@epic-web/workshop-app 5.3.7 → 5.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/client/assets/{_exerciseNumber-BnwWTYFw.js → _exerciseNumber-DvMYZgqk.js} +2 -2
- package/build/client/assets/{_exerciseNumber-BnwWTYFw.js.map → _exerciseNumber-DvMYZgqk.js.map} +1 -1
- package/build/client/assets/{_exerciseNumber_.finished-BfeMSie-.js → _exerciseNumber_.finished-DYN2QHN6.js} +2 -2
- package/build/client/assets/{_exerciseNumber_.finished-BfeMSie-.js.map → _exerciseNumber_.finished-DYN2QHN6.js.map} +1 -1
- package/build/client/assets/{_layout-Bpho30KN.js → _layout-BH5PQW0M.js} +2 -2
- package/build/client/assets/{_layout-Bpho30KN.js.map → _layout-BH5PQW0M.js.map} +1 -1
- package/build/client/assets/{_layout-pUNfVRe2.js → _layout-BK7mLImi.js} +2 -2
- package/build/client/assets/{_layout-pUNfVRe2.js.map → _layout-BK7mLImi.js.map} +1 -1
- package/build/client/assets/account-B5baO5pg.js +2 -0
- package/build/client/assets/account-B5baO5pg.js.map +1 -0
- package/build/client/assets/{diff-CyIaJAoJ.js → diff-C2Hm_DHX.js} +2 -2
- package/build/client/assets/{diff-CyIaJAoJ.js.map → diff-C2Hm_DHX.js.map} +1 -1
- package/build/client/assets/{diff-Cnw7IcG5.js → diff-CbIF8Oq1.js} +2 -2
- package/build/client/assets/{diff-Cnw7IcG5.js.map → diff-CbIF8Oq1.js.map} +1 -1
- package/build/client/assets/discord-BnQDHWJj.js +2 -0
- package/build/client/assets/discord-BnQDHWJj.js.map +1 -0
- package/build/client/assets/discord-DcHxc30v.js +2 -0
- package/build/client/assets/discord-DcHxc30v.js.map +1 -0
- package/build/client/assets/{epic-video-1XLXSFCL.js → epic-video-Bxtz3elt.js} +2 -2
- package/build/client/assets/{epic-video-1XLXSFCL.js.map → epic-video-Bxtz3elt.js.map} +1 -1
- package/build/client/assets/{finished-DjF_kSoF.js → finished--PGQDzya.js} +2 -2
- package/build/client/assets/{finished-DjF_kSoF.js.map → finished--PGQDzya.js.map} +1 -1
- package/build/client/assets/index-C2MH9l6b.js +2 -0
- package/build/client/assets/index-C2MH9l6b.js.map +1 -0
- package/build/client/assets/{index-f5Q6XZEy.js → index-oZkQrXic.js} +2 -2
- package/build/client/assets/{index-f5Q6XZEy.js.map → index-oZkQrXic.js.map} +1 -1
- package/build/client/assets/manifest-7f4f8707.js +1 -0
- package/build/client/assets/{mdx-DiFCTSLR.js → mdx-DIAWAXtT.js} +2 -2
- package/build/client/assets/{mdx-DiFCTSLR.js.map → mdx-DIAWAXtT.js.map} +1 -1
- package/build/client/assets/{onboarding-DXICEaMi.js → onboarding-BAVmCIKn.js} +2 -2
- package/build/client/assets/{onboarding-DXICEaMi.js.map → onboarding-BAVmCIKn.js.map} +1 -1
- package/build/client/assets/root-DCfiv1cO.js.map +1 -1
- package/build/client/assets/{test-CvzcNTDp.js → test-3x2HHA0t.js} +2 -2
- package/build/client/assets/{test-CvzcNTDp.js.map → test-3x2HHA0t.js.map} +1 -1
- package/build/client/assets/{tests-Bp85P9FF.js → tests-GmyhBOwD.js} +2 -2
- package/build/client/assets/{tests-Bp85P9FF.js.map → tests-GmyhBOwD.js.map} +1 -1
- package/build/client/assets/user-CFunCRfr.js +2 -0
- package/build/client/assets/user-CFunCRfr.js.map +1 -0
- package/build/server/index.js +117 -208
- package/build/server/index.js.map +1 -1
- package/package.json +3 -3
- package/build/client/assets/account-RJjysGnp.js +0 -2
- package/build/client/assets/account-RJjysGnp.js.map +0 -1
- package/build/client/assets/discord-DxisvcaU.js +0 -2
- package/build/client/assets/discord-DxisvcaU.js.map +0 -1
- package/build/client/assets/discord-lXkS53K3.js +0 -2
- package/build/client/assets/discord-lXkS53K3.js.map +0 -1
- package/build/client/assets/discord.callback-l0sNRNKZ.js +0 -2
- package/build/client/assets/discord.callback-l0sNRNKZ.js.map +0 -1
- package/build/client/assets/index-DZ0It6pH.js +0 -2
- package/build/client/assets/index-DZ0It6pH.js.map +0 -1
- package/build/client/assets/manifest-9328c766.js +0 -1
- package/build/client/assets/user-DJiL1Lk-.js +0 -2
- package/build/client/assets/user-DJiL1Lk-.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var ie=Object.defineProperty;var Ht=n=>{throw TypeError(n)};var se=(n,e,i)=>e in n?ie(n,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[e]=i;var v=(n,e,i)=>se(n,typeof e!="symbol"?e+"":e,i),Ft=(n,e,i)=>e.has(n)||Ht("Cannot "+i);var t=(n,e,i)=>(Ft(n,e,"read from private field"),i?i.call(n):e.get(n)),b=(n,e,i)=>e.has(n)?Ht("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,i),f=(n,e,i,s)=>(Ft(n,e,"write to private field"),s?s.call(n,i):e.set(n,i),i),c=(n,e,i)=>(Ft(n,e,"access private method"),i);var _t=(n,e,i,s)=>({set _(a){f(n,e,a,i)},get _(){return t(n,e,s)}});import{j as m,r as at}from"./index-BFGhCX_U.js";import{c as vt,I as ne,a as re,H as ht,A as oe}from"./misc-BJtHv_Jh.js";import{e as ae,L as $t,a as he,r as le,u as ce}from"./components-9EGYHTc_.js";import{V as ue,D as fe}from"./epic-video-1XLXSFCL.js";import{s as de}from"./progress-bar-Cj5R4Zk7.js";import{u as pe}from"./pe-ChIwTk8v.js";import{u as me}from"./request-info-DCIQLE6H.js";function ge(){const n=ae("root");if(!n)throw new Error("useApps requires a data object from the root loader");return n.apps}function qt(n){const e=he();return at.useEffect(()=>{e.state==="idle"&&e.data!=null&&(n==null||n("fetcher-done"))},[e,n]),e}function be({file:n,appFile:e,appName:i,syncTo:s,line:a,column:r,children:o,onUpdate:u}){var _;const h=qt(u),g=pe(),O=typeof e=="string"?[e]:e,w=n?"file":e?"appFile":"",L=s!=null&&s.file?"file":s!=null&&s.appFile?"appFile":"";return m.jsxs(h.Form,{action:"/launch-editor",method:"POST",className:"flex items-center",children:[g,de,m.jsx("input",{type:"hidden",name:"line",value:a}),m.jsx("input",{type:"hidden",name:"column",value:r}),m.jsx("input",{type:"hidden",name:"type",value:w}),m.jsx("input",{type:"hidden",name:"file",value:n}),m.jsx("input",{type:"hidden",name:"appName",value:i}),O==null?void 0:O.map(j=>m.jsx("input",{type:"hidden",name:"appFile",value:j},j)),s?m.jsxs(m.Fragment,{children:[m.jsx("input",{type:"hidden",name:"syncTo.type",value:L}),m.jsx("input",{type:"hidden",name:"syncTo.file",value:s.file}),m.jsx("input",{type:"hidden",name:"syncTo.appName",value:s.appName}),m.jsx("input",{type:"hidden",name:"syncTo.appFile",value:s.appFile})]}):null,m.jsx("button",{type:"submit",className:vt("launch_button",h.state==="idle"?null:"cursor-progress",((_=h.data)==null?void 0:_.status)==="error"?"cursor-not-allowed":null),children:o})]})}function we({file:n,appFile:e,appName:i,line:s,children:a}){const r=ge(),o=me();if(Array.isArray(e))return m.jsx("div",{children:"Cannot open more than one file"});if(n){const g=O=>O.replace(/\\/g,"/");return m.jsx("a",{className:"launch_button !no-underline",href:g(n).replace(g(ENV.EPICSHOP_CONTEXT_CWD),ENV.EPICSHOP_GITHUB_ROOT)+(s?`#L${s}`:""),rel:"noreferrer",target:"_blank",children:a})}const u=r.find(g=>g.name===i),h=[...(u==null?void 0:u.relativePath.split(o.separator))??[],e+(s?`#L${s}`:"")].join("/");return m.jsx("a",{className:"launch_button !no-underline",href:`${ENV.EPICSHOP_GITHUB_ROOT}/${h}`,rel:"noreferrer",target:"_blank",children:a})}function Ie({appFile:n="README.mdx",appName:e,file:i,relativePath:s}){const a=qt(),r=u=>{if(!u.altKey||ENV.EPICSHOP_DEPLOYED)return;u.preventDefault();const h=new FormData,g=i?"file":"appFile";h.append(g,i??n),h.append("type",g),e&&h.append("appName",e),a.submit(h,{method:"POST",action:"/launch-editor"})},o=ENV.EPICSHOP_GITHUB_ROOT.replace(/\/tree\/|\/blob\//,"/edit/");return m.jsxs($t,{className:"self-center font-mono text-sm",onClick:r,target:"_blank",to:`${o}/${s}/${n}`.replace(/\\/g,"/"),children:[m.jsx("span",{className:"block md:hidden",children:"Edit on GitHub"}),m.jsx("span",{className:"hidden md:block",children:"Edit this page on GitHub"})]})}const Xt=ENV.EPICSHOP_DEPLOYED?we:be,lt=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Yt=new Set,Tt=typeof process=="object"&&process?process:{},Kt=(n,e,i,s)=>{typeof Tt.emitWarning=="function"?Tt.emitWarning(n,e,i,s):console.error(`[${i}] ${e}: ${n}`)};let xt=globalThis.AbortController,kt=globalThis.AbortSignal;var Ut;if(typeof xt>"u"){kt=class{constructor(){v(this,"onabort");v(this,"_onabort",[]);v(this,"reason");v(this,"aborted",!1)}addEventListener(s,a){this._onabort.push(a)}},xt=class{constructor(){v(this,"signal",new kt);e()}abort(s){var a,r;if(!this.signal.aborted){this.signal.reason=s,this.signal.aborted=!0;for(const o of this.signal._onabort)o(s);(r=(a=this.signal).onabort)==null||r.call(a,s)}}};let n=((Ut=Tt.env)==null?void 0:Ut.LRU_CACHE_IGNORE_AC_WARNING)!=="1";const e=()=>{n&&(n=!1,Kt("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}const _e=n=>!Yt.has(n),Q=n=>n&&n===Math.floor(n)&&n>0&&isFinite(n),Zt=n=>Q(n)?n<=Math.pow(2,8)?Uint8Array:n<=Math.pow(2,16)?Uint16Array:n<=Math.pow(2,32)?Uint32Array:n<=Number.MAX_SAFE_INTEGER?yt:null:null;class yt extends Array{constructor(e){super(e),this.fill(0)}}var ct;const nt=class nt{constructor(e,i){v(this,"heap");v(this,"length");if(!t(nt,ct))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new i(e),this.length=0}static create(e){const i=Zt(e);if(!i)return[];f(nt,ct,!0);const s=new nt(e,i);return f(nt,ct,!1),s}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}};ct=new WeakMap,b(nt,ct,!1);let Dt=nt;var Vt,Bt,U,M,V,B,ut,ft,F,$,A,E,p,R,I,P,T,q,D,X,Y,G,K,st,N,l,Pt,rt,Z,gt,H,Jt,ot,dt,bt,tt,et,Rt,St,Et,S,Nt,mt,it,Wt;const It=class It{constructor(e){b(this,l);b(this,U);b(this,M);b(this,V);b(this,B);b(this,ut);b(this,ft);v(this,"ttl");v(this,"ttlResolution");v(this,"ttlAutopurge");v(this,"updateAgeOnGet");v(this,"updateAgeOnHas");v(this,"allowStale");v(this,"noDisposeOnSet");v(this,"noUpdateTTL");v(this,"maxEntrySize");v(this,"sizeCalculation");v(this,"noDeleteOnFetchRejection");v(this,"noDeleteOnStaleGet");v(this,"allowStaleOnFetchAbort");v(this,"allowStaleOnFetchRejection");v(this,"ignoreFetchAbort");b(this,F);b(this,$);b(this,A);b(this,E);b(this,p);b(this,R);b(this,I);b(this,P);b(this,T);b(this,q);b(this,D);b(this,X);b(this,Y);b(this,G);b(this,K);b(this,st);b(this,N);b(this,rt,()=>{});b(this,Z,()=>{});b(this,gt,()=>{});b(this,H,()=>!1);b(this,ot,e=>{});b(this,dt,(e,i,s)=>{});b(this,bt,(e,i,s,a)=>{if(s||a)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});v(this,Vt,"LRUCache");const{max:i=0,ttl:s,ttlResolution:a=1,ttlAutopurge:r,updateAgeOnGet:o,updateAgeOnHas:u,allowStale:h,dispose:g,disposeAfter:O,noDisposeOnSet:w,noUpdateTTL:L,maxSize:_=0,maxEntrySize:j=0,sizeCalculation:x,fetchMethod:C,memoMethod:d,noDeleteOnFetchRejection:y,noDeleteOnStaleGet:W,allowStaleOnFetchRejection:z,allowStaleOnFetchAbort:k,ignoreFetchAbort:pt}=e;if(i!==0&&!Q(i))throw new TypeError("max option must be a nonnegative integer");const J=i?Zt(i):Array;if(!J)throw new Error("invalid max value: "+i);if(f(this,U,i),f(this,M,_),this.maxEntrySize=j||t(this,M),this.sizeCalculation=x,this.sizeCalculation){if(!t(this,M)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(d!==void 0&&typeof d!="function")throw new TypeError("memoMethod must be a function if defined");if(f(this,ft,d),C!==void 0&&typeof C!="function")throw new TypeError("fetchMethod must be a function if specified");if(f(this,ut,C),f(this,st,!!C),f(this,A,new Map),f(this,E,new Array(i).fill(void 0)),f(this,p,new Array(i).fill(void 0)),f(this,R,new J(i)),f(this,I,new J(i)),f(this,P,0),f(this,T,0),f(this,q,Dt.create(i)),f(this,F,0),f(this,$,0),typeof g=="function"&&f(this,V,g),typeof O=="function"?(f(this,B,O),f(this,D,[])):(f(this,B,void 0),f(this,D,void 0)),f(this,K,!!t(this,V)),f(this,N,!!t(this,B)),this.noDisposeOnSet=!!w,this.noUpdateTTL=!!L,this.noDeleteOnFetchRejection=!!y,this.allowStaleOnFetchRejection=!!z,this.allowStaleOnFetchAbort=!!k,this.ignoreFetchAbort=!!pt,this.maxEntrySize!==0){if(t(this,M)!==0&&!Q(t(this,M)))throw new TypeError("maxSize must be a positive integer if specified");if(!Q(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");c(this,l,Jt).call(this)}if(this.allowStale=!!h,this.noDeleteOnStaleGet=!!W,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!u,this.ttlResolution=Q(a)||a===0?a:1,this.ttlAutopurge=!!r,this.ttl=s||0,this.ttl){if(!Q(this.ttl))throw new TypeError("ttl must be a positive integer if specified");c(this,l,Pt).call(this)}if(t(this,U)===0&&this.ttl===0&&t(this,M)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!t(this,U)&&!t(this,M)){const wt="LRU_CACHE_UNBOUNDED";_e(wt)&&(Yt.add(wt),Kt("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",wt,It))}}static unsafeExposeInternals(e){return{starts:t(e,Y),ttls:t(e,G),sizes:t(e,X),keyMap:t(e,A),keyList:t(e,E),valList:t(e,p),next:t(e,R),prev:t(e,I),get head(){return t(e,P)},get tail(){return t(e,T)},free:t(e,q),isBackgroundFetch:i=>{var s;return c(s=e,l,S).call(s,i)},backgroundFetch:(i,s,a,r)=>{var o;return c(o=e,l,Et).call(o,i,s,a,r)},moveToTail:i=>{var s;return c(s=e,l,mt).call(s,i)},indexes:i=>{var s;return c(s=e,l,tt).call(s,i)},rindexes:i=>{var s;return c(s=e,l,et).call(s,i)},isStale:i=>{var s;return t(s=e,H).call(s,i)}}}get max(){return t(this,U)}get maxSize(){return t(this,M)}get calculatedSize(){return t(this,$)}get size(){return t(this,F)}get fetchMethod(){return t(this,ut)}get memoMethod(){return t(this,ft)}get dispose(){return t(this,V)}get disposeAfter(){return t(this,B)}getRemainingTTL(e){return t(this,A).has(e)?1/0:0}*entries(){for(const e of c(this,l,tt).call(this))t(this,p)[e]!==void 0&&t(this,E)[e]!==void 0&&!c(this,l,S).call(this,t(this,p)[e])&&(yield[t(this,E)[e],t(this,p)[e]])}*rentries(){for(const e of c(this,l,et).call(this))t(this,p)[e]!==void 0&&t(this,E)[e]!==void 0&&!c(this,l,S).call(this,t(this,p)[e])&&(yield[t(this,E)[e],t(this,p)[e]])}*keys(){for(const e of c(this,l,tt).call(this)){const i=t(this,E)[e];i!==void 0&&!c(this,l,S).call(this,t(this,p)[e])&&(yield i)}}*rkeys(){for(const e of c(this,l,et).call(this)){const i=t(this,E)[e];i!==void 0&&!c(this,l,S).call(this,t(this,p)[e])&&(yield i)}}*values(){for(const e of c(this,l,tt).call(this))t(this,p)[e]!==void 0&&!c(this,l,S).call(this,t(this,p)[e])&&(yield t(this,p)[e])}*rvalues(){for(const e of c(this,l,et).call(this))t(this,p)[e]!==void 0&&!c(this,l,S).call(this,t(this,p)[e])&&(yield t(this,p)[e])}[(Bt=Symbol.iterator,Vt=Symbol.toStringTag,Bt)](){return this.entries()}find(e,i={}){for(const s of c(this,l,tt).call(this)){const a=t(this,p)[s],r=c(this,l,S).call(this,a)?a.__staleWhileFetching:a;if(r!==void 0&&e(r,t(this,E)[s],this))return this.get(t(this,E)[s],i)}}forEach(e,i=this){for(const s of c(this,l,tt).call(this)){const a=t(this,p)[s],r=c(this,l,S).call(this,a)?a.__staleWhileFetching:a;r!==void 0&&e.call(i,r,t(this,E)[s],this)}}rforEach(e,i=this){for(const s of c(this,l,et).call(this)){const a=t(this,p)[s],r=c(this,l,S).call(this,a)?a.__staleWhileFetching:a;r!==void 0&&e.call(i,r,t(this,E)[s],this)}}purgeStale(){let e=!1;for(const i of c(this,l,et).call(this,{allowStale:!0}))t(this,H).call(this,i)&&(c(this,l,it).call(this,t(this,E)[i],"expire"),e=!0);return e}info(e){const i=t(this,A).get(e);if(i===void 0)return;const s=t(this,p)[i],a=c(this,l,S).call(this,s)?s.__staleWhileFetching:s;if(a===void 0)return;const r={value:a};if(t(this,G)&&t(this,Y)){const o=t(this,G)[i],u=t(this,Y)[i];if(o&&u){const h=o-(lt.now()-u);r.ttl=h,r.start=Date.now()}}return t(this,X)&&(r.size=t(this,X)[i]),r}dump(){const e=[];for(const i of c(this,l,tt).call(this,{allowStale:!0})){const s=t(this,E)[i],a=t(this,p)[i],r=c(this,l,S).call(this,a)?a.__staleWhileFetching:a;if(r===void 0||s===void 0)continue;const o={value:r};if(t(this,G)&&t(this,Y)){o.ttl=t(this,G)[i];const u=lt.now()-t(this,Y)[i];o.start=Math.floor(Date.now()-u)}t(this,X)&&(o.size=t(this,X)[i]),e.unshift([s,o])}return e}load(e){this.clear();for(const[i,s]of e){if(s.start){const a=Date.now()-s.start;s.start=lt.now()-a}this.set(i,s.value,s)}}set(e,i,s={}){var L,_,j,x,C;if(i===void 0)return this.delete(e),this;const{ttl:a=this.ttl,start:r,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:u=this.sizeCalculation,status:h}=s;let{noUpdateTTL:g=this.noUpdateTTL}=s;const O=t(this,bt).call(this,e,i,s.size||0,u);if(this.maxEntrySize&&O>this.maxEntrySize)return h&&(h.set="miss",h.maxEntrySizeExceeded=!0),c(this,l,it).call(this,e,"set"),this;let w=t(this,F)===0?void 0:t(this,A).get(e);if(w===void 0)w=t(this,F)===0?t(this,T):t(this,q).length!==0?t(this,q).pop():t(this,F)===t(this,U)?c(this,l,St).call(this,!1):t(this,F),t(this,E)[w]=e,t(this,p)[w]=i,t(this,A).set(e,w),t(this,R)[t(this,T)]=w,t(this,I)[w]=t(this,T),f(this,T,w),_t(this,F)._++,t(this,dt).call(this,w,O,h),h&&(h.set="add"),g=!1;else{c(this,l,mt).call(this,w);const d=t(this,p)[w];if(i!==d){if(t(this,st)&&c(this,l,S).call(this,d)){d.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:y}=d;y!==void 0&&!o&&(t(this,K)&&((L=t(this,V))==null||L.call(this,y,e,"set")),t(this,N)&&((_=t(this,D))==null||_.push([y,e,"set"])))}else o||(t(this,K)&&((j=t(this,V))==null||j.call(this,d,e,"set")),t(this,N)&&((x=t(this,D))==null||x.push([d,e,"set"])));if(t(this,ot).call(this,w),t(this,dt).call(this,w,O,h),t(this,p)[w]=i,h){h.set="replace";const y=d&&c(this,l,S).call(this,d)?d.__staleWhileFetching:d;y!==void 0&&(h.oldValue=y)}}else h&&(h.set="update")}if(a!==0&&!t(this,G)&&c(this,l,Pt).call(this),t(this,G)&&(g||t(this,gt).call(this,w,a,r),h&&t(this,Z).call(this,h,w)),!o&&t(this,N)&&t(this,D)){const d=t(this,D);let y;for(;y=d==null?void 0:d.shift();)(C=t(this,B))==null||C.call(this,...y)}return this}pop(){var e;try{for(;t(this,F);){const i=t(this,p)[t(this,P)];if(c(this,l,St).call(this,!0),c(this,l,S).call(this,i)){if(i.__staleWhileFetching)return i.__staleWhileFetching}else if(i!==void 0)return i}}finally{if(t(this,N)&&t(this,D)){const i=t(this,D);let s;for(;s=i==null?void 0:i.shift();)(e=t(this,B))==null||e.call(this,...s)}}}has(e,i={}){const{updateAgeOnHas:s=this.updateAgeOnHas,status:a}=i,r=t(this,A).get(e);if(r!==void 0){const o=t(this,p)[r];if(c(this,l,S).call(this,o)&&o.__staleWhileFetching===void 0)return!1;if(t(this,H).call(this,r))a&&(a.has="stale",t(this,Z).call(this,a,r));else return s&&t(this,rt).call(this,r),a&&(a.has="hit",t(this,Z).call(this,a,r)),!0}else a&&(a.has="miss");return!1}peek(e,i={}){const{allowStale:s=this.allowStale}=i,a=t(this,A).get(e);if(a===void 0||!s&&t(this,H).call(this,a))return;const r=t(this,p)[a];return c(this,l,S).call(this,r)?r.__staleWhileFetching:r}async fetch(e,i={}){const{allowStale:s=this.allowStale,updateAgeOnGet:a=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:u=this.noDisposeOnSet,size:h=0,sizeCalculation:g=this.sizeCalculation,noUpdateTTL:O=this.noUpdateTTL,noDeleteOnFetchRejection:w=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:L=this.allowStaleOnFetchRejection,ignoreFetchAbort:_=this.ignoreFetchAbort,allowStaleOnFetchAbort:j=this.allowStaleOnFetchAbort,context:x,forceRefresh:C=!1,status:d,signal:y}=i;if(!t(this,st))return d&&(d.fetch="get"),this.get(e,{allowStale:s,updateAgeOnGet:a,noDeleteOnStaleGet:r,status:d});const W={allowStale:s,updateAgeOnGet:a,noDeleteOnStaleGet:r,ttl:o,noDisposeOnSet:u,size:h,sizeCalculation:g,noUpdateTTL:O,noDeleteOnFetchRejection:w,allowStaleOnFetchRejection:L,allowStaleOnFetchAbort:j,ignoreFetchAbort:_,status:d,signal:y};let z=t(this,A).get(e);if(z===void 0){d&&(d.fetch="miss");const k=c(this,l,Et).call(this,e,z,W,x);return k.__returned=k}else{const k=t(this,p)[z];if(c(this,l,S).call(this,k)){const Gt=s&&k.__staleWhileFetching!==void 0;return d&&(d.fetch="inflight",Gt&&(d.returnedStale=!0)),Gt?k.__staleWhileFetching:k.__returned=k}const pt=t(this,H).call(this,z);if(!C&&!pt)return d&&(d.fetch="hit"),c(this,l,mt).call(this,z),a&&t(this,rt).call(this,z),d&&t(this,Z).call(this,d,z),k;const J=c(this,l,Et).call(this,e,z,W,x),At=J.__staleWhileFetching!==void 0&&s;return d&&(d.fetch=pt?"stale":"refresh",At&&pt&&(d.returnedStale=!0)),At?J.__staleWhileFetching:J.__returned=J}}async forceFetch(e,i={}){const s=await this.fetch(e,i);if(s===void 0)throw new Error("fetch() returned undefined");return s}memo(e,i={}){const s=t(this,ft);if(!s)throw new Error("no memoMethod provided to constructor");const{context:a,forceRefresh:r,...o}=i,u=this.get(e,o);if(!r&&u!==void 0)return u;const h=s(e,u,{options:o,context:a});return this.set(e,h,o),h}get(e,i={}){const{allowStale:s=this.allowStale,updateAgeOnGet:a=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,status:o}=i,u=t(this,A).get(e);if(u!==void 0){const h=t(this,p)[u],g=c(this,l,S).call(this,h);return o&&t(this,Z).call(this,o,u),t(this,H).call(this,u)?(o&&(o.get="stale"),g?(o&&s&&h.__staleWhileFetching!==void 0&&(o.returnedStale=!0),s?h.__staleWhileFetching:void 0):(r||c(this,l,it).call(this,e,"expire"),o&&s&&(o.returnedStale=!0),s?h:void 0)):(o&&(o.get="hit"),g?h.__staleWhileFetching:(c(this,l,mt).call(this,u),a&&t(this,rt).call(this,u),h))}else o&&(o.get="miss")}delete(e){return c(this,l,it).call(this,e,"delete")}clear(){return c(this,l,Wt).call(this,"delete")}};U=new WeakMap,M=new WeakMap,V=new WeakMap,B=new WeakMap,ut=new WeakMap,ft=new WeakMap,F=new WeakMap,$=new WeakMap,A=new WeakMap,E=new WeakMap,p=new WeakMap,R=new WeakMap,I=new WeakMap,P=new WeakMap,T=new WeakMap,q=new WeakMap,D=new WeakMap,X=new WeakMap,Y=new WeakMap,G=new WeakMap,K=new WeakMap,st=new WeakMap,N=new WeakMap,l=new WeakSet,Pt=function(){const e=new yt(t(this,U)),i=new yt(t(this,U));f(this,G,e),f(this,Y,i),f(this,gt,(r,o,u=lt.now())=>{if(i[r]=o!==0?u:0,e[r]=o,o!==0&&this.ttlAutopurge){const h=setTimeout(()=>{t(this,H).call(this,r)&&c(this,l,it).call(this,t(this,E)[r],"expire")},o+1);h.unref&&h.unref()}}),f(this,rt,r=>{i[r]=e[r]!==0?lt.now():0}),f(this,Z,(r,o)=>{if(e[o]){const u=e[o],h=i[o];if(!u||!h)return;r.ttl=u,r.start=h,r.now=s||a();const g=r.now-h;r.remainingTTL=u-g}});let s=0;const a=()=>{const r=lt.now();if(this.ttlResolution>0){s=r;const o=setTimeout(()=>s=0,this.ttlResolution);o.unref&&o.unref()}return r};this.getRemainingTTL=r=>{const o=t(this,A).get(r);if(o===void 0)return 0;const u=e[o],h=i[o];if(!u||!h)return 1/0;const g=(s||a())-h;return u-g},f(this,H,r=>{const o=i[r],u=e[r];return!!u&&!!o&&(s||a())-o>u})},rt=new WeakMap,Z=new WeakMap,gt=new WeakMap,H=new WeakMap,Jt=function(){const e=new yt(t(this,U));f(this,$,0),f(this,X,e),f(this,ot,i=>{f(this,$,t(this,$)-e[i]),e[i]=0}),f(this,bt,(i,s,a,r)=>{if(c(this,l,S).call(this,s))return 0;if(!Q(a))if(r){if(typeof r!="function")throw new TypeError("sizeCalculation must be a function");if(a=r(s,i),!Q(a))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return a}),f(this,dt,(i,s,a)=>{if(e[i]=s,t(this,M)){const r=t(this,M)-e[i];for(;t(this,$)>r;)c(this,l,St).call(this,!0)}f(this,$,t(this,$)+e[i]),a&&(a.entrySize=s,a.totalCalculatedSize=t(this,$))})},ot=new WeakMap,dt=new WeakMap,bt=new WeakMap,tt=function*({allowStale:e=this.allowStale}={}){if(t(this,F))for(let i=t(this,T);!(!c(this,l,Rt).call(this,i)||((e||!t(this,H).call(this,i))&&(yield i),i===t(this,P)));)i=t(this,I)[i]},et=function*({allowStale:e=this.allowStale}={}){if(t(this,F))for(let i=t(this,P);!(!c(this,l,Rt).call(this,i)||((e||!t(this,H).call(this,i))&&(yield i),i===t(this,T)));)i=t(this,R)[i]},Rt=function(e){return e!==void 0&&t(this,A).get(t(this,E)[e])===e},St=function(e){var r,o;const i=t(this,P),s=t(this,E)[i],a=t(this,p)[i];return t(this,st)&&c(this,l,S).call(this,a)?a.__abortController.abort(new Error("evicted")):(t(this,K)||t(this,N))&&(t(this,K)&&((r=t(this,V))==null||r.call(this,a,s,"evict")),t(this,N)&&((o=t(this,D))==null||o.push([a,s,"evict"]))),t(this,ot).call(this,i),e&&(t(this,E)[i]=void 0,t(this,p)[i]=void 0,t(this,q).push(i)),t(this,F)===1?(f(this,P,f(this,T,0)),t(this,q).length=0):f(this,P,t(this,R)[i]),t(this,A).delete(s),_t(this,F)._--,i},Et=function(e,i,s,a){const r=i===void 0?void 0:t(this,p)[i];if(c(this,l,S).call(this,r))return r;const o=new xt,{signal:u}=s;u==null||u.addEventListener("abort",()=>o.abort(u.reason),{signal:o.signal});const h={signal:o.signal,options:s,context:a},g=(x,C=!1)=>{const{aborted:d}=o.signal,y=s.ignoreFetchAbort&&x!==void 0;if(s.status&&(d&&!C?(s.status.fetchAborted=!0,s.status.fetchError=o.signal.reason,y&&(s.status.fetchAbortIgnored=!0)):s.status.fetchResolved=!0),d&&!y&&!C)return w(o.signal.reason);const W=_;return t(this,p)[i]===_&&(x===void 0?W.__staleWhileFetching?t(this,p)[i]=W.__staleWhileFetching:c(this,l,it).call(this,e,"fetch"):(s.status&&(s.status.fetchUpdated=!0),this.set(e,x,h.options))),x},O=x=>(s.status&&(s.status.fetchRejected=!0,s.status.fetchError=x),w(x)),w=x=>{const{aborted:C}=o.signal,d=C&&s.allowStaleOnFetchAbort,y=d||s.allowStaleOnFetchRejection,W=y||s.noDeleteOnFetchRejection,z=_;if(t(this,p)[i]===_&&(!W||z.__staleWhileFetching===void 0?c(this,l,it).call(this,e,"fetch"):d||(t(this,p)[i]=z.__staleWhileFetching)),y)return s.status&&z.__staleWhileFetching!==void 0&&(s.status.returnedStale=!0),z.__staleWhileFetching;if(z.__returned===z)throw x},L=(x,C)=>{var y;const d=(y=t(this,ut))==null?void 0:y.call(this,e,r,h);d&&d instanceof Promise&&d.then(W=>x(W===void 0?void 0:W),C),o.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(x(void 0),s.allowStaleOnFetchAbort&&(x=W=>g(W,!0)))})};s.status&&(s.status.fetchDispatched=!0);const _=new Promise(L).then(g,O),j=Object.assign(_,{__abortController:o,__staleWhileFetching:r,__returned:void 0});return i===void 0?(this.set(e,j,{...h.options,status:void 0}),i=t(this,A).get(e)):t(this,p)[i]=j,j},S=function(e){if(!t(this,st))return!1;const i=e;return!!i&&i instanceof Promise&&i.hasOwnProperty("__staleWhileFetching")&&i.__abortController instanceof xt},Nt=function(e,i){t(this,I)[i]=e,t(this,R)[e]=i},mt=function(e){e!==t(this,T)&&(e===t(this,P)?f(this,P,t(this,R)[e]):c(this,l,Nt).call(this,t(this,I)[e],t(this,R)[e]),c(this,l,Nt).call(this,t(this,T),e),f(this,T,e))},it=function(e,i){var a,r,o,u;let s=!1;if(t(this,F)!==0){const h=t(this,A).get(e);if(h!==void 0)if(s=!0,t(this,F)===1)c(this,l,Wt).call(this,i);else{t(this,ot).call(this,h);const g=t(this,p)[h];if(c(this,l,S).call(this,g)?g.__abortController.abort(new Error("deleted")):(t(this,K)||t(this,N))&&(t(this,K)&&((a=t(this,V))==null||a.call(this,g,e,i)),t(this,N)&&((r=t(this,D))==null||r.push([g,e,i]))),t(this,A).delete(e),t(this,E)[h]=void 0,t(this,p)[h]=void 0,h===t(this,T))f(this,T,t(this,I)[h]);else if(h===t(this,P))f(this,P,t(this,R)[h]);else{const O=t(this,I)[h];t(this,R)[O]=t(this,R)[h];const w=t(this,R)[h];t(this,I)[w]=t(this,I)[h]}_t(this,F)._--,t(this,q).push(h)}}if(t(this,N)&&((o=t(this,D))!=null&&o.length)){const h=t(this,D);let g;for(;g=h==null?void 0:h.shift();)(u=t(this,B))==null||u.call(this,...g)}return s},Wt=function(e){var i,s,a;for(const r of c(this,l,et).call(this,{allowStale:!0})){const o=t(this,p)[r];if(c(this,l,S).call(this,o))o.__abortController.abort(new Error("deleted"));else{const u=t(this,E)[r];t(this,K)&&((i=t(this,V))==null||i.call(this,o,u,e)),t(this,N)&&((s=t(this,D))==null||s.push([o,u,e]))}}if(t(this,A).clear(),t(this,p).fill(void 0),t(this,E).fill(void 0),t(this,G)&&t(this,Y)&&(t(this,G).fill(0),t(this,Y).fill(0)),t(this,X)&&t(this,X).fill(0),f(this,P,0),f(this,T,0),t(this,q).length=0,f(this,$,0),f(this,F,0),t(this,N)&&t(this,D)){const r=t(this,D);let o;for(;o=r==null?void 0:r.shift();)(a=t(this,B))==null||a.call(this,...o)}};let zt=It;var Ot={};Object.defineProperty(Ot,"__esModule",{value:!0});Ot.getMDXComponent=xe;Ot.getMDXExport=te;var ye=Mt(at),Se=Mt(m),Ee=Mt(le);function Qt(n){if(typeof WeakMap!="function")return null;var e=new WeakMap,i=new WeakMap;return(Qt=function(s){return s?i:e})(n)}function Mt(n,e){if(n&&n.__esModule)return n;if(n===null||typeof n!="object"&&typeof n!="function")return{default:n};var i=Qt(e);if(i&&i.has(n))return i.get(n);var s={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in n)if(r!=="default"&&{}.hasOwnProperty.call(n,r)){var o=a?Object.getOwnPropertyDescriptor(n,r):null;o&&(o.get||o.set)?Object.defineProperty(s,r,o):s[r]=n[r]}return s.default=n,i&&i.set(n,s),s}function xe(n,e){return te(n,e).default}function te(n,e){const i={React:ye,ReactDOM:Ee,_jsx_runtime:Se,...e};return new Function(...Object.keys(i),n)(...Object.values(i))}var ve=Ot;const jt=n=>n.replace(/\\/g,"/");function ee(n,e,i){const[,s]=n.replace(/\\|\//g,e).split(`${i==="playground"?"example":"exercises"}${e}`);return s}const Lt="border-border bg-[var(--shiki-background)] hover:bg-foreground/20 active:bg-foreground/30 box-content block rounded border-2 px-2 py-0.5 font-mono text-xs font-semibold outline-none transition duration-300 ease-in-out";function Oe({"data-buttons":n,"data-filename":e,"data-fullpath":i,"data-sep":s="/","data-start":a,"data-type":r}){var L;const o=ce();if(r==="other"||!n||!e||!i)return null;const u=jt(((L=o[o.type])==null?void 0:L.fullPath)??""),h=!i.startsWith(u),g=ENV.EPICSHOP_DEPLOYED?["problem","solution"]:["problem","solution","playground"],O=n.split(","),w=g.filter(_=>O.includes(_));return m.jsx(m.Fragment,{children:w.map(_=>{var d;const j=o[_];if(_==="playground"){const y=o.playground&&o.playground.appName!==((d=o.problem)==null?void 0:d.name);if(!j||y||h)return m.jsxs("button",{className:vt(Lt,"cursor-not-allowed"),title:y?"Playground is not set to the right app":h?"This file is from different app":"You must 'Set to Playground' before opening a file",children:[m.jsx("span",{className:"uppercase",children:"Open"})," in ",_]},_)}if(!j||!j.fullPath)return null;const x=[jt(j.fullPath),jt(e)].join(s),C=ee(x,s,_);return m.jsx(Xt,{file:x,line:Number(a??1),children:m.jsxs("span",{title:C,className:Lt,children:[m.jsx("span",{className:"uppercase",children:"Open"})," in ",_]})},_)})})}function Ae(){const[n,e]=at.useState(!1);return at.useEffect(()=>{if(n){const i=setTimeout(()=>e(!1),1500);return()=>clearTimeout(i)}},[n]),m.jsx("button",{className:re(Lt,"w-12 uppercase"),onClick:i=>{var r,o,u;e(!0);const a=((u=(o=(r=i.currentTarget.parentElement)==null?void 0:r.parentElement)==null?void 0:o.querySelector("pre"))==null?void 0:u.textContent)||"";navigator.clipboard.writeText(a)},children:n?"copied":"copy"})}function Fe({children:n,...e}){const{"data-buttons":i,"data-filename":s,"data-fullpath":a,"data-nocopy":r,"data-sep":o}=e,u=r===void 0;function h(){if(a&&o)return!s||s.includes("..")?{"data-filename":ee(a,o)}:{"data-filename":s.replace(/\//g,o)}}return m.jsxs("div",{className:"group relative",children:[m.jsxs("div",{className:"absolute right-0 top-0 z-50 m-2 flex items-baseline justify-end gap-4 opacity-0 transition duration-300 ease-in-out focus-within:opacity-100 group-hover:opacity-100",children:[i?m.jsx(Oe,{...e}):null,u?m.jsx(Ae,{}):null]}),m.jsx("pre",{...e,className:vt("scrollbar-thin scrollbar-thumb-scrollbar",e.className??""),...h(),children:n})]})}const je={h1:n=>m.jsx(ht,{...n,as:"h1"}),h2:n=>m.jsx(ht,{...n,as:"h2"}),h3:n=>m.jsx(ht,{...n,as:"h3"}),h4:n=>m.jsx(ht,{...n,as:"h4"}),h5:n=>m.jsx(ht,{...n,as:"h5"}),h6:n=>m.jsx(ht,{...n,as:"h6"}),a:oe,p:n=>m.jsx("div",{...n}),pre:n=>m.jsx("pre",{...n,className:vt("scrollbar-thin scrollbar-thumb-scrollbar",n.className??"")}),LaunchEditor:Xt,VideoEmbed:ue,EpicVideo:fe};function Ce(n){const e=ve.getMDXComponent(n);function i({components:s,...a}){const r=at.useMemo(()=>({...je,...s}),[s]);return m.jsx(e,{components:r,...a})}return i}const Ct=new zt({max:1e3});function Te(n){return at.useMemo(()=>{if(Ct.has(n))return Ct.get(n);const e=Ce(n);return Ct.set(n,e),e},[n])}function ke({code:n,components:e}){const i=Te(n),s=at.useMemo(()=>({Icon:ne,pre:Fe,Link:$t,...e}),[e]);return m.jsx(i,{components:s})}export{Ie as E,Xt as L,ke as M,ge as u};
|
|
2
|
-
//# sourceMappingURL=mdx-
|
|
1
|
+
var ie=Object.defineProperty;var Ht=n=>{throw TypeError(n)};var se=(n,e,i)=>e in n?ie(n,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[e]=i;var v=(n,e,i)=>se(n,typeof e!="symbol"?e+"":e,i),Ft=(n,e,i)=>e.has(n)||Ht("Cannot "+i);var t=(n,e,i)=>(Ft(n,e,"read from private field"),i?i.call(n):e.get(n)),b=(n,e,i)=>e.has(n)?Ht("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,i),f=(n,e,i,s)=>(Ft(n,e,"write to private field"),s?s.call(n,i):e.set(n,i),i),c=(n,e,i)=>(Ft(n,e,"access private method"),i);var _t=(n,e,i,s)=>({set _(a){f(n,e,a,i)},get _(){return t(n,e,s)}});import{j as m,r as at}from"./index-BFGhCX_U.js";import{c as vt,I as ne,a as re,H as ht,A as oe}from"./misc-BJtHv_Jh.js";import{e as ae,L as $t,a as he,r as le,u as ce}from"./components-9EGYHTc_.js";import{V as ue,D as fe}from"./epic-video-Bxtz3elt.js";import{s as de}from"./progress-bar-Cj5R4Zk7.js";import{u as pe}from"./pe-ChIwTk8v.js";import{u as me}from"./request-info-DCIQLE6H.js";function ge(){const n=ae("root");if(!n)throw new Error("useApps requires a data object from the root loader");return n.apps}function qt(n){const e=he();return at.useEffect(()=>{e.state==="idle"&&e.data!=null&&(n==null||n("fetcher-done"))},[e,n]),e}function be({file:n,appFile:e,appName:i,syncTo:s,line:a,column:r,children:o,onUpdate:u}){var _;const h=qt(u),g=pe(),O=typeof e=="string"?[e]:e,w=n?"file":e?"appFile":"",L=s!=null&&s.file?"file":s!=null&&s.appFile?"appFile":"";return m.jsxs(h.Form,{action:"/launch-editor",method:"POST",className:"flex items-center",children:[g,de,m.jsx("input",{type:"hidden",name:"line",value:a}),m.jsx("input",{type:"hidden",name:"column",value:r}),m.jsx("input",{type:"hidden",name:"type",value:w}),m.jsx("input",{type:"hidden",name:"file",value:n}),m.jsx("input",{type:"hidden",name:"appName",value:i}),O==null?void 0:O.map(j=>m.jsx("input",{type:"hidden",name:"appFile",value:j},j)),s?m.jsxs(m.Fragment,{children:[m.jsx("input",{type:"hidden",name:"syncTo.type",value:L}),m.jsx("input",{type:"hidden",name:"syncTo.file",value:s.file}),m.jsx("input",{type:"hidden",name:"syncTo.appName",value:s.appName}),m.jsx("input",{type:"hidden",name:"syncTo.appFile",value:s.appFile})]}):null,m.jsx("button",{type:"submit",className:vt("launch_button",h.state==="idle"?null:"cursor-progress",((_=h.data)==null?void 0:_.status)==="error"?"cursor-not-allowed":null),children:o})]})}function we({file:n,appFile:e,appName:i,line:s,children:a}){const r=ge(),o=me();if(Array.isArray(e))return m.jsx("div",{children:"Cannot open more than one file"});if(n){const g=O=>O.replace(/\\/g,"/");return m.jsx("a",{className:"launch_button !no-underline",href:g(n).replace(g(ENV.EPICSHOP_CONTEXT_CWD),ENV.EPICSHOP_GITHUB_ROOT)+(s?`#L${s}`:""),rel:"noreferrer",target:"_blank",children:a})}const u=r.find(g=>g.name===i),h=[...(u==null?void 0:u.relativePath.split(o.separator))??[],e+(s?`#L${s}`:"")].join("/");return m.jsx("a",{className:"launch_button !no-underline",href:`${ENV.EPICSHOP_GITHUB_ROOT}/${h}`,rel:"noreferrer",target:"_blank",children:a})}function Ie({appFile:n="README.mdx",appName:e,file:i,relativePath:s}){const a=qt(),r=u=>{if(!u.altKey||ENV.EPICSHOP_DEPLOYED)return;u.preventDefault();const h=new FormData,g=i?"file":"appFile";h.append(g,i??n),h.append("type",g),e&&h.append("appName",e),a.submit(h,{method:"POST",action:"/launch-editor"})},o=ENV.EPICSHOP_GITHUB_ROOT.replace(/\/tree\/|\/blob\//,"/edit/");return m.jsxs($t,{className:"self-center font-mono text-sm",onClick:r,target:"_blank",to:`${o}/${s}/${n}`.replace(/\\/g,"/"),children:[m.jsx("span",{className:"block md:hidden",children:"Edit on GitHub"}),m.jsx("span",{className:"hidden md:block",children:"Edit this page on GitHub"})]})}const Xt=ENV.EPICSHOP_DEPLOYED?we:be,lt=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Yt=new Set,Tt=typeof process=="object"&&process?process:{},Kt=(n,e,i,s)=>{typeof Tt.emitWarning=="function"?Tt.emitWarning(n,e,i,s):console.error(`[${i}] ${e}: ${n}`)};let xt=globalThis.AbortController,kt=globalThis.AbortSignal;var Ut;if(typeof xt>"u"){kt=class{constructor(){v(this,"onabort");v(this,"_onabort",[]);v(this,"reason");v(this,"aborted",!1)}addEventListener(s,a){this._onabort.push(a)}},xt=class{constructor(){v(this,"signal",new kt);e()}abort(s){var a,r;if(!this.signal.aborted){this.signal.reason=s,this.signal.aborted=!0;for(const o of this.signal._onabort)o(s);(r=(a=this.signal).onabort)==null||r.call(a,s)}}};let n=((Ut=Tt.env)==null?void 0:Ut.LRU_CACHE_IGNORE_AC_WARNING)!=="1";const e=()=>{n&&(n=!1,Kt("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}const _e=n=>!Yt.has(n),Q=n=>n&&n===Math.floor(n)&&n>0&&isFinite(n),Zt=n=>Q(n)?n<=Math.pow(2,8)?Uint8Array:n<=Math.pow(2,16)?Uint16Array:n<=Math.pow(2,32)?Uint32Array:n<=Number.MAX_SAFE_INTEGER?yt:null:null;class yt extends Array{constructor(e){super(e),this.fill(0)}}var ct;const nt=class nt{constructor(e,i){v(this,"heap");v(this,"length");if(!t(nt,ct))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new i(e),this.length=0}static create(e){const i=Zt(e);if(!i)return[];f(nt,ct,!0);const s=new nt(e,i);return f(nt,ct,!1),s}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}};ct=new WeakMap,b(nt,ct,!1);let Dt=nt;var Vt,Bt,U,M,V,B,ut,ft,F,$,A,E,p,R,I,P,T,q,D,X,Y,G,K,st,N,l,Pt,rt,Z,gt,H,Jt,ot,dt,bt,tt,et,Rt,St,Et,S,Nt,mt,it,Wt;const It=class It{constructor(e){b(this,l);b(this,U);b(this,M);b(this,V);b(this,B);b(this,ut);b(this,ft);v(this,"ttl");v(this,"ttlResolution");v(this,"ttlAutopurge");v(this,"updateAgeOnGet");v(this,"updateAgeOnHas");v(this,"allowStale");v(this,"noDisposeOnSet");v(this,"noUpdateTTL");v(this,"maxEntrySize");v(this,"sizeCalculation");v(this,"noDeleteOnFetchRejection");v(this,"noDeleteOnStaleGet");v(this,"allowStaleOnFetchAbort");v(this,"allowStaleOnFetchRejection");v(this,"ignoreFetchAbort");b(this,F);b(this,$);b(this,A);b(this,E);b(this,p);b(this,R);b(this,I);b(this,P);b(this,T);b(this,q);b(this,D);b(this,X);b(this,Y);b(this,G);b(this,K);b(this,st);b(this,N);b(this,rt,()=>{});b(this,Z,()=>{});b(this,gt,()=>{});b(this,H,()=>!1);b(this,ot,e=>{});b(this,dt,(e,i,s)=>{});b(this,bt,(e,i,s,a)=>{if(s||a)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});v(this,Vt,"LRUCache");const{max:i=0,ttl:s,ttlResolution:a=1,ttlAutopurge:r,updateAgeOnGet:o,updateAgeOnHas:u,allowStale:h,dispose:g,disposeAfter:O,noDisposeOnSet:w,noUpdateTTL:L,maxSize:_=0,maxEntrySize:j=0,sizeCalculation:x,fetchMethod:C,memoMethod:d,noDeleteOnFetchRejection:y,noDeleteOnStaleGet:W,allowStaleOnFetchRejection:z,allowStaleOnFetchAbort:k,ignoreFetchAbort:pt}=e;if(i!==0&&!Q(i))throw new TypeError("max option must be a nonnegative integer");const J=i?Zt(i):Array;if(!J)throw new Error("invalid max value: "+i);if(f(this,U,i),f(this,M,_),this.maxEntrySize=j||t(this,M),this.sizeCalculation=x,this.sizeCalculation){if(!t(this,M)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(d!==void 0&&typeof d!="function")throw new TypeError("memoMethod must be a function if defined");if(f(this,ft,d),C!==void 0&&typeof C!="function")throw new TypeError("fetchMethod must be a function if specified");if(f(this,ut,C),f(this,st,!!C),f(this,A,new Map),f(this,E,new Array(i).fill(void 0)),f(this,p,new Array(i).fill(void 0)),f(this,R,new J(i)),f(this,I,new J(i)),f(this,P,0),f(this,T,0),f(this,q,Dt.create(i)),f(this,F,0),f(this,$,0),typeof g=="function"&&f(this,V,g),typeof O=="function"?(f(this,B,O),f(this,D,[])):(f(this,B,void 0),f(this,D,void 0)),f(this,K,!!t(this,V)),f(this,N,!!t(this,B)),this.noDisposeOnSet=!!w,this.noUpdateTTL=!!L,this.noDeleteOnFetchRejection=!!y,this.allowStaleOnFetchRejection=!!z,this.allowStaleOnFetchAbort=!!k,this.ignoreFetchAbort=!!pt,this.maxEntrySize!==0){if(t(this,M)!==0&&!Q(t(this,M)))throw new TypeError("maxSize must be a positive integer if specified");if(!Q(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");c(this,l,Jt).call(this)}if(this.allowStale=!!h,this.noDeleteOnStaleGet=!!W,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!u,this.ttlResolution=Q(a)||a===0?a:1,this.ttlAutopurge=!!r,this.ttl=s||0,this.ttl){if(!Q(this.ttl))throw new TypeError("ttl must be a positive integer if specified");c(this,l,Pt).call(this)}if(t(this,U)===0&&this.ttl===0&&t(this,M)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!t(this,U)&&!t(this,M)){const wt="LRU_CACHE_UNBOUNDED";_e(wt)&&(Yt.add(wt),Kt("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",wt,It))}}static unsafeExposeInternals(e){return{starts:t(e,Y),ttls:t(e,G),sizes:t(e,X),keyMap:t(e,A),keyList:t(e,E),valList:t(e,p),next:t(e,R),prev:t(e,I),get head(){return t(e,P)},get tail(){return t(e,T)},free:t(e,q),isBackgroundFetch:i=>{var s;return c(s=e,l,S).call(s,i)},backgroundFetch:(i,s,a,r)=>{var o;return c(o=e,l,Et).call(o,i,s,a,r)},moveToTail:i=>{var s;return c(s=e,l,mt).call(s,i)},indexes:i=>{var s;return c(s=e,l,tt).call(s,i)},rindexes:i=>{var s;return c(s=e,l,et).call(s,i)},isStale:i=>{var s;return t(s=e,H).call(s,i)}}}get max(){return t(this,U)}get maxSize(){return t(this,M)}get calculatedSize(){return t(this,$)}get size(){return t(this,F)}get fetchMethod(){return t(this,ut)}get memoMethod(){return t(this,ft)}get dispose(){return t(this,V)}get disposeAfter(){return t(this,B)}getRemainingTTL(e){return t(this,A).has(e)?1/0:0}*entries(){for(const e of c(this,l,tt).call(this))t(this,p)[e]!==void 0&&t(this,E)[e]!==void 0&&!c(this,l,S).call(this,t(this,p)[e])&&(yield[t(this,E)[e],t(this,p)[e]])}*rentries(){for(const e of c(this,l,et).call(this))t(this,p)[e]!==void 0&&t(this,E)[e]!==void 0&&!c(this,l,S).call(this,t(this,p)[e])&&(yield[t(this,E)[e],t(this,p)[e]])}*keys(){for(const e of c(this,l,tt).call(this)){const i=t(this,E)[e];i!==void 0&&!c(this,l,S).call(this,t(this,p)[e])&&(yield i)}}*rkeys(){for(const e of c(this,l,et).call(this)){const i=t(this,E)[e];i!==void 0&&!c(this,l,S).call(this,t(this,p)[e])&&(yield i)}}*values(){for(const e of c(this,l,tt).call(this))t(this,p)[e]!==void 0&&!c(this,l,S).call(this,t(this,p)[e])&&(yield t(this,p)[e])}*rvalues(){for(const e of c(this,l,et).call(this))t(this,p)[e]!==void 0&&!c(this,l,S).call(this,t(this,p)[e])&&(yield t(this,p)[e])}[(Bt=Symbol.iterator,Vt=Symbol.toStringTag,Bt)](){return this.entries()}find(e,i={}){for(const s of c(this,l,tt).call(this)){const a=t(this,p)[s],r=c(this,l,S).call(this,a)?a.__staleWhileFetching:a;if(r!==void 0&&e(r,t(this,E)[s],this))return this.get(t(this,E)[s],i)}}forEach(e,i=this){for(const s of c(this,l,tt).call(this)){const a=t(this,p)[s],r=c(this,l,S).call(this,a)?a.__staleWhileFetching:a;r!==void 0&&e.call(i,r,t(this,E)[s],this)}}rforEach(e,i=this){for(const s of c(this,l,et).call(this)){const a=t(this,p)[s],r=c(this,l,S).call(this,a)?a.__staleWhileFetching:a;r!==void 0&&e.call(i,r,t(this,E)[s],this)}}purgeStale(){let e=!1;for(const i of c(this,l,et).call(this,{allowStale:!0}))t(this,H).call(this,i)&&(c(this,l,it).call(this,t(this,E)[i],"expire"),e=!0);return e}info(e){const i=t(this,A).get(e);if(i===void 0)return;const s=t(this,p)[i],a=c(this,l,S).call(this,s)?s.__staleWhileFetching:s;if(a===void 0)return;const r={value:a};if(t(this,G)&&t(this,Y)){const o=t(this,G)[i],u=t(this,Y)[i];if(o&&u){const h=o-(lt.now()-u);r.ttl=h,r.start=Date.now()}}return t(this,X)&&(r.size=t(this,X)[i]),r}dump(){const e=[];for(const i of c(this,l,tt).call(this,{allowStale:!0})){const s=t(this,E)[i],a=t(this,p)[i],r=c(this,l,S).call(this,a)?a.__staleWhileFetching:a;if(r===void 0||s===void 0)continue;const o={value:r};if(t(this,G)&&t(this,Y)){o.ttl=t(this,G)[i];const u=lt.now()-t(this,Y)[i];o.start=Math.floor(Date.now()-u)}t(this,X)&&(o.size=t(this,X)[i]),e.unshift([s,o])}return e}load(e){this.clear();for(const[i,s]of e){if(s.start){const a=Date.now()-s.start;s.start=lt.now()-a}this.set(i,s.value,s)}}set(e,i,s={}){var L,_,j,x,C;if(i===void 0)return this.delete(e),this;const{ttl:a=this.ttl,start:r,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:u=this.sizeCalculation,status:h}=s;let{noUpdateTTL:g=this.noUpdateTTL}=s;const O=t(this,bt).call(this,e,i,s.size||0,u);if(this.maxEntrySize&&O>this.maxEntrySize)return h&&(h.set="miss",h.maxEntrySizeExceeded=!0),c(this,l,it).call(this,e,"set"),this;let w=t(this,F)===0?void 0:t(this,A).get(e);if(w===void 0)w=t(this,F)===0?t(this,T):t(this,q).length!==0?t(this,q).pop():t(this,F)===t(this,U)?c(this,l,St).call(this,!1):t(this,F),t(this,E)[w]=e,t(this,p)[w]=i,t(this,A).set(e,w),t(this,R)[t(this,T)]=w,t(this,I)[w]=t(this,T),f(this,T,w),_t(this,F)._++,t(this,dt).call(this,w,O,h),h&&(h.set="add"),g=!1;else{c(this,l,mt).call(this,w);const d=t(this,p)[w];if(i!==d){if(t(this,st)&&c(this,l,S).call(this,d)){d.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:y}=d;y!==void 0&&!o&&(t(this,K)&&((L=t(this,V))==null||L.call(this,y,e,"set")),t(this,N)&&((_=t(this,D))==null||_.push([y,e,"set"])))}else o||(t(this,K)&&((j=t(this,V))==null||j.call(this,d,e,"set")),t(this,N)&&((x=t(this,D))==null||x.push([d,e,"set"])));if(t(this,ot).call(this,w),t(this,dt).call(this,w,O,h),t(this,p)[w]=i,h){h.set="replace";const y=d&&c(this,l,S).call(this,d)?d.__staleWhileFetching:d;y!==void 0&&(h.oldValue=y)}}else h&&(h.set="update")}if(a!==0&&!t(this,G)&&c(this,l,Pt).call(this),t(this,G)&&(g||t(this,gt).call(this,w,a,r),h&&t(this,Z).call(this,h,w)),!o&&t(this,N)&&t(this,D)){const d=t(this,D);let y;for(;y=d==null?void 0:d.shift();)(C=t(this,B))==null||C.call(this,...y)}return this}pop(){var e;try{for(;t(this,F);){const i=t(this,p)[t(this,P)];if(c(this,l,St).call(this,!0),c(this,l,S).call(this,i)){if(i.__staleWhileFetching)return i.__staleWhileFetching}else if(i!==void 0)return i}}finally{if(t(this,N)&&t(this,D)){const i=t(this,D);let s;for(;s=i==null?void 0:i.shift();)(e=t(this,B))==null||e.call(this,...s)}}}has(e,i={}){const{updateAgeOnHas:s=this.updateAgeOnHas,status:a}=i,r=t(this,A).get(e);if(r!==void 0){const o=t(this,p)[r];if(c(this,l,S).call(this,o)&&o.__staleWhileFetching===void 0)return!1;if(t(this,H).call(this,r))a&&(a.has="stale",t(this,Z).call(this,a,r));else return s&&t(this,rt).call(this,r),a&&(a.has="hit",t(this,Z).call(this,a,r)),!0}else a&&(a.has="miss");return!1}peek(e,i={}){const{allowStale:s=this.allowStale}=i,a=t(this,A).get(e);if(a===void 0||!s&&t(this,H).call(this,a))return;const r=t(this,p)[a];return c(this,l,S).call(this,r)?r.__staleWhileFetching:r}async fetch(e,i={}){const{allowStale:s=this.allowStale,updateAgeOnGet:a=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:u=this.noDisposeOnSet,size:h=0,sizeCalculation:g=this.sizeCalculation,noUpdateTTL:O=this.noUpdateTTL,noDeleteOnFetchRejection:w=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:L=this.allowStaleOnFetchRejection,ignoreFetchAbort:_=this.ignoreFetchAbort,allowStaleOnFetchAbort:j=this.allowStaleOnFetchAbort,context:x,forceRefresh:C=!1,status:d,signal:y}=i;if(!t(this,st))return d&&(d.fetch="get"),this.get(e,{allowStale:s,updateAgeOnGet:a,noDeleteOnStaleGet:r,status:d});const W={allowStale:s,updateAgeOnGet:a,noDeleteOnStaleGet:r,ttl:o,noDisposeOnSet:u,size:h,sizeCalculation:g,noUpdateTTL:O,noDeleteOnFetchRejection:w,allowStaleOnFetchRejection:L,allowStaleOnFetchAbort:j,ignoreFetchAbort:_,status:d,signal:y};let z=t(this,A).get(e);if(z===void 0){d&&(d.fetch="miss");const k=c(this,l,Et).call(this,e,z,W,x);return k.__returned=k}else{const k=t(this,p)[z];if(c(this,l,S).call(this,k)){const Gt=s&&k.__staleWhileFetching!==void 0;return d&&(d.fetch="inflight",Gt&&(d.returnedStale=!0)),Gt?k.__staleWhileFetching:k.__returned=k}const pt=t(this,H).call(this,z);if(!C&&!pt)return d&&(d.fetch="hit"),c(this,l,mt).call(this,z),a&&t(this,rt).call(this,z),d&&t(this,Z).call(this,d,z),k;const J=c(this,l,Et).call(this,e,z,W,x),At=J.__staleWhileFetching!==void 0&&s;return d&&(d.fetch=pt?"stale":"refresh",At&&pt&&(d.returnedStale=!0)),At?J.__staleWhileFetching:J.__returned=J}}async forceFetch(e,i={}){const s=await this.fetch(e,i);if(s===void 0)throw new Error("fetch() returned undefined");return s}memo(e,i={}){const s=t(this,ft);if(!s)throw new Error("no memoMethod provided to constructor");const{context:a,forceRefresh:r,...o}=i,u=this.get(e,o);if(!r&&u!==void 0)return u;const h=s(e,u,{options:o,context:a});return this.set(e,h,o),h}get(e,i={}){const{allowStale:s=this.allowStale,updateAgeOnGet:a=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,status:o}=i,u=t(this,A).get(e);if(u!==void 0){const h=t(this,p)[u],g=c(this,l,S).call(this,h);return o&&t(this,Z).call(this,o,u),t(this,H).call(this,u)?(o&&(o.get="stale"),g?(o&&s&&h.__staleWhileFetching!==void 0&&(o.returnedStale=!0),s?h.__staleWhileFetching:void 0):(r||c(this,l,it).call(this,e,"expire"),o&&s&&(o.returnedStale=!0),s?h:void 0)):(o&&(o.get="hit"),g?h.__staleWhileFetching:(c(this,l,mt).call(this,u),a&&t(this,rt).call(this,u),h))}else o&&(o.get="miss")}delete(e){return c(this,l,it).call(this,e,"delete")}clear(){return c(this,l,Wt).call(this,"delete")}};U=new WeakMap,M=new WeakMap,V=new WeakMap,B=new WeakMap,ut=new WeakMap,ft=new WeakMap,F=new WeakMap,$=new WeakMap,A=new WeakMap,E=new WeakMap,p=new WeakMap,R=new WeakMap,I=new WeakMap,P=new WeakMap,T=new WeakMap,q=new WeakMap,D=new WeakMap,X=new WeakMap,Y=new WeakMap,G=new WeakMap,K=new WeakMap,st=new WeakMap,N=new WeakMap,l=new WeakSet,Pt=function(){const e=new yt(t(this,U)),i=new yt(t(this,U));f(this,G,e),f(this,Y,i),f(this,gt,(r,o,u=lt.now())=>{if(i[r]=o!==0?u:0,e[r]=o,o!==0&&this.ttlAutopurge){const h=setTimeout(()=>{t(this,H).call(this,r)&&c(this,l,it).call(this,t(this,E)[r],"expire")},o+1);h.unref&&h.unref()}}),f(this,rt,r=>{i[r]=e[r]!==0?lt.now():0}),f(this,Z,(r,o)=>{if(e[o]){const u=e[o],h=i[o];if(!u||!h)return;r.ttl=u,r.start=h,r.now=s||a();const g=r.now-h;r.remainingTTL=u-g}});let s=0;const a=()=>{const r=lt.now();if(this.ttlResolution>0){s=r;const o=setTimeout(()=>s=0,this.ttlResolution);o.unref&&o.unref()}return r};this.getRemainingTTL=r=>{const o=t(this,A).get(r);if(o===void 0)return 0;const u=e[o],h=i[o];if(!u||!h)return 1/0;const g=(s||a())-h;return u-g},f(this,H,r=>{const o=i[r],u=e[r];return!!u&&!!o&&(s||a())-o>u})},rt=new WeakMap,Z=new WeakMap,gt=new WeakMap,H=new WeakMap,Jt=function(){const e=new yt(t(this,U));f(this,$,0),f(this,X,e),f(this,ot,i=>{f(this,$,t(this,$)-e[i]),e[i]=0}),f(this,bt,(i,s,a,r)=>{if(c(this,l,S).call(this,s))return 0;if(!Q(a))if(r){if(typeof r!="function")throw new TypeError("sizeCalculation must be a function");if(a=r(s,i),!Q(a))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return a}),f(this,dt,(i,s,a)=>{if(e[i]=s,t(this,M)){const r=t(this,M)-e[i];for(;t(this,$)>r;)c(this,l,St).call(this,!0)}f(this,$,t(this,$)+e[i]),a&&(a.entrySize=s,a.totalCalculatedSize=t(this,$))})},ot=new WeakMap,dt=new WeakMap,bt=new WeakMap,tt=function*({allowStale:e=this.allowStale}={}){if(t(this,F))for(let i=t(this,T);!(!c(this,l,Rt).call(this,i)||((e||!t(this,H).call(this,i))&&(yield i),i===t(this,P)));)i=t(this,I)[i]},et=function*({allowStale:e=this.allowStale}={}){if(t(this,F))for(let i=t(this,P);!(!c(this,l,Rt).call(this,i)||((e||!t(this,H).call(this,i))&&(yield i),i===t(this,T)));)i=t(this,R)[i]},Rt=function(e){return e!==void 0&&t(this,A).get(t(this,E)[e])===e},St=function(e){var r,o;const i=t(this,P),s=t(this,E)[i],a=t(this,p)[i];return t(this,st)&&c(this,l,S).call(this,a)?a.__abortController.abort(new Error("evicted")):(t(this,K)||t(this,N))&&(t(this,K)&&((r=t(this,V))==null||r.call(this,a,s,"evict")),t(this,N)&&((o=t(this,D))==null||o.push([a,s,"evict"]))),t(this,ot).call(this,i),e&&(t(this,E)[i]=void 0,t(this,p)[i]=void 0,t(this,q).push(i)),t(this,F)===1?(f(this,P,f(this,T,0)),t(this,q).length=0):f(this,P,t(this,R)[i]),t(this,A).delete(s),_t(this,F)._--,i},Et=function(e,i,s,a){const r=i===void 0?void 0:t(this,p)[i];if(c(this,l,S).call(this,r))return r;const o=new xt,{signal:u}=s;u==null||u.addEventListener("abort",()=>o.abort(u.reason),{signal:o.signal});const h={signal:o.signal,options:s,context:a},g=(x,C=!1)=>{const{aborted:d}=o.signal,y=s.ignoreFetchAbort&&x!==void 0;if(s.status&&(d&&!C?(s.status.fetchAborted=!0,s.status.fetchError=o.signal.reason,y&&(s.status.fetchAbortIgnored=!0)):s.status.fetchResolved=!0),d&&!y&&!C)return w(o.signal.reason);const W=_;return t(this,p)[i]===_&&(x===void 0?W.__staleWhileFetching?t(this,p)[i]=W.__staleWhileFetching:c(this,l,it).call(this,e,"fetch"):(s.status&&(s.status.fetchUpdated=!0),this.set(e,x,h.options))),x},O=x=>(s.status&&(s.status.fetchRejected=!0,s.status.fetchError=x),w(x)),w=x=>{const{aborted:C}=o.signal,d=C&&s.allowStaleOnFetchAbort,y=d||s.allowStaleOnFetchRejection,W=y||s.noDeleteOnFetchRejection,z=_;if(t(this,p)[i]===_&&(!W||z.__staleWhileFetching===void 0?c(this,l,it).call(this,e,"fetch"):d||(t(this,p)[i]=z.__staleWhileFetching)),y)return s.status&&z.__staleWhileFetching!==void 0&&(s.status.returnedStale=!0),z.__staleWhileFetching;if(z.__returned===z)throw x},L=(x,C)=>{var y;const d=(y=t(this,ut))==null?void 0:y.call(this,e,r,h);d&&d instanceof Promise&&d.then(W=>x(W===void 0?void 0:W),C),o.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(x(void 0),s.allowStaleOnFetchAbort&&(x=W=>g(W,!0)))})};s.status&&(s.status.fetchDispatched=!0);const _=new Promise(L).then(g,O),j=Object.assign(_,{__abortController:o,__staleWhileFetching:r,__returned:void 0});return i===void 0?(this.set(e,j,{...h.options,status:void 0}),i=t(this,A).get(e)):t(this,p)[i]=j,j},S=function(e){if(!t(this,st))return!1;const i=e;return!!i&&i instanceof Promise&&i.hasOwnProperty("__staleWhileFetching")&&i.__abortController instanceof xt},Nt=function(e,i){t(this,I)[i]=e,t(this,R)[e]=i},mt=function(e){e!==t(this,T)&&(e===t(this,P)?f(this,P,t(this,R)[e]):c(this,l,Nt).call(this,t(this,I)[e],t(this,R)[e]),c(this,l,Nt).call(this,t(this,T),e),f(this,T,e))},it=function(e,i){var a,r,o,u;let s=!1;if(t(this,F)!==0){const h=t(this,A).get(e);if(h!==void 0)if(s=!0,t(this,F)===1)c(this,l,Wt).call(this,i);else{t(this,ot).call(this,h);const g=t(this,p)[h];if(c(this,l,S).call(this,g)?g.__abortController.abort(new Error("deleted")):(t(this,K)||t(this,N))&&(t(this,K)&&((a=t(this,V))==null||a.call(this,g,e,i)),t(this,N)&&((r=t(this,D))==null||r.push([g,e,i]))),t(this,A).delete(e),t(this,E)[h]=void 0,t(this,p)[h]=void 0,h===t(this,T))f(this,T,t(this,I)[h]);else if(h===t(this,P))f(this,P,t(this,R)[h]);else{const O=t(this,I)[h];t(this,R)[O]=t(this,R)[h];const w=t(this,R)[h];t(this,I)[w]=t(this,I)[h]}_t(this,F)._--,t(this,q).push(h)}}if(t(this,N)&&((o=t(this,D))!=null&&o.length)){const h=t(this,D);let g;for(;g=h==null?void 0:h.shift();)(u=t(this,B))==null||u.call(this,...g)}return s},Wt=function(e){var i,s,a;for(const r of c(this,l,et).call(this,{allowStale:!0})){const o=t(this,p)[r];if(c(this,l,S).call(this,o))o.__abortController.abort(new Error("deleted"));else{const u=t(this,E)[r];t(this,K)&&((i=t(this,V))==null||i.call(this,o,u,e)),t(this,N)&&((s=t(this,D))==null||s.push([o,u,e]))}}if(t(this,A).clear(),t(this,p).fill(void 0),t(this,E).fill(void 0),t(this,G)&&t(this,Y)&&(t(this,G).fill(0),t(this,Y).fill(0)),t(this,X)&&t(this,X).fill(0),f(this,P,0),f(this,T,0),t(this,q).length=0,f(this,$,0),f(this,F,0),t(this,N)&&t(this,D)){const r=t(this,D);let o;for(;o=r==null?void 0:r.shift();)(a=t(this,B))==null||a.call(this,...o)}};let zt=It;var Ot={};Object.defineProperty(Ot,"__esModule",{value:!0});Ot.getMDXComponent=xe;Ot.getMDXExport=te;var ye=Mt(at),Se=Mt(m),Ee=Mt(le);function Qt(n){if(typeof WeakMap!="function")return null;var e=new WeakMap,i=new WeakMap;return(Qt=function(s){return s?i:e})(n)}function Mt(n,e){if(n&&n.__esModule)return n;if(n===null||typeof n!="object"&&typeof n!="function")return{default:n};var i=Qt(e);if(i&&i.has(n))return i.get(n);var s={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in n)if(r!=="default"&&{}.hasOwnProperty.call(n,r)){var o=a?Object.getOwnPropertyDescriptor(n,r):null;o&&(o.get||o.set)?Object.defineProperty(s,r,o):s[r]=n[r]}return s.default=n,i&&i.set(n,s),s}function xe(n,e){return te(n,e).default}function te(n,e){const i={React:ye,ReactDOM:Ee,_jsx_runtime:Se,...e};return new Function(...Object.keys(i),n)(...Object.values(i))}var ve=Ot;const jt=n=>n.replace(/\\/g,"/");function ee(n,e,i){const[,s]=n.replace(/\\|\//g,e).split(`${i==="playground"?"example":"exercises"}${e}`);return s}const Lt="border-border bg-[var(--shiki-background)] hover:bg-foreground/20 active:bg-foreground/30 box-content block rounded border-2 px-2 py-0.5 font-mono text-xs font-semibold outline-none transition duration-300 ease-in-out";function Oe({"data-buttons":n,"data-filename":e,"data-fullpath":i,"data-sep":s="/","data-start":a,"data-type":r}){var L;const o=ce();if(r==="other"||!n||!e||!i)return null;const u=jt(((L=o[o.type])==null?void 0:L.fullPath)??""),h=!i.startsWith(u),g=ENV.EPICSHOP_DEPLOYED?["problem","solution"]:["problem","solution","playground"],O=n.split(","),w=g.filter(_=>O.includes(_));return m.jsx(m.Fragment,{children:w.map(_=>{var d;const j=o[_];if(_==="playground"){const y=o.playground&&o.playground.appName!==((d=o.problem)==null?void 0:d.name);if(!j||y||h)return m.jsxs("button",{className:vt(Lt,"cursor-not-allowed"),title:y?"Playground is not set to the right app":h?"This file is from different app":"You must 'Set to Playground' before opening a file",children:[m.jsx("span",{className:"uppercase",children:"Open"})," in ",_]},_)}if(!j||!j.fullPath)return null;const x=[jt(j.fullPath),jt(e)].join(s),C=ee(x,s,_);return m.jsx(Xt,{file:x,line:Number(a??1),children:m.jsxs("span",{title:C,className:Lt,children:[m.jsx("span",{className:"uppercase",children:"Open"})," in ",_]})},_)})})}function Ae(){const[n,e]=at.useState(!1);return at.useEffect(()=>{if(n){const i=setTimeout(()=>e(!1),1500);return()=>clearTimeout(i)}},[n]),m.jsx("button",{className:re(Lt,"w-12 uppercase"),onClick:i=>{var r,o,u;e(!0);const a=((u=(o=(r=i.currentTarget.parentElement)==null?void 0:r.parentElement)==null?void 0:o.querySelector("pre"))==null?void 0:u.textContent)||"";navigator.clipboard.writeText(a)},children:n?"copied":"copy"})}function Fe({children:n,...e}){const{"data-buttons":i,"data-filename":s,"data-fullpath":a,"data-nocopy":r,"data-sep":o}=e,u=r===void 0;function h(){if(a&&o)return!s||s.includes("..")?{"data-filename":ee(a,o)}:{"data-filename":s.replace(/\//g,o)}}return m.jsxs("div",{className:"group relative",children:[m.jsxs("div",{className:"absolute right-0 top-0 z-50 m-2 flex items-baseline justify-end gap-4 opacity-0 transition duration-300 ease-in-out focus-within:opacity-100 group-hover:opacity-100",children:[i?m.jsx(Oe,{...e}):null,u?m.jsx(Ae,{}):null]}),m.jsx("pre",{...e,className:vt("scrollbar-thin scrollbar-thumb-scrollbar",e.className??""),...h(),children:n})]})}const je={h1:n=>m.jsx(ht,{...n,as:"h1"}),h2:n=>m.jsx(ht,{...n,as:"h2"}),h3:n=>m.jsx(ht,{...n,as:"h3"}),h4:n=>m.jsx(ht,{...n,as:"h4"}),h5:n=>m.jsx(ht,{...n,as:"h5"}),h6:n=>m.jsx(ht,{...n,as:"h6"}),a:oe,p:n=>m.jsx("div",{...n}),pre:n=>m.jsx("pre",{...n,className:vt("scrollbar-thin scrollbar-thumb-scrollbar",n.className??"")}),LaunchEditor:Xt,VideoEmbed:ue,EpicVideo:fe};function Ce(n){const e=ve.getMDXComponent(n);function i({components:s,...a}){const r=at.useMemo(()=>({...je,...s}),[s]);return m.jsx(e,{components:r,...a})}return i}const Ct=new zt({max:1e3});function Te(n){return at.useMemo(()=>{if(Ct.has(n))return Ct.get(n);const e=Ce(n);return Ct.set(n,e),e},[n])}function ke({code:n,components:e}){const i=Te(n),s=at.useMemo(()=>({Icon:ne,pre:Fe,Link:$t,...e}),[e]);return m.jsx(i,{components:s})}export{Ie as E,Xt as L,ke as M,ge as u};
|
|
2
|
+
//# sourceMappingURL=mdx-DIAWAXtT.js.map
|