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