From 2f1e9c11c029908d7117e95a131f47a3882819a7 Mon Sep 17 00:00:00 2001 From: byeoon <47872200+byeoon@users.noreply.github.com> Date: Mon, 29 Apr 2024 15:44:20 +0000 Subject: [PATCH] test might break --- dist/vendetta.js | 8 +++----- src/ui/settings/components/Card.tsx | 4 ++-- src/ui/settings/components/PluginCard.tsx | 14 +++++++++++++- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/dist/vendetta.js b/dist/vendetta.js index c0cb98d7..0c369860 100644 --- a/dist/vendetta.js +++ b/dist/vendetta.js @@ -1,12 +1,10 @@ -"use strict";(()=>{var Na=Object.defineProperty;var s=(e,t)=>()=>(e&&(t=e(e=0)),t);var T=(e,t)=>{for(var n in t)Na(e,n,{get:t[n],enumerable:!0})};var Ee,ye,v,et,ae,ie,se=s(()=>{"use strict";Ee=window.nativeModuleProxy,ye=Ee.MMKVManager;v=Ee.DCDFileManager??Ee.RTNFileManager;et=Ee.InfoDictionaryManager??Ee.RTNClientInfoManager;ae=Ee.DCDDeviceManager??Ee.RTNDeviceManager,ie=Ee.BundleUpdaterManager});var zt={};T(zt,{find:()=>K,findAll:()=>tt,findByDisplayName:()=>jt,findByDisplayNameAll:()=>La,findByName:()=>I,findByNameAll:()=>Ma,findByProps:()=>l,findByPropsAll:()=>Ba,findByStoreName:()=>we,findByTypeName:()=>Oa,findByTypeNameAll:()=>ka,modules:()=>$t});var Da,Er,yr,$t,K,tt,wr,br,_r,xr,Pa,l,Ba,I,Ma,jt,La,Oa,ka,we,y=s(()=>{"use strict";Da=window.ErrorUtils.getGlobalHandler(),Er=function(e){return Object.defineProperty(window.modules,e,{value:window.modules[e],enumerable:!1,configurable:!0,writable:!0})};for(let e in window.modules){let t=Number(e),n=window.modules[t]?.publicModule?.exports;if(!n||n===window||n.proxygone===null){Er(t);continue}}yr=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return function(n){let r=[];for(let o in e){let a=Number(o),i=e[a]?.publicModule?.exports;if(!e[a].isInitialized)try{window.ErrorUtils.setGlobalHandler(function(){}),__r(a),window.ErrorUtils.setGlobalHandler(Da)}catch{}if(!i){Er(a);continue}if(i.default&&i.__esModule&&n(i.default)){if(t)return i.default;r.push(i.default)}if(n(i)){if(t)return i;r.push(i)}}if(!t)return r}},$t=window.modules,K=yr($t,!0),tt=yr($t),wr=function(e){return function(t){return e.every(function(n){return t[n]!==void 0})}},br=function(e,t){return t?function(n){return n?.name===e}:function(n){return n?.default?.name===e}},_r=function(e,t){return t?function(n){return n?.displayName===e}:function(n){return n?.default?.displayName===e}},xr=function(e,t){return t?function(n){return n?.type?.name===e}:function(n){return n?.default?.type?.name===e}},Pa=function(e){return function(t){return t.getName&&t.getName.length===0&&t.getName()===e}},l=function(){for(var e=arguments.length,t=new Array(e),n=0;n1&&arguments[1]!==void 0?arguments[1]:!0;return K(br(e,t))},Ma=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return tt(br(e,t))},jt=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return K(_r(e,t))},La=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return tt(_r(e,t))},Oa=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return K(xr(e,t))},ka=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return tt(xr(e,t))},we=function(e){return K(Pa(e))}});function $(e,t){return dt(e,t,{walkable:["props","children","child","sibling"]})}var Sr=s(()=>{"use strict";ce()});function Wt(e,t,n,r){if(!(r>n.maxDepth)&&e){try{if(t(e))return e}catch{}if(Array.isArray(e)){for(let o of e)if(!(typeof o!="object"||o===null))try{let a=Wt(o,t,n,r+1);if(a)return a}catch{}}else if(typeof e=="object"){for(let o of Object.keys(e))if(!(typeof e[o]!="object"||e[o]===null)&&!(n.walkable.length&&!n.walkable.includes(o))&&!n.ignore.includes(o))try{let a=Wt(e[o],t,n,r+1);if(a)return a}catch{}}}}function dt(e,t){let{walkable:n=[],ignore:r=[],maxDepth:o=100}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Wt(e,t,{walkable:n,ignore:r,maxDepth:o},0)}var Tr=s(()=>{"use strict"});async function be(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1e4,r=await fetch(e,{signal:Fa(n),...t});if(!r.ok)throw new Error("Request returned non-ok");return r}function Fa(e){let t=new AbortController;return setTimeout(function(){return t.abort(`Timed out after ${e}ms`)},e),t.signal}var vr=s(()=>{"use strict"});function Kt(e){return Object.isFrozen(e)?Object.assign({},e):e}var Ir=s(()=>{"use strict"});function Y(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r{"use strict"});var Yt={};T(Yt,{findInReactTree:()=>$,findInTree:()=>dt,safeFetch:()=>be,unfreeze:()=>Kt,without:()=>Y});var ce=s(()=>{"use strict";Sr();Tr();vr();Ir();Ar()});var Xt,ne,pt=s(()=>{Xt=["a","b","i"],ne=new Map});function Cr(e,t,n,r,o){let a=ne.get(t)?.[e];if(!a)return o?Reflect.construct(t[e],n,r):t[e].apply(r,n);for(let u of a.b.values()){let d=u.call(r,n);Array.isArray(d)&&(n=d)}let i=[...a.i.values()].reduce(function(u,d){return function(){for(var p=arguments.length,P=new Array(p),B=0;B{pt()});function Zt(e,t,n,r){let o=ne.get(e),a=o?.[t];return a?.[r].has(n)?(a[r].delete(n),Xt.every(function(i){return a[i].size===0})&&(Reflect.defineProperty(e,t,{value:a.o,writable:!0,configurable:!0})||(e[t]=a.o),delete o[t]),Object.keys(o).length==0&&ne.delete(e),!0):!1}function Dr(){for(let[e,t]of ne.entries())for(let n in t)for(let r of Xt)for(let o of t[n]?.[r].keys()??[])Zt(e,n,o,r)}var qt=s(()=>{pt()});function gt(e){return function(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(typeof n[t]!="function")throw new Error(`${t} is not a function in ${n.constructor.name}`);ne.has(n)||ne.set(n,Object.create(null));let a=ne.get(n);if(!a[t]){let d=n[t];a[t]={o:d,b:new Map,i:new Map,a:new Map};let p=function(S,U,V){let Ne=Cr(t,n,U,S,V);return o&&u(),Ne},P=new Proxy(d,{apply:function(S,U,V){return p(U,V,!1)},construct:function(S,U){return p(d,U,!0)},get:function(S,U,V){return U=="toString"?d.toString.bind(d):Reflect.get(S,U,V)}});Reflect.defineProperty(n,t,{value:P,configurable:!0,writable:!0})||(n[t]=P)}let i=Symbol(),u=function(){return Zt(n,t,i,e)};return a[t][e].set(i,r),u}}var Pr=s(()=>{Nr();pt();qt()});var Qt={};T(Qt,{after:()=>R,before:()=>Jt,instead:()=>X,unpatchAll:()=>Dr});var Jt,X,R,en=s(()=>{Pr();qt();Jt=gt("b"),X=gt("i"),R=gt("a")});var Br,A=s(()=>{"use strict";en();en();Br={...Qt}});function nn(){return{listeners:Object.values(tn).reduce(function(e,t){return e[t]=new Set,e},{}),on(e,t){this.listeners[e].has(t)||this.listeners[e].add(t)},off(e,t){this.listeners[e].delete(t)},once(e,t){var n=this;let r=function(o,a){n.off(o,r),t(o,a)};this.on(e,r)},emit(e,t){for(let n of this.listeners[e])n(e,t)}}}var tn,Mr=s(()=>{"use strict";(function(e){e.GET="GET",e.SET="SET",e.DEL="DEL"})(tn||(tn={}))});var Lr,rn,Or,on,_e,$e,kr=s(()=>{"use strict";se();g();Lr=/[<>:"\/\\|?*]/g,rn=function(e){return f.Platform.select({default:e,ios:v.saveFileToGallery?e:`Documents/${e}`})},Or=function(e){return Lr.test(e)&&(e=e.replace(Lr,"-").replace(/-+/g,"-")),`vd_mmkv/${e}`},on=async function(e){await ye.getItem(e)&&ye.removeItem(e);let t=Or(e);await v.fileExists(`${v.getConstants().DocumentsDirPath}/${t}`)&&await v.removeFile?.("documents",t)},_e=function(e){let t=Or(e);return $e(t,async function(){try{let n=`${v.getConstants().DocumentsDirPath}/${t}`;if(await v.fileExists(n))return;let r=await ye.getItem(e)??"{}";if(r==="!!LARGE_VALUE!!"){let o=`${v.getConstants().CacheDirPath}/mmkv/${e}`;await v.fileExists(o)?r=await v.readFile(o,"utf8"):(console.log(`${e}: Experienced data loss :(`),r="{}")}await v.writeFile("documents",rn(t),r,"utf8"),await ye.getItem(e)!==null&&(ye.removeItem(e),console.log(`Successfully migrated ${e} store from MMKV storage to fs`))}catch(n){console.error("Failed to migrate to fs from MMKVManager ",n)}}())},$e=function(e,t){let n;return{get:async function(){await t;let r=`${v.getConstants().DocumentsDirPath}/${e}`;return!n&&!await v.fileExists(r)?(n=!0,v.writeFile("documents",rn(e),"{}","utf8")):JSON.parse(await v.readFile(r,"utf8"))},set:async function(r){await t,await v.writeFile("documents",rn(e),JSON.stringify(r),"utf8")}}}});var sn={};T(sn,{awaitSyncWrapper:()=>je,createFileBackend:()=>$e,createMMKVBackend:()=>_e,createProxy:()=>Vr,createStorage:()=>le,purgeStorage:()=>on,useProxy:()=>M,wrapSync:()=>xe});function Vr(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=nn();function n(r,o){return new Proxy(r,{get(a,i){if(i===Fr)return t;let u=[...o,i],d=a[i];return d!=null?(t.emit("GET",{path:u,value:d}),typeof d=="object"?n(d,u):d):d},set(a,i,u){return a[i]=u,t.emit("SET",{path:[...o,i],value:u}),!0},deleteProperty(a,i){let u=delete a[i];return u&&t.emit("DEL",{path:[...o,i]}),u}})}return{proxy:n(e,[]),emitter:t}}function M(e){if(e[an])throw e[an];let t=e[Fr];if(!t)throw new Error("InvalidArgumentExcpetion - storage[emitterSymbol] is "+typeof t);let[,n]=React.useReducer(function(r){return~r},0);return React.useEffect(function(){let r=function(){return n()};return t.on("SET",r),t.on("DEL",r),function(){t.off("SET",r),t.off("DEL",r)}},[]),e}async function le(e){let t=await e.get(),{proxy:n,emitter:r}=Vr(t),o=function(){return e.set(n)};return r.on("SET",o),r.on("DEL",o),n}function xe(e){let t,n,r=[],o=function(a){return t?a():r.push(a)};return e.then(function(a){t=a,r.forEach(function(i){return i()})}).catch(function(a){n=a}),new Proxy({},{...Object.fromEntries(Object.getOwnPropertyNames(Reflect).map(function(a){return[a,function(i){for(var u=arguments.length,d=new Array(u>1?u-1:0),p=1;p{"use strict";Mr();kr();Fr=Symbol.for("vendetta.storage.emitter"),Ur=Symbol.for("vendetta.storage.accessor"),an=Symbol.for("vendetta.storage.error");je=function(e){return new Promise(function(t){return e[Ur](t)})}});var cn,Ua,C,De=s(()=>{"use strict";y();cn=l("setLogFn").default,Ua=new cn("Opti"),C=Ua});var pn={};T(pn,{color:()=>ue,fetchTheme:()=>nt,getCurrentTheme:()=>Me,getThemes:()=>dn,initThemes:()=>mn,installTheme:()=>Pe,patchChatBackground:()=>un,removeTheme:()=>fn,selectTheme:()=>Be,themes:()=>L,updateThemes:()=>Hr});async function ln(e){if(typeof e!="object")throw new Error("Theme must be an object");await $e("vendetta_theme.json").set(e)}function un(){let e=Me()?.data?.background;if(!e)return;let t=I("MessagesWrapperConnected",!1);if(!t)return;let{MessagesWrapper:n}=l("MessagesWrapper");if(!n)return;let r=[R("default",t,function(o,a){return React.createElement(f.ImageBackground,{style:{flex:1,height:"100%"},source:{uri:e.url},blurRadius:typeof e.blur=="number"?e.blur:0,children:a})}),R("render",n.prototype,function(o,a){let i=$(a,function(u){return"HACK_fixModalInteraction"in u?.props&&u?.props?.style});i?i.props.style=Object.assign(f.StyleSheet.flatten(i.props.style??{}),{backgroundColor:"#0000"}):C.error("Didn't find Messages when patching MessagesWrapper!")})];return function(){return r.forEach(function(o){return o()})}}function Gr(e){if(fe.valid(e))return fe(e).hex();let t=Number(f.processColor(e));return fe.rgb(t>>16&255,t>>8&255,t&255,t>>24&255).hex()}function Ga(e){if(e.semanticColors){let t=e.semanticColors;for(let n in t)for(let r in t[n])t[n][r]&&=Gr(t[n][r])}if(e.rawColors){let t=e.rawColors;for(let n in t)e.rawColors[n]=Gr(t[n]);f.Platform.OS==="android"&&Ha(t)}return e}function Ha(e){let t={BLACK_ALPHA_60:["BLACK",.6],BRAND_NEW_360_ALPHA_20:["BRAND_360",.2],BRAND_NEW_360_ALPHA_25:["BRAND_360",.25],BRAND_NEW_500_ALPHA_20:["BRAND_500",.2],PRIMARY_DARK_500_ALPHA_20:["PRIMARY_500",.2],PRIMARY_DARK_700_ALPHA_60:["PRIMARY_700",.6],STATUS_GREEN_500_ALPHA_20:["GREEN_500",.2],STATUS_RED_500_ALPHA_20:["RED_500",.2]};for(let n in t){let[r,o]=t[n];e[r]&&(e[n]=fe(e[r]).alpha(o).hex())}}async function nt(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n;try{n=await(await be(e,{cache:"no-store"})).json()}catch{throw new Error(`Failed to fetch theme at ${e}`)}L[e]={id:e,selected:t,data:Ga(n)},t&&ln(L[e])}async function Pe(e){if(typeof e!="string"||e in L)throw new Error("Theme already installed");await nt(e)}async function Be(e){if(e==="default")return await ln({});let t=Object.values(L).find(function(n){return n.selected})?.id;t&&(L[t].selected=!1),L[e].selected=!0,await ln(L[e])}async function fn(e){let t=L[e];return t.selected&&await Be("default"),delete L[e],t.selected}function Me(){let e=window.__vendetta_loader?.features?.themes?.prop;return e&&window[e]||null}async function Hr(){await je(L);let e=Me();await Promise.allSettled(Object.keys(L).map(function(t){return nt(t,e?.id===t)}))}async function mn(){let e=Me();if(!e)return;let t=ue.default.unsafe_rawColors;ue.default.unsafe_rawColors=new Proxy(t,{get:function(n,r){return e?e.data?.rawColors?.[r]??Reflect.get(t,r):Reflect.get(t,r)}}),X("resolveSemanticColor",ue.default.meta??ue.default.internal,function(n,r){if(!e)return r(...n);let[o,a]=n,[i,u]=$r(o,a),d=o==="amoled"?2:o==="light"?1:0;let p=Va[i]??i,P=(e.data?.semanticColors?.[i]??e.data?.semanticColors?.[p])?.[d];if(i==="CHAT_BACKGROUND"&&typeof e.data?.background?.alpha=="number")return fe(P||"black").alpha(1-e.data.background.alpha).hex();if(P)return P;let B=e.data?.rawColors?.[u.raw];return B?u.opacity===1?B:fe(B).alpha(u.opacity).hex():r(...n)}),await Hr()}function $r(e,t){let n=t[$r._sym??=Object.getOwnPropertySymbols(t)[0]],r=ue.SemanticColor[n];return[n,r[e.toLowerCase()]]}function dn(){var e=0;return Object.keys(L).forEach(function(t){return e++}),e}var ue,L,Va,j=s(()=>{"use strict";g();ce();y();A();Z();De();ue=l("SemanticColor"),L=xe(le(_e("VENDETTA_THEMES"))),Va={BG_BACKDROP:"BACKGROUND_FLOATING",BG_BASE_PRIMARY:"BACKGROUND_PRIMARY",BG_BASE_SECONDARY:"BACKGROUND_SECONDARY",BG_BASE_TERTIARY:"BACKGROUND_SECONDARY_ALT",BG_MOD_FAINT:"BACKGROUND_MODIFIER_ACCENT",BG_MOD_STRONG:"BACKGROUND_MODIFIER_ACCENT",BG_MOD_SUBTLE:"BACKGROUND_MODIFIER_ACCENT",BG_SURFACE_OVERLAY:"BACKGROUND_FLOATING",BG_SURFACE_OVERLAY_TMP:"BACKGROUND_FLOATING",BG_SURFACE_RAISED:"BACKGROUND_MOBILE_PRIMARY"}});var ht,jr,f,fe,Rt=s(()=>{"use strict";j();A();ht=function(e){for(let t in window.modules){let n=window.modules[t]?.publicModule.exports;if(n&&e(n))return n}},jr=ht(function(e){return e?.default?.name==="requireNativeComponent"});jr&&X("default",jr,function(e,t){try{return t(...e)}catch{return e[0]}});window.React=ht(function(e){return e.createElement});f=ht(function(e){return e.AppRegistry}),fe=ht(function(e){return e.brewer});if(window.__vendetta_loader?.features.themes)try{mn()}catch(e){console.error("[Vendetta] Failed to initialize themes...",e)}});var wn={};T(wn,{AsyncUsers:()=>rt,Flux:()=>Ya,FluxDispatcher:()=>yt,Messages:()=>En,NavigationNative:()=>de,Profiles:()=>Le,React:()=>re,ReactNative:()=>f,User:()=>Te,assets:()=>ot,channels:()=>hn,chroma:()=>fe,clipboard:()=>G,commands:()=>Et,constants:()=>Se,i18n:()=>me,invites:()=>za,lodash:()=>wt,moment:()=>yn,navigation:()=>Wa,navigationStack:()=>Ka,stylesheet:()=>O,toasts:()=>Rn,url:()=>ze,util:()=>Xa});function ja(e){if(gn){for(let t in e)e[t]=new Proxy(f.StyleSheet.flatten(e[t]),{get(n,r,o){let a=Reflect.get(n,r,o);return zr.isSemanticColor(a)?zr.resolveSemanticColor($a.theme,a):a}});return e}}var $a,gn,zr,Se,hn,me,ze,Rn,Te,rt,Le,O,G,ot,za,Et,Wa,Ka,de,En,Ya,yt,re,yn,wt,Xa,g=s(()=>{"use strict";y();Rt();Rt();Rt();$a=we("ThemeStore"),gn=l("colors","unsafe_rawColors"),zr=gn?.internal??gn?.meta;Se=l("Fonts","Permissions"),hn=l("getVoiceChannelId"),me=l("Messages"),ze=l("openURL","openDeeplink"),Rn=K(function(e){return e.open&&e.close&&!e.startDrag&&!e.init&&!e.openReplay&&!e.setAlwaysOnTop&&!e.setAccountFlag}),Te=l("getCurrentUser"),rt=l("getUser","fetchProfile"),Le=l("showUserProfile"),O={...K(function(e){return e.createStyles&&!e.ActionSheet}),createThemedStyleSheet:ja,...l("createThemedStyleSheet")},G=l("setString","getString","hasString"),ot=l("registerAsset"),za=l("acceptInviteAndTransitionToInviteChannel"),Et=l("getBuiltInCommands"),Wa=l("pushLazy"),Ka=l("createStackNavigator"),de=l("NavigationContainer"),En=l("sendBotMessage"),Ya=l("connectStores"),yt=l("_currentDispatchActionType"),re=window.React,yn=l("isMoment"),wt=l("forEachRight"),Xa=l("inspect","isNullOrUndefined")});var _n={};T(_n,{all:()=>pe,find:()=>Za,getAssetByID:()=>Ja,getAssetByName:()=>qa,getAssetIDByName:()=>m,patchAssets:()=>bn});function bn(){let e=R("registerAsset",ot,function(t,n){let r=t[0];pe[r.name]={...r,id:n}});for(let t=1;;t++){let n=ot.getAssetByID(t);if(!n)break;pe[n.name]||(pe[n.name]={...n,id:t})}return e}var pe,Za,qa,Ja,m,_=s(()=>{"use strict";g();A();pe={};Za=function(e){return Object.values(pe).find(e)},qa=function(e){return pe[e]},Ja=function(e){return ot.getAssetByID(e)},m=function(e){return pe[e]?.id}});var xn={};T(xn,{showToast:()=>h});var Qa,h,oe=s(()=>{"use strict";y();g();({uuid4:Qa}=l("uuid4")),h=function(e,t){return Rn.open({key:`vd-toast-${Qa()}`,content:e,source:t,icon:t})}});var c,q,H=s(()=>{"use strict";Z();c=xe(le(_e("VENDETTA_SETTINGS"))),q=xe(le($e("vendetta_loader.json")))});var vn={};T(vn,{connectToDebugger:()=>Sn,getDebugInfo:()=>ge,patchLogHook:()=>Tn,socket:()=>z,toggleSafeMode:()=>at,versionHash:()=>bt});async function at(){c.safeMode={...c.safeMode,enabled:!c.safeMode?.enabled},window.__vendetta_loader?.features.themes&&(Me()?.id&&(c.safeMode.currentThemeId=Me().id),c.safeMode?.enabled?await Be("default"):c.safeMode?.currentThemeId&&await Be(c.safeMode?.currentThemeId)),setTimeout(ie.reload,400)}function Sn(e){if(z!==void 0&&z.readyState!==WebSocket.CLOSED&&z.close(),!e){h("Invalid debugger URL!",m("Small"));return}z=new WebSocket(`ws://${e}`),z.addEventListener("open",function(){return h("Connected to debugger.",m("Check"))}),z.addEventListener("message",function(t){try{(0,eval)(t.data)}catch(n){console.error(n)}}),z.addEventListener("error",function(t){console.log(`Debugger error: ${t.message}`),h("An error occurred with the debugger connection!",m("Small"))})}function Tn(){let e=R("nativeLoggingHook",globalThis,function(t){z?.readyState===WebSocket.OPEN&&z.send(JSON.stringify({message:t[0],level:t[1]})),C.log(t[0])});return function(){z&&z.close(),e()}}function ge(){let e=window.HermesInternal.getRuntimeProperties(),t=e["OSS Release Version"],n="for RN ",r=f.Platform.constants,o=r.reactNativeVersion;return{vendetta:{version:bt,loader:window.__vendetta_loader?.name??"Unknown"},discord:{version:et.Version,build:et.Build},react:{version:React.version,nativeVersion:t.startsWith(n)?t.substring(n.length):`${o.major}.${o.minor}.${o.patch}`},hermes:{version:t,buildType:e.Build,bytecodeVersion:e["Bytecode Version"]},...f.Platform.select({android:{os:{name:"Android",version:r.Release,sdk:r.Version}},ios:{os:{name:r.systemName,version:r.osVersion}}}),...f.Platform.select({android:{device:{manufacturer:r.Manufacturer,brand:r.Brand,model:r.Model,codename:ae.device}},ios:{device:{manufacturer:ae.deviceManufacturer,brand:ae.deviceBrand,model:ae.deviceModel,codename:ae.device}}})}}var z,bt,ve=s(()=>{"use strict";g();A();j();se();_();oe();H();De();bt="4a7259a"});var J,_t,Wr,We,it=s(()=>{(function(e){e.BRAND="brand",e.RED="red",e.GREEN="green",e.PRIMARY="primary",e.TRANSPARENT="transparent",e.GREY="grey",e.LIGHTGREY="lightgrey",e.WHITE="white",e.LINK="link"})(J||(J={}));(function(e){e[e.BUILT_IN=0]="BUILT_IN",e[e.BUILT_IN_TEXT=1]="BUILT_IN_TEXT",e[e.BUILT_IN_INTEGRATION=2]="BUILT_IN_INTEGRATION",e[e.BOT=3]="BOT",e[e.PLACEHOLDER=4]="PLACEHOLDER"})(_t||(_t={}));(function(e){e[e.SUB_COMMAND=1]="SUB_COMMAND",e[e.SUB_COMMAND_GROUP=2]="SUB_COMMAND_GROUP",e[e.STRING=3]="STRING",e[e.INTEGER=4]="INTEGER",e[e.BOOLEAN=5]="BOOLEAN",e[e.USER=6]="USER",e[e.CHANNEL=7]="CHANNEL",e[e.ROLE=8]="ROLE",e[e.MENTIONABLE=9]="MENTIONABLE",e[e.NUMBER=10]="NUMBER",e[e.ATTACHMENT=11]="ATTACHMENT"})(Wr||(Wr={}));(function(e){e[e.CHAT=1]="CHAT",e[e.USER=2]="USER",e[e.MESSAGE=3]="MESSAGE"})(We||(We={}))});var Nn={};T(Nn,{patchCommands:()=>An,registerCommand:()=>Cn});function An(){let e=R("getBuiltInCommands",Et,function(t,n){let[r]=t;if(r===We.CHAT)return[...n,...In]});return function(){In=[],e()}}function Cn(e){for(let t in e){let n=Et.getBuiltInCommands(We.CHAT,!0,!1);n.sort(function(a,i){return parseInt(i.id)-parseInt(a.id)});let r=n[n.length-1],o=e[t];e[t]={id:(parseInt(r.id,10)-1).toString(),displayName:o.name,displayDescription:o.description,type:We.CHAT,inputType:_t.BUILT_IN,applicationId:"Opti",...o,__isOpti:!0}}In.push(...e)}var In,xt=s(()=>{"use strict";it();g();A();In=[]});var ei,ti,ni,Kr,Yr=s(()=>{"use strict";ei=function(e){return{status:"fulfilled",value:e}},ti=function(e){return{status:"rejected",reason:e}},ni=function(e){return Promise.resolve(e).then(ei,ti)},Kr=function(e){return Promise.all(Array.from(e).map(ni))}});var Ln={};T(Ln,{evalPlugin:()=>Xr,fetchPlugin:()=>Ke,getPlugins:()=>Bn,getSettings:()=>Mn,initPlugins:()=>Pn,installPlugin:()=>Ae,plugins:()=>N,removePlugin:()=>Dn,startPlugin:()=>Ye,stopPlugin:()=>Xe});async function Ke(e){e.endsWith("/")||(e+="/");let t=N[e],n;try{n=await(await be(e+"manifest.json",{cache:"no-store"})).json()}catch{throw new Error(`Failed to fetch manifest for ${e}`)}let r;if(t?.manifest.hash!==n.hash)try{r=await(await be(e+(n.main||"index.js"),{cache:"no-store"})).text()}catch{}if(!r&&!t)throw new Error(`Failed to fetch JS for ${e}`);N[e]={id:e,manifest:n,enabled:t?.enabled??!1,update:t?.update??!0,js:r??t.js}}async function Ae(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.endsWith("/")||(e+="/"),typeof e!="string"||e in N)throw new Error("Plugin already installed");await Ke(e),t&&await Ye(e)}async function Xr(e){let t={...window.vendetta,plugin:{id:e.id,manifest:e.manifest,storage:await le(_e(e.id))},logger:new cn(`Vendetta \xBB ${e.manifest.name}`)},n=`vendetta=>{return ${e.js}} +"use strict";(()=>{var Na=Object.defineProperty;var s=(e,t)=>()=>(e&&(t=e(e=0)),t);var T=(e,t)=>{for(var n in t)Na(e,n,{get:t[n],enumerable:!0})};var Ee,ye,v,et,ae,ie,se=s(()=>{"use strict";Ee=window.nativeModuleProxy,ye=Ee.MMKVManager;v=Ee.DCDFileManager??Ee.RTNFileManager;et=Ee.InfoDictionaryManager??Ee.RTNClientInfoManager;ae=Ee.DCDDeviceManager??Ee.RTNDeviceManager,ie=Ee.BundleUpdaterManager});var zt={};T(zt,{find:()=>K,findAll:()=>tt,findByDisplayName:()=>jt,findByDisplayNameAll:()=>La,findByName:()=>I,findByNameAll:()=>Ma,findByProps:()=>l,findByPropsAll:()=>Ba,findByStoreName:()=>we,findByTypeName:()=>Oa,findByTypeNameAll:()=>ka,modules:()=>$t});var Da,Er,yr,$t,K,tt,wr,br,_r,xr,Pa,l,Ba,I,Ma,jt,La,Oa,ka,we,y=s(()=>{"use strict";Da=window.ErrorUtils.getGlobalHandler(),Er=function(e){return Object.defineProperty(window.modules,e,{value:window.modules[e],enumerable:!1,configurable:!0,writable:!0})};for(let e in window.modules){let t=Number(e),n=window.modules[t]?.publicModule?.exports;if(!n||n===window||n.proxygone===null){Er(t);continue}}yr=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return function(n){let r=[];for(let o in e){let a=Number(o),i=e[a]?.publicModule?.exports;if(!e[a].isInitialized)try{window.ErrorUtils.setGlobalHandler(function(){}),__r(a),window.ErrorUtils.setGlobalHandler(Da)}catch{}if(!i){Er(a);continue}if(i.default&&i.__esModule&&n(i.default)){if(t)return i.default;r.push(i.default)}if(n(i)){if(t)return i;r.push(i)}}if(!t)return r}},$t=window.modules,K=yr($t,!0),tt=yr($t),wr=function(e){return function(t){return e.every(function(n){return t[n]!==void 0})}},br=function(e,t){return t?function(n){return n?.name===e}:function(n){return n?.default?.name===e}},_r=function(e,t){return t?function(n){return n?.displayName===e}:function(n){return n?.default?.displayName===e}},xr=function(e,t){return t?function(n){return n?.type?.name===e}:function(n){return n?.default?.type?.name===e}},Pa=function(e){return function(t){return t.getName&&t.getName.length===0&&t.getName()===e}},l=function(){for(var e=arguments.length,t=new Array(e),n=0;n1&&arguments[1]!==void 0?arguments[1]:!0;return K(br(e,t))},Ma=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return tt(br(e,t))},jt=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return K(_r(e,t))},La=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return tt(_r(e,t))},Oa=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return K(xr(e,t))},ka=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return tt(xr(e,t))},we=function(e){return K(Pa(e))}});function $(e,t){return dt(e,t,{walkable:["props","children","child","sibling"]})}var Sr=s(()=>{"use strict";ce()});function Wt(e,t,n,r){if(!(r>n.maxDepth)&&e){try{if(t(e))return e}catch{}if(Array.isArray(e)){for(let o of e)if(!(typeof o!="object"||o===null))try{let a=Wt(o,t,n,r+1);if(a)return a}catch{}}else if(typeof e=="object"){for(let o of Object.keys(e))if(!(typeof e[o]!="object"||e[o]===null)&&!(n.walkable.length&&!n.walkable.includes(o))&&!n.ignore.includes(o))try{let a=Wt(e[o],t,n,r+1);if(a)return a}catch{}}}}function dt(e,t){let{walkable:n=[],ignore:r=[],maxDepth:o=100}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Wt(e,t,{walkable:n,ignore:r,maxDepth:o},0)}var Tr=s(()=>{"use strict"});async function be(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1e4,r=await fetch(e,{signal:Fa(n),...t});if(!r.ok)throw new Error("Request returned non-ok");return r}function Fa(e){let t=new AbortController;return setTimeout(function(){return t.abort(`Timed out after ${e}ms`)},e),t.signal}var vr=s(()=>{"use strict"});function Kt(e){return Object.isFrozen(e)?Object.assign({},e):e}var Ir=s(()=>{"use strict"});function Y(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r{"use strict"});var Yt={};T(Yt,{findInReactTree:()=>$,findInTree:()=>dt,safeFetch:()=>be,unfreeze:()=>Kt,without:()=>Y});var ce=s(()=>{"use strict";Sr();Tr();vr();Ir();Ar()});var Xt,ne,pt=s(()=>{Xt=["a","b","i"],ne=new Map});function Cr(e,t,n,r,o){let a=ne.get(t)?.[e];if(!a)return o?Reflect.construct(t[e],n,r):t[e].apply(r,n);for(let u of a.b.values()){let d=u.call(r,n);Array.isArray(d)&&(n=d)}let i=[...a.i.values()].reduce(function(u,d){return function(){for(var p=arguments.length,P=new Array(p),B=0;B{pt()});function Zt(e,t,n,r){let o=ne.get(e),a=o?.[t];return a?.[r].has(n)?(a[r].delete(n),Xt.every(function(i){return a[i].size===0})&&(Reflect.defineProperty(e,t,{value:a.o,writable:!0,configurable:!0})||(e[t]=a.o),delete o[t]),Object.keys(o).length==0&&ne.delete(e),!0):!1}function Dr(){for(let[e,t]of ne.entries())for(let n in t)for(let r of Xt)for(let o of t[n]?.[r].keys()??[])Zt(e,n,o,r)}var qt=s(()=>{pt()});function gt(e){return function(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(typeof n[t]!="function")throw new Error(`${t} is not a function in ${n.constructor.name}`);ne.has(n)||ne.set(n,Object.create(null));let a=ne.get(n);if(!a[t]){let d=n[t];a[t]={o:d,b:new Map,i:new Map,a:new Map};let p=function(S,U,V){let Ne=Cr(t,n,U,S,V);return o&&u(),Ne},P=new Proxy(d,{apply:function(S,U,V){return p(U,V,!1)},construct:function(S,U){return p(d,U,!0)},get:function(S,U,V){return U=="toString"?d.toString.bind(d):Reflect.get(S,U,V)}});Reflect.defineProperty(n,t,{value:P,configurable:!0,writable:!0})||(n[t]=P)}let i=Symbol(),u=function(){return Zt(n,t,i,e)};return a[t][e].set(i,r),u}}var Pr=s(()=>{Nr();pt();qt()});var Qt={};T(Qt,{after:()=>R,before:()=>Jt,instead:()=>X,unpatchAll:()=>Dr});var Jt,X,R,en=s(()=>{Pr();qt();Jt=gt("b"),X=gt("i"),R=gt("a")});var Br,A=s(()=>{"use strict";en();en();Br={...Qt}});function nn(){return{listeners:Object.values(tn).reduce(function(e,t){return e[t]=new Set,e},{}),on(e,t){this.listeners[e].has(t)||this.listeners[e].add(t)},off(e,t){this.listeners[e].delete(t)},once(e,t){var n=this;let r=function(o,a){n.off(o,r),t(o,a)};this.on(e,r)},emit(e,t){for(let n of this.listeners[e])n(e,t)}}}var tn,Mr=s(()=>{"use strict";(function(e){e.GET="GET",e.SET="SET",e.DEL="DEL"})(tn||(tn={}))});var Lr,rn,Or,on,_e,$e,kr=s(()=>{"use strict";se();g();Lr=/[<>:"\/\\|?*]/g,rn=function(e){return f.Platform.select({default:e,ios:v.saveFileToGallery?e:`Documents/${e}`})},Or=function(e){return Lr.test(e)&&(e=e.replace(Lr,"-").replace(/-+/g,"-")),`vd_mmkv/${e}`},on=async function(e){await ye.getItem(e)&&ye.removeItem(e);let t=Or(e);await v.fileExists(`${v.getConstants().DocumentsDirPath}/${t}`)&&await v.removeFile?.("documents",t)},_e=function(e){let t=Or(e);return $e(t,async function(){try{let n=`${v.getConstants().DocumentsDirPath}/${t}`;if(await v.fileExists(n))return;let r=await ye.getItem(e)??"{}";if(r==="!!LARGE_VALUE!!"){let o=`${v.getConstants().CacheDirPath}/mmkv/${e}`;await v.fileExists(o)?r=await v.readFile(o,"utf8"):(console.log(`${e}: Experienced data loss :(`),r="{}")}await v.writeFile("documents",rn(t),r,"utf8"),await ye.getItem(e)!==null&&(ye.removeItem(e),console.log(`Successfully migrated ${e} store from MMKV storage to fs`))}catch(n){console.error("Failed to migrate to fs from MMKVManager ",n)}}())},$e=function(e,t){let n;return{get:async function(){await t;let r=`${v.getConstants().DocumentsDirPath}/${e}`;return!n&&!await v.fileExists(r)?(n=!0,v.writeFile("documents",rn(e),"{}","utf8")):JSON.parse(await v.readFile(r,"utf8"))},set:async function(r){await t,await v.writeFile("documents",rn(e),JSON.stringify(r),"utf8")}}}});var sn={};T(sn,{awaitSyncWrapper:()=>je,createFileBackend:()=>$e,createMMKVBackend:()=>_e,createProxy:()=>Vr,createStorage:()=>le,purgeStorage:()=>on,useProxy:()=>M,wrapSync:()=>xe});function Vr(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=nn();function n(r,o){return new Proxy(r,{get(a,i){if(i===Fr)return t;let u=[...o,i],d=a[i];return d!=null?(t.emit("GET",{path:u,value:d}),typeof d=="object"?n(d,u):d):d},set(a,i,u){return a[i]=u,t.emit("SET",{path:[...o,i],value:u}),!0},deleteProperty(a,i){let u=delete a[i];return u&&t.emit("DEL",{path:[...o,i]}),u}})}return{proxy:n(e,[]),emitter:t}}function M(e){if(e[an])throw e[an];let t=e[Fr];if(!t)throw new Error("InvalidArgumentExcpetion - storage[emitterSymbol] is "+typeof t);let[,n]=React.useReducer(function(r){return~r},0);return React.useEffect(function(){let r=function(){return n()};return t.on("SET",r),t.on("DEL",r),function(){t.off("SET",r),t.off("DEL",r)}},[]),e}async function le(e){let t=await e.get(),{proxy:n,emitter:r}=Vr(t),o=function(){return e.set(n)};return r.on("SET",o),r.on("DEL",o),n}function xe(e){let t,n,r=[],o=function(a){return t?a():r.push(a)};return e.then(function(a){t=a,r.forEach(function(i){return i()})}).catch(function(a){n=a}),new Proxy({},{...Object.fromEntries(Object.getOwnPropertyNames(Reflect).map(function(a){return[a,function(i){for(var u=arguments.length,d=new Array(u>1?u-1:0),p=1;p{"use strict";Mr();kr();Fr=Symbol.for("vendetta.storage.emitter"),Ur=Symbol.for("vendetta.storage.accessor"),an=Symbol.for("vendetta.storage.error");je=function(e){return new Promise(function(t){return e[Ur](t)})}});var cn,Ua,C,De=s(()=>{"use strict";y();cn=l("setLogFn").default,Ua=new cn("Opti"),C=Ua});var pn={};T(pn,{color:()=>ue,fetchTheme:()=>nt,getCurrentTheme:()=>Me,getThemes:()=>dn,initThemes:()=>mn,installTheme:()=>Pe,patchChatBackground:()=>un,removeTheme:()=>fn,selectTheme:()=>Be,themes:()=>L,updateThemes:()=>Hr});async function ln(e){if(typeof e!="object")throw new Error("Theme must be an object");await $e("vendetta_theme.json").set(e)}function un(){let e=Me()?.data?.background;if(!e)return;let t=I("MessagesWrapperConnected",!1);if(!t)return;let{MessagesWrapper:n}=l("MessagesWrapper");if(!n)return;let r=[R("default",t,function(o,a){return React.createElement(f.ImageBackground,{style:{flex:1,height:"100%"},source:{uri:e.url},blurRadius:typeof e.blur=="number"?e.blur:0,children:a})}),R("render",n.prototype,function(o,a){let i=$(a,function(u){return"HACK_fixModalInteraction"in u?.props&&u?.props?.style});i?i.props.style=Object.assign(f.StyleSheet.flatten(i.props.style??{}),{backgroundColor:"#0000"}):C.error("Didn't find Messages when patching MessagesWrapper!")})];return function(){return r.forEach(function(o){return o()})}}function Gr(e){if(fe.valid(e))return fe(e).hex();let t=Number(f.processColor(e));return fe.rgb(t>>16&255,t>>8&255,t&255,t>>24&255).hex()}function Ga(e){if(e.semanticColors){let t=e.semanticColors;for(let n in t)for(let r in t[n])t[n][r]&&=Gr(t[n][r])}if(e.rawColors){let t=e.rawColors;for(let n in t)e.rawColors[n]=Gr(t[n]);f.Platform.OS==="android"&&Ha(t)}return e}function Ha(e){let t={BLACK_ALPHA_60:["BLACK",.6],BRAND_NEW_360_ALPHA_20:["BRAND_360",.2],BRAND_NEW_360_ALPHA_25:["BRAND_360",.25],BRAND_NEW_500_ALPHA_20:["BRAND_500",.2],PRIMARY_DARK_500_ALPHA_20:["PRIMARY_500",.2],PRIMARY_DARK_700_ALPHA_60:["PRIMARY_700",.6],STATUS_GREEN_500_ALPHA_20:["GREEN_500",.2],STATUS_RED_500_ALPHA_20:["RED_500",.2]};for(let n in t){let[r,o]=t[n];e[r]&&(e[n]=fe(e[r]).alpha(o).hex())}}async function nt(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n;try{n=await(await be(e,{cache:"no-store"})).json()}catch{throw new Error(`Failed to fetch theme at ${e}`)}L[e]={id:e,selected:t,data:Ga(n)},t&&ln(L[e])}async function Pe(e){if(typeof e!="string"||e in L)throw new Error("Theme already installed");await nt(e)}async function Be(e){if(e==="default")return await ln({});let t=Object.values(L).find(function(n){return n.selected})?.id;t&&(L[t].selected=!1),L[e].selected=!0,await ln(L[e])}async function fn(e){let t=L[e];return t.selected&&await Be("default"),delete L[e],t.selected}function Me(){let e=window.__vendetta_loader?.features?.themes?.prop;return e&&window[e]||null}async function Hr(){await je(L);let e=Me();await Promise.allSettled(Object.keys(L).map(function(t){return nt(t,e?.id===t)}))}async function mn(){let e=Me();if(!e)return;let t=ue.default.unsafe_rawColors;ue.default.unsafe_rawColors=new Proxy(t,{get:function(n,r){return e?e.data?.rawColors?.[r]??Reflect.get(t,r):Reflect.get(t,r)}}),X("resolveSemanticColor",ue.default.meta??ue.default.internal,function(n,r){if(!e)return r(...n);let[o,a]=n,[i,u]=$r(o,a),d=o==="amoled"?2:o==="light"?1:0;let p=Va[i]??i,P=(e.data?.semanticColors?.[i]??e.data?.semanticColors?.[p])?.[d];if(i==="CHAT_BACKGROUND"&&typeof e.data?.background?.alpha=="number")return fe(P||"black").alpha(1-e.data.background.alpha).hex();if(P)return P;let B=e.data?.rawColors?.[u.raw];return B?u.opacity===1?B:fe(B).alpha(u.opacity).hex():r(...n)}),await Hr()}function $r(e,t){let n=t[$r._sym??=Object.getOwnPropertySymbols(t)[0]],r=ue.SemanticColor[n];return[n,r[e.toLowerCase()]]}function dn(){var e=0;return Object.keys(L).forEach(function(t){return e++}),e}var ue,L,Va,j=s(()=>{"use strict";g();ce();y();A();Z();De();ue=l("SemanticColor"),L=xe(le(_e("VENDETTA_THEMES"))),Va={BG_BACKDROP:"BACKGROUND_FLOATING",BG_BASE_PRIMARY:"BACKGROUND_PRIMARY",BG_BASE_SECONDARY:"BACKGROUND_SECONDARY",BG_BASE_TERTIARY:"BACKGROUND_SECONDARY_ALT",BG_MOD_FAINT:"BACKGROUND_MODIFIER_ACCENT",BG_MOD_STRONG:"BACKGROUND_MODIFIER_ACCENT",BG_MOD_SUBTLE:"BACKGROUND_MODIFIER_ACCENT",BG_SURFACE_OVERLAY:"BACKGROUND_FLOATING",BG_SURFACE_OVERLAY_TMP:"BACKGROUND_FLOATING",BG_SURFACE_RAISED:"BACKGROUND_MOBILE_PRIMARY"}});var ht,jr,f,fe,Rt=s(()=>{"use strict";j();A();ht=function(e){for(let t in window.modules){let n=window.modules[t]?.publicModule.exports;if(n&&e(n))return n}},jr=ht(function(e){return e?.default?.name==="requireNativeComponent"});jr&&X("default",jr,function(e,t){try{return t(...e)}catch{return e[0]}});window.React=ht(function(e){return e.createElement});f=ht(function(e){return e.AppRegistry}),fe=ht(function(e){return e.brewer});if(window.__vendetta_loader?.features.themes)try{mn()}catch(e){console.error("[Vendetta] Failed to initialize themes...",e)}});var wn={};T(wn,{AsyncUsers:()=>rt,Flux:()=>Ya,FluxDispatcher:()=>yt,Messages:()=>En,NavigationNative:()=>de,Profiles:()=>Le,React:()=>re,ReactNative:()=>f,User:()=>Te,assets:()=>ot,channels:()=>hn,chroma:()=>fe,clipboard:()=>G,commands:()=>Et,constants:()=>Se,i18n:()=>me,invites:()=>za,lodash:()=>wt,moment:()=>yn,navigation:()=>Wa,navigationStack:()=>Ka,stylesheet:()=>O,toasts:()=>Rn,url:()=>ze,util:()=>Xa});function ja(e){if(gn){for(let t in e)e[t]=new Proxy(f.StyleSheet.flatten(e[t]),{get(n,r,o){let a=Reflect.get(n,r,o);return zr.isSemanticColor(a)?zr.resolveSemanticColor($a.theme,a):a}});return e}}var $a,gn,zr,Se,hn,me,ze,Rn,Te,rt,Le,O,G,ot,za,Et,Wa,Ka,de,En,Ya,yt,re,yn,wt,Xa,g=s(()=>{"use strict";y();Rt();Rt();Rt();$a=we("ThemeStore"),gn=l("colors","unsafe_rawColors"),zr=gn?.internal??gn?.meta;Se=l("Fonts","Permissions"),hn=l("getVoiceChannelId"),me=l("Messages"),ze=l("openURL","openDeeplink"),Rn=K(function(e){return e.open&&e.close&&!e.startDrag&&!e.init&&!e.openReplay&&!e.setAlwaysOnTop&&!e.setAccountFlag}),Te=l("getCurrentUser"),rt=l("getUser","fetchProfile"),Le=l("showUserProfile"),O={...K(function(e){return e.createStyles&&!e.ActionSheet}),createThemedStyleSheet:ja,...l("createThemedStyleSheet")},G=l("setString","getString","hasString"),ot=l("registerAsset"),za=l("acceptInviteAndTransitionToInviteChannel"),Et=l("getBuiltInCommands"),Wa=l("pushLazy"),Ka=l("createStackNavigator"),de=l("NavigationContainer"),En=l("sendBotMessage"),Ya=l("connectStores"),yt=l("_currentDispatchActionType"),re=window.React,yn=l("isMoment"),wt=l("forEachRight"),Xa=l("inspect","isNullOrUndefined")});var _n={};T(_n,{all:()=>pe,find:()=>Za,getAssetByID:()=>Ja,getAssetByName:()=>qa,getAssetIDByName:()=>m,patchAssets:()=>bn});function bn(){let e=R("registerAsset",ot,function(t,n){let r=t[0];pe[r.name]={...r,id:n}});for(let t=1;;t++){let n=ot.getAssetByID(t);if(!n)break;pe[n.name]||(pe[n.name]={...n,id:t})}return e}var pe,Za,qa,Ja,m,_=s(()=>{"use strict";g();A();pe={};Za=function(e){return Object.values(pe).find(e)},qa=function(e){return pe[e]},Ja=function(e){return ot.getAssetByID(e)},m=function(e){return pe[e]?.id}});var xn={};T(xn,{showToast:()=>h});var Qa,h,oe=s(()=>{"use strict";y();g();({uuid4:Qa}=l("uuid4")),h=function(e,t){return Rn.open({key:`vd-toast-${Qa()}`,content:e,source:t,icon:t})}});var c,q,H=s(()=>{"use strict";Z();c=xe(le(_e("VENDETTA_SETTINGS"))),q=xe(le($e("vendetta_loader.json")))});var vn={};T(vn,{connectToDebugger:()=>Sn,getDebugInfo:()=>ge,patchLogHook:()=>Tn,socket:()=>z,toggleSafeMode:()=>at,versionHash:()=>bt});async function at(){c.safeMode={...c.safeMode,enabled:!c.safeMode?.enabled},window.__vendetta_loader?.features.themes&&(Me()?.id&&(c.safeMode.currentThemeId=Me().id),c.safeMode?.enabled?await Be("default"):c.safeMode?.currentThemeId&&await Be(c.safeMode?.currentThemeId)),setTimeout(ie.reload,400)}function Sn(e){if(z!==void 0&&z.readyState!==WebSocket.CLOSED&&z.close(),!e){h("Invalid debugger URL!",m("Small"));return}z=new WebSocket(`ws://${e}`),z.addEventListener("open",function(){return h("Connected to debugger.",m("Check"))}),z.addEventListener("message",function(t){try{(0,eval)(t.data)}catch(n){console.error(n)}}),z.addEventListener("error",function(t){console.log(`Debugger error: ${t.message}`),h("An error occurred with the debugger connection!",m("Small"))})}function Tn(){let e=R("nativeLoggingHook",globalThis,function(t){z?.readyState===WebSocket.OPEN&&z.send(JSON.stringify({message:t[0],level:t[1]})),C.log(t[0])});return function(){z&&z.close(),e()}}function ge(){let e=window.HermesInternal.getRuntimeProperties(),t=e["OSS Release Version"],n="for RN ",r=f.Platform.constants,o=r.reactNativeVersion;return{vendetta:{version:bt,loader:window.__vendetta_loader?.name??"Unknown"},discord:{version:et.Version,build:et.Build},react:{version:React.version,nativeVersion:t.startsWith(n)?t.substring(n.length):`${o.major}.${o.minor}.${o.patch}`},hermes:{version:t,buildType:e.Build,bytecodeVersion:e["Bytecode Version"]},...f.Platform.select({android:{os:{name:"Android",version:r.Release,sdk:r.Version}},ios:{os:{name:r.systemName,version:r.osVersion}}}),...f.Platform.select({android:{device:{manufacturer:r.Manufacturer,brand:r.Brand,model:r.Model,codename:ae.device}},ios:{device:{manufacturer:ae.deviceManufacturer,brand:ae.deviceBrand,model:ae.deviceModel,codename:ae.device}}})}}var z,bt,ve=s(()=>{"use strict";g();A();j();se();_();oe();H();De();bt="1088831"});var J,_t,Wr,We,it=s(()=>{(function(e){e.BRAND="brand",e.RED="red",e.GREEN="green",e.PRIMARY="primary",e.TRANSPARENT="transparent",e.GREY="grey",e.LIGHTGREY="lightgrey",e.WHITE="white",e.LINK="link"})(J||(J={}));(function(e){e[e.BUILT_IN=0]="BUILT_IN",e[e.BUILT_IN_TEXT=1]="BUILT_IN_TEXT",e[e.BUILT_IN_INTEGRATION=2]="BUILT_IN_INTEGRATION",e[e.BOT=3]="BOT",e[e.PLACEHOLDER=4]="PLACEHOLDER"})(_t||(_t={}));(function(e){e[e.SUB_COMMAND=1]="SUB_COMMAND",e[e.SUB_COMMAND_GROUP=2]="SUB_COMMAND_GROUP",e[e.STRING=3]="STRING",e[e.INTEGER=4]="INTEGER",e[e.BOOLEAN=5]="BOOLEAN",e[e.USER=6]="USER",e[e.CHANNEL=7]="CHANNEL",e[e.ROLE=8]="ROLE",e[e.MENTIONABLE=9]="MENTIONABLE",e[e.NUMBER=10]="NUMBER",e[e.ATTACHMENT=11]="ATTACHMENT"})(Wr||(Wr={}));(function(e){e[e.CHAT=1]="CHAT",e[e.USER=2]="USER",e[e.MESSAGE=3]="MESSAGE"})(We||(We={}))});var Nn={};T(Nn,{patchCommands:()=>An,registerCommand:()=>Cn});function An(){let e=R("getBuiltInCommands",Et,function(t,n){let[r]=t;if(r===We.CHAT)return[...n,...In]});return function(){In=[],e()}}function Cn(e){for(let t in e){let n=Et.getBuiltInCommands(We.CHAT,!0,!1);n.sort(function(a,i){return parseInt(i.id)-parseInt(a.id)});let r=n[n.length-1],o=e[t];e[t]={id:(parseInt(r.id,10)-1).toString(),displayName:o.name,displayDescription:o.description,type:We.CHAT,inputType:_t.BUILT_IN,applicationId:"Opti",...o,__isOpti:!0}}In.push(...e)}var In,xt=s(()=>{"use strict";it();g();A();In=[]});var ei,ti,ni,Kr,Yr=s(()=>{"use strict";ei=function(e){return{status:"fulfilled",value:e}},ti=function(e){return{status:"rejected",reason:e}},ni=function(e){return Promise.resolve(e).then(ei,ti)},Kr=function(e){return Promise.all(Array.from(e).map(ni))}});var Ln={};T(Ln,{evalPlugin:()=>Xr,fetchPlugin:()=>Ke,getPlugins:()=>Bn,getSettings:()=>Mn,initPlugins:()=>Pn,installPlugin:()=>Ae,plugins:()=>N,removePlugin:()=>Dn,startPlugin:()=>Ye,stopPlugin:()=>Xe});async function Ke(e){e.endsWith("/")||(e+="/");let t=N[e],n;try{n=await(await be(e+"manifest.json",{cache:"no-store"})).json()}catch{throw new Error(`Failed to fetch manifest for ${e}`)}let r;if(t?.manifest.hash!==n.hash)try{r=await(await be(e+(n.main||"index.js"),{cache:"no-store"})).text()}catch{}if(!r&&!t)throw new Error(`Failed to fetch JS for ${e}`);N[e]={id:e,manifest:n,enabled:t?.enabled??!1,update:t?.update??!0,js:r??t.js}}async function Ae(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.endsWith("/")||(e+="/"),typeof e!="string"||e in N)throw new Error("Plugin already installed");await Ke(e),t&&await Ye(e)}async function Xr(e){let t={...window.vendetta,plugin:{id:e.id,manifest:e.manifest,storage:await le(_e(e.id))},logger:new cn(`Vendetta \xBB ${e.manifest.name}`)},n=`vendetta=>{return ${e.js}} //# sourceURL=${e.id}`,r=(0,eval)(n)(t),o=typeof r=="function"?r():r;return o?.default??o??{}}async function Ye(e){e.endsWith("/")||(e+="/");let t=N[e];if(!t)throw new Error("Attempted to start non-existent plugin");try{if(!c.safeMode?.enabled){let n=await Xr(t);Ie[e]=n,n.onLoad?.()}t.enabled=!0}catch(n){C.error(`Plugin ${t.id} errored whilst loading, and will be unloaded`,n);try{Ie[t.id]?.onUnload?.()}catch(r){C.error(`Plugin ${t.id} errored whilst unloading`,r)}delete Ie[e],t.enabled=!1}}function Xe(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;e.endsWith("/")||(e+="/");let n=N[e],r=Ie[e];if(!n)throw new Error("Attempted to stop non-existent plugin");if(!c.safeMode?.enabled){try{r?.onUnload?.()}catch(o){C.error(`Plugin ${n.id} errored whilst unloading`,o)}delete Ie[e]}t&&(n.enabled=!1)}async function Dn(e){e.endsWith("/")||(e+="/"),N[e].enabled&&Xe(e),delete N[e],await on(e)}async function Pn(){await je(c),await je(N);let e=Object.keys(N);return c.safeMode?.enabled||(await Kr(e.filter(function(t){return N[t].enabled}).map(async function(t){return N[t].update&&await Ke(t).catch(function(n){return C.error(n.message)}),await Ye(t)})),e.filter(function(t){return!N[t].enabled&&N[t].update}).forEach(function(t){return Ke(t)})),ri}function Bn(){var e=0;return Object.keys(Ie).forEach(function(t){return e++}),e}var N,Ie,ri,Mn,he=s(()=>{"use strict";ce();Z();Yr();De();H();N=xe(le(_e("VENDETTA_PLUGINS"))),Ie={};ri=function(){return Object.keys(Ie).forEach(function(e){return Xe(e,!1)})};Mn=function(e){return Ie[e]?.settings}});var Vn={};T(Vn,{BADGES:()=>oi,DISCORD_SERVER:()=>On,DISCORD_SERVER_ID:()=>kn,GITHUB:()=>Un,HTTP_REGEX:()=>ai,HTTP_REGEX_MULTI:()=>ct,PLUGINS_CHANNEL_ID:()=>Fn,PROXY_PREFIX:()=>Oe,THEMES_CHANNEL_ID:()=>st});var On,kn,Fn,st,Un,oi,Oe,ai,ct,ke=s(()=>{"use strict";On="https://discord.gg/zm5MWBPeRp",kn="1228081962883747880",Fn="1228464451846672465",st="1228464459295756358",Un="https://github.com/opti-mod",oi="https://raw.githubusercontent.com/opti-mod/badges/main/",Oe="https://vd-plugins.github.io/proxy",ai=/^https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_\+.~#?&\/=]*)$/,ct=/https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_\+.~#?&//=]*)/g});function Fe(e){let{label:t,icon:n,noPadding:r=!1,noAnimation:o=!1,children:a}=e,{FormRow:i,FormDivider:u}=E,[d,p]=React.useState(!0);return React.createElement(React.Fragment,null,React.createElement(i,{label:t,leading:n&&React.createElement(i.Icon,{source:m(n)}),trailing:React.createElement(i.Arrow,{style:{transform:[{rotate:`${d?180:90}deg`}]}}),onPress:function(){p(!d),o||f.LayoutAnimation.configureNext(f.LayoutAnimation.Presets.easeInEaseOut)}}),!d&&React.createElement(React.Fragment,null,React.createElement(u,null),React.createElement(f.View,{style:!r&&{paddingHorizontal:15}},a)))}var Zr=s(()=>{"use strict";g();_();D()});function qr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Jr=s(()=>{});function Qr(e,t){for(var n=0;n{});function no(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ro=s(()=>{});function St(e,t){return St=Object.setPrototypeOf||function(r,o){return r.__proto__=o,r},St(e,t)}var oo=s(()=>{});function ao(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&St(e,t)}var io=s(()=>{oo()});function lt(e){return lt=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},lt(e)}var so=s(()=>{});function co(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var lo=s(()=>{});function uo(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var fo=s(()=>{});function mo(e){"@swc/helpers - typeof";return e&&typeof Symbol<"u"&&e.constructor===Symbol?"symbol":typeof e}var po=s(()=>{});function go(e,t){return t&&(mo(t)==="object"||typeof t=="function")?t:uo(e)}var ho=s(()=>{fo();po()});function Ro(e){var t=co();return function(){var r=lt(e),o;if(t){var a=lt(this).constructor;o=Reflect.construct(r,arguments,a)}else o=r.apply(this,arguments);return go(this,o)}}var Eo=s(()=>{so();lo();ho()});var Tt,ii,x,Gn=s(()=>{"use strict";Jr();to();ro();io();Eo();g();D();Tt=O.createThemedStyleSheet({view:{flex:1,flexDirection:"column",margin:10},title:{fontSize:20,textAlign:"center",marginBottom:5},br:{fontSize:0,padding:1}}),x=function(e){"use strict";ao(n,e);var t=Ro(n);function n(r){qr(this,n);var o;return o=t.call(this,r),o.state={hasErr:!1},o}return eo(n,[{key:"render",value:function(){var o=this;return this.state.hasErr?re.createElement(f.ScrollView,{style:Tt.view},re.createElement(E.FormText,{style:Tt.title},"Opti has encountered an error."),re.createElement(Ce,{selectable:!0,style:{marginBottom:5,maxHeight:400}},this.state.errStack),re.createElement(E.FormText,{style:Tt.br}," "),re.createElement(W,{color:W.Colors.RED,size:W.Sizes.MEDIUM,look:W.Looks.FILLED,onPress:function(){return o.setState({hasErr:!1})},text:"Retry"}),re.createElement(E.FormText,{style:Tt.br}," "),re.createElement(W,{color:W.Colors.BRAND,size:W.Sizes.MEDIUM,look:W.Looks.FILLED,onPress:function(){return G.setString(""+o.state.errStack)},text:"Copy"})):this.props.children}}]),n}(ii=re.Component);no(x,"getDerivedStateFromError",function(e){return{hasErr:!0,errText:e.message,errName:e.name,errCause:e.cause,errStack:e.stack}})});var Hn={};T(Hn,{rawColors:()=>si,semanticColors:()=>b});var b,si,Ue=s(()=>{"use strict";g();j();b=ue?.default?.colors??Se?.ThemeColorMap,si=ue?.default?.unsafe_rawColors??Se?.Colors});function Ce(e){let{selectable:t,style:n,children:r}=e;return t?f.Platform.select({ios:React.createElement(ci,{style:n,children:r}),default:React.createElement(yo,{style:n,children:r,selectable:!0})}):React.createElement(yo,{style:n,children:r})}var wo,ci,yo,bo=s(()=>{"use strict";g();Ue();wo=O.createThemedStyleSheet({codeBlock:{fontFamily:Se.Fonts.CODE_SEMIBOLD,fontSize:12,textAlignVertical:"center",backgroundColor:b.BACKGROUND_SECONDARY,color:b.TEXT_NORMAL,borderWidth:1,borderRadius:4,borderColor:b.BACKGROUND_TERTIARY,padding:10}}),ci=function(e){let{style:t,children:n}=e;return React.createElement(f.TextInput,{editable:!1,multiline:!0,style:[wo.codeBlock,t&&t],value:n})},yo=function(e){let{selectable:t,style:n,children:r}=e;return React.createElement(f.Text,{selectable:t,style:[wo.codeBlock,n&&n]},r)}});function Ze(e){let{onChangeText:t,placeholder:n,style:r}=e;return React.createElement(li,{style:[ui.search,r],placeholder:n,onChangeText:t})}var li,ui,_o=s(()=>{"use strict";g();y();li=I("StaticSearchBarContainer"),ui=O.createThemedStyleSheet({search:{margin:0,padding:0,borderBottomWidth:0,backgroundColor:"none"}})});var Wn={};T(Wn,{Alert:()=>$n,Button:()=>W,Codeblock:()=>Ce,ErrorBoundary:()=>x,Forms:()=>E,General:()=>fi,HelpMessage:()=>jn,SafeAreaView:()=>zn,Search:()=>Ze,Summary:()=>Fe});var E,fi,$n,W,jn,zn,D=s(()=>{"use strict";y();Zr();Gn();bo();_o();E=l("Form","FormSection"),fi=l("Button","Text","View"),$n=jt("FluxContainer(Alert)"),W=l("Looks","Colors","Sizes"),jn=I("HelpMessage"),zn=l("useSafeAreaInsets").SafeAreaView});function xo(){return R("default",mi,function(e,t){let[{thread:n}]=e;if(n.guild_id!==kn)return;let r;if(n.parent_id===Fn)r="Plugin";else if(n.parent_id===st&&window.__vendetta_loader?.features.themes)r="Theme";else return;let{firstMessage:o}=gi(n),a=o?.content?.match(ct);if(!a)return;r==="Plugin"?a=a.filter(function(p){return p.startsWith(Oe)}):a=a.filter(function(p){return p.endsWith(".json")});let i=a[0];if(!i)return;let u=$(t,function(p){return p?.[0]?.key}),d=u[0].type;u.unshift(React.createElement(d,{key:"install"},React.createElement(di,{leading:React.createElement(pi,{style:{opacity:1},source:m("ic_download_24px")}),label:`Install ${r}`,onPress:function(){return(r==="Plugin"?Ae:Pe)(i).then(function(){h(`Successfully installed ${n.name}`,m("Check"))}).catch(function(p){h(p.message,m("Small"))}).finally(function(){return hi()})}})))})}var mi,di,pi,gi,hi,So=s(()=>{"use strict";y();ke();A();he();j();ce();_();oe();D();mi=I("ForumPostLongPressActionSheet",!1),{FormRow:di,FormIcon:pi}=E,{useFirstForumPostMessage:gi}=l("useFirstForumPostMessage"),{hideActionSheet:hi}=l("openLazy","hideActionSheet")});function Kn(e){let{title:t,confirmText:n,confirmColor:r,onConfirm:o,cancelText:a,placeholder:i,initialValue:u="",secureTextEntry:d}=e,[p,P]=React.useState(u),[B,S]=React.useState("");function U(){Promise.resolve(o(p)).then(function(){To.close()}).catch(function(Ne){S(Ne.message)})}return React.createElement($n,{title:t,confirmText:n,confirmColor:r,isConfirmButtonDisabled:B.length!==0,onConfirm:U,cancelText:a,onCancel:function(){return To.close()}},React.createElement(Ri,{placeholder:i,value:p,onChange:function(V){P(typeof V=="string"?V:V.text),B&&S("")},returnKeyType:"done",onSubmitEditing:U,error:B||void 0,secureTextEntry:d,autoFocus:!0,showBorder:!0,style:{paddingVertical:5,alignSelf:"stretch",paddingHorizontal:0}}))}var Ri,To,vo=s(()=>{"use strict";y();D();({FormInput:Ri}=E),To=l("openLazy","close")});var Xn={};T(Xn,{showConfirmationAlert:()=>Q,showCustomAlert:()=>Ao,showInputAlert:()=>Yn});function Q(e){let t=e;return t.body=e.content,delete t.content,t.isDismissable??=!0,Io.show(t)}var Io,Ao,Yn,Ve=s(()=>{"use strict";y();vo();Io=l("openLazy","close");Ao=function(e,t){return Io.openLazy({importer:async function(){return function(){return React.createElement(e,t)}}})},Yn=function(e){return Ao(Kn,e)}});function Co(e){return e.startsWith(Oe)?"Plugin":e.endsWith(".json")&&window.__vendetta_loader?.features.themes?"Theme":void 0}function No(e,t){(e==="Plugin"?Ae:Pe)(t).then(function(){h("Successfully installed",m("Check"))}).catch(function(n){h(n.message,m("Small"))})}function Do(){let e=new Array;return e.push(R("showSimpleActionSheet",Ei,function(t){if(t[0].key!=="LongPressUrl")return;let{header:{title:n},options:r}=t[0],o=Co(n);o&&r.push({label:`Install ${o}`,onPress:function(){return No(o,n)}})})),e.push(X("handleClick",yi,async function(t,n){let{href:r}=t[0],o=Co(r);if(!o)return n.apply(this,t);if(o==="Theme"&&_i(bi())?.parent_id!==st)return n.apply(this,t);Q({title:"Hold Up",content:["This link is a ",React.createElement(f.Text,{style:xi["text-md/semibold"]},o),", would you like to install it?"],onConfirm:function(){return No(o,r)},confirmText:"Install",cancelText:"Cancel",secondaryConfirmText:"Open in Browser",onConfirmSecondary:function(){return wi(r)}})})),function(){return e.forEach(function(t){return t()})}}var Ei,yi,wi,bi,_i,xi,Po=s(()=>{"use strict";y();g();ke();A();he();j();Ve();_();oe();Ei=K(function(e){return e?.showSimpleActionSheet&&!Object.getOwnPropertyDescriptor(e,"showSimpleActionSheet")?.get}),yi=l("handleClick"),{openURL:wi}=ze,{getChannelId:bi}=hn,{getChannel:_i}=l("getChannel"),{TextStyleSheet:xi}=l("TextStyleSheet")});function Zn(){let e=new Array;return e.push(xo()),e.push(Do()),function(){return e.forEach(function(t){return t()})}}var Bo=s(()=>{"use strict";So();Po()});function Oo(){return R("render",Si.prototype,function(e,t){var n=this;if(!this.state.error)return;let r=ge();this.state.activeTab??="message";let o=Lo.find(function(u){return u.id===n.state.activeTab}),a=this.state.error[this.state.activeTab],i=[{text:"Restart Discord",onPress:this.handleReload},...c.safeMode?.enabled?[]:[{text:"Restart in Safe Mode",onPress:at}],{text:"Retry Render",color:J.RED,onPress:function(){return n.setState({info:null,error:null})}}];return React.createElement(x,null,React.createElement(zn,{style:ut.container},React.createElement(f.View,{style:ut.header},t.props.Illustration&&React.createElement(t.props.Illustration,{style:{flex:1,resizeMode:"contain",maxHeight:96,paddingRight:4}}),React.createElement(f.View,{style:{flex:2,paddingLeft:4}},React.createElement(f.Text,{style:ut.headerTitle},t.props.title),React.createElement(f.Text,{style:ut.headerDescription},t.props.body))),React.createElement(f.View,{style:{flex:6}},React.createElement(f.View,{style:{paddingBottom:8}},React.createElement(Ti,{tabs:Lo,activeTab:this.state.activeTab,onTabSelected:function(u){n.setState({activeTab:u})}})),React.createElement(Ce,{selectable:!0,style:{flexBasis:"auto",marginBottom:8}},[`Discord: ${r.discord.build} (${r.os.name})`,`Vendetta: ${r.vendetta.version}`].join(` `)),React.createElement(Ce,{selectable:!0,style:{flex:1,textAlignVertical:"top"}},o?.trimWhitespace?a.split(` `).filter(function(u){return u.length!==0}).map(function(u){return u.trim()}).join(` `):a)),React.createElement(f.View,{style:ut.footer},i.map(function(u){let d=i.indexOf(u)!==0?8:0;return React.createElement(W,{text:u.text,color:u.color??J.BRAND,size:u.size??"small",onPress:u.onPress,style:ae.isTablet?{flex:`0.${i.length}`,marginLeft:d}:{marginTop:d}})}))))})}var Si,Ti,Mo,ut,Lo,ko=s(()=>{"use strict";it();g();y();A();ve();se();Ue();D();H();Si=I("ErrorBoundary"),{BadgableTabBar:Ti}=l("BadgableTabBar"),{TextStyleSheet:Mo}=l("TextStyleSheet"),ut=O.createThemedStyleSheet({container:{flex:1,backgroundColor:b.BACKGROUND_PRIMARY,paddingHorizontal:16},header:{flex:1,flexDirection:"row",justifyContent:"center",alignItems:"center",marginVertical:8},headerTitle:{...Mo["heading-md/semibold"],textAlign:"center",textTransform:"uppercase",color:b.HEADER_PRIMARY},headerDescription:{...Mo["text-sm/medium"],textAlign:"center",color:b.TEXT_MUTED},footer:{flexDirection:ae.isTablet?"row":"column",justifyContent:"flex-end",marginVertical:8}}),Lo=[{id:"message",title:"Message"},{id:"stack",title:"Stack Trace"},{id:"componentStack",title:"Component",trimWhitespace:!0}]});function qn(e){let{alertTitle:t,installFunction:n}=e;return React.createElement(f.TouchableOpacity,{onPress:function(){return G.getString().then(function(r){return Yn({title:t,initialValue:r.match(ct)?.[0]??"",placeholder:"https://example.com/",onConfirm:function(o){return n(o)},confirmText:"Install",cancelText:"Cancel"})})}},React.createElement(f.Image,{style:vi.icon,source:m("ic_add_24px")}))}var vi,Fo=s(()=>{"use strict";g();ke();Ve();_();Ue();vi=O.createThemedStyleSheet({icon:{marginRight:10,tintColor:b.HEADER_PRIMARY}})});function Jn(e){let{asset:t}=e;return React.createElement(Ii,{label:`${t.name} - ${t.id}`,trailing:React.createElement(f.Image,{source:t.id,style:{width:32,height:32}}),onPress:function(){G.setString(t.name),h("Copied asset name to clipboard.",m("toast_copy_link"))}})}var Ii,Uo=s(()=>{"use strict";g();oe();_();D();({FormRow:Ii}=E)});function Qn(){let[e,t]=React.useState("");return React.createElement(x,null,React.createElement(f.View,{style:{flex:1}},React.createElement(Ze,{style:{margin:10},onChangeText:function(n){return t(n)},placeholder:"Search Assets"}),React.createElement(f.FlatList,{data:Object.values(pe).filter(function(n){return n.name.includes(e)||n.id.toString()===e}),renderItem:function(n){let{item:r}=n;return React.createElement(Jn,{asset:r})},ItemSeparatorComponent:Ai,keyExtractor:function(n){return n.name}})))}var Ai,Vo=s(()=>{"use strict";g();_();D();Uo();({FormDivider:Ai}=E)});function Ge(e){let{label:t,version:n,icon:r}=e;return React.createElement(Go,{label:t,leading:React.createElement(Go.Icon,{source:m(r)}),trailing:React.createElement(Ci,{style:{fontSize:13}},n),onPress:function(){G.setString(`${t} - ${n}`),h("Copied version to clipboard.",m("toast_copy_link"))}})}var Go,Ci,Ho=s(()=>{"use strict";g();_();oe();D();({FormRow:Go,FormText:Ci}=E)});function er(){let e=de.useNavigation();M(c),M(q);let t=[{label:"Discord Version",version:`${F.discord.version} (${F.discord.build})`,icon:"Discord"},{label:"React",version:F.react.version,icon:"ic_category_16px"},{label:"React Native",version:F.react.nativeVersion,icon:"mobile"},{label:"Bytecode",version:F.hermes.bytecodeVersion,icon:"ic_server_security_24px"}],n=[{label:"Loader",version:F.vendetta.loader,icon:"ic_download_24px"},{label:"OS",version:`${F.os.name} ${F.os.version}`,icon:"ic_cog_24px"},...F.os.sdk?[{label:"SDK",version:F.os.sdk,icon:"ic_profile_badge_verified_developer_color"}]:[],{label:"Manufacturer",version:F.device.manufacturer,icon:"ic_badge_staff"},{label:"Brand",version:F.device.brand,icon:"ic_settings_boost_24px"},{label:"Model",version:F.device.model,icon:"ic_phonelink_24px"},{label:f.Platform.select({android:"Codename",ios:"Machine ID"}),version:F.device.codename,icon:"ic_compose_24px"}];return React.createElement(x,null,React.createElement(f.ScrollView,{style:{flex:1},contentContainerStyle:{paddingBottom:38}},React.createElement(vt,{title:"Important",titleStyleType:"no_border"},React.createElement(Ge,{label:"Opti Version",version:F.vendetta.version,icon:"boost"}),React.createElement(k,null),React.createElement(w,{label:"Discord Server",leading:React.createElement(w.Icon,{source:m("Discord")}),trailing:w.Arrow,onPress:function(){return ze.openDeeplink(On)}}),React.createElement(k,null),React.createElement(w,{label:"GitHub Repository",leading:React.createElement(w.Icon,{source:m("img_account_sync_github_white")}),trailing:w.Arrow,onPress:function(){return ze.openURL(Un)}})),React.createElement(vt,{title:"Actions"},React.createElement(w,{label:"Reload Discord",subLabel:"This has a chance of crashing instead of directly reloading.",leading:React.createElement(w.Icon,{source:m("ic_message_retry")}),onPress:function(){return ie.reload()}}),React.createElement(k,null),React.createElement(w,{label:c.safeMode?.enabled?"Return to Normal Mode":"Reload in Safe Mode",subLabel:`This will reload Discord ${c.safeMode?.enabled?"normally.":"without loading plugins."}`,leading:React.createElement(w.Icon,{source:m("ic_privacy_24px")}),onPress:at}),React.createElement(k,null),React.createElement(w,{label:"Asset Browser",leading:React.createElement(w.Icon,{source:m("ic_image")}),trailing:w.Arrow,onPress:function(){return e.push("VendettaCustomPage",{title:"Asset Browser",render:Qn})}}),React.createElement(k,null)),React.createElement(vt,{title:"Info"},React.createElement(Fe,{label:"Versions",icon:"ic_information_filled_24px"},t.map(function(r,o){return React.createElement(React.Fragment,null,React.createElement(Ge,{label:r.label,version:r.version,icon:r.icon}),o!==t.length-1&&React.createElement(k,null))})),React.createElement(k,null),React.createElement(Fe,{label:"Platform",icon:"ic_mobile_device"},n.map(function(r,o){return React.createElement(React.Fragment,null,React.createElement(Ge,{label:r.label,version:r.version,icon:r.icon}),o!==n.length-1&&React.createElement(k,null))})),React.createElement(k,null),React.createElement(Fe,{label:"Opti Stats",icon:"ic_list"},React.createElement(Ge,{label:"Enabled Plugins",version:""+Bn(),icon:"ic_download_24px"}),React.createElement(Ge,{label:"Shaders",version:""+dn(),icon:"ic_paint_brush"}))),React.createElement(vt,{title:"Developer"},React.createElement(w,{label:"ErrorBoundary Tools",leading:React.createElement(w.Icon,{source:m("ic_warning_24px")}),trailing:w.Arrow,onPress:function(){return Di({key:"ErrorBoundaryTools",header:{title:"Which ErrorBoundary do you want to trip?",icon:React.createElement(w.Icon,{style:{marginRight:8},source:m("ic_warning_24px")}),onClose:function(){return Ni()}},options:[{label:"Opti",onPress:function(){return e.push("VendettaCustomPage",{render:function(){return React.createElement("undefined",null)}})}},{label:"Discord",isDestructive:!0,onPress:function(){return e.push("VendettaCustomPage",{noErrorBoundary:!0})}}]})}}),React.createElement(k,null),React.createElement(jo,{value:c.debuggerUrl,onChange:function(r){return c.debuggerUrl=r},placeholder:"127.0.0.1:9090",title:"Debugger URL"}),React.createElement(k,null),React.createElement(w,{label:"Connect to debug websocket",leading:React.createElement(w.Icon,{source:m("copy")}),onPress:function(){return Sn(c.debuggerUrl)}}),window.__vendetta_rdc&&React.createElement(React.Fragment,null,React.createElement(k,null),React.createElement(w,{label:"Connect to React DevTools",leading:React.createElement(w.Icon,{source:m("ic_badge_staff")}),onPress:function(){return window.__vendetta_rdc?.connectToDevTools({host:c.debuggerUrl.split(":")?.[0],resolveRNStyle:f.StyleSheet.flatten})}})),window.__vendetta_loader?.features.loaderConfig&&React.createElement(React.Fragment,null,React.createElement($o,{label:"Load from custom url",subLabel:"Load Vendetta from a custom endpoint.",leading:React.createElement(w.Icon,{source:m("copy")}),value:q.customLoadUrl.enabled,onValueChange:function(r){q.customLoadUrl.enabled=r}}),React.createElement(k,null),q.customLoadUrl.enabled&&React.createElement(React.Fragment,null,React.createElement(jo,{value:q.customLoadUrl.url,onChange:function(r){return q.customLoadUrl.url=r},placeholder:"http://localhost:4040/vendetta.js",title:"VENDETTA URL"}),React.createElement(k,null)),window.__vendetta_loader.features.devtools&&React.createElement($o,{label:"Load React DevTools",subLabel:`Version: ${window.__vendetta_loader.features.devtools.version}`,leading:React.createElement(w.Icon,{source:m("ic_badge_staff")}),value:q.loadReactDevTools,onValueChange:function(r){q.loadReactDevTools=r}}),React.createElement(k,null)))))}var w,$o,vt,k,jo,Ni,Di,F,zo=s(()=>{"use strict";g();ke();ve();y();Z();se();_();D();H();H();Vo();Ho();ve();he();j();({FormRow:w,FormSwitchRow:$o,FormSection:vt,FormDivider:k,FormInput:jo}=E),{hideActionSheet:Ni}=l("openLazy","hideActionSheet"),{showSimpleActionSheet:Di}=l("showSimpleActionSheet"),F=ge()});function It(){console.log("TweakManager has loaded SilentTyping."),Wo=["startTyping","stopTyping"].map(function(e){return X(e,Pi,function(){})})}function At(){console.log("TweakManager has unloaded SilentTyping."),Wo.forEach(function(e){return e()})}var Pi,Wo,tr=s(()=>{"use strict";A();y();Pi=l("startTyping"),Wo=[]});function Ct(){console.log("TweakManager has loaded HideUnneccesaryButtons.");let e=["ic_thread_normal_24px","ic_gift","AppsIcon"].map(function(t){return m(t)});Ko=R("render",Bi.prototype,function(t,n){let r=$(n,function(a){return a.props?.canSendVoiceMessage});r&&(r.props.canSendVoiceMessage=!1);let o=$(n,function(a){return"forceAnimateButtons"in a.props&&a.props.actions});o.props.actions=o.props.actions.filter(function(a){return!e.includes(a.source)})})}function Nt(){console.log("TweakManager has unloaded HideUnneccesaryButtons.")}var Bi,Ko,nr=s(()=>{"use strict";A();y();_();ce();Bi=I("ChatInput")});function Dt(){console.log("TweakManager has loaded TrustURLs."),Yo.push(R("isTrustedDomain",Mi,function(){return!0}))}function Pt(){console.log("TweakManager has unloaded TrustURLs.");for(let e of Yo)e()}var Mi,Yo,rr=s(()=>{"use strict";A();y();Mi=we("MaskedLinkStore"),Yo=[]});function Bt(){console.log("TweakManager has loaded EnableExperiments.");try{Te.getCurrentUser().flags|=1,Te._dispatcher._actionHandlers._computeOrderedActionHandlers("OVERLAY_INITIALIZE").forEach(function(e){e.name.includes("Experiment")&&e.actionHandler({serializedExperimentStore:Oi.getSerializedState(),user:{flags:1}})})}catch{let t=new Error;console.error(t.stack)}}function Mt(){console.log("TweakManager has unloaded EnableExperiments."),Li.unsubscribe("CONNECTION_OPEN")}var Li,Oi,or=s(()=>{"use strict";y();g();Li=l("_currentDispatchActionType"),Oi=l("getSerializedState")});function Lt(){console.log("TweakManager has loaded RemoveDeletePrompts.");let e=l("show","openLazy");Xo=X("show",e,function(t,n){t?.[0]?.title===me.Messages.DELETE_MESSAGE?t[0].onConfirm?.():n(...t)})}function Ot(){console.log("TweakManager has unloaded RemoveDeletePrompt.")}var Xo,ar=s(()=>{"use strict";A();y();g()});function ir(){return M(c),c.tweaks??={},React.createElement(x,null,React.createElement(f.View,{style:{flex:1}},React.createElement(ee,{label:"Tweaks",subLabel:`Right now most tweaks are ported Vendetta plugins and are actively being improved on. Want yours removed? Contact me and I'll remove it ASAP.`}),React.createElement(qe,null),React.createElement(ee,{label:c.tweaks.silentTyping?.valueOf()?"Silent Typing (Enabled)":"Silent Typing (Disabled)",subLabel:"Hides that you are typing to other people.",leading:React.createElement(ee.Icon,{source:m("bell")}),onPress:function(){c.tweaks.silentTyping??=!1,c.tweaks.silentTyping=!c.tweaks.silentTyping,(c.tweaks.silentTyping?It:At)()}}),React.createElement(qe,null),React.createElement(ee,{label:c.tweaks.hideButtons?.valueOf()?"Remove Chat Buttons (Enabled)":"Remove Chat Buttons (Disabled)",subLabel:"Removes the Gift, Voice Message, and Activities buton.",leading:React.createElement(ee.Icon,{source:m("ic_trash_24px")}),onPress:function(){c.tweaks.hideButtons??=!1,c.tweaks.hideButtons=!c.tweaks.hideButtons,(c.tweaks.hideButtons?Ct:Nt)()}}),React.createElement(qe,null),React.createElement(ee,{label:c.tweaks.trustURL?.valueOf()?"Trust All URLs (Enabled)":"Trust All URLs (Disabled)",subLabel:'Removes the "Trust This URL?" prompt.',leading:React.createElement(ee.Icon,{source:m("unlocked")}),onPress:function(){c.tweaks.trustURL??=!1,c.tweaks.trustURL=!c.tweaks.trustURL,(c.tweaks.trustURL?Dt:Pt)()}}),React.createElement(qe,null),React.createElement(ee,{label:c.tweaks.experiments?.valueOf()?"Staff Mode (Enabled)":"Staff Mode (Disabled)",subLabel:`Enables Discord Experiments - Port of EnableStaging made by acquitelol`,leading:React.createElement(ee.Icon,{source:m("debug")}),onPress:function(){c.tweaks.experiments??=!0,c.tweaks.experiments=!c.tweaks.experiments,(c.tweaks.experiments?Bt:Mt)()}}),React.createElement(qe,null),React.createElement(ee,{label:c.tweaks.fastdelete?.valueOf()?"Message Delete Prompt (Enabled)":"Message Delete Prompt (Disabled)",subLabel:"Delete messages without the warning prompt.",leading:React.createElement(ee.Icon,{source:m("ic_message_delete")}),onPress:function(){c.tweaks.fastdelete??=!0,c.tweaks.fastdelete=!c.tweaks.fastdelete,(c.tweaks.fastdelete?Lt:Ot)()}}),React.createElement(qe,null)))}var qe,ee,Zo=s(()=>{"use strict";g();D();_();tr();nr();rr();H();Z();or();ar();({FormDivider:qe,FormRow:ee}=E)});function kt(e){let{items:t,safeModeMessage:n,safeModeExtras:r,card:o}=e;M(c),M(t);let[a,i]=React.useState("");return React.createElement(x,null,React.createElement(f.FlatList,{ListHeaderComponent:React.createElement(React.Fragment,null,c.safeMode?.enabled&&React.createElement(f.View,{style:{marginBottom:10}},React.createElement(jn,{messageType:0},n),r),React.createElement(Ze,{style:{marginBottom:10},onChangeText:function(u){return i(u.toLowerCase())},placeholder:"Search"})),style:{paddingHorizontal:10,paddingTop:20},contentContainerStyle:{paddingBottom:20},data:Object.values(t).filter(function(u){return u.id?.toLowerCase().includes(a)}),renderItem:function(u){let{item:d,index:p}=u;return React.createElement(o,{item:d,index:p})}}))}var qo=s(()=>{"use strict";g();Z();D();H()});function ft(e){let t=e.toggleValue??!1;return React.createElement(f.View,{style:[He.card,{marginTop:e.index!==0?10:0}]},React.createElement(Ft,{style:He.header,label:function(){return React.createElement(f.View,null,React.createElement(f.Text,{style:He.headertitle},e.headerLabel))},leading:e.headerIcon&&React.createElement(Ft.Icon,{source:m(e.headerIcon)}),trailing:e.toggleType&&(e.toggleType==="switch"?React.createElement(ki,{style:f.Platform.OS==="android"&&{marginVertical:-15},value:e.toggleValue,onValueChange:e.onToggleChange}):React.createElement(f.Pressable,{onPress:function(){t=!t,e.onToggleChange?.(t)}},React.createElement(Fi,{selected:e.toggleValue})))}),React.createElement(Ui,null),React.createElement(Ft,{label:function(){return React.createElement(f.View,null,React.createElement(f.Text,{style:He.description},e.descriptionLabel))},trailing:React.createElement(f.View,{style:He.actions},e.overflowActions&&React.createElement(f.TouchableOpacity,{onPress:function(){return Gi({key:"CardOverflow",header:{title:e.overflowTitle,icon:e.headerIcon&&React.createElement(Ft.Icon,{style:{marginRight:8},source:m(e.headerIcon)}),onClose:function(){return Vi()}},options:e.overflowActions?.map(function(n){return{...n,icon:m(n.icon)}})})}},React.createElement(f.Image,{style:He.icon,source:m("ic_more_24px")})),e.actions?.map(function(n){let{icon:r,onPress:o}=n;return React.createElement(f.TouchableOpacity,{onPress:o},React.createElement(f.Image,{style:He.icon,source:m(r)}))}))}))}var Ft,ki,Fi,Ui,Vi,Gi,He,sr=s(()=>{"use strict";g();y();_();Ue();D();({FormRow:Ft,FormSwitch:ki,FormRadio:Fi,FormDivider:Ui}=E),{hideActionSheet:Vi}=l("openLazy","hideActionSheet"),{showSimpleActionSheet:Gi}=l("showSimpleActionSheet"),He=O.createThemedStyleSheet({card:{backgroundColor:b.BACKGROUND_SECONDARY,borderRadius:7,borderColor:b.BACKGROUND_TERTIARY,borderWidth:1},header:{padding:0,backgroundColor:b.PRIMARY_DARK,color:b.HEADER_PRIMARY,borderTopLeftRadius:5,borderTopRightRadius:5},headertitle:{fontFamily:Se.Fonts.PRIMARY_BOLD,fontSize:18,color:b.HEADER_PRIMARY},description:{color:b.TEXT_MUTED,fontSize:12},actions:{flexDirection:"row-reverse",alignItems:"center"},icon:{width:22,height:22,marginLeft:5,tintColor:b?.INTERACTIVE_NORMAL}})});async function Jo(e,t){e.enabled&&Xe(e.id,!1),t(),e.enabled&&await Ye(e.id)}function cr(e){let{item:t,index:n}=e,r=Mn(t.id),o=de.useNavigation(),[a,i]=React.useState(!1),u=t.manifest.authors;return a?null:React.createElement(ft,{index:n,headerLabel:`${t.manifest.name}`,headerIcon:t.manifest.vendetta?.icon||"ic_application_command_24px",toggleType:"switch",toggleValue:t.enabled,onToggleChange:function(d){try{d?Ye(t.id):Xe(t.id)}catch(p){h(p.message,m("Small"))}},descriptionLabel:`${t.manifest.description} - -by ${u.map(function(d){return d.name}).join(", ")}`,overflowTitle:t.manifest.name,overflowActions:[{label:"View Creator Profile",icon:"ic_profile_24px",onPress:function(){Te.getUser(t.manifest.authors[0]?.id)?Le.showUserProfile({userId:t.manifest.authors[0]?.id}):rt.fetchProfile(t.manifest.authors[0]?.id).then(function(){Le.showUserProfile({userId:t.manifest.authors[0]?.id})})}},{icon:"RetryIcon",label:"Refetch",onPress:async function(){Jo(t,function(){Ke(t.id).then(async function(){h("Successfully refetched plugin.",m("toast_image_saved"))}).catch(function(){h("Failed to refetch plugin!",m("Small"))})})}},{icon:"copy",label:"Copy URL",onPress:function(){G.setString(t.id),h("Copied plugin URL to clipboard.",m("toast_copy_link"))}},{icon:"ic_download_24px",label:t.update?"Disable updates":"Enable updates",onPress:function(){t.update=!t.update,h(`${t.update?"Enabled":"Disabled"} updates for ${t.manifest.name}.`,m("toast_image_saved"))}},{icon:"ic_duplicate",label:"Clear data",isDestructive:!0,onPress:function(){return Q({title:"Wait!",content:`Are you sure you wish to clear the data of ${t.manifest.name}?`,confirmText:"Clear",cancelText:"Cancel",confirmColor:J.RED,onConfirm:function(){Jo(t,function(){try{ye.removeItem(t.id),h(`Cleared data for ${t.manifest.name}.`,m("trash"))}catch{h(`Failed to clear data for ${t.manifest.name}!`,m("Small"))}})}})}},{icon:"ic_message_delete",label:"Delete",isDestructive:!0,onPress:function(){return Q({title:"Wait!",content:`Are you sure you wish to delete ${t.manifest.name}? This will clear all of the plugin's data.`,confirmText:"Delete",cancelText:"Cancel",confirmColor:J.RED,onConfirm:function(){try{Dn(t.id),i(!0)}catch(d){h(d.message,m("Small"))}}})}}],actions:[...r?[{icon:"settings",onPress:function(){return o.push("VendettaCustomPage",{title:t.manifest.name,render:r})}}]:[]]})}var Qo=s(()=>{"use strict";it();g();he();se();_();oe();Ve();sr()});async function ea(e,t){await Be(e?t:"default"),ie.reload()}function lr(e){let{item:t,index:n}=e;M(c);let[r,o]=React.useState(!1),a=t.data.authors;return r?null:React.createElement(ft,{index:n,headerLabel:`${t.data.name}`,headerIcon:"ic_theme_24px",descriptionLabel:t.data.description??"No description.",toggleType:c.safeMode?.enabled?void 0:"switch",toggleValue:t.selected,onToggleChange:function(i){ea(i,t.id)},overflowTitle:t.data.name,overflowActions:[{label:"View Creator Profile",icon:"ic_profile_24px",onPress:function(){Te.getUser(t.data.authors[0]?.id)?Le.showUserProfile({userId:t.data.authors[0]?.id}):rt.fetchProfile(t.data.authors[0]?.id).then(function(){Le.showUserProfile({userId:t.data.authors[0]?.id})})}},{icon:"ic_sync_24px",label:"Refetch",onPress:function(){nt(t.id,t.selected).then(function(){t.selected?Q({title:"Theme refetched",content:"A reload is required to see the changes. Do you want to reload now?",confirmText:"Reload",cancelText:"Cancel",confirmColor:J.RED,onConfirm:function(){return ie.reload()}}):h("Successfully refetched theme.",m("toast_image_saved"))}).catch(function(){h("Failed to refetch theme!",m("Small"))})}},{icon:"copy",label:"Copy URL",onPress:function(){G.setString(t.id),h("Copied shader URL to clipboard.",m("toast_copy_link"))}},{icon:"ic_message_delete",label:"Delete",isDestructive:!0,onPress:function(){return Q({title:"Wait!",content:`Are you sure you wish to delete ${t.data.name}?`,confirmText:"Delete",cancelText:"Cancel",confirmColor:J.RED,onConfirm:function(){fn(t.id).then(function(i){o(!0),i&&ea(!1,t.id)}).catch(function(i){h(i.message,m("Small"))})}})}}]})}var ta=s(()=>{"use strict";it();g();j();Z();se();_();Ve();oe();H();sr()});function ur(){M(c);let[e,t]=React.useState("plugins"),n=[{id:"plugins",title:"Plugins",page:function(){return React.createElement(kt,{items:N,card:cr})}},{id:"shaders",title:"Shaders",page:function(){return React.createElement(kt,{items:L,card:lr})}}];return React.createElement(React.Fragment,null,React.createElement(Hi,{style:{padding:14},tabs:n,activeTab:e,onTabSelected:function(r){return t(r)}}),React.createElement(n.find(function(r){return r.id===e}).page))}var Hi,na=s(()=>{"use strict";Z();he();j();H();qo();Qo();ta();y();({BadgableTabBar:Hi}=l("BadgableTabBar"))});var rm,om,am,im,sm,$i,Ut,Vt,Je,mt,ra,fr,Gt=s(()=>{"use strict";g();he();j();Ve();Ue();oe();ce();_();Gn();Fo();zo();ke();Zo();D();na();ve();({FormRow:rm,FormSwitchRow:om,FormSection:am,FormDivider:im,FormInput:sm}=E),$i=O.createThemedStyleSheet({container:{flex:1,backgroundColor:b.BACKGROUND_MOBILE_PRIMARY}}),Ut=function(e,t){return t?wt.snakeCase(e).toUpperCase():e},Vt=function(e,t){return Object.fromEntries(e.map(function(n){return[n.key,typeof t=="function"?t(n):typeof t=="string"?n[t]:t]}))},Je=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return[{key:Ut("VendettaSettings",e),title:"Opti",icon:"https://raw.githubusercontent.com/Opti-mod/assets/main/Opti%202.png",trailing:ge().vendetta.version,render:er},{key:Ut("VendettaAddons",e),title:"Addons",icon:"CirclePlusIcon-primary",render:ur,options:{headerRight:function(){return React.createElement(qn,{alertTitle:"Install Addon",installFunction:async function(t){if(t.endsWith(".json"))return await Pe(t);if(!t.startsWith(Oe))setImmediate(function(){return Q({title:"Unproxied Plugin",content:"The plugin you are trying to install has not been proxied. Want to download it anyways?",confirmText:"Install",onConfirm:function(){return Ae(t).then(function(){return h("Installed plugin",m("Check"))}).catch(function(n){return h(n?.message??`${n}`,m("Small"))})},cancelText:"Cancel"})});else return await Ae(t)}})}}},{key:Ut("VendettaSettingsTM",e),title:"Tweaks",icon:"ic_hammer_and_chisel_24px",render:ir},{key:Ut("VendettaCustomPage",e),title:"Opti Page",shouldRender:function(){return!1},render:function(t){let{render:n,noErrorBoundary:r,...o}=t,a=de.useNavigation();return a.addListener("focus",function(){return a.setOptions(Y(o,"render","noErrorBoundary"))}),r?React.createElement(n,null):React.createElement(x,null,React.createElement(n,null))}}]},mt=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return Je(e).filter(function(t){return t.shouldRender?.()??!0})},ra=function(){return Vt(Je(),function(e){return{title:e.title,render:e.render,...e.options}})},fr=function(){let e=Je(!0);return{getLayout:function(){return{title:"Opti",label:"Opti",settings:mt(!0).map(function(t){return t.key})}},titleConfig:Vt(e,"title"),relationships:Vt(e,null),rendererConfigs:Vt(e,function(t){let n=React.memo(function(r){let{navigation:o,route:a}=r;return o.addListener("focus",function(){return o.setOptions(t.options)}),React.createElement(f.View,{style:$i.container},React.createElement(t.render,a.params))});return{type:"route",title:function(){return t.title},icon:t.icon?m(t.icon):null,screen:{route:wt.chain(t.key).camelCase().upperFirst().value(),getComponent:function(){return n}}}})}}});function dr(){let e=de.useNavigation();M(c);let t=mt();return React.createElement(x,null,React.createElement(ji,{key:"Vendetta",title:`Opti ${c.safeMode?.enabled?" (Safe Mode)":""}`},t.map(function(n,r){return React.createElement(React.Fragment,null,React.createElement(mr,{label:n.title,leading:React.createElement(mr.Icon,{source:m(n.icon)}),trailing:mr.Arrow,onPress:function(){return e.push(n.key)}}),r!==t.length-1&&React.createElement(zi,null))})))}var mr,ji,zi,oa=s(()=>{"use strict";g();Z();_();Gt();D();H();({FormRow:mr,FormSection:ji,FormDivider:zi}=E)});function pr(){let e=new Array;return e.push(R("default",Wi,function(t,n){return{...n,...ra()}})),R("default",Ki,function(t,n){let r=$(n.props.children,function(o){return o.type&&o.type.name==="UserSettingsOverview"});e.push(R("renderSupportAndAcknowledgements",r.type.prototype,function(o,a){let{props:{children:i}}=a,u=i.findIndex(function(d){return d?.type?.name==="UploadLogsButton"});u!==-1&&i.splice(u,1)})),e.push(R("render",r.type.prototype,function(o,a){let{props:{children:i}}=a,u=[me.Messages.BILLING_SETTINGS,me.Messages.PREMIUM_SETTINGS];i=$(i,function(p){return p.children?.[1].type?.name==="FormSection"}).children;let d=i.findIndex(function(p){return u.includes(p?.props.label)});i.splice(d===-1?4:d,0,React.createElement(dr,null))}))},!0),function(){return e.forEach(function(t){return t()})}}var Wi,Ki,aa=s(()=>{"use strict";g();y();A();ce();Gt();oa();Wi=I("getScreens",!1),Ki=I("UserSettingsOverviewWrapper",!1)});function hr(){let e=new Array;return Xi(e)||Yi(e),function(){return e.forEach(function(t){return t?.()})}}function Yi(e){let t=l("useOverviewSettings"),n=l("getSettingTitleConfig"),r=l("SETTING_RELATIONSHIPS","SETTING_RENDERER_CONFIGS"),o="getSettingSearchListItems",a="getSettingListItems",i=l(o),u=!i,d=u?a:o,p=i??l(a);if(!p||!t)return;let P=Je(!0),B=mt(!0),S=fr();e.push(R("useOverviewSettings",t,function(Ne,Qe){return ia(Qe,S.getLayout())})),e.push(R("getSettingTitleConfig",n,function(Ne,Qe){return{...Qe,...S.titleConfig}})),e.push(R(d,p,function(Ne,Qe){let[Aa]=Ne;return[...B.filter(function(te){return Aa.includes(te.key)}).map(function(te){return{type:"setting_search_result",ancestorRendererData:S.rendererConfigs[te.key],setting:te.key,title:S.titleConfig[te.key],breadcrumbs:["Vendetta"],icon:S.rendererConfigs[te.key].icon}}),...Qe.filter(function(te){return u||!P.map(function(Ht){return Ht.key}).includes(te.setting)})].map(function(te,Ht,Ca){return{...te,index:Ht,total:Ca.length}})}));let U=r.SETTING_RELATIONSHIPS,V=r.SETTING_RENDERER_CONFIGS;return r.SETTING_RELATIONSHIPS={...U,...S.relationships},r.SETTING_RENDERER_CONFIGS={...V,...S.rendererConfigs},e.push(function(){r.SETTING_RELATIONSHIPS=U,r.SETTING_RENDERER_CONFIGS=V}),!0}function Xi(e){let t=l("SearchableSettingsList"),n=l("SETTING_RENDERER_CONFIG"),r=l("getSettingListItems");if(!r||!t||!n)return!1;let o=Je(!0),a=fr();e.push(Jt("type",t.SearchableSettingsList,function(u){let[{sections:d}]=u;return ia(d,a.getLayout())})),e.push(R("getSettingListSearchResultItems",r,function(u,d){d.forEach(function(p){return o.some(function(P){return P.key===p.setting})&&(p.breadcrumbs=["Vendetta"])})}));let i=n.SETTING_RENDERER_CONFIG;return n.SETTING_RENDERER_CONFIG={...i,...a.rendererConfigs},e.push(function(){n.SETTING_RENDERER_CONFIG=i}),!0}function ia(e,t){if(!Array.isArray(e)||e.find(function(o){return gr(o,"Vendetta")}))return;let n=e.findIndex(function(o){return gr(o,me.Messages.ACCOUNT_SETTINGS)});e.splice(n+1,0,t);let r=e.find(function(o){return gr(o,me.Messages.SUPPORT)});r&&(r.settings=r.settings.filter(function(o){return o!=="UPLOAD_DEBUG_LOGS"}))}var gr,sa=s(()=>{"use strict";y();A();Gt();g();gr=function(e,t){return e?.label===t||e?.title===t}});function Rr(){let e=[pr(),hr()];return function(){return e.forEach(function(t){return t?.()})}}var ca=s(()=>{"use strict";aa();sa()});function fa(e){let{locale:t}=e;try{la&&(la.overrideTheme(Zi?.theme??"dark"),ua&&qi.useAMOLEDTheme===2&&ua.setAMOLEDThemeEnabled(!0))}catch(n){C.error("Failed to fix theme...",n)}try{yn.locale(t.toLowerCase())}catch(n){C.error("Failed to fix timestamps...",n)}yt.unsubscribe("I18N_LOAD_SUCCESS",fa)}function ma(){return yt.subscribe("I18N_LOAD_SUCCESS",fa)}var la,ua,Zi,qi,da=s(()=>{"use strict";g();y();De();la=l("updateTheme","overrideTheme"),ua=l("setAMOLEDThemeEnabled"),Zi=we("ThemeStore"),qi=we("UnsyncedUserSettingsStore")});function pa(){console.log("object object is not a function in String, fuck you, now its gone. no more strings to complain about.")}var ga=s(()=>{"use strict"});async function ha(e){return{patcher:Y(Br,"unpatchAll"),metro:{...zt,common:{...wn}},constants:Vn,utils:Yt,debug:Y(vn,"versionHash","patchLogHook","toggleSafeMode"),ui:{components:Wn,toasts:xn,alerts:Xn,assets:_n,...Hn},plugins:Y(Ln,"initPlugins","evalPlugin"),themes:Y(pn,"initThemes"),commands:Y(Nn,"patchCommands"),storage:sn,settings:c,loader:{identity:window.__vendetta_loader,config:q},logger:C,version:bt,unload:function(){e.filter(function(t){return typeof t=="function"}).forEach(function(t){return t()}),delete window.vendetta}}}var Ra=s(()=>{"use strict";A();De();H();ke();ve();he();j();xt();Z();y();g();D();oe();Ve();_();Ue();ce()});function Ea(){c.tweaks??={},console.log("TweakManager has initialized."),c.tweaks.trustURL==null&&(c.tweaks.trustURL=!1),c.tweaks.hideButtons==null&&(c.tweaks.hideButtons=!1),c.tweaks.silentTyping==null&&(c.tweaks.silentTyping=!1),c.tweaks.experiments==null&&(c.tweaks.experiments=!1),c.tweaks.fastdelete==null&&(c.tweaks.fastdelete=!1),(c.tweaks.trustURL?Dt:Pt)(),(c.tweaks.hideButtons?Ct:Nt)(),(c.tweaks.silentTyping?It:At)(),(c.tweaks.experiments?Bt:Mt)(),(c.tweaks.fastdelete?Lt:Ot)()}var ya=s(()=>{"use strict";H();tr();nr();rr();or();ar()});var Re,wa,ba=s(()=>{"use strict";g();ve();Re=ge(),wa=[{name:"debug",description:"Prints Optis debug information to chat.",execute(e,t){let n=`**Opti Debug Info** + Port of EnableStaging made by acquitelol`,leading:React.createElement(ee.Icon,{source:m("debug")}),onPress:function(){c.tweaks.experiments??=!0,c.tweaks.experiments=!c.tweaks.experiments,(c.tweaks.experiments?Bt:Mt)()}}),React.createElement(qe,null),React.createElement(ee,{label:c.tweaks.fastdelete?.valueOf()?"Message Delete Prompt (Enabled)":"Message Delete Prompt (Disabled)",subLabel:"Delete messages without the warning prompt.",leading:React.createElement(ee.Icon,{source:m("ic_message_delete")}),onPress:function(){c.tweaks.fastdelete??=!0,c.tweaks.fastdelete=!c.tweaks.fastdelete,(c.tweaks.fastdelete?Lt:Ot)()}}),React.createElement(qe,null)))}var qe,ee,Zo=s(()=>{"use strict";g();D();_();tr();nr();rr();H();Z();or();ar();({FormDivider:qe,FormRow:ee}=E)});function kt(e){let{items:t,safeModeMessage:n,safeModeExtras:r,card:o}=e;M(c),M(t);let[a,i]=React.useState("");return React.createElement(x,null,React.createElement(f.FlatList,{ListHeaderComponent:React.createElement(React.Fragment,null,c.safeMode?.enabled&&React.createElement(f.View,{style:{marginBottom:10}},React.createElement(jn,{messageType:0},n),r),React.createElement(Ze,{style:{marginBottom:10},onChangeText:function(u){return i(u.toLowerCase())},placeholder:"Search"})),style:{paddingHorizontal:10,paddingTop:20},contentContainerStyle:{paddingBottom:20},data:Object.values(t).filter(function(u){return u.id?.toLowerCase().includes(a)}),renderItem:function(u){let{item:d,index:p}=u;return React.createElement(o,{item:d,index:p})}}))}var qo=s(()=>{"use strict";g();Z();D();H()});function ft(e){let t=e.toggleValue??!1;return React.createElement(f.View,{style:[He.card,{marginTop:e.index!==0?10:0}]},React.createElement(Ft,{style:He.header,label:function(){return React.createElement(f.View,null,React.createElement(f.Text,{style:He.headertitle},e.headerLabel))},leading:e.headerIcon&&React.createElement(Ft.Icon,{source:m(e.headerIcon)}),trailing:e.toggleType&&(e.toggleType==="switch"?React.createElement(ki,{style:f.Platform.OS==="android"&&{marginVertical:-15},value:e.toggleValue,onValueChange:e.onToggleChange}):React.createElement(f.Pressable,{onPress:function(){t=!t,e.onToggleChange?.(t)}},React.createElement(Fi,{selected:e.toggleValue})))}),React.createElement(Ui,null),React.createElement(Ft,{label:function(){return React.createElement(f.View,null,React.createElement(f.Text,{style:He.description},e.descriptionLabel))},trailing:React.createElement(f.View,{style:He.actions},e.overflowActions&&React.createElement(f.TouchableOpacity,{onPress:function(){return Gi({key:"CardOverflow",header:{title:e.overflowTitle,icon:e.headerIcon&&React.createElement(Ft.Icon,{style:{marginRight:8},source:m(e.headerIcon)}),onClose:function(){return Vi()}},options:e.overflowActions?.map(function(n){return{...n,icon:m(n.icon)}})})}},React.createElement(f.Image,{style:He.icon,source:m("ic_more_24px")})),e.actions?.map(function(n){let{icon:r,onPress:o}=n;return React.createElement(f.TouchableOpacity,{onPress:o},React.createElement(f.Image,{style:He.icon,source:m(r)}))}))}))}var Ft,ki,Fi,Ui,Vi,Gi,He,sr=s(()=>{"use strict";g();y();_();Ue();D();({FormRow:Ft,FormSwitch:ki,FormRadio:Fi,FormDivider:Ui}=E),{hideActionSheet:Vi}=l("openLazy","hideActionSheet"),{showSimpleActionSheet:Gi}=l("showSimpleActionSheet"),He=O.createThemedStyleSheet({card:{backgroundColor:b.BACKGROUND_SECONDARY,borderRadius:7,borderColor:b.BACKGROUND_TERTIARY,borderWidth:1},header:{padding:0,backgroundColor:b.PRIMARY_DARK,color:b.HEADER_PRIMARY,borderTopLeftRadius:5,borderTopRightRadius:5},headertitle:{fontFamily:Se.Fonts.PRIMARY_BOLD,fontSize:17,color:b.HEADER_PRIMARY},description:{color:b.TEXT_MUTED,fontSize:13},actions:{flexDirection:"row-reverse",alignItems:"center"},icon:{width:22,height:22,marginLeft:5,tintColor:b?.INTERACTIVE_NORMAL}})});async function Jo(e,t){e.enabled&&Xe(e.id,!1),t(),e.enabled&&await Ye(e.id)}function cr(e){let{item:t,index:n}=e,r=Mn(t.id),o=de.useNavigation(),[a,i]=React.useState(!1),u=t.manifest.authors;return a?null:React.createElement(ft,{index:n,headerLabel:`${t.manifest.name}`,headerIcon:t.manifest.vendetta?.icon||"ic_application_command_24px",toggleType:"switch",toggleValue:t.enabled,onToggleChange:function(d){try{d?Ye(t.id):Xe(t.id)}catch(p){h(p.message,m("Small"))}},descriptionLabel:function(){return React.createElement(f.View,null,React.createElement(f.Text,null,"$",t.manifest.description),React.createElement(f.View,null,React.createElement(f.Text,null,"\\n\\nAuthors: $",u.map(function(d){return d.name}).join(", "))))},overflowTitle:t.manifest.name,overflowActions:[{label:"View Creator Profile",icon:"ic_profile_24px",onPress:function(){Te.getUser(t.manifest.authors[0]?.id)?Le.showUserProfile({userId:t.manifest.authors[0]?.id}):rt.fetchProfile(t.manifest.authors[0]?.id).then(function(){Le.showUserProfile({userId:t.manifest.authors[0]?.id})})}},{icon:"RetryIcon",label:"Refetch",onPress:async function(){Jo(t,function(){Ke(t.id).then(async function(){h("Successfully refetched plugin.",m("toast_image_saved"))}).catch(function(){h("Failed to refetch plugin!",m("Small"))})})}},{icon:"copy",label:"Copy URL",onPress:function(){G.setString(t.id),h("Copied plugin URL to clipboard.",m("toast_copy_link"))}},{icon:"ic_download_24px",label:t.update?"Disable updates":"Enable updates",onPress:function(){t.update=!t.update,h(`${t.update?"Enabled":"Disabled"} updates for ${t.manifest.name}.`,m("toast_image_saved"))}},{icon:"ic_duplicate",label:"Clear data",isDestructive:!0,onPress:function(){return Q({title:"Wait!",content:`Are you sure you wish to clear the data of ${t.manifest.name}?`,confirmText:"Clear",cancelText:"Cancel",confirmColor:J.RED,onConfirm:function(){Jo(t,function(){try{ye.removeItem(t.id),h(`Cleared data for ${t.manifest.name}.`,m("trash"))}catch{h(`Failed to clear data for ${t.manifest.name}!`,m("Small"))}})}})}},{icon:"ic_message_delete",label:"Delete",isDestructive:!0,onPress:function(){return Q({title:"Wait!",content:`Are you sure you wish to delete ${t.manifest.name}? This will clear all of the plugin's data.`,confirmText:"Delete",cancelText:"Cancel",confirmColor:J.RED,onConfirm:function(){try{Dn(t.id),i(!0)}catch(d){h(d.message,m("Small"))}}})}}],actions:[...r?[{icon:"settings",onPress:function(){return o.push("VendettaCustomPage",{title:t.manifest.name,render:r})}}]:[]]})}var Qo=s(()=>{"use strict";it();g();he();se();_();oe();g();Ve();sr()});async function ea(e,t){await Be(e?t:"default"),ie.reload()}function lr(e){let{item:t,index:n}=e;M(c);let[r,o]=React.useState(!1),a=t.data.authors;return r?null:React.createElement(ft,{index:n,headerLabel:`${t.data.name}`,headerIcon:"ic_theme_24px",descriptionLabel:t.data.description??"No description.",toggleType:c.safeMode?.enabled?void 0:"switch",toggleValue:t.selected,onToggleChange:function(i){ea(i,t.id)},overflowTitle:t.data.name,overflowActions:[{label:"View Creator Profile",icon:"ic_profile_24px",onPress:function(){Te.getUser(t.data.authors[0]?.id)?Le.showUserProfile({userId:t.data.authors[0]?.id}):rt.fetchProfile(t.data.authors[0]?.id).then(function(){Le.showUserProfile({userId:t.data.authors[0]?.id})})}},{icon:"ic_sync_24px",label:"Refetch",onPress:function(){nt(t.id,t.selected).then(function(){t.selected?Q({title:"Theme refetched",content:"A reload is required to see the changes. Do you want to reload now?",confirmText:"Reload",cancelText:"Cancel",confirmColor:J.RED,onConfirm:function(){return ie.reload()}}):h("Successfully refetched theme.",m("toast_image_saved"))}).catch(function(){h("Failed to refetch theme!",m("Small"))})}},{icon:"copy",label:"Copy URL",onPress:function(){G.setString(t.id),h("Copied shader URL to clipboard.",m("toast_copy_link"))}},{icon:"ic_message_delete",label:"Delete",isDestructive:!0,onPress:function(){return Q({title:"Wait!",content:`Are you sure you wish to delete ${t.data.name}?`,confirmText:"Delete",cancelText:"Cancel",confirmColor:J.RED,onConfirm:function(){fn(t.id).then(function(i){o(!0),i&&ea(!1,t.id)}).catch(function(i){h(i.message,m("Small"))})}})}}]})}var ta=s(()=>{"use strict";it();g();j();Z();se();_();Ve();oe();H();sr()});function ur(){M(c);let[e,t]=React.useState("plugins"),n=[{id:"plugins",title:"Plugins",page:function(){return React.createElement(kt,{items:N,card:cr})}},{id:"shaders",title:"Shaders",page:function(){return React.createElement(kt,{items:L,card:lr})}}];return React.createElement(React.Fragment,null,React.createElement(Hi,{style:{padding:14},tabs:n,activeTab:e,onTabSelected:function(r){return t(r)}}),React.createElement(n.find(function(r){return r.id===e}).page))}var Hi,na=s(()=>{"use strict";Z();he();j();H();qo();Qo();ta();y();({BadgableTabBar:Hi}=l("BadgableTabBar"))});var om,am,im,sm,cm,$i,Ut,Vt,Je,mt,ra,fr,Gt=s(()=>{"use strict";g();he();j();Ve();Ue();oe();ce();_();Gn();Fo();zo();ke();Zo();D();na();ve();({FormRow:om,FormSwitchRow:am,FormSection:im,FormDivider:sm,FormInput:cm}=E),$i=O.createThemedStyleSheet({container:{flex:1,backgroundColor:b.BACKGROUND_MOBILE_PRIMARY}}),Ut=function(e,t){return t?wt.snakeCase(e).toUpperCase():e},Vt=function(e,t){return Object.fromEntries(e.map(function(n){return[n.key,typeof t=="function"?t(n):typeof t=="string"?n[t]:t]}))},Je=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return[{key:Ut("VendettaSettings",e),title:"Opti",icon:"https://raw.githubusercontent.com/Opti-mod/assets/main/Opti%202.png",trailing:ge().vendetta.version,render:er},{key:Ut("VendettaAddons",e),title:"Addons",icon:"CirclePlusIcon-primary",render:ur,options:{headerRight:function(){return React.createElement(qn,{alertTitle:"Install Addon",installFunction:async function(t){if(t.endsWith(".json"))return await Pe(t);if(!t.startsWith(Oe))setImmediate(function(){return Q({title:"Unproxied Plugin",content:"The plugin you are trying to install has not been proxied. Want to download it anyways?",confirmText:"Install",onConfirm:function(){return Ae(t).then(function(){return h("Installed plugin",m("Check"))}).catch(function(n){return h(n?.message??`${n}`,m("Small"))})},cancelText:"Cancel"})});else return await Ae(t)}})}}},{key:Ut("VendettaSettingsTM",e),title:"Tweaks",icon:"ic_hammer_and_chisel_24px",render:ir},{key:Ut("VendettaCustomPage",e),title:"Opti Page",shouldRender:function(){return!1},render:function(t){let{render:n,noErrorBoundary:r,...o}=t,a=de.useNavigation();return a.addListener("focus",function(){return a.setOptions(Y(o,"render","noErrorBoundary"))}),r?React.createElement(n,null):React.createElement(x,null,React.createElement(n,null))}}]},mt=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return Je(e).filter(function(t){return t.shouldRender?.()??!0})},ra=function(){return Vt(Je(),function(e){return{title:e.title,render:e.render,...e.options}})},fr=function(){let e=Je(!0);return{getLayout:function(){return{title:"Opti",label:"Opti",settings:mt(!0).map(function(t){return t.key})}},titleConfig:Vt(e,"title"),relationships:Vt(e,null),rendererConfigs:Vt(e,function(t){let n=React.memo(function(r){let{navigation:o,route:a}=r;return o.addListener("focus",function(){return o.setOptions(t.options)}),React.createElement(f.View,{style:$i.container},React.createElement(t.render,a.params))});return{type:"route",title:function(){return t.title},icon:t.icon?m(t.icon):null,screen:{route:wt.chain(t.key).camelCase().upperFirst().value(),getComponent:function(){return n}}}})}}});function dr(){let e=de.useNavigation();M(c);let t=mt();return React.createElement(x,null,React.createElement(ji,{key:"Vendetta",title:`Opti ${c.safeMode?.enabled?" (Safe Mode)":""}`},t.map(function(n,r){return React.createElement(React.Fragment,null,React.createElement(mr,{label:n.title,leading:React.createElement(mr.Icon,{source:m(n.icon)}),trailing:mr.Arrow,onPress:function(){return e.push(n.key)}}),r!==t.length-1&&React.createElement(zi,null))})))}var mr,ji,zi,oa=s(()=>{"use strict";g();Z();_();Gt();D();H();({FormRow:mr,FormSection:ji,FormDivider:zi}=E)});function pr(){let e=new Array;return e.push(R("default",Wi,function(t,n){return{...n,...ra()}})),R("default",Ki,function(t,n){let r=$(n.props.children,function(o){return o.type&&o.type.name==="UserSettingsOverview"});e.push(R("renderSupportAndAcknowledgements",r.type.prototype,function(o,a){let{props:{children:i}}=a,u=i.findIndex(function(d){return d?.type?.name==="UploadLogsButton"});u!==-1&&i.splice(u,1)})),e.push(R("render",r.type.prototype,function(o,a){let{props:{children:i}}=a,u=[me.Messages.BILLING_SETTINGS,me.Messages.PREMIUM_SETTINGS];i=$(i,function(p){return p.children?.[1].type?.name==="FormSection"}).children;let d=i.findIndex(function(p){return u.includes(p?.props.label)});i.splice(d===-1?4:d,0,React.createElement(dr,null))}))},!0),function(){return e.forEach(function(t){return t()})}}var Wi,Ki,aa=s(()=>{"use strict";g();y();A();ce();Gt();oa();Wi=I("getScreens",!1),Ki=I("UserSettingsOverviewWrapper",!1)});function hr(){let e=new Array;return Xi(e)||Yi(e),function(){return e.forEach(function(t){return t?.()})}}function Yi(e){let t=l("useOverviewSettings"),n=l("getSettingTitleConfig"),r=l("SETTING_RELATIONSHIPS","SETTING_RENDERER_CONFIGS"),o="getSettingSearchListItems",a="getSettingListItems",i=l(o),u=!i,d=u?a:o,p=i??l(a);if(!p||!t)return;let P=Je(!0),B=mt(!0),S=fr();e.push(R("useOverviewSettings",t,function(Ne,Qe){return ia(Qe,S.getLayout())})),e.push(R("getSettingTitleConfig",n,function(Ne,Qe){return{...Qe,...S.titleConfig}})),e.push(R(d,p,function(Ne,Qe){let[Aa]=Ne;return[...B.filter(function(te){return Aa.includes(te.key)}).map(function(te){return{type:"setting_search_result",ancestorRendererData:S.rendererConfigs[te.key],setting:te.key,title:S.titleConfig[te.key],breadcrumbs:["Vendetta"],icon:S.rendererConfigs[te.key].icon}}),...Qe.filter(function(te){return u||!P.map(function(Ht){return Ht.key}).includes(te.setting)})].map(function(te,Ht,Ca){return{...te,index:Ht,total:Ca.length}})}));let U=r.SETTING_RELATIONSHIPS,V=r.SETTING_RENDERER_CONFIGS;return r.SETTING_RELATIONSHIPS={...U,...S.relationships},r.SETTING_RENDERER_CONFIGS={...V,...S.rendererConfigs},e.push(function(){r.SETTING_RELATIONSHIPS=U,r.SETTING_RENDERER_CONFIGS=V}),!0}function Xi(e){let t=l("SearchableSettingsList"),n=l("SETTING_RENDERER_CONFIG"),r=l("getSettingListItems");if(!r||!t||!n)return!1;let o=Je(!0),a=fr();e.push(Jt("type",t.SearchableSettingsList,function(u){let[{sections:d}]=u;return ia(d,a.getLayout())})),e.push(R("getSettingListSearchResultItems",r,function(u,d){d.forEach(function(p){return o.some(function(P){return P.key===p.setting})&&(p.breadcrumbs=["Vendetta"])})}));let i=n.SETTING_RENDERER_CONFIG;return n.SETTING_RENDERER_CONFIG={...i,...a.rendererConfigs},e.push(function(){n.SETTING_RENDERER_CONFIG=i}),!0}function ia(e,t){if(!Array.isArray(e)||e.find(function(o){return gr(o,"Vendetta")}))return;let n=e.findIndex(function(o){return gr(o,me.Messages.ACCOUNT_SETTINGS)});e.splice(n+1,0,t);let r=e.find(function(o){return gr(o,me.Messages.SUPPORT)});r&&(r.settings=r.settings.filter(function(o){return o!=="UPLOAD_DEBUG_LOGS"}))}var gr,sa=s(()=>{"use strict";y();A();Gt();g();gr=function(e,t){return e?.label===t||e?.title===t}});function Rr(){let e=[pr(),hr()];return function(){return e.forEach(function(t){return t?.()})}}var ca=s(()=>{"use strict";aa();sa()});function fa(e){let{locale:t}=e;try{la&&(la.overrideTheme(Zi?.theme??"dark"),ua&&qi.useAMOLEDTheme===2&&ua.setAMOLEDThemeEnabled(!0))}catch(n){C.error("Failed to fix theme...",n)}try{yn.locale(t.toLowerCase())}catch(n){C.error("Failed to fix timestamps...",n)}yt.unsubscribe("I18N_LOAD_SUCCESS",fa)}function ma(){return yt.subscribe("I18N_LOAD_SUCCESS",fa)}var la,ua,Zi,qi,da=s(()=>{"use strict";g();y();De();la=l("updateTheme","overrideTheme"),ua=l("setAMOLEDThemeEnabled"),Zi=we("ThemeStore"),qi=we("UnsyncedUserSettingsStore")});function pa(){console.log("object object is not a function in String, fuck you, now its gone. no more strings to complain about.")}var ga=s(()=>{"use strict"});async function ha(e){return{patcher:Y(Br,"unpatchAll"),metro:{...zt,common:{...wn}},constants:Vn,utils:Yt,debug:Y(vn,"versionHash","patchLogHook","toggleSafeMode"),ui:{components:Wn,toasts:xn,alerts:Xn,assets:_n,...Hn},plugins:Y(Ln,"initPlugins","evalPlugin"),themes:Y(pn,"initThemes"),commands:Y(Nn,"patchCommands"),storage:sn,settings:c,loader:{identity:window.__vendetta_loader,config:q},logger:C,version:bt,unload:function(){e.filter(function(t){return typeof t=="function"}).forEach(function(t){return t()}),delete window.vendetta}}}var Ra=s(()=>{"use strict";A();De();H();ke();ve();he();j();xt();Z();y();g();D();oe();Ve();_();Ue();ce()});function Ea(){c.tweaks??={},console.log("TweakManager has initialized."),c.tweaks.trustURL==null&&(c.tweaks.trustURL=!1),c.tweaks.hideButtons==null&&(c.tweaks.hideButtons=!1),c.tweaks.silentTyping==null&&(c.tweaks.silentTyping=!1),c.tweaks.experiments==null&&(c.tweaks.experiments=!1),c.tweaks.fastdelete==null&&(c.tweaks.fastdelete=!1),(c.tweaks.trustURL?Dt:Pt)(),(c.tweaks.hideButtons?Ct:Nt)(),(c.tweaks.silentTyping?It:At)(),(c.tweaks.experiments?Bt:Mt)(),(c.tweaks.fastdelete?Lt:Ot)()}var ya=s(()=>{"use strict";H();tr();nr();rr();or();ar()});var Re,wa,ba=s(()=>{"use strict";g();ve();Re=ge(),wa=[{name:"debug",description:"Prints Optis debug information to chat.",execute(e,t){let n=`**Opti Debug Info** > **Opti Version**: ${Re.vendetta.version} > **Discord Version**: ${Re.discord.version} (Build ${Re.discord.build}) > **Hermes**: ${Re.hermes.version} @@ -15,6 +13,6 @@ by ${u.map(function(d){return d.name}).join(", ")}`,overflowTitle:t.manifest.nam > **Device**: ${Re.device.brand} > **OS**: ${Re.os.name} ${Re.os.version} > **Codename/Machine ID**: ${Re.device.codename}`;En.sendMessage(t.channel.id,{content:n})}}]});var _a,xa=s(()=>{"use strict";se();_a=[{name:"reload",description:"Reloads Discord.",execute(){ie.reload()}}]});function Sa(){let e=[...wa,..._a];Cn(e)}var Ta=s(()=>{"use strict";xt();ba();xa()});var va={};T(va,{default:()=>Ji});async function Ji(){let e=await Promise.all([Tn(),bn(),An(),un(),ma(),Oo(),Rr(),Zn()]);window.vendetta=await ha(e),e.push(await Pn()),e.push(await Ea()),e.push(await Sa()),e.push(await pa()),C.log("Opti has loaded!")}var Ia=s(()=>{"use strict";ve();xt();he();j();_();Bo();ko();ca();da();ga();De();Ra();ya();Ta()});se();console.log("Opti has loaded!");Object.freeze=Object;Object.seal=Object;Promise.resolve().then(()=>(Ia(),va)).then(function(e){return e.default()}).catch(function(e){console.log(e?.stack??e.toString()),alert([`Opti failed to initialize. Some parts may not function properly. -`,`Build Number: ${et.Build}`,"Opti Version: 4a7259a",e?.stack||e.toString()].join(` +`,`Build Number: ${et.Build}`,"Opti Version: 1088831",e?.stack||e.toString()].join(` `))});})(); //# sourceURL=Vendetta diff --git a/src/ui/settings/components/Card.tsx b/src/ui/settings/components/Card.tsx index 66af7490..fb1fd432 100644 --- a/src/ui/settings/components/Card.tsx +++ b/src/ui/settings/components/Card.tsx @@ -25,12 +25,12 @@ const styles = stylesheet.createThemedStyleSheet({ }, headertitle: { fontFamily: constants.Fonts.PRIMARY_BOLD, - fontSize: 18, + fontSize: 17, color: semanticColors.HEADER_PRIMARY, }, description: { color: semanticColors.TEXT_MUTED, - fontSize: 12, + fontSize: 13, }, actions: { flexDirection: "row-reverse", diff --git a/src/ui/settings/components/PluginCard.tsx b/src/ui/settings/components/PluginCard.tsx index d47002e1..98236259 100644 --- a/src/ui/settings/components/PluginCard.tsx +++ b/src/ui/settings/components/PluginCard.tsx @@ -4,6 +4,7 @@ import { removePlugin, startPlugin, stopPlugin, getSettings, fetchPlugin } from import { MMKVManager } from "@lib/native"; import { getAssetIDByName } from "@ui/assets"; import { showToast } from "@ui/toasts"; +import { ReactNative as RN, constants, stylesheet } from "@metro/common"; import { showConfirmationAlert } from "@ui/alerts"; import Card, { CardWrapper } from "@ui/settings/components/Card"; import { semanticColors } from "@/ui/color"; @@ -36,7 +37,18 @@ export default function PluginCard({ item: plugin, index }: CardWrapper) showToast((e as Error).message, getAssetIDByName("Small")); } }} - descriptionLabel={`${plugin.manifest.description} \n\nby ${authors.map(i => i.name).join(", ")}`} + descriptionLabel={() => + + + ${plugin.manifest.description} + + + + + \n\nAuthors: ${authors.map(i => i.name).join(", ")} + + + } overflowTitle={plugin.manifest.name} overflowActions={[ {