You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
7.2 KiB

(function(){"use strict";const D=e=>typeof e.prev=="function"?e.prev:D(e.prev);var M=(e,n,t)=>{const r=n[e][t];return r===void 0?n[t]:D(r)};class O{constructor(n,t,r){this.data={id:n,func:(o,...i)=>r(o,typeof this.prev=="function"?this.prev:this.prev.data.func,i)},this.prev=t}}var B=(e,n,t,r)=>{const o=e[r][n];if(o.data.id===t){if(typeof o.prev=="function"){e[n]=o.prev,delete e[r][n];return}e[r][n]=o.prev,e[n]=o.prev.data.func;return}const i=a=>a&&typeof a.prev=="object"?(a.data=a.prev.data,a.prev=a.prev.prev,i(a.prev)):!0,f=a=>{if(!a)throw new Error("could not find unpatch");return typeof a.prev=="object"&&a.data.id!==t?f(a.prev):i(a)};let l=Object.assign({},o);f(l),e[r][n]=l,e[n]=l.data.func},T=function(e,n,t,r,o){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof n=="function"?e!==n||!o:!n.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?o.call(e,t):o?o.value=t:n.set(e,t),t},s=function(e,n,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof n=="function"?e!==n||!r:!n.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(e):r?r.value:n.get(e)},y,d,m,E;class x{constructor(n="simian"){y.add(this),d.set(this,void 0),m.set(this,void 0),T(this,d,Symbol(n),"f"),T(this,m,new Set,"f"),this.after=s(this,y,"m",E).call(this,"AFTER"),this.before=s(this,y,"m",E).call(this,"BEFORE"),this.instead=s(this,y,"m",E).call(this,"INSTEAD")}cleanupAll(){for(const n of s(this,m,"f")){for(const t in n[s(this,d,"f")]){const r=M(s(this,d,"f"),n,t);n[t]=r,n[s(this,d,"f")][t]=void 0}n[s(this,d,"f")]=void 0,delete n[s(this,d,"f")]}s(this,m,"f").clear()}}d=new WeakMap,m=new WeakMap,y=new WeakSet,E=function(n){return(t,r,o)=>{const i=r[t];if(typeof i!="function")throw new Error(`${t} is not a function on ${r}`);const f=Symbol();r[s(this,d,"f")]===void 0&&(r[s(this,d,"f")]={});let l;switch(n){case"AFTER":l=(h,v,_)=>{let w=v.apply(h,_);const S=o.apply(h,[_,w]);return typeof S!="undefined"&&(w=S),w};break;case"BEFORE":l=(h,v,_)=>{var w;let S=_;const F=(w=o.apply(h,[_]))!==null&&w!==void 0?w:_;return Array.isArray(F)&&(S=F),v.apply(h,S)};break;case"INSTEAD":l=(h,v,_)=>o.apply(h,[_,v.bind(h)]);break}let a=r[s(this,d,"f")][t];return a===void 0?a=new O(f,i,l):a=new O(f,a,l),r[s(this,d,"f")][t]=a,r[t]=function(){return a.data.func(this,...arguments)},Object.assign(r[t],i),s(this,m,"f").add(r),()=>B(r,t,f,s(this,d,"f"))}};function I(){let e={};return window.webpackChunkdiscord_app.push([[Math.random().toString(36)],{},n=>{e=n}]),e.c}function L(e,n){let t=[];for(const r in n){const o=n[r].exports;o&&(o.default&&o.__esModule&&e(o.default)?t.push(o.default):e(o)&&t.push(o))}return t}let p={modules:I(),filter:L,find:e=>p.filter(e,p.modules)[0],findAll:e=>p.filter(e,p.modules),findByProps:(...e)=>p.find(n=>e.every(t=>n[t]!==void 0)),findByPropsAll:(...e)=>p.findAll(n=>e.every(t=>n[t]!==void 0))};function $(){var e=!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent);if(!e||!indexedDB.databases)return Promise.resolve();var n;return new Promise(function(t){var r=function(){return indexedDB.databases().finally(t)};n=setInterval(r,100),r()}).finally(function(){return clearInterval(n)})}function u(e){return new Promise((n,t)=>{e.oncomplete=e.onsuccess=()=>n(e.result),e.onabort=e.onerror=()=>t(e.error)})}function A(e,n){const t=$().then(()=>{const r=indexedDB.open(e);return r.onupgradeneeded=()=>r.result.createObjectStore(n),u(r)});return(r,o)=>t.then(i=>o(i.transaction(n,r).objectStore(n)))}let P;function c(){return P||(P=A("keyval-store","keyval")),P}function g(e,n=c()){return n("readonly",t=>u(t.get(e)))}function b(e,n,t=c()){return t("readwrite",r=>(r.put(n,e),u(r.transaction)))}function U(e,n=c()){return n("readwrite",t=>(e.forEach(r=>t.put(r[1],r[0])),u(t.transaction)))}function W(e,n=c()){return n("readonly",t