discord-awesomeaudio/assets/vencord.js

29 lines
51 KiB
JavaScript

"use strict";var Vencord=(()=>{var Ve=Object.defineProperty;var Ur=Object.getOwnPropertyDescriptor;var $r=Object.getOwnPropertyNames;var Vr=Object.prototype.hasOwnProperty;var l=(e,t)=>()=>(e&&(t=e(e=0)),t);var N=(e,t)=>{for(var n in t)Ve(e,n,{get:t[n],enumerable:!0})},Br=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of $r(t))!Vr.call(e,o)&&o!==n&&Ve(e,o,{get:()=>t[o],enumerable:!(r=Ur(t,o))||r.enumerable});return e};var Gr=e=>Br(Ve({},"__esModule",{value:!0}),e);function jr(e){let t={};for(let n in e)t[n]=e[n],t[e[n]]=n;return Object.freeze(t)}var h,q=l(()=>{"use strict";h=jr({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 s(e){return e}var u=l(()=>{"use strict"});var G,a,m=l(()=>{"use strict";G="webpackChunkdiscord_app",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}})});var je,fn=l(()=>{"use strict";u();m();je=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 He,gn=l(()=>{"use strict";u();m();He=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"}]}]})});var We,hn=l(()=>{"use strict";m();u();We=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 ze,yn=l(()=>{"use strict";m();u();ze=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 qe,En=l(()=>{"use strict";u();m();qe=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 Qe,_n=l(()=>{"use strict";m();u();Qe=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 Ke,Sn=l(()=>{"use strict";u();m();Ke=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 bn,xn=l(()=>{"use strict";bn=["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 k,te=l(()=>{"use strict";k=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 nt={};N(nt,{_handleClick:()=>qr,_handlePreEdit:()=>zr,_handlePreSend:()=>Wr,addClickListener:()=>et,addPreEditListener:()=>Q,addPreSendListener:()=>A,removeClickListener:()=>tt,removePreEditListener:()=>K,removePreSendListener:()=>D});function Wr(e,t,n){for(let r of Je)try{r(e,t,n)}catch(o){Ye.error(`MessageSendHandler: Listener encoutered an unknown error. (${o})`)}}function zr(e,t,n){for(let r of Xe)try{r(e,t,n)}catch(o){Ye.error(`MessageEditHandler: Listener encoutered an unknown error. (${o})`)}}function A(e){return Je.add(e),e}function Q(e){return Xe.add(e),e}function D(e){return Je.delete(e)}function K(e){return Xe.delete(e)}function qr(e,t,n){for(let r of Ze)try{r(e,t,n)}catch(o){Ye.error(`MessageClickHandler: Listener encoutered an unknown error. (${o})`)}}function et(e){return Ze.add(e),e}function tt(e){return Ze.delete(e)}var Ye,Je,Xe,Ze,j=l(()=>{"use strict";te();Ye=new k("MessageEvents","#e5c890"),Je=new Set,Xe=new Set;Ze=new Set});var wn,Qr,rt,Pn=l(()=>{"use strict";xn();j();u();wn=/[\\^$.*+?()[\]{}|]/g,Qr=RegExp(wn.source),rt=s({name:"clearURLs",description:"Removes tracking garbage from URLs",authors:[{name:"adryd",id:0n}],dependencies:["MessageEventsAPI"],escapeRegExp(e){return e&&Qr.test(e)?e.replace(wn,"\\$&"):e||""},createRules(){let e=bn;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,p,c)=>{this.removeParam(o,p,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=A((e,t)=>this.onSend(t)),this.preEdit=Q((e,t,n)=>this.onSend(n))},stop(){D(this.preSend),K(this.preEdit)}})});function st(e){if(Y!==void 0)throw"no.";fe=e.push([[Symbol()],{},t=>t]),Y=fe.c,e.pop()}function H(e,t=!0){if(typeof e!="function")throw new Error("Invalid filter. Expected a function got "+typeof e);for(let n in Y){let r=Y[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 Cn(e,t=!0){if(typeof e!="function")throw new Error("Invalid filter. Expected a function got "+typeof e);let n=[];for(let r in Y){let o=Y[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 p=o.exports[i];p&&e(p)&&n.push(p)}}}return n}function J(...e){return H(x.byProps(e))}function Kr(...e){return Cn(x.byProps(e))}function Yr(e){return H(x.byDisplayName(e))}function y(e,t){if(typeof e=="string")e=x.byProps([e]);else if(Array.isArray(e))e=x.byProps(e);else if(typeof e!="function")throw new Error("filter must be a string, string[] or function, got "+typeof e);let n=H(e);if(n)return void t(n);Tn.set(e,t)}function Jr(e){it.add(e)}function Xr(e){it.delete(e)}function Zr(...e){let t={},n=fe.m;e:for(let r in n){let o=n[r].original??n[r],i=o.toString();for(let p of e)if(typeof p=="string"&&!i.includes(p)||p instanceof RegExp&&!p.test(i))continue e;t[r]=o}return t}function eo(e){let t=fe.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 ke,ot,fe,Y,x,Tn,it,at=l(()=>{"use strict";ot=new Promise(e=>ke=e),x={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}},Tn=new Map,it=new Set});var ct={};N(ct,{Common:()=>lt,_initWebpack:()=>st,_resolveReady:()=>ke,addListener:()=>Jr,cache:()=>Y,extract:()=>eo,filters:()=>x,find:()=>H,findAll:()=>Cn,findAllByProps:()=>Kr,findByDisplayName:()=>Yr,findByProps:()=>J,listeners:()=>it,onceReady:()=>ot,removeListener:()=>Xr,search:()=>Zr,subscriptions:()=>Tn,waitFor:()=>y,wreq:()=>fe});var F=l(()=>{"use strict";at();C()});function to(e){let t;return()=>t??(t=e())}function ne(e){let t=to(()=>H(e));return new Proxy(()=>null,{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,o)=>Reflect.construct(t(),r,o),deleteProperty:(n,r)=>delete t()[r],defineProperty:(n,r,o)=>!!Object.defineProperty(t(),r,o)})}function Re(e,t=null){let[n,r]=S.useState({value:t,error:null,pending:!0});return S.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 Ie(e,t){for(let n in t){let r=t[n];typeof r=="object"&&!Array.isArray(r)?(e[n]??={},Ie(e[n],r)):e[n]??=r}return e}function vn(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;o<n;o++)r+=t(e[o]),n-o>2?r+=", ":n-o>1&&(r+=" and ");return r}function ge(...e){return e.join(" ")}function kn(e){return new Promise(t=>setTimeout(t,e))}var X=l(()=>{"use strict";F();C()});var lt={};N(lt,{Alerts:()=>Z,Button:()=>T,Card:()=>oe,ChannelStore:()=>In,FluxDispatcher:()=>M,Forms:()=>_,GuildStore:()=>Rn,Margins:()=>L,Parser:()=>se,React:()=>S,Router:()=>Me,SelectedChannelStore:()=>he,Switch:()=>ie,Toasts:()=>b,Tooltip:()=>Mn,UserStore:()=>re});var L,M,S,Rn,re,he,In,_,oe,T,ie,Mn,Me,se,Z,no,ro,b,C=l(()=>{"use strict";at();X();L=ne(x.byProps(["marginTop20"])),_={},no={MESSAGE:0,SUCCESS:1,FAILURE:2,CUSTOM:3},ro={TOP:0,BOTTOM:1},b={Type:no,Position:ro,genId:()=>(Math.random()||Math.random()).toString(36).slice(2)};y("useState",e=>S=e);y(["dispatch","subscribe"],e=>{M=e;let t=()=>{e.unsubscribe("CONNECTION_OPEN",t),ke()};e.subscribe("CONNECTION_OPEN",t)});y(["getCurrentUser","initialize"],e=>re=e);y("getSortedPrivateChannels",e=>In=e);y("getCurrentlySelectedChannelId",e=>he=e);y("getGuildCount",e=>Rn=e);y(["Hovers","Looks","Sizes"],e=>T=e);y(x.byCode("helpdeskArticleId"),e=>ie=e);y(["Positions","Colors"],e=>Mn=e);y(e=>e.Types?.PRIMARY==="cardPrimary",e=>oe=e);y(e=>e.Tags&&x.byCode("errorSeparator")(e),e=>_.FormTitle=e);y(e=>e.Tags&&x.byCode("titleClassName","sectionTitle")(e),e=>_.FormSection=e);y(e=>e.Types?.INPUT_PLACEHOLDER,e=>_.FormText=e);y(e=>{if(typeof e!="function")return!1;let t=e.toString();return t.length<200&&t.includes("divider")},e=>_.FormDivider=e);y(x.byCode("currentToast?"),e=>b.show=e);y(x.byCode("currentToast:null"),e=>b.pop=e);y(["show","close"],e=>Z=e);y("parseTopic",e=>se=e);y(["open","saveAccountChanges"],e=>Me=e)});var dt,Nn=l(()=>{"use strict";m();u();C();dt=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),b.show({message:"Copied to Clipboard!",type:b.Type.SUCCESS,id:b.genId(),options:{duration:1e3,position:b.Position.BOTTOM}})}})});var pt,ut,An=l(()=>{"use strict";m();u();pt=e=>()=>{throw new Error(`'${e}' is Discord Desktop only.`)},ut=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 mt,Dn=l(()=>{"use strict";m();u();mt=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;"}}]})});var St={};N(St,{ApplicationCommandInputType:()=>Et,ApplicationCommandOptionType:()=>yt,ApplicationCommandType:()=>_t,BUILT_IN:()=>ae,OptionalMessageOption:()=>ye,RequiredMessageOption:()=>Ee,_init:()=>oo,commands:()=>ft,findOption:()=>_e,generateId:()=>Un,registerCommand:()=>gt,unregisterCommand:()=>ht});function oo(e){try{ae=e,ye=e.find(t=>t.name==="shrug").options[0],Ee=e.find(t=>t.name==="me").options[0]}catch{console.error("Failed to load CommandsApi")}return e}function Un(){return`-${On.fromTimestamp(Date.now())}`}function _e(e,t,n){return e.find(r=>r.name===t)?.value||n}function $n(e){e.displayName||=e.name,e.displayDescription||=e.description,e.options?.forEach((t,n,r)=>{t===Fn?r[n]=ye:t===Ln&&(r[n]=Ee),$n(r[n])})}function gt(e,t){if(ae.some(n=>n.name===e.name))throw new Error(`Command '${e.name}' already exists.`);e.id||=Un(),e.applicationId||="-1",e.type||=_t.CHAT_INPUT,e.inputType||=Et.BUILT_IN_TEXT,e.plugin||=t,$n(e),ft[e.name]=e,ae.push(e)}function ht(e){let t=ae.findIndex(n=>n.name===e);return t===-1?!1:(ae.splice(t,1),delete ft[e],!0)}var ae,ft,Fn,Ln,ye,Ee,On,yt,Et,_t,ce=l(()=>{"use strict";F();ft={},Fn=Symbol("OptionalMessageOption"),Ln=Symbol("RequiredMessageOption"),ye=Fn,Ee=Ln;y("fromTimestamp",e=>On=e);yt=(d=>(d[d.SUB_COMMAND=1]="SUB_COMMAND",d[d.SUB_COMMAND_GROUP=2]="SUB_COMMAND_GROUP",d[d.STRING=3]="STRING",d[d.INTEGER=4]="INTEGER",d[d.BOOLEAN=5]="BOOLEAN",d[d.USER=6]="USER",d[d.CHANNEL=7]="CHANNEL",d[d.ROLE=8]="ROLE",d[d.MENTIONABLE=9]="MENTIONABLE",d[d.NUMBER=10]="NUMBER",d[d.ATTACHMENT=11]="ATTACHMENT",d))(yt||{}),Et=(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))(Et||{}),_t=(r=>(r[r.CHAT_INPUT=1]="CHAT_INPUT",r[r.USER=2]="USER",r[r.MESSAGE=3]="MESSAGE",r))(_t||{})});var Vn,bt,Bn=l(()=>{"use strict";ce();m();u();Vn={fart:new Audio("https://raw.githubusercontent.com/ItzOnlyAnimal/AliuPlugins/main/fart.mp3")},bt=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 Vn.fart.volume=.3,Vn.fart.play(),{content:e[0]?`<@${e[0].value}> fart`:"fart"}}}]})});var xt,Gn=l(()=>{"use strict";u();j();m();xt=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(/https?:\/\/twitter\.com(?=\/.*?\/)/g,"https://fxtwitter.com")},start(){this.preSend=A((e,t)=>this.addPrefix(t))},stop(){D(this.preSend)}})});var wt,jn=l(()=>{"use strict";m();u();wt=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 Pt,Hn=l(()=>{"use strict";m();u();Pt=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(){}"}]}]})});var Tt,Wn=l(()=>{"use strict";m();u();Tt=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 Ct,zn=l(()=>{"use strict";u();m();ce();Ct=s({name:"lenny",description:"( \u0361\xB0 \u035C\u0296 \u0361\xB0)",authors:[a.Arjix],dependencies:["CommandsAPI"],commands:[{name:"lenny",description:"Sends a lenny face",options:[ye],execute:e=>({content:_e(e,"message","")+" ( \u0361\xB0 \u035C\u0296 \u0361\xB0)"})}]})});var vt,qn,Qn,kt,Kn=l(()=>{"use strict";j();m();u();F();C();vt=!1,qn=e=>e.key==="Backspace"&&(vt=!0),Qn=e=>e.key==="Backspace"&&(vt=!1),kt=s({name:"MessageQuickActions",description:"Quick Delete, Quick edit",authors:[a.Ven],dependencies:["MessageEventsAPI"],start(){let{deleteMessage:e,startEditMessage:t}=J("deleteMessage"),{can:n}=J("can","initialize"),{MANAGE_MESSAGES:r}=H(i=>typeof i.MANAGE_MESSAGES=="bigint"),{isEditing:o}=J("isEditing");document.addEventListener("keydown",qn),document.addEventListener("keyup",Qn),this.onClick=et((i,p,c)=>{let f=i.author.id===re.getCurrentUser().id;vt?(f||n(r,p))&&(e(p.id,i.id),c.preventDefault()):f&&c.detail>=2&&!o(p.id,i.id)&&(t(p.id,i.id,i.content),c.preventDefault())})},stop(){tt(this.onClick),document.removeEventListener("keydown",qn),document.removeEventListener("keyup",Qn)}})});function ao(e,t){let n=0,r=0;for(;(r=e.indexOf(t,r)+1)!==0;)n++;return n}function co(e,t){if(!t.global)throw new Error("pattern must be global");let n=0;for(;t.test(e);)n++;return n}function po(e){let t=ao(e,Jn)+co(e,lo);return Math.min(t,10)}function Yn(){let e=document.createElement("audio");e.src=io,e.play()}var Jn,io,so,Rt,lo,Xn=l(()=>{"use strict";u();m();C();X();Jn="\u{1F5FF}",io="https://github.com/MeguminSama/VencordPlugins/raw/main/plugins/moyai/moyai.mp3",so=!0,Rt=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"||so&&e.message.author?.bot||!e.message.content||e.channelId!==he.getChannelId())return;let t=po(e.message.content);for(let n=0;n<t;n++)Yn(),await kn(300)},onReaction(e){if(e.optimistic||e.type!=="MESSAGE_REACTION_ADD"||e.channelId!==he.getChannelId())return;let t=e.emoji.name.toLowerCase();t!==Jn&&!t.includes("moyai")&&!t.includes("moai")||Yn()},start(){M.subscribe("MESSAGE_CREATE",this.onMessage),M.subscribe("MESSAGE_REACTION_ADD",this.onReaction)},stop(){M.unsubscribe("MESSAGE_CREATE",this.onMessage),M.unsubscribe("MESSAGE_REACTION_ADD",this.onReaction)}});lo=/<a?:\w*moy?ai\w*:\d{17,20}>/gi});var It,Zn=l(()=>{"use strict";u();m();It=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 Mt,er=l(()=>{"use strict";j();F();u();m();C();Mt=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(re.getCurrentUser().premiumType)},start(){if(this.canUseEmotes){console.info("[NitroBypass] Skipping start because you have nitro");return}let{getCustomEmojiById:e}=J("getCustomEmojiById");function t(n,r){return!n[r]||/\s/.test(n[r])?"":" "}this.preSend=A((n,r)=>{let{guildId:o}=this;for(let i of r.validNonShortcutEmojis){if(!i.require_colons||i.guildId===o&&!i.animated)continue;let p=`<${i.animated?"a":""}:${i.originalName||i.name}:${i.id}>`,c=i.url.replace(/\?size=[0-9]+/,"?size=48");r.content=r.content.replace(p,(f,E,w)=>`${t(w,E-1)}${c}${t(w,E+f.length)}`)}}),this.preEdit=Q((n,r,o)=>{let{guildId:i}=this;for(let[p,c,f]of o.content.matchAll(/(?<!\\)<a?:(\w+):(\d+)>/ig)){let E=e(f);if(E==null||E.guildId===i&&!E.animated||!E.require_colons)continue;let w=E.url.replace(/\?size=[0-9]+/,"?size=48");o.content=o.content.replace(p,(d,g,P)=>`${t(P,g-1)}${w}${t(P,g+d.length)}`)}})},stop(){D(this.preSend),K(this.preEdit)}})});var Nt,tr=l(()=>{"use strict";m();u();Nt=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 At,nr=l(()=>{"use strict";u();j();m();At=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=A((e,t)=>this.removeBetas(t))},stop(){D(this.preSend)}})});var Dt,rr=l(()=>{"use strict";u();m();Dt=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 Ft,or=l(()=>{"use strict";u();Ft=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 Lt,ir=l(()=>{"use strict";m();u();Lt=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 Ot,sr=l(()=>{"use strict";u();m();Ot=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:""}}]})});var Ut,ar=l(()=>{"use strict";m();u();Ut=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"}]}]})});function cr(){W=-1}function lr(e){if(!e.ctrlKey&&!e.metaKey||e.key!=="ArrowUp"&&e.key!=="ArrowDown")return;let t=uo.getChannelId(),n=mo.getChannel(t),r=fo.getMessages(t).toArray().reverse();if(e.key==="ArrowUp"?W+=1:e.key==="ArrowDown"&&(W=Math.max(-1,W-1)),W>r.length&&(W=r.length),W<0)return void M.dispatch({type:"DELETE_PENDING_REPLY",channelId:t});M.dispatch({type:"CREATE_PENDING_REPLY",channel:n,message:r[W],showMentionToggle:n.guild_id!==null})}var uo,mo,fo,$t,W,dr=l(()=>{"use strict";u();m();C();F();X();uo=ne(x.byProps(["getChannelId"])),mo=ne(x.byProps(["getChannel"])),fo=ne(x.byProps(["getRawMessages"])),$t=s({name:"Quickreply",authors:[a.obscurity],description:"Reply to messages faster (ctrl + direction)",start(){M.subscribe("DELETE_PENDING_REPLY",cr),document.addEventListener("keydown",lr)},stop(){M.unsubscribe("DELETE_PENDING_REPLY",cr),document.removeEventListener("keydown",lr)}}),W=-1});var Vt,pr=l(()=>{"use strict";u();m();Vt=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 le,Ne=l(()=>{le="516f8c4"});var Bt,ur=l(()=>{"use strict";u();Ne();m();Bt=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 ", "${le}${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 Gt,mr=l(()=>{"use strict";u();m();Gt=s({name:"SilentTyping",authors:[a.Ven],description:"Hide that you are typing",patches:[{find:"startTyping:",replacement:{match:/startTyping:.+?,stop/,replace:"startTyping:()=>{},stop"}}]})});var jt,fr=l(()=>{"use strict";u();j();m();jt=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]}
${this.unindent(n.slice(1).join(`
`))}
${r}`})},start(){this.preSend=A((e,t)=>this.unindentMsg(t)),this.preEdit=Q((e,t,n)=>this.unindentMsg(n))},stop(){D(this.preSend),K(this.preEdit)}})});function ho(e){return e.split(" ").map(t=>{let n=!1,r=t.toLowerCase();if(t.length<4)return t;for(let[o,i]of go)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+" "+gr[Math.floor(Math.random()*gr.length)]),t=t.replaceAll("r","w").replaceAll("l","w")),t}).join(" ")}var gr,go,Ht,hr=l(()=>{"use strict";u();ce();gr=["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*"],go=[["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"]];Ht=s({name:"UwUifier",description:"Simply uwuify commands",authors:[{name:"ECHO",id:712639419785412668n}],dependencies:["CommandsAPI"],commands:[{name:"uwuify",description:"uwuifies your messages",options:[Ee],execute:e=>({content:ho(_e(e,"message",""))})}]})});var Ae,Wt,yr=l(()=>{"use strict";m();q();u();Ae="Vencord.Plugins.plugins.ViewIcons.openImage(",Wt=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){VencordNative.ipc.invoke(h.OPEN_EXTERNAL,e)},patches:[{find:"onAddFriend:",replacement:{match:/\{src:(.{1,2}),avatarDecoration/,replace:(e,t)=>`{src:${t},onClick:()=>${Ae}${t}.replace(/\\?.+$/, "")+"?size=2048"),avatarDecoration`}},{find:"().popoutNoBannerPremium",replacement:{match:/style:.{0,10}\{\},(.{1,2})\)/,replace:(e,t)=>`onClick:${t}.backgroundImage&&(()=>${Ae}${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:()=>${Ae}_guild.getIconURL(void 0,true)+"size=2048")}),_guild.banner&&${n}(${t},{id:"viewicons-copy-banner",label:"View Banner",action:()=>${Ae}Vencord.Webpack.findByProps("getGuildBannerURL").getGuildBannerURL(_guild).replace(/\\?size=.+/, "?size=2048"))}),${o}])`}]}]})});var zt,Er=l(()=>{"use strict";u();m();zt=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(${t}==${n}.Z.Types.BOT&&arguments[0].user.isNonUserBot()){${t}=${n}.Z.Types.WEBHOOK}${e}`}}]})});var R,De=l(()=>{fn();gn();hn();yn();En();_n();Sn();Pn();Nn();An();Dn();Bn();Gn();jn();Hn();Wn();zn();Kn();Xn();Zn();er();tr();nr();rr();or();ir();sr();ar();dr();pr();ur();mr();fr();hr();yr();Er();R={[je.name]:je,[He.name]:He,[We.name]:We,[ze.name]:ze,[qe.name]:qe,[Qe.name]:Qe,[Ke.name]:Ke,[rt.name]:rt,[dt.name]:dt,[ut.name]:ut,[mt.name]:mt,[bt.name]:bt,[xt.name]:xt,[wt.name]:wt,[Pt.name]:Pt,[Tt.name]:Tt,[Ct.name]:Ct,[kt.name]:kt,[Rt.name]:Rt,[It.name]:It,[Mt.name]:Mt,[Nt.name]:Nt,[At.name]:At,[Dt.name]:Dt,[Ft.name]:Ft,[Lt.name]:Lt,[Ot.name]:Ot,[Ut.name]:Ut,[$t.name]:$t,[Vt.name]:Vt,[Bt.name]:Bt,[Gt.name]:Gt,[jt.name]:jt,[Ht.name]:Ht,[Wt.name]:Wt,[zt.name]:zt}});function _r(e,t=e,n=""){return new Proxy(e,{get(r,o){let i=r[o];return typeof i=="object"&&!Array.isArray(i)?_r(i,t,`${n}${n&&"."}${o}`):i},set(r,o,i){if(r[o]===i)return!0;r[o]=i;let p=`${n}${n&&"."}${o}`;for(let c of Fe)(!c._path||c._path===p)&&c(i,p);return VencordNative.ipc.invoke(h.SET_SETTINGS,JSON.stringify(t,null,4)),!0}})}function Sr(){let[,e]=S.useReducer(()=>({}),{});return S.useEffect(()=>(Fe.add(e),()=>void Fe.delete(e)),[]),$}function br(e,t){t._path=e,Fe.add(t)}var Se,de,Fe,$,be=l(()=>{"use strict";De();q();C();X();Se={notifyAboutUpdates:!0,useQuickCss:!0,plugins:{}};for(let e in R)Se.plugins[e]={enabled:R[e].required??!1};try{de=JSON.parse(VencordNative.ipc.sendSync(h.GET_SETTINGS));for(let e in Se)de[e]??=Se[e];Ie(de,Se)}catch(e){console.error("Corrupt settings file. ",e),de=Ie({},Se)}Fe=new Set;$=_r(de)});var Kt={};N(Kt,{patches:()=>xr,plugins:()=>yo,startAllPlugins:()=>qt,startPlugin:()=>xe,stopPlugin:()=>Qt});function qt(){for(let e in R)$.plugins[e].enabled&&xe(R[e])}function xe(e){if(e.start){if(O.info("Starting plugin",e.name),e.started)return O.warn(`${e.name} already started`),!1;try{e.start(),e.started=!0}catch(t){return O.error(`Failed to start ${e.name}
`,t),!1}}if(e.commands?.length){O.info("Registering commands of plugin",e.name);for(let t of e.commands)try{gt(t,e.name)}catch(n){return O.error(`Failed to register command ${t.name}
`,n),!1}}return!0}function Qt(e){if(e.stop){if(O.info("Stopping plugin",e.name),!e.started)return O.warn(`${e.name} already stopped`),!1;try{e.stop(),e.started=!1}catch(t){return O.error(`Failed to stop ${e.name}
`,t),!1}}if(e.commands?.length){O.info("Unregistering commands of plugin",e.name);for(let t of e.commands)try{ht(t.name)}catch(n){return O.error(`Failed to unregister command ${t.name}
`,n),!1}}return!0}var O,yo,xr,we=l(()=>{"use strict";De();ce();be();te();O=new k("PluginManager","#a6d189"),yo=R,xr=[];for(let e of Object.values(R))if(e.patches&&$.plugins[e.name].enabled)for(let t of e.patches)t.plugin=e.name,Array.isArray(t.replacement)||(t.replacement=[t.replacement]),xr.push(t)});var sn={};N(sn,{UpdateLogger:()=>ue,changes:()=>z,checkForUpdates:()=>Ce,getRepo:()=>rn,isNewer:()=>Le,isOutdated:()=>Te,rebuild:()=>on,update:()=>nn,updateError:()=>me});async function pe(e){let t=await e;if(t.ok)return t.value;throw me=t.error,t.error}async function Ce(){return z=await pe(VencordNative.ipc.invoke(h.GET_UPDATES)),z.some(e=>e.hash===le)?(Le=!0,Te=!1):Te=z.length>0}async function nn(){if(!Te)return!0;let e=await pe(VencordNative.ipc.invoke(h.UPDATE));return e&&(Te=!1),e}function rn(){return pe(VencordNative.ipc.invoke(h.GET_REPO))}async function on(){let e=await pe(VencordNative.ipc.invoke(h.GET_HASHES));if(!await pe(VencordNative.ipc.invoke(h.BUILD)))throw new Error("The Build failed. Please try manually building the new update");let t=await pe(VencordNative.ipc.invoke(h.GET_HASHES));return e["patcher.js"]!==t["patcher.js"]||e["preload.js"]!==t["preload.js"]}var ue,Te,Le,me,z,Oe=l(()=>{"use strict";q();te();Ne();ue=new k("Updater","white"),Te=!1,Le=!1});function ve(e){return Vencord.Webpack.Common.React.createElement(oe,{className:e.className,style:{padding:"2em",backgroundColor:"#e7828430",borderColor:"#e78284",color:"var(--text-normal)",...e.style}},e.children)}var ln=l(()=>{"use strict";C()});var _o,Tr,Cr,V,dn=l(()=>{"use strict";te();C();ln();_o="#e78284",Tr=new k("React ErrorBoundary",_o),Cr={},V=class extends S.Component{static wrap(t){return n=>Vencord.Webpack.Common.React.createElement(V,null,Vencord.Webpack.Common.React.createElement(t,{...n}))}state={error:Cr,message:""};static getDerivedStateFromError(t){return{error:t?.stack?.replace(/https:\/\/\S+\/assets\//g,"")||t?.message||String(t)}}componentDidCatch(t,n){this.props.onError?.(t,n),Tr.error(`A component threw an Error
`,t),Tr.error("Component Stack",n.componentStack)}render(){return this.state.error===Cr?this.props.children:this.props.fallback?Vencord.Webpack.Common.React.createElement(this.props.fallback,{children:this.props.children,error:this.state.error}):Vencord.Webpack.Common.React.createElement(ve,{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,Vencord.Webpack.Common.React.createElement("pre",null,this.state.error)))}}});function Ue(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 pn=l(()=>{"use strict"});var $e,vr=l(()=>{"use strict";$e=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 un(e){b.show({message:e,type:b.Type.FAILURE,id:b.genId(),options:{position:b.Position.BOTTOM}})}var kr,Rr=l(()=>{"use strict";X();De();be();q();C();dn();we();we();pn();vr();kr=V.wrap(function(){let[t,,n]=Re(()=>VencordNative.ipc.invoke(h.GET_SETTINGS_DIR),"Loading..."),r=Sr(),o=S.useMemo(()=>new $e,[]);S.useEffect(()=>()=>void(o.hasChanges&&Z.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&&", ",se.parse("`"+c+"`"))))),confirmText:"Restart now",cancelText:"Later!",onConfirm:()=>location.reload()})),[]);let i=S.useMemo(()=>{let c={};for(let f in R){let E=R[f].dependencies;if(E)for(let w of E)c[w]??=[],c[w].push(f)}return c},[]),p=S.useMemo(()=>Object.values(R).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(Ue,{className:ge(L.marginBottom20)},Vencord.Webpack.Common.React.createElement(T,{onClick:()=>window.DiscordNative.app.relaunch(),size:T.Sizes.SMALL,color:T.Colors.GREEN},"Reload"),Vencord.Webpack.Common.React.createElement(T,{onClick:()=>window.DiscordNative.fileManager.showItemInFolder(t),size:T.Sizes.SMALL,disabled:n},"Launch Directory"),Vencord.Webpack.Common.React.createElement(T,{onClick:()=>VencordNative.ipc.invoke(h.OPEN_QUICKCSS),size:T.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:"Enable QuickCSS"},"Use QuickCss"),!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:ge(L.marginTop20,L.marginBottom8)},"Plugins"),p.map(c=>{let f=i[c.name]?.filter(w=>r.plugins[w].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:w=>{r.plugins[c.name].enabled=w;let d=Boolean(c.patches?.length);w?(c.dependencies?.forEach(g=>{let P=R[g];d||=Boolean(P.patches?.length&&!r.plugins[g].enabled),r.plugins[g].enabled=!0,!d&&!P.started&&!xe(P)&&un(`Failed to start dependency ${g}. Check the console for more info.`)}),!d&&!c.started&&!xe(c)&&un(`Failed to start plugin ${c.name}. Check the console for more info.`)):(c.started||!c.start&&c.commands?.length)&&!Qt(c)&&un(`Failed to stop plugin ${c.name}. Check the console for more info.`),d&&o.handleChange(c.name)},note:c.description,tooltipNote:c.required?"This plugin is required. Thus you cannot disable it.":E?`${vn(f)} ${f.length===1?"depends":"depend"} on this plugin. Thus you cannot disable it.`:null},c.name)}))})});function mn(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 Ir=l(()=>{"use strict"});function Mr(e,t){return async()=>{e(!0);try{await t()}catch(r){if(ue.error("Failed to update",r),r)if(r.code&&r.cmd){let{code:o,path:i,cmd:p,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 \`${p}\`:
`;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.`;Z.show({title:"Oops!",body:Vencord.Webpack.Common.React.createElement(ve,null,n.split(`
`).map(o=>Vencord.Webpack.Common.React.createElement("div",null,se.parse(o))))})}finally{e(!1)}}}function Nr({updates:e,repo:t,repoPending:n}){return Vencord.Webpack.Common.React.createElement(oe,{style:{padding:".5em"}},e.map(({hash:r,author:o,message:i})=>Vencord.Webpack.Common.React.createElement("div",null,Vencord.Webpack.Common.React.createElement(mn,{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 So(e){let[t,n]=S.useState(z),[r,o]=S.useState(!1),[i,p]=S.useState(!1),c=t.length>0;return Vencord.Webpack.Common.React.createElement(Vencord.Webpack.Common.React.Fragment,null,!t&&me?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(ve,{style:{padding:"1em"}},Vencord.Webpack.Common.React.createElement("p",null,me.stderr||me.stdout||"An unknown error occurred"))):Vencord.Webpack.Common.React.createElement(_.FormText,{className:L.marginBottom8},c?`There are ${t.length} Updates`:"Up to Date!"),c&&Vencord.Webpack.Common.React.createElement(Nr,{updates:t,...e}),Vencord.Webpack.Common.React.createElement(Ue,{className:ge(L.marginBottom8,L.marginTop8)},c&&Vencord.Webpack.Common.React.createElement(T,{size:T.Sizes.SMALL,disabled:i||r,onClick:Mr(p,async()=>{if(await nn()){n([]);let f=await on();await new Promise(E=>{Z.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(T,{size:T.Sizes.SMALL,disabled:i||r,onClick:Mr(o,async()=>{await Ce()?n(z):(n([]),b.show({message:"No updates found!",id:b.genId(),type:b.Type.MESSAGE,options:{position:b.Position.BOTTOM}}))})},"Check for Updates")))}function bo(e){return Vencord.Webpack.Common.React.createElement(Vencord.Webpack.Common.React.Fragment,null,Vencord.Webpack.Common.React.createElement(_.FormText,{className:L.marginBottom8},"Your local copy has more recent commits. Please stash or reset them."),Vencord.Webpack.Common.React.createElement(Nr,{...e,updates:z}))}var Ar,Dr=l(()=>{"use strict";Ne();Oe();C();pn();X();Ir();dn();ln();Ar=V.wrap(function(){let[t,n,r]=Re(rn,"Loading...");S.useEffect(()=>{n&&ue.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(mn,{href:t},t.split("/").slice(-2).join("/"))," (",le,")"),Vencord.Webpack.Common.React.createElement(_.FormDivider,null),Vencord.Webpack.Common.React.createElement(_.FormTitle,{tag:"h5"},"Updates"),Le?Vencord.Webpack.Common.React.createElement(bo,{...o}):Vencord.Webpack.Common.React.createElement(So,{...o}))})});var Fr={};N(Fr,{Settings:()=>kr,Updater:()=>Ar});var Lr=l(()=>{"use strict";Rr();Dr()});var wo={};N(wo,{Api:()=>tn,Components:()=>Or,Plugins:()=>Kt,QuickCss:()=>cn,Settings:()=>$,Updater:()=>sn,Webpack:()=>ct});q();var{localStorage:Be}=window,Hr={[h.GET_REPO]:()=>"",[h.GET_SETTINGS_DIR]:()=>"LocalStorage",[h.GET_QUICK_CSS]:()=>Be.getItem("VencordQuickCss"),[h.GET_SETTINGS]:()=>Be.getItem("VencordSettings")||"{}",[h.SET_SETTINGS]:e=>Be.setItem("VencordSettings",e),[h.GET_UPDATES]:()=>({ok:!0,value:[]}),[h.OPEN_EXTERNAL]:e=>open(e,"_blank"),[h.OPEN_QUICKCSS]:()=>{}};function Ge(e,...t){let n=Hr[e];if(!n)throw new Error(`Event ${e} not implemented.`);return n(...t)}window.VencordNative={getVersions:()=>({}),ipc:{send:(e,...t)=>void Ge(e,...t),sendSync:Ge,on(e,t){},off(e,t){},invoke:(e,...t)=>Promise.resolve(Ge(e,...t))}};we();F();var tn={};N(tn,{Commands:()=>St,MessageEvents:()=>nt,Notices:()=>en});j();var en={};N(en,{currentNotice:()=>Pe,nextNotice:()=>wr,noticesQueue:()=>Jt,popNotice:()=>Xt,showNotice:()=>Zt});F();var Yt;y(e=>e.show&&e.dismiss&&!e.suppressAll,e=>Yt=e);var Jt=[],Pe=null;function Xt(){Yt.dismiss()}function wr(){Pe=Jt.shift(),Pe&&Yt.show(...Pe,"VencordNotice")}function Zt(e,t,n){Jt.push(["GENERIC",e,t,n]),Pe||wr()}ce();Oe();var cn={};N(cn,{toggle:()=>an});be();q();var ee;async function an(e){ee?ee.disabled=!e:e&&(ee=document.createElement("style"),ee.id="vencord-custom-css",document.head.appendChild(ee),VencordNative.ipc.on(h.QUICK_CSS_UPDATE,(t,n)=>ee.innerText=n),ee.innerText=await VencordNative.ipc.invoke(h.GET_QUICK_CSS))}document.addEventListener("DOMContentLoaded",()=>{an($.useQuickCss),br("useQuickCss",an)});be();we();m();te();F();var Pr,U=new k("WebpackInterceptor","#8caaee");Object.defineProperty(window,G,{get:()=>Pr,set:e=>{e?.push!==Array.prototype.push&&(U.info(`Patching ${G}.push`),st(e),Eo(),delete window[G],window[G]=e),Pr=e},configurable:!0});function Eo(){function e(t){try{let n=t[1],{subscriptions:r,listeners:o}=Vencord.Webpack,{patches:i}=Vencord.Plugins;for(let p in n){let c=n[p],f=c.toString().replaceAll(`
`,""),E=c,w=new Set;n[p]=function(d,g,P){try{c(d,g,P)}catch(v){if(c===E)throw v;return U.error("Error in patched chunk",v),void E(d,g,P)}if(d.exports===window){Object.defineProperty(P.c,p,{value:P.c[p],enumerable:!1,configurable:!0,writable:!0});return}for(let v of o)try{v(g)}catch(B){U.error("Error in webpack listener",B)}for(let[v,B]of r)try{if(v(g))r.delete(v),B(g);else if(typeof g=="object"){g.default&&v(g.default)&&(r.delete(v),B(g.default));for(let I in g)I.length<3&&g[I]&&v(g[I])&&(r.delete(v),B(g[I]))}}catch(I){U.error("Error while firing callback for webpack chunk",I)}},n[p].toString=()=>c.toString(),n[p].original=E;for(let d=0;d<i.length;d++){let g=i[d];if(f.includes(g.find)){w.add(g.plugin);for(let P of g.replacement){let v=c,B=f;try{let I=f.replace(P.match,P.replace);I===f?(U.warn(`Patch by ${g.plugin} had no effect: ${P.match}`),U.debug(`Function Source:
`,f)):(f=I,c=(0,eval)(`// Webpack Module ${p} - Patched by ${[...w].join(", ")}
${I}
//# sourceURL=WebpackModule${p}`))}catch(I){U.error("Failed to apply patch of",g.plugin,I),U.debug(`Original Source
`,B),U.debug(`Patched Source
`,f),f=B,c=v,w.delete(g.plugin)}}i.splice(d--,1)}}}}catch(n){U.error("oopsie",n)}return e.original.call(window[G],t)}e.original=window[G].push,Object.defineProperty(window[G],"push",{get:()=>e,set:t=>e.original=t,configurable:!0})}Oe();F();C();Object.defineProperty(window,"IS_WEB",{get:()=>!window.DiscordNative,configurable:!0,enumerable:!0});var Or;async function xo(){await ot,qt(),Or=await Promise.resolve().then(()=>(Lr(),Fr));try{await Ce()&&$.notifyAboutUpdates&&setTimeout(()=>{Zt("A Vencord update is available!","View Update",()=>{Xt(),Me.open("VencordUpdater")})},1e4)}catch(e){ue.error("Failed to check for updates",e)}}xo();return Gr(wo);})();
//# sourceURL=VencordWeb