"use strict";(()=>{var Ca=Object.defineProperty;var s=(e,t)=>()=>(e&&(t=e(e=0)),t);var D=(e,t)=>{for(var n in t)Ca(e,n,{get:t[n],enumerable:!0})};var ye,Re,B,Je,ke,Ie,Ee=s(()=>{"use strict";ye=window.nativeModuleProxy,Re=ye.MMKVManager;B=ye.DCDFileManager??ye.RTNFileManager;Je=ye.InfoDictionaryManager??ye.RTNClientInfoManager;ke=ye.DCDDeviceManager??ye.RTNDeviceManager,Ie=ye.BundleUpdaterManager});var Ht={};D(Ht,{find:()=>W,findAll:()=>Qe,findByDisplayName:()=>Vt,findByDisplayNameAll:()=>Oa,findByName:()=>O,findByNameAll:()=>Ba,findByProps:()=>c,findByPropsAll:()=>Da,findByStoreName:()=>ee,findByTypeName:()=>Ma,findByTypeNameAll:()=>La,modules:()=>Gt});var Pa,pr,gr,Gt,W,Qe,hr,yr,Rr,Er,Na,c,Da,O,Ba,Vt,Oa,Ma,La,ee,w=s(()=>{"use strict";be();Pa=window.ErrorUtils.getGlobalHandler();window.ErrorUtils.setGlobalHandler(null);pr=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){pr(t);continue}}gr=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{if(se().discord.version>=224){let m=Function.prototype.toString;Object.defineProperty(Function.prototype,"toString",{value:m,configurable:!0,writable:!1}),__r(a),Object.defineProperty(Function.prototype,"toString",{value:m,configurable:!0,writable:!0})}window.ErrorUtils.setGlobalHandler(function(){}),__r(a),window.ErrorUtils.setGlobalHandler(Pa)}catch{}if(!i){pr(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}},Gt=window.modules,W=gr(Gt,!0),Qe=gr(Gt),hr=function(e){return function(t){return e.every(function(n){return t[n]!==void 0})}},yr=function(e,t){return t?function(n){return n?.name===e}:function(n){return n?.default?.name===e}},Rr=function(e,t){return t?function(n){return n?.displayName===e}:function(n){return n?.default?.displayName===e}},Er=function(e,t){return t?function(n){return n?.type?.name===e}:function(n){return n?.default?.type?.name===e}},Na=function(e){return function(t){return t.getName&&t.getName.length===0&&t.getName()===e}},c=function(){for(var e=arguments.length,t=new Array(e),n=0;n1&&arguments[1]!==void 0?arguments[1]:!0;return W(yr(e,t))},Ba=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Qe(yr(e,t))},Vt=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return W(Rr(e,t))},Oa=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Qe(Rr(e,t))},Ma=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return W(Er(e,t))},La=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Qe(Er(e,t))},ee=function(e){return W(Na(e))}});function $(e,t){return dt(e,t,{walkable:["props","children","child","sibling"]})}var br=s(()=>{"use strict";ce()});function $t(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=$t(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=$t(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 $t(e,t,{walkable:n,ignore:r,maxDepth:o},0)}var wr=s(()=>{"use strict"});async function we(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1e4,r=await fetch(e,{signal:ka(n),...t});if(!r.ok)throw new Error("Request returned non-ok");return r}function ka(e){let t=new AbortController;return setTimeout(function(){return t.abort(`Timed out after ${e}ms`)},e),t.signal}var _r=s(()=>{"use strict"});function jt(e){return Object.isFrozen(e)?Object.assign({},e):e}var xr=s(()=>{"use strict"});function K(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r{"use strict"});var zt={};D(zt,{findInReactTree:()=>$,findInTree:()=>dt,safeFetch:()=>we,unfreeze:()=>jt,without:()=>K});var ce=s(()=>{"use strict";br();wr();_r();xr();Sr()});var Wt,te,pt=s(()=>{Wt=["a","b","i"],te=new Map});function vr(e,t,n,r,o){let a=te.get(t)?.[e];if(!a)return o?Reflect.construct(t[e],n,r):t[e].apply(r,n);for(let m of a.b.values()){let g=m.call(r,n);Array.isArray(g)&&(n=g)}let i=[...a.i.values()].reduce(function(m,g){return function(){for(var l=arguments.length,b=new Array(l),S=0;S{pt()});function Kt(e,t,n,r){let o=te.get(e),a=o?.[t];return a?.[r].has(n)?(a[r].delete(n),Wt.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&&te.delete(e),!0):!1}function Ar(){for(let[e,t]of te.entries())for(let n in t)for(let r of Wt)for(let o of t[n]?.[r].keys()??[])Kt(e,n,o,r)}var Yt=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}`);te.has(n)||te.set(n,Object.create(null));let a=te.get(n);if(!a[t]){let g=n[t];a[t]={o:g,b:new Map,i:new Map,a:new Map};let l=function(p,_,A){let Z=vr(t,n,_,p,A);return o&&m(),Z},b=new Proxy(g,{apply:function(p,_,A){return l(_,A,!1)},construct:function(p,_){return l(g,_,!0)},get:function(p,_,A){return _=="toString"?g.toString.bind(g):Reflect.get(p,_,A)}});Reflect.defineProperty(n,t,{value:b,configurable:!0,writable:!0})||(n[t]=b)}let i=Symbol(),m=function(){return Kt(n,t,i,e)};return a[t][e].set(i,r),m}}var Ir=s(()=>{Tr();pt();Yt()});var Jt={};D(Jt,{after:()=>y,before:()=>Xt,instead:()=>Y,unpatchAll:()=>Ar});var Xt,Y,y,Qt=s(()=>{Ir();Yt();Xt=gt("b"),Y=gt("i"),y=gt("a")});var Cr,C=s(()=>{"use strict";Qt();Qt();Cr={...Jt}});function qt(){return{listeners:Object.values(Zt).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 Zt,Pr=s(()=>{"use strict";(function(e){e.GET="GET",e.SET="SET",e.DEL="DEL"})(Zt||(Zt={}))});var Nr,en,Dr,tn,_e,Fe,Br=s(()=>{"use strict";Ee();h();Nr=/[<>:"\/\\|?*]/g,en=function(e){return u.Platform.select({default:e,ios:B.saveFileToGallery?e:`Documents/${e}`})},Dr=function(e){return Nr.test(e)&&(e=e.replace(Nr,"-").replace(/-+/g,"-")),`vd_mmkv/${e}`},tn=async function(e){await Re.getItem(e)&&Re.removeItem(e);let t=Dr(e);await B.fileExists(`${B.getConstants().DocumentsDirPath}/${t}`)&&await B.removeFile?.("documents",t)},_e=function(e){let t=Dr(e);return Fe(t,async function(){try{let n=`${B.getConstants().DocumentsDirPath}/${t}`;if(await B.fileExists(n))return;let r=await Re.getItem(e)??"{}";if(r==="!!LARGE_VALUE!!"){let o=`${B.getConstants().CacheDirPath}/mmkv/${e}`;await B.fileExists(o)?r=await B.readFile(o,"utf8"):(console.log(`${e}: Experienced data loss :(`),r="{}")}await B.writeFile("documents",en(t),r,"utf8"),await Re.getItem(e)!==null&&(Re.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)}}())},Fe=function(e,t){let n;return{get:async function(){await t;let r=`${B.getConstants().DocumentsDirPath}/${e}`;return!n&&!await B.fileExists(r)?(n=!0,B.writeFile("documents",en(e),"{}","utf8")):JSON.parse(await B.readFile(r,"utf8"))},set:async function(r){await t,await B.writeFile("documents",en(e),JSON.stringify(r),"utf8")}}}});var rn={};D(rn,{awaitSyncWrapper:()=>Ue,createFileBackend:()=>Fe,createMMKVBackend:()=>_e,createProxy:()=>Lr,createStorage:()=>le,purgeStorage:()=>tn,useProxy:()=>k,wrapSync:()=>xe});function Lr(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=qt();function n(r,o){return new Proxy(r,{get(a,i){if(i===Or)return t;let m=[...o,i],g=a[i];return g!=null?(t.emit("GET",{path:m,value:g}),typeof g=="object"?n(g,m):g):g},set(a,i,m){return a[i]=m,t.emit("SET",{path:[...o,i],value:m}),!0},deleteProperty(a,i){let m=delete a[i];return m&&t.emit("DEL",{path:[...o,i]}),m}})}return{proxy:n(e,[]),emitter:t}}function k(e){if(e[nn])throw e[nn];let t=e[Or];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}=Lr(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 m=arguments.length,g=new Array(m>1?m-1:0),l=1;l{"use strict";Pr();Br();Or=Symbol.for("vendetta.storage.emitter"),Mr=Symbol.for("vendetta.storage.accessor"),nn=Symbol.for("vendetta.storage.error");Ue=function(e){return new Promise(function(t){return e[Mr](t)})}});var on,Fa,P,Ce=s(()=>{"use strict";w();on=c("setLogFn").default,Fa=new on("Opti"),P=Fa});var un={};D(un,{color:()=>ue,fetchTheme:()=>Ze,getCurrentTheme:()=>yt,getThemes:()=>Ha,initThemes:()=>ln,installTheme:()=>Pe,patchChatBackground:()=>sn,removeTheme:()=>cn,selectTheme:()=>ht,themes:()=>F,updateThemes:()=>Fr});async function an(e){if(typeof e!="object")throw new Error("Theme must be an object");await Fe("vendetta_theme.json").set(e)}function sn(){let e=yt()?.data?.background;if(!e)return;let t=O("MessagesWrapperConnected",!1);if(!t)return;let{MessagesWrapper:n}=c("MessagesWrapper");if(!n)return;let r=[y("default",t,function(o,a){return React.createElement(u.ImageBackground,{style:{flex:1,height:"100%"},source:{uri:e.url},blurRadius:typeof e.blur=="number"?e.blur:0,children:a})}),y("render",n.prototype,function(o,a){let i=$(a,function(m){return"HACK_fixModalInteraction"in m?.props&&m?.props?.style});i?i.props.style=Object.assign(u.StyleSheet.flatten(i.props.style??{}),{backgroundColor:"#0000"}):P.error("Didn't find Messages when patching MessagesWrapper!")})];return function(){return r.forEach(function(o){return o()})}}function kr(e){if(fe.valid(e))return fe(e).hex();let t=Number(u.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]&&=kr(t[n][r])}if(e.rawColors){let t=e.rawColors;for(let n in t)e.rawColors[n]=kr(t[n]);u.Platform.OS==="android"&&Va(t)}return e}function Va(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 Ze(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n;try{n=await(await we(e,{cache:"no-store"})).json()}catch{throw new Error(`Failed to fetch theme at ${e}`)}F[e]={id:e,selected:t,data:Ga(n)},t&&an(F[e])}async function Pe(e){if(typeof e!="string"||e in F)throw new Error("Theme already installed");await Ze(e)}async function ht(e){if(e==="default")return await an({});let t=Object.values(F).find(function(n){return n.selected})?.id;t&&(F[t].selected=!1),F[e].selected=!0,await an(F[e])}async function cn(e){let t=F[e];return t.selected&&await ht("default"),delete F[e],t.selected}function yt(){let e=window.__vendetta_loader?.features?.themes?.prop;return e&&window[e]||null}async function Fr(){await Ue(F);let e=yt();await Promise.allSettled(Object.keys(F).map(function(t){return Ze(t,e?.id===t)}))}async function ln(){let e=yt();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)}}),Y("resolveSemanticColor",ue.default.meta??ue.default.internal,function(n,r){if(!e)return r(...n);let[o,a]=n,[i,m]=Ur(o,a),g=o==="amoled"?2:o==="light"?1:0;let l=Ua[i]??i,b=(e.data?.semanticColors?.[i]??e.data?.semanticColors?.[l])?.[g];if(i==="CHAT_BACKGROUND"&&typeof e.data?.background?.alpha=="number")return fe(b||"black").alpha(1-e.data.background.alpha).hex();if(b)return b;let S=e.data?.rawColors?.[m.raw];return S?m.opacity===1?S:fe(S).alpha(m.opacity).hex():r(...n)}),await Fr()}function Ur(e,t){let n=t[Ur._sym??=Object.getOwnPropertySymbols(t)[0]],r=ue.SemanticColor[n];return[n,r[e.toLowerCase()]]}function Ha(){var e=0;return Object.keys(F).forEach(function(t){return e++}),e}var ue,F,Ua,ne=s(()=>{"use strict";h();ce();w();C();X();Ce();ue=c("SemanticColor"),F=xe(le(_e("VENDETTA_THEMES"))),Ua={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 Rt,Gr,u,fe,Et=s(()=>{"use strict";ne();C();Rt=function(e){for(let t in window.modules){let n=window.modules[t]?.publicModule.exports;if(n&&e(n))return n}},Gr=Rt(function(e){return e?.default?.name==="requireNativeComponent"});Gr&&Y("default",Gr,function(e,t){try{return t(...e)}catch{return e[0]}});window.React=Rt(function(e){return e.createElement});u=Rt(function(e){return e.AppRegistry}),fe=Rt(function(e){return e.brewer});if(window.__vendetta_loader?.features.themes)try{ln()}catch(e){console.error("[Opti] Failed to initialize themes...",e)}});var pn={};D(pn,{AsyncUsers:()=>tt,Flux:()=>Ya,FluxDispatcher:()=>Xa,Messages:()=>rt,NavigationNative:()=>me,Profiles:()=>Ne,React:()=>x,ReactNative:()=>u,User:()=>et,assets:()=>nt,channels:()=>mn,chroma:()=>fe,clipboard:()=>U,commands:()=>bt,constants:()=>Se,i18n:()=>re,invites:()=>za,lodash:()=>wt,moment:()=>dn,navigation:()=>Wa,navigationStack:()=>Ka,stylesheet:()=>N,toasts:()=>qe,url:()=>Ge,util:()=>Ja});function ja(e){if(fn){for(let t in e)e[t]=new Proxy(u.StyleSheet.flatten(e[t]),{get(n,r,o){let a=Reflect.get(n,r,o);return Vr.isSemanticColor(a)?Vr.resolveSemanticColor($a.theme,a):a}});return e}}var $a,fn,Vr,Se,mn,re,Ge,qe,et,tt,Ne,N,U,nt,za,bt,Wa,Ka,me,rt,Ya,Xa,x,dn,wt,Ja,h=s(()=>{"use strict";w();Et();Et();Et();$a=ee("ThemeStore"),fn=c("colors","unsafe_rawColors"),Vr=fn?.internal??fn?.meta;Se=c("Fonts","Permissions"),mn=c("getVoiceChannelId"),re=c("Messages"),Ge=c("openURL","openDeeplink"),qe=W(function(e){return e.open&&e.close&&!e.startDrag&&!e.init&&!e.openReplay&&!e.setAlwaysOnTop&&!e.setAccountFlag}),et=c("getCurrentUser"),tt=c("getUser","fetchProfile"),Ne=c("showUserProfile"),N={...W(function(e){return e.createStyles&&!e.ActionSheet}),createThemedStyleSheet:ja,...c("createThemedStyleSheet")},U=c("setString","getString","hasString"),nt=c("registerAsset"),za=c("acceptInviteAndTransitionToInviteChannel"),bt=c("getBuiltInCommands"),Wa=c("pushLazy"),Ka=c("createStackNavigator"),me=c("NavigationContainer"),rt=c("sendBotMessage"),Ya=c("connectStores"),Xa=c("_currentDispatchActionType"),x=window.React,dn=c("isMoment"),wt=c("forEachRight"),Ja=c("inspect","isNullOrUndefined")});var hn={};D(hn,{all:()=>de,find:()=>Qa,getAssetByID:()=>qa,getAssetByName:()=>Za,getAssetIDByName:()=>f,patchAssets:()=>gn});function gn(){let e=y("registerAsset",nt,function(t,n){let r=t[0];de[r.name]={...r,id:n}});for(let t=1;;t++){let n=nt.getAssetByID(t);if(!n)break;de[n.name]||(de[n.name]={...n,id:t})}return e}var de,Qa,Za,qa,f,v=s(()=>{"use strict";h();C();de={};Qa=function(e){return Object.values(de).find(e)},Za=function(e){return de[e]},qa=function(e){return nt.getAssetByID(e)},f=function(e){return de[e]?.id}});var yn={};D(yn,{showToast:()=>R});var ei,R,oe=s(()=>{"use strict";w();h();({uuid4:ei}=c("uuid4")),R=function(e,t){return qe.open({key:`vd-toast-${ei()}`,content:e,source:t,icon:t})}});var bn={};D(bn,{connectToDebugger:()=>Rn,getDebugInfo:()=>se,patchLogHook:()=>En,socket:()=>j,versionHash:()=>_t});function Rn(e){if(j!==void 0&&j.readyState!==WebSocket.CLOSED&&j.close(),!e){R("Invalid debugger URL!",f("Small"));return}j=new WebSocket(`ws://${e}`),j.addEventListener("open",function(){return R("Connected to debugger.",f("Check"))}),j.addEventListener("message",function(t){try{(0,eval)(t.data)}catch(n){console.error(n)}}),j.addEventListener("error",function(t){console.log(`Debugger error: ${t.message}`),R("An error occurred with the debugger connection!",f("Small"))})}function En(){let e=y("nativeLoggingHook",globalThis,function(t){j?.readyState===WebSocket.OPEN&&j.send(JSON.stringify({message:t[0],level:t[1]})),P.log(t[0])});return function(){j&&j.close(),e()}}function se(){let e=window.HermesInternal.getRuntimeProperties(),t=e["OSS Release Version"],n="for RN ",r=u.Platform.constants,o=r.reactNativeVersion;return{vendetta:{version:_t,loader:window.__vendetta_loader?.name??"Unknown"},discord:{version:Je.Version,build:Je.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"]},...u.Platform.select({android:{os:{name:"Android",version:r.Release,sdk:r.Version}},ios:{os:{name:r.systemName,version:r.osVersion}}}),...u.Platform.select({android:{device:{manufacturer:r.Manufacturer,brand:r.Brand,model:r.Model,codename:ke.device}},ios:{device:{manufacturer:ke.deviceManufacturer,brand:ke.deviceBrand,model:ke.deviceModel,codename:ke.device}}})}}var j,_t,be=s(()=>{"use strict";h();C();Ee();v();oe();Ce();_t="60dca5b"});var ve,Ve,Hr,He,ot=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"})(ve||(ve={}));(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"})(Ve||(Ve={}));(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"})(Hr||(Hr={}));(function(e){e[e.CHAT=1]="CHAT",e[e.USER=2]="USER",e[e.MESSAGE=3]="MESSAGE"})(He||(He={}))});var Sn={};D(Sn,{patchCommands:()=>_n,registerCommand:()=>xn});function _n(){let e=y("getBuiltInCommands",bt,function(t,n){let[r]=t;if(r===He.CHAT)return[...n,...wn]});return function(){wn=[],e()}}function xn(e){for(let t in e){let n=bt.getBuiltInCommands(He.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:He.CHAT,inputType:Ve.BUILT_IN,...o,__isOpti:!0}}wn.push(...e)}var wn,xt=s(()=>{"use strict";ot();h();C();wn=[]});var ti,ni,ri,$r,jr=s(()=>{"use strict";ti=function(e){return{status:"fulfilled",value:e}},ni=function(e){return{status:"rejected",reason:e}},ri=function(e){return Promise.resolve(e).then(ti,ni)},$r=function(e){return Promise.all(Array.from(e).map(ri))}});var d,J,z=s(()=>{"use strict";X();d=xe(le(_e("VENDETTA_SETTINGS"))),J=xe(le(Fe("vendetta_loader.json")))});var Bn={};D(Bn,{evalPlugin:()=>zr,fetchPlugin:()=>$e,getDisabledPlugins:()=>Nn,getPluginList:()=>Pn,getPlugins:()=>Cn,getSettings:()=>Dn,initPlugins:()=>In,installPlugin:()=>Ae,plugins:()=>M,pluginsList:()=>vn,removePlugin:()=>An,startPlugin:()=>je,stopPlugin:()=>ze,stoppedPlugins:()=>Tn});async function $e(e){e.endsWith("/")||(e+="/");let t=M[e],n;try{n=await(await we(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 we(e+(n.main||"index.js"),{cache:"no-store"})).text()}catch{}if(!r&&!t)throw new Error(`Failed to fetch JS for ${e}`);M[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 M)throw new Error("Plugin already installed");await $e(e),t&&await je(e)}async function zr(e){let t={...window.vendetta,plugin:{id:e.id,manifest:e.manifest,storage:await le(_e(e.id))},logger:new on(`Opti \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 je(e){e.endsWith("/")||(e+="/");let t=M[e];if(!t)throw new Error("Attempted to start non-existent plugin");try{let n=await zr(t);Te[e]=n,n.onLoad?.(),vn.push(" "+t.manifest.name),t.enabled=!0}catch(n){Tn.push(" "+t.id),P.error(`Plugin ${t.id} errored whilst loading, and will be unloaded`,n);try{Te[t.id]?.onUnload?.()}catch(r){P.error(`Plugin ${t.id} errored whilst unloading`,r)}delete Te[e],t.enabled=!1}}function ze(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;e.endsWith("/")||(e+="/");let n=M[e],r=Te[e];if(!n)throw new Error("Attempted to stop non-existent plugin");try{r?.onUnload?.()}catch(o){P.error(`Plugin ${n.id} errored whilst unloading`,o)}delete Te[e],t&&(n.enabled=!1)}async function An(e){e.endsWith("/")||(e+="/"),M[e].enabled&&ze(e),delete M[e],await tn(e)}async function In(){await Ue(d),await Ue(M);let e=Object.keys(M);return await $r(e.filter(function(t){return M[t].enabled}).map(async function(t){return M[t].update&&await $e(t).catch(function(n){return P.error(n.message)}),await je(t)})),e.filter(function(t){return!M[t].enabled&&M[t].update}).forEach(function(t){return $e(t)}),oi}function Cn(){var e=0;return Object.keys(Te).forEach(function(t){return e++}),e}function Pn(){return vn.sort()}function Nn(){return Tn.sort()}var M,Te,vn,Tn,oi,Dn,pe=s(()=>{"use strict";ce();X();jr();Ce();z();M=xe(le(_e("VENDETTA_PLUGINS"))),Te={},vn=new Array,Tn=new Array;oi=function(){return Object.keys(Te).forEach(function(e){return ze(e,!1)})};Dn=function(e){return Te[e]?.settings}});var De,Wr,Kr=s(()=>{"use strict";ot();h();be();De=se(),Wr=[{name:"debug",description:"Prints Optis debug information to chat.",inputType:Ve.BUILT_IN,__isOpti:!0,execute(e,t){let n=`**Opti Debug Info** > **Opti Version**: ${De.vendetta.version} > **Discord Version**: ${De.discord.version} (Build ${De.discord.build}) > **Device**: ${De.device.brand} (${De.os.name} ${De.os.version}) > **Codename/Machine ID**: ${De.device.codename}`;rt.sendMessage(t.channel.id,{content:n})}}]});var Yr,Xr=s(()=>{"use strict";h();pe();Yr=[{name:"plugins list",description:"Lists all Opti plugins.",execute(e,t){let n=`**Enabled Plugins (${Cn()}):** > ${Pn()} **Disabled Plugins:** > ${Nn()}`;rt.sendMessage(t.channel.id,{content:n})}}]});var Jr,Qr=s(()=>{"use strict";Ee();Jr=[{name:"reload",description:"Reload Discord.",execute(){Ie.reload()}}]});function Zr(){let e=[...Wr,...Jr,...Yr];xn(e)}var qr=s(()=>{"use strict";xt();Kr();Xr();Qr()});var Fn={};D(Fn,{BADGES:()=>ai,DISCORD_SERVER:()=>On,DISCORD_SERVER_ID:()=>Mn,GITHUB:()=>kn,HTTP_REGEX:()=>ii,HTTP_REGEX_MULTI:()=>st,PLUGINS_CHANNEL_ID:()=>Ln,PROXY_PREFIX:()=>Be,THEMES_CHANNEL_ID:()=>at,VENDETTA_PROXY:()=>it});var On,Mn,Ln,at,kn,ai,Be,it,ii,st,Oe=s(()=>{"use strict";On="https://discord.gg/zm5MWBPeRp",Mn="1228081962883747880",Ln="1228464451846672465",at="1228464459295756358",kn="https://github.com/opti-mod",ai="https://raw.githubusercontent.com/opti-mod/badges/main/",Be="https://opti-mod.github.io/proxy/",it="https://vd-plugins.github.io/proxy/",ii=/^https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_\+.~#?&\/=]*)$/,st=/https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_\+.~#?&//=]*)/g});function We(e){let{label:t,icon:n,noPadding:r=!1,noAnimation:o=!1,children:a}=e,{FormRow:i,FormDivider:m}=E,[g,l]=React.useState(!0);return React.createElement(React.Fragment,null,React.createElement(i,{label:t,leading:n&&React.createElement(i.Icon,{source:f(n)}),trailing:React.createElement(i.Arrow,{style:{transform:[{rotate:`${g?180:90}deg`}]}}),onPress:function(){l(!g),o||u.LayoutAnimation.configureNext(u.LayoutAnimation.Presets.easeInEaseOut)}}),!g&&React.createElement(React.Fragment,null,React.createElement(m,null),React.createElement(u.View,{style:!r&&{paddingHorizontal:15}},a)))}var eo=s(()=>{"use strict";h();v();G()});function to(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var no=s(()=>{});function ro(e,t){for(var n=0;n{});function io(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var so=s(()=>{});function St(e,t){return St=Object.setPrototypeOf||function(r,o){return r.__proto__=o,r},St(e,t)}var co=s(()=>{});function lo(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 uo=s(()=>{co()});function ct(e){return ct=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},ct(e)}var fo=s(()=>{});function mo(){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 po=s(()=>{});function go(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var ho=s(()=>{});function yo(e){"@swc/helpers - typeof";return e&&typeof Symbol<"u"&&e.constructor===Symbol?"symbol":typeof e}var Ro=s(()=>{});function Eo(e,t){return t&&(yo(t)==="object"||typeof t=="function")?t:go(e)}var bo=s(()=>{ho();Ro()});function wo(e){var t=mo();return function(){var r=ct(e),o;if(t){var a=ct(this).constructor;o=Reflect.construct(r,arguments,a)}else o=r.apply(this,arguments);return Eo(this,o)}}var _o=s(()=>{fo();po();bo()});var vt,si,V,Un=s(()=>{"use strict";no();ao();so();uo();_o();h();G();vt=N.createThemedStyleSheet({view:{flex:1,flexDirection:"column",margin:10},title:{fontSize:20,textAlign:"center",marginBottom:5},br:{fontSize:0,padding:1}}),V=function(e){"use strict";lo(n,e);var t=wo(n);function n(r){to(this,n);var o;return o=t.call(this,r),o.state={hasErr:!1},o}return oo(n,[{key:"render",value:function(){var o=this;return this.state.hasErr?x.createElement(u.ScrollView,{style:vt.view},x.createElement(E.FormText,{style:vt.title},"Opti has encountered an error."),x.createElement(lt,{selectable:!0,style:{marginBottom:5,maxHeight:400}},this.state.errStack),x.createElement(E.FormText,{style:vt.br}," "),x.createElement(ae,{color:ae.Colors.RED,size:ae.Sizes.MEDIUM,look:ae.Looks.FILLED,onPress:function(){return o.setState({hasErr:!1})},text:"Retry"}),x.createElement(E.FormText,{style:vt.br}," "),x.createElement(ae,{color:ae.Colors.BRAND,size:ae.Sizes.MEDIUM,look:ae.Looks.FILLED,onPress:function(){return U.setString(""+o.state.errStack)},text:"Copy"})):this.props.children}}]),n}(si=x.Component);io(V,"getDerivedStateFromError",function(e){return{hasErr:!0,errText:e.message,errName:e.name,errCause:e.cause,errStack:e.stack}})});var Gn={};D(Gn,{rawColors:()=>ci,semanticColors:()=>I});var I,ci,Ke=s(()=>{"use strict";h();ne();I=ue?.default?.colors??Se?.ThemeColorMap,ci=ue?.default?.unsafe_rawColors??Se?.Colors});function lt(e){let{selectable:t,style:n,children:r}=e;return t?u.Platform.select({ios:React.createElement(li,{style:n,children:r}),default:React.createElement(xo,{style:n,children:r,selectable:!0})}):React.createElement(xo,{style:n,children:r})}var So,li,xo,vo=s(()=>{"use strict";h();Ke();So=N.createThemedStyleSheet({codeBlock:{fontFamily:Se.Fonts.CODE_SEMIBOLD,fontSize:12,textAlignVertical:"center",backgroundColor:I.BACKGROUND_SECONDARY,color:I.TEXT_NORMAL,borderWidth:1,borderRadius:4,borderColor:I.BACKGROUND_TERTIARY,padding:10}}),li=function(e){let{style:t,children:n}=e;return React.createElement(u.TextInput,{editable:!1,multiline:!0,style:[So.codeBlock,t&&t],value:n})},xo=function(e){let{selectable:t,style:n,children:r}=e;return React.createElement(u.Text,{selectable:t,style:[So.codeBlock,n&&n]},r)}});function Ye(e){let{onChangeText:t,placeholder:n,style:r}=e;return React.createElement(ui,{style:[fi.search,r],placeholder:n,onChangeText:t})}var ui,fi,To=s(()=>{"use strict";h();w();ui=O("StaticSearchBarContainer"),fi=N.createThemedStyleSheet({search:{margin:0,padding:0,borderBottomWidth:0,backgroundColor:"none"}})});var Hn={};D(Hn,{Alert:()=>Vn,Button:()=>ae,Codeblock:()=>lt,ErrorBoundary:()=>V,Forms:()=>E,General:()=>mi,HelpMessage:()=>di,SafeAreaView:()=>pi,Search:()=>Ye,Summary:()=>We});var E,mi,Vn,ae,di,pi,G=s(()=>{"use strict";w();eo();Un();vo();To();E=c("Form","FormSection"),mi=c("Button","Text","View"),Vn=Vt("FluxContainer(Alert)"),ae=c("Looks","Colors","Sizes"),di=O("HelpMessage"),pi=c("useSafeAreaInsets").SafeAreaView});function Ao(){return y("default",gi,function(e,t){let[{thread:n}]=e;if(n.guild_id!==Mn)return;let r;if(n.parent_id===Ln)r="Plugin";else if(n.parent_id===at&&window.__vendetta_loader?.features.themes)r="Theme";else return;let{firstMessage:o}=Ri(n),a=o?.content?.match(st);if(!a)return;r==="Plugin"?a=a.filter(function(l){return l.startsWith(Be)}):a=a.filter(function(l){return l.endsWith(".json")});let i=a[0];if(!i)return;let m=$(t,function(l){return l?.[0]?.key}),g=m[0].type;m.unshift(React.createElement(g,{key:"install"},React.createElement(hi,{leading:React.createElement(yi,{style:{opacity:1},source:f("ic_download_24px")}),label:`Install ${r}`,onPress:function(){return(r==="Plugin"?Ae:Pe)(i).then(function(){R(`Successfully installed ${n.name}`,f("Check"))}).catch(function(l){R(l.message,f("Small"))}).finally(function(){return Ei()})}})))})}var gi,hi,yi,Ri,Ei,Io=s(()=>{"use strict";w();Oe();C();pe();ne();ce();v();oe();G();gi=O("ForumPostLongPressActionSheet",!1),{FormRow:hi,FormIcon:yi}=E,{useFirstForumPostMessage:Ri}=c("useFirstForumPostMessage"),{hideActionSheet:Ei}=c("openLazy","hideActionSheet")});function $n(e){let{title:t,confirmText:n,confirmColor:r,onConfirm:o,cancelText:a,placeholder:i,initialValue:m="",secureTextEntry:g}=e,[l,b]=React.useState(m),[S,p]=React.useState("");function _(){Promise.resolve(o(l)).then(function(){Co.close()}).catch(function(Z){p(Z.message)})}return React.createElement(Vn,{title:t,confirmText:n,confirmColor:r,isConfirmButtonDisabled:S.length!==0,onConfirm:_,cancelText:a,onCancel:function(){return Co.close()}},React.createElement(bi,{placeholder:i,value:l,onChange:function(A){b(typeof A=="string"?A:A.text),S&&p("")},returnKeyType:"done",onSubmitEditing:_,error:S||void 0,secureTextEntry:g,autoFocus:!0,showBorder:!0,style:{paddingVertical:5,alignSelf:"stretch",paddingHorizontal:0}}))}var bi,Co,Po=s(()=>{"use strict";w();G();({FormInput:bi}=E),Co=c("openLazy","close")});var zn={};D(zn,{showConfirmationAlert:()=>Q,showCustomAlert:()=>Do,showInputAlert:()=>jn});function Q(e){let t=e;return t.body=e.content,delete t.content,t.isDismissable??=!0,No.show(t)}var No,Do,jn,Me=s(()=>{"use strict";w();Po();No=c("openLazy","close");Do=function(e,t){return No.openLazy({importer:async function(){return function(){return React.createElement(e,t)}}})},jn=function(e){return Do($n,e)}});function Bo(e){return e.startsWith(Be)||e.startsWith(it)?"Plugin":e.endsWith(".json")&&window.__vendetta_loader?.features.themes?"Theme":void 0}function Oo(e,t){(e==="Plugin"?Ae:Pe)(t).then(function(){R("Successfully installed",f("Check"))}).catch(function(n){R(n.message,f("Small"))})}function Mo(){let e=new Array;return e.push(y("showSimpleActionSheet",wi,function(t){if(t[0].key!=="LongPressUrl")return;let{header:{title:n},options:r}=t[0],o=Bo(n);o&&r.push({label:`Install ${o}`,onPress:function(){return Oo(o,n)}})})),e.push(Y("handleClick",_i,async function(t,n){let{href:r}=t[0],o=Bo(r);if(!o)return n.apply(this,t);if(o==="Theme"&&vi(Si())?.parent_id!==at)return n.apply(this,t);Q({title:"Hold Up",content:["This link is a ",React.createElement(u.Text,{style:Ti["text-md/semibold"]},o),", would you like to install it?"],onConfirm:function(){return Oo(o,r)},confirmText:"Install",cancelText:"Cancel",secondaryConfirmText:"Open in Browser",onConfirmSecondary:function(){return xi(r)}})})),function(){return e.forEach(function(t){return t()})}}var wi,_i,xi,Si,vi,Ti,Lo=s(()=>{"use strict";w();h();Oe();C();pe();ne();Me();v();oe();wi=W(function(e){return e?.showSimpleActionSheet&&!Object.getOwnPropertyDescriptor(e,"showSimpleActionSheet")?.get}),_i=c("handleClick"),{openURL:xi}=Ge,{getChannelId:Si}=mn,{getChannel:vi}=c("getChannel"),{TextStyleSheet:Ti}=c("TextStyleSheet")});function Wn(){let e=new Array;return e.push(Ao()),e.push(Mo()),function(){return e.forEach(function(t){return t()})}}var ko=s(()=>{"use strict";Io();Lo()});function Kn(e){let{alertTitle:t,installFunction:n}=e;return React.createElement(u.TouchableOpacity,{onPress:function(){return U.getString().then(function(r){return jn({title:t,initialValue:r.match(st)?.[0]??"",placeholder:"https://example.com/",onConfirm:function(o){return n(o)},confirmText:"Install",cancelText:"Cancel"})})}},React.createElement(u.Image,{style:Ai.icon,source:f("ic_add_24px")}))}var Ai,Fo=s(()=>{"use strict";h();Oe();Me();v();Ke();Ai=N.createThemedStyleSheet({icon:{marginRight:10,tintColor:I.HEADER_PRIMARY}})});function Yn(e){let{asset:t}=e;return React.createElement(Ii,{label:`${t.name} - ${t.id}`,trailing:React.createElement(u.Image,{source:t.id,style:{width:32,height:32}}),onPress:function(){U.setString(t.name),R("Copied asset name to clipboard.",f("toast_copy_link"))}})}var Ii,Uo=s(()=>{"use strict";h();oe();v();G();({FormRow:Ii}=E)});function Xn(){let[e,t]=React.useState("");return React.createElement(V,null,React.createElement(u.View,{style:{flex:1}},React.createElement(Ye,{style:{margin:10},onChangeText:function(n){return t(n)},placeholder:"Search Assets"}),React.createElement(u.FlatList,{data:Object.values(de).filter(function(n){return n.name.includes(e)||n.id.toString()===e}),renderItem:function(n){let{item:r}=n;return React.createElement(Yn,{asset:r})},ItemSeparatorComponent:Ci,keyExtractor:function(n){return n.name}})))}var Ci,Go=s(()=>{"use strict";h();v();G();Uo();({FormDivider:Ci}=E)});function Tt(e){let{label:t,version:n,icon:r}=e;return React.createElement(Vo,{label:t,leading:React.createElement(Vo.Icon,{source:f(r)}),trailing:React.createElement(Pi,{style:{fontSize:13}},n),onPress:function(){U.setString(`${t} - ${n}`),R("Copied version to clipboard.",f("toast_copy_link"))}})}var Vo,Pi,Ho=s(()=>{"use strict";h();v();oe();G();({FormRow:Vo,FormText:Pi}=E)});function Jn(){let e=me.useNavigation();k(d),k(J);let t=[{label:"Discord Version",version:`${L.discord.version} (${L.discord.build})`,icon:"Discord"},{label:"React",version:L.react.version,icon:"ic_category_16px"},{label:"React Native",version:L.react.nativeVersion,icon:"mobile"},{label:"Bytecode",version:L.hermes.bytecodeVersion,icon:"ic_server_security_24px"}],n=[{label:"Loader",version:L.vendetta.loader,icon:"ic_download_24px"},{label:"OS",version:`${L.os.name} ${L.os.version}`,icon:"ic_cog_24px"},...L.os.sdk?[{label:"SDK",version:L.os.sdk,icon:"ic_profile_badge_verified_developer_color"}]:[],{label:"Manufacturer",version:L.device.manufacturer,icon:"ic_badge_staff"},{label:"Brand",version:L.device.brand,icon:"ic_settings_boost_24px"},{label:"Model",version:L.device.model,icon:"ic_phonelink_24px"},{label:u.Platform.select({android:"Codename",ios:"Machine ID"}),version:L.device.codename,icon:"ic_compose_24px"}];return React.createElement(V,null,React.createElement(u.ScrollView,{style:{flex:1},contentContainerStyle:{paddingBottom:38}},React.createElement(At,{title:"Important",titleStyleType:"no_border"},React.createElement(T,{label:"Opti Version",leading:React.createElement(T.Icon,{source:{uri:"https://raw.githubusercontent.com/Opti-mod/assets/main/LogoOpti.png"}}),trailing:React.createElement(Ni,{style:{fontSize:13,color:"white"}},L.vendetta.version),onPress:function(){return U.setString(L.vendetta.version)}}),React.createElement(H,null),React.createElement(T,{label:"Discord Server",leading:React.createElement(T.Icon,{source:f("Discord")}),trailing:T.Arrow,onPress:function(){return Ge.openDeeplink(On)}}),React.createElement(H,null),React.createElement(T,{label:"GitHub Repository",leading:React.createElement(T.Icon,{source:f("img_account_sync_github_white")}),trailing:T.Arrow,onPress:function(){return Ge.openURL(kn)}})),React.createElement(At,{title:"Actions"},React.createElement(T,{label:"Reload Discord",leading:React.createElement(T.Icon,{source:f("ic_message_retry")}),onPress:function(){return Ie.reload()}}),React.createElement(H,null),React.createElement(T,{label:"Asset Browser",leading:React.createElement(T.Icon,{source:f("ic_image")}),trailing:T.Arrow,onPress:function(){return e.push("VendettaCustomPage",{title:"Asset Browser",render:Xn})}}),React.createElement(H,null)),React.createElement(At,{title:"Info"},React.createElement(We,{label:"Versions",icon:"ic_information_filled_24px"},t.map(function(r,o){return React.createElement(React.Fragment,null,React.createElement(Tt,{label:r.label,version:r.version,icon:r.icon}),o!==t.length-1&&React.createElement(H,null))})),React.createElement(H,null),React.createElement(We,{label:"Platform",icon:"ic_mobile_device"},n.map(function(r,o){return React.createElement(React.Fragment,null,React.createElement(Tt,{label:r.label,version:r.version,icon:r.icon}),o!==n.length-1&&React.createElement(H,null))})),React.createElement(H,null)),React.createElement(At,{title:"Developer"},React.createElement(jo,{value:d.debuggerUrl,onChange:function(r){return d.debuggerUrl=r},placeholder:"127.0.0.1:9090",title:"Debugger URL"}),React.createElement(H,null),React.createElement(T,{label:"Connect to debug websocket",leading:React.createElement(T.Icon,{source:f("copy")}),onPress:function(){return Rn(d.debuggerUrl)}}),window.__vendetta_rdc&&React.createElement(React.Fragment,null,React.createElement(H,null),React.createElement(T,{label:"Connect to React DevTools",leading:React.createElement(T.Icon,{source:f("ic_badge_staff")}),onPress:function(){return window.__vendetta_rdc?.connectToDevTools({host:d.debuggerUrl.split(":")?.[0],resolveRNStyle:u.StyleSheet.flatten})}})),window.__vendetta_loader?.features.loaderConfig&&React.createElement(React.Fragment,null,React.createElement($o,{label:"Load from custom url",subLabel:"Load Opti from a custom endpoint.",leading:React.createElement(T.Icon,{source:f("copy")}),value:J.customLoadUrl.enabled,onValueChange:function(r){J.customLoadUrl.enabled=r}}),React.createElement(H,null),J.customLoadUrl.enabled&&React.createElement(React.Fragment,null,React.createElement(jo,{value:J.customLoadUrl.url,onChange:function(r){return J.customLoadUrl.url=r},placeholder:"http://localhost:4040/vendetta.js",title:"OPTI URL"}),React.createElement(H,null)),window.__vendetta_loader.features.devtools&&React.createElement($o,{label:"Load React DevTools",subLabel:`Version: ${window.__vendetta_loader.features.devtools.version}`,leading:React.createElement(T.Icon,{source:f("ic_badge_staff")}),value:J.loadReactDevTools,onValueChange:function(r){J.loadReactDevTools=r}}),React.createElement(H,null)))))}var T,$o,At,H,jo,Ni,L,zo=s(()=>{"use strict";h();Oe();be();X();Ee();v();G();z();z();Go();Ho();be();({FormRow:T,FormSwitchRow:$o,FormSection:At,FormDivider:H,FormInput:jo,FormText:Ni}=E),L=se()});function It(e){let{items:t,card:n}=e;k(d),k(t);let[r,o]=React.useState("");return React.createElement(V,null,React.createElement(u.FlatList,{ListHeaderComponent:React.createElement(React.Fragment,null,React.createElement(u.View,{style:{marginBottom:10}}),React.createElement(Ye,{style:{marginBottom:10},onChangeText:function(a){return o(a.toLowerCase())},placeholder:"Search"})),style:{paddingHorizontal:10,paddingTop:20},contentContainerStyle:{paddingBottom:20},data:Object.values(t).filter(function(a){return a.id?.toLowerCase().includes(r)}),renderItem:function(a){let{item:i,index:m}=a;return React.createElement(n,{item:i,index:m})}}))}var Wo=s(()=>{"use strict";h();X();G();z()});function ft(e){let t=e.toggleValue??!1;return React.createElement(u.View,{style:[Le.card,{marginTop:e.index!==0?10:0}]},React.createElement(ut,{style:Le.header,label:function(){return React.createElement(u.View,null,React.createElement(u.Text,{style:Le.headertitle},e.headerLabel))},leading:e.headerIcon&&React.createElement(ut.Icon,{source:f(e.headerIcon)}),trailing:e.toggleType&&(e.toggleType==="switch"?React.createElement(Di,{style:u.Platform.OS==="android"&&{marginVertical:-15},value:e.toggleValue,onValueChange:e.onToggleChange}):React.createElement(u.Pressable,{onPress:function(){t=!t,e.onToggleChange?.(t)}},React.createElement(Bi,{selected:e.toggleValue}))),optiLogo:e.optiLogo&&React.createElement(u.View,null,React.createElement(ut.Icon,{source:{uri:"https://raw.githubusercontent.com/Opti-mod/assets/main/LogoOpti.png"}}))}),React.createElement(Oi,null),React.createElement(ut,{label:function(){return React.createElement(u.View,null,React.createElement(u.Text,{style:Le.description},e.descriptionLabel))},trailing:React.createElement(u.View,{style:Le.actions},e.overflowActions&&React.createElement(u.TouchableOpacity,{onPress:function(){return Li({key:"CardOverflow",header:{title:e.overflowTitle,icon:e.headerIcon&&React.createElement(ut.Icon,{style:{marginRight:8},source:f(e.headerIcon)}),onClose:function(){return Mi()}},options:e.overflowActions?.map(function(n){return{...n,icon:f(n.icon)}})})}},React.createElement(u.Image,{style:Le.icon,source:f("ic_more_24px")})),e.actions?.map(function(n){let{icon:r,onPress:o}=n;return React.createElement(u.TouchableOpacity,{onPress:o},React.createElement(u.Image,{style:Le.icon,source:f(r)}))}))}))}var ut,Di,Bi,Oi,Mi,Li,Le,Qn=s(()=>{"use strict";h();w();v();Ke();G();({FormRow:ut,FormSwitch:Di,FormRadio:Bi,FormDivider:Oi}=E),{hideActionSheet:Mi}=c("openLazy","hideActionSheet"),{showSimpleActionSheet:Li}=c("showSimpleActionSheet"),Le=N.createThemedStyleSheet({card:{backgroundColor:I.BACKGROUND_SECONDARY,borderRadius:7,borderColor:I.BACKGROUND_TERTIARY,borderWidth:1},header:{padding:0,backgroundColor:I.PRIMARY_DARK,color:I.HEADER_PRIMARY,borderTopLeftRadius:5,borderTopRightRadius:5},headertitle:{fontFamily:Se.Fonts.PRIMARY_BOLD,fontSize:17,color:I.HEADER_PRIMARY},description:{color:I.TEXT_MUTED,fontSize:13},authors:{color:I.HEADER_SECONDARY,fontSize:14},actions:{flexDirection:"row-reverse",alignItems:"center"},icon:{width:22,height:22,marginLeft:5,tintColor:I?.INTERACTIVE_NORMAL}})});async function Ko(e,t){e.enabled&&ze(e.id,!1),t(),e.enabled&&await je(e.id)}function Zn(e){let{item:t,index:n}=e,r=Dn(t.id),o=me.useNavigation(),[a,i]=React.useState(!1),m=t.manifest.authors,g=t.manifest.vendetta?.version??"";return a?null:React.createElement(ft,{index:n,headerLabel:`${t.manifest.name} ${g}`,headerIcon:t.manifest.vendetta?.icon||"ic_application_command_24px",toggleType:"switch",toggleValue:t.enabled,onToggleChange:function(l){try{l?je(t.id):ze(t.id)}catch(b){R(b.message,f("Small"))}},descriptionLabel:`${t.manifest.description} Authors: ${m.map(function(l){return l.name}).join(", ")}`,overflowTitle:t.manifest.name,overflowActions:[{label:"View Creator Profile",icon:"ic_profile_24px",onPress:function(){et.getUser(t.manifest.authors[0]?.id)?Ne.showUserProfile({userId:t.manifest.authors[0]?.id}):tt.fetchProfile(t.manifest.authors[0]?.id).then(function(){Ne.showUserProfile({userId:t.manifest.authors[0]?.id})})}},{icon:"RetryIcon",label:"Refetch",onPress:async function(){Ko(t,function(){$e(t.id).then(async function(){R("Successfully refetched plugin.",f("toast_image_saved"))}).catch(function(){R("Failed to refetch plugin!",f("Small"))})})}},{icon:"copy",label:"Copy URL",onPress:function(){U.setString(t.id),R("Copied plugin URL to clipboard.",f("toast_copy_link"))}},{icon:"ic_download_24px",label:t.update?"Disable updates":"Enable updates",onPress:function(){t.update=!t.update,R(`${t.update?"Enabled":"Disabled"} updates for ${t.manifest.name}.`,f("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:ve.RED,onConfirm:function(){Ko(t,function(){try{Re.removeItem(t.id),R(`Cleared data for ${t.manifest.name}.`,f("trash"))}catch{R(`Failed to clear data for ${t.manifest.name}!`,f("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:ve.RED,onConfirm:function(){try{An(t.id),i(!0)}catch(l){R(l.message,f("Small"))}}})}}],actions:[...r?[{icon:"settings",onPress:function(){return o.push("VendettaCustomPage",{title:t.manifest.name,render:r})}}]:[]]})}var Yo=s(()=>{"use strict";ot();h();pe();Ee();v();oe();Me();Qn()});async function Xo(e,t){await ht(e?t:"default"),Ie.reload()}function qn(e){let{item:t,index:n}=e;k(d);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:"switch",toggleValue:t.selected,onToggleChange:function(i){Xo(i,t.id)},overflowTitle:t.data.name,overflowActions:[{label:"View Creator Profile",icon:"ic_profile_24px",onPress:function(){et.getUser(t.data.authors[0]?.id)?Ne.showUserProfile({userId:t.data.authors[0]?.id}):tt.fetchProfile(t.data.authors[0]?.id).then(function(){Ne.showUserProfile({userId:t.data.authors[0]?.id})})}},{icon:"ic_sync_24px",label:"Refetch",onPress:function(){Ze(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:ve.RED,onConfirm:function(){return Ie.reload()}}):R("Successfully refetched theme.",f("toast_image_saved"))}).catch(function(){R("Failed to refetch theme!",f("Small"))})}},{icon:"copy",label:"Copy URL",onPress:function(){U.setString(t.id),R("Copied shader URL to clipboard.",f("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:ve.RED,onConfirm:function(){cn(t.id).then(function(i){o(!0),i&&Xo(!1,t.id)}).catch(function(i){R(i.message,f("Small"))})}})}}]})}var Jo=s(()=>{"use strict";ot();h();ne();X();Ee();v();Me();oe();z();Qn()});function Ct(){console.log("TweakManager has loaded SilentTyping."),Qo=["startTyping","stopTyping"].map(function(e){return Y(e,ki,function(){})})}function Pt(){Qo.forEach(function(e){return e()})}var ki,Qo,er=s(()=>{"use strict";C();w();ki=c("startTyping"),Qo=[]});function Nt(){console.log("TweakManager has loaded RemoveChatButtons.");let e=["ic_thread_normal_24px","ic_gift","AppsIcon"].map(function(t){return f(t)});Zo=y("render",Fi.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 Dt(){}var Fi,Zo,tr=s(()=>{"use strict";C();w();v();ce();Fi=O("ChatInput")});function Bt(){console.log("TweakManager has loaded RemovePrompts.");let e=c("show","openLazy");qo=Y("show",e,function(t,n){t?.[0]?.title===re.Messages.DELETE_MESSAGE||t?.[0]?.title===re.Messages.PIN_MESSAGE?t[0].onConfirm?.():n(...t)}),ea.push(y("isTrustedDomain",Ui,function(){return!0}))}function Ot(){for(let e of ea)e()}var Ui,qo,ea,nr=s(()=>{"use strict";C();w();h();C();w();Ui=ee("MaskedLinkStore"),ea=[]});function rr(){return k(d),d.tweaks??={},React.createElement(V,null,React.createElement(u.View,{style:{flex:1}},React.createElement(ge,{label:"Tweaks are small QoL adjustments that you can enable."}),React.createElement(Mt,null),React.createElement(ge,{label:d.tweaks.silentTyping?.valueOf()?"Silent Typing (Enabled)":"Silent Typing (Disabled)",subLabel:"Hides that you are typing to other people.",leading:React.createElement(ge.Icon,{source:f("bell")}),onPress:function(){d.tweaks.silentTyping??=!1,d.tweaks.silentTyping=!d.tweaks.silentTyping,(d.tweaks.silentTyping?Ct:Pt)()}}),React.createElement(Mt,null),React.createElement(ge,{label:d.tweaks.hideButtons?.valueOf()?"Remove Chat Buttons (Enabled)":"Remove Chat Buttons (Disabled)",subLabel:"Removes the Gift, Voice Message, and Activities buton.",leading:React.createElement(ge.Icon,{source:f("ic_trash_24px")}),onPress:function(){d.tweaks.hideButtons??=!1,d.tweaks.hideButtons=!d.tweaks.hideButtons,(d.tweaks.hideButtons?Nt:Dt)()}}),React.createElement(Mt,null),React.createElement(ge,{label:d.tweaks.removePrompts?.valueOf()?"Remove Prompts (Enabled)":"Remove Prompts (Disabled)",subLabel:"Removes the pin, delete, and trusted URL prompts for messages.",leading:React.createElement(ge.Icon,{source:f("ic_message_delete")}),onPress:function(){d.tweaks.removePrompts??=!0,d.tweaks.removePrompts=!d.tweaks.removePrompts,(d.tweaks.removePrompts?Bt:Ot)()}}),React.createElement(Mt,null),React.createElement(ge,{label:d.tweaks.externalbadges?.valueOf()?"Global Badges (Enabled)":"Global Badges (Disabled)",subLabel:"Load custom badges from other clients. (Opti badges will still show up.)",leading:React.createElement(ge.Icon,{source:f("ic_person_shield")}),onPress:function(){d.tweaks.externalbadges??=!0,d.tweaks.externalbadges=!d.tweaks.externalbadges}})))}var Mt,ge,ta=s(()=>{"use strict";h();G();v();er();tr();z();X();nr();({FormDivider:Mt,FormRow:ge}=E)});function or(){k(d);let[e,t]=React.useState("plugins"),n=[{id:"plugins",title:"Plugins",page:function(){return React.createElement(It,{items:M,card:Zn})}},{id:"shaders",title:"Shaders",page:function(){return React.createElement(It,{items:F,card:qn})}},{id:"tweaks",title:"Tweaks",page:function(){return React.createElement(rr,null)}}];return React.createElement(React.Fragment,null,React.createElement(u.View,{style:Vi.bar},React.createElement(Gi,{tabs:n,activeTab:e,onTabSelected:function(r){return t(r)}})),React.createElement(n.find(function(r){return r.id===e}).page))}var Gi,Vi,na=s(()=>{"use strict";X();pe();ne();z();Wo();Yo();h();Jo();w();ta();({BadgableTabBar:Gi}=c("BadgableTabBar")),Vi=N.createThemedStyleSheet({bar:{padding:8}})});var Hi,am,im,sm,cm,$i,ar,Lt,Xe,mt,ra,ir,kt=s(()=>{"use strict";h();pe();ne();Me();Ke();oe();ce();v();Un();Fo();zo();Oe();G();na();({FormRow:Hi,FormSwitchRow:am,FormSection:im,FormDivider:sm,FormInput:cm}=E),$i=N.createThemedStyleSheet({container:{flex:1,backgroundColor:I.BACKGROUND_MOBILE_PRIMARY}}),ar=function(e,t){return t?wt.snakeCase(e).toUpperCase():e},Lt=function(e,t){return Object.fromEntries(e.map(function(n){return[n.key,typeof t=="function"?t(n):typeof t=="string"?n[t]:t]}))},Xe=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return[{key:ar("VendettaSettings",e),title:"Opti",icon:"ic_settings_boost_24px",render:Jn},{key:ar("VendettaAddons",e),title:"Addons",icon:"CirclePlusIcon-primary",render:or,options:{headerRight:function(){return React.createElement(Kn,{alertTitle:"Install Addon",installFunction:async function(t){if(t.endsWith(".json"))return await Pe(t);if(!t.startsWith(Be)||!t.startsWith(it))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 R("Installed plugin",f("Check"))}).catch(function(n){return R(n?.message??`${n}`,f("Small"))})},cancelText:"Cancel"})});else return await Ae(t)}})}}},{key:ar("VendettaCustomPage",e),title:"Opti Page",shouldRender:function(){return!1},render:function(t){let{render:n,noErrorBoundary:r,...o}=t,a=me.useNavigation();return a.addListener("focus",function(){return a.setOptions(K(o,"render","noErrorBoundary"))}),r?React.createElement(n,null):React.createElement(V,null,React.createElement(n,null))}}]},mt=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return Xe(e).filter(function(t){return t.shouldRender?.()??!0})},ra=function(){return Lt(Xe(),function(e){return{title:e.title,render:e.render,...e.options}})},ir=function(){let e=Xe(!0);return{getLayout:function(){return{title:"Opti",label:"Opti",settings:mt(!0).map(function(t){return t.key})}},titleConfig:Lt(e,"title"),relationships:Lt(e,null),rendererConfigs:Lt(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(u.View,{style:$i.container},React.createElement(t.render,a.params))});return{type:"route",title:function(){return t.title},icon:React.createElement(Hi.Icon,null,"s.icon")?f(""+t.icon):t.icon,screen:{route:wt.chain(t.key).camelCase().upperFirst().value(),getComponent:function(){return n}}}})}}});function cr(){let e=me.useNavigation();k(d);let t=mt();return React.createElement(V,null,React.createElement(ji,{key:"Opti",title:"Opti"},t.map(function(n,r){return React.createElement(React.Fragment,null,React.createElement(sr,{label:n.title,leading:React.createElement(sr.Icon,{source:f(n.icon)}),trailing:sr.Arrow,onPress:function(){return e.push(n.key)}}),r!==t.length-1&&React.createElement(zi,null))})))}var sr,ji,zi,hm,oa=s(()=>{"use strict";h();X();v();kt();G();z();({FormRow:sr,FormSection:ji,FormDivider:zi,FormText:hm}=E)});function lr(){let e=new Array;return e.push(y("default",Wi,function(t,n){return{...n,...ra()}})),y("default",Ki,function(t,n){let r=$(n.props.children,function(o){return o.type&&o.type.name==="UserSettingsOverview"});e.push(y("renderSupportAndAcknowledgements",r.type.prototype,function(o,a){let{props:{children:i}}=a,m=i.findIndex(function(g){return g?.type?.name==="UploadLogsButton"});m!==-1&&i.splice(m,1)})),e.push(y("render",r.type.prototype,function(o,a){let{props:{children:i}}=a,m=[re.Messages.BILLING_SETTINGS,re.Messages.PREMIUM_SETTINGS];i=$(i,function(l){return l.children?.[1].type?.name==="FormSection"}).children;let g=i.findIndex(function(l){return m.includes(l?.props.label)});i.splice(g===-1?4:g,0,React.createElement(cr,null))}))},!0),function(){return e.forEach(function(t){return t()})}}var Wi,Ki,aa=s(()=>{"use strict";h();w();C();ce();kt();oa();Wi=O("getScreens",!1),Ki=O("UserSettingsOverviewWrapper",!1)});function fr(){let e=new Array;return Xi(e)||Yi(e),function(){return e.forEach(function(t){return t?.()})}}function Yi(e){let t=c("useOverviewSettings"),n=c("getSettingTitleConfig"),r=c("SETTING_RELATIONSHIPS","SETTING_RENDERER_CONFIGS"),o="getSettingSearchListItems",a="getSettingListItems",i=c(o),m=!i,g=m?a:o,l=i??c(a);if(!l||!t)return;let b=Xe(!0),S=mt(!0),p=ir();e.push(y("useOverviewSettings",t,function(Z,he){return ia(he,p.getLayout())})),e.push(y("getSettingTitleConfig",n,function(Z,he){return{...he,...p.titleConfig}})),e.push(y(g,l,function(Z,he){let[Aa]=Z;return[...S.filter(function(q){return Aa.includes(q.key)}).map(function(q){return{type:"setting_search_result",ancestorRendererData:p.rendererConfigs[q.key],setting:q.key,title:p.titleConfig[q.key],breadcrumbs:["Opti"],icon:p.rendererConfigs[q.key].icon}}),...he.filter(function(q){return m||!b.map(function(Ut){return Ut.key}).includes(q.setting)})].map(function(q,Ut,Ia){return{...q,index:Ut,total:Ia.length}})}));let _=r.SETTING_RELATIONSHIPS,A=r.SETTING_RENDERER_CONFIGS;return r.SETTING_RELATIONSHIPS={..._,...p.relationships},r.SETTING_RENDERER_CONFIGS={...A,...p.rendererConfigs},e.push(function(){r.SETTING_RELATIONSHIPS=_,r.SETTING_RENDERER_CONFIGS=A}),!0}function Xi(e){let t=c("SearchableSettingsList"),n=c("SETTING_RENDERER_CONFIG"),r=c("getSettingListItems");if(!r||!t||!n)return!1;let o=Xe(!0),a=ir();e.push(Xt("type",t.SearchableSettingsList,function(m){let[{sections:g}]=m;return ia(g,a.getLayout())})),e.push(y("getSettingListSearchResultItems",r,function(m,g){g.forEach(function(l){return o.some(function(b){return b.key===l.setting})&&(l.breadcrumbs=["Opti"])})}));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 ur(o,"Opti")}))return;let n=e.findIndex(function(o){return ur(o,re.Messages.ACCOUNT_SETTINGS)});e.splice(n+1,0,t);let r=e.find(function(o){return ur(o,re.Messages.SUPPORT)});r&&(r.settings=r.settings.filter(function(o){return o!=="UPLOAD_DEBUG_LOGS"}))}var ur,sa=s(()=>{"use strict";w();C();kt();h();ur=function(e,t){return e?.label===t||e?.title===t}});function mr(){let e=[lr(),fr()];return function(){return e.forEach(function(t){return t?.()})}}var ca=s(()=>{"use strict";aa();sa()});function ma(e){let{locale:t}=e;try{la&&(la.overrideTheme(Ji?.theme??"dark"),ua&&Qi.useAMOLEDTheme===2&&ua.setAMOLEDThemeEnabled(!0))}catch(n){P.error("Failed to fix theme...",n)}try{dn.locale(t.toLowerCase())}catch(n){P.error("Failed to fix timestamps...",n)}fa.unsubscribe("I18N_LOAD_SUCCESS",ma)}function da(){return fa.subscribe("I18N_LOAD_SUCCESS",ma)}var la,ua,Ji,Qi,fa,pa=s(()=>{"use strict";h();w();Ce();la=c("updateTheme","overrideTheme"),ua=c("setAMOLEDThemeEnabled"),Ji=ee("ThemeStore"),Qi=ee("UnsyncedUserSettingsStore"),fa=c("_currentDispatchActionType","_subscriptions","_actionHandlers","_waitQueue")});async function ga(e){return{patcher:K(Cr,"unpatchAll"),metro:{...Ht,common:{...pn}},constants:Fn,utils:zt,debug:K(bn,"versionHash","patchLogHook"),ui:{components:Hn,toasts:yn,alerts:zn,assets:hn,...Gn},plugins:K(Bn,"initPlugins","evalPlugin"),themes:K(un,"initThemes"),commands:K(Sn,"patchCommands"),storage:rn,settings:d,loader:{identity:window.__vendetta_loader,config:J},logger:P,version:_t,unload:function(){e.filter(function(t){return typeof t=="function"}).forEach(function(t){return t()}),delete window.vendetta}}}var ha=s(()=>{"use strict";C();Ce();z();Oe();be();pe();ne();xt();X();w();h();G();oe();Me();v();Ke();ce()});var Zi,qi,es,ya,Ra=s(()=>{"use strict";h();({View:Zi,Image:qi,TouchableOpacity:es}=u),ya=function(e){let{name:t,image:n,size:r,margin:o,custom:a}=e,i=N.createThemedStyleSheet({container:{flexDirection:"row",alignItems:"center",flexWrap:"wrap",justifyContent:"flex-end"},img:{width:r,height:r,resizeMode:"contain",marginHorizontal:o}}),m=function(){return a||x.createElement(es,{onPress:function(){return qe.open({content:t,source:{uri:n}})}},x.createElement(qi,{style:i.img,source:{uri:n}}))};return x.createElement(Zi,{style:i.container},m())}});function ba(){let e=O("ProfileBadges",!1);ns=y("default",e,function(t,n){let r=n,[,o]=x.useReducer(function(b){return b=!b},!1),a=t[0]?.user;if(a===void 0)return;if(Ft=ie.get(a.id),Ft===void 0){rs(a.id,o),os(a.id,o);return}let i=r?.props?.style,{replugged:m}=Ft?.badges,g=`#${m?.custom?.color||"7289da"}`;r||(r=x.createElement(ts,{style:[i,{flexDirection:"row",flexWrap:"wrap",alignItems:"flex-end",justifyContent:"flex-end",paddingVertical:2}],accessibilityRole:"list",accessibilityLabel:"User Badges"}),r.props.children=[]);let l=function(b){let{name:S,image:p,custom:_=!1}=b,A=function(){return x.createElement(ya,{custom:_,name:S,image:p,size:Array.isArray(i)?i?.find(function(he){return he.paddingVertical&&he.paddingHorizontal})?16:22:16,margin:Array.isArray(i)?4:6})},Z="PUSH";r?.props?.badges?Z?r.props.badges=[x.createElement(A,null),...r.props.badges]:r.props.badges=[...r.props.badges,x.createElement(A,null)]:Z?r.props.children=[x.createElement(A,null),...r.props.children]:r.props.children=[...r.props.children,x.createElement(A,null)]};Object.entries(Ft?.badges).forEach(function(b){let[S,p]=b;if(!(d.tweaks.externalbadges?.valueOf()==!1&&S!=="opti"))switch(S){case"customBadgesArray":p&&p.badges.map(function(_){l({name:_.name,image:_.badge})});break;case"opti":p?.developer&&l({name:"Opti Developer",image:"https://raw.githubusercontent.com/Opti-mod/assets/main/BadgeDeveloper.png"}),p?.contributor&&l({name:"Opti Contributor",image:"https://raw.githubusercontent.com/Opti-mod/assets/main/BadgeContributor.png"}),p?.supporter&&l({name:"Opti Supporter",image:"https://raw.githubusercontent.com/Opti-mod/assets/main/BadgeSupporter.png"});break;case"aliu":p?.dev&&l({name:"Aliucord Dev",image:"https://cdn.discordapp.com/emojis/860165259117199401.webp"}),p?.donor&&l({name:"Aliucord Donor",image:"https://cdn.discordapp.com/emojis/859801776232202280.webp"}),p?.contributor&&l({name:"Aliucord Contributor",image:"https://cdn.discordapp.com/emojis/886587553187246120.webp"});break;case"bd":p?.dev&&l({name:"BetterDiscord Dev",image:""});break;case"enmity":p?.supporter?.data&&l({name:"Enmity Supporter",image:p?.supporter?.data.url.dark}),p?.staff?.data&&l({name:"Enmity Staff",image:p?.staff?.data.url.dark}),p?.dev?.data&&l({name:"Enmity Dev",image:p?.dev?.data.url.dark}),p?.contributor?.data&&l({name:"Enmity Contributor",image:p?.contributor?.data.url.dark}),p[a.id]?.data&&l({name:"Enmity User",image:p[a.id]?.data.url.dark});break;case"replugged":p?.developer&&l({name:"Replugged Developer",image:""}),p?.staff&&l({name:"Replugged Staff",image:""}),p?.support&&l({name:"Replugged Support",image:""}),p?.contributor&&l({name:"Replugged Contributor",image:""}),p?.translator&&l({name:"Replugged Translator",image:""}),p?.hunter&&l({name:"Replugged Hunter",image:""}),p?.early&&l({name:"Replugged Early Access",image:""}),p?.booster&&l({name:"Replugged Booster",image:""}),p?.custom?.name&&l({name:p.custom.name,image:p.custom.icon});break;case"vencord":p?.contributor&&l({name:"Vencord Contributor",image:"https://vencord.dev/assets/favicon.png"}),p?.cutie&&p.cutie.map(function(_){l({name:_.tooltip,image:_.badge})});break;default:break}})})}async function rs(e,t){if(!ie.has(e)||ie.get(e).lastFetch+Ea{"use strict";w();C();h();Ra();z();({View:ts}=u),ie=new Map,Ea=1e3*60*30});function _a(){let e=c("startSession"),t=ee("AuthenticationStore"),n=c("_currentDispatchActionType","_subscriptions","_actionHandlers","_waitQueue");try{as=y("startSession",e,function(r,o){setTimeout(function(){t.getSessionId()||(n?.dispatch({type:"APP_STATE_UPDATE",state:"active"}),console.log("Successfully patched infinite loading."))},200)})}catch{console.log("Failed to patch infinite connection, please reload the app.")}}var as,xa=s(()=>{"use strict";w();C()});function dr(){d.tweaks??={},console.log("TweakManager has successfully initialized."),d.tweaks.hideButtons==null&&(d.tweaks.hideButtons=!1),d.tweaks.silentTyping==null&&(d.tweaks.silentTyping=!1),d.tweaks.removePrompts==null&&(d.tweaks.removePrompts=!1),d.tweaks.externalbadges==null&&(d.tweaks.externalbadges=!0),(d.tweaks.hideButtons?Nt:Dt)(),(d.tweaks.silentTyping?Ct:Pt)(),(d.tweaks.removePrompts?Bt:Ot)(),_a(),ba()}var Sa=s(()=>{"use strict";z();er();tr();nr();wa();xa()});var va={};D(va,{default:()=>is});async function is(){let e=await Promise.all([En(),gn(),_n(),sn(),da(),mr(),Wn()]);try{window.vendetta=await ga(e)}catch{P.log("Opti has failed to load.")}e.push(await In()),e.push(await dr()),e.push(await Zr()),P.log("Opti has loaded!")}var Ta=s(()=>{"use strict";be();xt();pe();ne();v();qr();ko();ca();pa();Ce();ha();Sa()});Ee();be();console.log("Opti has loaded!");Object.freeze=Object;Object.seal=Object;Promise.resolve().then(()=>(Ta(),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: ${Je.Build}`,"Opti Version: 60dca5b",e?.stack||e.toString()].join(` `))});se().discord.version==223&&alert("You are running on Discord v223. This version is known to have many crashes and issues with modded clients. Continue at your own risk.");})(); //# sourceURL=Vendetta