@drincs/pixi-vn 1.3.0 → 1.3.1

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.
package/dist/index.cjs CHANGED
@@ -3312,7 +3312,7 @@ fn setSaturation(c: vec3<f32>, s: f32) -> vec3<f32> {
3312
3312
  u32v[offset + (stride * 3)] = c;
3313
3313
  `,dynamic:false}};});var Z8,Rk,Bk,Ik=p(()=>{Xt();_i();Cw();Z8=new Me(0,0,0,0),Rk=class ww extends gt{constructor(e={}){e={...ww.defaultOptions,...e,dynamicProperties:{...ww.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 pp){let l=pp[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 Z8}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")}};Rk.defaultOptions={dynamicProperties:{vertex:false,position:true,rotation:false,uvs:false,color:false},roundPixels:false};Bk=Rk;});var Dk,Pw,b0,Ok=p(()=>{tn();Se();Pe();_i();E_();Dk=class kk extends gt{constructor(e){e instanceof exports.Texture&&(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??Ci.defaultOptions.leftWidth,this._topHeight=a??l?.defaultBorders?.top??Ci.defaultOptions.topHeight,this._rightWidth=o??l?.defaultBorders?.right??Ci.defaultOptions.rightWidth,this._bottomHeight=u??l?.defaultBorders?.bottom??Ci.defaultOptions.bottomHeight,this._width=t??l.width??Ci.defaultOptions.width,this._height=i??l.height??Ci.defaultOptions.height,this.allowChildren=false,this.texture=l??kk.defaultOptions.texture,this.roundPixels=c??false,this._anchor=new ke({_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=exports.Texture.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;}};Dk.defaultOptions={texture:exports.Texture.EMPTY};Pw=Dk,b0=class extends Pw{constructor(...e){let t=e[0];t instanceof exports.Texture&&(G(Y,"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]}),G(Y,"NineSlicePlane is deprecated. Use NineSliceSprite instead."),super(t);}};});function y0(r){let{text:e,style:t,chars:i}=r,s=t,n=Ai.getFont(e,s),o=st.graphemeSegmenter(e),a=Un(o,s,n,true),u=a.scale,l=[],c=[],h=[],d=t.lineHeight?t.lineHeight:n.lineHeight*u,f=0;for(let m of a.lines){if(m.chars.length===0)continue;let _=new J({label:"line"});_.y=f,h.push(_);let x=new J({label:"word"}),g=0;for(let y=0;y<m.chars.length;y++){let v=m.chars[y];if(!v||!n.chars[v])continue;let C=v===" ",A=y===m.chars.length-1,M;i.length>0?(M=i.shift(),M.text=v,M.style=s,M.label=`char-${v}`,M.x=m.charPositions[y]*u-m.charPositions[g]*u):M=new so({text:v,style:s,label:`char-${v}`,x:m.charPositions[y]*u-m.charPositions[g]*u}),C||(l.push(M),x.addChild(M)),(C||A)&&x.children.length>0&&(x.x=m.charPositions[g]*u,c.push(x),_.addChild(x),x=new J({label:"word"}),g=y+1);}f+=d;}return {chars:l,lines:h,words:c}}var Mw=p(()=>{Yt();Gs();Vl();u0();Fd();});var no,v0=p(()=>{Yt();Ei();no=class extends J{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 ht(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 Fk,Gk,Uk=p(()=>{Ei();Mw();v0();Fk=class T0 extends no{constructor(e){let t={...T0.defaultOptions,...e};super(t);}static from(e,t){let i={...T0.defaultOptions,...t,text:e.text,style:new ht(e.style)};return new T0({...i})}splitFn(){return y0({text:this._originalText,style:this._style,chars:this._canReuseChars?this.chars:[]})}};Fk.defaultOptions={autoSplit:true,lineAnchor:0,wordAnchor:0,charAnchor:0};Gk=Fk;});function Q8(r,e,t){switch(r){case "center":return (t-e)/2;case "right":return t-e;case "left":default:return 0}}function Lk(r){return r==="\r"||r===`
3314
3314
  `||r===`\r
3315
- `}function J8(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=Lk(u),h=n.length===0&&l;if(l&&!c&&h)return;c||(n+=u);let d=st.measureText(u,t);o.push({char:u,metric:d}),n.length>=s.length&&(i.push({line:n,chars:o,width:o.reduce((f,m)=>f+m.metric.width,0)}),o=[],n="",a++,s=e.lines[a]);}),i}function S0(r){let{text:e,style:t,chars:i}=r,s=t,n=st.measureText(e,s),o=st.graphemeSegmenter(e),a=J8(o,n,s.clone()),u=s.align,l=n.lineWidths.reduce((x,g)=>Math.max(x,g),0),c=[],h=[],d=[],f=0,m=s.stroke?.width||0,_=s.dropShadow?.distance||0;return a.forEach((x,g)=>{let y=new J({label:`line-${g}`});y.y=f,h.push(y);let v=n.lineWidths[g],S=Q8(u,v,l),C=new J({label:"word"});C.x=S,x.chars.forEach((A,M)=>{if(A.metric.width!==0){if(Lk(A.char)){S+=A.metric.width-m;return}if(A.char===" ")C.children.length>0&&(d.push(C),y.addChild(C)),S+=A.metric.width+s.letterSpacing-m,C=new J({label:"word"}),C.x=S;else {let D;i.length>0?(D=i.shift(),D.text=A.char,D.style=s,D.setFromMatrix(O.IDENTITY),D.x=S-C.x-_*M):D=new Cr({text:A.char,style:s,x:S-C.x-_*M}),c.push(D),C.addChild(D),S+=A.metric.width+s.letterSpacing-m;}}}),C.children.length>0&&(d.push(C),y.addChild(C)),f+=n.lineHeight;}),{chars:c,lines:h,words:d}}var Rw=p(()=>{Te();Yt();Gs();cp();});var Nk,Vk,Hk=p(()=>{Ei();Rw();v0();Nk=class E0 extends no{constructor(e){let t={...E0.defaultOptions,...e};super(t);}static from(e,t){let i={...E0.defaultOptions,...t,text:e.text,style:new ht(e.style)};return new E0({...i})}splitFn(){return S0({text:this._originalText,style:this._style,chars:this._canReuseChars?this.chars:[]})}};Nk.defaultOptions={autoSplit:true,lineAnchor:0,wordAnchor:0,charAnchor:0};Vk=Nk;});async function zk(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 Wk=p(()=>{});function Bw(r,e=0,t={color:"#000000"}){r.renderGroup&&(t.color=eN[tN++]);let i="";for(let o=0;o<e;o++)i+=" ";let s=r.label;!s&&r instanceof De&&(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];Bw(a,e,{...t});}}function Iw(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];Iw(o,e,{...t,index:n});}}var eN,tN,Xk=p(()=>{mn();eN=["#000080","#228B22","#8B0000","#4169E1","#008080","#800000","#9400D3","#FF8C00","#556B2F","#8B008B"],tN=0;});var Yk={};vs(Yk,{AbstractBitmapFont:()=>Gn,AbstractRenderer:()=>rs,AbstractSplitText:()=>no,AbstractText:()=>cs,AccessibilitySystem:()=>cg,AlphaFilter:()=>lD,AlphaMask:()=>Xo,AlphaMaskPipe:()=>Da,AnimatedSprite:()=>$c,Application:()=>Mf,ApplicationInitHook:()=>Ba,Assets:()=>exports.Assets,AssetsClass:()=>Of,BLEND_TO_NPM:()=>Rg,BUFFER_TYPE:()=>su,BackgroundLoader:()=>yc,BackgroundSystem:()=>X_,Batch:()=>ud,BatchGeometry:()=>ml,BatchTextureArray:()=>pl,BatchableGraphics:()=>ks,BatchableHTMLText:()=>Hl,BatchableMesh:()=>Zi,BatchableSprite:()=>ri,BatchableText:()=>Rl,Batcher:()=>Og,BatcherPipe:()=>mf,BigPool:()=>He,BindGroup:()=>Tt,BindGroupSystem:()=>Va,BitmapFont:()=>gu,BitmapFontManager:()=>Ai,BitmapText:()=>so,BitmapTextGraphics:()=>Gd,BitmapTextPipe:()=>fa,BlendModeFilter:()=>ce,BlendModePipe:()=>Fa,BlurFilter:()=>sp,BlurFilterPass:()=>jc,Bounds:()=>Me,BrowserAdapter:()=>_g,Buffer:()=>rt,BufferImageSource:()=>As,BufferResource:()=>ns,BufferUsage:()=>fe,CLEAR:()=>St,Cache:()=>Ee,CanvasObserver:()=>dn,CanvasPool:()=>fr,CanvasPoolClass:()=>Dd,CanvasSource:()=>Rt,CanvasTextGenerator:()=>Us,CanvasTextMetrics:()=>st,CanvasTextPipe:()=>aa,CanvasTextSystem:()=>da,Circle:()=>Bl,Color:()=>te,ColorBlend:()=>Wd,ColorBurnBlend:()=>Xd,ColorDodgeBlend:()=>Yd,ColorMask:()=>Yo,ColorMaskPipe:()=>ka,ColorMatrixFilter:()=>Jy,CompressedSource:()=>si,Container:()=>J,Culler:()=>ky,CullerPlugin:()=>zf,CustomRenderPipe:()=>Aa,D3D10_RESOURCE_DIMENSION:()=>Cy,D3DFMT:()=>pr,DATA_URI:()=>qR,DDS:()=>ae,DEG_TO_RAD:()=>km,DEPRECATED_SCALE_MODES:()=>fp,DEPRECATED_WRAP_MODES:()=>dp,DOMAdapter:()=>H,DOMContainer:()=>xg,DOMPipe:()=>zo,DRAW_MODES:()=>zD,DXGI_FORMAT:()=>Ay,DXGI_TO_TEXTURE_FORMAT:()=>ir,DarkenBlend:()=>jd,DefaultBatcher:()=>Zo,DefaultShader:()=>yl,DifferenceBlend:()=>$d,DisplacementFilter:()=>r0,DivideBlend:()=>qd,DynamicBitmapFont:()=>Od,Ellipse:()=>Il,EventBoundary:()=>nl,EventEmitter:()=>ve,EventSystem:()=>ol,EventsTicker:()=>jr,ExclusionBlend:()=>Kd,ExtensionType:()=>b,ExtractSystem:()=>Y_,FOURCC_TO_TEXTURE_FORMAT:()=>Nf,FederatedContainer:()=>gg,FederatedEvent:()=>$i,FederatedMouseEvent:()=>xi,FederatedPointerEvent:()=>jt,FederatedWheelEvent:()=>$r,FillGradient:()=>tr,FillPattern:()=>Ti,Filter:()=>Gt,FilterEffect:()=>pi,FilterPipe:()=>ba,FilterSystem:()=>ya,FontStylePromiseCache:()=>Ud,GAUSSIAN_VALUES:()=>Yc,GL_FORMATS:()=>hc,GL_INTERNAL_FORMAT:()=>EC,GL_TARGETS:()=>Tf,GL_TYPES:()=>Ce,GL_WRAP_MODES:()=>Z1,GenerateTextureSystem:()=>Ga,Geometry:()=>Jt,GlBackBufferSystem:()=>Sb,GlBatchAdaptor:()=>iu,GlBuffer:()=>cc,GlBufferSystem:()=>nu,GlColorMaskSystem:()=>au,GlContextSystem:()=>yb,GlEncoderSystem:()=>uu,GlGeometrySystem:()=>ou,GlGraphicsAdaptor:()=>tu,GlLimitsSystem:()=>lu,GlMeshAdaptor:()=>ru,GlParticleContainerAdaptor:()=>Al,GlParticleContainerPipe:()=>sa,GlProgram:()=>je,GlProgramData:()=>pc,GlRenderTarget:()=>dc,GlRenderTargetAdaptor:()=>fc,GlRenderTargetSystem:()=>du,GlShaderSystem:()=>fu,GlStateSystem:()=>Wb,GlStencilSystem:()=>cu,GlTexture:()=>gc,GlTextureSystem:()=>mu,GlUboSystem:()=>hu,GlUniformGroupSystem:()=>pu,GlobalUniformSystem:()=>Ua,GpuBatchAdaptor:()=>Ea,GpuBlendModesToPixi:()=>Kt,GpuBufferSystem:()=>Ha,GpuColorMaskSystem:()=>za,GpuDeviceSystem:()=>$n,GpuEncoderSystem:()=>Wa,GpuGraphicsAdaptor:()=>Ta,GpuGraphicsContext:()=>vd,GpuLimitsSystem:()=>Xa,GpuMeshAdapter:()=>Sa,GpuMipmapGenerator:()=>lc,GpuParticleContainerAdaptor:()=>Pl,GpuParticleContainerPipe:()=>na,GpuProgram:()=>$e,GpuRenderTarget:()=>oc,GpuRenderTargetAdaptor:()=>ac,GpuRenderTargetSystem:()=>Za,GpuShaderSystem:()=>Qa,GpuStateSystem:()=>Ja,GpuStencilModesToPixi:()=>ii,GpuStencilSystem:()=>Ya,GpuTextureSystem:()=>eu,GpuUboSystem:()=>$a,GpuUniformBatchPipe:()=>qa,Graphics:()=>Fn,GraphicsContext:()=>bt,GraphicsContextRenderData:()=>Td,GraphicsContextSystem:()=>Rn,GraphicsGpuData:()=>Ed,GraphicsPath:()=>Qi,GraphicsPipe:()=>ra,HTMLText:()=>Qc,HTMLTextPipe:()=>pa,HTMLTextRenderData:()=>Ln,HTMLTextStyle:()=>Zc,HTMLTextSystem:()=>ma,HardLightBlend:()=>Zd,HardMixBlend:()=>Qd,HelloSystem:()=>jn,IGLUniformData:()=>Mb,ImageSource:()=>Qt,InstructionSet:()=>on,KTX:()=>at,LightenBlend:()=>Jd,LinearBurnBlend:()=>ef,LinearDodgeBlend:()=>tf,LinearLightBlend:()=>rf,Loader:()=>Sc,LoaderParserPriority:()=>ze,LuminosityBlend:()=>sf,MaskEffectManager:()=>Qu,MaskEffectManagerClass:()=>zh,MaskFilter:()=>Kl,Matrix:()=>O,Mesh:()=>Ar,MeshGeometry:()=>yr,MeshGpuData:()=>El,MeshPipe:()=>ia,MeshPlane:()=>g0,MeshRope:()=>Tk,MeshSimple:()=>_0,NOOP:()=>$h,NegationBlend:()=>nf,NineSliceGeometry:()=>Ci,NineSlicePlane:()=>b0,NineSliceSprite:()=>Pw,NineSliceSpriteGpuData:()=>Vd,NineSliceSpritePipe:()=>_a,NoiseFilter:()=>_D,ObservablePoint:()=>ke,OverlayBlend:()=>of,PI_2:()=>Im,Particle:()=>Pk,ParticleBuffer:()=>Cl,ParticleContainer:()=>Bk,ParticleContainerPipe:()=>Bn,ParticleShader:()=>wl,PerspectiveMesh:()=>mk,PerspectivePlaneGeometry:()=>eh,PinLightBlend:()=>af,PipelineSystem:()=>Ka,PlaneGeometry:()=>Hn,Point:()=>ge,Polygon:()=>Dn,Pool:()=>Ss,PoolGroupClass:()=>Vh,PrepareBase:()=>n0,PrepareQueue:()=>Kc,PrepareSystem:()=>hp,PrepareUpload:()=>Jc,QuadGeometry:()=>Xl,RAD_TO_DEG:()=>Dm,Rectangle:()=>exports.Rectangle,RenderContainer:()=>d0,RenderGroup:()=>rl,RenderGroupPipe:()=>wa,RenderGroupSystem:()=>Ma,RenderLayer:()=>uk,RenderTarget:()=>Na,RenderTargetSystem:()=>Zn,RenderTexture:()=>Zl,RenderableGCSystem:()=>K_,RendererInitHook:()=>Ia,RendererType:()=>qe,ResizePlugin:()=>Vo,Resolver:()=>qt,RopeGeometry:()=>x0,RoundedRectangle:()=>Dl,SCALE_MODES:()=>YD,STENCIL_MODES:()=>Ve,SVGParser:()=>Yx,SaturationBlend:()=>uf,SchedulerSystem:()=>La,ScissorMask:()=>c0,SdfShader:()=>Nl,Shader:()=>it,ShaderStage:()=>Tn,ShapePath:()=>Gl,SharedRenderPipes:()=>tc,SharedSystems:()=>ec,SoftLightBlend:()=>lf,SplitBitmapText:()=>Gk,SplitText:()=>Vk,Sprite:()=>De,SpritePipe:()=>Ra,Spritesheet:()=>id,State:()=>Ze,StencilMask:()=>jo,StencilMaskPipe:()=>Oa,SubtractBlend:()=>cf,SystemRunner:()=>Xn,TEXTURE_FORMAT_BLOCK_SIZE:()=>wy,Text:()=>Cr,TextStyle:()=>ht,Texture:()=>exports.Texture,TextureGCSystem:()=>Z_,TextureMatrix:()=>un,TexturePool:()=>Oe,TexturePoolClass:()=>qh,TextureSource:()=>xe,TextureStyle:()=>mt,TextureUvs:()=>h0,Ticker:()=>_e,TickerListener:()=>hn,TickerPlugin:()=>Ho,TilingSprite:()=>a0,TilingSpriteGpuData:()=>Ld,TilingSpritePipe:()=>xa,TilingSpriteShader:()=>Wl,Transform:()=>qc,Triangle:()=>s0,UNIFORM_TO_ARRAY_SETTERS:()=>Vb,UNIFORM_TO_SINGLE_SETTERS:()=>Nb,UNIFORM_TYPES_MAP:()=>ix,UNIFORM_TYPES_VALUES:()=>pd,UPDATE_BLEND:()=>il,UPDATE_COLOR:()=>No,UPDATE_PRIORITY:()=>exports.UPDATE_PRIORITY,UPDATE_TRANSFORM:()=>B3,UPDATE_VISIBLE:()=>ln,UboBatch:()=>sc,UboSystem:()=>qn,UniformGroup:()=>be,VERSION:()=>Yn,VideoSource:()=>Ms,ViewContainer:()=>gt,ViewSystem:()=>eb,ViewableBuffer:()=>qr,VividLightBlend:()=>hf,WGSL_ALIGN_SIZE_DATA:()=>ja,WGSL_TO_STD40_SIZE:()=>Sf,WRAP_MODES:()=>XD,WebGLRenderer:()=>Pf,WebGPURenderer:()=>vf,WebWorkerAdapter:()=>nD,WorkerManager:()=>kf,accessibilityTarget:()=>hg,addBits:()=>cd,addMaskBounds:()=>gn,addMaskLocalBounds:()=>xn,addProgramDefines:()=>Lg,alphaFrag:()=>Xy,alphaWgsl:()=>ip,applyMatrix:()=>v_,applyProjectiveTransformationToPlane:()=>f0,applyStyleParams:()=>wf,assignWithIgnore:()=>Lo,autoDetectEnvironment:()=>WR,autoDetectRenderer:()=>ey,autoDetectSource:()=>nM,basisTranscoderUrls:()=>Dc,bgr2rgb:()=>Es,bitmapFontCachePlugin:()=>ty,bitmapFontTextParser:()=>bc,bitmapFontXMLParser:()=>Rf,bitmapFontXMLStringParser:()=>Bf,bitmapTextSplit:()=>y0,blendTemplateFrag:()=>C_,blendTemplateVert:()=>w_,blendTemplateWgsl:()=>P_,blockDataMap:()=>yf,blurTemplateWgsl:()=>Ky,boundsPool:()=>dr,browserExt:()=>SE,buildAdaptiveBezier:()=>Ol,buildAdaptiveQuadratic:()=>Fx,buildArc:()=>Fl,buildArcTo:()=>Ux,buildArcToSvg:()=>Lx,buildCircle:()=>Mn,buildContextBatches:()=>Ax,buildEllipse:()=>lx,buildLine:()=>px,buildPixelLine:()=>mx,buildPolygon:()=>vx,buildRectangle:()=>Tx,buildRoundedRectangle:()=>cx,buildSimpleUvs:()=>ax,buildTriangle:()=>Sx,buildUvs:()=>ox,cacheAsTextureMixin:()=>Um,cacheTextureArray:()=>iy,calculateProjection:()=>fb,canvasTextSplit:()=>S0,checkChildrenDidChange:()=>Xh,checkDataUrl:()=>vr,checkExtension:()=>nt,checkMaxIfStatementsInShader:()=>dl,childrenHelperMixin:()=>Nm,cleanArray:()=>q_,cleanHash:()=>$_,clearList:()=>Pa,closePointEps:()=>hx,collectAllRenderables:()=>ek,collectRenderablesMixin:()=>Vm,color32BitToUniform:()=>ti,colorBit:()=>En,colorBitGl:()=>An,colorMatrixFilterFrag:()=>Qy,colorMatrixFilterWgsl:()=>np,colorToUniform:()=>UM,compareModeToGlCompare:()=>Kb,compileHighShader:()=>qg,compileHighShaderGl:()=>Kg,compileHighShaderGlProgram:()=>Zr,compileHighShaderGpuProgram:()=>Kr,compileHooks:()=>hd,compileInputs:()=>dd,compileOutputs:()=>$g,compileShader:()=>Ef,compute2DProjection:()=>m0,convertFormatIfRequired:()=>QB,convertToList:()=>$t,copySearchParams:()=>Wo,createIdFromString:()=>vi,createIndicesForQuads:()=>Cd,createLevelBuffers:()=>UB,createLevelBuffersFromKTX:()=>eI,createStringVariations:()=>bg,createTexture:()=>rr,createUboElementsSTD40:()=>Eb,createUboElementsWGSL:()=>ib,createUboSyncFunction:()=>rc,createUboSyncFunctionSTD40:()=>wb,createUboSyncFunctionWGSL:()=>cb,crossOrigin:()=>dC,cullingMixin:()=>Bm,curveEps:()=>dx,defaultFilterVert:()=>ro,defaultValue:()=>mc,definedProps:()=>Ot,deprecation:()=>G,detectAvif:()=>ny,detectBasis:()=>BB,detectCompressed:()=>aI,detectDefaults:()=>oy,detectMp4:()=>ay,detectOgv:()=>uy,detectVideoAlphaMode:()=>ll,detectWebm:()=>ly,detectWebp:()=>cy,determineCrossOrigin:()=>pC,displacementFrag:()=>e0,displacementVert:()=>t0,displacementWgsl:()=>op,earcut:()=>bx,effectsMixin:()=>Hm,ensureAttributes:()=>nc,ensureIsBuffer:()=>ld,ensurePrecision:()=>Ng,ensureTextOptions:()=>io,executeInstructions:()=>Ca,extensions:()=>V,extractAttributesFromGlProgram:()=>kb,extractAttributesFromGpuProgram:()=>Wg,extractFontFamilies:()=>l_,extractStructAndGroups:()=>xl,extractSvgUrlId:()=>Bd,fastCopy:()=>Ko,findMixin:()=>zm,fontStringFromTextStyle:()=>Fs,formatShader:()=>OD,fragmentGPUTemplate:()=>Qg,fragmentGlTemplate:()=>ex,generateArraySyncSTD40:()=>Cb,generateArraySyncWGSL:()=>lb,generateBlurFragSource:()=>jy,generateBlurGlProgram:()=>qy,generateBlurProgram:()=>Zy,generateBlurVertSource:()=>$y,generateGPULayout:()=>BD,generateGpuLayoutGroups:()=>Xg,generateLayout:()=>DD,generateLayoutHash:()=>Yg,generateParticleUpdateFunction:()=>Cx,generateProgram:()=>Ub,generateShaderSyncCode:()=>Pb,generateTextStyleKey:()=>$x,generateTextureBatchBit:()=>Cn,generateTextureBatchBitGl:()=>wn,generateTextureMatrix:()=>Ex,generateUniformsSync:()=>Hb,getAdjustedBlendModeBlend:()=>yi,getAttributeInfoFromFormat:()=>er,getBatchSamplersUniformGroup:()=>Pn,getBitmapTextLayout:()=>Un,getCanvasBoundingBox:()=>Kx,getCanvasFillStyle:()=>On,getCanvasTexture:()=>Jl,getDefaultUniformValue:()=>sx,getFastGlobalBounds:()=>ZD,getFastGlobalBoundsMixin:()=>Xm,getFontCss:()=>d_,getFontFamilyName:()=>iC,getGeometryBounds:()=>Fg,getGlTypeFromFormat:()=>Tb,getGlobalBounds:()=>Yi,getGlobalMixin:()=>$m,getGlobalRenderableBounds:()=>A_,getLocalBounds:()=>nn,getMaxFragmentPrecision:()=>Ug,getMaxTexturesPerBatch:()=>kg,getOrientationOfPoints:()=>fx,getPo2TextureFromSource:()=>Ll,getResolutionOfUrl:()=>Jn,getSVGUrl:()=>f_,getSupportedCompressedTextureFormats:()=>Rc,getSupportedGPUCompressedTextureFormats:()=>Gf,getSupportedGlCompressedTextureFormats:()=>Ff,getSupportedTextureFormats:()=>as,getTemporaryCanvasFromImage:()=>p_,getTestContext:()=>hl,getTextureBatchBindGroup:()=>_n,getTextureDefaultMatrix:()=>Ak,getTextureFormatFromKTXTexture:()=>rI,getUboData:()=>Ob,getUniformData:()=>Fb,getUrlExtension:()=>ST,glFormatToGPUFormat:()=>By,glUploadBufferImageResource:()=>Xb,glUploadCompressedTextureResource:()=>Yb,glUploadImageResource:()=>xc,glUploadVideoResource:()=>$b,globalUniformsBit:()=>tx,globalUniformsBitGl:()=>rx,globalUniformsUBOBitGl:()=>bM,gpuFormatToBasisTranscoderFormat:()=>NB,gpuFormatToKTXBasisTranscoderFormat:()=>sI,gpuUploadBufferImageResource:()=>gb,gpuUploadCompressedTextureResource:()=>xb,gpuUploadImageResource:()=>uc,gpuUploadVideoResource:()=>bb,groupD8:()=>le,hasCachedCanvasTexture:()=>sB,hslWgsl:()=>yD,hslgl:()=>zn,hslgpu:()=>Wn,injectBits:()=>fd,insertVersion:()=>Vg,isMobile:()=>lg,isPow2:()=>Yh,isRenderingToScreen:()=>pb,isSafari:()=>a_,isSingleItem:()=>Ps,isWebGLSupported:()=>is,isWebGPUSupported:()=>ss,ktxTranscoderUrls:()=>Oc,loadBasis:()=>FB,loadBasisOnWorker:()=>Ey,loadBitmapFont:()=>ry,loadDDS:()=>HB,loadEnvironmentExtensions:()=>df,loadFontAsBase64:()=>c_,loadFontCSS:()=>h_,loadImageBitmap:()=>lC,loadJson:()=>hy,loadKTX:()=>WB,loadKTX2:()=>qB,loadKTX2onWorker:()=>Ry,loadSVGImage:()=>m_,loadSvg:()=>py,loadTextures:()=>wc,loadTxt:()=>dy,loadVideoTextures:()=>gy,loadWebFont:()=>fy,localUniformBit:()=>Ls,localUniformBitGl:()=>Vn,localUniformBitGroup2:()=>x_,localUniformMSDFBit:()=>e_,localUniformMSDFBitGl:()=>t_,log2:()=>S3,logDebugTexture:()=>zk,logProgramError:()=>Gb,logRenderGroupScene:()=>Iw,logScene:()=>Bw,mSDFBit:()=>r_,mSDFBitGl:()=>i_,mapFormatToGlFormat:()=>Zb,mapFormatToGlInternalFormat:()=>Qb,mapFormatToGlType:()=>Jb,mapGlToVertexFormat:()=>Ib,mapSize:()=>ND,mapType:()=>Af,mapWebGLBlendModesToPixi:()=>zb,maskFrag:()=>z_,maskVert:()=>W_,maskWgsl:()=>gf,matrixPool:()=>pt,measureHtmlText:()=>zl,measureMixin:()=>Km,migrateFragmentFromV7toV8:()=>UD,mipmapScaleModeToGlFilter:()=>qb,multiplyColors:()=>sn,multiplyHexColors:()=>el,nextPow2:()=>mi,noiseFrag:()=>i0,noiseWgsl:()=>ap,nonCompressedFormats:()=>bC,normalizeExtensionPriority:()=>qu,onRenderMixin:()=>Zm,parseDDS:()=>Py,parseFunctionBody:()=>qD,parseKTX:()=>My,parseSVGDefinitions:()=>Wx,parseSVGFloatAttribute:()=>Ke,parseSVGPath:()=>Bx,parseSVGStyle:()=>Id,particleData:()=>pp,particlesFrag:()=>wx,particlesVert:()=>Px,particlesWgsl:()=>wd,path:()=>We,pointInTriangle:()=>up,preloadVideo:()=>fC,removeItems:()=>Zu,removeStructAndGroupDuplicates:()=>jg,resetUids:()=>g3,resolveCharacters:()=>n_,resolveCompressedTextureUrl:()=>oI,resolveJsonUrl:()=>_y,resolveTextureUrl:()=>Pc,resourceToTexture:()=>DT,roundPixelsBit:()=>Qr,roundPixelsBitGl:()=>Jr,roundedShapeArc:()=>Nx,roundedShapeQuadraticCurve:()=>Vx,sayHello:()=>j_,scaleModeToGlFilter:()=>Cf,setBasisTranscoderPath:()=>kB,setKTXTranscoderPath:()=>jB,setPositions:()=>y_,setProgramName:()=>Hg,setUvs:()=>T_,shapeBuilders:()=>Sl,sortMixin:()=>Qm,spritesheetAsset:()=>vg,squaredDistanceToLineSegment:()=>In,stripVersion:()=>zg,styleAttributes:()=>Xx,testImageFormat:()=>vc,testVideoFormat:()=>os,textStyleToCSS:()=>l0,textureBit:()=>D_,textureBitGl:()=>k_,textureFrom:()=>kT,tilingBit:()=>__,tilingBitGl:()=>b_,toFillStyle:()=>Si,toLocalGlobalMixin:()=>Jm,toStrokeStyle:()=>kn,transformVertices:()=>gd,triangulateWithHoles:()=>Tl,uboSyncFunctionsSTD40:()=>_f,uboSyncFunctionsWGSL:()=>ab,uid:()=>de,uniformParsers:()=>wi,unpremultiplyAlpha:()=>gB,unsafeEvalSupported:()=>Yl,updateLocalTransform:()=>rk,updateQuadBounds:()=>ul,updateRenderGroupTransform:()=>FE,updateRenderGroupTransforms:()=>pf,updateTextBounds:()=>oa,updateTransformAndChildren:()=>L_,updateTransformBackwards:()=>Ju,updateWorldTransform:()=>sk,v8_0_0:()=>Y,v8_3_4:()=>Fm,validFormats:()=>Fc,validateRenderables:()=>N_,vertexGPUTemplate:()=>Zg,vertexGlTemplate:()=>Jg,vkFormatToGPUFormat:()=>Iy,warn:()=>U,webworkerExt:()=>EE,wrapModeToGlAddress:()=>_c});var Re=p(()=>{_R();yR();P();P();wg();Tg();cT();hT();SR();ER();AR();CR();wR();PR();MR();RR();BR();IR();DR();kR();OR();FR();GR();UR();LR();NR();VR();HR();zR();EB();dT();fT();RB();YA();qi();jA();$A();qA();KA();ZA();QA();JA();sy();Tc();eC();Ir();tC();rC();sC();nC();my();mC();Ns();uC();gC();xy();pn();Qn();Fr();al();yg();TT();td();vt();IB();GB();LB();VB();yC();vC();TC();zB();SC();XB();CC();AC();KB();JB();tI();iI();RC();nI();wC();BC();PC();uI();IC();kC();lI();Uv();ag();Z3();yT();Be();RE();vT();oD();gT();mg();dg();Kh();bT();Qh();fg();pg();CE();wE();PE();vD();KC();ZC();tw();sw();nw();rp();ow();aw();uw();lw();cw();zE();WE();XE();dt();Hd();zd();cD();fD();iw();Yy();QC();ew();JC();rw();pD();mD();bD();ts();Hh();_E();vE();YE();jh();Te();Om();tl();Ix();tn();_r();hw();d2();f2();p2();xt();m2();TD();dw();gw();RD();yw();X1();Dg();FT();ID();kD();od();DE();LT();HE();HT();GT();nx();bS();Is();dS();oS();aS();uS();lS();FD();cS();fS();_l();bl();pS();ga();Ds();O_();CT();$E();wT();qE();Wv();GD();PT();KE();sd();nd();LA();Y1();j1();$1();va();K1();J1();Q1();tA();rA();iA();sA();lA();nA();uA();cA();hA();dA();md();br();fA();vA();EA();LD();pA();Rb();hb();gA();yA();WT();Ig();xA();_A();bA();VD();Db();XT();YT();jT();$T();qT();Ab();aA();oA();SA();TA();wA();AA();vb();PA();GA();MA();RA();jb();BA();DA();xC();kA();OA();FA();IA();xB();UA();g1();x1();C1();_1();b1();y1();v1();T1();A1();w1();P1();M1();B1();I1();D1();Rs();Dr();k1();sb();E1();JT();eS();S1();rS();iS();sS();O1();F1();db();V1();G1();U1();_b();L1();_C();N1();H1();QE();JE();Bs();bf();Ki();Mg();r1();s1();WD();yn();vS();NT();vn();VT();TS();eg();n1();R1();Q_();mb();o1();tS();ei();xS();rb();_t();ob();_S();ub();nb();u1();bn();cl();Or();jl();tb();R_();ca();jD();h1();i1();rg();$o();Mc();qo();Mt();Cg();Se();f1();ig();gi();ji();$D();J_();Ty();Bc();OT();gl();KD();m1();kr();e2();t2();r2();Xt();QD();ko();Wh();bE();rn();Vv();Hv();zv();Xv();Yv();jv();qm();qv();Kv();Zv();Qv();Yt();kE();JD();tT();OE();LE();sg();$v();U_();tk();an();G_();jm();Ym();ik();GE();nk();UE();z1();ta();BE();ux();Ox();b2();Gx();y2();S2();SS();AS();CS();RS();BS();IS();AM();ea();Pd();Jx();la();Sd();YS();Hx();E2();A2();C2();zx();h2();P2();M2();w2();FS();jx();OS();ES();yx();lk();gk();Sw();vw();Tw();xk();Nd();Sk();Ek();Ew();W1();IE();Ad();Ck();_u();Nn();$S();KS();n2();s2();o2();Mk();JS();Ik();Mx();Cw();i2();ZS();QS();fw();E_();Ok();gE();oE();lE();mw();pE();dE();cE();hE();fE();Ml();mn();NE();s_();HA();zA();WA();XA();VA();Vl();u0();Y2();z2();Mw();Fd();W2();$2();bw();q2();u_();_w();sE();Z2();eE();tE();rE();Q2();J2();iE();g_();xw();v0();Uk();Hk();lp();u2();Qx();Gs();l2();F2();kd();Zx();H2();U2();L2();cp();Ei();Rw();B2();qx();Rx();_i();ET();AT();cn();Cs();sT();Eg();uT();K2();$l();ql();M_();D2();V_();Wt();l1();Lm();Pt();Sg();Pg();H_();Pe();Wk();Xk();Ae();eT();pw();If();fn();Gm();Xi();a1();MS();V.add(SE,EE);});var rO=Wi((k0,tO)=>{(function(r,e){typeof k0=="object"?tO.exports=k0=e():typeof define=="function"&&define.amd?define([],e):r.CryptoJS=e();})(k0,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 Mv=="function")try{i=Mv("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 g(){}return function(y){var v;return g.prototype=y,v=new g,g.prototype=null,v}}(),o={},a=o.lib={},u=a.Base=function(){return {extend:function(g){var y=n(this);return g&&y.mixIn(g),(!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 g=this.extend();return g.init.apply(g,arguments),g},init:function(){},mixIn:function(g){for(var y in g)g.hasOwnProperty(y)&&(this[y]=g[y]);g.hasOwnProperty("toString")&&(this.toString=g.toString);},clone:function(){return this.init.prototype.extend(this)}}}(),l=a.WordArray=u.extend({init:function(g,y){g=this.words=g||[],y!=t?this.sigBytes=y:this.sigBytes=g.length*4;},toString:function(g){return (g||h).stringify(this)},concat:function(g){var y=this.words,v=g.words,S=this.sigBytes,C=g.sigBytes;if(this.clamp(),S%4)for(var A=0;A<C;A++){var M=v[A>>>2]>>>24-A%4*8&255;y[S+A>>>2]|=M<<24-(S+A)%4*8;}else for(var D=0;D<C;D+=4)y[S+D>>>2]=v[D>>>2];return this.sigBytes+=C,this},clamp:function(){var g=this.words,y=this.sigBytes;g[y>>>2]&=4294967295<<32-y%4*8,g.length=e.ceil(y/4);},clone:function(){var g=u.clone.call(this);return g.words=this.words.slice(0),g},random:function(g){for(var y=[],v=0;v<g;v+=4)y.push(s());return new l.init(y,g)}}),c=o.enc={},h=c.Hex={stringify:function(g){for(var y=g.words,v=g.sigBytes,S=[],C=0;C<v;C++){var A=y[C>>>2]>>>24-C%4*8&255;S.push((A>>>4).toString(16)),S.push((A&15).toString(16));}return S.join("")},parse:function(g){for(var y=g.length,v=[],S=0;S<y;S+=2)v[S>>>3]|=parseInt(g.substr(S,2),16)<<24-S%8*4;return new l.init(v,y/2)}},d=c.Latin1={stringify:function(g){for(var y=g.words,v=g.sigBytes,S=[],C=0;C<v;C++){var A=y[C>>>2]>>>24-C%4*8&255;S.push(String.fromCharCode(A));}return S.join("")},parse:function(g){for(var y=g.length,v=[],S=0;S<y;S++)v[S>>>2]|=(g.charCodeAt(S)&255)<<24-S%4*8;return new l.init(v,y)}},f=c.Utf8={stringify:function(g){try{return decodeURIComponent(escape(d.stringify(g)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(g){return d.parse(unescape(encodeURIComponent(g)))}},m=a.BufferedBlockAlgorithm=u.extend({reset:function(){this._data=new l.init,this._nDataBytes=0;},_append:function(g){typeof g=="string"&&(g=f.parse(g)),this._data.concat(g),this._nDataBytes+=g.sigBytes;},_process:function(g){var y,v=this._data,S=v.words,C=v.sigBytes,A=this.blockSize,M=A*4,D=C/M;g?D=e.ceil(D):D=e.max((D|0)-this._minBufferSize,0);var R=D*A,L=e.min(R*4,C);if(R){for(var F=0;F<R;F+=A)this._doProcessBlock(S,F);y=S.splice(0,R),v.sigBytes-=L;}return new l.init(y,L)},clone:function(){var g=u.clone.call(this);return g._data=this._data.clone(),g},_minBufferSize:0});a.Hasher=m.extend({cfg:u.extend(),init:function(g){this.cfg=this.cfg.extend(g),this.reset();},reset:function(){m.reset.call(this),this._doReset();},update:function(g){return this._append(g),this._process(),this},finalize:function(g){g&&this._append(g);var y=this._doFinalize();return y},blockSize:512/32,_createHelper:function(g){return function(y,v){return new g.init(v).finalize(y)}},_createHmacHelper:function(g){return function(y,v){return new x.HMAC.init(g,v).finalize(y)}}});var x=o.algo={};return o}(Math);return r});});var Lw=Wi((O0,iO)=>{(function(r,e){typeof O0=="object"?iO.exports=O0=e(rO()):typeof define=="function"&&define.amd?define(["./core"],e):e(r.CryptoJS);})(O0,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],f=c[2],m=c[3],_=c[4],x=0;x<80;x++){if(x<16)o[x]=u[l+x]|0;else {var g=o[x-3]^o[x-8]^o[x-14]^o[x-16];o[x]=g<<1|g>>>31;}var y=(h<<5|h>>>27)+_+o[x];x<20?y+=(d&f|~d&m)+1518500249:x<40?y+=(d^f^m)+1859775393:x<60?y+=(d&f|d&m|f&m)-1894007588:y+=(d^f^m)-899497514,_=m,m=f,f=d<<30|d>>>2,d=h,h=y;}c[0]=c[0]+h|0,c[1]=c[1]+d|0,c[2]=c[2]+f|0,c[3]=c[3]+m|0,c[4]=c[4]+_|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});});Re();var VP={};vs(VP,{CanvasBaseItem:()=>Bp,CanvasEvent:()=>Rp,CanvasManagerStatic:()=>k,Container:()=>fo,FadeAlphaTicker:()=>gh,ImageContainer:()=>Ye,ImageSprite:()=>Ue,MoveTicker:()=>xh,RegisteredCanvasComponents:()=>ar,RegisteredEvents:()=>hs,RegisteredTickers:()=>ur,RotateTicker:()=>_h,Sprite:()=>ms,Text:()=>po,TickerBase:()=>Hr,VideoSprite:()=>nr,ZoomTicker:()=>bh,addImage:()=>Dp,addImageCointainer:()=>Ip,addVideo:()=>kp,animate:()=>mh,canvas:()=>I,canvasComponentDecorator:()=>fO,eventDecorator:()=>pO,getTexture:()=>Mu,moveIn:()=>CO,moveOut:()=>W0,pushIn:()=>PO,pushOut:()=>rP,removeWithDissolve:()=>Fp,removeWithFade:()=>AO,shakeEffect:()=>yO,showImage:()=>TO,showImageContainer:()=>vO,showVideo:()=>SO,showWithDissolve:()=>eP,showWithFade:()=>EO,tickerDecorator:()=>_O,zoomIn:()=>wO,zoomOut:()=>tP});Re();var Xe={};vs(Xe,{DistortionFilter:()=>A0,EqualizerFilter:()=>ni,Filter:()=>Bt,MonoFilter:()=>C0,ReverbFilter:()=>w0,StereoFilter:()=>P0,StreamFilter:()=>M0,TelephoneFilter:()=>R0});var jk;function $k(r){return jk=r,r}function Fe(){return jk}var Bt=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 A0=class extends Bt{constructor(e=0){let t;if(!Fe().useLegacy){let{audioContext:i}=Fe().context;t=i.createWaveShaper();}super(t),this._distortion=t,this.amount=e;}set amount(e){if(this._amount=e,Fe().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 Et=class{static setParamValue(e,t){if(e.setValueAtTime){let i=Fe().context;e.setValueAtTime(t,i.audioContext.currentTime);}else e.value=t;return t}};var Ge=class extends Bt{constructor(r=0,e=0,t=0,i=0,s=0,n=0,o=0,a=0,u=0,l=0){let c=[],h=[{f:Ge.F32,type:"lowshelf",gain:r},{f:Ge.F64,type:"peaking",gain:e},{f:Ge.F125,type:"peaking",gain:t},{f:Ge.F250,type:"peaking",gain:i},{f:Ge.F500,type:"peaking",gain:s},{f:Ge.F1K,type:"peaking",gain:n},{f:Ge.F2K,type:"peaking",gain:o},{f:Ge.F4K,type:"peaking",gain:a},{f:Ge.F8K,type:"peaking",gain:u},{f:Ge.F16K,type:"highshelf",gain:l}];Fe().useLegacy||(c=h.map(d=>{let f=Fe().context.audioContext.createBiquadFilter();return f.type=d.type,Et.setParamValue(f.Q,1),f.frequency.value=d.f,Et.setParamValue(f.gain,d.gain),f})),super(c[0],c[c.length-1]),this.bands=c,this.bandsMap={};for(let d=0;d<this.bands.length;d++){let f=this.bands[d];d>0&&this.bands[d-1].connect(f),this.bandsMap[f.frequency.value]=f;}}setGain(r,e=0){if(!this.bandsMap[r])throw new Error(`No band found for frequency ${r}`);Et.setParamValue(this.bandsMap[r].gain,e);}getGain(r){if(!this.bandsMap[r])throw new Error(`No band found for frequency ${r}`);return this.bandsMap[r].gain.value}set f32(r){this.setGain(Ge.F32,r);}get f32(){return this.getGain(Ge.F32)}set f64(r){this.setGain(Ge.F64,r);}get f64(){return this.getGain(Ge.F64)}set f125(r){this.setGain(Ge.F125,r);}get f125(){return this.getGain(Ge.F125)}set f250(r){this.setGain(Ge.F250,r);}get f250(){return this.getGain(Ge.F250)}set f500(r){this.setGain(Ge.F500,r);}get f500(){return this.getGain(Ge.F500)}set f1k(r){this.setGain(Ge.F1K,r);}get f1k(){return this.getGain(Ge.F1K)}set f2k(r){this.setGain(Ge.F2K,r);}get f2k(){return this.getGain(Ge.F2K)}set f4k(r){this.setGain(Ge.F4K,r);}get f4k(){return this.getGain(Ge.F4K)}set f8k(r){this.setGain(Ge.F8K,r);}get f8k(){return this.getGain(Ge.F8K)}set f16k(r){this.setGain(Ge.F16K,r);}get f16k(){return this.getGain(Ge.F16K)}reset(){this.bands.forEach(r=>{Et.setParamValue(r.gain,0);});}destroy(){this.bands.forEach(r=>{r.disconnect();}),this.bands=null,this.bandsMap=null;}},ni=Ge;ni.F32=32;ni.F64=64;ni.F125=125;ni.F250=250;ni.F500=500;ni.F1K=1e3;ni.F2K=2e3;ni.F4K=4e3;ni.F8K=8e3;ni.F16K=16e3;var C0=class extends Bt{constructor(){let e,t;if(!Fe().useLegacy){let{audioContext:i}=Fe().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 w0=class extends Bt{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(Fe().useLegacy)return;let{audioContext:e}=Fe().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 P0=class extends Bt{constructor(e=0){let t,i,s;if(!Fe().useLegacy){let{audioContext:n}=Fe().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?Et.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 M0=class extends Bt{constructor(){let e,t;if(!Fe().useLegacy){let{audioContext:i}=Fe().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 R0=class extends Bt{constructor(){let e,t;if(!Fe().useLegacy){let{audioContext:i}=Fe().context,s=i.createBiquadFilter(),n=i.createBiquadFilter(),o=i.createBiquadFilter(),a=i.createBiquadFilter();s.type="lowpass",Et.setParamValue(s.frequency,2e3),n.type="lowpass",Et.setParamValue(n.frequency,2e3),o.type="highpass",Et.setParamValue(o.frequency,500),a.type="highpass",Et.setParamValue(a.frequency,500),s.connect(n),n.connect(o),o.connect(a),e=s,t=a;}super(e,t);}};Re();var mp=class extends ve{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();}};Re();var rN=0,Dw=class extends ve{constructor(r){super(),this.id=rN++,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-Dw.PADDING),this._end=Math.min(this._end+Dw.PADDING,this._duration),this._source.onloadedmetadata=()=>{this._source&&(this._source.currentTime=e,this._source.onloadedmetadata=null,this.emit("progress",e/this._duration,this._duration),_e.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(){_e.shared.remove(this._onUpdate,this),this._internalStop(),this.emit("progress",1,this._duration),this.emit("end",this);}destroy(){_e.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}]`}},B0=Dw;B0.PADDING=.1;Re();var gp=class extends ve{init(e){this.parent=e,this._source=e.options.source||new Audio,e.url&&(this._source.src=e.url);}create(){return new B0(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();}};Re();var xp=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 bu=["ogg","oga","opus","m4a","mp3","mpeg","wav","aiff","wma","mid","caf"],kw=["audio/mpeg","audio/ogg"],yu={};function qk(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$/;bu.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(yu,i);}qk();Re();Re();var sN=0,_p=class extends ve{constructor(e){super(),this.id=sN++,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);Et.setParamValue(this._gain.gain,n*s*i),Et.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){_e.shared.remove(this._updateListener,this),e&&_e.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 vu=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 Kk=class extends vu{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(Kk.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,Et.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}},I0=Kk;I0.BUFFER_SIZE=0;var Tu=class{init(e){this.parent=e,this._nodes=new I0(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 _p(this)}get context(){return this.parent.context}get isPlayable(){return !!this._source&&!!this._source.buffer}get filters(){return this._nodes.filters}set filters(e){this._nodes.filters=e;}get duration(){return console.assert(this.isPlayable,"Sound not yet playable, no duration"),this._source.buffer.duration}get buffer(){return this._source.buffer}set buffer(e){this._source.buffer=e;}get nodes(){return this._nodes}load(e){this.source?this._decode(this.source,e):this.parent.url?this._loadUrl(e):e?e(new Error("sound.url or sound.source must be set")):console.error("sound.url or sound.source must be set");}async _loadUrl(e){let t=this.parent.url,i=await H.get().fetch(t);this._decode(await i.arrayBuffer(),e);}_decode(e,t){let i=(s,n)=>{if(s)t&&t(s);else {this.parent.isLoaded=true,this.buffer=n;let o=this.parent.autoPlayStart();t&&t(null,this.parent,o);}};e instanceof AudioBuffer?i(null,e):this.parent.context.decode(e,i);}};var th=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=Fe().useLegacy?new gp:new Tu;return new th(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:We.extname(t).slice(1)})).filter(({ext:t})=>yu[t]).sort((t,i)=>bu.indexOf(t.ext)-bu.indexOf(i.ext));if(!e)throw new Error("No supported file type found");return e.url}get context(){return Fe().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 xp(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(th._pool.length>0){let r=th._pool.pop();return r.init(this.media),r}return this.media.create()}_poolInstance(r){r.destroy(),th._pool.indexOf(r)<0&&th._pool.push(r);}},Gr=th;Gr._pool=[];Re();var rh=class r extends vu{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 ve,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 ih=class{constructor(){this.init();}init(){return this.supported&&(this._webAudioContext=new rh),this._htmlAudioContext=new mp,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 rh.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 Gr)return this._sounds[e]=t,t;let i=this._getOptions(t),s=Gr.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}};Re();Re();var Zk=r=>{let e=r.src,t=r?.alias?.[0];return (!t||r.src===t)&&(t=We.basename(e,We.extname(e))),t},Qk={extension:b.Asset,detection:{test:async()=>true,add:async r=>[...r,...bu.filter(e=>yu[e])],remove:async r=>r.filter(e=>r.includes(e))},loader:{name:"sound",extension:{type:[b.LoadParser],priority:ze.High},test(r){let e=We.extname(r).slice(1);return !!yu[e]||kw.some(t=>r.startsWith(`data:${t}`))},async load(r,e){let t=await new Promise((i,s)=>Gr.from({...e.data,url:r,preload:true,loaded(n,o){n?s(n):i(o),e.data?.loaded?.(n,o);}}));return Fe().add(Zk(e),t),t},async unload(r,e){Fe().remove(Zk(e));}}};V.add(Qk);var Ie=$k(new ih);var bp="1.3.0";var oo="repeat";function Ow(r){return {type:"pause",duration:r}}var Fw={DistortionFilter:Xe.DistortionFilter,EqualizerFilter:Xe.EqualizerFilter,MonoFilter:Xe.MonoFilter,ReverbFilter:Xe.ReverbFilter,StereoFilter:Xe.StereoFilter,StreamFilter:Xe.StreamFilter,TelephoneFilter:Xe.TelephoneFilter},Jk=["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"],wr="__game_layer__",sh="Container",D0="ImageContainer",Gw="Image",nh="Sprite",oh="Text",Uw="Video",he={CURRENT_DIALOGUE_MEMORY_KEY:"___current_dialogue_memory___",LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY:"___last_dialogue_added_in_step_memory___",CURRENT_MENU_OPTIONS_MEMORY_KEY:"___current_menu_options_memory___",LAST_MENU_OPTIONS_ADDED_IN_STEP_MEMORY_KEY:"___last_menu_options_added_in_step_memory___",CURRENT_INPUT_VALUE_MEMORY_KEY:"_input_value_",LAST_INPUT_ADDED_IN_STEP_MEMORY_KEY:"___last_input_added_in_step_memory___",CURRENT_INPUT_INFO_MEMORY_KEY:"___current_input_info_memory___",CHARACTER_CATEGORY_KEY:"___character___",ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY:"___glue___",OPENED_LABELS_COUNTER_KEY:"___opened_labels_counter___",ALL_CHOICES_MADE_KEY:"___all_choices_made___",CURRENT_STEP_TIMES_COUNTER_KEY:"___current_step_times_counter___",LAST_STEP_GLUED:"___last_step_glued___"};var E;(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)))(E||(E={}));function pe(r){try{if(typeof r>"u")return r;let e=JSON.stringify(r);return JSON.parse(e)}catch(e){throw E.error("Error creating exportable element",r,e),new Error("[Pixi\u2019VN] Error creating exportable element")}}async function eO(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(()=>(Re(),Yk))),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 nO=Fh(Lw());Re();var uN={extension:{type:"sceneProperties",name:"additional-positions"},testNode(r){return r instanceof Ue||r instanceof nr||r instanceof Ye},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 Ue||r instanceof nr||r instanceof Ye)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}}}]}},sO=uN;function lN(r,e){let t=0;return async(...i)=>{let s=Date.now();if(s-t>=e)return t=s,await r(...i)}}var j=class j{constructor(){}static get app(){if(!j._app)throw new Error("[Pixi\u2019VN] CanvasManagerStatic.app is undefined");return j._app}static get gameLayer(){let e=this.app.stage.getChildByLabel(wr);return e||(e=new J,e.label=wr,this.app.stage.addChild(e)),e}static async init(e,t,i,s,n){return j.canvasWidth=t,j.canvasHeight=i,j._app=new Mf,j.app.init({resolution:window.devicePixelRatio||1,autoDensity:true,width:t,height:i,...s}).then(()=>{let{app:o=j.app,extensions:a=[],...u}=n||{};eO({app:o,extensions:[sO,...a],...u}),j._isInitialized=true,j.addCanvasIntoHTMLElement(e),window.addEventListener("resize",j.resize),j.resize(),j.gameLayer;})}static addCanvasIntoHTMLElement(e){j._isInitialized?e.appendChild(j.app.canvas):E.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 j.htmlLayers.push(s),j.resize(),n}static removeHtmlLayer(e){let t=j.htmlLayers.find(i=>i.id===e);t&&(t.remove(),j.htmlLayers=j.htmlLayers.filter(i=>i.id!==e));}static getHtmlLayer(e){return j.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/j.canvasWidth,t/j.canvasHeight)}static get screenWidth(){return Math.floor(j.screenScale*j.canvasWidth)}static get screenHeight(){return Math.floor(j.screenScale*j.canvasHeight)}static get horizontalMargin(){return (Math.max(document.documentElement.clientWidth,window.innerWidth||0)-j.screenWidth)/2}static get verticalMargin(){return (Math.max(document.documentElement.clientHeight,window.innerHeight||0)-j.screenHeight)/2}static async resize(){await lN(async()=>{if(j._isInitialized){let i=j.app.canvas.style;i.width=`${j.screenWidth}px`,i.height=`${j.screenHeight}px`,i.marginLeft=`${j.horizontalMargin}px`,i.marginRight=`${j.horizontalMargin}px`,i.marginTop=`${j.verticalMargin}px`,i.marginBottom=`${j.verticalMargin}px`;}let t=j.htmlLayers.map(i=>{i.style.width=`${j.screenWidth}px`,i.style.height=`${j.screenHeight}px`,i.style.marginLeft=`${j.horizontalMargin}px`,i.style.marginRight=`${j.horizontalMargin}px`,i.style.marginTop=`${j.verticalMargin}px`,i.style.marginBottom=`${j.verticalMargin}px`;});await Promise.all(t);},10)();}static get childrenAliasesOrder(){return j.gameLayer.children.filter(e=>e.label).sort((e,t)=>j.gameLayer.getChildIndex(e)-j.gameLayer.getChildIndex(t)).map(e=>e.label)}static get currentTickersWithoutCreatedBySteps(){return Object.fromEntries(Object.entries(j._currentTickers).filter(([e,t])=>!t.createdByTicketSteps).map(([e,t])=>[e,{id:t.ticker.id,args:t.ticker.args,canvasElementAliases:t.ticker.canvasElementAliases,priority:t.ticker.priority,duration:t.ticker.duration,paused:t.ticker.paused}]))}static generateTickerId(e){try{return (0,nO.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]),j._currentTickersTimeouts[i]={aliases:e,ticker:t,canBeDeletedBeforeEnd:s};}static removeTickerTimeoutInfo(e){typeof e!="string"&&(e=e.toString()),j._currentTickersTimeouts[e]&&delete j._currentTickersTimeouts[e];}static removeTickerTimeout(e){typeof e!="string"&&(e=e.toString()),clearTimeout(Number(e)),j.removeTickerTimeoutInfo(e);}static removeTickerTimeoutsByAlias(e,t){Object.entries(j._currentTickersTimeouts).forEach(([i,s])=>{let n=s.aliases.filter(o=>o!==e);if(n.length===0){let o=s.canBeDeletedBeforeEnd;(!t||o)&&j.removeTickerTimeout(i);}else j._currentTickersTimeouts[i].aliases=n;});}};w(j,"_app"),w(j,"htmlLayers",[]),w(j,"canvasWidth",300),w(j,"canvasHeight",300),w(j,"_isInitialized",false),w(j,"_currentTickers",{}),w(j,"_currentTickersSequence",{}),w(j,"_currentTickersTimeouts",{}),w(j,"_tickersToCompleteOnStepEnd",{tikersIds:[],stepAlias:[]}),w(j,"_tickersOnPause",{});var k=j;Re();var ah=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,lO=new Set,Nw=typeof process=="object"&&process?process:{},cO=(r,e,t,i)=>{typeof Nw.emitWarning=="function"?Nw.emitWarning(r,e,t,i):console.error(`[${t}] ${e}: ${r}`);},U0=globalThis.AbortController,oO=globalThis.AbortSignal;if(typeof U0>"u"){oO=class{constructor(){w(this,"onabort");w(this,"_onabort",[]);w(this,"reason");w(this,"aborted",false);}addEventListener(i,s){this._onabort.push(s);}},U0=class{constructor(){w(this,"signal",new oO);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=Nw.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{r&&(r=false,cO("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 cN=r=>!lO.has(r),ao=r=>r&&r===Math.floor(r)&&r>0&&isFinite(r),hO=r=>ao(r)?r<=Math.pow(2,8)?Uint8Array:r<=Math.pow(2,16)?Uint16Array:r<=Math.pow(2,32)?Uint32Array:r<=Number.MAX_SAFE_INTEGER?uh:null:null,uh=class extends Array{constructor(e){super(e),this.fill(0);}},lh,Su=class Su{constructor(e,t){w(this,"heap");w(this,"length");if(!T(Su,lh))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0;}static create(e){let t=hO(e);if(!t)return [];ee(Su,lh,true);let i=new Su(e,t);return ee(Su,lh,false),i}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}};lh=new WeakMap,we(Su,lh,false);var Vw=Su,aO,uO,Mi,Ur,Ri,Eu,Bi,ch,hh,It,Ii,At,Je,me,mr,Lr,or,Nt,Di,Vt,ki,Oi,Nr,Fi,ho,gr,dh,z,Hw,Au,Ws,vp,Vr,dO,Cu,fh,Tp,uo,lo,zw,F0,G0,Qe,Ww,yp,co,Xw,Yw=class Yw{constructor(e){we(this,z);we(this,Mi);we(this,Ur);we(this,Ri);we(this,Eu);we(this,Bi);we(this,ch);we(this,hh);w(this,"ttl");w(this,"ttlResolution");w(this,"ttlAutopurge");w(this,"updateAgeOnGet");w(this,"updateAgeOnHas");w(this,"allowStale");w(this,"noDisposeOnSet");w(this,"noUpdateTTL");w(this,"maxEntrySize");w(this,"sizeCalculation");w(this,"noDeleteOnFetchRejection");w(this,"noDeleteOnStaleGet");w(this,"allowStaleOnFetchAbort");w(this,"allowStaleOnFetchRejection");w(this,"ignoreFetchAbort");we(this,It);we(this,Ii);we(this,At);we(this,Je);we(this,me);we(this,mr);we(this,Lr);we(this,or);we(this,Nt);we(this,Di);we(this,Vt);we(this,ki);we(this,Oi);we(this,Nr);we(this,Fi);we(this,ho);we(this,gr);we(this,dh);we(this,Au,()=>{});we(this,Ws,()=>{});we(this,vp,()=>{});we(this,Vr,()=>false);we(this,Cu,e=>{});we(this,fh,(e,t,i)=>{});we(this,Tp,(e,t,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});w(this,aO,"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:f,maxSize:m=0,maxEntrySize:_=0,sizeCalculation:x,fetchMethod:g,memoMethod:y,noDeleteOnFetchRejection:v,noDeleteOnStaleGet:S,allowStaleOnFetchRejection:C,allowStaleOnFetchAbort:A,ignoreFetchAbort:M}=e;if(t!==0&&!ao(t))throw new TypeError("max option must be a nonnegative integer");let D=t?hO(t):Array;if(!D)throw new Error("invalid max value: "+t);if(ee(this,Mi,t),ee(this,Ur,m),this.maxEntrySize=_||T(this,Ur),this.sizeCalculation=x,this.sizeCalculation){if(!T(this,Ur)&&!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(ee(this,hh,y),g!==void 0&&typeof g!="function")throw new TypeError("fetchMethod must be a function if specified");if(ee(this,ch,g),ee(this,ho,!!g),ee(this,At,new Map),ee(this,Je,new Array(t).fill(void 0)),ee(this,me,new Array(t).fill(void 0)),ee(this,mr,new D(t)),ee(this,Lr,new D(t)),ee(this,or,0),ee(this,Nt,0),ee(this,Di,Vw.create(t)),ee(this,It,0),ee(this,Ii,0),typeof l=="function"&&ee(this,Ri,l),typeof c=="function"&&ee(this,Eu,c),typeof h=="function"?(ee(this,Bi,h),ee(this,Vt,[])):(ee(this,Bi,void 0),ee(this,Vt,void 0)),ee(this,Fi,!!T(this,Ri)),ee(this,dh,!!T(this,Eu)),ee(this,gr,!!T(this,Bi)),this.noDisposeOnSet=!!d,this.noUpdateTTL=!!f,this.noDeleteOnFetchRejection=!!v,this.allowStaleOnFetchRejection=!!C,this.allowStaleOnFetchAbort=!!A,this.ignoreFetchAbort=!!M,this.maxEntrySize!==0){if(T(this,Ur)!==0&&!ao(T(this,Ur)))throw new TypeError("maxSize must be a positive integer if specified");if(!ao(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");$(this,z,dO).call(this);}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!S,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=ao(s)||s===0?s:1,this.ttlAutopurge=!!n,this.ttl=i||0,this.ttl){if(!ao(this.ttl))throw new TypeError("ttl must be a positive integer if specified");$(this,z,Hw).call(this);}if(T(this,Mi)===0&&this.ttl===0&&T(this,Ur)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!T(this,Mi)&&!T(this,Ur)){let R="LRU_CACHE_UNBOUNDED";cN(R)&&(lO.add(R),cO("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",R,Yw));}}static unsafeExposeInternals(e){return {starts:T(e,Oi),ttls:T(e,Nr),sizes:T(e,ki),keyMap:T(e,At),keyList:T(e,Je),valList:T(e,me),next:T(e,mr),prev:T(e,Lr),get head(){return T(e,or)},get tail(){return T(e,Nt)},free:T(e,Di),isBackgroundFetch:t=>{var i;return $(i=e,z,Qe).call(i,t)},backgroundFetch:(t,i,s,n)=>{var o;return $(o=e,z,G0).call(o,t,i,s,n)},moveToTail:t=>{var i;return $(i=e,z,yp).call(i,t)},indexes:t=>{var i;return $(i=e,z,uo).call(i,t)},rindexes:t=>{var i;return $(i=e,z,lo).call(i,t)},isStale:t=>{var i;return T(i=e,Vr).call(i,t)}}}get max(){return T(this,Mi)}get maxSize(){return T(this,Ur)}get calculatedSize(){return T(this,Ii)}get size(){return T(this,It)}get fetchMethod(){return T(this,ch)}get memoMethod(){return T(this,hh)}get dispose(){return T(this,Ri)}get onInsert(){return T(this,Eu)}get disposeAfter(){return T(this,Bi)}getRemainingTTL(e){return T(this,At).has(e)?1/0:0}*entries(){for(let e of $(this,z,uo).call(this))T(this,me)[e]!==void 0&&T(this,Je)[e]!==void 0&&!$(this,z,Qe).call(this,T(this,me)[e])&&(yield [T(this,Je)[e],T(this,me)[e]]);}*rentries(){for(let e of $(this,z,lo).call(this))T(this,me)[e]!==void 0&&T(this,Je)[e]!==void 0&&!$(this,z,Qe).call(this,T(this,me)[e])&&(yield [T(this,Je)[e],T(this,me)[e]]);}*keys(){for(let e of $(this,z,uo).call(this)){let t=T(this,Je)[e];t!==void 0&&!$(this,z,Qe).call(this,T(this,me)[e])&&(yield t);}}*rkeys(){for(let e of $(this,z,lo).call(this)){let t=T(this,Je)[e];t!==void 0&&!$(this,z,Qe).call(this,T(this,me)[e])&&(yield t);}}*values(){for(let e of $(this,z,uo).call(this))T(this,me)[e]!==void 0&&!$(this,z,Qe).call(this,T(this,me)[e])&&(yield T(this,me)[e]);}*rvalues(){for(let e of $(this,z,lo).call(this))T(this,me)[e]!==void 0&&!$(this,z,Qe).call(this,T(this,me)[e])&&(yield T(this,me)[e]);}[(uO=Symbol.iterator,aO=Symbol.toStringTag,uO)](){return this.entries()}find(e,t={}){for(let i of $(this,z,uo).call(this)){let s=T(this,me)[i],n=$(this,z,Qe).call(this,s)?s.__staleWhileFetching:s;if(n!==void 0&&e(n,T(this,Je)[i],this))return this.get(T(this,Je)[i],t)}}forEach(e,t=this){for(let i of $(this,z,uo).call(this)){let s=T(this,me)[i],n=$(this,z,Qe).call(this,s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,T(this,Je)[i],this);}}rforEach(e,t=this){for(let i of $(this,z,lo).call(this)){let s=T(this,me)[i],n=$(this,z,Qe).call(this,s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,T(this,Je)[i],this);}}purgeStale(){let e=false;for(let t of $(this,z,lo).call(this,{allowStale:true}))T(this,Vr).call(this,t)&&($(this,z,co).call(this,T(this,Je)[t],"expire"),e=true);return e}info(e){let t=T(this,At).get(e);if(t===void 0)return;let i=T(this,me)[t],s=$(this,z,Qe).call(this,i)?i.__staleWhileFetching:i;if(s===void 0)return;let n={value:s};if(T(this,Nr)&&T(this,Oi)){let o=T(this,Nr)[t],a=T(this,Oi)[t];if(o&&a){let u=o-(ah.now()-a);n.ttl=u,n.start=Date.now();}}return T(this,ki)&&(n.size=T(this,ki)[t]),n}dump(){let e=[];for(let t of $(this,z,uo).call(this,{allowStale:true})){let i=T(this,Je)[t],s=T(this,me)[t],n=$(this,z,Qe).call(this,s)?s.__staleWhileFetching:s;if(n===void 0||i===void 0)continue;let o={value:n};if(T(this,Nr)&&T(this,Oi)){o.ttl=T(this,Nr)[t];let a=ah.now()-T(this,Oi)[t];o.start=Math.floor(Date.now()-a);}T(this,ki)&&(o.size=T(this,ki)[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=ah.now()-s;}this.set(t,i.value,i);}}set(e,t,i={}){var d,f,m,_;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=T(this,Tp).call(this,e,t,i.size||0,a);if(this.maxEntrySize&&c>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=true),$(this,z,co).call(this,e,"set"),this;let h=T(this,It)===0?void 0:T(this,At).get(e);if(h===void 0)h=T(this,It)===0?T(this,Nt):T(this,Di).length!==0?T(this,Di).pop():T(this,It)===T(this,Mi)?$(this,z,F0).call(this,false):T(this,It),T(this,Je)[h]=e,T(this,me)[h]=t,T(this,At).set(e,h),T(this,mr)[T(this,Nt)]=h,T(this,Lr)[h]=T(this,Nt),ee(this,Nt,h),Pm(this,It)._++,T(this,fh).call(this,h,c,u),u&&(u.set="add"),l=false,T(this,dh)&&((d=T(this,Eu))==null||d.call(this,t,e,"add"));else {$(this,z,yp).call(this,h);let x=T(this,me)[h];if(t!==x){if(T(this,ho)&&$(this,z,Qe).call(this,x)){x.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:g}=x;g!==void 0&&!o&&(T(this,Fi)&&((f=T(this,Ri))==null||f.call(this,g,e,"set")),T(this,gr)&&T(this,Vt)?.push([g,e,"set"]));}else o||(T(this,Fi)&&((m=T(this,Ri))==null||m.call(this,x,e,"set")),T(this,gr)&&T(this,Vt)?.push([x,e,"set"]));if(T(this,Cu).call(this,h),T(this,fh).call(this,h,c,u),T(this,me)[h]=t,u){u.set="replace";let g=x&&$(this,z,Qe).call(this,x)?x.__staleWhileFetching:x;g!==void 0&&(u.oldValue=g);}}else u&&(u.set="update");T(this,dh)&&this.onInsert?.(t,e,t===x?"update":"replace");}if(s!==0&&!T(this,Nr)&&$(this,z,Hw).call(this),T(this,Nr)&&(l||T(this,vp).call(this,h,s,n),u&&T(this,Ws).call(this,u,h)),!o&&T(this,gr)&&T(this,Vt)){let x=T(this,Vt),g;for(;g=x?.shift();)(_=T(this,Bi))==null||_.call(this,...g);}return this}pop(){var e;try{for(;T(this,It);){let t=T(this,me)[T(this,or)];if($(this,z,F0).call(this,!0),$(this,z,Qe).call(this,t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(T(this,gr)&&T(this,Vt)){let t=T(this,Vt),i;for(;i=t?.shift();)(e=T(this,Bi))==null||e.call(this,...i);}}}has(e,t={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=t,n=T(this,At).get(e);if(n!==void 0){let o=T(this,me)[n];if($(this,z,Qe).call(this,o)&&o.__staleWhileFetching===void 0)return false;if(T(this,Vr).call(this,n))s&&(s.has="stale",T(this,Ws).call(this,s,n));else return i&&T(this,Au).call(this,n),s&&(s.has="hit",T(this,Ws).call(this,s,n)),true}else s&&(s.has="miss");return false}peek(e,t={}){let{allowStale:i=this.allowStale}=t,s=T(this,At).get(e);if(s===void 0||!i&&T(this,Vr).call(this,s))return;let n=T(this,me)[s];return $(this,z,Qe).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:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:m=this.allowStaleOnFetchAbort,context:_,forceRefresh:x=false,status:g,signal:y}=t;if(!T(this,ho))return g&&(g.fetch="get"),this.get(e,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:g});let v={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:o,noDisposeOnSet:a,size:u,sizeCalculation:l,noUpdateTTL:c,noDeleteOnFetchRejection:h,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:m,ignoreFetchAbort:f,status:g,signal:y},S=T(this,At).get(e);if(S===void 0){g&&(g.fetch="miss");let C=$(this,z,G0).call(this,e,S,v,_);return C.__returned=C}else {let C=T(this,me)[S];if($(this,z,Qe).call(this,C)){let L=i&&C.__staleWhileFetching!==void 0;return g&&(g.fetch="inflight",L&&(g.returnedStale=true)),L?C.__staleWhileFetching:C.__returned=C}let A=T(this,Vr).call(this,S);if(!x&&!A)return g&&(g.fetch="hit"),$(this,z,yp).call(this,S),s&&T(this,Au).call(this,S),g&&T(this,Ws).call(this,g,S),C;let M=$(this,z,G0).call(this,e,S,v,_),R=M.__staleWhileFetching!==void 0&&i;return g&&(g.fetch=A?"stale":"refresh",R&&A&&(g.returnedStale=true)),R?M.__staleWhileFetching:M.__returned=M}}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=T(this,hh);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=T(this,At).get(e);if(a!==void 0){let u=T(this,me)[a],l=$(this,z,Qe).call(this,u);return o&&T(this,Ws).call(this,o,a),T(this,Vr).call(this,a)?(o&&(o.get="stale"),l?(o&&i&&u.__staleWhileFetching!==void 0&&(o.returnedStale=true),i?u.__staleWhileFetching:void 0):(n||$(this,z,co).call(this,e,"expire"),o&&i&&(o.returnedStale=true),i?u:void 0)):(o&&(o.get="hit"),l?u.__staleWhileFetching:($(this,z,yp).call(this,a),s&&T(this,Au).call(this,a),u))}else o&&(o.get="miss");}delete(e){return $(this,z,co).call(this,e,"delete")}clear(){return $(this,z,Xw).call(this,"delete")}};Mi=new WeakMap,Ur=new WeakMap,Ri=new WeakMap,Eu=new WeakMap,Bi=new WeakMap,ch=new WeakMap,hh=new WeakMap,It=new WeakMap,Ii=new WeakMap,At=new WeakMap,Je=new WeakMap,me=new WeakMap,mr=new WeakMap,Lr=new WeakMap,or=new WeakMap,Nt=new WeakMap,Di=new WeakMap,Vt=new WeakMap,ki=new WeakMap,Oi=new WeakMap,Nr=new WeakMap,Fi=new WeakMap,ho=new WeakMap,gr=new WeakMap,dh=new WeakMap,z=new WeakSet,Hw=function(){let e=new uh(T(this,Mi)),t=new uh(T(this,Mi));ee(this,Nr,e),ee(this,Oi,t),ee(this,vp,(n,o,a=ah.now())=>{if(t[n]=o!==0?a:0,e[n]=o,o!==0&&this.ttlAutopurge){let u=setTimeout(()=>{T(this,Vr).call(this,n)&&$(this,z,co).call(this,T(this,Je)[n],"expire");},o+1);u.unref&&u.unref();}}),ee(this,Au,n=>{t[n]=e[n]!==0?ah.now():0;}),ee(this,Ws,(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=ah.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=T(this,At).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},ee(this,Vr,n=>{let o=t[n],a=e[n];return !!a&&!!o&&(i||s())-o>a});},Au=new WeakMap,Ws=new WeakMap,vp=new WeakMap,Vr=new WeakMap,dO=function(){let e=new uh(T(this,Mi));ee(this,Ii,0),ee(this,ki,e),ee(this,Cu,t=>{ee(this,Ii,T(this,Ii)-e[t]),e[t]=0;}),ee(this,Tp,(t,i,s,n)=>{if($(this,z,Qe).call(this,i))return 0;if(!ao(s))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(s=n(i,t),!ao(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}),ee(this,fh,(t,i,s)=>{if(e[t]=i,T(this,Ur)){let n=T(this,Ur)-e[t];for(;T(this,Ii)>n;)$(this,z,F0).call(this,true);}ee(this,Ii,T(this,Ii)+e[t]),s&&(s.entrySize=i,s.totalCalculatedSize=T(this,Ii));});},Cu=new WeakMap,fh=new WeakMap,Tp=new WeakMap,uo=function*({allowStale:e=this.allowStale}={}){if(T(this,It))for(let t=T(this,Nt);!(!$(this,z,zw).call(this,t)||((e||!T(this,Vr).call(this,t))&&(yield t),t===T(this,or)));)t=T(this,Lr)[t];},lo=function*({allowStale:e=this.allowStale}={}){if(T(this,It))for(let t=T(this,or);!(!$(this,z,zw).call(this,t)||((e||!T(this,Vr).call(this,t))&&(yield t),t===T(this,Nt)));)t=T(this,mr)[t];},zw=function(e){return e!==void 0&&T(this,At).get(T(this,Je)[e])===e},F0=function(e){var n;let t=T(this,or),i=T(this,Je)[t],s=T(this,me)[t];return T(this,ho)&&$(this,z,Qe).call(this,s)?s.__abortController.abort(new Error("evicted")):(T(this,Fi)||T(this,gr))&&(T(this,Fi)&&((n=T(this,Ri))==null||n.call(this,s,i,"evict")),T(this,gr)&&T(this,Vt)?.push([s,i,"evict"])),T(this,Cu).call(this,t),e&&(T(this,Je)[t]=void 0,T(this,me)[t]=void 0,T(this,Di).push(t)),T(this,It)===1?(ee(this,or,ee(this,Nt,0)),T(this,Di).length=0):ee(this,or,T(this,mr)[t]),T(this,At).delete(i),Pm(this,It)._--,t},G0=function(e,t,i,s){let n=t===void 0?void 0:T(this,me)[t];if($(this,z,Qe).call(this,n))return n;let o=new U0,{signal:a}=i;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let u={signal:o.signal,options:i,context:s},l=(_,x=false)=>{let{aborted:g}=o.signal,y=i.ignoreFetchAbort&&_!==void 0;if(i.status&&(g&&!x?(i.status.fetchAborted=true,i.status.fetchError=o.signal.reason,y&&(i.status.fetchAbortIgnored=true)):i.status.fetchResolved=true),g&&!y&&!x)return h(o.signal.reason);let v=f;return T(this,me)[t]===f&&(_===void 0?v.__staleWhileFetching?T(this,me)[t]=v.__staleWhileFetching:$(this,z,co).call(this,e,"fetch"):(i.status&&(i.status.fetchUpdated=true),this.set(e,_,u.options))),_},c=_=>(i.status&&(i.status.fetchRejected=true,i.status.fetchError=_),h(_)),h=_=>{let{aborted:x}=o.signal,g=x&&i.allowStaleOnFetchAbort,y=g||i.allowStaleOnFetchRejection,v=y||i.noDeleteOnFetchRejection,S=f;if(T(this,me)[t]===f&&(!v||S.__staleWhileFetching===void 0?$(this,z,co).call(this,e,"fetch"):g||(T(this,me)[t]=S.__staleWhileFetching)),y)return i.status&&S.__staleWhileFetching!==void 0&&(i.status.returnedStale=true),S.__staleWhileFetching;if(S.__returned===S)throw _},d=(_,x)=>{var y;let g=(y=T(this,ch))==null?void 0:y.call(this,e,n,u);g&&g instanceof Promise&&g.then(v=>_(v===void 0?void 0:v),x),o.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(_(void 0),i.allowStaleOnFetchAbort&&(_=v=>l(v,true)));});};i.status&&(i.status.fetchDispatched=true);let f=new Promise(d).then(l,c),m=Object.assign(f,{__abortController:o,__staleWhileFetching:n,__returned:void 0});return t===void 0?(this.set(e,m,{...u.options,status:void 0}),t=T(this,At).get(e)):T(this,me)[t]=m,m},Qe=function(e){if(!T(this,ho))return false;let t=e;return !!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof U0},Ww=function(e,t){T(this,Lr)[t]=e,T(this,mr)[e]=t;},yp=function(e){e!==T(this,Nt)&&(e===T(this,or)?ee(this,or,T(this,mr)[e]):$(this,z,Ww).call(this,T(this,Lr)[e],T(this,mr)[e]),$(this,z,Ww).call(this,T(this,Nt),e),ee(this,Nt,e));},co=function(e,t){var s,n;let i=false;if(T(this,It)!==0){let o=T(this,At).get(e);if(o!==void 0)if(i=true,T(this,It)===1)$(this,z,Xw).call(this,t);else {T(this,Cu).call(this,o);let a=T(this,me)[o];if($(this,z,Qe).call(this,a)?a.__abortController.abort(new Error("deleted")):(T(this,Fi)||T(this,gr))&&(T(this,Fi)&&((s=T(this,Ri))==null||s.call(this,a,e,t)),T(this,gr)&&T(this,Vt)?.push([a,e,t])),T(this,At).delete(e),T(this,Je)[o]=void 0,T(this,me)[o]=void 0,o===T(this,Nt))ee(this,Nt,T(this,Lr)[o]);else if(o===T(this,or))ee(this,or,T(this,mr)[o]);else {let u=T(this,Lr)[o];T(this,mr)[u]=T(this,mr)[o];let l=T(this,mr)[o];T(this,Lr)[l]=T(this,Lr)[o];}Pm(this,It)._--,T(this,Di).push(o);}}if(T(this,gr)&&T(this,Vt)?.length){let o=T(this,Vt),a;for(;a=o?.shift();)(n=T(this,Bi))==null||n.call(this,...a);}return i},Xw=function(e){var t,i;for(let s of $(this,z,lo).call(this,{allowStale:true})){let n=T(this,me)[s];if($(this,z,Qe).call(this,n))n.__abortController.abort(new Error("deleted"));else {let o=T(this,Je)[s];T(this,Fi)&&((t=T(this,Ri))==null||t.call(this,n,o,e)),T(this,gr)&&T(this,Vt)?.push([n,o,e]);}}if(T(this,At).clear(),T(this,me).fill(void 0),T(this,Je).fill(void 0),T(this,Nr)&&T(this,Oi)&&(T(this,Nr).fill(0),T(this,Oi).fill(0)),T(this,ki)&&T(this,ki).fill(0),ee(this,or,0),ee(this,Nt,0),T(this,Di).length=0,ee(this,Ii,0),ee(this,It,0),T(this,gr)&&T(this,Vt)){let s=T(this,Vt),n;for(;n=s?.shift();)(i=T(this,Bi))==null||i.call(this,...n);}};var L0=Yw;var Ct=class{constructor(e){w(this,"cache");w(this,"map",new Map);this.cache=new L0({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 Sp=new Ct({cacheSize:5});function fO(r){return function(e){N0.add(e,r);}}var N0;(s=>{function r(n,o){o||(o=n.name),Sp.get(o)&&E.warn(`CanvasElement "${o}" already registered`),n.prototype.pixivnId=o,Sp.set(o,n);}s.add=r;function e(n){try{let o=Sp.get(n);if(!o){E.error(`CanvasElement "${n}" not found, did you forget to register it with the canvasComponentDecorator?`);return}return new o,o}catch(o){E.error(`Error while getting CanvasElement "${n}"`,o);return}}s.get=e;function t(){return Array.from(Sp.values())}s.values=t;function i(n){return Sp.has(n)}s.has=i;})(N0||(N0={}));var ar=N0;var ph=new Ct({cacheSize:5});function pO(r){return function(e){V0.add(e,r);}}var V0;(n=>{function r(o,a){a||(a=o.name),ph.get(a)&&E.info(`Event "${a}" already exists, it will be overwritten`),o.prototype.id=a,ph.set(a,o);}n.add=r;function e(o){try{let a=ph.get(o);if(!a){E.error(`Event "${o}" not found, did you forget to register it with the eventDecorator?`);return}return new a,a}catch(a){E.error(`Error while getting Event "${o}"`,a);return}}n.get=e;function t(o){try{let a=ph.get(o);if(!a){E.error(`Event "${o}" not found, did you forget to register it with the eventDecorator?`);return}return new a}catch(a){E.error(`Error while getting Event "${o}"`,a);return}}n.getInstance=t;function i(){return Array.from(ph.values())}n.values=i;function s(o){return ph.has(o)}n.has=s;})(V0||(V0={}));var hs=V0;async function H0(r){let e=hN(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 hN(r){try{let e=ar.get(r);return e?new e:void 0}catch(e){E.error(`Error while getting CanvasElement ${r}`,e);return}}Re();function jw(r){return "memory"in r?r.memory:r instanceof Cr?$w(r):r instanceof De?Ep(r):wu(r)}function dN(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 mO(r,e){return {url:r.source.label,alias:e===r.source.label?void 0:e}}function wu(r,e){let t=fN(r,sh),s=e?.childrenExport||false?r.children.sort((n,o)=>r.getChildIndex(n)-r.getChildIndex(o)).map(n=>jw(n)):[];return {pixivnId:t,elements:s,...dN(r)}}function Ep(r){let e=wu(r),t=e.pixivnId??nh,i=xO(r),s="textureAlias"in r?mO(r.texture,r.textureAlias):mO(r.texture);return {...e,pixivnId:t,textureData:s,anchor:{x:r.anchor.x,y:r.anchor.y},roundPixels:r.roundPixels,onEvents:i}}function $w(r){let e=wu(r),t=e.pixivnId??oh,i=xO(r);return {...e,pixivnId:t,anchor:{x:r.anchor.x,y:r.anchor.y},text:r.text,resolution:r.resolution,style:pN(r.style),roundPixels:r.roundPixels,onEvents:i}}function fN(r,e){return Object.prototype.hasOwnProperty.call(r,"pixivnId")?r.pixivnId:e}function xO(r){return "onEvents"in r?r.onEvents:{}}function gO(r,e){if(typeof r!="object"||r===null)return r;E.warn(`Unsupported property type for Text.style.${e}: FillGradient or FillPattern.`,r);}function pN(r){return {align:r.align,breakWords:r.breakWords,dropShadow:r.dropShadow,fill:gO(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:gO(r.stroke,"stroke"),textBaseline:r.textBaseline,trim:r.trim,whiteSpace:r.whiteSpace,wordWrap:r.wordWrap,wordWrapWidth:r.wordWrapWidth}}var fo=class extends J{constructor(t){super(t);w(this,"pixivnId",sh);w(this,"_onEvents",{});this.pixivnId=this.constructor.prototype.pixivnId||sh;}get memory(){return wu(this,{childrenExport:true})}set memory(t){}async setMemory(t){return this.memory=t,await this.importChildren(t),await ds(this,t)}async importChildren(t){for(let i=0;i<t.elements.length;i++){let s=t.elements[i],n=await H0(s);this.addChild(n);}}get onEvents(){return this._onEvents}onEvent(t,i){let s=i.prototype.id,n=hs.getInstance(s);return this._onEvents[t]=s,n?super.on(t,()=>{n.fn(t,this);}):E.error(`Event ${s} not found`),this}on(t,i,s){return super.on(t,i,s)}};ar.add(fo,sh);async function ds(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));}Re();var Ap=class Ap{static init(e){Ap._getScreen=e.getScreen;}static get screen(){return Ap._getScreen()}};w(Ap,"_getScreen");var Pr=Ap;function oi(r,e,t,i,s,n=0){return i=i*(s?-1:1),r==="width"?e*(Pr.screen.width-t)+i+n*t+(s?t:0):e*(Pr.screen.height-t)+i+n*t+(s?t:0)}function fs(r,e,t,i,s,n=0){return i=i*(s?-1:1),r==="width"?(e-i-n*t-(s?t:0))/(Pr.screen.width-t):(e-i-n*t-(s?t:0))/(Pr.screen.height-t)}function ai(r,e){return r==="width"?e*Pr.screen.width:e*Pr.screen.height}function ps(r,e){return r==="width"?e/Pr.screen.width:e/Pr.screen.height}function ut(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 qw(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 ui(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 li(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))}Re();var mN=new RegExp(`(${Jk.join("|")})$`);function Cp(r){let e=exports.Assets.cache.has(r)?exports.Assets.get(r):null;return e instanceof exports.Texture&&(r=e.source?.label||r),mN.test(r)}function Pu(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)}Re();Re();async function Mu(r){if(r!=="EMPTY"){if(!r){E.error("Texture not found",r);return}if(exports.Assets.cache.has(r)){let e=exports.Assets.get(r);if(e)return e}return exports.Assets.load(r).then(e=>{if(!e){E.error("Texture not found",r);return}if(!(e instanceof exports.Texture)){E.error("File not is a file",r);return}return e}).catch(e=>{E.error("Error loading file",e);})}}Re();var ms=class r extends De{constructor(t){super(t);w(this,"pixivnId",nh);w(this,"_textureAlias");w(this,"_onEvents",{});this.pixivnId=this.constructor.prototype.pixivnId||nh;}get textureAlias(){return this._textureAlias?this._textureAlias:this.texture.source.label}set textureAlias(t){this._textureAlias=t;}get memory(){return Ep(this)}set memory(t){}async setMemory(t){return this.memory=t,await wp(this,t)}get onEvents(){return this._onEvents}onEvent(t,i){let s=i.prototype.id,n=hs.getInstance(s);return this._onEvents[t]=s,n?(super.on(t,()=>{n.fn(t,this);}),this.interactive||(this.interactive=true,this.eventMode="dynamic")):E.error(`Event ${s} not found`),this}on(t,i,s){return super.on(t,i,s)}static from(t,i){let s=De.from(t,i),n=new r;return n.texture=s.texture,n}};ar.add(ms,nh);async function wp(r,e,t){let i=t?.ignoreTexture||false;if(await ds(r,e),!i){if("textureImage"in e&&e.textureImage&&e.textureImage.image){let n=await Mu(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&&exports.Assets.resolver.hasKey(e.textureData.alias)&&(n=e.textureData.alias);let o=await Mu(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=hs.get(o);a&&r.onEvent(n,a);}}var Ue=class r extends ms{constructor(t,i){t=Pu(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);w(this,"pixivnId",Gw);w(this,"_loadIsStarted",false);w(this,"_align");w(this,"_percentagePosition");i&&(this.textureAlias=i),s&&(this.align=s),n&&(this.percentagePosition=n);}get memory(){return {...Ep(this),pixivnId:this.pixivnId,align:this._align,percentagePosition:this._percentagePosition,loadIsStarted:this._loadIsStarted}}set memory(t){}async setMemory(t){this.memory=t,await Pp(this,t),this.reloadPosition();}static from(t,i){let s=De.from(t,i),n=new r;return n.texture=s.texture,n}get loadIsStarted(){return this._loadIsStarted}async load(){return this._loadIsStarted=true,Mu(this.textureAlias).then(t=>{this._loadIsStarted=false,t&&(this.texture=t);}).catch(t=>{this._loadIsStarted=false,E.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=ut(this.pivot,this.angle),i=ut(this.scale,this.angle);return {x:fs("width",this.x,ui(this),t.x,i.x<0,this.anchor.x),y:fs("height",this.y,li(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=ut(this.pivot,this.angle),i=ut(this.scale,this.angle);return fs("width",this.x,ui(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=ut(this.pivot,this.angle),i=ut(this.scale,this.angle);return fs("height",this.y,li(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:ps("width",this.x),y:ps("height",this.y)}}get percentageX(){return ps("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 ps("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=ut(this.pivot,this.angle),i=ut(this.scale,this.angle);this._align.x!==void 0&&(super.x=oi("width",this._align.x,ui(this),t.x,i.x<0,this.anchor.x)),this._align.y!==void 0&&(super.y=oi("height",this._align.y,li(this),t.y,i.y<0,this.anchor.y));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=ai("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=ai("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;}};ar.add(Ue,Gw);async function Pp(r,e,t){let i=t?.ignoreTexture||false;return e=Pu(e),await wp(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})}Re();var nr=class r extends Ue{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);w(this,"pixivnId",Uw);w(this,"_looop",false);w(this,"_paused",false);w(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 Kw(this,t)}static from(t,i){let s=De.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}};ar.add(nr,Uw);async function Kw(r,e,t){await Pp(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 Ye=class extends fo{constructor(t,i=[]){t=Pu(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);w(this,"pixivnId",D0);w(this,"_loadIsStarted",false);w(this,"_anchor");w(this,"_align");w(this,"_percentagePosition");t=Pu(t),i&&i.forEach(a=>{let u;Cp(a)?u=new nr(void 0,a):u=new Ue(void 0,a),this.addChild(u);}),o&&(this.anchor=o),s&&(this.align=s),n&&(this.percentagePosition=n);}get memory(){return {...super.memory,pixivnId:D0,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 Zw(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,E.error("Error into ImageContainer.load()",i);})}get texture(){return this.children.length>0?this.children[0].texture:new exports.Texture}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=ut(this.pivot,this.angle),i=ut(this.scale,this.angle);return {x:fs("width",this.x,ui(this),t.x,i.x<0,this.anchor.x),y:fs("height",this.y,li(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=ut(this.pivot,this.angle),i=ut(this.scale,this.angle);return fs("width",this.x,ui(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=ut(this.pivot,this.angle),i=ut(this.scale,this.angle);return fs("height",this.y,li(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:ps("width",this.x),y:ps("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 ps("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 ps("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=ut(this.pivot,this.angle),i=ut(this.scale,this.angle);this._align.x!==void 0&&(super.x=oi("width",this._align.x,ui(this),t.x,i.x<0)),this._align.y!==void 0&&(super.y=oi("height",this._align.y,li(this),t.y,i.y<0));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=ai("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=ai("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;}};ar.add(Ye,D0);async function Zw(r,e,t){e=Pu(e),ds(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();}});}Re();var po=class extends Cr{constructor(t){super(t);w(this,"pixivnId",oh);w(this,"_onEvents",{});this.pixivnId=this.constructor.prototype.pixivnId||oh;}get memory(){return $w(this)}set memory(t){}async setMemory(t){return this.memory=t,await Qw(this,t)}get onEvents(){return this._onEvents}onEvent(t,i){let s=i.prototype.id,n=hs.getInstance(s);return this._onEvents[t]=s,n?(super.on(t,()=>{n.fn(t,this);}),this.interactive||(this.interactive=true,this.eventMode="dynamic")):E.error(`Event ${s} not found`),this}on(t,i,s){return super.on(t,i,s)}};ar.add(po,oh);async function Qw(r,e){if(await ds(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=hs.get(i);s&&r.onEvent(t,s);}}Re();var Ru=class{constructor(e,t,i){w(this,"_args");w(this,"duration");w(this,"priority");w(this,"ticker",new _e);w(this,"animation");w(this,"stopped",false);w(this,"ignoreOnComplete",true);w(this,"tickerId");w(this,"canvasElementAliases",[]);w(this,"timeout",50);w(this,"onComplete",()=>{if(this.ignoreOnComplete)return;let e=this.tickerId;if(!e){E.warn("MotionTicker.complete() called without tickerId set. This may cause issues.");return}let t=this._args.options?.aliasToRemoveAfter||[];typeof t=="string"&&(t=[t]);let i=this._args.options?.tickerAliasToResume||[];typeof i=="string"&&(i=[i]);let s=this._args.options?.tickerIdToResume||[];typeof s=="string"&&(s=[s]),I.onTickerComplete(e,{aliasToRemoveAfter:t,tickerAliasToResume:i,tickerIdToResume:s,stopTicker:false});});this._args=e,this.duration=t,this.priority=i;}get args(){return {...this._args,time:this.animation?.time}}getItemByAlias(e){if(!this.canvasElementAliases.includes(e))return;let t=I.find(e);if(t)return t}async complete(){if(!this.animation){E.warn("MotionTicker.complete() called without animation set. This may cause issues.");return}this.animation.complete(),await new Promise(e=>setTimeout(e,this.timeout));}stop(){if(!this.animation){E.warn("MotionTicker.stop() called without animation set. This may cause issues.");return}this.stopped=true,this.animation.stop();}createItem(e){return new Proxy({alias:e},{set:({alias:t},i,s)=>{if(this.stopped||this._args.startState&&this._args.startState[i]===s)return true;let n=this.getItemByAlias(t);if(!n)return true;switch(this.ignoreOnComplete&&setTimeout(()=>{this.ignoreOnComplete=false;},10),i){case "pivotX":n.pivot.x=s;break;case "pivotY":n.pivot.y=s;break;case "scaleX":n.scale.x=s;break;case "scaleY":n.scale.y=s;break;default:n[i]=s;break}return true},get:({alias:t},i)=>{if(this._args.startState||(this._args.startState={}),i in this._args.startState)return this._args.startState[i];let s=this.getItemByAlias(t);if(!s)return;let n;switch(i){case "pivotX":n=s.pivot.x;break;case "pivotY":n=s.pivot.y;break;case "scaleX":n=s.scale.x;break;case "scaleY":n=s.scale.y;break;default:n=s[i];break}return this._args.startState={...this._args.startState,[i]:n},n},has:({alias:t},i)=>{let s=this.getItemByAlias(t);if(!s)return false;switch(i){case "pivotX":return "pivot"in s&&"x"in s.pivot;case "pivotY":return "pivot"in s&&"y"in s.pivot;case "scaleX":return "scale"in s&&"x"in s.scale;case "scaleY":return "scale"in s&&"y"in s.scale;default:return i in s}},ownKeys:({alias:t})=>{let i=this.getItemByAlias(t);return i?Object.keys(i):[]}})}pause(){if(!this.animation){E.warn("MotionTicker.pause() called without animation set. This may cause issues.");return}this.animation.pause();}play(){if(!this.animation){E.warn("MotionTicker.play() called without animation set. This may cause issues.");return}this.animation.play();}get paused(){return this.animation?this.animation.state==="paused":(E.warn("MotionTicker.paused() called without animation set. This may cause issues."),true)}};var Bu=class extends Ru{constructor(){super(...arguments);w(this,"id","motion-sequence");}start(t){this.tickerId=t;let i=this.canvasElementAliases[0],s=this.createItem(i),n=this._args.sequence.map((o,a)=>[s,o[0],{...o[1]||{},ticker:this.ticker,repeat:this._args.options.repeat===null?1/0:this._args.options.repeat,onComplete:a===this._args.sequence.length-1?()=>this.onComplete():void 0}]);this.animation=mh(n,{...this._args.options,repeat:this._args.options.repeat===null?1/0:this._args.options.repeat}),this._args.time&&(this.animation.time=this._args.time);}};var Iu=class extends Ru{constructor(){super(...arguments);w(this,"id","motion");}start(t){this.tickerId=t;let i=this.canvasElementAliases.map(s=>this.createItem(s));this.animation=mh(i,this._args.keyframes,{...this._args.options,repeat:this._args.options?.repeat===null?1/0:this._args.options?.repeat,onComplete:()=>this.onComplete(),ticker:this.ticker}),this._args.time&&(this.animation.time=this._args.time);}};var mo=new Ct({cacheSize:5});mo.set("motion",Iu);mo.set("motion-sequence",Bu);function _O(r){return function(e){z0.add(e,r);}}var z0;(n=>{function r(o,a){a||(a=o.name),mo.get(a)&&E.info(`Ticker "${a}" already exists, it will be overwritten`),o.prototype.id=a,mo.set(a,o);}n.add=r;function e(o){try{let a=mo.get(o);if(!a){E.error(`Event "${o}" not found, did you forget to register it with the tickerDecorator?`);return}return a}catch(a){E.error(`Error while getting Event "${o}"`,a);return}}n.get=e;function t(o,a,u,l){try{let c=mo.get(o);if(!c){E.error(`Ticker "${o}" not found, did you forget to register it with the tickerDecorator?`);return}return new c(a,u,l)}catch(c){E.error(`Error while getting Ticker "${o}"`,c);return}}n.getInstance=t;function i(){return Array.from(mo.values())}n.values=i;function s(o){return mo.has(o)}n.has=s;})(z0||(z0={}));var ur=z0;var bO="aliasToRemoveAfter";var Mp=class{get app(){return k.app}get gameLayer(){return k.gameLayer}get isInitialized(){return k._isInitialized}get canvasWidth(){return k.canvasWidth}get canvasHeight(){return k.canvasHeight}set canvasWidth(e){k.canvasWidth=e;}set canvasHeight(e){k.canvasHeight=e;}get screen(){return this.app.screen}async init(e,t,i,s,n){if(typeof t=="number"&&typeof i=="number")return await k.init(e,t,i,s,n);if(typeof t!="number"&&typeof i!="number")return await k.init(e,t.width,t.height,t,i);throw new Error("Invalid parameters")}get children(){return k.gameLayer.children}async copyCanvasElementProperty(e,t){if(typeof t=="string"){let i=this.find(t);if(i)t=i;else {E.error(`Canvas element ${t} not found`);return}}if(typeof e=="string"){let i=this.find(e);if(i)e=i;else {E.error(`Canvas element ${e} not found`);return}}e instanceof J&&(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 nr?await Kw(t,e,{ignoreTexture:true}):t instanceof Ue?await Pp(t,e,{ignoreTexture:true}):t instanceof ms?await wp(t,e,{ignoreTexture:true}):t instanceof po?await Qw(t,e):t instanceof Ye?await Zw(t,e):t instanceof J&&await ds(t,e);}add(e,t,i={}){if(e===wr){E.error(`The alias ${wr} 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)?E.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===wr){E.error(`The alias ${wr} 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===wr)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();}editAlias(e,t,i={}){let s=this.find(e);s&&(s.label=t),!i.ignoreTickers&&this.transferTickers(e,t,"move");}get currentTickers(){return k._currentTickers}get currentTickersSteps(){return k._currentTickersSequence}findTicker(e){let t=k._currentTickers[e];if(t)return t.ticker}addTicker(e,t,i){let s=t.id;if(typeof e=="string"&&(e=[e]),t.canvasElementAliases=e,!ur.has(s)){E.error(`Ticker ${s} not found`);return}let n={ticker:t},{id:o=k.generateTickerId(n)}=i||{};if(k._currentTickers[o]=n,n.ticker.start(o),t.duration){let a=setTimeout(()=>{k.removeTickerTimeoutInfo(a),k._currentTickersTimeouts[a.toString()]&&n.ticker.complete({ignoreTickerSteps:true});},t.duration*1e3);k.addTickerTimeoutInfo(e,s,a.toString(),true);}return o}addTickersSequence(e,t,i=0){if(t.length==0){E.warn("The steps of the tickers is empty");return}e in k._currentTickersSequence||(k._currentTickersSequence[e]={});let s={currentStepNumber:i,steps:t.map(o=>o===oo||o.hasOwnProperty("type")&&o.type==="pause"?o:{ticker:o.id,args:pe(o.args),duration:o.duration})},n=k.generateTickerId(s);return k._currentTickersSequence[e][n]=s,this.runTickersSequence(e,n),n}runTickersSequence(e,t){if(!k._currentTickersSequence[e]||!k._currentTickersSequence[e][t])return;let i=k._currentTickersSequence[e][t].steps[k._currentTickersSequence[e][t].currentStepNumber];if(i===oo&&(i=k._currentTickersSequence[e][t].steps[0],k._currentTickersSequence[e][t].currentStepNumber=0,i===oo)){E.error("TikersSteps has a RepeatType in the first step");return}if(i.hasOwnProperty("type")&&i.type==="pause"){let u=setTimeout(()=>{let l=k._currentTickersTimeouts[u.toString()];l&&l.aliases.forEach(c=>{this.nextTickerStep(c,t);}),k.removeTickerTimeoutInfo(u);},i.duration*1e3);k.addTickerTimeoutInfo(e,"steps",u.toString(),false);return}let s=ur.getInstance(i.ticker,i.args,i.duration,i.priority);if(!s){E.error(`Ticker ${i.ticker} not found`);return}s.canvasElementAliases=[e];let n=s.id,o={createdByTicketSteps:{canvasElementAlias:e,id:t},ticker:s},a=k.generateTickerId(o);if(k._currentTickers[a]=o,o.ticker.start(a),s.duration){let u=setTimeout(()=>{let l=k._currentTickersTimeouts[u.toString()];l&&(o.ticker.complete({ignoreTickerSteps:true}),l.aliases.forEach(c=>{this.nextTickerStep(c,t);})),k.removeTickerTimeoutInfo(u);},s.duration*1e3);k.addTickerTimeoutInfo(e,n,u.toString(),false);}}nextTickerStep(e,t){if(k._currentTickersSequence[e]&&k._currentTickersSequence[e][t]){let i=k._currentTickersSequence[e][t];i.currentStepNumber+1<i.steps.length?(i.currentStepNumber++,k._currentTickersSequence[e][t]=i,this.runTickersSequence(e,t)):t&&k._currentTickersSequence[e]&&k._currentTickersSequence[e][t]&&(delete k._currentTickersSequence[e][t],Object.entries(k._currentTickers).forEach(([s,n])=>{n.createdByTicketSteps?.canvasElementAlias===e&&n.createdByTicketSteps.id===t&&this.removeTicker(s);}));}}onEndOfTicker(e,t){return this.onTickerComplete(e,t)}onTickerComplete(e,t){let{stopTicker:i=true,aliasToRemoveAfter:s,tickerAliasToResume:n,tickerIdToResume:o}=t,a=k._currentTickers[e],u=t.ignoreTickerSteps||false;this.remove(s),n.forEach(l=>this.resumeTicker({canvasAlias:l})),this.resumeTicker({id:o}),a&&(this.removeTicker(e,{stopTicker:i}),!u&&a.ticker.duration==null&&a.createdByTicketSteps&&this.nextTickerStep(a.createdByTicketSteps.canvasElementAlias,a.createdByTicketSteps.id));}unlinkComponentFromTicker(e,t){if(typeof e=="string"&&(e=[e]),!t){e.forEach(s=>{Object.entries(k._currentTickers).forEach(([n,o])=>{o.ticker.canvasElementAliases.includes(s)&&(o.ticker.canvasElementAliases.length===1?this.removeTicker(n):o.ticker.canvasElementAliases=o.ticker.canvasElementAliases.filter(a=>a!==s));}),k._currentTickersSequence[s]&&delete k._currentTickersSequence[s],k.removeTickerTimeoutsByAlias(s,false);});return}let i;typeof t=="string"?i=t:i=t.prototype.id,e.forEach(s=>{k._currentTickersSequence[s]&&Object.entries(k._currentTickersSequence[s]).forEach(([n,o])=>{o.steps.find(a=>typeof a=="object"&&"ticker"in a&&a.ticker===i)&&delete k._currentTickersSequence[s][n];});}),Object.entries(k._currentTickers).forEach(([s,n])=>{n.ticker.id===i&&(k._currentTickers[s].ticker.canvasElementAliases=n.ticker.canvasElementAliases.filter(o=>!e.includes(o)));}),Object.entries(k._currentTickersTimeouts).forEach(([s,n])=>{n.ticker===i&&n.canBeDeletedBeforeEnd&&(k._currentTickersTimeouts[s].aliases=n.aliases.filter(o=>!e.includes(o)));}),this.removeTickersWithoutAssociatedCanvasElement();}removeTickersWithoutAssociatedCanvasElement(){Object.entries(k._currentTickers).forEach(([e,t])=>{t.ticker.canvasElementAliases=t.ticker.canvasElementAliases.filter(i=>this.find(i)),t.ticker.canvasElementAliases.length===0&&t.ticker.complete({ignoreTickerSteps:true});}),Object.entries(k._currentTickersSequence).forEach(([e,t])=>{t===void 0&&delete k._currentTickersSequence[e];}),Object.entries(k._currentTickersTimeouts).forEach(([e,{aliases:t}])=>{t.length===0&&k.removeTickerTimeout(e);});}removeAllTickers(){k._currentTickersSequence={},Object.keys(k._currentTickers).forEach(e=>{this.removeTicker(e);}),k._currentTickers={};for(let e in k._currentTickersTimeouts)k.removeTickerTimeout(e);k._tickersToCompleteOnStepEnd={tikersIds:[],stepAlias:[]},k._tickersOnPause={};}removeTicker(e,t={stopTicker:true}){typeof e=="string"&&(e=[e]),e.forEach(i=>{let s=k._currentTickers[i];s&&(t.stopTicker&&s.ticker.stop(),delete k._currentTickers[i]);});}pauseTicker(e){let t=[];if("canvasAlias"in e){let{canvasAlias:i,tickerIdsExcluded:s=[]}=e;Object.entries(k._currentTickers).forEach(([n,o])=>{o.ticker.canvasElementAliases.includes(i)&&!s.includes(o.ticker.id)&&o.ticker.paused===false&&(o.ticker.pause(),t.push(n));});}else if("id"in e){let{id:i}=e;typeof i=="string"&&(i=[i]),i.forEach(s=>{let n=k._currentTickers[s];n?n.ticker.paused===false&&(n.ticker.pause(),t.push(s)):E.error(`Ticker with id ${s} not found`);});}return t}resumeTicker(e){if("canvasAlias"in e){let{canvasAlias:t}=e;Object.values(k._currentTickers).forEach(i=>{i.ticker.canvasElementAliases.includes(t)&&i.ticker.play();}),delete k._tickersOnPause[t];}else if("id"in e){let{id:t}=e;typeof t=="string"&&(t=[t]),t.forEach(i=>{let s=k._currentTickers[i];s?s.ticker.play():E.error(`Ticker with id ${i} not found`);});}}isTickerPaused(e,t){let i=k._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}transferTickers(e,t,i="move"){k._currentTickersSequence[e]&&(i==="move"?k._currentTickersSequence[t]=pe(k._currentTickersSequence[e]):i==="duplicate"&&(k._currentTickersSequence[t]=pe(k._currentTickersSequence[e]))),Object.entries(k._currentTickers).forEach(([s,n])=>{if(n.createdByTicketSteps?.canvasElementAlias===e&&this.removeTicker(s),n.ticker.canvasElementAliases.includes(e)){let o=ur.getInstance(n.ticker.id,pe(n.ticker.args),n.ticker.duration,n.ticker.priority);if(o?(o.canvasElementAliases=[t],this.addTicker(t,o),n.ticker.paused&&o.pause()):E.error(`Ticker ${n.ticker.id} not found`),i==="move"&&(n.ticker.canvasElementAliases=n.ticker.canvasElementAliases.filter(a=>a!==e)),n.ticker.args.hasOwnProperty(bO)){let a=n.ticker.args.aliasToRemoveAfter;typeof a=="string"&&(a=[a]),Array.isArray(a)&&(i==="move"?n.ticker.args.aliasToRemoveAfter=a.map(u=>u===e?t:u):i==="duplicate"&&a.find(u=>u===e)&&(n.ticker.args.aliasToRemoveAfter=[...a,t]));}}}),Object.values(k._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));}),k._currentTickersSequence[t]&&Object.keys(k._currentTickersSequence[t]).forEach(s=>{this.runTickersSequence(t,s);}),i==="duplicate"&&k._currentTickersSequence[e]&&Object.keys(k._currentTickersSequence[e]).forEach(s=>{this.runTickersSequence(e,s);});}completeTickerOnStepEnd(e){e.alias?k._tickersToCompleteOnStepEnd.stepAlias.push({id:e.id,alias:e.alias}):k._tickersToCompleteOnStepEnd.tikersIds.push({id:e.id});}async forceCompletionOfTicker(e,t){if(t){let i=k._currentTickersSequence[t];if(i&&i[e])if(i[e].steps.includes(oo))E.error(`The ticker alias: ${t} id: ${e} contains a RepeatType, so it can't be forced to complete`,i[e]);else {let s=i[e].steps.map(n=>{if(typeof n=="object"&&"ticker"in n){let o=ur.getInstance(n.ticker,n.args,n.duration,n.priority);if(o)return o.canvasElementAliases=[t],o.complete()}});await Promise.all(s);}}else {let i=k._currentTickers[e];i&&await i.ticker.complete();}}animate(e,t,i,s){try{t=pe(t);}catch(l){throw E.error("animate keyframes cannot contain functions or classes"),l}try{i=pe(i);}catch(l){throw E.error("animate options cannot contain functions or classes"),l}let n=[];typeof e=="string"?n=[e]:Array.isArray(e)?n=e.map(l=>typeof l=="string"?l:l.label):n=[e.label];let o;Array.isArray(t)?o=new Bu({sequence:t,options:i},void 0,s):o=new Iu({keyframes:t,options:i},void 0,s);let a=this.addTicker(n,o),{forceCompleteBeforeNext:u}=i||{};return a&&u&&this.completeTickerOnStepEnd({id:a}),a}addLayer(e,t){if(e===wr){E.error(`The alias ${wr} is reserved`);return}return t.label=e,k.app.stage.addChild(t)}getLayer(e){return k.app.stage.getChildByLabel(e)}removeLayer(e){k.app.stage.getChildrenByLabel(e);}addHtmlLayer(e,t,i){return k.addHtmlLayer(e,t,i)}removeHtmlLayer(e){return k.removeHtmlLayer(e)}getHtmlLayer(e){return k.getHtmlLayer(e)}async extractImage(){return (await this.app.renderer.extract.image(this.gameLayer)).src}clear(){this.removeAllTickers(),this.removeAll();}export(){let e={};return this.children.forEach(t=>{t.label&&(e[t.label]=jw(t));}),{tickers:pe(k.currentTickersWithoutCreatedBySteps),tickersSteps:pe(k._currentTickersSequence),elements:pe(e),stage:pe(wu(this.gameLayer)),elementAliasesOrder:pe(k.childrenAliasesOrder),tickersOnPause:pe(k._tickersOnPause),tickersToCompleteOnStepEnd:pe(k._tickersToCompleteOnStepEnd)}}async restore(e){this.clear();try{if(e.hasOwnProperty("elementAliasesOrder")&&e.hasOwnProperty("elements")){let t=e.elementAliasesOrder,i={},s=Object.entries(e.elements).map(async([n,o])=>{i[n]=await H0(o);});await Promise.all(s),t.forEach(n=>{let o=i[n];o&&this.add(n,o);});}else {E.error("The data does not have the properties elementAliasesOrder and elements");return}if(e.hasOwnProperty("stage")&&e.hasOwnProperty("stage")?ds(this.gameLayer,e.stage,{ignoreScale:!0}):E.error("The data does not have the properties stage"),e.hasOwnProperty("tickers")){let t=e.tickers;Object.entries(t).forEach(([i,s])=>{let n=s.canvasElementAliases;if(n.length!==0){let o=ur.getInstance(s.id,s.args,s.duration,s.priority);o?(o.canvasElementAliases=n,this.addTicker(n,o,{id:i}),s.paused&&o.pause()):E.error(`Ticker ${s.id} not found`);}});}if(e.hasOwnProperty("tickersSteps")){let t=e.tickersSteps;Object.entries(t).forEach(([i,s])=>{k._currentTickersSequence[i]=s,Object.keys(s).forEach(n=>{this.runTickersSequence(i,n);});});}if(e.hasOwnProperty("tickersOnPause")){let t=e.tickersOnPause;Object.keys(t).forEach(i=>{let s=t[i];"tickerIdsExcluded"in s&&s.tickerIdsExcluded&&(t[i].tickerIdsExcluded=s.tickerIdsExcluded),"tickerIdsIncluded"in s&&s.tickerIdsIncluded&&(t[i].tickerIdsIncluded=s.tickerIdsIncluded);}),k._tickersOnPause=t;}if(e.hasOwnProperty("tickersToCompleteOnStepEnd")){let t=e.tickersToCompleteOnStepEnd,i=t.tikersIds,s=t.stepAlias.map(n=>({id:n.id,alias:n.alias}));k._tickersToCompleteOnStepEnd={tikersIds:i,stepAlias:s};}}catch(t){E.error("Error importing data",t);}}};var Rp=class{constructor(){w(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 Bp=class{constructor(){w(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")}};async function yO(r,e={},t){let i=I.find(r);if(!i){E.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},{shakeType:n="horizontal",maxShockSize:o=10,shocksNumber:a=10,...u}=e,l=a-1;if(l<2){E.error("The number of shocks must be at least 3.");return}let c=Math.floor(l/2),h=Math.ceil(l/2),d=[];for(let _=0;_<c;_++){let x=o*(_+1)/c;n==="horizontal"?_%2!==0?d.push(s.x+x):d.push(s.x-x):_%2!==0?d.push(s.y+x):d.push(s.y-x);}let f=c%2===0;for(let _=h;_>0;_--){let x=o*(_+1)/(h-1);n==="horizontal"?_%2===0&&!f||_%2!==0&&f?d.push(s.x-x):d.push(s.x+x):_%2===0&&!f||_%2!==0&&f?d.push(s.y-x):d.push(s.y+x);}let m;if(n==="horizontal"?(d.push(s.x),m=I.animate(r,{x:d},u,t)):(d.push(s.y),m=I.animate(r,{y:d},u,t)),m)return [m]}Re();function Ip(r,e,t){let i=new Ye(t,e);return I.add(r,i),i}async function vO(r,e,t){let i=new Ye(t,e);return await i.load(),I.add(r,i),i}Re();function Dp(r,e,t){if(!e)if(exports.Assets.resolver.hasKey(r))e=r;else throw new Error(`The image ${r} does not exist in the cache.`);let i=new Ue(t,e);return I.add(r,i),i}async function TO(r,e,t){if(!e)if(exports.Assets.resolver.hasKey(r))e=r;else throw new Error(`The image ${r} does not exist in the cache.`);let i=new Ue(t,e);return await i.load(),I.add(r,i),i}Re();function kp(r,e,t){if(!e)if(exports.Assets.resolver.hasKey(r))e=r;else throw new Error(`The video ${r} does not exist in the cache.`);let i=new nr(t,e);return I.add(r,i),i}async function SO(r,e,t){if(!e)if(exports.Assets.resolver.hasKey(r))e=r;else throw new Error(`The video ${r} does not exist in the cache.`);let i=new nr(t,e);return await i.load(),I.add(r,i),i}function Jw(r,e){if(r.type==="align"){let t,i;e instanceof De&&(t=e.anchor.x,i=e.anchor.y);let s=ut(e.pivot,e.angle),n=ut(e.scale,e.angle);r.x=oi("width",r.x,ui(e),s.x,n.x<0,t),r.y=oi("height",r.y,li(e),s.y,n.y<0,i);}return r.type==="percentage"&&(r.x=ai("width",r.x),r.y=ai("height",r.y)),{x:r.x,y:r.y}}function Op(r,e){if(typeof e=="string")return Cp(e)?kp(r,e):Dp(r,e);if(Array.isArray(e))return Ip(r,e);if(typeof e=="object"&&"value"in e&&"options"in e){if(typeof e.value=="string")return Cp(e.value)?kp(r,e.value,e.options):Dp(r,e.value,e.options);if(Array.isArray(e.value))return Ip(r,e.value,e.options)}return I.add(r,e),e}async function eP(r,e,t={},i){let{forceCompleteBeforeNext:s=true,tickerIdToResume:n=[],...o}=t,a=[];e||(e=r),typeof n=="string"&&(n=[n]);let u;if(I.find(r)&&(u=r+"_temp_disolve",I.editAlias(r,u)),e=Op(r,e),u&&I.copyCanvasElementProperty(u,r),u&&I.transferTickers(u,r,"duplicate"),e.alpha=0,u){let c=Fp(u,{...t,autoplay:false},i);c&&(a.push(...c),n.push(...c));}let l=I.animate(r,{alpha:1},{...o,tickerIdToResume:n,forceCompleteBeforeNext:s},i);if(l&&a.push(l),(e instanceof Ue||e instanceof Ye)&&e.haveEmptyTexture&&await e.load(),a.length>0)return a}function Fp(r,e={},t){let{forceCompleteBeforeNext:i=true,aliasToRemoveAfter:s=[],...n}=e;typeof s=="string"&&(s=[s]),s.push(r);let o=I.animate(r,{alpha:0},{...n,aliasToRemoveAfter:s,forceCompleteBeforeNext:i},t);if(o)return [o]}async function EO(r,e,t={},i){let{forceCompleteBeforeNext:s=true,aliasToRemoveAfter:n=[],...o}=t,a=[];if(e||(e=r),typeof n=="string"&&(n=[n]),!I.find(r))return eP(r,e,t,i);let u=r+"_temp_fade";I.editAlias(r,u),n.push(u),e=Op(r,e),u&&I.copyCanvasElementProperty(u,r),u&&I.transferTickers(u,r,"duplicate"),e.alpha=0;let l=I.animate(r,{alpha:1},{...o,aliasToRemoveAfter:n,forceCompleteBeforeNext:s},i);if(l){let c=Fp(u,{...t,tickerIdToResume:l},i);c&&a.push(...c),a.push(l),I.pauseTicker({id:l});}if((e instanceof Ue||e instanceof Ye)&&e.haveEmptyTexture&&await e.load(),a.length>0)return a}function AO(r,e={},t){return Fp(r,e,t)}async function CO(r,e,t={},i){let{direction:s="right",forceCompleteBeforeNext:n=true,tickerIdToResume:o=[],aliasToRemoveAfter:a=[],removeOldComponentWithMoveOut:u,...l}=t,c=[];e||(e=r),typeof o=="string"&&(o=[o]),typeof a=="string"&&(a=[a]);let h;I.find(r)&&(h=r+"_temp_movein",I.editAlias(r,h)),e=Op(r,e),h&&I.copyCanvasElementProperty(h,r),h&&I.transferTickers(h,r,"move");let d;if(e instanceof Ue||e instanceof Ye?d=e.positionInfo:d={x:e.x,y:e.y,type:"pixel"},h)if(u){let _=W0(h,{...t,autoplay:false},i);_&&(c.push(..._),o.push(..._));}else a.push(h);switch((e instanceof Ue||e instanceof Ye)&&e.haveEmptyTexture&&await e.load(),s){case "up":e.y=I.canvasHeight+e.height;break;case "down":e.y=-e.height;break;case "left":e.x=I.canvasWidth+e.width;break;case "right":e.x=-e.width;break}let f=I.pauseTicker({canvasAlias:r});o.push(...f);let m=I.animate(r,Jw(d,e),{...l,tickerIdToResume:o,aliasToRemoveAfter:a,forceCompleteBeforeNext:n},i);if(m&&c.push(m),c.length>0)return c}function W0(r,e={},t){let{direction:i="right",forceCompleteBeforeNext:s=true,aliasToRemoveAfter:n=[],...o}=e;typeof n=="string"&&(n=[n]),n.push(r);let a=I.find(r);if(!a){E.warn(`The canvas component "${r}" is not found.`);return}let u={x:a.x,y:a.y};switch(i){case "up":u.y=-a.height;break;case "down":u.y=I.canvasHeight+a.height;break;case "left":u.x=-a.width;break;case "right":u.x=I.canvasWidth+a.width;break}I.pauseTicker({canvasAlias:r});let l=I.animate(r,u,{...o,aliasToRemoveAfter:n,forceCompleteBeforeNext:s},t);if(l)return [l]}async function wO(r,e,t={},i){let{direction:s="right",forceCompleteBeforeNext:n=true,tickerIdToResume:o=[],aliasToRemoveAfter:a=[],...u}=t,l=[];e||(e=r),typeof o=="string"&&(o=[o]),typeof a=="string"&&(a=[a]);let c;I.find(r)&&(c=r+"_temp_zoom",I.editAlias(r,c)),e=Op(r,e),c&&I.copyCanvasElementProperty(c,r),c&&I.transferTickers(c,r,"move");let h;e instanceof Ue||e instanceof Ye?h=e.positionInfo:h={x:e.x,y:e.y,type:"pixel"};let d={x:e.pivot.x,y:e.pivot.y},f={x:e.scale.x,y:e.scale.y};if(c)if(t.removeOldComponentWithZoomOut){let x=tP(c,{...t,autoplay:false},i);x&&(l.push(...x),o.push(...x));}else a.push(c);(e instanceof Ue||e instanceof Ye)&&e.haveEmptyTexture&&await e.load(),s=="up"?(e.pivot.y=I.canvasHeight-e.y,e.pivot.x=I.canvasWidth/2-e.x,e.y=I.canvasHeight,e.x=I.canvasWidth/2):s=="down"?(e.pivot.y=0-e.y,e.pivot.x=I.canvasWidth/2-e.x,e.y=0,e.x=I.canvasWidth/2):s=="left"?(e.pivot.x=I.canvasWidth-e.x,e.pivot.y=I.canvasHeight/2-e.y,e.x=I.canvasWidth,e.y=I.canvasHeight/2):s=="right"&&(e.pivot.x=0-e.x,e.pivot.y=I.canvasHeight/2-e.y,e.x=0,e.y=I.canvasHeight/2),e.pivot=qw(e.pivot,e.angle),e.scale.set(0);let m=I.pauseTicker({canvasAlias:r});o.push(...m);let _=I.animate(r,{...Jw(h,e),pivotX:d.x,pivotY:d.y,scaleX:f.x,scaleY:f.y},{...u,tickerIdToResume:o,aliasToRemoveAfter:a,forceCompleteBeforeNext:n},i);if(_&&l.push(_),l.length>0)return l}function tP(r,e={},t){let{direction:i="right",forceCompleteBeforeNext:s=true,aliasToRemoveAfter:n=[],...o}=e;typeof n=="string"&&(n=[n]),n.push(r);let a=I.find(r);if(!a){E.warn(`The canvas component "${r}" is not found.`);return}let u={x:a.x,y:a.y},l={x:a.pivot.x,y:a.pivot.y};i=="down"?(u.y=I.canvasHeight,u.x=I.canvasWidth/2,l.y=I.canvasHeight-u.y,l.x=I.canvasWidth/2-u.x):i=="up"?(u.y=0,u.x=I.canvasWidth/2,l.y=0-u.y,l.x=I.canvasWidth/2-u.x):i=="right"?(u.x=I.canvasWidth,u.y=I.canvasHeight/2,l.x=I.canvasWidth-u.x,l.y=I.canvasHeight/2-u.y):i=="left"&&(u.x=0,u.y=I.canvasHeight/2,l.x=0-u.x,l.y=I.canvasHeight/2-u.y),l=qw(l,a.angle),I.pauseTicker({canvasAlias:r});let c=I.animate(r,{...u,pivotX:l.x,pivotY:l.y,scaleX:0,scaleY:0},{...o,aliasToRemoveAfter:n,forceCompleteBeforeNext:s},t);if(c)return [c]}async function PO(r,e,t={},i){let{direction:s="right",forceCompleteBeforeNext:n=true,tickerIdToResume:o=[],...a}=t,u=[];e||(e=r),typeof o=="string"&&(o=[o]);let l;I.find(r)&&(l=r+"_temp_push",I.editAlias(r,l)),e=Op(r,e),l&&I.copyCanvasElementProperty(l,r),l&&I.transferTickers(l,r,"move");let c;switch((e instanceof Ue||e instanceof Ye)&&e.haveEmptyTexture?c=e.positionInfo:c={x:e.x,y:e.y,type:"pixel"},s){case "up":e.y=I.canvasHeight+e.height;break;case "down":e.y=-e.height;break;case "left":e.x=I.canvasWidth+e.width;break;case "right":e.x=-e.width;break}let h=I.pauseTicker({canvasAlias:r});if(o.push(...h),l){let f=rP(l,{...t,direction:s});f&&u.push(...f);}let d=I.animate(r,Jw(c,e),{...a,tickerIdToResume:o,forceCompleteBeforeNext:n},i);if(d&&u.push(d),(e instanceof Ue||e instanceof Ye)&&e.haveEmptyTexture&&await e.load(),u.length>0)return u}function rP(r,e={direction:"right"},t){return W0(r,e,t)}Re();var Hr=class{constructor(e,t,i){w(this,"id","ticker_id_not_set");w(this,"args");w(this,"duration");w(this,"priority");w(this,"ticker",new _e);w(this,"tickerId");w(this,"canvasElementAliases",[]);w(this,"fnValue");this.args=e,this.duration=t,this.priority=i,this.id=this.constructor.prototype.id;}complete(e){this.stop();}stop(){let e=this.fnValue;if(!e){E.warn("TickerBase.stop() called without fnValue set. This may cause issues.");return}this.ticker.remove(e,null);}start(e){this.tickerId=e;let t=()=>{let{createdByTicketSteps:i}=k._currentTickers[e],s=this.canvasElementAliases;if(i){if(I.isTickerPaused(i.canvasElementAlias,i.id))return}else s=s.filter(n=>!I.isTickerPaused(n,e));return this.fn(this.ticker,this.args,s,e)};this.fnValue=t,this.ticker.add(t,null,this.priority),this.ticker.start();}pause(){this.ticker.stop();}play(){this.ticker.start();}get paused(){return !this.ticker.started}};Re();Re();function go(r){return (r instanceof Ue||r instanceof Ye)&&r.haveEmptyTexture?false:!(r instanceof De&&r.texture?.label=="EMPTY")}function xo(r,e,t){let{limit:i}=t;r[e]===void 0||!t||r[e]===i||(typeof r[e]=="number"?t.type==="linear"?r[e]=iP(r[e],t):t.type==="exponential"&&(r[e]=sP(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=iP(r[e].x,t),r[e].y=iP(r[e].y,t)):t.type==="exponential"&&(r[e].x=sP(r[e].x,t),r[e].y=sP(r[e].y,t))));}function iP(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 sP(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 gN=5,gh=class extends Hr{constructor(e={},t,i){super(e,t,i);}fn(e,t,i,s){t.speed===void 0&&(t.duration===void 0?t.speed=gN: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=I.find(c);return !(!h||o&&!go(h))}).forEach(c=>{let h=I.find(c);if(h&&h instanceof J){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.complete();return}else if(n==="hide"&&h.alpha<=l){this.complete();return}if(u<1e-5&&!(a&&a.type=="linear"&&a.amt!=0)){E.warn("The speed of the FadeAlphaTicker must be greater than 0."),this.complete();return}}}),a&&xo(t,"speed",a);}onComplete(e,t,i){typeof e=="string"&&(e=[e]),e.forEach(s=>{let n=I.find(s);if(n){let o=this.getLimit(i);n.alpha=o;}});}getLimit(e){let{type:t="hide",limit:i=t==="hide"?0:1}=e;return i}speedConvert(e){return e/600}complete(e){let{ignoreTickerSteps:t}=e||{},i=this.tickerId;if(!i){E.warn("TickerBase.complete() called without tickerId set. This may cause issues.");return}this.onComplete(this.canvasElementAliases,i,this.args);let s="aliasToRemoveAfter"in this.args&&this.args.aliasToRemoveAfter||[];typeof s=="string"&&(s=[s]);let n="tickerAliasToResume"in this.args&&this.args.tickerAliasToResume||[];typeof n=="string"&&(n=[n]);let o="tickerIdToResume"in this.args&&this.args.tickerIdToResume||[];typeof o=="string"&&(o=[o]),I.onTickerComplete(i,{aliasToRemoveAfter:s,tickerAliasToResume:n,tickerIdToResume:o,ignoreTickerSteps:t}),super.complete(e);}};ur.add(gh);Re();var nP={};vs(nP,{createExportableElement:()=>pe});var xN=10;function _N(r,e){let t=pe(r.destination);if(t.type==="align"){let i,s;e instanceof De&&(i=e.anchor.x,s=e.anchor.y);let n=ut(e.pivot,e.angle),o=ut(e.scale,e.angle);t.x=oi("width",t.x,ui(e),n.x,o.x<0,i),t.y=oi("height",t.y,li(e),n.y,o.y<0,s);}return t.type==="percentage"&&(t.x=ai("width",t.x),t.y=ai("height",t.y)),t}var xh=class extends Hr{fn(e,t,i,s){t.speed===void 0&&(t.speed=xN);let{speed:n,startOnlyIfHaveTexture:o,speedProgression:a}=t;i.filter(u=>{let l=I.find(u);return !(!l||o&&!go(l))}).forEach(u=>{let l=I.find(u);if(l&&l instanceof J){let c=_N(t,l),h=c.x-l.x,d=c.y-l.y,f=h>0?1:-1,m=d>0?1:-1,_,x;if(typeof n=="number"){let g=this.speedConvert(n);h===0||d===0?_=x=g:(_=Math.abs(h/(h+d))*g,x=Math.abs(d/(h+d))*g);}else _=this.speedConvert(n.x),x=this.speedConvert(n.y);if(_>0){l.x+=f*_*e.deltaTime;let g=c.x-l.x;(f<0&&g>0||f>0&&g<0)&&(l.x=c.x);}if(x>0){l.y+=m*x*e.deltaTime;let g=c.y-l.y;(m<0&&g>0||m>0&&g<0)&&(l.y=c.y);}if(l.x==c.x&&l.y==c.y){this.complete();return}else if(_<1e-5&&x<1e-5&&!(a&&a.type=="linear"&&a.amt!=0)){E.warn("The speed of the MoveTicker must be greater than 0."),this.complete();return}}}),a&&xo(t,"speed",a);}onComplete(e,t,i){typeof e=="string"&&(e=[e]),e.forEach(s=>{let n=I.find(s);if(n){let o=i.destination;n instanceof Ue||n instanceof Ye?n.positionInfo=o:(n.x=o.x,n.y=o.y);}});}speedConvert(e){return e*(66/400)}complete(e){let{ignoreTickerSteps:t}=e||{},i=this.tickerId;if(!i){E.warn("TickerBase.complete() called without tickerId set. This may cause issues.");return}this.onComplete(this.canvasElementAliases,i,this.args);let s="aliasToRemoveAfter"in this.args&&this.args.aliasToRemoveAfter||[];typeof s=="string"&&(s=[s]);let n="tickerAliasToResume"in this.args&&this.args.tickerAliasToResume||[];typeof n=="string"&&(n=[n]);let o="tickerIdToResume"in this.args&&this.args.tickerIdToResume||[];typeof o=="string"&&(o=[o]),I.onTickerComplete(i,{aliasToRemoveAfter:s,tickerAliasToResume:n,tickerIdToResume:o,ignoreTickerSteps:t}),super.complete(e);}};ur.add(xh);Re();var bN=1,_h=class extends Hr{constructor(e={},t,i){super(e,t,i);}fn(e,t,i,s){t.speed===void 0&&(t.speed=bN);let{clockwise:n=true,speedProgression:o,limit:a}=t,u=this.speedConvert(t.speed);i.filter(l=>{let c=I.find(l);return !(!c||t.startOnlyIfHaveTexture&&!go(c))}).forEach(l=>{let c=I.find(l);if(c&&c instanceof J&&(n?c.rotation+=u*e.deltaTime:c.rotation-=u*e.deltaTime,a!==void 0&&(n&&c.angle>=a?(c.angle=a,this.complete()):!n&&c.angle<=a&&(c.angle=a,this.complete())),u<1e-5&&!(o&&o.type=="linear"&&o.amt!=0))){E.warn("The speed of the RotateTicker must be greater than 0."),this.complete();return}}),o&&xo(t,"speed",o);}onComplete(e,t,i){let{limit:s}=i;typeof e=="string"&&(e=[e]),e.forEach(n=>{let o=I.find(n);o&&s!==void 0&&(o.angle=s);});}speedConvert(e){return e/100}complete(e){let{ignoreTickerSteps:t}=e||{},i=this.tickerId;if(!i){E.warn("TickerBase.complete() called without tickerId set. This may cause issues.");return}this.onComplete(this.canvasElementAliases,i,this.args);let s="aliasToRemoveAfter"in this.args&&this.args.aliasToRemoveAfter||[];typeof s=="string"&&(s=[s]);let n="tickerAliasToResume"in this.args&&this.args.tickerAliasToResume||[];typeof n=="string"&&(n=[n]);let o="tickerIdToResume"in this.args&&this.args.tickerIdToResume||[];typeof o=="string"&&(o=[o]),I.onTickerComplete(i,{aliasToRemoveAfter:s,tickerAliasToResume:n,tickerIdToResume:o,ignoreTickerSteps:t}),super.complete(e);}};ur.add(_h);Re();var yN=10,bh=class extends Hr{constructor(e={},t,i){super(e,t,i);}fn(e,t,i,s){t.speed===void 0&&(t.speed=yN);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 f=I.find(d);return !(!f||a&&!go(f))}).forEach(d=>{let f=I.find(d);if(f&&f instanceof J){if(o==="zoom"&&(f.scale.x<h.x||f.scale.y<h.y)?(f.scale.x+=l*e.deltaTime,f.scale.y+=c*e.deltaTime):o==="unzoom"&&(f.scale.x>h.x||f.scale.y>h.y)&&(f.scale.x-=l*e.deltaTime,f.scale.y-=c*e.deltaTime),o==="zoom"){if(f.scale.x>h.x&&(f.scale.x=h.x),f.scale.y>h.y&&(f.scale.y=h.y),f.scale.x>=h.x&&f.scale.y>=h.y){this.complete();return}}else if(o==="unzoom"&&(f.scale.x<h.x&&(f.scale.x=h.x),f.scale.y<h.y&&(f.scale.y=h.y),f.scale.x<=h.x&&f.scale.y<=h.y)){this.complete();return}if((l<1e-5&&c<1e-5||l<1e-5&&f.scale.y==h.y||c<1e-5&&f.scale.x==h.x)&&!(u&&u.type=="linear"&&u.amt!=0)){E.warn("The speed of the ZoomTicker must be greater than 0."),this.complete();return}}}),u&&xo(t,"speed",u);}speedConvert(e){return e/600}onComplete(e,t,i){let{isZoomInOut:s}=i;typeof e=="string"&&(e=[e]),e.forEach(n=>{let o=I.find(n);if(o){let a=this.getLimit(i);if(o.scale.x=a.x,o.scale.y=a.y,s){let{pivot:u,position:l}=s;o.pivot=u.x,o.position=l;}}});}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}}complete(e){let{ignoreTickerSteps:t}=e||{},i=this.tickerId;if(!i){E.warn("TickerBase.complete() called without tickerId set. This may cause issues.");return}this.onComplete(this.canvasElementAliases,i,this.args);let s="aliasToRemoveAfter"in this.args&&this.args.aliasToRemoveAfter||[];typeof s=="string"&&(s=[s]);let n="tickerAliasToResume"in this.args&&this.args.tickerAliasToResume||[];typeof n=="string"&&(n=[n]);let o="tickerIdToResume"in this.args&&this.args.tickerIdToResume||[];typeof o=="string"&&(o=[o]),I.onTickerComplete(i,{aliasToRemoveAfter:s,tickerAliasToResume:n,tickerIdToResume:o,ignoreTickerSteps:t}),super.complete(e);}};ur.add(bh);function oP(r,e){r.indexOf(e)===-1&&r.push(e);}function Du(r,e){let t=r.indexOf(e);t>-1&&r.splice(t,1);}var Mr=(r,e,t)=>t>e?e:t<r?r:t;function Gp(r,e){return e?`${r}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:r}var gs=()=>{},Ht=()=>{};process.env.NODE_ENV!=="production"&&(gs=(r,e,t)=>{!r&&typeof console<"u"&&console.warn(Gp(e,t));},Ht=(r,e,t)=>{if(!r)throw new Error(Gp(e,t))});var lr={};var Up=r=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(r);function aP(r){return typeof r=="object"&&r!==null}var Lp=r=>/^0[^.\s]+$/u.test(r);function ku(r){let e;return ()=>(e===void 0&&(e=r()),e)}var zr=r=>r;var vN=(r,e)=>t=>e(r(t)),Ou=(...r)=>r.reduce(vN);var Fu=(r,e,t)=>{let i=e-r;return i===0?1:(t-r)/i};var Gu=class{constructor(){this.subscriptions=[];}add(e){return oP(this.subscriptions,e),()=>Du(this.subscriptions,e)}notify(e,t,i){let s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](e,t,i);else for(let n=0;n<s;n++){let o=this.subscriptions[n];o&&o(e,t,i);}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0;}};var Dt=r=>r*1e3,xr=r=>r/1e3;function Np(r,e){return e?r*(1e3/e):0}var MO=new Set;function Vp(r,e,t){r||MO.has(e)||(console.warn(Gp(e,t)),MO.add(e));}var RO=(r,e,t)=>{let i=e-r;return ((t-r)%i+i)%i+r};var BO=(r,e,t)=>(((1-3*t+3*e)*r+(3*t-6*e))*r+3*e)*r,TN=1e-7,SN=12;function EN(r,e,t,i,s){let n,o,a=0;do o=e+(t-e)/2,n=BO(o,i,s)-r,n>0?t=o:e=o;while(Math.abs(n)>TN&&++a<SN);return o}function _o(r,e,t,i){if(r===e&&t===i)return zr;let s=n=>EN(n,0,1,r,t);return n=>n===0||n===1?n:BO(s(n),e,i)}var X0=r=>e=>e<=.5?r(2*e)/2:(2-r(2*(1-e)))/2;var Y0=r=>e=>1-r(1-e);var j0=_o(.33,1.53,.69,.99),yh=Y0(j0),Hp=X0(yh);var zp=r=>(r*=2)<1?.5*yh(r):.5*(2-Math.pow(2,-10*(r-1)));var Wp=r=>1-Math.sin(Math.acos(r)),uP=Y0(Wp),Xp=X0(Wp);var lP=_o(.42,0,1,1),cP=_o(0,0,.58,1),Yp=_o(.42,0,.58,1);var jp=r=>Array.isArray(r)&&typeof r[0]!="number";function $p(r,e){return jp(r)?r[RO(0,r.length,e)]:r}var qp=r=>Array.isArray(r)&&typeof r[0]=="number";var IO={linear:zr,easeIn:lP,easeInOut:Yp,easeOut:cP,circIn:Wp,circInOut:Xp,circOut:uP,backIn:yh,backInOut:Hp,backOut:j0,anticipate:zp},AN=r=>typeof r=="string",$0=r=>{if(qp(r)){Ht(r.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");let[e,t,i,s]=r;return _o(e,t,i,s)}else if(AN(r))return Ht(IO[r]!==void 0,`Invalid easing type '${r}'`,"invalid-easing-type"),IO[r];return r};var Kp=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function DO(r,e){let t=new Set,i=new Set,s=false,n=false,o=new WeakSet,a={delta:0,timestamp:0,isProcessing:false};function l(h){o.has(h)&&(c.schedule(h),r()),h(a);}let c={schedule:(h,d=false,f=false)=>{let _=f&&s?t:i;return d&&o.add(h),_.has(h)||_.add(h),h},cancel:h=>{i.delete(h),o.delete(h);},process:h=>{if(a=h,s){n=true;return}s=true,[t,i]=[i,t],t.forEach(l),t.clear(),s=false,n&&(n=false,c.process(h));}};return c}var CN=40;function q0(r,e){let t=false,i=true,s={delta:0,timestamp:0,isProcessing:false},n=()=>t=true,o=Kp.reduce((v,S)=>(v[S]=DO(n),v),{}),{setup:a,read:u,resolveKeyframes:l,preUpdate:c,update:h,preRender:d,render:f,postRender:m}=o,_=()=>{let v=lr.useManualTiming?s.timestamp:performance.now();t=false,lr.useManualTiming||(s.delta=i?1e3/60:Math.max(Math.min(v-s.timestamp,CN),1)),s.timestamp=v,s.isProcessing=true,a.process(s),u.process(s),l.process(s),c.process(s),h.process(s),d.process(s),f.process(s),m.process(s),s.isProcessing=false,t&&e&&(i=false,r(_));},x=()=>{t=true,i=true,s.isProcessing||r(_);};return {schedule:Kp.reduce((v,S)=>{let C=o[S];return v[S]=(A,M=false,D=false)=>(t||x(),C.schedule(A,M,D)),v},{}),cancel:v=>{for(let S=0;S<Kp.length;S++)o[Kp[S]].cancel(v);},state:s,steps:o}}var{schedule:cr,cancel:Th,state:Uu}=q0(typeof requestAnimationFrame<"u"?requestAnimationFrame:zr,true);var K0;function PN(){K0=void 0;}var zt={now:()=>(K0===void 0&&zt.set(Uu.isProcessing||lr.useManualTiming?Uu.timestamp:performance.now()),K0),set:r=>{K0=r,queueMicrotask(PN);}};var kO=r=>e=>typeof e=="string"&&e.startsWith(r),Zp=kO("--"),MN=kO("var(--"),Lu=r=>MN(r)?RN.test(r.split("/*")[0].trim()):false,RN=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;var xs={test:r=>typeof r=="number",parse:parseFloat,transform:r=>r},Xs={...xs,transform:r=>Mr(0,1,r)},Qp={...xs,default:1};var bo=r=>Math.round(r*1e5)/1e5;var Eh=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function OO(r){return r==null}var FO=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;var Ah=(r,e)=>t=>!!(typeof t=="string"&&FO.test(t)&&t.startsWith(r)||e&&!OO(t)&&Object.prototype.hasOwnProperty.call(t,e)),Z0=(r,e,t)=>i=>{if(typeof i!="string")return i;let[s,n,o,a]=i.match(Eh);return {[r]:parseFloat(s),[e]:parseFloat(n),[t]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}};var BN=r=>Mr(0,255,r),hP={...xs,transform:r=>Math.round(BN(r))},_s={test:Ah("rgb","red"),parse:Z0("red","green","blue"),transform:({red:r,green:e,blue:t,alpha:i=1})=>"rgba("+hP.transform(r)+", "+hP.transform(e)+", "+hP.transform(t)+", "+bo(Xs.transform(i))+")"};function IN(r){let e="",t="",i="",s="";return r.length>5?(e=r.substring(1,3),t=r.substring(3,5),i=r.substring(5,7),s=r.substring(7,9)):(e=r.substring(1,2),t=r.substring(2,3),i=r.substring(3,4),s=r.substring(4,5),e+=e,t+=t,i+=i,s+=s),{red:parseInt(e,16),green:parseInt(t,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}}var Jp={test:Ah("#"),parse:IN,transform:_s.transform};var em=r=>({test:e=>typeof e=="string"&&e.endsWith(r)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${r}`}),Gi=em("deg"),Ys=em("%"),ie=em("px"),dP=em("vh"),fP=em("vw"),Q0={...Ys,parse:r=>Ys.parse(r)/100,transform:r=>Ys.transform(r*100)};var yo={test:Ah("hsl","hue"),parse:Z0("hue","saturation","lightness"),transform:({hue:r,saturation:e,lightness:t,alpha:i=1})=>"hsla("+Math.round(r)+", "+Ys.transform(bo(e))+", "+Ys.transform(bo(t))+", "+bo(Xs.transform(i))+")"};var lt={test:r=>_s.test(r)||Jp.test(r)||yo.test(r),parse:r=>_s.test(r)?_s.parse(r):yo.test(r)?yo.parse(r):Jp.parse(r),transform:r=>typeof r=="string"?r:r.hasOwnProperty("red")?_s.transform(r):yo.transform(r),getAnimatableNone:r=>{let e=lt.parse(r);return e.alpha=0,lt.transform(e)}};var GO=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function DN(r){return isNaN(r)&&typeof r=="string"&&(r.match(Eh)?.length||0)+(r.match(GO)?.length||0)>0}var LO="number",NO="color",kN="var",ON="var(",UO="${}",FN=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function vo(r){let e=r.toString(),t=[],i={color:[],number:[],var:[]},s=[],n=0,a=e.replace(FN,u=>(lt.test(u)?(i.color.push(n),s.push(NO),t.push(lt.parse(u))):u.startsWith(ON)?(i.var.push(n),s.push(kN),t.push(u)):(i.number.push(n),s.push(LO),t.push(parseFloat(u))),++n,UO)).split(UO);return {values:t,split:a,indexes:i,types:s}}function VO(r){return vo(r).values}function HO(r){let{split:e,types:t}=vo(r),i=e.length;return s=>{let n="";for(let o=0;o<i;o++)if(n+=e[o],s[o]!==void 0){let a=t[o];a===LO?n+=bo(s[o]):a===NO?n+=lt.transform(s[o]):n+=s[o];}return n}}var GN=r=>typeof r=="number"?0:lt.test(r)?lt.getAnimatableNone(r):r;function UN(r){let e=VO(r);return HO(r)(e.map(GN))}var Wr={test:DN,parse:VO,createTransformer:HO,getAnimatableNone:UN};function pP(r,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?r+(e-r)*6*t:t<1/2?e:t<2/3?r+(e-r)*(2/3-t)*6:r}function zO({hue:r,saturation:e,lightness:t,alpha:i}){r/=360,e/=100,t/=100;let s=0,n=0,o=0;if(!e)s=n=o=t;else {let a=t<.5?t*(1+e):t+e-t*e,u=2*t-a;s=pP(u,a,r+1/3),n=pP(u,a,r),o=pP(u,a,r-1/3);}return {red:Math.round(s*255),green:Math.round(n*255),blue:Math.round(o*255),alpha:i}}function Ch(r,e){return t=>t>0?e:r}var Ui=(r,e,t)=>r+(e-r)*t;var mP=(r,e,t)=>{let i=r*r,s=t*(e*e-i)+i;return s<0?0:Math.sqrt(s)},LN=[Jp,_s,yo],NN=r=>LN.find(e=>e.test(r));function WO(r){let e=NN(r);if(gs(!!e,`'${r}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!e)return false;let t=e.parse(r);return e===yo&&(t=zO(t)),t}var gP=(r,e)=>{let t=WO(r),i=WO(e);if(!t||!i)return Ch(r,e);let s={...t};return n=>(s.red=mP(t.red,i.red,n),s.green=mP(t.green,i.green,n),s.blue=mP(t.blue,i.blue,n),s.alpha=Ui(t.alpha,i.alpha,n),_s.transform(s))};var J0=new Set(["none","hidden"]);function XO(r,e){return J0.has(r)?t=>t<=0?r:e:t=>t>=1?e:r}function VN(r,e){return t=>Ui(r,e,t)}function ev(r){return typeof r=="number"?VN:typeof r=="string"?Lu(r)?Ch:lt.test(r)?gP:WN:Array.isArray(r)?YO:typeof r=="object"?lt.test(r)?gP:HN:Ch}function YO(r,e){let t=[...r],i=t.length,s=r.map((n,o)=>ev(n)(n,e[o]));return n=>{for(let o=0;o<i;o++)t[o]=s[o](n);return t}}function HN(r,e){let t={...r,...e},i={};for(let s in t)r[s]!==void 0&&e[s]!==void 0&&(i[s]=ev(r[s])(r[s],e[s]));return s=>{for(let n in i)t[n]=i[n](s);return t}}function zN(r,e){let t=[],i={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){let n=e.types[s],o=r.indexes[n][i[n]],a=r.values[o]??0;t[s]=a,i[n]++;}return t}var WN=(r,e)=>{let t=Wr.createTransformer(e),i=vo(r),s=vo(e);return i.indexes.var.length===s.indexes.var.length&&i.indexes.color.length===s.indexes.color.length&&i.indexes.number.length>=s.indexes.number.length?J0.has(r)&&!s.values.length||J0.has(e)&&!i.values.length?XO(r,e):Ou(YO(zN(i,s),s.values),t):(gs(true,`Complex values '${r}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),Ch(r,e))};function tv(r,e,t){return typeof r=="number"&&typeof e=="number"&&typeof t=="number"?Ui(r,e,t):ev(r)(r,e)}var jO=r=>{let e=({timestamp:t})=>r(t);return {start:(t=true)=>cr.update(e,t),stop:()=>Th(e),now:()=>Uu.isProcessing?Uu.timestamp:zt.now()}};var rv=(r,e,t=10)=>{let i="",s=Math.max(Math.round(e/t),2);for(let n=0;n<s;n++)i+=Math.round(r(n/(s-1))*1e4)/1e4+", ";return `linear(${i.substring(0,i.length-2)})`};function wh(r){let e=0,t=50,i=r.next(e);for(;!i.done&&e<2e4;)e+=t,i=r.next(e);return e>=2e4?1/0:e}function tm(r,e=100,t){let i=t({...r,keyframes:[0,e]}),s=Math.min(wh(i),2e4);return {type:"keyframes",ease:n=>i.next(s*n).value/e,duration:xr(s)}}var XN=5;function iv(r,e,t){let i=Math.max(e-XN,0);return Np(t-r(i),e-i)}var et={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};var _P=.001;function $O({duration:r=et.duration,bounce:e=et.bounce,velocity:t=et.velocity,mass:i=et.mass}){let s,n;gs(r<=Dt(et.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let o=1-e;o=Mr(et.minDamping,et.maxDamping,o),r=Mr(et.minDuration,et.maxDuration,xr(r)),o<1?(s=l=>{let c=l*o,h=c*r,d=c-t,f=sv(l,o),m=Math.exp(-h);return _P-d/f*m},n=l=>{let h=l*o*r,d=h*t+t,f=Math.pow(o,2)*Math.pow(l,2)*r,m=Math.exp(-h),_=sv(Math.pow(l,2),o);return (-s(l)+_P>0?-1:1)*((d-f)*m)/_}):(s=l=>{let c=Math.exp(-l*r),h=(l-t)*r+1;return -_P+c*h},n=l=>{let c=Math.exp(-l*r),h=(t-l)*(r*r);return c*h});let a=5/r,u=jN(s,n,a);if(r=Dt(r),isNaN(u))return {stiffness:et.stiffness,damping:et.damping,duration:r};{let l=Math.pow(u,2)*i;return {stiffness:l,damping:o*2*Math.sqrt(i*l),duration:r}}}var YN=12;function jN(r,e,t){let i=t;for(let s=1;s<YN;s++)i=i-r(i)/e(i);return i}function sv(r,e){return r*Math.sqrt(1-e*e)}var $N=["duration","bounce"],qN=["stiffness","damping","mass"];function qO(r,e){return e.some(t=>r[t]!==void 0)}function KN(r){let e={velocity:et.velocity,stiffness:et.stiffness,damping:et.damping,mass:et.mass,isResolvedFromDuration:false,...r};if(!qO(r,qN)&&qO(r,$N))if(r.visualDuration){let t=r.visualDuration,i=2*Math.PI/(t*1.2),s=i*i,n=2*Mr(.05,1,1-(r.bounce||0))*Math.sqrt(s);e={...e,mass:et.mass,stiffness:s,damping:n};}else {let t=$O(r);e={...e,...t,mass:et.mass},e.isResolvedFromDuration=true;}return e}function js(r=et.visualDuration,e=et.bounce){let t=typeof r!="object"?{visualDuration:r,keyframes:[0,1],bounce:e}:r,{restSpeed:i,restDelta:s}=t,n=t.keyframes[0],o=t.keyframes[t.keyframes.length-1],a={done:false,value:n},{stiffness:u,damping:l,mass:c,duration:h,velocity:d,isResolvedFromDuration:f}=KN({...t,velocity:-xr(t.velocity||0)}),m=d||0,_=l/(2*Math.sqrt(u*c)),x=o-n,g=xr(Math.sqrt(u/c)),y=Math.abs(x)<5;i||(i=y?et.restSpeed.granular:et.restSpeed.default),s||(s=y?et.restDelta.granular:et.restDelta.default);let v;if(_<1){let C=sv(g,_);v=A=>{let M=Math.exp(-_*g*A);return o-M*((m+_*g*x)/C*Math.sin(C*A)+x*Math.cos(C*A))};}else if(_===1)v=C=>o-Math.exp(-g*C)*(x+(m+g*x)*C);else {let C=g*Math.sqrt(_*_-1);v=A=>{let M=Math.exp(-_*g*A),D=Math.min(C*A,300);return o-M*((m+_*g*x)*Math.sinh(D)+C*x*Math.cosh(D))/C};}let S={calculatedDuration:f&&h||null,next:C=>{let A=v(C);if(f)a.done=C>=h;else {let M=C===0?m:0;_<1&&(M=C===0?Dt(m):iv(v,C,A));let D=Math.abs(M)<=i,R=Math.abs(o-A)<=s;a.done=D&&R;}return a.value=a.done?o:A,a},toString:()=>{let C=Math.min(wh(S),2e4),A=rv(M=>S.next(C*M).value,C,30);return C+"ms "+A},toTransition:()=>{}};return S}js.applyToOptions=r=>{let e=tm(r,100,js);return r.ease=e.ease,r.duration=Dt(e.duration),r.type="keyframes",r};function rm({keyframes:r,velocity:e=0,power:t=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:n=500,modifyTarget:o,min:a,max:u,restDelta:l=.5,restSpeed:c}){let h=r[0],d={done:false,value:h},f=D=>a!==void 0&&D<a||u!==void 0&&D>u,m=D=>a===void 0?u:u===void 0||Math.abs(a-D)<Math.abs(u-D)?a:u,_=t*e,x=h+_,g=o===void 0?x:o(x);g!==x&&(_=g-h);let y=D=>-_*Math.exp(-D/i),v=D=>g+y(D),S=D=>{let R=y(D),L=v(D);d.done=Math.abs(R)<=l,d.value=d.done?g:L;},C,A,M=D=>{f(d.value)&&(C=D,A=js({keyframes:[d.value,m(d.value)],velocity:iv(v,D,d.value),damping:s,stiffness:n,restDelta:l,restSpeed:c}));};return M(0),{calculatedDuration:null,next:D=>{let R=false;return !A&&C===void 0&&(R=true,S(D),M(D)),C!==void 0&&D>=C?A.next(D-C):(!R&&S(D),d)}}}function ZN(r,e,t){let i=[],s=t||lr.mix||tv,n=r.length-1;for(let o=0;o<n;o++){let a=s(r[o],r[o+1]);if(e){let u=Array.isArray(e)?e[o]||zr:e;a=Ou(u,a);}i.push(a);}return i}function KO(r,e,{clamp:t=true,ease:i,mixer:s}={}){let n=r.length;if(Ht(n===e.length,"Both input and output ranges must be the same length","range-length"),n===1)return ()=>e[0];if(n===2&&e[0]===e[1])return ()=>e[1];let o=r[0]===r[1];r[0]>r[n-1]&&(r=[...r].reverse(),e=[...e].reverse());let a=ZN(e,i,s),u=a.length,l=c=>{if(o&&c<r[0])return e[0];let h=0;if(u>1)for(;h<r.length-2&&!(c<r[h+1]);h++);let d=Fu(r[h],r[h+1],c);return a[h](d)};return t?c=>l(Mr(r[0],r[n-1],c)):l}function im(r,e){let t=r[r.length-1];for(let i=1;i<=e;i++){let s=Fu(0,e,i);r.push(Ui(t,1,s));}}function sm(r){let e=[0];return im(e,r.length-1),e}function ZO(r,e){return r.map(t=>t*e)}function QN(r,e){return r.map(()=>e||Yp).splice(0,r.length-1)}function To({duration:r=300,keyframes:e,times:t,ease:i="easeInOut"}){let s=jp(i)?i.map($0):$0(i),n={done:false,value:e[0]},o=ZO(t&&t.length===e.length?t:sm(e),r),a=KO(o,e,{ease:Array.isArray(s)?s:QN(e,s)});return {calculatedDuration:r,next:u=>(n.value=a(u),n.done=u>=r,n)}}var JN=r=>r!==null;function Ph(r,{repeat:e,repeatType:t="loop"},i,s=1){let n=r.filter(JN),a=s<0||e&&t!=="loop"&&e%2===1?0:n.length-1;return !a||i===void 0?n[a]:i}var e5={decay:rm,inertia:rm,tween:To,keyframes:To,spring:js};function nv(r){typeof r.type=="string"&&(r.type=e5[r.type]);}var So=class{constructor(){this.updateFinished();}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e;});}notifyFinished(){this.resolve();}then(e,t){return this.finished.then(e,t)}};var t5=r=>r/100,$s=class extends So{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=false,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{let{motionValue:t}=this.options;t&&t.updatedAt!==zt.now()&&this.tick(zt.now()),this.isStopped=true,this.state!=="idle"&&(this.teardown(),this.options.onStop?.());},this.options=e,this.initAnimation(),this.play(),e.autoplay===false&&this.pause();}initAnimation(){let{options:e}=this;nv(e);let{type:t=To,repeat:i=0,repeatDelay:s=0,repeatType:n,velocity:o=0}=e,{keyframes:a}=e,u=t||To;process.env.NODE_ENV!=="production"&&u!==To&&Ht(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`,"spring-two-frames"),u!==To&&typeof a[0]!="number"&&(this.mixKeyframes=Ou(t5,tv(a[0],a[1])),a=[0,100]);let l=u({...e,keyframes:a});n==="mirror"&&(this.mirroredGenerator=u({...e,keyframes:[...a].reverse(),velocity:-o})),l.calculatedDuration===null&&(l.calculatedDuration=wh(l));let{calculatedDuration:c}=l;this.calculatedDuration=c,this.resolvedDuration=c+s,this.totalDuration=this.resolvedDuration*(i+1)-s,this.generator=l;}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=t;}tick(e,t=false){let{generator:i,totalDuration:s,mixKeyframes:n,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:u}=this;if(this.startTime===null)return i.next(0);let{delay:l=0,keyframes:c,repeat:h,repeatType:d,repeatDelay:f,type:m,onUpdate:_,finalKeyframe:x}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-s/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let g=this.currentTime-l*(this.playbackSpeed>=0?1:-1),y=this.playbackSpeed>=0?g<0:g>s;this.currentTime=Math.max(g,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let v=this.currentTime,S=i;if(h){let D=Math.min(this.currentTime,s)/a,R=Math.floor(D),L=D%1;!L&&D>=1&&(L=1),L===1&&R--,R=Math.min(R,h+1),!!(R%2)&&(d==="reverse"?(L=1-L,f&&(L-=f/a)):d==="mirror"&&(S=o)),v=Mr(0,1,L)*a;}let C=y?{done:false,value:c[0]}:S.next(v);n&&(C.value=n(C.value));let{done:A}=C;!y&&u!==null&&(A=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);let M=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&A);return M&&m!==rm&&(C.value=Ph(c,this.options,x,this.speed)),_&&_(C.value),M&&this.finish(),C}then(e,t){return this.finished.then(e,t)}get duration(){return xr(this.calculatedDuration)}get time(){return xr(this.currentTime)}set time(e){e=Dt(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?.start(false);}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(zt.now());let t=this.playbackSpeed!==e;this.playbackSpeed=e,t&&(this.time=xr(this.currentTime));}play(){if(this.isStopped)return;let{driver:e=jO,startTime:t}=this.options;this.driver||(this.driver=e(s=>this.tick(s))),this.options.onPlay?.();let i=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=i):this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime||(this.startTime=t??i),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start();}pause(){this.state="paused",this.updateTime(zt.now()),this.holdTime=this.currentTime;}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null;}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.();}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.();}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null;}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0);}sample(e){return this.startTime=0,this.tick(e,true)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}};function QO(r){for(let e=1;e<r.length;e++)r[e]??(r[e]=r[e-1]);}var Nu=r=>r*180/Math.PI,bP=r=>{let e=Nu(Math.atan2(r[1],r[0]));return yP(e)},r5={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:r=>(Math.abs(r[0])+Math.abs(r[3]))/2,rotate:bP,rotateZ:bP,skewX:r=>Nu(Math.atan(r[1])),skewY:r=>Nu(Math.atan(r[2])),skew:r=>(Math.abs(r[1])+Math.abs(r[2]))/2},yP=r=>(r=r%360,r<0&&(r+=360),r),JO=bP,eF=r=>Math.sqrt(r[0]*r[0]+r[1]*r[1]),tF=r=>Math.sqrt(r[4]*r[4]+r[5]*r[5]),i5={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:eF,scaleY:tF,scale:r=>(eF(r)+tF(r))/2,rotateX:r=>yP(Nu(Math.atan2(r[6],r[5]))),rotateY:r=>yP(Nu(Math.atan2(-r[2],r[0]))),rotateZ:JO,rotate:JO,skewX:r=>Nu(Math.atan(r[4])),skewY:r=>Nu(Math.atan(r[1])),skew:r=>(Math.abs(r[1])+Math.abs(r[4]))/2};function nm(r){return r.includes("scale")?1:0}function om(r,e){if(!r||r==="none")return nm(e);let t=r.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),i,s;if(t)i=i5,s=t;else {let a=r.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=r5,s=a;}if(!s)return nm(e);let n=i[e],o=s[1].split(",").map(s5);return typeof n=="function"?n(o):o[n]}var vP=(r,e)=>{let{transform:t="none"}=getComputedStyle(r);return om(t,e)};function s5(r){return parseFloat(r.trim())}var Li=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Xr=new Set(Li);var TP=r=>r===xs||r===ie,n5=new Set(["x","y","z"]),o5=Li.filter(r=>!n5.has(r));function rF(r){let e=[];return o5.forEach(t=>{let i=r.getValue(t);i!==void 0&&(e.push([t,i.get()]),i.set(t.startsWith("scale")?1:0));}),e}var Eo={width:({x:r},{paddingLeft:e="0",paddingRight:t="0"})=>r.max-r.min-parseFloat(e)-parseFloat(t),height:({y:r},{paddingTop:e="0",paddingBottom:t="0"})=>r.max-r.min-parseFloat(e)-parseFloat(t),top:(r,{top:e})=>parseFloat(e),left:(r,{left:e})=>parseFloat(e),bottom:({y:r},{top:e})=>parseFloat(e)+(r.max-r.min),right:({x:r},{left:e})=>parseFloat(e)+(r.max-r.min),x:(r,{transform:e})=>om(e,"x"),y:(r,{transform:e})=>om(e,"y")};Eo.translateX=Eo.x;Eo.translateY=Eo.y;var Vu=new Set,SP=false,EP=false,AP=false;function iF(){if(EP){let r=Array.from(Vu).filter(i=>i.needsMeasurement),e=new Set(r.map(i=>i.element)),t=new Map;e.forEach(i=>{let s=rF(i);s.length&&(t.set(i,s),i.render());}),r.forEach(i=>i.measureInitialState()),e.forEach(i=>{i.render();let s=t.get(i);s&&s.forEach(([n,o])=>{i.getValue(n)?.set(o);});}),r.forEach(i=>i.measureEndState()),r.forEach(i=>{i.suspendedScrollY!==void 0&&window.scrollTo(0,i.suspendedScrollY);});}EP=false,SP=false,Vu.forEach(r=>r.complete(AP)),Vu.clear();}function sF(){Vu.forEach(r=>{r.readKeyframes(),r.needsMeasurement&&(EP=true);});}function CP(){AP=true,sF(),iF(),AP=false;}var qs=class{constructor(e,t,i,s,n,o=false){this.state="pending",this.isAsync=false,this.needsMeasurement=false,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=i,this.motionValue=s,this.element=n,this.isAsync=o;}scheduleResolve(){this.state="scheduled",this.isAsync?(Vu.add(this),SP||(SP=true,cr.read(sF),cr.resolveKeyframes(iF))):(this.readKeyframes(),this.complete());}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:i,motionValue:s}=this;if(e[0]===null){let n=s?.get(),o=e[e.length-1];if(n!==void 0)e[0]=n;else if(i&&t){let a=i.readValue(t,o);a!=null&&(e[0]=a);}e[0]===void 0&&(e[0]=o),s&&n===void 0&&s.set(e[0]);}QO(e);}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=false){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Vu.delete(this);}cancel(){this.state==="scheduled"&&(Vu.delete(this),this.state="pending");}resume(){this.state==="pending"&&this.scheduleResolve();}};var nF=r=>r.startsWith("--");function oF(r,e,t){nF(e)?r.style.setProperty(e,t):r.style[e]=t;}var aF=ku(()=>window.ScrollTimeline!==void 0);var uF={};function lF(r,e){let t=ku(r);return ()=>uF[e]??t()}var ov=lF(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"});}catch{return false}return true},"linearEasing");var Hu=([r,e,t,i])=>`cubic-bezier(${r}, ${e}, ${t}, ${i})`;var wP={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Hu([0,.65,.55,1]),circOut:Hu([.55,0,1,.45]),backIn:Hu([.31,.01,.66,-0.59]),backOut:Hu([.33,1.53,.69,.99])};function PP(r,e){if(r)return typeof r=="function"?ov()?rv(r,e):"ease-out":qp(r)?Hu(r):Array.isArray(r)?r.map(t=>PP(t,e)||wP.easeOut):wP[r]}function cF(r,e,t,{delay:i=0,duration:s=300,repeat:n=0,repeatType:o="loop",ease:a="easeOut",times:u}={},l=void 0){let c={[e]:t};u&&(c.offset=u);let h=PP(a,s);Array.isArray(h)&&(c.easing=h);let d={delay:i,duration:s,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:n+1,direction:o==="reverse"?"alternate":"normal"};l&&(d.pseudoElement=l);let f=r.animate(c,d);return f}function zu(r){return typeof r=="function"&&"applyToOptions"in r}function hF({type:r,...e}){return zu(r)&&ov()?r.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}var av=class extends So{constructor(e){if(super(),this.finishedTime=null,this.isStopped=false,!e)return;let{element:t,name:i,keyframes:s,pseudoElement:n,allowFlatten:o=false,finalKeyframe:a,onComplete:u}=e;this.isPseudoElement=!!n,this.allowFlatten=o,this.options=e,Ht(typeof e.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");let l=hF(e);this.animation=cF(t,i,s,l,n),l.autoplay===false&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!n){let c=Ph(s,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(c):oF(t,i,c),this.animation.cancel();}u?.(),this.notifyFinished();};}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished());}pause(){this.animation.pause();}complete(){this.animation.finish?.();}cancel(){try{this.animation.cancel();}catch{}}stop(){if(this.isStopped)return;this.isStopped=true;let{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel());}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.();}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return xr(Number(e))}get time(){return xr(Number(this.animation.currentTime)||0)}set time(e){this.finishedTime=null,this.animation.currentTime=Dt(e);}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e;}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(e){this.animation.startTime=e;}attachTimeline({timeline:e,observe:t}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&aF()?(this.animation.timeline=e,zr):t(this)}};var dF={anticipate:zp,backInOut:Hp,circInOut:Xp};function a5(r){return r in dF}function fF(r){typeof r.ease=="string"&&a5(r.ease)&&(r.ease=dF[r.ease]);}var pF=10,uv=class extends av{constructor(e){fF(e),nv(e),super(e),e.startTime&&(this.startTime=e.startTime),this.options=e;}updateMotionValue(e){let{motionValue:t,onUpdate:i,onComplete:s,element:n,...o}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let a=new $s({...o,autoplay:false}),u=Dt(this.finishedTime??this.time);t.setWithVelocity(a.sample(u-pF).value,a.sample(u).value,pF),a.stop();}};var MP=(r,e)=>e==="zIndex"?false:!!(typeof r=="number"||Array.isArray(r)||typeof r=="string"&&(Wr.test(r)||r==="0")&&!r.startsWith("url("));function u5(r){let e=r[0];if(r.length===1)return true;for(let t=0;t<r.length;t++)if(r[t]!==e)return true}function mF(r,e,t,i){let s=r[0];if(s===null)return false;if(e==="display"||e==="visibility")return true;let n=r[r.length-1],o=MP(s,e),a=MP(n,e);return gs(o===a,`You are trying to animate ${e} from "${s}" to "${n}". "${o?n:s}" is not an animatable value.`,"value-not-animatable"),!o||!a?false:u5(r)||(t==="spring"||zu(t))&&i}function Mh(r){r.duration=0,r.type;}var l5=new Set(["opacity","clipPath","filter","transform"]),c5=ku(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function gF(r){let{motionValue:e,name:t,repeatDelay:i,repeatType:s,damping:n,type:o}=r;if(!(e?.owner?.current instanceof HTMLElement))return false;let{onUpdate:u,transformTemplate:l}=e.owner.getProps();return c5()&&t&&l5.has(t)&&(t!=="transform"||!l)&&!u&&!i&&s!=="mirror"&&n!==0&&o!=="inertia"}var h5=40,am=class extends So{constructor({autoplay:e=true,delay:t=0,type:i="keyframes",repeat:s=0,repeatDelay:n=0,repeatType:o="loop",keyframes:a,name:u,motionValue:l,element:c,...h}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel();},this.createdAt=zt.now();let d={autoplay:e,delay:t,type:i,repeat:s,repeatDelay:n,repeatType:o,name:u,motionValue:l,element:c,...h},f=c?.KeyframeResolver||qs;this.keyframeResolver=new f(a,(m,_,x)=>this.onKeyframesResolved(m,_,d,!x),u,l,c),this.keyframeResolver?.scheduleResolve();}onKeyframesResolved(e,t,i,s){this.keyframeResolver=void 0;let{name:n,type:o,velocity:a,delay:u,isHandoff:l,onUpdate:c}=i;this.resolvedAt=zt.now(),mF(e,n,o,a)||((lr.instantAnimations||!u)&&c?.(Ph(e,i,t)),e[0]=e[e.length-1],Mh(i),i.repeat=0);let d={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>h5?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:t,...i,keyframes:e},f=!l&&gF(d)?new uv({...d,element:d.motionValue.owner.current}):new $s(d);f.finished.then(()=>this.notifyFinished()).catch(zr),this.pendingTimeline&&(this.stopTimeline=f.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=f;}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),CP()),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(e){this.animation.time=e;}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e;}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play();}pause(){this.animation.pause();}complete(){this.animation.complete();}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel();}};var lv=class{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean);}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let i=0;i<this.animations.length;i++)this.animations[i][e]=t;}attachTimeline(e){let t=this.animations.map(i=>i.attachTimeline(e));return ()=>{t.forEach((i,s)=>{i&&i(),this.animations[s].stop();});}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e);}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e);}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){let e=0;for(let t=0;t<this.animations.length;t++)e=Math.max(e,this.animations[t].duration);return e}runAll(e){this.animations.forEach(t=>t[e]());}play(){this.runAll("play");}pause(){this.runAll("pause");}cancel(){this.runAll("cancel");}complete(){this.runAll("complete");}};var um=class extends lv{then(e,t){return this.finished.finally(e).then(()=>{})}};var d5=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function f5(r){let e=d5.exec(r);if(!e)return [,];let[,t,i,s]=e;return [`--${t??i}`,s]}var p5=4;function RP(r,e,t=1){Ht(t<=p5,`Max CSS variable fallback depth detected in property "${r}". This may indicate a circular fallback dependency.`,"max-css-var-depth");let[i,s]=f5(r);if(!i)return;let n=window.getComputedStyle(e).getPropertyValue(i);if(n){let o=n.trim();return Up(o)?parseFloat(o):o}return Lu(s)?RP(s,e,t+1):s}function lm(r,e){return r?.[e]??r?.default??r}var cm=new Set(["width","height","top","left","right","bottom",...Li]);var xF={test:r=>r==="auto",parse:r=>r};var cv=r=>e=>e.test(r);var BP=[xs,ie,Ys,Gi,fP,dP,xF],IP=r=>BP.find(cv(r));function _F(r){return typeof r=="number"?r===0:r!==null?r==="none"||r==="0"||Lp(r):true}var m5=new Set(["brightness","contrast","saturate","opacity"]);function g5(r){let[e,t]=r.slice(0,-1).split("(");if(e==="drop-shadow")return r;let[i]=t.match(Eh)||[];if(!i)return r;let s=t.replace(i,""),n=m5.has(e)?1:0;return i!==t&&(n*=100),e+"("+n+s+")"}var x5=/\b([a-z-]*)\(.*?\)/gu,hm={...Wr,getAnimatableNone:r=>{let e=r.match(x5);return e?e.map(g5).join(" "):r}};var DP={...xs,transform:Math.round};var bF={rotate:Gi,rotateX:Gi,rotateY:Gi,rotateZ:Gi,scale:Qp,scaleX:Qp,scaleY:Qp,scaleZ:Qp,skew:Gi,skewX:Gi,skewY:Gi,distance:ie,translateX:ie,translateY:ie,translateZ:ie,x:ie,y:ie,z:ie,perspective:ie,transformPerspective:ie,opacity:Xs,originX:Q0,originY:Q0,originZ:ie};var Wu={borderWidth:ie,borderTopWidth:ie,borderRightWidth:ie,borderBottomWidth:ie,borderLeftWidth:ie,borderRadius:ie,radius:ie,borderTopLeftRadius:ie,borderTopRightRadius:ie,borderBottomRightRadius:ie,borderBottomLeftRadius:ie,width:ie,maxWidth:ie,height:ie,maxHeight:ie,top:ie,right:ie,bottom:ie,left:ie,padding:ie,paddingTop:ie,paddingRight:ie,paddingBottom:ie,paddingLeft:ie,margin:ie,marginTop:ie,marginRight:ie,marginBottom:ie,marginLeft:ie,backgroundPositionX:ie,backgroundPositionY:ie,...bF,zIndex:DP,fillOpacity:Xs,strokeOpacity:Xs,numOctaves:DP};var yF={...Wu,color:lt,backgroundColor:lt,outlineColor:lt,fill:lt,stroke:lt,borderColor:lt,borderTopColor:lt,borderRightColor:lt,borderBottomColor:lt,borderLeftColor:lt,filter:hm,WebkitFilter:hm},dm=r=>yF[r];function fm(r,e){let t=dm(r);return t!==hm&&(t=Wr),t.getAnimatableNone?t.getAnimatableNone(e):void 0}var _5=new Set(["auto","none","0"]);function vF(r,e,t){let i=0,s;for(;i<r.length&&!s;){let n=r[i];typeof n=="string"&&!_5.has(n)&&vo(n).values.length&&(s=r[i]),i++;}if(s&&t)for(let n of e)r[n]=fm(t,s);}var pm=class extends qs{constructor(e,t,i,s,n){super(e,t,i,s,n,true);}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:i}=this;if(!t||!t.current)return;super.readKeyframes();for(let u=0;u<e.length;u++){let l=e[u];if(typeof l=="string"&&(l=l.trim(),Lu(l))){let c=RP(l,t.current);c!==void 0&&(e[u]=c),u===e.length-1&&(this.finalKeyframe=l);}}if(this.resolveNoneKeyframes(),!cm.has(i)||e.length!==2)return;let[s,n]=e,o=IP(s),a=IP(n);if(o!==a)if(TP(o)&&TP(a))for(let u=0;u<e.length;u++){let l=e[u];typeof l=="string"&&(e[u]=parseFloat(l));}else Eo[i]&&(this.needsMeasurement=true);}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,i=[];for(let s=0;s<e.length;s++)(e[s]===null||_F(e[s]))&&i.push(s);i.length&&vF(e,i,t);}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:i}=this;if(!e||!e.current)return;i==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Eo[i](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let s=t[t.length-1];s!==void 0&&e.getValue(i,s).jump(s,false);}measureEndState(){let{element:e,name:t,unresolvedKeyframes:i}=this;if(!e||!e.current)return;let s=e.getValue(t);s&&s.jump(this.measuredOrigin,false);let n=i.length-1,o=i[n];i[n]=Eo[t](e.measureViewportBox(),window.getComputedStyle(e.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),this.removedTransforms?.length&&this.removedTransforms.forEach(([a,u])=>{e.getValue(a).set(u);}),this.resolveNoneKeyframes();}};function kP(r,e,t){if(r instanceof EventTarget)return [r];if(typeof r=="string"){let i=document;let s=t?.[r]??i.querySelectorAll(r);return s?Array.from(s):[]}return Array.from(r)}var mm=(r,e)=>e&&typeof r=="number"?e.transform(r):r;var TF=30,b5=r=>!isNaN(parseFloat(r)),hv=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=i=>{let s=zt.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(i),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let n of this.dependents)n.dirty();},this.hasAnimated=false,this.setCurrent(e),this.owner=t.owner;}setCurrent(e){this.current=e,this.updatedAt=zt.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=b5(this.current));}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt;}onChange(e){return process.env.NODE_ENV!=="production"&&Vp(false,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new Gu);let i=this.events[e].add(t);return e==="change"?()=>{i(),cr.read(()=>{this.events.change.getSize()||this.stop();});}:i}clearListeners(){for(let e in this.events)this.events[e].clear();}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t;}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e);}setWithVelocity(e,t,i){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-i;}jump(e,t=true){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect();}dirty(){this.events.change?.notify(this.current);}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e);}removeDependent(e){this.dependents&&this.dependents.delete(e);}get(){return this.current}getPrevious(){return this.prev}getVelocity(){let e=zt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>TF)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,TF);return Np(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=true,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify();}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation();})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation();}isAnimating(){return !!this.animation}clearAnimation(){delete this.animation;}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect();}};function bs(r,e){return new hv(r,e)}var{schedule:FP}=q0(queueMicrotask,false);function gm(r){return aP(r)&&"ownerSVGElement"in r}function GP(r){return gm(r)&&r.tagName==="svg"}var tt=r=>!!(r&&r.getVelocity);var v5=[...BP,lt,Wr],UP=r=>v5.find(cv(r));function xm(r){return typeof r=="object"&&!Array.isArray(r)}function dv(r,e,t,i){return typeof r=="string"&&xm(e)?kP(r,t,i):r instanceof NodeList?Array.from(r):Array.isArray(r)?r:[r]}function SF(r,e,t){return r*(e+1)}function LP(r,e,t,i){return typeof e=="number"?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,r+parseFloat(e)):e==="<"?t:e.startsWith("<")?Math.max(0,t+parseFloat(e.slice(1))):i.get(e)??r}function T5(r,e,t){for(let i=0;i<r.length;i++){let s=r[i];s.at>e&&s.at<t&&(Du(r,s),i--);}}function EF(r,e,t,i,s,n){T5(r,s,n);for(let o=0;o<e.length;o++)r.push({value:e[o],at:Ui(s,n,i[o]),easing:$p(t,o)});}function AF(r,e){for(let t=0;t<r.length;t++)r[t]=r[t]/(e+1);}function CF(r,e){return r.at===e.at?r.value===null?1:e.value===null?-1:0:r.at-e.at}var S5="easeInOut",E5=20;function MF(r,{defaultTransition:e={},...t}={},i,s){let n=e.duration||.3,o=new Map,a=new Map,u={},l=new Map,c=0,h=0,d=0;for(let f=0;f<r.length;f++){let m=r[f];if(typeof m=="string"){l.set(m,h);continue}else if(!Array.isArray(m)){l.set(m.name,LP(h,m.at,c,l));continue}let[_,x,g={}]=m;g.at!==void 0&&(h=LP(h,g.at,c,l));let y=0,v=(S,C,A,M=0,D=0)=>{let R=A5(S),{delay:L=0,times:F=sm(R),type:se="keyframes",repeat:ye,repeatType:ft,repeatDelay:ys=0,...X}=C,{ease:q=e.ease||"easeOut",duration:Rr}=C,Le=typeof L=="function"?L(M,D):L,di=R.length,Zs=zu(se)?se:s?.[se||"keyframes"];if(di<=2&&Zs){let Vi=100;if(di===2&&P5(R)){let en=R[1]-R[0];Vi=Math.abs(en);}let Hi={...X};Rr!==void 0&&(Hi.duration=Dt(Rr));let Mo=tm(Hi,Vi,Zs);q=Mo.ease,Rr=Mo.duration;}Rr??(Rr=n);let Qs=h+Le;F.length===1&&F[0]===0&&(F[1]=1);let Js=F.length-R.length;if(Js>0&&im(F,Js),R.length===1&&R.unshift(null),ye){Ht(ye<E5,"Repeat count too high, must be less than 20","repeat-count-high"),Rr=SF(Rr,ye);let Vi=[...R],Hi=[...F];q=Array.isArray(q)?[...q]:[q];let Mo=[...q];for(let en=0;en<ye;en++){R.push(...Vi);for(let zi=0;zi<Vi.length;zi++)F.push(Hi[zi]+(en+1)),q.push(zi===0?"linear":$p(Mo,zi-1));}AF(F,ye);}let Oh=Qs+Rr;EF(A,R,q,F,Qs,Oh),y=Math.max(Le+Rr,y),d=Math.max(Oh,d);};if(tt(_)){let S=wF(_,a);v(x,g,PF("default",S));}else {let S=dv(_,x,i,u),C=S.length;for(let A=0;A<C;A++){x=x,g=g;let M=S[A],D=wF(M,a);for(let R in x)v(x[R],C5(g,R),PF(R,D),A,C);}}c=h,h+=y;}return a.forEach((f,m)=>{for(let _ in f){let x=f[_];x.sort(CF);let g=[],y=[],v=[];for(let C=0;C<x.length;C++){let{at:A,value:M,easing:D}=x[C];g.push(M),y.push(Fu(0,d,A)),v.push(D||"easeOut");}y[0]!==0&&(y.unshift(0),g.unshift(g[0]),v.unshift(S5)),y[y.length-1]!==1&&(y.push(1),g.push(null)),o.has(m)||o.set(m,{keyframes:{},transition:{}});let S=o.get(m);S.keyframes[_]=g,S.transition[_]={...e,duration:d,ease:v,times:y,...t};}}),o}function wF(r,e){return !e.has(r)&&e.set(r,{}),e.get(r)}function PF(r,e){return e[r]||(e[r]=[]),e[r]}function A5(r){return Array.isArray(r)?r:[r]}function C5(r,e){return r&&r[e]?{...r,...r[e]}:{...r}}var w5=r=>typeof r=="number",P5=r=>r.every(w5);var Ao=new WeakMap;var RF=r=>Array.isArray(r);function BF(r){let e=[{},{}];return r?.values.forEach((t,i)=>{e[0][i]=t.get(),e[1][i]=t.getVelocity();}),e}function fv(r,e,t,i){if(typeof e=="function"){let[s,n]=BF(i);e=e(t!==void 0?t:r.custom,s,n);}if(typeof e=="string"&&(e=r.variants&&r.variants[e]),typeof e=="function"){let[s,n]=BF(i);e=e(t!==void 0?t:r.custom,s,n);}return e}function IF(r,e,t){let i=r.getProps();return fv(i,e,i.custom,r)}function M5(r,e,t){r.hasValue(e)?r.getValue(e).set(t):r.addValue(e,bs(t));}function R5(r){return RF(r)?r[r.length-1]||0:r}function DF(r,e){let t=IF(r,e),{transitionEnd:i={},transition:s={},...n}=t||{};n={...n,...i};for(let o in n){let a=R5(n[o]);M5(r,o,a);}}function kF(r){return !!(tt(r)&&r.add)}function OF(r,e){let t=r.getValue("willChange");if(kF(t))return t.add(e);if(!t&&lr.WillChange){let i=new lr.WillChange("auto");r.addValue("willChange",i),i.add(e);}}var Rh=r=>r.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase();var B5="framerAppearId",FF="data-"+Rh(B5);function GF(r){return r.props[FF]}var I5=r=>r!==null;function UF(r,{repeat:e,repeatType:t="loop"},i){let s=r.filter(I5),n=e&&t!=="loop"&&e%2===1?0:s.length-1;return !n||i===void 0?s[n]:i}var D5={type:"spring",stiffness:500,damping:25,restSpeed:10},k5=r=>({type:"spring",stiffness:550,damping:r===0?2*Math.sqrt(550):30,restSpeed:10}),O5={type:"keyframes",duration:.8},F5={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},LF=(r,{keyframes:e})=>e.length>2?O5:Xr.has(r)?r.startsWith("scale")?k5(e[1]):D5:F5;function NF({when:r,delay:e,delayChildren:t,staggerChildren:i,staggerDirection:s,repeat:n,repeatType:o,repeatDelay:a,from:u,elapsed:l,...c}){return !!Object.keys(c).length}var pv=(r,e,t,i={},s,n)=>o=>{let a=lm(i,r)||{},u=a.delay||i.delay||0,{elapsed:l=0}=i;l=l-Dt(u);let c={keyframes:Array.isArray(t)?t:[null,t],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-l,onUpdate:d=>{e.set(d),a.onUpdate&&a.onUpdate(d);},onComplete:()=>{o(),a.onComplete&&a.onComplete();},name:r,motionValue:e,element:n?void 0:s};NF(a)||Object.assign(c,LF(r,c)),c.duration&&(c.duration=Dt(c.duration)),c.repeatDelay&&(c.repeatDelay=Dt(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let h=false;if((c.type===false||c.duration===0&&!c.repeatDelay)&&(Mh(c),c.delay===0&&(h=true)),(lr.instantAnimations||lr.skipAnimations)&&(h=true,Mh(c),c.delay=0),c.allowFlatten=!a.type&&!a.ease,h&&!n&&e.get()!==void 0){let d=UF(c.keyframes,a);if(d!==void 0){cr.update(()=>{c.onUpdate(d),c.onComplete();});return}}return a.isSync?new $s(c):new am(c)};function G5({protectedKeys:r,needsAnimating:e},t){let i=r.hasOwnProperty(t)&&e[t]!==true;return e[t]=false,i}function VF(r,e,{delay:t=0,transitionOverride:i,type:s}={}){let{transition:n=r.getDefaultTransition(),transitionEnd:o,...a}=e;i&&(n=i);let u=[],l=s&&r.animationState&&r.animationState.getState()[s];for(let c in a){let h=r.getValue(c,r.latestValues[c]??null),d=a[c];if(d===void 0||l&&G5(l,c))continue;let f={delay:t,...lm(n||{},c)},m=h.get();if(m!==void 0&&!h.isAnimating&&!Array.isArray(d)&&d===m&&!f.velocity)continue;let _=false;if(window.MotionHandoffAnimation){let g=GF(r);if(g){let y=window.MotionHandoffAnimation(g,c,cr);y!==null&&(f.startTime=y,_=true);}}OF(r,c),h.start(pv(c,h,d,r.shouldReduceMotion&&cm.has(c)?{type:false}:f,r,_));let x=h.animation;x&&u.push(x);}return o&&Promise.all(u).then(()=>{cr.update(()=>{o&&DF(r,o);});}),u}function HF({top:r,left:e,right:t,bottom:i}){return {x:{min:e,max:t},y:{min:r,max:i}}}function zF(r,e){if(!e)return r;let t=e({x:r.left,y:r.top}),i=e({x:r.right,y:r.bottom});return {top:t.y,left:t.x,bottom:i.y,right:i.x}}function WF(r,e){return HF(zF(r.getBoundingClientRect(),e))}var XF={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},mv={};for(let r in XF)mv[r]={isEnabled:e=>XF[r].some(t=>!!e[t])};var YF=()=>({min:0,max:0}),Bh=()=>({x:YF(),y:YF()});var jF=typeof window<"u";var _m={current:null},gv={current:false};function $F(){if(gv.current=true,!!jF)if(window.matchMedia){let r=window.matchMedia("(prefers-reduced-motion)"),e=()=>_m.current=r.matches;r.addEventListener("change",e),e();}else _m.current=false;}function qF(r){return r!==null&&typeof r=="object"&&typeof r.start=="function"}function KF(r){return typeof r=="string"||Array.isArray(r)}var U5=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ZF=["initial",...U5];function NP(r){return qF(r.animate)||ZF.some(e=>KF(r[e]))}function QF(r){return !!(NP(r)||r.variants)}function JF(r,e,t){for(let i in e){let s=e[i],n=t[i];if(tt(s))r.addValue(i,s);else if(tt(n))r.addValue(i,bs(s,{owner:r}));else if(n!==s)if(r.hasValue(i)){let o=r.getValue(i);o.liveStyle===true?o.jump(s):o.hasAnimated||o.set(s);}else {let o=r.getStaticValue(i);r.addValue(i,bs(o!==void 0?o:s,{owner:r}));}}for(let i in t)e[i]===void 0&&r.removeValue(i);return e}var eG=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],Ih=class{scrapeMotionValuesFromProps(e,t,i){return {}}constructor({parent:e,props:t,presenceContext:i,reducedMotionConfig:s,blockInitialAnimation:n,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=false,this.isControllingVariants=false,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=qs,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection));},this.renderScheduledAt=0,this.scheduleRender=()=>{let d=zt.now();this.renderScheduledAt<d&&(this.renderScheduledAt=d,cr.render(this.render,false,true));};let{latestValues:u,renderState:l}=o;this.latestValues=u,this.baseTarget={...u},this.initialValues=t.initial?{...u}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=i,this.depth=e?e.depth+1:0,this.reducedMotionConfig=s,this.options=a,this.blockInitialAnimation=!!n,this.isControllingVariants=NP(t),this.isVariantNode=QF(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:c,...h}=this.scrapeMotionValuesFromProps(t,{},this);for(let d in h){let f=h[d];u[d]!==void 0&&tt(f)&&f.set(u[d]);}}mount(e){this.current=e,Ao.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,i)=>this.bindToMotionValue(i,t)),gv.current||$F(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?false:this.reducedMotionConfig==="always"?true:_m.current,process.env.NODE_ENV!=="production"&&Vp(this.shouldReduceMotion!==true,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),this.parent?.addChild(this),this.update(this.props,this.presenceContext);}unmount(){this.projection&&this.projection.unmount(),Th(this.notifyUpdate),Th(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=false);}this.current=null;}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e);}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e);}bindToMotionValue(e,t){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();let i=Xr.has(e);i&&this.onBindTransform&&this.onBindTransform();let s=t.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&cr.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=true),this.scheduleRender();}),n;window.MotionCheckAppearSync&&(n=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{s(),n&&n(),t.owner&&t.stop();});}sortNodePosition(e){return !this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in mv){let t=mv[e];if(!t)continue;let{isEnabled:i,Feature:s}=t;if(!this.features[e]&&s&&i(this.props)&&(this.features[e]=new s(this)),this.features[e]){let n=this.features[e];n.isMounted?n.update():(n.mount(),n.isMounted=true);}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props);}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Bh()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t;}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let i=0;i<eG.length;i++){let s=eG[i];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);let n="on"+s,o=e[n];o&&(this.propEventSubscriptions[s]=this.on(s,o));}this.prevMotionValues=JF(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue();}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let i=this.values.get(e);t!==i&&(i&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get());}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState);}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let i=this.values.get(e);return i===void 0&&t!==void 0&&(i=bs(t===null?void 0:t,{owner:this}),this.addValue(e,i)),i}readValue(e,t){let i=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return i!=null&&(typeof i=="string"&&(Up(i)||Lp(i))?i=parseFloat(i):!UP(i)&&Wr.test(t)&&(i=fm(e,t)),this.setBaseTarget(e,tt(i)?i.get():i)),tt(i)?i.get():i}setBaseTarget(e,t){this.baseTarget[e]=t;}getBaseTarget(e){let{initial:t}=this.props,i;if(typeof t=="string"||typeof t=="object"){let n=fv(this.props,t,this.presenceContext?.custom);n&&(i=n[e]);}if(t&&i!==void 0)return i;let s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!tt(s)?s:this.initialValues[e]!==void 0&&i===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new Gu),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t);}scheduleRenderMicrotask(){FP.render(this.render);}};var Dh=class extends Ih{constructor(){super(...arguments),this.KeyframeResolver=pm;}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){return e.style?e.style[t]:void 0}removeValueFromRenderState(e,{vars:t,style:i}){delete t[e],delete i[e];}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;tt(e)&&(this.childSubscription=e.on("change",t=>{this.current&&(this.current.textContent=`${t}`);}));}};var L5={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},N5=Li.length;function tG(r,e,t){let i="",s=true;for(let n=0;n<N5;n++){let o=Li[n],a=r[o];if(a===void 0)continue;let u=true;if(typeof a=="number"?u=a===(o.startsWith("scale")?1:0):u=parseFloat(a)===0,!u||t){let l=mm(a,Wu[o]);if(!u){s=false;let c=L5[o]||o;i+=`${c}(${l}) `;}t&&(e[o]=l);}}return i=i.trim(),t?i=t(e,s?"":i):s&&(i="none"),i}function xv(r,e,t){let{style:i,vars:s,transformOrigin:n}=r,o=false,a=false;for(let u in e){let l=e[u];if(Xr.has(u)){o=true;continue}else if(Zp(u)){s[u]=l;continue}else {let c=mm(l,Wu[u]);u.startsWith("origin")?(a=true,n[u]=c):i[u]=c;}}if(e.transform||(o||t?i.transform=tG(e,r.transform,t):i.transform&&(i.transform="none")),a){let{originX:u="50%",originY:l="50%",originZ:c=0}=n;i.transformOrigin=`${u} ${l} ${c}`;}}function _v(r,{style:e,vars:t},i,s){let n=r.style,o;for(o in e)n[o]=e[o];s?.applyProjectionStyles(n,i);for(o in t)n.setProperty(o,t[o]);}var rG={};function iG(r,{layout:e,layoutId:t}){return Xr.has(r)||r.startsWith("origin")||(e||t!==void 0)&&(!!rG[r]||r==="opacity")}function bv(r,e,t){let{style:i}=r,s={};for(let n in i)(tt(i[n])||e.style&&tt(e.style[n])||iG(n,r)||t?.getValue(n)?.liveStyle!==void 0)&&(s[n]=i[n]);return s}function V5(r){return window.getComputedStyle(r)}var yv=class extends Dh{constructor(){super(...arguments),this.type="html",this.renderInstance=_v;}readValueFromInstance(e,t){if(Xr.has(t))return this.projection?.isProjecting?nm(t):vP(e,t);{let i=V5(e),s=(Zp(t)?i.getPropertyValue(t):i[t])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(e,{transformPagePoint:t}){return WF(e,t)}build(e,t,i){xv(e,t,i.transformTemplate);}scrapeMotionValuesFromProps(e,t,i){return bv(e,t,i)}};function H5(r,e){return r in e}var vv=class extends Ih{constructor(){super(...arguments),this.type="object";}readValueFromInstance(e,t){if(H5(t,e)){let i=e[t];if(typeof i=="string"||typeof i=="number")return i}}getBaseTargetFromProps(){}removeValueFromRenderState(e,t){delete t.output[e];}measureInstanceViewportBox(){return Bh()}build(e,t){Object.assign(e.output,t);}renderInstance(e,{output:t}){Object.assign(e,t);}sortInstanceNodePosition(){return 0}};var z5={offset:"stroke-dashoffset",array:"stroke-dasharray"},W5={offset:"strokeDashoffset",array:"strokeDasharray"};function sG(r,e,t=1,i=0,s=true){r.pathLength=1;let n=s?z5:W5;r[n.offset]=ie.transform(-i);let o=ie.transform(e),a=ie.transform(t);r[n.array]=`${o} ${a}`;}function nG(r,{attrX:e,attrY:t,attrScale:i,pathLength:s,pathSpacing:n=1,pathOffset:o=0,...a},u,l,c){if(xv(r,a,l),u){r.style.viewBox&&(r.attrs.viewBox=r.style.viewBox);return}r.attrs=r.style,r.style={};let{attrs:h,style:d}=r;h.transform&&(d.transform=h.transform,delete h.transform),(d.transform||h.transformOrigin)&&(d.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),d.transform&&(d.transformBox=c?.transformBox??"fill-box",delete h.transformBox),e!==void 0&&(h.x=e),t!==void 0&&(h.y=t),i!==void 0&&(h.scale=i),s!==void 0&&sG(h,s,n,o,false);}var Tv=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);var oG=r=>typeof r=="string"&&r.toLowerCase()==="svg";function aG(r,e,t,i){_v(r,e,void 0,i);for(let s in e.attrs)r.setAttribute(Tv.has(s)?s:Rh(s),e.attrs[s]);}function uG(r,e,t){let i=bv(r,e,t);for(let s in r)if(tt(r[s])||tt(e[s])){let n=Li.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;i[n]=r[s];}return i}var Sv=class extends Dh{constructor(){super(...arguments),this.type="svg",this.isSVGTag=false,this.measureInstanceViewportBox=Bh;}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(Xr.has(t)){let i=dm(t);return i&&i.default||0}return t=Tv.has(t)?t:Rh(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,i){return uG(e,t,i)}build(e,t,i){nG(e,t,this.isSVGTag,i.transformTemplate,i.style);}renderInstance(e,t,i,s){aG(e,t,i,s);}mount(e){this.isSVGTag=oG(e.tagName),super.mount(e);}};function lG(r){let e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},t=gm(r)&&!GP(r)?new Sv(e):new yv(e);t.mount(r),Ao.set(r,t);}function cG(r){let e={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},t=new vv(e);t.mount(r),Ao.set(r,t);}function hG(r,e,t){let i=tt(r)?r:bs(r);return i.start(pv("",i,e,t)),i.animation}function X5(r,e){return tt(r)||typeof r=="number"||typeof r=="string"&&!xm(e)}function Ev(r,e,t,i){let s=[];if(X5(r,e))s.push(hG(r,xm(e)&&e.default||e,t&&(t.default||t)));else {let n=dv(r,e,i),o=n.length;Ht(!!o,"No valid elements provided.","no-valid-elements");for(let a=0;a<o;a++){let u=n[a];Ht(u!==null,"You're trying to perform an animation on null. Ensure that selectors are correctly finding elements and refs are correctly hydrated.","animate-null");let l=u instanceof Element?lG:cG;Ao.has(u)||l(u);let c=Ao.get(u),h={...t};"delay"in h&&typeof h.delay=="function"&&(h.delay=h.delay(a,o)),s.push(...VF(c,{...e,transition:h},{}));}}return s}function dG(r,e,t){let i=[];return MF(r,e,t,{spring:js}).forEach(({keyframes:n,transition:o},a)=>{i.push(...Ev(a,n,o));}),i}function Y5(r){return Array.isArray(r)&&r.some(Array.isArray)}function fG(r){function e(t,i,s){let n=[];Y5(t)?n=dG(t,i,r):n=Ev(t,i,s,r);let o=new um(n);return o}return e}var Av=fG();Re();function j5(r,e,t){if(Array.isArray(r)&&Array.isArray(r[0])){let i=r.map(s=>{let{ticker:n=new _e,...o}=s[2]||{};return [s[0],s[1],{driver:a=>{let u=({lastTime:l})=>a(l);return {start:(l=true)=>{n.add(u),n.start();},stop:()=>n.remove(u),now:()=>n.lastTime}},...o}]});return Av(i,e)}else {let{ticker:i=new _e}=t||{};return Av(r,e,{driver:s=>{let n=({lastTime:o})=>s(o);return {start:(o=true)=>{i.add(n),i.start();},stop:()=>i.remove(n),now:()=>i.lastTime}},...t||{}})}}var mh=j5;var I=new Mp;Pr.init({getScreen:()=>I.screen});var zP={};vs(zP,{CharacterBaseModel:()=>ym,CharacterStoredClass:()=>Xu,RegisteredCharacters:()=>pG});var ne=class ne{static init(e){ne._getStepCounter=e.getStepCounter,ne._setStepCounter=e.setStepCounter,ne._getCurrentGameStepState=e.getCurrentGameStepState,ne._restoreGameStepState=e.restoreGameStepState,ne._getOpenedLabels=e.getOpenedLabels,e.onGoNextEnd&&(ne._onGoNextEnd=e.onGoNextEnd),ne._getVariable=e.getVariable,ne._setVariable=e.setVariable,ne._removeVariable=e.removeVariable,ne._getFlag=e.getFlag,ne._setFlag=e.setFlag,e.onLabelClosing&&(ne._onLabelClosing=e.onLabelClosing),ne._addHistoryItem=e.addHistoryItem,ne._getCurrentStepsRunningNumber=e.getCurrentStepsRunningNumber,ne._getCharacter=e.getCharacter;}static get stepCounter(){return ne._getStepCounter()}static set stepCounter(e){ne._setStepCounter(e);}static get currentGameStepState(){return ne._getCurrentGameStepState()}static get restoreGameStepState(){return ne._restoreGameStepState}static get openedLabels(){return ne._getOpenedLabels()}static get onGoNextEnd(){return ne._onGoNextEnd}static get getVariable(){return ne._getVariable}static get setVariable(){return ne._setVariable}static get removeVariable(){return ne._removeVariable}static get getFlag(){return ne._getFlag}static get setFlag(){return ne._setFlag}static get onLabelClosing(){return ne._onLabelClosing}static get addHistoryItem(){return ne._addHistoryItem}static get currentStepsRunningNumber(){return ne._getCurrentStepsRunningNumber()}static get getCharacter(){return ne._getCharacter}};w(ne,"_getStepCounter",()=>{throw E.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),w(ne,"_setStepCounter",()=>{throw E.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),w(ne,"_getCurrentGameStepState",()=>{throw E.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),w(ne,"_restoreGameStepState",()=>{throw E.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),w(ne,"_getOpenedLabels",()=>{throw E.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),w(ne,"_onGoNextEnd",async()=>{}),w(ne,"_getVariable",()=>{throw E.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),w(ne,"_setVariable",()=>{throw E.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),w(ne,"_removeVariable",()=>{throw E.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),w(ne,"_getFlag",()=>{throw E.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),w(ne,"_setFlag",()=>{throw E.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),w(ne,"_onLabelClosing",()=>{}),w(ne,"_addHistoryItem",()=>{throw E.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),w(ne,"_getCurrentStepsRunningNumber",()=>{throw E.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),w(ne,"_getCharacter",()=>{throw E.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented.")}),w(ne,"onEnd"),w(ne,"onError");var W=ne;var wt=class wt{constructor(){}static clearOldTempVariables(e){wt.tempStorageDeadlines.forEach((t,i)=>{t>e&&(wt.tempStorage.delete(i),wt.tempStorageDeadlines.delete(i),wt.storage.cache.delete(i));});}static setVariable(e,t){let i=wt.tempStorage.has(e);t==null?(wt.storage.map.delete(e),!i&&wt.storage.cache.delete(e)):(wt.storage.map.set(e,t),!i&&wt.storage.cache.set(e,t));}static getVariable(e){let t=wt.storage.cache.get(e);return t===void 0&&(t=wt.tempStorage.get(e)),t===void 0&&(t=wt.storage.map.get(e)),pe(t)}static removeVariable(e){wt.storage.delete(e);}static setFlag(e,t){if(t)this.flags.includes(e)||this.flags.push(e);else {let i=this.flags.indexOf(e);i>-1&&this.flags.splice(i,1);}}static getFlag(e){return this.flags.includes(e)}};w(wt,"storage",new Ct({cacheSize:20})),w(wt,"startingStorage",[]),w(wt,"flags",Array()),w(wt,"tempStorage",new Map),w(wt,"tempStorageDeadlines",new Map);var ue=wt;var bm=class{get storage(){return ue.storage.map}get cache(){return ue.storage.cache}get flags(){return ue.flags}get tempStorage(){return ue.tempStorage}get tempStorageDeadlines(){return ue.tempStorageDeadlines}set startingStorage(e){let t=[],i=W.stepCounter===0;Object.entries(e).forEach(([s,n])=>{t.push({key:s,value:n}),i&&ue.storage.set(s,n);}),ue.startingStorage=t;}setVariable(e,t){return ue.setVariable(e,t)}getVariable(e){return ue.getVariable(e)}removeVariable(e){return ue.removeVariable(e)}setTempVariable(e,t){if(t==null){this.removeTempVariable(e);return}else ue.tempStorage.set(e,t),ue.storage.cache.set(e,t),ue.tempStorageDeadlines.has(e)||ue.tempStorageDeadlines.set(e,W.openedLabels);}removeTempVariable(e){ue.tempStorage.has(e)&&(ue.tempStorage.delete(e),ue.tempStorageDeadlines.delete(e),ue.storage.cache.delete(e));}setFlag(e,t){return ue.setFlag(e,t)}getFlag(e){return ue.getFlag(e)}clear(){this.storage.clear(),this.cache.clear(),ue.flags=[],ue.tempStorage.clear(),ue.tempStorageDeadlines.clear(),ue.startingStorage.forEach(({key:e,value:t})=>{this.storage.set(e,t);});}export(){let e=[];[...this.storage.keys()].forEach(s=>{e.push({key:s,value:this.storage.get(s)});});let t=[];[...ue.tempStorage.keys()].forEach(s=>{t.push({key:s,value:ue.tempStorage.get(s)});});let i=[];return [...ue.tempStorageDeadlines.keys()].forEach(s=>{i.push({key:s,value:ue.tempStorageDeadlines.get(s)});}),pe({base:e,temp:t,tempDeadlines:i,flags:ue.flags})}restore(e){this.clear();try{e?(Array.isArray(e)&&e.forEach(t=>{if(t.key==="___temp_storage___"){let i=t.value;Object.entries(i).forEach(([s,n])=>{ue.tempStorage.set(s,n);});}else if(t.key==="___temp_storage_deadlines___"){let i=t.value;Object.entries(i).forEach(([s,n])=>{ue.tempStorageDeadlines.set(s,n);});}else t.key==="___flags___"?t.value.forEach(s=>{ue.flags.push(s);}):this.storage.set(t.key,t.value);}),"base"in e&&"temp"in e&&"tempDeadlines"in e?(e.base?.forEach(t=>{this.storage.set(t.key,t.value);}),e.temp?.forEach(t=>{ue.tempStorage.set(t.key,t.value);}),e.tempDeadlines?.forEach(t=>{ue.tempStorageDeadlines.set(t.key,t.value);})):Object.entries(e).forEach(([t,i])=>{t==="___temp_storage___"?Object.entries(i).forEach(([s,n])=>{ue.tempStorage.set(s,n);}):t==="___temp_storage_deadlines___"?Object.entries(i).forEach(([s,n])=>{ue.tempStorageDeadlines.set(s,n);}):t==="___flags___"?i.forEach(s=>{ue.flags.push(s);}):this.storage.set(t,i);})):E.warn("No storage data found");}catch(t){E.error("Error importing data",t);}}};var kh=class{constructor(e,t){w(this,"_id");w(this,"categoryId");this.categoryId=e,this._id=t;}get id(){return this._id}setStorageProperty(e,t){let i=ue.getVariable(this.categoryId);i||(i={}),i.hasOwnProperty(this.id)||(i[this.id]={}),t==null?i[this.id].hasOwnProperty(e)&&delete i[this.id][e]:i[this.id]={...i[this.id],[e]:t},Object.keys(i[this.id]).length===0&&delete i[this.id],ue.setVariable(this.categoryId,i);}getStorageProperty(e,t=this.id){let i=ue.getVariable(this.categoryId);if(i&&i.hasOwnProperty(t)&&i[t].hasOwnProperty(e))return i[t][e]}};var ci=new bm;var q5="@",Xu=class extends kh{constructor(t,i=""){super(he.CHARACTER_CATEGORY_KEY,t+(i?q5+i:""));w(this,"sourceId");this.sourceId=t;}getStorageProperty(t){let i=super.getStorageProperty(t);return i===void 0&&(i=super.getStorageProperty(t,this.sourceId)),i}};var ym=class extends Xu{constructor(t,i){super(typeof t=="string"?t:t.id,typeof t=="string"?"":t.emotion);w(this,"defaultName");w(this,"defaultSurname");w(this,"defaultAge");w(this,"_icon");w(this,"_color");this.defaultName=i.name,this.defaultSurname=i.surname,this.defaultAge=i.age,this._icon=i.icon,this._color=i.color;}get name(){return this.getStorageProperty("name")||this.defaultName||this.id}set name(t){this.setStorageProperty("name",t);}get surname(){return this.getStorageProperty("surname")||this.defaultSurname}set surname(t){this.setStorageProperty("surname",t);}get age(){return this.getStorageProperty("age")||this.defaultAge}set age(t){this.setStorageProperty("age",t);}get icon(){return this._icon}get color(){return this._color}};var Yu=new Ct({cacheSize:10}),HP;(s=>{function r(n){try{let o=Yu.get(n);if(!o){E.warn(`Character "${n}" not found, did you forget to register it with the RegisteredCharacters.add?`);return}return o}catch(o){E.error(`Error while getting Character "${n}"`,o);return}}s.get=r;function e(n){if(Array.isArray(n)){n.forEach(o=>e(o));return}Yu.get(n.id)&&E.info(`Character id "${n.id}" already exists, it will be overwritten`),Yu.set(n.id,n);}s.add=e;function t(){return Array.from(Yu.values())}s.values=t;function i(n){return Yu.has(n)}s.has=i;})(HP||(HP={}));var pG=HP;var K5={Date:true,RegExp:true,String:true,Number:true};function Cv(r,e,t={cyclesFix:true},i=[]){let s=[],n=Array.isArray(r);for(let a in r){let u=r[a],l=n?+a:a;if(!(a in e)){s.push({type:"REMOVE",path:[l],oldValue:r[a]});continue}let c=e[a],h=typeof u=="object"&&typeof c=="object"&&Array.isArray(u)===Array.isArray(c);u&&c&&h&&!K5[Object.getPrototypeOf(u)?.constructor?.name]&&(!t.cyclesFix||!i.includes(u))?s.push.apply(s,Cv(u,c,t,t.cyclesFix?i.concat([u]):[]).map(d=>(d.path.unshift(l),d))):u!==c&&!(Number.isNaN(u)&&Number.isNaN(c))&&!(h&&(isNaN(u)?u+""==c+"":+u==+c))&&s.push({path:[l],type:"CHANGE",value:c,oldValue:u});}let o=Array.isArray(e);for(let a in e)a in r||s.push({type:"CREATE",path:[o?+a:a],value:e[a]});return s}function mG(r,e){let t=pe(r);return e.length>1&&"type"in e[0]&&(e=e.reverse()),e.forEach(i=>{"type"in i?Z5(t,i):Q5(t,i);}),t}function Z5(r,e){let t=r;e.path&&e.path.length>0?e.path.forEach((i,s)=>{if(e.path&&s===e.path.length-1)switch(e.type){case "CHANGE":case "REMOVE":t[i]=e.oldValue;break;case "CREATE":Array.isArray(t)&&typeof i=="number"?t.splice(i,1):delete t[i];break}else t=t[i];}):E.warn("No path found, skipping diff",e);}function Q5(r,e){let t=r;e.path&&e.path.length>0?e.path.forEach((i,s)=>{if(e.path&&s===e.path.length-1){if(e.kind==="E"||e.kind==="D")t[i]=e.lhs;else if(e.kind==="N")Number.isInteger(i)?Array.isArray(t)&&t.splice(i,1):typeof i=="string"&&delete t[i];else if(e.kind==="A"){let n=e.index;e.item.kind==="N"?t[i].splice(n,1):e.item.kind==="E"||e.item.kind==="D"?t[i][n]=e.item.lhs:e.item.kind==="A"?E.warn("Nested array found, skipping diff",e):E.warn("No array found, skipping diff",e);}}else t=t[i];}):E.warn("No path found, skipping diff",e);}var Ni=class Ni{static get originalStepData(){return Ni._originalStepData?pe(Ni._originalStepData):{path:"",storage:{},canvas:{elementAliasesOrder:[],elements:{},stage:{},tickers:{},tickersSteps:{},tickersOnPause:{},tickersToCompleteOnStepEnd:{tikersIds:[],stepAlias:[]}},sound:{soundAliasesOrder:[],soundsPlaying:{},playInStepIndex:{},filters:void 0},labelIndex:-1,openedLabels:[]}}static set originalStepData(e){Ni._originalStepData=pe(e);}};w(Ni,"_diffHistory",new Ct({cacheSize:5})),w(Ni,"_stepsInfoHistory",new Ct({cacheSize:5})),w(Ni,"_narrationHistory",new Ct({cacheSize:50})),w(Ni,"stepLimitSaved",20),w(Ni,"goBackRunning",false),w(Ni,"_originalStepData");var K=Ni;var vm=class{get stepsInfoMap(){return K._stepsInfoHistory}get diffMap(){return K._diffHistory}get narrationMap(){return K._narrationHistory}get size(){return K._stepsInfoHistory.size}get lastKey(){return this.size===0?null:Math.max(...Array.from(this.keys()))}keys(){return K._stepsInfoHistory.keys()}get(e){let t=K._narrationHistory.get(e);if(!(t&&Object.keys(t).length===1&&t.stepIndex!==void 0))return t}delete(e){K._stepsInfoHistory.delete(e),K._diffHistory.delete(e),K._narrationHistory.delete(e);}internalRestoreOldGameState(e,t){if(e<=0||this.size==0)return t;let i=this.lastKey;if(typeof i!="number")return E.error("You can't go back, there is no step to go back"),t;let s=K._diffHistory.get(i);if(s)try{let n=mG(t,s);return W.stepCounter=i,this.delete(i),this.internalRestoreOldGameState(e-1,n)}catch(n){return E.error("Error applying diff",n),t}else return E.error("You can't go back, there is no step to go back"),t}async goBack(e,t=1){if(t<=0){E.warn("The parameter steps must be greater than 0");return}if(K._diffHistory.size<1){E.warn("You can't go back, there is no step to go back");return}if(K.goBackRunning){E.warn("Go back is already running");return}K.goBackRunning=true;try{let i=pe(this.internalRestoreOldGameState(t,K.originalStepData));if(i){await W.restoreGameStepState(i,e);let s=W.stepCounter-1,n=K._narrationHistory.get(s);if(n&&Object.keys(n).length===1&&n.stepIndex!==void 0){let o=K._stepsInfoHistory.get(s);if(o){let a=this.itemMapper({step:o});K._narrationHistory.set(o.index,a);}}}else E.error("Error going back");K.originalStepData=i,K.goBackRunning=!1;}catch(i){E.error("Error going back",i),K.goBackRunning=false;}}add(e,t={}){let i=K.originalStepData,{ignoreSameStep:s}=t,n=W.currentGameStepState;if(!s&&this.isSameStep(i,n))return;let o=this.lastKey;(async()=>{try{let u,l;if(typeof o=="number"&&(u=K._stepsInfoHistory.get(o),l=K._narrationHistory.get(o)),K._stepsInfoHistory.set(e.index,e),e.index!==0){let d=Cv(i,n);d?K._diffHistory.set(e.index,d):E.warn("It was not possible to create the difference between the two steps");}let c={},h=this.itemMapper({step:e},c);if(K._narrationHistory.set(e.index,h),u&&l&&typeof o=="number"){let d=this.itemMapper({...c,step:u},{});K._narrationHistory.set(o,d);}}catch(u){E.error("Error adding history step",u);}})(),K.originalStepData=n;}itemMapper(e,t){let{step:i,choiceIndexMade:s,inputValue:n,removeDialogue:o}=e,a=i.dialogue||i.dialoge;t&&i.isGlued&&(t.removeDialogue=true),o&&(a=void 0);let u=i.choices;if(t&&i.currentLabel&&i.choiceIndexMade!==void 0&&(t.choiceIndexMade=i.choiceIndexMade),i.inputValue&&t&&(t.inputValue=i.inputValue),a||u||n){let l=u?.map((c,h)=>{let d=false;return c.oneTime&&i.alreadyMadeChoices&&i.alreadyMadeChoices.includes(h)&&(d=true),{text:c.text,type:c.type,isResponse:false,hidden:d}});if(l){if(l.every(c=>c.hidden)){let c=l.find(h=>h.hidden===false);c&&(c.hidden=false);}s!==void 0&&(l[s].isResponse=true);}return {dialogue:a?{...a,character:a.character?W.getCharacter(a.character)||a.character:void 0}:void 0,playerMadeChoice:typeof s=="number",choices:l,stepIndex:i.index,inputValue:n}}return {stepIndex:i.index}}get narrativeHistory(){let e=[];return Array.from(this.keys()).sort((i,s)=>i-s).forEach(i=>{let s=this.get(i);s&&e.push(s);}),e}get currentLabelHistory(){let e=[],t=Array.from(this.keys()).sort((u,l)=>l-u);if(t.length===0)return e;let i=t[0];if(typeof i!="number")return e;let s=K._stepsInfoHistory.get(i);if(!s)return e;let n=s.openedLabels;if(!n||!Array.isArray(n)||n.length===0)return e;let o=n[0].currentStepIndex,a=n[0].label;return t.every((u,l)=>{let c=this.get(u);if(c){if(l===0)return e.push(c),true;let h=K._stepsInfoHistory.get(u);if(!h)return true;let d=h.openedLabels;if(!d||!Array.isArray(d)||d.length===0||d[0].label!==a||d[0].currentStepIndex>=o)return false;o=d[0].currentStepIndex,e.push(c);}return true}),e.reverse()}removeNarrativeHistory(e){if(e){let t=Array.from(this.keys()).sort((i,s)=>i-s);t=t.slice(0,e),t.forEach(i=>{K._narrationHistory.delete(i),K._stepsInfoHistory.delete(i),K._diffHistory.delete(i);});}else K._stepsInfoHistory.clear(),K._diffHistory.clear(),K._narrationHistory.clear();}get canGoBack(){let e=this.lastKey;return typeof e!="number"?false:K._diffHistory.has(e)}blockGoBack(){W.currentStepsRunningNumber===0&&K._diffHistory.clear();}isSameStep(e,t){if(e.openedLabels.length===t.openedLabels.length)try{let i=JSON.stringify(e.openedLabels),s=JSON.stringify(t.openedLabels);if(i===s&&e.path===t.path&&e.labelIndex===t.labelIndex)return !0}catch(i){return E.error("Error comparing opened labels",i),true}return false}clear(){K._stepsInfoHistory.clear(),K._diffHistory.clear(),K._narrationHistory.clear(),K._originalStepData=void 0;}get stepLimitSaved(){return K.stepLimitSaved}set stepLimitSaved(e){K.stepLimitSaved=e;}export(){let e=Array.from(this.keys()).sort((i,s)=>i-s);e.length>this.stepLimitSaved&&(e=e.slice(e.length-this.stepLimitSaved));let t=[];return e.forEach(i=>{let s=K._stepsInfoHistory.get(i);if(s){let n=K._diffHistory.get(i);t.push({...s,diff:n});}}),{stepsHistory:pe(t),originalStepData:pe(K._originalStepData)}}restoreNarrativeHistory(){let e=Array.from(this.keys()).sort((i,s)=>i-s),t={};e.forEach(i=>{let s=K._stepsInfoHistory.get(i);if(s){let n={...t};t={};let o=this.itemMapper({step:s,choiceIndexMade:n.choiceIndexMade,inputValue:n.inputValue,removeDialogue:n.removeDialogue},t);o&&K._narrationHistory.set(i,o);}});}async restore(e){this.clear();try{e.hasOwnProperty("stepsHistory")?(e.stepsHistory.forEach(i=>{i.diff&&K._diffHistory.set(i.index,i.diff);let s={...i,diff:void 0};K._stepsInfoHistory.set(i.index,s);}),this.restoreNarrativeHistory()):E.warn("Could not import stepsHistory data, so will be ignored"),e.hasOwnProperty("originalStepData")?K._originalStepData=e.originalStepData:E.warn("Could not import originalStepData data, so will be ignored");}catch(t){E.error("Error importing data",t);}}};var Co=new vm;var gG={};var YP={};vs(YP,{Close:()=>wv,Label:()=>$u,LabelAbstract:()=>ju,NarrationManagerStatic:()=>N,RegisteredLabels:()=>hi,narration:()=>Ks,newChoiceOption:()=>xG,newCloseChoiceOption:()=>_G,newLabel:()=>XP});var Tm=new Ct({cacheSize:10}),WP;(s=>{function r(n){let o=Tm.get(n);if(!o){E.error(`Label "${n}" not found`);return}return o}s.get=r;function e(n){if(Array.isArray(n)){n.forEach(o=>e(o));return}Tm.has(n.id)&&E.info(`Label "${n.id}" already exists, it will be overwritten`),Tm.set(n.id,n);}s.add=e;function t(){return Array.from(Tm.values())}s.values=t;function i(n){return Tm.has(n)}s.has=i;})(WP||(WP={}));var hi=WP;var Z=class Z{constructor(){}static get allOpenedLabels(){return W.getVariable(he.OPENED_LABELS_COUNTER_KEY)||{}}static set allOpenedLabels(e){W.setVariable(he.OPENED_LABELS_COUNTER_KEY,e);}static getCurrentStepTimesCounterData(e=""){let t=Z.currentLabelStepIndex;if(t===null)return E.error("currentLabelStepIndex is null"),null;let i=`${t}${e}`,s=Z.currentLabelId,n=Z._currentLabel;if(!s||t===null||!n)return E.error("currentLabelId or currentLabelStepIndex is null or currentLabel not found"),null;let o=n.getStepSha(t)||"error",a=W.getVariable(he.CURRENT_STEP_TIMES_COUNTER_KEY)||{};return a[s]||(a[s]={}),(!a[s][i]||a[s][i].stepSha1!=o)&&(a[s][i]={stepSha1:o}),a[s][i]}static setCurrentStepTimesCounterData(e="",t){let i=Z.currentLabelStepIndex,s=i+e,n=Z.currentLabelId;if(!n||i===null){E.error("currentLabelId or currentLabelStepIndex is null");return}let o=W.getVariable(he.CURRENT_STEP_TIMES_COUNTER_KEY)||{};o[n]||(o[n]={}),o[n][s]=t,W.setVariable(he.CURRENT_STEP_TIMES_COUNTER_KEY,o);}static getCurrentStepTimesCounter(e=""){let t=Z._stepCounter,i=Z.getCurrentStepTimesCounterData(e);if(!i)return E.error("getCurrentStepTimesCounter obj is null"),0;let s=i.stepCounters||i.lastStepIndexs||[];return s.find(o=>o===t)||(s.push(t),delete i.lastStepIndexs,i.stepCounters=s,Z.setCurrentStepTimesCounterData(e,i)),s.length}static getRandomNumber(e,t,i={}){let s=i.nestedId||"";if(i.onceOnly||false){let o=Z.getCurrentStepTimesCounterData(s);if(!o)return;let a=o.usedRandomNumbers||{},u=Array.from({length:t-e+1},(h,d)=>d+e).filter(h=>!a[`${e}-${t}`]?.includes(h));if(u.length===0)return;let l=Math.floor(Math.random()*u.length),c=u[l];return a[`${e}-${t}`]||(a[`${e}-${t}`]=[]),a[`${e}-${t}`].push(c),o.usedRandomNumbers=a,Z.setCurrentStepTimesCounterData(s,o),c}return Math.floor(Math.random()*(t-e+1))+e}static resetCurrentStepTimesCounter(e=""){let t=Z.currentLabelStepIndex,i=t+e,s=Z.currentLabelId;if(!s||t===null){E.error("currentLabelId or currentLabelStepIndex is null");return}let n=W.getVariable(he.CURRENT_STEP_TIMES_COUNTER_KEY)||{};n[s]||(n[s]={}),n[s][i]={stepCounters:[],stepSha1:""},W.setVariable(he.CURRENT_STEP_TIMES_COUNTER_KEY,n);}static get allChoicesMade(){return W.getVariable(he.ALL_CHOICES_MADE_KEY)||[]}static set allChoicesMade(e){W.setVariable(he.ALL_CHOICES_MADE_KEY,e);}static increaseStepCounter(){Z._stepCounter++;}static get openedLabels(){return pe(Z._openedLabels)}static set openedLabels(e){Z._openedLabels=pe(e);}static get originalOpenedLabels(){return pe(Z._originalOpenedLabels)}static set originalOpenedLabels(e){Z._originalOpenedLabels=pe(e);}static get _currentLabel(){if(Z.currentLabelId)return hi.get(Z.currentLabelId)}static get currentLabelId(){if(Z._openedLabels.length>0)return Z._openedLabels[Z._openedLabels.length-1].label}static get currentLabelStepIndex(){return Z._openedLabels.length>0?Z._openedLabels[Z._openedLabels.length-1].currentStepIndex:null}static addLabelHistory(e,t){let i=Z.allOpenedLabels,s=Z.allOpenedLabels[e]?.biggestStep||0,n=Z.allOpenedLabels[e]?.openCount||0;(!s||s<t)&&(i[e]={biggestStep:t,openCount:n},Z.allOpenedLabels=i);}static addChoicesMade(e,t,i,s){let n=Z.allChoicesMade,o=n.findIndex(a=>a.labelId===e&&a.stepIndex===t&&a.choiceIndex===s&&a.stepSha1===i);o<0?n.push({labelId:e,stepIndex:t,choiceIndex:s,stepSha1:i,madeTimes:1}):n[o].madeTimes++,Z.allChoicesMade=n;}static pushNewLabel(e){if(!hi.get(e))throw new Error(`[Pixi\u2019VN] Label ${e} not found`);Z._openedLabels.push({label:e,currentStepIndex:0});let i=Z.allOpenedLabels,s=Z.allOpenedLabels[e]?.biggestStep||0,n=Z.allOpenedLabels[e]?.openCount||0;i[e]={biggestStep:s,openCount:n+1},Z.allOpenedLabels=i;}static increaseCurrentStepIndex(){if(Z._openedLabels.length>0){let e=Z._openedLabels[Z._openedLabels.length-1];Z._openedLabels[Z._openedLabels.length-1]={...e,currentStepIndex:e.currentStepIndex+1};}}static set onStepStart(e){Z._onStepStart=e;}static get onStepStart(){return async(e,t)=>{let i=[];return Z.onLoadingLabel&&e===0&&i.push(Z.onLoadingLabel(e,t)),Z._onStepStart&&i.push(Z._onStepStart(e,t)),await Promise.all(i)}}};w(Z,"stepsRunning",0),w(Z,"goNextRequests",0),w(Z,"choiceMadeTemp"),w(Z,"lastHistoryStep",null),w(Z,"_stepCounter",0),w(Z,"_openedLabels",[]),w(Z,"_originalOpenedLabels",[]),w(Z,"_onStepStart"),w(Z,"onLoadingLabel"),w(Z,"onStepEnd");var N=Z;var Sm=class{get currentStepTimesCounter(){return N.getCurrentStepTimesCounter()}set currentStepTimesCounter(e){N.resetCurrentStepTimesCounter();}getRandomNumber(e,t,i={}){return N.getRandomNumber(e,t,i)}get stepCounter(){return N._stepCounter}get openedLabels(){return N.openedLabels}get currentLabel(){return N._currentLabel}addStepHistory(e,t={}){let{choiceMade:i,ignoreSameStep:s}=t,n,o,a,u=W.getVariable(he.LAST_STEP_GLUED)===this.stepCounter;W.getVariable(he.LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY)===this.stepCounter&&(n=W.getVariable(he.CURRENT_DIALOGUE_MEMORY_KEY)),W.getVariable(he.LAST_MENU_OPTIONS_ADDED_IN_STEP_MEMORY_KEY)===this.stepCounter&&(o=W.getVariable(he.CURRENT_MENU_OPTIONS_MEMORY_KEY)),W.getVariable(he.LAST_INPUT_ADDED_IN_STEP_MEMORY_KEY)===this.stepCounter&&(a=W.getVariable(he.CURRENT_INPUT_VALUE_MEMORY_KEY));let l=N.openedLabels,c={currentLabel:N.currentLabelId,dialogue:n,choices:o,stepSha1:e,index:this.stepCounter,labelStepIndex:N.currentLabelStepIndex,choiceIndexMade:i,inputValue:a,alreadyMadeChoices:this.alreadyCurrentStepMadeChoices,isGlued:u,openedLabels:l};N.originalOpenedLabels=l,W.addHistoryItem(c,{ignoreSameStep:s}),N.lastHistoryStep=c,N.increaseStepCounter();}closeCurrentLabel(){if(!N.currentLabelId){E.warn("No label to close");return}if(!this.currentLabel){E.error("currentLabel not found");return}let e=N.openedLabels;e.pop(),N.openedLabels=e,W.onLabelClosing(this.openedLabels.length);}closeAllLabels(){for(;N.openedLabels.length>0;)this.closeCurrentLabel(),W.onLabelClosing(this.openedLabels.length);}isLabelAlreadyCompleted(e){let t;typeof e=="string"?t=e:t=e.id;let s=N.allOpenedLabels[t]?.biggestStep||0;if(s){let n=hi.get(t);if(n)return n.stepCount<=s}return false}get alreadyCurrentStepMadeChoicesObj(){let e=N.currentLabelStepIndex,t=this.currentLabel;if(e===null||!t)return;let i=t.getStepSha(e);return i||(E.warn("stepSha not found, setting to ERROR"),i="error"),N.allChoicesMade.filter(s=>s.labelId===t?.id&&s.stepIndex===e&&s.stepSha1===i)}get alreadyCurrentStepMadeChoices(){return this.alreadyCurrentStepMadeChoicesObj?.map(e=>e.choiceIndex)}get isCurrentStepAlreadyOpened(){let e=N.currentLabelId;if(e){let t=N.allOpenedLabels[e]?.openCount||0;if(N.currentLabelStepIndex&&t>=N.currentLabelStepIndex)return true}return false}getTimesLabelOpened(e){return N.allOpenedLabels[e]?.openCount||0}getTimesChoiceMade(e){return this.alreadyCurrentStepMadeChoicesObj?.find(t=>t.choiceIndex===e)?.madeTimes||0}addCurrentStepToHistory(){this.addStepHistory("dev",{ignoreSameStep:true});}getCanGoNext(e){let t=e?.showWarn||false,i=this.choiceMenuOptions;return i&&i.length>0?(t&&E.warn("The player must make a choice"),false):this.isRequiredInput?(t&&E.warn("The player must enter a value"),false):true}get canGoNext(){return N.stepsRunning!==0?false:this.getCanGoNext()}async onStepRun(e,t){let i=[];return e.onStepStart&&i.push(e.onStepStart(t,e)),N.onStepStart&&i.push(N.onStepStart(t,e)),await Promise.all(i)}async onStepEnd(e,t){let i=[];return e.onStepEnd&&i.push(e.onStepEnd(t,e)),N.onStepEnd&&i.push(N.onStepEnd(t,e)),await Promise.all(i)}async goNext(e,t={}){let{runNow:i=false}=t;if(!(!i&&!this.getCanGoNext({showWarn:true}))){if(!i&&N.stepsRunning!==0){N.goNextRequests++;return}try{this.currentLabel&&await this.onStepEnd(this.currentLabel,N.currentLabelStepIndex||0);}catch(s){E.error("Error running onStepEnd",s);}return N.stepsRunning===0&&await W.onGoNextEnd(),N.increaseCurrentStepIndex(),await this.runCurrentStep(e,t)}}async runCurrentStep(e,t={}){let{choiceMade:i}=t;if(N.currentLabelId){let s=N.currentLabelStepIndex;if(s===null){E.error("currentLabelStepIndex is null");return}let n=N._currentLabel;if(!n){E.error("currentLabel not found");return}if(n.stepCount>s){try{await this.onStepRun(n,s);}catch(u){E.error("Error running onStepStart",u),this.onStepError&&this.onStepError(u,e);return}let o=n.getStepById(s);if(!o){E.error("step not found");return}let a=n.getStepSha(s);a||(E.warn("stepSha not found, setting to ERROR"),a="error");try{N.stepsRunning++;let u=await o(e,{labelId:n.id}),l=this.choiceMenuOptions;if(l?.length===1&&l[0].autoSelect){let h=l[0];u=await this.selectChoice(h,e);}let c=N.lastHistoryStep;if(i!==void 0&&c){let h=c.stepSha1;h||(E.warn("stepSha not found, setting to ERROR"),h="error"),N.addChoicesMade(c.currentLabel||"error",typeof c.labelStepIndex=="number"?c.labelStepIndex:-1,c.stepSha1||"error",i),N.choiceMadeTemp=i;}return N.stepsRunning--,N.stepsRunning===0&&(N.addLabelHistory(n.id,s),this.addStepHistory(a,{...t,choiceMade:N.choiceMadeTemp}),N.choiceMadeTemp=void 0,N.goNextRequests>0)?(N.goNextRequests--,await this.goNext(e)):u}catch(u){N.stepsRunning>0&&N.stepsRunning--,E.error("Error running step",u),this.onStepError&&this.onStepError(u,e);return}}else {if(this.openedLabels.length>1)return this.closeCurrentLabel(),await this.goNext(e,t);if(this.openedLabels.length===1)return N.openedLabels=[],W.onEnd?await W.onEnd(e,{labelId:"end"}):void 0}}else if(this.openedLabels.length===0){if(N.openedLabels=N.originalOpenedLabels,W.onEnd)return await W.onEnd(e,{labelId:"end"});E.error("The end of the game is not managed, so the game is blocked. Read this documentation to know how to manage the end of the game: https://pixi-vn.web.app/start/other-narrative-features.html#how-manage-the-end-of-the-game");return}else E.error("currentLabelId not found");}async callLabel(e,t,i){let{choiceMade:s}=i||{},n;typeof e=="string"?n=e:n=e.id;try{let o=hi.get(n);if(!o)throw new Error(`[Pixi\u2019VN] Label ${n} not found`);try{this.currentLabel&&await this.onStepEnd(this.currentLabel,N.currentLabelStepIndex||0);}catch(a){E.error("Error running onStepEnd",a);}N.pushNewLabel(o.id);}catch(o){E.error("Error calling label",o);return}return await this.runCurrentStep(t,{choiceMade:s})}async jumpLabel(e,t,i){this.openedLabels.length>0&&this.closeCurrentLabel();let{choiceMade:s}=i||{},n;typeof e=="string"?n=e:n=e.id;try{let o=hi.get(n);if(!o)throw new Error(`[Pixi\u2019VN] Label ${n} not found`);try{this.currentLabel&&await this.onStepEnd(this.currentLabel,N.currentLabelStepIndex||0);}catch(a){E.error("Error running onStepEnd",a);}N.pushNewLabel(o.id);}catch(o){E.error("Error jumping label",o);return}return await this.runCurrentStep(t,{choiceMade:s})}async selectChoice(e,t){this.choiceMenuOptions=void 0;let i=e.type;switch(i){case "call":return await this.callLabel(e.label,{...e.props,...t},{choiceMade:e.choiceIndex});case "jump":return await this.jumpLabel(e.label,{...e.props,...t},{choiceMade:e.choiceIndex});case "close":return await this.closeChoiceMenu(e,{...e.props,...t});default:throw E.error(`Type ${i} not found`),new Error(`[Pixi\u2019VN] Type ${i} not found`)}}async closeChoiceMenu(e,t){if(e.type!=="close")throw E.error("For closeChoiceMenu, the type must be close"),new Error("[Pixi\u2019VN] For closeChoiceMenu, the type must be close");let i;return typeof e.choiceIndex=="number"&&(i=e.choiceIndex),e.closeCurrentLabel&&this.closeCurrentLabel(),this.goNext(t,{choiceMade:i})}get onStepError(){let e=W.onError;return e?(t,i)=>e("step",t,i):void 0}set onStepError(e){W.onError=(t,i,s)=>e(i,s);}get dialogue(){let e=W.getVariable(he.CURRENT_DIALOGUE_MEMORY_KEY);if(e)return {...e,character:e.character?W.getCharacter(e.character)||e.character:void 0}}set dialogue(e){if(!e){W.setVariable(he.CURRENT_DIALOGUE_MEMORY_KEY,void 0);return}if((typeof e=="string"||Array.isArray(e))&&(e={text:e}),this.dialogGlue){let t=W.getVariable(he.CURRENT_DIALOGUE_MEMORY_KEY);if(t){let i=[];Array.isArray(t.text)?i=[...t.text]:i=[t.text],Array.isArray(e.text)?i=[...i,...e.text]:i=[...i,e.text],e.text=i,e.character=e.character||t.character;}W.setVariable(he.LAST_STEP_GLUED,this.stepCounter),this.dialogGlue=false;}try{W.setVariable(he.CURRENT_DIALOGUE_MEMORY_KEY,pe({...e,character:typeof e.character=="string"?e.character:e.character?.id})),W.setVariable(he.LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY,this.stepCounter);}catch(t){throw E.error("DialogueInterface cannot contain functions or classes"),t}}get choiceMenuOptions(){let e=W.getVariable(he.CURRENT_MENU_OPTIONS_MEMORY_KEY);if(e){let t=[],i=e.map((n,o)=>({...n,choiceIndex:o})),s=this.alreadyCurrentStepMadeChoices;if(i=i.filter((n,o)=>n.oneTime&&s&&s.includes(o)?false:n.onlyHaveNoChoice?(t.push(n),false):true),i.length>0)return i;if(t.length>0)return [t[0]]}}set choiceMenuOptions(e){if(!e||e.length===0){W.setVariable(he.CURRENT_MENU_OPTIONS_MEMORY_KEY,void 0);return}try{W.setVariable(he.CURRENT_MENU_OPTIONS_MEMORY_KEY,pe(e)),W.setVariable(he.LAST_MENU_OPTIONS_ADDED_IN_STEP_MEMORY_KEY,this.stepCounter);}catch(t){throw E.error("ChoiceInterface cannot contain functions or classes"),t}}get dialogGlue(){return W.getFlag(he.ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY)}set dialogGlue(e){W.setFlag(he.ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY,e);}get inputValue(){return W.getVariable(he.CURRENT_INPUT_VALUE_MEMORY_KEY)}set inputValue(e){this.removeInputRequest(),W.setVariable(he.CURRENT_INPUT_VALUE_MEMORY_KEY,e),W.setVariable(he.LAST_INPUT_ADDED_IN_STEP_MEMORY_KEY,this.stepCounter);}get isRequiredInput(){return W.getVariable(he.CURRENT_INPUT_INFO_MEMORY_KEY)?.isRequired||false}get inputType(){return W.getVariable(he.CURRENT_INPUT_INFO_MEMORY_KEY)?.type}requestInput(e,t){e.isRequired=true,W.setVariable(he.CURRENT_INPUT_INFO_MEMORY_KEY,e),t!==void 0?W.setVariable(he.CURRENT_INPUT_VALUE_MEMORY_KEY,t):W.removeVariable(he.CURRENT_INPUT_VALUE_MEMORY_KEY);}removeInputRequest(){W.removeVariable(he.CURRENT_INPUT_INFO_MEMORY_KEY),W.removeVariable(he.CURRENT_INPUT_VALUE_MEMORY_KEY);}clear(){N.openedLabels=[],N._stepCounter=0;}export(){return {openedLabels:pe(N.openedLabels),stepCounter:this.stepCounter}}async onLoadingLabel(e){let t=this.openedLabels.map(async i=>{let s=[],n=hi.get(i.label);return n&&(n.onLoadingLabel&&s.push(n.onLoadingLabel(e,n)),N.onLoadingLabel&&s.push(N.onLoadingLabel(e,n))),await Promise.all(s)});return await Promise.all(t)}async restore(e,t){this.clear();try{N.lastHistoryStep=t,e.hasOwnProperty("openedLabels")?(N.openedLabels=e.openedLabels,N.originalOpenedLabels=N.openedLabels):E.warn("Could not import openedLabels data, so will be ignored"),e.hasOwnProperty("stepCounter")?N._stepCounter=e.stepCounter:e.hasOwnProperty("lastStepIndex")?N._stepCounter=e.lastStepIndex:E.warn("Could not import stepCounter data, so will be ignored");try{await this.onLoadingLabel(N.currentLabelStepIndex||0);}catch(i){E.error("Error running onLoadingLabel",i);}}catch(i){E.error("Error importing data",i);}}};function xG(r,e,t,i){let s=typeof e=="string"?e:e.id;return {...i,label:s,props:t,text:r,type:i?.type||"call"}}var wv="close";function _G(r,e){return {...e,type:wv,text:r}}var bG=Fh(Lw());var ju=class{constructor(e,t){w(this,"_id");w(this,"_onStepStart");w(this,"_onLoadingLabel");w(this,"_onStepEnd");this._id=e,this._onStepStart=t?.onStepStart,this._onLoadingLabel=t?.onLoadingLabel,this._onStepEnd=t?.onStepEnd;}get id(){return this._id}get onStepStart(){return async(e,t)=>{if(this._onLoadingLabel&&e===0&&await this._onLoadingLabel(e,t),this._onStepStart)return await this._onStepStart(e,t)}}get onLoadingLabel(){return this._onLoadingLabel}get onStepEnd(){return this._onStepEnd}};var $u=class extends ju{constructor(t,i,s){super(t,s);w(this,"_steps");this._steps=i;}get stepCount(){return this.steps.length}getStepById(t){return this.steps[t]}get steps(){return typeof this._steps=="function"?this._steps():this._steps}getStepSha(t){if(t<0||t>=this.steps.length)return E.warn("stepSha not found, setting to ERROR"),"error";try{let i=this.steps[t];return (0,bG.default)(i.toString().toLocaleLowerCase()).toString()}catch(i){return E.warn("stepSha not found, setting to ERROR",i),"error"}}};function XP(r,e,t){let i=new $u(r,e,t);return hi.add(i),i}var Ks=new Sm;var $P={};vs($P,{Sound:()=>wo,SoundManagerStatic:()=>oe,sound:()=>Po});var oe=class{constructor(){}};w(oe,"soundAliasesOrder",[]),w(oe,"soundsPlaying",{}),w(oe,"sounds",{});var wo=class r extends Gr{constructor(){super(...arguments);w(this,"alias");}pause(){if(!this.alias)throw new Error("[Pixi\u2019VN] The alias is not defined.");let t=oe.soundsPlaying[this.alias];if(!t)throw new Error("[Pixi\u2019VN] The alias is not found in the playInStepIndex.");return oe.soundsPlaying[this.alias]={...t,paused:true},super.pause()}resume(){if(!this.alias)throw new Error("[Pixi\u2019VN] The alias is not defined.");let t=oe.soundsPlaying[this.alias];if(!t)throw new Error("[Pixi\u2019VN] The alias is not found in the playInStepIndex.");return oe.soundsPlaying[this.alias]={options:t.options,stepIndex:W.stepCounter,paused:false},super.resume()}destroy(){return this.alias&&delete oe.soundsPlaying[this.alias],super.destroy()}stop(){if(!this.alias)throw new Error("[Pixi\u2019VN] The alias is not defined.");return delete oe.soundsPlaying[this.alias],super.stop()}play(t){if(typeof t=="string"&&(this.alias=t),!this.alias)throw new Error("[Pixi\u2019VN] The alias is not defined.");return oe.soundsPlaying[this.alias]={stepIndex:W.stepCounter,options:t,paused:false},super.play(t)}static from(t){let i=Gr.from(t);return new r(i.media,i.options)}};function Em(r){let e=[];for(let t of r)t.type==="TelephoneFilter"?e.push(new Xe.TelephoneFilter):t.type==="StreamFilter"?e.push(new Xe.StreamFilter):t.type==="StereoFilter"?e.push(new Xe.StereoFilter(t.pan)):t.type==="ReverbFilter"?e.push(new Xe.ReverbFilter(t.seconds,t.decay,t.reverse)):t.type==="MonoFilter"?e.push(new Xe.MonoFilter):t.type==="EqualizerFilter"?e.push(new Xe.EqualizerFilter(t.f32,t.f64,t.f125,t.f250,t.f500,t.f1k,t.f2k,t.f4k,t.f8k,t.f16k)):t.type==="DistortionFilter"?e.push(new Xe.DistortionFilter(t.amount)):E.error("Unknown sound filter type");return e}function jP(r){if(!r)return;let e=[];for(let t of r)t instanceof Xe.TelephoneFilter?e.push({type:"TelephoneFilter"}):t instanceof Xe.StreamFilter?e.push({type:"StreamFilter"}):t instanceof Xe.StereoFilter?e.push({type:"StereoFilter",pan:t.pan}):t instanceof Xe.ReverbFilter?e.push({type:"ReverbFilter",seconds:t.seconds,decay:t.decay,reverse:t.reverse}):t instanceof Xe.MonoFilter?e.push({type:"MonoFilter"}):t instanceof Xe.EqualizerFilter?e.push({type:"EqualizerFilter",f32:t.f32,f64:t.f64,f125:t.f125,f250:t.f250,f500:t.f500,f1k:t.f1k,f2k:t.f2k,f4k:t.f4k,f8k:t.f8k,f16k:t.f16k}):t instanceof Xe.DistortionFilter?e.push({type:"DistortionFilter",amount:t.amount}):E.error("Unknown sound filter type");return e}var Am=class extends ih{constructor(){super();}get context(){return Ie.context}get filtersAll(){return Ie.filtersAll}set filtersAll(e){Ie.filtersAll=e.filter(t=>!(t instanceof Xe.Filter));}get supported(){return Ie.supported}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}add(e,t){if(typeof e=="object")throw new Error("[Pixi\u2019VN] The method add(map: SoundSourceMap, globalOptions?: Options) is deprecated. Use add(alias: string, options: Options | string | ArrayBuffer | AudioBuffer | HTMLAudioElement | Sound): Sound; instead.");this.exists(e)&&this.remove(e),t instanceof Gr&&(t=t.options);let i;if(t instanceof wo)i=t;else {let s=this.getOptions(t||{});i=wo.from(s);}return i.alias=e,!oe.soundAliasesOrder.includes(e)&&oe.soundAliasesOrder.push(e),oe.sounds[e]=i,Ie.add(e,i),i}get useLegacy(){return Ie.useLegacy}set useLegacy(e){Ie.useLegacy=e;}get disableAutoPause(){return Ie.disableAutoPause}set disableAutoPause(e){Ie.disableAutoPause=e;}remove(e){return oe.soundAliasesOrder=oe.soundAliasesOrder.filter(t=>t!==e),delete oe.soundsPlaying[e],delete oe.sounds[e],Ie.remove(e)}get volumeAll(){return Ie.volumeAll}set volumeAll(e){Ie.volumeAll=e;}get speedAll(){return Ie.speedAll}set speedAll(e){Ie.speedAll=e;}togglePauseAll(){return Ie.togglePauseAll()}pauseAll(){return Ie.pauseAll()}resumeAll(){return Ie.resumeAll()}toggleMuteAll(){return Ie.toggleMuteAll()}muteAll(){return Ie.muteAll()}unmuteAll(){return Ie.unmuteAll()}removeAll(){return oe.soundAliasesOrder=[],oe.soundsPlaying={},oe.sounds={},Ie.removeAll()}stopAll(){for(let e in oe.sounds)oe.sounds[e].stop();return oe.soundsPlaying={},Ie.stopAll()}exists(e,t){return Ie.exists(e,t)||e in oe.sounds}isPlaying(){return Ie.isPlaying()}find(e){let t=oe.sounds[e];return t||(t=Ie.find(e),t&&(oe.sounds[e]=t),t)}play(e,t){if(!this.exists(e))throw new Error("[Pixi\u2019VN] The alias is not found in the sound library.");return oe.soundsPlaying[e]={stepIndex:W.stepCounter,options:t,paused:false},Ie.play(e,t)}stop(e){return delete oe.soundsPlaying[e],Ie.stop(e)}pause(e){let t=oe.soundsPlaying[e];if(!t)throw new Error("[Pixi\u2019VN] The alias is not found in the playInStepIndex.");return oe.soundsPlaying[e]={...t,paused:true},Ie.pause(e)}resume(e){let t=oe.soundsPlaying[e];if(!t)throw new Error("[Pixi\u2019VN] The alias is not found in the playInStepIndex.");return oe.soundsPlaying[e]={options:t.options,stepIndex:W.stepCounter,paused:false},Ie.resume(e)}volume(e,t){return Ie.volume(e,t)}speed(e,t){return Ie.speed(e,t)}duration(e){return Ie.duration(e)}close(){return Ie.close()}clear(){this.stopAll();}export(){let e={};for(let t in oe.soundsPlaying){let i=oe.soundsPlaying[t],s=this.find(t);s&&(e[t]={...i,sound:{options:{...s.options,autoPlay:s.autoPlay,loop:s.loop,preload:s.preload,singleInstance:s.singleInstance,url:s.options.url,volume:s.options.volume},filters:jP(s.media.filters)}});}return {soundsPlaying:pe(e),soundAliasesOrder:pe(oe.soundAliasesOrder),filters:pe(jP(this.filtersAll))}}removeOldSoundAndExport(){return this.export()}restore(e){let t=W.stepCounter-1;this.clear();try{if(e.hasOwnProperty("soundAliasesOrder"))oe.soundAliasesOrder=e.soundAliasesOrder;else {E.error("The data does not have the properties soundAliasesOrder");return}if(e.hasOwnProperty("filters")){let i=e.filters;i&&(this.filtersAll=Em(i));}if(e.hasOwnProperty("playInStepIndex")){let i=e.playInStepIndex;i&&(oe.soundsPlaying=i);}if(e.hasOwnProperty("sounds")){let i=e.sounds;for(let s in i){let n=i[s],o=!1,a=this.add(s,{...n.options,autoPlay:!1});if(s in oe.soundsPlaying){let u=oe.soundsPlaying[s];(n.options.loop||u.options&&typeof u.options=="object"&&u.options.loop||u.stepIndex===t)&&(o=!0),n.filters&&(a.filters=Em(n.filters)),o&&a.play();}}}if(e.hasOwnProperty("soundsPlaying")){let i=e.soundsPlaying;for(let s in i){let n=i[s];oe.soundsPlaying[s]={paused:n.paused,stepIndex:n.stepIndex,options:n.options};let o=i[s].sound,a=!1,u;if(this.exists(s)?(u=this.find(s),o.options.url=u.options.url,o.options.volume=u.options.volume,u.options=o.options,u.autoPlay=!1,u.filters=o.filters?Em(o.filters):[]):u=this.add(s,{...o.options,autoPlay:!1}),s in oe.soundsPlaying){let l=oe.soundsPlaying[s];(o.options.loop||l.options&&typeof l.options=="object"&&l.options.loop||l.stepIndex===t)&&(a=!0),o.filters&&(u.filters=Em(o.filters)),a&&u.play();}}}else {E.error("The data does not have the properties soundsPlaying");return}}catch(i){E.error("Error importing data",i);}}};var Po=new Am;Re();function yG(){console.info(`
3315
+ `}function J8(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=Lk(u),h=n.length===0&&l;if(l&&!c&&h)return;c||(n+=u);let d=st.measureText(u,t);o.push({char:u,metric:d}),n.length>=s.length&&(i.push({line:n,chars:o,width:o.reduce((f,m)=>f+m.metric.width,0)}),o=[],n="",a++,s=e.lines[a]);}),i}function S0(r){let{text:e,style:t,chars:i}=r,s=t,n=st.measureText(e,s),o=st.graphemeSegmenter(e),a=J8(o,n,s.clone()),u=s.align,l=n.lineWidths.reduce((x,g)=>Math.max(x,g),0),c=[],h=[],d=[],f=0,m=s.stroke?.width||0,_=s.dropShadow?.distance||0;return a.forEach((x,g)=>{let y=new J({label:`line-${g}`});y.y=f,h.push(y);let v=n.lineWidths[g],S=Q8(u,v,l),C=new J({label:"word"});C.x=S,x.chars.forEach((A,M)=>{if(A.metric.width!==0){if(Lk(A.char)){S+=A.metric.width-m;return}if(A.char===" ")C.children.length>0&&(d.push(C),y.addChild(C)),S+=A.metric.width+s.letterSpacing-m,C=new J({label:"word"}),C.x=S;else {let D;i.length>0?(D=i.shift(),D.text=A.char,D.style=s,D.setFromMatrix(O.IDENTITY),D.x=S-C.x-_*M):D=new Cr({text:A.char,style:s,x:S-C.x-_*M}),c.push(D),C.addChild(D),S+=A.metric.width+s.letterSpacing-m;}}}),C.children.length>0&&(d.push(C),y.addChild(C)),f+=n.lineHeight;}),{chars:c,lines:h,words:d}}var Rw=p(()=>{Te();Yt();Gs();cp();});var Nk,Vk,Hk=p(()=>{Ei();Rw();v0();Nk=class E0 extends no{constructor(e){let t={...E0.defaultOptions,...e};super(t);}static from(e,t){let i={...E0.defaultOptions,...t,text:e.text,style:new ht(e.style)};return new E0({...i})}splitFn(){return S0({text:this._originalText,style:this._style,chars:this._canReuseChars?this.chars:[]})}};Nk.defaultOptions={autoSplit:true,lineAnchor:0,wordAnchor:0,charAnchor:0};Vk=Nk;});async function zk(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 Wk=p(()=>{});function Bw(r,e=0,t={color:"#000000"}){r.renderGroup&&(t.color=eN[tN++]);let i="";for(let o=0;o<e;o++)i+=" ";let s=r.label;!s&&r instanceof De&&(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];Bw(a,e,{...t});}}function Iw(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];Iw(o,e,{...t,index:n});}}var eN,tN,Xk=p(()=>{mn();eN=["#000080","#228B22","#8B0000","#4169E1","#008080","#800000","#9400D3","#FF8C00","#556B2F","#8B008B"],tN=0;});var Yk={};vs(Yk,{AbstractBitmapFont:()=>Gn,AbstractRenderer:()=>rs,AbstractSplitText:()=>no,AbstractText:()=>cs,AccessibilitySystem:()=>cg,AlphaFilter:()=>lD,AlphaMask:()=>Xo,AlphaMaskPipe:()=>Da,AnimatedSprite:()=>$c,Application:()=>Mf,ApplicationInitHook:()=>Ba,Assets:()=>exports.Assets,AssetsClass:()=>Of,BLEND_TO_NPM:()=>Rg,BUFFER_TYPE:()=>su,BackgroundLoader:()=>yc,BackgroundSystem:()=>X_,Batch:()=>ud,BatchGeometry:()=>ml,BatchTextureArray:()=>pl,BatchableGraphics:()=>ks,BatchableHTMLText:()=>Hl,BatchableMesh:()=>Zi,BatchableSprite:()=>ri,BatchableText:()=>Rl,Batcher:()=>Og,BatcherPipe:()=>mf,BigPool:()=>He,BindGroup:()=>Tt,BindGroupSystem:()=>Va,BitmapFont:()=>gu,BitmapFontManager:()=>Ai,BitmapText:()=>so,BitmapTextGraphics:()=>Gd,BitmapTextPipe:()=>fa,BlendModeFilter:()=>ce,BlendModePipe:()=>Fa,BlurFilter:()=>sp,BlurFilterPass:()=>jc,Bounds:()=>Me,BrowserAdapter:()=>_g,Buffer:()=>rt,BufferImageSource:()=>As,BufferResource:()=>ns,BufferUsage:()=>fe,CLEAR:()=>St,Cache:()=>Ee,CanvasObserver:()=>dn,CanvasPool:()=>fr,CanvasPoolClass:()=>Dd,CanvasSource:()=>Rt,CanvasTextGenerator:()=>Us,CanvasTextMetrics:()=>st,CanvasTextPipe:()=>aa,CanvasTextSystem:()=>da,Circle:()=>Bl,Color:()=>te,ColorBlend:()=>Wd,ColorBurnBlend:()=>Xd,ColorDodgeBlend:()=>Yd,ColorMask:()=>Yo,ColorMaskPipe:()=>ka,ColorMatrixFilter:()=>Jy,CompressedSource:()=>si,Container:()=>J,Culler:()=>ky,CullerPlugin:()=>zf,CustomRenderPipe:()=>Aa,D3D10_RESOURCE_DIMENSION:()=>Cy,D3DFMT:()=>pr,DATA_URI:()=>qR,DDS:()=>ae,DEG_TO_RAD:()=>km,DEPRECATED_SCALE_MODES:()=>fp,DEPRECATED_WRAP_MODES:()=>dp,DOMAdapter:()=>H,DOMContainer:()=>xg,DOMPipe:()=>zo,DRAW_MODES:()=>zD,DXGI_FORMAT:()=>Ay,DXGI_TO_TEXTURE_FORMAT:()=>ir,DarkenBlend:()=>jd,DefaultBatcher:()=>Zo,DefaultShader:()=>yl,DifferenceBlend:()=>$d,DisplacementFilter:()=>r0,DivideBlend:()=>qd,DynamicBitmapFont:()=>Od,Ellipse:()=>Il,EventBoundary:()=>nl,EventEmitter:()=>ve,EventSystem:()=>ol,EventsTicker:()=>jr,ExclusionBlend:()=>Kd,ExtensionType:()=>b,ExtractSystem:()=>Y_,FOURCC_TO_TEXTURE_FORMAT:()=>Nf,FederatedContainer:()=>gg,FederatedEvent:()=>$i,FederatedMouseEvent:()=>xi,FederatedPointerEvent:()=>jt,FederatedWheelEvent:()=>$r,FillGradient:()=>tr,FillPattern:()=>Ti,Filter:()=>Gt,FilterEffect:()=>pi,FilterPipe:()=>ba,FilterSystem:()=>ya,FontStylePromiseCache:()=>Ud,GAUSSIAN_VALUES:()=>Yc,GL_FORMATS:()=>hc,GL_INTERNAL_FORMAT:()=>EC,GL_TARGETS:()=>Tf,GL_TYPES:()=>Ce,GL_WRAP_MODES:()=>Z1,GenerateTextureSystem:()=>Ga,Geometry:()=>Jt,GlBackBufferSystem:()=>Sb,GlBatchAdaptor:()=>iu,GlBuffer:()=>cc,GlBufferSystem:()=>nu,GlColorMaskSystem:()=>au,GlContextSystem:()=>yb,GlEncoderSystem:()=>uu,GlGeometrySystem:()=>ou,GlGraphicsAdaptor:()=>tu,GlLimitsSystem:()=>lu,GlMeshAdaptor:()=>ru,GlParticleContainerAdaptor:()=>Al,GlParticleContainerPipe:()=>sa,GlProgram:()=>je,GlProgramData:()=>pc,GlRenderTarget:()=>dc,GlRenderTargetAdaptor:()=>fc,GlRenderTargetSystem:()=>du,GlShaderSystem:()=>fu,GlStateSystem:()=>Wb,GlStencilSystem:()=>cu,GlTexture:()=>gc,GlTextureSystem:()=>mu,GlUboSystem:()=>hu,GlUniformGroupSystem:()=>pu,GlobalUniformSystem:()=>Ua,GpuBatchAdaptor:()=>Ea,GpuBlendModesToPixi:()=>Kt,GpuBufferSystem:()=>Ha,GpuColorMaskSystem:()=>za,GpuDeviceSystem:()=>$n,GpuEncoderSystem:()=>Wa,GpuGraphicsAdaptor:()=>Ta,GpuGraphicsContext:()=>vd,GpuLimitsSystem:()=>Xa,GpuMeshAdapter:()=>Sa,GpuMipmapGenerator:()=>lc,GpuParticleContainerAdaptor:()=>Pl,GpuParticleContainerPipe:()=>na,GpuProgram:()=>$e,GpuRenderTarget:()=>oc,GpuRenderTargetAdaptor:()=>ac,GpuRenderTargetSystem:()=>Za,GpuShaderSystem:()=>Qa,GpuStateSystem:()=>Ja,GpuStencilModesToPixi:()=>ii,GpuStencilSystem:()=>Ya,GpuTextureSystem:()=>eu,GpuUboSystem:()=>$a,GpuUniformBatchPipe:()=>qa,Graphics:()=>Fn,GraphicsContext:()=>bt,GraphicsContextRenderData:()=>Td,GraphicsContextSystem:()=>Rn,GraphicsGpuData:()=>Ed,GraphicsPath:()=>Qi,GraphicsPipe:()=>ra,HTMLText:()=>Qc,HTMLTextPipe:()=>pa,HTMLTextRenderData:()=>Ln,HTMLTextStyle:()=>Zc,HTMLTextSystem:()=>ma,HardLightBlend:()=>Zd,HardMixBlend:()=>Qd,HelloSystem:()=>jn,IGLUniformData:()=>Mb,ImageSource:()=>Qt,InstructionSet:()=>on,KTX:()=>at,LightenBlend:()=>Jd,LinearBurnBlend:()=>ef,LinearDodgeBlend:()=>tf,LinearLightBlend:()=>rf,Loader:()=>Sc,LoaderParserPriority:()=>ze,LuminosityBlend:()=>sf,MaskEffectManager:()=>Qu,MaskEffectManagerClass:()=>zh,MaskFilter:()=>Kl,Matrix:()=>O,Mesh:()=>Ar,MeshGeometry:()=>yr,MeshGpuData:()=>El,MeshPipe:()=>ia,MeshPlane:()=>g0,MeshRope:()=>Tk,MeshSimple:()=>_0,NOOP:()=>$h,NegationBlend:()=>nf,NineSliceGeometry:()=>Ci,NineSlicePlane:()=>b0,NineSliceSprite:()=>Pw,NineSliceSpriteGpuData:()=>Vd,NineSliceSpritePipe:()=>_a,NoiseFilter:()=>_D,ObservablePoint:()=>ke,OverlayBlend:()=>of,PI_2:()=>Im,Particle:()=>Pk,ParticleBuffer:()=>Cl,ParticleContainer:()=>Bk,ParticleContainerPipe:()=>Bn,ParticleShader:()=>wl,PerspectiveMesh:()=>mk,PerspectivePlaneGeometry:()=>eh,PinLightBlend:()=>af,PipelineSystem:()=>Ka,PlaneGeometry:()=>Hn,Point:()=>ge,Polygon:()=>Dn,Pool:()=>Ss,PoolGroupClass:()=>Vh,PrepareBase:()=>n0,PrepareQueue:()=>Kc,PrepareSystem:()=>hp,PrepareUpload:()=>Jc,QuadGeometry:()=>Xl,RAD_TO_DEG:()=>Dm,Rectangle:()=>exports.Rectangle,RenderContainer:()=>d0,RenderGroup:()=>rl,RenderGroupPipe:()=>wa,RenderGroupSystem:()=>Ma,RenderLayer:()=>uk,RenderTarget:()=>Na,RenderTargetSystem:()=>Zn,RenderTexture:()=>Zl,RenderableGCSystem:()=>K_,RendererInitHook:()=>Ia,RendererType:()=>qe,ResizePlugin:()=>Vo,Resolver:()=>qt,RopeGeometry:()=>x0,RoundedRectangle:()=>Dl,SCALE_MODES:()=>YD,STENCIL_MODES:()=>Ve,SVGParser:()=>Yx,SaturationBlend:()=>uf,SchedulerSystem:()=>La,ScissorMask:()=>c0,SdfShader:()=>Nl,Shader:()=>it,ShaderStage:()=>Tn,ShapePath:()=>Gl,SharedRenderPipes:()=>tc,SharedSystems:()=>ec,SoftLightBlend:()=>lf,SplitBitmapText:()=>Gk,SplitText:()=>Vk,Sprite:()=>De,SpritePipe:()=>Ra,Spritesheet:()=>id,State:()=>Ze,StencilMask:()=>jo,StencilMaskPipe:()=>Oa,SubtractBlend:()=>cf,SystemRunner:()=>Xn,TEXTURE_FORMAT_BLOCK_SIZE:()=>wy,Text:()=>Cr,TextStyle:()=>ht,Texture:()=>exports.Texture,TextureGCSystem:()=>Z_,TextureMatrix:()=>un,TexturePool:()=>Oe,TexturePoolClass:()=>qh,TextureSource:()=>xe,TextureStyle:()=>mt,TextureUvs:()=>h0,Ticker:()=>_e,TickerListener:()=>hn,TickerPlugin:()=>Ho,TilingSprite:()=>a0,TilingSpriteGpuData:()=>Ld,TilingSpritePipe:()=>xa,TilingSpriteShader:()=>Wl,Transform:()=>qc,Triangle:()=>s0,UNIFORM_TO_ARRAY_SETTERS:()=>Vb,UNIFORM_TO_SINGLE_SETTERS:()=>Nb,UNIFORM_TYPES_MAP:()=>ix,UNIFORM_TYPES_VALUES:()=>pd,UPDATE_BLEND:()=>il,UPDATE_COLOR:()=>No,UPDATE_PRIORITY:()=>exports.UPDATE_PRIORITY,UPDATE_TRANSFORM:()=>B3,UPDATE_VISIBLE:()=>ln,UboBatch:()=>sc,UboSystem:()=>qn,UniformGroup:()=>be,VERSION:()=>Yn,VideoSource:()=>Ms,ViewContainer:()=>gt,ViewSystem:()=>eb,ViewableBuffer:()=>qr,VividLightBlend:()=>hf,WGSL_ALIGN_SIZE_DATA:()=>ja,WGSL_TO_STD40_SIZE:()=>Sf,WRAP_MODES:()=>XD,WebGLRenderer:()=>Pf,WebGPURenderer:()=>vf,WebWorkerAdapter:()=>nD,WorkerManager:()=>kf,accessibilityTarget:()=>hg,addBits:()=>cd,addMaskBounds:()=>gn,addMaskLocalBounds:()=>xn,addProgramDefines:()=>Lg,alphaFrag:()=>Xy,alphaWgsl:()=>ip,applyMatrix:()=>v_,applyProjectiveTransformationToPlane:()=>f0,applyStyleParams:()=>wf,assignWithIgnore:()=>Lo,autoDetectEnvironment:()=>WR,autoDetectRenderer:()=>ey,autoDetectSource:()=>nM,basisTranscoderUrls:()=>Dc,bgr2rgb:()=>Es,bitmapFontCachePlugin:()=>ty,bitmapFontTextParser:()=>bc,bitmapFontXMLParser:()=>Rf,bitmapFontXMLStringParser:()=>Bf,bitmapTextSplit:()=>y0,blendTemplateFrag:()=>C_,blendTemplateVert:()=>w_,blendTemplateWgsl:()=>P_,blockDataMap:()=>yf,blurTemplateWgsl:()=>Ky,boundsPool:()=>dr,browserExt:()=>SE,buildAdaptiveBezier:()=>Ol,buildAdaptiveQuadratic:()=>Fx,buildArc:()=>Fl,buildArcTo:()=>Ux,buildArcToSvg:()=>Lx,buildCircle:()=>Mn,buildContextBatches:()=>Ax,buildEllipse:()=>lx,buildLine:()=>px,buildPixelLine:()=>mx,buildPolygon:()=>vx,buildRectangle:()=>Tx,buildRoundedRectangle:()=>cx,buildSimpleUvs:()=>ax,buildTriangle:()=>Sx,buildUvs:()=>ox,cacheAsTextureMixin:()=>Um,cacheTextureArray:()=>iy,calculateProjection:()=>fb,canvasTextSplit:()=>S0,checkChildrenDidChange:()=>Xh,checkDataUrl:()=>vr,checkExtension:()=>nt,checkMaxIfStatementsInShader:()=>dl,childrenHelperMixin:()=>Nm,cleanArray:()=>q_,cleanHash:()=>$_,clearList:()=>Pa,closePointEps:()=>hx,collectAllRenderables:()=>ek,collectRenderablesMixin:()=>Vm,color32BitToUniform:()=>ti,colorBit:()=>En,colorBitGl:()=>An,colorMatrixFilterFrag:()=>Qy,colorMatrixFilterWgsl:()=>np,colorToUniform:()=>UM,compareModeToGlCompare:()=>Kb,compileHighShader:()=>qg,compileHighShaderGl:()=>Kg,compileHighShaderGlProgram:()=>Zr,compileHighShaderGpuProgram:()=>Kr,compileHooks:()=>hd,compileInputs:()=>dd,compileOutputs:()=>$g,compileShader:()=>Ef,compute2DProjection:()=>m0,convertFormatIfRequired:()=>QB,convertToList:()=>$t,copySearchParams:()=>Wo,createIdFromString:()=>vi,createIndicesForQuads:()=>Cd,createLevelBuffers:()=>UB,createLevelBuffersFromKTX:()=>eI,createStringVariations:()=>bg,createTexture:()=>rr,createUboElementsSTD40:()=>Eb,createUboElementsWGSL:()=>ib,createUboSyncFunction:()=>rc,createUboSyncFunctionSTD40:()=>wb,createUboSyncFunctionWGSL:()=>cb,crossOrigin:()=>dC,cullingMixin:()=>Bm,curveEps:()=>dx,defaultFilterVert:()=>ro,defaultValue:()=>mc,definedProps:()=>Ot,deprecation:()=>G,detectAvif:()=>ny,detectBasis:()=>BB,detectCompressed:()=>aI,detectDefaults:()=>oy,detectMp4:()=>ay,detectOgv:()=>uy,detectVideoAlphaMode:()=>ll,detectWebm:()=>ly,detectWebp:()=>cy,determineCrossOrigin:()=>pC,displacementFrag:()=>e0,displacementVert:()=>t0,displacementWgsl:()=>op,earcut:()=>bx,effectsMixin:()=>Hm,ensureAttributes:()=>nc,ensureIsBuffer:()=>ld,ensurePrecision:()=>Ng,ensureTextOptions:()=>io,executeInstructions:()=>Ca,extensions:()=>V,extractAttributesFromGlProgram:()=>kb,extractAttributesFromGpuProgram:()=>Wg,extractFontFamilies:()=>l_,extractStructAndGroups:()=>xl,extractSvgUrlId:()=>Bd,fastCopy:()=>Ko,findMixin:()=>zm,fontStringFromTextStyle:()=>Fs,formatShader:()=>OD,fragmentGPUTemplate:()=>Qg,fragmentGlTemplate:()=>ex,generateArraySyncSTD40:()=>Cb,generateArraySyncWGSL:()=>lb,generateBlurFragSource:()=>jy,generateBlurGlProgram:()=>qy,generateBlurProgram:()=>Zy,generateBlurVertSource:()=>$y,generateGPULayout:()=>BD,generateGpuLayoutGroups:()=>Xg,generateLayout:()=>DD,generateLayoutHash:()=>Yg,generateParticleUpdateFunction:()=>Cx,generateProgram:()=>Ub,generateShaderSyncCode:()=>Pb,generateTextStyleKey:()=>$x,generateTextureBatchBit:()=>Cn,generateTextureBatchBitGl:()=>wn,generateTextureMatrix:()=>Ex,generateUniformsSync:()=>Hb,getAdjustedBlendModeBlend:()=>yi,getAttributeInfoFromFormat:()=>er,getBatchSamplersUniformGroup:()=>Pn,getBitmapTextLayout:()=>Un,getCanvasBoundingBox:()=>Kx,getCanvasFillStyle:()=>On,getCanvasTexture:()=>Jl,getDefaultUniformValue:()=>sx,getFastGlobalBounds:()=>ZD,getFastGlobalBoundsMixin:()=>Xm,getFontCss:()=>d_,getFontFamilyName:()=>iC,getGeometryBounds:()=>Fg,getGlTypeFromFormat:()=>Tb,getGlobalBounds:()=>Yi,getGlobalMixin:()=>$m,getGlobalRenderableBounds:()=>A_,getLocalBounds:()=>nn,getMaxFragmentPrecision:()=>Ug,getMaxTexturesPerBatch:()=>kg,getOrientationOfPoints:()=>fx,getPo2TextureFromSource:()=>Ll,getResolutionOfUrl:()=>Jn,getSVGUrl:()=>f_,getSupportedCompressedTextureFormats:()=>Rc,getSupportedGPUCompressedTextureFormats:()=>Gf,getSupportedGlCompressedTextureFormats:()=>Ff,getSupportedTextureFormats:()=>as,getTemporaryCanvasFromImage:()=>p_,getTestContext:()=>hl,getTextureBatchBindGroup:()=>_n,getTextureDefaultMatrix:()=>Ak,getTextureFormatFromKTXTexture:()=>rI,getUboData:()=>Ob,getUniformData:()=>Fb,getUrlExtension:()=>ST,glFormatToGPUFormat:()=>By,glUploadBufferImageResource:()=>Xb,glUploadCompressedTextureResource:()=>Yb,glUploadImageResource:()=>xc,glUploadVideoResource:()=>$b,globalUniformsBit:()=>tx,globalUniformsBitGl:()=>rx,globalUniformsUBOBitGl:()=>bM,gpuFormatToBasisTranscoderFormat:()=>NB,gpuFormatToKTXBasisTranscoderFormat:()=>sI,gpuUploadBufferImageResource:()=>gb,gpuUploadCompressedTextureResource:()=>xb,gpuUploadImageResource:()=>uc,gpuUploadVideoResource:()=>bb,groupD8:()=>le,hasCachedCanvasTexture:()=>sB,hslWgsl:()=>yD,hslgl:()=>zn,hslgpu:()=>Wn,injectBits:()=>fd,insertVersion:()=>Vg,isMobile:()=>lg,isPow2:()=>Yh,isRenderingToScreen:()=>pb,isSafari:()=>a_,isSingleItem:()=>Ps,isWebGLSupported:()=>is,isWebGPUSupported:()=>ss,ktxTranscoderUrls:()=>Oc,loadBasis:()=>FB,loadBasisOnWorker:()=>Ey,loadBitmapFont:()=>ry,loadDDS:()=>HB,loadEnvironmentExtensions:()=>df,loadFontAsBase64:()=>c_,loadFontCSS:()=>h_,loadImageBitmap:()=>lC,loadJson:()=>hy,loadKTX:()=>WB,loadKTX2:()=>qB,loadKTX2onWorker:()=>Ry,loadSVGImage:()=>m_,loadSvg:()=>py,loadTextures:()=>wc,loadTxt:()=>dy,loadVideoTextures:()=>gy,loadWebFont:()=>fy,localUniformBit:()=>Ls,localUniformBitGl:()=>Vn,localUniformBitGroup2:()=>x_,localUniformMSDFBit:()=>e_,localUniformMSDFBitGl:()=>t_,log2:()=>S3,logDebugTexture:()=>zk,logProgramError:()=>Gb,logRenderGroupScene:()=>Iw,logScene:()=>Bw,mSDFBit:()=>r_,mSDFBitGl:()=>i_,mapFormatToGlFormat:()=>Zb,mapFormatToGlInternalFormat:()=>Qb,mapFormatToGlType:()=>Jb,mapGlToVertexFormat:()=>Ib,mapSize:()=>ND,mapType:()=>Af,mapWebGLBlendModesToPixi:()=>zb,maskFrag:()=>z_,maskVert:()=>W_,maskWgsl:()=>gf,matrixPool:()=>pt,measureHtmlText:()=>zl,measureMixin:()=>Km,migrateFragmentFromV7toV8:()=>UD,mipmapScaleModeToGlFilter:()=>qb,multiplyColors:()=>sn,multiplyHexColors:()=>el,nextPow2:()=>mi,noiseFrag:()=>i0,noiseWgsl:()=>ap,nonCompressedFormats:()=>bC,normalizeExtensionPriority:()=>qu,onRenderMixin:()=>Zm,parseDDS:()=>Py,parseFunctionBody:()=>qD,parseKTX:()=>My,parseSVGDefinitions:()=>Wx,parseSVGFloatAttribute:()=>Ke,parseSVGPath:()=>Bx,parseSVGStyle:()=>Id,particleData:()=>pp,particlesFrag:()=>wx,particlesVert:()=>Px,particlesWgsl:()=>wd,path:()=>We,pointInTriangle:()=>up,preloadVideo:()=>fC,removeItems:()=>Zu,removeStructAndGroupDuplicates:()=>jg,resetUids:()=>g3,resolveCharacters:()=>n_,resolveCompressedTextureUrl:()=>oI,resolveJsonUrl:()=>_y,resolveTextureUrl:()=>Pc,resourceToTexture:()=>DT,roundPixelsBit:()=>Qr,roundPixelsBitGl:()=>Jr,roundedShapeArc:()=>Nx,roundedShapeQuadraticCurve:()=>Vx,sayHello:()=>j_,scaleModeToGlFilter:()=>Cf,setBasisTranscoderPath:()=>kB,setKTXTranscoderPath:()=>jB,setPositions:()=>y_,setProgramName:()=>Hg,setUvs:()=>T_,shapeBuilders:()=>Sl,sortMixin:()=>Qm,spritesheetAsset:()=>vg,squaredDistanceToLineSegment:()=>In,stripVersion:()=>zg,styleAttributes:()=>Xx,testImageFormat:()=>vc,testVideoFormat:()=>os,textStyleToCSS:()=>l0,textureBit:()=>D_,textureBitGl:()=>k_,textureFrom:()=>kT,tilingBit:()=>__,tilingBitGl:()=>b_,toFillStyle:()=>Si,toLocalGlobalMixin:()=>Jm,toStrokeStyle:()=>kn,transformVertices:()=>gd,triangulateWithHoles:()=>Tl,uboSyncFunctionsSTD40:()=>_f,uboSyncFunctionsWGSL:()=>ab,uid:()=>de,uniformParsers:()=>wi,unpremultiplyAlpha:()=>gB,unsafeEvalSupported:()=>Yl,updateLocalTransform:()=>rk,updateQuadBounds:()=>ul,updateRenderGroupTransform:()=>FE,updateRenderGroupTransforms:()=>pf,updateTextBounds:()=>oa,updateTransformAndChildren:()=>L_,updateTransformBackwards:()=>Ju,updateWorldTransform:()=>sk,v8_0_0:()=>Y,v8_3_4:()=>Fm,validFormats:()=>Fc,validateRenderables:()=>N_,vertexGPUTemplate:()=>Zg,vertexGlTemplate:()=>Jg,vkFormatToGPUFormat:()=>Iy,warn:()=>U,webworkerExt:()=>EE,wrapModeToGlAddress:()=>_c});var Re=p(()=>{_R();yR();P();P();wg();Tg();cT();hT();SR();ER();AR();CR();wR();PR();MR();RR();BR();IR();DR();kR();OR();FR();GR();UR();LR();NR();VR();HR();zR();EB();dT();fT();RB();YA();qi();jA();$A();qA();KA();ZA();QA();JA();sy();Tc();eC();Ir();tC();rC();sC();nC();my();mC();Ns();uC();gC();xy();pn();Qn();Fr();al();yg();TT();td();vt();IB();GB();LB();VB();yC();vC();TC();zB();SC();XB();CC();AC();KB();JB();tI();iI();RC();nI();wC();BC();PC();uI();IC();kC();lI();Uv();ag();Z3();yT();Be();RE();vT();oD();gT();mg();dg();Kh();bT();Qh();fg();pg();CE();wE();PE();vD();KC();ZC();tw();sw();nw();rp();ow();aw();uw();lw();cw();zE();WE();XE();dt();Hd();zd();cD();fD();iw();Yy();QC();ew();JC();rw();pD();mD();bD();ts();Hh();_E();vE();YE();jh();Te();Om();tl();Ix();tn();_r();hw();d2();f2();p2();xt();m2();TD();dw();gw();RD();yw();X1();Dg();FT();ID();kD();od();DE();LT();HE();HT();GT();nx();bS();Is();dS();oS();aS();uS();lS();FD();cS();fS();_l();bl();pS();ga();Ds();O_();CT();$E();wT();qE();Wv();GD();PT();KE();sd();nd();LA();Y1();j1();$1();va();K1();J1();Q1();tA();rA();iA();sA();lA();nA();uA();cA();hA();dA();md();br();fA();vA();EA();LD();pA();Rb();hb();gA();yA();WT();Ig();xA();_A();bA();VD();Db();XT();YT();jT();$T();qT();Ab();aA();oA();SA();TA();wA();AA();vb();PA();GA();MA();RA();jb();BA();DA();xC();kA();OA();FA();IA();xB();UA();g1();x1();C1();_1();b1();y1();v1();T1();A1();w1();P1();M1();B1();I1();D1();Rs();Dr();k1();sb();E1();JT();eS();S1();rS();iS();sS();O1();F1();db();V1();G1();U1();_b();L1();_C();N1();H1();QE();JE();Bs();bf();Ki();Mg();r1();s1();WD();yn();vS();NT();vn();VT();TS();eg();n1();R1();Q_();mb();o1();tS();ei();xS();rb();_t();ob();_S();ub();nb();u1();bn();cl();Or();jl();tb();R_();ca();jD();h1();i1();rg();$o();Mc();qo();Mt();Cg();Se();f1();ig();gi();ji();$D();J_();Ty();Bc();OT();gl();KD();m1();kr();e2();t2();r2();Xt();QD();ko();Wh();bE();rn();Vv();Hv();zv();Xv();Yv();jv();qm();qv();Kv();Zv();Qv();Yt();kE();JD();tT();OE();LE();sg();$v();U_();tk();an();G_();jm();Ym();ik();GE();nk();UE();z1();ta();BE();ux();Ox();b2();Gx();y2();S2();SS();AS();CS();RS();BS();IS();AM();ea();Pd();Jx();la();Sd();YS();Hx();E2();A2();C2();zx();h2();P2();M2();w2();FS();jx();OS();ES();yx();lk();gk();Sw();vw();Tw();xk();Nd();Sk();Ek();Ew();W1();IE();Ad();Ck();_u();Nn();$S();KS();n2();s2();o2();Mk();JS();Ik();Mx();Cw();i2();ZS();QS();fw();E_();Ok();gE();oE();lE();mw();pE();dE();cE();hE();fE();Ml();mn();NE();s_();HA();zA();WA();XA();VA();Vl();u0();Y2();z2();Mw();Fd();W2();$2();bw();q2();u_();_w();sE();Z2();eE();tE();rE();Q2();J2();iE();g_();xw();v0();Uk();Hk();lp();u2();Qx();Gs();l2();F2();kd();Zx();H2();U2();L2();cp();Ei();Rw();B2();qx();Rx();_i();ET();AT();cn();Cs();sT();Eg();uT();K2();$l();ql();M_();D2();V_();Wt();l1();Lm();Pt();Sg();Pg();H_();Pe();Wk();Xk();Ae();eT();pw();If();fn();Gm();Xi();a1();MS();V.add(SE,EE);});var rO=Wi((k0,tO)=>{(function(r,e){typeof k0=="object"?tO.exports=k0=e():typeof define=="function"&&define.amd?define([],e):r.CryptoJS=e();})(k0,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 Mv=="function")try{i=Mv("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 g(){}return function(y){var v;return g.prototype=y,v=new g,g.prototype=null,v}}(),o={},a=o.lib={},u=a.Base=function(){return {extend:function(g){var y=n(this);return g&&y.mixIn(g),(!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 g=this.extend();return g.init.apply(g,arguments),g},init:function(){},mixIn:function(g){for(var y in g)g.hasOwnProperty(y)&&(this[y]=g[y]);g.hasOwnProperty("toString")&&(this.toString=g.toString);},clone:function(){return this.init.prototype.extend(this)}}}(),l=a.WordArray=u.extend({init:function(g,y){g=this.words=g||[],y!=t?this.sigBytes=y:this.sigBytes=g.length*4;},toString:function(g){return (g||h).stringify(this)},concat:function(g){var y=this.words,v=g.words,S=this.sigBytes,C=g.sigBytes;if(this.clamp(),S%4)for(var A=0;A<C;A++){var M=v[A>>>2]>>>24-A%4*8&255;y[S+A>>>2]|=M<<24-(S+A)%4*8;}else for(var D=0;D<C;D+=4)y[S+D>>>2]=v[D>>>2];return this.sigBytes+=C,this},clamp:function(){var g=this.words,y=this.sigBytes;g[y>>>2]&=4294967295<<32-y%4*8,g.length=e.ceil(y/4);},clone:function(){var g=u.clone.call(this);return g.words=this.words.slice(0),g},random:function(g){for(var y=[],v=0;v<g;v+=4)y.push(s());return new l.init(y,g)}}),c=o.enc={},h=c.Hex={stringify:function(g){for(var y=g.words,v=g.sigBytes,S=[],C=0;C<v;C++){var A=y[C>>>2]>>>24-C%4*8&255;S.push((A>>>4).toString(16)),S.push((A&15).toString(16));}return S.join("")},parse:function(g){for(var y=g.length,v=[],S=0;S<y;S+=2)v[S>>>3]|=parseInt(g.substr(S,2),16)<<24-S%8*4;return new l.init(v,y/2)}},d=c.Latin1={stringify:function(g){for(var y=g.words,v=g.sigBytes,S=[],C=0;C<v;C++){var A=y[C>>>2]>>>24-C%4*8&255;S.push(String.fromCharCode(A));}return S.join("")},parse:function(g){for(var y=g.length,v=[],S=0;S<y;S++)v[S>>>2]|=(g.charCodeAt(S)&255)<<24-S%4*8;return new l.init(v,y)}},f=c.Utf8={stringify:function(g){try{return decodeURIComponent(escape(d.stringify(g)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(g){return d.parse(unescape(encodeURIComponent(g)))}},m=a.BufferedBlockAlgorithm=u.extend({reset:function(){this._data=new l.init,this._nDataBytes=0;},_append:function(g){typeof g=="string"&&(g=f.parse(g)),this._data.concat(g),this._nDataBytes+=g.sigBytes;},_process:function(g){var y,v=this._data,S=v.words,C=v.sigBytes,A=this.blockSize,M=A*4,D=C/M;g?D=e.ceil(D):D=e.max((D|0)-this._minBufferSize,0);var R=D*A,L=e.min(R*4,C);if(R){for(var F=0;F<R;F+=A)this._doProcessBlock(S,F);y=S.splice(0,R),v.sigBytes-=L;}return new l.init(y,L)},clone:function(){var g=u.clone.call(this);return g._data=this._data.clone(),g},_minBufferSize:0});a.Hasher=m.extend({cfg:u.extend(),init:function(g){this.cfg=this.cfg.extend(g),this.reset();},reset:function(){m.reset.call(this),this._doReset();},update:function(g){return this._append(g),this._process(),this},finalize:function(g){g&&this._append(g);var y=this._doFinalize();return y},blockSize:512/32,_createHelper:function(g){return function(y,v){return new g.init(v).finalize(y)}},_createHmacHelper:function(g){return function(y,v){return new x.HMAC.init(g,v).finalize(y)}}});var x=o.algo={};return o}(Math);return r});});var Lw=Wi((O0,iO)=>{(function(r,e){typeof O0=="object"?iO.exports=O0=e(rO()):typeof define=="function"&&define.amd?define(["./core"],e):e(r.CryptoJS);})(O0,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],f=c[2],m=c[3],_=c[4],x=0;x<80;x++){if(x<16)o[x]=u[l+x]|0;else {var g=o[x-3]^o[x-8]^o[x-14]^o[x-16];o[x]=g<<1|g>>>31;}var y=(h<<5|h>>>27)+_+o[x];x<20?y+=(d&f|~d&m)+1518500249:x<40?y+=(d^f^m)+1859775393:x<60?y+=(d&f|d&m|f&m)-1894007588:y+=(d^f^m)-899497514,_=m,m=f,f=d<<30|d>>>2,d=h,h=y;}c[0]=c[0]+h|0,c[1]=c[1]+d|0,c[2]=c[2]+f|0,c[3]=c[3]+m|0,c[4]=c[4]+_|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});});Re();var VP={};vs(VP,{CanvasBaseItem:()=>Bp,CanvasEvent:()=>Rp,CanvasManagerStatic:()=>k,Container:()=>fo,FadeAlphaTicker:()=>gh,ImageContainer:()=>Ye,ImageSprite:()=>Ue,MoveTicker:()=>xh,RegisteredCanvasComponents:()=>ar,RegisteredEvents:()=>hs,RegisteredTickers:()=>ur,RotateTicker:()=>_h,Sprite:()=>ms,Text:()=>po,TickerBase:()=>Hr,VideoSprite:()=>nr,ZoomTicker:()=>bh,addImage:()=>Dp,addImageCointainer:()=>Ip,addVideo:()=>kp,animate:()=>mh,canvas:()=>I,canvasComponentDecorator:()=>fO,eventDecorator:()=>pO,getTexture:()=>Mu,moveIn:()=>CO,moveOut:()=>W0,pushIn:()=>PO,pushOut:()=>rP,removeWithDissolve:()=>Fp,removeWithFade:()=>AO,shakeEffect:()=>yO,showImage:()=>TO,showImageContainer:()=>vO,showVideo:()=>SO,showWithDissolve:()=>eP,showWithFade:()=>EO,tickerDecorator:()=>_O,zoomIn:()=>wO,zoomOut:()=>tP});Re();var Xe={};vs(Xe,{DistortionFilter:()=>A0,EqualizerFilter:()=>ni,Filter:()=>Bt,MonoFilter:()=>C0,ReverbFilter:()=>w0,StereoFilter:()=>P0,StreamFilter:()=>M0,TelephoneFilter:()=>R0});var jk;function $k(r){return jk=r,r}function Fe(){return jk}var Bt=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 A0=class extends Bt{constructor(e=0){let t;if(!Fe().useLegacy){let{audioContext:i}=Fe().context;t=i.createWaveShaper();}super(t),this._distortion=t,this.amount=e;}set amount(e){if(this._amount=e,Fe().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 Et=class{static setParamValue(e,t){if(e.setValueAtTime){let i=Fe().context;e.setValueAtTime(t,i.audioContext.currentTime);}else e.value=t;return t}};var Ge=class extends Bt{constructor(r=0,e=0,t=0,i=0,s=0,n=0,o=0,a=0,u=0,l=0){let c=[],h=[{f:Ge.F32,type:"lowshelf",gain:r},{f:Ge.F64,type:"peaking",gain:e},{f:Ge.F125,type:"peaking",gain:t},{f:Ge.F250,type:"peaking",gain:i},{f:Ge.F500,type:"peaking",gain:s},{f:Ge.F1K,type:"peaking",gain:n},{f:Ge.F2K,type:"peaking",gain:o},{f:Ge.F4K,type:"peaking",gain:a},{f:Ge.F8K,type:"peaking",gain:u},{f:Ge.F16K,type:"highshelf",gain:l}];Fe().useLegacy||(c=h.map(d=>{let f=Fe().context.audioContext.createBiquadFilter();return f.type=d.type,Et.setParamValue(f.Q,1),f.frequency.value=d.f,Et.setParamValue(f.gain,d.gain),f})),super(c[0],c[c.length-1]),this.bands=c,this.bandsMap={};for(let d=0;d<this.bands.length;d++){let f=this.bands[d];d>0&&this.bands[d-1].connect(f),this.bandsMap[f.frequency.value]=f;}}setGain(r,e=0){if(!this.bandsMap[r])throw new Error(`No band found for frequency ${r}`);Et.setParamValue(this.bandsMap[r].gain,e);}getGain(r){if(!this.bandsMap[r])throw new Error(`No band found for frequency ${r}`);return this.bandsMap[r].gain.value}set f32(r){this.setGain(Ge.F32,r);}get f32(){return this.getGain(Ge.F32)}set f64(r){this.setGain(Ge.F64,r);}get f64(){return this.getGain(Ge.F64)}set f125(r){this.setGain(Ge.F125,r);}get f125(){return this.getGain(Ge.F125)}set f250(r){this.setGain(Ge.F250,r);}get f250(){return this.getGain(Ge.F250)}set f500(r){this.setGain(Ge.F500,r);}get f500(){return this.getGain(Ge.F500)}set f1k(r){this.setGain(Ge.F1K,r);}get f1k(){return this.getGain(Ge.F1K)}set f2k(r){this.setGain(Ge.F2K,r);}get f2k(){return this.getGain(Ge.F2K)}set f4k(r){this.setGain(Ge.F4K,r);}get f4k(){return this.getGain(Ge.F4K)}set f8k(r){this.setGain(Ge.F8K,r);}get f8k(){return this.getGain(Ge.F8K)}set f16k(r){this.setGain(Ge.F16K,r);}get f16k(){return this.getGain(Ge.F16K)}reset(){this.bands.forEach(r=>{Et.setParamValue(r.gain,0);});}destroy(){this.bands.forEach(r=>{r.disconnect();}),this.bands=null,this.bandsMap=null;}},ni=Ge;ni.F32=32;ni.F64=64;ni.F125=125;ni.F250=250;ni.F500=500;ni.F1K=1e3;ni.F2K=2e3;ni.F4K=4e3;ni.F8K=8e3;ni.F16K=16e3;var C0=class extends Bt{constructor(){let e,t;if(!Fe().useLegacy){let{audioContext:i}=Fe().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 w0=class extends Bt{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(Fe().useLegacy)return;let{audioContext:e}=Fe().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 P0=class extends Bt{constructor(e=0){let t,i,s;if(!Fe().useLegacy){let{audioContext:n}=Fe().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?Et.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 M0=class extends Bt{constructor(){let e,t;if(!Fe().useLegacy){let{audioContext:i}=Fe().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 R0=class extends Bt{constructor(){let e,t;if(!Fe().useLegacy){let{audioContext:i}=Fe().context,s=i.createBiquadFilter(),n=i.createBiquadFilter(),o=i.createBiquadFilter(),a=i.createBiquadFilter();s.type="lowpass",Et.setParamValue(s.frequency,2e3),n.type="lowpass",Et.setParamValue(n.frequency,2e3),o.type="highpass",Et.setParamValue(o.frequency,500),a.type="highpass",Et.setParamValue(a.frequency,500),s.connect(n),n.connect(o),o.connect(a),e=s,t=a;}super(e,t);}};Re();var mp=class extends ve{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();}};Re();var rN=0,Dw=class extends ve{constructor(r){super(),this.id=rN++,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-Dw.PADDING),this._end=Math.min(this._end+Dw.PADDING,this._duration),this._source.onloadedmetadata=()=>{this._source&&(this._source.currentTime=e,this._source.onloadedmetadata=null,this.emit("progress",e/this._duration,this._duration),_e.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(){_e.shared.remove(this._onUpdate,this),this._internalStop(),this.emit("progress",1,this._duration),this.emit("end",this);}destroy(){_e.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}]`}},B0=Dw;B0.PADDING=.1;Re();var gp=class extends ve{init(e){this.parent=e,this._source=e.options.source||new Audio,e.url&&(this._source.src=e.url);}create(){return new B0(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();}};Re();var xp=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 bu=["ogg","oga","opus","m4a","mp3","mpeg","wav","aiff","wma","mid","caf"],kw=["audio/mpeg","audio/ogg"],yu={};function qk(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$/;bu.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(yu,i);}qk();Re();Re();var sN=0,_p=class extends ve{constructor(e){super(),this.id=sN++,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);Et.setParamValue(this._gain.gain,n*s*i),Et.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){_e.shared.remove(this._updateListener,this),e&&_e.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 vu=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 Kk=class extends vu{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(Kk.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,Et.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}},I0=Kk;I0.BUFFER_SIZE=0;var Tu=class{init(e){this.parent=e,this._nodes=new I0(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 _p(this)}get context(){return this.parent.context}get isPlayable(){return !!this._source&&!!this._source.buffer}get filters(){return this._nodes.filters}set filters(e){this._nodes.filters=e;}get duration(){return console.assert(this.isPlayable,"Sound not yet playable, no duration"),this._source.buffer.duration}get buffer(){return this._source.buffer}set buffer(e){this._source.buffer=e;}get nodes(){return this._nodes}load(e){this.source?this._decode(this.source,e):this.parent.url?this._loadUrl(e):e?e(new Error("sound.url or sound.source must be set")):console.error("sound.url or sound.source must be set");}async _loadUrl(e){let t=this.parent.url,i=await H.get().fetch(t);this._decode(await i.arrayBuffer(),e);}_decode(e,t){let i=(s,n)=>{if(s)t&&t(s);else {this.parent.isLoaded=true,this.buffer=n;let o=this.parent.autoPlayStart();t&&t(null,this.parent,o);}};e instanceof AudioBuffer?i(null,e):this.parent.context.decode(e,i);}};var th=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=Fe().useLegacy?new gp:new Tu;return new th(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:We.extname(t).slice(1)})).filter(({ext:t})=>yu[t]).sort((t,i)=>bu.indexOf(t.ext)-bu.indexOf(i.ext));if(!e)throw new Error("No supported file type found");return e.url}get context(){return Fe().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 xp(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(th._pool.length>0){let r=th._pool.pop();return r.init(this.media),r}return this.media.create()}_poolInstance(r){r.destroy(),th._pool.indexOf(r)<0&&th._pool.push(r);}},Gr=th;Gr._pool=[];Re();var rh=class r extends vu{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 ve,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 ih=class{constructor(){this.init();}init(){return this.supported&&(this._webAudioContext=new rh),this._htmlAudioContext=new mp,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 rh.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 Gr)return this._sounds[e]=t,t;let i=this._getOptions(t),s=Gr.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}};Re();Re();var Zk=r=>{let e=r.src,t=r?.alias?.[0];return (!t||r.src===t)&&(t=We.basename(e,We.extname(e))),t},Qk={extension:b.Asset,detection:{test:async()=>true,add:async r=>[...r,...bu.filter(e=>yu[e])],remove:async r=>r.filter(e=>r.includes(e))},loader:{name:"sound",extension:{type:[b.LoadParser],priority:ze.High},test(r){let e=We.extname(r).slice(1);return !!yu[e]||kw.some(t=>r.startsWith(`data:${t}`))},async load(r,e){let t=await new Promise((i,s)=>Gr.from({...e.data,url:r,preload:true,loaded(n,o){n?s(n):i(o),e.data?.loaded?.(n,o);}}));return Fe().add(Zk(e),t),t},async unload(r,e){Fe().remove(Zk(e));}}};V.add(Qk);var Ie=$k(new ih);var bp="1.3.1";var oo="repeat";function Ow(r){return {type:"pause",duration:r}}var Fw={DistortionFilter:Xe.DistortionFilter,EqualizerFilter:Xe.EqualizerFilter,MonoFilter:Xe.MonoFilter,ReverbFilter:Xe.ReverbFilter,StereoFilter:Xe.StereoFilter,StreamFilter:Xe.StreamFilter,TelephoneFilter:Xe.TelephoneFilter},Jk=["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"],wr="__game_layer__",sh="Container",D0="ImageContainer",Gw="Image",nh="Sprite",oh="Text",Uw="Video",he={CURRENT_DIALOGUE_MEMORY_KEY:"___current_dialogue_memory___",LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY:"___last_dialogue_added_in_step_memory___",CURRENT_MENU_OPTIONS_MEMORY_KEY:"___current_menu_options_memory___",LAST_MENU_OPTIONS_ADDED_IN_STEP_MEMORY_KEY:"___last_menu_options_added_in_step_memory___",CURRENT_INPUT_VALUE_MEMORY_KEY:"_input_value_",LAST_INPUT_ADDED_IN_STEP_MEMORY_KEY:"___last_input_added_in_step_memory___",CURRENT_INPUT_INFO_MEMORY_KEY:"___current_input_info_memory___",CHARACTER_CATEGORY_KEY:"___character___",ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY:"___glue___",OPENED_LABELS_COUNTER_KEY:"___opened_labels_counter___",ALL_CHOICES_MADE_KEY:"___all_choices_made___",CURRENT_STEP_TIMES_COUNTER_KEY:"___current_step_times_counter___",LAST_STEP_GLUED:"___last_step_glued___"};var E;(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)))(E||(E={}));function pe(r){try{if(typeof r>"u")return r;let e=JSON.stringify(r);return JSON.parse(e)}catch(e){throw E.error("Error creating exportable element",r,e),new Error("[Pixi\u2019VN] Error creating exportable element")}}async function eO(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(()=>(Re(),Yk))),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 nO=Fh(Lw());Re();var uN={extension:{type:"sceneProperties",name:"additional-positions"},testNode(r){return r instanceof Ue||r instanceof nr||r instanceof Ye},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 Ue||r instanceof nr||r instanceof Ye)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}}}]}},sO=uN;function lN(r,e){let t=0;return async(...i)=>{let s=Date.now();if(s-t>=e)return t=s,await r(...i)}}var j=class j{constructor(){}static get app(){if(!j._app)throw new Error("[Pixi\u2019VN] CanvasManagerStatic.app is undefined");return j._app}static get gameLayer(){let e=this.app.stage.getChildByLabel(wr);return e||(e=new J,e.label=wr,this.app.stage.addChild(e)),e}static async init(e,t,i,s,n){return j.canvasWidth=t,j.canvasHeight=i,j._app=new Mf,j.app.init({resolution:window.devicePixelRatio||1,autoDensity:true,width:t,height:i,...s}).then(()=>{let{app:o=j.app,extensions:a=[],...u}=n||{};eO({app:o,extensions:[sO,...a],...u}),j._isInitialized=true,j.addCanvasIntoHTMLElement(e),window.addEventListener("resize",j.resize),j.resize(),j.gameLayer;})}static addCanvasIntoHTMLElement(e){j._isInitialized?e.appendChild(j.app.canvas):E.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 j.htmlLayers.push(s),j.resize(),n}static removeHtmlLayer(e){let t=j.htmlLayers.find(i=>i.id===e);t&&(t.remove(),j.htmlLayers=j.htmlLayers.filter(i=>i.id!==e));}static getHtmlLayer(e){return j.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/j.canvasWidth,t/j.canvasHeight)}static get screenWidth(){return Math.floor(j.screenScale*j.canvasWidth)}static get screenHeight(){return Math.floor(j.screenScale*j.canvasHeight)}static get horizontalMargin(){return (Math.max(document.documentElement.clientWidth,window.innerWidth||0)-j.screenWidth)/2}static get verticalMargin(){return (Math.max(document.documentElement.clientHeight,window.innerHeight||0)-j.screenHeight)/2}static async resize(){await lN(async()=>{if(j._isInitialized){let i=j.app.canvas.style;i.width=`${j.screenWidth}px`,i.height=`${j.screenHeight}px`,i.marginLeft=`${j.horizontalMargin}px`,i.marginRight=`${j.horizontalMargin}px`,i.marginTop=`${j.verticalMargin}px`,i.marginBottom=`${j.verticalMargin}px`;}let t=j.htmlLayers.map(i=>{i.style.width=`${j.screenWidth}px`,i.style.height=`${j.screenHeight}px`,i.style.marginLeft=`${j.horizontalMargin}px`,i.style.marginRight=`${j.horizontalMargin}px`,i.style.marginTop=`${j.verticalMargin}px`,i.style.marginBottom=`${j.verticalMargin}px`;});await Promise.all(t);},10)();}static get childrenAliasesOrder(){return j.gameLayer.children.filter(e=>e.label).sort((e,t)=>j.gameLayer.getChildIndex(e)-j.gameLayer.getChildIndex(t)).map(e=>e.label)}static get currentTickersWithoutCreatedBySteps(){return Object.fromEntries(Object.entries(j._currentTickers).filter(([e,t])=>!t.createdByTicketSteps).map(([e,t])=>[e,{id:t.ticker.id,args:t.ticker.args,canvasElementAliases:t.ticker.canvasElementAliases,priority:t.ticker.priority,duration:t.ticker.duration,paused:t.ticker.paused}]))}static generateTickerId(e){try{return (0,nO.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]),j._currentTickersTimeouts[i]={aliases:e,ticker:t,canBeDeletedBeforeEnd:s};}static removeTickerTimeoutInfo(e){typeof e!="string"&&(e=e.toString()),j._currentTickersTimeouts[e]&&delete j._currentTickersTimeouts[e];}static removeTickerTimeout(e){typeof e!="string"&&(e=e.toString()),clearTimeout(Number(e)),j.removeTickerTimeoutInfo(e);}static removeTickerTimeoutsByAlias(e,t){Object.entries(j._currentTickersTimeouts).forEach(([i,s])=>{let n=s.aliases.filter(o=>o!==e);if(n.length===0){let o=s.canBeDeletedBeforeEnd;(!t||o)&&j.removeTickerTimeout(i);}else j._currentTickersTimeouts[i].aliases=n;});}};w(j,"_app"),w(j,"htmlLayers",[]),w(j,"canvasWidth",300),w(j,"canvasHeight",300),w(j,"_isInitialized",false),w(j,"_currentTickers",{}),w(j,"_currentTickersSequence",{}),w(j,"_currentTickersTimeouts",{}),w(j,"_tickersToCompleteOnStepEnd",{tikersIds:[],stepAlias:[]}),w(j,"_tickersOnPause",{});var k=j;Re();var ah=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,lO=new Set,Nw=typeof process=="object"&&process?process:{},cO=(r,e,t,i)=>{typeof Nw.emitWarning=="function"?Nw.emitWarning(r,e,t,i):console.error(`[${t}] ${e}: ${r}`);},U0=globalThis.AbortController,oO=globalThis.AbortSignal;if(typeof U0>"u"){oO=class{constructor(){w(this,"onabort");w(this,"_onabort",[]);w(this,"reason");w(this,"aborted",false);}addEventListener(i,s){this._onabort.push(s);}},U0=class{constructor(){w(this,"signal",new oO);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=Nw.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{r&&(r=false,cO("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 cN=r=>!lO.has(r),ao=r=>r&&r===Math.floor(r)&&r>0&&isFinite(r),hO=r=>ao(r)?r<=Math.pow(2,8)?Uint8Array:r<=Math.pow(2,16)?Uint16Array:r<=Math.pow(2,32)?Uint32Array:r<=Number.MAX_SAFE_INTEGER?uh:null:null,uh=class extends Array{constructor(e){super(e),this.fill(0);}},lh,Su=class Su{constructor(e,t){w(this,"heap");w(this,"length");if(!T(Su,lh))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0;}static create(e){let t=hO(e);if(!t)return [];ee(Su,lh,true);let i=new Su(e,t);return ee(Su,lh,false),i}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}};lh=new WeakMap,we(Su,lh,false);var Vw=Su,aO,uO,Mi,Ur,Ri,Eu,Bi,ch,hh,It,Ii,At,Je,me,mr,Lr,or,Nt,Di,Vt,ki,Oi,Nr,Fi,ho,gr,dh,z,Hw,Au,Ws,vp,Vr,dO,Cu,fh,Tp,uo,lo,zw,F0,G0,Qe,Ww,yp,co,Xw,Yw=class Yw{constructor(e){we(this,z);we(this,Mi);we(this,Ur);we(this,Ri);we(this,Eu);we(this,Bi);we(this,ch);we(this,hh);w(this,"ttl");w(this,"ttlResolution");w(this,"ttlAutopurge");w(this,"updateAgeOnGet");w(this,"updateAgeOnHas");w(this,"allowStale");w(this,"noDisposeOnSet");w(this,"noUpdateTTL");w(this,"maxEntrySize");w(this,"sizeCalculation");w(this,"noDeleteOnFetchRejection");w(this,"noDeleteOnStaleGet");w(this,"allowStaleOnFetchAbort");w(this,"allowStaleOnFetchRejection");w(this,"ignoreFetchAbort");we(this,It);we(this,Ii);we(this,At);we(this,Je);we(this,me);we(this,mr);we(this,Lr);we(this,or);we(this,Nt);we(this,Di);we(this,Vt);we(this,ki);we(this,Oi);we(this,Nr);we(this,Fi);we(this,ho);we(this,gr);we(this,dh);we(this,Au,()=>{});we(this,Ws,()=>{});we(this,vp,()=>{});we(this,Vr,()=>false);we(this,Cu,e=>{});we(this,fh,(e,t,i)=>{});we(this,Tp,(e,t,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});w(this,aO,"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:f,maxSize:m=0,maxEntrySize:_=0,sizeCalculation:x,fetchMethod:g,memoMethod:y,noDeleteOnFetchRejection:v,noDeleteOnStaleGet:S,allowStaleOnFetchRejection:C,allowStaleOnFetchAbort:A,ignoreFetchAbort:M}=e;if(t!==0&&!ao(t))throw new TypeError("max option must be a nonnegative integer");let D=t?hO(t):Array;if(!D)throw new Error("invalid max value: "+t);if(ee(this,Mi,t),ee(this,Ur,m),this.maxEntrySize=_||T(this,Ur),this.sizeCalculation=x,this.sizeCalculation){if(!T(this,Ur)&&!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(ee(this,hh,y),g!==void 0&&typeof g!="function")throw new TypeError("fetchMethod must be a function if specified");if(ee(this,ch,g),ee(this,ho,!!g),ee(this,At,new Map),ee(this,Je,new Array(t).fill(void 0)),ee(this,me,new Array(t).fill(void 0)),ee(this,mr,new D(t)),ee(this,Lr,new D(t)),ee(this,or,0),ee(this,Nt,0),ee(this,Di,Vw.create(t)),ee(this,It,0),ee(this,Ii,0),typeof l=="function"&&ee(this,Ri,l),typeof c=="function"&&ee(this,Eu,c),typeof h=="function"?(ee(this,Bi,h),ee(this,Vt,[])):(ee(this,Bi,void 0),ee(this,Vt,void 0)),ee(this,Fi,!!T(this,Ri)),ee(this,dh,!!T(this,Eu)),ee(this,gr,!!T(this,Bi)),this.noDisposeOnSet=!!d,this.noUpdateTTL=!!f,this.noDeleteOnFetchRejection=!!v,this.allowStaleOnFetchRejection=!!C,this.allowStaleOnFetchAbort=!!A,this.ignoreFetchAbort=!!M,this.maxEntrySize!==0){if(T(this,Ur)!==0&&!ao(T(this,Ur)))throw new TypeError("maxSize must be a positive integer if specified");if(!ao(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");$(this,z,dO).call(this);}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!S,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=ao(s)||s===0?s:1,this.ttlAutopurge=!!n,this.ttl=i||0,this.ttl){if(!ao(this.ttl))throw new TypeError("ttl must be a positive integer if specified");$(this,z,Hw).call(this);}if(T(this,Mi)===0&&this.ttl===0&&T(this,Ur)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!T(this,Mi)&&!T(this,Ur)){let R="LRU_CACHE_UNBOUNDED";cN(R)&&(lO.add(R),cO("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",R,Yw));}}static unsafeExposeInternals(e){return {starts:T(e,Oi),ttls:T(e,Nr),sizes:T(e,ki),keyMap:T(e,At),keyList:T(e,Je),valList:T(e,me),next:T(e,mr),prev:T(e,Lr),get head(){return T(e,or)},get tail(){return T(e,Nt)},free:T(e,Di),isBackgroundFetch:t=>{var i;return $(i=e,z,Qe).call(i,t)},backgroundFetch:(t,i,s,n)=>{var o;return $(o=e,z,G0).call(o,t,i,s,n)},moveToTail:t=>{var i;return $(i=e,z,yp).call(i,t)},indexes:t=>{var i;return $(i=e,z,uo).call(i,t)},rindexes:t=>{var i;return $(i=e,z,lo).call(i,t)},isStale:t=>{var i;return T(i=e,Vr).call(i,t)}}}get max(){return T(this,Mi)}get maxSize(){return T(this,Ur)}get calculatedSize(){return T(this,Ii)}get size(){return T(this,It)}get fetchMethod(){return T(this,ch)}get memoMethod(){return T(this,hh)}get dispose(){return T(this,Ri)}get onInsert(){return T(this,Eu)}get disposeAfter(){return T(this,Bi)}getRemainingTTL(e){return T(this,At).has(e)?1/0:0}*entries(){for(let e of $(this,z,uo).call(this))T(this,me)[e]!==void 0&&T(this,Je)[e]!==void 0&&!$(this,z,Qe).call(this,T(this,me)[e])&&(yield [T(this,Je)[e],T(this,me)[e]]);}*rentries(){for(let e of $(this,z,lo).call(this))T(this,me)[e]!==void 0&&T(this,Je)[e]!==void 0&&!$(this,z,Qe).call(this,T(this,me)[e])&&(yield [T(this,Je)[e],T(this,me)[e]]);}*keys(){for(let e of $(this,z,uo).call(this)){let t=T(this,Je)[e];t!==void 0&&!$(this,z,Qe).call(this,T(this,me)[e])&&(yield t);}}*rkeys(){for(let e of $(this,z,lo).call(this)){let t=T(this,Je)[e];t!==void 0&&!$(this,z,Qe).call(this,T(this,me)[e])&&(yield t);}}*values(){for(let e of $(this,z,uo).call(this))T(this,me)[e]!==void 0&&!$(this,z,Qe).call(this,T(this,me)[e])&&(yield T(this,me)[e]);}*rvalues(){for(let e of $(this,z,lo).call(this))T(this,me)[e]!==void 0&&!$(this,z,Qe).call(this,T(this,me)[e])&&(yield T(this,me)[e]);}[(uO=Symbol.iterator,aO=Symbol.toStringTag,uO)](){return this.entries()}find(e,t={}){for(let i of $(this,z,uo).call(this)){let s=T(this,me)[i],n=$(this,z,Qe).call(this,s)?s.__staleWhileFetching:s;if(n!==void 0&&e(n,T(this,Je)[i],this))return this.get(T(this,Je)[i],t)}}forEach(e,t=this){for(let i of $(this,z,uo).call(this)){let s=T(this,me)[i],n=$(this,z,Qe).call(this,s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,T(this,Je)[i],this);}}rforEach(e,t=this){for(let i of $(this,z,lo).call(this)){let s=T(this,me)[i],n=$(this,z,Qe).call(this,s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,T(this,Je)[i],this);}}purgeStale(){let e=false;for(let t of $(this,z,lo).call(this,{allowStale:true}))T(this,Vr).call(this,t)&&($(this,z,co).call(this,T(this,Je)[t],"expire"),e=true);return e}info(e){let t=T(this,At).get(e);if(t===void 0)return;let i=T(this,me)[t],s=$(this,z,Qe).call(this,i)?i.__staleWhileFetching:i;if(s===void 0)return;let n={value:s};if(T(this,Nr)&&T(this,Oi)){let o=T(this,Nr)[t],a=T(this,Oi)[t];if(o&&a){let u=o-(ah.now()-a);n.ttl=u,n.start=Date.now();}}return T(this,ki)&&(n.size=T(this,ki)[t]),n}dump(){let e=[];for(let t of $(this,z,uo).call(this,{allowStale:true})){let i=T(this,Je)[t],s=T(this,me)[t],n=$(this,z,Qe).call(this,s)?s.__staleWhileFetching:s;if(n===void 0||i===void 0)continue;let o={value:n};if(T(this,Nr)&&T(this,Oi)){o.ttl=T(this,Nr)[t];let a=ah.now()-T(this,Oi)[t];o.start=Math.floor(Date.now()-a);}T(this,ki)&&(o.size=T(this,ki)[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=ah.now()-s;}this.set(t,i.value,i);}}set(e,t,i={}){var d,f,m,_;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=T(this,Tp).call(this,e,t,i.size||0,a);if(this.maxEntrySize&&c>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=true),$(this,z,co).call(this,e,"set"),this;let h=T(this,It)===0?void 0:T(this,At).get(e);if(h===void 0)h=T(this,It)===0?T(this,Nt):T(this,Di).length!==0?T(this,Di).pop():T(this,It)===T(this,Mi)?$(this,z,F0).call(this,false):T(this,It),T(this,Je)[h]=e,T(this,me)[h]=t,T(this,At).set(e,h),T(this,mr)[T(this,Nt)]=h,T(this,Lr)[h]=T(this,Nt),ee(this,Nt,h),Pm(this,It)._++,T(this,fh).call(this,h,c,u),u&&(u.set="add"),l=false,T(this,dh)&&((d=T(this,Eu))==null||d.call(this,t,e,"add"));else {$(this,z,yp).call(this,h);let x=T(this,me)[h];if(t!==x){if(T(this,ho)&&$(this,z,Qe).call(this,x)){x.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:g}=x;g!==void 0&&!o&&(T(this,Fi)&&((f=T(this,Ri))==null||f.call(this,g,e,"set")),T(this,gr)&&T(this,Vt)?.push([g,e,"set"]));}else o||(T(this,Fi)&&((m=T(this,Ri))==null||m.call(this,x,e,"set")),T(this,gr)&&T(this,Vt)?.push([x,e,"set"]));if(T(this,Cu).call(this,h),T(this,fh).call(this,h,c,u),T(this,me)[h]=t,u){u.set="replace";let g=x&&$(this,z,Qe).call(this,x)?x.__staleWhileFetching:x;g!==void 0&&(u.oldValue=g);}}else u&&(u.set="update");T(this,dh)&&this.onInsert?.(t,e,t===x?"update":"replace");}if(s!==0&&!T(this,Nr)&&$(this,z,Hw).call(this),T(this,Nr)&&(l||T(this,vp).call(this,h,s,n),u&&T(this,Ws).call(this,u,h)),!o&&T(this,gr)&&T(this,Vt)){let x=T(this,Vt),g;for(;g=x?.shift();)(_=T(this,Bi))==null||_.call(this,...g);}return this}pop(){var e;try{for(;T(this,It);){let t=T(this,me)[T(this,or)];if($(this,z,F0).call(this,!0),$(this,z,Qe).call(this,t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(T(this,gr)&&T(this,Vt)){let t=T(this,Vt),i;for(;i=t?.shift();)(e=T(this,Bi))==null||e.call(this,...i);}}}has(e,t={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=t,n=T(this,At).get(e);if(n!==void 0){let o=T(this,me)[n];if($(this,z,Qe).call(this,o)&&o.__staleWhileFetching===void 0)return false;if(T(this,Vr).call(this,n))s&&(s.has="stale",T(this,Ws).call(this,s,n));else return i&&T(this,Au).call(this,n),s&&(s.has="hit",T(this,Ws).call(this,s,n)),true}else s&&(s.has="miss");return false}peek(e,t={}){let{allowStale:i=this.allowStale}=t,s=T(this,At).get(e);if(s===void 0||!i&&T(this,Vr).call(this,s))return;let n=T(this,me)[s];return $(this,z,Qe).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:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:m=this.allowStaleOnFetchAbort,context:_,forceRefresh:x=false,status:g,signal:y}=t;if(!T(this,ho))return g&&(g.fetch="get"),this.get(e,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:g});let v={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:o,noDisposeOnSet:a,size:u,sizeCalculation:l,noUpdateTTL:c,noDeleteOnFetchRejection:h,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:m,ignoreFetchAbort:f,status:g,signal:y},S=T(this,At).get(e);if(S===void 0){g&&(g.fetch="miss");let C=$(this,z,G0).call(this,e,S,v,_);return C.__returned=C}else {let C=T(this,me)[S];if($(this,z,Qe).call(this,C)){let L=i&&C.__staleWhileFetching!==void 0;return g&&(g.fetch="inflight",L&&(g.returnedStale=true)),L?C.__staleWhileFetching:C.__returned=C}let A=T(this,Vr).call(this,S);if(!x&&!A)return g&&(g.fetch="hit"),$(this,z,yp).call(this,S),s&&T(this,Au).call(this,S),g&&T(this,Ws).call(this,g,S),C;let M=$(this,z,G0).call(this,e,S,v,_),R=M.__staleWhileFetching!==void 0&&i;return g&&(g.fetch=A?"stale":"refresh",R&&A&&(g.returnedStale=true)),R?M.__staleWhileFetching:M.__returned=M}}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=T(this,hh);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=T(this,At).get(e);if(a!==void 0){let u=T(this,me)[a],l=$(this,z,Qe).call(this,u);return o&&T(this,Ws).call(this,o,a),T(this,Vr).call(this,a)?(o&&(o.get="stale"),l?(o&&i&&u.__staleWhileFetching!==void 0&&(o.returnedStale=true),i?u.__staleWhileFetching:void 0):(n||$(this,z,co).call(this,e,"expire"),o&&i&&(o.returnedStale=true),i?u:void 0)):(o&&(o.get="hit"),l?u.__staleWhileFetching:($(this,z,yp).call(this,a),s&&T(this,Au).call(this,a),u))}else o&&(o.get="miss");}delete(e){return $(this,z,co).call(this,e,"delete")}clear(){return $(this,z,Xw).call(this,"delete")}};Mi=new WeakMap,Ur=new WeakMap,Ri=new WeakMap,Eu=new WeakMap,Bi=new WeakMap,ch=new WeakMap,hh=new WeakMap,It=new WeakMap,Ii=new WeakMap,At=new WeakMap,Je=new WeakMap,me=new WeakMap,mr=new WeakMap,Lr=new WeakMap,or=new WeakMap,Nt=new WeakMap,Di=new WeakMap,Vt=new WeakMap,ki=new WeakMap,Oi=new WeakMap,Nr=new WeakMap,Fi=new WeakMap,ho=new WeakMap,gr=new WeakMap,dh=new WeakMap,z=new WeakSet,Hw=function(){let e=new uh(T(this,Mi)),t=new uh(T(this,Mi));ee(this,Nr,e),ee(this,Oi,t),ee(this,vp,(n,o,a=ah.now())=>{if(t[n]=o!==0?a:0,e[n]=o,o!==0&&this.ttlAutopurge){let u=setTimeout(()=>{T(this,Vr).call(this,n)&&$(this,z,co).call(this,T(this,Je)[n],"expire");},o+1);u.unref&&u.unref();}}),ee(this,Au,n=>{t[n]=e[n]!==0?ah.now():0;}),ee(this,Ws,(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=ah.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=T(this,At).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},ee(this,Vr,n=>{let o=t[n],a=e[n];return !!a&&!!o&&(i||s())-o>a});},Au=new WeakMap,Ws=new WeakMap,vp=new WeakMap,Vr=new WeakMap,dO=function(){let e=new uh(T(this,Mi));ee(this,Ii,0),ee(this,ki,e),ee(this,Cu,t=>{ee(this,Ii,T(this,Ii)-e[t]),e[t]=0;}),ee(this,Tp,(t,i,s,n)=>{if($(this,z,Qe).call(this,i))return 0;if(!ao(s))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(s=n(i,t),!ao(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}),ee(this,fh,(t,i,s)=>{if(e[t]=i,T(this,Ur)){let n=T(this,Ur)-e[t];for(;T(this,Ii)>n;)$(this,z,F0).call(this,true);}ee(this,Ii,T(this,Ii)+e[t]),s&&(s.entrySize=i,s.totalCalculatedSize=T(this,Ii));});},Cu=new WeakMap,fh=new WeakMap,Tp=new WeakMap,uo=function*({allowStale:e=this.allowStale}={}){if(T(this,It))for(let t=T(this,Nt);!(!$(this,z,zw).call(this,t)||((e||!T(this,Vr).call(this,t))&&(yield t),t===T(this,or)));)t=T(this,Lr)[t];},lo=function*({allowStale:e=this.allowStale}={}){if(T(this,It))for(let t=T(this,or);!(!$(this,z,zw).call(this,t)||((e||!T(this,Vr).call(this,t))&&(yield t),t===T(this,Nt)));)t=T(this,mr)[t];},zw=function(e){return e!==void 0&&T(this,At).get(T(this,Je)[e])===e},F0=function(e){var n;let t=T(this,or),i=T(this,Je)[t],s=T(this,me)[t];return T(this,ho)&&$(this,z,Qe).call(this,s)?s.__abortController.abort(new Error("evicted")):(T(this,Fi)||T(this,gr))&&(T(this,Fi)&&((n=T(this,Ri))==null||n.call(this,s,i,"evict")),T(this,gr)&&T(this,Vt)?.push([s,i,"evict"])),T(this,Cu).call(this,t),e&&(T(this,Je)[t]=void 0,T(this,me)[t]=void 0,T(this,Di).push(t)),T(this,It)===1?(ee(this,or,ee(this,Nt,0)),T(this,Di).length=0):ee(this,or,T(this,mr)[t]),T(this,At).delete(i),Pm(this,It)._--,t},G0=function(e,t,i,s){let n=t===void 0?void 0:T(this,me)[t];if($(this,z,Qe).call(this,n))return n;let o=new U0,{signal:a}=i;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let u={signal:o.signal,options:i,context:s},l=(_,x=false)=>{let{aborted:g}=o.signal,y=i.ignoreFetchAbort&&_!==void 0;if(i.status&&(g&&!x?(i.status.fetchAborted=true,i.status.fetchError=o.signal.reason,y&&(i.status.fetchAbortIgnored=true)):i.status.fetchResolved=true),g&&!y&&!x)return h(o.signal.reason);let v=f;return T(this,me)[t]===f&&(_===void 0?v.__staleWhileFetching?T(this,me)[t]=v.__staleWhileFetching:$(this,z,co).call(this,e,"fetch"):(i.status&&(i.status.fetchUpdated=true),this.set(e,_,u.options))),_},c=_=>(i.status&&(i.status.fetchRejected=true,i.status.fetchError=_),h(_)),h=_=>{let{aborted:x}=o.signal,g=x&&i.allowStaleOnFetchAbort,y=g||i.allowStaleOnFetchRejection,v=y||i.noDeleteOnFetchRejection,S=f;if(T(this,me)[t]===f&&(!v||S.__staleWhileFetching===void 0?$(this,z,co).call(this,e,"fetch"):g||(T(this,me)[t]=S.__staleWhileFetching)),y)return i.status&&S.__staleWhileFetching!==void 0&&(i.status.returnedStale=true),S.__staleWhileFetching;if(S.__returned===S)throw _},d=(_,x)=>{var y;let g=(y=T(this,ch))==null?void 0:y.call(this,e,n,u);g&&g instanceof Promise&&g.then(v=>_(v===void 0?void 0:v),x),o.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(_(void 0),i.allowStaleOnFetchAbort&&(_=v=>l(v,true)));});};i.status&&(i.status.fetchDispatched=true);let f=new Promise(d).then(l,c),m=Object.assign(f,{__abortController:o,__staleWhileFetching:n,__returned:void 0});return t===void 0?(this.set(e,m,{...u.options,status:void 0}),t=T(this,At).get(e)):T(this,me)[t]=m,m},Qe=function(e){if(!T(this,ho))return false;let t=e;return !!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof U0},Ww=function(e,t){T(this,Lr)[t]=e,T(this,mr)[e]=t;},yp=function(e){e!==T(this,Nt)&&(e===T(this,or)?ee(this,or,T(this,mr)[e]):$(this,z,Ww).call(this,T(this,Lr)[e],T(this,mr)[e]),$(this,z,Ww).call(this,T(this,Nt),e),ee(this,Nt,e));},co=function(e,t){var s,n;let i=false;if(T(this,It)!==0){let o=T(this,At).get(e);if(o!==void 0)if(i=true,T(this,It)===1)$(this,z,Xw).call(this,t);else {T(this,Cu).call(this,o);let a=T(this,me)[o];if($(this,z,Qe).call(this,a)?a.__abortController.abort(new Error("deleted")):(T(this,Fi)||T(this,gr))&&(T(this,Fi)&&((s=T(this,Ri))==null||s.call(this,a,e,t)),T(this,gr)&&T(this,Vt)?.push([a,e,t])),T(this,At).delete(e),T(this,Je)[o]=void 0,T(this,me)[o]=void 0,o===T(this,Nt))ee(this,Nt,T(this,Lr)[o]);else if(o===T(this,or))ee(this,or,T(this,mr)[o]);else {let u=T(this,Lr)[o];T(this,mr)[u]=T(this,mr)[o];let l=T(this,mr)[o];T(this,Lr)[l]=T(this,Lr)[o];}Pm(this,It)._--,T(this,Di).push(o);}}if(T(this,gr)&&T(this,Vt)?.length){let o=T(this,Vt),a;for(;a=o?.shift();)(n=T(this,Bi))==null||n.call(this,...a);}return i},Xw=function(e){var t,i;for(let s of $(this,z,lo).call(this,{allowStale:true})){let n=T(this,me)[s];if($(this,z,Qe).call(this,n))n.__abortController.abort(new Error("deleted"));else {let o=T(this,Je)[s];T(this,Fi)&&((t=T(this,Ri))==null||t.call(this,n,o,e)),T(this,gr)&&T(this,Vt)?.push([n,o,e]);}}if(T(this,At).clear(),T(this,me).fill(void 0),T(this,Je).fill(void 0),T(this,Nr)&&T(this,Oi)&&(T(this,Nr).fill(0),T(this,Oi).fill(0)),T(this,ki)&&T(this,ki).fill(0),ee(this,or,0),ee(this,Nt,0),T(this,Di).length=0,ee(this,Ii,0),ee(this,It,0),T(this,gr)&&T(this,Vt)){let s=T(this,Vt),n;for(;n=s?.shift();)(i=T(this,Bi))==null||i.call(this,...n);}};var L0=Yw;var Ct=class{constructor(e){w(this,"cache");w(this,"map",new Map);this.cache=new L0({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 Sp=new Ct({cacheSize:5});function fO(r){return function(e){N0.add(e,r);}}var N0;(s=>{function r(n,o){o||(o=n.name),Sp.get(o)&&E.warn(`CanvasElement "${o}" already registered`),n.prototype.pixivnId=o,Sp.set(o,n);}s.add=r;function e(n){try{let o=Sp.get(n);if(!o){E.error(`CanvasElement "${n}" not found, did you forget to register it with the canvasComponentDecorator?`);return}return new o,o}catch(o){E.error(`Error while getting CanvasElement "${n}"`,o);return}}s.get=e;function t(){return Array.from(Sp.values())}s.values=t;function i(n){return Sp.has(n)}s.has=i;})(N0||(N0={}));var ar=N0;var ph=new Ct({cacheSize:5});function pO(r){return function(e){V0.add(e,r);}}var V0;(n=>{function r(o,a){a||(a=o.name),ph.get(a)&&E.info(`Event "${a}" already exists, it will be overwritten`),o.prototype.id=a,ph.set(a,o);}n.add=r;function e(o){try{let a=ph.get(o);if(!a){E.error(`Event "${o}" not found, did you forget to register it with the eventDecorator?`);return}return new a,a}catch(a){E.error(`Error while getting Event "${o}"`,a);return}}n.get=e;function t(o){try{let a=ph.get(o);if(!a){E.error(`Event "${o}" not found, did you forget to register it with the eventDecorator?`);return}return new a}catch(a){E.error(`Error while getting Event "${o}"`,a);return}}n.getInstance=t;function i(){return Array.from(ph.values())}n.values=i;function s(o){return ph.has(o)}n.has=s;})(V0||(V0={}));var hs=V0;async function H0(r){let e=hN(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 hN(r){try{let e=ar.get(r);return e?new e:void 0}catch(e){E.error(`Error while getting CanvasElement ${r}`,e);return}}Re();function jw(r){return "memory"in r?r.memory:r instanceof Cr?$w(r):r instanceof De?Ep(r):wu(r)}function dN(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 mO(r,e){return {url:r.source.label,alias:e===r.source.label?void 0:e}}function wu(r,e){let t=fN(r,sh),s=e?.childrenExport||false?r.children.sort((n,o)=>r.getChildIndex(n)-r.getChildIndex(o)).map(n=>jw(n)):[];return {pixivnId:t,elements:s,...dN(r)}}function Ep(r){let e=wu(r),t=e.pixivnId??nh,i=xO(r),s="textureAlias"in r?mO(r.texture,r.textureAlias):mO(r.texture);return {...e,pixivnId:t,textureData:s,anchor:{x:r.anchor.x,y:r.anchor.y},roundPixels:r.roundPixels,onEvents:i}}function $w(r){let e=wu(r),t=e.pixivnId??oh,i=xO(r);return {...e,pixivnId:t,anchor:{x:r.anchor.x,y:r.anchor.y},text:r.text,resolution:r.resolution,style:pN(r.style),roundPixels:r.roundPixels,onEvents:i}}function fN(r,e){return Object.prototype.hasOwnProperty.call(r,"pixivnId")?r.pixivnId:e}function xO(r){return "onEvents"in r?r.onEvents:{}}function gO(r,e){if(typeof r!="object"||r===null)return r;E.warn(`Unsupported property type for Text.style.${e}: FillGradient or FillPattern.`,r);}function pN(r){return {align:r.align,breakWords:r.breakWords,dropShadow:r.dropShadow,fill:gO(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:gO(r.stroke,"stroke"),textBaseline:r.textBaseline,trim:r.trim,whiteSpace:r.whiteSpace,wordWrap:r.wordWrap,wordWrapWidth:r.wordWrapWidth}}var fo=class extends J{constructor(t){super(t);w(this,"pixivnId",sh);w(this,"_onEvents",{});this.pixivnId=this.constructor.prototype.pixivnId||sh;}get memory(){return wu(this,{childrenExport:true})}set memory(t){}async setMemory(t){return this.memory=t,await this.importChildren(t),await ds(this,t)}async importChildren(t){for(let i=0;i<t.elements.length;i++){let s=t.elements[i],n=await H0(s);this.addChild(n);}}get onEvents(){return this._onEvents}onEvent(t,i){let s=i.prototype.id,n=hs.getInstance(s);return this._onEvents[t]=s,n?super.on(t,()=>{n.fn(t,this);}):E.error(`Event ${s} not found`),this}on(t,i,s){return super.on(t,i,s)}};ar.add(fo,sh);async function ds(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));}Re();var Ap=class Ap{static init(e){Ap._getScreen=e.getScreen;}static get screen(){return Ap._getScreen()}};w(Ap,"_getScreen");var Pr=Ap;function oi(r,e,t,i,s,n=0){return i=i*(s?-1:1),r==="width"?e*(Pr.screen.width-t)+i+n*t+(s?t:0):e*(Pr.screen.height-t)+i+n*t+(s?t:0)}function fs(r,e,t,i,s,n=0){return i=i*(s?-1:1),r==="width"?(e-i-n*t-(s?t:0))/(Pr.screen.width-t):(e-i-n*t-(s?t:0))/(Pr.screen.height-t)}function ai(r,e){return r==="width"?e*Pr.screen.width:e*Pr.screen.height}function ps(r,e){return r==="width"?e/Pr.screen.width:e/Pr.screen.height}function ut(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 qw(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 ui(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 li(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))}Re();var mN=new RegExp(`(${Jk.join("|")})$`);function Cp(r){let e=exports.Assets.cache.has(r)?exports.Assets.get(r):null;return e instanceof exports.Texture&&(r=e.source?.label||r),mN.test(r)}function Pu(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)}Re();Re();async function Mu(r){if(r!=="EMPTY"){if(!r){E.error("Texture not found",r);return}if(exports.Assets.cache.has(r)){let e=exports.Assets.get(r);if(e)return e}return exports.Assets.load(r).then(e=>{if(!e){E.error("Texture not found",r);return}if(!(e instanceof exports.Texture)){E.error("File not is a file",r);return}return e}).catch(e=>{E.error("Error loading file",e);})}}Re();var ms=class r extends De{constructor(t){super(t);w(this,"pixivnId",nh);w(this,"_textureAlias");w(this,"_onEvents",{});this.pixivnId=this.constructor.prototype.pixivnId||nh;}get textureAlias(){return this._textureAlias?this._textureAlias:this.texture.source.label}set textureAlias(t){this._textureAlias=t;}get memory(){return Ep(this)}set memory(t){}async setMemory(t){return this.memory=t,await wp(this,t)}get onEvents(){return this._onEvents}onEvent(t,i){let s=i.prototype.id,n=hs.getInstance(s);return this._onEvents[t]=s,n?(super.on(t,()=>{n.fn(t,this);}),this.interactive||(this.interactive=true,this.eventMode="dynamic")):E.error(`Event ${s} not found`),this}on(t,i,s){return super.on(t,i,s)}static from(t,i){let s=De.from(t,i),n=new r;return n.texture=s.texture,n}};ar.add(ms,nh);async function wp(r,e,t){let i=t?.ignoreTexture||false;if(await ds(r,e),!i){if("textureImage"in e&&e.textureImage&&e.textureImage.image){let n=await Mu(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&&exports.Assets.resolver.hasKey(e.textureData.alias)&&(n=e.textureData.alias);let o=await Mu(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=hs.get(o);a&&r.onEvent(n,a);}}var Ue=class r extends ms{constructor(t,i){t=Pu(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);w(this,"pixivnId",Gw);w(this,"_loadIsStarted",false);w(this,"_align");w(this,"_percentagePosition");i&&(this.textureAlias=i),s&&(this.align=s),n&&(this.percentagePosition=n);}get memory(){return {...Ep(this),pixivnId:this.pixivnId,align:this._align,percentagePosition:this._percentagePosition,loadIsStarted:this._loadIsStarted}}set memory(t){}async setMemory(t){this.memory=t,await Pp(this,t),this.reloadPosition();}static from(t,i){let s=De.from(t,i),n=new r;return n.texture=s.texture,n}get loadIsStarted(){return this._loadIsStarted}async load(){return this._loadIsStarted=true,Mu(this.textureAlias).then(t=>{this._loadIsStarted=false,t&&(this.texture=t);}).catch(t=>{this._loadIsStarted=false,E.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=ut(this.pivot,this.angle),i=ut(this.scale,this.angle);return {x:fs("width",this.x,ui(this),t.x,i.x<0,this.anchor.x),y:fs("height",this.y,li(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=ut(this.pivot,this.angle),i=ut(this.scale,this.angle);return fs("width",this.x,ui(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=ut(this.pivot,this.angle),i=ut(this.scale,this.angle);return fs("height",this.y,li(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:ps("width",this.x),y:ps("height",this.y)}}get percentageX(){return ps("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 ps("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=ut(this.pivot,this.angle),i=ut(this.scale,this.angle);this._align.x!==void 0&&(super.x=oi("width",this._align.x,ui(this),t.x,i.x<0,this.anchor.x)),this._align.y!==void 0&&(super.y=oi("height",this._align.y,li(this),t.y,i.y<0,this.anchor.y));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=ai("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=ai("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;}};ar.add(Ue,Gw);async function Pp(r,e,t){let i=t?.ignoreTexture||false;return e=Pu(e),await wp(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})}Re();var nr=class r extends Ue{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);w(this,"pixivnId",Uw);w(this,"_looop",false);w(this,"_paused",false);w(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 Kw(this,t)}static from(t,i){let s=De.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}};ar.add(nr,Uw);async function Kw(r,e,t){await Pp(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 Ye=class extends fo{constructor(t,i=[]){t=Pu(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);w(this,"pixivnId",D0);w(this,"_loadIsStarted",false);w(this,"_anchor");w(this,"_align");w(this,"_percentagePosition");t=Pu(t),i&&i.forEach(a=>{let u;Cp(a)?u=new nr(void 0,a):u=new Ue(void 0,a),this.addChild(u);}),o&&(this.anchor=o),s&&(this.align=s),n&&(this.percentagePosition=n);}get memory(){return {...super.memory,pixivnId:D0,anchor:this._anchor?this.anchor:void 0,align:this._align,percentagePosition:this._percentagePosition,loadIsStarted:this._loadIsStarted}}set memory(t){}async setMemory(t){this.memory=t,await this.importChildren(t),await Zw(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,E.error("Error into ImageContainer.load()",i);})}get texture(){return this.children.length>0?this.children[0].texture:new exports.Texture}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=ut(this.pivot,this.angle),i=ut(this.scale,this.angle);return {x:fs("width",this.x,ui(this),t.x,i.x<0,this.anchor.x),y:fs("height",this.y,li(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=ut(this.pivot,this.angle),i=ut(this.scale,this.angle);return fs("width",this.x,ui(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=ut(this.pivot,this.angle),i=ut(this.scale,this.angle);return fs("height",this.y,li(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:ps("width",this.x),y:ps("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 ps("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 ps("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=ut(this.pivot,this.angle),i=ut(this.scale,this.angle);this._align.x!==void 0&&(super.x=oi("width",this._align.x,ui(this),t.x,i.x<0)),this._align.y!==void 0&&(super.y=oi("height",this._align.y,li(this),t.y,i.y<0));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=ai("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=ai("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;}};ar.add(Ye,D0);async function Zw(r,e,t){e=Pu(e),ds(r,e,{...t,end:async()=>{"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();}});}Re();var po=class extends Cr{constructor(t){super(t);w(this,"pixivnId",oh);w(this,"_onEvents",{});this.pixivnId=this.constructor.prototype.pixivnId||oh;}get memory(){return $w(this)}set memory(t){}async setMemory(t){return this.memory=t,await Qw(this,t)}get onEvents(){return this._onEvents}onEvent(t,i){let s=i.prototype.id,n=hs.getInstance(s);return this._onEvents[t]=s,n?(super.on(t,()=>{n.fn(t,this);}),this.interactive||(this.interactive=true,this.eventMode="dynamic")):E.error(`Event ${s} not found`),this}on(t,i,s){return super.on(t,i,s)}};ar.add(po,oh);async function Qw(r,e){if(await ds(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=hs.get(i);s&&r.onEvent(t,s);}}Re();var Ru=class{constructor(e,t,i){w(this,"_args");w(this,"duration");w(this,"priority");w(this,"ticker",new _e);w(this,"animation");w(this,"stopped",false);w(this,"ignoreOnComplete",true);w(this,"tickerId");w(this,"canvasElementAliases",[]);w(this,"timeout",50);w(this,"onComplete",()=>{if(this.ignoreOnComplete)return;let e=this.tickerId;if(!e){E.warn("MotionTicker.complete() called without tickerId set. This may cause issues.");return}let t=this._args.options?.aliasToRemoveAfter||[];typeof t=="string"&&(t=[t]);let i=this._args.options?.tickerAliasToResume||[];typeof i=="string"&&(i=[i]);let s=this._args.options?.tickerIdToResume||[];typeof s=="string"&&(s=[s]),I.onTickerComplete(e,{aliasToRemoveAfter:t,tickerAliasToResume:i,tickerIdToResume:s,stopTicker:false});});this._args=e,this.duration=t,this.priority=i;}get args(){return {...this._args,time:this.animation?.time}}getItemByAlias(e){if(!this.canvasElementAliases.includes(e))return;let t=I.find(e);if(t)return t}async complete(){if(!this.animation){E.warn("MotionTicker.complete() called without animation set. This may cause issues.");return}this.animation.complete(),await new Promise(e=>setTimeout(e,this.timeout));}stop(){if(this.stopped=true,!this.animation){E.warn("MotionTicker.stop() called without animation set. This may cause issues.");return}this.animation.stop();}start(e){if(this.tickerId=e,this._args.options.autoplay!==false)return this.initialize()}createItem(e){return new Proxy({alias:e},{set:({alias:t},i,s)=>{if(this.stopped||this._args.startState&&this._args.startState[i]===s)return true;let n=this.getItemByAlias(t);if(!n)return true;switch(this.ignoreOnComplete&&setTimeout(()=>{this.ignoreOnComplete=false;},10),i){case "pivotX":n.pivot.x=s;break;case "pivotY":n.pivot.y=s;break;case "scaleX":n.scale.x=s;break;case "scaleY":n.scale.y=s;break;default:n[i]=s;break}return true},get:({alias:t},i)=>{if(this._args.startState||(this._args.startState={}),i in this._args.startState)return this._args.startState[i];let s=this.getItemByAlias(t);if(!s)return;let n;switch(i){case "pivotX":n=s.pivot.x;break;case "pivotY":n=s.pivot.y;break;case "scaleX":n=s.scale.x;break;case "scaleY":n=s.scale.y;break;default:n=s[i];break}return this._args.startState={...this._args.startState,[i]:n},n},has:({alias:t},i)=>{let s=this.getItemByAlias(t);if(!s)return false;switch(i){case "pivotX":return "pivot"in s&&"x"in s.pivot;case "pivotY":return "pivot"in s&&"y"in s.pivot;case "scaleX":return "scale"in s&&"x"in s.scale;case "scaleY":return "scale"in s&&"y"in s.scale;default:return i in s}},ownKeys:({alias:t})=>{let i=this.getItemByAlias(t);return i?Object.keys(i):[]}})}pause(){if(!this.animation){E.warn("MotionTicker.pause() called without animation set. This may cause issues.");return}this.animation.pause();}play(){if(this.animation||this.initialize(),!this.animation){E.warn("MotionTicker.play() called without animation set. This may cause issues.");return}this.animation.play();}get paused(){return this.animation?this.animation.state==="paused":(E.warn("MotionTicker.paused() called without animation set. This may cause issues."),true)}};var Bu=class extends Ru{constructor(){super(...arguments);w(this,"id","motion-sequence");}initialize(){let t=this.canvasElementAliases[0],i=this.createItem(t),s=this._args.sequence.map((n,o)=>[i,n[0],{...n[1]||{},ticker:this.ticker,repeat:this._args.options.repeat===null?1/0:this._args.options.repeat,onComplete:o===this._args.sequence.length-1?()=>this.onComplete():void 0}]);this.animation=mh(s,{...this._args.options,repeat:this._args.options.repeat===null?1/0:this._args.options.repeat}),this._args.time&&(this.animation.time=this._args.time);}};var Iu=class extends Ru{constructor(){super(...arguments);w(this,"id","motion");}initialize(){let t=this.canvasElementAliases.map(i=>this.createItem(i));this.animation=mh(t,this._args.keyframes,{...this._args.options,repeat:this._args.options?.repeat===null?1/0:this._args.options?.repeat,onComplete:()=>this.onComplete(),ticker:this.ticker}),this._args.time&&(this.animation.time=this._args.time);}};var mo=new Ct({cacheSize:5});mo.set("motion",Iu);mo.set("motion-sequence",Bu);function _O(r){return function(e){z0.add(e,r);}}var z0;(n=>{function r(o,a){a||(a=o.name),mo.get(a)&&E.info(`Ticker "${a}" already exists, it will be overwritten`),o.prototype.id=a,mo.set(a,o);}n.add=r;function e(o){try{let a=mo.get(o);if(!a){E.error(`Event "${o}" not found, did you forget to register it with the tickerDecorator?`);return}return a}catch(a){E.error(`Error while getting Event "${o}"`,a);return}}n.get=e;function t(o,a,u,l){try{let c=mo.get(o);if(!c){E.error(`Ticker "${o}" not found, did you forget to register it with the tickerDecorator?`);return}return new c(a,u,l)}catch(c){E.error(`Error while getting Ticker "${o}"`,c);return}}n.getInstance=t;function i(){return Array.from(mo.values())}n.values=i;function s(o){return mo.has(o)}n.has=s;})(z0||(z0={}));var ur=z0;var bO="aliasToRemoveAfter";var Mp=class{get app(){return k.app}get gameLayer(){return k.gameLayer}get isInitialized(){return k._isInitialized}get canvasWidth(){return k.canvasWidth}get canvasHeight(){return k.canvasHeight}set canvasWidth(e){k.canvasWidth=e;}set canvasHeight(e){k.canvasHeight=e;}get screen(){return this.app.screen}async init(e,t,i,s,n){if(typeof t=="number"&&typeof i=="number")return await k.init(e,t,i,s,n);if(typeof t!="number"&&typeof i!="number")return await k.init(e,t.width,t.height,t,i);throw new Error("Invalid parameters")}get children(){return k.gameLayer.children}async copyCanvasElementProperty(e,t){if(typeof t=="string"){let i=this.find(t);if(i)t=i;else {E.error(`Canvas element ${t} not found`);return}}if(typeof e=="string"){let i=this.find(e);if(i)e=i;else {E.error(`Canvas element ${e} not found`);return}}e instanceof J&&(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 nr?await Kw(t,e,{ignoreTexture:true}):t instanceof Ue?await Pp(t,e,{ignoreTexture:true}):t instanceof ms?await wp(t,e,{ignoreTexture:true}):t instanceof po?await Qw(t,e):t instanceof Ye?await Zw(t,e):t instanceof J&&await ds(t,e);}add(e,t,i={}){if(e===wr){E.error(`The alias ${wr} 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)?E.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===wr){E.error(`The alias ${wr} 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===wr)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();}editAlias(e,t,i={}){let s=this.find(e);s&&(s.label=t),!i.ignoreTickers&&this.transferTickers(e,t,"move");}get currentTickers(){return k._currentTickers}get currentTickersSteps(){return k._currentTickersSequence}findTicker(e){let t=k._currentTickers[e];if(t)return t.ticker}addTicker(e,t,i){let s=t.id;if(typeof e=="string"&&(e=[e]),t.canvasElementAliases=e,!ur.has(s)){E.error(`Ticker ${s} not found`);return}let n={ticker:t},{id:o=k.generateTickerId(n)}=i||{};if(k._currentTickers[o]=n,n.ticker.start(o),t.duration){let a=setTimeout(()=>{k.removeTickerTimeoutInfo(a),k._currentTickersTimeouts[a.toString()]&&n.ticker.complete({ignoreTickerSteps:true});},t.duration*1e3);k.addTickerTimeoutInfo(e,s,a.toString(),true);}return o}addTickersSequence(e,t,i=0){if(t.length==0){E.warn("The steps of the tickers is empty");return}e in k._currentTickersSequence||(k._currentTickersSequence[e]={});let s={currentStepNumber:i,steps:t.map(o=>o===oo||o.hasOwnProperty("type")&&o.type==="pause"?o:{ticker:o.id,args:pe(o.args),duration:o.duration})},n=k.generateTickerId(s);return k._currentTickersSequence[e][n]=s,this.runTickersSequence(e,n),n}runTickersSequence(e,t){if(!k._currentTickersSequence[e]||!k._currentTickersSequence[e][t])return;let i=k._currentTickersSequence[e][t].steps[k._currentTickersSequence[e][t].currentStepNumber];if(i===oo&&(i=k._currentTickersSequence[e][t].steps[0],k._currentTickersSequence[e][t].currentStepNumber=0,i===oo)){E.error("TikersSteps has a RepeatType in the first step");return}if(i.hasOwnProperty("type")&&i.type==="pause"){let u=setTimeout(()=>{let l=k._currentTickersTimeouts[u.toString()];l&&l.aliases.forEach(c=>{this.nextTickerStep(c,t);}),k.removeTickerTimeoutInfo(u);},i.duration*1e3);k.addTickerTimeoutInfo(e,"steps",u.toString(),false);return}let s=ur.getInstance(i.ticker,i.args,i.duration,i.priority);if(!s){E.error(`Ticker ${i.ticker} not found`);return}s.canvasElementAliases=[e];let n=s.id,o={createdByTicketSteps:{canvasElementAlias:e,id:t},ticker:s},a=k.generateTickerId(o);if(k._currentTickers[a]=o,o.ticker.start(a),s.duration){let u=setTimeout(()=>{let l=k._currentTickersTimeouts[u.toString()];l&&(o.ticker.complete({ignoreTickerSteps:true}),l.aliases.forEach(c=>{this.nextTickerStep(c,t);})),k.removeTickerTimeoutInfo(u);},s.duration*1e3);k.addTickerTimeoutInfo(e,n,u.toString(),false);}}nextTickerStep(e,t){if(k._currentTickersSequence[e]&&k._currentTickersSequence[e][t]){let i=k._currentTickersSequence[e][t];i.currentStepNumber+1<i.steps.length?(i.currentStepNumber++,k._currentTickersSequence[e][t]=i,this.runTickersSequence(e,t)):t&&k._currentTickersSequence[e]&&k._currentTickersSequence[e][t]&&(delete k._currentTickersSequence[e][t],Object.entries(k._currentTickers).forEach(([s,n])=>{n.createdByTicketSteps?.canvasElementAlias===e&&n.createdByTicketSteps.id===t&&this.removeTicker(s);}));}}onEndOfTicker(e,t){return this.onTickerComplete(e,t)}onTickerComplete(e,t){let{stopTicker:i=true,aliasToRemoveAfter:s,tickerAliasToResume:n,tickerIdToResume:o}=t,a=k._currentTickers[e],u=t.ignoreTickerSteps||false;this.remove(s),n.forEach(l=>this.resumeTicker({canvasAlias:l})),this.resumeTicker({id:o}),a&&(this.removeTicker(e,{stopTicker:i}),!u&&a.ticker.duration==null&&a.createdByTicketSteps&&this.nextTickerStep(a.createdByTicketSteps.canvasElementAlias,a.createdByTicketSteps.id));}unlinkComponentFromTicker(e,t){if(typeof e=="string"&&(e=[e]),!t){e.forEach(s=>{Object.entries(k._currentTickers).forEach(([n,o])=>{o.ticker.canvasElementAliases.includes(s)&&(o.ticker.canvasElementAliases.length===1?this.removeTicker(n):o.ticker.canvasElementAliases=o.ticker.canvasElementAliases.filter(a=>a!==s));}),k._currentTickersSequence[s]&&delete k._currentTickersSequence[s],k.removeTickerTimeoutsByAlias(s,false);});return}let i;typeof t=="string"?i=t:i=t.prototype.id,e.forEach(s=>{k._currentTickersSequence[s]&&Object.entries(k._currentTickersSequence[s]).forEach(([n,o])=>{o.steps.find(a=>typeof a=="object"&&"ticker"in a&&a.ticker===i)&&delete k._currentTickersSequence[s][n];});}),Object.entries(k._currentTickers).forEach(([s,n])=>{n.ticker.id===i&&(k._currentTickers[s].ticker.canvasElementAliases=n.ticker.canvasElementAliases.filter(o=>!e.includes(o)));}),Object.entries(k._currentTickersTimeouts).forEach(([s,n])=>{n.ticker===i&&n.canBeDeletedBeforeEnd&&(k._currentTickersTimeouts[s].aliases=n.aliases.filter(o=>!e.includes(o)));}),this.removeTickersWithoutAssociatedCanvasElement();}removeTickersWithoutAssociatedCanvasElement(){Object.entries(k._currentTickers).forEach(([e,t])=>{t.ticker.canvasElementAliases=t.ticker.canvasElementAliases.filter(i=>this.find(i)),t.ticker.canvasElementAliases.length===0&&t.ticker.complete({ignoreTickerSteps:true});}),Object.entries(k._currentTickersSequence).forEach(([e,t])=>{t===void 0&&delete k._currentTickersSequence[e];}),Object.entries(k._currentTickersTimeouts).forEach(([e,{aliases:t}])=>{t.length===0&&k.removeTickerTimeout(e);});}removeAllTickers(){k._currentTickersSequence={},Object.keys(k._currentTickers).forEach(e=>{this.removeTicker(e);}),k._currentTickers={};for(let e in k._currentTickersTimeouts)k.removeTickerTimeout(e);k._tickersToCompleteOnStepEnd={tikersIds:[],stepAlias:[]},k._tickersOnPause={};}removeTicker(e,t={stopTicker:true}){typeof e=="string"&&(e=[e]),e.forEach(i=>{let s=k._currentTickers[i];s&&(t.stopTicker&&s.ticker.stop(),delete k._currentTickers[i]);});}pauseTicker(e){let t=[];if("canvasAlias"in e){let{canvasAlias:i,tickerIdsExcluded:s=[]}=e;Object.entries(k._currentTickers).forEach(([n,o])=>{o.ticker.canvasElementAliases.includes(i)&&!s.includes(o.ticker.id)&&o.ticker.paused===false&&(o.ticker.pause(),t.push(n));});}else if("id"in e){let{id:i}=e;typeof i=="string"&&(i=[i]),i.forEach(s=>{let n=k._currentTickers[s];n?n.ticker.paused===false&&(n.ticker.pause(),t.push(s)):E.error(`Ticker with id ${s} not found`);});}return t}resumeTicker(e){if("canvasAlias"in e){let{canvasAlias:t}=e;Object.values(k._currentTickers).forEach(i=>{i.ticker.canvasElementAliases.includes(t)&&i.ticker.play();}),delete k._tickersOnPause[t];}else if("id"in e){let{id:t}=e;typeof t=="string"&&(t=[t]),t.forEach(i=>{let s=k._currentTickers[i];s?s.ticker.play():E.error(`Ticker with id ${i} not found`);});}}isTickerPaused(e,t){let i=k._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}transferTickers(e,t,i="move"){k._currentTickersSequence[e]&&(i==="move"?k._currentTickersSequence[t]=pe(k._currentTickersSequence[e]):i==="duplicate"&&(k._currentTickersSequence[t]=pe(k._currentTickersSequence[e]))),Object.entries(k._currentTickers).forEach(([s,n])=>{if(n.createdByTicketSteps?.canvasElementAlias===e&&this.removeTicker(s),n.ticker.canvasElementAliases.includes(e)){let o=ur.getInstance(n.ticker.id,pe(n.ticker.args),n.ticker.duration,n.ticker.priority);if(o?(o.canvasElementAliases=[t],this.addTicker(t,o),n.ticker.paused&&o.pause()):E.error(`Ticker ${n.ticker.id} not found`),i==="move"&&(n.ticker.canvasElementAliases=n.ticker.canvasElementAliases.filter(a=>a!==e)),n.ticker.args.hasOwnProperty(bO)){let a=n.ticker.args.aliasToRemoveAfter;typeof a=="string"&&(a=[a]),Array.isArray(a)&&(i==="move"?n.ticker.args.aliasToRemoveAfter=a.map(u=>u===e?t:u):i==="duplicate"&&a.find(u=>u===e)&&(n.ticker.args.aliasToRemoveAfter=[...a,t]));}}}),Object.values(k._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));}),k._currentTickersSequence[t]&&Object.keys(k._currentTickersSequence[t]).forEach(s=>{this.runTickersSequence(t,s);}),i==="duplicate"&&k._currentTickersSequence[e]&&Object.keys(k._currentTickersSequence[e]).forEach(s=>{this.runTickersSequence(e,s);});}completeTickerOnStepEnd(e){e.alias?k._tickersToCompleteOnStepEnd.stepAlias.push({id:e.id,alias:e.alias}):k._tickersToCompleteOnStepEnd.tikersIds.push({id:e.id});}async forceCompletionOfTicker(e,t){if(t){let i=k._currentTickersSequence[t];if(i&&i[e])if(i[e].steps.includes(oo))E.error(`The ticker alias: ${t} id: ${e} contains a RepeatType, so it can't be forced to complete`,i[e]);else {let s=i[e].steps.map(n=>{if(typeof n=="object"&&"ticker"in n){let o=ur.getInstance(n.ticker,n.args,n.duration,n.priority);if(o)return o.canvasElementAliases=[t],o.complete()}});await Promise.all(s);}}else {let i=k._currentTickers[e];i&&await i.ticker.complete();}}animate(e,t,i,s){try{t=pe(t);}catch(l){throw E.error("animate keyframes cannot contain functions or classes"),l}try{i=pe(i);}catch(l){throw E.error("animate options cannot contain functions or classes"),l}let n=[];typeof e=="string"?n=[e]:Array.isArray(e)?n=e.map(l=>typeof l=="string"?l:l.label):n=[e.label];let o;Array.isArray(t)?o=new Bu({sequence:t,options:i},void 0,s):o=new Iu({keyframes:t,options:i},void 0,s);let a=this.addTicker(n,o),{forceCompleteBeforeNext:u}=i||{};return a&&u&&this.completeTickerOnStepEnd({id:a}),a}addLayer(e,t){if(e===wr){E.error(`The alias ${wr} is reserved`);return}return t.label=e,k.app.stage.addChild(t)}getLayer(e){return k.app.stage.getChildByLabel(e)}removeLayer(e){k.app.stage.getChildrenByLabel(e);}addHtmlLayer(e,t,i){return k.addHtmlLayer(e,t,i)}removeHtmlLayer(e){return k.removeHtmlLayer(e)}getHtmlLayer(e){return k.getHtmlLayer(e)}async extractImage(){return (await this.app.renderer.extract.image(this.gameLayer)).src}clear(){this.removeAllTickers(),this.removeAll();}export(){let e={};return this.children.forEach(t=>{t.label&&(e[t.label]=jw(t));}),{tickers:pe(k.currentTickersWithoutCreatedBySteps),tickersSteps:pe(k._currentTickersSequence),elements:pe(e),stage:pe(wu(this.gameLayer)),elementAliasesOrder:pe(k.childrenAliasesOrder),tickersOnPause:pe(k._tickersOnPause),tickersToCompleteOnStepEnd:pe(k._tickersToCompleteOnStepEnd)}}async restore(e){this.clear();try{if(e.hasOwnProperty("elementAliasesOrder")&&e.hasOwnProperty("elements")){let t=e.elementAliasesOrder,i={},s=Object.entries(e.elements).map(async([n,o])=>{i[n]=await H0(o);});await Promise.all(s),t.forEach(n=>{let o=i[n];o&&this.add(n,o);});}else {E.error("The data does not have the properties elementAliasesOrder and elements");return}if(e.hasOwnProperty("stage")&&e.hasOwnProperty("stage")?ds(this.gameLayer,e.stage,{ignoreScale:!0}):E.error("The data does not have the properties stage"),e.hasOwnProperty("tickers")){let t=e.tickers;Object.entries(t).forEach(([i,s])=>{let n=s.canvasElementAliases;if(n.length!==0){let o=ur.getInstance(s.id,s.args,s.duration,s.priority);o?(o.canvasElementAliases=n,this.addTicker(n,o,{id:i}),s.paused&&o.pause()):E.error(`Ticker ${s.id} not found`);}});}if(e.hasOwnProperty("tickersSteps")){let t=e.tickersSteps;Object.entries(t).forEach(([i,s])=>{k._currentTickersSequence[i]=s,Object.keys(s).forEach(n=>{this.runTickersSequence(i,n);});});}if(e.hasOwnProperty("tickersOnPause")){let t=e.tickersOnPause;Object.keys(t).forEach(i=>{let s=t[i];"tickerIdsExcluded"in s&&s.tickerIdsExcluded&&(t[i].tickerIdsExcluded=s.tickerIdsExcluded),"tickerIdsIncluded"in s&&s.tickerIdsIncluded&&(t[i].tickerIdsIncluded=s.tickerIdsIncluded);}),k._tickersOnPause=t;}if(e.hasOwnProperty("tickersToCompleteOnStepEnd")){let t=e.tickersToCompleteOnStepEnd,i=t.tikersIds,s=t.stepAlias.map(n=>({id:n.id,alias:n.alias}));k._tickersToCompleteOnStepEnd={tikersIds:i,stepAlias:s};}}catch(t){E.error("Error importing data",t);}}};var Rp=class{constructor(){w(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 Bp=class{constructor(){w(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")}};async function yO(r,e={},t){let i=I.find(r);if(!i){E.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},{shakeType:n="horizontal",maxShockSize:o=10,shocksNumber:a=10,...u}=e,l=a-1;if(l<2){E.error("The number of shocks must be at least 3.");return}let c=Math.floor(l/2),h=Math.ceil(l/2),d=[];for(let _=0;_<c;_++){let x=o*(_+1)/c;n==="horizontal"?_%2!==0?d.push(s.x+x):d.push(s.x-x):_%2!==0?d.push(s.y+x):d.push(s.y-x);}let f=c%2===0;for(let _=h;_>0;_--){let x=o*(_+1)/(h-1);n==="horizontal"?_%2===0&&!f||_%2!==0&&f?d.push(s.x-x):d.push(s.x+x):_%2===0&&!f||_%2!==0&&f?d.push(s.y-x):d.push(s.y+x);}let m;if(n==="horizontal"?(d.push(s.x),m=I.animate(r,{x:d},u,t)):(d.push(s.y),m=I.animate(r,{y:d},u,t)),m)return [m]}Re();function Ip(r,e,t){let i=new Ye(t,e);return I.add(r,i),i}async function vO(r,e,t){let i=new Ye(t,e);return await i.load(),I.add(r,i),i}Re();function Dp(r,e,t){if(!e)if(exports.Assets.resolver.hasKey(r))e=r;else throw new Error(`The image ${r} does not exist in the cache.`);let i=new Ue(t,e);return I.add(r,i),i}async function TO(r,e,t){if(!e)if(exports.Assets.resolver.hasKey(r))e=r;else throw new Error(`The image ${r} does not exist in the cache.`);let i=new Ue(t,e);return await i.load(),I.add(r,i),i}Re();function kp(r,e,t){if(!e)if(exports.Assets.resolver.hasKey(r))e=r;else throw new Error(`The video ${r} does not exist in the cache.`);let i=new nr(t,e);return I.add(r,i),i}async function SO(r,e,t){if(!e)if(exports.Assets.resolver.hasKey(r))e=r;else throw new Error(`The video ${r} does not exist in the cache.`);let i=new nr(t,e);return await i.load(),I.add(r,i),i}function Jw(r,e){if(r.type==="align"){let t,i;e instanceof De&&(t=e.anchor.x,i=e.anchor.y);let s=ut(e.pivot,e.angle),n=ut(e.scale,e.angle);r.x=oi("width",r.x,ui(e),s.x,n.x<0,t),r.y=oi("height",r.y,li(e),s.y,n.y<0,i);}return r.type==="percentage"&&(r.x=ai("width",r.x),r.y=ai("height",r.y)),{x:r.x,y:r.y}}function Op(r,e){if(typeof e=="string")return Cp(e)?kp(r,e):Dp(r,e);if(Array.isArray(e))return Ip(r,e);if(typeof e=="object"&&"value"in e&&"options"in e){if(typeof e.value=="string")return Cp(e.value)?kp(r,e.value,e.options):Dp(r,e.value,e.options);if(Array.isArray(e.value))return Ip(r,e.value,e.options)}return I.add(r,e),e}async function eP(r,e,t={},i){let{forceCompleteBeforeNext:s=true,tickerIdToResume:n=[],...o}=t,a=[];e||(e=r),typeof n=="string"&&(n=[n]);let u;if(I.find(r)&&(u=r+"_temp_disolve",I.editAlias(r,u)),e=Op(r,e),u&&I.copyCanvasElementProperty(u,r),u&&I.transferTickers(u,r,"duplicate"),e.alpha=0,u){let c=Fp(u,{...t,autoplay:false,forceCompleteBeforeNext:s},i);c&&(a.push(...c),n.push(...c));}let l=I.animate(r,{alpha:1},{...o,tickerIdToResume:n,forceCompleteBeforeNext:s},i);if(l&&a.push(l),(e instanceof Ue||e instanceof Ye)&&e.haveEmptyTexture&&await e.load(),a.length>0)return a}function Fp(r,e={},t){let{forceCompleteBeforeNext:i=true,aliasToRemoveAfter:s=[],...n}=e;typeof s=="string"&&(s=[s]),s.push(r);let o=I.animate(r,{alpha:0},{...n,aliasToRemoveAfter:s,forceCompleteBeforeNext:i},t);if(o)return [o]}async function EO(r,e,t={},i){let{forceCompleteBeforeNext:s=true,aliasToRemoveAfter:n=[],...o}=t,a=[];if(e||(e=r),typeof n=="string"&&(n=[n]),!I.find(r))return eP(r,e,t,i);let u=r+"_temp_fade";I.editAlias(r,u),n.push(u),e=Op(r,e),u&&I.copyCanvasElementProperty(u,r),u&&I.transferTickers(u,r,"duplicate"),e.alpha=0;let l=I.animate(r,{alpha:1},{...o,aliasToRemoveAfter:n,forceCompleteBeforeNext:s},i);if(l){let c=Fp(u,{...t,tickerIdToResume:l,forceCompleteBeforeNext:s},i);c&&a.push(...c),a.push(l),I.pauseTicker({id:l});}if((e instanceof Ue||e instanceof Ye)&&e.haveEmptyTexture&&await e.load(),a.length>0)return a}function AO(r,e={},t){return Fp(r,e,t)}async function CO(r,e,t={},i){let{direction:s="right",forceCompleteBeforeNext:n=true,tickerIdToResume:o=[],aliasToRemoveAfter:a=[],removeOldComponentWithMoveOut:u,...l}=t,c=[];e||(e=r),typeof o=="string"&&(o=[o]),typeof a=="string"&&(a=[a]);let h;I.find(r)&&(h=r+"_temp_movein",I.editAlias(r,h)),e=Op(r,e),h&&I.copyCanvasElementProperty(h,r),h&&I.transferTickers(h,r,"move");let d;if(e instanceof Ue||e instanceof Ye?d=e.positionInfo:d={x:e.x,y:e.y,type:"pixel"},h)if(u){let _=W0(h,{...t,autoplay:false,forceCompleteBeforeNext:n},i);_&&(c.push(..._),o.push(..._));}else a.push(h);switch((e instanceof Ue||e instanceof Ye)&&e.haveEmptyTexture&&await e.load(),s){case "up":e.y=I.canvasHeight+e.height;break;case "down":e.y=-e.height;break;case "left":e.x=I.canvasWidth+e.width;break;case "right":e.x=-e.width;break}let f=I.pauseTicker({canvasAlias:r});o.push(...f);let m=I.animate(r,Jw(d,e),{...l,tickerIdToResume:o,aliasToRemoveAfter:a,forceCompleteBeforeNext:n},i);if(m&&c.push(m),c.length>0)return c}function W0(r,e={},t){let{direction:i="right",forceCompleteBeforeNext:s=true,aliasToRemoveAfter:n=[],...o}=e;typeof n=="string"&&(n=[n]),n.push(r);let a=I.find(r);if(!a){E.warn(`The canvas component "${r}" is not found.`);return}let u={x:a.x,y:a.y};switch(i){case "up":u.y=-a.height;break;case "down":u.y=I.canvasHeight+a.height;break;case "left":u.x=-a.width;break;case "right":u.x=I.canvasWidth+a.width;break}I.pauseTicker({canvasAlias:r});let l=I.animate(r,u,{...o,aliasToRemoveAfter:n,forceCompleteBeforeNext:s},t);if(l)return [l]}async function wO(r,e,t={},i){let{direction:s="right",forceCompleteBeforeNext:n=true,tickerIdToResume:o=[],aliasToRemoveAfter:a=[],...u}=t,l=[];e||(e=r),typeof o=="string"&&(o=[o]),typeof a=="string"&&(a=[a]);let c;I.find(r)&&(c=r+"_temp_zoom",I.editAlias(r,c)),e=Op(r,e),c&&I.copyCanvasElementProperty(c,r),c&&I.transferTickers(c,r,"move");let h;e instanceof Ue||e instanceof Ye?h=e.positionInfo:h={x:e.x,y:e.y,type:"pixel"};let d={x:e.pivot.x,y:e.pivot.y},f={x:e.scale.x,y:e.scale.y};if(c)if(t.removeOldComponentWithZoomOut){let x=tP(c,{...t,autoplay:false,forceCompleteBeforeNext:n},i);x&&(l.push(...x),o.push(...x));}else a.push(c);(e instanceof Ue||e instanceof Ye)&&e.haveEmptyTexture&&await e.load(),s=="up"?(e.pivot.y=I.canvasHeight-e.y,e.pivot.x=I.canvasWidth/2-e.x,e.y=I.canvasHeight,e.x=I.canvasWidth/2):s=="down"?(e.pivot.y=0-e.y,e.pivot.x=I.canvasWidth/2-e.x,e.y=0,e.x=I.canvasWidth/2):s=="left"?(e.pivot.x=I.canvasWidth-e.x,e.pivot.y=I.canvasHeight/2-e.y,e.x=I.canvasWidth,e.y=I.canvasHeight/2):s=="right"&&(e.pivot.x=0-e.x,e.pivot.y=I.canvasHeight/2-e.y,e.x=0,e.y=I.canvasHeight/2),e.pivot=qw(e.pivot,e.angle),e.scale.set(0);let m=I.pauseTicker({canvasAlias:r});o.push(...m);let _=I.animate(r,{...Jw(h,e),pivotX:d.x,pivotY:d.y,scaleX:f.x,scaleY:f.y},{...u,tickerIdToResume:o,aliasToRemoveAfter:a,forceCompleteBeforeNext:n},i);if(_&&l.push(_),l.length>0)return l}function tP(r,e={},t){let{direction:i="right",forceCompleteBeforeNext:s=true,aliasToRemoveAfter:n=[],...o}=e;typeof n=="string"&&(n=[n]),n.push(r);let a=I.find(r);if(!a){E.warn(`The canvas component "${r}" is not found.`);return}let u={x:a.x,y:a.y},l={x:a.pivot.x,y:a.pivot.y};i=="down"?(u.y=I.canvasHeight,u.x=I.canvasWidth/2,l.y=I.canvasHeight-u.y,l.x=I.canvasWidth/2-u.x):i=="up"?(u.y=0,u.x=I.canvasWidth/2,l.y=0-u.y,l.x=I.canvasWidth/2-u.x):i=="right"?(u.x=I.canvasWidth,u.y=I.canvasHeight/2,l.x=I.canvasWidth-u.x,l.y=I.canvasHeight/2-u.y):i=="left"&&(u.x=0,u.y=I.canvasHeight/2,l.x=0-u.x,l.y=I.canvasHeight/2-u.y),l=qw(l,a.angle),I.pauseTicker({canvasAlias:r});let c=I.animate(r,{...u,pivotX:l.x,pivotY:l.y,scaleX:0,scaleY:0},{...o,aliasToRemoveAfter:n,forceCompleteBeforeNext:s},t);if(c)return [c]}async function PO(r,e,t={},i){let{direction:s="right",forceCompleteBeforeNext:n=true,tickerIdToResume:o=[],...a}=t,u=[];e||(e=r),typeof o=="string"&&(o=[o]);let l;I.find(r)&&(l=r+"_temp_push",I.editAlias(r,l)),e=Op(r,e),l&&I.copyCanvasElementProperty(l,r),l&&I.transferTickers(l,r,"move");let c;switch((e instanceof Ue||e instanceof Ye)&&e.haveEmptyTexture?c=e.positionInfo:c={x:e.x,y:e.y,type:"pixel"},s){case "up":e.y=I.canvasHeight+e.height;break;case "down":e.y=-e.height;break;case "left":e.x=I.canvasWidth+e.width;break;case "right":e.x=-e.width;break}let h=I.pauseTicker({canvasAlias:r});if(o.push(...h),l){let f=rP(l,{...t,direction:s,forceCompleteBeforeNext:n});f&&u.push(...f);}let d=I.animate(r,Jw(c,e),{...a,tickerIdToResume:o,forceCompleteBeforeNext:n},i);if(d&&u.push(d),(e instanceof Ue||e instanceof Ye)&&e.haveEmptyTexture&&await e.load(),u.length>0)return u}function rP(r,e={direction:"right"},t){return W0(r,e,t)}Re();var Hr=class{constructor(e,t,i){w(this,"id","ticker_id_not_set");w(this,"args");w(this,"duration");w(this,"priority");w(this,"ticker",new _e);w(this,"tickerId");w(this,"canvasElementAliases",[]);w(this,"fnValue");this.args=e,this.duration=t,this.priority=i,this.id=this.constructor.prototype.id;}complete(e){this.stop();}stop(){let e=this.fnValue;if(!e){E.warn("TickerBase.stop() called without fnValue set. This may cause issues.");return}this.ticker.remove(e,null);}start(e){this.tickerId=e;let t=()=>{let{createdByTicketSteps:i}=k._currentTickers[e],s=this.canvasElementAliases;if(i){if(I.isTickerPaused(i.canvasElementAlias,i.id))return}else s=s.filter(n=>!I.isTickerPaused(n,e));return this.fn(this.ticker,this.args,s,e)};this.fnValue=t,this.ticker.add(t,null,this.priority),this.ticker.start();}pause(){this.ticker.stop();}play(){this.ticker.start();}get paused(){return !this.ticker.started}};Re();Re();function go(r){return (r instanceof Ue||r instanceof Ye)&&r.haveEmptyTexture?false:!(r instanceof De&&r.texture?.label=="EMPTY")}function xo(r,e,t){let{limit:i}=t;r[e]===void 0||!t||r[e]===i||(typeof r[e]=="number"?t.type==="linear"?r[e]=iP(r[e],t):t.type==="exponential"&&(r[e]=sP(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=iP(r[e].x,t),r[e].y=iP(r[e].y,t)):t.type==="exponential"&&(r[e].x=sP(r[e].x,t),r[e].y=sP(r[e].y,t))));}function iP(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 sP(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 gN=5,gh=class extends Hr{constructor(e={},t,i){super(e,t,i);}fn(e,t,i,s){t.speed===void 0&&(t.duration===void 0?t.speed=gN: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=I.find(c);return !(!h||o&&!go(h))}).forEach(c=>{let h=I.find(c);if(h&&h instanceof J){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.complete();return}else if(n==="hide"&&h.alpha<=l){this.complete();return}if(u<1e-5&&!(a&&a.type=="linear"&&a.amt!=0)){E.warn("The speed of the FadeAlphaTicker must be greater than 0."),this.complete();return}}}),a&&xo(t,"speed",a);}onComplete(e,t,i){typeof e=="string"&&(e=[e]),e.forEach(s=>{let n=I.find(s);if(n){let o=this.getLimit(i);n.alpha=o;}});}getLimit(e){let{type:t="hide",limit:i=t==="hide"?0:1}=e;return i}speedConvert(e){return e/600}complete(e){let{ignoreTickerSteps:t}=e||{},i=this.tickerId;if(!i){E.warn("TickerBase.complete() called without tickerId set. This may cause issues.");return}this.onComplete(this.canvasElementAliases,i,this.args);let s="aliasToRemoveAfter"in this.args&&this.args.aliasToRemoveAfter||[];typeof s=="string"&&(s=[s]);let n="tickerAliasToResume"in this.args&&this.args.tickerAliasToResume||[];typeof n=="string"&&(n=[n]);let o="tickerIdToResume"in this.args&&this.args.tickerIdToResume||[];typeof o=="string"&&(o=[o]),I.onTickerComplete(i,{aliasToRemoveAfter:s,tickerAliasToResume:n,tickerIdToResume:o,ignoreTickerSteps:t}),super.complete(e);}};ur.add(gh);Re();var nP={};vs(nP,{createExportableElement:()=>pe});var xN=10;function _N(r,e){let t=pe(r.destination);if(t.type==="align"){let i,s;e instanceof De&&(i=e.anchor.x,s=e.anchor.y);let n=ut(e.pivot,e.angle),o=ut(e.scale,e.angle);t.x=oi("width",t.x,ui(e),n.x,o.x<0,i),t.y=oi("height",t.y,li(e),n.y,o.y<0,s);}return t.type==="percentage"&&(t.x=ai("width",t.x),t.y=ai("height",t.y)),t}var xh=class extends Hr{fn(e,t,i,s){t.speed===void 0&&(t.speed=xN);let{speed:n,startOnlyIfHaveTexture:o,speedProgression:a}=t;i.filter(u=>{let l=I.find(u);return !(!l||o&&!go(l))}).forEach(u=>{let l=I.find(u);if(l&&l instanceof J){let c=_N(t,l),h=c.x-l.x,d=c.y-l.y,f=h>0?1:-1,m=d>0?1:-1,_,x;if(typeof n=="number"){let g=this.speedConvert(n);h===0||d===0?_=x=g:(_=Math.abs(h/(h+d))*g,x=Math.abs(d/(h+d))*g);}else _=this.speedConvert(n.x),x=this.speedConvert(n.y);if(_>0){l.x+=f*_*e.deltaTime;let g=c.x-l.x;(f<0&&g>0||f>0&&g<0)&&(l.x=c.x);}if(x>0){l.y+=m*x*e.deltaTime;let g=c.y-l.y;(m<0&&g>0||m>0&&g<0)&&(l.y=c.y);}if(l.x==c.x&&l.y==c.y){this.complete();return}else if(_<1e-5&&x<1e-5&&!(a&&a.type=="linear"&&a.amt!=0)){E.warn("The speed of the MoveTicker must be greater than 0."),this.complete();return}}}),a&&xo(t,"speed",a);}onComplete(e,t,i){typeof e=="string"&&(e=[e]),e.forEach(s=>{let n=I.find(s);if(n){let o=i.destination;n instanceof Ue||n instanceof Ye?n.positionInfo=o:(n.x=o.x,n.y=o.y);}});}speedConvert(e){return e*(66/400)}complete(e){let{ignoreTickerSteps:t}=e||{},i=this.tickerId;if(!i){E.warn("TickerBase.complete() called without tickerId set. This may cause issues.");return}this.onComplete(this.canvasElementAliases,i,this.args);let s="aliasToRemoveAfter"in this.args&&this.args.aliasToRemoveAfter||[];typeof s=="string"&&(s=[s]);let n="tickerAliasToResume"in this.args&&this.args.tickerAliasToResume||[];typeof n=="string"&&(n=[n]);let o="tickerIdToResume"in this.args&&this.args.tickerIdToResume||[];typeof o=="string"&&(o=[o]),I.onTickerComplete(i,{aliasToRemoveAfter:s,tickerAliasToResume:n,tickerIdToResume:o,ignoreTickerSteps:t}),super.complete(e);}};ur.add(xh);Re();var bN=1,_h=class extends Hr{constructor(e={},t,i){super(e,t,i);}fn(e,t,i,s){t.speed===void 0&&(t.speed=bN);let{clockwise:n=true,speedProgression:o,limit:a}=t,u=this.speedConvert(t.speed);i.filter(l=>{let c=I.find(l);return !(!c||t.startOnlyIfHaveTexture&&!go(c))}).forEach(l=>{let c=I.find(l);if(c&&c instanceof J&&(n?c.rotation+=u*e.deltaTime:c.rotation-=u*e.deltaTime,a!==void 0&&(n&&c.angle>=a?(c.angle=a,this.complete()):!n&&c.angle<=a&&(c.angle=a,this.complete())),u<1e-5&&!(o&&o.type=="linear"&&o.amt!=0))){E.warn("The speed of the RotateTicker must be greater than 0."),this.complete();return}}),o&&xo(t,"speed",o);}onComplete(e,t,i){let{limit:s}=i;typeof e=="string"&&(e=[e]),e.forEach(n=>{let o=I.find(n);o&&s!==void 0&&(o.angle=s);});}speedConvert(e){return e/100}complete(e){let{ignoreTickerSteps:t}=e||{},i=this.tickerId;if(!i){E.warn("TickerBase.complete() called without tickerId set. This may cause issues.");return}this.onComplete(this.canvasElementAliases,i,this.args);let s="aliasToRemoveAfter"in this.args&&this.args.aliasToRemoveAfter||[];typeof s=="string"&&(s=[s]);let n="tickerAliasToResume"in this.args&&this.args.tickerAliasToResume||[];typeof n=="string"&&(n=[n]);let o="tickerIdToResume"in this.args&&this.args.tickerIdToResume||[];typeof o=="string"&&(o=[o]),I.onTickerComplete(i,{aliasToRemoveAfter:s,tickerAliasToResume:n,tickerIdToResume:o,ignoreTickerSteps:t}),super.complete(e);}};ur.add(_h);Re();var yN=10,bh=class extends Hr{constructor(e={},t,i){super(e,t,i);}fn(e,t,i,s){t.speed===void 0&&(t.speed=yN);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 f=I.find(d);return !(!f||a&&!go(f))}).forEach(d=>{let f=I.find(d);if(f&&f instanceof J){if(o==="zoom"&&(f.scale.x<h.x||f.scale.y<h.y)?(f.scale.x+=l*e.deltaTime,f.scale.y+=c*e.deltaTime):o==="unzoom"&&(f.scale.x>h.x||f.scale.y>h.y)&&(f.scale.x-=l*e.deltaTime,f.scale.y-=c*e.deltaTime),o==="zoom"){if(f.scale.x>h.x&&(f.scale.x=h.x),f.scale.y>h.y&&(f.scale.y=h.y),f.scale.x>=h.x&&f.scale.y>=h.y){this.complete();return}}else if(o==="unzoom"&&(f.scale.x<h.x&&(f.scale.x=h.x),f.scale.y<h.y&&(f.scale.y=h.y),f.scale.x<=h.x&&f.scale.y<=h.y)){this.complete();return}if((l<1e-5&&c<1e-5||l<1e-5&&f.scale.y==h.y||c<1e-5&&f.scale.x==h.x)&&!(u&&u.type=="linear"&&u.amt!=0)){E.warn("The speed of the ZoomTicker must be greater than 0."),this.complete();return}}}),u&&xo(t,"speed",u);}speedConvert(e){return e/600}onComplete(e,t,i){let{isZoomInOut:s}=i;typeof e=="string"&&(e=[e]),e.forEach(n=>{let o=I.find(n);if(o){let a=this.getLimit(i);if(o.scale.x=a.x,o.scale.y=a.y,s){let{pivot:u,position:l}=s;o.pivot=u.x,o.position=l;}}});}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}}complete(e){let{ignoreTickerSteps:t}=e||{},i=this.tickerId;if(!i){E.warn("TickerBase.complete() called without tickerId set. This may cause issues.");return}this.onComplete(this.canvasElementAliases,i,this.args);let s="aliasToRemoveAfter"in this.args&&this.args.aliasToRemoveAfter||[];typeof s=="string"&&(s=[s]);let n="tickerAliasToResume"in this.args&&this.args.tickerAliasToResume||[];typeof n=="string"&&(n=[n]);let o="tickerIdToResume"in this.args&&this.args.tickerIdToResume||[];typeof o=="string"&&(o=[o]),I.onTickerComplete(i,{aliasToRemoveAfter:s,tickerAliasToResume:n,tickerIdToResume:o,ignoreTickerSteps:t}),super.complete(e);}};ur.add(bh);function oP(r,e){r.indexOf(e)===-1&&r.push(e);}function Du(r,e){let t=r.indexOf(e);t>-1&&r.splice(t,1);}var Mr=(r,e,t)=>t>e?e:t<r?r:t;function Gp(r,e){return e?`${r}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:r}var gs=()=>{},Ht=()=>{};process.env.NODE_ENV!=="production"&&(gs=(r,e,t)=>{!r&&typeof console<"u"&&console.warn(Gp(e,t));},Ht=(r,e,t)=>{if(!r)throw new Error(Gp(e,t))});var lr={};var Up=r=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(r);function aP(r){return typeof r=="object"&&r!==null}var Lp=r=>/^0[^.\s]+$/u.test(r);function ku(r){let e;return ()=>(e===void 0&&(e=r()),e)}var zr=r=>r;var vN=(r,e)=>t=>e(r(t)),Ou=(...r)=>r.reduce(vN);var Fu=(r,e,t)=>{let i=e-r;return i===0?1:(t-r)/i};var Gu=class{constructor(){this.subscriptions=[];}add(e){return oP(this.subscriptions,e),()=>Du(this.subscriptions,e)}notify(e,t,i){let s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](e,t,i);else for(let n=0;n<s;n++){let o=this.subscriptions[n];o&&o(e,t,i);}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0;}};var Dt=r=>r*1e3,xr=r=>r/1e3;function Np(r,e){return e?r*(1e3/e):0}var MO=new Set;function Vp(r,e,t){r||MO.has(e)||(console.warn(Gp(e,t)),MO.add(e));}var RO=(r,e,t)=>{let i=e-r;return ((t-r)%i+i)%i+r};var BO=(r,e,t)=>(((1-3*t+3*e)*r+(3*t-6*e))*r+3*e)*r,TN=1e-7,SN=12;function EN(r,e,t,i,s){let n,o,a=0;do o=e+(t-e)/2,n=BO(o,i,s)-r,n>0?t=o:e=o;while(Math.abs(n)>TN&&++a<SN);return o}function _o(r,e,t,i){if(r===e&&t===i)return zr;let s=n=>EN(n,0,1,r,t);return n=>n===0||n===1?n:BO(s(n),e,i)}var X0=r=>e=>e<=.5?r(2*e)/2:(2-r(2*(1-e)))/2;var Y0=r=>e=>1-r(1-e);var j0=_o(.33,1.53,.69,.99),yh=Y0(j0),Hp=X0(yh);var zp=r=>(r*=2)<1?.5*yh(r):.5*(2-Math.pow(2,-10*(r-1)));var Wp=r=>1-Math.sin(Math.acos(r)),uP=Y0(Wp),Xp=X0(Wp);var lP=_o(.42,0,1,1),cP=_o(0,0,.58,1),Yp=_o(.42,0,.58,1);var jp=r=>Array.isArray(r)&&typeof r[0]!="number";function $p(r,e){return jp(r)?r[RO(0,r.length,e)]:r}var qp=r=>Array.isArray(r)&&typeof r[0]=="number";var IO={linear:zr,easeIn:lP,easeInOut:Yp,easeOut:cP,circIn:Wp,circInOut:Xp,circOut:uP,backIn:yh,backInOut:Hp,backOut:j0,anticipate:zp},AN=r=>typeof r=="string",$0=r=>{if(qp(r)){Ht(r.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");let[e,t,i,s]=r;return _o(e,t,i,s)}else if(AN(r))return Ht(IO[r]!==void 0,`Invalid easing type '${r}'`,"invalid-easing-type"),IO[r];return r};var Kp=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function DO(r,e){let t=new Set,i=new Set,s=false,n=false,o=new WeakSet,a={delta:0,timestamp:0,isProcessing:false};function l(h){o.has(h)&&(c.schedule(h),r()),h(a);}let c={schedule:(h,d=false,f=false)=>{let _=f&&s?t:i;return d&&o.add(h),_.has(h)||_.add(h),h},cancel:h=>{i.delete(h),o.delete(h);},process:h=>{if(a=h,s){n=true;return}s=true,[t,i]=[i,t],t.forEach(l),t.clear(),s=false,n&&(n=false,c.process(h));}};return c}var CN=40;function q0(r,e){let t=false,i=true,s={delta:0,timestamp:0,isProcessing:false},n=()=>t=true,o=Kp.reduce((v,S)=>(v[S]=DO(n),v),{}),{setup:a,read:u,resolveKeyframes:l,preUpdate:c,update:h,preRender:d,render:f,postRender:m}=o,_=()=>{let v=lr.useManualTiming?s.timestamp:performance.now();t=false,lr.useManualTiming||(s.delta=i?1e3/60:Math.max(Math.min(v-s.timestamp,CN),1)),s.timestamp=v,s.isProcessing=true,a.process(s),u.process(s),l.process(s),c.process(s),h.process(s),d.process(s),f.process(s),m.process(s),s.isProcessing=false,t&&e&&(i=false,r(_));},x=()=>{t=true,i=true,s.isProcessing||r(_);};return {schedule:Kp.reduce((v,S)=>{let C=o[S];return v[S]=(A,M=false,D=false)=>(t||x(),C.schedule(A,M,D)),v},{}),cancel:v=>{for(let S=0;S<Kp.length;S++)o[Kp[S]].cancel(v);},state:s,steps:o}}var{schedule:cr,cancel:Th,state:Uu}=q0(typeof requestAnimationFrame<"u"?requestAnimationFrame:zr,true);var K0;function PN(){K0=void 0;}var zt={now:()=>(K0===void 0&&zt.set(Uu.isProcessing||lr.useManualTiming?Uu.timestamp:performance.now()),K0),set:r=>{K0=r,queueMicrotask(PN);}};var kO=r=>e=>typeof e=="string"&&e.startsWith(r),Zp=kO("--"),MN=kO("var(--"),Lu=r=>MN(r)?RN.test(r.split("/*")[0].trim()):false,RN=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;var xs={test:r=>typeof r=="number",parse:parseFloat,transform:r=>r},Xs={...xs,transform:r=>Mr(0,1,r)},Qp={...xs,default:1};var bo=r=>Math.round(r*1e5)/1e5;var Eh=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function OO(r){return r==null}var FO=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;var Ah=(r,e)=>t=>!!(typeof t=="string"&&FO.test(t)&&t.startsWith(r)||e&&!OO(t)&&Object.prototype.hasOwnProperty.call(t,e)),Z0=(r,e,t)=>i=>{if(typeof i!="string")return i;let[s,n,o,a]=i.match(Eh);return {[r]:parseFloat(s),[e]:parseFloat(n),[t]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}};var BN=r=>Mr(0,255,r),hP={...xs,transform:r=>Math.round(BN(r))},_s={test:Ah("rgb","red"),parse:Z0("red","green","blue"),transform:({red:r,green:e,blue:t,alpha:i=1})=>"rgba("+hP.transform(r)+", "+hP.transform(e)+", "+hP.transform(t)+", "+bo(Xs.transform(i))+")"};function IN(r){let e="",t="",i="",s="";return r.length>5?(e=r.substring(1,3),t=r.substring(3,5),i=r.substring(5,7),s=r.substring(7,9)):(e=r.substring(1,2),t=r.substring(2,3),i=r.substring(3,4),s=r.substring(4,5),e+=e,t+=t,i+=i,s+=s),{red:parseInt(e,16),green:parseInt(t,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}}var Jp={test:Ah("#"),parse:IN,transform:_s.transform};var em=r=>({test:e=>typeof e=="string"&&e.endsWith(r)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${r}`}),Gi=em("deg"),Ys=em("%"),ie=em("px"),dP=em("vh"),fP=em("vw"),Q0={...Ys,parse:r=>Ys.parse(r)/100,transform:r=>Ys.transform(r*100)};var yo={test:Ah("hsl","hue"),parse:Z0("hue","saturation","lightness"),transform:({hue:r,saturation:e,lightness:t,alpha:i=1})=>"hsla("+Math.round(r)+", "+Ys.transform(bo(e))+", "+Ys.transform(bo(t))+", "+bo(Xs.transform(i))+")"};var lt={test:r=>_s.test(r)||Jp.test(r)||yo.test(r),parse:r=>_s.test(r)?_s.parse(r):yo.test(r)?yo.parse(r):Jp.parse(r),transform:r=>typeof r=="string"?r:r.hasOwnProperty("red")?_s.transform(r):yo.transform(r),getAnimatableNone:r=>{let e=lt.parse(r);return e.alpha=0,lt.transform(e)}};var GO=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function DN(r){return isNaN(r)&&typeof r=="string"&&(r.match(Eh)?.length||0)+(r.match(GO)?.length||0)>0}var LO="number",NO="color",kN="var",ON="var(",UO="${}",FN=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function vo(r){let e=r.toString(),t=[],i={color:[],number:[],var:[]},s=[],n=0,a=e.replace(FN,u=>(lt.test(u)?(i.color.push(n),s.push(NO),t.push(lt.parse(u))):u.startsWith(ON)?(i.var.push(n),s.push(kN),t.push(u)):(i.number.push(n),s.push(LO),t.push(parseFloat(u))),++n,UO)).split(UO);return {values:t,split:a,indexes:i,types:s}}function VO(r){return vo(r).values}function HO(r){let{split:e,types:t}=vo(r),i=e.length;return s=>{let n="";for(let o=0;o<i;o++)if(n+=e[o],s[o]!==void 0){let a=t[o];a===LO?n+=bo(s[o]):a===NO?n+=lt.transform(s[o]):n+=s[o];}return n}}var GN=r=>typeof r=="number"?0:lt.test(r)?lt.getAnimatableNone(r):r;function UN(r){let e=VO(r);return HO(r)(e.map(GN))}var Wr={test:DN,parse:VO,createTransformer:HO,getAnimatableNone:UN};function pP(r,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?r+(e-r)*6*t:t<1/2?e:t<2/3?r+(e-r)*(2/3-t)*6:r}function zO({hue:r,saturation:e,lightness:t,alpha:i}){r/=360,e/=100,t/=100;let s=0,n=0,o=0;if(!e)s=n=o=t;else {let a=t<.5?t*(1+e):t+e-t*e,u=2*t-a;s=pP(u,a,r+1/3),n=pP(u,a,r),o=pP(u,a,r-1/3);}return {red:Math.round(s*255),green:Math.round(n*255),blue:Math.round(o*255),alpha:i}}function Ch(r,e){return t=>t>0?e:r}var Ui=(r,e,t)=>r+(e-r)*t;var mP=(r,e,t)=>{let i=r*r,s=t*(e*e-i)+i;return s<0?0:Math.sqrt(s)},LN=[Jp,_s,yo],NN=r=>LN.find(e=>e.test(r));function WO(r){let e=NN(r);if(gs(!!e,`'${r}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!e)return false;let t=e.parse(r);return e===yo&&(t=zO(t)),t}var gP=(r,e)=>{let t=WO(r),i=WO(e);if(!t||!i)return Ch(r,e);let s={...t};return n=>(s.red=mP(t.red,i.red,n),s.green=mP(t.green,i.green,n),s.blue=mP(t.blue,i.blue,n),s.alpha=Ui(t.alpha,i.alpha,n),_s.transform(s))};var J0=new Set(["none","hidden"]);function XO(r,e){return J0.has(r)?t=>t<=0?r:e:t=>t>=1?e:r}function VN(r,e){return t=>Ui(r,e,t)}function ev(r){return typeof r=="number"?VN:typeof r=="string"?Lu(r)?Ch:lt.test(r)?gP:WN:Array.isArray(r)?YO:typeof r=="object"?lt.test(r)?gP:HN:Ch}function YO(r,e){let t=[...r],i=t.length,s=r.map((n,o)=>ev(n)(n,e[o]));return n=>{for(let o=0;o<i;o++)t[o]=s[o](n);return t}}function HN(r,e){let t={...r,...e},i={};for(let s in t)r[s]!==void 0&&e[s]!==void 0&&(i[s]=ev(r[s])(r[s],e[s]));return s=>{for(let n in i)t[n]=i[n](s);return t}}function zN(r,e){let t=[],i={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){let n=e.types[s],o=r.indexes[n][i[n]],a=r.values[o]??0;t[s]=a,i[n]++;}return t}var WN=(r,e)=>{let t=Wr.createTransformer(e),i=vo(r),s=vo(e);return i.indexes.var.length===s.indexes.var.length&&i.indexes.color.length===s.indexes.color.length&&i.indexes.number.length>=s.indexes.number.length?J0.has(r)&&!s.values.length||J0.has(e)&&!i.values.length?XO(r,e):Ou(YO(zN(i,s),s.values),t):(gs(true,`Complex values '${r}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),Ch(r,e))};function tv(r,e,t){return typeof r=="number"&&typeof e=="number"&&typeof t=="number"?Ui(r,e,t):ev(r)(r,e)}var jO=r=>{let e=({timestamp:t})=>r(t);return {start:(t=true)=>cr.update(e,t),stop:()=>Th(e),now:()=>Uu.isProcessing?Uu.timestamp:zt.now()}};var rv=(r,e,t=10)=>{let i="",s=Math.max(Math.round(e/t),2);for(let n=0;n<s;n++)i+=Math.round(r(n/(s-1))*1e4)/1e4+", ";return `linear(${i.substring(0,i.length-2)})`};function wh(r){let e=0,t=50,i=r.next(e);for(;!i.done&&e<2e4;)e+=t,i=r.next(e);return e>=2e4?1/0:e}function tm(r,e=100,t){let i=t({...r,keyframes:[0,e]}),s=Math.min(wh(i),2e4);return {type:"keyframes",ease:n=>i.next(s*n).value/e,duration:xr(s)}}var XN=5;function iv(r,e,t){let i=Math.max(e-XN,0);return Np(t-r(i),e-i)}var et={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};var _P=.001;function $O({duration:r=et.duration,bounce:e=et.bounce,velocity:t=et.velocity,mass:i=et.mass}){let s,n;gs(r<=Dt(et.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let o=1-e;o=Mr(et.minDamping,et.maxDamping,o),r=Mr(et.minDuration,et.maxDuration,xr(r)),o<1?(s=l=>{let c=l*o,h=c*r,d=c-t,f=sv(l,o),m=Math.exp(-h);return _P-d/f*m},n=l=>{let h=l*o*r,d=h*t+t,f=Math.pow(o,2)*Math.pow(l,2)*r,m=Math.exp(-h),_=sv(Math.pow(l,2),o);return (-s(l)+_P>0?-1:1)*((d-f)*m)/_}):(s=l=>{let c=Math.exp(-l*r),h=(l-t)*r+1;return -_P+c*h},n=l=>{let c=Math.exp(-l*r),h=(t-l)*(r*r);return c*h});let a=5/r,u=jN(s,n,a);if(r=Dt(r),isNaN(u))return {stiffness:et.stiffness,damping:et.damping,duration:r};{let l=Math.pow(u,2)*i;return {stiffness:l,damping:o*2*Math.sqrt(i*l),duration:r}}}var YN=12;function jN(r,e,t){let i=t;for(let s=1;s<YN;s++)i=i-r(i)/e(i);return i}function sv(r,e){return r*Math.sqrt(1-e*e)}var $N=["duration","bounce"],qN=["stiffness","damping","mass"];function qO(r,e){return e.some(t=>r[t]!==void 0)}function KN(r){let e={velocity:et.velocity,stiffness:et.stiffness,damping:et.damping,mass:et.mass,isResolvedFromDuration:false,...r};if(!qO(r,qN)&&qO(r,$N))if(r.visualDuration){let t=r.visualDuration,i=2*Math.PI/(t*1.2),s=i*i,n=2*Mr(.05,1,1-(r.bounce||0))*Math.sqrt(s);e={...e,mass:et.mass,stiffness:s,damping:n};}else {let t=$O(r);e={...e,...t,mass:et.mass},e.isResolvedFromDuration=true;}return e}function js(r=et.visualDuration,e=et.bounce){let t=typeof r!="object"?{visualDuration:r,keyframes:[0,1],bounce:e}:r,{restSpeed:i,restDelta:s}=t,n=t.keyframes[0],o=t.keyframes[t.keyframes.length-1],a={done:false,value:n},{stiffness:u,damping:l,mass:c,duration:h,velocity:d,isResolvedFromDuration:f}=KN({...t,velocity:-xr(t.velocity||0)}),m=d||0,_=l/(2*Math.sqrt(u*c)),x=o-n,g=xr(Math.sqrt(u/c)),y=Math.abs(x)<5;i||(i=y?et.restSpeed.granular:et.restSpeed.default),s||(s=y?et.restDelta.granular:et.restDelta.default);let v;if(_<1){let C=sv(g,_);v=A=>{let M=Math.exp(-_*g*A);return o-M*((m+_*g*x)/C*Math.sin(C*A)+x*Math.cos(C*A))};}else if(_===1)v=C=>o-Math.exp(-g*C)*(x+(m+g*x)*C);else {let C=g*Math.sqrt(_*_-1);v=A=>{let M=Math.exp(-_*g*A),D=Math.min(C*A,300);return o-M*((m+_*g*x)*Math.sinh(D)+C*x*Math.cosh(D))/C};}let S={calculatedDuration:f&&h||null,next:C=>{let A=v(C);if(f)a.done=C>=h;else {let M=C===0?m:0;_<1&&(M=C===0?Dt(m):iv(v,C,A));let D=Math.abs(M)<=i,R=Math.abs(o-A)<=s;a.done=D&&R;}return a.value=a.done?o:A,a},toString:()=>{let C=Math.min(wh(S),2e4),A=rv(M=>S.next(C*M).value,C,30);return C+"ms "+A},toTransition:()=>{}};return S}js.applyToOptions=r=>{let e=tm(r,100,js);return r.ease=e.ease,r.duration=Dt(e.duration),r.type="keyframes",r};function rm({keyframes:r,velocity:e=0,power:t=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:n=500,modifyTarget:o,min:a,max:u,restDelta:l=.5,restSpeed:c}){let h=r[0],d={done:false,value:h},f=D=>a!==void 0&&D<a||u!==void 0&&D>u,m=D=>a===void 0?u:u===void 0||Math.abs(a-D)<Math.abs(u-D)?a:u,_=t*e,x=h+_,g=o===void 0?x:o(x);g!==x&&(_=g-h);let y=D=>-_*Math.exp(-D/i),v=D=>g+y(D),S=D=>{let R=y(D),L=v(D);d.done=Math.abs(R)<=l,d.value=d.done?g:L;},C,A,M=D=>{f(d.value)&&(C=D,A=js({keyframes:[d.value,m(d.value)],velocity:iv(v,D,d.value),damping:s,stiffness:n,restDelta:l,restSpeed:c}));};return M(0),{calculatedDuration:null,next:D=>{let R=false;return !A&&C===void 0&&(R=true,S(D),M(D)),C!==void 0&&D>=C?A.next(D-C):(!R&&S(D),d)}}}function ZN(r,e,t){let i=[],s=t||lr.mix||tv,n=r.length-1;for(let o=0;o<n;o++){let a=s(r[o],r[o+1]);if(e){let u=Array.isArray(e)?e[o]||zr:e;a=Ou(u,a);}i.push(a);}return i}function KO(r,e,{clamp:t=true,ease:i,mixer:s}={}){let n=r.length;if(Ht(n===e.length,"Both input and output ranges must be the same length","range-length"),n===1)return ()=>e[0];if(n===2&&e[0]===e[1])return ()=>e[1];let o=r[0]===r[1];r[0]>r[n-1]&&(r=[...r].reverse(),e=[...e].reverse());let a=ZN(e,i,s),u=a.length,l=c=>{if(o&&c<r[0])return e[0];let h=0;if(u>1)for(;h<r.length-2&&!(c<r[h+1]);h++);let d=Fu(r[h],r[h+1],c);return a[h](d)};return t?c=>l(Mr(r[0],r[n-1],c)):l}function im(r,e){let t=r[r.length-1];for(let i=1;i<=e;i++){let s=Fu(0,e,i);r.push(Ui(t,1,s));}}function sm(r){let e=[0];return im(e,r.length-1),e}function ZO(r,e){return r.map(t=>t*e)}function QN(r,e){return r.map(()=>e||Yp).splice(0,r.length-1)}function To({duration:r=300,keyframes:e,times:t,ease:i="easeInOut"}){let s=jp(i)?i.map($0):$0(i),n={done:false,value:e[0]},o=ZO(t&&t.length===e.length?t:sm(e),r),a=KO(o,e,{ease:Array.isArray(s)?s:QN(e,s)});return {calculatedDuration:r,next:u=>(n.value=a(u),n.done=u>=r,n)}}var JN=r=>r!==null;function Ph(r,{repeat:e,repeatType:t="loop"},i,s=1){let n=r.filter(JN),a=s<0||e&&t!=="loop"&&e%2===1?0:n.length-1;return !a||i===void 0?n[a]:i}var e5={decay:rm,inertia:rm,tween:To,keyframes:To,spring:js};function nv(r){typeof r.type=="string"&&(r.type=e5[r.type]);}var So=class{constructor(){this.updateFinished();}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e;});}notifyFinished(){this.resolve();}then(e,t){return this.finished.then(e,t)}};var t5=r=>r/100,$s=class extends So{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=false,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{let{motionValue:t}=this.options;t&&t.updatedAt!==zt.now()&&this.tick(zt.now()),this.isStopped=true,this.state!=="idle"&&(this.teardown(),this.options.onStop?.());},this.options=e,this.initAnimation(),this.play(),e.autoplay===false&&this.pause();}initAnimation(){let{options:e}=this;nv(e);let{type:t=To,repeat:i=0,repeatDelay:s=0,repeatType:n,velocity:o=0}=e,{keyframes:a}=e,u=t||To;process.env.NODE_ENV!=="production"&&u!==To&&Ht(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`,"spring-two-frames"),u!==To&&typeof a[0]!="number"&&(this.mixKeyframes=Ou(t5,tv(a[0],a[1])),a=[0,100]);let l=u({...e,keyframes:a});n==="mirror"&&(this.mirroredGenerator=u({...e,keyframes:[...a].reverse(),velocity:-o})),l.calculatedDuration===null&&(l.calculatedDuration=wh(l));let{calculatedDuration:c}=l;this.calculatedDuration=c,this.resolvedDuration=c+s,this.totalDuration=this.resolvedDuration*(i+1)-s,this.generator=l;}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=t;}tick(e,t=false){let{generator:i,totalDuration:s,mixKeyframes:n,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:u}=this;if(this.startTime===null)return i.next(0);let{delay:l=0,keyframes:c,repeat:h,repeatType:d,repeatDelay:f,type:m,onUpdate:_,finalKeyframe:x}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-s/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let g=this.currentTime-l*(this.playbackSpeed>=0?1:-1),y=this.playbackSpeed>=0?g<0:g>s;this.currentTime=Math.max(g,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let v=this.currentTime,S=i;if(h){let D=Math.min(this.currentTime,s)/a,R=Math.floor(D),L=D%1;!L&&D>=1&&(L=1),L===1&&R--,R=Math.min(R,h+1),!!(R%2)&&(d==="reverse"?(L=1-L,f&&(L-=f/a)):d==="mirror"&&(S=o)),v=Mr(0,1,L)*a;}let C=y?{done:false,value:c[0]}:S.next(v);n&&(C.value=n(C.value));let{done:A}=C;!y&&u!==null&&(A=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);let M=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&A);return M&&m!==rm&&(C.value=Ph(c,this.options,x,this.speed)),_&&_(C.value),M&&this.finish(),C}then(e,t){return this.finished.then(e,t)}get duration(){return xr(this.calculatedDuration)}get time(){return xr(this.currentTime)}set time(e){e=Dt(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?.start(false);}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(zt.now());let t=this.playbackSpeed!==e;this.playbackSpeed=e,t&&(this.time=xr(this.currentTime));}play(){if(this.isStopped)return;let{driver:e=jO,startTime:t}=this.options;this.driver||(this.driver=e(s=>this.tick(s))),this.options.onPlay?.();let i=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=i):this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime||(this.startTime=t??i),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start();}pause(){this.state="paused",this.updateTime(zt.now()),this.holdTime=this.currentTime;}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null;}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.();}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.();}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null;}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0);}sample(e){return this.startTime=0,this.tick(e,true)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}};function QO(r){for(let e=1;e<r.length;e++)r[e]??(r[e]=r[e-1]);}var Nu=r=>r*180/Math.PI,bP=r=>{let e=Nu(Math.atan2(r[1],r[0]));return yP(e)},r5={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:r=>(Math.abs(r[0])+Math.abs(r[3]))/2,rotate:bP,rotateZ:bP,skewX:r=>Nu(Math.atan(r[1])),skewY:r=>Nu(Math.atan(r[2])),skew:r=>(Math.abs(r[1])+Math.abs(r[2]))/2},yP=r=>(r=r%360,r<0&&(r+=360),r),JO=bP,eF=r=>Math.sqrt(r[0]*r[0]+r[1]*r[1]),tF=r=>Math.sqrt(r[4]*r[4]+r[5]*r[5]),i5={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:eF,scaleY:tF,scale:r=>(eF(r)+tF(r))/2,rotateX:r=>yP(Nu(Math.atan2(r[6],r[5]))),rotateY:r=>yP(Nu(Math.atan2(-r[2],r[0]))),rotateZ:JO,rotate:JO,skewX:r=>Nu(Math.atan(r[4])),skewY:r=>Nu(Math.atan(r[1])),skew:r=>(Math.abs(r[1])+Math.abs(r[4]))/2};function nm(r){return r.includes("scale")?1:0}function om(r,e){if(!r||r==="none")return nm(e);let t=r.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),i,s;if(t)i=i5,s=t;else {let a=r.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=r5,s=a;}if(!s)return nm(e);let n=i[e],o=s[1].split(",").map(s5);return typeof n=="function"?n(o):o[n]}var vP=(r,e)=>{let{transform:t="none"}=getComputedStyle(r);return om(t,e)};function s5(r){return parseFloat(r.trim())}var Li=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Xr=new Set(Li);var TP=r=>r===xs||r===ie,n5=new Set(["x","y","z"]),o5=Li.filter(r=>!n5.has(r));function rF(r){let e=[];return o5.forEach(t=>{let i=r.getValue(t);i!==void 0&&(e.push([t,i.get()]),i.set(t.startsWith("scale")?1:0));}),e}var Eo={width:({x:r},{paddingLeft:e="0",paddingRight:t="0"})=>r.max-r.min-parseFloat(e)-parseFloat(t),height:({y:r},{paddingTop:e="0",paddingBottom:t="0"})=>r.max-r.min-parseFloat(e)-parseFloat(t),top:(r,{top:e})=>parseFloat(e),left:(r,{left:e})=>parseFloat(e),bottom:({y:r},{top:e})=>parseFloat(e)+(r.max-r.min),right:({x:r},{left:e})=>parseFloat(e)+(r.max-r.min),x:(r,{transform:e})=>om(e,"x"),y:(r,{transform:e})=>om(e,"y")};Eo.translateX=Eo.x;Eo.translateY=Eo.y;var Vu=new Set,SP=false,EP=false,AP=false;function iF(){if(EP){let r=Array.from(Vu).filter(i=>i.needsMeasurement),e=new Set(r.map(i=>i.element)),t=new Map;e.forEach(i=>{let s=rF(i);s.length&&(t.set(i,s),i.render());}),r.forEach(i=>i.measureInitialState()),e.forEach(i=>{i.render();let s=t.get(i);s&&s.forEach(([n,o])=>{i.getValue(n)?.set(o);});}),r.forEach(i=>i.measureEndState()),r.forEach(i=>{i.suspendedScrollY!==void 0&&window.scrollTo(0,i.suspendedScrollY);});}EP=false,SP=false,Vu.forEach(r=>r.complete(AP)),Vu.clear();}function sF(){Vu.forEach(r=>{r.readKeyframes(),r.needsMeasurement&&(EP=true);});}function CP(){AP=true,sF(),iF(),AP=false;}var qs=class{constructor(e,t,i,s,n,o=false){this.state="pending",this.isAsync=false,this.needsMeasurement=false,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=i,this.motionValue=s,this.element=n,this.isAsync=o;}scheduleResolve(){this.state="scheduled",this.isAsync?(Vu.add(this),SP||(SP=true,cr.read(sF),cr.resolveKeyframes(iF))):(this.readKeyframes(),this.complete());}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:i,motionValue:s}=this;if(e[0]===null){let n=s?.get(),o=e[e.length-1];if(n!==void 0)e[0]=n;else if(i&&t){let a=i.readValue(t,o);a!=null&&(e[0]=a);}e[0]===void 0&&(e[0]=o),s&&n===void 0&&s.set(e[0]);}QO(e);}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=false){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Vu.delete(this);}cancel(){this.state==="scheduled"&&(Vu.delete(this),this.state="pending");}resume(){this.state==="pending"&&this.scheduleResolve();}};var nF=r=>r.startsWith("--");function oF(r,e,t){nF(e)?r.style.setProperty(e,t):r.style[e]=t;}var aF=ku(()=>window.ScrollTimeline!==void 0);var uF={};function lF(r,e){let t=ku(r);return ()=>uF[e]??t()}var ov=lF(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"});}catch{return false}return true},"linearEasing");var Hu=([r,e,t,i])=>`cubic-bezier(${r}, ${e}, ${t}, ${i})`;var wP={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Hu([0,.65,.55,1]),circOut:Hu([.55,0,1,.45]),backIn:Hu([.31,.01,.66,-0.59]),backOut:Hu([.33,1.53,.69,.99])};function PP(r,e){if(r)return typeof r=="function"?ov()?rv(r,e):"ease-out":qp(r)?Hu(r):Array.isArray(r)?r.map(t=>PP(t,e)||wP.easeOut):wP[r]}function cF(r,e,t,{delay:i=0,duration:s=300,repeat:n=0,repeatType:o="loop",ease:a="easeOut",times:u}={},l=void 0){let c={[e]:t};u&&(c.offset=u);let h=PP(a,s);Array.isArray(h)&&(c.easing=h);let d={delay:i,duration:s,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:n+1,direction:o==="reverse"?"alternate":"normal"};l&&(d.pseudoElement=l);let f=r.animate(c,d);return f}function zu(r){return typeof r=="function"&&"applyToOptions"in r}function hF({type:r,...e}){return zu(r)&&ov()?r.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}var av=class extends So{constructor(e){if(super(),this.finishedTime=null,this.isStopped=false,!e)return;let{element:t,name:i,keyframes:s,pseudoElement:n,allowFlatten:o=false,finalKeyframe:a,onComplete:u}=e;this.isPseudoElement=!!n,this.allowFlatten=o,this.options=e,Ht(typeof e.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");let l=hF(e);this.animation=cF(t,i,s,l,n),l.autoplay===false&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!n){let c=Ph(s,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(c):oF(t,i,c),this.animation.cancel();}u?.(),this.notifyFinished();};}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished());}pause(){this.animation.pause();}complete(){this.animation.finish?.();}cancel(){try{this.animation.cancel();}catch{}}stop(){if(this.isStopped)return;this.isStopped=true;let{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel());}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.();}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return xr(Number(e))}get time(){return xr(Number(this.animation.currentTime)||0)}set time(e){this.finishedTime=null,this.animation.currentTime=Dt(e);}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e;}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(e){this.animation.startTime=e;}attachTimeline({timeline:e,observe:t}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&aF()?(this.animation.timeline=e,zr):t(this)}};var dF={anticipate:zp,backInOut:Hp,circInOut:Xp};function a5(r){return r in dF}function fF(r){typeof r.ease=="string"&&a5(r.ease)&&(r.ease=dF[r.ease]);}var pF=10,uv=class extends av{constructor(e){fF(e),nv(e),super(e),e.startTime&&(this.startTime=e.startTime),this.options=e;}updateMotionValue(e){let{motionValue:t,onUpdate:i,onComplete:s,element:n,...o}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let a=new $s({...o,autoplay:false}),u=Dt(this.finishedTime??this.time);t.setWithVelocity(a.sample(u-pF).value,a.sample(u).value,pF),a.stop();}};var MP=(r,e)=>e==="zIndex"?false:!!(typeof r=="number"||Array.isArray(r)||typeof r=="string"&&(Wr.test(r)||r==="0")&&!r.startsWith("url("));function u5(r){let e=r[0];if(r.length===1)return true;for(let t=0;t<r.length;t++)if(r[t]!==e)return true}function mF(r,e,t,i){let s=r[0];if(s===null)return false;if(e==="display"||e==="visibility")return true;let n=r[r.length-1],o=MP(s,e),a=MP(n,e);return gs(o===a,`You are trying to animate ${e} from "${s}" to "${n}". "${o?n:s}" is not an animatable value.`,"value-not-animatable"),!o||!a?false:u5(r)||(t==="spring"||zu(t))&&i}function Mh(r){r.duration=0,r.type;}var l5=new Set(["opacity","clipPath","filter","transform"]),c5=ku(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function gF(r){let{motionValue:e,name:t,repeatDelay:i,repeatType:s,damping:n,type:o}=r;if(!(e?.owner?.current instanceof HTMLElement))return false;let{onUpdate:u,transformTemplate:l}=e.owner.getProps();return c5()&&t&&l5.has(t)&&(t!=="transform"||!l)&&!u&&!i&&s!=="mirror"&&n!==0&&o!=="inertia"}var h5=40,am=class extends So{constructor({autoplay:e=true,delay:t=0,type:i="keyframes",repeat:s=0,repeatDelay:n=0,repeatType:o="loop",keyframes:a,name:u,motionValue:l,element:c,...h}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel();},this.createdAt=zt.now();let d={autoplay:e,delay:t,type:i,repeat:s,repeatDelay:n,repeatType:o,name:u,motionValue:l,element:c,...h},f=c?.KeyframeResolver||qs;this.keyframeResolver=new f(a,(m,_,x)=>this.onKeyframesResolved(m,_,d,!x),u,l,c),this.keyframeResolver?.scheduleResolve();}onKeyframesResolved(e,t,i,s){this.keyframeResolver=void 0;let{name:n,type:o,velocity:a,delay:u,isHandoff:l,onUpdate:c}=i;this.resolvedAt=zt.now(),mF(e,n,o,a)||((lr.instantAnimations||!u)&&c?.(Ph(e,i,t)),e[0]=e[e.length-1],Mh(i),i.repeat=0);let d={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>h5?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:t,...i,keyframes:e},f=!l&&gF(d)?new uv({...d,element:d.motionValue.owner.current}):new $s(d);f.finished.then(()=>this.notifyFinished()).catch(zr),this.pendingTimeline&&(this.stopTimeline=f.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=f;}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),CP()),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(e){this.animation.time=e;}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e;}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play();}pause(){this.animation.pause();}complete(){this.animation.complete();}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel();}};var lv=class{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean);}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let i=0;i<this.animations.length;i++)this.animations[i][e]=t;}attachTimeline(e){let t=this.animations.map(i=>i.attachTimeline(e));return ()=>{t.forEach((i,s)=>{i&&i(),this.animations[s].stop();});}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e);}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e);}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){let e=0;for(let t=0;t<this.animations.length;t++)e=Math.max(e,this.animations[t].duration);return e}runAll(e){this.animations.forEach(t=>t[e]());}play(){this.runAll("play");}pause(){this.runAll("pause");}cancel(){this.runAll("cancel");}complete(){this.runAll("complete");}};var um=class extends lv{then(e,t){return this.finished.finally(e).then(()=>{})}};var d5=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function f5(r){let e=d5.exec(r);if(!e)return [,];let[,t,i,s]=e;return [`--${t??i}`,s]}var p5=4;function RP(r,e,t=1){Ht(t<=p5,`Max CSS variable fallback depth detected in property "${r}". This may indicate a circular fallback dependency.`,"max-css-var-depth");let[i,s]=f5(r);if(!i)return;let n=window.getComputedStyle(e).getPropertyValue(i);if(n){let o=n.trim();return Up(o)?parseFloat(o):o}return Lu(s)?RP(s,e,t+1):s}function lm(r,e){return r?.[e]??r?.default??r}var cm=new Set(["width","height","top","left","right","bottom",...Li]);var xF={test:r=>r==="auto",parse:r=>r};var cv=r=>e=>e.test(r);var BP=[xs,ie,Ys,Gi,fP,dP,xF],IP=r=>BP.find(cv(r));function _F(r){return typeof r=="number"?r===0:r!==null?r==="none"||r==="0"||Lp(r):true}var m5=new Set(["brightness","contrast","saturate","opacity"]);function g5(r){let[e,t]=r.slice(0,-1).split("(");if(e==="drop-shadow")return r;let[i]=t.match(Eh)||[];if(!i)return r;let s=t.replace(i,""),n=m5.has(e)?1:0;return i!==t&&(n*=100),e+"("+n+s+")"}var x5=/\b([a-z-]*)\(.*?\)/gu,hm={...Wr,getAnimatableNone:r=>{let e=r.match(x5);return e?e.map(g5).join(" "):r}};var DP={...xs,transform:Math.round};var bF={rotate:Gi,rotateX:Gi,rotateY:Gi,rotateZ:Gi,scale:Qp,scaleX:Qp,scaleY:Qp,scaleZ:Qp,skew:Gi,skewX:Gi,skewY:Gi,distance:ie,translateX:ie,translateY:ie,translateZ:ie,x:ie,y:ie,z:ie,perspective:ie,transformPerspective:ie,opacity:Xs,originX:Q0,originY:Q0,originZ:ie};var Wu={borderWidth:ie,borderTopWidth:ie,borderRightWidth:ie,borderBottomWidth:ie,borderLeftWidth:ie,borderRadius:ie,radius:ie,borderTopLeftRadius:ie,borderTopRightRadius:ie,borderBottomRightRadius:ie,borderBottomLeftRadius:ie,width:ie,maxWidth:ie,height:ie,maxHeight:ie,top:ie,right:ie,bottom:ie,left:ie,padding:ie,paddingTop:ie,paddingRight:ie,paddingBottom:ie,paddingLeft:ie,margin:ie,marginTop:ie,marginRight:ie,marginBottom:ie,marginLeft:ie,backgroundPositionX:ie,backgroundPositionY:ie,...bF,zIndex:DP,fillOpacity:Xs,strokeOpacity:Xs,numOctaves:DP};var yF={...Wu,color:lt,backgroundColor:lt,outlineColor:lt,fill:lt,stroke:lt,borderColor:lt,borderTopColor:lt,borderRightColor:lt,borderBottomColor:lt,borderLeftColor:lt,filter:hm,WebkitFilter:hm},dm=r=>yF[r];function fm(r,e){let t=dm(r);return t!==hm&&(t=Wr),t.getAnimatableNone?t.getAnimatableNone(e):void 0}var _5=new Set(["auto","none","0"]);function vF(r,e,t){let i=0,s;for(;i<r.length&&!s;){let n=r[i];typeof n=="string"&&!_5.has(n)&&vo(n).values.length&&(s=r[i]),i++;}if(s&&t)for(let n of e)r[n]=fm(t,s);}var pm=class extends qs{constructor(e,t,i,s,n){super(e,t,i,s,n,true);}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:i}=this;if(!t||!t.current)return;super.readKeyframes();for(let u=0;u<e.length;u++){let l=e[u];if(typeof l=="string"&&(l=l.trim(),Lu(l))){let c=RP(l,t.current);c!==void 0&&(e[u]=c),u===e.length-1&&(this.finalKeyframe=l);}}if(this.resolveNoneKeyframes(),!cm.has(i)||e.length!==2)return;let[s,n]=e,o=IP(s),a=IP(n);if(o!==a)if(TP(o)&&TP(a))for(let u=0;u<e.length;u++){let l=e[u];typeof l=="string"&&(e[u]=parseFloat(l));}else Eo[i]&&(this.needsMeasurement=true);}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,i=[];for(let s=0;s<e.length;s++)(e[s]===null||_F(e[s]))&&i.push(s);i.length&&vF(e,i,t);}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:i}=this;if(!e||!e.current)return;i==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Eo[i](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let s=t[t.length-1];s!==void 0&&e.getValue(i,s).jump(s,false);}measureEndState(){let{element:e,name:t,unresolvedKeyframes:i}=this;if(!e||!e.current)return;let s=e.getValue(t);s&&s.jump(this.measuredOrigin,false);let n=i.length-1,o=i[n];i[n]=Eo[t](e.measureViewportBox(),window.getComputedStyle(e.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),this.removedTransforms?.length&&this.removedTransforms.forEach(([a,u])=>{e.getValue(a).set(u);}),this.resolveNoneKeyframes();}};function kP(r,e,t){if(r instanceof EventTarget)return [r];if(typeof r=="string"){let i=document;let s=t?.[r]??i.querySelectorAll(r);return s?Array.from(s):[]}return Array.from(r)}var mm=(r,e)=>e&&typeof r=="number"?e.transform(r):r;var TF=30,b5=r=>!isNaN(parseFloat(r)),hv=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=i=>{let s=zt.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(i),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let n of this.dependents)n.dirty();},this.hasAnimated=false,this.setCurrent(e),this.owner=t.owner;}setCurrent(e){this.current=e,this.updatedAt=zt.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=b5(this.current));}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt;}onChange(e){return process.env.NODE_ENV!=="production"&&Vp(false,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new Gu);let i=this.events[e].add(t);return e==="change"?()=>{i(),cr.read(()=>{this.events.change.getSize()||this.stop();});}:i}clearListeners(){for(let e in this.events)this.events[e].clear();}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t;}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e);}setWithVelocity(e,t,i){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-i;}jump(e,t=true){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect();}dirty(){this.events.change?.notify(this.current);}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e);}removeDependent(e){this.dependents&&this.dependents.delete(e);}get(){return this.current}getPrevious(){return this.prev}getVelocity(){let e=zt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>TF)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,TF);return Np(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=true,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify();}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation();})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation();}isAnimating(){return !!this.animation}clearAnimation(){delete this.animation;}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect();}};function bs(r,e){return new hv(r,e)}var{schedule:FP}=q0(queueMicrotask,false);function gm(r){return aP(r)&&"ownerSVGElement"in r}function GP(r){return gm(r)&&r.tagName==="svg"}var tt=r=>!!(r&&r.getVelocity);var v5=[...BP,lt,Wr],UP=r=>v5.find(cv(r));function xm(r){return typeof r=="object"&&!Array.isArray(r)}function dv(r,e,t,i){return typeof r=="string"&&xm(e)?kP(r,t,i):r instanceof NodeList?Array.from(r):Array.isArray(r)?r:[r]}function SF(r,e,t){return r*(e+1)}function LP(r,e,t,i){return typeof e=="number"?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,r+parseFloat(e)):e==="<"?t:e.startsWith("<")?Math.max(0,t+parseFloat(e.slice(1))):i.get(e)??r}function T5(r,e,t){for(let i=0;i<r.length;i++){let s=r[i];s.at>e&&s.at<t&&(Du(r,s),i--);}}function EF(r,e,t,i,s,n){T5(r,s,n);for(let o=0;o<e.length;o++)r.push({value:e[o],at:Ui(s,n,i[o]),easing:$p(t,o)});}function AF(r,e){for(let t=0;t<r.length;t++)r[t]=r[t]/(e+1);}function CF(r,e){return r.at===e.at?r.value===null?1:e.value===null?-1:0:r.at-e.at}var S5="easeInOut",E5=20;function MF(r,{defaultTransition:e={},...t}={},i,s){let n=e.duration||.3,o=new Map,a=new Map,u={},l=new Map,c=0,h=0,d=0;for(let f=0;f<r.length;f++){let m=r[f];if(typeof m=="string"){l.set(m,h);continue}else if(!Array.isArray(m)){l.set(m.name,LP(h,m.at,c,l));continue}let[_,x,g={}]=m;g.at!==void 0&&(h=LP(h,g.at,c,l));let y=0,v=(S,C,A,M=0,D=0)=>{let R=A5(S),{delay:L=0,times:F=sm(R),type:se="keyframes",repeat:ye,repeatType:ft,repeatDelay:ys=0,...X}=C,{ease:q=e.ease||"easeOut",duration:Rr}=C,Le=typeof L=="function"?L(M,D):L,di=R.length,Zs=zu(se)?se:s?.[se||"keyframes"];if(di<=2&&Zs){let Vi=100;if(di===2&&P5(R)){let en=R[1]-R[0];Vi=Math.abs(en);}let Hi={...X};Rr!==void 0&&(Hi.duration=Dt(Rr));let Mo=tm(Hi,Vi,Zs);q=Mo.ease,Rr=Mo.duration;}Rr??(Rr=n);let Qs=h+Le;F.length===1&&F[0]===0&&(F[1]=1);let Js=F.length-R.length;if(Js>0&&im(F,Js),R.length===1&&R.unshift(null),ye){Ht(ye<E5,"Repeat count too high, must be less than 20","repeat-count-high"),Rr=SF(Rr,ye);let Vi=[...R],Hi=[...F];q=Array.isArray(q)?[...q]:[q];let Mo=[...q];for(let en=0;en<ye;en++){R.push(...Vi);for(let zi=0;zi<Vi.length;zi++)F.push(Hi[zi]+(en+1)),q.push(zi===0?"linear":$p(Mo,zi-1));}AF(F,ye);}let Oh=Qs+Rr;EF(A,R,q,F,Qs,Oh),y=Math.max(Le+Rr,y),d=Math.max(Oh,d);};if(tt(_)){let S=wF(_,a);v(x,g,PF("default",S));}else {let S=dv(_,x,i,u),C=S.length;for(let A=0;A<C;A++){x=x,g=g;let M=S[A],D=wF(M,a);for(let R in x)v(x[R],C5(g,R),PF(R,D),A,C);}}c=h,h+=y;}return a.forEach((f,m)=>{for(let _ in f){let x=f[_];x.sort(CF);let g=[],y=[],v=[];for(let C=0;C<x.length;C++){let{at:A,value:M,easing:D}=x[C];g.push(M),y.push(Fu(0,d,A)),v.push(D||"easeOut");}y[0]!==0&&(y.unshift(0),g.unshift(g[0]),v.unshift(S5)),y[y.length-1]!==1&&(y.push(1),g.push(null)),o.has(m)||o.set(m,{keyframes:{},transition:{}});let S=o.get(m);S.keyframes[_]=g,S.transition[_]={...e,duration:d,ease:v,times:y,...t};}}),o}function wF(r,e){return !e.has(r)&&e.set(r,{}),e.get(r)}function PF(r,e){return e[r]||(e[r]=[]),e[r]}function A5(r){return Array.isArray(r)?r:[r]}function C5(r,e){return r&&r[e]?{...r,...r[e]}:{...r}}var w5=r=>typeof r=="number",P5=r=>r.every(w5);var Ao=new WeakMap;var RF=r=>Array.isArray(r);function BF(r){let e=[{},{}];return r?.values.forEach((t,i)=>{e[0][i]=t.get(),e[1][i]=t.getVelocity();}),e}function fv(r,e,t,i){if(typeof e=="function"){let[s,n]=BF(i);e=e(t!==void 0?t:r.custom,s,n);}if(typeof e=="string"&&(e=r.variants&&r.variants[e]),typeof e=="function"){let[s,n]=BF(i);e=e(t!==void 0?t:r.custom,s,n);}return e}function IF(r,e,t){let i=r.getProps();return fv(i,e,i.custom,r)}function M5(r,e,t){r.hasValue(e)?r.getValue(e).set(t):r.addValue(e,bs(t));}function R5(r){return RF(r)?r[r.length-1]||0:r}function DF(r,e){let t=IF(r,e),{transitionEnd:i={},transition:s={},...n}=t||{};n={...n,...i};for(let o in n){let a=R5(n[o]);M5(r,o,a);}}function kF(r){return !!(tt(r)&&r.add)}function OF(r,e){let t=r.getValue("willChange");if(kF(t))return t.add(e);if(!t&&lr.WillChange){let i=new lr.WillChange("auto");r.addValue("willChange",i),i.add(e);}}var Rh=r=>r.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase();var B5="framerAppearId",FF="data-"+Rh(B5);function GF(r){return r.props[FF]}var I5=r=>r!==null;function UF(r,{repeat:e,repeatType:t="loop"},i){let s=r.filter(I5),n=e&&t!=="loop"&&e%2===1?0:s.length-1;return !n||i===void 0?s[n]:i}var D5={type:"spring",stiffness:500,damping:25,restSpeed:10},k5=r=>({type:"spring",stiffness:550,damping:r===0?2*Math.sqrt(550):30,restSpeed:10}),O5={type:"keyframes",duration:.8},F5={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},LF=(r,{keyframes:e})=>e.length>2?O5:Xr.has(r)?r.startsWith("scale")?k5(e[1]):D5:F5;function NF({when:r,delay:e,delayChildren:t,staggerChildren:i,staggerDirection:s,repeat:n,repeatType:o,repeatDelay:a,from:u,elapsed:l,...c}){return !!Object.keys(c).length}var pv=(r,e,t,i={},s,n)=>o=>{let a=lm(i,r)||{},u=a.delay||i.delay||0,{elapsed:l=0}=i;l=l-Dt(u);let c={keyframes:Array.isArray(t)?t:[null,t],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-l,onUpdate:d=>{e.set(d),a.onUpdate&&a.onUpdate(d);},onComplete:()=>{o(),a.onComplete&&a.onComplete();},name:r,motionValue:e,element:n?void 0:s};NF(a)||Object.assign(c,LF(r,c)),c.duration&&(c.duration=Dt(c.duration)),c.repeatDelay&&(c.repeatDelay=Dt(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let h=false;if((c.type===false||c.duration===0&&!c.repeatDelay)&&(Mh(c),c.delay===0&&(h=true)),(lr.instantAnimations||lr.skipAnimations)&&(h=true,Mh(c),c.delay=0),c.allowFlatten=!a.type&&!a.ease,h&&!n&&e.get()!==void 0){let d=UF(c.keyframes,a);if(d!==void 0){cr.update(()=>{c.onUpdate(d),c.onComplete();});return}}return a.isSync?new $s(c):new am(c)};function G5({protectedKeys:r,needsAnimating:e},t){let i=r.hasOwnProperty(t)&&e[t]!==true;return e[t]=false,i}function VF(r,e,{delay:t=0,transitionOverride:i,type:s}={}){let{transition:n=r.getDefaultTransition(),transitionEnd:o,...a}=e;i&&(n=i);let u=[],l=s&&r.animationState&&r.animationState.getState()[s];for(let c in a){let h=r.getValue(c,r.latestValues[c]??null),d=a[c];if(d===void 0||l&&G5(l,c))continue;let f={delay:t,...lm(n||{},c)},m=h.get();if(m!==void 0&&!h.isAnimating&&!Array.isArray(d)&&d===m&&!f.velocity)continue;let _=false;if(window.MotionHandoffAnimation){let g=GF(r);if(g){let y=window.MotionHandoffAnimation(g,c,cr);y!==null&&(f.startTime=y,_=true);}}OF(r,c),h.start(pv(c,h,d,r.shouldReduceMotion&&cm.has(c)?{type:false}:f,r,_));let x=h.animation;x&&u.push(x);}return o&&Promise.all(u).then(()=>{cr.update(()=>{o&&DF(r,o);});}),u}function HF({top:r,left:e,right:t,bottom:i}){return {x:{min:e,max:t},y:{min:r,max:i}}}function zF(r,e){if(!e)return r;let t=e({x:r.left,y:r.top}),i=e({x:r.right,y:r.bottom});return {top:t.y,left:t.x,bottom:i.y,right:i.x}}function WF(r,e){return HF(zF(r.getBoundingClientRect(),e))}var XF={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},mv={};for(let r in XF)mv[r]={isEnabled:e=>XF[r].some(t=>!!e[t])};var YF=()=>({min:0,max:0}),Bh=()=>({x:YF(),y:YF()});var jF=typeof window<"u";var _m={current:null},gv={current:false};function $F(){if(gv.current=true,!!jF)if(window.matchMedia){let r=window.matchMedia("(prefers-reduced-motion)"),e=()=>_m.current=r.matches;r.addEventListener("change",e),e();}else _m.current=false;}function qF(r){return r!==null&&typeof r=="object"&&typeof r.start=="function"}function KF(r){return typeof r=="string"||Array.isArray(r)}var U5=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ZF=["initial",...U5];function NP(r){return qF(r.animate)||ZF.some(e=>KF(r[e]))}function QF(r){return !!(NP(r)||r.variants)}function JF(r,e,t){for(let i in e){let s=e[i],n=t[i];if(tt(s))r.addValue(i,s);else if(tt(n))r.addValue(i,bs(s,{owner:r}));else if(n!==s)if(r.hasValue(i)){let o=r.getValue(i);o.liveStyle===true?o.jump(s):o.hasAnimated||o.set(s);}else {let o=r.getStaticValue(i);r.addValue(i,bs(o!==void 0?o:s,{owner:r}));}}for(let i in t)e[i]===void 0&&r.removeValue(i);return e}var eG=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],Ih=class{scrapeMotionValuesFromProps(e,t,i){return {}}constructor({parent:e,props:t,presenceContext:i,reducedMotionConfig:s,blockInitialAnimation:n,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=false,this.isControllingVariants=false,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=qs,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection));},this.renderScheduledAt=0,this.scheduleRender=()=>{let d=zt.now();this.renderScheduledAt<d&&(this.renderScheduledAt=d,cr.render(this.render,false,true));};let{latestValues:u,renderState:l}=o;this.latestValues=u,this.baseTarget={...u},this.initialValues=t.initial?{...u}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=i,this.depth=e?e.depth+1:0,this.reducedMotionConfig=s,this.options=a,this.blockInitialAnimation=!!n,this.isControllingVariants=NP(t),this.isVariantNode=QF(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:c,...h}=this.scrapeMotionValuesFromProps(t,{},this);for(let d in h){let f=h[d];u[d]!==void 0&&tt(f)&&f.set(u[d]);}}mount(e){this.current=e,Ao.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,i)=>this.bindToMotionValue(i,t)),gv.current||$F(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?false:this.reducedMotionConfig==="always"?true:_m.current,process.env.NODE_ENV!=="production"&&Vp(this.shouldReduceMotion!==true,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),this.parent?.addChild(this),this.update(this.props,this.presenceContext);}unmount(){this.projection&&this.projection.unmount(),Th(this.notifyUpdate),Th(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=false);}this.current=null;}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e);}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e);}bindToMotionValue(e,t){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();let i=Xr.has(e);i&&this.onBindTransform&&this.onBindTransform();let s=t.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&cr.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=true),this.scheduleRender();}),n;window.MotionCheckAppearSync&&(n=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{s(),n&&n(),t.owner&&t.stop();});}sortNodePosition(e){return !this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in mv){let t=mv[e];if(!t)continue;let{isEnabled:i,Feature:s}=t;if(!this.features[e]&&s&&i(this.props)&&(this.features[e]=new s(this)),this.features[e]){let n=this.features[e];n.isMounted?n.update():(n.mount(),n.isMounted=true);}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props);}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Bh()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t;}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let i=0;i<eG.length;i++){let s=eG[i];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);let n="on"+s,o=e[n];o&&(this.propEventSubscriptions[s]=this.on(s,o));}this.prevMotionValues=JF(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue();}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let i=this.values.get(e);t!==i&&(i&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get());}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState);}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let i=this.values.get(e);return i===void 0&&t!==void 0&&(i=bs(t===null?void 0:t,{owner:this}),this.addValue(e,i)),i}readValue(e,t){let i=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return i!=null&&(typeof i=="string"&&(Up(i)||Lp(i))?i=parseFloat(i):!UP(i)&&Wr.test(t)&&(i=fm(e,t)),this.setBaseTarget(e,tt(i)?i.get():i)),tt(i)?i.get():i}setBaseTarget(e,t){this.baseTarget[e]=t;}getBaseTarget(e){let{initial:t}=this.props,i;if(typeof t=="string"||typeof t=="object"){let n=fv(this.props,t,this.presenceContext?.custom);n&&(i=n[e]);}if(t&&i!==void 0)return i;let s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!tt(s)?s:this.initialValues[e]!==void 0&&i===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new Gu),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t);}scheduleRenderMicrotask(){FP.render(this.render);}};var Dh=class extends Ih{constructor(){super(...arguments),this.KeyframeResolver=pm;}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){return e.style?e.style[t]:void 0}removeValueFromRenderState(e,{vars:t,style:i}){delete t[e],delete i[e];}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;tt(e)&&(this.childSubscription=e.on("change",t=>{this.current&&(this.current.textContent=`${t}`);}));}};var L5={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},N5=Li.length;function tG(r,e,t){let i="",s=true;for(let n=0;n<N5;n++){let o=Li[n],a=r[o];if(a===void 0)continue;let u=true;if(typeof a=="number"?u=a===(o.startsWith("scale")?1:0):u=parseFloat(a)===0,!u||t){let l=mm(a,Wu[o]);if(!u){s=false;let c=L5[o]||o;i+=`${c}(${l}) `;}t&&(e[o]=l);}}return i=i.trim(),t?i=t(e,s?"":i):s&&(i="none"),i}function xv(r,e,t){let{style:i,vars:s,transformOrigin:n}=r,o=false,a=false;for(let u in e){let l=e[u];if(Xr.has(u)){o=true;continue}else if(Zp(u)){s[u]=l;continue}else {let c=mm(l,Wu[u]);u.startsWith("origin")?(a=true,n[u]=c):i[u]=c;}}if(e.transform||(o||t?i.transform=tG(e,r.transform,t):i.transform&&(i.transform="none")),a){let{originX:u="50%",originY:l="50%",originZ:c=0}=n;i.transformOrigin=`${u} ${l} ${c}`;}}function _v(r,{style:e,vars:t},i,s){let n=r.style,o;for(o in e)n[o]=e[o];s?.applyProjectionStyles(n,i);for(o in t)n.setProperty(o,t[o]);}var rG={};function iG(r,{layout:e,layoutId:t}){return Xr.has(r)||r.startsWith("origin")||(e||t!==void 0)&&(!!rG[r]||r==="opacity")}function bv(r,e,t){let{style:i}=r,s={};for(let n in i)(tt(i[n])||e.style&&tt(e.style[n])||iG(n,r)||t?.getValue(n)?.liveStyle!==void 0)&&(s[n]=i[n]);return s}function V5(r){return window.getComputedStyle(r)}var yv=class extends Dh{constructor(){super(...arguments),this.type="html",this.renderInstance=_v;}readValueFromInstance(e,t){if(Xr.has(t))return this.projection?.isProjecting?nm(t):vP(e,t);{let i=V5(e),s=(Zp(t)?i.getPropertyValue(t):i[t])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(e,{transformPagePoint:t}){return WF(e,t)}build(e,t,i){xv(e,t,i.transformTemplate);}scrapeMotionValuesFromProps(e,t,i){return bv(e,t,i)}};function H5(r,e){return r in e}var vv=class extends Ih{constructor(){super(...arguments),this.type="object";}readValueFromInstance(e,t){if(H5(t,e)){let i=e[t];if(typeof i=="string"||typeof i=="number")return i}}getBaseTargetFromProps(){}removeValueFromRenderState(e,t){delete t.output[e];}measureInstanceViewportBox(){return Bh()}build(e,t){Object.assign(e.output,t);}renderInstance(e,{output:t}){Object.assign(e,t);}sortInstanceNodePosition(){return 0}};var z5={offset:"stroke-dashoffset",array:"stroke-dasharray"},W5={offset:"strokeDashoffset",array:"strokeDasharray"};function sG(r,e,t=1,i=0,s=true){r.pathLength=1;let n=s?z5:W5;r[n.offset]=ie.transform(-i);let o=ie.transform(e),a=ie.transform(t);r[n.array]=`${o} ${a}`;}function nG(r,{attrX:e,attrY:t,attrScale:i,pathLength:s,pathSpacing:n=1,pathOffset:o=0,...a},u,l,c){if(xv(r,a,l),u){r.style.viewBox&&(r.attrs.viewBox=r.style.viewBox);return}r.attrs=r.style,r.style={};let{attrs:h,style:d}=r;h.transform&&(d.transform=h.transform,delete h.transform),(d.transform||h.transformOrigin)&&(d.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),d.transform&&(d.transformBox=c?.transformBox??"fill-box",delete h.transformBox),e!==void 0&&(h.x=e),t!==void 0&&(h.y=t),i!==void 0&&(h.scale=i),s!==void 0&&sG(h,s,n,o,false);}var Tv=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);var oG=r=>typeof r=="string"&&r.toLowerCase()==="svg";function aG(r,e,t,i){_v(r,e,void 0,i);for(let s in e.attrs)r.setAttribute(Tv.has(s)?s:Rh(s),e.attrs[s]);}function uG(r,e,t){let i=bv(r,e,t);for(let s in r)if(tt(r[s])||tt(e[s])){let n=Li.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;i[n]=r[s];}return i}var Sv=class extends Dh{constructor(){super(...arguments),this.type="svg",this.isSVGTag=false,this.measureInstanceViewportBox=Bh;}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(Xr.has(t)){let i=dm(t);return i&&i.default||0}return t=Tv.has(t)?t:Rh(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,i){return uG(e,t,i)}build(e,t,i){nG(e,t,this.isSVGTag,i.transformTemplate,i.style);}renderInstance(e,t,i,s){aG(e,t,i,s);}mount(e){this.isSVGTag=oG(e.tagName),super.mount(e);}};function lG(r){let e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},t=gm(r)&&!GP(r)?new Sv(e):new yv(e);t.mount(r),Ao.set(r,t);}function cG(r){let e={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},t=new vv(e);t.mount(r),Ao.set(r,t);}function hG(r,e,t){let i=tt(r)?r:bs(r);return i.start(pv("",i,e,t)),i.animation}function X5(r,e){return tt(r)||typeof r=="number"||typeof r=="string"&&!xm(e)}function Ev(r,e,t,i){let s=[];if(X5(r,e))s.push(hG(r,xm(e)&&e.default||e,t&&(t.default||t)));else {let n=dv(r,e,i),o=n.length;Ht(!!o,"No valid elements provided.","no-valid-elements");for(let a=0;a<o;a++){let u=n[a];Ht(u!==null,"You're trying to perform an animation on null. Ensure that selectors are correctly finding elements and refs are correctly hydrated.","animate-null");let l=u instanceof Element?lG:cG;Ao.has(u)||l(u);let c=Ao.get(u),h={...t};"delay"in h&&typeof h.delay=="function"&&(h.delay=h.delay(a,o)),s.push(...VF(c,{...e,transition:h},{}));}}return s}function dG(r,e,t){let i=[];return MF(r,e,t,{spring:js}).forEach(({keyframes:n,transition:o},a)=>{i.push(...Ev(a,n,o));}),i}function Y5(r){return Array.isArray(r)&&r.some(Array.isArray)}function fG(r){function e(t,i,s){let n=[];Y5(t)?n=dG(t,i,r):n=Ev(t,i,s,r);let o=new um(n);return o}return e}var Av=fG();Re();function j5(r,e,t){if(Array.isArray(r)&&Array.isArray(r[0])){let i=r.map(s=>{let{ticker:n=new _e,...o}=s[2]||{};return [s[0],s[1],{driver:a=>{let u=({lastTime:l})=>a(l);return {start:(l=true)=>{n.add(u),n.start();},stop:()=>n.remove(u),now:()=>n.lastTime}},...o}]});return Av(i,e)}else {let{ticker:i=new _e}=t||{};return Av(r,e,{driver:s=>{let n=({lastTime:o})=>s(o);return {start:(o=true)=>{i.add(n),i.start();},stop:()=>i.remove(n),now:()=>i.lastTime}},...t||{}})}}var mh=j5;var I=new Mp;Pr.init({getScreen:()=>I.screen});var zP={};vs(zP,{CharacterBaseModel:()=>ym,CharacterStoredClass:()=>Xu,RegisteredCharacters:()=>pG});var ne=class ne{static init(e){ne._getStepCounter=e.getStepCounter,ne._setStepCounter=e.setStepCounter,ne._getCurrentGameStepState=e.getCurrentGameStepState,ne._restoreGameStepState=e.restoreGameStepState,ne._getOpenedLabels=e.getOpenedLabels,e.onGoNextEnd&&(ne._onGoNextEnd=e.onGoNextEnd),ne._getVariable=e.getVariable,ne._setVariable=e.setVariable,ne._removeVariable=e.removeVariable,ne._getFlag=e.getFlag,ne._setFlag=e.setFlag,e.onLabelClosing&&(ne._onLabelClosing=e.onLabelClosing),ne._addHistoryItem=e.addHistoryItem,ne._getCurrentStepsRunningNumber=e.getCurrentStepsRunningNumber,ne._getCharacter=e.getCharacter;}static get stepCounter(){return ne._getStepCounter()}static set stepCounter(e){ne._setStepCounter(e);}static get currentGameStepState(){return ne._getCurrentGameStepState()}static get restoreGameStepState(){return ne._restoreGameStepState}static get openedLabels(){return ne._getOpenedLabels()}static get onGoNextEnd(){return ne._onGoNextEnd}static get getVariable(){return ne._getVariable}static get setVariable(){return ne._setVariable}static get removeVariable(){return ne._removeVariable}static get getFlag(){return ne._getFlag}static get setFlag(){return ne._setFlag}static get onLabelClosing(){return ne._onLabelClosing}static get addHistoryItem(){return ne._addHistoryItem}static get currentStepsRunningNumber(){return ne._getCurrentStepsRunningNumber()}static get getCharacter(){return ne._getCharacter}};w(ne,"_getStepCounter",()=>{throw E.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),w(ne,"_setStepCounter",()=>{throw E.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),w(ne,"_getCurrentGameStepState",()=>{throw E.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),w(ne,"_restoreGameStepState",()=>{throw E.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),w(ne,"_getOpenedLabels",()=>{throw E.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),w(ne,"_onGoNextEnd",async()=>{}),w(ne,"_getVariable",()=>{throw E.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),w(ne,"_setVariable",()=>{throw E.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),w(ne,"_removeVariable",()=>{throw E.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),w(ne,"_getFlag",()=>{throw E.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),w(ne,"_setFlag",()=>{throw E.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),w(ne,"_onLabelClosing",()=>{}),w(ne,"_addHistoryItem",()=>{throw E.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),w(ne,"_getCurrentStepsRunningNumber",()=>{throw E.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),w(ne,"_getCharacter",()=>{throw E.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented.")}),w(ne,"onEnd"),w(ne,"onError");var W=ne;var wt=class wt{constructor(){}static clearOldTempVariables(e){wt.tempStorageDeadlines.forEach((t,i)=>{t>e&&(wt.tempStorage.delete(i),wt.tempStorageDeadlines.delete(i),wt.storage.cache.delete(i));});}static setVariable(e,t){let i=wt.tempStorage.has(e);t==null?(wt.storage.map.delete(e),!i&&wt.storage.cache.delete(e)):(wt.storage.map.set(e,t),!i&&wt.storage.cache.set(e,t));}static getVariable(e){let t=wt.storage.cache.get(e);return t===void 0&&(t=wt.tempStorage.get(e)),t===void 0&&(t=wt.storage.map.get(e)),pe(t)}static removeVariable(e){wt.storage.delete(e);}static setFlag(e,t){if(t)this.flags.includes(e)||this.flags.push(e);else {let i=this.flags.indexOf(e);i>-1&&this.flags.splice(i,1);}}static getFlag(e){return this.flags.includes(e)}};w(wt,"storage",new Ct({cacheSize:20})),w(wt,"startingStorage",[]),w(wt,"flags",Array()),w(wt,"tempStorage",new Map),w(wt,"tempStorageDeadlines",new Map);var ue=wt;var bm=class{get storage(){return ue.storage.map}get cache(){return ue.storage.cache}get flags(){return ue.flags}get tempStorage(){return ue.tempStorage}get tempStorageDeadlines(){return ue.tempStorageDeadlines}set startingStorage(e){let t=[],i=W.stepCounter===0;Object.entries(e).forEach(([s,n])=>{t.push({key:s,value:n}),i&&ue.storage.set(s,n);}),ue.startingStorage=t;}setVariable(e,t){return ue.setVariable(e,t)}getVariable(e){return ue.getVariable(e)}removeVariable(e){return ue.removeVariable(e)}setTempVariable(e,t){if(t==null){this.removeTempVariable(e);return}else ue.tempStorage.set(e,t),ue.storage.cache.set(e,t),ue.tempStorageDeadlines.has(e)||ue.tempStorageDeadlines.set(e,W.openedLabels);}removeTempVariable(e){ue.tempStorage.has(e)&&(ue.tempStorage.delete(e),ue.tempStorageDeadlines.delete(e),ue.storage.cache.delete(e));}setFlag(e,t){return ue.setFlag(e,t)}getFlag(e){return ue.getFlag(e)}clear(){this.storage.clear(),this.cache.clear(),ue.flags=[],ue.tempStorage.clear(),ue.tempStorageDeadlines.clear(),ue.startingStorage.forEach(({key:e,value:t})=>{this.storage.set(e,t);});}export(){let e=[];[...this.storage.keys()].forEach(s=>{e.push({key:s,value:this.storage.get(s)});});let t=[];[...ue.tempStorage.keys()].forEach(s=>{t.push({key:s,value:ue.tempStorage.get(s)});});let i=[];return [...ue.tempStorageDeadlines.keys()].forEach(s=>{i.push({key:s,value:ue.tempStorageDeadlines.get(s)});}),pe({base:e,temp:t,tempDeadlines:i,flags:ue.flags})}restore(e){this.clear();try{e?(Array.isArray(e)&&e.forEach(t=>{if(t.key==="___temp_storage___"){let i=t.value;Object.entries(i).forEach(([s,n])=>{ue.tempStorage.set(s,n);});}else if(t.key==="___temp_storage_deadlines___"){let i=t.value;Object.entries(i).forEach(([s,n])=>{ue.tempStorageDeadlines.set(s,n);});}else t.key==="___flags___"?t.value.forEach(s=>{ue.flags.push(s);}):this.storage.set(t.key,t.value);}),"base"in e&&"temp"in e&&"tempDeadlines"in e?(e.base?.forEach(t=>{this.storage.set(t.key,t.value);}),e.temp?.forEach(t=>{ue.tempStorage.set(t.key,t.value);}),e.tempDeadlines?.forEach(t=>{ue.tempStorageDeadlines.set(t.key,t.value);})):Object.entries(e).forEach(([t,i])=>{t==="___temp_storage___"?Object.entries(i).forEach(([s,n])=>{ue.tempStorage.set(s,n);}):t==="___temp_storage_deadlines___"?Object.entries(i).forEach(([s,n])=>{ue.tempStorageDeadlines.set(s,n);}):t==="___flags___"?i.forEach(s=>{ue.flags.push(s);}):this.storage.set(t,i);})):E.warn("No storage data found");}catch(t){E.error("Error importing data",t);}}};var kh=class{constructor(e,t){w(this,"_id");w(this,"categoryId");this.categoryId=e,this._id=t;}get id(){return this._id}setStorageProperty(e,t){let i=ue.getVariable(this.categoryId);i||(i={}),i.hasOwnProperty(this.id)||(i[this.id]={}),t==null?i[this.id].hasOwnProperty(e)&&delete i[this.id][e]:i[this.id]={...i[this.id],[e]:t},Object.keys(i[this.id]).length===0&&delete i[this.id],ue.setVariable(this.categoryId,i);}getStorageProperty(e,t=this.id){let i=ue.getVariable(this.categoryId);if(i&&i.hasOwnProperty(t)&&i[t].hasOwnProperty(e))return i[t][e]}};var ci=new bm;var q5="@",Xu=class extends kh{constructor(t,i=""){super(he.CHARACTER_CATEGORY_KEY,t+(i?q5+i:""));w(this,"sourceId");this.sourceId=t;}getStorageProperty(t){let i=super.getStorageProperty(t);return i===void 0&&(i=super.getStorageProperty(t,this.sourceId)),i}};var ym=class extends Xu{constructor(t,i){super(typeof t=="string"?t:t.id,typeof t=="string"?"":t.emotion);w(this,"defaultName");w(this,"defaultSurname");w(this,"defaultAge");w(this,"_icon");w(this,"_color");this.defaultName=i.name,this.defaultSurname=i.surname,this.defaultAge=i.age,this._icon=i.icon,this._color=i.color;}get name(){return this.getStorageProperty("name")||this.defaultName||this.id}set name(t){this.setStorageProperty("name",t);}get surname(){return this.getStorageProperty("surname")||this.defaultSurname}set surname(t){this.setStorageProperty("surname",t);}get age(){return this.getStorageProperty("age")||this.defaultAge}set age(t){this.setStorageProperty("age",t);}get icon(){return this._icon}get color(){return this._color}};var Yu=new Ct({cacheSize:10}),HP;(s=>{function r(n){try{let o=Yu.get(n);if(!o){E.warn(`Character "${n}" not found, did you forget to register it with the RegisteredCharacters.add?`);return}return o}catch(o){E.error(`Error while getting Character "${n}"`,o);return}}s.get=r;function e(n){if(Array.isArray(n)){n.forEach(o=>e(o));return}Yu.get(n.id)&&E.info(`Character id "${n.id}" already exists, it will be overwritten`),Yu.set(n.id,n);}s.add=e;function t(){return Array.from(Yu.values())}s.values=t;function i(n){return Yu.has(n)}s.has=i;})(HP||(HP={}));var pG=HP;var K5={Date:true,RegExp:true,String:true,Number:true};function Cv(r,e,t={cyclesFix:true},i=[]){let s=[],n=Array.isArray(r);for(let a in r){let u=r[a],l=n?+a:a;if(!(a in e)){s.push({type:"REMOVE",path:[l],oldValue:r[a]});continue}let c=e[a],h=typeof u=="object"&&typeof c=="object"&&Array.isArray(u)===Array.isArray(c);u&&c&&h&&!K5[Object.getPrototypeOf(u)?.constructor?.name]&&(!t.cyclesFix||!i.includes(u))?s.push.apply(s,Cv(u,c,t,t.cyclesFix?i.concat([u]):[]).map(d=>(d.path.unshift(l),d))):u!==c&&!(Number.isNaN(u)&&Number.isNaN(c))&&!(h&&(isNaN(u)?u+""==c+"":+u==+c))&&s.push({path:[l],type:"CHANGE",value:c,oldValue:u});}let o=Array.isArray(e);for(let a in e)a in r||s.push({type:"CREATE",path:[o?+a:a],value:e[a]});return s}function mG(r,e){let t=pe(r);return e.length>1&&"type"in e[0]&&(e=e.reverse()),e.forEach(i=>{"type"in i?Z5(t,i):Q5(t,i);}),t}function Z5(r,e){let t=r;e.path&&e.path.length>0?e.path.forEach((i,s)=>{if(e.path&&s===e.path.length-1)switch(e.type){case "CHANGE":case "REMOVE":t[i]=e.oldValue;break;case "CREATE":Array.isArray(t)&&typeof i=="number"?t.splice(i,1):delete t[i];break}else t=t[i];}):E.warn("No path found, skipping diff",e);}function Q5(r,e){let t=r;e.path&&e.path.length>0?e.path.forEach((i,s)=>{if(e.path&&s===e.path.length-1){if(e.kind==="E"||e.kind==="D")t[i]=e.lhs;else if(e.kind==="N")Number.isInteger(i)?Array.isArray(t)&&t.splice(i,1):typeof i=="string"&&delete t[i];else if(e.kind==="A"){let n=e.index;e.item.kind==="N"?t[i].splice(n,1):e.item.kind==="E"||e.item.kind==="D"?t[i][n]=e.item.lhs:e.item.kind==="A"?E.warn("Nested array found, skipping diff",e):E.warn("No array found, skipping diff",e);}}else t=t[i];}):E.warn("No path found, skipping diff",e);}var Ni=class Ni{static get originalStepData(){return Ni._originalStepData?pe(Ni._originalStepData):{path:"",storage:{},canvas:{elementAliasesOrder:[],elements:{},stage:{},tickers:{},tickersSteps:{},tickersOnPause:{},tickersToCompleteOnStepEnd:{tikersIds:[],stepAlias:[]}},sound:{soundAliasesOrder:[],soundsPlaying:{},playInStepIndex:{},filters:void 0},labelIndex:-1,openedLabels:[]}}static set originalStepData(e){Ni._originalStepData=pe(e);}};w(Ni,"_diffHistory",new Ct({cacheSize:5})),w(Ni,"_stepsInfoHistory",new Ct({cacheSize:5})),w(Ni,"_narrationHistory",new Ct({cacheSize:50})),w(Ni,"stepLimitSaved",20),w(Ni,"goBackRunning",false),w(Ni,"_originalStepData");var K=Ni;var vm=class{get stepsInfoMap(){return K._stepsInfoHistory}get diffMap(){return K._diffHistory}get narrationMap(){return K._narrationHistory}get size(){return K._stepsInfoHistory.size}get lastKey(){return this.size===0?null:Math.max(...Array.from(this.keys()))}keys(){return K._stepsInfoHistory.keys()}get(e){let t=K._narrationHistory.get(e);if(!(t&&Object.keys(t).length===1&&t.stepIndex!==void 0))return t}delete(e){K._stepsInfoHistory.delete(e),K._diffHistory.delete(e),K._narrationHistory.delete(e);}internalRestoreOldGameState(e,t){if(e<=0||this.size==0)return t;let i=this.lastKey;if(typeof i!="number")return E.error("You can't go back, there is no step to go back"),t;let s=K._diffHistory.get(i);if(s)try{let n=mG(t,s);return W.stepCounter=i,this.delete(i),this.internalRestoreOldGameState(e-1,n)}catch(n){return E.error("Error applying diff",n),t}else return E.error("You can't go back, there is no step to go back"),t}async goBack(e,t=1){if(t<=0){E.warn("The parameter steps must be greater than 0");return}if(K._diffHistory.size<1){E.warn("You can't go back, there is no step to go back");return}if(K.goBackRunning){E.warn("Go back is already running");return}K.goBackRunning=true;try{let i=pe(this.internalRestoreOldGameState(t,K.originalStepData));if(i){await W.restoreGameStepState(i,e);let s=W.stepCounter-1,n=K._narrationHistory.get(s);if(n&&Object.keys(n).length===1&&n.stepIndex!==void 0){let o=K._stepsInfoHistory.get(s);if(o){let a=this.itemMapper({step:o});K._narrationHistory.set(o.index,a);}}}else E.error("Error going back");K.originalStepData=i,K.goBackRunning=!1;}catch(i){E.error("Error going back",i),K.goBackRunning=false;}}add(e,t={}){let i=K.originalStepData,{ignoreSameStep:s}=t,n=W.currentGameStepState;if(!s&&this.isSameStep(i,n))return;let o=this.lastKey;(async()=>{try{let u,l;if(typeof o=="number"&&(u=K._stepsInfoHistory.get(o),l=K._narrationHistory.get(o)),K._stepsInfoHistory.set(e.index,e),e.index!==0){let d=Cv(i,n);d?K._diffHistory.set(e.index,d):E.warn("It was not possible to create the difference between the two steps");}let c={},h=this.itemMapper({step:e},c);if(K._narrationHistory.set(e.index,h),u&&l&&typeof o=="number"){let d=this.itemMapper({...c,step:u},{});K._narrationHistory.set(o,d);}}catch(u){E.error("Error adding history step",u);}})(),K.originalStepData=n;}itemMapper(e,t){let{step:i,choiceIndexMade:s,inputValue:n,removeDialogue:o}=e,a=i.dialogue||i.dialoge;t&&i.isGlued&&(t.removeDialogue=true),o&&(a=void 0);let u=i.choices;if(t&&i.currentLabel&&i.choiceIndexMade!==void 0&&(t.choiceIndexMade=i.choiceIndexMade),i.inputValue&&t&&(t.inputValue=i.inputValue),a||u||n){let l=u?.map((c,h)=>{let d=false;return c.oneTime&&i.alreadyMadeChoices&&i.alreadyMadeChoices.includes(h)&&(d=true),{text:c.text,type:c.type,isResponse:false,hidden:d}});if(l){if(l.every(c=>c.hidden)){let c=l.find(h=>h.hidden===false);c&&(c.hidden=false);}s!==void 0&&(l[s].isResponse=true);}return {dialogue:a?{...a,character:a.character?W.getCharacter(a.character)||a.character:void 0}:void 0,playerMadeChoice:typeof s=="number",choices:l,stepIndex:i.index,inputValue:n}}return {stepIndex:i.index}}get narrativeHistory(){let e=[];return Array.from(this.keys()).sort((i,s)=>i-s).forEach(i=>{let s=this.get(i);s&&e.push(s);}),e}get currentLabelHistory(){let e=[],t=Array.from(this.keys()).sort((u,l)=>l-u);if(t.length===0)return e;let i=t[0];if(typeof i!="number")return e;let s=K._stepsInfoHistory.get(i);if(!s)return e;let n=s.openedLabels;if(!n||!Array.isArray(n)||n.length===0)return e;let o=n[0].currentStepIndex,a=n[0].label;return t.every((u,l)=>{let c=this.get(u);if(c){if(l===0)return e.push(c),true;let h=K._stepsInfoHistory.get(u);if(!h)return true;let d=h.openedLabels;if(!d||!Array.isArray(d)||d.length===0||d[0].label!==a||d[0].currentStepIndex>=o)return false;o=d[0].currentStepIndex,e.push(c);}return true}),e.reverse()}removeNarrativeHistory(e){if(e){let t=Array.from(this.keys()).sort((i,s)=>i-s);t=t.slice(0,e),t.forEach(i=>{K._narrationHistory.delete(i),K._stepsInfoHistory.delete(i),K._diffHistory.delete(i);});}else K._stepsInfoHistory.clear(),K._diffHistory.clear(),K._narrationHistory.clear();}get canGoBack(){let e=this.lastKey;return typeof e!="number"?false:K._diffHistory.has(e)}blockGoBack(){W.currentStepsRunningNumber===0&&K._diffHistory.clear();}isSameStep(e,t){if(e.openedLabels.length===t.openedLabels.length)try{let i=JSON.stringify(e.openedLabels),s=JSON.stringify(t.openedLabels);if(i===s&&e.path===t.path&&e.labelIndex===t.labelIndex)return !0}catch(i){return E.error("Error comparing opened labels",i),true}return false}clear(){K._stepsInfoHistory.clear(),K._diffHistory.clear(),K._narrationHistory.clear(),K._originalStepData=void 0;}get stepLimitSaved(){return K.stepLimitSaved}set stepLimitSaved(e){K.stepLimitSaved=e;}export(){let e=Array.from(this.keys()).sort((i,s)=>i-s);e.length>this.stepLimitSaved&&(e=e.slice(e.length-this.stepLimitSaved));let t=[];return e.forEach(i=>{let s=K._stepsInfoHistory.get(i);if(s){let n=K._diffHistory.get(i);t.push({...s,diff:n});}}),{stepsHistory:pe(t),originalStepData:pe(K._originalStepData)}}restoreNarrativeHistory(){let e=Array.from(this.keys()).sort((i,s)=>i-s),t={};e.forEach(i=>{let s=K._stepsInfoHistory.get(i);if(s){let n={...t};t={};let o=this.itemMapper({step:s,choiceIndexMade:n.choiceIndexMade,inputValue:n.inputValue,removeDialogue:n.removeDialogue},t);o&&K._narrationHistory.set(i,o);}});}async restore(e){this.clear();try{e.hasOwnProperty("stepsHistory")?(e.stepsHistory.forEach(i=>{i.diff&&K._diffHistory.set(i.index,i.diff);let s={...i,diff:void 0};K._stepsInfoHistory.set(i.index,s);}),this.restoreNarrativeHistory()):E.warn("Could not import stepsHistory data, so will be ignored"),e.hasOwnProperty("originalStepData")?K._originalStepData=e.originalStepData:E.warn("Could not import originalStepData data, so will be ignored");}catch(t){E.error("Error importing data",t);}}};var Co=new vm;var gG={};var YP={};vs(YP,{Close:()=>wv,Label:()=>$u,LabelAbstract:()=>ju,NarrationManagerStatic:()=>N,RegisteredLabels:()=>hi,narration:()=>Ks,newChoiceOption:()=>xG,newCloseChoiceOption:()=>_G,newLabel:()=>XP});var Tm=new Ct({cacheSize:10}),WP;(s=>{function r(n){let o=Tm.get(n);if(!o){E.error(`Label "${n}" not found`);return}return o}s.get=r;function e(n){if(Array.isArray(n)){n.forEach(o=>e(o));return}Tm.has(n.id)&&E.info(`Label "${n.id}" already exists, it will be overwritten`),Tm.set(n.id,n);}s.add=e;function t(){return Array.from(Tm.values())}s.values=t;function i(n){return Tm.has(n)}s.has=i;})(WP||(WP={}));var hi=WP;var Z=class Z{constructor(){}static get allOpenedLabels(){return W.getVariable(he.OPENED_LABELS_COUNTER_KEY)||{}}static set allOpenedLabels(e){W.setVariable(he.OPENED_LABELS_COUNTER_KEY,e);}static getCurrentStepTimesCounterData(e=""){let t=Z.currentLabelStepIndex;if(t===null)return E.error("currentLabelStepIndex is null"),null;let i=`${t}${e}`,s=Z.currentLabelId,n=Z._currentLabel;if(!s||t===null||!n)return E.error("currentLabelId or currentLabelStepIndex is null or currentLabel not found"),null;let o=n.getStepSha(t)||"error",a=W.getVariable(he.CURRENT_STEP_TIMES_COUNTER_KEY)||{};return a[s]||(a[s]={}),(!a[s][i]||a[s][i].stepSha1!=o)&&(a[s][i]={stepSha1:o}),a[s][i]}static setCurrentStepTimesCounterData(e="",t){let i=Z.currentLabelStepIndex,s=i+e,n=Z.currentLabelId;if(!n||i===null){E.error("currentLabelId or currentLabelStepIndex is null");return}let o=W.getVariable(he.CURRENT_STEP_TIMES_COUNTER_KEY)||{};o[n]||(o[n]={}),o[n][s]=t,W.setVariable(he.CURRENT_STEP_TIMES_COUNTER_KEY,o);}static getCurrentStepTimesCounter(e=""){let t=Z._stepCounter,i=Z.getCurrentStepTimesCounterData(e);if(!i)return E.error("getCurrentStepTimesCounter obj is null"),0;let s=i.stepCounters||i.lastStepIndexs||[];return s.find(o=>o===t)||(s.push(t),delete i.lastStepIndexs,i.stepCounters=s,Z.setCurrentStepTimesCounterData(e,i)),s.length}static getRandomNumber(e,t,i={}){let s=i.nestedId||"";if(i.onceOnly||false){let o=Z.getCurrentStepTimesCounterData(s);if(!o)return;let a=o.usedRandomNumbers||{},u=Array.from({length:t-e+1},(h,d)=>d+e).filter(h=>!a[`${e}-${t}`]?.includes(h));if(u.length===0)return;let l=Math.floor(Math.random()*u.length),c=u[l];return a[`${e}-${t}`]||(a[`${e}-${t}`]=[]),a[`${e}-${t}`].push(c),o.usedRandomNumbers=a,Z.setCurrentStepTimesCounterData(s,o),c}return Math.floor(Math.random()*(t-e+1))+e}static resetCurrentStepTimesCounter(e=""){let t=Z.currentLabelStepIndex,i=t+e,s=Z.currentLabelId;if(!s||t===null){E.error("currentLabelId or currentLabelStepIndex is null");return}let n=W.getVariable(he.CURRENT_STEP_TIMES_COUNTER_KEY)||{};n[s]||(n[s]={}),n[s][i]={stepCounters:[],stepSha1:""},W.setVariable(he.CURRENT_STEP_TIMES_COUNTER_KEY,n);}static get allChoicesMade(){return W.getVariable(he.ALL_CHOICES_MADE_KEY)||[]}static set allChoicesMade(e){W.setVariable(he.ALL_CHOICES_MADE_KEY,e);}static increaseStepCounter(){Z._stepCounter++;}static get openedLabels(){return pe(Z._openedLabels)}static set openedLabels(e){Z._openedLabels=pe(e);}static get originalOpenedLabels(){return pe(Z._originalOpenedLabels)}static set originalOpenedLabels(e){Z._originalOpenedLabels=pe(e);}static get _currentLabel(){if(Z.currentLabelId)return hi.get(Z.currentLabelId)}static get currentLabelId(){if(Z._openedLabels.length>0)return Z._openedLabels[Z._openedLabels.length-1].label}static get currentLabelStepIndex(){return Z._openedLabels.length>0?Z._openedLabels[Z._openedLabels.length-1].currentStepIndex:null}static addLabelHistory(e,t){let i=Z.allOpenedLabels,s=Z.allOpenedLabels[e]?.biggestStep||0,n=Z.allOpenedLabels[e]?.openCount||0;(!s||s<t)&&(i[e]={biggestStep:t,openCount:n},Z.allOpenedLabels=i);}static addChoicesMade(e,t,i,s){let n=Z.allChoicesMade,o=n.findIndex(a=>a.labelId===e&&a.stepIndex===t&&a.choiceIndex===s&&a.stepSha1===i);o<0?n.push({labelId:e,stepIndex:t,choiceIndex:s,stepSha1:i,madeTimes:1}):n[o].madeTimes++,Z.allChoicesMade=n;}static pushNewLabel(e){if(!hi.get(e))throw new Error(`[Pixi\u2019VN] Label ${e} not found`);Z._openedLabels.push({label:e,currentStepIndex:0});let i=Z.allOpenedLabels,s=Z.allOpenedLabels[e]?.biggestStep||0,n=Z.allOpenedLabels[e]?.openCount||0;i[e]={biggestStep:s,openCount:n+1},Z.allOpenedLabels=i;}static increaseCurrentStepIndex(){if(Z._openedLabels.length>0){let e=Z._openedLabels[Z._openedLabels.length-1];Z._openedLabels[Z._openedLabels.length-1]={...e,currentStepIndex:e.currentStepIndex+1};}}static set onStepStart(e){Z._onStepStart=e;}static get onStepStart(){return async(e,t)=>{let i=[];return Z.onLoadingLabel&&e===0&&i.push(Z.onLoadingLabel(e,t)),Z._onStepStart&&i.push(Z._onStepStart(e,t)),await Promise.all(i)}}};w(Z,"stepsRunning",0),w(Z,"goNextRequests",0),w(Z,"choiceMadeTemp"),w(Z,"lastHistoryStep",null),w(Z,"_stepCounter",0),w(Z,"_openedLabels",[]),w(Z,"_originalOpenedLabels",[]),w(Z,"_onStepStart"),w(Z,"onLoadingLabel"),w(Z,"onStepEnd");var N=Z;var Sm=class{get currentStepTimesCounter(){return N.getCurrentStepTimesCounter()}set currentStepTimesCounter(e){N.resetCurrentStepTimesCounter();}getRandomNumber(e,t,i={}){return N.getRandomNumber(e,t,i)}get stepCounter(){return N._stepCounter}get openedLabels(){return N.openedLabels}get currentLabel(){return N._currentLabel}addStepHistory(e,t={}){let{choiceMade:i,ignoreSameStep:s}=t,n,o,a,u=W.getVariable(he.LAST_STEP_GLUED)===this.stepCounter;W.getVariable(he.LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY)===this.stepCounter&&(n=W.getVariable(he.CURRENT_DIALOGUE_MEMORY_KEY)),W.getVariable(he.LAST_MENU_OPTIONS_ADDED_IN_STEP_MEMORY_KEY)===this.stepCounter&&(o=W.getVariable(he.CURRENT_MENU_OPTIONS_MEMORY_KEY)),W.getVariable(he.LAST_INPUT_ADDED_IN_STEP_MEMORY_KEY)===this.stepCounter&&(a=W.getVariable(he.CURRENT_INPUT_VALUE_MEMORY_KEY));let l=N.openedLabels,c={currentLabel:N.currentLabelId,dialogue:n,choices:o,stepSha1:e,index:this.stepCounter,labelStepIndex:N.currentLabelStepIndex,choiceIndexMade:i,inputValue:a,alreadyMadeChoices:this.alreadyCurrentStepMadeChoices,isGlued:u,openedLabels:l};N.originalOpenedLabels=l,W.addHistoryItem(c,{ignoreSameStep:s}),N.lastHistoryStep=c,N.increaseStepCounter();}closeCurrentLabel(){if(!N.currentLabelId){E.warn("No label to close");return}if(!this.currentLabel){E.error("currentLabel not found");return}let e=N.openedLabels;e.pop(),N.openedLabels=e,W.onLabelClosing(this.openedLabels.length);}closeAllLabels(){for(;N.openedLabels.length>0;)this.closeCurrentLabel(),W.onLabelClosing(this.openedLabels.length);}isLabelAlreadyCompleted(e){let t;typeof e=="string"?t=e:t=e.id;let s=N.allOpenedLabels[t]?.biggestStep||0;if(s){let n=hi.get(t);if(n)return n.stepCount<=s}return false}get alreadyCurrentStepMadeChoicesObj(){let e=N.currentLabelStepIndex,t=this.currentLabel;if(e===null||!t)return;let i=t.getStepSha(e);return i||(E.warn("stepSha not found, setting to ERROR"),i="error"),N.allChoicesMade.filter(s=>s.labelId===t?.id&&s.stepIndex===e&&s.stepSha1===i)}get alreadyCurrentStepMadeChoices(){return this.alreadyCurrentStepMadeChoicesObj?.map(e=>e.choiceIndex)}get isCurrentStepAlreadyOpened(){let e=N.currentLabelId;if(e){let t=N.allOpenedLabels[e]?.openCount||0;if(N.currentLabelStepIndex&&t>=N.currentLabelStepIndex)return true}return false}getTimesLabelOpened(e){return N.allOpenedLabels[e]?.openCount||0}getTimesChoiceMade(e){return this.alreadyCurrentStepMadeChoicesObj?.find(t=>t.choiceIndex===e)?.madeTimes||0}addCurrentStepToHistory(){this.addStepHistory("dev",{ignoreSameStep:true});}getCanGoNext(e){let t=e?.showWarn||false,i=this.choiceMenuOptions;return i&&i.length>0?(t&&E.warn("The player must make a choice"),false):this.isRequiredInput?(t&&E.warn("The player must enter a value"),false):true}get canGoNext(){return N.stepsRunning!==0?false:this.getCanGoNext()}async onStepRun(e,t){let i=[];return e.onStepStart&&i.push(e.onStepStart(t,e)),N.onStepStart&&i.push(N.onStepStart(t,e)),await Promise.all(i)}async onStepEnd(e,t){let i=[];return e.onStepEnd&&i.push(e.onStepEnd(t,e)),N.onStepEnd&&i.push(N.onStepEnd(t,e)),await Promise.all(i)}async goNext(e,t={}){let{runNow:i=false}=t;if(!(!i&&!this.getCanGoNext({showWarn:true}))){if(!i&&N.stepsRunning!==0){N.goNextRequests++;return}try{this.currentLabel&&await this.onStepEnd(this.currentLabel,N.currentLabelStepIndex||0);}catch(s){E.error("Error running onStepEnd",s);}return N.stepsRunning===0&&await W.onGoNextEnd(),N.increaseCurrentStepIndex(),await this.runCurrentStep(e,t)}}async runCurrentStep(e,t={}){let{choiceMade:i}=t;if(N.currentLabelId){let s=N.currentLabelStepIndex;if(s===null){E.error("currentLabelStepIndex is null");return}let n=N._currentLabel;if(!n){E.error("currentLabel not found");return}if(n.stepCount>s){try{await this.onStepRun(n,s);}catch(u){E.error("Error running onStepStart",u),this.onStepError&&this.onStepError(u,e);return}let o=n.getStepById(s);if(!o){E.error("step not found");return}let a=n.getStepSha(s);a||(E.warn("stepSha not found, setting to ERROR"),a="error");try{N.stepsRunning++;let u=await o(e,{labelId:n.id}),l=this.choiceMenuOptions;if(l?.length===1&&l[0].autoSelect){let h=l[0];u=await this.selectChoice(h,e);}let c=N.lastHistoryStep;if(i!==void 0&&c){let h=c.stepSha1;h||(E.warn("stepSha not found, setting to ERROR"),h="error"),N.addChoicesMade(c.currentLabel||"error",typeof c.labelStepIndex=="number"?c.labelStepIndex:-1,c.stepSha1||"error",i),N.choiceMadeTemp=i;}return N.stepsRunning--,N.stepsRunning===0&&(N.addLabelHistory(n.id,s),this.addStepHistory(a,{...t,choiceMade:N.choiceMadeTemp}),N.choiceMadeTemp=void 0,N.goNextRequests>0)?(N.goNextRequests--,await this.goNext(e)):u}catch(u){N.stepsRunning>0&&N.stepsRunning--,E.error("Error running step",u),this.onStepError&&this.onStepError(u,e);return}}else {if(this.openedLabels.length>1)return this.closeCurrentLabel(),await this.goNext(e,t);if(this.openedLabels.length===1)return N.openedLabels=[],W.onEnd?await W.onEnd(e,{labelId:"end"}):void 0}}else if(this.openedLabels.length===0){if(N.openedLabels=N.originalOpenedLabels,W.onEnd)return await W.onEnd(e,{labelId:"end"});E.error("The end of the game is not managed, so the game is blocked. Read this documentation to know how to manage the end of the game: https://pixi-vn.web.app/start/other-narrative-features.html#how-manage-the-end-of-the-game");return}else E.error("currentLabelId not found");}async callLabel(e,t,i){let{choiceMade:s}=i||{},n;typeof e=="string"?n=e:n=e.id;try{let o=hi.get(n);if(!o)throw new Error(`[Pixi\u2019VN] Label ${n} not found`);try{this.currentLabel&&await this.onStepEnd(this.currentLabel,N.currentLabelStepIndex||0);}catch(a){E.error("Error running onStepEnd",a);}N.pushNewLabel(o.id);}catch(o){E.error("Error calling label",o);return}return await this.runCurrentStep(t,{choiceMade:s})}async jumpLabel(e,t,i){this.openedLabels.length>0&&this.closeCurrentLabel();let{choiceMade:s}=i||{},n;typeof e=="string"?n=e:n=e.id;try{let o=hi.get(n);if(!o)throw new Error(`[Pixi\u2019VN] Label ${n} not found`);try{this.currentLabel&&await this.onStepEnd(this.currentLabel,N.currentLabelStepIndex||0);}catch(a){E.error("Error running onStepEnd",a);}N.pushNewLabel(o.id);}catch(o){E.error("Error jumping label",o);return}return await this.runCurrentStep(t,{choiceMade:s})}async selectChoice(e,t){this.choiceMenuOptions=void 0;let i=e.type;switch(i){case "call":return await this.callLabel(e.label,{...e.props,...t},{choiceMade:e.choiceIndex});case "jump":return await this.jumpLabel(e.label,{...e.props,...t},{choiceMade:e.choiceIndex});case "close":return await this.closeChoiceMenu(e,{...e.props,...t});default:throw E.error(`Type ${i} not found`),new Error(`[Pixi\u2019VN] Type ${i} not found`)}}async closeChoiceMenu(e,t){if(e.type!=="close")throw E.error("For closeChoiceMenu, the type must be close"),new Error("[Pixi\u2019VN] For closeChoiceMenu, the type must be close");let i;return typeof e.choiceIndex=="number"&&(i=e.choiceIndex),e.closeCurrentLabel&&this.closeCurrentLabel(),this.goNext(t,{choiceMade:i})}get onStepError(){let e=W.onError;return e?(t,i)=>e("step",t,i):void 0}set onStepError(e){W.onError=(t,i,s)=>e(i,s);}get dialogue(){let e=W.getVariable(he.CURRENT_DIALOGUE_MEMORY_KEY);if(e)return {...e,character:e.character?W.getCharacter(e.character)||e.character:void 0}}set dialogue(e){if(!e){W.setVariable(he.CURRENT_DIALOGUE_MEMORY_KEY,void 0);return}if((typeof e=="string"||Array.isArray(e))&&(e={text:e}),this.dialogGlue){let t=W.getVariable(he.CURRENT_DIALOGUE_MEMORY_KEY);if(t){let i=[];Array.isArray(t.text)?i=[...t.text]:i=[t.text],Array.isArray(e.text)?i=[...i,...e.text]:i=[...i,e.text],e.text=i,e.character=e.character||t.character;}W.setVariable(he.LAST_STEP_GLUED,this.stepCounter),this.dialogGlue=false;}try{W.setVariable(he.CURRENT_DIALOGUE_MEMORY_KEY,pe({...e,character:typeof e.character=="string"?e.character:e.character?.id})),W.setVariable(he.LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY,this.stepCounter);}catch(t){throw E.error("DialogueInterface cannot contain functions or classes"),t}}get choiceMenuOptions(){let e=W.getVariable(he.CURRENT_MENU_OPTIONS_MEMORY_KEY);if(e){let t=[],i=e.map((n,o)=>({...n,choiceIndex:o})),s=this.alreadyCurrentStepMadeChoices;if(i=i.filter((n,o)=>n.oneTime&&s&&s.includes(o)?false:n.onlyHaveNoChoice?(t.push(n),false):true),i.length>0)return i;if(t.length>0)return [t[0]]}}set choiceMenuOptions(e){if(!e||e.length===0){W.setVariable(he.CURRENT_MENU_OPTIONS_MEMORY_KEY,void 0);return}try{W.setVariable(he.CURRENT_MENU_OPTIONS_MEMORY_KEY,pe(e)),W.setVariable(he.LAST_MENU_OPTIONS_ADDED_IN_STEP_MEMORY_KEY,this.stepCounter);}catch(t){throw E.error("ChoiceInterface cannot contain functions or classes"),t}}get dialogGlue(){return W.getFlag(he.ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY)}set dialogGlue(e){W.setFlag(he.ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY,e);}get inputValue(){return W.getVariable(he.CURRENT_INPUT_VALUE_MEMORY_KEY)}set inputValue(e){this.removeInputRequest(),W.setVariable(he.CURRENT_INPUT_VALUE_MEMORY_KEY,e),W.setVariable(he.LAST_INPUT_ADDED_IN_STEP_MEMORY_KEY,this.stepCounter);}get isRequiredInput(){return W.getVariable(he.CURRENT_INPUT_INFO_MEMORY_KEY)?.isRequired||false}get inputType(){return W.getVariable(he.CURRENT_INPUT_INFO_MEMORY_KEY)?.type}requestInput(e,t){e.isRequired=true,W.setVariable(he.CURRENT_INPUT_INFO_MEMORY_KEY,e),t!==void 0?W.setVariable(he.CURRENT_INPUT_VALUE_MEMORY_KEY,t):W.removeVariable(he.CURRENT_INPUT_VALUE_MEMORY_KEY);}removeInputRequest(){W.removeVariable(he.CURRENT_INPUT_INFO_MEMORY_KEY),W.removeVariable(he.CURRENT_INPUT_VALUE_MEMORY_KEY);}clear(){N.openedLabels=[],N._stepCounter=0;}export(){return {openedLabels:pe(N.openedLabels),stepCounter:this.stepCounter}}async onLoadingLabel(e){let t=this.openedLabels.map(async i=>{let s=[],n=hi.get(i.label);return n&&(n.onLoadingLabel&&s.push(n.onLoadingLabel(e,n)),N.onLoadingLabel&&s.push(N.onLoadingLabel(e,n))),await Promise.all(s)});return await Promise.all(t)}async restore(e,t){this.clear();try{N.lastHistoryStep=t,e.hasOwnProperty("openedLabels")?(N.openedLabels=e.openedLabels,N.originalOpenedLabels=N.openedLabels):E.warn("Could not import openedLabels data, so will be ignored"),e.hasOwnProperty("stepCounter")?N._stepCounter=e.stepCounter:e.hasOwnProperty("lastStepIndex")?N._stepCounter=e.lastStepIndex:E.warn("Could not import stepCounter data, so will be ignored");try{await this.onLoadingLabel(N.currentLabelStepIndex||0);}catch(i){E.error("Error running onLoadingLabel",i);}}catch(i){E.error("Error importing data",i);}}};function xG(r,e,t,i){let s=typeof e=="string"?e:e.id;return {...i,label:s,props:t,text:r,type:i?.type||"call"}}var wv="close";function _G(r,e){return {...e,type:wv,text:r}}var bG=Fh(Lw());var ju=class{constructor(e,t){w(this,"_id");w(this,"_onStepStart");w(this,"_onLoadingLabel");w(this,"_onStepEnd");this._id=e,this._onStepStart=t?.onStepStart,this._onLoadingLabel=t?.onLoadingLabel,this._onStepEnd=t?.onStepEnd;}get id(){return this._id}get onStepStart(){return async(e,t)=>{if(this._onLoadingLabel&&e===0&&await this._onLoadingLabel(e,t),this._onStepStart)return await this._onStepStart(e,t)}}get onLoadingLabel(){return this._onLoadingLabel}get onStepEnd(){return this._onStepEnd}};var $u=class extends ju{constructor(t,i,s){super(t,s);w(this,"_steps");this._steps=i;}get stepCount(){return this.steps.length}getStepById(t){return this.steps[t]}get steps(){return typeof this._steps=="function"?this._steps():this._steps}getStepSha(t){if(t<0||t>=this.steps.length)return E.warn("stepSha not found, setting to ERROR"),"error";try{let i=this.steps[t];return (0,bG.default)(i.toString().toLocaleLowerCase()).toString()}catch(i){return E.warn("stepSha not found, setting to ERROR",i),"error"}}};function XP(r,e,t){let i=new $u(r,e,t);return hi.add(i),i}var Ks=new Sm;var $P={};vs($P,{Sound:()=>wo,SoundManagerStatic:()=>oe,sound:()=>Po});var oe=class{constructor(){}};w(oe,"soundAliasesOrder",[]),w(oe,"soundsPlaying",{}),w(oe,"sounds",{});var wo=class r extends Gr{constructor(){super(...arguments);w(this,"alias");}pause(){if(!this.alias)throw new Error("[Pixi\u2019VN] The alias is not defined.");let t=oe.soundsPlaying[this.alias];if(!t)throw new Error("[Pixi\u2019VN] The alias is not found in the playInStepIndex.");return oe.soundsPlaying[this.alias]={...t,paused:true},super.pause()}resume(){if(!this.alias)throw new Error("[Pixi\u2019VN] The alias is not defined.");let t=oe.soundsPlaying[this.alias];if(!t)throw new Error("[Pixi\u2019VN] The alias is not found in the playInStepIndex.");return oe.soundsPlaying[this.alias]={options:t.options,stepIndex:W.stepCounter,paused:false},super.resume()}destroy(){return this.alias&&delete oe.soundsPlaying[this.alias],super.destroy()}stop(){if(!this.alias)throw new Error("[Pixi\u2019VN] The alias is not defined.");return delete oe.soundsPlaying[this.alias],super.stop()}play(t){if(typeof t=="string"&&(this.alias=t),!this.alias)throw new Error("[Pixi\u2019VN] The alias is not defined.");return oe.soundsPlaying[this.alias]={stepIndex:W.stepCounter,options:t,paused:false},super.play(t)}static from(t){let i=Gr.from(t);return new r(i.media,i.options)}};function Em(r){let e=[];for(let t of r)t.type==="TelephoneFilter"?e.push(new Xe.TelephoneFilter):t.type==="StreamFilter"?e.push(new Xe.StreamFilter):t.type==="StereoFilter"?e.push(new Xe.StereoFilter(t.pan)):t.type==="ReverbFilter"?e.push(new Xe.ReverbFilter(t.seconds,t.decay,t.reverse)):t.type==="MonoFilter"?e.push(new Xe.MonoFilter):t.type==="EqualizerFilter"?e.push(new Xe.EqualizerFilter(t.f32,t.f64,t.f125,t.f250,t.f500,t.f1k,t.f2k,t.f4k,t.f8k,t.f16k)):t.type==="DistortionFilter"?e.push(new Xe.DistortionFilter(t.amount)):E.error("Unknown sound filter type");return e}function jP(r){if(!r)return;let e=[];for(let t of r)t instanceof Xe.TelephoneFilter?e.push({type:"TelephoneFilter"}):t instanceof Xe.StreamFilter?e.push({type:"StreamFilter"}):t instanceof Xe.StereoFilter?e.push({type:"StereoFilter",pan:t.pan}):t instanceof Xe.ReverbFilter?e.push({type:"ReverbFilter",seconds:t.seconds,decay:t.decay,reverse:t.reverse}):t instanceof Xe.MonoFilter?e.push({type:"MonoFilter"}):t instanceof Xe.EqualizerFilter?e.push({type:"EqualizerFilter",f32:t.f32,f64:t.f64,f125:t.f125,f250:t.f250,f500:t.f500,f1k:t.f1k,f2k:t.f2k,f4k:t.f4k,f8k:t.f8k,f16k:t.f16k}):t instanceof Xe.DistortionFilter?e.push({type:"DistortionFilter",amount:t.amount}):E.error("Unknown sound filter type");return e}var Am=class extends ih{constructor(){super();}get context(){return Ie.context}get filtersAll(){return Ie.filtersAll}set filtersAll(e){Ie.filtersAll=e.filter(t=>!(t instanceof Xe.Filter));}get supported(){return Ie.supported}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}add(e,t){if(typeof e=="object")throw new Error("[Pixi\u2019VN] The method add(map: SoundSourceMap, globalOptions?: Options) is deprecated. Use add(alias: string, options: Options | string | ArrayBuffer | AudioBuffer | HTMLAudioElement | Sound): Sound; instead.");this.exists(e)&&this.remove(e),t instanceof Gr&&(t=t.options);let i;if(t instanceof wo)i=t;else {let s=this.getOptions(t||{});i=wo.from(s);}return i.alias=e,!oe.soundAliasesOrder.includes(e)&&oe.soundAliasesOrder.push(e),oe.sounds[e]=i,Ie.add(e,i),i}get useLegacy(){return Ie.useLegacy}set useLegacy(e){Ie.useLegacy=e;}get disableAutoPause(){return Ie.disableAutoPause}set disableAutoPause(e){Ie.disableAutoPause=e;}remove(e){return oe.soundAliasesOrder=oe.soundAliasesOrder.filter(t=>t!==e),delete oe.soundsPlaying[e],delete oe.sounds[e],Ie.remove(e)}get volumeAll(){return Ie.volumeAll}set volumeAll(e){Ie.volumeAll=e;}get speedAll(){return Ie.speedAll}set speedAll(e){Ie.speedAll=e;}togglePauseAll(){return Ie.togglePauseAll()}pauseAll(){return Ie.pauseAll()}resumeAll(){return Ie.resumeAll()}toggleMuteAll(){return Ie.toggleMuteAll()}muteAll(){return Ie.muteAll()}unmuteAll(){return Ie.unmuteAll()}removeAll(){return oe.soundAliasesOrder=[],oe.soundsPlaying={},oe.sounds={},Ie.removeAll()}stopAll(){for(let e in oe.sounds)oe.sounds[e].stop();return oe.soundsPlaying={},Ie.stopAll()}exists(e,t){return Ie.exists(e,t)||e in oe.sounds}isPlaying(){return Ie.isPlaying()}find(e){let t=oe.sounds[e];return t||(t=Ie.find(e),t&&(oe.sounds[e]=t),t)}play(e,t){if(!this.exists(e))throw new Error("[Pixi\u2019VN] The alias is not found in the sound library.");return oe.soundsPlaying[e]={stepIndex:W.stepCounter,options:t,paused:false},Ie.play(e,t)}stop(e){return delete oe.soundsPlaying[e],Ie.stop(e)}pause(e){let t=oe.soundsPlaying[e];if(!t)throw new Error("[Pixi\u2019VN] The alias is not found in the playInStepIndex.");return oe.soundsPlaying[e]={...t,paused:true},Ie.pause(e)}resume(e){let t=oe.soundsPlaying[e];if(!t)throw new Error("[Pixi\u2019VN] The alias is not found in the playInStepIndex.");return oe.soundsPlaying[e]={options:t.options,stepIndex:W.stepCounter,paused:false},Ie.resume(e)}volume(e,t){return Ie.volume(e,t)}speed(e,t){return Ie.speed(e,t)}duration(e){return Ie.duration(e)}close(){return Ie.close()}clear(){this.stopAll();}export(){let e={};for(let t in oe.soundsPlaying){let i=oe.soundsPlaying[t],s=this.find(t);s&&(e[t]={...i,sound:{options:{...s.options,autoPlay:s.autoPlay,loop:s.loop,preload:s.preload,singleInstance:s.singleInstance,url:s.options.url,volume:s.options.volume},filters:jP(s.media.filters)}});}return {soundsPlaying:pe(e),soundAliasesOrder:pe(oe.soundAliasesOrder),filters:pe(jP(this.filtersAll))}}removeOldSoundAndExport(){return this.export()}restore(e){let t=W.stepCounter-1;this.clear();try{if(e.hasOwnProperty("soundAliasesOrder"))oe.soundAliasesOrder=e.soundAliasesOrder;else {E.error("The data does not have the properties soundAliasesOrder");return}if(e.hasOwnProperty("filters")){let i=e.filters;i&&(this.filtersAll=Em(i));}if(e.hasOwnProperty("playInStepIndex")){let i=e.playInStepIndex;i&&(oe.soundsPlaying=i);}if(e.hasOwnProperty("sounds")){let i=e.sounds;for(let s in i){let n=i[s],o=!1,a=this.add(s,{...n.options,autoPlay:!1});if(s in oe.soundsPlaying){let u=oe.soundsPlaying[s];(n.options.loop||u.options&&typeof u.options=="object"&&u.options.loop||u.stepIndex===t)&&(o=!0),n.filters&&(a.filters=Em(n.filters)),o&&a.play();}}}if(e.hasOwnProperty("soundsPlaying")){let i=e.soundsPlaying;for(let s in i){let n=i[s];oe.soundsPlaying[s]={paused:n.paused,stepIndex:n.stepIndex,options:n.options};let o=i[s].sound,a=!1,u;if(this.exists(s)?(u=this.find(s),o.options.url=u.options.url,o.options.volume=u.options.volume,u.options=o.options,u.autoPlay=!1,u.filters=o.filters?Em(o.filters):[]):u=this.add(s,{...o.options,autoPlay:!1}),s in oe.soundsPlaying){let l=oe.soundsPlaying[s];(o.options.loop||l.options&&typeof l.options=="object"&&l.options.loop||l.stepIndex===t)&&(a=!0),o.filters&&(u.filters=Em(o.filters)),a&&u.play();}}}else {E.error("The data does not have the properties soundsPlaying");return}}catch(i){E.error("Error importing data",i);}}};var Po=new Am;Re();function yG(){console.info(`
3316
3316
  _______ _ _ _ ____ ____ ____ _____
3317
3317
  |_ __ \\ (_) (_) | | |_ _| |_ _||_ \\|_ _|
3318
3318
  | |__) |__ _ __ __ \\_| \\ \\ / / | \\ | |