').concat(this.console.c(st()(e,"js",kt)),"")}},{key:"formatFn",value:function(e){return'
'.concat(this.formatJs(e.toString()),"")}},{key:"formatElName",value:function(e){var t=e.id,n=e.className,o=e.tagName.toLowerCase();if(""!==t&&(o+="#".concat(t)),de()(n)){var r="";_()(n.split(/\s+/g),(function(e){""!==e.trim()&&(r+=".".concat(e))})),o+=r}return o}},{key:"formatEl",value:function(e){var t=vt()();return this.elements[t]=e,this.console.c(''))}}])}(Ue());function St(e){var t=(e=Le()(e)).split(";"),n={};_()(t,(function(e){if(g()(e,":")){var t=i(e.split(":"),2),o=t[0],r=t[1];n[D()(o)]=D()(r)}})),n.display="inline-block",n["max-width"]="100%",delete n.width,delete n.height;var o="";return _()(n,(function(e,t){o+="".concat(t,":").concat(e,";")})),o}var Et=n(5820),Tt=n.n(Et),Ot=n(3981),Nt=n.n(Ot),jt=n(8105),Mt=n.n(jt),It=n(7005),zt=n.n(It),Bt=n(3497),Dt=n.n(Bt),Ft=n(5865),Rt=n.n(Ft),Lt=n(8862),Pt=n.n(Lt),Ht=n(7030),Gt=n.n(Ht),$t=n(961),Yt=n.n($t);function qt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(qt=function(){return!!e})()}var Qt,Ut=function(e){function t(e,n){var o,r,i,s,u,d=n.compName,h=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).theme,f=void 0===h?"light":h;return(0,a.A)(this,t),r=this,i=t,i=(0,l.A)(i),(o=(0,c.A)(r,qt()?Reflect.construct(i,s||[],(0,l.A)(r).constructor):i.apply(r,s))).subComponents=[],o.compName=d,o.c=W(d),o.options={},o.container=e,o.$container=$e()(e),o.$container.addClass(["luna-".concat(d),o.c("platform-".concat((u=Q()(),"os x"===u?"mac":u)))]),o.on("optionChange",(function(e,t,n){var r=o.c;"theme"===e&&(o.$container.rmClass(r("theme-".concat(n))).addClass(r("theme-".concat(t))),_()(o.subComponents,(function(e){return e.setOption("theme",t)})))})),o.setOption("theme",f),o}return(0,d.A)(t,e),(0,s.A)(t,[{key:"destroy",value:function(){var e=this;this.destroySubComponents();var t=this.$container,n=t.attr("class");_()(n.split(/\s+/),(function(n){y()(n,"luna-".concat(e.compName))&&t.rmClass(n)})),t.html(""),this.emit("destroy"),this.removeAllListeners()}},{key:"setOption",value:function(e,t){var n=this,o=this.options,r={};"string"==typeof e?r[e]=t:r=e,_()(r,(function(e,t){var r=o[t];o[t]=e,n.emit("optionChange",t,e,r)}))}},{key:"getOption",value:function(e){return this.options[e]}},{key:"addSubComponent",value:function(e){e.setOption("theme",this.options.theme),this.subComponents.push(e)}},{key:"removeSubComponent",value:function(e){Yt()(this.subComponents,(function(t){return t===e}))}},{key:"destroySubComponents",value:function(){_()(this.subComponents,(function(e){return e.destroy()})),this.subComponents=[]}},{key:"initOptions",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ge()(e,t),Mt()(this.options,e)}},{key:"find",value:function(e){return this.$container.find(this.c(e))}}])}(Ue()),Jt=n(2228),Wt=n.n(Jt);function Vt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Vt=function(){return!!e})()}e=n.hmd(e);var Kt=navigator.userAgent,Xt=Kt.indexOf("Android")>-1||Kt.indexOf("Adr")>-1,Zt=0,en=function(e){function t(e){var n,o,r,i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,a.A)(this,t),o=this,r=t,i=[e,{compName:"console"},s],r=(0,l.A)(r),(n=(0,c.A)(o,Vt()?Reflect.construct(r,i||[],(0,l.A)(o).constructor):r.apply(o,i))).spaceHeight=0,n.topSpaceHeight=0,n.bottomSpaceHeight=0,n.lastScrollTop=0,n.lastTimestamp=0,n.speedToleranceFactor=100,n.maxSpeedTolerance=2e3,n.minSpeedTolerance=100,n.logs=[],n.displayLogs=[],n.timer={},n.counter={},n.asyncList=[],n.asyncTimer=null,n.isAtBottom=!0,n.groupStack=new(zt()),n.selectedLog=null,n.onScroll=function(){var e=n.container,t=e.scrollHeight,o=e.offsetHeight,r=e.scrollTop;if(!(r<=0||o+r>t)){var i=!1;(t===o||Math.abs(t-o-r)<1)&&(i=!0),n.isAtBottom=i;var a=n.lastScrollTop,s=n.lastTimestamp,c=Nt()(),l=c-s,u=r-a,d=Math.abs(u/l)*n.speedToleranceFactor;l>1e3&&(d=1e3),d>n.maxSpeedTolerance&&(d=n.maxSpeedTolerance),d
]*>/g.test(e))try{var t=Ne().parse(e);return Be(t,(function(e){e.attrs&&e.attrs.class&&(e.attrs.class=De(e.attrs.class))})),Ne().stringify(t)}catch(t){return De(e)}return De(e)}function Be(e,t){for(var n=0,o=e.length;n3||Math.abs(a)>3)&&(r._isClick=!1);var s=r._oldX+i,c=r._oldY+a;s<0?s=0:s>n-t&&(s=n-t),c<0?c=0:c>o-t&&(c=o-t),r._$el.css({left:s,top:c})})),(0,c.A)(r,"_onDragEnd",(function(e){var t=r._$el;r._isClick&&r.emit("click"),r._onDragMove(e),Pe.off(pe()("move"),r._onDragMove),Pe.off(pe()("up"),r._onDragEnd);var n=r.config;n.get("rememberPos")&&n.set("pos",{x:Me(t.css("left")),y:Me(t.css("top"))}),t.rmClass("eruda-active")})),r._style=re(n(6945)),r._$container=e,r._initTpl(),r._bindEvent(),r._registerListener(),r}return(0,s.A)(t,e),(0,r.A)(t,[{key:"hide",value:function(){this._$el.hide()}},{key:"show",value:function(){this._$el.show()}},{key:"setPos",value:function(e){this._isOutOfRange(e)&&(e=this._getDefPos()),this._$el.css({left:e.x,top:e.y}),this.config.set("pos",e)}},{key:"getPos",value:function(){return this.config.get("pos")}},{key:"destroy",value:function(){re.remove(this._style),this._unregisterListener(),this._$el.remove()}},{key:"_isOutOfRange",value:function(e){e=e||this.config.get("pos");var t=this._getDefPos();return e.x>t.x+10||e.x<0||e.y<0||e.y>t.y+10}},{key:"_registerListener",value:function(){var e=this;this._scaleListener=function(){return ue()((function(){e._isOutOfRange()&&e._resetPos()}))},h.on(h.SCALE,this._scaleListener)}},{key:"_unregisterListener",value:function(){h.off(h.SCALE,this._scaleListener)}},{key:"_initTpl",value:function(){var e=this._$container;e.append(ze(' ')),this._$el=e.find(".eruda-entry-btn")}},{key:"_resetPos",value:function(e){var t=this.config,n=t.get("pos"),o=this._getDefPos();t.get("rememberPos")&&!e||(n=o),this.setPos(n)}},{key:"_bindEvent",value:function(){var e=this;this._$el.on(pe()("down"),this._onDragStart),he().on("change",(function(){return e._resetPos(!0)})),window.addEventListener("resize",(function(){return e._resetPos()}))}},{key:"initCfg",value:function(e){var t=this.config=ce.createCfg("entry-button",{rememberPos:!0,pos:this._getDefPos()});e.switch(t,"rememberPos","Remember Entry Button Position"),this._resetPos()}},{key:"_getDefPos",value:function(){var e=this._$el.get(0).offsetWidth+10;return{x:window.innerWidth-e,y:window.innerHeight-e}}}])}(u()),Ge=n(5458),$e=n(7622),Ye=Le=new(n.n($e)())("[Eruda]","warn");Le.formatter=function(e,t){return t.unshift(this.name),t};var qe=n(6097),Qe=n.n(qe),Ue=n(7e3),Je=n.n(Ue),We=n(9931),Ve=n.n(We),Ke=n(1009),Xe=n.n(Ke),Ze=n(5570),et=n.n(Ze),tt=n(1280),nt=n(9152),ot=n(9068);function rt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(rt=function(){return!!e})()}var it=function(e){function t(e){var r,s,l,u,d=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},h=d.defaults,f=void 0===h?{}:h,p=d.inline,v=void 0!==p&&p;return(0,o.A)(this,t),s=this,l=t,l=(0,a.A)(l),r=(0,i.A)(s,rt()?Reflect.construct(l,u||[],(0,a.A)(s).constructor):l.apply(s,u)),(0,c.A)(r,"_checkSafeArea",(function(){var e=r.$container;!function(){var e=!1,t=document.createElement("div");if(CSS.supports("padding-bottom: env(safe-area-inset-bottom)")?(t.style.paddingBottom="env(safe-area-inset-bottom)",e=!0):CSS.supports("padding-bottom: constant(safe-area-inset-bottom)")&&(t.style.paddingBottom="constant(safe-area-inset-bottom)",e=!0),e){document.body.appendChild(t);var n=parseInt(window.getComputedStyle(t).paddingBottom);if(document.body.removeChild(t),n>0)return!0}return!1}()?e.rmClass(ze("safe-area")):e.addClass(ze("safe-area"))})),(0,c.A)(r,"_updateTabHeight",(function(e){r._tab.setOption("height",40*e),ue()((function(){r._tab.updateSlider()}))})),r._defCfg=H()({transparency:1,displaySize:80,theme:"System preference"},f),r._style=re(n(849)),r.$container=e,r._isShow=!1,r._opacity=1,r._tools={},r._isResizing=!1,r._resizeTimer=null,r._resizeStartY=0,r._resizeStartSize=0,r._inline=v,r._initTpl(),r._initTab(),r._initNotification(),r._initModal(),et()((function(){return r._checkSafeArea()})),r._bindEvent(),r}return(0,s.A)(t,e),(0,r.A)(t,[{key:"show",value:function(){var e=this;return this._isShow=!0,this._$el.show(),this._tab.updateSlider(),setTimeout((function(){e._$el.css("opacity",e._opacity)}),50),this.emit("show"),this}},{key:"hide",value:function(){var e=this;if(!this._inline)return this._isShow=!1,this.emit("hide"),this._$el.css({opacity:0}),setTimeout((function(){return e._$el.hide()}),300),this}},{key:"toggle",value:function(){return this._isShow?this.hide():this.show()}},{key:"add",value:function(e){var t=this._tab;if(!(e instanceof v)){var n=new v,o=n.init,r=n.show,i=n.hide,a=n.destroy;L()(e,{init:o,show:r,hide:i,destroy:a})}var s=e.name;if(!s)return Ye.error("You must specify a name for a tool");if(this._tools[s])return Ye.warn("Tool ".concat(s," already exists"));var c=s.replace(/\s+/g,"-");return this._$tools.prepend('')),e.init(this._$tools.find(".".concat(ze(c),".").concat(ze("tool"))),this),e.active=!1,this._tools[s]=e,"settings"===s?t.append({id:s,title:s}):t.insert(t.length-1,{id:s,title:s}),this}},{key:"remove",value:function(e){var t=this._tools;if(!t[e])return Ye.warn("Tool ".concat(e," doesn't exist"));this._tab.remove(e);var n=t[e];if(delete t[e],n.active){var o=B()(t);o.length>0&&this.showTool(t[Ae()(o)].name)}return n.destroy(),this}},{key:"removeAll",value:function(){var e=this;return _()(this._tools,(function(t){return e.remove(t.name)})),this}},{key:"get",value:function(e){var t=this._tools[e];if(t)return t}},{key:"showTool",value:function(e){if(this._curTool===e)return this;this._curTool=e;var t=this._tools,n=t[e];if(n){var o={};return _()(t,(function(e){e.active&&(o=e,e.active=!1,e.hide())})),n.active=!0,n.show(),this._tab.select(e),this.emit("showTool",e,o),this}}},{key:"initCfg",value:function(e){var t=this,n=this.config=ce.createCfg("dev-tools",this._defCfg);this._setTransparency(n.get("transparency")),this._setDisplaySize(n.get("displaySize")),this._setTheme(n.get("theme")),n.on("change",(function(e,n){switch(e){case"transparency":return t._setTransparency(n);case"displaySize":return t._setDisplaySize(n);case"theme":return t._setTheme(n)}})),e.separator().select(n,"theme","Theme",["System preference"].concat((0,Ge.A)(B()(re.getThemes())))),this._inline||e.range(n,"transparency","Transparency",{min:.2,max:1,step:.01}).range(n,"displaySize","Display Size",{min:40,max:100,step:1}),e.button("Restore defaults and reload",(function(){var e=je("local"),t=JSON.parse(JSON.stringify(e));_()(t,(function(t,n){E()(t)&&Xe()(n,"eruda")&&e.removeItem(n)})),window.location.reload()})).separator()}},{key:"notify",value:function(e,t){this._notification.notify(e,t)}},{key:"destroy",value:function(){re.remove(this._style),this.removeAll(),this._tab.destroy(),this._$el.remove(),window.removeEventListener("resize",this._checkSafeArea),h.off(h.SCALE,this._updateTabHeight)}},{key:"_setTheme",value:function(e){var t=this.$container;"System preference"===e&&(e=Ve()(Je().get())),V(e)?t.addClass(ze("dark")):t.rmClass(ze("dark")),re.setTheme(e)}},{key:"_setTransparency",value:function(e){Qe()(e)&&(this._opacity=e,this._isShow&&this._$el.css({opacity:e}))}},{key:"_setDisplaySize",value:function(e){this._inline&&(e=100),Qe()(e)&&this._$el.css({height:e+"%"})}},{key:"_initTpl",value:function(){var e=this.$container;e.append(ze('\n\n \n \n \n \n \n\n ')),this._$el=e.find(ze(".dev-tools")),this._$tools=this._$el.find(ze(".tools"))}},{key:"_initTab",value:function(){var e=this;this._tab=new ot.A(this._$el.find(ze(".tab")).get(0),{height:40}),this._tab.on("select",(function(t){return e.showTool(t)}))}},{key:"_initNotification",value:function(){this._notification=new tt.A(this._$el.find(ze(".notification")).get(0),{position:{x:"center",y:"top"}})}},{key:"_initModal",value:function(){nt.A.setContainer(this._$el.find(ze(".modal")).get(0))}},{key:"_bindEvent",value:function(){var e=this,t=this._$el.find(ze(".resizer")),n=this._$el.find(ze(".nav-bar")),o=g()(document);this._inline&&t.hide();var r=function(t){if(e._isResizing){t.preventDefault(),t.stopPropagation(),t=t.origEvent;var n=(e._resizeStartY-Fe("y",t))/window.innerHeight*100,o=e._resizeStartSize+n;o<40?o=40:o>100&&(o=100),e.config.set("displaySize",Se()(o.toFixed(2)))}},i=function(){clearTimeout(e._resizeTimer),e._isResizing=!1,t.css("height",10),o.off(pe()("move"),r),o.off(pe()("up"),i)};t.css("height",10),t.on(pe()("down"),(function(n){n.preventDefault(),n.stopPropagation(),n=n.origEvent,e._isResizing=!0,e._resizeStartSize=e.config.get("displaySize"),e._resizeStartY=Fe("y",n),t.css("height","100%"),o.on(pe()("move"),r),o.on(pe()("up"),i)})),n.on("contextmenu",(function(e){return e.preventDefault()})),this.$container.on("click",(function(e){return e.stopPropagation()})),window.addEventListener("resize",this._checkSafeArea),h.on(h.SCALE,this._updateTabHeight),Je().on("change",(function(){var t=e.config.get("theme");"System preference"===t&&e._setTheme(t)}))}}])}(u()),at=n(9993),st=n.n(at),ct=n(3957),lt=n.n(ct),ut=n(1976),dt=n.n(ut),ht=n(6962),ft=n.n(ht),pt=n(8609),vt=n.n(pt),mt=n(4236),gt=n.n(mt),bt=n(8988);function yt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(yt=function(){return!!e})()}function At(e,t,n,o){var r=(0,f.A)((0,a.A)(1&o?e.prototype:e),t,n);return 2&o&&"function"==typeof r?function(e){return r.apply(n,e)}:r}ft().start();var wt=function(e){function t(){var e,n,r,s,l=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).name,d=void 0===l?"console":l;return(0,o.A)(this,t),n=this,r=t,r=(0,a.A)(r),e=(0,i.A)(n,yt()?Reflect.construct(r,s||[],(0,a.A)(n).constructor):r.apply(n,s)),(0,c.A)(e,"_handleShow",(function(){vt()(e._$el.get(0))||e._logger.renderViewport()})),(0,c.A)(e,"_handleErr",(function(t){e._logger.error(t)})),u().mixin(e),e.name=d,e._selectedLog=null,e}return(0,s.A)(t,e),(0,r.A)(t,[{key:"init",value:function(e,n){At(t,"init",this,3)([e]),this._container=n,this._appendTpl(),this._initCfg(),this._initLogger(),this._exposeLogger(),this._bindEvent()}},{key:"show",value:function(){At(t,"show",this,3)([]),this._handleShow()}},{key:"overrideConsole",value:function(){var e=this,t=this._origConsole={},n=window.console;return xt.forEach((function(o){var r=t[o]=st();n[o]&&(r=t[o]=n[o].bind(n)),n[o]=function(){e[o].apply(e,arguments),r.apply(void 0,arguments)}})),this}},{key:"setGlobal",value:function(e,t){this._logger.setGlobal(e,t)}},{key:"restoreConsole",value:function(){var e=this;return this._origConsole?(xt.forEach((function(t){return window.console[t]=e._origConsole[t]})),delete this._origConsole,this):this}},{key:"catchGlobalErr",value:function(){return ft().addListener(this._handleErr),this}},{key:"ignoreGlobalErr",value:function(){return ft().rmListener(this._handleErr),this}},{key:"filter",value:function(e){var t=this._$filterText,n=this._logger;E()(e)?(t.text(e),n.setOption("filter",Te()(e))):dt()(e)?(t.text(I()(e)),n.setOption("filter",e)):lt()(e)&&(t.text("ƒ"),n.setOption("filter",e))}},{key:"destroy",value:function(){this._logger.destroy(),At(t,"destroy",this,3)([]),this._container.off("show",this._handleShow),this._style&&re.remove(this._style),this.ignoreGlobalErr(),this.restoreConsole(),this._rmCfg()}},{key:"_enableJsExecution",value:function(e){var t=this._$el,n=t.find(ze(".js-input"));e?(n.show(),t.rmClass(ze("js-input-hidden"))):(n.hide(),t.addClass(ze("js-input-hidden")))}},{key:"_appendTpl",value:function(){var e=this._$el;this._style=re(n(5067)),e.append(ze('\n\n \n All\n Info\n Warning\n Error\n \n \n \n\n \n\n \n \n \n\n '));var t=e.find(ze(".js-input")),o=t.find("textarea"),r=t.find(ze(".buttons"));H()(this,{_$control:e.find(ze(".control")),_$logs:e.find(ze(".logs-container")),_$inputContainer:t,_$input:o,_$inputBtns:r,_$filterText:e.find(ze(".filter-text"))})}},{key:"_initLogger",value:function(){var e=this.config,t=e.get("maxLogNum");t="infinite"===t?0:+t;var n=this._$control.find(ze(".level")),o=new bt.A(this._$logs.get(0),{asyncRender:e.get("asyncRender"),maxNum:t,showHeader:e.get("displayExtraInfo"),unenumerable:e.get("displayUnenumerable"),accessGetter:e.get("displayGetterVal"),lazyEvaluation:e.get("lazyEvaluation")});o.on("optionChange",(function(e,t){if("level"===e)n.each((function(){var e=g()(this),n=e.data("level");e[n===t||"all"===n&&$()(t)?"addClass":"rmClass"](ze("active"))}))})),e.get("overrideConsole")&&this.overrideConsole(),this._logger=o}},{key:"_exposeLogger",value:function(){var e=this,t=this._logger;["html"].concat(xt).forEach((function(n){return e[n]=function(){for(var o=arguments.length,r=new Array(o),i=0;i').concat(Tt()(e.data),""));var n=" ";e.reqHeaders&&(n=xe()(e.reqHeaders,(function(e,t){return' Empty \n ")})).join(""));var o="').concat(Tt()(t)," \n").concat(Tt()(e)," \n";e.resHeaders&&(o=xe()(e.resHeaders,(function(e,t){return' Empty \n ")})).join(""));var r="";if(e.resTxt){var i=e.resTxt;i.length>Ft&&(i=zt()(i,Ft)),r='').concat(Tt()(t)," \n").concat(Tt()(e)," \n').concat(Tt()(i),"")}var a='\n \n \n ').concat(Tt()(e.url),'\n \n\n\n ').concat(t,'\n");this._$container.html(a).show(),this._detailData=e}},{key:"hide",value:function(){this._$container.hide(),this.emit("hide")}},{key:"_bindEvent",value:function(){var e=this,t=this._devtools;this._$container.on("click",ze(".back"),(function(){return e.hide()})).on("click",ze(".copy-res"),this._copyRes).on("click",ze(".http .response"),(function(){var t=e._detailData,o=t.resTxt;if(Mt()(o))return n("object",o);switch(t.subType){case"css":return n("css",o);case"html":return n("html",o);case"javascript":return n("js",o);case"json":return n("object",o)}return"image"===t.type?n("img",t.url):void 0}));var n=function(e,n){var o=t.get("sources");o&&(o.set(e,n),t.showTool("sources"))}}}])}(u()),Ft=1e5,Rt=n(5865),Lt=n.n(Rt),Pt=n(6476),Ht=n.n(Pt),Gt=n(5334),$t=n(2480),Yt=n(6192),qt=n(5689);function Qt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function Ut(e){for(var t=1;t\n\nResponse Headers
\n\n \n ').concat(o,'\n \n
\n\n\n ").concat(r,"\nRequest Headers
\n\n \n ').concat(n,"\n \n
\n=300)&&(n.hasErr=!0),i&&(n.resHeaders=i,e._updateType(n)),n.render()}})),(0,c.A)(e,"_loadingFinished",(function(t){var n=e._requests[t.requestId];if(e._isRecording&&n){var o=1e3*t.timestamp;n.time=o-n.startTime,n.displayTime=kt()(n.time),n.size=t.encodedDataLength,n.done=!0,n.resTxt=Wt.domain("Network").getResponseBody({requestId:t.requestId}).body,n.render()}})),(0,c.A)(e,"_loadingFailed",(function(t){var n=e._requests[t.requestId];if(e._isRecording&&n){var o=1e3*t.timestamp;n.time=o-n.startTime,n.displayTime=kt()(n.time),n.hasErr=!0,n.status=0,n.done=!0,n.render()}})),(0,c.A)(e,"_copyCurl",(function(){var t=e._selectedRequest;Nt()(function(e){var t=nn()();"windows"===t&&(t="win");var n=[],o=rn()(["accept-encoding","host","method","path","scheme","version"]),r="win"===t?function(e){var t=/[\r\n]/.test(e)?'^"':'"';return t+e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/[^a-zA-Z0-9\s_\-:=+~'\/.',?;()*`&]/g,"^$&").replace(/%(?=[a-zA-Z0-9_])/g,"%^").replace(/\r?\n/g,"^\n\n")+t}:function(e){return/[\0-\x1F\x7F-\x9F!]|\'/.test(e)?"$'"+e.replace(/\\/g,"\\\\").replace(/\'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\0-\x1F\x7F-\x9F!]/g,(function(e){for(var t=e.charCodeAt(0).toString(16);t.length<4;)t="0"+t;return"\\u"+t}))+"'":"'"+e+"'"};n.push(r(e.url()).replace(/[[{}\]]/g,"\\$&"));var i="GET",a=[],s=e.requestFormData();s&&(a.push("--data-raw "+r(s)),o["content-length"]=!0,i="POST"),e.requestMethod!==i&&n.push("-X "+r(e.requestMethod));for(var c=e.requestHeaders(),l=0;l =3?"win"===t?" ^\n ":" \\\n ":" ")}({requestMethod:t.method,url:function(){return t.url},requestFormData:function(){return t.data},requestHeaders:function(){var e=t.reqHeaders||{};return H()(e,{"User-Agent":navigator.userAgent,Referer:location.href}),xe()(e,(function(e,t){return{name:t,value:e}}))}})),e._container.notify("Copied",{icon:"success"})})),(0,c.A)(e,"_toggleRecording",(function(){e._$control.find(ze(".record")).toggleClass(ze("recording")),e._isRecording=!e._isRecording})),(0,c.A)(e,"_showDetail",(function(){e._selectedRequest&&(e._splitMode&&e._$network.css("width","50%"),e._detail.show(e._selectedRequest))})),(0,c.A)(e,"_updateScale",(function(t){e._splitMediaQuery.setQuery("screen and (min-width: ".concat(680*t,"px)"))})),e._style=re(n(2003)),e.name="network",e._requests={},e._selectedRequest=null,e._isRecording=!0,e}return(0,s.A)(t,e),(0,r.A)(t,[{key:"init",value:function(e,n){sn(t,"init",this,3)([e]),this._container=n,this._initTpl(),this._detail=new Dt(this._$detail,n),this._splitMediaQuery=new(en())("screen and (min-width: 680px)"),this._splitMode=this._splitMediaQuery.isMatch(),this._requestDataGrid=new Vt.A(this._$requests.get(0),{columns:[{id:"name",title:"Name",sortable:!0,weight:30},{id:"method",title:"Method",sortable:!0,weight:14},{id:"status",title:"Status",sortable:!0,weight:14},{id:"type",title:"Type",sortable:!0,weight:14},{id:"size",title:"Size",sortable:!0,weight:14},{id:"time",title:"Time",sortable:!0,weight:14}]}),this._resizeSensor=new(Xt())(e.get(0)),this._bindEvent()}},{key:"show",value:function(){sn(t,"show",this,3)([]),this._updateDataGridHeight()}},{key:"clear",value:function(){this._requests={},this._requestDataGrid.clear()}},{key:"requests",value:function(){var e=[];return _()(this._requests,(function(t){e.push(t)})),e}},{key:"_updateDataGridHeight",value:function(){var e=this._$el.offset().height-this._$control.offset().height;this._requestDataGrid.setOption({minHeight:e,maxHeight:e})}},{key:"_updateType",value:function(e){var t=function(e){if(!e)return"unknown";var t=e.split(";")[0].split("/");return{type:t[0],subType:Ae()(t)}}(e.resHeaders["content-type"]||""),n=t.type,o=t.subType;e.type=n,e.subType=o}},{key:"_updateButtons",value:function(){var e=this._$control,t=e.find(ze(".show-detail")),n=e.find(ze(".copy-curl")),o=ze("icon-disabled");t.addClass(o),n.addClass(o),this._selectedRequest&&(t.rmClass(o),n.rmClass(o))}},{key:"_bindEvent",value:function(){var e=this,t=this._$control,n=this._$filterText,o=this._requestDataGrid,r=this;t.on("click",ze(".clear-request"),(function(){return e.clear()})).on("click",ze(".show-detail"),this._showDetail).on("click",ze(".copy-curl"),this._copyCurl).on("click",ze(".record"),this._toggleRecording).on("click",ze(".filter"),(function(){nt.A.prompt("Filter").then((function(e){gt()(e)||(n.text(e),o.setOption("filter",Te()(e)))}))})),o.on("select",(function(t){var n=g()(t.container).data("id"),o=r._requests[n];e._selectedRequest=o,e._updateButtons(),e._splitMode&&e._showDetail()})),o.on("deselect",(function(){e._selectedRequest=null,e._updateButtons(),e._detail.hide()})),this._resizeSensor.addListener(Lt()((function(){return e._updateDataGridHeight()}),15)),this._splitMediaQuery.on("match",(function(){e._detail.hide(),e._splitMode=!0})),this._splitMediaQuery.on("unmatch",(function(){e._detail.hide(),e._splitMode=!1})),this._detail.on("hide",(function(){e._splitMode&&e._$network.css("width","100%")})),Wt.domain("Network").enable();var i=Wt.domain("Network");i.on("requestWillBeSent",this._reqWillBeSent),i.on("responseReceivedExtraInfo",this._resReceivedExtraInfo),i.on("responseReceived",this._resReceived),i.on("loadingFinished",this._loadingFinished),i.on("loadingFailed",this._loadingFailed),h.on(h.SCALE,this._updateScale)}},{key:"destroy",value:function(){sn(t,"destroy",this,3)([]),this._resizeSensor.destroy(),re.remove(this._style),this._splitMediaQuery.removeAllListeners();var e=Wt.domain("Network");e.off("requestWillBeSent",this._reqWillBeSent),e.off("responseReceivedExtraInfo",this._resReceivedExtraInfo),e.off("responseReceived",this._resReceived),e.off("loadingFinished",this._loadingFinished),h.off(h.SCALE,this._updateScale)}},{key:"_initTpl",value:function(){var e=this._$el;e.html(ze(' \n\n ')),this._$network=e.find(ze(".network")),this._$detail=e.find(ze(".detail")),this._$requests=e.find(ze(".requests")),this._$control=e.find(ze(".control")),this._$filterText=e.find(ze(".filter-text"))}}])}(v),ln=n(2708),un=n.n(ln),dn=n(1167),hn=n.n(dn),fn=n(7181),pn=n.n(fn),vn=n(5452),mn=n(96),gn=n.n(mn),bn=n(896),yn=n.n(bn),An=n(438),wn=n.n(An),xn=n(6493),_n=n.n(xn),kn=n(6186),Cn=n.n(kn),Sn=n(5241),En=n.n(Sn),Tn=n(2208),On=n.n(Tn),Nn=n(5145),jn=n.n(Nn);function Mn(e){for(var t={},n=0,o=e.length;n\n \n \n \n \n \n \n\n \no?o:n,i=0;i o?1:n (t=Fn(t))?1:e 1&&void 0!==arguments[1]?arguments[1]:{}).noAttr,n=void 0!==t&&t;if(e.nodeType===Node.TEXT_NODE)return'(text)');if(e.nodeType===Node.COMMENT_NODE)return'\x3c!--\x3e');if(pn()(e))return'#shadow-root');var o=e.id,r=e.className,i=e.attributes,a=''.concat(e.tagName.toLowerCase(),"");if(""!==o&&(a+='#'.concat(o,"")),E()(r)){var s="";_()(r.split(/\s+/g),(function(e){""!==e.trim()&&(s+=".".concat(e))})),a+=''.concat(s,"")}return n||_()(i,(function(e){var t=e.name;"id"!==t&&"class"!==t&&"style"!==t&&(a+=' '.concat(t,'="').concat(e.value,'"'))})),a}var Pn=function(){return(0,r.A)((function e(t,n){var r=this;(0,o.A)(this,e),(0,c.A)(this,"hide",(function(){r._$container.hide(),r._disableObserver(),Wt.domain("Overlay").hideHighlight()})),(0,c.A)(this,"_highlight",(function(e){var t=r._curEl,n={showInfo:!1};e&&"all"!==e?"margin"===e?n.marginColor="rgba(246, 178, 107, .66)":"border"===e?n.borderColor="rgba(255, 229, 153, .66)":"padding"===e?n.paddingColor="rgba(147, 196, 125, .55)":"content"===e&&(n.contentColor="rgba(111, 168, 220, .66)"):H()(n,{showInfo:!0,contentColor:"rgba(111, 168, 220, .66)",paddingColor:"rgba(147, 196, 125, .55)",borderColor:"rgba(255, 229, 153, .66)",marginColor:"rgba(246, 178, 107, .66)"});var o=Wt.domain("DOM").getNodeId({node:t}).nodeId;Wt.domain("Overlay").highlightNode({nodeId:o,highlightConfig:n})})),this._$container=t,this._devtools=n,this._curEl=document.documentElement,this._initObserver(),this._initCfg(),this._initTpl(),this._bindEvent()}),[{key:"show",value:function(e){this._curEl=e,this._rmDefComputedStyle=!0,this._computedStyleSearchKeyword="",this._enableObserver(),this._render(),this._highlight()}},{key:"destroy",value:function(){this._disableObserver(),this.restoreEventTarget(),this._rmCfg()}},{key:"overrideEventTarget",value:function(){var e=Wn(),t=this._origAddEvent=e.addEventListener,n=this._origRmEvent=e.removeEventListener;e.addEventListener=function(e,n,o){!function(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!un()(e)||!lt()(n)||!_n()(o))return;var r=e.erudaEvents=e.erudaEvents||{};r[t]=r[t]||[],r[t].push({listener:n,listenerStr:n.toString(),useCapture:o})}(this,e,n,o),t.apply(this,arguments)},e.removeEventListener=function(e,t,o){!function(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!un()(e)||!lt()(n)||!_n()(o))return;var r=e.erudaEvents;if(!r||!r[t])return;for(var i=r[t],a=0,s=i.length;a \n \n \n \n \n\n \n \n \n \n');e.html(t),this._$elementName=e.find(ze(".element-name")),this._$attributes=e.find(ze(".attributes")),this._$styles=e.find(ze(".styles")),this._$listeners=e.find(ze(".listeners")),this._$computedStyle=e.find(ze(".computed-style"));var n=En()("div");this._$boxModel=g()(n),this._boxModel=new Rn.A(n)}},{key:"_toggleAllComputedStyle",value:function(){this._rmDefComputedStyle=!this._rmDefComputedStyle,this._render()}},{key:"_render",value:function(){var e=this._getData(this._curEl),t=this._$attributes,n=this._$elementName,o=this._$styles,r=this._$computedStyle,i=this._$listeners;n.html(e.name);var a="";St()(e.attributes)||(a=xe()(e.attributes,(function(e){var t=e.name,n=e.value;return' Empty \n ")})).join("")),a='').concat(Tt()(t),' \n').concat(n," \nAttributes
\n\n"),t.html(a);var s="";if(St()(e.styles))o.hide();else{var c=xe()(e.styles,(function(e){var t=e.selectorText,n=e.style;return n=xe()(n,(function(e,t){return'\n \n ').concat(a," \n \n
\n').concat(Tt()(t),": ").concat(e,";")})).join(""),'\n")})).join("");s='').concat(Tt()(t)," {\n ").concat(n,"\n}\nStyles
\n\n ').concat(c,"\n"),o.html(s).show()}var l="";if(e.computedStyle){var u=ze('\n \n');e.rmDefComputedStyle&&(u=ze('\n \n')),l="\n Computed Style\n ".concat(u,'\n
\n \n\n \n\n ').concat(e.computedStyleSearchKeyword?'').concat(Tt()(e.computedStyleSearchKeyword),""):"",'\n\n"),r.html(l).show(),this._boxModel.setOption("element",this._curEl),r.find(ze(".box-model")).append(this._$boxModel.get(0))}else r.text("").hide();var d="";e.listeners?(d=xe()(e.listeners,(function(e,t){return e=xe()(e,(function(e){var t=e.useCapture,n=e.listenerStr;return"\n \n ').concat(xe()(e.computedStyle,(function(e,t){return'
\n\n ")})).join(""),"\n \n').concat(Tt()(t)," \n").concat(e," \n").concat(Tt()(n)," ")})).join(""),'\n")})).join(""),d='').concat(Tt()(t),'\n\n ').concat(e,"\n
\nEvent Listeners
\n\n ').concat(d," \n"),i.html(d).show()):i.hide(),this._$container.show()}},{key:"_getData",value:function(e){var t={},n=new Bn(e),o=e.className,r=e.id,i=e.attributes,a=e.tagName;t.computedStyleSearchKeyword=this._computedStyleSearchKeyword,t.attributes=Gn(i),t.name=Ln({tagName:a,id:r,className:o,attributes:i});var s=e.erudaEvents;if(s&&0!==B()(s).length&&(t.listeners=s),Un(a))return t;var c=n.getComputedStyle(),l=n.getMatchedCSSRules();l.unshift(function(e){for(var t={selectorText:"element.style",style:{}},n=0,o=e.length;n
| screen | '.concat(screen.width," * ").concat(screen.height," |
| viewport | ".concat(window.innerWidth," * ").concat(window.innerHeight," |
| pixel ratio | ".concat(window.devicePixelRatio," |
| os | '.concat(nn()()," |
| browser | ".concat(Do.name+" "+Do.version," |
]*>/g.test(e))try{var t=s.default.parse(e);return f(t,(function(e){e.attrs&&e.attrs.class&&(e.attrs.class=n(e.attrs.class))})),s.default.stringify(t)}catch(t){return n(e)}return n(e)}};var p,v="ontouchstart"in a.default,m={start:"touchstart",move:"touchmove",end:"touchend"},g={start:"mousedown",move:"mousemove",end:"mouseup"};t.drag=function(e){return v?m[e]:g[e]},t.eventClient=function(e,t){var n="x"===e?"clientX":"clientY";return t[n]?t[n]:t.changedTouches?t.changedTouches[0][n]:0},t.eventPage=function(e,t){var n="x"===e?"pageX":"pageY";return t[n]?t[n]:t.changedTouches?t.changedTouches[0][n]:0},t.measuredScrollbarWidth=function(){if((0,c.default)(p))return p;if(!document)return 16;var e=document.createElement("div"),t=document.createElement("div");return e.setAttribute("style","display: block; width: 100px; height: 100px; overflow: scroll;"),t.setAttribute("style","height: 200px"),e.appendChild(t),document.body.appendChild(e),p=e.offsetWidth-e.clientWidth,document.body.removeChild(e),p},t.hasVerticalScrollbar=function(e){return e.scrollHeight>e.offsetHeight},t.executeAfterTransition=function(e,t){if((0,h.default)(e))return t();var n=function(o){o.target===e&&(e.removeEventListener("transitionend",n),t())};e.addEventListener("transitionend",n)},t.pxToNum=function(e){return(0,u.default)(e.replace("px",""))},t.getPlatform=function(){var e=(0,d.default)();return"os x"===e?"mac":e},t.resetCanvasSize=function(e){e.width=Math.round(e.offsetWidth*window.devicePixelRatio),e.height=Math.round(e.offsetHeight*window.devicePixelRatio)}},3270:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return m}});var o={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},r=/([astvzqmhlc])([^astvzqmhlc]*)/gi,i=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;var a=function(e){var t=[],n=String(e).trim();return"M"!==n[0]&&"m"!==n[0]||n.replace(r,(function(e,n,r){var a=n.toLowerCase(),s=function(e){var t=e.match(i);return t?t.map(Number):[]}(r),c=n;if("m"===a&&s.length>2&&(t.push([c].concat(s.splice(0,2))),a="l",c="m"===c?"l":"L"),s.length
mr&&(mr=Jt,Re=fr)}}}Ne=Re,Re=I[Ne],ut+=Ne-Re+32768&32767}if(Me){Y[se++]=268435456|Yg[ke]<<18|Yv[Me];var Wr=Yg[ke]&31,O=Yv[Me]&31;re+=Dc[Wr]+Lc[O],++V[257+Wr],++J[O],Oe=f+ke,++$}else Y[se++]=e[f],++V[e[f]]}}d=Qv(e,u,s,Y,V,J,re,se,ve,f-ve,d),!s&&d&7&&(d=Xg(u,d+1,Vg))}return tS(c,0,r+Jg(d)+i)},$5=function(e,t,o,r,i){return U5(e,t.level==null?6:t.level,t.mem==null?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):12+t.mem,o,r,!i)};G5=typeof TextDecoder<"u"&&new TextDecoder,H5=0;try{G5.decode(Vg,{stream:!0}),H5=1}catch{}});async function iS(){let e=await lt("Vencord_cloudSecret")??{},t=eh();return e[t]?(await qr("Vencord_cloudSecret",o=>(o??={},o[`${t}:${Ba()}`]=o[t],delete o[t],o)),e[t]):e[`${t}:${Ba()}`]}async function z5(e){await qr("Vencord_cloudSecret",t=>(t??={},t[`${eh()}:${Ba()}`]=e,t))}async function Oc(){await qr("Vencord_cloudSecret",e=>(e??={},delete e[`${eh()}:${Ba()}`],e))}async function th(){if(await iS()!==void 0){he.cloud.authenticated=!0;return}try{let o=await fetch(new URL("/v1/oauth/settings",Pr()));var{clientId:e,redirectUri:t}=await o.json()}catch{ze({title:"Cloud Integration",body:"Setup failed (couldn't retrieve OAuth configuration)."}),he.cloud.authenticated=!1;return}ge(o=>n(ei,{...o,scopes:["identify"],responseType:"code",redirectUri:t,permissions:0n,clientId:e,cancelCompletesFlow:!1,callback:async({location:r})=>{if(!r){he.cloud.authenticated=!1;return}try{let i=await fetch(r,{headers:{Accept:"application/json"}}),{secret:s}=await i.json();s?(Ec.info("Authorized with secret"),await z5(s),ze({title:"Cloud Integration",body:"Cloud integrations enabled!"}),he.cloud.authenticated=!0):(ze({title:"Cloud Integration",body:"Setup failed (no secret returned?)."}),he.cloud.authenticated=!1)}catch(i){Ec.error("Failed to authorize",i),ze({title:"Cloud Integration",body:`Setup failed (${i.toString()}).`}),he.cloud.authenticated=!1}}}))}async function Xi(){let e=await iS();return window.btoa(`${e}:${Ba()}`)}var Ec,Pr,eh,Ba,oh=g(()=>{"use strict";a();Uo();Un();_();b();De();Ke();Ec=new ee("Cloud","#39b7e0"),Pr=()=>new URL(he.cloud.url),eh=()=>Pr().origin,Ba=()=>{let e=L.getCurrentUser()?.id;if(!e)throw new Error("User not yet logged in");return e}});function Ji(){window.VesktopNative.app.relaunch()}var Hn=g(()=>{"use strict";a()});function _c(e){let t=document.createElement("a");t.href=URL.createObjectURL(e),t.download=e.name,document.body.appendChild(t),t.click(),setImmediate(()=>{URL.revokeObjectURL(t.href),document.body.removeChild(t)})}function Fc(e){return new Promise(t=>{let o=document.createElement("input");o.type="file",o.style.display="none",o.accept=e,o.onchange=async()=>{t(o.files?.[0]??null)},document.body.appendChild(o),o.click(),setImmediate(()=>document.body.removeChild(o))})}var Bc=g(()=>{"use strict";a()});async function sS(e){try{var t=JSON.parse(e)}catch(o){throw console.log(e),new Error("Failed to parse JSON: "+String(o))}if("settings"in t&&"quickCss"in t)Object.assign(zn,t.settings),await VencordNative.settings.set(t.settings),await VencordNative.quickCss.set(t.quickCss);else throw new Error("Invalid Settings. Is this even a Vencord Settings file?")}async function aS({minify:e}={}){let t=VencordNative.settings.get(),o=await VencordNative.quickCss.get();return JSON.stringify({settings:t,quickCss:o},null,e?void 0:4)}async function lS(){let e=`vencord-settings-backup-${br().format("YYYY-MM-DD")}.json`,t=await aS(),o=new TextEncoder().encode(t);_c(new File([o],e,{type:"application/json"}))}async function uS(e=!0){if(!1){if(t)try{}catch(o){}}else{let t=await Fc("application/json");if(!t)return;let o=new FileReader;o.onload=async()=>{try{await sS(o.result),e&&W5()}catch(r){new ee("SettingsSync").error(r),e&&j5(r)}},o.readAsText(t)}}async function Vi(e){let t=await aS({minify:!0});try{let o=await fetch(new URL("/v1/settings",Pr()),{method:"PUT",headers:{Authorization:await Xi(),"Content-Type":"application/octet-stream"},body:oS(new TextEncoder().encode(t))});if(!o.ok){rn.error(`Failed to sync up, API returned ${o.status}`),ze({title:"Cloud Settings",body:`Could not synchronize settings to cloud (API returned ${o.status}).`,color:"var(--red-360)"});return}let{written:r}=await o.json();zn.cloud.settingsSyncVersion=r,VencordNative.settings.set(zn),rn.info("Settings uploaded to cloud successfully"),e&&ze({title:"Cloud Settings",body:"Synchronized settings to the cloud!",noPersist:!0})}catch(o){rn.error("Failed to sync up",o),ze({title:"Cloud Settings",body:`Could not synchronize settings to the cloud (${o.toString()}).`,color:"var(--red-360)"})}}async function Uc(e=!0,t=!1){try{let o=await fetch(new URL("/v1/settings",Pr()),{method:"GET",headers:{Authorization:await Xi(),Accept:"application/octet-stream","If-None-Match":he.cloud.settingsSyncVersion.toString()}});if(o.status===404)return rn.info("No settings on the cloud"),e&&ze({title:"Cloud Settings",body:"There are no settings in the cloud.",noPersist:!0}),!1;if(o.status===304)return rn.info("Settings up to date"),e&&ze({title:"Cloud Settings",body:"Your settings are up to date.",noPersist:!0}),!1;if(!o.ok)return rn.error(`Failed to sync down, API returned ${o.status}`),ze({title:"Cloud Settings",body:`Could not synchronize settings from the cloud (API returned ${o.status}).`,color:"var(--red-360)"}),!1;let r=Number(o.headers.get("etag")),i=he.cloud.settingsSyncVersion;if(!t&&rlocation.reload(),noPersist:!0}),!0}catch(o){return rn.error("Failed to sync down",o),ze({title:"Cloud Settings",body:`Could not synchronize settings from the cloud (${o.toString()}).`,color:"var(--red-360)"}),!1}}async function pS(){try{let e=await fetch(new URL("/v1/settings",Pr()),{method:"DELETE",headers:{Authorization:await Xi()}});if(!e.ok){rn.error(`Failed to delete, API returned ${e.status}`),ze({title:"Cloud Settings",body:`Could not delete settings (API returned ${e.status}).`,color:"var(--red-360)"});return}rn.info("Settings deleted from cloud successfully"),ze({title:"Cloud Settings",body:"Settings deleted from cloud!",color:"var(--green-360)"})}catch(e){rn.error("Failed to delete",e),ze({title:"Cloud Settings",body:`Could not delete settings (${e.toString()}).`,color:"var(--red-360)"})}}var cS,W5,j5,rn,Ua=g(()=>{"use strict";a();Un();_();b();rS();oh();De();Hn();Bc();cS=(e,t)=>X.show({type:e,message:t,id:X.genId()}),W5=()=>cS(X.Type.SUCCESS,"Settings successfully imported. Restart to apply changes!"),j5=e=>cS(X.Type.FAILURE,`Failed to import settings: ${String(e)}`);rn=new ee("Cloud:Settings","#39b7e0")});function h(e){return e}var x=g(()=>{"use strict";a()});var rh={};et(rh,{PlainSettings:()=>zn,Settings:()=>he,SettingsStore:()=>io,definePluginSettings:()=>w,migratePluginSettings:()=>sn,useSettings:()=>Ct});function Ct(e){let[,t]=q.useReducer(()=>({}),{});return q.useEffect(()=>e?(e.forEach(o=>io.addChangeListener(o,t)),()=>e.forEach(o=>io.removeChangeListener(o,t))):(io.addGlobalChangeListener(t),()=>io.removeGlobalChangeListener(t)),[]),io.store}function sn(e,...t){let{plugins:o}=io.plain;if(!(e in o)){for(let r of t)if(r in o){q5.info(`Migrating settings from old name ${r} to ${e}`),o[e]=o[r],delete o[r],io.markAsChanged();break}}}function w(e,t){let o={get store(){if(!o.pluginName)throw new Error("Cannot access settings before plugin is initialized");return he.plugins[o.pluginName]},use:r=>Ct(r?.map(i=>`plugins.${o.pluginName}.${i}`)).plugins[o.pluginName],def:e,checks:t??{},pluginName:"",withPrivateSettings(){return this}};return o}var q5,K5,nh,Y5,io,zn,he,_=g(()=>{"use strict";a();gr();Ov();gc();De();hc();Ua();x();b();Wn();q5=new ee("Settings"),K5={autoUpdate:!0,autoUpdateNotification:!0,useQuickCss:!0,themeLinks:[],eagerPatches:!1,enabledThemes:[],enableReactDevtools:!1,frameless:!1,transparent:!1,winCtrlQ:!1,macosVibrancyStyle:void 0,disableMinSize:!1,winNativeTitleBar:!1,plugins:{},notifications:{timeout:5e3,position:"bottom-right",useNative:"not-focused",logLimit:50},cloud:{authenticated:!1,url:"https://api.vencord.dev/",settingsSync:!1,settingsSyncVersion:0}},nh=VencordNative.settings.get();Zi(nh,K5);Y5=Gt(async()=>{he.cloud.settingsSync&&he.cloud.authenticated&&(await Vi(),delete ui.Vencord_settingsDirty)},6e4),io=new bc(nh,{readOnly:!0,getDefaultValue({target:e,key:t,path:o}){let r=e[t];if(!We)return r;if(o==="plugins"&&t in We)return e[t]={enabled:We[t].required||We[t].enabledByDefault||!1};if(o.startsWith("plugins.")){let i=o.slice(8);if(i in We){let s=We[i].options?.[t];if(!s)return r;if("default"in s)return e[t]=s.default;if(s.type===4){let l=s.options.find(c=>c.default);return l&&(e[t]=l.value),l?.value}}}return r}});io.addGlobalChangeListener((e,t)=>{io.plain.cloud.settingsSyncVersion=Date.now(),ui.Vencord_settingsDirty=!0,Y5(),VencordNative.settings.set(io.plain,t)});zn=nh,he=io.store});var dS=g(()=>{});var ah={};et(ah,{currentNotice:()=>$a,nextNotice:()=>fS,noticesQueue:()=>ih,popNotice:()=>sh,showNotice:()=>Ga});function sh(){mS.dismiss()}function fS(){$a=ih.shift(),$a&&mS.show(...$a,"VencordNotice")}function Ga(e,t,o){ih.push(["GENERIC",e,t,o]),$a||fS()}var mS,ih,$a,$c=g(()=>{"use strict";a();U();mS=Fe(e=>e.show&&e.dismiss&&!e.suppressAll),ih=[],$a=null});var gS=g(()=>{});function Ha(){return`-${xo.fromTimestamp(Date.now())}`}function Je(e,t){let o=Z5({channelId:e,content:"",embeds:[]});return wo.receiveMessage(e,Zi(t,o)),t}function qt(e,t,o){return e.find(r=>r.name===t)?.value||o}var Z5,lh=g(()=>{"use strict";a();hc();U();b();Z5=fe('username:"Clyde"')});var es,jn,ch,uh=g(()=>{"use strict";a();es=(y=>(y[y.SUB_COMMAND=1]="SUB_COMMAND",y[y.SUB_COMMAND_GROUP=2]="SUB_COMMAND_GROUP",y[y.STRING=3]="STRING",y[y.INTEGER=4]="INTEGER",y[y.BOOLEAN=5]="BOOLEAN",y[y.USER=6]="USER",y[y.CHANNEL=7]="CHANNEL",y[y.ROLE=8]="ROLE",y[y.MENTIONABLE=9]="MENTIONABLE",y[y.NUMBER=10]="NUMBER",y[y.ATTACHMENT=11]="ATTACHMENT",y))(es||{}),jn=(s=>(s[s.BUILT_IN=0]="BUILT_IN",s[s.BUILT_IN_TEXT=1]="BUILT_IN_TEXT",s[s.BUILT_IN_INTEGRATION=2]="BUILT_IN_INTEGRATION",s[s.BOT=3]="BOT",s[s.PLACEHOLDER=4]="PLACEHOLDER",s))(jn||{}),ch=(r=>(r[r.CHAT_INPUT=1]="CHAT_INPUT",r[r.USER=2]="USER",r[r.MESSAGE=3]="MESSAGE",r))(ch||{})});var mh={};et(mh,{ApplicationCommandInputType:()=>jn,ApplicationCommandOptionType:()=>es,ApplicationCommandType:()=>ch,BUILT_IN:()=>Mr,OptionalMessageOption:()=>Ir,RequiredMessageOption:()=>za,_handleCommand:()=>X5,_init:()=>Q5,commands:()=>ph,findOption:()=>qt,generateId:()=>Ha,prepareOption:()=>dh,registerCommand:()=>ts,sendBotMessage:()=>Je,unregisterCommand:()=>Wa});function dh(e){return e.displayName||=e.name,e.displayDescription||=e.description,e.options?.forEach((t,o,r)=>{t===hS?r[o]=Ir:t===yS&&(r[o]=za),t.choices?.forEach(i=>i.displayName||=i.name),dh(r[o])}),e}function J5(e,t){e.options?.forEach(o=>{if(o.type!==1)throw new Error("When specifying sub-command options, all options must be sub-commands.");let r={...e,...o,type:1,name:`${e.name} ${o.name}`,id:`${o.name}-${e.id}`,displayName:`${e.name} ${o.name}`,subCommandPath:[{name:o.name,type:o.type,displayName:o.name}],rootCommand:e};ts(r,t)})}function ts(e,t){if(!Mr){console.warn("[CommandsAPI]",`Not registering ${e.name} as the CommandsAPI hasn't been initialised.`,"Please restart to use commands");return}if(Mr.some(o=>o.name===e.name))throw new Error(`Command '${e.name}' already exists.`);if(e.isVencordCommand=!0,e.id??=`-${Mr.length+1}`,e.applicationId??="-1",e.type??=1,e.inputType??=1,e.plugin||=t,dh(e),e.options?.[0]?.type===1){J5(e,t);return}ph[e.name]=e,Mr.push(e)}function Wa(e){let t=Mr.findIndex(o=>o.name===e);return t===-1?!1:(Mr.splice(t,1),delete ph[e],!0)}var Mr,ph,hS,yS,Ir,za,Q5,X5,Wo=g(()=>{"use strict";a();_n();lh();uh();lh();uh();ph={},hS=Symbol("OptionalMessageOption"),yS=Symbol("RequiredMessageOption"),Ir=hS,za=yS,Q5=function(e){try{Mr=e,Ir=e.find(t=>t.name==="shrug").options[0],za=e.find(t=>t.name==="me").options[0]}catch{console.error("Failed to load CommandsApi")}return e},X5=function(e,t,o){if(!e.isVencordCommand)return e.execute(t,o);let r=i=>{let s=`An Error occurred while executing command "${e.name}"`,l=i instanceof Error?i.stack||i.message:String(i);console.error(s,i),Je(o.channel.id,{content:`${s}:
-${fi(l)}`,author:{username:"Vencord"}})};try{let i=e.execute(t,o);return i instanceof Promise?i.catch(r):i}catch(i){return r(i)}}});var yn,os=g(()=>{a();yn="3f0d915c"});var yi,vS=g(()=>{a();yi="Vendicated/Vencord"});var SS,Gc=g(()=>{"use strict";a();os();vS();SS=`Vencord/${yn}${yi?` (https://github.com/${yi})`:""}`});function bS({option:e,pluginSettings:t,definedSettings:o,id:r,onChange:i,onError:s}){let l=t[r]??e.default,[c,u]=q.useState(l??!1),[d,f]=q.useState(null);q.useEffect(()=>{s(d!==null)},[d]);function y(v){let N=e.isValid?.call(o,v)??!0;typeof N=="string"?f(N):N?(f(null),u(v),i(v)):f("Invalid input provided.")}return n(S.FormSection,null,n(eo,{value:c,onChange:y,note:e.description,disabled:e.disabled?.call(o)??!1,...e.componentProps,hideBorder:!0,style:{marginBottom:"0.5em"}},mi(hg(r))),d&&n(S.FormText,{style:{color:"var(--text-danger)"}},d))}var TS=g(()=>{"use strict";a();_n();b()});function xS({option:e,onChange:t,onError:o}){return e.component({setValue:t,setError:o,option:e})}var wS=g(()=>{"use strict";a()});function fh({option:e,pluginSettings:t,definedSettings:o,id:r,onChange:i,onError:s}){function l(v){return e.type===2?BigInt(v):Number(v)}let[c,u]=q.useState(`${t[r]??e.default??0}`),[d,f]=q.useState(null);q.useEffect(()=>{s(d!==null)},[d]);function y(v){let N=e.isValid?.call(o,v)??!0;f(null),typeof N=="string"?f(N):N||f("Invalid input provided."),e.type===1&&BigInt(v)>=V5?(u(`${Number.MAX_SAFE_INTEGER}`),i(l(v))):(u(v),i(l(v)))}return n(S.FormSection,null,n(S.FormTitle,null,e.description),n(mt,{type:"number",pattern:"-?[0-9]+",value:c,onChange:y,placeholder:e.placeholder??"Enter a number",disabled:e.disabled?.call(o)??!1,...e.componentProps}),d&&n(S.FormText,{style:{color:"var(--text-danger)"}},d))}var V5,PS=g(()=>{"use strict";a();x();b();V5=BigInt(Number.MAX_SAFE_INTEGER)});function MS({option:e,pluginSettings:t,definedSettings:o,onChange:r,onError:i,id:s}){let l=t[s]??e.options?.find(v=>v.default)?.value,[c,u]=q.useState(l??null),[d,f]=q.useState(null);q.useEffect(()=>{i(d!==null)},[d]);function y(v){let N=e.isValid?.call(o,v)??!0;typeof N=="string"?f(N):N?(f(null),u(v),r(v)):f("Invalid input provided.")}return n(S.FormSection,null,n(S.FormTitle,null,e.description),n(ko,{isDisabled:e.disabled?.call(o)??!1,options:e.options,placeholder:e.placeholder??"Select an option",maxVisibleItems:5,closeOnSelect:!0,select:y,isSelected:v=>v===c,serialize:v=>String(v),...e.componentProps}),d&&n(S.FormText,{style:{color:"var(--text-danger)"}},d))}var IS=g(()=>{"use strict";a();b()});function Fo(e,t,o=1){let r=[];for(let i=e;i<=t;i+=o)r.push(Math.round(i*100)/100);return r}function CS({option:e,pluginSettings:t,definedSettings:o,id:r,onChange:i,onError:s}){let l=t[r]??e.default,[c,u]=q.useState(null);q.useEffect(()=>{s(c!==null)},[c]);function d(f){let y=e.isValid?.call(o,f)??!0;typeof y=="string"?u(y):y?(u(null),i(f)):u("Invalid input provided.")}return n(S.FormSection,null,n(S.FormTitle,null,e.description),n(Xr,{disabled:e.disabled?.call(o)??!1,markers:e.markers,minValue:e.markers[0],maxValue:e.markers[e.markers.length-1],initialValue:l,onValueChange:d,onValueRender:f=>String(f.toFixed(2)),stickToMarkers:e.stickToMarkers??!0,...e.componentProps}))}var gh=g(()=>{"use strict";a();b()});function AS({option:e,pluginSettings:t,definedSettings:o,id:r,onChange:i,onError:s}){let[l,c]=q.useState(t[r]??e.default??null),[u,d]=q.useState(null);q.useEffect(()=>{s(u!==null)},[u]);function f(y){let v=e.isValid?.call(o,y)??!0;d(typeof v=="string"?v:v?null:"Invalid input provided."),c(y),i(y)}return n(S.FormSection,null,n(S.FormTitle,null,e.description),n(mt,{type:"text",value:l,onChange:f,placeholder:e.placeholder??"Enter a value",disabled:e.disabled?.call(o)??!1,...e.componentProps}),u&&n(S.FormText,{style:{color:"var(--text-danger)"}},u))}var NS=g(()=>{"use strict";a();b()});var ns=g(()=>{"use strict";a();xc();TS();wS();PS();IS();gh();NS()});var RS=g(()=>{});function eR(){return n(ka,{"aria-hidden":!0,className:"vc-settings-modal-link-icon"})}function tR(){return n(Og,{"aria-hidden":!0,className:"vc-settings-modal-link-icon"})}function kS({text:e,href:t,Icon:o}){return n(oe,{text:e},r=>n(Vr,{...r,href:t},n(o,null)))}var Hc,zc,hh=g(()=>{"use strict";a();RS();b();Da();Hc=e=>n(kS,{...e,Icon:tR}),zc=e=>n(kS,{...e,Icon:eR})});function LS(e){let t=new nR({username:e.username,id:e.id??Ha(),avatar:e.avatar,bot:!0});return F.dispatch({type:"USER_UPDATE",user:t}),t}function ES({plugin:e,onRestartNeeded:t,onClose:o,transitionState:r}){let[i,s]=q.useState([]),l=Ct().plugins[e.name],[c,u]=q.useState({}),[d,f]=q.useState({}),[y,v]=q.useState(null),N=()=>Object.values(d).every(B=>!B),T=Boolean(l&&e.options&&!qs(e.options));q.useEffect(()=>{(async()=>{for(let B of e.authors.slice(0,6)){let H=B.id?await no.getUser(`${B.id}`).catch(()=>LS({username:B.name})):LS({username:B.name});s(Y=>[...Y,H])}})()},[]);async function A(){if(!e.options){o();return}if(e.beforeSave){let H=await Promise.resolve(e.beforeSave(c));if(H!==!0){v(H);return}}let B=!1;for(let[H,Y]of Object.entries(c)){let V=e.options[H];l[H]=Y,V?.onChange?.(Y),V?.restartNeeded&&(B=!0)}B&&t(),o()}function I(){if(!T||!e.options)return n(S.FormText,null,"There are no settings for this plugin.");{let B=Object.entries(e.options).map(([H,Y])=>{if(Y.hidden)return null;function V(re){u(se=>({...se,[H]:re}))}function J(re){f(se=>({...se,[H]:re}))}let $=rR[Y.type];return n($,{id:H,key:H,option:Y,onChange:V,onError:J,pluginSettings:l,definedSettings:e.settings})});return n(pe,{flexDirection:"column",style:{gap:12,marginBottom:16}},B)}}function k(B,H){let Y=e.authors.length-H,V=e.authors.length-Y,J=V+e.authors.length-H;return n(oe,{text:e.authors.slice(V,J).map($=>$.name).join(", ")},({onMouseEnter:$,onMouseLeave:re})=>n("div",{className:yh.moreUsers,onMouseEnter:$,onMouseLeave:re},"+",Y))}let D=is[e.name];return n(Te,{transitionState:r,size:"medium",className:"vc-text-selectable"},n(Ee,{separator:!1},n(K,{variant:"heading-lg/semibold",style:{flexGrow:1}},e.name),n(rt,{onClick:o})),n(Ae,null,n(S.FormSection,null,n(pe,{className:DS("info")},n(S.FormText,{className:DS("description")},e.description),!D.userPlugin&&n("div",{className:"vc-settings-modal-links"},n(Hc,{text:"View more info",href:`https://vencord.dev/plugins/${e.name}`}),n(zc,{text:"View source code",href:`https://github.com/${yi}/tree/main/src/plugins/${D.folderName}`}))),n(S.FormTitle,{tag:"h3",style:{marginTop:8,marginBottom:0}},"Authors"),n("div",{style:{width:"fit-content",marginBottom:8}},n(oR,{users:i,count:e.authors.length,guildId:void 0,renderIcon:!1,max:6,showDefaultAvatarsForNullUsers:!0,showUserPopout:!0,renderMoreUsers:k,renderUser:B=>n(Hi,{className:yh.clickableAvatar,onClick:()=>jc(B)},n("img",{className:yh.avatar,src:B.getAvatarURL(void 0,80,!0),alt:B.username,title:B.username}))}))),!!e.settingsAboutComponent&&n("div",{className:W(G.bottom8,"vc-text-selectable")},n(S.FormSection,null,n(R,{message:"An error occurred while rendering this plugin's custom InfoComponent"},n(e.settingsAboutComponent,{tempSettings:c})))),n(S.FormSection,{className:G.bottom16},n(S.FormTitle,{tag:"h3"},"Settings"),I())),T&&n(ht,null,n(pe,{flexDirection:"column",style:{width:"100%"}},n(pe,{style:{marginLeft:"auto"}},n(M,{onClick:o,size:M.Sizes.SMALL,color:M.Colors.PRIMARY,look:M.Looks.LINK},"Cancel"),n(oe,{text:"You must fix all errors before saving",shouldShow:!N()},({onMouseEnter:B,onMouseLeave:H})=>n(M,{size:M.Sizes.SMALL,color:M.Colors.BRAND,onClick:A,onMouseEnter:B,onMouseLeave:H,disabled:!N()},"Save & Close"))),y&&n(K,{variant:"text-md/semibold",style:{color:"var(--text-danger)"}},"Error while saving: ",y))))}function rs(e,t){ge(o=>n(ES,{...o,plugin:e,onRestartNeeded:()=>t?.(e.name)}))}var DS,oR,yh,nR,rR,Wc=g(()=>{"use strict";a();gS();Wo();_();tt();ne();Lt();Gc();Ye();me();Ke();x();U();b();Wn();ns();vh();hh();DS=be("vc-plugin-modal-"),oR=ie("defaultRenderUser","showDefaultAvatarsForNullUsers"),yh=C("moreUsers","emptyUser","avatarContainer","clickableAvatar"),nR=Fe(e=>e?.prototype?.getAvatarURL&&e?.prototype?.hasHadPremium);rR={[0]:AS,[1]:fh,[2]:fh,[3]:bS,[4]:MS,[5]:CS,[6]:xS}});var OS=g(()=>{});function qc({disabled:e,isNew:t,name:o,infoButton:r,footer:i,author:s,enabled:l,setEnabled:c,description:u,onMouseEnter:d,onMouseLeave:f}){let y=bt(null),v=bt(null);return n("div",{className:Cr("card",{"card-disabled":e}),onMouseEnter:d,onMouseLeave:f},n("div",{className:Cr("header")},n("div",{className:Cr("name-author")},n(K,{variant:"text-md/bold",className:Cr("name")},n("div",{ref:v,className:Cr("title-container")},n("div",{ref:y,className:Cr("title"),onMouseOver:()=>{let N=y.current,T=v.current;N.style.setProperty("--offset",`${T.clientWidth-N.scrollWidth}px`),N.style.setProperty("--duration",`${Math.max(.5,(N.scrollWidth-T.clientWidth)/7)}s`)}},o)),t&&n(Pg,{text:"NEW",color:"#ED4245"})),!!s&&n(K,{variant:"text-md/normal",className:Cr("author")},s)),r,n(Bg,{checked:l,onChange:c,disabled:e})),n(K,{className:Cr("note"),variant:"text-sm/normal"},u),i)}var Cr,Sh=g(()=>{"use strict";a();OS();tt();xc();Ug();b();Cr=be("vc-addon-")});var _S=g(()=>{});var FS=g(()=>{});var xh={};et(xh,{UpdateLogger:()=>bh,changes:()=>ja,checkForUpdates:()=>Ka,getRepo:()=>BS,isNewer:()=>Yc,isOutdated:()=>qa,maybePromptToUpdate:()=>Ya,update:()=>Zc,updateError:()=>Th});async function Kc(e){let t=await e;if(t.ok)return t.value;throw Th=t.error,t.error}async function Ka(){return ja=await Kc(VencordNative.updater.getUpdates()),ja.some(e=>e.hash===yn)?(Yc=!0,qa=!1):qa=ja.length>0}async function Zc(){if(!qa)return!0;let e=await Kc(VencordNative.updater.update());if(e&&(qa=!1,!await Kc(VencordNative.updater.rebuild())))throw new Error("The Build failed. Please try manually building the new update");return e}async function Ya(e,t=!1){return;try{if(await Ka()){let r=confirm(e);if(r&&Yc)return alert("Your local copy has more recent commits. Please stash or reset them.");r&&(await Zc(),Ji())}}catch(o){bh.error(o),alert("That also failed :( Try updating or re-installing with the installer!")}}var bh,qa,Yc,Th,ja,BS,vi=g(()=>{"use strict";a();os();De();Hn();bh=new ee("Updater","white"),qa=!1,Yc=!1;BS=()=>Kc(VencordNative.updater.getRepo())});function US(){Ya("Uh Oh! Failed to render this Page. However, there is an update available that might fix it. Would you like to update and restart now?")}var $S=g(()=>{"use strict";a();vi()});function jo({title:e,children:t}){return n(S.FormSection,null,n(K,{variant:"heading-lg/semibold",tag:"h2",className:G.bottom16},e),t)}function vn(e,t){return R.wrap(e,{message:`Failed to render the ${t} tab. If this issue persists, try using the installer to reinstall!`,onError:iR})}var iR,qn=g(()=>{"use strict";a();_S();FS();ne();$S();Ye();ga();b();iR=pi(US)});var Ih={};et(Ih,{_usePatchContextMenu:()=>lR,addContextMenuPatch:()=>Ph,addGlobalContextMenuPatch:()=>sR,findGroupChildrenByChildId:()=>Ve,globalPatches:()=>Qc,navPatches:()=>Za,removeContextMenuPatch:()=>Mh,removeGlobalContextMenuPatch:()=>aR});function Ph(e,t){Array.isArray(e)||(e=[e]);for(let o of e){let r=Za.get(o);r||(r=new Set,Za.set(o,r)),r.add(t)}}function sR(e){Qc.add(e)}function Mh(e,t){let r=(Array.isArray(e)?e:[e]).map(i=>Za.get(i)?.delete(t)??!1);return Array.isArray(e)?r:r[0]}function aR(e){return Qc.delete(e)}function Ve(e,t){for(let o of t){if(o==null)continue;if(Array.isArray(o)){let i=Ve(e,o);if(i!==null)return i}if(Array.isArray(e)&&e.some(i=>o.props?.id===i)||o.props?.id===e)return t;let r=o.props?.children;if(r){Array.isArray(r)||(r=[r],o.props.children=r);let i=Ve(e,r);if(i!==null)return i}}return null}function lR(e){e={...e,children:wh(e.children)},e.contextMenuApiArguments??=[];let t=Za.get(e.navId);if(Array.isArray(e.children)||(e.children=[e.children]),t)for(let o of t)try{o(e.children,...e.contextMenuApiArguments)}catch(r){GS.error(`Patch for ${e.navId} errored,`,r)}for(let o of Qc)try{o(e.navId,e.children,...e.contextMenuApiArguments)}catch(r){GS.error("Global patch errored,",r)}return e}function wh(e){return Array.isArray(e)?e.map(wh):(q.isValidElement(e)&&(e=q.cloneElement(e),e?.props?.children&&(e.type!==E.MenuControlItem||e.type===E.MenuControlItem&&e.props.control!=null)&&(e.props.children=wh(e.props.children))),e)}var GS,Za,Qc,ho=g(()=>{"use strict";a();De();b();GS=new ee("ContextMenu"),Za=new Map,Qc=new Set});var Jc={};et(Jc,{PMLogger:()=>cR,addPatch:()=>WS,isPluginEnabled:()=>Qa,patches:()=>as,plugins:()=>uR,startAllPlugins:()=>Xa,startDependenciesRecursive:()=>jS,startPlugin:()=>Nh,stopPlugin:()=>dR,subscribeAllPluginsFluxEvents:()=>pR,subscribePluginFluxEvents:()=>Ah,unsubscribePluginFluxEvents:()=>qS});function Qa(e){return(We[e]?.required||We[e]?.isDependency||Xc[e]?.enabled)??!1}function WS(e,t){let o=e;o.plugin=t,!(o.predicate&&!o.predicate())&&(tg(o),Array.isArray(o.replacement)||(o.replacement=[o.replacement]),o.replacement=o.replacement.filter(({predicate:r})=>!r||r()),as.push(o))}function jS(e){let t=!1,o=[];return e.dependencies?.forEach(r=>{if(!Xc[r].enabled){let i=We[r];if(jS(i),Xc[r].enabled=!0,i.isDependency=!0,i.patches){Et.warn(`Enabling dependency ${r} requires restart.`),t=!0;return}Nh(i)||o.push(r)}}),{restartNeeded:t,failures:o}}function Ah(e,t){if(e.flux&&!Ch.has(e.name)){Ch.add(e.name),Et.debug("Subscribing to flux events of plugin",e.name);for(let[o,r]of Object.entries(e.flux)){let i=e.flux[o]=function(){try{let s=r.apply(e,arguments);return s instanceof Promise?s.catch(l=>Et.error(`${e.name}: Error while handling ${o}
-`,l)):s}catch(s){Et.error(`${e.name}: Error while handling ${o}
-`,s)}};t.subscribe(o,i)}}}function qS(e,t){if(e.flux){Ch.delete(e.name),Et.debug("Unsubscribing from flux events of plugin",e.name);for(let[o,r]of Object.entries(e.flux))t.unsubscribe(o,r)}}function pR(e){HS=!0;for(let t in We)!Qa(t)||Ah(We[t],e)}var Et,cR,uR,as,HS,Ch,zS,Xc,Xa,Nh,dR,Ja=g(()=>{"use strict";a();Wo();ho();_();De();Xo();x();b();Wn();Zl();Et=new ee("PluginManager","#a6d189"),cR=Et,uR=We,as=[],HS=!1,Ch=new Set,zS=Object.values(We),Xc=he.plugins;for(let e of zS)Qa(e.name)&&e.dependencies?.forEach(t=>{let o=We[t];if(!o){let r=new Error(`Plugin ${e.name} has unresolved dependency ${t}`);Et.warn(r);return}Xc[t].enabled=!0,o.isDependency=!0});for(let e of zS){if(e.settings){e.settings.pluginName=e.name,e.options??={};for(let[t,o]of Object.entries(e.settings.def)){let r=e.settings.checks?.[t];e.options[t]={...o,...r}}}if(e.patches&&Qa(e.name))for(let t of e.patches)WS(t,e.name)}Xa=Cn("startAllPlugins",function(t){Et.info(`Starting plugins (stage ${t})`);for(let o in We)if(Qa(o)){if((We[o].startAt??"WebpackReady")!==t)continue;Nh(We[o])}});Nh=Cn("startPlugin",function(t){let{name:o,commands:r,contextMenus:i}=t;if(t.start){if(Et.info("Starting plugin",o),t.started)return Et.warn(`${o} already started`),!1;try{t.start()}catch(s){return Et.error(`Failed to start ${o}
-`,s),!1}}if(t.started=!0,r?.length){Et.debug("Registering commands of plugin",o);for(let s of r)try{ts(s,o)}catch(l){return Et.error(`Failed to register command ${s.name}
-`,l),!1}}if(HS&&Ah(t,F),i){Et.debug("Adding context menus patches of plugin",o);for(let s in i)Ph(s,i[s])}return!0},e=>`startPlugin ${e.name}`),dR=Cn("stopPlugin",function(t){let{name:o,commands:r,contextMenus:i}=t;if(t.stop){if(Et.info("Stopping plugin",o),!t.started)return Et.warn(`${o} already stopped`),!1;try{t.stop()}catch(s){return Et.error(`Failed to stop ${o}
-`,s),!1}}if(t.started=!1,r?.length){Et.debug("Unregistering commands of plugin",o);for(let s of r)try{Wa(s.name)}catch(l){return Et.error(`Failed to unregister command ${s.name}
-`,l),!1}}if(qS(t,F),i){Et.debug("Removing context menus patches of plugin",o);for(let s in i)Mh(s,i[s])}return!0},e=>`stopPlugin ${e.name}`)});function fR(e){X.show({message:e,type:X.Type.FAILURE,id:X.genId(),options:{position:X.Position.BOTTOM}})}function gR({required:e}){return n(kt,{className:Si("info-card",{"restart-card":e})},e?n(m,null,n(S.FormTitle,{tag:"h5"},"Restart required!"),n(S.FormText,{className:Si("dep-text")},"Restart now to apply new plugins and their settings"),n(M,{onClick:()=>location.reload()},"Restart")):n(m,null,n(S.FormTitle,{tag:"h5"},"Plugin Management"),n(S.FormText,null,"Press the cog wheel or info icon to get more info on a plugin"),n(S.FormText,null,"Plugins with a cog wheel have settings you can modify!")))}function Vc({plugin:e,disabled:t,onRestartNeeded:o,onMouseEnter:r,onMouseLeave:i,isNew:s}){let l=he.plugins[e.name],c=()=>l.enabled??!1;function u(){let d=c();if(!d){let{restartNeeded:y,failures:v}=Rh.startDependenciesRecursive(e);if(v.length){KS.error(`Failed to start dependencies for ${e.name}: ${v.join(", ")}`),Ga("Failed to start dependencies: "+v.join(", "),"Close",()=>null);return}else if(y){l.enabled=!0,o(e.name);return}}if(e.patches?.length){l.enabled=!d,o(e.name);return}if(d&&!e.started){l.enabled=!d;return}if(!(d?Rh.stopPlugin(e):Rh.startPlugin(e))){l.enabled=!1;let y=`Error while ${d?"stopping":"starting"} plugin ${e.name}`;KS.error(y),fR(y);return}l.enabled=!d}return n(qc,{name:e.name,description:e.description,isNew:s,enabled:c(),setEnabled:u,disabled:t,onMouseEnter:r,onMouseLeave:i,infoButton:n("button",{role:"switch",onClick:()=>rs(e,o),className:W(mR.button,Si("info-button"))},e.options&&!qs(e.options)?n(Aa,null):n(Ma,null))})}function hR({search:e}){let t=Object.entries(ZS).filter(([r])=>r.toLowerCase().includes(e)),o={desktop:"Discord Desktop app or Vesktop",discordDesktop:"Discord Desktop app",vencordDesktop:"Vesktop app",web:"Vesktop app and the Web version of Discord",dev:"Developer version of Vencord"};return n(K,{variant:"text-md/normal",className:G.top16},t.length?n(m,null,n(S.FormText,null,"Are you looking for:"),n("ul",null,t.map(([r,i])=>n("li",{key:r},n("b",null,r),": Only available on the ",o[i])))):"No plugins meet the search criteria.")}function kh(){let e=Ct(),t=q.useMemo(()=>new js,[]);q.useEffect(()=>()=>void(t.hasChanges&&xt.show({title:"Restart required",body:n(m,null,n("p",null,"The following plugins require a restart:"),n("div",null,t.map((T,A)=>n(m,null,A>0&&", ",Ce.parse("`"+T+"`"))))),confirmText:"Restart now",cancelText:"Later!",onConfirm:()=>location.reload()})),[]);let o=q.useMemo(()=>{let T={};for(let A in We){let I=We[A].dependencies;if(I)for(let k of I)T[k]??=[],T[k].push(A)}return T},[]),r=dt(()=>Object.values(We).sort((T,A)=>T.name.localeCompare(A.name)),[]),[i,s]=q.useState({value:"",status:0}),l=i.value.toLowerCase(),c=T=>s(A=>({...A,value:T})),u=T=>s(A=>({...A,status:T})),d=T=>{let{status:A}=i,I=Vencord.Plugins.isPluginEnabled(T.name);return I&&A===2||!I&&A===1||A===3&&!f?.includes(T.name)?!1:l.length?T.name.toLowerCase().includes(l)||T.description.toLowerCase().includes(l)||T.tags?.some(k=>k.toLowerCase().includes(l)):!0},[f]=pt(()=>lt("Vencord_existingPlugins").then(T=>{let A=Date.now()/1e3,I={},k=Object.values(r).map(B=>B.name),D=[];for(let{name:B}of r)(I[B]=T?.[B]??A)+60*60*24*2>A&&D.push(B);return Pt("Vencord_existingPlugins",I),ni.isEqual(D,k)?[]:D})),y=[],v=[],N=i.value.includes("API");for(let T of r){if(T.hidden||!T.options&&T.name.endsWith("API")&&!N||!d(T))continue;if(T.required||o[T.name]?.some(I=>e.plugins[I].enabled)){let I=T.required?"This plugin is required for Vencord to function.":yR(o[T.name]?.filter(k=>e.plugins[k].enabled));v.push(n(oe,{text:I,key:T.name},({onMouseLeave:k,onMouseEnter:D})=>n(Vc,{onMouseLeave:k,onMouseEnter:D,onRestartNeeded:B=>t.handleChange(B),disabled:!0,plugin:T,key:T.name})))}else y.push(n(Vc,{onRestartNeeded:I=>t.handleChange(I),disabled:!1,plugin:T,isNew:f?.includes(T.name),key:T.name}))}return n(jo,{title:"Plugins"},n(gR,{required:t.hasChanges}),n(S.FormTitle,{tag:"h5",className:W(G.top20,G.bottom8)},"Filters"),n("div",{className:W(G.bottom20,Si("filter-controls"))},n(mt,{autoFocus:!0,value:i.value,placeholder:"Search for a plugin...",onChange:c}),n("div",{className:YS.inputWrapper},n(ko,{options:[{label:"Show All",value:0,default:!0},{label:"Show Enabled",value:1},{label:"Show Disabled",value:2},{label:"Show New",value:3}],serialize:String,select:u,isSelected:T=>T===i.status,closeOnSelect:!0,className:YS.inputDefault}))),n(S.FormTitle,{className:G.top20},"Plugins"),y.length||v.length?n("div",{className:Si("grid")},y.length?y:n(K,{variant:"text-md/normal"},"No plugins meet the search criteria.")):n(hR,{search:l}),n(S.FormDivider,{className:G.top20}),n(S.FormTitle,{tag:"h5",className:W(G.top20,G.bottom8)},"Required Plugins"),n("div",{className:Si("grid")},v.length?v:n(K,{variant:"text-md/normal"},"No plugins meet the search criteria.")))}function yR(e){return n(q.Fragment,null,n(S.FormText,null,"This plugin is required by:"),e.map(t=>n(S.FormText,{className:Si("dep-text")},t)))}var Rh,Si,KS,YS,mR,Dh=g(()=>{"use strict";a();dS();Uo();$c();_();tt();yt();Wc();Sh();qn();Xf();Vt();De();Ye();me();ct();U();b();Wn();Rh=Mt(()=>(Ja(),K0(Jc))),Si=be("vc-plugins-"),KS=new ee("PluginSettings","#a6d189"),YS=C("inputWrapper","inputDefault","error"),mR=C("button","disabled","enabled")});function jc(e){ge(t=>n(Te,{...t},n(R,null,n(Ae,{className:ls("root")},n(vR,{user:e})))))}function vR({user:e}){Ct();let t=_e([to],()=>to.getUserProfile(e.id));ue(()=>{!t&&!e.bot&&e.id&&gg(e.id)},[e.id]);let o=t?.connectedAccounts?.find(l=>l.type==="github")?.name,r=t?.connectedAccounts?.find(l=>l.type==="domain")?.name,i=dt(()=>{let l=Object.values(We);return(Oi[e.id]?l.filter(u=>u.authors.includes(Oi[e.id])):l.filter(u=>u.authors.some(d=>d.name===e.username))).filter(u=>!u.name.endsWith("API")).sort((u,d)=>Number(u.required??!1)-Number(d.required??!1))},[e.id,e.username]),s=n(He,{href:"https://vencord.dev/source"},"contributed");return n(m,null,n("div",{className:ls("header")},n("img",{className:ls("avatar"),src:e.getAvatarURL(void 0,512,!0),alt:""}),n(S.FormTitle,{tag:"h2",className:ls("name")},e.username),n("div",{className:W("vc-settings-modal-links",ls("links"))},r&&n(Hc,{text:r,href:`https://${r}`}),o&&n(zc,{text:o,href:`https://github.com/${o}`}))),i.length?n(S.FormText,null,"This person has ",s," to ",Vf(i.length,"plugin"),"!"):n(S.FormText,null,"This person has not made any plugins. They likely ",s," to Vencord in other ways!"),!!i.length&&n("div",{className:ls("plugins")},i.map(l=>n(Vc,{key:l.name,plugin:l,disabled:l.required??!1,onRestartNeeded:()=>ft("Restart to apply changes!")}))))}var ls,vh=g(()=>{"use strict";a();Ev();_();tt();ne();ro();P();it();me();Ke();b();Wn();Dh();hh();ls=be("vc-author-modal-")});async function QS(e=!1){Lh={};let t={};e&&(t.cache="no-cache"),Lh=await fetch("https://badges.vencord.dev/badges.json",t).then(o=>o.json())}var SR,bR,Lh,eu,XS=g(()=>{"use strict";a();Lv();ou();Sc();ne();Lt();vc();vh();P();De();Ye();me();Ke();x();b();SR="https://vencord.dev/assets/favicon.png",bR={description:"Vencord Contributor",image:SR,position:0,shouldShow:({userId:e})=>In(e),onClick:(e,{userId:t})=>jc(L.getUser(t))},Lh={};eu=h({name:"BadgeAPI",description:"API to add badges to users.",authors:[p.Megu,p.Ven,p.TheSun],required:!0,patches:[{find:'id:"premium",',replacement:[{match:/&&(\i)\.push\(\{id:"premium".+?\}\);/,replace:"$&$1.unshift(...$self.getBadges(arguments[0]));"},{match:/alt:" ","aria-hidden":!0,src:(?=(\i)\.src)/,replace:"...$1.props,$& $1.image??"},{match:/(?<=text:(\i)\.description,spacing:12,.{0,50})children:/,replace:"children:$1.component ? () => $self.renderBadgeComponent($1) :"},{match:/href:(\i)\.link/,replace:"...($1.onClick && { onClick: vcE => $1.onClick(vcE, $1) }),$&"}]},{find:".FULL_SIZE]:26",replacement:{match:/(?<=(\i)=\(0,\i\.\i\)\(\i\);)return 0===\i.length\?/,replace:"$1.unshift(...$self.getBadges(arguments[0].displayProfile));$&"}},{find:".description,delay:",replacement:[{match:/alt:" ","aria-hidden":!0,src:(?=.{0,20}(\i)\.icon)/,replace:"...$1.props,$& $1.image??"},{match:/(?<=text:(\i)\.description,.{0,50})children:/,replace:"children:$1.component ? $self.renderBadgeComponent({ ...$1 }) :"},{match:/href:(\i)\.link/,replace:"...($1.onClick && { onClick: vcE => $1.onClick(vcE, $1) }),$&"}]}],toolboxActions:{async"Refetch Badges"(){await QS(!0),X.show({id:X.genId(),message:"Successfully refetched badges!",type:X.Type.SUCCESS})}},async start(){Vencord.Api.Badges.addBadge(bR),await QS()},getBadges(e){if(!e)return[];try{return e.userId??=e.user?.id,Eh(e)}catch(t){return new ee("BadgeAPI#hasBadges").error(t),[]}},renderBadgeComponent:R.wrap(e=>{let t=e.component;return n(t,{...e})},{noop:!0}),getDonorBadges(e){return Lh[e]?.map(t=>({image:t.badge,description:t.tooltip,position:0,props:{style:{borderRadius:"50%",transform:"scale(0.9)"}},onClick(){let o=ge(r=>n(R,{noop:!0,onError:()=>{Ln(o),VencordNative.native.openExternal("https://github.com/sponsors/Vendicated")}},n(Ki.ModalRoot,{...r},n(Ki.ModalHeader,null,n(pe,{style:{width:"100%",justifyContent:"center"}},n(S.FormTitle,{tag:"h2",style:{width:"100%",textAlign:"center",margin:0}},n(va,null),"Vencord Donor"))),n(Ki.ModalContent,null,n(pe,null,n("img",{role:"presentation",src:"https://cdn.discordapp.com/emojis/1026533070955872337.png",alt:"",style:{margin:"auto"}}),n("img",{role:"presentation",src:"https://cdn.discordapp.com/emojis/1026533090627174460.png",alt:"",style:{margin:"auto"}})),n("div",{style:{padding:"1em"}},n(S.FormText,null,"This Badge is a special perk for Vencord Donors"),n(S.FormText,{className:G.top20},"Please consider supporting the development of Vencord by becoming a donor. It would mean a lot!!"))),n(Ki.ModalFooter,null,n(pe,{style:{width:"100%",justifyContent:"center"}},n(Sa,null))))))}}))}})});var nu,JS=g(()=>{"use strict";a();P();x();nu=h({name:"ChatInputButtonAPI",description:"API to add buttons to the chat input",authors:[p.Ven],patches:[{find:'"sticker")',replacement:{match:/return\(!\i\.\i&&(?=\(\i\.isDM.+?(\i)\.push\(.{0,50}"gift")/,replace:"$&(Vencord.Api.ChatButtons._injectButtons($1,arguments[0]),true)&&"}}]})});var ru,VS=g(()=>{"use strict";a();P();x();ru=h({name:"CommandsAPI",authors:[p.Arjix],description:"Api required by anything that uses commands",patches:[{find:',"tenor"',replacement:[{match:/(?<=\w=)(\w)(\.filter\(.{0,60}tenor)/,replace:"Vencord.Api.Commands._init($1)$2"}]},{find:"Unexpected value for option",replacement:{match:/,(\i)\.execute\((\i),(\i)\)/,replace:(e,t,o,r)=>`,Vencord.Api.Commands._handleCommand(${t}, ${o}, ${r})`}},{find:".source,children",replacement:{match:/(?<=:(.{1,3})\.displayDescription\}.{0,200}\.source,children:)[^}]+/,replace:"$1.plugin||($&)"}}]})});var iu,eb=g(()=>{"use strict";a();P();x();iu=h({name:"ContextMenuAPI",description:"API for adding/removing items to/from context menus.",authors:[p.Nuckyz,p.Ven,p.Kyuuhachi],required:!0,patches:[{find:"\u266B (\u3064\uFF61\u25D5\u203F\u203F\u25D5\uFF61)\u3064 \u266A",replacement:{match:/(?=let{navId:)(?<=function \i\((\i)\).+?)/,replace:"$1=Vencord.Api.ContextMenu._usePatchContextMenu($1);"}},{find:".Menu,{",all:!0,replacement:{match:/Menu,{(?<=\.jsxs?\)\(\i\.Menu,{)/g,replace:"$&contextMenuApiArguments:typeof arguments!=='undefined'?arguments:[],"}}]})});var su,tb=g(()=>{"use strict";a();P();x();su=h({name:"MemberListDecoratorsAPI",description:"API to add decorators to member list (both in servers and DMs)",authors:[p.TheSun,p.Ven],patches:[{find:".lostPermission)",replacement:[{match:/let\{[^}]*lostPermissionTooltipText:\i[^}]*\}=(\i),/,replace:"$&vencordProps=$1,"},{match:/\.Messages\.GUILD_OWNER(?=.+?decorators:(\i)\(\)).+?\1=?\(\)=>.+?children:\[/,replace:"$&...(typeof vencordProps=='undefined'?[]:Vencord.Api.MemberListDecorators.__getDecorators(vencordProps)),"}]},{find:"PrivateChannel.renderAvatar",replacement:{match:/decorators:(\i\.isSystemDM\(\))\?(.+?):null/,replace:"decorators:[...Vencord.Api.MemberListDecorators.__getDecorators(arguments[0]), $1?$2:null]"}}]})});var au,ob=g(()=>{"use strict";a();P();x();au=h({name:"MessageAccessoriesAPI",description:"API to add message accessories.",authors:[p.Cyn],patches:[{find:".Messages.REMOVE_ATTACHMENT_BODY",replacement:{match:/(?<=.container\)?,children:)(\[.+?\])/,replace:"Vencord.Api.MessageAccessories._modifyAccessories($1,this.props)"}}]})});var lu,nb=g(()=>{"use strict";a();P();x();lu=h({name:"MessageDecorationsAPI",description:"API to add decorations to messages",authors:[p.TheSun],patches:[{find:'"Message Username"',replacement:{match:/\.Messages\.GUILD_COMMUNICATION_DISABLED_BOTTOM_SHEET_TITLE.+?}\),\i(?=\])/,replace:"$&,...Vencord.Api.MessageDecorations.__addDecorationsToMessage(arguments[0])"}}]})});var cu,rb=g(()=>{"use strict";a();P();x();cu=h({name:"MessageEventsAPI",description:"Api required by anything using message events.",authors:[p.Arjix,p.hunt,p.Ven],patches:[{find:".Messages.EDIT_TEXTAREA_HELP",replacement:{match:/(?<=,channel:\i\}\)\.then\().+?(?=return \i\.content!==this\.props\.message\.content&&\i\((.+?)\))/,replace:(e,t)=>`async ${e}if(await Vencord.Api.MessageEvents._handlePreEdit(${t}))return Promise.resolve({shoudClear:true,shouldRefocus:true});`}},{find:".handleSendMessage,onResize",replacement:{match:/(type:this\.props\.chatInputType.+?\.then\()(\i=>\{.+?let (\i)=\i\.\i\.parse\((\i),.+?let (\i)=\i\.\i\.getSendMessageOptionsForReply\(\i\);)(?<=\)\(({.+?})\)\.then.+?)/,replace:(e,t,o,r,i,s,l)=>`${t}async ${o}if(await Vencord.Api.MessageEvents._handlePreSend(${i}.id,${r},${l},${s}))return{shoudClear:true,shouldRefocus:true};`}},{find:'("interactionUsernameProfile',replacement:{match:/let\{id:\i}=(\i),{id:\i}=(\i);return \i\.useCallback\((\i)=>\{/,replace:(e,t,o,r)=>`const vcMsg=${t},vcChan=${o};${e}Vencord.Api.MessageEvents._handleClick(vcMsg, vcChan, ${r});`}}]})});var uu,ib=g(()=>{"use strict";a();P();x();uu=h({name:"MessagePopoverAPI",description:"API to add buttons to message popovers.",authors:[p.KingFish,p.Ven,p.Nuckyz],patches:[{find:"Messages.MESSAGE_UTILITIES_A11Y_LABEL",replacement:{match:/\.jsx\)\((\i\.\i),\{label:\i\.\i\.Messages\.MESSAGE_ACTION_REPLY.{0,200}?"reply-self".{0,50}?\}\):null(?=,.+?message:(\i))/,replace:"$&,Vencord.Api.MessagePopover._buildPopoverElements($1,$2)"}}]})});var pu,sb=g(()=>{"use strict";a();P();x();pu=h({name:"MessageUpdaterAPI",description:"API for updating and re-rendering messages.",authors:[p.Nuckyz],patches:[{find:"}renderEmbeds(",replacement:{match:/(?<=this.props,\i,\[)"message",/,replace:""}}]})});var du,ab=g(()=>{"use strict";a();P();x();du=h({name:"NoticesAPI",description:"Fixes notices being automatically dismissed",authors:[p.Ven],required:!0,patches:[{find:'"NoticeStore"',replacement:[{match:/(?<=!1;)\i=null;(?=.{0,80}getPremiumSubscription\(\))/g,replace:"if(Vencord.Api.Notices.currentNotice)return false;$&"},{match:/(?<=,NOTICE_DISMISS:function\(\i\){)return null!=(\i)/,replace:'if($1.id=="VencordNotice")return($1=null,Vencord.Api.Notices.nextNotice(),true);$&'}]}]})});var mu,lb=g(()=>{"use strict";a();P();x();mu=h({name:"ServerListAPI",authors:[p.kemo],description:"Api required for plugins that modify the server list",patches:[{find:"Messages.DISCODO_DISABLED",replacement:{match:/(?<=Messages\.DISCODO_DISABLED.+?return)(\(.{0,75}?tutorialContainer.+?}\))(?=}function)/,replace:"[$1].concat(Vencord.Api.ServerList.renderAll(Vencord.Api.ServerList.ServerListRenderPosition.Above))"}},{find:"Messages.SERVERS,children",replacement:{match:/(?<=Messages\.SERVERS,children:).+?default:return null\}\}\)/,replace:"Vencord.Api.ServerList.renderAll(Vencord.Api.ServerList.ServerListRenderPosition.In).concat($&)"}}]})});var fu,cb=g(()=>{"use strict";a();P();x();fu=h({name:"UserSettingsAPI",description:"Patches Discord's UserSettings to expose their group and name.",authors:[p.Nuckyz],patches:[{find:",updateSetting:",replacement:[{match:/(?<=INFREQUENT_USER_ACTION.{0,20},)useSetting:/,replace:"userSettingsAPIGroup:arguments[0],userSettingsAPIName:arguments[1],$&"},{match:/updateSetting:.{0,100}SELECTIVELY_SYNCED_USER_SETTINGS_UPDATE/,replace:"userSettingsAPIGroup:arguments[0].userSettingsAPIGroup,userSettingsAPIName:arguments[0].userSettingsAPIName,$&"},{match:/updateSetting:.{0,60}USER_SETTINGS_OVERRIDE_CLEAR/,replace:"userSettingsAPIGroup:arguments[0].userSettingsAPIGroup,userSettingsAPIName:arguments[0].userSettingsAPIName,$&"}]}]})});var ub,gu,pb=g(()=>{"use strict";a();_();P();De();x();ub=w({disableAnalytics:{type:3,description:"Disable Discord's tracking (analytics/'science')",default:!0,restartNeeded:!0}}),gu=h({name:"NoTrack",description:"Disable Discord's tracking (analytics/'science'), metrics and Sentry crash reporting",authors:[p.Cyn,p.Ven,p.Nuckyz,p.Arrow],required:!0,settings:ub,patches:[{find:"AnalyticsActionHandlers.handle",predicate:()=>ub.store.disableAnalytics,replacement:{match:/^.+$/,replace:"()=>{}"}},{find:".METRICS,",replacement:[{match:/this\._intervalId=/,replace:"this._intervalId=void 0&&"},{match:/(?:increment|distribution)\(\i(?:,\i)?\){/g,replace:"$&return;"}]},{find:".installedLogHooks)",replacement:{match:"getDebugLogging(){",replace:"getDebugLogging(){return false;"}}],startAt:"Init",start(){Object.defineProperty(Function.prototype,"g",{configurable:!0,set(e){Object.defineProperty(this,"g",{value:e,configurable:!0,enumerable:!0,writable:!0});let{stack:t}=new Error;if(console.log(this.c),console.log(t),console.log(String(this)),this.c!=null||!t?.includes("http")||!String(this).includes("exports:{}"))return console.log("Failed at stack matching!");let o=t.match(/http.+?(?=:\d+?:\d+?$)/m)?.[0];if(!o)return console.log("Failed at asset path!");let r=new XMLHttpRequest;if(r.open("GET",o,!1),r.send(),!r.responseText.includes("DiscordSentry="))return console.log(r.responseText),console.log("Failed at response text matching!");throw new ee("NoTrack","#8caaee").info("Disabling Sentry by erroring its WebpackInstance"),Reflect.deleteProperty(Function.prototype,"g"),Reflect.deleteProperty(window,"DiscordSentry"),new Error("Sentry successfully disabled")}}),Object.defineProperty(window,"DiscordSentry",{configurable:!0,set(){new ee("NoTrack","#8caaee").error("Failed to disable Sentry. Falling back to deleting window.DiscordSentry"),Reflect.deleteProperty(Function.prototype,"g"),Reflect.deleteProperty(window,"DiscordSentry")}})}})});function TR(){return n(jo,{title:"Backup & Restore"},n(kt,{className:W("vc-settings-card","vc-backup-restore-card")},n(pe,{flexDirection:"column"},n("strong",null,"Warning"),n("span",null,"Importing a settings file will overwrite your current settings."))),n(K,{variant:"text-md/normal",className:G.bottom8},"You can import and export your Vencord settings as a JSON file. This allows you to easily transfer your settings to another device, or recover your settings after reinstalling Vencord or Discord."),n(K,{variant:"text-md/normal",className:G.bottom8},"Settings Export contains:",n("ul",null,n("li",null,"\u2014 Custom QuickCSS"),n("li",null,"\u2014 Theme Links"),n("li",null,"\u2014 Plugin Settings"))),n(pe,null,n(M,{onClick:()=>uS(),size:M.Sizes.SMALL},"Import Settings"),n(M,{onClick:lS,size:M.Sizes.SMALL},"Export Settings")))}var db,mb=g(()=>{"use strict";a();Lt();Ye();me();Ua();b();qn();db=vn(TR,"Backup & Restore")});function fb(e){let t={display:e.inline?"inline-grid":"grid",gridTemplateColumns:`repeat(${e.columns}, 1fr)`,gap:e.gap,...e.style};return n("div",{...e,style:t},e.children)}var gb=g(()=>{"use strict";a()});function xR(e){try{return new URL(e),!0}catch{return"Invalid URL"}}async function wR(){let e=await fetch(new URL("/v1/",Pr()),{method:"DELETE",headers:{Authorization:await Xi()}});if(!e.ok){Ec.error(`Failed to erase data, API returned ${e.status}`),ze({title:"Cloud Integrations",body:`Could not erase all data (API returned ${e.status}), please contact support.`,color:"var(--red-360)"});return}he.cloud.authenticated=!1,await Oc(),ze({title:"Cloud Integrations",body:"Successfully erased all data.",color:"var(--green-360)"})}function PR(){let{cloud:e}=Ct(["cloud.authenticated","cloud.settingsSync"]),t=e.authenticated&&e.settingsSync;return n(S.FormSection,{title:"Settings Sync",className:G.top16},n(S.FormText,{variant:"text-md/normal",className:G.bottom20},"Synchronize your settings to the cloud. This allows easy synchronization across multiple devices with minimal effort."),n(eo,{key:"cloud-sync",disabled:!e.authenticated,value:e.settingsSync,onChange:o=>{e.settingsSync=o}},"Settings Sync"),n("div",{className:"vc-cloud-settings-sync-grid"},n(M,{size:M.Sizes.SMALL,disabled:!t,onClick:()=>Vi(!0)},"Sync to Cloud"),n(oe,{text:"This will overwrite your local settings with the ones on the cloud. Use wisely!"},({onMouseLeave:o,onMouseEnter:r})=>n(M,{onMouseLeave:o,onMouseEnter:r,size:M.Sizes.SMALL,color:M.Colors.RED,disabled:!t,onClick:()=>Uc(!0,!0)},"Sync from Cloud")),n(M,{size:M.Sizes.SMALL,color:M.Colors.RED,disabled:!t,onClick:()=>pS()},"Delete Cloud Settings")))}function MR(){let e=Ct(["cloud.authenticated","cloud.url"]);return n(jo,{title:"Vencord Cloud"},n(S.FormSection,{title:"Cloud Settings",className:G.top16},n(S.FormText,{variant:"text-md/normal",className:G.bottom20},"Vencord comes with a cloud integration that adds goodies like settings sync across devices. It ",n(He,{href:"https://vencord.dev/cloud/privacy"},"respects your privacy"),", and the ",n(He,{href:"https://github.com/Vencord/Backend"},"source code")," is AGPL 3.0 licensed so you can host it yourself."),n(eo,{key:"backend",value:e.cloud.authenticated,onChange:t=>{t?th():e.cloud.authenticated=t},note:"This will request authorization if you have not yet set up cloud integrations."},"Enable Cloud Integrations"),n(S.FormTitle,{tag:"h5"},"Backend URL"),n(S.FormText,{className:G.bottom8},"Which backend to use when using cloud integrations."),n(Ta,{key:"backendUrl",value:e.cloud.url,onChange:async t=>{e.cloud.url=t,e.cloud.authenticated=!1,Oc()},validate:xR}),n(fb,{columns:2,gap:"1em",className:G.top8},n(M,{size:M.Sizes.MEDIUM,disabled:!e.cloud.authenticated,onClick:async()=>{await Oc(),e.cloud.authenticated=!1,await th()}},"Reauthorise"),n(M,{size:M.Sizes.MEDIUM,color:M.Colors.RED,disabled:!e.cloud.authenticated,onClick:()=>xt.show({title:"Are you sure?",body:"Once your data is erased, we cannot recover it. There's no going back!",onConfirm:wR,confirmText:"Erase it!",confirmColor:"vc-cloud-erase-data-danger-btn",cancelText:"Nevermind"})},"Erase All Data")),n(S.FormDivider,{className:G.top16})),n(PR,null))}var hb,yb=g(()=>{"use strict";a();Un();_();wc();gb();ro();oh();Ye();Ua();b();qn();hb=vn(MR,"Cloud")});var ZH,vb=g(()=>{"use strict";a();Pc();gr();Ye();Xo();_n();U();b();qn();ZH=Gt(function({find:e,setModule:t,setError:o}){let r=Ui(e),i=Object.keys(r),s=i.length;s===0?o("No match. Perhaps that module is lazy loaded?"):s!==1?o("Multiple matches. Please refine your filter"):t([i[0],r[i[0]]])})});var Sb,bb=g(()=>{"use strict";a();Dh();qn();Sb=vn(kh,"Plugins")});var Tb=g(()=>{});function Kn(e){let{Icon:t,action:o,text:r,disabled:i}=e;return n("button",{className:Oh("pill"),onClick:o,disabled:i},n(t,{className:Oh("img")}),r)}function hu(e){return n(kt,{className:Oh("card")},e.children)}var Oh,_h=g(()=>{"use strict";a();Tb();tt();b();Oh=be("vc-settings-quickActions-")});function NR({link:e}){let[t,o,r]=pt(()=>fetch(e).then(s=>{if(s.status>300)throw`${s.status} ${s.statusText}`;let l=s.headers.get("Content-Type");if(!l?.startsWith("text/css")&&!l?.startsWith("text/plain"))throw"Not a CSS file. Remember to use the raw link!";return"Okay!"})),i=r?"Checking...":o?`Error: ${o instanceof Error?o.message:String(o)}`:"Valid!";return n(S.FormText,{style:{color:r?"var(--text-muted)":o?"var(--text-danger)":"var(--text-positive)"}},i)}function RR({themeLinks:e}){return e.length?n(m,null,n(S.FormTitle,{className:G.top20,tag:"h5"},"Validator"),n(S.FormText,null,"This section will tell you whether your themes can successfully be loaded"),n("div",null,e.map(t=>n(kt,{style:{padding:".5em",marginBottom:".5em",marginTop:".5em"},key:t},n(S.FormTitle,{tag:"h5",style:{overflowWrap:"break-word"}},t),n(NR,{link:t}))))):null}function kR({theme:e,enabled:t,onChange:o,onDelete:r}){return n(qc,{name:e.name,description:e.description,author:e.author,enabled:t,setEnabled:o,infoButton:n("div",{style:{cursor:"pointer",color:"var(--status-danger"},onClick:r},n(Bn,null)),footer:n(pe,{flexDirection:"row",style:{gap:"0.2em"}},!!e.website&&n(He,{href:e.website},"Website"),!!(e.website&&e.invite)&&" \u2022 ",!!e.invite&&n(He,{href:`https://discord.gg/${e.invite}`,onClick:async i=>{i.preventDefault(),e.invite!=null&&ai(e.invite).catch(()=>ft("Invalid or expired invite"))}},"Discord Server"))})}function DR(){let e=Ct(["themeLinks","enabledThemes"]),t=bt(null),[o,r]=z(0),[i,s]=z(e.themeLinks.join(`
-`)),[l,c]=z(null),[u,,d]=pt(VencordNative.themes.getThemesDir);ue(()=>{f()},[]);async function f(){let I=await VencordNative.themes.getThemesList();c(I)}function y(I,k){if(k){if(e.enabledThemes.includes(I))return;e.enabledThemes=[...e.enabledThemes,I]}else e.enabledThemes=e.enabledThemes.filter(D=>D!==I)}async function v(I){if(I.stopPropagation(),I.preventDefault(),!I.currentTarget?.files?.length)return;let{files:k}=I.currentTarget,D=Array.from(k,B=>{let{name:H}=B;if(!!H.endsWith(".css"))return new Promise((Y,V)=>{let J=new FileReader;J.onload=()=>{VencordNative.themes.uploadTheme(H,J.result).then(Y).catch(V)},J.readAsText(B)})});await Promise.all(D),f()}function N(){return n(m,null,n(kt,{className:"vc-settings-card"},n(S.FormTitle,{tag:"h5"},"Find Themes:"),n("div",{style:{marginBottom:".5em",display:"flex",flexDirection:"column"}},n(He,{style:{marginRight:".5em"},href:"https://betterdiscord.app/themes"},"BetterDiscord Themes"),n(He,{href:"https://github.com/search?q=discord+theme"},"GitHub")),n(S.FormText,null,'If using the BD site, click on "Download" and place the downloaded .theme.css file into your themes folder.')),n(S.FormSection,{title:"Local Themes"},n(hu,null,n(m,null,n(Kn,{text:n("span",{style:{position:"relative"}},"Upload Theme",n(IR,{ref:t,onChange:v,multiple:!0,filters:[{extensions:["css"]}]})),Icon:Na}),n(Kn,{text:"Load missing Themes",action:f,Icon:Lg}),n(Kn,{text:"Edit QuickCSS",action:()=>VencordNative.quickCss.openEditor(),Icon:Ra}),Vencord.Plugins.isPluginEnabled("ClientTheme")&&n(Kn,{text:"Edit ClientTheme",action:()=>rs(We.ClientTheme),Icon:Eg}))),n("div",{className:AR("grid")},l?.map(I=>n(kR,{key:I.fileName,enabled:e.enabledThemes.includes(I.fileName),onChange:k=>y(I.fileName,k),onDelete:async()=>{y(I.fileName,!1),await VencordNative.themes.deleteTheme(I.fileName),f()},theme:I})))))}function T(){e.themeLinks=[...new Set(i.trim().split(/\n+/).map(I=>I.trim()).filter(Boolean))]}function A(){return n(m,null,n(kt,{className:"vc-settings-card vc-text-selectable"},n(S.FormTitle,{tag:"h5"},"Paste links to css files here"),n(S.FormText,null,"One link per line"),n(S.FormText,null,"Make sure to use direct links to files (raw or github.io)!")),n(S.FormSection,{title:"Online Themes",tag:"h5"},n(ra,{value:i,onChange:s,className:W(CR.textarea,"vc-settings-theme-links"),placeholder:"Theme Links",spellCheck:!1,onBlur:T,rows:10}),n(RR,{themeLinks:e.themeLinks})))}return n(jo,{title:"Themes"},n(mo,{type:"top",look:"brand",className:"vc-settings-tab-bar",selectedItem:o,onItemSelect:r},n(mo.Item,{className:"vc-settings-tab-bar-item",id:0},"Local Themes"),n(mo.Item,{className:"vc-settings-tab-bar-item",id:1},"Online Themes")),o===0&&N(),o===1&&A())}var IR,CR,AR,xb,wb=g(()=>{"use strict";a();_();tt();Lt();yt();ro();Wc();it();Ye();me();Hn();ct();U();b();Wn();Sh();_h();qn();IR=Xl("activateUploadDialogue","setRef"),CR=C("textarea"),AR=be("vc-settings-theme-");xb=vn(DR,"Themes")});var yu=g(()=>{"use strict";a();_();gi();Lt();ro();Ye();me();Ke();Hn();ct();vi();b();os();qn()});function ER(){let[e,,t]=pt(VencordNative.settings.getSettingsDir,{fallbackValue:"Loading..."}),o=Ct(),r=q.useMemo(()=>Math.random()>.5?Pb:Mb,[]),i=navigator.platform.toLowerCase().startsWith("win"),s=navigator.platform.toLowerCase().startsWith("mac"),l=!1,c=[{key:"useQuickCss",title:"Enable Custom CSS",note:"Loads your Custom CSS"},!1,!1,!1,!1,!1];return n(jo,{title:"Vencord Settings"},n(OR,{image:r}),n(S.FormSection,{title:"Quick Actions"},n(hu,null,n(Kn,{Icon:Dg,text:"Notification Log",action:Ea}),n(Kn,{Icon:Ra,text:"Edit QuickCSS",action:()=>VencordNative.quickCss.openEditor()}),!1,!1,n(Kn,{Icon:ka,text:"View Source Code",action:()=>VencordNative.native.openExternal("https://github.com/"+yi)}))),n(S.FormDivider,null),n(S.FormSection,{className:G.top16,title:"Settings",tag:"h5"},n(S.FormText,{className:G.bottom20,style:{color:"var(--text-muted)"}},"Hint: You can change the position of this settings section in the"," ",n(M,{look:M.Looks.BLANK,style:{color:"var(--text-link)",display:"inline-block"},onClick:()=>rs(Vencord.Plugins.plugins.Settings)},"settings of the Settings plugin"),"!"),c.map(u=>u&&n(eo,{key:u.key,value:o[u.key],onChange:d=>o[u.key]=d,note:u.note},u.title))),l&&n(m,null,n(S.FormTitle,{tag:"h5"},"Window vibrancy style (requires restart)"),n(ko,{className:G.bottom20,placeholder:"Window vibrancy style",options:[{label:"No vibrancy",value:void 0},{label:"Under Page (window tinting)",value:"under-page"},{label:"Content",value:"content"},{label:"Window",value:"window"},{label:"Selection",value:"selection"},{label:"Titlebar",value:"titlebar"},{label:"Header",value:"header"},{label:"Sidebar",value:"sidebar"},{label:"Tooltip",value:"tooltip"},{label:"Menu",value:"menu"},{label:"Popover",value:"popover"},{label:"Fullscreen UI (transparent but slightly muted)",value:"fullscreen-ui"},{label:"HUD (Most transparent)",value:"hud"}],select:u=>o.macosVibrancyStyle=u,isSelected:u=>o.macosVibrancyStyle===u,serialize:_i})),n(S.FormSection,{className:G.top16,title:"Vencord Notifications",tag:"h5"},n(pe,null,n(M,{onClick:Ac},"Notification Settings"),n(M,{onClick:Ea},"View Notification Log"))))}function OR({image:e}){return n(kt,{className:LR("card","donate")},n("div",null,n(S.FormTitle,{tag:"h5"},"Support the Project"),n(S.FormText,null,"Please consider supporting the development of Vencord by donating!"),n(Sa,{style:{transform:"translateX(-1em)"}})),n("img",{role:"presentation",src:e,alt:"",height:128,style:{imageRendering:e===Mb?"pixelated":void 0,marginLeft:"auto",transform:e===Pb?"rotate(10deg)":void 0}}))}var LR,Pb,Mb,Ib,Cb=g(()=>{"use strict";a();Rc();_();tt();Sc();Wc();Gc();Ye();me();Hn();ct();b();Da();Gg();_h();qn();LR=be("vc-settings-"),Pb="https://cdn.discordapp.com/emojis/1026533090627174460.png",Mb="https://media.discordapp.net/stickers/1039992459209490513.png";Ib=vn(ER,"Vencord Settings")});var Ab,cs,Fh=g(()=>{"use strict";a();_();mb();yb();vb();bb();wb();yu();Cb();P();x();b();os();Ab=w({settingsLocation:{type:4,description:"Where to put the Vencord settings section",options:[{label:"At the very top",value:"top"},{label:"Above the Nitro section",value:"aboveNitro",default:!0},{label:"Below the Nitro section",value:"belowNitro"},{label:"Above Activity Settings",value:"aboveActivity"},{label:"Below Activity Settings",value:"belowActivity"},{label:"At the very bottom",value:"bottom"}]}}),cs=h({name:"Settings",description:"Adds Settings UI and debug info",authors:[p.Ven,p.Megu],required:!0,settings:Ab,patches:[{find:".versionHash",replacement:[{match:/\[\(0,\i\.jsxs?\)\((.{1,10}),(\{[^{}}]+\{.{0,20}.versionHash,.+?\})\)," "/,replace:(e,t,o)=>(o=o.replace(/children:\[.+\]/,""),`${e},$self.makeInfoElements(${t}, ${o})`)},{match:/copyValue:\i\.join\(" "\)/,replace:"$& + $self.getInfoString()"}]},{find:"Messages.ACTIVITY_SETTINGS",replacement:[{match:/(?<=section:(.{0,50})\.DIVIDER\}\))([,;])(?=.{0,200}(\i)\.push.{0,100}label:(\i)\.header)/,replace:(e,t,o,r,i)=>`${o} $self.addSettings(${r}, ${i}, ${t}) ${o}`},{match:/({(?=.+?function (\i).{0,120}(\i)=\i\.useMemo.{0,30}return \i\.useMemo\(\(\)=>\i\(\3).+?function\(\){return )\2(?=})/,replace:(e,t,o)=>`${t}$self.wrapSettingsHook(${o})`}]},{find:"Messages.USER_SETTINGS_ACTIONS_MENU_LABEL",replacement:{match:/(?<=function\((\i),\i\)\{)(?=let \i=Object.values\(\i.\i\).*?(\i\.\i)\.open\()/,replace:"$2.open($1);return;"}}],customSections:[],makeSettingsCategories(e){return[{section:e.HEADER,label:"Vencord",className:"vc-settings-header"},{section:"VencordSettings",label:"Vencord",element:Ib,className:"vc-settings"},{section:"VencordPlugins",label:"Plugins",element:Sb,className:"vc-plugins"},{section:"VencordThemes",label:"Themes",element:xb,className:"vc-themes"},!1,{section:"VencordCloud",label:"Cloud",element:hb,className:"vc-cloud"},{section:"VencordSettingsSync",label:"Backup & Restore",element:db,className:"vc-backup-restore"},!1,...this.customSections.map(t=>t(e)),{section:e.DIVIDER}].filter(Boolean)},isRightSpot({header:e,settingsChilds:t}){let o=t?.[0];if(o==="LOGOUT"||o==="SOCIAL_LINKS")return!0;let{settingsLocation:r}=Ab.store;if(r==="bottom")return o==="LOGOUT";if(r==="belowActivity")return o==="CHANGELOG";if(!e)return;let i={top:Se.Messages.USER_SETTINGS,aboveNitro:Se.Messages.BILLING_SETTINGS,belowNitro:Se.Messages.APP_SETTINGS,aboveActivity:Se.Messages.ACTIVITY_SETTINGS};return e===i[r]},patchedSettings:new WeakSet,addSettings(e,t,o){this.patchedSettings.has(e)||!this.isRightSpot(t)||(this.patchedSettings.add(e),e.push(...this.makeSettingsCategories(o)))},wrapSettingsHook(e){return(...t)=>{let o=e(...t);return this.patchedSettings.has(o)||o.unshift(...this.makeSettingsCategories({HEADER:"HEADER",DIVIDER:"DIVIDER",CUSTOM:"CUSTOM"})),o}},get electronVersion(){return VencordNative.native.getVersions().electron||window.armcord?.electron||null},get chromiumVersion(){try{return VencordNative.native.getVersions().chrome||navigator.userAgentData?.brands?.find(e=>e.brand==="Chromium"||e.brand==="Google Chrome")?.version||null}catch{return null}},get additionalInfo(){return" (Web)"},getInfoRows(){let{electronVersion:e,chromiumVersion:t,additionalInfo:o}=this,r=[`Vencord ${yn}${o}`];return e&&r.push(`Electron ${e}`),t&&r.push(`Chromium ${t}`),r},getInfoString(){return`
-`+this.getInfoRows().join(`
-`)},makeInfoElements(e,t){return this.getInfoRows().map((o,r)=>n(e,{key:r,...t},o))}})});var Bh={};et(Bh,{_modifyAccessories:()=>_R,accessories:()=>vu,addAccessory:()=>bi,removeAccessory:()=>Va});function bi(e,t,o){vu.set(e,{callback:t,position:o})}function Va(e){vu.delete(e)}function _R(e,t){for(let o of vu.values()){let r=o.callback(t);if(r!=null){if(!Array.isArray(r))r=[r];else if(r.length===0)continue;e.splice(o.position!=null?o.position<0?e.length+o.position:o.position:e.length,0,...r.filter(i=>i!=null))}}return e}var vu,el=g(()=>{"use strict";a();vu=new Map});var $h={};et($h,{UserSettings:()=>Uh,getUserSetting:()=>Nb,getUserSettingLazy:()=>Bo});function Nb(e,t){if(!Vencord.Plugins.isPluginEnabled("UserSettingsAPI"))throw new Error("Cannot use UserSettingsAPI without setting as dependency.");for(let o in Uh){let r=Uh[o];if(r.userSettingsAPIGroup===e&&r.userSettingsAPIName===t)return r}throw new Error(`UserSettingsAPI: Setting ${e}.${t} not found.`)}function Bo(e,t){return Mt(()=>Nb(e,t))}var Uh,Ar=g(()=>{"use strict";a();Vt();U();Uh=Jl('"textAndImages","renderSpoilers"')});async function kb(){let{RELEASE_CHANNEL:e}=window.GLOBAL_ENV,t=(()=>"armcord"in window?`ArmCord v${window.armcord.version}`:`${typeof unsafeWindow<"u"?"UserScript":"Web"} (${navigator.userAgent})`)(),o={Vencord:`v1.9.7 \u2022 [${yn}](o.name.localeCompare(r.name))}async function UT(e){let t=await fetch(e);if(!t.ok)throw new Error(`Failed to fetch ${e} - ${t.status}`);return t.blob()}async function p3(e,t){try{t.t==="Sticker"?await l3(e,t):await c3(e,t),X.show({message:`Successfully cloned ${t.name} to ${le.getGuild(e)?.name??"your server"}!`,type:X.Type.SUCCESS,id:X.genId()})}catch(o){let r="Something went wrong (check console!)";try{r=JSON.parse(o.text).message}catch{}new ee("EmoteCloner").error("Failed to clone",t.name,"to",e,o),X.show({message:"Failed to clone: "+r,type:X.Type.FAILURE,id:X.genId()})}}function f3({data:e}){let[t,o]=q.useState(!1),[r,i]=q.useState(e.name),[s,l]=q.useReducer(u=>u+1,0),c=q.useMemo(()=>u3(e),[e.id,s]);return n(m,null,n(S.FormTitle,{className:G.top20},"Custom Name"),n(Ta,{value:r,onChange:u=>{e.name=u,i(u)},validate:u=>e.t==="Emoji"&&u.length>2&&u.length<32&&m3.test(u)||e.t==="Sticker"&&u.length>2&&u.length<30||"Name must be between 2 and 32 characters and only contain alphanumeric characters"}),n("div",{style:{display:"flex",flexWrap:"wrap",gap:"1em",padding:"1em 0.5em",justifyContent:"center",alignItems:"center"}},c.map(u=>n(oe,{text:u.name},({onMouseLeave:d,onMouseEnter:f})=>n("div",{onMouseLeave:d,onMouseEnter:f,role:"button","aria-label":"Clone to "+u.name,"aria-disabled":t,style:{borderRadius:"50%",backgroundColor:"var(--background-secondary)",display:"inline-flex",justifyContent:"center",alignItems:"center",width:"4em",height:"4em",cursor:t?"not-allowed":"pointer",filter:t?"brightness(50%)":"none"},onClick:t?void 0:async()=>{o(!0),p3(u.id,e).finally(()=>{l(),o(!1)})}},u.icon?n("img",{"aria-hidden":!0,style:{borderRadius:"50%",width:"100%",height:"100%"},src:u.getIconURL(512,!0),alt:u.name}):n(S.FormText,{style:{fontSize:d3(u.acronym),width:"100%",overflow:"hidden",whiteSpace:"nowrap",textAlign:"center",cursor:t?"not-allowed":"pointer"}},u.acronym))))))}function pp(e,t){return n(E.MenuItem,{id:"emote-cloner",key:"emote-cloner",label:`Clone ${e}`,action:()=>ma(async()=>{let o=await t(),r={t:e,...o},i=M1(r);return s=>n(Te,{...s},n(Ee,null,n("img",{role:"presentation","aria-hidden":!0,src:i,alt:"",height:24,width:24,style:{marginRight:"0.5em"}}),n(S.FormText,null,"Clone ",r.name)),n(Ae,null,n(f3,{data:r})))})})}function $T(e){return new URL(e).pathname.endsWith(".gif")}var i3,s3,a3,d3,m3,g3,h3,dp,GT=g(()=>{"use strict";a();ho();wc();P();De();Ye();Ke();x();U();b();i3=Q("StickersStore"),s3=fe(".GUILD_EMOJIS(","EMOJI_UPLOAD_START"),a3=[,"png","png","json","gif"];d3=e=>[20,20,18,18,16,14,12][e.length]??4,m3=/^\w+$/i;g3=(e,t)=>{let{favoriteableId:o,itemHref:r,itemSrc:i,favoriteableType:s}=t??{};if(!o)return;let l=(()=>{switch(s){case"emoji":let c=t.message.content.match(RegExp(`|https://cdn\\.discordapp\\.com/emojis/${o}\\.`)),u=t.message.reactions.find(y=>y.emoji.id===o);if(!c&&!u)return;let d=(c&&c[1])??u?.emoji.name??"FakeNitroEmoji";return pp("Emoji",()=>({id:o,name:d,isAnimated:$T(r??i)}));case"sticker":return t.message.stickerItems.find(y=>y.id===o)?.format_type===3?void 0:pp("Sticker",()=>BT(o))}})();l&&Ve("copy-link",e)?.push(l)},h3=(e,t)=>{let{id:o,name:r,type:i}=t?.target?.dataset??{};if(!!o)if(i==="emoji"&&r){let s=t.target.firstChild;e.push(pp("Emoji",()=>({id:o,name:r,isAnimated:s&&$T(s.src)})))}else i==="sticker"&&!t.target.className?.includes("lottieCanvas")&&e.push(pp("Sticker",()=>BT(o)))},dp=h({name:"EmoteCloner",description:"Allows you to clone Emotes & Stickers to your own server (right click them)",tags:["StickerCloner"],authors:[p.Ven,p.Nuckyz],contextMenus:{message:g3,"expression-picker":h3}})});var I1,HT=g(()=>{a();(window.VencordStyles??=new Map).set("src/plugins/experiments/hideBugReport.css",{name:"src/plugins/experiments/hideBugReport.css",source:`#staff-help-popout-staff-help-bug-reporter {
- display: none;
-}
-`,classNames:{},dom:null});I1="src/plugins/experiments/hideBugReport.css"});var mp,zT,fp,WT=g(()=>{"use strict";a();_();tt();ne();gi();P();Ye();x();U();b();HT();mp=C("key","combo"),zT=w({toolbarDevMenu:{type:3,description:"Change the Help (?) toolbar button (top right in chat) to Discord's developer menu",default:!1,restartNeeded:!0}}),fp=h({name:"Experiments",description:"Enable Access to Experiments & other dev-only features in Discord!",authors:[p.Megu,p.Ven,p.Nickyux,p.BanTheNons,p.Nuckyz],settings:zT,patches:[{find:"Object.defineProperties(this,{isDeveloper",replacement:{match:/(?<={isDeveloper:\{[^}]+?,get:\(\)=>)\i/,replace:"true"}},{find:'type:"user",revision',replacement:{match:/!(\i)&&"CONNECTION_OPEN".+?;/g,replace:"$1=!0;"}},{find:'H1,title:"Experiments"',replacement:{match:'title:"Experiments",children:[',replace:"$&$self.WarningCard(),"}},{find:"toolbar:function",replacement:{match:/\i\.isStaff\(\)/,replace:"true"},predicate:()=>zT.store.toolbarDevMenu},{find:"useCanFavoriteChannel",replacement:{match:/\i\.isDM\(\)\|\|\i\.isThread\(\)/,replace:"false"}}],start:()=>fo(I1),stop:()=>_o(I1),settingsAboutComponent:()=>{let e=navigator.platform.includes("Mac"),t=e?"cmd":"ctrl",o=e?"opt":"alt";return n(q.Fragment,null,n(S.FormTitle,{tag:"h3"},"More Information"),n(S.FormText,{variant:"text-md/normal"},"You can open Discord's DevTools via "," ",n("div",{className:mp.combo,style:{display:"inline-flex"}},n("kbd",{className:mp.key},t)," +"," ",n("kbd",{className:mp.key},o)," +"," ",n("kbd",{className:mp.key},"O")," ")))},WarningCard:R.wrap(()=>n(Oo,{id:"vc-experiments-warning-card",className:G.bottom16},n(S.FormTitle,{tag:"h2"},"Hold on!!"),n(S.FormText,null,"Experiments are unreleased Discord features. They might not work, or even break your client or get your account disabled."),n(S.FormText,{className:G.top8},"Only use experiments if you know what you're doing. Vencord is not responsible for any damage caused by enabling experiments. If you don't know what an experiment does, ignore it. Do not ask us what experiments do either, we probably don't know."),n(S.FormText,{className:G.top8},'No, you cannot use server-side features like checking the "Send to Client" box.')),{noop:!0})})});var gp,jT=g(()=>{"use strict";a();P();x();gp=h({name:"F8Break",description:"Pause the client when you press F8 with DevTools (+ breakpoints) open.",authors:[p.lewisakura],start(){window.addEventListener("keydown",this.event)},stop(){window.removeEventListener("keydown",this.event)},event(e){if(e.code==="F8")debugger}})});var KT=W0((eee,qT)=>{"use strict";a();var Xn=qT.exports;(function e(t,o,r){function i(c,u){if(!o[c]){if(!t[c]){var d=typeof zs=="function"&&zs;if(!u&&d)return d(c,!0);if(s)return s(c,!0);throw new Error("Cannot find module '"+c+"'")}var f=o[c]={exports:{}};t[c][0].call(f.exports,function(y){var v=t[c][1][y];return i(v||y)},f,f.exports,e,t,o,r)}return o[c].exports}for(var s=typeof zs=="function"&&zs,l=0;l