@drincs/pixi-vn 1.9.5 → 1.9.6

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