@drincs/pixi-vn 1.8.16 → 1.8.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/canvas.cjs CHANGED
@@ -1,2 +1,2 @@
1
- 'use strict';var core=require('@drincs/pixi-vn/core'),Ee=require('@drincs/pixi-vn/pixi.js'),devtools=require('@pixi/devtools');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var Ee__default=/*#__PURE__*/_interopDefault(Ee);var ki=Object.create;var Ct=Object.defineProperty;var wi=Object.getOwnPropertyDescriptor;var Mi=Object.getOwnPropertyNames;var Oi=Object.getPrototypeOf,Ri=Object.prototype.hasOwnProperty;var jt=t=>{throw TypeError(t)};var Bi=(t,e,i)=>e in t?Ct(t,e,{enumerable:true,configurable:true,writable:true,value:i}):t[e]=i;var bt=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,i)=>(typeof require<"u"?require:e)[i]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var $t=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Di=(t,e,i,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Mi(e))!Ri.call(t,n)&&n!==i&&Ct(t,n,{get:()=>e[n],enumerable:!(r=wi(e,n))||r.enumerable});return t};var Xt=(t,e,i)=>(i=t!=null?ki(Oi(t)):{},Di(Ct(i,"default",{value:t,enumerable:true}),t));var Y=(t,e,i)=>Bi(t,typeof e!="symbol"?e+"":e,i),At=(t,e,i)=>e.has(t)||jt("Cannot "+i);var s=(t,e,i)=>(At(t,e,"read from private field"),i?i.call(t):e.get(t)),M=(t,e,i)=>e.has(t)?jt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),b=(t,e,i,r)=>(At(t,e,"write to private field"),e.set(t,i),i),_=(t,e,i)=>(At(t,e,"access private method"),i);var rt=(t,e,i,r)=>({set _(n){b(t,e,n);},get _(){return s(t,e,r)}});var Zt=$t((st,Jt)=>{(function(t,e){typeof st=="object"?Jt.exports=st=e():typeof define=="function"&&define.amd?define([],e):t.CryptoJS=e();})(st,function(){var t=t||(function(e,i){var r;if(typeof window<"u"&&window.crypto&&(r=window.crypto),typeof self<"u"&&self.crypto&&(r=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(r=globalThis.crypto),!r&&typeof window<"u"&&window.msCrypto&&(r=window.msCrypto),!r&&typeof global<"u"&&global.crypto&&(r=global.crypto),!r&&typeof bt=="function")try{r=bt("crypto");}catch{}var n=function(){if(r){if(typeof r.getRandomValues=="function")try{return r.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof r.randomBytes=="function")try{return r.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},a=Object.create||(function(){function f(){}return function(P){var k;return f.prototype=P,k=new f,f.prototype=null,k}})(),o={},d=o.lib={},h=d.Base=(function(){return {extend:function(f){var P=a(this);return f&&P.mixIn(f),(!P.hasOwnProperty("init")||this.init===P.init)&&(P.init=function(){P.$super.init.apply(this,arguments);}),P.init.prototype=P,P.$super=this,P},create:function(){var f=this.extend();return f.init.apply(f,arguments),f},init:function(){},mixIn:function(f){for(var P in f)f.hasOwnProperty(P)&&(this[P]=f[P]);f.hasOwnProperty("toString")&&(this.toString=f.toString);},clone:function(){return this.init.prototype.extend(this)}}})(),c=d.WordArray=h.extend({init:function(f,P){f=this.words=f||[],P!=i?this.sigBytes=P:this.sigBytes=f.length*4;},toString:function(f){return (f||p).stringify(this)},concat:function(f){var P=this.words,k=f.words,E=this.sigBytes,w=f.sigBytes;if(this.clamp(),E%4)for(var D=0;D<w;D++){var ue=k[D>>>2]>>>24-D%4*8&255;P[E+D>>>2]|=ue<<24-(E+D)%4*8;}else for(var V=0;V<w;V+=4)P[E+V>>>2]=k[V>>>2];return this.sigBytes+=w,this},clamp:function(){var f=this.words,P=this.sigBytes;f[P>>>2]&=4294967295<<32-P%4*8,f.length=e.ceil(P/4);},clone:function(){var f=h.clone.call(this);return f.words=this.words.slice(0),f},random:function(f){for(var P=[],k=0;k<f;k+=4)P.push(n());return new c.init(P,f)}}),l=o.enc={},p=l.Hex={stringify:function(f){for(var P=f.words,k=f.sigBytes,E=[],w=0;w<k;w++){var D=P[w>>>2]>>>24-w%4*8&255;E.push((D>>>4).toString(16)),E.push((D&15).toString(16));}return E.join("")},parse:function(f){for(var P=f.length,k=[],E=0;E<P;E+=2)k[E>>>3]|=parseInt(f.substr(E,2),16)<<24-E%8*4;return new c.init(k,P/2)}},u=l.Latin1={stringify:function(f){for(var P=f.words,k=f.sigBytes,E=[],w=0;w<k;w++){var D=P[w>>>2]>>>24-w%4*8&255;E.push(String.fromCharCode(D));}return E.join("")},parse:function(f){for(var P=f.length,k=[],E=0;E<P;E++)k[E>>>2]|=(f.charCodeAt(E)&255)<<24-E%4*8;return new c.init(k,P)}},m=l.Utf8={stringify:function(f){try{return decodeURIComponent(escape(u.stringify(f)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(f){return u.parse(unescape(encodeURIComponent(f)))}},T=d.BufferedBlockAlgorithm=h.extend({reset:function(){this._data=new c.init,this._nDataBytes=0;},_append:function(f){typeof f=="string"&&(f=m.parse(f)),this._data.concat(f),this._nDataBytes+=f.sigBytes;},_process:function(f){var P,k=this._data,E=k.words,w=k.sigBytes,D=this.blockSize,ue=D*4,V=w/ue;f?V=e.ceil(V):V=e.max((V|0)-this._minBufferSize,0);var ie=V*D,Be=e.min(ie*4,w);if(ie){for(var _t=0;_t<ie;_t+=D)this._doProcessBlock(E,_t);P=E.splice(0,ie),k.sigBytes-=Be;}return new c.init(P,Be)},clone:function(){var f=h.clone.call(this);return f._data=this._data.clone(),f},_minBufferSize:0});d.Hasher=T.extend({cfg:h.extend(),init:function(f){this.cfg=this.cfg.extend(f),this.reset();},reset:function(){T.reset.call(this),this._doReset();},update:function(f){return this._append(f),this._process(),this},finalize:function(f){f&&this._append(f);var P=this._doFinalize();return P},blockSize:512/32,_createHelper:function(f){return function(P,k){return new f.init(k).finalize(P)}},_createHmacHelper:function(f){return function(P,k){return new C.HMAC.init(f,k).finalize(P)}}});var C=o.algo={};return o})(Math);return t});});var Et=$t((ot,Qt)=>{(function(t,e){typeof ot=="object"?Qt.exports=ot=e(Zt()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS);})(ot,function(t){return (function(){var e=t,i=e.lib,r=i.WordArray,n=i.Hasher,a=e.algo,o=[],d=a.SHA1=n.extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878,3285377520]);},_doProcessBlock:function(h,c){for(var l=this._hash.words,p=l[0],u=l[1],m=l[2],T=l[3],S=l[4],C=0;C<80;C++){if(C<16)o[C]=h[c+C]|0;else {var f=o[C-3]^o[C-8]^o[C-14]^o[C-16];o[C]=f<<1|f>>>31;}var P=(p<<5|p>>>27)+S+o[C];C<20?P+=(u&m|~u&T)+1518500249:C<40?P+=(u^m^T)+1859775393:C<60?P+=(u&m|u&T|m&T)-1894007588:P+=(u^m^T)-899497514,S=T,T=m,m=u<<30|u>>>2,u=p,p=P;}l[0]=l[0]+p|0,l[1]=l[1]+u|0,l[2]=l[2]+m|0,l[3]=l[3]+T|0,l[4]=l[4]+S|0;},_doFinalize:function(){var h=this._data,c=h.words,l=this._nDataBytes*8,p=h.sigBytes*8;return c[p>>>5]|=128<<24-p%32,c[(p+64>>>9<<4)+14]=Math.floor(l/4294967296),c[(p+64>>>9<<4)+15]=l,h.sigBytes=c.length*4,this._process(),this._hash},clone:function(){var h=n.clone.call(this);return h._hash=this._hash.clone(),h}});e.SHA1=n._createHelper(d),e.HmacSHA1=n._createHmacHelper(d);})(),t.SHA1});});var Li={extension:{type:"sceneProperties",name:"additional-positions"},testNode(t){return "xAlign"in t||"yAlign"in t||"percentageX"in t||"percentageY"in t||"positionType"in t},testProp(t){switch(t){case "xAlign":case "yAlign":case "percentageX":case "percentageY":case "positionType":return true;default:return false}},setProperty(t,e,i){switch(e){case "xAlign":"xAlign"in t&&(t.xAlign=i/100);break;case "yAlign":"yAlign"in t&&(t.yAlign=i/100);break;case "percentageX":"percentageX"in t&&(t.percentageX=i/100);break;case "percentageY":"percentageY"in t&&(t.percentageY=i/100);break}},getProperties(t){return [{value:t.positionType,prop:"positionType",entry:{section:"Transform",type:"text",label:"Position Type"}},{value:t.xAlign*100,prop:"xAlign",entry:{section:"Transform",type:"range",label:"X Align",tooltip:"0% is left, 100% is right",options:{min:0,max:100}}},{value:t.yAlign*100,prop:"yAlign",entry:{section:"Transform",type:"range",label:"Y Align",tooltip:"0% is top, 100% is bottom",options:{min:0,max:100}}},{value:t.percentageX*100,prop:"percentageX",entry:{section:"Transform",type:"range",label:"X Percentage Position",tooltip:"0% is left, 100% is right",options:{min:0,max:100}}},{value:t.percentageY*100,prop:"percentageY",entry:{section:"Transform",type:"range",label:"Y Percentage Position",tooltip:"0% is top, 100% is bottom",options:{min:0,max:100}}}]}},Kt=Li;var Xe="repeat";var re="__game_layer__",De="Container",nt="ImageContainer",Le="Image",ze="Sprite",He="Text",Ne="Video";var I;(n=>(n.log=(a,...o)=>console.log(`[Pixi\u2019VN] ${a}`,...o),n.warn=(a,...o)=>console.warn(`[Pixi\u2019VN] ${a}`,...o),n.error=(a,...o)=>console.error(`[Pixi\u2019VN] ${a}`,...o),n.info=(a,...o)=>console.info(`[Pixi\u2019VN] ${a}`,...o)))(I||={});function qt(t,e){let i=0;return async(...r)=>{let n=Date.now();if(n-i>=e)return i=n,await t(...r)}}var ii=Xt(Et()),y=class t{constructor(){}static _app=void 0;static get app(){if(!t._app)throw I.error("The canvas is not initialized"),new core.PixiError("invalid_usage","CanvasManagerStatic.app is undefined");return t._app}static get gameLayer(){let e=t.app.stage.getChildByLabel(re);return e||(e=new Ee__default.default.Container,e.label=re,t.app.stage.addChild(e)),e}static htmlLayers=[];static canvasWidth=300;static canvasHeight=300;static _isInitialized=false;static async init(e,i,r){let{id:n="pixi-vn-canvas",width:a=800,height:o=600,resolution:d=1,autoDensity:h=true,resizeMode:c="contain",...l}=i||{};return t.canvasWidth=a,t.canvasHeight=o,t._app=new Ee__default.default.Application,t.app.init({width:a,height:o,resolution:d,autoDensity:h,...l}).then(()=>{let{app:p=t.app,extensions:u=[],...m}=r||{};if(devtools.initDevtools({app:p,extensions:[Kt,...u],...m}),t._isInitialized=true,t.addCanvasIntoHTMLElement(e,n),c==="contain"){let T=qt(async()=>{requestAnimationFrame(()=>t.resize());},10);new ResizeObserver(T).observe(e),t.resize();}t.gameLayer;})}static addCanvasIntoHTMLElement(e,i){t._isInitialized?(e.appendChild(t.app.canvas),t.app.canvas.id=i):I.error("GameWindowManager is not initialized");}static addHtmlLayer(e,i,r={}){let{position:n="absolute",pointerEvents:a="none",userSelect:o="none"}=r,d=document.createElement("div");d.setAttribute("id",e),d.style.position=n,d.style.pointerEvents=a,d.style.userSelect=o;let h=i.appendChild(d);return t.htmlLayers.push(d),t.resize(),h}static removeHtmlLayer(e){let i=t.htmlLayers.find(r=>r.id===e);i&&(i.remove(),t.htmlLayers=t.htmlLayers.filter(r=>r.id!==e));}static getHtmlLayer(e){return t.htmlLayers.find(i=>i.id===e)}static async resize(){let e=t.canvasWidth,i=t.canvasHeight,r=t.app.resizeTo,n=t.app.canvas.style;r instanceof HTMLElement||(r=document.documentElement);let a,o;if(r===document.body||r===document.documentElement)a=document.documentElement.clientWidth||window.innerWidth,o=document.documentElement.clientHeight||window.innerHeight;else {let u=r.getBoundingClientRect();a=u.width||r.clientWidth,o=u.height||r.clientHeight;}let d=Math.min(a/e,o/i),h=Math.floor(d*e),c=Math.floor(d*i);n.width=`${h}px`,n.height=`${c}px`;let l=(a-h)/2,p=(o-c)/2;n.marginLeft=`${l}px`,n.marginRight=`${l}px`,n.marginTop=`${p}px`,n.marginBottom=`${p}px`,t.htmlLayers.forEach(u=>{u.style.width=`${h}px`,u.style.height=`${c}px`,u.style.marginLeft=`${l}px`,u.style.marginRight=`${l}px`,u.style.marginTop=`${p}px`,u.style.marginBottom=`${p}px`;});}static get childrenAliasesOrder(){return t.gameLayer.children.filter(e=>e.label).sort((e,i)=>t.gameLayer.getChildIndex(e)-t.gameLayer.getChildIndex(i)).map(e=>e.label)}static get currentTickersWithoutCreatedBySteps(){return Object.fromEntries(Array.from(t._currentTickers.entries()).filter(([e,i])=>!i.createdByTicketSteps).map(([e,i])=>[e,{id:i.ticker.alias,args:i.ticker.args,canvasElementAliases:i.ticker.canvasElementAliases,priority:i.ticker.priority,duration:i.ticker.duration,paused:i.ticker.paused}]))}static _currentTickers=new Map;static _currentTickersSequence=new Map;static get currentTickersSequence(){return Object.fromEntries(Array.from(t._currentTickersSequence.entries()).map(([e,i])=>[e,Object.fromEntries(i)]))}static _currentTickersTimeouts=new Map;static _tickersToCompleteOnStepEnd={tikersIds:[],stepAlias:[]};static generateTickerId(...e){try{return `${(0,ii.default)(JSON.stringify(e)).toString()}_${Math.random().toString(36).substring(7)}`}catch(i){throw new core.PixiError("not_json_serializable",`Error to generate ticker id: ${i}`)}}static addTickerTimeoutInfo(e,i,r,n){typeof e=="string"&&(e=[e]),t._currentTickersTimeouts.set(r,{aliases:e,ticker:i,canBeDeletedBeforeEnd:n});}static removeTickerTimeoutInfo(e){typeof e!="string"&&(e=e.toString()),t._currentTickersTimeouts.delete(e);}static removeTickerTimeout(e){typeof e!="string"&&(e=e.toString()),clearTimeout(Number(e)),t.removeTickerTimeoutInfo(e);}static removeTickerTimeoutsByAlias(e,i){t._currentTickersTimeouts.forEach((r,n)=>{let a=r.aliases.filter(o=>o!==e);if(a.length===0){let o=r.canBeDeletedBeforeEnd;(!i||o)&&t.removeTickerTimeout(n);}else r.aliases=a;});}};var Hi=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,oi=new Set,kt=typeof process=="object"&&process?process:{},ai=(t,e,i,r)=>{typeof kt.emitWarning=="function"?kt.emitWarning(t,e,i,r):console.error(`[${i}] ${e}: ${t}`);},ht=globalThis.AbortController,ri=globalThis.AbortSignal;if(typeof ht>"u"){ri=class{onabort;_onabort=[];reason;aborted=false;addEventListener(i,r){this._onabort.push(r);}},ht=class{constructor(){e();}signal=new ri;abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=true;for(let r of this.signal._onabort)r(i);this.signal.onabort?.(i);}}};let t=kt.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{t&&(t=false,ai("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 Ni=t=>!oi.has(t);var Te=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),ci=t=>Te(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?at:null:null,at=class extends Array{constructor(t){super(t),this.fill(0);}},fe,We,Wi=(fe=class{heap;length;static create(e){let i=ci(e);if(!i)return [];b(fe,We,true);let r=new fe(e,i);return b(fe,We,false),r}constructor(e,i){if(!s(fe,We))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new i(e),this.length=0;}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}},We=new WeakMap,M(fe,We,false),fe),ni,si,Q,X,ne,_e,se,Fe,Ve,oe,H,ae,L,R,A,j,K,G,N,ce,W,le,he,q,J,de,Ie,$,Ye,v,wt,Ce,me,qe,Z,hi,be,Ue,Je,ve,Pe,Mt,ct,lt,O,Ot,Ke,Se,Rt,Ge,li=(Ge=class{constructor(e){M(this,v);M(this,Q);M(this,X);M(this,ne);M(this,_e);M(this,se);M(this,Fe);M(this,Ve);M(this,oe);Y(this,"ttl");Y(this,"ttlResolution");Y(this,"ttlAutopurge");Y(this,"updateAgeOnGet");Y(this,"updateAgeOnHas");Y(this,"allowStale");Y(this,"noDisposeOnSet");Y(this,"noUpdateTTL");Y(this,"maxEntrySize");Y(this,"sizeCalculation");Y(this,"noDeleteOnFetchRejection");Y(this,"noDeleteOnStaleGet");Y(this,"allowStaleOnFetchAbort");Y(this,"allowStaleOnFetchRejection");Y(this,"ignoreFetchAbort");M(this,H);M(this,ae);M(this,L);M(this,R);M(this,A);M(this,j);M(this,K);M(this,G);M(this,N);M(this,ce);M(this,W);M(this,le);M(this,he);M(this,q);M(this,J);M(this,de);M(this,Ie);M(this,$);M(this,Ye);M(this,Ce,()=>{});M(this,me,()=>{});M(this,qe,()=>{});M(this,Z,()=>false);M(this,be,e=>{});M(this,Ue,(e,i,r)=>{});M(this,Je,(e,i,r,n)=>{if(r||n)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});Y(this,ni,"LRUCache");let{max:i=0,ttl:r,ttlResolution:n=1,ttlAutopurge:a,updateAgeOnGet:o,updateAgeOnHas:d,allowStale:h,dispose:c,onInsert:l,disposeAfter:p,noDisposeOnSet:u,noUpdateTTL:m,maxSize:T=0,maxEntrySize:S=0,sizeCalculation:C,fetchMethod:f,memoMethod:P,noDeleteOnFetchRejection:k,noDeleteOnStaleGet:E,allowStaleOnFetchRejection:w,allowStaleOnFetchAbort:D,ignoreFetchAbort:ue,perf:V}=e;if(V!==void 0&&typeof V?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(b(this,oe,V??Hi),i!==0&&!Te(i))throw new TypeError("max option must be a nonnegative integer");let ie=i?ci(i):Array;if(!ie)throw new Error("invalid max value: "+i);if(b(this,Q,i),b(this,X,T),this.maxEntrySize=S||s(this,X),this.sizeCalculation=C,this.sizeCalculation){if(!s(this,X)&&!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(P!==void 0&&typeof P!="function")throw new TypeError("memoMethod must be a function if defined");if(b(this,Ve,P),f!==void 0&&typeof f!="function")throw new TypeError("fetchMethod must be a function if specified");if(b(this,Fe,f),b(this,Ie,!!f),b(this,L,new Map),b(this,R,new Array(i).fill(void 0)),b(this,A,new Array(i).fill(void 0)),b(this,j,new ie(i)),b(this,K,new ie(i)),b(this,G,0),b(this,N,0),b(this,ce,Wi.create(i)),b(this,H,0),b(this,ae,0),typeof c=="function"&&b(this,ne,c),typeof l=="function"&&b(this,_e,l),typeof p=="function"?(b(this,se,p),b(this,W,[])):(b(this,se,void 0),b(this,W,void 0)),b(this,de,!!s(this,ne)),b(this,Ye,!!s(this,_e)),b(this,$,!!s(this,se)),this.noDisposeOnSet=!!u,this.noUpdateTTL=!!m,this.noDeleteOnFetchRejection=!!k,this.allowStaleOnFetchRejection=!!w,this.allowStaleOnFetchAbort=!!D,this.ignoreFetchAbort=!!ue,this.maxEntrySize!==0){if(s(this,X)!==0&&!Te(s(this,X)))throw new TypeError("maxSize must be a positive integer if specified");if(!Te(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");_(this,v,hi).call(this);}if(this.allowStale=!!h,this.noDeleteOnStaleGet=!!E,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!d,this.ttlResolution=Te(n)||n===0?n:1,this.ttlAutopurge=!!a,this.ttl=r||0,this.ttl){if(!Te(this.ttl))throw new TypeError("ttl must be a positive integer if specified");_(this,v,wt).call(this);}if(s(this,Q)===0&&this.ttl===0&&s(this,X)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!s(this,Q)&&!s(this,X)){let Be="LRU_CACHE_UNBOUNDED";Ni(Be)&&(oi.add(Be),ai("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",Be,Ge));}}get perf(){return s(this,oe)}static unsafeExposeInternals(e){return {starts:s(e,he),ttls:s(e,q),autopurgeTimers:s(e,J),sizes:s(e,le),keyMap:s(e,L),keyList:s(e,R),valList:s(e,A),next:s(e,j),prev:s(e,K),get head(){return s(e,G)},get tail(){return s(e,N)},free:s(e,ce),isBackgroundFetch:i=>{var r;return _(r=e,v,O).call(r,i)},backgroundFetch:(i,r,n,a)=>{var o;return _(o=e,v,lt).call(o,i,r,n,a)},moveToTail:i=>{var r;return _(r=e,v,Ke).call(r,i)},indexes:i=>{var r;return _(r=e,v,ve).call(r,i)},rindexes:i=>{var r;return _(r=e,v,Pe).call(r,i)},isStale:i=>{var r;return s(r=e,Z).call(r,i)}}}get max(){return s(this,Q)}get maxSize(){return s(this,X)}get calculatedSize(){return s(this,ae)}get size(){return s(this,H)}get fetchMethod(){return s(this,Fe)}get memoMethod(){return s(this,Ve)}get dispose(){return s(this,ne)}get onInsert(){return s(this,_e)}get disposeAfter(){return s(this,se)}getRemainingTTL(e){return s(this,L).has(e)?1/0:0}*entries(){for(let e of _(this,v,ve).call(this))s(this,A)[e]!==void 0&&s(this,R)[e]!==void 0&&!_(this,v,O).call(this,s(this,A)[e])&&(yield [s(this,R)[e],s(this,A)[e]]);}*rentries(){for(let e of _(this,v,Pe).call(this))s(this,A)[e]!==void 0&&s(this,R)[e]!==void 0&&!_(this,v,O).call(this,s(this,A)[e])&&(yield [s(this,R)[e],s(this,A)[e]]);}*keys(){for(let e of _(this,v,ve).call(this)){let i=s(this,R)[e];i!==void 0&&!_(this,v,O).call(this,s(this,A)[e])&&(yield i);}}*rkeys(){for(let e of _(this,v,Pe).call(this)){let i=s(this,R)[e];i!==void 0&&!_(this,v,O).call(this,s(this,A)[e])&&(yield i);}}*values(){for(let e of _(this,v,ve).call(this))s(this,A)[e]!==void 0&&!_(this,v,O).call(this,s(this,A)[e])&&(yield s(this,A)[e]);}*rvalues(){for(let e of _(this,v,Pe).call(this))s(this,A)[e]!==void 0&&!_(this,v,O).call(this,s(this,A)[e])&&(yield s(this,A)[e]);}[(si=Symbol.iterator,ni=Symbol.toStringTag,si)](){return this.entries()}find(e,i={}){for(let r of _(this,v,ve).call(this)){let n=s(this,A)[r],a=_(this,v,O).call(this,n)?n.__staleWhileFetching:n;if(a!==void 0&&e(a,s(this,R)[r],this))return this.get(s(this,R)[r],i)}}forEach(e,i=this){for(let r of _(this,v,ve).call(this)){let n=s(this,A)[r],a=_(this,v,O).call(this,n)?n.__staleWhileFetching:n;a!==void 0&&e.call(i,a,s(this,R)[r],this);}}rforEach(e,i=this){for(let r of _(this,v,Pe).call(this)){let n=s(this,A)[r],a=_(this,v,O).call(this,n)?n.__staleWhileFetching:n;a!==void 0&&e.call(i,a,s(this,R)[r],this);}}purgeStale(){let e=false;for(let i of _(this,v,Pe).call(this,{allowStale:true}))s(this,Z).call(this,i)&&(_(this,v,Se).call(this,s(this,R)[i],"expire"),e=true);return e}info(e){let i=s(this,L).get(e);if(i===void 0)return;let r=s(this,A)[i],n=_(this,v,O).call(this,r)?r.__staleWhileFetching:r;if(n===void 0)return;let a={value:n};if(s(this,q)&&s(this,he)){let o=s(this,q)[i],d=s(this,he)[i];if(o&&d){let h=o-(s(this,oe).now()-d);a.ttl=h,a.start=Date.now();}}return s(this,le)&&(a.size=s(this,le)[i]),a}dump(){let e=[];for(let i of _(this,v,ve).call(this,{allowStale:true})){let r=s(this,R)[i],n=s(this,A)[i],a=_(this,v,O).call(this,n)?n.__staleWhileFetching:n;if(a===void 0||r===void 0)continue;let o={value:a};if(s(this,q)&&s(this,he)){o.ttl=s(this,q)[i];let d=s(this,oe).now()-s(this,he)[i];o.start=Math.floor(Date.now()-d);}s(this,le)&&(o.size=s(this,le)[i]),e.unshift([r,o]);}return e}load(e){this.clear();for(let[i,r]of e){if(r.start){let n=Date.now()-r.start;r.start=s(this,oe).now()-n;}this.set(i,r.value,r);}}set(e,i,r={}){var u,m,T,S;if(i===void 0)return this.delete(e),this;let{ttl:n=this.ttl,start:a,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:d=this.sizeCalculation,status:h}=r,{noUpdateTTL:c=this.noUpdateTTL}=r,l=s(this,Je).call(this,e,i,r.size||0,d);if(this.maxEntrySize&&l>this.maxEntrySize)return h&&(h.set="miss",h.maxEntrySizeExceeded=true),_(this,v,Se).call(this,e,"set"),this;let p=s(this,H)===0?void 0:s(this,L).get(e);if(p===void 0)p=s(this,H)===0?s(this,N):s(this,ce).length!==0?s(this,ce).pop():s(this,H)===s(this,Q)?_(this,v,ct).call(this,false):s(this,H),s(this,R)[p]=e,s(this,A)[p]=i,s(this,L).set(e,p),s(this,j)[s(this,N)]=p,s(this,K)[p]=s(this,N),b(this,N,p),rt(this,H)._++,s(this,Ue).call(this,p,l,h),h&&(h.set="add"),c=false,s(this,Ye)&&((u=s(this,_e))==null||u.call(this,i,e,"add"));else {_(this,v,Ke).call(this,p);let C=s(this,A)[p];if(i!==C){if(s(this,Ie)&&_(this,v,O).call(this,C)){C.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:f}=C;f!==void 0&&!o&&(s(this,de)&&((m=s(this,ne))==null||m.call(this,f,e,"set")),s(this,$)&&s(this,W)?.push([f,e,"set"]));}else o||(s(this,de)&&((T=s(this,ne))==null||T.call(this,C,e,"set")),s(this,$)&&s(this,W)?.push([C,e,"set"]));if(s(this,be).call(this,p),s(this,Ue).call(this,p,l,h),s(this,A)[p]=i,h){h.set="replace";let f=C&&_(this,v,O).call(this,C)?C.__staleWhileFetching:C;f!==void 0&&(h.oldValue=f);}}else h&&(h.set="update");s(this,Ye)&&this.onInsert?.(i,e,i===C?"update":"replace");}if(n!==0&&!s(this,q)&&_(this,v,wt).call(this),s(this,q)&&(c||s(this,qe).call(this,p,n,a),h&&s(this,me).call(this,h,p)),!o&&s(this,$)&&s(this,W)){let C=s(this,W),f;for(;f=C?.shift();)(S=s(this,se))==null||S.call(this,...f);}return this}pop(){var e;try{for(;s(this,H);){let i=s(this,A)[s(this,G)];if(_(this,v,ct).call(this,!0),_(this,v,O).call(this,i)){if(i.__staleWhileFetching)return i.__staleWhileFetching}else if(i!==void 0)return i}}finally{if(s(this,$)&&s(this,W)){let i=s(this,W),r;for(;r=i?.shift();)(e=s(this,se))==null||e.call(this,...r);}}}has(e,i={}){let{updateAgeOnHas:r=this.updateAgeOnHas,status:n}=i,a=s(this,L).get(e);if(a!==void 0){let o=s(this,A)[a];if(_(this,v,O).call(this,o)&&o.__staleWhileFetching===void 0)return false;if(s(this,Z).call(this,a))n&&(n.has="stale",s(this,me).call(this,n,a));else return r&&s(this,Ce).call(this,a),n&&(n.has="hit",s(this,me).call(this,n,a)),true}else n&&(n.has="miss");return false}peek(e,i={}){let{allowStale:r=this.allowStale}=i,n=s(this,L).get(e);if(n===void 0||!r&&s(this,Z).call(this,n))return;let a=s(this,A)[n];return _(this,v,O).call(this,a)?a.__staleWhileFetching:a}async fetch(e,i={}){let{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:a=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:d=this.noDisposeOnSet,size:h=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:p=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:u=this.allowStaleOnFetchRejection,ignoreFetchAbort:m=this.ignoreFetchAbort,allowStaleOnFetchAbort:T=this.allowStaleOnFetchAbort,context:S,forceRefresh:C=false,status:f,signal:P}=i;if(!s(this,Ie))return f&&(f.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:a,status:f});let k={allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:a,ttl:o,noDisposeOnSet:d,size:h,sizeCalculation:c,noUpdateTTL:l,noDeleteOnFetchRejection:p,allowStaleOnFetchRejection:u,allowStaleOnFetchAbort:T,ignoreFetchAbort:m,status:f,signal:P},E=s(this,L).get(e);if(E===void 0){f&&(f.fetch="miss");let w=_(this,v,lt).call(this,e,E,k,S);return w.__returned=w}else {let w=s(this,A)[E];if(_(this,v,O).call(this,w)){let ie=r&&w.__staleWhileFetching!==void 0;return f&&(f.fetch="inflight",ie&&(f.returnedStale=true)),ie?w.__staleWhileFetching:w.__returned=w}let D=s(this,Z).call(this,E);if(!C&&!D)return f&&(f.fetch="hit"),_(this,v,Ke).call(this,E),n&&s(this,Ce).call(this,E),f&&s(this,me).call(this,f,E),w;let ue=_(this,v,lt).call(this,e,E,k,S),V=ue.__staleWhileFetching!==void 0&&r;return f&&(f.fetch=D?"stale":"refresh",V&&D&&(f.returnedStale=true)),V?ue.__staleWhileFetching:ue.__returned=ue}}async forceFetch(e,i={}){let r=await this.fetch(e,i);if(r===void 0)throw new Error("fetch() returned undefined");return r}memo(e,i={}){let r=s(this,Ve);if(!r)throw new Error("no memoMethod provided to constructor");let{context:n,forceRefresh:a,...o}=i,d=this.get(e,o);if(!a&&d!==void 0)return d;let h=r(e,d,{options:o,context:n});return this.set(e,h,o),h}get(e,i={}){let{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:a=this.noDeleteOnStaleGet,status:o}=i,d=s(this,L).get(e);if(d!==void 0){let h=s(this,A)[d],c=_(this,v,O).call(this,h);return o&&s(this,me).call(this,o,d),s(this,Z).call(this,d)?(o&&(o.get="stale"),c?(o&&r&&h.__staleWhileFetching!==void 0&&(o.returnedStale=true),r?h.__staleWhileFetching:void 0):(a||_(this,v,Se).call(this,e,"expire"),o&&r&&(o.returnedStale=true),r?h:void 0)):(o&&(o.get="hit"),c?h.__staleWhileFetching:(_(this,v,Ke).call(this,d),n&&s(this,Ce).call(this,d),h))}else o&&(o.get="miss");}delete(e){return _(this,v,Se).call(this,e,"delete")}clear(){return _(this,v,Rt).call(this,"delete")}},Q=new WeakMap,X=new WeakMap,ne=new WeakMap,_e=new WeakMap,se=new WeakMap,Fe=new WeakMap,Ve=new WeakMap,oe=new WeakMap,H=new WeakMap,ae=new WeakMap,L=new WeakMap,R=new WeakMap,A=new WeakMap,j=new WeakMap,K=new WeakMap,G=new WeakMap,N=new WeakMap,ce=new WeakMap,W=new WeakMap,le=new WeakMap,he=new WeakMap,q=new WeakMap,J=new WeakMap,de=new WeakMap,Ie=new WeakMap,$=new WeakMap,Ye=new WeakMap,v=new WeakSet,wt=function(){let e=new at(s(this,Q)),i=new at(s(this,Q));b(this,q,e),b(this,he,i);let r=this.ttlAutopurge?new Array(s(this,Q)):void 0;b(this,J,r),b(this,qe,(d,h,c=s(this,oe).now())=>{i[d]=h!==0?c:0,e[d]=h,n(d,h);}),b(this,Ce,d=>{i[d]=e[d]!==0?s(this,oe).now():0,n(d,e[d]);});let n=this.ttlAutopurge?(d,h)=>{if(r?.[d]&&(clearTimeout(r[d]),r[d]=void 0),h&&h!==0&&r){let c=setTimeout(()=>{s(this,Z).call(this,d)&&_(this,v,Se).call(this,s(this,R)[d],"expire");},h+1);c.unref&&c.unref(),r[d]=c;}}:()=>{};b(this,me,(d,h)=>{if(e[h]){let c=e[h],l=i[h];if(!c||!l)return;d.ttl=c,d.start=l,d.now=a||o();let p=d.now-l;d.remainingTTL=c-p;}});let a=0,o=()=>{let d=s(this,oe).now();if(this.ttlResolution>0){a=d;let h=setTimeout(()=>a=0,this.ttlResolution);h.unref&&h.unref();}return d};this.getRemainingTTL=d=>{let h=s(this,L).get(d);if(h===void 0)return 0;let c=e[h],l=i[h];if(!c||!l)return 1/0;let p=(a||o())-l;return c-p},b(this,Z,d=>{let h=i[d],c=e[d];return !!c&&!!h&&(a||o())-h>c});},Ce=new WeakMap,me=new WeakMap,qe=new WeakMap,Z=new WeakMap,hi=function(){let e=new at(s(this,Q));b(this,ae,0),b(this,le,e),b(this,be,i=>{b(this,ae,s(this,ae)-e[i]),e[i]=0;}),b(this,Je,(i,r,n,a)=>{if(_(this,v,O).call(this,r))return 0;if(!Te(n))if(a){if(typeof a!="function")throw new TypeError("sizeCalculation must be a function");if(n=a(r,i),!Te(n))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 n}),b(this,Ue,(i,r,n)=>{if(e[i]=r,s(this,X)){let a=s(this,X)-e[i];for(;s(this,ae)>a;)_(this,v,ct).call(this,true);}b(this,ae,s(this,ae)+e[i]),n&&(n.entrySize=r,n.totalCalculatedSize=s(this,ae));});},be=new WeakMap,Ue=new WeakMap,Je=new WeakMap,ve=function*({allowStale:e=this.allowStale}={}){if(s(this,H))for(let i=s(this,N);!(!_(this,v,Mt).call(this,i)||((e||!s(this,Z).call(this,i))&&(yield i),i===s(this,G)));)i=s(this,K)[i];},Pe=function*({allowStale:e=this.allowStale}={}){if(s(this,H))for(let i=s(this,G);!(!_(this,v,Mt).call(this,i)||((e||!s(this,Z).call(this,i))&&(yield i),i===s(this,N)));)i=s(this,j)[i];},Mt=function(e){return e!==void 0&&s(this,L).get(s(this,R)[e])===e},ct=function(e){var a;let i=s(this,G),r=s(this,R)[i],n=s(this,A)[i];return s(this,Ie)&&_(this,v,O).call(this,n)?n.__abortController.abort(new Error("evicted")):(s(this,de)||s(this,$))&&(s(this,de)&&((a=s(this,ne))==null||a.call(this,n,r,"evict")),s(this,$)&&s(this,W)?.push([n,r,"evict"])),s(this,be).call(this,i),s(this,J)?.[i]&&(clearTimeout(s(this,J)[i]),s(this,J)[i]=void 0),e&&(s(this,R)[i]=void 0,s(this,A)[i]=void 0,s(this,ce).push(i)),s(this,H)===1?(b(this,G,b(this,N,0)),s(this,ce).length=0):b(this,G,s(this,j)[i]),s(this,L).delete(r),rt(this,H)._--,i},lt=function(e,i,r,n){let a=i===void 0?void 0:s(this,A)[i];if(_(this,v,O).call(this,a))return a;let o=new ht,{signal:d}=r;d?.addEventListener("abort",()=>o.abort(d.reason),{signal:o.signal});let h={signal:o.signal,options:r,context:n},c=(S,C=false)=>{let{aborted:f}=o.signal,P=r.ignoreFetchAbort&&S!==void 0,k=r.ignoreFetchAbort||!!(r.allowStaleOnFetchAbort&&S!==void 0);if(r.status&&(f&&!C?(r.status.fetchAborted=true,r.status.fetchError=o.signal.reason,P&&(r.status.fetchAbortIgnored=true)):r.status.fetchResolved=true),f&&!P&&!C)return p(o.signal.reason,k);let E=m,w=s(this,A)[i];return (w===m||P&&C&&w===void 0)&&(S===void 0?E.__staleWhileFetching!==void 0?s(this,A)[i]=E.__staleWhileFetching:_(this,v,Se).call(this,e,"fetch"):(r.status&&(r.status.fetchUpdated=true),this.set(e,S,h.options))),S},l=S=>(r.status&&(r.status.fetchRejected=true,r.status.fetchError=S),p(S,false)),p=(S,C)=>{let{aborted:f}=o.signal,P=f&&r.allowStaleOnFetchAbort,k=P||r.allowStaleOnFetchRejection,E=k||r.noDeleteOnFetchRejection,w=m;if(s(this,A)[i]===m&&(!E||!C&&w.__staleWhileFetching===void 0?_(this,v,Se).call(this,e,"fetch"):P||(s(this,A)[i]=w.__staleWhileFetching)),k)return r.status&&w.__staleWhileFetching!==void 0&&(r.status.returnedStale=true),w.__staleWhileFetching;if(w.__returned===w)throw S},u=(S,C)=>{var P;let f=(P=s(this,Fe))==null?void 0:P.call(this,e,a,h);f&&f instanceof Promise&&f.then(k=>S(k===void 0?void 0:k),C),o.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(S(void 0),r.allowStaleOnFetchAbort&&(S=k=>c(k,true)));});};r.status&&(r.status.fetchDispatched=true);let m=new Promise(u).then(c,l),T=Object.assign(m,{__abortController:o,__staleWhileFetching:a,__returned:void 0});return i===void 0?(this.set(e,T,{...h.options,status:void 0}),i=s(this,L).get(e)):s(this,A)[i]=T,T},O=function(e){if(!s(this,Ie))return false;let i=e;return !!i&&i instanceof Promise&&i.hasOwnProperty("__staleWhileFetching")&&i.__abortController instanceof ht},Ot=function(e,i){s(this,K)[i]=e,s(this,j)[e]=i;},Ke=function(e){e!==s(this,N)&&(e===s(this,G)?b(this,G,s(this,j)[e]):_(this,v,Ot).call(this,s(this,K)[e],s(this,j)[e]),_(this,v,Ot).call(this,s(this,N),e),b(this,N,e));},Se=function(e,i){var n,a;let r=false;if(s(this,H)!==0){let o=s(this,L).get(e);if(o!==void 0)if(s(this,J)?.[o]&&(clearTimeout(s(this,J)?.[o]),s(this,J)[o]=void 0),r=true,s(this,H)===1)_(this,v,Rt).call(this,i);else {s(this,be).call(this,o);let d=s(this,A)[o];if(_(this,v,O).call(this,d)?d.__abortController.abort(new Error("deleted")):(s(this,de)||s(this,$))&&(s(this,de)&&((n=s(this,ne))==null||n.call(this,d,e,i)),s(this,$)&&s(this,W)?.push([d,e,i])),s(this,L).delete(e),s(this,R)[o]=void 0,s(this,A)[o]=void 0,o===s(this,N))b(this,N,s(this,K)[o]);else if(o===s(this,G))b(this,G,s(this,j)[o]);else {let h=s(this,K)[o];s(this,j)[h]=s(this,j)[o];let c=s(this,j)[o];s(this,K)[c]=s(this,K)[o];}rt(this,H)._--,s(this,ce).push(o);}}if(s(this,$)&&s(this,W)?.length){let o=s(this,W),d;for(;d=o?.shift();)(a=s(this,se))==null||a.call(this,...d);}return r},Rt=function(e){var i,r;for(let n of _(this,v,Pe).call(this,{allowStale:true})){let a=s(this,A)[n];if(_(this,v,O).call(this,a))a.__abortController.abort(new Error("deleted"));else {let o=s(this,R)[n];s(this,de)&&((i=s(this,ne))==null||i.call(this,a,o,e)),s(this,$)&&s(this,W)?.push([a,o,e]);}}if(s(this,L).clear(),s(this,A).fill(void 0),s(this,R).fill(void 0),s(this,q)&&s(this,he)){s(this,q).fill(0),s(this,he).fill(0);for(let n of s(this,J)??[])n!==void 0&&clearTimeout(n);s(this,J)?.fill(void 0);}if(s(this,le)&&s(this,le).fill(0),b(this,G,0),b(this,N,0),s(this,ce).length=0,b(this,ae,0),b(this,H,0),s(this,$)&&s(this,W)){let n=s(this,W),a;for(;a=n?.shift();)(r=s(this,se))==null||r.call(this,...a);}},Ge);var ee=class{cache;map=new Map;constructor(e){this.cache=new li({max:e.cacheSize}),this.map=new Map;}get[Symbol.iterator](){return this.map[Symbol.iterator]}get[Symbol.toStringTag](){return this.map[Symbol.toStringTag]}clear(){this.cache.clear(),this.map.clear();}delete(e){let i=this.map.delete(e);return i&&this.cache.delete(e),i}get forEach(){return this.map.forEach}get(e){let i=this.cache.get(e);return i||this.map.get(e)}has(e){return this.map.has(e)}set(e,i){return this.map.set(e,i),this.cache.set(e,i),this}get size(){return this.map.size}entries(){return this.map.entries()}keys(){return this.map.keys()}values(){return this.map.values()}};var Bt=Symbol("SerializableEvent"),je=new ee({cacheSize:5});function Fi(t){return (e,i,r)=>{let n=r.value;Dt.add(n,t||`${i}`);}}var Dt;(a=>{function t(o,d){o[Bt]=d,je.get(d)&&I.info(`Event "${d}" already exists, it will be overwritten`),je.set(d,o);}a.add=t;function e(o){try{let d=je.get(o);if(!d){I.error(`Event "${o}" not found, did you forget to register it with the eventDecorator?`);return}return d}catch(d){I.error(`Error while getting Event "${o}"`,d);return}}a.get=e;function i(){return Array.from(je.values())}a.values=i;function r(o){return je.has(o)}a.has=r;function n(){return Array.from(je.keys())}a.keys=n;})(Dt||={});var Lt=Dt;async function di(t,e){if("onEvents"in e)for(let i in e.onEvents){let r=e.onEvents[i],n=Lt.get(r);n&&t.on(i,n);}}function pi(t){let{onEventsHandlers:e={}}=t;return e}function Ae(t,e,i){let r=i[Bt];return r&&typeof r=="string"?(e.onEventsHandlers[t]=r,true):(I.warn(`The event handler for event "${t}" is not registered with the eventDecorator, it will not be saved in the memory and it will not work after loading the game. Please register the event handler with the eventDecorator to avoid this warning. Read more about it here: https://pixi-vn.com/start/canvas-functions#add-a-listener-to-an-event`),false)}var $e=new ee({cacheSize:5}),ui=new ee({cacheSize:2}),fi=new ee({cacheSize:2});function Vi(t={}){return function(e){zt.add(e,t);}}async function te(t,e,i){let r=i?.ignoreScale||false,n=i?.end;"isRenderGroup"in e&&e.isRenderGroup!==void 0&&(t.isRenderGroup=e.isRenderGroup),"blendMode"in e&&e.blendMode!==void 0&&(t.blendMode=e.blendMode),"tint"in e&&e.tint!==void 0&&(t.tint=e.tint),"alpha"in e&&e.alpha!==void 0&&(t.alpha=e.alpha),"angle"in e&&e.angle!==void 0&&(t.angle=e.angle),"renderable"in e&&e.renderable!==void 0&&(t.renderable=e.renderable),"rotation"in e&&e.rotation!==void 0&&(t.rotation=e.rotation),!r&&"scale"in e&&e.scale!==void 0&&(typeof e.scale=="number"?t.scale.set(e.scale,e.scale):t.scale.set(e.scale.x,e.scale.y)),"pivot"in e&&e.pivot!==void 0&&(typeof e.pivot=="number"?t.pivot.set(e.pivot,e.pivot):t.pivot.set(e.pivot.x,e.pivot.y)),"position"in e&&e.position!==void 0&&t.position.set(e.position.x,e.position.y),"skew"in e&&e.skew!==void 0&&t.skew.set(e.skew.x,e.skew.y),"visible"in e&&e.visible!==void 0&&(t.visible=e.visible),"x"in e&&e.x!==void 0&&(t.x=e.x),"y"in e&&e.y!==void 0&&(t.y=e.y),"boundsArea"in e&&e.boundsArea!==void 0&&(t.boundsArea=e.boundsArea),"cursor"in e&&e.cursor!==void 0&&(t.cursor=e.cursor),"eventMode"in e&&e.eventMode!==void 0&&(t.eventMode=e.eventMode),"interactive"in e&&e.interactive!==void 0&&(t.interactive=e.interactive),"interactiveChildren"in e&&e.interactiveChildren!==void 0&&(t.interactiveChildren=e.interactiveChildren),"hitArea"in e&&e.hitArea!==void 0&&(t.hitArea=e.hitArea),di(t,e),"align"in e&&e.align!==void 0&&"align"in t&&(t.align=e.align),"percentagePosition"in e&&e.percentagePosition!==void 0&&"percentagePosition"in t&&(t.percentagePosition=e.percentagePosition),n&&await n(),r||("width"in e&&e.width!==void 0&&(t.width=e.width),"height"in e&&e.height!==void 0&&(t.height=e.height));}var zt;(d=>{function t(h,c={}){let{name:l=h.name,getInstance:p=async(m,T)=>{let S=new m;return await S.setMemory(T),S},copyProperty:u=async(m,T)=>{await m.setMemory(T);}}=c;$e.get(l)&&I.warn(`CanvasElement "${l}" already registered`),h.prototype.pixivnId=l,$e.set(l,h),ui.set(l,p),fi.set(l,u);}d.add=t;function e(h){let c=$e.get(h);if(!c){I.error(`CanvasElement "${h}" not found, did you forget to register it with the canvasComponentDecorator?`);return}return c}d.get=e;async function i(h,c){let l=e(h),p=ui.get(h);if(!l||!p){I.error(`CanvasElement "${h}" not found, did you forget to register it with the canvasComponentDecorator?`);return}try{return await p(l,c)}catch(u){I.error(`Error while getting CanvasElement instance "${h}"`,u);}}d.getInstance=i;async function r(h,c,l){let p=fi.get(h);if(!p){I.error(`CanvasElement "${h}" not found, did you forget to register it with the canvasComponentDecorator?`);return}try{await p(c,l);}catch(u){I.error(`Error while copying properties of CanvasElement "${h}"`,u);}}d.copyProperty=r;function n(){return Array.from($e.values())}d.values=n;function a(h){return $e.has(h)}d.has=a;function o(){return Array.from($e.keys())}d.keys=o;})(zt||={});var U=zt;async function dt(t){let e=await U.getInstance(t.pixivnId,t);if(!e)throw new core.PixiError("unregistered_element",`The element ${t.pixivnId} could not be created`,"canvas",t);return e}function Nt(t){return "memory"in t?t.memory:t instanceof Ee__default.default.Text?Ft(t):t instanceof Ee__default.default.Sprite?Wt(t):ke(t)}function Ui(t){let e=t.parent;return {width:t.width,height:t.height,isRenderGroup:t.isRenderGroup,blendMode:t.blendMode,tint:t.tint,alpha:t.alpha,angle:t.angle,renderable:t.renderable,rotation:t.rotation,scale:{x:t.scale.x,y:t.scale.y},pivot:{x:t.pivot.x,y:t.pivot.y},position:{x:t.position.x,y:t.position.y},skew:{x:t.skew.x,y:t.skew.y},visible:t.visible,x:t.x,y:t.y,boundsArea:t.boundsArea,cursor:t.cursor,eventMode:t.eventMode,interactive:t.interactive,interactiveChildren:t.interactiveChildren,hitArea:t.hitArea,index:e?.getChildIndex(t),parentLabel:e?.label,label:t.label}}function Ht(t,e){return {url:t.source.label,alias:e===t.source.label?void 0:e}}function ke(t,e){let i=Gi(t,De),n=e?.childrenExport||false?t.children.sort((a,o)=>t.getChildIndex(a)-t.getChildIndex(o)).map(a=>Nt(a)):[];return {pixivnId:i,elements:n,onEvents:pi(t),...Ui(t)}}function Wt(t){let e=ke(t),i=e.pixivnId??ze,r="assetsAliases"in t&&Array.isArray(t.assetsAliases)?Ht(t.texture,t.assetsAliases[0]):"textureAlias"in t?Ht(t.texture,t.textureAlias):Ht(t.texture);return {...e,pixivnId:i,textureData:r,anchor:{x:t.anchor.x,y:t.anchor.y},roundPixels:t.roundPixels}}function Ft(t){let e=ke(t),i=e.pixivnId??He;return {...e,pixivnId:i,anchor:{x:t.anchor.x,y:t.anchor.y},text:t.text,resolution:t.resolution,style:Ki(t.style),roundPixels:t.roundPixels}}function Gi(t,e){return Object.hasOwn(t,"pixivnId")?t.pixivnId:e}function pt(t){switch(t.type){case "linear":return {type:"linear",colorStops:t.colorStops,end:{x:t.end.x,y:t.end.y},start:{x:t.start.x,y:t.start.y},textureSpace:t.textureSpace,wrapMode:t.texture.source.wrapMode,textureSize:t.texture.source.width/t.texture.source.height};case "radial":return {type:"radial",colorStops:t.colorStops,textureSpace:t.textureSpace,center:{x:t.center.x,y:t.center.y},innerRadius:t.innerRadius,outerCenter:{x:t.outerCenter.x,y:t.outerCenter.y},outerRadius:t.outerRadius,rotation:t.rotation,scale:t.scale,wrapMode:t.texture.source.wrapMode,textureSize:t.texture.source.width/t.texture.source.height}}}function ji(t){if(t!=null){{if(typeof t=="number")return t;if(typeof t=="string"||Array.isArray(t))return t;if(t instanceof Ee__default.default.FillGradient)return pt(t);if(typeof t=="object"&&"fill"in t&&typeof t.fill!="function"&&t.fill){if(!(t.fill instanceof Ee__default.default.FillPattern))return pt(t.fill)}}I.warn("Unsupported property type for Text.style.fill.",t);}}function $i(t){if(typeof t=="number")return t;if(typeof t=="string")return t;if(Array.isArray(t))return t;if(t instanceof Ee__default.default.Color)return t.toNumber();I.warn("Unsupported color type.",t);}function Xi(t){if(t!=null){{if(typeof t=="number")return t;if(typeof t=="string"||Array.isArray(t))return t;if(t instanceof Ee__default.default.FillGradient)return pt(t);if(typeof t=="object"&&"alignment"in t)return {alignment:t.alignment,alpha:t.alpha,color:$i(t.color),join:t.join,miterLimit:t.miterLimit,width:t.width,cap:t.cap,pixelLine:t.pixelLine,textureSpace:t.textureSpace};if(typeof t=="object"&&"fill"in t&&typeof t.fill!="function"&&t.fill){if(!(t.fill instanceof Ee__default.default.FillPattern))return pt(t.fill)}}I.warn("Unsupported property type for Text.style.stroke.",t);}}function Ki(t){return {align:t.align,breakWords:t.breakWords,dropShadow:t.dropShadow,fill:ji(t.fill),fontFamily:t.fontFamily,fontSize:t.fontSize,fontStyle:t.fontStyle,fontVariant:t.fontVariant,fontWeight:t.fontWeight,leading:t.leading,letterSpacing:t.letterSpacing,lineHeight:t.lineHeight,padding:t.padding,stroke:Xi(t.stroke),textBaseline:t.textBaseline,trim:t.trim,whiteSpace:t.whiteSpace,wordWrap:t.wordWrap,wordWrapWidth:t.wordWrapWidth}}var gi=Xt(Et());var ut=class{constructor(e,i){this.alias=this.constructor.prototype.id;let{duration:r,priority:n,id:a=this.generateTickerId(this.alias,i),canvasElementAliases:o=[]}=i||{};this.args=e,this.duration=r,this.priority=n,this.id=a,this.canvasElementAliases=o;}alias;id;args;duration;priority;ticker=new Ee__default.default.Ticker;canvasElementAliases=[];generateTickerId(...e){try{return (0,gi.default)(JSON.stringify(e)).toString()+"_"+Math.random().toString(36).substring(7)}catch(i){throw new core.PixiError("not_json_serializable",`Error to generate ticker id: ${i}`)}}fnValue;complete(e){this.stop();}stop(){let e=this.fnValue;if(!e){I.warn("TickerBase.stop() called without fnValue set. This may cause issues.");return}this.ticker.remove(e,null);}start(){let e=this.id,i=()=>this.fn(this.ticker,this.args,this.canvasElementAliases,e);this.fnValue=i,this.ticker.add(i,null,this.priority),this.ticker.start();}pause(){this.ticker.stop();}play(){this.ticker.start();}get paused(){return !this.ticker.started}};var we=new ee({cacheSize:5});function Zi(t){return function(e){Vt.add(e,t);}}var Vt;(o=>{function t(d,h){h||(h=d.name),we.get(h)&&I.info(`Ticker "${h}" already exists, it will be overwritten`),d.prototype.id=h,we.set(h,d);}o.add=t;function e(d){try{let h=we.get(d);if(!h){I.error(`Event "${d}" not found, did you forget to register it with the tickerDecorator?`);return}return h}catch(h){I.error(`Error while getting Event "${d}"`,h);return}}o.get=e;function i(d,h,c){try{let l=we.get(d);if(!l){I.error(`Ticker "${d}" not found, did you forget to register it with the tickerDecorator?`);return}return new l(h,c)}catch(l){I.error(`Error while getting Ticker "${d}"`,l);return}}o.getInstance=i;function r(){return Array.from(we.values())}o.values=r;function n(d){return we.has(d)}o.has=n;function a(){return Array.from(we.keys())}o.keys=a;})(Vt||={});var Me=Vt;var yi="aliasToRemoveAfter";function ge(t){try{if(typeof t>"u")return t;let e=JSON.stringify(t);return JSON.parse(e)}catch(e){throw I.error("Error creating exportable element",t,e),new core.PixiError("not_json_serializable","Error creating exportable element")}}var Ze=class{tickersPausedByGameLayerRender=[];get app(){return y.app}get gameLayer(){return y.gameLayer}get isInitialized(){return y._isInitialized}get width(){return y.canvasWidth}get height(){return y.canvasHeight}set width(e){y.canvasWidth=e;}set height(e){y.canvasHeight=e;}get screen(){return this.app.screen}async init(e,i,r){return await y.init(e,i,r)}get children(){return y.gameLayer.children}async copyCanvasElementProperty(e,i,r={}){let n=["isRenderGroup","scale","visible","boundsArea","text","resolution","style","height","width"],{ignoreProperties:a=h=>h}=r;if(typeof i=="string"){let h=this.find(i);if(h)i=h;else {I.error(`Canvas element ${i} not found`);return}}if(typeof e=="string"){let h=this.find(e);if(h)e=h;else {I.error(`Canvas element ${e} not found`);return}}e instanceof Ee__default.default.Container&&(e=e.memory);let o=a(n),d={...e};o.forEach(h=>{h in d&&delete d[h];}),await U.copyProperty(i.pixivnId,i,d);}add(e,i,r={}){if(e===re){I.error(`The alias ${re} is reserved`);return}let n=this.find(e),a=r?.ignoreOldStyle;n&&!a&&this.copyCanvasElementProperty(n,i);let{zIndex:o=n?.parent?.getChildIndex(n)}=r;n&&!this.canvasElementIsOnCanvas(n)?I.error(`The canvas element ${e} exist in the memory but it is not on the canvas, so the zIndex is not set`):n&&this.remove(e,{ignoreTickers:true}),o!==void 0?(i.label=e,this.gameLayer.addChildAt(i,o)):(i.label=e,this.gameLayer.addChild(i));}remove(e,i={}){if(e===re){I.error(`The alias ${re} is reserved`);return}let r=i.ignoreTickers;typeof e=="string"&&(e=[e]),e.forEach(n=>{this.gameLayer.getChildrenByLabel(n).forEach(a=>{this.gameLayer.removeChild(a),!r&&this.unlinkComponentFromTicker(n);});});}find(e){if(e===re)return this.gameLayer;let i=this.gameLayer.getChildByLabel(e);if(i)return i}canvasElementIsOnCanvas(e){return this.gameLayer.children.includes(e)}removeAll(){this.gameLayer.removeChildren();}editAlias(e,i,r={}){let n=this.find(e);n&&(n.label=i),!r.ignoreTickers&&this.transferTickers(e,i,"move");}get currentTickers(){return y._currentTickers}get currentTickersSteps(){return y._currentTickersSequence}findTicker(e){let i=y._currentTickers.get(e);if(i)return i.ticker}addTicker(e,i){let r=i.id,n=i.alias;if(typeof e=="string"&&(e=[e]),i.canvasElementAliases=e,!Me.has(n)){I.error(`Ticker ${n} not found`);return}let a={ticker:i};if(y._currentTickers.set(r,a),a.ticker.start(),i.duration){let o=setTimeout(()=>{y.removeTickerTimeoutInfo(o),y._currentTickersTimeouts.get(o.toString())&&a.ticker.complete({ignoreTickerSteps:true});},i.duration*1e3);y.addTickerTimeoutInfo(e,n,o.toString(),true);}return r}addTickersSequence(e,i,r=0){if(i.length===0){I.warn("The steps of the tickers is empty");return}y._currentTickersSequence.has(e)||y._currentTickersSequence.set(e,new Map);let n={currentStepNumber:r,steps:i.map(o=>o===Xe||Object.hasOwn(o,"type")&&o.type==="pause"?o:{ticker:o.alias,args:ge(o.args),duration:o.duration})},a=y.generateTickerId(n);return y._currentTickersSequence.get(e)?.set(a,n),this.runTickersSequence(e,a),a}runTickersSequence(e,i){let r=y._currentTickersSequence.get(e);if(!r?.has(i))return;let n=r.get(i).steps[r.get(i).currentStepNumber];if(n===Xe&&(n=r.get(i).steps[0],r.get(i).currentStepNumber=0,n===Xe)){I.error("TikersSteps has a RepeatType in the first step");return}if(Object.hasOwn(n,"type")&&n.type==="pause"){let c=setTimeout(()=>{let l=y._currentTickersTimeouts.get(c.toString());l&&l.aliases.forEach(p=>{this.nextTickerStep(p,i);}),y.removeTickerTimeoutInfo(c);},n.duration*1e3);y.addTickerTimeoutInfo(e,"steps",c.toString(),false);return}let a=Me.getInstance(n.ticker,n.args,{canvasElementAliases:[e],duration:n.duration,priority:n.priority});if(!a){I.error(`Ticker ${n.ticker} not found`);return}let o=a.alias,d=a.id;a.canvasElementAliases=[e];let h={createdByTicketSteps:{canvasElementAlias:e,id:i},ticker:a};if(y._currentTickers.set(d,h),h.ticker.start(),a.duration){let c=setTimeout(()=>{let l=y._currentTickersTimeouts.get(c.toString());l&&(h.ticker.complete({ignoreTickerSteps:true}),l.aliases.forEach(p=>{this.nextTickerStep(p,i);})),y.removeTickerTimeoutInfo(c);},a.duration*1e3);y.addTickerTimeoutInfo(e,o,c.toString(),false);}}nextTickerStep(e,i){let r=y._currentTickersSequence.get(e);if(r?.has(i)){let n=r.get(i);n.currentStepNumber+1<n.steps.length?(n.currentStepNumber++,r.set(i,n),this.runTickersSequence(e,i)):i&&r.has(i)&&(r.delete(i),y._currentTickers.forEach((a,o)=>{a.createdByTicketSteps?.canvasElementAlias===e&&a.createdByTicketSteps.id===i&&this.removeTicker(o);}));}}onTickerComplete(e,i){let{stopTicker:r=true,aliasToRemoveAfter:n,tickerAliasToResume:a,tickerIdToResume:o}=i,d=y._currentTickers.get(e),h=i.ignoreTickerSteps||false;this.remove(n),a.forEach(c=>{this.resumeTicker({canvasAlias:c});}),this.resumeTicker({id:o}),d&&(this.removeTicker(e,{stopTicker:r}),!h&&d.ticker.duration===void 0&&d.createdByTicketSteps&&this.nextTickerStep(d.createdByTicketSteps.canvasElementAlias,d.createdByTicketSteps.id));}unlinkComponentFromTicker(e,i){if(typeof e=="string"&&(e=[e]),!i){e.forEach(n=>{y._currentTickers.forEach((a,o)=>{a.ticker.canvasElementAliases.includes(n)&&(a.ticker.canvasElementAliases.length===1?this.removeTicker(o):a.ticker.canvasElementAliases=a.ticker.canvasElementAliases.filter(d=>d!==n));}),y._currentTickersSequence.has(n)&&y._currentTickersSequence.delete(n),y.removeTickerTimeoutsByAlias(n,false);});return}let r;typeof i=="string"?r=i:r=i.prototype.id,e.forEach(n=>{let a=y._currentTickersSequence.get(n);a&&a.forEach((o,d)=>{o.steps.find(h=>typeof h=="object"&&"ticker"in h&&h.ticker===r)&&a.delete(d);});}),y._currentTickers.forEach(n=>{n.ticker.alias===r&&(n.ticker.canvasElementAliases=n.ticker.canvasElementAliases.filter(a=>!e.includes(a)));}),y._currentTickersTimeouts.forEach(n=>{n.ticker===r&&n.canBeDeletedBeforeEnd&&(n.aliases=n.aliases.filter(a=>!e.includes(a)));}),this.removeTickersWithoutAssociatedCanvasElement();}removeTickersWithoutAssociatedCanvasElement(){y._currentTickers.forEach(e=>{e.ticker.canvasElementAliases=e.ticker.canvasElementAliases.filter(i=>this.find(i)),e.ticker.canvasElementAliases.length===0&&e.ticker.complete({ignoreTickerSteps:true});}),y._currentTickersSequence.forEach((e,i)=>{e===void 0&&y._currentTickersSequence.delete(i);}),Array.from(y._currentTickersTimeouts.keys()).forEach(e=>{let i=y._currentTickersTimeouts.get(e);i&&i.aliases.length===0&&y.removeTickerTimeout(e);});}removeAllTickers(){this.tickersPausedByGameLayerRender=[],y._currentTickersSequence.clear(),Array.from(y._currentTickers.keys()).forEach(e=>{this.removeTicker(e);}),y._currentTickers.clear(),Array.from(y._currentTickersTimeouts.keys()).forEach(e=>{y.removeTickerTimeout(e);}),y._tickersToCompleteOnStepEnd.tikersIds.length=0,y._tickersToCompleteOnStepEnd.stepAlias.length=0;}removeTicker(e,i={stopTicker:true}){typeof e=="string"&&(e=[e]),e.forEach(r=>{let n=y._currentTickers.get(r);n&&(i.stopTicker&&n.ticker.stop(),y._currentTickers.delete(r));});}pauseTicker(e){let i=[];if("canvasAlias"in e){let{canvasAlias:r,tickerIdsExcluded:n=[]}=e;y._currentTickers.forEach((a,o)=>{a.ticker.canvasElementAliases.includes(r)&&!n.includes(a.ticker.alias)&&a.ticker.paused===false&&(a.ticker.pause(),i.push(o));});}else if("id"in e){let{id:r}=e;typeof r=="string"&&(r=[r]),[...new Set(r)].forEach(n=>{let a=y._currentTickers.get(n);a?a.ticker.paused===false&&(a.ticker.pause(),i.push(n)):I.error(`Ticker with id ${n} not found`);});}return i}resumeTicker(e){if("canvasAlias"in e){let{canvasAlias:i}=e;y._currentTickers.forEach(r=>{r.ticker.canvasElementAliases.includes(i)&&r.ticker.play();});}else if("id"in e){let{id:i}=e;typeof i=="string"&&(i=[i]),[...new Set(i)].forEach(r=>{let n=y._currentTickers.get(r);n?n.ticker.play():I.error(`Ticker with id ${r} not found`);});}}isTickerPaused(e,i){return false}pause(){this.gameLayer.renderable!==false&&(this.gameLayer.renderable=false,this.tickersPausedByGameLayerRender=this.pauseTicker({id:Array.from(y._currentTickers.keys())}));}resume(){if(this.gameLayer.renderable===true)return;this.gameLayer.renderable=true;let e=this.tickersPausedByGameLayerRender.filter(i=>y._currentTickers.has(i));e.length>0&&this.resumeTicker({id:e}),this.tickersPausedByGameLayerRender=[];}transferTickers(e,i,r="move"){let n=y._currentTickersSequence.get(e);if(n){let o=new Map(Array.from(n.entries()).map(([d,h])=>[d,ge(h)]));y._currentTickersSequence.set(i,o);}y._currentTickers.forEach((o,d)=>{if(o.createdByTicketSteps?.canvasElementAlias===e&&this.removeTicker(d),o.ticker.canvasElementAliases.includes(e)){let h=Me.getInstance(o.ticker.alias,ge(o.ticker.args),{duration:o.ticker.duration,priority:o.ticker.priority,canvasElementAliases:[i]});if(h?(this.addTicker(i,h),o.ticker.paused&&h.pause()):I.error(`Ticker ${o.ticker.alias} not found`),r==="move"&&(o.ticker.canvasElementAliases=o.ticker.canvasElementAliases.filter(c=>c!==e)),Object.hasOwn(o.ticker.args,yi)){let c=o.ticker.args.aliasToRemoveAfter;typeof c=="string"&&(c=[c]),Array.isArray(c)&&(r==="move"?o.ticker.args.aliasToRemoveAfter=c.map(l=>l===e?i:l):r==="duplicate"&&c.find(l=>l===e)&&(o.ticker.args.aliasToRemoveAfter=[...c,i]));}}}),y._currentTickersTimeouts.forEach(o=>{o.aliases.includes(e)&&(r==="move"?o.aliases=o.aliases.map(d=>d===e?i:d):r==="duplicate"&&o.aliases.find(d=>d===e)&&o.aliases.push(i));});let a=y._currentTickersSequence.get(i);if(a&&a.forEach((o,d)=>{this.runTickersSequence(i,d);}),r==="duplicate"){let o=y._currentTickersSequence.get(e);o&&o.forEach((d,h)=>{this.runTickersSequence(e,h);});}}completeTickerOnStepEnd(e){e.alias?y._tickersToCompleteOnStepEnd.stepAlias.push({id:e.id,alias:e.alias}):y._tickersToCompleteOnStepEnd.tikersIds.push({id:e.id});}async forceCompletionOfTicker(e,i){if(i){let r=y._currentTickersSequence.get(i),n=r?.get(e);if(r&&n)if(n.steps.includes(Xe))I.error(`The ticker alias: ${i} id: ${e} contains a RepeatType, so it can't be forced to complete`,n);else {let a=n.steps.map(o=>{if(typeof o=="object"&&"ticker"in o){let d=Me.getInstance(o.ticker,o.args,{duration:o.duration,canvasElementAliases:[i],priority:o.priority});if(d)return d.complete()}return Promise.resolve()});await Promise.all(a);}}else {let r=y._currentTickers.get(e);r&&await r.ticker.complete();}}animate(e,i,r,n){return core.GameUnifier.animate(e,i,r,n)}addLayer(e,i){if(e===re){I.error(`The alias ${re} is reserved`);return}return i.label=e,y.app.stage.addChild(i)}getLayer(e){return y.app.stage.getChildByLabel(e)}removeLayer(e){let i=y.app.stage.getChildByLabel(e);i&&y.app.stage.removeChild(i);}addHtmlLayer(e,i,r){return y.addHtmlLayer(e,i,r)}removeHtmlLayer(e){return y.removeHtmlLayer(e)}getHtmlLayer(e){return y.getHtmlLayer(e)}async extractImage(){let e=this.gameLayer.renderable===false;e&&this.resume();let i;try{i=this.app.renderer.extract.image(this.app.stage);}finally{e&&this.pause();}return (await i).src}clear(){this.removeAllTickers(),this.removeAll();}export(){let e=this.gameLayer.renderable===false;e&&this.resume();try{let i={};return this.children.forEach(r=>{r.label&&(i[r.label]=Nt(r));}),{tickers:ge(y.currentTickersWithoutCreatedBySteps),tickersSteps:ge(y.currentTickersSequence),elements:ge(i),stage:ge(ke(this.gameLayer)),elementAliasesOrder:ge(y.childrenAliasesOrder),tickersToCompleteOnStepEnd:ge(y._tickersToCompleteOnStepEnd)}}finally{e&&this.pause();}}async restore(e){this.clear();try{if(Object.hasOwn(e,"elements")&&Object.hasOwn(e,"elementAliasesOrder")){let i=e.elementAliasesOrder,r={},n=Object.entries(e.elements).map(async([a,o])=>{r[a]=await dt(o);});await Promise.all(n),i.forEach(a=>{let o=r[a];o&&this.add(a,o);});}else {I.error("The data does not have the properties elementAliasesOrder and elements");return}if(Object.hasOwn(e,"stage")&&Object.hasOwn(e,"stage")?te(this.gameLayer,e.stage,{ignoreScale:!0}):I.error("The data does not have the properties stage"),Object.hasOwn(e,"tickers")){let i=e.tickers;Object.entries(i).forEach(([r,n])=>{let a=n.canvasElementAliases;if(a.length!==0){let o=Me.getInstance(n.id,n.args,{duration:n.duration,priority:n.priority,id:r,canvasElementAliases:a});o?(o.canvasElementAliases=a,this.addTicker(a,o),n.paused&&o.pause()):I.error(`Ticker ${n.id} not found`);}});}if(Object.hasOwn(e,"tickersSteps")){let i=e.tickersSteps;Object.entries(i).forEach(([r,n])=>{y._currentTickersSequence.set(r,new Map(Object.entries(n))),Object.keys(n).forEach(a=>{this.runTickersSequence(r,a);});});}if(Object.hasOwn(e,"tickersToCompleteOnStepEnd")){let i=e.tickersToCompleteOnStepEnd,r=i.tikersIds,n=i.stepAlias.map(a=>({id:a.id,alias:a.alias}));y._tickersToCompleteOnStepEnd.tikersIds.length=0,y._tickersToCompleteOnStepEnd.tikersIds.push(...r),y._tickersToCompleteOnStepEnd.stepAlias.length=0,y._tickersToCompleteOnStepEnd.stepAlias.push(...n);}}catch(i){I.error("Error importing data",i);}}};var F=class t{static init(e){t._getScreen=e.getScreen;}static _getScreen;static get screen(){return t._getScreen()}};exports.CanvasPropertyUtility=void 0;(h=>{function t(c,l,p,u,m,T=0){return m?c==="width"?l*(F.screen.width-p)+p-u-T*p:l*(F.screen.height-p)+p-u-T*p:c==="width"?l*(F.screen.width-p)+u+T*p:l*(F.screen.height-p)+u+T*p}h.calculatePositionByAlign=t;function e(c,l,p,u,m,T=0){return m?c==="width"?(l-p+u+T*p)/(F.screen.width-p):(l-p+u+T*p)/(F.screen.height-p):c==="width"?(l-u-T*p)/(F.screen.width-p):(l-u-T*p)/(F.screen.height-p)}h.calculateAlignByPosition=e;function i(c,l){return c==="width"?l*F.screen.width:l*F.screen.height}h.calculatePositionByPercentagePosition=i;function r(c,l){return c==="width"?l/F.screen.width:l/F.screen.height}h.calculatePercentagePositionByPosition=r;function n(c,l){if(l=l%360,l<0&&(l+=360),l===0)return {x:c.x,y:c.y};if(l===90)return {x:-c.y,y:c.x};if(l===180)return {x:-c.x,y:-c.y};if(l===270)return {x:c.y,y:-c.x};if(l>0&&l<90){let p=l*Math.PI/180,u=Math.cos(p),m=Math.sin(p),T=c.x*u-c.y*m,S=c.x*m+c.y*u;return c.x!==0&&Math.sign(T)!==Math.sign(c.x)&&(T=-T),c.y!==0&&Math.sign(S)!==Math.sign(c.y)&&(S=-S),{x:T,y:S}}else if(l>90&&l<180){let p=(l-90)*Math.PI/180,u=Math.cos(p),m=Math.sin(p),T=-c.y*m-c.x*u,S=c.y*u-c.x*m;return c.x!==0&&Math.sign(T)!==Math.sign(c.x)&&(T=-T),c.y!==0&&Math.sign(S)!==Math.sign(c.y)&&(S=-S),{x:T,y:S}}else if(l>180&&l<270){let p=(l-180)*Math.PI/180,u=Math.cos(p),m=Math.sin(p),T=-c.x*u+c.y*m,S=-c.x*m-c.y*u;return c.x!==0&&Math.sign(T)!==Math.sign(c.x)&&(T=-T),c.y!==0&&Math.sign(S)!==Math.sign(c.y)&&(S=-S),{x:T,y:S}}else if(l>270&&l<360){let p=(l-270)*Math.PI/180,u=Math.cos(p),m=Math.sin(p),T=c.y*m-c.x*u,S=-c.y*u-c.x*m;return c.x!==0&&Math.sign(T)!==Math.sign(c.x)&&(T=-T),c.y!==0&&Math.sign(S)!==Math.sign(c.y)&&(S=-S),{x:T,y:S}}return {x:0,y:0}}h.getSuperPoint=n;function a(c,l){if(l=l%360,l<0&&(l+=360),l===0)return {x:c.x,y:c.y};if(l===90)return {x:c.y,y:-c.x};if(l===180)return {x:-c.x,y:-c.y};if(l===270)return {x:-c.y,y:c.x};if(l>0&&l<90){let p=l*Math.PI/180,u=Math.cos(p),m=Math.sin(p);return {x:c.x*u+c.y*m,y:-c.x*m+c.y*u}}else if(l>90&&l<180){let p=(l-90)*Math.PI/180,u=Math.cos(p),m=Math.sin(p);return {x:c.y*u-c.x*m,y:-c.y*m-c.x*u}}else if(l>180&&l<270){let p=(l-180)*Math.PI/180,u=Math.cos(p),m=Math.sin(p);return {x:-c.x*u-c.y*m,y:c.x*m-c.y*u}}else if(l>270&&l<360){let p=(l-270)*Math.PI/180,u=Math.cos(p),m=Math.sin(p);return {x:-c.y*u+c.x*m,y:c.y*m+c.x*u}}return {x:0,y:0}}h.getPointBySuperPoint=a;function o(c){let l=c.width,p=c.height,u=c.angle%360;return u<0&&(u+=360),u===0||u===180?l:u===90||u===270?p:Math.abs(l*Math.cos(u*Math.PI/180))+Math.abs(p*Math.sin(u*Math.PI/180))}h.getSuperWidth=o;function d(c){let l=c.width,p=c.height,u=c.angle%360;return u<0&&(u+=360),u===0||u===180?p:u===90||u===270?l:Math.abs(p*Math.cos(u*Math.PI/180))+Math.abs(l*Math.sin(u*Math.PI/180))}h.getSuperHeight=d;})(exports.CanvasPropertyUtility||={});async function Qe(t){if(t!=="EMPTY"){if(!t)throw I.error("Texture not found",t),new core.PixiError("unregistered_asset","Texture not found");if(Ee__default.default.Assets.cache.has(t)){let e=Ee__default.default.Assets.get(t);if(e)return e}return Ee__default.default.Assets.load(t).then(e=>{if(!e)throw I.error("Texture not found",t),new core.PixiError("unregistered_asset","Texture not found");if(!(e instanceof Ee__default.default.Texture))throw I.error("File is not a Texture",t),new core.PixiError("unregistered_asset","File is not a Texture");return e}).catch(e=>{throw I.error("Error loading file",e),new core.PixiError("unknown_element","Error loading file")})}}function pe(t){return t&&(typeof t.align!="number"&&(t.xAlign!==void 0&&(t.align===void 0?(t.align={x:t.xAlign},delete t.xAlign):(t.align.x=t.xAlign,delete t.xAlign)),t.yAlign!==void 0&&(t.align===void 0?(t.align={y:t.yAlign},delete t.yAlign):(t.align.y=t.yAlign,delete t.yAlign))),typeof t.percentagePosition!="number"&&(t.percentageX!==void 0&&(t.percentagePosition===void 0?(t.percentagePosition={x:t.percentageX},delete t.percentageX):(t.percentagePosition.x=t.percentageX,delete t.percentageX)),t.percentageY!==void 0&&(t.percentagePosition===void 0?(t.percentagePosition={y:t.percentageY},delete t.percentageY):(t.percentagePosition.y=t.percentageY,delete t.percentageY))),t)}var Oe=class t extends Ee__default.default.Sprite{constructor(e){if(e instanceof Ee__default.default.Texture)super(e);else {let{align:i,percentagePosition:r,...n}=pe(e)||{};super(n),i&&(this.align=i),r&&(this.percentagePosition=r);}this.pixivnId=this.constructor.prototype.pixivnId||ze;}pixivnId=ze;get memory(){return {...Wt(this),pixivnId:this.pixivnId,align:this._align,percentagePosition:this._percentagePosition}}async setMemory(e){return await mt(this,e)}static from(e,i){let r=Ee__default.default.Sprite.from(e,i),n=new t;return n.texture=r.texture,n}onEventsHandlers={};on(e,i,r){return Ae(e,this,i),super.on(e,(...n)=>i(...n,this),r)}_align=void 0;set align(e){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),typeof e=="number"?(this._align.x=e,this._align.y=e):(e.x!==void 0&&(this._align.x=e.x),e.y!==void 0&&(this._align.y=e.y)),this.reloadPosition();}get align(){let e=exports.CanvasPropertyUtility.getSuperPoint(this.pivot,this.angle),i=exports.CanvasPropertyUtility.getSuperPoint(this.scale,this.angle);return {x:exports.CanvasPropertyUtility.calculateAlignByPosition("width",this.x,exports.CanvasPropertyUtility.getSuperWidth(this),e.x,i.x<0,this.anchor.x),y:exports.CanvasPropertyUtility.calculateAlignByPosition("height",this.y,exports.CanvasPropertyUtility.getSuperHeight(this),e.y,i.y<0,this.anchor.y)}}set xAlign(e){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),this._align.x=e,this.reloadPosition();}get xAlign(){let e=exports.CanvasPropertyUtility.getSuperPoint(this.pivot,this.angle),i=exports.CanvasPropertyUtility.getSuperPoint(this.scale,this.angle);return exports.CanvasPropertyUtility.calculateAlignByPosition("width",this.x,exports.CanvasPropertyUtility.getSuperWidth(this),e.x,i.x<0,this.anchor.x)}set yAlign(e){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),this._align.y=e,this.reloadPosition();}get yAlign(){let e=exports.CanvasPropertyUtility.getSuperPoint(this.pivot,this.angle),i=exports.CanvasPropertyUtility.getSuperPoint(this.scale,this.angle);return exports.CanvasPropertyUtility.calculateAlignByPosition("height",this.y,exports.CanvasPropertyUtility.getSuperHeight(this),e.y,i.y<0,this.anchor.y)}_percentagePosition=void 0;set percentagePosition(e){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),typeof e=="number"?(this._percentagePosition.x=e,this._percentagePosition.y=e):(e.x!==void 0&&(this._percentagePosition.x=e.x),e.y!==void 0&&(this._percentagePosition.y=e.y)),this.reloadPosition();}get percentagePosition(){return {x:exports.CanvasPropertyUtility.calculatePercentagePositionByPosition("width",this.x),y:exports.CanvasPropertyUtility.calculatePercentagePositionByPosition("height",this.y)}}get percentageX(){return exports.CanvasPropertyUtility.calculatePercentagePositionByPosition("width",this.x)}set percentageX(e){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.x=e,this.reloadPosition();}get percentageY(){return exports.CanvasPropertyUtility.calculatePercentagePositionByPosition("height",this.y)}set percentageY(e){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.y=e,this.reloadPosition();}get positionType(){return this._align?"align":this._percentagePosition?"percentage":"pixel"}get positionInfo(){switch(this.positionType){case "align":return {x:this.xAlign,y:this.yAlign,type:"align"};case "percentage":return {x:this.percentageX,y:this.percentageY,type:"percentage"};default:return {x:this.x,y:this.y,type:"pixel"}}}set positionInfo(e){e.type==="align"?this.align={x:e.x,y:e.y}:e.type==="percentage"?this.percentagePosition={x:e.x,y:e.y}:this.position.set(e.x,e.y);}reloadPosition(){if(this._align){let e=exports.CanvasPropertyUtility.getSuperPoint(this.pivot,this.angle),i=exports.CanvasPropertyUtility.getSuperPoint(this.scale,this.angle);this._align.x!==void 0&&(super.x=exports.CanvasPropertyUtility.calculatePositionByAlign("width",this._align.x,exports.CanvasPropertyUtility.getSuperWidth(this),e.x,i.x<0,this.anchor.x)),this._align.y!==void 0&&(super.y=exports.CanvasPropertyUtility.calculatePositionByAlign("height",this._align.y,exports.CanvasPropertyUtility.getSuperHeight(this),e.y,i.y<0,this.anchor.y));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=exports.CanvasPropertyUtility.calculatePositionByPercentagePosition("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=exports.CanvasPropertyUtility.calculatePositionByPercentagePosition("height",this._percentagePosition.y)));}get position(){return super.position}set position(e){this._align=void 0,this._percentagePosition=void 0,super.position=e;}get x(){return super.x}set x(e){this._align=void 0,this._percentagePosition=void 0,super.x=e;}get y(){return super.y}set y(e){this._align=void 0,this._percentagePosition=void 0,super.y=e;}};U.add(Oe,{name:ze,copyProperty:async(t,e)=>{await mt(t,e,{ignoreTexture:true});}});async function mt(t,e,i){e=pe(e);let r=i?.ignoreTexture||false;if(await te(t,e),!r){let a;if("textureData"in e&&e.textureData&&(a=e.textureData),a&&a.url!=="EMPTY"){let o=a.url;a.alias&&Ee__default.default.Assets.resolver.hasKey(a.alias)&&(o=a.alias);try{let d=await Qe(o);d&&(t.texture=d);}catch(d){I.error("Error in Sprite.setMemorySprite() while loading texture"),d=new core.PixiError("unregistered_asset",`Error loading image ${o}`,"canvas",e),core.GameUnifier.runOnError(d,{});}}}let n=i?.half;n&&await n(),"anchor"in e&&e.anchor!==void 0&&(typeof e.anchor=="number"?t.anchor.set(e.anchor,e.anchor):t.anchor.set(e.anchor.x,e.anchor.y)),"align"in e&&e.align!==void 0&&(t.align=e.align),"percentagePosition"in e&&e.percentagePosition!==void 0&&(t.percentagePosition=e.percentagePosition),"roundPixels"in e&&e.roundPixels!==void 0&&(t.roundPixels=e.roundPixels);}var B=class t extends Oe{_textureAlias;get textureAlias(){return this._textureAlias?this._textureAlias:this.texture.source.label}pixivnId=Le;constructor(e,i){super(e),i&&(this._textureAlias=i);}get memory(){return {...super.memory,pixivnId:this.pixivnId,loadIsStarted:this._loadIsStarted}}async setMemory(e){let i;"textureData"in e&&e.textureData&&(i=e.textureData),"assetsData"in e&&Array.isArray(e.assetsData)&&e.assetsData.length>0&&(i=e.assetsData[0]),i&&i.alias&&(this._textureAlias=i.alias),await xt(this,e),this.reloadPosition();}static from(e,i){let r=Ee__default.default.Sprite.from(e,i),n=new t;return n.texture=r.texture,n}_loadIsStarted=false;get loadIsStarted(){return this._loadIsStarted}async load(){return this._loadIsStarted=true,Qe(this.textureAlias).then(e=>{this._loadIsStarted=false,e&&(this.texture=e);}).catch(e=>{this._loadIsStarted=false,I.error("Error into ImageSprite.load()"),e=new core.PixiError("unregistered_asset",`Error loading image ${this.textureAlias}`,"canvas",{...this.memory,label:this.textureAlias},this),core.GameUnifier.runOnError(e,{});})}set texture(e){super.texture=e,this.reloadPosition();}get texture(){return super.texture}get haveEmptyTexture(){return this.texture._source.label==="EMPTY"}};U.add(B,{name:Le,copyProperty:async(t,e)=>{await xt(t,e,{ignoreTexture:true});}});async function xt(t,e,i){return await mt(t,e,{half:async()=>{"loadIsStarted"in e&&e.loadIsStarted&&await t.load();},ignoreTexture:i?.ignoreTexture})}var ye=class t extends B{constructor(e,i){if(e instanceof Ee__default.default.Texture){super(e,i);return}let{loop:r,paused:n,currentTime:a,...o}=e||{};super(o,i),r&&(this.loop=r),n&&(this.paused=n),a&&(this.currentTime=a);}pixivnId=Ne;get memory(){return {...super.memory,pixivnId:this.pixivnId,loop:this.loop,paused:this._paused,currentTime:this.currentTime}}async setMemory(e){await xi(this,e),this.reloadPosition();}static from(e,i){let r=Ee__default.default.Sprite.from(e,i),n=new t;return n.texture=r.texture,n}async load(){await super.load(),this.loop=this._looop,this.currentTime=this._currentTime,this.paused=this._paused;}_looop=false;get loop(){return this.texture?.source?.resource?.loop||false}set loop(e){this._looop=e,this.texture?.source?.resource&&(this.texture.source.resource.loop=e);}_paused=false;get paused(){return this.texture?.source?.resource?.paused||false}set paused(e){e?this.pause():this.play();}pause(){this._paused=true,this.texture?.source?.resource&&this.texture.source.resource.pause();}play(){this._paused=false,this.texture?.source?.resource?.play&&typeof this.texture.source.resource.play=="function"&&this.texture.source.resource.play();}_currentTime=0;get currentTime(){return this.texture?.source?.resource?.currentTime||0}set currentTime(e){let i=this.duration;i&&e>=i&&(e=0),this._currentTime=e,this.texture?.source?.resource&&(this.texture.source.resource.currentTime=e);}restart(){this.currentTime=0;}get duration(){if(this.texture?.source?.resource)return this.texture.source.resource.duration||0}};U.add(ye,{name:Ne,getInstance:async(t,e)=>{let i;"textureData"in e&&e.textureData&&(i=e.textureData);let r=new t(void 0,i?.alias);return await r.setMemory(e),r},copyProperty:async(t,e)=>{await xi(t,e,{ignoreTexture:true});}});async function xi(t,e,i){await xt(t,e,{ignoreTexture:i?.ignoreTexture}),"loop"in e&&e.loop!==void 0&&(t.loop=e.loop),"currentTime"in e&&e.currentTime!==void 0&&(t.currentTime=e.currentTime),"paused"in e&&e.paused!==void 0&&(t.paused=e.paused);}var xe=class extends Ee.Container{constructor(e){let{anchor:i,align:r,percentagePosition:n,...a}=pe(e)||{};super(a),this.pixivnId=this.constructor.prototype.pixivnId||De,i&&(this.anchor=i),r&&(this.align=r),n&&(this.percentagePosition=n);}pixivnId=De;get memory(){return {...ke(this,{childrenExport:true}),anchor:this._anchor?this.anchor:void 0,align:this._align,percentagePosition:this._percentagePosition}}async setMemory(e){await this.importChildren(e),await te(this,e),this.reloadAnchor(),this.reloadPosition();}async importChildren(e){for(let i=0;i<e.elements.length;i++){let r=e.elements[i],n=await dt(r);this.addChild(n);}}onEventsHandlers={};on(e,i,r){return Ae(e,this,i),super.on(e,(...n)=>i(...n,this),r)}_anchor;get anchor(){let e=super.pivot.x/this.width,i=super.pivot.y/this.height;return {x:e,y:i}}set anchor(e){typeof e=="number"?this._anchor={x:e,y:e}:this._anchor=e,this.reloadAnchor();}reloadAnchor(){this._anchor&&super.pivot.set(this._anchor.x*this.width,this._anchor.y*this.height);}get pivot(){return super.pivot}set pivot(e){this._anchor=void 0,super.pivot=e;}_align=void 0;set align(e){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),typeof e=="number"?(this._align.x=e,this._align.y=e):(e.x!==void 0&&(this._align.x=e.x),e.y!==void 0&&(this._align.y=e.y)),this.reloadPosition();}get align(){let e=exports.CanvasPropertyUtility.getSuperPoint(this.pivot,this.angle),i=exports.CanvasPropertyUtility.getSuperPoint(this.scale,this.angle);return {x:exports.CanvasPropertyUtility.calculateAlignByPosition("width",this.x,exports.CanvasPropertyUtility.getSuperWidth(this),e.x,i.x<0),y:exports.CanvasPropertyUtility.calculateAlignByPosition("height",this.y,exports.CanvasPropertyUtility.getSuperHeight(this),e.y,i.y<0)}}set xAlign(e){this._percentagePosition&&(this._percentagePosition=void 0),this._align===void 0&&(this._align={}),this._align.x=e,this.reloadPosition();}get xAlign(){let e=exports.CanvasPropertyUtility.getSuperPoint(this.pivot,this.angle),i=exports.CanvasPropertyUtility.getSuperPoint(this.scale,this.angle);return exports.CanvasPropertyUtility.calculateAlignByPosition("width",this.x,exports.CanvasPropertyUtility.getSuperWidth(this),e.x,i.x<0)}set yAlign(e){this._percentagePosition&&(this._percentagePosition=void 0),this._align===void 0&&(this._align={}),this._align.y=e,this.reloadPosition();}get yAlign(){let e=exports.CanvasPropertyUtility.getSuperPoint(this.pivot,this.angle),i=exports.CanvasPropertyUtility.getSuperPoint(this.scale,this.angle);return exports.CanvasPropertyUtility.calculateAlignByPosition("height",this.y,exports.CanvasPropertyUtility.getSuperHeight(this),e.y,i.y<0)}_percentagePosition=void 0;set percentagePosition(e){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),typeof e=="number"?(this._percentagePosition.x=e,this._percentagePosition.y=e):(e.x!==void 0&&(this._percentagePosition.x=e.x),e.y!==void 0&&(this._percentagePosition.y=e.y)),this.reloadPosition();}get percentagePosition(){return {x:exports.CanvasPropertyUtility.calculatePercentagePositionByPosition("width",this.x),y:exports.CanvasPropertyUtility.calculatePercentagePositionByPosition("height",this.y)}}set percentageX(e){this._align&&(this._align=void 0),this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.x=e,this.reloadPosition();}get percentageX(){return exports.CanvasPropertyUtility.calculatePercentagePositionByPosition("width",this.x)}set percentageY(e){this._align&&(this._align=void 0),this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.y=e,this.reloadPosition();}get percentageY(){return exports.CanvasPropertyUtility.calculatePercentagePositionByPosition("height",this.y)}get positionType(){return this._align?"align":this._percentagePosition?"percentage":"pixel"}get positionInfo(){switch(this.positionType){case "align":return {x:this.xAlign,y:this.yAlign,type:"align"};case "percentage":return {x:this.percentageX,y:this.percentageY,type:"percentage"};default:return {x:this.x,y:this.y,type:"pixel"}}}set positionInfo(e){e.type==="align"?this.align={x:e.x,y:e.y}:e.type==="percentage"?this.percentagePosition={x:e.x,y:e.y}:this.position.set(e.x,e.y);}reloadPosition(){if(this._align){let e=exports.CanvasPropertyUtility.getSuperPoint(this.pivot,this.angle),i=exports.CanvasPropertyUtility.getSuperPoint(this.scale,this.angle);this._align.x!==void 0&&(super.x=exports.CanvasPropertyUtility.calculatePositionByAlign("width",this._align.x,exports.CanvasPropertyUtility.getSuperWidth(this),e.x,i.x<0)),this._align.y!==void 0&&(super.y=exports.CanvasPropertyUtility.calculatePositionByAlign("height",this._align.y,exports.CanvasPropertyUtility.getSuperHeight(this),e.y,i.y<0));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=exports.CanvasPropertyUtility.calculatePositionByPercentagePosition("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=exports.CanvasPropertyUtility.calculatePositionByPercentagePosition("height",this._percentagePosition.y)));}get position(){return super.position}set position(e){this._align=void 0,this._percentagePosition=void 0,super.position=e;}get x(){return super.x}set x(e){this._align=void 0,this._percentagePosition=void 0,super.x=e;}get y(){return super.y}set y(e){this._align=void 0,this._percentagePosition=void 0,super.y=e;}};U.add(xe,{name:De,copyProperty:async(t,e)=>await te(t,e)});var cr=new Set(["mp4","webm","ogg","ogv","avi","mov","wmv","flv","mkv","m4v","3gp","3g2","ts","mts"]);function et(t){let e=Ee__default.default.Assets.cache.has(t)?Ee__default.default.Assets.get(t):null;return e instanceof Ee__default.default.Texture&&(t=e.source?.label||t),lr(t)}function lr(t){let e=t.split(".").pop()?.toLowerCase();return e!==void 0&&cr.has(e)}var z=class extends xe{constructor(e,i){let{anchor:r,align:n,percentagePosition:a,...o}=pe(e)||{};super(o),i&&i.forEach(d=>{et(d)?this.addChild(new ye(void 0,d)):this.addChild(new B(void 0,d));}),r&&(this.anchor=r),n&&(this.align=n),a&&(this.percentagePosition=a);}get memory(){return {...super.memory,pixivnId:nt,loadIsStarted:this._loadIsStarted}}async setMemory(e){await this.importChildren(e),await Ti(this,e),this.reloadAnchor(),this.reloadPosition();}pixivnId=nt;_loadIsStarted=false;get loadIsStarted(){return this._loadIsStarted}async load(){this._loadIsStarted=true;let e=this.children.map(i=>i.load());return Promise.all(e).then(()=>{this._loadIsStarted=false,this.reloadAnchor(),this.reloadPosition();}).catch(i=>{this._loadIsStarted=false,I.error("Error into ImageContainer.load()",i);})}get texture(){return this.children.length>0?this.children[0].texture:new Ee__default.default.Texture}get haveEmptyTexture(){return this.children.some(e=>e.texture._source.label==="EMPTY")}};U.add(z,{name:nt,copyProperty:async(t,e)=>await Ti(t,e)});async function Ti(t,e){e=pe(e)||{},te(t,e,{end:async()=>{"loadIsStarted"in e&&e.loadIsStarted&&await t.load();}});}var Tt=class{constructor(...e){}get memory(){throw new core.PixiError("not_implemented","The method CanvasBaseItem.memory must be overridden")}setMemory(e){throw new core.PixiError("not_implemented","The method CanvasBaseItem.setMemory must be overridden")}pixivnId="canvas_element_id_not_set"};var Re=class extends Ee__default.default.Text{constructor(e){let{align:i,percentagePosition:r,...n}=pe(e)||{};super(n),this.pixivnId=this.constructor.prototype.pixivnId||He,i&&(this.align=i),r&&(this.percentagePosition=r);}pixivnId=He;get memory(){return {...Ft(this),pixivnId:this.pixivnId,align:this._align,percentagePosition:this._percentagePosition}}async setMemory(e){await pr(this,e),this.reloadPosition();}onEventsHandlers={};on(e,i,r){return Ae(e,this,i),super.on(e,(...n)=>i(...n,this),r)}_align=void 0;set align(e){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),typeof e=="number"?(this._align.x=e,this._align.y=e):(e.x!==void 0&&(this._align.x=e.x),e.y!==void 0&&(this._align.y=e.y)),this.reloadPosition();}get align(){let e=exports.CanvasPropertyUtility.getSuperPoint(this.pivot,this.angle),i=exports.CanvasPropertyUtility.getSuperPoint(this.scale,this.angle);return {x:exports.CanvasPropertyUtility.calculateAlignByPosition("width",this.x,exports.CanvasPropertyUtility.getSuperWidth(this),e.x,i.x<0,this.anchor.x),y:exports.CanvasPropertyUtility.calculateAlignByPosition("height",this.y,exports.CanvasPropertyUtility.getSuperHeight(this),e.y,i.y<0,this.anchor.y)}}set xAlign(e){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),this._align.x=e,this.reloadPosition();}get xAlign(){let e=exports.CanvasPropertyUtility.getSuperPoint(this.pivot,this.angle),i=exports.CanvasPropertyUtility.getSuperPoint(this.scale,this.angle);return exports.CanvasPropertyUtility.calculateAlignByPosition("width",this.x,exports.CanvasPropertyUtility.getSuperWidth(this),e.x,i.x<0,this.anchor.x)}set yAlign(e){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),this._align.y=e,this.reloadPosition();}get yAlign(){let e=exports.CanvasPropertyUtility.getSuperPoint(this.pivot,this.angle),i=exports.CanvasPropertyUtility.getSuperPoint(this.scale,this.angle);return exports.CanvasPropertyUtility.calculateAlignByPosition("height",this.y,exports.CanvasPropertyUtility.getSuperHeight(this),e.y,i.y<0,this.anchor.y)}_percentagePosition=void 0;set percentagePosition(e){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),typeof e=="number"?(this._percentagePosition.x=e,this._percentagePosition.y=e):(e.x!==void 0&&(this._percentagePosition.x=e.x),e.y!==void 0&&(this._percentagePosition.y=e.y)),this.reloadPosition();}get percentagePosition(){return {x:exports.CanvasPropertyUtility.calculatePercentagePositionByPosition("width",this.x),y:exports.CanvasPropertyUtility.calculatePercentagePositionByPosition("height",this.y)}}get percentageX(){return exports.CanvasPropertyUtility.calculatePercentagePositionByPosition("width",this.x)}set percentageX(e){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.x=e,this.reloadPosition();}get percentageY(){return exports.CanvasPropertyUtility.calculatePercentagePositionByPosition("height",this.y)}set percentageY(e){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.y=e,this.reloadPosition();}get positionType(){return this._align?"align":this._percentagePosition?"percentage":"pixel"}get positionInfo(){switch(this.positionType){case "align":return {x:this.xAlign,y:this.yAlign,type:"align"};case "percentage":return {x:this.percentageX,y:this.percentageY,type:"percentage"};default:return {x:this.x,y:this.y,type:"pixel"}}}set positionInfo(e){e.type==="align"?this.align={x:e.x,y:e.y}:e.type==="percentage"?this.percentagePosition={x:e.x,y:e.y}:this.position.set(e.x,e.y);}reloadPosition(){if(this._align){let e=exports.CanvasPropertyUtility.getSuperPoint(this.pivot,this.angle),i=exports.CanvasPropertyUtility.getSuperPoint(this.scale,this.angle);this._align.x!==void 0&&(super.x=exports.CanvasPropertyUtility.calculatePositionByAlign("width",this._align.x,exports.CanvasPropertyUtility.getSuperWidth(this),e.x,i.x<0,this.anchor.x)),this._align.y!==void 0&&(super.y=exports.CanvasPropertyUtility.calculatePositionByAlign("height",this._align.y,exports.CanvasPropertyUtility.getSuperHeight(this),e.y,i.y<0,this.anchor.y));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=exports.CanvasPropertyUtility.calculatePositionByPercentagePosition("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=exports.CanvasPropertyUtility.calculatePositionByPercentagePosition("height",this._percentagePosition.y)));}get position(){return super.position}set position(e){this._align=void 0,this._percentagePosition=void 0,super.position=e;}get x(){return super.x}set x(e){this._align=void 0,this._percentagePosition=void 0,super.x=e;}get y(){return super.y}set y(e){this._align=void 0,this._percentagePosition=void 0,super.y=e;}};U.add(Re,{name:He});async function pr(t,e){"text"in e&&e.text!==void 0&&(t.text=e.text),await te(t,e,{end:()=>{"style"in e&&e.style!==void 0&&(t.style=e.style);}}),"anchor"in e&&e.anchor!==void 0&&(typeof e.anchor=="number"?t.anchor.set(e.anchor,e.anchor):t.anchor.set(e.anchor.x,e.anchor.y)),"resolution"in e&&e.resolution!==void 0&&(t.resolution=e.resolution),"anchor"in e&&e.anchor!==void 0&&(typeof e.anchor=="number"?t.anchor.set(e.anchor,e.anchor):t.anchor.set(e.anchor.x,e.anchor.y)),"align"in e&&e.align!==void 0&&(t.align=e.align),"percentagePosition"in e&&e.percentagePosition!==void 0&&(t.percentagePosition=e.percentagePosition),"roundPixels"in e&&e.roundPixels!==void 0&&(t.roundPixels=e.roundPixels);}async function ur(t,e={},i){let r=g.find(t);if(!r){I.error(`The element with the alias ${t} does not exist. So the shake effect can't be applied.`);return}let n={x:r.position.x,y:r.position.y},{shakeType:a="horizontal",maxShockSize:o=10,shocksNumber:d=10,...h}=e,c=d-1;if(c<2){I.error("The number of shocks must be at least 3.");return}let l=Math.floor(c/2),p=Math.ceil(c/2),u=[];for(let S=0;S<l;S++){let C=o*(S+1)/l;a==="horizontal"?S%2!==0?u.push(n.x+C):u.push(n.x-C):S%2!==0?u.push(n.y+C):u.push(n.y-C);}let m=l%2===0;for(let S=p;S>0;S--){let C=o*(S+1)/(p-1);a==="horizontal"?S%2===0&&!m||S%2!==0&&m?u.push(n.x-C):u.push(n.x+C):S%2===0&&!m||S%2!==0&&m?u.push(n.y-C):u.push(n.y+C);}let T;if(a==="horizontal"?(u.push(n.x),T=g.animate(t,{x:u},h,i)):(u.push(n.y),T=g.animate(t,{y:u},h,i)),T)return [T]}function vt(t,e,i){let r={...g.find(t)?.memory,...i},n=new z(i,e);return r&&g.copyCanvasElementProperty(r,n),g.add(t,n,{ignoreOldStyle:true,zIndex:i?.zIndex}),n}async function fr(t,e,i){let r={...g.find(t)?.memory,...i},n=new z(i,e);return n.label=t,await n.load(),r&&g.copyCanvasElementProperty(r,n),g.add(t,n,{ignoreOldStyle:true,zIndex:i?.zIndex}),n}function Pt(t,e,i){if(!e)if(Ee__default.default.Assets.resolver.hasKey(t))e=t;else throw new core.PixiError("unregistered_asset",`The image ${t} does not exist in the cache.`,"canvas",{pixivnId:Le,...i,label:t});let r={...g.find(t)?.memory,...i},n=new B(i,e);return r&&g.copyCanvasElementProperty(r,n),g.add(t,n,{ignoreOldStyle:true,zIndex:i?.zIndex}),n}async function gr(t,e,i){if(!e)if(Ee__default.default.Assets.resolver.hasKey(t))e=t;else throw new core.PixiError("unregistered_asset",`The image ${t} does not exist in the cache.`,"canvas",{pixivnId:Le,...i,label:t});let r={...g.find(t)?.memory,...i},n=new B(i,e);return n.label=t,await n.load(),r&&g.copyCanvasElementProperty(r,n),g.add(t,n,{ignoreOldStyle:true,zIndex:i?.zIndex}),n}function St(t,e,i){if(!e)if(Ee__default.default.Assets.resolver.hasKey(t))e=t;else throw new core.PixiError("unregistered_asset",`The video ${t} does not exist in the cache.`,"canvas",{pixivnId:Ne,...i,label:t});let r={...g.find(t)?.memory,...i},n=new ye(i,e);return r&&g.copyCanvasElementProperty(r,n),g.add(t,n,{ignoreOldStyle:true,zIndex:i?.zIndex}),n}async function yr(t,e,i){if(!e)if(Ee__default.default.Assets.resolver.hasKey(t))e=t;else throw new core.PixiError("unregistered_asset",`The video ${t} does not exist in the cache.`,"canvas",{pixivnId:Ne,...i,label:t});let r={...g.find(t)?.memory,...i},n=new ye(i,e);return n.label=t,await n.load(),r&&g.copyCanvasElementProperty(r,n),g.add(t,n,{ignoreOldStyle:true,zIndex:i?.zIndex}),n}function Ut(t){switch(t.type){case "align":return {xAlign:t.x,yAlign:t.y};case "percentage":return {percentageX:t.x,percentageY:t.y};default:return {x:t.x,y:t.y}}}function tt(t,e,i){if(typeof e=="string")return et(e)?St(t,e,i):Pt(t,e,i);if(Array.isArray(e))return vt(t,e,i);if(typeof e=="object"&&"value"in e&&"options"in e){if(typeof e.value=="string")return et(e.value)?St(t,e.value,{...e.options,zIndex:i.zIndex}):Pt(t,e.value,{...e.options,zIndex:i.zIndex});if(Array.isArray(e.value))return vt(t,e.value,{...e.options,zIndex:i.zIndex})}return g.add(t,e,i),e}async function Ci(t,e,i={},r){let{forceCompleteBeforeNext:n=true}=i,{completeOnContinue:a=n,tickerIdToResume:o=[],...d}=i,h=[];e||(e=t),typeof o=="string"&&(o=[o]);let c,l=g.find(t);if(l&&(c=t+"_temp_disolve",g.editAlias(t,c)),e=tt(t,e,{zIndex:l?l.parent?.getChildIndex(l):void 0}),l?.parent?.setChildIndex(l,l.parent.getChildIndex(l)-.1),c&&g.copyCanvasElementProperty(c,t),c&&g.transferTickers(c,t,"duplicate"),e.alpha=0,c){let u=It(c,{...i,autoplay:false,completeOnContinue:a},r);u&&(h.push(...u),o.push(...u));}let p=g.animate(t,{alpha:1},{...d,tickerIdToResume:o,completeOnContinue:a},r);if(p&&h.push(p),(e instanceof B||e instanceof z)&&e.haveEmptyTexture&&await e.load(),h.length>0)return h}function It(t,e={},i){let{forceCompleteBeforeNext:r=true}=e,{completeOnContinue:n=r,aliasToRemoveAfter:a=[],...o}=e;typeof a=="string"&&(a=[a]),a.push(t);let d=g.animate(t,{alpha:0},{...o,aliasToRemoveAfter:a,completeOnContinue:n},i);if(d)return [d]}async function mr(t,e,i={},r){let{forceCompleteBeforeNext:n=true}=i,{completeOnContinue:a=n,aliasToRemoveAfter:o=[],...d}=i,h=[];e||(e=t),typeof o=="string"&&(o=[o]);let c=g.find(t);if(!c)return Ci(t,e,i,r);let l=t+"_temp_fade";g.editAlias(t,l),o.push(l),e=tt(t,e,{zIndex:c?c.parent?.getChildIndex(c):void 0}),c?.parent?.setChildIndex(c,c.parent.getChildIndex(c)-.1),l&&g.copyCanvasElementProperty(l,t),l&&g.transferTickers(l,t,"duplicate"),e.alpha=0;let p=g.animate(t,{alpha:1},{...d,aliasToRemoveAfter:o,completeOnContinue:a},r);if(p){let u=It(l,{...i,tickerIdToResume:p,completeOnContinue:a},r);u&&h.push(...u),h.push(p),g.pauseTicker({id:p});}if((e instanceof B||e instanceof z)&&e.haveEmptyTexture&&await e.load(),h.length>0)return h}function xr(t,e={},i){return It(t,e,i)}async function Tr(t,e,i={},r){let{forceCompleteBeforeNext:n=true}=i,{direction:a="right",completeOnContinue:o=n,tickerIdToResume:d=[],aliasToRemoveAfter:h=[],removeOldComponentWithMoveOut:c,...l}=i,p=[],u;e||(e=t),typeof d=="string"&&(d=[d]),typeof h=="string"&&(h=[h]);let m,T=g.find(t);if(T&&(m=t+"_temp_movein",g.editAlias(t,m),T instanceof B||T instanceof z?u=T.positionInfo:u={x:T.x,y:T.y,type:"pixel"}),e=tt(t,e,{zIndex:T?T.parent?.getChildIndex(T):void 0}),T?.parent?.setChildIndex(T,T.parent.getChildIndex(T)-.1),m&&g.copyCanvasElementProperty(m,t),m&&g.transferTickers(m,t,"move"),u||(e instanceof B||e instanceof z?u=e.positionInfo:u={x:e.x,y:e.y,type:"pixel"}),m)if(c){let f=Gt(m,{...i,autoplay:false,completeOnContinue:o},r);f&&(p.push(...f),d.push(...f));}else h.push(m);switch((e instanceof B||e instanceof z)&&e.haveEmptyTexture&&await e.load(),a){case "up":e.y=g.height+e.height;break;case "down":e.y=-e.height;break;case "left":e.x=g.width+e.width;break;case "right":e.x=-e.width;break}let S=g.pauseTicker({canvasAlias:t});d.push(...S);let C=g.animate(t,Ut(u),{...l,tickerIdToResume:d,aliasToRemoveAfter:h,completeOnContinue:o},r);if(C&&p.push(C),p.length>0)return p}function Gt(t,e={},i){let{forceCompleteBeforeNext:r=true}=e,{direction:n="right",completeOnContinue:a=r,aliasToRemoveAfter:o=[],...d}=e;typeof o=="string"&&(o=[o]),o.push(t);let h=g.find(t);if(!h){I.warn(`The canvas component "${t}" is not found.`);return}let c={x:h.x,y:h.y};switch(n){case "up":c.y=-h.height;break;case "down":c.y=g.height+h.height;break;case "left":c.x=-h.width;break;case "right":c.x=g.width+h.width;break}g.pauseTicker({canvasAlias:t});let l=g.animate(t,c,{...d,aliasToRemoveAfter:o,completeOnContinue:a},i);if(l)return [l]}async function vr(t,e,i={},r){let{forceCompleteBeforeNext:n=true}=i,{direction:a="right",completeOnContinue:o=n,tickerIdToResume:d=[],aliasToRemoveAfter:h=[],...c}=i,l=[],p;e||(e=t),typeof d=="string"&&(d=[d]),typeof h=="string"&&(h=[h]);let u,m=g.find(t);m&&(u=t+"_temp_zoom",g.editAlias(t,u),m instanceof B||m instanceof z?p=m.positionInfo:p={x:m.x,y:m.y,type:"pixel"}),e=tt(t,e,{zIndex:m?m.parent?.getChildIndex(m):void 0}),m?.parent?.setChildIndex(m,m.parent.getChildIndex(m)-.1),u&&g.copyCanvasElementProperty(u,t),u&&g.transferTickers(u,t,"move"),p||(e instanceof B||e instanceof z?p=e.positionInfo:p={x:e.x,y:e.y,type:"pixel"});let T={x:e.pivot.x,y:e.pivot.y},S={x:e.scale.x,y:e.scale.y};if(u)if(i.removeOldComponentWithZoomOut){let P=bi(u,{...i,autoplay:false,completeOnContinue:o},r);P&&(l.push(...P),d.push(...P));}else h.push(u);(e instanceof B||e instanceof z)&&e.haveEmptyTexture&&await e.load(),a==="up"?(e.pivot.y=g.height-e.y,e.pivot.x=g.width/2-e.x,e.y=g.height,e.x=g.width/2):a==="down"?(e.pivot.y=0-e.y,e.pivot.x=g.width/2-e.x,e.y=0,e.x=g.width/2):a==="left"?(e.pivot.x=g.width-e.x,e.pivot.y=g.height/2-e.y,e.x=g.width,e.y=g.height/2):a==="right"&&(e.pivot.x=0-e.x,e.pivot.y=g.height/2-e.y,e.x=0,e.y=g.height/2),e.pivot=exports.CanvasPropertyUtility.getPointBySuperPoint(e.pivot,e.angle),e.scale.set(0);let C=g.pauseTicker({canvasAlias:t});d.push(...C);let f=g.animate(t,{...Ut(p),pivotX:T.x,pivotY:T.y,scaleX:S.x,scaleY:S.y},{...c,tickerIdToResume:d,aliasToRemoveAfter:h,completeOnContinue:o},r);if(f&&l.push(f),l.length>0)return l}function bi(t,e={},i){let{forceCompleteBeforeNext:r=true}=e,{direction:n="right",completeOnContinue:a=r,aliasToRemoveAfter:o=[],...d}=e;typeof o=="string"&&(o=[o]),o.push(t);let h=g.find(t);if(!h){I.warn(`The canvas component "${t}" is not found.`);return}let c={x:h.x,y:h.y},l={x:h.pivot.x,y:h.pivot.y};n==="down"?(c.y=g.height,c.x=g.width/2,l.y=g.height-c.y,l.x=g.width/2-c.x):n==="up"?(c.y=0,c.x=g.width/2,l.y=0-c.y,l.x=g.width/2-c.x):n==="right"?(c.x=g.width,c.y=g.height/2,l.x=g.width-c.x,l.y=g.height/2-c.y):n==="left"&&(c.x=0,c.y=g.height/2,l.x=0-c.x,l.y=g.height/2-c.y),l=exports.CanvasPropertyUtility.getPointBySuperPoint(l,h.angle),g.pauseTicker({canvasAlias:t});let p=g.animate(t,{...c,pivotX:l.x,pivotY:l.y,scaleX:0,scaleY:0},{...d,aliasToRemoveAfter:o,completeOnContinue:a},i);if(p)return [p]}async function Pr(t,e,i={},r){let{forceCompleteBeforeNext:n=true}=i,{direction:a="right",completeOnContinue:o=n,tickerIdToResume:d=[],...h}=i,c=[],l;e||(e=t),typeof d=="string"&&(d=[d]);let p,u=g.find(t);switch(u&&(p=t+"_temp_push",g.editAlias(t,p),u instanceof B||u instanceof z?l=u.positionInfo:l={x:u.x,y:u.y,type:"pixel"}),e=tt(t,e,{zIndex:u?u.parent?.getChildIndex(u):void 0}),u?.parent?.setChildIndex(u,u.parent.getChildIndex(u)-.1),p&&g.copyCanvasElementProperty(p,t),p&&g.transferTickers(p,t,"move"),l||((e instanceof B||e instanceof z)&&e.haveEmptyTexture?l=e.positionInfo:l={x:e.x,y:e.y,type:"pixel"}),(e instanceof B||e instanceof z)&&e.haveEmptyTexture&&await e.load(),a){case "up":e.y=g.height+e.height;break;case "down":e.y=-e.height;break;case "left":e.x=g.width+e.width;break;case "right":e.x=-e.width;break}let m=g.pauseTicker({canvasAlias:t});if(d.push(...m),p){let S=Ai(p,{...i,direction:a,completeOnContinue:o});S&&c.push(...S);}let T=g.animate(t,Ut(l),{...h,tickerIdToResume:d,completeOnContinue:o},r);if(T&&c.push(T),c.length>0)return c}function Ai(t,e={direction:"right"},i){return Gt(t,e,i)}var it=class extends xe{constructor(i){super(i);this._memory=i;this.pixivnId=i.pixivnId;}_memory;pixivnId;get memory(){return {...this._memory,...super.memory,elements:[],pixivnId:this.pixivnId}}};function Sr(){return async(e,i)=>{try{let r=e.canvasElementInfo;if(r){let n=new it(r),a=r.zIndex;n.groupColor=16711680;let o=new Ee__default.default.Graphics;o.rect(0,0,300,100).fill({color:16711680,alpha:.5}),n.addChild(o);let d=new Ee__default.default.Text({text:`Error: ${r.label}`,x:10,y:10});n.addChild(d);let h=e.parent;if(h&&"addChild"in h)a!==void 0?h.addChildAt(n,a):h.addChild(n);else {let c=r.parentLabel?g.find(r.parentLabel):void 0;if(c)a!==void 0?c.addChildAt(n,a):c.addChild(n);else {let l=r.label??r.pixivnId;g.add(l,n,{zIndex:a});}}}}catch{}}}function Ir(t,e,i){let r={...g.find(t)?.memory,...i},n=new Re({text:e,...i});return r&&g.copyCanvasElementProperty(r,n),g.add(t,n,{ignoreOldStyle:true,zIndex:i?.zIndex}),n}var {Assets:zo,Color:Ho,Rectangle:No,TextStyle:Wo,Texture:Fo,UPDATE_PRIORITY:Vo}=Ee__default.default,g=new Ze;F.init({getScreen:()=>g.screen});core.GameUnifier.addOnPreContinue(async()=>{try{let t=y._tickersToCompleteOnStepEnd.tikersIds,e=y._tickersToCompleteOnStepEnd.stepAlias,i=(async()=>{for(;t.length;){let{id:n}=t.pop()||{};n&&await g.forceCompletionOfTicker(n);}})(),r=(async()=>{for(;e.length;){let{alias:n,id:a}=e.pop()||{};n&&a&&await g.forceCompletionOfTicker(a,n);}})();await Promise.all([i,r]),y._tickersToCompleteOnStepEnd.tikersIds.length=0,y._tickersToCompleteOnStepEnd.stepAlias.length=0;}catch{}});
2
- exports.Assets=zo;exports.CanvasBaseItem=Tt;exports.CanvasManagerStatic=y;exports.Color=Ho;exports.Container=xe;exports.ImageContainer=z;exports.ImageSprite=B;exports.Rectangle=No;exports.RegisteredCanvasComponents=U;exports.RegisteredEvents=Lt;exports.RegisteredTickers=Me;exports.Sprite=Oe;exports.Text=Re;exports.TextStyle=Wo;exports.Texture=Fo;exports.TickerBase=ut;exports.UPDATE_PRIORITY=Vo;exports.VideoSprite=ye;exports.addImage=Pt;exports.addImageCointainer=vt;exports.addListenerHandler=Ae;exports.addVideo=St;exports.analizePositionsExtensionProps=pe;exports.canvas=g;exports.canvasComponentDecorator=Vi;exports.drawCanvasErrorHandler=Sr;exports.eventDecorator=Fi;exports.getTexture=Qe;exports.moveIn=Tr;exports.moveOut=Gt;exports.pushIn=Pr;exports.pushOut=Ai;exports.removeWithDissolve=It;exports.removeWithFade=xr;exports.setMemoryContainer=te;exports.shakeEffect=ur;exports.showImage=gr;exports.showImageContainer=fr;exports.showText=Ir;exports.showVideo=yr;exports.showWithDissolve=Ci;exports.showWithFade=mr;exports.tickerDecorator=Zi;exports.zoomIn=vr;exports.zoomOut=bi;
1
+ 'use strict';var core=require('@drincs/pixi-vn/core'),Ee=require('@drincs/pixi-vn/pixi.js'),devtools=require('@pixi/devtools');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var Ee__default=/*#__PURE__*/_interopDefault(Ee);var ki=Object.create;var _t=Object.defineProperty;var wi=Object.getOwnPropertyDescriptor;var Mi=Object.getOwnPropertyNames;var Oi=Object.getPrototypeOf,Ri=Object.prototype.hasOwnProperty;var jt=t=>{throw TypeError(t)};var Bi=(t,e,i)=>e in t?_t(t,e,{enumerable:true,configurable:true,writable:true,value:i}):t[e]=i;var bt=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,i)=>(typeof require<"u"?require:e)[i]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var $t=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Di=(t,e,i,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Mi(e))!Ri.call(t,n)&&n!==i&&_t(t,n,{get:()=>e[n],enumerable:!(r=wi(e,n))||r.enumerable});return t};var Xt=(t,e,i)=>(i=t!=null?ki(Oi(t)):{},Di(_t(i,"default",{value:t,enumerable:true}),t));var Y=(t,e,i)=>Bi(t,typeof e!="symbol"?e+"":e,i),At=(t,e,i)=>e.has(t)||jt("Cannot "+i);var s=(t,e,i)=>(At(t,e,"read from private field"),i?i.call(t):e.get(t)),M=(t,e,i)=>e.has(t)?jt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),b=(t,e,i,r)=>(At(t,e,"write to private field"),e.set(t,i),i),C=(t,e,i)=>(At(t,e,"access private method"),i);var rt=(t,e,i,r)=>({set _(n){b(t,e,n);},get _(){return s(t,e,r)}});var Zt=$t((st,Jt)=>{(function(t,e){typeof st=="object"?Jt.exports=st=e():typeof define=="function"&&define.amd?define([],e):t.CryptoJS=e();})(st,function(){var t=t||(function(e,i){var r;if(typeof window<"u"&&window.crypto&&(r=window.crypto),typeof self<"u"&&self.crypto&&(r=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(r=globalThis.crypto),!r&&typeof window<"u"&&window.msCrypto&&(r=window.msCrypto),!r&&typeof global<"u"&&global.crypto&&(r=global.crypto),!r&&typeof bt=="function")try{r=bt("crypto");}catch{}var n=function(){if(r){if(typeof r.getRandomValues=="function")try{return r.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof r.randomBytes=="function")try{return r.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},a=Object.create||(function(){function f(){}return function(P){var k;return f.prototype=P,k=new f,f.prototype=null,k}})(),o={},d=o.lib={},h=d.Base=(function(){return {extend:function(f){var P=a(this);return f&&P.mixIn(f),(!P.hasOwnProperty("init")||this.init===P.init)&&(P.init=function(){P.$super.init.apply(this,arguments);}),P.init.prototype=P,P.$super=this,P},create:function(){var f=this.extend();return f.init.apply(f,arguments),f},init:function(){},mixIn:function(f){for(var P in f)f.hasOwnProperty(P)&&(this[P]=f[P]);f.hasOwnProperty("toString")&&(this.toString=f.toString);},clone:function(){return this.init.prototype.extend(this)}}})(),c=d.WordArray=h.extend({init:function(f,P){f=this.words=f||[],P!=i?this.sigBytes=P:this.sigBytes=f.length*4;},toString:function(f){return (f||p).stringify(this)},concat:function(f){var P=this.words,k=f.words,E=this.sigBytes,w=f.sigBytes;if(this.clamp(),E%4)for(var D=0;D<w;D++){var ue=k[D>>>2]>>>24-D%4*8&255;P[E+D>>>2]|=ue<<24-(E+D)%4*8;}else for(var V=0;V<w;V+=4)P[E+V>>>2]=k[V>>>2];return this.sigBytes+=w,this},clamp:function(){var f=this.words,P=this.sigBytes;f[P>>>2]&=4294967295<<32-P%4*8,f.length=e.ceil(P/4);},clone:function(){var f=h.clone.call(this);return f.words=this.words.slice(0),f},random:function(f){for(var P=[],k=0;k<f;k+=4)P.push(n());return new c.init(P,f)}}),l=o.enc={},p=l.Hex={stringify:function(f){for(var P=f.words,k=f.sigBytes,E=[],w=0;w<k;w++){var D=P[w>>>2]>>>24-w%4*8&255;E.push((D>>>4).toString(16)),E.push((D&15).toString(16));}return E.join("")},parse:function(f){for(var P=f.length,k=[],E=0;E<P;E+=2)k[E>>>3]|=parseInt(f.substr(E,2),16)<<24-E%8*4;return new c.init(k,P/2)}},u=l.Latin1={stringify:function(f){for(var P=f.words,k=f.sigBytes,E=[],w=0;w<k;w++){var D=P[w>>>2]>>>24-w%4*8&255;E.push(String.fromCharCode(D));}return E.join("")},parse:function(f){for(var P=f.length,k=[],E=0;E<P;E++)k[E>>>2]|=(f.charCodeAt(E)&255)<<24-E%4*8;return new c.init(k,P)}},m=l.Utf8={stringify:function(f){try{return decodeURIComponent(escape(u.stringify(f)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(f){return u.parse(unescape(encodeURIComponent(f)))}},T=d.BufferedBlockAlgorithm=h.extend({reset:function(){this._data=new c.init,this._nDataBytes=0;},_append:function(f){typeof f=="string"&&(f=m.parse(f)),this._data.concat(f),this._nDataBytes+=f.sigBytes;},_process:function(f){var P,k=this._data,E=k.words,w=k.sigBytes,D=this.blockSize,ue=D*4,V=w/ue;f?V=e.ceil(V):V=e.max((V|0)-this._minBufferSize,0);var ie=V*D,Be=e.min(ie*4,w);if(ie){for(var Ct=0;Ct<ie;Ct+=D)this._doProcessBlock(E,Ct);P=E.splice(0,ie),k.sigBytes-=Be;}return new c.init(P,Be)},clone:function(){var f=h.clone.call(this);return f._data=this._data.clone(),f},_minBufferSize:0});d.Hasher=T.extend({cfg:h.extend(),init:function(f){this.cfg=this.cfg.extend(f),this.reset();},reset:function(){T.reset.call(this),this._doReset();},update:function(f){return this._append(f),this._process(),this},finalize:function(f){f&&this._append(f);var P=this._doFinalize();return P},blockSize:512/32,_createHelper:function(f){return function(P,k){return new f.init(k).finalize(P)}},_createHmacHelper:function(f){return function(P,k){return new _.HMAC.init(f,k).finalize(P)}}});var _=o.algo={};return o})(Math);return t});});var Et=$t((ot,Qt)=>{(function(t,e){typeof ot=="object"?Qt.exports=ot=e(Zt()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS);})(ot,function(t){return (function(){var e=t,i=e.lib,r=i.WordArray,n=i.Hasher,a=e.algo,o=[],d=a.SHA1=n.extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878,3285377520]);},_doProcessBlock:function(h,c){for(var l=this._hash.words,p=l[0],u=l[1],m=l[2],T=l[3],S=l[4],_=0;_<80;_++){if(_<16)o[_]=h[c+_]|0;else {var f=o[_-3]^o[_-8]^o[_-14]^o[_-16];o[_]=f<<1|f>>>31;}var P=(p<<5|p>>>27)+S+o[_];_<20?P+=(u&m|~u&T)+1518500249:_<40?P+=(u^m^T)+1859775393:_<60?P+=(u&m|u&T|m&T)-1894007588:P+=(u^m^T)-899497514,S=T,T=m,m=u<<30|u>>>2,u=p,p=P;}l[0]=l[0]+p|0,l[1]=l[1]+u|0,l[2]=l[2]+m|0,l[3]=l[3]+T|0,l[4]=l[4]+S|0;},_doFinalize:function(){var h=this._data,c=h.words,l=this._nDataBytes*8,p=h.sigBytes*8;return c[p>>>5]|=128<<24-p%32,c[(p+64>>>9<<4)+14]=Math.floor(l/4294967296),c[(p+64>>>9<<4)+15]=l,h.sigBytes=c.length*4,this._process(),this._hash},clone:function(){var h=n.clone.call(this);return h._hash=this._hash.clone(),h}});e.SHA1=n._createHelper(d),e.HmacSHA1=n._createHmacHelper(d);})(),t.SHA1});});var Li={extension:{type:"sceneProperties",name:"additional-positions"},testNode(t){return "xAlign"in t||"yAlign"in t||"percentageX"in t||"percentageY"in t||"positionType"in t},testProp(t){switch(t){case "xAlign":case "yAlign":case "percentageX":case "percentageY":case "positionType":return true;default:return false}},setProperty(t,e,i){switch(e){case "xAlign":"xAlign"in t&&(t.xAlign=i/100);break;case "yAlign":"yAlign"in t&&(t.yAlign=i/100);break;case "percentageX":"percentageX"in t&&(t.percentageX=i/100);break;case "percentageY":"percentageY"in t&&(t.percentageY=i/100);break}},getProperties(t){return [{value:t.positionType,prop:"positionType",entry:{section:"Transform",type:"text",label:"Position Type"}},{value:t.xAlign*100,prop:"xAlign",entry:{section:"Transform",type:"range",label:"X Align",tooltip:"0% is left, 100% is right",options:{min:0,max:100}}},{value:t.yAlign*100,prop:"yAlign",entry:{section:"Transform",type:"range",label:"Y Align",tooltip:"0% is top, 100% is bottom",options:{min:0,max:100}}},{value:t.percentageX*100,prop:"percentageX",entry:{section:"Transform",type:"range",label:"X Percentage Position",tooltip:"0% is left, 100% is right",options:{min:0,max:100}}},{value:t.percentageY*100,prop:"percentageY",entry:{section:"Transform",type:"range",label:"Y Percentage Position",tooltip:"0% is top, 100% is bottom",options:{min:0,max:100}}}]}},Kt=Li;var Xe="repeat";var re="__game_layer__",De="Container",nt="ImageContainer",Le="Image",ze="Sprite",He="Text",Ne="Video";var I;(n=>(n.log=(a,...o)=>console.log(`[Pixi\u2019VN] ${a}`,...o),n.warn=(a,...o)=>console.warn(`[Pixi\u2019VN] ${a}`,...o),n.error=(a,...o)=>console.error(`[Pixi\u2019VN] ${a}`,...o),n.info=(a,...o)=>console.info(`[Pixi\u2019VN] ${a}`,...o)))(I||={});function qt(t,e){let i=0;return async(...r)=>{let n=Date.now();if(n-i>=e)return i=n,await t(...r)}}var ii=Xt(Et()),y=class t{constructor(){}static _app=void 0;static get app(){if(!t._app)throw I.error("The canvas is not initialized"),new core.PixiError("invalid_usage","CanvasManagerStatic.app is undefined");return t._app}static get gameLayer(){let e=t.app.stage.getChildByLabel(re);return e||(e=new Ee__default.default.Container,e.label=re,t.app.stage.addChild(e)),e}static htmlLayers=[];static canvasWidth=300;static canvasHeight=300;static _isInitialized=false;static async init(e,i,r){let{id:n="pixi-vn-canvas",width:a=800,height:o=600,resolution:d=1,autoDensity:h=true,resizeMode:c="contain",...l}=i||{};return t.canvasWidth=a,t.canvasHeight=o,t._app=new Ee__default.default.Application,t.app.init({width:a,height:o,resolution:d,autoDensity:h,...l}).then(()=>{let{app:p=t.app,extensions:u=[],...m}=r||{};if(devtools.initDevtools({app:p,extensions:[Kt,...u],...m}),t._isInitialized=true,t.addCanvasIntoHTMLElement(e,n),c==="contain"){let T=qt(async()=>{requestAnimationFrame(()=>t.resize());},10);new ResizeObserver(T).observe(e),t.resize(),setTimeout(()=>t.resize(),750);}t.gameLayer;})}static addCanvasIntoHTMLElement(e,i){t._isInitialized?(e.appendChild(t.app.canvas),t.app.canvas.id=i):I.error("GameWindowManager is not initialized");}static addHtmlLayer(e,i,r={}){let{position:n="absolute",pointerEvents:a="none",userSelect:o="none"}=r,d=document.createElement("div");d.setAttribute("id",e),d.style.position=n,d.style.pointerEvents=a,d.style.userSelect=o;let h=i.appendChild(d);return t.htmlLayers.push(d),t.resize(),h}static removeHtmlLayer(e){let i=t.htmlLayers.find(r=>r.id===e);i&&(i.remove(),t.htmlLayers=t.htmlLayers.filter(r=>r.id!==e));}static getHtmlLayer(e){return t.htmlLayers.find(i=>i.id===e)}static async resize(){let e=t.canvasWidth,i=t.canvasHeight,r=t.app.resizeTo,n=t.app.canvas.style;r instanceof HTMLElement||(r=document.documentElement);let a,o;if(r===document.body||r===document.documentElement)a=document.documentElement.clientWidth||window.innerWidth,o=document.documentElement.clientHeight||window.innerHeight;else {let u=r.getBoundingClientRect();a=u.width||r.clientWidth,o=u.height||r.clientHeight;}let d=Math.min(a/e,o/i),h=Math.floor(d*e),c=Math.floor(d*i);n.width=`${h}px`,n.height=`${c}px`;let l=(a-h)/2,p=(o-c)/2;n.marginLeft=`${l}px`,n.marginRight=`${l}px`,n.marginTop=`${p}px`,n.marginBottom=`${p}px`,t.htmlLayers.forEach(u=>{u.style.width=`${h}px`,u.style.height=`${c}px`,u.style.marginLeft=`${l}px`,u.style.marginRight=`${l}px`,u.style.marginTop=`${p}px`,u.style.marginBottom=`${p}px`;});}static get childrenAliasesOrder(){return t.gameLayer.children.filter(e=>e.label).sort((e,i)=>t.gameLayer.getChildIndex(e)-t.gameLayer.getChildIndex(i)).map(e=>e.label)}static get currentTickersWithoutCreatedBySteps(){return Object.fromEntries(Array.from(t._currentTickers.entries()).filter(([e,i])=>!i.createdByTicketSteps).map(([e,i])=>[e,{id:i.ticker.alias,args:i.ticker.args,canvasElementAliases:i.ticker.canvasElementAliases,priority:i.ticker.priority,duration:i.ticker.duration,paused:i.ticker.paused}]))}static _currentTickers=new Map;static _currentTickersSequence=new Map;static get currentTickersSequence(){return Object.fromEntries(Array.from(t._currentTickersSequence.entries()).map(([e,i])=>[e,Object.fromEntries(i)]))}static _currentTickersTimeouts=new Map;static _tickersToCompleteOnStepEnd={tikersIds:[],stepAlias:[]};static generateTickerId(...e){try{return `${(0,ii.default)(JSON.stringify(e)).toString()}_${Math.random().toString(36).substring(7)}`}catch(i){throw new core.PixiError("not_json_serializable",`Error to generate ticker id: ${i}`)}}static addTickerTimeoutInfo(e,i,r,n){typeof e=="string"&&(e=[e]),t._currentTickersTimeouts.set(r,{aliases:e,ticker:i,canBeDeletedBeforeEnd:n});}static removeTickerTimeoutInfo(e){typeof e!="string"&&(e=e.toString()),t._currentTickersTimeouts.delete(e);}static removeTickerTimeout(e){typeof e!="string"&&(e=e.toString()),clearTimeout(Number(e)),t.removeTickerTimeoutInfo(e);}static removeTickerTimeoutsByAlias(e,i){t._currentTickersTimeouts.forEach((r,n)=>{let a=r.aliases.filter(o=>o!==e);if(a.length===0){let o=r.canBeDeletedBeforeEnd;(!i||o)&&t.removeTickerTimeout(n);}else r.aliases=a;});}};var Hi=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,oi=new Set,kt=typeof process=="object"&&process?process:{},ai=(t,e,i,r)=>{typeof kt.emitWarning=="function"?kt.emitWarning(t,e,i,r):console.error(`[${i}] ${e}: ${t}`);},ht=globalThis.AbortController,ri=globalThis.AbortSignal;if(typeof ht>"u"){ri=class{onabort;_onabort=[];reason;aborted=false;addEventListener(i,r){this._onabort.push(r);}},ht=class{constructor(){e();}signal=new ri;abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=true;for(let r of this.signal._onabort)r(i);this.signal.onabort?.(i);}}};let t=kt.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{t&&(t=false,ai("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 Ni=t=>!oi.has(t);var Te=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),ci=t=>Te(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?at:null:null,at=class extends Array{constructor(t){super(t),this.fill(0);}},fe,We,Wi=(fe=class{heap;length;static create(e){let i=ci(e);if(!i)return [];b(fe,We,true);let r=new fe(e,i);return b(fe,We,false),r}constructor(e,i){if(!s(fe,We))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new i(e),this.length=0;}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}},We=new WeakMap,M(fe,We,false),fe),ni,si,Q,X,ne,Ce,se,Fe,Ve,oe,H,ae,L,R,A,j,K,G,N,ce,W,le,he,q,J,de,Ie,$,Ye,v,wt,_e,me,qe,Z,hi,be,Ue,Je,ve,Pe,Mt,ct,lt,O,Ot,Ke,Se,Rt,Ge,li=(Ge=class{constructor(e){M(this,v);M(this,Q);M(this,X);M(this,ne);M(this,Ce);M(this,se);M(this,Fe);M(this,Ve);M(this,oe);Y(this,"ttl");Y(this,"ttlResolution");Y(this,"ttlAutopurge");Y(this,"updateAgeOnGet");Y(this,"updateAgeOnHas");Y(this,"allowStale");Y(this,"noDisposeOnSet");Y(this,"noUpdateTTL");Y(this,"maxEntrySize");Y(this,"sizeCalculation");Y(this,"noDeleteOnFetchRejection");Y(this,"noDeleteOnStaleGet");Y(this,"allowStaleOnFetchAbort");Y(this,"allowStaleOnFetchRejection");Y(this,"ignoreFetchAbort");M(this,H);M(this,ae);M(this,L);M(this,R);M(this,A);M(this,j);M(this,K);M(this,G);M(this,N);M(this,ce);M(this,W);M(this,le);M(this,he);M(this,q);M(this,J);M(this,de);M(this,Ie);M(this,$);M(this,Ye);M(this,_e,()=>{});M(this,me,()=>{});M(this,qe,()=>{});M(this,Z,()=>false);M(this,be,e=>{});M(this,Ue,(e,i,r)=>{});M(this,Je,(e,i,r,n)=>{if(r||n)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});Y(this,ni,"LRUCache");let{max:i=0,ttl:r,ttlResolution:n=1,ttlAutopurge:a,updateAgeOnGet:o,updateAgeOnHas:d,allowStale:h,dispose:c,onInsert:l,disposeAfter:p,noDisposeOnSet:u,noUpdateTTL:m,maxSize:T=0,maxEntrySize:S=0,sizeCalculation:_,fetchMethod:f,memoMethod:P,noDeleteOnFetchRejection:k,noDeleteOnStaleGet:E,allowStaleOnFetchRejection:w,allowStaleOnFetchAbort:D,ignoreFetchAbort:ue,perf:V}=e;if(V!==void 0&&typeof V?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(b(this,oe,V??Hi),i!==0&&!Te(i))throw new TypeError("max option must be a nonnegative integer");let ie=i?ci(i):Array;if(!ie)throw new Error("invalid max value: "+i);if(b(this,Q,i),b(this,X,T),this.maxEntrySize=S||s(this,X),this.sizeCalculation=_,this.sizeCalculation){if(!s(this,X)&&!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(P!==void 0&&typeof P!="function")throw new TypeError("memoMethod must be a function if defined");if(b(this,Ve,P),f!==void 0&&typeof f!="function")throw new TypeError("fetchMethod must be a function if specified");if(b(this,Fe,f),b(this,Ie,!!f),b(this,L,new Map),b(this,R,new Array(i).fill(void 0)),b(this,A,new Array(i).fill(void 0)),b(this,j,new ie(i)),b(this,K,new ie(i)),b(this,G,0),b(this,N,0),b(this,ce,Wi.create(i)),b(this,H,0),b(this,ae,0),typeof c=="function"&&b(this,ne,c),typeof l=="function"&&b(this,Ce,l),typeof p=="function"?(b(this,se,p),b(this,W,[])):(b(this,se,void 0),b(this,W,void 0)),b(this,de,!!s(this,ne)),b(this,Ye,!!s(this,Ce)),b(this,$,!!s(this,se)),this.noDisposeOnSet=!!u,this.noUpdateTTL=!!m,this.noDeleteOnFetchRejection=!!k,this.allowStaleOnFetchRejection=!!w,this.allowStaleOnFetchAbort=!!D,this.ignoreFetchAbort=!!ue,this.maxEntrySize!==0){if(s(this,X)!==0&&!Te(s(this,X)))throw new TypeError("maxSize must be a positive integer if specified");if(!Te(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");C(this,v,hi).call(this);}if(this.allowStale=!!h,this.noDeleteOnStaleGet=!!E,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!d,this.ttlResolution=Te(n)||n===0?n:1,this.ttlAutopurge=!!a,this.ttl=r||0,this.ttl){if(!Te(this.ttl))throw new TypeError("ttl must be a positive integer if specified");C(this,v,wt).call(this);}if(s(this,Q)===0&&this.ttl===0&&s(this,X)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!s(this,Q)&&!s(this,X)){let Be="LRU_CACHE_UNBOUNDED";Ni(Be)&&(oi.add(Be),ai("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",Be,Ge));}}get perf(){return s(this,oe)}static unsafeExposeInternals(e){return {starts:s(e,he),ttls:s(e,q),autopurgeTimers:s(e,J),sizes:s(e,le),keyMap:s(e,L),keyList:s(e,R),valList:s(e,A),next:s(e,j),prev:s(e,K),get head(){return s(e,G)},get tail(){return s(e,N)},free:s(e,ce),isBackgroundFetch:i=>{var r;return C(r=e,v,O).call(r,i)},backgroundFetch:(i,r,n,a)=>{var o;return C(o=e,v,lt).call(o,i,r,n,a)},moveToTail:i=>{var r;return C(r=e,v,Ke).call(r,i)},indexes:i=>{var r;return C(r=e,v,ve).call(r,i)},rindexes:i=>{var r;return C(r=e,v,Pe).call(r,i)},isStale:i=>{var r;return s(r=e,Z).call(r,i)}}}get max(){return s(this,Q)}get maxSize(){return s(this,X)}get calculatedSize(){return s(this,ae)}get size(){return s(this,H)}get fetchMethod(){return s(this,Fe)}get memoMethod(){return s(this,Ve)}get dispose(){return s(this,ne)}get onInsert(){return s(this,Ce)}get disposeAfter(){return s(this,se)}getRemainingTTL(e){return s(this,L).has(e)?1/0:0}*entries(){for(let e of C(this,v,ve).call(this))s(this,A)[e]!==void 0&&s(this,R)[e]!==void 0&&!C(this,v,O).call(this,s(this,A)[e])&&(yield [s(this,R)[e],s(this,A)[e]]);}*rentries(){for(let e of C(this,v,Pe).call(this))s(this,A)[e]!==void 0&&s(this,R)[e]!==void 0&&!C(this,v,O).call(this,s(this,A)[e])&&(yield [s(this,R)[e],s(this,A)[e]]);}*keys(){for(let e of C(this,v,ve).call(this)){let i=s(this,R)[e];i!==void 0&&!C(this,v,O).call(this,s(this,A)[e])&&(yield i);}}*rkeys(){for(let e of C(this,v,Pe).call(this)){let i=s(this,R)[e];i!==void 0&&!C(this,v,O).call(this,s(this,A)[e])&&(yield i);}}*values(){for(let e of C(this,v,ve).call(this))s(this,A)[e]!==void 0&&!C(this,v,O).call(this,s(this,A)[e])&&(yield s(this,A)[e]);}*rvalues(){for(let e of C(this,v,Pe).call(this))s(this,A)[e]!==void 0&&!C(this,v,O).call(this,s(this,A)[e])&&(yield s(this,A)[e]);}[(si=Symbol.iterator,ni=Symbol.toStringTag,si)](){return this.entries()}find(e,i={}){for(let r of C(this,v,ve).call(this)){let n=s(this,A)[r],a=C(this,v,O).call(this,n)?n.__staleWhileFetching:n;if(a!==void 0&&e(a,s(this,R)[r],this))return this.get(s(this,R)[r],i)}}forEach(e,i=this){for(let r of C(this,v,ve).call(this)){let n=s(this,A)[r],a=C(this,v,O).call(this,n)?n.__staleWhileFetching:n;a!==void 0&&e.call(i,a,s(this,R)[r],this);}}rforEach(e,i=this){for(let r of C(this,v,Pe).call(this)){let n=s(this,A)[r],a=C(this,v,O).call(this,n)?n.__staleWhileFetching:n;a!==void 0&&e.call(i,a,s(this,R)[r],this);}}purgeStale(){let e=false;for(let i of C(this,v,Pe).call(this,{allowStale:true}))s(this,Z).call(this,i)&&(C(this,v,Se).call(this,s(this,R)[i],"expire"),e=true);return e}info(e){let i=s(this,L).get(e);if(i===void 0)return;let r=s(this,A)[i],n=C(this,v,O).call(this,r)?r.__staleWhileFetching:r;if(n===void 0)return;let a={value:n};if(s(this,q)&&s(this,he)){let o=s(this,q)[i],d=s(this,he)[i];if(o&&d){let h=o-(s(this,oe).now()-d);a.ttl=h,a.start=Date.now();}}return s(this,le)&&(a.size=s(this,le)[i]),a}dump(){let e=[];for(let i of C(this,v,ve).call(this,{allowStale:true})){let r=s(this,R)[i],n=s(this,A)[i],a=C(this,v,O).call(this,n)?n.__staleWhileFetching:n;if(a===void 0||r===void 0)continue;let o={value:a};if(s(this,q)&&s(this,he)){o.ttl=s(this,q)[i];let d=s(this,oe).now()-s(this,he)[i];o.start=Math.floor(Date.now()-d);}s(this,le)&&(o.size=s(this,le)[i]),e.unshift([r,o]);}return e}load(e){this.clear();for(let[i,r]of e){if(r.start){let n=Date.now()-r.start;r.start=s(this,oe).now()-n;}this.set(i,r.value,r);}}set(e,i,r={}){var u,m,T,S;if(i===void 0)return this.delete(e),this;let{ttl:n=this.ttl,start:a,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:d=this.sizeCalculation,status:h}=r,{noUpdateTTL:c=this.noUpdateTTL}=r,l=s(this,Je).call(this,e,i,r.size||0,d);if(this.maxEntrySize&&l>this.maxEntrySize)return h&&(h.set="miss",h.maxEntrySizeExceeded=true),C(this,v,Se).call(this,e,"set"),this;let p=s(this,H)===0?void 0:s(this,L).get(e);if(p===void 0)p=s(this,H)===0?s(this,N):s(this,ce).length!==0?s(this,ce).pop():s(this,H)===s(this,Q)?C(this,v,ct).call(this,false):s(this,H),s(this,R)[p]=e,s(this,A)[p]=i,s(this,L).set(e,p),s(this,j)[s(this,N)]=p,s(this,K)[p]=s(this,N),b(this,N,p),rt(this,H)._++,s(this,Ue).call(this,p,l,h),h&&(h.set="add"),c=false,s(this,Ye)&&((u=s(this,Ce))==null||u.call(this,i,e,"add"));else {C(this,v,Ke).call(this,p);let _=s(this,A)[p];if(i!==_){if(s(this,Ie)&&C(this,v,O).call(this,_)){_.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:f}=_;f!==void 0&&!o&&(s(this,de)&&((m=s(this,ne))==null||m.call(this,f,e,"set")),s(this,$)&&s(this,W)?.push([f,e,"set"]));}else o||(s(this,de)&&((T=s(this,ne))==null||T.call(this,_,e,"set")),s(this,$)&&s(this,W)?.push([_,e,"set"]));if(s(this,be).call(this,p),s(this,Ue).call(this,p,l,h),s(this,A)[p]=i,h){h.set="replace";let f=_&&C(this,v,O).call(this,_)?_.__staleWhileFetching:_;f!==void 0&&(h.oldValue=f);}}else h&&(h.set="update");s(this,Ye)&&this.onInsert?.(i,e,i===_?"update":"replace");}if(n!==0&&!s(this,q)&&C(this,v,wt).call(this),s(this,q)&&(c||s(this,qe).call(this,p,n,a),h&&s(this,me).call(this,h,p)),!o&&s(this,$)&&s(this,W)){let _=s(this,W),f;for(;f=_?.shift();)(S=s(this,se))==null||S.call(this,...f);}return this}pop(){var e;try{for(;s(this,H);){let i=s(this,A)[s(this,G)];if(C(this,v,ct).call(this,!0),C(this,v,O).call(this,i)){if(i.__staleWhileFetching)return i.__staleWhileFetching}else if(i!==void 0)return i}}finally{if(s(this,$)&&s(this,W)){let i=s(this,W),r;for(;r=i?.shift();)(e=s(this,se))==null||e.call(this,...r);}}}has(e,i={}){let{updateAgeOnHas:r=this.updateAgeOnHas,status:n}=i,a=s(this,L).get(e);if(a!==void 0){let o=s(this,A)[a];if(C(this,v,O).call(this,o)&&o.__staleWhileFetching===void 0)return false;if(s(this,Z).call(this,a))n&&(n.has="stale",s(this,me).call(this,n,a));else return r&&s(this,_e).call(this,a),n&&(n.has="hit",s(this,me).call(this,n,a)),true}else n&&(n.has="miss");return false}peek(e,i={}){let{allowStale:r=this.allowStale}=i,n=s(this,L).get(e);if(n===void 0||!r&&s(this,Z).call(this,n))return;let a=s(this,A)[n];return C(this,v,O).call(this,a)?a.__staleWhileFetching:a}async fetch(e,i={}){let{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:a=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:d=this.noDisposeOnSet,size:h=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:p=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:u=this.allowStaleOnFetchRejection,ignoreFetchAbort:m=this.ignoreFetchAbort,allowStaleOnFetchAbort:T=this.allowStaleOnFetchAbort,context:S,forceRefresh:_=false,status:f,signal:P}=i;if(!s(this,Ie))return f&&(f.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:a,status:f});let k={allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:a,ttl:o,noDisposeOnSet:d,size:h,sizeCalculation:c,noUpdateTTL:l,noDeleteOnFetchRejection:p,allowStaleOnFetchRejection:u,allowStaleOnFetchAbort:T,ignoreFetchAbort:m,status:f,signal:P},E=s(this,L).get(e);if(E===void 0){f&&(f.fetch="miss");let w=C(this,v,lt).call(this,e,E,k,S);return w.__returned=w}else {let w=s(this,A)[E];if(C(this,v,O).call(this,w)){let ie=r&&w.__staleWhileFetching!==void 0;return f&&(f.fetch="inflight",ie&&(f.returnedStale=true)),ie?w.__staleWhileFetching:w.__returned=w}let D=s(this,Z).call(this,E);if(!_&&!D)return f&&(f.fetch="hit"),C(this,v,Ke).call(this,E),n&&s(this,_e).call(this,E),f&&s(this,me).call(this,f,E),w;let ue=C(this,v,lt).call(this,e,E,k,S),V=ue.__staleWhileFetching!==void 0&&r;return f&&(f.fetch=D?"stale":"refresh",V&&D&&(f.returnedStale=true)),V?ue.__staleWhileFetching:ue.__returned=ue}}async forceFetch(e,i={}){let r=await this.fetch(e,i);if(r===void 0)throw new Error("fetch() returned undefined");return r}memo(e,i={}){let r=s(this,Ve);if(!r)throw new Error("no memoMethod provided to constructor");let{context:n,forceRefresh:a,...o}=i,d=this.get(e,o);if(!a&&d!==void 0)return d;let h=r(e,d,{options:o,context:n});return this.set(e,h,o),h}get(e,i={}){let{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:a=this.noDeleteOnStaleGet,status:o}=i,d=s(this,L).get(e);if(d!==void 0){let h=s(this,A)[d],c=C(this,v,O).call(this,h);return o&&s(this,me).call(this,o,d),s(this,Z).call(this,d)?(o&&(o.get="stale"),c?(o&&r&&h.__staleWhileFetching!==void 0&&(o.returnedStale=true),r?h.__staleWhileFetching:void 0):(a||C(this,v,Se).call(this,e,"expire"),o&&r&&(o.returnedStale=true),r?h:void 0)):(o&&(o.get="hit"),c?h.__staleWhileFetching:(C(this,v,Ke).call(this,d),n&&s(this,_e).call(this,d),h))}else o&&(o.get="miss");}delete(e){return C(this,v,Se).call(this,e,"delete")}clear(){return C(this,v,Rt).call(this,"delete")}},Q=new WeakMap,X=new WeakMap,ne=new WeakMap,Ce=new WeakMap,se=new WeakMap,Fe=new WeakMap,Ve=new WeakMap,oe=new WeakMap,H=new WeakMap,ae=new WeakMap,L=new WeakMap,R=new WeakMap,A=new WeakMap,j=new WeakMap,K=new WeakMap,G=new WeakMap,N=new WeakMap,ce=new WeakMap,W=new WeakMap,le=new WeakMap,he=new WeakMap,q=new WeakMap,J=new WeakMap,de=new WeakMap,Ie=new WeakMap,$=new WeakMap,Ye=new WeakMap,v=new WeakSet,wt=function(){let e=new at(s(this,Q)),i=new at(s(this,Q));b(this,q,e),b(this,he,i);let r=this.ttlAutopurge?new Array(s(this,Q)):void 0;b(this,J,r),b(this,qe,(d,h,c=s(this,oe).now())=>{i[d]=h!==0?c:0,e[d]=h,n(d,h);}),b(this,_e,d=>{i[d]=e[d]!==0?s(this,oe).now():0,n(d,e[d]);});let n=this.ttlAutopurge?(d,h)=>{if(r?.[d]&&(clearTimeout(r[d]),r[d]=void 0),h&&h!==0&&r){let c=setTimeout(()=>{s(this,Z).call(this,d)&&C(this,v,Se).call(this,s(this,R)[d],"expire");},h+1);c.unref&&c.unref(),r[d]=c;}}:()=>{};b(this,me,(d,h)=>{if(e[h]){let c=e[h],l=i[h];if(!c||!l)return;d.ttl=c,d.start=l,d.now=a||o();let p=d.now-l;d.remainingTTL=c-p;}});let a=0,o=()=>{let d=s(this,oe).now();if(this.ttlResolution>0){a=d;let h=setTimeout(()=>a=0,this.ttlResolution);h.unref&&h.unref();}return d};this.getRemainingTTL=d=>{let h=s(this,L).get(d);if(h===void 0)return 0;let c=e[h],l=i[h];if(!c||!l)return 1/0;let p=(a||o())-l;return c-p},b(this,Z,d=>{let h=i[d],c=e[d];return !!c&&!!h&&(a||o())-h>c});},_e=new WeakMap,me=new WeakMap,qe=new WeakMap,Z=new WeakMap,hi=function(){let e=new at(s(this,Q));b(this,ae,0),b(this,le,e),b(this,be,i=>{b(this,ae,s(this,ae)-e[i]),e[i]=0;}),b(this,Je,(i,r,n,a)=>{if(C(this,v,O).call(this,r))return 0;if(!Te(n))if(a){if(typeof a!="function")throw new TypeError("sizeCalculation must be a function");if(n=a(r,i),!Te(n))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 n}),b(this,Ue,(i,r,n)=>{if(e[i]=r,s(this,X)){let a=s(this,X)-e[i];for(;s(this,ae)>a;)C(this,v,ct).call(this,true);}b(this,ae,s(this,ae)+e[i]),n&&(n.entrySize=r,n.totalCalculatedSize=s(this,ae));});},be=new WeakMap,Ue=new WeakMap,Je=new WeakMap,ve=function*({allowStale:e=this.allowStale}={}){if(s(this,H))for(let i=s(this,N);!(!C(this,v,Mt).call(this,i)||((e||!s(this,Z).call(this,i))&&(yield i),i===s(this,G)));)i=s(this,K)[i];},Pe=function*({allowStale:e=this.allowStale}={}){if(s(this,H))for(let i=s(this,G);!(!C(this,v,Mt).call(this,i)||((e||!s(this,Z).call(this,i))&&(yield i),i===s(this,N)));)i=s(this,j)[i];},Mt=function(e){return e!==void 0&&s(this,L).get(s(this,R)[e])===e},ct=function(e){var a;let i=s(this,G),r=s(this,R)[i],n=s(this,A)[i];return s(this,Ie)&&C(this,v,O).call(this,n)?n.__abortController.abort(new Error("evicted")):(s(this,de)||s(this,$))&&(s(this,de)&&((a=s(this,ne))==null||a.call(this,n,r,"evict")),s(this,$)&&s(this,W)?.push([n,r,"evict"])),s(this,be).call(this,i),s(this,J)?.[i]&&(clearTimeout(s(this,J)[i]),s(this,J)[i]=void 0),e&&(s(this,R)[i]=void 0,s(this,A)[i]=void 0,s(this,ce).push(i)),s(this,H)===1?(b(this,G,b(this,N,0)),s(this,ce).length=0):b(this,G,s(this,j)[i]),s(this,L).delete(r),rt(this,H)._--,i},lt=function(e,i,r,n){let a=i===void 0?void 0:s(this,A)[i];if(C(this,v,O).call(this,a))return a;let o=new ht,{signal:d}=r;d?.addEventListener("abort",()=>o.abort(d.reason),{signal:o.signal});let h={signal:o.signal,options:r,context:n},c=(S,_=false)=>{let{aborted:f}=o.signal,P=r.ignoreFetchAbort&&S!==void 0,k=r.ignoreFetchAbort||!!(r.allowStaleOnFetchAbort&&S!==void 0);if(r.status&&(f&&!_?(r.status.fetchAborted=true,r.status.fetchError=o.signal.reason,P&&(r.status.fetchAbortIgnored=true)):r.status.fetchResolved=true),f&&!P&&!_)return p(o.signal.reason,k);let E=m,w=s(this,A)[i];return (w===m||P&&_&&w===void 0)&&(S===void 0?E.__staleWhileFetching!==void 0?s(this,A)[i]=E.__staleWhileFetching:C(this,v,Se).call(this,e,"fetch"):(r.status&&(r.status.fetchUpdated=true),this.set(e,S,h.options))),S},l=S=>(r.status&&(r.status.fetchRejected=true,r.status.fetchError=S),p(S,false)),p=(S,_)=>{let{aborted:f}=o.signal,P=f&&r.allowStaleOnFetchAbort,k=P||r.allowStaleOnFetchRejection,E=k||r.noDeleteOnFetchRejection,w=m;if(s(this,A)[i]===m&&(!E||!_&&w.__staleWhileFetching===void 0?C(this,v,Se).call(this,e,"fetch"):P||(s(this,A)[i]=w.__staleWhileFetching)),k)return r.status&&w.__staleWhileFetching!==void 0&&(r.status.returnedStale=true),w.__staleWhileFetching;if(w.__returned===w)throw S},u=(S,_)=>{var P;let f=(P=s(this,Fe))==null?void 0:P.call(this,e,a,h);f&&f instanceof Promise&&f.then(k=>S(k===void 0?void 0:k),_),o.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(S(void 0),r.allowStaleOnFetchAbort&&(S=k=>c(k,true)));});};r.status&&(r.status.fetchDispatched=true);let m=new Promise(u).then(c,l),T=Object.assign(m,{__abortController:o,__staleWhileFetching:a,__returned:void 0});return i===void 0?(this.set(e,T,{...h.options,status:void 0}),i=s(this,L).get(e)):s(this,A)[i]=T,T},O=function(e){if(!s(this,Ie))return false;let i=e;return !!i&&i instanceof Promise&&i.hasOwnProperty("__staleWhileFetching")&&i.__abortController instanceof ht},Ot=function(e,i){s(this,K)[i]=e,s(this,j)[e]=i;},Ke=function(e){e!==s(this,N)&&(e===s(this,G)?b(this,G,s(this,j)[e]):C(this,v,Ot).call(this,s(this,K)[e],s(this,j)[e]),C(this,v,Ot).call(this,s(this,N),e),b(this,N,e));},Se=function(e,i){var n,a;let r=false;if(s(this,H)!==0){let o=s(this,L).get(e);if(o!==void 0)if(s(this,J)?.[o]&&(clearTimeout(s(this,J)?.[o]),s(this,J)[o]=void 0),r=true,s(this,H)===1)C(this,v,Rt).call(this,i);else {s(this,be).call(this,o);let d=s(this,A)[o];if(C(this,v,O).call(this,d)?d.__abortController.abort(new Error("deleted")):(s(this,de)||s(this,$))&&(s(this,de)&&((n=s(this,ne))==null||n.call(this,d,e,i)),s(this,$)&&s(this,W)?.push([d,e,i])),s(this,L).delete(e),s(this,R)[o]=void 0,s(this,A)[o]=void 0,o===s(this,N))b(this,N,s(this,K)[o]);else if(o===s(this,G))b(this,G,s(this,j)[o]);else {let h=s(this,K)[o];s(this,j)[h]=s(this,j)[o];let c=s(this,j)[o];s(this,K)[c]=s(this,K)[o];}rt(this,H)._--,s(this,ce).push(o);}}if(s(this,$)&&s(this,W)?.length){let o=s(this,W),d;for(;d=o?.shift();)(a=s(this,se))==null||a.call(this,...d);}return r},Rt=function(e){var i,r;for(let n of C(this,v,Pe).call(this,{allowStale:true})){let a=s(this,A)[n];if(C(this,v,O).call(this,a))a.__abortController.abort(new Error("deleted"));else {let o=s(this,R)[n];s(this,de)&&((i=s(this,ne))==null||i.call(this,a,o,e)),s(this,$)&&s(this,W)?.push([a,o,e]);}}if(s(this,L).clear(),s(this,A).fill(void 0),s(this,R).fill(void 0),s(this,q)&&s(this,he)){s(this,q).fill(0),s(this,he).fill(0);for(let n of s(this,J)??[])n!==void 0&&clearTimeout(n);s(this,J)?.fill(void 0);}if(s(this,le)&&s(this,le).fill(0),b(this,G,0),b(this,N,0),s(this,ce).length=0,b(this,ae,0),b(this,H,0),s(this,$)&&s(this,W)){let n=s(this,W),a;for(;a=n?.shift();)(r=s(this,se))==null||r.call(this,...a);}},Ge);var ee=class{cache;map=new Map;constructor(e){this.cache=new li({max:e.cacheSize}),this.map=new Map;}get[Symbol.iterator](){return this.map[Symbol.iterator]}get[Symbol.toStringTag](){return this.map[Symbol.toStringTag]}clear(){this.cache.clear(),this.map.clear();}delete(e){let i=this.map.delete(e);return i&&this.cache.delete(e),i}get forEach(){return this.map.forEach}get(e){let i=this.cache.get(e);return i||this.map.get(e)}has(e){return this.map.has(e)}set(e,i){return this.map.set(e,i),this.cache.set(e,i),this}get size(){return this.map.size}entries(){return this.map.entries()}keys(){return this.map.keys()}values(){return this.map.values()}};var Bt=Symbol("SerializableEvent"),je=new ee({cacheSize:5});function Fi(t){return (e,i,r)=>{let n=r.value;Dt.add(n,t||`${i}`);}}var Dt;(a=>{function t(o,d){o[Bt]=d,je.get(d)&&I.info(`Event "${d}" already exists, it will be overwritten`),je.set(d,o);}a.add=t;function e(o){try{let d=je.get(o);if(!d){I.error(`Event "${o}" not found, did you forget to register it with the eventDecorator?`);return}return d}catch(d){I.error(`Error while getting Event "${o}"`,d);return}}a.get=e;function i(){return Array.from(je.values())}a.values=i;function r(o){return je.has(o)}a.has=r;function n(){return Array.from(je.keys())}a.keys=n;})(Dt||={});var Lt=Dt;async function di(t,e){if("onEvents"in e)for(let i in e.onEvents){let r=e.onEvents[i],n=Lt.get(r);n&&t.on(i,n);}}function pi(t){let{onEventsHandlers:e={}}=t;return e}function Ae(t,e,i){let r=i[Bt];return r&&typeof r=="string"?(e.onEventsHandlers[t]=r,true):(I.warn(`The event handler for event "${t}" is not registered with the eventDecorator, it will not be saved in the memory and it will not work after loading the game. Please register the event handler with the eventDecorator to avoid this warning. Read more about it here: https://pixi-vn.com/start/canvas-functions#add-a-listener-to-an-event`),false)}var $e=new ee({cacheSize:5}),ui=new ee({cacheSize:2}),fi=new ee({cacheSize:2});function Vi(t={}){return e=>{zt.add(e,t);}}async function te(t,e,i){let r=i?.ignoreScale||false,n=i?.end;"isRenderGroup"in e&&e.isRenderGroup!==void 0&&(t.isRenderGroup=e.isRenderGroup),"blendMode"in e&&e.blendMode!==void 0&&(t.blendMode=e.blendMode),"tint"in e&&e.tint!==void 0&&(t.tint=e.tint),"alpha"in e&&e.alpha!==void 0&&(t.alpha=e.alpha),"angle"in e&&e.angle!==void 0&&(t.angle=e.angle),"renderable"in e&&e.renderable!==void 0&&(t.renderable=e.renderable),"rotation"in e&&e.rotation!==void 0&&(t.rotation=e.rotation),!r&&"scale"in e&&e.scale!==void 0&&(typeof e.scale=="number"?t.scale.set(e.scale,e.scale):t.scale.set(e.scale.x,e.scale.y)),"pivot"in e&&e.pivot!==void 0&&(typeof e.pivot=="number"?t.pivot.set(e.pivot,e.pivot):t.pivot.set(e.pivot.x,e.pivot.y)),"position"in e&&e.position!==void 0&&t.position.set(e.position.x,e.position.y),"skew"in e&&e.skew!==void 0&&t.skew.set(e.skew.x,e.skew.y),"visible"in e&&e.visible!==void 0&&(t.visible=e.visible),"x"in e&&e.x!==void 0&&(t.x=e.x),"y"in e&&e.y!==void 0&&(t.y=e.y),"boundsArea"in e&&e.boundsArea!==void 0&&(t.boundsArea=e.boundsArea),"cursor"in e&&e.cursor!==void 0&&(t.cursor=e.cursor),"eventMode"in e&&e.eventMode!==void 0&&(t.eventMode=e.eventMode),"interactive"in e&&e.interactive!==void 0&&(t.interactive=e.interactive),"interactiveChildren"in e&&e.interactiveChildren!==void 0&&(t.interactiveChildren=e.interactiveChildren),"hitArea"in e&&e.hitArea!==void 0&&(t.hitArea=e.hitArea),di(t,e),"align"in e&&e.align!==void 0&&"align"in t&&(t.align=e.align),"percentagePosition"in e&&e.percentagePosition!==void 0&&"percentagePosition"in t&&(t.percentagePosition=e.percentagePosition),n&&await n(),r||("width"in e&&e.width!==void 0&&(t.width=e.width),"height"in e&&e.height!==void 0&&(t.height=e.height));}var zt;(d=>{function t(h,c={}){let{name:l=h.name,getInstance:p=async(m,T)=>{let S=new m;return await S.setMemory(T),S},copyProperty:u=async(m,T)=>{await m.setMemory(T);}}=c;$e.get(l)&&I.warn(`CanvasElement "${l}" already registered`),h.prototype.pixivnId=l,$e.set(l,h),ui.set(l,p),fi.set(l,u);}d.add=t;function e(h){let c=$e.get(h);if(!c){I.error(`CanvasElement "${h}" not found, did you forget to register it with the canvasComponentDecorator?`);return}return c}d.get=e;async function i(h,c){let l=e(h),p=ui.get(h);if(!l||!p){I.error(`CanvasElement "${h}" not found, did you forget to register it with the canvasComponentDecorator?`);return}try{return await p(l,c)}catch(u){I.error(`Error while getting CanvasElement instance "${h}"`,u);}}d.getInstance=i;async function r(h,c,l){let p=fi.get(h);if(!p){I.error(`CanvasElement "${h}" not found, did you forget to register it with the canvasComponentDecorator?`);return}try{await p(c,l);}catch(u){I.error(`Error while copying properties of CanvasElement "${h}"`,u);}}d.copyProperty=r;function n(){return Array.from($e.values())}d.values=n;function a(h){return $e.has(h)}d.has=a;function o(){return Array.from($e.keys())}d.keys=o;})(zt||={});var U=zt;async function dt(t){let e=await U.getInstance(t.pixivnId,t);if(!e)throw new core.PixiError("unregistered_element",`The element ${t.pixivnId} could not be created`,"canvas",t);return e}function Nt(t){return "memory"in t?t.memory:t instanceof Ee__default.default.Text?Ft(t):t instanceof Ee__default.default.Sprite?Wt(t):ke(t)}function Ui(t){let e=t.parent;return {width:t.width,height:t.height,isRenderGroup:t.isRenderGroup,blendMode:t.blendMode,tint:t.tint,alpha:t.alpha,angle:t.angle,renderable:t.renderable,rotation:t.rotation,scale:{x:t.scale.x,y:t.scale.y},pivot:{x:t.pivot.x,y:t.pivot.y},position:{x:t.position.x,y:t.position.y},skew:{x:t.skew.x,y:t.skew.y},visible:t.visible,x:t.x,y:t.y,boundsArea:t.boundsArea,cursor:t.cursor,eventMode:t.eventMode,interactive:t.interactive,interactiveChildren:t.interactiveChildren,hitArea:t.hitArea,index:e?.getChildIndex(t),parentLabel:e?.label,label:t.label}}function Ht(t,e){return {url:t.source.label,alias:e===t.source.label?void 0:e}}function ke(t,e){let i=Gi(t,De),n=e?.childrenExport||false?t.children.sort((a,o)=>t.getChildIndex(a)-t.getChildIndex(o)).map(a=>Nt(a)):[];return {pixivnId:i,elements:n,onEvents:pi(t),...Ui(t)}}function Wt(t){let e=ke(t),i=e.pixivnId??ze,r="assetsAliases"in t&&Array.isArray(t.assetsAliases)?Ht(t.texture,t.assetsAliases[0]):"textureAlias"in t?Ht(t.texture,t.textureAlias):Ht(t.texture);return {...e,pixivnId:i,textureData:r,anchor:{x:t.anchor.x,y:t.anchor.y},roundPixels:t.roundPixels}}function Ft(t){let e=ke(t),i=e.pixivnId??He;return {...e,pixivnId:i,anchor:{x:t.anchor.x,y:t.anchor.y},text:t.text,resolution:t.resolution,style:Ki(t.style),roundPixels:t.roundPixels}}function Gi(t,e){return Object.hasOwn(t,"pixivnId")?t.pixivnId:e}function pt(t){switch(t.type){case "linear":return {type:"linear",colorStops:t.colorStops,end:{x:t.end.x,y:t.end.y},start:{x:t.start.x,y:t.start.y},textureSpace:t.textureSpace,wrapMode:t.texture.source.wrapMode,textureSize:t.texture.source.width/t.texture.source.height};case "radial":return {type:"radial",colorStops:t.colorStops,textureSpace:t.textureSpace,center:{x:t.center.x,y:t.center.y},innerRadius:t.innerRadius,outerCenter:{x:t.outerCenter.x,y:t.outerCenter.y},outerRadius:t.outerRadius,rotation:t.rotation,scale:t.scale,wrapMode:t.texture.source.wrapMode,textureSize:t.texture.source.width/t.texture.source.height}}}function ji(t){if(t!=null){{if(typeof t=="number")return t;if(typeof t=="string"||Array.isArray(t))return t;if(t instanceof Ee__default.default.FillGradient)return pt(t);if(typeof t=="object"&&"fill"in t&&typeof t.fill!="function"&&t.fill){if(!(t.fill instanceof Ee__default.default.FillPattern))return pt(t.fill)}}I.warn("Unsupported property type for Text.style.fill.",t);}}function $i(t){if(typeof t=="number")return t;if(typeof t=="string")return t;if(Array.isArray(t))return t;if(t instanceof Ee__default.default.Color)return t.toNumber();I.warn("Unsupported color type.",t);}function Xi(t){if(t!=null){{if(typeof t=="number")return t;if(typeof t=="string"||Array.isArray(t))return t;if(t instanceof Ee__default.default.FillGradient)return pt(t);if(typeof t=="object"&&"alignment"in t)return {alignment:t.alignment,alpha:t.alpha,color:$i(t.color),join:t.join,miterLimit:t.miterLimit,width:t.width,cap:t.cap,pixelLine:t.pixelLine,textureSpace:t.textureSpace};if(typeof t=="object"&&"fill"in t&&typeof t.fill!="function"&&t.fill){if(!(t.fill instanceof Ee__default.default.FillPattern))return pt(t.fill)}}I.warn("Unsupported property type for Text.style.stroke.",t);}}function Ki(t){return {align:t.align,breakWords:t.breakWords,dropShadow:t.dropShadow,fill:ji(t.fill),fontFamily:t.fontFamily,fontSize:t.fontSize,fontStyle:t.fontStyle,fontVariant:t.fontVariant,fontWeight:t.fontWeight,leading:t.leading,letterSpacing:t.letterSpacing,lineHeight:t.lineHeight,padding:t.padding,stroke:Xi(t.stroke),textBaseline:t.textBaseline,trim:t.trim,whiteSpace:t.whiteSpace,wordWrap:t.wordWrap,wordWrapWidth:t.wordWrapWidth}}var gi=Xt(Et());var ut=class{constructor(e,i){this.alias=this.constructor.prototype.id;let{duration:r,priority:n,id:a=this.generateTickerId(this.alias,i),canvasElementAliases:o=[]}=i||{};this.args=e,this.duration=r,this.priority=n,this.id=a,this.canvasElementAliases=o;}alias;id;args;duration;priority;ticker=new Ee__default.default.Ticker;canvasElementAliases=[];generateTickerId(...e){try{return (0,gi.default)(JSON.stringify(e)).toString()+"_"+Math.random().toString(36).substring(7)}catch(i){throw new core.PixiError("not_json_serializable",`Error to generate ticker id: ${i}`)}}fnValue;complete(e){this.stop();}stop(){let e=this.fnValue;if(!e){I.warn("TickerBase.stop() called without fnValue set. This may cause issues.");return}this.ticker.remove(e,null);}start(){let e=this.id,i=()=>this.fn(this.ticker,this.args,this.canvasElementAliases,e);this.fnValue=i,this.ticker.add(i,null,this.priority),this.ticker.start();}pause(){this.ticker.stop();}play(){this.ticker.start();}get paused(){return !this.ticker.started}};var we=new ee({cacheSize:5});function Zi(t){return function(e){Vt.add(e,t);}}var Vt;(o=>{function t(d,h){h||(h=d.name),we.get(h)&&I.info(`Ticker "${h}" already exists, it will be overwritten`),d.prototype.id=h,we.set(h,d);}o.add=t;function e(d){try{let h=we.get(d);if(!h){I.error(`Event "${d}" not found, did you forget to register it with the tickerDecorator?`);return}return h}catch(h){I.error(`Error while getting Event "${d}"`,h);return}}o.get=e;function i(d,h,c){try{let l=we.get(d);if(!l){I.error(`Ticker "${d}" not found, did you forget to register it with the tickerDecorator?`);return}return new l(h,c)}catch(l){I.error(`Error while getting Ticker "${d}"`,l);return}}o.getInstance=i;function r(){return Array.from(we.values())}o.values=r;function n(d){return we.has(d)}o.has=n;function a(){return Array.from(we.keys())}o.keys=a;})(Vt||={});var Me=Vt;var yi="aliasToRemoveAfter";function ge(t){try{if(typeof t>"u")return t;let e=JSON.stringify(t);return JSON.parse(e)}catch(e){throw I.error("Error creating exportable element",t,e),new core.PixiError("not_json_serializable","Error creating exportable element")}}var Ze=class{tickersPausedByGameLayerRender=[];get app(){return y.app}get gameLayer(){return y.gameLayer}get isInitialized(){return y._isInitialized}get width(){return y.canvasWidth}get height(){return y.canvasHeight}set width(e){y.canvasWidth=e;}set height(e){y.canvasHeight=e;}get screen(){return this.app.screen}async init(e,i,r){return await y.init(e,i,r)}get children(){return y.gameLayer.children}async copyCanvasElementProperty(e,i,r={}){let n=["isRenderGroup","scale","visible","boundsArea","text","resolution","style","height","width"],{ignoreProperties:a=h=>h}=r;if(typeof i=="string"){let h=this.find(i);if(h)i=h;else {I.error(`Canvas element ${i} not found`);return}}if(typeof e=="string"){let h=this.find(e);if(h)e=h;else {I.error(`Canvas element ${e} not found`);return}}e instanceof Ee__default.default.Container&&(e=e.memory);let o=a(n),d={...e};o.forEach(h=>{h in d&&delete d[h];}),await U.copyProperty(i.pixivnId,i,d);}add(e,i,r={}){if(e===re){I.error(`The alias ${re} is reserved`);return}let n=this.find(e),a=r?.ignoreOldStyle;n&&!a&&this.copyCanvasElementProperty(n,i);let{zIndex:o=n?.parent?.getChildIndex(n)}=r;n&&!this.canvasElementIsOnCanvas(n)?I.error(`The canvas element ${e} exist in the memory but it is not on the canvas, so the zIndex is not set`):n&&this.remove(e,{ignoreTickers:true}),o!==void 0?(i.label=e,this.gameLayer.addChildAt(i,o)):(i.label=e,this.gameLayer.addChild(i));}remove(e,i={}){if(e===re){I.error(`The alias ${re} is reserved`);return}let r=i.ignoreTickers;typeof e=="string"&&(e=[e]),e.forEach(n=>{this.gameLayer.getChildrenByLabel(n).forEach(a=>{this.gameLayer.removeChild(a),!r&&this.unlinkComponentFromTicker(n);});});}find(e){if(e===re)return this.gameLayer;let i=this.gameLayer.getChildByLabel(e);if(i)return i}canvasElementIsOnCanvas(e){return this.gameLayer.children.includes(e)}removeAll(){this.gameLayer.removeChildren();}editAlias(e,i,r={}){let n=this.find(e);n&&(n.label=i),!r.ignoreTickers&&this.transferTickers(e,i,"move");}get currentTickers(){return y._currentTickers}get currentTickersSteps(){return y._currentTickersSequence}findTicker(e){let i=y._currentTickers.get(e);if(i)return i.ticker}addTicker(e,i){let r=i.id,n=i.alias;if(typeof e=="string"&&(e=[e]),i.canvasElementAliases=e,!Me.has(n)){I.error(`Ticker ${n} not found`);return}let a={ticker:i};if(y._currentTickers.set(r,a),a.ticker.start(),i.duration){let o=setTimeout(()=>{y.removeTickerTimeoutInfo(o),y._currentTickersTimeouts.get(o.toString())&&a.ticker.complete({ignoreTickerSteps:true});},i.duration*1e3);y.addTickerTimeoutInfo(e,n,o.toString(),true);}return r}addTickersSequence(e,i,r=0){if(i.length===0){I.warn("The steps of the tickers is empty");return}y._currentTickersSequence.has(e)||y._currentTickersSequence.set(e,new Map);let n={currentStepNumber:r,steps:i.map(o=>o===Xe||Object.hasOwn(o,"type")&&o.type==="pause"?o:{ticker:o.alias,args:ge(o.args),duration:o.duration})},a=y.generateTickerId(n);return y._currentTickersSequence.get(e)?.set(a,n),this.runTickersSequence(e,a),a}runTickersSequence(e,i){let r=y._currentTickersSequence.get(e);if(!r?.has(i))return;let n=r.get(i).steps[r.get(i).currentStepNumber];if(n===Xe&&(n=r.get(i).steps[0],r.get(i).currentStepNumber=0,n===Xe)){I.error("TikersSteps has a RepeatType in the first step");return}if(Object.hasOwn(n,"type")&&n.type==="pause"){let c=setTimeout(()=>{let l=y._currentTickersTimeouts.get(c.toString());l&&l.aliases.forEach(p=>{this.nextTickerStep(p,i);}),y.removeTickerTimeoutInfo(c);},n.duration*1e3);y.addTickerTimeoutInfo(e,"steps",c.toString(),false);return}let a=Me.getInstance(n.ticker,n.args,{canvasElementAliases:[e],duration:n.duration,priority:n.priority});if(!a){I.error(`Ticker ${n.ticker} not found`);return}let o=a.alias,d=a.id;a.canvasElementAliases=[e];let h={createdByTicketSteps:{canvasElementAlias:e,id:i},ticker:a};if(y._currentTickers.set(d,h),h.ticker.start(),a.duration){let c=setTimeout(()=>{let l=y._currentTickersTimeouts.get(c.toString());l&&(h.ticker.complete({ignoreTickerSteps:true}),l.aliases.forEach(p=>{this.nextTickerStep(p,i);})),y.removeTickerTimeoutInfo(c);},a.duration*1e3);y.addTickerTimeoutInfo(e,o,c.toString(),false);}}nextTickerStep(e,i){let r=y._currentTickersSequence.get(e);if(r?.has(i)){let n=r.get(i);n.currentStepNumber+1<n.steps.length?(n.currentStepNumber++,r.set(i,n),this.runTickersSequence(e,i)):i&&r.has(i)&&(r.delete(i),y._currentTickers.forEach((a,o)=>{a.createdByTicketSteps?.canvasElementAlias===e&&a.createdByTicketSteps.id===i&&this.removeTicker(o);}));}}onTickerComplete(e,i){let{stopTicker:r=true,aliasToRemoveAfter:n,tickerAliasToResume:a,tickerIdToResume:o}=i,d=y._currentTickers.get(e),h=i.ignoreTickerSteps||false;this.remove(n),a.forEach(c=>{this.resumeTicker({canvasAlias:c});}),this.resumeTicker({id:o}),d&&(this.removeTicker(e,{stopTicker:r}),!h&&d.ticker.duration===void 0&&d.createdByTicketSteps&&this.nextTickerStep(d.createdByTicketSteps.canvasElementAlias,d.createdByTicketSteps.id));}unlinkComponentFromTicker(e,i){if(typeof e=="string"&&(e=[e]),!i){e.forEach(n=>{y._currentTickers.forEach((a,o)=>{a.ticker.canvasElementAliases.includes(n)&&(a.ticker.canvasElementAliases.length===1?this.removeTicker(o):a.ticker.canvasElementAliases=a.ticker.canvasElementAliases.filter(d=>d!==n));}),y._currentTickersSequence.has(n)&&y._currentTickersSequence.delete(n),y.removeTickerTimeoutsByAlias(n,false);});return}let r;typeof i=="string"?r=i:r=i.prototype.id,e.forEach(n=>{let a=y._currentTickersSequence.get(n);a&&a.forEach((o,d)=>{o.steps.find(h=>typeof h=="object"&&"ticker"in h&&h.ticker===r)&&a.delete(d);});}),y._currentTickers.forEach(n=>{n.ticker.alias===r&&(n.ticker.canvasElementAliases=n.ticker.canvasElementAliases.filter(a=>!e.includes(a)));}),y._currentTickersTimeouts.forEach(n=>{n.ticker===r&&n.canBeDeletedBeforeEnd&&(n.aliases=n.aliases.filter(a=>!e.includes(a)));}),this.removeTickersWithoutAssociatedCanvasElement();}removeTickersWithoutAssociatedCanvasElement(){y._currentTickers.forEach(e=>{e.ticker.canvasElementAliases=e.ticker.canvasElementAliases.filter(i=>this.find(i)),e.ticker.canvasElementAliases.length===0&&e.ticker.complete({ignoreTickerSteps:true});}),y._currentTickersSequence.forEach((e,i)=>{e===void 0&&y._currentTickersSequence.delete(i);}),Array.from(y._currentTickersTimeouts.keys()).forEach(e=>{let i=y._currentTickersTimeouts.get(e);i&&i.aliases.length===0&&y.removeTickerTimeout(e);});}removeAllTickers(){this.tickersPausedByGameLayerRender=[],y._currentTickersSequence.clear(),Array.from(y._currentTickers.keys()).forEach(e=>{this.removeTicker(e);}),y._currentTickers.clear(),Array.from(y._currentTickersTimeouts.keys()).forEach(e=>{y.removeTickerTimeout(e);}),y._tickersToCompleteOnStepEnd.tikersIds.length=0,y._tickersToCompleteOnStepEnd.stepAlias.length=0;}removeTicker(e,i={stopTicker:true}){typeof e=="string"&&(e=[e]),e.forEach(r=>{let n=y._currentTickers.get(r);n&&(i.stopTicker&&n.ticker.stop(),y._currentTickers.delete(r));});}pauseTicker(e){let i=[];if("canvasAlias"in e){let{canvasAlias:r,tickerIdsExcluded:n=[]}=e;y._currentTickers.forEach((a,o)=>{a.ticker.canvasElementAliases.includes(r)&&!n.includes(a.ticker.alias)&&a.ticker.paused===false&&(a.ticker.pause(),i.push(o));});}else if("id"in e){let{id:r}=e;typeof r=="string"&&(r=[r]),[...new Set(r)].forEach(n=>{let a=y._currentTickers.get(n);a?a.ticker.paused===false&&(a.ticker.pause(),i.push(n)):I.error(`Ticker with id ${n} not found`);});}return i}resumeTicker(e){if("canvasAlias"in e){let{canvasAlias:i}=e;y._currentTickers.forEach(r=>{r.ticker.canvasElementAliases.includes(i)&&r.ticker.play();});}else if("id"in e){let{id:i}=e;typeof i=="string"&&(i=[i]),[...new Set(i)].forEach(r=>{let n=y._currentTickers.get(r);n?n.ticker.play():I.error(`Ticker with id ${r} not found`);});}}isTickerPaused(e,i){return false}pause(){this.gameLayer.renderable!==false&&(this.gameLayer.renderable=false,this.tickersPausedByGameLayerRender=this.pauseTicker({id:Array.from(y._currentTickers.keys())}));}resume(){if(this.gameLayer.renderable===true)return;this.gameLayer.renderable=true;let e=this.tickersPausedByGameLayerRender.filter(i=>y._currentTickers.has(i));e.length>0&&this.resumeTicker({id:e}),this.tickersPausedByGameLayerRender=[];}transferTickers(e,i,r="move"){let n=y._currentTickersSequence.get(e);if(n){let o=new Map(Array.from(n.entries()).map(([d,h])=>[d,ge(h)]));y._currentTickersSequence.set(i,o);}y._currentTickers.forEach((o,d)=>{if(o.createdByTicketSteps?.canvasElementAlias===e&&this.removeTicker(d),o.ticker.canvasElementAliases.includes(e)){let h=Me.getInstance(o.ticker.alias,ge(o.ticker.args),{duration:o.ticker.duration,priority:o.ticker.priority,canvasElementAliases:[i]});if(h?(this.addTicker(i,h),o.ticker.paused&&h.pause()):I.error(`Ticker ${o.ticker.alias} not found`),r==="move"&&(o.ticker.canvasElementAliases=o.ticker.canvasElementAliases.filter(c=>c!==e)),Object.hasOwn(o.ticker.args,yi)){let c=o.ticker.args.aliasToRemoveAfter;typeof c=="string"&&(c=[c]),Array.isArray(c)&&(r==="move"?o.ticker.args.aliasToRemoveAfter=c.map(l=>l===e?i:l):r==="duplicate"&&c.find(l=>l===e)&&(o.ticker.args.aliasToRemoveAfter=[...c,i]));}}}),y._currentTickersTimeouts.forEach(o=>{o.aliases.includes(e)&&(r==="move"?o.aliases=o.aliases.map(d=>d===e?i:d):r==="duplicate"&&o.aliases.find(d=>d===e)&&o.aliases.push(i));});let a=y._currentTickersSequence.get(i);if(a&&a.forEach((o,d)=>{this.runTickersSequence(i,d);}),r==="duplicate"){let o=y._currentTickersSequence.get(e);o&&o.forEach((d,h)=>{this.runTickersSequence(e,h);});}}completeTickerOnStepEnd(e){e.alias?y._tickersToCompleteOnStepEnd.stepAlias.push({id:e.id,alias:e.alias}):y._tickersToCompleteOnStepEnd.tikersIds.push({id:e.id});}async forceCompletionOfTicker(e,i){if(i){let r=y._currentTickersSequence.get(i),n=r?.get(e);if(r&&n)if(n.steps.includes(Xe))I.error(`The ticker alias: ${i} id: ${e} contains a RepeatType, so it can't be forced to complete`,n);else {let a=n.steps.map(o=>{if(typeof o=="object"&&"ticker"in o){let d=Me.getInstance(o.ticker,o.args,{duration:o.duration,canvasElementAliases:[i],priority:o.priority});if(d)return d.complete()}return Promise.resolve()});await Promise.all(a);}}else {let r=y._currentTickers.get(e);r&&await r.ticker.complete();}}animate(e,i,r,n){return core.GameUnifier.animate(e,i,r,n)}addLayer(e,i){if(e===re){I.error(`The alias ${re} is reserved`);return}return i.label=e,y.app.stage.addChild(i)}getLayer(e){return y.app.stage.getChildByLabel(e)}removeLayer(e){let i=y.app.stage.getChildByLabel(e);i&&y.app.stage.removeChild(i);}addHtmlLayer(e,i,r){return y.addHtmlLayer(e,i,r)}removeHtmlLayer(e){return y.removeHtmlLayer(e)}getHtmlLayer(e){return y.getHtmlLayer(e)}async extractImage(){let e=this.gameLayer.renderable===false;e&&this.resume();let i;try{i=this.app.renderer.extract.image(this.app.stage);}finally{e&&this.pause();}return (await i).src}clear(){this.removeAllTickers(),this.removeAll();}export(){let e=this.gameLayer.renderable===false;e&&this.resume();try{let i={};return this.children.forEach(r=>{r.label&&(i[r.label]=Nt(r));}),{tickers:ge(y.currentTickersWithoutCreatedBySteps),tickersSteps:ge(y.currentTickersSequence),elements:ge(i),stage:ge(ke(this.gameLayer)),elementAliasesOrder:ge(y.childrenAliasesOrder),tickersToCompleteOnStepEnd:ge(y._tickersToCompleteOnStepEnd)}}finally{e&&this.pause();}}async restore(e){this.clear();try{if(Object.hasOwn(e,"elements")&&Object.hasOwn(e,"elementAliasesOrder")){let i=e.elementAliasesOrder,r={},n=Object.entries(e.elements).map(async([a,o])=>{r[a]=await dt(o);});await Promise.all(n),i.forEach(a=>{let o=r[a];o&&this.add(a,o);});}else {I.error("The data does not have the properties elementAliasesOrder and elements");return}if(Object.hasOwn(e,"stage")&&Object.hasOwn(e,"stage")?te(this.gameLayer,e.stage,{ignoreScale:!0}):I.error("The data does not have the properties stage"),Object.hasOwn(e,"tickers")){let i=e.tickers;Object.entries(i).forEach(([r,n])=>{let a=n.canvasElementAliases;if(a.length!==0){let o=Me.getInstance(n.id,n.args,{duration:n.duration,priority:n.priority,id:r,canvasElementAliases:a});o?(o.canvasElementAliases=a,this.addTicker(a,o),n.paused&&o.pause()):I.error(`Ticker ${n.id} not found`);}});}if(Object.hasOwn(e,"tickersSteps")){let i=e.tickersSteps;Object.entries(i).forEach(([r,n])=>{y._currentTickersSequence.set(r,new Map(Object.entries(n))),Object.keys(n).forEach(a=>{this.runTickersSequence(r,a);});});}if(Object.hasOwn(e,"tickersToCompleteOnStepEnd")){let i=e.tickersToCompleteOnStepEnd,r=i.tikersIds,n=i.stepAlias.map(a=>({id:a.id,alias:a.alias}));y._tickersToCompleteOnStepEnd.tikersIds.length=0,y._tickersToCompleteOnStepEnd.tikersIds.push(...r),y._tickersToCompleteOnStepEnd.stepAlias.length=0,y._tickersToCompleteOnStepEnd.stepAlias.push(...n);}}catch(i){I.error("Error importing data",i);}}};var F=class t{static init(e){t._getScreen=e.getScreen;}static _getScreen;static get screen(){return t._getScreen()}};exports.CanvasPropertyUtility=void 0;(h=>{function t(c,l,p,u,m,T=0){return m?c==="width"?l*(F.screen.width-p)+p-u-T*p:l*(F.screen.height-p)+p-u-T*p:c==="width"?l*(F.screen.width-p)+u+T*p:l*(F.screen.height-p)+u+T*p}h.calculatePositionByAlign=t;function e(c,l,p,u,m,T=0){return m?c==="width"?(l-p+u+T*p)/(F.screen.width-p):(l-p+u+T*p)/(F.screen.height-p):c==="width"?(l-u-T*p)/(F.screen.width-p):(l-u-T*p)/(F.screen.height-p)}h.calculateAlignByPosition=e;function i(c,l){return c==="width"?l*F.screen.width:l*F.screen.height}h.calculatePositionByPercentagePosition=i;function r(c,l){return c==="width"?l/F.screen.width:l/F.screen.height}h.calculatePercentagePositionByPosition=r;function n(c,l){if(l=l%360,l<0&&(l+=360),l===0)return {x:c.x,y:c.y};if(l===90)return {x:-c.y,y:c.x};if(l===180)return {x:-c.x,y:-c.y};if(l===270)return {x:c.y,y:-c.x};if(l>0&&l<90){let p=l*Math.PI/180,u=Math.cos(p),m=Math.sin(p),T=c.x*u-c.y*m,S=c.x*m+c.y*u;return c.x!==0&&Math.sign(T)!==Math.sign(c.x)&&(T=-T),c.y!==0&&Math.sign(S)!==Math.sign(c.y)&&(S=-S),{x:T,y:S}}else if(l>90&&l<180){let p=(l-90)*Math.PI/180,u=Math.cos(p),m=Math.sin(p),T=-c.y*m-c.x*u,S=c.y*u-c.x*m;return c.x!==0&&Math.sign(T)!==Math.sign(c.x)&&(T=-T),c.y!==0&&Math.sign(S)!==Math.sign(c.y)&&(S=-S),{x:T,y:S}}else if(l>180&&l<270){let p=(l-180)*Math.PI/180,u=Math.cos(p),m=Math.sin(p),T=-c.x*u+c.y*m,S=-c.x*m-c.y*u;return c.x!==0&&Math.sign(T)!==Math.sign(c.x)&&(T=-T),c.y!==0&&Math.sign(S)!==Math.sign(c.y)&&(S=-S),{x:T,y:S}}else if(l>270&&l<360){let p=(l-270)*Math.PI/180,u=Math.cos(p),m=Math.sin(p),T=c.y*m-c.x*u,S=-c.y*u-c.x*m;return c.x!==0&&Math.sign(T)!==Math.sign(c.x)&&(T=-T),c.y!==0&&Math.sign(S)!==Math.sign(c.y)&&(S=-S),{x:T,y:S}}return {x:0,y:0}}h.getSuperPoint=n;function a(c,l){if(l=l%360,l<0&&(l+=360),l===0)return {x:c.x,y:c.y};if(l===90)return {x:c.y,y:-c.x};if(l===180)return {x:-c.x,y:-c.y};if(l===270)return {x:-c.y,y:c.x};if(l>0&&l<90){let p=l*Math.PI/180,u=Math.cos(p),m=Math.sin(p);return {x:c.x*u+c.y*m,y:-c.x*m+c.y*u}}else if(l>90&&l<180){let p=(l-90)*Math.PI/180,u=Math.cos(p),m=Math.sin(p);return {x:c.y*u-c.x*m,y:-c.y*m-c.x*u}}else if(l>180&&l<270){let p=(l-180)*Math.PI/180,u=Math.cos(p),m=Math.sin(p);return {x:-c.x*u-c.y*m,y:c.x*m-c.y*u}}else if(l>270&&l<360){let p=(l-270)*Math.PI/180,u=Math.cos(p),m=Math.sin(p);return {x:-c.y*u+c.x*m,y:c.y*m+c.x*u}}return {x:0,y:0}}h.getPointBySuperPoint=a;function o(c){let l=c.width,p=c.height,u=c.angle%360;return u<0&&(u+=360),u===0||u===180?l:u===90||u===270?p:Math.abs(l*Math.cos(u*Math.PI/180))+Math.abs(p*Math.sin(u*Math.PI/180))}h.getSuperWidth=o;function d(c){let l=c.width,p=c.height,u=c.angle%360;return u<0&&(u+=360),u===0||u===180?p:u===90||u===270?l:Math.abs(p*Math.cos(u*Math.PI/180))+Math.abs(l*Math.sin(u*Math.PI/180))}h.getSuperHeight=d;})(exports.CanvasPropertyUtility||={});async function Qe(t){if(t!=="EMPTY"){if(!t)throw I.error("Texture not found",t),new core.PixiError("unregistered_asset","Texture not found");if(Ee__default.default.Assets.cache.has(t)){let e=Ee__default.default.Assets.get(t);if(e)return e}return Ee__default.default.Assets.load(t).then(e=>{if(!e)throw I.error("Texture not found",t),new core.PixiError("unregistered_asset","Texture not found");if(!(e instanceof Ee__default.default.Texture))throw I.error("File is not a Texture",t),new core.PixiError("unregistered_asset","File is not a Texture");return e}).catch(e=>{throw I.error("Error loading file",e),new core.PixiError("unknown_element","Error loading file")})}}function pe(t){return t&&(typeof t.align!="number"&&(t.xAlign!==void 0&&(t.align===void 0?(t.align={x:t.xAlign},delete t.xAlign):(t.align.x=t.xAlign,delete t.xAlign)),t.yAlign!==void 0&&(t.align===void 0?(t.align={y:t.yAlign},delete t.yAlign):(t.align.y=t.yAlign,delete t.yAlign))),typeof t.percentagePosition!="number"&&(t.percentageX!==void 0&&(t.percentagePosition===void 0?(t.percentagePosition={x:t.percentageX},delete t.percentageX):(t.percentagePosition.x=t.percentageX,delete t.percentageX)),t.percentageY!==void 0&&(t.percentagePosition===void 0?(t.percentagePosition={y:t.percentageY},delete t.percentageY):(t.percentagePosition.y=t.percentageY,delete t.percentageY))),t)}var Oe=class t extends Ee__default.default.Sprite{constructor(e){if(e instanceof Ee__default.default.Texture)super(e);else {let{align:i,percentagePosition:r,...n}=pe(e)||{};super(n),i&&(this.align=i),r&&(this.percentagePosition=r);}this.pixivnId=this.constructor.prototype.pixivnId||ze;}pixivnId=ze;get memory(){return {...Wt(this),pixivnId:this.pixivnId,align:this._align,percentagePosition:this._percentagePosition}}async setMemory(e){return await mt(this,e)}static from(e,i){let r=Ee__default.default.Sprite.from(e,i),n=new t;return n.texture=r.texture,n}onEventsHandlers={};on(e,i,r){return Ae(e,this,i),super.on(e,(...n)=>i(...n,this),r)}_align=void 0;set align(e){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),typeof e=="number"?(this._align.x=e,this._align.y=e):(e.x!==void 0&&(this._align.x=e.x),e.y!==void 0&&(this._align.y=e.y)),this.reloadPosition();}get align(){let e=exports.CanvasPropertyUtility.getSuperPoint(this.pivot,this.angle),i=exports.CanvasPropertyUtility.getSuperPoint(this.scale,this.angle);return {x:exports.CanvasPropertyUtility.calculateAlignByPosition("width",this.x,exports.CanvasPropertyUtility.getSuperWidth(this),e.x,i.x<0,this.anchor.x),y:exports.CanvasPropertyUtility.calculateAlignByPosition("height",this.y,exports.CanvasPropertyUtility.getSuperHeight(this),e.y,i.y<0,this.anchor.y)}}set xAlign(e){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),this._align.x=e,this.reloadPosition();}get xAlign(){let e=exports.CanvasPropertyUtility.getSuperPoint(this.pivot,this.angle),i=exports.CanvasPropertyUtility.getSuperPoint(this.scale,this.angle);return exports.CanvasPropertyUtility.calculateAlignByPosition("width",this.x,exports.CanvasPropertyUtility.getSuperWidth(this),e.x,i.x<0,this.anchor.x)}set yAlign(e){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),this._align.y=e,this.reloadPosition();}get yAlign(){let e=exports.CanvasPropertyUtility.getSuperPoint(this.pivot,this.angle),i=exports.CanvasPropertyUtility.getSuperPoint(this.scale,this.angle);return exports.CanvasPropertyUtility.calculateAlignByPosition("height",this.y,exports.CanvasPropertyUtility.getSuperHeight(this),e.y,i.y<0,this.anchor.y)}_percentagePosition=void 0;set percentagePosition(e){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),typeof e=="number"?(this._percentagePosition.x=e,this._percentagePosition.y=e):(e.x!==void 0&&(this._percentagePosition.x=e.x),e.y!==void 0&&(this._percentagePosition.y=e.y)),this.reloadPosition();}get percentagePosition(){return {x:exports.CanvasPropertyUtility.calculatePercentagePositionByPosition("width",this.x),y:exports.CanvasPropertyUtility.calculatePercentagePositionByPosition("height",this.y)}}get percentageX(){return exports.CanvasPropertyUtility.calculatePercentagePositionByPosition("width",this.x)}set percentageX(e){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.x=e,this.reloadPosition();}get percentageY(){return exports.CanvasPropertyUtility.calculatePercentagePositionByPosition("height",this.y)}set percentageY(e){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.y=e,this.reloadPosition();}get positionType(){return this._align?"align":this._percentagePosition?"percentage":"pixel"}get positionInfo(){switch(this.positionType){case "align":return {x:this.xAlign,y:this.yAlign,type:"align"};case "percentage":return {x:this.percentageX,y:this.percentageY,type:"percentage"};default:return {x:this.x,y:this.y,type:"pixel"}}}set positionInfo(e){e.type==="align"?this.align={x:e.x,y:e.y}:e.type==="percentage"?this.percentagePosition={x:e.x,y:e.y}:this.position.set(e.x,e.y);}reloadPosition(){if(this._align){let e=exports.CanvasPropertyUtility.getSuperPoint(this.pivot,this.angle),i=exports.CanvasPropertyUtility.getSuperPoint(this.scale,this.angle);this._align.x!==void 0&&(super.x=exports.CanvasPropertyUtility.calculatePositionByAlign("width",this._align.x,exports.CanvasPropertyUtility.getSuperWidth(this),e.x,i.x<0,this.anchor.x)),this._align.y!==void 0&&(super.y=exports.CanvasPropertyUtility.calculatePositionByAlign("height",this._align.y,exports.CanvasPropertyUtility.getSuperHeight(this),e.y,i.y<0,this.anchor.y));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=exports.CanvasPropertyUtility.calculatePositionByPercentagePosition("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=exports.CanvasPropertyUtility.calculatePositionByPercentagePosition("height",this._percentagePosition.y)));}get position(){return super.position}set position(e){this._align=void 0,this._percentagePosition=void 0,super.position=e;}get x(){return super.x}set x(e){this._align=void 0,this._percentagePosition=void 0,super.x=e;}get y(){return super.y}set y(e){this._align=void 0,this._percentagePosition=void 0,super.y=e;}};U.add(Oe,{name:ze,copyProperty:async(t,e)=>{await mt(t,e,{ignoreTexture:true});}});async function mt(t,e,i){e=pe(e);let r=i?.ignoreTexture||false;if(await te(t,e),!r){let a;if("textureData"in e&&e.textureData&&(a=e.textureData),a&&a.url!=="EMPTY"){let o=a.url;a.alias&&Ee__default.default.Assets.resolver.hasKey(a.alias)&&(o=a.alias);try{let d=await Qe(o);d&&(t.texture=d);}catch(d){I.error("Error in Sprite.setMemorySprite() while loading texture"),d=new core.PixiError("unregistered_asset",`Error loading image ${o}`,"canvas",e),core.GameUnifier.runOnError(d,{});}}}let n=i?.half;n&&await n(),"anchor"in e&&e.anchor!==void 0&&(typeof e.anchor=="number"?t.anchor.set(e.anchor,e.anchor):t.anchor.set(e.anchor.x,e.anchor.y)),"align"in e&&e.align!==void 0&&(t.align=e.align),"percentagePosition"in e&&e.percentagePosition!==void 0&&(t.percentagePosition=e.percentagePosition),"roundPixels"in e&&e.roundPixels!==void 0&&(t.roundPixels=e.roundPixels);}var B=class t extends Oe{_textureAlias;get textureAlias(){return this._textureAlias?this._textureAlias:this.texture.source.label}pixivnId=Le;constructor(e,i){super(e),i&&(this._textureAlias=i);}get memory(){return {...super.memory,pixivnId:this.pixivnId,loadIsStarted:this._loadIsStarted}}async setMemory(e){let i;"textureData"in e&&e.textureData&&(i=e.textureData),"assetsData"in e&&Array.isArray(e.assetsData)&&e.assetsData.length>0&&(i=e.assetsData[0]),i&&i.alias&&(this._textureAlias=i.alias),await xt(this,e),this.reloadPosition();}static from(e,i){let r=Ee__default.default.Sprite.from(e,i),n=new t;return n.texture=r.texture,n}_loadIsStarted=false;get loadIsStarted(){return this._loadIsStarted}async load(){return this._loadIsStarted=true,Qe(this.textureAlias).then(e=>{this._loadIsStarted=false,e&&(this.texture=e);}).catch(e=>{this._loadIsStarted=false,I.error("Error into ImageSprite.load()"),e=new core.PixiError("unregistered_asset",`Error loading image ${this.textureAlias}`,"canvas",{...this.memory,label:this.textureAlias},this),core.GameUnifier.runOnError(e,{});})}set texture(e){super.texture=e,this.reloadPosition();}get texture(){return super.texture}get haveEmptyTexture(){return this.texture._source.label==="EMPTY"}};U.add(B,{name:Le,copyProperty:async(t,e)=>{await xt(t,e,{ignoreTexture:true});}});async function xt(t,e,i){return await mt(t,e,{half:async()=>{"loadIsStarted"in e&&e.loadIsStarted&&await t.load();},ignoreTexture:i?.ignoreTexture})}var ye=class t extends B{constructor(e,i){if(e instanceof Ee__default.default.Texture){super(e,i);return}let{loop:r,paused:n,currentTime:a,...o}=e||{};super(o,i),r&&(this.loop=r),n&&(this.paused=n),a&&(this.currentTime=a);}pixivnId=Ne;get memory(){return {...super.memory,pixivnId:this.pixivnId,loop:this.loop,paused:this._paused,currentTime:this.currentTime}}async setMemory(e){await xi(this,e),this.reloadPosition();}static from(e,i){let r=Ee__default.default.Sprite.from(e,i),n=new t;return n.texture=r.texture,n}async load(){await super.load(),this.loop=this._looop,this.currentTime=this._currentTime,this.paused=this._paused;}_looop=false;get loop(){return this.texture?.source?.resource?.loop||false}set loop(e){this._looop=e,this.texture?.source?.resource&&(this.texture.source.resource.loop=e);}_paused=false;get paused(){return this.texture?.source?.resource?.paused||false}set paused(e){e?this.pause():this.play();}pause(){this._paused=true,this.texture?.source?.resource&&this.texture.source.resource.pause();}play(){this._paused=false,this.texture?.source?.resource?.play&&typeof this.texture.source.resource.play=="function"&&this.texture.source.resource.play();}_currentTime=0;get currentTime(){return this.texture?.source?.resource?.currentTime||0}set currentTime(e){let i=this.duration;i&&e>=i&&(e=0),this._currentTime=e,this.texture?.source?.resource&&(this.texture.source.resource.currentTime=e);}restart(){this.currentTime=0;}get duration(){if(this.texture?.source?.resource)return this.texture.source.resource.duration||0}};U.add(ye,{name:Ne,getInstance:async(t,e)=>{let i;"textureData"in e&&e.textureData&&(i=e.textureData);let r=new t(void 0,i?.alias);return await r.setMemory(e),r},copyProperty:async(t,e)=>{await xi(t,e,{ignoreTexture:true});}});async function xi(t,e,i){await xt(t,e,{ignoreTexture:i?.ignoreTexture}),"loop"in e&&e.loop!==void 0&&(t.loop=e.loop),"currentTime"in e&&e.currentTime!==void 0&&(t.currentTime=e.currentTime),"paused"in e&&e.paused!==void 0&&(t.paused=e.paused);}var xe=class extends Ee.Container{constructor(e){let{anchor:i,align:r,percentagePosition:n,...a}=pe(e)||{};super(a),this.pixivnId=this.constructor.prototype.pixivnId||De,i&&(this.anchor=i),r&&(this.align=r),n&&(this.percentagePosition=n);}pixivnId=De;get memory(){return {...ke(this,{childrenExport:true}),anchor:this._anchor?this.anchor:void 0,align:this._align,percentagePosition:this._percentagePosition}}async setMemory(e){await this.importChildren(e),await te(this,e),this.reloadAnchor(),this.reloadPosition();}async importChildren(e){for(let i=0;i<e.elements.length;i++){let r=e.elements[i],n=await dt(r);this.addChild(n);}}onEventsHandlers={};on(e,i,r){return Ae(e,this,i),super.on(e,(...n)=>i(...n,this),r)}_anchor;get anchor(){let e=super.pivot.x/this.width,i=super.pivot.y/this.height;return {x:e,y:i}}set anchor(e){typeof e=="number"?this._anchor={x:e,y:e}:this._anchor=e,this.reloadAnchor();}reloadAnchor(){this._anchor&&super.pivot.set(this._anchor.x*this.width,this._anchor.y*this.height);}get pivot(){return super.pivot}set pivot(e){this._anchor=void 0,super.pivot=e;}_align=void 0;set align(e){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),typeof e=="number"?(this._align.x=e,this._align.y=e):(e.x!==void 0&&(this._align.x=e.x),e.y!==void 0&&(this._align.y=e.y)),this.reloadPosition();}get align(){let e=exports.CanvasPropertyUtility.getSuperPoint(this.pivot,this.angle),i=exports.CanvasPropertyUtility.getSuperPoint(this.scale,this.angle);return {x:exports.CanvasPropertyUtility.calculateAlignByPosition("width",this.x,exports.CanvasPropertyUtility.getSuperWidth(this),e.x,i.x<0),y:exports.CanvasPropertyUtility.calculateAlignByPosition("height",this.y,exports.CanvasPropertyUtility.getSuperHeight(this),e.y,i.y<0)}}set xAlign(e){this._percentagePosition&&(this._percentagePosition=void 0),this._align===void 0&&(this._align={}),this._align.x=e,this.reloadPosition();}get xAlign(){let e=exports.CanvasPropertyUtility.getSuperPoint(this.pivot,this.angle),i=exports.CanvasPropertyUtility.getSuperPoint(this.scale,this.angle);return exports.CanvasPropertyUtility.calculateAlignByPosition("width",this.x,exports.CanvasPropertyUtility.getSuperWidth(this),e.x,i.x<0)}set yAlign(e){this._percentagePosition&&(this._percentagePosition=void 0),this._align===void 0&&(this._align={}),this._align.y=e,this.reloadPosition();}get yAlign(){let e=exports.CanvasPropertyUtility.getSuperPoint(this.pivot,this.angle),i=exports.CanvasPropertyUtility.getSuperPoint(this.scale,this.angle);return exports.CanvasPropertyUtility.calculateAlignByPosition("height",this.y,exports.CanvasPropertyUtility.getSuperHeight(this),e.y,i.y<0)}_percentagePosition=void 0;set percentagePosition(e){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),typeof e=="number"?(this._percentagePosition.x=e,this._percentagePosition.y=e):(e.x!==void 0&&(this._percentagePosition.x=e.x),e.y!==void 0&&(this._percentagePosition.y=e.y)),this.reloadPosition();}get percentagePosition(){return {x:exports.CanvasPropertyUtility.calculatePercentagePositionByPosition("width",this.x),y:exports.CanvasPropertyUtility.calculatePercentagePositionByPosition("height",this.y)}}set percentageX(e){this._align&&(this._align=void 0),this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.x=e,this.reloadPosition();}get percentageX(){return exports.CanvasPropertyUtility.calculatePercentagePositionByPosition("width",this.x)}set percentageY(e){this._align&&(this._align=void 0),this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.y=e,this.reloadPosition();}get percentageY(){return exports.CanvasPropertyUtility.calculatePercentagePositionByPosition("height",this.y)}get positionType(){return this._align?"align":this._percentagePosition?"percentage":"pixel"}get positionInfo(){switch(this.positionType){case "align":return {x:this.xAlign,y:this.yAlign,type:"align"};case "percentage":return {x:this.percentageX,y:this.percentageY,type:"percentage"};default:return {x:this.x,y:this.y,type:"pixel"}}}set positionInfo(e){e.type==="align"?this.align={x:e.x,y:e.y}:e.type==="percentage"?this.percentagePosition={x:e.x,y:e.y}:this.position.set(e.x,e.y);}reloadPosition(){if(this._align){let e=exports.CanvasPropertyUtility.getSuperPoint(this.pivot,this.angle),i=exports.CanvasPropertyUtility.getSuperPoint(this.scale,this.angle);this._align.x!==void 0&&(super.x=exports.CanvasPropertyUtility.calculatePositionByAlign("width",this._align.x,exports.CanvasPropertyUtility.getSuperWidth(this),e.x,i.x<0)),this._align.y!==void 0&&(super.y=exports.CanvasPropertyUtility.calculatePositionByAlign("height",this._align.y,exports.CanvasPropertyUtility.getSuperHeight(this),e.y,i.y<0));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=exports.CanvasPropertyUtility.calculatePositionByPercentagePosition("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=exports.CanvasPropertyUtility.calculatePositionByPercentagePosition("height",this._percentagePosition.y)));}get position(){return super.position}set position(e){this._align=void 0,this._percentagePosition=void 0,super.position=e;}get x(){return super.x}set x(e){this._align=void 0,this._percentagePosition=void 0,super.x=e;}get y(){return super.y}set y(e){this._align=void 0,this._percentagePosition=void 0,super.y=e;}};U.add(xe,{name:De,copyProperty:async(t,e)=>await te(t,e)});var cr=new Set(["mp4","webm","ogg","ogv","avi","mov","wmv","flv","mkv","m4v","3gp","3g2","ts","mts"]);function et(t){let e=Ee__default.default.Assets.cache.has(t)?Ee__default.default.Assets.get(t):null;return e instanceof Ee__default.default.Texture&&(t=e.source?.label||t),lr(t)}function lr(t){let e=t.split(".").pop()?.toLowerCase();return e!==void 0&&cr.has(e)}var z=class extends xe{constructor(e,i){let{anchor:r,align:n,percentagePosition:a,...o}=pe(e)||{};super(o),i&&i.forEach(d=>{et(d)?this.addChild(new ye(void 0,d)):this.addChild(new B(void 0,d));}),r&&(this.anchor=r),n&&(this.align=n),a&&(this.percentagePosition=a);}get memory(){return {...super.memory,pixivnId:nt,loadIsStarted:this._loadIsStarted}}async setMemory(e){await this.importChildren(e),await Ti(this,e),this.reloadAnchor(),this.reloadPosition();}pixivnId=nt;_loadIsStarted=false;get loadIsStarted(){return this._loadIsStarted}async load(){this._loadIsStarted=true;let e=this.children.map(i=>i.load());return Promise.all(e).then(()=>{this._loadIsStarted=false,this.reloadAnchor(),this.reloadPosition();}).catch(i=>{this._loadIsStarted=false,I.error("Error into ImageContainer.load()",i);})}get texture(){return this.children.length>0?this.children[0].texture:new Ee__default.default.Texture}get haveEmptyTexture(){return this.children.some(e=>e.texture._source.label==="EMPTY")}};U.add(z,{name:nt,copyProperty:async(t,e)=>await Ti(t,e)});async function Ti(t,e){e=pe(e)||{},te(t,e,{end:async()=>{"loadIsStarted"in e&&e.loadIsStarted&&await t.load();}});}var Tt=class{constructor(...e){}get memory(){throw new core.PixiError("not_implemented","The method CanvasBaseItem.memory must be overridden")}setMemory(e){throw new core.PixiError("not_implemented","The method CanvasBaseItem.setMemory must be overridden")}pixivnId="canvas_element_id_not_set"};var Re=class extends Ee__default.default.Text{constructor(e){let{align:i,percentagePosition:r,...n}=pe(e)||{};super(n),this.pixivnId=this.constructor.prototype.pixivnId||He,i&&(this.align=i),r&&(this.percentagePosition=r);}pixivnId=He;get memory(){return {...Ft(this),pixivnId:this.pixivnId,align:this._align,percentagePosition:this._percentagePosition}}async setMemory(e){await pr(this,e),this.reloadPosition();}onEventsHandlers={};on(e,i,r){return Ae(e,this,i),super.on(e,(...n)=>i(...n,this),r)}_align=void 0;set align(e){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),typeof e=="number"?(this._align.x=e,this._align.y=e):(e.x!==void 0&&(this._align.x=e.x),e.y!==void 0&&(this._align.y=e.y)),this.reloadPosition();}get align(){let e=exports.CanvasPropertyUtility.getSuperPoint(this.pivot,this.angle),i=exports.CanvasPropertyUtility.getSuperPoint(this.scale,this.angle);return {x:exports.CanvasPropertyUtility.calculateAlignByPosition("width",this.x,exports.CanvasPropertyUtility.getSuperWidth(this),e.x,i.x<0,this.anchor.x),y:exports.CanvasPropertyUtility.calculateAlignByPosition("height",this.y,exports.CanvasPropertyUtility.getSuperHeight(this),e.y,i.y<0,this.anchor.y)}}set xAlign(e){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),this._align.x=e,this.reloadPosition();}get xAlign(){let e=exports.CanvasPropertyUtility.getSuperPoint(this.pivot,this.angle),i=exports.CanvasPropertyUtility.getSuperPoint(this.scale,this.angle);return exports.CanvasPropertyUtility.calculateAlignByPosition("width",this.x,exports.CanvasPropertyUtility.getSuperWidth(this),e.x,i.x<0,this.anchor.x)}set yAlign(e){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),this._align.y=e,this.reloadPosition();}get yAlign(){let e=exports.CanvasPropertyUtility.getSuperPoint(this.pivot,this.angle),i=exports.CanvasPropertyUtility.getSuperPoint(this.scale,this.angle);return exports.CanvasPropertyUtility.calculateAlignByPosition("height",this.y,exports.CanvasPropertyUtility.getSuperHeight(this),e.y,i.y<0,this.anchor.y)}_percentagePosition=void 0;set percentagePosition(e){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),typeof e=="number"?(this._percentagePosition.x=e,this._percentagePosition.y=e):(e.x!==void 0&&(this._percentagePosition.x=e.x),e.y!==void 0&&(this._percentagePosition.y=e.y)),this.reloadPosition();}get percentagePosition(){return {x:exports.CanvasPropertyUtility.calculatePercentagePositionByPosition("width",this.x),y:exports.CanvasPropertyUtility.calculatePercentagePositionByPosition("height",this.y)}}get percentageX(){return exports.CanvasPropertyUtility.calculatePercentagePositionByPosition("width",this.x)}set percentageX(e){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.x=e,this.reloadPosition();}get percentageY(){return exports.CanvasPropertyUtility.calculatePercentagePositionByPosition("height",this.y)}set percentageY(e){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.y=e,this.reloadPosition();}get positionType(){return this._align?"align":this._percentagePosition?"percentage":"pixel"}get positionInfo(){switch(this.positionType){case "align":return {x:this.xAlign,y:this.yAlign,type:"align"};case "percentage":return {x:this.percentageX,y:this.percentageY,type:"percentage"};default:return {x:this.x,y:this.y,type:"pixel"}}}set positionInfo(e){e.type==="align"?this.align={x:e.x,y:e.y}:e.type==="percentage"?this.percentagePosition={x:e.x,y:e.y}:this.position.set(e.x,e.y);}reloadPosition(){if(this._align){let e=exports.CanvasPropertyUtility.getSuperPoint(this.pivot,this.angle),i=exports.CanvasPropertyUtility.getSuperPoint(this.scale,this.angle);this._align.x!==void 0&&(super.x=exports.CanvasPropertyUtility.calculatePositionByAlign("width",this._align.x,exports.CanvasPropertyUtility.getSuperWidth(this),e.x,i.x<0,this.anchor.x)),this._align.y!==void 0&&(super.y=exports.CanvasPropertyUtility.calculatePositionByAlign("height",this._align.y,exports.CanvasPropertyUtility.getSuperHeight(this),e.y,i.y<0,this.anchor.y));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=exports.CanvasPropertyUtility.calculatePositionByPercentagePosition("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=exports.CanvasPropertyUtility.calculatePositionByPercentagePosition("height",this._percentagePosition.y)));}get position(){return super.position}set position(e){this._align=void 0,this._percentagePosition=void 0,super.position=e;}get x(){return super.x}set x(e){this._align=void 0,this._percentagePosition=void 0,super.x=e;}get y(){return super.y}set y(e){this._align=void 0,this._percentagePosition=void 0,super.y=e;}};U.add(Re,{name:He});async function pr(t,e){"text"in e&&e.text!==void 0&&(t.text=e.text),await te(t,e,{end:()=>{"style"in e&&e.style!==void 0&&(t.style=e.style);}}),"anchor"in e&&e.anchor!==void 0&&(typeof e.anchor=="number"?t.anchor.set(e.anchor,e.anchor):t.anchor.set(e.anchor.x,e.anchor.y)),"resolution"in e&&e.resolution!==void 0&&(t.resolution=e.resolution),"anchor"in e&&e.anchor!==void 0&&(typeof e.anchor=="number"?t.anchor.set(e.anchor,e.anchor):t.anchor.set(e.anchor.x,e.anchor.y)),"align"in e&&e.align!==void 0&&(t.align=e.align),"percentagePosition"in e&&e.percentagePosition!==void 0&&(t.percentagePosition=e.percentagePosition),"roundPixels"in e&&e.roundPixels!==void 0&&(t.roundPixels=e.roundPixels);}async function ur(t,e={},i){let r=g.find(t);if(!r){I.error(`The element with the alias ${t} does not exist. So the shake effect can't be applied.`);return}let n={x:r.position.x,y:r.position.y},{shakeType:a="horizontal",maxShockSize:o=10,shocksNumber:d=10,...h}=e,c=d-1;if(c<2){I.error("The number of shocks must be at least 3.");return}let l=Math.floor(c/2),p=Math.ceil(c/2),u=[];for(let S=0;S<l;S++){let _=o*(S+1)/l;a==="horizontal"?S%2!==0?u.push(n.x+_):u.push(n.x-_):S%2!==0?u.push(n.y+_):u.push(n.y-_);}let m=l%2===0;for(let S=p;S>0;S--){let _=o*(S+1)/(p-1);a==="horizontal"?S%2===0&&!m||S%2!==0&&m?u.push(n.x-_):u.push(n.x+_):S%2===0&&!m||S%2!==0&&m?u.push(n.y-_):u.push(n.y+_);}let T;if(a==="horizontal"?(u.push(n.x),T=g.animate(t,{x:u},h,i)):(u.push(n.y),T=g.animate(t,{y:u},h,i)),T)return [T]}function vt(t,e,i){let r={...g.find(t)?.memory,...i},n=new z(i,e);return r&&g.copyCanvasElementProperty(r,n),g.add(t,n,{ignoreOldStyle:true,zIndex:i?.zIndex}),n}async function fr(t,e,i){let r={...g.find(t)?.memory,...i},n=new z(i,e);return n.label=t,await n.load(),r&&g.copyCanvasElementProperty(r,n),g.add(t,n,{ignoreOldStyle:true,zIndex:i?.zIndex}),n}function Pt(t,e,i){if(!e)if(Ee__default.default.Assets.resolver.hasKey(t))e=t;else throw new core.PixiError("unregistered_asset",`The image ${t} does not exist in the cache.`,"canvas",{pixivnId:Le,...i,label:t});let r={...g.find(t)?.memory,...i},n=new B(i,e);return r&&g.copyCanvasElementProperty(r,n),g.add(t,n,{ignoreOldStyle:true,zIndex:i?.zIndex}),n}async function gr(t,e,i){if(!e)if(Ee__default.default.Assets.resolver.hasKey(t))e=t;else throw new core.PixiError("unregistered_asset",`The image ${t} does not exist in the cache.`,"canvas",{pixivnId:Le,...i,label:t});let r={...g.find(t)?.memory,...i},n=new B(i,e);return n.label=t,await n.load(),r&&g.copyCanvasElementProperty(r,n),g.add(t,n,{ignoreOldStyle:true,zIndex:i?.zIndex}),n}function St(t,e,i){if(!e)if(Ee__default.default.Assets.resolver.hasKey(t))e=t;else throw new core.PixiError("unregistered_asset",`The video ${t} does not exist in the cache.`,"canvas",{pixivnId:Ne,...i,label:t});let r={...g.find(t)?.memory,...i},n=new ye(i,e);return r&&g.copyCanvasElementProperty(r,n),g.add(t,n,{ignoreOldStyle:true,zIndex:i?.zIndex}),n}async function yr(t,e,i){if(!e)if(Ee__default.default.Assets.resolver.hasKey(t))e=t;else throw new core.PixiError("unregistered_asset",`The video ${t} does not exist in the cache.`,"canvas",{pixivnId:Ne,...i,label:t});let r={...g.find(t)?.memory,...i},n=new ye(i,e);return n.label=t,await n.load(),r&&g.copyCanvasElementProperty(r,n),g.add(t,n,{ignoreOldStyle:true,zIndex:i?.zIndex}),n}function Ut(t){switch(t.type){case "align":return {xAlign:t.x,yAlign:t.y};case "percentage":return {percentageX:t.x,percentageY:t.y};default:return {x:t.x,y:t.y}}}function tt(t,e,i){if(typeof e=="string")return et(e)?St(t,e,i):Pt(t,e,i);if(Array.isArray(e))return vt(t,e,i);if(typeof e=="object"&&"value"in e&&"options"in e){if(typeof e.value=="string")return et(e.value)?St(t,e.value,{...e.options,zIndex:i.zIndex}):Pt(t,e.value,{...e.options,zIndex:i.zIndex});if(Array.isArray(e.value))return vt(t,e.value,{...e.options,zIndex:i.zIndex})}return g.add(t,e,i),e}async function _i(t,e,i={},r){let{forceCompleteBeforeNext:n=true}=i,{completeOnContinue:a=n,tickerIdToResume:o=[],...d}=i,h=[];e||(e=t),typeof o=="string"&&(o=[o]);let c,l=g.find(t);if(l&&(c=`${t}_temp_disolve`,g.editAlias(t,c)),e=tt(t,e,{zIndex:l?l.parent?.getChildIndex(l):void 0}),l?.parent?.setChildIndex(l,l.parent.getChildIndex(l)-.1),c&&g.copyCanvasElementProperty(c,t),c&&g.transferTickers(c,t,"duplicate"),e.alpha=0,c){let u=It(c,{...i,autoplay:false,completeOnContinue:a},r);u&&(h.push(...u),o.push(...u));}let p=g.animate(t,{alpha:1},{...d,tickerIdToResume:o,completeOnContinue:a},r);if(p&&h.push(p),(e instanceof B||e instanceof z)&&e.haveEmptyTexture&&await e.load(),h.length>0)return h}function It(t,e={},i){let{forceCompleteBeforeNext:r=true}=e,{completeOnContinue:n=r,aliasToRemoveAfter:a=[],...o}=e;typeof a=="string"&&(a=[a]),a.push(t);let d=g.animate(t,{alpha:0},{...o,aliasToRemoveAfter:a,completeOnContinue:n},i);if(d)return [d]}async function mr(t,e,i={},r){let{forceCompleteBeforeNext:n=true}=i,{completeOnContinue:a=n,aliasToRemoveAfter:o=[],...d}=i,h=[];e||(e=t),typeof o=="string"&&(o=[o]);let c=g.find(t);if(!c)return _i(t,e,i,r);let l=`${t}_temp_fade`;g.editAlias(t,l),o.push(l),e=tt(t,e,{zIndex:c?c.parent?.getChildIndex(c):void 0}),c?.parent?.setChildIndex(c,c.parent.getChildIndex(c)-.1),l&&g.copyCanvasElementProperty(l,t),l&&g.transferTickers(l,t,"duplicate"),e.alpha=0;let p=g.animate(t,{alpha:1},{...d,aliasToRemoveAfter:o,completeOnContinue:a},r);if(p){let u=It(l,{...i,tickerIdToResume:p,completeOnContinue:a},r);u&&h.push(...u),h.push(p),g.pauseTicker({id:p});}if((e instanceof B||e instanceof z)&&e.haveEmptyTexture&&await e.load(),h.length>0)return h}function xr(t,e={},i){return It(t,e,i)}async function Tr(t,e,i={},r){let{forceCompleteBeforeNext:n=true}=i,{direction:a="right",completeOnContinue:o=n,tickerIdToResume:d=[],aliasToRemoveAfter:h=[],removeOldComponentWithMoveOut:c,...l}=i,p=[],u;e||(e=t),typeof d=="string"&&(d=[d]),typeof h=="string"&&(h=[h]);let m,T=g.find(t);if(T&&(m=`${t}_temp_movein`,g.editAlias(t,m),T instanceof B||T instanceof z?u=T.positionInfo:u={x:T.x,y:T.y,type:"pixel"}),e=tt(t,e,{zIndex:T?T.parent?.getChildIndex(T):void 0}),T?.parent?.setChildIndex(T,T.parent.getChildIndex(T)-.1),m&&g.copyCanvasElementProperty(m,t),m&&g.transferTickers(m,t,"move"),u||(e instanceof B||e instanceof z?u=e.positionInfo:u={x:e.x,y:e.y,type:"pixel"}),m)if(c){let f=Gt(m,{...i,autoplay:false,completeOnContinue:o},r);f&&(p.push(...f),d.push(...f));}else h.push(m);switch((e instanceof B||e instanceof z)&&e.haveEmptyTexture&&await e.load(),a){case "up":e.y=g.height+e.height;break;case "down":e.y=-e.height;break;case "left":e.x=g.width+e.width;break;case "right":e.x=-e.width;break}let S=g.pauseTicker({canvasAlias:t});d.push(...S);let _=g.animate(t,Ut(u),{...l,tickerIdToResume:d,aliasToRemoveAfter:h,completeOnContinue:o},r);if(_&&p.push(_),p.length>0)return p}function Gt(t,e={},i){let{forceCompleteBeforeNext:r=true}=e,{direction:n="right",completeOnContinue:a=r,aliasToRemoveAfter:o=[],...d}=e;typeof o=="string"&&(o=[o]),o.push(t);let h=g.find(t);if(!h){I.warn(`The canvas component "${t}" is not found.`);return}let c={x:h.x,y:h.y};switch(n){case "up":c.y=-h.height;break;case "down":c.y=g.height+h.height;break;case "left":c.x=-h.width;break;case "right":c.x=g.width+h.width;break}g.pauseTicker({canvasAlias:t});let l=g.animate(t,c,{...d,aliasToRemoveAfter:o,completeOnContinue:a},i);if(l)return [l]}async function vr(t,e,i={},r){let{forceCompleteBeforeNext:n=true}=i,{direction:a="right",completeOnContinue:o=n,tickerIdToResume:d=[],aliasToRemoveAfter:h=[],...c}=i,l=[],p;e||(e=t),typeof d=="string"&&(d=[d]),typeof h=="string"&&(h=[h]);let u,m=g.find(t);m&&(u=`${t}_temp_zoom`,g.editAlias(t,u),m instanceof B||m instanceof z?p=m.positionInfo:p={x:m.x,y:m.y,type:"pixel"}),e=tt(t,e,{zIndex:m?m.parent?.getChildIndex(m):void 0}),m?.parent?.setChildIndex(m,m.parent.getChildIndex(m)-.1),u&&g.copyCanvasElementProperty(u,t),u&&g.transferTickers(u,t,"move"),p||(e instanceof B||e instanceof z?p=e.positionInfo:p={x:e.x,y:e.y,type:"pixel"});let T={x:e.pivot.x,y:e.pivot.y},S={x:e.scale.x,y:e.scale.y};if(u)if(i.removeOldComponentWithZoomOut){let P=bi(u,{...i,autoplay:false,completeOnContinue:o},r);P&&(l.push(...P),d.push(...P));}else h.push(u);(e instanceof B||e instanceof z)&&e.haveEmptyTexture&&await e.load(),a==="up"?(e.pivot.y=g.height-e.y,e.pivot.x=g.width/2-e.x,e.y=g.height,e.x=g.width/2):a==="down"?(e.pivot.y=0-e.y,e.pivot.x=g.width/2-e.x,e.y=0,e.x=g.width/2):a==="left"?(e.pivot.x=g.width-e.x,e.pivot.y=g.height/2-e.y,e.x=g.width,e.y=g.height/2):a==="right"&&(e.pivot.x=0-e.x,e.pivot.y=g.height/2-e.y,e.x=0,e.y=g.height/2),e.pivot=exports.CanvasPropertyUtility.getPointBySuperPoint(e.pivot,e.angle),e.scale.set(0);let _=g.pauseTicker({canvasAlias:t});d.push(..._);let f=g.animate(t,{...Ut(p),pivotX:T.x,pivotY:T.y,scaleX:S.x,scaleY:S.y},{...c,tickerIdToResume:d,aliasToRemoveAfter:h,completeOnContinue:o},r);if(f&&l.push(f),l.length>0)return l}function bi(t,e={},i){let{forceCompleteBeforeNext:r=true}=e,{direction:n="right",completeOnContinue:a=r,aliasToRemoveAfter:o=[],...d}=e;typeof o=="string"&&(o=[o]),o.push(t);let h=g.find(t);if(!h){I.warn(`The canvas component "${t}" is not found.`);return}let c={x:h.x,y:h.y},l={x:h.pivot.x,y:h.pivot.y};n==="down"?(c.y=g.height,c.x=g.width/2,l.y=g.height-c.y,l.x=g.width/2-c.x):n==="up"?(c.y=0,c.x=g.width/2,l.y=0-c.y,l.x=g.width/2-c.x):n==="right"?(c.x=g.width,c.y=g.height/2,l.x=g.width-c.x,l.y=g.height/2-c.y):n==="left"&&(c.x=0,c.y=g.height/2,l.x=0-c.x,l.y=g.height/2-c.y),l=exports.CanvasPropertyUtility.getPointBySuperPoint(l,h.angle),g.pauseTicker({canvasAlias:t});let p=g.animate(t,{...c,pivotX:l.x,pivotY:l.y,scaleX:0,scaleY:0},{...d,aliasToRemoveAfter:o,completeOnContinue:a},i);if(p)return [p]}async function Pr(t,e,i={},r){let{forceCompleteBeforeNext:n=true}=i,{direction:a="right",completeOnContinue:o=n,tickerIdToResume:d=[],...h}=i,c=[],l;e||(e=t),typeof d=="string"&&(d=[d]);let p,u=g.find(t);switch(u&&(p=`${t}_temp_push`,g.editAlias(t,p),u instanceof B||u instanceof z?l=u.positionInfo:l={x:u.x,y:u.y,type:"pixel"}),e=tt(t,e,{zIndex:u?u.parent?.getChildIndex(u):void 0}),u?.parent?.setChildIndex(u,u.parent.getChildIndex(u)-.1),p&&g.copyCanvasElementProperty(p,t),p&&g.transferTickers(p,t,"move"),l||((e instanceof B||e instanceof z)&&e.haveEmptyTexture?l=e.positionInfo:l={x:e.x,y:e.y,type:"pixel"}),(e instanceof B||e instanceof z)&&e.haveEmptyTexture&&await e.load(),a){case "up":e.y=g.height+e.height;break;case "down":e.y=-e.height;break;case "left":e.x=g.width+e.width;break;case "right":e.x=-e.width;break}let m=g.pauseTicker({canvasAlias:t});if(d.push(...m),p){let S=Ai(p,{...i,direction:a,completeOnContinue:o});S&&c.push(...S);}let T=g.animate(t,Ut(l),{...h,tickerIdToResume:d,completeOnContinue:o},r);if(T&&c.push(T),c.length>0)return c}function Ai(t,e={direction:"right"},i){return Gt(t,e,i)}var it=class extends xe{constructor(i){super(i);this._memory=i;this.pixivnId=i.pixivnId;}_memory;pixivnId;get memory(){return {...this._memory,...super.memory,elements:[],pixivnId:this.pixivnId}}};function Sr(){return async(e,i)=>{try{let r=e.canvasElementInfo;if(r){let n=new it(r),a=r.zIndex;n.groupColor=16711680;let o=new Ee__default.default.Graphics;o.rect(0,0,300,100).fill({color:16711680,alpha:.5}),n.addChild(o);let d=new Ee__default.default.Text({text:`Error: ${r.label}`,x:10,y:10});n.addChild(d);let h=e.parent;if(h&&"addChild"in h)a!==void 0?h.addChildAt(n,a):h.addChild(n);else {let c=r.parentLabel?g.find(r.parentLabel):void 0;if(c)a!==void 0?c.addChildAt(n,a):c.addChild(n);else {let l=r.label??r.pixivnId;g.add(l,n,{zIndex:a});}}}}catch{}}}function Ir(t,e,i){let r={...g.find(t)?.memory,...i},n=new Re({text:e,...i});return r&&g.copyCanvasElementProperty(r,n),g.add(t,n,{ignoreOldStyle:true,zIndex:i?.zIndex}),n}var {Assets:zo,Color:Ho,Rectangle:No,TextStyle:Wo,Texture:Fo,UPDATE_PRIORITY:Vo}=Ee__default.default,g=new Ze;F.init({getScreen:()=>g.screen});core.GameUnifier.addOnPreContinue(async()=>{try{let t=y._tickersToCompleteOnStepEnd.tikersIds,e=y._tickersToCompleteOnStepEnd.stepAlias,i=(async()=>{for(;t.length;){let{id:n}=t.pop()||{};n&&await g.forceCompletionOfTicker(n);}})(),r=(async()=>{for(;e.length;){let{alias:n,id:a}=e.pop()||{};n&&a&&await g.forceCompletionOfTicker(a,n);}})();await Promise.all([i,r]),y._tickersToCompleteOnStepEnd.tikersIds.length=0,y._tickersToCompleteOnStepEnd.stepAlias.length=0;}catch{}});
2
+ exports.Assets=zo;exports.CanvasBaseItem=Tt;exports.CanvasManagerStatic=y;exports.Color=Ho;exports.Container=xe;exports.ImageContainer=z;exports.ImageSprite=B;exports.Rectangle=No;exports.RegisteredCanvasComponents=U;exports.RegisteredEvents=Lt;exports.RegisteredTickers=Me;exports.Sprite=Oe;exports.Text=Re;exports.TextStyle=Wo;exports.Texture=Fo;exports.TickerBase=ut;exports.UPDATE_PRIORITY=Vo;exports.VideoSprite=ye;exports.addImage=Pt;exports.addImageCointainer=vt;exports.addListenerHandler=Ae;exports.addVideo=St;exports.analizePositionsExtensionProps=pe;exports.canvas=g;exports.canvasComponentDecorator=Vi;exports.drawCanvasErrorHandler=Sr;exports.eventDecorator=Fi;exports.getTexture=Qe;exports.moveIn=Tr;exports.moveOut=Gt;exports.pushIn=Pr;exports.pushOut=Ai;exports.removeWithDissolve=It;exports.removeWithFade=xr;exports.setMemoryContainer=te;exports.shakeEffect=ur;exports.showImage=gr;exports.showImageContainer=fr;exports.showText=Ir;exports.showVideo=yr;exports.showWithDissolve=_i;exports.showWithFade=mr;exports.tickerDecorator=Zi;exports.zoomIn=vr;exports.zoomOut=bi;
package/dist/canvas.d.cts CHANGED
@@ -388,8 +388,8 @@ interface CanvasManagerInterface {
388
388
  removeAll(): void;
389
389
  /**
390
390
  * Edit the alias of a canvas element. The tickers that are connected to the canvas element will be transferred.
391
- * @param oldAlias The old alias of the canvas element.
392
- * @param newAlias The new alias of the canvas element.
391
+ * @param oldAlias The old alias of the component to edit.
392
+ * @param newAlias The new alias of the component.
393
393
  * @param options The options of the canvas element.
394
394
  */
395
395
  editAlias(oldAlias: string, newAlias: string, options?: {
@@ -1208,10 +1208,27 @@ type CanvasElementAliasType = string;
1208
1208
  * Is a decorator that register a canvas component in the game.
1209
1209
  * @param options Options for the canvas component.
1210
1210
  * @returns
1211
+ * @example
1212
+ * ```ts title="canvas/components/AlienTinting.ts"
1213
+ * const ALIEN_TINTING_TEST_ID = "AlienTintingTest";
1214
+ * @canvasComponentDecorator({
1215
+ * name: ALIEN_TINTING_TEST_ID,
1216
+ * })
1217
+ * class AlienTintingTest extends Sprite<IAlienTintingMemory> {
1218
+ * readonly pixivnId: string = CANVAS_SPINE_ID;
1219
+ * override get memory() {
1220
+ * // ...
1221
+ * }
1222
+ * override async setMemory(memory: IAlienTintingMemory) {
1223
+ * // ...
1224
+ * }
1225
+ * // ...
1226
+ * }
1227
+ * ```
1211
1228
  */
1212
1229
  declare function canvasComponentDecorator<M extends CanvasBaseItemMemory, T extends typeof CanvasBaseItem<M>>(options?: {
1213
1230
  /**
1214
- * Name of the canvas component. If the name is already registered, it will show a warning
1231
+ * The id used by Pixi’VN to refer to this class (must be unique). If you don't pass the id, the class name will be used as the id.
1215
1232
  * @default target.name
1216
1233
  */
1217
1234
  name?: CanvasElementAliasType;
package/dist/canvas.d.ts CHANGED
@@ -388,8 +388,8 @@ interface CanvasManagerInterface {
388
388
  removeAll(): void;
389
389
  /**
390
390
  * Edit the alias of a canvas element. The tickers that are connected to the canvas element will be transferred.
391
- * @param oldAlias The old alias of the canvas element.
392
- * @param newAlias The new alias of the canvas element.
391
+ * @param oldAlias The old alias of the component to edit.
392
+ * @param newAlias The new alias of the component.
393
393
  * @param options The options of the canvas element.
394
394
  */
395
395
  editAlias(oldAlias: string, newAlias: string, options?: {
@@ -1208,10 +1208,27 @@ type CanvasElementAliasType = string;
1208
1208
  * Is a decorator that register a canvas component in the game.
1209
1209
  * @param options Options for the canvas component.
1210
1210
  * @returns
1211
+ * @example
1212
+ * ```ts title="canvas/components/AlienTinting.ts"
1213
+ * const ALIEN_TINTING_TEST_ID = "AlienTintingTest";
1214
+ * @canvasComponentDecorator({
1215
+ * name: ALIEN_TINTING_TEST_ID,
1216
+ * })
1217
+ * class AlienTintingTest extends Sprite<IAlienTintingMemory> {
1218
+ * readonly pixivnId: string = CANVAS_SPINE_ID;
1219
+ * override get memory() {
1220
+ * // ...
1221
+ * }
1222
+ * override async setMemory(memory: IAlienTintingMemory) {
1223
+ * // ...
1224
+ * }
1225
+ * // ...
1226
+ * }
1227
+ * ```
1211
1228
  */
1212
1229
  declare function canvasComponentDecorator<M extends CanvasBaseItemMemory, T extends typeof CanvasBaseItem<M>>(options?: {
1213
1230
  /**
1214
- * Name of the canvas component. If the name is already registered, it will show a warning
1231
+ * The id used by Pixi’VN to refer to this class (must be unique). If you don't pass the id, the class name will be used as the id.
1215
1232
  * @default target.name
1216
1233
  */
1217
1234
  name?: CanvasElementAliasType;