@drincs/pixi-vn 1.9.5 → 1.9.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/README.md +186 -170
  2. package/dist/{ContainerMemory-DNqSVzLY.d.cts → ContainerMemory-De04YSUc.d.cts} +2 -1
  3. package/dist/{ContainerMemory-DNqSVzLY.d.ts → ContainerMemory-De04YSUc.d.ts} +2 -1
  4. package/dist/canvas.cjs +2 -2
  5. package/dist/canvas.d.cts +8 -3
  6. package/dist/canvas.d.ts +8 -3
  7. package/dist/canvas.mjs +1 -1
  8. package/dist/characters.cjs +1 -1
  9. package/dist/characters.d.cts +3 -2
  10. package/dist/characters.d.ts +3 -2
  11. package/dist/characters.mjs +1 -1
  12. package/dist/{chunk-S7HZUIEI.mjs → chunk-A5FN4SNI.mjs} +1 -1
  13. package/dist/chunk-B46NFIFC.mjs +1 -0
  14. package/dist/chunk-FPMP2OWB.mjs +1 -0
  15. package/dist/{chunk-6OABTG5R.mjs → chunk-OJKUK6GL.mjs} +1 -1
  16. package/dist/{chunk-5MVDNAT4.mjs → chunk-WYGKBGMH.mjs} +1 -1
  17. package/dist/core.d.cts +4 -3
  18. package/dist/core.d.ts +4 -3
  19. package/dist/filters.cjs +1 -1
  20. package/dist/filters.d.cts +2 -1
  21. package/dist/filters.d.ts +2 -1
  22. package/dist/filters.mjs +1 -1
  23. package/dist/history.cjs +1 -1
  24. package/dist/history.d.cts +10 -5
  25. package/dist/history.d.ts +10 -5
  26. package/dist/history.mjs +1 -1
  27. package/dist/index.cjs +2 -2
  28. package/dist/index.d.cts +16 -7
  29. package/dist/index.d.ts +16 -7
  30. package/dist/index.mjs +2 -2
  31. package/dist/motion.cjs +1 -1
  32. package/dist/motion.d.cts +2 -1
  33. package/dist/motion.d.ts +2 -1
  34. package/dist/motion.mjs +1 -1
  35. package/dist/narration.cjs +2 -2
  36. package/dist/narration.d.cts +7 -2
  37. package/dist/narration.d.ts +7 -2
  38. package/dist/narration.mjs +1 -1
  39. package/dist/pixi/browser.js +182 -148
  40. package/dist/sound.cjs +1 -1
  41. package/dist/sound.d.cts +3 -2
  42. package/dist/sound.d.ts +3 -2
  43. package/dist/sound.mjs +1 -1
  44. package/dist/storage.cjs +1 -1
  45. package/dist/storage.d.cts +7 -2
  46. package/dist/storage.d.ts +7 -2
  47. package/dist/storage.mjs +1 -1
  48. package/dist/tickers.cjs +1 -1
  49. package/dist/tickers.d.cts +2 -1
  50. package/dist/tickers.d.ts +2 -1
  51. package/dist/tickers.mjs +1 -1
  52. package/dist/vite-listener.mjs +1 -1
  53. package/dist/vite.cjs +1 -1
  54. package/dist/vite.d.cts +2 -1
  55. package/dist/vite.d.ts +2 -1
  56. package/dist/vite.mjs +1 -1
  57. package/dist/worker.d.cts +2 -1
  58. package/dist/worker.d.ts +2 -1
  59. package/package.json +11 -10
  60. package/dist/chunk-AW5XWF24.mjs +0 -1
  61. package/dist/chunk-K7JIC2F2.mjs +0 -1
package/dist/canvas.d.cts CHANGED
@@ -6,8 +6,8 @@ import { TickerInfo, TickersSequence, TickerArgs, Ticker, TickersInterface } fro
6
6
  export * from '@drincs/pixi-vn/tickers';
7
7
  export { TickersInterface as CanvasTickersInterface } from '@drincs/pixi-vn/tickers';
8
8
  import { Devtools } from '@pixi/devtools';
9
- import { C as CanvasBaseItemMemory, a as CanvasBaseItem, b as CanvasGameState, c as ContainerChild$1, A as AdditionalPositionsExtensionProps, L as ListenerExtensionMemory, d as ListenerExtension, e as AdditionalPositionsExtension, O as OnEventsHandlers, f as ContainerMemory } from './ContainerMemory-DNqSVzLY.cjs';
10
- export { g as addListenerHandler, h as analizePositionsExtensionProps } from './ContainerMemory-DNqSVzLY.cjs';
9
+ import { C as CanvasBaseItemMemory, a as CanvasBaseItem, b as CanvasGameState, c as ContainerChild$1, A as AdditionalPositionsExtensionProps, L as ListenerExtensionMemory, d as ListenerExtension, e as AdditionalPositionsExtension, O as OnEventsHandlers, f as ContainerMemory } from './ContainerMemory-De04YSUc.cjs';
10
+ export { g as addListenerHandler, h as analizePositionsExtensionProps } from './ContainerMemory-De04YSUc.cjs';
11
11
  export { AnimationOptions as MotionAnimationOptions } from 'motion';
12
12
  import { OnErrorHandler } from '@drincs/pixi-vn/core';
13
13
  import '@drincs/pixi-vn/filters';
@@ -2856,6 +2856,11 @@ declare const TextStyle: typeof _drincs_pixi_vn_pixi_js.TextStyle;
2856
2856
  declare const Texture: typeof _drincs_pixi_vn_pixi_js.Texture;
2857
2857
  declare const UPDATE_PRIORITY: typeof _drincs_pixi_vn_pixi_js.UPDATE_PRIORITY;
2858
2858
 
2859
+ /**
2860
+ * The global canvas manager instance. It handles the PixiJS application, the canvas elements
2861
+ * (images, videos, text, containers), tickers, transitions, and the canvas state used for save/restore.
2862
+ */
2859
2863
  declare const canvas: CanvasManagerInterface;
2860
2864
 
2861
- export { AdditionalPositionsExtension, AdditionalPositionsExtensionProps, type AnchorExtension, type AnchorExtensionProps, type AssetAliasIdType, type AssetMemory, Assets, type BlurInOutProps, type BlurPulseEffectProps, type BounceEffectProps, type BundleIdType, type CanvasBaseInterface, CanvasBaseItem, CanvasBaseItemMemory, CanvasGameState, type CanvasHtmlLayersInterface, type CanvasLayersInterface, type CanvasManagerInterface, CanvasManagerStatic, CanvasPropertyUtility, type ChromaticAberrationEffectProps, Color, type ColorType, Container, ContainerChild$1 as ContainerChild, ContainerMemory, type ContainerOptions, type DecayingEffectProps, type DesaturateEffectProps, type FilterFadeTransitionProps, type FilterTransitionConfig, type FlashInOutProps, type GlitchEffectProps, type GlitchInOutProps, type GlowPulseEffectProps, type HopEffectProps, type HslColorType, type HslaColorType, type HsvColorType, type HsvaColorType, ImageContainer, type ImageContainerMemory, type ImageContainerOptions, ImageSprite, type ImageSpriteMemory, type ImageSpriteOptions, type IrisInOutProps, type Layer, ListenerExtension, ListenerExtensionMemory, type MaskTransitionProps, type MoveInOutProps, type NodEffectProps, type NoiseDissolveInOutProps, type OldComponentOutProps, OnEventsHandlers, type PinchInOutProps, type PixelateInOutProps, type PixivnAssetAliasIds, type PixivnBundleIds, type PulseEffectProps, type PunchEffectProps, type PushInOutProps, type RadialBlurEffectProps, Rectangle, RegisteredCanvasComponents, RegisteredEvents, type RgbColorType, type RgbaColorType, type RippleInOutProps, type ShakeEffectProps, type ShockwaveEffectProps, type ShowWithDissolveTransitionProps, type ShowWithFadeTransitionProps, type SplitInOutProps, Sprite, type SpriteBaseMemory, type SpriteMemory, type SpriteOptions, type SwayEffectProps, Text, type TextMemory, type TextOptions, TextStyle, Texture, type TvInOutProps, type TwistInOutProps, UPDATE_PRIORITY, VideoSprite, type VideoSpriteMemory, type VideoSpriteOptions, type VignettePulseEffectProps, type WarpInOutProps, type WiggleEffectProps, type WipeInOutProps, type ZoomInOutProps, addImage, addImageCointainer, addVideo, canvas, canvasComponentDecorator, createFilterTransitionApplier, drawCanvasErrorHandler, effects, eventDecorator, getTexture, moveIn, moveOut, pushIn, pushOut, removeWithDissolve, removeWithFade, setMemoryContainer, shakeEffect, showImage, showImageContainer, showText, showVideo, showWithDissolve, showWithFade, transitions, zoomIn, zoomOut };
2865
+ export { AdditionalPositionsExtension, AdditionalPositionsExtensionProps, Assets, CanvasBaseItem, CanvasBaseItemMemory, CanvasGameState, CanvasManagerStatic, CanvasPropertyUtility, Color, Container, ContainerChild$1 as ContainerChild, ContainerMemory, ImageContainer, ImageSprite, ListenerExtension, ListenerExtensionMemory, OnEventsHandlers, Rectangle, RegisteredCanvasComponents, RegisteredEvents, Sprite, Text, TextStyle, Texture, UPDATE_PRIORITY, VideoSprite, addImage, addImageCointainer, addVideo, canvas, canvasComponentDecorator, createFilterTransitionApplier, drawCanvasErrorHandler, effects, eventDecorator, getTexture, moveIn, moveOut, pushIn, pushOut, removeWithDissolve, removeWithFade, setMemoryContainer, shakeEffect, showImage, showImageContainer, showText, showVideo, showWithDissolve, showWithFade, transitions, zoomIn, zoomOut };
2866
+ export type { AnchorExtension, AnchorExtensionProps, AssetAliasIdType, AssetMemory, BlurInOutProps, BlurPulseEffectProps, BounceEffectProps, BundleIdType, CanvasBaseInterface, CanvasHtmlLayersInterface, CanvasLayersInterface, CanvasManagerInterface, ChromaticAberrationEffectProps, ColorType, ContainerOptions, DecayingEffectProps, DesaturateEffectProps, FilterFadeTransitionProps, FilterTransitionConfig, FlashInOutProps, GlitchEffectProps, GlitchInOutProps, GlowPulseEffectProps, HopEffectProps, HslColorType, HslaColorType, HsvColorType, HsvaColorType, ImageContainerMemory, ImageContainerOptions, ImageSpriteMemory, ImageSpriteOptions, IrisInOutProps, Layer, MaskTransitionProps, MoveInOutProps, NodEffectProps, NoiseDissolveInOutProps, OldComponentOutProps, PinchInOutProps, PixelateInOutProps, PixivnAssetAliasIds, PixivnBundleIds, PulseEffectProps, PunchEffectProps, PushInOutProps, RadialBlurEffectProps, RgbColorType, RgbaColorType, RippleInOutProps, ShakeEffectProps, ShockwaveEffectProps, ShowWithDissolveTransitionProps, ShowWithFadeTransitionProps, SplitInOutProps, SpriteBaseMemory, SpriteMemory, SpriteOptions, SwayEffectProps, TextMemory, TextOptions, TvInOutProps, TwistInOutProps, VideoSpriteMemory, VideoSpriteOptions, VignettePulseEffectProps, WarpInOutProps, WiggleEffectProps, WipeInOutProps, ZoomInOutProps };
package/dist/canvas.d.ts CHANGED
@@ -6,8 +6,8 @@ import { TickerInfo, TickersSequence, TickerArgs, Ticker, TickersInterface } fro
6
6
  export * from '@drincs/pixi-vn/tickers';
7
7
  export { TickersInterface as CanvasTickersInterface } from '@drincs/pixi-vn/tickers';
8
8
  import { Devtools } from '@pixi/devtools';
9
- import { C as CanvasBaseItemMemory, a as CanvasBaseItem, b as CanvasGameState, c as ContainerChild$1, A as AdditionalPositionsExtensionProps, L as ListenerExtensionMemory, d as ListenerExtension, e as AdditionalPositionsExtension, O as OnEventsHandlers, f as ContainerMemory } from './ContainerMemory-DNqSVzLY.js';
10
- export { g as addListenerHandler, h as analizePositionsExtensionProps } from './ContainerMemory-DNqSVzLY.js';
9
+ import { C as CanvasBaseItemMemory, a as CanvasBaseItem, b as CanvasGameState, c as ContainerChild$1, A as AdditionalPositionsExtensionProps, L as ListenerExtensionMemory, d as ListenerExtension, e as AdditionalPositionsExtension, O as OnEventsHandlers, f as ContainerMemory } from './ContainerMemory-De04YSUc.js';
10
+ export { g as addListenerHandler, h as analizePositionsExtensionProps } from './ContainerMemory-De04YSUc.js';
11
11
  export { AnimationOptions as MotionAnimationOptions } from 'motion';
12
12
  import { OnErrorHandler } from '@drincs/pixi-vn/core';
13
13
  import '@drincs/pixi-vn/filters';
@@ -2856,6 +2856,11 @@ declare const TextStyle: typeof _drincs_pixi_vn_pixi_js.TextStyle;
2856
2856
  declare const Texture: typeof _drincs_pixi_vn_pixi_js.Texture;
2857
2857
  declare const UPDATE_PRIORITY: typeof _drincs_pixi_vn_pixi_js.UPDATE_PRIORITY;
2858
2858
 
2859
+ /**
2860
+ * The global canvas manager instance. It handles the PixiJS application, the canvas elements
2861
+ * (images, videos, text, containers), tickers, transitions, and the canvas state used for save/restore.
2862
+ */
2859
2863
  declare const canvas: CanvasManagerInterface;
2860
2864
 
2861
- export { AdditionalPositionsExtension, AdditionalPositionsExtensionProps, type AnchorExtension, type AnchorExtensionProps, type AssetAliasIdType, type AssetMemory, Assets, type BlurInOutProps, type BlurPulseEffectProps, type BounceEffectProps, type BundleIdType, type CanvasBaseInterface, CanvasBaseItem, CanvasBaseItemMemory, CanvasGameState, type CanvasHtmlLayersInterface, type CanvasLayersInterface, type CanvasManagerInterface, CanvasManagerStatic, CanvasPropertyUtility, type ChromaticAberrationEffectProps, Color, type ColorType, Container, ContainerChild$1 as ContainerChild, ContainerMemory, type ContainerOptions, type DecayingEffectProps, type DesaturateEffectProps, type FilterFadeTransitionProps, type FilterTransitionConfig, type FlashInOutProps, type GlitchEffectProps, type GlitchInOutProps, type GlowPulseEffectProps, type HopEffectProps, type HslColorType, type HslaColorType, type HsvColorType, type HsvaColorType, ImageContainer, type ImageContainerMemory, type ImageContainerOptions, ImageSprite, type ImageSpriteMemory, type ImageSpriteOptions, type IrisInOutProps, type Layer, ListenerExtension, ListenerExtensionMemory, type MaskTransitionProps, type MoveInOutProps, type NodEffectProps, type NoiseDissolveInOutProps, type OldComponentOutProps, OnEventsHandlers, type PinchInOutProps, type PixelateInOutProps, type PixivnAssetAliasIds, type PixivnBundleIds, type PulseEffectProps, type PunchEffectProps, type PushInOutProps, type RadialBlurEffectProps, Rectangle, RegisteredCanvasComponents, RegisteredEvents, type RgbColorType, type RgbaColorType, type RippleInOutProps, type ShakeEffectProps, type ShockwaveEffectProps, type ShowWithDissolveTransitionProps, type ShowWithFadeTransitionProps, type SplitInOutProps, Sprite, type SpriteBaseMemory, type SpriteMemory, type SpriteOptions, type SwayEffectProps, Text, type TextMemory, type TextOptions, TextStyle, Texture, type TvInOutProps, type TwistInOutProps, UPDATE_PRIORITY, VideoSprite, type VideoSpriteMemory, type VideoSpriteOptions, type VignettePulseEffectProps, type WarpInOutProps, type WiggleEffectProps, type WipeInOutProps, type ZoomInOutProps, addImage, addImageCointainer, addVideo, canvas, canvasComponentDecorator, createFilterTransitionApplier, drawCanvasErrorHandler, effects, eventDecorator, getTexture, moveIn, moveOut, pushIn, pushOut, removeWithDissolve, removeWithFade, setMemoryContainer, shakeEffect, showImage, showImageContainer, showText, showVideo, showWithDissolve, showWithFade, transitions, zoomIn, zoomOut };
2865
+ export { AdditionalPositionsExtension, AdditionalPositionsExtensionProps, Assets, CanvasBaseItem, CanvasBaseItemMemory, CanvasGameState, CanvasManagerStatic, CanvasPropertyUtility, Color, Container, ContainerChild$1 as ContainerChild, ContainerMemory, ImageContainer, ImageSprite, ListenerExtension, ListenerExtensionMemory, OnEventsHandlers, Rectangle, RegisteredCanvasComponents, RegisteredEvents, Sprite, Text, TextStyle, Texture, UPDATE_PRIORITY, VideoSprite, addImage, addImageCointainer, addVideo, canvas, canvasComponentDecorator, createFilterTransitionApplier, drawCanvasErrorHandler, effects, eventDecorator, getTexture, moveIn, moveOut, pushIn, pushOut, removeWithDissolve, removeWithFade, setMemoryContainer, shakeEffect, showImage, showImageContainer, showText, showVideo, showWithDissolve, showWithFade, transitions, zoomIn, zoomOut };
2866
+ export type { AnchorExtension, AnchorExtensionProps, AssetAliasIdType, AssetMemory, BlurInOutProps, BlurPulseEffectProps, BounceEffectProps, BundleIdType, CanvasBaseInterface, CanvasHtmlLayersInterface, CanvasLayersInterface, CanvasManagerInterface, ChromaticAberrationEffectProps, ColorType, ContainerOptions, DecayingEffectProps, DesaturateEffectProps, FilterFadeTransitionProps, FilterTransitionConfig, FlashInOutProps, GlitchEffectProps, GlitchInOutProps, GlowPulseEffectProps, HopEffectProps, HslColorType, HslaColorType, HsvColorType, HsvaColorType, ImageContainerMemory, ImageContainerOptions, ImageSpriteMemory, ImageSpriteOptions, IrisInOutProps, Layer, MaskTransitionProps, MoveInOutProps, NodEffectProps, NoiseDissolveInOutProps, OldComponentOutProps, PinchInOutProps, PixelateInOutProps, PixivnAssetAliasIds, PixivnBundleIds, PulseEffectProps, PunchEffectProps, PushInOutProps, RadialBlurEffectProps, RgbColorType, RgbaColorType, RippleInOutProps, ShakeEffectProps, ShockwaveEffectProps, ShowWithDissolveTransitionProps, ShowWithFadeTransitionProps, SplitInOutProps, SpriteBaseMemory, SpriteMemory, SpriteOptions, SwayEffectProps, TextMemory, TextOptions, TvInOutProps, TwistInOutProps, VideoSpriteMemory, VideoSpriteOptions, VignettePulseEffectProps, WarpInOutProps, WiggleEffectProps, WipeInOutProps, ZoomInOutProps };
package/dist/canvas.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import'./chunk-JMOSOAGB.mjs';import {a,e as e$2,d as d$2,b as b$1,c as c$1}from'./chunk-XLRCR56W.mjs';import {e,d as d$1,g,b,c,f as f$1,a as a$1}from'./chunk-HD353M4B.mjs';import {a as a$2}from'./chunk-S7HZUIEI.mjs';import {d,e as e$1}from'./chunk-AW5XWF24.mjs';import {GameUnifier,PixiError}from'@drincs/pixi-vn/core';import we,{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 un={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}}}]}},Yt=un;function zt(t,e){let i=0;return async(...s)=>{let a=Date.now();if(a-i>=e)return i=a,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$1);return e||(e=new we.Container,e.label=a$1,t.app.stage.addChild(e)),e}static htmlLayers=[];static canvasWidth=300;static canvasHeight=300;static _isInitialized=false;static async init(e,i,s){let{id:a="pixi-vn-canvas",width:p=800,height:y=600,resolution:R=1,autoDensity:S=true,resizeMode:l="contain",...v}=i||{};return t.canvasWidth=p,t.canvasHeight=y,t._app=new we.Application,t.app.init({width:p,height:y,resolution:R,autoDensity:S,...v}).then(()=>{let{app:A=t.app,extensions:b=[],...U}=s||{};if(initDevtools({app:A,extensions:[Yt,...b],...U}),t._isInitialized=true,t.addCanvasIntoHTMLElement(e,a),l==="contain"){let z=zt(async()=>{requestAnimationFrame(()=>t.resize());},10);new ResizeObserver(z).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):e$1.error("GameWindowManager is not initialized");}static addHtmlLayer(e,i,s={}){let{position:a="absolute",pointerEvents:p="none",userSelect:y="none"}=s,R=document.createElement("div");R.setAttribute("id",e),R.style.position=a,R.style.pointerEvents=p,R.style.userSelect=y;let S=i.appendChild(R);return t.htmlLayers.push(R),t.resize(),S}static removeHtmlLayer(e){let i=t.htmlLayers.find(s=>s.id===e);i&&(i.remove(),t.htmlLayers=t.htmlLayers.filter(s=>s.id!==e));}static getHtmlLayer(e){return t.htmlLayers.find(i=>i.id===e)}static async resize(){let e=t.canvasWidth,i=t.canvasHeight,s=t.app.resizeTo,a=t.app.canvas.style;s instanceof HTMLElement||(s=document.documentElement);let p,y;if(s===document.body||s===document.documentElement)p=document.documentElement.clientWidth||window.innerWidth,y=document.documentElement.clientHeight||window.innerHeight;else {let b=s.getBoundingClientRect();p=b.width||s.clientWidth,y=b.height||s.clientHeight;}let R=Math.min(p/e,y/i),S=Math.floor(R*e),l=Math.floor(R*i);a.width=`${S}px`,a.height=`${l}px`;let v=(p-S)/2,A=(y-l)/2;a.marginLeft=`${v}px`,a.marginRight=`${v}px`,a.marginTop=`${A}px`,a.marginBottom=`${A}px`,t.htmlLayers.forEach(b=>{b.style.width=`${S}px`,b.style.height=`${l}px`,b.style.marginLeft=`${v}px`,b.style.marginRight=`${v}px`,b.style.marginTop=`${A}px`,b.style.marginBottom=`${A}px`;});}static get childrenAliasesOrder(){return t.gameLayer.children.filter(e=>e.label).sort((e,i)=>t.gameLayer.getChildIndex(e)-t.gameLayer.getChildIndex(i)).map(e=>e.label)}};var gt=Symbol("SerializableEvent"),Ye=new d({cacheSize:5});function pn(t){return (e,i,s)=>{let a=s.value;mt.add(a,t||`${i}`);}}var mt;(p=>{function t(y,R){y[gt]=R,Ye.get(R)&&e$1.info(`Event "${R}" already exists, it will be overwritten`),Ye.set(R,y);}p.add=t;function e(y){try{let R=Ye.get(y);if(!R){e$1.error(`Event "${y}" not found, did you forget to register it with the eventDecorator?`);return}return R}catch(R){e$1.error(`Error while getting Event "${y}"`,R);return}}p.get=e;function i(){return Array.from(Ye.values())}p.values=i;function s(y){return Ye.has(y)}p.has=s;function a(){return Array.from(Ye.keys())}p.keys=a;})(mt||={});var yt=mt;async function Wt(t,e){if("onEvents"in e)for(let i in e.onEvents){let s=e.onEvents[i],a=yt.get(s);a&&t.on(i,a);}}function Ut(t){let{onEventsHandlers:e={}}=t;return e}function Oe(t,e,i){let s=i[gt];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 ze=new d({cacheSize:5}),Xt=new d({cacheSize:2}),$t=new d({cacheSize:2});function gn(t={}){return e=>{xt.add(e,t);}}async function le(t,e,i){let s=i?.ignoreScale||false,a=i?.end;if("isRenderGroup"in e&&e.isRenderGroup!==void 0&&(t.isRenderGroup=e.isRenderGroup),"blendMode"in e&&e.blendMode!==void 0&&(t.blendMode=e.blendMode),"tint"in e&&e.tint!==void 0&&(t.tint=e.tint),"alpha"in e&&e.alpha!==void 0&&(t.alpha=e.alpha),"angle"in e&&e.angle!==void 0&&(t.angle=e.angle),"renderable"in e&&e.renderable!==void 0&&(t.renderable=e.renderable),"rotation"in e&&e.rotation!==void 0&&(t.rotation=e.rotation),!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),Wt(t,e),"pixivnFilters"in e&&e.pixivnFilters!==void 0){let p=e.pixivnFilters.map(y=>RegisteredFilters.getInstance(y.filterId,y.args,y.padding)).filter(y=>!!y);t.filters=p.length>0?p: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),a&&await a(),s||("width"in e&&e.width!==void 0&&(t.width=e.width),"height"in e&&e.height!==void 0&&(t.height=e.height));}var xt;(R=>{function t(S,l={}){let{name:v=S.name,getInstance:A=async(U,z)=>{let te=new U;return await te.setMemory(z),te},copyProperty:b=async(U,z)=>{await U.setMemory(z);}}=l;ze.get(v)&&e$1.warn(`CanvasElement "${v}" already registered`),S.prototype.pixivnId=v,ze.set(v,S),Xt.set(v,A),$t.set(v,b);}R.add=t;function e(S){let l=ze.get(S);if(!l){e$1.error(`CanvasElement "${S}" not found, did you forget to register it with the canvasComponentDecorator?`);return}return l}R.get=e;async function i(S,l){let v=e(S),A=Xt.get(S);if(!v||!A){e$1.error(`CanvasElement "${S}" not found, did you forget to register it with the canvasComponentDecorator?`);return}try{return await A(v,l)}catch(b){e$1.error(`Error while getting CanvasElement instance "${S}"`,b);}}R.getInstance=i;async function s(S,l,v){let A=$t.get(S);if(!A){e$1.error(`CanvasElement "${S}" not found, did you forget to register it with the canvasComponentDecorator?`);return}try{await A(l,v);}catch(b){e$1.error(`Error while copying properties of CanvasElement "${S}"`,b);}}R.copyProperty=s;function a(){return Array.from(ze.values())}R.values=a;function p(S){return ze.has(S)}R.has=p;function y(){return Array.from(ze.keys())}R.keys=y;})(xt||={});var de=xt;async function et(t){let e=await de.getInstance(t.pixivnId,t);if(!e)throw new PixiError("unregistered_element",`The element ${t.pixivnId} could not be created`,"canvas",t);return e}function vt(t){return "memory"in t?t.memory:t instanceof we.Text?Tt(t):t instanceof we.Sprite?It(t):Ae(t)}function xn(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:Pn(t.filters)}}function Pn(t){if(!t)return;let e=Array.isArray(t)?t:[t],i=[];for(let s of e){let a=s.pixivnFilterId;if(!a){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 p=RegisteredFilters.toMemory(a,s);p&&i.push(p);}return i}function Pt(t,e){return {url:t.source.label,alias:e===t.source.label?void 0:e}}function Ae(t,e){let i=vn(t,b),a=e?.childrenExport||false?t.children.sort((p,y)=>t.getChildIndex(p)-t.getChildIndex(y)).map(p=>vt(p)):[];return {pixivnId:i,elements:a,onEvents:Ut(t),...xn(t)}}function It(t){let e$1=Ae(t),i=e$1.pixivnId??e,s="assetsAliases"in t&&Array.isArray(t.assetsAliases)?Pt(t.texture,t.assetsAliases[0]):"textureAlias"in t?Pt(t.texture,t.textureAlias):Pt(t.texture);return {...e$1,pixivnId:i,textureData:s,anchor:{x:t.anchor.x,y:t.anchor.y},roundPixels:t.roundPixels}}function Tt(t){let e=Ae(t),i=e.pixivnId??f$1;return {...e,pixivnId:i,anchor:{x:t.anchor.x,y:t.anchor.y},text:t.text,resolution:t.resolution,style:bn(t.style),roundPixels:t.roundPixels}}function vn(t,e){return Object.hasOwn(t,"pixivnId")?t.pixivnId:e}function tt(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 In(t){if(t!=null){{if(typeof t=="number")return t;if(typeof t=="string"||Array.isArray(t))return t;if(t instanceof we.FillGradient)return tt(t);if(typeof t=="object"&&"fill"in t&&typeof t.fill!="function"&&t.fill){if(!(t.fill instanceof we.FillPattern))return tt(t.fill)}}e$1.warn("Unsupported property type for Text.style.fill.",t);}}function Tn(t){if(typeof t=="number")return t;if(typeof t=="string")return t;if(Array.isArray(t))return t;if(t instanceof we.Color)return t.toNumber();e$1.warn("Unsupported color type.",t);}function Cn(t){if(t!=null){{if(typeof t=="number")return t;if(typeof t=="string"||Array.isArray(t))return t;if(t instanceof we.FillGradient)return tt(t);if(typeof t=="object"&&"alignment"in t)return {alignment:t.alignment,alpha:t.alpha,color:Tn(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 we.FillPattern))return tt(t.fill)}}e$1.warn("Unsupported property type for Text.style.stroke.",t);}}function bn(t){return {align:t.align,breakWords:t.breakWords,dropShadow:t.dropShadow,fill:In(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:Cn(t.stroke),textBaseline:t.textBaseline,trim:t.trim,whiteSpace:t.whiteSpace,wordWrap:t.wordWrap,wordWrapWidth:t.wordWrapWidth}}var Xe=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,i,s){return await ie.init(e,i,s)}get children(){return ie.gameLayer.children}async copyCanvasElementProperty(e,i,s={}){let a=["isRenderGroup","scale","visible","boundsArea","text","resolution","style","height","width"],{ignoreProperties:p=S=>S}=s;if(typeof i=="string"){let S=this.find(i);if(S)i=S;else {e$1.error(`Canvas element ${i} not found`);return}}if(typeof e=="string"){let S=this.find(e);if(S)e=S;else {e$1.error(`Canvas element ${e} not found`);return}}e instanceof we.Container&&(e=e.memory);let y=p(a),R={...e};y.forEach(S=>{S in R&&delete R[S];}),await de.copyProperty(i.pixivnId,i,R);}add(e,i,s={}){if(e===a$1){e$1.error(`The alias ${a$1} is reserved`);return}let a=this.find(e),p=s?.ignoreOldStyle;a&&!p&&this.copyCanvasElementProperty(a,i);let{zIndex:y=a?.parent?.getChildIndex(a)}=s;a&&!this.canvasElementIsOnCanvas(a)?e$1.error(`The canvas element ${e} exist in the memory but it is not on the canvas, so the zIndex is not set`):a&&this.remove(e,{ignoreTickers:true}),y!==void 0?(i.label=e,this.gameLayer.addChildAt(i,y)):(i.label=e,this.gameLayer.addChild(i));}remove(e,i={}){if(e===a$1){e$1.error(`The alias ${a$1} is reserved`);return}let s=i.ignoreTickers;typeof e=="string"&&(e=[e]),e.forEach(a=>{this.gameLayer.getChildrenByLabel(a).forEach(p=>{this.gameLayer.removeChild(p),!s&&tickers$1.unlinkComponent(a);});});}find(e){if(e===a$1)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,s={}){let a=this.find(e);a&&(a.label=i),!s.ignoreTickers&&tickers$1.transfer(e,i,"move");}get currentTickers(){return this.tickers.currentTickers}get currentTickersSteps(){return this.tickers.currentTickersSteps}findTicker(e){return tickers$1.find(e)}addTicker(e,i){return tickers$1.add(e,i)}addTickersSequence(e,i,s=0){return tickers$1.addSequence(e,i,s)}onTickerComplete(e,i){return tickers$1.onComplete(e,i)}unlinkComponentFromTicker(e,i){return tickers$1.unlinkComponent(e,i)}removeAllTickers(){return tickers$1.removeAll()}removeTicker(e,i={stopTicker:true}){return removeTicker(e,i)}pauseTicker(e){return tickers$1.pause(e)}resumeTicker(e){return tickers$1.resume(e)}isTickerPaused(e,i){return tickers$1.isPaused(e,i)}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(i=>TickersManagerStatic._currentTickers.has(i));e.length>0&&tickers$1.resume({id:e}),this.tickersPausedByGameLayerRender=[];}transferTickers(e,i,s="move"){return tickers$1.transfer(e,i,s)}completeTickerOnStepEnd(e){return tickers$1.completeOnStepEnd(e)}async forceCompletionOfTicker(e,i){return tickers$1.forceCompletion(e,i)}tickers=tickers$1;animate(e,i,s,a){return GameUnifier.animate(e,i,s,a)}addLayerInternal(e,i){if(e===a$1){e$1.error(`The alias ${a$1} is reserved`);return}return i.label=e,ie.app.stage.addChild(i)}getLayerInternal(e){return ie.app.stage.getChildByLabel(e)}removeLayerInternal(e){let i=ie.app.stage.getChildByLabel(e);i&&ie.app.stage.removeChild(i);}addHtmlLayerInternal(e,i,s){return ie.addHtmlLayer(e,i,s)}removeHtmlLayerInternal(e){return ie.removeHtmlLayer(e)}getHtmlLayerInternal(e){return ie.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,s){return this.addHtmlLayerInternal(e,i,s)}removeHtmlLayer(e){return this.removeHtmlLayerInternal(e)}getHtmlLayer(e){return this.getHtmlLayerInternal(e)}layers={get gameLayer(){return ie.gameLayer},add:(e,i)=>this.addLayerInternal(e,i),get:e=>this.getLayerInternal(e),remove:e=>this.removeLayerInternal(e)};htmlLayers={add:(e,i,s)=>this.addHtmlLayerInternal(e,i,s),get:e=>this.getHtmlLayerInternal(e),remove:e=>this.removeHtmlLayerInternal(e)};async extractImage(){let e=this.gameLayer.renderable===false;e&&this.resume();let i;try{i=this.app.renderer.extract.image(this.app.stage);}finally{e&&this.pause();}return (await i).src}clear(){this.tickersPausedByGameLayerRender=[],tickers$1.removeAll(),this.removeAll();}export(){let e=this.gameLayer.renderable===false;e&&this.resume();try{let i={};return this.children.forEach(s=>{s.label&&(i[s.label]=vt(s));}),{tickers:a$2(TickersManagerStatic.currentTickersWithoutCreatedBySteps()),tickersSteps:a$2(TickersManagerStatic.currentTickersSequence()),elements:a$2(i),stage:a$2(Ae(this.gameLayer)),elementAliasesOrder:a$2(ie.childrenAliasesOrder),tickersToCompleteOnStepEnd:a$2(TickersManagerStatic._tickersToCompleteOnStepEnd)}}finally{e&&this.pause();}}async restore(e){this.clear();try{if(Object.hasOwn(e,"elements")&&Object.hasOwn(e,"elementAliasesOrder")){let i=e.elementAliasesOrder,s={},a=Object.entries(e.elements).map(async([p,y])=>{s[p]=await et(y);});await Promise.all(a),i.forEach(p=>{let y=s[p];y&&this.add(p,y);});}else {e$1.error("The data does not have the properties elementAliasesOrder and elements");return}if(Object.hasOwn(e,"stage")&&Object.hasOwn(e,"stage")?le(this.gameLayer,e.stage,{ignoreScale:!0}):e$1.error("The data does not have the properties stage"),Object.hasOwn(e,"tickers")){let i=e.tickers;Object.entries(i).forEach(([s,a])=>{let p=a.canvasElementAliases;if(p.length!==0){let y=RegisteredTickers.getInstance(a.id,a.args,{duration:a.duration,priority:a.priority,id:s,canvasElementAliases:p});y?(y.canvasElementAliases=p,tickers$1.add(p,y),a.paused&&y.pause()):e$1.error(`Ticker ${a.id} not found`);}});}if(Object.hasOwn(e,"tickersSteps")){let i=e.tickersSteps;Object.entries(i).forEach(([s,a])=>{TickersManagerStatic._currentTickersSequence.set(s,new Map(Object.entries(a))),Object.keys(a).forEach(p=>{runTickersSequence(s,p);});});}if(Object.hasOwn(e,"tickersToCompleteOnStepEnd")){let i=e.tickersToCompleteOnStepEnd,s=i.tikersIds,a=i.stepAlias.map(p=>({id:p.id,alias:p.alias}));TickersManagerStatic._tickersToCompleteOnStepEnd.tikersIds.length=0,TickersManagerStatic._tickersToCompleteOnStepEnd.tikersIds.push(...s),TickersManagerStatic._tickersToCompleteOnStepEnd.stepAlias.length=0,TickersManagerStatic._tickersToCompleteOnStepEnd.stepAlias.push(...a);}}catch(i){e$1.error("Error importing data",i);}}};var ae=class t{static init(e){t._getScreen=e.getScreen;}static _getScreen;static get screen(){return t._getScreen()}};var w;(S=>{function t(l,v,A,b,U,z=0){return U?l==="width"?v*(ae.screen.width-A)+A-b-z*A:v*(ae.screen.height-A)+A-b-z*A:l==="width"?v*(ae.screen.width-A)+b+z*A:v*(ae.screen.height-A)+b+z*A}S.calculatePositionByAlign=t;function e(l,v,A,b,U,z=0){return U?l==="width"?(v-A+b+z*A)/(ae.screen.width-A):(v-A+b+z*A)/(ae.screen.height-A):l==="width"?(v-b-z*A)/(ae.screen.width-A):(v-b-z*A)/(ae.screen.height-A)}S.calculateAlignByPosition=e;function i(l,v){return l==="width"?v*ae.screen.width:v*ae.screen.height}S.calculatePositionByPercentagePosition=i;function s(l,v){return l==="width"?v/ae.screen.width:v/ae.screen.height}S.calculatePercentagePositionByPosition=s;function a(l,v){if(v=v%360,v<0&&(v+=360),v===0)return {x:l.x,y:l.y};if(v===90)return {x:-l.y,y:l.x};if(v===180)return {x:-l.x,y:-l.y};if(v===270)return {x:l.y,y:-l.x};if(v>0&&v<90){let A=v*Math.PI/180,b=Math.cos(A),U=Math.sin(A),z=l.x*b-l.y*U,te=l.x*U+l.y*b;return l.x!==0&&Math.sign(z)!==Math.sign(l.x)&&(z=-z),l.y!==0&&Math.sign(te)!==Math.sign(l.y)&&(te=-te),{x:z,y:te}}else if(v>90&&v<180){let A=(v-90)*Math.PI/180,b=Math.cos(A),U=Math.sin(A),z=-l.y*U-l.x*b,te=l.y*b-l.x*U;return l.x!==0&&Math.sign(z)!==Math.sign(l.x)&&(z=-z),l.y!==0&&Math.sign(te)!==Math.sign(l.y)&&(te=-te),{x:z,y:te}}else if(v>180&&v<270){let A=(v-180)*Math.PI/180,b=Math.cos(A),U=Math.sin(A),z=-l.x*b+l.y*U,te=-l.x*U-l.y*b;return l.x!==0&&Math.sign(z)!==Math.sign(l.x)&&(z=-z),l.y!==0&&Math.sign(te)!==Math.sign(l.y)&&(te=-te),{x:z,y:te}}else if(v>270&&v<360){let A=(v-270)*Math.PI/180,b=Math.cos(A),U=Math.sin(A),z=l.y*U-l.x*b,te=-l.y*b-l.x*U;return l.x!==0&&Math.sign(z)!==Math.sign(l.x)&&(z=-z),l.y!==0&&Math.sign(te)!==Math.sign(l.y)&&(te=-te),{x:z,y:te}}return {x:0,y:0}}S.getSuperPoint=a;function p(l,v){if(v=v%360,v<0&&(v+=360),v===0)return {x:l.x,y:l.y};if(v===90)return {x:l.y,y:-l.x};if(v===180)return {x:-l.x,y:-l.y};if(v===270)return {x:-l.y,y:l.x};if(v>0&&v<90){let A=v*Math.PI/180,b=Math.cos(A),U=Math.sin(A);return {x:l.x*b+l.y*U,y:-l.x*U+l.y*b}}else if(v>90&&v<180){let A=(v-90)*Math.PI/180,b=Math.cos(A),U=Math.sin(A);return {x:l.y*b-l.x*U,y:-l.y*U-l.x*b}}else if(v>180&&v<270){let A=(v-180)*Math.PI/180,b=Math.cos(A),U=Math.sin(A);return {x:-l.x*b-l.y*U,y:l.x*U-l.y*b}}else if(v>270&&v<360){let A=(v-270)*Math.PI/180,b=Math.cos(A),U=Math.sin(A);return {x:-l.y*b+l.x*U,y:l.y*U+l.x*b}}return {x:0,y:0}}S.getPointBySuperPoint=p;function y(l){let v=l.width,A=l.height,b=l.angle%360;return b<0&&(b+=360),b===0||b===180?v:b===90||b===270?A:Math.abs(v*Math.cos(b*Math.PI/180))+Math.abs(A*Math.sin(b*Math.PI/180))}S.getSuperWidth=y;function R(l){let v=l.width,A=l.height,b=l.angle%360;return b<0&&(b+=360),b===0||b===180?A:b===90||b===270?v:Math.abs(A*Math.cos(b*Math.PI/180))+Math.abs(v*Math.sin(b*Math.PI/180))}S.getSuperHeight=R;})(w||={});async function $e(t){if(t!=="EMPTY"){if(!t)throw e$1.error("Texture not found",t),new PixiError("unregistered_asset","Texture not found");if(we.Assets.cache.has(t)){let e=we.Assets.get(t);if(e)return e}return we.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 we.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 Se=class t extends we.Sprite{constructor(e$1){if(e$1 instanceof we.Texture)super(e$1);else {let{align:i,percentagePosition:s,...a}=ge(e$1)||{};super(a),i&&(this.align=i),s&&(this.percentagePosition=s);}this.pixivnId=this.constructor.prototype.pixivnId||e;}pixivnId=e;get memory(){return {...It(this),pixivnId:this.pixivnId,align:this._align,percentagePosition:this._percentagePosition}}async setMemory(e){return await st(this,e)}static from(e,i){let s=we.Sprite.from(e,i),a=new t;return a.texture=s.texture,a}onEventsHandlers={};on(e,i,s){return Oe(e,this,i),super.on(e,(...a)=>i(...a,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=w.getSuperPoint(this.pivot,this.angle),i=w.getSuperPoint(this.scale,this.angle);return {x:w.calculateAlignByPosition("width",this.x,w.getSuperWidth(this),e.x,i.x<0,this.anchor.x),y:w.calculateAlignByPosition("height",this.y,w.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=w.getSuperPoint(this.pivot,this.angle),i=w.getSuperPoint(this.scale,this.angle);return w.calculateAlignByPosition("width",this.x,w.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=w.getSuperPoint(this.pivot,this.angle),i=w.getSuperPoint(this.scale,this.angle);return w.calculateAlignByPosition("height",this.y,w.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:w.calculatePercentagePositionByPosition("width",this.x),y:w.calculatePercentagePositionByPosition("height",this.y)}}get percentageX(){return w.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 w.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=w.getSuperPoint(this.pivot,this.angle),i=w.getSuperPoint(this.scale,this.angle);this._align.x!==void 0&&(super.x=w.calculatePositionByAlign("width",this._align.x,w.getSuperWidth(this),e.x,i.x<0,this.anchor.x)),this._align.y!==void 0&&(super.y=w.calculatePositionByAlign("height",this._align.y,w.getSuperHeight(this),e.y,i.y<0,this.anchor.y));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=w.calculatePositionByPercentagePosition("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=w.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;}};de.add(Se,{name:e,copyProperty:async(t,e)=>{await st(t,e,{ignoreTexture:true});}});async function st(t,e,i){e=ge(e);let s=i?.ignoreTexture||false;if(await le(t,e),!s){let p;if("textureData"in e&&e.textureData&&(p=e.textureData),p&&p.url!=="EMPTY"){let y=p.url;p.alias&&we.Assets.resolver.hasKey(p.alias)&&(y=p.alias);try{let R=await $e(y);R&&(t.texture=R);}catch(R){e$1.error("Error in Sprite.setMemorySprite() while loading texture"),R=new PixiError("unregistered_asset",`Error loading image ${y}`,"canvas",e),GameUnifier.runOnError(R,{});}}}let a=i?.half;a&&await a(),"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 J=class t extends Se{_textureAlias;get textureAlias(){return this._textureAlias?this._textureAlias:this.texture.source.label}pixivnId=d$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 ot(this,e),this.reloadPosition();}static from(e,i){let s=we.Sprite.from(e,i),a=new t;return a.texture=s.texture,a}_loadIsStarted=false;get loadIsStarted(){return this._loadIsStarted}async load(){return this._loadIsStarted=true,$e(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"}};de.add(J,{name:d$1,copyProperty:async(t,e)=>{await ot(t,e,{ignoreTexture:true});}});async function ot(t,e,i){return await st(t,e,{half:async()=>{"loadIsStarted"in e&&e.loadIsStarted&&await t.load();},ignoreTexture:i?.ignoreTexture})}var ye=class t extends J{constructor(e,i){if(e instanceof we.Texture){super(e,i);return}let{loop:s,paused:a,currentTime:p,...y}=e||{};super(y,i),s&&(this.loop=s),a&&(this.paused=a),p&&(this.currentTime=p);}pixivnId=g;get memory(){return {...super.memory,pixivnId:this.pixivnId,loop:this.loop,paused:this._paused,currentTime:this.currentTime}}async setMemory(e){await Vt(this,e),this.reloadPosition();}static from(e,i){let s=we.Sprite.from(e,i),a=new t;return a.texture=s.texture,a}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}};de.add(ye,{name:g,getInstance:async(t,e)=>{let i;"textureData"in e&&e.textureData&&(i=e.textureData);let s=new t(void 0,i?.alias);return await s.setMemory(e),s},copyProperty:async(t,e)=>{await Vt(t,e,{ignoreTexture:true});}});async function Vt(t,e,i){await ot(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 Pe=class extends Container{constructor(e){let{anchor:i,align:s,percentagePosition:a,...p}=ge(e)||{};super(p),this.pixivnId=this.constructor.prototype.pixivnId||b,i&&(this.anchor=i),s&&(this.align=s),a&&(this.percentagePosition=a);}pixivnId=b;get memory(){return {...Ae(this,{childrenExport:true}),anchor:this._anchor?this.anchor:void 0,align:this._align,percentagePosition:this._percentagePosition}}async setMemory(e){await this.importChildren(e),await le(this,e),this.reloadAnchor(),this.reloadPosition();}async importChildren(e){for(let i=0;i<e.elements.length;i++){let s=e.elements[i],a=await et(s);this.addChild(a);}}onEventsHandlers={};on(e,i,s){return Oe(e,this,i),super.on(e,(...a)=>i(...a,this),s)}_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=w.getSuperPoint(this.pivot,this.angle),i=w.getSuperPoint(this.scale,this.angle);return {x:w.calculateAlignByPosition("width",this.x,w.getSuperWidth(this),e.x,i.x<0),y:w.calculateAlignByPosition("height",this.y,w.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=w.getSuperPoint(this.pivot,this.angle),i=w.getSuperPoint(this.scale,this.angle);return w.calculateAlignByPosition("width",this.x,w.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=w.getSuperPoint(this.pivot,this.angle),i=w.getSuperPoint(this.scale,this.angle);return w.calculateAlignByPosition("height",this.y,w.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:w.calculatePercentagePositionByPosition("width",this.x),y:w.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 w.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 w.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=w.getSuperPoint(this.pivot,this.angle),i=w.getSuperPoint(this.scale,this.angle);this._align.x!==void 0&&(super.x=w.calculatePositionByAlign("width",this._align.x,w.getSuperWidth(this),e.x,i.x<0)),this._align.y!==void 0&&(super.y=w.calculatePositionByAlign("height",this._align.y,w.getSuperHeight(this),e.y,i.y<0));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=w.calculatePositionByPercentagePosition("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=w.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;}};de.add(Pe,{name:b,copyProperty:async(t,e)=>await le(t,e)});var Fn=new Set(["mp4","webm","ogg","ogv","avi","mov","wmv","flv","mkv","m4v","3gp","3g2","ts","mts"]);function Ge(t){let e=we.Assets.cache.has(t)?we.Assets.get(t):null;return e instanceof we.Texture&&(t=e.source?.label||t),Ln(t)}function Ln(t){let e=t.split(".").pop()?.toLowerCase();return e!==void 0&&Fn.has(e)}var Q=class extends Pe{constructor(e,i){let{anchor:s,align:a,percentagePosition:p,...y}=ge(e)||{};super(y),i&&i.forEach(R=>{Ge(R)?this.addChild(new ye(void 0,R)):this.addChild(new J(void 0,R));}),s&&(this.anchor=s),a&&(this.align=a),p&&(this.percentagePosition=p);}get memory(){return {...super.memory,pixivnId:c,loadIsStarted:this._loadIsStarted}}async setMemory(e){await this.importChildren(e),await jt(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(i=>i.load());return Promise.all(e).then(()=>{this._loadIsStarted=false,this.reloadAnchor(),this.reloadPosition();}).catch(i=>{this._loadIsStarted=false,e$1.error("Error into ImageContainer.load()",i);})}get texture(){return this.children.length>0?this.children[0].texture:new we.Texture}get haveEmptyTexture(){return this.children.some(e=>e.texture._source.label==="EMPTY")}};de.add(Q,{name:c,copyProperty:async(t,e)=>await jt(t,e)});async function jt(t,e){e=ge(e)||{},le(t,e,{end:async()=>{"loadIsStarted"in e&&e.loadIsStarted&&await t.load();}});}var at=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 Ee=class extends we.Text{constructor(e){let{align:i,percentagePosition:s,...a}=ge(e)||{};super(a),this.pixivnId=this.constructor.prototype.pixivnId||f$1,i&&(this.align=i),s&&(this.percentagePosition=s);}pixivnId=f$1;get memory(){return {...Tt(this),pixivnId:this.pixivnId,align:this._align,percentagePosition:this._percentagePosition}}async setMemory(e){await Hn(this,e),this.reloadPosition();}onEventsHandlers={};on(e,i,s){return Oe(e,this,i),super.on(e,(...a)=>i(...a,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=w.getSuperPoint(this.pivot,this.angle),i=w.getSuperPoint(this.scale,this.angle);return {x:w.calculateAlignByPosition("width",this.x,w.getSuperWidth(this),e.x,i.x<0,this.anchor.x),y:w.calculateAlignByPosition("height",this.y,w.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=w.getSuperPoint(this.pivot,this.angle),i=w.getSuperPoint(this.scale,this.angle);return w.calculateAlignByPosition("width",this.x,w.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=w.getSuperPoint(this.pivot,this.angle),i=w.getSuperPoint(this.scale,this.angle);return w.calculateAlignByPosition("height",this.y,w.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:w.calculatePercentagePositionByPosition("width",this.x),y:w.calculatePercentagePositionByPosition("height",this.y)}}get percentageX(){return w.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 w.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=w.getSuperPoint(this.pivot,this.angle),i=w.getSuperPoint(this.scale,this.angle);this._align.x!==void 0&&(super.x=w.calculatePositionByAlign("width",this._align.x,w.getSuperWidth(this),e.x,i.x<0,this.anchor.x)),this._align.y!==void 0&&(super.y=w.calculatePositionByAlign("height",this._align.y,w.getSuperHeight(this),e.y,i.y<0,this.anchor.y));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=w.calculatePositionByPercentagePosition("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=w.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;}};de.add(Ee,{name:f$1});async function Hn(t,e){"text"in e&&e.text!==void 0&&(t.text=e.text),await le(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 bt(t){let e=t.filters;return e?Array.isArray(e)?[...e]:[e]:[]}function Xn(t,e){t.filters=[...bt(t),...e];}function $n(t,e){let i=bt(t).filter(s=>!e.includes(s));t.filters=i.length>0?i:null;}function ee(t,e,i,s,a,p,y){Xn(e,[i]),y?.();let R=filters.animate(t,i,s,{duration:a.duration??1,delay:a.delay,ease:a.ease,times:a.times,aliasToRemoveAfter:a.aliasToRemoveAfter,autoplay:a.autoplay},p,void 0,()=>{$n(e,[i]),i.destroy();});return R&&(a.completeOnContinue??true)&&tickers$1.completeOnStepEnd({id:R}),R}function Ie(t,e){let i;try{i=f.screen;}catch{i=void 0;}return b$1(t.getBounds(),e,bt(t),i)}async function Gn(t,e={},i){return Ot.shakeEffect(t,e,i)}function Kt(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 ct(t,e,i){let s=[0],a=t;for(let p=0;p<i;p++)s.push(p%2===0?a:-a,0),a*=e;return s}function He(t,e,i,s){let a=[t],p=e;for(let y=0;y<s;y++)a.push(t+p,t),p*=i;return a}var Ot;(_e=>{async function t(M,q={},K){let _=f.find(M);if(!_){e$1.error(`The element with the alias ${M} does not exist. So the shake effect can't be applied.`);return}let B={x:_.position.x,y:_.position.y},{shakeType:W="horizontal",maxShockSize:G=10,shocksNumber:j=10,...H}=q,F=j-1;if(F<2){e$1.error("The number of shocks must be at least 3.");return}let X=Math.floor(F/2),Y=Math.ceil(F/2),L=[];for(let Z=0;Z<X;Z++){let re=G*(Z+1)/X;W==="horizontal"?Z%2!==0?L.push(B.x+re):L.push(B.x-re):Z%2!==0?L.push(B.y+re):L.push(B.y-re);}let N=X%2===0;for(let Z=Y;Z>0;Z--){let re=G*(Z+1)/(Y-1);W==="horizontal"?Z%2===0&&!N||Z%2!==0&&N?L.push(B.x-re):L.push(B.x+re):Z%2===0&&!N||Z%2!==0&&N?L.push(B.y-re):L.push(B.y+re);}let ne;if(W==="horizontal"?(L.push(B.x),ne=f.animate(M,{x:L},H,K)):(L.push(B.y),ne=f.animate(M,{y:L},H,K)),ne)return [ne]}_e.shakeEffect=t;async function e(M,q={},K){let _=f.find(M);if(!_){e$1.error(`The element with the alias ${M} does not exist. So the bounce effect can't be applied.`);return}let{direction:B="up",distance:W=30,bounces:G=4,decay:j=.5,...H}=q,{axis:F,sign:X}=Kt(B),Y=F==="x"?_.position.x:_.position.y,L=[Y],N=W;for(let Z=0;Z<G;Z++)L.push(Y+X*N,Y),N*=j;let ne=f.animate(M,{[F]:L},H,K);if(ne)return [ne]}_e.bounceEffect=e;async function i(M,q={},K){let _=f.find(M);if(!_){e$1.error(`The element with the alias ${M} does not exist. So the pulse effect can't be applied.`);return}let{scale:B=1.2,pulses:W=3,decay:G=.6,...j}=q,H=_.scale.x,F=_.scale.y,X=[H],Y=[F],L=B-1;for(let ne=0;ne<W;ne++)X.push(H*(1+L),H),Y.push(F*(1+L),F),L*=G;let N=f.animate(M,{scaleX:X,scaleY:Y},j,K);if(N)return [N]}_e.pulseEffect=i;async function s(M,q={},K){let _=f.find(M);if(!_){e$1.error(`The element with the alias ${M} does not exist. So the hop effect can't be applied.`);return}let{direction:B="up",distance:W=40,secondaryHops:G=0,decay:j=.5,...H}=q,{axis:F,sign:X}=Kt(B),Y=F==="x"?_.position.x:_.position.y,L=[Y],N=W;for(let Z=0;Z<1+G;Z++)L.push(Y+X*N,Y),N*=j;let ne=f.animate(M,{[F]:L},H,K);if(ne)return [ne]}_e.hopEffect=s;async function a$1(M,q={},K){let _=f.find(M);if(!_){e$1.error(`The element with the alias ${M} does not exist. So the wiggle effect can't be applied.`);return}let{angle:B=15,repetitions:W=3,decay:G=.5,...j}=q,H=_.rotation,F=B*Math.PI/180,X=ct(F,G,W).map(L=>H+L),Y=f.animate(M,{rotation:X},j,K);if(Y)return [Y]}_e.wiggleEffect=a$1;async function p(M,q={},K){let _=f.find(M);if(!_){e$1.error(`The element with the alias ${M} does not exist. So the nod effect can't be applied.`);return}let{axis:B="horizontal",distance:W=15,repetitions:G=3,decay:j=.5,...H}=q,F=B==="horizontal"?"x":"y",X=B==="horizontal"?_.position.x:_.position.y,Y=ct(W,j,G).map(N=>X+N),L=f.animate(M,{[F]:Y},H,K);if(L)return [L]}_e.nodEffect=p;async function y(M,q={},K){let _=f.find(M);if(!_){e$1.error(`The element with the alias ${M} does not exist. So the sway effect can't be applied.`);return}let{axis:B="horizontal",distance:W=10,angle:G=5,repetitions:j=3,decay:H=0,ease:F="easeInOut",...X}=q,Y=B==="horizontal"?"x":"y",L=B==="horizontal"?_.position.x:_.position.y,N=_.rotation,ne=G*Math.PI/180,Z=ct(W,H||1,j).map(xe=>L+xe),re=ct(ne,H||1,j).map(xe=>N+xe),fe=f.animate(M,{[Y]:Z,rotation:re},{ease:F,...X},K);if(fe)return [fe]}_e.swayEffect=y;async function R(M,q={},K){let _=f.find(M);if(!_){e$1.error(`The element with the alias ${M} does not exist. So the punch effect can't be applied.`);return}let{mode:B="scale",strength:W=.3,overshoot:G=.3,...j}=q,H;if(B==="scale"){let F=X=>[X,X*(1+W),X*(1-W*G),X];H=f.animate(M,{scaleX:F(_.scale.x),scaleY:F(_.scale.y)},j,K);}else {let F=B==="rotation"?_.rotation:B==="x"?_.position.x:_.position.y,X=B==="rotation"?W*Math.PI/180:W,Y=[F,F+X,F-X*G,F];H=f.animate(M,{[B]:Y},j,K);}if(H)return [H]}_e.punchEffect=R;async function S(M,q={},K){let _=f.find(M);if(!_){e$1.error(`The element with the alias ${M} does not exist. So the glitch effect can't be applied.`);return}let{strength:B=40,bursts:W=3,slices:G=8,direction:j=0,rgbSplit:H=6,decay:F=.5,ease:X="linear",...Y}=q,L=new filters.GlitchFilter({slices:G,direction:j,offset:0});L.refresh(),L.padding=Math.ceil(Math.abs(B));let N=[],ne=ee(M,_,L,{offset:a(B,F,W)},{ease:X,...Y},K);if(ne&&N.push(ne),H!==0){let Z=a(H,F,W),re=new filters.RGBSplitFilter({red:{x:0,y:0},green:{x:0,y:0},blue:{x:0,y:0}});re.padding=Math.ceil(Math.abs(H));let fe=ee(M,_,re,{redX:Z,blueX:Z.map(xe=>-xe)},{ease:X,...Y},K);fe&&N.push(fe);}if(N.length>0)return N}_e.glitchEffect=S;async function l(M,q={},K){let _=f.find(M);if(!_){e$1.error(`The element with the alias ${M} does not exist. So the chromatic aberration effect can't be applied.`);return}let{strength:B=8,axis:W="horizontal",bursts:G=1,decay:j=.5,...H}=q,F=new filters.RGBSplitFilter({red:{x:0,y:0},green:{x:0,y:0},blue:{x:0,y:0}});F.padding=Math.ceil(Math.abs(B));let X=W==="horizontal"?"redX":"redY",Y=W==="horizontal"?"blueX":"blueY",L={[X]:He(0,B,j,G),[Y]:He(0,-B,j,G)},N=ee(M,_,F,L,H,K);if(N)return [N]}_e.chromaticAberrationEffect=l;async function v(M,q={},K){let _=f.find(M);if(!_){e$1.error(`The element with the alias ${M} does not exist. So the shockwave effect can't be applied.`);return}let{origin:B={x:.5,y:.5},amplitude:W=30,wavelength:G=160,brightness:j=1,radius:H=-1,speed:F=500,strength:X,...Y}=q,{width:L,height:N}=_.getBounds(),ne=X??e$2({x:B.x*L,y:B.y*N},{width:L,height:N},G,H)/F,Z=new filters.ShockwaveFilter({center:{x:0,y:0},amplitude:W,wavelength:G,brightness:j,radius:H,speed:F,time:0});Z.padding=Math.ceil(Math.abs(W)*1.25);let re=ee(M,_,Z,{time:[0,ne]},Y,K,()=>{let{x:fe,y:xe}=Ie(_,B);Z.center={x:fe,y:xe};});if(re)return [re]}_e.shockwaveEffect=v;async function A(M,q={},K){let _=f.find(M);if(!_){e$1.error(`The element with the alias ${M} does not exist. So the radial blur effect can't be applied.`);return}let{strength:B=.5,bursts:W=1,origin:G={x:.5,y:.5},innerRadius:j=0,radius:H=-1,decay:F=.5,...X}=q,Y=new filters.ZoomBlurFilter({center:{x:0,y:0},innerRadius:j,radius:H,strength:0}),{width:L,height:N}=_.getBounds();Y.padding=d$2({x:G.x*L,y:G.y*N},B,L,N);let ne=He(0,B,F,W),Z=ee(M,_,Y,{strength:ne},X,K,()=>{let{x:re,y:fe}=Ie(_,G);Y.center={x:re,y:fe};});if(Z)return [Z]}_e.radialBlurEffect=A;async function b(M,q={},K){let _=f.find(M);if(!_){e$1.error(`The element with the alias ${M} does not exist. So the blur pulse effect can't be applied.`);return}let{strength:B=8,pulses:W=3,quality:G,decay:j=.5,...H}=q,F=new filters.BlurFilter({strength:0,quality:G}),X=He(0,B,j,W),Y=ee(M,_,F,{strength:X},H,K);if(Y)return [Y]}_e.blurPulseEffect=b;async function U(M,q={},K){let _=f.find(M);if(!_){e$1.error(`The element with the alias ${M} does not exist. So the vignette pulse effect can't be applied.`);return}let{strength:B=1,pulses:W=1,radius:G=.5,blur:j=.5,decay:H=.5,...F}=q,X=new filters.CRTFilter({curvature:0,lineWidth:0,lineContrast:0,noise:0,vignetting:G,vignettingBlur:j,vignettingAlpha:0}),Y=He(0,B,H,W),L=ee(M,_,X,{vignettingAlpha:Y},F,K);if(L)return [L]}_e.vignettePulseEffect=U;async function z(M,q={},K){let _=f.find(M);if(!_){e$1.error(`The element with the alias ${M} does not exist. So the desaturate effect can't be applied.`);return}let{amount:B=0,duration:W=1,holdDuration:G=0,...j}=q,H=W*2+G,F=[0,W/H,(W+G)/H,1],X=new filters.AdjustmentFilter({saturation:1}),Y=ee(M,_,X,{saturation:[1,B,B,1]},{...j,duration:H,times:F},K);if(Y)return [Y]}_e.desaturateEffect=z;async function te(M,q={},K){let _=f.find(M);if(!_){e$1.error(`The element with the alias ${M} does not exist. So the glow pulse effect can't be applied.`);return}let{strength:B=4,pulses:W=3,color:G=16777215,distance:j=10,innerStrength:H=0,decay:F=.5,...X}=q,Y=new filters.GlowFilter({outerStrength:0,innerStrength:H,distance:j,color:G}),L=He(0,B,F,W),N=ee(M,_,Y,{outerStrength:L},X,K);if(N)return [N]}_e.glowPulseEffect=te;})(Ot||={});function Me(t){let e=t.getLocalBounds();return {x:e.x,y:e.y,width:e.width,height:e.height}}function wt(t,e){return e.graphics||(e.graphics=new Graphics,e.graphics.label="",t.parent?.addChild(e.graphics),t.mask=e.graphics),jn(t,e.graphics),e.graphics}function jn(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 Nn(t,e){e.graphics&&(t.mask===e.graphics&&(t.mask=null),e.graphics.parent?.removeChild(e.graphics),e.graphics.destroy({children:true}),e.graphics=void 0);}function Kn(t,e,i,s){let a=e.invert?1-i:i,{bounds:p}=e,y=wt(t,s),R=p.x+p.width/2,S=p.y+p.height/2,l=Math.sqrt(p.width**2+p.height**2)||1,v=Math.max(a,0)*l*2,A=e.angle*Math.PI/180;if(y.clear(),v>0){let b=Math.cos(-A),U=Math.sin(-A),z=[[-l,-l],[-l+v,-l],[-l+v,l],[-l,l]].flatMap(([te,_e])=>[R+te*b-_e*U,S+te*U+_e*b]);y.poly(z).fill(16777215);}}function qn(t,e,i,s){let a=e.invert?1-i:i,{bounds:p}=e,y=wt(t,s),R=p.x+p.width*e.originX,S=p.y+p.height*e.originY,l=Math.max(R-p.x,p.x+p.width-R),v=Math.max(S-p.y,p.y+p.height-S),A=Math.sqrt(l**2+v**2)||1,b=Math.max(a,0)*A,U=e.aspect>0?e.aspect:1;if(y.clear(),e.outside){let z=A*Math.max(U,1)*2;y.rect(p.x-z,p.y-z,p.width+z*2,p.height+z*2).fill(16777215),b>0&&y.ellipse(R,S,b*U,b).cut();}else b>0&&y.ellipse(R,S,b*U,b).fill(16777215);}function Zn(t,e,i,s){let a=e.invert?1-i:i,p=1-a,{bounds:y}=e,R=wt(t,s);if(R.clear(),e.direction==="outward"){if(a>0)if(e.orientation==="horizontal"){let S=y.x+y.width*e.origin;R.rect(S-(S-y.x)*a,y.y,y.width*a,y.height).fill(16777215);}else {let S=y.y+y.height*e.origin;R.rect(y.x,S-(S-y.y)*a,y.width,y.height*a).fill(16777215);}return}if(e.orientation==="horizontal"){let S=y.x+y.width*e.origin,l=S-y.x,v=y.x+y.width-S,A=y.x-p*l,b=S+p*v;l>0&&R.rect(A,y.y,l,y.height).fill(16777215),v>0&&R.rect(b,y.y,v,y.height).fill(16777215);}else {let S=y.y+y.height*e.origin,l=S-y.y,v=y.y+y.height-S,A=y.y-p*l,b=S+p*v;l>0&&R.rect(y.x,A,y.width,l).fill(16777215),v>0&&R.rect(y.x,b,y.width,v).fill(16777215);}}function Jn(t,e,i){switch(e.kind){case "wipe":case "iris":case "split":Nn(t,i);break}}function Qn(t,e,i,s){switch(e.kind){case "wipe":return Kn(t,e,i,s);case "iris":return qn(t,e,i,s);case "split":return Zn(t,e,i,s)}}function At(t,e){let i={};return {apply(s){let a=f.find(t);a&&(i.component=a,Qn(a,e,s,i));},cleanup(){let s=i.component??f.find(t);s&&Jn(s,e,i);}}}function dt(t,e,i){let s={...f.find(t)?.memory,...i},a=new Q(i,e);return s&&f.copyCanvasElementProperty(s,a),f.add(t,a,{ignoreOldStyle:true,zIndex:i?.zIndex}),a}async function ei(t,e,i){let s={...f.find(t)?.memory,...i},a=new Q(i,e);return a.label=t,await a.load(),s&&f.copyCanvasElementProperty(s,a),f.add(t,a,{ignoreOldStyle:true,zIndex:i?.zIndex}),a}function ut(t,e,i){if(!e)if(we.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,...i,label:t});let s={...f.find(t)?.memory,...i},a=new J(i,e);return s&&f.copyCanvasElementProperty(s,a),f.add(t,a,{ignoreOldStyle:true,zIndex:i?.zIndex}),a}async function ti(t,e,i){if(!e)if(we.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,...i,label:t});let s={...f.find(t)?.memory,...i},a=new J(i,e);return a.label=t,await a.load(),s&&f.copyCanvasElementProperty(s,a),f.add(t,a,{ignoreOldStyle:true,zIndex:i?.zIndex}),a}function ft(t,e,i){if(!e)if(we.Assets.resolver.hasKey(t))e=t;else throw new PixiError("unregistered_asset",`The video ${t} does not exist in the cache.`,"canvas",{pixivnId:g,...i,label:t});let s={...f.find(t)?.memory,...i},a=new ye(i,e);return s&&f.copyCanvasElementProperty(s,a),f.add(t,a,{ignoreOldStyle:true,zIndex:i?.zIndex}),a}async function ni(t,e,i){if(!e)if(we.Assets.resolver.hasKey(t))e=t;else throw new PixiError("unregistered_asset",`The video ${t} does not exist in the cache.`,"canvas",{pixivnId:g,...i,label:t});let s={...f.find(t)?.memory,...i},a=new ye(i,e);return a.label=t,await a.load(),s&&f.copyCanvasElementProperty(s,a),f.add(t,a,{ignoreOldStyle:true,zIndex:i?.zIndex}),a}async function ii(t,e,i={},s){return pe.showWithDissolve(t,e,i,s)}function ri(t,e={},i){return pe.removeWithDissolve(t,e,i)}async function si(t,e,i={},s){return pe.showWithFade(t,e,i,s)}function oi(t,e={},i){return pe.removeWithFade(t,e,i)}async function ai(t,e,i={},s){return pe.moveIn(t,e,i,s)}function ci(t,e={},i){return pe.moveOut(t,e,i)}async function di(t,e,i={},s){return pe.zoomIn(t,e,i,s)}function ui(t,e={},i){return pe.zoomOut(t,e,i)}async function fi(t,e,i={},s){return pe.pushIn(t,e,i,s)}function li(t,e={direction:"right"},i){return pe.pushOut(t,e,i)}var pe;(Ai=>{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,n,o){if(typeof n=="string")return Ge(n)?ft(r,n,{...o.properties,zIndex:o.zIndex}):ut(r,n,{...o.properties,zIndex:o.zIndex});if(Array.isArray(n))return dt(r,n,{...o.properties,zIndex:o.zIndex});if(typeof n=="object"&&"value"in n&&"options"in n){if(typeof n.value=="string")return Ge(n.value)?ft(r,n.value,{...n.options,...o.properties,zIndex:o.zIndex}):ut(r,n.value,{...n.options,...o.properties,zIndex:o.zIndex});if(Array.isArray(n.value))return dt(r,n.value,{...n.options,...o.properties,zIndex:o.zIndex})}return f.add(r,n,o),n}function i(r){let n=r;return {x:n.x,y:n.y,anchor:n.anchor,scale:n.scale,pivot:n.pivot,skew:n.skew,rotation:n.rotation,angle:n.angle}}function s(r,n,o){let c,d=f.find(r);d&&(c=`${r}_temp_${o}`,f.editAlias(r,c));let u=e(r,n,{zIndex:d?d.parent?.getChildIndex(d):void 0,properties:d?i(d):void 0});return d?.parent?.setChildIndex(d,d.parent.getChildIndex(d)-.1),c&&f.copyCanvasElementProperty(c,r),c&&tickers$1.transfer(c,r,"duplicate"),{component:u,oldComponentAlias:c}}function a$1(r,n,o,c){return r?n?c(r)??[]:(o.push(r),[]):[]}function p(r){let{aliasToRemoveAfter:n,animateOldComponentOut:o,...c}=r;return c}function y(r,n){let o=r?[r,...n]:n;return o.length>0?o:void 0}function R(r){switch(r){case "up":return 90;case "down":return 270;case "left":return 180;default:return 0}}function S(r,n,o){let{apply:c,cleanup:d}=At(r,n.config),u=filters.animate(r,void 0,{value:[n.from,n.to]},{duration:n.duration??1,delay:n.delay,ease:n.ease,aliasToRemoveAfter:n.aliasToRemoveAfter,tickerIdToResume:n.tickerIdToResume},o,c,d,{alias:r,config:n.config});return u&&c(n.from),u&&(n.completeOnContinue??true)&&tickers$1.completeOnStepEnd({id:u}),u}function l(r,n,o,c,d,u){let m=Math.max(c,0)/4;o==="in"?(n&&(n.alpha=0),f.animate(r,{alpha:[0,1]},{duration:m,delay:u,completeOnContinue:false},d)):f.animate(r,{alpha:[1,0]},{duration:m,delay:typeof u=="function"?(C,h)=>u(C,h)+Math.max(c-m,0):(u??0)+Math.max(c-m,0),completeOnContinue:false},d);}function v(r,n,o,c,d=false){let u=Math.max(c,1),m=n*2+o,C=d?n+o:m,h=Math.max(m*(u-1)+C,.001),T=[0],P=[0],I=0;for(let x=0;x<u;x++){let g=x===u-1;I+=n,T.push(r),P.push(I/h),I+=o,T.push(r),P.push(I/h),(!g||!d)&&(I+=n,T.push(0),P.push(Math.min(I/h,1)));}return {values:T,times:P,total:h}}async function A(r,n,o={},c){let{completeOnContinue:d=true,tickerIdToResume:u=[],...m}=o,C=[];n||(n=r),typeof u=="string"&&(u=[u]);let h,T=f.find(r);if(T&&(h=`${r}_temp_disolve`,f.editAlias(r,h)),n=e(r,n,{zIndex:T?T.parent?.getChildIndex(T):void 0,properties:T?i(T):void 0}),T?.parent?.setChildIndex(T,T.parent.getChildIndex(T)-.1),h&&f.copyCanvasElementProperty(h,r),h&&tickers$1.transfer(h,r,"duplicate"),n.alpha=0,h){let I=b(h,{...o,autoplay:false,completeOnContinue:d},c);I&&(C.push(...I),u.push(...I));}let P=f.animate(r,{alpha:1},{...m,tickerIdToResume:u,completeOnContinue:d},c);if(P&&C.push(P),C.length>0)return C}Ai.showWithDissolve=A;function b(r,n={},o){let{completeOnContinue:c=true,aliasToRemoveAfter:d=[],...u}=n;typeof d=="string"&&(d=[d]),d.push(r);let m=f.animate(r,{alpha:0},{...u,aliasToRemoveAfter:d,completeOnContinue:c},o);if(m)return [m]}Ai.removeWithDissolve=b;async function U(r,n,o={},c){let{completeOnContinue:d=true,aliasToRemoveAfter:u=[],...m}=o,C=[];n||(n=r),typeof u=="string"&&(u=[u]);let h=f.find(r);if(!h)return A(r,n,o,c);let T=`${r}_temp_fade`;f.editAlias(r,T),u.push(T),n=e(r,n,{zIndex:h?h.parent?.getChildIndex(h):void 0,properties:i(h)}),h?.parent?.setChildIndex(h,h.parent.getChildIndex(h)-.1),T&&f.copyCanvasElementProperty(T,r),T&&tickers$1.transfer(T,r,"duplicate"),n.alpha=0;let P=f.animate(r,{alpha:1},{...m,aliasToRemoveAfter:u,completeOnContinue:d},c);if(P){let I=b(T,{...o,tickerIdToResume:P,completeOnContinue:d},c);I&&C.push(...I),C.push(P),tickers$1.pause({id:P});}if((n instanceof J||n instanceof Q)&&n.haveEmptyTexture&&await n.load(),C.length>0)return C}Ai.showWithFade=U;function z(r,n={},o){return b(r,n,o)}Ai.removeWithFade=z;async function te(r,n,o={},c){let{direction:d="right",completeOnContinue:u=true,tickerIdToResume:m=[],aliasToRemoveAfter:C=[],removeOldComponentWithMoveOut:h,animateOldComponentOut:T=h??false,motionBlur:P,...I}=o,x=[],g;n||(n=r),typeof m=="string"&&(m=[m]),typeof C=="string"&&(C=[C]);let O,k=f.find(r);if(k&&(O=`${r}_temp_movein`,f.editAlias(r,O),k instanceof J||k instanceof Q?g=k.positionInfo:g={x:k.x,y:k.y,type:"pixel"}),n=e(r,n,{zIndex:k?k.parent?.getChildIndex(k):void 0}),k?.parent?.setChildIndex(k,k.parent.getChildIndex(k)-.1),O&&f.copyCanvasElementProperty(O,r),O&&tickers$1.transfer(O,r,"move"),(n instanceof J||n instanceof Q)&&n.haveEmptyTexture&&await n.load(),g||(n instanceof J||n instanceof Q?g=n.positionInfo:g={x:n.x,y:n.y,type:"pixel"}),O)if(T){let se=_e(O,{...I,direction:d,motionBlur:P,autoplay:false,completeOnContinue:u},c);se&&(x.push(...se),m.push(...se));}else C.push(O);switch(d){case "up":n.y=f.height+n.height;break;case "down":n.y=-n.height;break;case "left":n.x=f.width+n.width;break;case "right":n.x=-n.width;break}let D=tickers$1.pause({canvasAlias:r});m.push(...D);let $=f.animate(r,t(g),{...I,tickerIdToResume:m,aliasToRemoveAfter:C,completeOnContinue:u},c);$&&x.push($);let V=lt(r,n,d,P,{...I,completeOnContinue:u},c);if(V&&x.push(V),x.length>0)return x}Ai.moveIn=te;function _e(r,n={},o){let{direction:c="right",completeOnContinue:d=true,aliasToRemoveAfter:u=[],motionBlur:m,...C}=n;typeof u=="string"&&(u=[u]),u.push(r);let h=f.find(r);if(!h){e$1.warn(`The canvas component "${r}" is not found.`);return}let T={x:h.x,y:h.y};switch(c){case "up":T.y=-h.height;break;case "down":T.y=f.height+h.height;break;case "left":T.x=-h.width;break;case "right":T.x=f.width+h.width;break}tickers$1.pause({canvasAlias:r});let P=f.animate(r,T,{...C,aliasToRemoveAfter:u,completeOnContinue:d},o),I=lt(r,h,c,m,{...C,completeOnContinue:d},o);return je([P,I])}Ai.moveOut=_e;async function M(r,n,o={},c){let{direction:d="right",completeOnContinue:u=true,tickerIdToResume:m=[],aliasToRemoveAfter:C=[],removeOldComponentWithZoomOut:h,animateOldComponentOut:T=h??false,...P}=o,I=[],x;n||(n=r),typeof m=="string"&&(m=[m]),typeof C=="string"&&(C=[C]);let g,O=f.find(r);O&&(g=`${r}_temp_zoom`,f.editAlias(r,g),O instanceof J||O instanceof Q?x=O.positionInfo:x={x:O.x,y:O.y,type:"pixel"}),n=e(r,n,{zIndex:O?O.parent?.getChildIndex(O):void 0}),O?.parent?.setChildIndex(O,O.parent.getChildIndex(O)-.1),g&&f.copyCanvasElementProperty(g,r),g&&tickers$1.transfer(g,r,"move"),(n instanceof J||n instanceof Q)&&n.haveEmptyTexture&&await n.load(),x||(n instanceof J||n instanceof Q?x=n.positionInfo:x={x:n.x,y:n.y,type:"pixel"});let k={x:n.pivot.x,y:n.pivot.y},D={x:n.scale.x,y:n.scale.y};if(g)if(T){let se=q(g,{...P,direction:d,autoplay:false,completeOnContinue:u},c);se&&(I.push(...se),m.push(...se));}else C.push(g);(n instanceof J||n instanceof Q)&&n.haveEmptyTexture&&await n.load(),d==="up"?(n.pivot.y=f.height-n.y,n.pivot.x=f.width/2-n.x,n.y=f.height,n.x=f.width/2):d==="down"?(n.pivot.y=0-n.y,n.pivot.x=f.width/2-n.x,n.y=0,n.x=f.width/2):d==="left"?(n.pivot.x=f.width-n.x,n.pivot.y=f.height/2-n.y,n.x=f.width,n.y=f.height/2):d==="right"&&(n.pivot.x=0-n.x,n.pivot.y=f.height/2-n.y,n.x=0,n.y=f.height/2),n.pivot=w.getPointBySuperPoint(n.pivot,n.angle),n.scale.set(0);let $=tickers$1.pause({canvasAlias:r});m.push(...$);let V=f.animate(r,{pivotX:k.x,pivotY:k.y,scaleX:D.x,scaleY:D.y,...t(x)},{...P,tickerIdToResume:m,aliasToRemoveAfter:C,completeOnContinue:u},c);if(V&&I.push(V),I.length>0)return I}Ai.zoomIn=M;function q(r,n={},o){let{direction:c="right",completeOnContinue:d=true,aliasToRemoveAfter:u=[],...m}=n;typeof u=="string"&&(u=[u]),u.push(r);let C=f.find(r);if(!C){e$1.warn(`The canvas component "${r}" is not found.`);return}let h={x:C.x,y:C.y},T={x:C.pivot.x,y:C.pivot.y};c==="down"?(h.y=f.height,h.x=f.width/2,T.y=f.height-h.y,T.x=f.width/2-h.x):c==="up"?(h.y=0,h.x=f.width/2,T.y=0-h.y,T.x=f.width/2-h.x):c==="right"?(h.x=f.width,h.y=f.height/2,T.x=f.width-h.x,T.y=f.height/2-h.y):c==="left"&&(h.x=0,h.y=f.height/2,T.x=0-h.x,T.y=f.height/2-h.y),T=w.getPointBySuperPoint(T,C.angle),tickers$1.pause({canvasAlias:r});let P=f.animate(r,{...h,pivotX:T.x,pivotY:T.y,scaleX:0,scaleY:0},{...m,aliasToRemoveAfter:u,completeOnContinue:d},o);if(P)return [P]}Ai.zoomOut=q;async function K(r,n,o={},c){let{direction:d="right",completeOnContinue:u=true,tickerIdToResume:m=[],aliasToRemoveAfter:C=[],animateOldComponentOut:h=true,motionBlur:T,...P}=o,I=[],x;n||(n=r),typeof m=="string"&&(m=[m]),typeof C=="string"&&(C=[C]);let g,O=f.find(r);switch(O&&(g=`${r}_temp_push`,f.editAlias(r,g),O instanceof J||O instanceof Q?x=O.positionInfo:x={x:O.x,y:O.y,type:"pixel"}),n=e(r,n,{zIndex:O?O.parent?.getChildIndex(O):void 0}),O?.parent?.setChildIndex(O,O.parent.getChildIndex(O)-.1),g&&f.copyCanvasElementProperty(g,r),g&&tickers$1.transfer(g,r,"move"),x||((n instanceof J||n instanceof Q)&&n.haveEmptyTexture?x=n.positionInfo:x={x:n.x,y:n.y,type:"pixel"}),(n instanceof J||n instanceof Q)&&n.haveEmptyTexture&&await n.load(),d){case "up":n.y=f.height+n.height;break;case "down":n.y=-n.height;break;case "left":n.x=f.width+n.width;break;case "right":n.x=-n.width;break}let k=tickers$1.pause({canvasAlias:r});if(m.push(...k),g)if(h){let V=_(g,{...P,direction:d,motionBlur:T,completeOnContinue:u});V&&I.push(...V);}else C.push(g);let D=f.animate(r,t(x),{...P,tickerIdToResume:m,aliasToRemoveAfter:C,completeOnContinue:u},c);D&&I.push(D);let $=lt(r,n,d,T,{...P,completeOnContinue:u},c);if($&&I.push($),I.length>0)return I}Ai.pushIn=K;function _(r,n={direction:"right"},o){return _e(r,n,o)}Ai.pushOut=_;async function B(r,n,o={},c){let{angle:d,direction:u="right",invert:m=false,duration:C,delay:h,ease:T,completeOnContinue:P=true,animateOldComponentOut:I=true}=o,{aliasToRemoveAfter:x=[]}=o;n||(n=r),typeof x=="string"&&(x=[x]);let{component:g,oldComponentAlias:O}=s(r,n,"wipe"),k=a$1(O,I,x,V=>W(V,{...p(o),angle:(d??R(u))+180},c));(g instanceof J||g instanceof Q)&&g.haveEmptyTexture&&await g.load();let D={kind:"wipe",angle:d??R(u),invert:m,bounds:Me(g)},$=S(r,{config:D,from:0,to:1,duration:C,delay:h,ease:T,completeOnContinue:P,aliasToRemoveAfter:x},c);return y($,k)}Ai.wipeIn=B;function W(r,n={},o){let{angle:c,direction:d="right",invert:u=false,duration:m,delay:C,ease:h,completeOnContinue:T=true}=n,{aliasToRemoveAfter:P=[]}=n;typeof P=="string"&&(P=[P]),P.push(r);let I=f.find(r);if(!I){e$1.warn(`The canvas component "${r}" is not found.`);return}let x={kind:"wipe",angle:c??R(d),invert:u,bounds:Me(I)},g=S(r,{config:x,from:1,to:0,duration:m,delay:C,ease:h,completeOnContinue:T,aliasToRemoveAfter:P},o);if(g)return [g]}Ai.wipeOut=W;async function G(r,n,o={},c){let{origin:d={},aspect:u=1,invert:m=false,duration:C,delay:h,ease:T,completeOnContinue:P=true,animateOldComponentOut:I=true,direction:x="expand"}=o,{aliasToRemoveAfter:g=[]}=o;n||(n=r),typeof g=="string"&&(g=[g]);let{component:O,oldComponentAlias:k}=s(r,n,"iris"),D=a$1(k,I,g,se=>j(se,{...p(o),direction:x==="contract"?"expand":"contract"},c));(O instanceof J||O instanceof Q)&&O.haveEmptyTexture&&await O.load();let $={kind:"iris",outside:x==="contract",originX:d.x??.5,originY:d.y??.5,aspect:u,invert:m,bounds:Me(O)},V=S(r,{config:$,from:x==="contract"?1:0,to:x==="contract"?0:1,duration:C,delay:h,ease:T,completeOnContinue:P,aliasToRemoveAfter:g},c);return y(V,D)}Ai.irisIn=G;function j(r,n={},o){let{origin:c={},aspect:d=1,invert:u=false,duration:m,delay:C,ease:h,completeOnContinue:T=true,direction:P="expand"}=n,{aliasToRemoveAfter:I=[]}=n;typeof I=="string"&&(I=[I]),I.push(r);let x=f.find(r);if(!x){e$1.warn(`The canvas component "${r}" is not found.`);return}let g={kind:"iris",outside:P==="contract",originX:c.x??.5,originY:c.y??.5,aspect:d,invert:u,bounds:Me(x)},O=S(r,{config:g,from:P==="contract"?0:1,to:P==="contract"?1:0,duration:m,delay:C,ease:h,completeOnContinue:T,aliasToRemoveAfter:I},o);if(O)return [O]}Ai.irisOut=j;async function H(r,n,o={},c){let{orientation:d="vertical",direction:u="inward",origin:m=.5,invert:C=false,duration:h,delay:T,ease:P,completeOnContinue:I=true,animateOldComponentOut:x=true}=o,{aliasToRemoveAfter:g=[]}=o;n||(n=r),typeof g=="string"&&(g=[g]);let{component:O,oldComponentAlias:k}=s(r,n,"split"),D=a$1(k,x,g,se=>F(se,{...p(o),direction:u==="inward"?"outward":"inward"},c));(O instanceof J||O instanceof Q)&&O.haveEmptyTexture&&await O.load();let $={kind:"split",orientation:d,direction:u,origin:m,invert:C,bounds:Me(O)},V=S(r,{config:$,from:0,to:1,duration:h,delay:T,ease:P,completeOnContinue:I,aliasToRemoveAfter:g},c);return y(V,D)}Ai.splitIn=H;function F(r,n={},o){let{orientation:c="vertical",direction:d="inward",origin:u=.5,invert:m=false,duration:C,delay:h,ease:T,completeOnContinue:P=true}=n,{aliasToRemoveAfter:I=[]}=n;typeof I=="string"&&(I=[I]),I.push(r);let x=f.find(r);if(!x){e$1.warn(`The canvas component "${r}" is not found.`);return}let g={kind:"split",orientation:c,direction:d,origin:u,invert:m,bounds:Me(x)},O=S(r,{config:g,from:1,to:0,duration:C,delay:h,ease:T,completeOnContinue:P,aliasToRemoveAfter:I},o);if(O)return [O]}Ai.splitOut=F;async function X(r,n,o={},c){let{strength:d=32,quality:u=4,duration:m,delay:C,ease:h,completeOnContinue:T=true,fadeComponent:P=true,animateOldComponentOut:I=true}=o,{aliasToRemoveAfter:x=[]}=o;n||(n=r),typeof x=="string"&&(x=[x]);let{component:g,oldComponentAlias:O}=s(r,n,"blur"),k=a$1(O,I,x,se=>Y(se,p(o),c));(g instanceof J||g instanceof Q)&&g.haveEmptyTexture&&await g.load();let D=m??1;P&&l(r,g,"in",D,c);let $=new filters.BlurFilter({strength:d,quality:u}),V=ee(r,g,$,{strength:[d,0]},{duration:D,delay:C,ease:h,completeOnContinue:T,aliasToRemoveAfter:x},c);return y(V,k)}Ai.blurIn=X;function Y(r,n={},o){let{strength:c=32,quality:d=4,duration:u,delay:m,ease:C,completeOnContinue:h=true,fadeComponent:T=true}=n,{aliasToRemoveAfter:P=[]}=n;typeof P=="string"&&(P=[P]),P.push(r);let I=f.find(r);if(!I){e$1.warn(`The canvas component "${r}" is not found.`);return}let x=u??1;T&&l(r,I,"out",x,o);let g=new filters.BlurFilter({strength:0,quality:d}),O=ee(r,I,g,{strength:[0,c]},{duration:x,delay:m,ease:C,completeOnContinue:h,aliasToRemoveAfter:P},o);if(O)return [O]}Ai.blurOut=Y;async function L(r,n,o={},c){let{pixelSize:d=32,direction:u="up-left",duration:m,delay:C,ease:h,completeOnContinue:T=true,fadeComponent:P=false,animateOldComponentOut:I=true}=o,{aliasToRemoveAfter:x=[]}=o;n||(n=r),typeof x=="string"&&(x=[x]);let{component:g,oldComponentAlias:O}=s(r,n,"pixelate"),k=a$1(O,I,x,Ke=>N(Ke,p(o),c));(g instanceof J||g instanceof Q)&&g.haveEmptyTexture&&await g.load();let D=m??1;P&&l(r,g,"in",D,c);let $=ne(d,u,"in"),V=new filters.PixelateFilter([$.sizeX[0],$.sizeY[0]]),se=ee(r,g,V,$,{duration:D,delay:C,ease:h,completeOnContinue:T,aliasToRemoveAfter:x},c);return y(se,k)}Ai.pixelateIn=L;function N(r,n={},o){let{pixelSize:c=32,direction:d="up-left",duration:u,delay:m,ease:C,completeOnContinue:h=true,fadeComponent:T=false}=n,{aliasToRemoveAfter:P=[]}=n;typeof P=="string"&&(P=[P]),P.push(r);let I=f.find(r);if(!I){e$1.warn(`The canvas component "${r}" is not found.`);return}let x=u??1;T&&l(r,I,"out",x,o);let g=ne(c,d,"out"),O=new filters.PixelateFilter([g.sizeX[0],g.sizeY[0]]),k=ee(r,I,O,g,{duration:x,delay:m,ease:C,completeOnContinue:h,aliasToRemoveAfter:P},o);if(k)return [k]}Ai.pixelateOut=N;function ne(r,n,o){let c=o==="in"?1:-1,d=(n.endsWith("left")?1:-1)*c,u=(n.startsWith("up")?1:-1)*c,m=Math.max(1,Math.abs(r)),C=o==="in"?[m,1]:[1,m];return {sizeX:C.map(h=>h*d),sizeY:C.map(h=>h*u)}}async function Z(r,n,o={},c){let{color:d=16777215,maxAlpha:u=1,duration:m=.3,holdDuration:C=0,pulses:h=1,completeOnContinue:T=true,fadeComponent:P=true,...I}=o;n||(n=r);let x=f.find(r);if(x)return xe(r,x,n,{color:d,maxAlpha:u,fadeDuration:m,holdDuration:C,pulses:h,completeOnContinue:T,rest:I,priority:c});let{component:g}=s(r,n,"flash");(g instanceof J||g instanceof Q)&&g.haveEmptyTexture&&await g.load(),P&&l(r,g,"in",m,c);let O=[],k=fe(g,{color:d,maxAlpha:u,fadeDuration:m,holdDuration:C,pulses:h,completeOnContinue:T,aliasToRemoveAfter:[],rest:I,priority:c});if(k&&O.push(k),O.length>0)return O}Ai.flashIn=Z;function re(r,n={},o){let{color:c=16777215,maxAlpha:d=1,duration:u=.3,holdDuration:m=0,pulses:C=1,completeOnContinue:h=true,fadeComponent:T=true,...P}=n,I=f.find(r);if(!I){e$1.warn(`The canvas component "${r}" is not found.`);return}if(T){let{total:g}=v(d,u,m,C);l(r,I,"out",g,o);}let x=fe(I,{color:c,maxAlpha:d,fadeDuration:u,holdDuration:m,pulses:C,completeOnContinue:h,aliasToRemoveAfter:[r],rest:P,priority:o});if(x)return [x]}Ai.flashOut=re;function fe(r,n){let{values:o,times:c,total:d}=v(n.maxAlpha,n.fadeDuration,n.holdDuration,n.pulses,n.endAtPeak??false),u=new filters.ColorOverlayFilter({color:n.color,alpha:0});return ee(r.label,r,u,{alpha:o},{duration:d,times:c,delay:n.rest.delay,ease:n.rest.ease,aliasToRemoveAfter:n.aliasToRemoveAfter,completeOnContinue:n.completeOnContinue},n.priority)}async function xe(r,n,o,c){let{component:d,oldComponentAlias:u}=s(r,o,"flash");if(!u)return;let m=d.alpha,C=n.alpha;d.alpha=0,(d instanceof J||d instanceof Q)&&d.haveEmptyTexture&&await d.load();let{values:h,times:T,total:P}=v(c.maxAlpha,c.fadeDuration,c.holdDuration,c.pulses,true),I=P+c.fadeDuration,x=P/I,g={duration:I,delay:c.rest.delay,ease:c.rest.ease,completeOnContinue:c.completeOnContinue},O=ee(u,n,new filters.ColorOverlayFilter({color:c.color,alpha:0}),{alpha:[...h,c.maxAlpha]},{...g,times:[...T.map(se=>se*x),1],aliasToRemoveAfter:[u]},c.priority),k=ee(r,d,new filters.ColorOverlayFilter({color:c.color,alpha:c.maxAlpha}),{alpha:[c.maxAlpha,c.maxAlpha,0]},{...g,times:[0,x,1],aliasToRemoveAfter:c.rest.aliasToRemoveAfter},c.priority),D={duration:I,delay:c.rest.delay,times:[0,x,x,1],ease:"linear"},$=f.animate(u,{alpha:[C,C,0,0]},D,c.priority),V=f.animate(r,{alpha:[0,0,m,m]},D,c.priority);return c.completeOnContinue&&($&&tickers$1.completeOnStepEnd({id:$}),V&&tickers$1.completeOnStepEnd({id:V})),je([O,k,$,V])}function lt(r,n,o,c,d,u){if(!c)return;let m=c===true?40:c,C=o==="up"||o==="down"?"velocityY":"velocityX",h=o==="up"||o==="left"?-1:1,T=new filters.MotionBlurFilter({velocity:{x:0,y:0},kernelSize:15});return ee(r,n,T,{[C]:[0,h*m,0]},{duration:d.duration??.3,delay:d.delay,ease:d.ease,completeOnContinue:d.completeOnContinue,autoplay:d.autoplay},u)}function je(r){let n=r.filter(o=>!!o);return n.length>0?n:void 0}async function Te(r,n,o,c,d,u,m,C,h=false){let{duration:T,delay:P,ease:I,completeOnContinue:x=true,fadeComponent:g=d,animateOldComponentOut:O=true}=c,{aliasToRemoveAfter:k=[]}=c;typeof k=="string"&&(k=[k]);let{component:D,oldComponentAlias:$}=s(r,n??r,o),V=h&&!!$&&O,se=D.alpha;V&&(D.alpha=0);let Ke=()=>a$1($,O,k,C),pt=V?[]:Ke();(D instanceof J||D instanceof Q)&&D.haveEmptyTexture&&await D.load(),V&&pt.push(...Ke());let We=T??1,Ft=h&&pt.length>0?typeof P=="function"?(cn,dn)=>P(cn,dn)+We:(P??0)+We:P,qe;return V?(qe=f.animate(r,{alpha:[0,se]},{duration:g?We/4:0,delay:Ft},u),qe&&x&&tickers$1.completeOnStepEnd({id:qe})):g&&l(r,D,"in",We,u),je([...m(D,{duration:We,delay:Ft,ease:I,completeOnContinue:x},k),...pt,qe])}function Ce(r,n,o,c,d){let{duration:u,delay:m,ease:C,completeOnContinue:h=true,fadeComponent:T=o}=n,{aliasToRemoveAfter:P=[]}=n;typeof P=="string"&&(P=[P]),P.push(r);let I=f.find(r);if(!I){e$1.warn(`The canvas component "${r}" is not found.`);return}let x=u??1;return T&&l(r,I,"out",x,c,m),je(d(I,{duration:x,delay:m,ease:C,completeOnContinue:h},P))}function St(r){let{width:n,height:o}=r.getBounds();return Math.hypot(n,o)/2}function Ne(r){return {x:r?.x??.5,y:r?.y??.5}}function Et(r,n,o,c,d,u,m){let{strength:C=40,bursts:h=3,slices:T=8,rgbSplit:P=6}=c,I=k=>{let D=a(k,.5,h);return o==="in"?D:D.reverse()},x={...d,ease:d.ease??"linear"},g=new filters.GlitchFilter({slices:T,offset:0});g.refresh(),g.padding=Math.ceil(Math.abs(C));let O=[ee(r,n,g,{offset:I(C)},{...x,aliasToRemoveAfter:u},m)];if(P!==0){let k=I(P),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(P)),O.push(ee(r,n,D,{redX:k,blueX:k.map($=>-$)},x,m));}return O}async function xi(r,n,o={},c){return Te(r,n,"glitch",o,true,c,(d,u,m)=>Et(r,d,"in",o,u,m,c),d=>nn(d,p(o),c),true)}Ai.glitchIn=xi;function nn(r,n={},o){return Ce(r,n,true,o,(c,d,u)=>Et(r,c,"out",n,d,u,o))}Ai.glitchOut=nn;function Mt(r,n,o,c,d,u,m){let{angle:C=540,radius:h=St(n),origin:T}=c,P=Ne(T),I=C*Math.PI/180,x=o==="in"?[I,0]:[0,I],g=new filters.TwistFilter({radius:h,angle:x[0],offset:{x:0,y:0}}),{width:O,height:k}=n.getBounds();return g.padding=Math.max(g.padding,c$1({x:P.x*O,y:P.y*k},h,O,k)),[ee(r,n,g,{angle:x},{...d,aliasToRemoveAfter:u},m,()=>{let{x:$,y:V}=Ie(n,P);g.offsetX=$,g.offsetY=V;})]}async function Pi(r,n,o={},c){return Te(r,n,"twist",o,true,c,(d,u,m)=>Mt(r,d,"in",o,u,m,c),d=>rn(d,{...p(o),angle:-(o.angle??540)},c))}Ai.twistIn=Pi;function rn(r,n={},o){return Ce(r,n,true,o,(c,d,u)=>Mt(r,c,"out",n,d,u,o))}Ai.twistOut=rn;function _t(r,n,o,c,d,u,m){let{strength:C=.6,origin:h}=c,T=Ne(h),P=o==="in"?[C,0]:[0,C],I=new filters.ZoomBlurFilter({center:{x:0,y:0},strength:P[0]}),{width:x,height:g}=n.getBounds();return I.padding=d$2({x:T.x*x,y:T.y*g},C,x,g),[ee(r,n,I,{strength:P},{...d,aliasToRemoveAfter:u},m,()=>{let{x:k,y:D}=Ie(n,T);I.center={x:k,y:D};})]}async function vi(r,n,o={},c){return Te(r,n,"warp",o,true,c,(d,u,m)=>_t(r,d,"in",o,u,m,c),d=>sn(d,p(o),c),true)}Ai.warpIn=vi;function sn(r,n={},o){return Ce(r,n,true,o,(c,d,u)=>_t(r,c,"out",n,d,u,o))}Ai.warpOut=sn;function Rt(r,n,o,c,d,u){let{origin:m,amplitude:C=30,wavelength:h=160,speed:T=500}=o,P=Ne(m),{width:I,height:x}=n.getBounds(),g=new filters.ShockwaveFilter({center:{x:0,y:0},amplitude:C,wavelength:h,speed:T,time:0});g.padding=Math.ceil(Math.abs(C)*1.25);let O=e$2({x:P.x*I,y:P.y*x},{width:I,height:x},h,-1)/T;return [ee(r,n,g,{time:[0,O]},{...c,aliasToRemoveAfter:d},u,()=>{let{x:D,y:$}=Ie(n,P);g.center={x:D,y:$};})]}async function Ii(r,n,o={},c){return Te(r,n,"ripple",o,true,c,(d,u,m)=>Rt(r,d,o,u,m,c),d=>b(d,{duration:o.duration,delay:o.delay,ease:o.ease,completeOnContinue:o.completeOnContinue},c))}Ai.rippleIn=Ii;function Ti(r,n={},o){return Ce(r,n,true,o,(c,d,u)=>Rt(r,c,n,d,u,o))}Ai.rippleOut=Ti;function kt(r,n,o,c,d,u,m){let{edge:C="hard",noiseScale:h=8,seed:T=Math.random()*1e3}=c,[P,I]=C==="hard"?[.25,.75]:[0,1],x=o==="in"?[P,I]:[I,P],g=new filters.SimplexNoiseFilter({strength:x[0],noiseScale:h,offsetZ:T,step:C==="hard"?.5:0});return [ee(r,n,g,{strength:x},{...d,aliasToRemoveAfter:u},m)]}async function Ci(r,n,o={},c){return Te(r,n,"noise",o,false,c,(d,u,m)=>kt(r,d,"in",o,u,m,c),d=>on(d,p(o),c))}Ai.noiseDissolveIn=Ci;function on(r,n={},o){return Ce(r,n,false,o,(c,d,u)=>kt(r,c,"out",n,d,u,o))}Ai.noiseDissolveOut=on;function Bt(r,n,o,c,d,u,m){let{lineThickness:C=.02,brightness:h=3,scanlines:T=true}=c,P=n.scale.x,I=n.scale.y,x=I*C,g=o==="in"?[0,.45,1]:[0,.55,1],O=o==="in"?[0,P,P]:[P,P,0],k=o==="in"?[x,x,I]:[I,x,x],D=o==="in"?[h,h,1]:[1,h,h];o==="in"&&n.scale.set(0,x);let $=[f.animate(r,{scaleX:O,scaleY:k},{duration:d.duration,delay:d.delay,ease:d.ease,times:g,completeOnContinue:d.completeOnContinue,aliasToRemoveAfter:u},m),ee(r,n,new filters.AdjustmentFilter({brightness:D[0]}),{brightness:D},{...d,times:g},m)];if(T){let V=o==="in"?[.5,.5,0]:[0,.5,.5];$.push(ee(r,n,new filters.CRTFilter({curvature:0,vignettingAlpha:0,lineWidth:3,lineContrast:V[0],noise:V[0]}),{lineContrast:V,noise:V},{...d,times:g},m));}return $}async function bi(r,n,o={},c){return Te(r,n,"tv",o,false,c,(d,u,m)=>Bt(r,d,"in",o,u,m,c),d=>an(d,p(o),c),true)}Ai.tvIn=bi;function an(r,n={},o){return Ce(r,n,false,o,(c,d,u)=>Bt(r,c,"out",n,d,u,o))}Ai.tvOut=an;function Dt(r,n,o,c,d,u,m){let{strength:C=1,mode:h="pinch",radius:T=St(n),origin:P}=c,I=(h==="bulge"?1:-1)*C,x=Ne(P),g=o==="in"?[I,0]:[0,I],O=new filters.BulgePinchFilter({center:x,radius:T,strength:g[0]});if(h==="bulge"){let{width:D,height:$}=n.getBounds();O.padding=c$1({x:x.x*D,y:x.y*$},T,D,$);}return [ee(r,n,O,{strength:g},{...d,aliasToRemoveAfter:u},m,()=>{let{x:D,y:$,area:V}=Ie(n,x);O.center={x:D/V.width,y:$/V.height};})]}async function Oi(r,n,o={},c){return Te(r,n,"pinch",o,true,c,(d,u,m)=>Dt(r,d,"in",o,u,m,c),d=>b(d,{duration:o.duration,delay:o.delay,ease:o.ease,completeOnContinue:o.completeOnContinue},c))}Ai.pinchIn=Oi;function wi(r,n={},o){return Ce(r,n,true,o,(c,d,u)=>Dt(r,c,"out",n,d,u,o))}Ai.pinchOut=wi;})(pe||={});var Ve=class extends Pe{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 pi(){return async(e,i)=>{try{let s=e.canvasElementInfo;if(s){let a=new Ve(s),p=s.zIndex;a.groupColor=16711680;let y=new we.Graphics;y.rect(0,0,300,100).fill({color:16711680,alpha:.5}),a.addChild(y);let R=new we.Text({text:`Error: ${s.label}`,x:10,y:10});a.addChild(R);let S=e.parent;if(S&&"addChild"in S)p!==void 0?S.addChildAt(a,p):S.addChild(a);else {let l=s.parentLabel?f.find(s.parentLabel):void 0;if(l)p!==void 0?l.addChildAt(a,p):l.addChild(a);else {let v=s.label??s.pixivnId;f.add(v,a,{zIndex:p});}}}}catch{}}}function hi(t,e,i){let s={...f.find(t)?.memory,...i},a=new Ee({text:e,...i});return s&&f.copyCanvasElementProperty(s,a),f.add(t,a,{ignoreOldStyle:true,zIndex:i?.zIndex}),a}var {Assets:So,Color:Eo,Rectangle:Mo,TextStyle:_o,Texture:Ro,UPDATE_PRIORITY:ko}=we,f=new Xe;ae.init({getScreen:()=>f.screen});GameUnifier.addOnPreContinue(async()=>{try{let{tikersIds:t,stepAlias:e}=drainCompleteOnStepEndQueue(),i=(async()=>{for(;t.length;){let{id:a}=t.pop()||{};a&&await tickers$1.forceCompletion(a);}})(),s=(async()=>{for(;e.length;){let{alias:a,id:p}=e.pop()||{};a&&p&&await tickers$1.forceCompletion(p,a);}})();await Promise.all([i,s]);}catch{}});
1
+ import'./chunk-JMOSOAGB.mjs';import {a,e as e$2,d as d$2,b as b$1,c as c$1}from'./chunk-XLRCR56W.mjs';import {e,d as d$1,g,b,c,f as f$1,a as a$1}from'./chunk-HD353M4B.mjs';import {a as a$2}from'./chunk-A5FN4SNI.mjs';import {d,e as e$1}from'./chunk-B46NFIFC.mjs';import {GameUnifier,PixiError}from'@drincs/pixi-vn/core';import we,{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 un={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}}}]}},Yt=un;function zt(t,e){let i=0;return async(...s)=>{let a=Date.now();if(a-i>=e)return i=a,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$1);return e||(e=new we.Container,e.label=a$1,t.app.stage.addChild(e)),e}static htmlLayers=[];static canvasWidth=300;static canvasHeight=300;static _isInitialized=false;static async init(e,i,s){let{id:a="pixi-vn-canvas",width:p=800,height:y=600,resolution:R=1,autoDensity:S=true,resizeMode:l="contain",...v}=i||{};return t.canvasWidth=p,t.canvasHeight=y,t._app=new we.Application,t.app.init({width:p,height:y,resolution:R,autoDensity:S,...v}).then(()=>{let{app:A=t.app,extensions:b=[],...U}=s||{};if(initDevtools({app:A,extensions:[Yt,...b],...U}),t._isInitialized=true,t.addCanvasIntoHTMLElement(e,a),l==="contain"){let z=zt(async()=>{requestAnimationFrame(()=>t.resize());},10);new ResizeObserver(z).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):e$1.error("GameWindowManager is not initialized");}static addHtmlLayer(e,i,s={}){let{position:a="absolute",pointerEvents:p="none",userSelect:y="none"}=s,R=document.createElement("div");R.setAttribute("id",e),R.style.position=a,R.style.pointerEvents=p,R.style.userSelect=y;let S=i.appendChild(R);return t.htmlLayers.push(R),t.resize(),S}static removeHtmlLayer(e){let i=t.htmlLayers.find(s=>s.id===e);i&&(i.remove(),t.htmlLayers=t.htmlLayers.filter(s=>s.id!==e));}static getHtmlLayer(e){return t.htmlLayers.find(i=>i.id===e)}static async resize(){let e=t.canvasWidth,i=t.canvasHeight,s=t.app.resizeTo,a=t.app.canvas.style;s instanceof HTMLElement||(s=document.documentElement);let p,y;if(s===document.body||s===document.documentElement)p=document.documentElement.clientWidth||window.innerWidth,y=document.documentElement.clientHeight||window.innerHeight;else {let b=s.getBoundingClientRect();p=b.width||s.clientWidth,y=b.height||s.clientHeight;}let R=Math.min(p/e,y/i),S=Math.floor(R*e),l=Math.floor(R*i);a.width=`${S}px`,a.height=`${l}px`;let v=(p-S)/2,A=(y-l)/2;a.marginLeft=`${v}px`,a.marginRight=`${v}px`,a.marginTop=`${A}px`,a.marginBottom=`${A}px`,t.htmlLayers.forEach(b=>{b.style.width=`${S}px`,b.style.height=`${l}px`,b.style.marginLeft=`${v}px`,b.style.marginRight=`${v}px`,b.style.marginTop=`${A}px`,b.style.marginBottom=`${A}px`;});}static get childrenAliasesOrder(){return t.gameLayer.children.filter(e=>e.label).sort((e,i)=>t.gameLayer.getChildIndex(e)-t.gameLayer.getChildIndex(i)).map(e=>e.label)}};var gt=Symbol("SerializableEvent"),Ye=new d({cacheSize:5});function pn(t){return (e,i,s)=>{let a=s.value;mt.add(a,t||`${i}`);}}var mt;(p=>{function t(y,R){y[gt]=R,Ye.get(R)&&e$1.info(`Event "${R}" already exists, it will be overwritten`),Ye.set(R,y);}p.add=t;function e(y){try{let R=Ye.get(y);if(!R){e$1.error(`Event "${y}" not found, did you forget to register it with the eventDecorator?`);return}return R}catch(R){e$1.error(`Error while getting Event "${y}"`,R);return}}p.get=e;function i(){return Array.from(Ye.values())}p.values=i;function s(y){return Ye.has(y)}p.has=s;function a(){return Array.from(Ye.keys())}p.keys=a;})(mt||={});var yt=mt;async function Wt(t,e){if("onEvents"in e)for(let i in e.onEvents){let s=e.onEvents[i],a=yt.get(s);a&&t.on(i,a);}}function Ut(t){let{onEventsHandlers:e={}}=t;return e}function Oe(t,e,i){let s=i[gt];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 ze=new d({cacheSize:5}),Xt=new d({cacheSize:2}),$t=new d({cacheSize:2});function gn(t={}){return e=>{xt.add(e,t);}}async function le(t,e,i){let s=i?.ignoreScale||false,a=i?.end;if("isRenderGroup"in e&&e.isRenderGroup!==void 0&&(t.isRenderGroup=e.isRenderGroup),"blendMode"in e&&e.blendMode!==void 0&&(t.blendMode=e.blendMode),"tint"in e&&e.tint!==void 0&&(t.tint=e.tint),"alpha"in e&&e.alpha!==void 0&&(t.alpha=e.alpha),"angle"in e&&e.angle!==void 0&&(t.angle=e.angle),"renderable"in e&&e.renderable!==void 0&&(t.renderable=e.renderable),"rotation"in e&&e.rotation!==void 0&&(t.rotation=e.rotation),!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),Wt(t,e),"pixivnFilters"in e&&e.pixivnFilters!==void 0){let p=e.pixivnFilters.map(y=>RegisteredFilters.getInstance(y.filterId,y.args,y.padding)).filter(y=>!!y);t.filters=p.length>0?p: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),a&&await a(),s||("width"in e&&e.width!==void 0&&(t.width=e.width),"height"in e&&e.height!==void 0&&(t.height=e.height));}var xt;(R=>{function t(S,l={}){let{name:v=S.name,getInstance:A=async(U,z)=>{let te=new U;return await te.setMemory(z),te},copyProperty:b=async(U,z)=>{await U.setMemory(z);}}=l;ze.get(v)&&e$1.warn(`CanvasElement "${v}" already registered`),S.prototype.pixivnId=v,ze.set(v,S),Xt.set(v,A),$t.set(v,b);}R.add=t;function e(S){let l=ze.get(S);if(!l){e$1.error(`CanvasElement "${S}" not found, did you forget to register it with the canvasComponentDecorator?`);return}return l}R.get=e;async function i(S,l){let v=e(S),A=Xt.get(S);if(!v||!A){e$1.error(`CanvasElement "${S}" not found, did you forget to register it with the canvasComponentDecorator?`);return}try{return await A(v,l)}catch(b){e$1.error(`Error while getting CanvasElement instance "${S}"`,b);}}R.getInstance=i;async function s(S,l,v){let A=$t.get(S);if(!A){e$1.error(`CanvasElement "${S}" not found, did you forget to register it with the canvasComponentDecorator?`);return}try{await A(l,v);}catch(b){e$1.error(`Error while copying properties of CanvasElement "${S}"`,b);}}R.copyProperty=s;function a(){return Array.from(ze.values())}R.values=a;function p(S){return ze.has(S)}R.has=p;function y(){return Array.from(ze.keys())}R.keys=y;})(xt||={});var de=xt;async function et(t){let e=await de.getInstance(t.pixivnId,t);if(!e)throw new PixiError("unregistered_element",`The element ${t.pixivnId} could not be created`,"canvas",t);return e}function vt(t){return "memory"in t?t.memory:t instanceof we.Text?Tt(t):t instanceof we.Sprite?It(t):Ae(t)}function xn(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:Pn(t.filters)}}function Pn(t){if(!t)return;let e=Array.isArray(t)?t:[t],i=[];for(let s of e){let a=s.pixivnFilterId;if(!a){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 p=RegisteredFilters.toMemory(a,s);p&&i.push(p);}return i}function Pt(t,e){return {url:t.source.label,alias:e===t.source.label?void 0:e}}function Ae(t,e){let i=vn(t,b),a=e?.childrenExport||false?t.children.sort((p,y)=>t.getChildIndex(p)-t.getChildIndex(y)).map(p=>vt(p)):[];return {pixivnId:i,elements:a,onEvents:Ut(t),...xn(t)}}function It(t){let e$1=Ae(t),i=e$1.pixivnId??e,s="assetsAliases"in t&&Array.isArray(t.assetsAliases)?Pt(t.texture,t.assetsAliases[0]):"textureAlias"in t?Pt(t.texture,t.textureAlias):Pt(t.texture);return {...e$1,pixivnId:i,textureData:s,anchor:{x:t.anchor.x,y:t.anchor.y},roundPixels:t.roundPixels}}function Tt(t){let e=Ae(t),i=e.pixivnId??f$1;return {...e,pixivnId:i,anchor:{x:t.anchor.x,y:t.anchor.y},text:t.text,resolution:t.resolution,style:bn(t.style),roundPixels:t.roundPixels}}function vn(t,e){return Object.hasOwn(t,"pixivnId")?t.pixivnId:e}function tt(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 In(t){if(t!=null){{if(typeof t=="number")return t;if(typeof t=="string"||Array.isArray(t))return t;if(t instanceof we.FillGradient)return tt(t);if(typeof t=="object"&&"fill"in t&&typeof t.fill!="function"&&t.fill){if(!(t.fill instanceof we.FillPattern))return tt(t.fill)}}e$1.warn("Unsupported property type for Text.style.fill.",t);}}function Tn(t){if(typeof t=="number")return t;if(typeof t=="string")return t;if(Array.isArray(t))return t;if(t instanceof we.Color)return t.toNumber();e$1.warn("Unsupported color type.",t);}function Cn(t){if(t!=null){{if(typeof t=="number")return t;if(typeof t=="string"||Array.isArray(t))return t;if(t instanceof we.FillGradient)return tt(t);if(typeof t=="object"&&"alignment"in t)return {alignment:t.alignment,alpha:t.alpha,color:Tn(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 we.FillPattern))return tt(t.fill)}}e$1.warn("Unsupported property type for Text.style.stroke.",t);}}function bn(t){return {align:t.align,breakWords:t.breakWords,dropShadow:t.dropShadow,fill:In(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:Cn(t.stroke),textBaseline:t.textBaseline,trim:t.trim,whiteSpace:t.whiteSpace,wordWrap:t.wordWrap,wordWrapWidth:t.wordWrapWidth}}var Xe=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,i,s){return await ie.init(e,i,s)}get children(){return ie.gameLayer.children}async copyCanvasElementProperty(e,i,s={}){let a=["isRenderGroup","scale","visible","boundsArea","text","resolution","style","height","width"],{ignoreProperties:p=S=>S}=s;if(typeof i=="string"){let S=this.find(i);if(S)i=S;else {e$1.error(`Canvas element ${i} not found`);return}}if(typeof e=="string"){let S=this.find(e);if(S)e=S;else {e$1.error(`Canvas element ${e} not found`);return}}e instanceof we.Container&&(e=e.memory);let y=p(a),R={...e};y.forEach(S=>{S in R&&delete R[S];}),await de.copyProperty(i.pixivnId,i,R);}add(e,i,s={}){if(e===a$1){e$1.error(`The alias ${a$1} is reserved`);return}let a=this.find(e),p=s?.ignoreOldStyle;a&&!p&&this.copyCanvasElementProperty(a,i);let{zIndex:y=a?.parent?.getChildIndex(a)}=s;a&&!this.canvasElementIsOnCanvas(a)?e$1.error(`The canvas element ${e} exist in the memory but it is not on the canvas, so the zIndex is not set`):a&&this.remove(e,{ignoreTickers:true}),y!==void 0?(i.label=e,this.gameLayer.addChildAt(i,y)):(i.label=e,this.gameLayer.addChild(i));}remove(e,i={}){if(e===a$1){e$1.error(`The alias ${a$1} is reserved`);return}let s=i.ignoreTickers;typeof e=="string"&&(e=[e]),e.forEach(a=>{this.gameLayer.getChildrenByLabel(a).forEach(p=>{this.gameLayer.removeChild(p),!s&&tickers$1.unlinkComponent(a);});});}find(e){if(e===a$1)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,s={}){let a=this.find(e);a&&(a.label=i),!s.ignoreTickers&&tickers$1.transfer(e,i,"move");}get currentTickers(){return this.tickers.currentTickers}get currentTickersSteps(){return this.tickers.currentTickersSteps}findTicker(e){return tickers$1.find(e)}addTicker(e,i){return tickers$1.add(e,i)}addTickersSequence(e,i,s=0){return tickers$1.addSequence(e,i,s)}onTickerComplete(e,i){return tickers$1.onComplete(e,i)}unlinkComponentFromTicker(e,i){return tickers$1.unlinkComponent(e,i)}removeAllTickers(){return tickers$1.removeAll()}removeTicker(e,i={stopTicker:true}){return removeTicker(e,i)}pauseTicker(e){return tickers$1.pause(e)}resumeTicker(e){return tickers$1.resume(e)}isTickerPaused(e,i){return tickers$1.isPaused(e,i)}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(i=>TickersManagerStatic._currentTickers.has(i));e.length>0&&tickers$1.resume({id:e}),this.tickersPausedByGameLayerRender=[];}transferTickers(e,i,s="move"){return tickers$1.transfer(e,i,s)}completeTickerOnStepEnd(e){return tickers$1.completeOnStepEnd(e)}async forceCompletionOfTicker(e,i){return tickers$1.forceCompletion(e,i)}tickers=tickers$1;animate(e,i,s,a){return GameUnifier.animate(e,i,s,a)}addLayerInternal(e,i){if(e===a$1){e$1.error(`The alias ${a$1} is reserved`);return}return i.label=e,ie.app.stage.addChild(i)}getLayerInternal(e){return ie.app.stage.getChildByLabel(e)}removeLayerInternal(e){let i=ie.app.stage.getChildByLabel(e);i&&ie.app.stage.removeChild(i);}addHtmlLayerInternal(e,i,s){return ie.addHtmlLayer(e,i,s)}removeHtmlLayerInternal(e){return ie.removeHtmlLayer(e)}getHtmlLayerInternal(e){return ie.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,s){return this.addHtmlLayerInternal(e,i,s)}removeHtmlLayer(e){return this.removeHtmlLayerInternal(e)}getHtmlLayer(e){return this.getHtmlLayerInternal(e)}layers={get gameLayer(){return ie.gameLayer},add:(e,i)=>this.addLayerInternal(e,i),get:e=>this.getLayerInternal(e),remove:e=>this.removeLayerInternal(e)};htmlLayers={add:(e,i,s)=>this.addHtmlLayerInternal(e,i,s),get:e=>this.getHtmlLayerInternal(e),remove:e=>this.removeHtmlLayerInternal(e)};async extractImage(){let e=this.gameLayer.renderable===false;e&&this.resume();let i;try{i=this.app.renderer.extract.image(this.app.stage);}finally{e&&this.pause();}return (await i).src}clear(){this.tickersPausedByGameLayerRender=[],tickers$1.removeAll(),this.removeAll();}export(){let e=this.gameLayer.renderable===false;e&&this.resume();try{let i={};return this.children.forEach(s=>{s.label&&(i[s.label]=vt(s));}),{tickers:a$2(TickersManagerStatic.currentTickersWithoutCreatedBySteps()),tickersSteps:a$2(TickersManagerStatic.currentTickersSequence()),elements:a$2(i),stage:a$2(Ae(this.gameLayer)),elementAliasesOrder:a$2(ie.childrenAliasesOrder),tickersToCompleteOnStepEnd:a$2(TickersManagerStatic._tickersToCompleteOnStepEnd)}}finally{e&&this.pause();}}async restore(e){this.clear();try{if(Object.hasOwn(e,"elements")&&Object.hasOwn(e,"elementAliasesOrder")){let i=e.elementAliasesOrder,s={},a=Object.entries(e.elements).map(async([p,y])=>{s[p]=await et(y);});await Promise.all(a),i.forEach(p=>{let y=s[p];y&&this.add(p,y);});}else {e$1.error("The data does not have the properties elementAliasesOrder and elements");return}if(Object.hasOwn(e,"stage")&&Object.hasOwn(e,"stage")?le(this.gameLayer,e.stage,{ignoreScale:!0}):e$1.error("The data does not have the properties stage"),Object.hasOwn(e,"tickers")){let i=e.tickers;Object.entries(i).forEach(([s,a])=>{let p=a.canvasElementAliases;if(p.length!==0){let y=RegisteredTickers.getInstance(a.id,a.args,{duration:a.duration,priority:a.priority,id:s,canvasElementAliases:p});y?(y.canvasElementAliases=p,tickers$1.add(p,y),a.paused&&y.pause()):e$1.error(`Ticker ${a.id} not found`);}});}if(Object.hasOwn(e,"tickersSteps")){let i=e.tickersSteps;Object.entries(i).forEach(([s,a])=>{TickersManagerStatic._currentTickersSequence.set(s,new Map(Object.entries(a))),Object.keys(a).forEach(p=>{runTickersSequence(s,p);});});}if(Object.hasOwn(e,"tickersToCompleteOnStepEnd")){let i=e.tickersToCompleteOnStepEnd,s=i.tikersIds,a=i.stepAlias.map(p=>({id:p.id,alias:p.alias}));TickersManagerStatic._tickersToCompleteOnStepEnd.tikersIds.length=0,TickersManagerStatic._tickersToCompleteOnStepEnd.tikersIds.push(...s),TickersManagerStatic._tickersToCompleteOnStepEnd.stepAlias.length=0,TickersManagerStatic._tickersToCompleteOnStepEnd.stepAlias.push(...a);}}catch(i){e$1.error("Error importing data",i);}}};var ae=class t{static init(e){t._getScreen=e.getScreen;}static _getScreen;static get screen(){return t._getScreen()}};var w;(S=>{function t(l,v,A,b,U,z=0){return U?l==="width"?v*(ae.screen.width-A)+A-b-z*A:v*(ae.screen.height-A)+A-b-z*A:l==="width"?v*(ae.screen.width-A)+b+z*A:v*(ae.screen.height-A)+b+z*A}S.calculatePositionByAlign=t;function e(l,v,A,b,U,z=0){return U?l==="width"?(v-A+b+z*A)/(ae.screen.width-A):(v-A+b+z*A)/(ae.screen.height-A):l==="width"?(v-b-z*A)/(ae.screen.width-A):(v-b-z*A)/(ae.screen.height-A)}S.calculateAlignByPosition=e;function i(l,v){return l==="width"?v*ae.screen.width:v*ae.screen.height}S.calculatePositionByPercentagePosition=i;function s(l,v){return l==="width"?v/ae.screen.width:v/ae.screen.height}S.calculatePercentagePositionByPosition=s;function a(l,v){if(v=v%360,v<0&&(v+=360),v===0)return {x:l.x,y:l.y};if(v===90)return {x:-l.y,y:l.x};if(v===180)return {x:-l.x,y:-l.y};if(v===270)return {x:l.y,y:-l.x};if(v>0&&v<90){let A=v*Math.PI/180,b=Math.cos(A),U=Math.sin(A),z=l.x*b-l.y*U,te=l.x*U+l.y*b;return l.x!==0&&Math.sign(z)!==Math.sign(l.x)&&(z=-z),l.y!==0&&Math.sign(te)!==Math.sign(l.y)&&(te=-te),{x:z,y:te}}else if(v>90&&v<180){let A=(v-90)*Math.PI/180,b=Math.cos(A),U=Math.sin(A),z=-l.y*U-l.x*b,te=l.y*b-l.x*U;return l.x!==0&&Math.sign(z)!==Math.sign(l.x)&&(z=-z),l.y!==0&&Math.sign(te)!==Math.sign(l.y)&&(te=-te),{x:z,y:te}}else if(v>180&&v<270){let A=(v-180)*Math.PI/180,b=Math.cos(A),U=Math.sin(A),z=-l.x*b+l.y*U,te=-l.x*U-l.y*b;return l.x!==0&&Math.sign(z)!==Math.sign(l.x)&&(z=-z),l.y!==0&&Math.sign(te)!==Math.sign(l.y)&&(te=-te),{x:z,y:te}}else if(v>270&&v<360){let A=(v-270)*Math.PI/180,b=Math.cos(A),U=Math.sin(A),z=l.y*U-l.x*b,te=-l.y*b-l.x*U;return l.x!==0&&Math.sign(z)!==Math.sign(l.x)&&(z=-z),l.y!==0&&Math.sign(te)!==Math.sign(l.y)&&(te=-te),{x:z,y:te}}return {x:0,y:0}}S.getSuperPoint=a;function p(l,v){if(v=v%360,v<0&&(v+=360),v===0)return {x:l.x,y:l.y};if(v===90)return {x:l.y,y:-l.x};if(v===180)return {x:-l.x,y:-l.y};if(v===270)return {x:-l.y,y:l.x};if(v>0&&v<90){let A=v*Math.PI/180,b=Math.cos(A),U=Math.sin(A);return {x:l.x*b+l.y*U,y:-l.x*U+l.y*b}}else if(v>90&&v<180){let A=(v-90)*Math.PI/180,b=Math.cos(A),U=Math.sin(A);return {x:l.y*b-l.x*U,y:-l.y*U-l.x*b}}else if(v>180&&v<270){let A=(v-180)*Math.PI/180,b=Math.cos(A),U=Math.sin(A);return {x:-l.x*b-l.y*U,y:l.x*U-l.y*b}}else if(v>270&&v<360){let A=(v-270)*Math.PI/180,b=Math.cos(A),U=Math.sin(A);return {x:-l.y*b+l.x*U,y:l.y*U+l.x*b}}return {x:0,y:0}}S.getPointBySuperPoint=p;function y(l){let v=l.width,A=l.height,b=l.angle%360;return b<0&&(b+=360),b===0||b===180?v:b===90||b===270?A:Math.abs(v*Math.cos(b*Math.PI/180))+Math.abs(A*Math.sin(b*Math.PI/180))}S.getSuperWidth=y;function R(l){let v=l.width,A=l.height,b=l.angle%360;return b<0&&(b+=360),b===0||b===180?A:b===90||b===270?v:Math.abs(A*Math.cos(b*Math.PI/180))+Math.abs(v*Math.sin(b*Math.PI/180))}S.getSuperHeight=R;})(w||={});async function $e(t){if(t!=="EMPTY"){if(!t)throw e$1.error("Texture not found",t),new PixiError("unregistered_asset","Texture not found");if(we.Assets.cache.has(t)){let e=we.Assets.get(t);if(e)return e}return we.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 we.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 Se=class t extends we.Sprite{constructor(e$1){if(e$1 instanceof we.Texture)super(e$1);else {let{align:i,percentagePosition:s,...a}=ge(e$1)||{};super(a),i&&(this.align=i),s&&(this.percentagePosition=s);}this.pixivnId=this.constructor.prototype.pixivnId||e;}pixivnId=e;get memory(){return {...It(this),pixivnId:this.pixivnId,align:this._align,percentagePosition:this._percentagePosition}}async setMemory(e){return await st(this,e)}static from(e,i){let s=we.Sprite.from(e,i),a=new t;return a.texture=s.texture,a}onEventsHandlers={};on(e,i,s){return Oe(e,this,i),super.on(e,(...a)=>i(...a,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=w.getSuperPoint(this.pivot,this.angle),i=w.getSuperPoint(this.scale,this.angle);return {x:w.calculateAlignByPosition("width",this.x,w.getSuperWidth(this),e.x,i.x<0,this.anchor.x),y:w.calculateAlignByPosition("height",this.y,w.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=w.getSuperPoint(this.pivot,this.angle),i=w.getSuperPoint(this.scale,this.angle);return w.calculateAlignByPosition("width",this.x,w.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=w.getSuperPoint(this.pivot,this.angle),i=w.getSuperPoint(this.scale,this.angle);return w.calculateAlignByPosition("height",this.y,w.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:w.calculatePercentagePositionByPosition("width",this.x),y:w.calculatePercentagePositionByPosition("height",this.y)}}get percentageX(){return w.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 w.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=w.getSuperPoint(this.pivot,this.angle),i=w.getSuperPoint(this.scale,this.angle);this._align.x!==void 0&&(super.x=w.calculatePositionByAlign("width",this._align.x,w.getSuperWidth(this),e.x,i.x<0,this.anchor.x)),this._align.y!==void 0&&(super.y=w.calculatePositionByAlign("height",this._align.y,w.getSuperHeight(this),e.y,i.y<0,this.anchor.y));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=w.calculatePositionByPercentagePosition("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=w.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;}};de.add(Se,{name:e,copyProperty:async(t,e)=>{await st(t,e,{ignoreTexture:true});}});async function st(t,e,i){e=ge(e);let s=i?.ignoreTexture||false;if(await le(t,e),!s){let p;if("textureData"in e&&e.textureData&&(p=e.textureData),p&&p.url!=="EMPTY"){let y=p.url;p.alias&&we.Assets.resolver.hasKey(p.alias)&&(y=p.alias);try{let R=await $e(y);R&&(t.texture=R);}catch(R){e$1.error("Error in Sprite.setMemorySprite() while loading texture"),R=new PixiError("unregistered_asset",`Error loading image ${y}`,"canvas",e),GameUnifier.runOnError(R,{});}}}let a=i?.half;a&&await a(),"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 J=class t extends Se{_textureAlias;get textureAlias(){return this._textureAlias?this._textureAlias:this.texture.source.label}pixivnId=d$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 ot(this,e),this.reloadPosition();}static from(e,i){let s=we.Sprite.from(e,i),a=new t;return a.texture=s.texture,a}_loadIsStarted=false;get loadIsStarted(){return this._loadIsStarted}async load(){return this._loadIsStarted=true,$e(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"}};de.add(J,{name:d$1,copyProperty:async(t,e)=>{await ot(t,e,{ignoreTexture:true});}});async function ot(t,e,i){return await st(t,e,{half:async()=>{"loadIsStarted"in e&&e.loadIsStarted&&await t.load();},ignoreTexture:i?.ignoreTexture})}var ye=class t extends J{constructor(e,i){if(e instanceof we.Texture){super(e,i);return}let{loop:s,paused:a,currentTime:p,...y}=e||{};super(y,i),s&&(this.loop=s),a&&(this.paused=a),p&&(this.currentTime=p);}pixivnId=g;get memory(){return {...super.memory,pixivnId:this.pixivnId,loop:this.loop,paused:this._paused,currentTime:this.currentTime}}async setMemory(e){await Vt(this,e),this.reloadPosition();}static from(e,i){let s=we.Sprite.from(e,i),a=new t;return a.texture=s.texture,a}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}};de.add(ye,{name:g,getInstance:async(t,e)=>{let i;"textureData"in e&&e.textureData&&(i=e.textureData);let s=new t(void 0,i?.alias);return await s.setMemory(e),s},copyProperty:async(t,e)=>{await Vt(t,e,{ignoreTexture:true});}});async function Vt(t,e,i){await ot(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 Pe=class extends Container{constructor(e){let{anchor:i,align:s,percentagePosition:a,...p}=ge(e)||{};super(p),this.pixivnId=this.constructor.prototype.pixivnId||b,i&&(this.anchor=i),s&&(this.align=s),a&&(this.percentagePosition=a);}pixivnId=b;get memory(){return {...Ae(this,{childrenExport:true}),anchor:this._anchor?this.anchor:void 0,align:this._align,percentagePosition:this._percentagePosition}}async setMemory(e){await this.importChildren(e),await le(this,e),this.reloadAnchor(),this.reloadPosition();}async importChildren(e){for(let i=0;i<e.elements.length;i++){let s=e.elements[i],a=await et(s);this.addChild(a);}}onEventsHandlers={};on(e,i,s){return Oe(e,this,i),super.on(e,(...a)=>i(...a,this),s)}_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=w.getSuperPoint(this.pivot,this.angle),i=w.getSuperPoint(this.scale,this.angle);return {x:w.calculateAlignByPosition("width",this.x,w.getSuperWidth(this),e.x,i.x<0),y:w.calculateAlignByPosition("height",this.y,w.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=w.getSuperPoint(this.pivot,this.angle),i=w.getSuperPoint(this.scale,this.angle);return w.calculateAlignByPosition("width",this.x,w.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=w.getSuperPoint(this.pivot,this.angle),i=w.getSuperPoint(this.scale,this.angle);return w.calculateAlignByPosition("height",this.y,w.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:w.calculatePercentagePositionByPosition("width",this.x),y:w.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 w.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 w.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=w.getSuperPoint(this.pivot,this.angle),i=w.getSuperPoint(this.scale,this.angle);this._align.x!==void 0&&(super.x=w.calculatePositionByAlign("width",this._align.x,w.getSuperWidth(this),e.x,i.x<0)),this._align.y!==void 0&&(super.y=w.calculatePositionByAlign("height",this._align.y,w.getSuperHeight(this),e.y,i.y<0));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=w.calculatePositionByPercentagePosition("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=w.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;}};de.add(Pe,{name:b,copyProperty:async(t,e)=>await le(t,e)});var Fn=new Set(["mp4","webm","ogg","ogv","avi","mov","wmv","flv","mkv","m4v","3gp","3g2","ts","mts"]);function Ge(t){let e=we.Assets.cache.has(t)?we.Assets.get(t):null;return e instanceof we.Texture&&(t=e.source?.label||t),Ln(t)}function Ln(t){let e=t.split(".").pop()?.toLowerCase();return e!==void 0&&Fn.has(e)}var Q=class extends Pe{constructor(e,i){let{anchor:s,align:a,percentagePosition:p,...y}=ge(e)||{};super(y),i&&i.forEach(R=>{Ge(R)?this.addChild(new ye(void 0,R)):this.addChild(new J(void 0,R));}),s&&(this.anchor=s),a&&(this.align=a),p&&(this.percentagePosition=p);}get memory(){return {...super.memory,pixivnId:c,loadIsStarted:this._loadIsStarted}}async setMemory(e){await this.importChildren(e),await jt(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(i=>i.load());return Promise.all(e).then(()=>{this._loadIsStarted=false,this.reloadAnchor(),this.reloadPosition();}).catch(i=>{this._loadIsStarted=false,e$1.error("Error into ImageContainer.load()",i);})}get texture(){return this.children.length>0?this.children[0].texture:new we.Texture}get haveEmptyTexture(){return this.children.some(e=>e.texture._source.label==="EMPTY")}};de.add(Q,{name:c,copyProperty:async(t,e)=>await jt(t,e)});async function jt(t,e){e=ge(e)||{},le(t,e,{end:async()=>{"loadIsStarted"in e&&e.loadIsStarted&&await t.load();}});}var at=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 Ee=class extends we.Text{constructor(e){let{align:i,percentagePosition:s,...a}=ge(e)||{};super(a),this.pixivnId=this.constructor.prototype.pixivnId||f$1,i&&(this.align=i),s&&(this.percentagePosition=s);}pixivnId=f$1;get memory(){return {...Tt(this),pixivnId:this.pixivnId,align:this._align,percentagePosition:this._percentagePosition}}async setMemory(e){await Hn(this,e),this.reloadPosition();}onEventsHandlers={};on(e,i,s){return Oe(e,this,i),super.on(e,(...a)=>i(...a,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=w.getSuperPoint(this.pivot,this.angle),i=w.getSuperPoint(this.scale,this.angle);return {x:w.calculateAlignByPosition("width",this.x,w.getSuperWidth(this),e.x,i.x<0,this.anchor.x),y:w.calculateAlignByPosition("height",this.y,w.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=w.getSuperPoint(this.pivot,this.angle),i=w.getSuperPoint(this.scale,this.angle);return w.calculateAlignByPosition("width",this.x,w.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=w.getSuperPoint(this.pivot,this.angle),i=w.getSuperPoint(this.scale,this.angle);return w.calculateAlignByPosition("height",this.y,w.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:w.calculatePercentagePositionByPosition("width",this.x),y:w.calculatePercentagePositionByPosition("height",this.y)}}get percentageX(){return w.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 w.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=w.getSuperPoint(this.pivot,this.angle),i=w.getSuperPoint(this.scale,this.angle);this._align.x!==void 0&&(super.x=w.calculatePositionByAlign("width",this._align.x,w.getSuperWidth(this),e.x,i.x<0,this.anchor.x)),this._align.y!==void 0&&(super.y=w.calculatePositionByAlign("height",this._align.y,w.getSuperHeight(this),e.y,i.y<0,this.anchor.y));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=w.calculatePositionByPercentagePosition("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=w.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;}};de.add(Ee,{name:f$1});async function Hn(t,e){"text"in e&&e.text!==void 0&&(t.text=e.text),await le(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 bt(t){let e=t.filters;return e?Array.isArray(e)?[...e]:[e]:[]}function Xn(t,e){t.filters=[...bt(t),...e];}function $n(t,e){let i=bt(t).filter(s=>!e.includes(s));t.filters=i.length>0?i:null;}function ee(t,e,i,s,a,p,y){Xn(e,[i]),y?.();let R=filters.animate(t,i,s,{duration:a.duration??1,delay:a.delay,ease:a.ease,times:a.times,aliasToRemoveAfter:a.aliasToRemoveAfter,autoplay:a.autoplay},p,void 0,()=>{$n(e,[i]),i.destroy();});return R&&(a.completeOnContinue??true)&&tickers$1.completeOnStepEnd({id:R}),R}function Ie(t,e){let i;try{i=f.screen;}catch{i=void 0;}return b$1(t.getBounds(),e,bt(t),i)}async function Gn(t,e={},i){return Ot.shakeEffect(t,e,i)}function Kt(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 ct(t,e,i){let s=[0],a=t;for(let p=0;p<i;p++)s.push(p%2===0?a:-a,0),a*=e;return s}function He(t,e,i,s){let a=[t],p=e;for(let y=0;y<s;y++)a.push(t+p,t),p*=i;return a}var Ot;(_e=>{async function t(M,q={},K){let _=f.find(M);if(!_){e$1.error(`The element with the alias ${M} does not exist. So the shake effect can't be applied.`);return}let B={x:_.position.x,y:_.position.y},{shakeType:W="horizontal",maxShockSize:G=10,shocksNumber:j=10,...H}=q,F=j-1;if(F<2){e$1.error("The number of shocks must be at least 3.");return}let X=Math.floor(F/2),Y=Math.ceil(F/2),L=[];for(let Z=0;Z<X;Z++){let re=G*(Z+1)/X;W==="horizontal"?Z%2!==0?L.push(B.x+re):L.push(B.x-re):Z%2!==0?L.push(B.y+re):L.push(B.y-re);}let N=X%2===0;for(let Z=Y;Z>0;Z--){let re=G*(Z+1)/(Y-1);W==="horizontal"?Z%2===0&&!N||Z%2!==0&&N?L.push(B.x-re):L.push(B.x+re):Z%2===0&&!N||Z%2!==0&&N?L.push(B.y-re):L.push(B.y+re);}let ne;if(W==="horizontal"?(L.push(B.x),ne=f.animate(M,{x:L},H,K)):(L.push(B.y),ne=f.animate(M,{y:L},H,K)),ne)return [ne]}_e.shakeEffect=t;async function e(M,q={},K){let _=f.find(M);if(!_){e$1.error(`The element with the alias ${M} does not exist. So the bounce effect can't be applied.`);return}let{direction:B="up",distance:W=30,bounces:G=4,decay:j=.5,...H}=q,{axis:F,sign:X}=Kt(B),Y=F==="x"?_.position.x:_.position.y,L=[Y],N=W;for(let Z=0;Z<G;Z++)L.push(Y+X*N,Y),N*=j;let ne=f.animate(M,{[F]:L},H,K);if(ne)return [ne]}_e.bounceEffect=e;async function i(M,q={},K){let _=f.find(M);if(!_){e$1.error(`The element with the alias ${M} does not exist. So the pulse effect can't be applied.`);return}let{scale:B=1.2,pulses:W=3,decay:G=.6,...j}=q,H=_.scale.x,F=_.scale.y,X=[H],Y=[F],L=B-1;for(let ne=0;ne<W;ne++)X.push(H*(1+L),H),Y.push(F*(1+L),F),L*=G;let N=f.animate(M,{scaleX:X,scaleY:Y},j,K);if(N)return [N]}_e.pulseEffect=i;async function s(M,q={},K){let _=f.find(M);if(!_){e$1.error(`The element with the alias ${M} does not exist. So the hop effect can't be applied.`);return}let{direction:B="up",distance:W=40,secondaryHops:G=0,decay:j=.5,...H}=q,{axis:F,sign:X}=Kt(B),Y=F==="x"?_.position.x:_.position.y,L=[Y],N=W;for(let Z=0;Z<1+G;Z++)L.push(Y+X*N,Y),N*=j;let ne=f.animate(M,{[F]:L},H,K);if(ne)return [ne]}_e.hopEffect=s;async function a$1(M,q={},K){let _=f.find(M);if(!_){e$1.error(`The element with the alias ${M} does not exist. So the wiggle effect can't be applied.`);return}let{angle:B=15,repetitions:W=3,decay:G=.5,...j}=q,H=_.rotation,F=B*Math.PI/180,X=ct(F,G,W).map(L=>H+L),Y=f.animate(M,{rotation:X},j,K);if(Y)return [Y]}_e.wiggleEffect=a$1;async function p(M,q={},K){let _=f.find(M);if(!_){e$1.error(`The element with the alias ${M} does not exist. So the nod effect can't be applied.`);return}let{axis:B="horizontal",distance:W=15,repetitions:G=3,decay:j=.5,...H}=q,F=B==="horizontal"?"x":"y",X=B==="horizontal"?_.position.x:_.position.y,Y=ct(W,j,G).map(N=>X+N),L=f.animate(M,{[F]:Y},H,K);if(L)return [L]}_e.nodEffect=p;async function y(M,q={},K){let _=f.find(M);if(!_){e$1.error(`The element with the alias ${M} does not exist. So the sway effect can't be applied.`);return}let{axis:B="horizontal",distance:W=10,angle:G=5,repetitions:j=3,decay:H=0,ease:F="easeInOut",...X}=q,Y=B==="horizontal"?"x":"y",L=B==="horizontal"?_.position.x:_.position.y,N=_.rotation,ne=G*Math.PI/180,Z=ct(W,H||1,j).map(xe=>L+xe),re=ct(ne,H||1,j).map(xe=>N+xe),fe=f.animate(M,{[Y]:Z,rotation:re},{ease:F,...X},K);if(fe)return [fe]}_e.swayEffect=y;async function R(M,q={},K){let _=f.find(M);if(!_){e$1.error(`The element with the alias ${M} does not exist. So the punch effect can't be applied.`);return}let{mode:B="scale",strength:W=.3,overshoot:G=.3,...j}=q,H;if(B==="scale"){let F=X=>[X,X*(1+W),X*(1-W*G),X];H=f.animate(M,{scaleX:F(_.scale.x),scaleY:F(_.scale.y)},j,K);}else {let F=B==="rotation"?_.rotation:B==="x"?_.position.x:_.position.y,X=B==="rotation"?W*Math.PI/180:W,Y=[F,F+X,F-X*G,F];H=f.animate(M,{[B]:Y},j,K);}if(H)return [H]}_e.punchEffect=R;async function S(M,q={},K){let _=f.find(M);if(!_){e$1.error(`The element with the alias ${M} does not exist. So the glitch effect can't be applied.`);return}let{strength:B=40,bursts:W=3,slices:G=8,direction:j=0,rgbSplit:H=6,decay:F=.5,ease:X="linear",...Y}=q,L=new filters.GlitchFilter({slices:G,direction:j,offset:0});L.refresh(),L.padding=Math.ceil(Math.abs(B));let N=[],ne=ee(M,_,L,{offset:a(B,F,W)},{ease:X,...Y},K);if(ne&&N.push(ne),H!==0){let Z=a(H,F,W),re=new filters.RGBSplitFilter({red:{x:0,y:0},green:{x:0,y:0},blue:{x:0,y:0}});re.padding=Math.ceil(Math.abs(H));let fe=ee(M,_,re,{redX:Z,blueX:Z.map(xe=>-xe)},{ease:X,...Y},K);fe&&N.push(fe);}if(N.length>0)return N}_e.glitchEffect=S;async function l(M,q={},K){let _=f.find(M);if(!_){e$1.error(`The element with the alias ${M} does not exist. So the chromatic aberration effect can't be applied.`);return}let{strength:B=8,axis:W="horizontal",bursts:G=1,decay:j=.5,...H}=q,F=new filters.RGBSplitFilter({red:{x:0,y:0},green:{x:0,y:0},blue:{x:0,y:0}});F.padding=Math.ceil(Math.abs(B));let X=W==="horizontal"?"redX":"redY",Y=W==="horizontal"?"blueX":"blueY",L={[X]:He(0,B,j,G),[Y]:He(0,-B,j,G)},N=ee(M,_,F,L,H,K);if(N)return [N]}_e.chromaticAberrationEffect=l;async function v(M,q={},K){let _=f.find(M);if(!_){e$1.error(`The element with the alias ${M} does not exist. So the shockwave effect can't be applied.`);return}let{origin:B={x:.5,y:.5},amplitude:W=30,wavelength:G=160,brightness:j=1,radius:H=-1,speed:F=500,strength:X,...Y}=q,{width:L,height:N}=_.getBounds(),ne=X??e$2({x:B.x*L,y:B.y*N},{width:L,height:N},G,H)/F,Z=new filters.ShockwaveFilter({center:{x:0,y:0},amplitude:W,wavelength:G,brightness:j,radius:H,speed:F,time:0});Z.padding=Math.ceil(Math.abs(W)*1.25);let re=ee(M,_,Z,{time:[0,ne]},Y,K,()=>{let{x:fe,y:xe}=Ie(_,B);Z.center={x:fe,y:xe};});if(re)return [re]}_e.shockwaveEffect=v;async function A(M,q={},K){let _=f.find(M);if(!_){e$1.error(`The element with the alias ${M} does not exist. So the radial blur effect can't be applied.`);return}let{strength:B=.5,bursts:W=1,origin:G={x:.5,y:.5},innerRadius:j=0,radius:H=-1,decay:F=.5,...X}=q,Y=new filters.ZoomBlurFilter({center:{x:0,y:0},innerRadius:j,radius:H,strength:0}),{width:L,height:N}=_.getBounds();Y.padding=d$2({x:G.x*L,y:G.y*N},B,L,N);let ne=He(0,B,F,W),Z=ee(M,_,Y,{strength:ne},X,K,()=>{let{x:re,y:fe}=Ie(_,G);Y.center={x:re,y:fe};});if(Z)return [Z]}_e.radialBlurEffect=A;async function b(M,q={},K){let _=f.find(M);if(!_){e$1.error(`The element with the alias ${M} does not exist. So the blur pulse effect can't be applied.`);return}let{strength:B=8,pulses:W=3,quality:G,decay:j=.5,...H}=q,F=new filters.BlurFilter({strength:0,quality:G}),X=He(0,B,j,W),Y=ee(M,_,F,{strength:X},H,K);if(Y)return [Y]}_e.blurPulseEffect=b;async function U(M,q={},K){let _=f.find(M);if(!_){e$1.error(`The element with the alias ${M} does not exist. So the vignette pulse effect can't be applied.`);return}let{strength:B=1,pulses:W=1,radius:G=.5,blur:j=.5,decay:H=.5,...F}=q,X=new filters.CRTFilter({curvature:0,lineWidth:0,lineContrast:0,noise:0,vignetting:G,vignettingBlur:j,vignettingAlpha:0}),Y=He(0,B,H,W),L=ee(M,_,X,{vignettingAlpha:Y},F,K);if(L)return [L]}_e.vignettePulseEffect=U;async function z(M,q={},K){let _=f.find(M);if(!_){e$1.error(`The element with the alias ${M} does not exist. So the desaturate effect can't be applied.`);return}let{amount:B=0,duration:W=1,holdDuration:G=0,...j}=q,H=W*2+G,F=[0,W/H,(W+G)/H,1],X=new filters.AdjustmentFilter({saturation:1}),Y=ee(M,_,X,{saturation:[1,B,B,1]},{...j,duration:H,times:F},K);if(Y)return [Y]}_e.desaturateEffect=z;async function te(M,q={},K){let _=f.find(M);if(!_){e$1.error(`The element with the alias ${M} does not exist. So the glow pulse effect can't be applied.`);return}let{strength:B=4,pulses:W=3,color:G=16777215,distance:j=10,innerStrength:H=0,decay:F=.5,...X}=q,Y=new filters.GlowFilter({outerStrength:0,innerStrength:H,distance:j,color:G}),L=He(0,B,F,W),N=ee(M,_,Y,{outerStrength:L},X,K);if(N)return [N]}_e.glowPulseEffect=te;})(Ot||={});function Me(t){let e=t.getLocalBounds();return {x:e.x,y:e.y,width:e.width,height:e.height}}function wt(t,e){return e.graphics||(e.graphics=new Graphics,e.graphics.label="",t.parent?.addChild(e.graphics),t.mask=e.graphics),jn(t,e.graphics),e.graphics}function jn(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 Nn(t,e){e.graphics&&(t.mask===e.graphics&&(t.mask=null),e.graphics.parent?.removeChild(e.graphics),e.graphics.destroy({children:true}),e.graphics=void 0);}function Kn(t,e,i,s){let a=e.invert?1-i:i,{bounds:p}=e,y=wt(t,s),R=p.x+p.width/2,S=p.y+p.height/2,l=Math.sqrt(p.width**2+p.height**2)||1,v=Math.max(a,0)*l*2,A=e.angle*Math.PI/180;if(y.clear(),v>0){let b=Math.cos(-A),U=Math.sin(-A),z=[[-l,-l],[-l+v,-l],[-l+v,l],[-l,l]].flatMap(([te,_e])=>[R+te*b-_e*U,S+te*U+_e*b]);y.poly(z).fill(16777215);}}function qn(t,e,i,s){let a=e.invert?1-i:i,{bounds:p}=e,y=wt(t,s),R=p.x+p.width*e.originX,S=p.y+p.height*e.originY,l=Math.max(R-p.x,p.x+p.width-R),v=Math.max(S-p.y,p.y+p.height-S),A=Math.sqrt(l**2+v**2)||1,b=Math.max(a,0)*A,U=e.aspect>0?e.aspect:1;if(y.clear(),e.outside){let z=A*Math.max(U,1)*2;y.rect(p.x-z,p.y-z,p.width+z*2,p.height+z*2).fill(16777215),b>0&&y.ellipse(R,S,b*U,b).cut();}else b>0&&y.ellipse(R,S,b*U,b).fill(16777215);}function Zn(t,e,i,s){let a=e.invert?1-i:i,p=1-a,{bounds:y}=e,R=wt(t,s);if(R.clear(),e.direction==="outward"){if(a>0)if(e.orientation==="horizontal"){let S=y.x+y.width*e.origin;R.rect(S-(S-y.x)*a,y.y,y.width*a,y.height).fill(16777215);}else {let S=y.y+y.height*e.origin;R.rect(y.x,S-(S-y.y)*a,y.width,y.height*a).fill(16777215);}return}if(e.orientation==="horizontal"){let S=y.x+y.width*e.origin,l=S-y.x,v=y.x+y.width-S,A=y.x-p*l,b=S+p*v;l>0&&R.rect(A,y.y,l,y.height).fill(16777215),v>0&&R.rect(b,y.y,v,y.height).fill(16777215);}else {let S=y.y+y.height*e.origin,l=S-y.y,v=y.y+y.height-S,A=y.y-p*l,b=S+p*v;l>0&&R.rect(y.x,A,y.width,l).fill(16777215),v>0&&R.rect(y.x,b,y.width,v).fill(16777215);}}function Jn(t,e,i){switch(e.kind){case "wipe":case "iris":case "split":Nn(t,i);break}}function Qn(t,e,i,s){switch(e.kind){case "wipe":return Kn(t,e,i,s);case "iris":return qn(t,e,i,s);case "split":return Zn(t,e,i,s)}}function At(t,e){let i={};return {apply(s){let a=f.find(t);a&&(i.component=a,Qn(a,e,s,i));},cleanup(){let s=i.component??f.find(t);s&&Jn(s,e,i);}}}function dt(t,e,i){let s={...f.find(t)?.memory,...i},a=new Q(i,e);return s&&f.copyCanvasElementProperty(s,a),f.add(t,a,{ignoreOldStyle:true,zIndex:i?.zIndex}),a}async function ei(t,e,i){let s={...f.find(t)?.memory,...i},a=new Q(i,e);return a.label=t,await a.load(),s&&f.copyCanvasElementProperty(s,a),f.add(t,a,{ignoreOldStyle:true,zIndex:i?.zIndex}),a}function ut(t,e,i){if(!e)if(we.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,...i,label:t});let s={...f.find(t)?.memory,...i},a=new J(i,e);return s&&f.copyCanvasElementProperty(s,a),f.add(t,a,{ignoreOldStyle:true,zIndex:i?.zIndex}),a}async function ti(t,e,i){if(!e)if(we.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,...i,label:t});let s={...f.find(t)?.memory,...i},a=new J(i,e);return a.label=t,await a.load(),s&&f.copyCanvasElementProperty(s,a),f.add(t,a,{ignoreOldStyle:true,zIndex:i?.zIndex}),a}function ft(t,e,i){if(!e)if(we.Assets.resolver.hasKey(t))e=t;else throw new PixiError("unregistered_asset",`The video ${t} does not exist in the cache.`,"canvas",{pixivnId:g,...i,label:t});let s={...f.find(t)?.memory,...i},a=new ye(i,e);return s&&f.copyCanvasElementProperty(s,a),f.add(t,a,{ignoreOldStyle:true,zIndex:i?.zIndex}),a}async function ni(t,e,i){if(!e)if(we.Assets.resolver.hasKey(t))e=t;else throw new PixiError("unregistered_asset",`The video ${t} does not exist in the cache.`,"canvas",{pixivnId:g,...i,label:t});let s={...f.find(t)?.memory,...i},a=new ye(i,e);return a.label=t,await a.load(),s&&f.copyCanvasElementProperty(s,a),f.add(t,a,{ignoreOldStyle:true,zIndex:i?.zIndex}),a}async function ii(t,e,i={},s){return pe.showWithDissolve(t,e,i,s)}function ri(t,e={},i){return pe.removeWithDissolve(t,e,i)}async function si(t,e,i={},s){return pe.showWithFade(t,e,i,s)}function oi(t,e={},i){return pe.removeWithFade(t,e,i)}async function ai(t,e,i={},s){return pe.moveIn(t,e,i,s)}function ci(t,e={},i){return pe.moveOut(t,e,i)}async function di(t,e,i={},s){return pe.zoomIn(t,e,i,s)}function ui(t,e={},i){return pe.zoomOut(t,e,i)}async function fi(t,e,i={},s){return pe.pushIn(t,e,i,s)}function li(t,e={direction:"right"},i){return pe.pushOut(t,e,i)}var pe;(Ai=>{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,n,o){if(typeof n=="string")return Ge(n)?ft(r,n,{...o.properties,zIndex:o.zIndex}):ut(r,n,{...o.properties,zIndex:o.zIndex});if(Array.isArray(n))return dt(r,n,{...o.properties,zIndex:o.zIndex});if(typeof n=="object"&&"value"in n&&"options"in n){if(typeof n.value=="string")return Ge(n.value)?ft(r,n.value,{...n.options,...o.properties,zIndex:o.zIndex}):ut(r,n.value,{...n.options,...o.properties,zIndex:o.zIndex});if(Array.isArray(n.value))return dt(r,n.value,{...n.options,...o.properties,zIndex:o.zIndex})}return f.add(r,n,o),n}function i(r){let n=r;return {x:n.x,y:n.y,anchor:n.anchor,scale:n.scale,pivot:n.pivot,skew:n.skew,rotation:n.rotation,angle:n.angle}}function s(r,n,o){let c,d=f.find(r);d&&(c=`${r}_temp_${o}`,f.editAlias(r,c));let u=e(r,n,{zIndex:d?d.parent?.getChildIndex(d):void 0,properties:d?i(d):void 0});return d?.parent?.setChildIndex(d,d.parent.getChildIndex(d)-.1),c&&f.copyCanvasElementProperty(c,r),c&&tickers$1.transfer(c,r,"duplicate"),{component:u,oldComponentAlias:c}}function a$1(r,n,o,c){return r?n?c(r)??[]:(o.push(r),[]):[]}function p(r){let{aliasToRemoveAfter:n,animateOldComponentOut:o,...c}=r;return c}function y(r,n){let o=r?[r,...n]:n;return o.length>0?o:void 0}function R(r){switch(r){case "up":return 90;case "down":return 270;case "left":return 180;default:return 0}}function S(r,n,o){let{apply:c,cleanup:d}=At(r,n.config),u=filters.animate(r,void 0,{value:[n.from,n.to]},{duration:n.duration??1,delay:n.delay,ease:n.ease,aliasToRemoveAfter:n.aliasToRemoveAfter,tickerIdToResume:n.tickerIdToResume},o,c,d,{alias:r,config:n.config});return u&&c(n.from),u&&(n.completeOnContinue??true)&&tickers$1.completeOnStepEnd({id:u}),u}function l(r,n,o,c,d,u){let m=Math.max(c,0)/4;o==="in"?(n&&(n.alpha=0),f.animate(r,{alpha:[0,1]},{duration:m,delay:u,completeOnContinue:false},d)):f.animate(r,{alpha:[1,0]},{duration:m,delay:typeof u=="function"?(C,h)=>u(C,h)+Math.max(c-m,0):(u??0)+Math.max(c-m,0),completeOnContinue:false},d);}function v(r,n,o,c,d=false){let u=Math.max(c,1),m=n*2+o,C=d?n+o:m,h=Math.max(m*(u-1)+C,.001),T=[0],P=[0],I=0;for(let x=0;x<u;x++){let g=x===u-1;I+=n,T.push(r),P.push(I/h),I+=o,T.push(r),P.push(I/h),(!g||!d)&&(I+=n,T.push(0),P.push(Math.min(I/h,1)));}return {values:T,times:P,total:h}}async function A(r,n,o={},c){let{completeOnContinue:d=true,tickerIdToResume:u=[],...m}=o,C=[];n||(n=r),typeof u=="string"&&(u=[u]);let h,T=f.find(r);if(T&&(h=`${r}_temp_disolve`,f.editAlias(r,h)),n=e(r,n,{zIndex:T?T.parent?.getChildIndex(T):void 0,properties:T?i(T):void 0}),T?.parent?.setChildIndex(T,T.parent.getChildIndex(T)-.1),h&&f.copyCanvasElementProperty(h,r),h&&tickers$1.transfer(h,r,"duplicate"),n.alpha=0,h){let I=b(h,{...o,autoplay:false,completeOnContinue:d},c);I&&(C.push(...I),u.push(...I));}let P=f.animate(r,{alpha:1},{...m,tickerIdToResume:u,completeOnContinue:d},c);if(P&&C.push(P),C.length>0)return C}Ai.showWithDissolve=A;function b(r,n={},o){let{completeOnContinue:c=true,aliasToRemoveAfter:d=[],...u}=n;typeof d=="string"&&(d=[d]),d.push(r);let m=f.animate(r,{alpha:0},{...u,aliasToRemoveAfter:d,completeOnContinue:c},o);if(m)return [m]}Ai.removeWithDissolve=b;async function U(r,n,o={},c){let{completeOnContinue:d=true,aliasToRemoveAfter:u=[],...m}=o,C=[];n||(n=r),typeof u=="string"&&(u=[u]);let h=f.find(r);if(!h)return A(r,n,o,c);let T=`${r}_temp_fade`;f.editAlias(r,T),u.push(T),n=e(r,n,{zIndex:h?h.parent?.getChildIndex(h):void 0,properties:i(h)}),h?.parent?.setChildIndex(h,h.parent.getChildIndex(h)-.1),T&&f.copyCanvasElementProperty(T,r),T&&tickers$1.transfer(T,r,"duplicate"),n.alpha=0;let P=f.animate(r,{alpha:1},{...m,aliasToRemoveAfter:u,completeOnContinue:d},c);if(P){let I=b(T,{...o,tickerIdToResume:P,completeOnContinue:d},c);I&&C.push(...I),C.push(P),tickers$1.pause({id:P});}if((n instanceof J||n instanceof Q)&&n.haveEmptyTexture&&await n.load(),C.length>0)return C}Ai.showWithFade=U;function z(r,n={},o){return b(r,n,o)}Ai.removeWithFade=z;async function te(r,n,o={},c){let{direction:d="right",completeOnContinue:u=true,tickerIdToResume:m=[],aliasToRemoveAfter:C=[],removeOldComponentWithMoveOut:h,animateOldComponentOut:T=h??false,motionBlur:P,...I}=o,x=[],g;n||(n=r),typeof m=="string"&&(m=[m]),typeof C=="string"&&(C=[C]);let O,k=f.find(r);if(k&&(O=`${r}_temp_movein`,f.editAlias(r,O),k instanceof J||k instanceof Q?g=k.positionInfo:g={x:k.x,y:k.y,type:"pixel"}),n=e(r,n,{zIndex:k?k.parent?.getChildIndex(k):void 0}),k?.parent?.setChildIndex(k,k.parent.getChildIndex(k)-.1),O&&f.copyCanvasElementProperty(O,r),O&&tickers$1.transfer(O,r,"move"),(n instanceof J||n instanceof Q)&&n.haveEmptyTexture&&await n.load(),g||(n instanceof J||n instanceof Q?g=n.positionInfo:g={x:n.x,y:n.y,type:"pixel"}),O)if(T){let se=_e(O,{...I,direction:d,motionBlur:P,autoplay:false,completeOnContinue:u},c);se&&(x.push(...se),m.push(...se));}else C.push(O);switch(d){case "up":n.y=f.height+n.height;break;case "down":n.y=-n.height;break;case "left":n.x=f.width+n.width;break;case "right":n.x=-n.width;break}let D=tickers$1.pause({canvasAlias:r});m.push(...D);let $=f.animate(r,t(g),{...I,tickerIdToResume:m,aliasToRemoveAfter:C,completeOnContinue:u},c);$&&x.push($);let V=lt(r,n,d,P,{...I,completeOnContinue:u},c);if(V&&x.push(V),x.length>0)return x}Ai.moveIn=te;function _e(r,n={},o){let{direction:c="right",completeOnContinue:d=true,aliasToRemoveAfter:u=[],motionBlur:m,...C}=n;typeof u=="string"&&(u=[u]),u.push(r);let h=f.find(r);if(!h){e$1.warn(`The canvas component "${r}" is not found.`);return}let T={x:h.x,y:h.y};switch(c){case "up":T.y=-h.height;break;case "down":T.y=f.height+h.height;break;case "left":T.x=-h.width;break;case "right":T.x=f.width+h.width;break}tickers$1.pause({canvasAlias:r});let P=f.animate(r,T,{...C,aliasToRemoveAfter:u,completeOnContinue:d},o),I=lt(r,h,c,m,{...C,completeOnContinue:d},o);return je([P,I])}Ai.moveOut=_e;async function M(r,n,o={},c){let{direction:d="right",completeOnContinue:u=true,tickerIdToResume:m=[],aliasToRemoveAfter:C=[],removeOldComponentWithZoomOut:h,animateOldComponentOut:T=h??false,...P}=o,I=[],x;n||(n=r),typeof m=="string"&&(m=[m]),typeof C=="string"&&(C=[C]);let g,O=f.find(r);O&&(g=`${r}_temp_zoom`,f.editAlias(r,g),O instanceof J||O instanceof Q?x=O.positionInfo:x={x:O.x,y:O.y,type:"pixel"}),n=e(r,n,{zIndex:O?O.parent?.getChildIndex(O):void 0}),O?.parent?.setChildIndex(O,O.parent.getChildIndex(O)-.1),g&&f.copyCanvasElementProperty(g,r),g&&tickers$1.transfer(g,r,"move"),(n instanceof J||n instanceof Q)&&n.haveEmptyTexture&&await n.load(),x||(n instanceof J||n instanceof Q?x=n.positionInfo:x={x:n.x,y:n.y,type:"pixel"});let k={x:n.pivot.x,y:n.pivot.y},D={x:n.scale.x,y:n.scale.y};if(g)if(T){let se=q(g,{...P,direction:d,autoplay:false,completeOnContinue:u},c);se&&(I.push(...se),m.push(...se));}else C.push(g);(n instanceof J||n instanceof Q)&&n.haveEmptyTexture&&await n.load(),d==="up"?(n.pivot.y=f.height-n.y,n.pivot.x=f.width/2-n.x,n.y=f.height,n.x=f.width/2):d==="down"?(n.pivot.y=0-n.y,n.pivot.x=f.width/2-n.x,n.y=0,n.x=f.width/2):d==="left"?(n.pivot.x=f.width-n.x,n.pivot.y=f.height/2-n.y,n.x=f.width,n.y=f.height/2):d==="right"&&(n.pivot.x=0-n.x,n.pivot.y=f.height/2-n.y,n.x=0,n.y=f.height/2),n.pivot=w.getPointBySuperPoint(n.pivot,n.angle),n.scale.set(0);let $=tickers$1.pause({canvasAlias:r});m.push(...$);let V=f.animate(r,{pivotX:k.x,pivotY:k.y,scaleX:D.x,scaleY:D.y,...t(x)},{...P,tickerIdToResume:m,aliasToRemoveAfter:C,completeOnContinue:u},c);if(V&&I.push(V),I.length>0)return I}Ai.zoomIn=M;function q(r,n={},o){let{direction:c="right",completeOnContinue:d=true,aliasToRemoveAfter:u=[],...m}=n;typeof u=="string"&&(u=[u]),u.push(r);let C=f.find(r);if(!C){e$1.warn(`The canvas component "${r}" is not found.`);return}let h={x:C.x,y:C.y},T={x:C.pivot.x,y:C.pivot.y};c==="down"?(h.y=f.height,h.x=f.width/2,T.y=f.height-h.y,T.x=f.width/2-h.x):c==="up"?(h.y=0,h.x=f.width/2,T.y=0-h.y,T.x=f.width/2-h.x):c==="right"?(h.x=f.width,h.y=f.height/2,T.x=f.width-h.x,T.y=f.height/2-h.y):c==="left"&&(h.x=0,h.y=f.height/2,T.x=0-h.x,T.y=f.height/2-h.y),T=w.getPointBySuperPoint(T,C.angle),tickers$1.pause({canvasAlias:r});let P=f.animate(r,{...h,pivotX:T.x,pivotY:T.y,scaleX:0,scaleY:0},{...m,aliasToRemoveAfter:u,completeOnContinue:d},o);if(P)return [P]}Ai.zoomOut=q;async function K(r,n,o={},c){let{direction:d="right",completeOnContinue:u=true,tickerIdToResume:m=[],aliasToRemoveAfter:C=[],animateOldComponentOut:h=true,motionBlur:T,...P}=o,I=[],x;n||(n=r),typeof m=="string"&&(m=[m]),typeof C=="string"&&(C=[C]);let g,O=f.find(r);switch(O&&(g=`${r}_temp_push`,f.editAlias(r,g),O instanceof J||O instanceof Q?x=O.positionInfo:x={x:O.x,y:O.y,type:"pixel"}),n=e(r,n,{zIndex:O?O.parent?.getChildIndex(O):void 0}),O?.parent?.setChildIndex(O,O.parent.getChildIndex(O)-.1),g&&f.copyCanvasElementProperty(g,r),g&&tickers$1.transfer(g,r,"move"),x||((n instanceof J||n instanceof Q)&&n.haveEmptyTexture?x=n.positionInfo:x={x:n.x,y:n.y,type:"pixel"}),(n instanceof J||n instanceof Q)&&n.haveEmptyTexture&&await n.load(),d){case "up":n.y=f.height+n.height;break;case "down":n.y=-n.height;break;case "left":n.x=f.width+n.width;break;case "right":n.x=-n.width;break}let k=tickers$1.pause({canvasAlias:r});if(m.push(...k),g)if(h){let V=_(g,{...P,direction:d,motionBlur:T,completeOnContinue:u});V&&I.push(...V);}else C.push(g);let D=f.animate(r,t(x),{...P,tickerIdToResume:m,aliasToRemoveAfter:C,completeOnContinue:u},c);D&&I.push(D);let $=lt(r,n,d,T,{...P,completeOnContinue:u},c);if($&&I.push($),I.length>0)return I}Ai.pushIn=K;function _(r,n={direction:"right"},o){return _e(r,n,o)}Ai.pushOut=_;async function B(r,n,o={},c){let{angle:d,direction:u="right",invert:m=false,duration:C,delay:h,ease:T,completeOnContinue:P=true,animateOldComponentOut:I=true}=o,{aliasToRemoveAfter:x=[]}=o;n||(n=r),typeof x=="string"&&(x=[x]);let{component:g,oldComponentAlias:O}=s(r,n,"wipe"),k=a$1(O,I,x,V=>W(V,{...p(o),angle:(d??R(u))+180},c));(g instanceof J||g instanceof Q)&&g.haveEmptyTexture&&await g.load();let D={kind:"wipe",angle:d??R(u),invert:m,bounds:Me(g)},$=S(r,{config:D,from:0,to:1,duration:C,delay:h,ease:T,completeOnContinue:P,aliasToRemoveAfter:x},c);return y($,k)}Ai.wipeIn=B;function W(r,n={},o){let{angle:c,direction:d="right",invert:u=false,duration:m,delay:C,ease:h,completeOnContinue:T=true}=n,{aliasToRemoveAfter:P=[]}=n;typeof P=="string"&&(P=[P]),P.push(r);let I=f.find(r);if(!I){e$1.warn(`The canvas component "${r}" is not found.`);return}let x={kind:"wipe",angle:c??R(d),invert:u,bounds:Me(I)},g=S(r,{config:x,from:1,to:0,duration:m,delay:C,ease:h,completeOnContinue:T,aliasToRemoveAfter:P},o);if(g)return [g]}Ai.wipeOut=W;async function G(r,n,o={},c){let{origin:d={},aspect:u=1,invert:m=false,duration:C,delay:h,ease:T,completeOnContinue:P=true,animateOldComponentOut:I=true,direction:x="expand"}=o,{aliasToRemoveAfter:g=[]}=o;n||(n=r),typeof g=="string"&&(g=[g]);let{component:O,oldComponentAlias:k}=s(r,n,"iris"),D=a$1(k,I,g,se=>j(se,{...p(o),direction:x==="contract"?"expand":"contract"},c));(O instanceof J||O instanceof Q)&&O.haveEmptyTexture&&await O.load();let $={kind:"iris",outside:x==="contract",originX:d.x??.5,originY:d.y??.5,aspect:u,invert:m,bounds:Me(O)},V=S(r,{config:$,from:x==="contract"?1:0,to:x==="contract"?0:1,duration:C,delay:h,ease:T,completeOnContinue:P,aliasToRemoveAfter:g},c);return y(V,D)}Ai.irisIn=G;function j(r,n={},o){let{origin:c={},aspect:d=1,invert:u=false,duration:m,delay:C,ease:h,completeOnContinue:T=true,direction:P="expand"}=n,{aliasToRemoveAfter:I=[]}=n;typeof I=="string"&&(I=[I]),I.push(r);let x=f.find(r);if(!x){e$1.warn(`The canvas component "${r}" is not found.`);return}let g={kind:"iris",outside:P==="contract",originX:c.x??.5,originY:c.y??.5,aspect:d,invert:u,bounds:Me(x)},O=S(r,{config:g,from:P==="contract"?0:1,to:P==="contract"?1:0,duration:m,delay:C,ease:h,completeOnContinue:T,aliasToRemoveAfter:I},o);if(O)return [O]}Ai.irisOut=j;async function H(r,n,o={},c){let{orientation:d="vertical",direction:u="inward",origin:m=.5,invert:C=false,duration:h,delay:T,ease:P,completeOnContinue:I=true,animateOldComponentOut:x=true}=o,{aliasToRemoveAfter:g=[]}=o;n||(n=r),typeof g=="string"&&(g=[g]);let{component:O,oldComponentAlias:k}=s(r,n,"split"),D=a$1(k,x,g,se=>F(se,{...p(o),direction:u==="inward"?"outward":"inward"},c));(O instanceof J||O instanceof Q)&&O.haveEmptyTexture&&await O.load();let $={kind:"split",orientation:d,direction:u,origin:m,invert:C,bounds:Me(O)},V=S(r,{config:$,from:0,to:1,duration:h,delay:T,ease:P,completeOnContinue:I,aliasToRemoveAfter:g},c);return y(V,D)}Ai.splitIn=H;function F(r,n={},o){let{orientation:c="vertical",direction:d="inward",origin:u=.5,invert:m=false,duration:C,delay:h,ease:T,completeOnContinue:P=true}=n,{aliasToRemoveAfter:I=[]}=n;typeof I=="string"&&(I=[I]),I.push(r);let x=f.find(r);if(!x){e$1.warn(`The canvas component "${r}" is not found.`);return}let g={kind:"split",orientation:c,direction:d,origin:u,invert:m,bounds:Me(x)},O=S(r,{config:g,from:1,to:0,duration:C,delay:h,ease:T,completeOnContinue:P,aliasToRemoveAfter:I},o);if(O)return [O]}Ai.splitOut=F;async function X(r,n,o={},c){let{strength:d=32,quality:u=4,duration:m,delay:C,ease:h,completeOnContinue:T=true,fadeComponent:P=true,animateOldComponentOut:I=true}=o,{aliasToRemoveAfter:x=[]}=o;n||(n=r),typeof x=="string"&&(x=[x]);let{component:g,oldComponentAlias:O}=s(r,n,"blur"),k=a$1(O,I,x,se=>Y(se,p(o),c));(g instanceof J||g instanceof Q)&&g.haveEmptyTexture&&await g.load();let D=m??1;P&&l(r,g,"in",D,c);let $=new filters.BlurFilter({strength:d,quality:u}),V=ee(r,g,$,{strength:[d,0]},{duration:D,delay:C,ease:h,completeOnContinue:T,aliasToRemoveAfter:x},c);return y(V,k)}Ai.blurIn=X;function Y(r,n={},o){let{strength:c=32,quality:d=4,duration:u,delay:m,ease:C,completeOnContinue:h=true,fadeComponent:T=true}=n,{aliasToRemoveAfter:P=[]}=n;typeof P=="string"&&(P=[P]),P.push(r);let I=f.find(r);if(!I){e$1.warn(`The canvas component "${r}" is not found.`);return}let x=u??1;T&&l(r,I,"out",x,o);let g=new filters.BlurFilter({strength:0,quality:d}),O=ee(r,I,g,{strength:[0,c]},{duration:x,delay:m,ease:C,completeOnContinue:h,aliasToRemoveAfter:P},o);if(O)return [O]}Ai.blurOut=Y;async function L(r,n,o={},c){let{pixelSize:d=32,direction:u="up-left",duration:m,delay:C,ease:h,completeOnContinue:T=true,fadeComponent:P=false,animateOldComponentOut:I=true}=o,{aliasToRemoveAfter:x=[]}=o;n||(n=r),typeof x=="string"&&(x=[x]);let{component:g,oldComponentAlias:O}=s(r,n,"pixelate"),k=a$1(O,I,x,Ke=>N(Ke,p(o),c));(g instanceof J||g instanceof Q)&&g.haveEmptyTexture&&await g.load();let D=m??1;P&&l(r,g,"in",D,c);let $=ne(d,u,"in"),V=new filters.PixelateFilter([$.sizeX[0],$.sizeY[0]]),se=ee(r,g,V,$,{duration:D,delay:C,ease:h,completeOnContinue:T,aliasToRemoveAfter:x},c);return y(se,k)}Ai.pixelateIn=L;function N(r,n={},o){let{pixelSize:c=32,direction:d="up-left",duration:u,delay:m,ease:C,completeOnContinue:h=true,fadeComponent:T=false}=n,{aliasToRemoveAfter:P=[]}=n;typeof P=="string"&&(P=[P]),P.push(r);let I=f.find(r);if(!I){e$1.warn(`The canvas component "${r}" is not found.`);return}let x=u??1;T&&l(r,I,"out",x,o);let g=ne(c,d,"out"),O=new filters.PixelateFilter([g.sizeX[0],g.sizeY[0]]),k=ee(r,I,O,g,{duration:x,delay:m,ease:C,completeOnContinue:h,aliasToRemoveAfter:P},o);if(k)return [k]}Ai.pixelateOut=N;function ne(r,n,o){let c=o==="in"?1:-1,d=(n.endsWith("left")?1:-1)*c,u=(n.startsWith("up")?1:-1)*c,m=Math.max(1,Math.abs(r)),C=o==="in"?[m,1]:[1,m];return {sizeX:C.map(h=>h*d),sizeY:C.map(h=>h*u)}}async function Z(r,n,o={},c){let{color:d=16777215,maxAlpha:u=1,duration:m=.3,holdDuration:C=0,pulses:h=1,completeOnContinue:T=true,fadeComponent:P=true,...I}=o;n||(n=r);let x=f.find(r);if(x)return xe(r,x,n,{color:d,maxAlpha:u,fadeDuration:m,holdDuration:C,pulses:h,completeOnContinue:T,rest:I,priority:c});let{component:g}=s(r,n,"flash");(g instanceof J||g instanceof Q)&&g.haveEmptyTexture&&await g.load(),P&&l(r,g,"in",m,c);let O=[],k=fe(g,{color:d,maxAlpha:u,fadeDuration:m,holdDuration:C,pulses:h,completeOnContinue:T,aliasToRemoveAfter:[],rest:I,priority:c});if(k&&O.push(k),O.length>0)return O}Ai.flashIn=Z;function re(r,n={},o){let{color:c=16777215,maxAlpha:d=1,duration:u=.3,holdDuration:m=0,pulses:C=1,completeOnContinue:h=true,fadeComponent:T=true,...P}=n,I=f.find(r);if(!I){e$1.warn(`The canvas component "${r}" is not found.`);return}if(T){let{total:g}=v(d,u,m,C);l(r,I,"out",g,o);}let x=fe(I,{color:c,maxAlpha:d,fadeDuration:u,holdDuration:m,pulses:C,completeOnContinue:h,aliasToRemoveAfter:[r],rest:P,priority:o});if(x)return [x]}Ai.flashOut=re;function fe(r,n){let{values:o,times:c,total:d}=v(n.maxAlpha,n.fadeDuration,n.holdDuration,n.pulses,n.endAtPeak??false),u=new filters.ColorOverlayFilter({color:n.color,alpha:0});return ee(r.label,r,u,{alpha:o},{duration:d,times:c,delay:n.rest.delay,ease:n.rest.ease,aliasToRemoveAfter:n.aliasToRemoveAfter,completeOnContinue:n.completeOnContinue},n.priority)}async function xe(r,n,o,c){let{component:d,oldComponentAlias:u}=s(r,o,"flash");if(!u)return;let m=d.alpha,C=n.alpha;d.alpha=0,(d instanceof J||d instanceof Q)&&d.haveEmptyTexture&&await d.load();let{values:h,times:T,total:P}=v(c.maxAlpha,c.fadeDuration,c.holdDuration,c.pulses,true),I=P+c.fadeDuration,x=P/I,g={duration:I,delay:c.rest.delay,ease:c.rest.ease,completeOnContinue:c.completeOnContinue},O=ee(u,n,new filters.ColorOverlayFilter({color:c.color,alpha:0}),{alpha:[...h,c.maxAlpha]},{...g,times:[...T.map(se=>se*x),1],aliasToRemoveAfter:[u]},c.priority),k=ee(r,d,new filters.ColorOverlayFilter({color:c.color,alpha:c.maxAlpha}),{alpha:[c.maxAlpha,c.maxAlpha,0]},{...g,times:[0,x,1],aliasToRemoveAfter:c.rest.aliasToRemoveAfter},c.priority),D={duration:I,delay:c.rest.delay,times:[0,x,x,1],ease:"linear"},$=f.animate(u,{alpha:[C,C,0,0]},D,c.priority),V=f.animate(r,{alpha:[0,0,m,m]},D,c.priority);return c.completeOnContinue&&($&&tickers$1.completeOnStepEnd({id:$}),V&&tickers$1.completeOnStepEnd({id:V})),je([O,k,$,V])}function lt(r,n,o,c,d,u){if(!c)return;let m=c===true?40:c,C=o==="up"||o==="down"?"velocityY":"velocityX",h=o==="up"||o==="left"?-1:1,T=new filters.MotionBlurFilter({velocity:{x:0,y:0},kernelSize:15});return ee(r,n,T,{[C]:[0,h*m,0]},{duration:d.duration??.3,delay:d.delay,ease:d.ease,completeOnContinue:d.completeOnContinue,autoplay:d.autoplay},u)}function je(r){let n=r.filter(o=>!!o);return n.length>0?n:void 0}async function Te(r,n,o,c,d,u,m,C,h=false){let{duration:T,delay:P,ease:I,completeOnContinue:x=true,fadeComponent:g=d,animateOldComponentOut:O=true}=c,{aliasToRemoveAfter:k=[]}=c;typeof k=="string"&&(k=[k]);let{component:D,oldComponentAlias:$}=s(r,n??r,o),V=h&&!!$&&O,se=D.alpha;V&&(D.alpha=0);let Ke=()=>a$1($,O,k,C),pt=V?[]:Ke();(D instanceof J||D instanceof Q)&&D.haveEmptyTexture&&await D.load(),V&&pt.push(...Ke());let We=T??1,Ft=h&&pt.length>0?typeof P=="function"?(cn,dn)=>P(cn,dn)+We:(P??0)+We:P,qe;return V?(qe=f.animate(r,{alpha:[0,se]},{duration:g?We/4:0,delay:Ft},u),qe&&x&&tickers$1.completeOnStepEnd({id:qe})):g&&l(r,D,"in",We,u),je([...m(D,{duration:We,delay:Ft,ease:I,completeOnContinue:x},k),...pt,qe])}function Ce(r,n,o,c,d){let{duration:u,delay:m,ease:C,completeOnContinue:h=true,fadeComponent:T=o}=n,{aliasToRemoveAfter:P=[]}=n;typeof P=="string"&&(P=[P]),P.push(r);let I=f.find(r);if(!I){e$1.warn(`The canvas component "${r}" is not found.`);return}let x=u??1;return T&&l(r,I,"out",x,c,m),je(d(I,{duration:x,delay:m,ease:C,completeOnContinue:h},P))}function St(r){let{width:n,height:o}=r.getBounds();return Math.hypot(n,o)/2}function Ne(r){return {x:r?.x??.5,y:r?.y??.5}}function Et(r,n,o,c,d,u,m){let{strength:C=40,bursts:h=3,slices:T=8,rgbSplit:P=6}=c,I=k=>{let D=a(k,.5,h);return o==="in"?D:D.reverse()},x={...d,ease:d.ease??"linear"},g=new filters.GlitchFilter({slices:T,offset:0});g.refresh(),g.padding=Math.ceil(Math.abs(C));let O=[ee(r,n,g,{offset:I(C)},{...x,aliasToRemoveAfter:u},m)];if(P!==0){let k=I(P),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(P)),O.push(ee(r,n,D,{redX:k,blueX:k.map($=>-$)},x,m));}return O}async function xi(r,n,o={},c){return Te(r,n,"glitch",o,true,c,(d,u,m)=>Et(r,d,"in",o,u,m,c),d=>nn(d,p(o),c),true)}Ai.glitchIn=xi;function nn(r,n={},o){return Ce(r,n,true,o,(c,d,u)=>Et(r,c,"out",n,d,u,o))}Ai.glitchOut=nn;function Mt(r,n,o,c,d,u,m){let{angle:C=540,radius:h=St(n),origin:T}=c,P=Ne(T),I=C*Math.PI/180,x=o==="in"?[I,0]:[0,I],g=new filters.TwistFilter({radius:h,angle:x[0],offset:{x:0,y:0}}),{width:O,height:k}=n.getBounds();return g.padding=Math.max(g.padding,c$1({x:P.x*O,y:P.y*k},h,O,k)),[ee(r,n,g,{angle:x},{...d,aliasToRemoveAfter:u},m,()=>{let{x:$,y:V}=Ie(n,P);g.offsetX=$,g.offsetY=V;})]}async function Pi(r,n,o={},c){return Te(r,n,"twist",o,true,c,(d,u,m)=>Mt(r,d,"in",o,u,m,c),d=>rn(d,{...p(o),angle:-(o.angle??540)},c))}Ai.twistIn=Pi;function rn(r,n={},o){return Ce(r,n,true,o,(c,d,u)=>Mt(r,c,"out",n,d,u,o))}Ai.twistOut=rn;function _t(r,n,o,c,d,u,m){let{strength:C=.6,origin:h}=c,T=Ne(h),P=o==="in"?[C,0]:[0,C],I=new filters.ZoomBlurFilter({center:{x:0,y:0},strength:P[0]}),{width:x,height:g}=n.getBounds();return I.padding=d$2({x:T.x*x,y:T.y*g},C,x,g),[ee(r,n,I,{strength:P},{...d,aliasToRemoveAfter:u},m,()=>{let{x:k,y:D}=Ie(n,T);I.center={x:k,y:D};})]}async function vi(r,n,o={},c){return Te(r,n,"warp",o,true,c,(d,u,m)=>_t(r,d,"in",o,u,m,c),d=>sn(d,p(o),c),true)}Ai.warpIn=vi;function sn(r,n={},o){return Ce(r,n,true,o,(c,d,u)=>_t(r,c,"out",n,d,u,o))}Ai.warpOut=sn;function Rt(r,n,o,c,d,u){let{origin:m,amplitude:C=30,wavelength:h=160,speed:T=500}=o,P=Ne(m),{width:I,height:x}=n.getBounds(),g=new filters.ShockwaveFilter({center:{x:0,y:0},amplitude:C,wavelength:h,speed:T,time:0});g.padding=Math.ceil(Math.abs(C)*1.25);let O=e$2({x:P.x*I,y:P.y*x},{width:I,height:x},h,-1)/T;return [ee(r,n,g,{time:[0,O]},{...c,aliasToRemoveAfter:d},u,()=>{let{x:D,y:$}=Ie(n,P);g.center={x:D,y:$};})]}async function Ii(r,n,o={},c){return Te(r,n,"ripple",o,true,c,(d,u,m)=>Rt(r,d,o,u,m,c),d=>b(d,{duration:o.duration,delay:o.delay,ease:o.ease,completeOnContinue:o.completeOnContinue},c))}Ai.rippleIn=Ii;function Ti(r,n={},o){return Ce(r,n,true,o,(c,d,u)=>Rt(r,c,n,d,u,o))}Ai.rippleOut=Ti;function kt(r,n,o,c,d,u,m){let{edge:C="hard",noiseScale:h=8,seed:T=Math.random()*1e3}=c,[P,I]=C==="hard"?[.25,.75]:[0,1],x=o==="in"?[P,I]:[I,P],g=new filters.SimplexNoiseFilter({strength:x[0],noiseScale:h,offsetZ:T,step:C==="hard"?.5:0});return [ee(r,n,g,{strength:x},{...d,aliasToRemoveAfter:u},m)]}async function Ci(r,n,o={},c){return Te(r,n,"noise",o,false,c,(d,u,m)=>kt(r,d,"in",o,u,m,c),d=>on(d,p(o),c))}Ai.noiseDissolveIn=Ci;function on(r,n={},o){return Ce(r,n,false,o,(c,d,u)=>kt(r,c,"out",n,d,u,o))}Ai.noiseDissolveOut=on;function Bt(r,n,o,c,d,u,m){let{lineThickness:C=.02,brightness:h=3,scanlines:T=true}=c,P=n.scale.x,I=n.scale.y,x=I*C,g=o==="in"?[0,.45,1]:[0,.55,1],O=o==="in"?[0,P,P]:[P,P,0],k=o==="in"?[x,x,I]:[I,x,x],D=o==="in"?[h,h,1]:[1,h,h];o==="in"&&n.scale.set(0,x);let $=[f.animate(r,{scaleX:O,scaleY:k},{duration:d.duration,delay:d.delay,ease:d.ease,times:g,completeOnContinue:d.completeOnContinue,aliasToRemoveAfter:u},m),ee(r,n,new filters.AdjustmentFilter({brightness:D[0]}),{brightness:D},{...d,times:g},m)];if(T){let V=o==="in"?[.5,.5,0]:[0,.5,.5];$.push(ee(r,n,new filters.CRTFilter({curvature:0,vignettingAlpha:0,lineWidth:3,lineContrast:V[0],noise:V[0]}),{lineContrast:V,noise:V},{...d,times:g},m));}return $}async function bi(r,n,o={},c){return Te(r,n,"tv",o,false,c,(d,u,m)=>Bt(r,d,"in",o,u,m,c),d=>an(d,p(o),c),true)}Ai.tvIn=bi;function an(r,n={},o){return Ce(r,n,false,o,(c,d,u)=>Bt(r,c,"out",n,d,u,o))}Ai.tvOut=an;function Dt(r,n,o,c,d,u,m){let{strength:C=1,mode:h="pinch",radius:T=St(n),origin:P}=c,I=(h==="bulge"?1:-1)*C,x=Ne(P),g=o==="in"?[I,0]:[0,I],O=new filters.BulgePinchFilter({center:x,radius:T,strength:g[0]});if(h==="bulge"){let{width:D,height:$}=n.getBounds();O.padding=c$1({x:x.x*D,y:x.y*$},T,D,$);}return [ee(r,n,O,{strength:g},{...d,aliasToRemoveAfter:u},m,()=>{let{x:D,y:$,area:V}=Ie(n,x);O.center={x:D/V.width,y:$/V.height};})]}async function Oi(r,n,o={},c){return Te(r,n,"pinch",o,true,c,(d,u,m)=>Dt(r,d,"in",o,u,m,c),d=>b(d,{duration:o.duration,delay:o.delay,ease:o.ease,completeOnContinue:o.completeOnContinue},c))}Ai.pinchIn=Oi;function wi(r,n={},o){return Ce(r,n,true,o,(c,d,u)=>Dt(r,c,"out",n,d,u,o))}Ai.pinchOut=wi;})(pe||={});var Ve=class extends Pe{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 pi(){return async(e,i)=>{try{let s=e.canvasElementInfo;if(s){let a=new Ve(s),p=s.zIndex;a.groupColor=16711680;let y=new we.Graphics;y.rect(0,0,300,100).fill({color:16711680,alpha:.5}),a.addChild(y);let R=new we.Text({text:`Error: ${s.label}`,x:10,y:10});a.addChild(R);let S=e.parent;if(S&&"addChild"in S)p!==void 0?S.addChildAt(a,p):S.addChild(a);else {let l=s.parentLabel?f.find(s.parentLabel):void 0;if(l)p!==void 0?l.addChildAt(a,p):l.addChild(a);else {let v=s.label??s.pixivnId;f.add(v,a,{zIndex:p});}}}}catch{}}}function hi(t,e,i){let s={...f.find(t)?.memory,...i},a=new Ee({text:e,...i});return s&&f.copyCanvasElementProperty(s,a),f.add(t,a,{ignoreOldStyle:true,zIndex:i?.zIndex}),a}var {Assets:So,Color:Eo,Rectangle:Mo,TextStyle:_o,Texture:Ro,UPDATE_PRIORITY:ko}=we,f=new Xe;ae.init({getScreen:()=>f.screen});GameUnifier.addOnPreContinue(async()=>{try{let{tikersIds:t,stepAlias:e}=drainCompleteOnStepEndQueue(),i=(async()=>{for(;t.length;){let{id:a}=t.pop()||{};a&&await tickers$1.forceCompletion(a);}})(),s=(async()=>{for(;e.length;){let{alias:a,id:p}=e.pop()||{};a&&p&&await tickers$1.forceCompletion(p,a);}})();await Promise.all([i,s]);}catch{}});
2
2
  export{So as Assets,at as CanvasBaseItem,ie as CanvasManagerStatic,w as CanvasPropertyUtility,Eo as Color,Pe as Container,Q as ImageContainer,J as ImageSprite,Mo as Rectangle,de as RegisteredCanvasComponents,yt as RegisteredEvents,Se as Sprite,Ee as Text,_o as TextStyle,Ro as Texture,ko as UPDATE_PRIORITY,ye as VideoSprite,ut as addImage,dt as addImageCointainer,Oe as addListenerHandler,ft as addVideo,ge as analizePositionsExtensionProps,f as canvas,gn as canvasComponentDecorator,At as createFilterTransitionApplier,pi as drawCanvasErrorHandler,Ot as effects,pn as eventDecorator,$e as getTexture,ai as moveIn,ci as moveOut,fi as pushIn,li as pushOut,ri as removeWithDissolve,oi as removeWithFade,le as setMemoryContainer,Gn as shakeEffect,ti as showImage,ei as showImageContainer,hi as showText,ni as showVideo,ii as showWithDissolve,si as showWithFade,pe as transitions,di as zoomIn,ui as zoomOut};