@drincs/pixi-vn 1.5.13 → 1.5.18

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.
Files changed (59) hide show
  1. package/README.md +8 -3
  2. package/dist/canvas.cjs +3 -2
  3. package/dist/canvas.d.cts +46 -105
  4. package/dist/canvas.d.ts +46 -105
  5. package/dist/canvas.mjs +3 -2
  6. package/dist/characters.cjs +2 -1
  7. package/dist/characters.mjs +2 -1
  8. package/dist/chunk-46QBDRUK.mjs +2 -0
  9. package/dist/chunk-52EK6LYW.mjs +2 -0
  10. package/dist/chunk-INJYRMJ3.mjs +2 -0
  11. package/dist/{chunk-TTRUPDAB.mjs → chunk-JJFD2BVW.mjs} +2 -1
  12. package/dist/chunk-JJFD2BVW.mjs.map +1 -0
  13. package/dist/chunk-OXRIVLY2.mjs +2 -0
  14. package/dist/chunk-SOFV7YZ5.mjs +2 -0
  15. package/dist/chunk-XZMYXKAY.mjs +2 -0
  16. package/dist/core.cjs +1 -0
  17. package/dist/core.d.cts +399 -0
  18. package/dist/core.d.ts +399 -0
  19. package/dist/core.mjs +1 -0
  20. package/dist/history.cjs +2 -1
  21. package/dist/history.d.cts +1 -1
  22. package/dist/history.d.ts +1 -1
  23. package/dist/history.mjs +2 -1
  24. package/dist/index.cjs +3 -2
  25. package/dist/index.cjs.map +1 -0
  26. package/dist/index.d.cts +9 -10
  27. package/dist/index.d.ts +9 -10
  28. package/dist/index.mjs +3 -2
  29. package/dist/index.mjs.map +1 -0
  30. package/dist/motion.cjs +2 -0
  31. package/dist/motion.cjs.map +1 -0
  32. package/dist/motion.d.cts +96 -0
  33. package/dist/motion.d.ts +96 -0
  34. package/dist/motion.mjs +2 -0
  35. package/dist/motion.mjs.map +1 -0
  36. package/dist/narration.cjs +3 -2
  37. package/dist/narration.mjs +3 -2
  38. package/dist/pixi/browser.js +170 -167
  39. package/dist/sound.cjs +2 -1
  40. package/dist/sound.mjs +2 -1
  41. package/dist/storage.cjs +2 -1
  42. package/dist/storage.mjs +2 -1
  43. package/dist/vite-listener.cjs +2 -1
  44. package/dist/vite-listener.cjs.map +1 -0
  45. package/dist/vite-listener.mjs +2 -1
  46. package/dist/vite-listener.mjs.map +1 -0
  47. package/dist/vite.cjs +2 -1
  48. package/dist/vite.cjs.map +1 -0
  49. package/dist/vite.mjs +2 -1
  50. package/dist/vite.mjs.map +1 -0
  51. package/package.json +27 -10
  52. package/dist/chunk-6GO4XVS7.mjs +0 -1
  53. package/dist/chunk-6IVCTY6P.mjs +0 -1
  54. package/dist/chunk-GNJIUFU2.mjs +0 -1
  55. package/dist/chunk-HVEJJGVC.mjs +0 -1
  56. package/dist/chunk-XDBHD3IV.mjs +0 -1
  57. package/dist/chunk-XSN6P5JL.mjs +0 -0
  58. package/dist/unifier.cjs +0 -1
  59. package/dist/unifier.mjs +0 -1
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import {b,d,a,c,e,f as f$1,g}from'./chunk-TTRUPDAB.mjs';import*as N from'@drincs/pixi-vn/canvas';export*from'@drincs/pixi-vn/canvas';import*as $t from'@drincs/pixi-vn/characters';export*from'@drincs/pixi-vn/characters';import*as tt from'@drincs/pixi-vn/history';export*from'@drincs/pixi-vn/history';import*as j from'@drincs/pixi-vn/narration';export*from'@drincs/pixi-vn/narration';import*as ct from'@drincs/pixi-vn/sound';export*from'@drincs/pixi-vn/sound';import*as I from'@drincs/pixi-vn/storage';export*from'@drincs/pixi-vn/storage';import {GameUnifier}from'@drincs/pixi-vn/unifier';export*from'@drincs/pixi-vn/unifier';var ne=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Jt=new Set,zt=typeof process=="object"&&process?process:{},Qt=(g,e,i,s)=>{typeof zt.emitWarning=="function"?zt.emitWarning(g,e,i,s):console.error(`[${i}] ${e}: ${g}`);},Pt=globalThis.AbortController,Bt=globalThis.AbortSignal;if(typeof Pt>"u"){Bt=class{constructor(){b(this,"onabort");b(this,"_onabort",[]);b(this,"reason");b(this,"aborted",false);}addEventListener(i,s){this._onabort.push(s);}},Pt=class{constructor(){b(this,"signal",new Bt);e();}abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=true;for(let s of this.signal._onabort)s(i);this.signal.onabort?.(i);}}};let g=zt.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{g&&(g=false,Qt("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));};}var ae=g=>!Jt.has(g);var ot=g=>g&&g===Math.floor(g)&&g>0&&isFinite(g),Zt=g=>ot(g)?g<=Math.pow(2,8)?Uint8Array:g<=Math.pow(2,16)?Uint16Array:g<=Math.pow(2,32)?Uint32Array:g<=Number.MAX_SAFE_INTEGER?Ct:null:null,Ct=class extends Array{constructor(g){super(g),this.fill(0);}},et,_t,he=(et=class{constructor(e,i){b(this,"heap");b(this,"length");if(!c(et,_t))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new i(e),this.length=0;}static create(e$1){let i=Zt(e$1);if(!i)return [];e(et,_t,true);let s=new et(e$1,i);return e(et,_t,false),s}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}},_t=new WeakMap,d(et,_t,false),et),Xt,Yt,K,M,q,pt,$,yt,St,B,D,X,T,E,f,L,V,P,C,Y,F,J,Q,W,H,Z,lt,z,xt,h,Nt,dt,st,Ut,k,ee,ut,wt,Ot,nt,at,It,Ft,jt,A,Gt,Et,ht,Mt,bt,te=(bt=class{constructor(e$1){d(this,h);d(this,K);d(this,M);d(this,q);d(this,pt);d(this,$);d(this,yt);d(this,St);d(this,B);b(this,"ttl");b(this,"ttlResolution");b(this,"ttlAutopurge");b(this,"updateAgeOnGet");b(this,"updateAgeOnHas");b(this,"allowStale");b(this,"noDisposeOnSet");b(this,"noUpdateTTL");b(this,"maxEntrySize");b(this,"sizeCalculation");b(this,"noDeleteOnFetchRejection");b(this,"noDeleteOnStaleGet");b(this,"allowStaleOnFetchAbort");b(this,"allowStaleOnFetchRejection");b(this,"ignoreFetchAbort");d(this,D);d(this,X);d(this,T);d(this,E);d(this,f);d(this,L);d(this,V);d(this,P);d(this,C);d(this,Y);d(this,F);d(this,J);d(this,Q);d(this,W);d(this,H);d(this,Z);d(this,lt);d(this,z);d(this,xt);d(this,dt,()=>{});d(this,st,()=>{});d(this,Ut,()=>{});d(this,k,()=>false);d(this,ut,e=>{});d(this,wt,(e,i,s)=>{});d(this,Ot,(e,i,s,o)=>{if(s||o)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});b(this,Xt,"LRUCache");let{max:i=0,ttl:s,ttlResolution:o=1,ttlAutopurge:a,updateAgeOnGet:r,updateAgeOnHas:p,allowStale:u,dispose:S,onInsert:R,disposeAfter:b$1,noDisposeOnSet:it,noUpdateTTL:G,maxSize:d$1=0,maxEntrySize:_=0,sizeCalculation:v,fetchMethod:n,memoMethod:y,noDeleteOnFetchRejection:U,noDeleteOnStaleGet:O,allowStaleOnFetchRejection:x,allowStaleOnFetchAbort:rt,ignoreFetchAbort:mt,perf:gt}=e$1;if(gt!==void 0&&typeof gt?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(e(this,B,gt??ne),i!==0&&!ot(i))throw new TypeError("max option must be a nonnegative integer");let vt=i?Zt(i):Array;if(!vt)throw new Error("invalid max value: "+i);if(e(this,K,i),e(this,M,d$1),this.maxEntrySize=_||c(this,M),this.sizeCalculation=v,this.sizeCalculation){if(!c(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(y!==void 0&&typeof y!="function")throw new TypeError("memoMethod must be a function if defined");if(e(this,St,y),n!==void 0&&typeof n!="function")throw new TypeError("fetchMethod must be a function if specified");if(e(this,yt,n),e(this,lt,!!n),e(this,T,new Map),e(this,E,new Array(i).fill(void 0)),e(this,f,new Array(i).fill(void 0)),e(this,L,new vt(i)),e(this,V,new vt(i)),e(this,P,0),e(this,C,0),e(this,Y,he.create(i)),e(this,D,0),e(this,X,0),typeof S=="function"&&e(this,q,S),typeof R=="function"&&e(this,pt,R),typeof b$1=="function"?(e(this,$,b$1),e(this,F,[])):(e(this,$,void 0),e(this,F,void 0)),e(this,Z,!!c(this,q)),e(this,xt,!!c(this,pt)),e(this,z,!!c(this,$)),this.noDisposeOnSet=!!it,this.noUpdateTTL=!!G,this.noDeleteOnFetchRejection=!!U,this.allowStaleOnFetchRejection=!!x,this.allowStaleOnFetchAbort=!!rt,this.ignoreFetchAbort=!!mt,this.maxEntrySize!==0){if(c(this,M)!==0&&!ot(c(this,M)))throw new TypeError("maxSize must be a positive integer if specified");if(!ot(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");f$1(this,h,ee).call(this);}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!O,this.updateAgeOnGet=!!r,this.updateAgeOnHas=!!p,this.ttlResolution=ot(o)||o===0?o:1,this.ttlAutopurge=!!a,this.ttl=s||0,this.ttl){if(!ot(this.ttl))throw new TypeError("ttl must be a positive integer if specified");f$1(this,h,Nt).call(this);}if(c(this,K)===0&&this.ttl===0&&c(this,M)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!c(this,K)&&!c(this,M)){let Lt="LRU_CACHE_UNBOUNDED";ae(Lt)&&(Jt.add(Lt),Qt("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",Lt,bt));}}get perf(){return c(this,B)}static unsafeExposeInternals(e){return {starts:c(e,Q),ttls:c(e,W),autopurgeTimers:c(e,H),sizes:c(e,J),keyMap:c(e,T),keyList:c(e,E),valList:c(e,f),next:c(e,L),prev:c(e,V),get head(){return c(e,P)},get tail(){return c(e,C)},free:c(e,Y),isBackgroundFetch:i=>{var s;return f$1(s=e,h,A).call(s,i)},backgroundFetch:(i,s,o,a)=>{var r;return f$1(r=e,h,jt).call(r,i,s,o,a)},moveToTail:i=>{var s;return f$1(s=e,h,Et).call(s,i)},indexes:i=>{var s;return f$1(s=e,h,nt).call(s,i)},rindexes:i=>{var s;return f$1(s=e,h,at).call(s,i)},isStale:i=>{var s;return c(s=e,k).call(s,i)}}}get max(){return c(this,K)}get maxSize(){return c(this,M)}get calculatedSize(){return c(this,X)}get size(){return c(this,D)}get fetchMethod(){return c(this,yt)}get memoMethod(){return c(this,St)}get dispose(){return c(this,q)}get onInsert(){return c(this,pt)}get disposeAfter(){return c(this,$)}getRemainingTTL(e){return c(this,T).has(e)?1/0:0}*entries(){for(let e of f$1(this,h,nt).call(this))c(this,f)[e]!==void 0&&c(this,E)[e]!==void 0&&!f$1(this,h,A).call(this,c(this,f)[e])&&(yield [c(this,E)[e],c(this,f)[e]]);}*rentries(){for(let e of f$1(this,h,at).call(this))c(this,f)[e]!==void 0&&c(this,E)[e]!==void 0&&!f$1(this,h,A).call(this,c(this,f)[e])&&(yield [c(this,E)[e],c(this,f)[e]]);}*keys(){for(let e of f$1(this,h,nt).call(this)){let i=c(this,E)[e];i!==void 0&&!f$1(this,h,A).call(this,c(this,f)[e])&&(yield i);}}*rkeys(){for(let e of f$1(this,h,at).call(this)){let i=c(this,E)[e];i!==void 0&&!f$1(this,h,A).call(this,c(this,f)[e])&&(yield i);}}*values(){for(let e of f$1(this,h,nt).call(this))c(this,f)[e]!==void 0&&!f$1(this,h,A).call(this,c(this,f)[e])&&(yield c(this,f)[e]);}*rvalues(){for(let e of f$1(this,h,at).call(this))c(this,f)[e]!==void 0&&!f$1(this,h,A).call(this,c(this,f)[e])&&(yield c(this,f)[e]);}[(Yt=Symbol.iterator,Xt=Symbol.toStringTag,Yt)](){return this.entries()}find(e,i={}){for(let s of f$1(this,h,nt).call(this)){let o=c(this,f)[s],a=f$1(this,h,A).call(this,o)?o.__staleWhileFetching:o;if(a!==void 0&&e(a,c(this,E)[s],this))return this.get(c(this,E)[s],i)}}forEach(e,i=this){for(let s of f$1(this,h,nt).call(this)){let o=c(this,f)[s],a=f$1(this,h,A).call(this,o)?o.__staleWhileFetching:o;a!==void 0&&e.call(i,a,c(this,E)[s],this);}}rforEach(e,i=this){for(let s of f$1(this,h,at).call(this)){let o=c(this,f)[s],a=f$1(this,h,A).call(this,o)?o.__staleWhileFetching:o;a!==void 0&&e.call(i,a,c(this,E)[s],this);}}purgeStale(){let e=false;for(let i of f$1(this,h,at).call(this,{allowStale:true}))c(this,k).call(this,i)&&(f$1(this,h,ht).call(this,c(this,E)[i],"expire"),e=true);return e}info(e){let i=c(this,T).get(e);if(i===void 0)return;let s=c(this,f)[i],o=f$1(this,h,A).call(this,s)?s.__staleWhileFetching:s;if(o===void 0)return;let a={value:o};if(c(this,W)&&c(this,Q)){let r=c(this,W)[i],p=c(this,Q)[i];if(r&&p){let u=r-(c(this,B).now()-p);a.ttl=u,a.start=Date.now();}}return c(this,J)&&(a.size=c(this,J)[i]),a}dump(){let e=[];for(let i of f$1(this,h,nt).call(this,{allowStale:true})){let s=c(this,E)[i],o=c(this,f)[i],a=f$1(this,h,A).call(this,o)?o.__staleWhileFetching:o;if(a===void 0||s===void 0)continue;let r={value:a};if(c(this,W)&&c(this,Q)){r.ttl=c(this,W)[i];let p=c(this,B).now()-c(this,Q)[i];r.start=Math.floor(Date.now()-p);}c(this,J)&&(r.size=c(this,J)[i]),e.unshift([s,r]);}return e}load(e){this.clear();for(let[i,s]of e){if(s.start){let o=Date.now()-s.start;s.start=c(this,B).now()-o;}this.set(i,s.value,s);}}set(e$1,i,s={}){var it,G,d,_;if(i===void 0)return this.delete(e$1),this;let{ttl:o=this.ttl,start:a,noDisposeOnSet:r=this.noDisposeOnSet,sizeCalculation:p=this.sizeCalculation,status:u}=s,{noUpdateTTL:S=this.noUpdateTTL}=s,R=c(this,Ot).call(this,e$1,i,s.size||0,p);if(this.maxEntrySize&&R>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=true),f$1(this,h,ht).call(this,e$1,"set"),this;let b=c(this,D)===0?void 0:c(this,T).get(e$1);if(b===void 0)b=c(this,D)===0?c(this,C):c(this,Y).length!==0?c(this,Y).pop():c(this,D)===c(this,K)?f$1(this,h,Ft).call(this,false):c(this,D),c(this,E)[b]=e$1,c(this,f)[b]=i,c(this,T).set(e$1,b),c(this,L)[c(this,C)]=b,c(this,V)[b]=c(this,C),e(this,C,b),g(this,D)._++,c(this,wt).call(this,b,R,u),u&&(u.set="add"),S=false,c(this,xt)&&((it=c(this,pt))==null||it.call(this,i,e$1,"add"));else {f$1(this,h,Et).call(this,b);let v=c(this,f)[b];if(i!==v){if(c(this,lt)&&f$1(this,h,A).call(this,v)){v.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:n}=v;n!==void 0&&!r&&(c(this,Z)&&((G=c(this,q))==null||G.call(this,n,e$1,"set")),c(this,z)&&c(this,F)?.push([n,e$1,"set"]));}else r||(c(this,Z)&&((d=c(this,q))==null||d.call(this,v,e$1,"set")),c(this,z)&&c(this,F)?.push([v,e$1,"set"]));if(c(this,ut).call(this,b),c(this,wt).call(this,b,R,u),c(this,f)[b]=i,u){u.set="replace";let n=v&&f$1(this,h,A).call(this,v)?v.__staleWhileFetching:v;n!==void 0&&(u.oldValue=n);}}else u&&(u.set="update");c(this,xt)&&this.onInsert?.(i,e$1,i===v?"update":"replace");}if(o!==0&&!c(this,W)&&f$1(this,h,Nt).call(this),c(this,W)&&(S||c(this,Ut).call(this,b,o,a),u&&c(this,st).call(this,u,b)),!r&&c(this,z)&&c(this,F)){let v=c(this,F),n;for(;n=v?.shift();)(_=c(this,$))==null||_.call(this,...n);}return this}pop(){var e;try{for(;c(this,D);){let i=c(this,f)[c(this,P)];if(f$1(this,h,Ft).call(this,!0),f$1(this,h,A).call(this,i)){if(i.__staleWhileFetching)return i.__staleWhileFetching}else if(i!==void 0)return i}}finally{if(c(this,z)&&c(this,F)){let i=c(this,F),s;for(;s=i?.shift();)(e=c(this,$))==null||e.call(this,...s);}}}has(e,i={}){let{updateAgeOnHas:s=this.updateAgeOnHas,status:o}=i,a=c(this,T).get(e);if(a!==void 0){let r=c(this,f)[a];if(f$1(this,h,A).call(this,r)&&r.__staleWhileFetching===void 0)return false;if(c(this,k).call(this,a))o&&(o.has="stale",c(this,st).call(this,o,a));else return s&&c(this,dt).call(this,a),o&&(o.has="hit",c(this,st).call(this,o,a)),true}else o&&(o.has="miss");return false}peek(e,i={}){let{allowStale:s=this.allowStale}=i,o=c(this,T).get(e);if(o===void 0||!s&&c(this,k).call(this,o))return;let a=c(this,f)[o];return f$1(this,h,A).call(this,a)?a.__staleWhileFetching:a}async fetch(e,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:o=this.updateAgeOnGet,noDeleteOnStaleGet:a=this.noDeleteOnStaleGet,ttl:r=this.ttl,noDisposeOnSet:p=this.noDisposeOnSet,size:u=0,sizeCalculation:S=this.sizeCalculation,noUpdateTTL:R=this.noUpdateTTL,noDeleteOnFetchRejection:b=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:it=this.allowStaleOnFetchRejection,ignoreFetchAbort:G=this.ignoreFetchAbort,allowStaleOnFetchAbort:d=this.allowStaleOnFetchAbort,context:_,forceRefresh:v=false,status:n,signal:y}=i;if(!c(this,lt))return n&&(n.fetch="get"),this.get(e,{allowStale:s,updateAgeOnGet:o,noDeleteOnStaleGet:a,status:n});let U={allowStale:s,updateAgeOnGet:o,noDeleteOnStaleGet:a,ttl:r,noDisposeOnSet:p,size:u,sizeCalculation:S,noUpdateTTL:R,noDeleteOnFetchRejection:b,allowStaleOnFetchRejection:it,allowStaleOnFetchAbort:d,ignoreFetchAbort:G,status:n,signal:y},O=c(this,T).get(e);if(O===void 0){n&&(n.fetch="miss");let x=f$1(this,h,jt).call(this,e,O,U,_);return x.__returned=x}else {let x=c(this,f)[O];if(f$1(this,h,A).call(this,x)){let vt=s&&x.__staleWhileFetching!==void 0;return n&&(n.fetch="inflight",vt&&(n.returnedStale=true)),vt?x.__staleWhileFetching:x.__returned=x}let rt=c(this,k).call(this,O);if(!v&&!rt)return n&&(n.fetch="hit"),f$1(this,h,Et).call(this,O),o&&c(this,dt).call(this,O),n&&c(this,st).call(this,n,O),x;let mt=f$1(this,h,jt).call(this,e,O,U,_),gt=mt.__staleWhileFetching!==void 0&&s;return n&&(n.fetch=rt?"stale":"refresh",gt&&rt&&(n.returnedStale=true)),gt?mt.__staleWhileFetching:mt.__returned=mt}}async forceFetch(e,i={}){let s=await this.fetch(e,i);if(s===void 0)throw new Error("fetch() returned undefined");return s}memo(e,i={}){let s=c(this,St);if(!s)throw new Error("no memoMethod provided to constructor");let{context:o,forceRefresh:a,...r}=i,p=this.get(e,r);if(!a&&p!==void 0)return p;let u=s(e,p,{options:r,context:o});return this.set(e,u,r),u}get(e,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:o=this.updateAgeOnGet,noDeleteOnStaleGet:a=this.noDeleteOnStaleGet,status:r}=i,p=c(this,T).get(e);if(p!==void 0){let u=c(this,f)[p],S=f$1(this,h,A).call(this,u);return r&&c(this,st).call(this,r,p),c(this,k).call(this,p)?(r&&(r.get="stale"),S?(r&&s&&u.__staleWhileFetching!==void 0&&(r.returnedStale=true),s?u.__staleWhileFetching:void 0):(a||f$1(this,h,ht).call(this,e,"expire"),r&&s&&(r.returnedStale=true),s?u:void 0)):(r&&(r.get="hit"),S?u.__staleWhileFetching:(f$1(this,h,Et).call(this,p),o&&c(this,dt).call(this,p),u))}else r&&(r.get="miss");}delete(e){return f$1(this,h,ht).call(this,e,"delete")}clear(){return f$1(this,h,Mt).call(this,"delete")}},K=new WeakMap,M=new WeakMap,q=new WeakMap,pt=new WeakMap,$=new WeakMap,yt=new WeakMap,St=new WeakMap,B=new WeakMap,D=new WeakMap,X=new WeakMap,T=new WeakMap,E=new WeakMap,f=new WeakMap,L=new WeakMap,V=new WeakMap,P=new WeakMap,C=new WeakMap,Y=new WeakMap,F=new WeakMap,J=new WeakMap,Q=new WeakMap,W=new WeakMap,H=new WeakMap,Z=new WeakMap,lt=new WeakMap,z=new WeakMap,xt=new WeakMap,h=new WeakSet,Nt=function(){let e$1=new Ct(c(this,K)),i=new Ct(c(this,K));e(this,W,e$1),e(this,Q,i);let s=this.ttlAutopurge?new Array(c(this,K)):void 0;e(this,H,s),e(this,Ut,(r,p,u=c(this,B).now())=>{if(i[r]=p!==0?u:0,e$1[r]=p,s?.[r]&&(clearTimeout(s[r]),s[r]=void 0),p!==0&&s){let S=setTimeout(()=>{c(this,k).call(this,r)&&f$1(this,h,ht).call(this,c(this,E)[r],"expire");},p+1);S.unref&&S.unref(),s[r]=S;}}),e(this,dt,r=>{i[r]=e$1[r]!==0?c(this,B).now():0;}),e(this,st,(r,p)=>{if(e$1[p]){let u=e$1[p],S=i[p];if(!u||!S)return;r.ttl=u,r.start=S,r.now=o||a();let R=r.now-S;r.remainingTTL=u-R;}});let o=0,a=()=>{let r=c(this,B).now();if(this.ttlResolution>0){o=r;let p=setTimeout(()=>o=0,this.ttlResolution);p.unref&&p.unref();}return r};this.getRemainingTTL=r=>{let p=c(this,T).get(r);if(p===void 0)return 0;let u=e$1[p],S=i[p];if(!u||!S)return 1/0;let R=(o||a())-S;return u-R},e(this,k,r=>{let p=i[r],u=e$1[r];return !!u&&!!p&&(o||a())-p>u});},dt=new WeakMap,st=new WeakMap,Ut=new WeakMap,k=new WeakMap,ee=function(){let e$1=new Ct(c(this,K));e(this,X,0),e(this,J,e$1),e(this,ut,i=>{e(this,X,c(this,X)-e$1[i]),e$1[i]=0;}),e(this,Ot,(i,s,o,a)=>{if(f$1(this,h,A).call(this,s))return 0;if(!ot(o))if(a){if(typeof a!="function")throw new TypeError("sizeCalculation must be a function");if(o=a(s,i),!ot(o))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 o}),e(this,wt,(i,s,o)=>{if(e$1[i]=s,c(this,M)){let a=c(this,M)-e$1[i];for(;c(this,X)>a;)f$1(this,h,Ft).call(this,true);}e(this,X,c(this,X)+e$1[i]),o&&(o.entrySize=s,o.totalCalculatedSize=c(this,X));});},ut=new WeakMap,wt=new WeakMap,Ot=new WeakMap,nt=function*({allowStale:e=this.allowStale}={}){if(c(this,D))for(let i=c(this,C);!(!f$1(this,h,It).call(this,i)||((e||!c(this,k).call(this,i))&&(yield i),i===c(this,P)));)i=c(this,V)[i];},at=function*({allowStale:e=this.allowStale}={}){if(c(this,D))for(let i=c(this,P);!(!f$1(this,h,It).call(this,i)||((e||!c(this,k).call(this,i))&&(yield i),i===c(this,C)));)i=c(this,L)[i];},It=function(e){return e!==void 0&&c(this,T).get(c(this,E)[e])===e},Ft=function(e$1){var a;let i=c(this,P),s=c(this,E)[i],o=c(this,f)[i];return c(this,lt)&&f$1(this,h,A).call(this,o)?o.__abortController.abort(new Error("evicted")):(c(this,Z)||c(this,z))&&(c(this,Z)&&((a=c(this,q))==null||a.call(this,o,s,"evict")),c(this,z)&&c(this,F)?.push([o,s,"evict"])),c(this,ut).call(this,i),c(this,H)?.[i]&&(clearTimeout(c(this,H)[i]),c(this,H)[i]=void 0),e$1&&(c(this,E)[i]=void 0,c(this,f)[i]=void 0,c(this,Y).push(i)),c(this,D)===1?(e(this,P,e(this,C,0)),c(this,Y).length=0):e(this,P,c(this,L)[i]),c(this,T).delete(s),g(this,D)._--,i},jt=function(e,i,s,o){let a=i===void 0?void 0:c(this,f)[i];if(f$1(this,h,A).call(this,a))return a;let r=new Pt,{signal:p}=s;p?.addEventListener("abort",()=>r.abort(p.reason),{signal:r.signal});let u={signal:r.signal,options:s,context:o},S=(_,v=false)=>{let{aborted:n}=r.signal,y=s.ignoreFetchAbort&&_!==void 0,U=s.ignoreFetchAbort||!!(s.allowStaleOnFetchAbort&&_!==void 0);if(s.status&&(n&&!v?(s.status.fetchAborted=true,s.status.fetchError=r.signal.reason,y&&(s.status.fetchAbortIgnored=true)):s.status.fetchResolved=true),n&&!y&&!v)return b(r.signal.reason,U);let O=G,x=c(this,f)[i];return (x===G||y&&v&&x===void 0)&&(_===void 0?O.__staleWhileFetching!==void 0?c(this,f)[i]=O.__staleWhileFetching:f$1(this,h,ht).call(this,e,"fetch"):(s.status&&(s.status.fetchUpdated=true),this.set(e,_,u.options))),_},R=_=>(s.status&&(s.status.fetchRejected=true,s.status.fetchError=_),b(_,false)),b=(_,v)=>{let{aborted:n}=r.signal,y=n&&s.allowStaleOnFetchAbort,U=y||s.allowStaleOnFetchRejection,O=U||s.noDeleteOnFetchRejection,x=G;if(c(this,f)[i]===G&&(!O||!v&&x.__staleWhileFetching===void 0?f$1(this,h,ht).call(this,e,"fetch"):y||(c(this,f)[i]=x.__staleWhileFetching)),U)return s.status&&x.__staleWhileFetching!==void 0&&(s.status.returnedStale=true),x.__staleWhileFetching;if(x.__returned===x)throw _},it=(_,v)=>{var y;let n=(y=c(this,yt))==null?void 0:y.call(this,e,a,u);n&&n instanceof Promise&&n.then(U=>_(U===void 0?void 0:U),v),r.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(_(void 0),s.allowStaleOnFetchAbort&&(_=U=>S(U,true)));});};s.status&&(s.status.fetchDispatched=true);let G=new Promise(it).then(S,R),d=Object.assign(G,{__abortController:r,__staleWhileFetching:a,__returned:void 0});return i===void 0?(this.set(e,d,{...u.options,status:void 0}),i=c(this,T).get(e)):c(this,f)[i]=d,d},A=function(e){if(!c(this,lt))return false;let i=e;return !!i&&i instanceof Promise&&i.hasOwnProperty("__staleWhileFetching")&&i.__abortController instanceof Pt},Gt=function(e,i){c(this,V)[i]=e,c(this,L)[e]=i;},Et=function(e$1){e$1!==c(this,C)&&(e$1===c(this,P)?e(this,P,c(this,L)[e$1]):f$1(this,h,Gt).call(this,c(this,V)[e$1],c(this,L)[e$1]),f$1(this,h,Gt).call(this,c(this,C),e$1),e(this,C,e$1));},ht=function(e$1,i){var o,a;let s=false;if(c(this,D)!==0){let r=c(this,T).get(e$1);if(r!==void 0)if(c(this,H)?.[r]&&(clearTimeout(c(this,H)?.[r]),c(this,H)[r]=void 0),s=true,c(this,D)===1)f$1(this,h,Mt).call(this,i);else {c(this,ut).call(this,r);let p=c(this,f)[r];if(f$1(this,h,A).call(this,p)?p.__abortController.abort(new Error("deleted")):(c(this,Z)||c(this,z))&&(c(this,Z)&&((o=c(this,q))==null||o.call(this,p,e$1,i)),c(this,z)&&c(this,F)?.push([p,e$1,i])),c(this,T).delete(e$1),c(this,E)[r]=void 0,c(this,f)[r]=void 0,r===c(this,C))e(this,C,c(this,V)[r]);else if(r===c(this,P))e(this,P,c(this,L)[r]);else {let u=c(this,V)[r];c(this,L)[u]=c(this,L)[r];let S=c(this,L)[r];c(this,V)[S]=c(this,V)[r];}g(this,D)._--,c(this,Y).push(r);}}if(c(this,z)&&c(this,F)?.length){let r=c(this,F),p;for(;p=r?.shift();)(a=c(this,$))==null||a.call(this,...p);}return s},Mt=function(e$1){var i,s;for(let o of f$1(this,h,at).call(this,{allowStale:true})){let a=c(this,f)[o];if(f$1(this,h,A).call(this,a))a.__abortController.abort(new Error("deleted"));else {let r=c(this,E)[o];c(this,Z)&&((i=c(this,q))==null||i.call(this,a,r,e$1)),c(this,z)&&c(this,F)?.push([a,r,e$1]);}}if(c(this,T).clear(),c(this,f).fill(void 0),c(this,E).fill(void 0),c(this,W)&&c(this,Q)){c(this,W).fill(0),c(this,Q).fill(0);for(let o of c(this,H)??[])o!==void 0&&clearTimeout(o);c(this,H)?.fill(void 0);}if(c(this,J)&&c(this,J).fill(0),e(this,P,0),e(this,C,0),c(this,Y).length=0,e(this,X,0),e(this,D,0),c(this,z)&&c(this,F)){let o=c(this,F),a;for(;a=o?.shift();)(s=c(this,$))==null||s.call(this,...a);}},bt);var Rt=class{constructor(e){b(this,"cache");b(this,"map",new Map);this.cache=new te({max:e.cacheSize}),this.map=new Map;}get[Symbol.iterator](){return this.map[Symbol.iterator]}get[Symbol.toStringTag](){return this.map[Symbol.toStringTag]}clear(){return this.cache.clear(),this.map.clear()}delete(e){let i=this.map.delete(e);return i&&this.cache.delete(e),i}get forEach(){return this.map.forEach}get(e){let i=this.cache.get(e);return i||this.map.get(e)}has(e){return this.map.has(e)}set(e,i){return this.map.set(e,i),this.cache.set(e,i),this}get size(){return this.map.size}entries(){return this.map.entries()}keys(){return this.map.keys()}values(){return this.map.values()}};var Tt="1.5.13";var Vt="repeat";function Wt(g){return {type:"pause",duration:g}}var Ht="__game_layer__";var ie={};var kt={};a(kt,{createExportableElement:()=>se});var At;(o=>(o.log=(a,...r)=>console.log(`[Pixi\u2019VN] ${a}`,...r),o.warn=(a,...r)=>console.warn(`[Pixi\u2019VN] ${a}`,...r),o.error=(a,...r)=>console.error(`[Pixi\u2019VN] ${a}`,...r),o.info=(a,...r)=>console.info(`[Pixi\u2019VN] ${a}`,...r)))(At||(At={}));function se(g){try{if(typeof g>"u")return g;let e=JSON.stringify(g);return JSON.parse(e)}catch(e){throw At.error("Error creating exportable element",g,e),new Error("[Pixi\u2019VN] Error creating exportable element")}}function re(){console.info(`
1
+ import {b,d,a,c,e,f as f$1,g}from'./chunk-JJFD2BVW.mjs';import*as I from'@drincs/pixi-vn/canvas';export*from'@drincs/pixi-vn/canvas';import*as $t from'@drincs/pixi-vn/characters';export*from'@drincs/pixi-vn/characters';import {PixiError,GameUnifier}from'@drincs/pixi-vn/core';export*from'@drincs/pixi-vn/core';import*as tt from'@drincs/pixi-vn/history';export*from'@drincs/pixi-vn/history';import*as P from'@drincs/pixi-vn/narration';export*from'@drincs/pixi-vn/narration';import*as ct from'@drincs/pixi-vn/sound';export*from'@drincs/pixi-vn/sound';import*as N from'@drincs/pixi-vn/storage';export*from'@drincs/pixi-vn/storage';import {motion}from'@drincs/pixi-vn/motion';var ne=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Jt=new Set,zt=typeof process=="object"&&process?process:{},Qt=(g,e,i,s)=>{typeof zt.emitWarning=="function"?zt.emitWarning(g,e,i,s):console.error(`[${i}] ${e}: ${g}`);},Pt=globalThis.AbortController,Bt=globalThis.AbortSignal;if(typeof Pt>"u"){Bt=class{constructor(){b(this,"onabort");b(this,"_onabort",[]);b(this,"reason");b(this,"aborted",false);}addEventListener(i,s){this._onabort.push(s);}},Pt=class{constructor(){b(this,"signal",new Bt);e();}abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=true;for(let s of this.signal._onabort)s(i);this.signal.onabort?.(i);}}};let g=zt.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{g&&(g=false,Qt("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));};}var ae=g=>!Jt.has(g);var ot=g=>g&&g===Math.floor(g)&&g>0&&isFinite(g),Zt=g=>ot(g)?g<=Math.pow(2,8)?Uint8Array:g<=Math.pow(2,16)?Uint16Array:g<=Math.pow(2,32)?Uint32Array:g<=Number.MAX_SAFE_INTEGER?Ct:null:null,Ct=class extends Array{constructor(g){super(g),this.fill(0);}},et,_t,le=(et=class{constructor(e,i){b(this,"heap");b(this,"length");if(!c(et,_t))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new i(e),this.length=0;}static create(e$1){let i=Zt(e$1);if(!i)return [];e(et,_t,true);let s=new et(e$1,i);return e(et,_t,false),s}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}},_t=new WeakMap,d(et,_t,false),et),Xt,Yt,q,M,K,pt,$,yt,St,B,D,X,T,E,f,L,V,R,F,Y,j,J,Q,W,H,Z,ht,z,xt,l,It,dt,st,Ut,k,ee,ut,wt,Ot,nt,at,Nt,Ft,jt,A,Gt,Et,lt,Mt,bt,te=(bt=class{constructor(e$1){d(this,l);d(this,q);d(this,M);d(this,K);d(this,pt);d(this,$);d(this,yt);d(this,St);d(this,B);b(this,"ttl");b(this,"ttlResolution");b(this,"ttlAutopurge");b(this,"updateAgeOnGet");b(this,"updateAgeOnHas");b(this,"allowStale");b(this,"noDisposeOnSet");b(this,"noUpdateTTL");b(this,"maxEntrySize");b(this,"sizeCalculation");b(this,"noDeleteOnFetchRejection");b(this,"noDeleteOnStaleGet");b(this,"allowStaleOnFetchAbort");b(this,"allowStaleOnFetchRejection");b(this,"ignoreFetchAbort");d(this,D);d(this,X);d(this,T);d(this,E);d(this,f);d(this,L);d(this,V);d(this,R);d(this,F);d(this,Y);d(this,j);d(this,J);d(this,Q);d(this,W);d(this,H);d(this,Z);d(this,ht);d(this,z);d(this,xt);d(this,dt,()=>{});d(this,st,()=>{});d(this,Ut,()=>{});d(this,k,()=>false);d(this,ut,e=>{});d(this,wt,(e,i,s)=>{});d(this,Ot,(e,i,s,r)=>{if(s||r)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});b(this,Xt,"LRUCache");let{max:i=0,ttl:s,ttlResolution:r=1,ttlAutopurge:a,updateAgeOnGet:o,updateAgeOnHas:c$1,allowStale:p,dispose:v,onInsert:C,disposeAfter:x,noDisposeOnSet:it,noUpdateTTL:G,maxSize:u=0,maxEntrySize:S=0,sizeCalculation:_,fetchMethod:n,memoMethod:y,noDeleteOnFetchRejection:U,noDeleteOnStaleGet:O,allowStaleOnFetchRejection:w,allowStaleOnFetchAbort:rt,ignoreFetchAbort:mt,perf:gt}=e$1;if(gt!==void 0&&typeof gt?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(e(this,B,gt??ne),i!==0&&!ot(i))throw new TypeError("max option must be a nonnegative integer");let vt=i?Zt(i):Array;if(!vt)throw new Error("invalid max value: "+i);if(e(this,q,i),e(this,M,u),this.maxEntrySize=S||c(this,M),this.sizeCalculation=_,this.sizeCalculation){if(!c(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(y!==void 0&&typeof y!="function")throw new TypeError("memoMethod must be a function if defined");if(e(this,St,y),n!==void 0&&typeof n!="function")throw new TypeError("fetchMethod must be a function if specified");if(e(this,yt,n),e(this,ht,!!n),e(this,T,new Map),e(this,E,new Array(i).fill(void 0)),e(this,f,new Array(i).fill(void 0)),e(this,L,new vt(i)),e(this,V,new vt(i)),e(this,R,0),e(this,F,0),e(this,Y,le.create(i)),e(this,D,0),e(this,X,0),typeof v=="function"&&e(this,K,v),typeof C=="function"&&e(this,pt,C),typeof x=="function"?(e(this,$,x),e(this,j,[])):(e(this,$,void 0),e(this,j,void 0)),e(this,Z,!!c(this,K)),e(this,xt,!!c(this,pt)),e(this,z,!!c(this,$)),this.noDisposeOnSet=!!it,this.noUpdateTTL=!!G,this.noDeleteOnFetchRejection=!!U,this.allowStaleOnFetchRejection=!!w,this.allowStaleOnFetchAbort=!!rt,this.ignoreFetchAbort=!!mt,this.maxEntrySize!==0){if(c(this,M)!==0&&!ot(c(this,M)))throw new TypeError("maxSize must be a positive integer if specified");if(!ot(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");f$1(this,l,ee).call(this);}if(this.allowStale=!!p,this.noDeleteOnStaleGet=!!O,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!c$1,this.ttlResolution=ot(r)||r===0?r:1,this.ttlAutopurge=!!a,this.ttl=s||0,this.ttl){if(!ot(this.ttl))throw new TypeError("ttl must be a positive integer if specified");f$1(this,l,It).call(this);}if(c(this,q)===0&&this.ttl===0&&c(this,M)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!c(this,q)&&!c(this,M)){let Lt="LRU_CACHE_UNBOUNDED";ae(Lt)&&(Jt.add(Lt),Qt("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",Lt,bt));}}get perf(){return c(this,B)}static unsafeExposeInternals(e){return {starts:c(e,Q),ttls:c(e,W),autopurgeTimers:c(e,H),sizes:c(e,J),keyMap:c(e,T),keyList:c(e,E),valList:c(e,f),next:c(e,L),prev:c(e,V),get head(){return c(e,R)},get tail(){return c(e,F)},free:c(e,Y),isBackgroundFetch:i=>{var s;return f$1(s=e,l,A).call(s,i)},backgroundFetch:(i,s,r,a)=>{var o;return f$1(o=e,l,jt).call(o,i,s,r,a)},moveToTail:i=>{var s;return f$1(s=e,l,Et).call(s,i)},indexes:i=>{var s;return f$1(s=e,l,nt).call(s,i)},rindexes:i=>{var s;return f$1(s=e,l,at).call(s,i)},isStale:i=>{var s;return c(s=e,k).call(s,i)}}}get max(){return c(this,q)}get maxSize(){return c(this,M)}get calculatedSize(){return c(this,X)}get size(){return c(this,D)}get fetchMethod(){return c(this,yt)}get memoMethod(){return c(this,St)}get dispose(){return c(this,K)}get onInsert(){return c(this,pt)}get disposeAfter(){return c(this,$)}getRemainingTTL(e){return c(this,T).has(e)?1/0:0}*entries(){for(let e of f$1(this,l,nt).call(this))c(this,f)[e]!==void 0&&c(this,E)[e]!==void 0&&!f$1(this,l,A).call(this,c(this,f)[e])&&(yield [c(this,E)[e],c(this,f)[e]]);}*rentries(){for(let e of f$1(this,l,at).call(this))c(this,f)[e]!==void 0&&c(this,E)[e]!==void 0&&!f$1(this,l,A).call(this,c(this,f)[e])&&(yield [c(this,E)[e],c(this,f)[e]]);}*keys(){for(let e of f$1(this,l,nt).call(this)){let i=c(this,E)[e];i!==void 0&&!f$1(this,l,A).call(this,c(this,f)[e])&&(yield i);}}*rkeys(){for(let e of f$1(this,l,at).call(this)){let i=c(this,E)[e];i!==void 0&&!f$1(this,l,A).call(this,c(this,f)[e])&&(yield i);}}*values(){for(let e of f$1(this,l,nt).call(this))c(this,f)[e]!==void 0&&!f$1(this,l,A).call(this,c(this,f)[e])&&(yield c(this,f)[e]);}*rvalues(){for(let e of f$1(this,l,at).call(this))c(this,f)[e]!==void 0&&!f$1(this,l,A).call(this,c(this,f)[e])&&(yield c(this,f)[e]);}[(Yt=Symbol.iterator,Xt=Symbol.toStringTag,Yt)](){return this.entries()}find(e,i={}){for(let s of f$1(this,l,nt).call(this)){let r=c(this,f)[s],a=f$1(this,l,A).call(this,r)?r.__staleWhileFetching:r;if(a!==void 0&&e(a,c(this,E)[s],this))return this.get(c(this,E)[s],i)}}forEach(e,i=this){for(let s of f$1(this,l,nt).call(this)){let r=c(this,f)[s],a=f$1(this,l,A).call(this,r)?r.__staleWhileFetching:r;a!==void 0&&e.call(i,a,c(this,E)[s],this);}}rforEach(e,i=this){for(let s of f$1(this,l,at).call(this)){let r=c(this,f)[s],a=f$1(this,l,A).call(this,r)?r.__staleWhileFetching:r;a!==void 0&&e.call(i,a,c(this,E)[s],this);}}purgeStale(){let e=false;for(let i of f$1(this,l,at).call(this,{allowStale:true}))c(this,k).call(this,i)&&(f$1(this,l,lt).call(this,c(this,E)[i],"expire"),e=true);return e}info(e){let i=c(this,T).get(e);if(i===void 0)return;let s=c(this,f)[i],r=f$1(this,l,A).call(this,s)?s.__staleWhileFetching:s;if(r===void 0)return;let a={value:r};if(c(this,W)&&c(this,Q)){let o=c(this,W)[i],c$1=c(this,Q)[i];if(o&&c$1){let p=o-(c(this,B).now()-c$1);a.ttl=p,a.start=Date.now();}}return c(this,J)&&(a.size=c(this,J)[i]),a}dump(){let e=[];for(let i of f$1(this,l,nt).call(this,{allowStale:true})){let s=c(this,E)[i],r=c(this,f)[i],a=f$1(this,l,A).call(this,r)?r.__staleWhileFetching:r;if(a===void 0||s===void 0)continue;let o={value:a};if(c(this,W)&&c(this,Q)){o.ttl=c(this,W)[i];let c$1=c(this,B).now()-c(this,Q)[i];o.start=Math.floor(Date.now()-c$1);}c(this,J)&&(o.size=c(this,J)[i]),e.unshift([s,o]);}return e}load(e){this.clear();for(let[i,s]of e){if(s.start){let r=Date.now()-s.start;s.start=c(this,B).now()-r;}this.set(i,s.value,s);}}set(e$1,i,s={}){var it,G,u,S;if(i===void 0)return this.delete(e$1),this;let{ttl:r=this.ttl,start:a,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:c$1=this.sizeCalculation,status:p}=s,{noUpdateTTL:v=this.noUpdateTTL}=s,C=c(this,Ot).call(this,e$1,i,s.size||0,c$1);if(this.maxEntrySize&&C>this.maxEntrySize)return p&&(p.set="miss",p.maxEntrySizeExceeded=true),f$1(this,l,lt).call(this,e$1,"set"),this;let x=c(this,D)===0?void 0:c(this,T).get(e$1);if(x===void 0)x=c(this,D)===0?c(this,F):c(this,Y).length!==0?c(this,Y).pop():c(this,D)===c(this,q)?f$1(this,l,Ft).call(this,false):c(this,D),c(this,E)[x]=e$1,c(this,f)[x]=i,c(this,T).set(e$1,x),c(this,L)[c(this,F)]=x,c(this,V)[x]=c(this,F),e(this,F,x),g(this,D)._++,c(this,wt).call(this,x,C,p),p&&(p.set="add"),v=false,c(this,xt)&&((it=c(this,pt))==null||it.call(this,i,e$1,"add"));else {f$1(this,l,Et).call(this,x);let _=c(this,f)[x];if(i!==_){if(c(this,ht)&&f$1(this,l,A).call(this,_)){_.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:n}=_;n!==void 0&&!o&&(c(this,Z)&&((G=c(this,K))==null||G.call(this,n,e$1,"set")),c(this,z)&&c(this,j)?.push([n,e$1,"set"]));}else o||(c(this,Z)&&((u=c(this,K))==null||u.call(this,_,e$1,"set")),c(this,z)&&c(this,j)?.push([_,e$1,"set"]));if(c(this,ut).call(this,x),c(this,wt).call(this,x,C,p),c(this,f)[x]=i,p){p.set="replace";let n=_&&f$1(this,l,A).call(this,_)?_.__staleWhileFetching:_;n!==void 0&&(p.oldValue=n);}}else p&&(p.set="update");c(this,xt)&&this.onInsert?.(i,e$1,i===_?"update":"replace");}if(r!==0&&!c(this,W)&&f$1(this,l,It).call(this),c(this,W)&&(v||c(this,Ut).call(this,x,r,a),p&&c(this,st).call(this,p,x)),!o&&c(this,z)&&c(this,j)){let _=c(this,j),n;for(;n=_?.shift();)(S=c(this,$))==null||S.call(this,...n);}return this}pop(){var e;try{for(;c(this,D);){let i=c(this,f)[c(this,R)];if(f$1(this,l,Ft).call(this,!0),f$1(this,l,A).call(this,i)){if(i.__staleWhileFetching)return i.__staleWhileFetching}else if(i!==void 0)return i}}finally{if(c(this,z)&&c(this,j)){let i=c(this,j),s;for(;s=i?.shift();)(e=c(this,$))==null||e.call(this,...s);}}}has(e,i={}){let{updateAgeOnHas:s=this.updateAgeOnHas,status:r}=i,a=c(this,T).get(e);if(a!==void 0){let o=c(this,f)[a];if(f$1(this,l,A).call(this,o)&&o.__staleWhileFetching===void 0)return false;if(c(this,k).call(this,a))r&&(r.has="stale",c(this,st).call(this,r,a));else return s&&c(this,dt).call(this,a),r&&(r.has="hit",c(this,st).call(this,r,a)),true}else r&&(r.has="miss");return false}peek(e,i={}){let{allowStale:s=this.allowStale}=i,r=c(this,T).get(e);if(r===void 0||!s&&c(this,k).call(this,r))return;let a=c(this,f)[r];return f$1(this,l,A).call(this,a)?a.__staleWhileFetching:a}async fetch(e,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:a=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:c$1=this.noDisposeOnSet,size:p=0,sizeCalculation:v=this.sizeCalculation,noUpdateTTL:C=this.noUpdateTTL,noDeleteOnFetchRejection:x=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:it=this.allowStaleOnFetchRejection,ignoreFetchAbort:G=this.ignoreFetchAbort,allowStaleOnFetchAbort:u=this.allowStaleOnFetchAbort,context:S,forceRefresh:_=false,status:n,signal:y}=i;if(!c(this,ht))return n&&(n.fetch="get"),this.get(e,{allowStale:s,updateAgeOnGet:r,noDeleteOnStaleGet:a,status:n});let U={allowStale:s,updateAgeOnGet:r,noDeleteOnStaleGet:a,ttl:o,noDisposeOnSet:c$1,size:p,sizeCalculation:v,noUpdateTTL:C,noDeleteOnFetchRejection:x,allowStaleOnFetchRejection:it,allowStaleOnFetchAbort:u,ignoreFetchAbort:G,status:n,signal:y},O=c(this,T).get(e);if(O===void 0){n&&(n.fetch="miss");let w=f$1(this,l,jt).call(this,e,O,U,S);return w.__returned=w}else {let w=c(this,f)[O];if(f$1(this,l,A).call(this,w)){let vt=s&&w.__staleWhileFetching!==void 0;return n&&(n.fetch="inflight",vt&&(n.returnedStale=true)),vt?w.__staleWhileFetching:w.__returned=w}let rt=c(this,k).call(this,O);if(!_&&!rt)return n&&(n.fetch="hit"),f$1(this,l,Et).call(this,O),r&&c(this,dt).call(this,O),n&&c(this,st).call(this,n,O),w;let mt=f$1(this,l,jt).call(this,e,O,U,S),gt=mt.__staleWhileFetching!==void 0&&s;return n&&(n.fetch=rt?"stale":"refresh",gt&&rt&&(n.returnedStale=true)),gt?mt.__staleWhileFetching:mt.__returned=mt}}async forceFetch(e,i={}){let s=await this.fetch(e,i);if(s===void 0)throw new Error("fetch() returned undefined");return s}memo(e,i={}){let s=c(this,St);if(!s)throw new Error("no memoMethod provided to constructor");let{context:r,forceRefresh:a,...o}=i,c$1=this.get(e,o);if(!a&&c$1!==void 0)return c$1;let p=s(e,c$1,{options:o,context:r});return this.set(e,p,o),p}get(e,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:a=this.noDeleteOnStaleGet,status:o}=i,c$1=c(this,T).get(e);if(c$1!==void 0){let p=c(this,f)[c$1],v=f$1(this,l,A).call(this,p);return o&&c(this,st).call(this,o,c$1),c(this,k).call(this,c$1)?(o&&(o.get="stale"),v?(o&&s&&p.__staleWhileFetching!==void 0&&(o.returnedStale=true),s?p.__staleWhileFetching:void 0):(a||f$1(this,l,lt).call(this,e,"expire"),o&&s&&(o.returnedStale=true),s?p:void 0)):(o&&(o.get="hit"),v?p.__staleWhileFetching:(f$1(this,l,Et).call(this,c$1),r&&c(this,dt).call(this,c$1),p))}else o&&(o.get="miss");}delete(e){return f$1(this,l,lt).call(this,e,"delete")}clear(){return f$1(this,l,Mt).call(this,"delete")}},q=new WeakMap,M=new WeakMap,K=new WeakMap,pt=new WeakMap,$=new WeakMap,yt=new WeakMap,St=new WeakMap,B=new WeakMap,D=new WeakMap,X=new WeakMap,T=new WeakMap,E=new WeakMap,f=new WeakMap,L=new WeakMap,V=new WeakMap,R=new WeakMap,F=new WeakMap,Y=new WeakMap,j=new WeakMap,J=new WeakMap,Q=new WeakMap,W=new WeakMap,H=new WeakMap,Z=new WeakMap,ht=new WeakMap,z=new WeakMap,xt=new WeakMap,l=new WeakSet,It=function(){let e$1=new Ct(c(this,q)),i=new Ct(c(this,q));e(this,W,e$1),e(this,Q,i);let s=this.ttlAutopurge?new Array(c(this,q)):void 0;e(this,H,s),e(this,Ut,(c$1,p,v=c(this,B).now())=>{i[c$1]=p!==0?v:0,e$1[c$1]=p,r(c$1,p);}),e(this,dt,c$1=>{i[c$1]=e$1[c$1]!==0?c(this,B).now():0,r(c$1,e$1[c$1]);});let r=this.ttlAutopurge?(c$1,p)=>{if(s?.[c$1]&&(clearTimeout(s[c$1]),s[c$1]=void 0),p&&p!==0&&s){let v=setTimeout(()=>{c(this,k).call(this,c$1)&&f$1(this,l,lt).call(this,c(this,E)[c$1],"expire");},p+1);v.unref&&v.unref(),s[c$1]=v;}}:()=>{};e(this,st,(c,p)=>{if(e$1[p]){let v=e$1[p],C=i[p];if(!v||!C)return;c.ttl=v,c.start=C,c.now=a||o();let x=c.now-C;c.remainingTTL=v-x;}});let a=0,o=()=>{let c$1=c(this,B).now();if(this.ttlResolution>0){a=c$1;let p=setTimeout(()=>a=0,this.ttlResolution);p.unref&&p.unref();}return c$1};this.getRemainingTTL=c$1=>{let p=c(this,T).get(c$1);if(p===void 0)return 0;let v=e$1[p],C=i[p];if(!v||!C)return 1/0;let x=(a||o())-C;return v-x},e(this,k,c=>{let p=i[c],v=e$1[c];return !!v&&!!p&&(a||o())-p>v});},dt=new WeakMap,st=new WeakMap,Ut=new WeakMap,k=new WeakMap,ee=function(){let e$1=new Ct(c(this,q));e(this,X,0),e(this,J,e$1),e(this,ut,i=>{e(this,X,c(this,X)-e$1[i]),e$1[i]=0;}),e(this,Ot,(i,s,r,a)=>{if(f$1(this,l,A).call(this,s))return 0;if(!ot(r))if(a){if(typeof a!="function")throw new TypeError("sizeCalculation must be a function");if(r=a(s,i),!ot(r))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 r}),e(this,wt,(i,s,r)=>{if(e$1[i]=s,c(this,M)){let a=c(this,M)-e$1[i];for(;c(this,X)>a;)f$1(this,l,Ft).call(this,true);}e(this,X,c(this,X)+e$1[i]),r&&(r.entrySize=s,r.totalCalculatedSize=c(this,X));});},ut=new WeakMap,wt=new WeakMap,Ot=new WeakMap,nt=function*({allowStale:e=this.allowStale}={}){if(c(this,D))for(let i=c(this,F);!(!f$1(this,l,Nt).call(this,i)||((e||!c(this,k).call(this,i))&&(yield i),i===c(this,R)));)i=c(this,V)[i];},at=function*({allowStale:e=this.allowStale}={}){if(c(this,D))for(let i=c(this,R);!(!f$1(this,l,Nt).call(this,i)||((e||!c(this,k).call(this,i))&&(yield i),i===c(this,F)));)i=c(this,L)[i];},Nt=function(e){return e!==void 0&&c(this,T).get(c(this,E)[e])===e},Ft=function(e$1){var a;let i=c(this,R),s=c(this,E)[i],r=c(this,f)[i];return c(this,ht)&&f$1(this,l,A).call(this,r)?r.__abortController.abort(new Error("evicted")):(c(this,Z)||c(this,z))&&(c(this,Z)&&((a=c(this,K))==null||a.call(this,r,s,"evict")),c(this,z)&&c(this,j)?.push([r,s,"evict"])),c(this,ut).call(this,i),c(this,H)?.[i]&&(clearTimeout(c(this,H)[i]),c(this,H)[i]=void 0),e$1&&(c(this,E)[i]=void 0,c(this,f)[i]=void 0,c(this,Y).push(i)),c(this,D)===1?(e(this,R,e(this,F,0)),c(this,Y).length=0):e(this,R,c(this,L)[i]),c(this,T).delete(s),g(this,D)._--,i},jt=function(e,i,s,r){let a=i===void 0?void 0:c(this,f)[i];if(f$1(this,l,A).call(this,a))return a;let o=new Pt,{signal:c$1}=s;c$1?.addEventListener("abort",()=>o.abort(c$1.reason),{signal:o.signal});let p={signal:o.signal,options:s,context:r},v=(S,_=false)=>{let{aborted:n}=o.signal,y=s.ignoreFetchAbort&&S!==void 0,U=s.ignoreFetchAbort||!!(s.allowStaleOnFetchAbort&&S!==void 0);if(s.status&&(n&&!_?(s.status.fetchAborted=true,s.status.fetchError=o.signal.reason,y&&(s.status.fetchAbortIgnored=true)):s.status.fetchResolved=true),n&&!y&&!_)return x(o.signal.reason,U);let O=G,w=c(this,f)[i];return (w===G||y&&_&&w===void 0)&&(S===void 0?O.__staleWhileFetching!==void 0?c(this,f)[i]=O.__staleWhileFetching:f$1(this,l,lt).call(this,e,"fetch"):(s.status&&(s.status.fetchUpdated=true),this.set(e,S,p.options))),S},C=S=>(s.status&&(s.status.fetchRejected=true,s.status.fetchError=S),x(S,false)),x=(S,_)=>{let{aborted:n}=o.signal,y=n&&s.allowStaleOnFetchAbort,U=y||s.allowStaleOnFetchRejection,O=U||s.noDeleteOnFetchRejection,w=G;if(c(this,f)[i]===G&&(!O||!_&&w.__staleWhileFetching===void 0?f$1(this,l,lt).call(this,e,"fetch"):y||(c(this,f)[i]=w.__staleWhileFetching)),U)return s.status&&w.__staleWhileFetching!==void 0&&(s.status.returnedStale=true),w.__staleWhileFetching;if(w.__returned===w)throw S},it=(S,_)=>{var y;let n=(y=c(this,yt))==null?void 0:y.call(this,e,a,p);n&&n instanceof Promise&&n.then(U=>S(U===void 0?void 0:U),_),o.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(S(void 0),s.allowStaleOnFetchAbort&&(S=U=>v(U,true)));});};s.status&&(s.status.fetchDispatched=true);let G=new Promise(it).then(v,C),u=Object.assign(G,{__abortController:o,__staleWhileFetching:a,__returned:void 0});return i===void 0?(this.set(e,u,{...p.options,status:void 0}),i=c(this,T).get(e)):c(this,f)[i]=u,u},A=function(e){if(!c(this,ht))return false;let i=e;return !!i&&i instanceof Promise&&i.hasOwnProperty("__staleWhileFetching")&&i.__abortController instanceof Pt},Gt=function(e,i){c(this,V)[i]=e,c(this,L)[e]=i;},Et=function(e$1){e$1!==c(this,F)&&(e$1===c(this,R)?e(this,R,c(this,L)[e$1]):f$1(this,l,Gt).call(this,c(this,V)[e$1],c(this,L)[e$1]),f$1(this,l,Gt).call(this,c(this,F),e$1),e(this,F,e$1));},lt=function(e$1,i){var r,a;let s=false;if(c(this,D)!==0){let o=c(this,T).get(e$1);if(o!==void 0)if(c(this,H)?.[o]&&(clearTimeout(c(this,H)?.[o]),c(this,H)[o]=void 0),s=true,c(this,D)===1)f$1(this,l,Mt).call(this,i);else {c(this,ut).call(this,o);let c$1=c(this,f)[o];if(f$1(this,l,A).call(this,c$1)?c$1.__abortController.abort(new Error("deleted")):(c(this,Z)||c(this,z))&&(c(this,Z)&&((r=c(this,K))==null||r.call(this,c$1,e$1,i)),c(this,z)&&c(this,j)?.push([c$1,e$1,i])),c(this,T).delete(e$1),c(this,E)[o]=void 0,c(this,f)[o]=void 0,o===c(this,F))e(this,F,c(this,V)[o]);else if(o===c(this,R))e(this,R,c(this,L)[o]);else {let p=c(this,V)[o];c(this,L)[p]=c(this,L)[o];let v=c(this,L)[o];c(this,V)[v]=c(this,V)[o];}g(this,D)._--,c(this,Y).push(o);}}if(c(this,z)&&c(this,j)?.length){let o=c(this,j),c$1;for(;c$1=o?.shift();)(a=c(this,$))==null||a.call(this,...c$1);}return s},Mt=function(e$1){var i,s;for(let r of f$1(this,l,at).call(this,{allowStale:true})){let a=c(this,f)[r];if(f$1(this,l,A).call(this,a))a.__abortController.abort(new Error("deleted"));else {let o=c(this,E)[r];c(this,Z)&&((i=c(this,K))==null||i.call(this,a,o,e$1)),c(this,z)&&c(this,j)?.push([a,o,e$1]);}}if(c(this,T).clear(),c(this,f).fill(void 0),c(this,E).fill(void 0),c(this,W)&&c(this,Q)){c(this,W).fill(0),c(this,Q).fill(0);for(let r of c(this,H)??[])r!==void 0&&clearTimeout(r);c(this,H)?.fill(void 0);}if(c(this,J)&&c(this,J).fill(0),e(this,R,0),e(this,F,0),c(this,Y).length=0,e(this,X,0),e(this,D,0),c(this,z)&&c(this,j)){let r=c(this,j),a;for(;a=r?.shift();)(s=c(this,$))==null||s.call(this,...a);}},bt);var Rt=class{constructor(e){b(this,"cache");b(this,"map",new Map);this.cache=new te({max:e.cacheSize}),this.map=new Map;}get[Symbol.iterator](){return this.map[Symbol.iterator]}get[Symbol.toStringTag](){return this.map[Symbol.toStringTag]}clear(){return this.cache.clear(),this.map.clear()}delete(e){let i=this.map.delete(e);return i&&this.cache.delete(e),i}get forEach(){return this.map.forEach}get(e){let i=this.cache.get(e);return i||this.map.get(e)}has(e){return this.map.has(e)}set(e,i){return this.map.set(e,i),this.cache.set(e,i),this}get size(){return this.map.size}entries(){return this.map.entries()}keys(){return this.map.keys()}values(){return this.map.values()}};var Tt="1.5.18";var Vt="repeat";function Wt(g){return {type:"pause",duration:g}}var Ht="__game_layer__";var ie={};var kt={};a(kt,{createExportableElement:()=>se});var At;(r=>(r.log=(a,...o)=>console.log(`[Pixi\u2019VN] ${a}`,...o),r.warn=(a,...o)=>console.warn(`[Pixi\u2019VN] ${a}`,...o),r.error=(a,...o)=>console.error(`[Pixi\u2019VN] ${a}`,...o),r.info=(a,...o)=>console.info(`[Pixi\u2019VN] ${a}`,...o)))(At||(At={}));function se(g){try{if(typeof g>"u")return g;let e=JSON.stringify(g);return JSON.parse(e)}catch(e){throw At.error("Error creating exportable element",g,e),new PixiError("not_json_serializable","Error creating exportable element")}}function re(){console.info(`
2
2
  _______ _ _ _ ____ ____ ____ _____
3
3
  |_ __ \\ (_) (_) | | |_ _| |_ _||_ \\|_ _|
4
4
  | |__) |__ _ __ __ \\_| \\ \\ / / | \\ | |
@@ -6,4 +6,5 @@ import {b,d,a,c,e,f as f$1,g}from'./chunk-TTRUPDAB.mjs';import*as N from'@drincs
6
6
  _| |_ | | > ' < | | \\ ' / _| |_\\ |_
7
7
  |_____| [___][__]\`\\_][___] \\_/ |_____|\\____|
8
8
 
9
- `);}function Kt(){let g=window.location.pathname+window.location.hash;return g.includes("#")&&(g=g.split("#")[1]),g}var qt;(G=>{async function g(d,_,v){if(GameUnifier.init({navigate:_?.navigate,getCurrentGameStepState:()=>{let n={};try{n=N.canvas.export();}catch{}return {path:Kt(),storage:I.storage.export(),canvas:n,sound:ct.sound.export(),labelIndex:j.NarrationManagerStatic.currentLabelStepIndex||0,openedLabels:j.narration.openedLabels}},restoreGameStepState:async(n,y)=>{tt.HistoryManagerStatic._originalStepData=n,j.NarrationManagerStatic.openedLabels=n.openedLabels,I.storage.restore(n.storage);try{await N.canvas.restore(n.canvas);}catch{}ct.sound.restore(n.sound),y(n.path);},getStepCounter:()=>j.narration.stepCounter,setStepCounter:n=>{j.NarrationManagerStatic._stepCounter=n;},getOpenedLabels:()=>j.narration.openedLabels.length,addHistoryItem:(n,y)=>tt.stepHistory.add(n,y),getCharacter:n=>$t.RegisteredCharacters.get(n),processNavigationRequests:(n,y)=>{let U=n,O=Promise.resolve();return n>0?(U--,O=j.narration.continue(y)):n<0&&(U=0,O=tt.stepHistory.back(y,{steps:n*-1})),{newValue:U,result:O}},onPreContinue:async()=>{try{let n=N.CanvasManagerStatic._tickersToCompleteOnStepEnd.tikersIds,y=N.CanvasManagerStatic._tickersToCompleteOnStepEnd.stepAlias,U=(async()=>{for(;n.length;){let{id:x}=n.pop()||{};x&&await N.canvas.forceCompletionOfTicker(x);}})(),O=(async()=>{for(;y.length;){let{alias:x,id:rt}=y.pop()||{};x&&rt&&await N.canvas.forceCompletionOfTicker(rt,x);}})();await Promise.all([U,O]),N.CanvasManagerStatic._tickersToCompleteOnStepEnd={tikersIds:[],stepAlias:[]};}catch{}},getVariable:n=>I.storage.get(n),setVariable:(n,y)=>I.storage.set(n,y),removeVariable:n=>I.storage.remove(n),getFlag:n=>I.storage.getFlag(n),setFlag:(n,y)=>I.storage.setFlag(n,y),onLabelClosing:n=>I.StorageManagerStatic.clearOldTempVariables(n)}),re(),!d||!_){At.warn("The canvas element or options are not defined. The canvas will not be initialized.");return}return await N.canvas.init(d,_,v)}G.init=g;function e(){I.storage.clear();try{N.canvas.clear();}catch{}ct.sound.clear(),j.narration.clear(),tt.stepHistory.clear();}G.clear=e;function i(){let d={};try{d=N.canvas.export();}catch{}return {pixivn_version:Tt,stepData:j.narration.export(),storageData:I.storage.export(),canvasData:d,soundData:ct.sound.export(),historyData:tt.stepHistory.export(),path:Kt()}}G.exportGameState=i;async function s(d,_){d.stepData.hasOwnProperty("stepsHistory")&&d.stepData.stepsHistory&&(d.historyData.stepsHistory=d.stepData.stepsHistory),d.stepData.hasOwnProperty("originalStepData")&&d.stepData.originalStepData&&(d.historyData.originalStepData=d.stepData.originalStepData),tt.stepHistory.restore(d.historyData);let v=tt.stepHistory.lastKey;if(typeof v=="number"){let n=tt.stepHistory.stepsInfoMap.get(v)||null;await j.narration.restore(d.stepData,n);}I.storage.restore(d.storageData);try{await N.canvas.restore(d.canvasData);}catch{}ct.sound.restore(d.soundData),await _(d.path);}G.restoreGameState=s;function o(d){return JSON.parse(d)}G.jsonToGameState=o;function a(d){GameUnifier.onEnd=d;}G.onEnd=a;function r(d){GameUnifier.onError=async(_,v,n)=>d(_,v,n);}G.onError=r;function p(d){j.NarrationManagerStatic.onStepStart=d;}G.onStepStart=p;function u(d){j.NarrationManagerStatic.onLoadingLabel=d;}G.onLoadingLabel=u;function S(d){j.NarrationManagerStatic.onStepEnd=d;}G.onStepEnd=S;function R(d){GameUnifier.navigate=d;}G.onNavigate=R;function b(d){return GameUnifier.addOnPreContinue(d)}G.addOnPreContinue=b;function it(d){return GameUnifier.removeOnPreContinue(d)}G.removeOnPreContinue=it;})(qt||(qt={}));var Re={characterUtils:$t,canvasUtils:N,narrationUtils:j,soundUtils:ct,CANVAS_APP_GAME_LAYER_ALIAS:Ht,Pause:Wt,Repeat:Vt,PIXIVN_VERSION:Tt,...kt,...ie,canvas:N.canvas,narration:j.narration,sound:ct.sound,storage:I.storage,history:tt.stepHistory,Game:qt,GameUnifier:GameUnifier};export{Ht as CANVAS_APP_GAME_LAYER_ALIAS,Rt as CachedMap,qt as Game,Tt as PIXIVN_VERSION,Wt as Pause,Vt as Repeat,se as createExportableElement,Re as default};
9
+ `);}function qt(){let g=window.location.pathname+window.location.hash;return g.includes("#")&&(g=g.split("#")[1]),g}var Kt;(G=>{async function g(u,S,_){if(GameUnifier.init({navigate:S?.navigate,getCurrentGameStepState:()=>{let n={};try{n=I.canvas.export();}catch{}return {path:qt(),storage:N.storage.export(),canvas:n,sound:ct.sound.export(),labelIndex:P.NarrationManagerStatic.currentLabelStepIndex||0,openedLabels:P.narration.openedLabels}},restoreGameStepState:async(n,y)=>{tt.HistoryManagerStatic._originalStepData=n,P.NarrationManagerStatic.openedLabels=n.openedLabels,N.storage.restore(n.storage);try{await I.canvas.restore(n.canvas);}catch{}ct.sound.restore(n.sound),y(n.path);},getStepCounter:()=>P.narration.stepCounter,setStepCounter:n=>{P.NarrationManagerStatic._stepCounter=n;},getOpenedLabels:()=>P.narration.openedLabels.length,addHistoryItem:(n,y)=>tt.stepHistory.add(n,y),getCharacter:n=>$t.RegisteredCharacters.get(n),processNavigationRequests:(n,y)=>{let U=n,O=Promise.resolve();return n>0?(U--,O=P.narration.continue(y)):n<0&&(U=0,O=tt.stepHistory.back(y,{steps:n*-1})),{newValue:U,result:O}},onPreContinue:async()=>{try{let n=I.CanvasManagerStatic._tickersToCompleteOnStepEnd.tikersIds,y=I.CanvasManagerStatic._tickersToCompleteOnStepEnd.stepAlias,U=(async()=>{for(;n.length;){let{id:w}=n.pop()||{};w&&await I.canvas.forceCompletionOfTicker(w);}})(),O=(async()=>{for(;y.length;){let{alias:w,id:rt}=y.pop()||{};w&&rt&&await I.canvas.forceCompletionOfTicker(rt,w);}})();await Promise.all([U,O]),I.CanvasManagerStatic._tickersToCompleteOnStepEnd={tikersIds:[],stepAlias:[]};}catch{}},animate:(n,y,U,O)=>motion.animate(n,y,U,O),getVariable:n=>N.storage.get(n),setVariable:(n,y)=>N.storage.set(n,y),removeVariable:n=>N.storage.remove(n),getFlag:n=>N.storage.getFlag(n),setFlag:(n,y)=>N.storage.setFlag(n,y),onLabelClosing:n=>N.StorageManagerStatic.clearOldTempVariables(n)}),re(),!u||!S){At.warn("The canvas element or options are not defined. The canvas will not be initialized.");return}return await I.canvas.init(u,S,_)}G.init=g;function e(){N.storage.clear();try{I.canvas.clear();}catch{}ct.sound.clear(),P.narration.clear(),tt.stepHistory.clear();}G.clear=e;function i(){let u={};try{u=I.canvas.export();}catch{}return {pixivn_version:Tt,stepData:P.narration.export(),storageData:N.storage.export(),canvasData:u,soundData:ct.sound.export(),historyData:tt.stepHistory.export(),path:qt()}}G.exportGameState=i;async function s(u,S){u.stepData.hasOwnProperty("stepsHistory")&&u.stepData.stepsHistory&&(u.historyData.stepsHistory=u.stepData.stepsHistory),u.stepData.hasOwnProperty("originalStepData")&&u.stepData.originalStepData&&(u.historyData.originalStepData=u.stepData.originalStepData),tt.stepHistory.restore(u.historyData);let _=tt.stepHistory.lastKey;if(typeof _=="number"){let n=tt.stepHistory.stepsInfoMap.get(_)||null;await P.narration.restore(u.stepData,n);}N.storage.restore(u.storageData);try{await I.canvas.restore(u.canvasData);}catch{}ct.sound.restore(u.soundData),await S(u.path);}G.restoreGameState=s;function r(u){return JSON.parse(u)}G.jsonToGameState=r;function a(u){GameUnifier.onEnd=u;}G.onEnd=a;function o(u){GameUnifier.onError=async(S,_,n)=>u(S,_,n);}G.onError=o;function c(u){P.NarrationManagerStatic.onStepStart=u;}G.onStepStart=c;function p(u){P.NarrationManagerStatic.onLoadingLabel=u;}G.onLoadingLabel=p;function v(u){P.NarrationManagerStatic.onStepEnd=u;}G.onStepEnd=v;function C(u){GameUnifier.navigate=u;}G.onNavigate=C;function x(u){return GameUnifier.addOnPreContinue(u)}G.addOnPreContinue=x;function it(u){return GameUnifier.removeOnPreContinue(u)}G.removeOnPreContinue=it;})(Kt||(Kt={}));var Ne={characterUtils:$t,canvasUtils:I,narrationUtils:P,soundUtils:ct,CANVAS_APP_GAME_LAYER_ALIAS:Ht,Pause:Wt,Repeat:Vt,PIXIVN_VERSION:Tt,...kt,...ie,canvas:I.canvas,narration:P.narration,sound:ct.sound,storage:N.storage,history:tt.stepHistory,Game:Kt,GameUnifier:GameUnifier};export{Ht as CANVAS_APP_GAME_LAYER_ALIAS,Rt as CachedMap,Kt as Game,Tt as PIXIVN_VERSION,Wt as Pause,Vt as Repeat,se as createExportableElement,Ne as default};//# sourceMappingURL=index.mjs.map
10
+ //# sourceMappingURL=index.mjs.map