@drincs/pixi-vn 1.8.4 → 1.8.5
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/dist/ContainerMemory-BjcfYRU7.d.cts +392 -0
- package/dist/ContainerMemory-BjcfYRU7.d.ts +392 -0
- package/dist/HistoryChoiceMenuOption-CEmjDDJH.d.cts +53 -0
- package/dist/HistoryChoiceMenuOption-CN7NkcxU.d.ts +53 -0
- package/dist/HistoryGameState-3ztYdv84.d.cts +12 -0
- package/dist/HistoryGameState-D4t2fY9x.d.ts +12 -0
- package/dist/HistoryStep-DtOryKAZ.d.cts +76 -0
- package/dist/HistoryStep-DtOryKAZ.d.ts +76 -0
- package/dist/OpenedLabel-DJby8qPc.d.ts +8 -0
- package/dist/OpenedLabel-t6PvSzaL.d.cts +8 -0
- package/dist/SoundManagerInterface-TgOPqm2L.d.cts +436 -0
- package/dist/SoundManagerInterface-TgOPqm2L.d.ts +436 -0
- package/dist/StepLabelType-CN97wZzm.d.cts +27 -0
- package/dist/StepLabelType-CN97wZzm.d.ts +27 -0
- package/dist/StorageGameState-BJy57o6K.d.ts +27 -0
- package/dist/StorageGameState-CtjNJpvE.d.cts +27 -0
- package/dist/{StoredClassModel-C9mQxPg-.d.cts → StoredClassModel-Bykjdn8S.d.cts} +1 -1
- package/dist/{StoredClassModel-upXPNQTp.d.ts → StoredClassModel-uMifeNzV.d.ts} +1 -1
- package/dist/canvas.cjs +2 -2
- package/dist/canvas.d.cts +54 -464
- package/dist/canvas.d.ts +54 -464
- package/dist/canvas.mjs +2 -2
- package/dist/characters.cjs +1 -1
- package/dist/characters.d.cts +5 -5
- package/dist/characters.d.ts +5 -5
- package/dist/characters.mjs +1 -1
- package/dist/chunk-3GXLF557.mjs +1 -0
- package/dist/chunk-F3AVLCQB.mjs +1 -0
- package/dist/{chunk-YCWXA3OR.mjs → chunk-PZ55RNCZ.mjs} +1 -1
- package/dist/chunk-UK6MT3QS.mjs +1 -0
- package/dist/core.cjs +1 -1
- package/dist/core.d.cts +5 -114
- package/dist/core.d.ts +5 -114
- package/dist/core.mjs +1 -1
- package/dist/history.cjs +1 -1
- package/dist/history.d.cts +7 -11
- package/dist/history.d.ts +7 -11
- package/dist/history.mjs +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +20 -826
- package/dist/index.d.ts +20 -826
- package/dist/index.mjs +2 -2
- package/dist/motion.cjs +1 -1
- package/dist/motion.mjs +1 -1
- package/dist/narration.cjs +2 -2
- package/dist/narration.d.cts +57 -22
- package/dist/narration.d.ts +57 -22
- package/dist/narration.mjs +2 -2
- package/dist/pixi/index.d.cts +12 -0
- package/dist/sound.cjs +1 -1
- package/dist/sound.d.cts +4 -435
- package/dist/sound.d.ts +4 -435
- package/dist/sound.mjs +1 -1
- package/dist/storage.cjs +1 -1
- package/dist/storage.d.cts +4 -27
- package/dist/storage.d.ts +4 -27
- package/dist/storage.mjs +1 -1
- package/dist/vite-listener.d.cts +1 -1
- package/dist/vite-listener.d.ts +1 -1
- package/dist/vite-listener.mjs +1 -1
- package/dist/vite.d.cts +1 -1
- package/dist/vite.d.ts +1 -1
- package/dist/vite.mjs +1 -1
- package/package.json +1 -1
- package/dist/HistoryChoiceMenuOption-CS41KG13.d.ts +0 -182
- package/dist/HistoryChoiceMenuOption-DdwePsOm.d.cts +0 -182
- package/dist/chunk-K7JIC2F2.mjs +0 -1
- package/dist/chunk-V34PMA2H.mjs +0 -1
- package/dist/chunk-Z4GZCINS.mjs +0 -1
package/dist/core.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var a;(o=>(o.log=(r,...s)=>console.log(`[Pixi\u2019VN] ${r}`,...s),o.warn=(r,...s)=>console.warn(`[Pixi\u2019VN] ${r}`,...s),o.error=(r,...s)=>console.error(`[Pixi\u2019VN] ${r}`,...s),o.info=(r,...s)=>console.info(`[Pixi\u2019VN] ${r}`,...s)))(a||={});var n=class extends Error{code;constructor(t,i,m,o,r){super(`[Pixi\u2019VN] ${i}`),this.code=t,m==="canvas"&&(this.canvasElementInfo=o,this.parent=r);}canvasElementInfo;parent};var l=class e{static init(t){t.navigate&&(e._navigate=t.navigate),e._getStepCounter=t.getStepCounter,e._setStepCounter=t.setStepCounter,e._getCurrentGameStepState=t.getCurrentGameStepState,e._restoreGameStepState=t.restoreGameStepState,e._getOpenedLabels=t.getOpenedLabels,e._processNavigationRequests=t.processNavigationRequests,e._getVariable=t.getVariable,e._setVariable=t.setVariable,e._removeVariable=t.removeVariable,e._getFlag=t.getFlag,e._setFlag=t.setFlag,t.onLabelClosing&&(e._onLabelClosing=t.onLabelClosing),e._addHistoryItem=t.addHistoryItem,e._getCharacter=t.getCharacter,e._animate=t.animate;}static _navigate=()=>{a.warn("Navigate function not initialized. You should add the navigate function in the Game.init() method.");};static get navigate(){return e._navigate}static set navigate(t){e._navigate=t;}static _getStepCounter=()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static _setStepCounter=()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get stepCounter(){return e._getStepCounter()}static set stepCounter(t){e._setStepCounter(t);}static _getCurrentGameStepState=()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get currentGameStepState(){return e._getCurrentGameStepState()}static _restoreGameStepState=()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get restoreGameStepState(){return e._restoreGameStepState}static _getOpenedLabels=()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get openedLabels(){return e._getOpenedLabels()}static _onPreContinueHandlers=[];static addOnPreContinue(t){e._onPreContinueHandlers.push(t);}static removeOnPreContinue(t){e._onPreContinueHandlers=e._onPreContinueHandlers.filter(i=>i!==t);}static clearOnPreContinueHandlers(){e._onPreContinueHandlers=[];}static async runOnPreContinue(){let t=e._onPreContinueHandlers.slice();await Promise.all(t.map(i=>i()));}static get onPreContinue(){return e.runOnPreContinue}static navigationRequestsCount=0;static processNavigationLock=Promise.resolve();static get continueRequestsCount(){return e.navigationRequestsCount}static increaseContinueRequest(t=1){e.navigationRequestsCount+=t;}static get backRequestsCount(){return -1*e.navigationRequestsCount}static increaseBackRequest(t=1){e.navigationRequestsCount-=t;}static _processNavigationRequests=()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static async processNavigationRequests(t){let i=e._processNavigationRequests(e.navigationRequestsCount,t);return e.navigationRequestsCount=i.newValue,await i.result}static _getVariable=()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get getVariable(){return e._getVariable}static _setVariable=()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get setVariable(){return e._setVariable}static _removeVariable=()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get removeVariable(){return e._removeVariable}static _getFlag=()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get getFlag(){return e._getFlag}static _setFlag=()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get setFlag(){return e._setFlag}static _onLabelClosing=()=>{};static get onLabelClosing(){return e._onLabelClosing}static _addHistoryItem=()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get addHistoryItem(){return e._addHistoryItem}static runningStepsCount=0;static _getCharacter=()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented.")};static get getCharacter(){return e._getCharacter}static onEnd;static _onErrorHandlers=[];static addOnError(t){return e._onErrorHandlers.push(t),()=>e.removeOnError(t)}static removeOnError(t){e._onErrorHandlers=e._onErrorHandlers.filter(i=>i!==t);}static clearOnErrorHandlers(){e._onErrorHandlers.length=0;}static async runOnError(t,i){for(let m of e._onErrorHandlers.slice())try{await m(t,i);}catch(o){a.error("Error in onError handler",o);}}static _animate=()=>{throw a.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get animate(){return e._animate}};export{l as GameUnifier,n as PixiError};
|
package/dist/history.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var core=require('@drincs/pixi-vn/core');var Xt=Object.defineProperty;var jt=c=>{throw TypeError(c)};var Qt=(c,t,i)=>t in c?Xt(c,t,{enumerable:true,configurable:true,writable:true,value:i}):c[t]=i;var v=(c,t,i)=>Qt(c,typeof t!="symbol"?t+"":t,i),Nt=(c,t,i)=>t.has(c)||jt("Cannot "+i);var e=(c,t,i)=>(Nt(c,t,"read from private field"),i?i.call(c):t.get(c)),b=(c,t,i)=>t.has(c)?jt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(c):t.set(c,i),u=(c,t,i,s)=>(Nt(c,t,"write to private field"),t.set(c,i),i),f=(c,t,i)=>(Nt(c,t,"access private method"),i);var Tt=(c,t,i,s)=>({set _(r){u(c,t,r);},get _(){return e(c,t,s)}});var Zt=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Pt=new Set,Rt=typeof process=="object"&&process?process:{},$t=(c,t,i,s)=>{typeof Rt.emitWarning=="function"?Rt.emitWarning(c,t,i,s):console.error(`[${i}] ${t}: ${c}`);},zt=globalThis.AbortController,Vt=globalThis.AbortSignal;if(typeof zt>"u"){Vt=class{constructor(){v(this,"onabort");v(this,"_onabort",[]);v(this,"reason");v(this,"aborted",false);}addEventListener(i,s){this._onabort.push(s);}},zt=class{constructor(){v(this,"signal",new Vt);t();}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 c=Rt.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",t=()=>{c&&(c=false,$t("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));};}var te=c=>!Pt.has(c);var ot=c=>c&&c===Math.floor(c)&&c>0&&isFinite(c),Bt=c=>ot(c)?c<=Math.pow(2,8)?Uint8Array:c<=Math.pow(2,16)?Uint16Array:c<=Math.pow(2,32)?Uint32Array:c<=Number.MAX_SAFE_INTEGER?Ft:null:null,Ft=class extends Array{constructor(c){super(c),this.fill(0);}},et,mt,ee=(et=class{constructor(t,i){v(this,"heap");v(this,"length");if(!e(et,mt))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new i(t),this.length=0;}static create(t){let i=Bt(t);if(!i)return [];u(et,mt,true);let s=new et(t,i);return u(et,mt,false),s}push(t){this.heap[this.length++]=t;}pop(){return this.heap[--this.length]}},mt=new WeakMap,b(et,mt,false),et),Ut,Kt,P,k,$,ft,B,St,bt,q,F,J,T,H,y,N,W,z,C,Y,D,X,Q,j,V,Z,lt,R,vt,l,Lt,ut,rt,At,U,Jt,pt,wt,Et,nt,at,Mt,Ct,Dt,x,kt,Ht,ht,Wt,_t,qt=(_t=class{constructor(t){b(this,l);b(this,P);b(this,k);b(this,$);b(this,ft);b(this,B);b(this,St);b(this,bt);b(this,q);v(this,"ttl");v(this,"ttlResolution");v(this,"ttlAutopurge");v(this,"updateAgeOnGet");v(this,"updateAgeOnHas");v(this,"allowStale");v(this,"noDisposeOnSet");v(this,"noUpdateTTL");v(this,"maxEntrySize");v(this,"sizeCalculation");v(this,"noDeleteOnFetchRejection");v(this,"noDeleteOnStaleGet");v(this,"allowStaleOnFetchAbort");v(this,"allowStaleOnFetchRejection");v(this,"ignoreFetchAbort");b(this,F);b(this,J);b(this,T);b(this,H);b(this,y);b(this,N);b(this,W);b(this,z);b(this,C);b(this,Y);b(this,D);b(this,X);b(this,Q);b(this,j);b(this,V);b(this,Z);b(this,lt);b(this,R);b(this,vt);b(this,ut,()=>{});b(this,rt,()=>{});b(this,At,()=>{});b(this,U,()=>false);b(this,pt,t=>{});b(this,wt,(t,i,s)=>{});b(this,Et,(t,i,s,r)=>{if(s||r)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});v(this,Ut,"LRUCache");let{max:i=0,ttl:s,ttlResolution:r=1,ttlAutopurge:o,updateAgeOnGet:n,updateAgeOnHas:a,allowStale:h,dispose:d,onInsert:g,disposeAfter:m,noDisposeOnSet:w,noUpdateTTL:K,maxSize:tt=0,maxEntrySize:A=0,sizeCalculation:_,fetchMethod:S,memoMethod:I,noDeleteOnFetchRejection:L,noDeleteOnStaleGet:G,allowStaleOnFetchRejection:E,allowStaleOnFetchAbort:xt,ignoreFetchAbort:dt,perf:yt}=t;if(yt!==void 0&&typeof yt?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(u(this,q,yt??Zt),i!==0&&!ot(i))throw new TypeError("max option must be a nonnegative integer");let gt=i?Bt(i):Array;if(!gt)throw new Error("invalid max value: "+i);if(u(this,P,i),u(this,k,tt),this.maxEntrySize=A||e(this,k),this.sizeCalculation=_,this.sizeCalculation){if(!e(this,k)&&!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(I!==void 0&&typeof I!="function")throw new TypeError("memoMethod must be a function if defined");if(u(this,bt,I),S!==void 0&&typeof S!="function")throw new TypeError("fetchMethod must be a function if specified");if(u(this,St,S),u(this,lt,!!S),u(this,T,new Map),u(this,H,new Array(i).fill(void 0)),u(this,y,new Array(i).fill(void 0)),u(this,N,new gt(i)),u(this,W,new gt(i)),u(this,z,0),u(this,C,0),u(this,Y,ee.create(i)),u(this,F,0),u(this,J,0),typeof d=="function"&&u(this,$,d),typeof g=="function"&&u(this,ft,g),typeof m=="function"?(u(this,B,m),u(this,D,[])):(u(this,B,void 0),u(this,D,void 0)),u(this,Z,!!e(this,$)),u(this,vt,!!e(this,ft)),u(this,R,!!e(this,B)),this.noDisposeOnSet=!!w,this.noUpdateTTL=!!K,this.noDeleteOnFetchRejection=!!L,this.allowStaleOnFetchRejection=!!E,this.allowStaleOnFetchAbort=!!xt,this.ignoreFetchAbort=!!dt,this.maxEntrySize!==0){if(e(this,k)!==0&&!ot(e(this,k)))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(this,l,Jt).call(this);}if(this.allowStale=!!h,this.noDeleteOnStaleGet=!!G,this.updateAgeOnGet=!!n,this.updateAgeOnHas=!!a,this.ttlResolution=ot(r)||r===0?r:1,this.ttlAutopurge=!!o,this.ttl=s||0,this.ttl){if(!ot(this.ttl))throw new TypeError("ttl must be a positive integer if specified");f(this,l,Lt).call(this);}if(e(this,P)===0&&this.ttl===0&&e(this,k)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!e(this,P)&&!e(this,k)){let Gt="LRU_CACHE_UNBOUNDED";te(Gt)&&(Pt.add(Gt),$t("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",Gt,_t));}}get perf(){return e(this,q)}static unsafeExposeInternals(t){return {starts:e(t,Q),ttls:e(t,j),autopurgeTimers:e(t,V),sizes:e(t,X),keyMap:e(t,T),keyList:e(t,H),valList:e(t,y),next:e(t,N),prev:e(t,W),get head(){return e(t,z)},get tail(){return e(t,C)},free:e(t,Y),isBackgroundFetch:i=>{var s;return f(s=t,l,x).call(s,i)},backgroundFetch:(i,s,r,o)=>{var n;return f(n=t,l,Dt).call(n,i,s,r,o)},moveToTail:i=>{var s;return f(s=t,l,Ht).call(s,i)},indexes:i=>{var s;return f(s=t,l,nt).call(s,i)},rindexes:i=>{var s;return f(s=t,l,at).call(s,i)},isStale:i=>{var s;return e(s=t,U).call(s,i)}}}get max(){return e(this,P)}get maxSize(){return e(this,k)}get calculatedSize(){return e(this,J)}get size(){return e(this,F)}get fetchMethod(){return e(this,St)}get memoMethod(){return e(this,bt)}get dispose(){return e(this,$)}get onInsert(){return e(this,ft)}get disposeAfter(){return e(this,B)}getRemainingTTL(t){return e(this,T).has(t)?1/0:0}*entries(){for(let t of f(this,l,nt).call(this))e(this,y)[t]!==void 0&&e(this,H)[t]!==void 0&&!f(this,l,x).call(this,e(this,y)[t])&&(yield [e(this,H)[t],e(this,y)[t]]);}*rentries(){for(let t of f(this,l,at).call(this))e(this,y)[t]!==void 0&&e(this,H)[t]!==void 0&&!f(this,l,x).call(this,e(this,y)[t])&&(yield [e(this,H)[t],e(this,y)[t]]);}*keys(){for(let t of f(this,l,nt).call(this)){let i=e(this,H)[t];i!==void 0&&!f(this,l,x).call(this,e(this,y)[t])&&(yield i);}}*rkeys(){for(let t of f(this,l,at).call(this)){let i=e(this,H)[t];i!==void 0&&!f(this,l,x).call(this,e(this,y)[t])&&(yield i);}}*values(){for(let t of f(this,l,nt).call(this))e(this,y)[t]!==void 0&&!f(this,l,x).call(this,e(this,y)[t])&&(yield e(this,y)[t]);}*rvalues(){for(let t of f(this,l,at).call(this))e(this,y)[t]!==void 0&&!f(this,l,x).call(this,e(this,y)[t])&&(yield e(this,y)[t]);}[(Kt=Symbol.iterator,Ut=Symbol.toStringTag,Kt)](){return this.entries()}find(t,i={}){for(let s of f(this,l,nt).call(this)){let r=e(this,y)[s],o=f(this,l,x).call(this,r)?r.__staleWhileFetching:r;if(o!==void 0&&t(o,e(this,H)[s],this))return this.get(e(this,H)[s],i)}}forEach(t,i=this){for(let s of f(this,l,nt).call(this)){let r=e(this,y)[s],o=f(this,l,x).call(this,r)?r.__staleWhileFetching:r;o!==void 0&&t.call(i,o,e(this,H)[s],this);}}rforEach(t,i=this){for(let s of f(this,l,at).call(this)){let r=e(this,y)[s],o=f(this,l,x).call(this,r)?r.__staleWhileFetching:r;o!==void 0&&t.call(i,o,e(this,H)[s],this);}}purgeStale(){let t=false;for(let i of f(this,l,at).call(this,{allowStale:true}))e(this,U).call(this,i)&&(f(this,l,ht).call(this,e(this,H)[i],"expire"),t=true);return t}info(t){let i=e(this,T).get(t);if(i===void 0)return;let s=e(this,y)[i],r=f(this,l,x).call(this,s)?s.__staleWhileFetching:s;if(r===void 0)return;let o={value:r};if(e(this,j)&&e(this,Q)){let n=e(this,j)[i],a=e(this,Q)[i];if(n&&a){let h=n-(e(this,q).now()-a);o.ttl=h,o.start=Date.now();}}return e(this,X)&&(o.size=e(this,X)[i]),o}dump(){let t=[];for(let i of f(this,l,nt).call(this,{allowStale:true})){let s=e(this,H)[i],r=e(this,y)[i],o=f(this,l,x).call(this,r)?r.__staleWhileFetching:r;if(o===void 0||s===void 0)continue;let n={value:o};if(e(this,j)&&e(this,Q)){n.ttl=e(this,j)[i];let a=e(this,q).now()-e(this,Q)[i];n.start=Math.floor(Date.now()-a);}e(this,X)&&(n.size=e(this,X)[i]),t.unshift([s,n]);}return t}load(t){this.clear();for(let[i,s]of t){if(s.start){let r=Date.now()-s.start;s.start=e(this,q).now()-r;}this.set(i,s.value,s);}}set(t,i,s={}){var w,K,tt,A;if(i===void 0)return this.delete(t),this;let{ttl:r=this.ttl,start:o,noDisposeOnSet:n=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:h}=s,{noUpdateTTL:d=this.noUpdateTTL}=s,g=e(this,Et).call(this,t,i,s.size||0,a);if(this.maxEntrySize&&g>this.maxEntrySize)return h&&(h.set="miss",h.maxEntrySizeExceeded=true),f(this,l,ht).call(this,t,"set"),this;let m=e(this,F)===0?void 0:e(this,T).get(t);if(m===void 0)m=e(this,F)===0?e(this,C):e(this,Y).length!==0?e(this,Y).pop():e(this,F)===e(this,P)?f(this,l,Ct).call(this,false):e(this,F),e(this,H)[m]=t,e(this,y)[m]=i,e(this,T).set(t,m),e(this,N)[e(this,C)]=m,e(this,W)[m]=e(this,C),u(this,C,m),Tt(this,F)._++,e(this,wt).call(this,m,g,h),h&&(h.set="add"),d=false,e(this,vt)&&((w=e(this,ft))==null||w.call(this,i,t,"add"));else {f(this,l,Ht).call(this,m);let _=e(this,y)[m];if(i!==_){if(e(this,lt)&&f(this,l,x).call(this,_)){_.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:S}=_;S!==void 0&&!n&&(e(this,Z)&&((K=e(this,$))==null||K.call(this,S,t,"set")),e(this,R)&&e(this,D)?.push([S,t,"set"]));}else n||(e(this,Z)&&((tt=e(this,$))==null||tt.call(this,_,t,"set")),e(this,R)&&e(this,D)?.push([_,t,"set"]));if(e(this,pt).call(this,m),e(this,wt).call(this,m,g,h),e(this,y)[m]=i,h){h.set="replace";let S=_&&f(this,l,x).call(this,_)?_.__staleWhileFetching:_;S!==void 0&&(h.oldValue=S);}}else h&&(h.set="update");e(this,vt)&&this.onInsert?.(i,t,i===_?"update":"replace");}if(r!==0&&!e(this,j)&&f(this,l,Lt).call(this),e(this,j)&&(d||e(this,At).call(this,m,r,o),h&&e(this,rt).call(this,h,m)),!n&&e(this,R)&&e(this,D)){let _=e(this,D),S;for(;S=_?.shift();)(A=e(this,B))==null||A.call(this,...S);}return this}pop(){var t;try{for(;e(this,F);){let i=e(this,y)[e(this,z)];if(f(this,l,Ct).call(this,!0),f(this,l,x).call(this,i)){if(i.__staleWhileFetching)return i.__staleWhileFetching}else if(i!==void 0)return i}}finally{if(e(this,R)&&e(this,D)){let i=e(this,D),s;for(;s=i?.shift();)(t=e(this,B))==null||t.call(this,...s);}}}has(t,i={}){let{updateAgeOnHas:s=this.updateAgeOnHas,status:r}=i,o=e(this,T).get(t);if(o!==void 0){let n=e(this,y)[o];if(f(this,l,x).call(this,n)&&n.__staleWhileFetching===void 0)return false;if(e(this,U).call(this,o))r&&(r.has="stale",e(this,rt).call(this,r,o));else return s&&e(this,ut).call(this,o),r&&(r.has="hit",e(this,rt).call(this,r,o)),true}else r&&(r.has="miss");return false}peek(t,i={}){let{allowStale:s=this.allowStale}=i,r=e(this,T).get(t);if(r===void 0||!s&&e(this,U).call(this,r))return;let o=e(this,y)[r];return f(this,l,x).call(this,o)?o.__staleWhileFetching:o}async fetch(t,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,ttl:n=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:h=0,sizeCalculation:d=this.sizeCalculation,noUpdateTTL:g=this.noUpdateTTL,noDeleteOnFetchRejection:m=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:w=this.allowStaleOnFetchRejection,ignoreFetchAbort:K=this.ignoreFetchAbort,allowStaleOnFetchAbort:tt=this.allowStaleOnFetchAbort,context:A,forceRefresh:_=false,status:S,signal:I}=i;if(!e(this,lt))return S&&(S.fetch="get"),this.get(t,{allowStale:s,updateAgeOnGet:r,noDeleteOnStaleGet:o,status:S});let L={allowStale:s,updateAgeOnGet:r,noDeleteOnStaleGet:o,ttl:n,noDisposeOnSet:a,size:h,sizeCalculation:d,noUpdateTTL:g,noDeleteOnFetchRejection:m,allowStaleOnFetchRejection:w,allowStaleOnFetchAbort:tt,ignoreFetchAbort:K,status:S,signal:I},G=e(this,T).get(t);if(G===void 0){S&&(S.fetch="miss");let E=f(this,l,Dt).call(this,t,G,L,A);return E.__returned=E}else {let E=e(this,y)[G];if(f(this,l,x).call(this,E)){let gt=s&&E.__staleWhileFetching!==void 0;return S&&(S.fetch="inflight",gt&&(S.returnedStale=true)),gt?E.__staleWhileFetching:E.__returned=E}let xt=e(this,U).call(this,G);if(!_&&!xt)return S&&(S.fetch="hit"),f(this,l,Ht).call(this,G),r&&e(this,ut).call(this,G),S&&e(this,rt).call(this,S,G),E;let dt=f(this,l,Dt).call(this,t,G,L,A),yt=dt.__staleWhileFetching!==void 0&&s;return S&&(S.fetch=xt?"stale":"refresh",yt&&xt&&(S.returnedStale=true)),yt?dt.__staleWhileFetching:dt.__returned=dt}}async forceFetch(t,i={}){let s=await this.fetch(t,i);if(s===void 0)throw new Error("fetch() returned undefined");return s}memo(t,i={}){let s=e(this,bt);if(!s)throw new Error("no memoMethod provided to constructor");let{context:r,forceRefresh:o,...n}=i,a=this.get(t,n);if(!o&&a!==void 0)return a;let h=s(t,a,{options:n,context:r});return this.set(t,h,n),h}get(t,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,status:n}=i,a=e(this,T).get(t);if(a!==void 0){let h=e(this,y)[a],d=f(this,l,x).call(this,h);return n&&e(this,rt).call(this,n,a),e(this,U).call(this,a)?(n&&(n.get="stale"),d?(n&&s&&h.__staleWhileFetching!==void 0&&(n.returnedStale=true),s?h.__staleWhileFetching:void 0):(o||f(this,l,ht).call(this,t,"expire"),n&&s&&(n.returnedStale=true),s?h:void 0)):(n&&(n.get="hit"),d?h.__staleWhileFetching:(f(this,l,Ht).call(this,a),r&&e(this,ut).call(this,a),h))}else n&&(n.get="miss");}delete(t){return f(this,l,ht).call(this,t,"delete")}clear(){return f(this,l,Wt).call(this,"delete")}},P=new WeakMap,k=new WeakMap,$=new WeakMap,ft=new WeakMap,B=new WeakMap,St=new WeakMap,bt=new WeakMap,q=new WeakMap,F=new WeakMap,J=new WeakMap,T=new WeakMap,H=new WeakMap,y=new WeakMap,N=new WeakMap,W=new WeakMap,z=new WeakMap,C=new WeakMap,Y=new WeakMap,D=new WeakMap,X=new WeakMap,Q=new WeakMap,j=new WeakMap,V=new WeakMap,Z=new WeakMap,lt=new WeakMap,R=new WeakMap,vt=new WeakMap,l=new WeakSet,Lt=function(){let t=new Ft(e(this,P)),i=new Ft(e(this,P));u(this,j,t),u(this,Q,i);let s=this.ttlAutopurge?new Array(e(this,P)):void 0;u(this,V,s),u(this,At,(a,h,d=e(this,q).now())=>{i[a]=h!==0?d:0,t[a]=h,r(a,h);}),u(this,ut,a=>{i[a]=t[a]!==0?e(this,q).now():0,r(a,t[a]);});let r=this.ttlAutopurge?(a,h)=>{if(s?.[a]&&(clearTimeout(s[a]),s[a]=void 0),h&&h!==0&&s){let d=setTimeout(()=>{e(this,U).call(this,a)&&f(this,l,ht).call(this,e(this,H)[a],"expire");},h+1);d.unref&&d.unref(),s[a]=d;}}:()=>{};u(this,rt,(a,h)=>{if(t[h]){let d=t[h],g=i[h];if(!d||!g)return;a.ttl=d,a.start=g,a.now=o||n();let m=a.now-g;a.remainingTTL=d-m;}});let o=0,n=()=>{let a=e(this,q).now();if(this.ttlResolution>0){o=a;let h=setTimeout(()=>o=0,this.ttlResolution);h.unref&&h.unref();}return a};this.getRemainingTTL=a=>{let h=e(this,T).get(a);if(h===void 0)return 0;let d=t[h],g=i[h];if(!d||!g)return 1/0;let m=(o||n())-g;return d-m},u(this,U,a=>{let h=i[a],d=t[a];return !!d&&!!h&&(o||n())-h>d});},ut=new WeakMap,rt=new WeakMap,At=new WeakMap,U=new WeakMap,Jt=function(){let t=new Ft(e(this,P));u(this,J,0),u(this,X,t),u(this,pt,i=>{u(this,J,e(this,J)-t[i]),t[i]=0;}),u(this,Et,(i,s,r,o)=>{if(f(this,l,x).call(this,s))return 0;if(!ot(r))if(o){if(typeof o!="function")throw new TypeError("sizeCalculation must be a function");if(r=o(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}),u(this,wt,(i,s,r)=>{if(t[i]=s,e(this,k)){let o=e(this,k)-t[i];for(;e(this,J)>o;)f(this,l,Ct).call(this,true);}u(this,J,e(this,J)+t[i]),r&&(r.entrySize=s,r.totalCalculatedSize=e(this,J));});},pt=new WeakMap,wt=new WeakMap,Et=new WeakMap,nt=function*({allowStale:t=this.allowStale}={}){if(e(this,F))for(let i=e(this,C);!(!f(this,l,Mt).call(this,i)||((t||!e(this,U).call(this,i))&&(yield i),i===e(this,z)));)i=e(this,W)[i];},at=function*({allowStale:t=this.allowStale}={}){if(e(this,F))for(let i=e(this,z);!(!f(this,l,Mt).call(this,i)||((t||!e(this,U).call(this,i))&&(yield i),i===e(this,C)));)i=e(this,N)[i];},Mt=function(t){return t!==void 0&&e(this,T).get(e(this,H)[t])===t},Ct=function(t){var o;let i=e(this,z),s=e(this,H)[i],r=e(this,y)[i];return e(this,lt)&&f(this,l,x).call(this,r)?r.__abortController.abort(new Error("evicted")):(e(this,Z)||e(this,R))&&(e(this,Z)&&((o=e(this,$))==null||o.call(this,r,s,"evict")),e(this,R)&&e(this,D)?.push([r,s,"evict"])),e(this,pt).call(this,i),e(this,V)?.[i]&&(clearTimeout(e(this,V)[i]),e(this,V)[i]=void 0),t&&(e(this,H)[i]=void 0,e(this,y)[i]=void 0,e(this,Y).push(i)),e(this,F)===1?(u(this,z,u(this,C,0)),e(this,Y).length=0):u(this,z,e(this,N)[i]),e(this,T).delete(s),Tt(this,F)._--,i},Dt=function(t,i,s,r){let o=i===void 0?void 0:e(this,y)[i];if(f(this,l,x).call(this,o))return o;let n=new zt,{signal:a}=s;a?.addEventListener("abort",()=>n.abort(a.reason),{signal:n.signal});let h={signal:n.signal,options:s,context:r},d=(A,_=false)=>{let{aborted:S}=n.signal,I=s.ignoreFetchAbort&&A!==void 0,L=s.ignoreFetchAbort||!!(s.allowStaleOnFetchAbort&&A!==void 0);if(s.status&&(S&&!_?(s.status.fetchAborted=true,s.status.fetchError=n.signal.reason,I&&(s.status.fetchAbortIgnored=true)):s.status.fetchResolved=true),S&&!I&&!_)return m(n.signal.reason,L);let G=K,E=e(this,y)[i];return (E===K||I&&_&&E===void 0)&&(A===void 0?G.__staleWhileFetching!==void 0?e(this,y)[i]=G.__staleWhileFetching:f(this,l,ht).call(this,t,"fetch"):(s.status&&(s.status.fetchUpdated=true),this.set(t,A,h.options))),A},g=A=>(s.status&&(s.status.fetchRejected=true,s.status.fetchError=A),m(A,false)),m=(A,_)=>{let{aborted:S}=n.signal,I=S&&s.allowStaleOnFetchAbort,L=I||s.allowStaleOnFetchRejection,G=L||s.noDeleteOnFetchRejection,E=K;if(e(this,y)[i]===K&&(!G||!_&&E.__staleWhileFetching===void 0?f(this,l,ht).call(this,t,"fetch"):I||(e(this,y)[i]=E.__staleWhileFetching)),L)return s.status&&E.__staleWhileFetching!==void 0&&(s.status.returnedStale=true),E.__staleWhileFetching;if(E.__returned===E)throw A},w=(A,_)=>{var I;let S=(I=e(this,St))==null?void 0:I.call(this,t,o,h);S&&S instanceof Promise&&S.then(L=>A(L===void 0?void 0:L),_),n.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(A(void 0),s.allowStaleOnFetchAbort&&(A=L=>d(L,true)));});};s.status&&(s.status.fetchDispatched=true);let K=new Promise(w).then(d,g),tt=Object.assign(K,{__abortController:n,__staleWhileFetching:o,__returned:void 0});return i===void 0?(this.set(t,tt,{...h.options,status:void 0}),i=e(this,T).get(t)):e(this,y)[i]=tt,tt},x=function(t){if(!e(this,lt))return false;let i=t;return !!i&&i instanceof Promise&&i.hasOwnProperty("__staleWhileFetching")&&i.__abortController instanceof zt},kt=function(t,i){e(this,W)[i]=t,e(this,N)[t]=i;},Ht=function(t){t!==e(this,C)&&(t===e(this,z)?u(this,z,e(this,N)[t]):f(this,l,kt).call(this,e(this,W)[t],e(this,N)[t]),f(this,l,kt).call(this,e(this,C),t),u(this,C,t));},ht=function(t,i){var r,o;let s=false;if(e(this,F)!==0){let n=e(this,T).get(t);if(n!==void 0)if(e(this,V)?.[n]&&(clearTimeout(e(this,V)?.[n]),e(this,V)[n]=void 0),s=true,e(this,F)===1)f(this,l,Wt).call(this,i);else {e(this,pt).call(this,n);let a=e(this,y)[n];if(f(this,l,x).call(this,a)?a.__abortController.abort(new Error("deleted")):(e(this,Z)||e(this,R))&&(e(this,Z)&&((r=e(this,$))==null||r.call(this,a,t,i)),e(this,R)&&e(this,D)?.push([a,t,i])),e(this,T).delete(t),e(this,H)[n]=void 0,e(this,y)[n]=void 0,n===e(this,C))u(this,C,e(this,W)[n]);else if(n===e(this,z))u(this,z,e(this,N)[n]);else {let h=e(this,W)[n];e(this,N)[h]=e(this,N)[n];let d=e(this,N)[n];e(this,W)[d]=e(this,W)[n];}Tt(this,F)._--,e(this,Y).push(n);}}if(e(this,R)&&e(this,D)?.length){let n=e(this,D),a;for(;a=n?.shift();)(o=e(this,B))==null||o.call(this,...a);}return s},Wt=function(t){var i,s;for(let r of f(this,l,at).call(this,{allowStale:true})){let o=e(this,y)[r];if(f(this,l,x).call(this,o))o.__abortController.abort(new Error("deleted"));else {let n=e(this,H)[r];e(this,Z)&&((i=e(this,$))==null||i.call(this,o,n,t)),e(this,R)&&e(this,D)?.push([o,n,t]);}}if(e(this,T).clear(),e(this,y).fill(void 0),e(this,H).fill(void 0),e(this,j)&&e(this,Q)){e(this,j).fill(0),e(this,Q).fill(0);for(let r of e(this,V)??[])r!==void 0&&clearTimeout(r);e(this,V)?.fill(void 0);}if(e(this,X)&&e(this,X).fill(0),u(this,z,0),u(this,C,0),e(this,Y).length=0,u(this,J,0),u(this,F,0),e(this,R)&&e(this,D)){let r=e(this,D),o;for(;o=r?.shift();)(s=e(this,B))==null||s.call(this,...o);}},_t);var ct=class{constructor(t){v(this,"cache");v(this,"map",new Map);this.cache=new qt({max:t.cacheSize}),this.map=new Map;}get[Symbol.iterator](){return this.map[Symbol.iterator]}get[Symbol.toStringTag](){return this.map[Symbol.toStringTag]}clear(){this.cache.clear(),this.map.clear();}delete(t){let i=this.map.delete(t);return i&&this.cache.delete(t),i}get forEach(){return this.map.forEach}get(t){let i=this.cache.get(t);return i||this.map.get(t)}has(t){return this.map.has(t)}set(t,i){return this.map.set(t,i),this.cache.set(t,i),this}get size(){return this.map.size}entries(){return this.map.entries()}keys(){return this.map.keys()}values(){return this.map.values()}};var O;(r=>(r.log=(o,...n)=>console.log(`[Pixi\u2019VN] ${o}`,...n),r.warn=(o,...n)=>console.warn(`[Pixi\u2019VN] ${o}`,...n),r.error=(o,...n)=>console.error(`[Pixi\u2019VN] ${o}`,...n),r.info=(o,...n)=>console.info(`[Pixi\u2019VN] ${o}`,...n)))(O||(O={}));function it(c){try{if(typeof c>"u")return c;let t=JSON.stringify(c);return JSON.parse(t)}catch(t){throw O.error("Error creating exportable element",c,t),new core.PixiError("not_json_serializable","Error creating exportable element")}}var st=class st{static get originalStepData(){return st._originalStepData?it(st._originalStepData):{path:"",storage:{},canvas:{elementAliasesOrder:[],elements:{},stage:{},tickers:{},tickersSteps:{},tickersOnPause:{},tickersToCompleteOnStepEnd:{tikersIds:[],stepAlias:[]}},sound:{soundAliasesOrder:[],soundsPlaying:{},playInStepIndex:{},filters:void 0},labelIndex:-1,openedLabels:[]}}static set originalStepData(t){st._originalStepData=it(t);}};v(st,"_diffHistory",new ct({cacheSize:5})),v(st,"_stepsInfoHistory",new ct({cacheSize:5})),v(st,"_narrationHistory",new ct({cacheSize:50})),v(st,"stepLimitSaved",20),v(st,"_originalStepData");var p=st;function Yt(c,t){let i=it(c);return t.length>1&&"type"in t[0]&&(t=t.slice().reverse()),t.forEach(s=>{se(i,s);}),i}function se(c,t){let i=c;t.path&&t.path.length>0?t.path.forEach((s,r)=>{if(t.path&&r===t.path.length-1)switch(t.type){case "CHANGE":case "REMOVE":i[s]=t.oldValue;break;case "CREATE":Array.isArray(i)&&typeof s=="number"?i.splice(s,1):delete i[s];break}else i=i[s];}):O.warn("No path found, skipping diff",t);}var re={Date:true,RegExp:true,String:true,Number:true};function It(c,t,i={cyclesFix:true},s=[]){let r=[],o=Array.isArray(c);for(let a in c){let h=c[a],d=o?+a:a;if(!(a in t)){r.push({type:"REMOVE",path:[d],oldValue:c[a]});continue}let g=t[a],m=typeof h=="object"&&typeof g=="object"&&Array.isArray(h)===Array.isArray(g);h&&g&&m&&!re[Object.getPrototypeOf(h)?.constructor?.name]&&(!i.cyclesFix||!s.includes(h))?r.push.apply(r,It(h,g,i,i.cyclesFix?s.concat([h]):[]).map(w=>(w.path.unshift(d),w))):h!==g&&!(Number.isNaN(h)&&Number.isNaN(g))&&!(m&&(isNaN(h)?h+""==g+"":+h==+g))&&r.push({path:[d],type:"CHANGE",value:g,oldValue:h});}let n=Array.isArray(t);for(let a in t)a in c||r.push({type:"CREATE",path:[n?+a:a],value:t[a]});return r}var Ot=class{get stepsInfoMap(){return p._stepsInfoHistory}get diffMap(){return p._diffHistory}get narrationMap(){return p._narrationHistory}get size(){return p._stepsInfoHistory.size}get lastKey(){return this.size===0?null:Math.max(...Array.from(this.keys()))}keys(){return p._stepsInfoHistory.keys()}get(t){let i=p._narrationHistory.get(t);if(!(i&&Object.keys(i).length===1&&i.stepIndex!==void 0))return i}delete(t){p._stepsInfoHistory.delete(t),p._diffHistory.delete(t),p._narrationHistory.delete(t);}getOldGameState(t,i){if(t<=0||this.size===0)return i;let s=this.lastKey;if(typeof s!="number")return O.warn("You can't go back, there is no step to go back"),i;let r=p._diffHistory.get(s);if(r)try{let o=Yt(i,r);return core.GameUnifier.stepCounter=s,this.delete(s),this.getOldGameState(t-1,o)}catch(o){return O.error("Error applying diff",o),i}else return O.warn("No diff found for the last step, cannot go back"),i}async back(t,i={}){let{steps:s=1}=i;if(!Number.isFinite(s)){O.warn(`[back] The parameter steps must be a valid finite number, received: ${s}`);return}if(s<=0){O.warn(`[back] The parameter steps must be greater than 0, received: ${s}`);return}if(core.GameUnifier.runningStepsCount>0){core.GameUnifier.increaseBackRequest(s);return}if(p._diffHistory.size<1){O.warn("You can't go back, there is no step to go back");return}core.GameUnifier.runningStepsCount++;try{let r=it(this.getOldGameState(s,p.originalStepData));if(r){await core.GameUnifier.restoreGameStepState(r,core.GameUnifier.navigate);let o=core.GameUnifier.stepCounter-1,n=p._narrationHistory.get(o);if(n&&Object.keys(n).length===1&&n.stepIndex!==void 0){let a=p._stepsInfoHistory.get(o);if(a){let h=this.itemMapper({step:a});p._narrationHistory.set(a.index,h);}}}else O.error("Error going back");p.originalStepData=r;}catch(r){O.error("Error going back",r);}if(core.GameUnifier.runningStepsCount--,core.GameUnifier.runningStepsCount===0&&core.GameUnifier.backRequestsCount!==0)return await core.GameUnifier.processNavigationRequests(t)}add(t,i={}){let s=p.originalStepData,{ignoreSameStep:r}=i,o=core.GameUnifier.currentGameStepState;if(!r&&this.isSameStep(s,o))return;let n=this.lastKey;(async()=>{try{let h,d;if(typeof n=="number"&&(h=p._stepsInfoHistory.get(n),d=p._narrationHistory.get(n)),p._stepsInfoHistory.set(t.index,t),t.index!==0){let w=It(s,o);w?p._diffHistory.set(t.index,w):O.warn("It was not possible to create the difference between the two steps");}let g={},m=this.itemMapper({step:t},g);if(p._narrationHistory.set(t.index,m),h&&d&&typeof n=="number"){let w=this.itemMapper({...g,step:h},{});p._narrationHistory.set(n,w);}}catch(h){O.error("Error adding history step",h);}})(),p.originalStepData=o;}itemMapper(t,i){let{step:s,choiceIndexMade:r,inputValue:o,removeDialogue:n}=t,a=s.dialogue;i&&s.isGlued&&(i.removeDialogue=true),n&&(a=void 0);let h=s.choices;if(i&&s.currentLabel&&s.choiceIndexMade!==void 0&&(i.choiceIndexMade=s.choiceIndexMade),s.inputValue&&i&&(i.inputValue=s.inputValue),a||h||o){let d=h?.map((g,m)=>{let w=false;return g.oneTime&&s.alreadyMadeChoices?.includes(m)&&(w=true),{text:g.text,type:g.type,isResponse:false,hidden:w}});if(d){if(d.every(g=>g.hidden)){let g=d.find(m=>m.hidden===false);g&&(g.hidden=false);}r!==void 0&&(d[r].isResponse=true);}return {dialogue:a?{...a,character:a.character?core.GameUnifier.getCharacter(a.character)||a.character:void 0}:void 0,playerMadeChoice:typeof r=="number",choices:d,stepIndex:s.index,inputValue:o}}return {stepIndex:s.index}}get narrativeHistory(){let t=[];return Array.from(this.keys()).sort((s,r)=>s-r).forEach(s=>{let r=this.get(s);r&&t.push(r);}),t}get currentLabelHistory(){let t=[],i=Array.from(this.keys()).sort((h,d)=>d-h);if(i.length===0)return t;let s=i[0];if(typeof s!="number")return t;let r=p._stepsInfoHistory.get(s);if(!r)return t;let o=r.openedLabels;if(!o||!Array.isArray(o)||o.length===0)return t;let n=o[0].currentStepIndex,a=o[0].label;return i.every((h,d)=>{let g=this.get(h);if(g){if(d===0)return t.push(g),true;let m=p._stepsInfoHistory.get(h);if(!m)return true;let w=m.openedLabels;if(!w||!Array.isArray(w)||w.length===0||w[0].label!==a||w[0].currentStepIndex>=n)return false;n=w[0].currentStepIndex,t.push(g);}return true}),t.reverse()}removeNarrativeHistory(t){if(t){let i=Array.from(this.keys()).sort((s,r)=>s-r);i=i.slice(0,t),i.forEach(s=>{p._narrationHistory.delete(s),p._stepsInfoHistory.delete(s),p._diffHistory.delete(s);});}else p._stepsInfoHistory.clear(),p._diffHistory.clear(),p._narrationHistory.clear();}get canGoBack(){let t=this.lastKey;return typeof t!="number"?false:p._diffHistory.has(t)}blockGoBack(){core.GameUnifier.runningStepsCount===0&&p._diffHistory.clear();}isSameStep(t,i){if(t.openedLabels.length===i.openedLabels.length)try{let s=JSON.stringify(t.openedLabels),r=JSON.stringify(i.openedLabels);if(s===r&&t.path===i.path&&t.labelIndex===i.labelIndex)return !0}catch(s){return O.error("Error comparing opened labels",s),true}return false}clear(){p._stepsInfoHistory.clear(),p._diffHistory.clear(),p._narrationHistory.clear(),p._originalStepData=void 0;}get stepLimitSaved(){return p.stepLimitSaved}set stepLimitSaved(t){p.stepLimitSaved=t;}export(){let t=Array.from(this.keys()).sort((s,r)=>s-r);t.length>this.stepLimitSaved&&(t=t.slice(t.length-this.stepLimitSaved));let i=[];return t.forEach(s=>{let r=p._stepsInfoHistory.get(s);if(r){let o=p._diffHistory.get(s);i.push({...r,diff:o});}}),{stepsHistory:it(i),originalStepData:it(p._originalStepData)}}restoreNarrativeHistory(){let t=Array.from(this.keys()).sort((s,r)=>s-r),i={};t.forEach(s=>{let r=p._stepsInfoHistory.get(s);if(r){let o={...i};i={};let n=this.itemMapper({step:r,choiceIndexMade:o.choiceIndexMade,inputValue:o.inputValue,removeDialogue:o.removeDialogue},i);n&&p._narrationHistory.set(s,n);}});}async restore(t){this.clear();try{Object.hasOwn(t,"stepsHistory")?(t.stepsHistory.forEach(s=>{s.diff&&p._diffHistory.set(s.index,s.diff);let r={...s,diff:void 0};p._stepsInfoHistory.set(s.index,r);}),this.restoreNarrativeHistory()):O.warn("Could not import stepsHistory data, so will be ignored"),Object.hasOwn(t,"originalStepData")?p._originalStepData=t.originalStepData:O.warn("Could not import originalStepData data, so will be ignored");}catch(i){O.error("Error importing data",i);}}};var Me=new Ot;exports.HistoryManagerStatic=p;exports.stepHistory=Me;
|
|
1
|
+
'use strict';var core=require('@drincs/pixi-vn/core');var $=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,W=new Set,L=typeof process=="object"&&process?process:{},j=(c,t,e,i)=>{typeof L.emitWarning=="function"?L.emitWarning(c,t,e,i):console.error(`[${e}] ${t}: ${c}`);},G=globalThis.AbortController,k=globalThis.AbortSignal;if(typeof G>"u"){k=class{onabort;_onabort=[];reason;aborted=false;addEventListener(e,i){this._onabort.push(i);}},G=class{constructor(){t();}signal=new k;abort(e){if(!this.signal.aborted){this.signal.reason=e,this.signal.aborted=true;for(let i of this.signal._onabort)i(e);this.signal.onabort?.(e);}}};let c=L.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",t=()=>{c&&(c=false,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));};}var B=c=>!W.has(c);var A=c=>c&&c===Math.floor(c)&&c>0&&isFinite(c),V=c=>A(c)?c<=Math.pow(2,8)?Uint8Array:c<=Math.pow(2,16)?Uint16Array:c<=Math.pow(2,32)?Uint32Array:c<=Number.MAX_SAFE_INTEGER?M:null:null,M=class extends Array{constructor(c){super(c),this.fill(0);}},q=class z{heap;length;static#a=false;static create(t){let e=V(t);if(!e)return [];z.#a=true;let i=new z(t,e);return z.#a=false,i}constructor(t,e){if(!z.#a)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]}},U=class K{#a;#f;#g;#F;#m;#I;#M;#S;get perf(){return this.#S}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#r;#b;#s;#i;#t;#l;#u;#h;#o;#v;#n;#w;#_;#p;#d;#x;#T;#c;#G;static unsafeExposeInternals(t){return {starts:t.#_,ttls:t.#p,autopurgeTimers:t.#d,sizes:t.#w,keyMap:t.#s,keyList:t.#i,valList:t.#t,next:t.#l,prev:t.#u,get head(){return t.#h},get tail(){return t.#o},free:t.#v,isBackgroundFetch:e=>t.#e(e),backgroundFetch:(e,i,s,r)=>t.#L(e,i,s,r),moveToTail:e=>t.#z(e),indexes:e=>t.#H(e),rindexes:e=>t.#A(e),isStale:e=>t.#y(e)}}get max(){return this.#a}get maxSize(){return this.#f}get calculatedSize(){return this.#b}get size(){return this.#r}get fetchMethod(){return this.#I}get memoMethod(){return this.#M}get dispose(){return this.#g}get onInsert(){return this.#F}get disposeAfter(){return this.#m}constructor(t){let{max:e=0,ttl:i,ttlResolution:s=1,ttlAutopurge:r,updateAgeOnGet:a,updateAgeOnHas:n,allowStale:o,dispose:l,onInsert:f,disposeAfter:u,noDisposeOnSet:p,noUpdateTTL:m,maxSize:O=0,maxEntrySize:S=0,sizeCalculation:_,fetchMethod:d,memoMethod:b,noDeleteOnFetchRejection:H,noDeleteOnStaleGet:v,allowStaleOnFetchRejection:y,allowStaleOnFetchAbort:D,ignoreFetchAbort:T,perf:F}=t;if(F!==void 0&&typeof F?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#S=F??$,e!==0&&!A(e))throw new TypeError("max option must be a nonnegative integer");let C=e?V(e):Array;if(!C)throw new Error("invalid max value: "+e);if(this.#a=e,this.#f=O,this.maxEntrySize=S||this.#f,this.sizeCalculation=_,this.sizeCalculation){if(!this.#f&&!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(b!==void 0&&typeof b!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#M=b,d!==void 0&&typeof d!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#I=d,this.#T=!!d,this.#s=new Map,this.#i=new Array(e).fill(void 0),this.#t=new Array(e).fill(void 0),this.#l=new C(e),this.#u=new C(e),this.#h=0,this.#o=0,this.#v=q.create(e),this.#r=0,this.#b=0,typeof l=="function"&&(this.#g=l),typeof f=="function"&&(this.#F=f),typeof u=="function"?(this.#m=u,this.#n=[]):(this.#m=void 0,this.#n=void 0),this.#x=!!this.#g,this.#G=!!this.#F,this.#c=!!this.#m,this.noDisposeOnSet=!!p,this.noUpdateTTL=!!m,this.noDeleteOnFetchRejection=!!H,this.allowStaleOnFetchRejection=!!y,this.allowStaleOnFetchAbort=!!D,this.ignoreFetchAbort=!!T,this.maxEntrySize!==0){if(this.#f!==0&&!A(this.#f))throw new TypeError("maxSize must be a positive integer if specified");if(!A(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#P();}if(this.allowStale=!!o,this.noDeleteOnStaleGet=!!v,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!n,this.ttlResolution=A(s)||s===0?s:1,this.ttlAutopurge=!!r,this.ttl=i||0,this.ttl){if(!A(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#k();}if(this.#a===0&&this.ttl===0&&this.#f===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#a&&!this.#f){let R="LRU_CACHE_UNBOUNDED";B(R)&&(W.add(R),j("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",R,K));}}getRemainingTTL(t){return this.#s.has(t)?1/0:0}#k(){let t=new M(this.#a),e=new M(this.#a);this.#p=t,this.#_=e;let i=this.ttlAutopurge?new Array(this.#a):void 0;this.#d=i,this.#W=(n,o,l=this.#S.now())=>{e[n]=o!==0?l:0,t[n]=o,s(n,o);},this.#C=n=>{e[n]=t[n]!==0?this.#S.now():0,s(n,t[n]);};let s=this.ttlAutopurge?(n,o)=>{if(i?.[n]&&(clearTimeout(i[n]),i[n]=void 0),o&&o!==0&&i){let l=setTimeout(()=>{this.#y(n)&&this.#E(this.#i[n],"expire");},o+1);l.unref&&l.unref(),i[n]=l;}}:()=>{};this.#O=(n,o)=>{if(t[o]){let l=t[o],f=e[o];if(!l||!f)return;n.ttl=l,n.start=f,n.now=r||a();let u=n.now-f;n.remainingTTL=l-u;}};let r=0,a=()=>{let n=this.#S.now();if(this.ttlResolution>0){r=n;let o=setTimeout(()=>r=0,this.ttlResolution);o.unref&&o.unref();}return n};this.getRemainingTTL=n=>{let o=this.#s.get(n);if(o===void 0)return 0;let l=t[o],f=e[o];if(!l||!f)return 1/0;let u=(r||a())-f;return l-u},this.#y=n=>{let o=e[n],l=t[n];return !!l&&!!o&&(r||a())-o>l};}#C=()=>{};#O=()=>{};#W=()=>{};#y=()=>false;#P(){let t=new M(this.#a);this.#b=0,this.#w=t,this.#D=e=>{this.#b-=t[e],t[e]=0;},this.#j=(e,i,s,r)=>{if(this.#e(i))return 0;if(!A(s))if(r){if(typeof r!="function")throw new TypeError("sizeCalculation must be a function");if(s=r(i,e),!A(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.#N=(e,i,s)=>{if(t[e]=i,this.#f){let r=this.#f-t[e];for(;this.#b>r;)this.#R(true);}this.#b+=t[e],s&&(s.entrySize=i,s.totalCalculatedSize=this.#b);};}#D=t=>{};#N=(t,e,i)=>{};#j=(t,e,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#H({allowStale:t=this.allowStale}={}){if(this.#r)for(let e=this.#o;!(!this.#V(e)||((t||!this.#y(e))&&(yield e),e===this.#h));)e=this.#u[e];}*#A({allowStale:t=this.allowStale}={}){if(this.#r)for(let e=this.#h;!(!this.#V(e)||((t||!this.#y(e))&&(yield e),e===this.#o));)e=this.#l[e];}#V(t){return t!==void 0&&this.#s.get(this.#i[t])===t}*entries(){for(let t of this.#H())this.#t[t]!==void 0&&this.#i[t]!==void 0&&!this.#e(this.#t[t])&&(yield [this.#i[t],this.#t[t]]);}*rentries(){for(let t of this.#A())this.#t[t]!==void 0&&this.#i[t]!==void 0&&!this.#e(this.#t[t])&&(yield [this.#i[t],this.#t[t]]);}*keys(){for(let t of this.#H()){let e=this.#i[t];e!==void 0&&!this.#e(this.#t[t])&&(yield e);}}*rkeys(){for(let t of this.#A()){let e=this.#i[t];e!==void 0&&!this.#e(this.#t[t])&&(yield e);}}*values(){for(let t of this.#H())this.#t[t]!==void 0&&!this.#e(this.#t[t])&&(yield this.#t[t]);}*rvalues(){for(let t of this.#A())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(let i of this.#H()){let 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(let i of this.#H()){let 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(let i of this.#A()){let 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=false;for(let e of this.#A({allowStale:true}))this.#y(e)&&(this.#E(this.#i[e],"expire"),t=true);return t}info(t){let e=this.#s.get(t);if(e===void 0)return;let i=this.#t[e],s=this.#e(i)?i.__staleWhileFetching:i;if(s===void 0)return;let r={value:s};if(this.#p&&this.#_){let a=this.#p[e],n=this.#_[e];if(a&&n){let o=a-(this.#S.now()-n);r.ttl=o,r.start=Date.now();}}return this.#w&&(r.size=this.#w[e]),r}dump(){let t=[];for(let e of this.#H({allowStale:true})){let i=this.#i[e],s=this.#t[e],r=this.#e(s)?s.__staleWhileFetching:s;if(r===void 0||i===void 0)continue;let a={value:r};if(this.#p&&this.#_){a.ttl=this.#p[e];let n=this.#S.now()-this.#_[e];a.start=Math.floor(Date.now()-n);}this.#w&&(a.size=this.#w[e]),t.unshift([i,a]);}return t}load(t){this.clear();for(let[e,i]of t){if(i.start){let s=Date.now()-i.start;i.start=this.#S.now()-s;}this.set(e,i.value,i);}}set(t,e,i={}){if(e===void 0)return this.delete(t),this;let{ttl:s=this.ttl,start:r,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:n=this.sizeCalculation,status:o}=i,{noUpdateTTL:l=this.noUpdateTTL}=i,f=this.#j(t,e,i.size||0,n);if(this.maxEntrySize&&f>this.maxEntrySize)return o&&(o.set="miss",o.maxEntrySizeExceeded=true),this.#E(t,"set"),this;let u=this.#r===0?void 0:this.#s.get(t);if(u===void 0)u=this.#r===0?this.#o:this.#v.length!==0?this.#v.pop():this.#r===this.#a?this.#R(false):this.#r,this.#i[u]=t,this.#t[u]=e,this.#s.set(t,u),this.#l[this.#o]=u,this.#u[u]=this.#o,this.#o=u,this.#r++,this.#N(u,f,o),o&&(o.set="add"),l=false,this.#G&&this.#F?.(e,t,"add");else {this.#z(u);let p=this.#t[u];if(e!==p){if(this.#T&&this.#e(p)){p.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:m}=p;m!==void 0&&!a&&(this.#x&&this.#g?.(m,t,"set"),this.#c&&this.#n?.push([m,t,"set"]));}else a||(this.#x&&this.#g?.(p,t,"set"),this.#c&&this.#n?.push([p,t,"set"]));if(this.#D(u),this.#N(u,f,o),this.#t[u]=e,o){o.set="replace";let m=p&&this.#e(p)?p.__staleWhileFetching:p;m!==void 0&&(o.oldValue=m);}}else o&&(o.set="update");this.#G&&this.onInsert?.(e,t,e===p?"update":"replace");}if(s!==0&&!this.#p&&this.#k(),this.#p&&(l||this.#W(u,s,r),o&&this.#O(o,u)),!a&&this.#c&&this.#n){let p=this.#n,m;for(;m=p?.shift();)this.#m?.(...m);}return this}pop(){try{for(;this.#r;){let t=this.#t[this.#h];if(this.#R(!0),this.#e(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(this.#c&&this.#n){let t=this.#n,e;for(;e=t?.shift();)this.#m?.(...e);}}}#R(t){let e=this.#h,i=this.#i[e],s=this.#t[e];return this.#T&&this.#e(s)?s.__abortController.abort(new Error("evicted")):(this.#x||this.#c)&&(this.#x&&this.#g?.(s,i,"evict"),this.#c&&this.#n?.push([s,i,"evict"])),this.#D(e),this.#d?.[e]&&(clearTimeout(this.#d[e]),this.#d[e]=void 0),t&&(this.#i[e]=void 0,this.#t[e]=void 0,this.#v.push(e)),this.#r===1?(this.#h=this.#o=0,this.#v.length=0):this.#h=this.#l[e],this.#s.delete(i),this.#r--,e}has(t,e={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=e,r=this.#s.get(t);if(r!==void 0){let a=this.#t[r];if(this.#e(a)&&a.__staleWhileFetching===void 0)return false;if(this.#y(r))s&&(s.has="stale",this.#O(s,r));else return i&&this.#C(r),s&&(s.has="hit",this.#O(s,r)),true}else s&&(s.has="miss");return false}peek(t,e={}){let{allowStale:i=this.allowStale}=e,s=this.#s.get(t);if(s===void 0||!i&&this.#y(s))return;let r=this.#t[s];return this.#e(r)?r.__staleWhileFetching:r}#L(t,e,i,s){let r=e===void 0?void 0:this.#t[e];if(this.#e(r))return r;let a=new G,{signal:n}=i;n?.addEventListener("abort",()=>a.abort(n.reason),{signal:a.signal});let o={signal:a.signal,options:i,context:s},l=(S,_=false)=>{let{aborted:d}=a.signal,b=i.ignoreFetchAbort&&S!==void 0,H=i.ignoreFetchAbort||!!(i.allowStaleOnFetchAbort&&S!==void 0);if(i.status&&(d&&!_?(i.status.fetchAborted=true,i.status.fetchError=a.signal.reason,b&&(i.status.fetchAbortIgnored=true)):i.status.fetchResolved=true),d&&!b&&!_)return u(a.signal.reason,H);let v=m,y=this.#t[e];return (y===m||b&&_&&y===void 0)&&(S===void 0?v.__staleWhileFetching!==void 0?this.#t[e]=v.__staleWhileFetching:this.#E(t,"fetch"):(i.status&&(i.status.fetchUpdated=true),this.set(t,S,o.options))),S},f=S=>(i.status&&(i.status.fetchRejected=true,i.status.fetchError=S),u(S,false)),u=(S,_)=>{let{aborted:d}=a.signal,b=d&&i.allowStaleOnFetchAbort,H=b||i.allowStaleOnFetchRejection,v=H||i.noDeleteOnFetchRejection,y=m;if(this.#t[e]===m&&(!v||!_&&y.__staleWhileFetching===void 0?this.#E(t,"fetch"):b||(this.#t[e]=y.__staleWhileFetching)),H)return i.status&&y.__staleWhileFetching!==void 0&&(i.status.returnedStale=true),y.__staleWhileFetching;if(y.__returned===y)throw S},p=(S,_)=>{let d=this.#I?.(t,r,o);d&&d instanceof Promise&&d.then(b=>S(b===void 0?void 0:b),_),a.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(S(void 0),i.allowStaleOnFetchAbort&&(S=b=>l(b,true)));});};i.status&&(i.status.fetchDispatched=true);let m=new Promise(p).then(l,f),O=Object.assign(m,{__abortController:a,__staleWhileFetching:r,__returned:void 0});return e===void 0?(this.set(t,O,{...o.options,status:void 0}),e=this.#s.get(t)):this.#t[e]=O,O}#e(t){if(!this.#T)return false;let e=t;return !!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof G}async fetch(t,e={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:n=this.noDisposeOnSet,size:o=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:f=this.noUpdateTTL,noDeleteOnFetchRejection:u=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:p=this.allowStaleOnFetchRejection,ignoreFetchAbort:m=this.ignoreFetchAbort,allowStaleOnFetchAbort:O=this.allowStaleOnFetchAbort,context:S,forceRefresh:_=false,status:d,signal:b}=e;if(!this.#T)return d&&(d.fetch="get"),this.get(t,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:r,status:d});let H={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:r,ttl:a,noDisposeOnSet:n,size:o,sizeCalculation:l,noUpdateTTL:f,noDeleteOnFetchRejection:u,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:O,ignoreFetchAbort:m,status:d,signal:b},v=this.#s.get(t);if(v===void 0){d&&(d.fetch="miss");let y=this.#L(t,v,H,S);return y.__returned=y}else {let y=this.#t[v];if(this.#e(y)){let C=i&&y.__staleWhileFetching!==void 0;return d&&(d.fetch="inflight",C&&(d.returnedStale=true)),C?y.__staleWhileFetching:y.__returned=y}let D=this.#y(v);if(!_&&!D)return d&&(d.fetch="hit"),this.#z(v),s&&this.#C(v),d&&this.#O(d,v),y;let T=this.#L(t,v,H,S),F=T.__staleWhileFetching!==void 0&&i;return d&&(d.fetch=D?"stale":"refresh",F&&D&&(d.returnedStale=true)),F?T.__staleWhileFetching:T.__returned=T}}async forceFetch(t,e={}){let i=await this.fetch(t,e);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(t,e={}){let i=this.#M;if(!i)throw new Error("no memoMethod provided to constructor");let{context:s,forceRefresh:r,...a}=e,n=this.get(t,a);if(!r&&n!==void 0)return n;let o=i(t,n,{options:a,context:s});return this.set(t,o,a),o}get(t,e={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,status:a}=e,n=this.#s.get(t);if(n!==void 0){let o=this.#t[n],l=this.#e(o);return a&&this.#O(a,n),this.#y(n)?(a&&(a.get="stale"),l?(a&&i&&o.__staleWhileFetching!==void 0&&(a.returnedStale=true),i?o.__staleWhileFetching:void 0):(r||this.#E(t,"expire"),a&&i&&(a.returnedStale=true),i?o:void 0)):(a&&(a.get="hit"),l?o.__staleWhileFetching:(this.#z(n),s&&this.#C(n),o))}else a&&(a.get="miss");}#U(t,e){this.#u[e]=t,this.#l[t]=e;}#z(t){t!==this.#o&&(t===this.#h?this.#h=this.#l[t]:this.#U(this.#u[t],this.#l[t]),this.#U(this.#o,t),this.#o=t);}delete(t){return this.#E(t,"delete")}#E(t,e){let i=false;if(this.#r!==0){let s=this.#s.get(t);if(s!==void 0)if(this.#d?.[s]&&(clearTimeout(this.#d?.[s]),this.#d[s]=void 0),i=true,this.#r===1)this.#K(e);else {this.#D(s);let r=this.#t[s];if(this.#e(r)?r.__abortController.abort(new Error("deleted")):(this.#x||this.#c)&&(this.#x&&this.#g?.(r,t,e),this.#c&&this.#n?.push([r,t,e])),this.#s.delete(t),this.#i[s]=void 0,this.#t[s]=void 0,s===this.#o)this.#o=this.#u[s];else if(s===this.#h)this.#h=this.#l[s];else {let a=this.#u[s];this.#l[a]=this.#l[s];let n=this.#l[s];this.#u[n]=this.#u[s];}this.#r--,this.#v.push(s);}}if(this.#c&&this.#n?.length){let s=this.#n,r;for(;r=s?.shift();)this.#m?.(...r);}return i}clear(){return this.#K("delete")}#K(t){for(let e of this.#A({allowStale:true})){let i=this.#t[e];if(this.#e(i))i.__abortController.abort(new Error("deleted"));else {let s=this.#i[e];this.#x&&this.#g?.(i,s,t),this.#c&&this.#n?.push([i,s,t]);}}if(this.#s.clear(),this.#t.fill(void 0),this.#i.fill(void 0),this.#p&&this.#_){this.#p.fill(0),this.#_.fill(0);for(let e of this.#d??[])e!==void 0&&clearTimeout(e);this.#d?.fill(void 0);}if(this.#w&&this.#w.fill(0),this.#h=0,this.#o=0,this.#v.length=0,this.#b=0,this.#r=0,this.#c&&this.#n){let e=this.#n,i;for(;i=e?.shift();)this.#m?.(...i);}}};var E=class{cache;map=new Map;constructor(t){this.cache=new U({max:t.cacheSize}),this.map=new Map;}get[Symbol.iterator](){return this.map[Symbol.iterator]}get[Symbol.toStringTag](){return this.map[Symbol.toStringTag]}clear(){this.cache.clear(),this.map.clear();}delete(t){let e=this.map.delete(t);return e&&this.cache.delete(t),e}get forEach(){return this.map.forEach}get(t){let e=this.cache.get(t);return e||this.map.get(t)}has(t){return this.map.has(t)}set(t,e){return this.map.set(t,e),this.cache.set(t,e),this}get size(){return this.map.size}entries(){return this.map.entries()}keys(){return this.map.keys()}values(){return this.map.values()}};var g;(s=>(s.log=(r,...a)=>console.log(`[Pixi\u2019VN] ${r}`,...a),s.warn=(r,...a)=>console.warn(`[Pixi\u2019VN] ${r}`,...a),s.error=(r,...a)=>console.error(`[Pixi\u2019VN] ${r}`,...a),s.info=(r,...a)=>console.info(`[Pixi\u2019VN] ${r}`,...a)))(g||={});function x(c){try{if(typeof c>"u")return c;let t=JSON.stringify(c);return JSON.parse(t)}catch(t){throw g.error("Error creating exportable element",c,t),new core.PixiError("not_json_serializable","Error creating exportable element")}}var h=class c{static _diffHistory=new E({cacheSize:5});static _stepsInfoHistory=new E({cacheSize:5});static _narrationHistory=new E({cacheSize:50});static stepLimitSaved=20;static _originalStepData=void 0;static get originalStepData(){return c._originalStepData?x(c._originalStepData):{path:"",storage:{},canvas:{elementAliasesOrder:[],elements:{},stage:{},tickers:{},tickersSteps:{},tickersOnPause:{},tickersToCompleteOnStepEnd:{tikersIds:[],stepAlias:[]}},sound:{soundAliasesOrder:[],soundsPlaying:{},playInStepIndex:{},filters:void 0},labelIndex:-1,openedLabels:[]}}static set originalStepData(t){c._originalStepData=x(t);}};function P(c,t){let e=x(c);return t.length>1&&"type"in t[0]&&(t=t.slice().reverse()),t.forEach(i=>{Y(e,i);}),e}function Y(c,t){let e=c;t.path&&t.path.length>0?t.path.forEach((i,s)=>{if(t.path&&s===t.path.length-1)switch(t.type){case "CHANGE":case "REMOVE":e[i]=t.oldValue;break;case "CREATE":Array.isArray(e)&&typeof i=="number"?e.splice(i,1):delete e[i];break}else e=e[i];}):g.warn("No path found, skipping diff",t);}var X={Date:true,RegExp:true,String:true,Number:true};function N(c,t,e={cyclesFix:true},i=[]){let s=[],r=Array.isArray(c);for(let n in c){let o=c[n],l=r?+n:n;if(!(n in t)){s.push({type:"REMOVE",path:[l],oldValue:c[n]});continue}let f=t[n],u=typeof o=="object"&&typeof f=="object"&&Array.isArray(o)===Array.isArray(f);o&&f&&u&&!X[Object.getPrototypeOf(o)?.constructor?.name]&&(!e.cyclesFix||!i.includes(o))?s.push.apply(s,N(o,f,e,e.cyclesFix?i.concat([o]):[]).map(p=>(p.path.unshift(l),p))):o!==f&&!(Number.isNaN(o)&&Number.isNaN(f))&&!(u&&(isNaN(o)?o+""==f+"":+o==+f))&&s.push({path:[l],type:"CHANGE",value:f,oldValue:o});}let a=Array.isArray(t);for(let n in t)n in c||s.push({type:"CREATE",path:[a?+n:n],value:t[n]});return s}var I=class{get stepsInfoMap(){return h._stepsInfoHistory}get diffMap(){return h._diffHistory}get narrationMap(){return h._narrationHistory}get size(){return h._stepsInfoHistory.size}get lastKey(){return this.size===0?null:Math.max(...Array.from(this.keys()))}keys(){return h._stepsInfoHistory.keys()}get(t){let e=h._narrationHistory.get(t);if(!(e&&Object.keys(e).length===1&&e.stepIndex!==void 0))return e}delete(t){h._stepsInfoHistory.delete(t),h._diffHistory.delete(t),h._narrationHistory.delete(t);}getOldGameState(t,e){if(t<=0||this.size===0)return e;let i=this.lastKey;if(typeof i!="number")return g.warn("You can't go back, there is no step to go back"),e;let s=h._diffHistory.get(i);if(s)try{let r=P(e,s);return core.GameUnifier.stepCounter=i,this.delete(i),this.getOldGameState(t-1,r)}catch(r){return g.error("Error applying diff",r),e}else return g.warn("No diff found for the last step, cannot go back"),e}async back(t,e={}){let{steps:i=1}=e;if(!Number.isFinite(i)){g.warn(`[back] The parameter steps must be a valid finite number, received: ${i}`);return}if(i<=0){g.warn(`[back] The parameter steps must be greater than 0, received: ${i}`);return}if(core.GameUnifier.runningStepsCount>0){core.GameUnifier.increaseBackRequest(i);return}if(h._diffHistory.size<1){g.warn("You can't go back, there is no step to go back");return}core.GameUnifier.runningStepsCount++;try{let s=x(this.getOldGameState(i,h.originalStepData));if(s){await core.GameUnifier.restoreGameStepState(s,core.GameUnifier.navigate);let r=core.GameUnifier.stepCounter-1,a=h._narrationHistory.get(r);if(a&&Object.keys(a).length===1&&a.stepIndex!==void 0){let n=h._stepsInfoHistory.get(r);if(n){let o=this.itemMapper({step:n});h._narrationHistory.set(n.index,o);}}}else g.error("Error going back");h.originalStepData=s;}catch(s){g.error("Error going back",s);}if(core.GameUnifier.runningStepsCount--,core.GameUnifier.runningStepsCount===0&&core.GameUnifier.backRequestsCount!==0)return await core.GameUnifier.processNavigationRequests(t)}add(t,e={}){let i=h.originalStepData,{ignoreSameStep:s}=e,r=core.GameUnifier.currentGameStepState;if(!s&&this.isSameStep(i,r))return;let a=this.lastKey;(async()=>{try{let o,l;if(typeof a=="number"&&(o=h._stepsInfoHistory.get(a),l=h._narrationHistory.get(a)),h._stepsInfoHistory.set(t.index,t),t.index!==0){let p=N(i,r);p?h._diffHistory.set(t.index,p):g.warn("It was not possible to create the difference between the two steps");}let f={},u=this.itemMapper({step:t},f);if(h._narrationHistory.set(t.index,u),o&&l&&typeof a=="number"){let p=this.itemMapper({...f,step:o},{});h._narrationHistory.set(a,p);}}catch(o){g.error("Error adding history step",o);}})(),h.originalStepData=r;}itemMapper(t,e){let{step:i,choiceIndexMade:s,inputValue:r,removeDialogue:a}=t,n=i.dialogue;e&&i.isGlued&&(e.removeDialogue=true),a&&(n=void 0);let o=i.choices;if(e&&i.currentLabel&&i.choiceIndexMade!==void 0&&(e.choiceIndexMade=i.choiceIndexMade),i.inputValue&&e&&(e.inputValue=i.inputValue),n||o||r){let l=o?.map((f,u)=>{let p=false;return f.oneTime&&i.alreadyMadeChoices?.includes(u)&&(p=true),{text:f.text,type:f.type,isResponse:false,hidden:p}});if(l){if(l.every(f=>f.hidden)){let f=l.find(u=>u.hidden===false);f&&(f.hidden=false);}s!==void 0&&(l[s].isResponse=true);}return {dialogue:n?{...n,character:n.character?core.GameUnifier.getCharacter(n.character)||n.character:void 0}:void 0,playerMadeChoice:typeof s=="number",choices:l,stepIndex:i.index,inputValue:r}}return {stepIndex:i.index}}get narrativeHistory(){let t=[];return Array.from(this.keys()).sort((i,s)=>i-s).forEach(i=>{let s=this.get(i);s&&t.push(s);}),t}get currentLabelHistory(){let t=[],e=Array.from(this.keys()).sort((o,l)=>l-o);if(e.length===0)return t;let i=e[0];if(typeof i!="number")return t;let s=h._stepsInfoHistory.get(i);if(!s)return t;let r=s.openedLabels;if(!r||!Array.isArray(r)||r.length===0)return t;let a=r[0].currentStepIndex,n=r[0].label;return e.every((o,l)=>{let f=this.get(o);if(f){if(l===0)return t.push(f),true;let u=h._stepsInfoHistory.get(o);if(!u)return true;let p=u.openedLabels;if(!p||!Array.isArray(p)||p.length===0||p[0].label!==n||p[0].currentStepIndex>=a)return false;a=p[0].currentStepIndex,t.push(f);}return true}),t.reverse()}removeNarrativeHistory(t){if(t){let e=Array.from(this.keys()).sort((i,s)=>i-s);e=e.slice(0,t),e.forEach(i=>{h._narrationHistory.delete(i),h._stepsInfoHistory.delete(i),h._diffHistory.delete(i);});}else h._stepsInfoHistory.clear(),h._diffHistory.clear(),h._narrationHistory.clear();}get canGoBack(){let t=this.lastKey;return typeof t!="number"?false:h._diffHistory.has(t)}blockGoBack(){core.GameUnifier.runningStepsCount===0&&h._diffHistory.clear();}isSameStep(t,e){if(t.openedLabels.length===e.openedLabels.length)try{let i=JSON.stringify(t.openedLabels),s=JSON.stringify(e.openedLabels);if(i===s&&t.path===e.path&&t.labelIndex===e.labelIndex)return !0}catch(i){return g.error("Error comparing opened labels",i),true}return false}clear(){h._stepsInfoHistory.clear(),h._diffHistory.clear(),h._narrationHistory.clear(),h._originalStepData=void 0;}get stepLimitSaved(){return h.stepLimitSaved}set stepLimitSaved(t){h.stepLimitSaved=t;}export(){let t=Array.from(this.keys()).sort((i,s)=>i-s);t.length>this.stepLimitSaved&&(t=t.slice(t.length-this.stepLimitSaved));let e=[];return t.forEach(i=>{let s=h._stepsInfoHistory.get(i);if(s){let r=h._diffHistory.get(i);e.push({...s,diff:r});}}),{stepsHistory:x(e),originalStepData:x(h._originalStepData)}}restoreNarrativeHistory(){let t=Array.from(this.keys()).sort((i,s)=>i-s),e={};t.forEach(i=>{let s=h._stepsInfoHistory.get(i);if(s){let r={...e};e={};let a=this.itemMapper({step:s,choiceIndexMade:r.choiceIndexMade,inputValue:r.inputValue,removeDialogue:r.removeDialogue},e);a&&h._narrationHistory.set(i,a);}});}async restore(t){this.clear();try{Object.hasOwn(t,"stepsHistory")?(t.stepsHistory.forEach(i=>{i.diff&&h._diffHistory.set(i.index,i.diff);let s={...i,diff:void 0};h._stepsInfoHistory.set(i.index,s);}),this.restoreNarrativeHistory()):g.warn("Could not import stepsHistory data, so will be ignored"),Object.hasOwn(t,"originalStepData")?h._originalStepData=t.originalStepData:g.warn("Could not import originalStepData data, so will be ignored");}catch(e){g.error("Error importing data",e);}}};var Ot=new I;exports.HistoryManagerStatic=h;exports.stepHistory=Ot;
|
package/dist/history.d.cts
CHANGED
|
@@ -1,18 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { HistoryInfo, GameStepState } from '@drincs/pixi-vn';
|
|
2
2
|
import { Difference } from 'microdiff';
|
|
3
3
|
import { C as CachedMap } from './CachedMap-DZLvJAnA.cjs';
|
|
4
|
-
import {
|
|
4
|
+
import { H as HistoryGameState } from './HistoryGameState-3ztYdv84.cjs';
|
|
5
|
+
import { S as StepLabelPropsType, a as StepLabelResultType } from './StepLabelType-CN97wZzm.cjs';
|
|
6
|
+
import { H as HistoryStep } from './HistoryStep-DtOryKAZ.cjs';
|
|
7
|
+
import { N as NarrationHistory } from './HistoryChoiceMenuOption-CEmjDDJH.cjs';
|
|
5
8
|
import 'lru-cache';
|
|
9
|
+
import '@drincs/pixi-vn/canvas';
|
|
6
10
|
import './StorageElementType-C7ETezlL.cjs';
|
|
7
11
|
|
|
8
|
-
/**
|
|
9
|
-
* Interface exported step data
|
|
10
|
-
*/
|
|
11
|
-
interface HistoryGameState {
|
|
12
|
-
stepsHistory: HistoryStep[];
|
|
13
|
-
originalStepData: GameStepState | undefined;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
12
|
interface HistoryManagerInterface {
|
|
17
13
|
/**
|
|
18
14
|
* Get the narrative history.
|
|
@@ -145,4 +141,4 @@ declare class HistoryManagerStatic {
|
|
|
145
141
|
|
|
146
142
|
declare const stepHistory: HistoryManagerInterface;
|
|
147
143
|
|
|
148
|
-
export {
|
|
144
|
+
export { HistoryGameState, type HistoryManagerInterface, HistoryManagerStatic, stepHistory };
|
package/dist/history.d.ts
CHANGED
|
@@ -1,18 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { HistoryInfo, GameStepState } from '@drincs/pixi-vn';
|
|
2
2
|
import { Difference } from 'microdiff';
|
|
3
3
|
import { C as CachedMap } from './CachedMap-DZLvJAnA.js';
|
|
4
|
-
import {
|
|
4
|
+
import { H as HistoryGameState } from './HistoryGameState-D4t2fY9x.js';
|
|
5
|
+
import { S as StepLabelPropsType, a as StepLabelResultType } from './StepLabelType-CN97wZzm.js';
|
|
6
|
+
import { H as HistoryStep } from './HistoryStep-DtOryKAZ.js';
|
|
7
|
+
import { N as NarrationHistory } from './HistoryChoiceMenuOption-CN7NkcxU.js';
|
|
5
8
|
import 'lru-cache';
|
|
9
|
+
import '@drincs/pixi-vn/canvas';
|
|
6
10
|
import './StorageElementType-C7ETezlL.js';
|
|
7
11
|
|
|
8
|
-
/**
|
|
9
|
-
* Interface exported step data
|
|
10
|
-
*/
|
|
11
|
-
interface HistoryGameState {
|
|
12
|
-
stepsHistory: HistoryStep[];
|
|
13
|
-
originalStepData: GameStepState | undefined;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
12
|
interface HistoryManagerInterface {
|
|
17
13
|
/**
|
|
18
14
|
* Get the narrative history.
|
|
@@ -145,4 +141,4 @@ declare class HistoryManagerStatic {
|
|
|
145
141
|
|
|
146
142
|
declare const stepHistory: HistoryManagerInterface;
|
|
147
143
|
|
|
148
|
-
export {
|
|
144
|
+
export { HistoryGameState, type HistoryManagerInterface, HistoryManagerStatic, stepHistory };
|
package/dist/history.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import'./chunk-JMOSOAGB.mjs';import {d,e
|
|
1
|
+
import'./chunk-JMOSOAGB.mjs';import {d,f,e}from'./chunk-F3AVLCQB.mjs';import {GameUnifier}from'@drincs/pixi-vn/core';var i=class y{static _diffHistory=new d({cacheSize:5});static _stepsInfoHistory=new d({cacheSize:5});static _narrationHistory=new d({cacheSize:50});static stepLimitSaved=20;static _originalStepData=void 0;static get originalStepData(){return y._originalStepData?f(y._originalStepData):{path:"",storage:{},canvas:{elementAliasesOrder:[],elements:{},stage:{},tickers:{},tickersSteps:{},tickersOnPause:{},tickersToCompleteOnStepEnd:{tikersIds:[],stepAlias:[]}},sound:{soundAliasesOrder:[],soundsPlaying:{},playInStepIndex:{},filters:void 0},labelIndex:-1,openedLabels:[]}}static set originalStepData(e){y._originalStepData=f(e);}};function b(y,e){let r=f(y);return e.length>1&&"type"in e[0]&&(e=e.slice().reverse()),e.forEach(t=>{x(r,t);}),r}function x(y,e$1){let r=y;e$1.path&&e$1.path.length>0?e$1.path.forEach((t,a)=>{if(e$1.path&&a===e$1.path.length-1)switch(e$1.type){case "CHANGE":case "REMOVE":r[t]=e$1.oldValue;break;case "CREATE":Array.isArray(r)&&typeof t=="number"?r.splice(t,1):delete r[t];break}else r=r[t];}):e.warn("No path found, skipping diff",e$1);}var _={Date:true,RegExp:true,String:true,Number:true};function S(y,e,r={cyclesFix:true},t=[]){let a=[],s=Array.isArray(y);for(let o in y){let n=y[o],u=s?+o:o;if(!(o in e)){a.push({type:"REMOVE",path:[u],oldValue:y[o]});continue}let p=e[o],m=typeof n=="object"&&typeof p=="object"&&Array.isArray(n)===Array.isArray(p);n&&p&&m&&!_[Object.getPrototypeOf(n)?.constructor?.name]&&(!r.cyclesFix||!t.includes(n))?a.push.apply(a,S(n,p,r,r.cyclesFix?t.concat([n]):[]).map(f=>(f.path.unshift(u),f))):n!==p&&!(Number.isNaN(n)&&Number.isNaN(p))&&!(m&&(isNaN(n)?n+""==p+"":+n==+p))&&a.push({path:[u],type:"CHANGE",value:p,oldValue:n});}let c=Array.isArray(e);for(let o in e)o in y||a.push({type:"CREATE",path:[c?+o:o],value:e[o]});return a}var h=class{get stepsInfoMap(){return i._stepsInfoHistory}get diffMap(){return i._diffHistory}get narrationMap(){return i._narrationHistory}get size(){return i._stepsInfoHistory.size}get lastKey(){return this.size===0?null:Math.max(...Array.from(this.keys()))}keys(){return i._stepsInfoHistory.keys()}get(e){let r=i._narrationHistory.get(e);if(!(r&&Object.keys(r).length===1&&r.stepIndex!==void 0))return r}delete(e){i._stepsInfoHistory.delete(e),i._diffHistory.delete(e),i._narrationHistory.delete(e);}getOldGameState(e$1,r){if(e$1<=0||this.size===0)return r;let t=this.lastKey;if(typeof t!="number")return e.warn("You can't go back, there is no step to go back"),r;let a=i._diffHistory.get(t);if(a)try{let s=b(r,a);return GameUnifier.stepCounter=t,this.delete(t),this.getOldGameState(e$1-1,s)}catch(s){return e.error("Error applying diff",s),r}else return e.warn("No diff found for the last step, cannot go back"),r}async back(e$1,r={}){let{steps:t=1}=r;if(!Number.isFinite(t)){e.warn(`[back] The parameter steps must be a valid finite number, received: ${t}`);return}if(t<=0){e.warn(`[back] The parameter steps must be greater than 0, received: ${t}`);return}if(GameUnifier.runningStepsCount>0){GameUnifier.increaseBackRequest(t);return}if(i._diffHistory.size<1){e.warn("You can't go back, there is no step to go back");return}GameUnifier.runningStepsCount++;try{let a=f(this.getOldGameState(t,i.originalStepData));if(a){await GameUnifier.restoreGameStepState(a,GameUnifier.navigate);let s=GameUnifier.stepCounter-1,c=i._narrationHistory.get(s);if(c&&Object.keys(c).length===1&&c.stepIndex!==void 0){let o=i._stepsInfoHistory.get(s);if(o){let n=this.itemMapper({step:o});i._narrationHistory.set(o.index,n);}}}else e.error("Error going back");i.originalStepData=a;}catch(a){e.error("Error going back",a);}if(GameUnifier.runningStepsCount--,GameUnifier.runningStepsCount===0&&GameUnifier.backRequestsCount!==0)return await GameUnifier.processNavigationRequests(e$1)}add(e$1,r={}){let t=i.originalStepData,{ignoreSameStep:a}=r,s=GameUnifier.currentGameStepState;if(!a&&this.isSameStep(t,s))return;let c=this.lastKey;(async()=>{try{let n,u;if(typeof c=="number"&&(n=i._stepsInfoHistory.get(c),u=i._narrationHistory.get(c)),i._stepsInfoHistory.set(e$1.index,e$1),e$1.index!==0){let f=S(t,s);f?i._diffHistory.set(e$1.index,f):e.warn("It was not possible to create the difference between the two steps");}let p={},m=this.itemMapper({step:e$1},p);if(i._narrationHistory.set(e$1.index,m),n&&u&&typeof c=="number"){let f=this.itemMapper({...p,step:n},{});i._narrationHistory.set(c,f);}}catch(n){e.error("Error adding history step",n);}})(),i.originalStepData=s;}itemMapper(e,r){let{step:t,choiceIndexMade:a,inputValue:s,removeDialogue:c}=e,o=t.dialogue;r&&t.isGlued&&(r.removeDialogue=true),c&&(o=void 0);let n=t.choices;if(r&&t.currentLabel&&t.choiceIndexMade!==void 0&&(r.choiceIndexMade=t.choiceIndexMade),t.inputValue&&r&&(r.inputValue=t.inputValue),o||n||s){let u=n?.map((p,m)=>{let f=false;return p.oneTime&&t.alreadyMadeChoices?.includes(m)&&(f=true),{text:p.text,type:p.type,isResponse:false,hidden:f}});if(u){if(u.every(p=>p.hidden)){let p=u.find(m=>m.hidden===false);p&&(p.hidden=false);}a!==void 0&&(u[a].isResponse=true);}return {dialogue:o?{...o,character:o.character?GameUnifier.getCharacter(o.character)||o.character:void 0}:void 0,playerMadeChoice:typeof a=="number",choices:u,stepIndex:t.index,inputValue:s}}return {stepIndex:t.index}}get narrativeHistory(){let e=[];return Array.from(this.keys()).sort((t,a)=>t-a).forEach(t=>{let a=this.get(t);a&&e.push(a);}),e}get currentLabelHistory(){let e=[],r=Array.from(this.keys()).sort((n,u)=>u-n);if(r.length===0)return e;let t=r[0];if(typeof t!="number")return e;let a=i._stepsInfoHistory.get(t);if(!a)return e;let s=a.openedLabels;if(!s||!Array.isArray(s)||s.length===0)return e;let c=s[0].currentStepIndex,o=s[0].label;return r.every((n,u)=>{let p=this.get(n);if(p){if(u===0)return e.push(p),true;let m=i._stepsInfoHistory.get(n);if(!m)return true;let f=m.openedLabels;if(!f||!Array.isArray(f)||f.length===0||f[0].label!==o||f[0].currentStepIndex>=c)return false;c=f[0].currentStepIndex,e.push(p);}return true}),e.reverse()}removeNarrativeHistory(e){if(e){let r=Array.from(this.keys()).sort((t,a)=>t-a);r=r.slice(0,e),r.forEach(t=>{i._narrationHistory.delete(t),i._stepsInfoHistory.delete(t),i._diffHistory.delete(t);});}else i._stepsInfoHistory.clear(),i._diffHistory.clear(),i._narrationHistory.clear();}get canGoBack(){let e=this.lastKey;return typeof e!="number"?false:i._diffHistory.has(e)}blockGoBack(){GameUnifier.runningStepsCount===0&&i._diffHistory.clear();}isSameStep(e$1,r){if(e$1.openedLabels.length===r.openedLabels.length)try{let t=JSON.stringify(e$1.openedLabels),a=JSON.stringify(r.openedLabels);if(t===a&&e$1.path===r.path&&e$1.labelIndex===r.labelIndex)return !0}catch(t){return e.error("Error comparing opened labels",t),true}return false}clear(){i._stepsInfoHistory.clear(),i._diffHistory.clear(),i._narrationHistory.clear(),i._originalStepData=void 0;}get stepLimitSaved(){return i.stepLimitSaved}set stepLimitSaved(e){i.stepLimitSaved=e;}export(){let e=Array.from(this.keys()).sort((t,a)=>t-a);e.length>this.stepLimitSaved&&(e=e.slice(e.length-this.stepLimitSaved));let r=[];return e.forEach(t=>{let a=i._stepsInfoHistory.get(t);if(a){let s=i._diffHistory.get(t);r.push({...a,diff:s});}}),{stepsHistory:f(r),originalStepData:f(i._originalStepData)}}restoreNarrativeHistory(){let e=Array.from(this.keys()).sort((t,a)=>t-a),r={};e.forEach(t=>{let a=i._stepsInfoHistory.get(t);if(a){let s={...r};r={};let c=this.itemMapper({step:a,choiceIndexMade:s.choiceIndexMade,inputValue:s.inputValue,removeDialogue:s.removeDialogue},r);c&&i._narrationHistory.set(t,c);}});}async restore(e$1){this.clear();try{Object.hasOwn(e$1,"stepsHistory")?(e$1.stepsHistory.forEach(t=>{t.diff&&i._diffHistory.set(t.index,t.diff);let a={...t,diff:void 0};i._stepsInfoHistory.set(t.index,a);}),this.restoreNarrativeHistory()):e.warn("Could not import stepsHistory data, so will be ignored"),Object.hasOwn(e$1,"originalStepData")?i._originalStepData=e$1.originalStepData:e.warn("Could not import originalStepData data, so will be ignored");}catch(r){e.error("Error importing data",r);}}};var j=new h;export{i as HistoryManagerStatic,j as stepHistory};
|
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var nt=require('@drincs/pixi-vn/canvas'),Xt=require('@drincs/pixi-vn/characters'),core=require('@drincs/pixi-vn/core'),et=require('@drincs/pixi-vn/history'),C=require('@drincs/pixi-vn/narration'),ut=require('@drincs/pixi-vn/sound'),G=require('@drincs/pixi-vn/storage'),motion=require('@drincs/pixi-vn/motion');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var nt__namespace=/*#__PURE__*/_interopNamespace(nt);var Xt__namespace=/*#__PURE__*/_interopNamespace(Xt);var et__namespace=/*#__PURE__*/_interopNamespace(et);var C__namespace=/*#__PURE__*/_interopNamespace(C);var ut__namespace=/*#__PURE__*/_interopNamespace(ut);var G__namespace=/*#__PURE__*/_interopNamespace(G);var Jt=Object.defineProperty;var Qt=h=>{throw TypeError(h)};var ue=(h,e,i)=>e in h?Jt(h,e,{enumerable:true,configurable:true,writable:true,value:i}):h[e]=i;var fe=(h,e)=>{for(var i in e)Jt(h,i,{get:e[i],enumerable:true});};var x=(h,e,i)=>ue(h,typeof e!="symbol"?e+"":e,i),jt=(h,e,i)=>e.has(h)||Qt("Cannot "+i);var t=(h,e,i)=>(jt(h,e,"read from private field"),i?i.call(h):e.get(h)),_=(h,e,i)=>e.has(h)?Qt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(h):e.set(h,i),u=(h,e,i,s)=>(jt(h,e,"write to private field"),e.set(h,i),i),d=(h,e,i)=>(jt(h,e,"access private method"),i);var Rt=(h,e,i,s)=>({set _(r){u(h,e,r);},get _(){return t(h,e,s)}});var me=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,ie=new Set,Gt=typeof process=="object"&&process?process:{},se=(h,e,i,s)=>{typeof Gt.emitWarning=="function"?Gt.emitWarning(h,e,i,s):console.error(`[${i}] ${e}: ${h}`);},Nt=globalThis.AbortController,Zt=globalThis.AbortSignal;if(typeof Nt>"u"){Zt=class{constructor(){x(this,"onabort");x(this,"_onabort",[]);x(this,"reason");x(this,"aborted",false);}addEventListener(i,s){this._onabort.push(s);}},Nt=class{constructor(){x(this,"signal",new Zt);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 h=Gt.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{h&&(h=false,se("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 ge=h=>!ie.has(h);var at=h=>h&&h===Math.floor(h)&&h>0&&isFinite(h),re=h=>at(h)?h<=Math.pow(2,8)?Uint8Array:h<=Math.pow(2,16)?Uint16Array:h<=Math.pow(2,32)?Uint32Array:h<=Number.MAX_SAFE_INTEGER?Dt:null:null,Dt=class extends Array{constructor(h){super(h),this.fill(0);}},it,St,_e=(it=class{constructor(e,i){x(this,"heap");x(this,"length");if(!t(it,St))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new i(e),this.length=0;}static create(e){let i=re(e);if(!i)return [];u(it,St,true);let s=new it(e,i);return u(it,St,false),s}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}},St=new WeakMap,_(it,St,false),it),te,ee,K,M,q,ft,$,yt,Et,B,U,X,T,w,m,P,z,N,D,J,L,Q,Z,V,W,tt,dt,j,xt,l,It,mt,ot,Ot,Y,ne,gt,bt,Tt,lt,ht,Mt,Lt,Ct,b,zt,At,ct,Vt,wt,oe=(wt=class{constructor(e){_(this,l);_(this,K);_(this,M);_(this,q);_(this,ft);_(this,$);_(this,yt);_(this,Et);_(this,B);x(this,"ttl");x(this,"ttlResolution");x(this,"ttlAutopurge");x(this,"updateAgeOnGet");x(this,"updateAgeOnHas");x(this,"allowStale");x(this,"noDisposeOnSet");x(this,"noUpdateTTL");x(this,"maxEntrySize");x(this,"sizeCalculation");x(this,"noDeleteOnFetchRejection");x(this,"noDeleteOnStaleGet");x(this,"allowStaleOnFetchAbort");x(this,"allowStaleOnFetchRejection");x(this,"ignoreFetchAbort");_(this,U);_(this,X);_(this,T);_(this,w);_(this,m);_(this,P);_(this,z);_(this,N);_(this,D);_(this,J);_(this,L);_(this,Q);_(this,Z);_(this,V);_(this,W);_(this,tt);_(this,dt);_(this,j);_(this,xt);_(this,mt,()=>{});_(this,ot,()=>{});_(this,Ot,()=>{});_(this,Y,()=>false);_(this,gt,e=>{});_(this,bt,(e,i,s)=>{});_(this,Tt,(e,i,s,r)=>{if(s||r)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});x(this,te,"LRUCache");let{max:i=0,ttl:s,ttlResolution:r=1,ttlAutopurge:n,updateAgeOnGet:o,updateAgeOnHas:c,allowStale:p,dispose:v,onInsert:R,disposeAfter:S,noDisposeOnSet:rt,noUpdateTTL:I,maxSize:k=0,maxEntrySize:A=0,sizeCalculation:y,fetchMethod:a,memoMethod:E,noDeleteOnFetchRejection:O,noDeleteOnStaleGet:f,allowStaleOnFetchRejection:g,allowStaleOnFetchAbort:F,ignoreFetchAbort:H,perf:_t}=e;if(_t!==void 0&&typeof _t?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(u(this,B,_t??me),i!==0&&!at(i))throw new TypeError("max option must be a nonnegative integer");let vt=i?re(i):Array;if(!vt)throw new Error("invalid max value: "+i);if(u(this,K,i),u(this,M,k),this.maxEntrySize=A||t(this,M),this.sizeCalculation=y,this.sizeCalculation){if(!t(this,M)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(E!==void 0&&typeof E!="function")throw new TypeError("memoMethod must be a function if defined");if(u(this,Et,E),a!==void 0&&typeof a!="function")throw new TypeError("fetchMethod must be a function if specified");if(u(this,yt,a),u(this,dt,!!a),u(this,T,new Map),u(this,w,new Array(i).fill(void 0)),u(this,m,new Array(i).fill(void 0)),u(this,P,new vt(i)),u(this,z,new vt(i)),u(this,N,0),u(this,D,0),u(this,J,_e.create(i)),u(this,U,0),u(this,X,0),typeof v=="function"&&u(this,q,v),typeof R=="function"&&u(this,ft,R),typeof S=="function"?(u(this,$,S),u(this,L,[])):(u(this,$,void 0),u(this,L,void 0)),u(this,tt,!!t(this,q)),u(this,xt,!!t(this,ft)),u(this,j,!!t(this,$)),this.noDisposeOnSet=!!rt,this.noUpdateTTL=!!I,this.noDeleteOnFetchRejection=!!O,this.allowStaleOnFetchRejection=!!g,this.allowStaleOnFetchAbort=!!F,this.ignoreFetchAbort=!!H,this.maxEntrySize!==0){if(t(this,M)!==0&&!at(t(this,M)))throw new TypeError("maxSize must be a positive integer if specified");if(!at(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");d(this,l,ne).call(this);}if(this.allowStale=!!p,this.noDeleteOnStaleGet=!!f,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!c,this.ttlResolution=at(r)||r===0?r:1,this.ttlAutopurge=!!n,this.ttl=s||0,this.ttl){if(!at(this.ttl))throw new TypeError("ttl must be a positive integer if specified");d(this,l,It).call(this);}if(t(this,K)===0&&this.ttl===0&&t(this,M)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!t(this,K)&&!t(this,M)){let Pt="LRU_CACHE_UNBOUNDED";ge(Pt)&&(ie.add(Pt),se("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",Pt,wt));}}get perf(){return t(this,B)}static unsafeExposeInternals(e){return {starts:t(e,Z),ttls:t(e,V),autopurgeTimers:t(e,W),sizes:t(e,Q),keyMap:t(e,T),keyList:t(e,w),valList:t(e,m),next:t(e,P),prev:t(e,z),get head(){return t(e,N)},get tail(){return t(e,D)},free:t(e,J),isBackgroundFetch:i=>{var s;return d(s=e,l,b).call(s,i)},backgroundFetch:(i,s,r,n)=>{var o;return d(o=e,l,Ct).call(o,i,s,r,n)},moveToTail:i=>{var s;return d(s=e,l,At).call(s,i)},indexes:i=>{var s;return d(s=e,l,lt).call(s,i)},rindexes:i=>{var s;return d(s=e,l,ht).call(s,i)},isStale:i=>{var s;return t(s=e,Y).call(s,i)}}}get max(){return t(this,K)}get maxSize(){return t(this,M)}get calculatedSize(){return t(this,X)}get size(){return t(this,U)}get fetchMethod(){return t(this,yt)}get memoMethod(){return t(this,Et)}get dispose(){return t(this,q)}get onInsert(){return t(this,ft)}get disposeAfter(){return t(this,$)}getRemainingTTL(e){return t(this,T).has(e)?1/0:0}*entries(){for(let e of d(this,l,lt).call(this))t(this,m)[e]!==void 0&&t(this,w)[e]!==void 0&&!d(this,l,b).call(this,t(this,m)[e])&&(yield [t(this,w)[e],t(this,m)[e]]);}*rentries(){for(let e of d(this,l,ht).call(this))t(this,m)[e]!==void 0&&t(this,w)[e]!==void 0&&!d(this,l,b).call(this,t(this,m)[e])&&(yield [t(this,w)[e],t(this,m)[e]]);}*keys(){for(let e of d(this,l,lt).call(this)){let i=t(this,w)[e];i!==void 0&&!d(this,l,b).call(this,t(this,m)[e])&&(yield i);}}*rkeys(){for(let e of d(this,l,ht).call(this)){let i=t(this,w)[e];i!==void 0&&!d(this,l,b).call(this,t(this,m)[e])&&(yield i);}}*values(){for(let e of d(this,l,lt).call(this))t(this,m)[e]!==void 0&&!d(this,l,b).call(this,t(this,m)[e])&&(yield t(this,m)[e]);}*rvalues(){for(let e of d(this,l,ht).call(this))t(this,m)[e]!==void 0&&!d(this,l,b).call(this,t(this,m)[e])&&(yield t(this,m)[e]);}[(ee=Symbol.iterator,te=Symbol.toStringTag,ee)](){return this.entries()}find(e,i={}){for(let s of d(this,l,lt).call(this)){let r=t(this,m)[s],n=d(this,l,b).call(this,r)?r.__staleWhileFetching:r;if(n!==void 0&&e(n,t(this,w)[s],this))return this.get(t(this,w)[s],i)}}forEach(e,i=this){for(let s of d(this,l,lt).call(this)){let r=t(this,m)[s],n=d(this,l,b).call(this,r)?r.__staleWhileFetching:r;n!==void 0&&e.call(i,n,t(this,w)[s],this);}}rforEach(e,i=this){for(let s of d(this,l,ht).call(this)){let r=t(this,m)[s],n=d(this,l,b).call(this,r)?r.__staleWhileFetching:r;n!==void 0&&e.call(i,n,t(this,w)[s],this);}}purgeStale(){let e=false;for(let i of d(this,l,ht).call(this,{allowStale:true}))t(this,Y).call(this,i)&&(d(this,l,ct).call(this,t(this,w)[i],"expire"),e=true);return e}info(e){let i=t(this,T).get(e);if(i===void 0)return;let s=t(this,m)[i],r=d(this,l,b).call(this,s)?s.__staleWhileFetching:s;if(r===void 0)return;let n={value:r};if(t(this,V)&&t(this,Z)){let o=t(this,V)[i],c=t(this,Z)[i];if(o&&c){let p=o-(t(this,B).now()-c);n.ttl=p,n.start=Date.now();}}return t(this,Q)&&(n.size=t(this,Q)[i]),n}dump(){let e=[];for(let i of d(this,l,lt).call(this,{allowStale:true})){let s=t(this,w)[i],r=t(this,m)[i],n=d(this,l,b).call(this,r)?r.__staleWhileFetching:r;if(n===void 0||s===void 0)continue;let o={value:n};if(t(this,V)&&t(this,Z)){o.ttl=t(this,V)[i];let c=t(this,B).now()-t(this,Z)[i];o.start=Math.floor(Date.now()-c);}t(this,Q)&&(o.size=t(this,Q)[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=t(this,B).now()-r;}this.set(i,s.value,s);}}set(e,i,s={}){var rt,I,k,A;if(i===void 0)return this.delete(e),this;let{ttl:r=this.ttl,start:n,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:c=this.sizeCalculation,status:p}=s,{noUpdateTTL:v=this.noUpdateTTL}=s,R=t(this,Tt).call(this,e,i,s.size||0,c);if(this.maxEntrySize&&R>this.maxEntrySize)return p&&(p.set="miss",p.maxEntrySizeExceeded=true),d(this,l,ct).call(this,e,"set"),this;let S=t(this,U)===0?void 0:t(this,T).get(e);if(S===void 0)S=t(this,U)===0?t(this,D):t(this,J).length!==0?t(this,J).pop():t(this,U)===t(this,K)?d(this,l,Lt).call(this,false):t(this,U),t(this,w)[S]=e,t(this,m)[S]=i,t(this,T).set(e,S),t(this,P)[t(this,D)]=S,t(this,z)[S]=t(this,D),u(this,D,S),Rt(this,U)._++,t(this,bt).call(this,S,R,p),p&&(p.set="add"),v=false,t(this,xt)&&((rt=t(this,ft))==null||rt.call(this,i,e,"add"));else {d(this,l,At).call(this,S);let y=t(this,m)[S];if(i!==y){if(t(this,dt)&&d(this,l,b).call(this,y)){y.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:a}=y;a!==void 0&&!o&&(t(this,tt)&&((I=t(this,q))==null||I.call(this,a,e,"set")),t(this,j)&&t(this,L)?.push([a,e,"set"]));}else o||(t(this,tt)&&((k=t(this,q))==null||k.call(this,y,e,"set")),t(this,j)&&t(this,L)?.push([y,e,"set"]));if(t(this,gt).call(this,S),t(this,bt).call(this,S,R,p),t(this,m)[S]=i,p){p.set="replace";let a=y&&d(this,l,b).call(this,y)?y.__staleWhileFetching:y;a!==void 0&&(p.oldValue=a);}}else p&&(p.set="update");t(this,xt)&&this.onInsert?.(i,e,i===y?"update":"replace");}if(r!==0&&!t(this,V)&&d(this,l,It).call(this),t(this,V)&&(v||t(this,Ot).call(this,S,r,n),p&&t(this,ot).call(this,p,S)),!o&&t(this,j)&&t(this,L)){let y=t(this,L),a;for(;a=y?.shift();)(A=t(this,$))==null||A.call(this,...a);}return this}pop(){var e;try{for(;t(this,U);){let i=t(this,m)[t(this,N)];if(d(this,l,Lt).call(this,!0),d(this,l,b).call(this,i)){if(i.__staleWhileFetching)return i.__staleWhileFetching}else if(i!==void 0)return i}}finally{if(t(this,j)&&t(this,L)){let i=t(this,L),s;for(;s=i?.shift();)(e=t(this,$))==null||e.call(this,...s);}}}has(e,i={}){let{updateAgeOnHas:s=this.updateAgeOnHas,status:r}=i,n=t(this,T).get(e);if(n!==void 0){let o=t(this,m)[n];if(d(this,l,b).call(this,o)&&o.__staleWhileFetching===void 0)return false;if(t(this,Y).call(this,n))r&&(r.has="stale",t(this,ot).call(this,r,n));else return s&&t(this,mt).call(this,n),r&&(r.has="hit",t(this,ot).call(this,r,n)),true}else r&&(r.has="miss");return false}peek(e,i={}){let{allowStale:s=this.allowStale}=i,r=t(this,T).get(e);if(r===void 0||!s&&t(this,Y).call(this,r))return;let n=t(this,m)[r];return d(this,l,b).call(this,n)?n.__staleWhileFetching:n}async fetch(e,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:c=this.noDisposeOnSet,size:p=0,sizeCalculation:v=this.sizeCalculation,noUpdateTTL:R=this.noUpdateTTL,noDeleteOnFetchRejection:S=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:rt=this.allowStaleOnFetchRejection,ignoreFetchAbort:I=this.ignoreFetchAbort,allowStaleOnFetchAbort:k=this.allowStaleOnFetchAbort,context:A,forceRefresh:y=false,status:a,signal:E}=i;if(!t(this,dt))return a&&(a.fetch="get"),this.get(e,{allowStale:s,updateAgeOnGet:r,noDeleteOnStaleGet:n,status:a});let O={allowStale:s,updateAgeOnGet:r,noDeleteOnStaleGet:n,ttl:o,noDisposeOnSet:c,size:p,sizeCalculation:v,noUpdateTTL:R,noDeleteOnFetchRejection:S,allowStaleOnFetchRejection:rt,allowStaleOnFetchAbort:k,ignoreFetchAbort:I,status:a,signal:E},f=t(this,T).get(e);if(f===void 0){a&&(a.fetch="miss");let g=d(this,l,Ct).call(this,e,f,O,A);return g.__returned=g}else {let g=t(this,m)[f];if(d(this,l,b).call(this,g)){let vt=s&&g.__staleWhileFetching!==void 0;return a&&(a.fetch="inflight",vt&&(a.returnedStale=true)),vt?g.__staleWhileFetching:g.__returned=g}let F=t(this,Y).call(this,f);if(!y&&!F)return a&&(a.fetch="hit"),d(this,l,At).call(this,f),r&&t(this,mt).call(this,f),a&&t(this,ot).call(this,a,f),g;let H=d(this,l,Ct).call(this,e,f,O,A),_t=H.__staleWhileFetching!==void 0&&s;return a&&(a.fetch=F?"stale":"refresh",_t&&F&&(a.returnedStale=true)),_t?H.__staleWhileFetching:H.__returned=H}}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=t(this,Et);if(!s)throw new Error("no memoMethod provided to constructor");let{context:r,forceRefresh:n,...o}=i,c=this.get(e,o);if(!n&&c!==void 0)return c;let p=s(e,c,{options:o,context:r});return this.set(e,p,o),p}get(e,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:o}=i,c=t(this,T).get(e);if(c!==void 0){let p=t(this,m)[c],v=d(this,l,b).call(this,p);return o&&t(this,ot).call(this,o,c),t(this,Y).call(this,c)?(o&&(o.get="stale"),v?(o&&s&&p.__staleWhileFetching!==void 0&&(o.returnedStale=true),s?p.__staleWhileFetching:void 0):(n||d(this,l,ct).call(this,e,"expire"),o&&s&&(o.returnedStale=true),s?p:void 0)):(o&&(o.get="hit"),v?p.__staleWhileFetching:(d(this,l,At).call(this,c),r&&t(this,mt).call(this,c),p))}else o&&(o.get="miss");}delete(e){return d(this,l,ct).call(this,e,"delete")}clear(){return d(this,l,Vt).call(this,"delete")}},K=new WeakMap,M=new WeakMap,q=new WeakMap,ft=new WeakMap,$=new WeakMap,yt=new WeakMap,Et=new WeakMap,B=new WeakMap,U=new WeakMap,X=new WeakMap,T=new WeakMap,w=new WeakMap,m=new WeakMap,P=new WeakMap,z=new WeakMap,N=new WeakMap,D=new WeakMap,J=new WeakMap,L=new WeakMap,Q=new WeakMap,Z=new WeakMap,V=new WeakMap,W=new WeakMap,tt=new WeakMap,dt=new WeakMap,j=new WeakMap,xt=new WeakMap,l=new WeakSet,It=function(){let e=new Dt(t(this,K)),i=new Dt(t(this,K));u(this,V,e),u(this,Z,i);let s=this.ttlAutopurge?new Array(t(this,K)):void 0;u(this,W,s),u(this,Ot,(c,p,v=t(this,B).now())=>{i[c]=p!==0?v:0,e[c]=p,r(c,p);}),u(this,mt,c=>{i[c]=e[c]!==0?t(this,B).now():0,r(c,e[c]);});let r=this.ttlAutopurge?(c,p)=>{if(s?.[c]&&(clearTimeout(s[c]),s[c]=void 0),p&&p!==0&&s){let v=setTimeout(()=>{t(this,Y).call(this,c)&&d(this,l,ct).call(this,t(this,w)[c],"expire");},p+1);v.unref&&v.unref(),s[c]=v;}}:()=>{};u(this,ot,(c,p)=>{if(e[p]){let v=e[p],R=i[p];if(!v||!R)return;c.ttl=v,c.start=R,c.now=n||o();let S=c.now-R;c.remainingTTL=v-S;}});let n=0,o=()=>{let c=t(this,B).now();if(this.ttlResolution>0){n=c;let p=setTimeout(()=>n=0,this.ttlResolution);p.unref&&p.unref();}return c};this.getRemainingTTL=c=>{let p=t(this,T).get(c);if(p===void 0)return 0;let v=e[p],R=i[p];if(!v||!R)return 1/0;let S=(n||o())-R;return v-S},u(this,Y,c=>{let p=i[c],v=e[c];return !!v&&!!p&&(n||o())-p>v});},mt=new WeakMap,ot=new WeakMap,Ot=new WeakMap,Y=new WeakMap,ne=function(){let e=new Dt(t(this,K));u(this,X,0),u(this,Q,e),u(this,gt,i=>{u(this,X,t(this,X)-e[i]),e[i]=0;}),u(this,Tt,(i,s,r,n)=>{if(d(this,l,b).call(this,s))return 0;if(!at(r))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(r=n(s,i),!at(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}),u(this,bt,(i,s,r)=>{if(e[i]=s,t(this,M)){let n=t(this,M)-e[i];for(;t(this,X)>n;)d(this,l,Lt).call(this,true);}u(this,X,t(this,X)+e[i]),r&&(r.entrySize=s,r.totalCalculatedSize=t(this,X));});},gt=new WeakMap,bt=new WeakMap,Tt=new WeakMap,lt=function*({allowStale:e=this.allowStale}={}){if(t(this,U))for(let i=t(this,D);!(!d(this,l,Mt).call(this,i)||((e||!t(this,Y).call(this,i))&&(yield i),i===t(this,N)));)i=t(this,z)[i];},ht=function*({allowStale:e=this.allowStale}={}){if(t(this,U))for(let i=t(this,N);!(!d(this,l,Mt).call(this,i)||((e||!t(this,Y).call(this,i))&&(yield i),i===t(this,D)));)i=t(this,P)[i];},Mt=function(e){return e!==void 0&&t(this,T).get(t(this,w)[e])===e},Lt=function(e){var n;let i=t(this,N),s=t(this,w)[i],r=t(this,m)[i];return t(this,dt)&&d(this,l,b).call(this,r)?r.__abortController.abort(new Error("evicted")):(t(this,tt)||t(this,j))&&(t(this,tt)&&((n=t(this,q))==null||n.call(this,r,s,"evict")),t(this,j)&&t(this,L)?.push([r,s,"evict"])),t(this,gt).call(this,i),t(this,W)?.[i]&&(clearTimeout(t(this,W)[i]),t(this,W)[i]=void 0),e&&(t(this,w)[i]=void 0,t(this,m)[i]=void 0,t(this,J).push(i)),t(this,U)===1?(u(this,N,u(this,D,0)),t(this,J).length=0):u(this,N,t(this,P)[i]),t(this,T).delete(s),Rt(this,U)._--,i},Ct=function(e,i,s,r){let n=i===void 0?void 0:t(this,m)[i];if(d(this,l,b).call(this,n))return n;let o=new Nt,{signal:c}=s;c?.addEventListener("abort",()=>o.abort(c.reason),{signal:o.signal});let p={signal:o.signal,options:s,context:r},v=(A,y=false)=>{let{aborted:a}=o.signal,E=s.ignoreFetchAbort&&A!==void 0,O=s.ignoreFetchAbort||!!(s.allowStaleOnFetchAbort&&A!==void 0);if(s.status&&(a&&!y?(s.status.fetchAborted=true,s.status.fetchError=o.signal.reason,E&&(s.status.fetchAbortIgnored=true)):s.status.fetchResolved=true),a&&!E&&!y)return S(o.signal.reason,O);let f=I,g=t(this,m)[i];return (g===I||E&&y&&g===void 0)&&(A===void 0?f.__staleWhileFetching!==void 0?t(this,m)[i]=f.__staleWhileFetching:d(this,l,ct).call(this,e,"fetch"):(s.status&&(s.status.fetchUpdated=true),this.set(e,A,p.options))),A},R=A=>(s.status&&(s.status.fetchRejected=true,s.status.fetchError=A),S(A,false)),S=(A,y)=>{let{aborted:a}=o.signal,E=a&&s.allowStaleOnFetchAbort,O=E||s.allowStaleOnFetchRejection,f=O||s.noDeleteOnFetchRejection,g=I;if(t(this,m)[i]===I&&(!f||!y&&g.__staleWhileFetching===void 0?d(this,l,ct).call(this,e,"fetch"):E||(t(this,m)[i]=g.__staleWhileFetching)),O)return s.status&&g.__staleWhileFetching!==void 0&&(s.status.returnedStale=true),g.__staleWhileFetching;if(g.__returned===g)throw A},rt=(A,y)=>{var E;let a=(E=t(this,yt))==null?void 0:E.call(this,e,n,p);a&&a instanceof Promise&&a.then(O=>A(O===void 0?void 0:O),y),o.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(A(void 0),s.allowStaleOnFetchAbort&&(A=O=>v(O,true)));});};s.status&&(s.status.fetchDispatched=true);let I=new Promise(rt).then(v,R),k=Object.assign(I,{__abortController:o,__staleWhileFetching:n,__returned:void 0});return i===void 0?(this.set(e,k,{...p.options,status:void 0}),i=t(this,T).get(e)):t(this,m)[i]=k,k},b=function(e){if(!t(this,dt))return false;let i=e;return !!i&&i instanceof Promise&&i.hasOwnProperty("__staleWhileFetching")&&i.__abortController instanceof Nt},zt=function(e,i){t(this,z)[i]=e,t(this,P)[e]=i;},At=function(e){e!==t(this,D)&&(e===t(this,N)?u(this,N,t(this,P)[e]):d(this,l,zt).call(this,t(this,z)[e],t(this,P)[e]),d(this,l,zt).call(this,t(this,D),e),u(this,D,e));},ct=function(e,i){var r,n;let s=false;if(t(this,U)!==0){let o=t(this,T).get(e);if(o!==void 0)if(t(this,W)?.[o]&&(clearTimeout(t(this,W)?.[o]),t(this,W)[o]=void 0),s=true,t(this,U)===1)d(this,l,Vt).call(this,i);else {t(this,gt).call(this,o);let c=t(this,m)[o];if(d(this,l,b).call(this,c)?c.__abortController.abort(new Error("deleted")):(t(this,tt)||t(this,j))&&(t(this,tt)&&((r=t(this,q))==null||r.call(this,c,e,i)),t(this,j)&&t(this,L)?.push([c,e,i])),t(this,T).delete(e),t(this,w)[o]=void 0,t(this,m)[o]=void 0,o===t(this,D))u(this,D,t(this,z)[o]);else if(o===t(this,N))u(this,N,t(this,P)[o]);else {let p=t(this,z)[o];t(this,P)[p]=t(this,P)[o];let v=t(this,P)[o];t(this,z)[v]=t(this,z)[o];}Rt(this,U)._--,t(this,J).push(o);}}if(t(this,j)&&t(this,L)?.length){let o=t(this,L),c;for(;c=o?.shift();)(n=t(this,$))==null||n.call(this,...c);}return s},Vt=function(e){var i,s;for(let r of d(this,l,ht).call(this,{allowStale:true})){let n=t(this,m)[r];if(d(this,l,b).call(this,n))n.__abortController.abort(new Error("deleted"));else {let o=t(this,w)[r];t(this,tt)&&((i=t(this,q))==null||i.call(this,n,o,e)),t(this,j)&&t(this,L)?.push([n,o,e]);}}if(t(this,T).clear(),t(this,m).fill(void 0),t(this,w).fill(void 0),t(this,V)&&t(this,Z)){t(this,V).fill(0),t(this,Z).fill(0);for(let r of t(this,W)??[])r!==void 0&&clearTimeout(r);t(this,W)?.fill(void 0);}if(t(this,Q)&&t(this,Q).fill(0),u(this,N,0),u(this,D,0),t(this,J).length=0,u(this,X,0),u(this,U,0),t(this,j)&&t(this,L)){let r=t(this,L),n;for(;n=r?.shift();)(s=t(this,$))==null||s.call(this,...n);}},wt);var Ft=class{constructor(e){x(this,"cache");x(this,"map",new Map);this.cache=new oe({max:e.cacheSize}),this.map=new Map;}get[Symbol.iterator](){return this.map[Symbol.iterator]}get[Symbol.toStringTag](){return this.map[Symbol.toStringTag]}clear(){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 Ut="1.8.4";var Wt={version:Ut};var Yt="repeat";function Ht(h){return {type:"pause",duration:h}}var Kt="__game_layer__";var ve={CURRENT_DIALOGUE_MEMORY_KEY:"dialogue",LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY:"dialogue:step_counter",CURRENT_MENU_OPTIONS_MEMORY_KEY:"choice:options",LAST_MENU_OPTIONS_ADDED_IN_STEP_MEMORY_KEY:"choice:step_counter",CURRENT_INPUT_VALUE_MEMORY_KEY:"input:value",LAST_INPUT_ADDED_IN_STEP_MEMORY_KEY:"input:step_counter",CURRENT_INPUT_INFO_MEMORY_KEY:"input:info",CHARACTER_CATEGORY_KEY:"character",ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY:"___glue___",OPENED_LABELS_COUNTER_KEY:"label:opened",ALL_CHOICES_MADE_KEY:"choices:made",CURRENT_STEP_TIMES_COUNTER_KEY:"label:history",LAST_STEP_GLUED:"glue:last_step"};var le={};var kt={};fe(kt,{createExportableElement:()=>he});var pt;(r=>(r.log=(n,...o)=>console.log(`[Pixi\u2019VN] ${n}`,...o),r.warn=(n,...o)=>console.warn(`[Pixi\u2019VN] ${n}`,...o),r.error=(n,...o)=>console.error(`[Pixi\u2019VN] ${n}`,...o),r.info=(n,...o)=>console.info(`[Pixi\u2019VN] ${n}`,...o)))(pt||(pt={}));function he(h){try{if(typeof h>"u")return h;let e=JSON.stringify(h);return JSON.parse(e)}catch(e){throw pt.error("Error creating exportable element",h,e),new core.PixiError("not_json_serializable","Error creating exportable element")}}var ye=typeof window<"u"&&typeof document<"u",ce=[" _______ _ _ _ ____ ____ ____ _____ ","|_ __ \\ (_) (_) | | |_ _| |_ _||_ \\|_ _|"," | |__) |__ _ __ __ \\_| \\ \\ / / | \\ | | "," | ___/[ | [ \\ [ ][ | \\ \\ / / | |\\ \\| | "," _| |_ | | > ' < | | \\ ' / _| |_\\ |_ ",`|_____| [___][__]\`\\_][___] \\_/ |_____|\\____| v${Wt.version}`],de=31,Ee="background:#2f90da;color:#fff;font-weight:bold;",xe="background:#c832bb;color:#fff;font-weight:bold;",be="background:transparent;font-weight:bold;",qt=` v${Wt.version}`;function pe(){if(!ye)return;let h=[],e=[];for(let i=0;i<ce.length;i++){let s=ce[i],r=s.endsWith(qt),n=r?s.slice(0,-qt.length):s,o=n.slice(0,de),c=n.slice(de),p=r?"%c%s%c%s%c%s":"%c%s%c%s";h.push(p),e.push(Ee,o,xe,c),r&&e.push(be,qt);}console.info(h.join(`
|
|
2
|
-
`),...
|
|
1
|
+
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var T=require('@drincs/pixi-vn/canvas'),$=require('@drincs/pixi-vn/characters'),core=require('@drincs/pixi-vn/core'),A=require('@drincs/pixi-vn/history'),S=require('@drincs/pixi-vn/narration'),D=require('@drincs/pixi-vn/sound'),x=require('@drincs/pixi-vn/storage'),motion=require('@drincs/pixi-vn/motion');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var T__namespace=/*#__PURE__*/_interopNamespace(T);var $__namespace=/*#__PURE__*/_interopNamespace($);var A__namespace=/*#__PURE__*/_interopNamespace(A);var S__namespace=/*#__PURE__*/_interopNamespace(S);var D__namespace=/*#__PURE__*/_interopNamespace(D);var x__namespace=/*#__PURE__*/_interopNamespace(x);var lt=Object.defineProperty;var ht=(c,t)=>{for(var e in t)lt(c,e,{get:t[e],enumerable:true});};var ct=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,X=new Set,z=typeof process=="object"&&process?process:{},J=(c,t,e,i)=>{typeof z.emitWarning=="function"?z.emitWarning(c,t,e,i):console.error(`[${e}] ${t}: ${c}`);},G=globalThis.AbortController,B=globalThis.AbortSignal;if(typeof G>"u"){B=class{onabort;_onabort=[];reason;aborted=false;addEventListener(e,i){this._onabort.push(i);}},G=class{constructor(){t();}signal=new B;abort(e){if(!this.signal.aborted){this.signal.reason=e,this.signal.aborted=true;for(let i of this.signal._onabort)i(e);this.signal.onabort?.(e);}}};let c=z.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",t=()=>{c&&(c=false,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));};}var dt=c=>!X.has(c);var R=c=>c&&c===Math.floor(c)&&c>0&&isFinite(c),Q=c=>R(c)?c<=Math.pow(2,8)?Uint8Array:c<=Math.pow(2,16)?Uint16Array:c<=Math.pow(2,32)?Uint32Array:c<=Number.MAX_SAFE_INTEGER?j:null:null,j=class extends Array{constructor(c){super(c),this.fill(0);}},pt=class F{heap;length;static#a=false;static create(t){let e=Q(t);if(!e)return [];F.#a=true;let i=new F(t,e);return F.#a=false,i}constructor(t,e){if(!F.#a)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]}},Z=class tt{#a;#d;#g;#R;#_;#N;#F;#v;get perf(){return this.#v}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#r;#S;#s;#i;#t;#h;#p;#l;#o;#y;#n;#E;#x;#u;#f;#b;#U;#c;#P;static unsafeExposeInternals(t){return {starts:t.#x,ttls:t.#u,autopurgeTimers:t.#f,sizes:t.#E,keyMap:t.#s,keyList:t.#i,valList:t.#t,next:t.#h,prev:t.#p,get head(){return t.#l},get tail(){return t.#o},free:t.#y,isBackgroundFetch:e=>t.#e(e),backgroundFetch:(e,i,s,r)=>t.#I(e,i,s,r),moveToTail:e=>t.#C(e),indexes:e=>t.#w(e),rindexes:e=>t.#A(e),isStale:e=>t.#m(e)}}get max(){return this.#a}get maxSize(){return this.#d}get calculatedSize(){return this.#S}get size(){return this.#r}get fetchMethod(){return this.#N}get memoMethod(){return this.#F}get dispose(){return this.#g}get onInsert(){return this.#R}get disposeAfter(){return this.#_}constructor(t){let{max:e=0,ttl:i,ttlResolution:s=1,ttlAutopurge:r,updateAgeOnGet:n,updateAgeOnHas:a,allowStale:l,dispose:p,onInsert:v,disposeAfter:u,noDisposeOnSet:m,noUpdateTTL:g,maxSize:U=0,maxEntrySize:_=0,sizeCalculation:b,fetchMethod:o,memoMethod:f,noDeleteOnFetchRejection:y,noDeleteOnStaleGet:h,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:E,ignoreFetchAbort:w,perf:C}=t;if(C!==void 0&&typeof C?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#v=C??ct,e!==0&&!R(e))throw new TypeError("max option must be a nonnegative integer");let N=e?Q(e):Array;if(!N)throw new Error("invalid max value: "+e);if(this.#a=e,this.#d=U,this.maxEntrySize=_||this.#d,this.sizeCalculation=b,this.sizeCalculation){if(!this.#d&&!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(f!==void 0&&typeof f!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#F=f,o!==void 0&&typeof o!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#N=o,this.#U=!!o,this.#s=new Map,this.#i=new Array(e).fill(void 0),this.#t=new Array(e).fill(void 0),this.#h=new N(e),this.#p=new N(e),this.#l=0,this.#o=0,this.#y=pt.create(e),this.#r=0,this.#S=0,typeof p=="function"&&(this.#g=p),typeof v=="function"&&(this.#R=v),typeof u=="function"?(this.#_=u,this.#n=[]):(this.#_=void 0,this.#n=void 0),this.#b=!!this.#g,this.#P=!!this.#R,this.#c=!!this.#_,this.noDisposeOnSet=!!m,this.noUpdateTTL=!!g,this.noDeleteOnFetchRejection=!!y,this.allowStaleOnFetchRejection=!!d,this.allowStaleOnFetchAbort=!!E,this.ignoreFetchAbort=!!w,this.maxEntrySize!==0){if(this.#d!==0&&!R(this.#d))throw new TypeError("maxSize must be a positive integer if specified");if(!R(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#K();}if(this.allowStale=!!l,this.noDeleteOnStaleGet=!!h,this.updateAgeOnGet=!!n,this.updateAgeOnHas=!!a,this.ttlResolution=R(s)||s===0?s:1,this.ttlAutopurge=!!r,this.ttl=i||0,this.ttl){if(!R(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#M();}if(this.#a===0&&this.ttl===0&&this.#d===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#a&&!this.#d){let M="LRU_CACHE_UNBOUNDED";dt(M)&&(X.add(M),J("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",M,tt));}}getRemainingTTL(t){return this.#s.has(t)?1/0:0}#M(){let t=new j(this.#a),e=new j(this.#a);this.#u=t,this.#x=e;let i=this.ttlAutopurge?new Array(this.#a):void 0;this.#f=i,this.#z=(a,l,p=this.#v.now())=>{e[a]=l!==0?p:0,t[a]=l,s(a,l);},this.#D=a=>{e[a]=t[a]!==0?this.#v.now():0,s(a,t[a]);};let s=this.ttlAutopurge?(a,l)=>{if(i?.[a]&&(clearTimeout(i[a]),i[a]=void 0),l&&l!==0&&i){let p=setTimeout(()=>{this.#m(a)&&this.#O(this.#i[a],"expire");},l+1);p.unref&&p.unref(),i[a]=p;}}:()=>{};this.#T=(a,l)=>{if(t[l]){let p=t[l],v=e[l];if(!p||!v)return;a.ttl=p,a.start=v,a.now=r||n();let u=a.now-v;a.remainingTTL=p-u;}};let r=0,n=()=>{let a=this.#v.now();if(this.ttlResolution>0){r=a;let l=setTimeout(()=>r=0,this.ttlResolution);l.unref&&l.unref();}return a};this.getRemainingTTL=a=>{let l=this.#s.get(a);if(l===void 0)return 0;let p=t[l],v=e[l];if(!p||!v)return 1/0;let u=(r||n())-v;return p-u},this.#m=a=>{let l=e[a],p=t[a];return !!p&&!!l&&(r||n())-l>p};}#D=()=>{};#T=()=>{};#z=()=>{};#m=()=>false;#K(){let t=new j(this.#a);this.#S=0,this.#E=t,this.#L=e=>{this.#S-=t[e],t[e]=0;},this.#V=(e,i,s,r)=>{if(this.#e(i))return 0;if(!R(s))if(r){if(typeof r!="function")throw new TypeError("sizeCalculation must be a function");if(s=r(i,e),!R(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.#j=(e,i,s)=>{if(t[e]=i,this.#d){let r=this.#d-t[e];for(;this.#S>r;)this.#G(true);}this.#S+=t[e],s&&(s.entrySize=i,s.totalCalculatedSize=this.#S);};}#L=t=>{};#j=(t,e,i)=>{};#V=(t,e,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#w({allowStale:t=this.allowStale}={}){if(this.#r)for(let e=this.#o;!(!this.#W(e)||((t||!this.#m(e))&&(yield e),e===this.#l));)e=this.#p[e];}*#A({allowStale:t=this.allowStale}={}){if(this.#r)for(let e=this.#l;!(!this.#W(e)||((t||!this.#m(e))&&(yield e),e===this.#o));)e=this.#h[e];}#W(t){return t!==void 0&&this.#s.get(this.#i[t])===t}*entries(){for(let t of this.#w())this.#t[t]!==void 0&&this.#i[t]!==void 0&&!this.#e(this.#t[t])&&(yield [this.#i[t],this.#t[t]]);}*rentries(){for(let t of this.#A())this.#t[t]!==void 0&&this.#i[t]!==void 0&&!this.#e(this.#t[t])&&(yield [this.#i[t],this.#t[t]]);}*keys(){for(let t of this.#w()){let e=this.#i[t];e!==void 0&&!this.#e(this.#t[t])&&(yield e);}}*rkeys(){for(let t of this.#A()){let e=this.#i[t];e!==void 0&&!this.#e(this.#t[t])&&(yield e);}}*values(){for(let t of this.#w())this.#t[t]!==void 0&&!this.#e(this.#t[t])&&(yield this.#t[t]);}*rvalues(){for(let t of this.#A())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(let i of this.#w()){let 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(let i of this.#w()){let 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(let i of this.#A()){let 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=false;for(let e of this.#A({allowStale:true}))this.#m(e)&&(this.#O(this.#i[e],"expire"),t=true);return t}info(t){let e=this.#s.get(t);if(e===void 0)return;let i=this.#t[e],s=this.#e(i)?i.__staleWhileFetching:i;if(s===void 0)return;let r={value:s};if(this.#u&&this.#x){let n=this.#u[e],a=this.#x[e];if(n&&a){let l=n-(this.#v.now()-a);r.ttl=l,r.start=Date.now();}}return this.#E&&(r.size=this.#E[e]),r}dump(){let t=[];for(let e of this.#w({allowStale:true})){let i=this.#i[e],s=this.#t[e],r=this.#e(s)?s.__staleWhileFetching:s;if(r===void 0||i===void 0)continue;let n={value:r};if(this.#u&&this.#x){n.ttl=this.#u[e];let a=this.#v.now()-this.#x[e];n.start=Math.floor(Date.now()-a);}this.#E&&(n.size=this.#E[e]),t.unshift([i,n]);}return t}load(t){this.clear();for(let[e,i]of t){if(i.start){let s=Date.now()-i.start;i.start=this.#v.now()-s;}this.set(e,i.value,i);}}set(t,e,i={}){if(e===void 0)return this.delete(t),this;let{ttl:s=this.ttl,start:r,noDisposeOnSet:n=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:l}=i,{noUpdateTTL:p=this.noUpdateTTL}=i,v=this.#V(t,e,i.size||0,a);if(this.maxEntrySize&&v>this.maxEntrySize)return l&&(l.set="miss",l.maxEntrySizeExceeded=true),this.#O(t,"set"),this;let u=this.#r===0?void 0:this.#s.get(t);if(u===void 0)u=this.#r===0?this.#o:this.#y.length!==0?this.#y.pop():this.#r===this.#a?this.#G(false):this.#r,this.#i[u]=t,this.#t[u]=e,this.#s.set(t,u),this.#h[this.#o]=u,this.#p[u]=this.#o,this.#o=u,this.#r++,this.#j(u,v,l),l&&(l.set="add"),p=false,this.#P&&this.#R?.(e,t,"add");else {this.#C(u);let m=this.#t[u];if(e!==m){if(this.#U&&this.#e(m)){m.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:g}=m;g!==void 0&&!n&&(this.#b&&this.#g?.(g,t,"set"),this.#c&&this.#n?.push([g,t,"set"]));}else n||(this.#b&&this.#g?.(m,t,"set"),this.#c&&this.#n?.push([m,t,"set"]));if(this.#L(u),this.#j(u,v,l),this.#t[u]=e,l){l.set="replace";let g=m&&this.#e(m)?m.__staleWhileFetching:m;g!==void 0&&(l.oldValue=g);}}else l&&(l.set="update");this.#P&&this.onInsert?.(e,t,e===m?"update":"replace");}if(s!==0&&!this.#u&&this.#M(),this.#u&&(p||this.#z(u,s,r),l&&this.#T(l,u)),!n&&this.#c&&this.#n){let m=this.#n,g;for(;g=m?.shift();)this.#_?.(...g);}return this}pop(){try{for(;this.#r;){let t=this.#t[this.#l];if(this.#G(!0),this.#e(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(this.#c&&this.#n){let t=this.#n,e;for(;e=t?.shift();)this.#_?.(...e);}}}#G(t){let e=this.#l,i=this.#i[e],s=this.#t[e];return this.#U&&this.#e(s)?s.__abortController.abort(new Error("evicted")):(this.#b||this.#c)&&(this.#b&&this.#g?.(s,i,"evict"),this.#c&&this.#n?.push([s,i,"evict"])),this.#L(e),this.#f?.[e]&&(clearTimeout(this.#f[e]),this.#f[e]=void 0),t&&(this.#i[e]=void 0,this.#t[e]=void 0,this.#y.push(e)),this.#r===1?(this.#l=this.#o=0,this.#y.length=0):this.#l=this.#h[e],this.#s.delete(i),this.#r--,e}has(t,e={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=e,r=this.#s.get(t);if(r!==void 0){let n=this.#t[r];if(this.#e(n)&&n.__staleWhileFetching===void 0)return false;if(this.#m(r))s&&(s.has="stale",this.#T(s,r));else return i&&this.#D(r),s&&(s.has="hit",this.#T(s,r)),true}else s&&(s.has="miss");return false}peek(t,e={}){let{allowStale:i=this.allowStale}=e,s=this.#s.get(t);if(s===void 0||!i&&this.#m(s))return;let r=this.#t[s];return this.#e(r)?r.__staleWhileFetching:r}#I(t,e,i,s){let r=e===void 0?void 0:this.#t[e];if(this.#e(r))return r;let n=new G,{signal:a}=i;a?.addEventListener("abort",()=>n.abort(a.reason),{signal:n.signal});let l={signal:n.signal,options:i,context:s},p=(_,b=false)=>{let{aborted:o}=n.signal,f=i.ignoreFetchAbort&&_!==void 0,y=i.ignoreFetchAbort||!!(i.allowStaleOnFetchAbort&&_!==void 0);if(i.status&&(o&&!b?(i.status.fetchAborted=true,i.status.fetchError=n.signal.reason,f&&(i.status.fetchAbortIgnored=true)):i.status.fetchResolved=true),o&&!f&&!b)return u(n.signal.reason,y);let h=g,d=this.#t[e];return (d===g||f&&b&&d===void 0)&&(_===void 0?h.__staleWhileFetching!==void 0?this.#t[e]=h.__staleWhileFetching:this.#O(t,"fetch"):(i.status&&(i.status.fetchUpdated=true),this.set(t,_,l.options))),_},v=_=>(i.status&&(i.status.fetchRejected=true,i.status.fetchError=_),u(_,false)),u=(_,b)=>{let{aborted:o}=n.signal,f=o&&i.allowStaleOnFetchAbort,y=f||i.allowStaleOnFetchRejection,h=y||i.noDeleteOnFetchRejection,d=g;if(this.#t[e]===g&&(!h||!b&&d.__staleWhileFetching===void 0?this.#O(t,"fetch"):f||(this.#t[e]=d.__staleWhileFetching)),y)return i.status&&d.__staleWhileFetching!==void 0&&(i.status.returnedStale=true),d.__staleWhileFetching;if(d.__returned===d)throw _},m=(_,b)=>{let o=this.#N?.(t,r,l);o&&o instanceof Promise&&o.then(f=>_(f===void 0?void 0:f),b),n.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(_(void 0),i.allowStaleOnFetchAbort&&(_=f=>p(f,true)));});};i.status&&(i.status.fetchDispatched=true);let g=new Promise(m).then(p,v),U=Object.assign(g,{__abortController:n,__staleWhileFetching:r,__returned:void 0});return e===void 0?(this.set(t,U,{...l.options,status:void 0}),e=this.#s.get(t)):this.#t[e]=U,U}#e(t){if(!this.#U)return false;let e=t;return !!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof G}async fetch(t,e={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,ttl:n=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:l=0,sizeCalculation:p=this.sizeCalculation,noUpdateTTL:v=this.noUpdateTTL,noDeleteOnFetchRejection:u=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:m=this.allowStaleOnFetchRejection,ignoreFetchAbort:g=this.ignoreFetchAbort,allowStaleOnFetchAbort:U=this.allowStaleOnFetchAbort,context:_,forceRefresh:b=false,status:o,signal:f}=e;if(!this.#U)return o&&(o.fetch="get"),this.get(t,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:r,status:o});let y={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:r,ttl:n,noDisposeOnSet:a,size:l,sizeCalculation:p,noUpdateTTL:v,noDeleteOnFetchRejection:u,allowStaleOnFetchRejection:m,allowStaleOnFetchAbort:U,ignoreFetchAbort:g,status:o,signal:f},h=this.#s.get(t);if(h===void 0){o&&(o.fetch="miss");let d=this.#I(t,h,y,_);return d.__returned=d}else {let d=this.#t[h];if(this.#e(d)){let N=i&&d.__staleWhileFetching!==void 0;return o&&(o.fetch="inflight",N&&(o.returnedStale=true)),N?d.__staleWhileFetching:d.__returned=d}let E=this.#m(h);if(!b&&!E)return o&&(o.fetch="hit"),this.#C(h),s&&this.#D(h),o&&this.#T(o,h),d;let w=this.#I(t,h,y,_),C=w.__staleWhileFetching!==void 0&&i;return o&&(o.fetch=E?"stale":"refresh",C&&E&&(o.returnedStale=true)),C?w.__staleWhileFetching:w.__returned=w}}async forceFetch(t,e={}){let i=await this.fetch(t,e);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(t,e={}){let i=this.#F;if(!i)throw new Error("no memoMethod provided to constructor");let{context:s,forceRefresh:r,...n}=e,a=this.get(t,n);if(!r&&a!==void 0)return a;let l=i(t,a,{options:n,context:s});return this.set(t,l,n),l}get(t,e={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,status:n}=e,a=this.#s.get(t);if(a!==void 0){let l=this.#t[a],p=this.#e(l);return n&&this.#T(n,a),this.#m(a)?(n&&(n.get="stale"),p?(n&&i&&l.__staleWhileFetching!==void 0&&(n.returnedStale=true),i?l.__staleWhileFetching:void 0):(r||this.#O(t,"expire"),n&&i&&(n.returnedStale=true),i?l:void 0)):(n&&(n.get="hit"),p?l.__staleWhileFetching:(this.#C(a),s&&this.#D(a),l))}else n&&(n.get="miss");}#Y(t,e){this.#p[e]=t,this.#h[t]=e;}#C(t){t!==this.#o&&(t===this.#l?this.#l=this.#h[t]:this.#Y(this.#p[t],this.#h[t]),this.#Y(this.#o,t),this.#o=t);}delete(t){return this.#O(t,"delete")}#O(t,e){let i=false;if(this.#r!==0){let s=this.#s.get(t);if(s!==void 0)if(this.#f?.[s]&&(clearTimeout(this.#f?.[s]),this.#f[s]=void 0),i=true,this.#r===1)this.#H(e);else {this.#L(s);let r=this.#t[s];if(this.#e(r)?r.__abortController.abort(new Error("deleted")):(this.#b||this.#c)&&(this.#b&&this.#g?.(r,t,e),this.#c&&this.#n?.push([r,t,e])),this.#s.delete(t),this.#i[s]=void 0,this.#t[s]=void 0,s===this.#o)this.#o=this.#p[s];else if(s===this.#l)this.#l=this.#h[s];else {let n=this.#p[s];this.#h[n]=this.#h[s];let a=this.#h[s];this.#p[a]=this.#p[s];}this.#r--,this.#y.push(s);}}if(this.#c&&this.#n?.length){let s=this.#n,r;for(;r=s?.shift();)this.#_?.(...r);}return i}clear(){return this.#H("delete")}#H(t){for(let e of this.#A({allowStale:true})){let i=this.#t[e];if(this.#e(i))i.__abortController.abort(new Error("deleted"));else {let s=this.#i[e];this.#b&&this.#g?.(i,s,t),this.#c&&this.#n?.push([i,s,t]);}}if(this.#s.clear(),this.#t.fill(void 0),this.#i.fill(void 0),this.#u&&this.#x){this.#u.fill(0),this.#x.fill(0);for(let e of this.#f??[])e!==void 0&&clearTimeout(e);this.#f?.fill(void 0);}if(this.#E&&this.#E.fill(0),this.#l=0,this.#o=0,this.#y.length=0,this.#S=0,this.#r=0,this.#c&&this.#n){let e=this.#n,i;for(;i=e?.shift();)this.#_?.(...i);}}};var I=class{cache;map=new Map;constructor(t){this.cache=new Z({max:t.cacheSize}),this.map=new Map;}get[Symbol.iterator](){return this.map[Symbol.iterator]}get[Symbol.toStringTag](){return this.map[Symbol.toStringTag]}clear(){this.cache.clear(),this.map.clear();}delete(t){let e=this.map.delete(t);return e&&this.cache.delete(t),e}get forEach(){return this.map.forEach}get(t){let e=this.cache.get(t);return e||this.map.get(t)}has(t){return this.map.has(t)}set(t,e){return this.map.set(t,e),this.cache.set(t,e),this}get size(){return this.map.size}entries(){return this.map.entries()}keys(){return this.map.keys()}values(){return this.map.values()}};var P="1.8.5";var V={version:P};var W="repeat";function Y(c){return {type:"pause",duration:c}}var H="__game_layer__";var ut={CURRENT_DIALOGUE_MEMORY_KEY:"dialogue",LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY:"dialogue:step_counter",CURRENT_MENU_OPTIONS_MEMORY_KEY:"choice:options",LAST_MENU_OPTIONS_ADDED_IN_STEP_MEMORY_KEY:"choice:step_counter",CURRENT_INPUT_VALUE_MEMORY_KEY:"input:value",LAST_INPUT_ADDED_IN_STEP_MEMORY_KEY:"input:step_counter",CURRENT_INPUT_INFO_MEMORY_KEY:"input:info",CHARACTER_CATEGORY_KEY:"character",ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY:"___glue___",OPENED_LABELS_COUNTER_KEY:"label:opened",ALL_CHOICES_MADE_KEY:"choices:made",CURRENT_STEP_TIMES_COUNTER_KEY:"label:history",LAST_STEP_GLUED:"glue:last_step"};var it={};var K={};ht(K,{createExportableElement:()=>st});var L;(s=>(s.log=(r,...n)=>console.log(`[Pixi\u2019VN] ${r}`,...n),s.warn=(r,...n)=>console.warn(`[Pixi\u2019VN] ${r}`,...n),s.error=(r,...n)=>console.error(`[Pixi\u2019VN] ${r}`,...n),s.info=(r,...n)=>console.info(`[Pixi\u2019VN] ${r}`,...n)))(L||={});function st(c){try{if(typeof c>"u")return c;let t=JSON.stringify(c);return JSON.parse(t)}catch(t){throw L.error("Error creating exportable element",c,t),new core.PixiError("not_json_serializable","Error creating exportable element")}}var mt=typeof window<"u"&&typeof document<"u",rt=[" _______ _ _ _ ____ ____ ____ _____ ","|_ __ \\ (_) (_) | | |_ _| |_ _||_ \\|_ _|"," | |__) |__ _ __ __ \\_| \\ \\ / / | \\ | | "," | ___/[ | [ \\ [ ][ | \\ \\ / / | |\\ \\| | "," _| |_ | | > ' < | | \\ ' / _| |_\\ |_ ",`|_____| [___][__]\`\\_][___] \\_/ |_____|\\____| v${V.version}`],ot=31,gt="background:#2f90da;color:#fff;font-weight:bold;",_t="background:#c832bb;color:#fff;font-weight:bold;",vt="background:transparent;font-weight:bold;",k=` v${V.version}`;function nt(){if(!mt)return;let c=[],t=[];for(let e=0;e<rt.length;e++){let i=rt[e],s=i.endsWith(k),r=s?i.slice(0,-k.length):i,n=r.slice(0,ot),a=r.slice(ot),l=s?"%c%s%c%s%c%s":"%c%s%c%s";c.push(l),t.push(gt,n,_t,a),s&&t.push(vt,k);}console.info(c.join(`
|
|
2
|
+
`),...t);}function q(){let c=window.location.pathname+window.location.hash;return c.includes("#")&&(c=c.split("#")[1]),c}nt();exports.Game=void 0;(b=>{async function c(o,f,y){if(core.GameUnifier.init({navigate:f?.navigate,getCurrentGameStepState:()=>{let h={};try{h=T__namespace.canvas.export();}catch{}return {path:q(),storage:x__namespace.storage.export(),canvas:h,sound:D__namespace.sound.export(),labelIndex:S__namespace.NarrationManagerStatic.currentLabelStepIndex||0,openedLabels:S__namespace.narration.openedLabels}},restoreGameStepState:async(h,d)=>{A__namespace.HistoryManagerStatic._originalStepData=h,S__namespace.NarrationManagerStatic.openedLabels=h.openedLabels,x__namespace.storage.restore(h.storage);try{await T__namespace.canvas.restore(h.canvas),await D__namespace.sound.restore(h.sound);}catch(E){L.error("Error restoring game step state:",E);}await d(h.path);},getStepCounter:()=>S__namespace.narration.stepCounter,setStepCounter:h=>{S__namespace.NarrationManagerStatic._stepCounter=h;},getOpenedLabels:()=>S__namespace.narration.openedLabels.length,addHistoryItem:(h,d)=>A__namespace.stepHistory.add(h,d),getCharacter:h=>$__namespace.RegisteredCharacters.get(h),processNavigationRequests:(h,d)=>{let E=h,w=Promise.resolve();return h>0?(E--,w=S__namespace.narration.continue(d)):h<0&&(E=0,w=A__namespace.stepHistory.back(d,{steps:h*-1})),{newValue:E,result:w}},animate:(h,d,E,w)=>motion.motion.animate(h,d,E,w),getVariable:(h,d)=>x__namespace.StorageRegistry.getVariable(h,d),setVariable:(h,d,E)=>x__namespace.StorageRegistry.setVariable(h,d,E),removeVariable:(h,d)=>x__namespace.StorageRegistry.removeVariable(h,d),getFlag:h=>x__namespace.storage.getFlag(h),setFlag:(h,d)=>x__namespace.storage.setFlag(h,d),onLabelClosing:h=>x__namespace.StorageRegistry.clearOldTempVariables(h)}),!o||!f){L.warn("The canvas element or options are not defined. The canvas will not be initialized.");return}return await T__namespace.canvas.init(o,f,y)}b.init=c;function t(){x__namespace.storage.clear();try{T__namespace.canvas.clear();}catch{}D__namespace.sound.clear(),S__namespace.narration.clear(),A__namespace.stepHistory.clear();}b.clear=t;function e(){let o={};try{o=T__namespace.canvas.export();}catch{}return {pixivn_version:P,stepData:S__namespace.narration.export(),storageData:x__namespace.storage.export(),canvasData:o,soundData:D__namespace.sound.export(),historyData:A__namespace.stepHistory.export(),path:q()}}b.exportGameState=e;async function i(o,f){A__namespace.stepHistory.restore(o.historyData);let y=A__namespace.stepHistory.lastKey;if(typeof y=="number"){let h=A__namespace.stepHistory.stepsInfoMap.get(y)||null;await S__namespace.narration.restore(o.stepData,h);}x__namespace.storage.restore(o.storageData);try{await T__namespace.canvas.restore(o.canvasData),await D__namespace.sound.restore(o.soundData);}catch{}f?await f(o.path):await core.GameUnifier.navigate(o.path);}b.restoreGameState=i;async function s(o,f){return b.clear(),await S__namespace.narration.call(o,f)}b.start=s;function r(o){return JSON.parse(o)}b.jsonToGameState=r;function n(o){core.GameUnifier.onEnd=o;}b.onEnd=n;function a(o){return L.warn("Game.onError is deprecated. Use Game.addOnError / Game.removeOnError to register multiple handlers."),core.GameUnifier.addOnError((f,y)=>o("step",f,y))}b.onError=a;function l(o){return core.GameUnifier.addOnError(o)}b.addOnError=l;function p(o){return core.GameUnifier.removeOnError(o)}b.removeOnError=p;function v(o){S__namespace.NarrationManagerStatic.onStepStart=o;}b.onStepStart=v;function u(o){S__namespace.NarrationManagerStatic.onLoadingLabel=o;}b.onLoadingLabel=u;function m(o){S__namespace.NarrationManagerStatic.onStepEnd=o;}b.onStepEnd=m;function g(o){core.GameUnifier.navigate=o;}b.onNavigate=g;function U(o){return core.GameUnifier.addOnPreContinue(o)}b.addOnPreContinue=U;function _(o){return core.GameUnifier.removeOnPreContinue(o)}b.removeOnPreContinue=_;})(exports.Game||={});var qt={characterUtils:$__namespace,canvasUtils:T__namespace,narrationUtils:S__namespace,soundUtils:D__namespace,CANVAS_APP_GAME_LAYER_ALIAS:H,Pause:Y,Repeat:W,PIXIVN_VERSION:P,...K,...it,canvas:T__namespace.canvas,narration:S__namespace.narration,sound:D__namespace.sound,storage:x__namespace.storage,history:A__namespace.stepHistory,Game:exports.Game,GameUnifier:core.GameUnifier};exports.CANVAS_APP_GAME_LAYER_ALIAS=H;exports.CachedMap=I;exports.PIXIVN_VERSION=P;exports.Pause=Y;exports.Repeat=W;exports.SYSTEM_RESERVED_STORAGE_KEYS=ut;exports.createExportableElement=st;exports.default=qt;Object.keys(T).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return T[k]}})});Object.keys($).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return $[k]}})});Object.keys(core).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return core[k]}})});Object.keys(A).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return A[k]}})});Object.keys(S).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return S[k]}})});Object.keys(D).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return D[k]}})});Object.keys(x).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return x[k]}})});
|