@drincs/pixi-vn 1.9.3 → 1.9.4

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 (48) hide show
  1. package/README.md +1 -1
  2. package/dist/{ContainerMemory-BpDgacyr.d.cts → ContainerMemory-DNqSVzLY.d.cts} +12 -116
  3. package/dist/{ContainerMemory-BpDgacyr.d.ts → ContainerMemory-DNqSVzLY.d.ts} +12 -116
  4. package/dist/canvas.cjs +2 -2
  5. package/dist/canvas.d.cts +1279 -551
  6. package/dist/canvas.d.ts +1279 -551
  7. package/dist/canvas.mjs +2 -2
  8. package/dist/characters.mjs +1 -1
  9. package/dist/{chunk-7P46CLKX.mjs → chunk-5MVDNAT4.mjs} +1 -1
  10. package/dist/chunk-6OABTG5R.mjs +1 -0
  11. package/dist/chunk-AW5XWF24.mjs +1 -0
  12. package/dist/chunk-HD353M4B.mjs +1 -0
  13. package/dist/chunk-LXIKP2K5.mjs +1 -0
  14. package/dist/chunk-S7HZUIEI.mjs +1 -0
  15. package/dist/core.cjs +1 -1
  16. package/dist/core.d.cts +57 -1
  17. package/dist/core.d.ts +57 -1
  18. package/dist/core.mjs +1 -1
  19. package/dist/filters.cjs +1 -0
  20. package/dist/filters.d.cts +182 -0
  21. package/dist/filters.d.ts +182 -0
  22. package/dist/filters.mjs +1 -0
  23. package/dist/history.mjs +1 -1
  24. package/dist/index.cjs +2 -2
  25. package/dist/index.d.cts +5 -2
  26. package/dist/index.d.ts +5 -2
  27. package/dist/index.mjs +2 -2
  28. package/dist/motion.cjs +1 -1
  29. package/dist/motion.d.cts +30 -8
  30. package/dist/motion.d.ts +30 -8
  31. package/dist/motion.mjs +1 -1
  32. package/dist/narration.mjs +1 -1
  33. package/dist/pixi/browser.js +170 -169
  34. package/dist/sound.mjs +1 -1
  35. package/dist/storage.mjs +1 -1
  36. package/dist/tickers.cjs +1 -0
  37. package/dist/tickers.d.cts +555 -0
  38. package/dist/tickers.d.ts +555 -0
  39. package/dist/tickers.mjs +1 -0
  40. package/dist/vite.cjs +6 -6
  41. package/dist/vite.mjs +6 -6
  42. package/dist/worker.cjs +1 -1
  43. package/dist/worker.mjs +1 -1
  44. package/package.json +22 -1
  45. package/dist/chunk-AWU37VV6.mjs +0 -1
  46. package/dist/chunk-QOBPVPCY.mjs +0 -1
  47. package/dist/chunk-U5BSF6X3.mjs +0 -1
  48. package/dist/chunk-YBA63R27.mjs +0 -1
package/dist/canvas.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import {a}from'./chunk-7P46CLKX.mjs';import'./chunk-JMOSOAGB.mjs';import {a as a$1}from'./chunk-YBA63R27.mjs';import {c,q as q$1,h as h$1,g as g$1,j,e,f as f$1,i,r,d}from'./chunk-U5BSF6X3.mjs';import {GameUnifier,PixiError}from'@drincs/pixi-vn/core';import B,{Container}from'@drincs/pixi-vn/pixi.js';import {initDevtools}from'@pixi/devtools';var Fe={extension:{type:"sceneProperties",name:"additional-positions"},testNode(t){return "xAlign"in t||"yAlign"in t||"percentageX"in t||"percentageY"in t||"positionType"in t},testProp(t){switch(t){case "xAlign":case "yAlign":case "percentageX":case "percentageY":case "positionType":return true;default:return false}},setProperty(t,e,i){switch(e){case "xAlign":"xAlign"in t&&(t.xAlign=i/100);break;case "yAlign":"yAlign"in t&&(t.yAlign=i/100);break;case "percentageX":"percentageX"in t&&(t.percentageX=i/100);break;case "percentageY":"percentageY"in t&&(t.percentageY=i/100);break}},getProperties(t){return [{value:t.positionType,prop:"positionType",entry:{section:"Transform",type:"text",label:"Position Type"}},{value:t.xAlign*100,prop:"xAlign",entry:{section:"Transform",type:"range",label:"X Align",tooltip:"0% is left, 100% is right",options:{min:0,max:100}}},{value:t.yAlign*100,prop:"yAlign",entry:{section:"Transform",type:"range",label:"Y Align",tooltip:"0% is top, 100% is bottom",options:{min:0,max:100}}},{value:t.percentageX*100,prop:"percentageX",entry:{section:"Transform",type:"range",label:"X Percentage Position",tooltip:"0% is left, 100% is right",options:{min:0,max:100}}},{value:t.percentageY*100,prop:"percentageY",entry:{section:"Transform",type:"range",label:"Y Percentage Position",tooltip:"0% is top, 100% is bottom",options:{min:0,max:100}}}]}},be=Fe;function Ae(t,e){let i=0;return async(...n)=>{let r=Date.now();if(r-i>=e)return i=r,await t(...n)}}var _e=c(a(),1),g=class t{constructor(){}static _app=void 0;static get app(){if(!t._app)throw r.error("The canvas is not initialized"),new PixiError("invalid_usage","CanvasManagerStatic.app is undefined");return t._app}static get gameLayer(){let e=t.app.stage.getChildByLabel(d);return e||(e=new B.Container,e.label=d,t.app.stage.addChild(e)),e}static htmlLayers=[];static canvasWidth=300;static canvasHeight=300;static _isInitialized=false;static async init(e,i,n){let{id:r="pixi-vn-canvas",width:a=800,height:o=600,resolution:p=1,autoDensity:d=true,resizeMode:s="contain",...c}=i||{};return t.canvasWidth=a,t.canvasHeight=o,t._app=new B.Application,t.app.init({width:a,height:o,resolution:p,autoDensity:d,...c}).then(()=>{let{app:l=t.app,extensions:u=[],...y}=n||{};if(initDevtools({app:l,extensions:[be,...u],...y}),t._isInitialized=true,t.addCanvasIntoHTMLElement(e,r),s==="contain"){let x=Ae(async()=>{requestAnimationFrame(()=>t.resize());},10);new ResizeObserver(x).observe(e),t.resize(),setTimeout(()=>t.resize(),750);}t.gameLayer;})}static addCanvasIntoHTMLElement(e,i){t._isInitialized?(e.appendChild(t.app.canvas),t.app.canvas.id=i):r.error("GameWindowManager is not initialized");}static addHtmlLayer(e,i,n={}){let{position:r="absolute",pointerEvents:a="none",userSelect:o="none"}=n,p=document.createElement("div");p.setAttribute("id",e),p.style.position=r,p.style.pointerEvents=a,p.style.userSelect=o;let d=i.appendChild(p);return t.htmlLayers.push(p),t.resize(),d}static removeHtmlLayer(e){let i=t.htmlLayers.find(n=>n.id===e);i&&(i.remove(),t.htmlLayers=t.htmlLayers.filter(n=>n.id!==e));}static getHtmlLayer(e){return t.htmlLayers.find(i=>i.id===e)}static async resize(){let e=t.canvasWidth,i=t.canvasHeight,n=t.app.resizeTo,r=t.app.canvas.style;n instanceof HTMLElement||(n=document.documentElement);let a,o;if(n===document.body||n===document.documentElement)a=document.documentElement.clientWidth||window.innerWidth,o=document.documentElement.clientHeight||window.innerHeight;else {let u=n.getBoundingClientRect();a=u.width||n.clientWidth,o=u.height||n.clientHeight;}let p=Math.min(a/e,o/i),d=Math.floor(p*e),s=Math.floor(p*i);r.width=`${d}px`,r.height=`${s}px`;let c=(a-d)/2,l=(o-s)/2;r.marginLeft=`${c}px`,r.marginRight=`${c}px`,r.marginTop=`${l}px`,r.marginBottom=`${l}px`,t.htmlLayers.forEach(u=>{u.style.width=`${d}px`,u.style.height=`${s}px`,u.style.marginLeft=`${c}px`,u.style.marginRight=`${c}px`,u.style.marginTop=`${l}px`,u.style.marginBottom=`${l}px`;});}static get childrenAliasesOrder(){return t.gameLayer.children.filter(e=>e.label).sort((e,i)=>t.gameLayer.getChildIndex(e)-t.gameLayer.getChildIndex(i)).map(e=>e.label)}static get currentTickersWithoutCreatedBySteps(){return Object.fromEntries(Array.from(t._currentTickers.entries()).filter(([e,i])=>!i.createdByTicketSteps).map(([e,i])=>[e,{id:i.ticker.alias,args:i.ticker.args,canvasElementAliases:i.ticker.canvasElementAliases,priority:i.ticker.priority,duration:i.ticker.duration,paused:i.ticker.paused}]))}static _currentTickers=new Map;static _currentTickersSequence=new Map;static get currentTickersSequence(){return Object.fromEntries(Array.from(t._currentTickersSequence.entries()).map(([e,i])=>[e,Object.fromEntries(i)]))}static _currentTickersTimeouts=new Map;static _tickersToCompleteOnStepEnd={tikersIds:[],stepAlias:[]};static generateTickerId(...e){try{return `${(0,_e.default)(JSON.stringify(e)).toString()}_${Math.random().toString(36).substring(7)}`}catch(i){throw new PixiError("not_json_serializable",`Error to generate ticker id: ${i}`)}}static addTickerTimeoutInfo(e,i,n,r){typeof e=="string"&&(e=[e]),t._currentTickersTimeouts.set(n,{aliases:e,ticker:i,canBeDeletedBeforeEnd:r});}static removeTickerTimeoutInfo(e){typeof e!="string"&&(e=e.toString()),t._currentTickersTimeouts.delete(e);}static removeTickerTimeout(e){typeof e!="string"&&(e=e.toString()),clearTimeout(Number(e)),t.removeTickerTimeoutInfo(e);}static removeTickerTimeoutsByAlias(e,i){t._currentTickersTimeouts.forEach((n,r)=>{let a=n.aliases.filter(o=>o!==e);if(a.length===0){let o=n.canBeDeletedBeforeEnd;(!i||o)&&t.removeTickerTimeout(r);}else n.aliases=a;});}};var ue=Symbol("SerializableEvent"),X=new q$1({cacheSize:5});function Ze(t){return (e,i,n)=>{let r=n.value;fe.add(r,t||`${i}`);}}var fe;(a=>{function t(o,p){o[ue]=p,X.get(p)&&r.info(`Event "${p}" already exists, it will be overwritten`),X.set(p,o);}a.add=t;function e(o){try{let p=X.get(o);if(!p){r.error(`Event "${o}" not found, did you forget to register it with the eventDecorator?`);return}return p}catch(p){r.error(`Error while getting Event "${o}"`,p);return}}a.get=e;function i(){return Array.from(X.values())}a.values=i;function n(o){return X.has(o)}a.has=n;function r$1(){return Array.from(X.keys())}a.keys=r$1;})(fe||={});var ge=fe;async function we(t,e){if("onEvents"in e)for(let i in e.onEvents){let n=e.onEvents[i],r=ge.get(n);r&&t.on(i,r);}}function Oe(t){let{onEventsHandlers:e={}}=t;return e}function O(t,e,i){let n=i[ue];return n&&typeof n=="string"?(e.onEventsHandlers[t]=n,true):(r.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 q=new q$1({cacheSize:5}),Be=new q$1({cacheSize:2}),Le=new q$1({cacheSize:2});function Je(t={}){return e=>{he.add(e,t);}}async function S(t,e,i){let n=i?.ignoreScale||false,r=i?.end;"isRenderGroup"in e&&e.isRenderGroup!==void 0&&(t.isRenderGroup=e.isRenderGroup),"blendMode"in e&&e.blendMode!==void 0&&(t.blendMode=e.blendMode),"tint"in e&&e.tint!==void 0&&(t.tint=e.tint),"alpha"in e&&e.alpha!==void 0&&(t.alpha=e.alpha),"angle"in e&&e.angle!==void 0&&(t.angle=e.angle),"renderable"in e&&e.renderable!==void 0&&(t.renderable=e.renderable),"rotation"in e&&e.rotation!==void 0&&(t.rotation=e.rotation),!n&&"scale"in e&&e.scale!==void 0&&(typeof e.scale=="number"?t.scale.set(e.scale,e.scale):t.scale.set(e.scale.x,e.scale.y)),"pivot"in e&&e.pivot!==void 0&&(typeof e.pivot=="number"?t.pivot.set(e.pivot,e.pivot):t.pivot.set(e.pivot.x,e.pivot.y)),"position"in e&&e.position!==void 0&&t.position.set(e.position.x,e.position.y),"skew"in e&&e.skew!==void 0&&t.skew.set(e.skew.x,e.skew.y),"visible"in e&&e.visible!==void 0&&(t.visible=e.visible),"x"in e&&e.x!==void 0&&(t.x=e.x),"y"in e&&e.y!==void 0&&(t.y=e.y),"boundsArea"in e&&e.boundsArea!==void 0&&(t.boundsArea=e.boundsArea),"cursor"in e&&e.cursor!==void 0&&(t.cursor=e.cursor),"eventMode"in e&&e.eventMode!==void 0&&(t.eventMode=e.eventMode),"interactive"in e&&e.interactive!==void 0&&(t.interactive=e.interactive),"interactiveChildren"in e&&e.interactiveChildren!==void 0&&(t.interactiveChildren=e.interactiveChildren),"hitArea"in e&&e.hitArea!==void 0&&(t.hitArea=e.hitArea),we(t,e),"align"in e&&e.align!==void 0&&"align"in t&&(t.align=e.align),"percentagePosition"in e&&e.percentagePosition!==void 0&&"percentagePosition"in t&&(t.percentagePosition=e.percentagePosition),r&&await r(),n||("width"in e&&e.width!==void 0&&(t.width=e.width),"height"in e&&e.height!==void 0&&(t.height=e.height));}var he;(p=>{function t(d,s={}){let{name:c=d.name,getInstance:l=async(y,x)=>{let T=new y;return await T.setMemory(x),T},copyProperty:u=async(y,x)=>{await y.setMemory(x);}}=s;q.get(c)&&r.warn(`CanvasElement "${c}" already registered`),d.prototype.pixivnId=c,q.set(c,d),Be.set(c,l),Le.set(c,u);}p.add=t;function e(d){let s=q.get(d);if(!s){r.error(`CanvasElement "${d}" not found, did you forget to register it with the canvasComponentDecorator?`);return}return s}p.get=e;async function i(d,s){let c=e(d),l=Be.get(d);if(!c||!l){r.error(`CanvasElement "${d}" not found, did you forget to register it with the canvasComponentDecorator?`);return}try{return await l(c,s)}catch(u){r.error(`Error while getting CanvasElement instance "${d}"`,u);}}p.getInstance=i;async function n(d,s,c){let l=Le.get(d);if(!l){r.error(`CanvasElement "${d}" not found, did you forget to register it with the canvasComponentDecorator?`);return}try{await l(s,c);}catch(u){r.error(`Error while copying properties of CanvasElement "${d}"`,u);}}p.copyProperty=n;function r$1(){return Array.from(q.values())}p.values=r$1;function a(d){return q.has(d)}p.has=a;function o(){return Array.from(q.keys())}p.keys=o;})(he||={});var k=he;async function J(t){let e=await k.getInstance(t.pixivnId,t);if(!e)throw new PixiError("unregistered_element",`The element ${t.pixivnId} could not be created`,"canvas",t);return e}function ye(t){return "memory"in t?t.memory:t instanceof B.Text?Te(t):t instanceof B.Sprite?xe(t):L(t)}function et(t){let e=t.parent;return {width:t.width,height:t.height,isRenderGroup:t.isRenderGroup,blendMode:t.blendMode,tint:t.tint,alpha:t.alpha,angle:t.angle,renderable:t.renderable,rotation:t.rotation,scale:{x:t.scale.x,y:t.scale.y},pivot:{x:t.pivot.x,y:t.pivot.y},position:{x:t.position.x,y:t.position.y},skew:{x:t.skew.x,y:t.skew.y},visible:t.visible,x:t.x,y:t.y,boundsArea:t.boundsArea,cursor:t.cursor,eventMode:t.eventMode,interactive:t.interactive,interactiveChildren:t.interactiveChildren,hitArea:t.hitArea,index:e?.getChildIndex(t),parentLabel:e?.label,label:t.label}}function me(t,e){return {url:t.source.label,alias:e===t.source.label?void 0:e}}function L(t,e$1){let i=tt(t,e),r=e$1?.childrenExport||false?t.children.sort((a,o)=>t.getChildIndex(a)-t.getChildIndex(o)).map(a=>ye(a)):[];return {pixivnId:i,elements:r,onEvents:Oe(t),...et(t)}}function xe(t){let e=L(t),i=e.pixivnId??h$1,n="assetsAliases"in t&&Array.isArray(t.assetsAliases)?me(t.texture,t.assetsAliases[0]):"textureAlias"in t?me(t.texture,t.textureAlias):me(t.texture);return {...e,pixivnId:i,textureData:n,anchor:{x:t.anchor.x,y:t.anchor.y},roundPixels:t.roundPixels}}function Te(t){let e=L(t),i$1=e.pixivnId??i;return {...e,pixivnId:i$1,anchor:{x:t.anchor.x,y:t.anchor.y},text:t.text,resolution:t.resolution,style:st(t.style),roundPixels:t.roundPixels}}function tt(t,e){return Object.hasOwn(t,"pixivnId")?t.pixivnId:e}function Q(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 it(t){if(t!=null){{if(typeof t=="number")return t;if(typeof t=="string"||Array.isArray(t))return t;if(t instanceof B.FillGradient)return Q(t);if(typeof t=="object"&&"fill"in t&&typeof t.fill!="function"&&t.fill){if(!(t.fill instanceof B.FillPattern))return Q(t.fill)}}r.warn("Unsupported property type for Text.style.fill.",t);}}function rt(t){if(typeof t=="number")return t;if(typeof t=="string")return t;if(Array.isArray(t))return t;if(t instanceof B.Color)return t.toNumber();r.warn("Unsupported color type.",t);}function nt(t){if(t!=null){{if(typeof t=="number")return t;if(typeof t=="string"||Array.isArray(t))return t;if(t instanceof B.FillGradient)return Q(t);if(typeof t=="object"&&"alignment"in t)return {alignment:t.alignment,alpha:t.alpha,color:rt(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 B.FillPattern))return Q(t.fill)}}r.warn("Unsupported property type for Text.style.stroke.",t);}}function st(t){return {align:t.align,breakWords:t.breakWords,dropShadow:t.dropShadow,fill:it(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:nt(t.stroke),textBaseline:t.textBaseline,trim:t.trim,whiteSpace:t.whiteSpace,wordWrap:t.wordWrap,wordWrapWidth:t.wordWrapWidth}}var Re=c(a(),1);var ee=class{constructor(e,i){this.alias=this.constructor.prototype.id;let{duration:n,priority:r,id:a=this.generateTickerId(this.alias,i),canvasElementAliases:o=[]}=i||{};this.args=e,this.duration=n,this.priority=r,this.id=a,this.canvasElementAliases=o;}alias;id;args;duration;priority;ticker=new B.Ticker;canvasElementAliases=[];generateTickerId(...e){try{return (0,Re.default)(JSON.stringify(e)).toString()+"_"+Math.random().toString(36).substring(7)}catch(i){throw new PixiError("not_json_serializable",`Error to generate ticker id: ${i}`)}}fnValue;complete(e){this.stop();}stop(){let e=this.fnValue;if(!e){r.warn("TickerBase.stop() called without fnValue set. This may cause issues.");return}this.ticker.remove(e,null);}start(){let e=this.id,i=()=>this.fn(this.ticker,this.args,this.canvasElementAliases,e);this.fnValue=i,this.ticker.add(i,null,this.priority),this.ticker.start();}pause(){this.ticker.stop();}play(){this.ticker.start();}get paused(){return !this.ticker.started}};var R=new q$1({cacheSize:5});function ct(t){return function(e){ve.add(e,t);}}var ve;(o=>{function t(p,d){d||(d=p.name),R.get(d)&&r.info(`Ticker "${d}" already exists, it will be overwritten`),p.prototype.id=d,R.set(d,p);}o.add=t;function e(p){try{let d=R.get(p);if(!d){r.error(`Event "${p}" not found, did you forget to register it with the tickerDecorator?`);return}return d}catch(d){r.error(`Error while getting Event "${p}"`,d);return}}o.get=e;function i(p,d,s){try{let c=R.get(p);if(!c){r.error(`Ticker "${p}" not found, did you forget to register it with the tickerDecorator?`);return}return new c(d,s)}catch(c){r.error(`Error while getting Ticker "${p}"`,c);return}}o.getInstance=i;function n(){return Array.from(R.values())}o.values=n;function r$1(p){return R.has(p)}o.has=r$1;function a(){return Array.from(R.keys())}o.keys=a;})(ve||={});var D=ve;var De="aliasToRemoveAfter";var G=class{tickersPausedByGameLayerRender=[];get app(){return g.app}get gameLayer(){return g.gameLayer}get isInitialized(){return g._isInitialized}get width(){return g.canvasWidth}get height(){return g.canvasHeight}get screen(){return this.app.screen}async init(e,i,n){return await g.init(e,i,n)}get children(){return g.gameLayer.children}async copyCanvasElementProperty(e,i,n={}){let r$1=["isRenderGroup","scale","visible","boundsArea","text","resolution","style","height","width"],{ignoreProperties:a=d=>d}=n;if(typeof i=="string"){let d=this.find(i);if(d)i=d;else {r.error(`Canvas element ${i} not found`);return}}if(typeof e=="string"){let d=this.find(e);if(d)e=d;else {r.error(`Canvas element ${e} not found`);return}}e instanceof B.Container&&(e=e.memory);let o=a(r$1),p={...e};o.forEach(d=>{d in p&&delete p[d];}),await k.copyProperty(i.pixivnId,i,p);}add(e,i,n={}){if(e===d){r.error(`The alias ${d} is reserved`);return}let r$1=this.find(e),a=n?.ignoreOldStyle;r$1&&!a&&this.copyCanvasElementProperty(r$1,i);let{zIndex:o=r$1?.parent?.getChildIndex(r$1)}=n;r$1&&!this.canvasElementIsOnCanvas(r$1)?r.error(`The canvas element ${e} exist in the memory but it is not on the canvas, so the zIndex is not set`):r$1&&this.remove(e,{ignoreTickers:true}),o!==void 0?(i.label=e,this.gameLayer.addChildAt(i,o)):(i.label=e,this.gameLayer.addChild(i));}remove(e,i={}){if(e===d){r.error(`The alias ${d} is reserved`);return}let n=i.ignoreTickers;typeof e=="string"&&(e=[e]),e.forEach(r=>{this.gameLayer.getChildrenByLabel(r).forEach(a=>{this.gameLayer.removeChild(a),!n&&this.unlinkComponentFromTickerInternal(r);});});}find(e){if(e===d)return this.gameLayer;let i=this.gameLayer.getChildByLabel(e);if(i)return i}canvasElementIsOnCanvas(e){return this.gameLayer.children.includes(e)}removeAll(){this.gameLayer.removeChildren();}editAlias(e,i,n={}){let r=this.find(e);r&&(r.label=i),!n.ignoreTickers&&this.transferTickersInternal(e,i,"move");}get currentTickers(){return this.tickers.currentTickers}get currentTickersSteps(){return this.tickers.currentTickersSteps}findTicker(e){return this.findTickerInternal(e)}findTickerInternal(e){let i=g._currentTickers.get(e);if(i)return i.ticker}addTicker(e,i){return this.addTickerInternal(e,i)}addTickerInternal(e,i){let n=i.id,r$1=i.alias;if(typeof e=="string"&&(e=[e]),i.canvasElementAliases=e,!D.has(r$1)){r.error(`Ticker ${r$1} not found`);return}let a={ticker:i};if(g._currentTickers.set(n,a),a.ticker.start(),i.duration){let o=setTimeout(()=>{g.removeTickerTimeoutInfo(o),g._currentTickersTimeouts.get(o.toString())&&a.ticker.complete({ignoreTickerSteps:true});},i.duration*1e3);g.addTickerTimeoutInfo(e,r$1,o.toString(),true);}return n}addTickersSequence(e,i,n=0){if(i.length===0){r.warn("The steps of the tickers is empty");return}g._currentTickersSequence.has(e)||g._currentTickersSequence.set(e,new Map);let r$1={currentStepNumber:n,steps:i.map(o=>({ticker:o.alias,args:a$1(o.args),duration:o.duration}))},a=g.generateTickerId(r$1);return g._currentTickersSequence.get(e)?.set(a,r$1),this.runTickersSequence(e,a),a}runTickersSequence(e,i){let n=g._currentTickersSequence.get(e);if(!n?.has(i))return;let r$1=n.get(i).steps[n.get(i).currentStepNumber],a=D.getInstance(r$1.ticker,r$1.args,{canvasElementAliases:[e],duration:r$1.duration,priority:r$1.priority});if(!a){r.error(`Ticker ${r$1.ticker} not found`);return}let o=a.alias,p=a.id;a.canvasElementAliases=[e];let d={createdByTicketSteps:{canvasElementAlias:e,id:i},ticker:a};if(g._currentTickers.set(p,d),d.ticker.start(),a.duration){let s=setTimeout(()=>{let c=g._currentTickersTimeouts.get(s.toString());c&&(d.ticker.complete({ignoreTickerSteps:true}),c.aliases.forEach(l=>{this.nextTickerStep(l,i);})),g.removeTickerTimeoutInfo(s);},a.duration*1e3);g.addTickerTimeoutInfo(e,o,s.toString(),false);}}nextTickerStep(e,i){let n=g._currentTickersSequence.get(e);if(n?.has(i)){let r=n.get(i);r.currentStepNumber+1<r.steps.length?(r.currentStepNumber++,n.set(i,r),this.runTickersSequence(e,i)):i&&n.has(i)&&(n.delete(i),g._currentTickers.forEach((a,o)=>{a.createdByTicketSteps?.canvasElementAlias===e&&a.createdByTicketSteps.id===i&&this.removeTickerInternal(o);}));}}onTickerComplete(e,i){return this.onTickerCompleteInternal(e,i)}onTickerCompleteInternal(e,i){let{stopTicker:n=true,aliasToRemoveAfter:r,tickerAliasToResume:a,tickerIdToResume:o}=i,p=g._currentTickers.get(e),d=i.ignoreTickerSteps||false;this.remove(r),a.forEach(s=>{this.resumeTickerInternal({canvasAlias:s});}),this.resumeTickerInternal({id:o}),p&&(this.removeTickerInternal(e,{stopTicker:n}),!d&&p.ticker.duration===void 0&&p.createdByTicketSteps&&this.nextTickerStep(p.createdByTicketSteps.canvasElementAlias,p.createdByTicketSteps.id));}unlinkComponentFromTicker(e,i){return this.unlinkComponentFromTickerInternal(e,i)}unlinkComponentFromTickerInternal(e,i){if(typeof e=="string"&&(e=[e]),!i){e.forEach(r=>{g._currentTickers.forEach((a,o)=>{a.ticker.canvasElementAliases.includes(r)&&(a.ticker.canvasElementAliases.length===1?this.removeTickerInternal(o):a.ticker.canvasElementAliases=a.ticker.canvasElementAliases.filter(p=>p!==r));}),g._currentTickersSequence.has(r)&&g._currentTickersSequence.delete(r),g.removeTickerTimeoutsByAlias(r,false);});return}let n;typeof i=="string"?n=i:n=i.prototype.id,e.forEach(r=>{let a=g._currentTickersSequence.get(r);a&&a.forEach((o,p)=>{o.steps.find(d=>typeof d=="object"&&"ticker"in d&&d.ticker===n)&&a.delete(p);});}),g._currentTickers.forEach(r=>{r.ticker.alias===n&&(r.ticker.canvasElementAliases=r.ticker.canvasElementAliases.filter(a=>!e.includes(a)));}),g._currentTickersTimeouts.forEach(r=>{r.ticker===n&&r.canBeDeletedBeforeEnd&&(r.aliases=r.aliases.filter(a=>!e.includes(a)));}),this.removeTickersWithoutAssociatedCanvasElement();}removeTickersWithoutAssociatedCanvasElement(){g._currentTickers.forEach(e=>{e.ticker.canvasElementAliases=e.ticker.canvasElementAliases.filter(i=>this.find(i)),e.ticker.canvasElementAliases.length===0&&e.ticker.complete({ignoreTickerSteps:true});}),g._currentTickersSequence.forEach((e,i)=>{e===void 0&&g._currentTickersSequence.delete(i);}),Array.from(g._currentTickersTimeouts.keys()).forEach(e=>{let i=g._currentTickersTimeouts.get(e);i&&i.aliases.length===0&&g.removeTickerTimeout(e);});}removeAllTickers(){return this.removeAllTickersInternal()}removeAllTickersInternal(){this.tickersPausedByGameLayerRender=[],g._currentTickersSequence.clear(),Array.from(g._currentTickers.keys()).forEach(e=>{this.removeTickerInternal(e);}),g._currentTickers.clear(),Array.from(g._currentTickersTimeouts.keys()).forEach(e=>{g.removeTickerTimeout(e);}),g._tickersToCompleteOnStepEnd.tikersIds.length=0,g._tickersToCompleteOnStepEnd.stepAlias.length=0;}removeTicker(e,i={stopTicker:true}){return this.removeTickerInternal(e,i)}removeTickerInternal(e,i={stopTicker:true}){typeof e=="string"&&(e=[e]),e.forEach(n=>{let r=g._currentTickers.get(n);r&&(i.stopTicker&&r.ticker.stop(),g._currentTickers.delete(n));});}pauseTicker(e){return this.pauseTickerInternal(e)}pauseTickerInternal(e){let i=[];if("canvasAlias"in e){let{canvasAlias:n,tickerIdsExcluded:r=[]}=e;g._currentTickers.forEach((a,o)=>{a.ticker.canvasElementAliases.includes(n)&&!r.includes(a.ticker.alias)&&a.ticker.paused===false&&(a.ticker.pause(),i.push(o));});}else if("id"in e){let{id:n}=e;typeof n=="string"&&(n=[n]),[...new Set(n)].forEach(r$1=>{let a=g._currentTickers.get(r$1);a?a.ticker.paused===false&&(a.ticker.pause(),i.push(r$1)):r.error(`Ticker with id ${r$1} not found`);});}return i}resumeTicker(e){return this.resumeTickerInternal(e)}resumeTickerInternal(e){if("canvasAlias"in e){let{canvasAlias:i}=e;g._currentTickers.forEach(n=>{n.ticker.canvasElementAliases.includes(i)&&n.ticker.play();});}else if("id"in e){let{id:i}=e;typeof i=="string"&&(i=[i]),[...new Set(i)].forEach(n=>{let r$1=g._currentTickers.get(n);r$1?r$1.ticker.play():r.error(`Ticker with id ${n} not found`);});}}isTickerPaused(e,i){return this.isTickerPausedInternal(e,i)}isTickerPausedInternal(e,i){return false}pause(){this.gameLayer.renderable!==false&&(this.gameLayer.renderable=false,this.tickersPausedByGameLayerRender=this.pauseTickerInternal({id:Array.from(g._currentTickers.keys())}));}resume(){if(this.gameLayer.renderable===true)return;this.gameLayer.renderable=true;let e=this.tickersPausedByGameLayerRender.filter(i=>g._currentTickers.has(i));e.length>0&&this.resumeTickerInternal({id:e}),this.tickersPausedByGameLayerRender=[];}transferTickers(e,i,n="move"){return this.transferTickersInternal(e,i,n)}transferTickersInternal(e,i,n="move"){let r$1=g._currentTickersSequence.get(e);if(r$1){let o=new Map(Array.from(r$1.entries()).map(([p,d])=>[p,a$1(d)]));g._currentTickersSequence.set(i,o);}g._currentTickers.forEach((o,p)=>{if(o.createdByTicketSteps?.canvasElementAlias===e&&this.removeTickerInternal(p),o.ticker.canvasElementAliases.includes(e)){let d=D.getInstance(o.ticker.alias,a$1(o.ticker.args),{duration:o.ticker.duration,priority:o.ticker.priority,canvasElementAliases:[i]});if(d?(this.addTickerInternal(i,d),o.ticker.paused&&d.pause()):r.error(`Ticker ${o.ticker.alias} not found`),n==="move"&&(o.ticker.canvasElementAliases=o.ticker.canvasElementAliases.filter(s=>s!==e)),Object.hasOwn(o.ticker.args,De)){let s=o.ticker.args.aliasToRemoveAfter;typeof s=="string"&&(s=[s]),Array.isArray(s)&&(n==="move"?o.ticker.args.aliasToRemoveAfter=s.map(c=>c===e?i:c):n==="duplicate"&&s.find(c=>c===e)&&(o.ticker.args.aliasToRemoveAfter=[...s,i]));}}}),g._currentTickersTimeouts.forEach(o=>{o.aliases.includes(e)&&(n==="move"?o.aliases=o.aliases.map(p=>p===e?i:p):n==="duplicate"&&o.aliases.find(p=>p===e)&&o.aliases.push(i));});let a=g._currentTickersSequence.get(i);if(a&&a.forEach((o,p)=>{this.runTickersSequence(i,p);}),n==="duplicate"){let o=g._currentTickersSequence.get(e);o&&o.forEach((p,d)=>{this.runTickersSequence(e,d);});}}completeTickerOnStepEnd(e){return this.completeTickerOnStepEndInternal(e)}completeTickerOnStepEndInternal(e){e.alias?g._tickersToCompleteOnStepEnd.stepAlias.push({id:e.id,alias:e.alias}):g._tickersToCompleteOnStepEnd.tikersIds.push({id:e.id});}async forceCompletionOfTicker(e,i){return this.forceCompletionOfTickerInternal(e,i)}async forceCompletionOfTickerInternal(e,i){if(i){let n=g._currentTickersSequence.get(i),r=n?.get(e);if(n&&r){let a=r.steps.map(o=>{if(typeof o=="object"&&"ticker"in o){let p=D.getInstance(o.ticker,o.args,{duration:o.duration,canvasElementAliases:[i],priority:o.priority});if(p)return p.complete()}return Promise.resolve()});await Promise.all(a);}}else {let n=g._currentTickers.get(e);n&&await n.ticker.complete();}}tickers={transfer:(e,i,n)=>this.transferTickersInternal(e,i,n),get currentTickers(){return g._currentTickers},get currentTickersSteps(){return g._currentTickersSequence},find:e=>this.findTickerInternal(e),add:(e,i)=>this.addTickerInternal(e,i),addSequence:(e,i,n)=>this.addTickersSequence(e,i,n),unlinkComponent:(e,i)=>this.unlinkComponentFromTickerInternal(e,i),removeAll:()=>this.removeAllTickersInternal(),remove:e=>this.removeTickerInternal(e),pause:e=>this.pauseTickerInternal(e),resume:e=>this.resumeTickerInternal(e),isPaused:(e,i)=>this.isTickerPausedInternal(e,i),completeOnStepEnd:e=>this.completeTickerOnStepEndInternal(e),forceCompletion:(e,i)=>this.forceCompletionOfTickerInternal(e,i),onComplete:(e,i)=>this.onTickerCompleteInternal(e,i)};animate(e,i,n,r){return GameUnifier.animate(e,i,n,r)}addLayerInternal(e,i){if(e===d){r.error(`The alias ${d} is reserved`);return}return i.label=e,g.app.stage.addChild(i)}getLayerInternal(e){return g.app.stage.getChildByLabel(e)}removeLayerInternal(e){let i=g.app.stage.getChildByLabel(e);i&&g.app.stage.removeChild(i);}addHtmlLayerInternal(e,i,n){return g.addHtmlLayer(e,i,n)}removeHtmlLayerInternal(e){return g.removeHtmlLayer(e)}getHtmlLayerInternal(e){return g.getHtmlLayer(e)}addLayer(e,i){return this.addLayerInternal(e,i)}getLayer(e){return this.getLayerInternal(e)}removeLayer(e){return this.removeLayerInternal(e)}addHtmlLayer(e,i,n){return this.addHtmlLayerInternal(e,i,n)}removeHtmlLayer(e){return this.removeHtmlLayerInternal(e)}getHtmlLayer(e){return this.getHtmlLayerInternal(e)}layers={get gameLayer(){return g.gameLayer},add:(e,i)=>this.addLayerInternal(e,i),get:e=>this.getLayerInternal(e),remove:e=>this.removeLayerInternal(e)};htmlLayers={add:(e,i,n)=>this.addHtmlLayerInternal(e,i,n),get:e=>this.getHtmlLayerInternal(e),remove:e=>this.removeHtmlLayerInternal(e)};async extractImage(){let e=this.gameLayer.renderable===false;e&&this.resume();let i;try{i=this.app.renderer.extract.image(this.app.stage);}finally{e&&this.pause();}return (await i).src}clear(){this.removeAllTickersInternal(),this.removeAll();}export(){let e=this.gameLayer.renderable===false;e&&this.resume();try{let i={};return this.children.forEach(n=>{n.label&&(i[n.label]=ye(n));}),{tickers:a$1(g.currentTickersWithoutCreatedBySteps),tickersSteps:a$1(g.currentTickersSequence),elements:a$1(i),stage:a$1(L(this.gameLayer)),elementAliasesOrder:a$1(g.childrenAliasesOrder),tickersToCompleteOnStepEnd:a$1(g._tickersToCompleteOnStepEnd)}}finally{e&&this.pause();}}async restore(e){this.clear();try{if(Object.hasOwn(e,"elements")&&Object.hasOwn(e,"elementAliasesOrder")){let i=e.elementAliasesOrder,n={},r=Object.entries(e.elements).map(async([a,o])=>{n[a]=await J(o);});await Promise.all(r),i.forEach(a=>{let o=n[a];o&&this.add(a,o);});}else {r.error("The data does not have the properties elementAliasesOrder and elements");return}if(Object.hasOwn(e,"stage")&&Object.hasOwn(e,"stage")?S(this.gameLayer,e.stage,{ignoreScale:!0}):r.error("The data does not have the properties stage"),Object.hasOwn(e,"tickers")){let i=e.tickers;Object.entries(i).forEach(([n,r$1])=>{let a=r$1.canvasElementAliases;if(a.length!==0){let o=D.getInstance(r$1.id,r$1.args,{duration:r$1.duration,priority:r$1.priority,id:n,canvasElementAliases:a});o?(o.canvasElementAliases=a,this.addTickerInternal(a,o),r$1.paused&&o.pause()):r.error(`Ticker ${r$1.id} not found`);}});}if(Object.hasOwn(e,"tickersSteps")){let i=e.tickersSteps;Object.entries(i).forEach(([n,r])=>{g._currentTickersSequence.set(n,new Map(Object.entries(r))),Object.keys(r).forEach(a=>{this.runTickersSequence(n,a);});});}if(Object.hasOwn(e,"tickersToCompleteOnStepEnd")){let i=e.tickersToCompleteOnStepEnd,n=i.tikersIds,r=i.stepAlias.map(a=>({id:a.id,alias:a.alias}));g._tickersToCompleteOnStepEnd.tikersIds.length=0,g._tickersToCompleteOnStepEnd.tikersIds.push(...n),g._tickersToCompleteOnStepEnd.stepAlias.length=0,g._tickersToCompleteOnStepEnd.stepAlias.push(...r);}}catch(i){r.error("Error importing data",i);}}};var I=class t{static init(e){t._getScreen=e.getScreen;}static _getScreen;static get screen(){return t._getScreen()}};var h;(d=>{function t(s,c,l,u,y,x=0){return y?s==="width"?c*(I.screen.width-l)+l-u-x*l:c*(I.screen.height-l)+l-u-x*l:s==="width"?c*(I.screen.width-l)+u+x*l:c*(I.screen.height-l)+u+x*l}d.calculatePositionByAlign=t;function e(s,c,l,u,y,x=0){return y?s==="width"?(c-l+u+x*l)/(I.screen.width-l):(c-l+u+x*l)/(I.screen.height-l):s==="width"?(c-u-x*l)/(I.screen.width-l):(c-u-x*l)/(I.screen.height-l)}d.calculateAlignByPosition=e;function i(s,c){return s==="width"?c*I.screen.width:c*I.screen.height}d.calculatePositionByPercentagePosition=i;function n(s,c){return s==="width"?c/I.screen.width:c/I.screen.height}d.calculatePercentagePositionByPosition=n;function r(s,c){if(c=c%360,c<0&&(c+=360),c===0)return {x:s.x,y:s.y};if(c===90)return {x:-s.y,y:s.x};if(c===180)return {x:-s.x,y:-s.y};if(c===270)return {x:s.y,y:-s.x};if(c>0&&c<90){let l=c*Math.PI/180,u=Math.cos(l),y=Math.sin(l),x=s.x*u-s.y*y,T=s.x*y+s.y*u;return s.x!==0&&Math.sign(x)!==Math.sign(s.x)&&(x=-x),s.y!==0&&Math.sign(T)!==Math.sign(s.y)&&(T=-T),{x,y:T}}else if(c>90&&c<180){let l=(c-90)*Math.PI/180,u=Math.cos(l),y=Math.sin(l),x=-s.y*y-s.x*u,T=s.y*u-s.x*y;return s.x!==0&&Math.sign(x)!==Math.sign(s.x)&&(x=-x),s.y!==0&&Math.sign(T)!==Math.sign(s.y)&&(T=-T),{x,y:T}}else if(c>180&&c<270){let l=(c-180)*Math.PI/180,u=Math.cos(l),y=Math.sin(l),x=-s.x*u+s.y*y,T=-s.x*y-s.y*u;return s.x!==0&&Math.sign(x)!==Math.sign(s.x)&&(x=-x),s.y!==0&&Math.sign(T)!==Math.sign(s.y)&&(T=-T),{x,y:T}}else if(c>270&&c<360){let l=(c-270)*Math.PI/180,u=Math.cos(l),y=Math.sin(l),x=s.y*y-s.x*u,T=-s.y*u-s.x*y;return s.x!==0&&Math.sign(x)!==Math.sign(s.x)&&(x=-x),s.y!==0&&Math.sign(T)!==Math.sign(s.y)&&(T=-T),{x,y:T}}return {x:0,y:0}}d.getSuperPoint=r;function a(s,c){if(c=c%360,c<0&&(c+=360),c===0)return {x:s.x,y:s.y};if(c===90)return {x:s.y,y:-s.x};if(c===180)return {x:-s.x,y:-s.y};if(c===270)return {x:-s.y,y:s.x};if(c>0&&c<90){let l=c*Math.PI/180,u=Math.cos(l),y=Math.sin(l);return {x:s.x*u+s.y*y,y:-s.x*y+s.y*u}}else if(c>90&&c<180){let l=(c-90)*Math.PI/180,u=Math.cos(l),y=Math.sin(l);return {x:s.y*u-s.x*y,y:-s.y*y-s.x*u}}else if(c>180&&c<270){let l=(c-180)*Math.PI/180,u=Math.cos(l),y=Math.sin(l);return {x:-s.x*u-s.y*y,y:s.x*y-s.y*u}}else if(c>270&&c<360){let l=(c-270)*Math.PI/180,u=Math.cos(l),y=Math.sin(l);return {x:-s.y*u+s.x*y,y:s.y*y+s.x*u}}return {x:0,y:0}}d.getPointBySuperPoint=a;function o(s){let c=s.width,l=s.height,u=s.angle%360;return u<0&&(u+=360),u===0||u===180?c:u===90||u===270?l:Math.abs(c*Math.cos(u*Math.PI/180))+Math.abs(l*Math.sin(u*Math.PI/180))}d.getSuperWidth=o;function p(s){let c=s.width,l=s.height,u=s.angle%360;return u<0&&(u+=360),u===0||u===180?l:u===90||u===270?c:Math.abs(l*Math.cos(u*Math.PI/180))+Math.abs(c*Math.sin(u*Math.PI/180))}d.getSuperHeight=p;})(h||={});async function N(t){if(t!=="EMPTY"){if(!t)throw r.error("Texture not found",t),new PixiError("unregistered_asset","Texture not found");if(B.Assets.cache.has(t)){let e=B.Assets.get(t);if(e)return e}return B.Assets.load(t).then(e=>{if(!e)throw r.error("Texture not found",t),new PixiError("unregistered_asset","Texture not found");if(!(e instanceof B.Texture))throw r.error("File is not a Texture",t),new PixiError("unregistered_asset","File is not a Texture");return e}).catch(e=>{throw r.error("Error loading file",e),new PixiError("unknown_element","Error loading file")})}}function A(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 H=class t extends B.Sprite{constructor(e){if(e instanceof B.Texture)super(e);else {let{align:i,percentagePosition:n,...r}=A(e)||{};super(r),i&&(this.align=i),n&&(this.percentagePosition=n);}this.pixivnId=this.constructor.prototype.pixivnId||h$1;}pixivnId=h$1;get memory(){return {...xe(this),pixivnId:this.pixivnId,align:this._align,percentagePosition:this._percentagePosition}}async setMemory(e){return await ne(this,e)}static from(e,i){let n=B.Sprite.from(e,i),r=new t;return r.texture=n.texture,r}onEventsHandlers={};on(e,i,n){return O(e,this,i),super.on(e,(...r)=>i(...r,this),n)}_align=void 0;set align(e){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),typeof e=="number"?(this._align.x=e,this._align.y=e):(e.x!==void 0&&(this._align.x=e.x),e.y!==void 0&&(this._align.y=e.y)),this.reloadPosition();}get align(){let e=h.getSuperPoint(this.pivot,this.angle),i=h.getSuperPoint(this.scale,this.angle);return {x:h.calculateAlignByPosition("width",this.x,h.getSuperWidth(this),e.x,i.x<0,this.anchor.x),y:h.calculateAlignByPosition("height",this.y,h.getSuperHeight(this),e.y,i.y<0,this.anchor.y)}}set xAlign(e){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),this._align.x=e,this.reloadPosition();}get xAlign(){let e=h.getSuperPoint(this.pivot,this.angle),i=h.getSuperPoint(this.scale,this.angle);return h.calculateAlignByPosition("width",this.x,h.getSuperWidth(this),e.x,i.x<0,this.anchor.x)}set yAlign(e){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),this._align.y=e,this.reloadPosition();}get yAlign(){let e=h.getSuperPoint(this.pivot,this.angle),i=h.getSuperPoint(this.scale,this.angle);return h.calculateAlignByPosition("height",this.y,h.getSuperHeight(this),e.y,i.y<0,this.anchor.y)}_percentagePosition=void 0;set percentagePosition(e){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),typeof e=="number"?(this._percentagePosition.x=e,this._percentagePosition.y=e):(e.x!==void 0&&(this._percentagePosition.x=e.x),e.y!==void 0&&(this._percentagePosition.y=e.y)),this.reloadPosition();}get percentagePosition(){return {x:h.calculatePercentagePositionByPosition("width",this.x),y:h.calculatePercentagePositionByPosition("height",this.y)}}get percentageX(){return h.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 h.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=h.getSuperPoint(this.pivot,this.angle),i=h.getSuperPoint(this.scale,this.angle);this._align.x!==void 0&&(super.x=h.calculatePositionByAlign("width",this._align.x,h.getSuperWidth(this),e.x,i.x<0,this.anchor.x)),this._align.y!==void 0&&(super.y=h.calculatePositionByAlign("height",this._align.y,h.getSuperHeight(this),e.y,i.y<0,this.anchor.y));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=h.calculatePositionByPercentagePosition("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=h.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;}};k.add(H,{name:h$1,copyProperty:async(t,e)=>{await ne(t,e,{ignoreTexture:true});}});async function ne(t,e,i){e=A(e);let n=i?.ignoreTexture||false;if(await S(t,e),!n){let a;if("textureData"in e&&e.textureData&&(a=e.textureData),a&&a.url!=="EMPTY"){let o=a.url;a.alias&&B.Assets.resolver.hasKey(a.alias)&&(o=a.alias);try{let p=await N(o);p&&(t.texture=p);}catch(p){r.error("Error in Sprite.setMemorySprite() while loading texture"),p=new PixiError("unregistered_asset",`Error loading image ${o}`,"canvas",e),GameUnifier.runOnError(p,{});}}}let r$1=i?.half;r$1&&await r$1(),"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 v=class t extends H{_textureAlias;get textureAlias(){return this._textureAlias?this._textureAlias:this.texture.source.label}pixivnId=g$1;constructor(e,i){super(e),i&&(this._textureAlias=i);}get memory(){return {...super.memory,pixivnId:this.pixivnId,loadIsStarted:this._loadIsStarted}}async setMemory(e){let i;"textureData"in e&&e.textureData&&(i=e.textureData),"assetsData"in e&&Array.isArray(e.assetsData)&&e.assetsData.length>0&&(i=e.assetsData[0]),i&&i.alias&&(this._textureAlias=i.alias),await se(this,e),this.reloadPosition();}static from(e,i){let n=B.Sprite.from(e,i),r=new t;return r.texture=n.texture,r}_loadIsStarted=false;get loadIsStarted(){return this._loadIsStarted}async load(){return this._loadIsStarted=true,N(this.textureAlias).then(e=>{this._loadIsStarted=false,e&&(this.texture=e);}).catch(e=>{this._loadIsStarted=false,r.error("Error into ImageSprite.load()"),e=new PixiError("unregistered_asset",`Error loading image ${this.textureAlias}`,"canvas",{...this.memory,label:this.textureAlias},this),GameUnifier.runOnError(e,{});})}set texture(e){super.texture=e,this.reloadPosition();}get texture(){return super.texture}get haveEmptyTexture(){return this.texture._source.label==="EMPTY"}};k.add(v,{name:g$1,copyProperty:async(t,e)=>{await se(t,e,{ignoreTexture:true});}});async function se(t,e,i){return await ne(t,e,{half:async()=>{"loadIsStarted"in e&&e.loadIsStarted&&await t.load();},ignoreTexture:i?.ignoreTexture})}var M=class t extends v{constructor(e,i){if(e instanceof B.Texture){super(e,i);return}let{loop:n,paused:r,currentTime:a,...o}=e||{};super(o,i),n&&(this.loop=n),r&&(this.paused=r),a&&(this.currentTime=a);}pixivnId=j;get memory(){return {...super.memory,pixivnId:this.pixivnId,loop:this.loop,paused:this._paused,currentTime:this.currentTime}}async setMemory(e){await ze(this,e),this.reloadPosition();}static from(e,i){let n=B.Sprite.from(e,i),r=new t;return r.texture=n.texture,r}async load(){await super.load(),this.loop=this._looop,this.currentTime=this._currentTime,this.paused=this._paused;}_looop=false;get loop(){return this.texture?.source?.resource?.loop||false}set loop(e){this._looop=e,this.texture?.source?.resource&&(this.texture.source.resource.loop=e);}_paused=false;get paused(){return this.texture?.source?.resource?.paused||false}set paused(e){e?this.pause():this.play();}pause(){this._paused=true,this.texture?.source?.resource&&this.texture.source.resource.pause();}play(){this._paused=false,this.texture?.source?.resource?.play&&typeof this.texture.source.resource.play=="function"&&this.texture.source.resource.play();}_currentTime=0;get currentTime(){return this.texture?.source?.resource?.currentTime||0}set currentTime(e){let i=this.duration;i&&e>=i&&(e=0),this._currentTime=e,this.texture?.source?.resource&&(this.texture.source.resource.currentTime=e);}restart(){this.currentTime=0;}get duration(){if(this.texture?.source?.resource)return this.texture.source.resource.duration||0}};k.add(M,{name:j,getInstance:async(t,e)=>{let i;"textureData"in e&&e.textureData&&(i=e.textureData);let n=new t(void 0,i?.alias);return await n.setMemory(e),n},copyProperty:async(t,e)=>{await ze(t,e,{ignoreTexture:true});}});async function ze(t,e,i){await se(t,e,{ignoreTexture:i?.ignoreTexture}),"loop"in e&&e.loop!==void 0&&(t.loop=e.loop),"currentTime"in e&&e.currentTime!==void 0&&(t.currentTime=e.currentTime),"paused"in e&&e.paused!==void 0&&(t.paused=e.paused);}var _=class extends Container{constructor(e$1){let{anchor:i,align:n,percentagePosition:r,...a}=A(e$1)||{};super(a),this.pixivnId=this.constructor.prototype.pixivnId||e,i&&(this.anchor=i),n&&(this.align=n),r&&(this.percentagePosition=r);}pixivnId=e;get memory(){return {...L(this,{childrenExport:true}),anchor:this._anchor?this.anchor:void 0,align:this._align,percentagePosition:this._percentagePosition}}async setMemory(e){await this.importChildren(e),await S(this,e),this.reloadAnchor(),this.reloadPosition();}async importChildren(e){for(let i=0;i<e.elements.length;i++){let n=e.elements[i],r=await J(n);this.addChild(r);}}onEventsHandlers={};on(e,i,n){return O(e,this,i),super.on(e,(...r)=>i(...r,this),n)}_anchor;get anchor(){let e=super.pivot.x/this.width,i=super.pivot.y/this.height;return {x:e,y:i}}set anchor(e){typeof e=="number"?this._anchor={x:e,y:e}:this._anchor=e,this.reloadAnchor();}reloadAnchor(){this._anchor&&super.pivot.set(this._anchor.x*this.width,this._anchor.y*this.height);}get pivot(){return super.pivot}set pivot(e){this._anchor=void 0,super.pivot=e;}_align=void 0;set align(e){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),typeof e=="number"?(this._align.x=e,this._align.y=e):(e.x!==void 0&&(this._align.x=e.x),e.y!==void 0&&(this._align.y=e.y)),this.reloadPosition();}get align(){let e=h.getSuperPoint(this.pivot,this.angle),i=h.getSuperPoint(this.scale,this.angle);return {x:h.calculateAlignByPosition("width",this.x,h.getSuperWidth(this),e.x,i.x<0),y:h.calculateAlignByPosition("height",this.y,h.getSuperHeight(this),e.y,i.y<0)}}set xAlign(e){this._percentagePosition&&(this._percentagePosition=void 0),this._align===void 0&&(this._align={}),this._align.x=e,this.reloadPosition();}get xAlign(){let e=h.getSuperPoint(this.pivot,this.angle),i=h.getSuperPoint(this.scale,this.angle);return h.calculateAlignByPosition("width",this.x,h.getSuperWidth(this),e.x,i.x<0)}set yAlign(e){this._percentagePosition&&(this._percentagePosition=void 0),this._align===void 0&&(this._align={}),this._align.y=e,this.reloadPosition();}get yAlign(){let e=h.getSuperPoint(this.pivot,this.angle),i=h.getSuperPoint(this.scale,this.angle);return h.calculateAlignByPosition("height",this.y,h.getSuperHeight(this),e.y,i.y<0)}_percentagePosition=void 0;set percentagePosition(e){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),typeof e=="number"?(this._percentagePosition.x=e,this._percentagePosition.y=e):(e.x!==void 0&&(this._percentagePosition.x=e.x),e.y!==void 0&&(this._percentagePosition.y=e.y)),this.reloadPosition();}get percentagePosition(){return {x:h.calculatePercentagePositionByPosition("width",this.x),y:h.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 h.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 h.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=h.getSuperPoint(this.pivot,this.angle),i=h.getSuperPoint(this.scale,this.angle);this._align.x!==void 0&&(super.x=h.calculatePositionByAlign("width",this._align.x,h.getSuperWidth(this),e.x,i.x<0)),this._align.y!==void 0&&(super.y=h.calculatePositionByAlign("height",this._align.y,h.getSuperHeight(this),e.y,i.y<0));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=h.calculatePositionByPercentagePosition("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=h.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;}};k.add(_,{name:e,copyProperty:async(t,e)=>await S(t,e)});var yt=new Set(["mp4","webm","ogg","ogv","avi","mov","wmv","flv","mkv","m4v","3gp","3g2","ts","mts"]);function U(t){let e=B.Assets.cache.has(t)?B.Assets.get(t):null;return e instanceof B.Texture&&(t=e.source?.label||t),xt(t)}function xt(t){let e=t.split(".").pop()?.toLowerCase();return e!==void 0&&yt.has(e)}var P=class extends _{constructor(e,i){let{anchor:n,align:r,percentagePosition:a,...o}=A(e)||{};super(o),i&&i.forEach(p=>{U(p)?this.addChild(new M(void 0,p)):this.addChild(new v(void 0,p));}),n&&(this.anchor=n),r&&(this.align=r),a&&(this.percentagePosition=a);}get memory(){return {...super.memory,pixivnId:f$1,loadIsStarted:this._loadIsStarted}}async setMemory(e){await this.importChildren(e),await Ve(this,e),this.reloadAnchor(),this.reloadPosition();}pixivnId=f$1;_loadIsStarted=false;get loadIsStarted(){return this._loadIsStarted}async load(){this._loadIsStarted=true;let e=this.children.map(i=>i.load());return Promise.all(e).then(()=>{this._loadIsStarted=false,this.reloadAnchor(),this.reloadPosition();}).catch(i=>{this._loadIsStarted=false,r.error("Error into ImageContainer.load()",i);})}get texture(){return this.children.length>0?this.children[0].texture:new B.Texture}get haveEmptyTexture(){return this.children.some(e=>e.texture._source.label==="EMPTY")}};k.add(P,{name:f$1,copyProperty:async(t,e)=>await Ve(t,e)});async function Ve(t,e){e=A(e)||{},S(t,e,{end:async()=>{"loadIsStarted"in e&&e.loadIsStarted&&await t.load();}});}var ae=class{constructor(...e){}get memory(){throw new PixiError("not_implemented","The method CanvasBaseItem.memory must be overridden")}setMemory(e){throw new PixiError("not_implemented","The method CanvasBaseItem.setMemory must be overridden")}pixivnId="canvas_element_id_not_set"};var z=class extends B.Text{constructor(e){let{align:i$1,percentagePosition:n,...r}=A(e)||{};super(r),this.pixivnId=this.constructor.prototype.pixivnId||i,i$1&&(this.align=i$1),n&&(this.percentagePosition=n);}pixivnId=i;get memory(){return {...Te(this),pixivnId:this.pixivnId,align:this._align,percentagePosition:this._percentagePosition}}async setMemory(e){await Pt(this,e),this.reloadPosition();}onEventsHandlers={};on(e,i,n){return O(e,this,i),super.on(e,(...r)=>i(...r,this),n)}_align=void 0;set align(e){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),typeof e=="number"?(this._align.x=e,this._align.y=e):(e.x!==void 0&&(this._align.x=e.x),e.y!==void 0&&(this._align.y=e.y)),this.reloadPosition();}get align(){let e=h.getSuperPoint(this.pivot,this.angle),i=h.getSuperPoint(this.scale,this.angle);return {x:h.calculateAlignByPosition("width",this.x,h.getSuperWidth(this),e.x,i.x<0,this.anchor.x),y:h.calculateAlignByPosition("height",this.y,h.getSuperHeight(this),e.y,i.y<0,this.anchor.y)}}set xAlign(e){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),this._align.x=e,this.reloadPosition();}get xAlign(){let e=h.getSuperPoint(this.pivot,this.angle),i=h.getSuperPoint(this.scale,this.angle);return h.calculateAlignByPosition("width",this.x,h.getSuperWidth(this),e.x,i.x<0,this.anchor.x)}set yAlign(e){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),this._align.y=e,this.reloadPosition();}get yAlign(){let e=h.getSuperPoint(this.pivot,this.angle),i=h.getSuperPoint(this.scale,this.angle);return h.calculateAlignByPosition("height",this.y,h.getSuperHeight(this),e.y,i.y<0,this.anchor.y)}_percentagePosition=void 0;set percentagePosition(e){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),typeof e=="number"?(this._percentagePosition.x=e,this._percentagePosition.y=e):(e.x!==void 0&&(this._percentagePosition.x=e.x),e.y!==void 0&&(this._percentagePosition.y=e.y)),this.reloadPosition();}get percentagePosition(){return {x:h.calculatePercentagePositionByPosition("width",this.x),y:h.calculatePercentagePositionByPosition("height",this.y)}}get percentageX(){return h.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 h.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=h.getSuperPoint(this.pivot,this.angle),i=h.getSuperPoint(this.scale,this.angle);this._align.x!==void 0&&(super.x=h.calculatePositionByAlign("width",this._align.x,h.getSuperWidth(this),e.x,i.x<0,this.anchor.x)),this._align.y!==void 0&&(super.y=h.calculatePositionByAlign("height",this._align.y,h.getSuperHeight(this),e.y,i.y<0,this.anchor.y));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=h.calculatePositionByPercentagePosition("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=h.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;}};k.add(z,{name:i});async function Pt(t,e){"text"in e&&e.text!==void 0&&(t.text=e.text),await S(t,e,{end:()=>{"style"in e&&e.style!==void 0&&(t.style=e.style);}}),"anchor"in e&&e.anchor!==void 0&&(typeof e.anchor=="number"?t.anchor.set(e.anchor,e.anchor):t.anchor.set(e.anchor.x,e.anchor.y)),"resolution"in e&&e.resolution!==void 0&&(t.resolution=e.resolution),"anchor"in e&&e.anchor!==void 0&&(typeof e.anchor=="number"?t.anchor.set(e.anchor,e.anchor):t.anchor.set(e.anchor.x,e.anchor.y)),"align"in e&&e.align!==void 0&&(t.align=e.align),"percentagePosition"in e&&e.percentagePosition!==void 0&&(t.percentagePosition=e.percentagePosition),"roundPixels"in e&&e.roundPixels!==void 0&&(t.roundPixels=e.roundPixels);}async function It(t,e={},i){let n=f.find(t);if(!n){r.error(`The element with the alias ${t} does not exist. So the shake effect can't be applied.`);return}let r$1={x:n.position.x,y:n.position.y},{shakeType:a="horizontal",maxShockSize:o=10,shocksNumber:p=10,...d}=e,s=p-1;if(s<2){r.error("The number of shocks must be at least 3.");return}let c=Math.floor(s/2),l=Math.ceil(s/2),u=[];for(let T=0;T<c;T++){let C=o*(T+1)/c;a==="horizontal"?T%2!==0?u.push(r$1.x+C):u.push(r$1.x-C):T%2!==0?u.push(r$1.y+C):u.push(r$1.y-C);}let y=c%2===0;for(let T=l;T>0;T--){let C=o*(T+1)/(l-1);a==="horizontal"?T%2===0&&!y||T%2!==0&&y?u.push(r$1.x-C):u.push(r$1.x+C):T%2===0&&!y||T%2!==0&&y?u.push(r$1.y-C):u.push(r$1.y+C);}let x;if(a==="horizontal"?(u.push(r$1.x),x=f.animate(t,{x:u},d,i)):(u.push(r$1.y),x=f.animate(t,{y:u},d,i)),x)return [x]}function oe(t,e,i){let n={...f.find(t)?.memory,...i},r=new P(i,e);return n&&f.copyCanvasElementProperty(n,r),f.add(t,r,{ignoreOldStyle:true,zIndex:i?.zIndex}),r}async function kt(t,e,i){let n={...f.find(t)?.memory,...i},r=new P(i,e);return r.label=t,await r.load(),n&&f.copyCanvasElementProperty(n,r),f.add(t,r,{ignoreOldStyle:true,zIndex:i?.zIndex}),r}function ce(t,e,i){if(!e)if(B.Assets.resolver.hasKey(t))e=t;else throw new PixiError("unregistered_asset",`The image ${t} does not exist in the cache.`,"canvas",{pixivnId:g$1,...i,label:t});let n={...f.find(t)?.memory,...i},r=new v(i,e);return n&&f.copyCanvasElementProperty(n,r),f.add(t,r,{ignoreOldStyle:true,zIndex:i?.zIndex}),r}async function Ct(t,e,i){if(!e)if(B.Assets.resolver.hasKey(t))e=t;else throw new PixiError("unregistered_asset",`The image ${t} does not exist in the cache.`,"canvas",{pixivnId:g$1,...i,label:t});let n={...f.find(t)?.memory,...i},r=new v(i,e);return r.label=t,await r.load(),n&&f.copyCanvasElementProperty(n,r),f.add(t,r,{ignoreOldStyle:true,zIndex:i?.zIndex}),r}function de(t,e,i){if(!e)if(B.Assets.resolver.hasKey(t))e=t;else throw new PixiError("unregistered_asset",`The video ${t} does not exist in the cache.`,"canvas",{pixivnId:j,...i,label:t});let n={...f.find(t)?.memory,...i},r=new M(i,e);return n&&f.copyCanvasElementProperty(n,r),f.add(t,r,{ignoreOldStyle:true,zIndex:i?.zIndex}),r}async function St(t,e,i){if(!e)if(B.Assets.resolver.hasKey(t))e=t;else throw new PixiError("unregistered_asset",`The video ${t} does not exist in the cache.`,"canvas",{pixivnId:j,...i,label:t});let n={...f.find(t)?.memory,...i},r=new M(i,e);return r.label=t,await r.load(),n&&f.copyCanvasElementProperty(n,r),f.add(t,r,{ignoreOldStyle:true,zIndex:i?.zIndex}),r}function Ie(t){switch(t.type){case "align":return {xAlign:t.x,yAlign:t.y};case "percentage":return {percentageX:t.x,percentageY:t.y};default:return {x:t.x,y:t.y}}}function F(t,e,i){if(typeof e=="string")return U(e)?de(t,e,i):ce(t,e,i);if(Array.isArray(e))return oe(t,e,i);if(typeof e=="object"&&"value"in e&&"options"in e){if(typeof e.value=="string")return U(e.value)?de(t,e.value,{...e.options,zIndex:i.zIndex}):ce(t,e.value,{...e.options,zIndex:i.zIndex});if(Array.isArray(e.value))return oe(t,e.value,{...e.options,zIndex:i.zIndex})}return f.add(t,e,i),e}async function qe(t,e,i={},n){let{completeOnContinue:r=true,tickerIdToResume:a=[],...o}=i,p=[];e||(e=t),typeof a=="string"&&(a=[a]);let d,s=f.find(t);if(s&&(d=`${t}_temp_disolve`,f.editAlias(t,d)),e=F(t,e,{zIndex:s?s.parent?.getChildIndex(s):void 0}),s?.parent?.setChildIndex(s,s.parent.getChildIndex(s)-.1),d&&f.copyCanvasElementProperty(d,t),d&&f.tickers.transfer(d,t,"duplicate"),e.alpha=0,d){let l=pe(d,{...i,autoplay:false,completeOnContinue:r},n);l&&(p.push(...l),a.push(...l));}let c=f.animate(t,{alpha:1},{...o,tickerIdToResume:a,completeOnContinue:r},n);if(c&&p.push(c),(e instanceof v||e instanceof P)&&e.haveEmptyTexture&&await e.load(),p.length>0)return p}function pe(t,e={},i){let{completeOnContinue:n=true,aliasToRemoveAfter:r=[],...a}=e;typeof r=="string"&&(r=[r]),r.push(t);let o=f.animate(t,{alpha:0},{...a,aliasToRemoveAfter:r,completeOnContinue:n},i);if(o)return [o]}async function bt(t,e,i={},n){let{completeOnContinue:r=true,aliasToRemoveAfter:a=[],...o}=i,p=[];e||(e=t),typeof a=="string"&&(a=[a]);let d=f.find(t);if(!d)return qe(t,e,i,n);let s=`${t}_temp_fade`;f.editAlias(t,s),a.push(s),e=F(t,e,{zIndex:d?d.parent?.getChildIndex(d):void 0}),d?.parent?.setChildIndex(d,d.parent.getChildIndex(d)-.1),s&&f.copyCanvasElementProperty(s,t),s&&f.tickers.transfer(s,t,"duplicate"),e.alpha=0;let c=f.animate(t,{alpha:1},{...o,aliasToRemoveAfter:a,completeOnContinue:r},n);if(c){let l=pe(s,{...i,tickerIdToResume:c,completeOnContinue:r},n);l&&p.push(...l),p.push(c),f.tickers.pause({id:c});}if((e instanceof v||e instanceof P)&&e.haveEmptyTexture&&await e.load(),p.length>0)return p}function At(t,e={},i){return pe(t,e,i)}async function Et(t,e,i={},n){let{direction:r="right",completeOnContinue:a=true,tickerIdToResume:o=[],aliasToRemoveAfter:p=[],removeOldComponentWithMoveOut:d,...s}=i,c=[],l;e||(e=t),typeof o=="string"&&(o=[o]),typeof p=="string"&&(p=[p]);let u,y=f.find(t);if(y&&(u=`${t}_temp_movein`,f.editAlias(t,u),y instanceof v||y instanceof P?l=y.positionInfo:l={x:y.x,y:y.y,type:"pixel"}),e=F(t,e,{zIndex:y?y.parent?.getChildIndex(y):void 0}),y?.parent?.setChildIndex(y,y.parent.getChildIndex(y)-.1),u&&f.copyCanvasElementProperty(u,t),u&&f.tickers.transfer(u,t,"move"),l||(e instanceof v||e instanceof P?l=e.positionInfo:l={x:e.x,y:e.y,type:"pixel"}),u)if(d){let C=ke(u,{...i,autoplay:false,completeOnContinue:a},n);C&&(c.push(...C),o.push(...C));}else p.push(u);switch((e instanceof v||e instanceof P)&&e.haveEmptyTexture&&await e.load(),r){case "up":e.y=f.height+e.height;break;case "down":e.y=-e.height;break;case "left":e.x=f.width+e.width;break;case "right":e.x=-e.width;break}let x=f.tickers.pause({canvasAlias:t});o.push(...x);let T=f.animate(t,Ie(l),{...s,tickerIdToResume:o,aliasToRemoveAfter:p,completeOnContinue:a},n);if(T&&c.push(T),c.length>0)return c}function ke(t,e={},i){let{direction:n="right",completeOnContinue:r$1=true,aliasToRemoveAfter:a=[],...o}=e;typeof a=="string"&&(a=[a]),a.push(t);let p=f.find(t);if(!p){r.warn(`The canvas component "${t}" is not found.`);return}let d={x:p.x,y:p.y};switch(n){case "up":d.y=-p.height;break;case "down":d.y=f.height+p.height;break;case "left":d.x=-p.width;break;case "right":d.x=f.width+p.width;break}f.tickers.pause({canvasAlias:t});let s=f.animate(t,d,{...o,aliasToRemoveAfter:a,completeOnContinue:r$1},i);if(s)return [s]}async function Mt(t,e,i={},n){let{direction:r="right",completeOnContinue:a=true,tickerIdToResume:o=[],aliasToRemoveAfter:p=[],...d}=i,s=[],c;e||(e=t),typeof o=="string"&&(o=[o]),typeof p=="string"&&(p=[p]);let l,u=f.find(t);u&&(l=`${t}_temp_zoom`,f.editAlias(t,l),u instanceof v||u instanceof P?c=u.positionInfo:c={x:u.x,y:u.y,type:"pixel"}),e=F(t,e,{zIndex:u?u.parent?.getChildIndex(u):void 0}),u?.parent?.setChildIndex(u,u.parent.getChildIndex(u)-.1),l&&f.copyCanvasElementProperty(l,t),l&&f.tickers.transfer(l,t,"move"),c||(e instanceof v||e instanceof P?c=e.positionInfo:c={x:e.x,y:e.y,type:"pixel"});let y={x:e.pivot.x,y:e.pivot.y},x={x:e.scale.x,y:e.scale.y};if(l)if(i.removeOldComponentWithZoomOut){let le=Ge(l,{...i,autoplay:false,completeOnContinue:a},n);le&&(s.push(...le),o.push(...le));}else p.push(l);(e instanceof v||e instanceof P)&&e.haveEmptyTexture&&await e.load(),r==="up"?(e.pivot.y=f.height-e.y,e.pivot.x=f.width/2-e.x,e.y=f.height,e.x=f.width/2):r==="down"?(e.pivot.y=0-e.y,e.pivot.x=f.width/2-e.x,e.y=0,e.x=f.width/2):r==="left"?(e.pivot.x=f.width-e.x,e.pivot.y=f.height/2-e.y,e.x=f.width,e.y=f.height/2):r==="right"&&(e.pivot.x=0-e.x,e.pivot.y=f.height/2-e.y,e.x=0,e.y=f.height/2),e.pivot=h.getPointBySuperPoint(e.pivot,e.angle),e.scale.set(0);let T=f.tickers.pause({canvasAlias:t});o.push(...T);let C=f.animate(t,{...Ie(c),pivotX:y.x,pivotY:y.y,scaleX:x.x,scaleY:x.y},{...d,tickerIdToResume:o,aliasToRemoveAfter:p,completeOnContinue:a},n);if(C&&s.push(C),s.length>0)return s}function Ge(t,e={},i){let{direction:n="right",completeOnContinue:r$1=true,aliasToRemoveAfter:a=[],...o}=e;typeof a=="string"&&(a=[a]),a.push(t);let p=f.find(t);if(!p){r.warn(`The canvas component "${t}" is not found.`);return}let d={x:p.x,y:p.y},s={x:p.pivot.x,y:p.pivot.y};n==="down"?(d.y=f.height,d.x=f.width/2,s.y=f.height-d.y,s.x=f.width/2-d.x):n==="up"?(d.y=0,d.x=f.width/2,s.y=0-d.y,s.x=f.width/2-d.x):n==="right"?(d.x=f.width,d.y=f.height/2,s.x=f.width-d.x,s.y=f.height/2-d.y):n==="left"&&(d.x=0,d.y=f.height/2,s.x=0-d.x,s.y=f.height/2-d.y),s=h.getPointBySuperPoint(s,p.angle),f.tickers.pause({canvasAlias:t});let c=f.animate(t,{...d,pivotX:s.x,pivotY:s.y,scaleX:0,scaleY:0},{...o,aliasToRemoveAfter:a,completeOnContinue:r$1},i);if(c)return [c]}async function _t(t,e,i={},n){let{direction:r="right",completeOnContinue:a=true,tickerIdToResume:o=[],...p}=i,d=[],s;e||(e=t),typeof o=="string"&&(o=[o]);let c,l=f.find(t);switch(l&&(c=`${t}_temp_push`,f.editAlias(t,c),l instanceof v||l instanceof P?s=l.positionInfo:s={x:l.x,y:l.y,type:"pixel"}),e=F(t,e,{zIndex:l?l.parent?.getChildIndex(l):void 0}),l?.parent?.setChildIndex(l,l.parent.getChildIndex(l)-.1),c&&f.copyCanvasElementProperty(c,t),c&&f.tickers.transfer(c,t,"move"),s||((e instanceof v||e instanceof P)&&e.haveEmptyTexture?s=e.positionInfo:s={x:e.x,y:e.y,type:"pixel"}),(e instanceof v||e instanceof P)&&e.haveEmptyTexture&&await e.load(),r){case "up":e.y=f.height+e.height;break;case "down":e.y=-e.height;break;case "left":e.x=f.width+e.width;break;case "right":e.x=-e.width;break}let u=f.tickers.pause({canvasAlias:t});if(o.push(...u),c){let x=Ne(c,{...i,direction:r,completeOnContinue:a});x&&d.push(...x);}let y=f.animate(t,Ie(s),{...p,tickerIdToResume:o,completeOnContinue:a},n);if(y&&d.push(y),d.length>0)return d}function Ne(t,e={direction:"right"},i){return ke(t,e,i)}var K=class extends _{constructor(i){super(i);this._memory=i;this.pixivnId=i.pixivnId;}_memory;pixivnId;get memory(){return {...this._memory,...super.memory,elements:[],pixivnId:this.pixivnId}}};function wt(){return async(e,i)=>{try{let n=e.canvasElementInfo;if(n){let r=new K(n),a=n.zIndex;r.groupColor=16711680;let o=new B.Graphics;o.rect(0,0,300,100).fill({color:16711680,alpha:.5}),r.addChild(o);let p=new B.Text({text:`Error: ${n.label}`,x:10,y:10});r.addChild(p);let d=e.parent;if(d&&"addChild"in d)a!==void 0?d.addChildAt(r,a):d.addChild(r);else {let s=n.parentLabel?f.find(n.parentLabel):void 0;if(s)a!==void 0?s.addChildAt(r,a):s.addChild(r);else {let c=n.label??n.pixivnId;f.add(c,r,{zIndex:a});}}}}catch{}}}function Ot(t,e,i){let n={...f.find(t)?.memory,...i},r=new z({text:e,...i});return n&&f.copyCanvasElementProperty(n,r),f.add(t,r,{ignoreOldStyle:true,zIndex:i?.zIndex}),r}var {Assets:Mn,Color:_n,Rectangle:wn,TextStyle:On,Texture:Bn,UPDATE_PRIORITY:Ln}=B,f=new G;I.init({getScreen:()=>f.screen});GameUnifier.addOnPreContinue(async()=>{try{let t=g._tickersToCompleteOnStepEnd.tikersIds,e=g._tickersToCompleteOnStepEnd.stepAlias,i=(async()=>{for(;t.length;){let{id:r}=t.pop()||{};r&&await f.tickers.forceCompletion(r);}})(),n=(async()=>{for(;e.length;){let{alias:r,id:a}=e.pop()||{};r&&a&&await f.tickers.forceCompletion(a,r);}})();await Promise.all([i,n]),g._tickersToCompleteOnStepEnd.tikersIds.length=0,g._tickersToCompleteOnStepEnd.stepAlias.length=0;}catch{}});
2
- export{Mn as Assets,ae as CanvasBaseItem,g as CanvasManagerStatic,h as CanvasPropertyUtility,_n as Color,_ as Container,P as ImageContainer,v as ImageSprite,wn as Rectangle,k as RegisteredCanvasComponents,ge as RegisteredEvents,D as RegisteredTickers,H as Sprite,z as Text,On as TextStyle,Bn as Texture,ee as TickerBase,Ln as UPDATE_PRIORITY,M as VideoSprite,ce as addImage,oe as addImageCointainer,O as addListenerHandler,de as addVideo,A as analizePositionsExtensionProps,f as canvas,Je as canvasComponentDecorator,wt as drawCanvasErrorHandler,Ze as eventDecorator,N as getTexture,Et as moveIn,ke as moveOut,_t as pushIn,Ne as pushOut,pe as removeWithDissolve,At as removeWithFade,S as setMemoryContainer,It as shakeEffect,Ct as showImage,kt as showImageContainer,Ot as showText,St as showVideo,qe as showWithDissolve,bt as showWithFade,ct as tickerDecorator,Mt as zoomIn,Ge as zoomOut};
1
+ import'./chunk-JMOSOAGB.mjs';import {e,d as d$1,g,b as b$1,c,f,a}from'./chunk-HD353M4B.mjs';import {a as a$1}from'./chunk-S7HZUIEI.mjs';import {d,e as e$1}from'./chunk-AW5XWF24.mjs';import {GameUnifier,PixiError}from'@drincs/pixi-vn/core';import be,{Container,Graphics}from'@drincs/pixi-vn/pixi.js';import {drainCompleteOnStepEndQueue,tickers as tickers$1,removeTicker,TickersManagerStatic,RegisteredTickers,runTickersSequence}from'@drincs/pixi-vn/tickers';export*from'@drincs/pixi-vn/tickers';import {initDevtools}from'@pixi/devtools';import {RegisteredFilters,filters}from'@drincs/pixi-vn/filters';var Jt={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}}}]}},Rt=Jt;function kt(t,e){let n=0;return async(...s)=>{let o=Date.now();if(o-n>=e)return n=o,await t(...s)}}var ie=class t{constructor(){}static _app=void 0;static get app(){if(!t._app)throw e$1.error("The canvas is not initialized"),new PixiError("invalid_usage","CanvasManagerStatic.app is undefined");return t._app}static get gameLayer(){let e=t.app.stage.getChildByLabel(a);return e||(e=new be.Container,e.label=a,t.app.stage.addChild(e)),e}static htmlLayers=[];static canvasWidth=300;static canvasHeight=300;static _isInitialized=false;static async init(e,n,s){let{id:o="pixi-vn-canvas",width:g=800,height:I=600,resolution:R=1,autoDensity:_=true,resizeMode:f="contain",...v}=n||{};return t.canvasWidth=g,t.canvasHeight=I,t._app=new be.Application,t.app.init({width:g,height:I,resolution:R,autoDensity:_,...v}).then(()=>{let{app:A=t.app,extensions:w=[],...H}=s||{};if(initDevtools({app:A,extensions:[Rt,...w],...H}),t._isInitialized=true,t.addCanvasIntoHTMLElement(e,o),f==="contain"){let X=kt(async()=>{requestAnimationFrame(()=>t.resize());},10);new ResizeObserver(X).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):e$1.error("GameWindowManager is not initialized");}static addHtmlLayer(e,n,s={}){let{position:o="absolute",pointerEvents:g="none",userSelect:I="none"}=s,R=document.createElement("div");R.setAttribute("id",e),R.style.position=o,R.style.pointerEvents=g,R.style.userSelect=I;let _=n.appendChild(R);return t.htmlLayers.push(R),t.resize(),_}static removeHtmlLayer(e){let n=t.htmlLayers.find(s=>s.id===e);n&&(n.remove(),t.htmlLayers=t.htmlLayers.filter(s=>s.id!==e));}static getHtmlLayer(e){return t.htmlLayers.find(n=>n.id===e)}static async resize(){let e=t.canvasWidth,n=t.canvasHeight,s=t.app.resizeTo,o=t.app.canvas.style;s instanceof HTMLElement||(s=document.documentElement);let g,I;if(s===document.body||s===document.documentElement)g=document.documentElement.clientWidth||window.innerWidth,I=document.documentElement.clientHeight||window.innerHeight;else {let w=s.getBoundingClientRect();g=w.width||s.clientWidth,I=w.height||s.clientHeight;}let R=Math.min(g/e,I/n),_=Math.floor(R*e),f=Math.floor(R*n);o.width=`${_}px`,o.height=`${f}px`;let v=(g-_)/2,A=(I-f)/2;o.marginLeft=`${v}px`,o.marginRight=`${v}px`,o.marginTop=`${A}px`,o.marginBottom=`${A}px`,t.htmlLayers.forEach(w=>{w.style.width=`${_}px`,w.style.height=`${f}px`,w.style.marginLeft=`${v}px`,w.style.marginRight=`${v}px`,w.style.marginTop=`${A}px`,w.style.marginBottom=`${A}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 ot=Symbol("SerializableEvent"),De=new d({cacheSize:5});function tn(t){return (e,n,s)=>{let o=s.value;at.add(o,t||`${n}`);}}var at;(g=>{function t(I,R){I[ot]=R,De.get(R)&&e$1.info(`Event "${R}" already exists, it will be overwritten`),De.set(R,I);}g.add=t;function e(I){try{let R=De.get(I);if(!R){e$1.error(`Event "${I}" not found, did you forget to register it with the eventDecorator?`);return}return R}catch(R){e$1.error(`Error while getting Event "${I}"`,R);return}}g.get=e;function n(){return Array.from(De.values())}g.values=n;function s(I){return De.has(I)}g.has=s;function o(){return Array.from(De.keys())}g.keys=o;})(at||={});var ct=at;async function Dt(t,e){if("onEvents"in e)for(let n in e.onEvents){let s=e.onEvents[n],o=ct.get(s);o&&t.on(n,o);}}function Ft(t){let{onEventsHandlers:e={}}=t;return e}function Ce(t,e,n){let s=n[ot];return s&&typeof s=="string"?(e.onEventsHandlers[t]=s,true):(e$1.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 Fe=new d({cacheSize:5}),Lt=new d({cacheSize:2}),Yt=new d({cacheSize:2});function rn(t={}){return e=>{dt.add(e,t);}}async function fe(t,e,n){let s=n?.ignoreScale||false,o=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),!s&&"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),Dt(t,e),"pixivnFilters"in e&&e.pixivnFilters!==void 0){let g=e.pixivnFilters.map(I=>RegisteredFilters.getInstance(I.filterId,I.args)).filter(I=>!!I);t.filters=g.length>0?g:null;}"align"in e&&e.align!==void 0&&"align"in t&&(t.align=e.align),"percentagePosition"in e&&e.percentagePosition!==void 0&&"percentagePosition"in t&&(t.percentagePosition=e.percentagePosition),o&&await o(),s||("width"in e&&e.width!==void 0&&(t.width=e.width),"height"in e&&e.height!==void 0&&(t.height=e.height));}var dt;(R=>{function t(_,f={}){let{name:v=_.name,getInstance:A=async(H,X)=>{let Z=new H;return await Z.setMemory(X),Z},copyProperty:w=async(H,X)=>{await H.setMemory(X);}}=f;Fe.get(v)&&e$1.warn(`CanvasElement "${v}" already registered`),_.prototype.pixivnId=v,Fe.set(v,_),Lt.set(v,A),Yt.set(v,w);}R.add=t;function e(_){let f=Fe.get(_);if(!f){e$1.error(`CanvasElement "${_}" not found, did you forget to register it with the canvasComponentDecorator?`);return}return f}R.get=e;async function n(_,f){let v=e(_),A=Lt.get(_);if(!v||!A){e$1.error(`CanvasElement "${_}" not found, did you forget to register it with the canvasComponentDecorator?`);return}try{return await A(v,f)}catch(w){e$1.error(`Error while getting CanvasElement instance "${_}"`,w);}}R.getInstance=n;async function s(_,f,v){let A=Yt.get(_);if(!A){e$1.error(`CanvasElement "${_}" not found, did you forget to register it with the canvasComponentDecorator?`);return}try{await A(f,v);}catch(w){e$1.error(`Error while copying properties of CanvasElement "${_}"`,w);}}R.copyProperty=s;function o(){return Array.from(Fe.values())}R.values=o;function g(_){return Fe.has(_)}R.has=g;function I(){return Array.from(Fe.keys())}R.keys=I;})(dt||={});var ae=dt;async function Ve(t){let e=await ae.getInstance(t.pixivnId,t);if(!e)throw new PixiError("unregistered_element",`The element ${t.pixivnId} could not be created`,"canvas",t);return e}function pt(t){return "memory"in t?t.memory:t instanceof be.Text?lt(t):t instanceof be.Sprite?ft(t):we(t)}function an(t){let e=t.parent;return {width:t.width,height:t.height,isRenderGroup:t.isRenderGroup,blendMode:t.blendMode,tint:t.tint,alpha:t.alpha,angle:t.angle,renderable:t.renderable,rotation:t.rotation,scale:{x:t.scale.x,y:t.scale.y},pivot:{x:t.pivot.x,y:t.pivot.y},position:{x:t.position.x,y:t.position.y},skew:{x:t.skew.x,y:t.skew.y},visible:t.visible,x:t.x,y:t.y,boundsArea:t.boundsArea,cursor:t.cursor,eventMode:t.eventMode,interactive:t.interactive,interactiveChildren:t.interactiveChildren,hitArea:t.hitArea,index:e?.getChildIndex(t),parentLabel:e?.label,label:t.label,pixivnFilters:cn(t.filters)}}function cn(t){if(!t)return;let e=Array.isArray(t)?t:[t],n=[];for(let s of e){let o=s.pixivnFilterId;if(!o){e$1.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.",s);continue}let g=RegisteredFilters.toMemory(o,s);g&&n.push(g);}return n}function ut(t,e){return {url:t.source.label,alias:e===t.source.label?void 0:e}}function we(t,e){let n=dn(t,b$1),o=e?.childrenExport||false?t.children.sort((g,I)=>t.getChildIndex(g)-t.getChildIndex(I)).map(g=>pt(g)):[];return {pixivnId:n,elements:o,onEvents:Ft(t),...an(t)}}function ft(t){let e$1=we(t),n=e$1.pixivnId??e,s="assetsAliases"in t&&Array.isArray(t.assetsAliases)?ut(t.texture,t.assetsAliases[0]):"textureAlias"in t?ut(t.texture,t.textureAlias):ut(t.texture);return {...e$1,pixivnId:n,textureData:s,anchor:{x:t.anchor.x,y:t.anchor.y},roundPixels:t.roundPixels}}function lt(t){let e=we(t),n=e.pixivnId??f;return {...e,pixivnId:n,anchor:{x:t.anchor.x,y:t.anchor.y},text:t.text,resolution:t.resolution,style:ln(t.style),roundPixels:t.roundPixels}}function dn(t,e){return Object.hasOwn(t,"pixivnId")?t.pixivnId:e}function je(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 un(t){if(t!=null){{if(typeof t=="number")return t;if(typeof t=="string"||Array.isArray(t))return t;if(t instanceof be.FillGradient)return je(t);if(typeof t=="object"&&"fill"in t&&typeof t.fill!="function"&&t.fill){if(!(t.fill instanceof be.FillPattern))return je(t.fill)}}e$1.warn("Unsupported property type for Text.style.fill.",t);}}function pn(t){if(typeof t=="number")return t;if(typeof t=="string")return t;if(Array.isArray(t))return t;if(t instanceof be.Color)return t.toNumber();e$1.warn("Unsupported color type.",t);}function fn(t){if(t!=null){{if(typeof t=="number")return t;if(typeof t=="string"||Array.isArray(t))return t;if(t instanceof be.FillGradient)return je(t);if(typeof t=="object"&&"alignment"in t)return {alignment:t.alignment,alpha:t.alpha,color:pn(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 be.FillPattern))return je(t.fill)}}e$1.warn("Unsupported property type for Text.style.stroke.",t);}}function ln(t){return {align:t.align,breakWords:t.breakWords,dropShadow:t.dropShadow,fill:un(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:fn(t.stroke),textBaseline:t.textBaseline,trim:t.trim,whiteSpace:t.whiteSpace,wordWrap:t.wordWrap,wordWrapWidth:t.wordWrapWidth}}var Ye=class{tickersPausedByGameLayerRender=[];get app(){return ie.app}get gameLayer(){return ie.gameLayer}get isInitialized(){return ie._isInitialized}get width(){return ie.canvasWidth}get height(){return ie.canvasHeight}get screen(){return this.app.screen}async init(e,n,s){return await ie.init(e,n,s)}get children(){return ie.gameLayer.children}async copyCanvasElementProperty(e,n,s={}){let o=["isRenderGroup","scale","visible","boundsArea","text","resolution","style","height","width"],{ignoreProperties:g=_=>_}=s;if(typeof n=="string"){let _=this.find(n);if(_)n=_;else {e$1.error(`Canvas element ${n} not found`);return}}if(typeof e=="string"){let _=this.find(e);if(_)e=_;else {e$1.error(`Canvas element ${e} not found`);return}}e instanceof be.Container&&(e=e.memory);let I=g(o),R={...e};I.forEach(_=>{_ in R&&delete R[_];}),await ae.copyProperty(n.pixivnId,n,R);}add(e,n,s={}){if(e===a){e$1.error(`The alias ${a} is reserved`);return}let o=this.find(e),g=s?.ignoreOldStyle;o&&!g&&this.copyCanvasElementProperty(o,n);let{zIndex:I=o?.parent?.getChildIndex(o)}=s;o&&!this.canvasElementIsOnCanvas(o)?e$1.error(`The canvas element ${e} exist in the memory but it is not on the canvas, so the zIndex is not set`):o&&this.remove(e,{ignoreTickers:true}),I!==void 0?(n.label=e,this.gameLayer.addChildAt(n,I)):(n.label=e,this.gameLayer.addChild(n));}remove(e,n={}){if(e===a){e$1.error(`The alias ${a} is reserved`);return}let s=n.ignoreTickers;typeof e=="string"&&(e=[e]),e.forEach(o=>{this.gameLayer.getChildrenByLabel(o).forEach(g=>{this.gameLayer.removeChild(g),!s&&tickers$1.unlinkComponent(o);});});}find(e){if(e===a)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,s={}){let o=this.find(e);o&&(o.label=n),!s.ignoreTickers&&tickers$1.transfer(e,n,"move");}get currentTickers(){return this.tickers.currentTickers}get currentTickersSteps(){return this.tickers.currentTickersSteps}findTicker(e){return tickers$1.find(e)}addTicker(e,n){return tickers$1.add(e,n)}addTickersSequence(e,n,s=0){return tickers$1.addSequence(e,n,s)}onTickerComplete(e,n){return tickers$1.onComplete(e,n)}unlinkComponentFromTicker(e,n){return tickers$1.unlinkComponent(e,n)}removeAllTickers(){return tickers$1.removeAll()}removeTicker(e,n={stopTicker:true}){return removeTicker(e,n)}pauseTicker(e){return tickers$1.pause(e)}resumeTicker(e){return tickers$1.resume(e)}isTickerPaused(e,n){return tickers$1.isPaused(e,n)}pause(){this.gameLayer.renderable!==false&&(this.gameLayer.renderable=false,this.tickersPausedByGameLayerRender=tickers$1.pause({id:Array.from(TickersManagerStatic._currentTickers.keys())}));}resume(){if(this.gameLayer.renderable===true)return;this.gameLayer.renderable=true;let e=this.tickersPausedByGameLayerRender.filter(n=>TickersManagerStatic._currentTickers.has(n));e.length>0&&tickers$1.resume({id:e}),this.tickersPausedByGameLayerRender=[];}transferTickers(e,n,s="move"){return tickers$1.transfer(e,n,s)}completeTickerOnStepEnd(e){return tickers$1.completeOnStepEnd(e)}async forceCompletionOfTicker(e,n){return tickers$1.forceCompletion(e,n)}tickers=tickers$1;animate(e,n,s,o){return GameUnifier.animate(e,n,s,o)}addLayerInternal(e,n){if(e===a){e$1.error(`The alias ${a} is reserved`);return}return n.label=e,ie.app.stage.addChild(n)}getLayerInternal(e){return ie.app.stage.getChildByLabel(e)}removeLayerInternal(e){let n=ie.app.stage.getChildByLabel(e);n&&ie.app.stage.removeChild(n);}addHtmlLayerInternal(e,n,s){return ie.addHtmlLayer(e,n,s)}removeHtmlLayerInternal(e){return ie.removeHtmlLayer(e)}getHtmlLayerInternal(e){return ie.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,s){return this.addHtmlLayerInternal(e,n,s)}removeHtmlLayer(e){return this.removeHtmlLayerInternal(e)}getHtmlLayer(e){return this.getHtmlLayerInternal(e)}layers={get gameLayer(){return ie.gameLayer},add:(e,n)=>this.addLayerInternal(e,n),get:e=>this.getLayerInternal(e),remove:e=>this.removeLayerInternal(e)};htmlLayers={add:(e,n,s)=>this.addHtmlLayerInternal(e,n,s),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$1.removeAll(),this.removeAll();}export(){let e=this.gameLayer.renderable===false;e&&this.resume();try{let n={};return this.children.forEach(s=>{s.label&&(n[s.label]=pt(s));}),{tickers:a$1(TickersManagerStatic.currentTickersWithoutCreatedBySteps()),tickersSteps:a$1(TickersManagerStatic.currentTickersSequence()),elements:a$1(n),stage:a$1(we(this.gameLayer)),elementAliasesOrder:a$1(ie.childrenAliasesOrder),tickersToCompleteOnStepEnd:a$1(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,s={},o=Object.entries(e.elements).map(async([g,I])=>{s[g]=await Ve(I);});await Promise.all(o),n.forEach(g=>{let I=s[g];I&&this.add(g,I);});}else {e$1.error("The data does not have the properties elementAliasesOrder and elements");return}if(Object.hasOwn(e,"stage")&&Object.hasOwn(e,"stage")?fe(this.gameLayer,e.stage,{ignoreScale:!0}):e$1.error("The data does not have the properties stage"),Object.hasOwn(e,"tickers")){let n=e.tickers;Object.entries(n).forEach(([s,o])=>{let g=o.canvasElementAliases;if(g.length!==0){let I=RegisteredTickers.getInstance(o.id,o.args,{duration:o.duration,priority:o.priority,id:s,canvasElementAliases:g});I?(I.canvasElementAliases=g,tickers$1.add(g,I),o.paused&&I.pause()):e$1.error(`Ticker ${o.id} not found`);}});}if(Object.hasOwn(e,"tickersSteps")){let n=e.tickersSteps;Object.entries(n).forEach(([s,o])=>{TickersManagerStatic._currentTickersSequence.set(s,new Map(Object.entries(o))),Object.keys(o).forEach(g=>{runTickersSequence(s,g);});});}if(Object.hasOwn(e,"tickersToCompleteOnStepEnd")){let n=e.tickersToCompleteOnStepEnd,s=n.tikersIds,o=n.stepAlias.map(g=>({id:g.id,alias:g.alias}));TickersManagerStatic._tickersToCompleteOnStepEnd.tikersIds.length=0,TickersManagerStatic._tickersToCompleteOnStepEnd.tikersIds.push(...s),TickersManagerStatic._tickersToCompleteOnStepEnd.stepAlias.length=0,TickersManagerStatic._tickersToCompleteOnStepEnd.stepAlias.push(...o);}}catch(n){e$1.error("Error importing data",n);}}};var oe=class t{static init(e){t._getScreen=e.getScreen;}static _getScreen;static get screen(){return t._getScreen()}};var b;(_=>{function t(f,v,A,w,H,X=0){return H?f==="width"?v*(oe.screen.width-A)+A-w-X*A:v*(oe.screen.height-A)+A-w-X*A:f==="width"?v*(oe.screen.width-A)+w+X*A:v*(oe.screen.height-A)+w+X*A}_.calculatePositionByAlign=t;function e(f,v,A,w,H,X=0){return H?f==="width"?(v-A+w+X*A)/(oe.screen.width-A):(v-A+w+X*A)/(oe.screen.height-A):f==="width"?(v-w-X*A)/(oe.screen.width-A):(v-w-X*A)/(oe.screen.height-A)}_.calculateAlignByPosition=e;function n(f,v){return f==="width"?v*oe.screen.width:v*oe.screen.height}_.calculatePositionByPercentagePosition=n;function s(f,v){return f==="width"?v/oe.screen.width:v/oe.screen.height}_.calculatePercentagePositionByPosition=s;function o(f,v){if(v=v%360,v<0&&(v+=360),v===0)return {x:f.x,y:f.y};if(v===90)return {x:-f.y,y:f.x};if(v===180)return {x:-f.x,y:-f.y};if(v===270)return {x:f.y,y:-f.x};if(v>0&&v<90){let A=v*Math.PI/180,w=Math.cos(A),H=Math.sin(A),X=f.x*w-f.y*H,Z=f.x*H+f.y*w;return f.x!==0&&Math.sign(X)!==Math.sign(f.x)&&(X=-X),f.y!==0&&Math.sign(Z)!==Math.sign(f.y)&&(Z=-Z),{x:X,y:Z}}else if(v>90&&v<180){let A=(v-90)*Math.PI/180,w=Math.cos(A),H=Math.sin(A),X=-f.y*H-f.x*w,Z=f.y*w-f.x*H;return f.x!==0&&Math.sign(X)!==Math.sign(f.x)&&(X=-X),f.y!==0&&Math.sign(Z)!==Math.sign(f.y)&&(Z=-Z),{x:X,y:Z}}else if(v>180&&v<270){let A=(v-180)*Math.PI/180,w=Math.cos(A),H=Math.sin(A),X=-f.x*w+f.y*H,Z=-f.x*H-f.y*w;return f.x!==0&&Math.sign(X)!==Math.sign(f.x)&&(X=-X),f.y!==0&&Math.sign(Z)!==Math.sign(f.y)&&(Z=-Z),{x:X,y:Z}}else if(v>270&&v<360){let A=(v-270)*Math.PI/180,w=Math.cos(A),H=Math.sin(A),X=f.y*H-f.x*w,Z=-f.y*w-f.x*H;return f.x!==0&&Math.sign(X)!==Math.sign(f.x)&&(X=-X),f.y!==0&&Math.sign(Z)!==Math.sign(f.y)&&(Z=-Z),{x:X,y:Z}}return {x:0,y:0}}_.getSuperPoint=o;function g(f,v){if(v=v%360,v<0&&(v+=360),v===0)return {x:f.x,y:f.y};if(v===90)return {x:f.y,y:-f.x};if(v===180)return {x:-f.x,y:-f.y};if(v===270)return {x:-f.y,y:f.x};if(v>0&&v<90){let A=v*Math.PI/180,w=Math.cos(A),H=Math.sin(A);return {x:f.x*w+f.y*H,y:-f.x*H+f.y*w}}else if(v>90&&v<180){let A=(v-90)*Math.PI/180,w=Math.cos(A),H=Math.sin(A);return {x:f.y*w-f.x*H,y:-f.y*H-f.x*w}}else if(v>180&&v<270){let A=(v-180)*Math.PI/180,w=Math.cos(A),H=Math.sin(A);return {x:-f.x*w-f.y*H,y:f.x*H-f.y*w}}else if(v>270&&v<360){let A=(v-270)*Math.PI/180,w=Math.cos(A),H=Math.sin(A);return {x:-f.y*w+f.x*H,y:f.y*H+f.x*w}}return {x:0,y:0}}_.getPointBySuperPoint=g;function I(f){let v=f.width,A=f.height,w=f.angle%360;return w<0&&(w+=360),w===0||w===180?v:w===90||w===270?A:Math.abs(v*Math.cos(w*Math.PI/180))+Math.abs(A*Math.sin(w*Math.PI/180))}_.getSuperWidth=I;function R(f){let v=f.width,A=f.height,w=f.angle%360;return w<0&&(w+=360),w===0||w===180?A:w===90||w===270?v:Math.abs(A*Math.cos(w*Math.PI/180))+Math.abs(v*Math.sin(w*Math.PI/180))}_.getSuperHeight=R;})(b||={});async function ze(t){if(t!=="EMPTY"){if(!t)throw e$1.error("Texture not found",t),new PixiError("unregistered_asset","Texture not found");if(be.Assets.cache.has(t)){let e=be.Assets.get(t);if(e)return e}return be.Assets.load(t).then(e=>{if(!e)throw e$1.error("Texture not found",t),new PixiError("unregistered_asset","Texture not found");if(!(e instanceof be.Texture))throw e$1.error("File is not a Texture",t),new PixiError("unregistered_asset","File is not a Texture");return e}).catch(e=>{throw e$1.error("Error loading file",e),new PixiError("unknown_element","Error loading file")})}}function ge(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 Ae=class t extends be.Sprite{constructor(e$1){if(e$1 instanceof be.Texture)super(e$1);else {let{align:n,percentagePosition:s,...o}=ge(e$1)||{};super(o),n&&(this.align=n),s&&(this.percentagePosition=s);}this.pixivnId=this.constructor.prototype.pixivnId||e;}pixivnId=e;get memory(){return {...ft(this),pixivnId:this.pixivnId,align:this._align,percentagePosition:this._percentagePosition}}async setMemory(e){return await Ze(this,e)}static from(e,n){let s=be.Sprite.from(e,n),o=new t;return o.texture=s.texture,o}onEventsHandlers={};on(e,n,s){return Ce(e,this,n),super.on(e,(...o)=>n(...o,this),s)}_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=b.getSuperPoint(this.pivot,this.angle),n=b.getSuperPoint(this.scale,this.angle);return {x:b.calculateAlignByPosition("width",this.x,b.getSuperWidth(this),e.x,n.x<0,this.anchor.x),y:b.calculateAlignByPosition("height",this.y,b.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=b.getSuperPoint(this.pivot,this.angle),n=b.getSuperPoint(this.scale,this.angle);return b.calculateAlignByPosition("width",this.x,b.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=b.getSuperPoint(this.pivot,this.angle),n=b.getSuperPoint(this.scale,this.angle);return b.calculateAlignByPosition("height",this.y,b.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:b.calculatePercentagePositionByPosition("width",this.x),y:b.calculatePercentagePositionByPosition("height",this.y)}}get percentageX(){return b.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 b.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=b.getSuperPoint(this.pivot,this.angle),n=b.getSuperPoint(this.scale,this.angle);this._align.x!==void 0&&(super.x=b.calculatePositionByAlign("width",this._align.x,b.getSuperWidth(this),e.x,n.x<0,this.anchor.x)),this._align.y!==void 0&&(super.y=b.calculatePositionByAlign("height",this._align.y,b.getSuperHeight(this),e.y,n.y<0,this.anchor.y));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=b.calculatePositionByPercentagePosition("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=b.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;}};ae.add(Ae,{name:e,copyProperty:async(t,e)=>{await Ze(t,e,{ignoreTexture:true});}});async function Ze(t,e,n){e=ge(e);let s=n?.ignoreTexture||false;if(await fe(t,e),!s){let g;if("textureData"in e&&e.textureData&&(g=e.textureData),g&&g.url!=="EMPTY"){let I=g.url;g.alias&&be.Assets.resolver.hasKey(g.alias)&&(I=g.alias);try{let R=await ze(I);R&&(t.texture=R);}catch(R){e$1.error("Error in Sprite.setMemorySprite() while loading texture"),R=new PixiError("unregistered_asset",`Error loading image ${I}`,"canvas",e),GameUnifier.runOnError(R,{});}}}let o=n?.half;o&&await o(),"anchor"in e&&e.anchor!==void 0&&(typeof e.anchor=="number"?t.anchor.set(e.anchor,e.anchor):t.anchor.set(e.anchor.x,e.anchor.y)),"align"in e&&e.align!==void 0&&(t.align=e.align),"percentagePosition"in e&&e.percentagePosition!==void 0&&(t.percentagePosition=e.percentagePosition),"roundPixels"in e&&e.roundPixels!==void 0&&(t.roundPixels=e.roundPixels);}var q=class t extends Ae{_textureAlias;get textureAlias(){return this._textureAlias?this._textureAlias:this.texture.source.label}pixivnId=d$1;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 Je(this,e),this.reloadPosition();}static from(e,n){let s=be.Sprite.from(e,n),o=new t;return o.texture=s.texture,o}_loadIsStarted=false;get loadIsStarted(){return this._loadIsStarted}async load(){return this._loadIsStarted=true,ze(this.textureAlias).then(e=>{this._loadIsStarted=false,e&&(this.texture=e);}).catch(e=>{this._loadIsStarted=false,e$1.error("Error into ImageSprite.load()"),e=new PixiError("unregistered_asset",`Error loading image ${this.textureAlias}`,"canvas",{...this.memory,label:this.textureAlias},this),GameUnifier.runOnError(e,{});})}set texture(e){super.texture=e,this.reloadPosition();}get texture(){return super.texture}get haveEmptyTexture(){return this.texture._source.label==="EMPTY"}};ae.add(q,{name:d$1,copyProperty:async(t,e)=>{await Je(t,e,{ignoreTexture:true});}});async function Je(t,e,n){return await Ze(t,e,{half:async()=>{"loadIsStarted"in e&&e.loadIsStarted&&await t.load();},ignoreTexture:n?.ignoreTexture})}var xe=class t extends q{constructor(e,n){if(e instanceof be.Texture){super(e,n);return}let{loop:s,paused:o,currentTime:g,...I}=e||{};super(I,n),s&&(this.loop=s),o&&(this.paused=o),g&&(this.currentTime=g);}pixivnId=g;get memory(){return {...super.memory,pixivnId:this.pixivnId,loop:this.loop,paused:this._paused,currentTime:this.currentTime}}async setMemory(e){await Ht(this,e),this.reloadPosition();}static from(e,n){let s=be.Sprite.from(e,n),o=new t;return o.texture=s.texture,o}async load(){await super.load(),this.loop=this._looop,this.currentTime=this._currentTime,this.paused=this._paused;}_looop=false;get loop(){return this.texture?.source?.resource?.loop||false}set loop(e){this._looop=e,this.texture?.source?.resource&&(this.texture.source.resource.loop=e);}_paused=false;get paused(){return this.texture?.source?.resource?.paused||false}set paused(e){e?this.pause():this.play();}pause(){this._paused=true,this.texture?.source?.resource&&this.texture.source.resource.pause();}play(){this._paused=false,this.texture?.source?.resource?.play&&typeof this.texture.source.resource.play=="function"&&this.texture.source.resource.play();}_currentTime=0;get currentTime(){return this.texture?.source?.resource?.currentTime||0}set currentTime(e){let 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}};ae.add(xe,{name:g,getInstance:async(t,e)=>{let n;"textureData"in e&&e.textureData&&(n=e.textureData);let s=new t(void 0,n?.alias);return await s.setMemory(e),s},copyProperty:async(t,e)=>{await Ht(t,e,{ignoreTexture:true});}});async function Ht(t,e,n){await Je(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 me=class extends Container{constructor(e){let{anchor:n,align:s,percentagePosition:o,...g}=ge(e)||{};super(g),this.pixivnId=this.constructor.prototype.pixivnId||b$1,n&&(this.anchor=n),s&&(this.align=s),o&&(this.percentagePosition=o);}pixivnId=b$1;get memory(){return {...we(this,{childrenExport:true}),anchor:this._anchor?this.anchor:void 0,align:this._align,percentagePosition:this._percentagePosition}}async setMemory(e){await this.importChildren(e),await fe(this,e),this.reloadAnchor(),this.reloadPosition();}async importChildren(e){for(let n=0;n<e.elements.length;n++){let s=e.elements[n],o=await Ve(s);this.addChild(o);}}onEventsHandlers={};on(e,n,s){return Ce(e,this,n),super.on(e,(...o)=>n(...o,this),s)}_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=b.getSuperPoint(this.pivot,this.angle),n=b.getSuperPoint(this.scale,this.angle);return {x:b.calculateAlignByPosition("width",this.x,b.getSuperWidth(this),e.x,n.x<0),y:b.calculateAlignByPosition("height",this.y,b.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=b.getSuperPoint(this.pivot,this.angle),n=b.getSuperPoint(this.scale,this.angle);return b.calculateAlignByPosition("width",this.x,b.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=b.getSuperPoint(this.pivot,this.angle),n=b.getSuperPoint(this.scale,this.angle);return b.calculateAlignByPosition("height",this.y,b.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:b.calculatePercentagePositionByPosition("width",this.x),y:b.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 b.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 b.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=b.getSuperPoint(this.pivot,this.angle),n=b.getSuperPoint(this.scale,this.angle);this._align.x!==void 0&&(super.x=b.calculatePositionByAlign("width",this._align.x,b.getSuperWidth(this),e.x,n.x<0)),this._align.y!==void 0&&(super.y=b.calculatePositionByAlign("height",this._align.y,b.getSuperHeight(this),e.y,n.y<0));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=b.calculatePositionByPercentagePosition("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=b.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;}};ae.add(me,{name:b$1,copyProperty:async(t,e)=>await fe(t,e)});var wn=new Set(["mp4","webm","ogg","ogv","avi","mov","wmv","flv","mkv","m4v","3gp","3g2","ts","mts"]);function He(t){let e=be.Assets.cache.has(t)?be.Assets.get(t):null;return e instanceof be.Texture&&(t=e.source?.label||t),An(t)}function An(t){let e=t.split(".").pop()?.toLowerCase();return e!==void 0&&wn.has(e)}var J=class extends me{constructor(e,n){let{anchor:s,align:o,percentagePosition:g,...I}=ge(e)||{};super(I),n&&n.forEach(R=>{He(R)?this.addChild(new xe(void 0,R)):this.addChild(new q(void 0,R));}),s&&(this.anchor=s),o&&(this.align=o),g&&(this.percentagePosition=g);}get memory(){return {...super.memory,pixivnId:c,loadIsStarted:this._loadIsStarted}}async setMemory(e){await this.importChildren(e),await Ut(this,e),this.reloadAnchor(),this.reloadPosition();}pixivnId=c;_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,e$1.error("Error into ImageContainer.load()",n);})}get texture(){return this.children.length>0?this.children[0].texture:new be.Texture}get haveEmptyTexture(){return this.children.some(e=>e.texture._source.label==="EMPTY")}};ae.add(J,{name:c,copyProperty:async(t,e)=>await Ut(t,e)});async function Ut(t,e){e=ge(e)||{},fe(t,e,{end:async()=>{"loadIsStarted"in e&&e.loadIsStarted&&await t.load();}});}var Qe=class{constructor(...e){}get memory(){throw new PixiError("not_implemented","The method CanvasBaseItem.memory must be overridden")}setMemory(e){throw new PixiError("not_implemented","The method CanvasBaseItem.setMemory must be overridden")}pixivnId="canvas_element_id_not_set"};var Se=class extends be.Text{constructor(e){let{align:n,percentagePosition:s,...o}=ge(e)||{};super(o),this.pixivnId=this.constructor.prototype.pixivnId||f,n&&(this.align=n),s&&(this.percentagePosition=s);}pixivnId=f;get memory(){return {...lt(this),pixivnId:this.pixivnId,align:this._align,percentagePosition:this._percentagePosition}}async setMemory(e){await En(this,e),this.reloadPosition();}onEventsHandlers={};on(e,n,s){return Ce(e,this,n),super.on(e,(...o)=>n(...o,this),s)}_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=b.getSuperPoint(this.pivot,this.angle),n=b.getSuperPoint(this.scale,this.angle);return {x:b.calculateAlignByPosition("width",this.x,b.getSuperWidth(this),e.x,n.x<0,this.anchor.x),y:b.calculateAlignByPosition("height",this.y,b.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=b.getSuperPoint(this.pivot,this.angle),n=b.getSuperPoint(this.scale,this.angle);return b.calculateAlignByPosition("width",this.x,b.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=b.getSuperPoint(this.pivot,this.angle),n=b.getSuperPoint(this.scale,this.angle);return b.calculateAlignByPosition("height",this.y,b.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:b.calculatePercentagePositionByPosition("width",this.x),y:b.calculatePercentagePositionByPosition("height",this.y)}}get percentageX(){return b.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 b.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=b.getSuperPoint(this.pivot,this.angle),n=b.getSuperPoint(this.scale,this.angle);this._align.x!==void 0&&(super.x=b.calculatePositionByAlign("width",this._align.x,b.getSuperWidth(this),e.x,n.x<0,this.anchor.x)),this._align.y!==void 0&&(super.y=b.calculatePositionByAlign("height",this._align.y,b.getSuperHeight(this),e.y,n.y<0,this.anchor.y));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=b.calculatePositionByPercentagePosition("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=b.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;}};ae.add(Se,{name:f});async function En(t,e){"text"in e&&e.text!==void 0&&(t.text=e.text),await fe(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 Ue(t,e,n){let s=[0],o=t;for(let g=0;g<n;g++)s.push(o,-o*.6,o*.3,0),o*=e;return s}function Xt(t,e,n,s){let o=n.reduce((v,A)=>A.enabled?v+A.padding:v,0),g=t.x,I=t.y,R=t.x+t.width,_=t.y+t.height;s&&(g=Math.max(g,0),I=Math.max(I,0),R=Math.min(R,s.width),_=Math.min(_,s.height));let f={x:g-o,y:I-o,width:R-g+o*2,height:_-I+o*2};return {x:t.x+e.x*t.width-f.x,y:t.y+e.y*t.height-f.y,area:f}}function gt(t,e,n,s){return Math.max(0,Math.ceil(e-Math.min(t.x,t.y,n-t.x,s-t.y)))}function et(t,e,n,s){let o=Math.min(Math.max(e,0),.5),g=Math.hypot(Math.max(t.x,n-t.x),Math.max(t.y,s-t.y));return Math.ceil(g*o/(1-o))}function tt(t,e,n,s){return s>0?s:Math.hypot(Math.max(t.x,e.width-t.x),Math.max(t.y,e.height-t.y))+n/2}function mt(t){let e=t.filters;return e?Array.isArray(e)?[...e]:[e]:[]}function Rn(t,e){t.filters=[...mt(t),...e];}function kn(t,e){let n=mt(t).filter(s=>!e.includes(s));t.filters=n.length>0?n:null;}function ee(t,e,n,s,o,g){Rn(e,[n]);let I=filters.animate(t,n,s,{duration:o.duration??1,delay:o.delay,ease:o.ease,times:o.times,aliasToRemoveAfter:o.aliasToRemoveAfter,autoplay:o.autoplay},g,void 0,()=>{kn(e,[n]),n.destroy();});return I&&(o.completeOnContinue??true)&&tickers$1.completeOnStepEnd({id:I}),I}function ve(t,e){let n;try{n=u.screen;}catch{n=void 0;}return Xt(t.getBounds(),e,mt(t),n)}async function Bn(t,e={},n){return yt.shakeEffect(t,e,n)}function $t(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 nt(t,e,n){let s=[0],o=t;for(let g=0;g<n;g++)s.push(g%2===0?o:-o,0),o*=e;return s}function Le(t,e,n,s){let o=[t],g=e;for(let I=0;I<s;I++)o.push(t+g,t),g*=n;return o}var yt;(Xe=>{async function t(O,K={},V){let M=u.find(O);if(!M){e$1.error(`The element with the alias ${O} does not exist. So the shake effect can't be applied.`);return}let k={x:M.position.x,y:M.position.y},{shakeType:U="horizontal",maxShockSize:$=10,shocksNumber:j=10,...L}=K,D=j-1;if(D<2){e$1.error("The number of shocks must be at least 3.");return}let W=Math.floor(D/2),Y=Math.ceil(D/2),F=[];for(let N=0;N<W;N++){let te=$*(N+1)/W;U==="horizontal"?N%2!==0?F.push(k.x+te):F.push(k.x-te):N%2!==0?F.push(k.y+te):F.push(k.y-te);}let G=W%2===0;for(let N=Y;N>0;N--){let te=$*(N+1)/(Y-1);U==="horizontal"?N%2===0&&!G||N%2!==0&&G?F.push(k.x-te):F.push(k.x+te):N%2===0&&!G||N%2!==0&&G?F.push(k.y-te):F.push(k.y+te);}let Q;if(U==="horizontal"?(F.push(k.x),Q=u.animate(O,{x:F},L,V)):(F.push(k.y),Q=u.animate(O,{y:F},L,V)),Q)return [Q]}Xe.shakeEffect=t;async function e(O,K={},V){let M=u.find(O);if(!M){e$1.error(`The element with the alias ${O} does not exist. So the bounce effect can't be applied.`);return}let{direction:k="up",distance:U=30,bounces:$=4,decay:j=.5,...L}=K,{axis:D,sign:W}=$t(k),Y=D==="x"?M.position.x:M.position.y,F=[Y],G=U;for(let N=0;N<$;N++)F.push(Y+W*G,Y),G*=j;let Q=u.animate(O,{[D]:F},L,V);if(Q)return [Q]}Xe.bounceEffect=e;async function n(O,K={},V){let M=u.find(O);if(!M){e$1.error(`The element with the alias ${O} does not exist. So the pulse effect can't be applied.`);return}let{scale:k=1.2,pulses:U=3,decay:$=.6,...j}=K,L=M.scale.x,D=M.scale.y,W=[L],Y=[D],F=k-1;for(let Q=0;Q<U;Q++)W.push(L*(1+F),L),Y.push(D*(1+F),D),F*=$;let G=u.animate(O,{scaleX:W,scaleY:Y},j,V);if(G)return [G]}Xe.pulseEffect=n;async function s(O,K={},V){let M=u.find(O);if(!M){e$1.error(`The element with the alias ${O} does not exist. So the hop effect can't be applied.`);return}let{direction:k="up",distance:U=40,secondaryHops:$=0,decay:j=.5,...L}=K,{axis:D,sign:W}=$t(k),Y=D==="x"?M.position.x:M.position.y,F=[Y],G=U;for(let N=0;N<1+$;N++)F.push(Y+W*G,Y),G*=j;let Q=u.animate(O,{[D]:F},L,V);if(Q)return [Q]}Xe.hopEffect=s;async function o(O,K={},V){let M=u.find(O);if(!M){e$1.error(`The element with the alias ${O} does not exist. So the wiggle effect can't be applied.`);return}let{angle:k=15,repetitions:U=3,decay:$=.5,...j}=K,L=M.rotation,D=k*Math.PI/180,W=nt(D,$,U).map(F=>L+F),Y=u.animate(O,{rotation:W},j,V);if(Y)return [Y]}Xe.wiggleEffect=o;async function g(O,K={},V){let M=u.find(O);if(!M){e$1.error(`The element with the alias ${O} does not exist. So the nod effect can't be applied.`);return}let{axis:k="horizontal",distance:U=15,repetitions:$=3,decay:j=.5,...L}=K,D=k==="horizontal"?"x":"y",W=k==="horizontal"?M.position.x:M.position.y,Y=nt(U,j,$).map(G=>W+G),F=u.animate(O,{[D]:Y},L,V);if(F)return [F]}Xe.nodEffect=g;async function I(O,K={},V){let M=u.find(O);if(!M){e$1.error(`The element with the alias ${O} does not exist. So the sway effect can't be applied.`);return}let{axis:k="horizontal",distance:U=10,angle:$=5,repetitions:j=3,decay:L=0,ease:D="easeInOut",...W}=K,Y=k==="horizontal"?"x":"y",F=k==="horizontal"?M.position.x:M.position.y,G=M.rotation,Q=$*Math.PI/180,N=nt(U,L||1,j).map(ce=>F+ce),te=nt(Q,L||1,j).map(ce=>G+ce),ue=u.animate(O,{[Y]:N,rotation:te},{ease:D,...W},V);if(ue)return [ue]}Xe.swayEffect=I;async function R(O,K={},V){let M=u.find(O);if(!M){e$1.error(`The element with the alias ${O} does not exist. So the punch effect can't be applied.`);return}let{mode:k="scale",strength:U=.3,overshoot:$=.3,...j}=K,L;if(k==="scale"){let D=W=>[W,W*(1+U),W*(1-U*$),W];L=u.animate(O,{scaleX:D(M.scale.x),scaleY:D(M.scale.y)},j,V);}else {let D=k==="rotation"?M.rotation:k==="x"?M.position.x:M.position.y,W=k==="rotation"?U*Math.PI/180:U,Y=[D,D+W,D-W*$,D];L=u.animate(O,{[k]:Y},j,V);}if(L)return [L]}Xe.punchEffect=R;async function _(O,K={},V){let M=u.find(O);if(!M){e$1.error(`The element with the alias ${O} does not exist. So the glitch effect can't be applied.`);return}let{strength:k=40,bursts:U=3,slices:$=8,direction:j=0,rgbSplit:L=6,decay:D=.5,ease:W="linear",...Y}=K,F=new filters.GlitchFilter({slices:$,direction:j,offset:0});F.refresh(),F.padding=Math.ceil(Math.abs(k));let G=[],Q=ee(O,M,F,{offset:Ue(k,D,U)},{ease:W,...Y},V);if(Q&&G.push(Q),L!==0){let N=Ue(L,D,U),te=new filters.RGBSplitFilter({red:{x:0,y:0},green:{x:0,y:0},blue:{x:0,y:0}});te.padding=Math.ceil(Math.abs(L));let ue=ee(O,M,te,{redX:N,blueX:N.map(ce=>-ce)},{ease:W,...Y},V);ue&&G.push(ue);}if(G.length>0)return G}Xe.glitchEffect=_;async function f(O,K={},V){let M=u.find(O);if(!M){e$1.error(`The element with the alias ${O} does not exist. So the chromatic aberration effect can't be applied.`);return}let{strength:k=8,axis:U="horizontal",bursts:$=1,decay:j=.5,...L}=K,D=new filters.RGBSplitFilter({red:{x:0,y:0},green:{x:0,y:0},blue:{x:0,y:0}});D.padding=Math.ceil(Math.abs(k));let W=U==="horizontal"?"redX":"redY",Y=U==="horizontal"?"blueX":"blueY",F={[W]:Le(0,k,j,$),[Y]:Le(0,-k,j,$)},G=ee(O,M,D,F,L,V);if(G)return [G]}Xe.chromaticAberrationEffect=f;async function v(O,K={},V){let M=u.find(O);if(!M){e$1.error(`The element with the alias ${O} does not exist. So the shockwave effect can't be applied.`);return}let{origin:k={x:.5,y:.5},amplitude:U=30,wavelength:$=160,brightness:j=1,radius:L=-1,speed:D=500,strength:W,...Y}=K,{width:F,height:G}=M.getBounds(),Q=W??tt({x:k.x*F,y:k.y*G},{width:F,height:G},$,L)/D,N=new filters.ShockwaveFilter({center:{x:0,y:0},amplitude:U,wavelength:$,brightness:j,radius:L,speed:D,time:0});N.padding=Math.ceil(Math.abs(U)*1.25);let te=ee(O,M,N,{time:[0,Q]},Y,V),{x:ue,y:ce}=ve(M,k);if(N.center={x:ue,y:ce},te)return [te]}Xe.shockwaveEffect=v;async function A(O,K={},V){let M=u.find(O);if(!M){e$1.error(`The element with the alias ${O} does not exist. So the radial blur effect can't be applied.`);return}let{strength:k=.5,bursts:U=1,origin:$={x:.5,y:.5},innerRadius:j=0,radius:L=-1,decay:D=.5,...W}=K,Y=new filters.ZoomBlurFilter({center:{x:0,y:0},innerRadius:j,radius:L,strength:0}),{width:F,height:G}=M.getBounds();Y.padding=et({x:$.x*F,y:$.y*G},k,F,G);let Q=Le(0,k,D,U),N=ee(O,M,Y,{strength:Q},W,V),{x:te,y:ue}=ve(M,$);if(Y.center={x:te,y:ue},N)return [N]}Xe.radialBlurEffect=A;async function w(O,K={},V){let M=u.find(O);if(!M){e$1.error(`The element with the alias ${O} does not exist. So the blur pulse effect can't be applied.`);return}let{strength:k=8,pulses:U=3,quality:$,decay:j=.5,...L}=K,D=new filters.BlurFilter({strength:0,quality:$}),W=Le(0,k,j,U),Y=ee(O,M,D,{strength:W},L,V);if(Y)return [Y]}Xe.blurPulseEffect=w;async function H(O,K={},V){let M=u.find(O);if(!M){e$1.error(`The element with the alias ${O} does not exist. So the vignette pulse effect can't be applied.`);return}let{strength:k=1,pulses:U=1,radius:$=.5,blur:j=.5,decay:L=.5,...D}=K,W=new filters.CRTFilter({curvature:0,lineWidth:0,lineContrast:0,noise:0,vignetting:$,vignettingBlur:j,vignettingAlpha:0}),Y=Le(0,k,L,U),F=ee(O,M,W,{vignettingAlpha:Y},D,V);if(F)return [F]}Xe.vignettePulseEffect=H;async function X(O,K={},V){let M=u.find(O);if(!M){e$1.error(`The element with the alias ${O} does not exist. So the desaturate effect can't be applied.`);return}let{amount:k=0,duration:U=1,holdDuration:$=0,...j}=K,L=U*2+$,D=[0,U/L,(U+$)/L,1],W=new filters.AdjustmentFilter({saturation:1}),Y=ee(O,M,W,{saturation:[1,k,k,1]},{...j,duration:L,times:D},V);if(Y)return [Y]}Xe.desaturateEffect=X;async function Z(O,K={},V){let M=u.find(O);if(!M){e$1.error(`The element with the alias ${O} does not exist. So the glow pulse effect can't be applied.`);return}let{strength:k=4,pulses:U=3,color:$=16777215,distance:j=10,innerStrength:L=0,decay:D=.5,...W}=K,Y=new filters.GlowFilter({outerStrength:0,innerStrength:L,distance:j,color:$}),F=Le(0,k,D,U),G=ee(O,M,Y,{outerStrength:F},W,V);if(G)return [G]}Xe.glowPulseEffect=Z;})(yt||={});function Oe(t){let e=t.getLocalBounds();return {x:e.x,y:e.y,width:e.width,height:e.height}}function xt(t,e){return e.graphics||(e.graphics=new Graphics,t.parent?.addChild(e.graphics),t.mask=e.graphics),Fn(t,e.graphics),e.graphics}function Fn(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 Ln(t,e){e.graphics&&(t.mask=null,e.graphics.parent?.removeChild(e.graphics),e.graphics.destroy({children:true}),e.graphics=void 0);}function Pt(t,e,n,s){let o=e.invert?1-n:n,{bounds:g}=e,I=xt(t,s),R=g.x+g.width/2,_=g.y+g.height/2,f=Math.sqrt(g.width**2+g.height**2)||1,v=Math.max(o,0)*f*2,A=e.angle*Math.PI/180;if(I.clear(),v>0){let w=Math.cos(-A),H=Math.sin(-A),X=[[-f,-f],[-f+v,-f],[-f+v,f],[-f,f]].flatMap(([Z,Xe])=>[R+Z*w-Xe*H,_+Z*H+Xe*w]);I.poly(X).fill(16777215);}}function vt(t,e,n,s){let o=e.invert?1-n:n,{bounds:g}=e,I=xt(t,s),R=g.x+g.width*e.originX,_=g.y+g.height*e.originY,f=Math.max(R-g.x,g.x+g.width-R),v=Math.max(_-g.y,g.y+g.height-_),A=Math.sqrt(f**2+v**2)||1,w=Math.max(o,0)*A,H=e.aspect>0?e.aspect:1;I.clear(),w>0&&I.ellipse(R,_,w*H,w).fill(16777215);}function It(t,e,n,s){let g=1-(e.invert?1-n:n),{bounds:I}=e,R=xt(t,s);if(R.clear(),e.orientation==="horizontal"){let _=I.x+I.width*e.origin,f=_-I.x,v=I.x+I.width-_,A=I.x-g*f,w=_+g*v;f>0&&R.rect(A,I.y,f,I.height).fill(16777215),v>0&&R.rect(w,I.y,v,I.height).fill(16777215);}else {let _=I.y+I.height*e.origin,f=_-I.y,v=I.y+I.height-_,A=I.y-g*f,w=_+g*v;f>0&&R.rect(I.x,A,I.width,f).fill(16777215),v>0&&R.rect(I.x,w,I.width,v).fill(16777215);}}function Gt(t,e,n){switch(e.kind){case "wipe":case "iris":case "split":Ln(t,n);break}}function it(t,e,n){let s={...u.find(t)?.memory,...n},o=new J(n,e);return s&&u.copyCanvasElementProperty(s,o),u.add(t,o,{ignoreOldStyle:true,zIndex:n?.zIndex}),o}async function Yn(t,e,n){let s={...u.find(t)?.memory,...n},o=new J(n,e);return o.label=t,await o.load(),s&&u.copyCanvasElementProperty(s,o),u.add(t,o,{ignoreOldStyle:true,zIndex:n?.zIndex}),o}function rt(t,e,n){if(!e)if(be.Assets.resolver.hasKey(t))e=t;else throw new PixiError("unregistered_asset",`The image ${t} does not exist in the cache.`,"canvas",{pixivnId:d$1,...n,label:t});let s={...u.find(t)?.memory,...n},o=new q(n,e);return s&&u.copyCanvasElementProperty(s,o),u.add(t,o,{ignoreOldStyle:true,zIndex:n?.zIndex}),o}async function zn(t,e,n){if(!e)if(be.Assets.resolver.hasKey(t))e=t;else throw new PixiError("unregistered_asset",`The image ${t} does not exist in the cache.`,"canvas",{pixivnId:d$1,...n,label:t});let s={...u.find(t)?.memory,...n},o=new q(n,e);return o.label=t,await o.load(),s&&u.copyCanvasElementProperty(s,o),u.add(t,o,{ignoreOldStyle:true,zIndex:n?.zIndex}),o}function st(t,e,n){if(!e)if(be.Assets.resolver.hasKey(t))e=t;else throw new PixiError("unregistered_asset",`The video ${t} does not exist in the cache.`,"canvas",{pixivnId:g,...n,label:t});let s={...u.find(t)?.memory,...n},o=new xe(n,e);return s&&u.copyCanvasElementProperty(s,o),u.add(t,o,{ignoreOldStyle:true,zIndex:n?.zIndex}),o}async function Hn(t,e,n){if(!e)if(be.Assets.resolver.hasKey(t))e=t;else throw new PixiError("unregistered_asset",`The video ${t} does not exist in the cache.`,"canvas",{pixivnId:g,...n,label:t});let s={...u.find(t)?.memory,...n},o=new xe(n,e);return o.label=t,await o.load(),s&&u.copyCanvasElementProperty(s,o),u.add(t,o,{ignoreOldStyle:true,zIndex:n?.zIndex}),o}async function Wn(t,e,n={},s){return le.showWithDissolve(t,e,n,s)}function Xn(t,e={},n){return le.removeWithDissolve(t,e,n)}async function $n(t,e,n={},s){return le.showWithFade(t,e,n,s)}function Gn(t,e={},n){return le.removeWithFade(t,e,n)}async function Vn(t,e,n={},s){return le.moveIn(t,e,n,s)}function jn(t,e={},n){return le.moveOut(t,e,n)}async function Nn(t,e,n={},s){return le.zoomIn(t,e,n,s)}function Kn(t,e={},n){return le.zoomOut(t,e,n)}async function qn(t,e,n={},s){return le.pushIn(t,e,n,s)}function Zn(t,e={direction:"right"},n){return le.pushOut(t,e,n)}var le;(yi=>{function t(r){switch(r.type){case "align":return {xAlign:r.x,yAlign:r.y};case "percentage":return {percentageX:r.x,percentageY:r.y};default:return {x:r.x,y:r.y}}}function e(r,i,a){if(typeof i=="string")return He(i)?st(r,i,{...a.properties,zIndex:a.zIndex}):rt(r,i,{...a.properties,zIndex:a.zIndex});if(Array.isArray(i))return it(r,i,{...a.properties,zIndex:a.zIndex});if(typeof i=="object"&&"value"in i&&"options"in i){if(typeof i.value=="string")return He(i.value)?st(r,i.value,{...i.options,...a.properties,zIndex:a.zIndex}):rt(r,i.value,{...i.options,...a.properties,zIndex:a.zIndex});if(Array.isArray(i.value))return it(r,i.value,{...i.options,...a.properties,zIndex:a.zIndex})}return u.add(r,i,a),i}function n(r){let i=r;return {x:i.x,y:i.y,anchor:i.anchor,scale:i.scale,pivot:i.pivot,skew:i.skew,rotation:i.rotation,angle:i.angle}}function s(r,i,a){let c,d=u.find(r);d&&(c=`${r}_temp_${a}`,u.editAlias(r,c));let p=e(r,i,{zIndex:d?d.parent?.getChildIndex(d):void 0,properties:d?n(d):void 0});return d?.parent?.setChildIndex(d,d.parent.getChildIndex(d)-.1),c&&u.copyCanvasElementProperty(c,r),c&&tickers$1.transfer(c,r,"duplicate"),{component:p,oldComponentAlias:c}}function o(r){switch(r){case "up":return 90;case "down":return 270;case "left":return 180;default:return 0}}function g(r,i,a){let c={},d=P=>{let T=u.find(r);T&&i.apply(T,P,c);},p=filters.animate(r,void 0,{value:[i.from,i.to]},{duration:i.duration??1,delay:i.delay,ease:i.ease,aliasToRemoveAfter:i.aliasToRemoveAfter,tickerIdToResume:i.tickerIdToResume},a,d,()=>{let P=u.find(r);P&&Gt(P,i.config,c);});return p&&d(i.from),p&&(i.completeOnContinue??true)&&tickers$1.completeOnStepEnd({id:p}),p}function I(r,i,a,c,d){let p=Math.max(c,0)/4;a==="in"?(i&&(i.alpha=0),u.animate(r,{alpha:[0,1]},{duration:p,completeOnContinue:false},d)):u.animate(r,{alpha:[1,0]},{duration:p,delay:Math.max(c-p,0),completeOnContinue:false},d);}function R(r,i,a,c,d=false){let p=Math.max(c,1),P=i*2+a,T=d?i+a:P,x=Math.max(P*(p-1)+T,.001),y=[0],m=[0],l=0;for(let h=0;h<p;h++){let C=h===p-1;l+=i,y.push(r),m.push(l/x),l+=a,y.push(r),m.push(l/x),(!C||!d)&&(l+=i,y.push(0),m.push(Math.min(l/x,1)));}return {values:y,times:m,total:x}}async function _(r,i,a={},c){let{completeOnContinue:d=true,tickerIdToResume:p=[],...P}=a,T=[];i||(i=r),typeof p=="string"&&(p=[p]);let x,y=u.find(r);if(y&&(x=`${r}_temp_disolve`,u.editAlias(r,x)),i=e(r,i,{zIndex:y?y.parent?.getChildIndex(y):void 0,properties:y?n(y):void 0}),y?.parent?.setChildIndex(y,y.parent.getChildIndex(y)-.1),x&&u.copyCanvasElementProperty(x,r),x&&tickers$1.transfer(x,r,"duplicate"),i.alpha=0,x){let l=f(x,{...a,autoplay:false,completeOnContinue:d},c);l&&(T.push(...l),p.push(...l));}let m=u.animate(r,{alpha:1},{...P,tickerIdToResume:p,completeOnContinue:d},c);if(m&&T.push(m),(i instanceof q||i instanceof J)&&i.haveEmptyTexture&&await i.load(),T.length>0)return T}yi.showWithDissolve=_;function f(r,i={},a){let{completeOnContinue:c=true,aliasToRemoveAfter:d=[],...p}=i;typeof d=="string"&&(d=[d]),d.push(r);let P=u.animate(r,{alpha:0},{...p,aliasToRemoveAfter:d,completeOnContinue:c},a);if(P)return [P]}yi.removeWithDissolve=f;async function v(r,i,a={},c){let{completeOnContinue:d=true,aliasToRemoveAfter:p=[],...P}=a,T=[];i||(i=r),typeof p=="string"&&(p=[p]);let x=u.find(r);if(!x)return _(r,i,a,c);let y=`${r}_temp_fade`;u.editAlias(r,y),p.push(y),i=e(r,i,{zIndex:x?x.parent?.getChildIndex(x):void 0,properties:n(x)}),x?.parent?.setChildIndex(x,x.parent.getChildIndex(x)-.1),y&&u.copyCanvasElementProperty(y,r),y&&tickers$1.transfer(y,r,"duplicate"),i.alpha=0;let m=u.animate(r,{alpha:1},{...P,aliasToRemoveAfter:p,completeOnContinue:d},c);if(m){let l=f(y,{...a,tickerIdToResume:m,completeOnContinue:d},c);l&&T.push(...l),T.push(m),tickers$1.pause({id:m});}if((i instanceof q||i instanceof J)&&i.haveEmptyTexture&&await i.load(),T.length>0)return T}yi.showWithFade=v;function A(r,i={},a){return f(r,i,a)}yi.removeWithFade=A;async function w(r,i,a={},c){let{direction:d="right",completeOnContinue:p=true,tickerIdToResume:P=[],aliasToRemoveAfter:T=[],removeOldComponentWithMoveOut:x,motionBlur:y,...m}=a,l=[],h;i||(i=r),typeof P=="string"&&(P=[P]),typeof T=="string"&&(T=[T]);let C,E=u.find(r);if(E&&(C=`${r}_temp_movein`,u.editAlias(r,C),E instanceof q||E instanceof J?h=E.positionInfo:h={x:E.x,y:E.y,type:"pixel"}),i=e(r,i,{zIndex:E?E.parent?.getChildIndex(E):void 0}),E?.parent?.setChildIndex(E,E.parent.getChildIndex(E)-.1),C&&u.copyCanvasElementProperty(C,r),C&&tickers$1.transfer(C,r,"move"),(i instanceof q||i instanceof J)&&i.haveEmptyTexture&&await i.load(),h||(i instanceof q||i instanceof J?h=i.positionInfo:h={x:i.x,y:i.y,type:"pixel"}),C)if(x){let re=H(C,{...a,autoplay:false,completeOnContinue:p},c);re&&(l.push(...re),P.push(...re));}else T.push(C);switch(d){case "up":i.y=u.height+i.height;break;case "down":i.y=-i.height;break;case "left":i.x=u.width+i.width;break;case "right":i.x=-i.width;break}let B=tickers$1.pause({canvasAlias:r});P.push(...B);let z=u.animate(r,t(h),{...m,tickerIdToResume:P,aliasToRemoveAfter:T,completeOnContinue:p},c);z&&l.push(z);let ne=te(r,i,d,y,{...m,completeOnContinue:p},c);if(ne&&l.push(ne),l.length>0)return l}yi.moveIn=w;function H(r,i={},a){let{direction:c="right",completeOnContinue:d=true,aliasToRemoveAfter:p=[],motionBlur:P,...T}=i;typeof p=="string"&&(p=[p]),p.push(r);let x=u.find(r);if(!x){e$1.warn(`The canvas component "${r}" is not found.`);return}let y={x:x.x,y:x.y};switch(c){case "up":y.y=-x.height;break;case "down":y.y=u.height+x.height;break;case "left":y.x=-x.width;break;case "right":y.x=u.width+x.width;break}tickers$1.pause({canvasAlias:r});let m=u.animate(r,y,{...T,aliasToRemoveAfter:p,completeOnContinue:d},a),l=te(r,x,c,P,{...T,completeOnContinue:d},a);return ue([m,l])}yi.moveOut=H;async function X(r,i,a={},c){let{direction:d="right",completeOnContinue:p=true,tickerIdToResume:P=[],aliasToRemoveAfter:T=[],...x}=a,y=[],m;i||(i=r),typeof P=="string"&&(P=[P]),typeof T=="string"&&(T=[T]);let l,h=u.find(r);h&&(l=`${r}_temp_zoom`,u.editAlias(r,l),h instanceof q||h instanceof J?m=h.positionInfo:m={x:h.x,y:h.y,type:"pixel"}),i=e(r,i,{zIndex:h?h.parent?.getChildIndex(h):void 0}),h?.parent?.setChildIndex(h,h.parent.getChildIndex(h)-.1),l&&u.copyCanvasElementProperty(l,r),l&&tickers$1.transfer(l,r,"move"),m||(i instanceof q||i instanceof J?m=i.positionInfo:m={x:i.x,y:i.y,type:"pixel"});let C={x:i.pivot.x,y:i.pivot.y},E={x:i.scale.x,y:i.scale.y};if(l)if(a.removeOldComponentWithZoomOut){let ne=Z(l,{...a,autoplay:false,completeOnContinue:p},c);ne&&(y.push(...ne),P.push(...ne));}else T.push(l);(i instanceof q||i instanceof J)&&i.haveEmptyTexture&&await i.load(),d==="up"?(i.pivot.y=u.height-i.y,i.pivot.x=u.width/2-i.x,i.y=u.height,i.x=u.width/2):d==="down"?(i.pivot.y=0-i.y,i.pivot.x=u.width/2-i.x,i.y=0,i.x=u.width/2):d==="left"?(i.pivot.x=u.width-i.x,i.pivot.y=u.height/2-i.y,i.x=u.width,i.y=u.height/2):d==="right"&&(i.pivot.x=0-i.x,i.pivot.y=u.height/2-i.y,i.x=0,i.y=u.height/2),i.pivot=b.getPointBySuperPoint(i.pivot,i.angle),i.scale.set(0);let B=tickers$1.pause({canvasAlias:r});P.push(...B);let z=u.animate(r,{pivotX:C.x,pivotY:C.y,scaleX:E.x,scaleY:E.y,...t(m)},{...x,tickerIdToResume:P,aliasToRemoveAfter:T,completeOnContinue:p},c);if(z&&y.push(z),y.length>0)return y}yi.zoomIn=X;function Z(r,i={},a){let{direction:c="right",completeOnContinue:d=true,aliasToRemoveAfter:p=[],...P}=i;typeof p=="string"&&(p=[p]),p.push(r);let T=u.find(r);if(!T){e$1.warn(`The canvas component "${r}" is not found.`);return}let x={x:T.x,y:T.y},y={x:T.pivot.x,y:T.pivot.y};c==="down"?(x.y=u.height,x.x=u.width/2,y.y=u.height-x.y,y.x=u.width/2-x.x):c==="up"?(x.y=0,x.x=u.width/2,y.y=0-x.y,y.x=u.width/2-x.x):c==="right"?(x.x=u.width,x.y=u.height/2,y.x=u.width-x.x,y.y=u.height/2-x.y):c==="left"&&(x.x=0,x.y=u.height/2,y.x=0-x.x,y.y=u.height/2-x.y),y=b.getPointBySuperPoint(y,T.angle),tickers$1.pause({canvasAlias:r});let m=u.animate(r,{...x,pivotX:y.x,pivotY:y.y,scaleX:0,scaleY:0},{...P,aliasToRemoveAfter:p,completeOnContinue:d},a);if(m)return [m]}yi.zoomOut=Z;async function Xe(r,i,a={},c){let{direction:d="right",completeOnContinue:p=true,tickerIdToResume:P=[],motionBlur:T,...x}=a,y=[],m;i||(i=r),typeof P=="string"&&(P=[P]);let l,h=u.find(r);switch(h&&(l=`${r}_temp_push`,u.editAlias(r,l),h instanceof q||h instanceof J?m=h.positionInfo:m={x:h.x,y:h.y,type:"pixel"}),i=e(r,i,{zIndex:h?h.parent?.getChildIndex(h):void 0}),h?.parent?.setChildIndex(h,h.parent.getChildIndex(h)-.1),l&&u.copyCanvasElementProperty(l,r),l&&tickers$1.transfer(l,r,"move"),m||((i instanceof q||i instanceof J)&&i.haveEmptyTexture?m=i.positionInfo:m={x:i.x,y:i.y,type:"pixel"}),(i instanceof q||i instanceof J)&&i.haveEmptyTexture&&await i.load(),d){case "up":i.y=u.height+i.height;break;case "down":i.y=-i.height;break;case "left":i.x=u.width+i.width;break;case "right":i.x=-i.width;break}let C=tickers$1.pause({canvasAlias:r});if(P.push(...C),l){let z=O(l,{...a,direction:d,completeOnContinue:p});z&&y.push(...z);}let E=u.animate(r,t(m),{...x,tickerIdToResume:P,completeOnContinue:p},c);E&&y.push(E);let B=te(r,i,d,T,{...x,completeOnContinue:p},c);if(B&&y.push(B),y.length>0)return y}yi.pushIn=Xe;function O(r,i={direction:"right"},a){return H(r,i,a)}yi.pushOut=O;async function K(r,i,a={},c){let{angle:d,direction:p="right",invert:P=false,duration:T,delay:x,ease:y,completeOnContinue:m=true}=a,{aliasToRemoveAfter:l=[]}=a;i||(i=r),typeof l=="string"&&(l=[l]);let{component:h,oldComponentAlias:C}=s(r,i,"wipe");C&&l.push(C),(h instanceof q||h instanceof J)&&h.haveEmptyTexture&&await h.load();let E={kind:"wipe",angle:d??o(p),invert:P,bounds:Oe(h)},B=g(r,{config:E,apply:(z,ne,re)=>Pt(z,E,ne,re),from:0,to:1,duration:T,delay:x,ease:y,completeOnContinue:m,aliasToRemoveAfter:l},c);if(B)return [B]}yi.wipeIn=K;function V(r,i={},a){let{angle:c,direction:d="right",invert:p=false,duration:P,delay:T,ease:x,completeOnContinue:y=true}=i,{aliasToRemoveAfter:m=[]}=i;typeof m=="string"&&(m=[m]),m.push(r);let l=u.find(r);if(!l){e$1.warn(`The canvas component "${r}" is not found.`);return}let h={kind:"wipe",angle:c??o(d),invert:p,bounds:Oe(l)},C=g(r,{config:h,apply:(E,B,z)=>Pt(E,h,B,z),from:1,to:0,duration:P,delay:T,ease:x,completeOnContinue:y,aliasToRemoveAfter:m},a);if(C)return [C]}yi.wipeOut=V;async function M(r,i,a={},c){let{origin:d={},aspect:p=1,invert:P=false,duration:T,delay:x,ease:y,completeOnContinue:m=true}=a,{aliasToRemoveAfter:l=[]}=a;i||(i=r),typeof l=="string"&&(l=[l]);let{component:h,oldComponentAlias:C}=s(r,i,"iris");C&&l.push(C),(h instanceof q||h instanceof J)&&h.haveEmptyTexture&&await h.load();let E={kind:"iris",originX:d.x??.5,originY:d.y??.5,aspect:p,invert:P,bounds:Oe(h)},B=g(r,{config:E,apply:(z,ne,re)=>vt(z,E,ne,re),from:0,to:1,duration:T,delay:x,ease:y,completeOnContinue:m,aliasToRemoveAfter:l},c);if(B)return [B]}yi.irisIn=M;function k(r,i={},a){let{origin:c={},aspect:d=1,invert:p=false,duration:P,delay:T,ease:x,completeOnContinue:y=true}=i,{aliasToRemoveAfter:m=[]}=i;typeof m=="string"&&(m=[m]),m.push(r);let l=u.find(r);if(!l){e$1.warn(`The canvas component "${r}" is not found.`);return}let h={kind:"iris",originX:c.x??.5,originY:c.y??.5,aspect:d,invert:p,bounds:Oe(l)},C=g(r,{config:h,apply:(E,B,z)=>vt(E,h,B,z),from:1,to:0,duration:P,delay:T,ease:x,completeOnContinue:y,aliasToRemoveAfter:m},a);if(C)return [C]}yi.irisOut=k;async function U(r,i,a={},c){let{orientation:d="vertical",origin:p=.5,invert:P=false,duration:T,delay:x,ease:y,completeOnContinue:m=true}=a,{aliasToRemoveAfter:l=[]}=a;i||(i=r),typeof l=="string"&&(l=[l]);let{component:h,oldComponentAlias:C}=s(r,i,"split");C&&l.push(C),(h instanceof q||h instanceof J)&&h.haveEmptyTexture&&await h.load();let E={kind:"split",orientation:d,origin:p,invert:P,bounds:Oe(h)},B=g(r,{config:E,apply:(z,ne,re)=>It(z,E,ne,re),from:0,to:1,duration:T,delay:x,ease:y,completeOnContinue:m,aliasToRemoveAfter:l},c);if(B)return [B]}yi.splitIn=U;function $(r,i={},a){let{orientation:c="vertical",origin:d=.5,invert:p=false,duration:P,delay:T,ease:x,completeOnContinue:y=true}=i,{aliasToRemoveAfter:m=[]}=i;typeof m=="string"&&(m=[m]),m.push(r);let l=u.find(r);if(!l){e$1.warn(`The canvas component "${r}" is not found.`);return}let h={kind:"split",orientation:c,origin:d,invert:p,bounds:Oe(l)},C=g(r,{config:h,apply:(E,B,z)=>It(E,h,B,z),from:1,to:0,duration:P,delay:T,ease:x,completeOnContinue:y,aliasToRemoveAfter:m},a);if(C)return [C]}yi.splitOut=$;async function j(r,i,a={},c){let{strength:d=32,quality:p=4,duration:P,delay:T,ease:x,completeOnContinue:y=true,fadeComponent:m=true}=a,{aliasToRemoveAfter:l=[]}=a;i||(i=r),typeof l=="string"&&(l=[l]);let{component:h,oldComponentAlias:C}=s(r,i,"blur");C&&l.push(C),(h instanceof q||h instanceof J)&&h.haveEmptyTexture&&await h.load();let E=P??1;m&&I(r,h,"in",E,c);let B=new filters.BlurFilter({strength:d,quality:p}),z=ee(r,h,B,{strength:[d,0]},{duration:E,delay:T,ease:x,completeOnContinue:y,aliasToRemoveAfter:l},c);if(z)return [z]}yi.blurIn=j;function L(r,i={},a){let{strength:c=32,quality:d=4,duration:p,delay:P,ease:T,completeOnContinue:x=true,fadeComponent:y=true}=i,{aliasToRemoveAfter:m=[]}=i;typeof m=="string"&&(m=[m]),m.push(r);let l=u.find(r);if(!l){e$1.warn(`The canvas component "${r}" is not found.`);return}let h=p??1;y&&I(r,l,"out",h,a);let C=new filters.BlurFilter({strength:0,quality:d}),E=ee(r,l,C,{strength:[0,c]},{duration:h,delay:P,ease:T,completeOnContinue:x,aliasToRemoveAfter:m},a);if(E)return [E]}yi.blurOut=L;async function D(r,i,a={},c){let{pixelSize:d=32,duration:p,delay:P,ease:T,completeOnContinue:x=true,fadeComponent:y=false}=a,{aliasToRemoveAfter:m=[]}=a;i||(i=r),typeof m=="string"&&(m=[m]);let{component:l,oldComponentAlias:h}=s(r,i,"pixelate");h&&m.push(h),(l instanceof q||l instanceof J)&&l.haveEmptyTexture&&await l.load();let C=p??1;y&&I(r,l,"in",C,c);let E=new filters.PixelateFilter(d),B=ee(r,l,E,{sizeX:[d,1],sizeY:[d,1]},{duration:C,delay:P,ease:T,completeOnContinue:x,aliasToRemoveAfter:m},c);if(B)return [B]}yi.pixelateIn=D;function W(r,i={},a){let{pixelSize:c=32,duration:d,delay:p,ease:P,completeOnContinue:T=true,fadeComponent:x=false}=i,{aliasToRemoveAfter:y=[]}=i;typeof y=="string"&&(y=[y]),y.push(r);let m=u.find(r);if(!m){e$1.warn(`The canvas component "${r}" is not found.`);return}let l=d??1;x&&I(r,m,"out",l,a);let h=new filters.PixelateFilter(1),C=ee(r,m,h,{sizeX:[1,c],sizeY:[1,c]},{duration:l,delay:p,ease:P,completeOnContinue:T,aliasToRemoveAfter:y},a);if(C)return [C]}yi.pixelateOut=W;async function Y(r,i,a={},c){let{color:d=16777215,maxAlpha:p=1,duration:P=.3,holdDuration:T=0,pulses:x=1,completeOnContinue:y=true,fadeComponent:m=true,...l}=a;i||(i=r);let h=u.find(r);if(h){let z=N(r,h,i,{color:d,maxAlpha:p,fadeDuration:P,holdDuration:T,pulses:x,completeOnContinue:y,rest:l,priority:c});return z||void 0}let{component:C}=s(r,i,"flash");(C instanceof q||C instanceof J)&&C.haveEmptyTexture&&await C.load(),m&&I(r,C,"in",P,c);let E=[],B=Q(C,{color:d,maxAlpha:p,fadeDuration:P,holdDuration:T,pulses:x,completeOnContinue:y,aliasToRemoveAfter:[],rest:l,priority:c});if(B&&E.push(B),E.length>0)return E}yi.flashIn=Y;function F(r,i={},a){let{color:c=16777215,maxAlpha:d=1,duration:p=.3,holdDuration:P=0,pulses:T=1,completeOnContinue:x=true,fadeComponent:y=true,...m}=i,l=u.find(r);if(!l){e$1.warn(`The canvas component "${r}" is not found.`);return}if(y){let{total:C}=R(d,p,P,T);I(r,l,"out",C,a);}let h=Q(l,{color:c,maxAlpha:d,fadeDuration:p,holdDuration:P,pulses:T,completeOnContinue:x,aliasToRemoveAfter:[r],rest:m,priority:a});if(h)return [h]}yi.flashOut=F;function G(r,i,a=0){let c=r.getBounds(),d=new me,p=new be.Graphics;p.rect(0,0,c.width,c.height).fill(i),d.addChild(p),d.position.set(c.x,c.y),d.alpha=a;let P=`${r.label}_flash_${Math.random().toString(36).slice(2)}`;return u.add(P,d,{zIndex:(r.zIndex??0)+1}),P}function Q(r,i){let a=G(r,i.color),{values:c,times:d,total:p}=R(i.maxAlpha,i.fadeDuration,i.holdDuration,i.pulses,i.endAtPeak??false),P=[...i.aliasToRemoveAfter,a];return u.animate(a,{alpha:c},{...i.rest,duration:p,times:d,aliasToRemoveAfter:P,completeOnContinue:i.completeOnContinue},i.priority)}function N(r,i,a,c){let d=G(i,c.color),{values:p,times:P,total:T}=R(c.maxAlpha,c.fadeDuration,c.holdDuration,c.pulses,true),x=u.animate(d,{alpha:p},{...c.rest,duration:T,times:P,completeOnContinue:false},c.priority);if(setTimeout(()=>{(async()=>{let{component:y,oldComponentAlias:m}=s(r,a,"flash");u.remove(m?[d,m]:[d]),(y instanceof q||y instanceof J)&&y.haveEmptyTexture&&await y.load();let l=G(y,c.color,c.maxAlpha);u.animate(l,{alpha:[c.maxAlpha,0]},{...c.rest,duration:c.fadeDuration,aliasToRemoveAfter:[l],completeOnContinue:c.completeOnContinue},c.priority);})();},T*1e3),x)return [x]}function te(r,i,a,c,d,p){if(!c)return;let P=c===true?40:c,T=a==="up"||a==="down"?"velocityY":"velocityX",x=a==="up"||a==="left"?-1:1,y=new filters.MotionBlurFilter({velocity:{x:0,y:0},kernelSize:15});return ee(r,i,y,{[T]:[0,x*P,0]},{duration:d.duration??.3,delay:d.delay,ease:d.ease,completeOnContinue:d.completeOnContinue,autoplay:d.autoplay},p)}function ue(r){let i=r.filter(a=>!!a);return i.length>0?i:void 0}async function ce(r,i,a,c,d,p,P){let{duration:T,delay:x,ease:y,completeOnContinue:m=true,fadeComponent:l=d}=c,{aliasToRemoveAfter:h=[]}=c;typeof h=="string"&&(h=[h]);let{component:C,oldComponentAlias:E}=s(r,i??r,a);E&&h.push(E),(C instanceof q||C instanceof J)&&C.haveEmptyTexture&&await C.load();let B=T??1;return l&&I(r,C,"in",B,p),ue(P(C,{duration:B,delay:x,ease:y,completeOnContinue:m},h))}function Ie(r,i,a,c,d){let{duration:p,delay:P,ease:T,completeOnContinue:x=true,fadeComponent:y=a}=i,{aliasToRemoveAfter:m=[]}=i;typeof m=="string"&&(m=[m]),m.push(r);let l=u.find(r);if(!l){e$1.warn(`The canvas component "${r}" is not found.`);return}let h=p??1;return y&&I(r,l,"out",h,c),ue(d(l,{duration:h,delay:P,ease:T,completeOnContinue:x},m))}function Tt(r){let{width:i,height:a}=r.getBounds();return Math.hypot(i,a)/2}function $e(r){return {x:r?.x??.5,y:r?.y??.5}}function Ct(r,i,a,c,d,p,P){let{strength:T=40,bursts:x=3,slices:y=8,rgbSplit:m=6}=c,l=B=>{let z=Ue(B,.5,x);return a==="in"?z:z.reverse()},h={...d,ease:d.ease??"linear"},C=new filters.GlitchFilter({slices:y,offset:0});C.refresh(),C.padding=Math.ceil(Math.abs(T));let E=[ee(r,i,C,{offset:l(T)},{...h,aliasToRemoveAfter:p},P)];if(m!==0){let B=l(m),z=new filters.RGBSplitFilter({red:{x:0,y:0},green:{x:0,y:0},blue:{x:0,y:0}});z.padding=Math.ceil(Math.abs(m)),E.push(ee(r,i,z,{redX:B,blueX:B.map(ne=>-ne)},h,P));}return E}async function ii(r,i,a={},c){return ce(r,i,"glitch",a,true,c,(d,p,P)=>Ct(r,d,"in",a,p,P,c))}yi.glitchIn=ii;function ri(r,i={},a){return Ie(r,i,true,a,(c,d,p)=>Ct(r,c,"out",i,d,p,a))}yi.glitchOut=ri;function bt(r,i,a,c,d,p,P){let{angle:T=540,radius:x=Tt(i),origin:y}=c,m=$e(y),l=T*Math.PI/180,h=a==="in"?[l,0]:[0,l],C=new filters.TwistFilter({radius:x,angle:h[0]}),{width:E,height:B}=i.getBounds();C.padding=Math.max(C.padding,gt({x:m.x*E,y:m.y*B},x,E,B));let z=ee(r,i,C,{angle:h},{...d,aliasToRemoveAfter:p},P),{x:ne,y:re}=ve(i,m);return C.offsetX=ne,C.offsetY=re,[z]}async function si(r,i,a={},c){return ce(r,i,"twist",a,true,c,(d,p,P)=>bt(r,d,"in",a,p,P,c))}yi.twistIn=si;function oi(r,i={},a){return Ie(r,i,true,a,(c,d,p)=>bt(r,c,"out",i,d,p,a))}yi.twistOut=oi;function wt(r,i,a,c,d,p,P){let{strength:T=.6,origin:x}=c,y=$e(x),m=a==="in"?[T,0]:[0,T],l=new filters.ZoomBlurFilter({center:{x:0,y:0},strength:m[0]}),{width:h,height:C}=i.getBounds();l.padding=et({x:y.x*h,y:y.y*C},T,h,C);let E=ee(r,i,l,{strength:m},{...d,aliasToRemoveAfter:p},P),{x:B,y:z}=ve(i,y);return l.center={x:B,y:z},[E]}async function ai(r,i,a={},c){return ce(r,i,"warp",a,true,c,(d,p,P)=>wt(r,d,"in",a,p,P,c))}yi.warpIn=ai;function ci(r,i={},a){return Ie(r,i,true,a,(c,d,p)=>wt(r,c,"out",i,d,p,a))}yi.warpOut=ci;function At(r,i,a,c,d,p){let{origin:P,amplitude:T=30,wavelength:x=160,speed:y=500}=a,m=$e(P),{width:l,height:h}=i.getBounds(),C=new filters.ShockwaveFilter({center:{x:0,y:0},amplitude:T,wavelength:x,speed:y,time:0});C.padding=Math.ceil(Math.abs(T)*1.25);let E=tt({x:m.x*l,y:m.y*h},{width:l,height:h},x,-1)/y,B=ee(r,i,C,{time:[0,E]},{...c,aliasToRemoveAfter:d},p),{x:z,y:ne}=ve(i,m);return C.center={x:z,y:ne},[B]}async function di(r,i,a={},c){return ce(r,i,"ripple",a,true,c,(d,p,P)=>At(r,d,a,p,P,c))}yi.rippleIn=di;function ui(r,i={},a){return Ie(r,i,true,a,(c,d,p)=>At(r,c,i,d,p,a))}yi.rippleOut=ui;function St(r,i,a,c,d,p,P){let{edge:T="hard",noiseScale:x=8,seed:y=Math.random()*1e3}=c,[m,l]=T==="hard"?[.25,.75]:[0,1],h=a==="in"?[m,l]:[l,m],C=new filters.SimplexNoiseFilter({strength:h[0],noiseScale:x,offsetZ:y,step:T==="hard"?.5:0});return [ee(r,i,C,{strength:h},{...d,aliasToRemoveAfter:p},P)]}async function pi(r,i,a={},c){return ce(r,i,"noise",a,false,c,(d,p,P)=>St(r,d,"in",a,p,P,c))}yi.noiseDissolveIn=pi;function fi(r,i={},a){return Ie(r,i,false,a,(c,d,p)=>St(r,c,"out",i,d,p,a))}yi.noiseDissolveOut=fi;function Ot(r,i,a,c,d,p,P){let{lineThickness:T=.02,brightness:x=3,scanlines:y=true}=c,m=i.scale.x,l=i.scale.y,h=l*T,C=a==="in"?[0,.45,1]:[0,.55,1],E=a==="in"?[0,m,m]:[m,m,0],B=a==="in"?[h,h,l]:[l,h,h],z=a==="in"?[x,x,1]:[1,x,x];a==="in"&&i.scale.set(0,h);let ne=[u.animate(r,{scaleX:E,scaleY:B},{duration:d.duration,delay:d.delay,ease:d.ease,times:C,completeOnContinue:d.completeOnContinue,aliasToRemoveAfter:p},P),ee(r,i,new filters.AdjustmentFilter({brightness:z[0]}),{brightness:z},{...d,times:C},P)];if(y){let re=a==="in"?[.5,.5,0]:[0,.5,.5];ne.push(ee(r,i,new filters.CRTFilter({curvature:0,vignettingAlpha:0,lineWidth:3,lineContrast:re[0],noise:re[0]}),{lineContrast:re,noise:re},{...d,times:C},P));}return ne}async function li(r,i,a={},c){return ce(r,i,"tv",a,false,c,(d,p,P)=>Ot(r,d,"in",a,p,P,c))}yi.tvIn=li;function hi(r,i={},a){return Ie(r,i,false,a,(c,d,p)=>Ot(r,c,"out",i,d,p,a))}yi.tvOut=hi;function Et(r,i,a,c,d,p,P){let{strength:T=1,mode:x="pinch",radius:y=Tt(i),origin:m}=c,l=(x==="bulge"?1:-1)*T,h=$e(m),C=a==="in"?[l,0]:[0,l],E=new filters.BulgePinchFilter({center:h,radius:y,strength:C[0]});if(x==="bulge"){let{width:Mt,height:_t}=i.getBounds();E.padding=gt({x:h.x*Mt,y:h.y*_t},y,Mt,_t);}let B=ee(r,i,E,{strength:C},{...d,aliasToRemoveAfter:p},P),{x:z,y:ne,area:re}=ve(i,h);return E.center={x:z/re.width,y:ne/re.height},[B]}async function gi(r,i,a={},c){return ce(r,i,"pinch",a,true,c,(d,p,P)=>Et(r,d,"in",a,p,P,c))}yi.pinchIn=gi;function mi(r,i={},a){return Ie(r,i,true,a,(c,d,p)=>Et(r,c,"out",i,d,p,a))}yi.pinchOut=mi;})(le||={});var We=class extends me{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 Jn(){return async(e,n)=>{try{let s=e.canvasElementInfo;if(s){let o=new We(s),g=s.zIndex;o.groupColor=16711680;let I=new be.Graphics;I.rect(0,0,300,100).fill({color:16711680,alpha:.5}),o.addChild(I);let R=new be.Text({text:`Error: ${s.label}`,x:10,y:10});o.addChild(R);let _=e.parent;if(_&&"addChild"in _)g!==void 0?_.addChildAt(o,g):_.addChild(o);else {let f=s.parentLabel?u.find(s.parentLabel):void 0;if(f)g!==void 0?f.addChildAt(o,g):f.addChild(o);else {let v=s.label??s.pixivnId;u.add(v,o,{zIndex:g});}}}}catch{}}}function Qn(t,e,n){let s={...u.find(t)?.memory,...n},o=new Se({text:e,...n});return s&&u.copyCanvasElementProperty(s,o),u.add(t,o,{ignoreOldStyle:true,zIndex:n?.zIndex}),o}var {Assets:vo,Color:Io,Rectangle:To,TextStyle:Co,Texture:bo,UPDATE_PRIORITY:wo}=be,u=new Ye;oe.init({getScreen:()=>u.screen});GameUnifier.addOnPreContinue(async()=>{try{let{tikersIds:t,stepAlias:e}=drainCompleteOnStepEndQueue(),n=(async()=>{for(;t.length;){let{id:o}=t.pop()||{};o&&await tickers$1.forceCompletion(o);}})(),s=(async()=>{for(;e.length;){let{alias:o,id:g}=e.pop()||{};o&&g&&await tickers$1.forceCompletion(g,o);}})();await Promise.all([n,s]);}catch{}});
2
+ export{vo as Assets,Qe as CanvasBaseItem,ie as CanvasManagerStatic,b as CanvasPropertyUtility,Io as Color,me as Container,J as ImageContainer,q as ImageSprite,To as Rectangle,ae as RegisteredCanvasComponents,ct as RegisteredEvents,Ae as Sprite,Se as Text,Co as TextStyle,bo as Texture,wo as UPDATE_PRIORITY,xe as VideoSprite,rt as addImage,it as addImageCointainer,Ce as addListenerHandler,st as addVideo,ge as analizePositionsExtensionProps,u as canvas,rn as canvasComponentDecorator,Jn as drawCanvasErrorHandler,yt as effects,tn as eventDecorator,ze as getTexture,Vn as moveIn,jn as moveOut,qn as pushIn,Zn as pushOut,Xn as removeWithDissolve,Gn as removeWithFade,fe as setMemoryContainer,Bn as shakeEffect,zn as showImage,Yn as showImageContainer,Qn as showText,Hn as showVideo,Wn as showWithDissolve,$n as showWithFade,le as transitions,Nn as zoomIn,Kn as zoomOut};
@@ -1 +1 @@
1
- import {b}from'./chunk-QOBPVPCY.mjs';import'./chunk-YBA63R27.mjs';import {q,r,p as p$1}from'./chunk-U5BSF6X3.mjs';var g="@",n=class extends b{sourceId;constructor(e,r=""){super(p$1.CHARACTER_CATEGORY_KEY,e+(r?g+r:"")),this.sourceId=e,this.migrateOldStorage("___character___");}getStorageProperty(e){let r=super.getStorageProperty(e);return r===void 0&&(r=super.getStorageProperty(e,this.sourceId)),r}};var i=class extends n{constructor(e,r){super(typeof e=="string"?e:e.id,typeof e=="string"?"":e.emotion),this.defaultName=r.name,this.defaultSurname=r.surname,this.defaultAge=r.age,this.icon=r.icon,this.color=r.color;}defaultName;get name(){return this.getStorageProperty("name")||this.defaultName||this.id}set name(e){this.setStorageProperty("name",e);}defaultSurname;get surname(){return this.getStorageProperty("surname")||this.defaultSurname}set surname(e){this.setStorageProperty("surname",e);}defaultAge;get age(){return this.getStorageProperty("age")||this.defaultAge}set age(e){this.setStorageProperty("age",e);}icon;color};var o=new q({cacheSize:10}),h;(C=>{function c(a){try{let t=o.get(a);if(!t){r.warn(`Character "${a}" not found, did you forget to register it with the RegisteredCharacters.add?`);return}return t}catch(t){r.error(`Error while getting Character "${a}"`,t);return}}C.get=c;function e(...a){for(let t of a){if(Array.isArray(t)){e(...t);continue}o.get(t.id)&&r.info(`Character id "${t.id}" already exists, it will be overwritten`),o.set(t.id,t);}}C.add=e;function r$1(){return Array.from(o.values())}C.values=r$1;function m(a){return o.has(a)}C.has=m;function l(){return Array.from(o.keys())}C.keys=l;function y(){o.clear();}C.clear=y;})(h||={});var p=h;export{i as CharacterBaseModel,n as CharacterStoredClass,p as RegisteredCharacters};
1
+ import {b}from'./chunk-6OABTG5R.mjs';import {m}from'./chunk-HD353M4B.mjs';import'./chunk-S7HZUIEI.mjs';import {d,e}from'./chunk-AW5XWF24.mjs';var g="@",n=class extends b{sourceId;constructor(e,r=""){super(m.CHARACTER_CATEGORY_KEY,e+(r?g+r:"")),this.sourceId=e,this.migrateOldStorage("___character___");}getStorageProperty(e){let r=super.getStorageProperty(e);return r===void 0&&(r=super.getStorageProperty(e,this.sourceId)),r}};var i=class extends n{constructor(e,r){super(typeof e=="string"?e:e.id,typeof e=="string"?"":e.emotion),this.defaultName=r.name,this.defaultSurname=r.surname,this.defaultAge=r.age,this.icon=r.icon,this.color=r.color;}defaultName;get name(){return this.getStorageProperty("name")||this.defaultName||this.id}set name(e){this.setStorageProperty("name",e);}defaultSurname;get surname(){return this.getStorageProperty("surname")||this.defaultSurname}set surname(e){this.setStorageProperty("surname",e);}defaultAge;get age(){return this.getStorageProperty("age")||this.defaultAge}set age(e){this.setStorageProperty("age",e);}icon;color};var o=new d({cacheSize:10}),h;(C=>{function c(a){try{let t=o.get(a);if(!t){e.warn(`Character "${a}" not found, did you forget to register it with the RegisteredCharacters.add?`);return}return t}catch(t){e.error(`Error while getting Character "${a}"`,t);return}}C.get=c;function e$1(...a){for(let t of a){if(Array.isArray(t)){e$1(...t);continue}o.get(t.id)&&e.info(`Character id "${t.id}" already exists, it will be overwritten`),o.set(t.id,t);}}C.add=e$1;function r(){return Array.from(o.values())}C.values=r;function m(a){return o.has(a)}C.has=m;function l(){return Array.from(o.keys())}C.keys=l;function y(){o.clear();}C.clear=y;})(h||={});var p=h;export{i as CharacterBaseModel,n as CharacterStoredClass,p as RegisteredCharacters};
@@ -1 +1 @@
1
- import {b,a}from'./chunk-U5BSF6X3.mjs';var L=b((S,I)=>{(function(w,o){typeof S=="object"?I.exports=S=o():typeof define=="function"&&define.amd?define([],o):w.CryptoJS=o();})(S,function(){var w=w||(function(o,x){var a$1;if(typeof window<"u"&&window.crypto&&(a$1=window.crypto),typeof self<"u"&&self.crypto&&(a$1=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(a$1=globalThis.crypto),!a$1&&typeof window<"u"&&window.msCrypto&&(a$1=window.msCrypto),!a$1&&typeof global<"u"&&global.crypto&&(a$1=global.crypto),!a$1&&typeof a=="function")try{a$1=a("crypto");}catch{}var _=function(){if(a$1){if(typeof a$1.getRandomValues=="function")try{return a$1.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof a$1.randomBytes=="function")try{return a$1.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},C=Object.create||(function(){function t(){}return function(e){var n;return t.prototype=e,n=new t,t.prototype=null,n}})(),d={},B=d.lib={},u=B.Base=(function(){return {extend:function(t){var e=C(this);return t&&e.mixIn(t),(!e.hasOwnProperty("init")||this.init===e.init)&&(e.init=function(){e.$super.init.apply(this,arguments);}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString);},clone:function(){return this.init.prototype.extend(this)}}})(),l=B.WordArray=u.extend({init:function(t,e){t=this.words=t||[],e!=x?this.sigBytes=e:this.sigBytes=t.length*4;},toString:function(t){return (t||v).stringify(this)},concat:function(t){var e=this.words,n=t.words,r=this.sigBytes,f=t.sigBytes;if(this.clamp(),r%4)for(var c=0;c<f;c++){var z=n[c>>>2]>>>24-c%4*8&255;e[r+c>>>2]|=z<<24-(r+c)%4*8;}else for(var g=0;g<f;g+=4)e[r+g>>>2]=n[g>>>2];return this.sigBytes+=f,this},clamp:function(){var t=this.words,e=this.sigBytes;t[e>>>2]&=4294967295<<32-e%4*8,t.length=o.ceil(e/4);},clone:function(){var t=u.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],n=0;n<t;n+=4)e.push(_());return new l.init(e,t)}}),i=d.enc={},v=i.Hex={stringify:function(t){for(var e=t.words,n=t.sigBytes,r=[],f=0;f<n;f++){var c=e[f>>>2]>>>24-f%4*8&255;r.push((c>>>4).toString(16)),r.push((c&15).toString(16));}return r.join("")},parse:function(t){for(var e=t.length,n=[],r=0;r<e;r+=2)n[r>>>3]|=parseInt(t.substr(r,2),16)<<24-r%8*4;return new l.init(n,e/2)}},h=i.Latin1={stringify:function(t){for(var e=t.words,n=t.sigBytes,r=[],f=0;f<n;f++){var c=e[f>>>2]>>>24-f%4*8&255;r.push(String.fromCharCode(c));}return r.join("")},parse:function(t){for(var e=t.length,n=[],r=0;r<e;r++)n[r>>>2]|=(t.charCodeAt(r)&255)<<24-r%4*8;return new l.init(n,e)}},p=i.Utf8={stringify:function(t){try{return decodeURIComponent(escape(h.stringify(t)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(t){return h.parse(unescape(encodeURIComponent(t)))}},y=B.BufferedBlockAlgorithm=u.extend({reset:function(){this._data=new l.init,this._nDataBytes=0;},_append:function(t){typeof t=="string"&&(t=p.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes;},_process:function(t){var e,n=this._data,r=n.words,f=n.sigBytes,c=this.blockSize,z=c*4,g=f/z;t?g=o.ceil(g):g=o.max((g|0)-this._minBufferSize,0);var b=g*c,R=o.min(b*4,f);if(b){for(var A=0;A<b;A+=c)this._doProcessBlock(r,A);e=r.splice(0,b),n.sigBytes-=R;}return new l.init(e,R)},clone:function(){var t=u.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0});B.Hasher=y.extend({cfg:u.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset();},reset:function(){y.reset.call(this),this._doReset();},update:function(t){return this._append(t),this._process(),this},finalize:function(t){t&&this._append(t);var e=this._doFinalize();return e},blockSize:512/32,_createHelper:function(t){return function(e,n){return new t.init(n).finalize(e)}},_createHmacHelper:function(t){return function(e,n){return new s.HMAC.init(t,n).finalize(e)}}});var s=d.algo={};return d})(Math);return w});});var T=b((H,P)=>{(function(w,o){typeof H=="object"?P.exports=H=o(L()):typeof define=="function"&&define.amd?define(["./core"],o):o(w.CryptoJS);})(H,function(w){return (function(){var o=w,x=o.lib,a=x.WordArray,_=x.Hasher,C=o.algo,d=[],B=C.SHA1=_.extend({_doReset:function(){this._hash=new a.init([1732584193,4023233417,2562383102,271733878,3285377520]);},_doProcessBlock:function(u,l){for(var i=this._hash.words,v=i[0],h=i[1],p=i[2],y=i[3],m=i[4],s=0;s<80;s++){if(s<16)d[s]=u[l+s]|0;else {var t=d[s-3]^d[s-8]^d[s-14]^d[s-16];d[s]=t<<1|t>>>31;}var e=(v<<5|v>>>27)+m+d[s];s<20?e+=(h&p|~h&y)+1518500249:s<40?e+=(h^p^y)+1859775393:s<60?e+=(h&p|h&y|p&y)-1894007588:e+=(h^p^y)-899497514,m=y,y=p,p=h<<30|h>>>2,h=v,v=e;}i[0]=i[0]+v|0,i[1]=i[1]+h|0,i[2]=i[2]+p|0,i[3]=i[3]+y|0,i[4]=i[4]+m|0;},_doFinalize:function(){var u=this._data,l=u.words,i=this._nDataBytes*8,v=u.sigBytes*8;return l[v>>>5]|=128<<24-v%32,l[(v+64>>>9<<4)+14]=Math.floor(i/4294967296),l[(v+64>>>9<<4)+15]=i,u.sigBytes=l.length*4,this._process(),this._hash},clone:function(){var u=_.clone.call(this);return u._hash=this._hash.clone(),u}});o.SHA1=_._createHelper(B),o.HmacSHA1=_._createHmacHelper(B);})(),w.SHA1});});export{T as a};
1
+ import {b,a}from'./chunk-AW5XWF24.mjs';var L=b((S,I)=>{(function(w,o){typeof S=="object"?I.exports=S=o():typeof define=="function"&&define.amd?define([],o):w.CryptoJS=o();})(S,function(){var w=w||(function(o,x){var a$1;if(typeof window<"u"&&window.crypto&&(a$1=window.crypto),typeof self<"u"&&self.crypto&&(a$1=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(a$1=globalThis.crypto),!a$1&&typeof window<"u"&&window.msCrypto&&(a$1=window.msCrypto),!a$1&&typeof global<"u"&&global.crypto&&(a$1=global.crypto),!a$1&&typeof a=="function")try{a$1=a("crypto");}catch{}var _=function(){if(a$1){if(typeof a$1.getRandomValues=="function")try{return a$1.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof a$1.randomBytes=="function")try{return a$1.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},C=Object.create||(function(){function t(){}return function(e){var n;return t.prototype=e,n=new t,t.prototype=null,n}})(),d={},B=d.lib={},u=B.Base=(function(){return {extend:function(t){var e=C(this);return t&&e.mixIn(t),(!e.hasOwnProperty("init")||this.init===e.init)&&(e.init=function(){e.$super.init.apply(this,arguments);}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString);},clone:function(){return this.init.prototype.extend(this)}}})(),l=B.WordArray=u.extend({init:function(t,e){t=this.words=t||[],e!=x?this.sigBytes=e:this.sigBytes=t.length*4;},toString:function(t){return (t||v).stringify(this)},concat:function(t){var e=this.words,n=t.words,r=this.sigBytes,f=t.sigBytes;if(this.clamp(),r%4)for(var c=0;c<f;c++){var z=n[c>>>2]>>>24-c%4*8&255;e[r+c>>>2]|=z<<24-(r+c)%4*8;}else for(var g=0;g<f;g+=4)e[r+g>>>2]=n[g>>>2];return this.sigBytes+=f,this},clamp:function(){var t=this.words,e=this.sigBytes;t[e>>>2]&=4294967295<<32-e%4*8,t.length=o.ceil(e/4);},clone:function(){var t=u.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],n=0;n<t;n+=4)e.push(_());return new l.init(e,t)}}),i=d.enc={},v=i.Hex={stringify:function(t){for(var e=t.words,n=t.sigBytes,r=[],f=0;f<n;f++){var c=e[f>>>2]>>>24-f%4*8&255;r.push((c>>>4).toString(16)),r.push((c&15).toString(16));}return r.join("")},parse:function(t){for(var e=t.length,n=[],r=0;r<e;r+=2)n[r>>>3]|=parseInt(t.substr(r,2),16)<<24-r%8*4;return new l.init(n,e/2)}},h=i.Latin1={stringify:function(t){for(var e=t.words,n=t.sigBytes,r=[],f=0;f<n;f++){var c=e[f>>>2]>>>24-f%4*8&255;r.push(String.fromCharCode(c));}return r.join("")},parse:function(t){for(var e=t.length,n=[],r=0;r<e;r++)n[r>>>2]|=(t.charCodeAt(r)&255)<<24-r%4*8;return new l.init(n,e)}},p=i.Utf8={stringify:function(t){try{return decodeURIComponent(escape(h.stringify(t)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(t){return h.parse(unescape(encodeURIComponent(t)))}},y=B.BufferedBlockAlgorithm=u.extend({reset:function(){this._data=new l.init,this._nDataBytes=0;},_append:function(t){typeof t=="string"&&(t=p.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes;},_process:function(t){var e,n=this._data,r=n.words,f=n.sigBytes,c=this.blockSize,z=c*4,g=f/z;t?g=o.ceil(g):g=o.max((g|0)-this._minBufferSize,0);var b=g*c,R=o.min(b*4,f);if(b){for(var A=0;A<b;A+=c)this._doProcessBlock(r,A);e=r.splice(0,b),n.sigBytes-=R;}return new l.init(e,R)},clone:function(){var t=u.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0});B.Hasher=y.extend({cfg:u.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset();},reset:function(){y.reset.call(this),this._doReset();},update:function(t){return this._append(t),this._process(),this},finalize:function(t){t&&this._append(t);var e=this._doFinalize();return e},blockSize:512/32,_createHelper:function(t){return function(e,n){return new t.init(n).finalize(e)}},_createHmacHelper:function(t){return function(e,n){return new s.HMAC.init(t,n).finalize(e)}}});var s=d.algo={};return d})(Math);return w});});var T=b((H,P)=>{(function(w,o){typeof H=="object"?P.exports=H=o(L()):typeof define=="function"&&define.amd?define(["./core"],o):o(w.CryptoJS);})(H,function(w){return (function(){var o=w,x=o.lib,a=x.WordArray,_=x.Hasher,C=o.algo,d=[],B=C.SHA1=_.extend({_doReset:function(){this._hash=new a.init([1732584193,4023233417,2562383102,271733878,3285377520]);},_doProcessBlock:function(u,l){for(var i=this._hash.words,v=i[0],h=i[1],p=i[2],y=i[3],m=i[4],s=0;s<80;s++){if(s<16)d[s]=u[l+s]|0;else {var t=d[s-3]^d[s-8]^d[s-14]^d[s-16];d[s]=t<<1|t>>>31;}var e=(v<<5|v>>>27)+m+d[s];s<20?e+=(h&p|~h&y)+1518500249:s<40?e+=(h^p^y)+1859775393:s<60?e+=(h&p|h&y|p&y)-1894007588:e+=(h^p^y)-899497514,m=y,y=p,p=h<<30|h>>>2,h=v,v=e;}i[0]=i[0]+v|0,i[1]=i[1]+h|0,i[2]=i[2]+p|0,i[3]=i[3]+y|0,i[4]=i[4]+m|0;},_doFinalize:function(){var u=this._data,l=u.words,i=this._nDataBytes*8,v=u.sigBytes*8;return l[v>>>5]|=128<<24-v%32,l[(v+64>>>9<<4)+14]=Math.floor(i/4294967296),l[(v+64>>>9<<4)+15]=i,u.sigBytes=l.length*4,this._process(),this._hash},clone:function(){var u=_.clone.call(this);return u._hash=this._hash.clone(),u}});o.SHA1=_._createHelper(B),o.HmacSHA1=_._createHmacHelper(B);})(),w.SHA1});});export{T as a};
@@ -0,0 +1 @@
1
+ import {j,l,i,k as k$1,m}from'./chunk-HD353M4B.mjs';import {a as a$1}from'./chunk-S7HZUIEI.mjs';import {d as d$1,e}from'./chunk-AW5XWF24.mjs';import {GameUnifier}from'@drincs/pixi-vn/core';import {cloneMaybeOffloaded}from'@drincs/pixi-vn/worker';var I;(n=>{n.storage=new d$1({cacheSize:50}),n.defaultStorage=new d$1({cacheSize:10}),n.tempStorageDeadlines=new Map;let s;function c(r){n.tempStorageDeadlines.forEach((i,o)=>{i>r&&(n.storage.delete(`${j}:${o}`),s?.onClearOldTempVariable?.(o),n.tempStorageDeadlines.delete(o));});}n.clearOldTempVariables=c;function T(r){s=r;}n.setExternalStoreHandler=T;function y(r,i,o){o==null?n.storage.delete(`${r}:${i}`):n.storage.set(`${r}:${i}`,o),s?.onSetVariable?.(i,o);}n.setVariable=y;function V(r,i){let o=n.storage.get(`${r}:${i}`);return a$1(o)}n.getVariable=V;function M(r,i){n.storage.delete(`${r}:${i}`),s?.onRemoveVariable?.(i);}n.removeVariable=M;function R(r,i){let o=n.storage.get(l)||[];if(i)o.includes(r)||o.push(r);else {let h=o.indexOf(r);h>-1&&o.splice(h,1);}n.storage.set(l,o);}n.setFlag=R;function v(r){return (n.storage.get(l)||[]).includes(r)}n.getFlag=v;})(I||={});var a=I;var _=class{get base(){return a.storage.map}get cache(){return a.storage.cache}get tempStorageDeadlines(){return a.tempStorageDeadlines}set default(t){Object.entries(t).forEach(([e,s])=>{a.defaultStorage.map.set(e,s);});}temp={set:(t,e)=>this.setTemp(t,e),remove:t=>this.removeTemp(t),get deadlines(){return a.tempStorageDeadlines}};flags={set:(t,e)=>a.setFlag(t,e),get:t=>a.getFlag(t)};set(t,e){return a.setVariable(i,t,e)}get(t){let e=a.getVariable(j,t);return e===void 0&&(e=a.getVariable(i,t)),e===void 0&&(e=a$1(a.defaultStorage.get(t))),e}remove(t){return this.temp.remove(t),a.removeVariable(i,t)}setTemp(t,e){if(e==null){this.temp.remove(t);return}else a.setVariable(j,t,e),this.temp.deadlines.has(t)||this.temp.deadlines.set(t,GameUnifier.openedLabels);}removeTemp(t){a.removeVariable(j,t),this.temp.deadlines.has(t)&&this.temp.deadlines.delete(t);}setTempVariable(t,e){this.temp.set(t,e);}removeTempVariable(t){this.temp.remove(t);}setFlag(t,e){this.flags.set(t,e);}getFlag(t){return this.flags.get(t)}setStorageHandler(t){a.setExternalStoreHandler(t);}clear(){this.base.clear(),this.cache.clear(),this.temp.deadlines.clear();}async export(){let t=[];[...this.base.keys()].forEach(s=>{t.push({key:s,value:this.base.get(s)});});let e=[];return [...this.temp.deadlines.keys()].forEach(s=>{e.push({key:s,value:this.temp.deadlines.get(s)});}),cloneMaybeOffloaded({main:t,tempDeadlines:e})}restore(t){this.clear();try{t?(t.base?.forEach(e=>{switch(e.key){case "___current_dialogue_memory___":a.setVariable(k$1,m.CURRENT_DIALOGUE_MEMORY_KEY,e.value);break;case "___last_dialogue_added_in_step_memory___":a.setVariable(k$1,m.LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY,e.value);break;case "___current_menu_options_memory___":a.setVariable(k$1,m.CURRENT_MENU_OPTIONS_MEMORY_KEY,e.value);break;case "___last_menu_options_added_in_step_memory___":a.setVariable(k$1,m.LAST_MENU_OPTIONS_ADDED_IN_STEP_MEMORY_KEY,e.value);break;case "_input_value_":a.setVariable(k$1,m.CURRENT_INPUT_VALUE_MEMORY_KEY,e.value);break;case "___last_input_added_in_step_memory___":a.setVariable(k$1,m.LAST_INPUT_ADDED_IN_STEP_MEMORY_KEY,e.value);break;case "___current_input_info_memory___":a.setVariable(k$1,m.CURRENT_INPUT_INFO_MEMORY_KEY,e.value);break;case "___opened_labels_counter___":a.setVariable(k$1,m.OPENED_LABELS_COUNTER_KEY,e.value);break;case "___all_choices_made___":a.setVariable(k$1,m.ALL_CHOICES_MADE_KEY,e.value);break;case "___current_step_times_counter___":a.setVariable(k$1,m.CURRENT_STEP_TIMES_COUNTER_KEY,e.value);break;case "___last_step_glued___":a.setVariable(k$1,m.LAST_STEP_GLUED,e.value);break;default:a.setVariable(i,e.key,e.value);}}),t.temp?.forEach(e=>{a.setVariable(j,e.key,e.value);}),t.flags?.forEach(e=>{a.setFlag(e,!0);}),t.main?.forEach(e=>{this.base.set(e.key,e.value);}),t.tempDeadlines?.forEach(e=>{this.temp.deadlines.set(e.key,e.value);})):e.warn("No storage data found");}catch(e$1){e.error("Error importing data",e$1);}}};var d=class{constructor(t,e){this.categoryId=t,this.id=e,this.migrateOldStorage();}migrateOldStorage(t=this.categoryId){let e=a.getVariable(i,t);e&&(Object.entries(e).forEach(([s,c])=>{typeof c=="object"&&c!==null&&Object.entries(c).forEach(([T,y])=>{a.setVariable(this.categoryId,`${s}:${T}`,y);});}),a.removeVariable(i,t));}id;categoryId;setStorageProperty(t,e){a.setVariable(this.categoryId,`${this.id}:${t}`,e);}getStorageProperty(t,e=this.id){return a.getVariable(this.categoryId,`${e}:${t}`)}};var k=new _;export{a,d as b,k as c};
@@ -0,0 +1 @@
1
+ var Ht=Object.create;var Tt=Object.defineProperty;var Kt=Object.getOwnPropertyDescriptor;var $t=Object.getOwnPropertyNames;var Bt=Object.getPrototypeOf,qt=Object.prototype.hasOwnProperty;var Ut=l=>{throw TypeError(l)};var Xt=(l,e,i)=>e in l?Tt(l,e,{enumerable:true,configurable:true,writable:true,value:i}):l[e]=i;var ee=(l=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(l,{get:(e,i)=>(typeof require<"u"?require:e)[i]}):l)(function(l){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+l+'" is not supported')});var ie=(l,e)=>()=>(e||l((e={exports:{}}).exports,e),e.exports);var Yt=(l,e,i,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let h of $t(e))!qt.call(l,h)&&h!==i&&Tt(l,h,{get:()=>e[h],enumerable:!(s=Kt(e,h))||s.enumerable});return l};var se=(l,e,i)=>(i=l!=null?Ht(Bt(l)):{},Yt(e||!l||!l.__esModule?Tt(i,"default",{value:l,enumerable:true}):i,l));var x=(l,e,i)=>Xt(l,typeof e!="symbol"?e+"":e,i),xt=(l,e,i)=>e.has(l)||Ut("Cannot "+i);var t=(l,e,i)=>(xt(l,e,"read from private field"),i?i.call(l):e.get(l)),g=(l,e,i)=>e.has(l)?Ut("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(l):e.set(l,i),f=(l,e,i,s)=>(xt(l,e,"write to private field"),e.set(l,i),i),a=(l,e,i)=>(xt(l,e,"access private method"),i);var bt=(l,e,i,s)=>({set _(h){f(l,e,h);},get _(){return t(l,e,s)}});var Jt;(h=>(h.log=(n,...o)=>console.log(`[Pixi\u2019VN] ${n}`,...o),h.warn=(n,...o)=>console.warn(`[Pixi\u2019VN] ${n}`,...o),h.error=(n,...o)=>console.error(`[Pixi\u2019VN] ${n}`,...o),h.info=(n,...o)=>console.info(`[Pixi\u2019VN] ${n}`,...o)))(Jt||={});var Qt=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Nt=new Set,zt=typeof process=="object"&&process?process:{},It=(l,e,i,s)=>{typeof zt.emitWarning=="function"?zt.emitWarning(l,e,i,s):console.error(`[${i}] ${e}: ${l}`);},Ft=globalThis.AbortController,Gt=globalThis.AbortSignal;if(typeof Ft>"u"){Gt=class{onabort;_onabort=[];reason;aborted=false;addEventListener(i,s){this._onabort.push(s);}},Ft=class{constructor(){e();}signal=new Gt;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 l=zt.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{l&&(l=false,It("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 Zt=l=>!Nt.has(l);var tt=l=>l&&l===Math.floor(l)&&l>0&&isFinite(l),Vt=l=>tt(l)?l<=Math.pow(2,8)?Uint8Array:l<=Math.pow(2,16)?Uint16Array:l<=Math.pow(2,32)?Uint32Array:l<=Number.MAX_SAFE_INTEGER?_t:null:null,_t=class extends Array{constructor(l){super(l),this.fill(0);}},J,ct,te=(J=class{heap;length;static create(e){let i=Vt(e);if(!i)return [];f(J,ct,true);let s=new J(e,i);return f(J,ct,false),s}constructor(e,i){if(!t(J,ct))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new i(e),this.length=0;}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}},ct=new WeakMap,g(J,ct,false),J),Mt,jt,V,U,P,ot,k,ft,dt,H,O,K,A,y,d,W,G,z,F,$,E,B,q,M,j,X,ht,D,pt,r,Rt,nt,Q,St,N,kt,rt,gt,yt,et,it,Ct,At,Ot,S,Wt,vt,st,Dt,wt,Pt=(wt=class{constructor(e){g(this,r);g(this,V);g(this,U);g(this,P);g(this,ot);g(this,k);g(this,ft);g(this,dt);g(this,H);x(this,"ttl");x(this,"ttlResolution");x(this,"ttlAutopurge");x(this,"updateAgeOnGet");x(this,"updateAgeOnHas");x(this,"allowStale");x(this,"noDisposeOnSet");x(this,"noUpdateTTL");x(this,"maxEntrySize");x(this,"sizeCalculation");x(this,"noDeleteOnFetchRejection");x(this,"noDeleteOnStaleGet");x(this,"allowStaleOnFetchAbort");x(this,"allowStaleOnFetchRejection");x(this,"ignoreFetchAbort");g(this,O);g(this,K);g(this,A);g(this,y);g(this,d);g(this,W);g(this,G);g(this,z);g(this,F);g(this,$);g(this,E);g(this,B);g(this,q);g(this,M);g(this,j);g(this,X);g(this,ht);g(this,D);g(this,pt);g(this,nt,()=>{});g(this,Q,()=>{});g(this,St,()=>{});g(this,N,()=>false);g(this,rt,e=>{});g(this,gt,(e,i,s)=>{});g(this,yt,(e,i,s,h)=>{if(s||h)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});x(this,Mt,"LRUCache");let{max:i=0,ttl:s,ttlResolution:h=1,ttlAutopurge:n,updateAgeOnGet:o,updateAgeOnHas:u,allowStale:c,dispose:w,onInsert:T,disposeAfter:m,noDisposeOnSet:Z,noUpdateTTL:I,maxSize:Y=0,maxEntrySize:b=0,sizeCalculation:v,fetchMethod:p,memoMethod:R,noDeleteOnFetchRejection:L,noDeleteOnStaleGet:C,allowStaleOnFetchRejection:_,allowStaleOnFetchAbort:mt,ignoreFetchAbort:lt,perf:at}=e;if(at!==void 0&&typeof at?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(f(this,H,at??Qt),i!==0&&!tt(i))throw new TypeError("max option must be a nonnegative integer");let ut=i?Vt(i):Array;if(!ut)throw new Error("invalid max value: "+i);if(f(this,V,i),f(this,U,Y),this.maxEntrySize=b||t(this,U),this.sizeCalculation=v,this.sizeCalculation){if(!t(this,U)&&!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(R!==void 0&&typeof R!="function")throw new TypeError("memoMethod must be a function if defined");if(f(this,dt,R),p!==void 0&&typeof p!="function")throw new TypeError("fetchMethod must be a function if specified");if(f(this,ft,p),f(this,ht,!!p),f(this,A,new Map),f(this,y,new Array(i).fill(void 0)),f(this,d,new Array(i).fill(void 0)),f(this,W,new ut(i)),f(this,G,new ut(i)),f(this,z,0),f(this,F,0),f(this,$,te.create(i)),f(this,O,0),f(this,K,0),typeof w=="function"&&f(this,P,w),typeof T=="function"&&f(this,ot,T),typeof m=="function"?(f(this,k,m),f(this,E,[])):(f(this,k,void 0),f(this,E,void 0)),f(this,X,!!t(this,P)),f(this,pt,!!t(this,ot)),f(this,D,!!t(this,k)),this.noDisposeOnSet=!!Z,this.noUpdateTTL=!!I,this.noDeleteOnFetchRejection=!!L,this.allowStaleOnFetchRejection=!!_,this.allowStaleOnFetchAbort=!!mt,this.ignoreFetchAbort=!!lt,this.maxEntrySize!==0){if(t(this,U)!==0&&!tt(t(this,U)))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");a(this,r,kt).call(this);}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!C,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!u,this.ttlResolution=tt(h)||h===0?h:1,this.ttlAutopurge=!!n,this.ttl=s||0,this.ttl){if(!tt(this.ttl))throw new TypeError("ttl must be a positive integer if specified");a(this,r,Rt).call(this);}if(t(this,V)===0&&this.ttl===0&&t(this,U)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!t(this,V)&&!t(this,U)){let Et="LRU_CACHE_UNBOUNDED";Zt(Et)&&(Nt.add(Et),It("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",Et,wt));}}get perf(){return t(this,H)}static unsafeExposeInternals(e){return {starts:t(e,q),ttls:t(e,M),autopurgeTimers:t(e,j),sizes:t(e,B),keyMap:t(e,A),keyList:t(e,y),valList:t(e,d),next:t(e,W),prev:t(e,G),get head(){return t(e,z)},get tail(){return t(e,F)},free:t(e,$),isBackgroundFetch:i=>{var s;return a(s=e,r,S).call(s,i)},backgroundFetch:(i,s,h,n)=>{var o;return a(o=e,r,Ot).call(o,i,s,h,n)},moveToTail:i=>{var s;return a(s=e,r,vt).call(s,i)},indexes:i=>{var s;return a(s=e,r,et).call(s,i)},rindexes:i=>{var s;return a(s=e,r,it).call(s,i)},isStale:i=>{var s;return t(s=e,N).call(s,i)}}}get max(){return t(this,V)}get maxSize(){return t(this,U)}get calculatedSize(){return t(this,K)}get size(){return t(this,O)}get fetchMethod(){return t(this,ft)}get memoMethod(){return t(this,dt)}get dispose(){return t(this,P)}get onInsert(){return t(this,ot)}get disposeAfter(){return t(this,k)}getRemainingTTL(e){return t(this,A).has(e)?1/0:0}*entries(){for(let e of a(this,r,et).call(this))t(this,d)[e]!==void 0&&t(this,y)[e]!==void 0&&!a(this,r,S).call(this,t(this,d)[e])&&(yield [t(this,y)[e],t(this,d)[e]]);}*rentries(){for(let e of a(this,r,it).call(this))t(this,d)[e]!==void 0&&t(this,y)[e]!==void 0&&!a(this,r,S).call(this,t(this,d)[e])&&(yield [t(this,y)[e],t(this,d)[e]]);}*keys(){for(let e of a(this,r,et).call(this)){let i=t(this,y)[e];i!==void 0&&!a(this,r,S).call(this,t(this,d)[e])&&(yield i);}}*rkeys(){for(let e of a(this,r,it).call(this)){let i=t(this,y)[e];i!==void 0&&!a(this,r,S).call(this,t(this,d)[e])&&(yield i);}}*values(){for(let e of a(this,r,et).call(this))t(this,d)[e]!==void 0&&!a(this,r,S).call(this,t(this,d)[e])&&(yield t(this,d)[e]);}*rvalues(){for(let e of a(this,r,it).call(this))t(this,d)[e]!==void 0&&!a(this,r,S).call(this,t(this,d)[e])&&(yield t(this,d)[e]);}[(jt=Symbol.iterator,Mt=Symbol.toStringTag,jt)](){return this.entries()}find(e,i={}){for(let s of a(this,r,et).call(this)){let h=t(this,d)[s],n=a(this,r,S).call(this,h)?h.__staleWhileFetching:h;if(n!==void 0&&e(n,t(this,y)[s],this))return this.get(t(this,y)[s],i)}}forEach(e,i=this){for(let s of a(this,r,et).call(this)){let h=t(this,d)[s],n=a(this,r,S).call(this,h)?h.__staleWhileFetching:h;n!==void 0&&e.call(i,n,t(this,y)[s],this);}}rforEach(e,i=this){for(let s of a(this,r,it).call(this)){let h=t(this,d)[s],n=a(this,r,S).call(this,h)?h.__staleWhileFetching:h;n!==void 0&&e.call(i,n,t(this,y)[s],this);}}purgeStale(){let e=false;for(let i of a(this,r,it).call(this,{allowStale:true}))t(this,N).call(this,i)&&(a(this,r,st).call(this,t(this,y)[i],"expire"),e=true);return e}info(e){let i=t(this,A).get(e);if(i===void 0)return;let s=t(this,d)[i],h=a(this,r,S).call(this,s)?s.__staleWhileFetching:s;if(h===void 0)return;let n={value:h};if(t(this,M)&&t(this,q)){let o=t(this,M)[i],u=t(this,q)[i];if(o&&u){let c=o-(t(this,H).now()-u);n.ttl=c,n.start=Date.now();}}return t(this,B)&&(n.size=t(this,B)[i]),n}dump(){let e=[];for(let i of a(this,r,et).call(this,{allowStale:true})){let s=t(this,y)[i],h=t(this,d)[i],n=a(this,r,S).call(this,h)?h.__staleWhileFetching:h;if(n===void 0||s===void 0)continue;let o={value:n};if(t(this,M)&&t(this,q)){o.ttl=t(this,M)[i];let u=t(this,H).now()-t(this,q)[i];o.start=Math.floor(Date.now()-u);}t(this,B)&&(o.size=t(this,B)[i]),e.unshift([s,o]);}return e}load(e){this.clear();for(let[i,s]of e){if(s.start){let h=Date.now()-s.start;s.start=t(this,H).now()-h;}this.set(i,s.value,s);}}set(e,i,s={}){var Z,I,Y,b;if(i===void 0)return this.delete(e),this;let{ttl:h=this.ttl,start:n,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:u=this.sizeCalculation,status:c}=s,{noUpdateTTL:w=this.noUpdateTTL}=s,T=t(this,yt).call(this,e,i,s.size||0,u);if(this.maxEntrySize&&T>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=true),a(this,r,st).call(this,e,"set"),this;let m=t(this,O)===0?void 0:t(this,A).get(e);if(m===void 0)m=t(this,O)===0?t(this,F):t(this,$).length!==0?t(this,$).pop():t(this,O)===t(this,V)?a(this,r,At).call(this,false):t(this,O),t(this,y)[m]=e,t(this,d)[m]=i,t(this,A).set(e,m),t(this,W)[t(this,F)]=m,t(this,G)[m]=t(this,F),f(this,F,m),bt(this,O)._++,t(this,gt).call(this,m,T,c),c&&(c.set="add"),w=false,t(this,pt)&&((Z=t(this,ot))==null||Z.call(this,i,e,"add"));else {a(this,r,vt).call(this,m);let v=t(this,d)[m];if(i!==v){if(t(this,ht)&&a(this,r,S).call(this,v)){v.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:p}=v;p!==void 0&&!o&&(t(this,X)&&((I=t(this,P))==null||I.call(this,p,e,"set")),t(this,D)&&t(this,E)?.push([p,e,"set"]));}else o||(t(this,X)&&((Y=t(this,P))==null||Y.call(this,v,e,"set")),t(this,D)&&t(this,E)?.push([v,e,"set"]));if(t(this,rt).call(this,m),t(this,gt).call(this,m,T,c),t(this,d)[m]=i,c){c.set="replace";let p=v&&a(this,r,S).call(this,v)?v.__staleWhileFetching:v;p!==void 0&&(c.oldValue=p);}}else c&&(c.set="update");t(this,pt)&&this.onInsert?.(i,e,i===v?"update":"replace");}if(h!==0&&!t(this,M)&&a(this,r,Rt).call(this),t(this,M)&&(w||t(this,St).call(this,m,h,n),c&&t(this,Q).call(this,c,m)),!o&&t(this,D)&&t(this,E)){let v=t(this,E),p;for(;p=v?.shift();)(b=t(this,k))==null||b.call(this,...p);}return this}pop(){var e;try{for(;t(this,O);){let i=t(this,d)[t(this,z)];if(a(this,r,At).call(this,!0),a(this,r,S).call(this,i)){if(i.__staleWhileFetching)return i.__staleWhileFetching}else if(i!==void 0)return i}}finally{if(t(this,D)&&t(this,E)){let i=t(this,E),s;for(;s=i?.shift();)(e=t(this,k))==null||e.call(this,...s);}}}has(e,i={}){let{updateAgeOnHas:s=this.updateAgeOnHas,status:h}=i,n=t(this,A).get(e);if(n!==void 0){let o=t(this,d)[n];if(a(this,r,S).call(this,o)&&o.__staleWhileFetching===void 0)return false;if(t(this,N).call(this,n))h&&(h.has="stale",t(this,Q).call(this,h,n));else return s&&t(this,nt).call(this,n),h&&(h.has="hit",t(this,Q).call(this,h,n)),true}else h&&(h.has="miss");return false}peek(e,i={}){let{allowStale:s=this.allowStale}=i,h=t(this,A).get(e);if(h===void 0||!s&&t(this,N).call(this,h))return;let n=t(this,d)[h];return a(this,r,S).call(this,n)?n.__staleWhileFetching:n}async fetch(e,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:h=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:u=this.noDisposeOnSet,size:c=0,sizeCalculation:w=this.sizeCalculation,noUpdateTTL:T=this.noUpdateTTL,noDeleteOnFetchRejection:m=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:Z=this.allowStaleOnFetchRejection,ignoreFetchAbort:I=this.ignoreFetchAbort,allowStaleOnFetchAbort:Y=this.allowStaleOnFetchAbort,context:b,forceRefresh:v=false,status:p,signal:R}=i;if(!t(this,ht))return p&&(p.fetch="get"),this.get(e,{allowStale:s,updateAgeOnGet:h,noDeleteOnStaleGet:n,status:p});let L={allowStale:s,updateAgeOnGet:h,noDeleteOnStaleGet:n,ttl:o,noDisposeOnSet:u,size:c,sizeCalculation:w,noUpdateTTL:T,noDeleteOnFetchRejection:m,allowStaleOnFetchRejection:Z,allowStaleOnFetchAbort:Y,ignoreFetchAbort:I,status:p,signal:R},C=t(this,A).get(e);if(C===void 0){p&&(p.fetch="miss");let _=a(this,r,Ot).call(this,e,C,L,b);return _.__returned=_}else {let _=t(this,d)[C];if(a(this,r,S).call(this,_)){let ut=s&&_.__staleWhileFetching!==void 0;return p&&(p.fetch="inflight",ut&&(p.returnedStale=true)),ut?_.__staleWhileFetching:_.__returned=_}let mt=t(this,N).call(this,C);if(!v&&!mt)return p&&(p.fetch="hit"),a(this,r,vt).call(this,C),h&&t(this,nt).call(this,C),p&&t(this,Q).call(this,p,C),_;let lt=a(this,r,Ot).call(this,e,C,L,b),at=lt.__staleWhileFetching!==void 0&&s;return p&&(p.fetch=mt?"stale":"refresh",at&&mt&&(p.returnedStale=true)),at?lt.__staleWhileFetching:lt.__returned=lt}}async forceFetch(e,i={}){let s=await this.fetch(e,i);if(s===void 0)throw new Error("fetch() returned undefined");return s}memo(e,i={}){let s=t(this,dt);if(!s)throw new Error("no memoMethod provided to constructor");let{context:h,forceRefresh:n,...o}=i,u=this.get(e,o);if(!n&&u!==void 0)return u;let c=s(e,u,{options:o,context:h});return this.set(e,c,o),c}get(e,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:h=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:o}=i,u=t(this,A).get(e);if(u!==void 0){let c=t(this,d)[u],w=a(this,r,S).call(this,c);return o&&t(this,Q).call(this,o,u),t(this,N).call(this,u)?(o&&(o.get="stale"),w?(o&&s&&c.__staleWhileFetching!==void 0&&(o.returnedStale=true),s?c.__staleWhileFetching:void 0):(n||a(this,r,st).call(this,e,"expire"),o&&s&&(o.returnedStale=true),s?c:void 0)):(o&&(o.get="hit"),w?c.__staleWhileFetching:(a(this,r,vt).call(this,u),h&&t(this,nt).call(this,u),c))}else o&&(o.get="miss");}delete(e){return a(this,r,st).call(this,e,"delete")}clear(){return a(this,r,Dt).call(this,"delete")}},V=new WeakMap,U=new WeakMap,P=new WeakMap,ot=new WeakMap,k=new WeakMap,ft=new WeakMap,dt=new WeakMap,H=new WeakMap,O=new WeakMap,K=new WeakMap,A=new WeakMap,y=new WeakMap,d=new WeakMap,W=new WeakMap,G=new WeakMap,z=new WeakMap,F=new WeakMap,$=new WeakMap,E=new WeakMap,B=new WeakMap,q=new WeakMap,M=new WeakMap,j=new WeakMap,X=new WeakMap,ht=new WeakMap,D=new WeakMap,pt=new WeakMap,r=new WeakSet,Rt=function(){let e=new _t(t(this,V)),i=new _t(t(this,V));f(this,M,e),f(this,q,i);let s=this.ttlAutopurge?new Array(t(this,V)):void 0;f(this,j,s),f(this,St,(u,c,w=t(this,H).now())=>{i[u]=c!==0?w:0,e[u]=c,h(u,c);}),f(this,nt,u=>{i[u]=e[u]!==0?t(this,H).now():0,h(u,e[u]);});let h=this.ttlAutopurge?(u,c)=>{if(s?.[u]&&(clearTimeout(s[u]),s[u]=void 0),c&&c!==0&&s){let w=setTimeout(()=>{t(this,N).call(this,u)&&a(this,r,st).call(this,t(this,y)[u],"expire");},c+1);w.unref&&w.unref(),s[u]=w;}}:()=>{};f(this,Q,(u,c)=>{if(e[c]){let w=e[c],T=i[c];if(!w||!T)return;u.ttl=w,u.start=T,u.now=n||o();let m=u.now-T;u.remainingTTL=w-m;}});let n=0,o=()=>{let u=t(this,H).now();if(this.ttlResolution>0){n=u;let c=setTimeout(()=>n=0,this.ttlResolution);c.unref&&c.unref();}return u};this.getRemainingTTL=u=>{let c=t(this,A).get(u);if(c===void 0)return 0;let w=e[c],T=i[c];if(!w||!T)return 1/0;let m=(n||o())-T;return w-m},f(this,N,u=>{let c=i[u],w=e[u];return !!w&&!!c&&(n||o())-c>w});},nt=new WeakMap,Q=new WeakMap,St=new WeakMap,N=new WeakMap,kt=function(){let e=new _t(t(this,V));f(this,K,0),f(this,B,e),f(this,rt,i=>{f(this,K,t(this,K)-e[i]),e[i]=0;}),f(this,yt,(i,s,h,n)=>{if(a(this,r,S).call(this,s))return 0;if(!tt(h))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(h=n(s,i),!tt(h))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 h}),f(this,gt,(i,s,h)=>{if(e[i]=s,t(this,U)){let n=t(this,U)-e[i];for(;t(this,K)>n;)a(this,r,At).call(this,true);}f(this,K,t(this,K)+e[i]),h&&(h.entrySize=s,h.totalCalculatedSize=t(this,K));});},rt=new WeakMap,gt=new WeakMap,yt=new WeakMap,et=function*({allowStale:e=this.allowStale}={}){if(t(this,O))for(let i=t(this,F);!(!a(this,r,Ct).call(this,i)||((e||!t(this,N).call(this,i))&&(yield i),i===t(this,z)));)i=t(this,G)[i];},it=function*({allowStale:e=this.allowStale}={}){if(t(this,O))for(let i=t(this,z);!(!a(this,r,Ct).call(this,i)||((e||!t(this,N).call(this,i))&&(yield i),i===t(this,F)));)i=t(this,W)[i];},Ct=function(e){return e!==void 0&&t(this,A).get(t(this,y)[e])===e},At=function(e){var n;let i=t(this,z),s=t(this,y)[i],h=t(this,d)[i];return t(this,ht)&&a(this,r,S).call(this,h)?h.__abortController.abort(new Error("evicted")):(t(this,X)||t(this,D))&&(t(this,X)&&((n=t(this,P))==null||n.call(this,h,s,"evict")),t(this,D)&&t(this,E)?.push([h,s,"evict"])),t(this,rt).call(this,i),t(this,j)?.[i]&&(clearTimeout(t(this,j)[i]),t(this,j)[i]=void 0),e&&(t(this,y)[i]=void 0,t(this,d)[i]=void 0,t(this,$).push(i)),t(this,O)===1?(f(this,z,f(this,F,0)),t(this,$).length=0):f(this,z,t(this,W)[i]),t(this,A).delete(s),bt(this,O)._--,i},Ot=function(e,i,s,h){let n=i===void 0?void 0:t(this,d)[i];if(a(this,r,S).call(this,n))return n;let o=new Ft,{signal:u}=s;u?.addEventListener("abort",()=>o.abort(u.reason),{signal:o.signal});let c={signal:o.signal,options:s,context:h},w=(b,v=false)=>{let{aborted:p}=o.signal,R=s.ignoreFetchAbort&&b!==void 0,L=s.ignoreFetchAbort||!!(s.allowStaleOnFetchAbort&&b!==void 0);if(s.status&&(p&&!v?(s.status.fetchAborted=true,s.status.fetchError=o.signal.reason,R&&(s.status.fetchAbortIgnored=true)):s.status.fetchResolved=true),p&&!R&&!v)return m(o.signal.reason,L);let C=I,_=t(this,d)[i];return (_===I||R&&v&&_===void 0)&&(b===void 0?C.__staleWhileFetching!==void 0?t(this,d)[i]=C.__staleWhileFetching:a(this,r,st).call(this,e,"fetch"):(s.status&&(s.status.fetchUpdated=true),this.set(e,b,c.options))),b},T=b=>(s.status&&(s.status.fetchRejected=true,s.status.fetchError=b),m(b,false)),m=(b,v)=>{let{aborted:p}=o.signal,R=p&&s.allowStaleOnFetchAbort,L=R||s.allowStaleOnFetchRejection,C=L||s.noDeleteOnFetchRejection,_=I;if(t(this,d)[i]===I&&(!C||!v&&_.__staleWhileFetching===void 0?a(this,r,st).call(this,e,"fetch"):R||(t(this,d)[i]=_.__staleWhileFetching)),L)return s.status&&_.__staleWhileFetching!==void 0&&(s.status.returnedStale=true),_.__staleWhileFetching;if(_.__returned===_)throw b},Z=(b,v)=>{var R;let p=(R=t(this,ft))==null?void 0:R.call(this,e,n,c);p&&p instanceof Promise&&p.then(L=>b(L===void 0?void 0:L),v),o.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(b(void 0),s.allowStaleOnFetchAbort&&(b=L=>w(L,true)));});};s.status&&(s.status.fetchDispatched=true);let I=new Promise(Z).then(w,T),Y=Object.assign(I,{__abortController:o,__staleWhileFetching:n,__returned:void 0});return i===void 0?(this.set(e,Y,{...c.options,status:void 0}),i=t(this,A).get(e)):t(this,d)[i]=Y,Y},S=function(e){if(!t(this,ht))return false;let i=e;return !!i&&i instanceof Promise&&i.hasOwnProperty("__staleWhileFetching")&&i.__abortController instanceof Ft},Wt=function(e,i){t(this,G)[i]=e,t(this,W)[e]=i;},vt=function(e){e!==t(this,F)&&(e===t(this,z)?f(this,z,t(this,W)[e]):a(this,r,Wt).call(this,t(this,G)[e],t(this,W)[e]),a(this,r,Wt).call(this,t(this,F),e),f(this,F,e));},st=function(e,i){var h,n;let s=false;if(t(this,O)!==0){let o=t(this,A).get(e);if(o!==void 0)if(t(this,j)?.[o]&&(clearTimeout(t(this,j)?.[o]),t(this,j)[o]=void 0),s=true,t(this,O)===1)a(this,r,Dt).call(this,i);else {t(this,rt).call(this,o);let u=t(this,d)[o];if(a(this,r,S).call(this,u)?u.__abortController.abort(new Error("deleted")):(t(this,X)||t(this,D))&&(t(this,X)&&((h=t(this,P))==null||h.call(this,u,e,i)),t(this,D)&&t(this,E)?.push([u,e,i])),t(this,A).delete(e),t(this,y)[o]=void 0,t(this,d)[o]=void 0,o===t(this,F))f(this,F,t(this,G)[o]);else if(o===t(this,z))f(this,z,t(this,W)[o]);else {let c=t(this,G)[o];t(this,W)[c]=t(this,W)[o];let w=t(this,W)[o];t(this,G)[w]=t(this,G)[o];}bt(this,O)._--,t(this,$).push(o);}}if(t(this,D)&&t(this,E)?.length){let o=t(this,E),u;for(;u=o?.shift();)(n=t(this,k))==null||n.call(this,...u);}return s},Dt=function(e){var i,s;for(let h of a(this,r,it).call(this,{allowStale:true})){let n=t(this,d)[h];if(a(this,r,S).call(this,n))n.__abortController.abort(new Error("deleted"));else {let o=t(this,y)[h];t(this,X)&&((i=t(this,P))==null||i.call(this,n,o,e)),t(this,D)&&t(this,E)?.push([n,o,e]);}}if(t(this,A).clear(),t(this,d).fill(void 0),t(this,y).fill(void 0),t(this,M)&&t(this,q)){t(this,M).fill(0),t(this,q).fill(0);for(let h of t(this,j)??[])h!==void 0&&clearTimeout(h);t(this,j)?.fill(void 0);}if(t(this,B)&&t(this,B).fill(0),f(this,z,0),f(this,F,0),t(this,$).length=0,f(this,K,0),f(this,O,0),t(this,D)&&t(this,E)){let h=t(this,E),n;for(;n=h?.shift();)(s=t(this,k))==null||s.call(this,...n);}},wt);var Lt=class{cache;map=new Map;constructor(e){this.cache=new Pt({max:e.cacheSize}),this.map=new Map;}get[Symbol.iterator](){return this.map[Symbol.iterator]}get[Symbol.toStringTag](){return this.map[Symbol.toStringTag]}clear(){this.cache.clear(),this.map.clear();}delete(e){let i=this.map.delete(e);return i&&this.cache.delete(e),i}get forEach(){return this.map.forEach}get(e){let i=this.cache.get(e);return i||this.map.get(e)}has(e){return this.map.has(e)}set(e,i){return this.map.set(e,i),this.cache.set(e,i),this}get size(){return this.map.size}entries(){return this.map.entries()}keys(){return this.map.keys()}values(){return this.map.values()}};export{ee as a,ie as b,se as c,Lt as d,Jt as e};
@@ -0,0 +1 @@
1
+ var _="__game_layer__",E="Container",A="ImageContainer",e="Image",t="Sprite",o="Text",T="Video",N="general",R="storage",I="temp",S="narration",O="flags",n={CURRENT_DIALOGUE_MEMORY_KEY:"dialogue",LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY:"dialogue:step_counter",CURRENT_MENU_OPTIONS_MEMORY_KEY:"choice:options",LAST_MENU_OPTIONS_ADDED_IN_STEP_MEMORY_KEY:"choice:step_counter",CURRENT_INPUT_VALUE_MEMORY_KEY:"input:value",LAST_INPUT_ADDED_IN_STEP_MEMORY_KEY:"input:step_counter",CURRENT_INPUT_INFO_MEMORY_KEY:"input:info",CHARACTER_CATEGORY_KEY:"character",ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY:"___glue___",OPENED_LABELS_COUNTER_KEY:"label:opened",ALL_CHOICES_MADE_KEY:"choices:made",CURRENT_STEP_TIMES_COUNTER_KEY:"label:history",LAST_STEP_GLUED:"glue:last_step"};export{_ as a,E as b,A as c,e as d,t as e,o as f,T as g,N as h,R as i,I as j,S as k,O as l,n as m};
@@ -0,0 +1 @@
1
+ var n=class extends Error{code;constructor(t,a,m,o,r){super(`[Pixi\u2019VN] ${a}`),this.code=t,m==="canvas"&&(this.canvasElementInfo=o,this.parent=r);}canvasElementInfo;parent};var i;(o=>(o.log=(r,...s)=>console.log(`[Pixi\u2019VN] ${r}`,...s),o.warn=(r,...s)=>console.warn(`[Pixi\u2019VN] ${r}`,...s),o.error=(r,...s)=>console.error(`[Pixi\u2019VN] ${r}`,...s),o.info=(r,...s)=>console.info(`[Pixi\u2019VN] ${r}`,...s)))(i||={});var l=class e{static init(t){t.navigate&&(e._navigate=t.navigate),e._getStepCounter=t.getStepCounter,e._setStepCounter=t.setStepCounter,e._getCurrentGameStepState=t.getCurrentGameStepState,e._restoreGameStepState=t.restoreGameStepState,e._getOpenedLabels=t.getOpenedLabels,e._processNavigationRequests=t.processNavigationRequests,e._getVariable=t.getVariable,e._setVariable=t.setVariable,e._removeVariable=t.removeVariable,e._getFlag=t.getFlag,e._setFlag=t.setFlag,t.onLabelClosing&&(e._onLabelClosing=t.onLabelClosing),e._addHistoryItem=t.addHistoryItem,e._getCharacter=t.getCharacter,e._animate=t.animate,e._animateFilter=t.animateFilter,e._removeCanvasComponent=t.removeCanvasComponent,e._canvasComponentExists=t.canvasComponentExists;}static _navigate=()=>{i.warn("Navigate function not initialized. You should add the navigate function in the Game.init() method.");};static get navigate(){return e._navigate}static set navigate(t){e._navigate=t;}static _getStepCounter=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static _setStepCounter=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get stepCounter(){return e._getStepCounter()}static set stepCounter(t){e._setStepCounter(t);}static _getCurrentGameStepState=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get currentGameStepState(){return e._getCurrentGameStepState()}static _restoreGameStepState=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get restoreGameStepState(){return e._restoreGameStepState}static _getOpenedLabels=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get openedLabels(){return e._getOpenedLabels()}static _onPreContinueHandlers=[];static addOnPreContinue(t){e._onPreContinueHandlers.push(t);}static removeOnPreContinue(t){e._onPreContinueHandlers=e._onPreContinueHandlers.filter(a=>a!==t);}static clearOnPreContinueHandlers(){e._onPreContinueHandlers=[];}static async runOnPreContinue(){let t=e._onPreContinueHandlers.slice();await Promise.all(t.map(a=>a()));}static get onPreContinue(){return e.runOnPreContinue}static navigationRequestsCount=0;static processNavigationLock=Promise.resolve();static get continueRequestsCount(){return e.navigationRequestsCount}static increaseContinueRequest(t=1){e.navigationRequestsCount+=t;}static get backRequestsCount(){return -1*e.navigationRequestsCount}static increaseBackRequest(t=1){e.navigationRequestsCount-=t;}static _processNavigationRequests=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static async processNavigationRequests(t){let a=e._processNavigationRequests(e.navigationRequestsCount,t);return e.navigationRequestsCount=a.newValue,await a.result}static _getVariable=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get getVariable(){return e._getVariable}static _setVariable=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get setVariable(){return e._setVariable}static _removeVariable=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get removeVariable(){return e._removeVariable}static _getFlag=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get getFlag(){return e._getFlag}static _setFlag=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get setFlag(){return e._setFlag}static _onLabelClosing=()=>{};static get onLabelClosing(){return e._onLabelClosing}static _addHistoryItem=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get addHistoryItem(){return e._addHistoryItem}static runningStepsCount=0;static _getCharacter=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented.")};static get getCharacter(){return e._getCharacter}static onEnd;static _onErrorHandlers=[];static addOnError(t){return e._onErrorHandlers.push(t),()=>e.removeOnError(t)}static removeOnError(t){e._onErrorHandlers=e._onErrorHandlers.filter(a=>a!==t);}static clearOnErrorHandlers(){e._onErrorHandlers.length=0;}static async runOnError(t,a){for(let m of e._onErrorHandlers.slice())try{await m(t,a);}catch(o){i.error("Error in onError handler",o);}}static _animate=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get animate(){return e._animate}static _animateFilter=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get animateFilter(){return e._animateFilter}static _removeCanvasComponent=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get removeCanvasComponent(){return e._removeCanvasComponent}static _canvasComponentExists=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get canvasComponentExists(){return e._canvasComponentExists}};export{n as a,i as b,l as c};
@@ -0,0 +1 @@
1
+ import {e}from'./chunk-AW5XWF24.mjs';import {PixiError}from'@drincs/pixi-vn/core';function a(r){try{if(typeof r>"u")return r;let e=JSON.stringify(r);return JSON.parse(e)}catch(e$1){throw e.error("Error creating exportable element",r,e$1),new PixiError("not_json_serializable","Error creating exportable element")}}export{a};
package/dist/core.cjs CHANGED
@@ -1 +1 @@
1
- 'use strict';var a=class extends Error{code;constructor(t,n,m,o,r){super(`[Pixi\u2019VN] ${n}`),this.code=t,m==="canvas"&&(this.canvasElementInfo=o,this.parent=r);}canvasElementInfo;parent};var i;(o=>(o.log=(r,...s)=>console.log(`[Pixi\u2019VN] ${r}`,...s),o.warn=(r,...s)=>console.warn(`[Pixi\u2019VN] ${r}`,...s),o.error=(r,...s)=>console.error(`[Pixi\u2019VN] ${r}`,...s),o.info=(r,...s)=>console.info(`[Pixi\u2019VN] ${r}`,...s)))(i||={});var l=class e{static init(t){t.navigate&&(e._navigate=t.navigate),e._getStepCounter=t.getStepCounter,e._setStepCounter=t.setStepCounter,e._getCurrentGameStepState=t.getCurrentGameStepState,e._restoreGameStepState=t.restoreGameStepState,e._getOpenedLabels=t.getOpenedLabels,e._processNavigationRequests=t.processNavigationRequests,e._getVariable=t.getVariable,e._setVariable=t.setVariable,e._removeVariable=t.removeVariable,e._getFlag=t.getFlag,e._setFlag=t.setFlag,t.onLabelClosing&&(e._onLabelClosing=t.onLabelClosing),e._addHistoryItem=t.addHistoryItem,e._getCharacter=t.getCharacter,e._animate=t.animate;}static _navigate=()=>{i.warn("Navigate function not initialized. You should add the navigate function in the Game.init() method.");};static get navigate(){return e._navigate}static set navigate(t){e._navigate=t;}static _getStepCounter=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new a("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static _setStepCounter=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new a("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get stepCounter(){return e._getStepCounter()}static set stepCounter(t){e._setStepCounter(t);}static _getCurrentGameStepState=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new a("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get currentGameStepState(){return e._getCurrentGameStepState()}static _restoreGameStepState=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new a("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get restoreGameStepState(){return e._restoreGameStepState}static _getOpenedLabels=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new a("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get openedLabels(){return e._getOpenedLabels()}static _onPreContinueHandlers=[];static addOnPreContinue(t){e._onPreContinueHandlers.push(t);}static removeOnPreContinue(t){e._onPreContinueHandlers=e._onPreContinueHandlers.filter(n=>n!==t);}static clearOnPreContinueHandlers(){e._onPreContinueHandlers=[];}static async runOnPreContinue(){let t=e._onPreContinueHandlers.slice();await Promise.all(t.map(n=>n()));}static get onPreContinue(){return e.runOnPreContinue}static navigationRequestsCount=0;static processNavigationLock=Promise.resolve();static get continueRequestsCount(){return e.navigationRequestsCount}static increaseContinueRequest(t=1){e.navigationRequestsCount+=t;}static get backRequestsCount(){return -1*e.navigationRequestsCount}static increaseBackRequest(t=1){e.navigationRequestsCount-=t;}static _processNavigationRequests=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new a("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static async processNavigationRequests(t){let n=e._processNavigationRequests(e.navigationRequestsCount,t);return e.navigationRequestsCount=n.newValue,await n.result}static _getVariable=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new a("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get getVariable(){return e._getVariable}static _setVariable=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new a("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get setVariable(){return e._setVariable}static _removeVariable=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new a("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get removeVariable(){return e._removeVariable}static _getFlag=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new a("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get getFlag(){return e._getFlag}static _setFlag=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new a("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get setFlag(){return e._setFlag}static _onLabelClosing=()=>{};static get onLabelClosing(){return e._onLabelClosing}static _addHistoryItem=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new a("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get addHistoryItem(){return e._addHistoryItem}static runningStepsCount=0;static _getCharacter=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new a("not_implemented","Method not implemented.")};static get getCharacter(){return e._getCharacter}static onEnd;static _onErrorHandlers=[];static addOnError(t){return e._onErrorHandlers.push(t),()=>e.removeOnError(t)}static removeOnError(t){e._onErrorHandlers=e._onErrorHandlers.filter(n=>n!==t);}static clearOnErrorHandlers(){e._onErrorHandlers.length=0;}static async runOnError(t,n){for(let m of e._onErrorHandlers.slice())try{await m(t,n);}catch(o){i.error("Error in onError handler",o);}}static _animate=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new a("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get animate(){return e._animate}};exports.GameUnifier=l;exports.PixiError=a;
1
+ 'use strict';var n=class extends Error{code;constructor(t,a,m,o,r){super(`[Pixi\u2019VN] ${a}`),this.code=t,m==="canvas"&&(this.canvasElementInfo=o,this.parent=r);}canvasElementInfo;parent};var i;(o=>(o.log=(r,...s)=>console.log(`[Pixi\u2019VN] ${r}`,...s),o.warn=(r,...s)=>console.warn(`[Pixi\u2019VN] ${r}`,...s),o.error=(r,...s)=>console.error(`[Pixi\u2019VN] ${r}`,...s),o.info=(r,...s)=>console.info(`[Pixi\u2019VN] ${r}`,...s)))(i||={});var l=class e{static init(t){t.navigate&&(e._navigate=t.navigate),e._getStepCounter=t.getStepCounter,e._setStepCounter=t.setStepCounter,e._getCurrentGameStepState=t.getCurrentGameStepState,e._restoreGameStepState=t.restoreGameStepState,e._getOpenedLabels=t.getOpenedLabels,e._processNavigationRequests=t.processNavigationRequests,e._getVariable=t.getVariable,e._setVariable=t.setVariable,e._removeVariable=t.removeVariable,e._getFlag=t.getFlag,e._setFlag=t.setFlag,t.onLabelClosing&&(e._onLabelClosing=t.onLabelClosing),e._addHistoryItem=t.addHistoryItem,e._getCharacter=t.getCharacter,e._animate=t.animate,e._animateFilter=t.animateFilter,e._removeCanvasComponent=t.removeCanvasComponent,e._canvasComponentExists=t.canvasComponentExists;}static _navigate=()=>{i.warn("Navigate function not initialized. You should add the navigate function in the Game.init() method.");};static get navigate(){return e._navigate}static set navigate(t){e._navigate=t;}static _getStepCounter=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static _setStepCounter=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get stepCounter(){return e._getStepCounter()}static set stepCounter(t){e._setStepCounter(t);}static _getCurrentGameStepState=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get currentGameStepState(){return e._getCurrentGameStepState()}static _restoreGameStepState=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get restoreGameStepState(){return e._restoreGameStepState}static _getOpenedLabels=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get openedLabels(){return e._getOpenedLabels()}static _onPreContinueHandlers=[];static addOnPreContinue(t){e._onPreContinueHandlers.push(t);}static removeOnPreContinue(t){e._onPreContinueHandlers=e._onPreContinueHandlers.filter(a=>a!==t);}static clearOnPreContinueHandlers(){e._onPreContinueHandlers=[];}static async runOnPreContinue(){let t=e._onPreContinueHandlers.slice();await Promise.all(t.map(a=>a()));}static get onPreContinue(){return e.runOnPreContinue}static navigationRequestsCount=0;static processNavigationLock=Promise.resolve();static get continueRequestsCount(){return e.navigationRequestsCount}static increaseContinueRequest(t=1){e.navigationRequestsCount+=t;}static get backRequestsCount(){return -1*e.navigationRequestsCount}static increaseBackRequest(t=1){e.navigationRequestsCount-=t;}static _processNavigationRequests=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static async processNavigationRequests(t){let a=e._processNavigationRequests(e.navigationRequestsCount,t);return e.navigationRequestsCount=a.newValue,await a.result}static _getVariable=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get getVariable(){return e._getVariable}static _setVariable=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get setVariable(){return e._setVariable}static _removeVariable=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get removeVariable(){return e._removeVariable}static _getFlag=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get getFlag(){return e._getFlag}static _setFlag=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get setFlag(){return e._setFlag}static _onLabelClosing=()=>{};static get onLabelClosing(){return e._onLabelClosing}static _addHistoryItem=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get addHistoryItem(){return e._addHistoryItem}static runningStepsCount=0;static _getCharacter=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented.")};static get getCharacter(){return e._getCharacter}static onEnd;static _onErrorHandlers=[];static addOnError(t){return e._onErrorHandlers.push(t),()=>e.removeOnError(t)}static removeOnError(t){e._onErrorHandlers=e._onErrorHandlers.filter(a=>a!==t);}static clearOnErrorHandlers(){e._onErrorHandlers.length=0;}static async runOnError(t,a){for(let m of e._onErrorHandlers.slice())try{await m(t,a);}catch(o){i.error("Error in onError handler",o);}}static _animate=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get animate(){return e._animate}static _animateFilter=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get animateFilter(){return e._animateFilter}static _removeCanvasComponent=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get removeCanvasComponent(){return e._removeCanvasComponent}static _canvasComponentExists=()=>{throw i.error("Method not implemented, you should initialize the Game: Game.init()"),new n("not_implemented","Method not implemented, you should initialize the Game: Game.init()")};static get canvasComponentExists(){return e._canvasComponentExists}};exports.GameUnifier=l;exports.PixiError=n;