@drincs/pixi-vn 1.2.23 → 1.2.25

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.
@@ -3311,4 +3311,4 @@ fn setSaturation(c: vec3<f32>, s: f32) -> vec3<f32> {
3311
3311
  u32v[offset + (stride * 3)] = c;
3312
3312
  `,dynamic:false}};});var zF,ER,AR,CR=f(()=>{Et();Gr();mE();zF=new xe(0,0,0,0),ER=class gE extends Ze{constructor(e={}){e={...gE.defaultOptions,...e,dynamicProperties:{...gE.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 Ed){let l=Ed[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 zF}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){e??(e=0),t??(t=this.particleChildren.length);let i=this.particleChildren.splice(e,t-e);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")}};ER.defaultOptions={dynamicProperties:{vertex:false,position:true,rotation:false,uvs:false,color:false},roundPixels:false};AR=ER;});var wR,xE,H_,BR=f(()=>{ns();he();me();Gr();$m();wR=class PR extends Ze{constructor(e){e instanceof C&&(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??Xr.defaultOptions.leftWidth,this._topHeight=a??l?.defaultBorders?.top??Xr.defaultOptions.topHeight,this._rightWidth=o??l?.defaultBorders?.right??Xr.defaultOptions.rightWidth,this._bottomHeight=u??l?.defaultBorders?.bottom??Xr.defaultOptions.bottomHeight,this._width=t??l.width??Xr.defaultOptions.width,this._height=i??l.height??Xr.defaultOptions.height,this.allowChildren=false,this.texture=l??PR.defaultOptions.texture,this.roundPixels=c??false,this._anchor=new be({_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=C.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;}};wR.defaultOptions={texture:C.EMPTY};xE=wR,H_=class extends xE{constructor(...e){let t=e[0];t instanceof C&&(I(V,"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]}),I(V,"NineSlicePlane is deprecated. Use NineSliceSprite instead."),super(t);}};});function V_(r){let{text:e,style:t,chars:i}=r,s=t,n=Wr.getFont(e,s),o=Xe.graphemeSegmenter(e),a=Hs(o,s,n,true),u=a.scale,l=[],c=[],h=[],d=0;for(let p of a.lines){if(p.chars.length===0)continue;let _=new q({label:"line"});_.y=d,h.push(_);let b=new q({label:"word"}),g=0;for(let m=0;m<p.chars.length;m++){let y=p.chars[m];if(!y||!n.chars[y])continue;let S=y===" ",w=m===p.chars.length-1,A;i.length>0?(A=i.shift(),A.text=y,A.style=s,A.label=`char-${y}`,A.x=p.charPositions[m]*u-p.charPositions[g]*u):A=new cn({text:y,style:s,label:`char-${y}`,x:p.charPositions[m]*u-p.charPositions[g]*u}),S||(l.push(A),b.addChild(A)),(S||w)&&b.children.length>0&&(b.x=p.charPositions[g]*u,c.push(b),_.addChild(b),b=new q({label:"word"}),g=m+1);}d+=n.lineHeight*u;}return {chars:l,lines:h,words:c}}var _E=f(()=>{At();Wi();gu();M_();Yc();});var hn,z_=f(()=>{At();zr();hn=class extends q{constructor(e){let{text:t,style:i,autoSplit:s,lineAnchor:n,wordAnchor:o,charAnchor:a,...u}=e;super(u),this._dirty=false,this._canReuseChars=false,this.chars=[],this.words=[],this.lines=[],this._originalText=t,this._autoSplit=s,this._lineAnchor=n,this._wordAnchor=o,this._charAnchor=a,this.style=i;}split(){let e=this.splitFn();this.chars=e.chars,this.words=e.words,this.lines=e.lines,this.addChild(...this.lines),this.charAnchor=this._charAnchor,this.wordAnchor=this._wordAnchor,this.lineAnchor=this._lineAnchor,this._dirty=false,this._canReuseChars=true;}get text(){return this._originalText}set text(e){this._originalText=e,this.lines.forEach(t=>t.destroy({children:true})),this.lines.length=0,this.words.length=0,this.chars.length=0,this._canReuseChars=false,this.onTextUpdate();}_setOrigin(e,t,i){let s;typeof e=="number"?s={x:e,y:e}:s={x:e.x,y:e.y},t.forEach(n=>{let o=n.getLocalBounds(),a=o.minX+o.width*s.x,u=o.minY+o.height*s.y;n.origin.set(a,u);}),this[i]=e;}get lineAnchor(){return this._lineAnchor}set lineAnchor(e){this._setOrigin(e,this.lines,"_lineAnchor");}get wordAnchor(){return this._wordAnchor}set wordAnchor(e){this._setOrigin(e,this.words,"_wordAnchor");}get charAnchor(){return this._charAnchor}set charAnchor(e){this._setOrigin(e,this.chars,"_charAnchor");}get style(){return this._style}set style(e){e||(e={}),this._style=new We(e),this.words.forEach(t=>t.destroy()),this.words.length=0,this.lines.forEach(t=>t.destroy()),this.lines.length=0,this._canReuseChars=true,this.onTextUpdate();}onTextUpdate(){this._dirty=true,this._autoSplit&&this.split();}destroy(e){super.destroy(e),this.chars=[],this.words=[],this.lines=[],(typeof e=="boolean"?e:e?.style)&&this._style.destroy(e),this._style=null,this._originalText="";}};});var RR,MR,DR=f(()=>{zr();_E();z_();RR=class W_ extends hn{constructor(e){let t={...W_.defaultOptions,...e};super(t);}static from(e,t){let i={...W_.defaultOptions,...t,text:e.text,style:new We(e.style)};return new W_({...i})}splitFn(){return V_({text:this._originalText,style:this._style,chars:this._canReuseChars?this.chars:[]})}};RR.defaultOptions={autoSplit:true,lineAnchor:0,wordAnchor:0,charAnchor:0};MR=RR;});function WF(r,e,t){switch(r){case "center":return (t-e)/2;case "right":return t-e;case "left":default:return 0}}function IR(r){return r==="\r"||r===`
3313
3313
  `||r===`\r
3314
- `}function XF(r,e,t){let i=[],s=e.lines[0],n="",o=[],a=0;return t.wordWrap=false,r.forEach(u=>{let l=/^\s*$/.test(u),c=IR(u),h=n.length===0&&l;if(l&&!c&&h)return;c||(n+=u);let d=Xe.measureText(u,t);o.push({char:u,metric:d}),n.length>=s.length&&(i.push({line:n,chars:o,width:o.reduce((p,_)=>p+_.metric.width,0)}),o=[],n="",a++,s=e.lines[a]);}),i}function X_(r){let{text:e,style:t,chars:i}=r,s=t,n=Xe.measureText(e,s),o=Xe.graphemeSegmenter(e),a=XF(o,n,s.clone()),u=s.align,l=n.lineWidths.reduce((g,m)=>Math.max(g,m),0),c=[],h=[],d=[],p=0,_=s.stroke?.width||0,b=s.dropShadow?.distance||0;return a.forEach((g,m)=>{let y=new q({label:`line-${m}`});y.y=p,h.push(y);let T=n.lineWidths[m],S=WF(u,T,l),w=new q({label:"word"});w.x=S,g.chars.forEach((A,P)=>{if(A.metric.width!==0){if(IR(A.char)){S+=A.metric.width-_;return}if(A.char===" ")w.children.length>0&&(d.push(w),y.addChild(w)),S+=A.metric.width+s.letterSpacing-_,w=new q({label:"word"}),w.x=S;else {let N;i.length>0?(N=i.shift(),N.text=A.char,N.style=s,N.setFromMatrix(M.IDENTITY),N.x=S-w.x-b*P):N=new ir({text:A.char,style:s,x:S-w.x-b*P}),c.push(N),w.addChild(N),S+=A.metric.width+s.letterSpacing-_;}}}),w.children.length>0&&(d.push(w),y.addChild(w)),p+=n.lineHeight;}),{chars:c,lines:h,words:d}}var bE=f(()=>{ce();At();Wi();yd();});var kR,FR,OR=f(()=>{zr();bE();z_();kR=class Y_ extends hn{constructor(e){let t={...Y_.defaultOptions,...e};super(t);}static from(e,t){let i={...Y_.defaultOptions,...t,text:e.text,style:new We(e.style)};return new Y_({...i})}splitFn(){return X_({text:this._originalText,style:this._style,chars:this._canReuseChars?this.chars:[]})}};kR.defaultOptions={autoSplit:true,lineAnchor:0,wordAnchor:0,charAnchor:0};FR=kR;});async function GR(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 UR=f(()=>{});function yE(r,e=0,t={color:"#000000"}){r.renderGroup&&(t.color=YF[$F++]);let i="";for(let o=0;o<e;o++)i+=" ";let s=r.label;!s&&r instanceof Ae&&(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];yE(a,e,{...t});}}function vE(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];vE(o,e,{...t,index:n});}}var YF,$F,LR=f(()=>{xs();YF=["#000080","#228B22","#8B0000","#4169E1","#008080","#800000","#9400D3","#FF8C00","#556B2F","#8B008B"],$F=0;});var NR={};Yd(NR,{AbstractBitmapFont:()=>Ns,AbstractRenderer:()=>pi,AbstractSplitText:()=>hn,AbstractText:()=>vi,AccessibilitySystem:()=>Df,AlphaFilter:()=>aB,AlphaMask:()=>Gn,AlphaMaskPipe:()=>Co,AnimatedSprite:()=>Sl,Application:()=>Uh,ApplicationInitHook:()=>Eo,Assets:()=>rt,AssetsClass:()=>Xh,BLEND_TO_NPM:()=>Qf,BUFFER_TYPE:()=>Zo,BackgroundLoader:()=>Ku,BackgroundSystem:()=>pg,Batch:()=>_c,BatchGeometry:()=>Wa,BatchTextureArray:()=>za,BatchableGraphics:()=>Hi,BatchableHTMLText:()=>xu,BatchableMesh:()=>li,BatchableSprite:()=>Pr,BatchableText:()=>nu,Batcher:()=>ip,BatcherPipe:()=>Eh,BigPool:()=>Re,BindGroup:()=>at,BindGroupSystem:()=>ko,BitmapFont:()=>la,BitmapFontManager:()=>Wr,BitmapText:()=>cn,BitmapTextGraphics:()=>$c,BitmapTextPipe:()=>no,BlendModeFilter:()=>te,BlendModePipe:()=>Bo,BlurFilter:()=>pd,BlurFilterPass:()=>Tl,Bounds:()=>xe,BrowserAdapter:()=>Nf,Buffer:()=>Ve,BufferImageSource:()=>ki,BufferResource:()=>xi,BufferUsage:()=>ie,CLEAR:()=>ut,Cache:()=>de,CanvasPool:()=>zt,CanvasPoolClass:()=>zc,CanvasSource:()=>ft,CanvasTextGenerator:()=>Xi,CanvasTextMetrics:()=>Xe,CanvasTextPipe:()=>Jn,CanvasTextSystem:()=>so,Circle:()=>ou,Color:()=>Z,ColorBlend:()=>eh,ColorBurnBlend:()=>th,ColorDodgeBlend:()=>rh,ColorMask:()=>Un,ColorMaskPipe:()=>wo,ColorMatrixFilter:()=>T_,CompressedSource:()=>Rr,Container:()=>q,Culler:()=>i_,CullerPlugin:()=>Jh,CustomRenderPipe:()=>_o,D3D10_RESOURCE_DIMENSION:()=>jx,D3DFMT:()=>Wt,DATA_URI:()=>Yw,DDS:()=>J,DEG_TO_RAD:()=>ef,DEPRECATED_SCALE_MODES:()=>Sd,DEPRECATED_WRAP_MODES:()=>Td,DOMAdapter:()=>z,DOMContainer:()=>Lf,DOMPipe:()=>Fn,DRAW_MODES:()=>GB,DXGI_FORMAT:()=>qx,DXGI_TO_TEXTURE_FORMAT:()=>Ot,DarkenBlend:()=>ih,DefaultBatcher:()=>zn,DefaultShader:()=>ja,DifferenceBlend:()=>sh,DisplacementFilter:()=>A_,DivideBlend:()=>nh,DynamicBitmapFont:()=>Xc,Ellipse:()=>au,EventBoundary:()=>ka,EventEmitter:()=>ue,EventSystem:()=>Fa,EventsTicker:()=>br,ExclusionBlend:()=>oh,ExtensionType:()=>x,ExtractSystem:()=>mg,FOURCC_TO_TEXTURE_FORMAT:()=>Kh,FederatedContainer:()=>Uf,FederatedEvent:()=>oi,FederatedMouseEvent:()=>Or,FederatedPointerEvent:()=>Ct,FederatedWheelEvent:()=>yr,FillGradient:()=>kt,FillPattern:()=>Hr,Filter:()=>_t,FilterEffect:()=>Ir,FilterPipe:()=>ho,FilterSystem:()=>fo,FontStylePromiseCache:()=>_u,GAUSSIAN_VALUES:()=>vl,GL_FORMATS:()=>Hu,GL_INTERNAL_FORMAT:()=>m1,GL_TARGETS:()=>Mh,GL_TYPES:()=>fe,GL_WRAP_MODES:()=>WT,GenerateTextureSystem:()=>Ro,Geometry:()=>Dt,GlBackBufferSystem:()=>Yg,GlBatchAdaptor:()=>Ko,GlBuffer:()=>Nu,GlBufferSystem:()=>Qo,GlColorMaskSystem:()=>ea,GlContextSystem:()=>zg,GlEncoderSystem:()=>ta,GlGeometrySystem:()=>Jo,GlGraphicsAdaptor:()=>qo,GlLimitsSystem:()=>ra,GlMeshAdaptor:()=>jo,GlParticleContainerAdaptor:()=>eu,GlParticleContainerPipe:()=>Kn,GlProgram:()=>ke,GlProgramData:()=>Wu,GlRenderTarget:()=>Vu,GlRenderTargetAdaptor:()=>zu,GlRenderTargetSystem:()=>na,GlShaderSystem:()=>oa,GlStateSystem:()=>fx,GlStencilSystem:()=>ia,GlTexture:()=>Yu,GlTextureSystem:()=>ua,GlUboSystem:()=>sa,GlUniformGroupSystem:()=>aa,GlobalUniformSystem:()=>Mo,GpuBatchAdaptor:()=>xo,GpuBlendModesToPixi:()=>Bt,GpuBufferSystem:()=>Fo,GpuColorMaskSystem:()=>Oo,GpuDeviceSystem:()=>Qs,GpuEncoderSystem:()=>Go,GpuGraphicsAdaptor:()=>mo,GpuGraphicsContext:()=>Mc,GpuLimitsSystem:()=>Uo,GpuMeshAdapter:()=>go,GpuMipmapGenerator:()=>Lu,GpuParticleContainerAdaptor:()=>iu,GpuParticleContainerPipe:()=>Zn,GpuProgram:()=>Fe,GpuRenderTarget:()=>Ou,GpuRenderTargetAdaptor:()=>Gu,GpuRenderTargetSystem:()=>Wo,GpuShaderSystem:()=>Xo,GpuStateSystem:()=>Yo,GpuStencilModesToPixi:()=>Br,GpuStencilSystem:()=>Lo,GpuTextureSystem:()=>$o,GpuUboSystem:()=>Ho,GpuUniformBatchPipe:()=>Vo,Graphics:()=>Ls,GraphicsContext:()=>tt,GraphicsContextRenderData:()=>Dc,GraphicsContextSystem:()=>Is,GraphicsGpuData:()=>kc,GraphicsPath:()=>ci,GraphicsPipe:()=>qn,HTMLText:()=>Cl,HTMLTextPipe:()=>oo,HTMLTextRenderData:()=>Vs,HTMLTextStyle:()=>zs,HTMLTextSystem:()=>ao,HardLightBlend:()=>ah,HardMixBlend:()=>uh,HelloSystem:()=>Zs,IGLUniformData:()=>Qg,ImageSource:()=>Mt,InstructionSet:()=>ls,KTX:()=>$e,LightenBlend:()=>lh,LinearBurnBlend:()=>ch,LinearDodgeBlend:()=>hh,LinearLightBlend:()=>dh,Loader:()=>Qu,LoaderParserPriority:()=>Me,LuminosityBlend:()=>fh,MaskEffectManager:()=>wa,MaskEffectManagerClass:()=>ec,MaskFilter:()=>Cu,Matrix:()=>M,Mesh:()=>rr,MeshGeometry:()=>Zt,MeshGpuData:()=>Ja,MeshPipe:()=>jn,MeshPlane:()=>U_,MeshRope:()=>gR,MeshSimple:()=>N_,NOOP:()=>sc,NegationBlend:()=>ph,NineSliceGeometry:()=>Xr,NineSlicePlane:()=>H_,NineSliceSprite:()=>xE,NineSliceSpriteGpuData:()=>Zc,NineSliceSpritePipe:()=>co,NoiseFilter:()=>gB,ObservablePoint:()=>be,OverlayBlend:()=>mh,PI_2:()=>Qd,Particle:()=>TR,ParticleBuffer:()=>tu,ParticleContainer:()=>AR,ParticleContainerPipe:()=>ks,ParticleShader:()=>ru,PerspectiveMesh:()=>lR,PerspectivePlaneGeometry:()=>Pl,PinLightBlend:()=>gh,PipelineSystem:()=>zo,PlaneGeometry:()=>Ys,Point:()=>ne,Polygon:()=>Os,Pool:()=>Mi,PoolGroupClass:()=>Ql,PrepareBase:()=>P_,PrepareQueue:()=>Al,PrepareSystem:()=>vd,PrepareUpload:()=>wl,QuadGeometry:()=>vu,RAD_TO_DEG:()=>Jd,Rectangle:()=>Q,RenderContainer:()=>k_,RenderGroup:()=>Ma,RenderGroupPipe:()=>yo,RenderGroupSystem:()=>To,RenderLayer:()=>rR,RenderTarget:()=>Io,RenderTargetSystem:()=>tn,RenderTexture:()=>wu,RenderableGCSystem:()=>bg,RendererInitHook:()=>Ao,RendererType:()=>Oe,ResizePlugin:()=>Dn,Resolver:()=>Pt,RopeGeometry:()=>L_,RoundedRectangle:()=>uu,SCALE_MODES:()=>NB,STENCIL_MODES:()=>Be,SVGParser:()=>pm,SaturationBlend:()=>xh,SchedulerSystem:()=>Do,ScissorMask:()=>D_,SdfShader:()=>mu,Shader:()=>ze,ShaderStage:()=>As,ShapePath:()=>du,SharedRenderPipes:()=>Mu,SharedSystems:()=>Ru,SoftLightBlend:()=>_h,SplitBitmapText:()=>MR,SplitText:()=>FR,Sprite:()=>Ae,SpritePipe:()=>So,Spritesheet:()=>fc,State:()=>Ue,StencilMask:()=>Ln,StencilMaskPipe:()=>Po,SubtractBlend:()=>bh,SystemRunner:()=>js,TEXTURE_FORMAT_BLOCK_SIZE:()=>Kx,Text:()=>ir,TextStyle:()=>We,Texture:()=>C,TextureGCSystem:()=>yg,TextureMatrix:()=>hs,TexturePool:()=>ye,TexturePoolClass:()=>nc,TextureSource:()=>oe,TextureStyle:()=>ot,TextureUvs:()=>I_,Ticker:()=>ve,TickerListener:()=>fs,TickerPlugin:()=>kn,TilingSprite:()=>R_,TilingSpriteGpuData:()=>jc,TilingSpritePipe:()=>lo,TilingSpriteShader:()=>yu,Transform:()=>El,Triangle:()=>w_,UNIFORM_TO_ARRAY_SETTERS:()=>cx,UNIFORM_TO_SINGLE_SETTERS:()=>lx,UNIFORM_TYPES_MAP:()=>Ap,UNIFORM_TYPES_VALUES:()=>Ec,UPDATE_BLEND:()=>Da,UPDATE_COLOR:()=>Mn,UPDATE_PRIORITY:()=>Vt,UPDATE_TRANSFORM:()=>AA,UPDATE_VISIBLE:()=>ds,UboBatch:()=>ku,UboSystem:()=>Js,UniformGroup:()=>ae,VERSION:()=>Ks,VideoSource:()=>ys,ViewContainer:()=>Ze,ViewSystem:()=>Sg,ViewableBuffer:()=>vr,VividLightBlend:()=>yh,WGSL_ALIGN_SIZE_DATA:()=>No,WGSL_TO_STD40_SIZE:()=>Dh,WRAP_MODES:()=>LB,WebGLRenderer:()=>Gh,WebGPURenderer:()=>Rh,WebWorkerAdapter:()=>iB,WorkerManager:()=>Wh,accessibilityTarget:()=>If,addBits:()=>yc,addMaskBounds:()=>_s,addMaskLocalBounds:()=>bs,addProgramDefines:()=>ap,alphaFrag:()=>p_,alphaWgsl:()=>fd,applyMatrix:()=>Wm,applyProjectiveTransformationToPlane:()=>F_,applyStyleParams:()=>Oh,assignWithIgnore:()=>Rn,autoDetectEnvironment:()=>Hw,autoDetectRenderer:()=>Sx,autoDetectSource:()=>QA,basisTranscoderUrls:()=>ul,bgr2rgb:()=>Di,bitmapFontCachePlugin:()=>Ex,bitmapFontTextParser:()=>ju,bitmapFontXMLParser:()=>Lh,bitmapFontXMLStringParser:()=>Nh,bitmapTextSplit:()=>V_,blendTemplateFrag:()=>jm,blendTemplateVert:()=>Km,blendTemplateWgsl:()=>Zm,blockDataMap:()=>Bh,blurTemplateWgsl:()=>b_,boundsPool:()=>Ht,browserExt:()=>g2,buildAdaptiveBezier:()=>cu,buildAdaptiveQuadratic:()=>sm,buildArc:()=>hu,buildArcTo:()=>om,buildArcToSvg:()=>am,buildCircle:()=>Ds,buildContextBatches:()=>$p,buildEllipse:()=>Mp,buildLine:()=>Op,buildPixelLine:()=>Gp,buildPolygon:()=>zp,buildRectangle:()=>Wp,buildRoundedRectangle:()=>Dp,buildSimpleUvs:()=>Bp,buildTriangle:()=>Xp,buildUvs:()=>Pp,cacheAsTextureMixin:()=>nf,cacheTextureArray:()=>Cx,calculateProjection:()=>Og,canvasTextSplit:()=>X_,checkChildrenDidChange:()=>rc,checkDataUrl:()=>Qt,checkExtension:()=>Ye,checkMaxIfStatementsInShader:()=>Ha,childrenHelperMixin:()=>af,cleanArray:()=>_g,cleanHash:()=>xg,clearList:()=>vo,closePointEps:()=>Ip,collectAllRenderables:()=>qB,collectRenderablesMixin:()=>uf,color32BitToUniform:()=>wr,colorBit:()=>ws,colorBitGl:()=>Ps,colorMatrixFilterFrag:()=>v_,colorMatrixFilterWgsl:()=>md,colorToUniform:()=>MC,compareModeToGlCompare:()=>bx,compileHighShader:()=>xp,compileHighShaderGl:()=>_p,compileHighShaderGlProgram:()=>Sr,compileHighShaderGpuProgram:()=>Tr,compileHooks:()=>vc,compileInputs:()=>Tc,compileOutputs:()=>gp,compileShader:()=>Ih,compute2DProjection:()=>G_,convertFormatIfRequired:()=>KP,convertToList:()=>wt,copySearchParams:()=>On,createIdFromString:()=>Nr,createIndicesForQuads:()=>Oc,createLevelBuffers:()=>OP,createLevelBuffersFromKTX:()=>QP,createStringVariations:()=>Hf,createTexture:()=>Ft,createUboElementsSTD40:()=>$g,createUboElementsWGSL:()=>Cg,createUboSyncFunction:()=>Du,createUboSyncFunctionSTD40:()=>Kg,createUboSyncFunctionWGSL:()=>Ig,crossOrigin:()=>i1,cullingMixin:()=>Zd,curveEps:()=>kp,defaultFilterVert:()=>un,defaultValue:()=>Xu,definedProps:()=>xt,deprecation:()=>I,detectAvif:()=>Px,detectBasis:()=>BP,detectCompressed:()=>n3,detectDefaults:()=>Bx,detectMp4:()=>Rx,detectOgv:()=>Mx,detectVideoAlphaMode:()=>Ua,detectWebm:()=>Dx,detectWebp:()=>Ix,determineCrossOrigin:()=>n1,displacementFrag:()=>S_,displacementVert:()=>E_,displacementWgsl:()=>gd,earcut:()=>Hp,effectsMixin:()=>lf,ensureAttributes:()=>Fu,ensureIsBuffer:()=>bc,ensurePrecision:()=>up,ensureTextOptions:()=>ln,executeInstructions:()=>bo,extensions:()=>O,extractAttributesFromGlProgram:()=>ix,extractAttributesFromGpuProgram:()=>dp,extractFontFamilies:()=>Im,extractStructAndGroups:()=>Ya,extractSvgUrlId:()=>Hc,fastCopy:()=>Vn,findMixin:()=>cf,fontStringFromTextStyle:()=>zi,formatShader:()=>BB,fragmentGPUTemplate:()=>yp,fragmentGlTemplate:()=>Tp,generateArraySyncSTD40:()=>jg,generateArraySyncWGSL:()=>Dg,generateBlurFragSource:()=>g_,generateBlurGlProgram:()=>__,generateBlurProgram:()=>y_,generateBlurVertSource:()=>x_,generateGPULayout:()=>AB,generateGpuLayoutGroups:()=>fp,generateLayout:()=>wB,generateLayoutHash:()=>pp,generateParticleUpdateFunction:()=>qp,generateProgram:()=>ax,generateShaderSyncCode:()=>Zg,generateTextStyleKey:()=>gm,generateTextureBatchBit:()=>Bs,generateTextureBatchBitGl:()=>Rs,generateTextureMatrix:()=>Yp,generateUniformsSync:()=>hx,getAdjustedBlendModeBlend:()=>Lr,getAttributeInfoFromFormat:()=>It,getBatchSamplersUniformGroup:()=>Ms,getBitmapTextLayout:()=>Hs,getCanvasBoundingBox:()=>_m,getCanvasFillStyle:()=>Us,getCanvasTexture:()=>Bu,getDefaultUniformValue:()=>Cp,getFastGlobalBounds:()=>XB,getFastGlobalBoundsMixin:()=>df,getFontCss:()=>Fm,getFontFamilyName:()=>KS,getGeometryBounds:()=>sp,getGlTypeFromFormat:()=>Xg,getGlobalBounds:()=>ni,getGlobalMixin:()=>mf,getGlobalRenderableBounds:()=>qm,getLocalBounds:()=>us,getMaxFragmentPrecision:()=>op,getMaxTexturesPerBatch:()=>rp,getOrientationOfPoints:()=>Fp,getPo2TextureFromSource:()=>pu,getResolutionOfUrl:()=>nn,getSVGUrl:()=>Om,getSupportedCompressedTextureFormats:()=>nl,getSupportedGPUCompressedTextureFormats:()=>$h,getSupportedGlCompressedTextureFormats:()=>Yh,getSupportedTextureFormats:()=>_i,getTemporaryCanvasFromImage:()=>Gm,getTestContext:()=>Na,getTextureBatchBindGroup:()=>vs,getTextureDefaultMatrix:()=>bR,getTextureFormatFromKTXTexture:()=>e3,getUboData:()=>sx,getUniformData:()=>nx,getUrlExtension:()=>my,glFormatToGPUFormat:()=>e_,glUploadBufferImageResource:()=>px,glUploadCompressedTextureResource:()=>mx,glUploadImageResource:()=>$u,glUploadVideoResource:()=>xx,globalUniformsBit:()=>Sp,globalUniformsBitGl:()=>Ep,globalUniformsUBOBitGl:()=>dC,gpuFormatToBasisTranscoderFormat:()=>UP,gpuFormatToKTXBasisTranscoderFormat:()=>r3,gpuUploadBufferImageResource:()=>Lg,gpuUploadCompressedTextureResource:()=>Ng,gpuUploadImageResource:()=>Uu,gpuUploadVideoResource:()=>Vg,groupD8:()=>le,hasCachedCanvasTexture:()=>tP,hslWgsl:()=>_B,hslgl:()=>$s,hslgpu:()=>qs,injectBits:()=>Sc,insertVersion:()=>lp,isMobile:()=>Rf,isPow2:()=>ic,isRenderingToScreen:()=>Gg,isSafari:()=>Bm,isSingleItem:()=>Oi,isWebGLSupported:()=>mi,isWebGPUSupported:()=>gi,ktxTranscoderUrls:()=>cl,loadBasis:()=>kP,loadBasisOnWorker:()=>$x,loadBitmapFont:()=>Ax,loadDDS:()=>NP,loadEnvironmentExtensions:()=>vh,loadFontAsBase64:()=>km,loadFontCSS:()=>qc,loadImageBitmap:()=>r1,loadJson:()=>kx,loadKTX:()=>VP,loadKTX2:()=>$P,loadKTX2onWorker:()=>Jx,loadSVGImage:()=>Um,loadSvg:()=>Gx,loadTextures:()=>rl,loadTxt:()=>Fx,loadVideoTextures:()=>Lx,loadWebFont:()=>Ox,localUniformBit:()=>Yi,localUniformBitGl:()=>Xs,localUniformBitGroup2:()=>Nm,localUniformMSDFBit:()=>Tm,localUniformMSDFBitGl:()=>Sm,log2:()=>xA,logDebugTexture:()=>GR,logProgramError:()=>ox,logRenderGroupScene:()=>vE,logScene:()=>yE,mSDFBit:()=>Em,mSDFBitGl:()=>Am,mapFormatToGlFormat:()=>yx,mapFormatToGlInternalFormat:()=>vx,mapFormatToGlType:()=>Tx,mapGlToVertexFormat:()=>tx,mapSize:()=>kB,mapType:()=>kh,mapWebGLBlendModesToPixi:()=>dx,maskFrag:()=>dg,maskVert:()=>fg,maskWgsl:()=>Ah,matrixPool:()=>Ke,measureHtmlText:()=>bu,measureMixin:()=>xf,migrateFragmentFromV7toV8:()=>DB,mipmapScaleModeToGlFilter:()=>_x,multiplyColors:()=>as,multiplyHexColors:()=>Ba,nextPow2:()=>kr,noiseFrag:()=>C_,noiseWgsl:()=>xd,nonCompressedFormats:()=>c1,normalizeExtensionPriority:()=>Ea,onRenderMixin:()=>_f,parseDDS:()=>Zx,parseFunctionBody:()=>zB,parseKTX:()=>Qx,parseSVGDefinitions:()=>dm,parseSVGFloatAttribute:()=>Ge,parseSVGPath:()=>Jp,parseSVGStyle:()=>Vc,particleData:()=>Ed,particlesFrag:()=>jp,particlesVert:()=>Kp,particlesWgsl:()=>Gc,path:()=>De,pointInTriangle:()=>_d,preloadVideo:()=>s1,removeItems:()=>Ca,removeStructAndGroupDuplicates:()=>mp,resetUids:()=>cA,resolveCharacters:()=>wm,resolveCompressedTextureUrl:()=>s3,resolveJsonUrl:()=>Hx,resolveTextureUrl:()=>il,resourceToTexture:()=>Ay,roundPixelsBit:()=>Er,roundPixelsBitGl:()=>Ar,roundedShapeArc:()=>um,roundedShapeQuadraticCurve:()=>lm,sayHello:()=>gg,scaleModeToGlFilter:()=>Fh,setBasisTranscoderPath:()=>DP,setKTXTranscoderPath:()=>XP,setPositions:()=>zm,setProgramName:()=>cp,setUvs:()=>Xm,shapeBuilders:()=>Qa,sortMixin:()=>bf,spritesheetAsset:()=>zf,squaredDistanceToLineSegment:()=>Fs,stripVersion:()=>hp,styleAttributes:()=>fm,testImageFormat:()=>Zu,testVideoFormat:()=>rn,textStyleToCSS:()=>Mm,textureBit:()=>rg,textureBitGl:()=>ig,textureFrom:()=>Cy,tilingBit:()=>Hm,tilingBitGl:()=>Vm,toFillStyle:()=>Vr,toLocalGlobalMixin:()=>yf,toStrokeStyle:()=>Gs,transformVertices:()=>Cc,triangulateWithHoles:()=>Za,uboSyncFunctionsSTD40:()=>wh,uboSyncFunctionsWGSL:()=>Rg,uid:()=>re,uniformParsers:()=>Yr,unpremultiplyAlpha:()=>fP,unsafeEvalSupported:()=>Tu,updateLocalTransform:()=>KB,updateQuadBounds:()=>Ga,updateRenderGroupTransform:()=>B2,updateRenderGroupTransforms:()=>Sh,updateTextBounds:()=>Qn,updateTransformAndChildren:()=>ug,updateTransformBackwards:()=>Pa,updateWorldTransform:()=>QB,v8_0_0:()=>V,v8_3_4:()=>rf,validFormats:()=>hl,validateRenderables:()=>lg,vertexGPUTemplate:()=>bp,vertexGlTemplate:()=>vp,vkFormatToGPUFormat:()=>t_,warn:()=>k,webworkerExt:()=>x2,wrapModeToGlAddress:()=>qu});var we=f(()=>{mw();xw();E();E();jf();Wf();ty();ry();yw();vw();Tw();Sw();Ew();Aw();Cw();ww();Pw();Bw();Rw();Mw();Dw();Iw();kw();Fw();Ow();Gw();Uw();Lw();Nw();vP();iy();ny();PP();LS();ai();NS();HS();VS();zS();WS();XS();YS();wx();Hh();$S();ur();qS();jS();ZS();QS();Ux();o1();$i();t1();a1();Nx();gs();sn();dr();Oa();Vf();py();hc();nt();RP();FP();GP();LP();h1();d1();f1();HP();p1();zP();x1();g1();qP();ZP();JP();t3();v1();i3();_1();T1();b1();o3();S1();A1();a3();Rb();WA();dy();Ee();S2();fy();sB();uy();Gf();kf();oc();hy();uc();Ff();Of();b2();y2();v2();bB();H1();V1();Y1();j1();K1();dd();Z1();Q1();J1();eE();tE();O2();G2();U2();je();Qc();Jc();uB();hB();q1();m_();z1();X1();W1();$1();dB();fB();xB();fi();Jl();h2();p2();L2();Sf();ce();tf();Ra();em();ns();jt();rE();sv();nv();ov();Je();av();yB();iE();aE();EB();lE();UT();tp();Py();CB();PB();gc();C2();My();F2();ky();By();wp();h0();Li();s0();Qy();Jy();e0();t0();RB();r0();n0();$a();qa();o0();uo();Ni();sg();_y();H2();by();V2();Ob();MB();yy();z2();pc();mc();DS();LT();NT();HT();po();zT();YT();XT();qT();jT();KT();ZT();rS();QT();tS();iS();sS();nS();Ac();Kt();oS();pS();xS();IB();aS();Jg();kg();lS();fS();Oy();ep();cS();hS();dS();FB();rx();Gy();Uy();Ly();Ny();Hy();qg();eS();JT();gS();mS();yS();_S();Wg();vS();RS();TS();SS();gx();ES();CS();u1();wS();PS();BS();AS();pP();MS();lT();cT();bT();hT();dT();fT();pT();mT();_T();yT();vT();TT();ET();AT();CT();Gi();lr();wT();wg();xT();Xy();Yy();gT();qy();jy();Ky();PT();BT();Fg();kT();RT();MT();Hg();DT();l1();IT();FT();X2();Y2();Ui();Ph();ui();Zf();j2();Z2();UB();Ss();f0();Dy();Es();Iy();p0();vf();Q2();ST();vg();Ug();J2();$y();Cr();l0();Ag();et();Bg();c0();Mg();Pg();tT();Ts();La();hr();Su();Eg();Jm();ro();HB();sT();K2();Ef();Nn();sl();Hn();dt();qf();he();oT();Af();Fr();Ii();VB();Tg();Xx();ol();wy();Xa();WB();uT();cr();Y0();$0();q0();Et();YB();An();tc();d2();os();Ib();kb();Fb();Gb();Ub();Lb();gf();Hb();Vb();zb();Wb();At();w2();$B();$b();P2();D2();Cf();Nb();ag();jB();cs();og();pf();ff();ZB();R2();JB();M2();OT();$n();E2();Rp();im();hv();nm();dv();mv();m0();x0();_0();T0();S0();E0();_C();Yn();Uc();vm();to();Ic();U0();cm();gv();xv();_v();hm();iv();yv();vv();bv();P0();mm();w0();g0();Vp();iR();cR();dE();cE();hE();hR();Kc();xR();_R();fE();GT();A2();Fc();yR();ha();Ws();N0();V0();Z0();K0();Q0();SR();X0();CR();Zp();mE();j0();z0();W0();sE();$m();BR();l2();Jv();r2();oE();a2();n2();i2();s2();o2();su();xs();I2();Cm();FS();OS();GS();US();kS();gu();M_();Uv();Fv();_E();Yc();Ov();Nv();uE();Hv();Rm();Dm();Zv();Wv();$v();qv();jv();Xv();Yv();Kv();Lm();zv();z_();DR();OR();bd();ev();ym();Wi();tv();Pv();Wc();bm();kv();Rv();Mv();yd();zr();bE();Sv();xm();Qp();Gr();gy();xy();In();ps();sy();Yf();Jb();Vv();Eu();Au();Qm();Av();cg();St();rT();of();ht();Xf();Kf();hg();me();UR();LR();ge();Yb();nE();Vh();ms();sf();si();eT();v0();O.add(g2,x2);});var KR=ii((ib,jR)=>{(function(r,e){typeof ib=="object"?jR.exports=ib=e():typeof define=="function"&&define.amd?define([],e):r.CryptoJS=e();})(ib,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 vb=="function")try{i=vb("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 m(){}return function(y){var T;return m.prototype=y,T=new m,m.prototype=null,T}}(),o={},a=o.lib={},u=a.Base=function(){return {extend:function(m){var y=n(this);return m&&y.mixIn(m),(!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 m=this.extend();return m.init.apply(m,arguments),m},init:function(){},mixIn:function(m){for(var y in m)m.hasOwnProperty(y)&&(this[y]=m[y]);m.hasOwnProperty("toString")&&(this.toString=m.toString);},clone:function(){return this.init.prototype.extend(this)}}}(),l=a.WordArray=u.extend({init:function(m,y){m=this.words=m||[],y!=t?this.sigBytes=y:this.sigBytes=m.length*4;},toString:function(m){return (m||h).stringify(this)},concat:function(m){var y=this.words,T=m.words,S=this.sigBytes,w=m.sigBytes;if(this.clamp(),S%4)for(var A=0;A<w;A++){var P=T[A>>>2]>>>24-A%4*8&255;y[S+A>>>2]|=P<<24-(S+A)%4*8;}else for(var N=0;N<w;N+=4)y[S+N>>>2]=T[N>>>2];return this.sigBytes+=w,this},clamp:function(){var m=this.words,y=this.sigBytes;m[y>>>2]&=4294967295<<32-y%4*8,m.length=e.ceil(y/4);},clone:function(){var m=u.clone.call(this);return m.words=this.words.slice(0),m},random:function(m){for(var y=[],T=0;T<m;T+=4)y.push(s());return new l.init(y,m)}}),c=o.enc={},h=c.Hex={stringify:function(m){for(var y=m.words,T=m.sigBytes,S=[],w=0;w<T;w++){var A=y[w>>>2]>>>24-w%4*8&255;S.push((A>>>4).toString(16)),S.push((A&15).toString(16));}return S.join("")},parse:function(m){for(var y=m.length,T=[],S=0;S<y;S+=2)T[S>>>3]|=parseInt(m.substr(S,2),16)<<24-S%8*4;return new l.init(T,y/2)}},d=c.Latin1={stringify:function(m){for(var y=m.words,T=m.sigBytes,S=[],w=0;w<T;w++){var A=y[w>>>2]>>>24-w%4*8&255;S.push(String.fromCharCode(A));}return S.join("")},parse:function(m){for(var y=m.length,T=[],S=0;S<y;S++)T[S>>>2]|=(m.charCodeAt(S)&255)<<24-S%4*8;return new l.init(T,y)}},p=c.Utf8={stringify:function(m){try{return decodeURIComponent(escape(d.stringify(m)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(m){return d.parse(unescape(encodeURIComponent(m)))}},_=a.BufferedBlockAlgorithm=u.extend({reset:function(){this._data=new l.init,this._nDataBytes=0;},_append:function(m){typeof m=="string"&&(m=p.parse(m)),this._data.concat(m),this._nDataBytes+=m.sigBytes;},_process:function(m){var y,T=this._data,S=T.words,w=T.sigBytes,A=this.blockSize,P=A*4,N=w/P;m?N=e.ceil(N):N=e.max((N|0)-this._minBufferSize,0);var D=N*A,U=e.min(D*4,w);if(D){for(var F=0;F<D;F+=A)this._doProcessBlock(S,F);y=S.splice(0,D),T.sigBytes-=U;}return new l.init(y,U)},clone:function(){var m=u.clone.call(this);return m._data=this._data.clone(),m},_minBufferSize:0});a.Hasher=_.extend({cfg:u.extend(),init:function(m){this.cfg=this.cfg.extend(m),this.reset();},reset:function(){_.reset.call(this),this._doReset();},update:function(m){return this._append(m),this._process(),this},finalize:function(m){m&&this._append(m);var y=this._doFinalize();return y},blockSize:512/32,_createHelper:function(m){return function(y,T){return new m.init(T).finalize(y)}},_createHmacHelper:function(m){return function(y,T){return new g.HMAC.init(m,T).finalize(y)}}});var g=o.algo={};return o}(Math);return r});});var QR=ii((sb,ZR)=>{(function(r,e){typeof sb=="object"?ZR.exports=sb=e(KR()):typeof define=="function"&&define.amd?define(["./core"],e):e(r.CryptoJS);})(sb,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],d=c[1],p=c[2],_=c[3],b=c[4],g=0;g<80;g++){if(g<16)o[g]=u[l+g]|0;else {var m=o[g-3]^o[g-8]^o[g-14]^o[g-16];o[g]=m<<1|m>>>31;}var y=(h<<5|h>>>27)+b+o[g];g<20?y+=(d&p|~d&_)+1518500249:g<40?y+=(d^p^_)+1859775393:g<60?y+=(d&p|d&_|p&_)-1894007588:y+=(d^p^_)-899497514,b=_,_=p,p=d<<30|d>>>2,d=h,h=y;}c[0]=c[0]+h|0,c[1]=c[1]+d|0,c[2]=c[2]+p|0,c[3]=c[3]+_|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});});we();var Ti={};Yd(Ti,{DistortionFilter:()=>$_,EqualizerFilter:()=>Mr,Filter:()=>pt,MonoFilter:()=>q_,ReverbFilter:()=>j_,StereoFilter:()=>K_,StreamFilter:()=>Z_,TelephoneFilter:()=>Q_});var HR;function VR(r){return HR=r,r}function Te(){return HR}var pt=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 $_=class extends pt{constructor(e=0){let t;if(!Te().useLegacy){let{audioContext:i}=Te().context;t=i.createWaveShaper();}super(t),this._distortion=t,this.amount=e;}set amount(e){if(this._amount=e,Te().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 lt=class{static setParamValue(e,t){if(e.setValueAtTime){let i=Te().context;e.setValueAtTime(t,i.audioContext.currentTime);}else e.value=t;return t}};var Se=class extends pt{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:Se.F32,type:"lowshelf",gain:r},{f:Se.F64,type:"peaking",gain:e},{f:Se.F125,type:"peaking",gain:t},{f:Se.F250,type:"peaking",gain:i},{f:Se.F500,type:"peaking",gain:s},{f:Se.F1K,type:"peaking",gain:n},{f:Se.F2K,type:"peaking",gain:o},{f:Se.F4K,type:"peaking",gain:a},{f:Se.F8K,type:"peaking",gain:u},{f:Se.F16K,type:"highshelf",gain:l}];Te().useLegacy||(c=h.map(d=>{let p=Te().context.audioContext.createBiquadFilter();return p.type=d.type,lt.setParamValue(p.Q,1),p.frequency.value=d.f,lt.setParamValue(p.gain,d.gain),p})),super(c[0],c[c.length-1]),this.bands=c,this.bandsMap={};for(let d=0;d<this.bands.length;d++){let p=this.bands[d];d>0&&this.bands[d-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}`);lt.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(Se.F32,r);}get f32(){return this.getGain(Se.F32)}set f64(r){this.setGain(Se.F64,r);}get f64(){return this.getGain(Se.F64)}set f125(r){this.setGain(Se.F125,r);}get f125(){return this.getGain(Se.F125)}set f250(r){this.setGain(Se.F250,r);}get f250(){return this.getGain(Se.F250)}set f500(r){this.setGain(Se.F500,r);}get f500(){return this.getGain(Se.F500)}set f1k(r){this.setGain(Se.F1K,r);}get f1k(){return this.getGain(Se.F1K)}set f2k(r){this.setGain(Se.F2K,r);}get f2k(){return this.getGain(Se.F2K)}set f4k(r){this.setGain(Se.F4K,r);}get f4k(){return this.getGain(Se.F4K)}set f8k(r){this.setGain(Se.F8K,r);}get f8k(){return this.getGain(Se.F8K)}set f16k(r){this.setGain(Se.F16K,r);}get f16k(){return this.getGain(Se.F16K)}reset(){this.bands.forEach(r=>{lt.setParamValue(r.gain,0);});}destroy(){this.bands.forEach(r=>{r.disconnect();}),this.bands=null,this.bandsMap=null;}},Mr=Se;Mr.F32=32;Mr.F64=64;Mr.F125=125;Mr.F250=250;Mr.F500=500;Mr.F1K=1e3;Mr.F2K=2e3;Mr.F4K=4e3;Mr.F8K=8e3;Mr.F16K=16e3;var q_=class extends pt{constructor(){let e,t;if(!Te().useLegacy){let{audioContext:i}=Te().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 j_=class extends pt{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(Te().useLegacy)return;let{audioContext:e}=Te().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 K_=class extends pt{constructor(e=0){let t,i,s;if(!Te().useLegacy){let{audioContext:n}=Te().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?lt.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 Z_=class extends pt{constructor(){let e,t;if(!Te().useLegacy){let{audioContext:i}=Te().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 Q_=class extends pt{constructor(){let e,t;if(!Te().useLegacy){let{audioContext:i}=Te().context,s=i.createBiquadFilter(),n=i.createBiquadFilter(),o=i.createBiquadFilter(),a=i.createBiquadFilter();s.type="lowpass",lt.setParamValue(s.frequency,2e3),n.type="lowpass",lt.setParamValue(n.frequency,2e3),o.type="highpass",lt.setParamValue(o.frequency,500),a.type="highpass",lt.setParamValue(a.frequency,500),s.connect(n),n.connect(o),o.connect(a),e=s,t=a;}super(e,t);}};we();var Ad=class extends ue{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();}};we();var qF=0,TE=class extends ue{constructor(r){super(),this.id=qF++,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-TE.PADDING),this._end=Math.min(this._end+TE.PADDING,this._duration),this._source.onloadedmetadata=()=>{this._source&&(this._source.currentTime=e,this._source.onloadedmetadata=null,this.emit("progress",e/this._duration,this._duration),ve.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(){ve.shared.remove(this._onUpdate,this),this._internalStop(),this.emit("progress",1,this._duration),this.emit("end",this);}destroy(){ve.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}]`}},J_=TE;J_.PADDING=.1;we();var Cd=class extends ue{init(e){this.parent=e,this._source=e.options.source||new Audio,e.url&&(this._source.src=e.url);}create(){return new J_(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();}};we();var wd=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 da=["ogg","oga","opus","m4a","mp3","mpeg","wav","aiff","wma","mid","caf"],SE=["audio/mpeg","audio/ogg"],fa={};function zR(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$/;da.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(fa,i);}zR();we();we();var KF=0,Pd=class extends ue{constructor(e){super(),this.id=KF++,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);lt.setParamValue(this._gain.gain,n*s*i),lt.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){ve.shared.remove(this._updateListener,this),e&&ve.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 pa=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 WR=class extends pa{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(WR.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,lt.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}},eb=WR;eb.BUFFER_SIZE=0;var ma=class{init(e){this.parent=e,this._nodes=new eb(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 Pd(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 z.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 Bl=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=Te().useLegacy?new Cd:new ma;return new Bl(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:De.extname(t).slice(1)})).filter(({ext:t})=>fa[t]).sort((t,i)=>da.indexOf(t.ext)-da.indexOf(i.ext));if(!e)throw new Error("No supported file type found");return e.url}get context(){return Te().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 wd(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(Bl._pool.length>0){let r=Bl._pool.pop();return r.init(this.media),r}return this.media.create()}_poolInstance(r){r.destroy(),Bl._pool.indexOf(r)<0&&Bl._pool.push(r);}},dn=Bl;dn._pool=[];we();var Rl=class r extends pa{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 ue,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 tb=class{constructor(){this.init();}init(){return this.supported&&(this._webAudioContext=new Rl),this._htmlAudioContext=new Ad,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 Rl.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 dn)return this._sounds[e]=t,t;let i=this._getOptions(t),s=dn.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}};we();we();var XR=r=>{let e=r.src,t=r?.alias?.[0];return (!t||r.src===t)&&(t=De.basename(e,De.extname(e))),t},YR={extension:x.Asset,detection:{test:async()=>true,add:async r=>[...r,...da.filter(e=>fa[e])],remove:async r=>r.filter(e=>r.includes(e))},loader:{name:"sound",extension:{type:[x.LoadParser],priority:Me.High},test(r){let e=De.extname(r).slice(1);return !!fa[e]||SE.some(t=>r.startsWith(`data:${t}`))},async load(r,e){let t=await new Promise((i,s)=>dn.from({...e.data,url:r,preload:true,loaded(n,o){n?s(n):i(o),e.data?.loaded?.(n,o);}}));return Te().add(XR(e),t),t},async unload(r,e){Te().remove(XR(e));}}};O.add(YR);VR(new tb);var Bd="repeat";({DistortionFilter:Ti.DistortionFilter,EqualizerFilter:Ti.EqualizerFilter,MonoFilter:Ti.MonoFilter,ReverbFilter:Ti.ReverbFilter,StereoFilter:Ti.StereoFilter,StreamFilter:Ti.StreamFilter,TelephoneFilter:Ti.TelephoneFilter});var $R=["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"],qr="__game_layer__",Ml="Container",rb="ImageContainer",EE="Image",Dl="Sprite",Il="Text",AE="Video";var H;(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)))(H||(H={}));function Ut(r){try{if(typeof r>"u")return r;let e=JSON.stringify(r);return JSON.parse(e)}catch(e){throw H.error("Error creating exportable element",r,e),new Error("[Pixi\u2019VN] Error creating exportable element")}}async function qR(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(()=>(we(),NR))),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 eM=$d(QR());we();var JF={extension:{type:"sceneProperties",name:"additional-positions"},testNode(r){return r instanceof Pe||r instanceof Xt||r instanceof Le},testProp(r){switch(r){case "xAlign":case "yAlign":case "percentageX":case "percentageY":case "positionType":return true;default:return false}},setProperty(r,e,t){if(r instanceof Pe||r instanceof Xt||r instanceof Le)switch(e){case "xAlign":r.xAlign=t/100;break;case "yAlign":r.yAlign=t/100;break;case "percentageX":r.percentageX=t/100;break;case "percentageY":r.percentageY=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.percentageX*100,prop:"percentageX",entry:{section:"Transform",type:"range",label:"X Percentage Position",tooltip:"0% is left, 100% is right",options:{min:0,max:100}}},{value:r.percentageY*100,prop:"percentageY",entry:{section:"Transform",type:"range",label:"Y Percentage Position",tooltip:"0% is top, 100% is bottom",options:{min:0,max:100}}}]}},JR=JF;function eO(r,e){let t=0;return async(...i)=>{let s=Date.now();if(s-t>=e)return t=s,await r(...i)}}var X=class X{constructor(){}static get app(){if(!X._app)throw new Error("[Pixi\u2019VN] CanvasManagerStatic.app is undefined");return X._app}static get gameLayer(){let e=this.app.stage.getChildByLabel(qr);return e||(e=new q,e.label=qr,this.app.stage.addChild(e)),e}static async init(e,t,i,s,n){return X.canvasWidth=t,X.canvasHeight=i,X._app=new Uh,X.app.init({resolution:window.devicePixelRatio||1,autoDensity:true,width:t,height:i,...s}).then(()=>{let{app:o=X.app,extensions:a=[],...u}=n||{};qR({app:o,extensions:[JR,...a],...u}),X._isInitialized=true,X.addCanvasIntoHTMLElement(e),window.addEventListener("resize",X.resize),X.resize(),X.gameLayer;})}static addCanvasIntoHTMLElement(e){X._isInitialized?e.appendChild(X.app.canvas):H.error("GameWindowManager is not initialized");}static addHtmlLayer(e,t,i={position:"absolute",pointerEvents:"none"}){let s=document.createElement("div");s.setAttribute("id",e),s.style.position=i.position,s.style.pointerEvents=i.pointerEvents;let n=t.appendChild(s);return X.htmlLayers.push(s),X.resize(),n}static removeHtmlLayer(e){let t=X.htmlLayers.find(i=>i.id===e);t&&(t.remove(),X.htmlLayers=X.htmlLayers.filter(i=>i.id!==e));}static getHtmlLayer(e){return X.htmlLayers.find(t=>t.id===e)}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/X.canvasWidth,t/X.canvasHeight)}static get screenWidth(){return Math.floor(X.screenScale*X.canvasWidth)}static get screenHeight(){return Math.floor(X.screenScale*X.canvasHeight)}static get horizontalMargin(){return (Math.max(document.documentElement.clientWidth,window.innerWidth||0)-X.screenWidth)/2}static get verticalMargin(){return (Math.max(document.documentElement.clientHeight,window.innerHeight||0)-X.screenHeight)/2}static async resize(){await eO(async()=>{if(X._isInitialized){let i=X.app.canvas.style;i.width=`${X.screenWidth}px`,i.height=`${X.screenHeight}px`,i.marginLeft=`${X.horizontalMargin}px`,i.marginRight=`${X.horizontalMargin}px`,i.marginTop=`${X.verticalMargin}px`,i.marginBottom=`${X.verticalMargin}px`;}let t=X.htmlLayers.map(i=>{i.style.width=`${X.screenWidth}px`,i.style.height=`${X.screenHeight}px`,i.style.marginLeft=`${X.horizontalMargin}px`,i.style.marginRight=`${X.horizontalMargin}px`,i.style.marginTop=`${X.verticalMargin}px`,i.style.marginBottom=`${X.verticalMargin}px`;});await Promise.all(t);},10)();}static get childrenAliasesOrder(){return X.gameLayer.children.filter(e=>e.label).sort((e,t)=>X.gameLayer.getChildIndex(e)-X.gameLayer.getChildIndex(t)).map(e=>e.label)}static get currentTickersWithoutCreatedBySteps(){return Object.fromEntries(Object.entries(X._currentTickers).filter(([e,t])=>!t.createdByTicketSteps))}static generateTickerId(e){try{return (0,eM.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]),X._currentTickersTimeouts[i]={aliases:e,ticker:t,canBeDeletedBeforeEnd:s};}static removeTickerTimeoutInfo(e){typeof e!="string"&&(e=e.toString()),X._currentTickersTimeouts[e]&&delete X._currentTickersTimeouts[e];}static removeTickerTimeout(e){typeof e!="string"&&(e=e.toString()),clearTimeout(Number(e)),X.removeTickerTimeoutInfo(e);}static removeTickerTimeoutsByAlias(e,t){Object.entries(X._currentTickersTimeouts).forEach(([i,s])=>{let n=s.aliases.filter(o=>o!==e);if(n.length===0){let o=s.canBeDeletedBeforeEnd;(!t||o)&&X.removeTickerTimeout(i);}else X._currentTickersTimeouts[i].aliases=n;});}};L(X,"_app"),L(X,"htmlLayers",[]),L(X,"canvasWidth",300),L(X,"canvasHeight",300),L(X,"_isInitialized",false),L(X,"_currentTickers",{}),L(X,"_currentTickersSequence",{}),L(X,"_currentTickersTimeouts",{}),L(X,"_tickersToCompleteOnStepEnd",{tikersIds:[],stepAlias:[]}),L(X,"_tickersOnPause",{});var R=X;we();var kl=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,sM=new Set,CE=typeof process=="object"&&process?process:{},nM=(r,e,t,i)=>{typeof CE.emitWarning=="function"?CE.emitWarning(r,e,t,i):console.error(`[${t}] ${e}: ${r}`);},ab=globalThis.AbortController,tM=globalThis.AbortSignal;if(typeof ab>"u"){tM=class{constructor(){L(this,"onabort");L(this,"_onabort",[]);L(this,"reason");L(this,"aborted",false);}addEventListener(i,s){this._onabort.push(s);}},ab=class{constructor(){L(this,"signal",new tM);e();}abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=true;for(let s of this.signal._onabort)s(i);this.signal.onabort?.(i);}}};let r=CE.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{r&&(r=false,nM("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e));};}var tO=r=>!sM.has(r),fn=r=>r&&r===Math.floor(r)&&r>0&&isFinite(r),oM=r=>fn(r)?r<=Math.pow(2,8)?Uint8Array:r<=Math.pow(2,16)?Uint16Array:r<=Math.pow(2,32)?Uint32Array:r<=Number.MAX_SAFE_INTEGER?Fl:null:null,Fl=class extends Array{constructor(e){super(e),this.fill(0);}},Ol,ga=class ga{constructor(e,t){L(this,"heap");L(this,"length");if(!v(ga,Ol))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0;}static create(e){let t=oM(e);if(!t)return [];K(ga,Ol,true);let i=new ga(e,t);return K(ga,Ol,false),i}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}};Ol=new WeakMap,pe(ga,Ol,false);var wE=ga,rM,iM,jr,fr,Kr,xa,Zr,Gl,Ul,mt,Qr,ct,He,se,Yt,pr,Lt,vt,Jr,Tt,ei,ti,mr,ri,xn,$t,Ll,G,PE,_a,Zi,Md,gr,aM,ba,Nl,Dd,pn,mn,BE,nb,ob,Ne,RE,Rd,gn,ME,DE=class DE{constructor(e){pe(this,G);pe(this,jr);pe(this,fr);pe(this,Kr);pe(this,xa);pe(this,Zr);pe(this,Gl);pe(this,Ul);L(this,"ttl");L(this,"ttlResolution");L(this,"ttlAutopurge");L(this,"updateAgeOnGet");L(this,"updateAgeOnHas");L(this,"allowStale");L(this,"noDisposeOnSet");L(this,"noUpdateTTL");L(this,"maxEntrySize");L(this,"sizeCalculation");L(this,"noDeleteOnFetchRejection");L(this,"noDeleteOnStaleGet");L(this,"allowStaleOnFetchAbort");L(this,"allowStaleOnFetchRejection");L(this,"ignoreFetchAbort");pe(this,mt);pe(this,Qr);pe(this,ct);pe(this,He);pe(this,se);pe(this,Yt);pe(this,pr);pe(this,Lt);pe(this,vt);pe(this,Jr);pe(this,Tt);pe(this,ei);pe(this,ti);pe(this,mr);pe(this,ri);pe(this,xn);pe(this,$t);pe(this,Ll);pe(this,_a,()=>{});pe(this,Zi,()=>{});pe(this,Md,()=>{});pe(this,gr,()=>false);pe(this,ba,e=>{});pe(this,Nl,(e,t,i)=>{});pe(this,Dd,(e,t,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});L(this,rM,"LRUCache");let{max:t=0,ttl:i,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:u,dispose:l,onInsert:c,disposeAfter:h,noDisposeOnSet:d,noUpdateTTL:p,maxSize:_=0,maxEntrySize:b=0,sizeCalculation:g,fetchMethod:m,memoMethod:y,noDeleteOnFetchRejection:T,noDeleteOnStaleGet:S,allowStaleOnFetchRejection:w,allowStaleOnFetchAbort:A,ignoreFetchAbort:P}=e;if(t!==0&&!fn(t))throw new TypeError("max option must be a nonnegative integer");let N=t?oM(t):Array;if(!N)throw new Error("invalid max value: "+t);if(K(this,jr,t),K(this,fr,_),this.maxEntrySize=b||v(this,fr),this.sizeCalculation=g,this.sizeCalculation){if(!v(this,fr)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(y!==void 0&&typeof y!="function")throw new TypeError("memoMethod must be a function if defined");if(K(this,Ul,y),m!==void 0&&typeof m!="function")throw new TypeError("fetchMethod must be a function if specified");if(K(this,Gl,m),K(this,xn,!!m),K(this,ct,new Map),K(this,He,new Array(t).fill(void 0)),K(this,se,new Array(t).fill(void 0)),K(this,Yt,new N(t)),K(this,pr,new N(t)),K(this,Lt,0),K(this,vt,0),K(this,Jr,wE.create(t)),K(this,mt,0),K(this,Qr,0),typeof l=="function"&&K(this,Kr,l),typeof c=="function"&&K(this,xa,c),typeof h=="function"?(K(this,Zr,h),K(this,Tt,[])):(K(this,Zr,void 0),K(this,Tt,void 0)),K(this,ri,!!v(this,Kr)),K(this,Ll,!!v(this,xa)),K(this,$t,!!v(this,Zr)),this.noDisposeOnSet=!!d,this.noUpdateTTL=!!p,this.noDeleteOnFetchRejection=!!T,this.allowStaleOnFetchRejection=!!w,this.allowStaleOnFetchAbort=!!A,this.ignoreFetchAbort=!!P,this.maxEntrySize!==0){if(v(this,fr)!==0&&!fn(v(this,fr)))throw new TypeError("maxSize must be a positive integer if specified");if(!fn(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");Y(this,G,aM).call(this);}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!S,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=fn(s)||s===0?s:1,this.ttlAutopurge=!!n,this.ttl=i||0,this.ttl){if(!fn(this.ttl))throw new TypeError("ttl must be a positive integer if specified");Y(this,G,PE).call(this);}if(v(this,jr)===0&&this.ttl===0&&v(this,fr)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!v(this,jr)&&!v(this,fr)){let D="LRU_CACHE_UNBOUNDED";tO(D)&&(sM.add(D),nM("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",D,DE));}}static unsafeExposeInternals(e){return {starts:v(e,ti),ttls:v(e,mr),sizes:v(e,ei),keyMap:v(e,ct),keyList:v(e,He),valList:v(e,se),next:v(e,Yt),prev:v(e,pr),get head(){return v(e,Lt)},get tail(){return v(e,vt)},free:v(e,Jr),isBackgroundFetch:t=>{var i;return Y(i=e,G,Ne).call(i,t)},backgroundFetch:(t,i,s,n)=>{var o;return Y(o=e,G,ob).call(o,t,i,s,n)},moveToTail:t=>{var i;return Y(i=e,G,Rd).call(i,t)},indexes:t=>{var i;return Y(i=e,G,pn).call(i,t)},rindexes:t=>{var i;return Y(i=e,G,mn).call(i,t)},isStale:t=>{var i;return v(i=e,gr).call(i,t)}}}get max(){return v(this,jr)}get maxSize(){return v(this,fr)}get calculatedSize(){return v(this,Qr)}get size(){return v(this,mt)}get fetchMethod(){return v(this,Gl)}get memoMethod(){return v(this,Ul)}get dispose(){return v(this,Kr)}get onInsert(){return v(this,xa)}get disposeAfter(){return v(this,Zr)}getRemainingTTL(e){return v(this,ct).has(e)?1/0:0}*entries(){for(let e of Y(this,G,pn).call(this))v(this,se)[e]!==void 0&&v(this,He)[e]!==void 0&&!Y(this,G,Ne).call(this,v(this,se)[e])&&(yield [v(this,He)[e],v(this,se)[e]]);}*rentries(){for(let e of Y(this,G,mn).call(this))v(this,se)[e]!==void 0&&v(this,He)[e]!==void 0&&!Y(this,G,Ne).call(this,v(this,se)[e])&&(yield [v(this,He)[e],v(this,se)[e]]);}*keys(){for(let e of Y(this,G,pn).call(this)){let t=v(this,He)[e];t!==void 0&&!Y(this,G,Ne).call(this,v(this,se)[e])&&(yield t);}}*rkeys(){for(let e of Y(this,G,mn).call(this)){let t=v(this,He)[e];t!==void 0&&!Y(this,G,Ne).call(this,v(this,se)[e])&&(yield t);}}*values(){for(let e of Y(this,G,pn).call(this))v(this,se)[e]!==void 0&&!Y(this,G,Ne).call(this,v(this,se)[e])&&(yield v(this,se)[e]);}*rvalues(){for(let e of Y(this,G,mn).call(this))v(this,se)[e]!==void 0&&!Y(this,G,Ne).call(this,v(this,se)[e])&&(yield v(this,se)[e]);}[(iM=Symbol.iterator,rM=Symbol.toStringTag,iM)](){return this.entries()}find(e,t={}){for(let i of Y(this,G,pn).call(this)){let s=v(this,se)[i],n=Y(this,G,Ne).call(this,s)?s.__staleWhileFetching:s;if(n!==void 0&&e(n,v(this,He)[i],this))return this.get(v(this,He)[i],t)}}forEach(e,t=this){for(let i of Y(this,G,pn).call(this)){let s=v(this,se)[i],n=Y(this,G,Ne).call(this,s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,v(this,He)[i],this);}}rforEach(e,t=this){for(let i of Y(this,G,mn).call(this)){let s=v(this,se)[i],n=Y(this,G,Ne).call(this,s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,v(this,He)[i],this);}}purgeStale(){let e=false;for(let t of Y(this,G,mn).call(this,{allowStale:true}))v(this,gr).call(this,t)&&(Y(this,G,gn).call(this,v(this,He)[t],"expire"),e=true);return e}info(e){let t=v(this,ct).get(e);if(t===void 0)return;let i=v(this,se)[t],s=Y(this,G,Ne).call(this,i)?i.__staleWhileFetching:i;if(s===void 0)return;let n={value:s};if(v(this,mr)&&v(this,ti)){let o=v(this,mr)[t],a=v(this,ti)[t];if(o&&a){let u=o-(kl.now()-a);n.ttl=u,n.start=Date.now();}}return v(this,ei)&&(n.size=v(this,ei)[t]),n}dump(){let e=[];for(let t of Y(this,G,pn).call(this,{allowStale:true})){let i=v(this,He)[t],s=v(this,se)[t],n=Y(this,G,Ne).call(this,s)?s.__staleWhileFetching:s;if(n===void 0||i===void 0)continue;let o={value:n};if(v(this,mr)&&v(this,ti)){o.ttl=v(this,mr)[t];let a=kl.now()-v(this,ti)[t];o.start=Math.floor(Date.now()-a);}v(this,ei)&&(o.size=v(this,ei)[t]),e.unshift([i,o]);}return e}load(e){this.clear();for(let[t,i]of e){if(i.start){let s=Date.now()-i.start;i.start=kl.now()-s;}this.set(t,i.value,i);}}set(e,t,i={}){var d,p,_,b;if(t===void 0)return this.delete(e),this;let{ttl:s=this.ttl,start:n,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:u}=i,{noUpdateTTL:l=this.noUpdateTTL}=i,c=v(this,Dd).call(this,e,t,i.size||0,a);if(this.maxEntrySize&&c>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=true),Y(this,G,gn).call(this,e,"set"),this;let h=v(this,mt)===0?void 0:v(this,ct).get(e);if(h===void 0)h=v(this,mt)===0?v(this,vt):v(this,Jr).length!==0?v(this,Jr).pop():v(this,mt)===v(this,jr)?Y(this,G,nb).call(this,false):v(this,mt),v(this,He)[h]=e,v(this,se)[h]=t,v(this,ct).set(e,h),v(this,Yt)[v(this,vt)]=h,v(this,pr)[h]=v(this,vt),K(this,vt,h),qd(this,mt)._++,v(this,Nl).call(this,h,c,u),u&&(u.set="add"),l=false,v(this,Ll)&&((d=v(this,xa))==null||d.call(this,t,e,"add"));else {Y(this,G,Rd).call(this,h);let g=v(this,se)[h];if(t!==g){if(v(this,xn)&&Y(this,G,Ne).call(this,g)){g.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:m}=g;m!==void 0&&!o&&(v(this,ri)&&((p=v(this,Kr))==null||p.call(this,m,e,"set")),v(this,$t)&&v(this,Tt)?.push([m,e,"set"]));}else o||(v(this,ri)&&((_=v(this,Kr))==null||_.call(this,g,e,"set")),v(this,$t)&&v(this,Tt)?.push([g,e,"set"]));if(v(this,ba).call(this,h),v(this,Nl).call(this,h,c,u),v(this,se)[h]=t,u){u.set="replace";let m=g&&Y(this,G,Ne).call(this,g)?g.__staleWhileFetching:g;m!==void 0&&(u.oldValue=m);}}else u&&(u.set="update");v(this,Ll)&&this.onInsert?.(t,e,t===g?"update":"replace");}if(s!==0&&!v(this,mr)&&Y(this,G,PE).call(this),v(this,mr)&&(l||v(this,Md).call(this,h,s,n),u&&v(this,Zi).call(this,u,h)),!o&&v(this,$t)&&v(this,Tt)){let g=v(this,Tt),m;for(;m=g?.shift();)(b=v(this,Zr))==null||b.call(this,...m);}return this}pop(){var e;try{for(;v(this,mt);){let t=v(this,se)[v(this,Lt)];if(Y(this,G,nb).call(this,!0),Y(this,G,Ne).call(this,t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(v(this,$t)&&v(this,Tt)){let t=v(this,Tt),i;for(;i=t?.shift();)(e=v(this,Zr))==null||e.call(this,...i);}}}has(e,t={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=t,n=v(this,ct).get(e);if(n!==void 0){let o=v(this,se)[n];if(Y(this,G,Ne).call(this,o)&&o.__staleWhileFetching===void 0)return false;if(v(this,gr).call(this,n))s&&(s.has="stale",v(this,Zi).call(this,s,n));else return i&&v(this,_a).call(this,n),s&&(s.has="hit",v(this,Zi).call(this,s,n)),true}else s&&(s.has="miss");return false}peek(e,t={}){let{allowStale:i=this.allowStale}=t,s=v(this,ct).get(e);if(s===void 0||!i&&v(this,gr).call(this,s))return;let n=v(this,se)[s];return Y(this,G,Ne).call(this,n)?n.__staleWhileFetching:n}async fetch(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:u=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:h=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:p=this.ignoreFetchAbort,allowStaleOnFetchAbort:_=this.allowStaleOnFetchAbort,context:b,forceRefresh:g=false,status:m,signal:y}=t;if(!v(this,xn))return m&&(m.fetch="get"),this.get(e,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:m});let T={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:o,noDisposeOnSet:a,size:u,sizeCalculation:l,noUpdateTTL:c,noDeleteOnFetchRejection:h,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:_,ignoreFetchAbort:p,status:m,signal:y},S=v(this,ct).get(e);if(S===void 0){m&&(m.fetch="miss");let w=Y(this,G,ob).call(this,e,S,T,b);return w.__returned=w}else {let w=v(this,se)[S];if(Y(this,G,Ne).call(this,w)){let U=i&&w.__staleWhileFetching!==void 0;return m&&(m.fetch="inflight",U&&(m.returnedStale=true)),U?w.__staleWhileFetching:w.__returned=w}let A=v(this,gr).call(this,S);if(!g&&!A)return m&&(m.fetch="hit"),Y(this,G,Rd).call(this,S),s&&v(this,_a).call(this,S),m&&v(this,Zi).call(this,m,S),w;let P=Y(this,G,ob).call(this,e,S,T,b),D=P.__staleWhileFetching!==void 0&&i;return m&&(m.fetch=A?"stale":"refresh",D&&A&&(m.returnedStale=true)),D?P.__staleWhileFetching:P.__returned=P}}async forceFetch(e,t={}){let i=await this.fetch(e,t);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(e,t={}){let i=v(this,Ul);if(!i)throw new Error("no memoMethod provided to constructor");let{context:s,forceRefresh:n,...o}=t,a=this.get(e,o);if(!n&&a!==void 0)return a;let u=i(e,a,{options:o,context:s});return this.set(e,u,o),u}get(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:o}=t,a=v(this,ct).get(e);if(a!==void 0){let u=v(this,se)[a],l=Y(this,G,Ne).call(this,u);return o&&v(this,Zi).call(this,o,a),v(this,gr).call(this,a)?(o&&(o.get="stale"),l?(o&&i&&u.__staleWhileFetching!==void 0&&(o.returnedStale=true),i?u.__staleWhileFetching:void 0):(n||Y(this,G,gn).call(this,e,"expire"),o&&i&&(o.returnedStale=true),i?u:void 0)):(o&&(o.get="hit"),l?u.__staleWhileFetching:(Y(this,G,Rd).call(this,a),s&&v(this,_a).call(this,a),u))}else o&&(o.get="miss");}delete(e){return Y(this,G,gn).call(this,e,"delete")}clear(){return Y(this,G,ME).call(this,"delete")}};jr=new WeakMap,fr=new WeakMap,Kr=new WeakMap,xa=new WeakMap,Zr=new WeakMap,Gl=new WeakMap,Ul=new WeakMap,mt=new WeakMap,Qr=new WeakMap,ct=new WeakMap,He=new WeakMap,se=new WeakMap,Yt=new WeakMap,pr=new WeakMap,Lt=new WeakMap,vt=new WeakMap,Jr=new WeakMap,Tt=new WeakMap,ei=new WeakMap,ti=new WeakMap,mr=new WeakMap,ri=new WeakMap,xn=new WeakMap,$t=new WeakMap,Ll=new WeakMap,G=new WeakSet,PE=function(){let e=new Fl(v(this,jr)),t=new Fl(v(this,jr));K(this,mr,e),K(this,ti,t),K(this,Md,(n,o,a=kl.now())=>{if(t[n]=o!==0?a:0,e[n]=o,o!==0&&this.ttlAutopurge){let u=setTimeout(()=>{v(this,gr).call(this,n)&&Y(this,G,gn).call(this,v(this,He)[n],"expire");},o+1);u.unref&&u.unref();}}),K(this,_a,n=>{t[n]=e[n]!==0?kl.now():0;}),K(this,Zi,(n,o)=>{if(e[o]){let a=e[o],u=t[o];if(!a||!u)return;n.ttl=a,n.start=u,n.now=i||s();let l=n.now-u;n.remainingTTL=a-l;}});let i=0,s=()=>{let n=kl.now();if(this.ttlResolution>0){i=n;let o=setTimeout(()=>i=0,this.ttlResolution);o.unref&&o.unref();}return n};this.getRemainingTTL=n=>{let o=v(this,ct).get(n);if(o===void 0)return 0;let a=e[o],u=t[o];if(!a||!u)return 1/0;let l=(i||s())-u;return a-l},K(this,gr,n=>{let o=t[n],a=e[n];return !!a&&!!o&&(i||s())-o>a});},_a=new WeakMap,Zi=new WeakMap,Md=new WeakMap,gr=new WeakMap,aM=function(){let e=new Fl(v(this,jr));K(this,Qr,0),K(this,ei,e),K(this,ba,t=>{K(this,Qr,v(this,Qr)-e[t]),e[t]=0;}),K(this,Dd,(t,i,s,n)=>{if(Y(this,G,Ne).call(this,i))return 0;if(!fn(s))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(s=n(i,t),!fn(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return s}),K(this,Nl,(t,i,s)=>{if(e[t]=i,v(this,fr)){let n=v(this,fr)-e[t];for(;v(this,Qr)>n;)Y(this,G,nb).call(this,true);}K(this,Qr,v(this,Qr)+e[t]),s&&(s.entrySize=i,s.totalCalculatedSize=v(this,Qr));});},ba=new WeakMap,Nl=new WeakMap,Dd=new WeakMap,pn=function*({allowStale:e=this.allowStale}={}){if(v(this,mt))for(let t=v(this,vt);!(!Y(this,G,BE).call(this,t)||((e||!v(this,gr).call(this,t))&&(yield t),t===v(this,Lt)));)t=v(this,pr)[t];},mn=function*({allowStale:e=this.allowStale}={}){if(v(this,mt))for(let t=v(this,Lt);!(!Y(this,G,BE).call(this,t)||((e||!v(this,gr).call(this,t))&&(yield t),t===v(this,vt)));)t=v(this,Yt)[t];},BE=function(e){return e!==void 0&&v(this,ct).get(v(this,He)[e])===e},nb=function(e){var n;let t=v(this,Lt),i=v(this,He)[t],s=v(this,se)[t];return v(this,xn)&&Y(this,G,Ne).call(this,s)?s.__abortController.abort(new Error("evicted")):(v(this,ri)||v(this,$t))&&(v(this,ri)&&((n=v(this,Kr))==null||n.call(this,s,i,"evict")),v(this,$t)&&v(this,Tt)?.push([s,i,"evict"])),v(this,ba).call(this,t),e&&(v(this,He)[t]=void 0,v(this,se)[t]=void 0,v(this,Jr).push(t)),v(this,mt)===1?(K(this,Lt,K(this,vt,0)),v(this,Jr).length=0):K(this,Lt,v(this,Yt)[t]),v(this,ct).delete(i),qd(this,mt)._--,t},ob=function(e,t,i,s){let n=t===void 0?void 0:v(this,se)[t];if(Y(this,G,Ne).call(this,n))return n;let o=new ab,{signal:a}=i;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let u={signal:o.signal,options:i,context:s},l=(b,g=false)=>{let{aborted:m}=o.signal,y=i.ignoreFetchAbort&&b!==void 0;if(i.status&&(m&&!g?(i.status.fetchAborted=true,i.status.fetchError=o.signal.reason,y&&(i.status.fetchAbortIgnored=true)):i.status.fetchResolved=true),m&&!y&&!g)return h(o.signal.reason);let T=p;return v(this,se)[t]===p&&(b===void 0?T.__staleWhileFetching?v(this,se)[t]=T.__staleWhileFetching:Y(this,G,gn).call(this,e,"fetch"):(i.status&&(i.status.fetchUpdated=true),this.set(e,b,u.options))),b},c=b=>(i.status&&(i.status.fetchRejected=true,i.status.fetchError=b),h(b)),h=b=>{let{aborted:g}=o.signal,m=g&&i.allowStaleOnFetchAbort,y=m||i.allowStaleOnFetchRejection,T=y||i.noDeleteOnFetchRejection,S=p;if(v(this,se)[t]===p&&(!T||S.__staleWhileFetching===void 0?Y(this,G,gn).call(this,e,"fetch"):m||(v(this,se)[t]=S.__staleWhileFetching)),y)return i.status&&S.__staleWhileFetching!==void 0&&(i.status.returnedStale=true),S.__staleWhileFetching;if(S.__returned===S)throw b},d=(b,g)=>{var y;let m=(y=v(this,Gl))==null?void 0:y.call(this,e,n,u);m&&m instanceof Promise&&m.then(T=>b(T===void 0?void 0:T),g),o.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(b(void 0),i.allowStaleOnFetchAbort&&(b=T=>l(T,true)));});};i.status&&(i.status.fetchDispatched=true);let p=new Promise(d).then(l,c),_=Object.assign(p,{__abortController:o,__staleWhileFetching:n,__returned:void 0});return t===void 0?(this.set(e,_,{...u.options,status:void 0}),t=v(this,ct).get(e)):v(this,se)[t]=_,_},Ne=function(e){if(!v(this,xn))return false;let t=e;return !!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof ab},RE=function(e,t){v(this,pr)[t]=e,v(this,Yt)[e]=t;},Rd=function(e){e!==v(this,vt)&&(e===v(this,Lt)?K(this,Lt,v(this,Yt)[e]):Y(this,G,RE).call(this,v(this,pr)[e],v(this,Yt)[e]),Y(this,G,RE).call(this,v(this,vt),e),K(this,vt,e));},gn=function(e,t){var s,n;let i=false;if(v(this,mt)!==0){let o=v(this,ct).get(e);if(o!==void 0)if(i=true,v(this,mt)===1)Y(this,G,ME).call(this,t);else {v(this,ba).call(this,o);let a=v(this,se)[o];if(Y(this,G,Ne).call(this,a)?a.__abortController.abort(new Error("deleted")):(v(this,ri)||v(this,$t))&&(v(this,ri)&&((s=v(this,Kr))==null||s.call(this,a,e,t)),v(this,$t)&&v(this,Tt)?.push([a,e,t])),v(this,ct).delete(e),v(this,He)[o]=void 0,v(this,se)[o]=void 0,o===v(this,vt))K(this,vt,v(this,pr)[o]);else if(o===v(this,Lt))K(this,Lt,v(this,Yt)[o]);else {let u=v(this,pr)[o];v(this,Yt)[u]=v(this,Yt)[o];let l=v(this,Yt)[o];v(this,pr)[l]=v(this,pr)[o];}qd(this,mt)._--,v(this,Jr).push(o);}}if(v(this,$t)&&v(this,Tt)?.length){let o=v(this,Tt),a;for(;a=o?.shift();)(n=v(this,Zr))==null||n.call(this,...a);}return i},ME=function(e){var t,i;for(let s of Y(this,G,mn).call(this,{allowStale:true})){let n=v(this,se)[s];if(Y(this,G,Ne).call(this,n))n.__abortController.abort(new Error("deleted"));else {let o=v(this,He)[s];v(this,ri)&&((t=v(this,Kr))==null||t.call(this,n,o,e)),v(this,$t)&&v(this,Tt)?.push([n,o,e]);}}if(v(this,ct).clear(),v(this,se).fill(void 0),v(this,He).fill(void 0),v(this,mr)&&v(this,ti)&&(v(this,mr).fill(0),v(this,ti).fill(0)),v(this,ei)&&v(this,ei).fill(0),K(this,Lt,0),K(this,vt,0),v(this,Jr).length=0,K(this,Qr,0),K(this,mt,0),v(this,$t)&&v(this,Tt)){let s=v(this,Tt),n;for(;n=s?.shift();)(i=v(this,Zr))==null||i.call(this,...n);}};var ub=DE;var Si=class{constructor(e){L(this,"cache");L(this,"map",new Map);this.cache=new ub({max:e.cacheSize}),this.map=new Map;}get[Symbol.iterator](){return this.map[Symbol.iterator]}get[Symbol.toStringTag](){return this.map[Symbol.toStringTag]}clear(){return this.cache.clear(),this.map.clear()}delete(e){let t=this.map.delete(e);return t&&this.cache.delete(e),t}get forEach(){return this.map.forEach}get(e){let t=this.cache.get(e);return t||this.map.get(e)}has(e){return this.map.has(e)}set(e,t){return this.map.set(e,t),this.cache.set(e,t),this}get size(){return this.map.size}entries(){return this.map.entries()}keys(){return this.map.keys()}values(){return this.map.values()}};var Id=new Si({cacheSize:5});function rO(r){return function(e){lb.add(e,r);}}var lb;(s=>{function r(n,o){o||(o=n.name),Id.get(o)&&H.warn(`CanvasElement "${o}" already registered`),n.prototype.pixivnId=o,Id.set(o,n);}s.add=r;function e(n){try{let o=Id.get(n);if(!o){H.error(`CanvasElement "${n}" not found, did you forget to register it with the canvasComponentDecorator?`);return}return new o,o}catch(o){H.error(`Error while getting CanvasElement "${n}"`,o);return}}s.get=e;function t(){return Array.from(Id.values())}s.values=t;function i(n){return Id.has(n)}s.has=i;})(lb||(lb={}));var qt=lb;var Hl=new Si({cacheSize:5});function iO(r){return function(e){cb.add(e,r);}}var cb;(n=>{function r(o,a){a||(a=o.name),Hl.get(a)&&H.info(`Event "${a}" already exists, it will be overwritten`),o.prototype.id=a,Hl.set(a,o);}n.add=r;function e(o){try{let a=Hl.get(o);if(!a){H.error(`Event "${o}" not found, did you forget to register it with the eventDecorator?`);return}return new a,a}catch(a){H.error(`Error while getting Event "${o}"`,a);return}}n.get=e;function t(o){try{let a=Hl.get(o);if(!a){H.error(`Event "${o}" not found, did you forget to register it with the eventDecorator?`);return}return new a}catch(a){H.error(`Error while getting Event "${o}"`,a);return}}n.getInstance=t;function i(){return Array.from(Hl.values())}n.values=i;function s(o){return Hl.has(o)}n.has=s;})(cb||(cb={}));var Qi=cb;async function hb(r){let e=sO(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 sO(r){try{let e=qt.get(r);return e?new e:void 0}catch(e){H.error(`Error while getting CanvasElement ${r}`,e);return}}we();function IE(r){return "memory"in r?r.memory:r instanceof ir?kE(r):r instanceof Ae?kd(r):ya(r)}function nO(r){return {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 uM(r,e){return {url:r.source.label,alias:e===r.source.label?void 0:e}}function ya(r,e){let t=oO(r,Ml),s=e?.childrenExport||false?r.children.sort((n,o)=>r.getChildIndex(n)-r.getChildIndex(o)).map(n=>IE(n)):[];return {pixivnId:t,elements:s,...nO(r)}}function kd(r){let e=ya(r),t=e.pixivnId??Dl,i=cM(r),s="textureAlias"in r?uM(r.texture,r.textureAlias):uM(r.texture);return {...e,pixivnId:t,textureData:s,anchor:{x:r.anchor.x,y:r.anchor.y},roundPixels:r.roundPixels,onEvents:i}}function kE(r){let e=ya(r),t=e.pixivnId??Il,i=cM(r);return {...e,pixivnId:t,anchor:{x:r.anchor.x,y:r.anchor.y},text:r.text,resolution:r.resolution,style:aO(r.style),roundPixels:r.roundPixels,onEvents:i}}function oO(r,e){return Object.prototype.hasOwnProperty.call(r,"pixivnId")?r.pixivnId:e}function cM(r){return "onEvents"in r?r.onEvents:{}}function lM(r,e){if(typeof r!="object"||r===null)return r;H.warn(`Unsupported property type for Text.style.${e}: FillGradient or FillPattern.`,r);}function aO(r){return {align:r.align,breakWords:r.breakWords,dropShadow:r.dropShadow,fill:lM(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:lM(r.stroke,"stroke"),textBaseline:r.textBaseline,trim:r.trim,whiteSpace:r.whiteSpace,wordWrap:r.wordWrap,wordWrapWidth:r.wordWrapWidth}}var va=class extends q{constructor(t){super(t);L(this,"pixivnId",Ml);L(this,"_onEvents",{});this.pixivnId=this.constructor.prototype.pixivnId||Ml;}get memory(){return ya(this,{childrenExport:true})}set memory(t){}async setMemory(t){return this.memory=t,await this.importChildren(t),await Ei(this,t)}async importChildren(t){for(let i=0;i<t.elements.length;i++){let s=t.elements[i],n=await hb(s);this.addChild(n);}}get onEvents(){return this._onEvents}onEvent(t,i){let s=i.prototype.id,n=Qi.getInstance(s);return this._onEvents[t]=s,n?super.on(t,()=>{n.fn(t,this);}):H.error(`Event ${s} not found`),this}on(t,i,s){return super.on(t,i,s)}};qt.add(va,Ml);async function Ei(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));}we();var Fd=class Fd{static init(e){Fd._getScreen=e.getScreen;}static get screen(){return Fd._getScreen()}};L(Fd,"_getScreen");var sr=Fd;function Ji(r,e,t,i,s,n=0){return i=i*(s?-1:1),r==="width"?e*(sr.screen.width-t)+i+n*t+(s?t:0):e*(sr.screen.height-t)+i+n*t+(s?t:0)}function Ai(r,e,t,i,s,n=0){return i=i*(s?-1:1),r==="width"?(e-i-n*t-(s?t:0))/(sr.screen.width-t):(e-i-n*t-(s?t:0))/(sr.screen.height-t)}function es(r,e){return r==="width"?e*sr.screen.width:e*sr.screen.height}function Ci(r,e){return r==="width"?e/sr.screen.width:e/sr.screen.height}function st(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),n=r.x*i-r.y*s,o=r.x*s+r.y*i;return r.x!==0&&Math.sign(n)!==Math.sign(r.x)&&(n=-n),r.y!==0&&Math.sign(o)!==Math.sign(r.y)&&(o=-o),{x:n,y:o}}else if(e>90&&e<180){let t=(e-90)*Math.PI/180,i=Math.cos(t),s=Math.sin(t),n=-r.y*s-r.x*i,o=r.y*i-r.x*s;return r.x!==0&&Math.sign(n)!==Math.sign(r.x)&&(n=-n),r.y!==0&&Math.sign(o)!==Math.sign(r.y)&&(o=-o),{x:n,y:o}}else if(e>180&&e<270){let t=(e-180)*Math.PI/180,i=Math.cos(t),s=Math.sin(t),n=-r.x*i+r.y*s,o=-r.x*s-r.y*i;return r.x!==0&&Math.sign(n)!==Math.sign(r.x)&&(n=-n),r.y!==0&&Math.sign(o)!==Math.sign(r.y)&&(o=-o),{x:n,y:o}}else if(e>270&&e<360){let t=(e-270)*Math.PI/180,i=Math.cos(t),s=Math.sin(t),n=r.y*s-r.x*i,o=-r.y*i-r.x*s;return r.x!==0&&Math.sign(n)!==Math.sign(r.x)&&(n=-n),r.y!==0&&Math.sign(o)!==Math.sign(r.y)&&(o=-o),{x:n,y:o}}return {x:0,y:0}}function FE(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 wi(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 Pi(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))}we();var uO=new RegExp(`(${$R.join("|")})$`);function Od(r){let e=rt.cache.has(r)?rt.get(r):null;return e instanceof C&&(r=e.source?.label||r),uO.test(r)}function Ta(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.percentageX===void 0&&(r.percentageX=r.xPercentagePosition),r.yPercentagePosition!=null&&r.percentageY===void 0&&(r.percentageY=r.yPercentagePosition),r.percentageX!=null&&(r.percentagePosition===void 0?(r.percentagePosition={x:r.percentageX},delete r.percentageX):(r.percentagePosition.x=r.percentageX,delete r.percentageX)),r.percentageY!=null&&(r.percentagePosition===void 0?(r.percentagePosition={y:r.percentageY},delete r.percentageY):(r.percentagePosition.y=r.percentageY,delete r.percentageY))),r)}we();we();async function Bi(r){if(r!=="EMPTY"){if(!r){H.error("Texture not found",r);return}if(rt.cache.has(r)){let e=rt.get(r);if(e)return e}return rt.load(r).then(e=>{if(!e){H.error("Texture not found",r);return}if(!(e instanceof C)){H.error("File not is a file",r);return}return e}).catch(e=>{H.error("Error loading file",e);})}}we();var ts=class r extends Ae{constructor(t){super(t);L(this,"pixivnId",Dl);L(this,"_textureAlias");L(this,"_onEvents",{});this.pixivnId=this.constructor.prototype.pixivnId||Dl;}get textureAlias(){return this._textureAlias?this._textureAlias:this.texture.source.label}set textureAlias(t){this._textureAlias=t;}get memory(){return kd(this)}set memory(t){}async setMemory(t){return this.memory=t,await Gd(this,t)}get onEvents(){return this._onEvents}onEvent(t,i){let s=i.prototype.id,n=Qi.getInstance(s);return this._onEvents[t]=s,n?(super.on(t,()=>{n.fn(t,this);}),this.interactive||(this.interactive=true,this.eventMode="dynamic")):H.error(`Event ${s} not found`),this}on(t,i,s){return super.on(t,i,s)}static from(t,i){let s=Ae.from(t,i),n=new r;return n.texture=s.texture,n}};qt.add(ts,Dl);async function Gd(r,e,t){let i=t?.ignoreTexture||false;if(await Ei(r,e),!i){if("textureImage"in e&&e.textureImage&&e.textureImage.image){let n=await Bi(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&&rt.resolver.hasKey(e.textureData.alias)&&(n=e.textureData.alias);let o=await Bi(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=Qi.get(o);a&&r.onEvent(n,a);}}var Pe=class r extends ts{constructor(t,i){t=Ta(t);let s,n;t&&"align"in t&&t?.align!==void 0&&(s=t.align,delete t.align),t&&"percentagePosition"in t&&t?.percentagePosition!==void 0&&(n=t.percentagePosition,delete t.percentagePosition);super(t);L(this,"pixivnId",EE);L(this,"_loadIsStarted",false);L(this,"_align");L(this,"_percentagePosition");i&&(this.textureAlias=i),s&&(this.align=s),n&&(this.percentagePosition=n);}get memory(){return {...kd(this),pixivnId:this.pixivnId,align:this._align,percentagePosition:this._percentagePosition,loadIsStarted:this._loadIsStarted}}set memory(t){}async setMemory(t){this.memory=t,await Ud(this,t),this.reloadPosition();}static from(t,i){let s=Ae.from(t,i),n=new r;return n.texture=s.texture,n}get loadIsStarted(){return this._loadIsStarted}async load(){return this._loadIsStarted=true,Bi(this.textureAlias).then(t=>{this._loadIsStarted=false,t&&(this.texture=t);}).catch(t=>{this._loadIsStarted=false,H.error("Error into ImageSprite.load()",t);})}set texture(t){super.texture=t,this.reloadPosition();}get texture(){return super.texture}get haveEmptyTexture(){return this.texture._source.label==="EMPTY"}set align(t){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),typeof t=="number"?(this._align.x=t,this._align.y=t):(t.x!==void 0&&(this._align.x=t.x),t.y!==void 0&&(this._align.y=t.y)),this.reloadPosition();}get align(){let t=st(this.pivot,this.angle),i=st(this.scale,this.angle);return {x:Ai("width",this.x,wi(this),t.x,i.x<0,this.anchor.x),y:Ai("height",this.y,Pi(this),t.y,i.y<0,this.anchor.y)}}set xAlign(t){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),this._align.x=t,this.reloadPosition();}get xAlign(){let t=st(this.pivot,this.angle),i=st(this.scale,this.angle);return Ai("width",this.x,wi(this),t.x,i.x<0,this.anchor.x)}set yAlign(t){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),this._align.y=t,this.reloadPosition();}get yAlign(){let t=st(this.pivot,this.angle),i=st(this.scale,this.angle);return Ai("height",this.y,Pi(this),t.y,i.y<0,this.anchor.y)}set percentagePosition(t){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),typeof t=="number"?(this._percentagePosition.x=t,this._percentagePosition.y=t):(t.x!==void 0&&(this._percentagePosition.x=t.x),t.y!==void 0&&(this._percentagePosition.y=t.y)),this.reloadPosition();}get percentagePosition(){return {x:Ci("width",this.x),y:Ci("height",this.y)}}get percentageX(){return Ci("width",this.x)}set percentageX(t){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.x=t,this.reloadPosition();}get percentageY(){return Ci("height",this.y)}set percentageY(t){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.y=t,this.reloadPosition();}set xPercentagePosition(t){this.percentageX=t;}get xPercentagePosition(){return this.percentageX}set yPercentagePosition(t){this.percentageY=t;}get yPercentagePosition(){return this.percentageY}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(t){t.type==="align"?this.align={x:t.x,y:t.y}:t.type==="percentage"?this.percentagePosition={x:t.x,y:t.y}:this.position.set(t.x,t.y);}reloadPosition(){if(this._align){let t=st(this.pivot,this.angle),i=st(this.scale,this.angle);this._align.x!==void 0&&(super.x=Ji("width",this._align.x,wi(this),t.x,i.x<0,this.anchor.x)),this._align.y!==void 0&&(super.y=Ji("height",this._align.y,Pi(this),t.y,i.y<0,this.anchor.y));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=es("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=es("height",this._percentagePosition.y)));}get position(){return super.position}set position(t){this._align=void 0,this._percentagePosition=void 0,super.position=t;}get x(){return super.x}set x(t){this._align=void 0,this._percentagePosition=void 0,super.x=t;}get y(){return super.y}set y(t){this._align=void 0,this._percentagePosition=void 0,super.y=t;}};qt.add(Pe,EE);async function Ud(r,e,t){let i=t?.ignoreTexture||false;return e=Ta(e),await Gd(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})}we();var Xt=class r extends Pe{constructor(t,i){let s,n,o;t&&"loop"in t&&t?.loop!==void 0&&(s=t.loop,delete t.loop),t&&"paused"in t&&t?.paused!==void 0&&(n=t.paused,delete t.paused),t&&"currentTime"in t&&t?.currentTime!==void 0&&(o=t.currentTime,delete t.currentTime);super(t,i);L(this,"pixivnId",AE);L(this,"_looop",false);L(this,"_paused",false);L(this,"_currentTime",0);s&&(this.loop=s),n&&(this.paused=n),o&&(this.currentTime=o);}get memory(){return {...super.memory,pixivnId:this.pixivnId,loop:this.loop,paused:this._paused,currentTime:this.currentTime}}set memory(t){}async setMemory(t){return this.memory=t,await OE(this,t)}static from(t,i){let s=Ae.from(t,i),n=new r;return n.texture=s.texture,n}async load(){await super.load(),this.loop=this._looop,this.currentTime=this._currentTime,this.paused=this._paused;}get loop(){return this.texture?.source?.resource?.loop||false}set loop(t){this._looop=t,this.texture?.source?.resource&&(this.texture.source.resource.loop=t);}get paused(){return this.texture?.source?.resource?.paused||false}set paused(t){t?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();}get currentTime(){return this.texture?.source?.resource?.currentTime||0}set currentTime(t){let i=this.duration;i&&t>=i&&(t=0),this._currentTime=t,this.texture?.source?.resource&&(this.texture.source.resource.currentTime=t);}restart(){this.currentTime=0;}get duration(){if(this.texture?.source?.resource)return this.texture.source.resource.duration||0}};qt.add(Xt,AE);async function OE(r,e,t){await Ud(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 Le=class extends va{constructor(t,i=[]){t=Ta(t);let s,n,o;t&&"anchor"in t&&t?.anchor!==void 0&&(o=t.anchor,delete t.anchor),t&&"align"in t&&t?.align!==void 0&&(s=t.align,delete t.align),t&&"percentagePosition"in t&&t?.percentagePosition!==void 0&&(n=t.percentagePosition,delete t.percentagePosition);super(t);L(this,"pixivnId",rb);L(this,"_loadIsStarted",false);L(this,"_anchor");L(this,"_align");L(this,"_percentagePosition");t=Ta(t),i&&i.forEach(a=>{let u;Od(a)?u=new Xt(void 0,a):u=new Pe(void 0,a),this.addChild(u);}),o&&(this.anchor=o),s&&(this.align=s),n&&(this.percentagePosition=n);}get memory(){return {...super.memory,pixivnId:rb,anchor:this._anchor,align:this._align,percentagePosition:this._percentagePosition,loadIsStarted:this._loadIsStarted}}set memory(t){}async setMemory(t){this.memory=t,await this.importChildren(t),await GE(this,t),this.reloadAnchor(),this.reloadPosition();}get loadIsStarted(){return this._loadIsStarted}async load(){this._loadIsStarted=true;let t=Array(this.children.length);for(let i=0;i<this.children.length;i++)t[i]=this.children[i].load();return Promise.all(t).then(()=>{this._loadIsStarted=false,this.reloadAnchor(),this.reloadPosition();}).catch(i=>{this._loadIsStarted=false,H.error("Error into ImageContainer.load()",i);})}get texture(){return this.children.length>0?this.children[0].texture:new C}get haveEmptyTexture(){return this.children.some(t=>t.texture._source.label==="EMPTY")}get anchor(){let t=super.pivot.x/this.width,i=super.pivot.y/this.height;return {x:t,y:i}}set anchor(t){typeof t=="number"?this._anchor={x:t,y:t}:this._anchor=t,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(t){this._anchor=void 0,super.pivot=t;}set align(t){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),typeof t=="number"?(this._align.x=t,this._align.y=t):(t.x!==void 0&&(this._align.x=t.x),t.y!==void 0&&(this._align.y=t.y)),this.reloadPosition();}get align(){let t=st(this.pivot,this.angle),i=st(this.scale,this.angle);return {x:Ai("width",this.x,wi(this),t.x,i.x<0,this.anchor.x),y:Ai("height",this.y,Pi(this),t.y,i.y<0,this.anchor.y)}}set xAlign(t){this._percentagePosition&&(this._percentagePosition=void 0),this._align===void 0&&(this._align={}),this._align.x=t,this.reloadPosition();}get xAlign(){let t=st(this.pivot,this.angle),i=st(this.scale,this.angle);return Ai("width",this.x,wi(this),t.x,i.x<0,this.anchor.x)}set yAlign(t){this._percentagePosition&&(this._percentagePosition=void 0),this._align===void 0&&(this._align={}),this._align.y=t,this.reloadPosition();}get yAlign(){let t=st(this.pivot,this.angle),i=st(this.scale,this.angle);return Ai("height",this.y,Pi(this),t.y,i.y<0,this.anchor.y)}set percentagePosition(t){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),typeof t=="number"?(this._percentagePosition.x=t,this._percentagePosition.y=t):(t.x!==void 0&&(this._percentagePosition.x=t.x),t.y!==void 0&&(this._percentagePosition.y=t.y)),this.reloadPosition();}get percentagePosition(){return {x:Ci("width",this.x),y:Ci("height",this.y)}}set percentageX(t){this._align&&(this._align=void 0),this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.x=t,this.reloadPosition();}get percentageX(){return Ci("width",this.x)}set xPercentagePosition(t){this.percentageX=t;}get xPercentagePosition(){return this.percentageX}set yPercentagePosition(t){this.percentageY=t;}get yPercentagePosition(){return this.percentageY}set percentageY(t){this._align&&(this._align=void 0),this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.y=t,this.reloadPosition();}get percentageY(){return Ci("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(t){t.type==="align"?this.align={x:t.x,y:t.y}:t.type==="percentage"?this.percentagePosition={x:t.x,y:t.y}:this.position.set(t.x,t.y);}reloadPosition(){if(this._align){let t=st(this.pivot,this.angle),i=st(this.scale,this.angle);this._align.x!==void 0&&(super.x=Ji("width",this._align.x,wi(this),t.x,i.x<0)),this._align.y!==void 0&&(super.y=Ji("height",this._align.y,Pi(this),t.y,i.y<0));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=es("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=es("height",this._percentagePosition.y)));}get position(){return super.position}set position(t){this._align=void 0,this._percentagePosition=void 0,super.position=t;}get x(){return super.x}set x(t){this._align=void 0,this._percentagePosition=void 0,super.x=t;}get y(){return super.y}set y(t){this._align=void 0,this._percentagePosition=void 0,super.y=t;}};qt.add(Le,rb);async function GE(r,e,t){e=Ta(e),Ei(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();}});}we();var Sa=class extends ir{constructor(t){super(t);L(this,"pixivnId",Il);L(this,"_onEvents",{});this.pixivnId=this.constructor.prototype.pixivnId||Il;}get memory(){return kE(this)}set memory(t){}async setMemory(t){return this.memory=t,await UE(this,t)}get onEvents(){return this._onEvents}onEvent(t,i){let s=i.prototype.id,n=Qi.getInstance(s);return this._onEvents[t]=s,n?(super.on(t,()=>{n.fn(t,this);}),this.interactive||(this.interactive=true,this.eventMode="dynamic")):H.error(`Event ${s} not found`),this}on(t,i,s){return super.on(t,i,s)}};qt.add(Sa,Il);async function UE(r,e){if(await Ei(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=Qi.get(i);s&&r.onEvent(t,s);}}var nr=class{constructor(e,t,i){L(this,"id","ticker_id_not_set");L(this,"args");L(this,"duration");L(this,"priority");this.args=e,this.duration=t,this.priority=i,this.id=this.constructor.prototype.id;}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]),B.onEndOfTicker(t,{aliasToRemoveAfter:s,tickerAliasToResume:n});}};var Vl=new Si({cacheSize:5});function lO(r){return function(e){db.add(e,r);}}var db;(n=>{function r(o,a){a||(a=o.name),Vl.get(a)&&H.info(`Ticker "${a}" already exists, it will be overwritten`),o.prototype.id=a,Vl.set(a,o);}n.add=r;function e(o){try{let a=Vl.get(o);if(!a){H.error(`Event "${o}" not found, did you forget to register it with the tickerDecorator?`);return}return a}catch(a){H.error(`Error while getting Event "${o}"`,a);return}}n.get=e;function t(o,a,u,l){try{let c=Vl.get(o);if(!c){H.error(`Ticker "${o}" not found, did you forget to register it with the tickerDecorator?`);return}return new c(a,u,l)}catch(c){H.error(`Error while getting Ticker "${o}"`,c);return}}n.getInstance=t;function i(){return Array.from(Vl.values())}n.values=i;function s(o){return Vl.has(o)}n.has=s;})(db||(db={}));var or=db;var zl="aliasToRemoveAfter";var Ld=class{get app(){return R.app}get gameLayer(){return R.gameLayer}get isInitialized(){return R._isInitialized}get htmlLayout(){return R.htmlLayers[0]}set htmlLayout(e){this.addHtmlLayer("ui",e);}get canvasWidth(){return R.canvasWidth}get canvasHeight(){return R.canvasHeight}set canvasWidth(e){R.canvasWidth=e;}set canvasHeight(e){R.canvasHeight=e;}get screen(){return this.app.screen}async init(e,t,i,s,n){if(typeof t=="number"&&typeof i=="number")return await R.init(e,t,i,s,n);if(typeof t!="number"&&typeof i!="number")return await R.init(e,t.width,t.height,t,i);throw new Error("Invalid parameters")}initializeHTMLLayout(e){this.addHtmlLayer("ui",e);}get children(){return R.gameLayer.children}async copyCanvasElementProperty(e,t){if(typeof t=="string"){let i=this.find(t);if(i)t=i;else {H.error(`Canvas element ${t} not found`);return}}if(typeof e=="string"){let i=this.find(e);if(i)e=i;else {H.error(`Canvas element ${e} not found`);return}}e instanceof q&&(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 Xt?await OE(t,e,{ignoreTexture:true}):t instanceof Pe?await Ud(t,e,{ignoreTexture:true}):t instanceof ts?await Gd(t,e,{ignoreTexture:true}):t instanceof Sa?await UE(t,e):t instanceof Le?await GE(t,e):t instanceof q&&await Ei(t,e);}transferTickers(e,t,i="move"){R._currentTickersSequence[e]&&(i==="move"?R._currentTickersSequence[t]=Ut(R._currentTickersSequence[e]):i==="duplicate"&&(R._currentTickersSequence[t]=Ut(R._currentTickersSequence[e]))),Object.entries(R._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(zl))){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(R._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));}),R._currentTickersSequence[t]&&Object.keys(R._currentTickersSequence[t]).forEach(s=>{this.runTickersSequence(t,s);}),i==="duplicate"&&R._currentTickersSequence[e]&&Object.keys(R._currentTickersSequence[e]).forEach(s=>{this.runTickersSequence(e,s);});}add(e,t,i={}){if(e===qr){H.error(`The alias ${qr} 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)?H.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));}remove(e,t={}){if(e===qr){H.error(`The alias ${qr} 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);});});}find(e){if(e===qr)return this.gameLayer;let t=this.gameLayer.getChildByLabel(e);if(t)return t}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 R._currentTickers}get currentTickersSteps(){return R._currentTickersSequence}addTicker(e,t){let i=t.id;if(typeof e=="string"&&(e=[e]),!or.getInstance(i,t.args,t.duration,t.priority)){H.error(`Ticker ${i} not found`);return}let s={fn:()=>{},id:i,args:Ut(t.args),canvasElementAliases:e,priority:t.priority,duration:t.duration,onEndOfTicker:()=>{}},n=R.generateTickerId(s);if(this.pushTicker(n,s,t),this.pushEndOfTicker(n,s,t),t.duration){let o=setTimeout(()=>{R.removeTickerTimeoutInfo(o),R._currentTickersTimeouts[o.toString()]&&this.onEndOfTicker(n,{aliasToRemoveAfter:zl in t.args?t.args.aliasToRemoveAfter||[]:[],tickerAliasToResume:"tickerAliasToResume"in t.args?t.args.tickerAliasToResume||[]:[],ignoreTickerSteps:true});},t.duration*1e3);R.addTickerTimeoutInfo(e,i,o.toString(),true);}return n}pushTicker(e,t,i){R._currentTickers[e]=t,t.fn=s=>{let n=R._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);};}addTickersSequence(e,t,i=0){if(t.length==0){H.warn("The steps of the tickers is empty");return}e in R._currentTickersSequence||(R._currentTickersSequence[e]={});let s={currentStepNumber:i,steps:t.map(o=>o===Bd||o.hasOwnProperty("type")&&o.type==="pause"?o:{ticker:o.id,args:Ut(o.args),duration:o.duration})},n=R.generateTickerId(s);return R._currentTickersSequence[e][n]=s,this.runTickersSequence(e,n),n}runTickersSequence(e,t){if(!R._currentTickersSequence[e]||!R._currentTickersSequence[e][t])return;let i=R._currentTickersSequence[e][t].steps[R._currentTickersSequence[e][t].currentStepNumber];if(i===Bd&&(i=R._currentTickersSequence[e][t].steps[0],R._currentTickersSequence[e][t].currentStepNumber=0,i===Bd)){H.error("TikersSteps has a RepeatType in the first step");return}if(i.hasOwnProperty("type")&&i.type==="pause"){let u=setTimeout(()=>{let l=R._currentTickersTimeouts[u.toString()];l&&l.aliases.forEach(c=>{this.nextTickerStep(c,t);}),R.removeTickerTimeoutInfo(u);},i.duration*1e3);R.addTickerTimeoutInfo(e,"steps",u.toString(),false);return}let s=or.getInstance(i.ticker,i.args,i.duration,i.priority);if(!s){H.error(`Ticker ${i.ticker} not found`);return}let n=s.id,o={fn:()=>{},id:n,args:Ut(s.args),canvasElementAliases:[e],priority:s.priority,duration:s.duration,createdByTicketSteps:{canvasElementAlias:e,id:t},onEndOfTicker:()=>{}},a=R.generateTickerId(o);if(this.pushTicker(a,o,s),s.duration){let u=setTimeout(()=>{let l=R._currentTickersTimeouts[u.toString()];l&&(this.onEndOfTicker(a,{aliasToRemoveAfter:zl in s.args?s.args.aliasToRemoveAfter||[]:[],tickerAliasToResume:"tickerAliasToResume"in s.args?s.args.tickerAliasToResume||[]:[],ignoreTickerSteps:true}),l.aliases.forEach(c=>{this.nextTickerStep(c,t);})),R.removeTickerTimeoutInfo(u);},s.duration*1e3);R.addTickerTimeoutInfo(e,n,u.toString(),false);}}nextTickerStep(e,t){if(R._currentTickersSequence[e]&&R._currentTickersSequence[e][t]){let i=R._currentTickersSequence[e][t];i.currentStepNumber+1<i.steps.length?(i.currentStepNumber++,R._currentTickersSequence[e][t]=i,this.runTickersSequence(e,t)):t&&R._currentTickersSequence[e]&&R._currentTickersSequence[e][t]&&(delete R._currentTickersSequence[e][t],Object.entries(R._currentTickers).forEach(([s,n])=>{n.createdByTicketSteps?.canvasElementAlias===e&&n.createdByTicketSteps.id===t&&this.removeTicker(s);}));}}onEndOfTicker(e,t){let i=R._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(R._currentTickers).forEach(([n,o])=>{o.canvasElementAliases.includes(s)&&(o.canvasElementAliases.length===1?this.removeTicker(n):o.canvasElementAliases=o.canvasElementAliases.filter(a=>a!==s));}),R._currentTickersSequence[s]&&delete R._currentTickersSequence[s],R.removeTickerTimeoutsByAlias(s,false);});return}let i;typeof t=="string"?i=t:t instanceof nr?i=t.id:i=t.prototype.id,e.forEach(s=>{R._currentTickersSequence[s]&&Object.entries(R._currentTickersSequence[s]).forEach(([n,o])=>{o.steps.find(a=>typeof a=="object"&&"ticker"in a&&a.ticker===i)&&delete R._currentTickersSequence[s][n];});}),Object.entries(R._currentTickers).forEach(([s,n])=>{n.id===i&&(R._currentTickers[s].canvasElementAliases=n.canvasElementAliases.filter(o=>!e.includes(o)));}),Object.entries(R._currentTickersTimeouts).forEach(([s,n])=>{n.ticker===i&&n.canBeDeletedBeforeEnd&&(R._currentTickersTimeouts[s].aliases=n.aliases.filter(o=>!e.includes(o)));}),this.removeTickersWithoutAssociatedCanvasElement();}removeTickersWithoutAssociatedCanvasElement(){Object.entries(R._currentTickers).forEach(([e,t])=>{t.canvasElementAliases=t.canvasElementAliases.filter(i=>this.find(i)),t.canvasElementAliases.length===0&&this.onEndOfTicker(e,{aliasToRemoveAfter:zl in t.args?t.args.aliasToRemoveAfter:[],tickerAliasToResume:"tickerAliasToResume"in t.args?t.args.tickerAliasToResume:[],ignoreTickerSteps:true});}),Object.entries(R._currentTickersSequence).forEach(([e,t])=>{t===void 0&&delete R._currentTickersSequence[e];}),Object.entries(R._currentTickersTimeouts).forEach(([e,{aliases:t}])=>{t.length===0&&R.removeTickerTimeout(e);});}removeAllTickers(){R._currentTickersSequence={},Object.keys(R._currentTickers).forEach(e=>{this.removeTicker(e);}),R._currentTickers={};for(let e in R._currentTickersTimeouts)R.removeTickerTimeout(e);R._tickersToCompleteOnStepEnd={tikersIds:[],stepAlias:[]},R._tickersOnPause={};}removeTicker(e){typeof e=="string"&&(e=[e]),e.forEach(t=>{let i=R._currentTickers[t];if(i){if(i.args.hasOwnProperty(zl)){let s=i.args.aliasToRemoveAfter;this.remove(s);}this.app.ticker.remove(i.fn),delete R._currentTickers[t];}});}pauseTicker(e,t={}){let i=R._tickersOnPause[e];if(!i){R._tickersOnPause[e]=t;return}t.tickerIdsExcluded&&(i.tickerIdsExcluded?R._tickersOnPause[e].tickerIdsExcluded=[...i.tickerIdsExcluded,...t.tickerIdsExcluded]:R._tickersOnPause[e].tickerIdsExcluded=t.tickerIdsExcluded),t.tickerIdsIncluded&&(i.tickerIdsIncluded?R._tickersOnPause[e].tickerIdsIncluded=[...i.tickerIdsIncluded,...t.tickerIdsIncluded]:R._tickersOnPause[e].tickerIdsIncluded=t.tickerIdsIncluded);}resumeTicker(e){typeof e=="string"&&(e=[e]),e.forEach(t=>{delete R._tickersOnPause[t];});}isTickerPaused(e,t){let i=R._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?R._tickersToCompleteOnStepEnd.stepAlias.push({id:e.id,alias:e.alias}):R._tickersToCompleteOnStepEnd.tikersIds.push({id:e.id});}forceCompletionOfTicker(e,t){if(t){let i=R._currentTickersSequence[t];i&&i[e]&&(i[e].steps.includes(Bd)?H.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=or.getInstance(s.ticker,s.args,s.duration,s.priority);n&&n.onEndOfTicker([t],e,s.args);}}));}else {let i=R._currentTickers[e];i&&i.onEndOfTicker();}}addLayer(e,t){if(e===qr){H.error(`The alias ${qr} is reserved`);return}return t.label=e,R.app.stage.addChild(t)}getLayer(e){return R.app.stage.getChildByLabel(e)}removeLayer(e){R.app.stage.getChildrenByLabel(e);}addHtmlLayer(e,t,i){return R.addHtmlLayer(e,t,i)}removeHtmlLayer(e){return R.removeHtmlLayer(e)}getHtmlLayer(e){return R.getHtmlLayer(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]=IE(t));}),{tickers:Ut(R.currentTickersWithoutCreatedBySteps),tickersSteps:Ut(R._currentTickersSequence),elements:Ut(e),stage:Ut(ya(this.gameLayer)),elementAliasesOrder:Ut(R.childrenAliasesOrder),tickersOnPause:Ut(R._tickersOnPause),tickersToCompleteOnStepEnd:Ut(R._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=>hb(i[a])),o=await Promise.all(n);this.clear(),o.forEach((a,u)=>{let l=s[u];this.add(l,a),R.childrenAliasesOrder.push(l);});}else {H.error("The data does not have the properties elementAliasesOrder and elements");return}if(e.hasOwnProperty("stage")&&e.hasOwnProperty("stage")?Ei(this.gameLayer,e.stage,{ignoreScale:!0}):H.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=or.getInstance(n.id,n.args,n.duration,n.priority);if(a){let u=this.addTicker(o,a);u&&(t[s]=u);}else H.error(`Ticker ${n.id} not found`);});}if(e.hasOwnProperty("tickersSteps")){let i=e.tickersSteps;Object.entries(i).forEach(([s,n])=>{R._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));}),R._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}));R._tickersToCompleteOnStepEnd={tikersIds:s,stepAlias:n};}}catch(t){H.error("Error importing data",t);}}};var fb=class{constructor(){L(this,"id","event_id_not_set");this.id=this.constructor.prototype.id;}fn(e,t){throw new Error("[Pixi\u2019VN] The method CanvasEvent.fn() must be overridden")}};var pb=class{constructor(){L(this,"pixivnId","canvas_element_id_not_set");}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")}};we();we();function _n(r){return (r instanceof Pe||r instanceof Le)&&r.haveEmptyTexture?false:!(r instanceof Ae&&r.texture?.label=="EMPTY")}function bn(r,e,t){let{limit:i}=t;r[e]===void 0||!t||r[e]===i||(typeof r[e]=="number"?t.type==="linear"?r[e]=LE(r[e],t):t.type==="exponential"&&(r[e]=NE(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=LE(r[e].x,t),r[e].y=LE(r[e].y,t)):t.type==="exponential"&&(r[e].x=NE(r[e].x,t),r[e].y=NE(r[e].y,t))));}function LE(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 NE(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 cO=5,rs=class extends nr{constructor(e={},t,i){super(e,t,i);}fn(e,t,i,s){t.speed===void 0&&(t.duration===void 0?t.speed=cO: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=B.find(c);return !(!h||o&&!_n(h))}).forEach(c=>{let h=B.find(c);if(h&&h instanceof q){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)){H.warn("The speed of the FadeAlphaTicker must be greater than 0."),this.onEndOfTicker(c,s,t,{editAlpha:false});return}}}),a&&bn(t,"speed",a);}onEndOfTicker(e,t,i,s={editAlpha:true}){typeof e=="string"&&(e=[e]),e.forEach(n=>{let o=B.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}};or.add(rs);we();var hO=10;function dO(r,e){let t=Ut(r.destination);if(t.type==="align"){let i,s;e instanceof Ae&&(i=e.anchor.x,s=e.anchor.y);let n=st(e.pivot,e.angle),o=st(e.scale,e.angle);t.x=Ji("width",t.x,wi(e),n.x,o.x<0,i),t.y=Ji("height",t.y,Pi(e),n.y,o.y<0,s);}return t.type==="percentage"&&(t.x=es("width",t.x),t.y=es("height",t.y)),t}var xr=class extends nr{fn(e,t,i,s){t.speed===void 0&&(t.speed=hO);let{speed:n,startOnlyIfHaveTexture:o,speedProgression:a}=t;i.filter(u=>{let l=B.find(u);return !(!l||o&&!_n(l))}).forEach(u=>{let l=B.find(u);if(l&&l instanceof q){let c=dO(t,l),h=c.x-l.x,d=c.y-l.y,p=h>0?1:-1,_=d>0?1:-1,b,g;if(typeof n=="number"){let m=this.speedConvert(n);h===0||d===0?b=g=m:(b=Math.abs(h/(h+d))*m,g=Math.abs(d/(h+d))*m);}else b=this.speedConvert(n.x),g=this.speedConvert(n.y);if(b>0){l.x+=p*b*e.deltaTime;let m=c.x-l.x;(p<0&&m>0||p>0&&m<0)&&(l.x=c.x);}if(g>0){l.y+=_*g*e.deltaTime;let m=c.y-l.y;(_<0&&m>0||_>0&&m<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&&g<1e-5&&!(a&&a.type=="linear"&&a.amt!=0)){H.warn("The speed of the MoveTicker must be greater than 0."),this.onEndOfTicker(u,s,t,{editPosition:false});return}}}),a&&bn(t,"speed",a);}onEndOfTicker(e,t,i,s={editPosition:true}){typeof e=="string"&&(e=[e]),e.forEach(n=>{let o=B.find(n);if(o){let a=i.destination;s.editPosition&&(o instanceof Pe||o instanceof Le?o.positionInfo=a:(o.x=a.x,o.y=a.y));}}),super.onEndOfTicker(e,t,i);}speedConvert(e){return e*(66/400)}};or.add(xr);we();var fO=1,Nd=class extends nr{constructor(e={},t,i){super(e,t,i);}fn(e,t,i,s){t.speed===void 0&&(t.speed=fO);let{clockwise:n=true,speedProgression:o,limit:a}=t,u=this.speedConvert(t.speed);i.filter(l=>{let c=B.find(l);return !(!c||t.startOnlyIfHaveTexture&&!_n(c))}).forEach(l=>{let c=B.find(l);if(c&&c instanceof q&&(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))){H.warn("The speed of the RotateTicker must be greater than 0."),this.onEndOfTicker(l,s,t,{editRotation:false});return}}),o&&bn(t,"speed",o);}onEndOfTicker(e,t,i,s={editRotation:true}){let{limit:n}=i;typeof e=="string"&&(e=[e]),e.forEach(o=>{let a=B.find(o);a&&s.editRotation&&n!==void 0&&(a.angle=n);}),super.onEndOfTicker(e,t,i);}speedConvert(e){return e/100}};or.add(Nd);we();var pO=10,yn=class extends nr{constructor(e={},t,i){super(e,t,i);}fn(e,t,i,s){t.speed===void 0&&(t.speed=pO);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(d=>{let p=B.find(d);return !(!p||a&&!_n(p))}).forEach(d=>{let p=B.find(d);if(p&&p instanceof q){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(d,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(d,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)){H.warn("The speed of the ZoomTicker must be greater than 0."),this.onEndOfTicker(d,s,t,{editScale:false});return}}}),u&&bn(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=B.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}}};or.add(yn);async function mO(r,e={},t){let i=B.find(r);if(!i){H.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){H.error("The number of shocks must be at least 3.");return}let h=Math.floor(c/2),d=Math.ceil(c/2),p=[];for(let g=0;g<h;g++){let m={x:s.x,y:s.y},y=l*(g+1)/h;u==="horizontal"?g%2!==0?m.x=s.x+y:m.x=s.x-y:g%2!==0?m.y=s.y+y:m.y=s.y-y,p.push(new xr({destination:m,speed:n,speedProgression:o,startOnlyIfHaveTexture:a},void 0,t));}let _=h%2===0;for(let g=d;g>0;g--){let m={x:s.x,y:s.y},y=l*(g+1)/(d-1);u==="horizontal"?g%2===0&&!_||g%2!==0&&_?m.x=s.x-y:m.x=s.x+y:g%2===0&&!_||g%2!==0&&_?m.y=s.y-y:m.y=s.y+y,p.push(new xr({destination:m,speed:n,speedProgression:o,startOnlyIfHaveTexture:a},void 0,t));}p.push(new xr({destination:s,speed:n,speedProgression:o,startOnlyIfHaveTexture:a,tickerAliasToResume:r},void 0,t));let b=B.addTickersSequence(r,p);b&&(B.completeTickerOnStepEnd({id:b,alias:r}),B.pauseTicker(r,{tickerIdsExcluded:[b]}));}function mb(r,e,t){let i=new Le(t,e);return B.add(r,i),i}async function gO(r,e,t){let i=new Le(t,e);return await i.load(),B.add(r,i),i}we();function gb(r,e,t){if(!e)if(rt.resolver.hasKey(r))e=r;else throw new Error(`The image ${r} does not exist in the cache.`);let i=new Pe(t,e);return B.add(r,i),i}async function xO(r){if(!Array.isArray(r))return [r];let e=Array(r.length);for(let t=0;t<r.length;t++)e[t]=Bi(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 _O(r,e,t){if(!e)if(rt.resolver.hasKey(r))e=r;else throw new Error(`The image ${r} does not exist in the cache.`);let i=new Pe(t,e);return await i.load(),B.add(r,i),i}we();function xb(r,e,t){if(!e)if(rt.resolver.hasKey(r))e=r;else throw new Error(`The video ${r} does not exist in the cache.`);let i=new Xt(t,e);return B.add(r,i),i}async function bO(r){if(!Array.isArray(r))return [r];let e=Array(r.length);for(let t=0;t<r.length;t++)e[t]=Bi(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 yO(r,e,t){if(!e)if(rt.resolver.hasKey(r))e=r;else throw new Error(`The video ${r} does not exist in the cache.`);let i=new Xt(t,e);return await i.load(),B.add(r,i),i}function Hd(r,e){if(typeof e=="string")return Od(e)?xb(r,e):gb(r,e);if(Array.isArray(e))return mb(r,e);if(typeof e=="object"&&"value"in e&&"options"in e){if(typeof e.value=="string")return Od(e.value)?xb(r,e.value,e.options):gb(r,e.value,e.options);if(Array.isArray(e.value))return mb(r,e.value,e.options)}return B.add(r,e),e}async function hM(r,e,t={},i){let{mustBeCompletedBeforeNextStep:s=true,tickerAliasToResume:n=[]}=t,o=[];e||(e=r),typeof n=="string"&&(n=[n]);let a;if(B.find(r)&&(a=r+"_temp_disolve",B.editAlias(r,a)),e=Hd(r,e),a&&B.copyCanvasElementProperty(a,r),a&&B.transferTickers(a,r,"duplicate"),e.alpha=0,a){let c=_b(a,t,i);c&&(o.push(...c),B.pauseTicker(a,{tickerIdsIncluded:c}),n.push(a));}let u=new rs({...t,type:"show",tickerAliasToResume:n,startOnlyIfHaveTexture:true},void 0,i),l=B.addTicker(r,u);if(l&&(s&&B.completeTickerOnStepEnd({id:l}),o.push(l)),(e instanceof Pe||e instanceof Le)&&e.haveEmptyTexture&&await e.load(),o.length>0)return o}function _b(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 rs({...e,type:"hide",aliasToRemoveAfter:s,startOnlyIfHaveTexture:true},void 0,t),o=B.addTicker(r,n);if(o)return i&&B.completeTickerOnStepEnd({id:o}),[o]}async function vO(r,e,t={},i){let{mustBeCompletedBeforeNextStep:s=true,aliasToRemoveAfter:n=[]}=t,o=[];if(e||(e=r),typeof n=="string"&&(n=[n]),!B.find(r))return hM(r,e,t,i);let a=r+"_temp_fade";B.editAlias(r,a),n.push(a),e=Hd(r,e),a&&B.copyCanvasElementProperty(a,r),a&&B.transferTickers(a,r,"duplicate"),e.alpha=0;let u=_b(a,{...t,tickerAliasToResume:r},i);u&&o.push(...u);let l=new rs({...t,type:"show",startOnlyIfHaveTexture:true,aliasToRemoveAfter:n},void 0,i),c=B.addTicker(r,l);if(c&&(s&&B.completeTickerOnStepEnd({id:c}),o.push(c),B.pauseTicker(r,{tickerIdsIncluded:[c]})),(e instanceof Pe||e instanceof Le)&&e.haveEmptyTexture&&await e.load(),o.length>0)return o}function TO(r,e={},t){return _b(r,e,t)}async function SO(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;B.find(r)&&(c=r+"_temp_movein",B.editAlias(r,c)),e=Hd(r,e),c&&B.copyCanvasElementProperty(c,r),c&&B.transferTickers(c,r,"move");let h;e instanceof Pe||e instanceof Le?h=e.positionInfo:h={x:e.x,y:e.y,type:"pixel"};let d;switch(c&&(u?(d=HE(c,t,i),d&&(l.push(...d),o.push(c))):a.push(c)),(e instanceof Pe||e instanceof Le)&&e.haveEmptyTexture&&await e.load(),c&&B.pauseTicker(c,{tickerIdsIncluded:d}),s){case "up":e.y=B.canvasHeight+e.height;break;case "down":e.y=-e.height;break;case "left":e.x=B.canvasWidth+e.width;break;case "right":e.x=-e.width;break}o.push(r);let p=new xr({...t,tickerAliasToResume:o,aliasToRemoveAfter:a,destination:h,startOnlyIfHaveTexture:true},void 0,i),_=B.addTicker(r,p);if(_&&(B.pauseTicker(r,{tickerIdsExcluded:[_]}),n&&B.completeTickerOnStepEnd({id:_}),l.push(_)),l.length>0)return l}function HE(r,e={},t){let{direction:i="right",mustBeCompletedBeforeNextStep:s=true,aliasToRemoveAfter:n=[]}=e;typeof n=="string"&&(n=[n]),n.push(r);let o=B.find(r);if(!o){H.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=B.canvasHeight+o.height;break;case "left":a.x=-o.width;break;case "right":a.x=B.canvasWidth+o.width;break}let u=new xr({...e,destination:a,startOnlyIfHaveTexture:true,aliasToRemoveAfter:n},void 0,t),l=B.addTicker(r,u);if(l)return B.pauseTicker(r,{tickerIdsExcluded:[l]}),s&&B.completeTickerOnStepEnd({id:l}),[l]}async function EO(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=B.find(r);c&&(l=r+"_temp_zoom",B.editAlias(r,l)),e=Hd(r,e),l&&B.copyCanvasElementProperty(l,r),l&&B.transferTickers(l,r,"move"),s=="up"?(e.pivot.y=B.canvasHeight-e.y,e.pivot.x=B.canvasWidth/2-e.x,e.y=B.canvasHeight,e.x=B.canvasWidth/2):s=="down"?(e.pivot.y=0-e.y,e.pivot.x=B.canvasWidth/2-e.x,e.y=0,e.x=B.canvasWidth/2):s=="left"?(e.pivot.x=B.canvasWidth-e.x,e.pivot.y=B.canvasHeight/2-e.y,e.x=B.canvasWidth,e.y=B.canvasHeight/2):s=="right"&&(e.pivot.x=0-e.x,e.pivot.y=B.canvasHeight/2-e.y,e.x=0,e.y=B.canvasHeight/2),e.pivot=FE(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 _=dM(l,t,i);_&&(u.push(..._),o.push(l));}else a.push(l);B.pauseTicker(l);}o.push(r);let d=new yn({...t,tickerAliasToResume:o,aliasToRemoveAfter:a,startOnlyIfHaveTexture:true,type:"zoom",limit:1,isZoomInOut:h},void 0,i),p=B.addTicker(r,d);if(p&&(B.pauseTicker(r,{tickerIdsExcluded:[p]}),n&&B.completeTickerOnStepEnd({id:p}),u.push(p)),(e instanceof Pe||e instanceof Le)&&e.haveEmptyTexture&&await e.load(),u.length>0)return u}function dM(r,e={},t){let{direction:i="right",mustBeCompletedBeforeNextStep:s=true,aliasToRemoveAfter:n=[]}=e;typeof n=="string"&&(n=[n]),n.push(r);let o=B.find(r);if(!o){H.warn("The canvas component is not found.");return}i=="up"?(o.pivot.y=B.canvasHeight-o.y,o.pivot.x=B.canvasWidth/2-o.x,o.y=B.canvasHeight,o.x=B.canvasWidth/2):i=="down"?(o.pivot.y=0-o.y,o.pivot.x=B.canvasWidth/2-o.x,o.y=0,o.x=B.canvasWidth/2):i=="left"?(o.pivot.x=B.canvasWidth-o.x,o.pivot.y=B.canvasHeight/2-o.y,o.x=B.canvasWidth,o.y=B.canvasHeight/2):i=="right"&&(o.pivot.x=0-o.x,o.pivot.y=B.canvasHeight/2-o.y,o.x=0,o.y=B.canvasHeight/2),o.pivot=FE(o.pivot,o.angle),o.scale.set(1);let a=new yn({...e,startOnlyIfHaveTexture:true,type:"unzoom",limit:0,aliasToRemoveAfter:n},void 0,t),u=B.addTicker(r,a);if(u)return B.pauseTicker(r,{tickerIdsExcluded:[u]}),s&&B.completeTickerOnStepEnd({id:u}),[u]}async function AO(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;B.find(r)&&(u=r+"_temp_push",B.editAlias(r,u)),e=Hd(r,e),u&&B.copyCanvasElementProperty(u,r),u&&B.transferTickers(u,r,"move");let l;if((e instanceof Pe||e instanceof Le)&&e.haveEmptyTexture?l=e.positionInfo:l={x:e.x,y:e.y,type:"pixel"},s=="up"?e.y=-B.canvasHeight+e.y:s=="down"?e.y=B.canvasHeight+e.y:s=="left"?e.x=-B.canvasWidth+e.x:s=="right"&&(e.x=B.canvasWidth+e.x),u){let d=fM(u,{...t,direction:s=="up"?"down":s=="down"?"up":s=="left"?"right":"left"},i);d&&a.push(...d);}o.push(r);let c=new xr({...t,tickerAliasToResume:o,startOnlyIfHaveTexture:true,destination:l},void 0,i),h=B.addTicker(r,c);if(h&&(B.pauseTicker(r,{tickerIdsExcluded:[h]}),n&&B.completeTickerOnStepEnd({id:h}),a.push(h)),(e instanceof Pe||e instanceof Le)&&e.haveEmptyTexture&&await e.load(),a.length>0)return a}function fM(r,e={direction:"right"},t){return HE(r,e,t)}var B=new Ld;sr.init({getScreen:()=>B.screen});exports.CanvasBaseItem=pb;exports.CanvasEvent=fb;exports.CanvasManagerStatic=R;exports.Container=va;exports.FadeAlphaTicker=rs;exports.ImageContainer=Le;exports.ImageSprite=Pe;exports.MoveTicker=xr;exports.RegisteredCanvasComponents=qt;exports.RegisteredEvents=Qi;exports.RegisteredTickers=or;exports.RotateTicker=Nd;exports.Sprite=ts;exports.Text=Sa;exports.TickerBase=nr;exports.VideoSprite=Xt;exports.ZoomTicker=yn;exports.addImage=gb;exports.addImageCointainer=mb;exports.addVideo=xb;exports.canvas=B;exports.canvasComponentDecorator=rO;exports.eventDecorator=iO;exports.getTexture=Bi;exports.loadImage=xO;exports.loadVideo=bO;exports.moveIn=SO;exports.moveOut=HE;exports.pushIn=AO;exports.pushOut=fM;exports.removeWithDissolve=_b;exports.removeWithFade=TO;exports.shakeEffect=mO;exports.showImage=_O;exports.showImageContainer=gO;exports.showVideo=yO;exports.showWithDissolve=hM;exports.showWithFade=vO;exports.tickerDecorator=lO;exports.zoomIn=EO;exports.zoomOut=dM;
3314
+ `}function XF(r,e,t){let i=[],s=e.lines[0],n="",o=[],a=0;return t.wordWrap=false,r.forEach(u=>{let l=/^\s*$/.test(u),c=IR(u),h=n.length===0&&l;if(l&&!c&&h)return;c||(n+=u);let d=Xe.measureText(u,t);o.push({char:u,metric:d}),n.length>=s.length&&(i.push({line:n,chars:o,width:o.reduce((p,_)=>p+_.metric.width,0)}),o=[],n="",a++,s=e.lines[a]);}),i}function X_(r){let{text:e,style:t,chars:i}=r,s=t,n=Xe.measureText(e,s),o=Xe.graphemeSegmenter(e),a=XF(o,n,s.clone()),u=s.align,l=n.lineWidths.reduce((g,m)=>Math.max(g,m),0),c=[],h=[],d=[],p=0,_=s.stroke?.width||0,b=s.dropShadow?.distance||0;return a.forEach((g,m)=>{let y=new q({label:`line-${m}`});y.y=p,h.push(y);let T=n.lineWidths[m],S=WF(u,T,l),w=new q({label:"word"});w.x=S,g.chars.forEach((A,P)=>{if(A.metric.width!==0){if(IR(A.char)){S+=A.metric.width-_;return}if(A.char===" ")w.children.length>0&&(d.push(w),y.addChild(w)),S+=A.metric.width+s.letterSpacing-_,w=new q({label:"word"}),w.x=S;else {let N;i.length>0?(N=i.shift(),N.text=A.char,N.style=s,N.setFromMatrix(M.IDENTITY),N.x=S-w.x-b*P):N=new ir({text:A.char,style:s,x:S-w.x-b*P}),c.push(N),w.addChild(N),S+=A.metric.width+s.letterSpacing-_;}}}),w.children.length>0&&(d.push(w),y.addChild(w)),p+=n.lineHeight;}),{chars:c,lines:h,words:d}}var bE=f(()=>{ce();At();Wi();yd();});var kR,FR,OR=f(()=>{zr();bE();z_();kR=class Y_ extends hn{constructor(e){let t={...Y_.defaultOptions,...e};super(t);}static from(e,t){let i={...Y_.defaultOptions,...t,text:e.text,style:new We(e.style)};return new Y_({...i})}splitFn(){return X_({text:this._originalText,style:this._style,chars:this._canReuseChars?this.chars:[]})}};kR.defaultOptions={autoSplit:true,lineAnchor:0,wordAnchor:0,charAnchor:0};FR=kR;});async function GR(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 UR=f(()=>{});function yE(r,e=0,t={color:"#000000"}){r.renderGroup&&(t.color=YF[$F++]);let i="";for(let o=0;o<e;o++)i+=" ";let s=r.label;!s&&r instanceof Ae&&(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];yE(a,e,{...t});}}function vE(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];vE(o,e,{...t,index:n});}}var YF,$F,LR=f(()=>{xs();YF=["#000080","#228B22","#8B0000","#4169E1","#008080","#800000","#9400D3","#FF8C00","#556B2F","#8B008B"],$F=0;});var NR={};Yd(NR,{AbstractBitmapFont:()=>Ns,AbstractRenderer:()=>pi,AbstractSplitText:()=>hn,AbstractText:()=>vi,AccessibilitySystem:()=>Df,AlphaFilter:()=>aB,AlphaMask:()=>Gn,AlphaMaskPipe:()=>Co,AnimatedSprite:()=>Sl,Application:()=>Uh,ApplicationInitHook:()=>Eo,Assets:()=>rt,AssetsClass:()=>Xh,BLEND_TO_NPM:()=>Qf,BUFFER_TYPE:()=>Zo,BackgroundLoader:()=>Ku,BackgroundSystem:()=>pg,Batch:()=>_c,BatchGeometry:()=>Wa,BatchTextureArray:()=>za,BatchableGraphics:()=>Hi,BatchableHTMLText:()=>xu,BatchableMesh:()=>li,BatchableSprite:()=>Pr,BatchableText:()=>nu,Batcher:()=>ip,BatcherPipe:()=>Eh,BigPool:()=>Re,BindGroup:()=>at,BindGroupSystem:()=>ko,BitmapFont:()=>la,BitmapFontManager:()=>Wr,BitmapText:()=>cn,BitmapTextGraphics:()=>$c,BitmapTextPipe:()=>no,BlendModeFilter:()=>te,BlendModePipe:()=>Bo,BlurFilter:()=>pd,BlurFilterPass:()=>Tl,Bounds:()=>xe,BrowserAdapter:()=>Nf,Buffer:()=>Ve,BufferImageSource:()=>ki,BufferResource:()=>xi,BufferUsage:()=>ie,CLEAR:()=>ut,Cache:()=>de,CanvasPool:()=>zt,CanvasPoolClass:()=>zc,CanvasSource:()=>ft,CanvasTextGenerator:()=>Xi,CanvasTextMetrics:()=>Xe,CanvasTextPipe:()=>Jn,CanvasTextSystem:()=>so,Circle:()=>ou,Color:()=>Z,ColorBlend:()=>eh,ColorBurnBlend:()=>th,ColorDodgeBlend:()=>rh,ColorMask:()=>Un,ColorMaskPipe:()=>wo,ColorMatrixFilter:()=>T_,CompressedSource:()=>Rr,Container:()=>q,Culler:()=>i_,CullerPlugin:()=>Jh,CustomRenderPipe:()=>_o,D3D10_RESOURCE_DIMENSION:()=>jx,D3DFMT:()=>Wt,DATA_URI:()=>Yw,DDS:()=>J,DEG_TO_RAD:()=>ef,DEPRECATED_SCALE_MODES:()=>Sd,DEPRECATED_WRAP_MODES:()=>Td,DOMAdapter:()=>z,DOMContainer:()=>Lf,DOMPipe:()=>Fn,DRAW_MODES:()=>GB,DXGI_FORMAT:()=>qx,DXGI_TO_TEXTURE_FORMAT:()=>Ot,DarkenBlend:()=>ih,DefaultBatcher:()=>zn,DefaultShader:()=>ja,DifferenceBlend:()=>sh,DisplacementFilter:()=>A_,DivideBlend:()=>nh,DynamicBitmapFont:()=>Xc,Ellipse:()=>au,EventBoundary:()=>ka,EventEmitter:()=>ue,EventSystem:()=>Fa,EventsTicker:()=>br,ExclusionBlend:()=>oh,ExtensionType:()=>x,ExtractSystem:()=>mg,FOURCC_TO_TEXTURE_FORMAT:()=>Kh,FederatedContainer:()=>Uf,FederatedEvent:()=>oi,FederatedMouseEvent:()=>Or,FederatedPointerEvent:()=>Ct,FederatedWheelEvent:()=>yr,FillGradient:()=>kt,FillPattern:()=>Hr,Filter:()=>_t,FilterEffect:()=>Ir,FilterPipe:()=>ho,FilterSystem:()=>fo,FontStylePromiseCache:()=>_u,GAUSSIAN_VALUES:()=>vl,GL_FORMATS:()=>Hu,GL_INTERNAL_FORMAT:()=>m1,GL_TARGETS:()=>Mh,GL_TYPES:()=>fe,GL_WRAP_MODES:()=>WT,GenerateTextureSystem:()=>Ro,Geometry:()=>Dt,GlBackBufferSystem:()=>Yg,GlBatchAdaptor:()=>Ko,GlBuffer:()=>Nu,GlBufferSystem:()=>Qo,GlColorMaskSystem:()=>ea,GlContextSystem:()=>zg,GlEncoderSystem:()=>ta,GlGeometrySystem:()=>Jo,GlGraphicsAdaptor:()=>qo,GlLimitsSystem:()=>ra,GlMeshAdaptor:()=>jo,GlParticleContainerAdaptor:()=>eu,GlParticleContainerPipe:()=>Kn,GlProgram:()=>ke,GlProgramData:()=>Wu,GlRenderTarget:()=>Vu,GlRenderTargetAdaptor:()=>zu,GlRenderTargetSystem:()=>na,GlShaderSystem:()=>oa,GlStateSystem:()=>fx,GlStencilSystem:()=>ia,GlTexture:()=>Yu,GlTextureSystem:()=>ua,GlUboSystem:()=>sa,GlUniformGroupSystem:()=>aa,GlobalUniformSystem:()=>Mo,GpuBatchAdaptor:()=>xo,GpuBlendModesToPixi:()=>Bt,GpuBufferSystem:()=>Fo,GpuColorMaskSystem:()=>Oo,GpuDeviceSystem:()=>Qs,GpuEncoderSystem:()=>Go,GpuGraphicsAdaptor:()=>mo,GpuGraphicsContext:()=>Mc,GpuLimitsSystem:()=>Uo,GpuMeshAdapter:()=>go,GpuMipmapGenerator:()=>Lu,GpuParticleContainerAdaptor:()=>iu,GpuParticleContainerPipe:()=>Zn,GpuProgram:()=>Fe,GpuRenderTarget:()=>Ou,GpuRenderTargetAdaptor:()=>Gu,GpuRenderTargetSystem:()=>Wo,GpuShaderSystem:()=>Xo,GpuStateSystem:()=>Yo,GpuStencilModesToPixi:()=>Br,GpuStencilSystem:()=>Lo,GpuTextureSystem:()=>$o,GpuUboSystem:()=>Ho,GpuUniformBatchPipe:()=>Vo,Graphics:()=>Ls,GraphicsContext:()=>tt,GraphicsContextRenderData:()=>Dc,GraphicsContextSystem:()=>Is,GraphicsGpuData:()=>kc,GraphicsPath:()=>ci,GraphicsPipe:()=>qn,HTMLText:()=>Cl,HTMLTextPipe:()=>oo,HTMLTextRenderData:()=>Vs,HTMLTextStyle:()=>zs,HTMLTextSystem:()=>ao,HardLightBlend:()=>ah,HardMixBlend:()=>uh,HelloSystem:()=>Zs,IGLUniformData:()=>Qg,ImageSource:()=>Mt,InstructionSet:()=>ls,KTX:()=>$e,LightenBlend:()=>lh,LinearBurnBlend:()=>ch,LinearDodgeBlend:()=>hh,LinearLightBlend:()=>dh,Loader:()=>Qu,LoaderParserPriority:()=>Me,LuminosityBlend:()=>fh,MaskEffectManager:()=>wa,MaskEffectManagerClass:()=>ec,MaskFilter:()=>Cu,Matrix:()=>M,Mesh:()=>rr,MeshGeometry:()=>Zt,MeshGpuData:()=>Ja,MeshPipe:()=>jn,MeshPlane:()=>U_,MeshRope:()=>gR,MeshSimple:()=>N_,NOOP:()=>sc,NegationBlend:()=>ph,NineSliceGeometry:()=>Xr,NineSlicePlane:()=>H_,NineSliceSprite:()=>xE,NineSliceSpriteGpuData:()=>Zc,NineSliceSpritePipe:()=>co,NoiseFilter:()=>gB,ObservablePoint:()=>be,OverlayBlend:()=>mh,PI_2:()=>Qd,Particle:()=>TR,ParticleBuffer:()=>tu,ParticleContainer:()=>AR,ParticleContainerPipe:()=>ks,ParticleShader:()=>ru,PerspectiveMesh:()=>lR,PerspectivePlaneGeometry:()=>Pl,PinLightBlend:()=>gh,PipelineSystem:()=>zo,PlaneGeometry:()=>Ys,Point:()=>ne,Polygon:()=>Os,Pool:()=>Mi,PoolGroupClass:()=>Ql,PrepareBase:()=>P_,PrepareQueue:()=>Al,PrepareSystem:()=>vd,PrepareUpload:()=>wl,QuadGeometry:()=>vu,RAD_TO_DEG:()=>Jd,Rectangle:()=>Q,RenderContainer:()=>k_,RenderGroup:()=>Ma,RenderGroupPipe:()=>yo,RenderGroupSystem:()=>To,RenderLayer:()=>rR,RenderTarget:()=>Io,RenderTargetSystem:()=>tn,RenderTexture:()=>wu,RenderableGCSystem:()=>bg,RendererInitHook:()=>Ao,RendererType:()=>Oe,ResizePlugin:()=>Dn,Resolver:()=>Pt,RopeGeometry:()=>L_,RoundedRectangle:()=>uu,SCALE_MODES:()=>NB,STENCIL_MODES:()=>Be,SVGParser:()=>pm,SaturationBlend:()=>xh,SchedulerSystem:()=>Do,ScissorMask:()=>D_,SdfShader:()=>mu,Shader:()=>ze,ShaderStage:()=>As,ShapePath:()=>du,SharedRenderPipes:()=>Mu,SharedSystems:()=>Ru,SoftLightBlend:()=>_h,SplitBitmapText:()=>MR,SplitText:()=>FR,Sprite:()=>Ae,SpritePipe:()=>So,Spritesheet:()=>fc,State:()=>Ue,StencilMask:()=>Ln,StencilMaskPipe:()=>Po,SubtractBlend:()=>bh,SystemRunner:()=>js,TEXTURE_FORMAT_BLOCK_SIZE:()=>Kx,Text:()=>ir,TextStyle:()=>We,Texture:()=>C,TextureGCSystem:()=>yg,TextureMatrix:()=>hs,TexturePool:()=>ye,TexturePoolClass:()=>nc,TextureSource:()=>oe,TextureStyle:()=>ot,TextureUvs:()=>I_,Ticker:()=>ve,TickerListener:()=>fs,TickerPlugin:()=>kn,TilingSprite:()=>R_,TilingSpriteGpuData:()=>jc,TilingSpritePipe:()=>lo,TilingSpriteShader:()=>yu,Transform:()=>El,Triangle:()=>w_,UNIFORM_TO_ARRAY_SETTERS:()=>cx,UNIFORM_TO_SINGLE_SETTERS:()=>lx,UNIFORM_TYPES_MAP:()=>Ap,UNIFORM_TYPES_VALUES:()=>Ec,UPDATE_BLEND:()=>Da,UPDATE_COLOR:()=>Mn,UPDATE_PRIORITY:()=>Vt,UPDATE_TRANSFORM:()=>AA,UPDATE_VISIBLE:()=>ds,UboBatch:()=>ku,UboSystem:()=>Js,UniformGroup:()=>ae,VERSION:()=>Ks,VideoSource:()=>ys,ViewContainer:()=>Ze,ViewSystem:()=>Sg,ViewableBuffer:()=>vr,VividLightBlend:()=>yh,WGSL_ALIGN_SIZE_DATA:()=>No,WGSL_TO_STD40_SIZE:()=>Dh,WRAP_MODES:()=>LB,WebGLRenderer:()=>Gh,WebGPURenderer:()=>Rh,WebWorkerAdapter:()=>iB,WorkerManager:()=>Wh,accessibilityTarget:()=>If,addBits:()=>yc,addMaskBounds:()=>_s,addMaskLocalBounds:()=>bs,addProgramDefines:()=>ap,alphaFrag:()=>p_,alphaWgsl:()=>fd,applyMatrix:()=>Wm,applyProjectiveTransformationToPlane:()=>F_,applyStyleParams:()=>Oh,assignWithIgnore:()=>Rn,autoDetectEnvironment:()=>Hw,autoDetectRenderer:()=>Sx,autoDetectSource:()=>QA,basisTranscoderUrls:()=>ul,bgr2rgb:()=>Di,bitmapFontCachePlugin:()=>Ex,bitmapFontTextParser:()=>ju,bitmapFontXMLParser:()=>Lh,bitmapFontXMLStringParser:()=>Nh,bitmapTextSplit:()=>V_,blendTemplateFrag:()=>jm,blendTemplateVert:()=>Km,blendTemplateWgsl:()=>Zm,blockDataMap:()=>Bh,blurTemplateWgsl:()=>b_,boundsPool:()=>Ht,browserExt:()=>g2,buildAdaptiveBezier:()=>cu,buildAdaptiveQuadratic:()=>sm,buildArc:()=>hu,buildArcTo:()=>om,buildArcToSvg:()=>am,buildCircle:()=>Ds,buildContextBatches:()=>$p,buildEllipse:()=>Mp,buildLine:()=>Op,buildPixelLine:()=>Gp,buildPolygon:()=>zp,buildRectangle:()=>Wp,buildRoundedRectangle:()=>Dp,buildSimpleUvs:()=>Bp,buildTriangle:()=>Xp,buildUvs:()=>Pp,cacheAsTextureMixin:()=>nf,cacheTextureArray:()=>Cx,calculateProjection:()=>Og,canvasTextSplit:()=>X_,checkChildrenDidChange:()=>rc,checkDataUrl:()=>Qt,checkExtension:()=>Ye,checkMaxIfStatementsInShader:()=>Ha,childrenHelperMixin:()=>af,cleanArray:()=>_g,cleanHash:()=>xg,clearList:()=>vo,closePointEps:()=>Ip,collectAllRenderables:()=>qB,collectRenderablesMixin:()=>uf,color32BitToUniform:()=>wr,colorBit:()=>ws,colorBitGl:()=>Ps,colorMatrixFilterFrag:()=>v_,colorMatrixFilterWgsl:()=>md,colorToUniform:()=>MC,compareModeToGlCompare:()=>bx,compileHighShader:()=>xp,compileHighShaderGl:()=>_p,compileHighShaderGlProgram:()=>Sr,compileHighShaderGpuProgram:()=>Tr,compileHooks:()=>vc,compileInputs:()=>Tc,compileOutputs:()=>gp,compileShader:()=>Ih,compute2DProjection:()=>G_,convertFormatIfRequired:()=>KP,convertToList:()=>wt,copySearchParams:()=>On,createIdFromString:()=>Nr,createIndicesForQuads:()=>Oc,createLevelBuffers:()=>OP,createLevelBuffersFromKTX:()=>QP,createStringVariations:()=>Hf,createTexture:()=>Ft,createUboElementsSTD40:()=>$g,createUboElementsWGSL:()=>Cg,createUboSyncFunction:()=>Du,createUboSyncFunctionSTD40:()=>Kg,createUboSyncFunctionWGSL:()=>Ig,crossOrigin:()=>i1,cullingMixin:()=>Zd,curveEps:()=>kp,defaultFilterVert:()=>un,defaultValue:()=>Xu,definedProps:()=>xt,deprecation:()=>I,detectAvif:()=>Px,detectBasis:()=>BP,detectCompressed:()=>n3,detectDefaults:()=>Bx,detectMp4:()=>Rx,detectOgv:()=>Mx,detectVideoAlphaMode:()=>Ua,detectWebm:()=>Dx,detectWebp:()=>Ix,determineCrossOrigin:()=>n1,displacementFrag:()=>S_,displacementVert:()=>E_,displacementWgsl:()=>gd,earcut:()=>Hp,effectsMixin:()=>lf,ensureAttributes:()=>Fu,ensureIsBuffer:()=>bc,ensurePrecision:()=>up,ensureTextOptions:()=>ln,executeInstructions:()=>bo,extensions:()=>O,extractAttributesFromGlProgram:()=>ix,extractAttributesFromGpuProgram:()=>dp,extractFontFamilies:()=>Im,extractStructAndGroups:()=>Ya,extractSvgUrlId:()=>Hc,fastCopy:()=>Vn,findMixin:()=>cf,fontStringFromTextStyle:()=>zi,formatShader:()=>BB,fragmentGPUTemplate:()=>yp,fragmentGlTemplate:()=>Tp,generateArraySyncSTD40:()=>jg,generateArraySyncWGSL:()=>Dg,generateBlurFragSource:()=>g_,generateBlurGlProgram:()=>__,generateBlurProgram:()=>y_,generateBlurVertSource:()=>x_,generateGPULayout:()=>AB,generateGpuLayoutGroups:()=>fp,generateLayout:()=>wB,generateLayoutHash:()=>pp,generateParticleUpdateFunction:()=>qp,generateProgram:()=>ax,generateShaderSyncCode:()=>Zg,generateTextStyleKey:()=>gm,generateTextureBatchBit:()=>Bs,generateTextureBatchBitGl:()=>Rs,generateTextureMatrix:()=>Yp,generateUniformsSync:()=>hx,getAdjustedBlendModeBlend:()=>Lr,getAttributeInfoFromFormat:()=>It,getBatchSamplersUniformGroup:()=>Ms,getBitmapTextLayout:()=>Hs,getCanvasBoundingBox:()=>_m,getCanvasFillStyle:()=>Us,getCanvasTexture:()=>Bu,getDefaultUniformValue:()=>Cp,getFastGlobalBounds:()=>XB,getFastGlobalBoundsMixin:()=>df,getFontCss:()=>Fm,getFontFamilyName:()=>KS,getGeometryBounds:()=>sp,getGlTypeFromFormat:()=>Xg,getGlobalBounds:()=>ni,getGlobalMixin:()=>mf,getGlobalRenderableBounds:()=>qm,getLocalBounds:()=>us,getMaxFragmentPrecision:()=>op,getMaxTexturesPerBatch:()=>rp,getOrientationOfPoints:()=>Fp,getPo2TextureFromSource:()=>pu,getResolutionOfUrl:()=>nn,getSVGUrl:()=>Om,getSupportedCompressedTextureFormats:()=>nl,getSupportedGPUCompressedTextureFormats:()=>$h,getSupportedGlCompressedTextureFormats:()=>Yh,getSupportedTextureFormats:()=>_i,getTemporaryCanvasFromImage:()=>Gm,getTestContext:()=>Na,getTextureBatchBindGroup:()=>vs,getTextureDefaultMatrix:()=>bR,getTextureFormatFromKTXTexture:()=>e3,getUboData:()=>sx,getUniformData:()=>nx,getUrlExtension:()=>my,glFormatToGPUFormat:()=>e_,glUploadBufferImageResource:()=>px,glUploadCompressedTextureResource:()=>mx,glUploadImageResource:()=>$u,glUploadVideoResource:()=>xx,globalUniformsBit:()=>Sp,globalUniformsBitGl:()=>Ep,globalUniformsUBOBitGl:()=>dC,gpuFormatToBasisTranscoderFormat:()=>UP,gpuFormatToKTXBasisTranscoderFormat:()=>r3,gpuUploadBufferImageResource:()=>Lg,gpuUploadCompressedTextureResource:()=>Ng,gpuUploadImageResource:()=>Uu,gpuUploadVideoResource:()=>Vg,groupD8:()=>le,hasCachedCanvasTexture:()=>tP,hslWgsl:()=>_B,hslgl:()=>$s,hslgpu:()=>qs,injectBits:()=>Sc,insertVersion:()=>lp,isMobile:()=>Rf,isPow2:()=>ic,isRenderingToScreen:()=>Gg,isSafari:()=>Bm,isSingleItem:()=>Oi,isWebGLSupported:()=>mi,isWebGPUSupported:()=>gi,ktxTranscoderUrls:()=>cl,loadBasis:()=>kP,loadBasisOnWorker:()=>$x,loadBitmapFont:()=>Ax,loadDDS:()=>NP,loadEnvironmentExtensions:()=>vh,loadFontAsBase64:()=>km,loadFontCSS:()=>qc,loadImageBitmap:()=>r1,loadJson:()=>kx,loadKTX:()=>VP,loadKTX2:()=>$P,loadKTX2onWorker:()=>Jx,loadSVGImage:()=>Um,loadSvg:()=>Gx,loadTextures:()=>rl,loadTxt:()=>Fx,loadVideoTextures:()=>Lx,loadWebFont:()=>Ox,localUniformBit:()=>Yi,localUniformBitGl:()=>Xs,localUniformBitGroup2:()=>Nm,localUniformMSDFBit:()=>Tm,localUniformMSDFBitGl:()=>Sm,log2:()=>xA,logDebugTexture:()=>GR,logProgramError:()=>ox,logRenderGroupScene:()=>vE,logScene:()=>yE,mSDFBit:()=>Em,mSDFBitGl:()=>Am,mapFormatToGlFormat:()=>yx,mapFormatToGlInternalFormat:()=>vx,mapFormatToGlType:()=>Tx,mapGlToVertexFormat:()=>tx,mapSize:()=>kB,mapType:()=>kh,mapWebGLBlendModesToPixi:()=>dx,maskFrag:()=>dg,maskVert:()=>fg,maskWgsl:()=>Ah,matrixPool:()=>Ke,measureHtmlText:()=>bu,measureMixin:()=>xf,migrateFragmentFromV7toV8:()=>DB,mipmapScaleModeToGlFilter:()=>_x,multiplyColors:()=>as,multiplyHexColors:()=>Ba,nextPow2:()=>kr,noiseFrag:()=>C_,noiseWgsl:()=>xd,nonCompressedFormats:()=>c1,normalizeExtensionPriority:()=>Ea,onRenderMixin:()=>_f,parseDDS:()=>Zx,parseFunctionBody:()=>zB,parseKTX:()=>Qx,parseSVGDefinitions:()=>dm,parseSVGFloatAttribute:()=>Ge,parseSVGPath:()=>Jp,parseSVGStyle:()=>Vc,particleData:()=>Ed,particlesFrag:()=>jp,particlesVert:()=>Kp,particlesWgsl:()=>Gc,path:()=>De,pointInTriangle:()=>_d,preloadVideo:()=>s1,removeItems:()=>Ca,removeStructAndGroupDuplicates:()=>mp,resetUids:()=>cA,resolveCharacters:()=>wm,resolveCompressedTextureUrl:()=>s3,resolveJsonUrl:()=>Hx,resolveTextureUrl:()=>il,resourceToTexture:()=>Ay,roundPixelsBit:()=>Er,roundPixelsBitGl:()=>Ar,roundedShapeArc:()=>um,roundedShapeQuadraticCurve:()=>lm,sayHello:()=>gg,scaleModeToGlFilter:()=>Fh,setBasisTranscoderPath:()=>DP,setKTXTranscoderPath:()=>XP,setPositions:()=>zm,setProgramName:()=>cp,setUvs:()=>Xm,shapeBuilders:()=>Qa,sortMixin:()=>bf,spritesheetAsset:()=>zf,squaredDistanceToLineSegment:()=>Fs,stripVersion:()=>hp,styleAttributes:()=>fm,testImageFormat:()=>Zu,testVideoFormat:()=>rn,textStyleToCSS:()=>Mm,textureBit:()=>rg,textureBitGl:()=>ig,textureFrom:()=>Cy,tilingBit:()=>Hm,tilingBitGl:()=>Vm,toFillStyle:()=>Vr,toLocalGlobalMixin:()=>yf,toStrokeStyle:()=>Gs,transformVertices:()=>Cc,triangulateWithHoles:()=>Za,uboSyncFunctionsSTD40:()=>wh,uboSyncFunctionsWGSL:()=>Rg,uid:()=>re,uniformParsers:()=>Yr,unpremultiplyAlpha:()=>fP,unsafeEvalSupported:()=>Tu,updateLocalTransform:()=>KB,updateQuadBounds:()=>Ga,updateRenderGroupTransform:()=>B2,updateRenderGroupTransforms:()=>Sh,updateTextBounds:()=>Qn,updateTransformAndChildren:()=>ug,updateTransformBackwards:()=>Pa,updateWorldTransform:()=>QB,v8_0_0:()=>V,v8_3_4:()=>rf,validFormats:()=>hl,validateRenderables:()=>lg,vertexGPUTemplate:()=>bp,vertexGlTemplate:()=>vp,vkFormatToGPUFormat:()=>t_,warn:()=>k,webworkerExt:()=>x2,wrapModeToGlAddress:()=>qu});var we=f(()=>{mw();xw();E();E();jf();Wf();ty();ry();yw();vw();Tw();Sw();Ew();Aw();Cw();ww();Pw();Bw();Rw();Mw();Dw();Iw();kw();Fw();Ow();Gw();Uw();Lw();Nw();vP();iy();ny();PP();LS();ai();NS();HS();VS();zS();WS();XS();YS();wx();Hh();$S();ur();qS();jS();ZS();QS();Ux();o1();$i();t1();a1();Nx();gs();sn();dr();Oa();Vf();py();hc();nt();RP();FP();GP();LP();h1();d1();f1();HP();p1();zP();x1();g1();qP();ZP();JP();t3();v1();i3();_1();T1();b1();o3();S1();A1();a3();Rb();WA();dy();Ee();S2();fy();sB();uy();Gf();kf();oc();hy();uc();Ff();Of();b2();y2();v2();bB();H1();V1();Y1();j1();K1();dd();Z1();Q1();J1();eE();tE();O2();G2();U2();je();Qc();Jc();uB();hB();q1();m_();z1();X1();W1();$1();dB();fB();xB();fi();Jl();h2();p2();L2();Sf();ce();tf();Ra();em();ns();jt();rE();sv();nv();ov();Je();av();yB();iE();aE();EB();lE();UT();tp();Py();CB();PB();gc();C2();My();F2();ky();By();wp();h0();Li();s0();Qy();Jy();e0();t0();RB();r0();n0();$a();qa();o0();uo();Ni();sg();_y();H2();by();V2();Ob();MB();yy();z2();pc();mc();DS();LT();NT();HT();po();zT();YT();XT();qT();jT();KT();ZT();rS();QT();tS();iS();sS();nS();Ac();Kt();oS();pS();xS();IB();aS();Jg();kg();lS();fS();Oy();ep();cS();hS();dS();FB();rx();Gy();Uy();Ly();Ny();Hy();qg();eS();JT();gS();mS();yS();_S();Wg();vS();RS();TS();SS();gx();ES();CS();u1();wS();PS();BS();AS();pP();MS();lT();cT();bT();hT();dT();fT();pT();mT();_T();yT();vT();TT();ET();AT();CT();Gi();lr();wT();wg();xT();Xy();Yy();gT();qy();jy();Ky();PT();BT();Fg();kT();RT();MT();Hg();DT();l1();IT();FT();X2();Y2();Ui();Ph();ui();Zf();j2();Z2();UB();Ss();f0();Dy();Es();Iy();p0();vf();Q2();ST();vg();Ug();J2();$y();Cr();l0();Ag();et();Bg();c0();Mg();Pg();tT();Ts();La();hr();Su();Eg();Jm();ro();HB();sT();K2();Ef();Nn();sl();Hn();dt();qf();he();oT();Af();Fr();Ii();VB();Tg();Xx();ol();wy();Xa();WB();uT();cr();Y0();$0();q0();Et();YB();An();tc();d2();os();Ib();kb();Fb();Gb();Ub();Lb();gf();Hb();Vb();zb();Wb();At();w2();$B();$b();P2();D2();Cf();Nb();ag();jB();cs();og();pf();ff();ZB();R2();JB();M2();OT();$n();E2();Rp();im();hv();nm();dv();mv();m0();x0();_0();T0();S0();E0();_C();Yn();Uc();vm();to();Ic();U0();cm();gv();xv();_v();hm();iv();yv();vv();bv();P0();mm();w0();g0();Vp();iR();cR();dE();cE();hE();hR();Kc();xR();_R();fE();GT();A2();Fc();yR();ha();Ws();N0();V0();Z0();K0();Q0();SR();X0();CR();Zp();mE();j0();z0();W0();sE();$m();BR();l2();Jv();r2();oE();a2();n2();i2();s2();o2();su();xs();I2();Cm();FS();OS();GS();US();kS();gu();M_();Uv();Fv();_E();Yc();Ov();Nv();uE();Hv();Rm();Dm();Zv();Wv();$v();qv();jv();Xv();Yv();Kv();Lm();zv();z_();DR();OR();bd();ev();ym();Wi();tv();Pv();Wc();bm();kv();Rv();Mv();yd();zr();bE();Sv();xm();Qp();Gr();gy();xy();In();ps();sy();Yf();Jb();Vv();Eu();Au();Qm();Av();cg();St();rT();of();ht();Xf();Kf();hg();me();UR();LR();ge();Yb();nE();Vh();ms();sf();si();eT();v0();O.add(g2,x2);});var KR=ii((ib,jR)=>{(function(r,e){typeof ib=="object"?jR.exports=ib=e():typeof define=="function"&&define.amd?define([],e):r.CryptoJS=e();})(ib,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 vb=="function")try{i=vb("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 m(){}return function(y){var T;return m.prototype=y,T=new m,m.prototype=null,T}}(),o={},a=o.lib={},u=a.Base=function(){return {extend:function(m){var y=n(this);return m&&y.mixIn(m),(!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 m=this.extend();return m.init.apply(m,arguments),m},init:function(){},mixIn:function(m){for(var y in m)m.hasOwnProperty(y)&&(this[y]=m[y]);m.hasOwnProperty("toString")&&(this.toString=m.toString);},clone:function(){return this.init.prototype.extend(this)}}}(),l=a.WordArray=u.extend({init:function(m,y){m=this.words=m||[],y!=t?this.sigBytes=y:this.sigBytes=m.length*4;},toString:function(m){return (m||h).stringify(this)},concat:function(m){var y=this.words,T=m.words,S=this.sigBytes,w=m.sigBytes;if(this.clamp(),S%4)for(var A=0;A<w;A++){var P=T[A>>>2]>>>24-A%4*8&255;y[S+A>>>2]|=P<<24-(S+A)%4*8;}else for(var N=0;N<w;N+=4)y[S+N>>>2]=T[N>>>2];return this.sigBytes+=w,this},clamp:function(){var m=this.words,y=this.sigBytes;m[y>>>2]&=4294967295<<32-y%4*8,m.length=e.ceil(y/4);},clone:function(){var m=u.clone.call(this);return m.words=this.words.slice(0),m},random:function(m){for(var y=[],T=0;T<m;T+=4)y.push(s());return new l.init(y,m)}}),c=o.enc={},h=c.Hex={stringify:function(m){for(var y=m.words,T=m.sigBytes,S=[],w=0;w<T;w++){var A=y[w>>>2]>>>24-w%4*8&255;S.push((A>>>4).toString(16)),S.push((A&15).toString(16));}return S.join("")},parse:function(m){for(var y=m.length,T=[],S=0;S<y;S+=2)T[S>>>3]|=parseInt(m.substr(S,2),16)<<24-S%8*4;return new l.init(T,y/2)}},d=c.Latin1={stringify:function(m){for(var y=m.words,T=m.sigBytes,S=[],w=0;w<T;w++){var A=y[w>>>2]>>>24-w%4*8&255;S.push(String.fromCharCode(A));}return S.join("")},parse:function(m){for(var y=m.length,T=[],S=0;S<y;S++)T[S>>>2]|=(m.charCodeAt(S)&255)<<24-S%4*8;return new l.init(T,y)}},p=c.Utf8={stringify:function(m){try{return decodeURIComponent(escape(d.stringify(m)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(m){return d.parse(unescape(encodeURIComponent(m)))}},_=a.BufferedBlockAlgorithm=u.extend({reset:function(){this._data=new l.init,this._nDataBytes=0;},_append:function(m){typeof m=="string"&&(m=p.parse(m)),this._data.concat(m),this._nDataBytes+=m.sigBytes;},_process:function(m){var y,T=this._data,S=T.words,w=T.sigBytes,A=this.blockSize,P=A*4,N=w/P;m?N=e.ceil(N):N=e.max((N|0)-this._minBufferSize,0);var D=N*A,U=e.min(D*4,w);if(D){for(var F=0;F<D;F+=A)this._doProcessBlock(S,F);y=S.splice(0,D),T.sigBytes-=U;}return new l.init(y,U)},clone:function(){var m=u.clone.call(this);return m._data=this._data.clone(),m},_minBufferSize:0});a.Hasher=_.extend({cfg:u.extend(),init:function(m){this.cfg=this.cfg.extend(m),this.reset();},reset:function(){_.reset.call(this),this._doReset();},update:function(m){return this._append(m),this._process(),this},finalize:function(m){m&&this._append(m);var y=this._doFinalize();return y},blockSize:512/32,_createHelper:function(m){return function(y,T){return new m.init(T).finalize(y)}},_createHmacHelper:function(m){return function(y,T){return new g.HMAC.init(m,T).finalize(y)}}});var g=o.algo={};return o}(Math);return r});});var QR=ii((sb,ZR)=>{(function(r,e){typeof sb=="object"?ZR.exports=sb=e(KR()):typeof define=="function"&&define.amd?define(["./core"],e):e(r.CryptoJS);})(sb,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],d=c[1],p=c[2],_=c[3],b=c[4],g=0;g<80;g++){if(g<16)o[g]=u[l+g]|0;else {var m=o[g-3]^o[g-8]^o[g-14]^o[g-16];o[g]=m<<1|m>>>31;}var y=(h<<5|h>>>27)+b+o[g];g<20?y+=(d&p|~d&_)+1518500249:g<40?y+=(d^p^_)+1859775393:g<60?y+=(d&p|d&_|p&_)-1894007588:y+=(d^p^_)-899497514,b=_,_=p,p=d<<30|d>>>2,d=h,h=y;}c[0]=c[0]+h|0,c[1]=c[1]+d|0,c[2]=c[2]+p|0,c[3]=c[3]+_|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});});we();var Ti={};Yd(Ti,{DistortionFilter:()=>$_,EqualizerFilter:()=>Mr,Filter:()=>pt,MonoFilter:()=>q_,ReverbFilter:()=>j_,StereoFilter:()=>K_,StreamFilter:()=>Z_,TelephoneFilter:()=>Q_});var HR;function VR(r){return HR=r,r}function Te(){return HR}var pt=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 $_=class extends pt{constructor(e=0){let t;if(!Te().useLegacy){let{audioContext:i}=Te().context;t=i.createWaveShaper();}super(t),this._distortion=t,this.amount=e;}set amount(e){if(this._amount=e,Te().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 lt=class{static setParamValue(e,t){if(e.setValueAtTime){let i=Te().context;e.setValueAtTime(t,i.audioContext.currentTime);}else e.value=t;return t}};var Se=class extends pt{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:Se.F32,type:"lowshelf",gain:r},{f:Se.F64,type:"peaking",gain:e},{f:Se.F125,type:"peaking",gain:t},{f:Se.F250,type:"peaking",gain:i},{f:Se.F500,type:"peaking",gain:s},{f:Se.F1K,type:"peaking",gain:n},{f:Se.F2K,type:"peaking",gain:o},{f:Se.F4K,type:"peaking",gain:a},{f:Se.F8K,type:"peaking",gain:u},{f:Se.F16K,type:"highshelf",gain:l}];Te().useLegacy||(c=h.map(d=>{let p=Te().context.audioContext.createBiquadFilter();return p.type=d.type,lt.setParamValue(p.Q,1),p.frequency.value=d.f,lt.setParamValue(p.gain,d.gain),p})),super(c[0],c[c.length-1]),this.bands=c,this.bandsMap={};for(let d=0;d<this.bands.length;d++){let p=this.bands[d];d>0&&this.bands[d-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}`);lt.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(Se.F32,r);}get f32(){return this.getGain(Se.F32)}set f64(r){this.setGain(Se.F64,r);}get f64(){return this.getGain(Se.F64)}set f125(r){this.setGain(Se.F125,r);}get f125(){return this.getGain(Se.F125)}set f250(r){this.setGain(Se.F250,r);}get f250(){return this.getGain(Se.F250)}set f500(r){this.setGain(Se.F500,r);}get f500(){return this.getGain(Se.F500)}set f1k(r){this.setGain(Se.F1K,r);}get f1k(){return this.getGain(Se.F1K)}set f2k(r){this.setGain(Se.F2K,r);}get f2k(){return this.getGain(Se.F2K)}set f4k(r){this.setGain(Se.F4K,r);}get f4k(){return this.getGain(Se.F4K)}set f8k(r){this.setGain(Se.F8K,r);}get f8k(){return this.getGain(Se.F8K)}set f16k(r){this.setGain(Se.F16K,r);}get f16k(){return this.getGain(Se.F16K)}reset(){this.bands.forEach(r=>{lt.setParamValue(r.gain,0);});}destroy(){this.bands.forEach(r=>{r.disconnect();}),this.bands=null,this.bandsMap=null;}},Mr=Se;Mr.F32=32;Mr.F64=64;Mr.F125=125;Mr.F250=250;Mr.F500=500;Mr.F1K=1e3;Mr.F2K=2e3;Mr.F4K=4e3;Mr.F8K=8e3;Mr.F16K=16e3;var q_=class extends pt{constructor(){let e,t;if(!Te().useLegacy){let{audioContext:i}=Te().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 j_=class extends pt{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(Te().useLegacy)return;let{audioContext:e}=Te().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 K_=class extends pt{constructor(e=0){let t,i,s;if(!Te().useLegacy){let{audioContext:n}=Te().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?lt.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 Z_=class extends pt{constructor(){let e,t;if(!Te().useLegacy){let{audioContext:i}=Te().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 Q_=class extends pt{constructor(){let e,t;if(!Te().useLegacy){let{audioContext:i}=Te().context,s=i.createBiquadFilter(),n=i.createBiquadFilter(),o=i.createBiquadFilter(),a=i.createBiquadFilter();s.type="lowpass",lt.setParamValue(s.frequency,2e3),n.type="lowpass",lt.setParamValue(n.frequency,2e3),o.type="highpass",lt.setParamValue(o.frequency,500),a.type="highpass",lt.setParamValue(a.frequency,500),s.connect(n),n.connect(o),o.connect(a),e=s,t=a;}super(e,t);}};we();var Ad=class extends ue{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();}};we();var qF=0,TE=class extends ue{constructor(r){super(),this.id=qF++,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-TE.PADDING),this._end=Math.min(this._end+TE.PADDING,this._duration),this._source.onloadedmetadata=()=>{this._source&&(this._source.currentTime=e,this._source.onloadedmetadata=null,this.emit("progress",e/this._duration,this._duration),ve.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(){ve.shared.remove(this._onUpdate,this),this._internalStop(),this.emit("progress",1,this._duration),this.emit("end",this);}destroy(){ve.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}]`}},J_=TE;J_.PADDING=.1;we();var Cd=class extends ue{init(e){this.parent=e,this._source=e.options.source||new Audio,e.url&&(this._source.src=e.url);}create(){return new J_(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();}};we();var wd=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 da=["ogg","oga","opus","m4a","mp3","mpeg","wav","aiff","wma","mid","caf"],SE=["audio/mpeg","audio/ogg"],fa={};function zR(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$/;da.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(fa,i);}zR();we();we();var KF=0,Pd=class extends ue{constructor(e){super(),this.id=KF++,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);lt.setParamValue(this._gain.gain,n*s*i),lt.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){ve.shared.remove(this._updateListener,this),e&&ve.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 pa=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 WR=class extends pa{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(WR.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,lt.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}},eb=WR;eb.BUFFER_SIZE=0;var ma=class{init(e){this.parent=e,this._nodes=new eb(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 Pd(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 z.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 Bl=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=Te().useLegacy?new Cd:new ma;return new Bl(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:De.extname(t).slice(1)})).filter(({ext:t})=>fa[t]).sort((t,i)=>da.indexOf(t.ext)-da.indexOf(i.ext));if(!e)throw new Error("No supported file type found");return e.url}get context(){return Te().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 wd(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(Bl._pool.length>0){let r=Bl._pool.pop();return r.init(this.media),r}return this.media.create()}_poolInstance(r){r.destroy(),Bl._pool.indexOf(r)<0&&Bl._pool.push(r);}},dn=Bl;dn._pool=[];we();var Rl=class r extends pa{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 ue,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 tb=class{constructor(){this.init();}init(){return this.supported&&(this._webAudioContext=new Rl),this._htmlAudioContext=new Ad,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 Rl.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 dn)return this._sounds[e]=t,t;let i=this._getOptions(t),s=dn.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}};we();we();var XR=r=>{let e=r.src,t=r?.alias?.[0];return (!t||r.src===t)&&(t=De.basename(e,De.extname(e))),t},YR={extension:x.Asset,detection:{test:async()=>true,add:async r=>[...r,...da.filter(e=>fa[e])],remove:async r=>r.filter(e=>r.includes(e))},loader:{name:"sound",extension:{type:[x.LoadParser],priority:Me.High},test(r){let e=De.extname(r).slice(1);return !!fa[e]||SE.some(t=>r.startsWith(`data:${t}`))},async load(r,e){let t=await new Promise((i,s)=>dn.from({...e.data,url:r,preload:true,loaded(n,o){n?s(n):i(o),e.data?.loaded?.(n,o);}}));return Te().add(XR(e),t),t},async unload(r,e){Te().remove(XR(e));}}};O.add(YR);VR(new tb);var Bd="repeat";({DistortionFilter:Ti.DistortionFilter,EqualizerFilter:Ti.EqualizerFilter,MonoFilter:Ti.MonoFilter,ReverbFilter:Ti.ReverbFilter,StereoFilter:Ti.StereoFilter,StreamFilter:Ti.StreamFilter,TelephoneFilter:Ti.TelephoneFilter});var $R=["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"],qr="__game_layer__",Ml="Container",rb="ImageContainer",EE="Image",Dl="Sprite",Il="Text",AE="Video";var H;(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)))(H||(H={}));function Ut(r){try{if(typeof r>"u")return r;let e=JSON.stringify(r);return JSON.parse(e)}catch(e){throw H.error("Error creating exportable element",r,e),new Error("[Pixi\u2019VN] Error creating exportable element")}}async function qR(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(()=>(we(),NR))),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 eM=$d(QR());we();var JF={extension:{type:"sceneProperties",name:"additional-positions"},testNode(r){return r instanceof Pe||r instanceof Xt||r instanceof Le},testProp(r){switch(r){case "xAlign":case "yAlign":case "percentageX":case "percentageY":case "positionType":return true;default:return false}},setProperty(r,e,t){if(r instanceof Pe||r instanceof Xt||r instanceof Le)switch(e){case "xAlign":r.xAlign=t/100;break;case "yAlign":r.yAlign=t/100;break;case "percentageX":r.percentageX=t/100;break;case "percentageY":r.percentageY=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.percentageX*100,prop:"percentageX",entry:{section:"Transform",type:"range",label:"X Percentage Position",tooltip:"0% is left, 100% is right",options:{min:0,max:100}}},{value:r.percentageY*100,prop:"percentageY",entry:{section:"Transform",type:"range",label:"Y Percentage Position",tooltip:"0% is top, 100% is bottom",options:{min:0,max:100}}}]}},JR=JF;function eO(r,e){let t=0;return async(...i)=>{let s=Date.now();if(s-t>=e)return t=s,await r(...i)}}var X=class X{constructor(){}static get app(){if(!X._app)throw new Error("[Pixi\u2019VN] CanvasManagerStatic.app is undefined");return X._app}static get gameLayer(){let e=this.app.stage.getChildByLabel(qr);return e||(e=new q,e.label=qr,this.app.stage.addChild(e)),e}static async init(e,t,i,s,n){return X.canvasWidth=t,X.canvasHeight=i,X._app=new Uh,X.app.init({resolution:window.devicePixelRatio||1,autoDensity:true,width:t,height:i,...s}).then(()=>{let{app:o=X.app,extensions:a=[],...u}=n||{};qR({app:o,extensions:[JR,...a],...u}),X._isInitialized=true,X.addCanvasIntoHTMLElement(e),window.addEventListener("resize",X.resize),X.resize(),X.gameLayer;})}static addCanvasIntoHTMLElement(e){X._isInitialized?e.appendChild(X.app.canvas):H.error("GameWindowManager is not initialized");}static addHtmlLayer(e,t,i={position:"absolute",pointerEvents:"none"}){let s=document.createElement("div");s.setAttribute("id",e),s.style.position=i.position,s.style.pointerEvents=i.pointerEvents;let n=t.appendChild(s);return X.htmlLayers.push(s),X.resize(),n}static removeHtmlLayer(e){let t=X.htmlLayers.find(i=>i.id===e);t&&(t.remove(),X.htmlLayers=X.htmlLayers.filter(i=>i.id!==e));}static getHtmlLayer(e){return X.htmlLayers.find(t=>t.id===e)}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/X.canvasWidth,t/X.canvasHeight)}static get screenWidth(){return Math.floor(X.screenScale*X.canvasWidth)}static get screenHeight(){return Math.floor(X.screenScale*X.canvasHeight)}static get horizontalMargin(){return (Math.max(document.documentElement.clientWidth,window.innerWidth||0)-X.screenWidth)/2}static get verticalMargin(){return (Math.max(document.documentElement.clientHeight,window.innerHeight||0)-X.screenHeight)/2}static async resize(){await eO(async()=>{if(X._isInitialized){let i=X.app.canvas.style;i.width=`${X.screenWidth}px`,i.height=`${X.screenHeight}px`,i.marginLeft=`${X.horizontalMargin}px`,i.marginRight=`${X.horizontalMargin}px`,i.marginTop=`${X.verticalMargin}px`,i.marginBottom=`${X.verticalMargin}px`;}let t=X.htmlLayers.map(i=>{i.style.width=`${X.screenWidth}px`,i.style.height=`${X.screenHeight}px`,i.style.marginLeft=`${X.horizontalMargin}px`,i.style.marginRight=`${X.horizontalMargin}px`,i.style.marginTop=`${X.verticalMargin}px`,i.style.marginBottom=`${X.verticalMargin}px`;});await Promise.all(t);},10)();}static get childrenAliasesOrder(){return X.gameLayer.children.filter(e=>e.label).sort((e,t)=>X.gameLayer.getChildIndex(e)-X.gameLayer.getChildIndex(t)).map(e=>e.label)}static get currentTickersWithoutCreatedBySteps(){return Object.fromEntries(Object.entries(X._currentTickers).filter(([e,t])=>!t.createdByTicketSteps))}static generateTickerId(e){try{return (0,eM.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]),X._currentTickersTimeouts[i]={aliases:e,ticker:t,canBeDeletedBeforeEnd:s};}static removeTickerTimeoutInfo(e){typeof e!="string"&&(e=e.toString()),X._currentTickersTimeouts[e]&&delete X._currentTickersTimeouts[e];}static removeTickerTimeout(e){typeof e!="string"&&(e=e.toString()),clearTimeout(Number(e)),X.removeTickerTimeoutInfo(e);}static removeTickerTimeoutsByAlias(e,t){Object.entries(X._currentTickersTimeouts).forEach(([i,s])=>{let n=s.aliases.filter(o=>o!==e);if(n.length===0){let o=s.canBeDeletedBeforeEnd;(!t||o)&&X.removeTickerTimeout(i);}else X._currentTickersTimeouts[i].aliases=n;});}};L(X,"_app"),L(X,"htmlLayers",[]),L(X,"canvasWidth",300),L(X,"canvasHeight",300),L(X,"_isInitialized",false),L(X,"_currentTickers",{}),L(X,"_currentTickersSequence",{}),L(X,"_currentTickersTimeouts",{}),L(X,"_tickersToCompleteOnStepEnd",{tikersIds:[],stepAlias:[]}),L(X,"_tickersOnPause",{});var R=X;we();var kl=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,sM=new Set,CE=typeof process=="object"&&process?process:{},nM=(r,e,t,i)=>{typeof CE.emitWarning=="function"?CE.emitWarning(r,e,t,i):console.error(`[${t}] ${e}: ${r}`);},ab=globalThis.AbortController,tM=globalThis.AbortSignal;if(typeof ab>"u"){tM=class{constructor(){L(this,"onabort");L(this,"_onabort",[]);L(this,"reason");L(this,"aborted",false);}addEventListener(i,s){this._onabort.push(s);}},ab=class{constructor(){L(this,"signal",new tM);e();}abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=true;for(let s of this.signal._onabort)s(i);this.signal.onabort?.(i);}}};let r=CE.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{r&&(r=false,nM("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e));};}var tO=r=>!sM.has(r),fn=r=>r&&r===Math.floor(r)&&r>0&&isFinite(r),oM=r=>fn(r)?r<=Math.pow(2,8)?Uint8Array:r<=Math.pow(2,16)?Uint16Array:r<=Math.pow(2,32)?Uint32Array:r<=Number.MAX_SAFE_INTEGER?Fl:null:null,Fl=class extends Array{constructor(e){super(e),this.fill(0);}},Ol,ga=class ga{constructor(e,t){L(this,"heap");L(this,"length");if(!v(ga,Ol))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0;}static create(e){let t=oM(e);if(!t)return [];K(ga,Ol,true);let i=new ga(e,t);return K(ga,Ol,false),i}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}};Ol=new WeakMap,pe(ga,Ol,false);var wE=ga,rM,iM,jr,fr,Kr,xa,Zr,Gl,Ul,mt,Qr,ct,He,se,Yt,pr,Lt,vt,Jr,Tt,ei,ti,mr,ri,xn,$t,Ll,G,PE,_a,Zi,Md,gr,aM,ba,Nl,Dd,pn,mn,BE,nb,ob,Ne,RE,Rd,gn,ME,DE=class DE{constructor(e){pe(this,G);pe(this,jr);pe(this,fr);pe(this,Kr);pe(this,xa);pe(this,Zr);pe(this,Gl);pe(this,Ul);L(this,"ttl");L(this,"ttlResolution");L(this,"ttlAutopurge");L(this,"updateAgeOnGet");L(this,"updateAgeOnHas");L(this,"allowStale");L(this,"noDisposeOnSet");L(this,"noUpdateTTL");L(this,"maxEntrySize");L(this,"sizeCalculation");L(this,"noDeleteOnFetchRejection");L(this,"noDeleteOnStaleGet");L(this,"allowStaleOnFetchAbort");L(this,"allowStaleOnFetchRejection");L(this,"ignoreFetchAbort");pe(this,mt);pe(this,Qr);pe(this,ct);pe(this,He);pe(this,se);pe(this,Yt);pe(this,pr);pe(this,Lt);pe(this,vt);pe(this,Jr);pe(this,Tt);pe(this,ei);pe(this,ti);pe(this,mr);pe(this,ri);pe(this,xn);pe(this,$t);pe(this,Ll);pe(this,_a,()=>{});pe(this,Zi,()=>{});pe(this,Md,()=>{});pe(this,gr,()=>false);pe(this,ba,e=>{});pe(this,Nl,(e,t,i)=>{});pe(this,Dd,(e,t,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});L(this,rM,"LRUCache");let{max:t=0,ttl:i,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:u,dispose:l,onInsert:c,disposeAfter:h,noDisposeOnSet:d,noUpdateTTL:p,maxSize:_=0,maxEntrySize:b=0,sizeCalculation:g,fetchMethod:m,memoMethod:y,noDeleteOnFetchRejection:T,noDeleteOnStaleGet:S,allowStaleOnFetchRejection:w,allowStaleOnFetchAbort:A,ignoreFetchAbort:P}=e;if(t!==0&&!fn(t))throw new TypeError("max option must be a nonnegative integer");let N=t?oM(t):Array;if(!N)throw new Error("invalid max value: "+t);if(K(this,jr,t),K(this,fr,_),this.maxEntrySize=b||v(this,fr),this.sizeCalculation=g,this.sizeCalculation){if(!v(this,fr)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(y!==void 0&&typeof y!="function")throw new TypeError("memoMethod must be a function if defined");if(K(this,Ul,y),m!==void 0&&typeof m!="function")throw new TypeError("fetchMethod must be a function if specified");if(K(this,Gl,m),K(this,xn,!!m),K(this,ct,new Map),K(this,He,new Array(t).fill(void 0)),K(this,se,new Array(t).fill(void 0)),K(this,Yt,new N(t)),K(this,pr,new N(t)),K(this,Lt,0),K(this,vt,0),K(this,Jr,wE.create(t)),K(this,mt,0),K(this,Qr,0),typeof l=="function"&&K(this,Kr,l),typeof c=="function"&&K(this,xa,c),typeof h=="function"?(K(this,Zr,h),K(this,Tt,[])):(K(this,Zr,void 0),K(this,Tt,void 0)),K(this,ri,!!v(this,Kr)),K(this,Ll,!!v(this,xa)),K(this,$t,!!v(this,Zr)),this.noDisposeOnSet=!!d,this.noUpdateTTL=!!p,this.noDeleteOnFetchRejection=!!T,this.allowStaleOnFetchRejection=!!w,this.allowStaleOnFetchAbort=!!A,this.ignoreFetchAbort=!!P,this.maxEntrySize!==0){if(v(this,fr)!==0&&!fn(v(this,fr)))throw new TypeError("maxSize must be a positive integer if specified");if(!fn(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");Y(this,G,aM).call(this);}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!S,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=fn(s)||s===0?s:1,this.ttlAutopurge=!!n,this.ttl=i||0,this.ttl){if(!fn(this.ttl))throw new TypeError("ttl must be a positive integer if specified");Y(this,G,PE).call(this);}if(v(this,jr)===0&&this.ttl===0&&v(this,fr)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!v(this,jr)&&!v(this,fr)){let D="LRU_CACHE_UNBOUNDED";tO(D)&&(sM.add(D),nM("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",D,DE));}}static unsafeExposeInternals(e){return {starts:v(e,ti),ttls:v(e,mr),sizes:v(e,ei),keyMap:v(e,ct),keyList:v(e,He),valList:v(e,se),next:v(e,Yt),prev:v(e,pr),get head(){return v(e,Lt)},get tail(){return v(e,vt)},free:v(e,Jr),isBackgroundFetch:t=>{var i;return Y(i=e,G,Ne).call(i,t)},backgroundFetch:(t,i,s,n)=>{var o;return Y(o=e,G,ob).call(o,t,i,s,n)},moveToTail:t=>{var i;return Y(i=e,G,Rd).call(i,t)},indexes:t=>{var i;return Y(i=e,G,pn).call(i,t)},rindexes:t=>{var i;return Y(i=e,G,mn).call(i,t)},isStale:t=>{var i;return v(i=e,gr).call(i,t)}}}get max(){return v(this,jr)}get maxSize(){return v(this,fr)}get calculatedSize(){return v(this,Qr)}get size(){return v(this,mt)}get fetchMethod(){return v(this,Gl)}get memoMethod(){return v(this,Ul)}get dispose(){return v(this,Kr)}get onInsert(){return v(this,xa)}get disposeAfter(){return v(this,Zr)}getRemainingTTL(e){return v(this,ct).has(e)?1/0:0}*entries(){for(let e of Y(this,G,pn).call(this))v(this,se)[e]!==void 0&&v(this,He)[e]!==void 0&&!Y(this,G,Ne).call(this,v(this,se)[e])&&(yield [v(this,He)[e],v(this,se)[e]]);}*rentries(){for(let e of Y(this,G,mn).call(this))v(this,se)[e]!==void 0&&v(this,He)[e]!==void 0&&!Y(this,G,Ne).call(this,v(this,se)[e])&&(yield [v(this,He)[e],v(this,se)[e]]);}*keys(){for(let e of Y(this,G,pn).call(this)){let t=v(this,He)[e];t!==void 0&&!Y(this,G,Ne).call(this,v(this,se)[e])&&(yield t);}}*rkeys(){for(let e of Y(this,G,mn).call(this)){let t=v(this,He)[e];t!==void 0&&!Y(this,G,Ne).call(this,v(this,se)[e])&&(yield t);}}*values(){for(let e of Y(this,G,pn).call(this))v(this,se)[e]!==void 0&&!Y(this,G,Ne).call(this,v(this,se)[e])&&(yield v(this,se)[e]);}*rvalues(){for(let e of Y(this,G,mn).call(this))v(this,se)[e]!==void 0&&!Y(this,G,Ne).call(this,v(this,se)[e])&&(yield v(this,se)[e]);}[(iM=Symbol.iterator,rM=Symbol.toStringTag,iM)](){return this.entries()}find(e,t={}){for(let i of Y(this,G,pn).call(this)){let s=v(this,se)[i],n=Y(this,G,Ne).call(this,s)?s.__staleWhileFetching:s;if(n!==void 0&&e(n,v(this,He)[i],this))return this.get(v(this,He)[i],t)}}forEach(e,t=this){for(let i of Y(this,G,pn).call(this)){let s=v(this,se)[i],n=Y(this,G,Ne).call(this,s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,v(this,He)[i],this);}}rforEach(e,t=this){for(let i of Y(this,G,mn).call(this)){let s=v(this,se)[i],n=Y(this,G,Ne).call(this,s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,v(this,He)[i],this);}}purgeStale(){let e=false;for(let t of Y(this,G,mn).call(this,{allowStale:true}))v(this,gr).call(this,t)&&(Y(this,G,gn).call(this,v(this,He)[t],"expire"),e=true);return e}info(e){let t=v(this,ct).get(e);if(t===void 0)return;let i=v(this,se)[t],s=Y(this,G,Ne).call(this,i)?i.__staleWhileFetching:i;if(s===void 0)return;let n={value:s};if(v(this,mr)&&v(this,ti)){let o=v(this,mr)[t],a=v(this,ti)[t];if(o&&a){let u=o-(kl.now()-a);n.ttl=u,n.start=Date.now();}}return v(this,ei)&&(n.size=v(this,ei)[t]),n}dump(){let e=[];for(let t of Y(this,G,pn).call(this,{allowStale:true})){let i=v(this,He)[t],s=v(this,se)[t],n=Y(this,G,Ne).call(this,s)?s.__staleWhileFetching:s;if(n===void 0||i===void 0)continue;let o={value:n};if(v(this,mr)&&v(this,ti)){o.ttl=v(this,mr)[t];let a=kl.now()-v(this,ti)[t];o.start=Math.floor(Date.now()-a);}v(this,ei)&&(o.size=v(this,ei)[t]),e.unshift([i,o]);}return e}load(e){this.clear();for(let[t,i]of e){if(i.start){let s=Date.now()-i.start;i.start=kl.now()-s;}this.set(t,i.value,i);}}set(e,t,i={}){var d,p,_,b;if(t===void 0)return this.delete(e),this;let{ttl:s=this.ttl,start:n,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:u}=i,{noUpdateTTL:l=this.noUpdateTTL}=i,c=v(this,Dd).call(this,e,t,i.size||0,a);if(this.maxEntrySize&&c>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=true),Y(this,G,gn).call(this,e,"set"),this;let h=v(this,mt)===0?void 0:v(this,ct).get(e);if(h===void 0)h=v(this,mt)===0?v(this,vt):v(this,Jr).length!==0?v(this,Jr).pop():v(this,mt)===v(this,jr)?Y(this,G,nb).call(this,false):v(this,mt),v(this,He)[h]=e,v(this,se)[h]=t,v(this,ct).set(e,h),v(this,Yt)[v(this,vt)]=h,v(this,pr)[h]=v(this,vt),K(this,vt,h),qd(this,mt)._++,v(this,Nl).call(this,h,c,u),u&&(u.set="add"),l=false,v(this,Ll)&&((d=v(this,xa))==null||d.call(this,t,e,"add"));else {Y(this,G,Rd).call(this,h);let g=v(this,se)[h];if(t!==g){if(v(this,xn)&&Y(this,G,Ne).call(this,g)){g.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:m}=g;m!==void 0&&!o&&(v(this,ri)&&((p=v(this,Kr))==null||p.call(this,m,e,"set")),v(this,$t)&&v(this,Tt)?.push([m,e,"set"]));}else o||(v(this,ri)&&((_=v(this,Kr))==null||_.call(this,g,e,"set")),v(this,$t)&&v(this,Tt)?.push([g,e,"set"]));if(v(this,ba).call(this,h),v(this,Nl).call(this,h,c,u),v(this,se)[h]=t,u){u.set="replace";let m=g&&Y(this,G,Ne).call(this,g)?g.__staleWhileFetching:g;m!==void 0&&(u.oldValue=m);}}else u&&(u.set="update");v(this,Ll)&&this.onInsert?.(t,e,t===g?"update":"replace");}if(s!==0&&!v(this,mr)&&Y(this,G,PE).call(this),v(this,mr)&&(l||v(this,Md).call(this,h,s,n),u&&v(this,Zi).call(this,u,h)),!o&&v(this,$t)&&v(this,Tt)){let g=v(this,Tt),m;for(;m=g?.shift();)(b=v(this,Zr))==null||b.call(this,...m);}return this}pop(){var e;try{for(;v(this,mt);){let t=v(this,se)[v(this,Lt)];if(Y(this,G,nb).call(this,!0),Y(this,G,Ne).call(this,t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(v(this,$t)&&v(this,Tt)){let t=v(this,Tt),i;for(;i=t?.shift();)(e=v(this,Zr))==null||e.call(this,...i);}}}has(e,t={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=t,n=v(this,ct).get(e);if(n!==void 0){let o=v(this,se)[n];if(Y(this,G,Ne).call(this,o)&&o.__staleWhileFetching===void 0)return false;if(v(this,gr).call(this,n))s&&(s.has="stale",v(this,Zi).call(this,s,n));else return i&&v(this,_a).call(this,n),s&&(s.has="hit",v(this,Zi).call(this,s,n)),true}else s&&(s.has="miss");return false}peek(e,t={}){let{allowStale:i=this.allowStale}=t,s=v(this,ct).get(e);if(s===void 0||!i&&v(this,gr).call(this,s))return;let n=v(this,se)[s];return Y(this,G,Ne).call(this,n)?n.__staleWhileFetching:n}async fetch(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:u=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:h=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:p=this.ignoreFetchAbort,allowStaleOnFetchAbort:_=this.allowStaleOnFetchAbort,context:b,forceRefresh:g=false,status:m,signal:y}=t;if(!v(this,xn))return m&&(m.fetch="get"),this.get(e,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:m});let T={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:o,noDisposeOnSet:a,size:u,sizeCalculation:l,noUpdateTTL:c,noDeleteOnFetchRejection:h,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:_,ignoreFetchAbort:p,status:m,signal:y},S=v(this,ct).get(e);if(S===void 0){m&&(m.fetch="miss");let w=Y(this,G,ob).call(this,e,S,T,b);return w.__returned=w}else {let w=v(this,se)[S];if(Y(this,G,Ne).call(this,w)){let U=i&&w.__staleWhileFetching!==void 0;return m&&(m.fetch="inflight",U&&(m.returnedStale=true)),U?w.__staleWhileFetching:w.__returned=w}let A=v(this,gr).call(this,S);if(!g&&!A)return m&&(m.fetch="hit"),Y(this,G,Rd).call(this,S),s&&v(this,_a).call(this,S),m&&v(this,Zi).call(this,m,S),w;let P=Y(this,G,ob).call(this,e,S,T,b),D=P.__staleWhileFetching!==void 0&&i;return m&&(m.fetch=A?"stale":"refresh",D&&A&&(m.returnedStale=true)),D?P.__staleWhileFetching:P.__returned=P}}async forceFetch(e,t={}){let i=await this.fetch(e,t);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(e,t={}){let i=v(this,Ul);if(!i)throw new Error("no memoMethod provided to constructor");let{context:s,forceRefresh:n,...o}=t,a=this.get(e,o);if(!n&&a!==void 0)return a;let u=i(e,a,{options:o,context:s});return this.set(e,u,o),u}get(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:o}=t,a=v(this,ct).get(e);if(a!==void 0){let u=v(this,se)[a],l=Y(this,G,Ne).call(this,u);return o&&v(this,Zi).call(this,o,a),v(this,gr).call(this,a)?(o&&(o.get="stale"),l?(o&&i&&u.__staleWhileFetching!==void 0&&(o.returnedStale=true),i?u.__staleWhileFetching:void 0):(n||Y(this,G,gn).call(this,e,"expire"),o&&i&&(o.returnedStale=true),i?u:void 0)):(o&&(o.get="hit"),l?u.__staleWhileFetching:(Y(this,G,Rd).call(this,a),s&&v(this,_a).call(this,a),u))}else o&&(o.get="miss");}delete(e){return Y(this,G,gn).call(this,e,"delete")}clear(){return Y(this,G,ME).call(this,"delete")}};jr=new WeakMap,fr=new WeakMap,Kr=new WeakMap,xa=new WeakMap,Zr=new WeakMap,Gl=new WeakMap,Ul=new WeakMap,mt=new WeakMap,Qr=new WeakMap,ct=new WeakMap,He=new WeakMap,se=new WeakMap,Yt=new WeakMap,pr=new WeakMap,Lt=new WeakMap,vt=new WeakMap,Jr=new WeakMap,Tt=new WeakMap,ei=new WeakMap,ti=new WeakMap,mr=new WeakMap,ri=new WeakMap,xn=new WeakMap,$t=new WeakMap,Ll=new WeakMap,G=new WeakSet,PE=function(){let e=new Fl(v(this,jr)),t=new Fl(v(this,jr));K(this,mr,e),K(this,ti,t),K(this,Md,(n,o,a=kl.now())=>{if(t[n]=o!==0?a:0,e[n]=o,o!==0&&this.ttlAutopurge){let u=setTimeout(()=>{v(this,gr).call(this,n)&&Y(this,G,gn).call(this,v(this,He)[n],"expire");},o+1);u.unref&&u.unref();}}),K(this,_a,n=>{t[n]=e[n]!==0?kl.now():0;}),K(this,Zi,(n,o)=>{if(e[o]){let a=e[o],u=t[o];if(!a||!u)return;n.ttl=a,n.start=u,n.now=i||s();let l=n.now-u;n.remainingTTL=a-l;}});let i=0,s=()=>{let n=kl.now();if(this.ttlResolution>0){i=n;let o=setTimeout(()=>i=0,this.ttlResolution);o.unref&&o.unref();}return n};this.getRemainingTTL=n=>{let o=v(this,ct).get(n);if(o===void 0)return 0;let a=e[o],u=t[o];if(!a||!u)return 1/0;let l=(i||s())-u;return a-l},K(this,gr,n=>{let o=t[n],a=e[n];return !!a&&!!o&&(i||s())-o>a});},_a=new WeakMap,Zi=new WeakMap,Md=new WeakMap,gr=new WeakMap,aM=function(){let e=new Fl(v(this,jr));K(this,Qr,0),K(this,ei,e),K(this,ba,t=>{K(this,Qr,v(this,Qr)-e[t]),e[t]=0;}),K(this,Dd,(t,i,s,n)=>{if(Y(this,G,Ne).call(this,i))return 0;if(!fn(s))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(s=n(i,t),!fn(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return s}),K(this,Nl,(t,i,s)=>{if(e[t]=i,v(this,fr)){let n=v(this,fr)-e[t];for(;v(this,Qr)>n;)Y(this,G,nb).call(this,true);}K(this,Qr,v(this,Qr)+e[t]),s&&(s.entrySize=i,s.totalCalculatedSize=v(this,Qr));});},ba=new WeakMap,Nl=new WeakMap,Dd=new WeakMap,pn=function*({allowStale:e=this.allowStale}={}){if(v(this,mt))for(let t=v(this,vt);!(!Y(this,G,BE).call(this,t)||((e||!v(this,gr).call(this,t))&&(yield t),t===v(this,Lt)));)t=v(this,pr)[t];},mn=function*({allowStale:e=this.allowStale}={}){if(v(this,mt))for(let t=v(this,Lt);!(!Y(this,G,BE).call(this,t)||((e||!v(this,gr).call(this,t))&&(yield t),t===v(this,vt)));)t=v(this,Yt)[t];},BE=function(e){return e!==void 0&&v(this,ct).get(v(this,He)[e])===e},nb=function(e){var n;let t=v(this,Lt),i=v(this,He)[t],s=v(this,se)[t];return v(this,xn)&&Y(this,G,Ne).call(this,s)?s.__abortController.abort(new Error("evicted")):(v(this,ri)||v(this,$t))&&(v(this,ri)&&((n=v(this,Kr))==null||n.call(this,s,i,"evict")),v(this,$t)&&v(this,Tt)?.push([s,i,"evict"])),v(this,ba).call(this,t),e&&(v(this,He)[t]=void 0,v(this,se)[t]=void 0,v(this,Jr).push(t)),v(this,mt)===1?(K(this,Lt,K(this,vt,0)),v(this,Jr).length=0):K(this,Lt,v(this,Yt)[t]),v(this,ct).delete(i),qd(this,mt)._--,t},ob=function(e,t,i,s){let n=t===void 0?void 0:v(this,se)[t];if(Y(this,G,Ne).call(this,n))return n;let o=new ab,{signal:a}=i;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let u={signal:o.signal,options:i,context:s},l=(b,g=false)=>{let{aborted:m}=o.signal,y=i.ignoreFetchAbort&&b!==void 0;if(i.status&&(m&&!g?(i.status.fetchAborted=true,i.status.fetchError=o.signal.reason,y&&(i.status.fetchAbortIgnored=true)):i.status.fetchResolved=true),m&&!y&&!g)return h(o.signal.reason);let T=p;return v(this,se)[t]===p&&(b===void 0?T.__staleWhileFetching?v(this,se)[t]=T.__staleWhileFetching:Y(this,G,gn).call(this,e,"fetch"):(i.status&&(i.status.fetchUpdated=true),this.set(e,b,u.options))),b},c=b=>(i.status&&(i.status.fetchRejected=true,i.status.fetchError=b),h(b)),h=b=>{let{aborted:g}=o.signal,m=g&&i.allowStaleOnFetchAbort,y=m||i.allowStaleOnFetchRejection,T=y||i.noDeleteOnFetchRejection,S=p;if(v(this,se)[t]===p&&(!T||S.__staleWhileFetching===void 0?Y(this,G,gn).call(this,e,"fetch"):m||(v(this,se)[t]=S.__staleWhileFetching)),y)return i.status&&S.__staleWhileFetching!==void 0&&(i.status.returnedStale=true),S.__staleWhileFetching;if(S.__returned===S)throw b},d=(b,g)=>{var y;let m=(y=v(this,Gl))==null?void 0:y.call(this,e,n,u);m&&m instanceof Promise&&m.then(T=>b(T===void 0?void 0:T),g),o.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(b(void 0),i.allowStaleOnFetchAbort&&(b=T=>l(T,true)));});};i.status&&(i.status.fetchDispatched=true);let p=new Promise(d).then(l,c),_=Object.assign(p,{__abortController:o,__staleWhileFetching:n,__returned:void 0});return t===void 0?(this.set(e,_,{...u.options,status:void 0}),t=v(this,ct).get(e)):v(this,se)[t]=_,_},Ne=function(e){if(!v(this,xn))return false;let t=e;return !!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof ab},RE=function(e,t){v(this,pr)[t]=e,v(this,Yt)[e]=t;},Rd=function(e){e!==v(this,vt)&&(e===v(this,Lt)?K(this,Lt,v(this,Yt)[e]):Y(this,G,RE).call(this,v(this,pr)[e],v(this,Yt)[e]),Y(this,G,RE).call(this,v(this,vt),e),K(this,vt,e));},gn=function(e,t){var s,n;let i=false;if(v(this,mt)!==0){let o=v(this,ct).get(e);if(o!==void 0)if(i=true,v(this,mt)===1)Y(this,G,ME).call(this,t);else {v(this,ba).call(this,o);let a=v(this,se)[o];if(Y(this,G,Ne).call(this,a)?a.__abortController.abort(new Error("deleted")):(v(this,ri)||v(this,$t))&&(v(this,ri)&&((s=v(this,Kr))==null||s.call(this,a,e,t)),v(this,$t)&&v(this,Tt)?.push([a,e,t])),v(this,ct).delete(e),v(this,He)[o]=void 0,v(this,se)[o]=void 0,o===v(this,vt))K(this,vt,v(this,pr)[o]);else if(o===v(this,Lt))K(this,Lt,v(this,Yt)[o]);else {let u=v(this,pr)[o];v(this,Yt)[u]=v(this,Yt)[o];let l=v(this,Yt)[o];v(this,pr)[l]=v(this,pr)[o];}qd(this,mt)._--,v(this,Jr).push(o);}}if(v(this,$t)&&v(this,Tt)?.length){let o=v(this,Tt),a;for(;a=o?.shift();)(n=v(this,Zr))==null||n.call(this,...a);}return i},ME=function(e){var t,i;for(let s of Y(this,G,mn).call(this,{allowStale:true})){let n=v(this,se)[s];if(Y(this,G,Ne).call(this,n))n.__abortController.abort(new Error("deleted"));else {let o=v(this,He)[s];v(this,ri)&&((t=v(this,Kr))==null||t.call(this,n,o,e)),v(this,$t)&&v(this,Tt)?.push([n,o,e]);}}if(v(this,ct).clear(),v(this,se).fill(void 0),v(this,He).fill(void 0),v(this,mr)&&v(this,ti)&&(v(this,mr).fill(0),v(this,ti).fill(0)),v(this,ei)&&v(this,ei).fill(0),K(this,Lt,0),K(this,vt,0),v(this,Jr).length=0,K(this,Qr,0),K(this,mt,0),v(this,$t)&&v(this,Tt)){let s=v(this,Tt),n;for(;n=s?.shift();)(i=v(this,Zr))==null||i.call(this,...n);}};var ub=DE;var Si=class{constructor(e){L(this,"cache");L(this,"map",new Map);this.cache=new ub({max:e.cacheSize}),this.map=new Map;}get[Symbol.iterator](){return this.map[Symbol.iterator]}get[Symbol.toStringTag](){return this.map[Symbol.toStringTag]}clear(){return this.cache.clear(),this.map.clear()}delete(e){let t=this.map.delete(e);return t&&this.cache.delete(e),t}get forEach(){return this.map.forEach}get(e){let t=this.cache.get(e);return t||this.map.get(e)}has(e){return this.map.has(e)}set(e,t){return this.map.set(e,t),this.cache.set(e,t),this}get size(){return this.map.size}entries(){return this.map.entries()}keys(){return this.map.keys()}values(){return this.map.values()}};var Id=new Si({cacheSize:5});function rO(r){return function(e){lb.add(e,r);}}var lb;(s=>{function r(n,o){o||(o=n.name),Id.get(o)&&H.warn(`CanvasElement "${o}" already registered`),n.prototype.pixivnId=o,Id.set(o,n);}s.add=r;function e(n){try{let o=Id.get(n);if(!o){H.error(`CanvasElement "${n}" not found, did you forget to register it with the canvasComponentDecorator?`);return}return new o,o}catch(o){H.error(`Error while getting CanvasElement "${n}"`,o);return}}s.get=e;function t(){return Array.from(Id.values())}s.values=t;function i(n){return Id.has(n)}s.has=i;})(lb||(lb={}));var qt=lb;var Hl=new Si({cacheSize:5});function iO(r){return function(e){cb.add(e,r);}}var cb;(n=>{function r(o,a){a||(a=o.name),Hl.get(a)&&H.info(`Event "${a}" already exists, it will be overwritten`),o.prototype.id=a,Hl.set(a,o);}n.add=r;function e(o){try{let a=Hl.get(o);if(!a){H.error(`Event "${o}" not found, did you forget to register it with the eventDecorator?`);return}return new a,a}catch(a){H.error(`Error while getting Event "${o}"`,a);return}}n.get=e;function t(o){try{let a=Hl.get(o);if(!a){H.error(`Event "${o}" not found, did you forget to register it with the eventDecorator?`);return}return new a}catch(a){H.error(`Error while getting Event "${o}"`,a);return}}n.getInstance=t;function i(){return Array.from(Hl.values())}n.values=i;function s(o){return Hl.has(o)}n.has=s;})(cb||(cb={}));var Qi=cb;async function hb(r){let e=sO(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 sO(r){try{let e=qt.get(r);return e?new e:void 0}catch(e){H.error(`Error while getting CanvasElement ${r}`,e);return}}we();function IE(r){return "memory"in r?r.memory:r instanceof ir?kE(r):r instanceof Ae?kd(r):ya(r)}function nO(r){return {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 uM(r,e){return {url:r.source.label,alias:e===r.source.label?void 0:e}}function ya(r,e){let t=oO(r,Ml),s=e?.childrenExport||false?r.children.sort((n,o)=>r.getChildIndex(n)-r.getChildIndex(o)).map(n=>IE(n)):[];return {pixivnId:t,elements:s,...nO(r)}}function kd(r){let e=ya(r),t=e.pixivnId??Dl,i=cM(r),s="textureAlias"in r?uM(r.texture,r.textureAlias):uM(r.texture);return {...e,pixivnId:t,textureData:s,anchor:{x:r.anchor.x,y:r.anchor.y},roundPixels:r.roundPixels,onEvents:i}}function kE(r){let e=ya(r),t=e.pixivnId??Il,i=cM(r);return {...e,pixivnId:t,anchor:{x:r.anchor.x,y:r.anchor.y},text:r.text,resolution:r.resolution,style:aO(r.style),roundPixels:r.roundPixels,onEvents:i}}function oO(r,e){return Object.prototype.hasOwnProperty.call(r,"pixivnId")?r.pixivnId:e}function cM(r){return "onEvents"in r?r.onEvents:{}}function lM(r,e){if(typeof r!="object"||r===null)return r;H.warn(`Unsupported property type for Text.style.${e}: FillGradient or FillPattern.`,r);}function aO(r){return {align:r.align,breakWords:r.breakWords,dropShadow:r.dropShadow,fill:lM(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:lM(r.stroke,"stroke"),textBaseline:r.textBaseline,trim:r.trim,whiteSpace:r.whiteSpace,wordWrap:r.wordWrap,wordWrapWidth:r.wordWrapWidth}}var va=class extends q{constructor(t){super(t);L(this,"pixivnId",Ml);L(this,"_onEvents",{});this.pixivnId=this.constructor.prototype.pixivnId||Ml;}get memory(){return ya(this,{childrenExport:true})}set memory(t){}async setMemory(t){return this.memory=t,await this.importChildren(t),await Ei(this,t)}async importChildren(t){for(let i=0;i<t.elements.length;i++){let s=t.elements[i],n=await hb(s);this.addChild(n);}}get onEvents(){return this._onEvents}onEvent(t,i){let s=i.prototype.id,n=Qi.getInstance(s);return this._onEvents[t]=s,n?super.on(t,()=>{n.fn(t,this);}):H.error(`Event ${s} not found`),this}on(t,i,s){return super.on(t,i,s)}};qt.add(va,Ml);async function Ei(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));}we();var Fd=class Fd{static init(e){Fd._getScreen=e.getScreen;}static get screen(){return Fd._getScreen()}};L(Fd,"_getScreen");var sr=Fd;function Ji(r,e,t,i,s,n=0){return i=i*(s?-1:1),r==="width"?e*(sr.screen.width-t)+i+n*t+(s?t:0):e*(sr.screen.height-t)+i+n*t+(s?t:0)}function Ai(r,e,t,i,s,n=0){return i=i*(s?-1:1),r==="width"?(e-i-n*t-(s?t:0))/(sr.screen.width-t):(e-i-n*t-(s?t:0))/(sr.screen.height-t)}function es(r,e){return r==="width"?e*sr.screen.width:e*sr.screen.height}function Ci(r,e){return r==="width"?e/sr.screen.width:e/sr.screen.height}function st(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),n=r.x*i-r.y*s,o=r.x*s+r.y*i;return r.x!==0&&Math.sign(n)!==Math.sign(r.x)&&(n=-n),r.y!==0&&Math.sign(o)!==Math.sign(r.y)&&(o=-o),{x:n,y:o}}else if(e>90&&e<180){let t=(e-90)*Math.PI/180,i=Math.cos(t),s=Math.sin(t),n=-r.y*s-r.x*i,o=r.y*i-r.x*s;return r.x!==0&&Math.sign(n)!==Math.sign(r.x)&&(n=-n),r.y!==0&&Math.sign(o)!==Math.sign(r.y)&&(o=-o),{x:n,y:o}}else if(e>180&&e<270){let t=(e-180)*Math.PI/180,i=Math.cos(t),s=Math.sin(t),n=-r.x*i+r.y*s,o=-r.x*s-r.y*i;return r.x!==0&&Math.sign(n)!==Math.sign(r.x)&&(n=-n),r.y!==0&&Math.sign(o)!==Math.sign(r.y)&&(o=-o),{x:n,y:o}}else if(e>270&&e<360){let t=(e-270)*Math.PI/180,i=Math.cos(t),s=Math.sin(t),n=r.y*s-r.x*i,o=-r.y*i-r.x*s;return r.x!==0&&Math.sign(n)!==Math.sign(r.x)&&(n=-n),r.y!==0&&Math.sign(o)!==Math.sign(r.y)&&(o=-o),{x:n,y:o}}return {x:0,y:0}}function FE(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 wi(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 Pi(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))}we();var uO=new RegExp(`(${$R.join("|")})$`);function Od(r){let e=rt.cache.has(r)?rt.get(r):null;return e instanceof C&&(r=e.source?.label||r),uO.test(r)}function Ta(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.percentageX===void 0&&(r.percentageX=r.xPercentagePosition),r.yPercentagePosition!=null&&r.percentageY===void 0&&(r.percentageY=r.yPercentagePosition),r.percentageX!=null&&(r.percentagePosition===void 0?(r.percentagePosition={x:r.percentageX},delete r.percentageX):(r.percentagePosition.x=r.percentageX,delete r.percentageX)),r.percentageY!=null&&(r.percentagePosition===void 0?(r.percentagePosition={y:r.percentageY},delete r.percentageY):(r.percentagePosition.y=r.percentageY,delete r.percentageY))),r)}we();we();async function Bi(r){if(r!=="EMPTY"){if(!r){H.error("Texture not found",r);return}if(rt.cache.has(r)){let e=rt.get(r);if(e)return e}return rt.load(r).then(e=>{if(!e){H.error("Texture not found",r);return}if(!(e instanceof C)){H.error("File not is a file",r);return}return e}).catch(e=>{H.error("Error loading file",e);})}}we();var ts=class r extends Ae{constructor(t){super(t);L(this,"pixivnId",Dl);L(this,"_textureAlias");L(this,"_onEvents",{});this.pixivnId=this.constructor.prototype.pixivnId||Dl;}get textureAlias(){return this._textureAlias?this._textureAlias:this.texture.source.label}set textureAlias(t){this._textureAlias=t;}get memory(){return kd(this)}set memory(t){}async setMemory(t){return this.memory=t,await Gd(this,t)}get onEvents(){return this._onEvents}onEvent(t,i){let s=i.prototype.id,n=Qi.getInstance(s);return this._onEvents[t]=s,n?(super.on(t,()=>{n.fn(t,this);}),this.interactive||(this.interactive=true,this.eventMode="dynamic")):H.error(`Event ${s} not found`),this}on(t,i,s){return super.on(t,i,s)}static from(t,i){let s=Ae.from(t,i),n=new r;return n.texture=s.texture,n}};qt.add(ts,Dl);async function Gd(r,e,t){let i=t?.ignoreTexture||false;if(await Ei(r,e),!i){if("textureImage"in e&&e.textureImage&&e.textureImage.image){let n=await Bi(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&&rt.resolver.hasKey(e.textureData.alias)&&(n=e.textureData.alias);let o=await Bi(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=Qi.get(o);a&&r.onEvent(n,a);}}var Pe=class r extends ts{constructor(t,i){t=Ta(t);let s,n;t&&"align"in t&&t?.align!==void 0&&(s=t.align,delete t.align),t&&"percentagePosition"in t&&t?.percentagePosition!==void 0&&(n=t.percentagePosition,delete t.percentagePosition);super(t);L(this,"pixivnId",EE);L(this,"_loadIsStarted",false);L(this,"_align");L(this,"_percentagePosition");i&&(this.textureAlias=i),s&&(this.align=s),n&&(this.percentagePosition=n);}get memory(){return {...kd(this),pixivnId:this.pixivnId,align:this._align,percentagePosition:this._percentagePosition,loadIsStarted:this._loadIsStarted}}set memory(t){}async setMemory(t){this.memory=t,await Ud(this,t),this.reloadPosition();}static from(t,i){let s=Ae.from(t,i),n=new r;return n.texture=s.texture,n}get loadIsStarted(){return this._loadIsStarted}async load(){return this._loadIsStarted=true,Bi(this.textureAlias).then(t=>{this._loadIsStarted=false,t&&(this.texture=t);}).catch(t=>{this._loadIsStarted=false,H.error("Error into ImageSprite.load()",t);})}set texture(t){super.texture=t,this.reloadPosition();}get texture(){return super.texture}get haveEmptyTexture(){return this.texture._source.label==="EMPTY"}set align(t){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),typeof t=="number"?(this._align.x=t,this._align.y=t):(t.x!==void 0&&(this._align.x=t.x),t.y!==void 0&&(this._align.y=t.y)),this.reloadPosition();}get align(){let t=st(this.pivot,this.angle),i=st(this.scale,this.angle);return {x:Ai("width",this.x,wi(this),t.x,i.x<0,this.anchor.x),y:Ai("height",this.y,Pi(this),t.y,i.y<0,this.anchor.y)}}set xAlign(t){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),this._align.x=t,this.reloadPosition();}get xAlign(){let t=st(this.pivot,this.angle),i=st(this.scale,this.angle);return Ai("width",this.x,wi(this),t.x,i.x<0,this.anchor.x)}set yAlign(t){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),this._align.y=t,this.reloadPosition();}get yAlign(){let t=st(this.pivot,this.angle),i=st(this.scale,this.angle);return Ai("height",this.y,Pi(this),t.y,i.y<0,this.anchor.y)}set percentagePosition(t){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),typeof t=="number"?(this._percentagePosition.x=t,this._percentagePosition.y=t):(t.x!==void 0&&(this._percentagePosition.x=t.x),t.y!==void 0&&(this._percentagePosition.y=t.y)),this.reloadPosition();}get percentagePosition(){return {x:Ci("width",this.x),y:Ci("height",this.y)}}get percentageX(){return Ci("width",this.x)}set percentageX(t){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.x=t,this.reloadPosition();}get percentageY(){return Ci("height",this.y)}set percentageY(t){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.y=t,this.reloadPosition();}set xPercentagePosition(t){this.percentageX=t;}get xPercentagePosition(){return this.percentageX}set yPercentagePosition(t){this.percentageY=t;}get yPercentagePosition(){return this.percentageY}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(t){t.type==="align"?this.align={x:t.x,y:t.y}:t.type==="percentage"?this.percentagePosition={x:t.x,y:t.y}:this.position.set(t.x,t.y);}reloadPosition(){if(this._align){let t=st(this.pivot,this.angle),i=st(this.scale,this.angle);this._align.x!==void 0&&(super.x=Ji("width",this._align.x,wi(this),t.x,i.x<0,this.anchor.x)),this._align.y!==void 0&&(super.y=Ji("height",this._align.y,Pi(this),t.y,i.y<0,this.anchor.y));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=es("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=es("height",this._percentagePosition.y)));}get position(){return super.position}set position(t){this._align=void 0,this._percentagePosition=void 0,super.position=t;}get x(){return super.x}set x(t){this._align=void 0,this._percentagePosition=void 0,super.x=t;}get y(){return super.y}set y(t){this._align=void 0,this._percentagePosition=void 0,super.y=t;}};qt.add(Pe,EE);async function Ud(r,e,t){let i=t?.ignoreTexture||false;return e=Ta(e),await Gd(r,e,{half:async()=>{i||"imageLink"in e&&e.imageLink!==void 0&&(r.textureAlias=e.imageLink),"loadIsStarted"in e&&e.loadIsStarted&&await r.load(),"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)),"align"in e&&e.align!==void 0&&(r.align=e.align),"percentagePosition"in e&&e.percentagePosition!==void 0&&(r.percentagePosition=e.percentagePosition);},ignoreTexture:t?.ignoreTexture})}we();var Xt=class r extends Pe{constructor(t,i){let s,n,o;t&&"loop"in t&&t?.loop!==void 0&&(s=t.loop,delete t.loop),t&&"paused"in t&&t?.paused!==void 0&&(n=t.paused,delete t.paused),t&&"currentTime"in t&&t?.currentTime!==void 0&&(o=t.currentTime,delete t.currentTime);super(t,i);L(this,"pixivnId",AE);L(this,"_looop",false);L(this,"_paused",false);L(this,"_currentTime",0);s&&(this.loop=s),n&&(this.paused=n),o&&(this.currentTime=o);}get memory(){return {...super.memory,pixivnId:this.pixivnId,loop:this.loop,paused:this._paused,currentTime:this.currentTime}}set memory(t){}async setMemory(t){return this.memory=t,await OE(this,t)}static from(t,i){let s=Ae.from(t,i),n=new r;return n.texture=s.texture,n}async load(){await super.load(),this.loop=this._looop,this.currentTime=this._currentTime,this.paused=this._paused;}get loop(){return this.texture?.source?.resource?.loop||false}set loop(t){this._looop=t,this.texture?.source?.resource&&(this.texture.source.resource.loop=t);}get paused(){return this.texture?.source?.resource?.paused||false}set paused(t){t?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();}get currentTime(){return this.texture?.source?.resource?.currentTime||0}set currentTime(t){let i=this.duration;i&&t>=i&&(t=0),this._currentTime=t,this.texture?.source?.resource&&(this.texture.source.resource.currentTime=t);}restart(){this.currentTime=0;}get duration(){if(this.texture?.source?.resource)return this.texture.source.resource.duration||0}};qt.add(Xt,AE);async function OE(r,e,t){await Ud(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 Le=class extends va{constructor(t,i=[]){t=Ta(t);let s,n,o;t&&"anchor"in t&&t?.anchor!==void 0&&(o=t.anchor,delete t.anchor),t&&"align"in t&&t?.align!==void 0&&(s=t.align,delete t.align),t&&"percentagePosition"in t&&t?.percentagePosition!==void 0&&(n=t.percentagePosition,delete t.percentagePosition);super(t);L(this,"pixivnId",rb);L(this,"_loadIsStarted",false);L(this,"_anchor");L(this,"_align");L(this,"_percentagePosition");t=Ta(t),i&&i.forEach(a=>{let u;Od(a)?u=new Xt(void 0,a):u=new Pe(void 0,a),this.addChild(u);}),o&&(this.anchor=o),s&&(this.align=s),n&&(this.percentagePosition=n);}get memory(){return {...super.memory,pixivnId:rb,anchor:this._anchor,align:this._align,percentagePosition:this._percentagePosition,loadIsStarted:this._loadIsStarted}}set memory(t){}async setMemory(t){this.memory=t,await this.importChildren(t),await GE(this,t),this.reloadAnchor(),this.reloadPosition();}get loadIsStarted(){return this._loadIsStarted}async load(){this._loadIsStarted=true;let t=Array(this.children.length);for(let i=0;i<this.children.length;i++)t[i]=this.children[i].load();return Promise.all(t).then(()=>{this._loadIsStarted=false,this.reloadAnchor(),this.reloadPosition();}).catch(i=>{this._loadIsStarted=false,H.error("Error into ImageContainer.load()",i);})}get texture(){return this.children.length>0?this.children[0].texture:new C}get haveEmptyTexture(){return this.children.some(t=>t.texture._source.label==="EMPTY")}get anchor(){let t=super.pivot.x/this.width,i=super.pivot.y/this.height;return {x:t,y:i}}set anchor(t){typeof t=="number"?this._anchor={x:t,y:t}:this._anchor=t,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(t){this._anchor=void 0,super.pivot=t;}set align(t){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),typeof t=="number"?(this._align.x=t,this._align.y=t):(t.x!==void 0&&(this._align.x=t.x),t.y!==void 0&&(this._align.y=t.y)),this.reloadPosition();}get align(){let t=st(this.pivot,this.angle),i=st(this.scale,this.angle);return {x:Ai("width",this.x,wi(this),t.x,i.x<0,this.anchor.x),y:Ai("height",this.y,Pi(this),t.y,i.y<0,this.anchor.y)}}set xAlign(t){this._percentagePosition&&(this._percentagePosition=void 0),this._align===void 0&&(this._align={}),this._align.x=t,this.reloadPosition();}get xAlign(){let t=st(this.pivot,this.angle),i=st(this.scale,this.angle);return Ai("width",this.x,wi(this),t.x,i.x<0,this.anchor.x)}set yAlign(t){this._percentagePosition&&(this._percentagePosition=void 0),this._align===void 0&&(this._align={}),this._align.y=t,this.reloadPosition();}get yAlign(){let t=st(this.pivot,this.angle),i=st(this.scale,this.angle);return Ai("height",this.y,Pi(this),t.y,i.y<0,this.anchor.y)}set percentagePosition(t){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),typeof t=="number"?(this._percentagePosition.x=t,this._percentagePosition.y=t):(t.x!==void 0&&(this._percentagePosition.x=t.x),t.y!==void 0&&(this._percentagePosition.y=t.y)),this.reloadPosition();}get percentagePosition(){return {x:Ci("width",this.x),y:Ci("height",this.y)}}set percentageX(t){this._align&&(this._align=void 0),this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.x=t,this.reloadPosition();}get percentageX(){return Ci("width",this.x)}set xPercentagePosition(t){this.percentageX=t;}get xPercentagePosition(){return this.percentageX}set yPercentagePosition(t){this.percentageY=t;}get yPercentagePosition(){return this.percentageY}set percentageY(t){this._align&&(this._align=void 0),this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.y=t,this.reloadPosition();}get percentageY(){return Ci("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(t){t.type==="align"?this.align={x:t.x,y:t.y}:t.type==="percentage"?this.percentagePosition={x:t.x,y:t.y}:this.position.set(t.x,t.y);}reloadPosition(){if(this._align){let t=st(this.pivot,this.angle),i=st(this.scale,this.angle);this._align.x!==void 0&&(super.x=Ji("width",this._align.x,wi(this),t.x,i.x<0)),this._align.y!==void 0&&(super.y=Ji("height",this._align.y,Pi(this),t.y,i.y<0));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=es("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=es("height",this._percentagePosition.y)));}get position(){return super.position}set position(t){this._align=void 0,this._percentagePosition=void 0,super.position=t;}get x(){return super.x}set x(t){this._align=void 0,this._percentagePosition=void 0,super.x=t;}get y(){return super.y}set y(t){this._align=void 0,this._percentagePosition=void 0,super.y=t;}};qt.add(Le,rb);async function GE(r,e,t){e=Ta(e),Ei(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();}});}we();var Sa=class extends ir{constructor(t){super(t);L(this,"pixivnId",Il);L(this,"_onEvents",{});this.pixivnId=this.constructor.prototype.pixivnId||Il;}get memory(){return kE(this)}set memory(t){}async setMemory(t){return this.memory=t,await UE(this,t)}get onEvents(){return this._onEvents}onEvent(t,i){let s=i.prototype.id,n=Qi.getInstance(s);return this._onEvents[t]=s,n?(super.on(t,()=>{n.fn(t,this);}),this.interactive||(this.interactive=true,this.eventMode="dynamic")):H.error(`Event ${s} not found`),this}on(t,i,s){return super.on(t,i,s)}};qt.add(Sa,Il);async function UE(r,e){if(await Ei(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=Qi.get(i);s&&r.onEvent(t,s);}}var nr=class{constructor(e,t,i){L(this,"id","ticker_id_not_set");L(this,"args");L(this,"duration");L(this,"priority");this.args=e,this.duration=t,this.priority=i,this.id=this.constructor.prototype.id;}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]),B.onEndOfTicker(t,{aliasToRemoveAfter:s,tickerAliasToResume:n});}};var Vl=new Si({cacheSize:5});function lO(r){return function(e){db.add(e,r);}}var db;(n=>{function r(o,a){a||(a=o.name),Vl.get(a)&&H.info(`Ticker "${a}" already exists, it will be overwritten`),o.prototype.id=a,Vl.set(a,o);}n.add=r;function e(o){try{let a=Vl.get(o);if(!a){H.error(`Event "${o}" not found, did you forget to register it with the tickerDecorator?`);return}return a}catch(a){H.error(`Error while getting Event "${o}"`,a);return}}n.get=e;function t(o,a,u,l){try{let c=Vl.get(o);if(!c){H.error(`Ticker "${o}" not found, did you forget to register it with the tickerDecorator?`);return}return new c(a,u,l)}catch(c){H.error(`Error while getting Ticker "${o}"`,c);return}}n.getInstance=t;function i(){return Array.from(Vl.values())}n.values=i;function s(o){return Vl.has(o)}n.has=s;})(db||(db={}));var or=db;var zl="aliasToRemoveAfter";var Ld=class{get app(){return R.app}get gameLayer(){return R.gameLayer}get isInitialized(){return R._isInitialized}get htmlLayout(){return R.htmlLayers[0]}set htmlLayout(e){this.addHtmlLayer("ui",e);}get canvasWidth(){return R.canvasWidth}get canvasHeight(){return R.canvasHeight}set canvasWidth(e){R.canvasWidth=e;}set canvasHeight(e){R.canvasHeight=e;}get screen(){return this.app.screen}async init(e,t,i,s,n){if(typeof t=="number"&&typeof i=="number")return await R.init(e,t,i,s,n);if(typeof t!="number"&&typeof i!="number")return await R.init(e,t.width,t.height,t,i);throw new Error("Invalid parameters")}initializeHTMLLayout(e){this.addHtmlLayer("ui",e);}get children(){return R.gameLayer.children}async copyCanvasElementProperty(e,t){if(typeof t=="string"){let i=this.find(t);if(i)t=i;else {H.error(`Canvas element ${t} not found`);return}}if(typeof e=="string"){let i=this.find(e);if(i)e=i;else {H.error(`Canvas element ${e} not found`);return}}e instanceof q&&(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 Xt?await OE(t,e,{ignoreTexture:true}):t instanceof Pe?await Ud(t,e,{ignoreTexture:true}):t instanceof ts?await Gd(t,e,{ignoreTexture:true}):t instanceof Sa?await UE(t,e):t instanceof Le?await GE(t,e):t instanceof q&&await Ei(t,e);}transferTickers(e,t,i="move"){R._currentTickersSequence[e]&&(i==="move"?R._currentTickersSequence[t]=Ut(R._currentTickersSequence[e]):i==="duplicate"&&(R._currentTickersSequence[t]=Ut(R._currentTickersSequence[e]))),Object.entries(R._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(zl))){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(R._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));}),R._currentTickersSequence[t]&&Object.keys(R._currentTickersSequence[t]).forEach(s=>{this.runTickersSequence(t,s);}),i==="duplicate"&&R._currentTickersSequence[e]&&Object.keys(R._currentTickersSequence[e]).forEach(s=>{this.runTickersSequence(e,s);});}add(e,t,i={}){if(e===qr){H.error(`The alias ${qr} 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)?H.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));}remove(e,t={}){if(e===qr){H.error(`The alias ${qr} 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);});});}find(e){if(e===qr)return this.gameLayer;let t=this.gameLayer.getChildByLabel(e);if(t)return t}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 R._currentTickers}get currentTickersSteps(){return R._currentTickersSequence}addTicker(e,t){let i=t.id;if(typeof e=="string"&&(e=[e]),!or.getInstance(i,t.args,t.duration,t.priority)){H.error(`Ticker ${i} not found`);return}let s={fn:()=>{},id:i,args:Ut(t.args),canvasElementAliases:e,priority:t.priority,duration:t.duration,onEndOfTicker:()=>{}},n=R.generateTickerId(s);if(this.pushTicker(n,s,t),this.pushEndOfTicker(n,s,t),t.duration){let o=setTimeout(()=>{R.removeTickerTimeoutInfo(o),R._currentTickersTimeouts[o.toString()]&&this.onEndOfTicker(n,{aliasToRemoveAfter:zl in t.args?t.args.aliasToRemoveAfter||[]:[],tickerAliasToResume:"tickerAliasToResume"in t.args?t.args.tickerAliasToResume||[]:[],ignoreTickerSteps:true});},t.duration*1e3);R.addTickerTimeoutInfo(e,i,o.toString(),true);}return n}pushTicker(e,t,i){R._currentTickers[e]=t,t.fn=s=>{let n=R._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);};}addTickersSequence(e,t,i=0){if(t.length==0){H.warn("The steps of the tickers is empty");return}e in R._currentTickersSequence||(R._currentTickersSequence[e]={});let s={currentStepNumber:i,steps:t.map(o=>o===Bd||o.hasOwnProperty("type")&&o.type==="pause"?o:{ticker:o.id,args:Ut(o.args),duration:o.duration})},n=R.generateTickerId(s);return R._currentTickersSequence[e][n]=s,this.runTickersSequence(e,n),n}runTickersSequence(e,t){if(!R._currentTickersSequence[e]||!R._currentTickersSequence[e][t])return;let i=R._currentTickersSequence[e][t].steps[R._currentTickersSequence[e][t].currentStepNumber];if(i===Bd&&(i=R._currentTickersSequence[e][t].steps[0],R._currentTickersSequence[e][t].currentStepNumber=0,i===Bd)){H.error("TikersSteps has a RepeatType in the first step");return}if(i.hasOwnProperty("type")&&i.type==="pause"){let u=setTimeout(()=>{let l=R._currentTickersTimeouts[u.toString()];l&&l.aliases.forEach(c=>{this.nextTickerStep(c,t);}),R.removeTickerTimeoutInfo(u);},i.duration*1e3);R.addTickerTimeoutInfo(e,"steps",u.toString(),false);return}let s=or.getInstance(i.ticker,i.args,i.duration,i.priority);if(!s){H.error(`Ticker ${i.ticker} not found`);return}let n=s.id,o={fn:()=>{},id:n,args:Ut(s.args),canvasElementAliases:[e],priority:s.priority,duration:s.duration,createdByTicketSteps:{canvasElementAlias:e,id:t},onEndOfTicker:()=>{}},a=R.generateTickerId(o);if(this.pushTicker(a,o,s),s.duration){let u=setTimeout(()=>{let l=R._currentTickersTimeouts[u.toString()];l&&(this.onEndOfTicker(a,{aliasToRemoveAfter:zl in s.args?s.args.aliasToRemoveAfter||[]:[],tickerAliasToResume:"tickerAliasToResume"in s.args?s.args.tickerAliasToResume||[]:[],ignoreTickerSteps:true}),l.aliases.forEach(c=>{this.nextTickerStep(c,t);})),R.removeTickerTimeoutInfo(u);},s.duration*1e3);R.addTickerTimeoutInfo(e,n,u.toString(),false);}}nextTickerStep(e,t){if(R._currentTickersSequence[e]&&R._currentTickersSequence[e][t]){let i=R._currentTickersSequence[e][t];i.currentStepNumber+1<i.steps.length?(i.currentStepNumber++,R._currentTickersSequence[e][t]=i,this.runTickersSequence(e,t)):t&&R._currentTickersSequence[e]&&R._currentTickersSequence[e][t]&&(delete R._currentTickersSequence[e][t],Object.entries(R._currentTickers).forEach(([s,n])=>{n.createdByTicketSteps?.canvasElementAlias===e&&n.createdByTicketSteps.id===t&&this.removeTicker(s);}));}}onEndOfTicker(e,t){let i=R._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(R._currentTickers).forEach(([n,o])=>{o.canvasElementAliases.includes(s)&&(o.canvasElementAliases.length===1?this.removeTicker(n):o.canvasElementAliases=o.canvasElementAliases.filter(a=>a!==s));}),R._currentTickersSequence[s]&&delete R._currentTickersSequence[s],R.removeTickerTimeoutsByAlias(s,false);});return}let i;typeof t=="string"?i=t:t instanceof nr?i=t.id:i=t.prototype.id,e.forEach(s=>{R._currentTickersSequence[s]&&Object.entries(R._currentTickersSequence[s]).forEach(([n,o])=>{o.steps.find(a=>typeof a=="object"&&"ticker"in a&&a.ticker===i)&&delete R._currentTickersSequence[s][n];});}),Object.entries(R._currentTickers).forEach(([s,n])=>{n.id===i&&(R._currentTickers[s].canvasElementAliases=n.canvasElementAliases.filter(o=>!e.includes(o)));}),Object.entries(R._currentTickersTimeouts).forEach(([s,n])=>{n.ticker===i&&n.canBeDeletedBeforeEnd&&(R._currentTickersTimeouts[s].aliases=n.aliases.filter(o=>!e.includes(o)));}),this.removeTickersWithoutAssociatedCanvasElement();}removeTickersWithoutAssociatedCanvasElement(){Object.entries(R._currentTickers).forEach(([e,t])=>{t.canvasElementAliases=t.canvasElementAliases.filter(i=>this.find(i)),t.canvasElementAliases.length===0&&this.onEndOfTicker(e,{aliasToRemoveAfter:zl in t.args?t.args.aliasToRemoveAfter:[],tickerAliasToResume:"tickerAliasToResume"in t.args?t.args.tickerAliasToResume:[],ignoreTickerSteps:true});}),Object.entries(R._currentTickersSequence).forEach(([e,t])=>{t===void 0&&delete R._currentTickersSequence[e];}),Object.entries(R._currentTickersTimeouts).forEach(([e,{aliases:t}])=>{t.length===0&&R.removeTickerTimeout(e);});}removeAllTickers(){R._currentTickersSequence={},Object.keys(R._currentTickers).forEach(e=>{this.removeTicker(e);}),R._currentTickers={};for(let e in R._currentTickersTimeouts)R.removeTickerTimeout(e);R._tickersToCompleteOnStepEnd={tikersIds:[],stepAlias:[]},R._tickersOnPause={};}removeTicker(e){typeof e=="string"&&(e=[e]),e.forEach(t=>{let i=R._currentTickers[t];if(i){if(i.args.hasOwnProperty(zl)){let s=i.args.aliasToRemoveAfter;this.remove(s);}this.app.ticker.remove(i.fn),delete R._currentTickers[t];}});}pauseTicker(e,t={}){let i=R._tickersOnPause[e];if(!i){R._tickersOnPause[e]=t;return}t.tickerIdsExcluded&&(i.tickerIdsExcluded?R._tickersOnPause[e].tickerIdsExcluded=[...i.tickerIdsExcluded,...t.tickerIdsExcluded]:R._tickersOnPause[e].tickerIdsExcluded=t.tickerIdsExcluded),t.tickerIdsIncluded&&(i.tickerIdsIncluded?R._tickersOnPause[e].tickerIdsIncluded=[...i.tickerIdsIncluded,...t.tickerIdsIncluded]:R._tickersOnPause[e].tickerIdsIncluded=t.tickerIdsIncluded);}resumeTicker(e){typeof e=="string"&&(e=[e]),e.forEach(t=>{delete R._tickersOnPause[t];});}isTickerPaused(e,t){let i=R._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?R._tickersToCompleteOnStepEnd.stepAlias.push({id:e.id,alias:e.alias}):R._tickersToCompleteOnStepEnd.tikersIds.push({id:e.id});}forceCompletionOfTicker(e,t){if(t){let i=R._currentTickersSequence[t];i&&i[e]&&(i[e].steps.includes(Bd)?H.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=or.getInstance(s.ticker,s.args,s.duration,s.priority);n&&n.onEndOfTicker([t],e,s.args);}}));}else {let i=R._currentTickers[e];i&&i.onEndOfTicker();}}addLayer(e,t){if(e===qr){H.error(`The alias ${qr} is reserved`);return}return t.label=e,R.app.stage.addChild(t)}getLayer(e){return R.app.stage.getChildByLabel(e)}removeLayer(e){R.app.stage.getChildrenByLabel(e);}addHtmlLayer(e,t,i){return R.addHtmlLayer(e,t,i)}removeHtmlLayer(e){return R.removeHtmlLayer(e)}getHtmlLayer(e){return R.getHtmlLayer(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]=IE(t));}),{tickers:Ut(R.currentTickersWithoutCreatedBySteps),tickersSteps:Ut(R._currentTickersSequence),elements:Ut(e),stage:Ut(ya(this.gameLayer)),elementAliasesOrder:Ut(R.childrenAliasesOrder),tickersOnPause:Ut(R._tickersOnPause),tickersToCompleteOnStepEnd:Ut(R._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=>hb(i[a])),o=await Promise.all(n);this.clear(),o.forEach((a,u)=>{let l=s[u];this.add(l,a),R.childrenAliasesOrder.push(l);});}else {H.error("The data does not have the properties elementAliasesOrder and elements");return}if(e.hasOwnProperty("stage")&&e.hasOwnProperty("stage")?Ei(this.gameLayer,e.stage,{ignoreScale:!0}):H.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=or.getInstance(n.id,n.args,n.duration,n.priority);if(a){let u=this.addTicker(o,a);u&&(t[s]=u);}else H.error(`Ticker ${n.id} not found`);});}if(e.hasOwnProperty("tickersSteps")){let i=e.tickersSteps;Object.entries(i).forEach(([s,n])=>{R._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));}),R._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}));R._tickersToCompleteOnStepEnd={tikersIds:s,stepAlias:n};}}catch(t){H.error("Error importing data",t);}}};var fb=class{constructor(){L(this,"id","event_id_not_set");this.id=this.constructor.prototype.id;}fn(e,t){throw new Error("[Pixi\u2019VN] The method CanvasEvent.fn() must be overridden")}};var pb=class{constructor(){L(this,"pixivnId","canvas_element_id_not_set");}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")}};we();we();function _n(r){return (r instanceof Pe||r instanceof Le)&&r.haveEmptyTexture?false:!(r instanceof Ae&&r.texture?.label=="EMPTY")}function bn(r,e,t){let{limit:i}=t;r[e]===void 0||!t||r[e]===i||(typeof r[e]=="number"?t.type==="linear"?r[e]=LE(r[e],t):t.type==="exponential"&&(r[e]=NE(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=LE(r[e].x,t),r[e].y=LE(r[e].y,t)):t.type==="exponential"&&(r[e].x=NE(r[e].x,t),r[e].y=NE(r[e].y,t))));}function LE(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 NE(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 cO=5,rs=class extends nr{constructor(e={},t,i){super(e,t,i);}fn(e,t,i,s){t.speed===void 0&&(t.duration===void 0?t.speed=cO: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=B.find(c);return !(!h||o&&!_n(h))}).forEach(c=>{let h=B.find(c);if(h&&h instanceof q){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)){H.warn("The speed of the FadeAlphaTicker must be greater than 0."),this.onEndOfTicker(c,s,t,{editAlpha:false});return}}}),a&&bn(t,"speed",a);}onEndOfTicker(e,t,i,s={editAlpha:true}){typeof e=="string"&&(e=[e]),e.forEach(n=>{let o=B.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}};or.add(rs);we();var hO=10;function dO(r,e){let t=Ut(r.destination);if(t.type==="align"){let i,s;e instanceof Ae&&(i=e.anchor.x,s=e.anchor.y);let n=st(e.pivot,e.angle),o=st(e.scale,e.angle);t.x=Ji("width",t.x,wi(e),n.x,o.x<0,i),t.y=Ji("height",t.y,Pi(e),n.y,o.y<0,s);}return t.type==="percentage"&&(t.x=es("width",t.x),t.y=es("height",t.y)),t}var xr=class extends nr{fn(e,t,i,s){t.speed===void 0&&(t.speed=hO);let{speed:n,startOnlyIfHaveTexture:o,speedProgression:a}=t;i.filter(u=>{let l=B.find(u);return !(!l||o&&!_n(l))}).forEach(u=>{let l=B.find(u);if(l&&l instanceof q){let c=dO(t,l),h=c.x-l.x,d=c.y-l.y,p=h>0?1:-1,_=d>0?1:-1,b,g;if(typeof n=="number"){let m=this.speedConvert(n);h===0||d===0?b=g=m:(b=Math.abs(h/(h+d))*m,g=Math.abs(d/(h+d))*m);}else b=this.speedConvert(n.x),g=this.speedConvert(n.y);if(b>0){l.x+=p*b*e.deltaTime;let m=c.x-l.x;(p<0&&m>0||p>0&&m<0)&&(l.x=c.x);}if(g>0){l.y+=_*g*e.deltaTime;let m=c.y-l.y;(_<0&&m>0||_>0&&m<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&&g<1e-5&&!(a&&a.type=="linear"&&a.amt!=0)){H.warn("The speed of the MoveTicker must be greater than 0."),this.onEndOfTicker(u,s,t,{editPosition:false});return}}}),a&&bn(t,"speed",a);}onEndOfTicker(e,t,i,s={editPosition:true}){typeof e=="string"&&(e=[e]),e.forEach(n=>{let o=B.find(n);if(o){let a=i.destination;s.editPosition&&(o instanceof Pe||o instanceof Le?o.positionInfo=a:(o.x=a.x,o.y=a.y));}}),super.onEndOfTicker(e,t,i);}speedConvert(e){return e*(66/400)}};or.add(xr);we();var fO=1,Nd=class extends nr{constructor(e={},t,i){super(e,t,i);}fn(e,t,i,s){t.speed===void 0&&(t.speed=fO);let{clockwise:n=true,speedProgression:o,limit:a}=t,u=this.speedConvert(t.speed);i.filter(l=>{let c=B.find(l);return !(!c||t.startOnlyIfHaveTexture&&!_n(c))}).forEach(l=>{let c=B.find(l);if(c&&c instanceof q&&(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))){H.warn("The speed of the RotateTicker must be greater than 0."),this.onEndOfTicker(l,s,t,{editRotation:false});return}}),o&&bn(t,"speed",o);}onEndOfTicker(e,t,i,s={editRotation:true}){let{limit:n}=i;typeof e=="string"&&(e=[e]),e.forEach(o=>{let a=B.find(o);a&&s.editRotation&&n!==void 0&&(a.angle=n);}),super.onEndOfTicker(e,t,i);}speedConvert(e){return e/100}};or.add(Nd);we();var pO=10,yn=class extends nr{constructor(e={},t,i){super(e,t,i);}fn(e,t,i,s){t.speed===void 0&&(t.speed=pO);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(d=>{let p=B.find(d);return !(!p||a&&!_n(p))}).forEach(d=>{let p=B.find(d);if(p&&p instanceof q){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(d,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(d,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)){H.warn("The speed of the ZoomTicker must be greater than 0."),this.onEndOfTicker(d,s,t,{editScale:false});return}}}),u&&bn(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=B.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}}};or.add(yn);async function mO(r,e={},t){let i=B.find(r);if(!i){H.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){H.error("The number of shocks must be at least 3.");return}let h=Math.floor(c/2),d=Math.ceil(c/2),p=[];for(let g=0;g<h;g++){let m={x:s.x,y:s.y},y=l*(g+1)/h;u==="horizontal"?g%2!==0?m.x=s.x+y:m.x=s.x-y:g%2!==0?m.y=s.y+y:m.y=s.y-y,p.push(new xr({destination:m,speed:n,speedProgression:o,startOnlyIfHaveTexture:a},void 0,t));}let _=h%2===0;for(let g=d;g>0;g--){let m={x:s.x,y:s.y},y=l*(g+1)/(d-1);u==="horizontal"?g%2===0&&!_||g%2!==0&&_?m.x=s.x-y:m.x=s.x+y:g%2===0&&!_||g%2!==0&&_?m.y=s.y-y:m.y=s.y+y,p.push(new xr({destination:m,speed:n,speedProgression:o,startOnlyIfHaveTexture:a},void 0,t));}p.push(new xr({destination:s,speed:n,speedProgression:o,startOnlyIfHaveTexture:a,tickerAliasToResume:r},void 0,t));let b=B.addTickersSequence(r,p);b&&(B.completeTickerOnStepEnd({id:b,alias:r}),B.pauseTicker(r,{tickerIdsExcluded:[b]}));}function mb(r,e,t){let i=new Le(t,e);return B.add(r,i),i}async function gO(r,e,t){let i=new Le(t,e);return await i.load(),B.add(r,i),i}we();function gb(r,e,t){if(!e)if(rt.resolver.hasKey(r))e=r;else throw new Error(`The image ${r} does not exist in the cache.`);let i=new Pe(t,e);return B.add(r,i),i}async function xO(r){if(!Array.isArray(r))return [r];let e=Array(r.length);for(let t=0;t<r.length;t++)e[t]=Bi(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 _O(r,e,t){if(!e)if(rt.resolver.hasKey(r))e=r;else throw new Error(`The image ${r} does not exist in the cache.`);let i=new Pe(t,e);return await i.load(),B.add(r,i),i}we();function xb(r,e,t){if(!e)if(rt.resolver.hasKey(r))e=r;else throw new Error(`The video ${r} does not exist in the cache.`);let i=new Xt(t,e);return B.add(r,i),i}async function bO(r){if(!Array.isArray(r))return [r];let e=Array(r.length);for(let t=0;t<r.length;t++)e[t]=Bi(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 yO(r,e,t){if(!e)if(rt.resolver.hasKey(r))e=r;else throw new Error(`The video ${r} does not exist in the cache.`);let i=new Xt(t,e);return await i.load(),B.add(r,i),i}function Hd(r,e){if(typeof e=="string")return Od(e)?xb(r,e):gb(r,e);if(Array.isArray(e))return mb(r,e);if(typeof e=="object"&&"value"in e&&"options"in e){if(typeof e.value=="string")return Od(e.value)?xb(r,e.value,e.options):gb(r,e.value,e.options);if(Array.isArray(e.value))return mb(r,e.value,e.options)}return B.add(r,e),e}async function hM(r,e,t={},i){let{mustBeCompletedBeforeNextStep:s=true,tickerAliasToResume:n=[]}=t,o=[];e||(e=r),typeof n=="string"&&(n=[n]);let a;if(B.find(r)&&(a=r+"_temp_disolve",B.editAlias(r,a)),e=Hd(r,e),a&&B.copyCanvasElementProperty(a,r),a&&B.transferTickers(a,r,"duplicate"),e.alpha=0,a){let c=_b(a,t,i);c&&(o.push(...c),B.pauseTicker(a,{tickerIdsIncluded:c}),n.push(a));}let u=new rs({...t,type:"show",tickerAliasToResume:n,startOnlyIfHaveTexture:true},void 0,i),l=B.addTicker(r,u);if(l&&(s&&B.completeTickerOnStepEnd({id:l}),o.push(l)),(e instanceof Pe||e instanceof Le)&&e.haveEmptyTexture&&await e.load(),o.length>0)return o}function _b(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 rs({...e,type:"hide",aliasToRemoveAfter:s,startOnlyIfHaveTexture:true},void 0,t),o=B.addTicker(r,n);if(o)return i&&B.completeTickerOnStepEnd({id:o}),[o]}async function vO(r,e,t={},i){let{mustBeCompletedBeforeNextStep:s=true,aliasToRemoveAfter:n=[]}=t,o=[];if(e||(e=r),typeof n=="string"&&(n=[n]),!B.find(r))return hM(r,e,t,i);let a=r+"_temp_fade";B.editAlias(r,a),n.push(a),e=Hd(r,e),a&&B.copyCanvasElementProperty(a,r),a&&B.transferTickers(a,r,"duplicate"),e.alpha=0;let u=_b(a,{...t,tickerAliasToResume:r},i);u&&o.push(...u);let l=new rs({...t,type:"show",startOnlyIfHaveTexture:true,aliasToRemoveAfter:n},void 0,i),c=B.addTicker(r,l);if(c&&(s&&B.completeTickerOnStepEnd({id:c}),o.push(c),B.pauseTicker(r,{tickerIdsIncluded:[c]})),(e instanceof Pe||e instanceof Le)&&e.haveEmptyTexture&&await e.load(),o.length>0)return o}function TO(r,e={},t){return _b(r,e,t)}async function SO(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;B.find(r)&&(c=r+"_temp_movein",B.editAlias(r,c)),e=Hd(r,e),c&&B.copyCanvasElementProperty(c,r),c&&B.transferTickers(c,r,"move");let h;e instanceof Pe||e instanceof Le?h=e.positionInfo:h={x:e.x,y:e.y,type:"pixel"};let d;switch(c&&(u?(d=HE(c,t,i),d&&(l.push(...d),o.push(c))):a.push(c)),(e instanceof Pe||e instanceof Le)&&e.haveEmptyTexture&&await e.load(),c&&B.pauseTicker(c,{tickerIdsIncluded:d}),s){case "up":e.y=B.canvasHeight+e.height;break;case "down":e.y=-e.height;break;case "left":e.x=B.canvasWidth+e.width;break;case "right":e.x=-e.width;break}o.push(r);let p=new xr({...t,tickerAliasToResume:o,aliasToRemoveAfter:a,destination:h,startOnlyIfHaveTexture:true},void 0,i),_=B.addTicker(r,p);if(_&&(B.pauseTicker(r,{tickerIdsExcluded:[_]}),n&&B.completeTickerOnStepEnd({id:_}),l.push(_)),l.length>0)return l}function HE(r,e={},t){let{direction:i="right",mustBeCompletedBeforeNextStep:s=true,aliasToRemoveAfter:n=[]}=e;typeof n=="string"&&(n=[n]),n.push(r);let o=B.find(r);if(!o){H.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=B.canvasHeight+o.height;break;case "left":a.x=-o.width;break;case "right":a.x=B.canvasWidth+o.width;break}let u=new xr({...e,destination:a,startOnlyIfHaveTexture:true,aliasToRemoveAfter:n},void 0,t),l=B.addTicker(r,u);if(l)return B.pauseTicker(r,{tickerIdsExcluded:[l]}),s&&B.completeTickerOnStepEnd({id:l}),[l]}async function EO(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=B.find(r);c&&(l=r+"_temp_zoom",B.editAlias(r,l)),e=Hd(r,e),l&&B.copyCanvasElementProperty(l,r),l&&B.transferTickers(l,r,"move"),s=="up"?(e.pivot.y=B.canvasHeight-e.y,e.pivot.x=B.canvasWidth/2-e.x,e.y=B.canvasHeight,e.x=B.canvasWidth/2):s=="down"?(e.pivot.y=0-e.y,e.pivot.x=B.canvasWidth/2-e.x,e.y=0,e.x=B.canvasWidth/2):s=="left"?(e.pivot.x=B.canvasWidth-e.x,e.pivot.y=B.canvasHeight/2-e.y,e.x=B.canvasWidth,e.y=B.canvasHeight/2):s=="right"&&(e.pivot.x=0-e.x,e.pivot.y=B.canvasHeight/2-e.y,e.x=0,e.y=B.canvasHeight/2),e.pivot=FE(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 _=dM(l,t,i);_&&(u.push(..._),o.push(l));}else a.push(l);B.pauseTicker(l);}o.push(r);let d=new yn({...t,tickerAliasToResume:o,aliasToRemoveAfter:a,startOnlyIfHaveTexture:true,type:"zoom",limit:1,isZoomInOut:h},void 0,i),p=B.addTicker(r,d);if(p&&(B.pauseTicker(r,{tickerIdsExcluded:[p]}),n&&B.completeTickerOnStepEnd({id:p}),u.push(p)),(e instanceof Pe||e instanceof Le)&&e.haveEmptyTexture&&await e.load(),u.length>0)return u}function dM(r,e={},t){let{direction:i="right",mustBeCompletedBeforeNextStep:s=true,aliasToRemoveAfter:n=[]}=e;typeof n=="string"&&(n=[n]),n.push(r);let o=B.find(r);if(!o){H.warn("The canvas component is not found.");return}i=="up"?(o.pivot.y=B.canvasHeight-o.y,o.pivot.x=B.canvasWidth/2-o.x,o.y=B.canvasHeight,o.x=B.canvasWidth/2):i=="down"?(o.pivot.y=0-o.y,o.pivot.x=B.canvasWidth/2-o.x,o.y=0,o.x=B.canvasWidth/2):i=="left"?(o.pivot.x=B.canvasWidth-o.x,o.pivot.y=B.canvasHeight/2-o.y,o.x=B.canvasWidth,o.y=B.canvasHeight/2):i=="right"&&(o.pivot.x=0-o.x,o.pivot.y=B.canvasHeight/2-o.y,o.x=0,o.y=B.canvasHeight/2),o.pivot=FE(o.pivot,o.angle),o.scale.set(1);let a=new yn({...e,startOnlyIfHaveTexture:true,type:"unzoom",limit:0,aliasToRemoveAfter:n},void 0,t),u=B.addTicker(r,a);if(u)return B.pauseTicker(r,{tickerIdsExcluded:[u]}),s&&B.completeTickerOnStepEnd({id:u}),[u]}async function AO(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;B.find(r)&&(u=r+"_temp_push",B.editAlias(r,u)),e=Hd(r,e),u&&B.copyCanvasElementProperty(u,r),u&&B.transferTickers(u,r,"move");let l;if((e instanceof Pe||e instanceof Le)&&e.haveEmptyTexture?l=e.positionInfo:l={x:e.x,y:e.y,type:"pixel"},s=="up"?e.y=-B.canvasHeight+e.y:s=="down"?e.y=B.canvasHeight+e.y:s=="left"?e.x=-B.canvasWidth+e.x:s=="right"&&(e.x=B.canvasWidth+e.x),u){let d=fM(u,{...t,direction:s=="up"?"down":s=="down"?"up":s=="left"?"right":"left"},i);d&&a.push(...d);}o.push(r);let c=new xr({...t,tickerAliasToResume:o,startOnlyIfHaveTexture:true,destination:l},void 0,i),h=B.addTicker(r,c);if(h&&(B.pauseTicker(r,{tickerIdsExcluded:[h]}),n&&B.completeTickerOnStepEnd({id:h}),a.push(h)),(e instanceof Pe||e instanceof Le)&&e.haveEmptyTexture&&await e.load(),a.length>0)return a}function fM(r,e={direction:"right"},t){return HE(r,e,t)}var B=new Ld;sr.init({getScreen:()=>B.screen});exports.CanvasBaseItem=pb;exports.CanvasEvent=fb;exports.CanvasManagerStatic=R;exports.Container=va;exports.FadeAlphaTicker=rs;exports.ImageContainer=Le;exports.ImageSprite=Pe;exports.MoveTicker=xr;exports.RegisteredCanvasComponents=qt;exports.RegisteredEvents=Qi;exports.RegisteredTickers=or;exports.RotateTicker=Nd;exports.Sprite=ts;exports.Text=Sa;exports.TickerBase=nr;exports.VideoSprite=Xt;exports.ZoomTicker=yn;exports.addImage=gb;exports.addImageCointainer=mb;exports.addVideo=xb;exports.canvas=B;exports.canvasComponentDecorator=rO;exports.eventDecorator=iO;exports.getTexture=Bi;exports.loadImage=xO;exports.loadVideo=bO;exports.moveIn=SO;exports.moveOut=HE;exports.pushIn=AO;exports.pushOut=fM;exports.removeWithDissolve=_b;exports.removeWithFade=TO;exports.shakeEffect=mO;exports.showImage=_O;exports.showImageContainer=gO;exports.showVideo=yO;exports.showWithDissolve=hM;exports.showWithFade=vO;exports.tickerDecorator=lO;exports.zoomIn=EO;exports.zoomOut=dM;