@epic-web/workshop-app 6.74.0 → 6.74.2
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-6IQJMb5M.js +2 -0
- package/build/client/assets/{_exerciseNumber-jokuvO2V.js.map → _exerciseNumber-6IQJMb5M.js.map} +1 -1
- package/build/client/assets/_exerciseNumber_.finished-D9-WSUZy.js +2 -0
- package/build/client/assets/{_exerciseNumber_.finished-BaC--Y5p.js.map → _exerciseNumber_.finished-D9-WSUZy.js.map} +1 -1
- package/build/client/assets/_extra-IT1EaIMp.js +2 -0
- package/build/client/assets/{_extra-DXypL1sc.js.map → _extra-IT1EaIMp.js.map} +1 -1
- package/build/client/assets/{_layout-C9vSX5Ti.js → _layout-BDFC2e7T.js} +2 -2
- package/build/client/assets/{_layout-C9vSX5Ti.js.map → _layout-BDFC2e7T.js.map} +1 -1
- package/build/client/assets/_layout-CCCrBY2W.js +2 -0
- package/build/client/assets/{_layout-_Aw6qzZC.js.map → _layout-CCCrBY2W.js.map} +1 -1
- package/build/client/assets/{diff-Dng5ItOr.js → diff-4YyKvzHi.js} +2 -2
- package/build/client/assets/{diff-Dng5ItOr.js.map → diff-4YyKvzHi.js.map} +1 -1
- package/build/client/assets/diff-8Er9eAl-.js +2 -0
- package/build/client/assets/{diff-DfWBhj2O.js.map → diff-8Er9eAl-.js.map} +1 -1
- package/build/client/assets/epic-video-BtFzbNqF.js +2 -0
- package/build/client/assets/{epic-video-C1_HSISA.js.map → epic-video-BtFzbNqF.js.map} +1 -1
- package/build/client/assets/{epic-video-CC0372g5.js → epic-video-DzLohyvt.js} +146 -146
- package/build/client/assets/epic-video-DzLohyvt.js.map +1 -0
- package/build/client/assets/finished-CzmzTZg6.js +2 -0
- package/build/client/assets/{finished-BbEk1NdF.js.map → finished-CzmzTZg6.js.map} +1 -1
- package/build/client/assets/index-BN0kldnY.js +2 -0
- package/build/client/assets/{index-CFM_ffAh.js.map → index-BN0kldnY.js.map} +1 -1
- package/build/client/assets/index-BNsKVnVt.js +2 -0
- package/build/client/assets/{index-Pxi8WjFA.js.map → index-BNsKVnVt.js.map} +1 -1
- package/build/client/assets/index-Cby_tLUO.js +2 -0
- package/build/client/assets/{index-CfU0fdf7.js.map → index-Cby_tLUO.js.map} +1 -1
- package/build/client/assets/{index-DroM8fzS.js → index-Dpyv8N6m.js} +2 -2
- package/build/client/assets/{index-DroM8fzS.js.map → index-Dpyv8N6m.js.map} +1 -1
- package/build/client/assets/{manifest-835c6db1.js → manifest-65ac4702.js} +1 -1
- package/build/client/assets/{mdx-vy-1-0a3.js → mdx-8X3W8bVO.js} +2 -2
- package/build/client/assets/{mdx-vy-1-0a3.js.map → mdx-8X3W8bVO.js.map} +1 -1
- package/build/client/assets/{progress-BcA4i0iU.js → progress-Bby-ybMA.js} +2 -2
- package/build/client/assets/progress-Bby-ybMA.js.map +1 -0
- package/build/client/assets/root-BwYDIUyI.js.map +1 -1
- package/build/client/assets/test-DXylXETz.js +2 -0
- package/build/client/assets/{test-Ciw2aKZE.js.map → test-DXylXETz.js.map} +1 -1
- package/build/client/assets/{tests-CZ2AhDKA.js → tests-DlPVOsMT.js} +2 -2
- package/build/client/assets/{tests-CZ2AhDKA.js.map → tests-DlPVOsMT.js.map} +1 -1
- package/build/server/index.js +310 -63
- package/build/server/index.js.map +1 -1
- package/package.json +3 -3
- package/build/client/assets/_exerciseNumber-jokuvO2V.js +0 -2
- package/build/client/assets/_exerciseNumber_.finished-BaC--Y5p.js +0 -2
- package/build/client/assets/_extra-DXypL1sc.js +0 -2
- package/build/client/assets/_layout-_Aw6qzZC.js +0 -2
- package/build/client/assets/diff-DfWBhj2O.js +0 -2
- package/build/client/assets/epic-video-C1_HSISA.js +0 -2
- package/build/client/assets/epic-video-CC0372g5.js.map +0 -1
- package/build/client/assets/finished-BbEk1NdF.js +0 -2
- package/build/client/assets/index-CFM_ffAh.js +0 -2
- package/build/client/assets/index-CfU0fdf7.js +0 -2
- package/build/client/assets/index-Pxi8WjFA.js +0 -2
- package/build/client/assets/progress-BcA4i0iU.js.map +0 -1
- package/build/client/assets/test-Ciw2aKZE.js +0 -2
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mermaid.core-BdxLLjl2.js","assets/preload-helper-BXl3LOEh.js","assets/misc-W4055b-0.js","assets/jsx-runtime-C5WNSv3b.js","assets/index-CqIc3cxq.js","assets/chunk-EPOLDU6W-BCLmut3y.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as Q,j as u}from"./jsx-runtime-C5WNSv3b.js";import{I as tt,a as G,m as et,c as it,A as st,H as F}from"./misc-W4055b-0.js";import{b as nt,r as v}from"./index-CqIc3cxq.js";import{a as rt}from"./index-vDCSPjrM.js";import{L as ot,b as ht}from"./chunk-EPOLDU6W-BCLmut3y.js";import{t as k}from"./index-DzdDahau.js";import{D as at,V as lt}from"./epic-video-CC0372g5.js";import{_ as ft}from"./preload-helper-BXl3LOEh.js";import{u as ct}from"./index-CdzVFL-Z.js";import{S as ut}from"./tooltip-Tlsyx2YO.js";import{L as H}from"./launch-editor-D2exGfVu.js";const dt=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Y=new Set,I=typeof process=="object"&&process?process:{},J=(h,t,e,i)=>{typeof I.emitWarning=="function"?I.emitWarning(h,t,e,i):console.error(`[${e}] ${t}: ${h}`)};let M=globalThis.AbortController,V=globalThis.AbortSignal;if(typeof M>"u"){V=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(i,s){this._onabort.push(s)}},M=class{constructor(){t()}signal=new V;abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=!0;for(const s of this.signal._onabort)s(i);this.signal.onabort?.(i)}}};let h=I.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1";const t=()=>{h&&(h=!1,J("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",t))}}const pt=h=>!Y.has(h),x=h=>h&&h===Math.floor(h)&&h>0&&isFinite(h),K=h=>x(h)?h<=Math.pow(2,8)?Uint8Array:h<=Math.pow(2,16)?Uint16Array:h<=Math.pow(2,32)?Uint32Array:h<=Number.MAX_SAFE_INTEGER?D:null:null;class D extends Array{constructor(t){super(t),this.fill(0)}}class j{heap;length;static#h=!1;static create(t){const e=K(t);if(!e)return[];j.#h=!0;const i=new j(t,e);return j.#h=!1,i}constructor(t,e){if(!j.#h)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new e(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}}class q{#h;#c;#m;#j;#b;#D;#M;#w;get perf(){return this.#w}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#n;#_;#s;#i;#t;#l;#u;#a;#r;#y;#o;#S;#v;#d;#p;#A;#F;#f;#W;static unsafeExposeInternals(t){return{starts:t.#v,ttls:t.#d,autopurgeTimers:t.#p,sizes:t.#S,keyMap:t.#s,keyList:t.#i,valList:t.#t,next:t.#l,prev:t.#u,get head(){return t.#a},get tail(){return t.#r},free:t.#y,isBackgroundFetch:e=>t.#e(e),backgroundFetch:(e,i,s,r)=>t.#N(e,i,s,r),moveToTail:e=>t.#R(e),indexes:e=>t.#x(e),rindexes:e=>t.#E(e),isStale:e=>t.#g(e)}}get max(){return this.#h}get maxSize(){return this.#c}get calculatedSize(){return this.#_}get size(){return this.#n}get fetchMethod(){return this.#D}get memoMethod(){return this.#M}get dispose(){return this.#m}get onInsert(){return this.#j}get disposeAfter(){return this.#b}constructor(t){const{max:e=0,ttl:i,ttlResolution:s=1,ttlAutopurge:r,updateAgeOnGet:n,updateAgeOnHas:o,allowStale:a,dispose:f,onInsert:d,disposeAfter:c,noDisposeOnSet:l,noUpdateTTL:g,maxSize:S=0,maxEntrySize:m=0,sizeCalculation:_,fetchMethod:p,memoMethod:w,noDeleteOnFetchRejection:A,noDeleteOnStaleGet:b,allowStaleOnFetchRejection:y,allowStaleOnFetchAbort:C,ignoreFetchAbort:E,perf:R}=t;if(R!==void 0&&typeof R?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#w=R??dt,e!==0&&!x(e))throw new TypeError("max option must be a nonnegative integer");const O=e?K(e):Array;if(!O)throw new Error("invalid max value: "+e);if(this.#h=e,this.#c=S,this.maxEntrySize=m||this.#c,this.sizeCalculation=_,this.sizeCalculation){if(!this.#c&&!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(w!==void 0&&typeof w!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#M=w,p!==void 0&&typeof p!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#D=p,this.#F=!!p,this.#s=new Map,this.#i=new Array(e).fill(void 0),this.#t=new Array(e).fill(void 0),this.#l=new O(e),this.#u=new O(e),this.#a=0,this.#r=0,this.#y=j.create(e),this.#n=0,this.#_=0,typeof f=="function"&&(this.#m=f),typeof d=="function"&&(this.#j=d),typeof c=="function"?(this.#b=c,this.#o=[]):(this.#b=void 0,this.#o=void 0),this.#A=!!this.#m,this.#W=!!this.#j,this.#f=!!this.#b,this.noDisposeOnSet=!!l,this.noUpdateTTL=!!g,this.noDeleteOnFetchRejection=!!A,this.allowStaleOnFetchRejection=!!y,this.allowStaleOnFetchAbort=!!C,this.ignoreFetchAbort=!!E,this.maxEntrySize!==0){if(this.#c!==0&&!x(this.#c))throw new TypeError("maxSize must be a positive integer if specified");if(!x(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#V()}if(this.allowStale=!!a,this.noDeleteOnStaleGet=!!b,this.updateAgeOnGet=!!n,this.updateAgeOnHas=!!o,this.ttlResolution=x(s)||s===0?s:1,this.ttlAutopurge=!!r,this.ttl=i||0,this.ttl){if(!x(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#I()}if(this.#h===0&&this.ttl===0&&this.#c===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#h&&!this.#c){const T="LRU_CACHE_UNBOUNDED";pt(T)&&(Y.add(T),J("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",T,q))}}getRemainingTTL(t){return this.#s.has(t)?1/0:0}#I(){const t=new D(this.#h),e=new D(this.#h);this.#d=t,this.#v=e;const i=this.ttlAutopurge?new Array(this.#h):void 0;this.#p=i,this.#U=(n,o,a=this.#w.now())=>{if(e[n]=o!==0?a:0,t[n]=o,i?.[n]&&(clearTimeout(i[n]),i[n]=void 0),o!==0&&i){const f=setTimeout(()=>{this.#g(n)&&this.#O(this.#i[n],"expire")},o+1);f.unref&&f.unref(),i[n]=f}},this.#C=n=>{e[n]=t[n]!==0?this.#w.now():0},this.#T=(n,o)=>{if(t[o]){const a=t[o],f=e[o];if(!a||!f)return;n.ttl=a,n.start=f,n.now=s||r();const d=n.now-f;n.remainingTTL=a-d}};let s=0;const r=()=>{const n=this.#w.now();if(this.ttlResolution>0){s=n;const o=setTimeout(()=>s=0,this.ttlResolution);o.unref&&o.unref()}return n};this.getRemainingTTL=n=>{const o=this.#s.get(n);if(o===void 0)return 0;const a=t[o],f=e[o];if(!a||!f)return 1/0;const d=(s||r())-f;return a-d},this.#g=n=>{const o=e[n],a=t[n];return!!a&&!!o&&(s||r())-o>a}}#C=()=>{};#T=()=>{};#U=()=>{};#g=()=>!1;#V(){const t=new D(this.#h);this.#_=0,this.#S=t,this.#z=e=>{this.#_-=t[e],t[e]=0},this.#G=(e,i,s,r)=>{if(this.#e(i))return 0;if(!x(s))if(r){if(typeof r!="function")throw new TypeError("sizeCalculation must be a function");if(s=r(i,e),!x(s))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 s},this.#L=(e,i,s)=>{if(t[e]=i,this.#c){const r=this.#c-t[e];for(;this.#_>r;)this.#P(!0)}this.#_+=t[e],s&&(s.entrySize=i,s.totalCalculatedSize=this.#_)}}#z=t=>{};#L=(t,e,i)=>{};#G=(t,e,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#x({allowStale:t=this.allowStale}={}){if(this.#n)for(let e=this.#r;!(!this.#H(e)||((t||!this.#g(e))&&(yield e),e===this.#a));)e=this.#u[e]}*#E({allowStale:t=this.allowStale}={}){if(this.#n)for(let e=this.#a;!(!this.#H(e)||((t||!this.#g(e))&&(yield e),e===this.#r));)e=this.#l[e]}#H(t){return t!==void 0&&this.#s.get(this.#i[t])===t}*entries(){for(const t of this.#x())this.#t[t]!==void 0&&this.#i[t]!==void 0&&!this.#e(this.#t[t])&&(yield[this.#i[t],this.#t[t]])}*rentries(){for(const t of this.#E())this.#t[t]!==void 0&&this.#i[t]!==void 0&&!this.#e(this.#t[t])&&(yield[this.#i[t],this.#t[t]])}*keys(){for(const t of this.#x()){const e=this.#i[t];e!==void 0&&!this.#e(this.#t[t])&&(yield e)}}*rkeys(){for(const t of this.#E()){const e=this.#i[t];e!==void 0&&!this.#e(this.#t[t])&&(yield e)}}*values(){for(const t of this.#x())this.#t[t]!==void 0&&!this.#e(this.#t[t])&&(yield this.#t[t])}*rvalues(){for(const t of this.#E())this.#t[t]!==void 0&&!this.#e(this.#t[t])&&(yield this.#t[t])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,e={}){for(const i of this.#x()){const s=this.#t[i],r=this.#e(s)?s.__staleWhileFetching:s;if(r!==void 0&&t(r,this.#i[i],this))return this.get(this.#i[i],e)}}forEach(t,e=this){for(const i of this.#x()){const s=this.#t[i],r=this.#e(s)?s.__staleWhileFetching:s;r!==void 0&&t.call(e,r,this.#i[i],this)}}rforEach(t,e=this){for(const i of this.#E()){const s=this.#t[i],r=this.#e(s)?s.__staleWhileFetching:s;r!==void 0&&t.call(e,r,this.#i[i],this)}}purgeStale(){let t=!1;for(const e of this.#E({allowStale:!0}))this.#g(e)&&(this.#O(this.#i[e],"expire"),t=!0);return t}info(t){const e=this.#s.get(t);if(e===void 0)return;const i=this.#t[e],s=this.#e(i)?i.__staleWhileFetching:i;if(s===void 0)return;const r={value:s};if(this.#d&&this.#v){const n=this.#d[e],o=this.#v[e];if(n&&o){const a=n-(this.#w.now()-o);r.ttl=a,r.start=Date.now()}}return this.#S&&(r.size=this.#S[e]),r}dump(){const t=[];for(const e of this.#x({allowStale:!0})){const i=this.#i[e],s=this.#t[e],r=this.#e(s)?s.__staleWhileFetching:s;if(r===void 0||i===void 0)continue;const n={value:r};if(this.#d&&this.#v){n.ttl=this.#d[e];const o=this.#w.now()-this.#v[e];n.start=Math.floor(Date.now()-o)}this.#S&&(n.size=this.#S[e]),t.unshift([i,n])}return t}load(t){this.clear();for(const[e,i]of t){if(i.start){const s=Date.now()-i.start;i.start=this.#w.now()-s}this.set(e,i.value,i)}}set(t,e,i={}){if(e===void 0)return this.delete(t),this;const{ttl:s=this.ttl,start:r,noDisposeOnSet:n=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:a}=i;let{noUpdateTTL:f=this.noUpdateTTL}=i;const d=this.#G(t,e,i.size||0,o);if(this.maxEntrySize&&d>this.maxEntrySize)return a&&(a.set="miss",a.maxEntrySizeExceeded=!0),this.#O(t,"set"),this;let c=this.#n===0?void 0:this.#s.get(t);if(c===void 0)c=this.#n===0?this.#r:this.#y.length!==0?this.#y.pop():this.#n===this.#h?this.#P(!1):this.#n,this.#i[c]=t,this.#t[c]=e,this.#s.set(t,c),this.#l[this.#r]=c,this.#u[c]=this.#r,this.#r=c,this.#n++,this.#L(c,d,a),a&&(a.set="add"),f=!1,this.#W&&this.#j?.(e,t,"add");else{this.#R(c);const l=this.#t[c];if(e!==l){if(this.#F&&this.#e(l)){l.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:g}=l;g!==void 0&&!n&&(this.#A&&this.#m?.(g,t,"set"),this.#f&&this.#o?.push([g,t,"set"]))}else n||(this.#A&&this.#m?.(l,t,"set"),this.#f&&this.#o?.push([l,t,"set"]));if(this.#z(c),this.#L(c,d,a),this.#t[c]=e,a){a.set="replace";const g=l&&this.#e(l)?l.__staleWhileFetching:l;g!==void 0&&(a.oldValue=g)}}else a&&(a.set="update");this.#W&&this.onInsert?.(e,t,e===l?"update":"replace")}if(s!==0&&!this.#d&&this.#I(),this.#d&&(f||this.#U(c,s,r),a&&this.#T(a,c)),!n&&this.#f&&this.#o){const l=this.#o;let g;for(;g=l?.shift();)this.#b?.(...g)}return this}pop(){try{for(;this.#n;){const t=this.#t[this.#a];if(this.#P(!0),this.#e(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(this.#f&&this.#o){const t=this.#o;let e;for(;e=t?.shift();)this.#b?.(...e)}}}#P(t){const e=this.#a,i=this.#i[e],s=this.#t[e];return this.#F&&this.#e(s)?s.__abortController.abort(new Error("evicted")):(this.#A||this.#f)&&(this.#A&&this.#m?.(s,i,"evict"),this.#f&&this.#o?.push([s,i,"evict"])),this.#z(e),this.#p?.[e]&&(clearTimeout(this.#p[e]),this.#p[e]=void 0),t&&(this.#i[e]=void 0,this.#t[e]=void 0,this.#y.push(e)),this.#n===1?(this.#a=this.#r=0,this.#y.length=0):this.#a=this.#l[e],this.#s.delete(i),this.#n--,e}has(t,e={}){const{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=e,r=this.#s.get(t);if(r!==void 0){const n=this.#t[r];if(this.#e(n)&&n.__staleWhileFetching===void 0)return!1;if(this.#g(r))s&&(s.has="stale",this.#T(s,r));else return i&&this.#C(r),s&&(s.has="hit",this.#T(s,r)),!0}else s&&(s.has="miss");return!1}peek(t,e={}){const{allowStale:i=this.allowStale}=e,s=this.#s.get(t);if(s===void 0||!i&&this.#g(s))return;const r=this.#t[s];return this.#e(r)?r.__staleWhileFetching:r}#N(t,e,i,s){const r=e===void 0?void 0:this.#t[e];if(this.#e(r))return r;const n=new M,{signal:o}=i;o?.addEventListener("abort",()=>n.abort(o.reason),{signal:n.signal});const a={signal:n.signal,options:i,context:s},f=(m,_=!1)=>{const{aborted:p}=n.signal,w=i.ignoreFetchAbort&&m!==void 0;if(i.status&&(p&&!_?(i.status.fetchAborted=!0,i.status.fetchError=n.signal.reason,w&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),p&&!w&&!_)return c(n.signal.reason);const A=g,b=this.#t[e];return(b===g||w&&_&&b===void 0)&&(m===void 0?A.__staleWhileFetching!==void 0?this.#t[e]=A.__staleWhileFetching:this.#O(t,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.set(t,m,a.options))),m},d=m=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=m),c(m)),c=m=>{const{aborted:_}=n.signal,p=_&&i.allowStaleOnFetchAbort,w=p||i.allowStaleOnFetchRejection,A=w||i.noDeleteOnFetchRejection,b=g;if(this.#t[e]===g&&(!A||b.__staleWhileFetching===void 0?this.#O(t,"fetch"):p||(this.#t[e]=b.__staleWhileFetching)),w)return i.status&&b.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),b.__staleWhileFetching;if(b.__returned===b)throw m},l=(m,_)=>{const p=this.#D?.(t,r,a);p&&p instanceof Promise&&p.then(w=>m(w===void 0?void 0:w),_),n.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(m(void 0),i.allowStaleOnFetchAbort&&(m=w=>f(w,!0)))})};i.status&&(i.status.fetchDispatched=!0);const g=new Promise(l).then(f,d),S=Object.assign(g,{__abortController:n,__staleWhileFetching:r,__returned:void 0});return e===void 0?(this.set(t,S,{...a.options,status:void 0}),e=this.#s.get(t)):this.#t[e]=S,S}#e(t){if(!this.#F)return!1;const e=t;return!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof M}async fetch(t,e={}){const{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,ttl:n=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:a=0,sizeCalculation:f=this.sizeCalculation,noUpdateTTL:d=this.noUpdateTTL,noDeleteOnFetchRejection:c=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:l=this.allowStaleOnFetchRejection,ignoreFetchAbort:g=this.ignoreFetchAbort,allowStaleOnFetchAbort:S=this.allowStaleOnFetchAbort,context:m,forceRefresh:_=!1,status:p,signal:w}=e;if(!this.#F)return p&&(p.fetch="get"),this.get(t,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:r,status:p});const A={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:r,ttl:n,noDisposeOnSet:o,size:a,sizeCalculation:f,noUpdateTTL:d,noDeleteOnFetchRejection:c,allowStaleOnFetchRejection:l,allowStaleOnFetchAbort:S,ignoreFetchAbort:g,status:p,signal:w};let b=this.#s.get(t);if(b===void 0){p&&(p.fetch="miss");const y=this.#N(t,b,A,m);return y.__returned=y}else{const y=this.#t[b];if(this.#e(y)){const T=i&&y.__staleWhileFetching!==void 0;return p&&(p.fetch="inflight",T&&(p.returnedStale=!0)),T?y.__staleWhileFetching:y.__returned=y}const C=this.#g(b);if(!_&&!C)return p&&(p.fetch="hit"),this.#R(b),s&&this.#C(b),p&&this.#T(p,b),y;const E=this.#N(t,b,A,m),O=E.__staleWhileFetching!==void 0&&i;return p&&(p.fetch=C?"stale":"refresh",O&&C&&(p.returnedStale=!0)),O?E.__staleWhileFetching:E.__returned=E}}async forceFetch(t,e={}){const i=await this.fetch(t,e);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(t,e={}){const i=this.#M;if(!i)throw new Error("no memoMethod provided to constructor");const{context:s,forceRefresh:r,...n}=e,o=this.get(t,n);if(!r&&o!==void 0)return o;const a=i(t,o,{options:n,context:s});return this.set(t,a,n),a}get(t,e={}){const{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,status:n}=e,o=this.#s.get(t);if(o!==void 0){const a=this.#t[o],f=this.#e(a);return n&&this.#T(n,o),this.#g(o)?(n&&(n.get="stale"),f?(n&&i&&a.__staleWhileFetching!==void 0&&(n.returnedStale=!0),i?a.__staleWhileFetching:void 0):(r||this.#O(t,"expire"),n&&i&&(n.returnedStale=!0),i?a:void 0)):(n&&(n.get="hit"),f?a.__staleWhileFetching:(this.#R(o),s&&this.#C(o),a))}else n&&(n.get="miss")}#q(t,e){this.#u[e]=t,this.#l[t]=e}#R(t){t!==this.#r&&(t===this.#a?this.#a=this.#l[t]:this.#q(this.#u[t],this.#l[t]),this.#q(this.#r,t),this.#r=t)}delete(t){return this.#O(t,"delete")}#O(t,e){let i=!1;if(this.#n!==0){const s=this.#s.get(t);if(s!==void 0)if(this.#p?.[s]&&(clearTimeout(this.#p?.[s]),this.#p[s]=void 0),i=!0,this.#n===1)this.#k(e);else{this.#z(s);const r=this.#t[s];if(this.#e(r)?r.__abortController.abort(new Error("deleted")):(this.#A||this.#f)&&(this.#A&&this.#m?.(r,t,e),this.#f&&this.#o?.push([r,t,e])),this.#s.delete(t),this.#i[s]=void 0,this.#t[s]=void 0,s===this.#r)this.#r=this.#u[s];else if(s===this.#a)this.#a=this.#l[s];else{const n=this.#u[s];this.#l[n]=this.#l[s];const o=this.#l[s];this.#u[o]=this.#u[s]}this.#n--,this.#y.push(s)}}if(this.#f&&this.#o?.length){const s=this.#o;let r;for(;r=s?.shift();)this.#b?.(...r)}return i}clear(){return this.#k("delete")}#k(t){for(const e of this.#E({allowStale:!0})){const i=this.#t[e];if(this.#e(i))i.__abortController.abort(new Error("deleted"));else{const s=this.#i[e];this.#A&&this.#m?.(i,s,t),this.#f&&this.#o?.push([i,s,t])}}if(this.#s.clear(),this.#t.fill(void 0),this.#i.fill(void 0),this.#d&&this.#v){this.#d.fill(0),this.#v.fill(0);for(const e of this.#p??[])e!==void 0&&clearTimeout(e);this.#p?.fill(void 0)}if(this.#S&&this.#S.fill(0),this.#a=0,this.#r=0,this.#y.length=0,this.#_=0,this.#n=0,this.#f&&this.#o){const e=this.#o;let i;for(;i=e?.shift();)this.#b?.(...i)}}}var W={},z={},$;function gt(){if($)return z;$=1,Object.defineProperty(z,"__esModule",{value:!0}),z.getMDXComponent=r,z.getMDXExport=n;var h=s(nt()),t=s(rt()),e=s(Q());function i(o){if(typeof WeakMap!="function")return null;var a=new WeakMap,f=new WeakMap;return(i=function(d){return d?f:a})(o)}function s(o,a){if(o&&o.__esModule)return o;if(o===null||typeof o!="object"&&typeof o!="function")return{default:o};var f=i(a);if(f&&f.has(o))return f.get(o);var d={__proto__:null},c=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in o)if(l!=="default"&&{}.hasOwnProperty.call(o,l)){var g=c?Object.getOwnPropertyDescriptor(o,l):null;g&&(g.get||g.set)?Object.defineProperty(d,l,g):d[l]=o[l]}return d.default=o,f&&f.set(o,d),d}function r(o,a){return n(o,a).default}function n(o,a){const d={...{React:h,ReactDOM:t,_jsx_runtime:e},...a};return new Function(...Object.keys(d),o)(...Object.values(d))}return z}var B;function mt(){return B||(B=1,(function(h){Object.defineProperty(h,"__esModule",{value:!0});var t=gt();Object.keys(t).forEach(function(e){e==="default"||e==="__esModule"||e in h&&h[e]===t[e]||Object.defineProperty(h,e,{enumerable:!0,get:function(){return t[e]}})})})(W)),W}var L,X;function bt(){return X||(X=1,L=mt()),L}var wt=bt();function _t({code:h,svg:t,svgTheme:e,onSvg:i}){const r=ct()==="dark"?"dark":"default",o=`${`mermaid-svg-${v.useId()}`}-${r}`,a=v.useRef(null),f=v.useRef(i);return v.useEffect(()=>{f.current=i},[i]),v.useEffect(()=>{if(!a.current||t&&e===r)return;let d=!1;return ft(()=>import("./mermaid.core-BdxLLjl2.js").then(c=>c.bB),__vite__mapDeps([0,1,2,3,4,5])).then(c=>{c.default.initialize({startOnLoad:!1,theme:r}),c.default.render(o,h).then(({svg:l})=>{!d&&a.current&&(a.current.innerHTML=l,f.current?.(l))}).catch(l=>{!d&&a.current&&(a.current.innerHTML=`<pre style='color:red'>${String(l)}</pre>`)})}),()=>{d=!0}},[h,r,o,t,e]),u.jsx("div",{className:"mermaid not-prose",children:u.jsx("div",{ref:a,dangerouslySetInnerHTML:t?{__html:t}:void 0})})}const P=h=>h.replace(/\\/g,"/");function Z(h,t,e){const[,i]=h.replace(/\\|\//g,t).split(`${e==="playground"?"example":"exercises"}${t}`);return i}const U="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 yt({"data-buttons":h,"data-filename":t,"data-fullpath":e,"data-sep":i="/","data-start":s,"data-type":r}){const n=ht();if(r==="other"||!h||!t||!e)return null;const o=P(n[n.type]?.fullPath??""),a=!e.startsWith(o),f=ENV.EPICSHOP_DEPLOYED?["problem","solution"]:["problem","solution","playground"],d=h.split(","),c=f.filter(l=>d.includes(l));return u.jsx(u.Fragment,{children:c.map(l=>{const g=n[l];if(l==="playground"){const _=n.playground&&n.playground.appName!==n.problem?.name;if(!g||_||a)return u.jsxs("button",{className:G(U,"cursor-not-allowed"),title:_?"Playground is not set to the right app":a?"This file is from different app":"You must 'Set to Playground' before opening a file",children:[u.jsx("span",{className:"uppercase",children:"Open"})," in ",l]},l)}if(!g||!g.fullPath)return null;const S=[P(g.fullPath),P(t)].join(i),m=Z(S,i,l);return u.jsx(H,{file:S,line:Number(s??1),children:u.jsxs("span",{title:m,className:U,children:[u.jsx("span",{className:"uppercase",children:"Open"})," in ",l]})},l)})})}function St(){const[h,t]=v.useState(!1);return v.useEffect(()=>{if(h){const e=setTimeout(()=>t(!1),1500);return()=>clearTimeout(e)}},[h]),u.jsx("button",{className:it(U,"w-12 uppercase"),onClick:async e=>{if(navigator.clipboard)try{const s=e.currentTarget.parentElement?.parentElement?.querySelector("pre")?.textContent||"";await navigator.clipboard.writeText(s),t(!0)}catch(i){console.error("Failed to copy to clipboard:",i),k.error("Failed to copy to clipboard",{description:"Please try again or copy the code manually."})}else k.error("Copying is only available in secure contexts (HTTPS or localhost).",{description:"Please access the workshop via localhost instead of an IP address to enable this feature."})},children:h?"copied":"copy"})}function vt({children:h,...t}){const{"data-buttons":e,"data-filename":i,"data-fullpath":s,"data-nocopy":r,"data-sep":n}=t,o=r===void 0;function a(){if(s&&n)return!i||i.includes("..")?{"data-filename":Z(s,n)}:{"data-filename":i.replace(/\//g,n)}}return u.jsxs("div",{className:"group relative",children:[u.jsxs("div",{className:"absolute top-0 right-0 z-50 m-2 flex items-baseline justify-end gap-4 opacity-0 transition duration-300 ease-in-out group-hover:opacity-100 focus-within:opacity-100",children:[e?u.jsx(yt,{...t}):null,o?u.jsx(St,{}):null]}),u.jsx("pre",{...t,className:G("scrollbar-thin scrollbar-thumb-scrollbar",t.className??""),...a(),children:h})]})}const At={h1:h=>u.jsx(F,{...h,as:"h1"}),h2:h=>u.jsx(F,{...h,as:"h2"}),h3:h=>u.jsx(F,{...h,as:"h3"}),h4:h=>u.jsx(F,{...h,as:"h4"}),h5:h=>u.jsx(F,{...h,as:"h5"}),h6:h=>u.jsx(F,{...h,as:"h6"}),a:st,p:h=>u.jsx("div",{...h}),pre:h=>u.jsx("pre",{...h,className:G("scrollbar-thin scrollbar-thumb-scrollbar",h.className??"")}),LaunchEditor:H,VideoEmbed:lt,EpicVideo:at,Mermaid:_t};function xt(h){const t=wt.getMDXComponent(h);function e({components:i,...s}){const r=v.useMemo(()=>({...At,...i}),[i]);return u.jsx(t,{components:r,...s})}return e}const N=new q({max:1e3});function Et(h){return v.useMemo(()=>{if(N.has(h))return N.get(h);const t=xt(h);return N.set(h,t),t},[h])}function Ut({code:h,components:t}){const e=Et(h),i=v.useMemo(()=>({Icon:tt,pre:vt,Link:ot,...t}),[t]);return u.jsx(e,{components:i})}function Gt(h){return function({file:e,children:i=u.jsx("code",{children:e}),...s}){const r=h(),n=u.jsxs("div",{className:"launch-editor-button-wrapper flex underline underline-offset-4",children:[i," ",u.jsx("svg",{height:24,width:24,children:u.jsx("use",{href:`${et}#Keyboard`})})]});return r?u.jsx("div",{className:"inline-block grow",children:u.jsx(H,{appFile:e,appName:r.name,...s,children:n})}):u.jsx(ut,{content:"App information not available",children:u.jsx("div",{className:"inline-block grow cursor-not-allowed",children:n})})}}export{Ut as M,Gt as c};
|
|
3
|
-
//# sourceMappingURL=mdx-
|
|
2
|
+
import{r as Q,j as u}from"./jsx-runtime-C5WNSv3b.js";import{I as tt,a as G,m as et,c as it,A as st,H as F}from"./misc-W4055b-0.js";import{b as nt,r as v}from"./index-CqIc3cxq.js";import{a as rt}from"./index-vDCSPjrM.js";import{L as ot,b as ht}from"./chunk-EPOLDU6W-BCLmut3y.js";import{t as k}from"./index-DzdDahau.js";import{D as at,V as lt}from"./epic-video-DzLohyvt.js";import{_ as ft}from"./preload-helper-BXl3LOEh.js";import{u as ct}from"./index-CdzVFL-Z.js";import{S as ut}from"./tooltip-Tlsyx2YO.js";import{L as H}from"./launch-editor-D2exGfVu.js";const dt=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Y=new Set,I=typeof process=="object"&&process?process:{},J=(h,t,e,i)=>{typeof I.emitWarning=="function"?I.emitWarning(h,t,e,i):console.error(`[${e}] ${t}: ${h}`)};let M=globalThis.AbortController,V=globalThis.AbortSignal;if(typeof M>"u"){V=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(i,s){this._onabort.push(s)}},M=class{constructor(){t()}signal=new V;abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=!0;for(const s of this.signal._onabort)s(i);this.signal.onabort?.(i)}}};let h=I.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1";const t=()=>{h&&(h=!1,J("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",t))}}const pt=h=>!Y.has(h),x=h=>h&&h===Math.floor(h)&&h>0&&isFinite(h),K=h=>x(h)?h<=Math.pow(2,8)?Uint8Array:h<=Math.pow(2,16)?Uint16Array:h<=Math.pow(2,32)?Uint32Array:h<=Number.MAX_SAFE_INTEGER?D:null:null;class D extends Array{constructor(t){super(t),this.fill(0)}}class j{heap;length;static#h=!1;static create(t){const e=K(t);if(!e)return[];j.#h=!0;const i=new j(t,e);return j.#h=!1,i}constructor(t,e){if(!j.#h)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new e(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}}class q{#h;#c;#m;#j;#b;#D;#M;#w;get perf(){return this.#w}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#n;#_;#s;#i;#t;#l;#u;#a;#r;#y;#o;#S;#v;#d;#p;#A;#F;#f;#W;static unsafeExposeInternals(t){return{starts:t.#v,ttls:t.#d,autopurgeTimers:t.#p,sizes:t.#S,keyMap:t.#s,keyList:t.#i,valList:t.#t,next:t.#l,prev:t.#u,get head(){return t.#a},get tail(){return t.#r},free:t.#y,isBackgroundFetch:e=>t.#e(e),backgroundFetch:(e,i,s,r)=>t.#N(e,i,s,r),moveToTail:e=>t.#R(e),indexes:e=>t.#x(e),rindexes:e=>t.#E(e),isStale:e=>t.#g(e)}}get max(){return this.#h}get maxSize(){return this.#c}get calculatedSize(){return this.#_}get size(){return this.#n}get fetchMethod(){return this.#D}get memoMethod(){return this.#M}get dispose(){return this.#m}get onInsert(){return this.#j}get disposeAfter(){return this.#b}constructor(t){const{max:e=0,ttl:i,ttlResolution:s=1,ttlAutopurge:r,updateAgeOnGet:n,updateAgeOnHas:o,allowStale:a,dispose:f,onInsert:d,disposeAfter:c,noDisposeOnSet:l,noUpdateTTL:g,maxSize:S=0,maxEntrySize:m=0,sizeCalculation:_,fetchMethod:p,memoMethod:w,noDeleteOnFetchRejection:A,noDeleteOnStaleGet:b,allowStaleOnFetchRejection:y,allowStaleOnFetchAbort:C,ignoreFetchAbort:E,perf:R}=t;if(R!==void 0&&typeof R?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#w=R??dt,e!==0&&!x(e))throw new TypeError("max option must be a nonnegative integer");const O=e?K(e):Array;if(!O)throw new Error("invalid max value: "+e);if(this.#h=e,this.#c=S,this.maxEntrySize=m||this.#c,this.sizeCalculation=_,this.sizeCalculation){if(!this.#c&&!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(w!==void 0&&typeof w!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#M=w,p!==void 0&&typeof p!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#D=p,this.#F=!!p,this.#s=new Map,this.#i=new Array(e).fill(void 0),this.#t=new Array(e).fill(void 0),this.#l=new O(e),this.#u=new O(e),this.#a=0,this.#r=0,this.#y=j.create(e),this.#n=0,this.#_=0,typeof f=="function"&&(this.#m=f),typeof d=="function"&&(this.#j=d),typeof c=="function"?(this.#b=c,this.#o=[]):(this.#b=void 0,this.#o=void 0),this.#A=!!this.#m,this.#W=!!this.#j,this.#f=!!this.#b,this.noDisposeOnSet=!!l,this.noUpdateTTL=!!g,this.noDeleteOnFetchRejection=!!A,this.allowStaleOnFetchRejection=!!y,this.allowStaleOnFetchAbort=!!C,this.ignoreFetchAbort=!!E,this.maxEntrySize!==0){if(this.#c!==0&&!x(this.#c))throw new TypeError("maxSize must be a positive integer if specified");if(!x(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#V()}if(this.allowStale=!!a,this.noDeleteOnStaleGet=!!b,this.updateAgeOnGet=!!n,this.updateAgeOnHas=!!o,this.ttlResolution=x(s)||s===0?s:1,this.ttlAutopurge=!!r,this.ttl=i||0,this.ttl){if(!x(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#I()}if(this.#h===0&&this.ttl===0&&this.#c===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#h&&!this.#c){const T="LRU_CACHE_UNBOUNDED";pt(T)&&(Y.add(T),J("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",T,q))}}getRemainingTTL(t){return this.#s.has(t)?1/0:0}#I(){const t=new D(this.#h),e=new D(this.#h);this.#d=t,this.#v=e;const i=this.ttlAutopurge?new Array(this.#h):void 0;this.#p=i,this.#U=(n,o,a=this.#w.now())=>{if(e[n]=o!==0?a:0,t[n]=o,i?.[n]&&(clearTimeout(i[n]),i[n]=void 0),o!==0&&i){const f=setTimeout(()=>{this.#g(n)&&this.#O(this.#i[n],"expire")},o+1);f.unref&&f.unref(),i[n]=f}},this.#C=n=>{e[n]=t[n]!==0?this.#w.now():0},this.#T=(n,o)=>{if(t[o]){const a=t[o],f=e[o];if(!a||!f)return;n.ttl=a,n.start=f,n.now=s||r();const d=n.now-f;n.remainingTTL=a-d}};let s=0;const r=()=>{const n=this.#w.now();if(this.ttlResolution>0){s=n;const o=setTimeout(()=>s=0,this.ttlResolution);o.unref&&o.unref()}return n};this.getRemainingTTL=n=>{const o=this.#s.get(n);if(o===void 0)return 0;const a=t[o],f=e[o];if(!a||!f)return 1/0;const d=(s||r())-f;return a-d},this.#g=n=>{const o=e[n],a=t[n];return!!a&&!!o&&(s||r())-o>a}}#C=()=>{};#T=()=>{};#U=()=>{};#g=()=>!1;#V(){const t=new D(this.#h);this.#_=0,this.#S=t,this.#z=e=>{this.#_-=t[e],t[e]=0},this.#G=(e,i,s,r)=>{if(this.#e(i))return 0;if(!x(s))if(r){if(typeof r!="function")throw new TypeError("sizeCalculation must be a function");if(s=r(i,e),!x(s))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 s},this.#L=(e,i,s)=>{if(t[e]=i,this.#c){const r=this.#c-t[e];for(;this.#_>r;)this.#P(!0)}this.#_+=t[e],s&&(s.entrySize=i,s.totalCalculatedSize=this.#_)}}#z=t=>{};#L=(t,e,i)=>{};#G=(t,e,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#x({allowStale:t=this.allowStale}={}){if(this.#n)for(let e=this.#r;!(!this.#H(e)||((t||!this.#g(e))&&(yield e),e===this.#a));)e=this.#u[e]}*#E({allowStale:t=this.allowStale}={}){if(this.#n)for(let e=this.#a;!(!this.#H(e)||((t||!this.#g(e))&&(yield e),e===this.#r));)e=this.#l[e]}#H(t){return t!==void 0&&this.#s.get(this.#i[t])===t}*entries(){for(const t of this.#x())this.#t[t]!==void 0&&this.#i[t]!==void 0&&!this.#e(this.#t[t])&&(yield[this.#i[t],this.#t[t]])}*rentries(){for(const t of this.#E())this.#t[t]!==void 0&&this.#i[t]!==void 0&&!this.#e(this.#t[t])&&(yield[this.#i[t],this.#t[t]])}*keys(){for(const t of this.#x()){const e=this.#i[t];e!==void 0&&!this.#e(this.#t[t])&&(yield e)}}*rkeys(){for(const t of this.#E()){const e=this.#i[t];e!==void 0&&!this.#e(this.#t[t])&&(yield e)}}*values(){for(const t of this.#x())this.#t[t]!==void 0&&!this.#e(this.#t[t])&&(yield this.#t[t])}*rvalues(){for(const t of this.#E())this.#t[t]!==void 0&&!this.#e(this.#t[t])&&(yield this.#t[t])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,e={}){for(const i of this.#x()){const s=this.#t[i],r=this.#e(s)?s.__staleWhileFetching:s;if(r!==void 0&&t(r,this.#i[i],this))return this.get(this.#i[i],e)}}forEach(t,e=this){for(const i of this.#x()){const s=this.#t[i],r=this.#e(s)?s.__staleWhileFetching:s;r!==void 0&&t.call(e,r,this.#i[i],this)}}rforEach(t,e=this){for(const i of this.#E()){const s=this.#t[i],r=this.#e(s)?s.__staleWhileFetching:s;r!==void 0&&t.call(e,r,this.#i[i],this)}}purgeStale(){let t=!1;for(const e of this.#E({allowStale:!0}))this.#g(e)&&(this.#O(this.#i[e],"expire"),t=!0);return t}info(t){const e=this.#s.get(t);if(e===void 0)return;const i=this.#t[e],s=this.#e(i)?i.__staleWhileFetching:i;if(s===void 0)return;const r={value:s};if(this.#d&&this.#v){const n=this.#d[e],o=this.#v[e];if(n&&o){const a=n-(this.#w.now()-o);r.ttl=a,r.start=Date.now()}}return this.#S&&(r.size=this.#S[e]),r}dump(){const t=[];for(const e of this.#x({allowStale:!0})){const i=this.#i[e],s=this.#t[e],r=this.#e(s)?s.__staleWhileFetching:s;if(r===void 0||i===void 0)continue;const n={value:r};if(this.#d&&this.#v){n.ttl=this.#d[e];const o=this.#w.now()-this.#v[e];n.start=Math.floor(Date.now()-o)}this.#S&&(n.size=this.#S[e]),t.unshift([i,n])}return t}load(t){this.clear();for(const[e,i]of t){if(i.start){const s=Date.now()-i.start;i.start=this.#w.now()-s}this.set(e,i.value,i)}}set(t,e,i={}){if(e===void 0)return this.delete(t),this;const{ttl:s=this.ttl,start:r,noDisposeOnSet:n=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:a}=i;let{noUpdateTTL:f=this.noUpdateTTL}=i;const d=this.#G(t,e,i.size||0,o);if(this.maxEntrySize&&d>this.maxEntrySize)return a&&(a.set="miss",a.maxEntrySizeExceeded=!0),this.#O(t,"set"),this;let c=this.#n===0?void 0:this.#s.get(t);if(c===void 0)c=this.#n===0?this.#r:this.#y.length!==0?this.#y.pop():this.#n===this.#h?this.#P(!1):this.#n,this.#i[c]=t,this.#t[c]=e,this.#s.set(t,c),this.#l[this.#r]=c,this.#u[c]=this.#r,this.#r=c,this.#n++,this.#L(c,d,a),a&&(a.set="add"),f=!1,this.#W&&this.#j?.(e,t,"add");else{this.#R(c);const l=this.#t[c];if(e!==l){if(this.#F&&this.#e(l)){l.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:g}=l;g!==void 0&&!n&&(this.#A&&this.#m?.(g,t,"set"),this.#f&&this.#o?.push([g,t,"set"]))}else n||(this.#A&&this.#m?.(l,t,"set"),this.#f&&this.#o?.push([l,t,"set"]));if(this.#z(c),this.#L(c,d,a),this.#t[c]=e,a){a.set="replace";const g=l&&this.#e(l)?l.__staleWhileFetching:l;g!==void 0&&(a.oldValue=g)}}else a&&(a.set="update");this.#W&&this.onInsert?.(e,t,e===l?"update":"replace")}if(s!==0&&!this.#d&&this.#I(),this.#d&&(f||this.#U(c,s,r),a&&this.#T(a,c)),!n&&this.#f&&this.#o){const l=this.#o;let g;for(;g=l?.shift();)this.#b?.(...g)}return this}pop(){try{for(;this.#n;){const t=this.#t[this.#a];if(this.#P(!0),this.#e(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(this.#f&&this.#o){const t=this.#o;let e;for(;e=t?.shift();)this.#b?.(...e)}}}#P(t){const e=this.#a,i=this.#i[e],s=this.#t[e];return this.#F&&this.#e(s)?s.__abortController.abort(new Error("evicted")):(this.#A||this.#f)&&(this.#A&&this.#m?.(s,i,"evict"),this.#f&&this.#o?.push([s,i,"evict"])),this.#z(e),this.#p?.[e]&&(clearTimeout(this.#p[e]),this.#p[e]=void 0),t&&(this.#i[e]=void 0,this.#t[e]=void 0,this.#y.push(e)),this.#n===1?(this.#a=this.#r=0,this.#y.length=0):this.#a=this.#l[e],this.#s.delete(i),this.#n--,e}has(t,e={}){const{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=e,r=this.#s.get(t);if(r!==void 0){const n=this.#t[r];if(this.#e(n)&&n.__staleWhileFetching===void 0)return!1;if(this.#g(r))s&&(s.has="stale",this.#T(s,r));else return i&&this.#C(r),s&&(s.has="hit",this.#T(s,r)),!0}else s&&(s.has="miss");return!1}peek(t,e={}){const{allowStale:i=this.allowStale}=e,s=this.#s.get(t);if(s===void 0||!i&&this.#g(s))return;const r=this.#t[s];return this.#e(r)?r.__staleWhileFetching:r}#N(t,e,i,s){const r=e===void 0?void 0:this.#t[e];if(this.#e(r))return r;const n=new M,{signal:o}=i;o?.addEventListener("abort",()=>n.abort(o.reason),{signal:n.signal});const a={signal:n.signal,options:i,context:s},f=(m,_=!1)=>{const{aborted:p}=n.signal,w=i.ignoreFetchAbort&&m!==void 0;if(i.status&&(p&&!_?(i.status.fetchAborted=!0,i.status.fetchError=n.signal.reason,w&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),p&&!w&&!_)return c(n.signal.reason);const A=g,b=this.#t[e];return(b===g||w&&_&&b===void 0)&&(m===void 0?A.__staleWhileFetching!==void 0?this.#t[e]=A.__staleWhileFetching:this.#O(t,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.set(t,m,a.options))),m},d=m=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=m),c(m)),c=m=>{const{aborted:_}=n.signal,p=_&&i.allowStaleOnFetchAbort,w=p||i.allowStaleOnFetchRejection,A=w||i.noDeleteOnFetchRejection,b=g;if(this.#t[e]===g&&(!A||b.__staleWhileFetching===void 0?this.#O(t,"fetch"):p||(this.#t[e]=b.__staleWhileFetching)),w)return i.status&&b.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),b.__staleWhileFetching;if(b.__returned===b)throw m},l=(m,_)=>{const p=this.#D?.(t,r,a);p&&p instanceof Promise&&p.then(w=>m(w===void 0?void 0:w),_),n.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(m(void 0),i.allowStaleOnFetchAbort&&(m=w=>f(w,!0)))})};i.status&&(i.status.fetchDispatched=!0);const g=new Promise(l).then(f,d),S=Object.assign(g,{__abortController:n,__staleWhileFetching:r,__returned:void 0});return e===void 0?(this.set(t,S,{...a.options,status:void 0}),e=this.#s.get(t)):this.#t[e]=S,S}#e(t){if(!this.#F)return!1;const e=t;return!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof M}async fetch(t,e={}){const{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,ttl:n=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:a=0,sizeCalculation:f=this.sizeCalculation,noUpdateTTL:d=this.noUpdateTTL,noDeleteOnFetchRejection:c=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:l=this.allowStaleOnFetchRejection,ignoreFetchAbort:g=this.ignoreFetchAbort,allowStaleOnFetchAbort:S=this.allowStaleOnFetchAbort,context:m,forceRefresh:_=!1,status:p,signal:w}=e;if(!this.#F)return p&&(p.fetch="get"),this.get(t,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:r,status:p});const A={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:r,ttl:n,noDisposeOnSet:o,size:a,sizeCalculation:f,noUpdateTTL:d,noDeleteOnFetchRejection:c,allowStaleOnFetchRejection:l,allowStaleOnFetchAbort:S,ignoreFetchAbort:g,status:p,signal:w};let b=this.#s.get(t);if(b===void 0){p&&(p.fetch="miss");const y=this.#N(t,b,A,m);return y.__returned=y}else{const y=this.#t[b];if(this.#e(y)){const T=i&&y.__staleWhileFetching!==void 0;return p&&(p.fetch="inflight",T&&(p.returnedStale=!0)),T?y.__staleWhileFetching:y.__returned=y}const C=this.#g(b);if(!_&&!C)return p&&(p.fetch="hit"),this.#R(b),s&&this.#C(b),p&&this.#T(p,b),y;const E=this.#N(t,b,A,m),O=E.__staleWhileFetching!==void 0&&i;return p&&(p.fetch=C?"stale":"refresh",O&&C&&(p.returnedStale=!0)),O?E.__staleWhileFetching:E.__returned=E}}async forceFetch(t,e={}){const i=await this.fetch(t,e);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(t,e={}){const i=this.#M;if(!i)throw new Error("no memoMethod provided to constructor");const{context:s,forceRefresh:r,...n}=e,o=this.get(t,n);if(!r&&o!==void 0)return o;const a=i(t,o,{options:n,context:s});return this.set(t,a,n),a}get(t,e={}){const{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,status:n}=e,o=this.#s.get(t);if(o!==void 0){const a=this.#t[o],f=this.#e(a);return n&&this.#T(n,o),this.#g(o)?(n&&(n.get="stale"),f?(n&&i&&a.__staleWhileFetching!==void 0&&(n.returnedStale=!0),i?a.__staleWhileFetching:void 0):(r||this.#O(t,"expire"),n&&i&&(n.returnedStale=!0),i?a:void 0)):(n&&(n.get="hit"),f?a.__staleWhileFetching:(this.#R(o),s&&this.#C(o),a))}else n&&(n.get="miss")}#q(t,e){this.#u[e]=t,this.#l[t]=e}#R(t){t!==this.#r&&(t===this.#a?this.#a=this.#l[t]:this.#q(this.#u[t],this.#l[t]),this.#q(this.#r,t),this.#r=t)}delete(t){return this.#O(t,"delete")}#O(t,e){let i=!1;if(this.#n!==0){const s=this.#s.get(t);if(s!==void 0)if(this.#p?.[s]&&(clearTimeout(this.#p?.[s]),this.#p[s]=void 0),i=!0,this.#n===1)this.#k(e);else{this.#z(s);const r=this.#t[s];if(this.#e(r)?r.__abortController.abort(new Error("deleted")):(this.#A||this.#f)&&(this.#A&&this.#m?.(r,t,e),this.#f&&this.#o?.push([r,t,e])),this.#s.delete(t),this.#i[s]=void 0,this.#t[s]=void 0,s===this.#r)this.#r=this.#u[s];else if(s===this.#a)this.#a=this.#l[s];else{const n=this.#u[s];this.#l[n]=this.#l[s];const o=this.#l[s];this.#u[o]=this.#u[s]}this.#n--,this.#y.push(s)}}if(this.#f&&this.#o?.length){const s=this.#o;let r;for(;r=s?.shift();)this.#b?.(...r)}return i}clear(){return this.#k("delete")}#k(t){for(const e of this.#E({allowStale:!0})){const i=this.#t[e];if(this.#e(i))i.__abortController.abort(new Error("deleted"));else{const s=this.#i[e];this.#A&&this.#m?.(i,s,t),this.#f&&this.#o?.push([i,s,t])}}if(this.#s.clear(),this.#t.fill(void 0),this.#i.fill(void 0),this.#d&&this.#v){this.#d.fill(0),this.#v.fill(0);for(const e of this.#p??[])e!==void 0&&clearTimeout(e);this.#p?.fill(void 0)}if(this.#S&&this.#S.fill(0),this.#a=0,this.#r=0,this.#y.length=0,this.#_=0,this.#n=0,this.#f&&this.#o){const e=this.#o;let i;for(;i=e?.shift();)this.#b?.(...i)}}}var W={},z={},$;function gt(){if($)return z;$=1,Object.defineProperty(z,"__esModule",{value:!0}),z.getMDXComponent=r,z.getMDXExport=n;var h=s(nt()),t=s(rt()),e=s(Q());function i(o){if(typeof WeakMap!="function")return null;var a=new WeakMap,f=new WeakMap;return(i=function(d){return d?f:a})(o)}function s(o,a){if(o&&o.__esModule)return o;if(o===null||typeof o!="object"&&typeof o!="function")return{default:o};var f=i(a);if(f&&f.has(o))return f.get(o);var d={__proto__:null},c=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in o)if(l!=="default"&&{}.hasOwnProperty.call(o,l)){var g=c?Object.getOwnPropertyDescriptor(o,l):null;g&&(g.get||g.set)?Object.defineProperty(d,l,g):d[l]=o[l]}return d.default=o,f&&f.set(o,d),d}function r(o,a){return n(o,a).default}function n(o,a){const d={...{React:h,ReactDOM:t,_jsx_runtime:e},...a};return new Function(...Object.keys(d),o)(...Object.values(d))}return z}var B;function mt(){return B||(B=1,(function(h){Object.defineProperty(h,"__esModule",{value:!0});var t=gt();Object.keys(t).forEach(function(e){e==="default"||e==="__esModule"||e in h&&h[e]===t[e]||Object.defineProperty(h,e,{enumerable:!0,get:function(){return t[e]}})})})(W)),W}var L,X;function bt(){return X||(X=1,L=mt()),L}var wt=bt();function _t({code:h,svg:t,svgTheme:e,onSvg:i}){const r=ct()==="dark"?"dark":"default",o=`${`mermaid-svg-${v.useId()}`}-${r}`,a=v.useRef(null),f=v.useRef(i);return v.useEffect(()=>{f.current=i},[i]),v.useEffect(()=>{if(!a.current||t&&e===r)return;let d=!1;return ft(()=>import("./mermaid.core-BdxLLjl2.js").then(c=>c.bB),__vite__mapDeps([0,1,2,3,4,5])).then(c=>{c.default.initialize({startOnLoad:!1,theme:r}),c.default.render(o,h).then(({svg:l})=>{!d&&a.current&&(a.current.innerHTML=l,f.current?.(l))}).catch(l=>{!d&&a.current&&(a.current.innerHTML=`<pre style='color:red'>${String(l)}</pre>`)})}),()=>{d=!0}},[h,r,o,t,e]),u.jsx("div",{className:"mermaid not-prose",children:u.jsx("div",{ref:a,dangerouslySetInnerHTML:t?{__html:t}:void 0})})}const P=h=>h.replace(/\\/g,"/");function Z(h,t,e){const[,i]=h.replace(/\\|\//g,t).split(`${e==="playground"?"example":"exercises"}${t}`);return i}const U="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 yt({"data-buttons":h,"data-filename":t,"data-fullpath":e,"data-sep":i="/","data-start":s,"data-type":r}){const n=ht();if(r==="other"||!h||!t||!e)return null;const o=P(n[n.type]?.fullPath??""),a=!e.startsWith(o),f=ENV.EPICSHOP_DEPLOYED?["problem","solution"]:["problem","solution","playground"],d=h.split(","),c=f.filter(l=>d.includes(l));return u.jsx(u.Fragment,{children:c.map(l=>{const g=n[l];if(l==="playground"){const _=n.playground&&n.playground.appName!==n.problem?.name;if(!g||_||a)return u.jsxs("button",{className:G(U,"cursor-not-allowed"),title:_?"Playground is not set to the right app":a?"This file is from different app":"You must 'Set to Playground' before opening a file",children:[u.jsx("span",{className:"uppercase",children:"Open"})," in ",l]},l)}if(!g||!g.fullPath)return null;const S=[P(g.fullPath),P(t)].join(i),m=Z(S,i,l);return u.jsx(H,{file:S,line:Number(s??1),children:u.jsxs("span",{title:m,className:U,children:[u.jsx("span",{className:"uppercase",children:"Open"})," in ",l]})},l)})})}function St(){const[h,t]=v.useState(!1);return v.useEffect(()=>{if(h){const e=setTimeout(()=>t(!1),1500);return()=>clearTimeout(e)}},[h]),u.jsx("button",{className:it(U,"w-12 uppercase"),onClick:async e=>{if(navigator.clipboard)try{const s=e.currentTarget.parentElement?.parentElement?.querySelector("pre")?.textContent||"";await navigator.clipboard.writeText(s),t(!0)}catch(i){console.error("Failed to copy to clipboard:",i),k.error("Failed to copy to clipboard",{description:"Please try again or copy the code manually."})}else k.error("Copying is only available in secure contexts (HTTPS or localhost).",{description:"Please access the workshop via localhost instead of an IP address to enable this feature."})},children:h?"copied":"copy"})}function vt({children:h,...t}){const{"data-buttons":e,"data-filename":i,"data-fullpath":s,"data-nocopy":r,"data-sep":n}=t,o=r===void 0;function a(){if(s&&n)return!i||i.includes("..")?{"data-filename":Z(s,n)}:{"data-filename":i.replace(/\//g,n)}}return u.jsxs("div",{className:"group relative",children:[u.jsxs("div",{className:"absolute top-0 right-0 z-50 m-2 flex items-baseline justify-end gap-4 opacity-0 transition duration-300 ease-in-out group-hover:opacity-100 focus-within:opacity-100",children:[e?u.jsx(yt,{...t}):null,o?u.jsx(St,{}):null]}),u.jsx("pre",{...t,className:G("scrollbar-thin scrollbar-thumb-scrollbar",t.className??""),...a(),children:h})]})}const At={h1:h=>u.jsx(F,{...h,as:"h1"}),h2:h=>u.jsx(F,{...h,as:"h2"}),h3:h=>u.jsx(F,{...h,as:"h3"}),h4:h=>u.jsx(F,{...h,as:"h4"}),h5:h=>u.jsx(F,{...h,as:"h5"}),h6:h=>u.jsx(F,{...h,as:"h6"}),a:st,p:h=>u.jsx("div",{...h}),pre:h=>u.jsx("pre",{...h,className:G("scrollbar-thin scrollbar-thumb-scrollbar",h.className??"")}),LaunchEditor:H,VideoEmbed:lt,EpicVideo:at,Mermaid:_t};function xt(h){const t=wt.getMDXComponent(h);function e({components:i,...s}){const r=v.useMemo(()=>({...At,...i}),[i]);return u.jsx(t,{components:r,...s})}return e}const N=new q({max:1e3});function Et(h){return v.useMemo(()=>{if(N.has(h))return N.get(h);const t=xt(h);return N.set(h,t),t},[h])}function Ut({code:h,components:t}){const e=Et(h),i=v.useMemo(()=>({Icon:tt,pre:vt,Link:ot,...t}),[t]);return u.jsx(e,{components:i})}function Gt(h){return function({file:e,children:i=u.jsx("code",{children:e}),...s}){const r=h(),n=u.jsxs("div",{className:"launch-editor-button-wrapper flex underline underline-offset-4",children:[i," ",u.jsx("svg",{height:24,width:24,children:u.jsx("use",{href:`${et}#Keyboard`})})]});return r?u.jsx("div",{className:"inline-block grow",children:u.jsx(H,{appFile:e,appName:r.name,...s,children:n})}):u.jsx(ut,{content:"App information not available",children:u.jsx("div",{className:"inline-block grow cursor-not-allowed",children:n})})}}export{Ut as M,Gt as c};
|
|
3
|
+
//# sourceMappingURL=mdx-8X3W8bVO.js.map
|