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