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