es(h)||d.push(h);const f=[];for(const h of l){const b=u[h],B=s.data[h];f.push({key:{status:\"valid\",value:h},value:b._parse(new Y(s,B,s.path,h)),alwaysSet:h in s.data})}if(this._def.catchall instanceof q){const h=this._def.unknownKeys;if(h===\"passthrough\")for(const b of d)f.push({key:{status:\"valid\",value:b},value:{status:\"valid\",value:s.data[b]}});else if(h===\"strict\")d.length>0&&(v(s,{code:y.unrecognized_keys,keys:d}),o.dirty());else if(h!==\"strip\")throw new Error(\"Internal ZodObject error: invalid unknownKeys value.\")}else{const h=this._def.catchall;for(const b of d){const B=s.data[b];f.push({key:{status:\"valid\",value:b},value:h._parse(new Y(s,B,s.path,b)),alwaysSet:b in s.data})}}return s.common.async?Promise.resolve().then(async function(){const h=[];for(const b of f){const B=await b.key;h.push({key:B,value:await b.value,alwaysSet:b.alwaysSet})}return h}).then(function(h){return U.mergeObjectSync(o,h)}):U.mergeObjectSync(o,f)}},{key:\"shape\",get:function(){return this._def.shape()}},{key:\"strict\",value:function(t){var a=this;return _.errToObj,new n({...this._def,unknownKeys:\"strict\",...t!==void 0?{errorMap:function(o,s){var u,l,d,f;const h=(d=(l=(u=a._def).errorMap)===null||l===void 0?void 0:l.call(u,o,s).message)!==null&&d!==void 0?d:s.defaultError;return o.code===\"unrecognized_keys\"?{message:(f=_.errToObj(t).message)!==null&&f!==void 0?f:h}:{message:h}}}:{}})}},{key:\"strip\",value:function(){return new n({...this._def,unknownKeys:\"strip\"})}},{key:\"passthrough\",value:function(){return new n({...this._def,unknownKeys:\"passthrough\"})}},{key:\"extend\",value:function(t){var a=this;return new n({...this._def,shape:function(){return{...a._def.shape(),...t}}})}},{key:\"merge\",value:function(t){var a=this;return new n({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:function(){return{...a._def.shape(),...t._def.shape()}},typeName:k.ZodObject})}},{key:\"setKey\",value:function(t,a){return this.augment({[t]:a})}},{key:\"catchall\",value:function(t){return new n({...this._def,catchall:t})}},{key:\"pick\",value:function(t){var a=this;const o={};return P.objectKeys(t).forEach(function(s){t[s]&&a.shape[s]&&(o[s]=a.shape[s])}),new n({...this._def,shape:function(){return o}})}},{key:\"omit\",value:function(t){var a=this;const o={};return P.objectKeys(this.shape).forEach(function(s){t[s]||(o[s]=a.shape[s])}),new n({...this._def,shape:function(){return o}})}},{key:\"deepPartial\",value:function(){return me(this)}},{key:\"partial\",value:function(t){var a=this;const o={};return P.objectKeys(this.shape).forEach(function(s){const u=a.shape[s];t&&!t[s]?o[s]=u:o[s]=u.optional()}),new n({...this._def,shape:function(){return o}})}},{key:\"required\",value:function(t){var a=this;const o={};return P.objectKeys(this.shape).forEach(function(s){if(t&&!t[s])o[s]=a.shape[s];else{let l=a.shape[s];for(;l instanceof X;)l=l._def.innerType;o[s]=l}}),new n({...this._def,shape:function(){return o}})}},{key:\"keyof\",value:function(){return Qt(P.objectKeys(this.shape))}}]),n}(S);z.create=function(e,i){return new z({shape:function(){return e},unknownKeys:\"strip\",catchall:q.create(),typeName:k.ZodObject,...E(i)})},z.strictCreate=function(e,i){return new z({shape:function(){return e},unknownKeys:\"strict\",catchall:q.create(),typeName:k.ZodObject,...E(i)})},z.lazycreate=function(e,i){return new z({shape:e,unknownKeys:\"strip\",catchall:q.create(),typeName:k.ZodObject,...E(i)})};let Ze=function(e){A(n,e);var i=N(n);function n(){return x(this,n),i.apply(this,arguments)}return T(n,[{key:\"_parse\",value:function(t){const{ctx:a}=this._processInputParams(t),o=this._def.options;function s(u){for(const d of u)if(d.result.status===\"valid\")return d.result;for(const d of u)if(d.result.status===\"dirty\")return a.common.issues.push(...d.ctx.common.issues),d.result;const l=u.map(function(d){return new J(d.ctx.common.issues)});return v(a,{code:y.invalid_union,unionErrors:l}),w}if(a.common.async)return Promise.all(o.map(async function(u){const l={...a,common:{...a.common,issues:[]},parent:null};return{result:await u._parseAsync({data:a.data,path:a.path,parent:l}),ctx:l}})).then(s);{let u;const l=[];for(const f of o){const h={...a,common:{...a.common,issues:[]},parent:null},b=f._parseSync({data:a.data,path:a.path,parent:h});if(b.status===\"valid\")return b;b.status===\"dirty\"&&!u&&(u={result:b,ctx:h}),h.common.issues.length&&l.push(h.common.issues)}if(u)return a.common.issues.push(...u.ctx.common.issues),u.result;const d=l.map(function(f){return new J(f)});return v(a,{code:y.invalid_union,unionErrors:d}),w}}},{key:\"options\",get:function(){return this._def.options}}]),n}(S);Ze.create=function(e,i){return new Ze({options:e,typeName:k.ZodUnion,...E(i)})};const Ke=function(e){return e instanceof $e?Ke(e.schema):e instanceof H?Ke(e.innerType()):e instanceof Le?[e.value]:e instanceof je?e.options:e instanceof Me?Object.keys(e.enum):e instanceof Ve?Ke(e._def.innerType):e instanceof De?[void 0]:e instanceof Oe?[null]:null};let qt=function(e){A(n,e);var i=N(n);function n(){return x(this,n),i.apply(this,arguments)}return T(n,[{key:\"_parse\",value:function(t){const{ctx:a}=this._processInputParams(t);if(a.parsedType!==m.object)return v(a,{code:y.invalid_type,expected:m.object,received:a.parsedType}),w;const o=this.discriminator,s=a.data[o],u=this.optionsMap.get(s);return u?a.common.async?u._parseAsync({data:a.data,path:a.path,parent:a}):u._parseSync({data:a.data,path:a.path,parent:a}):(v(a,{code:y.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),w)}},{key:\"discriminator\",get:function(){return this._def.discriminator}},{key:\"options\",get:function(){return this._def.options}},{key:\"optionsMap\",get:function(){return this._def.optionsMap}}],[{key:\"create\",value:function(t,a,o){const s=new Map;for(const u of a){const l=Ke(u.shape[t]);if(!l)throw new Error(`A discriminator value for key \\`${t}\\` could not be extracted from all schema options`);for(const d of l){if(s.has(d))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(d)}`);s.set(d,u)}}return new n({typeName:k.ZodDiscriminatedUnion,discriminator:t,options:a,optionsMap:s,...E(o)})}}]),n}(S);function Rt(e,i){const n=ee(e),r=ee(i);if(e===i)return{valid:!0,data:e};if(n===m.object&&r===m.object){const t=P.objectKeys(i),a=P.objectKeys(e).filter(function(s){return t.indexOf(s)!==-1}),o={...e,...i};for(const s of a){const u=Rt(e[s],i[s]);if(!u.valid)return{valid:!1};o[s]=u.data}return{valid:!0,data:o}}else if(n===m.array&&r===m.array){if(e.length!==i.length)return{valid:!1};const t=[];for(let a=0;athis._def.items.length&&(v(s,{code:y.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:\"array\"}),o.dirty());const l=[...s.data].map(function(d,f){const h=a._def.items[f]||a._def.rest;return h?h._parse(new Y(s,d,s.path,f)):null}).filter(function(d){return!!d});return s.common.async?Promise.all(l).then(function(d){return U.mergeArray(o,d)}):U.mergeArray(o,l)}},{key:\"items\",get:function(){return this._def.items}},{key:\"rest\",value:function(r){return new n({...this._def,rest:r})}}]),n}(S);te.create=function(e,i){if(!Array.isArray(e))throw new Error(\"You must pass an array of schemas to z.tuple([ ... ])\");return new te({items:e,typeName:k.ZodTuple,rest:null,...E(i)})};let Xt=function(e){A(n,e);var i=N(n);function n(){return x(this,n),i.apply(this,arguments)}return T(n,[{key:\"keySchema\",get:function(){return this._def.keyType}},{key:\"valueSchema\",get:function(){return this._def.valueType}},{key:\"_parse\",value:function(t){const{status:a,ctx:o}=this._processInputParams(t);if(o.parsedType!==m.object)return v(o,{code:y.invalid_type,expected:m.object,received:o.parsedType}),w;const s=[],u=this._def.keyType,l=this._def.valueType;for(const d in o.data)s.push({key:u._parse(new Y(o,d,o.path,d)),value:l._parse(new Y(o,o.data[d],o.path,d))});return o.common.async?U.mergeObjectAsync(a,s):U.mergeObjectSync(a,s)}},{key:\"element\",get:function(){return this._def.valueType}}],[{key:\"create\",value:function(t,a,o){return a instanceof S?new n({keyType:t,valueType:a,typeName:k.ZodRecord,...E(o)}):new n({keyType:he.create(),valueType:t,typeName:k.ZodRecord,...E(a)})}}]),n}(S),Qe=function(e){A(n,e);var i=N(n);function n(){return x(this,n),i.apply(this,arguments)}return T(n,[{key:\"keySchema\",get:function(){return this._def.keyType}},{key:\"valueSchema\",get:function(){return this._def.valueType}},{key:\"_parse\",value:function(t){const{status:a,ctx:o}=this._processInputParams(t);if(o.parsedType!==m.map)return v(o,{code:y.invalid_type,expected:m.map,received:o.parsedType}),w;const s=this._def.keyType,u=this._def.valueType,l=[...o.data.entries()].map(function(d,f){let[h,b]=d;return{key:s._parse(new Y(o,h,o.path,[f,\"key\"])),value:u._parse(new Y(o,b,o.path,[f,\"value\"]))}});if(o.common.async){const d=new Map;return Promise.resolve().then(async function(){for(const f of l){const h=await f.key,b=await f.value;if(h.status===\"aborted\"||b.status===\"aborted\")return w;(h.status===\"dirty\"||b.status===\"dirty\")&&a.dirty(),d.set(h.value,b.value)}return{status:a.value,value:d}})}else{const d=new Map;for(const f of l){const h=f.key,b=f.value;if(h.status===\"aborted\"||b.status===\"aborted\")return w;(h.status===\"dirty\"||b.status===\"dirty\")&&a.dirty(),d.set(h.value,b.value)}return{status:a.value,value:d}}}}]),n}(S);Qe.create=function(e,i,n){return new Qe({valueType:i,keyType:e,typeName:k.ZodMap,...E(n)})};let et=function(e){A(n,e);var i=N(n);function n(){return x(this,n),i.apply(this,arguments)}return T(n,[{key:\"_parse\",value:function(t){const{status:a,ctx:o}=this._processInputParams(t);if(o.parsedType!==m.set)return v(o,{code:y.invalid_type,expected:m.set,received:o.parsedType}),w;const s=this._def;s.minSize!==null&&o.data.sizes.maxSize.value&&(v(o,{code:y.too_big,maximum:s.maxSize.value,type:\"set\",inclusive:!0,exact:!1,message:s.maxSize.message}),a.dirty());const u=this._def.valueType;function l(f){const h=new Set;for(const b of f){if(b.status===\"aborted\")return w;b.status===\"dirty\"&&a.dirty(),h.add(b.value)}return{status:a.value,value:h}}const d=[...o.data.values()].map(function(f,h){return u._parse(new Y(o,f,o.path,h))});return o.common.async?Promise.all(d).then(function(f){return l(f)}):l(d)}},{key:\"min\",value:function(t,a){return new n({...this._def,minSize:{value:t,message:_.toString(a)}})}},{key:\"max\",value:function(t,a){return new n({...this._def,maxSize:{value:t,message:_.toString(a)}})}},{key:\"size\",value:function(r,t){return this.min(r,t).max(r,t)}},{key:\"nonempty\",value:function(t){return this.min(1,t)}}]),n}(S);et.create=function(e,i){return new et({valueType:e,minSize:null,maxSize:null,typeName:k.ZodSet,...E(i)})};let Kt=function(e){A(n,e);var i=N(n);function n(){x(this,n);var r;return r=i.call(this,...arguments),r.validate=r.implement,r}return T(n,[{key:\"_parse\",value:function(t){const{ctx:a}=this._processInputParams(t);if(a.parsedType!==m.function)return v(a,{code:y.invalid_type,expected:m.function,received:a.parsedType}),w;function o(d,f){return Ye({data:d,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,We(),Se].filter(function(h){return!!h}),issueData:{code:y.invalid_arguments,argumentsError:f}})}function s(d,f){return Ye({data:d,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,We(),Se].filter(function(h){return!!h}),issueData:{code:y.invalid_return_type,returnTypeError:f}})}const u={errorMap:a.common.contextualErrorMap},l=a.data;if(this._def.returns instanceof ve){const d=this;return V(async function(){for(var f=arguments.length,h=new Array(f),b=0;b1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return e?ge.create().superRefine(function(r,t){var a,o;if(!e(r)){const s=typeof i==\"function\"?i(r):typeof i==\"string\"?{message:i}:i,u=(o=(a=s.fatal)!==null&&a!==void 0?a:n)!==null&&o!==void 0?o:!0,l=typeof s==\"string\"?{message:s}:s;t.addIssue({code:\"custom\",...l,fatal:u})}}):ge.create()},vr={object:z.lazycreate};var k;(function(e){e.ZodString=\"ZodString\",e.ZodNumber=\"ZodNumber\",e.ZodNaN=\"ZodNaN\",e.ZodBigInt=\"ZodBigInt\",e.ZodBoolean=\"ZodBoolean\",e.ZodDate=\"ZodDate\",e.ZodSymbol=\"ZodSymbol\",e.ZodUndefined=\"ZodUndefined\",e.ZodNull=\"ZodNull\",e.ZodAny=\"ZodAny\",e.ZodUnknown=\"ZodUnknown\",e.ZodNever=\"ZodNever\",e.ZodVoid=\"ZodVoid\",e.ZodArray=\"ZodArray\",e.ZodObject=\"ZodObject\",e.ZodUnion=\"ZodUnion\",e.ZodDiscriminatedUnion=\"ZodDiscriminatedUnion\",e.ZodIntersection=\"ZodIntersection\",e.ZodTuple=\"ZodTuple\",e.ZodRecord=\"ZodRecord\",e.ZodMap=\"ZodMap\",e.ZodSet=\"ZodSet\",e.ZodFunction=\"ZodFunction\",e.ZodLazy=\"ZodLazy\",e.ZodLiteral=\"ZodLiteral\",e.ZodEnum=\"ZodEnum\",e.ZodEffects=\"ZodEffects\",e.ZodNativeEnum=\"ZodNativeEnum\",e.ZodOptional=\"ZodOptional\",e.ZodNullable=\"ZodNullable\",e.ZodDefault=\"ZodDefault\",e.ZodCatch=\"ZodCatch\",e.ZodPromise=\"ZodPromise\",e.ZodBranded=\"ZodBranded\",e.ZodPipeline=\"ZodPipeline\",e.ZodReadonly=\"ZodReadonly\"})(k||(k={}));const _r=function(e){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{message:`Input not instance of ${e.name}`};return tn(function(n){return n instanceof e},i)},nn=he.create,rn=Ae.create,br=nt.create,kr=Ne.create,an=Ie.create,Rr=Pe.create,wr=qe.create,Er=De.create,xr=Oe.create,Tr=ge.create,Sr=de.create,Cr=q.create,Ar=Xe.create,Nr=fe.create,Ir=z.create,Pr=z.strictCreate,Dr=Ze.create,Or=qt.create,Zr=Be.create,Br=te.create,$r=Xt.create,Lr=Qe.create,jr=et.create,Mr=Kt.create,Vr=$e.create,Ur=Le.create,zr=je.create,Jr=Me.create,Hr=ve.create,sn=H.create,Fr=X.create,Wr=pe.create,Yr=H.createWithPreprocess,Gr=wt.create;var O=Object.freeze({__proto__:null,defaultErrorMap:Se,setErrorMap:ar,getErrorMap:We,makeIssue:Ye,EMPTY_PATH:ir,addIssueToContext:v,ParseStatus:U,INVALID:w,DIRTY:Yt,OK:V,isAborted:_t,isDirty:bt,isValid:Ce,isAsync:Ge,get util(){return P},get objectUtil(){return vt},ZodParsedType:m,getParsedType:ee,ZodType:S,ZodString:he,ZodNumber:Ae,ZodBigInt:Ne,ZodBoolean:Ie,ZodDate:Pe,ZodSymbol:qe,ZodUndefined:De,ZodNull:Oe,ZodAny:ge,ZodUnknown:de,ZodNever:q,ZodVoid:Xe,ZodArray:fe,ZodObject:z,ZodUnion:Ze,ZodDiscriminatedUnion:qt,ZodIntersection:Be,ZodTuple:te,ZodRecord:Xt,ZodMap:Qe,ZodSet:et,ZodFunction:Kt,ZodLazy:$e,ZodLiteral:Le,ZodEnum:je,ZodNativeEnum:Me,ZodPromise:ve,ZodEffects:H,ZodTransformer:H,ZodOptional:X,ZodNullable:pe,ZodDefault:Ve,ZodCatch:tt,ZodNaN:nt,BRAND:mr,ZodBranded:en,ZodPipeline:wt,ZodReadonly:rt,custom:tn,Schema:S,ZodSchema:S,late:vr,get ZodFirstPartyTypeKind(){return k},coerce:{string:function(e){return he.create({...e,coerce:!0})},number:function(e){return Ae.create({...e,coerce:!0})},boolean:function(e){return Ie.create({...e,coerce:!0})},bigint:function(e){return Ne.create({...e,coerce:!0})},date:function(e){return Pe.create({...e,coerce:!0})}},any:Tr,array:Nr,bigint:kr,boolean:an,date:Rr,discriminatedUnion:Or,effect:sn,enum:zr,function:Mr,instanceof:_r,intersection:Zr,lazy:Vr,literal:Ur,map:Lr,nan:br,nativeEnum:Jr,never:Cr,null:xr,nullable:Wr,number:rn,object:Ir,oboolean:function(){return an().optional()},onumber:function(){return rn().optional()},optional:Fr,ostring:function(){return nn().optional()},pipeline:Gr,preprocess:Yr,promise:Hr,record:$r,set:jr,strictObject:Pr,string:nn,symbol:wr,transformer:sn,tuple:Br,undefined:Er,union:Dr,unknown:Sr,void:Ar,NEVER:w,ZodIssueCode:y,quotelessJson:rr,ZodError:J});const{View:qr,Text:Xr}=L.General,{FormSection:on}=L.Forms;let cn;const Kr=function(){const[e,i]=c.React.useReducer(function(r){return~r},0);cn=i;const n=c.stylesheet.createThemedStyleSheet({code:{fontFamily:c.constants.Fonts.CODE_SEMIBOLD,includeFontPadding:!1,color:$.semanticColors.TEXT_NORMAL}});return c.React.createElement(qr,null,c.React.createElement(on,{title:\"Live Raw Activity\"},ye.lastRawActivity?c.React.createElement(Xr,{style:n.code},JSON.stringify(ye.lastRawActivity,void 0,3)):p.settings.display?c.React.createElement(D,{variant:\"text-md/semibold\"},\"Display activity setting is disabled. You need to actually enable it for the raw activity to show up lmao\"):c.React.createElement(D,{variant:\"text-md/semibold\",onPress:function(){return Je()}},\"No last raw activity yet. Tap text to force update\")),c.React.createElement(on,{title:\"Info\"},c.React.createElement(D,{variant:\"text-md/semibold\",color:\"TEXT_NORMAL\"},\"Last raw activity update:\",\" \",ye.lastRawActivityTimestamp?new Date(ye.lastRawActivityTimestamp).toLocaleString(\"en-US\"):\"-\")))};function Qr(e){e.push(\"VendettaCustomPage\",{render:Kr,title:\"Live RawActivity\"})}const Et=\"https://discord.com/api/v9/\",{getToken:xt}=I.findByProps(\"getToken\");async function ea(){return await(await Bt.safeFetch(`${Et}applications?with_team_applications=true`,{headers:{authorization:xt()}})).json()}async function ta(e){return await(await Bt.safeFetch(`${Et}oauth2/applications/${e}/assets`,{cache:\"no-store\",headers:{authorization:xt()}})).json()}const ne={};async function un(e){if(ne[e])return ne[e];ne[e]=\"pending\";let i=(await(await fetch(`${Et}applications/0/external-assets`,{method:\"POST\",headers:{authorization:xt(),\"content-type\":\"application/json\"},body:JSON.stringify({urls:[e]})})).json())[0].external_asset_path;return i.startsWith(\"https://media.discordapp.net\")&&(i=i.split(\"/\").slice(3).join(\"/\")),ne[e]=i,i}const{View:ln,Image:na}=L.General;let dn;const ra=function(){const e=c.NavigationNative.useNavigation(),[i,n]=c.React.useState(\"\"),[r,t]=c.React.useState();dn=function(){return!a&&F.showInputAlert({title:\"Custom App ID\",placeholder:\"123\",confirmText:\"Use\",confirmColor:\"blue\",onConfirm:function(o){if(o.match(/^\\s*$/))return C.showToast(\"App ID cannot be empty\",g.getAssetIDByName(\"Small\"));if(Number.isNaN(Number(o)))return C.showToast(\"Invalid app ID\",g.getAssetIDByName(\"Small\"));at({id:o})},cancelText:\"Cancel\"})},c.React.useEffect(function(){n(\"\")},[]),r||ea().then(t);let a=!1;return r?c.React.createElement(c.ReactNative.FlatList,{ListHeaderComponent:c.React.createElement(L.Search,{style:{marginBottom:10},onChangeText:function(o){return n(o.toLowerCase())}}),style:{paddingHorizontal:10,paddingTop:10},contentContainerStyle:{paddingBottom:20},data:r.filter(function(o){return o.name.toLowerCase().includes(i.toLowerCase())}),renderItem:function(o){const{item:s}=o;return c.React.createElement(c.ReactNative.TouchableOpacity,{onPress:function(){a||(a=!0,e.goBack(),at?.({id:s.id,name:s.name}))}},c.React.createElement(ln,{style:{marginHorizontal:8,marginBottom:8,flexDirection:\"row\"}},c.React.createElement(na,{source:{uri:s.icon?`https://cdn.discordapp.com/app-icons/${s.icon}/${s.icon}.png?size=64`:G.image},style:{borderRadius:8,resizeMode:\"cover\",aspectRatio:1}}),c.React.createElement(ln,{style:{flexDirection:\"column\",marginLeft:8}},c.React.createElement(D,{variant:\"text-md/semibold\",color:\"TEXT_NORMAL\"},s.name),c.React.createElement(D,{variant:\"text-sm/medium\",color:\"TEXT_MUTED\",lineClamp:1},s.description))))}}):c.React.createElement(c.ReactNative.ActivityIndicator,{style:{flex:1}})};function aa(e){e.push(\"VendettaCustomPage\",{render:ra,title:\"Select Application\",headerRight:function(){return c.React.createElement(Ee,{style:\"header\",icon:g.getAssetIDByName(\"ic_custom_color\"),onPress:function(){return dn?.()}})}})}const fn=I.findByProps(\"isTablet\"),{View:pn,Text:ia,Image:sa}=L.General,Tt=c.stylesheet.createThemedStyleSheet({card:{backgroundColor:$.semanticColors.BACKGROUND_SECONDARY,marginHorizontal:4,marginVertical:4,borderRadius:8,flex:1},cardHeader:{backgroundColor:$.semanticColors.BACKGROUND_TERTIARY,borderTopLeftRadius:8,borderTopRightRadius:8,paddingHorizontal:8,paddingVertical:8,width:\"100%\"},cardHeaderText:{...Lt[\"text-sm/semibold\"],color:$.semanticColors.TEXT_NORMAL},cardImage:{width:\"100%\",flex:1,borderBottomLeftRadius:8,borderBottomRightRadius:8}}),oa=function(){const e=c.NavigationNative.useNavigation(),[i,n]=c.React.useState(\"\"),[r,t]=c.React.useState();c.React.useEffect(function(){n(\"\")}),r||ta(It).then(t);let a=!1;return r?c.React.createElement(c.ReactNative.FlatList,{ListEmptyComponent:c.React.createElement(L.Search,{style:{marginBottom:10},onChangeText:function(o){return n(o.toLowerCase())}}),style:{paddingHorizontal:10,paddingTop:10},contentContainerStyle:{paddingBottom:20},data:r.filter(function(o){return o.name.toLowerCase().includes(i)}),numColumns:fn.isTablet?3:2,renderItem:function(o){const{item:s}=o;return c.React.createElement(c.ReactNative.TouchableOpacity,{onPress:function(){a||(a=!0,e.goBack(),Nt?.(s.id))},style:{width:`${fn.isTablet?1/.03:1/.02}%`,aspectRatio:1}},c.React.createElement(pn,{style:Tt.card},c.React.createElement(pn,{style:Tt.cardHeader},c.React.createElement(ia,{style:Tt.cardHeaderText},s.name)),c.React.createElement(sa,{source:{uri:`https://cdn.discordapp.com/app-assets/${It}/${s.id}.png?size=128`}})))}}):c.React.createElement(c.ReactNative.ActivityIndicator,{style:{flex:1}})};function ca(e){e.push(\"VendettaCustomPage\",{render:oa,title:\"Select Asset\"})}function yn(e){const i=Math.abs(Math.floor(e/1e3)),n=Math.floor(i/3600),r=Math.floor(i/60)%60,t=i%60;return`${n?`${n.toString().padStart(2,\"0\")}:`:\"\"}${r.toString().padStart(2,\"0\")}:${t.toString().padStart(2,\"0\")}`}function St(e){const i=Math.floor(e/60),n=e%60;return new Date().setHours(i,n,0,0)}function hn(e){const i=new Date(e);return i.getHours()*60+i.getMinutes()}function gn(e,i){if(e.startsWith(\"spotify:\"))return`https://i.scdn.co/image/${e.slice(8)}`;if(e.startsWith(\"mp:\"))return`https://media.discordapp.net/${e.slice(3)}`;if(!Number.isNaN(Number(e)))return`https://cdn.discordapp.com/app-assets/${i??\"1\"}/${e}.png?size=56`}const mn={online:\"mp:attachments/919655852724604978/1125529509723123712/s_online.png\",idle:\"mp:attachments/919655852724604978/1125529509467279451/s_idle.png\",dnd:\"mp:attachments/919655852724604978/1125529509236572301/s_dnd.png\",offline:\"mp:attachments/919655852724604978/1125529508980731954/s_offline.png\"},_e=I.findByStoreName(\"UserStore\"),K=I.findByStoreName(\"SpotifyStore\"),Ct=I.findByStoreName(\"PresenceStore\");var M;(function(e){e[e.CurrentUser=0]=\"CurrentUser\",e[e.CurrentUserPresence=1]=\"CurrentUserPresence\"})(M||(M={}));const re={presence:{status:void 0,custom:void 0,spotify:null}},At=function(e){return(e??Ct.getActivities(_e.getCurrentUser().id)).find(function(i){return i.type===4})},vn=[{match:\"{user.name}\",description:\"Your username\",types:[M.CurrentUser],replace:function(){return _e.getCurrentUser().username}},{match:\"{user.displayname}\",description:\"Your display name\",types:[M.CurrentUser],replace:function(){return _e.getCurrentUser().globalName}},{match:\"{user.status}\",description:\"Your status\",types:[M.CurrentUserPresence],replace:function(){return At()?.label??\"No Status\"}},{match:\"{user.presence}\",description:\"Your presence (online/dnd/idle/invisible)\",types:[M.CurrentUserPresence],replace:function(){return Ct.getStatus(_e.getCurrentUser().id)}},{match:\"{spotify.track}\",description:\"Your playing Spotify track\",types:[M.CurrentUserPresence],replace:function(){return K.getActivity()?.details??\"No Spotify Track\"}},{match:\"{spotify.track.url}\",description:\"Your playing Spotify track's share link\",types:[M.CurrentUserPresence],replace:function(){const e=K.getActivity()?.sync_id;return e?`https://open.spotify.com/track/${e}`:\"\"}},{match:\"{spotify.artist}\",description:\"Your playing Spotify track's artist(s)\",types:[M.CurrentUserPresence],replace:function(){return(re.presence.spotify=K.getActivity())?.state??\"No Spotify Track\"}},{match:\"{spotify.album}\",description:\"Your playing Spotify track's album\",types:[M.CurrentUserPresence],replace:function(){return(re.presence.spotify=K.getActivity())?.assets?.large_text??\"No Spotify Track\"}}];function ua(e){const i={content:e,types:[]};for(const n of vn){let r;i.content=i.content.replaceAll(n.match,function(){for(const t of n.types)i.types.includes(t)||i.types.push(t);return r??(r=n.replace())})}return i}const _n=[{title:\"Spotify Track Start\",description:\"The timestamp when your playing Spotify track started\",format:\"spotify.track.start\",type:M.CurrentUserPresence,replace:function(){return(re.presence.spotify=K.getActivity())?.timestamps?.start}},{title:\"Spotify Track End\",description:\"The timestamp when your playing Spotify track ends\",format:\"spotify.track.end\",type:M.CurrentUserPresence,replace:function(){return(re.presence.spotify=K.getActivity())?.timestamps?.end}}];function la(e){if(typeof e==\"string\"){const i=_n.find(function(r){return r.format===e}),n=i?.replace();return i?{timestamp:n!==void 0?hn(n):void 0,type:i.type}:{timestamp:0}}else return{timestamp:e}}const bn=[{title:\"User Avatar\",description:\"Your avatar\",format:\"user.avatar\",type:M.CurrentUser,replace:function(){const e=_e.getCurrentUser(),i=Hn({discriminator:e.discriminator,id:e.id,avatar:e.avatar});return ne[i]||un(i).then(ct),`mp:${ne[i]}`}},{title:\"User Presence\",description:\"Your presence (online/idle/dnd/invisible)\",format:\"user.presence\",type:M.CurrentUserPresence,replace:function(){return mn[Ct.getStatus(_e.getCurrentUser().id)]??mn.online}},{title:\"Spotify Album Cover\",description:\"Your playing Spotify track's album cover\",format:\"spotify.album\",type:M.CurrentUserPresence,replace:function(){return K.getActivity()?.assets?.large_image}}];function da(e){const i=bn.find(function(n){return n.format===e});return i?{image:i.replace(),type:i.type}:{image:e}}function fa(e){for(const i of e)i===M.CurrentUser?Sn(\"parsed.currentuser\",\"CURRENT_USER_UPDATE\",ct):i===M.CurrentUserPresence&&Sn(\"parsed.currentuserpresence\",\"SELF_PRESENCE_STORE_UPDATE\",function(n){(re.presence.status!==n.status||JSON.stringify(re.presence.custom)!==JSON.stringify(At(n.activities))||JSON.stringify(re.presence.spotify)!==JSON.stringify(K.getActivity()))&&ct(),re.presence={status:n.status,custom:At(n.activities),spotify:K.getActivity()}})}const{View:pa}=L.General,{FormRow:R,FormRadioRow:ya}=L.Forms,ha=I.findByProps(\"DatePickerModes\"),ga=function(){return c.React.createElement(pa,{style:{marginBottom:16}})},be=c.stylesheet.createThemedStyleSheet({destructiveIcon:{tintColor:$.semanticColors.TEXT_DANGER}}),ke={color:\"TEXT_DANGER\",variant:\"text-md/semibold\"};function ma(e){let{role:i,update:n}=e;return c.React.createElement(oe,null,c.React.createElement(le,null,c.React.createElement(ce,{title:`${i} Image Variable`,trailing:c.React.createElement(ue,{onPress:function(){return j()}})}),bn.map(function(r){return c.React.createElement(R,{label:r.title,subLabel:r.description,trailing:c.React.createElement(R.Arrow,null),onPress:function(){n(r.format),j()}})})))}let Nt,It;function kn(e){let{appId:i,role:n,image:r,navigation:t,update:a}=e;return c.React.createElement(oe,null,c.React.createElement(le,null,c.React.createElement(ce,{title:`Edit ${n} Image`,trailing:c.React.createElement(ue,{onPress:j})}),c.React.createElement(R,{label:\"Set Image Variable\",leading:c.React.createElement(R.Icon,{source:g.getAssetIDByName(\"ic_essentials_sparkle\")}),trailing:c.React.createElement(R.Arrow,null),onPress:function(){return W(ma,{role:n,update:function(o){return a(o)}})}}),c.React.createElement(R,{label:\"Use Custom Image\",subLabel:\"Make sure your image is in a square aspect ratio\",leading:c.React.createElement(R.Icon,{source:g.getAssetIDByName(\"ic_link\")}),onPress:function(){F.showInputAlert({title:\"Enter the link to your image link\",placeholder:\"can be a discord attachment CDN link\",confirmText:\"Proxy\",confirmColor:\"brand\",onConfirm:async function(o){const s=o.match(ft.constants.HTTP_REGEX_MULTI)?.[0];if(!s)return C.showToast(\"Invalid URL\",g.getAssetIDByName(\"Small\"));C.showToast(\"Proxying image...\",g.getAssetIDByName(\"ic_clock\"));try{a(`mp:${await un(s)}`),C.showToast(\"Proxied image\",g.getAssetIDByName(\"Check\"))}catch(u){console.log(u),C.showToast(\"Failed to proxy image\",g.getAssetIDByName(\"Small\"))}},cancelText:\"Cancel\"})}}),c.React.createElement(R,{label:\"Select RPC Asset\",leading:c.React.createElement(R.Icon,{source:g.getAssetIDByName(\"ic_media_channel\")}),trailing:c.React.createElement(R.Arrow,null),onPress:function(){if(!i)return F.showConfirmationAlert({title:\"No App Set\",content:\"An app must be selected in order to use RPC assets\",confirmText:\"Dismiss\",confirmColor:\"grey\",onConfirm:function(){}});It=i,Nt=function(o){Nt=void 0,a(o)},ca(t),j()}}),r&&c.React.createElement(R,{label:c.React.createElement(D,ke,\"Remove Image\"),leading:c.React.createElement(R.Icon,{style:be.destructiveIcon,source:g.getAssetIDByName(\"trash\")}),onPress:function(){a(void 0),j()}})))}function Rn(e){let{role:i,text:n,url:r,update:t}=e;return c.React.createElement(oe,null,c.React.createElement(ce,{title:`Edit Button ${i}`,trailing:c.React.createElement(ue,{onPress:j})}),c.React.createElement(le,null,c.React.createElement(R,{label:\"Button Text\",leading:c.React.createElement(R.Icon,{source:g.getAssetIDByName(\"ic_message_edit\")}),onPress:function(){return Ue({role:`Button ${i} Text`,current:n,update:function(a){return t({text:a,url:r})}})}}),c.React.createElement(R,{label:\"Button URL\",leading:c.React.createElement(R.Icon,{source:g.getAssetIDByName(\"ic_message_edit\")}),onPress:function(){return Ue({role:`Button ${i} URL`,current:r,update:function(a){return t({text:n,url:a})}})}}),r&&c.React.createElement(R,{label:c.React.createElement(D,ke,\"Remove Button URL\"),leading:c.React.createElement(R.Icon,{style:be.destructiveIcon,source:g.getAssetIDByName(\"trash\")}),onPress:function(){t({text:n,url:void 0}),j()}}),n&&c.React.createElement(R,{label:c.React.createElement(D,ke,\"Remove Button\"),leading:c.React.createElement(R.Icon,{style:be.destructiveIcon,source:g.getAssetIDByName(\"trash\")}),onPress:function(){t({text:void 0,url:void 0}),j()}})))}let at;function va(e){let{appId:i,appName:n,navigation:r,update:t}=e;return c.React.createElement(oe,null,c.React.createElement(le,null,c.React.createElement(ce,{title:\"Edit Application\",trailing:c.React.createElement(ue,{onPress:j})}),c.React.createElement(R,{label:\"Application Name\",leading:c.React.createElement(R.Icon,{source:g.getAssetIDByName(\"ic_message_edit\")}),onPress:function(){return Ue({role:\"Application Name\",current:n,update:function(a){return t({id:i,name:a})}})}}),c.React.createElement(R,{label:\"Select Application\",leading:c.React.createElement(R.Icon,{source:g.getAssetIDByName(\"ic_robot_24px\")}),trailing:c.React.createElement(R.Arrow,null),onPress:function(){at=function(a){at=void 0,t({id:a.id??i,name:a.name??n})},aa(r),j()}}),i&&c.React.createElement(R,{label:c.React.createElement(D,ke,\"Remove Application\"),leading:c.React.createElement(R.Icon,{style:be.destructiveIcon,source:g.getAssetIDByName(\"trash\")}),onPress:function(){t(void 0),j()}})))}function _a(e){let{type:i,update:n}=e;const[r,t]=c.React.useState(i);return c.React.createElement(oe,null,c.React.createElement(le,null,c.React.createElement(ce,{title:\"Edit Activity Type\",trailing:c.React.createElement(ue,{onPress:function(){return j()}})}),...Object.values(ae).filter(function(a){return typeof a==\"number\"}).map(function(a){return c.React.createElement(ya,{label:Zn[a],trailing:c.React.createElement(R.Arrow,null),selected:a===r,onPress:function(){n(a),t(a)}})})))}function wn(e){let{role:i,update:n}=e;return c.React.createElement(oe,null,c.React.createElement(le,null,c.React.createElement(ce,{title:`Set ${i} Time Variable`,trailing:c.React.createElement(ue,{onPress:function(){return j()}})}),_n.map(function(r){return c.React.createElement(R,{label:r.title,subLabel:r.description,trailing:c.React.createElement(R.Arrow,null),onPress:function(){n(r.format),j()}})})),c.React.createElement(ga,null))}function ba(e){let{start:i,end:n,update:r}=e;const t=function(a){let{role:o,onSubmit:s}=a;const u=new Date().setHours(0,0,0,0),l=new Date().setHours(23,59,59,999);Mt(Promise.resolve(ha),\"DatePicker\",{onSubmit:function(d){return s(hn(d._d.getTime()))},title:`Timestamp ${o} Time`,startDate:new Date,minimumDate:new Date(u),maximumDate:new Date(l),requireDateChanged:!1,mode:\"time\"})};return c.React.createElement(oe,null,c.React.createElement(le,null,c.React.createElement(ce,{title:\"Edit Timestamp\",trailing:c.React.createElement(ue,{onPress:function(){return j()}})}),c.React.createElement(R,{label:\"Set Start Time Variable\",leading:c.React.createElement(R.Icon,{source:g.getAssetIDByName(\"ic_essentials_sparkle\")}),trailing:c.React.createElement(R.Arrow,null),onPress:function(){return W(wn,{role:\"Start\",update:function(a){return r({start:a,end:n})}})}}),typeof i!=\"string\"&&c.React.createElement(R,{label:\"Edit Start Time\",leading:c.React.createElement(R.Icon,{source:g.getAssetIDByName(\"ic_message_edit\")}),trailing:c.React.createElement(R.Arrow,null),onPress:function(){return t({role:\"Start\",onSubmit:function(a){return r({start:a,end:n})}})}}),i!==void 0&&c.React.createElement(R,{label:c.React.createElement(D,ke,\"Remove Start Time\"),leading:c.React.createElement(R.Icon,{style:be.destructiveIcon,source:g.getAssetIDByName(\"trash\")}),onPress:function(){r({start:void 0,end:n}),j()}}),c.React.createElement(R,{label:\"Set End Time Variable\",leading:c.React.createElement(R.Icon,{source:g.getAssetIDByName(\"ic_essentials_sparkle\")}),trailing:c.React.createElement(R.Arrow,null),onPress:function(){return W(wn,{role:\"End\",update:function(a){return r({start:i,end:a})}})}}),typeof n!=\"string\"&&c.React.createElement(R,{label:\"Edit End Time\",leading:c.React.createElement(R.Icon,{source:g.getAssetIDByName(\"ic_message_edit\")}),onPress:function(){return t({role:\"End\",onSubmit:function(a){return r({start:i,end:a})}})}}),n!==void 0&&c.React.createElement(R,{label:c.React.createElement(D,ke,\"Remove End Time\"),leading:c.React.createElement(R.Icon,{style:be.destructiveIcon,source:g.getAssetIDByName(\"trash\")}),onPress:function(){r({start:i,end:void 0}),j()}})))}const it=function(e){let{role:i,button:n,secondaryButton:r,run:t,secondaryRun:a}=e;if(Pn())return t();F.showConfirmationAlert({title:\"Unsaved Changes\",content:[\"You have unsaved changes in \",c.React.createElement(ht.Bold,null,p.activity.profile),`. Are you sure you want to ${i}?`],confirmText:n,confirmColor:\"red\",onConfirm:t,secondaryConfirmText:r,onConfirmSecondary:function(){a?.(),t?.()},cancelText:\"Cancel\"})},Ue=function(e){let{role:i,current:n,update:r}=e;return F.showInputAlert({title:`Enter New ${i}`,initialValue:n,placeholder:`really cool ${i.toLowerCase()}`,confirmText:\"Change\",confirmColor:\"brand\",onConfirm:r,cancelText:\"Cancel\"})},ka=I.findByStoreName(\"UserStore\"),{View:Q,Image:En,Pressable:xn}=L.General,Ra=I.findByName(\"UserActivityContainer\"),ze=c.stylesheet.createThemedStyleSheet({actTypeCont:{flexDirection:\"row\",marginBottom:12,justifyContent:\"space-between\"},card:{borderWidth:1,borderRadius:8,borderColor:$.semanticColors.BACKGROUND_MODIFIER_ACCENT},card2:{alignItems:\"flex-start\",flexDirection:\"row\"},images:{position:\"relative\",marginRight:10},smallImageBg:{borderColor:$.semanticColors.BACKGROUND_PRIMARY,backgroundColor:$.semanticColors.BACKGROUND_PRIMARY,borderWidth:1,borderRadius:18,position:\"absolute\",right:-4,bottom:-4}});let Tn;function wa(e){let{edit:i,act:n}=e;const[r,t]=c.React.useReducer(function(s){return~s},0);Tn=t;const a=c.NavigationNative.useNavigation(),o=function(){t(),dt?.()};return i?c.React.createElement(c.React.Fragment,null,c.React.createElement(Q,{style:ze.actTypeCont},c.React.createElement(D,{variant:\"eyebrow\",color:\"TEXT_NORMAL\",onPress:function(){return W(_a,{type:n.type??ae.Playing,update:function(s){n.type=s,o()}})}},Zn[n.type??ae.Playing],\" ...\")),c.React.createElement(Q,{style:ze.card},c.React.createElement(Q,{style:{padding:16}},c.React.createElement(Q,{style:ze.card2},c.React.createElement(Q,{style:ze.images},c.React.createElement(xn,{onPress:function(){return W(kn,{appId:n.app.id,role:\"Large\",image:n.assets.largeImg,navigation:a,update:function(s){n.assets.largeImg=s,o()}})}},c.React.createElement(En,{source:{uri:gn(n.assets.largeImg??\".\",n.app.id)??G.image},style:{borderRadius:3,width:56,height:56}})),c.React.createElement(Q,{style:ze.smallImageBg},c.React.createElement(xn,{onPress:function(){return W(kn,{appId:n.app.id,role:\"Small\",image:n.assets.smallImg,navigation:a,update:function(s){n.assets.smallImg=s,o()}})}},c.React.createElement(En,{source:{uri:gn(n.assets.smallImg??\".\",n.app.id)??G.image},style:{borderRadius:14,width:28,height:28}})))),c.React.createElement(Q,{style:{flex:1}},c.React.createElement(D,{variant:\"text-md/semibold\",color:\"TEXT_NORMAL\",onPress:function(){return W(va,{appId:n.app.id,appName:n.app.name,navigation:a,update:function(s){s?.id!==n.app.id&&(Number.isNaN(Number(n.assets.smallImg))||delete n.assets.smallImg,Number.isNaN(Number(n.assets.largeImg))||delete n.assets.largeImg),n.app.id=s?.id,n.app.name=s?.name,o()}})}},n.app.name??G.appName),c.React.createElement(D,{variant:\"text-sm/normal\",color:\"TEXT_NORMAL\",onPress:function(){return Ue({role:\"Details\",current:n.details,update:function(s){n.details=s,o()}})}},n.details??G.details),c.React.createElement(D,{variant:\"text-sm/normal\",color:\"TEXT_NORMAL\",onPress:function(){return Ue({role:\"State\",current:n.state,update:function(s){n.state=s,o()}})}},n.state??G.state),c.React.createElement(D,{variant:\"text-sm/normal\",color:\"TEXT_NORMAL\",onPress:function(){return W(ba,{start:n.timestamps.start,end:n.timestamps.end,update:function(s){n.timestamps.start=s.start,n.timestamps.end=s.end,o()}})},liveUpdate:!0,getChildren:function(){return typeof n.timestamps.end==\"string\"?`{${n.timestamps.end}}`:typeof n.timestamps.end==\"number\"?`${yn(St(n.timestamps.end)-Date.now())} left`:typeof n.timestamps.start==\"string\"?`{${n.timestamps.start}}`:typeof n.timestamps.start==\"number\"?`${yn(Date.now()-St(n.timestamps.start))} elapsed`:G.timestamp}}))),c.React.createElement(Q,{style:{marginTop:16}},c.React.createElement(L.Button,{text:n.buttons[0]?.text??G.button1,style:{backgroundColor:\"grey\"},size:\"small\",onPress:function(){return W(Rn,{role:\"1\",text:n.buttons[0]?.text,url:n.buttons[0]?.url,update:function(s){let{text:u,url:l}=s;!u&&!l?n.buttons[0]=void 0:n.buttons[0]={text:u,url:l},o()}})}})),c.React.createElement(Q,{style:{marginTop:10}},c.React.createElement(L.Button,{text:n.buttons[1]?.text??G.button2,style:{backgroundColor:\"grey\"},size:\"small\",onPress:function(){return W(Rn,{role:\"2\",text:n.buttons[1]?.text,url:n.buttons[1]?.url,update:function(s){let{text:u,url:l}=s;!u&&!l?n.buttons[1]=void 0:n.buttons[1]={text:u,url:l},o()}})}}))))):c.React.createElement(Ra,{user:ka.getCurrentUser(),activity:Nn(n).activity})}const st={};function Ea(e,i,n,r){if(st[e])return;const t={default:r,timeout:-1};st[e]=t;const a=function(){const o=i(new Date);t.timeout=setTimeout(function(){n(),a()},o-Date.now())};a()}const ot={};function Sn(e,i,n,r){ot[e]||(c.FluxDispatcher.subscribe(i,n),ot[e]={default:r,event:i,handler:n})}function Cn(e){for(const[i,n]of Object.entries(st))(e||!n.default)&&(clearTimeout(n.timeout),delete st[i]);for(const[i,n]of Object.entries(ot))(e||!n.default)&&(c.FluxDispatcher.unsubscribe(n.event,n.handler),delete ot[i])}function xa(){Ea(\"auto_fix_timestamps\",function(e){return e.setHours(24,0,0,0)},ct,!0)}function ct(){Tn?.(),Je()}var ae;(function(e){e[e.Playing=0]=\"Playing\",e[e.Listening=2]=\"Listening\",e[e.Watching=3]=\"Watching\",e[e.Competing=5]=\"Competing\"})(ae||(ae={}));const An=O.object({app:O.object({name:O.string().optional(),id:O.string().optional()}),state:O.string().optional(),details:O.string().optional(),timestamps:O.object({start:O.string().or(O.number()).optional(),end:O.string().or(O.number()).optional()}),assets:O.object({largeImg:O.string().optional(),smallImg:O.string().optional()}),buttons:O.array(O.object({text:O.string(),url:O.string().optional()})),type:O.nativeEnum(ae)});var Pt;(function(e){e[e.Instance=1]=\"Instance\",e[e.Join=2]=\"Join\",e[e.Spectate=4]=\"Spectate\",e[e.JoinRequest=8]=\"JoinRequest\",e[e.Sync=16]=\"Sync\",e[e.Play=32]=\"Play\",e[e.PartyPrivacyFriends=64]=\"PartyPrivacyFriends\",e[e.PartyPrivacyVoiceChannel=128]=\"PartyPrivacyVoiceChannel\",e[e.Embedded=256]=\"Embedded\"})(Pt||(Pt={}));function ut(){return{timestamps:{},assets:{},buttons:[],app:{}}}function Nn(e){const i=[],n={str:function(t){const a=ua(t);for(const o of a.types)i.includes(o)||i.push(o);return a.content},tim:function(t){const a=la(t);return a.type&&!i.includes(a.type)&&i.push(a.type),a.timestamp!==void 0?St(a.timestamp):void 0},img:function(t){const a=da(t);return a.type&&!i.includes(a.type)&&i.push(a.type),a.image}},r={name:n.str(e.app.name??G.appName),application_id:e.app.id??\"0\",type:e.type??ae.Playing,flags:Pt.Instance,state:e.state&&n.str(e.state),details:e.details&&n.str(e.details),timestamps:{start:e.timestamps.start!==void 0?n.tim(e.timestamps.start):void 0,end:e.timestamps.end!==void 0?n.tim(e.timestamps.end):void 0},assets:{large_image:e.assets.largeImg&&n.img(e.assets.largeImg),small_image:e.assets.smallImg&&n.img(e.assets.smallImg)}};return r.assets.large_image&&r.type===ae.Playing&&(r.assets.large_text=\"CRPC@VD\"),e.buttons[0]&&(r.metadata={button_urls:e.buttons.slice(0,2).filter(function(t){return!!t.text}).map(function(t){return t.url?n.str(t.url):null})},r.buttons=e.buttons.slice(0,2).filter(function(t){return!!t.text}).map(function(t){return n.str(t.text)})),ye.lastRawActivity=r,ye.lastRawActivityTimestamp=Date.now(),cn?.(),{activity:r,types:i}}async function Dt(e){let i={};if(Cn(),e){const n=Nn(e);i=n.activity,fa(n.types)}c.FluxDispatcher.dispatch({type:\"LOCAL_ACTIVITY_UPDATE\",activity:i,socketId:\"CustomRPC@Vendetta\"})}function In(){return p.profiles?.[p.activity?.profile]??p.activity?.editing??ut()}function Je(){const e=In();p.settings?.display?Dt(e):Dt()}function Pn(){const e=In();return JSON.stringify(e)===JSON.stringify(p.activity.editing)}//! for some reason the compiler breaks here and doesn't recognize ActivityType\nconst Ta={\"Vendetta Advertisement\":{state:\"Join Now\",details:'\"The best Discord client for mobile\"',app:{name:\"Vendetta\"},timestamps:{},assets:{largeImg:\"mp:external/t88vNcbCl2anXnBX4gmLVep17K_yqL4L2pvzwPMGtjs/%3Fsize%3D512/https/cdn.discordapp.com/icons/1015931589865246730/5b7f29e9c670fbcbf476b4d88fbd081f.png\"},type:3,buttons:[{text:\"Join Vendetta\",url:\"https://discord.gg/vendetta-mod\"},{text:\"Install Vendetta\",url:\"https://github.com/vendetta-mod/Vendetta#installing\"}]},\"Scuffed Spotify Activity\":{timestamps:{start:\"spotify.track.start\",end:\"spotify.track.end\"},assets:{smallImg:\"user.avatar\",largeImg:\"spotify.album\"},buttons:[{text:\"Listen Along\",url:\"{spotify.track.url}\"}],app:{name:\"{spotify.track}\"},type:2,details:\"by {spotify.artist}\",state:\"on {spotify.album}\"},\"My Profile\":{timestamps:{start:0},assets:{largeImg:\"user.avatar\",smallImg:\"user.presence\"},buttons:[],app:{name:\"{user.displayname}\"},type:3,details:\"{user.name}\",state:\"{user.status}\"}},{View:Sa}=L.General,{FormRadioRow:Ca,FormRow:Aa}=L.Forms,{showSimpleActionSheet:Na}=I.findByProps(\"showSimpleActionSheet\"),Ia=I.findByProps(\"openLazy\",\"hideActionSheet\"),lt={import:void 0,add:void 0},Pa=function(){const e=c.NavigationNative.useNavigation(),[i,n]=c.React.useReducer(function(o){return~o},0),[r,t]=c.React.useState(\"\");c.React.useEffect(function(){t(\"\")},[]),lt.add=function(){return F.showInputAlert({title:\"Enter new profile name\",placeholder:\"Super Awesome RPC\",confirmText:\"Add\",confirmColor:\"brand\",onConfirm:function(o){if(o.match(/^\\s*$/))return C.showToast(\"Profile name cannot be empty\",g.getAssetIDByName(\"Small\"));if(o=o.trim(),p.profiles[o])return C.showToast(\"A profile with that name already exists\",g.getAssetIDByName(\"Small\"));p.profiles[o]=JSON.parse(JSON.stringify(p.activity.editing)),p.activity.profile=o,n(),C.showToast(\"Created profile\",g.getAssetIDByName(\"Check\"))},cancelText:\"Cancel\"})},lt.import=async function(){let o;try{o=JSON.parse(await c.clipboard.getString())}catch{return C.showToast(\"Failed to parse JSON\")}const s=An.safeParse(o);if(!s.success)return C.showToast(\"Invalid profile data\",g.getAssetIDByName(\"Small\"));let u=0,l=\"Imported Profile\";for(;p.profiles[l];)u++,l=`Imported Profile (${u})`;p.profiles[l]=s.data,p.activity.profile=l,n(),C.showToast(\"Imported profile\",g.getAssetIDByName(\"Check\"))};let a=!1;return c.React.createElement(c.ReactNative.FlatList,{ListHeaderComponent:c.React.createElement(L.Search,{style:{marginBottom:10},onChangeText:function(o){return t(o.toLowerCase())}}),style:{paddingHorizontal:10,paddingTop:10},contentContainerStyle:{paddingBottom:20},data:Object.keys(p.profiles).filter(function(o){return o.toLowerCase().includes(r)}),renderItem:function(o){let{item:s}=o;return c.React.createElement(Ca,{label:s,onLongPress:function(){return Na({key:\"CardOverflow\",header:{title:s,onClose:function(){return Ia.hideActionSheet()}},options:[{label:\"Copy Profile\",icon:g.getAssetIDByName(\"copy\"),onPress:function(){c.clipboard.setString(JSON.stringify(p.profiles[s],void 0,3)),C.showToast(\"Copied\",g.getAssetIDByName(\"toast_copy_link\"))}},{label:\"Rename Profile\",icon:g.getAssetIDByName(\"ic_message_edit\"),onPress:function(){return F.showInputAlert({title:\"Enter new profile name\",placeholder:\"Super Awesome RPC 2.0\",initialValue:s,confirmText:\"Rename\",confirmColor:\"brand\",onConfirm:function(u){if(u.match(/^\\s*$/))return C.showToast(\"Profile name cannot be empty\",g.getAssetIDByName(\"Small\"));if(u=u.trim(),p.profiles[u])return C.showToast(\"A profile with that name already exists\",g.getAssetIDByName(\"Small\"));p.profiles[u]=p.profiles[s],p.activity.profile===s&&(p.activity.profile=u),delete p.profiles[s],n(),C.showToast(\"Renamed profile\",g.getAssetIDByName(\"Check\"))},cancelText:\"Cancel\"})}},{label:\"Delete Profile\",icon:g.getAssetIDByName(\"trash\"),isDestructive:!0,onPress:function(){return F.showConfirmationAlert({title:\"Delete Profile\",content:\"Are you sure you want to delete this profile? This cannot be undone.\",confirmText:\"Delete\",confirmColor:\"red\",onConfirm:function(){p.activity.profile===s&&(delete p.activity.profile,p.activity.editing=ut()),delete p.profiles[s],n(),dt?.(),C.showToast(\"Deleted\",g.getAssetIDByName(\"Check\"))},cancelText:\"Cancel\"})}}]})},onPress:function(){if(!a){if(p.activity.profile===s)return C.showToast(`${s} is already loaded`,g.getAssetIDByName(\"Small\"));it({role:\"discard your changes\",button:\"Discard\",run:function(){p.activity.editing=JSON.parse(JSON.stringify(p.profiles[s])),p.activity.profile=s,a=!0,e.goBack(),dt?.(),C.showToast(\"Loaded\",g.getAssetIDByName(\"Check\"))},secondaryButton:\"Save profile\",secondaryRun:function(){p.profiles[p.activity.profile]=JSON.parse(JSON.stringify(p.activity.editing))}})}},trailing:c.React.createElement(Aa.Arrow,null),selected:p.activity.profile===s})}})};function Da(e){e.push(\"VendettaCustomPage\",{render:Pa,title:\"Profiles\",headerRight:function(){return c.React.createElement(Sa,{style:{flexDirection:\"row-reverse\"}},c.React.createElement(Ee,{style:\"header\",icon:g.getAssetIDByName(\"ic_add_24px\"),onPress:function(){return lt.add?.()}}),c.React.createElement(Ee,{style:\"header\",icon:g.getAssetIDByName(\"ic_file_upload_24px\"),onPress:function(){return lt.import?.()}}))}})}const{ScrollView:Oa,View:Ot,Pressable:Za}=L.General,{FormSwitchRow:Dn,FormIcon:On,FormRow:Z}=L.Forms,G={image:\"https://discord.com/assets/cb1043c312ec65507573c06c37f6ee63.gif\",appName:\"Enter App Name...\",details:\"Enter Details...\",state:\"Enter State...\",timestamp:\"Enter Timestamp...\",button1:\"Edit Button 1...\",button2:\"Edit Button 2...\"},Zn={0:\"Playing\",2:\"Listening to\",3:\"Watching\",5:\"Competing in\"},Ba=c.stylesheet.createThemedStyleSheet({androidRipple:{color:$.semanticColors.ANDROID_RIPPLE,cornerRadius:8}});let dt;function $a(){var e,i,n;const r=c.NavigationNative.useNavigation(),[t,a]=c.React.useReducer(function(f){return~f},0);if(dt=a,(e=p).settings??(e.settings={edit:!1,display:!1,debug:{enabled:!1,visible:!1,boykisserDead:void 0}}),(i=p).activity??(i.activity={editing:ut()}),(n=p).profiles??(n.profiles=Ta),$n.useProxy(p),c.React.useEffect(function(){p.settings.debug.boykisserDead!==void 0&&Yn(ft.plugin,[{changes:[\"+ added boykisser back\",\"+ you can now kill boykisser (don't)\",\"+ fixed typo\",\"+ added a string variables 'Help' button\"]},{changes:[\"+ initial update guhhh\"]}])},[p.settings.debug.boykisserDead===void 0]),c.React.useEffect(function(){p.settings.debug.boykisserDead!==void 0&&p.settings.display&&Je()},[JSON.stringify(p.activity.editing),p.settings.display,p.settings.debug.boykisserDead===void 0]),p.settings.debug.boykisserDead===void 0)return yt.getItem(\"CRPC_boykisser\").then(function(f){p.settings.debug.boykisserDead=f===\"true\",a()}),c.React.createElement(c.ReactNative.ActivityIndicator,{style:{flex:1}});const o=r.addListener(\"focus\",function(){o(),r.setOptions({headerRight:function(){return c.React.createElement(Ot,{style:{flexDirection:\"row-reverse\"}},c.React.createElement(Ee,{style:\"header\",icon:g.getAssetIDByName(\"ic_report_message\"),onPress:function(){return Qn(\"customrpc\")}}),c.React.createElement(Ee,{style:\"header\",icon:g.getAssetIDByName(\"ic_essentials_sparkle\"),onPress:function(){return F.showConfirmationAlert({title:\"String Variables\",content:`String variables can be used in any text component\nHere's the entire list:\n\n${vn.map(function(f){return`**\\`${f.match}\\`**\n \\u2014 ${f.description}`}).join(`\n`)}`,confirmText:\"Dismiss\",confirmColor:\"brand\",onConfirm:function(){}})}}))}})});let s=0,u,l=-1,d;return c.React.createElement(c.React.Fragment,null,c.React.createElement(Wn,{style:[{backgroundColor:\"#f11\",position:\"absolute\",width:\"100%\",height:\"100%\",zIndex:2}],fade:\"out\",duration:1e3,trigger:p.settings.debug.boykisserDead,setDisplay:!0,animateOnInit:!1}),c.React.createElement(Oa,{style:{zIndex:1}},c.React.createElement(He,{title:\"Preview\",onTitlePress:function(){if(p.settings.debug.enabled)p.settings.debug.visible=!p.settings.debug.visible,C.showToast(p.settings.debug.boykisserDead?`debug tab ${p.settings.debug.visible?\"on\":\"off\"}`:`Debug tab ${p.settings.debug.visible?\"visible\":\"hidden\"}`);else{if(u&&clearTimeout(u),u=setTimeout(function(){s=0},500),s++,s<2)return;if(s<7){const f=7-s;return C.showToast(p.settings.debug.boykisserDead?`tap ${f} more time${f!==1?\"s\":\"\"}`:`${f} more taps`)}else C.showToast(p.settings.debug.boykisserDead?\"the sin of murdering boykisser continues to haunt you\":\"Behold! You can now debug!\"),p.settings.debug.visible=!0,p.settings.debug.enabled=!0,a()}},icon:g.getAssetIDByName(\"ic_eye\"),padding:p.settings.edit},c.React.createElement(wa,{edit:p.settings.edit,act:p.activity.editing})),c.React.createElement(He,{title:\"Settings\",icon:g.getAssetIDByName(\"ic_cog_24px\")},c.React.createElement(Dn,{label:\"Edit Mode\",subLabel:\"Be able to edit your activity\",leading:c.React.createElement(On,{source:g.getAssetIDByName(\"ic_badge_staff\")}),onValueChange:function(){return p.settings.edit=!p.settings.edit},value:p.settings.edit}),c.React.createElement(Dn,{label:\"Display Activity\",subLabel:\"Show off your super awesome poggers activity to the world\",leading:c.React.createElement(On,{source:g.getAssetIDByName(\"ic_show_password\")}),onValueChange:function(){return p.settings.display=!p.settings.display},value:p.settings.display})),c.React.createElement(He,{title:\"Data\",icon:g.getAssetIDByName(\"ic_feedback\")},c.React.createElement(Z,{label:\"Copy as JSON\",leading:c.React.createElement(Z.Icon,{source:g.getAssetIDByName(\"copy\")}),onPress:function(){c.clipboard.setString(JSON.stringify(p.activity.editing,void 0,3)),C.showToast(\"Copied\",g.getAssetIDByName(\"toast_copy_link\"))}}),c.React.createElement(Z,{label:\"Load from Clipboard\",leading:c.React.createElement(Z.Icon,{source:g.getAssetIDByName(\"ic_download_24px\")}),onPress:function(){return it({role:\"overwrite the activity data\",button:\"Overwrite\",run:async function(){let f;try{f=JSON.parse(await c.clipboard.getString())}catch{return C.showToast(\"Failed to parse JSON\",g.getAssetIDByName(\"Small\"))}const h=An.safeParse(f);if(!h.success)return C.showToast(\"Invalid activity data\",g.getAssetIDByName(\"Small\"));p.activity.editing=h.data,delete p.activity.profile,a(),C.showToast(\"Loaded\",g.getAssetIDByName(\"Check\"))}})}}),c.React.createElement(Ut,{addPadding:!0}),p.activity.profile&&c.React.createElement(Z,{label:`Save Profile${Pn()?\"\":\" \\u{1F534}\"}`,leading:c.React.createElement(Z.Icon,{source:g.getAssetIDByName(\"ic_message_edit\")}),onPress:function(){p.profiles[p.activity.profile]=JSON.parse(JSON.stringify(p.activity.editing)),C.showToast(\"Saved\",g.getAssetIDByName(\"Check\")),a()}}),p.activity.profile&&c.React.createElement(Z,{label:\"Revert Profile\",leading:c.React.createElement(Z.Icon,{source:g.getAssetIDByName(\"ic_message_edit\")}),onPress:function(){return it({role:\"revert\",button:\"Revert\",run:function(){p.activity.editing=JSON.parse(JSON.stringify(p.profiles[p.activity.profile])),C.showToast(\"Reverted\",g.getAssetIDByName(\"Check\")),a()}})}}),p.activity.profile&&c.React.createElement(Z,{label:\"Close Profile\",leading:c.React.createElement(Z.Icon,{source:g.getAssetIDByName(\"ic_message_edit\")}),onPress:function(){return it({role:\"discard your changes\",button:\"Discard\",run:function(){p.activity.editing=ut(),delete p.activity.profile,C.showToast(\"Closed\",g.getAssetIDByName(\"Check\")),a()},secondaryButton:\"Save profile\",secondaryRun:function(){p.profiles[p.activity.profile]=JSON.parse(JSON.stringify(p.activity.editing))}})}}),c.React.createElement(Z,{label:\"Browse Profiles\",leading:c.React.createElement(Z.Icon,{source:g.getAssetIDByName(\"ic_message_edit\")}),trailing:c.React.createElement(Z.Arrow,null),onPress:function(){return Da(r)}})),p.settings.debug.visible&&c.React.createElement(He,{title:\"Debug\",icon:g.getAssetIDByName(\"ic_progress_wrench_24px\")},c.React.createElement(Z,{label:\"Live RawActivity View\",trailing:c.React.createElement(Z.Arrow,null),leading:c.React.createElement(Z.Icon,{source:g.getAssetIDByName(\"ic_badge_staff\")}),onPress:function(){return Qr(r)}}),c.React.createElement(Z,{label:\"Flush MP Cache\",leading:c.React.createElement(Z.Icon,{source:g.getAssetIDByName(\"ic_badge_staff\")}),onPress:function(){let f=0;for(const b of Object.keys(ne))f++,delete ne[b];const h=\":3,>:3,:D,>:D,:P,>:P\".split(\",\");C.showToast(`flushed cache ${h[Math.floor(Math.random()*h.length)]}`),f>0&&Je()}}),!p.settings.debug.boykisserDead&&c.React.createElement(c.React.Fragment,null,c.React.createElement(Ut,{addPadding:!0}),c.React.createElement(Ot,{style:{paddingHorizontal:16,paddingBottom:16}},c.React.createElement(Za,{android_ripple:Ba.androidRipple,disabled:!1,accessibilityRole:\"button\",accessibilityLabel:\"boykisser\",accessibilityHint:\"tap to boykiss\",onPress:function(){const f=\"nya,mwah,uwu,nya~,guh,blehhh >:P\".split(\",\");C.showToast(f[Math.floor(Math.random()*f.length)])},delayLongPress:500,onLongPress:function(){if(p.settings.debug.boykisserDead)return C.showToast(\"fuck you\");d&&clearTimeout(d),d=setTimeout(function(){l=-1},3e3),l++;const f=[\"tapping and holding on boykisser will kill him. are you sure?\",\"i am serious, are you sure?\",\"are you TOTALLY sure you want to kill him?\",\"this cannot be undone\",\"please, have mercy on him\",\"this is your last warning, he will be forever killed\",\"you don't want to do this\",\"please, i beg you\"];f[l]?C.showToast(f[l]):(p.settings.debug.boykisserDead=!0,yt.setItem(\"CRPC_boykisser\",\"true\"),a(),C.showToast(\"you have MURDERED boykisser. fuck you\"))}},c.React.createElement(c.ReactNative.Image,{source:{uri:\"https://cdn.discordapp.com/attachments/919655852724604978/1126175249424191548/723.gif\"},style:{borderRadius:8,width:\"100%\",aspectRatio:1}}))))),c.React.createElement(Ot,{style:{marginBottom:20}})))}const p=Bn.storage,ye={lastRawActivity:void 0,lastRawActivityTimestamp:void 0};var La={onLoad:async function(){p.settings.debug&&(p.settings.debug.boykisserDead=await yt.getItem(\"CRPC_boykisser\")===\"true\"),Je(),xa()},onUnload:function(){Dt(),Cn(!0)},settings:$a};return we.debug=ye,we.default=La,we.vstorage=p,Object.defineProperty(we,\"__esModule\",{value:!0}),we})({},vendetta.plugin,vendetta,vendetta.metro,vendetta.metro.common,vendetta.ui,vendetta.ui.assets,vendetta.ui.components,vendetta.ui.toasts,vendetta.utils,vendetta.storage,vendetta.ui.alerts,vendetta.debug);\n"},"https://vd-plugins.github.io/proxy/vendetta.nexpid.xyz/song-spotlight/":{"id":"https://vd-plugins.github.io/proxy/vendetta.nexpid.xyz/song-spotlight/","manifest":{"name":"SongSpotlight","description":"Makes it so you can pin songs to your profile","authors":[{"name":"nexpid","id":"853550207039832084"}],"main":"index.js","vendetta":{"icon":"ic_music","original":"vendetta.nexpid.xyz/song-spotlight/"},"hash":"06a70e1ee1a488ed015cfea01879a4c6e614dd4d53c1da881af8b364911a810f"},"enabled":true,"update":true,"js":"(function(k,be,V,Se,l,e,b,me,p,M,C,xe,Nt,ae){\"use strict\";const Ae=l.findByStoreName(\"ThemeStore\"),Pe=l.findByProps(\"colors\",\"meta\");l.findByProps(\"triggerHaptic\");const H=l.findByProps(\"TextStyleSheet\").TextStyleSheet,{View:L,Text:re,Pressable:Te}=M.General;l.findByProps(\"TableRow\");const Ie=l.findByProps(\"ActionSheet\")?.ActionSheet??l.find(function(t){return t.render?.name===\"ActionSheet\"}),Be=l.findByProps(\"openLazy\",\"hideActionSheet\"),{openLazy:Ne,hideActionSheet:O}=Be,{ActionSheetTitleHeader:ke,ActionSheetCloseButton:De,ActionSheetContentContainer:_e}=l.findByProps(\"ActionSheetTitleHeader\",\"ActionSheetCloseButton\",\"ActionSheetContentContainer\");l.findByProps(\"ActionSheetRow\")?.ActionSheetRow,l.findByName(\"Navigator\")??l.findByProps(\"Navigator\")?.Navigator,l.findByProps(\"getRenderCloseButton\")?.getRenderCloseButton??l.findByProps(\"getHeaderCloseButton\")?.getHeaderCloseButton,l.findByProps(\"popModal\",\"pushModal\");const ie=l.findByProps(\"useSearchControls\"),G=l.findByProps(\"useSettingSearchQuery\"),Me=l.findByName(\"SettingSearchBar\"),{SvgXml:oe}=l.findByProps(\"SvgXml\");l.findByProps(\"useInMainTabsExperiment\",\"isInMainTabsExperiment\");const Le=l.find(function(t){return t?.WebView&&!t.default}).WebView;l.findByProps(\"Button\",\"SegmentedControl\");function Oe(t){return Pe.meta.resolveSemanticColor(Ae.theme,t)}function X(t,n){try{Ne(new Promise(function(r){return r({default:t})}),\"ActionSheet\",n)}catch(r){xe.logger.error(r.stack),C.showToast(\"Got error when opening ActionSheet! Please check debug logs\",p.getAssetIDByName(\"Smal\"))}}Object.assign(function(t){let{searchContext:n,controls:r}=t;return e.React.createElement(e.ReactNative.ScrollView,{scrollEnabled:!1},e.React.createElement(ie.default,{searchContext:n,controls:r},e.React.createElement(Me,null)))},{useAdvancedSearch:function(t){const n=G.useSettingSearchQuery(),r=ie.useSearchControls(t,!1,function(){});return e.React.useEffect(function(){return function(){G.setSettingSearchQuery(\"\"),G.setIsSettingSearchActive(!1)}},[]),[n,r]}}),window.nativeModuleProxy.DCDFileManager??window.nativeModuleProxy.RTNFileManager,window.nativeModuleProxy.BundleUpdaterManager,window.nativeModuleProxy.MMKVManager,window.nativeModuleProxy.DCDSoundManager;function $e(t){let{title:n,onPress:r,icon:a}=t;const o=e.stylesheet.createThemedStyleSheet({androidRipple:{color:b.semanticColors.ANDROID_RIPPLE},icon:{height:18,tintColor:b.semanticColors.HEADER_SECONDARY,opacity:.5}}),s=r?Te:L;return e.React.createElement(s,{android_ripple:o.androidRipple,disabled:!1,accessibilityRole:\"button\",onPress:r,style:{marginBottom:8,flexDirection:\"row\",justifyContent:\"flex-start\",alignItems:\"center\"}},a&&e.React.createElement(L,{style:{marginRight:4}},e.React.createElement(e.ReactNative.Image,{style:o.icon,source:a,resizeMode:\"contain\"})),e.React.createElement(S,{variant:\"text-sm/semibold\",color:\"HEADER_SECONDARY\"},n))}function ce(t){let{title:n,onTitlePress:r,icon:a,children:o,padding:s}=t;const u=e.stylesheet.createThemedStyleSheet({main:{backgroundColor:b.semanticColors.CARD_PRIMARY_BG,borderRadius:16,overflow:\"hidden\",flex:1}});return e.React.createElement(L,{style:{marginHorizontal:16,marginTop:16}},e.React.createElement($e,{title:n,onPress:r,icon:a}),e.React.createElement(L,{style:u.main},s?e.React.createElement(L,{style:{paddingHorizontal:16,paddingVertical:16}},o):o))}var se;(function(t){function n(a){let{children:o,onPress:s}=a;return e.React.createElement(S,{variant:\"text-md/bold\",onPress:s},o)}t.Bold=n;function r(a){let{children:o,onPress:s}=a;return e.React.createElement(re,{style:{textDecorationLine:\"underline\"},onPress:s},o)}t.Underline=r})(se||(se={}));function S(t){let{variant:n,lineClamp:r,color:a,align:o,style:s,onPress:u,getChildren:f,children:i,liveUpdate:g}=t;const[m,x]=e.React.useReducer(function(N){return~N},0);return e.React.useEffect(function(){if(!g)return;const N=new Date().setMilliseconds(1e3);let E;const c=setTimeout(function(){x(),E=setInterval(x,1e3)},N-Date.now());return function(){clearTimeout(c),clearInterval(E)}},[]),e.React.createElement(re,{style:[n?H[n]:{},a?{color:Oe(b.semanticColors[a])}:{},o?{textAlign:o}:{},s??{}],numberOfLines:r,onPress:u},f?.()??i)}const le=\"https://songspotlight.nexpid.xyz/\";var P={get api(){return y.host?y.host.endsWith(\"/\")?y.host:`${y.host}/`:le},oauth2:{clientId:\"1157745434140344321\",get redirectURL(){return`${y.host?y.host.endsWith(\"/\")?y.host:`${y.host}/`:le}api/oauth2-response`}}};function Ue(t){if(t===void 0)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}function je(t,n){if(!(t instanceof n))throw new TypeError(\"Cannot call a class as a function\")}function z(t,n,r){return ue()?z=Reflect.construct:z=function(a,o,s){var u=[null];u.push.apply(u,o);var f=Function.bind.apply(a,u),i=new f;return s&&U(i,s.prototype),i},z.apply(null,arguments)}function $(t){return $=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},$(t)}function Ve(t,n){if(typeof n!=\"function\"&&n!==null)throw new TypeError(\"Super expression must either be null or a function\");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&U(t,n)}function ze(t){return Function.toString.call(t).indexOf(\"[native code]\")!==-1}function Fe(t,n){return n&&(He(n)===\"object\"||typeof n==\"function\")?n:Ue(t)}function U(t,n){return U=Object.setPrototypeOf||function(r,a){return r.__proto__=a,r},U(t,n)}function He(t){\"@swc/helpers - typeof\";return t&&typeof Symbol<\"u\"&&t.constructor===Symbol?\"symbol\":typeof t}function W(t){var n=typeof Map==\"function\"?new Map:void 0;return W=function(r){if(r===null||!ze(r))return r;if(typeof r!=\"function\")throw new TypeError(\"Super expression must either be null or a function\");if(typeof n<\"u\"){if(n.has(r))return n.get(r);n.set(r,a)}function a(){return z(r,arguments,$(this).constructor)}return a.prototype=Object.create(r.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),U(a,r)},W(t)}function ue(){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}}function Ge(t){var n=ue();return function(){var r=$(t),a;if(n){var o=$(this).constructor;a=Reflect.construct(r,arguments,o)}else a=r.apply(this,arguments);return Fe(this,a)}}const de=l.findByStoreName(\"UserStore\");let D=function(t){Ve(r,t);var n=Ge(r);function r(a){je(this,r);var o;return o=n.call(this,`${a.status}: ${a.message}${a.error?` (${a.error})`:\"\"}`),o.name=o.constructor.name,o}return r}(W(Error));function T(){return y.auth?.[de.getCurrentUser()?.id]}async function J(){var t;const n=new Error(\"Unauthorized, try logging out and back in again\");let r=T();if(!r)throw n;if(Date.now()>=r.expiresAt){const a=await fetch(`${P.api}api/refresh-access-token?refresh_token=${encodeURIComponent(r.refreshToken)}`);if(a.status!==200)throw new D(await a.json());r=await a.json(),(t=y).auth??(t.auth={}),y.auth[de.getCurrentUser().id]=r}return r.accessToken}async function Xe(t){const n=await fetch(`${P.api}api/get-access-token?code=${encodeURIComponent(t)}`);if(n.status===200)return await n.json();throw new D(await n.json())}async function We(t){const n=new URLSearchParams;n.append(\"id\",t);const r=await fetch(`${P.api}api/get-profile-data?${n.toString()}`);if(r.status===200)return await r.json();throw new D(await r.json())}async function Je(){if(!T())return;const t=await fetch(`${P.api}api/get-data`,{headers:{authorization:await J()}});if(t.status===200)return await t.json();throw new D(await t.json())}async function Ze(t){if(!T())return;const n=await fetch(`${P.api}api/sync-data`,{method:\"POST\",headers:{authorization:await J(),\"content-type\":\"application/json\"},body:JSON.stringify(t)});if(n.status===200)return await n.json();throw new D(await n.json())}async function Ye(){if(!T())return;const t=await fetch(`${P.api}api/delete-data`,{method:\"DELETE\",headers:{authorization:await J()}});if(t.status===200)return await t.json();throw new D(await t.json())}let fe=0;function Qe(t){clearTimeout(fe),fe=setTimeout(t,1500)}let pe;function Z(){const t=pe?.slice();pe=JSON.stringify(v.data),t&&t!==JSON.stringify(v.data)&&Qe(function(){return Ze(v.data.songs)})}const{pushModal:qe,popModal:Ke}=l.findByProps(\"pushModal\",\"popModal\"),et=l.findByName(\"OAuth2AuthorizeModal\"),tt=l.findByStoreName(\"UserStore\");function nt(){qe({key:\"oauth2-authorize\",modal:{key:\"oauth2-authorize\",modal:et,animation:\"slide-up\",shouldPersistUnderModals:!1,props:{clientId:P.oauth2.clientId,redirectUri:P.oauth2.redirectURL,scopes:[\"identify\"],responseType:\"code\",permissions:0n,cancelCompletesFlow:!1,callback:async function(t){var n;let{location:r}=t;try{const a=new URL(r).searchParams.get(\"code\"),o=await Xe(a);(n=y).auth??(n.auth={}),y.auth[tt.getCurrentUser().id]=o,te(),C.showToast(\"Successfully authenticated\",p.getAssetIDByName(\"Check\"))}catch(a){C.showToast(String(a),p.getAssetIDByName(\"Small\"))}},dismissOAuthModal:function(){return Ke(\"oauth2-authorize\")}},closable:!0}})}const Y=new Map,Q=async function(t,n,r,a){const o=`${t}${n}${r}`;if(Y.has(o))return Y.get(o);if(t===\"spotify\"){const s=await(await fetch(`https://open.spotify.com/embed/${n}/${r}`,{signal:a})).text(),u=JSON.parse(`{\"props\"${s.split('{\"props\"')[1].split(\"<\\/script>\")[0]}`);return Y.set(o,u),u}else return!1};async function at(t,n,r,a){if(t===\"spotify\"){const o=(await Q(t,n,r,a))?.props?.pageProps?.state?.data?.entity;return o?.name&&o?.coverArt?o:!1}else return!1}async function rt(t,n,r,a){return t===\"spotify\"?(await Q(t,n,r,a))?.props?.pageProps?.state?.data?.entity?.name??!1:!1}async function it(t,n,r,a){return t===\"spotify\"?(await Q(t,n,r,a)).page?.props?.status!==404:!1}const he=function(t,n,r){return t===\"spotify\"?`https://open.spotify.com/${n}/${r}`:void 0};l.findByStoreName(\"ThemeStore\");async function ot(t){await e.ReactNative.Linking.canOpenURL(t)?e.url.openDeeplink(t):await e.ReactNative.Linking.canOpenURL(\"market://details?id=com.spotify.music\")?e.url.openDeeplink(\"market://details?id=com.spotify.music\"):e.url.openDeeplink(\"itms-apps://itunes.apple.com/app/id324684580\")}function ct(t){let{service:n,type:r,id:a,normal:o}=t;const[s,u]=e.React.useState(null);return e.React.useEffect(function(){u(void 0),a&&rt(n,r,a).then(function(f){return u(f!==!1?f:\"N/A\")})},[a]),e.React.createElement(S,{variant:o?\"text-md/semibold\":\"text-md/medium\",color:o?\"TEXT_NORMAL\":\"TEXT_MUTED\"},s??\"-\")}const{FormRow:I}=M.Forms,st={color:\"TEXT_DANGER\",variant:\"text-md/semibold\"};function q(t){let{song:n,remove:r,showAdd:a}=t;const o=e.stylesheet.createThemedStyleSheet({destructiveIcon:{tintColor:b.semanticColors.TEXT_DANGER}});return React.createElement(Ie,null,React.createElement(_e,null,React.createElement(ke,{title:\"Edit Song\",trailing:React.createElement(De,{onPress:O})}),n.service===\"spotify\"&&React.createElement(I,{label:\"Open in Spotify\",leading:React.createElement(I.Icon,{source:p.getAssetIDByName(\"img_account_sync_spotify_light_and_dark\")}),onPress:function(){ot(`spotify://${n.type}/${n.id}`),O()}}),React.createElement(I,{label:\"Copy link\",leading:React.createElement(I.Icon,{source:p.getAssetIDByName(\"copy\")}),onPress:function(){e.clipboard.setString(he(n.service,n.type,n.id)),C.showToast(\"Copied to clipboard.\",p.getAssetIDByName(\"toast_copy_link\")),O()}}),a&&React.createElement(I,{label:\"Add to your profile\",leading:React.createElement(I.Icon,{source:p.getAssetIDByName(\"ic_pin\")}),onPress:function(){O();const s=v.data?.songs;if(!s)return;const u=s.findIndex(function(f){return f===null});if(u===-1)return C.showToast(\"No space left!\",p.getAssetIDByName(\"Small\"));s[u]=n,Z(),C.showToast(\"Added to your profile\",p.getAssetIDByName(\"Check\"))}}),r&&React.createElement(I,{label:React.createElement(S,st,\"Remove song\"),leading:React.createElement(I.Icon,{style:o.destructiveIcon,source:p.getAssetIDByName(\"trash\")}),onPress:function(){r(),C.showToast(\"Removed\",p.getAssetIDByName(\"toast_trash\")),O()}})))}const{ScrollView:lt,View:K}=M.General,{FormRow:B}=M.Forms,ye=l.findByStoreName(\"UserStore\");function ut(){V.useProxy(v),V.useProxy(y),Z();const t=e.stylesheet.createThemedStyleSheet({song:{backgroundColor:b.semanticColors.BG_MOD_FAINT,borderRadius:8},serviceFrame:{height:24,width:24,backgroundColor:b.semanticColors.BG_MOD_FAINT,borderRadius:2147483647}}),n=!!T(),r=!!v.data;return React.createElement(lt,null,React.createElement(ce,{title:\"Songs\",icon:p.getAssetIDByName(\"abc\"),padding:!0},n&&r?React.createElement(K,{style:{flexDirection:\"column\",gap:8}},v.data.songs.map(function(a,o){return React.createElement(B,{label:a===null?\"Press to add song in this position\":React.createElement(ct,{service:a.service,type:a.type,id:a.id,normal:!0}),leading:a===null?React.createElement(K,{style:t.serviceFrame}):React.createElement(e.ReactNative.Image,{style:t.serviceFrame,source:p.getAssetIDByName(\"img_account_sync_spotify_light_and_dark\")}),onLongPress:function(){return a&&X(q,{song:a,remove:function(){return v.data.songs[o]=null}})},onPress:function(){return me.showInputAlert({title:\"Add song\",placeholder:[\"https://open.spotify.com/track/ABC\",\"https://open.spotify.com/album/ABC\",\"https://open.spotify.com/playlist/ABC\",\"https://spotify.link/ABC\"].sort(function(){return Math.random()>.5?1:-1})[0],initialValue:a&&he(a.service,a.type,a.id),cancelText:\"Cancel\",confirmText:\"Save\",onConfirm:async function(s){const u=s.match(Se.HTTP_REGEX_MULTI)?.[0];if(!u)throw new Error(\"Invalid link!\");let f=new URL(u),i=f.hostname,g,m,x;if(i===\"spotify.link\"&&(g=\"spotify\",f=new URL((await fetch(u)).url),i=f.hostname),i===\"open.spotify.com\"){g=\"spotify\";const[N,E,c]=f.pathname.split(\"/\");[\"album\",\"track\",\"playlist\"].includes(E)&&c&&(m=E,x=c)}if(!g||!m||!x)throw new Error(\"Missing service, type or id!\");if(!await it(g,m,x))throw new Error(\"Invalid song!\");v.data.songs[o]={service:g,type:m,id:x}}})},style:t.song})})):n?React.createElement(e.ReactNative.ActivityIndicator,{size:\"small\",style:{flex:1}}):React.createElement(S,{variant:\"text-md/semibold\",color:\"TEXT_NORMAL\",align:\"center\"},\"Authenticate first to manage your songs\")),React.createElement(ce,{title:\"Authentication\",icon:p.getAssetIDByName(\"lock\")},T()?React.createElement(React.Fragment,null,React.createElement(B,{label:\"Log out\",subLabel:\"Logs you out of SongSpotlight\",leading:React.createElement(B.Icon,{source:p.getAssetIDByName(\"ic_logout_24px\")}),onPress:function(){var a;(a=y).auth??(a.auth={}),delete y.auth[ye.getCurrentUser().id],delete v.data,C.showToast(\"Successfully logged out\",p.getAssetIDByName(\"ic_logout_24px\"))}}),React.createElement(B,{label:\"Delete data\",subLabel:\"Deletes your SongSpotlight data\",leading:React.createElement(B.Icon,{source:p.getAssetIDByName(\"trash\")}),onPress:async function(){var a;await Ye(),(a=y).auth??(a.auth={}),delete y.auth[ye.getCurrentUser().id],delete v.data,C.showToast(\"Successfully deleted data\",p.getAssetIDByName(\"trash\"))}})):React.createElement(B,{label:\"Authenticate\",leading:React.createElement(B.Icon,{source:p.getAssetIDByName(\"copy\")}),trailing:B.Arrow,onPress:nt})),React.createElement(K,{style:{height:12}}))}const dt=l.findByStoreName(\"ThemeStore\"),ft=function(t,n){return dt.theme!==\"light\"?t:n},F=function(t,n,r){const a=function(i){return i.match(/\\w\\w/g)?.map(function(g){return parseInt(g,16)})??[0,0,0]},o=function(i){return`#${i.map(function(g){return g.toString(16).padStart(2,\"0\")}).join(\"\")}`},s=a(t),u=a(n),f=s.map(function(i,g){return Math.round(i+(u[g]-i)*r)});return o(f)};var pt=`\n\n`,ht=`\n\n`,yt=`\n\n`,gt=`\n\n