@drincs/pixi-vn 1.0.0 → 1.0.2

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 (137) hide show
  1. package/dist/canvas/CanvasManager.cjs +1 -1
  2. package/dist/canvas/CanvasManager.js +1 -1
  3. package/dist/canvas/CanvasManagerStatic.cjs +1 -1
  4. package/dist/canvas/CanvasManagerStatic.js +1 -1
  5. package/dist/canvas/components/Container.cjs +1 -1
  6. package/dist/canvas/components/Container.js +1 -1
  7. package/dist/canvas/components/ImageContainer.cjs +1 -1
  8. package/dist/canvas/components/ImageContainer.js +1 -1
  9. package/dist/canvas/components/ImageSprite.cjs +1 -1
  10. package/dist/canvas/components/ImageSprite.js +1 -1
  11. package/dist/canvas/components/Sprite.cjs +1 -1
  12. package/dist/canvas/components/Sprite.js +1 -1
  13. package/dist/canvas/components/Text.cjs +1 -1
  14. package/dist/canvas/components/Text.js +1 -1
  15. package/dist/canvas/components/VideoSprite.cjs +1 -1
  16. package/dist/canvas/components/VideoSprite.js +1 -1
  17. package/dist/canvas/decorators/canvas-element-decorator.cjs +1 -1
  18. package/dist/canvas/decorators/canvas-element-decorator.js +1 -1
  19. package/dist/canvas/decorators/event-decorator.cjs +1 -1
  20. package/dist/canvas/decorators/event-decorator.d.cts +1 -3
  21. package/dist/canvas/decorators/event-decorator.d.ts +1 -3
  22. package/dist/canvas/decorators/event-decorator.js +1 -1
  23. package/dist/canvas/functions/canvas-effect.cjs +1 -1
  24. package/dist/canvas/functions/canvas-effect.js +1 -1
  25. package/dist/canvas/functions/canvas-import-utility.cjs +1 -1
  26. package/dist/canvas/functions/canvas-import-utility.js +1 -1
  27. package/dist/canvas/functions/canvas-property-utility.cjs +1 -1
  28. package/dist/canvas/functions/canvas-property-utility.js +1 -1
  29. package/dist/canvas/functions/canvas-transition.cjs +1 -1
  30. package/dist/canvas/functions/canvas-transition.js +1 -1
  31. package/dist/canvas/functions/image-container-utility.cjs +1 -1
  32. package/dist/canvas/functions/image-container-utility.js +1 -1
  33. package/dist/canvas/functions/image-utility.cjs +1 -1
  34. package/dist/canvas/functions/image-utility.js +1 -1
  35. package/dist/canvas/functions/ticker-utility.cjs +1 -1
  36. package/dist/canvas/functions/ticker-utility.js +1 -1
  37. package/dist/canvas/functions/video-utility.cjs +1 -1
  38. package/dist/canvas/functions/video-utility.js +1 -1
  39. package/dist/canvas/index.cjs +1 -1
  40. package/dist/canvas/index.js +1 -1
  41. package/dist/canvas/tickers/classes/TickerBase.cjs +1 -1
  42. package/dist/canvas/tickers/classes/TickerBase.js +1 -1
  43. package/dist/canvas/tickers/components/FadeAlphaTicker.cjs +1 -1
  44. package/dist/canvas/tickers/components/FadeAlphaTicker.js +1 -1
  45. package/dist/canvas/tickers/components/MoveTicker.cjs +1 -1
  46. package/dist/canvas/tickers/components/MoveTicker.js +1 -1
  47. package/dist/canvas/tickers/components/RotateTicker.cjs +1 -1
  48. package/dist/canvas/tickers/components/RotateTicker.js +1 -1
  49. package/dist/canvas/tickers/components/ZoomTicker.cjs +1 -1
  50. package/dist/canvas/tickers/components/ZoomTicker.js +1 -1
  51. package/dist/canvas/tickers/decorators/ticker-decorator.cjs +1 -1
  52. package/dist/canvas/tickers/decorators/ticker-decorator.d.cts +1 -3
  53. package/dist/canvas/tickers/decorators/ticker-decorator.d.ts +1 -3
  54. package/dist/canvas/tickers/decorators/ticker-decorator.js +1 -1
  55. package/dist/canvas/tickers/index.cjs +1 -1
  56. package/dist/canvas/tickers/index.js +1 -1
  57. package/dist/character/decorators/character-decorator.cjs +1 -1
  58. package/dist/character/decorators/character-decorator.d.cts +1 -3
  59. package/dist/character/decorators/character-decorator.d.ts +1 -3
  60. package/dist/character/decorators/character-decorator.js +1 -1
  61. package/dist/character/index.cjs +1 -1
  62. package/dist/character/index.js +1 -1
  63. package/dist/constants.cjs +1 -1
  64. package/dist/constants.d.cts +1 -1
  65. package/dist/constants.d.ts +1 -1
  66. package/dist/constants.js +1 -1
  67. package/dist/history/HistoryManager.cjs +1 -1
  68. package/dist/history/HistoryManager.d.cts +1 -1
  69. package/dist/history/HistoryManager.d.ts +1 -1
  70. package/dist/history/HistoryManager.js +1 -1
  71. package/dist/history/HistoryManagerStatic.d.cts +1 -1
  72. package/dist/history/HistoryManagerStatic.d.ts +1 -1
  73. package/dist/history/index.cjs +1 -1
  74. package/dist/history/index.d.cts +1 -1
  75. package/dist/history/index.d.ts +1 -1
  76. package/dist/history/index.js +1 -1
  77. package/dist/history/interfaces/HistoryGameState.d.cts +1 -1
  78. package/dist/history/interfaces/HistoryGameState.d.ts +1 -1
  79. package/dist/history/interfaces/HistoryManagerInterface.d.cts +1 -1
  80. package/dist/history/interfaces/HistoryManagerInterface.d.ts +1 -1
  81. package/dist/{index-Bo5b5ojv.d.cts → index-A4Zf-9mB.d.cts} +4 -4
  82. package/dist/{index-b75SF7z8.d.ts → index-DwELdyJt.d.ts} +4 -4
  83. package/dist/index.cjs +101 -101
  84. package/dist/index.d.cts +4 -3
  85. package/dist/index.d.ts +4 -3
  86. package/dist/index.js +101 -101
  87. package/dist/interfaces/GameState.d.cts +1 -1
  88. package/dist/interfaces/GameState.d.ts +1 -1
  89. package/dist/interfaces/index.d.cts +1 -1
  90. package/dist/interfaces/index.d.ts +1 -1
  91. package/dist/narration/NarrationManager.cjs +32 -32
  92. package/dist/narration/NarrationManager.d.cts +7 -7
  93. package/dist/narration/NarrationManager.d.ts +7 -7
  94. package/dist/narration/NarrationManager.js +32 -32
  95. package/dist/narration/NarrationManagerStatic.cjs +51 -51
  96. package/dist/narration/NarrationManagerStatic.d.cts +1 -1
  97. package/dist/narration/NarrationManagerStatic.d.ts +1 -1
  98. package/dist/narration/NarrationManagerStatic.js +51 -51
  99. package/dist/narration/classes/ChoiceMenuOption.cjs +1 -1
  100. package/dist/narration/classes/ChoiceMenuOption.js +1 -1
  101. package/dist/narration/classes/CloseLabel.cjs +1 -1
  102. package/dist/narration/classes/CloseLabel.d.cts +1 -1
  103. package/dist/narration/classes/CloseLabel.d.ts +1 -1
  104. package/dist/narration/classes/CloseLabel.js +1 -1
  105. package/dist/narration/classes/Label.cjs +1 -1
  106. package/dist/narration/classes/Label.js +1 -1
  107. package/dist/narration/classes/LabelAbstract.cjs +1 -1
  108. package/dist/narration/classes/LabelAbstract.d.cts +2 -6
  109. package/dist/narration/classes/LabelAbstract.d.ts +2 -6
  110. package/dist/narration/classes/LabelAbstract.js +1 -1
  111. package/dist/narration/decorators/label-decorator.cjs +1 -1
  112. package/dist/narration/decorators/label-decorator.d.cts +17 -28
  113. package/dist/narration/decorators/label-decorator.d.ts +17 -28
  114. package/dist/narration/decorators/label-decorator.js +1 -1
  115. package/dist/narration/decorators/newLabel.cjs +1 -0
  116. package/dist/narration/decorators/newLabel.d.cts +18 -0
  117. package/dist/narration/decorators/newLabel.d.ts +18 -0
  118. package/dist/narration/decorators/newLabel.js +1 -0
  119. package/dist/narration/index.cjs +49 -49
  120. package/dist/narration/index.d.cts +3 -2
  121. package/dist/narration/index.d.ts +3 -2
  122. package/dist/narration/index.js +49 -49
  123. package/dist/narration/interfaces/HistoryStep.d.cts +1 -1
  124. package/dist/narration/interfaces/HistoryStep.d.ts +1 -1
  125. package/dist/narration/interfaces/NarrationGameState.d.cts +1 -1
  126. package/dist/narration/interfaces/NarrationGameState.d.ts +1 -1
  127. package/dist/narration/interfaces/NarrationManagerInterface.d.cts +7 -7
  128. package/dist/narration/interfaces/NarrationManagerInterface.d.ts +7 -7
  129. package/dist/narration/types/ChoiceMenuOptionsType.d.cts +1 -1
  130. package/dist/narration/types/ChoiceMenuOptionsType.d.ts +1 -1
  131. package/dist/pixi-devtools/additionalPositionsProperties.cjs +1 -1
  132. package/dist/pixi-devtools/additionalPositionsProperties.js +1 -1
  133. package/dist/sound/SoundManager.cjs +48 -48
  134. package/dist/sound/SoundManager.js +48 -48
  135. package/dist/sound/index.cjs +48 -48
  136. package/dist/sound/index.js +48 -48
  137. package/package.json +1 -1
@@ -3307,4 +3307,4 @@ fn setSaturation(c: vec3<f32>, s: f32) -> vec3<f32> {
3307
3307
  u32v[offset + stride] = c;
3308
3308
  u32v[offset + (stride * 2)] = c;
3309
3309
  u32v[offset + (stride * 3)] = c;
3310
- `,dynamic:false}};});var uk,eB,tB,rB=d(()=>{at();_r();$1();uk=new ue(0,0,0,0),eB=class q1 extends Le{constructor(e={}){e={...q1.defaultOptions,...e,dynamicProperties:{...q1.defaultOptions.dynamicProperties,...e?.dynamicProperties}};let{dynamicProperties:t,shader:i,roundPixels:s,texture:n,particles:o,...a}=e;super({label:"ParticleContainer",...a}),this.renderPipeId="particle",this.batched=false,this._childrenDirty=false,this.texture=n||null,this.shader=i,this._properties={};for(let u in Th){let l=Th[u],c=t[u];this._properties[u]={...l,dynamic:c};}this.allowChildren=true,this.roundPixels=s??false,this.particleChildren=o??[];}addParticle(...e){for(let t=0;t<e.length;t++)this.particleChildren.push(e[t]);return this.onViewUpdate(),e[0]}removeParticle(...e){let t=false;for(let i=0;i<e.length;i++){let s=this.particleChildren.indexOf(e[i]);s>-1&&(this.particleChildren.splice(s,1),t=true);}return t&&this.onViewUpdate(),e[0]}update(){this._childrenDirty=true;}onViewUpdate(){this._childrenDirty=true,super.onViewUpdate();}get bounds(){return uk}updateBounds(){}destroy(e=false){if(super.destroy(e),typeof e=="boolean"?e:e?.texture){let i=typeof e=="boolean"?e:e?.textureSource,s=this.texture??this.particleChildren[0]?.texture;s&&s.destroy(i);}this.texture=null,this.shader?.destroy();}removeParticles(e,t){let i=this.particleChildren.splice(e,t);return this.onViewUpdate(),i}removeParticleAt(e){let t=this.particleChildren.splice(e,1);return this.onViewUpdate(),t[0]}addParticleAt(e,t){return this.particleChildren.splice(t,0,e),this.onViewUpdate(),e}addChild(...e){throw new Error("ParticleContainer.addChild() is not available. Please use ParticleContainer.addParticle()")}removeChild(...e){throw new Error("ParticleContainer.removeChild() is not available. Please use ParticleContainer.removeParticle()")}removeChildren(e,t){throw new Error("ParticleContainer.removeChildren() is not available. Please use ParticleContainer.removeParticles()")}removeChildAt(e){throw new Error("ParticleContainer.removeChildAt() is not available. Please use ParticleContainer.removeParticleAt()")}getChildAt(e){throw new Error("ParticleContainer.getChildAt() is not available. Please use ParticleContainer.getParticleAt()")}setChildIndex(e,t){throw new Error("ParticleContainer.setChildIndex() is not available. Please use ParticleContainer.setParticleIndex()")}getChildIndex(e){throw new Error("ParticleContainer.getChildIndex() is not available. Please use ParticleContainer.getParticleIndex()")}addChildAt(e,t){throw new Error("ParticleContainer.addChildAt() is not available. Please use ParticleContainer.addParticleAt()")}swapChildren(e,t){throw new Error("ParticleContainer.swapChildren() is not available. Please use ParticleContainer.swapParticles()")}reparentChild(...e){throw new Error("ParticleContainer.reparentChild() is not available with the particle container")}reparentChildAt(e,t){throw new Error("ParticleContainer.reparentChildAt() is not available with the particle container")}};eB.defaultOptions={dynamicProperties:{vertex:false,position:true,rotation:false,uvs:false,color:false},roundPixels:false};tB=eB;});var iB,j1,Ox,nB=d(()=>{Ai();se();ce();_r();Wp();iB=class sB extends Le{constructor(e){e instanceof A&&(e={texture:e});let{width:t,height:i,anchor:s,leftWidth:n,rightWidth:o,topHeight:a,bottomHeight:u,texture:l,roundPixels:c,...h}=e;super({label:"NineSliceSprite",...h}),this.renderPipeId="nineSliceSprite",this.batched=true,this._leftWidth=n??l?.defaultBorders?.left??Pr.defaultOptions.leftWidth,this._topHeight=a??l?.defaultBorders?.top??Pr.defaultOptions.topHeight,this._rightWidth=o??l?.defaultBorders?.right??Pr.defaultOptions.rightWidth,this._bottomHeight=u??l?.defaultBorders?.bottom??Pr.defaultOptions.bottomHeight,this._width=t??l.width??Pr.defaultOptions.width,this._height=i??l.height??Pr.defaultOptions.height,this.allowChildren=false,this.texture=l??sB.defaultOptions.texture,this.roundPixels=c??false,this._anchor=new ve({_onUpdate:()=>{this.onViewUpdate();}}),s?this.anchor=s:this.texture.defaultAnchor&&(this.anchor=this.texture.defaultAnchor);}get anchor(){return this._anchor}set anchor(e){typeof e=="number"?this._anchor.set(e):this._anchor.copyFrom(e);}get width(){return this._width}set width(e){this._width=e,this.onViewUpdate();}get height(){return this._height}set height(e){this._height=e,this.onViewUpdate();}setSize(e,t){typeof e=="object"&&(t=e.height??e.width,e=e.width),this._width=e,this._height=t??e,this.onViewUpdate();}getSize(e){return e||(e={}),e.width=this._width,e.height=this._height,e}get leftWidth(){return this._leftWidth}set leftWidth(e){this._leftWidth=e,this.onViewUpdate();}get topHeight(){return this._topHeight}set topHeight(e){this._topHeight=e,this.onViewUpdate();}get rightWidth(){return this._rightWidth}set rightWidth(e){this._rightWidth=e,this.onViewUpdate();}get bottomHeight(){return this._bottomHeight}set bottomHeight(e){this._bottomHeight=e,this.onViewUpdate();}get texture(){return this._texture}set texture(e){e||(e=A.EMPTY);let t=this._texture;t!==e&&(t&&t.dynamic&&t.off("update",this.onViewUpdate,this),e.dynamic&&e.on("update",this.onViewUpdate,this),this._texture=e,this.onViewUpdate());}get originalWidth(){return this._texture.width}get originalHeight(){return this._texture.height}destroy(e){if(super.destroy(e),typeof e=="boolean"?e:e?.texture){let i=typeof e=="boolean"?e:e?.textureSource;this._texture.destroy(i);}this._texture=null;}updateBounds(){let e=this._bounds,t=this._anchor,i=this._width,s=this._height;e.minX=-t._x*i,e.maxX=e.minX+i,e.minY=-t._y*s,e.maxY=e.minY+s;}};iB.defaultOptions={texture:A.EMPTY};j1=iB,Ox=class extends j1{constructor(...e){let t=e[0];t instanceof A&&(M(U,"NineSlicePlane now uses the options object {texture, leftWidth, rightWidth, topHeight, bottomHeight}"),t={texture:t,leftWidth:e[1],topHeight:e[2],rightWidth:e[3],bottomHeight:e[4]}),M(U,"NineSlicePlane is deprecated. Use NineSliceSprite instead."),super(t);}};});function oB(r,e){return e instanceof ze||e instanceof Cr?e:r==="html"?new Cr(e):new ze(e)}var aB=d(()=>{ql();ci();});async function uB(r,e,t=200){let i=await e.extract.base64(r);await e.encoder.commandFinished;let s=t;console.log(`logging texture ${r.source.width}px ${r.source.height}px`);let n=["font-size: 1px;",`padding: ${s}px 300px;`,`background: url(${i}) no-repeat;`,"background-size: contain;"].join(" ");console.log("%c ",n);}var lB=d(()=>{});function K1(r,e=0,t={color:"#000000"}){r.renderGroup&&(t.color=lk[ck++]);let i="";for(let o=0;o<e;o++)i+=" ";let s=r.label;!s&&r instanceof xe&&(s=`sprite:${r.texture.label}`);let n=`%c ${i}|- ${s} (worldX:${r.worldTransform.tx}, relativeRenderX:${r.relativeGroupTransform.tx}, renderX:${r.groupTransform.tx}, localX:${r.x})`;r.renderGroup&&(n+=" (RenderGroup)"),r.filters&&(n+="(*filters)"),console.log(n,`color:${t.color}; font-weight:bold;`),e++;for(let o=0;o<r.children.length;o++){let a=r.children[o];K1(a,e,{...t});}}function Z1(r,e=0,t={index:0,color:"#000000"}){let i="";for(let n=0;n<e;n++)i+=" ";let s=`%c ${i}- ${t.index}: ${r.root.label} worldX:${r.worldTransform.tx}`;console.log(s,`color:${t.color}; font-weight:bold;`),e++;for(let n=0;n<r.renderGroupChildren.length;n++){let o=r.renderGroupChildren[n];Z1(o,e,{...t,index:n});}}var lk,ck,cB=d(()=>{Oi();lk=["#000080","#228B22","#8B0000","#4169E1","#008080","#800000","#9400D3","#FF8C00","#556B2F","#8B008B"],ck=0;});var hB={};Hh(hB,{AbstractBitmapFont:()=>os,AbstractRenderer:()=>Ur,AbstractText:()=>Xr,AccessibilitySystem:()=>Ed,AlphaFilter:()=>P3,AlphaMask:()=>js,AlphaMaskPipe:()=>Gn,AnimatedSprite:()=>Du,Application:()=>Oc,ApplicationInitHook:()=>kn,Assets:()=>Xe,AssetsClass:()=>zc,BLEND_TO_NPM:()=>qd,BUFFER_TYPE:()=>oo,BackgroundLoader:()=>nu,BackgroundSystem:()=>cm,Batch:()=>yl,BatchGeometry:()=>qo,BatchTextureArray:()=>$o,BatchableGraphics:()=>li,BatchableMesh:()=>Fr,BatchableSprite:()=>or,Batcher:()=>Kd,BatcherPipe:()=>Sc,BigPool:()=>X,BindGroup:()=>je,BindGroupSystem:()=>zn,BitmapFont:()=>_o,BitmapFontManager:()=>di,BitmapText:()=>Fu,BitmapTextPipe:()=>xn,BlendModeFilter:()=>Z,BlendModePipe:()=>Ln,BlurFilter:()=>fh,BlurFilterPass:()=>Mu,Bounds:()=>ue,BrowserAdapter:()=>Dd,Buffer:()=>Ce,BufferImageSource:()=>ii,BufferResource:()=>Hr,BufferUsage:()=>K,CLEAR:()=>Ke,Cache:()=>oe,CanvasPool:()=>_t,CanvasPoolClass:()=>Ol,CanvasSource:()=>Qe,CanvasTextMetrics:()=>kt,CanvasTextPipe:()=>dn,CanvasTextSystem:()=>gn,Circle:()=>pa,Color:()=>z,ColorBlend:()=>Jl,ColorBurnBlend:()=>ec,ColorDodgeBlend:()=>tc,ColorMask:()=>Ks,ColorMaskPipe:()=>On,ColorMatrixFilter:()=>_x,CompressedSource:()=>lr,Container:()=>$,Culler:()=>Jg,CullerPlugin:()=>Qc,CustomRenderPipe:()=>wn,D3D10_RESOURCE_DIMENSION:()=>Xg,D3DFMT:()=>Bt,DATA_URI:()=>dC,DDS:()=>q,DEG_TO_RAD:()=>$h,DEPRECATED_SCALE_MODES:()=>vh,DEPRECATED_WRAP_MODES:()=>yh,DOMAdapter:()=>H,DOMContainer:()=>Md,DOMPipe:()=>$s,DRAW_MODES:()=>nw,DXGI_FORMAT:()=>zg,DXGI_TO_TEXTURE_FORMAT:()=>vt,DarkenBlend:()=>rc,DefaultBatcher:()=>tn,DefaultShader:()=>Jo,DifferenceBlend:()=>ic,DisplacementFilter:()=>vx,DivideBlend:()=>sc,DynamicBitmapFont:()=>Yl,Ellipse:()=>ma,EventBoundary:()=>Lo,EventEmitter:()=>re,EventSystem:()=>No,EventsTicker:()=>Kt,ExclusionBlend:()=>nc,ExtensionType:()=>m,ExtractSystem:()=>hm,FOURCC_TO_TEXTURE_FORMAT:()=>jc,FederatedContainer:()=>Rd,FederatedEvent:()=>Dr,FederatedMouseEvent:()=>xr,FederatedPointerEvent:()=>ut,FederatedWheelEvent:()=>Zt,FillGradient:()=>It,FillPattern:()=>Sr,Filter:()=>st,FilterEffect:()=>pr,FilterPipe:()=>Tn,FilterSystem:()=>Sn,FontStylePromiseCache:()=>Pa,GAUSSIAN_VALUES:()=>Ru,GL_FORMATS:()=>Ka,GL_INTERNAL_FORMAT:()=>zT,GL_TARGETS:()=>Rc,GL_TYPES:()=>ae,GL_WRAP_MODES:()=>y2,GenerateTextureSystem:()=>Nn,Geometry:()=>gt,GlBackBufferSystem:()=>Vm,GlBatchAdaptor:()=>no,GlBuffer:()=>ja,GlBufferSystem:()=>ao,GlColorMaskSystem:()=>lo,GlContextSystem:()=>Lm,GlEncoderSystem:()=>co,GlGeometrySystem:()=>uo,GlGraphicsAdaptor:()=>io,GlMeshAdaptor:()=>so,GlParticleContainerAdaptor:()=>ua,GlParticleContainerPipe:()=>ln,GlProgram:()=>Pe,GlProgramData:()=>Ja,GlRenderTarget:()=>Za,GlRenderTargetAdaptor:()=>Qa,GlRenderTargetSystem:()=>po,GlShaderSystem:()=>mo,GlStateSystem:()=>lg,GlStencilSystem:()=>ho,GlTexture:()=>tu,GlTextureSystem:()=>xo,GlUboSystem:()=>fo,GlUniformGroupSystem:()=>go,GlobalUniformSystem:()=>Hn,GpuBatchAdaptor:()=>Pn,GpuBlendModesToPixi:()=>ht,GpuBufferSystem:()=>Xn,GpuColorMaskSystem:()=>Yn,GpuDeviceSystem:()=>gs,GpuEncoderSystem:()=>$n,GpuGraphicsAdaptor:()=>An,GpuGraphicsContext:()=>Ml,GpuMeshAdapter:()=>Cn,GpuMipmapGenerator:()=>qa,GpuParticleContainerAdaptor:()=>ha,GpuParticleContainerPipe:()=>cn,GpuProgram:()=>we,GpuReadBuffer:()=>rw,GpuRenderTarget:()=>Xa,GpuRenderTargetAdaptor:()=>Ya,GpuRenderTargetSystem:()=>Jn,GpuShaderSystem:()=>eo,GpuStateSystem:()=>to,GpuStencilModesToPixi:()=>ur,GpuStencilSystem:()=>qn,GpuTextureSystem:()=>ro,GpuUboSystem:()=>Kn,GpuUniformBatchPipe:()=>Zn,Graphics:()=>ns,GraphicsContext:()=>We,GraphicsContextRenderData:()=>Dl,GraphicsContextSystem:()=>Ji,GraphicsPath:()=>ar,GraphicsPipe:()=>an,HTMLText:()=>Gu,HTMLTextPipe:()=>_n,HTMLTextRenderData:()=>as,HTMLTextStyle:()=>Cr,HTMLTextSystem:()=>us,HardLightBlend:()=>oc,HardMixBlend:()=>ac,HelloSystem:()=>ms,IGLUniformData:()=>qm,ImageSource:()=>mt,InstructionSet:()=>Bi,KTX:()=>Fe,LightenBlend:()=>uc,LinearBurnBlend:()=>lc,LinearDodgeBlend:()=>cc,LinearLightBlend:()=>hc,Loader:()=>au,LoaderParserPriority:()=>Se,LuminosityBlend:()=>dc,MSAA_QUALITY:()=>N1,MaskEffectManager:()=>Mo,MaskEffectManagerClass:()=>rl,MaskFilter:()=>Fa,Matrix:()=>R,Mesh:()=>Lt,MeshGeometry:()=>bt,MeshPipe:()=>un,MeshPlane:()=>kx,MeshRope:()=>Yw,MeshSimple:()=>Gx,NOOP:()=>ol,NegationBlend:()=>fc,NineSliceGeometry:()=>Pr,NineSlicePlane:()=>Ox,NineSliceSprite:()=>j1,NineSliceSpritePipe:()=>vn,NoiseFilter:()=>G3,ObservablePoint:()=>ve,OverlayBlend:()=>pc,PI_2:()=>Xh,Particle:()=>Qw,ParticleBuffer:()=>la,ParticleContainer:()=>tB,ParticleContainerPipe:()=>es,ParticleShader:()=>ca,PerspectiveMesh:()=>Lw,PerspectivePlaneGeometry:()=>Uu,PinLightBlend:()=>mc,PipelineSystem:()=>Qn,PlaneGeometry:()=>cs,Point:()=>Q,Polygon:()=>rs,Pool:()=>ti,PoolGroupClass:()=>el,PrepareBase:()=>Ex,PrepareQueue:()=>ku,PrepareSystem:()=>bh,PrepareUpload:()=>Ou,QuadGeometry:()=>Ra,RAD_TO_DEG:()=>Yh,Rectangle:()=>Y,RenderContainer:()=>Rx,RenderGroup:()=>Go,RenderGroupPipe:()=>Rn,RenderGroupSystem:()=>Dn,RenderLayer:()=>Dw,RenderLayerClass:()=>H1,RenderTarget:()=>Wn,RenderTargetSystem:()=>bs,RenderTexture:()=>Ga,RenderableGCSystem:()=>mm,RendererInitHook:()=>Fn,RendererType:()=>Be,ResizePlugin:()=>zs,Resolver:()=>ct,RopeGeometry:()=>Fx,RoundedRectangle:()=>ga,SCALE_MODES:()=>cw,STENCIL_MODES:()=>Te,SVGParser:()=>cp,SaturationBlend:()=>gc,SchedulerSystem:()=>Vn,ScissorMask:()=>wx,SdfShader:()=>Ea,Shader:()=>Ie,ShaderStage:()=>Yi,ShapePath:()=>ya,SharedRenderPipes:()=>Na,SharedSystems:()=>La,SoftLightBlend:()=>xc,Sprite:()=>xe,SpritePipe:()=>In,Spritesheet:()=>ml,State:()=>Me,StencilMask:()=>Zs,StencilMaskPipe:()=>Un,SubtractBlend:()=>_c,SystemRunner:()=>fs,TEXTURE_FORMAT_BLOCK_SIZE:()=>Yg,Text:()=>cr,TextStyle:()=>ze,Texture:()=>A,TextureGCSystem:()=>gm,TextureMatrix:()=>Mi,TexturePool:()=>de,TexturePoolClass:()=>al,TextureSource:()=>ie,TextureStyle:()=>Fo,TextureUvs:()=>Bx,Ticker:()=>fe,TickerListener:()=>Ii,TickerPlugin:()=>Ys,TilingSprite:()=>Cx,TilingSpritePipe:()=>yn,TilingSpriteShader:()=>Ba,Transform:()=>Iu,Triangle:()=>Sx,UNIFORM_TO_ARRAY_SETTERS:()=>og,UNIFORM_TO_SINGLE_SETTERS:()=>ng,UNIFORM_TYPES_MAP:()=>bf,UNIFORM_TYPES_VALUES:()=>Cl,UPDATE_BLEND:()=>Oo,UPDATE_COLOR:()=>Ws,UPDATE_PRIORITY:()=>wt,UPDATE_TRANSFORM:()=>ZS,UPDATE_VISIBLE:()=>Di,UboBatch:()=>Wa,UboSystem:()=>xs,UniformGroup:()=>ee,VERSION:()=>ps,VideoSource:()=>Ni,ViewContainer:()=>Le,ViewSystem:()=>bm,ViewableBuffer:()=>Qt,VividLightBlend:()=>bc,WGSL_ALIGN_SIZE_DATA:()=>jn,WGSL_TO_STD40_SIZE:()=>Mc,WRAP_MODES:()=>lw,WebGLRenderer:()=>Gc,WebGPURenderer:()=>Bc,WebWorkerAdapter:()=>S3,WorkerManager:()=>Wc,_getGlobalBounds:()=>nd,accessibilityTarget:()=>Ad,addBits:()=>Tl,addMaskBounds:()=>Ui,addMaskLocalBounds:()=>Li,addProgramDefines:()=>ef,alphaFrag:()=>cx,alphaWgsl:()=>dh,applyMatrix:()=>Np,applyProjectiveTransformationToPlane:()=>Mx,applyStyleParams:()=>Fc,assignWithIgnore:()=>Vs,autoDetectEnvironment:()=>aC,autoDetectRenderer:()=>bg,autoDetectSource:()=>SE,basisTranscoderUrls:()=>xu,bgr2rgb:()=>ri,bitmapFontCachePlugin:()=>yg,bitmapFontTextParser:()=>su,bitmapFontXMLParser:()=>Uc,bitmapFontXMLStringParser:()=>Lc,blendTemplateFrag:()=>Xp,blendTemplateVert:()=>Yp,blendTemplateWgsl:()=>$p,blockDataMap:()=>wc,blurTemplateWgsl:()=>mx,boundsPool:()=>Pt,browserExt:()=>$0,buildAdaptiveBezier:()=>_a,buildAdaptiveQuadratic:()=>ep,buildArc:()=>ba,buildArcTo:()=>rp,buildArcToSvg:()=>ip,buildCircle:()=>sr,buildContextBatches:()=>Vf,buildEllipse:()=>Af,buildGeometryFromPath:()=>ww,buildLine:()=>Mf,buildPixelLine:()=>Df,buildPolygon:()=>sa,buildRectangle:()=>na,buildRoundedRectangle:()=>Cf,buildSimpleUvs:()=>ta,buildTriangle:()=>oa,buildUvs:()=>ea,cacheAsTextureMixin:()=>Zh,cacheTextureArray:()=>Tg,calculateProjection:()=>Dm,checkChildrenDidChange:()=>sl,checkDataUrl:()=>Ft,checkExtension:()=>ke,checkMaxIfStatementsInShader:()=>Xd,childrenHelperMixin:()=>Jh,cleanArray:()=>pm,cleanHash:()=>fm,clearList:()=>Mn,closePointEps:()=>wf,collectAllRenderables:()=>yw,collectRenderablesMixin:()=>ed,color32BitToUniform:()=>nr,colorBit:()=>qi,colorBitGl:()=>ji,colorMatrixFilterFrag:()=>xx,colorMatrixFilterWgsl:()=>ph,colorToUniform:()=>QE,compareModeToGlCompare:()=>mg,compileHighShader:()=>hf,compileHighShaderGl:()=>df,compileHighShaderGlProgram:()=>er,compileHighShaderGpuProgram:()=>Jt,compileHooks:()=>Sl,compileInputs:()=>El,compileOutputs:()=>cf,compileShader:()=>Dc,compute2DProjection:()=>Ix,convertFormatIfRequired:()=>gP,convertToList:()=>lt,copySearchParams:()=>qs,createIdFromString:()=>Tr,createIndicesForQuads:()=>Fl,createLevelBuffers:()=>rP,createLevelBuffersFromKTX:()=>_P,createStringVariations:()=>Id,createTexture:()=>yt,createUboElementsSTD40:()=>Wm,createUboElementsWGSL:()=>Tm,createUboSyncFunction:()=>Ha,createUboSyncFunctionSTD40:()=>Ym,createUboSyncFunctionWGSL:()=>Bm,crossOrigin:()=>DT,cullingMixin:()=>zh,curveEps:()=>Bf,defaultFilterVert:()=>As,defaultValue:()=>eu,definedProps:()=>rt,deprecation:()=>M,detectAvif:()=>Eg,detectBasis:()=>jC,detectCompressed:()=>AP,detectDefaults:()=>Ag,detectMp4:()=>Cg,detectOgv:()=>Pg,detectVideoAlphaMode:()=>Wo,detectWebm:()=>wg,detectWebp:()=>Bg,determineCrossOrigin:()=>kT,displacementFrag:()=>bx,displacementVert:()=>yx,displacementWgsl:()=>mh,earcut:()=>dB.default,effectsMixin:()=>td,ensureAttributes:()=>za,ensureIsBuffer:()=>vl,ensurePrecision:()=>tf,ensureTextOptions:()=>Cs,ensureTextStyle:()=>oB,executeInstructions:()=>Bn,extensions:()=>k,extractAttributesFromGlProgram:()=>Jm,extractAttributesFromGpuProgram:()=>of,extractFontFamilies:()=>Bp,extractStructAndGroups:()=>Ko,extractSvgUrlId:()=>Vl,fastCopy:()=>en,findHooksRx:()=>Nb,findMixin:()=>rd,fontStringFromTextStyle:()=>hi,formatShader:()=>j3,fragmentGPUTemplate:()=>pf,fragmentGlTemplate:()=>gf,generateArraySyncSTD40:()=>Xm,generateArraySyncWGSL:()=>wm,generateBlurFragSource:()=>dx,generateBlurGlProgram:()=>px,generateBlurProgram:()=>gx,generateBlurVertSource:()=>fx,generateGPULayout:()=>X3,generateGpuLayoutGroups:()=>af,generateLayout:()=>$3,generateLayoutHash:()=>uf,generateParticleUpdateFunction:()=>Wf,generateProgram:()=>ig,generateShaderSyncCode:()=>$m,generateTextStyleKey:()=>va,generateTextureBatchBit:()=>Ki,generateTextureBatchBitGl:()=>Zi,generateTextureMatrix:()=>Hf,generateUID:()=>fw,generateUniformsSync:()=>ag,getAdjustedBlendModeBlend:()=>yr,getAttributeInfoFromFormat:()=>xt,getBatchSamplersUniformGroup:()=>Qi,getBitmapTextLayout:()=>Ca,getCanvasBoundingBox:()=>qf,getCanvasFillStyle:()=>ss,getCanvasTexture:()=>Ua,getDefaultUniformValue:()=>yf,getFastGlobalBounds:()=>xw,getFastGlobalBoundsMixin:()=>sd,getFontCss:()=>Mp,getFontFamilyName:()=>AT,getGeometryBounds:()=>Zd,getGlTypeFromFormat:()=>Hm,getGlobalBounds:()=>Mr,getGlobalMixin:()=>ud,getGlobalRenderableBounds:()=>zp,getLocalBounds:()=>wi,getMatrixRelativeToParent:()=>Ud,getMaxFragmentPrecision:()=>Jd,getMaxTexturesPerBatch:()=>Mt,getOrientationOfPoints:()=>Rf,getParent:()=>E_,getPo2TextureFromSource:()=>Sa,getResolutionOfUrl:()=>Ts,getSVGUrl:()=>Dp,getSupportedCompressedTextureFormats:()=>pu,getSupportedGPUCompressedTextureFormats:()=>Yc,getSupportedGlCompressedTextureFormats:()=>Xc,getSupportedTextureFormats:()=>Vr,getTemporaryCanvasFromImage:()=>Ip,getTestContext:()=>zo,getTextureBatchBindGroup:()=>Vi,getTextureDefaultMatrix:()=>jw,getTextureFormatFromKTXTexture:()=>yP,getUboData:()=>eg,getUniformData:()=>tg,getUrlExtension:()=>tb,glFormatToGPUFormat:()=>Kg,glUploadBufferImageResource:()=>cg,glUploadCompressedTextureResource:()=>hg,glUploadImageResource:()=>ru,glUploadVideoResource:()=>fg,globalUniformsBit:()=>xf,globalUniformsBitGl:()=>_f,globalUniformsUBOBitGl:()=>GE,gpuFormatToBasisTranscoderFormat:()=>sP,gpuFormatToKTXBasisTranscoderFormat:()=>TP,gpuUploadBufferImageResource:()=>Fm,gpuUploadCompressedTextureResource:()=>Gm,gpuUploadImageResource:()=>$a,gpuUploadVideoResource:()=>Um,groupD8:()=>te,hasCachedCanvasTexture:()=>vC,hslWgsl:()=>U3,hslgl:()=>hs,hslgpu:()=>ds,injectBits:()=>Al,insertVersion:()=>rf,isMobile:()=>Td,isPow2:()=>nl,isRenderingToScreen:()=>Im,isSafari:()=>Ep,isSingleItem:()=>ni,isWebGLSupported:()=>Lr,isWebGPUSupported:()=>Nr,ktxTranscoderUrls:()=>bu,loadBasis:()=>eP,loadBasisOnWorker:()=>Wg,loadBitmapFont:()=>vg,loadDDS:()=>oP,loadEnvironmentExtensions:()=>yc,loadFontAsBase64:()=>Rp,loadFontCSS:()=>jl,loadImageBitmap:()=>MT,loadJson:()=>Rg,loadKTX:()=>uP,loadKTX2:()=>fP,loadKTX2onWorker:()=>jg,loadSVGImage:()=>kp,loadSvg:()=>Ig,loadTextures:()=>hu,loadTxt:()=>Mg,loadVideoTextures:()=>Fg,loadWebFont:()=>Dg,localUniformBit:()=>pi,localUniformBitGl:()=>ls,localUniformBitGroup2:()=>Gp,localUniformMSDFBit:()=>gp,localUniformMSDFBitGl:()=>xp,log2:()=>WS,logDebugTexture:()=>uB,logProgramError:()=>rg,logRenderGroupScene:()=>Z1,logScene:()=>K1,mSDFBit:()=>_p,mSDFBitGl:()=>bp,mapFormatToGlFormat:()=>gg,mapFormatToGlInternalFormat:()=>xg,mapFormatToGlType:()=>_g,mapGlToVertexFormat:()=>Zm,mapSize:()=>ew,mapType:()=>Ic,mapWebGLBlendModesToPixi:()=>ug,maskFrag:()=>um,maskVert:()=>lm,maskWgsl:()=>Ec,matrixPool:()=>Ue,measureHtmlText:()=>wa,measureMixin:()=>cd,migrateFragmentFromV7toV8:()=>Q3,mipmapScaleModeToGlFilter:()=>pg,mixHexColors:()=>Tw,multiplyColors:()=>Pi,multiplyHexColors:()=>Io,nextPow2:()=>mr,noiseFrag:()=>Tx,noiseWgsl:()=>gh,nonCompressedFormats:()=>LT,normalizeExtensionPriority:()=>wo,nssvg:()=>Ap,nsxhtml:()=>Cp,onRenderMixin:()=>hd,parseAttribute:()=>lp,parseDDS:()=>$g,parseFunctionBody:()=>mw,parseKTX:()=>qg,parseSVGDefinitions:()=>ap,parseSVGFloatAttribute:()=>Re,parseSVGPath:()=>jf,parseSVGStyle:()=>Wl,particleData:()=>Th,particlesFrag:()=>zf,particlesVert:()=>Xf,particlesWgsl:()=>Gl,path:()=>Ee,pointInTriangle:()=>xh,preloadVideo:()=>IT,removeItems:()=>Ro,removeStructAndGroupDuplicates:()=>lf,resetUids:()=>OS,resolveCharacters:()=>Aa,resolveCompressedTextureUrl:()=>EP,resolveJsonUrl:()=>Og,resolveTextureUrl:()=>du,resourceToTexture:()=>hb,roundPixelsBit:()=>tr,roundPixelsBitGl:()=>rr,roundedShapeArc:()=>sp,roundedShapeQuadraticCurve:()=>np,sayHello:()=>dm,scaleModeToGlFilter:()=>kc,setBasisTranscoderPath:()=>QC,setKTXTranscoderPath:()=>hP,setPositions:()=>Lp,setProgramName:()=>sf,setUvs:()=>Hp,shapeBuilders:()=>aa,sortMixin:()=>dd,spritesheetAsset:()=>Fd,squaredDistanceToLineSegment:()=>ts,stripVersion:()=>nf,styleAttributes:()=>up,testImageFormat:()=>ou,testVideoFormat:()=>ys,textStyleToCSS:()=>wp,textureBit:()=>Qp,textureBitGl:()=>Jp,textureFrom:()=>db,tilingBit:()=>Op,tilingBitGl:()=>Up,toFillStyle:()=>Er,toLocalGlobalMixin:()=>fd,toStrokeStyle:()=>is,transformVertices:()=>rn,triangulateWithHoles:()=>ia,uboSyncFunctionsSTD40:()=>Cc,uboSyncFunctionsWGSL:()=>Cm,uid:()=>J,uniformParsers:()=>wr,unpremultiplyAlpha:()=>IC,unsafeEvalSupported:()=>Ma,updateLocalTransform:()=>Ew,updateQuadBounds:()=>Vo,updateRenderGroupTransform:()=>ov,updateRenderGroupTransforms:()=>Tc,updateTextBounds:()=>hn,updateTransformAndChildren:()=>sm,updateTransformBackwards:()=>Do,updateWorldTransform:()=>Cw,v8_0_0:()=>U,v8_3_4:()=>jh,validFormats:()=>yu,validateRenderables:()=>nm,vertexGPUTemplate:()=>ff,vertexGlTemplate:()=>mf,viewportFromFrame:()=>aw,vkFormatToGPUFormat:()=>Zg,warn:()=>I,webworkerExt:()=>q0,wrapModeToGlAddress:()=>iu});var dB,pe=d(()=>{FA();OA();S();S();Vd();Gd();H_();V_();NA();HA();VA();WA();zA();XA();YA();$A();qA();jA();KA();ZA();QA();JA();eC();tC();rC();iC();sC();nC();oC();HC();W_();X_();qC();pT();Ir();mT();gT();xT();_T();bT();yT();vT();Sg();Nc();TT();Vt();ST();ET();CT();PT();kg();FT();mi();RT();GT();Gg();Gi();vs();Yt();Ho();kd();eb();fl();qe();KC();tP();iP();nP();NT();HT();VT();aP();WT();lP();YT();XT();pP();xP();bP();vP();KT();SP();$T();ZT();qT();CP();QT();e1();PP();p_();gE();Q_();be();ev();J_();E3();q_();Bd();Cd();ul();Z_();cl();Pd();wd();K0();Z0();Q0();L3();g1();x1();v1();E1();A1();hh();C1();P1();w1();B1();R1();fv();pv();mv();Oe();Zl();Ql();w3();M3();S1();hx();_1();y1();b1();T1();D3();I3();O3();Or();tl();W0();X0();gv();xd();ne();qh();ko();Kf();Ai();Ct();M1();Hy();Vy();Wy();He();zy();N3();D1();G1();z3();L1();p2();pb();Hi();Y3();q3();_l();iv();_b();dv();vb();gb();vf();Jb();ai();Yb();Lb();Hb();Vb();Wb();K3();zb();$b();Zo();Qo();qb();bn();ui();em();sb();_v();nb();bv();b_();Z3();ob();yv();gl();xl();aT();m2();g2();x2();En();b2();T2();v2();E2();A2();C2();M2();P2();R2();D2();I2();k2();Pl();Dt();F2();W2();Y2();J3();G2();jm();Rm();U2();V2();Sb();zd();L2();N2();H2();tw();Qm();Eb();Ab();Cb();Pb();wb();zm();B2();w2();X2();z2();j2();$2();Nm();K2();nT();Z2();Q2();dg();J2();tT();OT();rT();iT();sT();eT();kC();oT();Nv();Hv();iw();jv();Vv();Wv();zv();Xv();qv();Kv();Zv();Qv();e2();t2();r2();oi();Wt();i2();Sm();$v();Db();Ib();Yv();Fb();Gb();Ob();s2();n2();Mm();c2();o2();a2();Om();u2();UT();l2();h2();Tv();Sv();kr();Pc();vr();$d();Cv();wv();ow();zi();Tf();bb();Xi();yb();Sf();pd();Bv();Jv();xm();km();uw();Rv();kb();ir();Zb();vm();Ve();Am();Qb();Pm();Em();Dv();Wi();Yo();Xt();Da();ym();jp();fn();hw();Fv();Pv();_d();Qs();fu();Js();it();Hd();se();Ov();bd();gr();md();dw();pw();_m();Hg();mu();fb();jo();gw();Lv();zt();Py();wy();By();at();_w();Os();il();z0();Ci();g_();x_();__();y_();v_();T_();ld();C_();P_();w_();B_();Rt();sv();bw();D_();nv();lv();yd();A_();im();vw();Ri();rm();Sw();ad();od();Aw();av();Pw();uv();d2();on();tv();Ef();Jf();qy();tp();jy();Qy();Pf();ty();ry();Uf();Lf();Nf();WE();fa();Ul();mp();mn();Il();by();Hl();Jy();e0();t0();op();Ny();i0();s0();r0();ly();Bw();hp();uy();ey();Of();Iw();Nw();z1();V1();W1();Hw();Kl();$w();qw();X1();f2();rv();kl();Kw();yo();fi();vy();Sy();Dy();My();Iy();Jw();Cy();rB();Yf();$1();Ry();Ey();Ay();I1();Wp();nB();H0();M0();k0();F1();L0();O0();F0();G0();U0();da();Oi();cv();yp();cT();hT();dT();fT();lT();$l();O1();x0();m0();Tp();vp();U1();b0();Pp();ql();B0();T0();A0();C0();P0();S0();E0();w0();Fp();v0();_h();Xl();Fy();u0();zl();pp();p0();c0();h0();Px();ci();aB();dp();fp();$f();_r();rb();ib();Xs();ki();z_();Ld();L_();y0();Ia();ka();qp();Gy();om();ft();Iv();Qh();tt();Od();Yd();am();ce();lB();cB();le();M_();k1();Hc();Fi();Kh();pt();Mv();dB=Po(ay());k.add($0,q0);});var TB=dr((qx,vB)=>{(function(r,e){typeof qx=="object"?vB.exports=qx=e():typeof define=="function"&&define.amd?define([],e):r.CryptoJS=e();})(qx,function(){var r=r||function(e,t){var i;if(typeof window<"u"&&window.crypto&&(i=window.crypto),typeof self<"u"&&self.crypto&&(i=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(i=globalThis.crypto),!i&&typeof window<"u"&&window.msCrypto&&(i=window.msCrypto),!i&&typeof global<"u"&&global.crypto&&(i=global.crypto),!i&&typeof o_=="function")try{i=o_("crypto");}catch{}var s=function(){if(i){if(typeof i.getRandomValues=="function")try{return i.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof i.randomBytes=="function")try{return i.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},n=Object.create||function(){function x(){}return function(y){var v;return x.prototype=y,v=new x,x.prototype=null,v}}(),o={},a=o.lib={},u=a.Base=function(){return {extend:function(x){var y=n(this);return x&&y.mixIn(x),(!y.hasOwnProperty("init")||this.init===y.init)&&(y.init=function(){y.$super.init.apply(this,arguments);}),y.init.prototype=y,y.$super=this,y},create:function(){var x=this.extend();return x.init.apply(x,arguments),x},init:function(){},mixIn:function(x){for(var y in x)x.hasOwnProperty(y)&&(this[y]=x[y]);x.hasOwnProperty("toString")&&(this.toString=x.toString);},clone:function(){return this.init.prototype.extend(this)}}}(),l=a.WordArray=u.extend({init:function(x,y){x=this.words=x||[],y!=t?this.sigBytes=y:this.sigBytes=x.length*4;},toString:function(x){return (x||h).stringify(this)},concat:function(x){var y=this.words,v=x.words,T=this.sigBytes,B=x.sigBytes;if(this.clamp(),T%4)for(var E=0;E<B;E++){var w=v[E>>>2]>>>24-E%4*8&255;y[T+E>>>2]|=w<<24-(T+E)%4*8;}else for(var F=0;F<B;F+=4)y[T+F>>>2]=v[F>>>2];return this.sigBytes+=B,this},clamp:function(){var x=this.words,y=this.sigBytes;x[y>>>2]&=4294967295<<32-y%4*8,x.length=e.ceil(y/4);},clone:function(){var x=u.clone.call(this);return x.words=this.words.slice(0),x},random:function(x){for(var y=[],v=0;v<x;v+=4)y.push(s());return new l.init(y,x)}}),c=o.enc={},h=c.Hex={stringify:function(x){for(var y=x.words,v=x.sigBytes,T=[],B=0;B<v;B++){var E=y[B>>>2]>>>24-B%4*8&255;T.push((E>>>4).toString(16)),T.push((E&15).toString(16));}return T.join("")},parse:function(x){for(var y=x.length,v=[],T=0;T<y;T+=2)v[T>>>3]|=parseInt(x.substr(T,2),16)<<24-T%8*4;return new l.init(v,y/2)}},f=c.Latin1={stringify:function(x){for(var y=x.words,v=x.sigBytes,T=[],B=0;B<v;B++){var E=y[B>>>2]>>>24-B%4*8&255;T.push(String.fromCharCode(E));}return T.join("")},parse:function(x){for(var y=x.length,v=[],T=0;T<y;T++)v[T>>>2]|=(x.charCodeAt(T)&255)<<24-T%4*8;return new l.init(v,y)}},p=c.Utf8={stringify:function(x){try{return decodeURIComponent(escape(f.stringify(x)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(x){return f.parse(unescape(encodeURIComponent(x)))}},g=a.BufferedBlockAlgorithm=u.extend({reset:function(){this._data=new l.init,this._nDataBytes=0;},_append:function(x){typeof x=="string"&&(x=p.parse(x)),this._data.concat(x),this._nDataBytes+=x.sigBytes;},_process:function(x){var y,v=this._data,T=v.words,B=v.sigBytes,E=this.blockSize,w=E*4,F=B/w;x?F=e.ceil(F):F=e.max((F|0)-this._minBufferSize,0);var G=F*E,O=e.min(G*4,B);if(G){for(var D=0;D<G;D+=E)this._doProcessBlock(T,D);y=T.splice(0,G),v.sigBytes-=O;}return new l.init(y,O)},clone:function(){var x=u.clone.call(this);return x._data=this._data.clone(),x},_minBufferSize:0});a.Hasher=g.extend({cfg:u.extend(),init:function(x){this.cfg=this.cfg.extend(x),this.reset();},reset:function(){g.reset.call(this),this._doReset();},update:function(x){return this._append(x),this._process(),this},finalize:function(x){x&&this._append(x);var y=this._doFinalize();return y},blockSize:512/32,_createHelper:function(x){return function(y,v){return new x.init(v).finalize(y)}},_createHmacHelper:function(x){return function(y,v){return new _.HMAC.init(x,v).finalize(y)}}});var _=o.algo={};return o}(Math);return r});});var EB=dr((jx,SB)=>{(function(r,e){typeof jx=="object"?SB.exports=jx=e(TB()):typeof define=="function"&&define.amd?define(["./core"],e):e(r.CryptoJS);})(jx,function(r){return function(){var e=r,t=e.lib,i=t.WordArray,s=t.Hasher,n=e.algo,o=[],a=n.SHA1=s.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878,3285377520]);},_doProcessBlock:function(u,l){for(var c=this._hash.words,h=c[0],f=c[1],p=c[2],g=c[3],b=c[4],_=0;_<80;_++){if(_<16)o[_]=u[l+_]|0;else {var x=o[_-3]^o[_-8]^o[_-14]^o[_-16];o[_]=x<<1|x>>>31;}var y=(h<<5|h>>>27)+b+o[_];_<20?y+=(f&p|~f&g)+1518500249:_<40?y+=(f^p^g)+1859775393:_<60?y+=(f&p|f&g|p&g)-1894007588:y+=(f^p^g)-899497514,b=g,g=p,p=f<<30|f>>>2,f=h,h=y;}c[0]=c[0]+h|0,c[1]=c[1]+f|0,c[2]=c[2]+p|0,c[3]=c[3]+g|0,c[4]=c[4]+b|0;},_doFinalize:function(){var u=this._data,l=u.words,c=this._nDataBytes*8,h=u.sigBytes*8;return l[h>>>5]|=128<<24-h%32,l[(h+64>>>9<<4)+14]=Math.floor(c/4294967296),l[(h+64>>>9<<4)+15]=c,u.sigBytes=l.length*4,this._process(),this._hash},clone:function(){var u=s.clone.call(this);return u._hash=this._hash.clone(),u}});e.SHA1=s._createHelper(a),e.HmacSHA1=s._createHmacHelper(a);}(),r.SHA1});});pe();var Yr={};Hh(Yr,{DistortionFilter:()=>Ux,EqualizerFilter:()=>hr,Filter:()=>Je,MonoFilter:()=>Lx,ReverbFilter:()=>Nx,StereoFilter:()=>Hx,StreamFilter:()=>Vx,TelephoneFilter:()=>Wx});var fB;function pB(r){return fB=r,r}function me(){return fB}var Je=class{constructor(e,t){this.init(e,t);}init(e,t){this.destination=e,this.source=t||e;}connect(e){this.source?.connect(e);}disconnect(){this.source?.disconnect();}destroy(){this.disconnect(),this.destination=null,this.source=null;}};var Ux=class extends Je{constructor(e=0){let t;if(!me().useLegacy){let{audioContext:i}=me().context;t=i.createWaveShaper();}super(t),this._distortion=t,this.amount=e;}set amount(e){if(this._amount=e,me().useLegacy)return;let t=e*1e3,i=44100,s=new Float32Array(i),n=Math.PI/180,o=0,a;for(;o<i;++o)a=o*2/i-1,s[o]=(3+t)*a*20*n/(Math.PI+t*Math.abs(a));this._distortion.curve=s,this._distortion.oversample="4x";}get amount(){return this._amount}destroy(){this._distortion=null,super.destroy();}};var Ze=class{static setParamValue(e,t){if(e.setValueAtTime){let i=me().context;e.setValueAtTime(t,i.audioContext.currentTime);}else e.value=t;return t}};var ge=class extends Je{constructor(r=0,e=0,t=0,i=0,s=0,n=0,o=0,a=0,u=0,l=0){let c=[],h=[{f:ge.F32,type:"lowshelf",gain:r},{f:ge.F64,type:"peaking",gain:e},{f:ge.F125,type:"peaking",gain:t},{f:ge.F250,type:"peaking",gain:i},{f:ge.F500,type:"peaking",gain:s},{f:ge.F1K,type:"peaking",gain:n},{f:ge.F2K,type:"peaking",gain:o},{f:ge.F4K,type:"peaking",gain:a},{f:ge.F8K,type:"peaking",gain:u},{f:ge.F16K,type:"highshelf",gain:l}];me().useLegacy||(c=h.map(f=>{let p=me().context.audioContext.createBiquadFilter();return p.type=f.type,Ze.setParamValue(p.Q,1),p.frequency.value=f.f,Ze.setParamValue(p.gain,f.gain),p})),super(c[0],c[c.length-1]),this.bands=c,this.bandsMap={};for(let f=0;f<this.bands.length;f++){let p=this.bands[f];f>0&&this.bands[f-1].connect(p),this.bandsMap[p.frequency.value]=p;}}setGain(r,e=0){if(!this.bandsMap[r])throw new Error(`No band found for frequency ${r}`);Ze.setParamValue(this.bandsMap[r].gain,e);}getGain(r){if(!this.bandsMap[r])throw new Error(`No band found for frequency ${r}`);return this.bandsMap[r].gain.value}set f32(r){this.setGain(ge.F32,r);}get f32(){return this.getGain(ge.F32)}set f64(r){this.setGain(ge.F64,r);}get f64(){return this.getGain(ge.F64)}set f125(r){this.setGain(ge.F125,r);}get f125(){return this.getGain(ge.F125)}set f250(r){this.setGain(ge.F250,r);}get f250(){return this.getGain(ge.F250)}set f500(r){this.setGain(ge.F500,r);}get f500(){return this.getGain(ge.F500)}set f1k(r){this.setGain(ge.F1K,r);}get f1k(){return this.getGain(ge.F1K)}set f2k(r){this.setGain(ge.F2K,r);}get f2k(){return this.getGain(ge.F2K)}set f4k(r){this.setGain(ge.F4K,r);}get f4k(){return this.getGain(ge.F4K)}set f8k(r){this.setGain(ge.F8K,r);}get f8k(){return this.getGain(ge.F8K)}set f16k(r){this.setGain(ge.F16K,r);}get f16k(){return this.getGain(ge.F16K)}reset(){this.bands.forEach(r=>{Ze.setParamValue(r.gain,0);});}destroy(){this.bands.forEach(r=>{r.disconnect();}),this.bands=null,this.bandsMap=null;}},hr=ge;hr.F32=32;hr.F64=64;hr.F125=125;hr.F250=250;hr.F500=500;hr.F1K=1e3;hr.F2K=2e3;hr.F4K=4e3;hr.F8K=8e3;hr.F16K=16e3;var Lx=class extends Je{constructor(){let e,t;if(!me().useLegacy){let{audioContext:i}=me().context;t=i.createChannelSplitter(),e=i.createChannelMerger(),e.connect(t);}super(e,t),this._merger=e;}destroy(){this._merger?.disconnect(),this._merger=null,super.destroy();}};var Nx=class extends Je{constructor(e=3,t=2,i=false){super(null),this._seconds=this._clamp(e,1,50),this._decay=this._clamp(t,0,100),this._reverse=i,this._rebuild();}_clamp(e,t,i){return Math.min(i,Math.max(t,e))}get seconds(){return this._seconds}set seconds(e){this._seconds=this._clamp(e,1,50),this._rebuild();}get decay(){return this._decay}set decay(e){this._decay=this._clamp(e,0,100),this._rebuild();}get reverse(){return this._reverse}set reverse(e){this._reverse=e,this._rebuild();}_rebuild(){if(me().useLegacy)return;let{audioContext:e}=me().context,t=e.sampleRate,i=t*this._seconds,s=e.createBuffer(2,i,t),n=s.getChannelData(0),o=s.getChannelData(1),a;for(let l=0;l<i;l++)a=this._reverse?i-l:l,n[l]=(Math.random()*2-1)*Math.pow(1-a/i,this._decay),o[l]=(Math.random()*2-1)*Math.pow(1-a/i,this._decay);let u=e.createConvolver();u.buffer=s,this.init(u);}};var Hx=class extends Je{constructor(e=0){let t,i,s;if(!me().useLegacy){let{audioContext:n}=me().context;n.createStereoPanner?(t=n.createStereoPanner(),s=t):(i=n.createPanner(),i.panningModel="equalpower",s=i);}super(s),this._stereo=t,this._panner=i,this.pan=e;}set pan(e){this._pan=e,this._stereo?Ze.setParamValue(this._stereo.pan,e):this._panner&&this._panner.setPosition(e,0,1-Math.abs(e));}get pan(){return this._pan}destroy(){super.destroy(),this._stereo=null,this._panner=null;}};var Vx=class extends Je{constructor(){let e,t;if(!me().useLegacy){let{audioContext:i}=me().context;e=i.createMediaStreamDestination(),t=i.createMediaStreamSource(e.stream);}super(e,t),this._stream=e?.stream;}get stream(){return this._stream}destroy(){this._stream=null,super.destroy();}};var Wx=class extends Je{constructor(){let e,t;if(!me().useLegacy){let{audioContext:i}=me().context,s=i.createBiquadFilter(),n=i.createBiquadFilter(),o=i.createBiquadFilter(),a=i.createBiquadFilter();s.type="lowpass",Ze.setParamValue(s.frequency,2e3),n.type="lowpass",Ze.setParamValue(n.frequency,2e3),o.type="highpass",Ze.setParamValue(o.frequency,500),a.type="highpass",Ze.setParamValue(a.frequency,500),s.connect(n),n.connect(o),o.connect(a),e=s,t=a;}super(e,t);}};pe();var Sh=class extends re{constructor(){super(...arguments),this.speed=1,this.muted=false,this.volume=1,this.paused=false;}refresh(){this.emit("refresh");}refreshPaused(){this.emit("refreshPaused");}get filters(){return console.warn("HTML Audio does not support filters"),null}set filters(e){console.warn("HTML Audio does not support filters");}get audioContext(){return console.warn("HTML Audio does not support audioContext"),null}toggleMute(){return this.muted=!this.muted,this.refresh(),this.muted}togglePause(){return this.paused=!this.paused,this.refreshPaused(),this.paused}destroy(){this.removeAllListeners();}};pe();var hk=0,Q1=class extends re{constructor(r){super(),this.id=hk++,this.init(r);}set(r,e){if(this[r]===void 0)throw new Error(`Property with name ${r} does not exist.`);switch(r){case "speed":this.speed=e;break;case "volume":this.volume=e;break;case "paused":this.paused=e;break;case "loop":this.loop=e;break;case "muted":this.muted=e;break}return this}get progress(){let{currentTime:r}=this._source;return r/this._duration}get paused(){return this._paused}set paused(r){this._paused=r,this.refreshPaused();}_onPlay(){this._playing=true;}_onPause(){this._playing=false;}init(r){this._playing=false,this._duration=r.source.duration;let e=this._source=r.source.cloneNode(false);e.src=r.parent.url,e.onplay=this._onPlay.bind(this),e.onpause=this._onPause.bind(this),r.context.on("refresh",this.refresh,this),r.context.on("refreshPaused",this.refreshPaused,this),this._media=r;}_internalStop(){this._source&&this._playing&&(this._source.onended=null,this._source.pause());}stop(){this._internalStop(),this._source&&this.emit("stop");}get speed(){return this._speed}set speed(r){this._speed=r,this.refresh();}get volume(){return this._volume}set volume(r){this._volume=r,this.refresh();}get loop(){return this._loop}set loop(r){this._loop=r,this.refresh();}get muted(){return this._muted}set muted(r){this._muted=r,this.refresh();}get filters(){return console.warn("HTML Audio does not support filters"),null}set filters(r){console.warn("HTML Audio does not support filters");}refresh(){let r=this._media.context,e=this._media.parent;this._source.loop=this._loop||e.loop;let t=r.volume*(r.muted?0:1),i=e.volume*(e.muted?0:1),s=this._volume*(this._muted?0:1);this._source.volume=s*t*i,this._source.playbackRate=this._speed*r.speed*e.speed;}refreshPaused(){let r=this._media.context,e=this._media.parent,t=this._paused||e.paused||r.paused;t!==this._pausedReal&&(this._pausedReal=t,t?(this._internalStop(),this.emit("paused")):(this.emit("resumed"),this.play({start:this._source.currentTime,end:this._end,volume:this._volume,speed:this._speed,loop:this._loop})),this.emit("pause",t));}play(r){let{start:e,end:t,speed:i,loop:s,volume:n,muted:o}=r;t&&console.assert(t>e,"End time is before start time"),this._speed=i,this._volume=n,this._loop=!!s,this._muted=o,this.refresh(),this.loop&&t!==null&&(console.warn('Looping not support when specifying an "end" time'),this.loop=false),this._start=e,this._end=t||this._duration,this._start=Math.max(0,this._start-Q1.PADDING),this._end=Math.min(this._end+Q1.PADDING,this._duration),this._source.onloadedmetadata=()=>{this._source&&(this._source.currentTime=e,this._source.onloadedmetadata=null,this.emit("progress",e/this._duration,this._duration),fe.shared.add(this._onUpdate,this));},this._source.onended=this._onComplete.bind(this),this._source.play(),this.emit("start");}_onUpdate(){this.emit("progress",this.progress,this._duration),this._source.currentTime>=this._end&&!this._source.loop&&this._onComplete();}_onComplete(){fe.shared.remove(this._onUpdate,this),this._internalStop(),this.emit("progress",1,this._duration),this.emit("end",this);}destroy(){fe.shared.remove(this._onUpdate,this),this.removeAllListeners();let r=this._source;r&&(r.onended=null,r.onplay=null,r.onpause=null,this._internalStop()),this._source=null,this._speed=1,this._volume=1,this._loop=false,this._end=null,this._start=0,this._duration=0,this._playing=false,this._pausedReal=false,this._paused=false,this._muted=false,this._media&&(this._media.context.off("refresh",this.refresh,this),this._media.context.off("refreshPaused",this.refreshPaused,this),this._media=null);}toString(){return `[HTMLAudioInstance id=${this.id}]`}},zx=Q1;zx.PADDING=.1;pe();var Eh=class extends re{init(e){this.parent=e,this._source=e.options.source||new Audio,e.url&&(this._source.src=e.url);}create(){return new zx(this)}get isPlayable(){return !!this._source&&this._source.readyState===4}get duration(){return this._source.duration}get context(){return this.parent.context}get filters(){return null}set filters(e){console.warn("HTML Audio does not support filters");}destroy(){this.removeAllListeners(),this.parent=null,this._source&&(this._source.src="",this._source.load(),this._source=null);}get source(){return this._source}load(e){let t=this._source,i=this.parent;if(t.readyState===4){i.isLoaded=true;let u=i.autoPlayStart();e&&setTimeout(()=>{e(null,i,u);},0);return}if(!i.url){e(new Error("sound.url or sound.source must be set"));return}t.src=i.url;let s=()=>{a(),i.isLoaded=true;let u=i.autoPlayStart();e&&e(null,i,u);},n=()=>{a(),e&&e(new Error("Sound loading has been aborted"));},o=()=>{a();let u=`Failed to load audio element (code: ${t.error.code})`;e?e(new Error(u)):console.error(u);},a=()=>{t.removeEventListener("canplaythrough",s),t.removeEventListener("load",s),t.removeEventListener("abort",n),t.removeEventListener("error",o);};t.addEventListener("canplaythrough",s,false),t.addEventListener("load",s,false),t.addEventListener("abort",n,false),t.addEventListener("error",o,false),t.load();}};pe();var Ah=class{constructor(e,t){this.parent=e,Object.assign(this,t),this.duration=this.end-this.start,console.assert(this.duration>0,"End time must be after start time");}play(e){return this.parent.play({complete:e,speed:this.speed||this.parent.speed,end:this.end,start:this.start,loop:this.loop})}destroy(){this.parent=null;}};var vo=["ogg","oga","opus","m4a","mp3","mpeg","wav","aiff","wma","mid","caf"],J1=["audio/mpeg","audio/ogg"],To={};function mB(r){let e={m4a:"audio/mp4",oga:"audio/ogg",opus:'audio/ogg; codecs="opus"',caf:'audio/x-caf; codecs="opus"',...{}},t=document.createElement("audio"),i={},s=/^no$/;vo.forEach(n=>{let o=t.canPlayType(`audio/${n}`).replace(s,""),a=e[n]?t.canPlayType(e[n]).replace(s,""):"";i[n]=!!o||!!a;}),Object.assign(To,i);}mB();pe();pe();var fk=0,Ch=class extends re{constructor(e){super(),this.id=fk++,this._media=null,this._paused=false,this._muted=false,this._elapsed=0,this.init(e);}set(e,t){if(this[e]===void 0)throw new Error(`Property with name ${e} does not exist.`);switch(e){case "speed":this.speed=t;break;case "volume":this.volume=t;break;case "muted":this.muted=t;break;case "loop":this.loop=t;break;case "paused":this.paused=t;break}return this}stop(){this._source&&(this._internalStop(),this.emit("stop"));}get speed(){return this._speed}set speed(e){this._speed=e,this.refresh(),this._update(true);}get volume(){return this._volume}set volume(e){this._volume=e,this.refresh();}get muted(){return this._muted}set muted(e){this._muted=e,this.refresh();}get loop(){return this._loop}set loop(e){this._loop=e,this.refresh();}get filters(){return this._filters}set filters(e){this._filters&&(this._filters?.filter(t=>t).forEach(t=>t.disconnect()),this._filters=null,this._source.connect(this._gain)),this._filters=e?.length?e.slice(0):null,this.refresh();}refresh(){if(!this._source)return;let e=this._media.context,t=this._media.parent;this._source.loop=this._loop||t.loop;let i=e.volume*(e.muted?0:1),s=t.volume*(t.muted?0:1),n=this._volume*(this._muted?0:1);Ze.setParamValue(this._gain.gain,n*s*i),Ze.setParamValue(this._source.playbackRate,this._speed*t.speed*e.speed),this.applyFilters();}applyFilters(){if(this._filters?.length){this._source.disconnect();let e=this._source;this._filters.forEach(t=>{e.connect(t.destination),e=t;}),e.connect(this._gain);}}refreshPaused(){let e=this._media.context,t=this._media.parent,i=this._paused||t.paused||e.paused;i!==this._pausedReal&&(this._pausedReal=i,i?(this._internalStop(),this.emit("paused")):(this.emit("resumed"),this.play({start:this._elapsed%this._duration,end:this._end,speed:this._speed,loop:this._loop,volume:this._volume})),this.emit("pause",i));}play(e){let{start:t,end:i,speed:s,loop:n,volume:o,muted:a,filters:u}=e;i&&console.assert(i>t,"End time is before start time"),this._paused=false;let{source:l,gain:c}=this._media.nodes.cloneBufferSource();this._source=l,this._gain=c,this._speed=s,this._volume=o,this._loop=!!n,this._muted=a,this._filters=u,this.refresh();let h=this._source.buffer.duration;this._duration=h,this._end=i,this._lastUpdate=this._now(),this._elapsed=t,this._source.onended=this._onComplete.bind(this),this._loop?(this._source.loopEnd=i,this._source.loopStart=t,this._source.start(0,t)):i?this._source.start(0,t,i-t):this._source.start(0,t),this.emit("start"),this._update(true),this.enableTicker(true);}enableTicker(e){fe.shared.remove(this._updateListener,this),e&&fe.shared.add(this._updateListener,this);}get progress(){return this._progress}get paused(){return this._paused}set paused(e){this._paused=e,this.refreshPaused();}destroy(){this.removeAllListeners(),this._internalStop(),this._gain&&(this._gain.disconnect(),this._gain=null),this._media&&(this._media.context.events.off("refresh",this.refresh,this),this._media.context.events.off("refreshPaused",this.refreshPaused,this),this._media=null),this._filters?.forEach(e=>e.disconnect()),this._filters=null,this._end=null,this._speed=1,this._volume=1,this._loop=false,this._elapsed=0,this._duration=0,this._paused=false,this._muted=false,this._pausedReal=false;}toString(){return `[WebAudioInstance id=${this.id}]`}_now(){return this._media.context.audioContext.currentTime}_updateListener(){this._update();}_update(e=false){if(this._source){let t=this._now(),i=t-this._lastUpdate;if(i>0||e){let s=this._source.playbackRate.value;this._elapsed+=i*s,this._lastUpdate=t;let n=this._duration,o;if(this._source.loopStart){let a=this._source.loopEnd-this._source.loopStart;o=(this._source.loopStart+this._elapsed%a)/n;}else o=this._elapsed%n/n;this._progress=o,this.emit("progress",this._progress,n);}}}init(e){this._media=e,e.context.events.on("refresh",this.refresh,this),e.context.events.on("refreshPaused",this.refreshPaused,this);}_internalStop(){if(this._source){this.enableTicker(false),this._source.onended=null,this._source.stop(0),this._source.disconnect();try{this._source.buffer=null;}catch(e){console.warn("Failed to set AudioBufferSourceNode.buffer to null:",e);}this._source=null;}}_onComplete(){if(this._source){this.enableTicker(false),this._source.onended=null,this._source.disconnect();try{this._source.buffer=null;}catch(e){console.warn("Failed to set AudioBufferSourceNode.buffer to null:",e);}}this._source=null,this._progress=1,this.emit("progress",1,this._duration),this.emit("end",this);}};var So=class{constructor(e,t){this._output=t,this._input=e;}get destination(){return this._input}get filters(){return this._filters}set filters(e){if(this._filters&&(this._filters.forEach(t=>{t&&t.disconnect();}),this._filters=null,this._input.connect(this._output)),e&&e.length){this._filters=e.slice(0),this._input.disconnect();let t=null;e.forEach(i=>{t===null?this._input.connect(i.destination):t.connect(i.destination),t=i;}),t.connect(this._output);}}destroy(){this.filters=null,this._input=null,this._output=null;}};var gB=class extends So{constructor(r){let e=r.audioContext,t=e.createBufferSource(),i=e.createGain(),s=e.createAnalyser();t.connect(s),s.connect(i),i.connect(r.destination),super(s,i),this.context=r,this.bufferSource=t,this.gain=i,this.analyser=s;}get script(){return this._script||(this._script=this.context.audioContext.createScriptProcessor(gB.BUFFER_SIZE),this._script.connect(this.context.destination)),this._script}destroy(){super.destroy(),this.bufferSource.disconnect(),this._script&&this._script.disconnect(),this.gain.disconnect(),this.analyser.disconnect(),this.bufferSource=null,this._script=null,this.gain=null,this.analyser=null,this.context=null;}cloneBufferSource(){let r=this.bufferSource,e=this.context.audioContext.createBufferSource();e.buffer=r.buffer,Ze.setParamValue(e.playbackRate,r.playbackRate.value),e.loop=r.loop;let t=this.context.audioContext.createGain();return e.connect(t),t.connect(this.destination),{source:e,gain:t}}get bufferSize(){return this.script.bufferSize}},Xx=gB;Xx.BUFFER_SIZE=0;var Eo=class{init(e){this.parent=e,this._nodes=new Xx(this.context),this._source=this._nodes.bufferSource,this.source=e.options.source;}destroy(){this.parent=null,this._nodes.destroy(),this._nodes=null;try{this._source.buffer=null;}catch(e){console.warn("Failed to set AudioBufferSourceNode.buffer to null:",e);}this._source=null,this.source=null;}create(){return new Ch(this)}get context(){return this.parent.context}get isPlayable(){return !!this._source&&!!this._source.buffer}get filters(){return this._nodes.filters}set filters(e){this._nodes.filters=e;}get duration(){return console.assert(this.isPlayable,"Sound not yet playable, no duration"),this._source.buffer.duration}get buffer(){return this._source.buffer}set buffer(e){this._source.buffer=e;}get nodes(){return this._nodes}load(e){this.source?this._decode(this.source,e):this.parent.url?this._loadUrl(e):e?e(new Error("sound.url or sound.source must be set")):console.error("sound.url or sound.source must be set");}async _loadUrl(e){let t=this.parent.url,i=await H.get().fetch(t);this._decode(await i.arrayBuffer(),e);}_decode(e,t){let i=(s,n)=>{if(s)t&&t(s);else {this.parent.isLoaded=true,this.buffer=n;let o=this.parent.autoPlayStart();t&&t(null,this.parent,o);}};e instanceof AudioBuffer?i(null,e):this.parent.context.decode(e,i);}};var Lu=class{static from(r){let e={};typeof r=="string"?e.url=r:r instanceof ArrayBuffer||r instanceof AudioBuffer||r instanceof HTMLAudioElement?e.source=r:Array.isArray(r)?e.url=r:e=r,e={autoPlay:false,singleInstance:false,url:null,source:null,preload:false,volume:1,speed:1,complete:null,loaded:null,loop:false,...e},Object.freeze(e);let t=me().useLegacy?new Eh:new Eo;return new Lu(t,e)}constructor(r,e){this.media=r,this.options=e,this._instances=[],this._sprites={},this.media.init(this);let t=e.complete;this._autoPlayOptions=t?{complete:t}:null,this.isLoaded=false,this._preloadQueue=null,this.isPlaying=false,this.autoPlay=e.autoPlay,this.singleInstance=e.singleInstance,this.preload=e.preload||this.autoPlay,this.url=Array.isArray(e.url)?this.preferUrl(e.url):e.url,this.speed=e.speed,this.volume=e.volume,this.loop=e.loop,e.sprites&&this.addSprites(e.sprites),this.preload&&this._preload(e.loaded);}preferUrl(r){let[e]=r.map(t=>({url:t,ext:Ee.extname(t).slice(1)})).filter(({ext:t})=>To[t]).sort((t,i)=>vo.indexOf(t.ext)-vo.indexOf(i.ext));if(!e)throw new Error("No supported file type found");return e.url}get context(){return me().context}pause(){return this.isPlaying=false,this.paused=true,this}resume(){return this.isPlaying=this._instances.length>0,this.paused=false,this}get paused(){return this._paused}set paused(r){this._paused=r,this.refreshPaused();}get speed(){return this._speed}set speed(r){this._speed=r,this.refresh();}get filters(){return this.media.filters}set filters(r){this.media.filters=r;}addSprites(r,e){if(typeof r=="object"){let i={};for(let s in r)i[s]=this.addSprites(s,r[s]);return i}console.assert(!this._sprites[r],`Alias ${r} is already taken`);let t=new Ah(this,e);return this._sprites[r]=t,t}destroy(){this._removeInstances(),this.removeSprites(),this.media.destroy(),this.media=null,this._sprites=null,this._instances=null;}removeSprites(r){if(r){let e=this._sprites[r];e!==void 0&&(e.destroy(),delete this._sprites[r]);}else for(let e in this._sprites)this.removeSprites(e);return this}get isPlayable(){return this.isLoaded&&this.media&&this.media.isPlayable}stop(){if(!this.isPlayable)return this.autoPlay=false,this._autoPlayOptions=null,this;this.isPlaying=false;for(let r=this._instances.length-1;r>=0;r--)this._instances[r].stop();return this}play(r,e){let t;if(typeof r=="string"?t={sprite:r,loop:this.loop,complete:e}:typeof r=="function"?(t={},t.complete=r):t=r,t={complete:null,loaded:null,sprite:null,end:null,start:0,volume:1,speed:1,muted:false,loop:false,...t||{}},t.sprite){let s=t.sprite;console.assert(!!this._sprites[s],`Alias ${s} is not available`);let n=this._sprites[s];t.start=n.start+(t.start||0),t.end=n.end,t.speed=n.speed||1,t.loop=n.loop||t.loop,delete t.sprite;}if(t.offset&&(t.start=t.offset),!this.isLoaded)return this._preloadQueue?new Promise(s=>{this._preloadQueue.push(()=>{s(this.play(t));});}):(this._preloadQueue=[],this.autoPlay=true,this._autoPlayOptions=t,new Promise((s,n)=>{this._preload((o,a,u)=>{this._preloadQueue.forEach(l=>l()),this._preloadQueue=null,o?n(o):(t.loaded&&t.loaded(o,a,u),s(u));});}));(this.singleInstance||t.singleInstance)&&this._removeInstances();let i=this._createInstance();return this._instances.push(i),this.isPlaying=true,i.once("end",()=>{t.complete&&t.complete(this),this._onComplete(i);}),i.once("stop",()=>{this._onComplete(i);}),i.play(t),i}refresh(){let r=this._instances.length;for(let e=0;e<r;e++)this._instances[e].refresh();}refreshPaused(){let r=this._instances.length;for(let e=0;e<r;e++)this._instances[e].refreshPaused();}get volume(){return this._volume}set volume(r){this._volume=r,this.refresh();}get muted(){return this._muted}set muted(r){this._muted=r,this.refresh();}get loop(){return this._loop}set loop(r){this._loop=r,this.refresh();}_preload(r){this.media.load(r);}get instances(){return this._instances}get sprites(){return this._sprites}get duration(){return this.media.duration}autoPlayStart(){let r;return this.autoPlay&&(r=this.play(this._autoPlayOptions)),r}_removeInstances(){for(let r=this._instances.length-1;r>=0;r--)this._poolInstance(this._instances[r]);this._instances.length=0;}_onComplete(r){if(this._instances){let e=this._instances.indexOf(r);e>-1&&this._instances.splice(e,1),this.isPlaying=this._instances.length>0;}this._poolInstance(r);}_createInstance(){if(Lu._pool.length>0){let r=Lu._pool.pop();return r.init(this.media),r}return this.media.create()}_poolInstance(r){r.destroy(),Lu._pool.indexOf(r)<0&&Lu._pool.push(r);}},Ps=Lu;Ps._pool=[];pe();var Nu=class r extends So{constructor(){let e=window,t=new r.AudioContext,i=t.createDynamicsCompressor(),s=t.createAnalyser();s.connect(i),i.connect(t.destination),super(s,i),this.autoPause=true,this._ctx=t,this._offlineCtx=new r.OfflineAudioContext(1,2,e.OfflineAudioContext?Math.max(8e3,Math.min(96e3,t.sampleRate)):44100),this.compressor=i,this.analyser=s,this.events=new re,this.volume=1,this.speed=1,this.muted=false,this.paused=false,this._locked=t.state==="suspended"&&("ontouchstart"in globalThis||"onclick"in globalThis),this._locked&&(this._unlock(),this._unlock=this._unlock.bind(this),document.addEventListener("mousedown",this._unlock,true),document.addEventListener("touchstart",this._unlock,true),document.addEventListener("touchend",this._unlock,true)),this.onFocus=this.onFocus.bind(this),this.onBlur=this.onBlur.bind(this),globalThis.addEventListener("focus",this.onFocus),globalThis.addEventListener("blur",this.onBlur);}onFocus(){if(!this.autoPause)return;let e=this._ctx.state;(e==="suspended"||e==="interrupted"||!this._locked)&&(this.paused=this._pausedOnBlur,this.refreshPaused());}onBlur(){this.autoPause&&(this._locked||(this._pausedOnBlur=this._paused,this.paused=true,this.refreshPaused()));}_unlock(){this._locked&&(this.playEmptySound(),this._ctx.state==="running"&&(document.removeEventListener("mousedown",this._unlock,true),document.removeEventListener("touchend",this._unlock,true),document.removeEventListener("touchstart",this._unlock,true),this._locked=false));}playEmptySound(){let e=this._ctx.createBufferSource();e.buffer=this._ctx.createBuffer(1,1,22050),e.connect(this._ctx.destination),e.start(0,0,0),e.context.state==="suspended"&&e.context.resume();}static get AudioContext(){let e=window;return e.AudioContext||e.webkitAudioContext||null}static get OfflineAudioContext(){let e=window;return e.OfflineAudioContext||e.webkitOfflineAudioContext||null}destroy(){super.destroy();let e=this._ctx;typeof e.close<"u"&&e.close(),globalThis.removeEventListener("focus",this.onFocus),globalThis.removeEventListener("blur",this.onBlur),this.events.removeAllListeners(),this.analyser.disconnect(),this.compressor.disconnect(),this.analyser=null,this.compressor=null,this.events=null,this._offlineCtx=null,this._ctx=null;}get audioContext(){return this._ctx}get offlineContext(){return this._offlineCtx}set paused(e){e&&this._ctx.state==="running"?this._ctx.suspend():!e&&this._ctx.state==="suspended"&&this._ctx.resume(),this._paused=e;}get paused(){return this._paused}refresh(){this.events.emit("refresh");}refreshPaused(){this.events.emit("refreshPaused");}toggleMute(){return this.muted=!this.muted,this.refresh(),this.muted}togglePause(){return this.paused=!this.paused,this.refreshPaused(),this._paused}decode(e,t){let i=n=>{t(new Error(n?.message||"Unable to decode file"));},s=this._offlineCtx.decodeAudioData(e,n=>{t(null,n);},i);s&&s.catch(i);}};var Yx=class{constructor(){this.init();}init(){return this.supported&&(this._webAudioContext=new Nu),this._htmlAudioContext=new Sh,this._sounds={},this.useLegacy=!this.supported,this}get context(){return this._context}get filtersAll(){return this.useLegacy?[]:this._context.filters}set filtersAll(e){this.useLegacy||(this._context.filters=e);}get supported(){return Nu.AudioContext!==null}add(e,t){if(typeof e=="object"){let n={};for(let o in e){let a=this._getOptions(e[o],t);n[o]=this.add(o,a);}return n}if(console.assert(!this._sounds[e],`Sound with alias ${e} already exists.`),t instanceof Ps)return this._sounds[e]=t,t;let i=this._getOptions(t),s=Ps.from(i);return this._sounds[e]=s,s}_getOptions(e,t){let i;return typeof e=="string"?i={url:e}:Array.isArray(e)?i={url:e}:e instanceof ArrayBuffer||e instanceof AudioBuffer||e instanceof HTMLAudioElement?i={source:e}:i=e,i={...i,...t||{}},i}get useLegacy(){return this._useLegacy}set useLegacy(e){this._useLegacy=e,this._context=!e&&this.supported?this._webAudioContext:this._htmlAudioContext;}get disableAutoPause(){return !this._webAudioContext.autoPause}set disableAutoPause(e){this._webAudioContext.autoPause=!e;}remove(e){return this.exists(e,true),this._sounds[e].destroy(),delete this._sounds[e],this}get volumeAll(){return this._context.volume}set volumeAll(e){this._context.volume=e,this._context.refresh();}get speedAll(){return this._context.speed}set speedAll(e){this._context.speed=e,this._context.refresh();}togglePauseAll(){return this._context.togglePause()}pauseAll(){return this._context.paused=true,this._context.refreshPaused(),this}resumeAll(){return this._context.paused=false,this._context.refreshPaused(),this}toggleMuteAll(){return this._context.toggleMute()}muteAll(){return this._context.muted=true,this._context.refresh(),this}unmuteAll(){return this._context.muted=false,this._context.refresh(),this}removeAll(){for(let e in this._sounds)this._sounds[e].destroy(),delete this._sounds[e];return this}stopAll(){for(let e in this._sounds)this._sounds[e].stop();return this}exists(e,t=false){let i=!!this._sounds[e];return t&&console.assert(i,`No sound matching alias '${e}'.`),i}isPlaying(){for(let e in this._sounds)if(this._sounds[e].isPlaying)return true;return false}find(e){return this.exists(e,true),this._sounds[e]}play(e,t){return this.find(e).play(t)}stop(e){return this.find(e).stop()}pause(e){return this.find(e).pause()}resume(e){return this.find(e).resume()}volume(e,t){let i=this.find(e);return t!==void 0&&(i.volume=t),i.volume}speed(e,t){let i=this.find(e);return t!==void 0&&(i.speed=t),i.speed}duration(e){return this.find(e).duration}close(){return this.removeAll(),this._sounds=null,this._webAudioContext&&(this._webAudioContext.destroy(),this._webAudioContext=null),this._htmlAudioContext&&(this._htmlAudioContext.destroy(),this._htmlAudioContext=null),this._context=null,this}};pe();pe();var xB=r=>{let e=r.src,t=r?.alias?.[0];return (!t||r.src===t)&&(t=Ee.basename(e,Ee.extname(e))),t},_B={extension:m.Asset,detection:{test:async()=>true,add:async r=>[...r,...vo.filter(e=>To[e])],remove:async r=>r.filter(e=>r.includes(e))},loader:{name:"sound",extension:{type:[m.LoadParser],priority:Se.High},test(r){let e=Ee.extname(r).slice(1);return !!To[e]||J1.some(t=>r.startsWith(`data:${t}`))},async load(r,e){let t=await new Promise((i,s)=>Ps.from({...e.data,url:r,preload:true,loaded(n,o){n?s(n):i(o),e.data?.loaded?.(n,o);}}));return me().add(xB(e),t),t},async unload(r,e){me().remove(xB(e));}}};k.add(_B);pB(new Yx);var Ph="repeat";({DistortionFilter:Yr.DistortionFilter,EqualizerFilter:Yr.EqualizerFilter,MonoFilter:Yr.MonoFilter,ReverbFilter:Yr.ReverbFilter,StereoFilter:Yr.StereoFilter,StreamFilter:Yr.StreamFilter,TelephoneFilter:Yr.TelephoneFilter});var bB=["webm","mp4","ogv","mov","avi","wmv","flv","mkv","3gp","mpg","mpeg","m4v","f4v","m2v","asf","vob","ts","m2ts","mts","divx","xvid","rm","rmvb","dat","swf","mpv","mxf","vcd","svcd","dvd","dv","3g2","m2p","m2ts","m2v","m4v","mpe","mpg","mpv2","ogm","qt","rm","ts","vob","wmv","xvid","flv","mkv","mov","mp4","webm","avi","ogv","m4v","f4v","m2v","asf","vob","ts","m2ts","mts","divx","xvid","rm","rmvb","dat","swf","mpv","mxf","vcd","svcd","dvd","dv","3g2","m2p","m2ts","m2v","m4v","mpe","mpg","mpv2","ogm","qt","rm","ts","vob","wmv","xvid","flv","mkv","mov","mp4","webm","avi","ogv","m4v","f4v","m2v","asf","vob"],Rr="__game_layer__",Hu="Container",$x="ImageContainer",eS="Image",Vu="Sprite",Wu="Text",tS="Video";var N;(s=>(s.log=(n,...o)=>console.log(`[Pixi\u2019VN] ${n}`,...o),s.warn=(n,...o)=>console.warn(`[Pixi\u2019VN] ${n}`,...o),s.error=(n,...o)=>console.error(`[Pixi\u2019VN] ${n}`,...o),s.info=(n,...o)=>console.info(`[Pixi\u2019VN] ${n}`,...o)))(N||={});function St(r){try{if(typeof r>"u")return r;let e=JSON.stringify(r);return JSON.parse(e)}catch(e){throw N.error("Error creating exportable element",r,e),new Error("[Pixi\u2019VN] Error creating exportable element")}}async function yB(r){var e;let t={importPixi:false,...r};t.app&&(t.renderer=t.app.renderer,t.stage=t.app.stage),t.importPixi&&!t.pixi&&(t.pixi=await Promise.resolve().then(()=>(pe(),hB))),window.__PIXI_DEVTOOLS__={...window.__PIXI_DEVTOOLS__||{},app:t.app,stage:t.stage,renderer:t.renderer,extensions:[...((e=window.__PIXI_DEVTOOLS__)==null?void 0:e.extensions)||[],...t.extensions||[]],plugins:{}};}var CB=Po(EB());pe();var gk={extension:{type:"sceneProperties",name:"additional-positions"},testNode(r){return r instanceof _e||r instanceof Et||r instanceof De},testProp(r){switch(r){case "xAlign":case "yAlign":case "xPercentagePosition":case "yPercentagePosition":case "positionType":return true;default:return false}},setProperty(r,e,t){if(r instanceof _e||r instanceof Et||r instanceof De)switch(e){case "xAlign":r.xAlign=t/100;break;case "yAlign":r.yAlign=t/100;break;case "xPercentagePosition":r.xPercentagePosition=t/100;break;case "yPercentagePosition":r.yPercentagePosition=t/100;break}},getProperties(r){return [{value:r.positionType,prop:"positionType",entry:{section:"Transform",type:"text",label:"Position Type"}},{value:r.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:r.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:r.xPercentagePosition*100,prop:"xPercentagePosition",entry:{section:"Transform",type:"range",label:"X Percentage Position",tooltip:"0% is left, 100% is right",options:{min:0,max:100}}},{value:r.yPercentagePosition*100,prop:"yPercentagePosition",entry:{section:"Transform",type:"range",label:"Y Percentage Position",tooltip:"0% is top, 100% is bottom",options:{min:0,max:100}}}]}},AB=gk;var P=class r{constructor(){}static _app=void 0;static get app(){if(!r._app)throw new Error("[Pixi\u2019VN] CanvasManagerStatic.app is undefined");return r._app}static get gameLayer(){let e=this.app.stage.getChildByLabel(Rr);return e||(e=new $,e.label=Rr,this.app.stage.addChild(e)),e}static htmlLayout;static canvasWidth=300;static canvasHeight=300;static _isInitialized=false;static async init(e,t,i,s,n){return r.canvasWidth=t,r.canvasHeight=i,r._app=new Oc,r.app.init({resolution:window.devicePixelRatio||1,autoDensity:true,width:t,height:i,...s}).then(()=>{let{app:o=r.app,extensions:a=[],...u}=n||{};yB({app:o,extensions:[AB,...a],...u}),r._isInitialized=true,r.addCanvasIntoHTMLElement(e),window.addEventListener("resize",r.resize),r.resize(),r.gameLayer;})}static addCanvasIntoHTMLElement(e){r._isInitialized?e.appendChild(r.app.canvas):N.error("GameWindowManager is not initialized");}static initializeHTMLLayout(e){let t=document.createElement("div");t.style.position="absolute",t.style.pointerEvents="none",e.appendChild(t),r.htmlLayout=t,r.resize();}static get screenScale(){let e=Math.max(document.documentElement.clientWidth,window.innerWidth||0),t=Math.max(document.documentElement.clientHeight,window.innerHeight||0);return Math.min(e/r.canvasWidth,t/r.canvasHeight)}static get screenWidth(){return Math.floor(r.screenScale*r.canvasWidth)}static get screenHeight(){return Math.floor(r.screenScale*r.canvasHeight)}static get horizontalMargin(){return (Math.max(document.documentElement.clientWidth,window.innerWidth||0)-r.screenWidth)/2}static get verticalMargin(){return (Math.max(document.documentElement.clientHeight,window.innerHeight||0)-r.screenHeight)/2}static resize(){if(r._isInitialized){let e=r.app.canvas.style;e.width=`${r.screenWidth}px`,e.height=`${r.screenHeight}px`,e.marginLeft=`${r.horizontalMargin}px`,e.marginRight=`${r.horizontalMargin}px`,e.marginTop=`${r.verticalMargin}px`,e.marginBottom=`${r.verticalMargin}px`;}r.htmlLayout&&(r.htmlLayout.style.width=`${r.screenWidth}px`,r.htmlLayout.style.height=`${r.screenHeight}px`,r.htmlLayout.style.marginLeft=`${r.horizontalMargin}px`,r.htmlLayout.style.marginRight=`${r.horizontalMargin}px`,r.htmlLayout.style.marginTop=`${r.verticalMargin}px`,r.htmlLayout.style.marginBottom=`${r.verticalMargin}px`);}static get childrenAliasesOrder(){return r.gameLayer.children.filter(e=>e.label).sort((e,t)=>r.gameLayer.getChildIndex(e)-r.gameLayer.getChildIndex(t)).map(e=>e.label)}static get currentTickersWithoutCreatedBySteps(){return Object.fromEntries(Object.entries(r._currentTickers).filter(([e,t])=>!t.createdByTicketSteps))}static _currentTickers={};static _currentTickersSequence={};static _currentTickersTimeouts={};static _tickersToCompleteOnStepEnd={tikersIds:[],stepAlias:[]};static _tickersOnPause={};static generateTickerId(e){try{return (0,CB.default)(JSON.stringify(e)).toString()+"_"+Math.random().toString(36).substring(7)}catch(t){throw new Error(`[Pixi\u2019VN] Error to generate ticker id: ${t}`)}}static addTickerTimeoutInfo(e,t,i,s){typeof e=="string"&&(e=[e]),r._currentTickersTimeouts[i]={aliases:e,ticker:t,canBeDeletedBeforeEnd:s};}static removeTickerTimeoutInfo(e){typeof e!="string"&&(e=e.toString()),r._currentTickersTimeouts[e]&&delete r._currentTickersTimeouts[e];}static removeTickerTimeout(e){typeof e!="string"&&(e=e.toString()),clearTimeout(Number(e)),r.removeTickerTimeoutInfo(e);}static removeTickerTimeoutsByAlias(e,t){Object.entries(r._currentTickersTimeouts).forEach(([i,s])=>{let n=s.aliases.filter(o=>o!==e);if(n.length===0){let o=s.canBeDeletedBeforeEnd;(!t||o)&&r.removeTickerTimeout(i);}else r._currentTickersTimeouts[i].aliases=n;});}};pe();var rS={};function iS(r){return function(e){$t(e,r);}}function $t(r,e){e||(e=r.name),rS[e]&&N.warn(`CanvasElement ${e} already registered`),r.prototype.pixivnId=e,rS[e]=r;}function PB(r){try{let e=rS[r];if(!e){N.error(`CanvasElement ${r} not found, did you forget to register it with the canvasComponentDecorator?`);return}return new e,e}catch(e){N.error(`Error while getting CanvasElement ${r}`,e);return}}var Kx={};function wB(r){return function(e){r||(r=e.name),Kx[r]&&N.info(`Event ${r} already exists, it will be overwritten`),e.prototype.id=r,Kx[r]=e;}}function Zx(r){try{let e=Kx[r];if(!e){N.error(`Event ${r} not found, did you forget to register it with the eventDecorator?`);return}return new e,e}catch(e){N.error(`Error while getting Event ${r}`,e);return}}function zu(r){try{let e=Kx[r];if(!e){N.error(`Event ${r} not found, did you forget to register it with the eventDecorator?`);return}return new e}catch(e){N.error(`Error while getting Event ${r}`,e);return}}async function Qx(r){let e=xk(r.pixivnId);if(e)await e.setMemory(r);else throw new Error("[Pixi\u2019VN] The element "+r.pixivnId+" could not be created");return e}function xk(r){try{let e=PB(r);return e?new e:void 0}catch(e){N.error(`Error while getting CanvasElement ${r}`,e);return}}pe();pe();function sS(r,e){let t=r.source.label;return {url:t,alias:e===t?void 0:e}}function wh(r){if(Xe.cache.has(r)){let e=Xe.get(r);e&&e instanceof A&&(r=e.source.label);}return !!r.match(new RegExp(`(${bB.join("|")})$`))}pe();async function $r(r){if(r!=="EMPTY"){if(!r){N.error("Texture not found",r);return}if(Xe.cache.has(r)){let e=Xe.get(r);if(e)return e}return Xe.load(r).then(e=>{if(!e){N.error("Texture not found",r);return}if(!(e instanceof A)){N.error("File not is a file",r);return}return e}).catch(e=>{N.error("Error loading file",e);})}}function BB(r,e){if(!(r instanceof Object))return r;N.warn(`Text.style.${e} is a FillGradient or FillPattern, this is not supported yet.`,r);}function RB(r){return {align:r.align,breakWords:r.breakWords,dropShadow:r.dropShadow,fill:BB(r.stroke,"fill"),fontFamily:r.fontFamily,fontSize:r.fontSize,fontStyle:r.fontStyle,fontVariant:r.fontVariant,fontWeight:r.fontWeight,leading:r.leading,letterSpacing:r.letterSpacing,lineHeight:r.lineHeight,padding:r.padding,stroke:BB(r.stroke,"stroke"),textBaseline:r.textBaseline,trim:r.trim,whiteSpace:r.whiteSpace,wordWrap:r.wordWrap,wordWrapWidth:r.wordWrapWidth}}function nS(r){return "memory"in r?r.memory:r instanceof cr?oS(r):r instanceof xe?Bh(r):Ao(r)}function Ao(r,e){let t=Hu,i=e?.childrenExport||false;r.hasOwnProperty("pixivnId")&&(t=r.pixivnId);let s=[];return i&&r.children.sort((n,o)=>r.getChildIndex(n)-r.getChildIndex(o)).forEach(n=>{s.push(nS(n));}),{pixivnId:t,elements:s,width:r.width,height:r.height,isRenderGroup:r.isRenderGroup,blendMode:r.blendMode,tint:r.tint,alpha:r.alpha,angle:r.angle,renderable:r.renderable,rotation:r.rotation,scale:{x:r.scale.x,y:r.scale.y},pivot:{x:r.pivot.x,y:r.pivot.y},position:{x:r.position.x,y:r.position.y},skew:{x:r.skew.x,y:r.skew.y},visible:r.visible,x:r.x,y:r.y,boundsArea:r.boundsArea,cursor:r.cursor,eventMode:r.eventMode,interactive:r.interactive,interactiveChildren:r.interactiveChildren,hitArea:r.hitArea}}function Bh(r){let e=Ao(r),t=e.pixivnId??Vu,i={};"onEvents"in r&&(i=r.onEvents);let s;return "textureAlias"in r?s=sS(r.texture,r.textureAlias):s=sS(r.texture),{...e,pixivnId:t,textureData:s,anchor:{x:r.anchor.x,y:r.anchor.y},roundPixels:r.roundPixels,onEvents:i}}function oS(r){let e=Ao(r),t=e.pixivnId??Wu,i={};return "onEvents"in r&&(i=r.onEvents),{...e,pixivnId:t,anchor:{x:r.anchor.x,y:r.anchor.y},text:r.text,resolution:r.resolution,style:RB(r.style),roundPixels:r.roundPixels,onEvents:i}}var ws=class extends ${constructor(e){super(e),this.pixivnId=this.constructor.prototype.pixivnId||Hu;}pixivnId=Hu;get memory(){return Ao(this,{childrenExport:true})}set memory(e){}async setMemory(e){return this.memory=e,await this.importChildren(e),await qr(this,e)}async importChildren(e){for(let t=0;t<e.elements.length;t++){let i=e.elements[t],s=await Qx(i);this.addChild(s);}}_onEvents={};get onEvents(){return this._onEvents}onEvent(e,t){let i=t.prototype.id,s=zu(i);return this._onEvents[e]=i,s?super.on(e,()=>{s.fn(e,this);}):N.error(`Event ${i} not found`),this}on(e,t,i){return super.on(e,t,i)}};$t(ws,Hu);async function qr(r,e,t){let i=t?.ignoreScale||false,s=t?.end;"isRenderGroup"in e&&e.isRenderGroup!==void 0&&(r.isRenderGroup=e.isRenderGroup),"blendMode"in e&&e.blendMode!==void 0&&(r.blendMode=e.blendMode),"tint"in e&&e.tint!==void 0&&(r.tint=e.tint),"alpha"in e&&e.alpha!==void 0&&(r.alpha=e.alpha),"angle"in e&&e.angle!==void 0&&(r.angle=e.angle),"renderable"in e&&e.renderable!==void 0&&(r.renderable=e.renderable),"rotation"in e&&e.rotation!==void 0&&(r.rotation=e.rotation),!i&&"scale"in e&&e.scale!==void 0&&(typeof e.scale=="number"?r.scale.set(e.scale,e.scale):r.scale.set(e.scale.x,e.scale.y)),"pivot"in e&&e.pivot!==void 0&&(typeof e.pivot=="number"?r.pivot.set(e.pivot,e.pivot):r.pivot.set(e.pivot.x,e.pivot.y)),"position"in e&&e.position!==void 0&&r.position.set(e.position.x,e.position.y),"skew"in e&&e.skew!==void 0&&r.skew.set(e.skew.x,e.skew.y),"visible"in e&&e.visible!==void 0&&(r.visible=e.visible),"x"in e&&e.x!==void 0&&(r.x=e.x),"y"in e&&e.y!==void 0&&(r.y=e.y),"boundsArea"in e&&e.boundsArea!==void 0&&(r.boundsArea=e.boundsArea),"cursor"in e&&e.cursor!==void 0&&(r.cursor=e.cursor),"eventMode"in e&&e.eventMode!==void 0&&(r.eventMode=e.eventMode),"interactive"in e&&e.interactive!==void 0&&(r.interactive=e.interactive),"interactiveChildren"in e&&e.interactiveChildren!==void 0&&(r.interactiveChildren=e.interactiveChildren),"hitArea"in e&&e.hitArea!==void 0&&(r.hitArea=e.hitArea),s&&await s(),i||("width"in e&&e.width!==void 0&&(r.width=e.width),"height"in e&&e.height!==void 0&&(r.height=e.height));}pe();function bi(r,e,t,i,s,n=0){return i=i*(s?-1:1),r==="width"?e*(C.screen.width-t)+i+n*t+(s?t:0):e*(C.screen.height-t)+i+n*t+(s?t:0)}function jr(r,e,t,i,s,n=0){return i=i*(s?-1:1),r==="width"?(e-i-n*t-(s?t:0))/(C.screen.width-t):(e-i-n*t-(s?t:0))/(C.screen.height-t)}function yi(r,e){return r==="width"?e*C.screen.width:e*C.screen.height}function Kr(r,e){return r==="width"?e/C.screen.width:e/C.screen.height}function $e(r,e){if(e=e%360,e<0&&(e+=360),e===0)return {x:r.x,y:r.y};if(e===90)return {x:-r.y,y:r.x};if(e===180)return {x:-r.x,y:-r.y};if(e===270)return {x:r.y,y:-r.x};if(e>0&&e<90){let t=e*Math.PI/180,i=Math.cos(t),s=Math.sin(t);return {x:r.x*i-r.y*s,y:r.x*s+r.y*i}}else if(e>90&&e<180){let t=(e-90)*Math.PI/180,i=Math.cos(t),s=Math.sin(t);return {x:-r.y*s-r.x*i,y:r.y*i-r.x*s}}else if(e>180&&e<270){let t=(e-180)*Math.PI/180,i=Math.cos(t),s=Math.sin(t);return {x:-r.x*i+r.y*s,y:-r.x*s-r.y*i}}else if(e>270&&e<360){let t=(e-270)*Math.PI/180,i=Math.cos(t),s=Math.sin(t);return {x:r.y*s-r.x*i,y:-r.y*i-r.x*s}}return {x:0,y:0}}function aS(r,e){if(e=e%360,e<0&&(e+=360),e===0)return {x:r.x,y:r.y};if(e===90)return {x:r.y,y:-r.x};if(e===180)return {x:-r.x,y:-r.y};if(e===270)return {x:-r.y,y:r.x};if(e>0&&e<90){let t=e*Math.PI/180,i=Math.cos(t),s=Math.sin(t);return {x:r.x*i+r.y*s,y:-r.x*s+r.y*i}}else if(e>90&&e<180){let t=(e-90)*Math.PI/180,i=Math.cos(t),s=Math.sin(t);return {x:r.y*i-r.x*s,y:-r.y*s-r.x*i}}else if(e>180&&e<270){let t=(e-180)*Math.PI/180,i=Math.cos(t),s=Math.sin(t);return {x:-r.x*i-r.y*s,y:r.x*s-r.y*i}}else if(e>270&&e<360){let t=(e-270)*Math.PI/180,i=Math.cos(t),s=Math.sin(t);return {x:-r.y*i+r.x*s,y:r.y*s+r.x*i}}return {x:0,y:0}}function Zr(r){let e=r.width,t=r.height,i=r.angle%360;return i<0&&(i+=360),i===0||i===180?e:i===90||i===270?t:Math.abs(e*Math.cos(i*Math.PI/180))+Math.abs(t*Math.sin(i*Math.PI/180))}function Qr(r){let e=r.width,t=r.height,i=r.angle%360;return i<0&&(i+=360),i===0||i===180?t:i===90||i===270?e:Math.abs(t*Math.cos(i*Math.PI/180))+Math.abs(e*Math.sin(i*Math.PI/180))}pe();function Co(r){return r&&(typeof r.align!="number"&&(r.xAlign!=null&&(r.align===void 0?(r.align={x:r.xAlign},delete r.xAlign):(r.align.x=r.xAlign,delete r.xAlign)),r.yAlign!=null&&(r.align===void 0?(r.align={y:r.yAlign},delete r.yAlign):(r.align.y=r.yAlign,delete r.yAlign))),typeof r.percentagePosition!="number"&&(r.xPercentagePosition!=null&&(r.percentagePosition===void 0?(r.percentagePosition={x:r.xPercentagePosition},delete r.xPercentagePosition):(r.percentagePosition.x=r.xPercentagePosition,delete r.xPercentagePosition)),r.yPercentagePosition!=null&&(r.percentagePosition===void 0?(r.percentagePosition={y:r.yPercentagePosition},delete r.yPercentagePosition):(r.percentagePosition.y=r.yPercentagePosition,delete r.yPercentagePosition))),r)}pe();pe();var Jr=class r extends xe{constructor(e){super(e),this.pixivnId=this.constructor.prototype.pixivnId||Vu;}pixivnId=Vu;_textureAlias;get textureAlias(){return this._textureAlias?this._textureAlias:this.texture.source.label}set textureAlias(e){this._textureAlias=e;}get memory(){return Bh(this)}set memory(e){}async setMemory(e){return this.memory=e,await Rh(this,e)}_onEvents={};get onEvents(){return this._onEvents}onEvent(e,t){let i=t.prototype.id,s=zu(i);return this._onEvents[e]=i,s?(super.on(e,()=>{s.fn(e,this);}),this.interactive||(this.interactive=true,this.eventMode="dynamic")):N.error(`Event ${i} not found`),this}on(e,t,i){return super.on(e,t,i)}static from(e,t){let i=xe.from(e,t),s=new r;return s.texture=i.texture,s}};$t(Jr,Vu);async function Rh(r,e,t){let i=t?.ignoreTexture||false;if(await qr(r,e),!i){if("textureImage"in e&&e.textureImage&&e.textureImage.image){let n=await $r(e.textureImage.image);n&&(r.texture=n);}if("textureData"in e&&(e.textureData.alias&&(r.textureAlias=e.textureData.alias),e.textureData.url!=="EMPTY")){let n=e.textureData.url;e.textureData.alias&&Xe.resolver.hasKey(e.textureData.alias)&&(n=e.textureData.alias);let o=await $r(n);o&&(r.texture=o);}}let s=t?.half;if(s&&await s(),"anchor"in e&&e.anchor!==void 0&&(typeof e.anchor=="number"?r.anchor.set(e.anchor,e.anchor):r.anchor.set(e.anchor.x,e.anchor.y)),"roundPixels"in e&&e.roundPixels!==void 0&&(r.roundPixels=e.roundPixels),"onEvents"in e)for(let n in e.onEvents){let o=e.onEvents[n],a=Zx(o);a&&r.onEvent(n,a);}}var _e=class r extends Jr{pixivnId=eS;constructor(e,t){e=Co(e);let i,s;e&&"align"in e&&e?.align!==void 0&&(i=e.align,delete e.align),e&&"percentagePosition"in e&&e?.percentagePosition!==void 0&&(s=e.percentagePosition,delete e.percentagePosition),super(e),t&&(this.textureAlias=t),i&&(this.align=i),s&&(this.percentagePosition=s);}get memory(){return {...Bh(this),pixivnId:this.pixivnId,align:this._align,percentagePosition:this._percentagePosition,loadIsStarted:this._loadIsStarted}}set memory(e){}async setMemory(e){this.memory=e,await Mh(this,e),this.reloadPosition();}static from(e,t){let i=xe.from(e,t),s=new r;return s.texture=i.texture,s}_loadIsStarted=false;get loadIsStarted(){return this._loadIsStarted}async load(){return this._loadIsStarted=true,$r(this.textureAlias).then(e=>{this._loadIsStarted=false,e&&(this.texture=e);}).catch(e=>{this._loadIsStarted=false,N.error("Error into ImageSprite.load()",e);})}set texture(e){super.texture=e,this.reloadPosition();}get texture(){return super.texture}get haveEmptyTexture(){return this.texture._source.label==="EMPTY"}_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=$e(this.pivot,this.angle),t=$e(this.scale,this.angle);return {x:jr("width",this.x,Zr(this),e.x,t.x<0,this.anchor.x),y:jr("height",this.y,Qr(this),e.y,t.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=$e(this.pivot,this.angle),t=$e(this.scale,this.angle);return jr("width",this.x,Zr(this),e.x,t.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=$e(this.pivot,this.angle),t=$e(this.scale,this.angle);return jr("height",this.y,Qr(this),e.y,t.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:Kr("width",this.x),y:Kr("height",this.y)}}get xPercentagePosition(){return Kr("width",this.x)}set xPercentagePosition(e){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.x=e,this.reloadPosition();}get yPercentagePosition(){return Kr("height",this.y)}set yPercentagePosition(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(){return this._align?{x:this._align.x||0,y:this._align.y||0,type:"align"}:this._percentagePosition?{x:this._percentagePosition.x||0,y:this._percentagePosition.y||0,type:"percentage"}:{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=$e(this.pivot,this.angle),t=$e(this.scale,this.angle);this._align.x!==void 0&&(super.x=bi("width",this._align.x,Zr(this),e.x,t.x<0,this.anchor.x)),this._align.y!==void 0&&(super.y=bi("height",this._align.y,Qr(this),e.y,t.y<0,this.anchor.y));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=yi("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=yi("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;}};$t(_e,eS);async function Mh(r,e,t){let i=t?.ignoreTexture||false;return e=Co(e),await Rh(r,e,{half:async()=>{"align"in e&&e.align!==void 0&&(r.align=e.align),"percentagePosition"in e&&e.percentagePosition!==void 0&&(r.percentagePosition=e.percentagePosition),i||"imageLink"in e&&e.imageLink!==void 0&&(r.textureAlias=e.imageLink),"loadIsStarted"in e&&e.loadIsStarted&&await r.load();},ignoreTexture:t?.ignoreTexture})}pe();var Et=class r extends _e{constructor(e,t){let i,s,n;e&&"loop"in e&&e?.loop!==void 0&&(i=e.loop,delete e.loop),e&&"paused"in e&&e?.paused!==void 0&&(s=e.paused,delete e.paused),e&&"currentTime"in e&&e?.currentTime!==void 0&&(n=e.currentTime,delete e.currentTime),super(e,t),i&&(this.loop=i),s&&(this.paused=s),n&&(this.currentTime=n);}pixivnId=tS;get memory(){return {...super.memory,pixivnId:this.pixivnId,loop:this.loop,paused:this._paused,currentTime:this.currentTime}}set memory(e){}async setMemory(e){return this.memory=e,await uS(this,e)}static from(e,t){let i=xe.from(e,t),s=new r;return s.texture=i.texture,s}async load(){await super.load(),this.loop=this._looop,this.currentTime=this._currentTime,this.paused=this._paused;}_looop=false;get loop(){return this.texture?.source?.resource?.loop||false}set loop(e){this._looop=e,this.texture?.source?.resource&&(this.texture.source.resource.loop=e);}_paused=false;get paused(){return this.texture?.source?.resource?.paused||false}set paused(e){e?this.pause():this.play();}pause(){this._paused=true,this.texture?.source?.resource&&this.texture.source.resource.pause();}play(){this._paused=false,this.texture?.source?.resource&&this.texture.source.resource.play();}_currentTime=0;get currentTime(){return this.texture?.source?.resource?.currentTime||0}set currentTime(e){let t=this.duration;t&&e>=t&&(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}};$t(Et,tS);async function uS(r,e,t){await Mh(r,e,{ignoreTexture:t?.ignoreTexture}),"loop"in e&&e.loop!==void 0&&(r.loop=e.loop),"currentTime"in e&&e.currentTime!==void 0&&(r.currentTime=e.currentTime),"paused"in e&&e.paused!==void 0&&(r.paused=e.paused);}var De=class extends ws{constructor(e,t=[]){e=Co(e);let i,s,n;e&&"anchor"in e&&e?.anchor!==void 0&&(n=e.anchor,delete e.anchor),e&&"align"in e&&e?.align!==void 0&&(i=e.align,delete e.align),e&&"percentagePosition"in e&&e?.percentagePosition!==void 0&&(s=e.percentagePosition,delete e.percentagePosition),super(e),e=Co(e),t&&t.forEach(o=>{let a;wh(o)?a=new Et(void 0,o):a=new _e(void 0,o),this.addChild(a);}),n&&(this.anchor=n),i&&(this.align=i),s&&(this.percentagePosition=s);}get memory(){return {...super.memory,pixivnId:$x,anchor:this._anchor,align:this._align,percentagePosition:this._percentagePosition,loadIsStarted:this._loadIsStarted}}set memory(e){}async setMemory(e){this.memory=e,await this.importChildren(e),await lS(this,e),this.reloadAnchor(),this.reloadPosition();}pixivnId=$x;_loadIsStarted=false;get loadIsStarted(){return this._loadIsStarted}async load(){this._loadIsStarted=true;let e=Array(this.children.length);for(let t=0;t<this.children.length;t++)e[t]=this.children[t].load();return Promise.all(e).then(()=>{this._loadIsStarted=false,this.reloadAnchor(),this.reloadPosition();}).catch(t=>{this._loadIsStarted=false,N.error("Error into ImageContainer.load()",t);})}get texture(){return this.children.length>0?this.children[0].texture:new A}get haveEmptyTexture(){return this.children.some(e=>e.texture._source.label==="EMPTY")}_anchor;get anchor(){let e=super.pivot.x/this.width,t=super.pivot.y/this.height;return {x:e,y:t}}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=$e(this.pivot,this.angle),t=$e(this.scale,this.angle);return {x:jr("width",this.x,Zr(this),e.x,t.x<0,this.anchor.x),y:jr("height",this.y,Qr(this),e.y,t.y<0,this.anchor.y)}}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=$e(this.pivot,this.angle),t=$e(this.scale,this.angle);return jr("width",this.x,Zr(this),e.x,t.x<0,this.anchor.x)}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=$e(this.pivot,this.angle),t=$e(this.scale,this.angle);return jr("height",this.y,Qr(this),e.y,t.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:Kr("width",this.x),y:Kr("height",this.y)}}set xPercentagePosition(e){this._align&&(this._align=void 0),this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.x=e,this.reloadPosition();}get xPercentagePosition(){return Kr("width",this.x)}set yPercentagePosition(e){this._align&&(this._align=void 0),this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.y=e,this.reloadPosition();}get yPercentagePosition(){return Kr("height",this.y)}get positionType(){return this._align?"align":this._percentagePosition?"percentage":"pixel"}get positionInfo(){return this._align?{x:this._align.x||0,y:this._align.y||0,type:"align"}:this._percentagePosition?{x:this._percentagePosition.x||0,y:this._percentagePosition.y||0,type:"percentage"}:{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=$e(this.pivot,this.angle),t=$e(this.scale,this.angle);this._align.x!==void 0&&(super.x=bi("width",this._align.x,Zr(this),e.x,t.x<0)),this._align.y!==void 0&&(super.y=bi("height",this._align.y,Qr(this),e.y,t.y<0));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=yi("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=yi("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;}};$t(De,$x);async function lS(r,e,t){e=Co(e),qr(r,e,{...t,end:async()=>{"anchor"in e&&e.anchor!==void 0&&(r.anchor=e.anchor),"align"in e&&e.align!==void 0&&(r.align=e.align),"percentagePosition"in e&&e.percentagePosition!==void 0&&(r.percentagePosition=e.percentagePosition),"loadIsStarted"in e&&e.loadIsStarted&&await r.load();}});}pe();var Bs=class extends cr{constructor(e){super(e),this.pixivnId=this.constructor.prototype.pixivnId||Wu;}pixivnId=Wu;get memory(){return oS(this)}set memory(e){}async setMemory(e){return this.memory=e,await cS(this,e)}_onEvents={};get onEvents(){return this._onEvents}onEvent(e,t){let i=t.prototype.id,s=zu(i);return this._onEvents[e]=i,s?(super.on(e,()=>{s.fn(e,this);}),this.interactive||(this.interactive=true,this.eventMode="dynamic")):N.error(`Event ${i} not found`),this}on(e,t,i){return super.on(e,t,i)}};$t(Bs,Wu);async function cS(r,e){if(await qr(r,e),"anchor"in e&&e.anchor!==void 0&&(typeof e.anchor=="number"?r.anchor.set(e.anchor,e.anchor):r.anchor.set(e.anchor.x,e.anchor.y)),"text"in e&&e.text!==void 0&&(r.text=e.text),"resolution"in e&&e.resolution!==void 0&&(r.resolution=e.resolution),"style"in e&&e.style!==void 0&&(r.style=e.style),"roundPixels"in e&&e.roundPixels!==void 0&&(r.roundPixels=e.roundPixels),"onEvents"in e)for(let t in e.onEvents){let i=e.onEvents[t],s=Zx(i);s&&r.onEvent(t,s);}}var Nt=class{constructor(e,t,i){this.args=e,this.duration=t,this.priority=i,this.id=this.constructor.prototype.id;}id="ticker_id_not_set";args;duration;priority;fn(e,t,i,s){throw new Error("[Pixi\u2019VN] The method TickerBase.fn() must be overridden")}onEndOfTicker(e,t,i){let s="aliasToRemoveAfter"in i&&i.aliasToRemoveAfter||[];typeof s=="string"&&(s=[s]);let n="tickerAliasToResume"in i&&i.tickerAliasToResume||[];typeof n=="string"&&(n=[n]),C.onEndOfTicker(t,{aliasToRemoveAfter:s,tickerAliasToResume:n});}};var hS={};function MB(r){return function(e){vi(e,r);}}function vi(r,e){e||(e=r.name),hS[e]&&N.info(`Ticker ${e} already exists, it will be overwritten`),r.prototype.id=e,hS[e]=r;}function Dh(r,e,t,i){try{let s=hS[r];if(!s){N.error(`Ticker ${r} not found, did you forget to register it with the tickerDecorator?`);return}return new s(e,t,i)}catch(s){N.error(`Error while getting Ticker ${r}`,s);return}}var Xu="aliasToRemoveAfter";var Ih=class{get app(){return P.app}get gameLayer(){return P.gameLayer}get isInitialized(){return P._isInitialized}get htmlLayout(){return P.htmlLayout}set htmlLayout(e){P.htmlLayout=e;}get canvasWidth(){return P.canvasWidth}get canvasHeight(){return P.canvasHeight}set canvasWidth(e){P.canvasWidth=e;}set canvasHeight(e){P.canvasHeight=e;}get screen(){return this.app.screen}async init(e,t,i,s,n){if(typeof t=="number"&&typeof i=="number")return await P.init(e,t,i,s,n);if(typeof t!="number"&&typeof i!="number")return await P.init(e,t.width,t.height,t,i);throw new Error("Invalid parameters")}initializeHTMLLayout(e){return P.initializeHTMLLayout(e)}get children(){return P.gameLayer.children}async copyCanvasElementProperty(e,t){if(typeof t=="string"){let i=this.find(t);if(i)t=i;else {N.error(`Canvas element ${t} not found`);return}}if(typeof e=="string"){let i=this.find(e);if(i)e=i;else {N.error(`Canvas element ${e} not found`);return}}e instanceof $&&(e=e.memory),"isRenderGroup"in e&&delete e.isRenderGroup,"scale"in e&&delete e.scale,"visible"in e&&delete e.visible,"boundsArea"in e&&delete e.boundsArea,"text"in e&&delete e.text,"resolution"in e&&delete e.resolution,"style"in e&&delete e.style,"height"in e&&delete e.height,"width"in e&&delete e.width,t instanceof Et?await uS(t,e,{ignoreTexture:true}):t instanceof _e?await Mh(t,e,{ignoreTexture:true}):t instanceof Jr?await Rh(t,e,{ignoreTexture:true}):t instanceof Bs?await cS(t,e):t instanceof De?await lS(t,e):t instanceof $&&await qr(t,e);}transferTickers(e,t,i="move"){P._currentTickersSequence[e]&&(i==="move"?P._currentTickersSequence[t]=St(P._currentTickersSequence[e]):i==="duplicate"&&(P._currentTickersSequence[t]=St(P._currentTickersSequence[e]))),Object.entries(P._currentTickers).forEach(([s,n])=>{if(n.createdByTicketSteps?.canvasElementAlias===e&&this.removeTicker(s),n.canvasElementAliases.includes(e)&&(i==="move"?n.canvasElementAliases=n.canvasElementAliases.map(o=>o===e?t:o):i==="duplicate"&&n.canvasElementAliases.find(o=>o===e)&&n.canvasElementAliases.push(t),n.args.hasOwnProperty(Xu))){let o=n.args.aliasToRemoveAfter;typeof o=="string"&&(o=[o]),Array.isArray(o)&&(i==="move"?n.args.aliasToRemoveAfter=o.map(a=>a===e?t:a):i==="duplicate"&&o.find(a=>a===e)&&(n.args.aliasToRemoveAfter=[...o,t]));}}),Object.values(P._currentTickersTimeouts).forEach(s=>{s.aliases.includes(e)&&(i==="move"?s.aliases=s.aliases.map(n=>n===e?t:n):i==="duplicate"&&s.aliases.find(n=>n===e)&&s.aliases.push(t));}),P._currentTickersSequence[t]&&Object.keys(P._currentTickersSequence[t]).forEach(s=>{this.runTickersSequence(t,s);}),i==="duplicate"&&P._currentTickersSequence[e]&&Object.keys(P._currentTickersSequence[e]).forEach(s=>{this.runTickersSequence(e,s);});}add(e,t,i={}){if(e===Rr){N.error(`The alias ${Rr} is reserved`);return}let s=this.find(e),n=i?.ignoreOldStyle;s&&!n&&this.copyCanvasElementProperty(s,t);let o=i.zIndex;s&&!this.gameLayer.children.includes(s)?N.error(`The canvas element ${e} exist in the memory but it is not on the canvas, so the zIndex is not set`):s&&(o===void 0&&(o=this.gameLayer.getChildIndex(s)),this.remove(e,{ignoreTickers:true})),o!==void 0?(t.label=e,this.gameLayer.addChildAt(t,o)):(t.label=e,this.gameLayer.addChild(t));}addCanvasElement(e,t){this.add(e,t);}remove(e,t={}){if(e===Rr){N.error(`The alias ${Rr} is reserved`);return}let i=t.ignoreTickers;typeof e=="string"&&(e=[e]),e.forEach(s=>{this.gameLayer.getChildrenByLabel(s).forEach(n=>{this.gameLayer.removeChild(n),!i&&this.unlinkComponentFromTicker(s);});});}removeCanvasElement(e){this.remove(e);}find(e){if(e===Rr)return this.gameLayer;let t=this.gameLayer.getChildByLabel(e);if(t)return t}getCanvasElement(e){return this.find(e)}canvasElementIsOnCanvas(e){return this.gameLayer.children.includes(e)}removeAll(){this.gameLayer.removeChildren(),this.removeAllTickers();}editAlias(e,t,i={}){let s=this.find(e);s&&(s.label=t),!i.ignoreTickers&&this.transferTickers(e,t,"move");}get currentTickers(){return P._currentTickers}get currentTickersSteps(){return P._currentTickersSequence}addTicker(e,t){let i=t.id;if(typeof e=="string"&&(e=[e]),!Dh(i,t.args,t.duration,t.priority)){N.error(`Ticker ${i} not found`);return}let s={fn:()=>{},id:i,args:St(t.args),canvasElementAliases:e,priority:t.priority,duration:t.duration,onEndOfTicker:()=>{}},n=P.generateTickerId(s);if(this.pushTicker(n,s,t),this.pushEndOfTicker(n,s,t),t.duration){let o=setTimeout(()=>{P.removeTickerTimeoutInfo(o),P._currentTickersTimeouts[o.toString()]&&this.onEndOfTicker(n,{aliasToRemoveAfter:Xu in t.args?t.args.aliasToRemoveAfter||[]:[],tickerAliasToResume:"tickerAliasToResume"in t.args?t.args.tickerAliasToResume||[]:[],ignoreTickerSteps:true});},t.duration*1e3);P.addTickerTimeoutInfo(e,i,o.toString(),true);}return n}pushTicker(e,t,i){P._currentTickers[e]=t,t.fn=s=>{let n=P._currentTickers[e];if(n){let o=n.canvasElementAliases;if(t.createdByTicketSteps){if(this.isTickerPaused(t.createdByTicketSteps.canvasElementAlias,t.createdByTicketSteps.id))return}else o=o.filter(a=>!this.isTickerPaused(a,e));i?.fn(s,n.args,o,e);}},this.app.ticker.add(t.fn,void 0,t.priority);}pushEndOfTicker(e,t,i){t.onEndOfTicker=()=>{i.onEndOfTicker(t.canvasElementAliases,e,t.args);};}addTickersSteps(e,t,i=0){return this.addTickersSequence(e,t,i)}addTickersSequence(e,t,i=0){if(t.length==0){N.warn("The steps of the tickers is empty");return}e in P._currentTickersSequence||(P._currentTickersSequence[e]={});let s={currentStepNumber:i,steps:t.map(o=>o===Ph||o.hasOwnProperty("type")&&o.type==="pause"?o:{ticker:o.id,args:St(o.args),duration:o.duration})},n=P.generateTickerId(s);return P._currentTickersSequence[e][n]=s,this.runTickersSequence(e,n),n}runTickersSequence(e,t){if(!P._currentTickersSequence[e]||!P._currentTickersSequence[e][t])return;let i=P._currentTickersSequence[e][t].steps[P._currentTickersSequence[e][t].currentStepNumber];if(i===Ph&&(i=P._currentTickersSequence[e][t].steps[0],P._currentTickersSequence[e][t].currentStepNumber=0,i===Ph)){N.error("TikersSteps has a RepeatType in the first step");return}if(i.hasOwnProperty("type")&&i.type==="pause"){let u=setTimeout(()=>{let l=P._currentTickersTimeouts[u.toString()];l&&l.aliases.forEach(c=>{this.nextTickerStep(c,t);}),P.removeTickerTimeoutInfo(u);},i.duration*1e3);P.addTickerTimeoutInfo(e,"steps",u.toString(),false);return}let s=Dh(i.ticker,i.args,i.duration,i.priority);if(!s){N.error(`Ticker ${i.ticker} not found`);return}let n=s.id,o={fn:()=>{},id:n,args:St(s.args),canvasElementAliases:[e],priority:s.priority,duration:s.duration,createdByTicketSteps:{canvasElementAlias:e,id:t},onEndOfTicker:()=>{}},a=P.generateTickerId(o);if(this.pushTicker(a,o,s),s.duration){let u=setTimeout(()=>{let l=P._currentTickersTimeouts[u.toString()];l&&(this.onEndOfTicker(a,{aliasToRemoveAfter:Xu in s.args?s.args.aliasToRemoveAfter||[]:[],tickerAliasToResume:"tickerAliasToResume"in s.args?s.args.tickerAliasToResume||[]:[],ignoreTickerSteps:true}),l.aliases.forEach(c=>{this.nextTickerStep(c,t);})),P.removeTickerTimeoutInfo(u);},s.duration*1e3);P.addTickerTimeoutInfo(e,n,u.toString(),false);}}nextTickerStep(e,t){if(P._currentTickersSequence[e]&&P._currentTickersSequence[e][t]){let i=P._currentTickersSequence[e][t];i.currentStepNumber+1<i.steps.length?(i.currentStepNumber++,P._currentTickersSequence[e][t]=i,this.runTickersSequence(e,t)):t&&P._currentTickersSequence[e]&&P._currentTickersSequence[e][t]&&(delete P._currentTickersSequence[e][t],Object.entries(P._currentTickers).forEach(([s,n])=>{n.createdByTicketSteps?.canvasElementAlias===e&&n.createdByTicketSteps.id===t&&this.removeTicker(s);}));}}onEndOfTicker(e,t){let i=P._currentTickers[e],s=t.ignoreTickerSteps||false;this.remove(t.aliasToRemoveAfter),this.resumeTicker(t.tickerAliasToResume),i&&(this.removeTicker(e),!s&&i.duration==null&&i.createdByTicketSteps&&this.nextTickerStep(i.createdByTicketSteps.canvasElementAlias,i.createdByTicketSteps.id));}unlinkComponentFromTicker(e,t){if(typeof e=="string"&&(e=[e]),!t){e.forEach(s=>{Object.entries(P._currentTickers).forEach(([n,o])=>{o.canvasElementAliases.includes(s)&&(o.canvasElementAliases.length===1?this.removeTicker(n):o.canvasElementAliases=o.canvasElementAliases.filter(a=>a!==s));}),P._currentTickersSequence[s]&&delete P._currentTickersSequence[s],P.removeTickerTimeoutsByAlias(s,false);});return}let i;typeof t=="string"?i=t:t instanceof Nt?i=t.id:i=t.prototype.id,e.forEach(s=>{P._currentTickersSequence[s]&&Object.entries(P._currentTickersSequence[s]).forEach(([n,o])=>{o.steps.find(a=>typeof a=="object"&&"ticker"in a&&a.ticker===i)&&delete P._currentTickersSequence[s][n];});}),Object.entries(P._currentTickers).forEach(([s,n])=>{n.id===i&&(P._currentTickers[s].canvasElementAliases=n.canvasElementAliases.filter(o=>!e.includes(o)));}),Object.entries(P._currentTickersTimeouts).forEach(([s,n])=>{n.ticker===i&&n.canBeDeletedBeforeEnd&&(P._currentTickersTimeouts[s].aliases=n.aliases.filter(o=>!e.includes(o)));}),this.removeTickersWithoutAssociatedCanvasElement();}removeTickersWithoutAssociatedCanvasElement(){Object.entries(P._currentTickers).forEach(([e,t])=>{t.canvasElementAliases=t.canvasElementAliases.filter(i=>this.find(i)),t.canvasElementAliases.length===0&&this.onEndOfTicker(e,{aliasToRemoveAfter:Xu in t.args?t.args.aliasToRemoveAfter:[],tickerAliasToResume:"tickerAliasToResume"in t.args?t.args.tickerAliasToResume:[],ignoreTickerSteps:true});}),Object.entries(P._currentTickersSequence).forEach(([e,t])=>{t===void 0&&delete P._currentTickersSequence[e];}),Object.entries(P._currentTickersTimeouts).forEach(([e,{aliases:t}])=>{t.length===0&&P.removeTickerTimeout(e);});}removeAllTickers(){P._currentTickersSequence={},Object.keys(P._currentTickers).forEach(e=>{this.removeTicker(e);}),P._currentTickers={};for(let e in P._currentTickersTimeouts)P.removeTickerTimeout(e);P._tickersToCompleteOnStepEnd={tikersIds:[],stepAlias:[]},P._tickersOnPause={};}removeTicker(e){typeof e=="string"&&(e=[e]),e.forEach(t=>{let i=P._currentTickers[t];if(i){if(i.args.hasOwnProperty(Xu)){let s=i.args.aliasToRemoveAfter;this.remove(s);}this.app.ticker.remove(i.fn),delete P._currentTickers[t];}});}putOnPauseTicker(e,t={}){this.pauseTicker(e,t);}pauseTicker(e,t={}){let i=P._tickersOnPause[e];if(!i){P._tickersOnPause[e]=t;return}t.tickerIdsExcluded&&(i.tickerIdsExcluded?P._tickersOnPause[e].tickerIdsExcluded=[...i.tickerIdsExcluded,...t.tickerIdsExcluded]:P._tickersOnPause[e].tickerIdsExcluded=t.tickerIdsExcluded),t.tickerIdsIncluded&&(i.tickerIdsIncluded?P._tickersOnPause[e].tickerIdsIncluded=[...i.tickerIdsIncluded,...t.tickerIdsIncluded]:P._tickersOnPause[e].tickerIdsIncluded=t.tickerIdsIncluded);}resumeTickerPaused(e){this.resumeTicker(e);}resumeTicker(e){typeof e=="string"&&(e=[e]),e.forEach(t=>{delete P._tickersOnPause[t];});}isTickerPaused(e,t){let i=P._tickersOnPause[e];if(i){if(t){if("tickerIdsIncluded"in i&&i.tickerIdsIncluded)return i.tickerIdsIncluded.includes(t);if("tickerIdsExcluded"in i&&i.tickerIdsExcluded)return !i.tickerIdsExcluded.includes(t)}return true}return false}completeTickerOnStepEnd(e){e.alias?P._tickersToCompleteOnStepEnd.stepAlias.push({id:e.id,alias:e.alias}):P._tickersToCompleteOnStepEnd.tikersIds.push({id:e.id});}forceCompletionOfTicker(e,t){if(t){let i=P._currentTickersSequence[t];i&&i[e]&&(i[e].steps.includes(Ph)?N.error(`The ticker alias: ${t} id: ${e} contains a RepeatType, so it can't be forced to complete`,i[e]):i[e].steps.forEach(s=>{if(typeof s=="object"&&"ticker"in s){let n=Dh(s.ticker,s.args,s.duration,s.priority);n&&n.onEndOfTicker([t],e,s.args);}}));}else {let i=P._currentTickers[e];i&&i.onEndOfTicker();}}addLayer(e,t){if(e===Rr){N.error(`The alias ${Rr} is reserved`);return}return t.label=e,P.app.stage.addChild(t)}getLayer(e){return P.app.stage.getChildByLabel(e)}removeLayer(e){P.app.stage.getChildrenByLabel(e);}async extractImage(){return (await this.app.renderer.extract.image(this.gameLayer)).src}clear(){this.removeAll();}export(){let e={};return this.children.forEach(t=>{t.label&&(e[t.label]=nS(t));}),{tickers:St(P.currentTickersWithoutCreatedBySteps),tickersSteps:St(P._currentTickersSequence),elements:St(e),stage:St(Ao(this.gameLayer)),elementAliasesOrder:St(P.childrenAliasesOrder),tickersOnPause:St(P._tickersOnPause),tickersToCompleteOnStepEnd:St(P._tickersToCompleteOnStepEnd)}}async restore(e){try{let t={};if(e.hasOwnProperty("elementAliasesOrder")&&e.hasOwnProperty("elements")){let i=e.elements,s=e.elementAliasesOrder,n=s.filter(a=>i[a]).map(a=>Qx(i[a])),o=await Promise.all(n);this.clear(),o.forEach((a,u)=>{let l=s[u];this.add(l,a),P.childrenAliasesOrder.push(l);});}else {N.error("The data does not have the properties elementAliasesOrder and elements");return}if(e.hasOwnProperty("stage")&&e.hasOwnProperty("stage")?qr(this.gameLayer,e.stage,{ignoreScale:!0}):N.error("The data does not have the properties stage"),e.hasOwnProperty("tickers")){let i=e.tickers;Object.entries(i).forEach(([s,n])=>{let o=n.canvasElementAliases,a=Dh(n.id,n.args,n.duration,n.priority);if(a){let u=this.addTicker(o,a);u&&(t[s]=u);}else N.error(`Ticker ${n.id} not found`);});}if(e.hasOwnProperty("tickersSteps")){let i=e.tickersSteps;Object.entries(i).forEach(([s,n])=>{P._currentTickersSequence[s]=n,Object.keys(n).forEach(o=>{this.runTickersSequence(s,o);});});}if(e.hasOwnProperty("tickersOnPause")){let i=e.tickersOnPause;Object.keys(i).forEach(s=>{let n=i[s];"tickerIdsExcluded"in n&&n.tickerIdsExcluded&&(i[s].tickerIdsExcluded=n.tickerIdsExcluded.map(o=>t[o]||o)),"tickerIdsIncluded"in n&&n.tickerIdsIncluded&&(i[s].tickerIdsIncluded=n.tickerIdsIncluded.map(o=>t[o]||o));}),P._tickersOnPause=i;}if(e.hasOwnProperty("tickersToCompleteOnStepEnd")){let i=e.tickersToCompleteOnStepEnd,s=i.tikersIds.map(o=>({id:t[o.id]||o.id})),n=i.stepAlias.map(o=>({id:o.id,alias:o.alias}));P._tickersToCompleteOnStepEnd={tikersIds:s,stepAlias:n};}}catch(t){N.error("Error importing data",t);}}};var Jx=class{constructor(){this.id=this.constructor.prototype.id;}fn(e,t){throw new Error("[Pixi\u2019VN] The method CanvasEvent.fn() must be overridden")}id="event_id_not_set"};pe();var kh=class extends ${get memory(){throw new Error("[Pixi\u2019VN] The method CanvasBaseItem.memory must be overridden")}set memory(e){throw new Error("[Pixi\u2019VN] The method CanvasBaseItems.memory must be overridden")}setMemory(e){throw new Error("[Pixi\u2019VN] The method CanvasBaseItems.memory must be overridden")}pixivnId="canvas_element_id_not_set"};pe();pe();function Rs(r){return (r instanceof _e||r instanceof De)&&r.haveEmptyTexture?false:!(r instanceof xe&&r.texture?.label=="EMPTY")}function Ms(r,e,t){let{limit:i}=t;r[e]===void 0||!t||r[e]===i||(typeof r[e]=="number"?t.type==="linear"?r[e]=dS(r[e],t):t.type==="exponential"&&(r[e]=fS(r[e],t)):r[e]!==void 0&&typeof r[e]=="object"&&r[e].haveOwnProperty("x")&&r[e].haveOwnProperty("y")&&typeof r[e].x=="number"&&typeof r[e].y=="number"&&(t.type==="linear"?(r[e].x=dS(r[e].x,t),r[e].y=dS(r[e].y,t)):t.type==="exponential"&&(r[e].x=fS(r[e].x,t),r[e].y=fS(r[e].y,t))));}function dS(r,e){let{limit:t,amt:i}=e;if(t!==void 0){if(r>t&&i>0)return t;if(r<t&&i<0)return t}return r+i}function fS(r,e){let{limit:t}=e;if(t!==void 0){if(r>t&&e.percentage>0)return t;if(r<t&&e.percentage<0)return t}return r+r*e.percentage}var _k=5,Ti=class extends Nt{constructor(e={},t,i){super(e,t,i);}fn(e,t,i,s){t.speed===void 0&&(t.duration===void 0?t.speed=_k:t.speed=600/(t.duration*60));let{type:n="hide",startOnlyIfHaveTexture:o,speedProgression:a}=t,u=this.speedConvert(t.speed),l=this.getLimit(t);n==="hide"&&l<0&&(l=0),n==="show"&&l>1&&(l=1),i.filter(c=>{let h=C.find(c);return !(!h||o&&!Rs(h))}).forEach(c=>{let h=C.find(c);if(h&&h instanceof $){if(n==="show"&&h.alpha<l?h.alpha+=u*e.deltaTime:n==="hide"&&h.alpha>l&&(h.alpha-=u*e.deltaTime),n==="show"&&h.alpha>=l){this.onEndOfTicker(c,s,t);return}else if(n==="hide"&&h.alpha<=l){this.onEndOfTicker(c,s,t);return}if(u<1e-5&&!(a&&a.type=="linear"&&a.amt!=0)){N.warn("The speed of the FadeAlphaTicker must be greater than 0."),this.onEndOfTicker(c,s,t,{editAlpha:false});return}}}),a&&Ms(t,"speed",a);}onEndOfTicker(e,t,i,s={editAlpha:true}){typeof e=="string"&&(e=[e]),e.forEach(n=>{let o=C.find(n);if(o&&s.editAlpha){let a=this.getLimit(i);o.alpha=a;}}),super.onEndOfTicker(e,t,i);}getLimit(e){let{type:t="hide",limit:i=t==="hide"?0:1}=e;return i}speedConvert(e){return e/600}};vi(Ti);pe();var bk=10;function yk(r,e){let t=St(r.destination);if(t.type==="align"){let i,s;e instanceof xe&&(i=e.anchor.x,s=e.anchor.y);let n=$e(e.pivot,e.angle),o=$e(e.scale,e.angle);t.x=bi("width",t.x,Zr(e),n.x,o.x<0,i),t.y=bi("height",t.y,Qr(e),n.y,o.y<0,s);}return t.type==="percentage"&&(t.x=yi("width",t.x),t.y=yi("height",t.y)),t}var qt=class extends Nt{fn(e,t,i,s){t.speed===void 0&&(t.speed=bk);let{speed:n,startOnlyIfHaveTexture:o,speedProgression:a}=t;i.filter(u=>{let l=C.find(u);return !(!l||o&&!Rs(l))}).forEach(u=>{let l=C.find(u);if(l&&l instanceof $){let c=yk(t,l),h=c.x-l.x,f=c.y-l.y,p=h>0?1:-1,g=f>0?1:-1,b,_;if(typeof n=="number"){let x=this.speedConvert(n);h===0||f===0?b=_=x:(b=Math.abs(h/(h+f))*x,_=Math.abs(f/(h+f))*x);}else b=this.speedConvert(n.x),_=this.speedConvert(n.y);if(b>0){l.x+=p*b*e.deltaTime;let x=c.x-l.x;(p<0&&x>0||p>0&&x<0)&&(l.x=c.x);}if(_>0){l.y+=g*_*e.deltaTime;let x=c.y-l.y;(g<0&&x>0||g>0&&x<0)&&(l.y=c.y);}if(l.x==c.x&&l.y==c.y){this.onEndOfTicker(u,s,t);return}else if(b<1e-5&&_<1e-5&&!(a&&a.type=="linear"&&a.amt!=0)){N.warn("The speed of the MoveTicker must be greater than 0."),this.onEndOfTicker(u,s,t,{editPosition:false});return}}}),a&&Ms(t,"speed",a);}onEndOfTicker(e,t,i,s={editPosition:true}){typeof e=="string"&&(e=[e]),e.forEach(n=>{let o=C.find(n);if(o){let a=i.destination;s.editPosition&&(o instanceof _e||o instanceof De?o.positionInfo=a:(o.x=a.x,o.y=a.y));}}),super.onEndOfTicker(e,t,i);}speedConvert(e){return e*(66/400)}};vi(qt);pe();var vk=1,Fh=class extends Nt{constructor(e={},t,i){super(e,t,i);}fn(e,t,i,s){t.speed===void 0&&(t.speed=vk);let{clockwise:n=true,speedProgression:o,limit:a}=t,u=this.speedConvert(t.speed);i.filter(l=>{let c=C.find(l);return !(!c||t.startOnlyIfHaveTexture&&!Rs(c))}).forEach(l=>{let c=C.find(l);if(c&&c instanceof $&&(n?c.rotation+=u*e.deltaTime:c.rotation-=u*e.deltaTime,a!==void 0&&(n&&c.angle>=a?(c.angle=a,this.onEndOfTicker(l,s,t)):!n&&c.angle<=a&&(c.angle=a,this.onEndOfTicker(l,s,t))),u<1e-5&&!(o&&o.type=="linear"&&o.amt!=0))){N.warn("The speed of the RotateTicker must be greater than 0."),this.onEndOfTicker(l,s,t,{editRotation:false});return}}),o&&Ms(t,"speed",o);}onEndOfTicker(e,t,i,s={editRotation:true}){let{limit:n}=i;typeof e=="string"&&(e=[e]),e.forEach(o=>{let a=C.find(o);a&&s.editRotation&&n!==void 0&&(a.angle=n);}),super.onEndOfTicker(e,t,i);}speedConvert(e){return e/100}};vi(Fh);pe();var Tk=10,Ds=class extends Nt{constructor(e={},t,i){super(e,t,i);}fn(e,t,i,s){t.speed===void 0&&(t.speed=Tk);let{speed:n,type:o="zoom",startOnlyIfHaveTexture:a,speedProgression:u}=t,l,c;typeof n=="number"?(l=this.speedConvert(n),c=this.speedConvert(n)):(l=this.speedConvert(n.x),c=this.speedConvert(n.y));let h=this.getLimit(t);i.filter(f=>{let p=C.find(f);return !(!p||a&&!Rs(p))}).forEach(f=>{let p=C.find(f);if(p&&p instanceof $){if(o==="zoom"&&(p.scale.x<h.x||p.scale.y<h.y)?(p.scale.x+=l*e.deltaTime,p.scale.y+=c*e.deltaTime):o==="unzoom"&&(p.scale.x>h.x||p.scale.y>h.y)&&(p.scale.x-=l*e.deltaTime,p.scale.y-=c*e.deltaTime),o==="zoom"){if(p.scale.x>h.x&&(p.scale.x=h.x),p.scale.y>h.y&&(p.scale.y=h.y),p.scale.x>=h.x&&p.scale.y>=h.y){this.onEndOfTicker(f,s,t);return}}else if(o==="unzoom"&&(p.scale.x<h.x&&(p.scale.x=h.x),p.scale.y<h.y&&(p.scale.y=h.y),p.scale.x<=h.x&&p.scale.y<=h.y)){this.onEndOfTicker(f,s,t);return}if((l<1e-5&&c<1e-5||l<1e-5&&p.scale.y==h.y||c<1e-5&&p.scale.x==h.x)&&!(u&&u.type=="linear"&&u.amt!=0)){N.warn("The speed of the ZoomTicker must be greater than 0."),this.onEndOfTicker(f,s,t,{editScale:false});return}}}),u&&Ms(t,"speed",u);}speedConvert(e){return e/600}onEndOfTicker(e,t,i,s={editScale:true}){let{isZoomInOut:n}=i;typeof e=="string"&&(e=[e]),e.forEach(o=>{let a=C.find(o);if(a){if(s.editScale){let u=this.getLimit(i);a.scale.x=u.x,a.scale.y=u.y;}if(n){let{pivot:u,position:l}=n;a.pivot=u.x,a.position=l;}}}),super.onEndOfTicker(e,t,i);}getLimit(e){let{type:t="zoom",limit:i}=e,s=t==="zoom"?1/0:0,n=t==="zoom"?1/0:0;return i&&(typeof i=="number"?(s=i,n=i):(s=i.x,n=i.y)),{x:s,y:n}}};vi(Ds);async function Sk(r,e={},t){let i=C.find(r);if(!i){N.error(`The element with the alias ${r} does not exist. So the shake effect can't be applied.`);return}let s={x:i.position.x,y:i.position.y},n=e.speed||20,o=e.speedProgression||void 0,a=e.startOnlyIfHaveTexture||false,u=e.type||"horizontal",l=e.maximumShockSize||10,c=(e.shocksNumber||10)-1;if(c<2){N.error("The number of shocks must be at least 3.");return}let h=Math.floor(c/2),f=Math.ceil(c/2),p=[];for(let _=0;_<h;_++){let x={x:s.x,y:s.y},y=l*(_+1)/h;u==="horizontal"?_%2!==0?x.x=s.x+y:x.x=s.x-y:_%2!==0?x.y=s.y+y:x.y=s.y-y,p.push(new qt({destination:x,speed:n,speedProgression:o,startOnlyIfHaveTexture:a},void 0,t));}let g=h%2===0;for(let _=f;_>0;_--){let x={x:s.x,y:s.y},y=l*(_+1)/(f-1);u==="horizontal"?_%2===0&&!g||_%2!==0&&g?x.x=s.x-y:x.x=s.x+y:_%2===0&&!g||_%2!==0&&g?x.y=s.y-y:x.y=s.y+y,p.push(new qt({destination:x,speed:n,speedProgression:o,startOnlyIfHaveTexture:a},void 0,t));}p.push(new qt({destination:s,speed:n,speedProgression:o,startOnlyIfHaveTexture:a,tickerAliasToResume:r},void 0,t));let b=C.addTickersSequence(r,p);b&&(C.completeTickerOnStepEnd({id:b,alias:r}),C.pauseTicker(r,{tickerIdsExcluded:[b]}));}function e_(r,e,t){let i=new De(t,e);return C.add(r,i),i}async function Ek(r,e,t){let i=new De(t,e);return await i.load(),C.add(r,i),i}pe();function t_(r,e,t){if(!e)if(Xe.resolver.hasKey(r))e=r;else throw new Error(`The image ${r} does not exist in the cache.`);let i=new _e(t,e);return C.add(r,i),i}async function Ak(r){if(!Array.isArray(r))return [r];let e=Array(r.length);for(let t=0;t<r.length;t++)e[t]=$r(r[t].textureAlias);return Promise.all(e).then(t=>t.map((i,s)=>i?(r[s].texture=i,r[s]):(r[s].load(),r[s])))}async function Ck(r,e,t){if(!e)if(Xe.resolver.hasKey(r))e=r;else throw new Error(`The image ${r} does not exist in the cache.`);let i=new _e(t,e);return await i.load(),C.add(r,i),i}pe();function r_(r,e,t){if(!e)if(Xe.resolver.hasKey(r))e=r;else throw new Error(`The video ${r} does not exist in the cache.`);let i=new Et(t,e);return C.add(r,i),i}async function Pk(r){if(!Array.isArray(r))return [r];let e=Array(r.length);for(let t=0;t<r.length;t++)e[t]=$r(r[t].textureAlias);return Promise.all(e).then(t=>t.map((i,s)=>i?(r[s].texture=i,r[s]):(r[s].load(),r[s])))}async function wk(r,e,t){if(!e)if(Xe.resolver.hasKey(r))e=r;else throw new Error(`The video ${r} does not exist in the cache.`);let i=new Et(t,e);return await i.load(),C.add(r,i),i}function Gh(r,e){if(typeof e=="string")return wh(e)?r_(r,e):t_(r,e);if(Array.isArray(e))return e_(r,e);if(typeof e=="object"&&"value"in e&&"options"in e){if(typeof e.value=="string")return wh(e.value)?r_(r,e.value,e.options):t_(r,e.value,e.options);if(Array.isArray(e.value))return e_(r,e.value,e.options)}return C.add(r,e),e}async function pS(r,e,t={},i){let{mustBeCompletedBeforeNextStep:s=true,tickerAliasToResume:n=[]}=t,o=[];e||(e=r),typeof n=="string"&&(n=[n]);let a;if(C.find(r)&&(a=r+"_temp_disolve",C.editAlias(r,a)),e=Gh(r,e),a&&C.copyCanvasElementProperty(a,r),a&&C.transferTickers(a,r,"duplicate"),e.alpha=0,a){let c=Oh(a,t,i);c&&(o.push(...c),C.pauseTicker(a,{tickerIdsIncluded:c}),n.push(a));}let u=new Ti({...t,type:"show",tickerAliasToResume:n,startOnlyIfHaveTexture:true},void 0,i),l=C.addTicker(r,u);if(l&&(s&&C.completeTickerOnStepEnd({id:l}),o.push(l)),(e instanceof _e||e instanceof De)&&e.haveEmptyTexture&&await e.load(),o.length>0)return o}function Oh(r,e={},t){let{mustBeCompletedBeforeNextStep:i=true,aliasToRemoveAfter:s=[]}=e;typeof r=="string"&&(r=[r]),typeof s=="string"&&(s=[s]),s.push(...r);let n=new Ti({...e,type:"hide",aliasToRemoveAfter:s,startOnlyIfHaveTexture:true},void 0,t),o=C.addTicker(r,n);if(o)return i&&C.completeTickerOnStepEnd({id:o}),[o]}async function DB(r,e,t={},i){let{mustBeCompletedBeforeNextStep:s=true,aliasToRemoveAfter:n=[]}=t,o=[];if(e||(e=r),typeof n=="string"&&(n=[n]),!C.find(r))return pS(r,e,t,i);let a=r+"_temp_fade";C.editAlias(r,a),n.push(a),e=Gh(r,e),a&&C.copyCanvasElementProperty(a,r),a&&C.transferTickers(a,r,"duplicate"),e.alpha=0;let u=Oh(a,{...t,tickerAliasToResume:r},i);u&&o.push(...u);let l=new Ti({...t,type:"show",startOnlyIfHaveTexture:true,aliasToRemoveAfter:n},void 0,i),c=C.addTicker(r,l);if(c&&(s&&C.completeTickerOnStepEnd({id:c}),o.push(c),C.pauseTicker(r,{tickerIdsIncluded:[c]})),(e instanceof _e||e instanceof De)&&e.haveEmptyTexture&&await e.load(),o.length>0)return o}function IB(r,e={},t){return Oh(r,e,t)}async function Bk(r,e,t={},i){let{direction:s="right",mustBeCompletedBeforeNextStep:n=true,tickerAliasToResume:o=[],aliasToRemoveAfter:a=[],removeOldComponentWithMoveOut:u}=t,l=[];e||(e=r),typeof o=="string"&&(o=[o]),typeof a=="string"&&(a=[a]);let c;C.find(r)&&(c=r+"_temp_movein",C.editAlias(r,c)),e=Gh(r,e),c&&C.copyCanvasElementProperty(c,r),c&&C.transferTickers(c,r,"move");let h;e instanceof _e||e instanceof De?h=e.positionInfo:h={x:e.x,y:e.y,type:"pixel"};let f;switch(c&&(u?(f=mS(c,t,i),f&&(l.push(...f),o.push(c))):a.push(c)),(e instanceof _e||e instanceof De)&&e.haveEmptyTexture&&await e.load(),c&&C.pauseTicker(c,{tickerIdsIncluded:f}),s){case "up":e.y=C.canvasHeight+e.height;break;case "down":e.y=-e.height;break;case "left":e.x=C.canvasWidth+e.width;break;case "right":e.x=-e.width;break}o.push(r);let p=new qt({...t,tickerAliasToResume:o,aliasToRemoveAfter:a,destination:h,startOnlyIfHaveTexture:true},void 0,i),g=C.addTicker(r,p);if(g&&(C.pauseTicker(r,{tickerIdsExcluded:[g]}),n&&C.completeTickerOnStepEnd({id:g}),l.push(g)),l.length>0)return l}function mS(r,e={},t){let{direction:i="right",mustBeCompletedBeforeNextStep:s=true,aliasToRemoveAfter:n=[]}=e;typeof n=="string"&&(n=[n]),n.push(r);let o=C.find(r);if(!o){N.warn("The canvas component is not found.");return}let a={x:o.x,y:o.y};switch(i){case "up":a.y=-o.height;break;case "down":a.y=C.canvasHeight+o.height;break;case "left":a.x=-o.width;break;case "right":a.x=C.canvasWidth+o.width;break}let u=new qt({...e,destination:a,startOnlyIfHaveTexture:true,aliasToRemoveAfter:n},void 0,t),l=C.addTicker(r,u);if(l)return C.pauseTicker(r,{tickerIdsExcluded:[l]}),s&&C.completeTickerOnStepEnd({id:l}),[l]}async function Rk(r,e,t={},i){let{direction:s="right",mustBeCompletedBeforeNextStep:n=true,tickerAliasToResume:o=[],aliasToRemoveAfter:a=[]}=t,u=[];e||(e=r),typeof o=="string"&&(o=[o]),typeof a=="string"&&(a=[a]);let l,c=C.find(r);c&&(l=r+"_temp_zoom",C.editAlias(r,l)),e=Gh(r,e),l&&C.copyCanvasElementProperty(l,r),l&&C.transferTickers(l,r,"move"),s=="up"?(e.pivot.y=C.canvasHeight-e.y,e.pivot.x=C.canvasWidth/2-e.x,e.y=C.canvasHeight,e.x=C.canvasWidth/2):s=="down"?(e.pivot.y=0-e.y,e.pivot.x=C.canvasWidth/2-e.x,e.y=0,e.x=C.canvasWidth/2):s=="left"?(e.pivot.x=C.canvasWidth-e.x,e.pivot.y=C.canvasHeight/2-e.y,e.x=C.canvasWidth,e.y=C.canvasHeight/2):s=="right"&&(e.pivot.x=0-e.x,e.pivot.y=C.canvasHeight/2-e.y,e.x=0,e.y=C.canvasHeight/2),e.pivot=aS(e.pivot,e.angle),e.scale.set(0);let h=c?{pivot:{x:c.pivot.x,y:c.pivot.y},position:{x:c.x,y:c.y}}:void 0;if(l){if(t.removeOldComponentWithZoomOut){let g=kB(l,t,i);g&&(u.push(...g),o.push(l));}else a.push(l);C.pauseTicker(l);}o.push(r);let f=new Ds({...t,tickerAliasToResume:o,aliasToRemoveAfter:a,startOnlyIfHaveTexture:true,type:"zoom",limit:1,isZoomInOut:h},void 0,i),p=C.addTicker(r,f);if(p&&(C.pauseTicker(r,{tickerIdsExcluded:[p]}),n&&C.completeTickerOnStepEnd({id:p}),u.push(p)),(e instanceof _e||e instanceof De)&&e.haveEmptyTexture&&await e.load(),u.length>0)return u}function kB(r,e={},t){let{direction:i="right",mustBeCompletedBeforeNextStep:s=true,aliasToRemoveAfter:n=[]}=e;typeof n=="string"&&(n=[n]),n.push(r);let o=C.find(r);if(!o){N.warn("The canvas component is not found.");return}i=="up"?(o.pivot.y=C.canvasHeight-o.y,o.pivot.x=C.canvasWidth/2-o.x,o.y=C.canvasHeight,o.x=C.canvasWidth/2):i=="down"?(o.pivot.y=0-o.y,o.pivot.x=C.canvasWidth/2-o.x,o.y=0,o.x=C.canvasWidth/2):i=="left"?(o.pivot.x=C.canvasWidth-o.x,o.pivot.y=C.canvasHeight/2-o.y,o.x=C.canvasWidth,o.y=C.canvasHeight/2):i=="right"&&(o.pivot.x=0-o.x,o.pivot.y=C.canvasHeight/2-o.y,o.x=0,o.y=C.canvasHeight/2),o.pivot=aS(o.pivot,o.angle),o.scale.set(1);let a=new Ds({...e,startOnlyIfHaveTexture:true,type:"unzoom",limit:0,aliasToRemoveAfter:n},void 0,t),u=C.addTicker(r,a);if(u)return C.pauseTicker(r,{tickerIdsExcluded:[u]}),s&&C.completeTickerOnStepEnd({id:u}),[u]}async function Mk(r,e,t={},i){let{direction:s="right",mustBeCompletedBeforeNextStep:n=true,tickerAliasToResume:o=[]}=t,a=[];e||(e=r),typeof o=="string"&&(o=[o]);let u;C.find(r)&&(u=r+"_temp_push",C.editAlias(r,u)),e=Gh(r,e),u&&C.copyCanvasElementProperty(u,r),u&&C.transferTickers(u,r,"move");let l;if((e instanceof _e||e instanceof De)&&e.haveEmptyTexture?l=e.positionInfo:l={x:e.x,y:e.y,type:"pixel"},s=="up"?e.y=-C.canvasHeight+e.y:s=="down"?e.y=C.canvasHeight+e.y:s=="left"?e.x=-C.canvasWidth+e.x:s=="right"&&(e.x=C.canvasWidth+e.x),u){let f=FB(u,{...t,direction:s=="up"?"down":s=="down"?"up":s=="left"?"right":"left"},i);f&&a.push(...f);}o.push(r);let c=new qt({...t,tickerAliasToResume:o,startOnlyIfHaveTexture:true,destination:l},void 0,i),h=C.addTicker(r,c);if(h&&(C.pauseTicker(r,{tickerIdsExcluded:[h]}),n&&C.completeTickerOnStepEnd({id:h}),a.push(h)),(e instanceof _e||e instanceof De)&&e.haveEmptyTexture&&await e.load(),a.length>0)return a}function FB(r,e={direction:"right"},t){return mS(r,e,t)}var C=new Ih;export{kh as CanvasBase,kh as CanvasBaseItem,ws as CanvasContainer,Jx as CanvasEvent,_e as CanvasImage,P as CanvasManagerStatic,Jr as CanvasSprite,Bs as CanvasText,Et as CanvasVideo,ws as Container,Ti as FadeAlphaTicker,De as ImageContainer,_e as ImageSprite,qt as MoveTicker,Fh as RotateTicker,Jr as Sprite,Bs as Text,Nt as TickerBase,Et as VideoSprite,Ds as ZoomTicker,t_ as addImage,e_ as addImageCointainer,r_ as addVideo,C as canvas,iS as canvasComponentDecorator,iS as canvasElementDecorator,wB as eventDecorator,$r as getTexture,Ak as loadImage,Pk as loadVideo,Bk as moveIn,mS as moveOut,Mk as pushIn,FB as pushOut,Oh as removeWithDissolve,Oh as removeWithDissolveTransition,IB as removeWithFade,IB as removeWithFadeTransition,Sk as shakeEffect,Ck as showImage,Ek as showImageContainer,wk as showVideo,pS as showWithDissolve,pS as showWithDissolveTransition,DB as showWithFade,DB as showWithFadeTransition,MB as tickerDecorator,Rk as zoomIn,kB as zoomOut};
3310
+ `,dynamic:false}};});var uk,eB,tB,rB=d(()=>{at();_r();$1();uk=new ue(0,0,0,0),eB=class q1 extends Le{constructor(e={}){e={...q1.defaultOptions,...e,dynamicProperties:{...q1.defaultOptions.dynamicProperties,...e?.dynamicProperties}};let{dynamicProperties:t,shader:i,roundPixels:s,texture:n,particles:o,...a}=e;super({label:"ParticleContainer",...a}),this.renderPipeId="particle",this.batched=false,this._childrenDirty=false,this.texture=n||null,this.shader=i,this._properties={};for(let u in Th){let l=Th[u],c=t[u];this._properties[u]={...l,dynamic:c};}this.allowChildren=true,this.roundPixels=s??false,this.particleChildren=o??[];}addParticle(...e){for(let t=0;t<e.length;t++)this.particleChildren.push(e[t]);return this.onViewUpdate(),e[0]}removeParticle(...e){let t=false;for(let i=0;i<e.length;i++){let s=this.particleChildren.indexOf(e[i]);s>-1&&(this.particleChildren.splice(s,1),t=true);}return t&&this.onViewUpdate(),e[0]}update(){this._childrenDirty=true;}onViewUpdate(){this._childrenDirty=true,super.onViewUpdate();}get bounds(){return uk}updateBounds(){}destroy(e=false){if(super.destroy(e),typeof e=="boolean"?e:e?.texture){let i=typeof e=="boolean"?e:e?.textureSource,s=this.texture??this.particleChildren[0]?.texture;s&&s.destroy(i);}this.texture=null,this.shader?.destroy();}removeParticles(e,t){let i=this.particleChildren.splice(e,t);return this.onViewUpdate(),i}removeParticleAt(e){let t=this.particleChildren.splice(e,1);return this.onViewUpdate(),t[0]}addParticleAt(e,t){return this.particleChildren.splice(t,0,e),this.onViewUpdate(),e}addChild(...e){throw new Error("ParticleContainer.addChild() is not available. Please use ParticleContainer.addParticle()")}removeChild(...e){throw new Error("ParticleContainer.removeChild() is not available. Please use ParticleContainer.removeParticle()")}removeChildren(e,t){throw new Error("ParticleContainer.removeChildren() is not available. Please use ParticleContainer.removeParticles()")}removeChildAt(e){throw new Error("ParticleContainer.removeChildAt() is not available. Please use ParticleContainer.removeParticleAt()")}getChildAt(e){throw new Error("ParticleContainer.getChildAt() is not available. Please use ParticleContainer.getParticleAt()")}setChildIndex(e,t){throw new Error("ParticleContainer.setChildIndex() is not available. Please use ParticleContainer.setParticleIndex()")}getChildIndex(e){throw new Error("ParticleContainer.getChildIndex() is not available. Please use ParticleContainer.getParticleIndex()")}addChildAt(e,t){throw new Error("ParticleContainer.addChildAt() is not available. Please use ParticleContainer.addParticleAt()")}swapChildren(e,t){throw new Error("ParticleContainer.swapChildren() is not available. Please use ParticleContainer.swapParticles()")}reparentChild(...e){throw new Error("ParticleContainer.reparentChild() is not available with the particle container")}reparentChildAt(e,t){throw new Error("ParticleContainer.reparentChildAt() is not available with the particle container")}};eB.defaultOptions={dynamicProperties:{vertex:false,position:true,rotation:false,uvs:false,color:false},roundPixels:false};tB=eB;});var iB,j1,Ox,nB=d(()=>{Ai();se();ce();_r();Wp();iB=class sB extends Le{constructor(e){e instanceof A&&(e={texture:e});let{width:t,height:i,anchor:s,leftWidth:n,rightWidth:o,topHeight:a,bottomHeight:u,texture:l,roundPixels:c,...h}=e;super({label:"NineSliceSprite",...h}),this.renderPipeId="nineSliceSprite",this.batched=true,this._leftWidth=n??l?.defaultBorders?.left??Pr.defaultOptions.leftWidth,this._topHeight=a??l?.defaultBorders?.top??Pr.defaultOptions.topHeight,this._rightWidth=o??l?.defaultBorders?.right??Pr.defaultOptions.rightWidth,this._bottomHeight=u??l?.defaultBorders?.bottom??Pr.defaultOptions.bottomHeight,this._width=t??l.width??Pr.defaultOptions.width,this._height=i??l.height??Pr.defaultOptions.height,this.allowChildren=false,this.texture=l??sB.defaultOptions.texture,this.roundPixels=c??false,this._anchor=new ve({_onUpdate:()=>{this.onViewUpdate();}}),s?this.anchor=s:this.texture.defaultAnchor&&(this.anchor=this.texture.defaultAnchor);}get anchor(){return this._anchor}set anchor(e){typeof e=="number"?this._anchor.set(e):this._anchor.copyFrom(e);}get width(){return this._width}set width(e){this._width=e,this.onViewUpdate();}get height(){return this._height}set height(e){this._height=e,this.onViewUpdate();}setSize(e,t){typeof e=="object"&&(t=e.height??e.width,e=e.width),this._width=e,this._height=t??e,this.onViewUpdate();}getSize(e){return e||(e={}),e.width=this._width,e.height=this._height,e}get leftWidth(){return this._leftWidth}set leftWidth(e){this._leftWidth=e,this.onViewUpdate();}get topHeight(){return this._topHeight}set topHeight(e){this._topHeight=e,this.onViewUpdate();}get rightWidth(){return this._rightWidth}set rightWidth(e){this._rightWidth=e,this.onViewUpdate();}get bottomHeight(){return this._bottomHeight}set bottomHeight(e){this._bottomHeight=e,this.onViewUpdate();}get texture(){return this._texture}set texture(e){e||(e=A.EMPTY);let t=this._texture;t!==e&&(t&&t.dynamic&&t.off("update",this.onViewUpdate,this),e.dynamic&&e.on("update",this.onViewUpdate,this),this._texture=e,this.onViewUpdate());}get originalWidth(){return this._texture.width}get originalHeight(){return this._texture.height}destroy(e){if(super.destroy(e),typeof e=="boolean"?e:e?.texture){let i=typeof e=="boolean"?e:e?.textureSource;this._texture.destroy(i);}this._texture=null;}updateBounds(){let e=this._bounds,t=this._anchor,i=this._width,s=this._height;e.minX=-t._x*i,e.maxX=e.minX+i,e.minY=-t._y*s,e.maxY=e.minY+s;}};iB.defaultOptions={texture:A.EMPTY};j1=iB,Ox=class extends j1{constructor(...e){let t=e[0];t instanceof A&&(M(U,"NineSlicePlane now uses the options object {texture, leftWidth, rightWidth, topHeight, bottomHeight}"),t={texture:t,leftWidth:e[1],topHeight:e[2],rightWidth:e[3],bottomHeight:e[4]}),M(U,"NineSlicePlane is deprecated. Use NineSliceSprite instead."),super(t);}};});function oB(r,e){return e instanceof ze||e instanceof Cr?e:r==="html"?new Cr(e):new ze(e)}var aB=d(()=>{ql();ci();});async function uB(r,e,t=200){let i=await e.extract.base64(r);await e.encoder.commandFinished;let s=t;console.log(`logging texture ${r.source.width}px ${r.source.height}px`);let n=["font-size: 1px;",`padding: ${s}px 300px;`,`background: url(${i}) no-repeat;`,"background-size: contain;"].join(" ");console.log("%c ",n);}var lB=d(()=>{});function K1(r,e=0,t={color:"#000000"}){r.renderGroup&&(t.color=lk[ck++]);let i="";for(let o=0;o<e;o++)i+=" ";let s=r.label;!s&&r instanceof xe&&(s=`sprite:${r.texture.label}`);let n=`%c ${i}|- ${s} (worldX:${r.worldTransform.tx}, relativeRenderX:${r.relativeGroupTransform.tx}, renderX:${r.groupTransform.tx}, localX:${r.x})`;r.renderGroup&&(n+=" (RenderGroup)"),r.filters&&(n+="(*filters)"),console.log(n,`color:${t.color}; font-weight:bold;`),e++;for(let o=0;o<r.children.length;o++){let a=r.children[o];K1(a,e,{...t});}}function Z1(r,e=0,t={index:0,color:"#000000"}){let i="";for(let n=0;n<e;n++)i+=" ";let s=`%c ${i}- ${t.index}: ${r.root.label} worldX:${r.worldTransform.tx}`;console.log(s,`color:${t.color}; font-weight:bold;`),e++;for(let n=0;n<r.renderGroupChildren.length;n++){let o=r.renderGroupChildren[n];Z1(o,e,{...t,index:n});}}var lk,ck,cB=d(()=>{Oi();lk=["#000080","#228B22","#8B0000","#4169E1","#008080","#800000","#9400D3","#FF8C00","#556B2F","#8B008B"],ck=0;});var hB={};Hh(hB,{AbstractBitmapFont:()=>os,AbstractRenderer:()=>Ur,AbstractText:()=>Xr,AccessibilitySystem:()=>Ed,AlphaFilter:()=>P3,AlphaMask:()=>js,AlphaMaskPipe:()=>Gn,AnimatedSprite:()=>Du,Application:()=>Oc,ApplicationInitHook:()=>kn,Assets:()=>Xe,AssetsClass:()=>zc,BLEND_TO_NPM:()=>qd,BUFFER_TYPE:()=>oo,BackgroundLoader:()=>nu,BackgroundSystem:()=>cm,Batch:()=>yl,BatchGeometry:()=>qo,BatchTextureArray:()=>$o,BatchableGraphics:()=>li,BatchableMesh:()=>Fr,BatchableSprite:()=>or,Batcher:()=>Kd,BatcherPipe:()=>Sc,BigPool:()=>X,BindGroup:()=>je,BindGroupSystem:()=>zn,BitmapFont:()=>_o,BitmapFontManager:()=>di,BitmapText:()=>Fu,BitmapTextPipe:()=>xn,BlendModeFilter:()=>Z,BlendModePipe:()=>Ln,BlurFilter:()=>fh,BlurFilterPass:()=>Mu,Bounds:()=>ue,BrowserAdapter:()=>Dd,Buffer:()=>Ce,BufferImageSource:()=>ii,BufferResource:()=>Hr,BufferUsage:()=>K,CLEAR:()=>Ke,Cache:()=>oe,CanvasPool:()=>_t,CanvasPoolClass:()=>Ol,CanvasSource:()=>Qe,CanvasTextMetrics:()=>kt,CanvasTextPipe:()=>dn,CanvasTextSystem:()=>gn,Circle:()=>pa,Color:()=>z,ColorBlend:()=>Jl,ColorBurnBlend:()=>ec,ColorDodgeBlend:()=>tc,ColorMask:()=>Ks,ColorMaskPipe:()=>On,ColorMatrixFilter:()=>_x,CompressedSource:()=>lr,Container:()=>$,Culler:()=>Jg,CullerPlugin:()=>Qc,CustomRenderPipe:()=>wn,D3D10_RESOURCE_DIMENSION:()=>Xg,D3DFMT:()=>Bt,DATA_URI:()=>dC,DDS:()=>q,DEG_TO_RAD:()=>$h,DEPRECATED_SCALE_MODES:()=>vh,DEPRECATED_WRAP_MODES:()=>yh,DOMAdapter:()=>H,DOMContainer:()=>Md,DOMPipe:()=>$s,DRAW_MODES:()=>nw,DXGI_FORMAT:()=>zg,DXGI_TO_TEXTURE_FORMAT:()=>vt,DarkenBlend:()=>rc,DefaultBatcher:()=>tn,DefaultShader:()=>Jo,DifferenceBlend:()=>ic,DisplacementFilter:()=>vx,DivideBlend:()=>sc,DynamicBitmapFont:()=>Yl,Ellipse:()=>ma,EventBoundary:()=>Lo,EventEmitter:()=>re,EventSystem:()=>No,EventsTicker:()=>Kt,ExclusionBlend:()=>nc,ExtensionType:()=>m,ExtractSystem:()=>hm,FOURCC_TO_TEXTURE_FORMAT:()=>jc,FederatedContainer:()=>Rd,FederatedEvent:()=>Dr,FederatedMouseEvent:()=>xr,FederatedPointerEvent:()=>ut,FederatedWheelEvent:()=>Zt,FillGradient:()=>It,FillPattern:()=>Sr,Filter:()=>st,FilterEffect:()=>pr,FilterPipe:()=>Tn,FilterSystem:()=>Sn,FontStylePromiseCache:()=>Pa,GAUSSIAN_VALUES:()=>Ru,GL_FORMATS:()=>Ka,GL_INTERNAL_FORMAT:()=>zT,GL_TARGETS:()=>Rc,GL_TYPES:()=>ae,GL_WRAP_MODES:()=>y2,GenerateTextureSystem:()=>Nn,Geometry:()=>gt,GlBackBufferSystem:()=>Vm,GlBatchAdaptor:()=>no,GlBuffer:()=>ja,GlBufferSystem:()=>ao,GlColorMaskSystem:()=>lo,GlContextSystem:()=>Lm,GlEncoderSystem:()=>co,GlGeometrySystem:()=>uo,GlGraphicsAdaptor:()=>io,GlMeshAdaptor:()=>so,GlParticleContainerAdaptor:()=>ua,GlParticleContainerPipe:()=>ln,GlProgram:()=>Pe,GlProgramData:()=>Ja,GlRenderTarget:()=>Za,GlRenderTargetAdaptor:()=>Qa,GlRenderTargetSystem:()=>po,GlShaderSystem:()=>mo,GlStateSystem:()=>lg,GlStencilSystem:()=>ho,GlTexture:()=>tu,GlTextureSystem:()=>xo,GlUboSystem:()=>fo,GlUniformGroupSystem:()=>go,GlobalUniformSystem:()=>Hn,GpuBatchAdaptor:()=>Pn,GpuBlendModesToPixi:()=>ht,GpuBufferSystem:()=>Xn,GpuColorMaskSystem:()=>Yn,GpuDeviceSystem:()=>gs,GpuEncoderSystem:()=>$n,GpuGraphicsAdaptor:()=>An,GpuGraphicsContext:()=>Ml,GpuMeshAdapter:()=>Cn,GpuMipmapGenerator:()=>qa,GpuParticleContainerAdaptor:()=>ha,GpuParticleContainerPipe:()=>cn,GpuProgram:()=>we,GpuReadBuffer:()=>rw,GpuRenderTarget:()=>Xa,GpuRenderTargetAdaptor:()=>Ya,GpuRenderTargetSystem:()=>Jn,GpuShaderSystem:()=>eo,GpuStateSystem:()=>to,GpuStencilModesToPixi:()=>ur,GpuStencilSystem:()=>qn,GpuTextureSystem:()=>ro,GpuUboSystem:()=>Kn,GpuUniformBatchPipe:()=>Zn,Graphics:()=>ns,GraphicsContext:()=>We,GraphicsContextRenderData:()=>Dl,GraphicsContextSystem:()=>Ji,GraphicsPath:()=>ar,GraphicsPipe:()=>an,HTMLText:()=>Gu,HTMLTextPipe:()=>_n,HTMLTextRenderData:()=>as,HTMLTextStyle:()=>Cr,HTMLTextSystem:()=>us,HardLightBlend:()=>oc,HardMixBlend:()=>ac,HelloSystem:()=>ms,IGLUniformData:()=>qm,ImageSource:()=>mt,InstructionSet:()=>Bi,KTX:()=>Fe,LightenBlend:()=>uc,LinearBurnBlend:()=>lc,LinearDodgeBlend:()=>cc,LinearLightBlend:()=>hc,Loader:()=>au,LoaderParserPriority:()=>Se,LuminosityBlend:()=>dc,MSAA_QUALITY:()=>N1,MaskEffectManager:()=>Mo,MaskEffectManagerClass:()=>rl,MaskFilter:()=>Fa,Matrix:()=>R,Mesh:()=>Lt,MeshGeometry:()=>bt,MeshPipe:()=>un,MeshPlane:()=>kx,MeshRope:()=>Yw,MeshSimple:()=>Gx,NOOP:()=>ol,NegationBlend:()=>fc,NineSliceGeometry:()=>Pr,NineSlicePlane:()=>Ox,NineSliceSprite:()=>j1,NineSliceSpritePipe:()=>vn,NoiseFilter:()=>G3,ObservablePoint:()=>ve,OverlayBlend:()=>pc,PI_2:()=>Xh,Particle:()=>Qw,ParticleBuffer:()=>la,ParticleContainer:()=>tB,ParticleContainerPipe:()=>es,ParticleShader:()=>ca,PerspectiveMesh:()=>Lw,PerspectivePlaneGeometry:()=>Uu,PinLightBlend:()=>mc,PipelineSystem:()=>Qn,PlaneGeometry:()=>cs,Point:()=>Q,Polygon:()=>rs,Pool:()=>ti,PoolGroupClass:()=>el,PrepareBase:()=>Ex,PrepareQueue:()=>ku,PrepareSystem:()=>bh,PrepareUpload:()=>Ou,QuadGeometry:()=>Ra,RAD_TO_DEG:()=>Yh,Rectangle:()=>Y,RenderContainer:()=>Rx,RenderGroup:()=>Go,RenderGroupPipe:()=>Rn,RenderGroupSystem:()=>Dn,RenderLayer:()=>Dw,RenderLayerClass:()=>H1,RenderTarget:()=>Wn,RenderTargetSystem:()=>bs,RenderTexture:()=>Ga,RenderableGCSystem:()=>mm,RendererInitHook:()=>Fn,RendererType:()=>Be,ResizePlugin:()=>zs,Resolver:()=>ct,RopeGeometry:()=>Fx,RoundedRectangle:()=>ga,SCALE_MODES:()=>cw,STENCIL_MODES:()=>Te,SVGParser:()=>cp,SaturationBlend:()=>gc,SchedulerSystem:()=>Vn,ScissorMask:()=>wx,SdfShader:()=>Ea,Shader:()=>Ie,ShaderStage:()=>Yi,ShapePath:()=>ya,SharedRenderPipes:()=>Na,SharedSystems:()=>La,SoftLightBlend:()=>xc,Sprite:()=>xe,SpritePipe:()=>In,Spritesheet:()=>ml,State:()=>Me,StencilMask:()=>Zs,StencilMaskPipe:()=>Un,SubtractBlend:()=>_c,SystemRunner:()=>fs,TEXTURE_FORMAT_BLOCK_SIZE:()=>Yg,Text:()=>cr,TextStyle:()=>ze,Texture:()=>A,TextureGCSystem:()=>gm,TextureMatrix:()=>Mi,TexturePool:()=>de,TexturePoolClass:()=>al,TextureSource:()=>ie,TextureStyle:()=>Fo,TextureUvs:()=>Bx,Ticker:()=>fe,TickerListener:()=>Ii,TickerPlugin:()=>Ys,TilingSprite:()=>Cx,TilingSpritePipe:()=>yn,TilingSpriteShader:()=>Ba,Transform:()=>Iu,Triangle:()=>Sx,UNIFORM_TO_ARRAY_SETTERS:()=>og,UNIFORM_TO_SINGLE_SETTERS:()=>ng,UNIFORM_TYPES_MAP:()=>bf,UNIFORM_TYPES_VALUES:()=>Cl,UPDATE_BLEND:()=>Oo,UPDATE_COLOR:()=>Ws,UPDATE_PRIORITY:()=>wt,UPDATE_TRANSFORM:()=>ZS,UPDATE_VISIBLE:()=>Di,UboBatch:()=>Wa,UboSystem:()=>xs,UniformGroup:()=>ee,VERSION:()=>ps,VideoSource:()=>Ni,ViewContainer:()=>Le,ViewSystem:()=>bm,ViewableBuffer:()=>Qt,VividLightBlend:()=>bc,WGSL_ALIGN_SIZE_DATA:()=>jn,WGSL_TO_STD40_SIZE:()=>Mc,WRAP_MODES:()=>lw,WebGLRenderer:()=>Gc,WebGPURenderer:()=>Bc,WebWorkerAdapter:()=>S3,WorkerManager:()=>Wc,_getGlobalBounds:()=>nd,accessibilityTarget:()=>Ad,addBits:()=>Tl,addMaskBounds:()=>Ui,addMaskLocalBounds:()=>Li,addProgramDefines:()=>ef,alphaFrag:()=>cx,alphaWgsl:()=>dh,applyMatrix:()=>Np,applyProjectiveTransformationToPlane:()=>Mx,applyStyleParams:()=>Fc,assignWithIgnore:()=>Vs,autoDetectEnvironment:()=>aC,autoDetectRenderer:()=>bg,autoDetectSource:()=>SE,basisTranscoderUrls:()=>xu,bgr2rgb:()=>ri,bitmapFontCachePlugin:()=>yg,bitmapFontTextParser:()=>su,bitmapFontXMLParser:()=>Uc,bitmapFontXMLStringParser:()=>Lc,blendTemplateFrag:()=>Xp,blendTemplateVert:()=>Yp,blendTemplateWgsl:()=>$p,blockDataMap:()=>wc,blurTemplateWgsl:()=>mx,boundsPool:()=>Pt,browserExt:()=>$0,buildAdaptiveBezier:()=>_a,buildAdaptiveQuadratic:()=>ep,buildArc:()=>ba,buildArcTo:()=>rp,buildArcToSvg:()=>ip,buildCircle:()=>sr,buildContextBatches:()=>Vf,buildEllipse:()=>Af,buildGeometryFromPath:()=>ww,buildLine:()=>Mf,buildPixelLine:()=>Df,buildPolygon:()=>sa,buildRectangle:()=>na,buildRoundedRectangle:()=>Cf,buildSimpleUvs:()=>ta,buildTriangle:()=>oa,buildUvs:()=>ea,cacheAsTextureMixin:()=>Zh,cacheTextureArray:()=>Tg,calculateProjection:()=>Dm,checkChildrenDidChange:()=>sl,checkDataUrl:()=>Ft,checkExtension:()=>ke,checkMaxIfStatementsInShader:()=>Xd,childrenHelperMixin:()=>Jh,cleanArray:()=>pm,cleanHash:()=>fm,clearList:()=>Mn,closePointEps:()=>wf,collectAllRenderables:()=>yw,collectRenderablesMixin:()=>ed,color32BitToUniform:()=>nr,colorBit:()=>qi,colorBitGl:()=>ji,colorMatrixFilterFrag:()=>xx,colorMatrixFilterWgsl:()=>ph,colorToUniform:()=>QE,compareModeToGlCompare:()=>mg,compileHighShader:()=>hf,compileHighShaderGl:()=>df,compileHighShaderGlProgram:()=>er,compileHighShaderGpuProgram:()=>Jt,compileHooks:()=>Sl,compileInputs:()=>El,compileOutputs:()=>cf,compileShader:()=>Dc,compute2DProjection:()=>Ix,convertFormatIfRequired:()=>gP,convertToList:()=>lt,copySearchParams:()=>qs,createIdFromString:()=>Tr,createIndicesForQuads:()=>Fl,createLevelBuffers:()=>rP,createLevelBuffersFromKTX:()=>_P,createStringVariations:()=>Id,createTexture:()=>yt,createUboElementsSTD40:()=>Wm,createUboElementsWGSL:()=>Tm,createUboSyncFunction:()=>Ha,createUboSyncFunctionSTD40:()=>Ym,createUboSyncFunctionWGSL:()=>Bm,crossOrigin:()=>DT,cullingMixin:()=>zh,curveEps:()=>Bf,defaultFilterVert:()=>As,defaultValue:()=>eu,definedProps:()=>rt,deprecation:()=>M,detectAvif:()=>Eg,detectBasis:()=>jC,detectCompressed:()=>AP,detectDefaults:()=>Ag,detectMp4:()=>Cg,detectOgv:()=>Pg,detectVideoAlphaMode:()=>Wo,detectWebm:()=>wg,detectWebp:()=>Bg,determineCrossOrigin:()=>kT,displacementFrag:()=>bx,displacementVert:()=>yx,displacementWgsl:()=>mh,earcut:()=>dB.default,effectsMixin:()=>td,ensureAttributes:()=>za,ensureIsBuffer:()=>vl,ensurePrecision:()=>tf,ensureTextOptions:()=>Cs,ensureTextStyle:()=>oB,executeInstructions:()=>Bn,extensions:()=>k,extractAttributesFromGlProgram:()=>Jm,extractAttributesFromGpuProgram:()=>of,extractFontFamilies:()=>Bp,extractStructAndGroups:()=>Ko,extractSvgUrlId:()=>Vl,fastCopy:()=>en,findHooksRx:()=>Nb,findMixin:()=>rd,fontStringFromTextStyle:()=>hi,formatShader:()=>j3,fragmentGPUTemplate:()=>pf,fragmentGlTemplate:()=>gf,generateArraySyncSTD40:()=>Xm,generateArraySyncWGSL:()=>wm,generateBlurFragSource:()=>dx,generateBlurGlProgram:()=>px,generateBlurProgram:()=>gx,generateBlurVertSource:()=>fx,generateGPULayout:()=>X3,generateGpuLayoutGroups:()=>af,generateLayout:()=>$3,generateLayoutHash:()=>uf,generateParticleUpdateFunction:()=>Wf,generateProgram:()=>ig,generateShaderSyncCode:()=>$m,generateTextStyleKey:()=>va,generateTextureBatchBit:()=>Ki,generateTextureBatchBitGl:()=>Zi,generateTextureMatrix:()=>Hf,generateUID:()=>fw,generateUniformsSync:()=>ag,getAdjustedBlendModeBlend:()=>yr,getAttributeInfoFromFormat:()=>xt,getBatchSamplersUniformGroup:()=>Qi,getBitmapTextLayout:()=>Ca,getCanvasBoundingBox:()=>qf,getCanvasFillStyle:()=>ss,getCanvasTexture:()=>Ua,getDefaultUniformValue:()=>yf,getFastGlobalBounds:()=>xw,getFastGlobalBoundsMixin:()=>sd,getFontCss:()=>Mp,getFontFamilyName:()=>AT,getGeometryBounds:()=>Zd,getGlTypeFromFormat:()=>Hm,getGlobalBounds:()=>Mr,getGlobalMixin:()=>ud,getGlobalRenderableBounds:()=>zp,getLocalBounds:()=>wi,getMatrixRelativeToParent:()=>Ud,getMaxFragmentPrecision:()=>Jd,getMaxTexturesPerBatch:()=>Mt,getOrientationOfPoints:()=>Rf,getParent:()=>E_,getPo2TextureFromSource:()=>Sa,getResolutionOfUrl:()=>Ts,getSVGUrl:()=>Dp,getSupportedCompressedTextureFormats:()=>pu,getSupportedGPUCompressedTextureFormats:()=>Yc,getSupportedGlCompressedTextureFormats:()=>Xc,getSupportedTextureFormats:()=>Vr,getTemporaryCanvasFromImage:()=>Ip,getTestContext:()=>zo,getTextureBatchBindGroup:()=>Vi,getTextureDefaultMatrix:()=>jw,getTextureFormatFromKTXTexture:()=>yP,getUboData:()=>eg,getUniformData:()=>tg,getUrlExtension:()=>tb,glFormatToGPUFormat:()=>Kg,glUploadBufferImageResource:()=>cg,glUploadCompressedTextureResource:()=>hg,glUploadImageResource:()=>ru,glUploadVideoResource:()=>fg,globalUniformsBit:()=>xf,globalUniformsBitGl:()=>_f,globalUniformsUBOBitGl:()=>GE,gpuFormatToBasisTranscoderFormat:()=>sP,gpuFormatToKTXBasisTranscoderFormat:()=>TP,gpuUploadBufferImageResource:()=>Fm,gpuUploadCompressedTextureResource:()=>Gm,gpuUploadImageResource:()=>$a,gpuUploadVideoResource:()=>Um,groupD8:()=>te,hasCachedCanvasTexture:()=>vC,hslWgsl:()=>U3,hslgl:()=>hs,hslgpu:()=>ds,injectBits:()=>Al,insertVersion:()=>rf,isMobile:()=>Td,isPow2:()=>nl,isRenderingToScreen:()=>Im,isSafari:()=>Ep,isSingleItem:()=>ni,isWebGLSupported:()=>Lr,isWebGPUSupported:()=>Nr,ktxTranscoderUrls:()=>bu,loadBasis:()=>eP,loadBasisOnWorker:()=>Wg,loadBitmapFont:()=>vg,loadDDS:()=>oP,loadEnvironmentExtensions:()=>yc,loadFontAsBase64:()=>Rp,loadFontCSS:()=>jl,loadImageBitmap:()=>MT,loadJson:()=>Rg,loadKTX:()=>uP,loadKTX2:()=>fP,loadKTX2onWorker:()=>jg,loadSVGImage:()=>kp,loadSvg:()=>Ig,loadTextures:()=>hu,loadTxt:()=>Mg,loadVideoTextures:()=>Fg,loadWebFont:()=>Dg,localUniformBit:()=>pi,localUniformBitGl:()=>ls,localUniformBitGroup2:()=>Gp,localUniformMSDFBit:()=>gp,localUniformMSDFBitGl:()=>xp,log2:()=>WS,logDebugTexture:()=>uB,logProgramError:()=>rg,logRenderGroupScene:()=>Z1,logScene:()=>K1,mSDFBit:()=>_p,mSDFBitGl:()=>bp,mapFormatToGlFormat:()=>gg,mapFormatToGlInternalFormat:()=>xg,mapFormatToGlType:()=>_g,mapGlToVertexFormat:()=>Zm,mapSize:()=>ew,mapType:()=>Ic,mapWebGLBlendModesToPixi:()=>ug,maskFrag:()=>um,maskVert:()=>lm,maskWgsl:()=>Ec,matrixPool:()=>Ue,measureHtmlText:()=>wa,measureMixin:()=>cd,migrateFragmentFromV7toV8:()=>Q3,mipmapScaleModeToGlFilter:()=>pg,mixHexColors:()=>Tw,multiplyColors:()=>Pi,multiplyHexColors:()=>Io,nextPow2:()=>mr,noiseFrag:()=>Tx,noiseWgsl:()=>gh,nonCompressedFormats:()=>LT,normalizeExtensionPriority:()=>wo,nssvg:()=>Ap,nsxhtml:()=>Cp,onRenderMixin:()=>hd,parseAttribute:()=>lp,parseDDS:()=>$g,parseFunctionBody:()=>mw,parseKTX:()=>qg,parseSVGDefinitions:()=>ap,parseSVGFloatAttribute:()=>Re,parseSVGPath:()=>jf,parseSVGStyle:()=>Wl,particleData:()=>Th,particlesFrag:()=>zf,particlesVert:()=>Xf,particlesWgsl:()=>Gl,path:()=>Ee,pointInTriangle:()=>xh,preloadVideo:()=>IT,removeItems:()=>Ro,removeStructAndGroupDuplicates:()=>lf,resetUids:()=>OS,resolveCharacters:()=>Aa,resolveCompressedTextureUrl:()=>EP,resolveJsonUrl:()=>Og,resolveTextureUrl:()=>du,resourceToTexture:()=>hb,roundPixelsBit:()=>tr,roundPixelsBitGl:()=>rr,roundedShapeArc:()=>sp,roundedShapeQuadraticCurve:()=>np,sayHello:()=>dm,scaleModeToGlFilter:()=>kc,setBasisTranscoderPath:()=>QC,setKTXTranscoderPath:()=>hP,setPositions:()=>Lp,setProgramName:()=>sf,setUvs:()=>Hp,shapeBuilders:()=>aa,sortMixin:()=>dd,spritesheetAsset:()=>Fd,squaredDistanceToLineSegment:()=>ts,stripVersion:()=>nf,styleAttributes:()=>up,testImageFormat:()=>ou,testVideoFormat:()=>ys,textStyleToCSS:()=>wp,textureBit:()=>Qp,textureBitGl:()=>Jp,textureFrom:()=>db,tilingBit:()=>Op,tilingBitGl:()=>Up,toFillStyle:()=>Er,toLocalGlobalMixin:()=>fd,toStrokeStyle:()=>is,transformVertices:()=>rn,triangulateWithHoles:()=>ia,uboSyncFunctionsSTD40:()=>Cc,uboSyncFunctionsWGSL:()=>Cm,uid:()=>J,uniformParsers:()=>wr,unpremultiplyAlpha:()=>IC,unsafeEvalSupported:()=>Ma,updateLocalTransform:()=>Ew,updateQuadBounds:()=>Vo,updateRenderGroupTransform:()=>ov,updateRenderGroupTransforms:()=>Tc,updateTextBounds:()=>hn,updateTransformAndChildren:()=>sm,updateTransformBackwards:()=>Do,updateWorldTransform:()=>Cw,v8_0_0:()=>U,v8_3_4:()=>jh,validFormats:()=>yu,validateRenderables:()=>nm,vertexGPUTemplate:()=>ff,vertexGlTemplate:()=>mf,viewportFromFrame:()=>aw,vkFormatToGPUFormat:()=>Zg,warn:()=>I,webworkerExt:()=>q0,wrapModeToGlAddress:()=>iu});var dB,pe=d(()=>{FA();OA();S();S();Vd();Gd();H_();V_();NA();HA();VA();WA();zA();XA();YA();$A();qA();jA();KA();ZA();QA();JA();eC();tC();rC();iC();sC();nC();oC();HC();W_();X_();qC();pT();Ir();mT();gT();xT();_T();bT();yT();vT();Sg();Nc();TT();Vt();ST();ET();CT();PT();kg();FT();mi();RT();GT();Gg();Gi();vs();Yt();Ho();kd();eb();fl();qe();KC();tP();iP();nP();NT();HT();VT();aP();WT();lP();YT();XT();pP();xP();bP();vP();KT();SP();$T();ZT();qT();CP();QT();e1();PP();p_();gE();Q_();be();ev();J_();E3();q_();Bd();Cd();ul();Z_();cl();Pd();wd();K0();Z0();Q0();L3();g1();x1();v1();E1();A1();hh();C1();P1();w1();B1();R1();fv();pv();mv();Oe();Zl();Ql();w3();M3();S1();hx();_1();y1();b1();T1();D3();I3();O3();Or();tl();W0();X0();gv();xd();ne();qh();ko();Kf();Ai();Ct();M1();Hy();Vy();Wy();He();zy();N3();D1();G1();z3();L1();p2();pb();Hi();Y3();q3();_l();iv();_b();dv();vb();gb();vf();Jb();ai();Yb();Lb();Hb();Vb();Wb();K3();zb();$b();Zo();Qo();qb();bn();ui();em();sb();_v();nb();bv();b_();Z3();ob();yv();gl();xl();aT();m2();g2();x2();En();b2();T2();v2();E2();A2();C2();M2();P2();R2();D2();I2();k2();Pl();Dt();F2();W2();Y2();J3();G2();jm();Rm();U2();V2();Sb();zd();L2();N2();H2();tw();Qm();Eb();Ab();Cb();Pb();wb();zm();B2();w2();X2();z2();j2();$2();Nm();K2();nT();Z2();Q2();dg();J2();tT();OT();rT();iT();sT();eT();kC();oT();Nv();Hv();iw();jv();Vv();Wv();zv();Xv();qv();Kv();Zv();Qv();e2();t2();r2();oi();Wt();i2();Sm();$v();Db();Ib();Yv();Fb();Gb();Ob();s2();n2();Mm();c2();o2();a2();Om();u2();UT();l2();h2();Tv();Sv();kr();Pc();vr();$d();Cv();wv();ow();zi();Tf();bb();Xi();yb();Sf();pd();Bv();Jv();xm();km();uw();Rv();kb();ir();Zb();vm();Ve();Am();Qb();Pm();Em();Dv();Wi();Yo();Xt();Da();ym();jp();fn();hw();Fv();Pv();_d();Qs();fu();Js();it();Hd();se();Ov();bd();gr();md();dw();pw();_m();Hg();mu();fb();jo();gw();Lv();zt();Py();wy();By();at();_w();Os();il();z0();Ci();g_();x_();__();y_();v_();T_();ld();C_();P_();w_();B_();Rt();sv();bw();D_();nv();lv();yd();A_();im();vw();Ri();rm();Sw();ad();od();Aw();av();Pw();uv();d2();on();tv();Ef();Jf();qy();tp();jy();Qy();Pf();ty();ry();Uf();Lf();Nf();WE();fa();Ul();mp();mn();Il();by();Hl();Jy();e0();t0();op();Ny();i0();s0();r0();ly();Bw();hp();uy();ey();Of();Iw();Nw();z1();V1();W1();Hw();Kl();$w();qw();X1();f2();rv();kl();Kw();yo();fi();vy();Sy();Dy();My();Iy();Jw();Cy();rB();Yf();$1();Ry();Ey();Ay();I1();Wp();nB();H0();M0();k0();F1();L0();O0();F0();G0();U0();da();Oi();cv();yp();cT();hT();dT();fT();lT();$l();O1();x0();m0();Tp();vp();U1();b0();Pp();ql();B0();T0();A0();C0();P0();S0();E0();w0();Fp();v0();_h();Xl();Fy();u0();zl();pp();p0();c0();h0();Px();ci();aB();dp();fp();$f();_r();rb();ib();Xs();ki();z_();Ld();L_();y0();Ia();ka();qp();Gy();om();ft();Iv();Qh();tt();Od();Yd();am();ce();lB();cB();le();M_();k1();Hc();Fi();Kh();pt();Mv();dB=Po(ay());k.add($0,q0);});var TB=dr((qx,vB)=>{(function(r,e){typeof qx=="object"?vB.exports=qx=e():typeof define=="function"&&define.amd?define([],e):r.CryptoJS=e();})(qx,function(){var r=r||function(e,t){var i;if(typeof window<"u"&&window.crypto&&(i=window.crypto),typeof self<"u"&&self.crypto&&(i=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(i=globalThis.crypto),!i&&typeof window<"u"&&window.msCrypto&&(i=window.msCrypto),!i&&typeof global<"u"&&global.crypto&&(i=global.crypto),!i&&typeof o_=="function")try{i=o_("crypto");}catch{}var s=function(){if(i){if(typeof i.getRandomValues=="function")try{return i.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof i.randomBytes=="function")try{return i.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},n=Object.create||function(){function x(){}return function(y){var v;return x.prototype=y,v=new x,x.prototype=null,v}}(),o={},a=o.lib={},u=a.Base=function(){return {extend:function(x){var y=n(this);return x&&y.mixIn(x),(!y.hasOwnProperty("init")||this.init===y.init)&&(y.init=function(){y.$super.init.apply(this,arguments);}),y.init.prototype=y,y.$super=this,y},create:function(){var x=this.extend();return x.init.apply(x,arguments),x},init:function(){},mixIn:function(x){for(var y in x)x.hasOwnProperty(y)&&(this[y]=x[y]);x.hasOwnProperty("toString")&&(this.toString=x.toString);},clone:function(){return this.init.prototype.extend(this)}}}(),l=a.WordArray=u.extend({init:function(x,y){x=this.words=x||[],y!=t?this.sigBytes=y:this.sigBytes=x.length*4;},toString:function(x){return (x||h).stringify(this)},concat:function(x){var y=this.words,v=x.words,T=this.sigBytes,B=x.sigBytes;if(this.clamp(),T%4)for(var E=0;E<B;E++){var w=v[E>>>2]>>>24-E%4*8&255;y[T+E>>>2]|=w<<24-(T+E)%4*8;}else for(var F=0;F<B;F+=4)y[T+F>>>2]=v[F>>>2];return this.sigBytes+=B,this},clamp:function(){var x=this.words,y=this.sigBytes;x[y>>>2]&=4294967295<<32-y%4*8,x.length=e.ceil(y/4);},clone:function(){var x=u.clone.call(this);return x.words=this.words.slice(0),x},random:function(x){for(var y=[],v=0;v<x;v+=4)y.push(s());return new l.init(y,x)}}),c=o.enc={},h=c.Hex={stringify:function(x){for(var y=x.words,v=x.sigBytes,T=[],B=0;B<v;B++){var E=y[B>>>2]>>>24-B%4*8&255;T.push((E>>>4).toString(16)),T.push((E&15).toString(16));}return T.join("")},parse:function(x){for(var y=x.length,v=[],T=0;T<y;T+=2)v[T>>>3]|=parseInt(x.substr(T,2),16)<<24-T%8*4;return new l.init(v,y/2)}},f=c.Latin1={stringify:function(x){for(var y=x.words,v=x.sigBytes,T=[],B=0;B<v;B++){var E=y[B>>>2]>>>24-B%4*8&255;T.push(String.fromCharCode(E));}return T.join("")},parse:function(x){for(var y=x.length,v=[],T=0;T<y;T++)v[T>>>2]|=(x.charCodeAt(T)&255)<<24-T%4*8;return new l.init(v,y)}},p=c.Utf8={stringify:function(x){try{return decodeURIComponent(escape(f.stringify(x)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(x){return f.parse(unescape(encodeURIComponent(x)))}},g=a.BufferedBlockAlgorithm=u.extend({reset:function(){this._data=new l.init,this._nDataBytes=0;},_append:function(x){typeof x=="string"&&(x=p.parse(x)),this._data.concat(x),this._nDataBytes+=x.sigBytes;},_process:function(x){var y,v=this._data,T=v.words,B=v.sigBytes,E=this.blockSize,w=E*4,F=B/w;x?F=e.ceil(F):F=e.max((F|0)-this._minBufferSize,0);var G=F*E,O=e.min(G*4,B);if(G){for(var D=0;D<G;D+=E)this._doProcessBlock(T,D);y=T.splice(0,G),v.sigBytes-=O;}return new l.init(y,O)},clone:function(){var x=u.clone.call(this);return x._data=this._data.clone(),x},_minBufferSize:0});a.Hasher=g.extend({cfg:u.extend(),init:function(x){this.cfg=this.cfg.extend(x),this.reset();},reset:function(){g.reset.call(this),this._doReset();},update:function(x){return this._append(x),this._process(),this},finalize:function(x){x&&this._append(x);var y=this._doFinalize();return y},blockSize:512/32,_createHelper:function(x){return function(y,v){return new x.init(v).finalize(y)}},_createHmacHelper:function(x){return function(y,v){return new _.HMAC.init(x,v).finalize(y)}}});var _=o.algo={};return o}(Math);return r});});var EB=dr((jx,SB)=>{(function(r,e){typeof jx=="object"?SB.exports=jx=e(TB()):typeof define=="function"&&define.amd?define(["./core"],e):e(r.CryptoJS);})(jx,function(r){return function(){var e=r,t=e.lib,i=t.WordArray,s=t.Hasher,n=e.algo,o=[],a=n.SHA1=s.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878,3285377520]);},_doProcessBlock:function(u,l){for(var c=this._hash.words,h=c[0],f=c[1],p=c[2],g=c[3],b=c[4],_=0;_<80;_++){if(_<16)o[_]=u[l+_]|0;else {var x=o[_-3]^o[_-8]^o[_-14]^o[_-16];o[_]=x<<1|x>>>31;}var y=(h<<5|h>>>27)+b+o[_];_<20?y+=(f&p|~f&g)+1518500249:_<40?y+=(f^p^g)+1859775393:_<60?y+=(f&p|f&g|p&g)-1894007588:y+=(f^p^g)-899497514,b=g,g=p,p=f<<30|f>>>2,f=h,h=y;}c[0]=c[0]+h|0,c[1]=c[1]+f|0,c[2]=c[2]+p|0,c[3]=c[3]+g|0,c[4]=c[4]+b|0;},_doFinalize:function(){var u=this._data,l=u.words,c=this._nDataBytes*8,h=u.sigBytes*8;return l[h>>>5]|=128<<24-h%32,l[(h+64>>>9<<4)+14]=Math.floor(c/4294967296),l[(h+64>>>9<<4)+15]=c,u.sigBytes=l.length*4,this._process(),this._hash},clone:function(){var u=s.clone.call(this);return u._hash=this._hash.clone(),u}});e.SHA1=s._createHelper(a),e.HmacSHA1=s._createHmacHelper(a);}(),r.SHA1});});pe();var Yr={};Hh(Yr,{DistortionFilter:()=>Ux,EqualizerFilter:()=>hr,Filter:()=>Je,MonoFilter:()=>Lx,ReverbFilter:()=>Nx,StereoFilter:()=>Hx,StreamFilter:()=>Vx,TelephoneFilter:()=>Wx});var fB;function pB(r){return fB=r,r}function me(){return fB}var Je=class{constructor(e,t){this.init(e,t);}init(e,t){this.destination=e,this.source=t||e;}connect(e){this.source?.connect(e);}disconnect(){this.source?.disconnect();}destroy(){this.disconnect(),this.destination=null,this.source=null;}};var Ux=class extends Je{constructor(e=0){let t;if(!me().useLegacy){let{audioContext:i}=me().context;t=i.createWaveShaper();}super(t),this._distortion=t,this.amount=e;}set amount(e){if(this._amount=e,me().useLegacy)return;let t=e*1e3,i=44100,s=new Float32Array(i),n=Math.PI/180,o=0,a;for(;o<i;++o)a=o*2/i-1,s[o]=(3+t)*a*20*n/(Math.PI+t*Math.abs(a));this._distortion.curve=s,this._distortion.oversample="4x";}get amount(){return this._amount}destroy(){this._distortion=null,super.destroy();}};var Ze=class{static setParamValue(e,t){if(e.setValueAtTime){let i=me().context;e.setValueAtTime(t,i.audioContext.currentTime);}else e.value=t;return t}};var ge=class extends Je{constructor(r=0,e=0,t=0,i=0,s=0,n=0,o=0,a=0,u=0,l=0){let c=[],h=[{f:ge.F32,type:"lowshelf",gain:r},{f:ge.F64,type:"peaking",gain:e},{f:ge.F125,type:"peaking",gain:t},{f:ge.F250,type:"peaking",gain:i},{f:ge.F500,type:"peaking",gain:s},{f:ge.F1K,type:"peaking",gain:n},{f:ge.F2K,type:"peaking",gain:o},{f:ge.F4K,type:"peaking",gain:a},{f:ge.F8K,type:"peaking",gain:u},{f:ge.F16K,type:"highshelf",gain:l}];me().useLegacy||(c=h.map(f=>{let p=me().context.audioContext.createBiquadFilter();return p.type=f.type,Ze.setParamValue(p.Q,1),p.frequency.value=f.f,Ze.setParamValue(p.gain,f.gain),p})),super(c[0],c[c.length-1]),this.bands=c,this.bandsMap={};for(let f=0;f<this.bands.length;f++){let p=this.bands[f];f>0&&this.bands[f-1].connect(p),this.bandsMap[p.frequency.value]=p;}}setGain(r,e=0){if(!this.bandsMap[r])throw new Error(`No band found for frequency ${r}`);Ze.setParamValue(this.bandsMap[r].gain,e);}getGain(r){if(!this.bandsMap[r])throw new Error(`No band found for frequency ${r}`);return this.bandsMap[r].gain.value}set f32(r){this.setGain(ge.F32,r);}get f32(){return this.getGain(ge.F32)}set f64(r){this.setGain(ge.F64,r);}get f64(){return this.getGain(ge.F64)}set f125(r){this.setGain(ge.F125,r);}get f125(){return this.getGain(ge.F125)}set f250(r){this.setGain(ge.F250,r);}get f250(){return this.getGain(ge.F250)}set f500(r){this.setGain(ge.F500,r);}get f500(){return this.getGain(ge.F500)}set f1k(r){this.setGain(ge.F1K,r);}get f1k(){return this.getGain(ge.F1K)}set f2k(r){this.setGain(ge.F2K,r);}get f2k(){return this.getGain(ge.F2K)}set f4k(r){this.setGain(ge.F4K,r);}get f4k(){return this.getGain(ge.F4K)}set f8k(r){this.setGain(ge.F8K,r);}get f8k(){return this.getGain(ge.F8K)}set f16k(r){this.setGain(ge.F16K,r);}get f16k(){return this.getGain(ge.F16K)}reset(){this.bands.forEach(r=>{Ze.setParamValue(r.gain,0);});}destroy(){this.bands.forEach(r=>{r.disconnect();}),this.bands=null,this.bandsMap=null;}},hr=ge;hr.F32=32;hr.F64=64;hr.F125=125;hr.F250=250;hr.F500=500;hr.F1K=1e3;hr.F2K=2e3;hr.F4K=4e3;hr.F8K=8e3;hr.F16K=16e3;var Lx=class extends Je{constructor(){let e,t;if(!me().useLegacy){let{audioContext:i}=me().context;t=i.createChannelSplitter(),e=i.createChannelMerger(),e.connect(t);}super(e,t),this._merger=e;}destroy(){this._merger?.disconnect(),this._merger=null,super.destroy();}};var Nx=class extends Je{constructor(e=3,t=2,i=false){super(null),this._seconds=this._clamp(e,1,50),this._decay=this._clamp(t,0,100),this._reverse=i,this._rebuild();}_clamp(e,t,i){return Math.min(i,Math.max(t,e))}get seconds(){return this._seconds}set seconds(e){this._seconds=this._clamp(e,1,50),this._rebuild();}get decay(){return this._decay}set decay(e){this._decay=this._clamp(e,0,100),this._rebuild();}get reverse(){return this._reverse}set reverse(e){this._reverse=e,this._rebuild();}_rebuild(){if(me().useLegacy)return;let{audioContext:e}=me().context,t=e.sampleRate,i=t*this._seconds,s=e.createBuffer(2,i,t),n=s.getChannelData(0),o=s.getChannelData(1),a;for(let l=0;l<i;l++)a=this._reverse?i-l:l,n[l]=(Math.random()*2-1)*Math.pow(1-a/i,this._decay),o[l]=(Math.random()*2-1)*Math.pow(1-a/i,this._decay);let u=e.createConvolver();u.buffer=s,this.init(u);}};var Hx=class extends Je{constructor(e=0){let t,i,s;if(!me().useLegacy){let{audioContext:n}=me().context;n.createStereoPanner?(t=n.createStereoPanner(),s=t):(i=n.createPanner(),i.panningModel="equalpower",s=i);}super(s),this._stereo=t,this._panner=i,this.pan=e;}set pan(e){this._pan=e,this._stereo?Ze.setParamValue(this._stereo.pan,e):this._panner&&this._panner.setPosition(e,0,1-Math.abs(e));}get pan(){return this._pan}destroy(){super.destroy(),this._stereo=null,this._panner=null;}};var Vx=class extends Je{constructor(){let e,t;if(!me().useLegacy){let{audioContext:i}=me().context;e=i.createMediaStreamDestination(),t=i.createMediaStreamSource(e.stream);}super(e,t),this._stream=e?.stream;}get stream(){return this._stream}destroy(){this._stream=null,super.destroy();}};var Wx=class extends Je{constructor(){let e,t;if(!me().useLegacy){let{audioContext:i}=me().context,s=i.createBiquadFilter(),n=i.createBiquadFilter(),o=i.createBiquadFilter(),a=i.createBiquadFilter();s.type="lowpass",Ze.setParamValue(s.frequency,2e3),n.type="lowpass",Ze.setParamValue(n.frequency,2e3),o.type="highpass",Ze.setParamValue(o.frequency,500),a.type="highpass",Ze.setParamValue(a.frequency,500),s.connect(n),n.connect(o),o.connect(a),e=s,t=a;}super(e,t);}};pe();var Sh=class extends re{constructor(){super(...arguments),this.speed=1,this.muted=false,this.volume=1,this.paused=false;}refresh(){this.emit("refresh");}refreshPaused(){this.emit("refreshPaused");}get filters(){return console.warn("HTML Audio does not support filters"),null}set filters(e){console.warn("HTML Audio does not support filters");}get audioContext(){return console.warn("HTML Audio does not support audioContext"),null}toggleMute(){return this.muted=!this.muted,this.refresh(),this.muted}togglePause(){return this.paused=!this.paused,this.refreshPaused(),this.paused}destroy(){this.removeAllListeners();}};pe();var hk=0,Q1=class extends re{constructor(r){super(),this.id=hk++,this.init(r);}set(r,e){if(this[r]===void 0)throw new Error(`Property with name ${r} does not exist.`);switch(r){case "speed":this.speed=e;break;case "volume":this.volume=e;break;case "paused":this.paused=e;break;case "loop":this.loop=e;break;case "muted":this.muted=e;break}return this}get progress(){let{currentTime:r}=this._source;return r/this._duration}get paused(){return this._paused}set paused(r){this._paused=r,this.refreshPaused();}_onPlay(){this._playing=true;}_onPause(){this._playing=false;}init(r){this._playing=false,this._duration=r.source.duration;let e=this._source=r.source.cloneNode(false);e.src=r.parent.url,e.onplay=this._onPlay.bind(this),e.onpause=this._onPause.bind(this),r.context.on("refresh",this.refresh,this),r.context.on("refreshPaused",this.refreshPaused,this),this._media=r;}_internalStop(){this._source&&this._playing&&(this._source.onended=null,this._source.pause());}stop(){this._internalStop(),this._source&&this.emit("stop");}get speed(){return this._speed}set speed(r){this._speed=r,this.refresh();}get volume(){return this._volume}set volume(r){this._volume=r,this.refresh();}get loop(){return this._loop}set loop(r){this._loop=r,this.refresh();}get muted(){return this._muted}set muted(r){this._muted=r,this.refresh();}get filters(){return console.warn("HTML Audio does not support filters"),null}set filters(r){console.warn("HTML Audio does not support filters");}refresh(){let r=this._media.context,e=this._media.parent;this._source.loop=this._loop||e.loop;let t=r.volume*(r.muted?0:1),i=e.volume*(e.muted?0:1),s=this._volume*(this._muted?0:1);this._source.volume=s*t*i,this._source.playbackRate=this._speed*r.speed*e.speed;}refreshPaused(){let r=this._media.context,e=this._media.parent,t=this._paused||e.paused||r.paused;t!==this._pausedReal&&(this._pausedReal=t,t?(this._internalStop(),this.emit("paused")):(this.emit("resumed"),this.play({start:this._source.currentTime,end:this._end,volume:this._volume,speed:this._speed,loop:this._loop})),this.emit("pause",t));}play(r){let{start:e,end:t,speed:i,loop:s,volume:n,muted:o}=r;t&&console.assert(t>e,"End time is before start time"),this._speed=i,this._volume=n,this._loop=!!s,this._muted=o,this.refresh(),this.loop&&t!==null&&(console.warn('Looping not support when specifying an "end" time'),this.loop=false),this._start=e,this._end=t||this._duration,this._start=Math.max(0,this._start-Q1.PADDING),this._end=Math.min(this._end+Q1.PADDING,this._duration),this._source.onloadedmetadata=()=>{this._source&&(this._source.currentTime=e,this._source.onloadedmetadata=null,this.emit("progress",e/this._duration,this._duration),fe.shared.add(this._onUpdate,this));},this._source.onended=this._onComplete.bind(this),this._source.play(),this.emit("start");}_onUpdate(){this.emit("progress",this.progress,this._duration),this._source.currentTime>=this._end&&!this._source.loop&&this._onComplete();}_onComplete(){fe.shared.remove(this._onUpdate,this),this._internalStop(),this.emit("progress",1,this._duration),this.emit("end",this);}destroy(){fe.shared.remove(this._onUpdate,this),this.removeAllListeners();let r=this._source;r&&(r.onended=null,r.onplay=null,r.onpause=null,this._internalStop()),this._source=null,this._speed=1,this._volume=1,this._loop=false,this._end=null,this._start=0,this._duration=0,this._playing=false,this._pausedReal=false,this._paused=false,this._muted=false,this._media&&(this._media.context.off("refresh",this.refresh,this),this._media.context.off("refreshPaused",this.refreshPaused,this),this._media=null);}toString(){return `[HTMLAudioInstance id=${this.id}]`}},zx=Q1;zx.PADDING=.1;pe();var Eh=class extends re{init(e){this.parent=e,this._source=e.options.source||new Audio,e.url&&(this._source.src=e.url);}create(){return new zx(this)}get isPlayable(){return !!this._source&&this._source.readyState===4}get duration(){return this._source.duration}get context(){return this.parent.context}get filters(){return null}set filters(e){console.warn("HTML Audio does not support filters");}destroy(){this.removeAllListeners(),this.parent=null,this._source&&(this._source.src="",this._source.load(),this._source=null);}get source(){return this._source}load(e){let t=this._source,i=this.parent;if(t.readyState===4){i.isLoaded=true;let u=i.autoPlayStart();e&&setTimeout(()=>{e(null,i,u);},0);return}if(!i.url){e(new Error("sound.url or sound.source must be set"));return}t.src=i.url;let s=()=>{a(),i.isLoaded=true;let u=i.autoPlayStart();e&&e(null,i,u);},n=()=>{a(),e&&e(new Error("Sound loading has been aborted"));},o=()=>{a();let u=`Failed to load audio element (code: ${t.error.code})`;e?e(new Error(u)):console.error(u);},a=()=>{t.removeEventListener("canplaythrough",s),t.removeEventListener("load",s),t.removeEventListener("abort",n),t.removeEventListener("error",o);};t.addEventListener("canplaythrough",s,false),t.addEventListener("load",s,false),t.addEventListener("abort",n,false),t.addEventListener("error",o,false),t.load();}};pe();var Ah=class{constructor(e,t){this.parent=e,Object.assign(this,t),this.duration=this.end-this.start,console.assert(this.duration>0,"End time must be after start time");}play(e){return this.parent.play({complete:e,speed:this.speed||this.parent.speed,end:this.end,start:this.start,loop:this.loop})}destroy(){this.parent=null;}};var vo=["ogg","oga","opus","m4a","mp3","mpeg","wav","aiff","wma","mid","caf"],J1=["audio/mpeg","audio/ogg"],To={};function mB(r){let e={m4a:"audio/mp4",oga:"audio/ogg",opus:'audio/ogg; codecs="opus"',caf:'audio/x-caf; codecs="opus"',...{}},t=document.createElement("audio"),i={},s=/^no$/;vo.forEach(n=>{let o=t.canPlayType(`audio/${n}`).replace(s,""),a=e[n]?t.canPlayType(e[n]).replace(s,""):"";i[n]=!!o||!!a;}),Object.assign(To,i);}mB();pe();pe();var fk=0,Ch=class extends re{constructor(e){super(),this.id=fk++,this._media=null,this._paused=false,this._muted=false,this._elapsed=0,this.init(e);}set(e,t){if(this[e]===void 0)throw new Error(`Property with name ${e} does not exist.`);switch(e){case "speed":this.speed=t;break;case "volume":this.volume=t;break;case "muted":this.muted=t;break;case "loop":this.loop=t;break;case "paused":this.paused=t;break}return this}stop(){this._source&&(this._internalStop(),this.emit("stop"));}get speed(){return this._speed}set speed(e){this._speed=e,this.refresh(),this._update(true);}get volume(){return this._volume}set volume(e){this._volume=e,this.refresh();}get muted(){return this._muted}set muted(e){this._muted=e,this.refresh();}get loop(){return this._loop}set loop(e){this._loop=e,this.refresh();}get filters(){return this._filters}set filters(e){this._filters&&(this._filters?.filter(t=>t).forEach(t=>t.disconnect()),this._filters=null,this._source.connect(this._gain)),this._filters=e?.length?e.slice(0):null,this.refresh();}refresh(){if(!this._source)return;let e=this._media.context,t=this._media.parent;this._source.loop=this._loop||t.loop;let i=e.volume*(e.muted?0:1),s=t.volume*(t.muted?0:1),n=this._volume*(this._muted?0:1);Ze.setParamValue(this._gain.gain,n*s*i),Ze.setParamValue(this._source.playbackRate,this._speed*t.speed*e.speed),this.applyFilters();}applyFilters(){if(this._filters?.length){this._source.disconnect();let e=this._source;this._filters.forEach(t=>{e.connect(t.destination),e=t;}),e.connect(this._gain);}}refreshPaused(){let e=this._media.context,t=this._media.parent,i=this._paused||t.paused||e.paused;i!==this._pausedReal&&(this._pausedReal=i,i?(this._internalStop(),this.emit("paused")):(this.emit("resumed"),this.play({start:this._elapsed%this._duration,end:this._end,speed:this._speed,loop:this._loop,volume:this._volume})),this.emit("pause",i));}play(e){let{start:t,end:i,speed:s,loop:n,volume:o,muted:a,filters:u}=e;i&&console.assert(i>t,"End time is before start time"),this._paused=false;let{source:l,gain:c}=this._media.nodes.cloneBufferSource();this._source=l,this._gain=c,this._speed=s,this._volume=o,this._loop=!!n,this._muted=a,this._filters=u,this.refresh();let h=this._source.buffer.duration;this._duration=h,this._end=i,this._lastUpdate=this._now(),this._elapsed=t,this._source.onended=this._onComplete.bind(this),this._loop?(this._source.loopEnd=i,this._source.loopStart=t,this._source.start(0,t)):i?this._source.start(0,t,i-t):this._source.start(0,t),this.emit("start"),this._update(true),this.enableTicker(true);}enableTicker(e){fe.shared.remove(this._updateListener,this),e&&fe.shared.add(this._updateListener,this);}get progress(){return this._progress}get paused(){return this._paused}set paused(e){this._paused=e,this.refreshPaused();}destroy(){this.removeAllListeners(),this._internalStop(),this._gain&&(this._gain.disconnect(),this._gain=null),this._media&&(this._media.context.events.off("refresh",this.refresh,this),this._media.context.events.off("refreshPaused",this.refreshPaused,this),this._media=null),this._filters?.forEach(e=>e.disconnect()),this._filters=null,this._end=null,this._speed=1,this._volume=1,this._loop=false,this._elapsed=0,this._duration=0,this._paused=false,this._muted=false,this._pausedReal=false;}toString(){return `[WebAudioInstance id=${this.id}]`}_now(){return this._media.context.audioContext.currentTime}_updateListener(){this._update();}_update(e=false){if(this._source){let t=this._now(),i=t-this._lastUpdate;if(i>0||e){let s=this._source.playbackRate.value;this._elapsed+=i*s,this._lastUpdate=t;let n=this._duration,o;if(this._source.loopStart){let a=this._source.loopEnd-this._source.loopStart;o=(this._source.loopStart+this._elapsed%a)/n;}else o=this._elapsed%n/n;this._progress=o,this.emit("progress",this._progress,n);}}}init(e){this._media=e,e.context.events.on("refresh",this.refresh,this),e.context.events.on("refreshPaused",this.refreshPaused,this);}_internalStop(){if(this._source){this.enableTicker(false),this._source.onended=null,this._source.stop(0),this._source.disconnect();try{this._source.buffer=null;}catch(e){console.warn("Failed to set AudioBufferSourceNode.buffer to null:",e);}this._source=null;}}_onComplete(){if(this._source){this.enableTicker(false),this._source.onended=null,this._source.disconnect();try{this._source.buffer=null;}catch(e){console.warn("Failed to set AudioBufferSourceNode.buffer to null:",e);}}this._source=null,this._progress=1,this.emit("progress",1,this._duration),this.emit("end",this);}};var So=class{constructor(e,t){this._output=t,this._input=e;}get destination(){return this._input}get filters(){return this._filters}set filters(e){if(this._filters&&(this._filters.forEach(t=>{t&&t.disconnect();}),this._filters=null,this._input.connect(this._output)),e&&e.length){this._filters=e.slice(0),this._input.disconnect();let t=null;e.forEach(i=>{t===null?this._input.connect(i.destination):t.connect(i.destination),t=i;}),t.connect(this._output);}}destroy(){this.filters=null,this._input=null,this._output=null;}};var gB=class extends So{constructor(r){let e=r.audioContext,t=e.createBufferSource(),i=e.createGain(),s=e.createAnalyser();t.connect(s),s.connect(i),i.connect(r.destination),super(s,i),this.context=r,this.bufferSource=t,this.gain=i,this.analyser=s;}get script(){return this._script||(this._script=this.context.audioContext.createScriptProcessor(gB.BUFFER_SIZE),this._script.connect(this.context.destination)),this._script}destroy(){super.destroy(),this.bufferSource.disconnect(),this._script&&this._script.disconnect(),this.gain.disconnect(),this.analyser.disconnect(),this.bufferSource=null,this._script=null,this.gain=null,this.analyser=null,this.context=null;}cloneBufferSource(){let r=this.bufferSource,e=this.context.audioContext.createBufferSource();e.buffer=r.buffer,Ze.setParamValue(e.playbackRate,r.playbackRate.value),e.loop=r.loop;let t=this.context.audioContext.createGain();return e.connect(t),t.connect(this.destination),{source:e,gain:t}}get bufferSize(){return this.script.bufferSize}},Xx=gB;Xx.BUFFER_SIZE=0;var Eo=class{init(e){this.parent=e,this._nodes=new Xx(this.context),this._source=this._nodes.bufferSource,this.source=e.options.source;}destroy(){this.parent=null,this._nodes.destroy(),this._nodes=null;try{this._source.buffer=null;}catch(e){console.warn("Failed to set AudioBufferSourceNode.buffer to null:",e);}this._source=null,this.source=null;}create(){return new Ch(this)}get context(){return this.parent.context}get isPlayable(){return !!this._source&&!!this._source.buffer}get filters(){return this._nodes.filters}set filters(e){this._nodes.filters=e;}get duration(){return console.assert(this.isPlayable,"Sound not yet playable, no duration"),this._source.buffer.duration}get buffer(){return this._source.buffer}set buffer(e){this._source.buffer=e;}get nodes(){return this._nodes}load(e){this.source?this._decode(this.source,e):this.parent.url?this._loadUrl(e):e?e(new Error("sound.url or sound.source must be set")):console.error("sound.url or sound.source must be set");}async _loadUrl(e){let t=this.parent.url,i=await H.get().fetch(t);this._decode(await i.arrayBuffer(),e);}_decode(e,t){let i=(s,n)=>{if(s)t&&t(s);else {this.parent.isLoaded=true,this.buffer=n;let o=this.parent.autoPlayStart();t&&t(null,this.parent,o);}};e instanceof AudioBuffer?i(null,e):this.parent.context.decode(e,i);}};var Lu=class{static from(r){let e={};typeof r=="string"?e.url=r:r instanceof ArrayBuffer||r instanceof AudioBuffer||r instanceof HTMLAudioElement?e.source=r:Array.isArray(r)?e.url=r:e=r,e={autoPlay:false,singleInstance:false,url:null,source:null,preload:false,volume:1,speed:1,complete:null,loaded:null,loop:false,...e},Object.freeze(e);let t=me().useLegacy?new Eh:new Eo;return new Lu(t,e)}constructor(r,e){this.media=r,this.options=e,this._instances=[],this._sprites={},this.media.init(this);let t=e.complete;this._autoPlayOptions=t?{complete:t}:null,this.isLoaded=false,this._preloadQueue=null,this.isPlaying=false,this.autoPlay=e.autoPlay,this.singleInstance=e.singleInstance,this.preload=e.preload||this.autoPlay,this.url=Array.isArray(e.url)?this.preferUrl(e.url):e.url,this.speed=e.speed,this.volume=e.volume,this.loop=e.loop,e.sprites&&this.addSprites(e.sprites),this.preload&&this._preload(e.loaded);}preferUrl(r){let[e]=r.map(t=>({url:t,ext:Ee.extname(t).slice(1)})).filter(({ext:t})=>To[t]).sort((t,i)=>vo.indexOf(t.ext)-vo.indexOf(i.ext));if(!e)throw new Error("No supported file type found");return e.url}get context(){return me().context}pause(){return this.isPlaying=false,this.paused=true,this}resume(){return this.isPlaying=this._instances.length>0,this.paused=false,this}get paused(){return this._paused}set paused(r){this._paused=r,this.refreshPaused();}get speed(){return this._speed}set speed(r){this._speed=r,this.refresh();}get filters(){return this.media.filters}set filters(r){this.media.filters=r;}addSprites(r,e){if(typeof r=="object"){let i={};for(let s in r)i[s]=this.addSprites(s,r[s]);return i}console.assert(!this._sprites[r],`Alias ${r} is already taken`);let t=new Ah(this,e);return this._sprites[r]=t,t}destroy(){this._removeInstances(),this.removeSprites(),this.media.destroy(),this.media=null,this._sprites=null,this._instances=null;}removeSprites(r){if(r){let e=this._sprites[r];e!==void 0&&(e.destroy(),delete this._sprites[r]);}else for(let e in this._sprites)this.removeSprites(e);return this}get isPlayable(){return this.isLoaded&&this.media&&this.media.isPlayable}stop(){if(!this.isPlayable)return this.autoPlay=false,this._autoPlayOptions=null,this;this.isPlaying=false;for(let r=this._instances.length-1;r>=0;r--)this._instances[r].stop();return this}play(r,e){let t;if(typeof r=="string"?t={sprite:r,loop:this.loop,complete:e}:typeof r=="function"?(t={},t.complete=r):t=r,t={complete:null,loaded:null,sprite:null,end:null,start:0,volume:1,speed:1,muted:false,loop:false,...t||{}},t.sprite){let s=t.sprite;console.assert(!!this._sprites[s],`Alias ${s} is not available`);let n=this._sprites[s];t.start=n.start+(t.start||0),t.end=n.end,t.speed=n.speed||1,t.loop=n.loop||t.loop,delete t.sprite;}if(t.offset&&(t.start=t.offset),!this.isLoaded)return this._preloadQueue?new Promise(s=>{this._preloadQueue.push(()=>{s(this.play(t));});}):(this._preloadQueue=[],this.autoPlay=true,this._autoPlayOptions=t,new Promise((s,n)=>{this._preload((o,a,u)=>{this._preloadQueue.forEach(l=>l()),this._preloadQueue=null,o?n(o):(t.loaded&&t.loaded(o,a,u),s(u));});}));(this.singleInstance||t.singleInstance)&&this._removeInstances();let i=this._createInstance();return this._instances.push(i),this.isPlaying=true,i.once("end",()=>{t.complete&&t.complete(this),this._onComplete(i);}),i.once("stop",()=>{this._onComplete(i);}),i.play(t),i}refresh(){let r=this._instances.length;for(let e=0;e<r;e++)this._instances[e].refresh();}refreshPaused(){let r=this._instances.length;for(let e=0;e<r;e++)this._instances[e].refreshPaused();}get volume(){return this._volume}set volume(r){this._volume=r,this.refresh();}get muted(){return this._muted}set muted(r){this._muted=r,this.refresh();}get loop(){return this._loop}set loop(r){this._loop=r,this.refresh();}_preload(r){this.media.load(r);}get instances(){return this._instances}get sprites(){return this._sprites}get duration(){return this.media.duration}autoPlayStart(){let r;return this.autoPlay&&(r=this.play(this._autoPlayOptions)),r}_removeInstances(){for(let r=this._instances.length-1;r>=0;r--)this._poolInstance(this._instances[r]);this._instances.length=0;}_onComplete(r){if(this._instances){let e=this._instances.indexOf(r);e>-1&&this._instances.splice(e,1),this.isPlaying=this._instances.length>0;}this._poolInstance(r);}_createInstance(){if(Lu._pool.length>0){let r=Lu._pool.pop();return r.init(this.media),r}return this.media.create()}_poolInstance(r){r.destroy(),Lu._pool.indexOf(r)<0&&Lu._pool.push(r);}},Ps=Lu;Ps._pool=[];pe();var Nu=class r extends So{constructor(){let e=window,t=new r.AudioContext,i=t.createDynamicsCompressor(),s=t.createAnalyser();s.connect(i),i.connect(t.destination),super(s,i),this.autoPause=true,this._ctx=t,this._offlineCtx=new r.OfflineAudioContext(1,2,e.OfflineAudioContext?Math.max(8e3,Math.min(96e3,t.sampleRate)):44100),this.compressor=i,this.analyser=s,this.events=new re,this.volume=1,this.speed=1,this.muted=false,this.paused=false,this._locked=t.state==="suspended"&&("ontouchstart"in globalThis||"onclick"in globalThis),this._locked&&(this._unlock(),this._unlock=this._unlock.bind(this),document.addEventListener("mousedown",this._unlock,true),document.addEventListener("touchstart",this._unlock,true),document.addEventListener("touchend",this._unlock,true)),this.onFocus=this.onFocus.bind(this),this.onBlur=this.onBlur.bind(this),globalThis.addEventListener("focus",this.onFocus),globalThis.addEventListener("blur",this.onBlur);}onFocus(){if(!this.autoPause)return;let e=this._ctx.state;(e==="suspended"||e==="interrupted"||!this._locked)&&(this.paused=this._pausedOnBlur,this.refreshPaused());}onBlur(){this.autoPause&&(this._locked||(this._pausedOnBlur=this._paused,this.paused=true,this.refreshPaused()));}_unlock(){this._locked&&(this.playEmptySound(),this._ctx.state==="running"&&(document.removeEventListener("mousedown",this._unlock,true),document.removeEventListener("touchend",this._unlock,true),document.removeEventListener("touchstart",this._unlock,true),this._locked=false));}playEmptySound(){let e=this._ctx.createBufferSource();e.buffer=this._ctx.createBuffer(1,1,22050),e.connect(this._ctx.destination),e.start(0,0,0),e.context.state==="suspended"&&e.context.resume();}static get AudioContext(){let e=window;return e.AudioContext||e.webkitAudioContext||null}static get OfflineAudioContext(){let e=window;return e.OfflineAudioContext||e.webkitOfflineAudioContext||null}destroy(){super.destroy();let e=this._ctx;typeof e.close<"u"&&e.close(),globalThis.removeEventListener("focus",this.onFocus),globalThis.removeEventListener("blur",this.onBlur),this.events.removeAllListeners(),this.analyser.disconnect(),this.compressor.disconnect(),this.analyser=null,this.compressor=null,this.events=null,this._offlineCtx=null,this._ctx=null;}get audioContext(){return this._ctx}get offlineContext(){return this._offlineCtx}set paused(e){e&&this._ctx.state==="running"?this._ctx.suspend():!e&&this._ctx.state==="suspended"&&this._ctx.resume(),this._paused=e;}get paused(){return this._paused}refresh(){this.events.emit("refresh");}refreshPaused(){this.events.emit("refreshPaused");}toggleMute(){return this.muted=!this.muted,this.refresh(),this.muted}togglePause(){return this.paused=!this.paused,this.refreshPaused(),this._paused}decode(e,t){let i=n=>{t(new Error(n?.message||"Unable to decode file"));},s=this._offlineCtx.decodeAudioData(e,n=>{t(null,n);},i);s&&s.catch(i);}};var Yx=class{constructor(){this.init();}init(){return this.supported&&(this._webAudioContext=new Nu),this._htmlAudioContext=new Sh,this._sounds={},this.useLegacy=!this.supported,this}get context(){return this._context}get filtersAll(){return this.useLegacy?[]:this._context.filters}set filtersAll(e){this.useLegacy||(this._context.filters=e);}get supported(){return Nu.AudioContext!==null}add(e,t){if(typeof e=="object"){let n={};for(let o in e){let a=this._getOptions(e[o],t);n[o]=this.add(o,a);}return n}if(console.assert(!this._sounds[e],`Sound with alias ${e} already exists.`),t instanceof Ps)return this._sounds[e]=t,t;let i=this._getOptions(t),s=Ps.from(i);return this._sounds[e]=s,s}_getOptions(e,t){let i;return typeof e=="string"?i={url:e}:Array.isArray(e)?i={url:e}:e instanceof ArrayBuffer||e instanceof AudioBuffer||e instanceof HTMLAudioElement?i={source:e}:i=e,i={...i,...t||{}},i}get useLegacy(){return this._useLegacy}set useLegacy(e){this._useLegacy=e,this._context=!e&&this.supported?this._webAudioContext:this._htmlAudioContext;}get disableAutoPause(){return !this._webAudioContext.autoPause}set disableAutoPause(e){this._webAudioContext.autoPause=!e;}remove(e){return this.exists(e,true),this._sounds[e].destroy(),delete this._sounds[e],this}get volumeAll(){return this._context.volume}set volumeAll(e){this._context.volume=e,this._context.refresh();}get speedAll(){return this._context.speed}set speedAll(e){this._context.speed=e,this._context.refresh();}togglePauseAll(){return this._context.togglePause()}pauseAll(){return this._context.paused=true,this._context.refreshPaused(),this}resumeAll(){return this._context.paused=false,this._context.refreshPaused(),this}toggleMuteAll(){return this._context.toggleMute()}muteAll(){return this._context.muted=true,this._context.refresh(),this}unmuteAll(){return this._context.muted=false,this._context.refresh(),this}removeAll(){for(let e in this._sounds)this._sounds[e].destroy(),delete this._sounds[e];return this}stopAll(){for(let e in this._sounds)this._sounds[e].stop();return this}exists(e,t=false){let i=!!this._sounds[e];return t&&console.assert(i,`No sound matching alias '${e}'.`),i}isPlaying(){for(let e in this._sounds)if(this._sounds[e].isPlaying)return true;return false}find(e){return this.exists(e,true),this._sounds[e]}play(e,t){return this.find(e).play(t)}stop(e){return this.find(e).stop()}pause(e){return this.find(e).pause()}resume(e){return this.find(e).resume()}volume(e,t){let i=this.find(e);return t!==void 0&&(i.volume=t),i.volume}speed(e,t){let i=this.find(e);return t!==void 0&&(i.speed=t),i.speed}duration(e){return this.find(e).duration}close(){return this.removeAll(),this._sounds=null,this._webAudioContext&&(this._webAudioContext.destroy(),this._webAudioContext=null),this._htmlAudioContext&&(this._htmlAudioContext.destroy(),this._htmlAudioContext=null),this._context=null,this}};pe();pe();var xB=r=>{let e=r.src,t=r?.alias?.[0];return (!t||r.src===t)&&(t=Ee.basename(e,Ee.extname(e))),t},_B={extension:m.Asset,detection:{test:async()=>true,add:async r=>[...r,...vo.filter(e=>To[e])],remove:async r=>r.filter(e=>r.includes(e))},loader:{name:"sound",extension:{type:[m.LoadParser],priority:Se.High},test(r){let e=Ee.extname(r).slice(1);return !!To[e]||J1.some(t=>r.startsWith(`data:${t}`))},async load(r,e){let t=await new Promise((i,s)=>Ps.from({...e.data,url:r,preload:true,loaded(n,o){n?s(n):i(o),e.data?.loaded?.(n,o);}}));return me().add(xB(e),t),t},async unload(r,e){me().remove(xB(e));}}};k.add(_B);pB(new Yx);var Ph="repeat";({DistortionFilter:Yr.DistortionFilter,EqualizerFilter:Yr.EqualizerFilter,MonoFilter:Yr.MonoFilter,ReverbFilter:Yr.ReverbFilter,StereoFilter:Yr.StereoFilter,StreamFilter:Yr.StreamFilter,TelephoneFilter:Yr.TelephoneFilter});var bB=["webm","mp4","ogv","mov","avi","wmv","flv","mkv","3gp","mpg","mpeg","m4v","f4v","m2v","asf","vob","ts","m2ts","mts","divx","xvid","rm","rmvb","dat","swf","mpv","mxf","vcd","svcd","dvd","dv","3g2","m2p","m2ts","m2v","m4v","mpe","mpg","mpv2","ogm","qt","rm","ts","vob","wmv","xvid","flv","mkv","mov","mp4","webm","avi","ogv","m4v","f4v","m2v","asf","vob","ts","m2ts","mts","divx","xvid","rm","rmvb","dat","swf","mpv","mxf","vcd","svcd","dvd","dv","3g2","m2p","m2ts","m2v","m4v","mpe","mpg","mpv2","ogm","qt","rm","ts","vob","wmv","xvid","flv","mkv","mov","mp4","webm","avi","ogv","m4v","f4v","m2v","asf","vob"],Rr="__game_layer__",Hu="Container",$x="ImageContainer",eS="Image",Vu="Sprite",Wu="Text",tS="Video";var N;(s=>(s.log=(n,...o)=>console.log(`[Pixi\u2019VN] ${n}`,...o),s.warn=(n,...o)=>console.warn(`[Pixi\u2019VN] ${n}`,...o),s.error=(n,...o)=>console.error(`[Pixi\u2019VN] ${n}`,...o),s.info=(n,...o)=>console.info(`[Pixi\u2019VN] ${n}`,...o)))(N||={});function St(r){try{if(typeof r>"u")return r;let e=JSON.stringify(r);return JSON.parse(e)}catch(e){throw N.error("Error creating exportable element",r,e),new Error("[Pixi\u2019VN] Error creating exportable element")}}async function yB(r){var e;let t={importPixi:false,...r};t.app&&(t.renderer=t.app.renderer,t.stage=t.app.stage),t.importPixi&&!t.pixi&&(t.pixi=await Promise.resolve().then(()=>(pe(),hB))),window.__PIXI_DEVTOOLS__={...window.__PIXI_DEVTOOLS__||{},app:t.app,stage:t.stage,renderer:t.renderer,extensions:[...((e=window.__PIXI_DEVTOOLS__)==null?void 0:e.extensions)||[],...t.extensions||[]],plugins:{}};}var CB=Po(EB());pe();var gk={extension:{type:"sceneProperties",name:"additional-positions"},testNode(r){return r instanceof _e||r instanceof Et||r instanceof De},testProp(r){switch(r){case "xAlign":case "yAlign":case "xPercentagePosition":case "yPercentagePosition":case "positionType":return true;default:return false}},setProperty(r,e,t){if(r instanceof _e||r instanceof Et||r instanceof De)switch(e){case "xAlign":r.xAlign=t/100;break;case "yAlign":r.yAlign=t/100;break;case "xPercentagePosition":r.xPercentagePosition=t/100;break;case "yPercentagePosition":r.yPercentagePosition=t/100;break}},getProperties(r){return [{value:r.positionType,prop:"positionType",entry:{section:"Transform",type:"text",label:"Position Type"}},{value:r.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:r.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:r.xPercentagePosition*100,prop:"xPercentagePosition",entry:{section:"Transform",type:"range",label:"X Percentage Position",tooltip:"0% is left, 100% is right",options:{min:0,max:100}}},{value:r.yPercentagePosition*100,prop:"yPercentagePosition",entry:{section:"Transform",type:"range",label:"Y Percentage Position",tooltip:"0% is top, 100% is bottom",options:{min:0,max:100}}}]}},AB=gk;var P=class r{constructor(){}static _app=void 0;static get app(){if(!r._app)throw new Error("[Pixi\u2019VN] CanvasManagerStatic.app is undefined");return r._app}static get gameLayer(){let e=this.app.stage.getChildByLabel(Rr);return e||(e=new $,e.label=Rr,this.app.stage.addChild(e)),e}static htmlLayout;static canvasWidth=300;static canvasHeight=300;static _isInitialized=false;static async init(e,t,i,s,n){return r.canvasWidth=t,r.canvasHeight=i,r._app=new Oc,r.app.init({resolution:window.devicePixelRatio||1,autoDensity:true,width:t,height:i,...s}).then(()=>{let{app:o=r.app,extensions:a=[],...u}=n||{};yB({app:o,extensions:[AB,...a],...u}),r._isInitialized=true,r.addCanvasIntoHTMLElement(e),window.addEventListener("resize",r.resize),r.resize(),r.gameLayer;})}static addCanvasIntoHTMLElement(e){r._isInitialized?e.appendChild(r.app.canvas):N.error("GameWindowManager is not initialized");}static initializeHTMLLayout(e){let t=document.createElement("div");t.style.position="absolute",t.style.pointerEvents="none",e.appendChild(t),r.htmlLayout=t,r.resize();}static get screenScale(){let e=Math.max(document.documentElement.clientWidth,window.innerWidth||0),t=Math.max(document.documentElement.clientHeight,window.innerHeight||0);return Math.min(e/r.canvasWidth,t/r.canvasHeight)}static get screenWidth(){return Math.floor(r.screenScale*r.canvasWidth)}static get screenHeight(){return Math.floor(r.screenScale*r.canvasHeight)}static get horizontalMargin(){return (Math.max(document.documentElement.clientWidth,window.innerWidth||0)-r.screenWidth)/2}static get verticalMargin(){return (Math.max(document.documentElement.clientHeight,window.innerHeight||0)-r.screenHeight)/2}static resize(){if(r._isInitialized){let e=r.app.canvas.style;e.width=`${r.screenWidth}px`,e.height=`${r.screenHeight}px`,e.marginLeft=`${r.horizontalMargin}px`,e.marginRight=`${r.horizontalMargin}px`,e.marginTop=`${r.verticalMargin}px`,e.marginBottom=`${r.verticalMargin}px`;}r.htmlLayout&&(r.htmlLayout.style.width=`${r.screenWidth}px`,r.htmlLayout.style.height=`${r.screenHeight}px`,r.htmlLayout.style.marginLeft=`${r.horizontalMargin}px`,r.htmlLayout.style.marginRight=`${r.horizontalMargin}px`,r.htmlLayout.style.marginTop=`${r.verticalMargin}px`,r.htmlLayout.style.marginBottom=`${r.verticalMargin}px`);}static get childrenAliasesOrder(){return r.gameLayer.children.filter(e=>e.label).sort((e,t)=>r.gameLayer.getChildIndex(e)-r.gameLayer.getChildIndex(t)).map(e=>e.label)}static get currentTickersWithoutCreatedBySteps(){return Object.fromEntries(Object.entries(r._currentTickers).filter(([e,t])=>!t.createdByTicketSteps))}static _currentTickers={};static _currentTickersSequence={};static _currentTickersTimeouts={};static _tickersToCompleteOnStepEnd={tikersIds:[],stepAlias:[]};static _tickersOnPause={};static generateTickerId(e){try{return (0,CB.default)(JSON.stringify(e)).toString()+"_"+Math.random().toString(36).substring(7)}catch(t){throw new Error(`[Pixi\u2019VN] Error to generate ticker id: ${t}`)}}static addTickerTimeoutInfo(e,t,i,s){typeof e=="string"&&(e=[e]),r._currentTickersTimeouts[i]={aliases:e,ticker:t,canBeDeletedBeforeEnd:s};}static removeTickerTimeoutInfo(e){typeof e!="string"&&(e=e.toString()),r._currentTickersTimeouts[e]&&delete r._currentTickersTimeouts[e];}static removeTickerTimeout(e){typeof e!="string"&&(e=e.toString()),clearTimeout(Number(e)),r.removeTickerTimeoutInfo(e);}static removeTickerTimeoutsByAlias(e,t){Object.entries(r._currentTickersTimeouts).forEach(([i,s])=>{let n=s.aliases.filter(o=>o!==e);if(n.length===0){let o=s.canBeDeletedBeforeEnd;(!t||o)&&r.removeTickerTimeout(i);}else r._currentTickersTimeouts[i].aliases=n;});}};pe();var rS=new Map;function iS(r){return function(e){$t(e,r);}}function $t(r,e){e||(e=r.name),rS.get(e)&&N.warn(`CanvasElement ${e} already registered`),r.prototype.pixivnId=e,rS.set(e,r);}function PB(r){try{let e=rS.get(r);if(!e){N.error(`CanvasElement ${r} not found, did you forget to register it with the canvasComponentDecorator?`);return}return new e,e}catch(e){N.error(`Error while getting CanvasElement ${r}`,e);return}}var Kx=new Map;function wB(r){return function(e){r||(r=e.name),Kx.get(r)&&N.info(`Event ${r} already exists, it will be overwritten`),e.prototype.id=r,Kx.set(r,e);}}function Zx(r){try{let e=Kx.get(r);if(!e){N.error(`Event ${r} not found, did you forget to register it with the eventDecorator?`);return}return new e,e}catch(e){N.error(`Error while getting Event ${r}`,e);return}}function zu(r){try{let e=Kx.get(r);if(!e){N.error(`Event ${r} not found, did you forget to register it with the eventDecorator?`);return}return new e}catch(e){N.error(`Error while getting Event ${r}`,e);return}}async function Qx(r){let e=xk(r.pixivnId);if(e)await e.setMemory(r);else throw new Error("[Pixi\u2019VN] The element "+r.pixivnId+" could not be created");return e}function xk(r){try{let e=PB(r);return e?new e:void 0}catch(e){N.error(`Error while getting CanvasElement ${r}`,e);return}}pe();pe();function sS(r,e){let t=r.source.label;return {url:t,alias:e===t?void 0:e}}function wh(r){if(Xe.cache.has(r)){let e=Xe.get(r);e&&e instanceof A&&(r=e.source.label);}return !!r.match(new RegExp(`(${bB.join("|")})$`))}pe();async function $r(r){if(r!=="EMPTY"){if(!r){N.error("Texture not found",r);return}if(Xe.cache.has(r)){let e=Xe.get(r);if(e)return e}return Xe.load(r).then(e=>{if(!e){N.error("Texture not found",r);return}if(!(e instanceof A)){N.error("File not is a file",r);return}return e}).catch(e=>{N.error("Error loading file",e);})}}function BB(r,e){if(!(r instanceof Object))return r;N.warn(`Text.style.${e} is a FillGradient or FillPattern, this is not supported yet.`,r);}function RB(r){return {align:r.align,breakWords:r.breakWords,dropShadow:r.dropShadow,fill:BB(r.stroke,"fill"),fontFamily:r.fontFamily,fontSize:r.fontSize,fontStyle:r.fontStyle,fontVariant:r.fontVariant,fontWeight:r.fontWeight,leading:r.leading,letterSpacing:r.letterSpacing,lineHeight:r.lineHeight,padding:r.padding,stroke:BB(r.stroke,"stroke"),textBaseline:r.textBaseline,trim:r.trim,whiteSpace:r.whiteSpace,wordWrap:r.wordWrap,wordWrapWidth:r.wordWrapWidth}}function nS(r){return "memory"in r?r.memory:r instanceof cr?oS(r):r instanceof xe?Bh(r):Ao(r)}function Ao(r,e){let t=Hu,i=e?.childrenExport||false;r.hasOwnProperty("pixivnId")&&(t=r.pixivnId);let s=[];return i&&r.children.sort((n,o)=>r.getChildIndex(n)-r.getChildIndex(o)).forEach(n=>{s.push(nS(n));}),{pixivnId:t,elements:s,width:r.width,height:r.height,isRenderGroup:r.isRenderGroup,blendMode:r.blendMode,tint:r.tint,alpha:r.alpha,angle:r.angle,renderable:r.renderable,rotation:r.rotation,scale:{x:r.scale.x,y:r.scale.y},pivot:{x:r.pivot.x,y:r.pivot.y},position:{x:r.position.x,y:r.position.y},skew:{x:r.skew.x,y:r.skew.y},visible:r.visible,x:r.x,y:r.y,boundsArea:r.boundsArea,cursor:r.cursor,eventMode:r.eventMode,interactive:r.interactive,interactiveChildren:r.interactiveChildren,hitArea:r.hitArea}}function Bh(r){let e=Ao(r),t=e.pixivnId??Vu,i={};"onEvents"in r&&(i=r.onEvents);let s;return "textureAlias"in r?s=sS(r.texture,r.textureAlias):s=sS(r.texture),{...e,pixivnId:t,textureData:s,anchor:{x:r.anchor.x,y:r.anchor.y},roundPixels:r.roundPixels,onEvents:i}}function oS(r){let e=Ao(r),t=e.pixivnId??Wu,i={};return "onEvents"in r&&(i=r.onEvents),{...e,pixivnId:t,anchor:{x:r.anchor.x,y:r.anchor.y},text:r.text,resolution:r.resolution,style:RB(r.style),roundPixels:r.roundPixels,onEvents:i}}var ws=class extends ${constructor(e){super(e),this.pixivnId=this.constructor.prototype.pixivnId||Hu;}pixivnId=Hu;get memory(){return Ao(this,{childrenExport:true})}set memory(e){}async setMemory(e){return this.memory=e,await this.importChildren(e),await qr(this,e)}async importChildren(e){for(let t=0;t<e.elements.length;t++){let i=e.elements[t],s=await Qx(i);this.addChild(s);}}_onEvents={};get onEvents(){return this._onEvents}onEvent(e,t){let i=t.prototype.id,s=zu(i);return this._onEvents[e]=i,s?super.on(e,()=>{s.fn(e,this);}):N.error(`Event ${i} not found`),this}on(e,t,i){return super.on(e,t,i)}};$t(ws,Hu);async function qr(r,e,t){let i=t?.ignoreScale||false,s=t?.end;"isRenderGroup"in e&&e.isRenderGroup!==void 0&&(r.isRenderGroup=e.isRenderGroup),"blendMode"in e&&e.blendMode!==void 0&&(r.blendMode=e.blendMode),"tint"in e&&e.tint!==void 0&&(r.tint=e.tint),"alpha"in e&&e.alpha!==void 0&&(r.alpha=e.alpha),"angle"in e&&e.angle!==void 0&&(r.angle=e.angle),"renderable"in e&&e.renderable!==void 0&&(r.renderable=e.renderable),"rotation"in e&&e.rotation!==void 0&&(r.rotation=e.rotation),!i&&"scale"in e&&e.scale!==void 0&&(typeof e.scale=="number"?r.scale.set(e.scale,e.scale):r.scale.set(e.scale.x,e.scale.y)),"pivot"in e&&e.pivot!==void 0&&(typeof e.pivot=="number"?r.pivot.set(e.pivot,e.pivot):r.pivot.set(e.pivot.x,e.pivot.y)),"position"in e&&e.position!==void 0&&r.position.set(e.position.x,e.position.y),"skew"in e&&e.skew!==void 0&&r.skew.set(e.skew.x,e.skew.y),"visible"in e&&e.visible!==void 0&&(r.visible=e.visible),"x"in e&&e.x!==void 0&&(r.x=e.x),"y"in e&&e.y!==void 0&&(r.y=e.y),"boundsArea"in e&&e.boundsArea!==void 0&&(r.boundsArea=e.boundsArea),"cursor"in e&&e.cursor!==void 0&&(r.cursor=e.cursor),"eventMode"in e&&e.eventMode!==void 0&&(r.eventMode=e.eventMode),"interactive"in e&&e.interactive!==void 0&&(r.interactive=e.interactive),"interactiveChildren"in e&&e.interactiveChildren!==void 0&&(r.interactiveChildren=e.interactiveChildren),"hitArea"in e&&e.hitArea!==void 0&&(r.hitArea=e.hitArea),s&&await s(),i||("width"in e&&e.width!==void 0&&(r.width=e.width),"height"in e&&e.height!==void 0&&(r.height=e.height));}pe();function bi(r,e,t,i,s,n=0){return i=i*(s?-1:1),r==="width"?e*(C.screen.width-t)+i+n*t+(s?t:0):e*(C.screen.height-t)+i+n*t+(s?t:0)}function jr(r,e,t,i,s,n=0){return i=i*(s?-1:1),r==="width"?(e-i-n*t-(s?t:0))/(C.screen.width-t):(e-i-n*t-(s?t:0))/(C.screen.height-t)}function yi(r,e){return r==="width"?e*C.screen.width:e*C.screen.height}function Kr(r,e){return r==="width"?e/C.screen.width:e/C.screen.height}function $e(r,e){if(e=e%360,e<0&&(e+=360),e===0)return {x:r.x,y:r.y};if(e===90)return {x:-r.y,y:r.x};if(e===180)return {x:-r.x,y:-r.y};if(e===270)return {x:r.y,y:-r.x};if(e>0&&e<90){let t=e*Math.PI/180,i=Math.cos(t),s=Math.sin(t);return {x:r.x*i-r.y*s,y:r.x*s+r.y*i}}else if(e>90&&e<180){let t=(e-90)*Math.PI/180,i=Math.cos(t),s=Math.sin(t);return {x:-r.y*s-r.x*i,y:r.y*i-r.x*s}}else if(e>180&&e<270){let t=(e-180)*Math.PI/180,i=Math.cos(t),s=Math.sin(t);return {x:-r.x*i+r.y*s,y:-r.x*s-r.y*i}}else if(e>270&&e<360){let t=(e-270)*Math.PI/180,i=Math.cos(t),s=Math.sin(t);return {x:r.y*s-r.x*i,y:-r.y*i-r.x*s}}return {x:0,y:0}}function aS(r,e){if(e=e%360,e<0&&(e+=360),e===0)return {x:r.x,y:r.y};if(e===90)return {x:r.y,y:-r.x};if(e===180)return {x:-r.x,y:-r.y};if(e===270)return {x:-r.y,y:r.x};if(e>0&&e<90){let t=e*Math.PI/180,i=Math.cos(t),s=Math.sin(t);return {x:r.x*i+r.y*s,y:-r.x*s+r.y*i}}else if(e>90&&e<180){let t=(e-90)*Math.PI/180,i=Math.cos(t),s=Math.sin(t);return {x:r.y*i-r.x*s,y:-r.y*s-r.x*i}}else if(e>180&&e<270){let t=(e-180)*Math.PI/180,i=Math.cos(t),s=Math.sin(t);return {x:-r.x*i-r.y*s,y:r.x*s-r.y*i}}else if(e>270&&e<360){let t=(e-270)*Math.PI/180,i=Math.cos(t),s=Math.sin(t);return {x:-r.y*i+r.x*s,y:r.y*s+r.x*i}}return {x:0,y:0}}function Zr(r){let e=r.width,t=r.height,i=r.angle%360;return i<0&&(i+=360),i===0||i===180?e:i===90||i===270?t:Math.abs(e*Math.cos(i*Math.PI/180))+Math.abs(t*Math.sin(i*Math.PI/180))}function Qr(r){let e=r.width,t=r.height,i=r.angle%360;return i<0&&(i+=360),i===0||i===180?t:i===90||i===270?e:Math.abs(t*Math.cos(i*Math.PI/180))+Math.abs(e*Math.sin(i*Math.PI/180))}pe();function Co(r){return r&&(typeof r.align!="number"&&(r.xAlign!=null&&(r.align===void 0?(r.align={x:r.xAlign},delete r.xAlign):(r.align.x=r.xAlign,delete r.xAlign)),r.yAlign!=null&&(r.align===void 0?(r.align={y:r.yAlign},delete r.yAlign):(r.align.y=r.yAlign,delete r.yAlign))),typeof r.percentagePosition!="number"&&(r.xPercentagePosition!=null&&(r.percentagePosition===void 0?(r.percentagePosition={x:r.xPercentagePosition},delete r.xPercentagePosition):(r.percentagePosition.x=r.xPercentagePosition,delete r.xPercentagePosition)),r.yPercentagePosition!=null&&(r.percentagePosition===void 0?(r.percentagePosition={y:r.yPercentagePosition},delete r.yPercentagePosition):(r.percentagePosition.y=r.yPercentagePosition,delete r.yPercentagePosition))),r)}pe();pe();var Jr=class r extends xe{constructor(e){super(e),this.pixivnId=this.constructor.prototype.pixivnId||Vu;}pixivnId=Vu;_textureAlias;get textureAlias(){return this._textureAlias?this._textureAlias:this.texture.source.label}set textureAlias(e){this._textureAlias=e;}get memory(){return Bh(this)}set memory(e){}async setMemory(e){return this.memory=e,await Rh(this,e)}_onEvents={};get onEvents(){return this._onEvents}onEvent(e,t){let i=t.prototype.id,s=zu(i);return this._onEvents[e]=i,s?(super.on(e,()=>{s.fn(e,this);}),this.interactive||(this.interactive=true,this.eventMode="dynamic")):N.error(`Event ${i} not found`),this}on(e,t,i){return super.on(e,t,i)}static from(e,t){let i=xe.from(e,t),s=new r;return s.texture=i.texture,s}};$t(Jr,Vu);async function Rh(r,e,t){let i=t?.ignoreTexture||false;if(await qr(r,e),!i){if("textureImage"in e&&e.textureImage&&e.textureImage.image){let n=await $r(e.textureImage.image);n&&(r.texture=n);}if("textureData"in e&&(e.textureData.alias&&(r.textureAlias=e.textureData.alias),e.textureData.url!=="EMPTY")){let n=e.textureData.url;e.textureData.alias&&Xe.resolver.hasKey(e.textureData.alias)&&(n=e.textureData.alias);let o=await $r(n);o&&(r.texture=o);}}let s=t?.half;if(s&&await s(),"anchor"in e&&e.anchor!==void 0&&(typeof e.anchor=="number"?r.anchor.set(e.anchor,e.anchor):r.anchor.set(e.anchor.x,e.anchor.y)),"roundPixels"in e&&e.roundPixels!==void 0&&(r.roundPixels=e.roundPixels),"onEvents"in e)for(let n in e.onEvents){let o=e.onEvents[n],a=Zx(o);a&&r.onEvent(n,a);}}var _e=class r extends Jr{pixivnId=eS;constructor(e,t){e=Co(e);let i,s;e&&"align"in e&&e?.align!==void 0&&(i=e.align,delete e.align),e&&"percentagePosition"in e&&e?.percentagePosition!==void 0&&(s=e.percentagePosition,delete e.percentagePosition),super(e),t&&(this.textureAlias=t),i&&(this.align=i),s&&(this.percentagePosition=s);}get memory(){return {...Bh(this),pixivnId:this.pixivnId,align:this._align,percentagePosition:this._percentagePosition,loadIsStarted:this._loadIsStarted}}set memory(e){}async setMemory(e){this.memory=e,await Mh(this,e),this.reloadPosition();}static from(e,t){let i=xe.from(e,t),s=new r;return s.texture=i.texture,s}_loadIsStarted=false;get loadIsStarted(){return this._loadIsStarted}async load(){return this._loadIsStarted=true,$r(this.textureAlias).then(e=>{this._loadIsStarted=false,e&&(this.texture=e);}).catch(e=>{this._loadIsStarted=false,N.error("Error into ImageSprite.load()",e);})}set texture(e){super.texture=e,this.reloadPosition();}get texture(){return super.texture}get haveEmptyTexture(){return this.texture._source.label==="EMPTY"}_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=$e(this.pivot,this.angle),t=$e(this.scale,this.angle);return {x:jr("width",this.x,Zr(this),e.x,t.x<0,this.anchor.x),y:jr("height",this.y,Qr(this),e.y,t.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=$e(this.pivot,this.angle),t=$e(this.scale,this.angle);return jr("width",this.x,Zr(this),e.x,t.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=$e(this.pivot,this.angle),t=$e(this.scale,this.angle);return jr("height",this.y,Qr(this),e.y,t.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:Kr("width",this.x),y:Kr("height",this.y)}}get xPercentagePosition(){return Kr("width",this.x)}set xPercentagePosition(e){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.x=e,this.reloadPosition();}get yPercentagePosition(){return Kr("height",this.y)}set yPercentagePosition(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(){return this._align?{x:this._align.x||0,y:this._align.y||0,type:"align"}:this._percentagePosition?{x:this._percentagePosition.x||0,y:this._percentagePosition.y||0,type:"percentage"}:{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=$e(this.pivot,this.angle),t=$e(this.scale,this.angle);this._align.x!==void 0&&(super.x=bi("width",this._align.x,Zr(this),e.x,t.x<0,this.anchor.x)),this._align.y!==void 0&&(super.y=bi("height",this._align.y,Qr(this),e.y,t.y<0,this.anchor.y));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=yi("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=yi("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;}};$t(_e,eS);async function Mh(r,e,t){let i=t?.ignoreTexture||false;return e=Co(e),await Rh(r,e,{half:async()=>{"align"in e&&e.align!==void 0&&(r.align=e.align),"percentagePosition"in e&&e.percentagePosition!==void 0&&(r.percentagePosition=e.percentagePosition),i||"imageLink"in e&&e.imageLink!==void 0&&(r.textureAlias=e.imageLink),"loadIsStarted"in e&&e.loadIsStarted&&await r.load();},ignoreTexture:t?.ignoreTexture})}pe();var Et=class r extends _e{constructor(e,t){let i,s,n;e&&"loop"in e&&e?.loop!==void 0&&(i=e.loop,delete e.loop),e&&"paused"in e&&e?.paused!==void 0&&(s=e.paused,delete e.paused),e&&"currentTime"in e&&e?.currentTime!==void 0&&(n=e.currentTime,delete e.currentTime),super(e,t),i&&(this.loop=i),s&&(this.paused=s),n&&(this.currentTime=n);}pixivnId=tS;get memory(){return {...super.memory,pixivnId:this.pixivnId,loop:this.loop,paused:this._paused,currentTime:this.currentTime}}set memory(e){}async setMemory(e){return this.memory=e,await uS(this,e)}static from(e,t){let i=xe.from(e,t),s=new r;return s.texture=i.texture,s}async load(){await super.load(),this.loop=this._looop,this.currentTime=this._currentTime,this.paused=this._paused;}_looop=false;get loop(){return this.texture?.source?.resource?.loop||false}set loop(e){this._looop=e,this.texture?.source?.resource&&(this.texture.source.resource.loop=e);}_paused=false;get paused(){return this.texture?.source?.resource?.paused||false}set paused(e){e?this.pause():this.play();}pause(){this._paused=true,this.texture?.source?.resource&&this.texture.source.resource.pause();}play(){this._paused=false,this.texture?.source?.resource&&this.texture.source.resource.play();}_currentTime=0;get currentTime(){return this.texture?.source?.resource?.currentTime||0}set currentTime(e){let t=this.duration;t&&e>=t&&(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}};$t(Et,tS);async function uS(r,e,t){await Mh(r,e,{ignoreTexture:t?.ignoreTexture}),"loop"in e&&e.loop!==void 0&&(r.loop=e.loop),"currentTime"in e&&e.currentTime!==void 0&&(r.currentTime=e.currentTime),"paused"in e&&e.paused!==void 0&&(r.paused=e.paused);}var De=class extends ws{constructor(e,t=[]){e=Co(e);let i,s,n;e&&"anchor"in e&&e?.anchor!==void 0&&(n=e.anchor,delete e.anchor),e&&"align"in e&&e?.align!==void 0&&(i=e.align,delete e.align),e&&"percentagePosition"in e&&e?.percentagePosition!==void 0&&(s=e.percentagePosition,delete e.percentagePosition),super(e),e=Co(e),t&&t.forEach(o=>{let a;wh(o)?a=new Et(void 0,o):a=new _e(void 0,o),this.addChild(a);}),n&&(this.anchor=n),i&&(this.align=i),s&&(this.percentagePosition=s);}get memory(){return {...super.memory,pixivnId:$x,anchor:this._anchor,align:this._align,percentagePosition:this._percentagePosition,loadIsStarted:this._loadIsStarted}}set memory(e){}async setMemory(e){this.memory=e,await this.importChildren(e),await lS(this,e),this.reloadAnchor(),this.reloadPosition();}pixivnId=$x;_loadIsStarted=false;get loadIsStarted(){return this._loadIsStarted}async load(){this._loadIsStarted=true;let e=Array(this.children.length);for(let t=0;t<this.children.length;t++)e[t]=this.children[t].load();return Promise.all(e).then(()=>{this._loadIsStarted=false,this.reloadAnchor(),this.reloadPosition();}).catch(t=>{this._loadIsStarted=false,N.error("Error into ImageContainer.load()",t);})}get texture(){return this.children.length>0?this.children[0].texture:new A}get haveEmptyTexture(){return this.children.some(e=>e.texture._source.label==="EMPTY")}_anchor;get anchor(){let e=super.pivot.x/this.width,t=super.pivot.y/this.height;return {x:e,y:t}}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=$e(this.pivot,this.angle),t=$e(this.scale,this.angle);return {x:jr("width",this.x,Zr(this),e.x,t.x<0,this.anchor.x),y:jr("height",this.y,Qr(this),e.y,t.y<0,this.anchor.y)}}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=$e(this.pivot,this.angle),t=$e(this.scale,this.angle);return jr("width",this.x,Zr(this),e.x,t.x<0,this.anchor.x)}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=$e(this.pivot,this.angle),t=$e(this.scale,this.angle);return jr("height",this.y,Qr(this),e.y,t.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:Kr("width",this.x),y:Kr("height",this.y)}}set xPercentagePosition(e){this._align&&(this._align=void 0),this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.x=e,this.reloadPosition();}get xPercentagePosition(){return Kr("width",this.x)}set yPercentagePosition(e){this._align&&(this._align=void 0),this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.y=e,this.reloadPosition();}get yPercentagePosition(){return Kr("height",this.y)}get positionType(){return this._align?"align":this._percentagePosition?"percentage":"pixel"}get positionInfo(){return this._align?{x:this._align.x||0,y:this._align.y||0,type:"align"}:this._percentagePosition?{x:this._percentagePosition.x||0,y:this._percentagePosition.y||0,type:"percentage"}:{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=$e(this.pivot,this.angle),t=$e(this.scale,this.angle);this._align.x!==void 0&&(super.x=bi("width",this._align.x,Zr(this),e.x,t.x<0)),this._align.y!==void 0&&(super.y=bi("height",this._align.y,Qr(this),e.y,t.y<0));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=yi("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=yi("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;}};$t(De,$x);async function lS(r,e,t){e=Co(e),qr(r,e,{...t,end:async()=>{"anchor"in e&&e.anchor!==void 0&&(r.anchor=e.anchor),"align"in e&&e.align!==void 0&&(r.align=e.align),"percentagePosition"in e&&e.percentagePosition!==void 0&&(r.percentagePosition=e.percentagePosition),"loadIsStarted"in e&&e.loadIsStarted&&await r.load();}});}pe();var Bs=class extends cr{constructor(e){super(e),this.pixivnId=this.constructor.prototype.pixivnId||Wu;}pixivnId=Wu;get memory(){return oS(this)}set memory(e){}async setMemory(e){return this.memory=e,await cS(this,e)}_onEvents={};get onEvents(){return this._onEvents}onEvent(e,t){let i=t.prototype.id,s=zu(i);return this._onEvents[e]=i,s?(super.on(e,()=>{s.fn(e,this);}),this.interactive||(this.interactive=true,this.eventMode="dynamic")):N.error(`Event ${i} not found`),this}on(e,t,i){return super.on(e,t,i)}};$t(Bs,Wu);async function cS(r,e){if(await qr(r,e),"anchor"in e&&e.anchor!==void 0&&(typeof e.anchor=="number"?r.anchor.set(e.anchor,e.anchor):r.anchor.set(e.anchor.x,e.anchor.y)),"text"in e&&e.text!==void 0&&(r.text=e.text),"resolution"in e&&e.resolution!==void 0&&(r.resolution=e.resolution),"style"in e&&e.style!==void 0&&(r.style=e.style),"roundPixels"in e&&e.roundPixels!==void 0&&(r.roundPixels=e.roundPixels),"onEvents"in e)for(let t in e.onEvents){let i=e.onEvents[t],s=Zx(i);s&&r.onEvent(t,s);}}var Nt=class{constructor(e,t,i){this.args=e,this.duration=t,this.priority=i,this.id=this.constructor.prototype.id;}id="ticker_id_not_set";args;duration;priority;fn(e,t,i,s){throw new Error("[Pixi\u2019VN] The method TickerBase.fn() must be overridden")}onEndOfTicker(e,t,i){let s="aliasToRemoveAfter"in i&&i.aliasToRemoveAfter||[];typeof s=="string"&&(s=[s]);let n="tickerAliasToResume"in i&&i.tickerAliasToResume||[];typeof n=="string"&&(n=[n]),C.onEndOfTicker(t,{aliasToRemoveAfter:s,tickerAliasToResume:n});}};var hS=new Map;function MB(r){return function(e){vi(e,r);}}function vi(r,e){e||(e=r.name),hS.get(e)&&N.info(`Ticker ${e} already exists, it will be overwritten`),r.prototype.id=e,hS.set(e,r);}function Dh(r,e,t,i){try{let s=hS.get(r);if(!s){N.error(`Ticker ${r} not found, did you forget to register it with the tickerDecorator?`);return}return new s(e,t,i)}catch(s){N.error(`Error while getting Ticker ${r}`,s);return}}var Xu="aliasToRemoveAfter";var Ih=class{get app(){return P.app}get gameLayer(){return P.gameLayer}get isInitialized(){return P._isInitialized}get htmlLayout(){return P.htmlLayout}set htmlLayout(e){P.htmlLayout=e;}get canvasWidth(){return P.canvasWidth}get canvasHeight(){return P.canvasHeight}set canvasWidth(e){P.canvasWidth=e;}set canvasHeight(e){P.canvasHeight=e;}get screen(){return this.app.screen}async init(e,t,i,s,n){if(typeof t=="number"&&typeof i=="number")return await P.init(e,t,i,s,n);if(typeof t!="number"&&typeof i!="number")return await P.init(e,t.width,t.height,t,i);throw new Error("Invalid parameters")}initializeHTMLLayout(e){return P.initializeHTMLLayout(e)}get children(){return P.gameLayer.children}async copyCanvasElementProperty(e,t){if(typeof t=="string"){let i=this.find(t);if(i)t=i;else {N.error(`Canvas element ${t} not found`);return}}if(typeof e=="string"){let i=this.find(e);if(i)e=i;else {N.error(`Canvas element ${e} not found`);return}}e instanceof $&&(e=e.memory),"isRenderGroup"in e&&delete e.isRenderGroup,"scale"in e&&delete e.scale,"visible"in e&&delete e.visible,"boundsArea"in e&&delete e.boundsArea,"text"in e&&delete e.text,"resolution"in e&&delete e.resolution,"style"in e&&delete e.style,"height"in e&&delete e.height,"width"in e&&delete e.width,t instanceof Et?await uS(t,e,{ignoreTexture:true}):t instanceof _e?await Mh(t,e,{ignoreTexture:true}):t instanceof Jr?await Rh(t,e,{ignoreTexture:true}):t instanceof Bs?await cS(t,e):t instanceof De?await lS(t,e):t instanceof $&&await qr(t,e);}transferTickers(e,t,i="move"){P._currentTickersSequence[e]&&(i==="move"?P._currentTickersSequence[t]=St(P._currentTickersSequence[e]):i==="duplicate"&&(P._currentTickersSequence[t]=St(P._currentTickersSequence[e]))),Object.entries(P._currentTickers).forEach(([s,n])=>{if(n.createdByTicketSteps?.canvasElementAlias===e&&this.removeTicker(s),n.canvasElementAliases.includes(e)&&(i==="move"?n.canvasElementAliases=n.canvasElementAliases.map(o=>o===e?t:o):i==="duplicate"&&n.canvasElementAliases.find(o=>o===e)&&n.canvasElementAliases.push(t),n.args.hasOwnProperty(Xu))){let o=n.args.aliasToRemoveAfter;typeof o=="string"&&(o=[o]),Array.isArray(o)&&(i==="move"?n.args.aliasToRemoveAfter=o.map(a=>a===e?t:a):i==="duplicate"&&o.find(a=>a===e)&&(n.args.aliasToRemoveAfter=[...o,t]));}}),Object.values(P._currentTickersTimeouts).forEach(s=>{s.aliases.includes(e)&&(i==="move"?s.aliases=s.aliases.map(n=>n===e?t:n):i==="duplicate"&&s.aliases.find(n=>n===e)&&s.aliases.push(t));}),P._currentTickersSequence[t]&&Object.keys(P._currentTickersSequence[t]).forEach(s=>{this.runTickersSequence(t,s);}),i==="duplicate"&&P._currentTickersSequence[e]&&Object.keys(P._currentTickersSequence[e]).forEach(s=>{this.runTickersSequence(e,s);});}add(e,t,i={}){if(e===Rr){N.error(`The alias ${Rr} is reserved`);return}let s=this.find(e),n=i?.ignoreOldStyle;s&&!n&&this.copyCanvasElementProperty(s,t);let o=i.zIndex;s&&!this.gameLayer.children.includes(s)?N.error(`The canvas element ${e} exist in the memory but it is not on the canvas, so the zIndex is not set`):s&&(o===void 0&&(o=this.gameLayer.getChildIndex(s)),this.remove(e,{ignoreTickers:true})),o!==void 0?(t.label=e,this.gameLayer.addChildAt(t,o)):(t.label=e,this.gameLayer.addChild(t));}addCanvasElement(e,t){this.add(e,t);}remove(e,t={}){if(e===Rr){N.error(`The alias ${Rr} is reserved`);return}let i=t.ignoreTickers;typeof e=="string"&&(e=[e]),e.forEach(s=>{this.gameLayer.getChildrenByLabel(s).forEach(n=>{this.gameLayer.removeChild(n),!i&&this.unlinkComponentFromTicker(s);});});}removeCanvasElement(e){this.remove(e);}find(e){if(e===Rr)return this.gameLayer;let t=this.gameLayer.getChildByLabel(e);if(t)return t}getCanvasElement(e){return this.find(e)}canvasElementIsOnCanvas(e){return this.gameLayer.children.includes(e)}removeAll(){this.gameLayer.removeChildren(),this.removeAllTickers();}editAlias(e,t,i={}){let s=this.find(e);s&&(s.label=t),!i.ignoreTickers&&this.transferTickers(e,t,"move");}get currentTickers(){return P._currentTickers}get currentTickersSteps(){return P._currentTickersSequence}addTicker(e,t){let i=t.id;if(typeof e=="string"&&(e=[e]),!Dh(i,t.args,t.duration,t.priority)){N.error(`Ticker ${i} not found`);return}let s={fn:()=>{},id:i,args:St(t.args),canvasElementAliases:e,priority:t.priority,duration:t.duration,onEndOfTicker:()=>{}},n=P.generateTickerId(s);if(this.pushTicker(n,s,t),this.pushEndOfTicker(n,s,t),t.duration){let o=setTimeout(()=>{P.removeTickerTimeoutInfo(o),P._currentTickersTimeouts[o.toString()]&&this.onEndOfTicker(n,{aliasToRemoveAfter:Xu in t.args?t.args.aliasToRemoveAfter||[]:[],tickerAliasToResume:"tickerAliasToResume"in t.args?t.args.tickerAliasToResume||[]:[],ignoreTickerSteps:true});},t.duration*1e3);P.addTickerTimeoutInfo(e,i,o.toString(),true);}return n}pushTicker(e,t,i){P._currentTickers[e]=t,t.fn=s=>{let n=P._currentTickers[e];if(n){let o=n.canvasElementAliases;if(t.createdByTicketSteps){if(this.isTickerPaused(t.createdByTicketSteps.canvasElementAlias,t.createdByTicketSteps.id))return}else o=o.filter(a=>!this.isTickerPaused(a,e));i?.fn(s,n.args,o,e);}},this.app.ticker.add(t.fn,void 0,t.priority);}pushEndOfTicker(e,t,i){t.onEndOfTicker=()=>{i.onEndOfTicker(t.canvasElementAliases,e,t.args);};}addTickersSteps(e,t,i=0){return this.addTickersSequence(e,t,i)}addTickersSequence(e,t,i=0){if(t.length==0){N.warn("The steps of the tickers is empty");return}e in P._currentTickersSequence||(P._currentTickersSequence[e]={});let s={currentStepNumber:i,steps:t.map(o=>o===Ph||o.hasOwnProperty("type")&&o.type==="pause"?o:{ticker:o.id,args:St(o.args),duration:o.duration})},n=P.generateTickerId(s);return P._currentTickersSequence[e][n]=s,this.runTickersSequence(e,n),n}runTickersSequence(e,t){if(!P._currentTickersSequence[e]||!P._currentTickersSequence[e][t])return;let i=P._currentTickersSequence[e][t].steps[P._currentTickersSequence[e][t].currentStepNumber];if(i===Ph&&(i=P._currentTickersSequence[e][t].steps[0],P._currentTickersSequence[e][t].currentStepNumber=0,i===Ph)){N.error("TikersSteps has a RepeatType in the first step");return}if(i.hasOwnProperty("type")&&i.type==="pause"){let u=setTimeout(()=>{let l=P._currentTickersTimeouts[u.toString()];l&&l.aliases.forEach(c=>{this.nextTickerStep(c,t);}),P.removeTickerTimeoutInfo(u);},i.duration*1e3);P.addTickerTimeoutInfo(e,"steps",u.toString(),false);return}let s=Dh(i.ticker,i.args,i.duration,i.priority);if(!s){N.error(`Ticker ${i.ticker} not found`);return}let n=s.id,o={fn:()=>{},id:n,args:St(s.args),canvasElementAliases:[e],priority:s.priority,duration:s.duration,createdByTicketSteps:{canvasElementAlias:e,id:t},onEndOfTicker:()=>{}},a=P.generateTickerId(o);if(this.pushTicker(a,o,s),s.duration){let u=setTimeout(()=>{let l=P._currentTickersTimeouts[u.toString()];l&&(this.onEndOfTicker(a,{aliasToRemoveAfter:Xu in s.args?s.args.aliasToRemoveAfter||[]:[],tickerAliasToResume:"tickerAliasToResume"in s.args?s.args.tickerAliasToResume||[]:[],ignoreTickerSteps:true}),l.aliases.forEach(c=>{this.nextTickerStep(c,t);})),P.removeTickerTimeoutInfo(u);},s.duration*1e3);P.addTickerTimeoutInfo(e,n,u.toString(),false);}}nextTickerStep(e,t){if(P._currentTickersSequence[e]&&P._currentTickersSequence[e][t]){let i=P._currentTickersSequence[e][t];i.currentStepNumber+1<i.steps.length?(i.currentStepNumber++,P._currentTickersSequence[e][t]=i,this.runTickersSequence(e,t)):t&&P._currentTickersSequence[e]&&P._currentTickersSequence[e][t]&&(delete P._currentTickersSequence[e][t],Object.entries(P._currentTickers).forEach(([s,n])=>{n.createdByTicketSteps?.canvasElementAlias===e&&n.createdByTicketSteps.id===t&&this.removeTicker(s);}));}}onEndOfTicker(e,t){let i=P._currentTickers[e],s=t.ignoreTickerSteps||false;this.remove(t.aliasToRemoveAfter),this.resumeTicker(t.tickerAliasToResume),i&&(this.removeTicker(e),!s&&i.duration==null&&i.createdByTicketSteps&&this.nextTickerStep(i.createdByTicketSteps.canvasElementAlias,i.createdByTicketSteps.id));}unlinkComponentFromTicker(e,t){if(typeof e=="string"&&(e=[e]),!t){e.forEach(s=>{Object.entries(P._currentTickers).forEach(([n,o])=>{o.canvasElementAliases.includes(s)&&(o.canvasElementAliases.length===1?this.removeTicker(n):o.canvasElementAliases=o.canvasElementAliases.filter(a=>a!==s));}),P._currentTickersSequence[s]&&delete P._currentTickersSequence[s],P.removeTickerTimeoutsByAlias(s,false);});return}let i;typeof t=="string"?i=t:t instanceof Nt?i=t.id:i=t.prototype.id,e.forEach(s=>{P._currentTickersSequence[s]&&Object.entries(P._currentTickersSequence[s]).forEach(([n,o])=>{o.steps.find(a=>typeof a=="object"&&"ticker"in a&&a.ticker===i)&&delete P._currentTickersSequence[s][n];});}),Object.entries(P._currentTickers).forEach(([s,n])=>{n.id===i&&(P._currentTickers[s].canvasElementAliases=n.canvasElementAliases.filter(o=>!e.includes(o)));}),Object.entries(P._currentTickersTimeouts).forEach(([s,n])=>{n.ticker===i&&n.canBeDeletedBeforeEnd&&(P._currentTickersTimeouts[s].aliases=n.aliases.filter(o=>!e.includes(o)));}),this.removeTickersWithoutAssociatedCanvasElement();}removeTickersWithoutAssociatedCanvasElement(){Object.entries(P._currentTickers).forEach(([e,t])=>{t.canvasElementAliases=t.canvasElementAliases.filter(i=>this.find(i)),t.canvasElementAliases.length===0&&this.onEndOfTicker(e,{aliasToRemoveAfter:Xu in t.args?t.args.aliasToRemoveAfter:[],tickerAliasToResume:"tickerAliasToResume"in t.args?t.args.tickerAliasToResume:[],ignoreTickerSteps:true});}),Object.entries(P._currentTickersSequence).forEach(([e,t])=>{t===void 0&&delete P._currentTickersSequence[e];}),Object.entries(P._currentTickersTimeouts).forEach(([e,{aliases:t}])=>{t.length===0&&P.removeTickerTimeout(e);});}removeAllTickers(){P._currentTickersSequence={},Object.keys(P._currentTickers).forEach(e=>{this.removeTicker(e);}),P._currentTickers={};for(let e in P._currentTickersTimeouts)P.removeTickerTimeout(e);P._tickersToCompleteOnStepEnd={tikersIds:[],stepAlias:[]},P._tickersOnPause={};}removeTicker(e){typeof e=="string"&&(e=[e]),e.forEach(t=>{let i=P._currentTickers[t];if(i){if(i.args.hasOwnProperty(Xu)){let s=i.args.aliasToRemoveAfter;this.remove(s);}this.app.ticker.remove(i.fn),delete P._currentTickers[t];}});}putOnPauseTicker(e,t={}){this.pauseTicker(e,t);}pauseTicker(e,t={}){let i=P._tickersOnPause[e];if(!i){P._tickersOnPause[e]=t;return}t.tickerIdsExcluded&&(i.tickerIdsExcluded?P._tickersOnPause[e].tickerIdsExcluded=[...i.tickerIdsExcluded,...t.tickerIdsExcluded]:P._tickersOnPause[e].tickerIdsExcluded=t.tickerIdsExcluded),t.tickerIdsIncluded&&(i.tickerIdsIncluded?P._tickersOnPause[e].tickerIdsIncluded=[...i.tickerIdsIncluded,...t.tickerIdsIncluded]:P._tickersOnPause[e].tickerIdsIncluded=t.tickerIdsIncluded);}resumeTickerPaused(e){this.resumeTicker(e);}resumeTicker(e){typeof e=="string"&&(e=[e]),e.forEach(t=>{delete P._tickersOnPause[t];});}isTickerPaused(e,t){let i=P._tickersOnPause[e];if(i){if(t){if("tickerIdsIncluded"in i&&i.tickerIdsIncluded)return i.tickerIdsIncluded.includes(t);if("tickerIdsExcluded"in i&&i.tickerIdsExcluded)return !i.tickerIdsExcluded.includes(t)}return true}return false}completeTickerOnStepEnd(e){e.alias?P._tickersToCompleteOnStepEnd.stepAlias.push({id:e.id,alias:e.alias}):P._tickersToCompleteOnStepEnd.tikersIds.push({id:e.id});}forceCompletionOfTicker(e,t){if(t){let i=P._currentTickersSequence[t];i&&i[e]&&(i[e].steps.includes(Ph)?N.error(`The ticker alias: ${t} id: ${e} contains a RepeatType, so it can't be forced to complete`,i[e]):i[e].steps.forEach(s=>{if(typeof s=="object"&&"ticker"in s){let n=Dh(s.ticker,s.args,s.duration,s.priority);n&&n.onEndOfTicker([t],e,s.args);}}));}else {let i=P._currentTickers[e];i&&i.onEndOfTicker();}}addLayer(e,t){if(e===Rr){N.error(`The alias ${Rr} is reserved`);return}return t.label=e,P.app.stage.addChild(t)}getLayer(e){return P.app.stage.getChildByLabel(e)}removeLayer(e){P.app.stage.getChildrenByLabel(e);}async extractImage(){return (await this.app.renderer.extract.image(this.gameLayer)).src}clear(){this.removeAll();}export(){let e={};return this.children.forEach(t=>{t.label&&(e[t.label]=nS(t));}),{tickers:St(P.currentTickersWithoutCreatedBySteps),tickersSteps:St(P._currentTickersSequence),elements:St(e),stage:St(Ao(this.gameLayer)),elementAliasesOrder:St(P.childrenAliasesOrder),tickersOnPause:St(P._tickersOnPause),tickersToCompleteOnStepEnd:St(P._tickersToCompleteOnStepEnd)}}async restore(e){try{let t={};if(e.hasOwnProperty("elementAliasesOrder")&&e.hasOwnProperty("elements")){let i=e.elements,s=e.elementAliasesOrder,n=s.filter(a=>i[a]).map(a=>Qx(i[a])),o=await Promise.all(n);this.clear(),o.forEach((a,u)=>{let l=s[u];this.add(l,a),P.childrenAliasesOrder.push(l);});}else {N.error("The data does not have the properties elementAliasesOrder and elements");return}if(e.hasOwnProperty("stage")&&e.hasOwnProperty("stage")?qr(this.gameLayer,e.stage,{ignoreScale:!0}):N.error("The data does not have the properties stage"),e.hasOwnProperty("tickers")){let i=e.tickers;Object.entries(i).forEach(([s,n])=>{let o=n.canvasElementAliases,a=Dh(n.id,n.args,n.duration,n.priority);if(a){let u=this.addTicker(o,a);u&&(t[s]=u);}else N.error(`Ticker ${n.id} not found`);});}if(e.hasOwnProperty("tickersSteps")){let i=e.tickersSteps;Object.entries(i).forEach(([s,n])=>{P._currentTickersSequence[s]=n,Object.keys(n).forEach(o=>{this.runTickersSequence(s,o);});});}if(e.hasOwnProperty("tickersOnPause")){let i=e.tickersOnPause;Object.keys(i).forEach(s=>{let n=i[s];"tickerIdsExcluded"in n&&n.tickerIdsExcluded&&(i[s].tickerIdsExcluded=n.tickerIdsExcluded.map(o=>t[o]||o)),"tickerIdsIncluded"in n&&n.tickerIdsIncluded&&(i[s].tickerIdsIncluded=n.tickerIdsIncluded.map(o=>t[o]||o));}),P._tickersOnPause=i;}if(e.hasOwnProperty("tickersToCompleteOnStepEnd")){let i=e.tickersToCompleteOnStepEnd,s=i.tikersIds.map(o=>({id:t[o.id]||o.id})),n=i.stepAlias.map(o=>({id:o.id,alias:o.alias}));P._tickersToCompleteOnStepEnd={tikersIds:s,stepAlias:n};}}catch(t){N.error("Error importing data",t);}}};var Jx=class{constructor(){this.id=this.constructor.prototype.id;}fn(e,t){throw new Error("[Pixi\u2019VN] The method CanvasEvent.fn() must be overridden")}id="event_id_not_set"};pe();var kh=class extends ${get memory(){throw new Error("[Pixi\u2019VN] The method CanvasBaseItem.memory must be overridden")}set memory(e){throw new Error("[Pixi\u2019VN] The method CanvasBaseItems.memory must be overridden")}setMemory(e){throw new Error("[Pixi\u2019VN] The method CanvasBaseItems.memory must be overridden")}pixivnId="canvas_element_id_not_set"};pe();pe();function Rs(r){return (r instanceof _e||r instanceof De)&&r.haveEmptyTexture?false:!(r instanceof xe&&r.texture?.label=="EMPTY")}function Ms(r,e,t){let{limit:i}=t;r[e]===void 0||!t||r[e]===i||(typeof r[e]=="number"?t.type==="linear"?r[e]=dS(r[e],t):t.type==="exponential"&&(r[e]=fS(r[e],t)):r[e]!==void 0&&typeof r[e]=="object"&&r[e].haveOwnProperty("x")&&r[e].haveOwnProperty("y")&&typeof r[e].x=="number"&&typeof r[e].y=="number"&&(t.type==="linear"?(r[e].x=dS(r[e].x,t),r[e].y=dS(r[e].y,t)):t.type==="exponential"&&(r[e].x=fS(r[e].x,t),r[e].y=fS(r[e].y,t))));}function dS(r,e){let{limit:t,amt:i}=e;if(t!==void 0){if(r>t&&i>0)return t;if(r<t&&i<0)return t}return r+i}function fS(r,e){let{limit:t}=e;if(t!==void 0){if(r>t&&e.percentage>0)return t;if(r<t&&e.percentage<0)return t}return r+r*e.percentage}var _k=5,Ti=class extends Nt{constructor(e={},t,i){super(e,t,i);}fn(e,t,i,s){t.speed===void 0&&(t.duration===void 0?t.speed=_k:t.speed=600/(t.duration*60));let{type:n="hide",startOnlyIfHaveTexture:o,speedProgression:a}=t,u=this.speedConvert(t.speed),l=this.getLimit(t);n==="hide"&&l<0&&(l=0),n==="show"&&l>1&&(l=1),i.filter(c=>{let h=C.find(c);return !(!h||o&&!Rs(h))}).forEach(c=>{let h=C.find(c);if(h&&h instanceof $){if(n==="show"&&h.alpha<l?h.alpha+=u*e.deltaTime:n==="hide"&&h.alpha>l&&(h.alpha-=u*e.deltaTime),n==="show"&&h.alpha>=l){this.onEndOfTicker(c,s,t);return}else if(n==="hide"&&h.alpha<=l){this.onEndOfTicker(c,s,t);return}if(u<1e-5&&!(a&&a.type=="linear"&&a.amt!=0)){N.warn("The speed of the FadeAlphaTicker must be greater than 0."),this.onEndOfTicker(c,s,t,{editAlpha:false});return}}}),a&&Ms(t,"speed",a);}onEndOfTicker(e,t,i,s={editAlpha:true}){typeof e=="string"&&(e=[e]),e.forEach(n=>{let o=C.find(n);if(o&&s.editAlpha){let a=this.getLimit(i);o.alpha=a;}}),super.onEndOfTicker(e,t,i);}getLimit(e){let{type:t="hide",limit:i=t==="hide"?0:1}=e;return i}speedConvert(e){return e/600}};vi(Ti);pe();var bk=10;function yk(r,e){let t=St(r.destination);if(t.type==="align"){let i,s;e instanceof xe&&(i=e.anchor.x,s=e.anchor.y);let n=$e(e.pivot,e.angle),o=$e(e.scale,e.angle);t.x=bi("width",t.x,Zr(e),n.x,o.x<0,i),t.y=bi("height",t.y,Qr(e),n.y,o.y<0,s);}return t.type==="percentage"&&(t.x=yi("width",t.x),t.y=yi("height",t.y)),t}var qt=class extends Nt{fn(e,t,i,s){t.speed===void 0&&(t.speed=bk);let{speed:n,startOnlyIfHaveTexture:o,speedProgression:a}=t;i.filter(u=>{let l=C.find(u);return !(!l||o&&!Rs(l))}).forEach(u=>{let l=C.find(u);if(l&&l instanceof $){let c=yk(t,l),h=c.x-l.x,f=c.y-l.y,p=h>0?1:-1,g=f>0?1:-1,b,_;if(typeof n=="number"){let x=this.speedConvert(n);h===0||f===0?b=_=x:(b=Math.abs(h/(h+f))*x,_=Math.abs(f/(h+f))*x);}else b=this.speedConvert(n.x),_=this.speedConvert(n.y);if(b>0){l.x+=p*b*e.deltaTime;let x=c.x-l.x;(p<0&&x>0||p>0&&x<0)&&(l.x=c.x);}if(_>0){l.y+=g*_*e.deltaTime;let x=c.y-l.y;(g<0&&x>0||g>0&&x<0)&&(l.y=c.y);}if(l.x==c.x&&l.y==c.y){this.onEndOfTicker(u,s,t);return}else if(b<1e-5&&_<1e-5&&!(a&&a.type=="linear"&&a.amt!=0)){N.warn("The speed of the MoveTicker must be greater than 0."),this.onEndOfTicker(u,s,t,{editPosition:false});return}}}),a&&Ms(t,"speed",a);}onEndOfTicker(e,t,i,s={editPosition:true}){typeof e=="string"&&(e=[e]),e.forEach(n=>{let o=C.find(n);if(o){let a=i.destination;s.editPosition&&(o instanceof _e||o instanceof De?o.positionInfo=a:(o.x=a.x,o.y=a.y));}}),super.onEndOfTicker(e,t,i);}speedConvert(e){return e*(66/400)}};vi(qt);pe();var vk=1,Fh=class extends Nt{constructor(e={},t,i){super(e,t,i);}fn(e,t,i,s){t.speed===void 0&&(t.speed=vk);let{clockwise:n=true,speedProgression:o,limit:a}=t,u=this.speedConvert(t.speed);i.filter(l=>{let c=C.find(l);return !(!c||t.startOnlyIfHaveTexture&&!Rs(c))}).forEach(l=>{let c=C.find(l);if(c&&c instanceof $&&(n?c.rotation+=u*e.deltaTime:c.rotation-=u*e.deltaTime,a!==void 0&&(n&&c.angle>=a?(c.angle=a,this.onEndOfTicker(l,s,t)):!n&&c.angle<=a&&(c.angle=a,this.onEndOfTicker(l,s,t))),u<1e-5&&!(o&&o.type=="linear"&&o.amt!=0))){N.warn("The speed of the RotateTicker must be greater than 0."),this.onEndOfTicker(l,s,t,{editRotation:false});return}}),o&&Ms(t,"speed",o);}onEndOfTicker(e,t,i,s={editRotation:true}){let{limit:n}=i;typeof e=="string"&&(e=[e]),e.forEach(o=>{let a=C.find(o);a&&s.editRotation&&n!==void 0&&(a.angle=n);}),super.onEndOfTicker(e,t,i);}speedConvert(e){return e/100}};vi(Fh);pe();var Tk=10,Ds=class extends Nt{constructor(e={},t,i){super(e,t,i);}fn(e,t,i,s){t.speed===void 0&&(t.speed=Tk);let{speed:n,type:o="zoom",startOnlyIfHaveTexture:a,speedProgression:u}=t,l,c;typeof n=="number"?(l=this.speedConvert(n),c=this.speedConvert(n)):(l=this.speedConvert(n.x),c=this.speedConvert(n.y));let h=this.getLimit(t);i.filter(f=>{let p=C.find(f);return !(!p||a&&!Rs(p))}).forEach(f=>{let p=C.find(f);if(p&&p instanceof $){if(o==="zoom"&&(p.scale.x<h.x||p.scale.y<h.y)?(p.scale.x+=l*e.deltaTime,p.scale.y+=c*e.deltaTime):o==="unzoom"&&(p.scale.x>h.x||p.scale.y>h.y)&&(p.scale.x-=l*e.deltaTime,p.scale.y-=c*e.deltaTime),o==="zoom"){if(p.scale.x>h.x&&(p.scale.x=h.x),p.scale.y>h.y&&(p.scale.y=h.y),p.scale.x>=h.x&&p.scale.y>=h.y){this.onEndOfTicker(f,s,t);return}}else if(o==="unzoom"&&(p.scale.x<h.x&&(p.scale.x=h.x),p.scale.y<h.y&&(p.scale.y=h.y),p.scale.x<=h.x&&p.scale.y<=h.y)){this.onEndOfTicker(f,s,t);return}if((l<1e-5&&c<1e-5||l<1e-5&&p.scale.y==h.y||c<1e-5&&p.scale.x==h.x)&&!(u&&u.type=="linear"&&u.amt!=0)){N.warn("The speed of the ZoomTicker must be greater than 0."),this.onEndOfTicker(f,s,t,{editScale:false});return}}}),u&&Ms(t,"speed",u);}speedConvert(e){return e/600}onEndOfTicker(e,t,i,s={editScale:true}){let{isZoomInOut:n}=i;typeof e=="string"&&(e=[e]),e.forEach(o=>{let a=C.find(o);if(a){if(s.editScale){let u=this.getLimit(i);a.scale.x=u.x,a.scale.y=u.y;}if(n){let{pivot:u,position:l}=n;a.pivot=u.x,a.position=l;}}}),super.onEndOfTicker(e,t,i);}getLimit(e){let{type:t="zoom",limit:i}=e,s=t==="zoom"?1/0:0,n=t==="zoom"?1/0:0;return i&&(typeof i=="number"?(s=i,n=i):(s=i.x,n=i.y)),{x:s,y:n}}};vi(Ds);async function Sk(r,e={},t){let i=C.find(r);if(!i){N.error(`The element with the alias ${r} does not exist. So the shake effect can't be applied.`);return}let s={x:i.position.x,y:i.position.y},n=e.speed||20,o=e.speedProgression||void 0,a=e.startOnlyIfHaveTexture||false,u=e.type||"horizontal",l=e.maximumShockSize||10,c=(e.shocksNumber||10)-1;if(c<2){N.error("The number of shocks must be at least 3.");return}let h=Math.floor(c/2),f=Math.ceil(c/2),p=[];for(let _=0;_<h;_++){let x={x:s.x,y:s.y},y=l*(_+1)/h;u==="horizontal"?_%2!==0?x.x=s.x+y:x.x=s.x-y:_%2!==0?x.y=s.y+y:x.y=s.y-y,p.push(new qt({destination:x,speed:n,speedProgression:o,startOnlyIfHaveTexture:a},void 0,t));}let g=h%2===0;for(let _=f;_>0;_--){let x={x:s.x,y:s.y},y=l*(_+1)/(f-1);u==="horizontal"?_%2===0&&!g||_%2!==0&&g?x.x=s.x-y:x.x=s.x+y:_%2===0&&!g||_%2!==0&&g?x.y=s.y-y:x.y=s.y+y,p.push(new qt({destination:x,speed:n,speedProgression:o,startOnlyIfHaveTexture:a},void 0,t));}p.push(new qt({destination:s,speed:n,speedProgression:o,startOnlyIfHaveTexture:a,tickerAliasToResume:r},void 0,t));let b=C.addTickersSequence(r,p);b&&(C.completeTickerOnStepEnd({id:b,alias:r}),C.pauseTicker(r,{tickerIdsExcluded:[b]}));}function e_(r,e,t){let i=new De(t,e);return C.add(r,i),i}async function Ek(r,e,t){let i=new De(t,e);return await i.load(),C.add(r,i),i}pe();function t_(r,e,t){if(!e)if(Xe.resolver.hasKey(r))e=r;else throw new Error(`The image ${r} does not exist in the cache.`);let i=new _e(t,e);return C.add(r,i),i}async function Ak(r){if(!Array.isArray(r))return [r];let e=Array(r.length);for(let t=0;t<r.length;t++)e[t]=$r(r[t].textureAlias);return Promise.all(e).then(t=>t.map((i,s)=>i?(r[s].texture=i,r[s]):(r[s].load(),r[s])))}async function Ck(r,e,t){if(!e)if(Xe.resolver.hasKey(r))e=r;else throw new Error(`The image ${r} does not exist in the cache.`);let i=new _e(t,e);return await i.load(),C.add(r,i),i}pe();function r_(r,e,t){if(!e)if(Xe.resolver.hasKey(r))e=r;else throw new Error(`The video ${r} does not exist in the cache.`);let i=new Et(t,e);return C.add(r,i),i}async function Pk(r){if(!Array.isArray(r))return [r];let e=Array(r.length);for(let t=0;t<r.length;t++)e[t]=$r(r[t].textureAlias);return Promise.all(e).then(t=>t.map((i,s)=>i?(r[s].texture=i,r[s]):(r[s].load(),r[s])))}async function wk(r,e,t){if(!e)if(Xe.resolver.hasKey(r))e=r;else throw new Error(`The video ${r} does not exist in the cache.`);let i=new Et(t,e);return await i.load(),C.add(r,i),i}function Gh(r,e){if(typeof e=="string")return wh(e)?r_(r,e):t_(r,e);if(Array.isArray(e))return e_(r,e);if(typeof e=="object"&&"value"in e&&"options"in e){if(typeof e.value=="string")return wh(e.value)?r_(r,e.value,e.options):t_(r,e.value,e.options);if(Array.isArray(e.value))return e_(r,e.value,e.options)}return C.add(r,e),e}async function pS(r,e,t={},i){let{mustBeCompletedBeforeNextStep:s=true,tickerAliasToResume:n=[]}=t,o=[];e||(e=r),typeof n=="string"&&(n=[n]);let a;if(C.find(r)&&(a=r+"_temp_disolve",C.editAlias(r,a)),e=Gh(r,e),a&&C.copyCanvasElementProperty(a,r),a&&C.transferTickers(a,r,"duplicate"),e.alpha=0,a){let c=Oh(a,t,i);c&&(o.push(...c),C.pauseTicker(a,{tickerIdsIncluded:c}),n.push(a));}let u=new Ti({...t,type:"show",tickerAliasToResume:n,startOnlyIfHaveTexture:true},void 0,i),l=C.addTicker(r,u);if(l&&(s&&C.completeTickerOnStepEnd({id:l}),o.push(l)),(e instanceof _e||e instanceof De)&&e.haveEmptyTexture&&await e.load(),o.length>0)return o}function Oh(r,e={},t){let{mustBeCompletedBeforeNextStep:i=true,aliasToRemoveAfter:s=[]}=e;typeof r=="string"&&(r=[r]),typeof s=="string"&&(s=[s]),s.push(...r);let n=new Ti({...e,type:"hide",aliasToRemoveAfter:s,startOnlyIfHaveTexture:true},void 0,t),o=C.addTicker(r,n);if(o)return i&&C.completeTickerOnStepEnd({id:o}),[o]}async function DB(r,e,t={},i){let{mustBeCompletedBeforeNextStep:s=true,aliasToRemoveAfter:n=[]}=t,o=[];if(e||(e=r),typeof n=="string"&&(n=[n]),!C.find(r))return pS(r,e,t,i);let a=r+"_temp_fade";C.editAlias(r,a),n.push(a),e=Gh(r,e),a&&C.copyCanvasElementProperty(a,r),a&&C.transferTickers(a,r,"duplicate"),e.alpha=0;let u=Oh(a,{...t,tickerAliasToResume:r},i);u&&o.push(...u);let l=new Ti({...t,type:"show",startOnlyIfHaveTexture:true,aliasToRemoveAfter:n},void 0,i),c=C.addTicker(r,l);if(c&&(s&&C.completeTickerOnStepEnd({id:c}),o.push(c),C.pauseTicker(r,{tickerIdsIncluded:[c]})),(e instanceof _e||e instanceof De)&&e.haveEmptyTexture&&await e.load(),o.length>0)return o}function IB(r,e={},t){return Oh(r,e,t)}async function Bk(r,e,t={},i){let{direction:s="right",mustBeCompletedBeforeNextStep:n=true,tickerAliasToResume:o=[],aliasToRemoveAfter:a=[],removeOldComponentWithMoveOut:u}=t,l=[];e||(e=r),typeof o=="string"&&(o=[o]),typeof a=="string"&&(a=[a]);let c;C.find(r)&&(c=r+"_temp_movein",C.editAlias(r,c)),e=Gh(r,e),c&&C.copyCanvasElementProperty(c,r),c&&C.transferTickers(c,r,"move");let h;e instanceof _e||e instanceof De?h=e.positionInfo:h={x:e.x,y:e.y,type:"pixel"};let f;switch(c&&(u?(f=mS(c,t,i),f&&(l.push(...f),o.push(c))):a.push(c)),(e instanceof _e||e instanceof De)&&e.haveEmptyTexture&&await e.load(),c&&C.pauseTicker(c,{tickerIdsIncluded:f}),s){case "up":e.y=C.canvasHeight+e.height;break;case "down":e.y=-e.height;break;case "left":e.x=C.canvasWidth+e.width;break;case "right":e.x=-e.width;break}o.push(r);let p=new qt({...t,tickerAliasToResume:o,aliasToRemoveAfter:a,destination:h,startOnlyIfHaveTexture:true},void 0,i),g=C.addTicker(r,p);if(g&&(C.pauseTicker(r,{tickerIdsExcluded:[g]}),n&&C.completeTickerOnStepEnd({id:g}),l.push(g)),l.length>0)return l}function mS(r,e={},t){let{direction:i="right",mustBeCompletedBeforeNextStep:s=true,aliasToRemoveAfter:n=[]}=e;typeof n=="string"&&(n=[n]),n.push(r);let o=C.find(r);if(!o){N.warn("The canvas component is not found.");return}let a={x:o.x,y:o.y};switch(i){case "up":a.y=-o.height;break;case "down":a.y=C.canvasHeight+o.height;break;case "left":a.x=-o.width;break;case "right":a.x=C.canvasWidth+o.width;break}let u=new qt({...e,destination:a,startOnlyIfHaveTexture:true,aliasToRemoveAfter:n},void 0,t),l=C.addTicker(r,u);if(l)return C.pauseTicker(r,{tickerIdsExcluded:[l]}),s&&C.completeTickerOnStepEnd({id:l}),[l]}async function Rk(r,e,t={},i){let{direction:s="right",mustBeCompletedBeforeNextStep:n=true,tickerAliasToResume:o=[],aliasToRemoveAfter:a=[]}=t,u=[];e||(e=r),typeof o=="string"&&(o=[o]),typeof a=="string"&&(a=[a]);let l,c=C.find(r);c&&(l=r+"_temp_zoom",C.editAlias(r,l)),e=Gh(r,e),l&&C.copyCanvasElementProperty(l,r),l&&C.transferTickers(l,r,"move"),s=="up"?(e.pivot.y=C.canvasHeight-e.y,e.pivot.x=C.canvasWidth/2-e.x,e.y=C.canvasHeight,e.x=C.canvasWidth/2):s=="down"?(e.pivot.y=0-e.y,e.pivot.x=C.canvasWidth/2-e.x,e.y=0,e.x=C.canvasWidth/2):s=="left"?(e.pivot.x=C.canvasWidth-e.x,e.pivot.y=C.canvasHeight/2-e.y,e.x=C.canvasWidth,e.y=C.canvasHeight/2):s=="right"&&(e.pivot.x=0-e.x,e.pivot.y=C.canvasHeight/2-e.y,e.x=0,e.y=C.canvasHeight/2),e.pivot=aS(e.pivot,e.angle),e.scale.set(0);let h=c?{pivot:{x:c.pivot.x,y:c.pivot.y},position:{x:c.x,y:c.y}}:void 0;if(l){if(t.removeOldComponentWithZoomOut){let g=kB(l,t,i);g&&(u.push(...g),o.push(l));}else a.push(l);C.pauseTicker(l);}o.push(r);let f=new Ds({...t,tickerAliasToResume:o,aliasToRemoveAfter:a,startOnlyIfHaveTexture:true,type:"zoom",limit:1,isZoomInOut:h},void 0,i),p=C.addTicker(r,f);if(p&&(C.pauseTicker(r,{tickerIdsExcluded:[p]}),n&&C.completeTickerOnStepEnd({id:p}),u.push(p)),(e instanceof _e||e instanceof De)&&e.haveEmptyTexture&&await e.load(),u.length>0)return u}function kB(r,e={},t){let{direction:i="right",mustBeCompletedBeforeNextStep:s=true,aliasToRemoveAfter:n=[]}=e;typeof n=="string"&&(n=[n]),n.push(r);let o=C.find(r);if(!o){N.warn("The canvas component is not found.");return}i=="up"?(o.pivot.y=C.canvasHeight-o.y,o.pivot.x=C.canvasWidth/2-o.x,o.y=C.canvasHeight,o.x=C.canvasWidth/2):i=="down"?(o.pivot.y=0-o.y,o.pivot.x=C.canvasWidth/2-o.x,o.y=0,o.x=C.canvasWidth/2):i=="left"?(o.pivot.x=C.canvasWidth-o.x,o.pivot.y=C.canvasHeight/2-o.y,o.x=C.canvasWidth,o.y=C.canvasHeight/2):i=="right"&&(o.pivot.x=0-o.x,o.pivot.y=C.canvasHeight/2-o.y,o.x=0,o.y=C.canvasHeight/2),o.pivot=aS(o.pivot,o.angle),o.scale.set(1);let a=new Ds({...e,startOnlyIfHaveTexture:true,type:"unzoom",limit:0,aliasToRemoveAfter:n},void 0,t),u=C.addTicker(r,a);if(u)return C.pauseTicker(r,{tickerIdsExcluded:[u]}),s&&C.completeTickerOnStepEnd({id:u}),[u]}async function Mk(r,e,t={},i){let{direction:s="right",mustBeCompletedBeforeNextStep:n=true,tickerAliasToResume:o=[]}=t,a=[];e||(e=r),typeof o=="string"&&(o=[o]);let u;C.find(r)&&(u=r+"_temp_push",C.editAlias(r,u)),e=Gh(r,e),u&&C.copyCanvasElementProperty(u,r),u&&C.transferTickers(u,r,"move");let l;if((e instanceof _e||e instanceof De)&&e.haveEmptyTexture?l=e.positionInfo:l={x:e.x,y:e.y,type:"pixel"},s=="up"?e.y=-C.canvasHeight+e.y:s=="down"?e.y=C.canvasHeight+e.y:s=="left"?e.x=-C.canvasWidth+e.x:s=="right"&&(e.x=C.canvasWidth+e.x),u){let f=FB(u,{...t,direction:s=="up"?"down":s=="down"?"up":s=="left"?"right":"left"},i);f&&a.push(...f);}o.push(r);let c=new qt({...t,tickerAliasToResume:o,startOnlyIfHaveTexture:true,destination:l},void 0,i),h=C.addTicker(r,c);if(h&&(C.pauseTicker(r,{tickerIdsExcluded:[h]}),n&&C.completeTickerOnStepEnd({id:h}),a.push(h)),(e instanceof _e||e instanceof De)&&e.haveEmptyTexture&&await e.load(),a.length>0)return a}function FB(r,e={direction:"right"},t){return mS(r,e,t)}var C=new Ih;export{kh as CanvasBase,kh as CanvasBaseItem,ws as CanvasContainer,Jx as CanvasEvent,_e as CanvasImage,P as CanvasManagerStatic,Jr as CanvasSprite,Bs as CanvasText,Et as CanvasVideo,ws as Container,Ti as FadeAlphaTicker,De as ImageContainer,_e as ImageSprite,qt as MoveTicker,Fh as RotateTicker,Jr as Sprite,Bs as Text,Nt as TickerBase,Et as VideoSprite,Ds as ZoomTicker,t_ as addImage,e_ as addImageCointainer,r_ as addVideo,C as canvas,iS as canvasComponentDecorator,iS as canvasElementDecorator,wB as eventDecorator,$r as getTexture,Ak as loadImage,Pk as loadVideo,Bk as moveIn,mS as moveOut,Mk as pushIn,FB as pushOut,Oh as removeWithDissolve,Oh as removeWithDissolveTransition,IB as removeWithFade,IB as removeWithFadeTransition,Sk as shakeEffect,Ck as showImage,Ek as showImageContainer,wk as showVideo,pS as showWithDissolve,pS as showWithDissolveTransition,DB as showWithFade,DB as showWithFadeTransition,MB as tickerDecorator,Rk as zoomIn,kB as zoomOut};