@drincs/pixi-vn 1.1.2 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/dist/canvas/CanvasManager.cjs +1 -1
  2. package/dist/canvas/CanvasManager.js +1 -1
  3. package/dist/canvas/CanvasManagerStatic.cjs +1 -1
  4. package/dist/canvas/CanvasManagerStatic.js +1 -1
  5. package/dist/canvas/components/Container.cjs +1 -1
  6. package/dist/canvas/components/Container.js +1 -1
  7. package/dist/canvas/components/ImageContainer.cjs +1 -1
  8. package/dist/canvas/components/ImageContainer.js +1 -1
  9. package/dist/canvas/components/ImageSprite.cjs +2 -2
  10. package/dist/canvas/components/ImageSprite.js +2 -2
  11. package/dist/canvas/components/Sprite.cjs +1 -1
  12. package/dist/canvas/components/Sprite.js +1 -1
  13. package/dist/canvas/components/Text.cjs +1 -1
  14. package/dist/canvas/components/Text.js +1 -1
  15. package/dist/canvas/components/VideoSprite.cjs +2 -2
  16. package/dist/canvas/components/VideoSprite.js +2 -2
  17. package/dist/canvas/decorators/canvas-element-decorator.cjs +1 -1
  18. package/dist/canvas/decorators/canvas-element-decorator.js +1 -1
  19. package/dist/canvas/decorators/event-decorator.cjs +1 -1
  20. package/dist/canvas/decorators/event-decorator.js +1 -1
  21. package/dist/canvas/functions/canvas-effect.cjs +1 -1
  22. package/dist/canvas/functions/canvas-effect.js +1 -1
  23. package/dist/canvas/functions/canvas-import-utility.cjs +1 -1
  24. package/dist/canvas/functions/canvas-import-utility.js +1 -1
  25. package/dist/canvas/functions/canvas-transition.cjs +1 -1
  26. package/dist/canvas/functions/canvas-transition.js +1 -1
  27. package/dist/canvas/functions/image-container-utility.cjs +1 -1
  28. package/dist/canvas/functions/image-container-utility.js +1 -1
  29. package/dist/canvas/functions/image-utility.cjs +1 -1
  30. package/dist/canvas/functions/image-utility.js +1 -1
  31. package/dist/canvas/functions/video-utility.cjs +1 -1
  32. package/dist/canvas/functions/video-utility.js +1 -1
  33. package/dist/canvas/index.cjs +1 -1
  34. package/dist/canvas/index.js +1 -1
  35. package/dist/canvas/tickers/classes/TickerBase.cjs +1 -1
  36. package/dist/canvas/tickers/classes/TickerBase.js +1 -1
  37. package/dist/canvas/tickers/components/FadeAlphaTicker.cjs +1 -1
  38. package/dist/canvas/tickers/components/FadeAlphaTicker.js +1 -1
  39. package/dist/canvas/tickers/components/MoveTicker.cjs +1 -1
  40. package/dist/canvas/tickers/components/MoveTicker.js +1 -1
  41. package/dist/canvas/tickers/components/RotateTicker.cjs +1 -1
  42. package/dist/canvas/tickers/components/RotateTicker.js +1 -1
  43. package/dist/canvas/tickers/components/ZoomTicker.cjs +1 -1
  44. package/dist/canvas/tickers/components/ZoomTicker.js +1 -1
  45. package/dist/canvas/tickers/decorators/ticker-decorator.cjs +1 -1
  46. package/dist/canvas/tickers/decorators/ticker-decorator.js +1 -1
  47. package/dist/canvas/tickers/functions/ticker-texture-utility.cjs +1 -1
  48. package/dist/canvas/tickers/functions/ticker-texture-utility.js +1 -1
  49. package/dist/canvas/tickers/index.cjs +1 -1
  50. package/dist/canvas/tickers/index.js +1 -1
  51. package/dist/character/classes/CharacterBaseModel.cjs +17 -17
  52. package/dist/character/classes/CharacterBaseModel.js +17 -17
  53. package/dist/character/classes/CharacterStoredClass.cjs +16 -16
  54. package/dist/character/classes/CharacterStoredClass.js +16 -16
  55. package/dist/character/decorators/character-decorator.cjs +1 -1
  56. package/dist/character/decorators/character-decorator.js +1 -1
  57. package/dist/character/index.cjs +16 -16
  58. package/dist/character/index.js +16 -16
  59. package/dist/classes/CachedMap.cjs +1 -1
  60. package/dist/classes/CachedMap.d.cts +1 -1
  61. package/dist/classes/CachedMap.d.ts +1 -1
  62. package/dist/classes/CachedMap.js +1 -1
  63. package/dist/classes/index.cjs +1 -1
  64. package/dist/classes/index.js +1 -1
  65. package/dist/constants.cjs +1 -1
  66. package/dist/constants.d.cts +5 -1
  67. package/dist/constants.d.ts +5 -1
  68. package/dist/constants.js +1 -1
  69. package/dist/history/HistoryManager.cjs +2 -2
  70. package/dist/history/HistoryManager.d.cts +24 -13
  71. package/dist/history/HistoryManager.d.ts +24 -13
  72. package/dist/history/HistoryManager.js +2 -2
  73. package/dist/history/HistoryManagerStatic.cjs +1 -1
  74. package/dist/history/HistoryManagerStatic.d.cts +9 -8
  75. package/dist/history/HistoryManagerStatic.d.ts +9 -8
  76. package/dist/history/HistoryManagerStatic.js +1 -1
  77. package/dist/history/index.cjs +2 -2
  78. package/dist/history/index.d.cts +4 -2
  79. package/dist/history/index.d.ts +4 -2
  80. package/dist/history/index.js +2 -2
  81. package/dist/history/interfaces/HistoryManagerInterface.d.cts +54 -11
  82. package/dist/history/interfaces/HistoryManagerInterface.d.ts +54 -11
  83. package/dist/{index-CWhYJ7yq.d.ts → index-CvpVN1rC.d.ts} +3 -3
  84. package/dist/{index-CVn6zVij.d.cts → index-DCnX_VPi.d.cts} +3 -3
  85. package/dist/index.cjs +73 -73
  86. package/dist/index.d.cts +6 -5
  87. package/dist/index.d.ts +6 -5
  88. package/dist/index.js +73 -73
  89. package/dist/narration/NarrationManager.cjs +16 -16
  90. package/dist/narration/NarrationManager.d.cts +1 -1
  91. package/dist/narration/NarrationManager.d.ts +1 -1
  92. package/dist/narration/NarrationManager.js +16 -16
  93. package/dist/narration/NarrationManagerStatic.cjs +1 -1
  94. package/dist/narration/NarrationManagerStatic.js +1 -1
  95. package/dist/narration/classes/ChoiceMenuOption.cjs +1 -1
  96. package/dist/narration/classes/ChoiceMenuOption.js +1 -1
  97. package/dist/narration/decorators/RegisteredLabels.cjs +1 -1
  98. package/dist/narration/decorators/RegisteredLabels.js +1 -1
  99. package/dist/narration/decorators/newLabel.cjs +1 -1
  100. package/dist/narration/decorators/newLabel.js +1 -1
  101. package/dist/narration/index.cjs +17 -17
  102. package/dist/narration/index.d.cts +2 -2
  103. package/dist/narration/index.d.ts +2 -2
  104. package/dist/narration/index.js +17 -17
  105. package/dist/narration/interfaces/HistoryStep.d.cts +5 -5
  106. package/dist/narration/interfaces/HistoryStep.d.ts +5 -5
  107. package/dist/narration/interfaces/{NarrativeHistory.d.cts → NarrationHistory.d.cts} +2 -2
  108. package/dist/narration/interfaces/{NarrativeHistory.d.ts → NarrationHistory.d.ts} +2 -2
  109. package/dist/narration/interfaces/NarrationManagerInterface.d.cts +1 -1
  110. package/dist/narration/interfaces/NarrationManagerInterface.d.ts +1 -1
  111. package/dist/pixi-devtools/additionalPositionsProperties.cjs +1 -1
  112. package/dist/pixi-devtools/additionalPositionsProperties.js +1 -1
  113. package/dist/pixi-vn.d.d.cts +44 -1
  114. package/dist/pixi-vn.d.d.ts +44 -1
  115. package/dist/storage/StorageManager.cjs +1 -1
  116. package/dist/storage/StorageManager.js +1 -1
  117. package/dist/storage/StorageManagerStatic.cjs +1 -1
  118. package/dist/storage/StorageManagerStatic.js +1 -1
  119. package/dist/storage/classes/StoredClassModel.cjs +1 -1
  120. package/dist/storage/classes/StoredClassModel.js +1 -1
  121. package/dist/storage/index.cjs +1 -1
  122. package/dist/storage/index.js +1 -1
  123. package/dist/utils/diff-utility.d.cts +2 -2
  124. package/dist/utils/diff-utility.d.ts +2 -2
  125. package/package.json +3 -3
  126. /package/dist/narration/interfaces/{NarrativeHistory.cjs → NarrationHistory.cjs} +0 -0
  127. /package/dist/narration/interfaces/{NarrativeHistory.js → NarrationHistory.js} +0 -0
@@ -82,6 +82,49 @@ declare module "@drincs/pixi-vn" {
82
82
  [key: string]: any;
83
83
  }
84
84
  interface HistoryInfo {
85
- [key: string]: any;
85
+ /**
86
+ * The label id of the current step.
87
+ */
88
+ currentLabel?: LabelIdType;
89
+ /**
90
+ * The sha1 of the step function.
91
+ */
92
+ stepSha1: string;
93
+ /**
94
+ * Equivalent to the narration.stepCounter
95
+ */
96
+ index: number;
97
+ /**
98
+ * The data of the step of the label.
99
+ */
100
+ labelStepIndex: number | null;
101
+ /**
102
+ * @deprecated
103
+ */
104
+ dialoge?: StoredDialogue;
105
+ /**
106
+ * Dialogue to be shown in the game
107
+ */
108
+ dialogue?: StoredDialogue;
109
+ /**
110
+ * List of choices asked of the player
111
+ */
112
+ choices?: StoredChoiceInterface[];
113
+ /**
114
+ * List of choices already made by the player
115
+ */
116
+ alreadyMadeChoices?: number[];
117
+ /**
118
+ * The input value of the player
119
+ */
120
+ inputValue?: StorageElementType;
121
+ /**
122
+ * The choice made by the player
123
+ */
124
+ choiceIndexMade?: number;
125
+ /**
126
+ * If true, the current dialogue will be glued to the previous one.
127
+ */
128
+ isGlued?: boolean;
86
129
  }
87
130
  }
@@ -82,6 +82,49 @@ declare module "@drincs/pixi-vn" {
82
82
  [key: string]: any;
83
83
  }
84
84
  interface HistoryInfo {
85
- [key: string]: any;
85
+ /**
86
+ * The label id of the current step.
87
+ */
88
+ currentLabel?: LabelIdType;
89
+ /**
90
+ * The sha1 of the step function.
91
+ */
92
+ stepSha1: string;
93
+ /**
94
+ * Equivalent to the narration.stepCounter
95
+ */
96
+ index: number;
97
+ /**
98
+ * The data of the step of the label.
99
+ */
100
+ labelStepIndex: number | null;
101
+ /**
102
+ * @deprecated
103
+ */
104
+ dialoge?: StoredDialogue;
105
+ /**
106
+ * Dialogue to be shown in the game
107
+ */
108
+ dialogue?: StoredDialogue;
109
+ /**
110
+ * List of choices asked of the player
111
+ */
112
+ choices?: StoredChoiceInterface[];
113
+ /**
114
+ * List of choices already made by the player
115
+ */
116
+ alreadyMadeChoices?: number[];
117
+ /**
118
+ * The input value of the player
119
+ */
120
+ inputValue?: StorageElementType;
121
+ /**
122
+ * The choice made by the player
123
+ */
124
+ choiceIndexMade?: number;
125
+ /**
126
+ * If true, the current dialogue will be glued to the previous one.
127
+ */
128
+ isGlued?: boolean;
86
129
  }
87
130
  }
@@ -1 +1 @@
1
- 'use strict';var f;(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)))(f||={});var x=class n{static init(e){n._getStepCounter=e.getStepCounter,n._setStepCounter=e.setStepCounter,n._getCurrentGameStepState=e.getCurrentGameStepState,n._restoreGameStepState=e.restoreGameStepState,n._getOpenedLabels=e.getOpenedLabels,e.onGoNextEnd&&(n._onGoNextEnd=e.onGoNextEnd),n._getVariable=e.getVariable,n._setVariable=e.setVariable,n._removeVariable=e.removeVariable,n._getFlag=e.getFlag,n._setFlag=e.setFlag,e.onLabelClosing&&(n._onLabelClosing=e.onLabelClosing),n._addHistoryItem=e.addHistoryItem,n._getCurrentStepsRunningNumber=e.getCurrentStepsRunningNumber,n._getCharacter=e.getCharacter;}static _getStepCounter=()=>{throw f.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static _setStepCounter=()=>{throw f.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get stepCounter(){return n._getStepCounter()}static set stepCounter(e){n._setStepCounter(e);}static _getCurrentGameStepState=()=>{throw f.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get currentGameStepState(){return n._getCurrentGameStepState()}static _restoreGameStepState=()=>{throw f.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get restoreGameStepState(){return n._restoreGameStepState}static _getOpenedLabels=()=>{throw f.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get openedLabels(){return n._getOpenedLabels()}static _onGoNextEnd=async()=>{};static get onGoNextEnd(){return n._onGoNextEnd}static _getVariable=()=>{throw f.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get getVariable(){return n._getVariable}static _setVariable=()=>{throw f.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get setVariable(){return n._setVariable}static _removeVariable=()=>{throw f.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get removeVariable(){return n._removeVariable}static _getFlag=()=>{throw f.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get getFlag(){return n._getFlag}static _setFlag=()=>{throw f.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get setFlag(){return n._setFlag}static _onLabelClosing=()=>{};static get onLabelClosing(){return n._onLabelClosing}static _addHistoryItem=()=>{throw f.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get addHistoryItem(){return n._addHistoryItem}static _getCurrentStepsRunningNumber=()=>{throw f.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get currentStepsRunningNumber(){return n._getCurrentStepsRunningNumber()}static _getCharacter=()=>{throw f.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented.")};static get getCharacter(){return n._getCharacter}static onEnd;static onError};function I(n){try{if(typeof n>"u")return n;let e=JSON.stringify(n);return JSON.parse(e)}catch(e){throw f.error("Error creating exportable element",n,e),new Error("[Pixi\u2019VN] Error creating exportable element")}}var C=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,U=new Set,D=typeof process=="object"&&process?process:{},j=(n,e,t,i)=>{typeof D.emitWarning=="function"?D.emitWarning(n,e,t,i):console.error(`[${t}] ${e}: ${n}`);},L=globalThis.AbortController,P=globalThis.AbortSignal;if(typeof L>"u"){P=class{onabort;_onabort=[];reason;aborted=false;addEventListener(i,s){this._onabort.push(s);}},L=class{constructor(){e();}signal=new P;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 n=D.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{n&&(n=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",e));};}var K=n=>!U.has(n),v=n=>n&&n===Math.floor(n)&&n>0&&isFinite(n),H=n=>v(n)?n<=Math.pow(2,8)?Uint8Array:n<=Math.pow(2,16)?Uint16Array:n<=Math.pow(2,32)?Uint32Array:n<=Number.MAX_SAFE_INTEGER?F:null:null,F=class extends Array{constructor(e){super(e),this.fill(0);}},N=class n{heap;length;static#h=false;static create(e){let t=H(e);if(!t)return [];n.#h=true;let i=new n(e,t);return n.#h=false,i}constructor(e,t){if(!n.#h)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0;}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}},V=class n{#h;#c;#m;#C;#p;#x;#M;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#r;#S;#s;#i;#e;#l;#f;#o;#n;#b;#a;#y;#w;#d;#_;#z;#u;#I;static unsafeExposeInternals(e){return {starts:e.#w,ttls:e.#d,sizes:e.#y,keyMap:e.#s,keyList:e.#i,valList:e.#e,next:e.#l,prev:e.#f,get head(){return e.#o},get tail(){return e.#n},free:e.#b,isBackgroundFetch:t=>e.#t(t),backgroundFetch:(t,i,s,r)=>e.#R(t,i,s,r),moveToTail:t=>e.#O(t),indexes:t=>e.#E(t),rindexes:t=>e.#v(t),isStale:t=>e.#g(t)}}get max(){return this.#h}get maxSize(){return this.#c}get calculatedSize(){return this.#S}get size(){return this.#r}get fetchMethod(){return this.#x}get memoMethod(){return this.#M}get dispose(){return this.#m}get onInsert(){return this.#C}get disposeAfter(){return this.#p}constructor(e){let{max:t=0,ttl:i,ttlResolution:s=1,ttlAutopurge:r,updateAgeOnGet:a,updateAgeOnHas:l,allowStale:o,dispose:p,onInsert:w,disposeAfter:c,noDisposeOnSet:d,noUpdateTTL:g,maxSize:G=0,maxEntrySize:m=0,sizeCalculation:_,fetchMethod:u,memoMethod:b,noDeleteOnFetchRejection:E,noDeleteOnStaleGet:S,allowStaleOnFetchRejection:y,allowStaleOnFetchAbort:O,ignoreFetchAbort:T}=e;if(t!==0&&!v(t))throw new TypeError("max option must be a nonnegative integer");let M=t?H(t):Array;if(!M)throw new Error("invalid max value: "+t);if(this.#h=t,this.#c=G,this.maxEntrySize=m||this.#c,this.sizeCalculation=_,this.sizeCalculation){if(!this.#c&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(b!==void 0&&typeof b!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#M=b,u!==void 0&&typeof u!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#x=u,this.#z=!!u,this.#s=new Map,this.#i=new Array(t).fill(void 0),this.#e=new Array(t).fill(void 0),this.#l=new M(t),this.#f=new M(t),this.#o=0,this.#n=0,this.#b=N.create(t),this.#r=0,this.#S=0,typeof p=="function"&&(this.#m=p),typeof w=="function"&&(this.#C=w),typeof c=="function"?(this.#p=c,this.#a=[]):(this.#p=void 0,this.#a=void 0),this.#_=!!this.#m,this.#I=!!this.#C,this.#u=!!this.#p,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!g,this.noDeleteOnFetchRejection=!!E,this.allowStaleOnFetchRejection=!!y,this.allowStaleOnFetchAbort=!!O,this.ignoreFetchAbort=!!T,this.maxEntrySize!==0){if(this.#c!==0&&!v(this.#c))throw new TypeError("maxSize must be a positive integer if specified");if(!v(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#H();}if(this.allowStale=!!o,this.noDeleteOnStaleGet=!!S,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!l,this.ttlResolution=v(s)||s===0?s:1,this.ttlAutopurge=!!r,this.ttl=i||0,this.ttl){if(!v(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#D();}if(this.#h===0&&this.ttl===0&&this.#c===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#h&&!this.#c){let z="LRU_CACHE_UNBOUNDED";K(z)&&(U.add(z),j("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",z,n));}}getRemainingTTL(e){return this.#s.has(e)?1/0:0}#D(){let e=new F(this.#h),t=new F(this.#h);this.#d=e,this.#w=t,this.#N=(r,a,l=C.now())=>{if(t[r]=a!==0?l:0,e[r]=a,a!==0&&this.ttlAutopurge){let o=setTimeout(()=>{this.#g(r)&&this.#G(this.#i[r],"expire");},a+1);o.unref&&o.unref();}},this.#F=r=>{t[r]=e[r]!==0?C.now():0;},this.#T=(r,a)=>{if(e[a]){let l=e[a],o=t[a];if(!l||!o)return;r.ttl=l,r.start=o,r.now=i||s();let p=r.now-o;r.remainingTTL=l-p;}};let i=0,s=()=>{let r=C.now();if(this.ttlResolution>0){i=r;let a=setTimeout(()=>i=0,this.ttlResolution);a.unref&&a.unref();}return r};this.getRemainingTTL=r=>{let a=this.#s.get(r);if(a===void 0)return 0;let l=e[a],o=t[a];if(!l||!o)return 1/0;let p=(i||s())-o;return l-p},this.#g=r=>{let a=t[r],l=e[r];return !!l&&!!a&&(i||s())-a>l};}#F=()=>{};#T=()=>{};#N=()=>{};#g=()=>false;#H(){let e=new F(this.#h);this.#S=0,this.#y=e,this.#A=t=>{this.#S-=e[t],e[t]=0;},this.#W=(t,i,s,r)=>{if(this.#t(i))return 0;if(!v(s))if(r){if(typeof r!="function")throw new TypeError("sizeCalculation must be a function");if(s=r(i,t),!v(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return s},this.#L=(t,i,s)=>{if(e[t]=i,this.#c){let r=this.#c-e[t];for(;this.#S>r;)this.#V(true);}this.#S+=e[t],s&&(s.entrySize=i,s.totalCalculatedSize=this.#S);};}#A=e=>{};#L=(e,t,i)=>{};#W=(e,t,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#E({allowStale:e=this.allowStale}={}){if(this.#r)for(let t=this.#n;!(!this.#P(t)||((e||!this.#g(t))&&(yield t),t===this.#o));)t=this.#f[t];}*#v({allowStale:e=this.allowStale}={}){if(this.#r)for(let t=this.#o;!(!this.#P(t)||((e||!this.#g(t))&&(yield t),t===this.#n));)t=this.#l[t];}#P(e){return e!==void 0&&this.#s.get(this.#i[e])===e}*entries(){for(let e of this.#E())this.#e[e]!==void 0&&this.#i[e]!==void 0&&!this.#t(this.#e[e])&&(yield [this.#i[e],this.#e[e]]);}*rentries(){for(let e of this.#v())this.#e[e]!==void 0&&this.#i[e]!==void 0&&!this.#t(this.#e[e])&&(yield [this.#i[e],this.#e[e]]);}*keys(){for(let e of this.#E()){let t=this.#i[e];t!==void 0&&!this.#t(this.#e[e])&&(yield t);}}*rkeys(){for(let e of this.#v()){let t=this.#i[e];t!==void 0&&!this.#t(this.#e[e])&&(yield t);}}*values(){for(let e of this.#E())this.#e[e]!==void 0&&!this.#t(this.#e[e])&&(yield this.#e[e]);}*rvalues(){for(let e of this.#v())this.#e[e]!==void 0&&!this.#t(this.#e[e])&&(yield this.#e[e]);}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let i of this.#E()){let s=this.#e[i],r=this.#t(s)?s.__staleWhileFetching:s;if(r!==void 0&&e(r,this.#i[i],this))return this.get(this.#i[i],t)}}forEach(e,t=this){for(let i of this.#E()){let s=this.#e[i],r=this.#t(s)?s.__staleWhileFetching:s;r!==void 0&&e.call(t,r,this.#i[i],this);}}rforEach(e,t=this){for(let i of this.#v()){let s=this.#e[i],r=this.#t(s)?s.__staleWhileFetching:s;r!==void 0&&e.call(t,r,this.#i[i],this);}}purgeStale(){let e=false;for(let t of this.#v({allowStale:true}))this.#g(t)&&(this.#G(this.#i[t],"expire"),e=true);return e}info(e){let t=this.#s.get(e);if(t===void 0)return;let i=this.#e[t],s=this.#t(i)?i.__staleWhileFetching:i;if(s===void 0)return;let r={value:s};if(this.#d&&this.#w){let a=this.#d[t],l=this.#w[t];if(a&&l){let o=a-(C.now()-l);r.ttl=o,r.start=Date.now();}}return this.#y&&(r.size=this.#y[t]),r}dump(){let e=[];for(let t of this.#E({allowStale:true})){let i=this.#i[t],s=this.#e[t],r=this.#t(s)?s.__staleWhileFetching:s;if(r===void 0||i===void 0)continue;let a={value:r};if(this.#d&&this.#w){a.ttl=this.#d[t];let l=C.now()-this.#w[t];a.start=Math.floor(Date.now()-l);}this.#y&&(a.size=this.#y[t]),e.unshift([i,a]);}return e}load(e){this.clear();for(let[t,i]of e){if(i.start){let s=Date.now()-i.start;i.start=C.now()-s;}this.set(t,i.value,i);}}set(e,t,i={}){if(t===void 0)return this.delete(e),this;let{ttl:s=this.ttl,start:r,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:l=this.sizeCalculation,status:o}=i,{noUpdateTTL:p=this.noUpdateTTL}=i,w=this.#W(e,t,i.size||0,l);if(this.maxEntrySize&&w>this.maxEntrySize)return o&&(o.set="miss",o.maxEntrySizeExceeded=true),this.#G(e,"set"),this;let c=this.#r===0?void 0:this.#s.get(e);if(c===void 0)c=this.#r===0?this.#n:this.#b.length!==0?this.#b.pop():this.#r===this.#h?this.#V(false):this.#r,this.#i[c]=e,this.#e[c]=t,this.#s.set(e,c),this.#l[this.#n]=c,this.#f[c]=this.#n,this.#n=c,this.#r++,this.#L(c,w,o),o&&(o.set="add"),p=false,this.#I&&this.#C?.(t,e,"add");else {this.#O(c);let d=this.#e[c];if(t!==d){if(this.#z&&this.#t(d)){d.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:g}=d;g!==void 0&&!a&&(this.#_&&this.#m?.(g,e,"set"),this.#u&&this.#a?.push([g,e,"set"]));}else a||(this.#_&&this.#m?.(d,e,"set"),this.#u&&this.#a?.push([d,e,"set"]));if(this.#A(c),this.#L(c,w,o),this.#e[c]=t,o){o.set="replace";let g=d&&this.#t(d)?d.__staleWhileFetching:d;g!==void 0&&(o.oldValue=g);}}else o&&(o.set="update");this.#I&&this.onInsert?.(t,e,t===d?"update":"replace");}if(s!==0&&!this.#d&&this.#D(),this.#d&&(p||this.#N(c,s,r),o&&this.#T(o,c)),!a&&this.#u&&this.#a){let d=this.#a,g;for(;g=d?.shift();)this.#p?.(...g);}return this}pop(){try{for(;this.#r;){let e=this.#e[this.#o];if(this.#V(!0),this.#t(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#u&&this.#a){let e=this.#a,t;for(;t=e?.shift();)this.#p?.(...t);}}}#V(e){let t=this.#o,i=this.#i[t],s=this.#e[t];return this.#z&&this.#t(s)?s.__abortController.abort(new Error("evicted")):(this.#_||this.#u)&&(this.#_&&this.#m?.(s,i,"evict"),this.#u&&this.#a?.push([s,i,"evict"])),this.#A(t),e&&(this.#i[t]=void 0,this.#e[t]=void 0,this.#b.push(t)),this.#r===1?(this.#o=this.#n=0,this.#b.length=0):this.#o=this.#l[t],this.#s.delete(i),this.#r--,t}has(e,t={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=t,r=this.#s.get(e);if(r!==void 0){let a=this.#e[r];if(this.#t(a)&&a.__staleWhileFetching===void 0)return false;if(this.#g(r))s&&(s.has="stale",this.#T(s,r));else return i&&this.#F(r),s&&(s.has="hit",this.#T(s,r)),true}else s&&(s.has="miss");return false}peek(e,t={}){let{allowStale:i=this.allowStale}=t,s=this.#s.get(e);if(s===void 0||!i&&this.#g(s))return;let r=this.#e[s];return this.#t(r)?r.__staleWhileFetching:r}#R(e,t,i,s){let r=t===void 0?void 0:this.#e[t];if(this.#t(r))return r;let a=new L,{signal:l}=i;l?.addEventListener("abort",()=>a.abort(l.reason),{signal:a.signal});let o={signal:a.signal,options:i,context:s},p=(m,_=false)=>{let{aborted:u}=a.signal,b=i.ignoreFetchAbort&&m!==void 0;if(i.status&&(u&&!_?(i.status.fetchAborted=true,i.status.fetchError=a.signal.reason,b&&(i.status.fetchAbortIgnored=true)):i.status.fetchResolved=true),u&&!b&&!_)return c(a.signal.reason);let E=g;return this.#e[t]===g&&(m===void 0?E.__staleWhileFetching?this.#e[t]=E.__staleWhileFetching:this.#G(e,"fetch"):(i.status&&(i.status.fetchUpdated=true),this.set(e,m,o.options))),m},w=m=>(i.status&&(i.status.fetchRejected=true,i.status.fetchError=m),c(m)),c=m=>{let{aborted:_}=a.signal,u=_&&i.allowStaleOnFetchAbort,b=u||i.allowStaleOnFetchRejection,E=b||i.noDeleteOnFetchRejection,S=g;if(this.#e[t]===g&&(!E||S.__staleWhileFetching===void 0?this.#G(e,"fetch"):u||(this.#e[t]=S.__staleWhileFetching)),b)return i.status&&S.__staleWhileFetching!==void 0&&(i.status.returnedStale=true),S.__staleWhileFetching;if(S.__returned===S)throw m},d=(m,_)=>{let u=this.#x?.(e,r,o);u&&u instanceof Promise&&u.then(b=>m(b===void 0?void 0:b),_),a.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(m(void 0),i.allowStaleOnFetchAbort&&(m=b=>p(b,true)));});};i.status&&(i.status.fetchDispatched=true);let g=new Promise(d).then(p,w),G=Object.assign(g,{__abortController:a,__staleWhileFetching:r,__returned:void 0});return t===void 0?(this.set(e,G,{...o.options,status:void 0}),t=this.#s.get(e)):this.#e[t]=G,G}#t(e){if(!this.#z)return false;let t=e;return !!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof L}async fetch(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:l=this.noDisposeOnSet,size:o=0,sizeCalculation:p=this.sizeCalculation,noUpdateTTL:w=this.noUpdateTTL,noDeleteOnFetchRejection:c=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:g=this.ignoreFetchAbort,allowStaleOnFetchAbort:G=this.allowStaleOnFetchAbort,context:m,forceRefresh:_=false,status:u,signal:b}=t;if(!this.#z)return u&&(u.fetch="get"),this.get(e,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:r,status:u});let E={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:r,ttl:a,noDisposeOnSet:l,size:o,sizeCalculation:p,noUpdateTTL:w,noDeleteOnFetchRejection:c,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:G,ignoreFetchAbort:g,status:u,signal:b},S=this.#s.get(e);if(S===void 0){u&&(u.fetch="miss");let y=this.#R(e,S,E,m);return y.__returned=y}else {let y=this.#e[S];if(this.#t(y)){let R=i&&y.__staleWhileFetching!==void 0;return u&&(u.fetch="inflight",R&&(u.returnedStale=true)),R?y.__staleWhileFetching:y.__returned=y}let O=this.#g(S);if(!_&&!O)return u&&(u.fetch="hit"),this.#O(S),s&&this.#F(S),u&&this.#T(u,S),y;let T=this.#R(e,S,E,m),z=T.__staleWhileFetching!==void 0&&i;return u&&(u.fetch=O?"stale":"refresh",z&&O&&(u.returnedStale=true)),z?T.__staleWhileFetching:T.__returned=T}}async forceFetch(e,t={}){let i=await this.fetch(e,t);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(e,t={}){let i=this.#M;if(!i)throw new Error("no memoMethod provided to constructor");let{context:s,forceRefresh:r,...a}=t,l=this.get(e,a);if(!r&&l!==void 0)return l;let o=i(e,l,{options:a,context:s});return this.set(e,o,a),o}get(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,status:a}=t,l=this.#s.get(e);if(l!==void 0){let o=this.#e[l],p=this.#t(o);return a&&this.#T(a,l),this.#g(l)?(a&&(a.get="stale"),p?(a&&i&&o.__staleWhileFetching!==void 0&&(a.returnedStale=true),i?o.__staleWhileFetching:void 0):(r||this.#G(e,"expire"),a&&i&&(a.returnedStale=true),i?o:void 0)):(a&&(a.get="hit"),p?o.__staleWhileFetching:(this.#O(l),s&&this.#F(l),o))}else a&&(a.get="miss");}#U(e,t){this.#f[t]=e,this.#l[e]=t;}#O(e){e!==this.#n&&(e===this.#o?this.#o=this.#l[e]:this.#U(this.#f[e],this.#l[e]),this.#U(this.#n,e),this.#n=e);}delete(e){return this.#G(e,"delete")}#G(e,t){let i=false;if(this.#r!==0){let s=this.#s.get(e);if(s!==void 0)if(i=true,this.#r===1)this.#j(t);else {this.#A(s);let r=this.#e[s];if(this.#t(r)?r.__abortController.abort(new Error("deleted")):(this.#_||this.#u)&&(this.#_&&this.#m?.(r,e,t),this.#u&&this.#a?.push([r,e,t])),this.#s.delete(e),this.#i[s]=void 0,this.#e[s]=void 0,s===this.#n)this.#n=this.#f[s];else if(s===this.#o)this.#o=this.#l[s];else {let a=this.#f[s];this.#l[a]=this.#l[s];let l=this.#l[s];this.#f[l]=this.#f[s];}this.#r--,this.#b.push(s);}}if(this.#u&&this.#a?.length){let s=this.#a,r;for(;r=s?.shift();)this.#p?.(...r);}return i}clear(){return this.#j("delete")}#j(e){for(let t of this.#v({allowStale:true})){let i=this.#e[t];if(this.#t(i))i.__abortController.abort(new Error("deleted"));else {let s=this.#i[t];this.#_&&this.#m?.(i,s,e),this.#u&&this.#a?.push([i,s,e]);}}if(this.#s.clear(),this.#e.fill(void 0),this.#i.fill(void 0),this.#d&&this.#w&&(this.#d.fill(0),this.#w.fill(0)),this.#y&&this.#y.fill(0),this.#o=0,this.#n=0,this.#b.length=0,this.#S=0,this.#r=0,this.#u&&this.#a){let t=this.#a,i;for(;i=t?.shift();)this.#p?.(...i);}}};var A=class{cache;map=new Map;constructor(e){this.cache=new V({max:e.cacheSize}),this.map=new Map;}get[Symbol.iterator](){return this.map[Symbol.iterator]}get[Symbol.toStringTag](){return this.map[Symbol.toStringTag]}clear(){return this.cache.clear(),this.map.clear()}delete(e){let t=this.map.delete(e);return t&&this.cache.delete(e),t}get forEach(){return this.map.forEach}get(e){let t=this.cache.get(e);return t||this.map.get(e)}has(e){return this.map.has(e)}set(e,t){return this.map.set(e,t),this.cache.set(e,t),this}get size(){return this.map.size}get entries(){return this.map.entries}get keys(){return this.map.keys}get values(){return this.map.values}};var h=class n{static storage=new A({cacheSize:20});static startingStorage=[];static flags=Array();static tempStorage=new Map;static tempStorageDeadlines=new Map;constructor(){}static clearOldTempVariables(e){n.tempStorageDeadlines.forEach((t,i)=>{t>e&&(n.tempStorage.delete(i),n.tempStorageDeadlines.delete(i),n.storage.cache.delete(i));});}static setVariable(e,t){let i=n.tempStorage.has(e);t==null?(n.storage.map.delete(e),!i&&n.storage.cache.delete(e)):(n.storage.map.set(e,t),!i&&n.storage.cache.set(e,t));}static getVariable(e){let t=n.storage.cache.get(e);return t===void 0&&(t=n.tempStorage.get(e)),t===void 0&&(t=n.storage.map.get(e)),I(t)}static removeVariable(e){n.storage.delete(e);}static setFlag(e,t){if(t)this.flags.includes(e)||this.flags.push(e);else {let i=this.flags.indexOf(e);i>-1&&this.flags.splice(i,1);}}static getFlag(e){return this.flags.includes(e)}};var W=class{get storage(){return h.storage.map}get cache(){return h.storage.cache}get flags(){return h.flags}get tempStorage(){return h.tempStorage}get tempStorageDeadlines(){return h.tempStorageDeadlines}set startingStorage(e){let t=[];Object.entries(e).forEach(([i,s])=>{t.push({key:i,value:s});}),h.startingStorage=t;}setVariable(e,t){return h.setVariable(e,t)}getVariable(e){return h.getVariable(e)}removeVariable(e){return h.removeVariable(e)}setTempVariable(e,t){if(t==null){this.removeTempVariable(e);return}else h.tempStorage.set(e,t),h.storage.cache.set(e,t),h.tempStorageDeadlines.has(e)||h.tempStorageDeadlines.set(e,x.openedLabels);}removeTempVariable(e){h.tempStorage.has(e)&&(h.tempStorage.delete(e),h.tempStorageDeadlines.delete(e),h.storage.cache.delete(e));}setFlag(e,t){return h.setFlag(e,t)}getFlag(e){return h.getFlag(e)}clear(){this.storage.clear(),this.cache.clear(),h.flags=[],h.tempStorage.clear(),h.tempStorageDeadlines.clear(),h.startingStorage.forEach(({key:e,value:t})=>{this.storage.set(e,t);});}export(){let e=[];[...this.storage.keys()].forEach(s=>{e.push({key:s,value:this.storage.get(s)});});let t=[];[...h.tempStorage.keys()].forEach(s=>{t.push({key:s,value:h.tempStorage.get(s)});});let i=[];return [...h.tempStorageDeadlines.keys()].forEach(s=>{i.push({key:s,value:h.tempStorageDeadlines.get(s)});}),I({base:e,temp:t,tempDeadlines:i,flags:h.flags})}restore(e){this.clear();try{e?(Array.isArray(e)&&e.forEach(t=>{if(t.key==="___temp_storage___"){let i=t.value;Object.entries(i).forEach(([s,r])=>{h.tempStorage.set(s,r);});}else if(t.key==="___temp_storage_deadlines___"){let i=t.value;Object.entries(i).forEach(([s,r])=>{h.tempStorageDeadlines.set(s,r);});}else t.key==="___flags___"?t.value.forEach(s=>{h.flags.push(s);}):this.storage.set(t.key,t.value);}),"base"in e&&"temp"in e&&"tempDeadlines"in e?(e.base?.forEach(t=>{this.storage.set(t.key,t.value);}),e.temp?.forEach(t=>{h.tempStorage.set(t.key,t.value);}),e.tempDeadlines?.forEach(t=>{h.tempStorageDeadlines.set(t.key,t.value);})):Object.entries(e).forEach(([t,i])=>{t==="___temp_storage___"?Object.entries(i).forEach(([s,r])=>{h.tempStorage.set(s,r);}):t==="___temp_storage_deadlines___"?Object.entries(i).forEach(([s,r])=>{h.tempStorageDeadlines.set(s,r);}):t==="___flags___"?i.forEach(s=>{h.flags.push(s);}):this.storage.set(t,i);})):f.warn("No storage data found");}catch(t){f.error("Error importing data",t);}}};module.exports=W;
1
+ 'use strict';var f;(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)))(f||={});var x=class n{static init(e){n._getStepCounter=e.getStepCounter,n._setStepCounter=e.setStepCounter,n._getCurrentGameStepState=e.getCurrentGameStepState,n._restoreGameStepState=e.restoreGameStepState,n._getOpenedLabels=e.getOpenedLabels,e.onGoNextEnd&&(n._onGoNextEnd=e.onGoNextEnd),n._getVariable=e.getVariable,n._setVariable=e.setVariable,n._removeVariable=e.removeVariable,n._getFlag=e.getFlag,n._setFlag=e.setFlag,e.onLabelClosing&&(n._onLabelClosing=e.onLabelClosing),n._addHistoryItem=e.addHistoryItem,n._getCurrentStepsRunningNumber=e.getCurrentStepsRunningNumber,n._getCharacter=e.getCharacter;}static _getStepCounter=()=>{throw f.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static _setStepCounter=()=>{throw f.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get stepCounter(){return n._getStepCounter()}static set stepCounter(e){n._setStepCounter(e);}static _getCurrentGameStepState=()=>{throw f.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get currentGameStepState(){return n._getCurrentGameStepState()}static _restoreGameStepState=()=>{throw f.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get restoreGameStepState(){return n._restoreGameStepState}static _getOpenedLabels=()=>{throw f.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get openedLabels(){return n._getOpenedLabels()}static _onGoNextEnd=async()=>{};static get onGoNextEnd(){return n._onGoNextEnd}static _getVariable=()=>{throw f.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get getVariable(){return n._getVariable}static _setVariable=()=>{throw f.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get setVariable(){return n._setVariable}static _removeVariable=()=>{throw f.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get removeVariable(){return n._removeVariable}static _getFlag=()=>{throw f.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get getFlag(){return n._getFlag}static _setFlag=()=>{throw f.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get setFlag(){return n._setFlag}static _onLabelClosing=()=>{};static get onLabelClosing(){return n._onLabelClosing}static _addHistoryItem=()=>{throw f.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get addHistoryItem(){return n._addHistoryItem}static _getCurrentStepsRunningNumber=()=>{throw f.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get currentStepsRunningNumber(){return n._getCurrentStepsRunningNumber()}static _getCharacter=()=>{throw f.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented.")};static get getCharacter(){return n._getCharacter}static onEnd;static onError};function I(n){try{if(typeof n>"u")return n;let e=JSON.stringify(n);return JSON.parse(e)}catch(e){throw f.error("Error creating exportable element",n,e),new Error("[Pixi\u2019VN] Error creating exportable element")}}var C=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,U=new Set,D=typeof process=="object"&&process?process:{},j=(n,e,t,i)=>{typeof D.emitWarning=="function"?D.emitWarning(n,e,t,i):console.error(`[${t}] ${e}: ${n}`);},L=globalThis.AbortController,P=globalThis.AbortSignal;if(typeof L>"u"){P=class{onabort;_onabort=[];reason;aborted=false;addEventListener(i,s){this._onabort.push(s);}},L=class{constructor(){e();}signal=new P;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 n=D.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{n&&(n=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",e));};}var K=n=>!U.has(n),v=n=>n&&n===Math.floor(n)&&n>0&&isFinite(n),H=n=>v(n)?n<=Math.pow(2,8)?Uint8Array:n<=Math.pow(2,16)?Uint16Array:n<=Math.pow(2,32)?Uint32Array:n<=Number.MAX_SAFE_INTEGER?F:null:null,F=class extends Array{constructor(e){super(e),this.fill(0);}},N=class n{heap;length;static#h=false;static create(e){let t=H(e);if(!t)return [];n.#h=true;let i=new n(e,t);return n.#h=false,i}constructor(e,t){if(!n.#h)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0;}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}},V=class n{#h;#c;#m;#C;#p;#x;#M;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#r;#S;#s;#i;#e;#l;#f;#o;#n;#b;#a;#y;#w;#d;#_;#z;#u;#I;static unsafeExposeInternals(e){return {starts:e.#w,ttls:e.#d,sizes:e.#y,keyMap:e.#s,keyList:e.#i,valList:e.#e,next:e.#l,prev:e.#f,get head(){return e.#o},get tail(){return e.#n},free:e.#b,isBackgroundFetch:t=>e.#t(t),backgroundFetch:(t,i,s,r)=>e.#R(t,i,s,r),moveToTail:t=>e.#O(t),indexes:t=>e.#E(t),rindexes:t=>e.#v(t),isStale:t=>e.#g(t)}}get max(){return this.#h}get maxSize(){return this.#c}get calculatedSize(){return this.#S}get size(){return this.#r}get fetchMethod(){return this.#x}get memoMethod(){return this.#M}get dispose(){return this.#m}get onInsert(){return this.#C}get disposeAfter(){return this.#p}constructor(e){let{max:t=0,ttl:i,ttlResolution:s=1,ttlAutopurge:r,updateAgeOnGet:a,updateAgeOnHas:l,allowStale:o,dispose:p,onInsert:w,disposeAfter:c,noDisposeOnSet:d,noUpdateTTL:g,maxSize:G=0,maxEntrySize:m=0,sizeCalculation:_,fetchMethod:u,memoMethod:b,noDeleteOnFetchRejection:E,noDeleteOnStaleGet:S,allowStaleOnFetchRejection:y,allowStaleOnFetchAbort:O,ignoreFetchAbort:T}=e;if(t!==0&&!v(t))throw new TypeError("max option must be a nonnegative integer");let M=t?H(t):Array;if(!M)throw new Error("invalid max value: "+t);if(this.#h=t,this.#c=G,this.maxEntrySize=m||this.#c,this.sizeCalculation=_,this.sizeCalculation){if(!this.#c&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(b!==void 0&&typeof b!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#M=b,u!==void 0&&typeof u!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#x=u,this.#z=!!u,this.#s=new Map,this.#i=new Array(t).fill(void 0),this.#e=new Array(t).fill(void 0),this.#l=new M(t),this.#f=new M(t),this.#o=0,this.#n=0,this.#b=N.create(t),this.#r=0,this.#S=0,typeof p=="function"&&(this.#m=p),typeof w=="function"&&(this.#C=w),typeof c=="function"?(this.#p=c,this.#a=[]):(this.#p=void 0,this.#a=void 0),this.#_=!!this.#m,this.#I=!!this.#C,this.#u=!!this.#p,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!g,this.noDeleteOnFetchRejection=!!E,this.allowStaleOnFetchRejection=!!y,this.allowStaleOnFetchAbort=!!O,this.ignoreFetchAbort=!!T,this.maxEntrySize!==0){if(this.#c!==0&&!v(this.#c))throw new TypeError("maxSize must be a positive integer if specified");if(!v(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#H();}if(this.allowStale=!!o,this.noDeleteOnStaleGet=!!S,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!l,this.ttlResolution=v(s)||s===0?s:1,this.ttlAutopurge=!!r,this.ttl=i||0,this.ttl){if(!v(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#D();}if(this.#h===0&&this.ttl===0&&this.#c===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#h&&!this.#c){let z="LRU_CACHE_UNBOUNDED";K(z)&&(U.add(z),j("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",z,n));}}getRemainingTTL(e){return this.#s.has(e)?1/0:0}#D(){let e=new F(this.#h),t=new F(this.#h);this.#d=e,this.#w=t,this.#N=(r,a,l=C.now())=>{if(t[r]=a!==0?l:0,e[r]=a,a!==0&&this.ttlAutopurge){let o=setTimeout(()=>{this.#g(r)&&this.#G(this.#i[r],"expire");},a+1);o.unref&&o.unref();}},this.#F=r=>{t[r]=e[r]!==0?C.now():0;},this.#T=(r,a)=>{if(e[a]){let l=e[a],o=t[a];if(!l||!o)return;r.ttl=l,r.start=o,r.now=i||s();let p=r.now-o;r.remainingTTL=l-p;}};let i=0,s=()=>{let r=C.now();if(this.ttlResolution>0){i=r;let a=setTimeout(()=>i=0,this.ttlResolution);a.unref&&a.unref();}return r};this.getRemainingTTL=r=>{let a=this.#s.get(r);if(a===void 0)return 0;let l=e[a],o=t[a];if(!l||!o)return 1/0;let p=(i||s())-o;return l-p},this.#g=r=>{let a=t[r],l=e[r];return !!l&&!!a&&(i||s())-a>l};}#F=()=>{};#T=()=>{};#N=()=>{};#g=()=>false;#H(){let e=new F(this.#h);this.#S=0,this.#y=e,this.#A=t=>{this.#S-=e[t],e[t]=0;},this.#W=(t,i,s,r)=>{if(this.#t(i))return 0;if(!v(s))if(r){if(typeof r!="function")throw new TypeError("sizeCalculation must be a function");if(s=r(i,t),!v(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return s},this.#L=(t,i,s)=>{if(e[t]=i,this.#c){let r=this.#c-e[t];for(;this.#S>r;)this.#V(true);}this.#S+=e[t],s&&(s.entrySize=i,s.totalCalculatedSize=this.#S);};}#A=e=>{};#L=(e,t,i)=>{};#W=(e,t,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#E({allowStale:e=this.allowStale}={}){if(this.#r)for(let t=this.#n;!(!this.#P(t)||((e||!this.#g(t))&&(yield t),t===this.#o));)t=this.#f[t];}*#v({allowStale:e=this.allowStale}={}){if(this.#r)for(let t=this.#o;!(!this.#P(t)||((e||!this.#g(t))&&(yield t),t===this.#n));)t=this.#l[t];}#P(e){return e!==void 0&&this.#s.get(this.#i[e])===e}*entries(){for(let e of this.#E())this.#e[e]!==void 0&&this.#i[e]!==void 0&&!this.#t(this.#e[e])&&(yield [this.#i[e],this.#e[e]]);}*rentries(){for(let e of this.#v())this.#e[e]!==void 0&&this.#i[e]!==void 0&&!this.#t(this.#e[e])&&(yield [this.#i[e],this.#e[e]]);}*keys(){for(let e of this.#E()){let t=this.#i[e];t!==void 0&&!this.#t(this.#e[e])&&(yield t);}}*rkeys(){for(let e of this.#v()){let t=this.#i[e];t!==void 0&&!this.#t(this.#e[e])&&(yield t);}}*values(){for(let e of this.#E())this.#e[e]!==void 0&&!this.#t(this.#e[e])&&(yield this.#e[e]);}*rvalues(){for(let e of this.#v())this.#e[e]!==void 0&&!this.#t(this.#e[e])&&(yield this.#e[e]);}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let i of this.#E()){let s=this.#e[i],r=this.#t(s)?s.__staleWhileFetching:s;if(r!==void 0&&e(r,this.#i[i],this))return this.get(this.#i[i],t)}}forEach(e,t=this){for(let i of this.#E()){let s=this.#e[i],r=this.#t(s)?s.__staleWhileFetching:s;r!==void 0&&e.call(t,r,this.#i[i],this);}}rforEach(e,t=this){for(let i of this.#v()){let s=this.#e[i],r=this.#t(s)?s.__staleWhileFetching:s;r!==void 0&&e.call(t,r,this.#i[i],this);}}purgeStale(){let e=false;for(let t of this.#v({allowStale:true}))this.#g(t)&&(this.#G(this.#i[t],"expire"),e=true);return e}info(e){let t=this.#s.get(e);if(t===void 0)return;let i=this.#e[t],s=this.#t(i)?i.__staleWhileFetching:i;if(s===void 0)return;let r={value:s};if(this.#d&&this.#w){let a=this.#d[t],l=this.#w[t];if(a&&l){let o=a-(C.now()-l);r.ttl=o,r.start=Date.now();}}return this.#y&&(r.size=this.#y[t]),r}dump(){let e=[];for(let t of this.#E({allowStale:true})){let i=this.#i[t],s=this.#e[t],r=this.#t(s)?s.__staleWhileFetching:s;if(r===void 0||i===void 0)continue;let a={value:r};if(this.#d&&this.#w){a.ttl=this.#d[t];let l=C.now()-this.#w[t];a.start=Math.floor(Date.now()-l);}this.#y&&(a.size=this.#y[t]),e.unshift([i,a]);}return e}load(e){this.clear();for(let[t,i]of e){if(i.start){let s=Date.now()-i.start;i.start=C.now()-s;}this.set(t,i.value,i);}}set(e,t,i={}){if(t===void 0)return this.delete(e),this;let{ttl:s=this.ttl,start:r,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:l=this.sizeCalculation,status:o}=i,{noUpdateTTL:p=this.noUpdateTTL}=i,w=this.#W(e,t,i.size||0,l);if(this.maxEntrySize&&w>this.maxEntrySize)return o&&(o.set="miss",o.maxEntrySizeExceeded=true),this.#G(e,"set"),this;let c=this.#r===0?void 0:this.#s.get(e);if(c===void 0)c=this.#r===0?this.#n:this.#b.length!==0?this.#b.pop():this.#r===this.#h?this.#V(false):this.#r,this.#i[c]=e,this.#e[c]=t,this.#s.set(e,c),this.#l[this.#n]=c,this.#f[c]=this.#n,this.#n=c,this.#r++,this.#L(c,w,o),o&&(o.set="add"),p=false,this.#I&&this.#C?.(t,e,"add");else {this.#O(c);let d=this.#e[c];if(t!==d){if(this.#z&&this.#t(d)){d.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:g}=d;g!==void 0&&!a&&(this.#_&&this.#m?.(g,e,"set"),this.#u&&this.#a?.push([g,e,"set"]));}else a||(this.#_&&this.#m?.(d,e,"set"),this.#u&&this.#a?.push([d,e,"set"]));if(this.#A(c),this.#L(c,w,o),this.#e[c]=t,o){o.set="replace";let g=d&&this.#t(d)?d.__staleWhileFetching:d;g!==void 0&&(o.oldValue=g);}}else o&&(o.set="update");this.#I&&this.onInsert?.(t,e,t===d?"update":"replace");}if(s!==0&&!this.#d&&this.#D(),this.#d&&(p||this.#N(c,s,r),o&&this.#T(o,c)),!a&&this.#u&&this.#a){let d=this.#a,g;for(;g=d?.shift();)this.#p?.(...g);}return this}pop(){try{for(;this.#r;){let e=this.#e[this.#o];if(this.#V(!0),this.#t(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#u&&this.#a){let e=this.#a,t;for(;t=e?.shift();)this.#p?.(...t);}}}#V(e){let t=this.#o,i=this.#i[t],s=this.#e[t];return this.#z&&this.#t(s)?s.__abortController.abort(new Error("evicted")):(this.#_||this.#u)&&(this.#_&&this.#m?.(s,i,"evict"),this.#u&&this.#a?.push([s,i,"evict"])),this.#A(t),e&&(this.#i[t]=void 0,this.#e[t]=void 0,this.#b.push(t)),this.#r===1?(this.#o=this.#n=0,this.#b.length=0):this.#o=this.#l[t],this.#s.delete(i),this.#r--,t}has(e,t={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=t,r=this.#s.get(e);if(r!==void 0){let a=this.#e[r];if(this.#t(a)&&a.__staleWhileFetching===void 0)return false;if(this.#g(r))s&&(s.has="stale",this.#T(s,r));else return i&&this.#F(r),s&&(s.has="hit",this.#T(s,r)),true}else s&&(s.has="miss");return false}peek(e,t={}){let{allowStale:i=this.allowStale}=t,s=this.#s.get(e);if(s===void 0||!i&&this.#g(s))return;let r=this.#e[s];return this.#t(r)?r.__staleWhileFetching:r}#R(e,t,i,s){let r=t===void 0?void 0:this.#e[t];if(this.#t(r))return r;let a=new L,{signal:l}=i;l?.addEventListener("abort",()=>a.abort(l.reason),{signal:a.signal});let o={signal:a.signal,options:i,context:s},p=(m,_=false)=>{let{aborted:u}=a.signal,b=i.ignoreFetchAbort&&m!==void 0;if(i.status&&(u&&!_?(i.status.fetchAborted=true,i.status.fetchError=a.signal.reason,b&&(i.status.fetchAbortIgnored=true)):i.status.fetchResolved=true),u&&!b&&!_)return c(a.signal.reason);let E=g;return this.#e[t]===g&&(m===void 0?E.__staleWhileFetching?this.#e[t]=E.__staleWhileFetching:this.#G(e,"fetch"):(i.status&&(i.status.fetchUpdated=true),this.set(e,m,o.options))),m},w=m=>(i.status&&(i.status.fetchRejected=true,i.status.fetchError=m),c(m)),c=m=>{let{aborted:_}=a.signal,u=_&&i.allowStaleOnFetchAbort,b=u||i.allowStaleOnFetchRejection,E=b||i.noDeleteOnFetchRejection,S=g;if(this.#e[t]===g&&(!E||S.__staleWhileFetching===void 0?this.#G(e,"fetch"):u||(this.#e[t]=S.__staleWhileFetching)),b)return i.status&&S.__staleWhileFetching!==void 0&&(i.status.returnedStale=true),S.__staleWhileFetching;if(S.__returned===S)throw m},d=(m,_)=>{let u=this.#x?.(e,r,o);u&&u instanceof Promise&&u.then(b=>m(b===void 0?void 0:b),_),a.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(m(void 0),i.allowStaleOnFetchAbort&&(m=b=>p(b,true)));});};i.status&&(i.status.fetchDispatched=true);let g=new Promise(d).then(p,w),G=Object.assign(g,{__abortController:a,__staleWhileFetching:r,__returned:void 0});return t===void 0?(this.set(e,G,{...o.options,status:void 0}),t=this.#s.get(e)):this.#e[t]=G,G}#t(e){if(!this.#z)return false;let t=e;return !!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof L}async fetch(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:l=this.noDisposeOnSet,size:o=0,sizeCalculation:p=this.sizeCalculation,noUpdateTTL:w=this.noUpdateTTL,noDeleteOnFetchRejection:c=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:g=this.ignoreFetchAbort,allowStaleOnFetchAbort:G=this.allowStaleOnFetchAbort,context:m,forceRefresh:_=false,status:u,signal:b}=t;if(!this.#z)return u&&(u.fetch="get"),this.get(e,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:r,status:u});let E={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:r,ttl:a,noDisposeOnSet:l,size:o,sizeCalculation:p,noUpdateTTL:w,noDeleteOnFetchRejection:c,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:G,ignoreFetchAbort:g,status:u,signal:b},S=this.#s.get(e);if(S===void 0){u&&(u.fetch="miss");let y=this.#R(e,S,E,m);return y.__returned=y}else {let y=this.#e[S];if(this.#t(y)){let R=i&&y.__staleWhileFetching!==void 0;return u&&(u.fetch="inflight",R&&(u.returnedStale=true)),R?y.__staleWhileFetching:y.__returned=y}let O=this.#g(S);if(!_&&!O)return u&&(u.fetch="hit"),this.#O(S),s&&this.#F(S),u&&this.#T(u,S),y;let T=this.#R(e,S,E,m),z=T.__staleWhileFetching!==void 0&&i;return u&&(u.fetch=O?"stale":"refresh",z&&O&&(u.returnedStale=true)),z?T.__staleWhileFetching:T.__returned=T}}async forceFetch(e,t={}){let i=await this.fetch(e,t);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(e,t={}){let i=this.#M;if(!i)throw new Error("no memoMethod provided to constructor");let{context:s,forceRefresh:r,...a}=t,l=this.get(e,a);if(!r&&l!==void 0)return l;let o=i(e,l,{options:a,context:s});return this.set(e,o,a),o}get(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,status:a}=t,l=this.#s.get(e);if(l!==void 0){let o=this.#e[l],p=this.#t(o);return a&&this.#T(a,l),this.#g(l)?(a&&(a.get="stale"),p?(a&&i&&o.__staleWhileFetching!==void 0&&(a.returnedStale=true),i?o.__staleWhileFetching:void 0):(r||this.#G(e,"expire"),a&&i&&(a.returnedStale=true),i?o:void 0)):(a&&(a.get="hit"),p?o.__staleWhileFetching:(this.#O(l),s&&this.#F(l),o))}else a&&(a.get="miss");}#U(e,t){this.#f[t]=e,this.#l[e]=t;}#O(e){e!==this.#n&&(e===this.#o?this.#o=this.#l[e]:this.#U(this.#f[e],this.#l[e]),this.#U(this.#n,e),this.#n=e);}delete(e){return this.#G(e,"delete")}#G(e,t){let i=false;if(this.#r!==0){let s=this.#s.get(e);if(s!==void 0)if(i=true,this.#r===1)this.#j(t);else {this.#A(s);let r=this.#e[s];if(this.#t(r)?r.__abortController.abort(new Error("deleted")):(this.#_||this.#u)&&(this.#_&&this.#m?.(r,e,t),this.#u&&this.#a?.push([r,e,t])),this.#s.delete(e),this.#i[s]=void 0,this.#e[s]=void 0,s===this.#n)this.#n=this.#f[s];else if(s===this.#o)this.#o=this.#l[s];else {let a=this.#f[s];this.#l[a]=this.#l[s];let l=this.#l[s];this.#f[l]=this.#f[s];}this.#r--,this.#b.push(s);}}if(this.#u&&this.#a?.length){let s=this.#a,r;for(;r=s?.shift();)this.#p?.(...r);}return i}clear(){return this.#j("delete")}#j(e){for(let t of this.#v({allowStale:true})){let i=this.#e[t];if(this.#t(i))i.__abortController.abort(new Error("deleted"));else {let s=this.#i[t];this.#_&&this.#m?.(i,s,e),this.#u&&this.#a?.push([i,s,e]);}}if(this.#s.clear(),this.#e.fill(void 0),this.#i.fill(void 0),this.#d&&this.#w&&(this.#d.fill(0),this.#w.fill(0)),this.#y&&this.#y.fill(0),this.#o=0,this.#n=0,this.#b.length=0,this.#S=0,this.#r=0,this.#u&&this.#a){let t=this.#a,i;for(;i=t?.shift();)this.#p?.(...i);}}};var A=class{cache;map=new Map;constructor(e){this.cache=new V({max:e.cacheSize}),this.map=new Map;}get[Symbol.iterator](){return this.map[Symbol.iterator]}get[Symbol.toStringTag](){return this.map[Symbol.toStringTag]}clear(){return this.cache.clear(),this.map.clear()}delete(e){let t=this.map.delete(e);return t&&this.cache.delete(e),t}get forEach(){return this.map.forEach}get(e){let t=this.cache.get(e);return t||this.map.get(e)}has(e){return this.map.has(e)}set(e,t){return this.map.set(e,t),this.cache.set(e,t),this}get size(){return this.map.size}get entries(){return this.map.entries}keys(){return this.map.keys()}get values(){return this.map.values}};var h=class n{static storage=new A({cacheSize:20});static startingStorage=[];static flags=Array();static tempStorage=new Map;static tempStorageDeadlines=new Map;constructor(){}static clearOldTempVariables(e){n.tempStorageDeadlines.forEach((t,i)=>{t>e&&(n.tempStorage.delete(i),n.tempStorageDeadlines.delete(i),n.storage.cache.delete(i));});}static setVariable(e,t){let i=n.tempStorage.has(e);t==null?(n.storage.map.delete(e),!i&&n.storage.cache.delete(e)):(n.storage.map.set(e,t),!i&&n.storage.cache.set(e,t));}static getVariable(e){let t=n.storage.cache.get(e);return t===void 0&&(t=n.tempStorage.get(e)),t===void 0&&(t=n.storage.map.get(e)),I(t)}static removeVariable(e){n.storage.delete(e);}static setFlag(e,t){if(t)this.flags.includes(e)||this.flags.push(e);else {let i=this.flags.indexOf(e);i>-1&&this.flags.splice(i,1);}}static getFlag(e){return this.flags.includes(e)}};var W=class{get storage(){return h.storage.map}get cache(){return h.storage.cache}get flags(){return h.flags}get tempStorage(){return h.tempStorage}get tempStorageDeadlines(){return h.tempStorageDeadlines}set startingStorage(e){let t=[];Object.entries(e).forEach(([i,s])=>{t.push({key:i,value:s});}),h.startingStorage=t;}setVariable(e,t){return h.setVariable(e,t)}getVariable(e){return h.getVariable(e)}removeVariable(e){return h.removeVariable(e)}setTempVariable(e,t){if(t==null){this.removeTempVariable(e);return}else h.tempStorage.set(e,t),h.storage.cache.set(e,t),h.tempStorageDeadlines.has(e)||h.tempStorageDeadlines.set(e,x.openedLabels);}removeTempVariable(e){h.tempStorage.has(e)&&(h.tempStorage.delete(e),h.tempStorageDeadlines.delete(e),h.storage.cache.delete(e));}setFlag(e,t){return h.setFlag(e,t)}getFlag(e){return h.getFlag(e)}clear(){this.storage.clear(),this.cache.clear(),h.flags=[],h.tempStorage.clear(),h.tempStorageDeadlines.clear(),h.startingStorage.forEach(({key:e,value:t})=>{this.storage.set(e,t);});}export(){let e=[];[...this.storage.keys()].forEach(s=>{e.push({key:s,value:this.storage.get(s)});});let t=[];[...h.tempStorage.keys()].forEach(s=>{t.push({key:s,value:h.tempStorage.get(s)});});let i=[];return [...h.tempStorageDeadlines.keys()].forEach(s=>{i.push({key:s,value:h.tempStorageDeadlines.get(s)});}),I({base:e,temp:t,tempDeadlines:i,flags:h.flags})}restore(e){this.clear();try{e?(Array.isArray(e)&&e.forEach(t=>{if(t.key==="___temp_storage___"){let i=t.value;Object.entries(i).forEach(([s,r])=>{h.tempStorage.set(s,r);});}else if(t.key==="___temp_storage_deadlines___"){let i=t.value;Object.entries(i).forEach(([s,r])=>{h.tempStorageDeadlines.set(s,r);});}else t.key==="___flags___"?t.value.forEach(s=>{h.flags.push(s);}):this.storage.set(t.key,t.value);}),"base"in e&&"temp"in e&&"tempDeadlines"in e?(e.base?.forEach(t=>{this.storage.set(t.key,t.value);}),e.temp?.forEach(t=>{h.tempStorage.set(t.key,t.value);}),e.tempDeadlines?.forEach(t=>{h.tempStorageDeadlines.set(t.key,t.value);})):Object.entries(e).forEach(([t,i])=>{t==="___temp_storage___"?Object.entries(i).forEach(([s,r])=>{h.tempStorage.set(s,r);}):t==="___temp_storage_deadlines___"?Object.entries(i).forEach(([s,r])=>{h.tempStorageDeadlines.set(s,r);}):t==="___flags___"?i.forEach(s=>{h.flags.push(s);}):this.storage.set(t,i);})):f.warn("No storage data found");}catch(t){f.error("Error importing data",t);}}};module.exports=W;
@@ -1 +1 @@
1
- var f;(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)))(f||={});var x=class n{static init(e){n._getStepCounter=e.getStepCounter,n._setStepCounter=e.setStepCounter,n._getCurrentGameStepState=e.getCurrentGameStepState,n._restoreGameStepState=e.restoreGameStepState,n._getOpenedLabels=e.getOpenedLabels,e.onGoNextEnd&&(n._onGoNextEnd=e.onGoNextEnd),n._getVariable=e.getVariable,n._setVariable=e.setVariable,n._removeVariable=e.removeVariable,n._getFlag=e.getFlag,n._setFlag=e.setFlag,e.onLabelClosing&&(n._onLabelClosing=e.onLabelClosing),n._addHistoryItem=e.addHistoryItem,n._getCurrentStepsRunningNumber=e.getCurrentStepsRunningNumber,n._getCharacter=e.getCharacter;}static _getStepCounter=()=>{throw f.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static _setStepCounter=()=>{throw f.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get stepCounter(){return n._getStepCounter()}static set stepCounter(e){n._setStepCounter(e);}static _getCurrentGameStepState=()=>{throw f.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get currentGameStepState(){return n._getCurrentGameStepState()}static _restoreGameStepState=()=>{throw f.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get restoreGameStepState(){return n._restoreGameStepState}static _getOpenedLabels=()=>{throw f.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get openedLabels(){return n._getOpenedLabels()}static _onGoNextEnd=async()=>{};static get onGoNextEnd(){return n._onGoNextEnd}static _getVariable=()=>{throw f.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get getVariable(){return n._getVariable}static _setVariable=()=>{throw f.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get setVariable(){return n._setVariable}static _removeVariable=()=>{throw f.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get removeVariable(){return n._removeVariable}static _getFlag=()=>{throw f.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get getFlag(){return n._getFlag}static _setFlag=()=>{throw f.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get setFlag(){return n._setFlag}static _onLabelClosing=()=>{};static get onLabelClosing(){return n._onLabelClosing}static _addHistoryItem=()=>{throw f.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get addHistoryItem(){return n._addHistoryItem}static _getCurrentStepsRunningNumber=()=>{throw f.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get currentStepsRunningNumber(){return n._getCurrentStepsRunningNumber()}static _getCharacter=()=>{throw f.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented.")};static get getCharacter(){return n._getCharacter}static onEnd;static onError};function I(n){try{if(typeof n>"u")return n;let e=JSON.stringify(n);return JSON.parse(e)}catch(e){throw f.error("Error creating exportable element",n,e),new Error("[Pixi\u2019VN] Error creating exportable element")}}var C=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,U=new Set,D=typeof process=="object"&&process?process:{},j=(n,e,t,i)=>{typeof D.emitWarning=="function"?D.emitWarning(n,e,t,i):console.error(`[${t}] ${e}: ${n}`);},L=globalThis.AbortController,P=globalThis.AbortSignal;if(typeof L>"u"){P=class{onabort;_onabort=[];reason;aborted=false;addEventListener(i,s){this._onabort.push(s);}},L=class{constructor(){e();}signal=new P;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 n=D.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{n&&(n=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",e));};}var K=n=>!U.has(n),v=n=>n&&n===Math.floor(n)&&n>0&&isFinite(n),H=n=>v(n)?n<=Math.pow(2,8)?Uint8Array:n<=Math.pow(2,16)?Uint16Array:n<=Math.pow(2,32)?Uint32Array:n<=Number.MAX_SAFE_INTEGER?F:null:null,F=class extends Array{constructor(e){super(e),this.fill(0);}},N=class n{heap;length;static#h=false;static create(e){let t=H(e);if(!t)return [];n.#h=true;let i=new n(e,t);return n.#h=false,i}constructor(e,t){if(!n.#h)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0;}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}},V=class n{#h;#c;#m;#C;#p;#x;#M;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#r;#S;#s;#i;#e;#l;#f;#o;#n;#b;#a;#y;#w;#d;#_;#z;#u;#I;static unsafeExposeInternals(e){return {starts:e.#w,ttls:e.#d,sizes:e.#y,keyMap:e.#s,keyList:e.#i,valList:e.#e,next:e.#l,prev:e.#f,get head(){return e.#o},get tail(){return e.#n},free:e.#b,isBackgroundFetch:t=>e.#t(t),backgroundFetch:(t,i,s,r)=>e.#R(t,i,s,r),moveToTail:t=>e.#O(t),indexes:t=>e.#E(t),rindexes:t=>e.#v(t),isStale:t=>e.#g(t)}}get max(){return this.#h}get maxSize(){return this.#c}get calculatedSize(){return this.#S}get size(){return this.#r}get fetchMethod(){return this.#x}get memoMethod(){return this.#M}get dispose(){return this.#m}get onInsert(){return this.#C}get disposeAfter(){return this.#p}constructor(e){let{max:t=0,ttl:i,ttlResolution:s=1,ttlAutopurge:r,updateAgeOnGet:a,updateAgeOnHas:l,allowStale:o,dispose:p,onInsert:w,disposeAfter:c,noDisposeOnSet:d,noUpdateTTL:g,maxSize:G=0,maxEntrySize:m=0,sizeCalculation:_,fetchMethod:u,memoMethod:b,noDeleteOnFetchRejection:E,noDeleteOnStaleGet:S,allowStaleOnFetchRejection:y,allowStaleOnFetchAbort:O,ignoreFetchAbort:T}=e;if(t!==0&&!v(t))throw new TypeError("max option must be a nonnegative integer");let M=t?H(t):Array;if(!M)throw new Error("invalid max value: "+t);if(this.#h=t,this.#c=G,this.maxEntrySize=m||this.#c,this.sizeCalculation=_,this.sizeCalculation){if(!this.#c&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(b!==void 0&&typeof b!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#M=b,u!==void 0&&typeof u!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#x=u,this.#z=!!u,this.#s=new Map,this.#i=new Array(t).fill(void 0),this.#e=new Array(t).fill(void 0),this.#l=new M(t),this.#f=new M(t),this.#o=0,this.#n=0,this.#b=N.create(t),this.#r=0,this.#S=0,typeof p=="function"&&(this.#m=p),typeof w=="function"&&(this.#C=w),typeof c=="function"?(this.#p=c,this.#a=[]):(this.#p=void 0,this.#a=void 0),this.#_=!!this.#m,this.#I=!!this.#C,this.#u=!!this.#p,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!g,this.noDeleteOnFetchRejection=!!E,this.allowStaleOnFetchRejection=!!y,this.allowStaleOnFetchAbort=!!O,this.ignoreFetchAbort=!!T,this.maxEntrySize!==0){if(this.#c!==0&&!v(this.#c))throw new TypeError("maxSize must be a positive integer if specified");if(!v(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#H();}if(this.allowStale=!!o,this.noDeleteOnStaleGet=!!S,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!l,this.ttlResolution=v(s)||s===0?s:1,this.ttlAutopurge=!!r,this.ttl=i||0,this.ttl){if(!v(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#D();}if(this.#h===0&&this.ttl===0&&this.#c===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#h&&!this.#c){let z="LRU_CACHE_UNBOUNDED";K(z)&&(U.add(z),j("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",z,n));}}getRemainingTTL(e){return this.#s.has(e)?1/0:0}#D(){let e=new F(this.#h),t=new F(this.#h);this.#d=e,this.#w=t,this.#N=(r,a,l=C.now())=>{if(t[r]=a!==0?l:0,e[r]=a,a!==0&&this.ttlAutopurge){let o=setTimeout(()=>{this.#g(r)&&this.#G(this.#i[r],"expire");},a+1);o.unref&&o.unref();}},this.#F=r=>{t[r]=e[r]!==0?C.now():0;},this.#T=(r,a)=>{if(e[a]){let l=e[a],o=t[a];if(!l||!o)return;r.ttl=l,r.start=o,r.now=i||s();let p=r.now-o;r.remainingTTL=l-p;}};let i=0,s=()=>{let r=C.now();if(this.ttlResolution>0){i=r;let a=setTimeout(()=>i=0,this.ttlResolution);a.unref&&a.unref();}return r};this.getRemainingTTL=r=>{let a=this.#s.get(r);if(a===void 0)return 0;let l=e[a],o=t[a];if(!l||!o)return 1/0;let p=(i||s())-o;return l-p},this.#g=r=>{let a=t[r],l=e[r];return !!l&&!!a&&(i||s())-a>l};}#F=()=>{};#T=()=>{};#N=()=>{};#g=()=>false;#H(){let e=new F(this.#h);this.#S=0,this.#y=e,this.#A=t=>{this.#S-=e[t],e[t]=0;},this.#W=(t,i,s,r)=>{if(this.#t(i))return 0;if(!v(s))if(r){if(typeof r!="function")throw new TypeError("sizeCalculation must be a function");if(s=r(i,t),!v(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return s},this.#L=(t,i,s)=>{if(e[t]=i,this.#c){let r=this.#c-e[t];for(;this.#S>r;)this.#V(true);}this.#S+=e[t],s&&(s.entrySize=i,s.totalCalculatedSize=this.#S);};}#A=e=>{};#L=(e,t,i)=>{};#W=(e,t,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#E({allowStale:e=this.allowStale}={}){if(this.#r)for(let t=this.#n;!(!this.#P(t)||((e||!this.#g(t))&&(yield t),t===this.#o));)t=this.#f[t];}*#v({allowStale:e=this.allowStale}={}){if(this.#r)for(let t=this.#o;!(!this.#P(t)||((e||!this.#g(t))&&(yield t),t===this.#n));)t=this.#l[t];}#P(e){return e!==void 0&&this.#s.get(this.#i[e])===e}*entries(){for(let e of this.#E())this.#e[e]!==void 0&&this.#i[e]!==void 0&&!this.#t(this.#e[e])&&(yield [this.#i[e],this.#e[e]]);}*rentries(){for(let e of this.#v())this.#e[e]!==void 0&&this.#i[e]!==void 0&&!this.#t(this.#e[e])&&(yield [this.#i[e],this.#e[e]]);}*keys(){for(let e of this.#E()){let t=this.#i[e];t!==void 0&&!this.#t(this.#e[e])&&(yield t);}}*rkeys(){for(let e of this.#v()){let t=this.#i[e];t!==void 0&&!this.#t(this.#e[e])&&(yield t);}}*values(){for(let e of this.#E())this.#e[e]!==void 0&&!this.#t(this.#e[e])&&(yield this.#e[e]);}*rvalues(){for(let e of this.#v())this.#e[e]!==void 0&&!this.#t(this.#e[e])&&(yield this.#e[e]);}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let i of this.#E()){let s=this.#e[i],r=this.#t(s)?s.__staleWhileFetching:s;if(r!==void 0&&e(r,this.#i[i],this))return this.get(this.#i[i],t)}}forEach(e,t=this){for(let i of this.#E()){let s=this.#e[i],r=this.#t(s)?s.__staleWhileFetching:s;r!==void 0&&e.call(t,r,this.#i[i],this);}}rforEach(e,t=this){for(let i of this.#v()){let s=this.#e[i],r=this.#t(s)?s.__staleWhileFetching:s;r!==void 0&&e.call(t,r,this.#i[i],this);}}purgeStale(){let e=false;for(let t of this.#v({allowStale:true}))this.#g(t)&&(this.#G(this.#i[t],"expire"),e=true);return e}info(e){let t=this.#s.get(e);if(t===void 0)return;let i=this.#e[t],s=this.#t(i)?i.__staleWhileFetching:i;if(s===void 0)return;let r={value:s};if(this.#d&&this.#w){let a=this.#d[t],l=this.#w[t];if(a&&l){let o=a-(C.now()-l);r.ttl=o,r.start=Date.now();}}return this.#y&&(r.size=this.#y[t]),r}dump(){let e=[];for(let t of this.#E({allowStale:true})){let i=this.#i[t],s=this.#e[t],r=this.#t(s)?s.__staleWhileFetching:s;if(r===void 0||i===void 0)continue;let a={value:r};if(this.#d&&this.#w){a.ttl=this.#d[t];let l=C.now()-this.#w[t];a.start=Math.floor(Date.now()-l);}this.#y&&(a.size=this.#y[t]),e.unshift([i,a]);}return e}load(e){this.clear();for(let[t,i]of e){if(i.start){let s=Date.now()-i.start;i.start=C.now()-s;}this.set(t,i.value,i);}}set(e,t,i={}){if(t===void 0)return this.delete(e),this;let{ttl:s=this.ttl,start:r,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:l=this.sizeCalculation,status:o}=i,{noUpdateTTL:p=this.noUpdateTTL}=i,w=this.#W(e,t,i.size||0,l);if(this.maxEntrySize&&w>this.maxEntrySize)return o&&(o.set="miss",o.maxEntrySizeExceeded=true),this.#G(e,"set"),this;let c=this.#r===0?void 0:this.#s.get(e);if(c===void 0)c=this.#r===0?this.#n:this.#b.length!==0?this.#b.pop():this.#r===this.#h?this.#V(false):this.#r,this.#i[c]=e,this.#e[c]=t,this.#s.set(e,c),this.#l[this.#n]=c,this.#f[c]=this.#n,this.#n=c,this.#r++,this.#L(c,w,o),o&&(o.set="add"),p=false,this.#I&&this.#C?.(t,e,"add");else {this.#O(c);let d=this.#e[c];if(t!==d){if(this.#z&&this.#t(d)){d.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:g}=d;g!==void 0&&!a&&(this.#_&&this.#m?.(g,e,"set"),this.#u&&this.#a?.push([g,e,"set"]));}else a||(this.#_&&this.#m?.(d,e,"set"),this.#u&&this.#a?.push([d,e,"set"]));if(this.#A(c),this.#L(c,w,o),this.#e[c]=t,o){o.set="replace";let g=d&&this.#t(d)?d.__staleWhileFetching:d;g!==void 0&&(o.oldValue=g);}}else o&&(o.set="update");this.#I&&this.onInsert?.(t,e,t===d?"update":"replace");}if(s!==0&&!this.#d&&this.#D(),this.#d&&(p||this.#N(c,s,r),o&&this.#T(o,c)),!a&&this.#u&&this.#a){let d=this.#a,g;for(;g=d?.shift();)this.#p?.(...g);}return this}pop(){try{for(;this.#r;){let e=this.#e[this.#o];if(this.#V(!0),this.#t(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#u&&this.#a){let e=this.#a,t;for(;t=e?.shift();)this.#p?.(...t);}}}#V(e){let t=this.#o,i=this.#i[t],s=this.#e[t];return this.#z&&this.#t(s)?s.__abortController.abort(new Error("evicted")):(this.#_||this.#u)&&(this.#_&&this.#m?.(s,i,"evict"),this.#u&&this.#a?.push([s,i,"evict"])),this.#A(t),e&&(this.#i[t]=void 0,this.#e[t]=void 0,this.#b.push(t)),this.#r===1?(this.#o=this.#n=0,this.#b.length=0):this.#o=this.#l[t],this.#s.delete(i),this.#r--,t}has(e,t={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=t,r=this.#s.get(e);if(r!==void 0){let a=this.#e[r];if(this.#t(a)&&a.__staleWhileFetching===void 0)return false;if(this.#g(r))s&&(s.has="stale",this.#T(s,r));else return i&&this.#F(r),s&&(s.has="hit",this.#T(s,r)),true}else s&&(s.has="miss");return false}peek(e,t={}){let{allowStale:i=this.allowStale}=t,s=this.#s.get(e);if(s===void 0||!i&&this.#g(s))return;let r=this.#e[s];return this.#t(r)?r.__staleWhileFetching:r}#R(e,t,i,s){let r=t===void 0?void 0:this.#e[t];if(this.#t(r))return r;let a=new L,{signal:l}=i;l?.addEventListener("abort",()=>a.abort(l.reason),{signal:a.signal});let o={signal:a.signal,options:i,context:s},p=(m,_=false)=>{let{aborted:u}=a.signal,b=i.ignoreFetchAbort&&m!==void 0;if(i.status&&(u&&!_?(i.status.fetchAborted=true,i.status.fetchError=a.signal.reason,b&&(i.status.fetchAbortIgnored=true)):i.status.fetchResolved=true),u&&!b&&!_)return c(a.signal.reason);let E=g;return this.#e[t]===g&&(m===void 0?E.__staleWhileFetching?this.#e[t]=E.__staleWhileFetching:this.#G(e,"fetch"):(i.status&&(i.status.fetchUpdated=true),this.set(e,m,o.options))),m},w=m=>(i.status&&(i.status.fetchRejected=true,i.status.fetchError=m),c(m)),c=m=>{let{aborted:_}=a.signal,u=_&&i.allowStaleOnFetchAbort,b=u||i.allowStaleOnFetchRejection,E=b||i.noDeleteOnFetchRejection,S=g;if(this.#e[t]===g&&(!E||S.__staleWhileFetching===void 0?this.#G(e,"fetch"):u||(this.#e[t]=S.__staleWhileFetching)),b)return i.status&&S.__staleWhileFetching!==void 0&&(i.status.returnedStale=true),S.__staleWhileFetching;if(S.__returned===S)throw m},d=(m,_)=>{let u=this.#x?.(e,r,o);u&&u instanceof Promise&&u.then(b=>m(b===void 0?void 0:b),_),a.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(m(void 0),i.allowStaleOnFetchAbort&&(m=b=>p(b,true)));});};i.status&&(i.status.fetchDispatched=true);let g=new Promise(d).then(p,w),G=Object.assign(g,{__abortController:a,__staleWhileFetching:r,__returned:void 0});return t===void 0?(this.set(e,G,{...o.options,status:void 0}),t=this.#s.get(e)):this.#e[t]=G,G}#t(e){if(!this.#z)return false;let t=e;return !!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof L}async fetch(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:l=this.noDisposeOnSet,size:o=0,sizeCalculation:p=this.sizeCalculation,noUpdateTTL:w=this.noUpdateTTL,noDeleteOnFetchRejection:c=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:g=this.ignoreFetchAbort,allowStaleOnFetchAbort:G=this.allowStaleOnFetchAbort,context:m,forceRefresh:_=false,status:u,signal:b}=t;if(!this.#z)return u&&(u.fetch="get"),this.get(e,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:r,status:u});let E={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:r,ttl:a,noDisposeOnSet:l,size:o,sizeCalculation:p,noUpdateTTL:w,noDeleteOnFetchRejection:c,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:G,ignoreFetchAbort:g,status:u,signal:b},S=this.#s.get(e);if(S===void 0){u&&(u.fetch="miss");let y=this.#R(e,S,E,m);return y.__returned=y}else {let y=this.#e[S];if(this.#t(y)){let R=i&&y.__staleWhileFetching!==void 0;return u&&(u.fetch="inflight",R&&(u.returnedStale=true)),R?y.__staleWhileFetching:y.__returned=y}let O=this.#g(S);if(!_&&!O)return u&&(u.fetch="hit"),this.#O(S),s&&this.#F(S),u&&this.#T(u,S),y;let T=this.#R(e,S,E,m),z=T.__staleWhileFetching!==void 0&&i;return u&&(u.fetch=O?"stale":"refresh",z&&O&&(u.returnedStale=true)),z?T.__staleWhileFetching:T.__returned=T}}async forceFetch(e,t={}){let i=await this.fetch(e,t);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(e,t={}){let i=this.#M;if(!i)throw new Error("no memoMethod provided to constructor");let{context:s,forceRefresh:r,...a}=t,l=this.get(e,a);if(!r&&l!==void 0)return l;let o=i(e,l,{options:a,context:s});return this.set(e,o,a),o}get(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,status:a}=t,l=this.#s.get(e);if(l!==void 0){let o=this.#e[l],p=this.#t(o);return a&&this.#T(a,l),this.#g(l)?(a&&(a.get="stale"),p?(a&&i&&o.__staleWhileFetching!==void 0&&(a.returnedStale=true),i?o.__staleWhileFetching:void 0):(r||this.#G(e,"expire"),a&&i&&(a.returnedStale=true),i?o:void 0)):(a&&(a.get="hit"),p?o.__staleWhileFetching:(this.#O(l),s&&this.#F(l),o))}else a&&(a.get="miss");}#U(e,t){this.#f[t]=e,this.#l[e]=t;}#O(e){e!==this.#n&&(e===this.#o?this.#o=this.#l[e]:this.#U(this.#f[e],this.#l[e]),this.#U(this.#n,e),this.#n=e);}delete(e){return this.#G(e,"delete")}#G(e,t){let i=false;if(this.#r!==0){let s=this.#s.get(e);if(s!==void 0)if(i=true,this.#r===1)this.#j(t);else {this.#A(s);let r=this.#e[s];if(this.#t(r)?r.__abortController.abort(new Error("deleted")):(this.#_||this.#u)&&(this.#_&&this.#m?.(r,e,t),this.#u&&this.#a?.push([r,e,t])),this.#s.delete(e),this.#i[s]=void 0,this.#e[s]=void 0,s===this.#n)this.#n=this.#f[s];else if(s===this.#o)this.#o=this.#l[s];else {let a=this.#f[s];this.#l[a]=this.#l[s];let l=this.#l[s];this.#f[l]=this.#f[s];}this.#r--,this.#b.push(s);}}if(this.#u&&this.#a?.length){let s=this.#a,r;for(;r=s?.shift();)this.#p?.(...r);}return i}clear(){return this.#j("delete")}#j(e){for(let t of this.#v({allowStale:true})){let i=this.#e[t];if(this.#t(i))i.__abortController.abort(new Error("deleted"));else {let s=this.#i[t];this.#_&&this.#m?.(i,s,e),this.#u&&this.#a?.push([i,s,e]);}}if(this.#s.clear(),this.#e.fill(void 0),this.#i.fill(void 0),this.#d&&this.#w&&(this.#d.fill(0),this.#w.fill(0)),this.#y&&this.#y.fill(0),this.#o=0,this.#n=0,this.#b.length=0,this.#S=0,this.#r=0,this.#u&&this.#a){let t=this.#a,i;for(;i=t?.shift();)this.#p?.(...i);}}};var A=class{cache;map=new Map;constructor(e){this.cache=new V({max:e.cacheSize}),this.map=new Map;}get[Symbol.iterator](){return this.map[Symbol.iterator]}get[Symbol.toStringTag](){return this.map[Symbol.toStringTag]}clear(){return this.cache.clear(),this.map.clear()}delete(e){let t=this.map.delete(e);return t&&this.cache.delete(e),t}get forEach(){return this.map.forEach}get(e){let t=this.cache.get(e);return t||this.map.get(e)}has(e){return this.map.has(e)}set(e,t){return this.map.set(e,t),this.cache.set(e,t),this}get size(){return this.map.size}get entries(){return this.map.entries}get keys(){return this.map.keys}get values(){return this.map.values}};var h=class n{static storage=new A({cacheSize:20});static startingStorage=[];static flags=Array();static tempStorage=new Map;static tempStorageDeadlines=new Map;constructor(){}static clearOldTempVariables(e){n.tempStorageDeadlines.forEach((t,i)=>{t>e&&(n.tempStorage.delete(i),n.tempStorageDeadlines.delete(i),n.storage.cache.delete(i));});}static setVariable(e,t){let i=n.tempStorage.has(e);t==null?(n.storage.map.delete(e),!i&&n.storage.cache.delete(e)):(n.storage.map.set(e,t),!i&&n.storage.cache.set(e,t));}static getVariable(e){let t=n.storage.cache.get(e);return t===void 0&&(t=n.tempStorage.get(e)),t===void 0&&(t=n.storage.map.get(e)),I(t)}static removeVariable(e){n.storage.delete(e);}static setFlag(e,t){if(t)this.flags.includes(e)||this.flags.push(e);else {let i=this.flags.indexOf(e);i>-1&&this.flags.splice(i,1);}}static getFlag(e){return this.flags.includes(e)}};var W=class{get storage(){return h.storage.map}get cache(){return h.storage.cache}get flags(){return h.flags}get tempStorage(){return h.tempStorage}get tempStorageDeadlines(){return h.tempStorageDeadlines}set startingStorage(e){let t=[];Object.entries(e).forEach(([i,s])=>{t.push({key:i,value:s});}),h.startingStorage=t;}setVariable(e,t){return h.setVariable(e,t)}getVariable(e){return h.getVariable(e)}removeVariable(e){return h.removeVariable(e)}setTempVariable(e,t){if(t==null){this.removeTempVariable(e);return}else h.tempStorage.set(e,t),h.storage.cache.set(e,t),h.tempStorageDeadlines.has(e)||h.tempStorageDeadlines.set(e,x.openedLabels);}removeTempVariable(e){h.tempStorage.has(e)&&(h.tempStorage.delete(e),h.tempStorageDeadlines.delete(e),h.storage.cache.delete(e));}setFlag(e,t){return h.setFlag(e,t)}getFlag(e){return h.getFlag(e)}clear(){this.storage.clear(),this.cache.clear(),h.flags=[],h.tempStorage.clear(),h.tempStorageDeadlines.clear(),h.startingStorage.forEach(({key:e,value:t})=>{this.storage.set(e,t);});}export(){let e=[];[...this.storage.keys()].forEach(s=>{e.push({key:s,value:this.storage.get(s)});});let t=[];[...h.tempStorage.keys()].forEach(s=>{t.push({key:s,value:h.tempStorage.get(s)});});let i=[];return [...h.tempStorageDeadlines.keys()].forEach(s=>{i.push({key:s,value:h.tempStorageDeadlines.get(s)});}),I({base:e,temp:t,tempDeadlines:i,flags:h.flags})}restore(e){this.clear();try{e?(Array.isArray(e)&&e.forEach(t=>{if(t.key==="___temp_storage___"){let i=t.value;Object.entries(i).forEach(([s,r])=>{h.tempStorage.set(s,r);});}else if(t.key==="___temp_storage_deadlines___"){let i=t.value;Object.entries(i).forEach(([s,r])=>{h.tempStorageDeadlines.set(s,r);});}else t.key==="___flags___"?t.value.forEach(s=>{h.flags.push(s);}):this.storage.set(t.key,t.value);}),"base"in e&&"temp"in e&&"tempDeadlines"in e?(e.base?.forEach(t=>{this.storage.set(t.key,t.value);}),e.temp?.forEach(t=>{h.tempStorage.set(t.key,t.value);}),e.tempDeadlines?.forEach(t=>{h.tempStorageDeadlines.set(t.key,t.value);})):Object.entries(e).forEach(([t,i])=>{t==="___temp_storage___"?Object.entries(i).forEach(([s,r])=>{h.tempStorage.set(s,r);}):t==="___temp_storage_deadlines___"?Object.entries(i).forEach(([s,r])=>{h.tempStorageDeadlines.set(s,r);}):t==="___flags___"?i.forEach(s=>{h.flags.push(s);}):this.storage.set(t,i);})):f.warn("No storage data found");}catch(t){f.error("Error importing data",t);}}};export{W as default};
1
+ var f;(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)))(f||={});var x=class n{static init(e){n._getStepCounter=e.getStepCounter,n._setStepCounter=e.setStepCounter,n._getCurrentGameStepState=e.getCurrentGameStepState,n._restoreGameStepState=e.restoreGameStepState,n._getOpenedLabels=e.getOpenedLabels,e.onGoNextEnd&&(n._onGoNextEnd=e.onGoNextEnd),n._getVariable=e.getVariable,n._setVariable=e.setVariable,n._removeVariable=e.removeVariable,n._getFlag=e.getFlag,n._setFlag=e.setFlag,e.onLabelClosing&&(n._onLabelClosing=e.onLabelClosing),n._addHistoryItem=e.addHistoryItem,n._getCurrentStepsRunningNumber=e.getCurrentStepsRunningNumber,n._getCharacter=e.getCharacter;}static _getStepCounter=()=>{throw f.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static _setStepCounter=()=>{throw f.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get stepCounter(){return n._getStepCounter()}static set stepCounter(e){n._setStepCounter(e);}static _getCurrentGameStepState=()=>{throw f.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get currentGameStepState(){return n._getCurrentGameStepState()}static _restoreGameStepState=()=>{throw f.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get restoreGameStepState(){return n._restoreGameStepState}static _getOpenedLabels=()=>{throw f.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get openedLabels(){return n._getOpenedLabels()}static _onGoNextEnd=async()=>{};static get onGoNextEnd(){return n._onGoNextEnd}static _getVariable=()=>{throw f.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get getVariable(){return n._getVariable}static _setVariable=()=>{throw f.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get setVariable(){return n._setVariable}static _removeVariable=()=>{throw f.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get removeVariable(){return n._removeVariable}static _getFlag=()=>{throw f.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get getFlag(){return n._getFlag}static _setFlag=()=>{throw f.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get setFlag(){return n._setFlag}static _onLabelClosing=()=>{};static get onLabelClosing(){return n._onLabelClosing}static _addHistoryItem=()=>{throw f.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get addHistoryItem(){return n._addHistoryItem}static _getCurrentStepsRunningNumber=()=>{throw f.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")};static get currentStepsRunningNumber(){return n._getCurrentStepsRunningNumber()}static _getCharacter=()=>{throw f.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented.")};static get getCharacter(){return n._getCharacter}static onEnd;static onError};function I(n){try{if(typeof n>"u")return n;let e=JSON.stringify(n);return JSON.parse(e)}catch(e){throw f.error("Error creating exportable element",n,e),new Error("[Pixi\u2019VN] Error creating exportable element")}}var C=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,U=new Set,D=typeof process=="object"&&process?process:{},j=(n,e,t,i)=>{typeof D.emitWarning=="function"?D.emitWarning(n,e,t,i):console.error(`[${t}] ${e}: ${n}`);},L=globalThis.AbortController,P=globalThis.AbortSignal;if(typeof L>"u"){P=class{onabort;_onabort=[];reason;aborted=false;addEventListener(i,s){this._onabort.push(s);}},L=class{constructor(){e();}signal=new P;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 n=D.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{n&&(n=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",e));};}var K=n=>!U.has(n),v=n=>n&&n===Math.floor(n)&&n>0&&isFinite(n),H=n=>v(n)?n<=Math.pow(2,8)?Uint8Array:n<=Math.pow(2,16)?Uint16Array:n<=Math.pow(2,32)?Uint32Array:n<=Number.MAX_SAFE_INTEGER?F:null:null,F=class extends Array{constructor(e){super(e),this.fill(0);}},N=class n{heap;length;static#h=false;static create(e){let t=H(e);if(!t)return [];n.#h=true;let i=new n(e,t);return n.#h=false,i}constructor(e,t){if(!n.#h)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0;}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}},V=class n{#h;#c;#m;#C;#p;#x;#M;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#r;#S;#s;#i;#e;#l;#f;#o;#n;#b;#a;#y;#w;#d;#_;#z;#u;#I;static unsafeExposeInternals(e){return {starts:e.#w,ttls:e.#d,sizes:e.#y,keyMap:e.#s,keyList:e.#i,valList:e.#e,next:e.#l,prev:e.#f,get head(){return e.#o},get tail(){return e.#n},free:e.#b,isBackgroundFetch:t=>e.#t(t),backgroundFetch:(t,i,s,r)=>e.#R(t,i,s,r),moveToTail:t=>e.#O(t),indexes:t=>e.#E(t),rindexes:t=>e.#v(t),isStale:t=>e.#g(t)}}get max(){return this.#h}get maxSize(){return this.#c}get calculatedSize(){return this.#S}get size(){return this.#r}get fetchMethod(){return this.#x}get memoMethod(){return this.#M}get dispose(){return this.#m}get onInsert(){return this.#C}get disposeAfter(){return this.#p}constructor(e){let{max:t=0,ttl:i,ttlResolution:s=1,ttlAutopurge:r,updateAgeOnGet:a,updateAgeOnHas:l,allowStale:o,dispose:p,onInsert:w,disposeAfter:c,noDisposeOnSet:d,noUpdateTTL:g,maxSize:G=0,maxEntrySize:m=0,sizeCalculation:_,fetchMethod:u,memoMethod:b,noDeleteOnFetchRejection:E,noDeleteOnStaleGet:S,allowStaleOnFetchRejection:y,allowStaleOnFetchAbort:O,ignoreFetchAbort:T}=e;if(t!==0&&!v(t))throw new TypeError("max option must be a nonnegative integer");let M=t?H(t):Array;if(!M)throw new Error("invalid max value: "+t);if(this.#h=t,this.#c=G,this.maxEntrySize=m||this.#c,this.sizeCalculation=_,this.sizeCalculation){if(!this.#c&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(b!==void 0&&typeof b!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#M=b,u!==void 0&&typeof u!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#x=u,this.#z=!!u,this.#s=new Map,this.#i=new Array(t).fill(void 0),this.#e=new Array(t).fill(void 0),this.#l=new M(t),this.#f=new M(t),this.#o=0,this.#n=0,this.#b=N.create(t),this.#r=0,this.#S=0,typeof p=="function"&&(this.#m=p),typeof w=="function"&&(this.#C=w),typeof c=="function"?(this.#p=c,this.#a=[]):(this.#p=void 0,this.#a=void 0),this.#_=!!this.#m,this.#I=!!this.#C,this.#u=!!this.#p,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!g,this.noDeleteOnFetchRejection=!!E,this.allowStaleOnFetchRejection=!!y,this.allowStaleOnFetchAbort=!!O,this.ignoreFetchAbort=!!T,this.maxEntrySize!==0){if(this.#c!==0&&!v(this.#c))throw new TypeError("maxSize must be a positive integer if specified");if(!v(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#H();}if(this.allowStale=!!o,this.noDeleteOnStaleGet=!!S,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!l,this.ttlResolution=v(s)||s===0?s:1,this.ttlAutopurge=!!r,this.ttl=i||0,this.ttl){if(!v(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#D();}if(this.#h===0&&this.ttl===0&&this.#c===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#h&&!this.#c){let z="LRU_CACHE_UNBOUNDED";K(z)&&(U.add(z),j("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",z,n));}}getRemainingTTL(e){return this.#s.has(e)?1/0:0}#D(){let e=new F(this.#h),t=new F(this.#h);this.#d=e,this.#w=t,this.#N=(r,a,l=C.now())=>{if(t[r]=a!==0?l:0,e[r]=a,a!==0&&this.ttlAutopurge){let o=setTimeout(()=>{this.#g(r)&&this.#G(this.#i[r],"expire");},a+1);o.unref&&o.unref();}},this.#F=r=>{t[r]=e[r]!==0?C.now():0;},this.#T=(r,a)=>{if(e[a]){let l=e[a],o=t[a];if(!l||!o)return;r.ttl=l,r.start=o,r.now=i||s();let p=r.now-o;r.remainingTTL=l-p;}};let i=0,s=()=>{let r=C.now();if(this.ttlResolution>0){i=r;let a=setTimeout(()=>i=0,this.ttlResolution);a.unref&&a.unref();}return r};this.getRemainingTTL=r=>{let a=this.#s.get(r);if(a===void 0)return 0;let l=e[a],o=t[a];if(!l||!o)return 1/0;let p=(i||s())-o;return l-p},this.#g=r=>{let a=t[r],l=e[r];return !!l&&!!a&&(i||s())-a>l};}#F=()=>{};#T=()=>{};#N=()=>{};#g=()=>false;#H(){let e=new F(this.#h);this.#S=0,this.#y=e,this.#A=t=>{this.#S-=e[t],e[t]=0;},this.#W=(t,i,s,r)=>{if(this.#t(i))return 0;if(!v(s))if(r){if(typeof r!="function")throw new TypeError("sizeCalculation must be a function");if(s=r(i,t),!v(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return s},this.#L=(t,i,s)=>{if(e[t]=i,this.#c){let r=this.#c-e[t];for(;this.#S>r;)this.#V(true);}this.#S+=e[t],s&&(s.entrySize=i,s.totalCalculatedSize=this.#S);};}#A=e=>{};#L=(e,t,i)=>{};#W=(e,t,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#E({allowStale:e=this.allowStale}={}){if(this.#r)for(let t=this.#n;!(!this.#P(t)||((e||!this.#g(t))&&(yield t),t===this.#o));)t=this.#f[t];}*#v({allowStale:e=this.allowStale}={}){if(this.#r)for(let t=this.#o;!(!this.#P(t)||((e||!this.#g(t))&&(yield t),t===this.#n));)t=this.#l[t];}#P(e){return e!==void 0&&this.#s.get(this.#i[e])===e}*entries(){for(let e of this.#E())this.#e[e]!==void 0&&this.#i[e]!==void 0&&!this.#t(this.#e[e])&&(yield [this.#i[e],this.#e[e]]);}*rentries(){for(let e of this.#v())this.#e[e]!==void 0&&this.#i[e]!==void 0&&!this.#t(this.#e[e])&&(yield [this.#i[e],this.#e[e]]);}*keys(){for(let e of this.#E()){let t=this.#i[e];t!==void 0&&!this.#t(this.#e[e])&&(yield t);}}*rkeys(){for(let e of this.#v()){let t=this.#i[e];t!==void 0&&!this.#t(this.#e[e])&&(yield t);}}*values(){for(let e of this.#E())this.#e[e]!==void 0&&!this.#t(this.#e[e])&&(yield this.#e[e]);}*rvalues(){for(let e of this.#v())this.#e[e]!==void 0&&!this.#t(this.#e[e])&&(yield this.#e[e]);}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let i of this.#E()){let s=this.#e[i],r=this.#t(s)?s.__staleWhileFetching:s;if(r!==void 0&&e(r,this.#i[i],this))return this.get(this.#i[i],t)}}forEach(e,t=this){for(let i of this.#E()){let s=this.#e[i],r=this.#t(s)?s.__staleWhileFetching:s;r!==void 0&&e.call(t,r,this.#i[i],this);}}rforEach(e,t=this){for(let i of this.#v()){let s=this.#e[i],r=this.#t(s)?s.__staleWhileFetching:s;r!==void 0&&e.call(t,r,this.#i[i],this);}}purgeStale(){let e=false;for(let t of this.#v({allowStale:true}))this.#g(t)&&(this.#G(this.#i[t],"expire"),e=true);return e}info(e){let t=this.#s.get(e);if(t===void 0)return;let i=this.#e[t],s=this.#t(i)?i.__staleWhileFetching:i;if(s===void 0)return;let r={value:s};if(this.#d&&this.#w){let a=this.#d[t],l=this.#w[t];if(a&&l){let o=a-(C.now()-l);r.ttl=o,r.start=Date.now();}}return this.#y&&(r.size=this.#y[t]),r}dump(){let e=[];for(let t of this.#E({allowStale:true})){let i=this.#i[t],s=this.#e[t],r=this.#t(s)?s.__staleWhileFetching:s;if(r===void 0||i===void 0)continue;let a={value:r};if(this.#d&&this.#w){a.ttl=this.#d[t];let l=C.now()-this.#w[t];a.start=Math.floor(Date.now()-l);}this.#y&&(a.size=this.#y[t]),e.unshift([i,a]);}return e}load(e){this.clear();for(let[t,i]of e){if(i.start){let s=Date.now()-i.start;i.start=C.now()-s;}this.set(t,i.value,i);}}set(e,t,i={}){if(t===void 0)return this.delete(e),this;let{ttl:s=this.ttl,start:r,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:l=this.sizeCalculation,status:o}=i,{noUpdateTTL:p=this.noUpdateTTL}=i,w=this.#W(e,t,i.size||0,l);if(this.maxEntrySize&&w>this.maxEntrySize)return o&&(o.set="miss",o.maxEntrySizeExceeded=true),this.#G(e,"set"),this;let c=this.#r===0?void 0:this.#s.get(e);if(c===void 0)c=this.#r===0?this.#n:this.#b.length!==0?this.#b.pop():this.#r===this.#h?this.#V(false):this.#r,this.#i[c]=e,this.#e[c]=t,this.#s.set(e,c),this.#l[this.#n]=c,this.#f[c]=this.#n,this.#n=c,this.#r++,this.#L(c,w,o),o&&(o.set="add"),p=false,this.#I&&this.#C?.(t,e,"add");else {this.#O(c);let d=this.#e[c];if(t!==d){if(this.#z&&this.#t(d)){d.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:g}=d;g!==void 0&&!a&&(this.#_&&this.#m?.(g,e,"set"),this.#u&&this.#a?.push([g,e,"set"]));}else a||(this.#_&&this.#m?.(d,e,"set"),this.#u&&this.#a?.push([d,e,"set"]));if(this.#A(c),this.#L(c,w,o),this.#e[c]=t,o){o.set="replace";let g=d&&this.#t(d)?d.__staleWhileFetching:d;g!==void 0&&(o.oldValue=g);}}else o&&(o.set="update");this.#I&&this.onInsert?.(t,e,t===d?"update":"replace");}if(s!==0&&!this.#d&&this.#D(),this.#d&&(p||this.#N(c,s,r),o&&this.#T(o,c)),!a&&this.#u&&this.#a){let d=this.#a,g;for(;g=d?.shift();)this.#p?.(...g);}return this}pop(){try{for(;this.#r;){let e=this.#e[this.#o];if(this.#V(!0),this.#t(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#u&&this.#a){let e=this.#a,t;for(;t=e?.shift();)this.#p?.(...t);}}}#V(e){let t=this.#o,i=this.#i[t],s=this.#e[t];return this.#z&&this.#t(s)?s.__abortController.abort(new Error("evicted")):(this.#_||this.#u)&&(this.#_&&this.#m?.(s,i,"evict"),this.#u&&this.#a?.push([s,i,"evict"])),this.#A(t),e&&(this.#i[t]=void 0,this.#e[t]=void 0,this.#b.push(t)),this.#r===1?(this.#o=this.#n=0,this.#b.length=0):this.#o=this.#l[t],this.#s.delete(i),this.#r--,t}has(e,t={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=t,r=this.#s.get(e);if(r!==void 0){let a=this.#e[r];if(this.#t(a)&&a.__staleWhileFetching===void 0)return false;if(this.#g(r))s&&(s.has="stale",this.#T(s,r));else return i&&this.#F(r),s&&(s.has="hit",this.#T(s,r)),true}else s&&(s.has="miss");return false}peek(e,t={}){let{allowStale:i=this.allowStale}=t,s=this.#s.get(e);if(s===void 0||!i&&this.#g(s))return;let r=this.#e[s];return this.#t(r)?r.__staleWhileFetching:r}#R(e,t,i,s){let r=t===void 0?void 0:this.#e[t];if(this.#t(r))return r;let a=new L,{signal:l}=i;l?.addEventListener("abort",()=>a.abort(l.reason),{signal:a.signal});let o={signal:a.signal,options:i,context:s},p=(m,_=false)=>{let{aborted:u}=a.signal,b=i.ignoreFetchAbort&&m!==void 0;if(i.status&&(u&&!_?(i.status.fetchAborted=true,i.status.fetchError=a.signal.reason,b&&(i.status.fetchAbortIgnored=true)):i.status.fetchResolved=true),u&&!b&&!_)return c(a.signal.reason);let E=g;return this.#e[t]===g&&(m===void 0?E.__staleWhileFetching?this.#e[t]=E.__staleWhileFetching:this.#G(e,"fetch"):(i.status&&(i.status.fetchUpdated=true),this.set(e,m,o.options))),m},w=m=>(i.status&&(i.status.fetchRejected=true,i.status.fetchError=m),c(m)),c=m=>{let{aborted:_}=a.signal,u=_&&i.allowStaleOnFetchAbort,b=u||i.allowStaleOnFetchRejection,E=b||i.noDeleteOnFetchRejection,S=g;if(this.#e[t]===g&&(!E||S.__staleWhileFetching===void 0?this.#G(e,"fetch"):u||(this.#e[t]=S.__staleWhileFetching)),b)return i.status&&S.__staleWhileFetching!==void 0&&(i.status.returnedStale=true),S.__staleWhileFetching;if(S.__returned===S)throw m},d=(m,_)=>{let u=this.#x?.(e,r,o);u&&u instanceof Promise&&u.then(b=>m(b===void 0?void 0:b),_),a.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(m(void 0),i.allowStaleOnFetchAbort&&(m=b=>p(b,true)));});};i.status&&(i.status.fetchDispatched=true);let g=new Promise(d).then(p,w),G=Object.assign(g,{__abortController:a,__staleWhileFetching:r,__returned:void 0});return t===void 0?(this.set(e,G,{...o.options,status:void 0}),t=this.#s.get(e)):this.#e[t]=G,G}#t(e){if(!this.#z)return false;let t=e;return !!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof L}async fetch(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:l=this.noDisposeOnSet,size:o=0,sizeCalculation:p=this.sizeCalculation,noUpdateTTL:w=this.noUpdateTTL,noDeleteOnFetchRejection:c=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:g=this.ignoreFetchAbort,allowStaleOnFetchAbort:G=this.allowStaleOnFetchAbort,context:m,forceRefresh:_=false,status:u,signal:b}=t;if(!this.#z)return u&&(u.fetch="get"),this.get(e,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:r,status:u});let E={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:r,ttl:a,noDisposeOnSet:l,size:o,sizeCalculation:p,noUpdateTTL:w,noDeleteOnFetchRejection:c,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:G,ignoreFetchAbort:g,status:u,signal:b},S=this.#s.get(e);if(S===void 0){u&&(u.fetch="miss");let y=this.#R(e,S,E,m);return y.__returned=y}else {let y=this.#e[S];if(this.#t(y)){let R=i&&y.__staleWhileFetching!==void 0;return u&&(u.fetch="inflight",R&&(u.returnedStale=true)),R?y.__staleWhileFetching:y.__returned=y}let O=this.#g(S);if(!_&&!O)return u&&(u.fetch="hit"),this.#O(S),s&&this.#F(S),u&&this.#T(u,S),y;let T=this.#R(e,S,E,m),z=T.__staleWhileFetching!==void 0&&i;return u&&(u.fetch=O?"stale":"refresh",z&&O&&(u.returnedStale=true)),z?T.__staleWhileFetching:T.__returned=T}}async forceFetch(e,t={}){let i=await this.fetch(e,t);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(e,t={}){let i=this.#M;if(!i)throw new Error("no memoMethod provided to constructor");let{context:s,forceRefresh:r,...a}=t,l=this.get(e,a);if(!r&&l!==void 0)return l;let o=i(e,l,{options:a,context:s});return this.set(e,o,a),o}get(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,status:a}=t,l=this.#s.get(e);if(l!==void 0){let o=this.#e[l],p=this.#t(o);return a&&this.#T(a,l),this.#g(l)?(a&&(a.get="stale"),p?(a&&i&&o.__staleWhileFetching!==void 0&&(a.returnedStale=true),i?o.__staleWhileFetching:void 0):(r||this.#G(e,"expire"),a&&i&&(a.returnedStale=true),i?o:void 0)):(a&&(a.get="hit"),p?o.__staleWhileFetching:(this.#O(l),s&&this.#F(l),o))}else a&&(a.get="miss");}#U(e,t){this.#f[t]=e,this.#l[e]=t;}#O(e){e!==this.#n&&(e===this.#o?this.#o=this.#l[e]:this.#U(this.#f[e],this.#l[e]),this.#U(this.#n,e),this.#n=e);}delete(e){return this.#G(e,"delete")}#G(e,t){let i=false;if(this.#r!==0){let s=this.#s.get(e);if(s!==void 0)if(i=true,this.#r===1)this.#j(t);else {this.#A(s);let r=this.#e[s];if(this.#t(r)?r.__abortController.abort(new Error("deleted")):(this.#_||this.#u)&&(this.#_&&this.#m?.(r,e,t),this.#u&&this.#a?.push([r,e,t])),this.#s.delete(e),this.#i[s]=void 0,this.#e[s]=void 0,s===this.#n)this.#n=this.#f[s];else if(s===this.#o)this.#o=this.#l[s];else {let a=this.#f[s];this.#l[a]=this.#l[s];let l=this.#l[s];this.#f[l]=this.#f[s];}this.#r--,this.#b.push(s);}}if(this.#u&&this.#a?.length){let s=this.#a,r;for(;r=s?.shift();)this.#p?.(...r);}return i}clear(){return this.#j("delete")}#j(e){for(let t of this.#v({allowStale:true})){let i=this.#e[t];if(this.#t(i))i.__abortController.abort(new Error("deleted"));else {let s=this.#i[t];this.#_&&this.#m?.(i,s,e),this.#u&&this.#a?.push([i,s,e]);}}if(this.#s.clear(),this.#e.fill(void 0),this.#i.fill(void 0),this.#d&&this.#w&&(this.#d.fill(0),this.#w.fill(0)),this.#y&&this.#y.fill(0),this.#o=0,this.#n=0,this.#b.length=0,this.#S=0,this.#r=0,this.#u&&this.#a){let t=this.#a,i;for(;i=t?.shift();)this.#p?.(...i);}}};var A=class{cache;map=new Map;constructor(e){this.cache=new V({max:e.cacheSize}),this.map=new Map;}get[Symbol.iterator](){return this.map[Symbol.iterator]}get[Symbol.toStringTag](){return this.map[Symbol.toStringTag]}clear(){return this.cache.clear(),this.map.clear()}delete(e){let t=this.map.delete(e);return t&&this.cache.delete(e),t}get forEach(){return this.map.forEach}get(e){let t=this.cache.get(e);return t||this.map.get(e)}has(e){return this.map.has(e)}set(e,t){return this.map.set(e,t),this.cache.set(e,t),this}get size(){return this.map.size}get entries(){return this.map.entries}keys(){return this.map.keys()}get values(){return this.map.values}};var h=class n{static storage=new A({cacheSize:20});static startingStorage=[];static flags=Array();static tempStorage=new Map;static tempStorageDeadlines=new Map;constructor(){}static clearOldTempVariables(e){n.tempStorageDeadlines.forEach((t,i)=>{t>e&&(n.tempStorage.delete(i),n.tempStorageDeadlines.delete(i),n.storage.cache.delete(i));});}static setVariable(e,t){let i=n.tempStorage.has(e);t==null?(n.storage.map.delete(e),!i&&n.storage.cache.delete(e)):(n.storage.map.set(e,t),!i&&n.storage.cache.set(e,t));}static getVariable(e){let t=n.storage.cache.get(e);return t===void 0&&(t=n.tempStorage.get(e)),t===void 0&&(t=n.storage.map.get(e)),I(t)}static removeVariable(e){n.storage.delete(e);}static setFlag(e,t){if(t)this.flags.includes(e)||this.flags.push(e);else {let i=this.flags.indexOf(e);i>-1&&this.flags.splice(i,1);}}static getFlag(e){return this.flags.includes(e)}};var W=class{get storage(){return h.storage.map}get cache(){return h.storage.cache}get flags(){return h.flags}get tempStorage(){return h.tempStorage}get tempStorageDeadlines(){return h.tempStorageDeadlines}set startingStorage(e){let t=[];Object.entries(e).forEach(([i,s])=>{t.push({key:i,value:s});}),h.startingStorage=t;}setVariable(e,t){return h.setVariable(e,t)}getVariable(e){return h.getVariable(e)}removeVariable(e){return h.removeVariable(e)}setTempVariable(e,t){if(t==null){this.removeTempVariable(e);return}else h.tempStorage.set(e,t),h.storage.cache.set(e,t),h.tempStorageDeadlines.has(e)||h.tempStorageDeadlines.set(e,x.openedLabels);}removeTempVariable(e){h.tempStorage.has(e)&&(h.tempStorage.delete(e),h.tempStorageDeadlines.delete(e),h.storage.cache.delete(e));}setFlag(e,t){return h.setFlag(e,t)}getFlag(e){return h.getFlag(e)}clear(){this.storage.clear(),this.cache.clear(),h.flags=[],h.tempStorage.clear(),h.tempStorageDeadlines.clear(),h.startingStorage.forEach(({key:e,value:t})=>{this.storage.set(e,t);});}export(){let e=[];[...this.storage.keys()].forEach(s=>{e.push({key:s,value:this.storage.get(s)});});let t=[];[...h.tempStorage.keys()].forEach(s=>{t.push({key:s,value:h.tempStorage.get(s)});});let i=[];return [...h.tempStorageDeadlines.keys()].forEach(s=>{i.push({key:s,value:h.tempStorageDeadlines.get(s)});}),I({base:e,temp:t,tempDeadlines:i,flags:h.flags})}restore(e){this.clear();try{e?(Array.isArray(e)&&e.forEach(t=>{if(t.key==="___temp_storage___"){let i=t.value;Object.entries(i).forEach(([s,r])=>{h.tempStorage.set(s,r);});}else if(t.key==="___temp_storage_deadlines___"){let i=t.value;Object.entries(i).forEach(([s,r])=>{h.tempStorageDeadlines.set(s,r);});}else t.key==="___flags___"?t.value.forEach(s=>{h.flags.push(s);}):this.storage.set(t.key,t.value);}),"base"in e&&"temp"in e&&"tempDeadlines"in e?(e.base?.forEach(t=>{this.storage.set(t.key,t.value);}),e.temp?.forEach(t=>{h.tempStorage.set(t.key,t.value);}),e.tempDeadlines?.forEach(t=>{h.tempStorageDeadlines.set(t.key,t.value);})):Object.entries(e).forEach(([t,i])=>{t==="___temp_storage___"?Object.entries(i).forEach(([s,r])=>{h.tempStorage.set(s,r);}):t==="___temp_storage_deadlines___"?Object.entries(i).forEach(([s,r])=>{h.tempStorageDeadlines.set(s,r);}):t==="___flags___"?i.forEach(s=>{h.flags.push(s);}):this.storage.set(t,i);})):f.warn("No storage data found");}catch(t){f.error("Error importing data",t);}}};export{W as default};
@@ -1 +1 @@
1
- 'use strict';var F=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,N=new Set,D=typeof process=="object"&&process?process:{},V=(h,t,e,i)=>{typeof D.emitWarning=="function"?D.emitWarning(h,t,e,i):console.error(`[${e}] ${t}: ${h}`);},C=globalThis.AbortController,U=globalThis.AbortSignal;if(typeof C>"u"){U=class{onabort;_onabort=[];reason;aborted=false;addEventListener(i,s){this._onabort.push(s);}},C=class{constructor(){t();}signal=new U;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=D.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",t=()=>{h&&(h=false,V("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 P=h=>!N.has(h),_=h=>h&&h===Math.floor(h)&&h>0&&isFinite(h),G=h=>_(h)?h<=Math.pow(2,8)?Uint8Array:h<=Math.pow(2,16)?Uint16Array:h<=Math.pow(2,32)?Uint32Array:h<=Number.MAX_SAFE_INTEGER?O:null:null,O=class extends Array{constructor(t){super(t),this.fill(0);}},L=class h{heap;length;static#a=false;static create(t){let e=G(t);if(!e)return [];h.#a=true;let i=new h(t,e);return h.#a=false,i}constructor(t,e){if(!h.#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]}},R=class h{#a;#c;#p;#z;#m;#R;#W;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#n;#S;#s;#i;#t;#l;#u;#o;#r;#w;#h;#b;#y;#d;#_;#O;#f;#D;static unsafeExposeInternals(t){return {starts:t.#y,ttls:t.#d,sizes:t.#b,keyMap:t.#s,keyList:t.#i,valList:t.#t,next:t.#l,prev:t.#u,get head(){return t.#o},get tail(){return t.#r},free:t.#w,isBackgroundFetch:e=>t.#e(e),backgroundFetch:(e,i,s,n)=>t.#I(e,i,s,n),moveToTail:e=>t.#C(e),indexes:e=>t.#A(e),rindexes:e=>t.#T(e),isStale:e=>t.#g(e)}}get max(){return this.#a}get maxSize(){return this.#c}get calculatedSize(){return this.#S}get size(){return this.#n}get fetchMethod(){return this.#R}get memoMethod(){return this.#W}get dispose(){return this.#p}get onInsert(){return this.#z}get disposeAfter(){return this.#m}constructor(t){let{max:e=0,ttl:i,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:r,updateAgeOnHas:a,allowStale:o,dispose:g,onInsert:w,disposeAfter:f,noDisposeOnSet:c,noUpdateTTL:u,maxSize:A=0,maxEntrySize:d=0,sizeCalculation:b,fetchMethod:l,memoMethod:m,noDeleteOnFetchRejection:y,noDeleteOnStaleGet:p,allowStaleOnFetchRejection:S,allowStaleOnFetchAbort:v,ignoreFetchAbort:T}=t;if(e!==0&&!_(e))throw new TypeError("max option must be a nonnegative integer");let x=e?G(e):Array;if(!x)throw new Error("invalid max value: "+e);if(this.#a=e,this.#c=A,this.maxEntrySize=d||this.#c,this.sizeCalculation=b,this.sizeCalculation){if(!this.#c&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(m!==void 0&&typeof m!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#W=m,l!==void 0&&typeof l!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#R=l,this.#O=!!l,this.#s=new Map,this.#i=new Array(e).fill(void 0),this.#t=new Array(e).fill(void 0),this.#l=new x(e),this.#u=new x(e),this.#o=0,this.#r=0,this.#w=L.create(e),this.#n=0,this.#S=0,typeof g=="function"&&(this.#p=g),typeof w=="function"&&(this.#z=w),typeof f=="function"?(this.#m=f,this.#h=[]):(this.#m=void 0,this.#h=void 0),this.#_=!!this.#p,this.#D=!!this.#z,this.#f=!!this.#m,this.noDisposeOnSet=!!c,this.noUpdateTTL=!!u,this.noDeleteOnFetchRejection=!!y,this.allowStaleOnFetchRejection=!!S,this.allowStaleOnFetchAbort=!!v,this.ignoreFetchAbort=!!T,this.maxEntrySize!==0){if(this.#c!==0&&!_(this.#c))throw new TypeError("maxSize must be a positive integer if specified");if(!_(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#H();}if(this.allowStale=!!o,this.noDeleteOnStaleGet=!!p,this.updateAgeOnGet=!!r,this.updateAgeOnHas=!!a,this.ttlResolution=_(s)||s===0?s:1,this.ttlAutopurge=!!n,this.ttl=i||0,this.ttl){if(!_(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#U();}if(this.#a===0&&this.ttl===0&&this.#c===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#a&&!this.#c){let E="LRU_CACHE_UNBOUNDED";P(E)&&(N.add(E),V("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",E,h));}}getRemainingTTL(t){return this.#s.has(t)?1/0:0}#U(){let t=new O(this.#a),e=new O(this.#a);this.#d=t,this.#y=e,this.#N=(n,r,a=F.now())=>{if(e[n]=r!==0?a:0,t[n]=r,r!==0&&this.ttlAutopurge){let o=setTimeout(()=>{this.#g(n)&&this.#E(this.#i[n],"expire");},r+1);o.unref&&o.unref();}},this.#v=n=>{e[n]=t[n]!==0?F.now():0;},this.#F=(n,r)=>{if(t[r]){let a=t[r],o=e[r];if(!a||!o)return;n.ttl=a,n.start=o,n.now=i||s();let g=n.now-o;n.remainingTTL=a-g;}};let i=0,s=()=>{let n=F.now();if(this.ttlResolution>0){i=n;let r=setTimeout(()=>i=0,this.ttlResolution);r.unref&&r.unref();}return n};this.getRemainingTTL=n=>{let r=this.#s.get(n);if(r===void 0)return 0;let a=t[r],o=e[r];if(!a||!o)return 1/0;let g=(i||s())-o;return a-g},this.#g=n=>{let r=e[n],a=t[n];return !!a&&!!r&&(i||s())-r>a};}#v=()=>{};#F=()=>{};#N=()=>{};#g=()=>false;#H(){let t=new O(this.#a);this.#S=0,this.#b=t,this.#x=e=>{this.#S-=t[e],t[e]=0;},this.#V=(e,i,s,n)=>{if(this.#e(i))return 0;if(!_(s))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(s=n(i,e),!_(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return s},this.#L=(e,i,s)=>{if(t[e]=i,this.#c){let n=this.#c-t[e];for(;this.#S>n;)this.#M(true);}this.#S+=t[e],s&&(s.entrySize=i,s.totalCalculatedSize=this.#S);};}#x=t=>{};#L=(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};*#A({allowStale:t=this.allowStale}={}){if(this.#n)for(let e=this.#r;!(!this.#G(e)||((t||!this.#g(e))&&(yield e),e===this.#o));)e=this.#u[e];}*#T({allowStale:t=this.allowStale}={}){if(this.#n)for(let e=this.#o;!(!this.#G(e)||((t||!this.#g(e))&&(yield e),e===this.#r));)e=this.#l[e];}#G(t){return t!==void 0&&this.#s.get(this.#i[t])===t}*entries(){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]]);}*rentries(){for(let t of this.#T())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.#A()){let e=this.#i[t];e!==void 0&&!this.#e(this.#t[t])&&(yield e);}}*rkeys(){for(let t of this.#T()){let e=this.#i[t];e!==void 0&&!this.#e(this.#t[t])&&(yield e);}}*values(){for(let t of this.#A())this.#t[t]!==void 0&&!this.#e(this.#t[t])&&(yield this.#t[t]);}*rvalues(){for(let t of this.#T())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.#A()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;if(n!==void 0&&t(n,this.#i[i],this))return this.get(this.#i[i],e)}}forEach(t,e=this){for(let i of this.#A()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;n!==void 0&&t.call(e,n,this.#i[i],this);}}rforEach(t,e=this){for(let i of this.#T()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;n!==void 0&&t.call(e,n,this.#i[i],this);}}purgeStale(){let t=false;for(let e of this.#T({allowStale:true}))this.#g(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 n={value:s};if(this.#d&&this.#y){let r=this.#d[e],a=this.#y[e];if(r&&a){let o=r-(F.now()-a);n.ttl=o,n.start=Date.now();}}return this.#b&&(n.size=this.#b[e]),n}dump(){let t=[];for(let e of this.#A({allowStale:true})){let i=this.#i[e],s=this.#t[e],n=this.#e(s)?s.__staleWhileFetching:s;if(n===void 0||i===void 0)continue;let r={value:n};if(this.#d&&this.#y){r.ttl=this.#d[e];let a=F.now()-this.#y[e];r.start=Math.floor(Date.now()-a);}this.#b&&(r.size=this.#b[e]),t.unshift([i,r]);}return t}load(t){this.clear();for(let[e,i]of t){if(i.start){let s=Date.now()-i.start;i.start=F.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:n,noDisposeOnSet:r=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:o}=i,{noUpdateTTL:g=this.noUpdateTTL}=i,w=this.#V(t,e,i.size||0,a);if(this.maxEntrySize&&w>this.maxEntrySize)return o&&(o.set="miss",o.maxEntrySizeExceeded=true),this.#E(t,"set"),this;let f=this.#n===0?void 0:this.#s.get(t);if(f===void 0)f=this.#n===0?this.#r:this.#w.length!==0?this.#w.pop():this.#n===this.#a?this.#M(false):this.#n,this.#i[f]=t,this.#t[f]=e,this.#s.set(t,f),this.#l[this.#r]=f,this.#u[f]=this.#r,this.#r=f,this.#n++,this.#L(f,w,o),o&&(o.set="add"),g=false,this.#D&&this.#z?.(e,t,"add");else {this.#C(f);let c=this.#t[f];if(e!==c){if(this.#O&&this.#e(c)){c.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:u}=c;u!==void 0&&!r&&(this.#_&&this.#p?.(u,t,"set"),this.#f&&this.#h?.push([u,t,"set"]));}else r||(this.#_&&this.#p?.(c,t,"set"),this.#f&&this.#h?.push([c,t,"set"]));if(this.#x(f),this.#L(f,w,o),this.#t[f]=e,o){o.set="replace";let u=c&&this.#e(c)?c.__staleWhileFetching:c;u!==void 0&&(o.oldValue=u);}}else o&&(o.set="update");this.#D&&this.onInsert?.(e,t,e===c?"update":"replace");}if(s!==0&&!this.#d&&this.#U(),this.#d&&(g||this.#N(f,s,n),o&&this.#F(o,f)),!r&&this.#f&&this.#h){let c=this.#h,u;for(;u=c?.shift();)this.#m?.(...u);}return this}pop(){try{for(;this.#n;){let t=this.#t[this.#o];if(this.#M(!0),this.#e(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(this.#f&&this.#h){let t=this.#h,e;for(;e=t?.shift();)this.#m?.(...e);}}}#M(t){let e=this.#o,i=this.#i[e],s=this.#t[e];return this.#O&&this.#e(s)?s.__abortController.abort(new Error("evicted")):(this.#_||this.#f)&&(this.#_&&this.#p?.(s,i,"evict"),this.#f&&this.#h?.push([s,i,"evict"])),this.#x(e),t&&(this.#i[e]=void 0,this.#t[e]=void 0,this.#w.push(e)),this.#n===1?(this.#o=this.#r=0,this.#w.length=0):this.#o=this.#l[e],this.#s.delete(i),this.#n--,e}has(t,e={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=e,n=this.#s.get(t);if(n!==void 0){let r=this.#t[n];if(this.#e(r)&&r.__staleWhileFetching===void 0)return false;if(this.#g(n))s&&(s.has="stale",this.#F(s,n));else return i&&this.#v(n),s&&(s.has="hit",this.#F(s,n)),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.#g(s))return;let n=this.#t[s];return this.#e(n)?n.__staleWhileFetching:n}#I(t,e,i,s){let n=e===void 0?void 0:this.#t[e];if(this.#e(n))return n;let r=new C,{signal:a}=i;a?.addEventListener("abort",()=>r.abort(a.reason),{signal:r.signal});let o={signal:r.signal,options:i,context:s},g=(d,b=false)=>{let{aborted:l}=r.signal,m=i.ignoreFetchAbort&&d!==void 0;if(i.status&&(l&&!b?(i.status.fetchAborted=true,i.status.fetchError=r.signal.reason,m&&(i.status.fetchAbortIgnored=true)):i.status.fetchResolved=true),l&&!m&&!b)return f(r.signal.reason);let y=u;return this.#t[e]===u&&(d===void 0?y.__staleWhileFetching?this.#t[e]=y.__staleWhileFetching:this.#E(t,"fetch"):(i.status&&(i.status.fetchUpdated=true),this.set(t,d,o.options))),d},w=d=>(i.status&&(i.status.fetchRejected=true,i.status.fetchError=d),f(d)),f=d=>{let{aborted:b}=r.signal,l=b&&i.allowStaleOnFetchAbort,m=l||i.allowStaleOnFetchRejection,y=m||i.noDeleteOnFetchRejection,p=u;if(this.#t[e]===u&&(!y||p.__staleWhileFetching===void 0?this.#E(t,"fetch"):l||(this.#t[e]=p.__staleWhileFetching)),m)return i.status&&p.__staleWhileFetching!==void 0&&(i.status.returnedStale=true),p.__staleWhileFetching;if(p.__returned===p)throw d},c=(d,b)=>{let l=this.#R?.(t,n,o);l&&l instanceof Promise&&l.then(m=>d(m===void 0?void 0:m),b),r.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(d(void 0),i.allowStaleOnFetchAbort&&(d=m=>g(m,true)));});};i.status&&(i.status.fetchDispatched=true);let u=new Promise(c).then(g,w),A=Object.assign(u,{__abortController:r,__staleWhileFetching:n,__returned:void 0});return e===void 0?(this.set(t,A,{...o.options,status:void 0}),e=this.#s.get(t)):this.#t[e]=A,A}#e(t){if(!this.#O)return false;let e=t;return !!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof C}async fetch(t,e={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:r=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:o=0,sizeCalculation:g=this.sizeCalculation,noUpdateTTL:w=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:c=this.allowStaleOnFetchRejection,ignoreFetchAbort:u=this.ignoreFetchAbort,allowStaleOnFetchAbort:A=this.allowStaleOnFetchAbort,context:d,forceRefresh:b=false,status:l,signal:m}=e;if(!this.#O)return l&&(l.fetch="get"),this.get(t,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:l});let y={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:r,noDisposeOnSet:a,size:o,sizeCalculation:g,noUpdateTTL:w,noDeleteOnFetchRejection:f,allowStaleOnFetchRejection:c,allowStaleOnFetchAbort:A,ignoreFetchAbort:u,status:l,signal:m},p=this.#s.get(t);if(p===void 0){l&&(l.fetch="miss");let S=this.#I(t,p,y,d);return S.__returned=S}else {let S=this.#t[p];if(this.#e(S)){let W=i&&S.__staleWhileFetching!==void 0;return l&&(l.fetch="inflight",W&&(l.returnedStale=true)),W?S.__staleWhileFetching:S.__returned=S}let v=this.#g(p);if(!b&&!v)return l&&(l.fetch="hit"),this.#C(p),s&&this.#v(p),l&&this.#F(l,p),S;let T=this.#I(t,p,y,d),E=T.__staleWhileFetching!==void 0&&i;return l&&(l.fetch=v?"stale":"refresh",E&&v&&(l.returnedStale=true)),E?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.#W;if(!i)throw new Error("no memoMethod provided to constructor");let{context:s,forceRefresh:n,...r}=e,a=this.get(t,r);if(!n&&a!==void 0)return a;let o=i(t,a,{options:r,context:s});return this.set(t,o,r),o}get(t,e={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:r}=e,a=this.#s.get(t);if(a!==void 0){let o=this.#t[a],g=this.#e(o);return r&&this.#F(r,a),this.#g(a)?(r&&(r.get="stale"),g?(r&&i&&o.__staleWhileFetching!==void 0&&(r.returnedStale=true),i?o.__staleWhileFetching:void 0):(n||this.#E(t,"expire"),r&&i&&(r.returnedStale=true),i?o:void 0)):(r&&(r.get="hit"),g?o.__staleWhileFetching:(this.#C(a),s&&this.#v(a),o))}else r&&(r.get="miss");}#j(t,e){this.#u[e]=t,this.#l[t]=e;}#C(t){t!==this.#r&&(t===this.#o?this.#o=this.#l[t]:this.#j(this.#u[t],this.#l[t]),this.#j(this.#r,t),this.#r=t);}delete(t){return this.#E(t,"delete")}#E(t,e){let i=false;if(this.#n!==0){let s=this.#s.get(t);if(s!==void 0)if(i=true,this.#n===1)this.#P(e);else {this.#x(s);let n=this.#t[s];if(this.#e(n)?n.__abortController.abort(new Error("deleted")):(this.#_||this.#f)&&(this.#_&&this.#p?.(n,t,e),this.#f&&this.#h?.push([n,t,e])),this.#s.delete(t),this.#i[s]=void 0,this.#t[s]=void 0,s===this.#r)this.#r=this.#u[s];else if(s===this.#o)this.#o=this.#l[s];else {let r=this.#u[s];this.#l[r]=this.#l[s];let a=this.#l[s];this.#u[a]=this.#u[s];}this.#n--,this.#w.push(s);}}if(this.#f&&this.#h?.length){let s=this.#h,n;for(;n=s?.shift();)this.#m?.(...n);}return i}clear(){return this.#P("delete")}#P(t){for(let e of this.#T({allowStale:true})){let i=this.#t[e];if(this.#e(i))i.__abortController.abort(new Error("deleted"));else {let s=this.#i[e];this.#_&&this.#p?.(i,s,t),this.#f&&this.#h?.push([i,s,t]);}}if(this.#s.clear(),this.#t.fill(void 0),this.#i.fill(void 0),this.#d&&this.#y&&(this.#d.fill(0),this.#y.fill(0)),this.#b&&this.#b.fill(0),this.#o=0,this.#r=0,this.#w.length=0,this.#S=0,this.#n=0,this.#f&&this.#h){let e=this.#h,i;for(;i=e?.shift();)this.#m?.(...i);}}};var z=class{cache;map=new Map;constructor(t){this.cache=new R({max:t.cacheSize}),this.map=new Map;}get[Symbol.iterator](){return this.map[Symbol.iterator]}get[Symbol.toStringTag](){return this.map[Symbol.toStringTag]}clear(){return this.cache.clear(),this.map.clear()}delete(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}get entries(){return this.map.entries}get keys(){return this.map.keys}get values(){return this.map.values}};var M;(s=>(s.log=(n,...r)=>console.log(`[Pixi\u2019VN] ${n}`,...r),s.warn=(n,...r)=>console.warn(`[Pixi\u2019VN] ${n}`,...r),s.error=(n,...r)=>console.error(`[Pixi\u2019VN] ${n}`,...r),s.info=(n,...r)=>console.info(`[Pixi\u2019VN] ${n}`,...r)))(M||={});function j(h){try{if(typeof h>"u")return h;let t=JSON.stringify(h);return JSON.parse(t)}catch(t){throw M.error("Error creating exportable element",h,t),new Error("[Pixi\u2019VN] Error creating exportable element")}}var I=class h{static storage=new z({cacheSize:20});static startingStorage=[];static flags=Array();static tempStorage=new Map;static tempStorageDeadlines=new Map;constructor(){}static clearOldTempVariables(t){h.tempStorageDeadlines.forEach((e,i)=>{e>t&&(h.tempStorage.delete(i),h.tempStorageDeadlines.delete(i),h.storage.cache.delete(i));});}static setVariable(t,e){let i=h.tempStorage.has(t);e==null?(h.storage.map.delete(t),!i&&h.storage.cache.delete(t)):(h.storage.map.set(t,e),!i&&h.storage.cache.set(t,e));}static getVariable(t){let e=h.storage.cache.get(t);return e===void 0&&(e=h.tempStorage.get(t)),e===void 0&&(e=h.storage.map.get(t)),j(e)}static removeVariable(t){h.storage.delete(t);}static setFlag(t,e){if(e)this.flags.includes(t)||this.flags.push(t);else {let i=this.flags.indexOf(t);i>-1&&this.flags.splice(i,1);}}static getFlag(t){return this.flags.includes(t)}};module.exports=I;
1
+ 'use strict';var F=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,N=new Set,D=typeof process=="object"&&process?process:{},V=(h,t,e,i)=>{typeof D.emitWarning=="function"?D.emitWarning(h,t,e,i):console.error(`[${e}] ${t}: ${h}`);},C=globalThis.AbortController,U=globalThis.AbortSignal;if(typeof C>"u"){U=class{onabort;_onabort=[];reason;aborted=false;addEventListener(i,s){this._onabort.push(s);}},C=class{constructor(){t();}signal=new U;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=D.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",t=()=>{h&&(h=false,V("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 P=h=>!N.has(h),_=h=>h&&h===Math.floor(h)&&h>0&&isFinite(h),G=h=>_(h)?h<=Math.pow(2,8)?Uint8Array:h<=Math.pow(2,16)?Uint16Array:h<=Math.pow(2,32)?Uint32Array:h<=Number.MAX_SAFE_INTEGER?O:null:null,O=class extends Array{constructor(t){super(t),this.fill(0);}},L=class h{heap;length;static#a=false;static create(t){let e=G(t);if(!e)return [];h.#a=true;let i=new h(t,e);return h.#a=false,i}constructor(t,e){if(!h.#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]}},R=class h{#a;#c;#p;#z;#m;#R;#W;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#n;#S;#s;#i;#t;#l;#u;#o;#r;#w;#h;#b;#y;#d;#_;#O;#f;#D;static unsafeExposeInternals(t){return {starts:t.#y,ttls:t.#d,sizes:t.#b,keyMap:t.#s,keyList:t.#i,valList:t.#t,next:t.#l,prev:t.#u,get head(){return t.#o},get tail(){return t.#r},free:t.#w,isBackgroundFetch:e=>t.#e(e),backgroundFetch:(e,i,s,n)=>t.#I(e,i,s,n),moveToTail:e=>t.#C(e),indexes:e=>t.#A(e),rindexes:e=>t.#T(e),isStale:e=>t.#g(e)}}get max(){return this.#a}get maxSize(){return this.#c}get calculatedSize(){return this.#S}get size(){return this.#n}get fetchMethod(){return this.#R}get memoMethod(){return this.#W}get dispose(){return this.#p}get onInsert(){return this.#z}get disposeAfter(){return this.#m}constructor(t){let{max:e=0,ttl:i,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:r,updateAgeOnHas:a,allowStale:o,dispose:g,onInsert:w,disposeAfter:f,noDisposeOnSet:c,noUpdateTTL:u,maxSize:A=0,maxEntrySize:d=0,sizeCalculation:b,fetchMethod:l,memoMethod:m,noDeleteOnFetchRejection:y,noDeleteOnStaleGet:p,allowStaleOnFetchRejection:S,allowStaleOnFetchAbort:v,ignoreFetchAbort:T}=t;if(e!==0&&!_(e))throw new TypeError("max option must be a nonnegative integer");let x=e?G(e):Array;if(!x)throw new Error("invalid max value: "+e);if(this.#a=e,this.#c=A,this.maxEntrySize=d||this.#c,this.sizeCalculation=b,this.sizeCalculation){if(!this.#c&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(m!==void 0&&typeof m!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#W=m,l!==void 0&&typeof l!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#R=l,this.#O=!!l,this.#s=new Map,this.#i=new Array(e).fill(void 0),this.#t=new Array(e).fill(void 0),this.#l=new x(e),this.#u=new x(e),this.#o=0,this.#r=0,this.#w=L.create(e),this.#n=0,this.#S=0,typeof g=="function"&&(this.#p=g),typeof w=="function"&&(this.#z=w),typeof f=="function"?(this.#m=f,this.#h=[]):(this.#m=void 0,this.#h=void 0),this.#_=!!this.#p,this.#D=!!this.#z,this.#f=!!this.#m,this.noDisposeOnSet=!!c,this.noUpdateTTL=!!u,this.noDeleteOnFetchRejection=!!y,this.allowStaleOnFetchRejection=!!S,this.allowStaleOnFetchAbort=!!v,this.ignoreFetchAbort=!!T,this.maxEntrySize!==0){if(this.#c!==0&&!_(this.#c))throw new TypeError("maxSize must be a positive integer if specified");if(!_(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#H();}if(this.allowStale=!!o,this.noDeleteOnStaleGet=!!p,this.updateAgeOnGet=!!r,this.updateAgeOnHas=!!a,this.ttlResolution=_(s)||s===0?s:1,this.ttlAutopurge=!!n,this.ttl=i||0,this.ttl){if(!_(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#U();}if(this.#a===0&&this.ttl===0&&this.#c===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#a&&!this.#c){let E="LRU_CACHE_UNBOUNDED";P(E)&&(N.add(E),V("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",E,h));}}getRemainingTTL(t){return this.#s.has(t)?1/0:0}#U(){let t=new O(this.#a),e=new O(this.#a);this.#d=t,this.#y=e,this.#N=(n,r,a=F.now())=>{if(e[n]=r!==0?a:0,t[n]=r,r!==0&&this.ttlAutopurge){let o=setTimeout(()=>{this.#g(n)&&this.#E(this.#i[n],"expire");},r+1);o.unref&&o.unref();}},this.#v=n=>{e[n]=t[n]!==0?F.now():0;},this.#F=(n,r)=>{if(t[r]){let a=t[r],o=e[r];if(!a||!o)return;n.ttl=a,n.start=o,n.now=i||s();let g=n.now-o;n.remainingTTL=a-g;}};let i=0,s=()=>{let n=F.now();if(this.ttlResolution>0){i=n;let r=setTimeout(()=>i=0,this.ttlResolution);r.unref&&r.unref();}return n};this.getRemainingTTL=n=>{let r=this.#s.get(n);if(r===void 0)return 0;let a=t[r],o=e[r];if(!a||!o)return 1/0;let g=(i||s())-o;return a-g},this.#g=n=>{let r=e[n],a=t[n];return !!a&&!!r&&(i||s())-r>a};}#v=()=>{};#F=()=>{};#N=()=>{};#g=()=>false;#H(){let t=new O(this.#a);this.#S=0,this.#b=t,this.#x=e=>{this.#S-=t[e],t[e]=0;},this.#V=(e,i,s,n)=>{if(this.#e(i))return 0;if(!_(s))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(s=n(i,e),!_(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return s},this.#L=(e,i,s)=>{if(t[e]=i,this.#c){let n=this.#c-t[e];for(;this.#S>n;)this.#M(true);}this.#S+=t[e],s&&(s.entrySize=i,s.totalCalculatedSize=this.#S);};}#x=t=>{};#L=(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};*#A({allowStale:t=this.allowStale}={}){if(this.#n)for(let e=this.#r;!(!this.#G(e)||((t||!this.#g(e))&&(yield e),e===this.#o));)e=this.#u[e];}*#T({allowStale:t=this.allowStale}={}){if(this.#n)for(let e=this.#o;!(!this.#G(e)||((t||!this.#g(e))&&(yield e),e===this.#r));)e=this.#l[e];}#G(t){return t!==void 0&&this.#s.get(this.#i[t])===t}*entries(){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]]);}*rentries(){for(let t of this.#T())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.#A()){let e=this.#i[t];e!==void 0&&!this.#e(this.#t[t])&&(yield e);}}*rkeys(){for(let t of this.#T()){let e=this.#i[t];e!==void 0&&!this.#e(this.#t[t])&&(yield e);}}*values(){for(let t of this.#A())this.#t[t]!==void 0&&!this.#e(this.#t[t])&&(yield this.#t[t]);}*rvalues(){for(let t of this.#T())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.#A()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;if(n!==void 0&&t(n,this.#i[i],this))return this.get(this.#i[i],e)}}forEach(t,e=this){for(let i of this.#A()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;n!==void 0&&t.call(e,n,this.#i[i],this);}}rforEach(t,e=this){for(let i of this.#T()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;n!==void 0&&t.call(e,n,this.#i[i],this);}}purgeStale(){let t=false;for(let e of this.#T({allowStale:true}))this.#g(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 n={value:s};if(this.#d&&this.#y){let r=this.#d[e],a=this.#y[e];if(r&&a){let o=r-(F.now()-a);n.ttl=o,n.start=Date.now();}}return this.#b&&(n.size=this.#b[e]),n}dump(){let t=[];for(let e of this.#A({allowStale:true})){let i=this.#i[e],s=this.#t[e],n=this.#e(s)?s.__staleWhileFetching:s;if(n===void 0||i===void 0)continue;let r={value:n};if(this.#d&&this.#y){r.ttl=this.#d[e];let a=F.now()-this.#y[e];r.start=Math.floor(Date.now()-a);}this.#b&&(r.size=this.#b[e]),t.unshift([i,r]);}return t}load(t){this.clear();for(let[e,i]of t){if(i.start){let s=Date.now()-i.start;i.start=F.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:n,noDisposeOnSet:r=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:o}=i,{noUpdateTTL:g=this.noUpdateTTL}=i,w=this.#V(t,e,i.size||0,a);if(this.maxEntrySize&&w>this.maxEntrySize)return o&&(o.set="miss",o.maxEntrySizeExceeded=true),this.#E(t,"set"),this;let f=this.#n===0?void 0:this.#s.get(t);if(f===void 0)f=this.#n===0?this.#r:this.#w.length!==0?this.#w.pop():this.#n===this.#a?this.#M(false):this.#n,this.#i[f]=t,this.#t[f]=e,this.#s.set(t,f),this.#l[this.#r]=f,this.#u[f]=this.#r,this.#r=f,this.#n++,this.#L(f,w,o),o&&(o.set="add"),g=false,this.#D&&this.#z?.(e,t,"add");else {this.#C(f);let c=this.#t[f];if(e!==c){if(this.#O&&this.#e(c)){c.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:u}=c;u!==void 0&&!r&&(this.#_&&this.#p?.(u,t,"set"),this.#f&&this.#h?.push([u,t,"set"]));}else r||(this.#_&&this.#p?.(c,t,"set"),this.#f&&this.#h?.push([c,t,"set"]));if(this.#x(f),this.#L(f,w,o),this.#t[f]=e,o){o.set="replace";let u=c&&this.#e(c)?c.__staleWhileFetching:c;u!==void 0&&(o.oldValue=u);}}else o&&(o.set="update");this.#D&&this.onInsert?.(e,t,e===c?"update":"replace");}if(s!==0&&!this.#d&&this.#U(),this.#d&&(g||this.#N(f,s,n),o&&this.#F(o,f)),!r&&this.#f&&this.#h){let c=this.#h,u;for(;u=c?.shift();)this.#m?.(...u);}return this}pop(){try{for(;this.#n;){let t=this.#t[this.#o];if(this.#M(!0),this.#e(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(this.#f&&this.#h){let t=this.#h,e;for(;e=t?.shift();)this.#m?.(...e);}}}#M(t){let e=this.#o,i=this.#i[e],s=this.#t[e];return this.#O&&this.#e(s)?s.__abortController.abort(new Error("evicted")):(this.#_||this.#f)&&(this.#_&&this.#p?.(s,i,"evict"),this.#f&&this.#h?.push([s,i,"evict"])),this.#x(e),t&&(this.#i[e]=void 0,this.#t[e]=void 0,this.#w.push(e)),this.#n===1?(this.#o=this.#r=0,this.#w.length=0):this.#o=this.#l[e],this.#s.delete(i),this.#n--,e}has(t,e={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=e,n=this.#s.get(t);if(n!==void 0){let r=this.#t[n];if(this.#e(r)&&r.__staleWhileFetching===void 0)return false;if(this.#g(n))s&&(s.has="stale",this.#F(s,n));else return i&&this.#v(n),s&&(s.has="hit",this.#F(s,n)),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.#g(s))return;let n=this.#t[s];return this.#e(n)?n.__staleWhileFetching:n}#I(t,e,i,s){let n=e===void 0?void 0:this.#t[e];if(this.#e(n))return n;let r=new C,{signal:a}=i;a?.addEventListener("abort",()=>r.abort(a.reason),{signal:r.signal});let o={signal:r.signal,options:i,context:s},g=(d,b=false)=>{let{aborted:l}=r.signal,m=i.ignoreFetchAbort&&d!==void 0;if(i.status&&(l&&!b?(i.status.fetchAborted=true,i.status.fetchError=r.signal.reason,m&&(i.status.fetchAbortIgnored=true)):i.status.fetchResolved=true),l&&!m&&!b)return f(r.signal.reason);let y=u;return this.#t[e]===u&&(d===void 0?y.__staleWhileFetching?this.#t[e]=y.__staleWhileFetching:this.#E(t,"fetch"):(i.status&&(i.status.fetchUpdated=true),this.set(t,d,o.options))),d},w=d=>(i.status&&(i.status.fetchRejected=true,i.status.fetchError=d),f(d)),f=d=>{let{aborted:b}=r.signal,l=b&&i.allowStaleOnFetchAbort,m=l||i.allowStaleOnFetchRejection,y=m||i.noDeleteOnFetchRejection,p=u;if(this.#t[e]===u&&(!y||p.__staleWhileFetching===void 0?this.#E(t,"fetch"):l||(this.#t[e]=p.__staleWhileFetching)),m)return i.status&&p.__staleWhileFetching!==void 0&&(i.status.returnedStale=true),p.__staleWhileFetching;if(p.__returned===p)throw d},c=(d,b)=>{let l=this.#R?.(t,n,o);l&&l instanceof Promise&&l.then(m=>d(m===void 0?void 0:m),b),r.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(d(void 0),i.allowStaleOnFetchAbort&&(d=m=>g(m,true)));});};i.status&&(i.status.fetchDispatched=true);let u=new Promise(c).then(g,w),A=Object.assign(u,{__abortController:r,__staleWhileFetching:n,__returned:void 0});return e===void 0?(this.set(t,A,{...o.options,status:void 0}),e=this.#s.get(t)):this.#t[e]=A,A}#e(t){if(!this.#O)return false;let e=t;return !!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof C}async fetch(t,e={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:r=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:o=0,sizeCalculation:g=this.sizeCalculation,noUpdateTTL:w=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:c=this.allowStaleOnFetchRejection,ignoreFetchAbort:u=this.ignoreFetchAbort,allowStaleOnFetchAbort:A=this.allowStaleOnFetchAbort,context:d,forceRefresh:b=false,status:l,signal:m}=e;if(!this.#O)return l&&(l.fetch="get"),this.get(t,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:l});let y={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:r,noDisposeOnSet:a,size:o,sizeCalculation:g,noUpdateTTL:w,noDeleteOnFetchRejection:f,allowStaleOnFetchRejection:c,allowStaleOnFetchAbort:A,ignoreFetchAbort:u,status:l,signal:m},p=this.#s.get(t);if(p===void 0){l&&(l.fetch="miss");let S=this.#I(t,p,y,d);return S.__returned=S}else {let S=this.#t[p];if(this.#e(S)){let W=i&&S.__staleWhileFetching!==void 0;return l&&(l.fetch="inflight",W&&(l.returnedStale=true)),W?S.__staleWhileFetching:S.__returned=S}let v=this.#g(p);if(!b&&!v)return l&&(l.fetch="hit"),this.#C(p),s&&this.#v(p),l&&this.#F(l,p),S;let T=this.#I(t,p,y,d),E=T.__staleWhileFetching!==void 0&&i;return l&&(l.fetch=v?"stale":"refresh",E&&v&&(l.returnedStale=true)),E?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.#W;if(!i)throw new Error("no memoMethod provided to constructor");let{context:s,forceRefresh:n,...r}=e,a=this.get(t,r);if(!n&&a!==void 0)return a;let o=i(t,a,{options:r,context:s});return this.set(t,o,r),o}get(t,e={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:r}=e,a=this.#s.get(t);if(a!==void 0){let o=this.#t[a],g=this.#e(o);return r&&this.#F(r,a),this.#g(a)?(r&&(r.get="stale"),g?(r&&i&&o.__staleWhileFetching!==void 0&&(r.returnedStale=true),i?o.__staleWhileFetching:void 0):(n||this.#E(t,"expire"),r&&i&&(r.returnedStale=true),i?o:void 0)):(r&&(r.get="hit"),g?o.__staleWhileFetching:(this.#C(a),s&&this.#v(a),o))}else r&&(r.get="miss");}#j(t,e){this.#u[e]=t,this.#l[t]=e;}#C(t){t!==this.#r&&(t===this.#o?this.#o=this.#l[t]:this.#j(this.#u[t],this.#l[t]),this.#j(this.#r,t),this.#r=t);}delete(t){return this.#E(t,"delete")}#E(t,e){let i=false;if(this.#n!==0){let s=this.#s.get(t);if(s!==void 0)if(i=true,this.#n===1)this.#P(e);else {this.#x(s);let n=this.#t[s];if(this.#e(n)?n.__abortController.abort(new Error("deleted")):(this.#_||this.#f)&&(this.#_&&this.#p?.(n,t,e),this.#f&&this.#h?.push([n,t,e])),this.#s.delete(t),this.#i[s]=void 0,this.#t[s]=void 0,s===this.#r)this.#r=this.#u[s];else if(s===this.#o)this.#o=this.#l[s];else {let r=this.#u[s];this.#l[r]=this.#l[s];let a=this.#l[s];this.#u[a]=this.#u[s];}this.#n--,this.#w.push(s);}}if(this.#f&&this.#h?.length){let s=this.#h,n;for(;n=s?.shift();)this.#m?.(...n);}return i}clear(){return this.#P("delete")}#P(t){for(let e of this.#T({allowStale:true})){let i=this.#t[e];if(this.#e(i))i.__abortController.abort(new Error("deleted"));else {let s=this.#i[e];this.#_&&this.#p?.(i,s,t),this.#f&&this.#h?.push([i,s,t]);}}if(this.#s.clear(),this.#t.fill(void 0),this.#i.fill(void 0),this.#d&&this.#y&&(this.#d.fill(0),this.#y.fill(0)),this.#b&&this.#b.fill(0),this.#o=0,this.#r=0,this.#w.length=0,this.#S=0,this.#n=0,this.#f&&this.#h){let e=this.#h,i;for(;i=e?.shift();)this.#m?.(...i);}}};var z=class{cache;map=new Map;constructor(t){this.cache=new R({max:t.cacheSize}),this.map=new Map;}get[Symbol.iterator](){return this.map[Symbol.iterator]}get[Symbol.toStringTag](){return this.map[Symbol.toStringTag]}clear(){return this.cache.clear(),this.map.clear()}delete(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}get entries(){return this.map.entries}keys(){return this.map.keys()}get values(){return this.map.values}};var M;(s=>(s.log=(n,...r)=>console.log(`[Pixi\u2019VN] ${n}`,...r),s.warn=(n,...r)=>console.warn(`[Pixi\u2019VN] ${n}`,...r),s.error=(n,...r)=>console.error(`[Pixi\u2019VN] ${n}`,...r),s.info=(n,...r)=>console.info(`[Pixi\u2019VN] ${n}`,...r)))(M||={});function j(h){try{if(typeof h>"u")return h;let t=JSON.stringify(h);return JSON.parse(t)}catch(t){throw M.error("Error creating exportable element",h,t),new Error("[Pixi\u2019VN] Error creating exportable element")}}var I=class h{static storage=new z({cacheSize:20});static startingStorage=[];static flags=Array();static tempStorage=new Map;static tempStorageDeadlines=new Map;constructor(){}static clearOldTempVariables(t){h.tempStorageDeadlines.forEach((e,i)=>{e>t&&(h.tempStorage.delete(i),h.tempStorageDeadlines.delete(i),h.storage.cache.delete(i));});}static setVariable(t,e){let i=h.tempStorage.has(t);e==null?(h.storage.map.delete(t),!i&&h.storage.cache.delete(t)):(h.storage.map.set(t,e),!i&&h.storage.cache.set(t,e));}static getVariable(t){let e=h.storage.cache.get(t);return e===void 0&&(e=h.tempStorage.get(t)),e===void 0&&(e=h.storage.map.get(t)),j(e)}static removeVariable(t){h.storage.delete(t);}static setFlag(t,e){if(e)this.flags.includes(t)||this.flags.push(t);else {let i=this.flags.indexOf(t);i>-1&&this.flags.splice(i,1);}}static getFlag(t){return this.flags.includes(t)}};module.exports=I;
@@ -1 +1 @@
1
- var F=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,N=new Set,D=typeof process=="object"&&process?process:{},V=(h,t,e,i)=>{typeof D.emitWarning=="function"?D.emitWarning(h,t,e,i):console.error(`[${e}] ${t}: ${h}`);},C=globalThis.AbortController,U=globalThis.AbortSignal;if(typeof C>"u"){U=class{onabort;_onabort=[];reason;aborted=false;addEventListener(i,s){this._onabort.push(s);}},C=class{constructor(){t();}signal=new U;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=D.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",t=()=>{h&&(h=false,V("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 P=h=>!N.has(h),_=h=>h&&h===Math.floor(h)&&h>0&&isFinite(h),G=h=>_(h)?h<=Math.pow(2,8)?Uint8Array:h<=Math.pow(2,16)?Uint16Array:h<=Math.pow(2,32)?Uint32Array:h<=Number.MAX_SAFE_INTEGER?O:null:null,O=class extends Array{constructor(t){super(t),this.fill(0);}},L=class h{heap;length;static#a=false;static create(t){let e=G(t);if(!e)return [];h.#a=true;let i=new h(t,e);return h.#a=false,i}constructor(t,e){if(!h.#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]}},R=class h{#a;#c;#p;#z;#m;#R;#W;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#n;#S;#s;#i;#t;#l;#u;#o;#r;#w;#h;#b;#y;#d;#_;#O;#f;#D;static unsafeExposeInternals(t){return {starts:t.#y,ttls:t.#d,sizes:t.#b,keyMap:t.#s,keyList:t.#i,valList:t.#t,next:t.#l,prev:t.#u,get head(){return t.#o},get tail(){return t.#r},free:t.#w,isBackgroundFetch:e=>t.#e(e),backgroundFetch:(e,i,s,n)=>t.#I(e,i,s,n),moveToTail:e=>t.#C(e),indexes:e=>t.#A(e),rindexes:e=>t.#T(e),isStale:e=>t.#g(e)}}get max(){return this.#a}get maxSize(){return this.#c}get calculatedSize(){return this.#S}get size(){return this.#n}get fetchMethod(){return this.#R}get memoMethod(){return this.#W}get dispose(){return this.#p}get onInsert(){return this.#z}get disposeAfter(){return this.#m}constructor(t){let{max:e=0,ttl:i,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:r,updateAgeOnHas:a,allowStale:o,dispose:g,onInsert:w,disposeAfter:f,noDisposeOnSet:c,noUpdateTTL:u,maxSize:A=0,maxEntrySize:d=0,sizeCalculation:b,fetchMethod:l,memoMethod:m,noDeleteOnFetchRejection:y,noDeleteOnStaleGet:p,allowStaleOnFetchRejection:S,allowStaleOnFetchAbort:v,ignoreFetchAbort:T}=t;if(e!==0&&!_(e))throw new TypeError("max option must be a nonnegative integer");let x=e?G(e):Array;if(!x)throw new Error("invalid max value: "+e);if(this.#a=e,this.#c=A,this.maxEntrySize=d||this.#c,this.sizeCalculation=b,this.sizeCalculation){if(!this.#c&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(m!==void 0&&typeof m!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#W=m,l!==void 0&&typeof l!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#R=l,this.#O=!!l,this.#s=new Map,this.#i=new Array(e).fill(void 0),this.#t=new Array(e).fill(void 0),this.#l=new x(e),this.#u=new x(e),this.#o=0,this.#r=0,this.#w=L.create(e),this.#n=0,this.#S=0,typeof g=="function"&&(this.#p=g),typeof w=="function"&&(this.#z=w),typeof f=="function"?(this.#m=f,this.#h=[]):(this.#m=void 0,this.#h=void 0),this.#_=!!this.#p,this.#D=!!this.#z,this.#f=!!this.#m,this.noDisposeOnSet=!!c,this.noUpdateTTL=!!u,this.noDeleteOnFetchRejection=!!y,this.allowStaleOnFetchRejection=!!S,this.allowStaleOnFetchAbort=!!v,this.ignoreFetchAbort=!!T,this.maxEntrySize!==0){if(this.#c!==0&&!_(this.#c))throw new TypeError("maxSize must be a positive integer if specified");if(!_(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#H();}if(this.allowStale=!!o,this.noDeleteOnStaleGet=!!p,this.updateAgeOnGet=!!r,this.updateAgeOnHas=!!a,this.ttlResolution=_(s)||s===0?s:1,this.ttlAutopurge=!!n,this.ttl=i||0,this.ttl){if(!_(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#U();}if(this.#a===0&&this.ttl===0&&this.#c===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#a&&!this.#c){let E="LRU_CACHE_UNBOUNDED";P(E)&&(N.add(E),V("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",E,h));}}getRemainingTTL(t){return this.#s.has(t)?1/0:0}#U(){let t=new O(this.#a),e=new O(this.#a);this.#d=t,this.#y=e,this.#N=(n,r,a=F.now())=>{if(e[n]=r!==0?a:0,t[n]=r,r!==0&&this.ttlAutopurge){let o=setTimeout(()=>{this.#g(n)&&this.#E(this.#i[n],"expire");},r+1);o.unref&&o.unref();}},this.#v=n=>{e[n]=t[n]!==0?F.now():0;},this.#F=(n,r)=>{if(t[r]){let a=t[r],o=e[r];if(!a||!o)return;n.ttl=a,n.start=o,n.now=i||s();let g=n.now-o;n.remainingTTL=a-g;}};let i=0,s=()=>{let n=F.now();if(this.ttlResolution>0){i=n;let r=setTimeout(()=>i=0,this.ttlResolution);r.unref&&r.unref();}return n};this.getRemainingTTL=n=>{let r=this.#s.get(n);if(r===void 0)return 0;let a=t[r],o=e[r];if(!a||!o)return 1/0;let g=(i||s())-o;return a-g},this.#g=n=>{let r=e[n],a=t[n];return !!a&&!!r&&(i||s())-r>a};}#v=()=>{};#F=()=>{};#N=()=>{};#g=()=>false;#H(){let t=new O(this.#a);this.#S=0,this.#b=t,this.#x=e=>{this.#S-=t[e],t[e]=0;},this.#V=(e,i,s,n)=>{if(this.#e(i))return 0;if(!_(s))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(s=n(i,e),!_(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return s},this.#L=(e,i,s)=>{if(t[e]=i,this.#c){let n=this.#c-t[e];for(;this.#S>n;)this.#M(true);}this.#S+=t[e],s&&(s.entrySize=i,s.totalCalculatedSize=this.#S);};}#x=t=>{};#L=(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};*#A({allowStale:t=this.allowStale}={}){if(this.#n)for(let e=this.#r;!(!this.#G(e)||((t||!this.#g(e))&&(yield e),e===this.#o));)e=this.#u[e];}*#T({allowStale:t=this.allowStale}={}){if(this.#n)for(let e=this.#o;!(!this.#G(e)||((t||!this.#g(e))&&(yield e),e===this.#r));)e=this.#l[e];}#G(t){return t!==void 0&&this.#s.get(this.#i[t])===t}*entries(){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]]);}*rentries(){for(let t of this.#T())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.#A()){let e=this.#i[t];e!==void 0&&!this.#e(this.#t[t])&&(yield e);}}*rkeys(){for(let t of this.#T()){let e=this.#i[t];e!==void 0&&!this.#e(this.#t[t])&&(yield e);}}*values(){for(let t of this.#A())this.#t[t]!==void 0&&!this.#e(this.#t[t])&&(yield this.#t[t]);}*rvalues(){for(let t of this.#T())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.#A()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;if(n!==void 0&&t(n,this.#i[i],this))return this.get(this.#i[i],e)}}forEach(t,e=this){for(let i of this.#A()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;n!==void 0&&t.call(e,n,this.#i[i],this);}}rforEach(t,e=this){for(let i of this.#T()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;n!==void 0&&t.call(e,n,this.#i[i],this);}}purgeStale(){let t=false;for(let e of this.#T({allowStale:true}))this.#g(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 n={value:s};if(this.#d&&this.#y){let r=this.#d[e],a=this.#y[e];if(r&&a){let o=r-(F.now()-a);n.ttl=o,n.start=Date.now();}}return this.#b&&(n.size=this.#b[e]),n}dump(){let t=[];for(let e of this.#A({allowStale:true})){let i=this.#i[e],s=this.#t[e],n=this.#e(s)?s.__staleWhileFetching:s;if(n===void 0||i===void 0)continue;let r={value:n};if(this.#d&&this.#y){r.ttl=this.#d[e];let a=F.now()-this.#y[e];r.start=Math.floor(Date.now()-a);}this.#b&&(r.size=this.#b[e]),t.unshift([i,r]);}return t}load(t){this.clear();for(let[e,i]of t){if(i.start){let s=Date.now()-i.start;i.start=F.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:n,noDisposeOnSet:r=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:o}=i,{noUpdateTTL:g=this.noUpdateTTL}=i,w=this.#V(t,e,i.size||0,a);if(this.maxEntrySize&&w>this.maxEntrySize)return o&&(o.set="miss",o.maxEntrySizeExceeded=true),this.#E(t,"set"),this;let f=this.#n===0?void 0:this.#s.get(t);if(f===void 0)f=this.#n===0?this.#r:this.#w.length!==0?this.#w.pop():this.#n===this.#a?this.#M(false):this.#n,this.#i[f]=t,this.#t[f]=e,this.#s.set(t,f),this.#l[this.#r]=f,this.#u[f]=this.#r,this.#r=f,this.#n++,this.#L(f,w,o),o&&(o.set="add"),g=false,this.#D&&this.#z?.(e,t,"add");else {this.#C(f);let c=this.#t[f];if(e!==c){if(this.#O&&this.#e(c)){c.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:u}=c;u!==void 0&&!r&&(this.#_&&this.#p?.(u,t,"set"),this.#f&&this.#h?.push([u,t,"set"]));}else r||(this.#_&&this.#p?.(c,t,"set"),this.#f&&this.#h?.push([c,t,"set"]));if(this.#x(f),this.#L(f,w,o),this.#t[f]=e,o){o.set="replace";let u=c&&this.#e(c)?c.__staleWhileFetching:c;u!==void 0&&(o.oldValue=u);}}else o&&(o.set="update");this.#D&&this.onInsert?.(e,t,e===c?"update":"replace");}if(s!==0&&!this.#d&&this.#U(),this.#d&&(g||this.#N(f,s,n),o&&this.#F(o,f)),!r&&this.#f&&this.#h){let c=this.#h,u;for(;u=c?.shift();)this.#m?.(...u);}return this}pop(){try{for(;this.#n;){let t=this.#t[this.#o];if(this.#M(!0),this.#e(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(this.#f&&this.#h){let t=this.#h,e;for(;e=t?.shift();)this.#m?.(...e);}}}#M(t){let e=this.#o,i=this.#i[e],s=this.#t[e];return this.#O&&this.#e(s)?s.__abortController.abort(new Error("evicted")):(this.#_||this.#f)&&(this.#_&&this.#p?.(s,i,"evict"),this.#f&&this.#h?.push([s,i,"evict"])),this.#x(e),t&&(this.#i[e]=void 0,this.#t[e]=void 0,this.#w.push(e)),this.#n===1?(this.#o=this.#r=0,this.#w.length=0):this.#o=this.#l[e],this.#s.delete(i),this.#n--,e}has(t,e={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=e,n=this.#s.get(t);if(n!==void 0){let r=this.#t[n];if(this.#e(r)&&r.__staleWhileFetching===void 0)return false;if(this.#g(n))s&&(s.has="stale",this.#F(s,n));else return i&&this.#v(n),s&&(s.has="hit",this.#F(s,n)),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.#g(s))return;let n=this.#t[s];return this.#e(n)?n.__staleWhileFetching:n}#I(t,e,i,s){let n=e===void 0?void 0:this.#t[e];if(this.#e(n))return n;let r=new C,{signal:a}=i;a?.addEventListener("abort",()=>r.abort(a.reason),{signal:r.signal});let o={signal:r.signal,options:i,context:s},g=(d,b=false)=>{let{aborted:l}=r.signal,m=i.ignoreFetchAbort&&d!==void 0;if(i.status&&(l&&!b?(i.status.fetchAborted=true,i.status.fetchError=r.signal.reason,m&&(i.status.fetchAbortIgnored=true)):i.status.fetchResolved=true),l&&!m&&!b)return f(r.signal.reason);let y=u;return this.#t[e]===u&&(d===void 0?y.__staleWhileFetching?this.#t[e]=y.__staleWhileFetching:this.#E(t,"fetch"):(i.status&&(i.status.fetchUpdated=true),this.set(t,d,o.options))),d},w=d=>(i.status&&(i.status.fetchRejected=true,i.status.fetchError=d),f(d)),f=d=>{let{aborted:b}=r.signal,l=b&&i.allowStaleOnFetchAbort,m=l||i.allowStaleOnFetchRejection,y=m||i.noDeleteOnFetchRejection,p=u;if(this.#t[e]===u&&(!y||p.__staleWhileFetching===void 0?this.#E(t,"fetch"):l||(this.#t[e]=p.__staleWhileFetching)),m)return i.status&&p.__staleWhileFetching!==void 0&&(i.status.returnedStale=true),p.__staleWhileFetching;if(p.__returned===p)throw d},c=(d,b)=>{let l=this.#R?.(t,n,o);l&&l instanceof Promise&&l.then(m=>d(m===void 0?void 0:m),b),r.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(d(void 0),i.allowStaleOnFetchAbort&&(d=m=>g(m,true)));});};i.status&&(i.status.fetchDispatched=true);let u=new Promise(c).then(g,w),A=Object.assign(u,{__abortController:r,__staleWhileFetching:n,__returned:void 0});return e===void 0?(this.set(t,A,{...o.options,status:void 0}),e=this.#s.get(t)):this.#t[e]=A,A}#e(t){if(!this.#O)return false;let e=t;return !!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof C}async fetch(t,e={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:r=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:o=0,sizeCalculation:g=this.sizeCalculation,noUpdateTTL:w=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:c=this.allowStaleOnFetchRejection,ignoreFetchAbort:u=this.ignoreFetchAbort,allowStaleOnFetchAbort:A=this.allowStaleOnFetchAbort,context:d,forceRefresh:b=false,status:l,signal:m}=e;if(!this.#O)return l&&(l.fetch="get"),this.get(t,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:l});let y={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:r,noDisposeOnSet:a,size:o,sizeCalculation:g,noUpdateTTL:w,noDeleteOnFetchRejection:f,allowStaleOnFetchRejection:c,allowStaleOnFetchAbort:A,ignoreFetchAbort:u,status:l,signal:m},p=this.#s.get(t);if(p===void 0){l&&(l.fetch="miss");let S=this.#I(t,p,y,d);return S.__returned=S}else {let S=this.#t[p];if(this.#e(S)){let W=i&&S.__staleWhileFetching!==void 0;return l&&(l.fetch="inflight",W&&(l.returnedStale=true)),W?S.__staleWhileFetching:S.__returned=S}let v=this.#g(p);if(!b&&!v)return l&&(l.fetch="hit"),this.#C(p),s&&this.#v(p),l&&this.#F(l,p),S;let T=this.#I(t,p,y,d),E=T.__staleWhileFetching!==void 0&&i;return l&&(l.fetch=v?"stale":"refresh",E&&v&&(l.returnedStale=true)),E?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.#W;if(!i)throw new Error("no memoMethod provided to constructor");let{context:s,forceRefresh:n,...r}=e,a=this.get(t,r);if(!n&&a!==void 0)return a;let o=i(t,a,{options:r,context:s});return this.set(t,o,r),o}get(t,e={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:r}=e,a=this.#s.get(t);if(a!==void 0){let o=this.#t[a],g=this.#e(o);return r&&this.#F(r,a),this.#g(a)?(r&&(r.get="stale"),g?(r&&i&&o.__staleWhileFetching!==void 0&&(r.returnedStale=true),i?o.__staleWhileFetching:void 0):(n||this.#E(t,"expire"),r&&i&&(r.returnedStale=true),i?o:void 0)):(r&&(r.get="hit"),g?o.__staleWhileFetching:(this.#C(a),s&&this.#v(a),o))}else r&&(r.get="miss");}#j(t,e){this.#u[e]=t,this.#l[t]=e;}#C(t){t!==this.#r&&(t===this.#o?this.#o=this.#l[t]:this.#j(this.#u[t],this.#l[t]),this.#j(this.#r,t),this.#r=t);}delete(t){return this.#E(t,"delete")}#E(t,e){let i=false;if(this.#n!==0){let s=this.#s.get(t);if(s!==void 0)if(i=true,this.#n===1)this.#P(e);else {this.#x(s);let n=this.#t[s];if(this.#e(n)?n.__abortController.abort(new Error("deleted")):(this.#_||this.#f)&&(this.#_&&this.#p?.(n,t,e),this.#f&&this.#h?.push([n,t,e])),this.#s.delete(t),this.#i[s]=void 0,this.#t[s]=void 0,s===this.#r)this.#r=this.#u[s];else if(s===this.#o)this.#o=this.#l[s];else {let r=this.#u[s];this.#l[r]=this.#l[s];let a=this.#l[s];this.#u[a]=this.#u[s];}this.#n--,this.#w.push(s);}}if(this.#f&&this.#h?.length){let s=this.#h,n;for(;n=s?.shift();)this.#m?.(...n);}return i}clear(){return this.#P("delete")}#P(t){for(let e of this.#T({allowStale:true})){let i=this.#t[e];if(this.#e(i))i.__abortController.abort(new Error("deleted"));else {let s=this.#i[e];this.#_&&this.#p?.(i,s,t),this.#f&&this.#h?.push([i,s,t]);}}if(this.#s.clear(),this.#t.fill(void 0),this.#i.fill(void 0),this.#d&&this.#y&&(this.#d.fill(0),this.#y.fill(0)),this.#b&&this.#b.fill(0),this.#o=0,this.#r=0,this.#w.length=0,this.#S=0,this.#n=0,this.#f&&this.#h){let e=this.#h,i;for(;i=e?.shift();)this.#m?.(...i);}}};var z=class{cache;map=new Map;constructor(t){this.cache=new R({max:t.cacheSize}),this.map=new Map;}get[Symbol.iterator](){return this.map[Symbol.iterator]}get[Symbol.toStringTag](){return this.map[Symbol.toStringTag]}clear(){return this.cache.clear(),this.map.clear()}delete(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}get entries(){return this.map.entries}get keys(){return this.map.keys}get values(){return this.map.values}};var M;(s=>(s.log=(n,...r)=>console.log(`[Pixi\u2019VN] ${n}`,...r),s.warn=(n,...r)=>console.warn(`[Pixi\u2019VN] ${n}`,...r),s.error=(n,...r)=>console.error(`[Pixi\u2019VN] ${n}`,...r),s.info=(n,...r)=>console.info(`[Pixi\u2019VN] ${n}`,...r)))(M||={});function j(h){try{if(typeof h>"u")return h;let t=JSON.stringify(h);return JSON.parse(t)}catch(t){throw M.error("Error creating exportable element",h,t),new Error("[Pixi\u2019VN] Error creating exportable element")}}var I=class h{static storage=new z({cacheSize:20});static startingStorage=[];static flags=Array();static tempStorage=new Map;static tempStorageDeadlines=new Map;constructor(){}static clearOldTempVariables(t){h.tempStorageDeadlines.forEach((e,i)=>{e>t&&(h.tempStorage.delete(i),h.tempStorageDeadlines.delete(i),h.storage.cache.delete(i));});}static setVariable(t,e){let i=h.tempStorage.has(t);e==null?(h.storage.map.delete(t),!i&&h.storage.cache.delete(t)):(h.storage.map.set(t,e),!i&&h.storage.cache.set(t,e));}static getVariable(t){let e=h.storage.cache.get(t);return e===void 0&&(e=h.tempStorage.get(t)),e===void 0&&(e=h.storage.map.get(t)),j(e)}static removeVariable(t){h.storage.delete(t);}static setFlag(t,e){if(e)this.flags.includes(t)||this.flags.push(t);else {let i=this.flags.indexOf(t);i>-1&&this.flags.splice(i,1);}}static getFlag(t){return this.flags.includes(t)}};export{I as default};
1
+ var F=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,N=new Set,D=typeof process=="object"&&process?process:{},V=(h,t,e,i)=>{typeof D.emitWarning=="function"?D.emitWarning(h,t,e,i):console.error(`[${e}] ${t}: ${h}`);},C=globalThis.AbortController,U=globalThis.AbortSignal;if(typeof C>"u"){U=class{onabort;_onabort=[];reason;aborted=false;addEventListener(i,s){this._onabort.push(s);}},C=class{constructor(){t();}signal=new U;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=D.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",t=()=>{h&&(h=false,V("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 P=h=>!N.has(h),_=h=>h&&h===Math.floor(h)&&h>0&&isFinite(h),G=h=>_(h)?h<=Math.pow(2,8)?Uint8Array:h<=Math.pow(2,16)?Uint16Array:h<=Math.pow(2,32)?Uint32Array:h<=Number.MAX_SAFE_INTEGER?O:null:null,O=class extends Array{constructor(t){super(t),this.fill(0);}},L=class h{heap;length;static#a=false;static create(t){let e=G(t);if(!e)return [];h.#a=true;let i=new h(t,e);return h.#a=false,i}constructor(t,e){if(!h.#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]}},R=class h{#a;#c;#p;#z;#m;#R;#W;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#n;#S;#s;#i;#t;#l;#u;#o;#r;#w;#h;#b;#y;#d;#_;#O;#f;#D;static unsafeExposeInternals(t){return {starts:t.#y,ttls:t.#d,sizes:t.#b,keyMap:t.#s,keyList:t.#i,valList:t.#t,next:t.#l,prev:t.#u,get head(){return t.#o},get tail(){return t.#r},free:t.#w,isBackgroundFetch:e=>t.#e(e),backgroundFetch:(e,i,s,n)=>t.#I(e,i,s,n),moveToTail:e=>t.#C(e),indexes:e=>t.#A(e),rindexes:e=>t.#T(e),isStale:e=>t.#g(e)}}get max(){return this.#a}get maxSize(){return this.#c}get calculatedSize(){return this.#S}get size(){return this.#n}get fetchMethod(){return this.#R}get memoMethod(){return this.#W}get dispose(){return this.#p}get onInsert(){return this.#z}get disposeAfter(){return this.#m}constructor(t){let{max:e=0,ttl:i,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:r,updateAgeOnHas:a,allowStale:o,dispose:g,onInsert:w,disposeAfter:f,noDisposeOnSet:c,noUpdateTTL:u,maxSize:A=0,maxEntrySize:d=0,sizeCalculation:b,fetchMethod:l,memoMethod:m,noDeleteOnFetchRejection:y,noDeleteOnStaleGet:p,allowStaleOnFetchRejection:S,allowStaleOnFetchAbort:v,ignoreFetchAbort:T}=t;if(e!==0&&!_(e))throw new TypeError("max option must be a nonnegative integer");let x=e?G(e):Array;if(!x)throw new Error("invalid max value: "+e);if(this.#a=e,this.#c=A,this.maxEntrySize=d||this.#c,this.sizeCalculation=b,this.sizeCalculation){if(!this.#c&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(m!==void 0&&typeof m!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#W=m,l!==void 0&&typeof l!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#R=l,this.#O=!!l,this.#s=new Map,this.#i=new Array(e).fill(void 0),this.#t=new Array(e).fill(void 0),this.#l=new x(e),this.#u=new x(e),this.#o=0,this.#r=0,this.#w=L.create(e),this.#n=0,this.#S=0,typeof g=="function"&&(this.#p=g),typeof w=="function"&&(this.#z=w),typeof f=="function"?(this.#m=f,this.#h=[]):(this.#m=void 0,this.#h=void 0),this.#_=!!this.#p,this.#D=!!this.#z,this.#f=!!this.#m,this.noDisposeOnSet=!!c,this.noUpdateTTL=!!u,this.noDeleteOnFetchRejection=!!y,this.allowStaleOnFetchRejection=!!S,this.allowStaleOnFetchAbort=!!v,this.ignoreFetchAbort=!!T,this.maxEntrySize!==0){if(this.#c!==0&&!_(this.#c))throw new TypeError("maxSize must be a positive integer if specified");if(!_(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#H();}if(this.allowStale=!!o,this.noDeleteOnStaleGet=!!p,this.updateAgeOnGet=!!r,this.updateAgeOnHas=!!a,this.ttlResolution=_(s)||s===0?s:1,this.ttlAutopurge=!!n,this.ttl=i||0,this.ttl){if(!_(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#U();}if(this.#a===0&&this.ttl===0&&this.#c===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#a&&!this.#c){let E="LRU_CACHE_UNBOUNDED";P(E)&&(N.add(E),V("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",E,h));}}getRemainingTTL(t){return this.#s.has(t)?1/0:0}#U(){let t=new O(this.#a),e=new O(this.#a);this.#d=t,this.#y=e,this.#N=(n,r,a=F.now())=>{if(e[n]=r!==0?a:0,t[n]=r,r!==0&&this.ttlAutopurge){let o=setTimeout(()=>{this.#g(n)&&this.#E(this.#i[n],"expire");},r+1);o.unref&&o.unref();}},this.#v=n=>{e[n]=t[n]!==0?F.now():0;},this.#F=(n,r)=>{if(t[r]){let a=t[r],o=e[r];if(!a||!o)return;n.ttl=a,n.start=o,n.now=i||s();let g=n.now-o;n.remainingTTL=a-g;}};let i=0,s=()=>{let n=F.now();if(this.ttlResolution>0){i=n;let r=setTimeout(()=>i=0,this.ttlResolution);r.unref&&r.unref();}return n};this.getRemainingTTL=n=>{let r=this.#s.get(n);if(r===void 0)return 0;let a=t[r],o=e[r];if(!a||!o)return 1/0;let g=(i||s())-o;return a-g},this.#g=n=>{let r=e[n],a=t[n];return !!a&&!!r&&(i||s())-r>a};}#v=()=>{};#F=()=>{};#N=()=>{};#g=()=>false;#H(){let t=new O(this.#a);this.#S=0,this.#b=t,this.#x=e=>{this.#S-=t[e],t[e]=0;},this.#V=(e,i,s,n)=>{if(this.#e(i))return 0;if(!_(s))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(s=n(i,e),!_(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return s},this.#L=(e,i,s)=>{if(t[e]=i,this.#c){let n=this.#c-t[e];for(;this.#S>n;)this.#M(true);}this.#S+=t[e],s&&(s.entrySize=i,s.totalCalculatedSize=this.#S);};}#x=t=>{};#L=(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};*#A({allowStale:t=this.allowStale}={}){if(this.#n)for(let e=this.#r;!(!this.#G(e)||((t||!this.#g(e))&&(yield e),e===this.#o));)e=this.#u[e];}*#T({allowStale:t=this.allowStale}={}){if(this.#n)for(let e=this.#o;!(!this.#G(e)||((t||!this.#g(e))&&(yield e),e===this.#r));)e=this.#l[e];}#G(t){return t!==void 0&&this.#s.get(this.#i[t])===t}*entries(){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]]);}*rentries(){for(let t of this.#T())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.#A()){let e=this.#i[t];e!==void 0&&!this.#e(this.#t[t])&&(yield e);}}*rkeys(){for(let t of this.#T()){let e=this.#i[t];e!==void 0&&!this.#e(this.#t[t])&&(yield e);}}*values(){for(let t of this.#A())this.#t[t]!==void 0&&!this.#e(this.#t[t])&&(yield this.#t[t]);}*rvalues(){for(let t of this.#T())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.#A()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;if(n!==void 0&&t(n,this.#i[i],this))return this.get(this.#i[i],e)}}forEach(t,e=this){for(let i of this.#A()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;n!==void 0&&t.call(e,n,this.#i[i],this);}}rforEach(t,e=this){for(let i of this.#T()){let s=this.#t[i],n=this.#e(s)?s.__staleWhileFetching:s;n!==void 0&&t.call(e,n,this.#i[i],this);}}purgeStale(){let t=false;for(let e of this.#T({allowStale:true}))this.#g(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 n={value:s};if(this.#d&&this.#y){let r=this.#d[e],a=this.#y[e];if(r&&a){let o=r-(F.now()-a);n.ttl=o,n.start=Date.now();}}return this.#b&&(n.size=this.#b[e]),n}dump(){let t=[];for(let e of this.#A({allowStale:true})){let i=this.#i[e],s=this.#t[e],n=this.#e(s)?s.__staleWhileFetching:s;if(n===void 0||i===void 0)continue;let r={value:n};if(this.#d&&this.#y){r.ttl=this.#d[e];let a=F.now()-this.#y[e];r.start=Math.floor(Date.now()-a);}this.#b&&(r.size=this.#b[e]),t.unshift([i,r]);}return t}load(t){this.clear();for(let[e,i]of t){if(i.start){let s=Date.now()-i.start;i.start=F.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:n,noDisposeOnSet:r=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:o}=i,{noUpdateTTL:g=this.noUpdateTTL}=i,w=this.#V(t,e,i.size||0,a);if(this.maxEntrySize&&w>this.maxEntrySize)return o&&(o.set="miss",o.maxEntrySizeExceeded=true),this.#E(t,"set"),this;let f=this.#n===0?void 0:this.#s.get(t);if(f===void 0)f=this.#n===0?this.#r:this.#w.length!==0?this.#w.pop():this.#n===this.#a?this.#M(false):this.#n,this.#i[f]=t,this.#t[f]=e,this.#s.set(t,f),this.#l[this.#r]=f,this.#u[f]=this.#r,this.#r=f,this.#n++,this.#L(f,w,o),o&&(o.set="add"),g=false,this.#D&&this.#z?.(e,t,"add");else {this.#C(f);let c=this.#t[f];if(e!==c){if(this.#O&&this.#e(c)){c.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:u}=c;u!==void 0&&!r&&(this.#_&&this.#p?.(u,t,"set"),this.#f&&this.#h?.push([u,t,"set"]));}else r||(this.#_&&this.#p?.(c,t,"set"),this.#f&&this.#h?.push([c,t,"set"]));if(this.#x(f),this.#L(f,w,o),this.#t[f]=e,o){o.set="replace";let u=c&&this.#e(c)?c.__staleWhileFetching:c;u!==void 0&&(o.oldValue=u);}}else o&&(o.set="update");this.#D&&this.onInsert?.(e,t,e===c?"update":"replace");}if(s!==0&&!this.#d&&this.#U(),this.#d&&(g||this.#N(f,s,n),o&&this.#F(o,f)),!r&&this.#f&&this.#h){let c=this.#h,u;for(;u=c?.shift();)this.#m?.(...u);}return this}pop(){try{for(;this.#n;){let t=this.#t[this.#o];if(this.#M(!0),this.#e(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(this.#f&&this.#h){let t=this.#h,e;for(;e=t?.shift();)this.#m?.(...e);}}}#M(t){let e=this.#o,i=this.#i[e],s=this.#t[e];return this.#O&&this.#e(s)?s.__abortController.abort(new Error("evicted")):(this.#_||this.#f)&&(this.#_&&this.#p?.(s,i,"evict"),this.#f&&this.#h?.push([s,i,"evict"])),this.#x(e),t&&(this.#i[e]=void 0,this.#t[e]=void 0,this.#w.push(e)),this.#n===1?(this.#o=this.#r=0,this.#w.length=0):this.#o=this.#l[e],this.#s.delete(i),this.#n--,e}has(t,e={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=e,n=this.#s.get(t);if(n!==void 0){let r=this.#t[n];if(this.#e(r)&&r.__staleWhileFetching===void 0)return false;if(this.#g(n))s&&(s.has="stale",this.#F(s,n));else return i&&this.#v(n),s&&(s.has="hit",this.#F(s,n)),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.#g(s))return;let n=this.#t[s];return this.#e(n)?n.__staleWhileFetching:n}#I(t,e,i,s){let n=e===void 0?void 0:this.#t[e];if(this.#e(n))return n;let r=new C,{signal:a}=i;a?.addEventListener("abort",()=>r.abort(a.reason),{signal:r.signal});let o={signal:r.signal,options:i,context:s},g=(d,b=false)=>{let{aborted:l}=r.signal,m=i.ignoreFetchAbort&&d!==void 0;if(i.status&&(l&&!b?(i.status.fetchAborted=true,i.status.fetchError=r.signal.reason,m&&(i.status.fetchAbortIgnored=true)):i.status.fetchResolved=true),l&&!m&&!b)return f(r.signal.reason);let y=u;return this.#t[e]===u&&(d===void 0?y.__staleWhileFetching?this.#t[e]=y.__staleWhileFetching:this.#E(t,"fetch"):(i.status&&(i.status.fetchUpdated=true),this.set(t,d,o.options))),d},w=d=>(i.status&&(i.status.fetchRejected=true,i.status.fetchError=d),f(d)),f=d=>{let{aborted:b}=r.signal,l=b&&i.allowStaleOnFetchAbort,m=l||i.allowStaleOnFetchRejection,y=m||i.noDeleteOnFetchRejection,p=u;if(this.#t[e]===u&&(!y||p.__staleWhileFetching===void 0?this.#E(t,"fetch"):l||(this.#t[e]=p.__staleWhileFetching)),m)return i.status&&p.__staleWhileFetching!==void 0&&(i.status.returnedStale=true),p.__staleWhileFetching;if(p.__returned===p)throw d},c=(d,b)=>{let l=this.#R?.(t,n,o);l&&l instanceof Promise&&l.then(m=>d(m===void 0?void 0:m),b),r.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(d(void 0),i.allowStaleOnFetchAbort&&(d=m=>g(m,true)));});};i.status&&(i.status.fetchDispatched=true);let u=new Promise(c).then(g,w),A=Object.assign(u,{__abortController:r,__staleWhileFetching:n,__returned:void 0});return e===void 0?(this.set(t,A,{...o.options,status:void 0}),e=this.#s.get(t)):this.#t[e]=A,A}#e(t){if(!this.#O)return false;let e=t;return !!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof C}async fetch(t,e={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:r=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:o=0,sizeCalculation:g=this.sizeCalculation,noUpdateTTL:w=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:c=this.allowStaleOnFetchRejection,ignoreFetchAbort:u=this.ignoreFetchAbort,allowStaleOnFetchAbort:A=this.allowStaleOnFetchAbort,context:d,forceRefresh:b=false,status:l,signal:m}=e;if(!this.#O)return l&&(l.fetch="get"),this.get(t,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:l});let y={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:r,noDisposeOnSet:a,size:o,sizeCalculation:g,noUpdateTTL:w,noDeleteOnFetchRejection:f,allowStaleOnFetchRejection:c,allowStaleOnFetchAbort:A,ignoreFetchAbort:u,status:l,signal:m},p=this.#s.get(t);if(p===void 0){l&&(l.fetch="miss");let S=this.#I(t,p,y,d);return S.__returned=S}else {let S=this.#t[p];if(this.#e(S)){let W=i&&S.__staleWhileFetching!==void 0;return l&&(l.fetch="inflight",W&&(l.returnedStale=true)),W?S.__staleWhileFetching:S.__returned=S}let v=this.#g(p);if(!b&&!v)return l&&(l.fetch="hit"),this.#C(p),s&&this.#v(p),l&&this.#F(l,p),S;let T=this.#I(t,p,y,d),E=T.__staleWhileFetching!==void 0&&i;return l&&(l.fetch=v?"stale":"refresh",E&&v&&(l.returnedStale=true)),E?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.#W;if(!i)throw new Error("no memoMethod provided to constructor");let{context:s,forceRefresh:n,...r}=e,a=this.get(t,r);if(!n&&a!==void 0)return a;let o=i(t,a,{options:r,context:s});return this.set(t,o,r),o}get(t,e={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:r}=e,a=this.#s.get(t);if(a!==void 0){let o=this.#t[a],g=this.#e(o);return r&&this.#F(r,a),this.#g(a)?(r&&(r.get="stale"),g?(r&&i&&o.__staleWhileFetching!==void 0&&(r.returnedStale=true),i?o.__staleWhileFetching:void 0):(n||this.#E(t,"expire"),r&&i&&(r.returnedStale=true),i?o:void 0)):(r&&(r.get="hit"),g?o.__staleWhileFetching:(this.#C(a),s&&this.#v(a),o))}else r&&(r.get="miss");}#j(t,e){this.#u[e]=t,this.#l[t]=e;}#C(t){t!==this.#r&&(t===this.#o?this.#o=this.#l[t]:this.#j(this.#u[t],this.#l[t]),this.#j(this.#r,t),this.#r=t);}delete(t){return this.#E(t,"delete")}#E(t,e){let i=false;if(this.#n!==0){let s=this.#s.get(t);if(s!==void 0)if(i=true,this.#n===1)this.#P(e);else {this.#x(s);let n=this.#t[s];if(this.#e(n)?n.__abortController.abort(new Error("deleted")):(this.#_||this.#f)&&(this.#_&&this.#p?.(n,t,e),this.#f&&this.#h?.push([n,t,e])),this.#s.delete(t),this.#i[s]=void 0,this.#t[s]=void 0,s===this.#r)this.#r=this.#u[s];else if(s===this.#o)this.#o=this.#l[s];else {let r=this.#u[s];this.#l[r]=this.#l[s];let a=this.#l[s];this.#u[a]=this.#u[s];}this.#n--,this.#w.push(s);}}if(this.#f&&this.#h?.length){let s=this.#h,n;for(;n=s?.shift();)this.#m?.(...n);}return i}clear(){return this.#P("delete")}#P(t){for(let e of this.#T({allowStale:true})){let i=this.#t[e];if(this.#e(i))i.__abortController.abort(new Error("deleted"));else {let s=this.#i[e];this.#_&&this.#p?.(i,s,t),this.#f&&this.#h?.push([i,s,t]);}}if(this.#s.clear(),this.#t.fill(void 0),this.#i.fill(void 0),this.#d&&this.#y&&(this.#d.fill(0),this.#y.fill(0)),this.#b&&this.#b.fill(0),this.#o=0,this.#r=0,this.#w.length=0,this.#S=0,this.#n=0,this.#f&&this.#h){let e=this.#h,i;for(;i=e?.shift();)this.#m?.(...i);}}};var z=class{cache;map=new Map;constructor(t){this.cache=new R({max:t.cacheSize}),this.map=new Map;}get[Symbol.iterator](){return this.map[Symbol.iterator]}get[Symbol.toStringTag](){return this.map[Symbol.toStringTag]}clear(){return this.cache.clear(),this.map.clear()}delete(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}get entries(){return this.map.entries}keys(){return this.map.keys()}get values(){return this.map.values}};var M;(s=>(s.log=(n,...r)=>console.log(`[Pixi\u2019VN] ${n}`,...r),s.warn=(n,...r)=>console.warn(`[Pixi\u2019VN] ${n}`,...r),s.error=(n,...r)=>console.error(`[Pixi\u2019VN] ${n}`,...r),s.info=(n,...r)=>console.info(`[Pixi\u2019VN] ${n}`,...r)))(M||={});function j(h){try{if(typeof h>"u")return h;let t=JSON.stringify(h);return JSON.parse(t)}catch(t){throw M.error("Error creating exportable element",h,t),new Error("[Pixi\u2019VN] Error creating exportable element")}}var I=class h{static storage=new z({cacheSize:20});static startingStorage=[];static flags=Array();static tempStorage=new Map;static tempStorageDeadlines=new Map;constructor(){}static clearOldTempVariables(t){h.tempStorageDeadlines.forEach((e,i)=>{e>t&&(h.tempStorage.delete(i),h.tempStorageDeadlines.delete(i),h.storage.cache.delete(i));});}static setVariable(t,e){let i=h.tempStorage.has(t);e==null?(h.storage.map.delete(t),!i&&h.storage.cache.delete(t)):(h.storage.map.set(t,e),!i&&h.storage.cache.set(t,e));}static getVariable(t){let e=h.storage.cache.get(t);return e===void 0&&(e=h.tempStorage.get(t)),e===void 0&&(e=h.storage.map.get(t)),j(e)}static removeVariable(t){h.storage.delete(t);}static setFlag(t,e){if(e)this.flags.includes(t)||this.flags.push(t);else {let i=this.flags.indexOf(t);i>-1&&this.flags.splice(i,1);}}static getFlag(t){return this.flags.includes(t)}};export{I as default};