@drincs/pixi-vn 1.9.4 → 1.9.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/canvas.cjs +2 -2
- package/dist/canvas.d.cts +999 -914
- package/dist/canvas.d.ts +999 -914
- package/dist/canvas.mjs +2 -2
- package/dist/chunk-XLRCR56W.mjs +1 -0
- package/dist/core.d.cts +8 -2
- package/dist/core.d.ts +8 -2
- package/dist/filters.cjs +1 -1
- package/dist/filters.d.cts +16 -2
- package/dist/filters.d.ts +16 -2
- package/dist/filters.mjs +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +2 -2
- package/dist/motion.cjs +1 -1
- package/dist/motion.d.cts +6 -1
- package/dist/motion.d.ts +6 -1
- package/dist/motion.mjs +1 -1
- package/dist/tickers.cjs +1 -1
- package/dist/tickers.d.cts +71 -1
- package/dist/tickers.d.ts +71 -1
- package/dist/tickers.mjs +1 -1
- package/dist/worker.cjs +1 -1
- package/package.json +1 -1
package/dist/canvas.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var core=require('@drincs/pixi-vn/core'),ut=require('@drincs/pixi-vn/pixi.js'),tickers=require('@drincs/pixi-vn/tickers'),devtools=require('@pixi/devtools'),filters=require('@drincs/pixi-vn/filters');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var ut__default=/*#__PURE__*/_interopDefault(ut);var pn=Object.defineProperty;var zi=t=>{throw TypeError(t)};var gn=(t,e,i)=>e in t?pn(t,e,{enumerable:true,configurable:true,writable:true,value:i}):t[e]=i;var ve=(t,e,i)=>gn(t,typeof e!="symbol"?e+"":e,i),oi=(t,e,i)=>e.has(t)||zi("Cannot "+i);var s=(t,e,i)=>(oi(t,e,"read from private field"),i?i.call(t):e.get(t)),te=(t,e,i)=>e.has(t)?zi("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),z=(t,e,i,n)=>(oi(t,e,"write to private field"),e.set(t,i),i),F=(t,e,i)=>(oi(t,e,"access private method"),i);var Ut=(t,e,i,n)=>({set _(o){z(t,e,o);},get _(){return s(t,e,n)}});var mn={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}}}]}},Yi=mn;var Le="__game_layer__",yt="Container",Wt="ImageContainer",xt="Image",Pt="Sprite",vt="Text",It="Video";var k;(o=>(o.log=(l,...c)=>console.log(`[Pixi\u2019VN] ${l}`,...c),o.warn=(l,...c)=>console.warn(`[Pixi\u2019VN] ${l}`,...c),o.error=(l,...c)=>console.error(`[Pixi\u2019VN] ${l}`,...c),o.info=(l,...c)=>console.info(`[Pixi\u2019VN] ${l}`,...c)))(k||={});function Ui(t,e){let i=0;return async(...n)=>{let o=Date.now();if(o-i>=e)return i=o,await t(...n)}}var fe=class t{constructor(){}static _app=void 0;static get app(){if(!t._app)throw k.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(Le);return e||(e=new ut__default.default.Container,e.label=Le,t.app.stage.addChild(e)),e}static htmlLayers=[];static canvasWidth=300;static canvasHeight=300;static _isInitialized=false;static async init(e,i,n){let{id:o="pixi-vn-canvas",width:l=800,height:c=600,resolution:y=1,autoDensity:x=true,resizeMode:u="contain",...P}=i||{};return t.canvasWidth=l,t.canvasHeight=c,t._app=new ut__default.default.Application,t.app.init({width:l,height:c,resolution:y,autoDensity:x,...P}).then(()=>{let{app:b=t.app,extensions:A=[],...L}=n||{};if(devtools.initDevtools({app:b,extensions:[Yi,...A],...L}),t._isInitialized=true,t.addCanvasIntoHTMLElement(e,o),u==="contain"){let H=Ui(async()=>{requestAnimationFrame(()=>t.resize());},10);new ResizeObserver(H).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):k.error("GameWindowManager is not initialized");}static addHtmlLayer(e,i,n={}){let{position:o="absolute",pointerEvents:l="none",userSelect:c="none"}=n,y=document.createElement("div");y.setAttribute("id",e),y.style.position=o,y.style.pointerEvents=l,y.style.userSelect=c;let x=i.appendChild(y);return t.htmlLayers.push(y),t.resize(),x}static removeHtmlLayer(e){let i=t.htmlLayers.find(n=>n.id===e);i&&(i.remove(),t.htmlLayers=t.htmlLayers.filter(n=>n.id!==e));}static getHtmlLayer(e){return t.htmlLayers.find(i=>i.id===e)}static async resize(){let e=t.canvasWidth,i=t.canvasHeight,n=t.app.resizeTo,o=t.app.canvas.style;n instanceof HTMLElement||(n=document.documentElement);let l,c;if(n===document.body||n===document.documentElement)l=document.documentElement.clientWidth||window.innerWidth,c=document.documentElement.clientHeight||window.innerHeight;else {let A=n.getBoundingClientRect();l=A.width||n.clientWidth,c=A.height||n.clientHeight;}let y=Math.min(l/e,c/i),x=Math.floor(y*e),u=Math.floor(y*i);o.width=`${x}px`,o.height=`${u}px`;let P=(l-x)/2,b=(c-u)/2;o.marginLeft=`${P}px`,o.marginRight=`${P}px`,o.marginTop=`${b}px`,o.marginBottom=`${b}px`,t.htmlLayers.forEach(A=>{A.style.width=`${x}px`,A.style.height=`${u}px`,A.style.marginLeft=`${P}px`,A.style.marginRight=`${P}px`,A.style.marginTop=`${b}px`,A.style.marginBottom=`${b}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)}};var Pn=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Vi=new Set,ai=typeof process=="object"&&process?process:{},$i=(t,e,i,n)=>{typeof ai.emitWarning=="function"?ai.emitWarning(t,e,i,n):console.error(`[${i}] ${e}: ${t}`);},Vt=globalThis.AbortController,Hi=globalThis.AbortSignal;if(typeof Vt>"u"){Hi=class{onabort;_onabort=[];reason;aborted=false;addEventListener(i,n){this._onabort.push(n);}},Vt=class{constructor(){e();}signal=new Hi;abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=true;for(let n of this.signal._onabort)n(i);this.signal.onabort?.(i);}}};let t=ai.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{t&&(t=false,$i("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 vn=t=>!Vi.has(t);var et=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),Xi=t=>et(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?Ht:null:null,Ht=class extends Array{constructor(t){super(t),this.fill(0);}},je,Tt,In=(je=class{heap;length;static create(e){let i=Xi(e);if(!i)return [];z(je,Tt,true);let n=new je(e,i);return z(je,Tt,false),n}constructor(e,i){if(!s(je,Tt))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]}},Tt=new WeakMap,te(je,Tt,false),je),Gi,Ni,ke,Ee,ze,at,Ye,Ct,bt,Ue,ge,We,he,le,q,be,Oe,Te,ye,He,xe,Ge,Ne,_e,Me,Ve,rt,we,wt,R,li,lt,Je,Rt,Re,Ki,ct,St,Dt,tt,it,ci,Gt,Nt,ae,di,Mt,nt,ui,At,ji=(At=class{constructor(e){te(this,R);te(this,ke);te(this,Ee);te(this,ze);te(this,at);te(this,Ye);te(this,Ct);te(this,bt);te(this,Ue);ve(this,"ttl");ve(this,"ttlResolution");ve(this,"ttlAutopurge");ve(this,"updateAgeOnGet");ve(this,"updateAgeOnHas");ve(this,"allowStale");ve(this,"noDisposeOnSet");ve(this,"noUpdateTTL");ve(this,"maxEntrySize");ve(this,"sizeCalculation");ve(this,"noDeleteOnFetchRejection");ve(this,"noDeleteOnStaleGet");ve(this,"allowStaleOnFetchAbort");ve(this,"allowStaleOnFetchRejection");ve(this,"ignoreFetchAbort");te(this,ge);te(this,We);te(this,he);te(this,le);te(this,q);te(this,be);te(this,Oe);te(this,Te);te(this,ye);te(this,He);te(this,xe);te(this,Ge);te(this,Ne);te(this,_e);te(this,Me);te(this,Ve);te(this,rt);te(this,we);te(this,wt);te(this,lt,()=>{});te(this,Je,()=>{});te(this,Rt,()=>{});te(this,Re,()=>false);te(this,ct,e=>{});te(this,St,(e,i,n)=>{});te(this,Dt,(e,i,n,o)=>{if(n||o)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});ve(this,Gi,"LRUCache");let{max:i=0,ttl:n,ttlResolution:o=1,ttlAutopurge:l,updateAgeOnGet:c,updateAgeOnHas:y,allowStale:x,dispose:u,onInsert:P,disposeAfter:b,noDisposeOnSet:A,noUpdateTTL:L,maxSize:H=0,maxEntrySize:Y=0,sizeCalculation:re,fetchMethod:w,memoMethod:N,noDeleteOnFetchRejection:G,noDeleteOnStaleGet:M,allowStaleOnFetchRejection:D,allowStaleOnFetchAbort:V,ignoreFetchAbort:j,perf:J}=e;if(J!==void 0&&typeof J?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(z(this,Ue,J??Pn),i!==0&&!et(i))throw new TypeError("max option must be a nonnegative integer");let U=i?Xi(i):Array;if(!U)throw new Error("invalid max value: "+i);if(z(this,ke,i),z(this,Ee,H),this.maxEntrySize=Y||s(this,Ee),this.sizeCalculation=re,this.sizeCalculation){if(!s(this,Ee)&&!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(N!==void 0&&typeof N!="function")throw new TypeError("memoMethod must be a function if defined");if(z(this,bt,N),w!==void 0&&typeof w!="function")throw new TypeError("fetchMethod must be a function if specified");if(z(this,Ct,w),z(this,rt,!!w),z(this,he,new Map),z(this,le,new Array(i).fill(void 0)),z(this,q,new Array(i).fill(void 0)),z(this,be,new U(i)),z(this,Oe,new U(i)),z(this,Te,0),z(this,ye,0),z(this,He,In.create(i)),z(this,ge,0),z(this,We,0),typeof u=="function"&&z(this,ze,u),typeof P=="function"&&z(this,at,P),typeof b=="function"?(z(this,Ye,b),z(this,xe,[])):(z(this,Ye,void 0),z(this,xe,void 0)),z(this,Ve,!!s(this,ze)),z(this,wt,!!s(this,at)),z(this,we,!!s(this,Ye)),this.noDisposeOnSet=!!A,this.noUpdateTTL=!!L,this.noDeleteOnFetchRejection=!!G,this.allowStaleOnFetchRejection=!!D,this.allowStaleOnFetchAbort=!!V,this.ignoreFetchAbort=!!j,this.maxEntrySize!==0){if(s(this,Ee)!==0&&!et(s(this,Ee)))throw new TypeError("maxSize must be a positive integer if specified");if(!et(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");F(this,R,Ki).call(this);}if(this.allowStale=!!x,this.noDeleteOnStaleGet=!!M,this.updateAgeOnGet=!!c,this.updateAgeOnHas=!!y,this.ttlResolution=et(o)||o===0?o:1,this.ttlAutopurge=!!l,this.ttl=n||0,this.ttl){if(!et(this.ttl))throw new TypeError("ttl must be a positive integer if specified");F(this,R,li).call(this);}if(s(this,ke)===0&&this.ttl===0&&s(this,Ee)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!s(this,ke)&&!s(this,Ee)){let W="LRU_CACHE_UNBOUNDED";vn(W)&&(Vi.add(W),$i("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",W,At));}}get perf(){return s(this,Ue)}static unsafeExposeInternals(e){return {starts:s(e,Ne),ttls:s(e,_e),autopurgeTimers:s(e,Me),sizes:s(e,Ge),keyMap:s(e,he),keyList:s(e,le),valList:s(e,q),next:s(e,be),prev:s(e,Oe),get head(){return s(e,Te)},get tail(){return s(e,ye)},free:s(e,He),isBackgroundFetch:i=>{var n;return F(n=e,R,ae).call(n,i)},backgroundFetch:(i,n,o,l)=>{var c;return F(c=e,R,Nt).call(c,i,n,o,l)},moveToTail:i=>{var n;return F(n=e,R,Mt).call(n,i)},indexes:i=>{var n;return F(n=e,R,tt).call(n,i)},rindexes:i=>{var n;return F(n=e,R,it).call(n,i)},isStale:i=>{var n;return s(n=e,Re).call(n,i)}}}get max(){return s(this,ke)}get maxSize(){return s(this,Ee)}get calculatedSize(){return s(this,We)}get size(){return s(this,ge)}get fetchMethod(){return s(this,Ct)}get memoMethod(){return s(this,bt)}get dispose(){return s(this,ze)}get onInsert(){return s(this,at)}get disposeAfter(){return s(this,Ye)}getRemainingTTL(e){return s(this,he).has(e)?1/0:0}*entries(){for(let e of F(this,R,tt).call(this))s(this,q)[e]!==void 0&&s(this,le)[e]!==void 0&&!F(this,R,ae).call(this,s(this,q)[e])&&(yield [s(this,le)[e],s(this,q)[e]]);}*rentries(){for(let e of F(this,R,it).call(this))s(this,q)[e]!==void 0&&s(this,le)[e]!==void 0&&!F(this,R,ae).call(this,s(this,q)[e])&&(yield [s(this,le)[e],s(this,q)[e]]);}*keys(){for(let e of F(this,R,tt).call(this)){let i=s(this,le)[e];i!==void 0&&!F(this,R,ae).call(this,s(this,q)[e])&&(yield i);}}*rkeys(){for(let e of F(this,R,it).call(this)){let i=s(this,le)[e];i!==void 0&&!F(this,R,ae).call(this,s(this,q)[e])&&(yield i);}}*values(){for(let e of F(this,R,tt).call(this))s(this,q)[e]!==void 0&&!F(this,R,ae).call(this,s(this,q)[e])&&(yield s(this,q)[e]);}*rvalues(){for(let e of F(this,R,it).call(this))s(this,q)[e]!==void 0&&!F(this,R,ae).call(this,s(this,q)[e])&&(yield s(this,q)[e]);}[(Ni=Symbol.iterator,Gi=Symbol.toStringTag,Ni)](){return this.entries()}find(e,i={}){for(let n of F(this,R,tt).call(this)){let o=s(this,q)[n],l=F(this,R,ae).call(this,o)?o.__staleWhileFetching:o;if(l!==void 0&&e(l,s(this,le)[n],this))return this.get(s(this,le)[n],i)}}forEach(e,i=this){for(let n of F(this,R,tt).call(this)){let o=s(this,q)[n],l=F(this,R,ae).call(this,o)?o.__staleWhileFetching:o;l!==void 0&&e.call(i,l,s(this,le)[n],this);}}rforEach(e,i=this){for(let n of F(this,R,it).call(this)){let o=s(this,q)[n],l=F(this,R,ae).call(this,o)?o.__staleWhileFetching:o;l!==void 0&&e.call(i,l,s(this,le)[n],this);}}purgeStale(){let e=false;for(let i of F(this,R,it).call(this,{allowStale:true}))s(this,Re).call(this,i)&&(F(this,R,nt).call(this,s(this,le)[i],"expire"),e=true);return e}info(e){let i=s(this,he).get(e);if(i===void 0)return;let n=s(this,q)[i],o=F(this,R,ae).call(this,n)?n.__staleWhileFetching:n;if(o===void 0)return;let l={value:o};if(s(this,_e)&&s(this,Ne)){let c=s(this,_e)[i],y=s(this,Ne)[i];if(c&&y){let x=c-(s(this,Ue).now()-y);l.ttl=x,l.start=Date.now();}}return s(this,Ge)&&(l.size=s(this,Ge)[i]),l}dump(){let e=[];for(let i of F(this,R,tt).call(this,{allowStale:true})){let n=s(this,le)[i],o=s(this,q)[i],l=F(this,R,ae).call(this,o)?o.__staleWhileFetching:o;if(l===void 0||n===void 0)continue;let c={value:l};if(s(this,_e)&&s(this,Ne)){c.ttl=s(this,_e)[i];let y=s(this,Ue).now()-s(this,Ne)[i];c.start=Math.floor(Date.now()-y);}s(this,Ge)&&(c.size=s(this,Ge)[i]),e.unshift([n,c]);}return e}load(e){this.clear();for(let[i,n]of e){if(n.start){let o=Date.now()-n.start;n.start=s(this,Ue).now()-o;}this.set(i,n.value,n);}}set(e,i,n={}){var A,L,H,Y;if(i===void 0)return this.delete(e),this;let{ttl:o=this.ttl,start:l,noDisposeOnSet:c=this.noDisposeOnSet,sizeCalculation:y=this.sizeCalculation,status:x}=n,{noUpdateTTL:u=this.noUpdateTTL}=n,P=s(this,Dt).call(this,e,i,n.size||0,y);if(this.maxEntrySize&&P>this.maxEntrySize)return x&&(x.set="miss",x.maxEntrySizeExceeded=true),F(this,R,nt).call(this,e,"set"),this;let b=s(this,ge)===0?void 0:s(this,he).get(e);if(b===void 0)b=s(this,ge)===0?s(this,ye):s(this,He).length!==0?s(this,He).pop():s(this,ge)===s(this,ke)?F(this,R,Gt).call(this,false):s(this,ge),s(this,le)[b]=e,s(this,q)[b]=i,s(this,he).set(e,b),s(this,be)[s(this,ye)]=b,s(this,Oe)[b]=s(this,ye),z(this,ye,b),Ut(this,ge)._++,s(this,St).call(this,b,P,x),x&&(x.set="add"),u=false,s(this,wt)&&((A=s(this,at))==null||A.call(this,i,e,"add"));else {F(this,R,Mt).call(this,b);let re=s(this,q)[b];if(i!==re){if(s(this,rt)&&F(this,R,ae).call(this,re)){re.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:w}=re;w!==void 0&&!c&&(s(this,Ve)&&((L=s(this,ze))==null||L.call(this,w,e,"set")),s(this,we)&&s(this,xe)?.push([w,e,"set"]));}else c||(s(this,Ve)&&((H=s(this,ze))==null||H.call(this,re,e,"set")),s(this,we)&&s(this,xe)?.push([re,e,"set"]));if(s(this,ct).call(this,b),s(this,St).call(this,b,P,x),s(this,q)[b]=i,x){x.set="replace";let w=re&&F(this,R,ae).call(this,re)?re.__staleWhileFetching:re;w!==void 0&&(x.oldValue=w);}}else x&&(x.set="update");s(this,wt)&&this.onInsert?.(i,e,i===re?"update":"replace");}if(o!==0&&!s(this,_e)&&F(this,R,li).call(this),s(this,_e)&&(u||s(this,Rt).call(this,b,o,l),x&&s(this,Je).call(this,x,b)),!c&&s(this,we)&&s(this,xe)){let re=s(this,xe),w;for(;w=re?.shift();)(Y=s(this,Ye))==null||Y.call(this,...w);}return this}pop(){var e;try{for(;s(this,ge);){let i=s(this,q)[s(this,Te)];if(F(this,R,Gt).call(this,!0),F(this,R,ae).call(this,i)){if(i.__staleWhileFetching)return i.__staleWhileFetching}else if(i!==void 0)return i}}finally{if(s(this,we)&&s(this,xe)){let i=s(this,xe),n;for(;n=i?.shift();)(e=s(this,Ye))==null||e.call(this,...n);}}}has(e,i={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:o}=i,l=s(this,he).get(e);if(l!==void 0){let c=s(this,q)[l];if(F(this,R,ae).call(this,c)&&c.__staleWhileFetching===void 0)return false;if(s(this,Re).call(this,l))o&&(o.has="stale",s(this,Je).call(this,o,l));else return n&&s(this,lt).call(this,l),o&&(o.has="hit",s(this,Je).call(this,o,l)),true}else o&&(o.has="miss");return false}peek(e,i={}){let{allowStale:n=this.allowStale}=i,o=s(this,he).get(e);if(o===void 0||!n&&s(this,Re).call(this,o))return;let l=s(this,q)[o];return F(this,R,ae).call(this,l)?l.__staleWhileFetching:l}async fetch(e,i={}){let{allowStale:n=this.allowStale,updateAgeOnGet:o=this.updateAgeOnGet,noDeleteOnStaleGet:l=this.noDeleteOnStaleGet,ttl:c=this.ttl,noDisposeOnSet:y=this.noDisposeOnSet,size:x=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:P=this.noUpdateTTL,noDeleteOnFetchRejection:b=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:A=this.allowStaleOnFetchRejection,ignoreFetchAbort:L=this.ignoreFetchAbort,allowStaleOnFetchAbort:H=this.allowStaleOnFetchAbort,context:Y,forceRefresh:re=false,status:w,signal:N}=i;if(!s(this,rt))return w&&(w.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:o,noDeleteOnStaleGet:l,status:w});let G={allowStale:n,updateAgeOnGet:o,noDeleteOnStaleGet:l,ttl:c,noDisposeOnSet:y,size:x,sizeCalculation:u,noUpdateTTL:P,noDeleteOnFetchRejection:b,allowStaleOnFetchRejection:A,allowStaleOnFetchAbort:H,ignoreFetchAbort:L,status:w,signal:N},M=s(this,he).get(e);if(M===void 0){w&&(w.fetch="miss");let D=F(this,R,Nt).call(this,e,M,G,Y);return D.__returned=D}else {let D=s(this,q)[M];if(F(this,R,ae).call(this,D)){let U=n&&D.__staleWhileFetching!==void 0;return w&&(w.fetch="inflight",U&&(w.returnedStale=true)),U?D.__staleWhileFetching:D.__returned=D}let V=s(this,Re).call(this,M);if(!re&&!V)return w&&(w.fetch="hit"),F(this,R,Mt).call(this,M),o&&s(this,lt).call(this,M),w&&s(this,Je).call(this,w,M),D;let j=F(this,R,Nt).call(this,e,M,G,Y),J=j.__staleWhileFetching!==void 0&&n;return w&&(w.fetch=V?"stale":"refresh",J&&V&&(w.returnedStale=true)),J?j.__staleWhileFetching:j.__returned=j}}async forceFetch(e,i={}){let n=await this.fetch(e,i);if(n===void 0)throw new Error("fetch() returned undefined");return n}memo(e,i={}){let n=s(this,bt);if(!n)throw new Error("no memoMethod provided to constructor");let{context:o,forceRefresh:l,...c}=i,y=this.get(e,c);if(!l&&y!==void 0)return y;let x=n(e,y,{options:c,context:o});return this.set(e,x,c),x}get(e,i={}){let{allowStale:n=this.allowStale,updateAgeOnGet:o=this.updateAgeOnGet,noDeleteOnStaleGet:l=this.noDeleteOnStaleGet,status:c}=i,y=s(this,he).get(e);if(y!==void 0){let x=s(this,q)[y],u=F(this,R,ae).call(this,x);return c&&s(this,Je).call(this,c,y),s(this,Re).call(this,y)?(c&&(c.get="stale"),u?(c&&n&&x.__staleWhileFetching!==void 0&&(c.returnedStale=true),n?x.__staleWhileFetching:void 0):(l||F(this,R,nt).call(this,e,"expire"),c&&n&&(c.returnedStale=true),n?x:void 0)):(c&&(c.get="hit"),u?x.__staleWhileFetching:(F(this,R,Mt).call(this,y),o&&s(this,lt).call(this,y),x))}else c&&(c.get="miss");}delete(e){return F(this,R,nt).call(this,e,"delete")}clear(){return F(this,R,ui).call(this,"delete")}},ke=new WeakMap,Ee=new WeakMap,ze=new WeakMap,at=new WeakMap,Ye=new WeakMap,Ct=new WeakMap,bt=new WeakMap,Ue=new WeakMap,ge=new WeakMap,We=new WeakMap,he=new WeakMap,le=new WeakMap,q=new WeakMap,be=new WeakMap,Oe=new WeakMap,Te=new WeakMap,ye=new WeakMap,He=new WeakMap,xe=new WeakMap,Ge=new WeakMap,Ne=new WeakMap,_e=new WeakMap,Me=new WeakMap,Ve=new WeakMap,rt=new WeakMap,we=new WeakMap,wt=new WeakMap,R=new WeakSet,li=function(){let e=new Ht(s(this,ke)),i=new Ht(s(this,ke));z(this,_e,e),z(this,Ne,i);let n=this.ttlAutopurge?new Array(s(this,ke)):void 0;z(this,Me,n),z(this,Rt,(y,x,u=s(this,Ue).now())=>{i[y]=x!==0?u:0,e[y]=x,o(y,x);}),z(this,lt,y=>{i[y]=e[y]!==0?s(this,Ue).now():0,o(y,e[y]);});let o=this.ttlAutopurge?(y,x)=>{if(n?.[y]&&(clearTimeout(n[y]),n[y]=void 0),x&&x!==0&&n){let u=setTimeout(()=>{s(this,Re).call(this,y)&&F(this,R,nt).call(this,s(this,le)[y],"expire");},x+1);u.unref&&u.unref(),n[y]=u;}}:()=>{};z(this,Je,(y,x)=>{if(e[x]){let u=e[x],P=i[x];if(!u||!P)return;y.ttl=u,y.start=P,y.now=l||c();let b=y.now-P;y.remainingTTL=u-b;}});let l=0,c=()=>{let y=s(this,Ue).now();if(this.ttlResolution>0){l=y;let x=setTimeout(()=>l=0,this.ttlResolution);x.unref&&x.unref();}return y};this.getRemainingTTL=y=>{let x=s(this,he).get(y);if(x===void 0)return 0;let u=e[x],P=i[x];if(!u||!P)return 1/0;let b=(l||c())-P;return u-b},z(this,Re,y=>{let x=i[y],u=e[y];return !!u&&!!x&&(l||c())-x>u});},lt=new WeakMap,Je=new WeakMap,Rt=new WeakMap,Re=new WeakMap,Ki=function(){let e=new Ht(s(this,ke));z(this,We,0),z(this,Ge,e),z(this,ct,i=>{z(this,We,s(this,We)-e[i]),e[i]=0;}),z(this,Dt,(i,n,o,l)=>{if(F(this,R,ae).call(this,n))return 0;if(!et(o))if(l){if(typeof l!="function")throw new TypeError("sizeCalculation must be a function");if(o=l(n,i),!et(o))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return o}),z(this,St,(i,n,o)=>{if(e[i]=n,s(this,Ee)){let l=s(this,Ee)-e[i];for(;s(this,We)>l;)F(this,R,Gt).call(this,true);}z(this,We,s(this,We)+e[i]),o&&(o.entrySize=n,o.totalCalculatedSize=s(this,We));});},ct=new WeakMap,St=new WeakMap,Dt=new WeakMap,tt=function*({allowStale:e=this.allowStale}={}){if(s(this,ge))for(let i=s(this,ye);!(!F(this,R,ci).call(this,i)||((e||!s(this,Re).call(this,i))&&(yield i),i===s(this,Te)));)i=s(this,Oe)[i];},it=function*({allowStale:e=this.allowStale}={}){if(s(this,ge))for(let i=s(this,Te);!(!F(this,R,ci).call(this,i)||((e||!s(this,Re).call(this,i))&&(yield i),i===s(this,ye)));)i=s(this,be)[i];},ci=function(e){return e!==void 0&&s(this,he).get(s(this,le)[e])===e},Gt=function(e){var l;let i=s(this,Te),n=s(this,le)[i],o=s(this,q)[i];return s(this,rt)&&F(this,R,ae).call(this,o)?o.__abortController.abort(new Error("evicted")):(s(this,Ve)||s(this,we))&&(s(this,Ve)&&((l=s(this,ze))==null||l.call(this,o,n,"evict")),s(this,we)&&s(this,xe)?.push([o,n,"evict"])),s(this,ct).call(this,i),s(this,Me)?.[i]&&(clearTimeout(s(this,Me)[i]),s(this,Me)[i]=void 0),e&&(s(this,le)[i]=void 0,s(this,q)[i]=void 0,s(this,He).push(i)),s(this,ge)===1?(z(this,Te,z(this,ye,0)),s(this,He).length=0):z(this,Te,s(this,be)[i]),s(this,he).delete(n),Ut(this,ge)._--,i},Nt=function(e,i,n,o){let l=i===void 0?void 0:s(this,q)[i];if(F(this,R,ae).call(this,l))return l;let c=new Vt,{signal:y}=n;y?.addEventListener("abort",()=>c.abort(y.reason),{signal:c.signal});let x={signal:c.signal,options:n,context:o},u=(Y,re=false)=>{let{aborted:w}=c.signal,N=n.ignoreFetchAbort&&Y!==void 0,G=n.ignoreFetchAbort||!!(n.allowStaleOnFetchAbort&&Y!==void 0);if(n.status&&(w&&!re?(n.status.fetchAborted=true,n.status.fetchError=c.signal.reason,N&&(n.status.fetchAbortIgnored=true)):n.status.fetchResolved=true),w&&!N&&!re)return b(c.signal.reason,G);let M=L,D=s(this,q)[i];return (D===L||N&&re&&D===void 0)&&(Y===void 0?M.__staleWhileFetching!==void 0?s(this,q)[i]=M.__staleWhileFetching:F(this,R,nt).call(this,e,"fetch"):(n.status&&(n.status.fetchUpdated=true),this.set(e,Y,x.options))),Y},P=Y=>(n.status&&(n.status.fetchRejected=true,n.status.fetchError=Y),b(Y,false)),b=(Y,re)=>{let{aborted:w}=c.signal,N=w&&n.allowStaleOnFetchAbort,G=N||n.allowStaleOnFetchRejection,M=G||n.noDeleteOnFetchRejection,D=L;if(s(this,q)[i]===L&&(!M||!re&&D.__staleWhileFetching===void 0?F(this,R,nt).call(this,e,"fetch"):N||(s(this,q)[i]=D.__staleWhileFetching)),G)return n.status&&D.__staleWhileFetching!==void 0&&(n.status.returnedStale=true),D.__staleWhileFetching;if(D.__returned===D)throw Y},A=(Y,re)=>{var N;let w=(N=s(this,Ct))==null?void 0:N.call(this,e,l,x);w&&w instanceof Promise&&w.then(G=>Y(G===void 0?void 0:G),re),c.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(Y(void 0),n.allowStaleOnFetchAbort&&(Y=G=>u(G,true)));});};n.status&&(n.status.fetchDispatched=true);let L=new Promise(A).then(u,P),H=Object.assign(L,{__abortController:c,__staleWhileFetching:l,__returned:void 0});return i===void 0?(this.set(e,H,{...x.options,status:void 0}),i=s(this,he).get(e)):s(this,q)[i]=H,H},ae=function(e){if(!s(this,rt))return false;let i=e;return !!i&&i instanceof Promise&&i.hasOwnProperty("__staleWhileFetching")&&i.__abortController instanceof Vt},di=function(e,i){s(this,Oe)[i]=e,s(this,be)[e]=i;},Mt=function(e){e!==s(this,ye)&&(e===s(this,Te)?z(this,Te,s(this,be)[e]):F(this,R,di).call(this,s(this,Oe)[e],s(this,be)[e]),F(this,R,di).call(this,s(this,ye),e),z(this,ye,e));},nt=function(e,i){var o,l;let n=false;if(s(this,ge)!==0){let c=s(this,he).get(e);if(c!==void 0)if(s(this,Me)?.[c]&&(clearTimeout(s(this,Me)?.[c]),s(this,Me)[c]=void 0),n=true,s(this,ge)===1)F(this,R,ui).call(this,i);else {s(this,ct).call(this,c);let y=s(this,q)[c];if(F(this,R,ae).call(this,y)?y.__abortController.abort(new Error("deleted")):(s(this,Ve)||s(this,we))&&(s(this,Ve)&&((o=s(this,ze))==null||o.call(this,y,e,i)),s(this,we)&&s(this,xe)?.push([y,e,i])),s(this,he).delete(e),s(this,le)[c]=void 0,s(this,q)[c]=void 0,c===s(this,ye))z(this,ye,s(this,Oe)[c]);else if(c===s(this,Te))z(this,Te,s(this,be)[c]);else {let x=s(this,Oe)[c];s(this,be)[x]=s(this,be)[c];let u=s(this,be)[c];s(this,Oe)[u]=s(this,Oe)[c];}Ut(this,ge)._--,s(this,He).push(c);}}if(s(this,we)&&s(this,xe)?.length){let c=s(this,xe),y;for(;y=c?.shift();)(l=s(this,Ye))==null||l.call(this,...y);}return n},ui=function(e){var i,n;for(let o of F(this,R,it).call(this,{allowStale:true})){let l=s(this,q)[o];if(F(this,R,ae).call(this,l))l.__abortController.abort(new Error("deleted"));else {let c=s(this,le)[o];s(this,Ve)&&((i=s(this,ze))==null||i.call(this,l,c,e)),s(this,we)&&s(this,xe)?.push([l,c,e]);}}if(s(this,he).clear(),s(this,q).fill(void 0),s(this,le).fill(void 0),s(this,_e)&&s(this,Ne)){s(this,_e).fill(0),s(this,Ne).fill(0);for(let o of s(this,Me)??[])o!==void 0&&clearTimeout(o);s(this,Me)?.fill(void 0);}if(s(this,Ge)&&s(this,Ge).fill(0),z(this,Te,0),z(this,ye,0),s(this,He).length=0,z(this,We,0),z(this,ge,0),s(this,we)&&s(this,xe)){let o=s(this,xe),l;for(;l=o?.shift();)(n=s(this,Ye))==null||n.call(this,...l);}},At);var Ke=class{cache;map=new Map;constructor(e){this.cache=new ji({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 fi=Symbol("SerializableEvent"),Et=new Ke({cacheSize:5});function Tn(t){return (e,i,n)=>{let o=n.value;hi.add(o,t||`${i}`);}}var hi;(l=>{function t(c,y){c[fi]=y,Et.get(y)&&k.info(`Event "${y}" already exists, it will be overwritten`),Et.set(y,c);}l.add=t;function e(c){try{let y=Et.get(c);if(!y){k.error(`Event "${c}" not found, did you forget to register it with the eventDecorator?`);return}return y}catch(y){k.error(`Error while getting Event "${c}"`,y);return}}l.get=e;function i(){return Array.from(Et.values())}l.values=i;function n(c){return Et.has(c)}l.has=n;function o(){return Array.from(Et.keys())}l.keys=o;})(hi||={});var pi=hi;async function qi(t,e){if("onEvents"in e)for(let i in e.onEvents){let n=e.onEvents[i],o=pi.get(n);o&&t.on(i,o);}}function Zi(t){let{onEventsHandlers:e={}}=t;return e}function dt(t,e,i){let n=i[fi];return n&&typeof n=="string"?(e.onEventsHandlers[t]=n,true):(k.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 Ot=new Ke({cacheSize:5}),Ji=new Ke({cacheSize:2}),Qi=new Ke({cacheSize:2});function bn(t={}){return e=>{gi.add(e,t);}}async function Be(t,e,i){let n=i?.ignoreScale||false,o=i?.end;if("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),!n&&"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),qi(t,e),"pixivnFilters"in e&&e.pixivnFilters!==void 0){let l=e.pixivnFilters.map(c=>filters.RegisteredFilters.getInstance(c.filterId,c.args)).filter(c=>!!c);t.filters=l.length>0?l:null;}"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),o&&await o(),n||("width"in e&&e.width!==void 0&&(t.width=e.width),"height"in e&&e.height!==void 0&&(t.height=e.height));}var gi;(y=>{function t(x,u={}){let{name:P=x.name,getInstance:b=async(L,H)=>{let Y=new L;return await Y.setMemory(H),Y},copyProperty:A=async(L,H)=>{await L.setMemory(H);}}=u;Ot.get(P)&&k.warn(`CanvasElement "${P}" already registered`),x.prototype.pixivnId=P,Ot.set(P,x),Ji.set(P,b),Qi.set(P,A);}y.add=t;function e(x){let u=Ot.get(x);if(!u){k.error(`CanvasElement "${x}" not found, did you forget to register it with the canvasComponentDecorator?`);return}return u}y.get=e;async function i(x,u){let P=e(x),b=Ji.get(x);if(!P||!b){k.error(`CanvasElement "${x}" not found, did you forget to register it with the canvasComponentDecorator?`);return}try{return await b(P,u)}catch(A){k.error(`Error while getting CanvasElement instance "${x}"`,A);}}y.getInstance=i;async function n(x,u,P){let b=Qi.get(x);if(!b){k.error(`CanvasElement "${x}" not found, did you forget to register it with the canvasComponentDecorator?`);return}try{await b(u,P);}catch(A){k.error(`Error while copying properties of CanvasElement "${x}"`,A);}}y.copyProperty=n;function o(){return Array.from(Ot.values())}y.values=o;function l(x){return Ot.has(x)}y.has=l;function c(){return Array.from(Ot.keys())}y.keys=c;})(gi||={});var Ie=gi;async function $t(t){let e=await Ie.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 yi(t){return "memory"in t?t.memory:t instanceof ut__default.default.Text?Pi(t):t instanceof ut__default.default.Sprite?xi(t):ft(t)}function An(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,pixivnFilters:En(t.filters)}}function En(t){if(!t)return;let e=Array.isArray(t)?t:[t],i=[];for(let n of e){let o=n.pixivnFilterId;if(!o){k.warn("A Filter instance without a registered pixivnFilterId can't be saved and will be skipped. Register it with filterDecorator/RegisteredFilters to make it save-compatible.",n);continue}let l=filters.RegisteredFilters.toMemory(o,n);l&&i.push(l);}return i}function mi(t,e){return {url:t.source.label,alias:e===t.source.label?void 0:e}}function ft(t,e){let i=On(t,yt),o=e?.childrenExport||false?t.children.sort((l,c)=>t.getChildIndex(l)-t.getChildIndex(c)).map(l=>yi(l)):[];return {pixivnId:i,elements:o,onEvents:Zi(t),...An(t)}}function xi(t){let e=ft(t),i=e.pixivnId??Pt,n="assetsAliases"in t&&Array.isArray(t.assetsAliases)?mi(t.texture,t.assetsAliases[0]):"textureAlias"in t?mi(t.texture,t.textureAlias):mi(t.texture);return {...e,pixivnId:i,textureData:n,anchor:{x:t.anchor.x,y:t.anchor.y},roundPixels:t.roundPixels}}function Pi(t){let e=ft(t),i=e.pixivnId??vt;return {...e,pixivnId:i,anchor:{x:t.anchor.x,y:t.anchor.y},text:t.text,resolution:t.resolution,style:Dn(t.style),roundPixels:t.roundPixels}}function On(t,e){return Object.hasOwn(t,"pixivnId")?t.pixivnId:e}function Xt(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 _n(t){if(t!=null){{if(typeof t=="number")return t;if(typeof t=="string"||Array.isArray(t))return t;if(t instanceof ut__default.default.FillGradient)return Xt(t);if(typeof t=="object"&&"fill"in t&&typeof t.fill!="function"&&t.fill){if(!(t.fill instanceof ut__default.default.FillPattern))return Xt(t.fill)}}k.warn("Unsupported property type for Text.style.fill.",t);}}function Mn(t){if(typeof t=="number")return t;if(typeof t=="string")return t;if(Array.isArray(t))return t;if(t instanceof ut__default.default.Color)return t.toNumber();k.warn("Unsupported color type.",t);}function Rn(t){if(t!=null){{if(typeof t=="number")return t;if(typeof t=="string"||Array.isArray(t))return t;if(t instanceof ut__default.default.FillGradient)return Xt(t);if(typeof t=="object"&&"alignment"in t)return {alignment:t.alignment,alpha:t.alpha,color:Mn(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 ut__default.default.FillPattern))return Xt(t.fill)}}k.warn("Unsupported property type for Text.style.stroke.",t);}}function Dn(t){return {align:t.align,breakWords:t.breakWords,dropShadow:t.dropShadow,fill:_n(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:Rn(t.stroke),textBaseline:t.textBaseline,trim:t.trim,whiteSpace:t.whiteSpace,wordWrap:t.wordWrap,wordWrapWidth:t.wordWrapWidth}}function ht(t){try{if(typeof t>"u")return t;let e=JSON.stringify(t);return JSON.parse(e)}catch(e){throw k.error("Error creating exportable element",t,e),new core.PixiError("not_json_serializable","Error creating exportable element")}}var kt=class{tickersPausedByGameLayerRender=[];get app(){return fe.app}get gameLayer(){return fe.gameLayer}get isInitialized(){return fe._isInitialized}get width(){return fe.canvasWidth}get height(){return fe.canvasHeight}get screen(){return this.app.screen}async init(e,i,n){return await fe.init(e,i,n)}get children(){return fe.gameLayer.children}async copyCanvasElementProperty(e,i,n={}){let o=["isRenderGroup","scale","visible","boundsArea","text","resolution","style","height","width"],{ignoreProperties:l=x=>x}=n;if(typeof i=="string"){let x=this.find(i);if(x)i=x;else {k.error(`Canvas element ${i} not found`);return}}if(typeof e=="string"){let x=this.find(e);if(x)e=x;else {k.error(`Canvas element ${e} not found`);return}}e instanceof ut__default.default.Container&&(e=e.memory);let c=l(o),y={...e};c.forEach(x=>{x in y&&delete y[x];}),await Ie.copyProperty(i.pixivnId,i,y);}add(e,i,n={}){if(e===Le){k.error(`The alias ${Le} is reserved`);return}let o=this.find(e),l=n?.ignoreOldStyle;o&&!l&&this.copyCanvasElementProperty(o,i);let{zIndex:c=o?.parent?.getChildIndex(o)}=n;o&&!this.canvasElementIsOnCanvas(o)?k.error(`The canvas element ${e} exist in the memory but it is not on the canvas, so the zIndex is not set`):o&&this.remove(e,{ignoreTickers:true}),c!==void 0?(i.label=e,this.gameLayer.addChildAt(i,c)):(i.label=e,this.gameLayer.addChild(i));}remove(e,i={}){if(e===Le){k.error(`The alias ${Le} is reserved`);return}let n=i.ignoreTickers;typeof e=="string"&&(e=[e]),e.forEach(o=>{this.gameLayer.getChildrenByLabel(o).forEach(l=>{this.gameLayer.removeChild(l),!n&&tickers.tickers.unlinkComponent(o);});});}find(e){if(e===Le)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,n={}){let o=this.find(e);o&&(o.label=i),!n.ignoreTickers&&tickers.tickers.transfer(e,i,"move");}get currentTickers(){return this.tickers.currentTickers}get currentTickersSteps(){return this.tickers.currentTickersSteps}findTicker(e){return tickers.tickers.find(e)}addTicker(e,i){return tickers.tickers.add(e,i)}addTickersSequence(e,i,n=0){return tickers.tickers.addSequence(e,i,n)}onTickerComplete(e,i){return tickers.tickers.onComplete(e,i)}unlinkComponentFromTicker(e,i){return tickers.tickers.unlinkComponent(e,i)}removeAllTickers(){return tickers.tickers.removeAll()}removeTicker(e,i={stopTicker:true}){return tickers.removeTicker(e,i)}pauseTicker(e){return tickers.tickers.pause(e)}resumeTicker(e){return tickers.tickers.resume(e)}isTickerPaused(e,i){return tickers.tickers.isPaused(e,i)}pause(){this.gameLayer.renderable!==false&&(this.gameLayer.renderable=false,this.tickersPausedByGameLayerRender=tickers.tickers.pause({id:Array.from(tickers.TickersManagerStatic._currentTickers.keys())}));}resume(){if(this.gameLayer.renderable===true)return;this.gameLayer.renderable=true;let e=this.tickersPausedByGameLayerRender.filter(i=>tickers.TickersManagerStatic._currentTickers.has(i));e.length>0&&tickers.tickers.resume({id:e}),this.tickersPausedByGameLayerRender=[];}transferTickers(e,i,n="move"){return tickers.tickers.transfer(e,i,n)}completeTickerOnStepEnd(e){return tickers.tickers.completeOnStepEnd(e)}async forceCompletionOfTicker(e,i){return tickers.tickers.forceCompletion(e,i)}tickers=tickers.tickers;animate(e,i,n,o){return core.GameUnifier.animate(e,i,n,o)}addLayerInternal(e,i){if(e===Le){k.error(`The alias ${Le} is reserved`);return}return i.label=e,fe.app.stage.addChild(i)}getLayerInternal(e){return fe.app.stage.getChildByLabel(e)}removeLayerInternal(e){let i=fe.app.stage.getChildByLabel(e);i&&fe.app.stage.removeChild(i);}addHtmlLayerInternal(e,i,n){return fe.addHtmlLayer(e,i,n)}removeHtmlLayerInternal(e){return fe.removeHtmlLayer(e)}getHtmlLayerInternal(e){return fe.getHtmlLayer(e)}addLayer(e,i){return this.addLayerInternal(e,i)}getLayer(e){return this.getLayerInternal(e)}removeLayer(e){return this.removeLayerInternal(e)}addHtmlLayer(e,i,n){return this.addHtmlLayerInternal(e,i,n)}removeHtmlLayer(e){return this.removeHtmlLayerInternal(e)}getHtmlLayer(e){return this.getHtmlLayerInternal(e)}layers={get gameLayer(){return fe.gameLayer},add:(e,i)=>this.addLayerInternal(e,i),get:e=>this.getLayerInternal(e),remove:e=>this.removeLayerInternal(e)};htmlLayers={add:(e,i,n)=>this.addHtmlLayerInternal(e,i,n),get:e=>this.getHtmlLayerInternal(e),remove:e=>this.removeHtmlLayerInternal(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.tickersPausedByGameLayerRender=[],tickers.tickers.removeAll(),this.removeAll();}export(){let e=this.gameLayer.renderable===false;e&&this.resume();try{let i={};return this.children.forEach(n=>{n.label&&(i[n.label]=yi(n));}),{tickers:ht(tickers.TickersManagerStatic.currentTickersWithoutCreatedBySteps()),tickersSteps:ht(tickers.TickersManagerStatic.currentTickersSequence()),elements:ht(i),stage:ht(ft(this.gameLayer)),elementAliasesOrder:ht(fe.childrenAliasesOrder),tickersToCompleteOnStepEnd:ht(tickers.TickersManagerStatic._tickersToCompleteOnStepEnd)}}finally{e&&this.pause();}}async restore(e){this.clear();try{if(Object.hasOwn(e,"elements")&&Object.hasOwn(e,"elementAliasesOrder")){let i=e.elementAliasesOrder,n={},o=Object.entries(e.elements).map(async([l,c])=>{n[l]=await $t(c);});await Promise.all(o),i.forEach(l=>{let c=n[l];c&&this.add(l,c);});}else {k.error("The data does not have the properties elementAliasesOrder and elements");return}if(Object.hasOwn(e,"stage")&&Object.hasOwn(e,"stage")?Be(this.gameLayer,e.stage,{ignoreScale:!0}):k.error("The data does not have the properties stage"),Object.hasOwn(e,"tickers")){let i=e.tickers;Object.entries(i).forEach(([n,o])=>{let l=o.canvasElementAliases;if(l.length!==0){let c=tickers.RegisteredTickers.getInstance(o.id,o.args,{duration:o.duration,priority:o.priority,id:n,canvasElementAliases:l});c?(c.canvasElementAliases=l,tickers.tickers.add(l,c),o.paused&&c.pause()):k.error(`Ticker ${o.id} not found`);}});}if(Object.hasOwn(e,"tickersSteps")){let i=e.tickersSteps;Object.entries(i).forEach(([n,o])=>{tickers.TickersManagerStatic._currentTickersSequence.set(n,new Map(Object.entries(o))),Object.keys(o).forEach(l=>{tickers.runTickersSequence(n,l);});});}if(Object.hasOwn(e,"tickersToCompleteOnStepEnd")){let i=e.tickersToCompleteOnStepEnd,n=i.tikersIds,o=i.stepAlias.map(l=>({id:l.id,alias:l.alias}));tickers.TickersManagerStatic._tickersToCompleteOnStepEnd.tikersIds.length=0,tickers.TickersManagerStatic._tickersToCompleteOnStepEnd.tikersIds.push(...n),tickers.TickersManagerStatic._tickersToCompleteOnStepEnd.stepAlias.length=0,tickers.TickersManagerStatic._tickersToCompleteOnStepEnd.stepAlias.push(...o);}}catch(i){k.error("Error importing data",i);}}};var Pe=class t{static init(e){t._getScreen=e.getScreen;}static _getScreen;static get screen(){return t._getScreen()}};exports.CanvasPropertyUtility=void 0;(x=>{function t(u,P,b,A,L,H=0){return L?u==="width"?P*(Pe.screen.width-b)+b-A-H*b:P*(Pe.screen.height-b)+b-A-H*b:u==="width"?P*(Pe.screen.width-b)+A+H*b:P*(Pe.screen.height-b)+A+H*b}x.calculatePositionByAlign=t;function e(u,P,b,A,L,H=0){return L?u==="width"?(P-b+A+H*b)/(Pe.screen.width-b):(P-b+A+H*b)/(Pe.screen.height-b):u==="width"?(P-A-H*b)/(Pe.screen.width-b):(P-A-H*b)/(Pe.screen.height-b)}x.calculateAlignByPosition=e;function i(u,P){return u==="width"?P*Pe.screen.width:P*Pe.screen.height}x.calculatePositionByPercentagePosition=i;function n(u,P){return u==="width"?P/Pe.screen.width:P/Pe.screen.height}x.calculatePercentagePositionByPosition=n;function o(u,P){if(P=P%360,P<0&&(P+=360),P===0)return {x:u.x,y:u.y};if(P===90)return {x:-u.y,y:u.x};if(P===180)return {x:-u.x,y:-u.y};if(P===270)return {x:u.y,y:-u.x};if(P>0&&P<90){let b=P*Math.PI/180,A=Math.cos(b),L=Math.sin(b),H=u.x*A-u.y*L,Y=u.x*L+u.y*A;return u.x!==0&&Math.sign(H)!==Math.sign(u.x)&&(H=-H),u.y!==0&&Math.sign(Y)!==Math.sign(u.y)&&(Y=-Y),{x:H,y:Y}}else if(P>90&&P<180){let b=(P-90)*Math.PI/180,A=Math.cos(b),L=Math.sin(b),H=-u.y*L-u.x*A,Y=u.y*A-u.x*L;return u.x!==0&&Math.sign(H)!==Math.sign(u.x)&&(H=-H),u.y!==0&&Math.sign(Y)!==Math.sign(u.y)&&(Y=-Y),{x:H,y:Y}}else if(P>180&&P<270){let b=(P-180)*Math.PI/180,A=Math.cos(b),L=Math.sin(b),H=-u.x*A+u.y*L,Y=-u.x*L-u.y*A;return u.x!==0&&Math.sign(H)!==Math.sign(u.x)&&(H=-H),u.y!==0&&Math.sign(Y)!==Math.sign(u.y)&&(Y=-Y),{x:H,y:Y}}else if(P>270&&P<360){let b=(P-270)*Math.PI/180,A=Math.cos(b),L=Math.sin(b),H=u.y*L-u.x*A,Y=-u.y*A-u.x*L;return u.x!==0&&Math.sign(H)!==Math.sign(u.x)&&(H=-H),u.y!==0&&Math.sign(Y)!==Math.sign(u.y)&&(Y=-Y),{x:H,y:Y}}return {x:0,y:0}}x.getSuperPoint=o;function l(u,P){if(P=P%360,P<0&&(P+=360),P===0)return {x:u.x,y:u.y};if(P===90)return {x:u.y,y:-u.x};if(P===180)return {x:-u.x,y:-u.y};if(P===270)return {x:-u.y,y:u.x};if(P>0&&P<90){let b=P*Math.PI/180,A=Math.cos(b),L=Math.sin(b);return {x:u.x*A+u.y*L,y:-u.x*L+u.y*A}}else if(P>90&&P<180){let b=(P-90)*Math.PI/180,A=Math.cos(b),L=Math.sin(b);return {x:u.y*A-u.x*L,y:-u.y*L-u.x*A}}else if(P>180&&P<270){let b=(P-180)*Math.PI/180,A=Math.cos(b),L=Math.sin(b);return {x:-u.x*A-u.y*L,y:u.x*L-u.y*A}}else if(P>270&&P<360){let b=(P-270)*Math.PI/180,A=Math.cos(b),L=Math.sin(b);return {x:-u.y*A+u.x*L,y:u.y*L+u.x*A}}return {x:0,y:0}}x.getPointBySuperPoint=l;function c(u){let P=u.width,b=u.height,A=u.angle%360;return A<0&&(A+=360),A===0||A===180?P:A===90||A===270?b:Math.abs(P*Math.cos(A*Math.PI/180))+Math.abs(b*Math.sin(A*Math.PI/180))}x.getSuperWidth=c;function y(u){let P=u.width,b=u.height,A=u.angle%360;return A<0&&(A+=360),A===0||A===180?b:A===90||A===270?P:Math.abs(b*Math.cos(A*Math.PI/180))+Math.abs(P*Math.sin(A*Math.PI/180))}x.getSuperHeight=y;})(exports.CanvasPropertyUtility||={});async function Bt(t){if(t!=="EMPTY"){if(!t)throw k.error("Texture not found",t),new core.PixiError("unregistered_asset","Texture not found");if(ut__default.default.Assets.cache.has(t)){let e=ut__default.default.Assets.get(t);if(e)return e}return ut__default.default.Assets.load(t).then(e=>{if(!e)throw k.error("Texture not found",t),new core.PixiError("unregistered_asset","Texture not found");if(!(e instanceof ut__default.default.Texture))throw k.error("File is not a Texture",t),new core.PixiError("unregistered_asset","File is not a Texture");return e}).catch(e=>{throw k.error("Error loading file",e),new core.PixiError("unknown_element","Error loading file")})}}function $e(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 pt=class t extends ut__default.default.Sprite{constructor(e){if(e instanceof ut__default.default.Texture)super(e);else {let{align:i,percentagePosition:n,...o}=$e(e)||{};super(o),i&&(this.align=i),n&&(this.percentagePosition=n);}this.pixivnId=this.constructor.prototype.pixivnId||Pt;}pixivnId=Pt;get memory(){return {...xi(this),pixivnId:this.pixivnId,align:this._align,percentagePosition:this._percentagePosition}}async setMemory(e){return await Zt(this,e)}static from(e,i){let n=ut__default.default.Sprite.from(e,i),o=new t;return o.texture=n.texture,o}onEventsHandlers={};on(e,i,n){return dt(e,this,i),super.on(e,(...o)=>i(...o,this),n)}_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;}};Ie.add(pt,{name:Pt,copyProperty:async(t,e)=>{await Zt(t,e,{ignoreTexture:true});}});async function Zt(t,e,i){e=$e(e);let n=i?.ignoreTexture||false;if(await Be(t,e),!n){let l;if("textureData"in e&&e.textureData&&(l=e.textureData),l&&l.url!=="EMPTY"){let c=l.url;l.alias&&ut__default.default.Assets.resolver.hasKey(l.alias)&&(c=l.alias);try{let y=await Bt(c);y&&(t.texture=y);}catch(y){k.error("Error in Sprite.setMemorySprite() while loading texture"),y=new core.PixiError("unregistered_asset",`Error loading image ${c}`,"canvas",e),core.GameUnifier.runOnError(y,{});}}}let o=i?.half;o&&await o(),"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 ne=class t extends pt{_textureAlias;get textureAlias(){return this._textureAlias?this._textureAlias:this.texture.source.label}pixivnId=xt;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 Jt(this,e),this.reloadPosition();}static from(e,i){let n=ut__default.default.Sprite.from(e,i),o=new t;return o.texture=n.texture,o}_loadIsStarted=false;get loadIsStarted(){return this._loadIsStarted}async load(){return this._loadIsStarted=true,Bt(this.textureAlias).then(e=>{this._loadIsStarted=false,e&&(this.texture=e);}).catch(e=>{this._loadIsStarted=false,k.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"}};Ie.add(ne,{name:xt,copyProperty:async(t,e)=>{await Jt(t,e,{ignoreTexture:true});}});async function Jt(t,e,i){return await Zt(t,e,{half:async()=>{"loadIsStarted"in e&&e.loadIsStarted&&await t.load();},ignoreTexture:i?.ignoreTexture})}var Ze=class t extends ne{constructor(e,i){if(e instanceof ut__default.default.Texture){super(e,i);return}let{loop:n,paused:o,currentTime:l,...c}=e||{};super(c,i),n&&(this.loop=n),o&&(this.paused=o),l&&(this.currentTime=l);}pixivnId=It;get memory(){return {...super.memory,pixivnId:this.pixivnId,loop:this.loop,paused:this._paused,currentTime:this.currentTime}}async setMemory(e){await tn(this,e),this.reloadPosition();}static from(e,i){let n=ut__default.default.Sprite.from(e,i),o=new t;return o.texture=n.texture,o}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}};Ie.add(Ze,{name:It,getInstance:async(t,e)=>{let i;"textureData"in e&&e.textureData&&(i=e.textureData);let n=new t(void 0,i?.alias);return await n.setMemory(e),n},copyProperty:async(t,e)=>{await tn(t,e,{ignoreTexture:true});}});async function tn(t,e,i){await Jt(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 ut.Container{constructor(e){let{anchor:i,align:n,percentagePosition:o,...l}=$e(e)||{};super(l),this.pixivnId=this.constructor.prototype.pixivnId||yt,i&&(this.anchor=i),n&&(this.align=n),o&&(this.percentagePosition=o);}pixivnId=yt;get memory(){return {...ft(this,{childrenExport:true}),anchor:this._anchor?this.anchor:void 0,align:this._align,percentagePosition:this._percentagePosition}}async setMemory(e){await this.importChildren(e),await Be(this,e),this.reloadAnchor(),this.reloadPosition();}async importChildren(e){for(let i=0;i<e.elements.length;i++){let n=e.elements[i],o=await $t(n);this.addChild(o);}}onEventsHandlers={};on(e,i,n){return dt(e,this,i),super.on(e,(...o)=>i(...o,this),n)}_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;}};Ie.add(Xe,{name:yt,copyProperty:async(t,e)=>await Be(t,e)});var $n=new Set(["mp4","webm","ogg","ogv","avi","mov","wmv","flv","mkv","m4v","3gp","3g2","ts","mts"]);function Ft(t){let e=ut__default.default.Assets.cache.has(t)?ut__default.default.Assets.get(t):null;return e instanceof ut__default.default.Texture&&(t=e.source?.label||t),Xn(t)}function Xn(t){let e=t.split(".").pop()?.toLowerCase();return e!==void 0&&$n.has(e)}var se=class extends Xe{constructor(e,i){let{anchor:n,align:o,percentagePosition:l,...c}=$e(e)||{};super(c),i&&i.forEach(y=>{Ft(y)?this.addChild(new Ze(void 0,y)):this.addChild(new ne(void 0,y));}),n&&(this.anchor=n),o&&(this.align=o),l&&(this.percentagePosition=l);}get memory(){return {...super.memory,pixivnId:Wt,loadIsStarted:this._loadIsStarted}}async setMemory(e){await this.importChildren(e),await nn(this,e),this.reloadAnchor(),this.reloadPosition();}pixivnId=Wt;_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,k.error("Error into ImageContainer.load()",i);})}get texture(){return this.children.length>0?this.children[0].texture:new ut__default.default.Texture}get haveEmptyTexture(){return this.children.some(e=>e.texture._source.label==="EMPTY")}};Ie.add(se,{name:Wt,copyProperty:async(t,e)=>await nn(t,e)});async function nn(t,e){e=$e(e)||{},Be(t,e,{end:async()=>{"loadIsStarted"in e&&e.loadIsStarted&&await t.load();}});}var Qt=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 gt=class extends ut__default.default.Text{constructor(e){let{align:i,percentagePosition:n,...o}=$e(e)||{};super(o),this.pixivnId=this.constructor.prototype.pixivnId||vt,i&&(this.align=i),n&&(this.percentagePosition=n);}pixivnId=vt;get memory(){return {...Pi(this),pixivnId:this.pixivnId,align:this._align,percentagePosition:this._percentagePosition}}async setMemory(e){await qn(this,e),this.reloadPosition();}onEventsHandlers={};on(e,i,n){return dt(e,this,i),super.on(e,(...o)=>i(...o,this),n)}_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;}};Ie.add(gt,{name:vt});async function qn(t,e){"text"in e&&e.text!==void 0&&(t.text=e.text),await Be(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);}function Lt(t,e,i){let n=[0],o=t;for(let l=0;l<i;l++)n.push(o,-o*.6,o*.3,0),o*=e;return n}function sn(t,e,i,n){let o=i.reduce((P,b)=>b.enabled?P+b.padding:P,0),l=t.x,c=t.y,y=t.x+t.width,x=t.y+t.height;n&&(l=Math.max(l,0),c=Math.max(c,0),y=Math.min(y,n.width),x=Math.min(x,n.height));let u={x:l-o,y:c-o,width:y-l+o*2,height:x-c+o*2};return {x:t.x+e.x*t.width-u.x,y:t.y+e.y*t.height-u.y,area:u}}function Ii(t,e,i,n){return Math.max(0,Math.ceil(e-Math.min(t.x,t.y,i-t.x,n-t.y)))}function ei(t,e,i,n){let o=Math.min(Math.max(e,0),.5),l=Math.hypot(Math.max(t.x,i-t.x),Math.max(t.y,n-t.y));return Math.ceil(l*o/(1-o))}function ti(t,e,i,n){return n>0?n:Math.hypot(Math.max(t.x,e.width-t.x),Math.max(t.y,e.height-t.y))+i/2}function Ti(t){let e=t.filters;return e?Array.isArray(e)?[...e]:[e]:[]}function Qn(t,e){t.filters=[...Ti(t),...e];}function er(t,e){let i=Ti(t).filter(n=>!e.includes(n));t.filters=i.length>0?i:null;}function ce(t,e,i,n,o,l){Qn(e,[i]);let c=filters.filters.animate(t,i,n,{duration:o.duration??1,delay:o.delay,ease:o.ease,times:o.times,aliasToRemoveAfter:o.aliasToRemoveAfter,autoplay:o.autoplay},l,void 0,()=>{er(e,[i]),i.destroy();});return c&&(o.completeOnContinue??true)&&tickers.tickers.completeOnStepEnd({id:c}),c}function st(t,e){let i;try{i=p.screen;}catch{i=void 0;}return sn(t.getBounds(),e,Ti(t),i)}async function tr(t,e={},i){return exports.effects.shakeEffect(t,e,i)}function on(t){switch(t){case "up":return {axis:"y",sign:-1};case "down":return {axis:"y",sign:1};case "left":return {axis:"x",sign:-1};default:return {axis:"x",sign:1}}}function ii(t,e,i){let n=[0],o=t;for(let l=0;l<i;l++)n.push(l%2===0?o:-o,0),o*=e;return n}function _t(t,e,i,n){let o=[t],l=e;for(let c=0;c<n;c++)o.push(t+l,t),l*=i;return o}exports.effects=void 0;(re=>{async function t(w,N={},G){let M=p.find(w);if(!M){k.error(`The element with the alias ${w} does not exist. So the shake effect can't be applied.`);return}let D={x:M.position.x,y:M.position.y},{shakeType:V="horizontal",maxShockSize:j=10,shocksNumber:J=10,...U}=N,W=J-1;if(W<2){k.error("The number of shocks must be at least 3.");return}let Q=Math.floor(W/2),K=Math.ceil(W/2),X=[];for(let ie=0;ie<Q;ie++){let de=j*(ie+1)/Q;V==="horizontal"?ie%2!==0?X.push(D.x+de):X.push(D.x-de):ie%2!==0?X.push(D.y+de):X.push(D.y-de);}let ee=Q%2===0;for(let ie=K;ie>0;ie--){let de=j*(ie+1)/(K-1);V==="horizontal"?ie%2===0&&!ee||ie%2!==0&&ee?X.push(D.x-de):X.push(D.x+de):ie%2===0&&!ee||ie%2!==0&&ee?X.push(D.y-de):X.push(D.y+de);}let oe;if(V==="horizontal"?(X.push(D.x),oe=p.animate(w,{x:X},U,G)):(X.push(D.y),oe=p.animate(w,{y:X},U,G)),oe)return [oe]}re.shakeEffect=t;async function e(w,N={},G){let M=p.find(w);if(!M){k.error(`The element with the alias ${w} does not exist. So the bounce effect can't be applied.`);return}let{direction:D="up",distance:V=30,bounces:j=4,decay:J=.5,...U}=N,{axis:W,sign:Q}=on(D),K=W==="x"?M.position.x:M.position.y,X=[K],ee=V;for(let ie=0;ie<j;ie++)X.push(K+Q*ee,K),ee*=J;let oe=p.animate(w,{[W]:X},U,G);if(oe)return [oe]}re.bounceEffect=e;async function i(w,N={},G){let M=p.find(w);if(!M){k.error(`The element with the alias ${w} does not exist. So the pulse effect can't be applied.`);return}let{scale:D=1.2,pulses:V=3,decay:j=.6,...J}=N,U=M.scale.x,W=M.scale.y,Q=[U],K=[W],X=D-1;for(let oe=0;oe<V;oe++)Q.push(U*(1+X),U),K.push(W*(1+X),W),X*=j;let ee=p.animate(w,{scaleX:Q,scaleY:K},J,G);if(ee)return [ee]}re.pulseEffect=i;async function n(w,N={},G){let M=p.find(w);if(!M){k.error(`The element with the alias ${w} does not exist. So the hop effect can't be applied.`);return}let{direction:D="up",distance:V=40,secondaryHops:j=0,decay:J=.5,...U}=N,{axis:W,sign:Q}=on(D),K=W==="x"?M.position.x:M.position.y,X=[K],ee=V;for(let ie=0;ie<1+j;ie++)X.push(K+Q*ee,K),ee*=J;let oe=p.animate(w,{[W]:X},U,G);if(oe)return [oe]}re.hopEffect=n;async function o(w,N={},G){let M=p.find(w);if(!M){k.error(`The element with the alias ${w} does not exist. So the wiggle effect can't be applied.`);return}let{angle:D=15,repetitions:V=3,decay:j=.5,...J}=N,U=M.rotation,W=D*Math.PI/180,Q=ii(W,j,V).map(X=>U+X),K=p.animate(w,{rotation:Q},J,G);if(K)return [K]}re.wiggleEffect=o;async function l(w,N={},G){let M=p.find(w);if(!M){k.error(`The element with the alias ${w} does not exist. So the nod effect can't be applied.`);return}let{axis:D="horizontal",distance:V=15,repetitions:j=3,decay:J=.5,...U}=N,W=D==="horizontal"?"x":"y",Q=D==="horizontal"?M.position.x:M.position.y,K=ii(V,J,j).map(ee=>Q+ee),X=p.animate(w,{[W]:K},U,G);if(X)return [X]}re.nodEffect=l;async function c(w,N={},G){let M=p.find(w);if(!M){k.error(`The element with the alias ${w} does not exist. So the sway effect can't be applied.`);return}let{axis:D="horizontal",distance:V=10,angle:j=5,repetitions:J=3,decay:U=0,ease:W="easeInOut",...Q}=N,K=D==="horizontal"?"x":"y",X=D==="horizontal"?M.position.x:M.position.y,ee=M.rotation,oe=j*Math.PI/180,ie=ii(V,U||1,J).map(Ce=>X+Ce),de=ii(oe,U||1,J).map(Ce=>ee+Ce),Ae=p.animate(w,{[K]:ie,rotation:de},{ease:W,...Q},G);if(Ae)return [Ae]}re.swayEffect=c;async function y(w,N={},G){let M=p.find(w);if(!M){k.error(`The element with the alias ${w} does not exist. So the punch effect can't be applied.`);return}let{mode:D="scale",strength:V=.3,overshoot:j=.3,...J}=N,U;if(D==="scale"){let W=Q=>[Q,Q*(1+V),Q*(1-V*j),Q];U=p.animate(w,{scaleX:W(M.scale.x),scaleY:W(M.scale.y)},J,G);}else {let W=D==="rotation"?M.rotation:D==="x"?M.position.x:M.position.y,Q=D==="rotation"?V*Math.PI/180:V,K=[W,W+Q,W-Q*j,W];U=p.animate(w,{[D]:K},J,G);}if(U)return [U]}re.punchEffect=y;async function x(w,N={},G){let M=p.find(w);if(!M){k.error(`The element with the alias ${w} does not exist. So the glitch effect can't be applied.`);return}let{strength:D=40,bursts:V=3,slices:j=8,direction:J=0,rgbSplit:U=6,decay:W=.5,ease:Q="linear",...K}=N,X=new filters.filters.GlitchFilter({slices:j,direction:J,offset:0});X.refresh(),X.padding=Math.ceil(Math.abs(D));let ee=[],oe=ce(w,M,X,{offset:Lt(D,W,V)},{ease:Q,...K},G);if(oe&&ee.push(oe),U!==0){let ie=Lt(U,W,V),de=new filters.filters.RGBSplitFilter({red:{x:0,y:0},green:{x:0,y:0},blue:{x:0,y:0}});de.padding=Math.ceil(Math.abs(U));let Ae=ce(w,M,de,{redX:ie,blueX:ie.map(Ce=>-Ce)},{ease:Q,...K},G);Ae&&ee.push(Ae);}if(ee.length>0)return ee}re.glitchEffect=x;async function u(w,N={},G){let M=p.find(w);if(!M){k.error(`The element with the alias ${w} does not exist. So the chromatic aberration effect can't be applied.`);return}let{strength:D=8,axis:V="horizontal",bursts:j=1,decay:J=.5,...U}=N,W=new filters.filters.RGBSplitFilter({red:{x:0,y:0},green:{x:0,y:0},blue:{x:0,y:0}});W.padding=Math.ceil(Math.abs(D));let Q=V==="horizontal"?"redX":"redY",K=V==="horizontal"?"blueX":"blueY",X={[Q]:_t(0,D,J,j),[K]:_t(0,-D,J,j)},ee=ce(w,M,W,X,U,G);if(ee)return [ee]}re.chromaticAberrationEffect=u;async function P(w,N={},G){let M=p.find(w);if(!M){k.error(`The element with the alias ${w} does not exist. So the shockwave effect can't be applied.`);return}let{origin:D={x:.5,y:.5},amplitude:V=30,wavelength:j=160,brightness:J=1,radius:U=-1,speed:W=500,strength:Q,...K}=N,{width:X,height:ee}=M.getBounds(),oe=Q??ti({x:D.x*X,y:D.y*ee},{width:X,height:ee},j,U)/W,ie=new filters.filters.ShockwaveFilter({center:{x:0,y:0},amplitude:V,wavelength:j,brightness:J,radius:U,speed:W,time:0});ie.padding=Math.ceil(Math.abs(V)*1.25);let de=ce(w,M,ie,{time:[0,oe]},K,G),{x:Ae,y:Ce}=st(M,D);if(ie.center={x:Ae,y:Ce},de)return [de]}re.shockwaveEffect=P;async function b(w,N={},G){let M=p.find(w);if(!M){k.error(`The element with the alias ${w} does not exist. So the radial blur effect can't be applied.`);return}let{strength:D=.5,bursts:V=1,origin:j={x:.5,y:.5},innerRadius:J=0,radius:U=-1,decay:W=.5,...Q}=N,K=new filters.filters.ZoomBlurFilter({center:{x:0,y:0},innerRadius:J,radius:U,strength:0}),{width:X,height:ee}=M.getBounds();K.padding=ei({x:j.x*X,y:j.y*ee},D,X,ee);let oe=_t(0,D,W,V),ie=ce(w,M,K,{strength:oe},Q,G),{x:de,y:Ae}=st(M,j);if(K.center={x:de,y:Ae},ie)return [ie]}re.radialBlurEffect=b;async function A(w,N={},G){let M=p.find(w);if(!M){k.error(`The element with the alias ${w} does not exist. So the blur pulse effect can't be applied.`);return}let{strength:D=8,pulses:V=3,quality:j,decay:J=.5,...U}=N,W=new filters.filters.BlurFilter({strength:0,quality:j}),Q=_t(0,D,J,V),K=ce(w,M,W,{strength:Q},U,G);if(K)return [K]}re.blurPulseEffect=A;async function L(w,N={},G){let M=p.find(w);if(!M){k.error(`The element with the alias ${w} does not exist. So the vignette pulse effect can't be applied.`);return}let{strength:D=1,pulses:V=1,radius:j=.5,blur:J=.5,decay:U=.5,...W}=N,Q=new filters.filters.CRTFilter({curvature:0,lineWidth:0,lineContrast:0,noise:0,vignetting:j,vignettingBlur:J,vignettingAlpha:0}),K=_t(0,D,U,V),X=ce(w,M,Q,{vignettingAlpha:K},W,G);if(X)return [X]}re.vignettePulseEffect=L;async function H(w,N={},G){let M=p.find(w);if(!M){k.error(`The element with the alias ${w} does not exist. So the desaturate effect can't be applied.`);return}let{amount:D=0,duration:V=1,holdDuration:j=0,...J}=N,U=V*2+j,W=[0,V/U,(V+j)/U,1],Q=new filters.filters.AdjustmentFilter({saturation:1}),K=ce(w,M,Q,{saturation:[1,D,D,1]},{...J,duration:U,times:W},G);if(K)return [K]}re.desaturateEffect=H;async function Y(w,N={},G){let M=p.find(w);if(!M){k.error(`The element with the alias ${w} does not exist. So the glow pulse effect can't be applied.`);return}let{strength:D=4,pulses:V=3,color:j=16777215,distance:J=10,innerStrength:U=0,decay:W=.5,...Q}=N,K=new filters.filters.GlowFilter({outerStrength:0,innerStrength:U,distance:J,color:j}),X=_t(0,D,W,V),ee=ce(w,M,K,{outerStrength:X},Q,G);if(ee)return [ee]}re.glowPulseEffect=Y;})(exports.effects||={});function mt(t){let e=t.getLocalBounds();return {x:e.x,y:e.y,width:e.width,height:e.height}}function bi(t,e){return e.graphics||(e.graphics=new ut.Graphics,t.parent?.addChild(e.graphics),t.mask=e.graphics),nr(t,e.graphics),e.graphics}function nr(t,e){e.position.copyFrom(t.position),e.scale.copyFrom(t.scale),e.pivot.copyFrom(t.pivot),e.skew.copyFrom(t.skew),e.rotation=t.rotation;}function rr(t,e){e.graphics&&(t.mask=null,e.graphics.parent?.removeChild(e.graphics),e.graphics.destroy({children:true}),e.graphics=void 0);}function wi(t,e,i,n){let o=e.invert?1-i:i,{bounds:l}=e,c=bi(t,n),y=l.x+l.width/2,x=l.y+l.height/2,u=Math.sqrt(l.width**2+l.height**2)||1,P=Math.max(o,0)*u*2,b=e.angle*Math.PI/180;if(c.clear(),P>0){let A=Math.cos(-b),L=Math.sin(-b),H=[[-u,-u],[-u+P,-u],[-u+P,u],[-u,u]].flatMap(([Y,re])=>[y+Y*A-re*L,x+Y*L+re*A]);c.poly(H).fill(16777215);}}function Si(t,e,i,n){let o=e.invert?1-i:i,{bounds:l}=e,c=bi(t,n),y=l.x+l.width*e.originX,x=l.y+l.height*e.originY,u=Math.max(y-l.x,l.x+l.width-y),P=Math.max(x-l.y,l.y+l.height-x),b=Math.sqrt(u**2+P**2)||1,A=Math.max(o,0)*b,L=e.aspect>0?e.aspect:1;c.clear(),A>0&&c.ellipse(y,x,A*L,A).fill(16777215);}function Ai(t,e,i,n){let l=1-(e.invert?1-i:i),{bounds:c}=e,y=bi(t,n);if(y.clear(),e.orientation==="horizontal"){let x=c.x+c.width*e.origin,u=x-c.x,P=c.x+c.width-x,b=c.x-l*u,A=x+l*P;u>0&&y.rect(b,c.y,u,c.height).fill(16777215),P>0&&y.rect(A,c.y,P,c.height).fill(16777215);}else {let x=c.y+c.height*e.origin,u=x-c.y,P=c.y+c.height-x,b=c.y-l*u,A=x+l*P;u>0&&y.rect(c.x,b,c.width,u).fill(16777215),P>0&&y.rect(c.x,A,c.width,P).fill(16777215);}}function an(t,e,i){switch(e.kind){case "wipe":case "iris":case "split":rr(t,i);break}}function ni(t,e,i){let n={...p.find(t)?.memory,...i},o=new se(i,e);return n&&p.copyCanvasElementProperty(n,o),p.add(t,o,{ignoreOldStyle:true,zIndex:i?.zIndex}),o}async function sr(t,e,i){let n={...p.find(t)?.memory,...i},o=new se(i,e);return o.label=t,await o.load(),n&&p.copyCanvasElementProperty(n,o),p.add(t,o,{ignoreOldStyle:true,zIndex:i?.zIndex}),o}function ri(t,e,i){if(!e)if(ut__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:xt,...i,label:t});let n={...p.find(t)?.memory,...i},o=new ne(i,e);return n&&p.copyCanvasElementProperty(n,o),p.add(t,o,{ignoreOldStyle:true,zIndex:i?.zIndex}),o}async function or(t,e,i){if(!e)if(ut__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:xt,...i,label:t});let n={...p.find(t)?.memory,...i},o=new ne(i,e);return o.label=t,await o.load(),n&&p.copyCanvasElementProperty(n,o),p.add(t,o,{ignoreOldStyle:true,zIndex:i?.zIndex}),o}function si(t,e,i){if(!e)if(ut__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:It,...i,label:t});let n={...p.find(t)?.memory,...i},o=new Ze(i,e);return n&&p.copyCanvasElementProperty(n,o),p.add(t,o,{ignoreOldStyle:true,zIndex:i?.zIndex}),o}async function ar(t,e,i){if(!e)if(ut__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:It,...i,label:t});let n={...p.find(t)?.memory,...i},o=new Ze(i,e);return o.label=t,await o.load(),n&&p.copyCanvasElementProperty(n,o),p.add(t,o,{ignoreOldStyle:true,zIndex:i?.zIndex}),o}async function cr(t,e,i={},n){return exports.transitions.showWithDissolve(t,e,i,n)}function dr(t,e={},i){return exports.transitions.removeWithDissolve(t,e,i)}async function ur(t,e,i={},n){return exports.transitions.showWithFade(t,e,i,n)}function fr(t,e={},i){return exports.transitions.removeWithFade(t,e,i)}async function hr(t,e,i={},n){return exports.transitions.moveIn(t,e,i,n)}function pr(t,e={},i){return exports.transitions.moveOut(t,e,i)}async function gr(t,e,i={},n){return exports.transitions.zoomIn(t,e,i,n)}function mr(t,e={},i){return exports.transitions.zoomOut(t,e,i)}async function yr(t,e,i={},n){return exports.transitions.pushIn(t,e,i,n)}function xr(t,e={direction:"right"},i){return exports.transitions.pushOut(t,e,i)}exports.transitions=void 0;(zr=>{function t(a){switch(a.type){case "align":return {xAlign:a.x,yAlign:a.y};case "percentage":return {percentageX:a.x,percentageY:a.y};default:return {x:a.x,y:a.y}}}function e(a,r,d){if(typeof r=="string")return Ft(r)?si(a,r,{...d.properties,zIndex:d.zIndex}):ri(a,r,{...d.properties,zIndex:d.zIndex});if(Array.isArray(r))return ni(a,r,{...d.properties,zIndex:d.zIndex});if(typeof r=="object"&&"value"in r&&"options"in r){if(typeof r.value=="string")return Ft(r.value)?si(a,r.value,{...r.options,...d.properties,zIndex:d.zIndex}):ri(a,r.value,{...r.options,...d.properties,zIndex:d.zIndex});if(Array.isArray(r.value))return ni(a,r.value,{...r.options,...d.properties,zIndex:d.zIndex})}return p.add(a,r,d),r}function i(a){let r=a;return {x:r.x,y:r.y,anchor:r.anchor,scale:r.scale,pivot:r.pivot,skew:r.skew,rotation:r.rotation,angle:r.angle}}function n(a,r,d){let f,h=p.find(a);h&&(f=`${a}_temp_${d}`,p.editAlias(a,f));let g=e(a,r,{zIndex:h?h.parent?.getChildIndex(h):void 0,properties:h?i(h):void 0});return h?.parent?.setChildIndex(h,h.parent.getChildIndex(h)-.1),f&&p.copyCanvasElementProperty(f,a),f&&tickers.tickers.transfer(f,a,"duplicate"),{component:g,oldComponentAlias:f}}function o(a){switch(a){case "up":return 90;case "down":return 270;case "left":return 180;default:return 0}}function l(a,r,d){let f={},h=S=>{let E=p.find(a);E&&r.apply(E,S,f);},g=filters.filters.animate(a,void 0,{value:[r.from,r.to]},{duration:r.duration??1,delay:r.delay,ease:r.ease,aliasToRemoveAfter:r.aliasToRemoveAfter,tickerIdToResume:r.tickerIdToResume},d,h,()=>{let S=p.find(a);S&&an(S,r.config,f);});return g&&h(r.from),g&&(r.completeOnContinue??true)&&tickers.tickers.completeOnStepEnd({id:g}),g}function c(a,r,d,f,h){let g=Math.max(f,0)/4;d==="in"?(r&&(r.alpha=0),p.animate(a,{alpha:[0,1]},{duration:g,completeOnContinue:false},h)):p.animate(a,{alpha:[1,0]},{duration:g,delay:Math.max(f-g,0),completeOnContinue:false},h);}function y(a,r,d,f,h=false){let g=Math.max(f,1),S=r*2+d,E=h?r+d:S,C=Math.max(S*(g-1)+E,.001),T=[0],I=[0],m=0;for(let v=0;v<g;v++){let O=v===g-1;m+=r,T.push(a),I.push(m/C),m+=d,T.push(a),I.push(m/C),(!O||!h)&&(m+=r,T.push(0),I.push(Math.min(m/C,1)));}return {values:T,times:I,total:C}}async function x(a,r,d={},f){let{completeOnContinue:h=true,tickerIdToResume:g=[],...S}=d,E=[];r||(r=a),typeof g=="string"&&(g=[g]);let C,T=p.find(a);if(T&&(C=`${a}_temp_disolve`,p.editAlias(a,C)),r=e(a,r,{zIndex:T?T.parent?.getChildIndex(T):void 0,properties:T?i(T):void 0}),T?.parent?.setChildIndex(T,T.parent.getChildIndex(T)-.1),C&&p.copyCanvasElementProperty(C,a),C&&tickers.tickers.transfer(C,a,"duplicate"),r.alpha=0,C){let m=u(C,{...d,autoplay:false,completeOnContinue:h},f);m&&(E.push(...m),g.push(...m));}let I=p.animate(a,{alpha:1},{...S,tickerIdToResume:g,completeOnContinue:h},f);if(I&&E.push(I),(r instanceof ne||r instanceof se)&&r.haveEmptyTexture&&await r.load(),E.length>0)return E}zr.showWithDissolve=x;function u(a,r={},d){let{completeOnContinue:f=true,aliasToRemoveAfter:h=[],...g}=r;typeof h=="string"&&(h=[h]),h.push(a);let S=p.animate(a,{alpha:0},{...g,aliasToRemoveAfter:h,completeOnContinue:f},d);if(S)return [S]}zr.removeWithDissolve=u;async function P(a,r,d={},f){let{completeOnContinue:h=true,aliasToRemoveAfter:g=[],...S}=d,E=[];r||(r=a),typeof g=="string"&&(g=[g]);let C=p.find(a);if(!C)return x(a,r,d,f);let T=`${a}_temp_fade`;p.editAlias(a,T),g.push(T),r=e(a,r,{zIndex:C?C.parent?.getChildIndex(C):void 0,properties:i(C)}),C?.parent?.setChildIndex(C,C.parent.getChildIndex(C)-.1),T&&p.copyCanvasElementProperty(T,a),T&&tickers.tickers.transfer(T,a,"duplicate"),r.alpha=0;let I=p.animate(a,{alpha:1},{...S,aliasToRemoveAfter:g,completeOnContinue:h},f);if(I){let m=u(T,{...d,tickerIdToResume:I,completeOnContinue:h},f);m&&E.push(...m),E.push(I),tickers.tickers.pause({id:I});}if((r instanceof ne||r instanceof se)&&r.haveEmptyTexture&&await r.load(),E.length>0)return E}zr.showWithFade=P;function b(a,r={},d){return u(a,r,d)}zr.removeWithFade=b;async function A(a,r,d={},f){let{direction:h="right",completeOnContinue:g=true,tickerIdToResume:S=[],aliasToRemoveAfter:E=[],removeOldComponentWithMoveOut:C,motionBlur:T,...I}=d,m=[],v;r||(r=a),typeof S=="string"&&(S=[S]),typeof E=="string"&&(E=[E]);let O,B=p.find(a);if(B&&(O=`${a}_temp_movein`,p.editAlias(a,O),B instanceof ne||B instanceof se?v=B.positionInfo:v={x:B.x,y:B.y,type:"pixel"}),r=e(a,r,{zIndex:B?B.parent?.getChildIndex(B):void 0}),B?.parent?.setChildIndex(B,B.parent.getChildIndex(B)-.1),O&&p.copyCanvasElementProperty(O,a),O&&tickers.tickers.transfer(O,a,"move"),(r instanceof ne||r instanceof se)&&r.haveEmptyTexture&&await r.load(),v||(r instanceof ne||r instanceof se?v=r.positionInfo:v={x:r.x,y:r.y,type:"pixel"}),O)if(C){let pe=L(O,{...d,autoplay:false,completeOnContinue:g},f);pe&&(m.push(...pe),S.push(...pe));}else E.push(O);switch(h){case "up":r.y=p.height+r.height;break;case "down":r.y=-r.height;break;case "left":r.x=p.width+r.width;break;case "right":r.x=-r.width;break}let $=tickers.tickers.pause({canvasAlias:a});S.push(...$);let Z=p.animate(a,t(v),{...I,tickerIdToResume:S,aliasToRemoveAfter:E,completeOnContinue:g},f);Z&&m.push(Z);let ue=de(a,r,h,T,{...I,completeOnContinue:g},f);if(ue&&m.push(ue),m.length>0)return m}zr.moveIn=A;function L(a,r={},d){let{direction:f="right",completeOnContinue:h=true,aliasToRemoveAfter:g=[],motionBlur:S,...E}=r;typeof g=="string"&&(g=[g]),g.push(a);let C=p.find(a);if(!C){k.warn(`The canvas component "${a}" is not found.`);return}let T={x:C.x,y:C.y};switch(f){case "up":T.y=-C.height;break;case "down":T.y=p.height+C.height;break;case "left":T.x=-C.width;break;case "right":T.x=p.width+C.width;break}tickers.tickers.pause({canvasAlias:a});let I=p.animate(a,T,{...E,aliasToRemoveAfter:g,completeOnContinue:h},d),m=de(a,C,f,S,{...E,completeOnContinue:h},d);return Ae([I,m])}zr.moveOut=L;async function H(a,r,d={},f){let{direction:h="right",completeOnContinue:g=true,tickerIdToResume:S=[],aliasToRemoveAfter:E=[],...C}=d,T=[],I;r||(r=a),typeof S=="string"&&(S=[S]),typeof E=="string"&&(E=[E]);let m,v=p.find(a);v&&(m=`${a}_temp_zoom`,p.editAlias(a,m),v instanceof ne||v instanceof se?I=v.positionInfo:I={x:v.x,y:v.y,type:"pixel"}),r=e(a,r,{zIndex:v?v.parent?.getChildIndex(v):void 0}),v?.parent?.setChildIndex(v,v.parent.getChildIndex(v)-.1),m&&p.copyCanvasElementProperty(m,a),m&&tickers.tickers.transfer(m,a,"move"),I||(r instanceof ne||r instanceof se?I=r.positionInfo:I={x:r.x,y:r.y,type:"pixel"});let O={x:r.pivot.x,y:r.pivot.y},B={x:r.scale.x,y:r.scale.y};if(m)if(d.removeOldComponentWithZoomOut){let ue=Y(m,{...d,autoplay:false,completeOnContinue:g},f);ue&&(T.push(...ue),S.push(...ue));}else E.push(m);(r instanceof ne||r instanceof se)&&r.haveEmptyTexture&&await r.load(),h==="up"?(r.pivot.y=p.height-r.y,r.pivot.x=p.width/2-r.x,r.y=p.height,r.x=p.width/2):h==="down"?(r.pivot.y=0-r.y,r.pivot.x=p.width/2-r.x,r.y=0,r.x=p.width/2):h==="left"?(r.pivot.x=p.width-r.x,r.pivot.y=p.height/2-r.y,r.x=p.width,r.y=p.height/2):h==="right"&&(r.pivot.x=0-r.x,r.pivot.y=p.height/2-r.y,r.x=0,r.y=p.height/2),r.pivot=exports.CanvasPropertyUtility.getPointBySuperPoint(r.pivot,r.angle),r.scale.set(0);let $=tickers.tickers.pause({canvasAlias:a});S.push(...$);let Z=p.animate(a,{pivotX:O.x,pivotY:O.y,scaleX:B.x,scaleY:B.y,...t(I)},{...C,tickerIdToResume:S,aliasToRemoveAfter:E,completeOnContinue:g},f);if(Z&&T.push(Z),T.length>0)return T}zr.zoomIn=H;function Y(a,r={},d){let{direction:f="right",completeOnContinue:h=true,aliasToRemoveAfter:g=[],...S}=r;typeof g=="string"&&(g=[g]),g.push(a);let E=p.find(a);if(!E){k.warn(`The canvas component "${a}" is not found.`);return}let C={x:E.x,y:E.y},T={x:E.pivot.x,y:E.pivot.y};f==="down"?(C.y=p.height,C.x=p.width/2,T.y=p.height-C.y,T.x=p.width/2-C.x):f==="up"?(C.y=0,C.x=p.width/2,T.y=0-C.y,T.x=p.width/2-C.x):f==="right"?(C.x=p.width,C.y=p.height/2,T.x=p.width-C.x,T.y=p.height/2-C.y):f==="left"&&(C.x=0,C.y=p.height/2,T.x=0-C.x,T.y=p.height/2-C.y),T=exports.CanvasPropertyUtility.getPointBySuperPoint(T,E.angle),tickers.tickers.pause({canvasAlias:a});let I=p.animate(a,{...C,pivotX:T.x,pivotY:T.y,scaleX:0,scaleY:0},{...S,aliasToRemoveAfter:g,completeOnContinue:h},d);if(I)return [I]}zr.zoomOut=Y;async function re(a,r,d={},f){let{direction:h="right",completeOnContinue:g=true,tickerIdToResume:S=[],motionBlur:E,...C}=d,T=[],I;r||(r=a),typeof S=="string"&&(S=[S]);let m,v=p.find(a);switch(v&&(m=`${a}_temp_push`,p.editAlias(a,m),v instanceof ne||v instanceof se?I=v.positionInfo:I={x:v.x,y:v.y,type:"pixel"}),r=e(a,r,{zIndex:v?v.parent?.getChildIndex(v):void 0}),v?.parent?.setChildIndex(v,v.parent.getChildIndex(v)-.1),m&&p.copyCanvasElementProperty(m,a),m&&tickers.tickers.transfer(m,a,"move"),I||((r instanceof ne||r instanceof se)&&r.haveEmptyTexture?I=r.positionInfo:I={x:r.x,y:r.y,type:"pixel"}),(r instanceof ne||r instanceof se)&&r.haveEmptyTexture&&await r.load(),h){case "up":r.y=p.height+r.height;break;case "down":r.y=-r.height;break;case "left":r.x=p.width+r.width;break;case "right":r.x=-r.width;break}let O=tickers.tickers.pause({canvasAlias:a});if(S.push(...O),m){let Z=w(m,{...d,direction:h,completeOnContinue:g});Z&&T.push(...Z);}let B=p.animate(a,t(I),{...C,tickerIdToResume:S,completeOnContinue:g},f);B&&T.push(B);let $=de(a,r,h,E,{...C,completeOnContinue:g},f);if($&&T.push($),T.length>0)return T}zr.pushIn=re;function w(a,r={direction:"right"},d){return L(a,r,d)}zr.pushOut=w;async function N(a,r,d={},f){let{angle:h,direction:g="right",invert:S=false,duration:E,delay:C,ease:T,completeOnContinue:I=true}=d,{aliasToRemoveAfter:m=[]}=d;r||(r=a),typeof m=="string"&&(m=[m]);let{component:v,oldComponentAlias:O}=n(a,r,"wipe");O&&m.push(O),(v instanceof ne||v instanceof se)&&v.haveEmptyTexture&&await v.load();let B={kind:"wipe",angle:h??o(g),invert:S,bounds:mt(v)},$=l(a,{config:B,apply:(Z,ue,pe)=>wi(Z,B,ue,pe),from:0,to:1,duration:E,delay:C,ease:T,completeOnContinue:I,aliasToRemoveAfter:m},f);if($)return [$]}zr.wipeIn=N;function G(a,r={},d){let{angle:f,direction:h="right",invert:g=false,duration:S,delay:E,ease:C,completeOnContinue:T=true}=r,{aliasToRemoveAfter:I=[]}=r;typeof I=="string"&&(I=[I]),I.push(a);let m=p.find(a);if(!m){k.warn(`The canvas component "${a}" is not found.`);return}let v={kind:"wipe",angle:f??o(h),invert:g,bounds:mt(m)},O=l(a,{config:v,apply:(B,$,Z)=>wi(B,v,$,Z),from:1,to:0,duration:S,delay:E,ease:C,completeOnContinue:T,aliasToRemoveAfter:I},d);if(O)return [O]}zr.wipeOut=G;async function M(a,r,d={},f){let{origin:h={},aspect:g=1,invert:S=false,duration:E,delay:C,ease:T,completeOnContinue:I=true}=d,{aliasToRemoveAfter:m=[]}=d;r||(r=a),typeof m=="string"&&(m=[m]);let{component:v,oldComponentAlias:O}=n(a,r,"iris");O&&m.push(O),(v instanceof ne||v instanceof se)&&v.haveEmptyTexture&&await v.load();let B={kind:"iris",originX:h.x??.5,originY:h.y??.5,aspect:g,invert:S,bounds:mt(v)},$=l(a,{config:B,apply:(Z,ue,pe)=>Si(Z,B,ue,pe),from:0,to:1,duration:E,delay:C,ease:T,completeOnContinue:I,aliasToRemoveAfter:m},f);if($)return [$]}zr.irisIn=M;function D(a,r={},d){let{origin:f={},aspect:h=1,invert:g=false,duration:S,delay:E,ease:C,completeOnContinue:T=true}=r,{aliasToRemoveAfter:I=[]}=r;typeof I=="string"&&(I=[I]),I.push(a);let m=p.find(a);if(!m){k.warn(`The canvas component "${a}" is not found.`);return}let v={kind:"iris",originX:f.x??.5,originY:f.y??.5,aspect:h,invert:g,bounds:mt(m)},O=l(a,{config:v,apply:(B,$,Z)=>Si(B,v,$,Z),from:1,to:0,duration:S,delay:E,ease:C,completeOnContinue:T,aliasToRemoveAfter:I},d);if(O)return [O]}zr.irisOut=D;async function V(a,r,d={},f){let{orientation:h="vertical",origin:g=.5,invert:S=false,duration:E,delay:C,ease:T,completeOnContinue:I=true}=d,{aliasToRemoveAfter:m=[]}=d;r||(r=a),typeof m=="string"&&(m=[m]);let{component:v,oldComponentAlias:O}=n(a,r,"split");O&&m.push(O),(v instanceof ne||v instanceof se)&&v.haveEmptyTexture&&await v.load();let B={kind:"split",orientation:h,origin:g,invert:S,bounds:mt(v)},$=l(a,{config:B,apply:(Z,ue,pe)=>Ai(Z,B,ue,pe),from:0,to:1,duration:E,delay:C,ease:T,completeOnContinue:I,aliasToRemoveAfter:m},f);if($)return [$]}zr.splitIn=V;function j(a,r={},d){let{orientation:f="vertical",origin:h=.5,invert:g=false,duration:S,delay:E,ease:C,completeOnContinue:T=true}=r,{aliasToRemoveAfter:I=[]}=r;typeof I=="string"&&(I=[I]),I.push(a);let m=p.find(a);if(!m){k.warn(`The canvas component "${a}" is not found.`);return}let v={kind:"split",orientation:f,origin:h,invert:g,bounds:mt(m)},O=l(a,{config:v,apply:(B,$,Z)=>Ai(B,v,$,Z),from:1,to:0,duration:S,delay:E,ease:C,completeOnContinue:T,aliasToRemoveAfter:I},d);if(O)return [O]}zr.splitOut=j;async function J(a,r,d={},f){let{strength:h=32,quality:g=4,duration:S,delay:E,ease:C,completeOnContinue:T=true,fadeComponent:I=true}=d,{aliasToRemoveAfter:m=[]}=d;r||(r=a),typeof m=="string"&&(m=[m]);let{component:v,oldComponentAlias:O}=n(a,r,"blur");O&&m.push(O),(v instanceof ne||v instanceof se)&&v.haveEmptyTexture&&await v.load();let B=S??1;I&&c(a,v,"in",B,f);let $=new filters.filters.BlurFilter({strength:h,quality:g}),Z=ce(a,v,$,{strength:[h,0]},{duration:B,delay:E,ease:C,completeOnContinue:T,aliasToRemoveAfter:m},f);if(Z)return [Z]}zr.blurIn=J;function U(a,r={},d){let{strength:f=32,quality:h=4,duration:g,delay:S,ease:E,completeOnContinue:C=true,fadeComponent:T=true}=r,{aliasToRemoveAfter:I=[]}=r;typeof I=="string"&&(I=[I]),I.push(a);let m=p.find(a);if(!m){k.warn(`The canvas component "${a}" is not found.`);return}let v=g??1;T&&c(a,m,"out",v,d);let O=new filters.filters.BlurFilter({strength:0,quality:h}),B=ce(a,m,O,{strength:[0,f]},{duration:v,delay:S,ease:E,completeOnContinue:C,aliasToRemoveAfter:I},d);if(B)return [B]}zr.blurOut=U;async function W(a,r,d={},f){let{pixelSize:h=32,duration:g,delay:S,ease:E,completeOnContinue:C=true,fadeComponent:T=false}=d,{aliasToRemoveAfter:I=[]}=d;r||(r=a),typeof I=="string"&&(I=[I]);let{component:m,oldComponentAlias:v}=n(a,r,"pixelate");v&&I.push(v),(m instanceof ne||m instanceof se)&&m.haveEmptyTexture&&await m.load();let O=g??1;T&&c(a,m,"in",O,f);let B=new filters.filters.PixelateFilter(h),$=ce(a,m,B,{sizeX:[h,1],sizeY:[h,1]},{duration:O,delay:S,ease:E,completeOnContinue:C,aliasToRemoveAfter:I},f);if($)return [$]}zr.pixelateIn=W;function Q(a,r={},d){let{pixelSize:f=32,duration:h,delay:g,ease:S,completeOnContinue:E=true,fadeComponent:C=false}=r,{aliasToRemoveAfter:T=[]}=r;typeof T=="string"&&(T=[T]),T.push(a);let I=p.find(a);if(!I){k.warn(`The canvas component "${a}" is not found.`);return}let m=h??1;C&&c(a,I,"out",m,d);let v=new filters.filters.PixelateFilter(1),O=ce(a,I,v,{sizeX:[1,f],sizeY:[1,f]},{duration:m,delay:g,ease:S,completeOnContinue:E,aliasToRemoveAfter:T},d);if(O)return [O]}zr.pixelateOut=Q;async function K(a,r,d={},f){let{color:h=16777215,maxAlpha:g=1,duration:S=.3,holdDuration:E=0,pulses:C=1,completeOnContinue:T=true,fadeComponent:I=true,...m}=d;r||(r=a);let v=p.find(a);if(v){let Z=ie(a,v,r,{color:h,maxAlpha:g,fadeDuration:S,holdDuration:E,pulses:C,completeOnContinue:T,rest:m,priority:f});return Z||void 0}let{component:O}=n(a,r,"flash");(O instanceof ne||O instanceof se)&&O.haveEmptyTexture&&await O.load(),I&&c(a,O,"in",S,f);let B=[],$=oe(O,{color:h,maxAlpha:g,fadeDuration:S,holdDuration:E,pulses:C,completeOnContinue:T,aliasToRemoveAfter:[],rest:m,priority:f});if($&&B.push($),B.length>0)return B}zr.flashIn=K;function X(a,r={},d){let{color:f=16777215,maxAlpha:h=1,duration:g=.3,holdDuration:S=0,pulses:E=1,completeOnContinue:C=true,fadeComponent:T=true,...I}=r,m=p.find(a);if(!m){k.warn(`The canvas component "${a}" is not found.`);return}if(T){let{total:O}=y(h,g,S,E);c(a,m,"out",O,d);}let v=oe(m,{color:f,maxAlpha:h,fadeDuration:g,holdDuration:S,pulses:E,completeOnContinue:C,aliasToRemoveAfter:[a],rest:I,priority:d});if(v)return [v]}zr.flashOut=X;function ee(a,r,d=0){let f=a.getBounds(),h=new Xe,g=new ut__default.default.Graphics;g.rect(0,0,f.width,f.height).fill(r),h.addChild(g),h.position.set(f.x,f.y),h.alpha=d;let S=`${a.label}_flash_${Math.random().toString(36).slice(2)}`;return p.add(S,h,{zIndex:(a.zIndex??0)+1}),S}function oe(a,r){let d=ee(a,r.color),{values:f,times:h,total:g}=y(r.maxAlpha,r.fadeDuration,r.holdDuration,r.pulses,r.endAtPeak??false),S=[...r.aliasToRemoveAfter,d];return p.animate(d,{alpha:f},{...r.rest,duration:g,times:h,aliasToRemoveAfter:S,completeOnContinue:r.completeOnContinue},r.priority)}function ie(a,r,d,f){let h=ee(r,f.color),{values:g,times:S,total:E}=y(f.maxAlpha,f.fadeDuration,f.holdDuration,f.pulses,true),C=p.animate(h,{alpha:g},{...f.rest,duration:E,times:S,completeOnContinue:false},f.priority);if(setTimeout(()=>{(async()=>{let{component:T,oldComponentAlias:I}=n(a,d,"flash");p.remove(I?[h,I]:[h]),(T instanceof ne||T instanceof se)&&T.haveEmptyTexture&&await T.load();let m=ee(T,f.color,f.maxAlpha);p.animate(m,{alpha:[f.maxAlpha,0]},{...f.rest,duration:f.fadeDuration,aliasToRemoveAfter:[m],completeOnContinue:f.completeOnContinue},f.priority);})();},E*1e3),C)return [C]}function de(a,r,d,f,h,g){if(!f)return;let S=f===true?40:f,E=d==="up"||d==="down"?"velocityY":"velocityX",C=d==="up"||d==="left"?-1:1,T=new filters.filters.MotionBlurFilter({velocity:{x:0,y:0},kernelSize:15});return ce(a,r,T,{[E]:[0,C*S,0]},{duration:h.duration??.3,delay:h.delay,ease:h.ease,completeOnContinue:h.completeOnContinue,autoplay:h.autoplay},g)}function Ae(a){let r=a.filter(d=>!!d);return r.length>0?r:void 0}async function Ce(a,r,d,f,h,g,S){let{duration:E,delay:C,ease:T,completeOnContinue:I=true,fadeComponent:m=h}=f,{aliasToRemoveAfter:v=[]}=f;typeof v=="string"&&(v=[v]);let{component:O,oldComponentAlias:B}=n(a,r??a,d);B&&v.push(B),(O instanceof ne||O instanceof se)&&O.haveEmptyTexture&&await O.load();let $=E??1;return m&&c(a,O,"in",$,g),Ae(S(O,{duration:$,delay:C,ease:T,completeOnContinue:I},v))}function ot(a,r,d,f,h){let{duration:g,delay:S,ease:E,completeOnContinue:C=true,fadeComponent:T=d}=r,{aliasToRemoveAfter:I=[]}=r;typeof I=="string"&&(I=[I]),I.push(a);let m=p.find(a);if(!m){k.warn(`The canvas component "${a}" is not found.`);return}let v=g??1;return T&&c(a,m,"out",v,f),Ae(h(m,{duration:v,delay:S,ease:E,completeOnContinue:C},I))}function Ei(a){let{width:r,height:d}=a.getBounds();return Math.hypot(r,d)/2}function Yt(a){return {x:a?.x??.5,y:a?.y??.5}}function Oi(a,r,d,f,h,g,S){let{strength:E=40,bursts:C=3,slices:T=8,rgbSplit:I=6}=f,m=$=>{let Z=Lt($,.5,C);return d==="in"?Z:Z.reverse()},v={...h,ease:h.ease??"linear"},O=new filters.filters.GlitchFilter({slices:T,offset:0});O.refresh(),O.padding=Math.ceil(Math.abs(E));let B=[ce(a,r,O,{offset:m(E)},{...v,aliasToRemoveAfter:g},S)];if(I!==0){let $=m(I),Z=new filters.filters.RGBSplitFilter({red:{x:0,y:0},green:{x:0,y:0},blue:{x:0,y:0}});Z.padding=Math.ceil(Math.abs(I)),B.push(ce(a,r,Z,{redX:$,blueX:$.map(ue=>-ue)},v,S));}return B}async function br(a,r,d={},f){return Ce(a,r,"glitch",d,true,f,(h,g,S)=>Oi(a,h,"in",d,g,S,f))}zr.glitchIn=br;function wr(a,r={},d){return ot(a,r,true,d,(f,h,g)=>Oi(a,f,"out",r,h,g,d))}zr.glitchOut=wr;function _i(a,r,d,f,h,g,S){let{angle:E=540,radius:C=Ei(r),origin:T}=f,I=Yt(T),m=E*Math.PI/180,v=d==="in"?[m,0]:[0,m],O=new filters.filters.TwistFilter({radius:C,angle:v[0]}),{width:B,height:$}=r.getBounds();O.padding=Math.max(O.padding,Ii({x:I.x*B,y:I.y*$},C,B,$));let Z=ce(a,r,O,{angle:v},{...h,aliasToRemoveAfter:g},S),{x:ue,y:pe}=st(r,I);return O.offsetX=ue,O.offsetY=pe,[Z]}async function Sr(a,r,d={},f){return Ce(a,r,"twist",d,true,f,(h,g,S)=>_i(a,h,"in",d,g,S,f))}zr.twistIn=Sr;function Ar(a,r={},d){return ot(a,r,true,d,(f,h,g)=>_i(a,f,"out",r,h,g,d))}zr.twistOut=Ar;function Mi(a,r,d,f,h,g,S){let{strength:E=.6,origin:C}=f,T=Yt(C),I=d==="in"?[E,0]:[0,E],m=new filters.filters.ZoomBlurFilter({center:{x:0,y:0},strength:I[0]}),{width:v,height:O}=r.getBounds();m.padding=ei({x:T.x*v,y:T.y*O},E,v,O);let B=ce(a,r,m,{strength:I},{...h,aliasToRemoveAfter:g},S),{x:$,y:Z}=st(r,T);return m.center={x:$,y:Z},[B]}async function Er(a,r,d={},f){return Ce(a,r,"warp",d,true,f,(h,g,S)=>Mi(a,h,"in",d,g,S,f))}zr.warpIn=Er;function Or(a,r={},d){return ot(a,r,true,d,(f,h,g)=>Mi(a,f,"out",r,h,g,d))}zr.warpOut=Or;function Ri(a,r,d,f,h,g){let{origin:S,amplitude:E=30,wavelength:C=160,speed:T=500}=d,I=Yt(S),{width:m,height:v}=r.getBounds(),O=new filters.filters.ShockwaveFilter({center:{x:0,y:0},amplitude:E,wavelength:C,speed:T,time:0});O.padding=Math.ceil(Math.abs(E)*1.25);let B=ti({x:I.x*m,y:I.y*v},{width:m,height:v},C,-1)/T,$=ce(a,r,O,{time:[0,B]},{...f,aliasToRemoveAfter:h},g),{x:Z,y:ue}=st(r,I);return O.center={x:Z,y:ue},[$]}async function _r(a,r,d={},f){return Ce(a,r,"ripple",d,true,f,(h,g,S)=>Ri(a,h,d,g,S,f))}zr.rippleIn=_r;function Mr(a,r={},d){return ot(a,r,true,d,(f,h,g)=>Ri(a,f,r,h,g,d))}zr.rippleOut=Mr;function Di(a,r,d,f,h,g,S){let{edge:E="hard",noiseScale:C=8,seed:T=Math.random()*1e3}=f,[I,m]=E==="hard"?[.25,.75]:[0,1],v=d==="in"?[I,m]:[m,I],O=new filters.filters.SimplexNoiseFilter({strength:v[0],noiseScale:C,offsetZ:T,step:E==="hard"?.5:0});return [ce(a,r,O,{strength:v},{...h,aliasToRemoveAfter:g},S)]}async function Rr(a,r,d={},f){return Ce(a,r,"noise",d,false,f,(h,g,S)=>Di(a,h,"in",d,g,S,f))}zr.noiseDissolveIn=Rr;function Dr(a,r={},d){return ot(a,r,false,d,(f,h,g)=>Di(a,f,"out",r,h,g,d))}zr.noiseDissolveOut=Dr;function ki(a,r,d,f,h,g,S){let{lineThickness:E=.02,brightness:C=3,scanlines:T=true}=f,I=r.scale.x,m=r.scale.y,v=m*E,O=d==="in"?[0,.45,1]:[0,.55,1],B=d==="in"?[0,I,I]:[I,I,0],$=d==="in"?[v,v,m]:[m,v,v],Z=d==="in"?[C,C,1]:[1,C,C];d==="in"&&r.scale.set(0,v);let ue=[p.animate(a,{scaleX:B,scaleY:$},{duration:h.duration,delay:h.delay,ease:h.ease,times:O,completeOnContinue:h.completeOnContinue,aliasToRemoveAfter:g},S),ce(a,r,new filters.filters.AdjustmentFilter({brightness:Z[0]}),{brightness:Z},{...h,times:O},S)];if(T){let pe=d==="in"?[.5,.5,0]:[0,.5,.5];ue.push(ce(a,r,new filters.filters.CRTFilter({curvature:0,vignettingAlpha:0,lineWidth:3,lineContrast:pe[0],noise:pe[0]}),{lineContrast:pe,noise:pe},{...h,times:O},S));}return ue}async function kr(a,r,d={},f){return Ce(a,r,"tv",d,false,f,(h,g,S)=>ki(a,h,"in",d,g,S,f))}zr.tvIn=kr;function Br(a,r={},d){return ot(a,r,false,d,(f,h,g)=>ki(a,f,"out",r,h,g,d))}zr.tvOut=Br;function Bi(a,r,d,f,h,g,S){let{strength:E=1,mode:C="pinch",radius:T=Ei(r),origin:I}=f,m=(C==="bulge"?1:-1)*E,v=Yt(I),O=d==="in"?[m,0]:[0,m],B=new filters.filters.BulgePinchFilter({center:v,radius:T,strength:O[0]});if(C==="bulge"){let{width:Fi,height:Li}=r.getBounds();B.padding=Ii({x:v.x*Fi,y:v.y*Li},T,Fi,Li);}let $=ce(a,r,B,{strength:O},{...h,aliasToRemoveAfter:g},S),{x:Z,y:ue,area:pe}=st(r,v);return B.center={x:Z/pe.width,y:ue/pe.height},[$]}async function Fr(a,r,d={},f){return Ce(a,r,"pinch",d,true,f,(h,g,S)=>Bi(a,h,"in",d,g,S,f))}zr.pinchIn=Fr;function Lr(a,r={},d){return ot(a,r,true,d,(f,h,g)=>Bi(a,f,"out",r,h,g,d))}zr.pinchOut=Lr;})(exports.transitions||={});var zt=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 Pr(){return async(e,i)=>{try{let n=e.canvasElementInfo;if(n){let o=new zt(n),l=n.zIndex;o.groupColor=16711680;let c=new ut__default.default.Graphics;c.rect(0,0,300,100).fill({color:16711680,alpha:.5}),o.addChild(c);let y=new ut__default.default.Text({text:`Error: ${n.label}`,x:10,y:10});o.addChild(y);let x=e.parent;if(x&&"addChild"in x)l!==void 0?x.addChildAt(o,l):x.addChild(o);else {let u=n.parentLabel?p.find(n.parentLabel):void 0;if(u)l!==void 0?u.addChildAt(o,l):u.addChild(o);else {let P=n.label??n.pixivnId;p.add(P,o,{zIndex:l});}}}}catch{}}}function vr(t,e,i){let n={...p.find(t)?.memory,...i},o=new gt({text:e,...i});return n&&p.copyCanvasElementProperty(n,o),p.add(t,o,{ignoreOldStyle:true,zIndex:i?.zIndex}),o}var {Assets:il,Color:nl,Rectangle:rl,TextStyle:sl,Texture:ol,UPDATE_PRIORITY:al}=ut__default.default,p=new kt;Pe.init({getScreen:()=>p.screen});core.GameUnifier.addOnPreContinue(async()=>{try{let{tikersIds:t,stepAlias:e}=tickers.drainCompleteOnStepEndQueue(),i=(async()=>{for(;t.length;){let{id:o}=t.pop()||{};o&&await tickers.tickers.forceCompletion(o);}})(),n=(async()=>{for(;e.length;){let{alias:o,id:l}=e.pop()||{};o&&l&&await tickers.tickers.forceCompletion(l,o);}})();await Promise.all([i,n]);}catch{}});
|
|
2
|
-
exports.Assets=
|
|
1
|
+
'use strict';var core=require('@drincs/pixi-vn/core'),ht=require('@drincs/pixi-vn/pixi.js'),tickers=require('@drincs/pixi-vn/tickers'),devtools=require('@pixi/devtools'),filters=require('@drincs/pixi-vn/filters');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var ht__default=/*#__PURE__*/_interopDefault(ht);var wi=Object.defineProperty;var Nn=t=>{throw TypeError(t)};var Si=(t,e,n)=>e in t?wi(t,e,{enumerable:true,configurable:true,writable:true,value:n}):t[e]=n;var Ie=(t,e,n)=>Si(t,typeof e!="symbol"?e+"":e,n),gn=(t,e,n)=>e.has(t)||Nn("Cannot "+n);var o=(t,e,n)=>(gn(t,e,"read from private field"),n?n.call(t):e.get(t)),ne=(t,e,n)=>e.has(t)?Nn("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),U=(t,e,n,i)=>(gn(t,e,"write to private field"),e.set(t,n),n),F=(t,e,n)=>(gn(t,e,"access private method"),n);var Xt=(t,e,n,i)=>({set _(s){U(t,e,s);},get _(){return o(t,e,i)}});var Ai={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,n){switch(e){case "xAlign":"xAlign"in t&&(t.xAlign=n/100);break;case "yAlign":"yAlign"in t&&(t.yAlign=n/100);break;case "percentageX":"percentageX"in t&&(t.percentageX=n/100);break;case "percentageY":"percentageY"in t&&(t.percentageY=n/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}}}]}},Vn=Ai;var Le="__game_layer__",Pt="Container",$t="ImageContainer",vt="Image",Tt="Sprite",It="Text",Ct="Video";var B;(s=>(s.log=(l,...c)=>console.log(`[Pixi\u2019VN] ${l}`,...c),s.warn=(l,...c)=>console.warn(`[Pixi\u2019VN] ${l}`,...c),s.error=(l,...c)=>console.error(`[Pixi\u2019VN] ${l}`,...c),s.info=(l,...c)=>console.info(`[Pixi\u2019VN] ${l}`,...c)))(B||={});function Xn(t,e){let n=0;return async(...i)=>{let s=Date.now();if(s-n>=e)return n=s,await t(...i)}}var fe=class t{constructor(){}static _app=void 0;static get app(){if(!t._app)throw B.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(Le);return e||(e=new ht__default.default.Container,e.label=Le,t.app.stage.addChild(e)),e}static htmlLayers=[];static canvasWidth=300;static canvasHeight=300;static _isInitialized=false;static async init(e,n,i){let{id:s="pixi-vn-canvas",width:l=800,height:c=600,resolution:y=1,autoDensity:m=true,resizeMode:f="contain",...x}=n||{};return t.canvasWidth=l,t.canvasHeight=c,t._app=new ht__default.default.Application,t.app.init({width:l,height:c,resolution:y,autoDensity:m,...x}).then(()=>{let{app:T=t.app,extensions:A=[],...z}=i||{};if(devtools.initDevtools({app:T,extensions:[Vn,...A],...z}),t._isInitialized=true,t.addCanvasIntoHTMLElement(e,s),f==="contain"){let Y=Xn(async()=>{requestAnimationFrame(()=>t.resize());},10);new ResizeObserver(Y).observe(e),t.resize(),setTimeout(()=>t.resize(),750);}t.gameLayer;})}static addCanvasIntoHTMLElement(e,n){t._isInitialized?(e.appendChild(t.app.canvas),t.app.canvas.id=n):B.error("GameWindowManager is not initialized");}static addHtmlLayer(e,n,i={}){let{position:s="absolute",pointerEvents:l="none",userSelect:c="none"}=i,y=document.createElement("div");y.setAttribute("id",e),y.style.position=s,y.style.pointerEvents=l,y.style.userSelect=c;let m=n.appendChild(y);return t.htmlLayers.push(y),t.resize(),m}static removeHtmlLayer(e){let n=t.htmlLayers.find(i=>i.id===e);n&&(n.remove(),t.htmlLayers=t.htmlLayers.filter(i=>i.id!==e));}static getHtmlLayer(e){return t.htmlLayers.find(n=>n.id===e)}static async resize(){let e=t.canvasWidth,n=t.canvasHeight,i=t.app.resizeTo,s=t.app.canvas.style;i instanceof HTMLElement||(i=document.documentElement);let l,c;if(i===document.body||i===document.documentElement)l=document.documentElement.clientWidth||window.innerWidth,c=document.documentElement.clientHeight||window.innerHeight;else {let A=i.getBoundingClientRect();l=A.width||i.clientWidth,c=A.height||i.clientHeight;}let y=Math.min(l/e,c/n),m=Math.floor(y*e),f=Math.floor(y*n);s.width=`${m}px`,s.height=`${f}px`;let x=(l-m)/2,T=(c-f)/2;s.marginLeft=`${x}px`,s.marginRight=`${x}px`,s.marginTop=`${T}px`,s.marginBottom=`${T}px`,t.htmlLayers.forEach(A=>{A.style.width=`${m}px`,A.style.height=`${f}px`,A.style.marginLeft=`${x}px`,A.style.marginRight=`${x}px`,A.style.marginTop=`${T}px`,A.style.marginBottom=`${T}px`;});}static get childrenAliasesOrder(){return t.gameLayer.children.filter(e=>e.label).sort((e,n)=>t.gameLayer.getChildIndex(e)-t.gameLayer.getChildIndex(n)).map(e=>e.label)}};var _i=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Zn=new Set,mn=typeof process=="object"&&process?process:{},Jn=(t,e,n,i)=>{typeof mn.emitWarning=="function"?mn.emitWarning(t,e,n,i):console.error(`[${n}] ${e}: ${t}`);},Zt=globalThis.AbortController,jn=globalThis.AbortSignal;if(typeof Zt>"u"){jn=class{onabort;_onabort=[];reason;aborted=false;addEventListener(n,i){this._onabort.push(i);}},Zt=class{constructor(){e();}signal=new jn;abort(n){if(!this.signal.aborted){this.signal.reason=n,this.signal.aborted=true;for(let i of this.signal._onabort)i(n);this.signal.onabort?.(n);}}};let t=mn.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{t&&(t=false,Jn("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 Mi=t=>!Zn.has(t);var tt=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),Qn=t=>tt(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?jt:null:null,jt=class extends Array{constructor(t){super(t),this.fill(0);}},$e,bt,Ri=($e=class{heap;length;static create(e){let n=Qn(e);if(!n)return [];U($e,bt,true);let i=new $e(e,n);return U($e,bt,false),i}constructor(e,n){if(!o($e,bt))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new n(e),this.length=0;}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}},bt=new WeakMap,ne($e,bt,false),$e),Kn,qn,ke,Oe,ze,ct,Ye,wt,St,Ue,me,We,pe,ue,Z,Se,Ee,be,xe,He,Pe,Ge,Ne,_e,Me,Ve,st,Ae,At,D,yn,dt,Je,Bt,Re,ti,ut,Ot,Ft,nt,it,xn,Kt,qt,de,Pn,kt,rt,vn,Et,ei=(Et=class{constructor(e){ne(this,D);ne(this,ke);ne(this,Oe);ne(this,ze);ne(this,ct);ne(this,Ye);ne(this,wt);ne(this,St);ne(this,Ue);Ie(this,"ttl");Ie(this,"ttlResolution");Ie(this,"ttlAutopurge");Ie(this,"updateAgeOnGet");Ie(this,"updateAgeOnHas");Ie(this,"allowStale");Ie(this,"noDisposeOnSet");Ie(this,"noUpdateTTL");Ie(this,"maxEntrySize");Ie(this,"sizeCalculation");Ie(this,"noDeleteOnFetchRejection");Ie(this,"noDeleteOnStaleGet");Ie(this,"allowStaleOnFetchAbort");Ie(this,"allowStaleOnFetchRejection");Ie(this,"ignoreFetchAbort");ne(this,me);ne(this,We);ne(this,pe);ne(this,ue);ne(this,Z);ne(this,Se);ne(this,Ee);ne(this,be);ne(this,xe);ne(this,He);ne(this,Pe);ne(this,Ge);ne(this,Ne);ne(this,_e);ne(this,Me);ne(this,Ve);ne(this,st);ne(this,Ae);ne(this,At);ne(this,dt,()=>{});ne(this,Je,()=>{});ne(this,Bt,()=>{});ne(this,Re,()=>false);ne(this,ut,e=>{});ne(this,Ot,(e,n,i)=>{});ne(this,Ft,(e,n,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});Ie(this,Kn,"LRUCache");let{max:n=0,ttl:i,ttlResolution:s=1,ttlAutopurge:l,updateAgeOnGet:c,updateAgeOnHas:y,allowStale:m,dispose:f,onInsert:x,disposeAfter:T,noDisposeOnSet:A,noUpdateTTL:z,maxSize:Y=0,maxEntrySize:G=0,sizeCalculation:re,fetchMethod:C,memoMethod:X,noDeleteOnFetchRejection:N,noDeleteOnStaleGet:R,allowStaleOnFetchRejection:k,allowStaleOnFetchAbort:$,ignoreFetchAbort:K,perf:J}=e;if(J!==void 0&&typeof J?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(U(this,Ue,J??_i),n!==0&&!tt(n))throw new TypeError("max option must be a nonnegative integer");let H=n?Qn(n):Array;if(!H)throw new Error("invalid max value: "+n);if(U(this,ke,n),U(this,Oe,Y),this.maxEntrySize=G||o(this,Oe),this.sizeCalculation=re,this.sizeCalculation){if(!o(this,Oe)&&!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(X!==void 0&&typeof X!="function")throw new TypeError("memoMethod must be a function if defined");if(U(this,St,X),C!==void 0&&typeof C!="function")throw new TypeError("fetchMethod must be a function if specified");if(U(this,wt,C),U(this,st,!!C),U(this,pe,new Map),U(this,ue,new Array(n).fill(void 0)),U(this,Z,new Array(n).fill(void 0)),U(this,Se,new H(n)),U(this,Ee,new H(n)),U(this,be,0),U(this,xe,0),U(this,He,Ri.create(n)),U(this,me,0),U(this,We,0),typeof f=="function"&&U(this,ze,f),typeof x=="function"&&U(this,ct,x),typeof T=="function"?(U(this,Ye,T),U(this,Pe,[])):(U(this,Ye,void 0),U(this,Pe,void 0)),U(this,Ve,!!o(this,ze)),U(this,At,!!o(this,ct)),U(this,Ae,!!o(this,Ye)),this.noDisposeOnSet=!!A,this.noUpdateTTL=!!z,this.noDeleteOnFetchRejection=!!N,this.allowStaleOnFetchRejection=!!k,this.allowStaleOnFetchAbort=!!$,this.ignoreFetchAbort=!!K,this.maxEntrySize!==0){if(o(this,Oe)!==0&&!tt(o(this,Oe)))throw new TypeError("maxSize must be a positive integer if specified");if(!tt(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");F(this,D,ti).call(this);}if(this.allowStale=!!m,this.noDeleteOnStaleGet=!!R,this.updateAgeOnGet=!!c,this.updateAgeOnHas=!!y,this.ttlResolution=tt(s)||s===0?s:1,this.ttlAutopurge=!!l,this.ttl=i||0,this.ttl){if(!tt(this.ttl))throw new TypeError("ttl must be a positive integer if specified");F(this,D,yn).call(this);}if(o(this,ke)===0&&this.ttl===0&&o(this,Oe)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!o(this,ke)&&!o(this,Oe)){let W="LRU_CACHE_UNBOUNDED";Mi(W)&&(Zn.add(W),Jn("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",W,Et));}}get perf(){return o(this,Ue)}static unsafeExposeInternals(e){return {starts:o(e,Ne),ttls:o(e,_e),autopurgeTimers:o(e,Me),sizes:o(e,Ge),keyMap:o(e,pe),keyList:o(e,ue),valList:o(e,Z),next:o(e,Se),prev:o(e,Ee),get head(){return o(e,be)},get tail(){return o(e,xe)},free:o(e,He),isBackgroundFetch:n=>{var i;return F(i=e,D,de).call(i,n)},backgroundFetch:(n,i,s,l)=>{var c;return F(c=e,D,qt).call(c,n,i,s,l)},moveToTail:n=>{var i;return F(i=e,D,kt).call(i,n)},indexes:n=>{var i;return F(i=e,D,nt).call(i,n)},rindexes:n=>{var i;return F(i=e,D,it).call(i,n)},isStale:n=>{var i;return o(i=e,Re).call(i,n)}}}get max(){return o(this,ke)}get maxSize(){return o(this,Oe)}get calculatedSize(){return o(this,We)}get size(){return o(this,me)}get fetchMethod(){return o(this,wt)}get memoMethod(){return o(this,St)}get dispose(){return o(this,ze)}get onInsert(){return o(this,ct)}get disposeAfter(){return o(this,Ye)}getRemainingTTL(e){return o(this,pe).has(e)?1/0:0}*entries(){for(let e of F(this,D,nt).call(this))o(this,Z)[e]!==void 0&&o(this,ue)[e]!==void 0&&!F(this,D,de).call(this,o(this,Z)[e])&&(yield [o(this,ue)[e],o(this,Z)[e]]);}*rentries(){for(let e of F(this,D,it).call(this))o(this,Z)[e]!==void 0&&o(this,ue)[e]!==void 0&&!F(this,D,de).call(this,o(this,Z)[e])&&(yield [o(this,ue)[e],o(this,Z)[e]]);}*keys(){for(let e of F(this,D,nt).call(this)){let n=o(this,ue)[e];n!==void 0&&!F(this,D,de).call(this,o(this,Z)[e])&&(yield n);}}*rkeys(){for(let e of F(this,D,it).call(this)){let n=o(this,ue)[e];n!==void 0&&!F(this,D,de).call(this,o(this,Z)[e])&&(yield n);}}*values(){for(let e of F(this,D,nt).call(this))o(this,Z)[e]!==void 0&&!F(this,D,de).call(this,o(this,Z)[e])&&(yield o(this,Z)[e]);}*rvalues(){for(let e of F(this,D,it).call(this))o(this,Z)[e]!==void 0&&!F(this,D,de).call(this,o(this,Z)[e])&&(yield o(this,Z)[e]);}[(qn=Symbol.iterator,Kn=Symbol.toStringTag,qn)](){return this.entries()}find(e,n={}){for(let i of F(this,D,nt).call(this)){let s=o(this,Z)[i],l=F(this,D,de).call(this,s)?s.__staleWhileFetching:s;if(l!==void 0&&e(l,o(this,ue)[i],this))return this.get(o(this,ue)[i],n)}}forEach(e,n=this){for(let i of F(this,D,nt).call(this)){let s=o(this,Z)[i],l=F(this,D,de).call(this,s)?s.__staleWhileFetching:s;l!==void 0&&e.call(n,l,o(this,ue)[i],this);}}rforEach(e,n=this){for(let i of F(this,D,it).call(this)){let s=o(this,Z)[i],l=F(this,D,de).call(this,s)?s.__staleWhileFetching:s;l!==void 0&&e.call(n,l,o(this,ue)[i],this);}}purgeStale(){let e=false;for(let n of F(this,D,it).call(this,{allowStale:true}))o(this,Re).call(this,n)&&(F(this,D,rt).call(this,o(this,ue)[n],"expire"),e=true);return e}info(e){let n=o(this,pe).get(e);if(n===void 0)return;let i=o(this,Z)[n],s=F(this,D,de).call(this,i)?i.__staleWhileFetching:i;if(s===void 0)return;let l={value:s};if(o(this,_e)&&o(this,Ne)){let c=o(this,_e)[n],y=o(this,Ne)[n];if(c&&y){let m=c-(o(this,Ue).now()-y);l.ttl=m,l.start=Date.now();}}return o(this,Ge)&&(l.size=o(this,Ge)[n]),l}dump(){let e=[];for(let n of F(this,D,nt).call(this,{allowStale:true})){let i=o(this,ue)[n],s=o(this,Z)[n],l=F(this,D,de).call(this,s)?s.__staleWhileFetching:s;if(l===void 0||i===void 0)continue;let c={value:l};if(o(this,_e)&&o(this,Ne)){c.ttl=o(this,_e)[n];let y=o(this,Ue).now()-o(this,Ne)[n];c.start=Math.floor(Date.now()-y);}o(this,Ge)&&(c.size=o(this,Ge)[n]),e.unshift([i,c]);}return e}load(e){this.clear();for(let[n,i]of e){if(i.start){let s=Date.now()-i.start;i.start=o(this,Ue).now()-s;}this.set(n,i.value,i);}}set(e,n,i={}){var A,z,Y,G;if(n===void 0)return this.delete(e),this;let{ttl:s=this.ttl,start:l,noDisposeOnSet:c=this.noDisposeOnSet,sizeCalculation:y=this.sizeCalculation,status:m}=i,{noUpdateTTL:f=this.noUpdateTTL}=i,x=o(this,Ft).call(this,e,n,i.size||0,y);if(this.maxEntrySize&&x>this.maxEntrySize)return m&&(m.set="miss",m.maxEntrySizeExceeded=true),F(this,D,rt).call(this,e,"set"),this;let T=o(this,me)===0?void 0:o(this,pe).get(e);if(T===void 0)T=o(this,me)===0?o(this,xe):o(this,He).length!==0?o(this,He).pop():o(this,me)===o(this,ke)?F(this,D,Kt).call(this,false):o(this,me),o(this,ue)[T]=e,o(this,Z)[T]=n,o(this,pe).set(e,T),o(this,Se)[o(this,xe)]=T,o(this,Ee)[T]=o(this,xe),U(this,xe,T),Xt(this,me)._++,o(this,Ot).call(this,T,x,m),m&&(m.set="add"),f=false,o(this,At)&&((A=o(this,ct))==null||A.call(this,n,e,"add"));else {F(this,D,kt).call(this,T);let re=o(this,Z)[T];if(n!==re){if(o(this,st)&&F(this,D,de).call(this,re)){re.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:C}=re;C!==void 0&&!c&&(o(this,Ve)&&((z=o(this,ze))==null||z.call(this,C,e,"set")),o(this,Ae)&&o(this,Pe)?.push([C,e,"set"]));}else c||(o(this,Ve)&&((Y=o(this,ze))==null||Y.call(this,re,e,"set")),o(this,Ae)&&o(this,Pe)?.push([re,e,"set"]));if(o(this,ut).call(this,T),o(this,Ot).call(this,T,x,m),o(this,Z)[T]=n,m){m.set="replace";let C=re&&F(this,D,de).call(this,re)?re.__staleWhileFetching:re;C!==void 0&&(m.oldValue=C);}}else m&&(m.set="update");o(this,At)&&this.onInsert?.(n,e,n===re?"update":"replace");}if(s!==0&&!o(this,_e)&&F(this,D,yn).call(this),o(this,_e)&&(f||o(this,Bt).call(this,T,s,l),m&&o(this,Je).call(this,m,T)),!c&&o(this,Ae)&&o(this,Pe)){let re=o(this,Pe),C;for(;C=re?.shift();)(G=o(this,Ye))==null||G.call(this,...C);}return this}pop(){var e;try{for(;o(this,me);){let n=o(this,Z)[o(this,be)];if(F(this,D,Kt).call(this,!0),F(this,D,de).call(this,n)){if(n.__staleWhileFetching)return n.__staleWhileFetching}else if(n!==void 0)return n}}finally{if(o(this,Ae)&&o(this,Pe)){let n=o(this,Pe),i;for(;i=n?.shift();)(e=o(this,Ye))==null||e.call(this,...i);}}}has(e,n={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=n,l=o(this,pe).get(e);if(l!==void 0){let c=o(this,Z)[l];if(F(this,D,de).call(this,c)&&c.__staleWhileFetching===void 0)return false;if(o(this,Re).call(this,l))s&&(s.has="stale",o(this,Je).call(this,s,l));else return i&&o(this,dt).call(this,l),s&&(s.has="hit",o(this,Je).call(this,s,l)),true}else s&&(s.has="miss");return false}peek(e,n={}){let{allowStale:i=this.allowStale}=n,s=o(this,pe).get(e);if(s===void 0||!i&&o(this,Re).call(this,s))return;let l=o(this,Z)[s];return F(this,D,de).call(this,l)?l.__staleWhileFetching:l}async fetch(e,n={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:l=this.noDeleteOnStaleGet,ttl:c=this.ttl,noDisposeOnSet:y=this.noDisposeOnSet,size:m=0,sizeCalculation:f=this.sizeCalculation,noUpdateTTL:x=this.noUpdateTTL,noDeleteOnFetchRejection:T=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:A=this.allowStaleOnFetchRejection,ignoreFetchAbort:z=this.ignoreFetchAbort,allowStaleOnFetchAbort:Y=this.allowStaleOnFetchAbort,context:G,forceRefresh:re=false,status:C,signal:X}=n;if(!o(this,st))return C&&(C.fetch="get"),this.get(e,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:l,status:C});let N={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:l,ttl:c,noDisposeOnSet:y,size:m,sizeCalculation:f,noUpdateTTL:x,noDeleteOnFetchRejection:T,allowStaleOnFetchRejection:A,allowStaleOnFetchAbort:Y,ignoreFetchAbort:z,status:C,signal:X},R=o(this,pe).get(e);if(R===void 0){C&&(C.fetch="miss");let k=F(this,D,qt).call(this,e,R,N,G);return k.__returned=k}else {let k=o(this,Z)[R];if(F(this,D,de).call(this,k)){let H=i&&k.__staleWhileFetching!==void 0;return C&&(C.fetch="inflight",H&&(C.returnedStale=true)),H?k.__staleWhileFetching:k.__returned=k}let $=o(this,Re).call(this,R);if(!re&&!$)return C&&(C.fetch="hit"),F(this,D,kt).call(this,R),s&&o(this,dt).call(this,R),C&&o(this,Je).call(this,C,R),k;let K=F(this,D,qt).call(this,e,R,N,G),J=K.__staleWhileFetching!==void 0&&i;return C&&(C.fetch=$?"stale":"refresh",J&&$&&(C.returnedStale=true)),J?K.__staleWhileFetching:K.__returned=K}}async forceFetch(e,n={}){let i=await this.fetch(e,n);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(e,n={}){let i=o(this,St);if(!i)throw new Error("no memoMethod provided to constructor");let{context:s,forceRefresh:l,...c}=n,y=this.get(e,c);if(!l&&y!==void 0)return y;let m=i(e,y,{options:c,context:s});return this.set(e,m,c),m}get(e,n={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:l=this.noDeleteOnStaleGet,status:c}=n,y=o(this,pe).get(e);if(y!==void 0){let m=o(this,Z)[y],f=F(this,D,de).call(this,m);return c&&o(this,Je).call(this,c,y),o(this,Re).call(this,y)?(c&&(c.get="stale"),f?(c&&i&&m.__staleWhileFetching!==void 0&&(c.returnedStale=true),i?m.__staleWhileFetching:void 0):(l||F(this,D,rt).call(this,e,"expire"),c&&i&&(c.returnedStale=true),i?m:void 0)):(c&&(c.get="hit"),f?m.__staleWhileFetching:(F(this,D,kt).call(this,y),s&&o(this,dt).call(this,y),m))}else c&&(c.get="miss");}delete(e){return F(this,D,rt).call(this,e,"delete")}clear(){return F(this,D,vn).call(this,"delete")}},ke=new WeakMap,Oe=new WeakMap,ze=new WeakMap,ct=new WeakMap,Ye=new WeakMap,wt=new WeakMap,St=new WeakMap,Ue=new WeakMap,me=new WeakMap,We=new WeakMap,pe=new WeakMap,ue=new WeakMap,Z=new WeakMap,Se=new WeakMap,Ee=new WeakMap,be=new WeakMap,xe=new WeakMap,He=new WeakMap,Pe=new WeakMap,Ge=new WeakMap,Ne=new WeakMap,_e=new WeakMap,Me=new WeakMap,Ve=new WeakMap,st=new WeakMap,Ae=new WeakMap,At=new WeakMap,D=new WeakSet,yn=function(){let e=new jt(o(this,ke)),n=new jt(o(this,ke));U(this,_e,e),U(this,Ne,n);let i=this.ttlAutopurge?new Array(o(this,ke)):void 0;U(this,Me,i),U(this,Bt,(y,m,f=o(this,Ue).now())=>{n[y]=m!==0?f:0,e[y]=m,s(y,m);}),U(this,dt,y=>{n[y]=e[y]!==0?o(this,Ue).now():0,s(y,e[y]);});let s=this.ttlAutopurge?(y,m)=>{if(i?.[y]&&(clearTimeout(i[y]),i[y]=void 0),m&&m!==0&&i){let f=setTimeout(()=>{o(this,Re).call(this,y)&&F(this,D,rt).call(this,o(this,ue)[y],"expire");},m+1);f.unref&&f.unref(),i[y]=f;}}:()=>{};U(this,Je,(y,m)=>{if(e[m]){let f=e[m],x=n[m];if(!f||!x)return;y.ttl=f,y.start=x,y.now=l||c();let T=y.now-x;y.remainingTTL=f-T;}});let l=0,c=()=>{let y=o(this,Ue).now();if(this.ttlResolution>0){l=y;let m=setTimeout(()=>l=0,this.ttlResolution);m.unref&&m.unref();}return y};this.getRemainingTTL=y=>{let m=o(this,pe).get(y);if(m===void 0)return 0;let f=e[m],x=n[m];if(!f||!x)return 1/0;let T=(l||c())-x;return f-T},U(this,Re,y=>{let m=n[y],f=e[y];return !!f&&!!m&&(l||c())-m>f});},dt=new WeakMap,Je=new WeakMap,Bt=new WeakMap,Re=new WeakMap,ti=function(){let e=new jt(o(this,ke));U(this,We,0),U(this,Ge,e),U(this,ut,n=>{U(this,We,o(this,We)-e[n]),e[n]=0;}),U(this,Ft,(n,i,s,l)=>{if(F(this,D,de).call(this,i))return 0;if(!tt(s))if(l){if(typeof l!="function")throw new TypeError("sizeCalculation must be a function");if(s=l(i,n),!tt(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return s}),U(this,Ot,(n,i,s)=>{if(e[n]=i,o(this,Oe)){let l=o(this,Oe)-e[n];for(;o(this,We)>l;)F(this,D,Kt).call(this,true);}U(this,We,o(this,We)+e[n]),s&&(s.entrySize=i,s.totalCalculatedSize=o(this,We));});},ut=new WeakMap,Ot=new WeakMap,Ft=new WeakMap,nt=function*({allowStale:e=this.allowStale}={}){if(o(this,me))for(let n=o(this,xe);!(!F(this,D,xn).call(this,n)||((e||!o(this,Re).call(this,n))&&(yield n),n===o(this,be)));)n=o(this,Ee)[n];},it=function*({allowStale:e=this.allowStale}={}){if(o(this,me))for(let n=o(this,be);!(!F(this,D,xn).call(this,n)||((e||!o(this,Re).call(this,n))&&(yield n),n===o(this,xe)));)n=o(this,Se)[n];},xn=function(e){return e!==void 0&&o(this,pe).get(o(this,ue)[e])===e},Kt=function(e){var l;let n=o(this,be),i=o(this,ue)[n],s=o(this,Z)[n];return o(this,st)&&F(this,D,de).call(this,s)?s.__abortController.abort(new Error("evicted")):(o(this,Ve)||o(this,Ae))&&(o(this,Ve)&&((l=o(this,ze))==null||l.call(this,s,i,"evict")),o(this,Ae)&&o(this,Pe)?.push([s,i,"evict"])),o(this,ut).call(this,n),o(this,Me)?.[n]&&(clearTimeout(o(this,Me)[n]),o(this,Me)[n]=void 0),e&&(o(this,ue)[n]=void 0,o(this,Z)[n]=void 0,o(this,He).push(n)),o(this,me)===1?(U(this,be,U(this,xe,0)),o(this,He).length=0):U(this,be,o(this,Se)[n]),o(this,pe).delete(i),Xt(this,me)._--,n},qt=function(e,n,i,s){let l=n===void 0?void 0:o(this,Z)[n];if(F(this,D,de).call(this,l))return l;let c=new Zt,{signal:y}=i;y?.addEventListener("abort",()=>c.abort(y.reason),{signal:c.signal});let m={signal:c.signal,options:i,context:s},f=(G,re=false)=>{let{aborted:C}=c.signal,X=i.ignoreFetchAbort&&G!==void 0,N=i.ignoreFetchAbort||!!(i.allowStaleOnFetchAbort&&G!==void 0);if(i.status&&(C&&!re?(i.status.fetchAborted=true,i.status.fetchError=c.signal.reason,X&&(i.status.fetchAbortIgnored=true)):i.status.fetchResolved=true),C&&!X&&!re)return T(c.signal.reason,N);let R=z,k=o(this,Z)[n];return (k===z||X&&re&&k===void 0)&&(G===void 0?R.__staleWhileFetching!==void 0?o(this,Z)[n]=R.__staleWhileFetching:F(this,D,rt).call(this,e,"fetch"):(i.status&&(i.status.fetchUpdated=true),this.set(e,G,m.options))),G},x=G=>(i.status&&(i.status.fetchRejected=true,i.status.fetchError=G),T(G,false)),T=(G,re)=>{let{aborted:C}=c.signal,X=C&&i.allowStaleOnFetchAbort,N=X||i.allowStaleOnFetchRejection,R=N||i.noDeleteOnFetchRejection,k=z;if(o(this,Z)[n]===z&&(!R||!re&&k.__staleWhileFetching===void 0?F(this,D,rt).call(this,e,"fetch"):X||(o(this,Z)[n]=k.__staleWhileFetching)),N)return i.status&&k.__staleWhileFetching!==void 0&&(i.status.returnedStale=true),k.__staleWhileFetching;if(k.__returned===k)throw G},A=(G,re)=>{var X;let C=(X=o(this,wt))==null?void 0:X.call(this,e,l,m);C&&C instanceof Promise&&C.then(N=>G(N===void 0?void 0:N),re),c.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(G(void 0),i.allowStaleOnFetchAbort&&(G=N=>f(N,true)));});};i.status&&(i.status.fetchDispatched=true);let z=new Promise(A).then(f,x),Y=Object.assign(z,{__abortController:c,__staleWhileFetching:l,__returned:void 0});return n===void 0?(this.set(e,Y,{...m.options,status:void 0}),n=o(this,pe).get(e)):o(this,Z)[n]=Y,Y},de=function(e){if(!o(this,st))return false;let n=e;return !!n&&n instanceof Promise&&n.hasOwnProperty("__staleWhileFetching")&&n.__abortController instanceof Zt},Pn=function(e,n){o(this,Ee)[n]=e,o(this,Se)[e]=n;},kt=function(e){e!==o(this,xe)&&(e===o(this,be)?U(this,be,o(this,Se)[e]):F(this,D,Pn).call(this,o(this,Ee)[e],o(this,Se)[e]),F(this,D,Pn).call(this,o(this,xe),e),U(this,xe,e));},rt=function(e,n){var s,l;let i=false;if(o(this,me)!==0){let c=o(this,pe).get(e);if(c!==void 0)if(o(this,Me)?.[c]&&(clearTimeout(o(this,Me)?.[c]),o(this,Me)[c]=void 0),i=true,o(this,me)===1)F(this,D,vn).call(this,n);else {o(this,ut).call(this,c);let y=o(this,Z)[c];if(F(this,D,de).call(this,y)?y.__abortController.abort(new Error("deleted")):(o(this,Ve)||o(this,Ae))&&(o(this,Ve)&&((s=o(this,ze))==null||s.call(this,y,e,n)),o(this,Ae)&&o(this,Pe)?.push([y,e,n])),o(this,pe).delete(e),o(this,ue)[c]=void 0,o(this,Z)[c]=void 0,c===o(this,xe))U(this,xe,o(this,Ee)[c]);else if(c===o(this,be))U(this,be,o(this,Se)[c]);else {let m=o(this,Ee)[c];o(this,Se)[m]=o(this,Se)[c];let f=o(this,Se)[c];o(this,Ee)[f]=o(this,Ee)[c];}Xt(this,me)._--,o(this,He).push(c);}}if(o(this,Ae)&&o(this,Pe)?.length){let c=o(this,Pe),y;for(;y=c?.shift();)(l=o(this,Ye))==null||l.call(this,...y);}return i},vn=function(e){var n,i;for(let s of F(this,D,it).call(this,{allowStale:true})){let l=o(this,Z)[s];if(F(this,D,de).call(this,l))l.__abortController.abort(new Error("deleted"));else {let c=o(this,ue)[s];o(this,Ve)&&((n=o(this,ze))==null||n.call(this,l,c,e)),o(this,Ae)&&o(this,Pe)?.push([l,c,e]);}}if(o(this,pe).clear(),o(this,Z).fill(void 0),o(this,ue).fill(void 0),o(this,_e)&&o(this,Ne)){o(this,_e).fill(0),o(this,Ne).fill(0);for(let s of o(this,Me)??[])s!==void 0&&clearTimeout(s);o(this,Me)?.fill(void 0);}if(o(this,Ge)&&o(this,Ge).fill(0),U(this,be,0),U(this,xe,0),o(this,He).length=0,U(this,We,0),U(this,me,0),o(this,Ae)&&o(this,Pe)){let s=o(this,Pe),l;for(;l=s?.shift();)(i=o(this,Ye))==null||i.call(this,...l);}},Et);var je=class{cache;map=new Map;constructor(e){this.cache=new ei({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 n=this.map.delete(e);return n&&this.cache.delete(e),n}get forEach(){return this.map.forEach}get(e){let n=this.cache.get(e);return n||this.map.get(e)}has(e){return this.map.has(e)}set(e,n){return this.map.set(e,n),this.cache.set(e,n),this}get size(){return this.map.size}entries(){return this.map.entries()}keys(){return this.map.keys()}values(){return this.map.values()}};var Tn=Symbol("SerializableEvent"),_t=new je({cacheSize:5});function Di(t){return (e,n,i)=>{let s=i.value;In.add(s,t||`${n}`);}}var In;(l=>{function t(c,y){c[Tn]=y,_t.get(y)&&B.info(`Event "${y}" already exists, it will be overwritten`),_t.set(y,c);}l.add=t;function e(c){try{let y=_t.get(c);if(!y){B.error(`Event "${c}" not found, did you forget to register it with the eventDecorator?`);return}return y}catch(y){B.error(`Error while getting Event "${c}"`,y);return}}l.get=e;function n(){return Array.from(_t.values())}l.values=n;function i(c){return _t.has(c)}l.has=i;function s(){return Array.from(_t.keys())}l.keys=s;})(In||={});var Cn=In;async function ni(t,e){if("onEvents"in e)for(let n in e.onEvents){let i=e.onEvents[n],s=Cn.get(i);s&&t.on(n,s);}}function ii(t){let{onEventsHandlers:e={}}=t;return e}function ft(t,e,n){let i=n[Tn];return i&&typeof i=="string"?(e.onEventsHandlers[t]=i,true):(B.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 Mt=new je({cacheSize:5}),ri=new je({cacheSize:2}),si=new je({cacheSize:2});function Bi(t={}){return e=>{bn.add(e,t);}}async function Be(t,e,n){let i=n?.ignoreScale||false,s=n?.end;if("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),!i&&"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),ni(t,e),"pixivnFilters"in e&&e.pixivnFilters!==void 0){let l=e.pixivnFilters.map(c=>filters.RegisteredFilters.getInstance(c.filterId,c.args,c.padding)).filter(c=>!!c);t.filters=l.length>0?l:null;}"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),s&&await s(),i||("width"in e&&e.width!==void 0&&(t.width=e.width),"height"in e&&e.height!==void 0&&(t.height=e.height));}var bn;(y=>{function t(m,f={}){let{name:x=m.name,getInstance:T=async(z,Y)=>{let G=new z;return await G.setMemory(Y),G},copyProperty:A=async(z,Y)=>{await z.setMemory(Y);}}=f;Mt.get(x)&&B.warn(`CanvasElement "${x}" already registered`),m.prototype.pixivnId=x,Mt.set(x,m),ri.set(x,T),si.set(x,A);}y.add=t;function e(m){let f=Mt.get(m);if(!f){B.error(`CanvasElement "${m}" not found, did you forget to register it with the canvasComponentDecorator?`);return}return f}y.get=e;async function n(m,f){let x=e(m),T=ri.get(m);if(!x||!T){B.error(`CanvasElement "${m}" not found, did you forget to register it with the canvasComponentDecorator?`);return}try{return await T(x,f)}catch(A){B.error(`Error while getting CanvasElement instance "${m}"`,A);}}y.getInstance=n;async function i(m,f,x){let T=si.get(m);if(!T){B.error(`CanvasElement "${m}" not found, did you forget to register it with the canvasComponentDecorator?`);return}try{await T(f,x);}catch(A){B.error(`Error while copying properties of CanvasElement "${m}"`,A);}}y.copyProperty=i;function s(){return Array.from(Mt.values())}y.values=s;function l(m){return Mt.has(m)}y.has=l;function c(){return Array.from(Mt.keys())}y.keys=c;})(bn||={});var Ce=bn;async function Jt(t){let e=await Ce.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 Sn(t){return "memory"in t?t.memory:t instanceof ht__default.default.Text?On(t):t instanceof ht__default.default.Sprite?An(t):pt(t)}function zi(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,pixivnFilters:Yi(t.filters)}}function Yi(t){if(!t)return;let e=Array.isArray(t)?t:[t],n=[];for(let i of e){let s=i.pixivnFilterId;if(!s){B.warn("A Filter instance without a registered pixivnFilterId can't be saved and will be skipped. Register it with filterDecorator/RegisteredFilters to make it save-compatible.",i);continue}let l=filters.RegisteredFilters.toMemory(s,i);l&&n.push(l);}return n}function wn(t,e){return {url:t.source.label,alias:e===t.source.label?void 0:e}}function pt(t,e){let n=Ui(t,Pt),s=e?.childrenExport||false?t.children.sort((l,c)=>t.getChildIndex(l)-t.getChildIndex(c)).map(l=>Sn(l)):[];return {pixivnId:n,elements:s,onEvents:ii(t),...zi(t)}}function An(t){let e=pt(t),n=e.pixivnId??Tt,i="assetsAliases"in t&&Array.isArray(t.assetsAliases)?wn(t.texture,t.assetsAliases[0]):"textureAlias"in t?wn(t.texture,t.textureAlias):wn(t.texture);return {...e,pixivnId:n,textureData:i,anchor:{x:t.anchor.x,y:t.anchor.y},roundPixels:t.roundPixels}}function On(t){let e=pt(t),n=e.pixivnId??It;return {...e,pixivnId:n,anchor:{x:t.anchor.x,y:t.anchor.y},text:t.text,resolution:t.resolution,style:Ni(t.style),roundPixels:t.roundPixels}}function Ui(t,e){return Object.hasOwn(t,"pixivnId")?t.pixivnId:e}function Qt(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 Wi(t){if(t!=null){{if(typeof t=="number")return t;if(typeof t=="string"||Array.isArray(t))return t;if(t instanceof ht__default.default.FillGradient)return Qt(t);if(typeof t=="object"&&"fill"in t&&typeof t.fill!="function"&&t.fill){if(!(t.fill instanceof ht__default.default.FillPattern))return Qt(t.fill)}}B.warn("Unsupported property type for Text.style.fill.",t);}}function Hi(t){if(typeof t=="number")return t;if(typeof t=="string")return t;if(Array.isArray(t))return t;if(t instanceof ht__default.default.Color)return t.toNumber();B.warn("Unsupported color type.",t);}function Gi(t){if(t!=null){{if(typeof t=="number")return t;if(typeof t=="string"||Array.isArray(t))return t;if(t instanceof ht__default.default.FillGradient)return Qt(t);if(typeof t=="object"&&"alignment"in t)return {alignment:t.alignment,alpha:t.alpha,color:Hi(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 ht__default.default.FillPattern))return Qt(t.fill)}}B.warn("Unsupported property type for Text.style.stroke.",t);}}function Ni(t){return {align:t.align,breakWords:t.breakWords,dropShadow:t.dropShadow,fill:Wi(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:Gi(t.stroke),textBaseline:t.textBaseline,trim:t.trim,whiteSpace:t.whiteSpace,wordWrap:t.wordWrap,wordWrapWidth:t.wordWrapWidth}}function gt(t){try{if(typeof t>"u")return t;let e=JSON.stringify(t);return JSON.parse(e)}catch(e){throw B.error("Error creating exportable element",t,e),new core.PixiError("not_json_serializable","Error creating exportable element")}}var Lt=class{tickersPausedByGameLayerRender=[];get app(){return fe.app}get gameLayer(){return fe.gameLayer}get isInitialized(){return fe._isInitialized}get width(){return fe.canvasWidth}get height(){return fe.canvasHeight}get screen(){return this.app.screen}async init(e,n,i){return await fe.init(e,n,i)}get children(){return fe.gameLayer.children}async copyCanvasElementProperty(e,n,i={}){let s=["isRenderGroup","scale","visible","boundsArea","text","resolution","style","height","width"],{ignoreProperties:l=m=>m}=i;if(typeof n=="string"){let m=this.find(n);if(m)n=m;else {B.error(`Canvas element ${n} not found`);return}}if(typeof e=="string"){let m=this.find(e);if(m)e=m;else {B.error(`Canvas element ${e} not found`);return}}e instanceof ht__default.default.Container&&(e=e.memory);let c=l(s),y={...e};c.forEach(m=>{m in y&&delete y[m];}),await Ce.copyProperty(n.pixivnId,n,y);}add(e,n,i={}){if(e===Le){B.error(`The alias ${Le} is reserved`);return}let s=this.find(e),l=i?.ignoreOldStyle;s&&!l&&this.copyCanvasElementProperty(s,n);let{zIndex:c=s?.parent?.getChildIndex(s)}=i;s&&!this.canvasElementIsOnCanvas(s)?B.error(`The canvas element ${e} exist in the memory but it is not on the canvas, so the zIndex is not set`):s&&this.remove(e,{ignoreTickers:true}),c!==void 0?(n.label=e,this.gameLayer.addChildAt(n,c)):(n.label=e,this.gameLayer.addChild(n));}remove(e,n={}){if(e===Le){B.error(`The alias ${Le} is reserved`);return}let i=n.ignoreTickers;typeof e=="string"&&(e=[e]),e.forEach(s=>{this.gameLayer.getChildrenByLabel(s).forEach(l=>{this.gameLayer.removeChild(l),!i&&tickers.tickers.unlinkComponent(s);});});}find(e){if(e===Le)return this.gameLayer;let n=this.gameLayer.getChildByLabel(e);if(n)return n}canvasElementIsOnCanvas(e){return this.gameLayer.children.includes(e)}removeAll(){this.gameLayer.removeChildren();}editAlias(e,n,i={}){let s=this.find(e);s&&(s.label=n),!i.ignoreTickers&&tickers.tickers.transfer(e,n,"move");}get currentTickers(){return this.tickers.currentTickers}get currentTickersSteps(){return this.tickers.currentTickersSteps}findTicker(e){return tickers.tickers.find(e)}addTicker(e,n){return tickers.tickers.add(e,n)}addTickersSequence(e,n,i=0){return tickers.tickers.addSequence(e,n,i)}onTickerComplete(e,n){return tickers.tickers.onComplete(e,n)}unlinkComponentFromTicker(e,n){return tickers.tickers.unlinkComponent(e,n)}removeAllTickers(){return tickers.tickers.removeAll()}removeTicker(e,n={stopTicker:true}){return tickers.removeTicker(e,n)}pauseTicker(e){return tickers.tickers.pause(e)}resumeTicker(e){return tickers.tickers.resume(e)}isTickerPaused(e,n){return tickers.tickers.isPaused(e,n)}pause(){this.gameLayer.renderable!==false&&(this.gameLayer.renderable=false,this.tickersPausedByGameLayerRender=tickers.tickers.pause({id:Array.from(tickers.TickersManagerStatic._currentTickers.keys())}));}resume(){if(this.gameLayer.renderable===true)return;this.gameLayer.renderable=true;let e=this.tickersPausedByGameLayerRender.filter(n=>tickers.TickersManagerStatic._currentTickers.has(n));e.length>0&&tickers.tickers.resume({id:e}),this.tickersPausedByGameLayerRender=[];}transferTickers(e,n,i="move"){return tickers.tickers.transfer(e,n,i)}completeTickerOnStepEnd(e){return tickers.tickers.completeOnStepEnd(e)}async forceCompletionOfTicker(e,n){return tickers.tickers.forceCompletion(e,n)}tickers=tickers.tickers;animate(e,n,i,s){return core.GameUnifier.animate(e,n,i,s)}addLayerInternal(e,n){if(e===Le){B.error(`The alias ${Le} is reserved`);return}return n.label=e,fe.app.stage.addChild(n)}getLayerInternal(e){return fe.app.stage.getChildByLabel(e)}removeLayerInternal(e){let n=fe.app.stage.getChildByLabel(e);n&&fe.app.stage.removeChild(n);}addHtmlLayerInternal(e,n,i){return fe.addHtmlLayer(e,n,i)}removeHtmlLayerInternal(e){return fe.removeHtmlLayer(e)}getHtmlLayerInternal(e){return fe.getHtmlLayer(e)}addLayer(e,n){return this.addLayerInternal(e,n)}getLayer(e){return this.getLayerInternal(e)}removeLayer(e){return this.removeLayerInternal(e)}addHtmlLayer(e,n,i){return this.addHtmlLayerInternal(e,n,i)}removeHtmlLayer(e){return this.removeHtmlLayerInternal(e)}getHtmlLayer(e){return this.getHtmlLayerInternal(e)}layers={get gameLayer(){return fe.gameLayer},add:(e,n)=>this.addLayerInternal(e,n),get:e=>this.getLayerInternal(e),remove:e=>this.removeLayerInternal(e)};htmlLayers={add:(e,n,i)=>this.addHtmlLayerInternal(e,n,i),get:e=>this.getHtmlLayerInternal(e),remove:e=>this.removeHtmlLayerInternal(e)};async extractImage(){let e=this.gameLayer.renderable===false;e&&this.resume();let n;try{n=this.app.renderer.extract.image(this.app.stage);}finally{e&&this.pause();}return (await n).src}clear(){this.tickersPausedByGameLayerRender=[],tickers.tickers.removeAll(),this.removeAll();}export(){let e=this.gameLayer.renderable===false;e&&this.resume();try{let n={};return this.children.forEach(i=>{i.label&&(n[i.label]=Sn(i));}),{tickers:gt(tickers.TickersManagerStatic.currentTickersWithoutCreatedBySteps()),tickersSteps:gt(tickers.TickersManagerStatic.currentTickersSequence()),elements:gt(n),stage:gt(pt(this.gameLayer)),elementAliasesOrder:gt(fe.childrenAliasesOrder),tickersToCompleteOnStepEnd:gt(tickers.TickersManagerStatic._tickersToCompleteOnStepEnd)}}finally{e&&this.pause();}}async restore(e){this.clear();try{if(Object.hasOwn(e,"elements")&&Object.hasOwn(e,"elementAliasesOrder")){let n=e.elementAliasesOrder,i={},s=Object.entries(e.elements).map(async([l,c])=>{i[l]=await Jt(c);});await Promise.all(s),n.forEach(l=>{let c=i[l];c&&this.add(l,c);});}else {B.error("The data does not have the properties elementAliasesOrder and elements");return}if(Object.hasOwn(e,"stage")&&Object.hasOwn(e,"stage")?Be(this.gameLayer,e.stage,{ignoreScale:!0}):B.error("The data does not have the properties stage"),Object.hasOwn(e,"tickers")){let n=e.tickers;Object.entries(n).forEach(([i,s])=>{let l=s.canvasElementAliases;if(l.length!==0){let c=tickers.RegisteredTickers.getInstance(s.id,s.args,{duration:s.duration,priority:s.priority,id:i,canvasElementAliases:l});c?(c.canvasElementAliases=l,tickers.tickers.add(l,c),s.paused&&c.pause()):B.error(`Ticker ${s.id} not found`);}});}if(Object.hasOwn(e,"tickersSteps")){let n=e.tickersSteps;Object.entries(n).forEach(([i,s])=>{tickers.TickersManagerStatic._currentTickersSequence.set(i,new Map(Object.entries(s))),Object.keys(s).forEach(l=>{tickers.runTickersSequence(i,l);});});}if(Object.hasOwn(e,"tickersToCompleteOnStepEnd")){let n=e.tickersToCompleteOnStepEnd,i=n.tikersIds,s=n.stepAlias.map(l=>({id:l.id,alias:l.alias}));tickers.TickersManagerStatic._tickersToCompleteOnStepEnd.tikersIds.length=0,tickers.TickersManagerStatic._tickersToCompleteOnStepEnd.tikersIds.push(...i),tickers.TickersManagerStatic._tickersToCompleteOnStepEnd.stepAlias.length=0,tickers.TickersManagerStatic._tickersToCompleteOnStepEnd.stepAlias.push(...s);}}catch(n){B.error("Error importing data",n);}}};var ve=class t{static init(e){t._getScreen=e.getScreen;}static _getScreen;static get screen(){return t._getScreen()}};exports.CanvasPropertyUtility=void 0;(m=>{function t(f,x,T,A,z,Y=0){return z?f==="width"?x*(ve.screen.width-T)+T-A-Y*T:x*(ve.screen.height-T)+T-A-Y*T:f==="width"?x*(ve.screen.width-T)+A+Y*T:x*(ve.screen.height-T)+A+Y*T}m.calculatePositionByAlign=t;function e(f,x,T,A,z,Y=0){return z?f==="width"?(x-T+A+Y*T)/(ve.screen.width-T):(x-T+A+Y*T)/(ve.screen.height-T):f==="width"?(x-A-Y*T)/(ve.screen.width-T):(x-A-Y*T)/(ve.screen.height-T)}m.calculateAlignByPosition=e;function n(f,x){return f==="width"?x*ve.screen.width:x*ve.screen.height}m.calculatePositionByPercentagePosition=n;function i(f,x){return f==="width"?x/ve.screen.width:x/ve.screen.height}m.calculatePercentagePositionByPosition=i;function s(f,x){if(x=x%360,x<0&&(x+=360),x===0)return {x:f.x,y:f.y};if(x===90)return {x:-f.y,y:f.x};if(x===180)return {x:-f.x,y:-f.y};if(x===270)return {x:f.y,y:-f.x};if(x>0&&x<90){let T=x*Math.PI/180,A=Math.cos(T),z=Math.sin(T),Y=f.x*A-f.y*z,G=f.x*z+f.y*A;return f.x!==0&&Math.sign(Y)!==Math.sign(f.x)&&(Y=-Y),f.y!==0&&Math.sign(G)!==Math.sign(f.y)&&(G=-G),{x:Y,y:G}}else if(x>90&&x<180){let T=(x-90)*Math.PI/180,A=Math.cos(T),z=Math.sin(T),Y=-f.y*z-f.x*A,G=f.y*A-f.x*z;return f.x!==0&&Math.sign(Y)!==Math.sign(f.x)&&(Y=-Y),f.y!==0&&Math.sign(G)!==Math.sign(f.y)&&(G=-G),{x:Y,y:G}}else if(x>180&&x<270){let T=(x-180)*Math.PI/180,A=Math.cos(T),z=Math.sin(T),Y=-f.x*A+f.y*z,G=-f.x*z-f.y*A;return f.x!==0&&Math.sign(Y)!==Math.sign(f.x)&&(Y=-Y),f.y!==0&&Math.sign(G)!==Math.sign(f.y)&&(G=-G),{x:Y,y:G}}else if(x>270&&x<360){let T=(x-270)*Math.PI/180,A=Math.cos(T),z=Math.sin(T),Y=f.y*z-f.x*A,G=-f.y*A-f.x*z;return f.x!==0&&Math.sign(Y)!==Math.sign(f.x)&&(Y=-Y),f.y!==0&&Math.sign(G)!==Math.sign(f.y)&&(G=-G),{x:Y,y:G}}return {x:0,y:0}}m.getSuperPoint=s;function l(f,x){if(x=x%360,x<0&&(x+=360),x===0)return {x:f.x,y:f.y};if(x===90)return {x:f.y,y:-f.x};if(x===180)return {x:-f.x,y:-f.y};if(x===270)return {x:-f.y,y:f.x};if(x>0&&x<90){let T=x*Math.PI/180,A=Math.cos(T),z=Math.sin(T);return {x:f.x*A+f.y*z,y:-f.x*z+f.y*A}}else if(x>90&&x<180){let T=(x-90)*Math.PI/180,A=Math.cos(T),z=Math.sin(T);return {x:f.y*A-f.x*z,y:-f.y*z-f.x*A}}else if(x>180&&x<270){let T=(x-180)*Math.PI/180,A=Math.cos(T),z=Math.sin(T);return {x:-f.x*A-f.y*z,y:f.x*z-f.y*A}}else if(x>270&&x<360){let T=(x-270)*Math.PI/180,A=Math.cos(T),z=Math.sin(T);return {x:-f.y*A+f.x*z,y:f.y*z+f.x*A}}return {x:0,y:0}}m.getPointBySuperPoint=l;function c(f){let x=f.width,T=f.height,A=f.angle%360;return A<0&&(A+=360),A===0||A===180?x:A===90||A===270?T:Math.abs(x*Math.cos(A*Math.PI/180))+Math.abs(T*Math.sin(A*Math.PI/180))}m.getSuperWidth=c;function y(f){let x=f.width,T=f.height,A=f.angle%360;return A<0&&(A+=360),A===0||A===180?T:A===90||A===270?x:Math.abs(T*Math.cos(A*Math.PI/180))+Math.abs(x*Math.sin(A*Math.PI/180))}m.getSuperHeight=y;})(exports.CanvasPropertyUtility||={});async function zt(t){if(t!=="EMPTY"){if(!t)throw B.error("Texture not found",t),new core.PixiError("unregistered_asset","Texture not found");if(ht__default.default.Assets.cache.has(t)){let e=ht__default.default.Assets.get(t);if(e)return e}return ht__default.default.Assets.load(t).then(e=>{if(!e)throw B.error("Texture not found",t),new core.PixiError("unregistered_asset","Texture not found");if(!(e instanceof ht__default.default.Texture))throw B.error("File is not a Texture",t),new core.PixiError("unregistered_asset","File is not a Texture");return e}).catch(e=>{throw B.error("Error loading file",e),new core.PixiError("unknown_element","Error loading file")})}}function Xe(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 mt=class t extends ht__default.default.Sprite{constructor(e){if(e instanceof ht__default.default.Texture)super(e);else {let{align:n,percentagePosition:i,...s}=Xe(e)||{};super(s),n&&(this.align=n),i&&(this.percentagePosition=i);}this.pixivnId=this.constructor.prototype.pixivnId||Tt;}pixivnId=Tt;get memory(){return {...An(this),pixivnId:this.pixivnId,align:this._align,percentagePosition:this._percentagePosition}}async setMemory(e){return await rn(this,e)}static from(e,n){let i=ht__default.default.Sprite.from(e,n),s=new t;return s.texture=i.texture,s}onEventsHandlers={};on(e,n,i){return ft(e,this,n),super.on(e,(...s)=>n(...s,this),i)}_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),n=exports.CanvasPropertyUtility.getSuperPoint(this.scale,this.angle);return {x:exports.CanvasPropertyUtility.calculateAlignByPosition("width",this.x,exports.CanvasPropertyUtility.getSuperWidth(this),e.x,n.x<0,this.anchor.x),y:exports.CanvasPropertyUtility.calculateAlignByPosition("height",this.y,exports.CanvasPropertyUtility.getSuperHeight(this),e.y,n.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),n=exports.CanvasPropertyUtility.getSuperPoint(this.scale,this.angle);return exports.CanvasPropertyUtility.calculateAlignByPosition("width",this.x,exports.CanvasPropertyUtility.getSuperWidth(this),e.x,n.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),n=exports.CanvasPropertyUtility.getSuperPoint(this.scale,this.angle);return exports.CanvasPropertyUtility.calculateAlignByPosition("height",this.y,exports.CanvasPropertyUtility.getSuperHeight(this),e.y,n.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),n=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,n.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,n.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;}};Ce.add(mt,{name:Tt,copyProperty:async(t,e)=>{await rn(t,e,{ignoreTexture:true});}});async function rn(t,e,n){e=Xe(e);let i=n?.ignoreTexture||false;if(await Be(t,e),!i){let l;if("textureData"in e&&e.textureData&&(l=e.textureData),l&&l.url!=="EMPTY"){let c=l.url;l.alias&&ht__default.default.Assets.resolver.hasKey(l.alias)&&(c=l.alias);try{let y=await zt(c);y&&(t.texture=y);}catch(y){B.error("Error in Sprite.setMemorySprite() while loading texture"),y=new core.PixiError("unregistered_asset",`Error loading image ${c}`,"canvas",e),core.GameUnifier.runOnError(y,{});}}}let s=n?.half;s&&await s(),"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 oe=class t extends mt{_textureAlias;get textureAlias(){return this._textureAlias?this._textureAlias:this.texture.source.label}pixivnId=vt;constructor(e,n){super(e),n&&(this._textureAlias=n);}get memory(){return {...super.memory,pixivnId:this.pixivnId,loadIsStarted:this._loadIsStarted}}async setMemory(e){let n;"textureData"in e&&e.textureData&&(n=e.textureData),"assetsData"in e&&Array.isArray(e.assetsData)&&e.assetsData.length>0&&(n=e.assetsData[0]),n&&n.alias&&(this._textureAlias=n.alias),await sn(this,e),this.reloadPosition();}static from(e,n){let i=ht__default.default.Sprite.from(e,n),s=new t;return s.texture=i.texture,s}_loadIsStarted=false;get loadIsStarted(){return this._loadIsStarted}async load(){return this._loadIsStarted=true,zt(this.textureAlias).then(e=>{this._loadIsStarted=false,e&&(this.texture=e);}).catch(e=>{this._loadIsStarted=false,B.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"}};Ce.add(oe,{name:vt,copyProperty:async(t,e)=>{await sn(t,e,{ignoreTexture:true});}});async function sn(t,e,n){return await rn(t,e,{half:async()=>{"loadIsStarted"in e&&e.loadIsStarted&&await t.load();},ignoreTexture:n?.ignoreTexture})}var qe=class t extends oe{constructor(e,n){if(e instanceof ht__default.default.Texture){super(e,n);return}let{loop:i,paused:s,currentTime:l,...c}=e||{};super(c,n),i&&(this.loop=i),s&&(this.paused=s),l&&(this.currentTime=l);}pixivnId=Ct;get memory(){return {...super.memory,pixivnId:this.pixivnId,loop:this.loop,paused:this._paused,currentTime:this.currentTime}}async setMemory(e){await ai(this,e),this.reloadPosition();}static from(e,n){let i=ht__default.default.Sprite.from(e,n),s=new t;return s.texture=i.texture,s}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 n=this.duration;n&&e>=n&&(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}};Ce.add(qe,{name:Ct,getInstance:async(t,e)=>{let n;"textureData"in e&&e.textureData&&(n=e.textureData);let i=new t(void 0,n?.alias);return await i.setMemory(e),i},copyProperty:async(t,e)=>{await ai(t,e,{ignoreTexture:true});}});async function ai(t,e,n){await sn(t,e,{ignoreTexture:n?.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 Qe=class extends ht.Container{constructor(e){let{anchor:n,align:i,percentagePosition:s,...l}=Xe(e)||{};super(l),this.pixivnId=this.constructor.prototype.pixivnId||Pt,n&&(this.anchor=n),i&&(this.align=i),s&&(this.percentagePosition=s);}pixivnId=Pt;get memory(){return {...pt(this,{childrenExport:true}),anchor:this._anchor?this.anchor:void 0,align:this._align,percentagePosition:this._percentagePosition}}async setMemory(e){await this.importChildren(e),await Be(this,e),this.reloadAnchor(),this.reloadPosition();}async importChildren(e){for(let n=0;n<e.elements.length;n++){let i=e.elements[n],s=await Jt(i);this.addChild(s);}}onEventsHandlers={};on(e,n,i){return ft(e,this,n),super.on(e,(...s)=>n(...s,this),i)}_anchor;get anchor(){let e=super.pivot.x/this.width,n=super.pivot.y/this.height;return {x:e,y:n}}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),n=exports.CanvasPropertyUtility.getSuperPoint(this.scale,this.angle);return {x:exports.CanvasPropertyUtility.calculateAlignByPosition("width",this.x,exports.CanvasPropertyUtility.getSuperWidth(this),e.x,n.x<0),y:exports.CanvasPropertyUtility.calculateAlignByPosition("height",this.y,exports.CanvasPropertyUtility.getSuperHeight(this),e.y,n.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),n=exports.CanvasPropertyUtility.getSuperPoint(this.scale,this.angle);return exports.CanvasPropertyUtility.calculateAlignByPosition("width",this.x,exports.CanvasPropertyUtility.getSuperWidth(this),e.x,n.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),n=exports.CanvasPropertyUtility.getSuperPoint(this.scale,this.angle);return exports.CanvasPropertyUtility.calculateAlignByPosition("height",this.y,exports.CanvasPropertyUtility.getSuperHeight(this),e.y,n.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),n=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,n.x<0)),this._align.y!==void 0&&(super.y=exports.CanvasPropertyUtility.calculatePositionByAlign("height",this._align.y,exports.CanvasPropertyUtility.getSuperHeight(this),e.y,n.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;}};Ce.add(Qe,{name:Pt,copyProperty:async(t,e)=>await Be(t,e)});var ir=new Set(["mp4","webm","ogg","ogv","avi","mov","wmv","flv","mkv","m4v","3gp","3g2","ts","mts"]);function Yt(t){let e=ht__default.default.Assets.cache.has(t)?ht__default.default.Assets.get(t):null;return e instanceof ht__default.default.Texture&&(t=e.source?.label||t),rr(t)}function rr(t){let e=t.split(".").pop()?.toLowerCase();return e!==void 0&&ir.has(e)}var ae=class extends Qe{constructor(e,n){let{anchor:i,align:s,percentagePosition:l,...c}=Xe(e)||{};super(c),n&&n.forEach(y=>{Yt(y)?this.addChild(new qe(void 0,y)):this.addChild(new oe(void 0,y));}),i&&(this.anchor=i),s&&(this.align=s),l&&(this.percentagePosition=l);}get memory(){return {...super.memory,pixivnId:$t,loadIsStarted:this._loadIsStarted}}async setMemory(e){await this.importChildren(e),await li(this,e),this.reloadAnchor(),this.reloadPosition();}pixivnId=$t;_loadIsStarted=false;get loadIsStarted(){return this._loadIsStarted}async load(){this._loadIsStarted=true;let e=this.children.map(n=>n.load());return Promise.all(e).then(()=>{this._loadIsStarted=false,this.reloadAnchor(),this.reloadPosition();}).catch(n=>{this._loadIsStarted=false,B.error("Error into ImageContainer.load()",n);})}get texture(){return this.children.length>0?this.children[0].texture:new ht__default.default.Texture}get haveEmptyTexture(){return this.children.some(e=>e.texture._source.label==="EMPTY")}};Ce.add(ae,{name:$t,copyProperty:async(t,e)=>await li(t,e)});async function li(t,e){e=Xe(e)||{},Be(t,e,{end:async()=>{"loadIsStarted"in e&&e.loadIsStarted&&await t.load();}});}var on=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 yt=class extends ht__default.default.Text{constructor(e){let{align:n,percentagePosition:i,...s}=Xe(e)||{};super(s),this.pixivnId=this.constructor.prototype.pixivnId||It,n&&(this.align=n),i&&(this.percentagePosition=i);}pixivnId=It;get memory(){return {...On(this),pixivnId:this.pixivnId,align:this._align,percentagePosition:this._percentagePosition}}async setMemory(e){await ar(this,e),this.reloadPosition();}onEventsHandlers={};on(e,n,i){return ft(e,this,n),super.on(e,(...s)=>n(...s,this),i)}_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),n=exports.CanvasPropertyUtility.getSuperPoint(this.scale,this.angle);return {x:exports.CanvasPropertyUtility.calculateAlignByPosition("width",this.x,exports.CanvasPropertyUtility.getSuperWidth(this),e.x,n.x<0,this.anchor.x),y:exports.CanvasPropertyUtility.calculateAlignByPosition("height",this.y,exports.CanvasPropertyUtility.getSuperHeight(this),e.y,n.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),n=exports.CanvasPropertyUtility.getSuperPoint(this.scale,this.angle);return exports.CanvasPropertyUtility.calculateAlignByPosition("width",this.x,exports.CanvasPropertyUtility.getSuperWidth(this),e.x,n.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),n=exports.CanvasPropertyUtility.getSuperPoint(this.scale,this.angle);return exports.CanvasPropertyUtility.calculateAlignByPosition("height",this.y,exports.CanvasPropertyUtility.getSuperHeight(this),e.y,n.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),n=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,n.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,n.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;}};Ce.add(yt,{name:It});async function ar(t,e){"text"in e&&e.text!==void 0&&(t.text=e.text),await Be(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);}function Ut(t,e,n){let i=[0],s=t;for(let l=0;l<n;l++)i.push(s,-s*.6,s*.3,0),s*=e;return i}function di(t,e,n,i){let s=n.reduce((x,T)=>T.enabled?x+T.padding:x,0),l=t.x,c=t.y,y=t.x+t.width,m=t.y+t.height;i&&(l=Math.max(l,0),c=Math.max(c,0),y=Math.min(y,i.width),m=Math.min(m,i.height));let f={x:l-s,y:c-s,width:y-l+s*2,height:m-c+s*2};return {x:t.x+e.x*t.width-f.x,y:t.y+e.y*t.height-f.y,area:f}}function _n(t,e,n,i){return Math.max(0,Math.ceil(e-Math.min(t.x,t.y,n-t.x,i-t.y)))}function an(t,e,n,i){let s=Math.min(Math.max(e,0),.5),l=Math.hypot(Math.max(t.x,n-t.x),Math.max(t.y,i-t.y));return Math.ceil(l*s/(1-s))}function ln(t,e,n,i){return i>0?i:Math.hypot(Math.max(t.x,e.width-t.x),Math.max(t.y,e.height-t.y))+n/2}function Mn(t){let e=t.filters;return e?Array.isArray(e)?[...e]:[e]:[]}function dr(t,e){t.filters=[...Mn(t),...e];}function ur(t,e){let n=Mn(t).filter(i=>!e.includes(i));t.filters=n.length>0?n:null;}function le(t,e,n,i,s,l,c){dr(e,[n]),c?.();let y=filters.filters.animate(t,n,i,{duration:s.duration??1,delay:s.delay,ease:s.ease,times:s.times,aliasToRemoveAfter:s.aliasToRemoveAfter,autoplay:s.autoplay},l,void 0,()=>{ur(e,[n]),n.destroy();});return y&&(s.completeOnContinue??true)&&tickers.tickers.completeOnStepEnd({id:y}),y}function ot(t,e){let n;try{n=g.screen;}catch{n=void 0;}return di(t.getBounds(),e,Mn(t),n)}async function fr(t,e={},n){return exports.effects.shakeEffect(t,e,n)}function ui(t){switch(t){case "up":return {axis:"y",sign:-1};case "down":return {axis:"y",sign:1};case "left":return {axis:"x",sign:-1};default:return {axis:"x",sign:1}}}function cn(t,e,n){let i=[0],s=t;for(let l=0;l<n;l++)i.push(l%2===0?s:-s,0),s*=e;return i}function Rt(t,e,n,i){let s=[t],l=e;for(let c=0;c<i;c++)s.push(t+l,t),l*=n;return s}exports.effects=void 0;(re=>{async function t(C,X={},N){let R=g.find(C);if(!R){B.error(`The element with the alias ${C} does not exist. So the shake effect can't be applied.`);return}let k={x:R.position.x,y:R.position.y},{shakeType:$="horizontal",maxShockSize:K=10,shocksNumber:J=10,...H}=X,W=J-1;if(W<2){B.error("The number of shocks must be at least 3.");return}let Q=Math.floor(W/2),q=Math.ceil(W/2),j=[];for(let se=0;se<Q;se++){let he=K*(se+1)/Q;$==="horizontal"?se%2!==0?j.push(k.x+he):j.push(k.x-he):se%2!==0?j.push(k.y+he):j.push(k.y-he);}let ie=Q%2===0;for(let se=q;se>0;se--){let he=K*(se+1)/(q-1);$==="horizontal"?se%2===0&&!ie||se%2!==0&&ie?j.push(k.x-he):j.push(k.x+he):se%2===0&&!ie||se%2!==0&&ie?j.push(k.y-he):j.push(k.y+he);}let ce;if($==="horizontal"?(j.push(k.x),ce=g.animate(C,{x:j},H,N)):(j.push(k.y),ce=g.animate(C,{y:j},H,N)),ce)return [ce]}re.shakeEffect=t;async function e(C,X={},N){let R=g.find(C);if(!R){B.error(`The element with the alias ${C} does not exist. So the bounce effect can't be applied.`);return}let{direction:k="up",distance:$=30,bounces:K=4,decay:J=.5,...H}=X,{axis:W,sign:Q}=ui(k),q=W==="x"?R.position.x:R.position.y,j=[q],ie=$;for(let se=0;se<K;se++)j.push(q+Q*ie,q),ie*=J;let ce=g.animate(C,{[W]:j},H,N);if(ce)return [ce]}re.bounceEffect=e;async function n(C,X={},N){let R=g.find(C);if(!R){B.error(`The element with the alias ${C} does not exist. So the pulse effect can't be applied.`);return}let{scale:k=1.2,pulses:$=3,decay:K=.6,...J}=X,H=R.scale.x,W=R.scale.y,Q=[H],q=[W],j=k-1;for(let ce=0;ce<$;ce++)Q.push(H*(1+j),H),q.push(W*(1+j),W),j*=K;let ie=g.animate(C,{scaleX:Q,scaleY:q},J,N);if(ie)return [ie]}re.pulseEffect=n;async function i(C,X={},N){let R=g.find(C);if(!R){B.error(`The element with the alias ${C} does not exist. So the hop effect can't be applied.`);return}let{direction:k="up",distance:$=40,secondaryHops:K=0,decay:J=.5,...H}=X,{axis:W,sign:Q}=ui(k),q=W==="x"?R.position.x:R.position.y,j=[q],ie=$;for(let se=0;se<1+K;se++)j.push(q+Q*ie,q),ie*=J;let ce=g.animate(C,{[W]:j},H,N);if(ce)return [ce]}re.hopEffect=i;async function s(C,X={},N){let R=g.find(C);if(!R){B.error(`The element with the alias ${C} does not exist. So the wiggle effect can't be applied.`);return}let{angle:k=15,repetitions:$=3,decay:K=.5,...J}=X,H=R.rotation,W=k*Math.PI/180,Q=cn(W,K,$).map(j=>H+j),q=g.animate(C,{rotation:Q},J,N);if(q)return [q]}re.wiggleEffect=s;async function l(C,X={},N){let R=g.find(C);if(!R){B.error(`The element with the alias ${C} does not exist. So the nod effect can't be applied.`);return}let{axis:k="horizontal",distance:$=15,repetitions:K=3,decay:J=.5,...H}=X,W=k==="horizontal"?"x":"y",Q=k==="horizontal"?R.position.x:R.position.y,q=cn($,J,K).map(ie=>Q+ie),j=g.animate(C,{[W]:q},H,N);if(j)return [j]}re.nodEffect=l;async function c(C,X={},N){let R=g.find(C);if(!R){B.error(`The element with the alias ${C} does not exist. So the sway effect can't be applied.`);return}let{axis:k="horizontal",distance:$=10,angle:K=5,repetitions:J=3,decay:H=0,ease:W="easeInOut",...Q}=X,q=k==="horizontal"?"x":"y",j=k==="horizontal"?R.position.x:R.position.y,ie=R.rotation,ce=K*Math.PI/180,se=cn($,H||1,J).map(Ze=>j+Ze),he=cn(ce,H||1,J).map(Ze=>ie+Ze),De=g.animate(C,{[q]:se,rotation:he},{ease:W,...Q},N);if(De)return [De]}re.swayEffect=c;async function y(C,X={},N){let R=g.find(C);if(!R){B.error(`The element with the alias ${C} does not exist. So the punch effect can't be applied.`);return}let{mode:k="scale",strength:$=.3,overshoot:K=.3,...J}=X,H;if(k==="scale"){let W=Q=>[Q,Q*(1+$),Q*(1-$*K),Q];H=g.animate(C,{scaleX:W(R.scale.x),scaleY:W(R.scale.y)},J,N);}else {let W=k==="rotation"?R.rotation:k==="x"?R.position.x:R.position.y,Q=k==="rotation"?$*Math.PI/180:$,q=[W,W+Q,W-Q*K,W];H=g.animate(C,{[k]:q},J,N);}if(H)return [H]}re.punchEffect=y;async function m(C,X={},N){let R=g.find(C);if(!R){B.error(`The element with the alias ${C} does not exist. So the glitch effect can't be applied.`);return}let{strength:k=40,bursts:$=3,slices:K=8,direction:J=0,rgbSplit:H=6,decay:W=.5,ease:Q="linear",...q}=X,j=new filters.filters.GlitchFilter({slices:K,direction:J,offset:0});j.refresh(),j.padding=Math.ceil(Math.abs(k));let ie=[],ce=le(C,R,j,{offset:Ut(k,W,$)},{ease:Q,...q},N);if(ce&&ie.push(ce),H!==0){let se=Ut(H,W,$),he=new filters.filters.RGBSplitFilter({red:{x:0,y:0},green:{x:0,y:0},blue:{x:0,y:0}});he.padding=Math.ceil(Math.abs(H));let De=le(C,R,he,{redX:se,blueX:se.map(Ze=>-Ze)},{ease:Q,...q},N);De&&ie.push(De);}if(ie.length>0)return ie}re.glitchEffect=m;async function f(C,X={},N){let R=g.find(C);if(!R){B.error(`The element with the alias ${C} does not exist. So the chromatic aberration effect can't be applied.`);return}let{strength:k=8,axis:$="horizontal",bursts:K=1,decay:J=.5,...H}=X,W=new filters.filters.RGBSplitFilter({red:{x:0,y:0},green:{x:0,y:0},blue:{x:0,y:0}});W.padding=Math.ceil(Math.abs(k));let Q=$==="horizontal"?"redX":"redY",q=$==="horizontal"?"blueX":"blueY",j={[Q]:Rt(0,k,J,K),[q]:Rt(0,-k,J,K)},ie=le(C,R,W,j,H,N);if(ie)return [ie]}re.chromaticAberrationEffect=f;async function x(C,X={},N){let R=g.find(C);if(!R){B.error(`The element with the alias ${C} does not exist. So the shockwave effect can't be applied.`);return}let{origin:k={x:.5,y:.5},amplitude:$=30,wavelength:K=160,brightness:J=1,radius:H=-1,speed:W=500,strength:Q,...q}=X,{width:j,height:ie}=R.getBounds(),ce=Q??ln({x:k.x*j,y:k.y*ie},{width:j,height:ie},K,H)/W,se=new filters.filters.ShockwaveFilter({center:{x:0,y:0},amplitude:$,wavelength:K,brightness:J,radius:H,speed:W,time:0});se.padding=Math.ceil(Math.abs($)*1.25);let he=le(C,R,se,{time:[0,ce]},q,N,()=>{let{x:De,y:Ze}=ot(R,k);se.center={x:De,y:Ze};});if(he)return [he]}re.shockwaveEffect=x;async function T(C,X={},N){let R=g.find(C);if(!R){B.error(`The element with the alias ${C} does not exist. So the radial blur effect can't be applied.`);return}let{strength:k=.5,bursts:$=1,origin:K={x:.5,y:.5},innerRadius:J=0,radius:H=-1,decay:W=.5,...Q}=X,q=new filters.filters.ZoomBlurFilter({center:{x:0,y:0},innerRadius:J,radius:H,strength:0}),{width:j,height:ie}=R.getBounds();q.padding=an({x:K.x*j,y:K.y*ie},k,j,ie);let ce=Rt(0,k,W,$),se=le(C,R,q,{strength:ce},Q,N,()=>{let{x:he,y:De}=ot(R,K);q.center={x:he,y:De};});if(se)return [se]}re.radialBlurEffect=T;async function A(C,X={},N){let R=g.find(C);if(!R){B.error(`The element with the alias ${C} does not exist. So the blur pulse effect can't be applied.`);return}let{strength:k=8,pulses:$=3,quality:K,decay:J=.5,...H}=X,W=new filters.filters.BlurFilter({strength:0,quality:K}),Q=Rt(0,k,J,$),q=le(C,R,W,{strength:Q},H,N);if(q)return [q]}re.blurPulseEffect=A;async function z(C,X={},N){let R=g.find(C);if(!R){B.error(`The element with the alias ${C} does not exist. So the vignette pulse effect can't be applied.`);return}let{strength:k=1,pulses:$=1,radius:K=.5,blur:J=.5,decay:H=.5,...W}=X,Q=new filters.filters.CRTFilter({curvature:0,lineWidth:0,lineContrast:0,noise:0,vignetting:K,vignettingBlur:J,vignettingAlpha:0}),q=Rt(0,k,H,$),j=le(C,R,Q,{vignettingAlpha:q},W,N);if(j)return [j]}re.vignettePulseEffect=z;async function Y(C,X={},N){let R=g.find(C);if(!R){B.error(`The element with the alias ${C} does not exist. So the desaturate effect can't be applied.`);return}let{amount:k=0,duration:$=1,holdDuration:K=0,...J}=X,H=$*2+K,W=[0,$/H,($+K)/H,1],Q=new filters.filters.AdjustmentFilter({saturation:1}),q=le(C,R,Q,{saturation:[1,k,k,1]},{...J,duration:H,times:W},N);if(q)return [q]}re.desaturateEffect=Y;async function G(C,X={},N){let R=g.find(C);if(!R){B.error(`The element with the alias ${C} does not exist. So the glow pulse effect can't be applied.`);return}let{strength:k=4,pulses:$=3,color:K=16777215,distance:J=10,innerStrength:H=0,decay:W=.5,...Q}=X,q=new filters.filters.GlowFilter({outerStrength:0,innerStrength:H,distance:J,color:K}),j=Rt(0,k,W,$),ie=le(C,R,q,{outerStrength:j},Q,N);if(ie)return [ie]}re.glowPulseEffect=G;})(exports.effects||={});function xt(t){let e=t.getLocalBounds();return {x:e.x,y:e.y,width:e.width,height:e.height}}function Dn(t,e){return e.graphics||(e.graphics=new ht.Graphics,e.graphics.label="",t.parent?.addChild(e.graphics),t.mask=e.graphics),pr(t,e.graphics),e.graphics}function pr(t,e){e.position.copyFrom(t.position),e.scale.copyFrom(t.scale),e.pivot.copyFrom(t.pivot),e.skew.copyFrom(t.skew),e.rotation=t.rotation;}function gr(t,e){e.graphics&&(t.mask===e.graphics&&(t.mask=null),e.graphics.parent?.removeChild(e.graphics),e.graphics.destroy({children:true}),e.graphics=void 0);}function mr(t,e,n,i){let s=e.invert?1-n:n,{bounds:l}=e,c=Dn(t,i),y=l.x+l.width/2,m=l.y+l.height/2,f=Math.sqrt(l.width**2+l.height**2)||1,x=Math.max(s,0)*f*2,T=e.angle*Math.PI/180;if(c.clear(),x>0){let A=Math.cos(-T),z=Math.sin(-T),Y=[[-f,-f],[-f+x,-f],[-f+x,f],[-f,f]].flatMap(([G,re])=>[y+G*A-re*z,m+G*z+re*A]);c.poly(Y).fill(16777215);}}function yr(t,e,n,i){let s=e.invert?1-n:n,{bounds:l}=e,c=Dn(t,i),y=l.x+l.width*e.originX,m=l.y+l.height*e.originY,f=Math.max(y-l.x,l.x+l.width-y),x=Math.max(m-l.y,l.y+l.height-m),T=Math.sqrt(f**2+x**2)||1,A=Math.max(s,0)*T,z=e.aspect>0?e.aspect:1;if(c.clear(),e.outside){let Y=T*Math.max(z,1)*2;c.rect(l.x-Y,l.y-Y,l.width+Y*2,l.height+Y*2).fill(16777215),A>0&&c.ellipse(y,m,A*z,A).cut();}else A>0&&c.ellipse(y,m,A*z,A).fill(16777215);}function xr(t,e,n,i){let s=e.invert?1-n:n,l=1-s,{bounds:c}=e,y=Dn(t,i);if(y.clear(),e.direction==="outward"){if(s>0)if(e.orientation==="horizontal"){let m=c.x+c.width*e.origin;y.rect(m-(m-c.x)*s,c.y,c.width*s,c.height).fill(16777215);}else {let m=c.y+c.height*e.origin;y.rect(c.x,m-(m-c.y)*s,c.width,c.height*s).fill(16777215);}return}if(e.orientation==="horizontal"){let m=c.x+c.width*e.origin,f=m-c.x,x=c.x+c.width-m,T=c.x-l*f,A=m+l*x;f>0&&y.rect(T,c.y,f,c.height).fill(16777215),x>0&&y.rect(A,c.y,x,c.height).fill(16777215);}else {let m=c.y+c.height*e.origin,f=m-c.y,x=c.y+c.height-m,T=c.y-l*f,A=m+l*x;f>0&&y.rect(c.x,T,c.width,f).fill(16777215),x>0&&y.rect(c.x,A,c.width,x).fill(16777215);}}function Pr(t,e,n){switch(e.kind){case "wipe":case "iris":case "split":gr(t,n);break}}function vr(t,e,n,i){switch(e.kind){case "wipe":return mr(t,e,n,i);case "iris":return yr(t,e,n,i);case "split":return xr(t,e,n,i)}}function kn(t,e){let n={};return {apply(i){let s=g.find(t);s&&(n.component=s,vr(s,e,i,n));},cleanup(){let i=n.component??g.find(t);i&&Pr(i,e,n);}}}function dn(t,e,n){let i={...g.find(t)?.memory,...n},s=new ae(n,e);return i&&g.copyCanvasElementProperty(i,s),g.add(t,s,{ignoreOldStyle:true,zIndex:n?.zIndex}),s}async function Tr(t,e,n){let i={...g.find(t)?.memory,...n},s=new ae(n,e);return s.label=t,await s.load(),i&&g.copyCanvasElementProperty(i,s),g.add(t,s,{ignoreOldStyle:true,zIndex:n?.zIndex}),s}function un(t,e,n){if(!e)if(ht__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:vt,...n,label:t});let i={...g.find(t)?.memory,...n},s=new oe(n,e);return i&&g.copyCanvasElementProperty(i,s),g.add(t,s,{ignoreOldStyle:true,zIndex:n?.zIndex}),s}async function Ir(t,e,n){if(!e)if(ht__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:vt,...n,label:t});let i={...g.find(t)?.memory,...n},s=new oe(n,e);return s.label=t,await s.load(),i&&g.copyCanvasElementProperty(i,s),g.add(t,s,{ignoreOldStyle:true,zIndex:n?.zIndex}),s}function fn(t,e,n){if(!e)if(ht__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:Ct,...n,label:t});let i={...g.find(t)?.memory,...n},s=new qe(n,e);return i&&g.copyCanvasElementProperty(i,s),g.add(t,s,{ignoreOldStyle:true,zIndex:n?.zIndex}),s}async function Cr(t,e,n){if(!e)if(ht__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:Ct,...n,label:t});let i={...g.find(t)?.memory,...n},s=new qe(n,e);return s.label=t,await s.load(),i&&g.copyCanvasElementProperty(i,s),g.add(t,s,{ignoreOldStyle:true,zIndex:n?.zIndex}),s}async function br(t,e,n={},i){return exports.transitions.showWithDissolve(t,e,n,i)}function wr(t,e={},n){return exports.transitions.removeWithDissolve(t,e,n)}async function Sr(t,e,n={},i){return exports.transitions.showWithFade(t,e,n,i)}function Ar(t,e={},n){return exports.transitions.removeWithFade(t,e,n)}async function Or(t,e,n={},i){return exports.transitions.moveIn(t,e,n,i)}function Er(t,e={},n){return exports.transitions.moveOut(t,e,n)}async function _r(t,e,n={},i){return exports.transitions.zoomIn(t,e,n,i)}function Mr(t,e={},n){return exports.transitions.zoomOut(t,e,n)}async function Rr(t,e,n={},i){return exports.transitions.pushIn(t,e,n,i)}function Dr(t,e={direction:"right"},n){return exports.transitions.pushOut(t,e,n)}exports.transitions=void 0;(jr=>{function t(a){switch(a.type){case "align":return {xAlign:a.x,yAlign:a.y};case "percentage":return {percentageX:a.x,percentageY:a.y};default:return {x:a.x,y:a.y}}}function e(a,r,d){if(typeof r=="string")return Yt(r)?fn(a,r,{...d.properties,zIndex:d.zIndex}):un(a,r,{...d.properties,zIndex:d.zIndex});if(Array.isArray(r))return dn(a,r,{...d.properties,zIndex:d.zIndex});if(typeof r=="object"&&"value"in r&&"options"in r){if(typeof r.value=="string")return Yt(r.value)?fn(a,r.value,{...r.options,...d.properties,zIndex:d.zIndex}):un(a,r.value,{...r.options,...d.properties,zIndex:d.zIndex});if(Array.isArray(r.value))return dn(a,r.value,{...r.options,...d.properties,zIndex:d.zIndex})}return g.add(a,r,d),r}function n(a){let r=a;return {x:r.x,y:r.y,anchor:r.anchor,scale:r.scale,pivot:r.pivot,skew:r.skew,rotation:r.rotation,angle:r.angle}}function i(a,r,d){let u,h=g.find(a);h&&(u=`${a}_temp_${d}`,g.editAlias(a,u));let p=e(a,r,{zIndex:h?h.parent?.getChildIndex(h):void 0,properties:h?n(h):void 0});return h?.parent?.setChildIndex(h,h.parent.getChildIndex(h)-.1),u&&g.copyCanvasElementProperty(u,a),u&&tickers.tickers.transfer(u,a,"duplicate"),{component:p,oldComponentAlias:u}}function s(a,r,d,u){return a?r?u(a)??[]:(d.push(a),[]):[]}function l(a){let{aliasToRemoveAfter:r,animateOldComponentOut:d,...u}=a;return u}function c(a,r){let d=a?[a,...r]:r;return d.length>0?d:void 0}function y(a){switch(a){case "up":return 90;case "down":return 270;case "left":return 180;default:return 0}}function m(a,r,d){let{apply:u,cleanup:h}=kn(a,r.config),p=filters.filters.animate(a,void 0,{value:[r.from,r.to]},{duration:r.duration??1,delay:r.delay,ease:r.ease,aliasToRemoveAfter:r.aliasToRemoveAfter,tickerIdToResume:r.tickerIdToResume},d,u,h,{alias:a,config:r.config});return p&&u(r.from),p&&(r.completeOnContinue??true)&&tickers.tickers.completeOnStepEnd({id:p}),p}function f(a,r,d,u,h,p){let I=Math.max(u,0)/4;d==="in"?(r&&(r.alpha=0),g.animate(a,{alpha:[0,1]},{duration:I,delay:p,completeOnContinue:false},h)):g.animate(a,{alpha:[1,0]},{duration:I,delay:typeof p=="function"?(E,P)=>p(E,P)+Math.max(u-I,0):(p??0)+Math.max(u-I,0),completeOnContinue:false},h);}function x(a,r,d,u,h=false){let p=Math.max(u,1),I=r*2+d,E=h?r+d:I,P=Math.max(I*(p-1)+E,.001),O=[0],w=[0],S=0;for(let b=0;b<p;b++){let v=b===p-1;S+=r,O.push(a),w.push(S/P),S+=d,O.push(a),w.push(S/P),(!v||!h)&&(S+=r,O.push(0),w.push(Math.min(S/P,1)));}return {values:O,times:w,total:P}}async function T(a,r,d={},u){let{completeOnContinue:h=true,tickerIdToResume:p=[],...I}=d,E=[];r||(r=a),typeof p=="string"&&(p=[p]);let P,O=g.find(a);if(O&&(P=`${a}_temp_disolve`,g.editAlias(a,P)),r=e(a,r,{zIndex:O?O.parent?.getChildIndex(O):void 0,properties:O?n(O):void 0}),O?.parent?.setChildIndex(O,O.parent.getChildIndex(O)-.1),P&&g.copyCanvasElementProperty(P,a),P&&tickers.tickers.transfer(P,a,"duplicate"),r.alpha=0,P){let S=A(P,{...d,autoplay:false,completeOnContinue:h},u);S&&(E.push(...S),p.push(...S));}let w=g.animate(a,{alpha:1},{...I,tickerIdToResume:p,completeOnContinue:h},u);if(w&&E.push(w),E.length>0)return E}jr.showWithDissolve=T;function A(a,r={},d){let{completeOnContinue:u=true,aliasToRemoveAfter:h=[],...p}=r;typeof h=="string"&&(h=[h]),h.push(a);let I=g.animate(a,{alpha:0},{...p,aliasToRemoveAfter:h,completeOnContinue:u},d);if(I)return [I]}jr.removeWithDissolve=A;async function z(a,r,d={},u){let{completeOnContinue:h=true,aliasToRemoveAfter:p=[],...I}=d,E=[];r||(r=a),typeof p=="string"&&(p=[p]);let P=g.find(a);if(!P)return T(a,r,d,u);let O=`${a}_temp_fade`;g.editAlias(a,O),p.push(O),r=e(a,r,{zIndex:P?P.parent?.getChildIndex(P):void 0,properties:n(P)}),P?.parent?.setChildIndex(P,P.parent.getChildIndex(P)-.1),O&&g.copyCanvasElementProperty(O,a),O&&tickers.tickers.transfer(O,a,"duplicate"),r.alpha=0;let w=g.animate(a,{alpha:1},{...I,aliasToRemoveAfter:p,completeOnContinue:h},u);if(w){let S=A(O,{...d,tickerIdToResume:w,completeOnContinue:h},u);S&&E.push(...S),E.push(w),tickers.tickers.pause({id:w});}if((r instanceof oe||r instanceof ae)&&r.haveEmptyTexture&&await r.load(),E.length>0)return E}jr.showWithFade=z;function Y(a,r={},d){return A(a,r,d)}jr.removeWithFade=Y;async function G(a,r,d={},u){let{direction:h="right",completeOnContinue:p=true,tickerIdToResume:I=[],aliasToRemoveAfter:E=[],removeOldComponentWithMoveOut:P,animateOldComponentOut:O=P??false,motionBlur:w,...S}=d,b=[],v;r||(r=a),typeof I=="string"&&(I=[I]),typeof E=="string"&&(E=[E]);let _,L=g.find(a);if(L&&(_=`${a}_temp_movein`,g.editAlias(a,_),L instanceof oe||L instanceof ae?v=L.positionInfo:v={x:L.x,y:L.y,type:"pixel"}),r=e(a,r,{zIndex:L?L.parent?.getChildIndex(L):void 0}),L?.parent?.setChildIndex(L,L.parent.getChildIndex(L)-.1),_&&g.copyCanvasElementProperty(_,a),_&&tickers.tickers.transfer(_,a,"move"),(r instanceof oe||r instanceof ae)&&r.haveEmptyTexture&&await r.load(),v||(r instanceof oe||r instanceof ae?v=r.positionInfo:v={x:r.x,y:r.y,type:"pixel"}),_)if(O){let ge=re(_,{...S,direction:h,motionBlur:w,autoplay:false,completeOnContinue:p},u);ge&&(b.push(...ge),I.push(...ge));}else E.push(_);switch(h){case "up":r.y=g.height+r.height;break;case "down":r.y=-r.height;break;case "left":r.x=g.width+r.width;break;case "right":r.x=-r.width;break}let V=tickers.tickers.pause({canvasAlias:a});I.push(...V);let ee=g.animate(a,t(v),{...S,tickerIdToResume:I,aliasToRemoveAfter:E,completeOnContinue:p},u);ee&&b.push(ee);let te=hn(a,r,h,w,{...S,completeOnContinue:p},u);if(te&&b.push(te),b.length>0)return b}jr.moveIn=G;function re(a,r={},d){let{direction:u="right",completeOnContinue:h=true,aliasToRemoveAfter:p=[],motionBlur:I,...E}=r;typeof p=="string"&&(p=[p]),p.push(a);let P=g.find(a);if(!P){B.warn(`The canvas component "${a}" is not found.`);return}let O={x:P.x,y:P.y};switch(u){case "up":O.y=-P.height;break;case "down":O.y=g.height+P.height;break;case "left":O.x=-P.width;break;case "right":O.x=g.width+P.width;break}tickers.tickers.pause({canvasAlias:a});let w=g.animate(a,O,{...E,aliasToRemoveAfter:p,completeOnContinue:h},d),S=hn(a,P,u,I,{...E,completeOnContinue:h},d);return Ht([w,S])}jr.moveOut=re;async function C(a,r,d={},u){let{direction:h="right",completeOnContinue:p=true,tickerIdToResume:I=[],aliasToRemoveAfter:E=[],removeOldComponentWithZoomOut:P,animateOldComponentOut:O=P??false,...w}=d,S=[],b;r||(r=a),typeof I=="string"&&(I=[I]),typeof E=="string"&&(E=[E]);let v,_=g.find(a);_&&(v=`${a}_temp_zoom`,g.editAlias(a,v),_ instanceof oe||_ instanceof ae?b=_.positionInfo:b={x:_.x,y:_.y,type:"pixel"}),r=e(a,r,{zIndex:_?_.parent?.getChildIndex(_):void 0}),_?.parent?.setChildIndex(_,_.parent.getChildIndex(_)-.1),v&&g.copyCanvasElementProperty(v,a),v&&tickers.tickers.transfer(v,a,"move"),(r instanceof oe||r instanceof ae)&&r.haveEmptyTexture&&await r.load(),b||(r instanceof oe||r instanceof ae?b=r.positionInfo:b={x:r.x,y:r.y,type:"pixel"});let L={x:r.pivot.x,y:r.pivot.y},V={x:r.scale.x,y:r.scale.y};if(v)if(O){let ge=X(v,{...w,direction:h,autoplay:false,completeOnContinue:p},u);ge&&(S.push(...ge),I.push(...ge));}else E.push(v);(r instanceof oe||r instanceof ae)&&r.haveEmptyTexture&&await r.load(),h==="up"?(r.pivot.y=g.height-r.y,r.pivot.x=g.width/2-r.x,r.y=g.height,r.x=g.width/2):h==="down"?(r.pivot.y=0-r.y,r.pivot.x=g.width/2-r.x,r.y=0,r.x=g.width/2):h==="left"?(r.pivot.x=g.width-r.x,r.pivot.y=g.height/2-r.y,r.x=g.width,r.y=g.height/2):h==="right"&&(r.pivot.x=0-r.x,r.pivot.y=g.height/2-r.y,r.x=0,r.y=g.height/2),r.pivot=exports.CanvasPropertyUtility.getPointBySuperPoint(r.pivot,r.angle),r.scale.set(0);let ee=tickers.tickers.pause({canvasAlias:a});I.push(...ee);let te=g.animate(a,{pivotX:L.x,pivotY:L.y,scaleX:V.x,scaleY:V.y,...t(b)},{...w,tickerIdToResume:I,aliasToRemoveAfter:E,completeOnContinue:p},u);if(te&&S.push(te),S.length>0)return S}jr.zoomIn=C;function X(a,r={},d){let{direction:u="right",completeOnContinue:h=true,aliasToRemoveAfter:p=[],...I}=r;typeof p=="string"&&(p=[p]),p.push(a);let E=g.find(a);if(!E){B.warn(`The canvas component "${a}" is not found.`);return}let P={x:E.x,y:E.y},O={x:E.pivot.x,y:E.pivot.y};u==="down"?(P.y=g.height,P.x=g.width/2,O.y=g.height-P.y,O.x=g.width/2-P.x):u==="up"?(P.y=0,P.x=g.width/2,O.y=0-P.y,O.x=g.width/2-P.x):u==="right"?(P.x=g.width,P.y=g.height/2,O.x=g.width-P.x,O.y=g.height/2-P.y):u==="left"&&(P.x=0,P.y=g.height/2,O.x=0-P.x,O.y=g.height/2-P.y),O=exports.CanvasPropertyUtility.getPointBySuperPoint(O,E.angle),tickers.tickers.pause({canvasAlias:a});let w=g.animate(a,{...P,pivotX:O.x,pivotY:O.y,scaleX:0,scaleY:0},{...I,aliasToRemoveAfter:p,completeOnContinue:h},d);if(w)return [w]}jr.zoomOut=X;async function N(a,r,d={},u){let{direction:h="right",completeOnContinue:p=true,tickerIdToResume:I=[],aliasToRemoveAfter:E=[],animateOldComponentOut:P=true,motionBlur:O,...w}=d,S=[],b;r||(r=a),typeof I=="string"&&(I=[I]),typeof E=="string"&&(E=[E]);let v,_=g.find(a);switch(_&&(v=`${a}_temp_push`,g.editAlias(a,v),_ instanceof oe||_ instanceof ae?b=_.positionInfo:b={x:_.x,y:_.y,type:"pixel"}),r=e(a,r,{zIndex:_?_.parent?.getChildIndex(_):void 0}),_?.parent?.setChildIndex(_,_.parent.getChildIndex(_)-.1),v&&g.copyCanvasElementProperty(v,a),v&&tickers.tickers.transfer(v,a,"move"),b||((r instanceof oe||r instanceof ae)&&r.haveEmptyTexture?b=r.positionInfo:b={x:r.x,y:r.y,type:"pixel"}),(r instanceof oe||r instanceof ae)&&r.haveEmptyTexture&&await r.load(),h){case "up":r.y=g.height+r.height;break;case "down":r.y=-r.height;break;case "left":r.x=g.width+r.width;break;case "right":r.x=-r.width;break}let L=tickers.tickers.pause({canvasAlias:a});if(I.push(...L),v)if(P){let te=R(v,{...w,direction:h,motionBlur:O,completeOnContinue:p});te&&S.push(...te);}else E.push(v);let V=g.animate(a,t(b),{...w,tickerIdToResume:I,aliasToRemoveAfter:E,completeOnContinue:p},u);V&&S.push(V);let ee=hn(a,r,h,O,{...w,completeOnContinue:p},u);if(ee&&S.push(ee),S.length>0)return S}jr.pushIn=N;function R(a,r={direction:"right"},d){return re(a,r,d)}jr.pushOut=R;async function k(a,r,d={},u){let{angle:h,direction:p="right",invert:I=false,duration:E,delay:P,ease:O,completeOnContinue:w=true,animateOldComponentOut:S=true}=d,{aliasToRemoveAfter:b=[]}=d;r||(r=a),typeof b=="string"&&(b=[b]);let{component:v,oldComponentAlias:_}=i(a,r,"wipe"),L=s(_,S,b,te=>$(te,{...l(d),angle:(h??y(p))+180},u));(v instanceof oe||v instanceof ae)&&v.haveEmptyTexture&&await v.load();let V={kind:"wipe",angle:h??y(p),invert:I,bounds:xt(v)},ee=m(a,{config:V,from:0,to:1,duration:E,delay:P,ease:O,completeOnContinue:w,aliasToRemoveAfter:b},u);return c(ee,L)}jr.wipeIn=k;function $(a,r={},d){let{angle:u,direction:h="right",invert:p=false,duration:I,delay:E,ease:P,completeOnContinue:O=true}=r,{aliasToRemoveAfter:w=[]}=r;typeof w=="string"&&(w=[w]),w.push(a);let S=g.find(a);if(!S){B.warn(`The canvas component "${a}" is not found.`);return}let b={kind:"wipe",angle:u??y(h),invert:p,bounds:xt(S)},v=m(a,{config:b,from:1,to:0,duration:I,delay:E,ease:P,completeOnContinue:O,aliasToRemoveAfter:w},d);if(v)return [v]}jr.wipeOut=$;async function K(a,r,d={},u){let{origin:h={},aspect:p=1,invert:I=false,duration:E,delay:P,ease:O,completeOnContinue:w=true,animateOldComponentOut:S=true,direction:b="expand"}=d,{aliasToRemoveAfter:v=[]}=d;r||(r=a),typeof v=="string"&&(v=[v]);let{component:_,oldComponentAlias:L}=i(a,r,"iris"),V=s(L,S,v,ge=>J(ge,{...l(d),direction:b==="contract"?"expand":"contract"},u));(_ instanceof oe||_ instanceof ae)&&_.haveEmptyTexture&&await _.load();let ee={kind:"iris",outside:b==="contract",originX:h.x??.5,originY:h.y??.5,aspect:p,invert:I,bounds:xt(_)},te=m(a,{config:ee,from:b==="contract"?1:0,to:b==="contract"?0:1,duration:E,delay:P,ease:O,completeOnContinue:w,aliasToRemoveAfter:v},u);return c(te,V)}jr.irisIn=K;function J(a,r={},d){let{origin:u={},aspect:h=1,invert:p=false,duration:I,delay:E,ease:P,completeOnContinue:O=true,direction:w="expand"}=r,{aliasToRemoveAfter:S=[]}=r;typeof S=="string"&&(S=[S]),S.push(a);let b=g.find(a);if(!b){B.warn(`The canvas component "${a}" is not found.`);return}let v={kind:"iris",outside:w==="contract",originX:u.x??.5,originY:u.y??.5,aspect:h,invert:p,bounds:xt(b)},_=m(a,{config:v,from:w==="contract"?0:1,to:w==="contract"?1:0,duration:I,delay:E,ease:P,completeOnContinue:O,aliasToRemoveAfter:S},d);if(_)return [_]}jr.irisOut=J;async function H(a,r,d={},u){let{orientation:h="vertical",direction:p="inward",origin:I=.5,invert:E=false,duration:P,delay:O,ease:w,completeOnContinue:S=true,animateOldComponentOut:b=true}=d,{aliasToRemoveAfter:v=[]}=d;r||(r=a),typeof v=="string"&&(v=[v]);let{component:_,oldComponentAlias:L}=i(a,r,"split"),V=s(L,b,v,ge=>W(ge,{...l(d),direction:p==="inward"?"outward":"inward"},u));(_ instanceof oe||_ instanceof ae)&&_.haveEmptyTexture&&await _.load();let ee={kind:"split",orientation:h,direction:p,origin:I,invert:E,bounds:xt(_)},te=m(a,{config:ee,from:0,to:1,duration:P,delay:O,ease:w,completeOnContinue:S,aliasToRemoveAfter:v},u);return c(te,V)}jr.splitIn=H;function W(a,r={},d){let{orientation:u="vertical",direction:h="inward",origin:p=.5,invert:I=false,duration:E,delay:P,ease:O,completeOnContinue:w=true}=r,{aliasToRemoveAfter:S=[]}=r;typeof S=="string"&&(S=[S]),S.push(a);let b=g.find(a);if(!b){B.warn(`The canvas component "${a}" is not found.`);return}let v={kind:"split",orientation:u,direction:h,origin:p,invert:I,bounds:xt(b)},_=m(a,{config:v,from:1,to:0,duration:E,delay:P,ease:O,completeOnContinue:w,aliasToRemoveAfter:S},d);if(_)return [_]}jr.splitOut=W;async function Q(a,r,d={},u){let{strength:h=32,quality:p=4,duration:I,delay:E,ease:P,completeOnContinue:O=true,fadeComponent:w=true,animateOldComponentOut:S=true}=d,{aliasToRemoveAfter:b=[]}=d;r||(r=a),typeof b=="string"&&(b=[b]);let{component:v,oldComponentAlias:_}=i(a,r,"blur"),L=s(_,S,b,ge=>q(ge,l(d),u));(v instanceof oe||v instanceof ae)&&v.haveEmptyTexture&&await v.load();let V=I??1;w&&f(a,v,"in",V,u);let ee=new filters.filters.BlurFilter({strength:h,quality:p}),te=le(a,v,ee,{strength:[h,0]},{duration:V,delay:E,ease:P,completeOnContinue:O,aliasToRemoveAfter:b},u);return c(te,L)}jr.blurIn=Q;function q(a,r={},d){let{strength:u=32,quality:h=4,duration:p,delay:I,ease:E,completeOnContinue:P=true,fadeComponent:O=true}=r,{aliasToRemoveAfter:w=[]}=r;typeof w=="string"&&(w=[w]),w.push(a);let S=g.find(a);if(!S){B.warn(`The canvas component "${a}" is not found.`);return}let b=p??1;O&&f(a,S,"out",b,d);let v=new filters.filters.BlurFilter({strength:0,quality:h}),_=le(a,S,v,{strength:[0,u]},{duration:b,delay:I,ease:E,completeOnContinue:P,aliasToRemoveAfter:w},d);if(_)return [_]}jr.blurOut=q;async function j(a,r,d={},u){let{pixelSize:h=32,direction:p="up-left",duration:I,delay:E,ease:P,completeOnContinue:O=true,fadeComponent:w=false,animateOldComponentOut:S=true}=d,{aliasToRemoveAfter:b=[]}=d;r||(r=a),typeof b=="string"&&(b=[b]);let{component:v,oldComponentAlias:_}=i(a,r,"pixelate"),L=s(_,S,b,Nt=>ie(Nt,l(d),u));(v instanceof oe||v instanceof ae)&&v.haveEmptyTexture&&await v.load();let V=I??1;w&&f(a,v,"in",V,u);let ee=ce(h,p,"in"),te=new filters.filters.PixelateFilter([ee.sizeX[0],ee.sizeY[0]]),ge=le(a,v,te,ee,{duration:V,delay:E,ease:P,completeOnContinue:O,aliasToRemoveAfter:b},u);return c(ge,L)}jr.pixelateIn=j;function ie(a,r={},d){let{pixelSize:u=32,direction:h="up-left",duration:p,delay:I,ease:E,completeOnContinue:P=true,fadeComponent:O=false}=r,{aliasToRemoveAfter:w=[]}=r;typeof w=="string"&&(w=[w]),w.push(a);let S=g.find(a);if(!S){B.warn(`The canvas component "${a}" is not found.`);return}let b=p??1;O&&f(a,S,"out",b,d);let v=ce(u,h,"out"),_=new filters.filters.PixelateFilter([v.sizeX[0],v.sizeY[0]]),L=le(a,S,_,v,{duration:b,delay:I,ease:E,completeOnContinue:P,aliasToRemoveAfter:w},d);if(L)return [L]}jr.pixelateOut=ie;function ce(a,r,d){let u=d==="in"?1:-1,h=(r.endsWith("left")?1:-1)*u,p=(r.startsWith("up")?1:-1)*u,I=Math.max(1,Math.abs(a)),E=d==="in"?[I,1]:[1,I];return {sizeX:E.map(P=>P*h),sizeY:E.map(P=>P*p)}}async function se(a,r,d={},u){let{color:h=16777215,maxAlpha:p=1,duration:I=.3,holdDuration:E=0,pulses:P=1,completeOnContinue:O=true,fadeComponent:w=true,...S}=d;r||(r=a);let b=g.find(a);if(b)return Ze(a,b,r,{color:h,maxAlpha:p,fadeDuration:I,holdDuration:E,pulses:P,completeOnContinue:O,rest:S,priority:u});let{component:v}=i(a,r,"flash");(v instanceof oe||v instanceof ae)&&v.haveEmptyTexture&&await v.load(),w&&f(a,v,"in",I,u);let _=[],L=De(v,{color:h,maxAlpha:p,fadeDuration:I,holdDuration:E,pulses:P,completeOnContinue:O,aliasToRemoveAfter:[],rest:S,priority:u});if(L&&_.push(L),_.length>0)return _}jr.flashIn=se;function he(a,r={},d){let{color:u=16777215,maxAlpha:h=1,duration:p=.3,holdDuration:I=0,pulses:E=1,completeOnContinue:P=true,fadeComponent:O=true,...w}=r,S=g.find(a);if(!S){B.warn(`The canvas component "${a}" is not found.`);return}if(O){let{total:v}=x(h,p,I,E);f(a,S,"out",v,d);}let b=De(S,{color:u,maxAlpha:h,fadeDuration:p,holdDuration:I,pulses:E,completeOnContinue:P,aliasToRemoveAfter:[a],rest:w,priority:d});if(b)return [b]}jr.flashOut=he;function De(a,r){let{values:d,times:u,total:h}=x(r.maxAlpha,r.fadeDuration,r.holdDuration,r.pulses,r.endAtPeak??false),p=new filters.filters.ColorOverlayFilter({color:r.color,alpha:0});return le(a.label,a,p,{alpha:d},{duration:h,times:u,delay:r.rest.delay,ease:r.rest.ease,aliasToRemoveAfter:r.aliasToRemoveAfter,completeOnContinue:r.completeOnContinue},r.priority)}async function Ze(a,r,d,u){let{component:h,oldComponentAlias:p}=i(a,d,"flash");if(!p)return;let I=h.alpha,E=r.alpha;h.alpha=0,(h instanceof oe||h instanceof ae)&&h.haveEmptyTexture&&await h.load();let{values:P,times:O,total:w}=x(u.maxAlpha,u.fadeDuration,u.holdDuration,u.pulses,true),S=w+u.fadeDuration,b=w/S,v={duration:S,delay:u.rest.delay,ease:u.rest.ease,completeOnContinue:u.completeOnContinue},_=le(p,r,new filters.filters.ColorOverlayFilter({color:u.color,alpha:0}),{alpha:[...P,u.maxAlpha]},{...v,times:[...O.map(ge=>ge*b),1],aliasToRemoveAfter:[p]},u.priority),L=le(a,h,new filters.filters.ColorOverlayFilter({color:u.color,alpha:u.maxAlpha}),{alpha:[u.maxAlpha,u.maxAlpha,0]},{...v,times:[0,b,1],aliasToRemoveAfter:u.rest.aliasToRemoveAfter},u.priority),V={duration:S,delay:u.rest.delay,times:[0,b,b,1],ease:"linear"},ee=g.animate(p,{alpha:[E,E,0,0]},V,u.priority),te=g.animate(a,{alpha:[0,0,I,I]},V,u.priority);return u.completeOnContinue&&(ee&&tickers.tickers.completeOnStepEnd({id:ee}),te&&tickers.tickers.completeOnStepEnd({id:te})),Ht([_,L,ee,te])}function hn(a,r,d,u,h,p){if(!u)return;let I=u===true?40:u,E=d==="up"||d==="down"?"velocityY":"velocityX",P=d==="up"||d==="left"?-1:1,O=new filters.filters.MotionBlurFilter({velocity:{x:0,y:0},kernelSize:15});return le(a,r,O,{[E]:[0,P*I,0]},{duration:h.duration??.3,delay:h.delay,ease:h.ease,completeOnContinue:h.completeOnContinue,autoplay:h.autoplay},p)}function Ht(a){let r=a.filter(d=>!!d);return r.length>0?r:void 0}async function at(a,r,d,u,h,p,I,E,P=false){let{duration:O,delay:w,ease:S,completeOnContinue:b=true,fadeComponent:v=h,animateOldComponentOut:_=true}=u,{aliasToRemoveAfter:L=[]}=u;typeof L=="string"&&(L=[L]);let{component:V,oldComponentAlias:ee}=i(a,r??a,d),te=P&&!!ee&&_,ge=V.alpha;te&&(V.alpha=0);let Nt=()=>s(ee,_,L,E),pn=te?[]:Nt();(V instanceof oe||V instanceof ae)&&V.haveEmptyTexture&&await V.load(),te&&pn.push(...Nt());let Dt=O??1,Gn=P&&pn.length>0?typeof w=="function"?(Ci,bi)=>w(Ci,bi)+Dt:(w??0)+Dt:w,Vt;return te?(Vt=g.animate(a,{alpha:[0,ge]},{duration:v?Dt/4:0,delay:Gn},p),Vt&&b&&tickers.tickers.completeOnStepEnd({id:Vt})):v&&f(a,V,"in",Dt,p),Ht([...I(V,{duration:Dt,delay:Gn,ease:S,completeOnContinue:b},L),...pn,Vt])}function lt(a,r,d,u,h){let{duration:p,delay:I,ease:E,completeOnContinue:P=true,fadeComponent:O=d}=r,{aliasToRemoveAfter:w=[]}=r;typeof w=="string"&&(w=[w]),w.push(a);let S=g.find(a);if(!S){B.warn(`The canvas component "${a}" is not found.`);return}let b=p??1;return O&&f(a,S,"out",b,u,I),Ht(h(S,{duration:b,delay:I,ease:E,completeOnContinue:P},w))}function Bn(a){let{width:r,height:d}=a.getBounds();return Math.hypot(r,d)/2}function Gt(a){return {x:a?.x??.5,y:a?.y??.5}}function Fn(a,r,d,u,h,p,I){let{strength:E=40,bursts:P=3,slices:O=8,rgbSplit:w=6}=u,S=L=>{let V=Ut(L,.5,P);return d==="in"?V:V.reverse()},b={...h,ease:h.ease??"linear"},v=new filters.filters.GlitchFilter({slices:O,offset:0});v.refresh(),v.padding=Math.ceil(Math.abs(E));let _=[le(a,r,v,{offset:S(E)},{...b,aliasToRemoveAfter:p},I)];if(w!==0){let L=S(w),V=new filters.filters.RGBSplitFilter({red:{x:0,y:0},green:{x:0,y:0},blue:{x:0,y:0}});V.padding=Math.ceil(Math.abs(w)),_.push(le(a,r,V,{redX:L,blueX:L.map(ee=>-ee)},b,I));}return _}async function Yr(a,r,d={},u){return at(a,r,"glitch",d,true,u,(h,p,I)=>Fn(a,h,"in",d,p,I,u),h=>xi(h,l(d),u),true)}jr.glitchIn=Yr;function xi(a,r={},d){return lt(a,r,true,d,(u,h,p)=>Fn(a,u,"out",r,h,p,d))}jr.glitchOut=xi;function Ln(a,r,d,u,h,p,I){let{angle:E=540,radius:P=Bn(r),origin:O}=u,w=Gt(O),S=E*Math.PI/180,b=d==="in"?[S,0]:[0,S],v=new filters.filters.TwistFilter({radius:P,angle:b[0],offset:{x:0,y:0}}),{width:_,height:L}=r.getBounds();return v.padding=Math.max(v.padding,_n({x:w.x*_,y:w.y*L},P,_,L)),[le(a,r,v,{angle:b},{...h,aliasToRemoveAfter:p},I,()=>{let{x:ee,y:te}=ot(r,w);v.offsetX=ee,v.offsetY=te;})]}async function Ur(a,r,d={},u){return at(a,r,"twist",d,true,u,(h,p,I)=>Ln(a,h,"in",d,p,I,u),h=>Pi(h,{...l(d),angle:-(d.angle??540)},u))}jr.twistIn=Ur;function Pi(a,r={},d){return lt(a,r,true,d,(u,h,p)=>Ln(a,u,"out",r,h,p,d))}jr.twistOut=Pi;function zn(a,r,d,u,h,p,I){let{strength:E=.6,origin:P}=u,O=Gt(P),w=d==="in"?[E,0]:[0,E],S=new filters.filters.ZoomBlurFilter({center:{x:0,y:0},strength:w[0]}),{width:b,height:v}=r.getBounds();return S.padding=an({x:O.x*b,y:O.y*v},E,b,v),[le(a,r,S,{strength:w},{...h,aliasToRemoveAfter:p},I,()=>{let{x:L,y:V}=ot(r,O);S.center={x:L,y:V};})]}async function Wr(a,r,d={},u){return at(a,r,"warp",d,true,u,(h,p,I)=>zn(a,h,"in",d,p,I,u),h=>vi(h,l(d),u),true)}jr.warpIn=Wr;function vi(a,r={},d){return lt(a,r,true,d,(u,h,p)=>zn(a,u,"out",r,h,p,d))}jr.warpOut=vi;function Yn(a,r,d,u,h,p){let{origin:I,amplitude:E=30,wavelength:P=160,speed:O=500}=d,w=Gt(I),{width:S,height:b}=r.getBounds(),v=new filters.filters.ShockwaveFilter({center:{x:0,y:0},amplitude:E,wavelength:P,speed:O,time:0});v.padding=Math.ceil(Math.abs(E)*1.25);let _=ln({x:w.x*S,y:w.y*b},{width:S,height:b},P,-1)/O;return [le(a,r,v,{time:[0,_]},{...u,aliasToRemoveAfter:h},p,()=>{let{x:V,y:ee}=ot(r,w);v.center={x:V,y:ee};})]}async function Hr(a,r,d={},u){return at(a,r,"ripple",d,true,u,(h,p,I)=>Yn(a,h,d,p,I,u),h=>A(h,{duration:d.duration,delay:d.delay,ease:d.ease,completeOnContinue:d.completeOnContinue},u))}jr.rippleIn=Hr;function Gr(a,r={},d){return lt(a,r,true,d,(u,h,p)=>Yn(a,u,r,h,p,d))}jr.rippleOut=Gr;function Un(a,r,d,u,h,p,I){let{edge:E="hard",noiseScale:P=8,seed:O=Math.random()*1e3}=u,[w,S]=E==="hard"?[.25,.75]:[0,1],b=d==="in"?[w,S]:[S,w],v=new filters.filters.SimplexNoiseFilter({strength:b[0],noiseScale:P,offsetZ:O,step:E==="hard"?.5:0});return [le(a,r,v,{strength:b},{...h,aliasToRemoveAfter:p},I)]}async function Nr(a,r,d={},u){return at(a,r,"noise",d,false,u,(h,p,I)=>Un(a,h,"in",d,p,I,u),h=>Ti(h,l(d),u))}jr.noiseDissolveIn=Nr;function Ti(a,r={},d){return lt(a,r,false,d,(u,h,p)=>Un(a,u,"out",r,h,p,d))}jr.noiseDissolveOut=Ti;function Wn(a,r,d,u,h,p,I){let{lineThickness:E=.02,brightness:P=3,scanlines:O=true}=u,w=r.scale.x,S=r.scale.y,b=S*E,v=d==="in"?[0,.45,1]:[0,.55,1],_=d==="in"?[0,w,w]:[w,w,0],L=d==="in"?[b,b,S]:[S,b,b],V=d==="in"?[P,P,1]:[1,P,P];d==="in"&&r.scale.set(0,b);let ee=[g.animate(a,{scaleX:_,scaleY:L},{duration:h.duration,delay:h.delay,ease:h.ease,times:v,completeOnContinue:h.completeOnContinue,aliasToRemoveAfter:p},I),le(a,r,new filters.filters.AdjustmentFilter({brightness:V[0]}),{brightness:V},{...h,times:v},I)];if(O){let te=d==="in"?[.5,.5,0]:[0,.5,.5];ee.push(le(a,r,new filters.filters.CRTFilter({curvature:0,vignettingAlpha:0,lineWidth:3,lineContrast:te[0],noise:te[0]}),{lineContrast:te,noise:te},{...h,times:v},I));}return ee}async function Vr(a,r,d={},u){return at(a,r,"tv",d,false,u,(h,p,I)=>Wn(a,h,"in",d,p,I,u),h=>Ii(h,l(d),u),true)}jr.tvIn=Vr;function Ii(a,r={},d){return lt(a,r,false,d,(u,h,p)=>Wn(a,u,"out",r,h,p,d))}jr.tvOut=Ii;function Hn(a,r,d,u,h,p,I){let{strength:E=1,mode:P="pinch",radius:O=Bn(r),origin:w}=u,S=(P==="bulge"?1:-1)*E,b=Gt(w),v=d==="in"?[S,0]:[0,S],_=new filters.filters.BulgePinchFilter({center:b,radius:O,strength:v[0]});if(P==="bulge"){let{width:V,height:ee}=r.getBounds();_.padding=_n({x:b.x*V,y:b.y*ee},O,V,ee);}return [le(a,r,_,{strength:v},{...h,aliasToRemoveAfter:p},I,()=>{let{x:V,y:ee,area:te}=ot(r,b);_.center={x:V/te.width,y:ee/te.height};})]}async function Xr(a,r,d={},u){return at(a,r,"pinch",d,true,u,(h,p,I)=>Hn(a,h,"in",d,p,I,u),h=>A(h,{duration:d.duration,delay:d.delay,ease:d.ease,completeOnContinue:d.completeOnContinue},u))}jr.pinchIn=Xr;function $r(a,r={},d){return lt(a,r,true,d,(u,h,p)=>Hn(a,u,"out",r,h,p,d))}jr.pinchOut=$r;})(exports.transitions||={});var Wt=class extends Qe{constructor(n){super(n);this._memory=n;this.pixivnId=n.pixivnId;}_memory;pixivnId;get memory(){return {...this._memory,...super.memory,elements:[],pixivnId:this.pixivnId}}};function kr(){return async(e,n)=>{try{let i=e.canvasElementInfo;if(i){let s=new Wt(i),l=i.zIndex;s.groupColor=16711680;let c=new ht__default.default.Graphics;c.rect(0,0,300,100).fill({color:16711680,alpha:.5}),s.addChild(c);let y=new ht__default.default.Text({text:`Error: ${i.label}`,x:10,y:10});s.addChild(y);let m=e.parent;if(m&&"addChild"in m)l!==void 0?m.addChildAt(s,l):m.addChild(s);else {let f=i.parentLabel?g.find(i.parentLabel):void 0;if(f)l!==void 0?f.addChildAt(s,l):f.addChild(s);else {let x=i.label??i.pixivnId;g.add(x,s,{zIndex:l});}}}}catch{}}}function Br(t,e,n){let i={...g.find(t)?.memory,...n},s=new yt({text:e,...n});return i&&g.copyCanvasElementProperty(i,s),g.add(t,s,{ignoreOldStyle:true,zIndex:n?.zIndex}),s}var {Assets:ul,Color:fl,Rectangle:hl,TextStyle:pl,Texture:gl,UPDATE_PRIORITY:ml}=ht__default.default,g=new Lt;ve.init({getScreen:()=>g.screen});core.GameUnifier.addOnPreContinue(async()=>{try{let{tikersIds:t,stepAlias:e}=tickers.drainCompleteOnStepEndQueue(),n=(async()=>{for(;t.length;){let{id:s}=t.pop()||{};s&&await tickers.tickers.forceCompletion(s);}})(),i=(async()=>{for(;e.length;){let{alias:s,id:l}=e.pop()||{};s&&l&&await tickers.tickers.forceCompletion(l,s);}})();await Promise.all([n,i]);}catch{}});
|
|
2
|
+
exports.Assets=ul;exports.CanvasBaseItem=on;exports.CanvasManagerStatic=fe;exports.Color=fl;exports.Container=Qe;exports.ImageContainer=ae;exports.ImageSprite=oe;exports.Rectangle=hl;exports.RegisteredCanvasComponents=Ce;exports.RegisteredEvents=Cn;exports.Sprite=mt;exports.Text=yt;exports.TextStyle=pl;exports.Texture=gl;exports.UPDATE_PRIORITY=ml;exports.VideoSprite=qe;exports.addImage=un;exports.addImageCointainer=dn;exports.addListenerHandler=ft;exports.addVideo=fn;exports.analizePositionsExtensionProps=Xe;exports.canvas=g;exports.canvasComponentDecorator=Bi;exports.createFilterTransitionApplier=kn;exports.drawCanvasErrorHandler=kr;exports.eventDecorator=Di;exports.getTexture=zt;exports.moveIn=Or;exports.moveOut=Er;exports.pushIn=Rr;exports.pushOut=Dr;exports.removeWithDissolve=wr;exports.removeWithFade=Ar;exports.setMemoryContainer=Be;exports.shakeEffect=fr;exports.showImage=Ir;exports.showImageContainer=Tr;exports.showText=Br;exports.showVideo=Cr;exports.showWithDissolve=br;exports.showWithFade=Sr;exports.zoomIn=_r;exports.zoomOut=Mr;Object.keys(tickers).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return tickers[k]}})});
|