From 9eae8bbe4f8ef71215c8734a9f9fba813526aaf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Malte=20J=C3=BCrgens?= Date: Sat, 22 Oct 2022 23:56:49 +0200 Subject: [PATCH] further work on vencord --- assets/vencord/VencordNativeStub.ts | 7 ++-- assets/vencord/settings.patch | 46 ++++++++++++++++++++++++++ assets/vencord/vencord.js | 51 ++++++++++++++--------------- scripts/build_vencord.sh | 3 +- src/discordpage.cpp | 11 ++++++- src/webclass.cpp | 44 ++++++++++++++++++++----- 6 files changed, 122 insertions(+), 40 deletions(-) create mode 100644 assets/vencord/settings.patch diff --git a/assets/vencord/VencordNativeStub.ts b/assets/vencord/VencordNativeStub.ts index e818216..d6d2a98 100644 --- a/assets/vencord/VencordNativeStub.ts +++ b/assets/vencord/VencordNativeStub.ts @@ -21,9 +21,9 @@ window.VencordNative = { webclass.vencordSend(event, args); }, sendSync: (event: string, ...args: any[]) => { + // We need this hack because Vencord requires its settings right when it starts if (event === "VencordGetSettings") { - console.log("stub: IPC VencordGetSettings"); - return "{}"; + return window.discordScreenaudioVencordSettings || "{}"; } else throw new Error("Synchroneous IPC not implemented"); }, on(event: string, listener: () => {}) { @@ -34,6 +34,9 @@ window.VencordNative = { }, invoke: async (event: string, ...args: any[]) => { await prepareWebclass(); + if (event === "VencordSetSettings") { + window.discordScreenaudioVencordSettings = args[0]; + } return webclass.vencordSend(event, args); }, }, diff --git a/assets/vencord/settings.patch b/assets/vencord/settings.patch new file mode 100644 index 0000000..7ed2035 --- /dev/null +++ b/assets/vencord/settings.patch @@ -0,0 +1,46 @@ +diff --git a/src/components/Settings.tsx b/src/components/Settings.tsx +index 8ffe111..8f037bd 100644 +--- a/src/components/Settings.tsx ++++ b/src/components/Settings.tsx +@@ -61,37 +61,22 @@ export default ErrorBoundary.wrap(function Settings() { + Settings Directory: {settingsDir} + + +- {!IS_WEB && ++ + +- + +- } +- +- {IS_WEB && } ++ + + + {var Do=Object.create;var Fe=Object.defineProperty;var No=Object.getOwnPropertyDescriptor;var Fo=Object.getOwnPropertyNames;var Lo=Object.getPrototypeOf,Uo=Object.prototype.hasOwnProperty;var Oo=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(t,n)=>(typeof require!="undefined"?require:t)[n]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var l=(e,t)=>()=>(e&&(t=e(e=0)),t);var k=(e,t)=>{for(var n in t)Fe(e,n,{get:t[n],enumerable:!0})},Kn=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Fo(t))!Uo.call(e,o)&&o!==n&&Fe(e,o,{get:()=>t[o],enumerable:!(r=No(t,o))||r.enumerable});return e};var $o=(e,t,n)=>(n=e!=null?Do(Lo(e)):{},Kn(t||!e||!e.__esModule?Fe(n,"default",{value:e,enumerable:!0}):n,e)),Vo=e=>Kn(Fe({},"__esModule",{value:!0}),e);function s(e){return e}var m=l(()=>{"use strict"});var Ze={};k(Ze,{Devs:()=>a,REACT_GLOBAL:()=>Go,WEBPACK_CHUNK:()=>z});var z,Go,a,u=l(()=>{"use strict";z="webpackChunkdiscord_app",Go="Vencord.Webpack.Common.React",a=Object.freeze({Ven:{name:"Vendicated",id:343383572805058560n},Arjix:{name:"ArjixWasTaken",id:674710789138939916n},Cyn:{name:"Cynosphere",id:150745989836308480n},Megu:{name:"Megumin",id:545581357812678656n},botato:{name:"botato",id:440990343899643943n},obscurity:{name:"obscurity",id:336678828233588736n},rushii:{name:"rushii",id:295190422244950017n},Glitch:{name:"Glitchy",id:269567451199569920n},Samu:{name:"Samu",id:702973430449832038n},Animal:{name:"Animal",id:118437263754395652n},MaiKokain:{name:"Mai",id:722647978577363026n}})});var et,Qn=l(()=>{"use strict";m();u();et=s({name:"STFU",description:"Disables the 'HOLD UP' banner in the console",authors:[a.Ven],patches:[{find:"setDevtoolsCallbacks",replacement:{match:/if\(.{0,10}\|\|"0.0.0"!==.{0,2}\.remoteApp\.getVersion\(\)\)/,replace:"if(false)"}}]})});var tt,Yn=l(()=>{"use strict";m();u();tt=s({name:"CommandsAPI",authors:[a.Arjix],description:"Api required by anything that uses commands",patches:[{find:'"giphy","tenor"',replacement:[{match:/(?<=\w=)(\w)(\.filter\(.{0,30}giphy)/,replace:"Vencord.Api.Commands._init($1)$2"}]},{find:"Unexpected value for option",replacement:{match:/,(.{1,2})\.execute\((.{1,2}),(.{1,2})\)]/,replace:(e,t,n,r)=>`,Vencord.Api.Commands._handleCommand(${t}, ${n}, ${r})]`}}]})});var nt,Jn=l(()=>{"use strict";u();m();nt=s({name:"MessageEventsAPI",description:"Api required by anything using message events.",authors:[a.Arjix],patches:[{find:"sendMessage:function",replacement:[{match:/(?<=_sendMessage:function\([^)]+\)){/,replace:"{Vencord.Api.MessageEvents._handlePreSend(...arguments);"},{match:/(?<=\beditMessage:function\([^)]+\)){/,replace:"{Vencord.Api.MessageEvents._handlePreEdit(...arguments);"}]},{find:"if(e.altKey){",replacement:{match:/var \w=(\w)\.id,\w=(\w)\.id;return .{1,2}\.useCallback\(\(?function\((.{1,2})\){/,replace:(e,t,n,r)=>`var _msg=${t},_chan=${n};${e}Vencord.Api.MessageEvents._handleClick(_msg, _chan, ${r});`}}]})});var rt,Xn=l(()=>{"use strict";u();m();rt=s({name:"ApiNotices",description:"Fixes notices being automatically dismissed",authors:[a.Ven],required:!0,patches:[{find:"updateNotice:",replacement:[{match:/;(.{1,2}=null;)(?=.{0,50}updateNotice)/g,replace:";if(Vencord.Api.Notices.currentNotice)return !1;$1"},{match:/(?<=NOTICE_DISMISS:function.+?){(?=if\(null==(.+?)\))/,replace:'{if($1?.id=="VencordNotice")return ($1=null,Vencord.Api.Notices.nextNotice(),true);'}]}]})});var ot,Zn=l(()=>{"use strict";m();u();ot=s({name:"BANger",description:"Replaces the GIF in the ban dialogue with a custom one.",authors:[{name:"Xinto",id:423915768191647755n},a.Glitch],patches:[{find:"BAN_CONFIRM_TITLE.",replacement:{match:/src:\w\(\d+\)/g,replace:'src: "https://i.imgur.com/wp5q52C.mp4"'}}]})});var it,er=l(()=>{"use strict";u();m();it=s({name:"BetterGifAltText",authors:[a.Ven],description:"Change GIF alt text from simply being 'GIF' to containing the gif tags / filename",patches:[{find:"onCloseImage=",replacement:{match:/(return .{1,2}\.createElement.{0,50}isWindowFocused)/,replace:"Vencord.Plugins.plugins.BetterGifAltText.altify(e);$1"}},{find:'preload:"none","aria',replacement:{match:/\?.{0,5}\.Messages\.GIF/,replace:"?(e.alt='GIF',Vencord.Plugins.plugins.BetterGifAltText.altify(e))"}}],altify(e){if(e.alt!=="GIF")return e.alt;let t=e.original||e.src;try{t=decodeURI(t)}catch{}let n=t.slice(t.lastIndexOf("/")+1).replace(/\d/g,"").replace(/.gif$/,"").split(/[,\-_ ]+/g).slice(0,20).join(" ");return n.length>300&&(n=n.slice(0,300)+"..."),n&&(e.alt+=` - ${n}`),e.alt}})});var st,tr=l(()=>{"use strict";m();u();st=s({name:"BetterUploadButton",authors:[a.obscurity],description:"Upload with a single click, open menu with right click",patches:[{find:"Messages.CHAT_ATTACH_UPLOAD_OR_INVITE",replacement:{match:/CHAT_ATTACH_UPLOAD_OR_INVITE,onDoubleClick:([^,]+),onClick:([^,]+)}}/,replace:"CHAT_ATTACH_UPLOAD_OR_INVITE,onClick:$1,onContextMenu:$2}}"}}]})});var nr,rr=l(()=>{"use strict";nr=["action_object_map","action_type_map","action_ref_map","spm@*.aliexpress.com","scm@*.aliexpress.com","aff_platform","aff_trace_key","algo_expid@*.aliexpress.*","algo_pvid@*.aliexpress.*","btsid","ws_ab_test","pd_rd_*@amazon.*","_encoding@amazon.*","psc@amazon.*","tag@amazon.*","ref_@amazon.*","pf_rd_*@amazon.*","pf@amazon.*","crid@amazon.*","keywords@amazon.*","sprefix@amazon.*","sr@amazon.*","ie@amazon.*","node@amazon.*","qid@amazon.*","callback@bilibili.com","cvid@bing.com","form@bing.com","sk@bing.com","sp@bing.com","sc@bing.com","qs@bing.com","pq@bing.com","sc_cid","mkt_tok","trk","trkCampaign","ga_*","gclid","gclsrc","hmb_campaign","hmb_medium","hmb_source","spReportId","spJobID","spUserID","spMailingID","itm_*","s_cid","elqTrackId","elqTrack","assetType","assetId","recipientId","campaignId","siteId","mc_cid","mc_eid","pk_*","sc_campaign","sc_channel","sc_content","sc_medium","sc_outcome","sc_geo","sc_country","nr_email_referer","vero_conv","vero_id","yclid","_openstat","mbid","cmpid","cid","c_id","campaign_id","Campaign","hash@ebay.*","fb_action_ids","fb_action_types","fb_ref","fb_source","fbclid","refsrc@facebook.com","hrc@facebook.com","gs_l","gs_lcp@google.*","ved@google.*","ei@google.*","sei@google.*","gws_rd@google.*","gs_gbg@google.*","gs_mss@google.*","gs_rn@google.*","_hsenc","_hsmi","__hssc","__hstc","hsCtaTracking","source@sourceforge.net","position@sourceforge.net","t@*.twitter.com","s@*.twitter.com","ref_*@*.twitter.com","tt_medium","tt_content","lr@yandex.*","redircnt@yandex.*","feature@youtube.com","kw@youtube.com","wt_zmc","utm_source","utm_content","utm_medium","utm_campaign","utm_term","si@open.spotify.com"]});var A,Z=l(()=>{"use strict";A=class{constructor(t,n){this.name=t;this.color=n}_log(t,n,r){console[t](`%c Vencord %c %c ${this.name} `,`background: ${n}; color: black; font-weight: bold; border-radius: 5px;`,"",`background: ${this.color}; color: black; font-weight: bold; border-radius: 5px;`,...r)}log(...t){this._log("log","#a6d189",t)}info(...t){this._log("info","#a6d189",t)}error(...t){this._log("error","#e78284",t)}warn(...t){this._log("warn","#e5c890",t)}debug(...t){this._log("debug","#eebebe",t)}}});var ut={};k(ut,{_handleClick:()=>zo,_handlePreEdit:()=>Wo,_handlePreSend:()=>jo,addClickListener:()=>pt,addPreEditListener:()=>ee,addPreSendListener:()=>O,removeClickListener:()=>mt,removePreEditListener:()=>te,removePreSendListener:()=>$});function jo(e,t,n){for(let r of ct)try{r(e,t,n)}catch(o){at.error(`MessageSendHandler: Listener encoutered an unknown error. (${o})`)}}function Wo(e,t,n){for(let r of lt)try{r(e,t,n)}catch(o){at.error(`MessageEditHandler: Listener encoutered an unknown error. (${o})`)}}function O(e){return ct.add(e),e}function ee(e){return lt.add(e),e}function $(e){return ct.delete(e)}function te(e){return lt.delete(e)}function zo(e,t,n){for(let r of dt)try{r(e,t,n)}catch(o){at.error(`MessageClickHandler: Listener encoutered an unknown error. (${o})`)}}function pt(e){return dt.add(e),e}function mt(e){return dt.delete(e)}var at,ct,lt,dt,Y=l(()=>{"use strict";Z();at=new A("MessageEvents","#e5c890"),ct=new Set,lt=new Set;dt=new Set});var or,Ho,ft,ir=l(()=>{"use strict";rr();Y();m();or=/[\\^$.*+?()[\]{}|]/g,Ho=RegExp(or.source),ft=s({name:"clearURLs",description:"Removes tracking garbage from URLs",authors:[{name:"adryd",id:0n}],dependencies:["MessageEventsAPI"],escapeRegExp(e){return e&&Ho.test(e)?e.replace(or,"\\$&"):e||""},createRules(){let e=nr;this.universalRules=new Set,this.rulesByHost=new Map,this.hostRules=new Map;for(let t of e){let n=t.split("@"),r=new RegExp("^"+this.escapeRegExp(n[0]).replace(/\\\*/,".+?")+"$");if(!n[1]){this.universalRules.add(r);continue}let o=new RegExp("^(www\\.)?"+this.escapeRegExp(n[1]).replace(/\\\./,"\\.").replace(/^\\\*\\\./,"(.+?\\.)?").replace(/\\\*/,".+?")+"$"),i=o.toString();this.hostRules.set(i,o),this.rulesByHost.get(i)==null&&this.rulesByHost.set(i,new Set),this.rulesByHost.get(i).add(r)}},removeParam(e,t,n){(t===e||e instanceof RegExp&&e.test(t))&&n.delete(t)},replacer(e){try{var t=new URL(e)}catch{return e}return t.searchParams.entries().next().done?e:(this.universalRules.forEach(n=>{t.searchParams.forEach((r,o,i)=>{this.removeParam(n,o,i)})}),this.hostRules.forEach((n,r)=>{!n.test(t.hostname)||this.rulesByHost.get(r).forEach(o=>{t.searchParams.forEach((i,d,c)=>{this.removeParam(o,d,c)})})}),t.toString())},onSend(e){e.content.match(/http(s)?:\/\//)&&(e.content=e.content.replace(/(https?:\/\/[^\s<]+[^<.,:;"'>)|\]\s])/g,t=>this.replacer(t)))},start(){this.createRules(),this.preSend=O((e,t)=>this.onSend(t)),this.preEdit=ee((e,t,n)=>this.onSend(n))},stop(){$(this.preSend),te(this.preEdit)}})});var gt={};k(gt,{Common:()=>xt,_initWebpack:()=>Et,_resolveReady:()=>Ue,addListener:()=>Qo,cache:()=>ne,extract:()=>Xo,filters:()=>y,find:()=>B,findAll:()=>ar,findAllByProps:()=>Ko,findByDisplayName:()=>qo,findByProps:()=>re,listeners:()=>yt,mapMangledModule:()=>cr,mapMangledModuleLazy:()=>bt,onceReady:()=>ht,removeListener:()=>Yo,search:()=>Jo,subscriptions:()=>sr,waitFor:()=>b,wreq:()=>J});var F=l(()=>{"use strict";Oe();v()});function H(e){let t;return()=>t??(t=e())}function R(e){return Se(()=>B(e))}function _e(e,t=null){let[n,r]=x.useState({value:t,error:null,pending:!0});return x.useEffect(()=>{let o=!0;return e().then(i=>o&&r({value:i,error:null,pending:!1})).catch(i=>o&&r({value:null,error:i,pending:!1})),()=>void(o=!1)},[]),[n.value,n.error,n.pending]}function ei(e){return t=>{let n=x.useMemo(e,[]);return Vencord.Webpack.Common.React.createElement(n,{...t})}}function oe(e,t){for(let n in t){let r=t[n];typeof r=="object"&&!Array.isArray(r)?(e[n]??={},oe(e[n],r)):e[n]??=r}return e}function _t(e,t=n=>n){let{length:n}=e;if(n===0)return"";if(n===1)return t(e[0]);let r="";for(let o=0;o2?r+=", ":n-o>1&&(r+=" and ");return r}function de(...e){return e.join(" ")}function St(e){return new Promise(t=>setTimeout(t,e))}function ti(e,t,n){return t.constructor.name==="AsyncFunction"?async function(){try{await t.apply(n??this,arguments)}catch(r){console.error(`Caught an Error in ${e||"anonymous"} -`,r)}}:function(){try{t.apply(n??this,arguments)}catch(r){console.error(`Caught an Error in ${e||"anonymous"} -`,r)}}}function Ct(e,t){let n="```";return`${n}${t||""} -${e} -${n}`}var Zo,N=l(()=>{"use strict";F();v();$e();Zo=H});function Se(e){let t=H(e);return new Proxy(ni,{get:(n,r)=>t()[r],set:(n,r,o)=>t()[r]=o,has:(n,r)=>r in t(),apply:(n,r,o)=>t().apply(r,o),ownKeys:()=>Reflect.ownKeys(t()),construct:(n,r)=>Reflect.construct(t(),r),deleteProperty:(n,r)=>delete t()[r],defineProperty:(n,r,o)=>!!Object.defineProperty(t(),r,o),getPrototypeOf:()=>Object.getPrototypeOf(t())})}var ni,$e=l(()=>{"use strict";N();ni=function(){}});function Et(e){if(ne!==void 0)throw"no.";J=e.push([[Symbol()],{},t=>t]),ne=J.c,e.pop()}function B(e,t=!0){if(typeof e!="function")throw new Error("Invalid filter. Expected a function got "+typeof e);for(let n in ne){let r=ne[n];if(!!r?.exports){if(e(r.exports))return r.exports;if(typeof r.exports=="object"){if(r.exports.default&&e(r.exports.default))return t?r.exports.default:r.exports;for(let o in r.exports)if(o.length<=3){let i=r.exports[o];if(i&&e(i))return i}}}}return null}function ar(e,t=!0){if(typeof e!="function")throw new Error("Invalid filter. Expected a function got "+typeof e);let n=[];for(let r in ne){let o=ne[r];if(!!o?.exports){if(e(o.exports))n.push(o.exports);else if(typeof o.exports!="object")continue;if(o.exports.default&&e(o.exports.default))n.push(t?o.exports.default:o.exports);else for(let i in o.exports)if(i.length<=3){let d=o.exports[i];d&&e(d)&&n.push(d)}}}return n}function cr(e,t){let n={};for(let r in J.m)if(J.m[r].toString().includes(e)){let i=J(r);e:for(let d in i){let c=i[d];for(let f in t)if(t[f](c)){n[f]=c;continue e}}break}return n}function bt(e,t){return Se(()=>cr(e,t))}function re(...e){return B(y.byProps(e))}function Ko(...e){return ar(y.byProps(e))}function qo(e){return B(y.byDisplayName(e))}function b(e,t){if(typeof e=="string")e=y.byProps([e]);else if(Array.isArray(e))e=y.byProps(e);else if(typeof e!="function")throw new Error("filter must be a string, string[] or function, got "+typeof e);let n=B(e);if(n)return void t(n);sr.set(e,t)}function Qo(e){yt.add(e)}function Yo(e){yt.delete(e)}function Jo(...e){let t={},n=J.m;e:for(let r in n){let o=n[r].original??n[r],i=o.toString();for(let d of e)if(typeof d=="string"&&!i.includes(d)||d instanceof RegExp&&!d.test(i))continue e;t[r]=o}return t}function Xo(e){let t=J.m[e];if(!t)return null;let n=` +"use strict";var Vencord=(()=>{var Xi=Object.create;var tt=Object.defineProperty;var Ji=Object.getOwnPropertyDescriptor;var Zi=Object.getOwnPropertyNames;var es=Object.getPrototypeOf,ts=Object.prototype.hasOwnProperty;var ns=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(t,n)=>(typeof require!="undefined"?require:t)[n]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var a=(e,t)=>()=>(e&&(t=e(e=0)),t);var D=(e,t)=>{for(var n in t)tt(e,n,{get:t[n],enumerable:!0})},Lo=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Zi(t))!ts.call(e,r)&&r!==n&&tt(e,r,{get:()=>t[r],enumerable:!(o=Ji(t,r))||o.enumerable});return e};var os=(e,t,n)=>(n=e!=null?Xi(es(e)):{},Lo(t||!e||!e.__esModule?tt(n,"default",{value:e,enumerable:!0}):n,e)),rs=e=>Lo(tt({},"__esModule",{value:!0}),e);function he(e){let t=te(e);return new Proxy(ss,{get:(n,o)=>t()[o],set:(n,o,r)=>t()[o]=r,has:(n,o)=>o in t(),apply:(n,o,r)=>t().apply(o,r),ownKeys:()=>Reflect.ownKeys(t()),construct:(n,o)=>Reflect.construct(t(),o),deleteProperty:(n,o)=>delete t()[o],defineProperty:(n,o,r)=>!!Object.defineProperty(t(),o,r),getPrototypeOf:()=>Object.getPrototypeOf(t())})}var ss,ot=a(()=>{"use strict";O();ss=function(){}});function Mt(e){if(ye!==void 0)throw"no.";le=e.push([[Symbol()],{},t=>t]),ye=le.c,e.pop()}function X(e,t=!0){if(typeof e!="function")throw new Error("Invalid filter. Expected a function got "+typeof e);for(let n in ye){let o=ye[n];if(!!o?.exports){if(e(o.exports))return o.exports;if(typeof o.exports=="object"){if(o.exports.default&&e(o.exports.default))return t?o.exports.default:o.exports;for(let r in o.exports)if(r.length<=3){let i=o.exports[r];if(i&&e(i))return i}}}}return null}function Vo(e,t=!0){if(typeof e!="function")throw new Error("Invalid filter. Expected a function got "+typeof e);let n=[];for(let o in ye){let r=ye[o];if(!!r?.exports){if(e(r.exports))n.push(r.exports);else if(typeof r.exports!="object")continue;if(r.exports.default&&e(r.exports.default))n.push(t?r.exports.default:r.exports);else for(let i in r.exports)if(i.length<=3){let l=r.exports[i];l&&e(l)&&n.push(l)}}}return n}function $o(e,t){let n={};for(let o in le.m)if(le.m[o].toString().includes(e)){let i=le(o);e:for(let l in i){let m=i[l];for(let g in t)if(t[g](m)){n[g]=m;continue e}}break}return n}function Ne(e,t){return he(()=>$o(e,t))}function be(...e){return X(h.byProps(e))}function as(...e){return Vo(h.byProps(e))}function cs(e){return X(h.byDisplayName(e))}function k(e,t){if(typeof e=="string")e=h.byProps([e]);else if(Array.isArray(e))e=h.byProps(e);else if(typeof e!="function")throw new Error("filter must be a string, string[] or function, got "+typeof e);let n=X(e);if(n)return void t(n);Bo.set(e,t)}function ls(e){It.add(e)}function ds(e){It.delete(e)}function ps(...e){let t={},n=le.m;e:for(let o in n){let r=n[o].original??n[o],i=r.toString();for(let l of e)if(typeof l=="string"&&!i.includes(l)||l instanceof RegExp&&!l.test(i))continue e;t[o]=r}return t}function ms(e){let t=le.m[e];if(!t)return null;let n=` // [EXTRACTED] WebpackModule${e} // WARNING: This module was extracted to be more easily readable. // This module is NOT ACTUALLY USED! This means putting breakpoints will have NO EFFECT!! ${t.toString()} //# sourceURL=ExtractedWebpackModule${e} -`;return(0,eval)(n)}var Ue,ht,J,ne,y,sr,yt,Oe=l(()=>{"use strict";$e();ht=new Promise(e=>Ue=e),y={byProps:e=>e.length===1?t=>t[e[0]]!==void 0:t=>e.every(n=>t[n]!==void 0),byDisplayName:e=>t=>t.default?.displayName===e,byCode:(...e)=>t=>{if(typeof t!="function")return!1;let n=Function.prototype.toString.call(t);for(let r of e)if(!n.includes(r))return!1;return!0}},sr=new Map,yt=new Set});var xt={};k(xt,{Alerts:()=>se,Button:()=>D,Card:()=>me,ChannelStore:()=>pe,FluxDispatcher:()=>C,Forms:()=>_,GuildStore:()=>Ve,Margins:()=>U,Parser:()=>ue,React:()=>x,Router:()=>Be,SelectedChannelStore:()=>V,Switch:()=>ie,Toasts:()=>w,Tooltip:()=>lr,UserStore:()=>K});var U,C,x,Ve,K,V,pe,_,me,D,ie,lr,Be,ue,se,ri,oi,w,v=l(()=>{"use strict";Oe();N();U=R(y.byProps(["marginTop20"])),_={},ri={MESSAGE:0,SUCCESS:1,FAILURE:2,CUSTOM:3},oi={TOP:0,BOTTOM:1},w={Type:ri,Position:oi,genId:()=>(Math.random()||Math.random()).toString(36).slice(2)};b("useState",e=>x=e);b(["dispatch","subscribe"],e=>{C=e;let t=()=>{e.unsubscribe("CONNECTION_OPEN",t),Ue()};e.subscribe("CONNECTION_OPEN",t)});b(["getCurrentUser","initialize"],e=>K=e);b("getSortedPrivateChannels",e=>pe=e);b("getCurrentlySelectedChannelId",e=>V=e);b("getGuildCount",e=>Ve=e);b(["Hovers","Looks","Sizes"],e=>D=e);b(y.byCode("helpdeskArticleId"),e=>ie=e);b(["Positions","Colors"],e=>lr=e);b(e=>e.Types?.PRIMARY==="cardPrimary",e=>me=e);b(e=>e.Tags&&y.byCode("errorSeparator")(e),e=>_.FormTitle=e);b(e=>e.Tags&&y.byCode("titleClassName","sectionTitle")(e),e=>_.FormSection=e);b(e=>e.Types?.INPUT_PLACEHOLDER,e=>_.FormText=e);b(e=>{if(typeof e!="function")return!1;let t=e.toString();return t.length<200&&t.includes("divider")},e=>_.FormDivider=e);b(y.byCode("currentToast?"),e=>w.show=e);b(y.byCode("currentToast:null"),e=>w.pop=e);b(["show","close"],e=>se=e);b("parseTopic",e=>ue=e);b(["open","saveAccountChanges"],e=>Be=e)});var wt,dr=l(()=>{"use strict";u();m();v();wt=s({name:"ClickableRoleDot",authors:[a.Ven],description:"Makes RoleDots (Accessibility Feature) copy colour to clipboard on click",patches:[{find:"M0 4C0 1.79086 1.79086 0 4 0H16C18.2091 0 20 1.79086 20 4V16C20 18.2091 18.2091 20 16 20H4C1.79086 20 0 18.2091 0 16V4Z",replacement:{match:/(viewBox:"0 0 20 20")/,replace:"$1,onClick:()=>Vencord.Plugins.plugins.ClickableRoleDot.copyToClipBoard(e.color)"}}],copyToClipBoard(e){window.DiscordNative.clipboard.copy(e),w.show({message:"Copied to Clipboard!",type:w.Type.SUCCESS,id:w.genId(),options:{duration:1e3,position:w.Position.BOTTOM}})}})});var Pt,Tt,pr=l(()=>{"use strict";u();m();Pt=e=>()=>{throw new Error(`'${e}' is Discord Desktop only.`)},Tt=s({name:"ConsoleShortcuts",description:"Adds shorter Aliases for many things on the window. Run `shortcutList` for a list.",authors:[a.Ven],getShortcuts(){return{toClip:IS_WEB?Pt("toClip"):window.DiscordNative.clipboard.copy,fromClip:IS_WEB?Pt("fromClip"):window.DiscordNative.clipboard.read,wp:Vencord.Webpack,wpc:Vencord.Webpack.wreq.c,wreq:Vencord.Webpack.wreq,wpsearch:Vencord.Webpack.search,wpex:Vencord.Webpack.extract,findByProps:Vencord.Webpack.findByProps,find:Vencord.Webpack.find,Plugins:Vencord.Plugins,React:Vencord.Webpack.Common.React,Settings:Vencord.Settings,Api:Vencord.Api,reload:()=>location.reload(),restart:IS_WEB?Pt("restart"):window.DiscordNative.app.relaunch}},start(){let e=this.getShortcuts();window.shortcutList=e;for(let[t,n]of Object.entries(e))window[t]=n},stop(){delete window.shortcutList;for(let e in this.getShortcuts())delete window[e]}})});var vt,mr=l(()=>{"use strict";m();vt=s({name:"discord-screenaudio",authors:[{name:"maltejur",id:205966226709676032n}],required:!0,description:"UI patches for discord-screenaudio.",patches:[]})});var Rt,ur=l(()=>{"use strict";u();m();Rt=s({name:"Experiments",authors:[a.Ven,a.Megu],description:"Enable Experiments",patches:[{find:"Object.defineProperties(this,{isDeveloper",replacement:{match:/(?<={isDeveloper:\{[^}]+,get:function\(\)\{return )\w/,replace:"true"}},{find:'type:"user",revision',replacement:{match:/(\w)\|\|"CONNECTION_OPEN".+?;/g,replace:"$1=!0;"}}]})});function Mt(){return`-${fr.fromTimestamp(Date.now())}`}function Ce(e,t){let n=ii({channelId:e,content:"",embeds:[]});return si.receiveMessage(e,oe(t,n)),t}function G(e,t,n){return e.find(r=>r.name===t)?.value||n}var ii,si,fr,It=l(()=>{"use strict";F();N();ii=R(y.byCode('username:"Clyde"')),si=R(y.byProps(["receiveMessage"]));b("fromTimestamp",e=>fr=e)});var Ge,we,kt,At=l(()=>{"use strict";Ge=(p=>(p[p.SUB_COMMAND=1]="SUB_COMMAND",p[p.SUB_COMMAND_GROUP=2]="SUB_COMMAND_GROUP",p[p.STRING=3]="STRING",p[p.INTEGER=4]="INTEGER",p[p.BOOLEAN=5]="BOOLEAN",p[p.USER=6]="USER",p[p.CHANNEL=7]="CHANNEL",p[p.ROLE=8]="ROLE",p[p.MENTIONABLE=9]="MENTIONABLE",p[p.NUMBER=10]="NUMBER",p[p.ATTACHMENT=11]="ATTACHMENT",p))(Ge||{}),we=(i=>(i[i.BUILT_IN=0]="BUILT_IN",i[i.BUILT_IN_TEXT=1]="BUILT_IN_TEXT",i[i.BUILT_IN_INTEGRATION=2]="BUILT_IN_INTEGRATION",i[i.BOT=3]="BOT",i[i.PLACEHOLDER=4]="PLACEHOLDER",i))(we||{}),kt=(r=>(r[r.CHAT_INPUT=1]="CHAT_INPUT",r[r.USER=2]="USER",r[r.MESSAGE=3]="MESSAGE",r))(kt||{})});var Lt={};k(Lt,{ApplicationCommandInputType:()=>we,ApplicationCommandOptionType:()=>Ge,ApplicationCommandType:()=>kt,BUILT_IN:()=>fe,OptionalMessageOption:()=>ge,RequiredMessageOption:()=>Pe,_handleCommand:()=>ci,_init:()=>ai,commands:()=>Dt,findOption:()=>G,generateId:()=>Mt,registerCommand:()=>Nt,sendBotMessage:()=>Ce,unregisterCommand:()=>Ft});function yr(e){e.displayName||=e.name,e.displayDescription||=e.description,e.options?.forEach((t,n,r)=>{t===gr?r[n]=ge:t===hr&&(r[n]=Pe),t.choices?.forEach(o=>o.displayName||=o.name),yr(r[n])})}function Nt(e,t){if(fe.some(n=>n.name===e.name))throw new Error(`Command '${e.name}' already exists.`);e.isVencordCommand=!0,e.id??=Mt(),e.applicationId??="-1",e.type??=1,e.inputType??=1,e.plugin||=t,yr(e),Dt[e.name]=e,fe.push(e)}function Ft(e){let t=fe.findIndex(n=>n.name===e);return t===-1?!1:(fe.splice(t,1),delete Dt[e],!0)}var fe,Dt,gr,hr,ge,Pe,ai,ci,ae=l(()=>{"use strict";N();It();At();At();It();Dt={},gr=Symbol("OptionalMessageOption"),hr=Symbol("RequiredMessageOption"),ge=gr,Pe=hr,ai=function(e){try{fe=e,ge=e.find(t=>t.name==="shrug").options[0],Pe=e.find(t=>t.name==="me").options[0]}catch{console.error("Failed to load CommandsApi")}return e},ci=function(e,t,n){if(!e.isVencordCommand)return e.execute(t,n);let r=o=>{let i=`An Error occurred while executing command "${e.name}"`,d=o instanceof Error?o.stack||o.message:String(o);console.error(i,o),Ce(n.channel.id,{content:`${i}: -${Ct(d)}`,author:{username:"Vencord"}})};try{let o=e.execute(t,n);return o instanceof Promise?o.catch(r):o}catch(o){return r(o)}}});var Er,Ut,br=l(()=>{"use strict";ae();u();m();Er={fart:new Audio("https://raw.githubusercontent.com/ItzOnlyAnimal/AliuPlugins/main/fart.mp3")},Ut=s({name:"Fart2",authors:[a.Animal],description:"Enable farting v2, a slash command that allows you to perform or request that someone perform a little toot.",dependencies:["CommandsAPI"],commands:[{name:"fart",description:"A simple command in which you may either request that a user do a little toot for you, or conduct one yourself.",options:[{type:6,name:"user",description:"A Discord\u2122 user of which you would humbly request a toot from.",required:!1}],execute(e){return Er.fart.volume=.3,Er.fart.play(),{content:e[0]?`<@${e[0].value}> fart`:"fart"}}}]})});var li,Ot,xr=l(()=>{"use strict";m();Y();u();li=/https?:\/\/twitter\.com(?=\/\w+?\/status\/)/g,Ot=s({name:"FxTwitter",description:"Uses FxTwitter to improve embeds from twitter on send",authors:[a.Samu],dependencies:["MessageEventsAPI"],addPrefix(e){e.content=e.content.replace(li,"https://fxtwitter.com")},start(){this.preSend=O((e,t)=>this.addPrefix(t))},stop(){$(this.preSend)}})});var $t,_r=l(()=>{"use strict";u();m();$t=s({name:"iLoveSpam",description:"Do not hide messages from 'likely spammers'",authors:[a.botato,a.Animal],patches:[{find:"),{hasFlag:",replacement:{match:/(if\((.{1,2})<=1<<30\)return)/,replace:"if($2===(1<<20)){return false};$1"}}]})});var Vt,Sr=l(()=>{"use strict";u();m();Vt=s({name:"Ify",description:"Disables Spotify auto-pausing and Premium checks, allowing you to listen along with others.",authors:[a.Cyn],patches:[{find:'.displayName="SpotifyStore"',replacement:[{match:/\.isPremium=.;/,replace:".isPremium=true;"},{match:/function (.{1,2})\(\).{0,200}SPOTIFY_AUTO_PAUSED\);.{0,}}}}/,replace:"function $1(){}"}]}]})});function Mr(e,t){let n=e.findIndex(r=>r.id===t);return n===-1?n:e.length-n-1}function Pr({channelId:e,messageId:t,_isQuickEdit:n}){if(n)return;let r=K.getCurrentUser().id,o=Bt.getMessages(e)._array.filter(i=>i.author.id===r);We=Mr(o,t)}function Tr({message:e,_isQuickReply:t}){t||(je=Mr(Bt.getMessages(e.channel_id)._array,e.id))}function vr(e){let t=e.key==="ArrowUp";!t&&e.key!=="ArrowDown"||!di(e)||pi(e)||(e.shiftKey?ui(t):mi(t))}function Ir(e,t){let n=Bt.getMessages(V.getChannelId())._array;if(!t){let i=K.getCurrentUser().id;n=n.filter(d=>d.author.id===i)}let r=i=>e?Math.min(n.length-1,i+1):Math.max(-1,i-1),o;return t?je=o=r(je):We=o=r(We),o===-1?void 0:n[n.length-o-1]}function mi(e){let t=Ir(e,!0);if(!t)return void C.dispatch({type:"DELETE_PENDING_REPLY",channelId:V.getChannelId()});let n=pe.getChannel(t.channel_id);C.dispatch({type:"CREATE_PENDING_REPLY",channel:n,message:t,shouldMention:!0,showMentionToggle:n.guild_id!==null,_isQuickReply:!0})}function ui(e){let t=Ir(e,!1);t?C.dispatch({type:"MESSAGE_START_EDIT",channelId:t.channel_id,messageId:t.id,content:t.content,_isQuickEdit:!0}):C.dispatch({type:"MESSAGE_END_EDIT",channelId:V.getChannelId()})}var Bt,Rr,je,We,Gt,Cr,wr,di,pi,kr=l(()=>{"use strict";m();u();v();F();N();Bt=R(y.byProps(["getRawMessages"])),Rr=navigator.platform.includes("Mac"),je=-1,We=-1,Gt=s({name:"InteractionKeybinds",authors:[a.obscurity,a.Ven],description:"Reply to (ctrl + up/down) and edit (ctrl + shift + up/down) messages via keybinds",start(){C.subscribe("DELETE_PENDING_REPLY",Cr),C.subscribe("MESSAGE_END_EDIT",wr),C.subscribe("MESSAGE_START_EDIT",Pr),C.subscribe("CREATE_PENDING_REPLY",Tr),document.addEventListener("keydown",vr)},stop(){C.unsubscribe("DELETE_PENDING_REPLY",Cr),C.unsubscribe("MESSAGE_END_EDIT",wr),C.unsubscribe("MESSAGE_START_EDIT",Pr),C.unsubscribe("CREATE_PENDING_REPLY",Tr),document.removeEventListener("keydown",vr)}}),Cr=()=>je=-1,wr=()=>We=-1;di=e=>Rr?e.metaKey:e.ctrlKey,pi=e=>e.altKey||!Rr&&e.metaKey});var jt,Ar=l(()=>{"use strict";u();m();jt=s({name:"isStaff",description:"Gives access to client devtools & other things locked behind isStaff",authors:[a.Megu,{name:"Nickyux",id:427146305651998721n},{name:"BanTheNons",id:460478012794863637n}],patches:[{find:".isStaff=function(){",replacement:[{match:/return\s*(\w+)\.hasFlag\((.+?)\.STAFF\)}/,replace:"return Vencord.Webpack.Common.UserStore.getCurrentUser().id===$1.id||$1.hasFlag($2.STAFF)}"},{match:/hasFreePremium=function\(\){return this.isStaff\(\)\s*\|\|/,replace:"hasFreePremium=function(){return "}]}]})});var Wt,Dr,Nr,zt,Fr=l(()=>{"use strict";Y();u();m();F();v();Wt=!1,Dr=e=>e.key==="Backspace"&&(Wt=!0),Nr=e=>e.key==="Backspace"&&(Wt=!1),zt=s({name:"MessageQuickActions",description:"Quick Delete, Quick edit",authors:[a.Ven],dependencies:["MessageEventsAPI"],start(){let{deleteMessage:e,startEditMessage:t}=re("deleteMessage"),{can:n}=re("can","initialize"),{MANAGE_MESSAGES:r}=B(i=>typeof i.MANAGE_MESSAGES=="bigint"),{isEditing:o}=re("isEditing");document.addEventListener("keydown",Dr),document.addEventListener("keyup",Nr),this.onClick=pt((i,d,c)=>{let f=i.author.id===K.getCurrentUser().id;Wt?(f||n(r,d))&&(e(d.id,i.id),c.preventDefault()):f&&c.detail>=2&&!o(d.id,i.id)&&(t(d.id,i.id,i.content),c.preventDefault())})},stop(){mt(this.onClick),document.removeEventListener("keydown",Dr),document.removeEventListener("keyup",Nr)}})});var Ht,Lr=l(()=>{"use strict";m();ae();u();Ht=s({name:"MoreCommands",description:"echo, lenny",authors:[a.Arjix,{name:"ICodeInAssembly",id:702973430449832038n}],dependencies:["CommandsAPI"],commands:[{name:"echo",description:"Sends a message as Clyde (locally)",options:[ge],inputType:3,execute:(e,t)=>{let n=G(e,"message","");Ce(t.channel.id,{content:n})}},{name:"lenny",description:"Sends a lenny face",options:[ge],execute:e=>({content:G(e,"message","")+" ( \u0361\xB0 \u035C\u0296 \u0361\xB0)"})}]})});function hi(e,t){let n=0,r=0;for(;(r=e.indexOf(t,r)+1)!==0;)n++;return n}function yi(e,t){if(!t.global)throw new Error("pattern must be global");let n=0;for(;t.test(e);)n++;return n}function bi(e){let t=hi(e,Or)+yi(e,Ei);return Math.min(t,10)}function Ur(){let e=document.createElement("audio");e.src=fi,e.play()}var Or,fi,gi,Kt,Ei,$r=l(()=>{"use strict";m();u();v();N();Or="\u{1F5FF}",fi="https://github.com/MeguminSama/VencordPlugins/raw/main/plugins/moyai/moyai.mp3",gi=!0,Kt=s({name:"Moyai",authors:[a.Megu],description:"\u{1F5FF}\u{1F5FF}\u{1F5FF}\u{1F5FF}\u{1F5FF}\u{1F5FF}\u{1F5FF}\u{1F5FF}",async onMessage(e){if(e.optimistic||e.type!=="MESSAGE_CREATE"||e.message.state==="SENDING"||gi&&e.message.author?.bot||!e.message.content||e.channelId!==V.getChannelId())return;let t=bi(e.message.content);for(let n=0;n/gi});var Qt,Vr=l(()=>{"use strict";m();u();Qt=s({name:"MuteNewGuild",description:"Mutes newly joined guilds",authors:[a.Glitch],patches:[{find:",acceptInvite:function",replacement:{match:/(\w=null!==[^;]+)/,replace:"$1;Vencord.Webpack.findByProps('updateGuildNotificationSettings').updateGuildNotificationSettings($1,{'muted':true,'suppress_everyone':true,'suppress_roles':true})"}}]})});var Yt,Br=l(()=>{"use strict";Y();F();m();u();v();Yt=s({name:"NitroBypass",authors:[a.Arjix],description:"Allows you to stream in nitro quality and send fake emojis.",dependencies:["MessageEventsAPI"],patches:[{find:"canUseAnimatedEmojis:function",replacement:["canUseAnimatedEmojis","canUseEmojisEverywhere","canUseHighVideoQuality","canStreamHighQuality","canStreamMidQuality"].map(e=>({match:new RegExp(`${e}:function\\(.+?}`),replace:`${e}:function (e) { return true; }`}))},{find:"STREAM_FPS_OPTION.format",replacement:{match:/(userPremiumType|guildPremiumTier):.{0,10}TIER_\d,?/g,replace:""}}],get guildId(){return window.location.href.split("channels/")[1].split("/")[0]},get canUseEmotes(){return Boolean(K.getCurrentUser().premiumType)},start(){if(this.canUseEmotes){console.info("[NitroBypass] Skipping start because you have nitro");return}let{getCustomEmojiById:e}=re("getCustomEmojiById");function t(n,r){return!n[r]||/\s/.test(n[r])?"":" "}this.preSend=O((n,r)=>{let{guildId:o}=this;for(let i of r.validNonShortcutEmojis){if(!i.require_colons||i.guildId===o&&!i.animated)continue;let d=`<${i.animated?"a":""}:${i.originalName||i.name}:${i.id}>`,c=i.url.replace(/\?size=[0-9]+/,"?size=48");r.content=r.content.replace(d,(f,E,h)=>`${t(h,E-1)}${c}${t(h,E+f.length)}`)}}),this.preEdit=ee((n,r,o)=>{let{guildId:i}=this;for(let[d,c,f]of o.content.matchAll(/(?/ig)){let E=e(f);if(E==null||E.guildId===i&&!E.animated||!E.require_colons)continue;let h=E.url.replace(/\?size=[0-9]+/,"?size=48");o.content=o.content.replace(d,(p,g,S)=>`${t(S,g-1)}${h}${t(S,g+p.length)}`)}})},stop(){$(this.preSend),te(this.preEdit)}})});var Jt,Gr=l(()=>{"use strict";u();m();Jt=s({name:"NoBlockedMessages",description:"Hides all blocked messages from chat completely.",authors:[a.rushii],patches:[{find:'safety_prompt:"DMSpamExperiment",response:"show_redacted_messages"',replacement:[{match:/collapsedReason;return (?=\w{1,2}.createElement)/,replace:"collapsedReason; return null;"}]}]})});var Xt,jr=l(()=>{"use strict";m();Y();u();Xt=s({name:"NoCanaryMessageLinks",description:"Removes the canary and ptb prefix from message links",authors:[a.Samu],dependencies:["MessageEventsAPI"],removeBetas(e){e.content=e.content.replace(/(?<=https:\/\/)(canary.|ptb.)(?=discord(?:app)?.com\/channels\/(?:\d{17,20}|@me)\/\d{17,20}\/\d{17,20})/g,"")},start(){this.preSend=O((e,t)=>this.removeBetas(t))},stop(){$(this.preSend)}})});var Zt,Wr=l(()=>{"use strict";m();u();Zt=s({name:"No F1",description:"Disables F1 help bind.",authors:[a.Cyn],patches:[{find:',"f1"],comboKeysBindGlobal:',replacement:{match:',"f1"],comboKeysBindGlobal:',replace:"],comboKeysBindGlobal:"}}]})});var en,zr=l(()=>{"use strict";m();u();en=s({name:"No RPC",description:"Disables Discord's RPC server.",authors:[a.Cyn],patches:[{find:'.ensureModule("discord_rpc")',replacement:{match:/\.ensureModule\("discord_rpc"\)\.then\(\(.+?\)\)}/,replace:'.ensureModule("discord_rpc")}'}}]})});var tn,Hr=l(()=>{"use strict";m();tn=s({name:"NoReplyMention",description:"Disables reply pings by default",authors:[{name:"DustyAngel47",id:714583473804935238n}],patches:[{find:"CREATE_PENDING_REPLY:function",replacement:{match:/CREATE_PENDING_REPLY:function\((.{1,2})\){/,replace:"CREATE_PENDING_REPLY:function($1){$1.shouldMention=false;"}}]})});var nn,Kr=l(()=>{"use strict";u();m();nn=s({name:"NoSystemBadge",description:"Disables the taskbar and system tray unread count badge.",authors:[a.rushii],patches:[{find:"setSystemTrayApplications:function",replacement:[{match:/setBadge:function.+?},/,replace:"setBadge:function(){},"},{match:/setSystemTrayIcon:function.+?},/,replace:"setSystemTrayIcon:function(){},"}]}]})});var rn,qr=l(()=>{"use strict";m();u();rn=s({name:"NoTrack",description:"Disable Discord's tracking and crash reporting",authors:[a.Cyn],required:!0,patches:[{find:"TRACKING_URL:",replacement:{match:/^.+$/,replace:"()=>{}"}},{find:"window.DiscordSentry=",replacement:{match:/window\.DiscordSentry=function.+\}\(\)/,replace:""}}]})});function Yr(e){let t=e instanceof File,n=t?URL.createObjectURL(e):e;return new Promise((r,o)=>{let i=new Image;i.onload=()=>{t&&URL.revokeObjectURL(n),r(i)},i.onerror=(d,c,f,E,h)=>o(h||d),i.crossOrigin="Anonymous",i.src=n})}async function vi(e,t,n){for(let r of e)switch(r.name){case"image":let o=Ti.getUploads(t.channel.id,Qr)[0];if(o){if(!o.isImage)throw"Upload is not an image";return o.item.file}break;case"url":return r.value;case"user":try{return(await wi(r.value)).getAvatarURL(n?void 0:t.guild?.id,2048).replace(/\?size=\d+$/,"?size=2048")}catch(i){throw console.error(`[petpet] Failed to fetch user -`,i),"Failed to fetch user. Check the console for more info."}}return null}var Qr,xi,_i,ze,Si,Ci,wi,Pi,Ti,on,Jr=l(()=>{"use strict";ae();u();m();N();F();Qr=0,xi=20,_i=128,ze=10,Si=H(()=>import("https://unpkg.com/gifenc@1.0.3/dist/gifenc.esm.js")),Ci=H(()=>Promise.all(Array.from({length:ze},(e,t)=>Yr(`https://raw.githubusercontent.com/VenPlugs/petpet/main/frames/pet${t}.gif`)))),wi=R(y.byCode(".USER(")),Pi=R(y.byCode("UPLOAD_FILE_LIMIT_ERROR")),Ti=R(y.byProps(["getUploads"]));on=s({name:"petpet",description:"headpet a cutie",authors:[a.Ven],dependencies:["CommandsAPI"],commands:[{inputType:0,name:"petpet",description:"Create a petpet gif. You can only specify one of the image options",options:[{name:"delay",description:"The delay between each frame. Defaults to 20.",type:4},{name:"resolution",description:"Resolution for the gif. Defaults to 120. If you enter an insane number and it freezes Discord that's your fault.",type:4},{name:"image",description:"Image attachment to use",type:11},{name:"url",description:"URL to fetch image from",type:3},{name:"user",description:"User whose avatar to use as image",type:6},{name:"no-server-pfp",description:"Use the normal avatar instead of the server specific one when using the 'user' option",type:5}],execute:async(e,t)=>{let{GIFEncoder:n,quantize:r,applyPalette:o}=await Si(),i=await Ci(),d=G(e,"no-server-pfp",!1);try{var c=await vi(e,t,d);if(!c)throw"No Image specified!"}catch(T){console.log(T);return}let f=await Yr(c),E=G(e,"delay",xi),h=G(e,"resolution",_i),p=new n,g=document.createElement("canvas");g.width=g.height=h;let S=g.getContext("2d");for(let T=0;TPi([M],t.channel,Qr))}}]})});var sn,Xr=l(()=>{"use strict";u();m();sn=s({name:"PlainFolderIcon",description:"Doesn't show the small guild icons in folders",authors:[a.botato],patches:[{find:"().expandedFolderIconWrapper",replacement:[{match:/\(\w\|\|\w\)(&&\(\w=\w\.createElement\(\w+\.animated)/,replace:"true$1"}]}]})});var an,Zr=l(()=>{"use strict";m();u();an=s({name:"RandomiseFileNames",authors:[a.obscurity],description:"Randomise uploaded file names",patches:[{find:"instantBatchUpload:function",replacement:{match:/uploadFiles:(.{1,2}),/,replace:"uploadFiles:(...args)=>(args[0].uploads.forEach(f=>f.filename=Vencord.Plugins.plugins.RandomiseFileNames.rand(f.filename)),$1(...args)),"}}],rand(e){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";return Array.from({length:7},()=>t[Math.floor(Math.random()*t.length)]).join("")+(e.lastIndexOf(".")>-1?e.slice(e.lastIndexOf(".")):"")}})});var he,He=l(()=>{he="0d99663"});var cn,eo=l(()=>{"use strict";m();He();u();cn=s({name:"Settings",description:"Adds Settings UI and debug info",authors:[a.Ven],required:!0,patches:[{find:"().versionHash",replacement:[{match:/\w\.createElement\(.{1,2}.Fragment,.{0,30}\{[^}]+\},"Host ".+?\):null/,replace:e=>{let t=e.indexOf("Host")-1,n=e.slice(0,t),r=`${e}, ${n}"Vencord ", "${he}${IS_WEB?" (Web)":""}"), " ")`;return IS_WEB||(r+=`,${n} "Electron ",VencordNative.getVersions().electron)," "),`,r+=`${n} "Chrome ",VencordNative.getVersions().chrome)," ")`),r}}]},{find:"Messages.ACTIVITY_SETTINGS",replacement:{match:/\{section:(.{1,2})\.ID\.HEADER,\s*label:(.{1,2})\..{1,2}\.Messages\.ACTIVITY_SETTINGS\}/,replace:(e,t)=>`{section:${t}.ID.HEADER,label:"Vencord"},{section:"VencordSetting",label:"Vencord",element:Vencord.Components.Settings},{section:"VencordUpdater",label:"Updater",element:Vencord.Components.Updater,predicate:()=>!IS_WEB},{section:${t}.ID.DIVIDER},${e}`}}]})});var ln,to=l(()=>{"use strict";m();u();ln=s({name:"SilentTyping",authors:[a.Ven],description:"Hide that you are typing",patches:[{find:"startTyping:",replacement:{match:/startTyping:.+?,stop/,replace:"startTyping:()=>{},stop"}}]})});var dn,no=l(()=>{"use strict";m();Y();u();dn=s({name:"Unindent",description:"Trims leading indentation from codeblocks",authors:[a.Ven],dependencies:["MessageEventsAPI"],patches:[{find:"inQuote:",replacement:{match:/,content:([^,]+),inQuote/,replace:(e,t)=>`,content:Vencord.Plugins.plugins.Unindent.unindent(${t}),inQuote`}}],unindent(e){e=e.replace(/\t/g," ");let t=e.match(/^ *(?=\S)/gm)?.reduce((n,r)=>Math.min(n,r.length),1/0)??0;return t?e.replace(new RegExp(`^ {${t}}`,"gm"),""):e},unindentMsg(e){e.content=e.content.replace(/```(.|\n)*?```/g,t=>{let n=t.split(` -`);if(n.length<2)return t;let r="";return n[n.length-1]==="```"&&(r=n.pop()),`${n[0]} +`;return(0,eval)(n)}var rt,kt,le,ye,h,Bo,It,it=a(()=>{"use strict";ot();kt=new Promise(e=>rt=e),h={byProps:e=>e.length===1?t=>t[e[0]]!==void 0:t=>e.every(n=>t[n]!==void 0),byDisplayName:e=>t=>t.default?.displayName===e,byCode:(...e)=>t=>{if(typeof t!="function")return!1;let n=Function.prototype.toString.call(t);for(let o of e)if(!n.includes(o))return!1;return!0}},Bo=new Map,It=new Set});var At={};D(At,{Alerts:()=>Ee,Button:()=>M,Card:()=>ze,ChannelStore:()=>De,Clipboard:()=>gs,FluxDispatcher:()=>I,Forms:()=>u,GuildStore:()=>st,Margins:()=>$,Parser:()=>xe,React:()=>f,Router:()=>Go,Select:()=>We,SelectedChannelStore:()=>G,Slider:()=>_t,Switch:()=>at,Text:()=>ne,TextInput:()=>de,Toasts:()=>B,Tooltip:()=>Se,UserStore:()=>F,UserUtils:()=>Ft});var $,I,f,st,F,G,De,u,ze,M,at,Se,Go,de,ne,We,_t,xe,Ee,us,fs,B,Ft,gs,v=a(()=>{"use strict";O();it();$=C(h.byProps(["marginTop20"])),u={},We=C(h.byCode("optionClassName","popoutPosition","autoFocus","maxVisibleItems")),_t=C(h.byCode("closestMarkerIndex","stickToMarkers")),us={MESSAGE:0,SUCCESS:1,FAILURE:2,CUSTOM:3},fs={TOP:0,BOTTOM:1},B={Type:us,Position:fs,genId:()=>(Math.random()||Math.random()).toString(36).slice(2)},Ft={fetchUser:C(h.byCode(".USER(","getUser"))},gs=Ne('document.queryCommandEnabled("copy")||document.queryCommandSupported("copy")',{copy:h.byCode(".default.copy("),SUPPORTS_COPY:e=>typeof e=="boolean"});k("useState",e=>f=e);k(["dispatch","subscribe"],e=>{I=e;let t=()=>{e.unsubscribe("CONNECTION_OPEN",t),rt()};e.subscribe("CONNECTION_OPEN",t)});k(["getCurrentUser","initialize"],e=>F=e);k("getSortedPrivateChannels",e=>De=e);k("getCurrentlySelectedChannelId",e=>G=e);k("getGuildCount",e=>st=e);k(["Hovers","Looks","Sizes"],e=>M=e);k(h.byCode("helpdeskArticleId"),e=>at=e);k(["Positions","Colors"],e=>Se=e);k(e=>e.Types?.PRIMARY==="cardPrimary",e=>ze=e);k(e=>e.Tags&&h.byCode("errorSeparator")(e),e=>u.FormTitle=e);k(e=>e.Tags&&h.byCode("titleClassName","sectionTitle")(e),e=>u.FormSection=e);k(e=>e.Types?.INPUT_PLACEHOLDER,e=>u.FormText=e);k(e=>{if(typeof e!="function")return!1;let t=e.toString();return t.length<200&&t.includes("divider")},e=>u.FormDivider=e);k(h.byCode("currentToast?"),e=>B.show=e);k(h.byCode("currentToast:null"),e=>B.pop=e);k(["show","close"],e=>Ee=e);k("parseTopic",e=>xe=e);k(["open","saveAccountChanges"],e=>Go=e);k(["defaultProps","Sizes","contextType"],e=>de=e);k(e=>{if(typeof e!="function")return!1;let t=e.toString();return t.length<1500&&t.includes("data-text-variant")&&t.includes("always-white")},e=>ne=e)});var Nt={};D(Nt,{Common:()=>At,_initWebpack:()=>Mt,_resolveReady:()=>rt,addListener:()=>ls,cache:()=>ye,extract:()=>ms,filters:()=>h,find:()=>X,findAll:()=>Vo,findAllByProps:()=>as,findByDisplayName:()=>cs,findByProps:()=>be,listeners:()=>It,mapMangledModule:()=>$o,mapMangledModuleLazy:()=>Ne,onceReady:()=>kt,removeListener:()=>ds,search:()=>ps,subscriptions:()=>Bo,waitFor:()=>k,wreq:()=>le});var A=a(()=>{"use strict";v();it()});function te(e){let t;return()=>t??(t=e())}function C(e){return he(()=>X(e))}function pe(e,t=null,n){let[o,r]=f.useState({value:t,error:null,pending:!0});return f.useEffect(()=>{let i=!0;return e().then(l=>i&&r({value:l,error:null,pending:!1})).catch(l=>i&&(r({value:null,error:l,pending:!1}),n?.(l))),()=>void(i=!1)},[]),[o.value,o.error,o.pending]}function ys(e){return t=>{let n=f.useMemo(e,[]);return Vencord.Webpack.Common.React.createElement(n,{...t})}}function Pe(e,t){for(let n in t){let o=t[n];typeof o=="object"&&!Array.isArray(o)?(e[n]??={},Pe(e[n],o)):e[n]??=o}return e}function bs(e,t=n=>n){let{length:n}=e;if(n===0)return"";if(n===1)return t(e[0]);let o="";for(let r=0;r2?o+=", ":n-r>1&&(o+=" and ");return o}function Te(...e){return e.join(" ")}function Dt(e){return new Promise(t=>setTimeout(t,e))}function Ss(e,t,n){return t.constructor.name==="AsyncFunction"?async function(){try{await t.apply(n??this,arguments)}catch(o){console.error(`Caught an Error in ${e||"anonymous"} +`,o)}}:function(){try{t.apply(n??this,arguments)}catch(o){console.error(`Caught an Error in ${e||"anonymous"} +`,o)}}}function Ot(e,t){let n="```";return`${n}${t||""} +${e} +${n}`}var hs,O=a(()=>{"use strict";A();v();ot();hs=te});function He(){return`-${jo.fromTimestamp(Date.now())}`}function oe(e,t){let n=xs({channelId:e,content:"",embeds:[]});return Es.receiveMessage(e,Pe(t,n)),t}function j(e,t,n){return e.find(o=>o.name===t)?.value||n}var xs,Es,jo,Lt=a(()=>{"use strict";O();A();xs=C(h.byCode('username:"Clyde"')),Es=C(h.byProps(["receiveMessage"]));k("fromTimestamp",e=>jo=e)});var ct,Oe,Ut,Bt=a(()=>{"use strict";ct=(s=>(s[s.SUB_COMMAND=1]="SUB_COMMAND",s[s.SUB_COMMAND_GROUP=2]="SUB_COMMAND_GROUP",s[s.STRING=3]="STRING",s[s.INTEGER=4]="INTEGER",s[s.BOOLEAN=5]="BOOLEAN",s[s.USER=6]="USER",s[s.CHANNEL=7]="CHANNEL",s[s.ROLE=8]="ROLE",s[s.MENTIONABLE=9]="MENTIONABLE",s[s.NUMBER=10]="NUMBER",s[s.ATTACHMENT=11]="ATTACHMENT",s))(ct||{}),Oe=(i=>(i[i.BUILT_IN=0]="BUILT_IN",i[i.BUILT_IN_TEXT=1]="BUILT_IN_TEXT",i[i.BUILT_IN_INTEGRATION=2]="BUILT_IN_INTEGRATION",i[i.BOT=3]="BOT",i[i.PLACEHOLDER=4]="PLACEHOLDER",i))(Oe||{}),Ut=(o=>(o[o.CHAT_INPUT=1]="CHAT_INPUT",o[o.USER=2]="USER",o[o.MESSAGE=3]="MESSAGE",o))(Ut||{})});var jt={};D(jt,{ApplicationCommandInputType:()=>Oe,ApplicationCommandOptionType:()=>ct,ApplicationCommandType:()=>Ut,BUILT_IN:()=>Ce,OptionalMessageOption:()=>Le,RequiredMessageOption:()=>ve,_handleCommand:()=>Ts,_init:()=>Ps,commands:()=>Vt,findOption:()=>j,generateId:()=>He,registerCommand:()=>$t,sendBotMessage:()=>oe,unregisterCommand:()=>Gt});function Ho(e){e.displayName||=e.name,e.displayDescription||=e.description,e.options?.forEach((t,n,o)=>{t===zo?o[n]=Le:t===Wo&&(o[n]=ve),t.choices?.forEach(r=>r.displayName||=r.name),Ho(o[n])})}function $t(e,t){if(!Ce){console.warn("[CommandsAPI]",`Not registering ${e.name} as the CommandsAPI hasn't been initialised.`,"Please restart to use commands");return}if(Ce.some(n=>n.name===e.name))throw new Error(`Command '${e.name}' already exists.`);e.isVencordCommand=!0,e.id??=He(),e.applicationId??="-1",e.type??=1,e.inputType??=1,e.plugin||=t,Ho(e),Vt[e.name]=e,Ce.push(e)}function Gt(e){let t=Ce.findIndex(n=>n.name===e);return t===-1?!1:(Ce.splice(t,1),delete Vt[e],!0)}var Ce,Vt,zo,Wo,Le,ve,Ps,Ts,re=a(()=>{"use strict";O();Lt();Bt();Lt();Bt();Vt={},zo=Symbol("OptionalMessageOption"),Wo=Symbol("RequiredMessageOption"),Le=zo,ve=Wo,Ps=function(e){try{Ce=e,Le=e.find(t=>t.name==="shrug").options[0],ve=e.find(t=>t.name==="me").options[0]}catch{console.error("Failed to load CommandsApi")}return e},Ts=function(e,t,n){if(!e.isVencordCommand)return e.execute(t,n);let o=r=>{let i=`An Error occurred while executing command "${e.name}"`,l=r instanceof Error?r.stack||r.message:String(r);console.error(i,r),oe(n.channel.id,{content:`${i}: +${Ot(l)}`,author:{username:"Vencord"}})};try{let r=e.execute(t,n);return r instanceof Promise?r.catch(o):r}catch(r){return o(r)}}});var Ht={};D(Ht,{clear:()=>_s,createStore:()=>Ko,del:()=>Is,delMany:()=>Ms,entries:()=>Ns,get:()=>Cs,getMany:()=>Rs,keys:()=>Fs,promisifyRequest:()=>L,set:()=>vs,setMany:()=>ws,update:()=>ks,values:()=>As});function L(e){return new Promise((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)})}function Ko(e,t){let n=indexedDB.open(e);n.onupgradeneeded=()=>n.result.createObjectStore(t);let o=L(n);return(r,i)=>o.then(l=>i(l.transaction(t,r).objectStore(t)))}function z(){return zt||(zt=Ko("VencordData","VencordStore")),zt}function Cs(e,t=z()){return t("readonly",n=>L(n.get(e)))}function vs(e,t,n=z()){return n("readwrite",o=>(o.put(t,e),L(o.transaction)))}function ws(e,t=z()){return t("readwrite",n=>(e.forEach(o=>n.put(o[1],o[0])),L(n.transaction)))}function Rs(e,t=z()){return t("readonly",n=>Promise.all(e.map(o=>L(n.get(o)))))}function ks(e,t,n=z()){return n("readwrite",o=>new Promise((r,i)=>{o.get(e).onsuccess=function(){try{o.put(t(this.result),e),r(L(o.transaction))}catch(l){i(l)}}}))}function Is(e,t=z()){return t("readwrite",n=>(n.delete(e),L(n.transaction)))}function Ms(e,t=z()){return t("readwrite",n=>(e.forEach(o=>n.delete(o)),L(n.transaction)))}function _s(e=z()){return e("readwrite",t=>(t.clear(),L(t.transaction)))}function Wt(e,t){return e.openCursor().onsuccess=function(){!this.result||(t(this.result),this.result.continue())},L(e.transaction)}function Fs(e=z()){return e("readonly",t=>{if(t.getAllKeys)return L(t.getAllKeys());let n=[];return Wt(t,o=>n.push(o.key)).then(()=>n)})}function As(e=z()){return e("readonly",t=>{if(t.getAll)return L(t.getAll());let n=[];return Wt(t,o=>n.push(o.value)).then(()=>n)})}function Ns(e=z()){return e("readonly",t=>{if(t.getAll&&t.getAllKeys)return Promise.all([L(t.getAllKeys()),L(t.getAll())]).then(([o,r])=>o.map((i,l)=>[i,r[l]]));let n=[];return e("readonly",o=>Wt(o,r=>n.push([r.key,r.value])).then(()=>n))})}var zt,qo=a(()=>{"use strict";});var Kt={};D(Kt,{_modifyAccessories:()=>Ls,accessories:()=>lt,addAccessory:()=>Ds,removeAccessory:()=>Os});function Ds(e,t,n){lt.set(e,{callback:t,position:n})}function Os(e){lt.delete(e)}function Ls(e,t){for(let n of lt.values())e.splice(n.position!=null?n.position<0?e.length+n.position:n.position:e.length,0,n.callback(t));return e}var lt,Qo=a(()=>{"use strict";lt=new Map});var U,we=a(()=>{"use strict";U=class{constructor(t,n){this.name=t;this.color=n}_log(t,n,o){console[t](`%c Vencord %c %c ${this.name} `,`background: ${n}; color: black; font-weight: bold; border-radius: 5px;`,"",`background: ${this.color}; color: black; font-weight: bold; border-radius: 5px;`,...o)}log(...t){this._log("log","#a6d189",t)}info(...t){this._log("info","#a6d189",t)}error(...t){this._log("error","#e78284",t)}warn(...t){this._log("warn","#e5c890",t)}debug(...t){this._log("debug","#eebebe",t)}}});var tn={};D(tn,{_handleClick:()=>Vs,_handlePreEdit:()=>Bs,_handlePreSend:()=>Us,addClickListener:()=>Zt,addPreEditListener:()=>Re,addPreSendListener:()=>W,removeClickListener:()=>en,removePreEditListener:()=>ke,removePreSendListener:()=>H});function Us(e,t,n){for(let o of Yt)try{o(e,t,n)}catch(r){Qt.error(`MessageSendHandler: Listener encoutered an unknown error. (${r})`)}}function Bs(e,t,n){for(let o of Xt)try{o(e,t,n)}catch(r){Qt.error(`MessageEditHandler: Listener encoutered an unknown error. (${r})`)}}function W(e){return Yt.add(e),e}function Re(e){return Xt.add(e),e}function H(e){return Yt.delete(e)}function ke(e){return Xt.delete(e)}function Vs(e,t,n){for(let o of Jt)try{o(e,t,n)}catch(r){Qt.error(`MessageClickHandler: Listener encoutered an unknown error. (${r})`)}}function Zt(e){return Jt.add(e),e}function en(e){return Jt.delete(e)}var Qt,Yt,Xt,Jt,me=a(()=>{"use strict";we();Qt=new U("MessageEvents","#e5c890"),Yt=new Set,Xt=new Set;Jt=new Set});var rn={};D(rn,{currentNotice:()=>Ke,nextNotice:()=>Yo,noticesQueue:()=>on,popNotice:()=>$s,showNotice:()=>Gs});function $s(){nn.dismiss()}function Yo(){Ke=on.shift(),Ke&&nn.show(...Ke,"VencordNotice")}function Gs(e,t,n){on.push(["GENERIC",e,t,n]),Ke||Yo()}var nn,on,Ke,sn=a(()=>{"use strict";A();k(e=>e.show&&e.dismiss&&!e.suppressAll,e=>nn=e);on=[],Ke=null});var an={};D(an,{Commands:()=>Ws,DataStore:()=>Hs,MessageAccessories:()=>Ks,MessageEvents:()=>js,Notices:()=>zs});var js,zs,Ws,Hs,Ks,Xo=a(()=>{"use strict";re();qo();Qo();me();sn();js=tn,zs=rn,Ws=jt,Hs=Ht,Ks=Kt});var cn={};D(cn,{Devs:()=>d,REACT_GLOBAL:()=>qs,WEBPACK_CHUNK:()=>ie});var ie,qs,d,E=a(()=>{"use strict";ie="webpackChunkdiscord_app",qs="Vencord.Webpack.Common.React",d=Object.freeze({Ven:{name:"Vendicated",id:343383572805058560n},Arjix:{name:"ArjixWasTaken",id:674710789138939916n},Cyn:{name:"Cynosphere",id:150745989836308480n},Megu:{name:"Megumin",id:545581357812678656n},botato:{name:"botato",id:440990343899643943n},obscurity:{name:"obscurity",id:336678828233588736n},rushii:{name:"rushii",id:295190422244950017n},Glitch:{name:"Glitchy",id:269567451199569920n},Samu:{name:"Samu",id:702973430449832038n},Animal:{name:"Animal",id:118437263754395652n},MaiKokain:{name:"Mai",id:722647978577363026n},echo:{name:"ECHO",id:712639419785412668n},katlyn:{name:"katlyn",id:250322741406859265n},Nuckyz:{name:"Nuckyz",id:235834946571337729n}})});function c(e){return e}var y=a(()=>{"use strict"});var ln,Jo=a(()=>{"use strict";E();y();ln=c({name:"STFU",description:"Disables the 'HOLD UP' banner in the console",authors:[d.Ven],patches:[{find:"setDevtoolsCallbacks",replacement:{match:/if\(.{0,10}\|\|"0.0.0"!==.{0,2}\.remoteApp\.getVersion\(\)\)/,replace:"if(false)"}}]})});var dn,Zo=a(()=>{"use strict";E();y();K();dn=c({name:"AnonymiseFileNames",authors:[d.obscurity],description:"Anonymise uploaded file names",patches:[{find:"instantBatchUpload:function",replacement:{match:/uploadFiles:(.{1,2}),/,replace:"uploadFiles:(...args)=>(args[0].uploads.forEach(f=>f.filename=Vencord.Plugins.plugins.AnonymiseFileNames.anonymise(f.filename)),$1(...args)),"}}],options:{method:{description:"Anonymising method",type:4,options:[{label:"Random Characters",value:0,default:!0},{label:"Consistent",value:1},{label:"Timestamp (4chan-like)",value:2}]},randomisedLength:{description:"Random characters length",type:1,default:7,disabled:()=>P.plugins.AnonymiseFileNames.method!==0},consistent:{description:"Consistent filename",type:0,default:"image",disabled:()=>P.plugins.AnonymiseFileNames.method!==1}},anonymise(e){let t="image",n=e.match(/\..+$/g)?.[0]??"";switch(P.plugins.AnonymiseFileNames.method){case 0:let o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";t=Array.from({length:P.plugins.AnonymiseFileNames.randomisedLength},()=>o[Math.floor(Math.random()*o.length)]).join("");break;case 1:t=P.plugins.AnonymiseFileNames.consistent;break;case 2:t=`${Math.floor(Date.now()/1e3)}${Math.floor(window.performance.now())}`;break}return t+n}})});var pn,er=a(()=>{"use strict";E();y();pn=c({name:"CommandsAPI",authors:[d.Arjix],description:"Api required by anything that uses commands",patches:[{find:'"giphy","tenor"',replacement:[{match:/(?<=\w=)(\w)(\.filter\(.{0,30}giphy)/,replace:"Vencord.Api.Commands._init($1)$2"}]},{find:"Unexpected value for option",replacement:{match:/,(.{1,2})\.execute\((.{1,2}),(.{1,2})\)]/,replace:(e,t,n,o)=>`,Vencord.Api.Commands._handleCommand(${t}, ${n}, ${o})]`}}]})});var mn,tr=a(()=>{"use strict";E();y();mn=c({name:"MessageAccessoriesAPI",description:"API to add message accessories.",authors:[d.Cyn],patches:[{find:"_messageAttachmentToEmbedMedia",replacement:{match:/\(\)\.container\)},(.+?)\)};return/,replace:(e,t)=>`().container)},Vencord.Api.MessageAccessories._modifyAccessories([${t}],this.props))};return`}}]})});var un,nr=a(()=>{"use strict";E();y();un=c({name:"MessageEventsAPI",description:"Api required by anything using message events.",authors:[d.Arjix],patches:[{find:"sendMessage:function",replacement:[{match:/(?<=_sendMessage:function\([^)]+\)){/,replace:"{Vencord.Api.MessageEvents._handlePreSend(...arguments);"},{match:/(?<=\beditMessage:function\([^)]+\)){/,replace:"{Vencord.Api.MessageEvents._handlePreEdit(...arguments);"}]},{find:"if(e.altKey){",replacement:{match:/var \w=(\w)\.id,\w=(\w)\.id;return .{1,2}\.useCallback\(\(?function\((.{1,2})\){/,replace:(e,t,n,o)=>`var _msg=${t},_chan=${n};${e}Vencord.Api.MessageEvents._handleClick(_msg, _chan, ${o});`}}]})});var fn,or=a(()=>{"use strict";E();y();fn=c({name:"ApiNotices",description:"Fixes notices being automatically dismissed",authors:[d.Ven],required:!0,patches:[{find:"updateNotice:",replacement:[{match:/;(.{1,2}=null;)(?=.{0,50}updateNotice)/g,replace:";if(Vencord.Api.Notices.currentNotice)return !1;$1"},{match:/(?<=NOTICE_DISMISS:function.+?){(?=if\(null==(.+?)\))/,replace:'{if($1?.id=="VencordNotice")return ($1=null,Vencord.Api.Notices.nextNotice(),true);'}]}]})});var gn,rr=a(()=>{"use strict";E();y();gn=c({name:"BANger",description:"Replaces the GIF in the ban dialogue with a custom one.",authors:[{name:"Xinto",id:423915768191647755n},d.Glitch],patches:[{find:"BAN_CONFIRM_TITLE.",replacement:{match:/src:\w\(\d+\)/g,replace:"src: Vencord.Settings.plugins.BANger.source"}}],options:{source:{description:"Source to replace ban GIF with (Video or Gif)",type:0,default:"https://i.imgur.com/wp5q52C.mp4",restartNeeded:!0}}})});var hn,ir=a(()=>{"use strict";E();y();hn=c({name:"BetterGifAltText",authors:[d.Ven],description:"Change GIF alt text from simply being 'GIF' to containing the gif tags / filename",patches:[{find:"onCloseImage=",replacement:{match:/(return .{1,2}\.createElement.{0,50}isWindowFocused)/,replace:"Vencord.Plugins.plugins.BetterGifAltText.altify(e);$1"}},{find:'preload:"none","aria',replacement:{match:/\?.{0,5}\.Messages\.GIF/,replace:"?(e.alt='GIF',Vencord.Plugins.plugins.BetterGifAltText.altify(e))"}}],altify(e){if(e.alt!=="GIF")return e.alt;let t=e.original||e.src;try{t=decodeURI(t)}catch{}let n=t.slice(t.lastIndexOf("/")+1).replace(/\d/g,"").replace(/.gif$/,"").split(/[,\-_ ]+/g).slice(0,20).join(" ");return n.length>300&&(n=n.slice(0,300)+"..."),n&&(e.alt+=` - ${n}`),e.alt}})});var yn,sr=a(()=>{"use strict";E();y();yn=c({name:"BetterUploadButton",authors:[d.obscurity],description:"Upload with a single click, open menu with right click",patches:[{find:"Messages.CHAT_ATTACH_UPLOAD_OR_INVITE",replacement:{match:/CHAT_ATTACH_UPLOAD_OR_INVITE,onDoubleClick:([^,]+),onClick:([^,]+)}}/,replace:"CHAT_ATTACH_UPLOAD_OR_INVITE,onClick:$1,onContextMenu:$2}}"}}]})});var ar,cr=a(()=>{"use strict";ar=["action_object_map","action_type_map","action_ref_map","spm@*.aliexpress.com","scm@*.aliexpress.com","aff_platform","aff_trace_key","algo_expid@*.aliexpress.*","algo_pvid@*.aliexpress.*","btsid","ws_ab_test","pd_rd_*@amazon.*","_encoding@amazon.*","psc@amazon.*","tag@amazon.*","ref_@amazon.*","pf_rd_*@amazon.*","pf@amazon.*","crid@amazon.*","keywords@amazon.*","sprefix@amazon.*","sr@amazon.*","ie@amazon.*","node@amazon.*","qid@amazon.*","callback@bilibili.com","cvid@bing.com","form@bing.com","sk@bing.com","sp@bing.com","sc@bing.com","qs@bing.com","pq@bing.com","sc_cid","mkt_tok","trk","trkCampaign","ga_*","gclid","gclsrc","hmb_campaign","hmb_medium","hmb_source","spReportId","spJobID","spUserID","spMailingID","itm_*","s_cid","elqTrackId","elqTrack","assetType","assetId","recipientId","campaignId","siteId","mc_cid","mc_eid","pk_*","sc_campaign","sc_channel","sc_content","sc_medium","sc_outcome","sc_geo","sc_country","nr_email_referer","vero_conv","vero_id","yclid","_openstat","mbid","cmpid","cid","c_id","campaign_id","Campaign","hash@ebay.*","fb_action_ids","fb_action_types","fb_ref","fb_source","fbclid","refsrc@facebook.com","hrc@facebook.com","gs_l","gs_lcp@google.*","ved@google.*","ei@google.*","sei@google.*","gws_rd@google.*","gs_gbg@google.*","gs_mss@google.*","gs_rn@google.*","_hsenc","_hsmi","__hssc","__hstc","hsCtaTracking","source@sourceforge.net","position@sourceforge.net","t@*.twitter.com","s@*.twitter.com","ref_*@*.twitter.com","tt_medium","tt_content","lr@yandex.*","redircnt@yandex.*","feature@youtube.com","kw@youtube.com","wt_zmc","utm_source","utm_content","utm_medium","utm_campaign","utm_term","si@open.spotify.com"]});var lr,Qs,bn,dr=a(()=>{"use strict";me();y();cr();lr=/[\\^$.*+?()[\]{}|]/g,Qs=RegExp(lr.source),bn=c({name:"clearURLs",description:"Removes tracking garbage from URLs",authors:[{name:"adryd",id:0n}],dependencies:["MessageEventsAPI"],escapeRegExp(e){return e&&Qs.test(e)?e.replace(lr,"\\$&"):e||""},createRules(){let e=ar;this.universalRules=new Set,this.rulesByHost=new Map,this.hostRules=new Map;for(let t of e){let n=t.split("@"),o=new RegExp("^"+this.escapeRegExp(n[0]).replace(/\\\*/,".+?")+"$");if(!n[1]){this.universalRules.add(o);continue}let r=new RegExp("^(www\\.)?"+this.escapeRegExp(n[1]).replace(/\\\./,"\\.").replace(/^\\\*\\\./,"(.+?\\.)?").replace(/\\\*/,".+?")+"$"),i=r.toString();this.hostRules.set(i,r),this.rulesByHost.get(i)==null&&this.rulesByHost.set(i,new Set),this.rulesByHost.get(i).add(o)}},removeParam(e,t,n){(t===e||e instanceof RegExp&&e.test(t))&&n.delete(t)},replacer(e){try{var t=new URL(e)}catch{return e}return t.searchParams.entries().next().done?e:(this.universalRules.forEach(n=>{t.searchParams.forEach((o,r,i)=>{this.removeParam(n,r,i)})}),this.hostRules.forEach((n,o)=>{!n.test(t.hostname)||this.rulesByHost.get(o).forEach(r=>{t.searchParams.forEach((i,l,m)=>{this.removeParam(r,l,m)})})}),t.toString())},onSend(e){e.content.match(/http(s)?:\/\//)&&(e.content=e.content.replace(/(https?:\/\/[^\s<]+[^<.,:;"'>)|\]\s])/g,t=>this.replacer(t)))},start(){this.createRules(),this.preSend=W((e,t)=>this.onSend(t)),this.preEdit=Re((e,t,n)=>this.onSend(n))},stop(){H(this.preSend),ke(this.preEdit)}})});var Sn,pr=a(()=>{"use strict";E();y();v();Sn=c({name:"ClickableRoleDot",authors:[d.Ven],description:"Makes RoleDots (Accessibility Feature) copy colour to clipboard on click",patches:[{find:"M0 4C0 1.79086 1.79086 0 4 0H16C18.2091 0 20 1.79086 20 4V16C20 18.2091 18.2091 20 16 20H4C1.79086 20 0 18.2091 0 16V4Z",replacement:{match:/(viewBox:"0 0 20 20")/,replace:"$1,onClick:()=>Vencord.Plugins.plugins.ClickableRoleDot.copyToClipBoard(e.color)"}}],copyToClipBoard(e){navigator.clipboard.writeText(e).then(()=>this.notifySuccess)},notifySuccess(){B.show({message:"Copied to Clipboard!",type:B.Type.SUCCESS,id:B.genId(),options:{duration:1e3,position:B.Position.BOTTOM}})}})});var xn,En,mr=a(()=>{"use strict";E();y();xn=e=>()=>{throw new Error(`'${e}' is Discord Desktop only.`)},En=c({name:"ConsoleShortcuts",description:"Adds shorter Aliases for many things on the window. Run `shortcutList` for a list.",authors:[d.Ven],getShortcuts(){return{toClip:xn("toClip"),fromClip:xn("fromClip"),wp:Vencord.Webpack,wpc:Vencord.Webpack.wreq.c,wreq:Vencord.Webpack.wreq,wpsearch:Vencord.Webpack.search,wpex:Vencord.Webpack.extract,findByProps:Vencord.Webpack.findByProps,find:Vencord.Webpack.find,Plugins:Vencord.Plugins,React:Vencord.Webpack.Common.React,Settings:Vencord.Settings,Api:Vencord.Api,reload:()=>location.reload(),restart:xn("restart")}},start(){let e=this.getShortcuts();window.shortcutList=e;for(let[t,n]of Object.entries(e))window[t]=n},stop(){delete window.shortcutList;for(let e in this.getShortcuts())delete window[e]}})});var Pn,ur=a(()=>{"use strict";y();Pn=c({name:"discord-screenaudio",authors:[{name:"maltejur",id:205966226709676032n}],required:!0,description:"UI patches for discord-screenaudio.",patches:[]})});var Ie,dt=a(()=>{"use strict";Ie=class{set=new Set;get changeCount(){return this.set.size}get hasChanges(){return this.changeCount>0}handleChange(t){this.set.delete(t)||this.set.add(t)}getChanges(){return this.set.values()}map(t){return[...this.getChanges()].map(t)}}});function Tn(e,t=300){let n;return function(...o){clearTimeout(n),n=setTimeout(()=>{e(...o)},t)}}var fr=a(()=>{"use strict"});var Cn={};D(Cn,{getCurrentChannel:()=>gr,getCurrentGuild:()=>Ys});function gr(){return De.getChannel(G.getChannelId())}function Ys(){return st.getGuild(gr()?.guild_id)}var hr=a(()=>{"use strict";v()});function Xs(e){let t={};for(let n in e)t[n]=e[n],t[e[n]]=n;return Object.freeze(t)}var _,Ue=a(()=>{"use strict";_=Xs({QUICK_CSS_UPDATE:"VencordQuickCssUpdate",GET_QUICK_CSS:"VencordGetQuickCss",SET_QUICK_CSS:"VencordSetQuickCss",GET_SETTINGS_DIR:"VencordGetSettingsDir",GET_SETTINGS:"VencordGetSettings",SET_SETTINGS:"VencordSetSettings",OPEN_EXTERNAL:"VencordOpenExternal",OPEN_QUICKCSS:"VencordOpenQuickCss",GET_UPDATES:"VencordGetUpdates",GET_REPO:"VencordGetRepo",GET_HASHES:"VencordGetHashes",UPDATE:"VencordUpdate",BUILD:"VencordBuild",GET_DESKTOP_CAPTURE_SOURCES:"VencordGetDesktopCaptureSources",OPEN_MONACO_EDITOR:"VencordOpenMonacoEditor"})});var Qe={};D(Qe,{ModalCloseButton:()=>Js,ModalContent:()=>wn,ModalFooter:()=>Rn,ModalHeader:()=>vn,ModalRoot:()=>qe,ModalSize:()=>pt,Modals:()=>Be,closeModal:()=>ea,openModal:()=>In,openModalLazy:()=>Zs});function Zs(e,t){return kn.openModalLazy(e,t)}function In(e,t,n){return kn.openModal(e,t,n)}function ea(e,t){return kn.closeModal(e,t)}var pt,Be,qe,vn,wn,Rn,Js,kn,mt=a(()=>{"use strict";A();it();pt=(r=>(r.SMALL="small",r.MEDIUM="medium",r.LARGE="large",r.DYNAMIC="dynamic",r))(pt||{}),Be=Ne(".onAnimationEnd,",{ModalRoot:h.byCode("headerIdIsManaged:"),ModalHeader:h.byCode("children","separator","wrap","NO_WRAP","grow","shrink","id","header"),ModalContent:h.byCode("scrollerRef","content","className","children"),ModalFooter:h.byCode("HORIZONTAL_REVERSE","START","STRETCH","NO_WRAP","footerSeparator"),ModalCloseButton:h.byCode("closeWithCircleBackground","hideOnFullscreen")}),qe=e=>Vencord.Webpack.Common.React.createElement(Be.ModalRoot,{...e}),vn=e=>Vencord.Webpack.Common.React.createElement(Be.ModalHeader,{...e}),wn=e=>Vencord.Webpack.Common.React.createElement(Be.ModalContent,{...e}),Rn=e=>Vencord.Webpack.Common.React.createElement(Be.ModalFooter,{...e}),Js=e=>Vencord.Webpack.Common.React.createElement(Be.ModalCloseButton,{...e}),kn=Ne("onCloseRequest:null!=",{openModal:h.byCode("onCloseRequest:null!="),closeModal:h.byCode("onCloseCallback&&"),openModalLazy:e=>e?.length===1&&h.byCode(".apply(this,arguments)")(e)})});var Mn={};D(Mn,{ChangeList:()=>Ie,Constants:()=>cn,Discord:()=>Cn,IpcEvents:()=>_,LazyComponent:()=>ys,Logger:()=>U,Modals:()=>Qe,classes:()=>Te,debounce:()=>Tn,humanFriendlyJoin:()=>bs,lazy:()=>hs,lazyWebpack:()=>C,makeCodeblock:()=>Ot,makeLazy:()=>te,mergeDefaults:()=>Pe,proxyLazy:()=>he,sleep:()=>Dt,suppressErrors:()=>Ss,useAwaiter:()=>pe});var ue=a(()=>{"use strict";dt();E();fr();hr();Ue();we();O();mt();ot();});var _n,Fn,yr=a(()=>{"use strict";ue();E();y();K();A();v();_n=C(h.byProps(["key","removeBuildOverride"])),Fn=c({name:"Experiments",authors:[d.Megu,d.Ven,{name:"Nickyux",id:427146305651998721n},{name:"BanTheNons",id:460478012794863637n}],description:"Enable Access to Experiments in Discord!",patches:[{find:"Object.defineProperties(this,{isDeveloper",replacement:{match:/(?<={isDeveloper:\{[^}]+,get:function\(\)\{return )\w/,replace:"true"}},{find:'type:"user",revision',replacement:{match:/(\w)\|\|"CONNECTION_OPEN".+?;/g,replace:"$1=!0;"}},{find:".isStaff=function(){",predicate:()=>P.plugins.Experiments.enableIsStaff===!0,replacement:[{match:/return\s*(\w+)\.hasFlag\((.+?)\.STAFF\)}/,replace:"return Vencord.Webpack.Common.UserStore.getCurrentUser().id===$1.id||$1.hasFlag($2.STAFF)}"},{match:/hasFreePremium=function\(\){return this.isStaff\(\)\s*\|\|/,replace:"hasFreePremium=function(){return "}]}],options:{enableIsStaff:{description:"Enable isStaff (requires restart)",type:3,default:!1,restartNeeded:!0}},settingsAboutComponent:()=>{let e=navigator.platform.includes("Mac"),t=e?"cmd":"ctrl",n=e?"opt":"alt";return Vencord.Webpack.Common.React.createElement(f.Fragment,null,Vencord.Webpack.Common.React.createElement(u.FormTitle,{tag:"h3"},"More Information"),Vencord.Webpack.Common.React.createElement(u.FormText,{variant:"text-md/normal"},"You can enable client DevTools"," ",Vencord.Webpack.Common.React.createElement("kbd",{className:_n.key},t)," +"," ",Vencord.Webpack.Common.React.createElement("kbd",{className:_n.key},n)," +"," ",Vencord.Webpack.Common.React.createElement("kbd",{className:_n.key},"O")," ","after enabling ",Vencord.Webpack.Common.React.createElement("code",null,"isStaff")," below"),Vencord.Webpack.Common.React.createElement(u.FormText,null,"and then toggling ",Vencord.Webpack.Common.React.createElement("code",null,"Enable DevTools")," in the ",Vencord.Webpack.Common.React.createElement("code",null,"Developer Options")," tab in settings."))}})});function br({option:e,pluginSettings:t,id:n,onChange:o,onError:r}){let i=t[n]??e.default,[l,m]=f.useState(i??!1),[g,b]=f.useState(null);f.useEffect(()=>{r(g!==null)},[g]);let S=[{label:"Enabled",value:!0,default:i===!0},{label:"Disabled",value:!1,default:typeof i>"u"||i===!1}];function s(p){let T=(e.isValid&&e.isValid(p))??!0;typeof T=="string"?b(T):T?(b(null),m(p),o(p)):b("Invalid input provided.")}return Vencord.Webpack.Common.React.createElement(u.FormSection,null,Vencord.Webpack.Common.React.createElement(u.FormTitle,null,e.description),Vencord.Webpack.Common.React.createElement(We,{isDisabled:e.disabled?.()??!1,options:S,placeholder:e.placeholder??"Select an option",maxVisibleItems:5,closeOnSelect:!0,select:s,isSelected:p=>p===l,serialize:p=>String(p),...e.componentProps}),g&&Vencord.Webpack.Common.React.createElement(u.FormText,{style:{color:"var(--text-danger)"}},g))}var Sr=a(()=>{"use strict";v()});function xr({option:e,pluginSettings:t,id:n,onChange:o,onError:r}){function i(s){return e.type===2?BigInt(s):Number(s)}let[l,m]=f.useState(`${t[n]??e.default??0}`),[g,b]=f.useState(null);f.useEffect(()=>{r(g!==null)},[g]);function S(s){let p=(e.isValid&&e.isValid(s))??!0;typeof p=="string"?b(p):p?e.type===1&&BigInt(s)>=ta?(m(`${Number.MAX_SAFE_INTEGER}`),o(i(s))):(m(s),o(i(s))):b("Invalid input provided.")}return Vencord.Webpack.Common.React.createElement(u.FormSection,null,Vencord.Webpack.Common.React.createElement(u.FormTitle,null,e.description),Vencord.Webpack.Common.React.createElement(de,{type:"number",pattern:"-?[0-9]+",value:l,onChange:S,placeholder:e.placeholder??"Enter a number",disabled:e.disabled?.()??!1,...e.componentProps}),g&&Vencord.Webpack.Common.React.createElement(u.FormText,{style:{color:"var(--text-danger)"}},g))}var ta,Er=a(()=>{"use strict";y();v();ta=BigInt(Number.MAX_SAFE_INTEGER)});function Pr({option:e,pluginSettings:t,onChange:n,onError:o,id:r}){let i=t[r]??e.options?.find(s=>s.default)?.value,[l,m]=f.useState(i??null),[g,b]=f.useState(null);f.useEffect(()=>{o(g!==null)},[g]);function S(s){let p=(e.isValid&&e.isValid(s))??!0;typeof p=="string"?b(p):p?(m(s),n(s)):b("Invalid input provided.")}return Vencord.Webpack.Common.React.createElement(u.FormSection,null,Vencord.Webpack.Common.React.createElement(u.FormTitle,null,e.description),Vencord.Webpack.Common.React.createElement(We,{isDisabled:e.disabled?.()??!1,options:e.options,placeholder:e.placeholder??"Select an option",maxVisibleItems:5,closeOnSelect:!0,select:S,isSelected:s=>s===l,serialize:s=>String(s),...e.componentProps}),g&&Vencord.Webpack.Common.React.createElement(u.FormText,{style:{color:"var(--text-danger)"}},g))}var Tr=a(()=>{"use strict";v()});function ut(e,t,n=1){let o=[];for(let r=e;r<=t;r+=n)o.push(Math.round(r*100)/100);return o}function Cr({option:e,pluginSettings:t,id:n,onChange:o,onError:r}){let i=t[n]??e.default,[l,m]=f.useState(null);f.useEffect(()=>{r(l!==null)},[l]);function g(b){let S=(e.isValid&&e.isValid(b))??!0;typeof S=="string"?m(S):S?(m(null),o(b)):m("Invalid input provided.")}return Vencord.Webpack.Common.React.createElement(u.FormSection,null,Vencord.Webpack.Common.React.createElement(u.FormTitle,null,e.description),Vencord.Webpack.Common.React.createElement(_t,{disabled:e.disabled?.()??!1,markers:e.markers,minValue:e.markers[0],maxValue:e.markers[e.markers.length-1],initialValue:i,onValueChange:g,onValueRender:b=>String(b.toFixed(2)),stickToMarkers:e.stickToMarkers??!0,...e.componentProps}))}var An=a(()=>{"use strict";v()});function vr({option:e,pluginSettings:t,id:n,onChange:o,onError:r}){let[i,l]=f.useState(t[n]??e.default??null),[m,g]=f.useState(null);f.useEffect(()=>{r(m!==null)},[m]);function b(S){let s=(e.isValid&&e.isValid(S))??!0;typeof s=="string"?g(s):s?(l(S),o(S)):g("Invalid input provided.")}return Vencord.Webpack.Common.React.createElement(u.FormSection,null,Vencord.Webpack.Common.React.createElement(u.FormTitle,null,e.description),Vencord.Webpack.Common.React.createElement(de,{type:"text",value:i,onChange:b,placeholder:e.placeholder??"Enter a value",disabled:e.disabled?.()??!1,...e.componentProps}),m&&Vencord.Webpack.Common.React.createElement(u.FormText,{style:{color:"var(--text-danger)"}},m))}var wr=a(()=>{"use strict";v()});var Nn=a(()=>{"use strict";Sr();Er();Tr();An();wr()});var Dn,Rr=a(()=>{"use strict";re();Nn();E();y();K();Dn=c({name:"Fart2",authors:[d.Animal],description:"Enable farting v2, a slash command that allows you to perform or request that someone perform a little toot.",dependencies:["CommandsAPI"],commands:[{name:"fart",description:"A simple command in which you may either request that a user do a little toot for you, or conduct one yourself.",options:[{type:6,name:"user",description:"A Discord\u2122 user of which you would humbly request a toot from.",required:!1}],execute(e){let t=new Audio("https://raw.githubusercontent.com/ItzOnlyAnimal/AliuPlugins/main/fart.mp3");return t.volume=P.plugins.Fart2.volume,t.play(),{content:e[0]?`<@${e[0].value}> fart`:"fart"}}}],options:{volume:{description:"how loud you wanna fart (aka volume)",type:5,markers:ut(0,1,.1),default:.5,stickToMarkers:!1}}})});var na,On,kr=a(()=>{"use strict";me();E();y();na=/https?:\/\/twitter\.com(?=\/\w+?\/status\/)/g,On=c({name:"FxTwitter",description:"Uses FxTwitter to improve embeds from twitter on send",authors:[d.Samu],dependencies:["MessageEventsAPI"],addPrefix(e){e.content=e.content.replace(na,"https://fxtwitter.com")},start(){this.preSend=W((e,t)=>this.addPrefix(t))},stop(){H(this.preSend)}})});var Ln,Ir=a(()=>{"use strict";E();y();Ln=c({name:"iLoveSpam",description:"Do not hide messages from 'likely spammers'",authors:[d.botato,d.Animal],patches:[{find:"),{hasFlag:",replacement:{match:/(if\((.{1,2})<=1<<30\)return)/,replace:"if($2===(1<<20)){return false};$1"}}]})});var Un,Mr=a(()=>{"use strict";E();y();K();Un=c({name:"Ify",description:"Disables Spotify auto-pausing, allows activity to continue playing when idling and bypasses premium checks, allowing you to listen along with others.",authors:[d.Cyn,d.Nuckyz],patches:[{find:'dispatch({type:"SPOTIFY_PROFILE_UPDATE"',replacement:[{match:/(function\((.{1,2})\){)(.{1,6}dispatch\({type:"SPOTIFY_PROFILE_UPDATE")/,replace:(e,t,n,o)=>`${t}${n}.body.product="premium";${o}`}]},{find:'.displayName="SpotifyStore"',predicate:()=>P.plugins.Ify.noSpotifyAutoPause,replacement:{match:/function (.{1,2})\(\).{0,200}SPOTIFY_AUTO_PAUSED\);.{0,}}}}/,replace:"function $1(){}"}},{find:'.displayName="SpotifyStore"',predicate:()=>P.plugins.Ify.keepSpotifyActivityOnIdle,replacement:{match:/(shouldShowActivity=function\(\){.{1,50})&&!.{1,6}\.isIdle\(\)(.{0,}?})/,replace:(e,t,n)=>`${t}${n}`}}],options:{noSpotifyAutoPause:{description:"Disable Spotify auto-pause",type:3,default:!0,restartNeeded:!0},keepSpotifyActivityOnIdle:{description:"Keep Spotify activity playing when idling",type:3,default:!1,restartNeeded:!0}}})});function Lr(e,t){let n=e.findIndex(o=>o.id===t);return n===-1?n:e.length-n-1}function Ar({channelId:e,messageId:t,_isQuickEdit:n}){if(n)return;let o=F.getCurrentUser().id,r=Bn.getMessages(e)._array.filter(i=>i.author.id===o);gt=Lr(r,t)}function Nr({message:e,_isQuickReply:t}){t||(ft=Lr(Bn.getMessages(e.channel_id)._array,e.id))}function Dr(e){let t=e.key==="ArrowUp";!t&&e.key!=="ArrowDown"||!oa(e)||ra(e)||(e.shiftKey?sa(t):ia(t))}function Ur(e,t){let n=Bn.getMessages(G.getChannelId())._array;if(!t){let i=F.getCurrentUser().id;n=n.filter(l=>l.author.id===i)}let o=i=>e?Math.min(n.length-1,i+1):Math.max(-1,i-1),r;return t?ft=r=o(ft):gt=r=o(gt),r===-1?void 0:n[n.length-r-1]}function ia(e){let t=Ur(e,!0);if(!t)return void I.dispatch({type:"DELETE_PENDING_REPLY",channelId:G.getChannelId()});let n=De.getChannel(t.channel_id),o=F.getCurrentUser().id;I.dispatch({type:"CREATE_PENDING_REPLY",channel:n,message:t,shouldMention:!0,showMentionToggle:n.guild_id!==null&&t.author.id!==o,_isQuickReply:!0})}function sa(e){let t=Ur(e,!1);t?I.dispatch({type:"MESSAGE_START_EDIT",channelId:t.channel_id,messageId:t.id,content:t.content,_isQuickEdit:!0}):I.dispatch({type:"MESSAGE_END_EDIT",channelId:G.getChannelId()})}var Bn,Or,ft,gt,Vn,_r,Fr,oa,ra,Br=a(()=>{"use strict";E();O();y();A();v();Bn=C(h.byProps(["getRawMessages"])),Or=navigator.platform.includes("Mac"),ft=-1,gt=-1,Vn=c({name:"InteractionKeybinds",authors:[d.obscurity,d.Ven],description:"Reply to (ctrl + up/down) and edit (ctrl + shift + up/down) messages via keybinds",start(){I.subscribe("DELETE_PENDING_REPLY",_r),I.subscribe("MESSAGE_END_EDIT",Fr),I.subscribe("MESSAGE_START_EDIT",Ar),I.subscribe("CREATE_PENDING_REPLY",Nr),document.addEventListener("keydown",Dr)},stop(){I.unsubscribe("DELETE_PENDING_REPLY",_r),I.unsubscribe("MESSAGE_END_EDIT",Fr),I.unsubscribe("MESSAGE_START_EDIT",Ar),I.unsubscribe("CREATE_PENDING_REPLY",Nr),document.removeEventListener("keydown",Dr)}}),_r=()=>ft=-1,Fr=()=>gt=-1;oa=e=>Or?e.metaKey:e.ctrlKey,ra=e=>e.altKey||!Or&&e.metaKey});var $n,Vr,$r,Gn,Gr=a(()=>{"use strict";me();E();y();A();v();$n=!1,Vr=e=>e.key==="Backspace"&&($n=!0),$r=e=>e.key==="Backspace"&&($n=!1),Gn=c({name:"MessageQuickActions",description:"Quick Delete, Quick edit",authors:[d.Ven],dependencies:["MessageEventsAPI"],start(){let{deleteMessage:e,startEditMessage:t}=be("deleteMessage","startEditMessage"),{can:n}=be("can","initialize"),{MANAGE_MESSAGES:o}=X(i=>typeof i.MANAGE_MESSAGES=="bigint"),{isEditing:r}=be("isEditing","isEditingAny");document.addEventListener("keydown",Vr),document.addEventListener("keyup",$r),this.onClick=Zt((i,l,m)=>{let g=i.author.id===F.getCurrentUser().id;$n?(g||n(o,l))&&(e(l.id,i.id),m.preventDefault()):g&&m.detail>=2&&!r(l.id,i.id)&&(t(l.id,i.id,i.content),m.preventDefault())})},stop(){en(this.onClick),document.removeEventListener("keydown",Vr),document.removeEventListener("keyup",$r)}})});function aa(e){let t="";for(let n=0;n{"use strict";re();E();y();jn=c({name:"MoreCommands",description:"echo, lenny, mock",authors:[d.Arjix,d.echo,{name:"ICodeInAssembly",id:702973430449832038n}],dependencies:["CommandsAPI"],commands:[{name:"echo",description:"Sends a message as Clyde (locally)",options:[Le],inputType:3,execute:(e,t)=>{let n=j(e,"message","");oe(t.channel.id,{content:n})}},{name:"lenny",description:"Sends a lenny face",options:[Le],execute:e=>({content:j(e,"message","")+" ( \u0361\xB0 \u035C\u0296 \u0361\xB0)"})},{name:"mock",description:"mOcK PeOpLe",options:[ve],execute:e=>({content:aa(j(e,"message",""))})}]})});function la(e,t){let n=0,o=0;for(;(o=e.indexOf(t,o)+1)!==0;)n++;return n}function da(e,t){if(!t.global)throw new Error("pattern must be global");let n=0;for(;t.test(e);)n++;return n}function ma(e){let t=la(e,Wr)+da(e,pa);return Math.min(t,10)}function zr(){if(!P.plugins.Moyai.triggerWhenUnfocused&&!document.hasFocus())return;let e=document.createElement("audio");e.src=ca,e.volume=P.plugins.Moyai.volume,e.play()}var Wr,ca,zn,pa,Hr=a(()=>{"use strict";An();E();O();y();K();v();Wr="\u{1F5FF}",ca="https://raw.githubusercontent.com/MeguminSama/VencordPlugins/main/plugins/moyai/moyai.mp3",zn=c({name:"Moyai",authors:[d.Megu,d.Nuckyz],description:"\u{1F5FF}\u{1F5FF}\u{1F5FF}\u{1F5FF}\u{1F5FF}\u{1F5FF}\u{1F5FF}\u{1F5FF}",async onMessage(e){if(e.optimistic||e.type!=="MESSAGE_CREATE"||e.message.state==="SENDING"||P.plugins.Moyai.ignoreBots&&e.message.author?.bot||!e.message.content||e.channelId!==G.getChannelId())return;let t=ma(e.message.content);for(let n=0;n/gi});var Wn,Kr=a(()=>{"use strict";E();y();Wn=c({name:"MuteNewGuild",description:"Mutes newly joined guilds",authors:[d.Glitch],patches:[{find:",acceptInvite:function",replacement:{match:/(\w=null!==[^;]+)/,replace:"$1;Vencord.Webpack.findByProps('updateGuildNotificationSettings').updateGuildNotificationSettings($1,{'muted':true,'suppress_everyone':true,'suppress_roles':true})"}}]})});var Hn,qr=a(()=>{"use strict";me();E();y();K();A();v();Hn=c({name:"NitroBypass",authors:[d.Arjix],description:"Allows you to stream in nitro quality and send fake emojis.",dependencies:["MessageEventsAPI"],patches:[{find:"canUseAnimatedEmojis:function",predicate:()=>P.plugins.NitroBypass.enableEmojiBypass===!0,replacement:["canUseAnimatedEmojis","canUseEmojisEverywhere"].map(e=>({match:new RegExp(`${e}:function\\(.+?}`),replace:`${e}:function (e) { return true; }`}))},{find:"canUseAnimatedEmojis:function",predicate:()=>P.plugins.NitroBypass.enableStreamQualityBypass===!0,replacement:["canUseHighVideoUploadQuality","canStreamHighQuality","canStreamMidQuality"].map(e=>({match:new RegExp(`${e}:function\\(.+?}`),replace:`${e}:function (e) { return true; }`}))},{find:"STREAM_FPS_OPTION.format",predicate:()=>P.plugins.NitroBypass.enableStreamQualityBypass===!0,replacement:{match:/(userPremiumType|guildPremiumTier):.{0,10}TIER_\d,?/g,replace:""}}],options:{enableEmojiBypass:{description:"Allow sending fake emojis",type:3,default:!0,restartNeeded:!0},enableStreamQualityBypass:{description:"Allow streaming in nitro quality",type:3,default:!0,restartNeeded:!0}},get guildId(){return window.location.href.split("channels/")[1].split("/")[0]},get canUseEmotes(){return Boolean(F.getCurrentUser().premiumType)},start(){if(!P.plugins.NitroBypass.enableEmojiBypass)return;if(this.canUseEmotes){console.info("[NitroBypass] Skipping start because you have nitro");return}let{getCustomEmojiById:e}=be("getCustomEmojiById");function t(n,o){return!n[o]||/\s/.test(n[o])?"":" "}this.preSend=W((n,o)=>{let{guildId:r}=this;for(let i of o.validNonShortcutEmojis){if(!i.require_colons||i.guildId===r&&!i.animated)continue;let l=`<${i.animated?"a":""}:${i.originalName||i.name}:${i.id}>`,m=i.url.replace(/\?size=[0-9]+/,"?size=48");o.content=o.content.replace(l,(g,b,S)=>`${t(S,b-1)}${m}${t(S,b+g.length)}`)}}),this.preEdit=Re((n,o,r)=>{let{guildId:i}=this;for(let[l,m,g]of r.content.matchAll(/(?/ig)){let b=e(g);if(b==null||b.guildId===i&&!b.animated||!b.require_colons)continue;let S=b.url.replace(/\?size=[0-9]+/,"?size=48");r.content=r.content.replace(l,(s,p,T)=>`${t(T,p-1)}${S}${t(T,p+s.length)}`)}})},stop(){H(this.preSend),ke(this.preEdit)}})});var Kn,Qr=a(()=>{"use strict";E();y();Kn=c({name:"NoBlockedMessages",description:"Hides all blocked messages from chat completely.",authors:[d.rushii],patches:[{find:'safety_prompt:"DMSpamExperiment",response:"show_redacted_messages"',replacement:[{match:/collapsedReason;return (?=\w{1,2}.createElement)/,replace:"collapsedReason; return null;"}]}]})});var qn,Yr=a(()=>{"use strict";me();E();y();qn=c({name:"NoCanaryMessageLinks",description:"Removes the canary and ptb prefix from message links",authors:[d.Samu],dependencies:["MessageEventsAPI"],removeBetas(e){e.content=e.content.replace(/(?<=https:\/\/)(canary.|ptb.)(?=discord(?:app)?.com\/channels\/(?:\d{17,20}|@me)\/\d{17,20}\/\d{17,20})/g,"")},start(){this.preSend=W((e,t)=>this.removeBetas(t))},stop(){H(this.preSend)}})});var Qn,Xr=a(()=>{"use strict";E();y();Qn=c({name:"No F1",description:"Disables F1 help bind.",authors:[d.Cyn],patches:[{find:',"f1"],comboKeysBindGlobal:',replacement:{match:',"f1"],comboKeysBindGlobal:',replace:"],comboKeysBindGlobal:"}}]})});var Yn,Jr=a(()=>{"use strict";E();y();Yn=c({name:"No RPC",description:"Disables Discord's RPC server.",authors:[d.Cyn],target:"DESKTOP",patches:[{find:'.ensureModule("discord_rpc")',replacement:{match:/\.ensureModule\("discord_rpc"\)\.then\(\(.+?\)\)}/,replace:'.ensureModule("discord_rpc")}'}}]})});var Xn,Zr=a(()=>{"use strict";y();Xn=c({name:"NoReplyMention",description:"Disables reply pings by default",authors:[{name:"DustyAngel47",id:714583473804935238n}],patches:[{find:"CREATE_PENDING_REPLY:function",replacement:{match:/CREATE_PENDING_REPLY:function\((.{1,2})\){/,replace:"CREATE_PENDING_REPLY:function($1){$1.shouldMention=false;"}}]})});var Jn,ei=a(()=>{"use strict";E();y();Jn=c({name:"NoSystemBadge",description:"Disables the taskbar and system tray unread count badge.",authors:[d.rushii],target:"DESKTOP",patches:[{find:"setSystemTrayApplications:function",replacement:[{match:/setBadge:function.+?},/,replace:"setBadge:function(){},"},{match:/setSystemTrayIcon:function.+?},/,replace:"setSystemTrayIcon:function(){},"}]}]})});var Zn,ti=a(()=>{"use strict";E();y();Zn=c({name:"NoTrack",description:"Disable Discord's tracking and crash reporting",authors:[d.Cyn],required:!0,patches:[{find:"TRACKING_URL:",replacement:{match:/^.+$/,replace:"()=>{}"}},{find:"window.DiscordSentry=",replacement:{match:/window\.DiscordSentry=function.+\}\(\)/,replace:""}}]})});function oi(e){let t=e instanceof File,n=t?URL.createObjectURL(e):e;return new Promise((o,r)=>{let i=new Image;i.onload=()=>{t&&URL.revokeObjectURL(n),o(i)},i.onerror=(l,m,g,b,S)=>r(S||l),i.crossOrigin="Anonymous",i.src=n})}async function xa(e,t,n){for(let o of e)switch(o.name){case"image":let r=Sa.getUploads(t.channel.id,ni)[0];if(r){if(!r.isImage)throw"Upload is not an image";return r.item.file}break;case"url":return o.value;case"user":try{return(await ya(o.value)).getAvatarURL(n?void 0:t.guild?.id,2048).replace(/\?size=\d+$/,"?size=2048")}catch(i){throw console.error(`[petpet] Failed to fetch user +`,i),"Failed to fetch user. Check the console for more info."}}return null}var ni,ua,fa,ht,ga,ha,ya,ba,Sa,eo,ri=a(()=>{"use strict";re();E();O();y();A();ni=0,ua=20,fa=128,ht=10,ga=te(()=>import("https://unpkg.com/gifenc@1.0.3/dist/gifenc.esm.js")),ha=te(()=>Promise.all(Array.from({length:ht},(e,t)=>oi(`https://raw.githubusercontent.com/VenPlugs/petpet/main/frames/pet${t}.gif`)))),ya=C(h.byCode(".USER(")),ba=C(h.byCode("UPLOAD_FILE_LIMIT_ERROR")),Sa=C(h.byProps(["getUploads"]));eo=c({name:"petpet",description:"headpet a cutie",authors:[d.Ven],dependencies:["CommandsAPI"],commands:[{inputType:0,name:"petpet",description:"Create a petpet gif. You can only specify one of the image options",options:[{name:"delay",description:"The delay between each frame. Defaults to 20.",type:4},{name:"resolution",description:"Resolution for the gif. Defaults to 120. If you enter an insane number and it freezes Discord that's your fault.",type:4},{name:"image",description:"Image attachment to use",type:11},{name:"url",description:"URL to fetch image from",type:3},{name:"user",description:"User whose avatar to use as image",type:6},{name:"no-server-pfp",description:"Use the normal avatar instead of the server specific one when using the 'user' option",type:5}],execute:async(e,t)=>{let{GIFEncoder:n,quantize:o,applyPalette:r}=await ga(),i=await ha(),l=j(e,"no-server-pfp",!1);try{var m=await xa(e,t,l);if(!m)throw"No Image specified!"}catch(x){console.log(x);return}let g=await oi(m),b=j(e,"delay",ua),S=j(e,"resolution",fa),s=new n,p=document.createElement("canvas");p.width=p.height=S;let T=p.getContext("2d");for(let x=0;xba([w],t.channel,ni))}}]})});var to,ii=a(()=>{"use strict";E();y();to=c({name:"PlainFolderIcon",description:"Doesn't show the small guild icons in folders",authors:[d.botato],patches:[{find:"().expandedFolderIconWrapper",replacement:[{match:/\(\w\|\|\w\)(&&\(\w=\w\.createElement\(\w+\.animated)/,replace:"true$1"}]}]})});function no(){return Vencord.Webpack.Common.React.createElement(f.Fragment,null,Vencord.Webpack.Common.React.createElement(u.FormTitle,{tag:"h3"},"More Information"),Vencord.Webpack.Common.React.createElement(u.FormText,null,"The two pronoun formats are lowercase and capitalized. Example:",Vencord.Webpack.Common.React.createElement("ul",null,Vencord.Webpack.Common.React.createElement("li",null,"Lowercase: they/them"),Vencord.Webpack.Common.React.createElement("li",null,"Capitalized: They/Them")),'Text like "Ask me my pronouns" or "Any pronouns" will always be capitalized. ',Vencord.Webpack.Common.React.createElement("br",null),Vencord.Webpack.Common.React.createElement("br",null),"You can also configure whether or not to display pronouns for the current user (since you probably already know them)"))}var si=a(()=>{"use strict";v()});var fe,yt=a(()=>{"use strict";fe={hh:"He/Him",hi:"He/It",hs:"He/She",ht:"He/They",ih:"It/Him",ii:"It/Its",is:"It/She",it:"It/They",shh:"She/He",sh:"She/Her",si:"She/It",st:"She/They",th:"They/He",ti:"They/It",ts:"They/She",tt:"They/Them",any:"Any pronouns",other:"Other pronouns",ask:"Ask me my pronouns",avoid:"Avoid pronouns, use my name",unspecified:"Unspecified"}});var Me,Ye=a(()=>{Me="35d2b8d"});function St(e){return new Promise(t=>{e in bt?t(bt[e]):e in Ve?Ve[e].push(t):(Ve[e]=[t],Ea())})}async function Pa(e){let t=new URLSearchParams;t.append("platform","discord"),t.append("ids",e.join(","));try{return await(await fetch("https://pronoundb.org/api/v1/lookup-bulk?"+t.toString(),{method:"GET",headers:{Accept:"application/json","X-PronounDB-Source":`Vencord/${Me} (github.com/Vendicated/Vencord)`}})).json().then(o=>(Object.assign(bt,o),o))}catch(n){console.error("PronounDB fetching failed: ",n);let o=Object.fromEntries(e.map(r=>[r,"unspecified"]));return Object.assign(bt,o),o}}function xt(e){let{pronounsFormat:t}=P.plugins.PronounDB;return t==="CAPITALIZED"?fe[e]:t==="LOWERCASE"&&["any","ask","avoid","other"].includes(e)?fe[e]:fe[e].toLowerCase()}var bt,Ve,Ea,oo=a(()=>{"use strict";Ye();ue();K();ro();yt();bt={},Ve={},Ea=Tn(async()=>{let e=Object.keys(Ve),t=await Pa(e);for(let n of e)Ve[n].forEach(o=>o(t[n])),delete Ve[n]})});function io({message:e}){if(e.author.bot||e.author.system||!P.plugins.PronounDB.showSelf&&e.author.id===F.getCurrentUser().id)return null;let[t,,n]=pe(()=>St(e.author.id),null,o=>console.error("Fetching pronouns failed: ",o));return!n&&t&&t!=="unspecified"&&fe[t]?Vencord.Webpack.Common.React.createElement("span",{className:Te(ai.timestampInline,ai.timestamp)},"\u2022 ",xt(t)):null}var ai,ci=a(()=>{"use strict";O();K();A();v();yt();oo();ai=C(h.byProps(["timestampInline"]))});function so(e,t){if(e.user.bot||e.user.system||!P.plugins.PronounDB.showSelf&&e.user.id===F.getCurrentUser().id)return null;let[n,,o]=pe(()=>St(e.user.id),null,r=>console.error("Fetching pronouns failed: ",r));if(!o&&n&&n!=="unspecified"&&fe[n]){let[,r]=t.props.children;return r.props.children=xt(n),t}else return null}var li=a(()=>{"use strict";ue();K();v();yt();oo()});var ao,ro=a(()=>{"use strict";y();si();ci();li();ao=c({name:"PronounDB",authors:[{name:"Tyman",id:487443883127472129n}],description:"Adds pronouns to user messages using pronoundb",patches:[{find:"showCommunicationDisabledStyles",replacement:{match:/(?<=return\s+\w{1,3}\.createElement\(.+!\w{1,3}&&)(\w{1,3}.createElement\(.+?\{.+?\}\))/,replace:"[$1, Vencord.Plugins.plugins.PronounDB.PronounsChatComponent(e)]"}},{find:".headerTagUsernameNoNickname",replacement:{match:/""!==(.{1,2})&&(r\.createElement\(r\.Fragment.+?\.Messages\.USER_POPOUT_PRONOUNS.+?pronounsText.+?\},\1\)\))/,replace:(e,t,n)=>`Vencord.Plugins.plugins.PronounDB.PronounsProfileWrapper(e, ${n})`}}],options:{pronounsFormat:{type:4,description:"The format for pronouns to appear in chat",options:[{label:"Lowercase",value:"LOWERCASE",default:!0},{label:"Capitalized",value:"CAPITALIZED"}]},showSelf:{type:3,description:"Enable or disable showing pronouns for the current user",default:!0}},settingsAboutComponent:no,PronounsChatComponent:io,PronounsProfileWrapper:so})});function lo(e,t){t={invalidEmojis:[],tts:!1,validNonShortcutEmojis:[],...t};let n=Ta.getPendingReply(e);di.sendMessage(e,t,void 0,di.getSendMessageOptionsForReply(n)).then(()=>{n&&I.dispatch({type:"DELETE_PENDING_REPLY",channelId:e})})}var co,di,Ta,po,pi=a(()=>{"use strict";re();ue();E();y();A();v();co=C(h.byProps(["getPlayerState"])),di=C(h.byProps(["getSendMessageOptionsForReply","sendMessage"])),Ta=C(h.byProps(["getPendingReply"]));po=c({name:"Sendify",description:"Send your current Spotify music to chat",authors:[d.katlyn],dependencies:["CommandsAPI"],commands:[{name:"track",description:"Send your current Spotify track to chat",inputType:0,options:[],execute:(e,t)=>{let n=co.getTrack();if(n===null){oe(t.channel.id,{content:"You're not listening to any music."});return}lo(t.channel.id,{content:`https://open.spotify.com/track/${n.id}`})}},{name:"album",description:"Send your current Spotify album to chat",inputType:0,options:[],execute:(e,t)=>{let n=co.getTrack();if(n===null){oe(t.channel.id,{content:"You're not listening to any music."});return}lo(t.channel.id,{content:`https://open.spotify.com/album/${n.album.id}`})}},{name:"artist",description:"Send your current Spotify artist to chat",inputType:0,options:[],execute:(e,t)=>{let n=co.getTrack();if(n===null){oe(t.channel.id,{content:"You're not listening to any music."});return}lo(t.channel.id,{content:n.artists[0].external_urls.spotify})}}]})});var mo,mi=a(()=>{"use strict";Ye();E();y();mo=c({name:"Settings",description:"Adds Settings UI and debug info",authors:[d.Ven,d.Megu],required:!0,patches:[{find:"().versionHash",replacement:[{match:/\w\.createElement\(.{1,2}.Fragment,.{0,30}\{[^}]+\},"Host ".+?\):null/,replace:e=>{let t=e.indexOf("Host")-1,n=e.slice(0,t);return`${e}, ${n}"Vencord ", "${Me} (Web)"), " ")`}}]},{find:"Messages.ACTIVITY_SETTINGS",replacement:{match:/\{section:(.{1,2})\.ID\.HEADER,\s*label:(.{1,2})\..{1,2}\.Messages\.ACTIVITY_SETTINGS\}/,replace:(e,t)=>{let n="";return`{section:${t}.ID.HEADER,label:"Vencord"},{section:"VencordSetting",label:"Vencord",element:Vencord.Components.Settings},{section:"VencordPlugins",label:"Plugins",element:Vencord.Components.PluginSettings},`+n+`{section:${t}.ID.DIVIDER},${e}`}}}]})});var uo,ui=a(()=>{"use strict";E();y();uo=c({name:"SilentTyping",authors:[d.Ven],description:"Hide that you are typing",patches:[{find:"startTyping:",replacement:{match:/startTyping:.+?,stop/,replace:"startTyping:()=>{},stop"}}]})});var fo,fi=a(()=>{"use strict";me();E();y();fo=c({name:"Unindent",description:"Trims leading indentation from codeblocks",authors:[d.Ven],dependencies:["MessageEventsAPI"],patches:[{find:"inQuote:",replacement:{match:/,content:([^,]+),inQuote/,replace:(e,t)=>`,content:Vencord.Plugins.plugins.Unindent.unindent(${t}),inQuote`}}],unindent(e){e=e.replace(/\t/g," ");let t=e.match(/^ *(?=\S)/gm)?.reduce((n,o)=>Math.min(n,o.length),1/0)??0;return t?e.replace(new RegExp(`^ {${t}}`,"gm"),""):e},unindentMsg(e){e.content=e.content.replace(/```(.|\n)*?```/g,t=>{let n=t.split(` +`);if(n.length<2)return t;let o="";return n[n.length-1]==="```"&&(o=n.pop()),`${n[0]} ${this.unindent(n.slice(1).join(` `))} -${r}`})},start(){this.preSend=O((e,t)=>this.unindentMsg(t)),this.preEdit=ee((e,t,n)=>this.unindentMsg(n))},stop(){$(this.preSend),te(this.preEdit)}})});var pn,Ri,mn,ro=l(()=>{"use strict";m();u();Ri="https://raw.githubusercontent.com/facebook/react/17.0.2/scripts/error-codes/codes.json",mn=s({name:"ReactErrorDecoder",description:'Replaces "Minifed React Error" with the actual error.',authors:[a.Cyn],patches:[{find:'"https://reactjs.org/docs/error-decoder.html?invariant="',replacement:{match:/(function .\(.\)){(for\(var .="https:\/\/reactjs\.org\/docs\/error-decoder\.html\?invariant="\+.,.=1;.`${t}{var decoded=Vencord.Plugins.plugins.ReactErrorDecoder.decodeError.apply(null, arguments);if(decoded)return decoded;${n}}`}}],async start(){pn=await fetch(Ri).then(e=>e.json()).catch(e=>console.error(`[ReactErrorDecoder] Failed to fetch React error codes -`,e))},stop(){pn=void 0},decodeError(e,...t){let n=0;return pn?.[e]?.replace(/%s/g,()=>{let r=t[n];return n++,r})}})});function Ii(e){return e.split(" ").map(t=>{let n=!1,r=t.toLowerCase();if(t.length<4)return t;for(let[o,i]of Mi)t.includes(o)&&(t=t.replace(o,i),n=!0);return r.includes("u")&&!r.includes("uwu")&&(t=t.replace("u","UwU"),n=!0),r.includes("o")&&!r.includes("owo")&&(t=t.replace("o","OwO"),n=!0),r.endsWith("y")&&t.length<7&&(t=t+" w"+t.slice(1),n=!0),n||(r.endsWith("n")||(t=t.replace("n","ny")),Math.floor(Math.random()*2)===1&&t.replace("s","sh"),Math.floor(Math.random()*5)===3&&!n&&(t=t[0]+"-"+t[0]+"-"+t),Math.floor(Math.random()*5)===3&&(t=t+" "+oo[Math.floor(Math.random()*oo.length)]),t=t.replaceAll("r","w").replaceAll("l","w")),t}).join(" ")}var oo,Mi,un,io=l(()=>{"use strict";m();ae();oo=["owo","UwU",">w<","^w^","\u25CFw\u25CF","\u2606w\u2606","\u{1D5E8}\u{1D604}\u{1D5E8}","(\u15D2\u15E8\u15D5)","(\u25B0\u02D8v\u02D8\u25B0)","( \xB4 \u25BD ` ).\uFF61\uFF4F\u2661","*unbuttons shirt*",">3<",">:3",":3","murr~","\u2665(\u3002U \u03C9 U\u3002)","(\u02D8\u03B5\u02D8)","*screams*","*twerks*","*sweats*"],Mi=[["love","wuv"],["mr","mistuh"],["dog","doggo"],["cat","kitteh"],["hello","henwo"],["hell","heck"],["fuck","fwick"],["fuk","fwick"],["shit","shoot"],["friend","fwend"],["stop","stawp"],["god","gosh"],["dick","peepee"],["penis","bulge"],["damn","darn"]];un=s({name:"UwUifier",description:"Simply uwuify commands",authors:[{name:"ECHO",id:712639419785412668n}],dependencies:["CommandsAPI"],commands:[{name:"uwuify",description:"uwuifies your messages",options:[Pe],execute:e=>({content:Ii(G(e,"message",""))})}]})});var hn={};k(hn,{ModalSize:()=>fn,closeModal:()=>Di,openModal:()=>gn});function gn(e,t){let n=`Vencord${Ai++}`;return so.openModal(r=>Vencord.Webpack.Common.React.createElement(ki,{...r,...t},Vencord.Webpack.Common.React.createElement(e,null)),{modalKey:n}),n}function Di(e){so.closeModal(e)}var ki,so,Ai,fn,yn=l(()=>{"use strict";F();N();Oe();ki=R(y.byCode("headerIdIsManaged:")),so=bt("onCloseRequest:null!=",{openModal:y.byCode("onCloseRequest:null!="),closeModal:y.byCode("onCloseCallback&&")}),Ai=1337,fn=(o=>(o.SMALL="small",o.MEDIUM="medium",o.LARGE="large",o.DYNAMIC="dynamic",o))(fn||{})});var Ni,Fi,Ke,En,ao=l(()=>{"use strict";u();m();N();yn();F();v();Ni=R(e=>e.prototype?.render?.toString().includes("OPEN_ORIGINAL_IMAGE")),Fi=H(()=>B(e=>e.type?.toString().includes("MASKED_LINK)"))),Ke="Vencord.Plugins.plugins.ViewIcons.openImage(",En=s({name:"ViewIcons",authors:[a.Ven],description:"Makes Avatars/Banners in user profiles clickable, and adds Guild Context Menu Entries to View Banner/Icon.",openImage(e){gn(()=>Vencord.Webpack.Common.React.createElement(Ni,{shouldAnimate:!0,original:e,src:e,renderLinkComponent:t=>x.createElement(Fi(),t)}),{size:"dynamic"})},patches:[{find:"onAddFriend:",replacement:{match:/\{src:(.{1,2}),avatarDecoration/,replace:(e,t)=>`{src:${t},onClick:()=>${Ke}${t}.replace(/\\?.+$/, "")+"?size=2048"),avatarDecoration`}},{find:"().popoutNoBannerPremium",replacement:{match:/style:.{0,10}\{\},(.{1,2})\)/,replace:(e,t)=>`onClick:${t}.backgroundImage&&(()=>${Ke}${t}.backgroundImage.replace("url(", "").replace(/(\\?size=.+)?\\)/, "?size=2048"))),${e}`}},{find:'"GuildContextMenu:',replacement:[{match:/\w=(\w)\.id/,replace:(e,t)=>`_guild=${t},${e}`},{match:/(?<=createElement\((.{1,5}),\{id:"leave-guild".{0,100}\,)(.{1,2}\.createElement)\((.{1,5}),null,(.{1,2})\)(?=\)\}function)/,replace:(e,t,n,r,o)=>`${n}(${r},null,[_guild.icon&&${n}(${t},{id:"viewicons-copy-icon",label:"View Icon",action:()=>${Ke}_guild.getIconURL(void 0,true)+"size=2048")}),_guild.banner&&${n}(${t},{id:"viewicons-copy-banner",label:"View Banner",action:()=>${Ke}Vencord.Webpack.findByProps("getGuildBannerURL").getGuildBannerURL(_guild).replace(/\\?size=.+/, "?size=2048"))}),${o}])`}]}]})});var bn,co=l(()=>{"use strict";m();u();bn=s({name:"Webhook Tags",description:"Changes the bot tag to say webhook for webhooks",authors:[a.Cyn],patches:[{find:'.BOT=0]="BOT"',replacement:[{match:/(.)\[.\.BOT=0\]="BOT";/,replace:(e,t)=>`${t}[${t}.WEBHOOK=99]="WEBHOOK";${e}`},{match:/case (.)\.BOT:default:(.)=/,replace:(e,t,n)=>`case ${t}.WEBHOOK:${n}="WEBHOOK";break;${e}`}]},{find:".Types.ORIGINAL_POSTER",replacement:{match:/return null==(.)\?null:.\.createElement\((.)\.Z/,replace:(e,t,n)=>`if(arguments[0].message.webhookId&&arguments[0].user.isNonUserBot()){${t}=${n}.Z.Types.WEBHOOK}${e}`}}]})});var L,qe=l(()=>{Qn();Yn();Jn();Xn();Zn();er();tr();ir();dr();pr();mr();ur();br();xr();_r();Sr();kr();Ar();Fr();Lr();$r();Vr();Br();Gr();jr();Wr();zr();Hr();Kr();qr();Jr();Xr();Zr();eo();to();no();ro();io();ao();co();L={[et.name]:et,[tt.name]:tt,[nt.name]:nt,[rt.name]:rt,[ot.name]:ot,[it.name]:it,[st.name]:st,[ft.name]:ft,[wt.name]:wt,[Tt.name]:Tt,[vt.name]:vt,[Rt.name]:Rt,[Ut.name]:Ut,[Ot.name]:Ot,[$t.name]:$t,[Vt.name]:Vt,[Gt.name]:Gt,[jt.name]:jt,[zt.name]:zt,[Ht.name]:Ht,[Kt.name]:Kt,[Qt.name]:Qt,[Yt.name]:Yt,[Jt.name]:Jt,[Xt.name]:Xt,[Zt.name]:Zt,[en.name]:en,[tn.name]:tn,[nn.name]:nn,[rn.name]:rn,[on.name]:on,[sn.name]:sn,[an.name]:an,[cn.name]:cn,[ln.name]:ln,[dn.name]:dn,[mn.name]:mn,[un.name]:un,[En.name]:En,[bn.name]:bn}});function Li(e){let t={};for(let n in e)t[n]=e[n],t[e[n]]=n;return Object.freeze(t)}var P,ye=l(()=>{"use strict";P=Li({QUICK_CSS_UPDATE:"VencordQuickCssUpdate",GET_QUICK_CSS:"VencordGetQuickCss",GET_SETTINGS_DIR:"VencordGetSettingsDir",GET_SETTINGS:"VencordGetSettings",SET_SETTINGS:"VencordSetSettings",OPEN_EXTERNAL:"VencordOpenExternal",OPEN_QUICKCSS:"VencordOpenQuickCss",GET_UPDATES:"VencordGetUpdates",GET_REPO:"VencordGetRepo",GET_HASHES:"VencordGetHashes",UPDATE:"VencordUpdate",BUILD:"VencordBuild",GET_DESKTOP_CAPTURE_SOURCES:"VencordGetDesktopCaptureSources"})});function lo(e,t=e,n=""){return new Proxy(e,{get(r,o){let i=r[o];return typeof i=="object"&&!Array.isArray(i)&&i!==null?lo(i,t,`${n}${n&&"."}${o}`):i},set(r,o,i){if(r[o]===i)return!0;r[o]=i;let d=`${n}${n&&"."}${o}`;for(let c of Qe)(!c._path||c._path===d)&&c(i,d);return VencordNative.ipc.invoke(P.SET_SETTINGS,JSON.stringify(t,null,4)),!0}})}function mo(){let[,e]=x.useReducer(()=>({}),{});return x.useEffect(()=>(Qe.add(e),()=>void Qe.delete(e)),[]),q}function uo(e,t){t._path=e,Qe.add(t)}var Te,ce,Qe,po,q,ve=l(()=>{"use strict";qe();ye();v();N();Te={notifyAboutUpdates:!0,useQuickCss:!0,enableReactDevtools:!1,plugins:{}};for(let e in L)Te.plugins[e]={enabled:L[e].required??!1};try{ce=JSON.parse(VencordNative.ipc.sendSync(P.GET_SETTINGS));for(let e in Te)ce[e]??=Te[e];oe(ce,Te)}catch(e){console.error("Corrupt settings file. ",e),ce=oe({},Te)}Qe=new Set;po=ce,q=lo(ce)});var Sn={};k(Sn,{patches:()=>fo,plugins:()=>Ui,startAllPlugins:()=>xn,startPlugin:()=>Re,stopPlugin:()=>_n});function xn(){for(let e in L)q.plugins[e].enabled&&Re(L[e])}function Re(e){if(e.start){if(j.info("Starting plugin",e.name),e.started)return j.warn(`${e.name} already started`),!1;try{e.start(),e.started=!0}catch(t){return j.error(`Failed to start ${e.name} -`,t),!1}}if(e.commands?.length){j.info("Registering commands of plugin",e.name);for(let t of e.commands)try{Nt(t,e.name)}catch(n){return j.error(`Failed to register command ${t.name} -`,n),!1}}return!0}function _n(e){if(e.stop){if(j.info("Stopping plugin",e.name),!e.started)return j.warn(`${e.name} already stopped`),!1;try{e.stop(),e.started=!1}catch(t){return j.error(`Failed to stop ${e.name} -`,t),!1}}if(e.commands?.length){j.info("Unregistering commands of plugin",e.name);for(let t of e.commands)try{Ft(t.name)}catch(n){return j.error(`Failed to unregister command ${t.name} -`,n),!1}}return!0}var j,Ui,fo,Me=l(()=>{"use strict";qe();ae();ve();Z();j=new A("PluginManager","#a6d189"),Ui=L,fo=[];for(let e of Object.values(L))if(e.patches&&q.plugins[e.name].enabled)for(let t of e.patches)t.plugin=e.name,Array.isArray(t.replacement)||(t.replacement=[t.replacement]),fo.push(t)});var An={};k(An,{UpdateLogger:()=>be,changes:()=>X,checkForUpdates:()=>Ae,getRepo:()=>In,isNewer:()=>Ye,isOutdated:()=>ke,rebuild:()=>kn,update:()=>Mn,updateError:()=>xe});async function Ee(e){let t=await e;if(t.ok)return t.value;throw xe=t.error,t.error}async function Ae(){return X=await Ee(VencordNative.ipc.invoke(P.GET_UPDATES)),X.some(e=>e.hash===he)?(Ye=!0,ke=!1):ke=X.length>0}async function Mn(){if(!ke)return!0;let e=await Ee(VencordNative.ipc.invoke(P.UPDATE));return e&&(ke=!1),e}function In(){return Ee(VencordNative.ipc.invoke(P.GET_REPO))}async function kn(){let e=await Ee(VencordNative.ipc.invoke(P.GET_HASHES));if(!await Ee(VencordNative.ipc.invoke(P.BUILD)))throw new Error("The Build failed. Please try manually building the new update");let t=await Ee(VencordNative.ipc.invoke(P.GET_HASHES));return e["patcher.js"]!==t["patcher.js"]||e["preload.js"]!==t["preload.js"]}var be,ke,Ye,xe,X,Je=l(()=>{"use strict";ye();Z();He();be=new A("Updater","white"),ke=!1,Ye=!1});var De,Fn=l(()=>{"use strict";De=class{set=new Set;get changeCount(){return this.set.size}get hasChanges(){return this.changeCount>0}handleChange(t){this.set.delete(t)||this.set.add(t)}getChanges(){return this.set.values()}map(t){return[...this.getChanges()].map(t)}}});function Ne(e){return Vencord.Webpack.Common.React.createElement(me,{className:e.className,style:{padding:"2em",backgroundColor:"#e7828430",borderColor:"#e78284",color:"var(--text-normal)",...e.style}},e.children)}var On=l(()=>{"use strict";v()});var Bi,Eo,bo,Q,$n=l(()=>{"use strict";Z();v();On();Bi="#e78284",Eo=new A("React ErrorBoundary",Bi),bo={},Q=class extends x.Component{static wrap(t){return n=>Vencord.Webpack.Common.React.createElement(Q,null,Vencord.Webpack.Common.React.createElement(t,{...n}))}state={error:bo,stack:"",message:""};static getDerivedStateFromError(t){let n=t?.stack??"",r=t?.message||String(t);if(t instanceof Error&&n){let o=n.indexOf(` -`);o!==-1&&(r=n.slice(0,o),n=n.slice(o+1).replace(/https:\/\/\S+\/assets\//g,""))}return{error:t,stack:n,message:r}}componentDidCatch(t,n){this.props.onError?.(t,n),Eo.error(`A component threw an Error -`,t),Eo.error("Component Stack",n.componentStack)}render(){return this.state.error===bo?this.props.children:this.props.fallback?Vencord.Webpack.Common.React.createElement(this.props.fallback,{children:this.props.children,...this.state}):Vencord.Webpack.Common.React.createElement(Ne,{style:{overflow:"hidden"}},Vencord.Webpack.Common.React.createElement("h1",null,"Oh no!"),Vencord.Webpack.Common.React.createElement("p",null,"An error occurred while rendering this Component. More info can be found below and in your console."),Vencord.Webpack.Common.React.createElement("code",null,this.state.message,!!this.state.stack&&Vencord.Webpack.Common.React.createElement("pre",{className:U.marginTop8},this.state.stack)))}}});function Xe(e){return e.style??={},e.style.flexDirection||=e.flexDirection,e.style.gap??="1em",e.style.display="flex",Vencord.Webpack.Common.React.createElement("div",{...e},e.children)}var Vn=l(()=>{"use strict"});function Bn(e){w.show({message:e,type:w.Type.FAILURE,id:w.genId(),options:{position:w.Position.BOTTOM}})}var xo,_o=l(()=>{"use strict";N();qe();ve();ye();v();$n();Me();Me();Vn();Fn();xo=Q.wrap(function(){let[t,,n]=_e(()=>VencordNative.ipc.invoke(P.GET_SETTINGS_DIR),"Loading..."),r=mo(),o=x.useMemo(()=>new De,[]);x.useEffect(()=>()=>void(o.hasChanges&&se.show({title:"Restart required",body:Vencord.Webpack.Common.React.createElement(Vencord.Webpack.Common.React.Fragment,null,Vencord.Webpack.Common.React.createElement("p",null,"The following plugins require a restart:"),Vencord.Webpack.Common.React.createElement("div",null,o.map((c,f)=>Vencord.Webpack.Common.React.createElement(Vencord.Webpack.Common.React.Fragment,null,f>0&&", ",ue.parse("`"+c+"`"))))),confirmText:"Restart now",cancelText:"Later!",onConfirm:()=>location.reload()})),[]);let i=x.useMemo(()=>{let c={};for(let f in L){let E=L[f].dependencies;if(E)for(let h of E)c[h]??=[],c[h].push(f)}return c},[]),d=x.useMemo(()=>Object.values(L).sort((c,f)=>c.name.localeCompare(f.name)),[]);return Vencord.Webpack.Common.React.createElement(_.FormSection,{tag:"h1",title:"Vencord"},Vencord.Webpack.Common.React.createElement(_.FormTitle,{tag:"h5"},"Settings"),Vencord.Webpack.Common.React.createElement(_.FormText,null,"SettingsDir: ",Vencord.Webpack.Common.React.createElement("code",{style:{userSelect:"text",cursor:"text"}},t)),!IS_WEB&&Vencord.Webpack.Common.React.createElement(Xe,{className:de(U.marginBottom20)},Vencord.Webpack.Common.React.createElement(D,{onClick:()=>window.DiscordNative.app.relaunch(),size:D.Sizes.SMALL,color:D.Colors.GREEN},"Reload"),Vencord.Webpack.Common.React.createElement(D,{onClick:()=>window.DiscordNative.fileManager.showItemInFolder(t),size:D.Sizes.SMALL,disabled:n},"Launch Directory"),Vencord.Webpack.Common.React.createElement(D,{onClick:()=>VencordNative.ipc.invoke(P.OPEN_QUICKCSS),size:D.Sizes.SMALL,disabled:t==="Loading..."},"Open QuickCSS File")),Vencord.Webpack.Common.React.createElement(_.FormDivider,null),Vencord.Webpack.Common.React.createElement(_.FormTitle,{tag:"h5"},"Settings"),Vencord.Webpack.Common.React.createElement(ie,{value:r.useQuickCss,onChange:c=>r.useQuickCss=c,note:"Loads styles from your QuickCss file"},"Use QuickCss"),!IS_WEB&&Vencord.Webpack.Common.React.createElement(ie,{value:r.enableReactDevtools,onChange:c=>r.enableReactDevtools=c,note:"Requires a full restart"},"Enable React Developer Tools"),!IS_WEB&&Vencord.Webpack.Common.React.createElement(ie,{value:r.notifyAboutUpdates,onChange:c=>r.notifyAboutUpdates=c,note:"Shows a Toast on StartUp"},"Get notified about new Updates"),Vencord.Webpack.Common.React.createElement(_.FormDivider,null),Vencord.Webpack.Common.React.createElement(_.FormTitle,{tag:"h5",className:de(U.marginTop20,U.marginBottom8)},"Plugins"),d.map(c=>{let f=i[c.name]?.filter(h=>r.plugins[h].enabled),E=f?.length;return Vencord.Webpack.Common.React.createElement(ie,{disabled:c.required||E,key:c.name,value:r.plugins[c.name].enabled||c.required||E,onChange:h=>{r.plugins[c.name].enabled=h;let p=Boolean(c.patches?.length);h?(c.dependencies?.forEach(g=>{let S=L[g];p||=Boolean(S.patches?.length&&!r.plugins[g].enabled),r.plugins[g].enabled=!0,!p&&!S.started&&!Re(S)&&Bn(`Failed to start dependency ${g}. Check the console for more info.`)}),!p&&!c.started&&!Re(c)&&Bn(`Failed to start plugin ${c.name}. Check the console for more info.`)):(c.started||!c.start&&c.commands?.length)&&!_n(c)&&Bn(`Failed to stop plugin ${c.name}. Check the console for more info.`),p&&o.handleChange(c.name)},note:c.description,tooltipNote:c.required?"This plugin is required. Thus you cannot disable it.":E?`${_t(f)} ${f.length===1?"depends":"depend"} on this plugin. Thus you cannot disable it.`:null},c.name)}))})});function Gn(e){return e.disabled&&(e.style??={},e.style.pointerEvents="none"),Vencord.Webpack.Common.React.createElement("a",{href:e.href,target:"_blank",style:e.style},e.children)}var So=l(()=>{"use strict"});function Co(e,t){return async()=>{e(!0);try{await t()}catch(r){if(be.error("Failed to update",r),r)if(r.code&&r.cmd){let{code:o,path:i,cmd:d,stderr:c}=r;if(o==="ENOENT")var n=`Command \`${i}\` not found. -Please install it and try again`;else{var n=`An error occured while running \`${d}\`: -`;n+=c||`Code \`${o}\`. See the console for more info`}}else var n="An unknown error occurred. See the console for more info.";else var n=`An unknown error occurred (error is undefined). -Please try again.`;se.show({title:"Oops!",body:Vencord.Webpack.Common.React.createElement(Ne,null,n.split(` -`).map(o=>Vencord.Webpack.Common.React.createElement("div",null,ue.parse(o))))})}finally{e(!1)}}}function wo({updates:e,repo:t,repoPending:n}){return Vencord.Webpack.Common.React.createElement(me,{style:{padding:".5em"}},e.map(({hash:r,author:o,message:i})=>Vencord.Webpack.Common.React.createElement("div",null,Vencord.Webpack.Common.React.createElement(Gn,{href:`${t}/commit/${r}`,disabled:n},Vencord.Webpack.Common.React.createElement("code",null,r)),Vencord.Webpack.Common.React.createElement("span",{style:{marginLeft:"0.5em",color:"var(--text-normal)"}},i," - ",o))))}function Gi(e){let[t,n]=x.useState(X),[r,o]=x.useState(!1),[i,d]=x.useState(!1),c=t.length>0;return Vencord.Webpack.Common.React.createElement(Vencord.Webpack.Common.React.Fragment,null,!t&&xe?Vencord.Webpack.Common.React.createElement(Vencord.Webpack.Common.React.Fragment,null,Vencord.Webpack.Common.React.createElement(_.FormText,null,"Failed to check updates. Check the console for more info"),Vencord.Webpack.Common.React.createElement(Ne,{style:{padding:"1em"}},Vencord.Webpack.Common.React.createElement("p",null,xe.stderr||xe.stdout||"An unknown error occurred"))):Vencord.Webpack.Common.React.createElement(_.FormText,{className:U.marginBottom8},c?`There are ${t.length} Updates`:"Up to Date!"),c&&Vencord.Webpack.Common.React.createElement(wo,{updates:t,...e}),Vencord.Webpack.Common.React.createElement(Xe,{className:de(U.marginBottom8,U.marginTop8)},c&&Vencord.Webpack.Common.React.createElement(D,{size:D.Sizes.SMALL,disabled:i||r,onClick:Co(d,async()=>{if(await Mn()){n([]);let f=await kn();await new Promise(E=>{se.show({title:"Update Success!",body:"Successfully updated. Restart now to apply the changes?",confirmText:"Restart",cancelText:"Not now!",onConfirm(){f?window.DiscordNative.app.relaunch():location.reload(),E()},onCancel:E})})}})},"Update Now"),Vencord.Webpack.Common.React.createElement(D,{size:D.Sizes.SMALL,disabled:i||r,onClick:Co(o,async()=>{await Ae()?n(X):(n([]),w.show({message:"No updates found!",id:w.genId(),type:w.Type.MESSAGE,options:{position:w.Position.BOTTOM}}))})},"Check for Updates")))}function ji(e){return Vencord.Webpack.Common.React.createElement(Vencord.Webpack.Common.React.Fragment,null,Vencord.Webpack.Common.React.createElement(_.FormText,{className:U.marginBottom8},"Your local copy has more recent commits. Please stash or reset them."),Vencord.Webpack.Common.React.createElement(wo,{...e,updates:X}))}var Po,To=l(()=>{"use strict";He();Je();v();Vn();N();So();$n();On();Po=Q.wrap(function(){let[t,n,r]=_e(In,"Loading...");x.useEffect(()=>{n&&be.error("Failed to retrieve repo",n)},[n]);let o={repo:t,repoPending:r};return Vencord.Webpack.Common.React.createElement(_.FormSection,{tag:"h1",title:"Vencord Updater"},Vencord.Webpack.Common.React.createElement(_.FormTitle,{tag:"h5"},"Repo"),Vencord.Webpack.Common.React.createElement(_.FormText,null,r?t:n?"Failed to retrieve - check console":Vencord.Webpack.Common.React.createElement(Gn,{href:t},t.split("/").slice(-2).join("/"))," (",he,")"),Vencord.Webpack.Common.React.createElement(_.FormDivider,null),Vencord.Webpack.Common.React.createElement(_.FormTitle,{tag:"h5"},"Updates"),Ye?Vencord.Webpack.Common.React.createElement(ji,{...o}):Vencord.Webpack.Common.React.createElement(Gi,{...o}))})});var vo={};k(vo,{Settings:()=>xo,Updater:()=>Po});var Ro=l(()=>{"use strict";_o();To()});var zi={};k(zi,{Api:()=>Rn,Components:()=>Mo,PlainSettings:()=>po,Plugins:()=>Sn,QuickCss:()=>Nn,Settings:()=>q,Updater:()=>An,Util:()=>Un,Webpack:()=>gt});var Le,Bo=new Promise(e=>{setTimeout(()=>{new QWebChannel(qt.webChannelTransport,function(t){Le=t.objects.webclass,e()})})});async function qn(){Le||await Bo}window.VencordNative={getVersions:()=>({}),ipc:{send:async(e,...t)=>{await qn(),Le.vencordSend(e,t)},sendSync:(e,...t)=>{if(e==="VencordGetSettings")return console.log("stub: IPC VencordGetSettings"),"{}";throw new Error("Synchroneous IPC not implemented")},on(e,t){},off(e,t){},invoke:async(e,...t)=>(await qn(),Le.vencordSend(e,t))}};Me();F();var Rn={};k(Rn,{Commands:()=>Lt,MessageEvents:()=>ut,Notices:()=>vn});Y();var vn={};k(vn,{currentNotice:()=>Ie,nextNotice:()=>go,noticesQueue:()=>wn,popNotice:()=>Pn,showNotice:()=>Tn});F();var Cn;b(e=>e.show&&e.dismiss&&!e.suppressAll,e=>Cn=e);var wn=[],Ie=null;function Pn(){Cn.dismiss()}function go(){Ie=wn.shift(),Ie&&Cn.show(...Ie,"VencordNotice")}function Tn(e,t,n){wn.push(["GENERIC",e,t,n]),Ie||go()}ae();Je();var Nn={};k(Nn,{toggle:()=>Dn});ve();ye();var le;async function Dn(e){le?le.disabled=!e:e&&(le=document.createElement("style"),le.id="vencord-custom-css",document.head.appendChild(le),VencordNative.ipc.on(P.QUICK_CSS_UPDATE,(t,n)=>le.innerText=n),le.innerText=await VencordNative.ipc.invoke(P.GET_QUICK_CSS))}document.addEventListener("DOMContentLoaded",()=>{Dn(q.useQuickCss),uo("useQuickCss",Dn)});var Un={};k(Un,{ChangeList:()=>De,Constants:()=>Ze,Discord:()=>Ln,IpcEvents:()=>P,LazyComponent:()=>ei,Logger:()=>A,Modals:()=>hn,classes:()=>de,debounce:()=>Oi,humanFriendlyJoin:()=>_t,lazy:()=>Zo,lazyWebpack:()=>R,makeCodeblock:()=>Ct,makeLazy:()=>H,mergeDefaults:()=>oe,proxyLazy:()=>Se,sleep:()=>St,suppressErrors:()=>ti,useAwaiter:()=>_e});Fn();function Oi(e,t=300){let n;return function(...r){clearTimeout(n),n=setTimeout(()=>{e(...r)},t)}}N();$e();ye();Z();u();var Ln={};k(Ln,{getCurrentChannel:()=>ho,getCurrentGuild:()=>$i});v();function ho(){return pe.getChannel(V.getChannelId())}function $i(){return Ve.getGuild(ho()?.guild_id)}yn();ve();Me();u();Z();F();var yo,W=new A("WebpackInterceptor","#8caaee");Object.defineProperty(window,z,{get:()=>yo,set:e=>{e?.push!==Array.prototype.push&&(W.info(`Patching ${z}.push`),Et(e),Vi(),delete window[z],window[z]=e),yo=e},configurable:!0});function Vi(){function e(t){try{let n=t[1],{subscriptions:r,listeners:o}=Vencord.Webpack,{patches:i}=Vencord.Plugins;for(let d in n){let c=n[d],f=c.toString().replaceAll(` -`,""),E=c,h=new Set;n[d]=function(p,g,S){try{c(p,g,S)}catch(M){if(c===E)throw M;return W.error("Error in patched chunk",M),void E(p,g,S)}if(p.exports===window){Object.defineProperty(S.c,d,{value:S.c[d],enumerable:!1,configurable:!0,writable:!0});return}for(let M of o)try{M(g)}catch(T){W.error("Error in webpack listener",T)}for(let[M,T]of r)try{if(M(g))r.delete(M),T(g);else if(typeof g=="object"){g.default&&M(g.default)&&(r.delete(M),T(g.default));for(let I in g)I.length<3&&g[I]&&M(g[I])&&(r.delete(M),T(g[I]))}}catch(I){W.error("Error while firing callback for webpack chunk",I)}},n[d].toString=()=>c.toString(),n[d].original=E;for(let p=0;pe,set:t=>e.original=t,configurable:!0})}Je();F();v();Object.defineProperty(window,"IS_WEB",{get:()=>!window.DiscordNative,configurable:!0,enumerable:!0});var Mo;async function Wi(){await ht,xn(),Mo=await Promise.resolve().then(()=>(Ro(),vo));try{await Ae()&&q.notifyAboutUpdates&&setTimeout(()=>{Tn("A Vencord update is available!","View Update",()=>{Pn(),Be.open("VencordUpdater")})},1e4)}catch(e){be.error("Failed to check for updates",e)}}Wi();return Vo(zi);})(); +${o}`})},start(){this.preSend=W((e,t)=>this.unindentMsg(t)),this.preEdit=Re((e,t,n)=>this.unindentMsg(n))},stop(){H(this.preSend),ke(this.preEdit)}})});var go,Ca,ho,gi=a(()=>{"use strict";E();y();Ca="https://raw.githubusercontent.com/facebook/react/17.0.2/scripts/error-codes/codes.json",ho=c({name:"ReactErrorDecoder",description:'Replaces "Minifed React Error" with the actual error.',authors:[d.Cyn],patches:[{find:'"https://reactjs.org/docs/error-decoder.html?invariant="',replacement:{match:/(function .\(.\)){(for\(var .="https:\/\/reactjs\.org\/docs\/error-decoder\.html\?invariant="\+.,.=1;.`${t}{var decoded=Vencord.Plugins.plugins.ReactErrorDecoder.decodeError.apply(null, arguments);if(decoded)return decoded;${n}}`}}],async start(){go=await fetch(Ca).then(e=>e.json()).catch(e=>console.error(`[ReactErrorDecoder] Failed to fetch React error codes +`,e))},stop(){go=void 0},decodeError(e,...t){let n=0;return go?.[e]?.replace(/%s/g,()=>{let o=t[n];return n++,o})}})});function wa(e){return e.split(" ").map(t=>{let n=!1,o=t.toLowerCase();if(t.length<4)return t;for(let[r,i]of va)t.includes(r)&&(t=t.replace(r,i),n=!0);return o.includes("u")&&!o.includes("uwu")&&(t=t.replace("u","UwU"),n=!0),o.includes("o")&&!o.includes("owo")&&(t=t.replace("o","OwO"),n=!0),o.endsWith("y")&&t.length<7&&(t=t+" w"+t.slice(1),n=!0),n||(o.endsWith("n")||(t=t.replace("n","ny")),Math.floor(Math.random()*2)===1&&t.replace("s","sh"),Math.floor(Math.random()*5)===3&&!n&&(t=t[0]+"-"+t[0]+"-"+t),Math.floor(Math.random()*5)===3&&(t=t+" "+hi[Math.floor(Math.random()*hi.length)]),t=t.replaceAll("r","w").replaceAll("l","w")),t}).join(" ")}var hi,va,yo,yi=a(()=>{"use strict";re();y();hi=["owo","UwU",">w<","^w^","\u25CFw\u25CF","\u2606w\u2606","\u{1D5E8}\u{1D604}\u{1D5E8}","(\u15D2\u15E8\u15D5)","(\u25B0\u02D8v\u02D8\u25B0)","( \xB4 \u25BD ` ).\uFF61\uFF4F\u2661","*unbuttons shirt*",">3<",">:3",":3","murr~","\u2665(\u3002U \u03C9 U\u3002)","(\u02D8\u03B5\u02D8)","*screams*","*twerks*","*sweats*"],va=[["love","wuv"],["mr","mistuh"],["dog","doggo"],["cat","kitteh"],["hello","henwo"],["hell","heck"],["fuck","fwick"],["fuk","fwick"],["shit","shoot"],["friend","fwend"],["stop","stawp"],["god","gosh"],["dick","peepee"],["penis","bulge"],["damn","darn"]];yo=c({name:"UwUifier",description:"Simply uwuify commands",authors:[{name:"ECHO",id:712639419785412668n}],dependencies:["CommandsAPI"],commands:[{name:"uwuify",description:"uwuifies your messages",options:[ve],execute:e=>({content:wa(j(e,"message",""))})}]})});var bo,So,bi=a(()=>{"use strict";E();y();bo={},So=c({name:"vcDoubleClick",description:"Join VCs via DoubleClick instead of single click",authors:[d.Ven],patches:[{find:"VoiceChannel.renderPopout",replacement:{match:/onClick:function\(\)\{(e\.handleClick.+?)}/g,replace:"onClick:function(){Vencord.Plugins.plugins.vcDoubleClick.schedule(()=>{$1}, e)}"}},{find:'className:"channelMention",iconType:(',replacement:{match:/onClick:(.{1,3}),/,replace:"onClick:(_vcEv)=>_vcEv.detail>=2&&($1)(),"}}],schedule(e,t){let n=t.props.channel.id,o=bo[n]??={timeout:void 0,i:0};clearTimeout(o.timeout),++o.i>=2?(e(),delete bo[n]):o.timeout=setTimeout(()=>{delete bo[n]},500)}})});var Ra,ka,Et,xo,Si=a(()=>{"use strict";E();O();mt();y();A();v();Ra=C(e=>e.prototype?.render?.toString().includes("OPEN_ORIGINAL_IMAGE")),ka=te(()=>X(e=>e.type?.toString().includes("MASKED_LINK)"))),Et="Vencord.Plugins.plugins.ViewIcons.openImage(",xo=c({name:"ViewIcons",authors:[d.Ven],description:"Makes Avatars/Banners in user profiles clickable, and adds Guild Context Menu Entries to View Banner/Icon.",openImage(e){In(t=>Vencord.Webpack.Common.React.createElement(qe,{size:"dynamic",...t},Vencord.Webpack.Common.React.createElement(Ra,{shouldAnimate:!0,original:e,src:e,renderLinkComponent:n=>f.createElement(ka(),n)})))},patches:[{find:"onAddFriend:",replacement:{match:/\{src:(.{1,2}),avatarDecoration/g,replace:(e,t)=>`{src:${t},onClick:()=>${Et}${t}.replace(/\\?.+$/, "")+"?size=2048"),avatarDecoration`}},{find:"().popoutNoBannerPremium",replacement:{match:/style:.{0,10}\{\},(.{1,2})\)/,replace:(e,t)=>`onClick:${t}.backgroundImage&&(${t}.cursor="pointer",()=>${Et}${t}.backgroundImage.replace("url(", "").replace(/(\\?size=.+)?\\)/, "?size=2048"))),${e}`}},{find:'"GuildContextMenu:',replacement:[{match:/\w=(\w)\.id/,replace:(e,t)=>`_guild=${t},${e}`},{match:/(?<=createElement\((.{1,5}),\{id:"leave-guild".{0,100},)(.{1,2}\.createElement)\((.{1,5}),null,(.{1,2})\)(?=\)\}function)/,replace:(e,t,n,o,r)=>`${n}(${o},null,[_guild.icon&&${n}(${t},{id:"viewicons-copy-icon",label:"View Icon",action:()=>${Et}_guild.getIconURL(void 0,true)+"size=2048")}),_guild.banner&&${n}(${t},{id:"viewicons-copy-banner",label:"View Banner",action:()=>${Et}Vencord.Webpack.findByProps("getGuildBannerURL").getGuildBannerURL(_guild).replace(/\\?size=.+/, "?size=2048"))}),${r}])`}]}]})});var Eo,xi=a(()=>{"use strict";E();y();Eo=c({name:"Webhook Tags",description:"Changes the bot tag to say webhook for webhooks",authors:[d.Cyn],patches:[{find:'.BOT=0]="BOT"',replacement:[{match:/(.)\[.\.BOT=0\]="BOT";/,replace:(e,t)=>`${t}[${t}.WEBHOOK=99]="WEBHOOK";${e}`},{match:/case (.)\.BOT:default:(.)=/,replace:(e,t,n)=>`case ${t}.WEBHOOK:${n}="WEBHOOK";break;${e}`}]},{find:".Types.ORIGINAL_POSTER",replacement:{match:/return null==(.)\?null:.\.createElement\((.)\.Z/,replace:(e,t,n)=>`if(arguments[0].message.webhookId&&arguments[0].user.isNonUserBot()){${t}=${n}.Z.Types.WEBHOOK}${e}`}}]})});var V,Pt=a(()=>{Jo();Zo();er();tr();nr();or();rr();ir();sr();dr();pr();mr();ur();yr();Rr();kr();Ir();Mr();Br();Gr();jr();Hr();Kr();qr();Qr();Yr();Xr();Jr();Zr();ei();ti();ri();ii();ro();pi();mi();ui();fi();gi();yi();bi();Si();xi();V={[ln.name]:ln,[dn.name]:dn,[pn.name]:pn,[mn.name]:mn,[un.name]:un,[fn.name]:fn,[gn.name]:gn,[hn.name]:hn,[yn.name]:yn,[bn.name]:bn,[Sn.name]:Sn,[En.name]:En,[Pn.name]:Pn,[Fn.name]:Fn,[Dn.name]:Dn,[On.name]:On,[Ln.name]:Ln,[Un.name]:Un,[Vn.name]:Vn,[Gn.name]:Gn,[jn.name]:jn,[zn.name]:zn,[Wn.name]:Wn,[Hn.name]:Hn,[Kn.name]:Kn,[qn.name]:qn,[Qn.name]:Qn,[Yn.name]:Yn,[Xn.name]:Xn,[Jn.name]:Jn,[Zn.name]:Zn,[eo.name]:eo,[to.name]:to,[ao.name]:ao,[po.name]:po,[mo.name]:mo,[uo.name]:uo,[fo.name]:fo,[ho.name]:ho,[yo.name]:yo,[So.name]:So,[xo.name]:xo,[Eo.name]:Eo}});function Ei(e,t=e,n=""){return new Proxy(e,{get(o,r){let i=o[r];if(!(r in o)){if(n.startsWith("plugins.")){let l=n.slice(8);if(l in V){let m=V[l].options?.[r];if(!m)return i;if("default"in m)return m.default;if(m.type===4)return m.options.find(g=>g.default)?.value}}return i}return typeof i=="object"&&!Array.isArray(i)&&i!==null?Ei(i,t,`${n}${n&&"."}${r}`):i},set(o,r,i){if(o[r]===i)return!0;o[r]=i;let l=`${n}${n&&"."}${r}`;for(let m of Tt)(!m._path||m._path===l)&&m(i,l);return VencordNative.ipc.invoke(_.SET_SETTINGS,JSON.stringify(t,null,4)),!0}})}function _e(){let[,e]=f.useReducer(()=>({}),{});return f.useEffect(()=>(Tt.add(e),()=>void Tt.delete(e)),[]),P}function Ti(e,t){t._path=e,Tt.add(t)}var Po,$e,Tt,Pi,P,Fe=a(()=>{"use strict";Pt();Ue();O();y();v();Po={notifyAboutUpdates:!0,useQuickCss:!0,enableReactDevtools:!1,plugins:{}};for(let e in V)Po.plugins[e]={enabled:V[e].required??!1};try{$e=JSON.parse(VencordNative.ipc.sendSync(_.GET_SETTINGS)),Pe($e,Po)}catch(e){console.error("Corrupt settings file. ",e),$e=Pe({},Po)}Tt=new Set;Pi=$e,P=Ei($e)});var vo={};D(vo,{patches:()=>Ci,plugins:()=>Ia,startAllPlugins:()=>To,startPlugin:()=>Ct,stopPlugin:()=>Co});function To(){for(let e in V)P.plugins[e].enabled&&Ct(V[e])}function Ct(e){if(e.start){if(Z.info("Starting plugin",e.name),e.started)return Z.warn(`${e.name} already started`),!1;try{e.start(),e.started=!0}catch(t){return Z.error(`Failed to start ${e.name} +`,t),!1}}if(e.commands?.length){Z.info("Registering commands of plugin",e.name);for(let t of e.commands)try{$t(t,e.name)}catch(n){return Z.error(`Failed to register command ${t.name} +`,n),!1}}return!0}function Co(e){if(e.stop){if(Z.info("Stopping plugin",e.name),!e.started)return Z.warn(`${e.name} already stopped`),!1;try{e.stop(),e.started=!1}catch(t){return Z.error(`Failed to stop ${e.name} +`,t),!1}}if(e.commands?.length){Z.info("Unregistering commands of plugin",e.name);for(let t of e.commands)try{Gt(t.name)}catch(n){return Z.error(`Failed to unregister command ${t.name} +`,n),!1}}return!0}var Z,Ia,Ci,vt=a(()=>{"use strict";Pt();re();Fe();we();Z=new U("PluginManager","#a6d189"),Ia=V,Ci=[];for(let e of Object.values(V))if(e.patches&&P.plugins[e.name].enabled)for(let t of e.patches)t.plugin=e.name,Array.isArray(t.replacement)||(t.replacement=[t.replacement]),Ci.push(t)});var Ro={};D(Ro,{toggle:()=>wo});async function wo(e){Ae?Ae.disabled=!e:e&&(Ae=document.createElement("style"),Ae.id="vencord-custom-css",document.head.appendChild(Ae),VencordNative.ipc.on(_.QUICK_CSS_UPDATE,(t,n)=>Ae.innerText=n),Ae.innerText=await VencordNative.ipc.invoke(_.GET_QUICK_CSS))}var Ae,ko=a(()=>{"use strict";Fe();Ue();document.addEventListener("DOMContentLoaded",()=>{wo(P.useQuickCss),Ti("useQuickCss",wo)})});var _o={};D(_o,{UpdateLogger:()=>vi,changes:()=>Xe,checkForUpdates:()=>wi,getRepo:()=>ki,isNewer:()=>Io,isOutdated:()=>Je,rebuild:()=>Ii,update:()=>Ri,updateError:()=>Mo});async function Ge(e){let t=await e;if(t.ok)return t.value;throw Mo=t.error,t.error}async function wi(){return Xe=await Ge(VencordNative.ipc.invoke(_.GET_UPDATES)),Xe.some(e=>e.hash===Me)?(Io=!0,Je=!1):Je=Xe.length>0}async function Ri(){if(!Je)return!0;let e=await Ge(VencordNative.ipc.invoke(_.UPDATE));return e&&(Je=!1),e}function ki(){return Ge(VencordNative.ipc.invoke(_.GET_REPO))}async function Ii(){let e=await Ge(VencordNative.ipc.invoke(_.GET_HASHES));if(!await Ge(VencordNative.ipc.invoke(_.BUILD)))throw new Error("The Build failed. Please try manually building the new update");let t=await Ge(VencordNative.ipc.invoke(_.GET_HASHES));return e["patcher.js"]!==t["patcher.js"]||e["preload.js"]!==t["preload.js"]}var vi,Je,Io,Mo,Xe,wt=a(()=>{"use strict";Ye();Ue();we();vi=new U("Updater","white"),Je=!1,Io=!1});function Ma(){function e(t){try{let n=t[1],{subscriptions:o,listeners:r}=Vencord.Webpack,{patches:i}=Vencord.Plugins;for(let l in n){let m=n[l],g=m.toString().replaceAll(` +`,""),b=m,S=new Set;n[l]=function(s,p,T){try{m(s,p,T)}catch(w){if(m===b)throw w;return ee.error("Error in patched chunk",w),void b(s,p,T)}if(s.exports===window){Object.defineProperty(T.c,l,{value:T.c[l],enumerable:!1,configurable:!0,writable:!0});return}for(let w of r)try{w(p)}catch(x){ee.error("Error in webpack listener",x)}for(let[w,x]of o)try{if(w(p))o.delete(w),x(p);else if(typeof p=="object"){p.default&&w(p.default)&&(o.delete(w),x(p.default));for(let R in p)R.length<3&&p[R]&&w(p[R])&&(o.delete(w),x(p[R]))}}catch(R){ee.error("Error while firing callback for webpack chunk",R)}},n[l].toString=()=>m.toString(),n[l].original=b;for(let s=0;se,set:t=>e.original=t,configurable:!0})}var Mi,ee,_i=a(()=>{"use strict";E();we();A();ee=new U("WebpackInterceptor","#8caaee");Object.defineProperty(window,ie,{get:()=>Mi,set:e=>{e?.push!==Array.prototype.push&&(ee.info(`Patching ${ie}.push`),Mt(e),Ma(),delete window[ie],window[ie]=e),Mi=e},configurable:!0})});function Fo(e){return Vencord.Webpack.Common.React.createElement(ze,{className:e.className,style:{padding:"2em",backgroundColor:"#e7828430",borderColor:"#e78284",color:"var(--text-normal)",...e.style}},e.children)}var Ao=a(()=>{"use strict";v()});var _a,Fi,Ai,q,Ze=a(()=>{"use strict";we();v();Ao();_a="#e78284",Fi=new U("React ErrorBoundary",_a),Ai={},q=class extends f.Component{static wrap(t){return n=>Vencord.Webpack.Common.React.createElement(q,null,Vencord.Webpack.Common.React.createElement(t,{...n}))}state={error:Ai,stack:"",message:""};static getDerivedStateFromError(t){let n=t?.stack??"",o=t?.message||String(t);if(t instanceof Error&&n){let r=n.indexOf(` +`);r!==-1&&(o=n.slice(0,r),n=n.slice(r+1).replace(/https:\/\/\S+\/assets\//g,""))}return{error:t,stack:n,message:o}}componentDidCatch(t,n){this.props.onError?.(t,n),Fi.error(`A component threw an Error +`,t),Fi.error("Component Stack",n.componentStack)}render(){if(this.state.error===Ai)return this.props.children;if(this.props.fallback)return Vencord.Webpack.Common.React.createElement(this.props.fallback,{children:this.props.children,...this.state});let t=this.props.message||"An error occurred while rendering this Component. More info can be found below and in your console.";return Vencord.Webpack.Common.React.createElement(Fo,{style:{overflow:"hidden"}},Vencord.Webpack.Common.React.createElement("h1",null,"Oh no!"),Vencord.Webpack.Common.React.createElement("p",null,t),Vencord.Webpack.Common.React.createElement("code",null,this.state.message,!!this.state.stack&&Vencord.Webpack.Common.React.createElement("pre",{className:$.marginTop8},this.state.stack)))}}});function se(e){return e.style??={},e.style.flexDirection||=e.flexDirection,e.style.gap??="1em",e.style.display="flex",Vencord.Webpack.Common.React.createElement("div",{...e},e.children)}var et=a(()=>{"use strict"});function Ni(e){let t=new Na({username:e.name,id:He(),bot:!0});return I.dispatch({type:"USER_UPDATE",user:t}),t}function No({plugin:e,onRestartNeeded:t,onClose:n,transitionState:o}){let[r,i]=f.useState([]),l=_e().plugins[e.name],[m,g]=f.useState({}),[b,S]=f.useState({}),s=()=>Object.values(b).every(x=>!x);f.useEffect(()=>{(async()=>{for(let x of e.authors.slice(0,6)){let R=x.id?await Ft.fetchUser(`${x.id}`).catch(()=>null):Ni(x);i(Q=>[...Q,R||Ni(x)])}})()},[]);function p(){if(!e.options){n();return}let x=!1;for(let[R,Q]of Object.entries(m)){let N=e.options[R];l[R]=Q,N?.onChange?.(Q),N?.restartNeeded&&(x=!0)}x&&t(),n()}function T(){if(!l||!e.options)return Vencord.Webpack.Common.React.createElement(u.FormText,null,"There are no settings for this plugin.");let x=[];for(let[N,Y]of Object.entries(e.options)){let ae=function(je){g(Rt=>({...Rt,[N]:je}))},ge=function(je){S(Rt=>({...Rt,[N]:je}))};var R=ae,Q=ge;let ce={onChange:ae,pluginSettings:l,id:N,onError:ge};switch(Y.type){case 4:{x.push(Vencord.Webpack.Common.React.createElement(Pr,{key:N,option:Y,...ce}));break}case 0:{x.push(Vencord.Webpack.Common.React.createElement(vr,{key:N,option:Y,...ce}));break}case 1:case 2:{x.push(Vencord.Webpack.Common.React.createElement(xr,{key:N,option:Y,...ce}));break}case 3:{x.push(Vencord.Webpack.Common.React.createElement(br,{key:N,option:Y,...ce}));break}case 5:{x.push(Vencord.Webpack.Common.React.createElement(Cr,{key:N,option:Y,...ce}));break}}}return Vencord.Webpack.Common.React.createElement(se,{flexDirection:"column",style:{gap:12}},x)}function w(x,R){let Q=e.authors.length-R,N=e.authors.length-Q,Y=N+e.authors.length-R;return Vencord.Webpack.Common.React.createElement(Se,{text:e.authors.slice(N,Y).map(ae=>ae.name).join(", ")},({onMouseEnter:ae,onMouseLeave:ge})=>Vencord.Webpack.Common.React.createElement("div",{className:Aa.moreUsers,onMouseEnter:ae,onMouseLeave:ge},"+",Q))}return Vencord.Webpack.Common.React.createElement(qe,{transitionState:o,size:"medium"},Vencord.Webpack.Common.React.createElement(vn,null,Vencord.Webpack.Common.React.createElement(ne,{variant:"heading-md/bold"},e.name)),Vencord.Webpack.Common.React.createElement(wn,{style:{marginBottom:8,marginTop:8}},Vencord.Webpack.Common.React.createElement(u.FormSection,null,Vencord.Webpack.Common.React.createElement(u.FormTitle,{tag:"h3"},"About ",e.name),Vencord.Webpack.Common.React.createElement(u.FormText,null,e.description),Vencord.Webpack.Common.React.createElement("div",{style:{marginTop:8,marginBottom:8,width:"fit-content"}},Vencord.Webpack.Common.React.createElement(Fa,{users:r,count:e.authors.length,guildId:void 0,renderIcon:!1,max:6,showDefaultAvatarsForNullUsers:!0,showUserPopout:!0,renderMoreUsers:w}))),!!e.settingsAboutComponent&&Vencord.Webpack.Common.React.createElement("div",{style:{marginBottom:8}},Vencord.Webpack.Common.React.createElement(u.FormSection,null,Vencord.Webpack.Common.React.createElement(q,{message:"An error occurred while rendering this plugin's custom InfoComponent"},Vencord.Webpack.Common.React.createElement(e.settingsAboutComponent,null)))),Vencord.Webpack.Common.React.createElement(u.FormSection,null,Vencord.Webpack.Common.React.createElement(u.FormTitle,{tag:"h3"},"Settings"),T())),Vencord.Webpack.Common.React.createElement(Rn,null,Vencord.Webpack.Common.React.createElement(se,null,Vencord.Webpack.Common.React.createElement(M,{onClick:n,size:M.Sizes.SMALL,color:M.Colors.RED},"Exit Without Saving"),Vencord.Webpack.Common.React.createElement(Se,{text:"You must fix all errors before saving",shouldShow:!s()},({onMouseEnter:x,onMouseLeave:R})=>Vencord.Webpack.Common.React.createElement(M,{size:M.Sizes.SMALL,color:M.Colors.BRAND,onClick:p,onMouseEnter:x,onMouseLeave:R,disabled:!s()},"Save & Exit")))))}var Fa,Aa,Na,Di=a(()=>{"use strict";re();Fe();ue();mt();y();A();v();Ze();et();Nn();Fa=C(h.byCode("defaultRenderUser","showDefaultAvatarsForNullUsers")),Aa=C(h.byProps(["moreUsers","emptyUser","avatarContainer","clickableAvatar"])),Na=he(()=>F.getCurrentUser().constructor)});var Do,Oi,Li,Ui=a(()=>{"use strict";Do={marginTop:16,display:"grid",gridGap:16,gridTemplateColumns:"repeat(auto-fill, minmax(250px, 1fr))"},Oi={backgroundColor:"var(--background-modifier-selected)",color:"var(--interactive-active)",borderRadius:3,cursor:"pointer",display:"block",height:150,padding:10,width:"100%"},Li={gap:10,height:40,gridTemplateColumns:"1fr 150px",display:"grid"}});function La(e){B.show({message:e,type:B.Type.FAILURE,id:B.genId(),options:{position:B.Position.BOTTOM}})}function Vi({plugin:e,disabled:t,onRestartNeeded:n,onMouseEnter:o,onMouseLeave:r}){let i=_e().plugins[e.name];function l(){return i?.enabled||e.started}function m(){Qe.openModalLazy(async()=>b=>Vencord.Webpack.Common.React.createElement(No,{...b,plugin:e,onRestartNeeded:n}))}function g(){let b=l(),S=b?Co(e):Ct(e),s=b?"stop":"start";if(!S){La(`Failed to ${s} plugin: ${e.name}`);return}i.enabled=!i.enabled,e.patches&&n()}return Vencord.Webpack.Common.React.createElement(se,{style:Oi,flexDirection:"column",onClick:()=>m(),onMouseEnter:o,onMouseLeave:r},Vencord.Webpack.Common.React.createElement(ne,{variant:"text-md/bold"},e.name),Vencord.Webpack.Common.React.createElement(ne,{variant:"text-md/normal",style:{height:40,overflow:"hidden"}},e.description),Vencord.Webpack.Common.React.createElement(se,{flexDirection:"row-reverse",style:{marginTop:"auto",width:"100%",justifyContent:"space-between"}},Vencord.Webpack.Common.React.createElement(M,{onClick:b=>{b.preventDefault(),b.stopPropagation(),g()},disabled:t,color:l()?M.Colors.RED:M.Colors.GREEN},l()?"Disable":"Enable"),e.options&&Vencord.Webpack.Common.React.createElement(u.FormText,{style:{cursor:"pointer",margin:"auto 0 auto 10px"}},"Click to configure")))}function Ua(e){return Vencord.Webpack.Common.React.createElement(f.Fragment,null,Vencord.Webpack.Common.React.createElement(u.FormText,null,"This plugin is required by:"),e.map(t=>Vencord.Webpack.Common.React.createElement(u.FormText,{style:{margin:"0 auto"}},t)))}function Oo(e,t){return t[e]?.filter(n=>P.plugins[n].enabled)||[]}var Oa,Bi,$i,Gi=a(()=>{"use strict";Pt();Fe();vt();ue();dt();O();A();v();Ze();et();Di();Ui();Oa=C(h.byCode("optionClassName","popoutPosition","autoFocus","maxVisibleItems")),Bi=C(h.byProps(["inputDefault","inputWrapper"]));$i=q.wrap(function(){let t=_e(),n=f.useMemo(()=>new Ie,[]);f.useEffect(()=>()=>void(n.hasChanges&&Ee.show({title:"Restart required",body:Vencord.Webpack.Common.React.createElement(Vencord.Webpack.Common.React.Fragment,null,Vencord.Webpack.Common.React.createElement("p",null,"The following plugins require a restart:"),Vencord.Webpack.Common.React.createElement("div",null,n.map((s,p)=>Vencord.Webpack.Common.React.createElement(Vencord.Webpack.Common.React.Fragment,null,p>0&&", ",xe.parse("`"+s+"`"))))),confirmText:"Restart now",cancelText:"Later!",onConfirm:()=>location.reload()})),[]);let o=f.useMemo(()=>{let s={};for(let p in V){let T=V[p].dependencies;if(T)for(let w of T)s[w]??=[],s[w].push(p)}return s},[]);function r(s){return!!o[s.name]?.filter(T=>t.plugins[T].enabled)?.length}let i=f.useMemo(()=>Object.values(V).sort((s,p)=>s.name.localeCompare(p.name)),[]),[l,m]=f.useState({value:"",status:"all"}),g=s=>m(p=>({...p,value:s})),b=s=>m(p=>({...p,status:s})),S=s=>{let p=l.status==="enabled"||l.status==="all",T=l.status==="disabled"||l.status==="all",w=t.plugins[s.name]?.enabled||s.started;return(p&&w||T&&!w)&&(s.name.toLowerCase().includes(l.value.toLowerCase())||s.description.toLowerCase().includes(l.value.toLowerCase()))};return Vencord.Webpack.Common.React.createElement(u.FormSection,{tag:"h1",title:"Vencord"},Vencord.Webpack.Common.React.createElement(u.FormTitle,{tag:"h5",className:Te($.marginTop20,$.marginBottom8)},"Plugins"),Vencord.Webpack.Common.React.createElement("div",{style:Li},Vencord.Webpack.Common.React.createElement(de,{value:l.value,placeholder:"Search for a plugin...",onChange:g,style:{marginBottom:24}}),Vencord.Webpack.Common.React.createElement("div",{className:Bi.inputWrapper},Vencord.Webpack.Common.React.createElement(Oa,{className:Bi.inputDefault,options:[{label:"Show All",value:"all",default:!0},{label:"Show Enabled",value:"enabled"},{label:"Show Disabled",value:"disabled"}],serialize:s=>String(s),select:b,isSelected:s=>s===l.status,closeOnSelect:!0}))),Vencord.Webpack.Common.React.createElement("div",{style:Do},i?.length?i.filter(s=>!s.required&&!Oo(s.name,o).length&&S(s)).map(s=>{let T=o[s.name]?.filter(w=>t.plugins[w].enabled)?.length;return Vencord.Webpack.Common.React.createElement(Vi,{onRestartNeeded:()=>{n.handleChange(s.name)},disabled:s.required||!!T,plugin:s})}):Vencord.Webpack.Common.React.createElement(ne,{variant:"text-md/normal"},"No plugins meet search criteria.")),Vencord.Webpack.Common.React.createElement(u.FormDivider,null),Vencord.Webpack.Common.React.createElement(u.FormTitle,{tag:"h5",className:Te($.marginTop20,$.marginBottom8)},"Required Plugins"),Vencord.Webpack.Common.React.createElement("div",{style:Do},i?.length?i.filter(s=>s.required||Oo(s.name,o).length&&S(s)).map(s=>{let T=o[s.name]?.filter(x=>t.plugins[x].enabled)?.length,w=s.required?"This plugin is required for Vencord to function.":Ua(Oo(s.name,o));return Vencord.Webpack.Common.React.createElement(Se,{text:w},({onMouseLeave:x,onMouseEnter:R})=>Vencord.Webpack.Common.React.createElement(Vi,{onMouseLeave:x,onMouseEnter:R,onRestartNeeded:()=>{n.handleChange(s.name)},disabled:s.required||!!T,plugin:s}))}):Vencord.Webpack.Common.React.createElement(ne,{variant:"text-md/normal"},"No plugins meet search criteria.")))})});var ji,zi=a(()=>{"use strict";Fe();dt();Ue();O();v();Ze();et();ji=q.wrap(function(){let[t,,n]=pe(()=>VencordNative.ipc.invoke(_.GET_SETTINGS_DIR),"Loading..."),o=_e(),r=f.useMemo(()=>new Ie,[]);return f.useEffect(()=>()=>void(r.hasChanges&&Ee.show({title:"Restart required",body:Vencord.Webpack.Common.React.createElement(Vencord.Webpack.Common.React.Fragment,null,Vencord.Webpack.Common.React.createElement("p",null,"The following plugins require a restart:"),Vencord.Webpack.Common.React.createElement("div",null,r.map((i,l)=>Vencord.Webpack.Common.React.createElement(Vencord.Webpack.Common.React.Fragment,null,l>0&&", ",xe.parse("`"+i+"`"))))),confirmText:"Restart now",cancelText:"Later!",onConfirm:()=>location.reload()})),[]),Vencord.Webpack.Common.React.createElement(u.FormSection,{tag:"h1",title:"Vencord"},Vencord.Webpack.Common.React.createElement(u.FormTitle,{tag:"h5"},"Settings"),Vencord.Webpack.Common.React.createElement(u.FormText,null,"Settings Directory: ",Vencord.Webpack.Common.React.createElement("code",{style:{userSelect:"text",cursor:"text"}},t)),Vencord.Webpack.Common.React.createElement(se,{className:$.marginBottom20,style:{marginTop:8}},Vencord.Webpack.Common.React.createElement(M,{onClick:()=>VencordNative.ipc.send(_.OPEN_EXTERNAL,t),size:M.Sizes.SMALL,disabled:n},"Launch Directory"),Vencord.Webpack.Common.React.createElement(M,{onClick:()=>VencordNative.ipc.send(_.OPEN_EXTERNAL,t+"/quickCss.css"),size:M.Sizes.SMALL,disabled:t==="Loading..."},"Open QuickCSS File")),Vencord.Webpack.Common.React.createElement(u.FormDivider,null),Vencord.Webpack.Common.React.createElement(at,{value:o.useQuickCss,onChange:i=>o.useQuickCss=i,note:"Loads styles from your QuickCss file"},"Use QuickCss"),!1,!1)})});var Wi=a(()=>{"use strict"});var Hi,Ki=a(()=>{"use strict";Ye();O();wt();v();Ze();Ao();et();Wi();Hi=null});var qi={};D(qi,{PluginSettings:()=>$i,Settings:()=>ji,Updater:()=>Hi});var Qi=a(()=>{"use strict";Gi();zi();Ki()});async function Ba(){if(await kt,To(),Yi=await Promise.resolve().then(()=>(Qi(),qi)),!1)try{}catch(e){}}var Yi,K=a(()=>{"use strict";Xo();vt();ue();ko();wt();A();sn();Fe();vt();_i();ko();wt();A();v();Ba()});var Va={};D(Va,{Api:()=>an,Components:()=>Yi,PlainSettings:()=>Pi,Plugins:()=>vo,QuickCss:()=>Ro,Settings:()=>P,Updater:()=>_o,Util:()=>Mn,Webpack:()=>Nt});var nt,is=new Promise(e=>{setTimeout(()=>{new QWebChannel(qt.webChannelTransport,function(t){nt=t.objects.webclass,e()})})});async function Uo(){nt||await is}window.VencordNative={getVersions:()=>({}),ipc:{send:async(e,...t)=>{await Uo(),nt.vencordSend(e,t)},sendSync:(e,...t)=>{if(e==="VencordGetSettings")return console.log(window.discordScreenaudioVencordSettings),window.discordScreenaudioVencordSettings||"{}";throw new Error("Synchroneous IPC not implemented")},on(e,t){},off(e,t){},invoke:async(e,...t)=>(await Uo(),nt.vencordSend(e,t))}};K();return rs(Va);})(); //# sourceURL=VencordWeb +/*! For license information please see browser.js.LEGAL.txt */ diff --git a/scripts/build_vencord.sh b/scripts/build_vencord.sh index eeee588..fe5131c 100755 --- a/scripts/build_vencord.sh +++ b/scripts/build_vencord.sh @@ -22,7 +22,7 @@ fi echo_status "Checking out latest commit" git reset --hard HEAD git checkout main -git reset --hard origin/main +git reset --hard devbuild echo_status "Installing dependencies" pnpm i @@ -30,6 +30,7 @@ pnpm i echo_status "Patching Vencord" cp -v ../../assets/vencord/plugin.js ./src/plugins/discord-screenaudio.js cp -v ../../assets/vencord/VencordNativeStub.ts ./browser/VencordNativeStub.ts +patch -p1 -i ../../assets/vencord/settings.patch echo_status "Building Vencord" pnpm run buildWeb diff --git a/src/discordpage.cpp b/src/discordpage.cpp index e216f8a..7a0712a 100644 --- a/src/discordpage.cpp +++ b/src/discordpage.cpp @@ -59,7 +59,16 @@ DiscordPage::DiscordPage(QWidget *parent) : QWebEnginePage(parent) { webChannel()->registerObject("webclass", &m_webClass); injectScriptFile("userscript.js", ":/assets/userscript.js"); - injectScriptFile("vencord.js", ":/assets/vencord/vencord.js"); + QFile vencord(":/assets/vencord/vencord.js"); + if (!vencord.open(QIODevice::ReadOnly)) + qFatal("Failed to load vencord source with error: %s", + vencord.errorString().toLatin1().constData()); + injectScriptText( + "vencord.js", + QString("window.discordScreenaudioVencordSettings = `%1`; %2") + .arg(m_webClass.vencordSend("VencordGetSettings", {}).toString(), + vencord.readAll())); + vencord.close(); injectScriptText("version.js", QString("window.discordScreenaudioVersion = '%1';") diff --git a/src/webclass.cpp b/src/webclass.cpp index 7dc0f57..ced0b92 100644 --- a/src/webclass.cpp +++ b/src/webclass.cpp @@ -1,5 +1,6 @@ #include "webclass.h" +#include #include #include #include @@ -7,19 +8,28 @@ #include QVariant WebClass::vencordSend(QString event, QVariantList args) { + QString configFolder = + QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation) + + "/vencord"; + QString quickCssFile = configFolder + "/quickCss.css"; + QString settingsFile = configFolder + "/settings.json"; + + if (!QDir().exists(configFolder)) + QDir().mkpath(configFolder); + if (event == "VencordGetRepo") { return true; } if (event == "VencordGetSettingsDir") { - return QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation); + return configFolder; } if (event == "VencordGetQuickCss") { - QString filename = - QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation) + - "/vencord/quickCss.css"; - if (QFile::exists(filename)) { - QFile file(filename); - file.open(QIODevice::ReadOnly); + if (QFile::exists(quickCssFile)) { + QFile file(quickCssFile); + if (!file.open(QIODevice::WriteOnly)) + qFatal("Failed to load %s with error: %s", + quickCssFile.toLatin1().constData(), + file.errorString().toLatin1().constData()); auto content = file.readAll(); file.close(); return QString(content); @@ -27,10 +37,26 @@ QVariant WebClass::vencordSend(QString event, QVariantList args) { return ""; } if (event == "VencordGetSettings") { - return m_vencordSettings; + if (QFile::exists(settingsFile)) { + QFile file(settingsFile); + if (!file.open(QIODevice::ReadOnly)) + qFatal("Failed to load %s with error: %s", + settingsFile.toLatin1().constData(), + file.errorString().toLatin1().constData()); + auto content = file.readAll(); + file.close(); + return QString(content); + } else + return "{}"; } if (event == "VencordSetSettings") { - m_vencordSettings = args[0].toString(); + QFile file(settingsFile); + if (!file.open(QIODevice::WriteOnly)) + qFatal("Failed to load %s with error: %s", + settingsFile.toLatin1().constData(), + file.errorString().toLatin1().constData()); + file.write(args[0].toString().toUtf8()); + file.close(); return true; } if (event == "VencordGetUpdates") {