@gjsify/example-dom-excalibur-jelly-jumper 0.4.30 → 0.4.32
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/browser.js +2 -2
- package/dist/gjs.js +53 -53
- package/package.json +7 -7
package/dist/browser.js
CHANGED
|
@@ -888,7 +888,7 @@ void main(){
|
|
|
888
888
|
`;return W=W.replace(`%%texture_picker%%`,Y),W}_addImageAsTexture(e){if(this._images.has(e))return;let R=e.getAttribute(on.Filtering),W=R?parseImageFiltering(R):void 0,Y=parseImageWrapping(e.getAttribute(on.WrappingX)),X=parseImageWrapping(e.getAttribute(on.WrappingY)),ie=e.getAttribute(`forceUpload`)===`true`,ae=this._context.textureLoader.load(e,{filtering:W,wrapping:{x:Y,y:X}},ie);e.removeAttribute(`forceUpload`),this._textures.indexOf(ae)===-1&&(this._textures.push(ae),this._textureToIndex.set(ae,this._textureIndex++),this._images.add(e))}_bindTextures(e){let R=Math.min(this._textureIndex,this._maxTextures);for(let W=0;W<R;W++)e.activeTexture(e.TEXTURE0+W),e.bindTexture(e.TEXTURE_2D,this._textures[W]||this._textures[0])}_getTextureIdForImage(e){if(e){let R=this._context.textureLoader.get(e);return this._textureToIndex.get(R)??-1}return-1}_isFull(){return this._imageCount>=this._maxImages||this._textures.length>=this._maxTextures}_getImageWidth(e){let R=this._imageToWidth.get(e);return R===void 0&&(R=e.width,this._imageToWidth.set(e,R)),R}_getImageHeight(e){let R=this._imageToHeight.get(e);return R===void 0&&(R=e.height,this._imageToHeight.set(e,R)),R}draw(e,R,W,Y,X,ie,ae,le,_e){this._isFull()&&this.flush(),this._imageCount++,this._addImageAsTexture(e);let ye=this._getImageWidth(e),be=this._getImageHeight(e),Ce=ye||Y||0,Te=be||X||0;this._view[0]=0,this._view[1]=0,this._view[2]=Y??ye??0,this._view[3]=X??be??0,this._dest[0]=R??1,this._dest[1]=W??1,ie!==void 0&&ae!==void 0&&le!==void 0&&_e!==void 0&&(this._view[0]=R??1,this._view[1]=W??1,this._view[2]=Y??ye??0,this._view[3]=X??be??0,this._dest[0]=ie,this._dest[1]=ae,Ce=le,Te=_e),R=this._view[0],W=this._view[1];let Oe=this._view[2],Ae=this._view[3],Me=this._context.getTransform(),Pe=this._context.opacity;this._context.snapToPixel&&(this._dest[0]=~~(this._dest[0]+ni),this._dest[1]=~~(this._dest[1]+ni));let Re=this._context.tint||this._defaultTint,Be=this._getTextureIdForImage(e),Ve=ye||Ce,He=be||Te,Ue=(R+this.uvPadding)/Ve,We=(W+this.uvPadding)/He,Ge=(R+Oe-this.uvPadding)/Ve,Ke=(W+Ae-this.uvPadding)/He,qe=ye,Je=be,Ye=this._transformData.bufferData;Ye[this._vertexIndex++]=this._dest[0],Ye[this._vertexIndex++]=this._dest[1],Ye[this._vertexIndex++]=Me.data[0],Ye[this._vertexIndex++]=Me.data[1],Ye[this._vertexIndex++]=Me.data[2],Ye[this._vertexIndex++]=Me.data[3],Ye[this._vertexIndex++]=Me.data[4],Ye[this._vertexIndex++]=Me.data[5],Ye[this._vertexIndex++]=Pe,Ye[this._vertexIndex++]=Ce,Ye[this._vertexIndex++]=Te,Ye[this._vertexIndex++]=qe,Ye[this._vertexIndex++]=Je,Ye[this._vertexIndex++]=Be,Ye[this._vertexIndex++]=Ue,Ye[this._vertexIndex++]=We,Ye[this._vertexIndex++]=Ge,Ye[this._vertexIndex++]=Ke,Ye[this._vertexIndex++]=Re.r/255,Ye[this._vertexIndex++]=Re.g/255,Ye[this._vertexIndex++]=Re.b/255,Ye[this._vertexIndex++]=Re.a}hasPendingDraws(){return this._imageCount!==0}flush(){if(this._imageCount===0)return;let e=this._gl;this._shader.use(),this._bindData(e),this._shader.setUniformMatrix(`u_matrix`,this._context.ortho),this._shader.setUniformBoolean(`u_pixelart`,this.pixelArtSampler),this._bindTextures(e),e.drawArraysInstanced(e.TRIANGLES,0,6,this._imageCount),Nr.DrawnImagesCount+=this._imageCount,Nr.DrawCallCount++,e.bindVertexArray(null),this._imageCount=0,this._vertexIndex=0,this._textures.length=0,this._textureIndex=0,this._textureToIndex.clear(),this._images.clear(),this._imageToWidth.clear(),this._imageToHeight.clear()}};const ni=1e-4;var ExcaliburGraphicsContextWebGLDebug=class{constructor(e){this._webglCtx=e,this._debugText=new DebugText}drawRect(e,R,W,Y,X={color:We.Black}){this.drawLine(vec(e,R),vec(e+W,R),{...X}),this.drawLine(vec(e+W,R),vec(e+W,R+Y),{...X}),this.drawLine(vec(e+W,R+Y),vec(e,R+Y),{...X}),this.drawLine(vec(e,R+Y),vec(e,R),{...X})}drawLine(e,R,W){this._webglCtx.save(),this._webglCtx.z=W?.dashed?lr.config.settings.z.dashed:lr.config.settings.z.solid,this._webglCtx.draw(`ex.debug-line`,e,R,W?.color??We.Black,W?.lineWidth,W?.dashed),this._webglCtx.restore()}drawPoint(e,R={color:We.Black,size:5}){this._webglCtx.save(),this._webglCtx.z=lr.config.settings.z.point,this._webglCtx.draw(`ex.debug-point`,e,R.color,R.size),this._webglCtx.restore()}drawCircle(e,R,W,Y,X){this._webglCtx.save(),this._webglCtx.z=lr.config.settings.z.solid,this._webglCtx.draw(`ex.debug-circle`,e,R,W,Y,X),this._webglCtx.restore()}drawText(e,R){this._webglCtx.save(),this._webglCtx.z=lr.config.settings.z.text,this._debugText.write(this._webglCtx,e,R),this._webglCtx.restore()}},ExcaliburGraphicsContextWebGL=class{constructor(e){this._logger=Je.getInstance(),this._renderers=new Map,this._lazyRenderersFactory=new Map,this.imageRenderer=ie.isEnabled(`use-legacy-image-renderer`)?`ex.image`:`ex.image-v2`,this._isDrawLifecycle=!1,this.useDrawSorting=!0,this._drawCallPool=new Pool(()=>new DrawCall,void 0,4e3),this._drawCallIndex=0,this._drawCalls=Array(4e3).fill(null),this._postProcessTargets=[],this._postprocessors=[],this._transform=new TransformStack,this._state=new StateStack,this.snapToPixel=!1,this.smoothing=!1,this.pixelArtSampler=!1,this.uvPadding=.01,this.backgroundColor=We.ExcaliburBlue,this.multiSampleAntialiasing=!0,this.transparency=!0,this._isContextLost=!1,this._disposed=!1,this._imageToWidth=new Map,this._imageToHeight=new Map,this._totalPostProcessorTime=0;let{canvasElement:R,context:W,enableTransparency:Y,antialiasing:X,uvPadding:ae,multiSampleAntialiasing:le,pixelArtSampler:_e,powerPreference:ye,snapToPixel:be,backgroundColor:Ce,useDrawSorting:Te,garbageCollector:Oe,handleContextLost:Ae,handleContextRestored:Me}=e;if(this.__gl=W??R.getContext(`webgl2`,{antialias:X??this.smoothing,premultipliedAlpha:!1,alpha:Y??this.transparency,depth:!1,powerPreference:ye??`high-performance`}),!this.__gl)throw Error(`Failed to retrieve webgl context from browser`);Ae&&this.__gl.canvas.addEventListener(`webglcontextlost`,Ae,!1),Me&&this.__gl.canvas.addEventListener(`webglcontextrestored`,Me,!1),this.__gl.canvas.addEventListener(`webglcontextlost`,()=>{this._isContextLost=!0}),this.__gl.canvas.addEventListener(`webglcontextrestored`,()=>{this._isContextLost=!1}),this.textureLoader=new $t(this.__gl,Oe),this.snapToPixel=be??this.snapToPixel,this.smoothing=X??this.smoothing,this.transparency=Y??this.transparency,this.pixelArtSampler=_e??this.pixelArtSampler,this.uvPadding=ae??this.uvPadding,this.multiSampleAntialiasing=typeof le==`boolean`?le:this.multiSampleAntialiasing,this.samples=typeof le==`object`?le.samples:void 0,this.backgroundColor=Ce??this.backgroundColor,this.useDrawSorting=Te??this.useDrawSorting,this._drawCallPool.disableWarnings=!0,this._drawCallPool.preallocate(),this._init()}get z(){return this._state.current.z}set z(e){this._state.current.z=e}get opacity(){return this._state.current.opacity}set opacity(e){this._state.current.opacity=e}get tint(){return this._state.current.tint}set tint(e){this._state.current.tint=e}get width(){return this.__gl.canvas.width}get height(){return this.__gl.canvas.height}get ortho(){return this._ortho}checkIfResolutionSupported(e){let R=!0;return(e.width>4096||e.height>4096)&&(R=!1),R}dispose(){if(!this._disposed){this._disposed=!0,this.textureLoader.dispose();for(let e of this._renderers.values())e.dispose();this._renderers.clear(),this._drawCallPool.dispose(),this._drawCalls.length=0,this.__gl=null}}_init(){let e=this.__gl;if(this._ortho=Ae.ortho(0,e.canvas.width,e.canvas.height,0,400,-400),e.viewport(0,0,e.canvas.width,e.canvas.height),e.clearColor(this.backgroundColor.r/255,this.backgroundColor.g/255,this.backgroundColor.b/255,this.backgroundColor.a),e.clear(e.COLOR_BUFFER_BIT),e.enable(e.BLEND),e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA),e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.ONE,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA),e.depthMask(!1),this.register(new ImageRenderer({uvPadding:this.uvPadding,pixelArtSampler:this.pixelArtSampler})),this.register(new MaterialRenderer),this.register(new RectangleRenderer),this.register(new CircleRenderer),this.lazyRegister(`ex.debug-circle`,()=>new DebugCircleRenderer),this.lazyRegister(`ex.debug-point`,()=>new DebugPointRenderer),this.lazyRegister(`ex.debug-line`,()=>new DebugLineRenderer),this.lazyRegister(`ex.particle`,()=>new ParticleRenderer),this.register(new ImageRendererV2({uvPadding:this.uvPadding,pixelArtSampler:this.pixelArtSampler})),this.materialScreenTexture=e.createTexture(),!this.materialScreenTexture)throw Error(`Could not create screen texture!`);e.bindTexture(e.TEXTURE_2D,this.materialScreenTexture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,this.width,this.height,0,e.RGBA,e.UNSIGNED_BYTE,null),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT),e.bindTexture(e.TEXTURE_2D,null),this._screenRenderer=new ScreenPassPainter(this),this._renderTarget=new RenderTarget({gl:e,transparency:this.transparency,width:e.canvas.width,height:e.canvas.height}),this._postProcessTargets=[new RenderTarget({gl:e,transparency:this.transparency,width:e.canvas.width,height:e.canvas.height}),new RenderTarget({gl:e,transparency:this.transparency,width:e.canvas.width,height:e.canvas.height})],this._msaaTarget=new RenderTarget({gl:e,transparency:this.transparency,width:e.canvas.width,height:e.canvas.height,antialias:this.multiSampleAntialiasing,samples:this.samples}),this.debug=new ExcaliburGraphicsContextWebGLDebug(this)}register(e){this._renderers.set(e.type,e),e.initialize(this.__gl,this)}lazyRegister(e,R){this._lazyRenderersFactory.set(e,R)}get(e){let R=this._renderers.get(e);if(!R){let W=this._lazyRenderersFactory.get(e);W&&(this._logger.debug(`lazy init renderer:`,e),R=W(),this.register(R))}return R}_isCurrentRenderer(e){return!this._currentRenderer||this._currentRenderer===e}beginDrawLifecycle(){this._isDrawLifecycle=!0}endDrawLifecycle(){this._isDrawLifecycle=!1}draw(e,...R){if(R.length>9)throw Error(`Only 10 or less renderer arguments are supported!;`);if(this._isDrawLifecycle||this._logger.warnOnce(`Attempting to draw outside the the drawing lifecycle (preDraw/postDraw) is not supported and is a source of bugs/errors.
|
|
889
889
|
If you want to do custom drawing, use Actor.graphics, or any onPreDraw or onPostDraw handler.`),this._isContextLost){this._logger.errorOnce(`Unable to draw ${e}, the webgl context is lost`);return}let W=this.get(e);if(W)if(this.useDrawSorting){let Y=this._drawCallPool.get();Y.z=this._state.current.z,Y.priority=W.priority,Y.renderer=e,this.getTransform().clone(Y.transform),Y.state.z=this._state.current.z,Y.state.opacity=this._state.current.opacity,Y.state.tint=this._state.current.tint,Y.state.material=this._state.current.material,Y.args[0]=R[0],Y.args[1]=R[1],Y.args[2]=R[2],Y.args[3]=R[3],Y.args[4]=R[4],Y.args[5]=R[5],Y.args[6]=R[6],Y.args[7]=R[7],Y.args[8]=R[8],Y.args[9]=R[9],this._drawCalls[this._drawCallIndex++]=Y}else this._currentRenderer||=W,this._isCurrentRenderer(W)||this._currentRenderer.flush(),W.draw(R[0],R[1],R[2],R[3],R[4],R[5],R[6],R[7],R[8],R[9]),this._currentRenderer=W;else throw Error(`No renderer with name ${e} has been registered`)}resetTransform(){this._transform.reset()}updateViewport(e){let R=this.__gl;this._ortho=this._ortho=Ae.ortho(0,e.width,e.height,0,400,-400),this._renderTarget.setResolution(R.canvas.width,R.canvas.height),this._msaaTarget.setResolution(R.canvas.width,R.canvas.height),this._postProcessTargets[0].setResolution(R.canvas.width,R.canvas.height),this._postProcessTargets[1].setResolution(R.canvas.width,R.canvas.height)}_getImageWidth(e){let R=this._imageToWidth.get(e);return R===void 0&&(R=e.width,this._imageToWidth.set(e,R)),R}_getImageHeight(e){let R=this._imageToHeight.get(e);return R===void 0&&(R=e.height,this._imageToHeight.set(e,R)),R}drawImage(e,R,W,Y,X,ie,ae,le,_e){if(!(Y===0||X===0)&&!(le===0||_e===0)&&!(this._getImageWidth(e)===0||this._getImageHeight(e)===0)){if(!e){Je.getInstance().warn(`Cannot draw a null or undefined image`),console.trace&&console.trace();return}this._state.current.material?this.draw(`ex.material`,e,R,W,Y,X,ie,ae,le,_e):(this.imageRenderer,this.draw(this.imageRenderer,e,R,W,Y,X,ie,ae,le,_e))}}drawLine(e,R,W,Y=1){this.draw(`ex.rectangle`,e,R,W,Y)}drawRectangle(e,R,W,Y,X,ie){this.draw(`ex.rectangle`,e,R,W,Y,X,ie)}drawCircle(e,R,W,Y,X){this.draw(`ex.circle`,e,R,W,Y,X)}save(){this._transform.save(),this._state.save()}restore(){this._transform.restore(),this._state.restore()}translate(e,R){this._transform.translate(this.snapToPixel?~~(e+ni):e,this.snapToPixel?~~(R+ni):R)}rotate(e){this._transform.rotate(e)}scale(e,R){this._transform.scale(e,R)}transform(e){this._transform.current=e}getTransform(){return this._transform.current}multiply(e){this._transform.current.multiply(e,this._transform.current)}addPostProcessor(e){this._postprocessors.push(e),e.initialize(this)}removePostProcessor(e){let R=this._postprocessors.indexOf(e);R!==-1&&this._postprocessors.splice(R,1)}clearPostProcessors(){this._postprocessors.length=0}updatePostProcessors(e){for(let R of this._postprocessors){let W=R.getShader();W.use();let Y=W.getUniformDefinitions();this._totalPostProcessorTime+=e,Y.find(e=>e.name===`u_time_ms`)&&W.setUniformFloat(`u_time_ms`,this._totalPostProcessorTime),Y.find(e=>e.name===`u_elapsed_ms`)&&W.setUniformFloat(`u_elapsed_ms`,e),Y.find(e=>e.name===`u_resolution`)&&W.setUniformFloatVector(`u_resolution`,vec(this.width,this.height)),R.onUpdate&&R.onUpdate(e)}}set material(e){this._state.current.material=e}get material(){return this._state.current.material}createMaterial(e){return new ti({...e,graphicsContext:this})}createShader(e){let{name:R,vertexSource:W,fragmentSource:Y,uniforms:X,images:ie,startingTextureSlot:ae}=e,le=new Vr({name:R,graphicsContext:this,vertexSource:W,fragmentSource:Y,uniforms:X,images:ie,startingTextureSlot:ae});return le.compile(),le}clear(){let e=this.__gl;(this.multiSampleAntialiasing?this._msaaTarget:this._renderTarget).use(),e.clearColor(this.backgroundColor.r/255,this.backgroundColor.g/255,this.backgroundColor.b/255,this.backgroundColor.a),e.clear(e.COLOR_BUFFER_BIT)}flush(){if(this._isContextLost){this._logger.errorOnce(`Unable to flush the webgl context is lost`);return}let e=this.multiSampleAntialiasing?this._msaaTarget:this._renderTarget;if(e.use(),this.useDrawSorting){for(let e=this._drawCallIndex;e<this._drawCalls.length;e++)this._drawCalls[e]=null;let R=new Map;for(let[e]of this._renderers){let W=0;for(W=0;W<this._drawCallIndex&&this._drawCalls[W].renderer!==e;W++);R.set(e,W)}this._drawCalls.sort((e,W)=>{if(e===null||W===null)return 0;let Y=e.z-W.z,X=R.get(e.renderer)-R.get(W.renderer),ie=e.priority-W.priority;return Y===0?ie===0?X:ie:Y});let W=this._transform.current,Y=this._state.current;if(this._drawCalls.length&&this._drawCallIndex){let R=this._drawCalls[0].renderer,W=this.get(R);for(let Y=0;Y<this._drawCallIndex;Y++)this._transform.current=this._drawCalls[Y].transform,this._state.current=this._drawCalls[Y].state,this._drawCalls[Y].renderer!==R&&(W.flush(),R=this._drawCalls[Y].renderer,W=this.get(R),Nr.RendererSwaps++),W instanceof MaterialRenderer&&this.material?.isUsingScreenTexture&&(e.copyToTexture(this.materialScreenTexture),e.use()),W.draw(...this._drawCalls[Y].args);W.hasPendingDraws()&&W.flush()}this._transform.current=W,this._state.current=Y,this._drawCallPool.done(),this._drawCallIndex=0,this._imageToHeight.clear(),this._imageToWidth.clear()}else for(let e of this._renderers.values())e.hasPendingDraws()&&e.flush();e.disable(),this._postprocessors.length>0&&e.toRenderSource().use();for(let R=0;R<this._postprocessors.length;R++)e=this._postProcessTargets[R%2],this._postProcessTargets[R%2].use(),this._screenRenderer.renderWithPostProcessor(this._postprocessors[R]),this._postProcessTargets[R%2].toRenderSource().use();e.blitToScreen()}},ii=class FontTextInstance{constructor(e,R,W,Y){this.font=e,this.text=R,this.color=W,this.maxWidth=Y,this._textFragments=[],this.disposed=!1,this._dirty=!0,this.canvas=document.createElement(`canvas`);let X=this.canvas.getContext(`2d`);if(!X)throw Error(`Unable to create FontTextInstance, internal canvas failed to create`);this.ctx=X,this.dimensions=this.measureText(R),this._setDimension(this.dimensions,this.ctx),this._lastHashCode=this.getHashCode()}measureText(e,R){if(this.disposed)throw Error(`Accessing disposed text instance! `+this.text);let W=null;W=R==null?e.split(`
|
|
890
890
|
`):this._getLinesFromText(e,R);let Y=W.reduce((e,R)=>e.length>R.length?e:R);this._applyFont(this.ctx);let X=this.ctx.measureText(Y),ie=Math.abs(X.actualBoundingBoxAscent)+Math.abs(X.actualBoundingBoxDescent),ae=ie*W.length;ie=ae;let le=ae-Math.abs(X.actualBoundingBoxAscent);return new lt({left:0-Math.abs(X.actualBoundingBoxLeft)-this.font.padding,top:0-Math.abs(X.actualBoundingBoxAscent)-this.font.padding,bottom:0+le+this.font.padding,right:0+Math.abs(X.actualBoundingBoxRight)+this.font.padding})}_setDimension(e,R){let W=1;this.font.lineHeight&&(W=this.font.lineHeight/this.font.size),R.canvas.width=(e.width+this.font.padding*2)*2*this.font.quality,R.canvas.height=(e.height+this.font.padding*2)*2*this.font.quality*W}static getHashCode(e,R,W){return R+`__hashcode__`+e.fontString+e.showDebug+e.textAlign+e.baseAlign+e.direction+e.lineHeight+JSON.stringify(e.shadow)+(e.padding.toString()+e.smoothing.toString()+e.lineWidth.toString()+e.lineDash.toString()+e.strokeColor?.toString()+(W?W.toString():e.color.toString()))}getHashCode(e=!0){return FontTextInstance.getHashCode(this.font,this.text,e?this.color:void 0)}_applyRasterProperties(e){e.translate(this.font.padding,this.font.padding),e.imageSmoothingEnabled=this.font.smoothing,e.lineWidth=this.font.lineWidth,e.setLineDash(this.font.lineDash??e.getLineDash()),e.strokeStyle=this.font.strokeColor?.toString()??``,e.fillStyle=this.color.toString()}_applyFont(e){e.resetTransform(),e.translate(this.font.padding+e.canvas.width/2,this.font.padding+e.canvas.height/2),e.scale(this.font.quality,this.font.quality),e.textAlign=this.font.textAlign,e.textBaseline=this.font.baseAlign,e.font=this.font.fontString,e.direction=this.font.direction,this.font.shadow&&(this.font.shadow.color&&(e.shadowColor=this.font.shadow.color.toString()),this.font.shadow.blur&&(e.shadowBlur=this.font.shadow.blur),this.font.shadow.offset&&(e.shadowOffsetX=this.font.shadow.offset.x,e.shadowOffsetY=this.font.shadow.offset.y))}_drawText(e,R,W){this._applyRasterProperties(e),this._applyFont(e);for(let Y=0;Y<R.length;Y++){let X=R[Y];this.color&&e.fillText(X,0,Y*W),this.font.strokeColor&&e.strokeText(X,0,Y*W)}this.font.showDebug&&(line(e,We.Green,-e.canvas.width/2,0,e.canvas.width/2,0,2),line(e,We.Red,0,-e.canvas.height/2,0,e.canvas.height/2,2))}_splitTextBitmap(e){let R=[],W=0,Y=0,X=Math.min(4096,e.canvas.width),ie=Math.min(4096,e.canvas.height);for(;W<e.canvas.width;){for(;Y<e.canvas.height;){let ae=document.createElement(`canvas`);ae.width=X,ae.height=ie;let le=ae.getContext(`2d`);if(!le)throw Error(`Unable to split internal FontTextInstance bitmap, failed to create internal canvas`);le.drawImage(e.canvas,W,Y,X,ie,0,0,X,ie),R.push({x:W,y:Y,canvas:ae}),Y+=ie}W+=X,Y=0}return R}flagDirty(){this._dirty=!0}render(e,R,W,Y){if(this.disposed)throw Error(`Accessing disposed text instance! `+this.text);this._ex=e;let X=this.getHashCode();if(this._lastHashCode!==X&&(this._dirty=!0),this._dirty){this.dimensions=this.measureText(this.text,Y),this._setDimension(this.dimensions,this.ctx);let R=this._getLinesFromText(this.text,Y),W=this.font.lineHeight??this.dimensions.height/R.length;if(this._drawText(this.ctx,R,W),e instanceof ExcaliburGraphicsContextWebGL)for(let R of this._textFragments)e.textureLoader.delete(R.canvas);if(this._textFragments=this._splitTextBitmap(this.ctx),e instanceof ExcaliburGraphicsContextWebGL)for(let R of this._textFragments)e.textureLoader.load(R.canvas,{filtering:this.font.filtering},!0);this._lastHashCode=X,this._dirty=!1}for(let Y of this._textFragments)e.drawImage(Y.canvas,0,0,Y.canvas.width,Y.canvas.height,Y.x/this.font.quality+R-this.ctx.canvas.width/this.font.quality/2,Y.y/this.font.quality+W-this.ctx.canvas.height/this.font.quality/2,Y.canvas.width/this.font.quality,Y.canvas.height/this.font.quality)}dispose(){if(this.disposed=!0,this.dimensions=void 0,this.canvas=void 0,this.ctx=void 0,this._ex instanceof ExcaliburGraphicsContextWebGL)for(let e of this._textFragments)this._ex.textureLoader.delete(e.canvas);this._textFragments.length=0}_getLinesFromText(e,R){if(this._cachedText===e&&this._cachedRenderWidth===R&&this._cachedLines?.length)return this._cachedLines;let W=e.split(`
|
|
891
|
-
`);if(R==null)return W;for(let e=0;e<W.length;e++){let Y=W[e],X=``;if(this.measureText(Y).width>R){for(;this.measureText(Y).width>R;)X=Y[Y.length-1]+X,Y=Y.slice(0,-1);W[e]=Y,W[e+1]=X}}return this._cachedText=e,this._cachedLines=W,this._cachedRenderWidth=R,W}},si=class Font extends Rt{constructor(e={}){super(e),this.filtering=Yt.Blended,this.quality=2,this.padding=2,this.smoothing=!1,this.lineWidth=1,this.lineDash=[],this.color=We.Black,this.family=`sans-serif`,this.style=qt.Normal,this.bold=!1,this.unit=Wt.Px,this.textAlign=Gt.Left,this.baseAlign=Kt.Top,this.direction=Jt.LeftToRight,this.lineHeight=void 0,this.size=10,this._textBounds=new lt,this.smoothing=e?.smoothing??this.smoothing,this.padding=e?.padding??this.padding,this.color=e?.color??this.color,this.strokeColor=e?.strokeColor??this.strokeColor,this.lineDash=e?.lineDash??this.lineDash,this.lineWidth=e?.lineWidth??this.lineWidth,this.filtering=e?.filtering??this.filtering,this.family=e?.family??this.family,this.style=e?.style??this.style,this.bold=e?.bold??this.bold,this.size=e?.size??this.size,this.unit=e?.unit??this.unit,this.textAlign=e?.textAlign??this.textAlign,this.baseAlign=e?.baseAlign??this.baseAlign,this.direction=e?.direction??this.direction,this.lineHeight=e?.lineHeight??this.lineHeight,this.quality=e?.quality??this.quality,e?.shadow&&(this.shadow={},this.shadow.blur=e.shadow.blur??this.shadow.blur,this.shadow.offset=e.shadow.offset??this.shadow.offset,this.shadow.color=e.shadow.color??this.shadow.color),this._textMeasurement=new ii(this,``,We.Black)}clone(){return new Font({...this.cloneGraphicOptions(),size:this.size,unit:this.unit,family:this.family,style:this.style,bold:this.bold,textAlign:this.textAlign,baseAlign:this.baseAlign,direction:this.direction,shadow:this.shadow?{blur:this.shadow.blur,offset:this.shadow.offset,color:this.shadow.color}:void 0})}get fontString(){return`${this.style} ${this.bold?`bold`:``} ${this.size}${this.unit} ${this.family}`}get localBounds(){return this._textBounds}_drawImage(e,R,W){}_rotate(e){let R=this.origin??this._textBounds.center;e.translate(R.x,R.y),e.rotate(this.rotation),e.translate(-R.x,-R.y)}_flip(e){this.flipHorizontal&&(e.translate(this._textBounds.width/this.scale.x,0),e.scale(-1,1)),this.flipVertical&&(e.translate(0,-this._textBounds.height/2/this.scale.y),e.scale(1,-1))}measureTextWithoutCache(e,R){return this._textMeasurement.measureText(e,R)}measureText(e,R){return gr.measureText(e,this,R)}_postDraw(e){e.restore()}render(e,R,W,Y,X,ie){let ae=gr.getTextInstance(R,this,W);this._textBounds=ae.dimensions,this._preDraw(e,Y,X),ae.render(e,Y,X,ie),this._postDraw(e)}},ci=class Text extends Rt{constructor(e){super(e),this._text=``,this._textWidth=0,this._textHeight=0,this.font=e.font??new si,this.color=e.color??this.color,this.text=e.text,this.maxWidth=e.maxWidth}clone(){return new Text({text:this.text.slice(),color:this.color?.clone()??We.Black,font:this.font.clone(),maxWidth:this.maxWidth})}get text(){return this._text}set text(e){this._text=e,this._calculateDimension()}get font(){return this._font}set font(e){this._font=e}get width(){return this._textWidth===0&&this._calculateDimension(),this._textWidth*this.scale.x}get height(){return this._textHeight===0&&this._calculateDimension(),this._textHeight*this.scale.y}_calculateDimension(){let{width:e,height:R}=this.font.measureText(this._text,this.maxWidth);this._textWidth=e,this._textHeight=R}get localBounds(){return this.font.measureText(this._text,this.maxWidth).scale(this.scale)}_rotate(e){}_flip(e){}_preDraw(e,R,W){(this.isStale()||this.font.isStale())&&(this.font.flipHorizontal=this.flipHorizontal,this.font.flipVertical=this.flipVertical,this.font.rotation=this.rotation,this.font.origin=this.origin,this.font.opacity=this.opacity),this.font.tint=this.tint,super._preDraw(e,R,W)}_drawImage(e,R,W){let Y=We.Black;this.font instanceof si&&(Y=this.color??this.font.color);let{width:X,height:ie}=this.font.measureText(this._text,this.maxWidth);this._textWidth=X,this._textHeight=ie,this.font.render(e,this._text,Y,R,W,this.maxWidth),this.font.showDebug&&(e.debug.drawRect(R-X,W-ie,X*2,ie*2),this.maxWidth!=null&&e.debug.drawRect(R,W,this.maxWidth,this.height,{color:We.Yellow}))}};function hasGraphicsTick(e){return!!e.tick}var fi=class GraphicsComponent extends Component{constructor(e){super(),this._logger=Je.getInstance(),this._current=`default`,this._graphics={},this._options={},this.material=null,this.isVisible=!0,this.forceOnScreen=!1,this.opacity=1,this._offset=new WatchVector(Oe.Zero,()=>this.recalculateBounds()),this._anchor=new WatchVector(Oe.Half,()=>this.recalculateBounds()),this.flipHorizontal=!1,this.flipVertical=!1,this.copyGraphics=!1,e={visible:this.isVisible,graphics:{},...e};let{current:R,anchor:W,color:Y,opacity:X,visible:ie,graphics:ae,offset:le,copyGraphics:_e,onPreDraw:ye,onPostDraw:be,onPreTransformDraw:Ce,onPostTransformDraw:Te}=e;for(let[e,R]of Object.entries(ae))R instanceof Rt?this._graphics[e]=R:(this._graphics[e]=R.graphic,this._options[e]=R.options);this.offset=le??this.offset,this.opacity=X??this.opacity,this.anchor=W??this.anchor,this.color=Y??this.color,this.copyGraphics=_e??this.copyGraphics,this.onPreDraw=ye??this.onPreDraw,this.onPostDraw=be??this.onPostDraw,this.onPreDraw=Ce??this.onPreTransformDraw,this.onPostTransformDraw=Te??this.onPostTransformDraw,this.isVisible=!!ie,this._current=R??this._current,R&&this._graphics[R]&&this.use(R)}get visible(){return this.isVisible}set visible(e){this.isVisible=e}get offset(){return this._offset}set offset(e){this._offset=new WatchVector(e,()=>this.recalculateBounds()),this.recalculateBounds()}get anchor(){return this._anchor}set anchor(e){this._anchor=new WatchVector(e,()=>this.recalculateBounds()),this.recalculateBounds()}get color(){return this._color}set color(e){if(e){this._color=e.clone();let R=this.current;(R instanceof Raster||R instanceof ci)&&(R.color=this._color)}}getGraphic(e){return this._graphics[e]}getOptions(e){return this._options[e]}getNames(){return Object.keys(this._graphics)}get current(){return this._graphics[this._current]}get currentOptions(){return this._options[this._current]}get graphics(){return this._graphics}get options(){return this._options}add(e,R,W){let Y=`default`,X=null,ie;if(typeof e==`string`&&R instanceof Rt&&(Y=e,X=R,ie=W),e instanceof Rt&&!(R instanceof Rt)&&(X=e,ie=R),!X)throw Error(`Need to provide a graphic or valid graphic string`);return this._graphics[Y]=this.copyGraphics?X.clone():X,this._options[Y]=this.copyGraphics?{...ie}:ie,Y===`default`&&this.use(`default`),X}remove(e){delete this._graphics[e],delete this._options[e],this._current===e&&(this._current=`default`,this.recalculateBounds())}use(e,R){if(e instanceof Rt){let W=e;this.copyGraphics&&(W=e.clone()),this._current=`default`,this._graphics[this._current]=W,this._options[this._current]=R}else this._current=e,this._options[this._current]=R,this._current in this._graphics||this._logger.warn(`Graphic ${this._current} is not registered with the graphics component owned by ${this.owner?.name}. Nothing will be drawn.`);return this.recalculateBounds(),this.current}hide(){this._current=`ex.none`}set localBounds(e){this._localBounds=e}recalculateBounds(){let e=new lt,R=this._graphics[this._current],W=this._options[this._current];if(!R){this._localBounds=e;return}let Y=this.anchor,X=this.offset;W?.anchor&&(Y=W.anchor),W?.offset&&(X=W.offset);let ie=R.localBounds,ae=-ie.width*Y.x+X.x,le=-ie.height*Y.y+X.y;e=R instanceof Ut&&!R.useAnchor?R?.localBounds.combine(e):R?.localBounds.translate(vec(ae,le)).combine(e),this._localBounds=e}get localBounds(){return(!this._localBounds||this._localBounds.hasZeroDimensions())&&this.recalculateBounds(),this._localBounds}get bounds(){let e=this.localBounds;if(this.owner){let R=this.owner.get(Xe);R&&(e=e.transform(R.get().matrix))}return e}update(e,R=0){let W=this.current;W&&hasGraphicsTick(W)&&W.tick(e,R)}clone(){let e=new GraphicsComponent;return e._graphics={...this._graphics},e._options={...this._options},e.offset=this.offset.clone(),this.color&&(e.color=this.color.clone()),e.opacity=this.opacity,e.anchor=this.anchor.clone(),e.copyGraphics=this.copyGraphics,e.onPreDraw=this.onPreDraw,e.onPostDraw=this.onPostDraw,e.isVisible=this.isVisible,e}},PointerComponent=class extends Component{constructor(e){super(),this.useColliderShape=!0,this.useGraphicsBounds=!0,this.useColliderShape=e?.useColliderShape??this.useColliderShape,this.useGraphicsBounds=e?.useGraphicsBounds??this.useGraphicsBounds,this.localBounds=e?.localBounds}};function isLegacyEasing(e){return!!e&&e.length===4}const pi=class _EasingFunctions2{static CreateReversibleEasingFunction(e){return(R,W,Y,X)=>Y<W?W-(e(R,Y,W,X)-Y):e(R,W,Y,X)}static CreateVectorEasingFunction(e){return(R,W,Y,X)=>new Oe(e(R,W.x,Y.x,X),e(R,W.y,Y.y,X))}};pi.Linear=pi.CreateReversibleEasingFunction((e,R,W,Y)=>(W-=R,W*e/Y+R)),pi.EaseInQuad=pi.CreateReversibleEasingFunction((e,R,W,Y)=>(W-=R,e/=Y,W*e*e+R)),pi.EaseOutQuad=pi.CreateReversibleEasingFunction((e,R,W,Y)=>(W-=R,e/=Y,-W*e*(e-2)+R)),pi.EaseInOutQuad=pi.CreateReversibleEasingFunction((e,R,W,Y)=>(W-=R,e/=Y/2,e<1?W/2*e*e+R:(e--,-W/2*(e*(e-2)-1)+R))),pi.EaseInCubic=pi.CreateReversibleEasingFunction((e,R,W,Y)=>(W-=R,e/=Y,W*e*e*e+R)),pi.EaseOutCubic=pi.CreateReversibleEasingFunction((e,R,W,Y)=>(W-=R,e/=Y,e--,W*(e*e*e+1)+R)),pi.EaseInOutCubic=pi.CreateReversibleEasingFunction((e,R,W,Y)=>(W-=R,e/=Y/2,e<1?W/2*e*e*e+R:(e-=2,W/2*(e*e*e+2)+R)));let mi=pi;var ActionQueue=class{constructor(e){this._actions=[],this._currentAction=null,this._completedActions=[],this._entity=e}add(e){this._actions.push(e)}remove(e){let R=this._actions.indexOf(e);this._actions.splice(R,1)}clearActions(){this._actions.length=0,this._completedActions.length=0,this._currentAction&&this._currentAction.stop()}getActions(){return this._actions.concat(this._completedActions)}getIncompleteActions(){return this._actions}getCurrentAction(){return this._currentAction}hasNext(){return this._actions.length>0}isComplete(){return this._actions.length===0}reset(){this._actions=this.getActions();let e=this._actions.length;for(let R=0;R<e;R++)this._actions[R].reset();this._completedActions=[]}update(e){if(this._actions.length>0&&(this._currentAction!==this._actions[0]&&(this._currentAction=this._actions[0],this._entity.emit(`actionstart`,new ActionStartEvent(this._currentAction,this._entity))),this._currentAction.update(e),this._currentAction.isComplete(this._entity))){this._entity.emit(`actioncomplete`,new ActionCompleteEvent(this._currentAction,this._entity));let e=this._actions.shift();e&&this._completedActions.push(e)}}};let hi=0;function nextActionId(){return hi++}var Repeat=class{constructor(e,R,W){this.id=nextActionId(),this._stopped=!1,this._repeatBuilder=R,this._repeatContext=new ActionContext(e),this._actionQueue=this._repeatContext.getQueue(),this._repeat=W,this._originalRepeat=W,this._repeatBuilder(this._repeatContext),this._repeat--}update(e){this._actionQueue.isComplete()&&(this._actionQueue.clearActions(),this._repeatBuilder(this._repeatContext),this._repeat--),this._actionQueue.update(e)}isComplete(){return this._stopped||this._repeat<=0&&this._actionQueue.isComplete()}stop(){this._stopped=!0}reset(){this._repeat=this._originalRepeat}},RepeatForever=class{constructor(e,R){this.id=nextActionId(),this._stopped=!1,this._repeatBuilder=R,this._repeatContext=new ActionContext(e),this._actionQueue=this._repeatContext.getQueue(),this._repeatBuilder(this._repeatContext)}update(e){this._stopped||(this._actionQueue.isComplete()&&(this._actionQueue.clearActions(),this._repeatBuilder(this._repeatContext)),this._actionQueue.update(e))}isComplete(){return this._stopped}stop(){this._stopped=!0,this._actionQueue.clearActions()}reset(){}};function isMoveByOptions(e){return e.offset instanceof Oe&&typeof e.duration==`number`}var MoveByWithOptions=class{constructor(e,R){if(this.entity=e,this.id=nextActionId(),this._started=!1,this._stopped=!1,this._legacyEasing=mi.Linear,this._easing=linear,this._useLegacyEasing=!1,this._offset=R.offset,this._easing=R.easing??this._easing,isLegacyEasing(R.easing)&&(this._legacyEasing=R.easing,this._useLegacyEasing=!0),this._tx=e.get(Xe),this._motion=e.get(MotionComponent),!this._tx)throw Error(`Entity ${e.name} has no TransformComponent, can only MoveBy on Entities with TransformComponents.`);this._durationMs=R.duration,this._currentMs=this._durationMs}update(e){this._started||=(this._start=this._tx.pos.clone(),this._end=this._start.add(this._offset),!0),this._currentMs-=e;let R=clamp(remap(0,this._durationMs,0,1,this._durationMs-this._currentMs),0,1),W=this._tx.pos,Y=0,X=0;this._useLegacyEasing?(Y=this._legacyEasing(R,this._start.x,this._end.x,1),X=this._legacyEasing(R,this._start.y,this._end.y,1)):(Y=lerp(this._start.x,this._end.x,this._easing(R)),X=lerp(this._start.y,this._end.y,this._easing(R)));let ie=e/1e3,ae=ie===0?0:(Y-W.x)/ie,le=ie===0?0:(X-W.y)/ie;this._motion.vel.x=ae,this._motion.vel.y=le,this.isComplete(this.entity)&&(this._tx.pos=vec(this._end.x,this._end.y),this._motion.vel=vec(0,0))}isComplete(e){return this._stopped||this._currentMs<0}stop(){this._motion.vel=vec(0,0),this._stopped=!0,this._currentMs=0}reset(){this._currentMs=this._durationMs,this._started=!1,this._stopped=!1}},MoveBy=class{constructor(e,R,W,Y){if(this.id=nextActionId(),this._started=!1,this._stopped=!1,this._entity=e,this._tx=e.get(Xe),this._motion=e.get(MotionComponent),this._speed=Y,this._offset=new Oe(R,W),Y<=0)throw Je.getInstance().error(`Attempted to moveBy with speed less than or equal to zero : `+Y),Error(`Speed must be greater than 0 pixels per second`)}update(e){this._started||(this._started=!0,this._start=new Oe(this._tx.pos.x,this._tx.pos.y),this._end=this._start.add(this._offset),this._distance=this._offset.magnitude,this._dir=this._end.sub(this._start).normalize()),this.isComplete(this._entity)?(this._tx.pos=vec(this._end.x,this._end.y),this._motion.vel=vec(0,0)):this._motion.vel=this._dir.scale(this._speed)}isComplete(e){let R=e.get(Xe);return this._stopped||R.pos.distance(this._start)>=this._distance}stop(){this._motion.vel=vec(0,0),this._stopped=!0}reset(){this._started=!1,this._stopped=!1}};function isMoveToOptions(e){return e.pos instanceof Oe&&typeof e.duration==`number`}var MoveToWithOptions=class{constructor(e,R){if(this.entity=e,this.id=nextActionId(),this._started=!1,this._stopped=!1,this._easing=linear,this._legacyEasing=mi.Linear,this._useLegacyEasing=!1,this._end=R.pos,this._easing=R.easing??this._easing,isLegacyEasing(R.easing)&&(this._legacyEasing=R.easing,this._useLegacyEasing=!0),this._tx=e.get(Xe),this._motion=e.get(MotionComponent),!this._tx)throw Error(`Entity ${e.name} has no TransformComponent, can only moveTo on Entities with TransformComponents.`);this._durationMs=R.duration,this._currentMs=this._durationMs}update(e){this._started||=(this._start=this._tx.pos.clone(),!0),this._currentMs-=e;let R=clamp(remap(0,this._durationMs,0,1,this._durationMs-this._currentMs),0,1),W=this._tx.pos,Y=0,X=0;this._useLegacyEasing?(Y=this._legacyEasing(R,this._start.x,this._end.x,1),X=this._legacyEasing(R,this._start.y,this._end.y,1)):(Y=lerp(this._start.x,this._end.x,this._easing(R)),X=lerp(this._start.y,this._end.y,this._easing(R)));let ie=e/1e3,ae=ie===0?0:(Y-W.x)/ie,le=ie===0?0:(X-W.y)/ie;this._motion.vel.x=ae,this._motion.vel.y=le,this.isComplete(this.entity)&&(this._tx.pos=vec(this._end.x,this._end.y),this._motion.vel=vec(0,0))}isComplete(e){return this._stopped||this._currentMs<0}stop(){this._motion.vel=vec(0,0),this._stopped=!0,this._currentMs=0}reset(){this._currentMs=this._durationMs,this._started=!1,this._stopped=!1}},MoveTo=class{constructor(e,R,W,Y){this.entity=e,this.id=nextActionId(),this._started=!1,this._stopped=!1,this._tx=e.get(Xe),this._motion=e.get(MotionComponent),this._end=new Oe(R,W),this._speed=Y}update(e){this._started||(this._started=!0,this._start=new Oe(this._tx.pos.x,this._tx.pos.y),this._distance=this._start.distance(this._end),this._dir=this._end.sub(this._start).normalize());let R=this._dir.scale(this._speed);this._motion.vel=vec(R.x,R.y),this.isComplete(this.entity)&&(this._tx.pos=vec(this._end.x,this._end.y),this._motion.vel=vec(0,0))}isComplete(e){let R=e.get(Xe);return this._stopped||new Oe(R.pos.x,R.pos.y).distance(this._start)>=this._distance}stop(){this._motion.vel=vec(0,0),this._stopped=!0}reset(){this._started=!1,this._stopped=!1}},RotateToWithOptions=class{constructor(e,R){if(this.entity=e,this.id=nextActionId(),this._started=!1,this._stopped=!1,this._endAngle=0,this._startAngle=0,this._endAngle=R.angle,this._tx=e.get(Xe),this._motion=e.get(MotionComponent),!this._tx)throw Error(`Entity ${e.name} has no TransformComponent, can only RotateTo on Entities with TransformComponents.`);this._durationMs=R.duration,this._rotationType=R.rotationType??le.ShortestPath,this._currentMs=this._durationMs}update(e){this._started||=(this._startAngle=this._tx.rotation,!0),this._currentMs-=e;let R=clamp(remap(0,this._durationMs,0,1,this._durationMs-this._currentMs),0,1),W=lerpAngle(this._startAngle,this._endAngle,this._rotationType,R),Y=this._tx.rotation,X=e/1e3,ie=X===0?0:(W-Y)/X;this._motion.angularVelocity=ie,this.isComplete(this.entity)&&(this._tx.rotation=this._endAngle,this._motion.angularVelocity=0)}isComplete(e){return this._stopped||this._currentMs<0}stop(){this._motion.angularVelocity=0,this._stopped=!0,this._currentMs=0}reset(){this._currentMs=this._durationMs,this._started=!1,this._stopped=!1}},RotateTo=class{constructor(e,R,W,Y){this.id=nextActionId(),this._started=!1,this._stopped=!1,this._tx=e.get(Xe),this._motion=e.get(MotionComponent),this._end=R,this._speed=W,this._rotationType=Y||le.ShortestPath}update(e){if(!this._started){this._started=!0,this._start=this._tx.rotation,this._currentNonCannonAngle=this._tx.rotation;let e=Math.abs(this._end-this._start),R=Ce-e;switch(e>R?(this._shortDistance=R,this._longDistance=e):(this._shortDistance=e,this._longDistance=R),this._shortestPathIsPositive=(this._start-this._end+Ce)%Ce>=Math.PI,this._rotationType){case le.ShortestPath:this._distance=this._shortDistance,this._shortestPathIsPositive?this._direction=1:this._direction=-1;break;case le.LongestPath:this._distance=this._longDistance,this._shortestPathIsPositive?this._direction=-1:this._direction=1;break;case le.Clockwise:this._direction=1,this._shortestPathIsPositive?this._distance=this._shortDistance:this._distance=this._longDistance;break;case le.CounterClockwise:this._direction=-1,this._shortestPathIsPositive?this._distance=this._longDistance:this._distance=this._shortDistance;break}}this._motion.angularVelocity=this._direction*this._speed,this._currentNonCannonAngle+=this._direction*this._speed*(e/1e3),this.isComplete()&&(this._tx.rotation=this._end,this._motion.angularVelocity=0,this._stopped=!0)}isComplete(){let e=Math.abs(this._currentNonCannonAngle-this._start);return this._stopped||e>=Math.abs(this._distance)}stop(){this._motion.angularVelocity=0,this._stopped=!0}reset(){this._started=!1,this._stopped=!1}},RotateByWithOptions=class{constructor(e,R){if(this.entity=e,this.id=nextActionId(),this._started=!1,this._stopped=!1,this._offset=0,this._startAngle=0,this._endAngle=0,this._offset=R.angleRadiansOffset,this._tx=e.get(Xe),this._motion=e.get(MotionComponent),!this._tx)throw Error(`Entity ${e.name} has no TransformComponent, can only RotateBy on Entities with TransformComponents.`);this._durationMs=R.duration,this._rotationType=R.rotationType??le.ShortestPath,this._currentMs=this._durationMs}update(e){this._started||=(this._startAngle=this._tx.rotation,this._endAngle=canonicalizeAngle(this._startAngle+this._offset),!0),this._currentMs-=e;let R=clamp(remap(0,this._durationMs,0,1,this._durationMs-this._currentMs),0,1),W=lerpAngle(this._startAngle,this._endAngle,this._rotationType,R),Y=this._tx.rotation,X=e/1e3,ie=X===0?0:(W-Y)/X;this._motion.angularVelocity=ie,this.isComplete()&&(this._tx.rotation=this._endAngle,this._motion.angularVelocity=0)}isComplete(){return this._stopped||this._currentMs<0}stop(){this._motion.angularVelocity=0,this._stopped=!0,this._currentMs=0}reset(){this._currentMs=this._durationMs,this._started=!1,this._stopped=!1}},RotateBy=class{constructor(e,R,W,Y){this.id=nextActionId(),this._started=!1,this._stopped=!1,this._tx=e.get(Xe),this._motion=e.get(MotionComponent),this._speed=W,this._offset=R,this._rotationType=Y||le.ShortestPath}update(e){if(!this._started){this._started=!0,this._start=this._tx.rotation,this._currentNonCannonAngle=this._tx.rotation,this._end=this._start+this._offset;let e=Math.abs(this._end-this._start),R=Ce-e;switch(e>R?(this._shortDistance=R,this._longDistance=e):(this._shortDistance=e,this._longDistance=R),this._shortestPathIsPositive=(this._start-this._end+Ce)%Ce>=Math.PI,this._rotationType){case le.ShortestPath:this._distance=this._shortDistance,this._shortestPathIsPositive?this._direction=1:this._direction=-1;break;case le.LongestPath:this._distance=this._longDistance,this._shortestPathIsPositive?this._direction=-1:this._direction=1;break;case le.Clockwise:this._direction=1,this._shortDistance>=0?this._distance=this._shortDistance:this._distance=this._longDistance;break;case le.CounterClockwise:this._direction=-1,this._shortDistance<=0?this._distance=this._shortDistance:this._distance=this._longDistance;break}}this._motion.angularVelocity=this._direction*this._speed,this._currentNonCannonAngle+=this._direction*this._speed*(e/1e3),this.isComplete()&&(this._tx.rotation=this._end,this._motion.angularVelocity=0,this._stopped=!0)}isComplete(){let e=Math.abs(this._currentNonCannonAngle-this._start);return this._stopped||e>=Math.abs(this._distance)}stop(){this._motion.angularVelocity=0,this._stopped=!0}reset(){this._started=!1,this._stopped=!1,this._start=void 0,this._currentNonCannonAngle=void 0,this._distance=void 0}};function isScaleToOptions(e){return typeof e.scale==`object`&&typeof e.duration==`number`}var ScaleToWithOptions=class{constructor(e,R){if(this.entity=e,this.id=nextActionId(),this._started=!1,this._stopped=!1,this._endScale=vec(1,1),this._startScale=vec(1,1),this._endScale=R.scale,this._tx=e.get(Xe),this._motion=e.get(MotionComponent),!this._tx)throw Error(`Entity ${e.name} has no TransformComponent, can only ScaleTo on Entities with TransformComponents.`);this._durationMs=R.duration,this._currentMs=this._durationMs}update(e){this._started||=(this._startScale=this._tx.scale,!0),this._currentMs-=e;let R=clamp(remap(0,this._durationMs,0,1,this._durationMs-this._currentMs),0,1),W=lerpVector(this._startScale,this._endScale,R),Y=this._tx.scale,X=e/1e3,ie=W.sub(Y).scale(X===0?0:1/X);this._motion.scaleFactor=ie,this.isComplete()&&(this._tx.scale=this._endScale,this._motion.angularVelocity=0)}isComplete(){return this._stopped||this._currentMs<0}stop(){this._motion.scaleFactor=Oe.Zero,this._stopped=!0,this._currentMs=0}reset(){this._currentMs=this._durationMs,this._started=!1,this._stopped=!1}},ScaleTo=class{constructor(e,R,W,Y,X){this.id=nextActionId(),this._started=!1,this._stopped=!1,this._tx=e.get(Xe),this._motion=e.get(MotionComponent),this._endX=R,this._endY=W,this._speedX=Y,this._speedY=X}update(e){if(this._started||(this._started=!0,this._startX=this._tx.scale.x,this._startY=this._tx.scale.y,this._distanceX=Math.abs(this._endX-this._startX),this._distanceY=Math.abs(this._endY-this._startY)),Math.abs(this._tx.scale.x-this._startX)>=this._distanceX)this._motion.scaleFactor.x=0;else{let e=this._endY<this._startY?-1:1;this._motion.scaleFactor.x=this._speedX*e}if(Math.abs(this._tx.scale.y-this._startY)>=this._distanceY)this._motion.scaleFactor.y=0;else{let e=this._endY<this._startY?-1:1;this._motion.scaleFactor.y=this._speedY*e}this.isComplete()&&(this._tx.scale=vec(this._endX,this._endY),this._motion.scaleFactor.x=0,this._motion.scaleFactor.y=0)}isComplete(){return this._stopped||Math.abs(this._tx.scale.x-this._startX)>=this._distanceX-.01&&Math.abs(this._tx.scale.y-this._startY)>=this._distanceY-.01}stop(){this._motion.scaleFactor.x=0,this._motion.scaleFactor.y=0,this._stopped=!0}reset(){this._started=!1,this._stopped=!1}};function isScaleByOptions(e){return typeof e.scaleOffset==`object`&&typeof e.duration==`number`}var ScaleByWithOptions=class{constructor(e,R){if(this.entity=e,this.id=nextActionId(),this._started=!1,this._stopped=!1,this._endScale=vec(1,1),this._scaleOffset=vec(0,0),this._startScale=vec(1,1),this._scaleOffset=R.scaleOffset,this._tx=e.get(Xe),this._motion=e.get(MotionComponent),!this._tx)throw Error(`Entity ${e.name} has no TransformComponent, can only ScaleBy on Entities with TransformComponents.`);this._durationMs=R.duration,this._currentMs=this._durationMs}update(e){this._started||=(this._startScale=this._tx.scale,this._endScale=this._startScale.add(this._scaleOffset),!0),this._currentMs-=e;let R=clamp(remap(0,this._durationMs,0,1,this._durationMs-this._currentMs),0,1),W=lerpVector(this._startScale,this._endScale,R),Y=this._tx.scale,X=e/1e3,ie=W.sub(Y).scale(X===0?0:1/X);this._motion.scaleFactor=ie,this.isComplete()&&(this._tx.scale=this._endScale,this._motion.angularVelocity=0)}isComplete(){return this._stopped||this._currentMs<0}stop(){this._motion.scaleFactor=Oe.Zero,this._stopped=!0,this._currentMs=0}reset(){this._currentMs=this._durationMs,this._started=!1,this._stopped=!1}},ScaleBy=class{constructor(e,R,W,Y){this.id=nextActionId(),this._started=!1,this._stopped=!1,this._tx=e.get(Xe),this._motion=e.get(MotionComponent),this._offset=new Oe(R,W),this._speedX=this._speedY=Y}update(e){this._started||(this._started=!0,this._startScale=this._tx.scale.clone(),this._endScale=this._startScale.add(this._offset),this._distanceX=Math.abs(this._endScale.x-this._startScale.x),this._distanceY=Math.abs(this._endScale.y-this._startScale.y),this._directionX=this._endScale.x<this._startScale.x?-1:1,this._directionY=this._endScale.y<this._startScale.y?-1:1),this._motion.scaleFactor.x=this._speedX*this._directionX,this._motion.scaleFactor.y=this._speedY*this._directionY,this.isComplete()&&(this._tx.scale=this._endScale,this._motion.scaleFactor.x=0,this._motion.scaleFactor.y=0)}isComplete(){return this._stopped||Math.abs(this._tx.scale.x-this._startScale.x)>=this._distanceX-.01&&Math.abs(this._tx.scale.y-this._startScale.y)>=this._distanceY-.01}stop(){this._motion.scaleFactor.x=0,this._motion.scaleFactor.y=0,this._stopped=!0}reset(){this._started=!1,this._stopped=!1}},CallMethod=class{constructor(e){this.id=nextActionId(),this._hasBeenCalled=!1,this._method=e}update(e){this._method(),this._hasBeenCalled=!0}isComplete(){return this._hasBeenCalled}reset(){this._hasBeenCalled=!1}stop(){this._hasBeenCalled=!0}},EaseTo=class{constructor(e,R,W,Y,X){this.easingFcn=X,this.id=nextActionId(),this._currentLerpTime=0,this._lerpDuration=1*1e3,this._lerpStart=new Oe(0,0),this._lerpEnd=new Oe(0,0),this._initialized=!1,this._stopped=!1,this._tx=e.get(Xe),this._motion=e.get(MotionComponent),this._lerpDuration=Y,this._lerpEnd=new Oe(R,W)}_initialize(){this._lerpStart=new Oe(this._tx.pos.x,this._tx.pos.y),this._currentLerpTime=0}update(e){this._initialized||=(this._initialize(),!0),this._currentLerpTime+=e;let R=this._tx.pos.x,W=this._tx.pos.y;if(this._currentLerpTime<this._lerpDuration){R=this._lerpEnd.x<this._lerpStart.x?this._lerpStart.x-(this.easingFcn(this._currentLerpTime,this._lerpEnd.x,this._lerpStart.x,this._lerpDuration)-this._lerpEnd.x):this.easingFcn(this._currentLerpTime,this._lerpStart.x,this._lerpEnd.x,this._lerpDuration),W=this._lerpEnd.y<this._lerpStart.y?this._lerpStart.y-(this.easingFcn(this._currentLerpTime,this._lerpEnd.y,this._lerpStart.y,this._lerpDuration)-this._lerpEnd.y):this.easingFcn(this._currentLerpTime,this._lerpStart.y,this._lerpEnd.y,this._lerpDuration);let Y=e/1e3;this._motion.vel=vec(Y===0?0:(R-this._tx.pos.x)/Y,Y===0?0:(W-this._tx.pos.y)/Y)}else this._tx.pos=vec(this._lerpEnd.x,this._lerpEnd.y),this._motion.vel=Oe.Zero}isComplete(){return this._stopped||this._currentLerpTime>=this._lerpDuration}reset(){this._initialized=!1,this._stopped=!1,this._currentLerpTime=0}stop(){this._motion.vel=vec(0,0),this._stopped=!0}},EaseBy=class{constructor(e,R,W,Y,X){this.easingFcn=X,this.id=nextActionId(),this._currentLerpTime=0,this._lerpDuration=1*1e3,this._lerpStart=new Oe(0,0),this._lerpEnd=new Oe(0,0),this._initialized=!1,this._stopped=!1,this._tx=e.get(Xe),this._motion=e.get(MotionComponent),this._lerpDuration=Y,this._offset=new Oe(R,W)}_initialize(){this._lerpStart=new Oe(this._tx.pos.x,this._tx.pos.y),this._currentLerpTime=0,this._lerpEnd=this._lerpStart.add(this._offset)}update(e){this._initialized||=(this._initialize(),!0),this._currentLerpTime+=e;let R=this._tx.pos.x,W=this._tx.pos.y;if(this._currentLerpTime<this._lerpDuration){R=this._lerpEnd.x<this._lerpStart.x?this._lerpStart.x-(this.easingFcn(this._currentLerpTime,this._lerpEnd.x,this._lerpStart.x,this._lerpDuration)-this._lerpEnd.x):this.easingFcn(this._currentLerpTime,this._lerpStart.x,this._lerpEnd.x,this._lerpDuration),W=this._lerpEnd.y<this._lerpStart.y?this._lerpStart.y-(this.easingFcn(this._currentLerpTime,this._lerpEnd.y,this._lerpStart.y,this._lerpDuration)-this._lerpEnd.y):this.easingFcn(this._currentLerpTime,this._lerpStart.y,this._lerpEnd.y,this._lerpDuration);let Y=e/1e3;this._motion.vel=vec(Y===0?0:(R-this._tx.pos.x)/Y,Y===0?0:(W-this._tx.pos.y)/Y)}else this._tx.pos=vec(this._lerpEnd.x,this._lerpEnd.y),this._motion.vel=Oe.Zero}isComplete(){return this._stopped||this._currentLerpTime>=this._lerpDuration}reset(){this._initialized=!1,this._stopped=!1,this._currentLerpTime=0}stop(){this._motion.vel=vec(0,0),this._stopped=!0}},Blink=class{constructor(e,R,W,Y=1){this.id=nextActionId(),this._timeVisible=0,this._timeNotVisible=0,this._elapsedTime=0,this._totalTime=0,this._stopped=!1,this._started=!1,this._graphics=e.get(fi),this._timeVisible=R,this._timeNotVisible=W,this._duration=(R+W)*Y}update(e){this._started||(this._started=!0,this._elapsedTime=0,this._totalTime=0),this._graphics&&(this._elapsedTime+=e,this._totalTime+=e,this._graphics.isVisible&&this._elapsedTime>=this._timeVisible&&(this._graphics.isVisible=!1,this._elapsedTime=0),!this._graphics.isVisible&&this._elapsedTime>=this._timeNotVisible&&(this._graphics.isVisible=!0,this._elapsedTime=0),this.isComplete()&&(this._graphics.isVisible=!0))}isComplete(){return this._stopped||this._totalTime>=this._duration}stop(){this._graphics&&(this._graphics.isVisible=!0),this._stopped=!0}reset(){this._started=!1,this._stopped=!1,this._elapsedTime=0,this._totalTime=0}},Fade=class{constructor(e,R,W){this.id=nextActionId(),this._multiplier=1,this._started=!1,this._stopped=!1,this._graphics=e.get(fi),this._endOpacity=R,this._remainingTime=this._originalTime=W}update(e){this._graphics&&(this._started||(this._started=!0,this._remainingTime=this._originalTime,this._endOpacity<this._graphics.opacity?this._multiplier=-1:this._multiplier=1),this._remainingTime>0&&(this._graphics.opacity+=this._multiplier*(Math.abs(this._graphics.opacity-this._endOpacity)*e)/this._remainingTime),this._remainingTime-=e,this.isComplete()&&(this._graphics.opacity=this._endOpacity),Je.getInstance().debug(`[Action fade] Actor opacity:`,this._graphics.opacity))}isComplete(){return this._stopped||this._remainingTime<=0}stop(){this._stopped=!0}reset(){this._started=!1,this._stopped=!1,this._remainingTime=this._originalTime}},Delay=class{constructor(e){this.id=nextActionId(),this._elapsedTime=0,this._started=!1,this._stopped=!1,this._delay=e}update(e){this._started||=!0,this._elapsedTime+=e}isComplete(){return this._stopped||this._elapsedTime>=this._delay}stop(){this._stopped=!0}reset(){this._elapsedTime=0,this._started=!1,this._stopped=!1}},Die=class{constructor(e){this.id=nextActionId(),this._stopped=!1,this._entity=e}update(e){this._entity.get(ActionsComponent).clearActions(),this._entity.kill(),this._stopped=!0}isComplete(){return this._stopped}stop(){}reset(){}},Follow=class{constructor(e,R,W){this.id=nextActionId(),this._started=!1,this._stopped=!1,this._tx=e.get(Xe),this._motion=e.get(MotionComponent),this._followTx=R.get(Xe),this._followMotion=R.get(MotionComponent),this._current=new Oe(this._tx.pos.x,this._tx.pos.y),this._end=new Oe(this._followTx.pos.x,this._followTx.pos.y),this._maximumDistance=W===void 0?this._current.distance(this._end):W,this._speed=0}update(e){this._started||(this._started=!0,this._distanceBetween=this._current.distance(this._end),this._dir=this._end.sub(this._current).normalize());let R=Math.sqrt(this._followMotion.vel.x**2+this._followMotion.vel.y**2);if(R!==0&&(this._speed=R),this._current=vec(this._tx.pos.x,this._tx.pos.y),this._end=vec(this._followTx.pos.x,this._followTx.pos.y),this._distanceBetween=this._current.distance(this._end),this._dir=this._end.sub(this._current).normalize(),this._distanceBetween>=this._maximumDistance){let e=this._dir.scale(this._speed);this._motion.vel=vec(e.x,e.y)}else this._motion.vel=vec(0,0);this.isComplete()&&(this._tx.pos=vec(this._end.x,this._end.y),this._motion.vel=vec(0,0))}stop(){this._motion.vel=vec(0,0),this._stopped=!0}isComplete(){return this._stopped}reset(){this._started=!1,this._stopped=!1}},Meet=class{constructor(e,R,W,Y){this.id=nextActionId(),this._started=!1,this._stopped=!1,this._speedWasSpecified=!1,this._tolerance=1,this._tx=e.get(Xe),this._motion=e.get(MotionComponent),this._meetTx=R.get(Xe),this._meetMotion=R.get(MotionComponent),this._current=new Oe(this._tx.pos.x,this._tx.pos.y),this._end=new Oe(this._meetTx.pos.x,this._meetTx.pos.y),this._speed=W||0,W!==void 0&&(this._speedWasSpecified=!0),Y!==void 0&&(this._tolerance=Y)}update(e){this._started||(this._started=!0,this._distanceBetween=this._current.distance(this._end),this._dir=this._end.sub(this._current).normalize());let R=Math.sqrt(this._meetMotion.vel.x**2+this._meetMotion.vel.y**2);R!==0&&!this._speedWasSpecified&&(this._speed=R),this._current=vec(this._tx.pos.x,this._tx.pos.y),this._end=vec(this._meetTx.pos.x,this._meetTx.pos.y),this._distanceBetween=this._current.distance(this._end),this._dir=this._end.sub(this._current).normalize();let W=this._dir.scale(this._speed);this._motion.vel=vec(W.x,W.y),this.isComplete()&&(this._tx.pos=vec(this._end.x,this._end.y),this._motion.vel=vec(0,0))}isComplete(){return this._stopped||this._distanceBetween<=this._tolerance}stop(){this._motion.vel=vec(0,0),this._stopped=!0}reset(){this._started=!1,this._stopped=!1,this._distanceBetween=1/0}},Flash=class{constructor(e,R,W=1e3){this.id=nextActionId(),this._stopped=!1,this._started=!1,this._total=0,this._currentDuration=0,this._graphics=e.get(fi),this._duration=W,this._entity=e,this._material=e.scene?.engine.graphicsContext.createMaterial({name:`flash-material`,color:R,fragmentSource:`#version 300 es
|
|
891
|
+
`);if(R==null)return W;for(let e=0;e<W.length;e++){let Y=W[e],X=``;if(this.measureText(Y).width>R){for(;this.measureText(Y).width>R;)X=Y[Y.length-1]+X,Y=Y.slice(0,-1);W[e]=Y,W[e+1]=X}}return this._cachedText=e,this._cachedLines=W,this._cachedRenderWidth=R,W}},si=class Font extends Rt{constructor(e={}){super(e),this.filtering=Yt.Blended,this.quality=2,this.padding=2,this.smoothing=!1,this.lineWidth=1,this.lineDash=[],this.color=We.Black,this.family=`sans-serif`,this.style=qt.Normal,this.bold=!1,this.unit=Wt.Px,this.textAlign=Gt.Left,this.baseAlign=Kt.Top,this.direction=Jt.LeftToRight,this.lineHeight=void 0,this.size=10,this._textBounds=new lt,this.smoothing=e?.smoothing??this.smoothing,this.padding=e?.padding??this.padding,this.color=e?.color??this.color,this.strokeColor=e?.strokeColor??this.strokeColor,this.lineDash=e?.lineDash??this.lineDash,this.lineWidth=e?.lineWidth??this.lineWidth,this.filtering=e?.filtering??this.filtering,this.family=e?.family??this.family,this.style=e?.style??this.style,this.bold=e?.bold??this.bold,this.size=e?.size??this.size,this.unit=e?.unit??this.unit,this.textAlign=e?.textAlign??this.textAlign,this.baseAlign=e?.baseAlign??this.baseAlign,this.direction=e?.direction??this.direction,this.lineHeight=e?.lineHeight??this.lineHeight,this.quality=e?.quality??this.quality,e?.shadow&&(this.shadow={},this.shadow.blur=e.shadow.blur??this.shadow.blur,this.shadow.offset=e.shadow.offset??this.shadow.offset,this.shadow.color=e.shadow.color??this.shadow.color),this._textMeasurement=new ii(this,``,We.Black)}clone(){return new Font({...this.cloneGraphicOptions(),size:this.size,unit:this.unit,family:this.family,style:this.style,bold:this.bold,textAlign:this.textAlign,baseAlign:this.baseAlign,direction:this.direction,shadow:this.shadow?{blur:this.shadow.blur,offset:this.shadow.offset,color:this.shadow.color}:void 0})}get fontString(){return`${this.style} ${this.bold?`bold`:``} ${this.size}${this.unit} ${this.family}`}get localBounds(){return this._textBounds}_drawImage(e,R,W){}_rotate(e){let R=this.origin??this._textBounds.center;e.translate(R.x,R.y),e.rotate(this.rotation),e.translate(-R.x,-R.y)}_flip(e){this.flipHorizontal&&(e.translate(this._textBounds.width/this.scale.x,0),e.scale(-1,1)),this.flipVertical&&(e.translate(0,-this._textBounds.height/2/this.scale.y),e.scale(1,-1))}measureTextWithoutCache(e,R){return this._textMeasurement.measureText(e,R)}measureText(e,R){return gr.measureText(e,this,R)}_postDraw(e){e.restore()}render(e,R,W,Y,X,ie){let ae=gr.getTextInstance(R,this,W);this._textBounds=ae.dimensions,this._preDraw(e,Y,X),ae.render(e,Y,X,ie),this._postDraw(e)}},ci=class Text extends Rt{constructor(e){super(e),this._text=``,this._textWidth=0,this._textHeight=0,this.font=e.font??new si,this.color=e.color??this.color,this.text=e.text,this.maxWidth=e.maxWidth}clone(){return new Text({text:this.text.slice(),color:this.color?.clone()??We.Black,font:this.font.clone(),maxWidth:this.maxWidth})}get text(){return this._text}set text(e){this._text=e,this._calculateDimension()}get font(){return this._font}set font(e){this._font=e}get width(){return this._textWidth===0&&this._calculateDimension(),this._textWidth*this.scale.x}get height(){return this._textHeight===0&&this._calculateDimension(),this._textHeight*this.scale.y}_calculateDimension(){let{width:e,height:R}=this.font.measureText(this._text,this.maxWidth);this._textWidth=e,this._textHeight=R}get localBounds(){return this.font.measureText(this._text,this.maxWidth).scale(this.scale)}_rotate(e){}_flip(e){}_preDraw(e,R,W){(this.isStale()||this.font.isStale())&&(this.font.flipHorizontal=this.flipHorizontal,this.font.flipVertical=this.flipVertical,this.font.rotation=this.rotation,this.font.origin=this.origin,this.font.opacity=this.opacity),this.font.tint=this.tint,super._preDraw(e,R,W)}_drawImage(e,R,W){let Y=We.Black;this.font instanceof si&&(Y=this.color??this.font.color);let{width:X,height:ie}=this.font.measureText(this._text,this.maxWidth);this._textWidth=X,this._textHeight=ie,this.font.render(e,this._text,Y,R,W,this.maxWidth),this.font.showDebug&&(e.debug.drawRect(R-X,W-ie,X*2,ie*2),this.maxWidth!=null&&e.debug.drawRect(R,W,this.maxWidth,this.height,{color:We.Yellow}))}};function hasGraphicsTick(e){return!!e.tick}var fi=class GraphicsComponent extends Component{constructor(e){super(),this._logger=Je.getInstance(),this._current=`default`,this._graphics={},this._options={},this.material=null,this.isVisible=!0,this.forceOnScreen=!1,this.opacity=1,this._offset=new WatchVector(Oe.Zero,()=>this.recalculateBounds()),this._anchor=new WatchVector(Oe.Half,()=>this.recalculateBounds()),this.flipHorizontal=!1,this.flipVertical=!1,this.copyGraphics=!1,e={visible:this.isVisible,graphics:{},...e};let{current:R,anchor:W,color:Y,opacity:X,visible:ie,graphics:ae,offset:le,copyGraphics:_e,onPreDraw:ye,onPostDraw:be,onPreTransformDraw:Ce,onPostTransformDraw:Te}=e;for(let[e,R]of Object.entries(ae))R instanceof Rt?this._graphics[e]=R:(this._graphics[e]=R.graphic,this._options[e]=R.options);this.offset=le??this.offset,this.opacity=X??this.opacity,this.anchor=W??this.anchor,this.color=Y??this.color,this.copyGraphics=_e??this.copyGraphics,this.onPreDraw=ye??this.onPreDraw,this.onPostDraw=be??this.onPostDraw,this.onPreDraw=Ce??this.onPreTransformDraw,this.onPostTransformDraw=Te??this.onPostTransformDraw,this.isVisible=!!ie,this._current=R??this._current,R&&this._graphics[R]&&this.use(R)}get visible(){return this.isVisible}set visible(e){this.isVisible=e}get offset(){return this._offset}set offset(e){this._offset=new WatchVector(e,()=>this.recalculateBounds()),this.recalculateBounds()}get anchor(){return this._anchor}set anchor(e){this._anchor=new WatchVector(e,()=>this.recalculateBounds()),this.recalculateBounds()}get color(){return this._color}set color(e){if(e){this._color=e.clone();let R=this.current;(R instanceof Raster||R instanceof ci)&&(R.color=this._color)}}getGraphic(e){return this._graphics[e]}getOptions(e){return this._options[e]}getNames(){return Object.keys(this._graphics)}get current(){return this._graphics[this._current]}get currentOptions(){return this._options[this._current]}get graphics(){return this._graphics}get options(){return this._options}add(e,R,W){let Y=`default`,X=null,ie;if(typeof e==`string`&&R instanceof Rt&&(Y=e,X=R,ie=W),e instanceof Rt&&!(R instanceof Rt)&&(X=e,ie=R),!X)throw Error(`Need to provide a graphic or valid graphic string`);return this._graphics[Y]=this.copyGraphics?X.clone():X,this._options[Y]=this.copyGraphics?{...ie}:ie,Y==="default"&&this.use(`default`),X}remove(e){delete this._graphics[e],delete this._options[e],this._current===e&&(this._current=`default`,this.recalculateBounds())}use(e,R){if(e instanceof Rt){let W=e;this.copyGraphics&&(W=e.clone()),this._current=`default`,this._graphics[this._current]=W,this._options[this._current]=R}else this._current=e,this._options[this._current]=R,this._current in this._graphics||this._logger.warn(`Graphic ${this._current} is not registered with the graphics component owned by ${this.owner?.name}. Nothing will be drawn.`);return this.recalculateBounds(),this.current}hide(){this._current=`ex.none`}set localBounds(e){this._localBounds=e}recalculateBounds(){let e=new lt,R=this._graphics[this._current],W=this._options[this._current];if(!R){this._localBounds=e;return}let Y=this.anchor,X=this.offset;W?.anchor&&(Y=W.anchor),W?.offset&&(X=W.offset);let ie=R.localBounds,ae=-ie.width*Y.x+X.x,le=-ie.height*Y.y+X.y;e=R instanceof Ut&&!R.useAnchor?R?.localBounds.combine(e):R?.localBounds.translate(vec(ae,le)).combine(e),this._localBounds=e}get localBounds(){return(!this._localBounds||this._localBounds.hasZeroDimensions())&&this.recalculateBounds(),this._localBounds}get bounds(){let e=this.localBounds;if(this.owner){let R=this.owner.get(Xe);R&&(e=e.transform(R.get().matrix))}return e}update(e,R=0){let W=this.current;W&&hasGraphicsTick(W)&&W.tick(e,R)}clone(){let e=new GraphicsComponent;return e._graphics={...this._graphics},e._options={...this._options},e.offset=this.offset.clone(),this.color&&(e.color=this.color.clone()),e.opacity=this.opacity,e.anchor=this.anchor.clone(),e.copyGraphics=this.copyGraphics,e.onPreDraw=this.onPreDraw,e.onPostDraw=this.onPostDraw,e.isVisible=this.isVisible,e}},PointerComponent=class extends Component{constructor(e){super(),this.useColliderShape=!0,this.useGraphicsBounds=!0,this.useColliderShape=e?.useColliderShape??this.useColliderShape,this.useGraphicsBounds=e?.useGraphicsBounds??this.useGraphicsBounds,this.localBounds=e?.localBounds}};function isLegacyEasing(e){return!!e&&e.length===4}const pi=class _EasingFunctions2{static CreateReversibleEasingFunction(e){return(R,W,Y,X)=>Y<W?W-(e(R,Y,W,X)-Y):e(R,W,Y,X)}static CreateVectorEasingFunction(e){return(R,W,Y,X)=>new Oe(e(R,W.x,Y.x,X),e(R,W.y,Y.y,X))}};pi.Linear=pi.CreateReversibleEasingFunction((e,R,W,Y)=>(W-=R,W*e/Y+R)),pi.EaseInQuad=pi.CreateReversibleEasingFunction((e,R,W,Y)=>(W-=R,e/=Y,W*e*e+R)),pi.EaseOutQuad=pi.CreateReversibleEasingFunction((e,R,W,Y)=>(W-=R,e/=Y,-W*e*(e-2)+R)),pi.EaseInOutQuad=pi.CreateReversibleEasingFunction((e,R,W,Y)=>(W-=R,e/=Y/2,e<1?W/2*e*e+R:(e--,-W/2*(e*(e-2)-1)+R))),pi.EaseInCubic=pi.CreateReversibleEasingFunction((e,R,W,Y)=>(W-=R,e/=Y,W*e*e*e+R)),pi.EaseOutCubic=pi.CreateReversibleEasingFunction((e,R,W,Y)=>(W-=R,e/=Y,e--,W*(e*e*e+1)+R)),pi.EaseInOutCubic=pi.CreateReversibleEasingFunction((e,R,W,Y)=>(W-=R,e/=Y/2,e<1?W/2*e*e*e+R:(e-=2,W/2*(e*e*e+2)+R)));let mi=pi;var ActionQueue=class{constructor(e){this._actions=[],this._currentAction=null,this._completedActions=[],this._entity=e}add(e){this._actions.push(e)}remove(e){let R=this._actions.indexOf(e);this._actions.splice(R,1)}clearActions(){this._actions.length=0,this._completedActions.length=0,this._currentAction&&this._currentAction.stop()}getActions(){return this._actions.concat(this._completedActions)}getIncompleteActions(){return this._actions}getCurrentAction(){return this._currentAction}hasNext(){return this._actions.length>0}isComplete(){return this._actions.length===0}reset(){this._actions=this.getActions();let e=this._actions.length;for(let R=0;R<e;R++)this._actions[R].reset();this._completedActions=[]}update(e){if(this._actions.length>0&&(this._currentAction!==this._actions[0]&&(this._currentAction=this._actions[0],this._entity.emit(`actionstart`,new ActionStartEvent(this._currentAction,this._entity))),this._currentAction.update(e),this._currentAction.isComplete(this._entity))){this._entity.emit(`actioncomplete`,new ActionCompleteEvent(this._currentAction,this._entity));let e=this._actions.shift();e&&this._completedActions.push(e)}}};let hi=0;function nextActionId(){return hi++}var Repeat=class{constructor(e,R,W){this.id=nextActionId(),this._stopped=!1,this._repeatBuilder=R,this._repeatContext=new ActionContext(e),this._actionQueue=this._repeatContext.getQueue(),this._repeat=W,this._originalRepeat=W,this._repeatBuilder(this._repeatContext),this._repeat--}update(e){this._actionQueue.isComplete()&&(this._actionQueue.clearActions(),this._repeatBuilder(this._repeatContext),this._repeat--),this._actionQueue.update(e)}isComplete(){return this._stopped||this._repeat<=0&&this._actionQueue.isComplete()}stop(){this._stopped=!0}reset(){this._repeat=this._originalRepeat}},RepeatForever=class{constructor(e,R){this.id=nextActionId(),this._stopped=!1,this._repeatBuilder=R,this._repeatContext=new ActionContext(e),this._actionQueue=this._repeatContext.getQueue(),this._repeatBuilder(this._repeatContext)}update(e){this._stopped||(this._actionQueue.isComplete()&&(this._actionQueue.clearActions(),this._repeatBuilder(this._repeatContext)),this._actionQueue.update(e))}isComplete(){return this._stopped}stop(){this._stopped=!0,this._actionQueue.clearActions()}reset(){}};function isMoveByOptions(e){return e.offset instanceof Oe&&typeof e.duration==`number`}var MoveByWithOptions=class{constructor(e,R){if(this.entity=e,this.id=nextActionId(),this._started=!1,this._stopped=!1,this._legacyEasing=mi.Linear,this._easing=linear,this._useLegacyEasing=!1,this._offset=R.offset,this._easing=R.easing??this._easing,isLegacyEasing(R.easing)&&(this._legacyEasing=R.easing,this._useLegacyEasing=!0),this._tx=e.get(Xe),this._motion=e.get(MotionComponent),!this._tx)throw Error(`Entity ${e.name} has no TransformComponent, can only MoveBy on Entities with TransformComponents.`);this._durationMs=R.duration,this._currentMs=this._durationMs}update(e){this._started||=(this._start=this._tx.pos.clone(),this._end=this._start.add(this._offset),!0),this._currentMs-=e;let R=clamp(remap(0,this._durationMs,0,1,this._durationMs-this._currentMs),0,1),W=this._tx.pos,Y=0,X=0;this._useLegacyEasing?(Y=this._legacyEasing(R,this._start.x,this._end.x,1),X=this._legacyEasing(R,this._start.y,this._end.y,1)):(Y=lerp(this._start.x,this._end.x,this._easing(R)),X=lerp(this._start.y,this._end.y,this._easing(R)));let ie=e/1e3,ae=ie===0?0:(Y-W.x)/ie,le=ie===0?0:(X-W.y)/ie;this._motion.vel.x=ae,this._motion.vel.y=le,this.isComplete(this.entity)&&(this._tx.pos=vec(this._end.x,this._end.y),this._motion.vel=vec(0,0))}isComplete(e){return this._stopped||this._currentMs<0}stop(){this._motion.vel=vec(0,0),this._stopped=!0,this._currentMs=0}reset(){this._currentMs=this._durationMs,this._started=!1,this._stopped=!1}},MoveBy=class{constructor(e,R,W,Y){if(this.id=nextActionId(),this._started=!1,this._stopped=!1,this._entity=e,this._tx=e.get(Xe),this._motion=e.get(MotionComponent),this._speed=Y,this._offset=new Oe(R,W),Y<=0)throw Je.getInstance().error(`Attempted to moveBy with speed less than or equal to zero : `+Y),Error(`Speed must be greater than 0 pixels per second`)}update(e){this._started||(this._started=!0,this._start=new Oe(this._tx.pos.x,this._tx.pos.y),this._end=this._start.add(this._offset),this._distance=this._offset.magnitude,this._dir=this._end.sub(this._start).normalize()),this.isComplete(this._entity)?(this._tx.pos=vec(this._end.x,this._end.y),this._motion.vel=vec(0,0)):this._motion.vel=this._dir.scale(this._speed)}isComplete(e){let R=e.get(Xe);return this._stopped||R.pos.distance(this._start)>=this._distance}stop(){this._motion.vel=vec(0,0),this._stopped=!0}reset(){this._started=!1,this._stopped=!1}};function isMoveToOptions(e){return e.pos instanceof Oe&&typeof e.duration==`number`}var MoveToWithOptions=class{constructor(e,R){if(this.entity=e,this.id=nextActionId(),this._started=!1,this._stopped=!1,this._easing=linear,this._legacyEasing=mi.Linear,this._useLegacyEasing=!1,this._end=R.pos,this._easing=R.easing??this._easing,isLegacyEasing(R.easing)&&(this._legacyEasing=R.easing,this._useLegacyEasing=!0),this._tx=e.get(Xe),this._motion=e.get(MotionComponent),!this._tx)throw Error(`Entity ${e.name} has no TransformComponent, can only moveTo on Entities with TransformComponents.`);this._durationMs=R.duration,this._currentMs=this._durationMs}update(e){this._started||=(this._start=this._tx.pos.clone(),!0),this._currentMs-=e;let R=clamp(remap(0,this._durationMs,0,1,this._durationMs-this._currentMs),0,1),W=this._tx.pos,Y=0,X=0;this._useLegacyEasing?(Y=this._legacyEasing(R,this._start.x,this._end.x,1),X=this._legacyEasing(R,this._start.y,this._end.y,1)):(Y=lerp(this._start.x,this._end.x,this._easing(R)),X=lerp(this._start.y,this._end.y,this._easing(R)));let ie=e/1e3,ae=ie===0?0:(Y-W.x)/ie,le=ie===0?0:(X-W.y)/ie;this._motion.vel.x=ae,this._motion.vel.y=le,this.isComplete(this.entity)&&(this._tx.pos=vec(this._end.x,this._end.y),this._motion.vel=vec(0,0))}isComplete(e){return this._stopped||this._currentMs<0}stop(){this._motion.vel=vec(0,0),this._stopped=!0,this._currentMs=0}reset(){this._currentMs=this._durationMs,this._started=!1,this._stopped=!1}},MoveTo=class{constructor(e,R,W,Y){this.entity=e,this.id=nextActionId(),this._started=!1,this._stopped=!1,this._tx=e.get(Xe),this._motion=e.get(MotionComponent),this._end=new Oe(R,W),this._speed=Y}update(e){this._started||(this._started=!0,this._start=new Oe(this._tx.pos.x,this._tx.pos.y),this._distance=this._start.distance(this._end),this._dir=this._end.sub(this._start).normalize());let R=this._dir.scale(this._speed);this._motion.vel=vec(R.x,R.y),this.isComplete(this.entity)&&(this._tx.pos=vec(this._end.x,this._end.y),this._motion.vel=vec(0,0))}isComplete(e){let R=e.get(Xe);return this._stopped||new Oe(R.pos.x,R.pos.y).distance(this._start)>=this._distance}stop(){this._motion.vel=vec(0,0),this._stopped=!0}reset(){this._started=!1,this._stopped=!1}},RotateToWithOptions=class{constructor(e,R){if(this.entity=e,this.id=nextActionId(),this._started=!1,this._stopped=!1,this._endAngle=0,this._startAngle=0,this._endAngle=R.angle,this._tx=e.get(Xe),this._motion=e.get(MotionComponent),!this._tx)throw Error(`Entity ${e.name} has no TransformComponent, can only RotateTo on Entities with TransformComponents.`);this._durationMs=R.duration,this._rotationType=R.rotationType??le.ShortestPath,this._currentMs=this._durationMs}update(e){this._started||=(this._startAngle=this._tx.rotation,!0),this._currentMs-=e;let R=clamp(remap(0,this._durationMs,0,1,this._durationMs-this._currentMs),0,1),W=lerpAngle(this._startAngle,this._endAngle,this._rotationType,R),Y=this._tx.rotation,X=e/1e3,ie=X===0?0:(W-Y)/X;this._motion.angularVelocity=ie,this.isComplete(this.entity)&&(this._tx.rotation=this._endAngle,this._motion.angularVelocity=0)}isComplete(e){return this._stopped||this._currentMs<0}stop(){this._motion.angularVelocity=0,this._stopped=!0,this._currentMs=0}reset(){this._currentMs=this._durationMs,this._started=!1,this._stopped=!1}},RotateTo=class{constructor(e,R,W,Y){this.id=nextActionId(),this._started=!1,this._stopped=!1,this._tx=e.get(Xe),this._motion=e.get(MotionComponent),this._end=R,this._speed=W,this._rotationType=Y||le.ShortestPath}update(e){if(!this._started){this._started=!0,this._start=this._tx.rotation,this._currentNonCannonAngle=this._tx.rotation;let e=Math.abs(this._end-this._start),R=Ce-e;switch(e>R?(this._shortDistance=R,this._longDistance=e):(this._shortDistance=e,this._longDistance=R),this._shortestPathIsPositive=(this._start-this._end+Ce)%Ce>=Math.PI,this._rotationType){case le.ShortestPath:this._distance=this._shortDistance,this._shortestPathIsPositive?this._direction=1:this._direction=-1;break;case le.LongestPath:this._distance=this._longDistance,this._shortestPathIsPositive?this._direction=-1:this._direction=1;break;case le.Clockwise:this._direction=1,this._shortestPathIsPositive?this._distance=this._shortDistance:this._distance=this._longDistance;break;case le.CounterClockwise:this._direction=-1,this._shortestPathIsPositive?this._distance=this._longDistance:this._distance=this._shortDistance;break}}this._motion.angularVelocity=this._direction*this._speed,this._currentNonCannonAngle+=this._direction*this._speed*(e/1e3),this.isComplete()&&(this._tx.rotation=this._end,this._motion.angularVelocity=0,this._stopped=!0)}isComplete(){let e=Math.abs(this._currentNonCannonAngle-this._start);return this._stopped||e>=Math.abs(this._distance)}stop(){this._motion.angularVelocity=0,this._stopped=!0}reset(){this._started=!1,this._stopped=!1}},RotateByWithOptions=class{constructor(e,R){if(this.entity=e,this.id=nextActionId(),this._started=!1,this._stopped=!1,this._offset=0,this._startAngle=0,this._endAngle=0,this._offset=R.angleRadiansOffset,this._tx=e.get(Xe),this._motion=e.get(MotionComponent),!this._tx)throw Error(`Entity ${e.name} has no TransformComponent, can only RotateBy on Entities with TransformComponents.`);this._durationMs=R.duration,this._rotationType=R.rotationType??le.ShortestPath,this._currentMs=this._durationMs}update(e){this._started||=(this._startAngle=this._tx.rotation,this._endAngle=canonicalizeAngle(this._startAngle+this._offset),!0),this._currentMs-=e;let R=clamp(remap(0,this._durationMs,0,1,this._durationMs-this._currentMs),0,1),W=lerpAngle(this._startAngle,this._endAngle,this._rotationType,R),Y=this._tx.rotation,X=e/1e3,ie=X===0?0:(W-Y)/X;this._motion.angularVelocity=ie,this.isComplete()&&(this._tx.rotation=this._endAngle,this._motion.angularVelocity=0)}isComplete(){return this._stopped||this._currentMs<0}stop(){this._motion.angularVelocity=0,this._stopped=!0,this._currentMs=0}reset(){this._currentMs=this._durationMs,this._started=!1,this._stopped=!1}},RotateBy=class{constructor(e,R,W,Y){this.id=nextActionId(),this._started=!1,this._stopped=!1,this._tx=e.get(Xe),this._motion=e.get(MotionComponent),this._speed=W,this._offset=R,this._rotationType=Y||le.ShortestPath}update(e){if(!this._started){this._started=!0,this._start=this._tx.rotation,this._currentNonCannonAngle=this._tx.rotation,this._end=this._start+this._offset;let e=Math.abs(this._end-this._start),R=Ce-e;switch(e>R?(this._shortDistance=R,this._longDistance=e):(this._shortDistance=e,this._longDistance=R),this._shortestPathIsPositive=(this._start-this._end+Ce)%Ce>=Math.PI,this._rotationType){case le.ShortestPath:this._distance=this._shortDistance,this._shortestPathIsPositive?this._direction=1:this._direction=-1;break;case le.LongestPath:this._distance=this._longDistance,this._shortestPathIsPositive?this._direction=-1:this._direction=1;break;case le.Clockwise:this._direction=1,this._shortDistance>=0?this._distance=this._shortDistance:this._distance=this._longDistance;break;case le.CounterClockwise:this._direction=-1,this._shortDistance<=0?this._distance=this._shortDistance:this._distance=this._longDistance;break}}this._motion.angularVelocity=this._direction*this._speed,this._currentNonCannonAngle+=this._direction*this._speed*(e/1e3),this.isComplete()&&(this._tx.rotation=this._end,this._motion.angularVelocity=0,this._stopped=!0)}isComplete(){let e=Math.abs(this._currentNonCannonAngle-this._start);return this._stopped||e>=Math.abs(this._distance)}stop(){this._motion.angularVelocity=0,this._stopped=!0}reset(){this._started=!1,this._stopped=!1,this._start=void 0,this._currentNonCannonAngle=void 0,this._distance=void 0}};function isScaleToOptions(e){return typeof e.scale==`object`&&typeof e.duration==`number`}var ScaleToWithOptions=class{constructor(e,R){if(this.entity=e,this.id=nextActionId(),this._started=!1,this._stopped=!1,this._endScale=vec(1,1),this._startScale=vec(1,1),this._endScale=R.scale,this._tx=e.get(Xe),this._motion=e.get(MotionComponent),!this._tx)throw Error(`Entity ${e.name} has no TransformComponent, can only ScaleTo on Entities with TransformComponents.`);this._durationMs=R.duration,this._currentMs=this._durationMs}update(e){this._started||=(this._startScale=this._tx.scale,!0),this._currentMs-=e;let R=clamp(remap(0,this._durationMs,0,1,this._durationMs-this._currentMs),0,1),W=lerpVector(this._startScale,this._endScale,R),Y=this._tx.scale,X=e/1e3,ie=W.sub(Y).scale(X===0?0:1/X);this._motion.scaleFactor=ie,this.isComplete()&&(this._tx.scale=this._endScale,this._motion.angularVelocity=0)}isComplete(){return this._stopped||this._currentMs<0}stop(){this._motion.scaleFactor=Oe.Zero,this._stopped=!0,this._currentMs=0}reset(){this._currentMs=this._durationMs,this._started=!1,this._stopped=!1}},ScaleTo=class{constructor(e,R,W,Y,X){this.id=nextActionId(),this._started=!1,this._stopped=!1,this._tx=e.get(Xe),this._motion=e.get(MotionComponent),this._endX=R,this._endY=W,this._speedX=Y,this._speedY=X}update(e){if(this._started||(this._started=!0,this._startX=this._tx.scale.x,this._startY=this._tx.scale.y,this._distanceX=Math.abs(this._endX-this._startX),this._distanceY=Math.abs(this._endY-this._startY)),Math.abs(this._tx.scale.x-this._startX)>=this._distanceX)this._motion.scaleFactor.x=0;else{let e=this._endY<this._startY?-1:1;this._motion.scaleFactor.x=this._speedX*e}if(Math.abs(this._tx.scale.y-this._startY)>=this._distanceY)this._motion.scaleFactor.y=0;else{let e=this._endY<this._startY?-1:1;this._motion.scaleFactor.y=this._speedY*e}this.isComplete()&&(this._tx.scale=vec(this._endX,this._endY),this._motion.scaleFactor.x=0,this._motion.scaleFactor.y=0)}isComplete(){return this._stopped||Math.abs(this._tx.scale.x-this._startX)>=this._distanceX-.01&&Math.abs(this._tx.scale.y-this._startY)>=this._distanceY-.01}stop(){this._motion.scaleFactor.x=0,this._motion.scaleFactor.y=0,this._stopped=!0}reset(){this._started=!1,this._stopped=!1}};function isScaleByOptions(e){return typeof e.scaleOffset==`object`&&typeof e.duration==`number`}var ScaleByWithOptions=class{constructor(e,R){if(this.entity=e,this.id=nextActionId(),this._started=!1,this._stopped=!1,this._endScale=vec(1,1),this._scaleOffset=vec(0,0),this._startScale=vec(1,1),this._scaleOffset=R.scaleOffset,this._tx=e.get(Xe),this._motion=e.get(MotionComponent),!this._tx)throw Error(`Entity ${e.name} has no TransformComponent, can only ScaleBy on Entities with TransformComponents.`);this._durationMs=R.duration,this._currentMs=this._durationMs}update(e){this._started||=(this._startScale=this._tx.scale,this._endScale=this._startScale.add(this._scaleOffset),!0),this._currentMs-=e;let R=clamp(remap(0,this._durationMs,0,1,this._durationMs-this._currentMs),0,1),W=lerpVector(this._startScale,this._endScale,R),Y=this._tx.scale,X=e/1e3,ie=W.sub(Y).scale(X===0?0:1/X);this._motion.scaleFactor=ie,this.isComplete()&&(this._tx.scale=this._endScale,this._motion.angularVelocity=0)}isComplete(){return this._stopped||this._currentMs<0}stop(){this._motion.scaleFactor=Oe.Zero,this._stopped=!0,this._currentMs=0}reset(){this._currentMs=this._durationMs,this._started=!1,this._stopped=!1}},ScaleBy=class{constructor(e,R,W,Y){this.id=nextActionId(),this._started=!1,this._stopped=!1,this._tx=e.get(Xe),this._motion=e.get(MotionComponent),this._offset=new Oe(R,W),this._speedX=this._speedY=Y}update(e){this._started||(this._started=!0,this._startScale=this._tx.scale.clone(),this._endScale=this._startScale.add(this._offset),this._distanceX=Math.abs(this._endScale.x-this._startScale.x),this._distanceY=Math.abs(this._endScale.y-this._startScale.y),this._directionX=this._endScale.x<this._startScale.x?-1:1,this._directionY=this._endScale.y<this._startScale.y?-1:1),this._motion.scaleFactor.x=this._speedX*this._directionX,this._motion.scaleFactor.y=this._speedY*this._directionY,this.isComplete()&&(this._tx.scale=this._endScale,this._motion.scaleFactor.x=0,this._motion.scaleFactor.y=0)}isComplete(){return this._stopped||Math.abs(this._tx.scale.x-this._startScale.x)>=this._distanceX-.01&&Math.abs(this._tx.scale.y-this._startScale.y)>=this._distanceY-.01}stop(){this._motion.scaleFactor.x=0,this._motion.scaleFactor.y=0,this._stopped=!0}reset(){this._started=!1,this._stopped=!1}},CallMethod=class{constructor(e){this.id=nextActionId(),this._hasBeenCalled=!1,this._method=e}update(e){this._method(),this._hasBeenCalled=!0}isComplete(){return this._hasBeenCalled}reset(){this._hasBeenCalled=!1}stop(){this._hasBeenCalled=!0}},EaseTo=class{constructor(e,R,W,Y,X){this.easingFcn=X,this.id=nextActionId(),this._currentLerpTime=0,this._lerpDuration=1*1e3,this._lerpStart=new Oe(0,0),this._lerpEnd=new Oe(0,0),this._initialized=!1,this._stopped=!1,this._tx=e.get(Xe),this._motion=e.get(MotionComponent),this._lerpDuration=Y,this._lerpEnd=new Oe(R,W)}_initialize(){this._lerpStart=new Oe(this._tx.pos.x,this._tx.pos.y),this._currentLerpTime=0}update(e){this._initialized||=(this._initialize(),!0),this._currentLerpTime+=e;let R=this._tx.pos.x,W=this._tx.pos.y;if(this._currentLerpTime<this._lerpDuration){R=this._lerpEnd.x<this._lerpStart.x?this._lerpStart.x-(this.easingFcn(this._currentLerpTime,this._lerpEnd.x,this._lerpStart.x,this._lerpDuration)-this._lerpEnd.x):this.easingFcn(this._currentLerpTime,this._lerpStart.x,this._lerpEnd.x,this._lerpDuration),W=this._lerpEnd.y<this._lerpStart.y?this._lerpStart.y-(this.easingFcn(this._currentLerpTime,this._lerpEnd.y,this._lerpStart.y,this._lerpDuration)-this._lerpEnd.y):this.easingFcn(this._currentLerpTime,this._lerpStart.y,this._lerpEnd.y,this._lerpDuration);let Y=e/1e3;this._motion.vel=vec(Y===0?0:(R-this._tx.pos.x)/Y,Y===0?0:(W-this._tx.pos.y)/Y)}else this._tx.pos=vec(this._lerpEnd.x,this._lerpEnd.y),this._motion.vel=Oe.Zero}isComplete(){return this._stopped||this._currentLerpTime>=this._lerpDuration}reset(){this._initialized=!1,this._stopped=!1,this._currentLerpTime=0}stop(){this._motion.vel=vec(0,0),this._stopped=!0}},EaseBy=class{constructor(e,R,W,Y,X){this.easingFcn=X,this.id=nextActionId(),this._currentLerpTime=0,this._lerpDuration=1*1e3,this._lerpStart=new Oe(0,0),this._lerpEnd=new Oe(0,0),this._initialized=!1,this._stopped=!1,this._tx=e.get(Xe),this._motion=e.get(MotionComponent),this._lerpDuration=Y,this._offset=new Oe(R,W)}_initialize(){this._lerpStart=new Oe(this._tx.pos.x,this._tx.pos.y),this._currentLerpTime=0,this._lerpEnd=this._lerpStart.add(this._offset)}update(e){this._initialized||=(this._initialize(),!0),this._currentLerpTime+=e;let R=this._tx.pos.x,W=this._tx.pos.y;if(this._currentLerpTime<this._lerpDuration){R=this._lerpEnd.x<this._lerpStart.x?this._lerpStart.x-(this.easingFcn(this._currentLerpTime,this._lerpEnd.x,this._lerpStart.x,this._lerpDuration)-this._lerpEnd.x):this.easingFcn(this._currentLerpTime,this._lerpStart.x,this._lerpEnd.x,this._lerpDuration),W=this._lerpEnd.y<this._lerpStart.y?this._lerpStart.y-(this.easingFcn(this._currentLerpTime,this._lerpEnd.y,this._lerpStart.y,this._lerpDuration)-this._lerpEnd.y):this.easingFcn(this._currentLerpTime,this._lerpStart.y,this._lerpEnd.y,this._lerpDuration);let Y=e/1e3;this._motion.vel=vec(Y===0?0:(R-this._tx.pos.x)/Y,Y===0?0:(W-this._tx.pos.y)/Y)}else this._tx.pos=vec(this._lerpEnd.x,this._lerpEnd.y),this._motion.vel=Oe.Zero}isComplete(){return this._stopped||this._currentLerpTime>=this._lerpDuration}reset(){this._initialized=!1,this._stopped=!1,this._currentLerpTime=0}stop(){this._motion.vel=vec(0,0),this._stopped=!0}},Blink=class{constructor(e,R,W,Y=1){this.id=nextActionId(),this._timeVisible=0,this._timeNotVisible=0,this._elapsedTime=0,this._totalTime=0,this._stopped=!1,this._started=!1,this._graphics=e.get(fi),this._timeVisible=R,this._timeNotVisible=W,this._duration=(R+W)*Y}update(e){this._started||(this._started=!0,this._elapsedTime=0,this._totalTime=0),this._graphics&&(this._elapsedTime+=e,this._totalTime+=e,this._graphics.isVisible&&this._elapsedTime>=this._timeVisible&&(this._graphics.isVisible=!1,this._elapsedTime=0),!this._graphics.isVisible&&this._elapsedTime>=this._timeNotVisible&&(this._graphics.isVisible=!0,this._elapsedTime=0),this.isComplete()&&(this._graphics.isVisible=!0))}isComplete(){return this._stopped||this._totalTime>=this._duration}stop(){this._graphics&&(this._graphics.isVisible=!0),this._stopped=!0}reset(){this._started=!1,this._stopped=!1,this._elapsedTime=0,this._totalTime=0}},Fade=class{constructor(e,R,W){this.id=nextActionId(),this._multiplier=1,this._started=!1,this._stopped=!1,this._graphics=e.get(fi),this._endOpacity=R,this._remainingTime=this._originalTime=W}update(e){this._graphics&&(this._started||(this._started=!0,this._remainingTime=this._originalTime,this._endOpacity<this._graphics.opacity?this._multiplier=-1:this._multiplier=1),this._remainingTime>0&&(this._graphics.opacity+=this._multiplier*(Math.abs(this._graphics.opacity-this._endOpacity)*e)/this._remainingTime),this._remainingTime-=e,this.isComplete()&&(this._graphics.opacity=this._endOpacity),Je.getInstance().debug(`[Action fade] Actor opacity:`,this._graphics.opacity))}isComplete(){return this._stopped||this._remainingTime<=0}stop(){this._stopped=!0}reset(){this._started=!1,this._stopped=!1,this._remainingTime=this._originalTime}},Delay=class{constructor(e){this.id=nextActionId(),this._elapsedTime=0,this._started=!1,this._stopped=!1,this._delay=e}update(e){this._started||=!0,this._elapsedTime+=e}isComplete(){return this._stopped||this._elapsedTime>=this._delay}stop(){this._stopped=!0}reset(){this._elapsedTime=0,this._started=!1,this._stopped=!1}},Die=class{constructor(e){this.id=nextActionId(),this._stopped=!1,this._entity=e}update(e){this._entity.get(ActionsComponent).clearActions(),this._entity.kill(),this._stopped=!0}isComplete(){return this._stopped}stop(){}reset(){}},Follow=class{constructor(e,R,W){this.id=nextActionId(),this._started=!1,this._stopped=!1,this._tx=e.get(Xe),this._motion=e.get(MotionComponent),this._followTx=R.get(Xe),this._followMotion=R.get(MotionComponent),this._current=new Oe(this._tx.pos.x,this._tx.pos.y),this._end=new Oe(this._followTx.pos.x,this._followTx.pos.y),this._maximumDistance=W===void 0?this._current.distance(this._end):W,this._speed=0}update(e){this._started||(this._started=!0,this._distanceBetween=this._current.distance(this._end),this._dir=this._end.sub(this._current).normalize());let R=Math.sqrt(this._followMotion.vel.x**2+this._followMotion.vel.y**2);if(R!==0&&(this._speed=R),this._current=vec(this._tx.pos.x,this._tx.pos.y),this._end=vec(this._followTx.pos.x,this._followTx.pos.y),this._distanceBetween=this._current.distance(this._end),this._dir=this._end.sub(this._current).normalize(),this._distanceBetween>=this._maximumDistance){let e=this._dir.scale(this._speed);this._motion.vel=vec(e.x,e.y)}else this._motion.vel=vec(0,0);this.isComplete()&&(this._tx.pos=vec(this._end.x,this._end.y),this._motion.vel=vec(0,0))}stop(){this._motion.vel=vec(0,0),this._stopped=!0}isComplete(){return this._stopped}reset(){this._started=!1,this._stopped=!1}},Meet=class{constructor(e,R,W,Y){this.id=nextActionId(),this._started=!1,this._stopped=!1,this._speedWasSpecified=!1,this._tolerance=1,this._tx=e.get(Xe),this._motion=e.get(MotionComponent),this._meetTx=R.get(Xe),this._meetMotion=R.get(MotionComponent),this._current=new Oe(this._tx.pos.x,this._tx.pos.y),this._end=new Oe(this._meetTx.pos.x,this._meetTx.pos.y),this._speed=W||0,W!==void 0&&(this._speedWasSpecified=!0),Y!==void 0&&(this._tolerance=Y)}update(e){this._started||(this._started=!0,this._distanceBetween=this._current.distance(this._end),this._dir=this._end.sub(this._current).normalize());let R=Math.sqrt(this._meetMotion.vel.x**2+this._meetMotion.vel.y**2);R!==0&&!this._speedWasSpecified&&(this._speed=R),this._current=vec(this._tx.pos.x,this._tx.pos.y),this._end=vec(this._meetTx.pos.x,this._meetTx.pos.y),this._distanceBetween=this._current.distance(this._end),this._dir=this._end.sub(this._current).normalize();let W=this._dir.scale(this._speed);this._motion.vel=vec(W.x,W.y),this.isComplete()&&(this._tx.pos=vec(this._end.x,this._end.y),this._motion.vel=vec(0,0))}isComplete(){return this._stopped||this._distanceBetween<=this._tolerance}stop(){this._motion.vel=vec(0,0),this._stopped=!0}reset(){this._started=!1,this._stopped=!1,this._distanceBetween=1/0}},Flash=class{constructor(e,R,W=1e3){this.id=nextActionId(),this._stopped=!1,this._started=!1,this._total=0,this._currentDuration=0,this._graphics=e.get(fi),this._duration=W,this._entity=e,this._material=e.scene?.engine.graphicsContext.createMaterial({name:`flash-material`,color:R,fragmentSource:`#version 300 es
|
|
892
892
|
|
|
893
893
|
precision mediump float;
|
|
894
894
|
uniform float u_blend;
|
|
@@ -1096,7 +1096,7 @@ Read more about this issue at https://excaliburjs.com/docs/performance`),W&&this
|
|
|
1096
1096
|
Pass an engine parameter to ex.coroutine(engine, function * {...})`)}let be=!1,Ce=!1,Te=!1,Oe=W.bind(Y),Ae=Oe(),loop,Me=new Promise((e,R)=>{loop=W=>{try{if(Te){Ce=!0,e();return}let{done:R,value:Y}=ya.scope(!0,()=>Ae.next(W));if(R||Te){Ce=!0,e();return}Y instanceof Promise?Y.then(()=>{ye.clock.schedule(loop,0,le)}):Y===void 0||Y===void 0?ye.clock.schedule(loop,0,le):ye.clock.schedule(loop,Y||0,le)}catch(e){R(e);return}},_e&&(be=!0,loop(ye.clock.elapsed()))}),Pe={isRunning:()=>be&&!Te&&!Ce,isComplete:()=>Ce,cancel:()=>{Te=!0},start:()=>(be?R.warn(`.start() was called on a coroutine that was already started, this is probably a bug:
|
|
1097
1097
|
`,Function.prototype.toString.call(Oe)):(be=!0,loop(ye.clock.elapsed())),Pe),generator:Ae,done:Me,then:Me.then.bind(Me),[Symbol.iterator]:()=>Ae};return Pe}var Transition=class extends nt{constructor(e){super(),this._logger=Je.getInstance(),this.transform=new Xe,this.graphics=new fi,this._completeFuture=new Future,this.started=!1,this._currentDistance=0,this._currentProgress=0,this.done=this._completeFuture.promise,this._useLegacyEasing=!1,this.name=`Transition#${this.id}`,this.duration=e.duration,isLegacyEasing(e.easing)?(this.legacyEasing=e.easing??mi.Linear,this._useLegacyEasing=!0):this.easing=e.easing??linear,this.direction=e.direction??`out`,this.hideLoader=e.hideLoader??!1,this.blockInput=e.blockInput??!1,this.transform.coordPlane=Re.Screen,this.transform.pos=Oe.Zero,this.transform.z=1/0,this.graphics.anchor=Oe.Zero,this.addComponent(this.transform),this.addComponent(this.graphics),this.direction===`out`?this._currentProgress=0:this._currentProgress=1}get progress(){return this._currentProgress}get distance(){return this._currentDistance}get complete(){return this.direction===`out`?this.progress>=1:this.progress<=0}updateTransition(e,R){this.complete||(this._currentDistance+=clamp(R/this.duration,0,1),this._currentDistance>=1&&(this._currentDistance=1),this.direction===`out`?this._useLegacyEasing?this._currentProgress=clamp(this.legacyEasing(this._currentDistance,0,1,1),0,1):this._currentProgress=clamp(lerp(0,1,this.easing(this._currentDistance)),0,1):this._useLegacyEasing?this._currentProgress=clamp(this.legacyEasing(this._currentDistance,1,0,1),0,1):this._currentProgress=clamp(lerp(1,0,this.easing(this._currentDistance)),0,1))}async onPreviousSceneDeactivate(e){}onStart(e){}onUpdate(e){}onEnd(e){}onReset(){}reset(){this.started=!1,this._completeFuture=new Future,this.done=this._completeFuture.promise,this._currentDistance=0,this.direction===`out`?this._currentProgress=0:this._currentProgress=1,this.onReset()}_addToTargetScene(e,R){let W=R;if(this.started&&this._logger.warn(`Attempted to add a transition ${this.name} that is already playing.`),W.world.entityManager.getById(this.id))return this._co;this._engine=e,W.add(this);let Y=this;return this._co=coroutine(e,function*(){for(;!Y.complete;){let e=yield;Y.updateTransition(Y._engine,e),Y._execute()}},{autostart:!1}),this._co}async _play(){this.started&&(this.reset(),this._logger.warn(`Attempted to play a transition ${this.name} that is already playing, reset transition.`)),(!this._engine||!this._co)&&(this.reset(),this._logger.warn(`Attempted to play a transition ${this.name} that hasn't been added`)),this._co&&await this._co.start()}_execute(){this.isInitialized&&(this.started||(this.started=!0,this.onStart(this.progress)),this.onUpdate(this.progress),this.complete&&!this._completeFuture.isCompleted&&(this.onEnd(this.progress),this._completeFuture.resolve()))}},FadeInOut=class extends Transition{constructor(e){super({...e,duration:e.duration??2e3}),this.name=`FadeInOut#${this.id}`,this.color=e.color??We.Black}onInitialize(e){this.transform.pos=e.screen.unsafeArea.topLeft,this.screenCover=new Sr({width:e.screen.resolution.width,height:e.screen.resolution.height,color:this.color}),this.graphics.add(this.screenCover),this.graphics.opacity=this.progress}onReset(){this.graphics.opacity=this.progress}onStart(e){this.graphics.opacity=e}onEnd(e){this.graphics.opacity=e}onUpdate(e){this.graphics.opacity=e}};const xa=`0.32.0`;polyfill();var Ea=__exportAll({}),Da={83(e,R,W){var Y=W(447),X=W(805),ie=W(996),ae=W(681),le=W(674),_e=W(442),ye=W(414),be=Object.prototype.toString;function g(e){if(!(this instanceof g))return new g(e);this.options=X.assign({chunkSize:16384,windowBits:0,to:``},e||{});var R=this.options;R.raw&&R.windowBits>=0&&R.windowBits<16&&(R.windowBits=-R.windowBits,R.windowBits===0&&(R.windowBits=-15)),!(R.windowBits>=0&&R.windowBits<16)||e&&e.windowBits||(R.windowBits+=32),R.windowBits>15&&R.windowBits<48&&(15&R.windowBits||(R.windowBits|=15)),this.err=0,this.msg=``,this.ended=!1,this.chunks=[],this.strm=new _e,this.strm.avail_out=0;var W=Y.inflateInit2(this.strm,R.windowBits);if(W!==ae.Z_OK||(this.header=new ye,Y.inflateGetHeader(this.strm,this.header),R.dictionary&&(typeof R.dictionary==`string`?R.dictionary=ie.string2buf(R.dictionary):be.call(R.dictionary)===`[object ArrayBuffer]`&&(R.dictionary=new Uint8Array(R.dictionary)),R.raw&&(W=Y.inflateSetDictionary(this.strm,R.dictionary))!==ae.Z_OK)))throw Error(le[W])}function d(e,R){var W=new g(R);if(W.push(e,!0),W.err)throw W.msg||le[W.err];return W.result}g.prototype.push=function(e,R){var W,le,_e,ye,Ce,Te=this.strm,Oe=this.options.chunkSize,Ae=this.options.dictionary,Me=!1;if(this.ended)return!1;le=R===~~R?R:!0===R?ae.Z_FINISH:ae.Z_NO_FLUSH,typeof e==`string`?Te.input=ie.binstring2buf(e):be.call(e)===`[object ArrayBuffer]`?Te.input=new Uint8Array(e):Te.input=e,Te.next_in=0,Te.avail_in=Te.input.length;do{if(Te.avail_out===0&&(Te.output=new X.Buf8(Oe),Te.next_out=0,Te.avail_out=Oe),(W=Y.inflate(Te,ae.Z_NO_FLUSH))===ae.Z_NEED_DICT&&Ae&&(W=Y.inflateSetDictionary(this.strm,Ae)),W===ae.Z_BUF_ERROR&&!0===Me&&(W=ae.Z_OK,Me=!1),W!==ae.Z_STREAM_END&&W!==ae.Z_OK)return this.onEnd(W),this.ended=!0,!1;Te.next_out&&(Te.avail_out!==0&&W!==ae.Z_STREAM_END&&(Te.avail_in!==0||le!==ae.Z_FINISH&&le!==ae.Z_SYNC_FLUSH)||(this.options.to===`string`?(_e=ie.utf8border(Te.output,Te.next_out),ye=Te.next_out-_e,Ce=ie.buf2string(Te.output,_e),Te.next_out=ye,Te.avail_out=Oe-ye,ye&&X.arraySet(Te.output,Te.output,_e,ye,0),this.onData(Ce)):this.onData(X.shrinkBuf(Te.output,Te.next_out)))),Te.avail_in===0&&Te.avail_out===0&&(Me=!0)}while((Te.avail_in>0||Te.avail_out===0)&&W!==ae.Z_STREAM_END);return W===ae.Z_STREAM_END&&(le=ae.Z_FINISH),le===ae.Z_FINISH?(W=Y.inflateEnd(this.strm),this.onEnd(W),this.ended=!0,W===ae.Z_OK):le!==ae.Z_SYNC_FLUSH||(this.onEnd(ae.Z_OK),Te.avail_out=0,!0)},g.prototype.onData=function(e){this.chunks.push(e)},g.prototype.onEnd=function(e){e===ae.Z_OK&&(this.options.to===`string`?this.result=this.chunks.join(``):this.result=X.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},R.Inflate=g,R.inflate=d,R.inflateRaw=function(e,R){return(R||={}).raw=!0,d(e,R)},R.ungzip=d},269(e){e.exports=function(e,R,W,Y){for(var X=65535&e,ie=e>>>16&65535,ae=0;W!==0;){W-=ae=W>2e3?2e3:W;do ie=ie+(X=X+R[Y++]|0)|0;while(--ae);X%=65521,ie%=65521}return X|ie<<16}},293(e){e.exports=function(e,R){var W=e.state,Y=e.next_in,X,ie,ae,le,_e,ye,be,Ce,Te,Oe,Ae,Me,Pe,Re,Be,Ve,He,Ue,We,Ge,Ke,qe=e.input,Je;X=Y+(e.avail_in-5),ie=e.next_out,Je=e.output,ae=ie-(R-e.avail_out),le=ie+(e.avail_out-257),_e=W.dmax,ye=W.wsize,be=W.whave,Ce=W.wnext,Te=W.window,Oe=W.hold,Ae=W.bits,Me=W.lencode,Pe=W.distcode,Re=(1<<W.lenbits)-1,Be=(1<<W.distbits)-1;e:do{Ae<15&&(Oe+=qe[Y++]<<Ae,Ae+=8,Oe+=qe[Y++]<<Ae,Ae+=8),Ve=Me[Oe&Re];t:for(;;){if(Oe>>>=He=Ve>>>24,Ae-=He,(He=Ve>>>16&255)==0)Je[ie++]=65535&Ve;else{if(!(16&He)){if(64&He){if(32&He){W.mode=12;break e}e.msg=`invalid literal/length code`,W.mode=30;break e}Ve=Me[(65535&Ve)+(Oe&(1<<He)-1)];continue t}for(Ue=65535&Ve,(He&=15)&&(Ae<He&&(Oe+=qe[Y++]<<Ae,Ae+=8),Ue+=Oe&(1<<He)-1,Oe>>>=He,Ae-=He),Ae<15&&(Oe+=qe[Y++]<<Ae,Ae+=8,Oe+=qe[Y++]<<Ae,Ae+=8),Ve=Pe[Oe&Be];;){if(Oe>>>=He=Ve>>>24,Ae-=He,16&(He=Ve>>>16&255)){if(We=65535&Ve,Ae<(He&=15)&&(Oe+=qe[Y++]<<Ae,(Ae+=8)<He&&(Oe+=qe[Y++]<<Ae,Ae+=8)),(We+=Oe&(1<<He)-1)>_e){e.msg=`invalid distance too far back`,W.mode=30;break e}if(Oe>>>=He,Ae-=He,We>(He=ie-ae)){if((He=We-He)>be&&W.sane){e.msg=`invalid distance too far back`,W.mode=30;break e}if(Ge=0,Ke=Te,Ce===0){if(Ge+=ye-He,He<Ue){Ue-=He;do Je[ie++]=Te[Ge++];while(--He);Ge=ie-We,Ke=Je}}else if(Ce<He){if(Ge+=ye+Ce-He,(He-=Ce)<Ue){Ue-=He;do Je[ie++]=Te[Ge++];while(--He);if(Ge=0,Ce<Ue){Ue-=He=Ce;do Je[ie++]=Te[Ge++];while(--He);Ge=ie-We,Ke=Je}}}else if(Ge+=Ce-He,He<Ue){Ue-=He;do Je[ie++]=Te[Ge++];while(--He);Ge=ie-We,Ke=Je}for(;Ue>2;)Je[ie++]=Ke[Ge++],Je[ie++]=Ke[Ge++],Je[ie++]=Ke[Ge++],Ue-=3;Ue&&(Je[ie++]=Ke[Ge++],Ue>1&&(Je[ie++]=Ke[Ge++]))}else{Ge=ie-We;do Je[ie++]=Je[Ge++],Je[ie++]=Je[Ge++],Je[ie++]=Je[Ge++],Ue-=3;while(Ue>2);Ue&&(Je[ie++]=Je[Ge++],Ue>1&&(Je[ie++]=Je[Ge++]))}break}if(64&He){e.msg=`invalid distance code`,W.mode=30;break e}Ve=Pe[(65535&Ve)+(Oe&(1<<He)-1)]}}break}}while(Y<X&&ie<le);Y-=Ue=Ae>>3,Oe&=(1<<(Ae-=Ue<<3))-1,e.next_in=Y,e.next_out=ie,e.avail_in=Y<X?X-Y+5:5-(Y-X),e.avail_out=ie<le?le-ie+257:257-(ie-le),W.hold=Oe,W.bits=Ae}},303(e,R,W){var Y=W(411),X=W(805),ie=W(996),ae=W(674),le=W(442),_e=Object.prototype.toString;function l(e){if(!(this instanceof l))return new l(e);this.options=X.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:``},e||{});var R=this.options;R.raw&&R.windowBits>0?R.windowBits=-R.windowBits:R.gzip&&R.windowBits>0&&R.windowBits<16&&(R.windowBits+=16),this.err=0,this.msg=``,this.ended=!1,this.chunks=[],this.strm=new le,this.strm.avail_out=0;var W=Y.deflateInit2(this.strm,R.level,R.method,R.windowBits,R.memLevel,R.strategy);if(W!==0)throw Error(ae[W]);if(R.header&&Y.deflateSetHeader(this.strm,R.header),R.dictionary){var ye;if(ye=typeof R.dictionary==`string`?ie.string2buf(R.dictionary):_e.call(R.dictionary)===`[object ArrayBuffer]`?new Uint8Array(R.dictionary):R.dictionary,(W=Y.deflateSetDictionary(this.strm,ye))!==0)throw Error(ae[W]);this._dict_set=!0}}function c(e,R){var W=new l(R);if(W.push(e,!0),W.err)throw W.msg||ae[W.err];return W.result}l.prototype.push=function(e,R){var W,ae,le=this.strm,ye=this.options.chunkSize;if(this.ended)return!1;ae=R===~~R?R:!0===R?4:0,typeof e==`string`?le.input=ie.string2buf(e):_e.call(e)===`[object ArrayBuffer]`?le.input=new Uint8Array(e):le.input=e,le.next_in=0,le.avail_in=le.input.length;do{if(le.avail_out===0&&(le.output=new X.Buf8(ye),le.next_out=0,le.avail_out=ye),(W=Y.deflate(le,ae))!==1&&W!==0)return this.onEnd(W),this.ended=!0,!1;le.avail_out!==0&&(le.avail_in!==0||ae!==4&&ae!==2)||(this.options.to===`string`?this.onData(ie.buf2binstring(X.shrinkBuf(le.output,le.next_out))):this.onData(X.shrinkBuf(le.output,le.next_out)))}while((le.avail_in>0||le.avail_out===0)&&W!==1);return ae===4?(W=Y.deflateEnd(this.strm),this.onEnd(W),this.ended=!0,W===0):ae!==2||(this.onEnd(0),le.avail_out=0,!0)},l.prototype.onData=function(e){this.chunks.push(e)},l.prototype.onEnd=function(e){e===0&&(this.options.to===`string`?this.result=this.chunks.join(``):this.result=X.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},R.Deflate=l,R.deflate=c,R.deflateRaw=function(e,R){return(R||={}).raw=!0,c(e,R)},R.gzip=function(e,R){return(R||={}).gzip=!0,c(e,R)}},371(e){e.exports=Ea},411(e,R,W){var Y,X=W(805),ie=W(665),ae=W(269),le=W(823),_e=W(674),ye=-2,be=258,Ce=262,Te=103,Oe=113,Ae=666;function I(e,R){return e.msg=_e[R],R}function p(e){return(e<<1)-(e>4?9:0)}function f(e){for(var R=e.length;--R>=0;)e[R]=0}function B(e){var R=e.state,W=R.pending;W>e.avail_out&&(W=e.avail_out),W!==0&&(X.arraySet(e.output,R.pending_buf,R.pending_out,W,e.next_out),e.next_out+=W,R.pending_out+=W,e.total_out+=W,e.avail_out-=W,R.pending-=W,R.pending===0&&(R.pending_out=0))}function C(e,R){ie._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,R),e.block_start=e.strstart,B(e.strm)}function E(e,R){e.pending_buf[e.pending++]=R}function Q(e,R){e.pending_buf[e.pending++]=R>>>8&255,e.pending_buf[e.pending++]=255&R}function m(e,R){var W,Y,X=e.max_chain_length,ie=e.strstart,ae=e.prev_length,le=e.nice_match,_e=e.strstart>e.w_size-Ce?e.strstart-(e.w_size-Ce):0,ye=e.window,Te=e.w_mask,Oe=e.prev,Ae=e.strstart+be,Me=ye[ie+ae-1],Pe=ye[ie+ae];e.prev_length>=e.good_match&&(X>>=2),le>e.lookahead&&(le=e.lookahead);do if(ye[(W=R)+ae]===Pe&&ye[W+ae-1]===Me&&ye[W]===ye[ie]&&ye[++W]===ye[ie+1]){ie+=2,W++;do;while(ye[++ie]===ye[++W]&&ye[++ie]===ye[++W]&&ye[++ie]===ye[++W]&&ye[++ie]===ye[++W]&&ye[++ie]===ye[++W]&&ye[++ie]===ye[++W]&&ye[++ie]===ye[++W]&&ye[++ie]===ye[++W]&&ie<Ae);if(Y=be-(Ae-ie),ie=Ae-be,Y>ae){if(e.match_start=R,ae=Y,Y>=le)break;Me=ye[ie+ae-1],Pe=ye[ie+ae]}}while((R=Oe[R&Te])>_e&&--X!=0);return ae<=e.lookahead?ae:e.lookahead}function y(e){var R,W,Y,ie,_e,ye,be,Te,Oe,Ae,Me=e.w_size;do{if(ie=e.window_size-e.lookahead-e.strstart,e.strstart>=Me+(Me-Ce)){X.arraySet(e.window,e.window,Me,Me,0),e.match_start-=Me,e.strstart-=Me,e.block_start-=Me,R=W=e.hash_size;do Y=e.head[--R],e.head[R]=Y>=Me?Y-Me:0;while(--W);R=W=Me;do Y=e.prev[--R],e.prev[R]=Y>=Me?Y-Me:0;while(--W);ie+=Me}if(e.strm.avail_in===0)break;if(ye=e.strm,be=e.window,Te=e.strstart+e.lookahead,Oe=ie,Ae=void 0,(Ae=ye.avail_in)>Oe&&(Ae=Oe),W=Ae===0?0:(ye.avail_in-=Ae,X.arraySet(be,ye.input,ye.next_in,Ae,Te),ye.state.wrap===1?ye.adler=ae(ye.adler,be,Ae,Te):ye.state.wrap===2&&(ye.adler=le(ye.adler,be,Ae,Te)),ye.next_in+=Ae,ye.total_in+=Ae,Ae),e.lookahead+=W,e.lookahead+e.insert>=3)for(_e=e.strstart-e.insert,e.ins_h=e.window[_e],e.ins_h=(e.ins_h<<e.hash_shift^e.window[_e+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[_e+3-1])&e.hash_mask,e.prev[_e&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=_e,_e++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<Ce&&e.strm.avail_in!==0)}function w(e,R){for(var W,Y;;){if(e.lookahead<Ce){if(y(e),e.lookahead<Ce&&R===0)return 1;if(e.lookahead===0)break}if(W=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,W=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),W!==0&&e.strstart-W<=e.w_size-Ce&&(e.match_length=m(e,W)),e.match_length>=3)if(Y=ie._tr_tally(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,W=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!=0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else Y=ie._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(Y&&(C(e,!1),e.strm.avail_out===0))return 1}return e.insert=e.strstart<2?e.strstart:2,R===4?(C(e,!0),e.strm.avail_out===0?3:4):e.last_lit&&(C(e,!1),e.strm.avail_out===0)?1:2}function _(e,R){for(var W,Y,X;;){if(e.lookahead<Ce){if(y(e),e.lookahead<Ce&&R===0)return 1;if(e.lookahead===0)break}if(W=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,W=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,W!==0&&e.prev_length<e.max_lazy_match&&e.strstart-W<=e.w_size-Ce&&(e.match_length=m(e,W),e.match_length<=5&&(e.strategy===1||e.match_length===3&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){X=e.strstart+e.lookahead-3,Y=ie._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=X&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,W=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!=0);if(e.match_available=0,e.match_length=2,e.strstart++,Y&&(C(e,!1),e.strm.avail_out===0))return 1}else if(e.match_available){if((Y=ie._tr_tally(e,0,e.window[e.strstart-1]))&&C(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&=(Y=ie._tr_tally(e,0,e.window[e.strstart-1]),0),e.insert=e.strstart<2?e.strstart:2,R===4?(C(e,!0),e.strm.avail_out===0?3:4):e.last_lit&&(C(e,!1),e.strm.avail_out===0)?1:2}function v(e,R,W,Y,X){this.good_length=e,this.max_lazy=R,this.nice_length=W,this.max_chain=Y,this.func=X}function b(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new X.Buf16(1146),this.dyn_dtree=new X.Buf16(122),this.bl_tree=new X.Buf16(78),f(this.dyn_ltree),f(this.dyn_dtree),f(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new X.Buf16(16),this.heap=new X.Buf16(573),f(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new X.Buf16(573),f(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function k(e){var R;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=2,(R=e.state).pending=0,R.pending_out=0,R.wrap<0&&(R.wrap=-R.wrap),R.status=R.wrap?42:Oe,e.adler=R.wrap===2?0:1,R.last_flush=0,ie._tr_init(R),0):I(e,ye)}function D(e){var R,W=k(e);return W===0&&((R=e.state).window_size=2*R.w_size,f(R.head),R.max_lazy_match=Y[R.level].max_lazy,R.good_match=Y[R.level].good_length,R.nice_match=Y[R.level].nice_length,R.max_chain_length=Y[R.level].max_chain,R.strstart=0,R.block_start=0,R.lookahead=0,R.insert=0,R.match_length=R.prev_length=2,R.match_available=0,R.ins_h=0),W}function S(e,R,W,Y,ie,ae){if(!e)return ye;var le=1;if(R===-1&&(R=6),Y<0?(le=0,Y=-Y):Y>15&&(le=2,Y-=16),ie<1||ie>9||W!==8||Y<8||Y>15||R<0||R>9||ae<0||ae>4)return I(e,ye);Y===8&&(Y=9);var _e=new b;return e.state=_e,_e.strm=e,_e.wrap=le,_e.gzhead=null,_e.w_bits=Y,_e.w_size=1<<_e.w_bits,_e.w_mask=_e.w_size-1,_e.hash_bits=ie+7,_e.hash_size=1<<_e.hash_bits,_e.hash_mask=_e.hash_size-1,_e.hash_shift=~~((_e.hash_bits+3-1)/3),_e.window=new X.Buf8(2*_e.w_size),_e.head=new X.Buf16(_e.hash_size),_e.prev=new X.Buf16(_e.w_size),_e.lit_bufsize=1<<ie+6,_e.pending_buf_size=4*_e.lit_bufsize,_e.pending_buf=new X.Buf8(_e.pending_buf_size),_e.d_buf=1*_e.lit_bufsize,_e.l_buf=3*_e.lit_bufsize,_e.level=R,_e.strategy=ae,_e.method=W,D(e)}Y=[new v(0,0,0,0,(function(e,R){var W=65535;for(W>e.pending_buf_size-5&&(W=e.pending_buf_size-5);;){if(e.lookahead<=1){if(y(e),e.lookahead===0&&R===0)return 1;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var Y=e.block_start+W;if((e.strstart===0||e.strstart>=Y)&&(e.lookahead=e.strstart-Y,e.strstart=Y,C(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-Ce&&(C(e,!1),e.strm.avail_out===0))return 1}return e.insert=0,R===4?(C(e,!0),e.strm.avail_out===0?3:4):(e.strstart>e.block_start&&(C(e,!1),e.strm.avail_out),1)})),new v(4,4,8,4,w),new v(4,5,16,8,w),new v(4,6,32,32,w),new v(4,4,16,16,_),new v(8,16,32,32,_),new v(8,16,128,128,_),new v(8,32,128,256,_),new v(32,128,258,1024,_),new v(32,258,258,4096,_)],R.deflateInit=function(e,R){return S(e,R,8,15,8,0)},R.deflateInit2=S,R.deflateReset=D,R.deflateResetKeep=k,R.deflateSetHeader=function(e,R){return e&&e.state&&e.state.wrap===2?(e.state.gzhead=R,0):ye},R.deflate=function(e,R){var W,X,ae,_e;if(!e||!e.state||R>5||R<0)return e?I(e,ye):ye;if(X=e.state,!e.output||!e.input&&e.avail_in!==0||X.status===Ae&&R!==4)return I(e,e.avail_out===0?-5:ye);if(X.strm=e,W=X.last_flush,X.last_flush=R,X.status===42)if(X.wrap===2)e.adler=0,E(X,31),E(X,139),E(X,8),X.gzhead?(E(X,+!!X.gzhead.text+(X.gzhead.hcrc?2:0)+(X.gzhead.extra?4:0)+(X.gzhead.name?8:0)+(X.gzhead.comment?16:0)),E(X,255&X.gzhead.time),E(X,X.gzhead.time>>8&255),E(X,X.gzhead.time>>16&255),E(X,X.gzhead.time>>24&255),E(X,X.level===9?2:X.strategy>=2||X.level<2?4:0),E(X,255&X.gzhead.os),X.gzhead.extra&&X.gzhead.extra.length&&(E(X,255&X.gzhead.extra.length),E(X,X.gzhead.extra.length>>8&255)),X.gzhead.hcrc&&(e.adler=le(e.adler,X.pending_buf,X.pending,0)),X.gzindex=0,X.status=69):(E(X,0),E(X,0),E(X,0),E(X,0),E(X,0),E(X,X.level===9?2:X.strategy>=2||X.level<2?4:0),E(X,3),X.status=Oe);else{var Ce=8+(X.w_bits-8<<4)<<8;Ce|=(X.strategy>=2||X.level<2?0:X.level<6?1:X.level===6?2:3)<<6,X.strstart!==0&&(Ce|=32),Ce+=31-Ce%31,X.status=Oe,Q(X,Ce),X.strstart!==0&&(Q(X,e.adler>>>16),Q(X,65535&e.adler)),e.adler=1}if(X.status===69)if(X.gzhead.extra){for(ae=X.pending;X.gzindex<(65535&X.gzhead.extra.length)&&(X.pending!==X.pending_buf_size||(X.gzhead.hcrc&&X.pending>ae&&(e.adler=le(e.adler,X.pending_buf,X.pending-ae,ae)),B(e),ae=X.pending,X.pending!==X.pending_buf_size));)E(X,255&X.gzhead.extra[X.gzindex]),X.gzindex++;X.gzhead.hcrc&&X.pending>ae&&(e.adler=le(e.adler,X.pending_buf,X.pending-ae,ae)),X.gzindex===X.gzhead.extra.length&&(X.gzindex=0,X.status=73)}else X.status=73;if(X.status===73)if(X.gzhead.name){ae=X.pending;do{if(X.pending===X.pending_buf_size&&(X.gzhead.hcrc&&X.pending>ae&&(e.adler=le(e.adler,X.pending_buf,X.pending-ae,ae)),B(e),ae=X.pending,X.pending===X.pending_buf_size)){_e=1;break}_e=X.gzindex<X.gzhead.name.length?255&X.gzhead.name.charCodeAt(X.gzindex++):0,E(X,_e)}while(_e!==0);X.gzhead.hcrc&&X.pending>ae&&(e.adler=le(e.adler,X.pending_buf,X.pending-ae,ae)),_e===0&&(X.gzindex=0,X.status=91)}else X.status=91;if(X.status===91)if(X.gzhead.comment){ae=X.pending;do{if(X.pending===X.pending_buf_size&&(X.gzhead.hcrc&&X.pending>ae&&(e.adler=le(e.adler,X.pending_buf,X.pending-ae,ae)),B(e),ae=X.pending,X.pending===X.pending_buf_size)){_e=1;break}_e=X.gzindex<X.gzhead.comment.length?255&X.gzhead.comment.charCodeAt(X.gzindex++):0,E(X,_e)}while(_e!==0);X.gzhead.hcrc&&X.pending>ae&&(e.adler=le(e.adler,X.pending_buf,X.pending-ae,ae)),_e===0&&(X.status=Te)}else X.status=Te;if(X.status===Te&&(X.gzhead.hcrc?(X.pending+2>X.pending_buf_size&&B(e),X.pending+2<=X.pending_buf_size&&(E(X,255&e.adler),E(X,e.adler>>8&255),e.adler=0,X.status=Oe)):X.status=Oe),X.pending!==0){if(B(e),e.avail_out===0)return X.last_flush=-1,0}else if(e.avail_in===0&&p(R)<=p(W)&&R!==4)return I(e,-5);if(X.status===Ae&&e.avail_in!==0)return I(e,-5);if(e.avail_in!==0||X.lookahead!==0||R!==0&&X.status!==Ae){var Me=X.strategy===2?function(e,R){for(var W;;){if(e.lookahead===0&&(y(e),e.lookahead===0)){if(R===0)return 1;break}if(e.match_length=0,W=ie._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,W&&(C(e,!1),e.strm.avail_out===0))return 1}return e.insert=0,R===4?(C(e,!0),e.strm.avail_out===0?3:4):e.last_lit&&(C(e,!1),e.strm.avail_out===0)?1:2}(X,R):X.strategy===3?function(e,R){for(var W,Y,X,ae,le=e.window;;){if(e.lookahead<=be){if(y(e),e.lookahead<=be&&R===0)return 1;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(Y=le[X=e.strstart-1])===le[++X]&&Y===le[++X]&&Y===le[++X]){ae=e.strstart+be;do;while(Y===le[++X]&&Y===le[++X]&&Y===le[++X]&&Y===le[++X]&&Y===le[++X]&&Y===le[++X]&&Y===le[++X]&&Y===le[++X]&&X<ae);e.match_length=be-(ae-X),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(W=ie._tr_tally(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(W=ie._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),W&&(C(e,!1),e.strm.avail_out===0))return 1}return e.insert=0,R===4?(C(e,!0),e.strm.avail_out===0?3:4):e.last_lit&&(C(e,!1),e.strm.avail_out===0)?1:2}(X,R):Y[X.level].func(X,R);if(Me!==3&&Me!==4||(X.status=Ae),Me===1||Me===3)return e.avail_out===0&&(X.last_flush=-1),0;if(Me===2&&(R===1?ie._tr_align(X):R!==5&&(ie._tr_stored_block(X,0,0,!1),R===3&&(f(X.head),X.lookahead===0&&(X.strstart=0,X.block_start=0,X.insert=0))),B(e),e.avail_out===0))return X.last_flush=-1,0}return R===4?X.wrap<=0?1:(X.wrap===2?(E(X,255&e.adler),E(X,e.adler>>8&255),E(X,e.adler>>16&255),E(X,e.adler>>24&255),E(X,255&e.total_in),E(X,e.total_in>>8&255),E(X,e.total_in>>16&255),E(X,e.total_in>>24&255)):(Q(X,e.adler>>>16),Q(X,65535&e.adler)),B(e),X.wrap>0&&(X.wrap=-X.wrap),+(X.pending===0)):0},R.deflateEnd=function(e){var R;return e&&e.state?(R=e.state.status)!==42&&R!==69&&R!==73&&R!==91&&R!==Te&&R!==Oe&&R!==Ae?I(e,ye):(e.state=null,R===Oe?I(e,-3):0):ye},R.deflateSetDictionary=function(e,R){var W,Y,ie,le,_e,be,Ce,Te,Oe=R.length;if(!e||!e.state||(le=(W=e.state).wrap)===2||le===1&&W.status!==42||W.lookahead)return ye;for(le===1&&(e.adler=ae(e.adler,R,Oe,0)),W.wrap=0,Oe>=W.w_size&&(le===0&&(f(W.head),W.strstart=0,W.block_start=0,W.insert=0),Te=new X.Buf8(W.w_size),X.arraySet(Te,R,Oe-W.w_size,W.w_size,0),R=Te,Oe=W.w_size),_e=e.avail_in,be=e.next_in,Ce=e.input,e.avail_in=Oe,e.next_in=0,e.input=R,y(W);W.lookahead>=3;){Y=W.strstart,ie=W.lookahead-2;do W.ins_h=(W.ins_h<<W.hash_shift^W.window[Y+3-1])&W.hash_mask,W.prev[Y&W.w_mask]=W.head[W.ins_h],W.head[W.ins_h]=Y,Y++;while(--ie);W.strstart=Y,W.lookahead=2,y(W)}return W.strstart+=W.lookahead,W.block_start=W.strstart,W.insert=W.lookahead,W.lookahead=0,W.match_length=W.prev_length=2,W.match_available=0,e.next_in=be,e.input=Ce,e.avail_in=_e,W.wrap=le,0},R.deflateInfo=`pako deflate (from Nodeca project)`},414(e){e.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name=``,this.comment=``,this.hcrc=0,this.done=!1}},442(e){e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg=``,this.state=null,this.data_type=2,this.adler=0}},447(e,R,W){var Y=W(805),X=W(269),ie=W(823),ae=W(293),le=W(998),_e=-2,ye=12,be=30;function g(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function d(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Y.Buf16(320),this.work=new Y.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function h(e){var R;return e&&e.state?(R=e.state,e.total_in=e.total_out=R.total=0,e.msg=``,R.wrap&&(e.adler=1&R.wrap),R.mode=1,R.last=0,R.havedict=0,R.dmax=32768,R.head=null,R.hold=0,R.bits=0,R.lencode=R.lendyn=new Y.Buf32(852),R.distcode=R.distdyn=new Y.Buf32(592),R.sane=1,R.back=-1,0):_e}function u(e){var R;return e&&e.state?((R=e.state).wsize=0,R.whave=0,R.wnext=0,h(e)):_e}function I(e,R){var W,Y;return e&&e.state?(Y=e.state,R<0?(W=0,R=-R):(W=1+(R>>4),R<48&&(R&=15)),R&&(R<8||R>15)?_e:(Y.window!==null&&Y.wbits!==R&&(Y.window=null),Y.wrap=W,Y.wbits=R,u(e))):_e}function p(e,R){var W,Y;return e?(Y=new d,e.state=Y,Y.window=null,(W=I(e,R))!==0&&(e.state=null),W):_e}var Ce,Te,Oe=!0;function E(e){if(Oe){var R;for(Ce=new Y.Buf32(512),Te=new Y.Buf32(32),R=0;R<144;)e.lens[R++]=8;for(;R<256;)e.lens[R++]=9;for(;R<280;)e.lens[R++]=7;for(;R<288;)e.lens[R++]=8;for(le(1,e.lens,0,288,Ce,0,e.work,{bits:9}),R=0;R<32;)e.lens[R++]=5;le(2,e.lens,0,32,Te,0,e.work,{bits:5}),Oe=!1}e.lencode=Ce,e.lenbits=9,e.distcode=Te,e.distbits=5}function Q(e,R,W,X){var ie,ae=e.state;return ae.window===null&&(ae.wsize=1<<ae.wbits,ae.wnext=0,ae.whave=0,ae.window=new Y.Buf8(ae.wsize)),X>=ae.wsize?(Y.arraySet(ae.window,R,W-ae.wsize,ae.wsize,0),ae.wnext=0,ae.whave=ae.wsize):((ie=ae.wsize-ae.wnext)>X&&(ie=X),Y.arraySet(ae.window,R,W-X,ie,ae.wnext),(X-=ie)?(Y.arraySet(ae.window,R,W-X,X,0),ae.wnext=X,ae.whave=ae.wsize):(ae.wnext+=ie,ae.wnext===ae.wsize&&(ae.wnext=0),ae.whave<ae.wsize&&(ae.whave+=ie))),0}R.inflateReset=u,R.inflateReset2=I,R.inflateResetKeep=h,R.inflateInit=function(e){return p(e,15)},R.inflateInit2=p,R.inflate=function(e,R){var W,Ce,Te,Oe,Ae,Me,Pe,Re,Be,Ve,He,Ue,We,Ge,Ke,qe,Je,Ye,Xe,Ze,Qe,$e,et,tt,nt=0,rt=new Y.Buf8(4),it=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&e.avail_in!==0)return _e;(W=e.state).mode===ye&&(W.mode=13),Ae=e.next_out,Te=e.output,Pe=e.avail_out,Oe=e.next_in,Ce=e.input,Me=e.avail_in,Re=W.hold,Be=W.bits,Ve=Me,He=Pe,$e=0;e:for(;;)switch(W.mode){case 1:if(W.wrap===0){W.mode=13;break}for(;Be<16;){if(Me===0)break e;Me--,Re+=Ce[Oe++]<<Be,Be+=8}if(2&W.wrap&&Re===35615){W.check=0,rt[0]=255&Re,rt[1]=Re>>>8&255,W.check=ie(W.check,rt,2,0),Re=0,Be=0,W.mode=2;break}if(W.flags=0,W.head&&(W.head.done=!1),!(1&W.wrap)||(((255&Re)<<8)+(Re>>8))%31){e.msg=`incorrect header check`,W.mode=be;break}if((15&Re)!=8){e.msg=`unknown compression method`,W.mode=be;break}if(Be-=4,Qe=8+(15&(Re>>>=4)),W.wbits===0)W.wbits=Qe;else if(Qe>W.wbits){e.msg=`invalid window size`,W.mode=be;break}W.dmax=1<<Qe,e.adler=W.check=1,W.mode=512&Re?10:ye,Re=0,Be=0;break;case 2:for(;Be<16;){if(Me===0)break e;Me--,Re+=Ce[Oe++]<<Be,Be+=8}if(W.flags=Re,(255&W.flags)!=8){e.msg=`unknown compression method`,W.mode=be;break}if(57344&W.flags){e.msg=`unknown header flags set`,W.mode=be;break}W.head&&(W.head.text=Re>>8&1),512&W.flags&&(rt[0]=255&Re,rt[1]=Re>>>8&255,W.check=ie(W.check,rt,2,0)),Re=0,Be=0,W.mode=3;case 3:for(;Be<32;){if(Me===0)break e;Me--,Re+=Ce[Oe++]<<Be,Be+=8}W.head&&(W.head.time=Re),512&W.flags&&(rt[0]=255&Re,rt[1]=Re>>>8&255,rt[2]=Re>>>16&255,rt[3]=Re>>>24&255,W.check=ie(W.check,rt,4,0)),Re=0,Be=0,W.mode=4;case 4:for(;Be<16;){if(Me===0)break e;Me--,Re+=Ce[Oe++]<<Be,Be+=8}W.head&&(W.head.xflags=255&Re,W.head.os=Re>>8),512&W.flags&&(rt[0]=255&Re,rt[1]=Re>>>8&255,W.check=ie(W.check,rt,2,0)),Re=0,Be=0,W.mode=5;case 5:if(1024&W.flags){for(;Be<16;){if(Me===0)break e;Me--,Re+=Ce[Oe++]<<Be,Be+=8}W.length=Re,W.head&&(W.head.extra_len=Re),512&W.flags&&(rt[0]=255&Re,rt[1]=Re>>>8&255,W.check=ie(W.check,rt,2,0)),Re=0,Be=0}else W.head&&(W.head.extra=null);W.mode=6;case 6:if(1024&W.flags&&((Ue=W.length)>Me&&(Ue=Me),Ue&&(W.head&&(Qe=W.head.extra_len-W.length,W.head.extra||(W.head.extra=Array(W.head.extra_len)),Y.arraySet(W.head.extra,Ce,Oe,Ue,Qe)),512&W.flags&&(W.check=ie(W.check,Ce,Ue,Oe)),Me-=Ue,Oe+=Ue,W.length-=Ue),W.length))break e;W.length=0,W.mode=7;case 7:if(2048&W.flags){if(Me===0)break e;Ue=0;do Qe=Ce[Oe+ Ue++],W.head&&Qe&&W.length<65536&&(W.head.name+=String.fromCharCode(Qe));while(Qe&&Ue<Me);if(512&W.flags&&(W.check=ie(W.check,Ce,Ue,Oe)),Me-=Ue,Oe+=Ue,Qe)break e}else W.head&&(W.head.name=null);W.length=0,W.mode=8;case 8:if(4096&W.flags){if(Me===0)break e;Ue=0;do Qe=Ce[Oe+ Ue++],W.head&&Qe&&W.length<65536&&(W.head.comment+=String.fromCharCode(Qe));while(Qe&&Ue<Me);if(512&W.flags&&(W.check=ie(W.check,Ce,Ue,Oe)),Me-=Ue,Oe+=Ue,Qe)break e}else W.head&&(W.head.comment=null);W.mode=9;case 9:if(512&W.flags){for(;Be<16;){if(Me===0)break e;Me--,Re+=Ce[Oe++]<<Be,Be+=8}if(Re!==(65535&W.check)){e.msg=`header crc mismatch`,W.mode=be;break}Re=0,Be=0}W.head&&(W.head.hcrc=W.flags>>9&1,W.head.done=!0),e.adler=W.check=0,W.mode=ye;break;case 10:for(;Be<32;){if(Me===0)break e;Me--,Re+=Ce[Oe++]<<Be,Be+=8}e.adler=W.check=g(Re),Re=0,Be=0,W.mode=11;case 11:if(W.havedict===0)return e.next_out=Ae,e.avail_out=Pe,e.next_in=Oe,e.avail_in=Me,W.hold=Re,W.bits=Be,2;e.adler=W.check=1,W.mode=ye;case ye:if(R===5||R===6)break e;case 13:if(W.last){Re>>>=7&Be,Be-=7&Be,W.mode=27;break}for(;Be<3;){if(Me===0)break e;Me--,Re+=Ce[Oe++]<<Be,Be+=8}switch(W.last=1&Re,--Be,3&(Re>>>=1)){case 0:W.mode=14;break;case 1:if(E(W),W.mode=20,R===6){Re>>>=2,Be-=2;break e}break;case 2:W.mode=17;break;case 3:e.msg=`invalid block type`,W.mode=be}Re>>>=2,Be-=2;break;case 14:for(Re>>>=7&Be,Be-=7&Be;Be<32;){if(Me===0)break e;Me--,Re+=Ce[Oe++]<<Be,Be+=8}if((65535&Re)!=(Re>>>16^65535)){e.msg=`invalid stored block lengths`,W.mode=be;break}if(W.length=65535&Re,Re=0,Be=0,W.mode=15,R===6)break e;case 15:W.mode=16;case 16:if(Ue=W.length){if(Ue>Me&&(Ue=Me),Ue>Pe&&(Ue=Pe),Ue===0)break e;Y.arraySet(Te,Ce,Oe,Ue,Ae),Me-=Ue,Oe+=Ue,Pe-=Ue,Ae+=Ue,W.length-=Ue;break}W.mode=ye;break;case 17:for(;Be<14;){if(Me===0)break e;Me--,Re+=Ce[Oe++]<<Be,Be+=8}if(W.nlen=257+(31&Re),Re>>>=5,Be-=5,W.ndist=1+(31&Re),Re>>>=5,Be-=5,W.ncode=4+(15&Re),Re>>>=4,Be-=4,W.nlen>286||W.ndist>30){e.msg=`too many length or distance symbols`,W.mode=be;break}W.have=0,W.mode=18;case 18:for(;W.have<W.ncode;){for(;Be<3;){if(Me===0)break e;Me--,Re+=Ce[Oe++]<<Be,Be+=8}W.lens[it[W.have++]]=7&Re,Re>>>=3,Be-=3}for(;W.have<19;)W.lens[it[W.have++]]=0;if(W.lencode=W.lendyn,W.lenbits=7,et={bits:W.lenbits},$e=le(0,W.lens,0,19,W.lencode,0,W.work,et),W.lenbits=et.bits,$e){e.msg=`invalid code lengths set`,W.mode=be;break}W.have=0,W.mode=19;case 19:for(;W.have<W.nlen+W.ndist;){for(;qe=(nt=W.lencode[Re&(1<<W.lenbits)-1])>>>16&255,Je=65535&nt,!((Ke=nt>>>24)<=Be);){if(Me===0)break e;Me--,Re+=Ce[Oe++]<<Be,Be+=8}if(Je<16)Re>>>=Ke,Be-=Ke,W.lens[W.have++]=Je;else{if(Je===16){for(tt=Ke+2;Be<tt;){if(Me===0)break e;Me--,Re+=Ce[Oe++]<<Be,Be+=8}if(Re>>>=Ke,Be-=Ke,W.have===0){e.msg=`invalid bit length repeat`,W.mode=be;break}Qe=W.lens[W.have-1],Ue=3+(3&Re),Re>>>=2,Be-=2}else if(Je===17){for(tt=Ke+3;Be<tt;){if(Me===0)break e;Me--,Re+=Ce[Oe++]<<Be,Be+=8}Be-=Ke,Qe=0,Ue=3+(7&(Re>>>=Ke)),Re>>>=3,Be-=3}else{for(tt=Ke+7;Be<tt;){if(Me===0)break e;Me--,Re+=Ce[Oe++]<<Be,Be+=8}Be-=Ke,Qe=0,Ue=11+(127&(Re>>>=Ke)),Re>>>=7,Be-=7}if(W.have+Ue>W.nlen+W.ndist){e.msg=`invalid bit length repeat`,W.mode=be;break}for(;Ue--;)W.lens[W.have++]=Qe}}if(W.mode===be)break;if(W.lens[256]===0){e.msg=`invalid code -- missing end-of-block`,W.mode=be;break}if(W.lenbits=9,et={bits:W.lenbits},$e=le(1,W.lens,0,W.nlen,W.lencode,0,W.work,et),W.lenbits=et.bits,$e){e.msg=`invalid literal/lengths set`,W.mode=be;break}if(W.distbits=6,W.distcode=W.distdyn,et={bits:W.distbits},$e=le(2,W.lens,W.nlen,W.ndist,W.distcode,0,W.work,et),W.distbits=et.bits,$e){e.msg=`invalid distances set`,W.mode=be;break}if(W.mode=20,R===6)break e;case 20:W.mode=21;case 21:if(Me>=6&&Pe>=258){e.next_out=Ae,e.avail_out=Pe,e.next_in=Oe,e.avail_in=Me,W.hold=Re,W.bits=Be,ae(e,He),Ae=e.next_out,Te=e.output,Pe=e.avail_out,Oe=e.next_in,Ce=e.input,Me=e.avail_in,Re=W.hold,Be=W.bits,W.mode===ye&&(W.back=-1);break}for(W.back=0;qe=(nt=W.lencode[Re&(1<<W.lenbits)-1])>>>16&255,Je=65535&nt,!((Ke=nt>>>24)<=Be);){if(Me===0)break e;Me--,Re+=Ce[Oe++]<<Be,Be+=8}if(qe&&!(240&qe)){for(Ye=Ke,Xe=qe,Ze=Je;qe=(nt=W.lencode[Ze+((Re&(1<<Ye+Xe)-1)>>Ye)])>>>16&255,Je=65535&nt,!(Ye+(Ke=nt>>>24)<=Be);){if(Me===0)break e;Me--,Re+=Ce[Oe++]<<Be,Be+=8}Re>>>=Ye,Be-=Ye,W.back+=Ye}if(Re>>>=Ke,Be-=Ke,W.back+=Ke,W.length=Je,qe===0){W.mode=26;break}if(32&qe){W.back=-1,W.mode=ye;break}if(64&qe){e.msg=`invalid literal/length code`,W.mode=be;break}W.extra=15&qe,W.mode=22;case 22:if(W.extra){for(tt=W.extra;Be<tt;){if(Me===0)break e;Me--,Re+=Ce[Oe++]<<Be,Be+=8}W.length+=Re&(1<<W.extra)-1,Re>>>=W.extra,Be-=W.extra,W.back+=W.extra}W.was=W.length,W.mode=23;case 23:for(;qe=(nt=W.distcode[Re&(1<<W.distbits)-1])>>>16&255,Je=65535&nt,!((Ke=nt>>>24)<=Be);){if(Me===0)break e;Me--,Re+=Ce[Oe++]<<Be,Be+=8}if(!(240&qe)){for(Ye=Ke,Xe=qe,Ze=Je;qe=(nt=W.distcode[Ze+((Re&(1<<Ye+Xe)-1)>>Ye)])>>>16&255,Je=65535&nt,!(Ye+(Ke=nt>>>24)<=Be);){if(Me===0)break e;Me--,Re+=Ce[Oe++]<<Be,Be+=8}Re>>>=Ye,Be-=Ye,W.back+=Ye}if(Re>>>=Ke,Be-=Ke,W.back+=Ke,64&qe){e.msg=`invalid distance code`,W.mode=be;break}W.offset=Je,W.extra=15&qe,W.mode=24;case 24:if(W.extra){for(tt=W.extra;Be<tt;){if(Me===0)break e;Me--,Re+=Ce[Oe++]<<Be,Be+=8}W.offset+=Re&(1<<W.extra)-1,Re>>>=W.extra,Be-=W.extra,W.back+=W.extra}if(W.offset>W.dmax){e.msg=`invalid distance too far back`,W.mode=be;break}W.mode=25;case 25:if(Pe===0)break e;if(Ue=He-Pe,W.offset>Ue){if((Ue=W.offset-Ue)>W.whave&&W.sane){e.msg=`invalid distance too far back`,W.mode=be;break}Ue>W.wnext?(Ue-=W.wnext,We=W.wsize-Ue):We=W.wnext-Ue,Ue>W.length&&(Ue=W.length),Ge=W.window}else Ge=Te,We=Ae-W.offset,Ue=W.length;Ue>Pe&&(Ue=Pe),Pe-=Ue,W.length-=Ue;do Te[Ae++]=Ge[We++];while(--Ue);W.length===0&&(W.mode=21);break;case 26:if(Pe===0)break e;Te[Ae++]=W.length,Pe--,W.mode=21;break;case 27:if(W.wrap){for(;Be<32;){if(Me===0)break e;Me--,Re|=Ce[Oe++]<<Be,Be+=8}if(He-=Pe,e.total_out+=He,W.total+=He,He&&(e.adler=W.check=W.flags?ie(W.check,Te,He,Ae-He):X(W.check,Te,He,Ae-He)),He=Pe,(W.flags?Re:g(Re))!==W.check){e.msg=`incorrect data check`,W.mode=be;break}Re=0,Be=0}W.mode=28;case 28:if(W.wrap&&W.flags){for(;Be<32;){if(Me===0)break e;Me--,Re+=Ce[Oe++]<<Be,Be+=8}if(Re!==(4294967295&W.total)){e.msg=`incorrect length check`,W.mode=be;break}Re=0,Be=0}W.mode=29;case 29:$e=1;break e;case be:$e=-3;break e;case 31:return-4;default:return _e}return e.next_out=Ae,e.avail_out=Pe,e.next_in=Oe,e.avail_in=Me,W.hold=Re,W.bits=Be,(W.wsize||He!==e.avail_out&&W.mode<be&&(W.mode<27||R!==4))&&Q(e,e.output,e.next_out,He-e.avail_out)?(W.mode=31,-4):(Ve-=e.avail_in,He-=e.avail_out,e.total_in+=Ve,e.total_out+=He,W.total+=He,W.wrap&&He&&(e.adler=W.check=W.flags?ie(W.check,Te,He,e.next_out-He):X(W.check,Te,He,e.next_out-He)),e.data_type=W.bits+(W.last?64:0)+(W.mode===ye?128:0)+(W.mode===20||W.mode===15?256:0),(Ve===0&&He===0||R===4)&&$e===0&&($e=-5),$e)},R.inflateEnd=function(e){if(!e||!e.state)return _e;var R=e.state;return R.window&&=null,e.state=null,0},R.inflateGetHeader=function(e,R){var W;return e&&e.state&&2&(W=e.state).wrap?(W.head=R,R.done=!1,0):_e},R.inflateSetDictionary=function(e,R){var W,Y=R.length;return e&&e.state?(W=e.state).wrap!==0&&W.mode!==11?_e:W.mode===11&&X(1,R,Y,0)!==W.check?-3:Q(e,R,Y,Y)?(W.mode=31,-4):(W.havedict=1,0):_e},R.inflateInfo=`pako inflate (from Nodeca project)`},665(e,R,W){var Y=W(805);function n(e){for(var R=e.length;--R>=0;)e[R]=0}var X=256,ie=286,ae=30,le=15,_e=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],ye=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],be=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Ce=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Te=Array(576);n(Te);var Oe=Array(60);n(Oe);var Ae=Array(512);n(Ae);var Me=Array(256);n(Me);var Pe=Array(29);n(Pe);var Re,Be,Ve,He=Array(ae);function m(e,R,W,Y,X){this.static_tree=e,this.extra_bits=R,this.extra_base=W,this.elems=Y,this.max_length=X,this.has_stree=e&&e.length}function y(e,R){this.dyn_tree=e,this.max_code=0,this.stat_desc=R}function w(e){return e<256?Ae[e]:Ae[256+(e>>>7)]}function _(e,R){e.pending_buf[e.pending++]=255&R,e.pending_buf[e.pending++]=R>>>8&255}function v(e,R,W){e.bi_valid>16-W?(e.bi_buf|=R<<e.bi_valid&65535,_(e,e.bi_buf),e.bi_buf=R>>16-e.bi_valid,e.bi_valid+=W-16):(e.bi_buf|=R<<e.bi_valid&65535,e.bi_valid+=W)}function b(e,R,W){v(e,W[2*R],W[2*R+1])}function k(e,R){var W=0;do W|=1&e,e>>>=1,W<<=1;while(--R>0);return W>>>1}function D(e,R,W){var Y,X,ie=Array(16),ae=0;for(Y=1;Y<=le;Y++)ie[Y]=ae=ae+W[Y-1]<<1;for(X=0;X<=R;X++){var _e=e[2*X+1];_e!==0&&(e[2*X]=k(ie[_e]++,_e))}}function S(e){var R;for(R=0;R<ie;R++)e.dyn_ltree[2*R]=0;for(R=0;R<ae;R++)e.dyn_dtree[2*R]=0;for(R=0;R<19;R++)e.bl_tree[2*R]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function x(e){e.bi_valid>8?_(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function z(e,R,W,Y){var X=2*R,ie=2*W;return e[X]<e[ie]||e[X]===e[ie]&&Y[R]<=Y[W]}function F(e,R,W){for(var Y=e.heap[W],X=W<<1;X<=e.heap_len&&(X<e.heap_len&&z(R,e.heap[X+1],e.heap[X],e.depth)&&X++,!z(R,Y,e.heap[X],e.depth));)e.heap[W]=e.heap[X],W=X,X<<=1;e.heap[W]=Y}function L(e,R,W){var Y,ie,ae,le,be=0;if(e.last_lit!==0)do Y=e.pending_buf[e.d_buf+2*be]<<8|e.pending_buf[e.d_buf+2*be+1],ie=e.pending_buf[e.l_buf+be],be++,Y===0?b(e,ie,R):(b(e,(ae=Me[ie])+X+1,R),(le=_e[ae])!==0&&v(e,ie-=Pe[ae],le),b(e,ae=w(--Y),W),(le=ye[ae])!==0&&v(e,Y-=He[ae],le));while(be<e.last_lit);b(e,256,R)}function N(e,R){var W,Y,X,ie=R.dyn_tree,ae=R.stat_desc.static_tree,_e=R.stat_desc.has_stree,ye=R.stat_desc.elems,be=-1;for(e.heap_len=0,e.heap_max=573,W=0;W<ye;W++)ie[2*W]===0?ie[2*W+1]=0:(e.heap[++e.heap_len]=be=W,e.depth[W]=0);for(;e.heap_len<2;)ie[2*(X=e.heap[++e.heap_len]=be<2?++be:0)]=1,e.depth[X]=0,e.opt_len--,_e&&(e.static_len-=ae[2*X+1]);for(R.max_code=be,W=e.heap_len>>1;W>=1;W--)F(e,ie,W);X=ye;do W=e.heap[1],e.heap[1]=e.heap[e.heap_len--],F(e,ie,1),Y=e.heap[1],e.heap[--e.heap_max]=W,e.heap[--e.heap_max]=Y,ie[2*X]=ie[2*W]+ie[2*Y],e.depth[X]=(e.depth[W]>=e.depth[Y]?e.depth[W]:e.depth[Y])+1,ie[2*W+1]=ie[2*Y+1]=X,e.heap[1]=X++,F(e,ie,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,R){var W,Y,X,ie,ae,_e,ye=R.dyn_tree,be=R.max_code,Ce=R.stat_desc.static_tree,Te=R.stat_desc.has_stree,Oe=R.stat_desc.extra_bits,Ae=R.stat_desc.extra_base,Me=R.stat_desc.max_length,Pe=0;for(ie=0;ie<=le;ie++)e.bl_count[ie]=0;for(ye[2*e.heap[e.heap_max]+1]=0,W=e.heap_max+1;W<573;W++)(ie=ye[2*ye[2*(Y=e.heap[W])+1]+1]+1)>Me&&(ie=Me,Pe++),ye[2*Y+1]=ie,Y>be||(e.bl_count[ie]++,ae=0,Y>=Ae&&(ae=Oe[Y-Ae]),_e=ye[2*Y],e.opt_len+=_e*(ie+ae),Te&&(e.static_len+=_e*(Ce[2*Y+1]+ae)));if(Pe!==0){do{for(ie=Me-1;e.bl_count[ie]===0;)ie--;e.bl_count[ie]--,e.bl_count[ie+1]+=2,e.bl_count[Me]--,Pe-=2}while(Pe>0);for(ie=Me;ie!==0;ie--)for(Y=e.bl_count[ie];Y!==0;)(X=e.heap[--W])>be||(ye[2*X+1]!==ie&&(e.opt_len+=(ie-ye[2*X+1])*ye[2*X],ye[2*X+1]=ie),Y--)}}(e,R),D(ie,be,e.bl_count)}function G(e,R,W){var Y,X,ie=-1,ae=R[1],le=0,_e=7,ye=4;for(ae===0&&(_e=138,ye=3),R[2*(W+1)+1]=65535,Y=0;Y<=W;Y++)X=ae,ae=R[2*(Y+1)+1],++le<_e&&X===ae||(le<ye?e.bl_tree[2*X]+=le:X===0?le<=10?e.bl_tree[34]++:e.bl_tree[36]++:(X!==ie&&e.bl_tree[2*X]++,e.bl_tree[32]++),le=0,ie=X,ae===0?(_e=138,ye=3):X===ae?(_e=6,ye=3):(_e=7,ye=4))}function T(e,R,W){var Y,X,ie=-1,ae=R[1],le=0,_e=7,ye=4;for(ae===0&&(_e=138,ye=3),Y=0;Y<=W;Y++)if(X=ae,ae=R[2*(Y+1)+1],!(++le<_e&&X===ae)){if(le<ye)do b(e,X,e.bl_tree);while(--le!=0);else X===0?le<=10?(b(e,17,e.bl_tree),v(e,le-3,3)):(b(e,18,e.bl_tree),v(e,le-11,7)):(X!==ie&&(b(e,X,e.bl_tree),le--),b(e,16,e.bl_tree),v(e,le-3,2));le=0,ie=X,ae===0?(_e=138,ye=3):X===ae?(_e=6,ye=3):(_e=7,ye=4)}}n(He);var Ue=!1;function M(e,R,W,X){v(e,0+ +!!X,3),function(e,R,W,X){x(e),X&&(_(e,W),_(e,~W)),Y.arraySet(e.pending_buf,e.window,R,W,e.pending),e.pending+=W}(e,R,W,!0)}R._tr_init=function(e){Ue||=(function(){var e,R,W,Y,X,Ce=Array(16);for(W=0,Y=0;Y<28;Y++)for(Pe[Y]=W,e=0;e<1<<_e[Y];e++)Me[W++]=Y;for(Me[W-1]=Y,X=0,Y=0;Y<16;Y++)for(He[Y]=X,e=0;e<1<<ye[Y];e++)Ae[X++]=Y;for(X>>=7;Y<ae;Y++)for(He[Y]=X<<7,e=0;e<1<<ye[Y]-7;e++)Ae[256+ X++]=Y;for(R=0;R<=le;R++)Ce[R]=0;for(e=0;e<=143;)Te[2*e+1]=8,e++,Ce[8]++;for(;e<=255;)Te[2*e+1]=9,e++,Ce[9]++;for(;e<=279;)Te[2*e+1]=7,e++,Ce[7]++;for(;e<=287;)Te[2*e+1]=8,e++,Ce[8]++;for(D(Te,287,Ce),e=0;e<ae;e++)Oe[2*e+1]=5,Oe[2*e]=k(e,5);Re=new m(Te,_e,257,ie,le),Be=new m(Oe,ye,0,ae,le),Ve=new m([],be,0,19,7)}(),!0),e.l_desc=new y(e.dyn_ltree,Re),e.d_desc=new y(e.dyn_dtree,Be),e.bl_desc=new y(e.bl_tree,Ve),e.bi_buf=0,e.bi_valid=0,S(e)},R._tr_stored_block=M,R._tr_flush_block=function(e,R,W,Y){var ie,ae,le=0;e.level>0?(e.strm.data_type===2&&(e.strm.data_type=function(e){var R,W=4093624447;for(R=0;R<=31;R++,W>>>=1)if(1&W&&e.dyn_ltree[2*R]!==0)return 0;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return 1;for(R=32;R<X;R++)if(e.dyn_ltree[2*R]!==0)return 1;return 0}(e)),N(e,e.l_desc),N(e,e.d_desc),le=function(e){var R;for(G(e,e.dyn_ltree,e.l_desc.max_code),G(e,e.dyn_dtree,e.d_desc.max_code),N(e,e.bl_desc),R=18;R>=3&&e.bl_tree[2*Ce[R]+1]===0;R--);return e.opt_len+=3*(R+1)+5+5+4,R}(e),ie=e.opt_len+3+7>>>3,(ae=e.static_len+3+7>>>3)<=ie&&(ie=ae)):ie=ae=W+5,W+4<=ie&&R!==-1?M(e,R,W,Y):e.strategy===4||ae===ie?(v(e,2+ +!!Y,3),L(e,Te,Oe)):(v(e,4+ +!!Y,3),function(e,R,W,Y){var X;for(v(e,R-257,5),v(e,W-1,5),v(e,Y-4,4),X=0;X<Y;X++)v(e,e.bl_tree[2*Ce[X]+1],3);T(e,e.dyn_ltree,R-1),T(e,e.dyn_dtree,W-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,le+1),L(e,e.dyn_ltree,e.dyn_dtree)),S(e),Y&&x(e)},R._tr_tally=function(e,R,W){return e.pending_buf[e.d_buf+2*e.last_lit]=R>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&R,e.pending_buf[e.l_buf+e.last_lit]=255&W,e.last_lit++,R===0?e.dyn_ltree[2*W]++:(e.matches++,R--,e.dyn_ltree[2*(Me[W]+X+1)]++,e.dyn_dtree[2*w(R)]++),e.last_lit===e.lit_bufsize-1},R._tr_align=function(e){v(e,2,3),b(e,256,Te),function(e){e.bi_valid===16?(_(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},668(e,R,W){var Y={};(0,W(805).assign)(Y,W(303),W(83),W(681)),e.exports=Y},674(e){e.exports={2:`need dictionary`,1:`stream end`,0:``,"-1":`file error`,"-2":`stream error`,"-3":`data error`,"-4":`insufficient memory`,"-5":`buffer error`,"-6":`incompatible version`}},681(e){e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},805(e,R){var W=typeof Uint8Array<`u`&&typeof Uint16Array<`u`&&typeof Int32Array<`u`;function i(e,R){return Object.prototype.hasOwnProperty.call(e,R)}R.assign=function(e){for(var R=Array.prototype.slice.call(arguments,1);R.length;){var W=R.shift();if(W){if(typeof W!=`object`)throw TypeError(W+`must be non-object`);for(var Y in W)i(W,Y)&&(e[Y]=W[Y])}}return e},R.shrinkBuf=function(e,R){return e.length===R?e:e.subarray?e.subarray(0,R):(e.length=R,e)};var Y={arraySet:function(e,R,W,Y,X){if(R.subarray&&e.subarray)e.set(R.subarray(W,W+Y),X);else for(var ie=0;ie<Y;ie++)e[X+ie]=R[W+ie]},flattenChunks:function(e){var R,W,Y,X,ie,ae;for(Y=0,R=0,W=e.length;R<W;R++)Y+=e[R].length;for(ae=new Uint8Array(Y),X=0,R=0,W=e.length;R<W;R++)ie=e[R],ae.set(ie,X),X+=ie.length;return ae}},X={arraySet:function(e,R,W,Y,X){for(var ie=0;ie<Y;ie++)e[X+ie]=R[W+ie]},flattenChunks:function(e){return[].concat.apply([],e)}};R.setTyped=function(e){e?(R.Buf8=Uint8Array,R.Buf16=Uint16Array,R.Buf32=Int32Array,R.assign(R,Y)):(R.Buf8=Array,R.Buf16=Array,R.Buf32=Array,R.assign(R,X))},R.setTyped(W)},823(e){var R=function(){for(var e,R=[],W=0;W<256;W++){e=W;for(var Y=0;Y<8;Y++)e=1&e?3988292384^e>>>1:e>>>1;R[W]=e}return R}();e.exports=function(e,W,Y,X){var ie=R,ae=X+Y;e^=-1;for(var le=X;le<ae;le++)e=e>>>8^ie[255&(e^W[le])];return~e}},996(e,R,W){var Y=W(805),X=!0,ie=!0;try{String.fromCharCode.apply(null,[0])}catch{X=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{ie=!1}for(var ae=new Y.Buf8(256),le=0;le<256;le++)ae[le]=le>=252?6:le>=248?5:le>=240?4:le>=224?3:le>=192?2:1;function a(e,R){if(R<65534&&(e.subarray&&ie||!e.subarray&&X))return String.fromCharCode.apply(null,Y.shrinkBuf(e,R));for(var W=``,ae=0;ae<R;ae++)W+=String.fromCharCode(e[ae]);return W}ae[254]=ae[254]=1,R.string2buf=function(e){var R,W,X,ie,ae,le=e.length,_e=0;for(ie=0;ie<le;ie++)(64512&(W=e.charCodeAt(ie)))==55296&&ie+1<le&&(64512&(X=e.charCodeAt(ie+1)))==56320&&(W=65536+(W-55296<<10)+(X-56320),ie++),_e+=W<128?1:W<2048?2:W<65536?3:4;for(R=new Y.Buf8(_e),ae=0,ie=0;ae<_e;ie++)(64512&(W=e.charCodeAt(ie)))==55296&&ie+1<le&&(64512&(X=e.charCodeAt(ie+1)))==56320&&(W=65536+(W-55296<<10)+(X-56320),ie++),W<128?R[ae++]=W:W<2048?(R[ae++]=192|W>>>6,R[ae++]=128|63&W):W<65536?(R[ae++]=224|W>>>12,R[ae++]=128|W>>>6&63,R[ae++]=128|63&W):(R[ae++]=240|W>>>18,R[ae++]=128|W>>>12&63,R[ae++]=128|W>>>6&63,R[ae++]=128|63&W);return R},R.buf2binstring=function(e){return a(e,e.length)},R.binstring2buf=function(e){for(var R=new Y.Buf8(e.length),W=0,X=R.length;W<X;W++)R[W]=e.charCodeAt(W);return R},R.buf2string=function(e,R){var W,Y,X,ie,le=R||e.length,_e=Array(2*le);for(Y=0,W=0;W<le;)if((X=e[W++])<128)_e[Y++]=X;else if((ie=ae[X])>4)_e[Y++]=65533,W+=ie-1;else{for(X&=ie===2?31:ie===3?15:7;ie>1&&W<le;)X=X<<6|63&e[W++],ie--;ie>1?_e[Y++]=65533:X<65536?_e[Y++]=X:(X-=65536,_e[Y++]=55296|X>>10&1023,_e[Y++]=56320|1023&X)}return a(_e,Y)},R.utf8border=function(e,R){var W;for((R||=e.length)>e.length&&(R=e.length),W=R-1;W>=0&&(192&e[W])==128;)W--;return W<0||W===0?R:W+ae[e[W]]>R?W:R}},998(e,R,W){var Y=W(805),X=15,ie=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],ae=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],le=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],_e=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function(e,R,W,ye,be,Ce,Te,Oe){var Ae,Me,Pe,Re,Be,Ve,He,Ue,We,Ge=Oe.bits,Ke=0,qe=0,Je=0,Ye=0,Xe=0,Ze=0,Qe=0,$e=0,et=0,tt=0,nt=null,rt=0,it=new Y.Buf16(16),at=new Y.Buf16(16),st=null,ct=0;for(Ke=0;Ke<=X;Ke++)it[Ke]=0;for(qe=0;qe<ye;qe++)it[R[W+qe]]++;for(Xe=Ge,Ye=X;Ye>=1&&it[Ye]===0;Ye--);if(Xe>Ye&&(Xe=Ye),Ye===0)return be[Ce++]=20971520,be[Ce++]=20971520,Oe.bits=1,0;for(Je=1;Je<Ye&&it[Je]===0;Je++);for(Xe<Je&&(Xe=Je),$e=1,Ke=1;Ke<=X;Ke++)if($e<<=1,($e-=it[Ke])<0)return-1;if($e>0&&(e===0||Ye!==1))return-1;for(at[1]=0,Ke=1;Ke<X;Ke++)at[Ke+1]=at[Ke]+it[Ke];for(qe=0;qe<ye;qe++)R[W+qe]!==0&&(Te[at[R[W+qe]]++]=qe);if(e===0?(nt=st=Te,Ve=19):e===1?(nt=ie,rt-=257,st=ae,ct-=257,Ve=256):(nt=le,st=_e,Ve=-1),tt=0,qe=0,Ke=Je,Be=Ce,Ze=Xe,Qe=0,Pe=-1,Re=(et=1<<Xe)-1,e===1&&et>852||e===2&&et>592)return 1;for(;;){He=Ke-Qe,Te[qe]<Ve?(Ue=0,We=Te[qe]):Te[qe]>Ve?(Ue=st[ct+Te[qe]],We=nt[rt+Te[qe]]):(Ue=96,We=0),Ae=1<<Ke-Qe,Je=Me=1<<Ze;do be[Be+(tt>>Qe)+(Me-=Ae)]=He<<24|Ue<<16|We;while(Me!==0);for(Ae=1<<Ke-1;tt&Ae;)Ae>>=1;if(Ae===0?tt=0:(tt&=Ae-1,tt+=Ae),qe++,--it[Ke]==0){if(Ke===Ye)break;Ke=R[W+Te[qe]]}if(Ke>Xe&&(tt&Re)!==Pe){for(Qe===0&&(Qe=Xe),Be+=Je,$e=1<<(Ze=Ke-Qe);Ze+Qe<Ye&&!(($e-=it[Ze+Qe])<=0);)Ze++,$e<<=1;if(et+=1<<Ze,e===1&&et>852||e===2&&et>592)return 1;be[Pe=tt&Re]=Xe<<24|Ze<<16|Be-Ce}}return tt!==0&&(be[Be+tt]=Ke-Qe<<24|64<<16),Oe.bits=Xe,0}}},Oa={};function S(e){var R=Oa[e];if(R!==void 0)return R.exports;var W=Oa[e]={exports:{}};return Da[e](W,W.exports,S),W.exports}S.d=(e,R)=>{for(var W in R)S.o(R,W)&&!S.o(e,W)&&Object.defineProperty(e,W,{enumerable:!0,get:R[W]})},S.o=(e,R)=>Object.prototype.hasOwnProperty.call(e,R),S.r=e=>{typeof Symbol<`u`&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:`Module`}),Object.defineProperty(e,"__esModule",{value:!0})};var Aa={};S.r(Aa),S.d(Aa,{base64:()=>Bs,base64url:()=>Hs,bigint:()=>ec,boolean:()=>sc,browserEmail:()=>js,cidrv4:()=>Is,cidrv6:()=>zs,cuid:()=>ss,cuid2:()=>cs,date:()=>$s,datetime:()=>ft,domain:()=>Ws,duration:()=>ps,e164:()=>Xs,email:()=>bs,emoji:()=>At,extendedDuration:()=>ms,guid:()=>hs,hex:()=>Hc,hostname:()=>Us,html5Email:()=>Cs,idnEmail:()=>As,integer:()=>tc,ipv4:()=>Ms,ipv6:()=>Ns,ksuid:()=>ds,lowercase:()=>Ac,mac:()=>ot,md5_base64:()=>nl,md5_base64url:()=>sl,md5_hex:()=>el,nanoid:()=>fs,null:()=>uc,number:()=>nc,rfc5322Email:()=>Ts,sha1_base64:()=>ml,sha1_base64url:()=>_l,sha1_hex:()=>fl,sha256_base64:()=>yl,sha256_base64url:()=>bl,sha256_hex:()=>vl,sha384_base64:()=>Sl,sha384_base64url:()=>Cl,sha384_hex:()=>xl,sha512_base64:()=>Tl,sha512_base64url:()=>El,sha512_hex:()=>wl,string:()=>Bt,time:()=>pt,ulid:()=>ls,undefined:()=>hc,unicodeEmail:()=>Es,uppercase:()=>Ic,uuid:()=>je,uuid4:()=>gs,uuid6:()=>_s,uuid7:()=>ys,xid:()=>us});var Pa={};S.r(Pa),S.d(Pa,{endsWith:()=>Pn,gt:()=>Sn,gte:()=>xn,includes:()=>Yn,length:()=>Jn,lowercase:()=>qn,lt:()=>kn,lte:()=>Dn,maxLength:()=>On,maxSize:()=>Tn,mime:()=>Kn,minLength:()=>Un,minSize:()=>Rn,multipleOf:()=>Gn,negative:()=>Fn,nonnegative:()=>Nn,nonpositive:()=>Ln,normalize:()=>Vn,overwrite:()=>Wn,positive:()=>zn,property:()=>$n,regex:()=>Zn,size:()=>Mn,slugify:()=>Ao,startsWith:()=>Hn,toLowerCase:()=>eo,toUpperCase:()=>to,trim:()=>Xn,uppercase:()=>jn});var La={};S.r(La),S.d(La,{ZodISODate:()=>kd,ZodISODateTime:()=>Od,ZodISODuration:()=>jd,ZodISOTime:()=>Ad,date:()=>Xo,datetime:()=>Wo,duration:()=>is,time:()=>ts});var Ra={};S.r(Ra),S.d(Ra,{ZodAny:()=>Tf,ZodArray:()=>Af,ZodBase64:()=>ff,ZodBase64URL:()=>pf,ZodBigInt:()=>bf,ZodBigIntFormat:()=>xf,ZodBoolean:()=>yf,ZodCIDRv4:()=>uf,ZodCIDRv6:()=>df,ZodCUID:()=>tf,ZodCUID2:()=>nf,ZodCatch:()=>Xf,ZodCodec:()=>$f,ZodCustom:()=>ap,ZodCustomStringFormat:()=>gf,ZodDate:()=>kf,ZodDefault:()=>Kf,ZodDiscriminatedUnion:()=>Pf,ZodE164:()=>mf,ZodEmail:()=>Yd,ZodEmoji:()=>$d,ZodEnum:()=>Bf,ZodFile:()=>Hf,ZodFunction:()=>ip,ZodGUID:()=>Xd,ZodIPv4:()=>sf,ZodIPv6:()=>lf,ZodIntersection:()=>Ff,ZodJWT:()=>hf,ZodKSUID:()=>of,ZodLazy:()=>np,ZodLiteral:()=>Vf,ZodMAC:()=>cf,ZodMap:()=>Rf,ZodNaN:()=>Zf,ZodNanoID:()=>ef,ZodNever:()=>Df,ZodNonOptional:()=>Jf,ZodNull:()=>wf,ZodNullable:()=>Gf,ZodNumber:()=>_f,ZodNumberFormat:()=>vf,ZodObject:()=>jf,ZodOptional:()=>Wf,ZodPipe:()=>Qf,ZodPrefault:()=>qf,ZodPromise:()=>rp,ZodReadonly:()=>ep,ZodRecord:()=>Lf,ZodSet:()=>zf,ZodString:()=>qd,ZodStringFormat:()=>Jd,ZodSuccess:()=>Yf,ZodSymbol:()=>Sf,ZodTemplateLiteral:()=>tp,ZodTransform:()=>Uf,ZodTuple:()=>If,ZodType:()=>Gd,ZodULID:()=>rf,ZodURL:()=>Qd,ZodUUID:()=>Zd,ZodUndefined:()=>Cf,ZodUnion:()=>Mf,ZodUnknown:()=>Ef,ZodVoid:()=>Of,ZodXID:()=>af,ZodXor:()=>Nf,_ZodString:()=>Kd,_default:()=>Na,_function:()=>ol,any:()=>Or,array:()=>Kr,base64:()=>sr,base64url:()=>ar,bigint:()=>Dr,boolean:()=>br,catch:()=>Za,check:()=>rl,cidrv4:()=>Ar,cidrv6:()=>nr,codec:()=>$a,cuid:()=>Os,cuid2:()=>Js,custom:()=>al,date:()=>Pr,describe:()=>gl,discriminatedUnion:()=>ra,e164:()=>cr,email:()=>ws,emoji:()=>Gs,enum:()=>Qa,file:()=>va,float32:()=>mr,float64:()=>yr,function:()=>ol,guid:()=>vs,hash:()=>fr,hex:()=>pr,hostname:()=>Ir,httpUrl:()=>Ls,instanceof:()=>hl,int:()=>Qr,int32:()=>wr,int64:()=>xr,intersection:()=>la,ipv4:()=>Ks,ipv6:()=>er,json:()=>Il,jwt:()=>dr,keyof:()=>Wr,ksuid:()=>Ps,lazy:()=>tl,literal:()=>wa,looseObject:()=>ta,looseRecord:()=>Ia,mac:()=>Vs,map:()=>fa,meta:()=>dl,nan:()=>ja,nanoid:()=>Rs,nativeEnum:()=>ma,never:()=>qr,nonoptional:()=>Ma,null:()=>Rr,nullable:()=>za,nullish:()=>Fa,number:()=>Cr,object:()=>Xr,optional:()=>Sa,partialRecord:()=>ua,pipe:()=>Ha,prefault:()=>Ta,preprocess:()=>pl,promise:()=>il,readonly:()=>Wa,record:()=>ha,refine:()=>ll,set:()=>Ca,strictObject:()=>ea,string:()=>Qs,stringFormat:()=>ur,stringbool:()=>ul,success:()=>Ua,superRefine:()=>cl,symbol:()=>Lr,templateLiteral:()=>Xa,transform:()=>ka,tuple:()=>ga,uint32:()=>_r,uint64:()=>zr,ulid:()=>qs,undefined:()=>Gr,union:()=>ia,unknown:()=>Jr,url:()=>Fs,uuid:()=>ks,uuidv4:()=>Ds,uuidv6:()=>Ss,uuidv7:()=>xs,void:()=>Yr,xid:()=>Ys,xor:()=>oa}),Object.freeze({status:`aborted`});function N(e,R,W){function i(W,Y){if(W._zod||Object.defineProperty(W,"_zod",{value:{def:Y,constr:s,traits:new Set},enumerable:!1}),W._zod.traits.has(e))return;W._zod.traits.add(e),R(W,Y);let X=s.prototype,ie=Object.keys(X);for(let e=0;e<ie.length;e++){let R=ie[e];R in W||(W[R]=X[R].bind(W))}}let Y=W?.Parent??Object;class o extends Y{}function s(e){var R;let Y=W?.Parent?new o:this;i(Y,e),(R=Y._zod).deferred??(R.deferred=[]);for(let e of Y._zod.deferred)e();return Y}return Object.defineProperty(o,"name",{value:e}),Object.defineProperty(s,"init",{value:i}),Object.defineProperty(s,Symbol.hasInstance,{value:R=>!!(W?.Parent&&R instanceof W.Parent)||R?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}var G=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},T=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};const Ba={};function M(e){return e&&Object.assign(Ba,e),Ba}function O(e){let R=Object.values(e).filter((e=>typeof e==`number`));return Object.entries(e).filter((([e,W])=>R.indexOf(+e)===-1)).map((([e,R])=>R))}function U(e,R=`|`){return e.map((e=>re(e))).join(R)}function J(e,R){return typeof R==`bigint`?R.toString():R}function Z(e){return{get value(){{let R=e();return Object.defineProperty(this,"value",{value:R}),R}}}}function q(e){return e==null}function j(e){let R=+!!e.startsWith(`^`),W=e.endsWith(`$`)?e.length-1:e.length;return e.slice(R,W)}const Va=Symbol(`evaluating`);function H(e,R,W){let Y;Object.defineProperty(e,R,{get(){if(Y!==Va)return Y===void 0&&(Y=Va,Y=W()),Y},set(W){Object.defineProperty(e,R,{value:W})},configurable:!0})}function P(e,R,W){Object.defineProperty(e,R,{value:W,writable:!0,enumerable:!0,configurable:!0})}function $(...e){let R={};for(let W of e)Object.assign(R,Object.getOwnPropertyDescriptors(W));return Object.defineProperties({},R)}function K(e){return JSON.stringify(e)}const Ga=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function V(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}const Ka=Z((()=>{if(typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}}));function ee(e){if(!1===V(e))return!1;let R=e.constructor;if(R===void 0||typeof R!=`function`)return!0;let W=R.prototype;return!1!==V(W)&&!1!==Object.prototype.hasOwnProperty.call(W,`isPrototypeOf`)}function te(e){return ee(e)?{...e}:Array.isArray(e)?[...e]:e}const qa=new Set([`string`,`number`,`symbol`]),Ja=new Set([`string`,`number`,`bigint`,`boolean`,`symbol`,`undefined`]);function ne(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function oe(e,R,W){let Y=new e._zod.constr(R??e._zod.def);return R&&!W?.parent||(Y._zod.parent=e),Y}function se(e){let R=e;if(!R)return{};if(typeof R==`string`)return{error:()=>R};if(R?.message!==void 0){if(R?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");R.error=R.message}return delete R.message,typeof R.error==`string`?{...R,error:()=>R.error}:R}function re(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}const Ya={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},go={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function ce(e,R=0){if(!0===e.aborted)return!0;for(let W=R;W<e.issues.length;W++)if(!0!==e.issues[W]?.continue)return!0;return!1}function ge(e,R){return R.map((R=>{var W;return(W=R).path??(W.path=[]),R.path.unshift(e),R}))}function de(e){return typeof e==`string`?e:e?.message}function he(e,R,W){let Y={...e,path:e.path??[]};return e.message||(Y.message=de(e.inst?._zod.def?.error?.(e))??de(R?.error?.(e))??de(W.customError?.(e))??de(W.localeError?.(e))??`Invalid input`),delete Y.inst,delete Y.continue,R?.reportInput||delete Y.input,Y}function ue(e){return e instanceof Set?`set`:e instanceof Map?`map`:e instanceof File?`file`:`unknown`}function Ie(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function pe(...e){let[R,W,Y]=e;return typeof R==`string`?{message:R,code:`custom`,input:W,inst:Y}:{...R}}const fe=(e,R)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:R,enumerable:!1}),e.message=JSON.stringify(R,J,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Vo=N(`$ZodError`,fe),Ko=N(`$ZodError`,fe,{Parent:Error}),Ee=e=>(R,W,Y,X)=>{let ie=Y?Object.assign(Y,{async:!1}):{async:!1},ae=R._zod.run({value:W,issues:[]},ie);if(ae instanceof Promise)throw new G;if(ae.issues.length){let R=new(X?.Err??e)(ae.issues.map((e=>he(e,ie,M()))));throw Ga(R,X?.callee),R}return ae.value},es=Ee(Ko),me=e=>async(R,W,Y,X)=>{let ie=Y?Object.assign(Y,{async:!0}):{async:!0},ae=R._zod.run({value:W,issues:[]},ie);if(ae instanceof Promise&&(ae=await ae),ae.issues.length){let R=new(X?.Err??e)(ae.issues.map((e=>he(e,ie,M()))));throw Ga(R,X?.callee),R}return ae.value},rs=me(Ko),we=e=>(R,W,Y)=>{let X=Y?{...Y,async:!1}:{async:!1},ie=R._zod.run({value:W,issues:[]},X);if(ie instanceof Promise)throw new G;return ie.issues.length?{success:!1,error:new(e??Vo)(ie.issues.map((e=>he(e,X,M()))))}:{success:!0,data:ie.value}},as=we(Ko),ve=e=>async(R,W,Y)=>{let X=Y?Object.assign(Y,{async:!0}):{async:!0},ie=R._zod.run({value:W,issues:[]},X);return ie instanceof Promise&&(ie=await ie),ie.issues.length?{success:!1,error:new e(ie.issues.map((e=>he(e,X,M()))))}:{success:!0,data:ie.value}},os=ve(Ko),ke=e=>(R,W,Y)=>{let X=Y?Object.assign(Y,{direction:`backward`}):{direction:`backward`};return Ee(e)(R,W,X)},De=e=>(R,W,Y)=>Ee(e)(R,W,Y),Se=e=>async(R,W,Y)=>{let X=Y?Object.assign(Y,{direction:`backward`}):{direction:`backward`};return me(e)(R,W,X)},xe=e=>async(R,W,Y)=>me(e)(R,W,Y),ze=e=>(R,W,Y)=>{let X=Y?Object.assign(Y,{direction:`backward`}):{direction:`backward`};return we(e)(R,W,X)},Fe=e=>(R,W,Y)=>we(e)(R,W,Y),Le=e=>async(R,W,Y)=>{let X=Y?Object.assign(Y,{direction:`backward`}):{direction:`backward`};return ve(e)(R,W,X)},Ne=e=>async(R,W,Y)=>ve(e)(R,W,Y),ss=/^[cC][^\s-]{8,}$/,cs=/^[0-9a-z]+$/,ls=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,us=/^[0-9a-vA-V]{20}$/,ds=/^[A-Za-z0-9]{27}$/,fs=/^[a-zA-Z0-9_-]{21}$/,ps=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,ms=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,hs=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,je=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,gs=je(4),_s=je(6),ys=je(7),bs=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Cs=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Ts=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,Es=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,As=Es,js=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;function At(){return RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`)}const Ms=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Ns=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{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[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,$s=RegExp(`^${Zs}$`);function It(e){let R=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${R}`:e.precision===0?`${R}:[0-5]\\d`:`${R}:[0-5]\\d\\.\\d{${e.precision}}`:`${R}(?::[0-5]\\d(?:\\.\\d+)?)?`}function pt(e){return RegExp(`^${It(e)}$`)}function ft(e){let R=It({precision:e.precision}),W=[`Z`];e.local&&W.push(``),e.offset&&W.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let Y=`${R}(?:${W.join(`|`)})`;return RegExp(`^${Zs}T(?:${Y})$`)}const Bt=e=>RegExp(`^${e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`}$`),ec=/^-?\d+n?$/,tc=/^-?\d+$/,nc=/^-?\d+(?:\.\d+)?/,sc=/^(?:true|false)$/i,uc=/^null$/i,hc=/^undefined$/i,Ac=/^[^A-Z]*$/,Ic=/^[^a-z]*$/,Hc=/^[0-9a-fA-F]*$/;function kt(e,R){return RegExp(`^[A-Za-z0-9+/]{${e}}${R}$`)}function Dt(e){return RegExp(`^[A-Za-z0-9_-]{${e}}$`)}const el=/^[0-9a-fA-F]{32}$/,nl=kt(22,`==`),sl=Dt(22),fl=/^[0-9a-fA-F]{40}$/,ml=kt(27,`=`),_l=Dt(27),vl=/^[0-9a-fA-F]{64}$/,yl=kt(43,`=`),bl=Dt(43),xl=/^[0-9a-fA-F]{96}$/,Sl=kt(64,``),Cl=Dt(64),wl=/^[0-9a-fA-F]{128}$/,Tl=kt(86,`==`),El=Dt(86),Al=N(`$ZodCheck`,((e,R)=>{var W;e._zod??={},e._zod.def=R,(W=e._zod).onattach??(W.onattach=[])})),jl={number:`number`,bigint:`bigint`,object:`date`},Ml=N(`$ZodCheckLessThan`,((e,R)=>{Al.init(e,R);let W=jl[typeof R.value];e._zod.onattach.push((e=>{let W=e._zod.bag,Y=(R.inclusive?W.maximum:W.exclusiveMaximum)??1/0;R.value<Y&&(R.inclusive?W.maximum=R.value:W.exclusiveMaximum=R.value)})),e._zod.check=Y=>{(R.inclusive?Y.value<=R.value:Y.value<R.value)||Y.issues.push({origin:W,code:`too_big`,maximum:R.value,input:Y.value,inclusive:R.inclusive,inst:e,continue:!R.abort})}})),Nl=N(`$ZodCheckGreaterThan`,((e,R)=>{Al.init(e,R);let W=jl[typeof R.value];e._zod.onattach.push((e=>{let W=e._zod.bag,Y=(R.inclusive?W.minimum:W.exclusiveMinimum)??-1/0;R.value>Y&&(R.inclusive?W.minimum=R.value:W.exclusiveMinimum=R.value)})),e._zod.check=Y=>{(R.inclusive?Y.value>=R.value:Y.value>R.value)||Y.issues.push({origin:W,code:`too_small`,minimum:R.value,input:Y.value,inclusive:R.inclusive,inst:e,continue:!R.abort})}})),Fl=N(`$ZodCheckMultipleOf`,((e,R)=>{Al.init(e,R),e._zod.onattach.push((e=>{var W;(W=e._zod.bag).multipleOf??(W.multipleOf=R.value)})),e._zod.check=W=>{if(typeof W.value!=typeof R.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof W.value==`bigint`?W.value%R.value===BigInt(0):function(e,R){let W=(e.toString().split(`.`)[1]||``).length,Y=R.toString(),X=(Y.split(`.`)[1]||``).length;if(X===0&&/\d?e-\d?/.test(Y)){let e=Y.match(/\d?e-(\d?)/);e?.[1]&&(X=Number.parseInt(e[1]))}let ie=W>X?W:X;return Number.parseInt(e.toFixed(ie).replace(`.`,``))%Number.parseInt(R.toFixed(ie).replace(`.`,``))/10**ie}(W.value,R.value)===0)||W.issues.push({origin:typeof W.value,code:`not_multiple_of`,divisor:R.value,input:W.value,inst:e,continue:!R.abort})}})),Ll=N(`$ZodCheckNumberFormat`,((e,R)=>{Al.init(e,R),R.format=R.format||`float64`;let W=R.format?.includes(`int`),Y=W?`int`:`number`,[X,ie]=Ya[R.format];e._zod.onattach.push((e=>{let Y=e._zod.bag;Y.format=R.format,Y.minimum=X,Y.maximum=ie,W&&(Y.pattern=tc)})),e._zod.check=ae=>{let le=ae.value;if(W){if(!Number.isInteger(le))return void ae.issues.push({expected:Y,format:R.format,code:`invalid_type`,continue:!1,input:le,inst:e});if(!Number.isSafeInteger(le))return void(le>0?ae.issues.push({input:le,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:Y,continue:!R.abort}):ae.issues.push({input:le,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:Y,continue:!R.abort}))}le<X&&ae.issues.push({origin:`number`,input:le,code:`too_small`,minimum:X,inclusive:!0,inst:e,continue:!R.abort}),le>ie&&ae.issues.push({origin:`number`,input:le,code:`too_big`,maximum:ie,inst:e})}})),Rl=N(`$ZodCheckBigIntFormat`,((e,R)=>{Al.init(e,R);let[W,Y]=go[R.format];e._zod.onattach.push((e=>{let X=e._zod.bag;X.format=R.format,X.minimum=W,X.maximum=Y})),e._zod.check=X=>{let ie=X.value;ie<W&&X.issues.push({origin:`bigint`,input:ie,code:`too_small`,minimum:W,inclusive:!0,inst:e,continue:!R.abort}),ie>Y&&X.issues.push({origin:`bigint`,input:ie,code:`too_big`,maximum:Y,inst:e})}})),zl=N(`$ZodCheckMaxSize`,((e,R)=>{var W;Al.init(e,R),(W=e._zod.def).when??(W.when=e=>{let R=e.value;return!q(R)&&R.size!==void 0}),e._zod.onattach.push((e=>{let W=e._zod.bag.maximum??1/0;R.maximum<W&&(e._zod.bag.maximum=R.maximum)})),e._zod.check=W=>{let Y=W.value;Y.size<=R.maximum||W.issues.push({origin:ue(Y),code:`too_big`,maximum:R.maximum,inclusive:!0,input:Y,inst:e,continue:!R.abort})}})),Bl=N(`$ZodCheckMinSize`,((e,R)=>{var W;Al.init(e,R),(W=e._zod.def).when??(W.when=e=>{let R=e.value;return!q(R)&&R.size!==void 0}),e._zod.onattach.push((e=>{let W=e._zod.bag.minimum??-1/0;R.minimum>W&&(e._zod.bag.minimum=R.minimum)})),e._zod.check=W=>{let Y=W.value;Y.size>=R.minimum||W.issues.push({origin:ue(Y),code:`too_small`,minimum:R.minimum,inclusive:!0,input:Y,inst:e,continue:!R.abort})}})),Vl=N(`$ZodCheckSizeEquals`,((e,R)=>{var W;Al.init(e,R),(W=e._zod.def).when??(W.when=e=>{let R=e.value;return!q(R)&&R.size!==void 0}),e._zod.onattach.push((e=>{let W=e._zod.bag;W.minimum=R.size,W.maximum=R.size,W.size=R.size})),e._zod.check=W=>{let Y=W.value,X=Y.size;if(X===R.size)return;let ie=X>R.size;W.issues.push({origin:ue(Y),...ie?{code:`too_big`,maximum:R.size}:{code:`too_small`,minimum:R.size},inclusive:!0,exact:!0,input:W.value,inst:e,continue:!R.abort})}})),Gl=N(`$ZodCheckMaxLength`,((e,R)=>{var W;Al.init(e,R),(W=e._zod.def).when??(W.when=e=>{let R=e.value;return!q(R)&&R.length!==void 0}),e._zod.onattach.push((e=>{let W=e._zod.bag.maximum??1/0;R.maximum<W&&(e._zod.bag.maximum=R.maximum)})),e._zod.check=W=>{let Y=W.value;if(Y.length<=R.maximum)return;let X=Ie(Y);W.issues.push({origin:X,code:`too_big`,maximum:R.maximum,inclusive:!0,input:Y,inst:e,continue:!R.abort})}})),ql=N(`$ZodCheckMinLength`,((e,R)=>{var W;Al.init(e,R),(W=e._zod.def).when??(W.when=e=>{let R=e.value;return!q(R)&&R.length!==void 0}),e._zod.onattach.push((e=>{let W=e._zod.bag.minimum??-1/0;R.minimum>W&&(e._zod.bag.minimum=R.minimum)})),e._zod.check=W=>{let Y=W.value;if(Y.length>=R.minimum)return;let X=Ie(Y);W.issues.push({origin:X,code:`too_small`,minimum:R.minimum,inclusive:!0,input:Y,inst:e,continue:!R.abort})}})),Jl=N(`$ZodCheckLengthEquals`,((e,R)=>{var W;Al.init(e,R),(W=e._zod.def).when??(W.when=e=>{let R=e.value;return!q(R)&&R.length!==void 0}),e._zod.onattach.push((e=>{let W=e._zod.bag;W.minimum=R.length,W.maximum=R.length,W.length=R.length})),e._zod.check=W=>{let Y=W.value,X=Y.length;if(X===R.length)return;let ie=Ie(Y),ae=X>R.length;W.issues.push({origin:ie,...ae?{code:`too_big`,maximum:R.length}:{code:`too_small`,minimum:R.length},inclusive:!0,exact:!0,input:W.value,inst:e,continue:!R.abort})}})),Yl=N(`$ZodCheckStringFormat`,((e,R)=>{var W,Y;Al.init(e,R),e._zod.onattach.push((e=>{let W=e._zod.bag;W.format=R.format,R.pattern&&(W.patterns??=new Set,W.patterns.add(R.pattern))})),R.pattern?(W=e._zod).check??(W.check=W=>{R.pattern.lastIndex=0,R.pattern.test(W.value)||W.issues.push({origin:`string`,code:`invalid_format`,format:R.format,input:W.value,...R.pattern?{pattern:R.pattern.toString()}:{},inst:e,continue:!R.abort})}):(Y=e._zod).check??(Y.check=()=>{})})),Xl=N(`$ZodCheckRegex`,((e,R)=>{Yl.init(e,R),e._zod.check=W=>{R.pattern.lastIndex=0,R.pattern.test(W.value)||W.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:W.value,pattern:R.pattern.toString(),inst:e,continue:!R.abort})}})),Zl=N(`$ZodCheckLowerCase`,((e,R)=>{R.pattern??=Ac,Yl.init(e,R)})),Ql=N(`$ZodCheckUpperCase`,((e,R)=>{R.pattern??=Ic,Yl.init(e,R)})),eu=N(`$ZodCheckIncludes`,((e,R)=>{Al.init(e,R);let W=ne(R.includes),Y=new RegExp(typeof R.position==`number`?`^.{${R.position}}${W}`:W);R.pattern=Y,e._zod.onattach.push((e=>{let R=e._zod.bag;R.patterns??=new Set,R.patterns.add(Y)})),e._zod.check=W=>{W.value.includes(R.includes,R.position)||W.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:R.includes,input:W.value,inst:e,continue:!R.abort})}})),tu=N(`$ZodCheckStartsWith`,((e,R)=>{Al.init(e,R);let W=RegExp(`^${ne(R.prefix)}.*`);R.pattern??=W,e._zod.onattach.push((e=>{let R=e._zod.bag;R.patterns??=new Set,R.patterns.add(W)})),e._zod.check=W=>{W.value.startsWith(R.prefix)||W.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:R.prefix,input:W.value,inst:e,continue:!R.abort})}})),nu=N(`$ZodCheckEndsWith`,((e,R)=>{Al.init(e,R);let W=RegExp(`.*${ne(R.suffix)}$`);R.pattern??=W,e._zod.onattach.push((e=>{let R=e._zod.bag;R.patterns??=new Set,R.patterns.add(W)})),e._zod.check=W=>{W.value.endsWith(R.suffix)||W.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:R.suffix,input:W.value,inst:e,continue:!R.abort})}}));function gA(e,R,W){e.issues.length&&R.issues.push(...ge(W,e.issues))}const ru=N(`$ZodCheckProperty`,((e,R)=>{Al.init(e,R),e._zod.check=e=>{let W=R.schema._zod.run({value:e.value[R.property],issues:[]},{});if(W instanceof Promise)return W.then((W=>gA(W,e,R.property)));gA(W,e,R.property)}})),iu=N(`$ZodCheckMimeType`,((e,R)=>{Al.init(e,R);let W=new Set(R.mime);e._zod.onattach.push((e=>{e._zod.bag.mime=R.mime})),e._zod.check=Y=>{W.has(Y.value.type)||Y.issues.push({code:`invalid_value`,values:R.mime,input:Y.value.type,inst:e,continue:!R.abort})}})),au=N(`$ZodCheckOverwrite`,((e,R)=>{Al.init(e,R),e._zod.check=e=>{e.value=R.tx(e.value)}}));var IA=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`)return e(this,{execution:`sync`}),void e(this,{execution:`async`});let R=e.split(`
|
|
1098
1098
|
`).filter((e=>e)),W=Math.min(...R.map((e=>e.length-e.trimStart().length))),Y=R.map((e=>e.slice(W))).map((e=>` `.repeat(2*this.indent)+e));for(let e of Y)this.content.push(e)}compile(){let e=Function,R=this?.args;return new e(...R,[...(this?.content??[``]).map((e=>` ${e}`))].join(`
|
|
1099
|
-
`))}};const ou={major:4,minor:2,patch:1},su=N(`$ZodType`,((e,R)=>{var W;e??={},e._zod.def=R,e._zod.bag=e._zod.bag||{},e._zod.version=ou;let Y=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&Y.unshift(e);for(let R of Y)for(let W of R._zod.onattach)W(e);if(Y.length===0)(W=e._zod).deferred??(W.deferred=[]),e._zod.deferred?.push((()=>{e._zod.run=e._zod.parse}));else{let t=(e,R,W)=>{let Y,X=ce(e);for(let ie of R){if(ie._zod.def.when){if(!ie._zod.def.when(e))continue}else if(X)continue;let R=e.issues.length,ae=ie._zod.check(e);if(ae instanceof Promise&&!1===W?.async)throw new G;if(Y||ae instanceof Promise)Y=(Y??Promise.resolve()).then((async()=>{await ae,e.issues.length!==R&&(X||=ce(e,R))}));else{if(e.issues.length===R)continue;X||=ce(e,R)}}return Y?Y.then((()=>e)):e},A=(R,W,X)=>{if(ce(R))return R.aborted=!0,R;let ie=t(W,Y,X);if(ie instanceof Promise){if(!1===X.async)throw new G;return ie.then((R=>e._zod.parse(R,X)))}return e._zod.parse(ie,X)};e._zod.run=(R,W)=>{if(W.skipChecks)return e._zod.parse(R,W);if(W.direction===`backward`){let Y=e._zod.parse({value:R.value,issues:[]},{...W,skipChecks:!0});return Y instanceof Promise?Y.then((e=>A(e,R,W))):A(Y,R,W)}let X=e._zod.parse(R,W);if(X instanceof Promise){if(!1===W.async)throw new G;return X.then((e=>t(e,Y,W)))}return t(X,Y,W)}}e[`~standard`]={validate:R=>{try{let W=as(e,R);return W.success?{value:W.data}:{issues:W.error?.issues}}catch{return os(e,R).then((e=>e.success?{value:e.data}:{issues:e.error?.issues}))}},vendor:`zod`,version:1}})),cu=N(`$ZodString`,((e,R)=>{su.init(e,R),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Bt(e._zod.bag),e._zod.parse=(W,Y)=>{if(R.coerce)try{W.value=String(W.value)}catch{}return typeof W.value==`string`||W.issues.push({expected:`string`,code:`invalid_type`,input:W.value,inst:e}),W}})),lu=N(`$ZodStringFormat`,((e,R)=>{Yl.init(e,R),cu.init(e,R)})),uu=N(`$ZodGUID`,((e,R)=>{R.pattern??=hs,lu.init(e,R)})),du=N(`$ZodUUID`,((e,R)=>{if(R.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[R.version];if(e===void 0)throw Error(`Invalid UUID version: "${R.version}"`);R.pattern??=je(e)}else R.pattern??=je();lu.init(e,R)})),fu=N(`$ZodEmail`,((e,R)=>{R.pattern??=bs,lu.init(e,R)})),pu=N(`$ZodURL`,((e,R)=>{lu.init(e,R),e._zod.check=W=>{try{let Y=W.value.trim(),X=new URL(Y);R.hostname&&(R.hostname.lastIndex=0,R.hostname.test(X.hostname)||W.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:R.hostname.source,input:W.value,inst:e,continue:!R.abort})),R.protocol&&(R.protocol.lastIndex=0,R.protocol.test(X.protocol.endsWith(`:`)?X.protocol.slice(0,-1):X.protocol)||W.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:R.protocol.source,input:W.value,inst:e,continue:!R.abort})),R.normalize?W.value=X.href:W.value=Y;return}catch{W.issues.push({code:`invalid_format`,format:`url`,input:W.value,inst:e,continue:!R.abort})}}})),mu=N(`$ZodEmoji`,((e,R)=>{R.pattern??=At(),lu.init(e,R)})),hu=N(`$ZodNanoID`,((e,R)=>{R.pattern??=fs,lu.init(e,R)})),gu=N(`$ZodCUID`,((e,R)=>{R.pattern??=ss,lu.init(e,R)})),_u=N(`$ZodCUID2`,((e,R)=>{R.pattern??=cs,lu.init(e,R)})),vu=N(`$ZodULID`,((e,R)=>{R.pattern??=ls,lu.init(e,R)})),yu=N(`$ZodXID`,((e,R)=>{R.pattern??=us,lu.init(e,R)})),bu=N(`$ZodKSUID`,((e,R)=>{R.pattern??=ds,lu.init(e,R)})),xu=N(`$ZodISODateTime`,((e,R)=>{R.pattern??=ft(R),lu.init(e,R)})),Su=N(`$ZodISODate`,((e,R)=>{R.pattern??=$s,lu.init(e,R)})),Cu=N(`$ZodISOTime`,((e,R)=>{R.pattern??=pt(R),lu.init(e,R)})),wu=N(`$ZodISODuration`,((e,R)=>{R.pattern??=ps,lu.init(e,R)})),Tu=N(`$ZodIPv4`,((e,R)=>{R.pattern??=Ms,lu.init(e,R),e._zod.bag.format=`ipv4`})),Eu=N(`$ZodIPv6`,((e,R)=>{R.pattern??=Ns,lu.init(e,R),e._zod.bag.format=`ipv6`,e._zod.check=W=>{try{new URL(`http://[${W.value}]`)}catch{W.issues.push({code:`invalid_format`,format:`ipv6`,input:W.value,inst:e,continue:!R.abort})}}})),Du=N(`$ZodMAC`,((e,R)=>{R.pattern??=ot(R.delimiter),lu.init(e,R),e._zod.bag.format=`mac`})),Ou=N(`$ZodCIDRv4`,((e,R)=>{R.pattern??=Is,lu.init(e,R)})),ku=N(`$ZodCIDRv6`,((e,R)=>{R.pattern??=zs,lu.init(e,R),e._zod.check=W=>{let Y=W.value.split(`/`);try{if(Y.length!==2)throw Error();let[e,R]=Y;if(!R)throw Error();let W=Number(R);if(`${W}`!==R||W<0||W>128)throw Error();new URL(`http://[${e}]`)}catch{W.issues.push({code:`invalid_format`,format:`cidrv6`,input:W.value,inst:e,continue:!R.abort})}}}));function OA(e){if(e===``)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const Au=N(`$ZodBase64`,((e,R)=>{R.pattern??=Bs,lu.init(e,R),e._zod.bag.contentEncoding=`base64`,e._zod.check=W=>{OA(W.value)||W.issues.push({code:`invalid_format`,format:`base64`,input:W.value,inst:e,continue:!R.abort})}})),ju=N(`$ZodBase64URL`,((e,R)=>{R.pattern??=Hs,lu.init(e,R),e._zod.bag.contentEncoding=`base64url`,e._zod.check=W=>{(function(e){if(!Hs.test(e))return!1;let R=e.replace(/[-_]/g,(e=>e===`-`?`+`:`/`));return OA(R.padEnd(4*Math.ceil(R.length/4),`=`))})(W.value)||W.issues.push({code:`invalid_format`,format:`base64url`,input:W.value,inst:e,continue:!R.abort})}})),Mu=N(`$ZodE164`,((e,R)=>{R.pattern??=Xs,lu.init(e,R)})),Nu=N(`$ZodJWT`,((e,R)=>{lu.init(e,R),e._zod.check=W=>{(function(e,R=null){try{let W=e.split(`.`);if(W.length!==3)return!1;let[Y]=W;if(!Y)return!1;let X=JSON.parse(atob(Y));return!(`typ`in X&&X?.typ!==`JWT`||!X.alg||R&&(!(`alg`in X)||X.alg!==R))}catch{return!1}})(W.value,R.alg)||W.issues.push({code:`invalid_format`,format:`jwt`,input:W.value,inst:e,continue:!R.abort})}})),Pu=N(`$ZodCustomStringFormat`,((e,R)=>{lu.init(e,R),e._zod.check=W=>{R.fn(W.value)||W.issues.push({code:`invalid_format`,format:R.format,input:W.value,inst:e,continue:!R.abort})}})),Fu=N(`$ZodNumber`,((e,R)=>{su.init(e,R),e._zod.pattern=e._zod.bag.pattern??nc,e._zod.parse=(W,Y)=>{if(R.coerce)try{W.value=Number(W.value)}catch{}let X=W.value;if(typeof X==`number`&&!Number.isNaN(X)&&Number.isFinite(X))return W;let ie=typeof X==`number`?Number.isNaN(X)?`NaN`:Number.isFinite(X)?void 0:`Infinity`:void 0;return W.issues.push({expected:`number`,code:`invalid_type`,input:X,inst:e,...ie?{received:ie}:{}}),W}})),Iu=N(`$ZodNumberFormat`,((e,R)=>{Ll.init(e,R),Fu.init(e,R)})),Lu=N(`$ZodBoolean`,((e,R)=>{su.init(e,R),e._zod.pattern=sc,e._zod.parse=(W,Y)=>{if(R.coerce)try{W.value=!!W.value}catch{}let X=W.value;return typeof X==`boolean`||W.issues.push({expected:`boolean`,code:`invalid_type`,input:X,inst:e}),W}})),Ru=N(`$ZodBigInt`,((e,R)=>{su.init(e,R),e._zod.pattern=ec,e._zod.parse=(W,Y)=>{if(R.coerce)try{W.value=BigInt(W.value)}catch{}return typeof W.value==`bigint`||W.issues.push({expected:`bigint`,code:`invalid_type`,input:W.value,inst:e}),W}})),zu=N(`$ZodBigIntFormat`,((e,R)=>{Rl.init(e,R),Ru.init(e,R)})),Bu=N(`$ZodSymbol`,((e,R)=>{su.init(e,R),e._zod.parse=(R,W)=>{let Y=R.value;return typeof Y==`symbol`||R.issues.push({expected:`symbol`,code:`invalid_type`,input:Y,inst:e}),R}})),Vu=N(`$ZodUndefined`,((e,R)=>{su.init(e,R),e._zod.pattern=hc,e._zod.values=new Set([void 0]),e._zod.optin=`optional`,e._zod.optout=`optional`,e._zod.parse=(R,W)=>{let Y=R.value;return Y===void 0||R.issues.push({expected:`undefined`,code:`invalid_type`,input:Y,inst:e}),R}})),Hu=N(`$ZodNull`,((e,R)=>{su.init(e,R),e._zod.pattern=uc,e._zod.values=new Set([null]),e._zod.parse=(R,W)=>{let Y=R.value;return Y===null||R.issues.push({expected:`null`,code:`invalid_type`,input:Y,inst:e}),R}})),Uu=N(`$ZodAny`,((e,R)=>{su.init(e,R),e._zod.parse=e=>e})),Wu=N(`$ZodUnknown`,((e,R)=>{su.init(e,R),e._zod.parse=e=>e})),Gu=N(`$ZodNever`,((e,R)=>{su.init(e,R),e._zod.parse=(R,W)=>(R.issues.push({expected:`never`,code:`invalid_type`,input:R.value,inst:e}),R)})),Ku=N(`$ZodVoid`,((e,R)=>{su.init(e,R),e._zod.parse=(R,W)=>{let Y=R.value;return Y===void 0||R.issues.push({expected:`void`,code:`invalid_type`,input:Y,inst:e}),R}})),qu=N(`$ZodDate`,((e,R)=>{su.init(e,R),e._zod.parse=(W,Y)=>{if(R.coerce)try{W.value=new Date(W.value)}catch{}let X=W.value,ie=X instanceof Date;return ie&&!Number.isNaN(X.getTime())||W.issues.push({expected:`date`,code:`invalid_type`,input:X,...ie?{received:`Invalid Date`}:{},inst:e}),W}}));function oi(e,R,W){e.issues.length&&R.issues.push(...ge(W,e.issues)),R.value[W]=e.value}const Ju=N(`$ZodArray`,((e,R)=>{su.init(e,R),e._zod.parse=(W,Y)=>{let X=W.value;if(!Array.isArray(X))return W.issues.push({expected:`array`,code:`invalid_type`,input:X,inst:e}),W;W.value=Array(X.length);let ie=[];for(let e=0;e<X.length;e++){let ae=X[e],le=R.element._zod.run({value:ae,issues:[]},Y);le instanceof Promise?ie.push(le.then((R=>oi(R,W,e)))):oi(le,W,e)}return ie.length?Promise.all(ie).then((()=>W)):W}}));function ri(e,R,W,Y){e.issues.length&&R.issues.push(...ge(W,e.issues)),e.value===void 0?W in Y&&(R.value[W]=void 0):R.value[W]=e.value}function ai(e){let R=Object.keys(e.shape);for(let W of R)if(!e.shape?.[W]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${W}": expected a Zod schema`);let W=(Y=e.shape,Object.keys(Y).filter((e=>Y[e]._zod.optin===`optional`&&Y[e]._zod.optout===`optional`)));var Y;return{...e,keys:R,keySet:new Set(R),numKeys:R.length,optionalKeys:new Set(W)}}function li(e,R,W,Y,X,ie){let ae=[],le=X.keySet,_e=X.catchall._zod,ye=_e.def.type;for(let X in R){if(le.has(X))continue;if(ye===`never`){ae.push(X);continue}let ie=_e.run({value:R[X],issues:[]},Y);ie instanceof Promise?e.push(ie.then((e=>ri(e,W,X,R)))):ri(ie,W,X,R)}return ae.length&&W.issues.push({code:`unrecognized_keys`,keys:ae,input:R,inst:ie}),e.length?Promise.all(e).then((()=>W)):W}const Yu=N(`$ZodObject`,((e,R)=>{if(su.init(e,R),!Object.getOwnPropertyDescriptor(R,`shape`)?.get){let e=R.shape;Object.defineProperty(R,"shape",{get:()=>{let W={...e};return Object.defineProperty(R,"shape",{value:W}),W}})}let W=Z((()=>ai(R)));H(e._zod,`propValues`,(()=>{let e=R.shape,W={};for(let R in e){let Y=e[R]._zod;if(Y.values){W[R]??(W[R]=new Set);for(let e of Y.values)W[R].add(e)}}return W}));let Y=V,X=R.catchall,ie;e._zod.parse=(R,ae)=>{ie??=W.value;let le=R.value;if(!Y(le))return R.issues.push({expected:`object`,code:`invalid_type`,input:le,inst:e}),R;R.value={};let _e=[],ye=ie.shape;for(let e of ie.keys){let W=ye[e]._zod.run({value:le[e],issues:[]},ae);W instanceof Promise?_e.push(W.then((W=>ri(W,R,e,le)))):ri(W,R,e,le)}return X?li(_e,le,R,ae,W.value,e):_e.length?Promise.all(_e).then((()=>R)):R}})),Xu=N(`$ZodObjectJIT`,((e,R)=>{Yu.init(e,R);let W=e._zod.parse,Y=Z((()=>ai(R))),X,ie=V,ae=!Ba.jitless,le=ae&&Ka.value,_e=R.catchall,ye;e._zod.parse=(be,Ce)=>{ye??=Y.value;let Te=be.value;return ie(Te)?ae&&le&&!1===Ce?.async&&!0!==Ce.jitless?(X||=(e=>{let R=new IA([`shape`,`payload`,`ctx`]),W=Y.value,n=e=>{let R=K(e);return`shape[${R}]._zod.run({ value: input[${R}], issues: [] }, ctx)`};R.write(`const input = payload.value;`);let X=Object.create(null),ie=0;for(let e of W.keys)X[e]=`key_`+ ie++;R.write(`const newResult = {};`);for(let e of W.keys){let W=X[e],Y=K(e);R.write(`const ${W} = ${n(e)};`),R.write(`\n if (${W}.issues.length) {\n payload.issues = payload.issues.concat(${W}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${Y}, ...iss.path] : [${Y}]\n })));\n }\n \n \n if (${W}.value === undefined) {\n if (${Y} in input) {\n newResult[${Y}] = undefined;\n }\n } else {\n newResult[${Y}] = ${W}.value;\n }\n \n `)}R.write(`payload.value = newResult;`),R.write(`return payload;`);let ae=R.compile();return(R,W)=>ae(e,R,W)})(R.shape),be=X(be,Ce),_e?li([],Te,be,Ce,ye,e):be):W(be,Ce):(be.issues.push({expected:`object`,code:`invalid_type`,input:Te,inst:e}),be)}}));function di(e,R,W,Y){for(let W of e)if(W.issues.length===0)return R.value=W.value,R;let X=e.filter((e=>!ce(e)));return X.length===1?(R.value=X[0].value,X[0]):(R.issues.push({code:`invalid_union`,input:R.value,inst:W,errors:e.map((e=>e.issues.map((e=>he(e,Y,M())))))}),R)}const Zu=N(`$ZodUnion`,((e,R)=>{su.init(e,R),H(e._zod,`optin`,(()=>R.options.some((e=>e._zod.optin===`optional`))?`optional`:void 0)),H(e._zod,`optout`,(()=>R.options.some((e=>e._zod.optout===`optional`))?`optional`:void 0)),H(e._zod,`values`,(()=>{if(R.options.every((e=>e._zod.values)))return new Set(R.options.flatMap((e=>Array.from(e._zod.values))))})),H(e._zod,`pattern`,(()=>{if(R.options.every((e=>e._zod.pattern))){let e=R.options.map((e=>e._zod.pattern));return RegExp(`^(${e.map((e=>j(e.source))).join(`|`)})$`)}}));let W=R.options.length===1,Y=R.options[0]._zod.run;e._zod.parse=(X,ie)=>{if(W)return Y(X,ie);let ae=!1,le=[];for(let e of R.options){let R=e._zod.run({value:X.value,issues:[]},ie);if(R instanceof Promise)le.push(R),ae=!0;else{if(R.issues.length===0)return R;le.push(R)}}return ae?Promise.all(le).then((R=>di(R,X,e,ie))):di(le,X,e,ie)}}));function ui(e,R,W,Y){let X=e.filter((e=>e.issues.length===0));return X.length===1?(R.value=X[0].value,R):(X.length===0?R.issues.push({code:`invalid_union`,input:R.value,inst:W,errors:e.map((e=>e.issues.map((e=>he(e,Y,M())))))}):R.issues.push({code:`invalid_union`,input:R.value,inst:W,errors:[],inclusive:!1}),R)}const Qu=N(`$ZodXor`,((e,R)=>{Zu.init(e,R),R.inclusive=!1;let W=R.options.length===1,Y=R.options[0]._zod.run;e._zod.parse=(X,ie)=>{if(W)return Y(X,ie);let ae=!1,le=[];for(let e of R.options){let R=e._zod.run({value:X.value,issues:[]},ie);R instanceof Promise?(le.push(R),ae=!0):le.push(R)}return ae?Promise.all(le).then((R=>ui(R,X,e,ie))):ui(le,X,e,ie)}})),$u=N(`$ZodDiscriminatedUnion`,((e,R)=>{R.inclusive=!1,Zu.init(e,R);let W=e._zod.parse;H(e._zod,`propValues`,(()=>{let e={};for(let W of R.options){let Y=W._zod.propValues;if(!Y||Object.keys(Y).length===0)throw Error(`Invalid discriminated union option at index "${R.options.indexOf(W)}"`);for(let[R,W]of Object.entries(Y)){e[R]||(e[R]=new Set);for(let Y of W)e[R].add(Y)}}return e}));let Y=Z((()=>{let e=R.options,W=new Map;for(let Y of e){let e=Y._zod.propValues?.[R.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${R.options.indexOf(Y)}"`);for(let R of e){if(W.has(R))throw Error(`Duplicate discriminator value "${String(R)}"`);W.set(R,Y)}}return W}));e._zod.parse=(X,ie)=>{let ae=X.value;if(!V(ae))return X.issues.push({code:`invalid_type`,expected:`object`,input:ae,inst:e}),X;let le=Y.value.get(ae?.[R.discriminator]);return le?le._zod.run(X,ie):R.unionFallback?W(X,ie):(X.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:R.discriminator,input:ae,path:[R.discriminator],inst:e}),X)}})),ed=N(`$ZodIntersection`,((e,R)=>{su.init(e,R),e._zod.parse=(e,W)=>{let Y=e.value,X=R.left._zod.run({value:Y,issues:[]},W),ie=R.right._zod.run({value:Y,issues:[]},W);return X instanceof Promise||ie instanceof Promise?Promise.all([X,ie]).then((([R,W])=>Ci(e,R,W))):Ci(e,X,ie)}}));function Bi(e,R){if(e===R||e instanceof Date&&R instanceof Date&&+e==+R)return{valid:!0,data:e};if(ee(e)&&ee(R)){let W=Object.keys(R),Y=Object.keys(e).filter((e=>W.indexOf(e)!==-1)),X={...e,...R};for(let W of Y){let Y=Bi(e[W],R[W]);if(!Y.valid)return{valid:!1,mergeErrorPath:[W,...Y.mergeErrorPath]};X[W]=Y.data}return{valid:!0,data:X}}if(Array.isArray(e)&&Array.isArray(R)){if(e.length!==R.length)return{valid:!1,mergeErrorPath:[]};let W=[];for(let Y=0;Y<e.length;Y++){let X=Bi(e[Y],R[Y]);if(!X.valid)return{valid:!1,mergeErrorPath:[Y,...X.mergeErrorPath]};W.push(X.data)}return{valid:!0,data:W}}return{valid:!1,mergeErrorPath:[]}}function Ci(e,R,W){if(R.issues.length&&e.issues.push(...R.issues),W.issues.length&&e.issues.push(...W.issues),ce(e))return e;let Y=Bi(R.value,W.value);if(!Y.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(Y.mergeErrorPath)}`);return e.value=Y.data,e}const td=N(`$ZodTuple`,((e,R)=>{su.init(e,R);let W=R.items;e._zod.parse=(Y,X)=>{let ie=Y.value;if(!Array.isArray(ie))return Y.issues.push({input:ie,inst:e,expected:`tuple`,code:`invalid_type`}),Y;Y.value=[];let ae=[],le=[...W].reverse().findIndex((e=>e._zod.optin!==`optional`)),_e=le===-1?0:W.length-le;if(!R.rest){let R=ie.length>W.length,X=ie.length<_e-1;if(R||X)return Y.issues.push({...R?{code:`too_big`,maximum:W.length}:{code:`too_small`,minimum:W.length},input:ie,inst:e,origin:`array`}),Y}let ye=-1;for(let e of W){if(ye++,ye>=ie.length&&ye>=_e)continue;let R=e._zod.run({value:ie[ye],issues:[]},X);R instanceof Promise?ae.push(R.then((e=>Qi(e,Y,ye)))):Qi(R,Y,ye)}if(R.rest){let e=ie.slice(W.length);for(let W of e){ye++;let e=R.rest._zod.run({value:W,issues:[]},X);e instanceof Promise?ae.push(e.then((e=>Qi(e,Y,ye)))):Qi(e,Y,ye)}}return ae.length?Promise.all(ae).then((()=>Y)):Y}}));function Qi(e,R,W){e.issues.length&&R.issues.push(...ge(W,e.issues)),R.value[W]=e.value}const nd=N(`$ZodRecord`,((e,R)=>{su.init(e,R),e._zod.parse=(W,Y)=>{let X=W.value;if(!ee(X))return W.issues.push({expected:`record`,code:`invalid_type`,input:X,inst:e}),W;let ie=[],ae=R.keyType._zod.values;if(ae){W.value={};let le=new Set;for(let e of ae)if(typeof e==`string`||typeof e==`number`||typeof e==`symbol`){le.add(typeof e==`number`?e.toString():e);let ae=R.valueType._zod.run({value:X[e],issues:[]},Y);ae instanceof Promise?ie.push(ae.then((R=>{R.issues.length&&W.issues.push(...ge(e,R.issues)),W.value[e]=R.value}))):(ae.issues.length&&W.issues.push(...ge(e,ae.issues)),W.value[e]=ae.value)}let _e;for(let e in X)le.has(e)||(_e??=[],_e.push(e));_e&&_e.length>0&&W.issues.push({code:`unrecognized_keys`,input:X,inst:e,keys:_e})}else{W.value={};for(let ae of Reflect.ownKeys(X)){if(ae===`__proto__`)continue;let le=R.keyType._zod.run({value:ae,issues:[]},Y);if(le instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(le.issues.length){R.mode===`loose`?W.value[ae]=X[ae]:W.issues.push({code:`invalid_key`,origin:`record`,issues:le.issues.map((e=>he(e,Y,M()))),input:ae,path:[ae],inst:e});continue}let _e=R.valueType._zod.run({value:X[ae],issues:[]},Y);_e instanceof Promise?ie.push(_e.then((e=>{e.issues.length&&W.issues.push(...ge(ae,e.issues)),W.value[le.value]=e.value}))):(_e.issues.length&&W.issues.push(...ge(ae,_e.issues)),W.value[le.value]=_e.value)}}return ie.length?Promise.all(ie).then((()=>W)):W}})),rd=N(`$ZodMap`,((e,R)=>{su.init(e,R),e._zod.parse=(W,Y)=>{let X=W.value;if(!(X instanceof Map))return W.issues.push({expected:`map`,code:`invalid_type`,input:X,inst:e}),W;let ie=[];W.value=new Map;for(let[ae,le]of X){let _e=R.keyType._zod.run({value:ae,issues:[]},Y),ye=R.valueType._zod.run({value:le,issues:[]},Y);_e instanceof Promise||ye instanceof Promise?ie.push(Promise.all([_e,ye]).then((([R,ie])=>{wi(R,ie,W,ae,X,e,Y)}))):wi(_e,ye,W,ae,X,e,Y)}return ie.length?Promise.all(ie).then((()=>W)):W}}));function wi(e,R,W,Y,X,ie,ae){e.issues.length&&(qa.has(typeof Y)?W.issues.push(...ge(Y,e.issues)):W.issues.push({code:`invalid_key`,origin:`map`,input:X,inst:ie,issues:e.issues.map((e=>he(e,ae,M())))})),R.issues.length&&(qa.has(typeof Y)?W.issues.push(...ge(Y,R.issues)):W.issues.push({origin:`map`,code:`invalid_element`,input:X,inst:ie,key:Y,issues:R.issues.map((e=>he(e,ae,M())))})),W.value.set(e.value,R.value)}const id=N(`$ZodSet`,((e,R)=>{su.init(e,R),e._zod.parse=(W,Y)=>{let X=W.value;if(!(X instanceof Set))return W.issues.push({input:X,inst:e,expected:`set`,code:`invalid_type`}),W;let ie=[];W.value=new Set;for(let e of X){let X=R.valueType._zod.run({value:e,issues:[]},Y);X instanceof Promise?ie.push(X.then((e=>vi(e,W)))):vi(X,W)}return ie.length?Promise.all(ie).then((()=>W)):W}}));function vi(e,R){e.issues.length&&R.issues.push(...e.issues),R.value.add(e.value)}const ad=N(`$ZodEnum`,((e,R)=>{su.init(e,R);let W=O(R.entries),Y=new Set(W);e._zod.values=Y,e._zod.pattern=RegExp(`^(${W.filter((e=>qa.has(typeof e))).map((e=>typeof e==`string`?ne(e):e.toString())).join(`|`)})$`),e._zod.parse=(R,X)=>{let ie=R.value;return Y.has(ie)||R.issues.push({code:`invalid_value`,values:W,input:ie,inst:e}),R}})),od=N(`$ZodLiteral`,((e,R)=>{if(su.init(e,R),R.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let W=new Set(R.values);e._zod.values=W,e._zod.pattern=RegExp(`^(${R.values.map((e=>typeof e==`string`?ne(e):e?ne(e.toString()):String(e))).join(`|`)})$`),e._zod.parse=(Y,X)=>{let ie=Y.value;return W.has(ie)||Y.issues.push({code:`invalid_value`,values:R.values,input:ie,inst:e}),Y}})),sd=N(`$ZodFile`,((e,R)=>{su.init(e,R),e._zod.parse=(R,W)=>{let Y=R.value;return Y instanceof File||R.issues.push({expected:`file`,code:`invalid_type`,input:Y,inst:e}),R}})),cd=N(`$ZodTransform`,((e,R)=>{su.init(e,R),e._zod.parse=(W,Y)=>{if(Y.direction===`backward`)throw new T(e.constructor.name);let X=R.transform(W.value,W);if(Y.async)return(X instanceof Promise?X:Promise.resolve(X)).then((e=>(W.value=e,W)));if(X instanceof Promise)throw new G;return W.value=X,W}}));function xi(e,R){return e.issues.length&&R===void 0?{issues:[],value:void 0}:e}const ld=N(`$ZodOptional`,((e,R)=>{su.init(e,R),e._zod.optin=`optional`,e._zod.optout=`optional`,H(e._zod,`values`,(()=>R.innerType._zod.values?new Set([...R.innerType._zod.values,void 0]):void 0)),H(e._zod,`pattern`,(()=>{let e=R.innerType._zod.pattern;return e?RegExp(`^(${j(e.source)})?$`):void 0})),e._zod.parse=(e,W)=>{if(R.innerType._zod.optin===`optional`){let Y=R.innerType._zod.run(e,W);return Y instanceof Promise?Y.then((R=>xi(R,e.value))):xi(Y,e.value)}return e.value===void 0?e:R.innerType._zod.run(e,W)}})),ud=N(`$ZodNullable`,((e,R)=>{su.init(e,R),H(e._zod,`optin`,(()=>R.innerType._zod.optin)),H(e._zod,`optout`,(()=>R.innerType._zod.optout)),H(e._zod,`pattern`,(()=>{let e=R.innerType._zod.pattern;return e?RegExp(`^(${j(e.source)}|null)$`):void 0})),H(e._zod,`values`,(()=>R.innerType._zod.values?new Set([...R.innerType._zod.values,null]):void 0)),e._zod.parse=(e,W)=>e.value===null?e:R.innerType._zod.run(e,W)})),dd=N(`$ZodDefault`,((e,R)=>{su.init(e,R),e._zod.optin=`optional`,H(e._zod,`values`,(()=>R.innerType._zod.values)),e._zod.parse=(e,W)=>{if(W.direction===`backward`)return R.innerType._zod.run(e,W);if(e.value===void 0)return e.value=R.defaultValue,e;let Y=R.innerType._zod.run(e,W);return Y instanceof Promise?Y.then((e=>Ni(e,R))):Ni(Y,R)}}));function Ni(e,R){return e.value===void 0&&(e.value=R.defaultValue),e}const fd=N(`$ZodPrefault`,((e,R)=>{su.init(e,R),e._zod.optin=`optional`,H(e._zod,`values`,(()=>R.innerType._zod.values)),e._zod.parse=(e,W)=>(W.direction===`backward`||e.value===void 0&&(e.value=R.defaultValue),R.innerType._zod.run(e,W))})),pd=N(`$ZodNonOptional`,((e,R)=>{su.init(e,R),H(e._zod,`values`,(()=>{let e=R.innerType._zod.values;return e?new Set([...e].filter((e=>e!==void 0))):void 0})),e._zod.parse=(W,Y)=>{let X=R.innerType._zod.run(W,Y);return X instanceof Promise?X.then((R=>Ri(R,e))):Ri(X,e)}}));function Ri(e,R){return e.issues.length||e.value!==void 0||e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:R}),e}const md=N(`$ZodSuccess`,((e,R)=>{su.init(e,R),e._zod.parse=(e,W)=>{if(W.direction===`backward`)throw new T(`ZodSuccess`);let Y=R.innerType._zod.run(e,W);return Y instanceof Promise?Y.then((R=>(e.value=R.issues.length===0,e))):(e.value=Y.issues.length===0,e)}})),hd=N(`$ZodCatch`,((e,R)=>{su.init(e,R),H(e._zod,`optin`,(()=>R.innerType._zod.optin)),H(e._zod,`optout`,(()=>R.innerType._zod.optout)),H(e._zod,`values`,(()=>R.innerType._zod.values)),e._zod.parse=(e,W)=>{if(W.direction===`backward`)return R.innerType._zod.run(e,W);let Y=R.innerType._zod.run(e,W);return Y instanceof Promise?Y.then((Y=>(e.value=Y.value,Y.issues.length&&(e.value=R.catchValue({...e,error:{issues:Y.issues.map((e=>he(e,W,M())))},input:e.value}),e.issues=[]),e))):(e.value=Y.value,Y.issues.length&&(e.value=R.catchValue({...e,error:{issues:Y.issues.map((e=>he(e,W,M())))},input:e.value}),e.issues=[]),e)}})),gd=N(`$ZodNaN`,((e,R)=>{su.init(e,R),e._zod.parse=(R,W)=>(typeof R.value==`number`&&Number.isNaN(R.value)||R.issues.push({input:R.value,inst:e,expected:`nan`,code:`invalid_type`}),R)})),_d=N(`$ZodPipe`,((e,R)=>{su.init(e,R),H(e._zod,`values`,(()=>R.in._zod.values)),H(e._zod,`optin`,(()=>R.in._zod.optin)),H(e._zod,`optout`,(()=>R.out._zod.optout)),H(e._zod,`propValues`,(()=>R.in._zod.propValues)),e._zod.parse=(e,W)=>{if(W.direction===`backward`){let Y=R.out._zod.run(e,W);return Y instanceof Promise?Y.then((e=>Zi(e,R.in,W))):Zi(Y,R.in,W)}let Y=R.in._zod.run(e,W);return Y instanceof Promise?Y.then((e=>Zi(e,R.out,W))):Zi(Y,R.out,W)}}));function Zi(e,R,W){return e.issues.length?(e.aborted=!0,e):R._zod.run({value:e.value,issues:e.issues},W)}const vd=N(`$ZodCodec`,((e,R)=>{su.init(e,R),H(e._zod,`values`,(()=>R.in._zod.values)),H(e._zod,`optin`,(()=>R.in._zod.optin)),H(e._zod,`optout`,(()=>R.out._zod.optout)),H(e._zod,`propValues`,(()=>R.in._zod.propValues)),e._zod.parse=(e,W)=>{if((W.direction||`forward`)===`forward`){let Y=R.in._zod.run(e,W);return Y instanceof Promise?Y.then((e=>ji(e,R,W))):ji(Y,R,W)}{let Y=R.out._zod.run(e,W);return Y instanceof Promise?Y.then((e=>ji(e,R,W))):ji(Y,R,W)}}}));function ji(e,R,W){if(e.issues.length)return e.aborted=!0,e;if((W.direction||`forward`)===`forward`){let Y=R.transform(e.value,e);return Y instanceof Promise?Y.then((Y=>Yi(e,Y,R.out,W))):Yi(e,Y,R.out,W)}{let Y=R.reverseTransform(e.value,e);return Y instanceof Promise?Y.then((Y=>Yi(e,Y,R.in,W))):Yi(e,Y,R.in,W)}}function Yi(e,R,W,Y){return e.issues.length?(e.aborted=!0,e):W._zod.run({value:R,issues:e.issues},Y)}const yd=N(`$ZodReadonly`,((e,R)=>{su.init(e,R),H(e._zod,`propValues`,(()=>R.innerType._zod.propValues)),H(e._zod,`values`,(()=>R.innerType._zod.values)),H(e._zod,`optin`,(()=>R.innerType?._zod?.optin)),H(e._zod,`optout`,(()=>R.innerType?._zod?.optout)),e._zod.parse=(e,W)=>{if(W.direction===`backward`)return R.innerType._zod.run(e,W);let Y=R.innerType._zod.run(e,W);return Y instanceof Promise?Y.then(Pi):Pi(Y)}}));function Pi(e){return e.value=Object.freeze(e.value),e}const bd=N(`$ZodTemplateLiteral`,((e,R)=>{su.init(e,R);let W=[];for(let e of R.parts)if(typeof e==`object`&&e){if(!e._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...e._zod.traits].shift()}`);let R=e._zod.pattern instanceof RegExp?e._zod.pattern.source:e._zod.pattern;if(!R)throw Error(`Invalid template literal part: ${e._zod.traits}`);let Y=+!!R.startsWith(`^`),X=R.endsWith(`$`)?R.length-1:R.length;W.push(R.slice(Y,X))}else{if(e!==null&&!Ja.has(typeof e))throw Error(`Invalid template literal part: ${e}`);W.push(ne(`${e}`))}e._zod.pattern=RegExp(`^${W.join(``)}$`),e._zod.parse=(W,Y)=>typeof W.value==`string`?(e._zod.pattern.lastIndex=0,e._zod.pattern.test(W.value)||W.issues.push({input:W.value,inst:e,code:`invalid_format`,format:R.format??`template_literal`,pattern:e._zod.pattern.source}),W):(W.issues.push({input:W.value,inst:e,expected:`template_literal`,code:`invalid_type`}),W)})),xd=N(`$ZodFunction`,((e,R)=>(su.init(e,R),e._def=R,e._zod.def=R,e.implement=R=>{if(typeof R!=`function`)throw Error(`implement() must be called with a function`);return function(...W){let Y=e._def.input?es(e._def.input,W):W,X=Reflect.apply(R,this,Y);return e._def.output?es(e._def.output,X):X}},e.implementAsync=R=>{if(typeof R!=`function`)throw Error(`implementAsync() must be called with a function`);return async function(...W){let Y=e._def.input?await rs(e._def.input,W):W,X=await Reflect.apply(R,this,Y);return e._def.output?await rs(e._def.output,X):X}},e._zod.parse=(R,W)=>typeof R.value==`function`?(R.value=e._def.output&&e._def.output._zod.def.type===`promise`?e.implementAsync(R.value):e.implement(R.value),R):(R.issues.push({code:`invalid_type`,expected:`function`,input:R.value,inst:e}),R),e.input=(...R)=>{let W=e.constructor;return Array.isArray(R[0])?new W({type:`function`,input:new td({type:`tuple`,items:R[0],rest:R[1]}),output:e._def.output}):new W({type:`function`,input:R[0],output:e._def.output})},e.output=R=>new e.constructor({type:`function`,input:e._def.input,output:R}),e))),Sd=N(`$ZodPromise`,((e,R)=>{su.init(e,R),e._zod.parse=(e,W)=>Promise.resolve(e.value).then((e=>R.innerType._zod.run({value:e,issues:[]},W)))})),Cd=N(`$ZodLazy`,((e,R)=>{su.init(e,R),H(e._zod,`innerType`,(()=>R.getter())),H(e._zod,`pattern`,(()=>e._zod.innerType?._zod?.pattern)),H(e._zod,`propValues`,(()=>e._zod.innerType?._zod?.propValues)),H(e._zod,`optin`,(()=>e._zod.innerType?._zod?.optin??void 0)),H(e._zod,`optout`,(()=>e._zod.innerType?._zod?.optout??void 0)),e._zod.parse=(R,W)=>e._zod.innerType._zod.run(R,W)})),wd=N(`$ZodCustom`,((e,R)=>{Al.init(e,R),su.init(e,R),e._zod.parse=(e,R)=>e,e._zod.check=W=>{let Y=W.value,X=R.fn(Y);if(X instanceof Promise)return X.then((R=>en(R,W,Y,e)));en(X,W,Y,e)}}));function en(e,R,W,Y){if(!e){let e={code:`custom`,input:W,inst:Y,path:[...Y._zod.def.path??[]],continue:!Y._zod.def.abort};Y._zod.def.params&&(e.params=Y._zod.def.params),R.issues.push(pe(e))}}const tn=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`}};function t(R){return e[R]??null}let R={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,jwt:`JWT`,template_literal:`input`};return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${e.expected}, received ${(e=>{let R=typeof e;switch(R){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return R})(e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${re(e.values[0])}`:`Invalid option: expected one of ${U(e.values,`|`)}`;case`too_big`:{let R=e.inclusive?`<=`:`<`,W=t(e.origin);return W?`Too big: expected ${e.origin??`value`} to have ${R}${e.maximum.toString()} ${W.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${R}${e.maximum.toString()}`}case`too_small`:{let R=e.inclusive?`>=`:`>`,W=t(e.origin);return W?`Too small: expected ${e.origin} to have ${R}${e.minimum.toString()} ${W.unit}`:`Too small: expected ${e.origin} to be ${R}${e.minimum.toString()}`}case`invalid_format`:{let W=e;return W.format===`starts_with`?`Invalid string: must start with "${W.prefix}"`:W.format===`ends_with`?`Invalid string: must end with "${W.suffix}"`:W.format===`includes`?`Invalid string: must include "${W.includes}"`:W.format===`regex`?`Invalid string: must match pattern ${W.pattern}`:`Invalid ${R[W.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${U(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:default:return`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`}}};var Td,nn=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...R){let W=R[0];if(this._map.set(e,W),W&&typeof W==`object`&&`id`in W){if(this._idmap.has(W.id))throw Error(`ID ${W.id} already exists in the registry`);this._idmap.set(W.id,e)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let R=this._map.get(e);return R&&typeof R==`object`&&`id`in R&&this._idmap.delete(R.id),this._map.delete(e),this}get(e){let R=e._zod.parent;if(R){let W={...this.get(R)??{}};delete W.id;let Y={...W,...this._map.get(e)};return Object.keys(Y).length?Y:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};(Td=globalThis).__zod_globalRegistry??(Td.__zod_globalRegistry=new nn);const Ed=globalThis.__zod_globalRegistry;function sn(e,R){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...se(R)})}function rn(e,R){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...se(R)})}function an(e,R){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...se(R)})}function ln(e,R){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...se(R)})}function cn(e,R){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...se(R)})}function gn(e,R){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...se(R)})}function dn(e,R){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...se(R)})}function hn(e,R){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...se(R)})}function un(e,R){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...se(R)})}function In(e,R){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...se(R)})}function pn(e,R){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...se(R)})}function fn(e,R){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...se(R)})}function Bn(e,R){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...se(R)})}function Cn(e,R){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...se(R)})}function En(e,R){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...se(R)})}function Qn(e,R){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...se(R)})}function mn(e,R){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...se(R)})}function yn(e,R){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...se(R)})}function wn(e,R){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...se(R)})}function _n(e,R){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...se(R)})}function vn(e,R){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...se(R)})}function bn(e,R){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...se(R)})}function kn(e,R){return new Ml({check:`less_than`,...se(R),value:e,inclusive:!1})}function Dn(e,R){return new Ml({check:`less_than`,...se(R),value:e,inclusive:!0})}function Sn(e,R){return new Nl({check:`greater_than`,...se(R),value:e,inclusive:!1})}function xn(e,R){return new Nl({check:`greater_than`,...se(R),value:e,inclusive:!0})}function zn(e){return Sn(0,e)}function Fn(e){return kn(0,e)}function Ln(e){return Dn(0,e)}function Nn(e){return xn(0,e)}function Gn(e,R){return new Fl({check:`multiple_of`,...se(R),value:e})}function Tn(e,R){return new zl({check:`max_size`,...se(R),maximum:e})}function Rn(e,R){return new Bl({check:`min_size`,...se(R),minimum:e})}function Mn(e,R){return new Vl({check:`size_equals`,...se(R),size:e})}function On(e,R){return new Gl({check:`max_length`,...se(R),maximum:e})}function Un(e,R){return new ql({check:`min_length`,...se(R),minimum:e})}function Jn(e,R){return new Jl({check:`length_equals`,...se(R),length:e})}function Zn(e,R){return new Xl({check:`string_format`,format:`regex`,...se(R),pattern:e})}function qn(e){return new Zl({check:`string_format`,format:`lowercase`,...se(e)})}function jn(e){return new Ql({check:`string_format`,format:`uppercase`,...se(e)})}function Yn(e,R){return new eu({check:`string_format`,format:`includes`,...se(R),includes:e})}function Hn(e,R){return new tu({check:`string_format`,format:`starts_with`,...se(R),prefix:e})}function Pn(e,R){return new nu({check:`string_format`,format:`ends_with`,...se(R),suffix:e})}function $n(e,R,W){return new ru({check:`property`,property:e,schema:R,...se(W)})}function Kn(e,R){return new iu({check:`mime_type`,mime:e,...se(R)})}function Wn(e){return new au({check:`overwrite`,tx:e})}function Vn(e){return Wn((R=>R.normalize(e)))}function Xn(){return Wn((e=>e.trim()))}function eo(){return Wn((e=>e.toLowerCase()))}function to(){return Wn((e=>e.toUpperCase()))}function Ao(){return Wn((e=>function(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}(e)))}function io(e){let R=function(e,R){let W=new Al({check:`custom`,...se(R)});return W._zod.check=e,W}((W=>(W.addIssue=e=>{if(typeof e==`string`)W.issues.push(pe(e,W.value,R._zod.def));else{let Y=e;Y.fatal&&(Y.continue=!1),Y.code??=`custom`,Y.input??=W.value,Y.inst??=R,Y.continue??=!R._zod.def.abort,W.issues.push(pe(Y))}},e(W.value,W))));return R}function no(e,R,W,Y={}){let X=se(Y),ie={...se(Y),check:`string_format`,type:`string`,format:R,fn:typeof W==`function`?W:e=>W.test(e),...X};return W instanceof RegExp&&(ie.pattern=W),new e(ie)}function oo(e){let R=e?.target??`draft-2020-12`;return R===`draft-4`&&(R=`draft-04`),R===`draft-7`&&(R=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??Ed,target:R,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function so(e,R,W={path:[],schemaPath:[]}){var Y;let X=e._zod.def,ie=R.seen.get(e);if(ie)return ie.count++,W.schemaPath.includes(e)&&(ie.cycle=W.path),ie.schema;let ae={schema:{},count:1,cycle:void 0,path:W.path};R.seen.set(e,ae);let le=e._zod.toJSONSchema?.();if(le)ae.schema=le;else{let Y={...W,schemaPath:[...W.schemaPath,e],path:W.path},ie=e._zod.parent;if(ie)ae.ref=ie,so(ie,R,Y),R.seen.get(ie).isParent=!0;else if(e._zod.processJSONSchema)e._zod.processJSONSchema(R,ae.schema,Y);else{let W=ae.schema,ie=R.processors[X.type];if(!ie)throw Error(`[toJSONSchema]: Non-representable type encountered: ${X.type}`);ie(e,R,W,Y)}}let _e=R.metadataRegistry.get(e);return _e&&Object.assign(ae.schema,_e),R.io===`input`&&lo(e)&&(delete ae.schema.examples,delete ae.schema.default),R.io===`input`&&ae.schema._prefault&&((Y=ae.schema).default??(Y.default=ae.schema._prefault)),delete ae.schema._prefault,R.seen.get(e).schema}function ro(e,R){let W=e.seen.get(R);if(!W)throw Error(`Unprocessed schema. This is a bug in Zod.`);let i=R=>{if(R[1].schema.$ref)return;let Y=R[1],{ref:X,defId:ie}=(R=>{let Y=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let W=e.external.registry.get(R[0])?.id,X=e.external.uri??(e=>e);if(W)return{ref:X(W)};let ie=R[1].defId??R[1].schema.id??`schema`+ e.counter++;return R[1].defId=ie,{defId:ie,ref:`${X(`__shared`)}#/${Y}/${ie}`}}if(R[1]===W)return{ref:`#`};let X=`#/${Y}/`,ie=R[1].schema.id??`__schema`+ e.counter++;return{defId:ie,ref:X+ie}})(R);Y.def={...Y.schema},ie&&(Y.defId=ie);let ae=Y.schema;for(let e in ae)delete ae[e];ae.$ref=X};if(e.cycles===`throw`)for(let R of e.seen.entries()){let e=R[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>\n\nSet the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let W of e.seen.entries()){let Y=W[1];if(R===W[0]){i(W);continue}if(e.external){let Y=e.external.registry.get(W[0])?.id;if(R!==W[0]&&Y){i(W);continue}}(e.metadataRegistry.get(W[0])?.id||Y.cycle||Y.count>1&&e.reused===`ref`)&&i(W)}}function ao(e,R){let W=e.seen.get(R);if(!W)throw Error(`Unprocessed schema. This is a bug in Zod.`);let i=R=>{let W=e.seen.get(R),Y=W.def??W.schema,X={...Y};if(W.ref===null)return;let ie=W.ref;if(W.ref=null,ie){i(ie);let R=e.seen.get(ie).schema;!R.$ref||e.target!==`draft-07`&&e.target!==`draft-04`&&e.target!==`openapi-3.0`?(Object.assign(Y,R),Object.assign(Y,X)):(Y.allOf=Y.allOf??[],Y.allOf.push(R))}W.isParent||e.override({zodSchema:R,jsonSchema:Y,path:W.path??[]})};for(let R of[...e.seen.entries()].reverse())i(R[0]);let Y={};if(e.target===`draft-2020-12`?Y.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?Y.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?Y.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let W=e.external.registry.get(R)?.id;if(!W)throw Error("Schema is missing an `id` property");Y.$id=e.external.uri(W)}Object.assign(Y,W.def??W.schema);let X=e.external?.defs??{};for(let R of e.seen.entries()){let e=R[1];e.def&&e.defId&&(X[e.defId]=e.def)}e.external||Object.keys(X).length>0&&(e.target===`draft-2020-12`?Y.$defs=X:Y.definitions=X);try{let e=JSON.parse(JSON.stringify(Y));return Object.defineProperty(e,"~standard",{value:{...R[`~standard`],jsonSchema:{input:co(R,`input`),output:co(R,`output`)}},enumerable:!1,writable:!1}),e}catch{throw Error(`Error converting schema to JSON.`)}}function lo(e,R){let W=R??{seen:new Set};if(W.seen.has(e))return!1;W.seen.add(e);let Y=e._zod.def;if(Y.type===`transform`)return!0;if(Y.type===`array`)return lo(Y.element,W);if(Y.type===`set`)return lo(Y.valueType,W);if(Y.type===`lazy`)return lo(Y.getter(),W);if(Y.type===`promise`||Y.type===`optional`||Y.type===`nonoptional`||Y.type===`nullable`||Y.type===`readonly`||Y.type===`default`||Y.type===`prefault`)return lo(Y.innerType,W);if(Y.type===`intersection`)return lo(Y.left,W)||lo(Y.right,W);if(Y.type===`record`||Y.type===`map`)return lo(Y.keyType,W)||lo(Y.valueType,W);if(Y.type===`pipe`)return lo(Y.in,W)||lo(Y.out,W);if(Y.type===`object`){for(let e in Y.shape)if(lo(Y.shape[e],W))return!0;return!1}if(Y.type===`union`){for(let e of Y.options)if(lo(e,W))return!0;return!1}if(Y.type===`tuple`){for(let e of Y.items)if(lo(e,W))return!0;return!(!Y.rest||!lo(Y.rest,W))}return!1}const co=(e,R)=>W=>{let{libraryOptions:Y,target:X}=W??{},ie=oo({...Y??{},target:X,io:R,processors:{}});return so(e,ie),ro(ie,e),ao(ie,e)},Dd={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},ho=(e,R,W,Y)=>{let X=W;X.type=`string`;let{minimum:ie,maximum:ae,format:le,patterns:_e,contentEncoding:ye}=e._zod.bag;if(typeof ie==`number`&&(X.minLength=ie),typeof ae==`number`&&(X.maxLength=ae),le&&(X.format=Dd[le]??le,X.format===``&&delete X.format),ye&&(X.contentEncoding=ye),_e&&_e.size>0){let e=[..._e];e.length===1?X.pattern=e[0].source:e.length>1&&(X.allOf=[...e.map((e=>({...R.target===`draft-07`||R.target===`draft-04`||R.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source})))])}},uo=(e,R,W,Y)=>{let X=W,{minimum:ie,maximum:ae,format:le,multipleOf:_e,exclusiveMaximum:ye,exclusiveMinimum:be}=e._zod.bag;typeof le==`string`&&le.includes(`int`)?X.type=`integer`:X.type=`number`,typeof be==`number`&&(R.target===`draft-04`||R.target===`openapi-3.0`?(X.minimum=be,X.exclusiveMinimum=!0):X.exclusiveMinimum=be),typeof ie==`number`&&(X.minimum=ie,typeof be==`number`&&R.target!==`draft-04`&&(be>=ie?delete X.minimum:delete X.exclusiveMinimum)),typeof ye==`number`&&(R.target===`draft-04`||R.target===`openapi-3.0`?(X.maximum=ye,X.exclusiveMaximum=!0):X.exclusiveMaximum=ye),typeof ae==`number`&&(X.maximum=ae,typeof ye==`number`&&R.target!==`draft-04`&&(ye<=ae?delete X.maximum:delete X.exclusiveMaximum)),typeof _e==`number`&&(X.multipleOf=_e)},Io=(e,R,W,Y)=>{W.type=`boolean`},po=(e,R,W,Y)=>{if(R.unrepresentable===`throw`)throw Error(`BigInt cannot be represented in JSON Schema`)},fo=(e,R,W,Y)=>{if(R.unrepresentable===`throw`)throw Error(`Symbols cannot be represented in JSON Schema`)},Bo=(e,R,W,Y)=>{R.target===`openapi-3.0`?(W.type=`string`,W.nullable=!0,W.enum=[null]):W.type=`null`},Co=(e,R,W,Y)=>{if(R.unrepresentable===`throw`)throw Error(`Undefined cannot be represented in JSON Schema`)},Eo=(e,R,W,Y)=>{if(R.unrepresentable===`throw`)throw Error(`Void cannot be represented in JSON Schema`)},Qo=(e,R,W,Y)=>{W.not={}},mo=(e,R,W,Y)=>{if(R.unrepresentable===`throw`)throw Error(`Date cannot be represented in JSON Schema`)},yo=(e,R,W,Y)=>{let X=O(e._zod.def.entries);X.every((e=>typeof e==`number`))&&(W.type=`number`),X.every((e=>typeof e==`string`))&&(W.type=`string`),W.enum=X},wo=(e,R,W,Y)=>{let X=e._zod.def,ie=[];for(let e of X.values)if(e===void 0){if(R.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(R.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);ie.push(Number(e))}else ie.push(e);if(ie.length!==0)if(ie.length===1){let e=ie[0];W.type=e===null?`null`:typeof e,R.target===`draft-04`||R.target===`openapi-3.0`?W.enum=[e]:W.const=e}else ie.every((e=>typeof e==`number`))&&(W.type=`number`),ie.every((e=>typeof e==`string`))&&(W.type=`string`),ie.every((e=>typeof e==`boolean`))&&(W.type=`boolean`),ie.every((e=>e===null))&&(W.type=`null`),W.enum=ie},_o=(e,R,W,Y)=>{if(R.unrepresentable===`throw`)throw Error(`NaN cannot be represented in JSON Schema`)},vo=(e,R,W,Y)=>{let X=W,ie=e._zod.pattern;if(!ie)throw Error(`Pattern not found in template literal`);X.type=`string`,X.pattern=ie.source},bo=(e,R,W,Y)=>{let X=W,ie={type:`string`,format:`binary`,contentEncoding:`binary`},{minimum:ae,maximum:le,mime:_e}=e._zod.bag;ae!==void 0&&(ie.minLength=ae),le!==void 0&&(ie.maxLength=le),_e?_e.length===1?(ie.contentMediaType=_e[0],Object.assign(X,ie)):X.anyOf=_e.map((e=>({...ie,contentMediaType:e}))):Object.assign(X,ie)},ko=(e,R,W,Y)=>{W.type=`boolean`},Do=(e,R,W,Y)=>{if(R.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},So=(e,R,W,Y)=>{if(R.unrepresentable===`throw`)throw Error(`Function types cannot be represented in JSON Schema`)},xo=(e,R,W,Y)=>{if(R.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},zo=(e,R,W,Y)=>{if(R.unrepresentable===`throw`)throw Error(`Map cannot be represented in JSON Schema`)},Fo=(e,R,W,Y)=>{if(R.unrepresentable===`throw`)throw Error(`Set cannot be represented in JSON Schema`)},Lo=(e,R,W,Y)=>{let X=W,ie=e._zod.def,{minimum:ae,maximum:le}=e._zod.bag;typeof ae==`number`&&(X.minItems=ae),typeof le==`number`&&(X.maxItems=le),X.type=`array`,X.items=so(ie.element,R,{...Y,path:[...Y.path,`items`]})},No=(e,R,W,Y)=>{let X=W,ie=e._zod.def;X.type=`object`,X.properties={};let ae=ie.shape;for(let e in ae)X.properties[e]=so(ae[e],R,{...Y,path:[...Y.path,`properties`,e]});let le=new Set(Object.keys(ae)),_e=new Set([...le].filter((e=>{let W=ie.shape[e]._zod;return R.io===`input`?W.optin===void 0:W.optout===void 0})));_e.size>0&&(X.required=Array.from(_e)),ie.catchall?._zod.def.type===`never`?X.additionalProperties=!1:ie.catchall?ie.catchall&&(X.additionalProperties=so(ie.catchall,R,{...Y,path:[...Y.path,`additionalProperties`]})):R.io===`output`&&(X.additionalProperties=!1)},Go=(e,R,W,Y)=>{let X=e._zod.def,ie=!1===X.inclusive,ae=X.options.map(((e,W)=>so(e,R,{...Y,path:[...Y.path,ie?`oneOf`:`anyOf`,W]})));ie?W.oneOf=ae:W.anyOf=ae},To=(e,R,W,Y)=>{let X=e._zod.def,ie=so(X.left,R,{...Y,path:[...Y.path,`allOf`,0]}),ae=so(X.right,R,{...Y,path:[...Y.path,`allOf`,1]}),r=e=>`allOf`in e&&Object.keys(e).length===1;W.allOf=[...r(ie)?ie.allOf:[ie],...r(ae)?ae.allOf:[ae]]},Ro=(e,R,W,Y)=>{let X=W,ie=e._zod.def;X.type=`array`;let ae=R.target===`draft-2020-12`?`prefixItems`:`items`,le=R.target===`draft-2020-12`||R.target===`openapi-3.0`?`items`:`additionalItems`,_e=ie.items.map(((e,W)=>so(e,R,{...Y,path:[...Y.path,ae,W]}))),ye=ie.rest?so(ie.rest,R,{...Y,path:[...Y.path,le,...R.target===`openapi-3.0`?[ie.items.length]:[]]}):null;R.target===`draft-2020-12`?(X.prefixItems=_e,ye&&(X.items=ye)):R.target===`openapi-3.0`?(X.items={anyOf:_e},ye&&X.items.anyOf.push(ye),X.minItems=_e.length,ye||(X.maxItems=_e.length)):(X.items=_e,ye&&(X.additionalItems=ye));let{minimum:be,maximum:Ce}=e._zod.bag;typeof be==`number`&&(X.minItems=be),typeof Ce==`number`&&(X.maxItems=Ce)},Mo=(e,R,W,Y)=>{let X=W,ie=e._zod.def;X.type=`object`,R.target!==`draft-07`&&R.target!==`draft-2020-12`||(X.propertyNames=so(ie.keyType,R,{...Y,path:[...Y.path,`propertyNames`]})),X.additionalProperties=so(ie.valueType,R,{...Y,path:[...Y.path,`additionalProperties`]})},Oo=(e,R,W,Y)=>{let X=e._zod.def,ie=so(X.innerType,R,Y),ae=R.seen.get(e);R.target===`openapi-3.0`?(ae.ref=X.innerType,W.nullable=!0):W.anyOf=[ie,{type:`null`}]},Uo=(e,R,W,Y)=>{let X=e._zod.def;so(X.innerType,R,Y),R.seen.get(e).ref=X.innerType},Jo=(e,R,W,Y)=>{let X=e._zod.def;so(X.innerType,R,Y),R.seen.get(e).ref=X.innerType,W.default=JSON.parse(JSON.stringify(X.defaultValue))},Zo=(e,R,W,Y)=>{let X=e._zod.def;so(X.innerType,R,Y),R.seen.get(e).ref=X.innerType,R.io===`input`&&(W._prefault=JSON.parse(JSON.stringify(X.defaultValue)))},qo=(e,R,W,Y)=>{let X=e._zod.def;so(X.innerType,R,Y);let ie;R.seen.get(e).ref=X.innerType;try{ie=X.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}W.default=ie},jo=(e,R,W,Y)=>{let X=e._zod.def,ie=R.io===`input`?X.in._zod.def.type===`transform`?X.out:X.in:X.out;so(ie,R,Y),R.seen.get(e).ref=ie},Yo=(e,R,W,Y)=>{let X=e._zod.def;so(X.innerType,R,Y),R.seen.get(e).ref=X.innerType,W.readOnly=!0},Ho=(e,R,W,Y)=>{let X=e._zod.def;so(X.innerType,R,Y),R.seen.get(e).ref=X.innerType},Po=(e,R,W,Y)=>{let X=e._zod.def;so(X.innerType,R,Y),R.seen.get(e).ref=X.innerType},$o=(e,R,W,Y)=>{let X=e._zod.innerType;so(X,R,Y),R.seen.get(e).ref=X},Od=N(`ZodISODateTime`,((e,R)=>{xu.init(e,R),Jd.init(e,R)}));function Wo(e){return function(e,R){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...se(R)})}(Od,e)}const kd=N(`ZodISODate`,((e,R)=>{Su.init(e,R),Jd.init(e,R)}));function Xo(e){return function(e,R){return new e({type:`string`,format:`date`,check:`string_format`,...se(R)})}(kd,e)}const Ad=N(`ZodISOTime`,((e,R)=>{Cu.init(e,R),Jd.init(e,R)}));function ts(e){return function(e,R){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...se(R)})}(Ad,e)}const jd=N(`ZodISODuration`,((e,R)=>{wu.init(e,R),Jd.init(e,R)}));function is(e){return function(e,R){return new e({type:`string`,format:`duration`,check:`string_format`,...se(R)})}(jd,e)}const ns=(e,R)=>{Vo.init(e,R),e.name=`ZodError`,Object.defineProperties(e,{format:{value:R=>function(e,R=e=>e.message){let W={_errors:[]},i=e=>{for(let Y of e.issues)if(Y.code===`invalid_union`&&Y.errors.length)Y.errors.map((e=>i({issues:e})));else if(Y.code===`invalid_key`)i({issues:Y.issues});else if(Y.code===`invalid_element`)i({issues:Y.issues});else if(Y.path.length===0)W._errors.push(R(Y));else{let e=W,X=0;for(;X<Y.path.length;){let W=Y.path[X];X===Y.path.length-1?(e[W]=e[W]||{_errors:[]},e[W]._errors.push(R(Y))):e[W]=e[W]||{_errors:[]},e=e[W],X++}}};return i(e),W}(e,R)},flatten:{value:R=>function(e,R=e=>e.message){let W={},Y=[];for(let X of e.issues)X.path.length>0?(W[X.path[0]]=W[X.path[0]]||[],W[X.path[0]].push(R(X))):Y.push(R(X));return{formErrors:Y,fieldErrors:W}}(e,R)},addIssue:{value:R=>{e.issues.push(R),e.message=JSON.stringify(e.issues,J,2)}},addIssues:{value:R=>{e.issues.push(...R),e.message=JSON.stringify(e.issues,J,2)}},isEmpty:{get:()=>e.issues.length===0}})},Md=(N(`ZodError`,ns),N(`ZodError`,ns,{Parent:Error})),Nd=Ee(Md),Pd=me(Md),Fd=we(Md),Id=ve(Md),Ld=ke(Md),Rd=De(Md),zd=Se(Md),Bd=xe(Md),Vd=ze(Md),Hd=Fe(Md),Ud=Le(Md),Wd=Ne(Md),Gd=N(`ZodType`,((e,R)=>(su.init(e,R),Object.assign(e[`~standard`],{jsonSchema:{input:co(e,`input`),output:co(e,`output`)}}),e.toJSONSchema=((e,R={})=>W=>{let Y=oo({...W,processors:R});return so(e,Y),ro(Y,e),ao(Y,e)})(e,{}),e.def=R,e.type=R.type,Object.defineProperty(e,"_def",{value:R}),e.check=(...W)=>e.clone($(R,{checks:[...R.checks??[],...W.map((e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e))]})),e.clone=(R,W)=>oe(e,R,W),e.brand=()=>e,e.register=(R,W)=>(R.add(e,W),e),e.parse=(R,W)=>Nd(e,R,W,{callee:e.parse}),e.safeParse=(R,W)=>Fd(e,R,W),e.parseAsync=async(R,W)=>Pd(e,R,W,{callee:e.parseAsync}),e.safeParseAsync=async(R,W)=>Id(e,R,W),e.spa=e.safeParseAsync,e.encode=(R,W)=>Ld(e,R,W),e.decode=(R,W)=>Rd(e,R,W),e.encodeAsync=async(R,W)=>zd(e,R,W),e.decodeAsync=async(R,W)=>Bd(e,R,W),e.safeEncode=(R,W)=>Vd(e,R,W),e.safeDecode=(R,W)=>Hd(e,R,W),e.safeEncodeAsync=async(R,W)=>Ud(e,R,W),e.safeDecodeAsync=async(R,W)=>Wd(e,R,W),e.refine=(R,W)=>e.check(ll(R,W)),e.superRefine=R=>e.check(cl(R)),e.overwrite=R=>e.check(Wn(R)),e.optional=()=>Sa(e),e.nullable=()=>za(e),e.nullish=()=>Sa(za(e)),e.nonoptional=R=>Ma(e,R),e.array=()=>Kr(e),e.or=R=>ia([e,R]),e.and=R=>la(e,R),e.transform=R=>Ha(e,ka(R)),e.default=R=>Na(e,R),e.prefault=R=>Ta(e,R),e.catch=R=>Za(e,R),e.pipe=R=>Ha(e,R),e.readonly=()=>Wa(e),e.describe=R=>{let W=e.clone();return Ed.add(W,{description:R}),W},Object.defineProperty(e,"description",{get:()=>Ed.get(e)?.description,configurable:!0}),e.meta=(...R)=>{if(R.length===0)return Ed.get(e);let W=e.clone();return Ed.add(W,R[0]),W},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e))),Kd=N(`_ZodString`,((e,R)=>{cu.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(R,W,Y)=>ho(e,R,W);let W=e._zod.bag;e.format=W.format??null,e.minLength=W.minimum??null,e.maxLength=W.maximum??null,e.regex=(...R)=>e.check(Zn(...R)),e.includes=(...R)=>e.check(Yn(...R)),e.startsWith=(...R)=>e.check(Hn(...R)),e.endsWith=(...R)=>e.check(Pn(...R)),e.min=(...R)=>e.check(Un(...R)),e.max=(...R)=>e.check(On(...R)),e.length=(...R)=>e.check(Jn(...R)),e.nonempty=(...R)=>e.check(Un(1,...R)),e.lowercase=R=>e.check(qn(R)),e.uppercase=R=>e.check(jn(R)),e.trim=()=>e.check(Xn()),e.normalize=(...R)=>e.check(Vn(...R)),e.toLowerCase=()=>e.check(eo()),e.toUpperCase=()=>e.check(to()),e.slugify=()=>e.check(Ao())})),qd=N(`ZodString`,((e,R)=>{cu.init(e,R),Kd.init(e,R),e.email=R=>e.check(sn(Yd,R)),e.url=R=>e.check(dn(Qd,R)),e.jwt=R=>e.check(bn(hf,R)),e.emoji=R=>e.check(hn($d,R)),e.guid=R=>e.check(rn(Xd,R)),e.uuid=R=>e.check(an(Zd,R)),e.uuidv4=R=>e.check(ln(Zd,R)),e.uuidv6=R=>e.check(cn(Zd,R)),e.uuidv7=R=>e.check(gn(Zd,R)),e.nanoid=R=>e.check(un(ef,R)),e.guid=R=>e.check(rn(Xd,R)),e.cuid=R=>e.check(In(tf,R)),e.cuid2=R=>e.check(pn(nf,R)),e.ulid=R=>e.check(fn(rf,R)),e.base64=R=>e.check(wn(ff,R)),e.base64url=R=>e.check(_n(pf,R)),e.xid=R=>e.check(Bn(af,R)),e.ksuid=R=>e.check(Cn(of,R)),e.ipv4=R=>e.check(En(sf,R)),e.ipv6=R=>e.check(Qn(lf,R)),e.cidrv4=R=>e.check(mn(uf,R)),e.cidrv6=R=>e.check(yn(df,R)),e.e164=R=>e.check(vn(mf,R)),e.datetime=R=>e.check(Wo(R)),e.date=R=>e.check(Xo(R)),e.time=R=>e.check(ts(R)),e.duration=R=>e.check(is(R))}));function Qs(e){return function(e,R){return new e({type:`string`,...se(R)})}(qd,e)}const Jd=N(`ZodStringFormat`,((e,R)=>{lu.init(e,R),Kd.init(e,R)})),Yd=N(`ZodEmail`,((e,R)=>{fu.init(e,R),Jd.init(e,R)}));function ws(e){return sn(Yd,e)}const Xd=N(`ZodGUID`,((e,R)=>{uu.init(e,R),Jd.init(e,R)}));function vs(e){return rn(Xd,e)}const Zd=N(`ZodUUID`,((e,R)=>{du.init(e,R),Jd.init(e,R)}));function ks(e){return an(Zd,e)}function Ds(e){return ln(Zd,e)}function Ss(e){return cn(Zd,e)}function xs(e){return gn(Zd,e)}const Qd=N(`ZodURL`,((e,R)=>{pu.init(e,R),Jd.init(e,R)}));function Fs(e){return dn(Qd,e)}function Ls(e){return dn(Qd,{protocol:/^https?$/,hostname:Ws,...se(e)})}const $d=N(`ZodEmoji`,((e,R)=>{mu.init(e,R),Jd.init(e,R)}));function Gs(e){return hn($d,e)}const ef=N(`ZodNanoID`,((e,R)=>{hu.init(e,R),Jd.init(e,R)}));function Rs(e){return un(ef,e)}const tf=N(`ZodCUID`,((e,R)=>{gu.init(e,R),Jd.init(e,R)}));function Os(e){return In(tf,e)}const nf=N(`ZodCUID2`,((e,R)=>{_u.init(e,R),Jd.init(e,R)}));function Js(e){return pn(nf,e)}const rf=N(`ZodULID`,((e,R)=>{vu.init(e,R),Jd.init(e,R)}));function qs(e){return fn(rf,e)}const af=N(`ZodXID`,((e,R)=>{yu.init(e,R),Jd.init(e,R)}));function Ys(e){return Bn(af,e)}const of=N(`ZodKSUID`,((e,R)=>{bu.init(e,R),Jd.init(e,R)}));function Ps(e){return Cn(of,e)}const sf=N(`ZodIPv4`,((e,R)=>{Tu.init(e,R),Jd.init(e,R)}));function Ks(e){return En(sf,e)}const cf=N(`ZodMAC`,((e,R)=>{Du.init(e,R),Jd.init(e,R)}));function Vs(e){return function(e,R){return new e({type:`string`,format:`mac`,check:`string_format`,abort:!1,...se(R)})}(cf,e)}const lf=N(`ZodIPv6`,((e,R)=>{Eu.init(e,R),Jd.init(e,R)}));function er(e){return Qn(lf,e)}const uf=N(`ZodCIDRv4`,((e,R)=>{Ou.init(e,R),Jd.init(e,R)}));function Ar(e){return mn(uf,e)}const df=N(`ZodCIDRv6`,((e,R)=>{ku.init(e,R),Jd.init(e,R)}));function nr(e){return yn(df,e)}const ff=N(`ZodBase64`,((e,R)=>{Au.init(e,R),Jd.init(e,R)}));function sr(e){return wn(ff,e)}const pf=N(`ZodBase64URL`,((e,R)=>{ju.init(e,R),Jd.init(e,R)}));function ar(e){return _n(pf,e)}const mf=N(`ZodE164`,((e,R)=>{Mu.init(e,R),Jd.init(e,R)}));function cr(e){return vn(mf,e)}const hf=N(`ZodJWT`,((e,R)=>{Nu.init(e,R),Jd.init(e,R)}));function dr(e){return bn(hf,e)}const gf=N(`ZodCustomStringFormat`,((e,R)=>{Pu.init(e,R),Jd.init(e,R)}));function ur(e,R,W={}){return no(gf,e,R,W)}function Ir(e){return no(gf,`hostname`,Us,e)}function pr(e){return no(gf,`hex`,Hc,e)}function fr(e,R){let W=`${e}_${R?.enc??`hex`}`,Y=Aa[W];if(!Y)throw Error(`Unrecognized hash format: ${W}`);return no(gf,W,Y,R)}const _f=N(`ZodNumber`,((e,R)=>{Fu.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(R,W,Y)=>uo(e,R,W),e.gt=(R,W)=>e.check(Sn(R,W)),e.gte=(R,W)=>e.check(xn(R,W)),e.min=(R,W)=>e.check(xn(R,W)),e.lt=(R,W)=>e.check(kn(R,W)),e.lte=(R,W)=>e.check(Dn(R,W)),e.max=(R,W)=>e.check(Dn(R,W)),e.int=R=>e.check(Qr(R)),e.safe=R=>e.check(Qr(R)),e.positive=R=>e.check(Sn(0,R)),e.nonnegative=R=>e.check(xn(0,R)),e.negative=R=>e.check(kn(0,R)),e.nonpositive=R=>e.check(Dn(0,R)),e.multipleOf=(R,W)=>e.check(Gn(R,W)),e.step=(R,W)=>e.check(Gn(R,W)),e.finite=()=>e;let W=e._zod.bag;e.minValue=Math.max(W.minimum??-1/0,W.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(W.maximum??1/0,W.exclusiveMaximum??1/0)??null,e.isInt=(W.format??``).includes(`int`)||Number.isSafeInteger(W.multipleOf??.5),e.isFinite=!0,e.format=W.format??null}));function Cr(e){return function(e,R){return new e({type:`number`,checks:[],...se(R)})}(_f,e)}const vf=N(`ZodNumberFormat`,((e,R)=>{Iu.init(e,R),_f.init(e,R)}));function Qr(e){return function(e,R){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...se(R)})}(vf,e)}function mr(e){return function(e,R){return new e({type:`number`,check:`number_format`,abort:!1,format:`float32`,...se(R)})}(vf,e)}function yr(e){return function(e,R){return new e({type:`number`,check:`number_format`,abort:!1,format:`float64`,...se(R)})}(vf,e)}function wr(e){return function(e,R){return new e({type:`number`,check:`number_format`,abort:!1,format:`int32`,...se(R)})}(vf,e)}function _r(e){return function(e,R){return new e({type:`number`,check:`number_format`,abort:!1,format:`uint32`,...se(R)})}(vf,e)}const yf=N(`ZodBoolean`,((e,R)=>{Lu.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(e,R,W)=>Io(0,0,R)}));function br(e){return function(e,R){return new e({type:`boolean`,...se(R)})}(yf,e)}const bf=N(`ZodBigInt`,((e,R)=>{Ru.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(e,R,W)=>po(0,e),e.gte=(R,W)=>e.check(xn(R,W)),e.min=(R,W)=>e.check(xn(R,W)),e.gt=(R,W)=>e.check(Sn(R,W)),e.gte=(R,W)=>e.check(xn(R,W)),e.min=(R,W)=>e.check(xn(R,W)),e.lt=(R,W)=>e.check(kn(R,W)),e.lte=(R,W)=>e.check(Dn(R,W)),e.max=(R,W)=>e.check(Dn(R,W)),e.positive=R=>e.check(Sn(BigInt(0),R)),e.negative=R=>e.check(kn(BigInt(0),R)),e.nonpositive=R=>e.check(Dn(BigInt(0),R)),e.nonnegative=R=>e.check(xn(BigInt(0),R)),e.multipleOf=(R,W)=>e.check(Gn(R,W));let W=e._zod.bag;e.minValue=W.minimum??null,e.maxValue=W.maximum??null,e.format=W.format??null}));function Dr(e){return function(e,R){return new e({type:`bigint`,...se(R)})}(bf,e)}const xf=N(`ZodBigIntFormat`,((e,R)=>{zu.init(e,R),bf.init(e,R)}));function xr(e){return function(e,R){return new e({type:`bigint`,check:`bigint_format`,abort:!1,format:`int64`,...se(R)})}(xf,e)}function zr(e){return function(e,R){return new e({type:`bigint`,check:`bigint_format`,abort:!1,format:`uint64`,...se(R)})}(xf,e)}const Sf=N(`ZodSymbol`,((e,R)=>{Bu.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(e,R,W)=>fo(0,e)}));function Lr(e){return function(e,R){return new e({type:`symbol`,...se(R)})}(Sf,e)}const Cf=N(`ZodUndefined`,((e,R)=>{Vu.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(e,R,W)=>Co(0,e)}));function Gr(e){return function(e,R){return new e({type:`undefined`,...se(R)})}(Cf,e)}const wf=N(`ZodNull`,((e,R)=>{Hu.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(e,R,W)=>Bo(0,e,R)}));function Rr(e){return function(e,R){return new e({type:`null`,...se(R)})}(wf,e)}const Tf=N(`ZodAny`,((e,R)=>{Uu.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(e,R,W)=>{}}));function Or(){return function(e){return new e({type:`any`})}(Tf)}const Ef=N(`ZodUnknown`,((e,R)=>{Wu.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(e,R,W)=>{}}));function Jr(){return function(e){return new e({type:`unknown`})}(Ef)}const Df=N(`ZodNever`,((e,R)=>{Gu.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(e,R,W)=>Qo(0,0,R)}));function qr(e){return function(e,R){return new e({type:`never`,...se(R)})}(Df,e)}const Of=N(`ZodVoid`,((e,R)=>{Ku.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(e,R,W)=>Eo(0,e)}));function Yr(e){return function(e,R){return new e({type:`void`,...se(R)})}(Of,e)}const kf=N(`ZodDate`,((e,R)=>{qu.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(e,R,W)=>mo(0,e),e.min=(R,W)=>e.check(xn(R,W)),e.max=(R,W)=>e.check(Dn(R,W));let W=e._zod.bag;e.minDate=W.minimum?new Date(W.minimum):null,e.maxDate=W.maximum?new Date(W.maximum):null}));function Pr(e){return function(e,R){return new e({type:`date`,...se(R)})}(kf,e)}const Af=N(`ZodArray`,((e,R)=>{Ju.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(R,W,Y)=>Lo(e,R,W,Y),e.element=R.element,e.min=(R,W)=>e.check(Un(R,W)),e.nonempty=R=>e.check(Un(1,R)),e.max=(R,W)=>e.check(On(R,W)),e.length=(R,W)=>e.check(Jn(R,W)),e.unwrap=()=>e.element}));function Kr(e,R){return function(e,R,W){return new e({type:`array`,element:R,...se(W)})}(Af,e,R)}function Wr(e){let R=e._zod.def.shape;return Qa(Object.keys(R))}const jf=N(`ZodObject`,((e,R)=>{Xu.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(R,W,Y)=>No(e,R,W,Y),H(e,`shape`,(()=>R.shape)),e.keyof=()=>Qa(Object.keys(e._zod.def.shape)),e.catchall=R=>e.clone({...e._zod.def,catchall:R}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Jr()}),e.loose=()=>e.clone({...e._zod.def,catchall:Jr()}),e.strict=()=>e.clone({...e._zod.def,catchall:qr()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=R=>function(e,R){if(!ee(R))throw Error(`Invalid input to extend: expected a plain object`);let W=e._zod.def.checks;if(W&&W.length>0)throw Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");return oe(e,$(e._zod.def,{get shape(){let W={...e._zod.def.shape,...R};return P(this,`shape`,W),W},checks:[]}))}(e,R),e.safeExtend=R=>function(e,R){if(!ee(R))throw Error(`Invalid input to safeExtend: expected a plain object`);return oe(e,{...e._zod.def,get shape(){let W={...e._zod.def.shape,...R};return P(this,`shape`,W),W},checks:e._zod.def.checks})}(e,R),e.merge=R=>function(e,R){return oe(e,$(e._zod.def,{get shape(){let W={...e._zod.def.shape,...R._zod.def.shape};return P(this,`shape`,W),W},get catchall(){return R._zod.def.catchall},checks:[]}))}(e,R),e.pick=R=>function(e,R){let W=e._zod.def;return oe(e,$(e._zod.def,{get shape(){let e={};for(let Y in R){if(!(Y in W.shape))throw Error(`Unrecognized key: "${Y}"`);R[Y]&&(e[Y]=W.shape[Y])}return P(this,`shape`,e),e},checks:[]}))}(e,R),e.omit=R=>function(e,R){let W=e._zod.def;return oe(e,$(e._zod.def,{get shape(){let Y={...e._zod.def.shape};for(let e in R){if(!(e in W.shape))throw Error(`Unrecognized key: "${e}"`);R[e]&&delete Y[e]}return P(this,`shape`,Y),Y},checks:[]}))}(e,R),e.partial=(...R)=>function(e,R,W){return oe(R,$(R._zod.def,{get shape(){let Y=R._zod.def.shape,X={...Y};if(W)for(let R in W){if(!(R in Y))throw Error(`Unrecognized key: "${R}"`);W[R]&&(X[R]=e?new e({type:`optional`,innerType:Y[R]}):Y[R])}else for(let R in Y)X[R]=e?new e({type:`optional`,innerType:Y[R]}):Y[R];return P(this,`shape`,X),X},checks:[]}))}(Wf,e,R[0]),e.required=(...R)=>function(e,R,W){return oe(R,$(R._zod.def,{get shape(){let Y=R._zod.def.shape,X={...Y};if(W)for(let R in W){if(!(R in X))throw Error(`Unrecognized key: "${R}"`);W[R]&&(X[R]=new e({type:`nonoptional`,innerType:Y[R]}))}else for(let R in Y)X[R]=new e({type:`nonoptional`,innerType:Y[R]});return P(this,`shape`,X),X},checks:[]}))}(Jf,e,R[0])}));function Xr(e,R){return new jf({type:`object`,shape:e??{},...se(R)})}function ea(e,R){return new jf({type:`object`,shape:e,catchall:qr(),...se(R)})}function ta(e,R){return new jf({type:`object`,shape:e,catchall:Jr(),...se(R)})}const Mf=N(`ZodUnion`,((e,R)=>{Zu.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(R,W,Y)=>Go(e,R,W,Y),e.options=R.options}));function ia(e,R){return new Mf({type:`union`,options:e,...se(R)})}const Nf=N(`ZodXor`,((e,R)=>{Mf.init(e,R),Qu.init(e,R),e._zod.processJSONSchema=(R,W,Y)=>Go(e,R,W,Y),e.options=R.options}));function oa(e,R){return new Nf({type:`union`,options:e,inclusive:!1,...se(R)})}const Pf=N(`ZodDiscriminatedUnion`,((e,R)=>{Mf.init(e,R),$u.init(e,R)}));function ra(e,R,W){return new Pf({type:`union`,options:R,discriminator:e,...se(W)})}const Ff=N(`ZodIntersection`,((e,R)=>{ed.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(R,W,Y)=>To(e,R,W,Y)}));function la(e,R){return new Ff({type:`intersection`,left:e,right:R})}const If=N(`ZodTuple`,((e,R)=>{td.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(R,W,Y)=>Ro(e,R,W,Y),e.rest=R=>e.clone({...e._zod.def,rest:R})}));function ga(e,R,W){let Y=R instanceof su;return new If({type:`tuple`,items:e,rest:Y?R:null,...se(Y?W:R)})}const Lf=N(`ZodRecord`,((e,R)=>{nd.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(R,W,Y)=>Mo(e,R,W,Y),e.keyType=R.keyType,e.valueType=R.valueType}));function ha(e,R,W){return new Lf({type:`record`,keyType:e,valueType:R,...se(W)})}function ua(e,R,W){let Y=oe(e);return Y._zod.values=void 0,new Lf({type:`record`,keyType:Y,valueType:R,...se(W)})}function Ia(e,R,W){return new Lf({type:`record`,keyType:e,valueType:R,mode:`loose`,...se(W)})}const Rf=N(`ZodMap`,((e,R)=>{rd.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(e,R,W)=>zo(0,e),e.keyType=R.keyType,e.valueType=R.valueType}));function fa(e,R,W){return new Rf({type:`map`,keyType:e,valueType:R,...se(W)})}const zf=N(`ZodSet`,((e,R)=>{id.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(e,R,W)=>Fo(0,e),e.min=(...R)=>e.check(Rn(...R)),e.nonempty=R=>e.check(Rn(1,R)),e.max=(...R)=>e.check(Tn(...R)),e.size=(...R)=>e.check(Mn(...R))}));function Ca(e,R){return new zf({type:`set`,valueType:e,...se(R)})}const Bf=N(`ZodEnum`,((e,R)=>{ad.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(R,W,Y)=>yo(e,0,W),e.enum=R.entries,e.options=Object.values(R.entries);let W=new Set(Object.keys(R.entries));e.extract=(e,Y)=>{let X={};for(let Y of e){if(!W.has(Y))throw Error(`Key ${Y} not found in enum`);X[Y]=R.entries[Y]}return new Bf({...R,checks:[],...se(Y),entries:X})},e.exclude=(e,Y)=>{let X={...R.entries};for(let R of e){if(!W.has(R))throw Error(`Key ${R} not found in enum`);delete X[R]}return new Bf({...R,checks:[],...se(Y),entries:X})}}));function Qa(e,R){return new Bf({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map((e=>[e,e]))):e,...se(R)})}function ma(e,R){return new Bf({type:`enum`,entries:e,...se(R)})}const Vf=N(`ZodLiteral`,((e,R)=>{od.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(R,W,Y)=>wo(e,R,W),e.values=new Set(R.values),Object.defineProperty(e,"value",{get(){if(R.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return R.values[0]}})}));function wa(e,R){return new Vf({type:`literal`,values:Array.isArray(e)?e:[e],...se(R)})}const Hf=N(`ZodFile`,((e,R)=>{sd.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(R,W,Y)=>bo(e,0,W),e.min=(R,W)=>e.check(Rn(R,W)),e.max=(R,W)=>e.check(Tn(R,W)),e.mime=(R,W)=>e.check(Kn(Array.isArray(R)?R:[R],W))}));function va(e){return function(e,R){return new e({type:`file`,...se(R)})}(Hf,e)}const Uf=N(`ZodTransform`,((e,R)=>{cd.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(e,R,W)=>xo(0,e),e._zod.parse=(W,Y)=>{if(Y.direction===`backward`)throw new T(e.constructor.name);W.addIssue=Y=>{if(typeof Y==`string`)W.issues.push(pe(Y,W.value,R));else{let R=Y;R.fatal&&(R.continue=!1),R.code??=`custom`,R.input??=W.value,R.inst??=e,W.issues.push(pe(R))}};let X=R.transform(W.value,W);return X instanceof Promise?X.then((e=>(W.value=e,W))):(W.value=X,W)}}));function ka(e){return new Uf({type:`transform`,transform:e})}const Wf=N(`ZodOptional`,((e,R)=>{ld.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(R,W,Y)=>Po(e,R,0,Y),e.unwrap=()=>e._zod.def.innerType}));function Sa(e){return new Wf({type:`optional`,innerType:e})}const Gf=N(`ZodNullable`,((e,R)=>{ud.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(R,W,Y)=>Oo(e,R,W,Y),e.unwrap=()=>e._zod.def.innerType}));function za(e){return new Gf({type:`nullable`,innerType:e})}function Fa(e){return Sa(za(e))}const Kf=N(`ZodDefault`,((e,R)=>{dd.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(R,W,Y)=>Jo(e,R,W,Y),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap}));function Na(e,R){return new Kf({type:`default`,innerType:e,get defaultValue(){return typeof R==`function`?R():te(R)}})}const qf=N(`ZodPrefault`,((e,R)=>{fd.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(R,W,Y)=>Zo(e,R,W,Y),e.unwrap=()=>e._zod.def.innerType}));function Ta(e,R){return new qf({type:`prefault`,innerType:e,get defaultValue(){return typeof R==`function`?R():te(R)}})}const Jf=N(`ZodNonOptional`,((e,R)=>{pd.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(R,W,Y)=>Uo(e,R,0,Y),e.unwrap=()=>e._zod.def.innerType}));function Ma(e,R){return new Jf({type:`nonoptional`,innerType:e,...se(R)})}const Yf=N(`ZodSuccess`,((e,R)=>{md.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(e,R,W)=>ko(0,0,R),e.unwrap=()=>e._zod.def.innerType}));function Ua(e){return new Yf({type:`success`,innerType:e})}const Xf=N(`ZodCatch`,((e,R)=>{hd.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(R,W,Y)=>qo(e,R,W,Y),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap}));function Za(e,R){return new Xf({type:`catch`,innerType:e,catchValue:typeof R==`function`?R:()=>R})}const Zf=N(`ZodNaN`,((e,R)=>{gd.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(e,R,W)=>_o(0,e)}));function ja(e){return function(e,R){return new e({type:`nan`,...se(R)})}(Zf,e)}const Qf=N(`ZodPipe`,((e,R)=>{_d.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(R,W,Y)=>jo(e,R,0,Y),e.in=R.in,e.out=R.out}));function Ha(e,R){return new Qf({type:`pipe`,in:e,out:R})}const $f=N(`ZodCodec`,((e,R)=>{Qf.init(e,R),vd.init(e,R)}));function $a(e,R,W){return new $f({type:`pipe`,in:e,out:R,transform:W.decode,reverseTransform:W.encode})}const ep=N(`ZodReadonly`,((e,R)=>{yd.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(R,W,Y)=>Yo(e,R,W,Y),e.unwrap=()=>e._zod.def.innerType}));function Wa(e){return new ep({type:`readonly`,innerType:e})}const tp=N(`ZodTemplateLiteral`,((e,R)=>{bd.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(R,W,Y)=>vo(e,0,W)}));function Xa(e,R){return new tp({type:`template_literal`,parts:e,...se(R)})}const np=N(`ZodLazy`,((e,R)=>{Cd.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(R,W,Y)=>$o(e,R,0,Y),e.unwrap=()=>e._zod.def.getter()}));function tl(e){return new np({type:`lazy`,getter:e})}const rp=N(`ZodPromise`,((e,R)=>{Sd.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(R,W,Y)=>Ho(e,R,0,Y),e.unwrap=()=>e._zod.def.innerType}));function il(e){return new rp({type:`promise`,innerType:e})}const ip=N(`ZodFunction`,((e,R)=>{xd.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(e,R,W)=>So(0,e)}));function ol(e){return new ip({type:`function`,input:Array.isArray(e?.input)?ga(e?.input):e?.input??Kr(Jr()),output:e?.output??Jr()})}const ap=N(`ZodCustom`,((e,R)=>{wd.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(e,R,W)=>Do(0,e)}));function rl(e){let R=new Al({check:`custom`});return R._zod.check=e,R}function al(e,R){return function(e,R,W){let Y=se(W);return Y.abort??=!0,new e({type:`custom`,check:`custom`,fn:R,...Y})}(ap,e??(()=>!0),R)}function ll(e,R={}){return function(e,R,W){return new e({type:`custom`,check:`custom`,fn:R,...se(W)})}(ap,e,R)}function cl(e){return io(e)}const gl=function(e){let R=new Al({check:`describe`});return R._zod.onattach=[R=>{let W=Ed.get(R)??{};Ed.add(R,{...W,description:e})}],R._zod.check=()=>{},R},dl=function(e){let R=new Al({check:`meta`});return R._zod.onattach=[R=>{let W=Ed.get(R)??{};Ed.add(R,{...W,...e})}],R._zod.check=()=>{},R};function hl(e,R={error:`Input not instance of ${e.name}`}){let W=new ap({type:`custom`,check:`custom`,fn:R=>R instanceof e,abort:!0,...se(R)});return W._zod.bag.Class=e,W}const ul=(...e)=>function(e,R){let W=se(R),Y=W.truthy??[`true`,`1`,`yes`,`on`,`y`,`enabled`],X=W.falsy??[`false`,`0`,`no`,`off`,`n`,`disabled`];W.case!==`sensitive`&&(Y=Y.map((e=>typeof e==`string`?e.toLowerCase():e)),X=X.map((e=>typeof e==`string`?e.toLowerCase():e)));let ie=new Set(Y),ae=new Set(X),le=e.Codec??vd,_e=e.Boolean??Lu,ye=new le({type:`pipe`,in:new(e.String??cu)({type:`string`,error:W.error}),out:new _e({type:`boolean`,error:W.error}),transform:(e,R)=>{let Y=e;return W.case!==`sensitive`&&(Y=Y.toLowerCase()),!!ie.has(Y)||!ae.has(Y)&&(R.issues.push({code:`invalid_value`,expected:`stringbool`,values:[...ie,...ae],input:R.value,inst:ye,continue:!1}),{})},reverseTransform:(e,R)=>!0===e?Y[0]||`true`:X[0]||`false`,error:W.error});return ye}({Codec:$f,Boolean:yf,String:qd},...e);function Il(e){let R=tl((()=>ia([Qs(e),Cr(),br(),Rr(),Kr(R),ha(Qs(),R)])));return R}function pl(e,R){return Ha(ka(e),R)}var op;op||={},M({localeError:tn()});const sp=ra(`type`,[Xr({name:Qs(),type:wa(`int`),value:Cr().int()}),Xr({name:Qs(),type:wa(`bool`),value:br()}),Xr({name:Qs(),type:wa(`float`),value:Cr()}),Xr({name:Qs(),type:wa(`string`),value:Qs()}),Xr({name:Qs(),type:wa(`file`),value:Qs()}),Xr({name:Qs(),type:wa(`color`),value:Qs()}),Xr({name:Qs(),type:wa(`object`),value:Cr()})]),cp=Xr({name:Qs(),type:wa(`tilelayer`),class:Qs().optional(),height:Cr(),width:Cr(),x:Cr(),y:Cr(),id:Cr(),opacity:Cr(),properties:Kr(sp).optional(),visible:br(),tintcolor:Qs().optional(),parallaxx:Cr().optional(),parallaxy:Cr().optional(),offsetx:Cr().optional(),offsety:Cr().optional()}),lp=cp.extend({data:Kr(Cr()),encoding:wa(`csv`)}),up=cp.extend({data:Kr(Cr()),encoding:wa(`base64`),compression:wa(`gzip`)}),dp=cp.extend({data:Kr(Cr()),encoding:wa(`base64`),compression:wa(`zlib`)}),fp=cp.extend({data:Kr(Cr()),encoding:wa(`base64`),compression:wa(`zstandard`)}),pp=cp.extend({data:Qs(),encoding:wa(`base64`),compression:Qs().optional()}),mp=ia([Xr({x:Cr(),y:Cr(),width:Cr(),height:Cr(),data:Qs()}),Xr({x:Cr(),y:Cr(),width:Cr(),height:Cr(),data:Kr(Cr())})]),hp=ia([pp,lp,up,dp,fp,cp.extend({startx:Cr(),starty:Cr(),chunks:Kr(mp),encoding:Qs().optional(),compression:Qs().optional(),data:Gr()})]);function kl(e){return e.encoding===`base64`}function Dl(e){return e.encoding===`csv`||Array.isArray(e.data)}const gp=Xr({x:Cr(),y:Cr()}),_p=Kr(gp),vp=Xr({text:Qs(),color:Qs().optional(),fontfamily:Qs().optional(),pixelsize:Cr().optional(),wrap:br().optional(),halign:ia([wa(`left`),wa(`center`),wa(`right`),wa(`justify`)]).optional(),valign:ia([wa(`top`),wa(`center`),wa(`bottom`)]).optional()}),yp=Xr({id:Cr().optional(),name:Qs().optional(),type:Qs().optional(),x:Cr().optional(),y:Cr().optional(),rotation:Cr().optional(),height:Cr().optional(),width:Cr().optional(),visible:br().optional(),gid:Cr().optional(),text:vp.optional(),point:br().optional(),ellipse:br().optional(),polyline:Kr(gp).optional(),polygon:_p.optional(),template:Qs().optional(),properties:Kr(sp).optional()}),bp=Xr({duration:Cr(),tileid:Cr()}),xp=Xr({name:Qs(),draworder:Qs(),type:wa(`objectgroup`),class:Qs().optional(),x:Cr(),y:Cr(),id:Cr(),color:Qs().optional(),tintcolor:Qs().optional(),parallaxx:Cr().optional(),parallaxy:Cr().optional(),offsetx:Cr().optional(),offsety:Cr().optional(),opacity:Cr(),properties:Kr(sp).optional(),visible:br(),objects:Kr(yp)}),Sp=ia([hp,Xr({name:Qs(),x:Cr(),y:Cr(),id:Cr(),type:wa(`imagelayer`),class:Qs().optional(),image:Qs().optional(),opacity:Cr(),properties:Kr(sp).optional(),visible:br(),tintcolor:Qs().optional(),repeatx:br().optional(),repeaty:br().optional(),parallaxx:Cr().optional(),parallaxy:Cr().optional(),offsetx:Cr().optional(),offsety:Cr().optional(),transparentcolor:Qs().optional()}),xp]),Cp=Xr({draworder:Qs(),id:Cr().optional(),name:Qs(),x:Cr(),y:Cr(),opacity:Cr(),tintcolor:Qs().optional(),type:wa(`objectgroup`),visible:br(),objects:Kr(yp),properties:Kr(sp).optional()}),wp=Xr({id:Cr(),type:Qs().optional(),animation:Kr(bp).optional(),objectgroup:Cp.optional(),probability:Cr().optional(),properties:Kr(sp).optional(),image:Qs().optional(),imageheight:Cr().optional(),imagewidth:Cr().optional()}),Tp=Xr({name:Qs(),firstgid:Cr().optional(),class:Qs().optional(),objectalignment:ia([wa(`topleft`),wa(`top`),wa(`topright`),wa(`left`),wa(`center`),wa(`right`),wa(`bottomleft`),wa(`bottom`),wa(`bottomright`)]).optional(),image:Qs().optional(),imagewidth:Cr().optional(),imageheight:Cr().optional(),columns:Cr(),tileheight:Cr(),tilewidth:Cr(),tilecount:Cr(),grid:Xr({height:Cr(),width:Cr(),orientation:ia([wa(`isometric`),wa(`orthogonal`)])}).optional(),tileoffset:gp.optional(),spacing:Cr(),margin:Cr(),tiles:Kr(wp).optional(),properties:Kr(sp).optional()});function Ol(e){return!!e.image}function Ul(e){return!e.image}const Ep=Tp.extend({tiledversion:Qs().optional(),type:wa(`tileset`),version:Qs().optional()}),Dp=Xr({firstgid:Cr(),source:Qs()}),Op=ia([Tp,Dp]),kp=Xr({object:yp.extend({id:Cr().optional()}),tileset:Dp.optional(),type:wa(`template`)}),Ap=Xr({type:Qs(),class:Qs().optional(),tiledversion:Qs(),version:Qs(),width:Cr(),height:Cr(),tilewidth:Cr(),tileheight:Cr(),compressionlevel:Cr().optional(),infinite:br(),nextlayerid:Cr(),nextobjectid:Cr(),parallaxoriginx:Cr().optional(),parallaxoriginy:Cr().optional(),hexsidelength:Cr().optional(),staggeraxis:wa(`y`).or(wa(`x`)).optional(),staggerindex:wa(`odd`).or(wa(`even`)).optional(),orientation:ia([wa(`isometric`),wa(`orthogonal`),wa(`staggered`),wa(`hexagonal`)]),renderorder:ia([wa(`right-down`),wa(`right-up`),wa(`left-down`),wa(`left-up`)]),backgroundcolor:Qs().optional(),layers:Kr(Sp),tilesets:Kr(Op),properties:Kr(sp).optional()});function Hl(e){return!!e.chunks}function Pl(e){return!e.source}function $l(e){return!!e.source}var jp=class Kl{constructor(e,R,W,Y){this.x=e,this.y=R,this.width=W,this.height=Y}combine(e){let R=this.x+this.width,W=this.y+this.height,Y=e.x+e.width,X=e.y+e.height,ie=Math.max(R,Y),ae=Math.max(W,X);return new Kl(Math.min(this.x,e.x),Math.min(this.y,e.y),ie-Math.min(this.x,e.x),ae-Math.min(this.y,e.y))}},Wl=class{constructor(){this._largestBounds=new jp(0,0,0,0)}_coerceNumber(e){return+e}_coerceBoolean(e){switch(e){case`0`:case`false`:return!1;case`true`:return!0;default:return!!e}}_coerceType(e,R){return e===`bool`?this._coerceBoolean(R):e===`int`||e===`float`||e===`object`?this._coerceNumber(R):R}_parsePropertiesNode(e,R){let W=[];if(e)for(let R of e.children){let e=R.getAttribute(`type`)??`string`,Y=R.getAttribute(`value`);Y||=R.innerHTML,W.push({name:R.getAttribute(`name`),type:e,value:this._coerceType(e,Y)})}R.properties=W}_parseAttributes(e,R){let W=`width.height.columns.firstgid.spacing.margin.tilecount.tilewidth.tileheight.opacity.compressionlevel.nextlayerid.nextobjectid.parallaxoriginx.parallaxoriginy.parallaxx.parallaxy.hexsidelength.offsetx.offsety.id.gid.x.y.rotation.probability`.split(`.`),Y=[`infinite`,`visible`,`repeatx`,`repeaty`];for(let X of e.attributes)W.indexOf(X.name)>-1?R[X.name]=this._coerceNumber(X.value):Y.indexOf(X.name)>-1?R[X.name]=this._coerceBoolean(X.value):R[X.name]=X.value}_parseToDocument(e){if(typeof DOMParser<`u`)return new DOMParser().parseFromString(e,`application/xml`);try{let{JSDOM:R}=S(371);return new R(e,{contentType:`application/xml`,encoding:`utf-8`}).window.document}catch{}let R=Error(`Could not find DOM parser`);throw console.error(R.message,R),R}parseObject(e,R=!0){let W={type:``,x:0,y:0};e.getAttribute(`template`)||(W.visible=!0,W.name=``,W.rotation=0,W.height=0,W.width=0),this._parseAttributes(e,W);let Y=e.querySelector(`properties`);Y&&this._parsePropertiesNode(Y,W);let X=e.querySelector(`text`);if(X){W.text={text:X.textContent};let e=X.getAttribute(`fontfamily`);e&&(W.text.fontfamily=e);let R=X.getAttribute(`color`);R&&(W.text.color=R);let Y=X.getAttribute(`pixelsize`);Y&&(W.text.pixelsize=this._coerceNumber(Y));let ie=X.getAttribute(`wrap`);ie&&(W.text.wrap=this._coerceBoolean(ie));let ae=X.getAttribute(`valign`);ae&&(W.text.valign=ae);let le=X.getAttribute(`halign`);le&&(W.text.halign=le)}e.querySelector(`point`)&&(W.point=!0),e.querySelector(`ellipse`)&&(W.ellipse=!0);let ie=e.querySelector(`polygon`);if(ie){let e=ie.getAttribute(`points`)?.split(` `);W.polygon=[],e&&e.forEach((e=>{let R=e.split(`,`);W.polygon.push({x:+R[0],y:+R[1]})}))}let ae=e.querySelector(`polyline`);if(ae){let e=ae.getAttribute(`points`)?.split(` `);W.polyline=[],e&&e.forEach((e=>{let R=e.split(`,`);W.polyline.push({x:+R[0],y:+R[1]})}))}if(R)try{return yp.parse(W)}catch(e){throw console.error(`Could not parse object`,W,e),e}return W}parseTileset(e,R=!0){let W={spacing:0,margin:0};if(this._parseAttributes(e,W),W.source)try{return Op.parse(W)}catch(e){console.error(`Could not parse external tileset`,W,e)}for(let Y of e.children)switch(Y.tagName){case`properties`:this._parsePropertiesNode(Y,W);break;case`tileoffset`:{let e={};this._parseAttributes(Y,e),W.tileoffset=e;break}case`grid`:{let e={};this._parseAttributes(Y,e),W.grid=e;break}case`image`:W.image=Y.getAttribute(`source`),W.imagewidth=this._coerceNumber(Y.getAttribute(`width`)),W.imageheight=this._coerceNumber(Y.getAttribute(`height`));break;case`tile`:{W.tiles||=[];let e={};this._parseAttributes(Y,e);for(let W of Y.children)switch(W.tagName){case`image`:e.image=W.getAttribute(`source`),e.imagewidth=this._coerceNumber(W.getAttribute(`width`)),e.imageheight=this._coerceNumber(W.getAttribute(`height`));break;case`objectgroup`:{let Y={type:`objectgroup`,name:``,visible:!0,x:0,y:0,opacity:1,objects:[]};this._parseAttributes(W,Y),e.objectgroup=Y;for(let e of W.children){let W=this.parseObject(e,R);Y.objects.push(W)}break}case`animation`:{let R=[];for(let e of W.children)R.push({duration:this._coerceNumber(e.getAttribute(`duration`)),tileid:this._coerceNumber(e.getAttribute(`tileid`))});e.animation=R;break}case`properties`:this._parsePropertiesNode(W,e)}if(R)try{W.tiles.push(wp.parse(e))}catch(R){throw console.error(`Could not parse Tile`,e,R),R}else W.tiles.push(e);break}}if(R)try{return Op.parse(W)}catch(e){throw console.error(`Could not parse Tileset`,W,e),e}return W}parseTileLayer(e,R,W=!0){let Y={type:`tilelayer`,x:0,y:0,opacity:1,visible:!0};this._parseAttributes(e,Y);for(let W of e.children)switch(W.tagName){case`properties`:this._parsePropertiesNode(W,Y);break;case`data`:{let e=W.getAttribute(`encoding`);e&&(Y.encoding=e);let X=W.getAttribute(`compression`);if(X&&(Y.compression=X),R){Y.width=0,Y.height=0,Y.chunks=[];let e=new jp(0,0,0,0);for(let R of W.children)if(R.tagName===`chunk`){let W={};switch(this._parseAttributes(R,W),Y.encoding){case`base64`:W.data=R.textContent?.trim();break;case`csv`:W.data=R.textContent?.split(`,`).map((e=>+e))}let X=new jp(W.x,W.y,W.width,W.height);e=e.combine(X),Y.chunks.push(W)}Y.width=e.width,Y.height=e.height,Y.startx=e.x,Y.starty=e.y,this._largestBounds=this._largestBounds.combine(new jp(Y.startx,Y.starty,Y.width,Y.height))}else switch(Y.encoding){case`base64`:Y.data=W.textContent?.trim();break;case`csv`:Y.data=W.textContent?.split(`,`).map((e=>+e))}}}if(W)try{return Sp.parse(Y)}catch(e){throw console.error(`Could not parse tiled tile layer`,Y,e),e}return Y}parseObjectGroup(e,R=!0){let W={type:`objectgroup`,draworder:`topdown`,visible:!0,x:0,y:0,opacity:1,objects:[]};this._parseAttributes(e,W);for(let Y of e.children)switch(Y.tagName){case`properties`:this._parsePropertiesNode(Y,W);break;case`object`:{let e=this.parseObject(Y,R);W.objects.push(e);break}}if(R)try{return Sp.parse(W)}catch(e){throw console.error(`Could not parse object group`,W,e),e}return W}parseImageLayer(e,R=!0){let W={type:`imagelayer`,visible:!0,x:0,y:0,opacity:1},Y=e.querySelector(`image`);W.image=Y?.getAttribute(`source`);let X=e.querySelector(`properties`);X&&this._parsePropertiesNode(X,W);let ie=Y?.getAttribute(`trans`);if(ie&&(W.transparentcolor=`#`+ie),this._parseAttributes(e,W),R)try{return Sp.parse(W)}catch(e){throw console.error(`Could not parse layer`,W,e),e}return W}parseExternalTemplate(e,R=!0){let W=this._parseToDocument(e).querySelector(`template`),Y={type:`template`},X=W.querySelector(`object`);X&&(Y.object=this.parseObject(X,R));let ie=W.querySelector(`tileset`);if(ie&&(Y.tileset=this.parseTileset(ie,R)),R)try{return kp.parse(Y)}catch(e){throw console.error(`Could not parse template`,Y,e),e}return Y}parseExternalTileset(e,R=!0){let W=this._parseToDocument(e).querySelector(`tileset`),Y=this.parseTileset(W,R);if(Y.type=`tileset`,this._parseAttributes(W,Y),R)try{return Ep.parse(Y)}catch(e){throw console.error(`Could not parse tileset file`,Y,e),e}return Y}parse(e,R=!0){let W=this._parseToDocument(e).querySelector(`map`),Y={type:`map`,compressionlevel:-1,layers:[],tilesets:[]};this._parseAttributes(W,Y);let n=(e,R=!0)=>{switch(e.tagName){case`group`:for(let W of e.children)n(W,R);break;case`layer`:{let W=this.parseTileLayer(e,Y.infinite,R);Y.layers.push(W);break}case`properties`:this._parsePropertiesNode(e,Y);break;case`tileset`:{let W=this.parseTileset(e,R);Y.tilesets.push(W);break}case`objectgroup`:{let W=this.parseObjectGroup(e,R);Y.layers.push(W);break}case`imagelayer`:{let W=this.parseImageLayer(e,R);Y.layers.push(W);break}}};for(let e of W.children)n(e,R);if(R)try{return Ap.parse(Y)}catch(e){throw console.error(`Could not parse Tiled map`,e),e}return Y}},Mp=S(668);let Np,Pp,Fp;const Ip={env:{emscripten_notify_memory_growth:function(e){Fp=new Uint8Array(Pp.exports.memory.buffer)}}};var ic=class{init(){return Np||(Np=typeof fetch<`u`?fetch(`data:application/wasm;base64,`+Lp).then((e=>e.arrayBuffer())).then((e=>WebAssembly.instantiate(e,Ip))).then(this._init):WebAssembly.instantiate(Buffer.from(Lp,`base64`),Ip).then(this._init),Np)}_init(e){Pp=e.instance,Ip.env.emscripten_notify_memory_growth(0)}decode(e,R=0){if(!Pp)throw Error(`ZSTDDecoder: Await .init() before decoding.`);let W=e.byteLength,Y=Pp.exports.malloc(W);Fp.set(e,Y),R||=Number(Pp.exports.ZSTD_findDecompressedSize(Y,W));let X=Pp.exports.malloc(R),ie=Pp.exports.ZSTD_decompress(X,R,Y,W),ae=Fp.slice(X,X+ie);return Pp.exports.free(Y),Pp.exports.free(X),ae}};const Lp=`AGFzbQEAAAABpQEVYAF/AX9gAn9/AGADf39/AX9gBX9/f39/AX9gAX8AYAJ/fwF/YAR/f39/AX9gA39/fwBgBn9/f39/fwF/YAd/f39/f39/AX9gAn9/AX5gAn5+AX5gAABgBX9/f39/AGAGf39/f39/AGAIf39/f39/f38AYAl/f39/f39/f38AYAABf2AIf39/f39/f38Bf2ANf39/f39/f39/f39/fwF/YAF/AX4CJwEDZW52H2Vtc2NyaXB0ZW5fbm90aWZ5X21lbW9yeV9ncm93dGgABANpaAEFAAAFAgEFCwACAQABAgIFBQcAAwABDgsBAQcAEhMHAAUBDAQEAAANBwQCAgYCBAgDAwMDBgEACQkHBgICAAYGAgQUBwYGAwIGAAMCAQgBBwUGCgoEEQAEBAEIAwgDBQgDEA8IAAcABAUBcAECAgUEAQCAAgYJAX8BQaCgwAILB2AHBm1lbW9yeQIABm1hbGxvYwAoBGZy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QX9qIAE6AAAgACABOgAAIAJBA0kNACADQX5qIAE6AAAgACABOgABIANBfWogAToAACAAIAE6AAIgAkEHSQ0AIANBfGogAToAACAAIAE6AAMgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIAIAQgA0EEcUEYciIEayICQSBJDQAgAa0iBUIghiAFhCEFIAMgBGohAQNAIAEgBTcDGCABIAU3AxAgASAFNwMIIAEgBTcDACABQSBqIQEgAkFgaiICQR9LDQALCyAACy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAIajYCACADCy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAFajYCACADCx8AIAAgASACKAIEEAg2AgAgARAEGiAAIAJBCGo2AgQLCAAgAGdBH3MLugUBDX8jAEEQayIKJAACfyAEQQNNBEAgCkEANgIMIApBDGogAyAEEAsaIAAgASACIApBDGpBBBAVIgBBbCAAEAMbIAAgACAESxsMAQsgAEEAIAEoAgBBAXRBAmoQECENQVQgAygAACIGQQ9xIgBBCksNABogAiAAQQVqNgIAIAMgBGoiAkF8aiEMIAJBeWohDiACQXtqIRAgAEEGaiELQQQhBSAGQQR2IQRBICAAdCIAQQFyIQkgASgCACEPQQAhAiADIQYCQANAIAlBAkggAiAPS3JFBEAgAiEHAkAgCARAA0AgBEH//wNxQf//A0YEQCAHQRhqIQcgBiAQSQR/IAZBAmoiBigAACAFdgUgBUEQaiEFIARBEHYLIQQMAQsLA0AgBEEDcSIIQQNGBEAgBUECaiEFIARBAnYhBCAHQQNqIQcMAQsLIAcgCGoiByAPSw0EIAVBAmohBQNAIAIgB0kEQCANI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HIARBEGohBCADQRBqIgMgAUkNAAsLIAIgASAAa2ohAgsDQCABIAVPDQEgASACLQAAOgAAIAFBAWohASACQQFqIQIMAAALAAsLQQECfyAAIAAoArjgASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksNAAJAIAFBAWsOAgEAAgtBbA8LIAAhAwsgAwsMACAAIAEgAkEAEC4LiAQCA38CfiADEBYhBCAAQQBBKBAQIQAgBCACSwRAIAQPCyABRQRAQX8PCwJAAkAgA0EBRg0AIAEoAAAiBkGo6r5pRg0AQXYhAyAGQXBxQdDUtMIBRw0BQQghAyACQQhJDQEgAEEAQSgQECEAIAEoAAQhASAAQQE2AhQgACABrTcDAEEADwsgASACIAMQLyIDIAJLDQAgACADNgIYQXIhAyABIARqIgVBf2otAAAiAkEIcQ0AIAJBIHEiBkUEQEFwIQMgBS0AACIFQacBSw0BIAVBB3GtQgEgBUEDdkEKaq2GIgdCA4h+IAd8IQggBEEBaiEECyACQQZ2IQMgAkECdiEFAkAgAkEDcUF/aiICQQJLBEBBACECDAELAkACQAJAIAJBAWsOAgECAAsgASAEai0AACECIARBAWohBAwCCyABIARqLwAAIQIgBEECaiEEDAELIAEgBGooAAAhAiAEQQRqIQQLIAVBAXEhBQJ+AkACQAJAIANBf2oiA0ECTQRAIANBAWsOAgIDAQtCfyAGRQ0DGiABIARqMQAADAMLIAEgBGovAACtQoACfAwCCyABIARq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QQNHBEAgACAEQQJ0IgJqQazQAWogAiAHaigCVDYCACAEQQFqIQQMAQsLIAcoArwBIQgLQbp/IRAgEyAIayIAIBIgA2tLDQAgAwR/IAMgCCAAEAsgAGoFQQALIAFrIRALIAdB0AFqJAAgEAslACAAQgA3AgAgAEEAOwEIIABBADoACyAAIAE2AgwgACACOgAKC7QFAQN/IwBBMGsiBCQAIABB/wFqIgVBfWohBgJAIAMvAQIEQCAEQRhqIAEgAhAGIgIQAw0BIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahASOgAAIAMgBEEIaiAEQRhqEBI6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0FIAEgBEEQaiAEQRhqEBI6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBSABIARBCGogBEEYahASOgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEjoAACABIAJqIABrIQIMAwsgAyAEQRBqIARBGGoQEjoAAiADIARBCGogBEEYahASOgADIANBBGohAwwAAAsACyAEQRhqIAEgAhAGIgIQAw0AIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahAROgAAIAMgBEEIaiAEQRhqEBE6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0EIAEgBEEQaiAEQRhqEBE6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBCABIARBCGogBEEYahAROgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEToAACABIAJqIABrIQIMAgsgAyAEQRBqIARBGGoQEToAAiADIARBCGogBEEYahAROgADIANBBGohAwwAAAsACyAEQTBqJAAgAgtpAQF/An8C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QBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJA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AAAAAAAYSAAAAAAAABhUAAAAAAAAGGAAAAAAAAAYbAAAAAAAABh4AAAAAAAAGIQAAAAAAAQYjAAAAAAABBicAAAAAAAIGKwAAAAAAAwYzAAAAAAAEBkMAAAAAAAUGYwAAAAAACAYDAQAAIAAABAQAAAAwAAAEBAAAABAAAAQFAAAAIAAABQcAAAAgAAAFCAAAACAAAAUKAAAAIAAABQsAAAAAAAAGDgAAAAAAAAYRAAAAAAAABhQAAAAAAAAGFwAAAAAAAAYaAAAAAAAABh0AAAAAAAAGIAAAAAAAEAYDAAEAAAAPBgOAAAAAAA4GA0AAAAAADQYDIAAAAAAMBgMQAAAAAAsGAwgAAAAACgYDBABBpB0L2QEBAAAAAwAAAAcAAAAPAAAAHwAAAD8AAAB/AAAA/wAAAP8BAAD/AwAA/wcAAP8PAAD/HwAA/z8AAP9/AAD//wAA//8BAP//AwD//wcA//8PAP//HwD//z8A//9/AP///wD///8B////A////wf///8P////H////z////9/AAAAAAEAAAACAAAABAAAAAAAAAACAAAABAAAAAgAAAAAAAAAAQAAAAIAAAABAAAABAAAAAQAAAAEAAAABAAAAAgAAAAIAAAACAAAAAcAAAAIAAAACQAAAAoAAAALAEGgIAsDwBBQ`;var oc=class{static decode(e,R){var W,Y,X,ie,ae,le;if(e.length%4>0)throw Error(`Invalid string. Length must be a multiple of 4`);var _e=43,ye=47,be=48,Ce=97,Te=65,Oe=45,Ae=95;function I(e){var R=e.charCodeAt(0);if(R===_e||R===Oe)return 62;if(R===ye||R===Ae)return 63;if(R<be)return-1;if(R<be+10)return R-be+26+26;if(R<Te+26)return R-Te;if(R<Ce+26)return R-Ce+26;throw Error(`Could not decode elt`)}var Me=e.length;ae=e.charAt(Me-2)===`=`?2:+(e.charAt(Me-1)===`=`),le=new Uint8Array(3*e.length/4-ae),X=ae>0?e.length-4:e.length;var Pe=0;function B(e){le[Pe++]=e}for(W=0,Y=0;W<X;W+=4,Y+=3)B((16711680&(ie=I(e.charAt(W))<<18|I(e.charAt(W+1))<<12|I(e.charAt(W+2))<<6|I(e.charAt(W+3))))>>16),B((65280&ie)>>8),B(255&ie);return ae===2?B(255&(ie=I(e.charAt(W))<<2|I(e.charAt(W+1))>>4)):ae===1&&(B((ie=I(e.charAt(W))<<10|I(e.charAt(W+1))<<4|I(e.charAt(W+2))>>2)>>8&255),B(255&ie)),new Promise((e=>{let i=function(e){for(var R=0,W=e.length-1;W>=0;W--)R=256*R+1*e[W];return R};if(R===`zlib`||R===`gzip`){var Y=(le=(0,Mp.inflate)(le)).length/4,X=Array(Y);for(W=0;W<Y;W++)X[W]=i(le.slice(4*W,4*W+4));e(X)}if(R===`zstd`){let R=new ic;R.init().then((()=>{var Y=(le=R.decode(le)).length/4,X=Array(Y);for(W=0;W<Y;W++)X[W]=i(le.slice(4*W,4*W+4));e(X)}))}if(!R){for(Y=le.length/4,X=Array(Y),W=0;W<Y;W++)X[W]=i(le.slice(4*W,4*W+4));e(X)}}))}};const Rp={TileData:{Tiled:`ex-tiled`},ZIndex:{ZIndex:`zindex`},Camera:{Camera:`camera`,Zoom:`zoom`},Animation:{Strategy:`animationstrategy`},Layer:{Solid:`solid`},Collision:{Type:`collisiontype`}},rc=async(e,R)=>{let W=await fetch(e);switch(R.toLowerCase()){case`xml`:default:return await W.text();case`json`:return await W.json()}},ac=e=>R=>R?.name&&e?R.name.toLocaleLowerCase().localeCompare(e.toLocaleLowerCase())===0:R?.name===e,lc=e=>R=>R?.class&&e?R.class.toLocaleLowerCase().localeCompare(e.toLocaleLowerCase())===0:R?.class===e,cc=e=>{let R=new Map;for(let[W,Y]of e)R.set(W.toLocaleLowerCase(),Y);return R},gc=(e,R,W=!0)=>Y=>{let X=cc(Y.properties);if(R!==void 0){let Y=R;typeof R==`string`&&(Y=W?R.toLocaleLowerCase():R);let ie=X.get(e.toLocaleLowerCase());return typeof ie==`string`?(W?ie.toLocaleLowerCase():ie)===Y:X.get(e.toLocaleLowerCase())===Y}return X.has(e.toLocaleLowerCase())},dc=(e,R)=>W=>R(cc(W.properties).get(e.toLocaleLowerCase())),pc=e=>!!(e&2147483648),fc=e=>!!(e&1073741824),Bc=e=>!!(e&536870912),Cc=e=>536870911&e;var Ec=class{constructor(e){this.type=e,this._loaded=!1,this.cache=new Map}getOrAdd(...e){let R=this.cache.get(e.join(`+`));return R||(R=new this.type(...e),this.cache.set(e.join(`+`),R),R)}values(){if(this._loaded)return Array.from(this.cache.values());throw Error(`Read through cache not yet loaded! No values to return!`)}async load(){let e=Array.from(this.cache.entries()),R=await Promise.allSettled(e.map((e=>e[1].load()))),W=0;for(let Y=0;Y<R.length;Y++){let X=R[Y];X.status===`rejected`&&(console.error(`Error loading resource at ${e[Y][0]}, is your pathMap correct? or your Tiled map corrupted?`,X.reason),W++)}if(W)throw Error(`Error loading ${W} resources`);this._loaded=!0}};function Qc(e,R){try{if(R)for(let W of R){let R=W.value;typeof W.value==`string`&&(R=W.value.toLocaleLowerCase()),e.properties.set(W.name.toLocaleLowerCase(),R)}}catch(R){console.error(`Unable to map properties onto ${e}`,R)}}function mc(e){let R=e.match(/[^/\\&\?]+\.\w{2,4}(?=([\#\?&].*$|$))/gi);if(R)return R[0];throw Error(`Could not locate filename from path: ${e}`)}function yc(e,R){for(let{path:W,output:Y}of R)if(typeof W==`string`){if(e.includes(W))return Y}else{let R=e.match(W);if(R)return Y.replace(`[match]`,R[0])}return e}function wc(e,R){if(!R)return!1;for(let{path:W,output:Y}of R)if(typeof W==`string`){if(e.includes(W))return!0}else if(e.match(W))return!0;return!1}function _c(e,R,W){if(wc(R,W)&&W)return yc(R,W);if(R.indexOf(`/`)===0)return R;let Y=e.split(`/`),X=R.split(`/`);return Y[Y.length-1].includes(`.`)&&Y.pop(),Y.concat(X).join(`/`)}var vc=class{constructor(e){this.properties=new Map,this.tiledObject=e.tiledObject,this.name=this.tiledObject.name,this.class=this.tiledObject.type,this.id=this.tiledObject.id??-1,this.x=this.tiledObject.x??0,this.y=this.tiledObject.y??0,this.rotation=this.tiledObject.rotation??0}},bc=class extends vc{constructor(e,R){if(super({tiledObject:e}),!e.template)throw Error(`Invalid template`);if(this.source=e.template,this.gid=e.gid,this.instanceObject=e,this.template=R,R.object){this.name=this.name||R.object.name,this.class=this.class||R.object.class;for(let[e,W]of R.object.properties.entries())this.properties.has(e)||this.properties.set(e,W)}if(R.tileset&&R.object.tiledObject.gid){let e=R.tileset.getTileByGid(R.object.tiledObject.gid);if(e){this.class=this.class||e.class;for(let[R,W]of e.properties.entries())this.properties.has(R)||this.properties.set(R,W)}}}},kc=class extends vc{constructor(e,R,W,Y){super({tiledObject:e}),this.gid=R,this.width=W,this.height=Y}},Dc=class extends vc{},Sc=class extends vc{constructor(e,R,W,Y){var X;super({tiledObject:e}),this.font=new si({family:R.fontfamily??`sans-serif`,color:R.color?We.fromHex(R.color):We.Black,size:R.pixelsize??16,unit:Wt.Px,textAlign:this._textAlignFromTiled(R.halign),baseAlign:this._textBaselineFromTiled(R.valign),quality:Y});let ie=(X=R.wrap)!=null&&X;this.text=new ci({text:R.text,font:this.font,...ie?{maxWidth:W+10}:{}})}_textBaselineFromTiled(e){switch(e){case`bottom`:return Kt.Bottom;case`center`:return Kt.Middle;default:return Kt.Top}}_textAlignFromTiled(e){switch(e){case`left`:default:return Gt.Left;case`center`:return Gt.Center;case`right`:return Gt.Right;case`justify`:return Gt.Start}}},xc=class extends vc{constructor(e,R,W){super({tiledObject:e}),this.width=R,this.height=W}},zc=class extends vc{constructor(e,R,W,Y){super({tiledObject:e}),this.width=R,this.height=W,this.anchor=Y}},Fc=class extends vc{constructor(e,R){super({tiledObject:e}),this.points=[],this.localPoints=[],this.localPoints=R.map((e=>vec(e.x,e.y))),this.points=R.map((e=>vec(e.x,e.y).rotate(toRadians(this.rotation)).add(vec(this.x,this.y))))}},Lc=class extends vc{constructor(e,R){super({tiledObject:e}),this.points=[],this.points=R.map((e=>vec(e.x,e.y)))}};function Nc(e,R){let W;if(e.point)W=new Dc({tiledObject:e});else if(e.ellipse)e.width&&e.height?(W=new xc(e,e.width,e.height),W.x+=e.width/2,W.y+=e.height/2):W=new xc(e,20,20);else if(e.polygon)W=new Fc(e,e.polygon);else if(e.polyline)W=new Lc(e,e.polyline);else if(e.text)W=new Sc(e,e.text,e.width??0,R?.textQuality??4);else if(e.gid&&!e.template){W=new kc(e,e.gid,e.width??0,e.height??0);let Y=R?.getTilesetForTileGid(e.gid),X=e.type;if(Y){let R=Y?.getTileByGid(e.gid);if(X||=R?.class,R?.properties)for(let[e,Y]of R.properties.entries())W.properties.has(e)||W.properties.set(e,Y)}W.class=X}else if(e.template&&R){let Y=R.templates.find((R=>mc(R.templatePath)===mc(e.template)));if(!Y)throw Error(`Template object id ${e.id} with name ${e.name} is missing a loaded template file, there should be one loaded from ${e.template}! Is your tiled map or template corrupted?`);W=new bc(e,Y)}else W=e.width&&e.height?new zc(e,e.width,e.height,Oe.Zero):new zc(e,20,20,Oe.Half);return Qc(W,e.properties),W}function Gc(e,R){let W=[];for(let Y of e.objects){let e=Nc(Y,R);W.push(e)}return W}var Tc=class{constructor(e){let{templatePath:R,object:W,tiledTemplate:Y,tileset:X}=e;this.templatePath=R,this.object=W,this.tiledTemplate=Y,this.tileset=X}},Rc=class{constructor(e){this.objects=[],this.colliders=[],this.animation=[],this.properties=new Map;let{id:R,tileset:W,tiledTile:Y}=e;this.id=R,this.tileset=W,this.tiledTile=Y,this.class=Y.type,Qc(this,Y.properties),Y.objectgroup&&Y.objectgroup.objects&&(this.objects=Gc(Y.objectgroup)),Y.animation&&(this.animation=Y.animation)}},Mc=class{constructor(e){this.firstGid=-1,this.tileCount=0,this.tileWidth=0,this.tileHeight=0,this.tileOffset=vec(0,0),this.tiles=[],this.objectalignment=`bottomleft`,this.orientation=`orthogonal`,this.properties=new Map;let{name:R,tiledTileset:W,image:Y,tileToImage:X,firstGid:ie}=e;if(this.name=R,this.tiledTileset=W,this.firstGid=ie,Ol(W)){Qc(this,W.properties);let e=W.spacing,R=Math.floor((W.imagewidth+e)/(W.tilewidth+e)),X=Math.floor((W.imageheight+e)/(W.tileheight+e));if(this.class=W.class,this.orientation=W.grid?.orientation??`orthogonal`,this.horizontalFlipTransform=Me.identity().translate(W.tilewidth,0).scale(-1,1),this.verticalFlipTransform=Me.identity().translate(0,W.tileheight).scale(1,-1),this.diagonalFlipTransform=Me.identity().translate(0,0).rotate(-Math.PI/2).scale(-1,1),this.objectalignment=W.objectalignment??(this.orientation===`orthogonal`?`bottomleft`:`bottom`),Y&&(this.spritesheet=ir.fromImageSource({image:Y,grid:{rows:X,columns:R,spriteWidth:W.tilewidth,spriteHeight:W.tileheight},spacing:{originOffset:{x:W.margin??0,y:W.margin??0},margin:{x:W.spacing??0,y:W.spacing??0}}})),this.tileCount=W.tilecount,this.tileWidth=W.tilewidth,this.tileHeight=W.tileheight,W.tileoffset&&(this.tileOffset=vec(W.tileoffset.x,W.tileoffset.y)),W.tiles)for(let e of W.tiles)this.tiles.push(new Rc({id:e.id,tileset:this,tiledTile:e,image:Y}))}if(Ul(W)&&W.firstgid!==void 0){this.horizontalFlipTransform=Me.identity().translate(W.tilewidth,0).scale(-1,1),this.verticalFlipTransform=Me.identity().translate(0,W.tileheight).scale(1,-1),this.diagonalFlipTransform=Me.identity().translate(0,0).rotate(-Math.PI/2).scale(-1,1),this.objectalignment=W.objectalignment??(this.orientation===`orthogonal`?`bottomleft`:`bottom`),this.orientation=W.grid?.orientation??`orthogonal`,this.tileCount=W.tilecount,this.tileWidth=W.tilewidth,this.tileHeight=W.tileheight,W.tileoffset&&(this.tileOffset=vec(W.tileoffset.x,W.tileoffset.y));let e=[];if(W.tiles)for(let R of W.tiles){let W=X?.get(R);W&&e.push(W.toSprite()),this.tiles.push(new Rc({id:R.id,tileset:this,tiledTile:R,image:W}))}X&&(this.spritesheet=new ir({sprites:e}))}}getTilesetAlignmentAnchor(e){switch(e??this.objectalignment){case`topleft`:return vec(0,0);case`top`:return vec(.5,0);case`topright`:return vec(1,0);case`left`:return vec(0,.5);case`center`:return vec(.5,.5);case`right`:return vec(1,.5);case`bottomleft`:default:return vec(0,1);case`bottom`:return vec(.5,1);case`bottomright`:return vec(1,1)}}getTileByGid(e){let R=Cc(e)-this.firstGid;return this.tiles.find((e=>e.id===R))}getTilesByClassName(e){return this.tiles.filter(lc(e))}getTilesByProperty(e,R,W=!0){return this.tiles.filter(gc(e,R,W))}getTilesByPropertyValueMatcher(e,R){return this.tiles.filter(dc(e,R))}getSpriteForGid(e){let R=pc(e),W=fc(e),Y=Bc(e),X=Cc(e),ie=X-this.firstGid;if(this.spritesheet){let e=this.spritesheet.sprites[ie];return(Y||R||W)&&(e=e.clone()),Y&&(e.rotation=-Math.PI/2,e.scale=vec(-1,1)),R&&(e.scale=vec((Y?1:-1)*e.scale.x,(Y?-1:1)*e.scale.y)),W&&(e.scale=vec((Y?-1:1)*e.scale.x,(Y?1:-1)*e.scale.y)),e}throw Error(`Tileset: [${this.name}] Could not find sprite for gid: [${e}] normalized gid: [${X}]`)}_isometricTiledCoordToWorld(e){let R=this.tileWidth,W=this.tileHeight/2,Y=e.y/W,X=e.x/W;return vec((X-Y)*R/2+0,(X+Y)*W/2)}getCollidersForGid(e,R){let{anchor:W,scale:Y,orientationOverride:X,offset:ie}={anchor:Oe.Zero,scale:Oe.One,offset:Oe.Zero,orientationOverride:void 0,...R},ae=X??this.orientation,le=this.getTileByGid(e),_e=[];if(le&&le.objects)for(let R of le.objects){if(R instanceof Fc){let W=R.points.map((e=>e.scale(Y)));W=this._applyFlipsToPoints(W,e),ae===`isometric`&&(W=W.map((e=>this._isometricTiledCoordToWorld(e)))),W=W.map((e=>e.add(ie)));let X=Ft.Polygon(W,Oe.Zero,!0);X.isConvex()?_e.push(X):_e.push(X.triangulate())}if(R instanceof zc){let W=R.width,X=R.height,le=R.anchor,ye=lt.fromDimension(W*Y.x,X*Y.y,le).getPoints().map((e=>e.rotate(toRadians(R.rotation)).add(vec(R.x,R.y))));ae===`isometric`&&(ye=ye.map((e=>this._isometricTiledCoordToWorld(e)))),ye=this._applyFlipsToPoints(ye,e),ye=ye.map((e=>e.add(ie)));let be=Ft.Polygon(ye);_e.push(be)}if(R instanceof xc){let e=vec(R.x,R.y);ae===`isometric`&&(e=this._isometricTiledCoordToWorld(e)),e=e.add(ie);let W=Math.min(R.width/2,R.height/2),X=Ft.Circle(W,e.scale(Y));_e.push(X)}}return _e}_applyFlipsToPoints(e,R){let W=pc(R),Y=fc(R);return Bc(R)&&(e=e.map((e=>this.diagonalFlipTransform.multiply(e)))),W&&(e=e.map((e=>this.horizontalFlipTransform.multiply(e)))),Y&&(e=e.map((e=>this.verticalFlipTransform.multiply(e)))),e}getAnimationForGid(e){let R=this.getTileByGid(e);if(R&&R.animation?.length){let e=[];for(let W of R.animation)e.push({graphic:this.getSpriteForGid(W.tileid+this.firstGid),duration:W.duration});return new Ht({frames:e,strategy:zt.Loop})}return null}},Oc=class{constructor(e,R,W){this.path=e,this.strict=!0,this.headless=!1,this.orientation=`orthogonal`,this.fileLoader=rc;let{fileLoader:Y,parser:X,pathMap:ie,imageLoader:ae,strict:le,headless:_e,orientation:ye}={...W};this.headless=_e??this.headless,this.orientation=ye??this.orientation,this.strict=le??this.strict,this.fileLoader=Y??this.fileLoader,this.imageLoader=ae??new Ec(An),this.parser=X??new Wl,this.firstGid=R,this.pathMap=ie}async load(){let e=this.path.includes(`.tsx`)?`xml`:`json`;try{let R=await this.fileLoader(this.path,e),W;if(W=e===`json`?this.strict?Ep.parse(R):R:this.parser.parseExternalTileset(R,this.strict),Ol(W)){let e=_c(this.path,W.image,this.pathMap),R=this.headless?void 0:this.imageLoader.getOrAdd(e);this.data=new Mc({name:W.name,tiledTileset:W,firstGid:this.firstGid,image:R})}if(Ul(W)){let e=this.headless?void 0:new Map;if(e){let R=[];if(W.tiles){for(let Y of W.tiles)if(Y.image){let W=_c(this.path,Y.image,this.pathMap),X=this.imageLoader.getOrAdd(W);e.set(Y,X),R.push(X)}}}W.firstgid=this.firstGid,this.data=new Mc({name:W.name,tiledTileset:W,firstGid:this.firstGid,tileToImage:e})}if(this.headless||await this.imageLoader.load(),this.data)return this.data}catch(e){throw console.error(`Could not load tileset at path ${this.path}`),e}throw Error(`No tileset at path ${this.path}`)}isLoaded(){return!!this.data}},Uc=class{constructor(e,R){this.templatePath=e,this.headless=!1,this.strict=!0,this.fileLoader=rc;let{fileLoader:W,parser:Y,pathMap:X,imageLoader:ie,strict:ae,headless:le}={...R};this.headless=le??this.headless,this.strict=ae??this.strict,this.fileLoader=W??this.fileLoader,this.imageLoader=ie??new Ec(An),this.parser=Y??new Wl,this.pathMap=X}isLoaded(){return!!this.data}async load(){let e=this.templatePath.includes(`.tx`)?`xml`:`json`;try{let R=await this.fileLoader(this.templatePath,e),W;W=e===`xml`?this.parser.parseExternalTemplate(R,this.strict):this.strict?kp.parse(R):R;let Y=W,X=Nc(W.object),ie;return W.tileset&&(ie=await new Oc(_c(this.templatePath,W.tileset.source,this.pathMap),W.tileset.firstgid,{headless:this.headless,strict:this.strict,fileLoader:this.fileLoader,imageLoader:this.imageLoader,parser:this.parser,pathMap:this.pathMap}).load()),this.data=new Tc({templatePath:this.templatePath,tiledTemplate:Y,object:X,tileset:ie})}catch(e){throw console.error(`Could not load template at ${this.templatePath}, check to see if your pathMap is correct or if you're Tiled map is corrupted`),e}}},Jc=class extends Component{constructor(e){super();let{tiledObject:R}=e;this.tiledObject=R}},Zc=class extends Component{constructor(e){super();let{tiledTileLayer:R}=e;this.tiledTileLayer=R}},qc=class{get isInfinite(){return this._isInfinite}constructor(e,R,W){this.tiledTileLayer=e,this.resource=R,this.order=W,this.logger=Je.getInstance(),this.width=0,this.height=0,this.properties=new Map,this.data=[],this._isInfinite=!1,this._tileToChunkData=new WeakMap,this._tileToChunkIndex=new WeakMap,this._gidToTileInfo=new Map,this.name=e.name,this.id=e.id,this.class=e.class,this.width=e.width,this.height=e.height,this.visible=!!e.visible,Qc(this,e.properties)}getTilesByProperty(e,R,W=!0){return this.isometricMap.tiles.filter((Y=>{let X=Y.data.get(Rp.TileData.Tiled);return!!X&&gc(e,R,W)(X)})).map((e=>({exTile:e,tiledTile:e.data.get(Rp.TileData.Tiled)})))}getTilesByPropertyValueMatcher(e,R){return this.isometricMap.tiles.filter((W=>{let Y=W.data.get(Rp.TileData.Tiled);return!!Y&&dc(e,R)(Y)})).map((e=>({exTile:e,tiledTile:e.data.get(Rp.TileData.Tiled)})))}getTilesByGid(e){return this._gidToTileInfo.get(e)??[]}getTilesByClassName(e){return this.isometricMap.tiles.filter((R=>{let W=R.data.get(Rp.TileData.Tiled);return!!W&&lc(e)(W)})).map((e=>({exTile:e,tiledTile:e.data.get(Rp.TileData.Tiled)})))}_getGidForTile(e){let R=0;if(this._isInfinite){let W=this._tileToChunkData.get(e);if(W===void 0)throw Error(`Missing chunk data for excalibur tile`);let Y=this._tileToChunkIndex.get(e);if(Y===void 0)throw Error(`Missing chunk index for excalibur tile`);R=Cc(W[Y])}else{let W=this.isometricMap.tiles.indexOf(e);R=Cc(this.data[W])}return R}getTileByPoint(e){if(!this.isometricMap)return this.logger.warn(`IsometricMap has not yet been loaded! getTileByPoint() will only return null`),null;if(this.isometricMap){let R=this.isometricMap.getTileByPoint(e);if(!R)return null;let W=this._getGidForTile(R),Y;return W>0&&(Y=this.resource.getTilesetForTileGid(W).getTileByGid(W)),{tiledTile:Y,exTile:R}}return null}getTileByCoordinate(e,R){if(!this.isometricMap)return this.logger.warn(`IsometricMap has not yet been loaded! getTileByCoordinate() will only return null`),null;if(this.isometricMap){let W=this.isometricMap.getTile(e,R),Y=this._getGidForTile(W),X;return Y>0&&(X=this.resource.getTilesetForTileGid(Y).getTileByGid(Y)),{tiledTile:X,exTile:W}}return null}_recordTileData(e,R){let W=this._gidToTileInfo.get(e),Y=this.resource.getTilesetForTileGid(e).getTileByGid(e);W?W.push({exTile:R,tiledTile:Y}):W=[{exTile:R,tiledTile:Y}],this._gidToTileInfo.set(e,W),R.data.set(Rp.TileData.Tiled,Y)}updateTile(e,R,W,Y,X){this._recordTileData(R,e);let ie=this.resource.getLayerConfig(this.name)||this.resource.getLayerConfig(this.id);ie?.isSolid!==void 0&&(X=ie.isSolid),this.resource.useExcaliburWiring&&X&&(e.solid=!0);let ae=e.get(IsometricEntityComponent);ae&&(ae.elevation=this.order);let le=this.resource.getTilesetForTileGid(R),_e=le.getSpriteForGid(R);W&&(_e=_e.clone(),_e.tint=Y),e.addGraphic(_e,{offset:le.tileOffset});let ye=e.pos;if(le.orientation===`orthogonal`)ye=vec(0,0);else{let e=this.resource.map.tilewidth/2,R=this.resource.map.tileheight;ye=vec(e,R)}let be=le.getCollidersForGid(R,{offset:ye});for(let R of be)e.addCollider(R);ie!=null&&ie.useTileColliders&&be.length>0&&this.visible&&(e.solid=!0),ie!=null&&ie.useTileCollidersWhenInvisible&&be.length>0&&(e.solid=!0);let Ce=le.getAnimationForGid(R);if(Ce&&(W&&(Ce=Ce.clone(),Ce.tint=Y),e.clearGraphics(),e.addGraphic(Ce,{offset:le.tileOffset}),this.resource.useExcaliburWiring)){let e=le.getTileByGid(R)?.properties.get(Rp.Animation.Strategy);if(e&&typeof e==`string`)switch(e.toLowerCase()){case zt.End.toLowerCase():Ce.strategy=zt.End;break;case zt.Freeze.toLowerCase():Ce.strategy=zt.Freeze;break;case zt.Loop.toLowerCase():Ce.strategy=zt.Loop;break;case zt.PingPong.toLowerCase():Ce.strategy=zt.PingPong;break;default:this.logger.warn(`Unknown animation strategy in tileset ${le.name} on tile gid ${R}: ${e}`)}}}async load(){let e=this.resource.getLayerConfig(this.name)||this.resource.getLayerConfig(this.id),R=this.tiledTileLayer,W=!!this.properties.get(Rp.Layer.Solid),Y=(this.tiledTileLayer.opacity,!!this.tiledTileLayer.tintcolor),X=this.tiledTileLayer.tintcolor?We.fromHex(this.tiledTileLayer.tintcolor):We.Transparent,ie=vec(R.offsetx??0,R.offsety??0);this.tiledTileLayer.data&&kl(this.tiledTileLayer)?this.data=await oc.decode(this.tiledTileLayer.data,this.tiledTileLayer.compression):this.tiledTileLayer.data&&Dl(this.tiledTileLayer)&&(this.data=this.tiledTileLayer.data);let ae=this.order,le=this.properties.get(Rp.ZIndex.ZIndex);if(typeof le==`number`&&(ae=le),this.resource.map.infinite&&Hl(this.tiledTileLayer)){let W=this.resource.isometricTiledCoordToWorld(this.tiledTileLayer.startx,this.tiledTileLayer.starty),Y=vec(W.x*this.resource.map.tilewidth,W.y*this.resource.map.tileheight);this.isometricMap=new IsometricMap({name:this.name,pos:ie.add(Y),tileHeight:this.resource.map.tileheight,tileWidth:this.resource.map.tilewidth,columns:R.width,rows:R.height,elevation:ae}),e?.collisionGroup&&(this.isometricMap.get(Ti).group=e.collisionGroup)}else this.isometricMap=new IsometricMap({name:this.name,pos:ie,tileWidth:this.resource.map.tilewidth,tileHeight:this.resource.map.tileheight,columns:R.width,rows:R.height,elevation:ae}),e?.collisionGroup&&(this.isometricMap.get(Ti).group=e.collisionGroup);if(this.isometricMap.visible=this.tiledTileLayer.visible,this.isometricMap.opacity=this.tiledTileLayer.opacity,this.isometricMap.addComponent(new Zc({tiledTileLayer:R})),R.parallaxx||R.parallaxy){let e=vec(R.parallaxx??1,R.parallaxy??1);this.isometricMap.addComponent(new ParallaxComponent(e))}if(this.resource.map.infinite&&Hl(this.tiledTileLayer)){this._isInfinite=!0;let e=this.tiledTileLayer;for(let ie of this.tiledTileLayer.chunks){let ae=[];kl(this.tiledTileLayer)?ae=await oc.decode(ie.data,e.compression):Dl(this.tiledTileLayer)&&(ae=ie.data);for(let e=0;e<ae.length;e++){let le=ae[e],_e=e%ie.width+(ie.x-this.tiledTileLayer.startx),ye=Math.floor(e/ie.width)+(ie.y-this.tiledTileLayer.starty),be=this.isometricMap.tiles[_e+ye*R.width];this._tileToChunkData.set(be,ae),this._tileToChunkIndex.set(be,e),le!=0&&this.updateTile(be,le,Y,X,W)}}}else for(let e=0;e<this.data.length;e++){let R=this.data[e];if(R!==0){let ie=this.isometricMap.tiles[e];this.updateTile(ie,R,Y,X,W)}}}},jc=class{get isInfinite(){return this._isInfinite}getTilesByProperty(e,R,W=!0){return this.tilemap.tiles.filter((Y=>{let X=Y.data.get(Rp.TileData.Tiled);return!!X&&gc(e,R,W)(X)})).map((e=>({exTile:e,tiledTile:e.data.get(Rp.TileData.Tiled)})))}getTilesByPropertyValueMatcher(e,R){return this.tilemap.tiles.filter((W=>{let Y=W.data.get(Rp.TileData.Tiled);return!!Y&&dc(e,R)(Y)})).map((e=>({exTile:e,tiledTile:e.data.get(Rp.TileData.Tiled)})))}getTilesByGid(e){return this._gidToTileInfo.get(e)??[]}getTilesByClassName(e){return this.tilemap.tiles.filter((R=>{let W=R.data.get(Rp.TileData.Tiled);return!!W&&lc(e)(W)})).map((e=>({exTile:e,tiledTile:e.data.get(Rp.TileData.Tiled)})))}_getGidForTile(e){let R=0;if(this._isInfinite){let W=this._tileToChunkData.get(e);if(W===void 0)throw Error(`Missing chunk data for excalibur tile (${e.x}, ${e.y})`);let Y=this._tileToChunkIndex.get(e);if(Y===void 0)throw Error(`Missing chunk index for excalibur tile (${e.x}, ${e.y})`);R=Cc(W[Y])}else{let W=this.tilemap.tiles.indexOf(e);R=Cc(this.data[W])}return R}getTileByPoint(e){if(!this.tilemap)return this.logger.warn(`Tilemap has not yet been loaded! getTileByPoint() will only return null`),null;if(this.tilemap){let R=this.tilemap.getTileByPoint(e);if(!R)return null;let W=this._getGidForTile(R),Y;return W>0&&(Y=this.resource.getTilesetForTileGid(W).getTileByGid(W)),{tiledTile:Y,exTile:R}}return null}getTileByCoordinate(e,R){if(!this.tilemap)return this.logger.warn(`Tilemap has not yet been loaded! getTileByCoordinate() will only return null`),null;if(this.tilemap){let W=this.tilemap.getTile(e,R),Y=this._getGidForTile(W),X;return Y>0&&(X=this.resource.getTilesetForTileGid(Y).getTileByGid(Y)),{tiledTile:X,exTile:W}}return null}constructor(e,R,W){this.tiledTileLayer=e,this.resource=R,this.order=W,this.logger=Je.getInstance(),this.width=0,this.height=0,this.properties=new Map,this.data=[],this._gidToTileInfo=new Map,this._isInfinite=!1,this._tileToChunkData=new Map,this._tileToChunkIndex=new Map,this.name=e.name,this.id=e.id,this.class=e.class,this.width=e.width,this.height=e.height,this.visible=!!e.visible,Qc(this,e.properties)}_recordTileData(e,R){let W=this._gidToTileInfo.get(e),Y=this.resource.getTilesetForTileGid(e).getTileByGid(e);W?W.push({exTile:R,tiledTile:Y}):W=[{exTile:R,tiledTile:Y}],this._gidToTileInfo.set(e,W),R.data.set(Rp.TileData.Tiled,Y)}updateTile(e,R,W,Y,X){this._recordTileData(R,e);let ie=this.resource.getLayerConfig(this.name)||this.resource.getLayerConfig(this.id);ie?.isSolid!==void 0&&(X=ie.isSolid),this.resource.useExcaliburWiring&&X&&this.visible&&(e.solid=!0);let ae=this.resource.getTilesetForTileGid(R),le=this.resource.headless;if(!le){let X=ae.getSpriteForGid(R);W&&(X=X.clone(),X.tint=Y),e.addGraphic(X,{offset:ae.tileOffset})}let _e=ae.getCollidersForGid(R);for(let R of _e)e.addCollider(R);ie!=null&&ie.useTileColliders&&_e.length>0&&this.visible&&(e.solid=!0),ie!=null&&ie.useTileCollidersWhenInvisible&&_e.length>0&&(e.solid=!0);let ye=le?null:ae.getAnimationForGid(R);if(ye&&(W&&(ye=ye.clone(),ye.tint=Y),e.clearGraphics(),e.addGraphic(ye,{offset:ae.tileOffset}),this.resource.useExcaliburWiring)){let e=ae.getTileByGid(R)?.properties.get(Rp.Animation.Strategy);if(e&&typeof e==`string`)switch(e.toLowerCase()){case zt.End.toLowerCase():ye.strategy=zt.End;break;case zt.Freeze.toLowerCase():ye.strategy=zt.Freeze;break;case zt.Loop.toLowerCase():ye.strategy=zt.Loop;break;case zt.PingPong.toLowerCase():ye.strategy=zt.PingPong;break;default:this.logger.warn(`Unknown animation strategy in tileset ${ae.name} on tile gid ${R}: ${e}`)}}}async load(){let e=this.resource.getLayerConfig(this.name)||this.resource.getLayerConfig(this.id),R=this.tiledTileLayer.opacity,W=!!this.tiledTileLayer.tintcolor,Y=this.tiledTileLayer.tintcolor?We.fromHex(this.tiledTileLayer.tintcolor):We.Transparent,X=!!this.properties.get(Rp.Layer.Solid),ie=this.tiledTileLayer,ae=vec(ie.offsetx??0,ie.offsety??0);if(this.tiledTileLayer.data&&kl(this.tiledTileLayer)?this.data=await oc.decode(this.tiledTileLayer.data,this.tiledTileLayer.compression):this.tiledTileLayer.data&&Dl(this.tiledTileLayer)&&(this.data=this.tiledTileLayer.data),this.resource.map.infinite&&Hl(this.tiledTileLayer)){let R=vec(this.tiledTileLayer.startx*this.resource.map.tilewidth,this.tiledTileLayer.starty*this.resource.map.tileheight);this.tilemap=new TileMap({name:this.name,pos:ae.add(R),tileHeight:this.resource.map.tileheight,tileWidth:this.resource.map.tilewidth,columns:ie.width,rows:ie.height}),e?.collisionGroup&&(this.tilemap.get(Ti).group=e.collisionGroup)}else this.tilemap=new TileMap({name:this.name,pos:ae,tileWidth:this.resource.map.tilewidth,tileHeight:this.resource.map.tileheight,columns:ie.width,rows:ie.height}),e?.collisionGroup&&(this.tilemap.get(Ti).group=e.collisionGroup);this.tilemap.addComponent(new Zc({tiledTileLayer:ie}));let le=this.tilemap.get(Xe);if(le){le.z=this.order;let e=this.properties.get(Rp.ZIndex.ZIndex);typeof e==`number`&&(le.z=e)}let _e=this.tilemap.get(fi);if(_e&&(_e.isVisible=this.tiledTileLayer.visible,_e.opacity=R),ie.parallaxx||ie.parallaxy){let e=vec(ie.parallaxx??1,ie.parallaxy??1);this.tilemap.addComponent(new ParallaxComponent(e))}if(this.resource.map.infinite&&Hl(this.tiledTileLayer)){this._isInfinite=!0;let e=this.tiledTileLayer;for(let R of this.tiledTileLayer.chunks){let ae=[];kl(this.tiledTileLayer)?ae=await oc.decode(R.data,e.compression):Dl(this.tiledTileLayer)&&(ae=R.data);for(let e=0;e<ae.length;e++){let le=ae[e],_e=e%R.width+(R.x-this.tiledTileLayer.startx),ye=Math.floor(e/R.width)+(R.y-this.tiledTileLayer.starty),be=this.tilemap.tiles[_e+ye*ie.width];this._tileToChunkData.set(be,ae),this._tileToChunkIndex.set(be,e),le!==0&&this.updateTile(be,le,W,Y,X)}}}else for(let e=0;e<this.data.length;e++){let R=this.data[e];if(R!==0){let ie=this.tilemap.tiles[e];this.updateTile(ie,R,W,Y,X)}}}},Yc=class{constructor(e,R,W){this.tiledObjectLayer=e,this.resource=R,this.order=W,this.logger=Je.getInstance(),this.properties=new Map,this.objects=[],this.entities=[],this._objectToEntity=new Map,this._entityToObject=new Map,this._loaded=!1,this.name=e.name,this.class=e.class,Qc(this,e.properties)}_logLoadedWarning(e){this.logger.warn(`ObjectLayer ${this.name} is not yet loaded, ${e}() will always be empty!`)}getObjectsByName(e){return this._loaded||this._logLoadedWarning(`getObjectsByName`),this.objects.filter(ac(e))}getEntitiesByName(e){return this._loaded||this._logLoadedWarning(`getEntitiesByName`),this.entities.filter(ac(e))}getEntityByObject(e){return this._loaded||this._logLoadedWarning(`getEntityByObject`),this._objectToEntity.get(e)}getObjectByEntity(e){return this._loaded||this._logLoadedWarning(`getObjectByEntity`),this._entityToObject.get(e)}getObjectsByProperty(e,R,W=!0){return this._loaded||this._logLoadedWarning(`getObjectsByProperty`),this.objects.filter(gc(e,R,W))}getObjectsByPropertyValueMatcher(e,R){return this._loaded||this._logLoadedWarning(`getObjectsByPropertyValueMatcher`),this.objects.filter(dc(e,R))}getEntitiesByProperty(e,R,W=!0){return this._loaded||this._logLoadedWarning(`getEntitiesByProperty`),this.getObjectsByProperty(e,R,W).map((e=>this._objectToEntity.get(e))).filter((e=>!!e))}getEntitiesByPropertyValueMatcher(e,R){return this._loaded||this._logLoadedWarning(`getEntitiesByPropertyValueMatcher`),this.getObjectsByProperty(e,R).map((e=>this._objectToEntity.get(e))).filter((e=>!!e))}getObjectsByClassName(e){return this._loaded||this._logLoadedWarning(`getObjectsByClassName`),this.objects.filter(lc(e))}getEntitiesByClassName(e){return this._loaded||this._logLoadedWarning(`getEntitiesByClassName`),this.getObjectsByClassName(e).map((e=>this._objectToEntity.get(e))).filter((e=>!!e))}getTemplates(){return this._loaded||this._logLoadedWarning(`getTemplates`),this.objects.filter((e=>e instanceof bc))}runFactory(e){let R=vec(this.tiledObjectLayer.offsetx??0,this.tiledObjectLayer.offsety??0),W=this.objects.slice();for(let Y of W){let W=Y.class;if(Y instanceof bc&&(W||=Y.template.object.class),e!==W)continue;let X=vec((Y.x??0)+R.x,(Y.y??0)+R.y);this.resource.map.orientation===`isometric`&&(X=this.resource.isometricTiledCoordToWorld(X.x,X.y));let ie=this.resource.factories.get(e);if(ie){let e=ie({worldPos:X,name:Y.name,class:W,layer:this,object:Y,properties:Y.properties});e&&this._recordObjectEntityMapping(Y,e)}}}_actorFromObject(e,R,W){let Y=this.resource.headless,X=!!this.tiledObjectLayer.tintcolor,ie=this.tiledObjectLayer.tintcolor?We.fromHex(this.tiledObjectLayer.tintcolor):We.White;if(e instanceof kc&&W){let ae=this.resource.map.orientation===`isometric`&&W.orientation===`orthogonal`?`bottom`:void 0,le=W.getTilesetAlignmentAnchor(ae);R.anchor=le;let _e=vec((e.tiledObject.width??W.tileWidth)/W.tileWidth,(e.tiledObject.width??W.tileWidth)/W.tileWidth);if(!Y){let Y=W.getSpriteForGid(e.gid).clone();Y.destSize.width=e.tiledObject.width??Y.width,Y.destSize.height=e.tiledObject.height??Y.height,X&&(Y.tint=ie),R.graphics.use(Y),R.graphics.offset=W.tileOffset;let ae=W.getAnimationForGid(e.gid);if(ae){let e=ae.clone();e.scale=_e,X&&(e.tint=ie),R.graphics.use(e),R.graphics.offset=W.tileOffset}}let ye=e.tiledObject.width??0,be=e.tiledObject.height??0,Ce=-ye*le.x,Te=-be*le.y,Ae=this.resource.map.tilewidth/2,Me=this.resource.map.tileheight,Pe=vec(Ce,Te);this.resource.map.orientation===`isometric`&&(Pe=vec(Ce+Ae,Te+Me),W.orientation===`orthogonal`&&(Pe=Pe.sub(vec(Ae,Me))));let Re=W.getCollidersForGid(e.gid,{anchor:Oe.Zero,scale:_e,offset:Pe});if(Re.length)R.collider.useCompositeCollider(Re);else{let W=e.width,Y=e.height;if(this.resource.map.orientation===`isometric`){let R=e.height/2;W=R,Y=R}let X=Ft.Box(W,Y,this.resource.map.orientation===`isometric`?vec(1,1):vec(0,1));this.resource.map.orientation===`isometric`&&(X.points=X.points.map((e=>this.resource.isometricTiledCoordToWorld(e.x,e.y)))),R.collider.set(X)}}if(e instanceof Sc&&R.graphics.use(e.text),e instanceof Fc){let W=vec(e.x,e.y),Y=e.localPoints;this.resource.map.orientation===`isometric`&&(W=this.resource.isometricTiledCoordToWorld(W.x,W.y),Y=Y.map((e=>this.resource.isometricTiledCoordToWorld(e.x,e.y)))),R.anchor=vec(0,1),R.pos=W;let X=Ft.Polygon(Y,Oe.Zero,!0);X.isConvex()?R.collider.set(X):R.collider.set(X.triangulate())}if(e instanceof zc){R.anchor=e.anchor;let W=Ft.Box(e.width,e.height,e.anchor);this.resource.map.orientation===`isometric`&&(W.points=W.points.map((e=>this.resource.isometricTiledCoordToWorld(e.x,e.y)))),R.collider.set(W)}e instanceof xc&&R.collider.useCircleCollider(Math.min(e.width,e.height)/2)}async load(){let e=this.tiledObjectLayer.opacity,R=vec(this.tiledObjectLayer.offsetx??0,this.tiledObjectLayer.offsety??0),W=Gc(this.tiledObjectLayer,this.resource);for(let Y of W){let W=vec((Y.x??0)+R.x,(Y.y??0)+R.y);this.resource.map.orientation===`isometric`&&(W=this.resource.isometricTiledCoordToWorld(W.x,W.y));let X,ie=Y.class;if(Y instanceof bc&&(ie||=Y.template.object.class),ie){let e=this.resource.factories.get(ie);if(e){let R=e({worldPos:W,name:Y.name,class:ie,layer:this,object:Y,properties:Y.properties});R&&this._recordObjectEntityMapping(Y,R);continue}}let ae=this.properties.get(Rp.ZIndex.ZIndex);typeof ae==`number`&&(X=ae);let le=new _i({name:Y.tiledObject.name,pos:W,anchor:Oe.Zero,rotation:toRadians(Y.tiledObject.rotation??0),z:X}),_e=le.get(fi);if(_e&&(_e.visible=this.tiledObjectLayer.visible&&(Y.tiledObject.visible===void 0||!!Y.tiledObject.visible),_e.opacity=e),this.resource.map.orientation===`isometric`){let e=new IsometricEntityComponent({rows:this.resource.map.height,columns:this.resource.map.width,tileWidth:this.resource.map.tilewidth,tileHeight:this.resource.map.tileheight});e.elevation=X??this.order,le.addComponent(e)}if(this.resource.useExcaliburWiring){let e=Y.properties.get(Rp.Collision.Type);if(e&&typeof e==`string`)switch(e.toLowerCase()){case Ye.Active.toLowerCase():le.body.collisionType=Ye.Active;break;case Ye.Fixed.toLowerCase():le.body.collisionType=Ye.Fixed;break;case Ye.Passive.toLowerCase():le.body.collisionType=Ye.Passive;break;case Ye.PreventCollision.toLowerCase():le.body.collisionType=Ye.PreventCollision;break;default:this.logger.warn(`Unknown collision type in layer ${this.name}, for object id ${Y.id} and name ${Y.name}: ${e}`)}}if(Y instanceof bc){let e=Y.template.tileset,R=Y.template.object;R&&(Y.gid&&R instanceof kc&&(e=this.resource.getTilesetForTileGid(Y.gid),R=new kc(R.tiledObject,Y.gid,R.width,R.height)),this._actorFromObject(R,le,e))}else{let e;Y instanceof kc&&(e=this.resource.getTilesetForTileGid(Y.gid)),this._actorFromObject(Y,le,e)}this._recordObjectEntityMapping(Y,le)}this._loaded=!0}_recordObjectEntityMapping(e,R){R.addComponent(new Jc({tiledObject:e})),this.objects.push(e),this.entities.push(R),this._objectToEntity.set(e,R),this._entityToObject.set(R,e)}};const zp=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,Pc=e=>{if(typeof e!=`string`)throw TypeError(`Invalid argument expected string`);let R=e.match(zp);if(!R)throw Error(`Invalid argument not valid semver ('${e}' received)`);return R.shift(),R},$c=e=>e===`*`||e===`x`||e===`X`,Kc=e=>{let R=parseInt(e,10);return isNaN(R)?e:R},Wc=(e,R)=>{if($c(e)||$c(R))return 0;let[W,Y]=((e,R)=>typeof e==typeof R?[e,R]:[String(e),String(R)])(Kc(e),Kc(R));return W>Y?1:W<Y?-1:0},Vc=(e,R)=>{for(let W=0;W<Math.max(e.length,R.length);W++){let Y=Wc(e[W]||`0`,R[W]||`0`);if(Y!==0)return Y}return 0},Xc=(e,R,W)=>{Ag(W);let Y=((e,R)=>{let W=Pc(e),Y=Pc(R),X=W.pop(),ie=Y.pop(),ae=Vc(W,Y);return ae===0?X&&ie?Vc(X.split(`.`),ie.split(`.`)):X||ie?X?-1:1:0:ae})(e,R);return Bp[W].includes(Y)},Bp={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},Vp=Object.keys(Bp),Ag=e=>{if(typeof e!=`string`)throw TypeError(`Invalid operator type, expected string but got `+typeof e);if(Vp.indexOf(e)===-1)throw Error(`Invalid operator, expected one of ${Vp.join(`|`)}`)};var ig=class{constructor(e,R,W){this.tiledImageLayer=e,this.resource=R,this.order=W,this.properties=new Map,this.image=null,this.imageActor=null,this.name=e.name,this.class=e.class,Qc(this,e.properties),e.image&&(this.image=new An(_c(this.resource.path,e.image,this.resource.pathMap)))}async load(){let e=this.tiledImageLayer.opacity,R=!!this.tiledImageLayer.tintcolor,W=this.tiledImageLayer.tintcolor?We.fromHex(this.tiledImageLayer.tintcolor):We.White,Y=vec(this.tiledImageLayer.offsetx??0,this.tiledImageLayer.offsety??0),X=this.tiledImageLayer.parallaxx??1,ie=this.tiledImageLayer.parallaxy??1;if(this.image){this.resource.headless||await this.image.load(),this.imageActor=new _i({name:this.tiledImageLayer.name,pos:Y,anchor:Oe.Zero,z:this.order}),this.imageActor.addComponent(new ParallaxComponent(vec(X,ie)));let ae=this.image.toSprite();this.imageActor.graphics.use(ae),this.imageActor.graphics.visible=this.tiledImageLayer.visible,this.imageActor.graphics.opacity=e,R&&(ae.tint=W)}}},Hp=class ng{constructor(e,R){this.path=e,this.logger=Je.getInstance(),this.tilesets=[],this.templates=[],this.layers=[],this.mapFormat=`TMX`,this.strict=!0,this.factories=new Map,this.parser=new Wl,this.fileLoader=rc,this.startZIndex=0,this.textQuality=4,this.useExcaliburWiring=!0,this.useMapBackgroundColor=!1,this.useTilemapCameraStrategy=!1,this.headless=!1,this.layerConfig={},this._imageLoader=new Ec(An),this._tilesetLoader=new Ec(Oc),this._templateLoader=new Ec(Uc);let{mapFormatOverride:W,textQuality:Y,entityClassNameFactories:X,useExcaliburWiring:ie,useTilemapCameraStrategy:ae,useMapBackgroundColor:le,layerConfig:_e,pathMap:ye,fileLoader:be,strict:Ce,headless:Te,startZIndex:Oe}={...R};this.strict=Ce??this.strict,this.headless=Te??this.headless,this.useExcaliburWiring=ie??this.useExcaliburWiring,this.useTilemapCameraStrategy=ae??this.useTilemapCameraStrategy,this.useMapBackgroundColor=le??this.useMapBackgroundColor,this.layerConfig=_e??this.layerConfig,this.textQuality=Y??this.textQuality,this.startZIndex=Oe??this.startZIndex,this.fileLoader=be??this.fileLoader,this.pathMap=ye;for(let e in X)this.registerEntityFactory(e,X[e]);this.mapFormat=W??(e.includes(`.tmx`)?`TMX`:`TMJ`)}registerEntityFactory(e,R){if(this.factories.has(e)&&console.warn(`Another factory has already been registered for tiled class/type "${e}", this is probably a bug.`),this.factories.set(e,R),this.isLoaded())for(let R of this.getObjectLayers())R.runFactory(e)}unregisterEntityFactory(e){this.factories.has(e)||console.warn(`No factory has been registered for tiled class/type "${e}", cannot unregister!`),this.factories.delete(e)}getLayerConfig(e){return this.layerConfig[e]}getTilesetForTileGid(e){let R=Cc(e);if(this.tilesets){for(let e of this.tilesets)if(R>=e.firstGid&&R<=e.firstGid+e.tileCount-1)return e}throw Error(`No tileset exists for tiled gid [${e}] normalized [${R}]!`)}getTilesetByName(e){return this.tilesets.filter(ac(e))}getTilesetByClassName(e){return this.tilesets.filter(lc(e))}getTilesetByProperty(e,R){return this.tilesets.filter(gc(e,R))}getTileMetadataByClassName(e){let R=[];for(let W of this.tilesets)R=R.concat(W.tiles.filter(lc(e)));return R}getTileMetadataByProperty(e,R){let W=[];for(let Y of this.tilesets)W=W.concat(Y.tiles.filter(gc(e,R)));return W}getTilesByGid(e){if(this.map.orientation===`orthogonal`){let R=[];for(let W of this.getTileLayers())R=R.concat(W.getTilesByGid(e));return R}{let R=[];for(let W of this.getIsoTileLayers())R=R.concat(W.getTilesByGid(e));return R}}getTilesByClassName(e){if(this.map.orientation===`orthogonal`){let R=[];for(let W of this.getTileLayers())R=R.concat(W.getTilesByClassName(e));return R}{let R=[];for(let W of this.getIsoTileLayers())R=R.concat(W.getTilesByClassName(e));return R}}getTilesByProperty(e,R){if(this.map.orientation===`orthogonal`){let W=[];for(let Y of this.getTileLayers())W=W.concat(Y.getTilesByProperty(e,R));return W}{let W=[];for(let Y of this.getIsoTileLayers())W=W.concat(Y.getTilesByProperty(e,R));return W}}getTileByPoint(e,R){if(this.map.orientation===`isometric`){let W=this.getIsoTileLayers().find(ac(e));if(W)return W.getTileByPoint(R)}else{let W=this.getTileLayers().find(ac(e));if(W)return W.getTileByPoint(R)}return null}getTileByCoordinate(e,R,W){if(this.map.orientation===`isometric`){let Y=this.getIsoTileLayers().find(ac(e));if(Y)return Y.getTileByCoordinate(R,W)}else{let Y=this.getTileLayers().find(ac(e));if(Y)return Y.getTileByCoordinate(R,W)}return null}getTilesByPoint(e){if(this.map.orientation===`orthogonal`){let R=[];for(let W of this.getTileLayers()){let Y=W.getTileByPoint(e);Y&&R.push(Y)}return R}{let R=[];for(let W of this.getIsoTileLayers()){let Y=W.getTileByPoint(e);Y&&R.push(Y)}return R}}getTilesByCoordinate(e,R){if(this.map.orientation===`orthogonal`){let W=[];for(let Y of this.getTileLayers()){let X=Y.getTileByCoordinate(e,R);X&&W.push(X)}return W}{let W=[];for(let Y of this.getIsoTileLayers()){let X=Y.getTileByCoordinate(e,R);X&&W.push(X)}return W}}getObjectsByName(e){let R=[];for(let W of this.getObjectLayers())R=R.concat(W.getObjectsByName(e));return R}getEntitiesByName(e){let R=[];for(let W of this.getObjectLayers())R=R.concat(W.getEntitiesByName(e));return R}getEntityByObject(e){for(let R of this.getObjectLayers()){let W=R.getEntityByObject(e);if(W)return W}}getObjectByEntity(e){for(let R of this.getObjectLayers()){let W=R.getObjectByEntity(e);if(W)return W}}getObjectsByProperty(e,R){let W=[];for(let Y of this.getObjectLayers())W=W.concat(Y.getObjectsByProperty(e,R));return W}getEntitiesByProperty(e,R){let W=[];for(let Y of this.getObjectLayers())W=W.concat(Y.getEntitiesByProperty(e,R));return W}getObjectsByClassName(e){let R=[];for(let W of this.getObjectLayers())R=R.concat(W.getObjectsByClassName(e));return R}getEntitiesByClassName(e){let R=[];for(let W of this.getObjectLayers())R=R.concat(W.getEntitiesByClassName(e));return R}getImageLayers(e){let R=this.layers.filter((e=>e instanceof ig));return e?R.filter(ac(e)):R}getTileLayers(e){let R=this.layers.filter((e=>e instanceof jc));return e?R.filter(ac(e)):R}getIsoTileLayers(e){let R=this.layers.filter((e=>e instanceof qc));return e?R.filter(ac(e)):R}getObjectLayers(e){let R=this.layers.filter((e=>e instanceof Yc));return e?R.filter(ac(e)):R}getLayersByName(e){return this.layers.filter(ac(e))}getLayersByClassName(e){return this.layers.filter(lc(e))}getLayersByProperty(e,R){return this.layers.filter(gc(e,R))}_parseMap(e){return this.mapFormat===`TMX`?this.parser.parse(e,this.strict):e}async load(){let e=await this.fileLoader(this.path,this.mapFormat===`TMX`?`xml`:`json`),R;if(this.strict)try{R=this._parseMap(e)}catch(e){throw console.error(`Could not parse tiled map from location ${this.path}, attempted to interpret as ${this.mapFormat}.\nExcalibur only supports the latest version of Tiled formats as of the plugin's release.`),console.error(`Is your map file corrupted or being interpreted as the wrong type?`),e}else R=this._parseMap(e);Xc(ng.supportedTiledVersion,R.tiledversion??`0.0.0`,`>`)&&console.warn(`The excalibur tiled plugin officially supports ${ng.supportedTiledVersion}+, the current map has tiled version ${R.tiledversion}`),this.map=R,this._collectTilesets(),this._collectTemplates(),await Promise.all([this._tilesetLoader.load(),this.headless?Promise.resolve():this._imageLoader.load(),this._templateLoader.load()]),this.tilesets=[...this.tilesets,...this._tilesetLoader.values().map((e=>e.data))],this.templates=this._templateLoader.values().map((e=>e.data));let W=[],Y=this.startZIndex;for(let e of this.map.layers){if(e.type===`tilelayer`){if(this.map.orientation===`isometric`){let R=new qc(e,this,Y);W.push(R)}if(this.map.orientation===`orthogonal`){let R=new jc(e,this,Y);W.push(R)}}if(e.type===`objectgroup`){let R=new Yc(e,this,Y);W.push(R)}if(e.type===`imagelayer`){let R=new ig(e,this,Y);W.push(R)}Y++}await Promise.all(W.map((e=>e.load()))),this.layers=W}_collectTilesets(){for(let e of this.map.tilesets){if(Pl(e)){if(Ol(e)){let R=_c(this.path,e.image,this.pathMap),W=this._imageLoader.getOrAdd(R),Y=new Mc({name:e.name,tiledTileset:e,image:W,firstGid:e.firstgid});this.tilesets.push(Y)}if(Ul(e)){let R=new Map;if(e.tiles){for(let W of e.tiles)if(W.image){let e=_c(this.path,W.image,this.pathMap),Y=this._imageLoader.getOrAdd(e);R.set(W,Y)}}let W=new Mc({name:e.name,tiledTileset:e,tileToImage:R,firstGid:e.firstgid});this.tilesets.push(W)}}if($l(e)){let R=_c(this.path,e.source,this.pathMap);this._tilesetLoader.getOrAdd(R,e.firstgid,{strict:this.strict,headless:this.headless,parser:this.parser,fileLoader:this.fileLoader,imageLoader:this._imageLoader,pathMap:this.pathMap})}}}_collectTemplates(){let e=[];for(let R of this.map.layers)if(R.type===`objectgroup`){let W=R.objects.filter((e=>e.template)).map((e=>e.template));e=e.concat(W)}let R=e.filter(((e,R,W)=>W.findIndex((R=>R===e))===R));for(let e of R){let R=_c(this.path,e,this.pathMap);this._templateLoader.getOrAdd(R,{strict:this.strict,headless:this.headless,parser:this.parser,fileLoader:this.fileLoader,imageLoader:this._imageLoader,pathMap:this.pathMap})}}addToScene(e,R){if(!this.isLoaded())return void this.logger.warn(`TiledResource ${this.path} is not loaded! Nothing will be wired into excalibur!`);let{pos:W}={pos:vec(0,0),...R};for(let R of this.layers){if(R instanceof jc&&(R.tilemap.pos=R.tilemap.pos.add(W),e.add(R.tilemap)),R instanceof qc&&e.add(R.isometricMap),R instanceof Yc)for(let Y of R.entities){let R=Y.get(Xe);R&&(R.pos=R.pos.add(W)),e.add(Y)}R instanceof ig&&R.imageActor&&(R.imageActor.pos=R.imageActor.pos.add(W),e.add(R.imageActor))}if(this.useExcaliburWiring){let R=this.getObjectsByProperty(Rp.Camera.Camera,!0);if(R&&R.length){let W=R[0],Y=1,X=W.properties.get(Rp.Camera.Zoom);X&&typeof X==`number`&&(Y=X),this.map.orientation===`isometric`?e.camera.pos=this.isometricTiledCoordToWorld(W.x,W.y):e.camera.pos=vec(W.x,W.y),e.camera.zoom=Y}}if(this.useTilemapCameraStrategy){let R=this.getTileLayers()[0];if(R){let Y=lt.fromDimension(this.map.width*this.map.tilewidth,this.map.height*this.map.tileheight,Oe.Zero,W.add(R.tilemap.pos));e.camera.strategy.limitCameraBounds(Y)}}this.useMapBackgroundColor&&this.map.backgroundcolor&&(e.backgroundColor=We.fromHex(this.map.backgroundcolor))}isometricTiledCoordToWorld(e,R){let W=this.map.tilewidth,Y=this.map.tileheight,X=R/Y,ie=e/Y;return vec((ie-X)*W/2+0,(ie+X)*Y/2)}isLoaded(){return!!this.map}};Hp.supportedTiledVersion=`1.10.1`;const Up={img:{player:new An(`/res/images/Player.png`),level1Background:new An(`/res/images/Forest_Background_0.png`),spiderGreen:new An(`/res/images/Spider_1.png`),spiderGray:new An(`/res/images/Spider_2.png`),birdPurple:new An(`/res/images/Bird_1.png`),birdOrange:new An(`/res/images/Bird_2.png`),platform:new An(`/res/images/Platform.png`),bouncepadGreen:new An(`/res/images/Bouncepad_Green.png`),bouncepadRed:new An(`/res/images/Bouncepad_Red.png`),bouncepadWood:new An(`/res/images/Bouncepad_Wood.png`),axe:new An(`/res/images/Axe_Trap.png`),circularSaw:new An(`/res/images/Circular_Saw.png`),smokePuff:new An(`/res/images/Smoke_Puff.png`),smokeLand:new An(`/res/images/Smoke_Land.png`),coin:new An(`/res/images/Coin.png`),coinsUi:new An(`/res/images/Coins_Ui.png`)},fonts:{round:new FontSource(`/res/fonts/Round9x13.ttf`,`Round9x13`,{filtering:Yt.Pixel,quality:4})},music:{stage1:new Sound(`/res/music/stage1.mp3`),stage2:new Sound(`/res/music/stage2.mp3`)},sfx:{jump:new Sound(`/res/sfx/jump.wav`),jumpSpring:new Sound(`/res/sfx/jump-spring.wav`),land:new Sound(`/res/sfx/land.wav`),turnAround:new Sound(`/res/sfx/turn-around.wav`),stomp:new Sound(`/res/sfx/stomp.wav`),damage:new Sound(`/res/sfx/damage.wav`),collectCoin:new Sound(`/res/sfx/coin.wav`)},tiled:{level1:new Hp(`/res/tilemaps/level1.tmx`,{useTilemapCameraStrategy:!0})}};var DevLoader=class extends Ii{showPlayButton(){return Promise.resolve()}draw(){}dispose(){}static __type=[()=>Ii,`showPlayButton`,`draw`,`dispose`,`DevLoader`,`P7!P"0"P"0#P"0$5w%`]};const Wp=new DevLoader;for(let e of Object.values(Up))for(let R of Object.values(e))Wp.addResource(R);function __assignType$19(e,R){return e.__type=R,e}__name(__assignType$19,`__assignType`);var OneWayCollisionComponent=class extends Component{type=`one-way-collision`;onAdd(e){let R=e.onPreCollisionResolve.bind(e);e.onPreCollisionResolve=__assignType$19((...e)=>{this.onPreCollisionResolve(...e),R(...e)},[`args`,``,`P"@2!"/"`])}onPreCollisionResolve(e,R,W,Y){if(!(R.owner instanceof _i))return;let X=R.owner.pos.sub(R.owner.oldPos),ie=R.bounds.bottom-X.y<e.bounds.top+1;if(W!==st.Top||!ie){Y.cancel();return}}static __type=[()=>Component,`type`,function(){return`one-way-collision`},`owner`,`onAdd`,`self`,`other`,`side`,`contact`,`onPreCollisionResolve`,`OneWayCollisionComponent`,`P7!&3">#P!2$$0%P!2&!2'!2(!2)$0*5w+`]};function __assignType$18(e,R){return e.__type=R,e}__name(__assignType$18,`__assignType`);const Gp=[`Ground`,()=>1,`Player`,()=>2,`Enemy`,()=>4,`Item`,()=>8,`PhysicalItem`,()=>16,`Hazard`,()=>32,`Climbable`,()=>64,`Category`,`PC!>"C#>$C%>&C'>(C)>*C+>,C->.Bw/`],Kp={Ground:new et(`ground`,1,collideWith(2,4,16)),Player:new et(`player`,2,collideWith(1,4,8,32,16,64)),Enemy:new et(`enemy`,4,collideWith(1,2)),Hazard:new et(`hazard`,32,collideWith(2)),Item:new et(`item`,8,collideWith(2)),PhysicalItem:new et(`phys-item`,16,collideWith(1,2)),Climbable:new et(`climbable`,64,collideWith(2))};function collideWith(...e){return e.reduce(__assignType$18((e,R)=>e|R,[`acc`,`cat`,``,`P"2!"2""/#`]),0)}collideWith.__type=[()=>Gp,`categories`,`collideWith`,`Pn!@2""/#`];var OneWayPlatform=class extends _i{constructor(e){super({...e,collisionType:Ye.Fixed,collisionGroup:Kp.Ground,anchor:vec(0,0),height:16}),this.addComponent(new OneWayCollisionComponent)}static __type=[()=>_i,`args`,`constructor`,`OneWayPlatform`,`P7!P!2""0#5w$`]};const qp=[`K`,`T`,`Record`,`l'e#"Rb!b"Pde"!N#!w#y`];function __assignType$17(e,R){return e.__type=R,e}__name(__assignType$17,`__assignType`);var AnimationComponent=class extends Component{type=`animation`;_animations;_speed=1;_frameDurations=(WeakMap.Ω=[[`!`],[`'`]],new WeakMap);constructor(e){super(),this._animations=e}set(e,R=0,W){let Y=this.owner.graphics.current,X=this._animations[e];this.is(e)||(R?X.goToFrame(R,W):X.reset(),Y&&(X.scale.setTo(Y.scale.x,Y.scale.y),X.opacity=Y.opacity),this.owner.graphics.use(X))}get(e){return this._animations[e]}set speed(e){this._speed=e,e!==0&&this.current.frames.forEach(__assignType$17(R=>{this._frameDurations.has(R)||this._frameDurations.set(R,R.duration??0),R.duration=this._frameDurations.get(R)/e},[`frame`,``,`P"2!"/"`]))}get speed(){return this._speed}get current(){return this.owner.graphics.current}is(e){return this.current===this.get(e)}static __type=[`Keys`,()=>Component,`graphics`,`owner`,`type`,function(){return`animation`},()=>qp,`_animations`,`_speed`,function(){return 1},`_frameDurations`,function(){return WeakMap.Ω=[[`!`],[`'`]],new WeakMap},()=>qp,`animations`,`constructor`,`name`,`startFromFrame`,`durationLeft`,`set`,`get`,`animation`,`is`,`AnimationComponent`,`b!P7"P!P!4#MK3$&3%>&e!!!o'#3(;'3);>*!3+;>,Pe"!!o-#2."0/Pe"!20"21'228"03Pe"!20"04!!Pe"!25"065w7`]};function __assignType$16(e,R){return e.__type=R,e}__name(__assignType$16,`__assignType`);var ControlsComponent=class extends Component{type=`input`;controls={Left:[Ui.Left,Hi.DpadLeft],Right:[Ui.Right,Hi.DpadRight],Up:[Ui.Up,Hi.DpadUp],Down:[Ui.Down,Hi.DpadDown],Jump:[Ui.A,Hi.Face1],Run:[Ui.S,Hi.Face3]};isHeld(e){let R=this.owner.scene.engine,[W,Y]=this.controls[e];return!!(R.input.keyboard.isHeld(W)||this.getGamepad()?.isButtonHeld(Y))}wasPressed(e){let R=this.owner.scene.engine,[W,Y]=this.controls[e];return!!(R.input.keyboard.wasPressed(W)||this.getGamepad()?.wasButtonPressed(Y))}wasReleased(e){let R=this.owner.scene.engine,[W,Y]=this.controls[e];return!!(R.input.keyboard.wasReleased(W)||this.getGamepad()?.wasButtonReleased(Y))}getGamepad(){let e=this.owner.scene.engine;return[e.input.gamepads.at(0),e.input.gamepads.at(1),e.input.gamepads.at(2),e.input.gamepads.at(3)].find(__assignType$16(e=>e.connected,[`g`,``,`P"2!"/"`]))}getHeldXDirection(){let e=this.owner.scene.engine;for(let R of e.input.keyboard.getKeys().slice().reverse()){if(this.controls.Left.includes(R))return`Left`;if(this.controls.Right.includes(R))return`Right`}if(this.getGamepad()){if(this.isHeld(`Left`))return`Left`;if(this.isHeld(`Right`))return`Right`}}getHeldYDirection(){let e=this.owner.scene.engine;for(let R of e.input.keyboard.getKeys().slice().reverse()){if(this.controls.Up.includes(R))return`Up`;if(this.controls.Down.includes(R))return`Down`}if(this.getGamepad()){if(this.isHeld(`Up`))return`Up`;if(this.isHeld(`Down`))return`Down`}}static __type=[()=>Component,`owner`,`type`,function(){return`input`},`controls`,function(){return{Left:[Ui.Left,Hi.DpadLeft],Right:[Ui.Right,Hi.DpadRight],Up:[Ui.Up,Hi.DpadUp],Down:[Ui.Down,Hi.DpadDown],Jump:[Ui.A,Hi.Face1],Run:[Ui.S,Hi.Face3]}},()=>this.controls,`control`,`isHeld`,()=>this.controls,`wasPressed`,()=>this.controls,`wasReleased`,`getGamepad`,`Left`,`Right`,`getHeldXDirection`,`Up`,`Down`,`getHeldYDirection`,`ControlsComponent`,`P7!!3"&3#>$!3%>&Pi'g2("0)Pi*g2("0+Pi,g2("0-P"0.PP./.0-J01PP.2.3-J045w5`]},ClimbableComponent=class extends Component{static __type=[()=>Component,`ClimbableComponent`,`P7!5w"`]};function __assignType$15(e,R){return e.__type=R,e}__name(__assignType$15,`__assignType`);const Jp=[`left`,`right`,`top`,`bottom`,`Side`,`P.!.".#.$Jw%y`];var TouchingComponent=class extends Component{type=`touching`;contacts=(Map.Ω=[[`&`],[`contact`,`actor`,()=>Jp,`side`,`P!4!!4"n#4$M`]],new Map);left=(Set.Ω=[[`!`]],new Set);right=(Set.Ω=[[`!`]],new Set);top=(Set.Ω=[[`!`]],new Set);bottom=(Set.Ω=[[`!`]],new Set);passives=(Set.Ω=[[`!`]],new Set);onAdd(e){e.on(`collisionstart`,__assignType$15(e=>{let R=e.other.owner;if(R)if(R.get(Ti)?.collisionType===Ye.Passive)this.passives.add(R);else{let W=e.side.toLowerCase();this.contacts.set(e.contact.id,{contact:e.contact,actor:R,side:W}),this.updateSides()}},[`ev`,``,`P"2!"/"`])),e.on(`collisionend`,__assignType$15(e=>{let R=e.other.owner;R?.get(Ti)?.collisionType===Ye.Passive?this.passives.delete(R):(this.contacts.delete(e.lastContact.id),this.updateSides())},[`ev`,``,`P"2!"/"`]))}updateSides(){this.left.clear(),this.right.clear(),this.top.clear(),this.bottom.clear();for(let{side:e,actor:R}of this.contacts.values())this[e].add(R)}get ladders(){return new Set(Array.from(this.passives).filter(__assignType$15(e=>e.has(ClimbableComponent),[`e`,``,`P"2!"/"`])))}static __type=[()=>Component,`type`,function(){return`touching`},`contacts`,function(){return Map.Ω=[[`&`],[`contact`,`actor`,()=>Jp,`side`,`P!4!!4"n#4$M`]],new Map},`left`,function(){return Set.Ω=[[`!`]],new Set},`right`,function(){return Set.Ω=[[`!`]],new Set},`top`,function(){return Set.Ω=[[`!`]],new Set},`bottom`,function(){return Set.Ω=[[`!`]],new Set},`passives`,function(){return Set.Ω=[[`!`]],new Set},`owner`,`onAdd`,`updateSides`,`TouchingComponent`,`P7!&3">#!3$;>%!3&>'!3(>)!3*>+!3,>-!3.>/P!20$01P"02;!5w3`]},CarrierComponent=class extends Component{type=`carrier`;onAdd(e){e.on(`collisionstart`,this.onCollisionStart.bind(this)),e.on(`collisionend`,this.onCollisionEnd.bind(this)),e.on(`initialize`,this.onInitialize.bind(this))}onInitialize(){let e=this.owner;e.once(`postupdate`,()=>{--e.pos.y,e.once(`preupdate`,()=>{e.pos.y+=1})})}onCollisionStart(e){let R=e.other.owner;R.get(CarriableComponent)?.canBeCarried&&e.side===st.Top&&!this.owner.children.includes(R)&&this.addChild(R)}onCollisionEnd(e){let R=e.other.owner;this.owner.children.includes(R)&&this.removeChild(R)}addChild(e){this.owner.addChild(e),e.pos.x-=this.owner.pos.x,e.pos.y-=this.owner.pos.y}removeChild(e){this.owner.removeChild(e),this.owner.scene.add(e),e.pos.x+=this.owner.pos.x,e.pos.y+=this.owner.pos.y}static __type=[()=>Component,`owner`,`type`,function(){return`carrier`},`onAdd`,`onInitialize`,`event`,`onCollisionStart`,`onCollisionEnd`,`actor`,`addChild`,`removeChild`,`CarrierComponent`,`P7!!3"&3#>$P!2"$0%P$0&P!2'$0(P!2'$0)P!2*"0+P!2*"0,5w-`]},CarriableComponent=class extends Component{canBeCarried=!0;static __type=[()=>Component,`owner`,`canBeCarried`,function(){return!0},`CarriableComponent`,`P7!!3")3#>$5w%`]};const Yp=[`T`,`K`,()=>Xp,()=>Zp,`Omit`,`b!b"e!!e!!ge!"o$#o##w%y`],Xp=[`T`,`K`,`Pick`,`l+e#!e"!fRb!b"Pde""N#!w#y`],Zp=[`T`,`U`,`Exclude`,`l6!Re$!RPe#!e$"qk#%QRb!b"Pde"!p)w#y`];function __assignType$14(e,R){return e.__type=R,e}__name(__assignType$14,`__assignType`);var PhysicsActor=class extends _i{touching=new TouchingComponent;isOnGround=!1;_oldPosGlobal=vec(0,0);_ray1=new Ray(vec(0,0),vec(1,0));_ray2=new Ray(vec(0,0),vec(1,0));constructor(e){super(e),this.addComponent(new CarriableComponent)}onInitialize(e){this.addComponent(this.touching),this.on(`preupdate`,()=>{this.isOnGround=this.touching.bottom.size>0}),this.on(`postupdate`,()=>{let e=this.getGlobalPos();this._oldPosGlobal.setTo(e.x,e.y)})}get canBeCarried(){return this.get(CarriableComponent).canBeCarried}set canBeCarried(e){this.get(CarriableComponent).canBeCarried=e}raycast(e,R,W){return this.scene.physics.rayCast(e,{maxDistance:R,searchAllColliders:!0,...W}).filter(__assignType$14(e=>e.body!==this.body,[`hit`,``,`P"2!"/"`])).sort(__assignType$14((e,R)=>e.distance-R.distance,[`a`,`b`,``,`P"2!"2""/#`]))}raycastSide(e,R,W){let Y=this.collider.bounds,X=Math.round(Y.left)+1,ie=Math.round(Y.right)-1,ae=Math.round(Y.top)+1,le=Math.round(Y.bottom)-1;if(e===`left`||e===`right`){let R=e===`left`?X:ie,W=e===`left`?-1:1;this._ray1.pos.setTo(R,ae),this._ray1.dir.setTo(W,0),this._ray2.pos.setTo(R,le),this._ray2.dir.setTo(W,0)}else{let R=e===`top`?ae:le,W=e===`top`?-1:1;this._ray1.pos.setTo(X,R),this._ray1.dir.setTo(0,W),this._ray2.pos.setTo(ie,R),this._ray2.dir.setTo(0,W)}let _e=this.raycast(this._ray1,R,W),ye=this.raycast(this._ray2,R,W);if(ye.length===0)return _e;if(_e.length===0)return ye;let be=_e.slice();for(let e of ye)_e.indexOf(e)===-1&&be.push(e);return be}getGlobalOldPos(){return this._oldPosGlobal}static __type=[()=>_i,`touching`,function(){return new TouchingComponent},`isOnGround`,function(){return!1},`_oldPosGlobal`,function(){return vec(0,0)},`_ray1`,function(){return new Ray(vec(0,0),vec(1,0))},`_ray2`,function(){return new Ray(vec(0,0),vec(1,0))},`args`,`constructor`,`_engine`,`onInitialize`,`ray`,`distance`,()=>Yp,`maxDistance`,`opts`,`raycast`,`left`,`right`,`top`,`bottom`,`side`,()=>Yp,`maxDistance`,`raycastSide`,`getGlobalOldPos`,`PhysicsActor`,`P7!!3">#)3$>%!3&;>'!3(;>)!3*;>+P!2,"0-P!2.$0/!P!20'21!.3o2#248"05PP.6.7.8.9J2:'21!.<o;#248"0=P"0>5w?`]};let Qp=null,$p=!1;var em=class AudioManager{static levels=(Map.Ω=[[`!`],[`'`]],new Map([[Up.music.stage1,.1],[Up.music.stage2,.1],[Up.sfx.jump,.25],[Up.sfx.jumpSpring,.25],[Up.sfx.land,.25],[Up.sfx.turnAround,.25],[Up.sfx.stomp,.25],[Up.sfx.damage,.25],[Up.sfx.collectCoin,.25]]));static get isMuted(){return $p}static init(e=!1){$p=e;for(let e of Object.values(Up))for(let R of Object.values(e))R instanceof Sound&&(R.volume=$p?0:AudioManager.levels.get(R)??1)}static muteAll(){$p=!0;for(let e of Object.values(Up))for(let R of Object.values(e))R instanceof Sound&&(R.stop(),R.volume=0)}static unmuteAll(){$p=!1;for(let e of Object.values(Up))for(let R of Object.values(e))R instanceof Sound&&(R.volume=AudioManager.levels.get(R)??1);Qp&&(Qp.play(),Qp.loop=!0)}static playSong(e){Qp&&Qp.stop(),Qp=e,$p||Qp.play(),Qp.loop=!0}static playSfx(e,R={}){if($p)return;let{volume:W=AudioManager.levels.get(e),force:Y=!1}=R;(Y||!e.isPlaying())&&e.play(W)}static __type=[`levels`,function(){return Map.Ω=[[`!`],[`'`]],new Map([[Up.music.stage1,.1],[Up.music.stage2,.1],[Up.sfx.jump,.25],[Up.sfx.jumpSpring,.25],[Up.sfx.land,.25],[Up.sfx.turnAround,.25],[Up.sfx.stomp,.25],[Up.sfx.damage,.25],[Up.sfx.collectCoin,.25]])},`startMuted`,`init`,`muteAll`,`unmuteAll`,`song`,`playSong`,`sfx`,()=>tm,`opts`,()=>({}),`playSfx`,`AudioManager`,`!3!s>"!P"2#"0$sP"0%sP"0&sP!2'"0(sP!2)n*2+>,"0-s5w.`]};const tm=[`volume`,`force`,`PlaySfxOptions`,`P'4!8)4"8Mw#y`],nm=new Oe(0,1450),rm={rows:1,columns:3,spriteWidth:48,spriteHeight:48},im={green:{force:500,spritesheet:ir.fromImageSource({image:Up.img.bouncepadGreen,grid:rm})},red:{force:700,spritesheet:ir.fromImageSource({image:Up.img.bouncepadRed,grid:rm})}},am=[()=>im,`type`,`BouncepadArgs`,`P!Pi!g4"8MKw#y`];var Bouncepad=class extends _i{COMPRESS_TIME=250;COMPRESS_DISTANCE=2;spritesheet;force;animation;touching=new TouchingComponent;colliderShape;constructor({type:e=`green`,...R}){super({...R,name:`bouncepad`,anchor:vec(.5,1),width:16,height:16,collisionType:Ye.Fixed}),this.graphics.offset=vec(0,16),this.pos.x+=this.width*this.anchor.x,this.pos.y+=this.height*this.anchor.y,this.spritesheet=im[e].spritesheet,this.force=im[e].force,this.animation=new AnimationComponent({neutral:Ht.fromSpriteSheet(this.spritesheet,[2],0),compressed:Ht.fromSpriteSheet(this.spritesheet,[1],this.COMPRESS_TIME),released:Ht.fromSpriteSheet(this.spritesheet,[0,0,0,0,1],150)}),this.colliderShape=Ft.Box(16,16,this.anchor),this.collider.set(this.colliderShape),this.addTag(`bouncepad`),this.addComponent(this.animation),this.addComponent(this.touching),this.addComponent(new OneWayCollisionComponent)}onInitialize(e){this.graphics.use(this.animation.get(`neutral`)),this.animation.get(`compressed`).events.on(`loop`,()=>{this.release()}),this.animation.get(`released`).events.on(`loop`,()=>{this.animation.set(`neutral`)})}compress(){if(this.animation.current===this.animation.get(`compressed`))return;this.graphics.use(this.animation.get(`compressed`));let e=this.colliderShape.points[0],R=this.colliderShape.points[1];e.y+=this.COMPRESS_DISTANCE,R.y+=this.COMPRESS_DISTANCE,this.colliderShape.points=this.colliderShape.points;for(let e of this.touching.top)e instanceof _i&&(e.pos.y+=this.COMPRESS_DISTANCE)}release(){if(this.animation.current!==this.animation.get(`compressed`))return;this.graphics.use(this.animation.get(`released`));let e=this.colliderShape.points[0],R=this.colliderShape.points[1];e.y-=this.COMPRESS_DISTANCE,R.y-=this.COMPRESS_DISTANCE,this.colliderShape.points=this.colliderShape.points;for(let e of this.touching.top)e instanceof _i&&(e.pos.y-=this.COMPRESS_DISTANCE,e.vel.y=-this.force,em.playSfx(Up.sfx.jumpSpring))}onCollisionStart(e,R,W,Y){W===st.Top&&R.owner instanceof _i&&this.compress()}static __type=[()=>_i,`COMPRESS_TIME`,function(){return 250},`COMPRESS_DISTANCE`,function(){return 2},`spritesheet`,`force`,`neutral`,`compressed`,`released`,()=>AnimationComponent,`animation`,`touching`,function(){return new TouchingComponent},`colliderShape`,()=>am,`param0`,`constructor`,`_engine`,`onInitialize`,`compress`,`release`,`self`,`other`,`side`,`_contact`,`onCollisionStart`,`Bouncepad`,`P7!'3">#'3$>%!3&'3'PP.(.).*J7+3,!3->.!3/;Pn021"02P!23$04P"05P"06P!27!28!29!2:$0;5w<`]},StompableComponent=class extends Component{stomped=!1;stomp(){this.stomped||(this.stomped=!0,this.owner.graphics.current.scale=vec(1,.25))}isBeingStomped(e){let R=e.getGlobalPos().sub(e.getGlobalOldPos());return e.collider.bounds.bottom-R.y<this.owner.collider.bounds.top+1}static __type=[()=>Component,`owner`,`stomped`,function(){return!1},`stomp`,`PhysicsActor`,`other`,`isBeingStomped`,`StompableComponent`,`P7!!3")3#>$P"0%P"w&2'"0(5w)`]};const om=[`instant`,`stomp`,`KillMethod`,`P.!."Jw#y`],sm=[`stompDuration`,`KillableComponentArgs`,`P'4!8Mw"y`];var KillableComponent=class extends Component{dead=!1;events=(EventEmitter.Ω=[[()=>om,`method`,`kill`,`PPn!4"M4#M`]],new EventEmitter);stompDuration=700;constructor({stompDuration:e}={}){super(),this.stompDuration=e??700}kill(e){if(e===`stomp`&&!this.owner.has(StompableComponent))throw Error(`Cannot kill with stomp method: actor does not have a StompableComponent`);if(!this.dead){if(this.dead=!0,this.events.emit(`kill`,{method:e}),e===`instant`)this.owner.kill();else if(e===`stomp`){let e=this.owner.get(StompableComponent);this.owner.actions.callMethod(()=>{e.stomp()}).delay(this.stompDuration*.8).fade(0,this.stompDuration*.2).callMethod(()=>{this.owner.kill()})}}}static __type=[()=>Component,`owner`,`dead`,function(){return!1},`events`,function(){return EventEmitter.Ω=[[()=>om,`method`,`kill`,`PPn!4"M4#M`]],new EventEmitter},`stompDuration`,function(){return 700},()=>sm,`param0`,()=>({}),`constructor`,()=>om,`method`,`kill`,`KillableComponent`,`P7!!3")3#>$!3%>&'3';>(Pn)2*>+"0,Pn-2."0/5w0`]};const cm={puff:{spritesheet:ir.fromImageSource({image:Up.img.smokePuff,grid:{rows:1,columns:8,spriteWidth:32,spriteHeight:32}}),get animation(){return Ht.fromSpriteSheet(this.spritesheet,[0,1,2,3,4,5,6,7],50,zt.End)}},land:{spritesheet:ir.fromImageSource({image:Up.img.smokeLand,grid:{rows:1,columns:3,spriteWidth:32,spriteHeight:32}}),get animation(){return Ht.fromSpriteSheet(this.spritesheet,[0,0,0,1,1,2],60,zt.End)}}},lm=[`puff`,`land`,`type`,`SmokeArgs`,`P!PP.!."J4#MKw$y`];var Smoke=class extends _i{constructor({type:e,...R}){super({anchor:vec(.5,.5),...R});let W=cm[e].animation;W.events.on(`end`,()=>{this.kill()}),this.graphics.use(W),e===`puff`&&(this.vel.y=-20)}static __type=[()=>_i,()=>lm,`param0`,`constructor`,`Smoke`,`P7!Pn"2#"0$5w%`]},HealthComponent=class extends Component{_amount;_max;events=(EventEmitter.Ω=[[`die`,`amount`,`change`,`P$4!P'4"M4#M`]],new EventEmitter);constructor({amount:e}){super(),this._max=e,this._amount=e}get max(){return this._max}get amount(){return this._amount}set amount(e){this._amount=e,this.events.emit(`change`,{amount:e}),this._amount<=0&&this.events.emit(`die`)}static __type=[()=>Component,`_amount`,`_max`,`events`,function(){return EventEmitter.Ω=[[`die`,`amount`,`change`,`P$4!P'4"M4#M`]],new EventEmitter},`amount`,`param0`,`constructor`,`HealthComponent`,`P7!'3";'3#;!3$>%PP'4&M2'"0(!!5w)`]};const um=[`T`,`args`,``,`ReturnType`,`l>e"!R"RPde#!P"@2"h"!/#qk#'QRb!Pde"!p)w$y`];function __assignType$13(e,R){return e.__type=R,e}__name(__assignType$13,`__assignType`);var dm=class DamageableComponent extends Component{events=(EventEmitter.Ω=[[`amount`,`left`,`right`,`knockback`,`damage`,`PP'4!P.".#J4$8M4%M`]],new EventEmitter);INVINCIBILITY_DURATION=2e3;KNOCKBACK_DURATION=200;isInvincible=!1;isBeingKnockedBack=!1;damage(e,R){if(this.isInvincible)return;let W=this.owner.get(HealthComponent);if(this.events.emit(`damage`,{amount:e,knockback:R}),this.isInvincible=!0,em.playSfx(Up.sfx.damage),W&&(W.amount-=e),R){let e=100*(R===`left`?-1:1);this.owner.vel=vec(e,-300),this.owner.acc=vec(0,0),this.isBeingKnockedBack=!0}coroutine(this.owner.scene.engine,__assignType$13(function*(){let e=0;for(;e<Math.max(this.KNOCKBACK_DURATION,this.INVINCIBILITY_DURATION);)if(e+=yield 1,this.isBeingKnockedBack&&e>=this.KNOCKBACK_DURATION&&(this.isBeingKnockedBack=!1,this.owner.vel.x=0),e>=this.INVINCIBILITY_DURATION&&(this.isInvincible=!1),this.owner.graphics.current){let R=Math.floor(e/100)%2==0;this.owner.graphics.current.opacity=R?.35:1}this.owner.graphics.current&&(this.owner.graphics.current.opacity=1)},[()=>DamageableComponent,`this`,()=>um,``,`PP7!2"!o#"/$`]).bind(this))}static __type=[()=>Component,`owner`,`events`,function(){return EventEmitter.Ω=[[`amount`,`left`,`right`,`knockback`,`damage`,`PP'4!P.".#J4$8M4%M`]],new EventEmitter},`INVINCIBILITY_DURATION`,function(){return 2e3},`KNOCKBACK_DURATION`,function(){return 200},`isInvincible`,function(){return!1},`isBeingKnockedBack`,function(){return!1},`amount`,`left`,`right`,`knockback`,`damage`,`DamageableComponent`,`P7!!3"!3#>$'3%>&'3'>()3)>*)3+>,P'2-P.../J208"015w2`]},CollectableComponent=class extends Component{isCollected=!1;isCollectable=!0;static __type=[()=>Component,`isCollected`,function(){return!1},`isCollectable`,function(){return!0},`CollectableComponent`,`P7!)3">#)3$>%5w&`]};let fm=3;var pm=class GameManager{static events=(EventEmitter.Ω=[[()=>mm,`n!`]],new EventEmitter);static get coins(){return fm}static set coins(e){e<0&&(e=0),fm=e,GameManager.events.emit(`coinchange`,{coins:fm})}static __type=[`events`,function(){return EventEmitter.Ω=[[()=>mm,`n!`]],new EventEmitter},`GameManager`,`!3!s>"!5w#`]};const mm=[`coins`,`coinchange`,`GameManagerEvents`,`PP'4!M4"Mw#y`];function __assignType$12(e,R){return e.__type=R,e}__name(__assignType$12,`__assignType`);var CoinItem=class extends _i{elapsedMs=0;collected=!1;constructor(e){super({anchor:vec(.5,.75),collisionType:Ye.Passive,collisionGroup:Kp.Item,width:8,height:8,...e}),this.pos.x+=this.width*this.anchor.x,this.pos.y-=this.height*this.anchor.y,this.addComponent(new CollectableComponent),this.graphics.use(Up.img.coin.toSprite())}get collectable(){return this.get(CollectableComponent)}onPreUpdate(e,R){this.elapsedMs+=R,this.pos.y-=Math.sin(this.elapsedMs/200)/10}collect(){!this.collectable.isCollectable||this.collectable.isCollected||(em.playSfx(Up.sfx.collectCoin,{force:!0}),pm.coins+=1,this.collectable.isCollected=!0,this.actions.clearActions(),this.actions.runAction(new ParallelActions([new _a(this,__assignType$12(e=>e.moveBy(vec(0,-16),150),[`ctx`,``,`P"2!"/"`])),new _a(this,__assignType$12(e=>e.fade(0,150),[`ctx`,``,`P"2!"/"`]))])).callMethod(()=>{this.kill()}))}onPreCollisionResolve(e,R,W,Y){R.owner instanceof vm&&(this.collect(),Y.cancel())}static __type=[()=>_i,`elapsedMs`,function(){return 0},`collected`,function(){return!1},`args`,`constructor`,`engine`,`elapsed`,`onPreUpdate`,`collect`,`self`,`other`,`side`,`contact`,`onPreCollisionResolve`,`CoinItem`,`P7!'3">#)3$>%P!2&"0'!P!2('2)$0*P"0+P!2,!2-!2.!2/$005w1`]};function __assignType$11(e,R){return e.__type=R,e}__name(__assignType$11,`__assignType`);var LostCoin=class extends CoinItem{touching=new TouchingComponent;LIFETIME=3e3;TIME_UNTIL_COLLECTABLE=500;BOUNCE=1;FRICTION=.1;constructor(e){super({anchor:vec(.5,.5),collisionType:Ye.Active,collisionGroup:Kp.PhysicalItem,width:8,height:8,z:500,...e}),this.pos.x+=this.width*this.anchor.x,this.pos.y-=this.height*this.anchor.y,this.addComponent(this.touching),this.addComponent(new CarriableComponent),this.graphics.use(Up.img.coin.toSprite()),this.collectable.isCollectable=!1}onInitialize(e){this.actions.runAction(new ParallelActions([new _a(this,__assignType$11(e=>e.delay(this.TIME_UNTIL_COLLECTABLE).callMethod(()=>{this.collectable.isCollectable=!0}),[`ctx`,``,`P"2!"/"`])),new _a(this,__assignType$11(e=>e.delay(this.LIFETIME).callMethod(()=>this.kill()),[`ctx`,``,`P"2!"/"`]))]))}onPreUpdate(e,R){this.elapsedMs+=R;let W=Math.floor(this.elapsedMs/50)%2==0;this.graphics.current&&(this.graphics.current.opacity=W?.35:.65)}onPreCollisionResolve(e,R,W,Y){if(R.owner instanceof vm&&!this.collectable.isCollectable)return Y.cancel();super.onPreCollisionResolve(e,R,W,Y)}onPostCollisionResolve(e,R,W,Y){W===st.Bottom||W===st.Top?this.vel.x=this.oldVel.x*(1-this.FRICTION):(W==st.Left||W==st.Right)&&(this.vel.y=this.oldVel.y*(1-this.FRICTION))}onCollisionStart(e,R,W,Y){R.owner instanceof vm?super.onCollisionStart(e,R,W,Y):W===st.Bottom||W===st.Top?this.vel.y=this.oldVel.y*-this.BOUNCE:(W==st.Left||W==st.Right)&&(this.vel.x=this.oldVel.x*-this.BOUNCE)}static __type=[()=>CoinItem,`touching`,function(){return new TouchingComponent},`LIFETIME`,function(){return 3e3},`TIME_UNTIL_COLLECTABLE`,function(){return 500},`BOUNCE`,function(){return 1},`FRICTION`,function(){return .1},`args`,`constructor`,`_engine`,`onInitialize`,`engine`,`elapsed`,`onPreUpdate`,`self`,`other`,`side`,`contact`,`onPreCollisionResolve`,`_contact`,`onPostCollisionResolve`,`onCollisionStart`,`LostCoin`,`P7!!3">#'3$>%'3&>''3(>)'3*>+P!2,"0-P!2.$0/P!20'21$02P!23!24!25!26$07P!23!24!25!28$09P!23!24!25!26$0:5w;`]};const hm=[`K`,`T`,`Record`,`l'e#"Rb!b"Pde"!N#!w#y`];var CoyoteComponent=class extends Component{actions;counter={};constructor(e){super(),this.actions=e}onAdd(e){e.on(`preupdate`,this.onPreUpdate.bind(this))}onPreUpdate(e){for(let R in this.actions){let W=this.actions[R];W.condition(e.elapsed)?this.counter[R]=W.time:this.counter[R]=Math.max(0,this.counter[R]-e.elapsed)}}allow(e){return this.counter[e]>0}reset(e){this.counter[e]=0}static __type=[`T`,()=>Component,`actions`,()=>hm,`counter`,function(){return{}},`constructor`,`owner`,`onAdd`,`ev`,`onPreUpdate`,`action`,`allow`,`reset`,`CoyoteComponent`,`b!P7"e!!3#e!!g'o$#3%>&Pe"!2#"0'P!2($0)P!2*"0+Pe"!g2,"0-Pe"!g2,"0.5w/`]},FakeDie=class extends _i{constructor(e){super({...e,collisionType:Ye.Active,z:9999}),this.body.useGravity=!1,this.acc.y=nm.y/2,this.graphics.use(new ci({text:`// TODO: die`,color:We.White,font:new si({size:10,family:`sans-serif`})})),this.vel.y=-300,this.vel.x=randomInRange(-100,100)}onPreUpdate(e,R){this.isOffScreen&&this.kill()}static __type=[()=>_i,`args`,`constructor`,`_engine`,`_elapsed`,`onPreUpdate`,`FakeDie`,`P7!P!2""0#P!2$'2%$0&5w'`]};const gm=[`T`,`args`,``,`ReturnType`,`l>e"!R"RPde#!P"@2"h"!/#qk#'QRb!Pde"!p)w$y`];function __assignType$10(e,R){return e.__type=R,e}__name(__assignType$10,`__assignType`);const _m=ir.fromImageSource({image:Up.img.player,grid:{columns:4,rows:7,spriteWidth:48,spriteHeight:48}});var vm=class Player extends PhysicsActor{JUMP_GRAVITY=nm.y*.5;APEX_GRAVITY=nm.y*.3;MAX_FALL_SPEED=270;WALL_SLIDE_SPEED=80;LADDER_CLIMB_SPEED=75;ACCELERATION=300;STOP_DECELERATION=this.ACCELERATION;GROUND_TURN_DECELERATION=this.ACCELERATION*4;AIR_TURN_DECELERATION=this.ACCELERATION*7;WALK_MAX_VELOCITY=90;RUN_MAX_VELOCITY=150;SPRINT_MAX_VELOCITY=210;SPRINT_TRIGGER_TIME=1e3;JUMP_FORCE=300;RUN_JUMP_FORCE=this.JUMP_FORCE*1.1;SPRINT_JUMP_FORCE=this.JUMP_FORCE*1.2;WALL_JUMP_X_DISTANCE=4;WALL_JUMP_DURATION=70;FX_SQUISH_AMOUNT=8/48;animation=new AnimationComponent({idle:Ht.fromSpriteSheet(_m,[0,1,2,3],140),run:Ht.fromSpriteSheet(_m,[4,5,6,7],140),sprint:Ht.fromSpriteSheet(_m,[8,9,10,11],140),jump:Ht.fromSpriteSheet(_m,[12],140),fall:Ht.fromSpriteSheet(_m,[13],140),turn:Ht.fromSpriteSheet(_m,[16],140),ladder_climb:Ht.fromSpriteSheet(_m,[20,21],140),wall_slide:Ht.fromSpriteSheet(_m,[16],100,zt.Loop)});controls=new PlayerControlsComponent;coyote=new CoyoteComponent({jump:{time:70,condition:()=>this.isOnGround}});isUsingJumpGravity=!1;facing=`right`;isClimbingLadder=!1;isSlidingOnWall=!1;isWallJumping=!1;get maxXVelocity(){switch(!0){case this.controls.isSprinting:return this.SPRINT_MAX_VELOCITY;case this.controls.isRunning:return this.RUN_MAX_VELOCITY;default:return this.WALK_MAX_VELOCITY}}get maxFallingVelocity(){switch(!0){case this.isSlidingOnWall:return this.WALL_SLIDE_SPEED;default:return this.MAX_FALL_SPEED}}get bouncepad(){for(let e of this.touching.bottom)if(e.hasTag(`bouncepad`))return e}get isTouchingLadder(){return this.touching.ladders.size>0}get isAboveLadder(){return this.raycastSide(`bottom`,1,{searchAllColliders:!0}).filter(__assignType$10(e=>e.body.owner?.has(ClimbableComponent),[`hit`,``,`P"2!"/"`])).length>0}get isXMovementAllowed(){let{isBeingKnockedBack:e}=this.get(dm);return!this.isClimbingLadder&&!this.bouncepad&&!this.isWallJumping&&!e}constructor(e){super({...e,name:`player`,anchor:new Oe(.5,1),width:16,height:16,collisionType:Ye.Active,collisionGroup:Kp.Player,collider:Ft.Box(12,12,vec(.5,1))}),this.body.useGravity=!1;let R=new dm;this.addComponent(this.animation),this.addComponent(this.controls),this.addComponent(this.coyote),this.addComponent(R),this.addComponent(new HealthComponent({amount:3})),R.events.on(`damage`,__assignType$10(({amount:e})=>{if(pm.coins===0)this.scene?.entities.find(__assignType$10(e=>e instanceof FakeDie,[`e`,``,`P"2!"/"`]))||this.scene?.add(new FakeDie({x:this.getGlobalPos().x,y:this.getGlobalPos().y}));else{let R=pm.coins-e<0?pm.coins:e;pm.coins-=R;for(let e=0;e<R;e++)this.scene?.add(new LostCoin({pos:vec(this.facing===`left`?this.collider.bounds.right:this.collider.bounds.left,this.collider.bounds.top),vel:vec(100*(this.facing===`right`?-1:1),-200)}))}},[`param0`,``,`P"2!"/"`])),this.animation.get(`turn`).events.on(`frame`,__assignType$10(e=>{e.frameIndex===0&&em.playSfx(Up.sfx.turnAround)},[`frame`,``,`P"2!"/"`])),this.animation.get(`sprint`).events.on(`frame`,__assignType$10(e=>{e.frameIndex%2==0&&this.spawnSmokePuffAtFeet(this.facing===`left`?`right`:`left`,vec(-2,0))},[`frame`,``,`P"2!"/"`])),this.animation.get(`turn`).events.on(`frame`,__assignType$10(e=>{this.spawnSmokePuffAtFeet(this.facing===`left`?`right`:`left`)},[`_frame`,``,`P"2!"/"`])),this.animation.get(`wall_slide`).events.on(`loop`,__assignType$10(e=>{this.spawnSmokePuffAtHands(this.facing,vec(randomIntInRange(-1,1),0))},[`_frame`,``,`P"2!"/"`])),this.addTag(`player`),globalThis.player=this}onInitialize(e){super.onInitialize(e),this.graphics.offset=new Oe(0,16),this.animation.set(`idle`)}onPreUpdate(e,R){this.isOnGround&&(this.isUsingJumpGravity=!1,this.isWallJumping=!1,this.isSlidingOnWall=!1),this.isTouchingLadder||(this.isClimbingLadder=!1),!this.isOnWall(`right`)&&!this.isOnWall(`left`)&&(this.isSlidingOnWall=!1),this.handleInput(e,R)}update(e,R){let W=!1;this.vel.y<0&&(this.isUsingJumpGravity=this.controls.isHeld(`Jump`)),this.isUsingJumpGravity&&this.vel.y>-10&&this.vel.y<10&&(W=!0),W?this.acc.setTo(0,this.APEX_GRAVITY):this.isUsingJumpGravity?this.acc.setTo(0,this.JUMP_GRAVITY):this.acc.setTo(0,nm.y),this.isClimbingLadder&&(this.acc.setTo(0,0),this.vel.setTo(0,0)),this.vel.y>=this.maxFallingVelocity&&(this.vel.y=this.maxFallingVelocity,this.acc.y=0),super.update(e,R)}onPostUpdate(e,R){let{isBeingKnockedBack:W}=this.get(dm);this.animation.speed=Math.min(1+(Math.abs(this.vel.x)/200)**2*3,3),this.handleAnimation(),!this.isWallJumping&&!W&&this.applyDeceleration()}onPreCollisionResolve(e,R,W,Y){super.onPreCollisionResolve(e,R,W,Y);let X=R.owner.has(StompableComponent)?R.owner.get(StompableComponent):void 0;X&&X&&!X.stomped&&X.isBeingStomped(this)&&(this.stomp(R.owner),Y.cancel())}onCollisionStart(e,R,W,Y){if(Y.isCanceled())return;let X=R.owner.get(Ti);if(X?.collisionType===Ye.Fixed||X?.collisionType===Ye.Active){let e=this.oldVel.y>0;W===st.Bottom&&e&&(R.owner instanceof Bouncepad&&(this.vel.x=0),this.land())}}handleInput(e,R){let W=this.controls.wasPressed(`Jump`),Y=this.controls.isHeld(`Jump`),X=this.controls.getHeldXDirection(),ie=this.controls.getHeldYDirection(),ae=this.isOnWall(`left`,4),le=this.isOnWall(`right`,4);if(X&&this.isXMovementAllowed){let e=X===`Left`?-1:1,R=this.ACCELERATION*e;if(this.facing=e===-1?`left`:`right`,this.acc.x+=R,!this.isOnGround&&this.vel.y>0){let e=this.isOnWall(`right`),R=this.isOnWall(`left`);e&&X===`Right`||R&&X===`Left`?this.isSlidingOnWall=!0:this.isSlidingOnWall=!1}}else this.isSlidingOnWall=!1;ie&&this.climbLadder(),W?this.isClimbingLadder?(this.isClimbingLadder=!1,ie!==`Down`&&this.jump()):this.isOnGround||this.coyote.allow(`jump`)?this.jump():(ae||le)&&this.wallJump(ae?`left`:`right`):!Y&&this.vel.y<0&&this.vel.y>-200&&!this.isClimbingLadder&&(this.vel.y*=.5,this.isUsingJumpGravity=!1)}handleAnimation(){let e=this.animation.current.currentFrameIndex,R=this.animation.current.currentFrameTimeLeft,W=this.controls.getHeldXDirection();if(this.graphics.flipHorizontal=this.facing===`left`,this.isSlidingOnWall)this.animation.is(`wall_slide`)||em.playSfx(Up.sfx.land),this.animation.set(`wall_slide`);else if(this.isClimbingLadder)this.animation.set(`ladder_climb`),this.vel.y===0&&this.animation.current.goToFrame(0);else if(this.isOnGround){if(this.controls.isTurning)this.animation.set(`turn`);else if(!W||W===`Left`&&this.vel.x<0||W===`Right`&&this.vel.x>0){if(this.controls.isSprinting&&Math.abs(this.vel.x)>this.RUN_MAX_VELOCITY){let W=this.animation.is(`run`);this.animation.set(`sprint`,W?e:0,W?R:0)}else if(this.vel.x!==0){let W=this.animation.is(`sprint`);this.animation.set(`run`,W?e:0,W?R:0)}}else this.animation.set(`idle`);Math.round(this.vel.x)===0&&this.animation.set(`idle`)}else this.vel.y!==0&&(this.vel.y<0?this.animation.set(`jump`):this.animation.set(`fall`));this.animation.is(`jump`)&&this.oldVel.y>=0&&this.vel.y<0&&coroutine(this.scene.engine,__assignType$10(function*(){let e=1+1*this.FX_SQUISH_AMOUNT,R=mi.EaseOutCubic,W=this.vel.y,Y=0;for(;this.vel.y<W*.25;)Y+=yield 1,Y<70&&this.squishGraphic(R(Math.min(Y,70),1,e,70));for(Y=0;!this.touching.bottom.size;)Y+=yield 1,Y<70&&this.squishGraphic(R(Math.min(Y,70),e,1,140));this.squishGraphic(1)},[()=>Player,`this`,()=>gm,``,`PP7!2"!o#"/$`]).bind(this))}land(){this.isOnGround=!0,em.playSfx(Up.sfx.land),this.spawnSmoke(`land`,{pos:vec(this.center.x,this.collider.bounds.bottom-8),scale:vec(.5,.5)});let e=1-this.FX_SQUISH_AMOUNT,R=mi.EaseOutCubic;coroutine(this.scene.engine,__assignType$10(function*(){let W=0;for(;W<70&&this.isOnGround;)W+=yield 1,this.squishGraphic(R(Math.min(W,70),1,e,70));for(this.squishGraphic(e),W=0;W<70&&this.isOnGround;)W+=yield 1,this.squishGraphic(R(Math.min(W,70),e,1,70));this.squishGraphic(1)},[()=>Player,`this`,()=>gm,``,`PP7!2"!o#"/$`]).bind(this))}climbLadder(){let e=this.controls.getHeldYDirection();if(this.isTouchingLadder){let R=Array.from(this.touching.ladders).sort(__assignType$10((e,R)=>Math.abs(this.collider.bounds.bottom-e.collider.bounds.bottom)-Math.abs(this.collider.bounds.bottom-R.collider.bounds.bottom),[`a`,`b`,``,`P"2!"2""/#`])).at(0),W=e===`Up`?-1:1,Y=Math.abs(this.pos.x-R.center.x)<8,X=__assignType$10(e=>Math.floor(Math.round(e)/16),[`n`,``,`P'2!"/"`]),ie=X(this.collider.bounds.bottom)===X(R.collider.bounds.bottom);e===`Up`&&!this.isClimbingLadder&&ie&&Y&&(this.isClimbingLadder=!0),this.isClimbingLadder&&(this.pos.x=R.center.x,this.vel.y=this.LADDER_CLIMB_SPEED*W,this.vel.x=0,this.isOnGround&&e===`Down`&&(this.isClimbingLadder=!1))}else this.isAboveLadder&&e===`Down`&&(this.isClimbingLadder=!0,this.pos.y=Math.ceil(this.pos.y)+1)}jump(e,R=!0){if(this.isOnGround=!1,this.coyote.reset(`jump`),this.bouncepad){this.bouncepad.release();return}e===void 0&&(e=this.JUMP_FORCE,this.controls.isSprinting?e=this.SPRINT_JUMP_FORCE:this.controls.isRunning&&(e=this.RUN_JUMP_FORCE)),this.vel.y=-e,R&&em.playSfx(Up.sfx.jump)}wallJump(e){this.isWallJumping||(this.jump(),this.isWallJumping=!0,this.spawnSmokePuffAtFeet(e,vec(0,-4)),coroutine(this.scene.engine,__assignType$10(function*(){let R=0,W=e===`left`?1:-1,Y=this.WALL_JUMP_X_DISTANCE/(this.WALL_JUMP_DURATION/1e3)*W;for(;R<this.WALL_JUMP_DURATION&&this.isWallJumping;)R+=yield 1,this.vel.x=Y;this.isWallJumping&&(this.controls.getHeldXDirection()||(this.vel.x=0)),this.isWallJumping=!1},[()=>Player,`this`,()=>gm,``,`PP7!2"!o#"/$`]).bind(this)))}stomp(e){let R=e.get(KillableComponent);if(R.dead)return;this.land(),R.kill(`stomp`),em.playSfx(Up.sfx.stomp);let W=this.controls.isSprinting?this.SPRINT_JUMP_FORCE:this.RUN_JUMP_FORCE;this.jump(W,!1)}isOnWall(e,R=1){return this.raycastSide(e,R,{filter:__assignType$10(e=>e.body.group===Kp.Ground,[`hit`,``,`P"2!"/"`])}).length>0}applyDeceleration(){let e=this.isOnGround,R=Math.abs(this.vel.x)>this.maxXVelocity;e?this.controls.isTurning?this.acc.x=-this.GROUND_TURN_DECELERATION*Math.sign(this.vel.x):(!this.controls.isMoving||R)&&this.vel.x!==0&&(this.acc.x=-this.STOP_DECELERATION*Math.sign(this.vel.x)):this.controls.isTurning?this.acc.x=-this.AIR_TURN_DECELERATION*Math.sign(this.vel.x):R&&(this.vel.x=clamp(this.vel.x,-this.maxXVelocity,this.maxXVelocity),this.acc.x=0),Math.sign(this.vel.x)!==0&&Math.sign(this.vel.x)!==Math.sign(this.acc.x)&&Math.abs(this.vel.x)<1&&(this.vel.x=0,this.acc.x=0)}squishGraphic(e){let R=e,W=2-R;this.graphics.current.scale=vec(W,R)}spawnSmoke(e,R){this.scene?.add(new Smoke({type:e,z:this.z+1,...R}))}spawnSmokePuffAtFeet(e,R=vec(0,0)){this.spawnSmoke(`puff`,{pos:vec(e===`left`?this.collider.bounds.left+R.x:this.collider.bounds.right-R.x,this.collider.bounds.bottom+R.y),scale:vec(.35,.35)})}spawnSmokePuffAtHands(e,R=vec(0,0)){this.spawnSmoke(`puff`,{pos:vec(e===`left`?this.collider.bounds.left+R.x:this.collider.bounds.right-R.x,this.center.y+R.y),scale:vec(.35,.35)})}static __type=[()=>PhysicsActor,`JUMP_GRAVITY`,function(){return nm.y*.5},`APEX_GRAVITY`,function(){return nm.y*.3},`MAX_FALL_SPEED`,function(){return 270},`WALL_SLIDE_SPEED`,function(){return 80},`LADDER_CLIMB_SPEED`,function(){return 75},`ACCELERATION`,function(){return 300},`STOP_DECELERATION`,function(){return this.ACCELERATION},`GROUND_TURN_DECELERATION`,function(){return this.ACCELERATION*4},`AIR_TURN_DECELERATION`,function(){return this.ACCELERATION*7},`WALK_MAX_VELOCITY`,function(){return 90},`RUN_MAX_VELOCITY`,function(){return 150},`SPRINT_MAX_VELOCITY`,function(){return 210},`SPRINT_TRIGGER_TIME`,function(){return 1e3},`JUMP_FORCE`,function(){return 300},`RUN_JUMP_FORCE`,function(){return this.JUMP_FORCE*1.1},`SPRINT_JUMP_FORCE`,function(){return this.JUMP_FORCE*1.2},`WALL_JUMP_X_DISTANCE`,function(){return 4},`WALL_JUMP_DURATION`,function(){return 70},`FX_SQUISH_AMOUNT`,function(){return 8/48},`animation`,function(){return new AnimationComponent({idle:Ht.fromSpriteSheet(_m,[0,1,2,3],140),run:Ht.fromSpriteSheet(_m,[4,5,6,7],140),sprint:Ht.fromSpriteSheet(_m,[8,9,10,11],140),jump:Ht.fromSpriteSheet(_m,[12],140),fall:Ht.fromSpriteSheet(_m,[13],140),turn:Ht.fromSpriteSheet(_m,[16],140),ladder_climb:Ht.fromSpriteSheet(_m,[20,21],140),wall_slide:Ht.fromSpriteSheet(_m,[16],100,zt.Loop)})},`controls`,function(){return new PlayerControlsComponent},`coyote`,function(){return new CoyoteComponent({jump:{time:70,condition:()=>this.isOnGround}})},`isUsingJumpGravity`,function(){return!1},`left`,`right`,`facing`,function(){return`right`},`isClimbingLadder`,function(){return!1},`isSlidingOnWall`,function(){return!1},`isWallJumping`,function(){return!1},`x`,`y`,`z`,`args`,`constructor`,`engine`,`onInitialize`,`elapsed`,`onPreUpdate`,`update`,`_engine`,`_elapsed`,`onPostUpdate`,`self`,`other`,`side`,`contact`,`onPreCollisionResolve`,`onCollisionStart`,`handleInput`,`handleAnimation`,`land`,`climbLadder`,`force`,`playSfx`,`jump`,`left`,`right`,`wallJump`,`stomp`,`left`,`right`,`distance`,`isOnWall`,`applyDeceleration`,`scale`,`squishGraphic`,`puff`,`land`,`type`,`pos`,`spawnSmoke`,`left`,`right`,`offset`,`spawnSmokePuffAtFeet`,`left`,`right`,`spawnSmokePuffAtHands`,`Player`,`P7!!3">#!3$>%'3&>''3(>)'3*>+'3,>-!3.>/!30>1!32>3'34>5'36>7'38>9'3:>;'3<>=!3>>?!3@>A'3B>C'3D>E!3F>G!3H>I!3J>K!3L>M)3N>OP.P.QJ3R>S)3T>U)3V>W)3X>Y!!!!!!PP'4Z'4['4\\8M2]"0^P!2_"0\`P!2_'2a$0bP!2_'2a$0cP!2d'2e$0fP!2g!2h!2i!2j$0kP!2g!2h!2i!2j$0lP!2d'2e"0mP"0nP"0oP"0pP'2q8"2r"0sPP.t.uJ2i"0vP!2h"0wPP.x.yJ2i"2z"0{P"0|P'2}"0~PP..J2P!4!4}8M2]"0PP..
J2i"2"0PP..J2i"2"05w`]},PlayerControlsComponent=class extends ControlsComponent{sprintTimer=0;onAdd(e){super.onAdd?.(e),e.on(`postupdate`,__assignType$10(({elapsed:e})=>{let R=this.owner.isOnGround,W=!R&&!this.isSprinting,Y=this.isTurning&&R;this.isRunning&&R&&!Y?this.sprintTimer=Math.min(this.sprintTimer+e,this.owner.SPRINT_TRIGGER_TIME):(!this.isRunning||Y||W)&&(this.sprintTimer=0)},[`param0`,``,`P"2!"/"`]))}get isMoving(){return this.getHeldXDirection()!==void 0}get isRunning(){return this.isMoving&&this.isHeld(`Run`)}get isSprinting(){return this.isRunning&&this.sprintTimer>=this.owner.SPRINT_TRIGGER_TIME}get isTurning(){let e=this.getHeldXDirection(),{isBeingKnockedBack:R}=this.owner.get(dm);return R?!1:e===`Left`&&this.owner.vel.x>0||e===`Right`&&this.owner.vel.x<0}static __type=[()=>ControlsComponent,()=>vm,`owner`,`sprintTimer`,function(){return 0},()=>vm,`onAdd`,`PlayerControlsComponent`,`P7!P7"3#'3$>%PP7&2#$0'!!!!5w(`]};function __assignType$9(e,R){return e.__type=R,e}__name(__assignType$9,`__assignType`);var ScrollingBackground=class extends nt{xSpeed;ySpeed;image;graphics=new fi;transform=new Xe;constructor(e){let{xSpeed:R=.25,ySpeed:W=.1,z:Y=-100,image:X}=e;super(),this.addComponent(this.graphics),this.addComponent(this.transform),this.image=X,this.xSpeed=R,this.ySpeed=W,this.graphics.anchor=vec(.5,.5),this.transform.pos=vec(0,0),this.transform.z=Y}onInitialize(e){let R=this.image.toSprite(),W=this.scene.camera.viewport.width,Y=this.scene.camera.viewport.height,X=Math.ceil(W/R.width)+1,ie=Math.ceil(Y/R.height)+1;this.graphics.use(new Ut({members:Array.from({length:X*ie}).map(__assignType$9((e,W)=>{let Y=W%X,ae=Math.floor(W/ie);return{graphic:R,offset:vec(R.width*Y,R.height*ae)}},[`_`,`i`,``,`P"2!"2""/#`]))})),this.on(`pretransformdraw`,()=>{let W=this.scene.camera,Y=W.drawPos.x-e.halfDrawWidth,X=W.drawPos.y-e.halfDrawHeight;this.transform.pos.x=Y,this.transform.pos.y=X;let ie=Y*-this.xSpeed%R.width+R.width,ae=X*-this.ySpeed%R.height+R.height;this.graphics.offset.setTo(ie,ae)})}static __type=[()=>nt,`xSpeed`,`ySpeed`,`image`,`graphics`,function(){return new fi},`transform`,function(){return new Xe},`z`,`args`,`constructor`,`_engine`,`onInitialize`,`ScrollingBackground`,`P7!'3"'3#!3$!3%>&!3'>(PP!4$'4"8'4#8'4)8M2*"0+P!2,$0-5w.`]};function __assignType$8(e,R){return e.__type=R,e}__name(__assignType$8,`__assignType`);var Tween=class{engine;value;_startValue=0;_targetValue=0;_easing;_duration=0;_elapsed=0;constructor(e,R,W){let{easing:Y=mi.Linear,duration:X=1e3}=W;this.engine=e,this.value=R,this._startValue=R,this._targetValue=R,this._easing=Y,this._duration=X,e.on(`preupdate`,this.onUpdate)}onUpdate=__assignType$8(e=>{this._elapsed<this._duration&&(this._elapsed=Math.min(this._duration,this._elapsed+e.elapsed),this.value=this._easing(this._elapsed,this._startValue,this._targetValue,this._duration))},[`ev`,``,`P!2!"/"`]);set(e,R=!1){this._elapsed=0,R?(this.value=e,this._startValue=e,this._targetValue=e):(this._startValue=this.value,this._targetValue=e)}destroy(){this.engine.off(`preupdate`,this.onUpdate)}static __type=[`engine`,`value`,`_startValue`,function(){return 0},`_targetValue`,function(){return 0},`_easing`,`_duration`,function(){return 0},`_elapsed`,function(){return 0},`easing`,`duration`,`opts`,`constructor`,`onUpdate`,function(){return __assignType$8(e=>{this._elapsed<this._duration&&(this._elapsed=Math.min(this._duration,this._elapsed+e.elapsed),this.value=this._easing(this._elapsed,this._startValue,this._targetValue,this._duration))},[`ev`,``,`P!2!"/"`])},`immediately`,`set`,`destroy`,`Tween`,`!3!'3"'3#;>$'3%;>&!3';'3(;>)'3*;>+P!2!'2"P!4,8'4-8M2."0/!30>1P'2""22"03P"045w5`]},LockToPlayerStrategy=class{FOLLOW_DAMPING=.5;TURN_TWEEN_DURATION=400;X_EDGE_BUFFER=20;Y_EDGE_BUFFER=40;target;xOffset;facing=`right`;isFirstUpdate=!0;constructor(e){this.target=e,this.xOffset=new Tween(this.target.scene.engine,0,{easing:mi.Linear,duration:this.TURN_TWEEN_DURATION}),this.turn(`right`,!0)}action(e,R,W,Y){let X=e.getGlobalPos(),ie=X.x-R.pos.x+this.xOffset.value,ae=X.y-R.pos.y,le=ie<-this.X_EDGE_BUFFER,_e=ie>this.X_EDGE_BUFFER,ye=ae<-this.Y_EDGE_BUFFER,be=ae>this.Y_EDGE_BUFFER,Ce=R.pos.x,Te=R.pos.y;if((le&&this.facing!==`left`||_e&&this.facing!==`right`)&&this.turn(le?`left`:`right`),le?Ce=X.x+this.X_EDGE_BUFFER+this.xOffset.value:_e&&(Ce=X.x-this.X_EDGE_BUFFER+this.xOffset.value),(ye||be)&&(Te=ye?X.y+this.Y_EDGE_BUFFER:X.y-this.Y_EDGE_BUFFER),this.isFirstUpdate)return this.isFirstUpdate=!1,vec(Ce,Te);if(le||_e){let e=Ce-R.pos.x,W=Te-R.pos.y;Math.abs(e)>.1&&(Ce-=e*this.FOLLOW_DAMPING),Math.abs(W)>.1&&(Te-=W*this.FOLLOW_DAMPING)}return vec(Ce,Te)}turn(e,R=!1){this.facing=e,e===`left`?this.xOffset.set(-this.X_EDGE_BUFFER*4,R):this.xOffset.set(this.X_EDGE_BUFFER*4,R)}static __type=[`FOLLOW_DAMPING`,function(){return .5},`TURN_TWEEN_DURATION`,function(){return 400},`X_EDGE_BUFFER`,function(){return 20},`Y_EDGE_BUFFER`,function(){return 40},`Player`,`target`,()=>Tween,`xOffset`,`left`,`right`,`facing`,function(){return`right`},`isFirstUpdate`,function(){return!0},`constructor`,`camera`,`_engine`,`_elapsed`,`action`,`left`,`right`,`direction`,`immediately`,`turn`,`LockToPlayerStrategy`,`'3!>"'3#>$'3%>&'3'>("w)3*P7+3,P.-..J3/>0)31;>2P"w)2*"03P"w)2*!24!25'26"07PP.8.9J2:"2;"0<5"x"w=`]},DamageComponent=class extends Component{amount;cancelContactOnDamage;constructor({amount:e,cancelContactOnDamage:R}){super(),this.amount=e,this.cancelContactOnDamage=R??!0}onAdd(e){e.on(`precollision`,this.onPreCollisionResolve.bind(this))}onPreCollisionResolve(e){let R=this.owner.get(KillableComponent),W=this.owner.get(StompableComponent),Y=R?.dead??!1,X=e.other.owner,ie=X.get(dm),ae=X instanceof PhysicsActor&&W?.isBeingStomped(X);ie&&(this.cancelContactOnDamage&&e.contact.cancel(),!Y&&!ae&&ie.damage(this.amount,X.center.x<this.owner.center.x?`left`:`right`))}static __type=[()=>Component,`owner`,`amount`,`cancelContactOnDamage`,`param0`,`constructor`,`onAdd`,`event`,`onPreCollisionResolve`,`DamageComponent`,`P7!!3"'3#)3$PP'4#)4$8M2%"0&P!2"$0'P!2("0)5w*`]};const ym=[`stompDuration`,`EnemyActorArgs`,`P!P'4!8MKw"y`];var bm=class EnemyActor extends PhysicsActor{killable;stompable;constructor({stompDuration:e,...R}){super({collisionType:Ye.Active,collisionGroup:Kp.Enemy,...R}),this.killable=new KillableComponent({stompDuration:e}),this.stompable=new StompableComponent,this.addComponent(new DamageComponent({amount:1})),this.addComponent(this.stompable),this.addComponent(this.killable),this.killable.events.on(`kill`,this.onKill.bind(this))}get dead(){return this.killable.dead}set dead(e){this.killable.dead=e}onPreCollisionResolve(e,R,W,Y){R.owner instanceof EnemyActor&&Y.cancel()}onKill(){}static __type=[()=>PhysicsActor,()=>KillableComponent,`killable`,()=>StompableComponent,`stompable`,()=>ym,`param0`,`constructor`,`self`,`other`,`side`,`contact`,`onPreCollisionResolve`,`onKill`,`EnemyActor`,`P7!P7"3#<P7$3%<Pn&2'"0(!P!2)!2*!2+!2,$0-P"0.5w/`]};const xm={rows:1,columns:3,spriteWidth:64,spriteHeight:48},Sm={green:{speed:20,spritesheet:ir.fromImageSource({image:Up.img.spiderGreen,grid:xm})},gray:{speed:30,spritesheet:ir.fromImageSource({image:Up.img.spiderGray,grid:xm})}},Cm=[()=>Sm,`type`,`SpiderEnemyArgs`,`P!Pi!g4"MKw#y`];var SpiderEnemy=class extends bm{spritesheet;speed;direction=`left`;constructor(e){super({...e,anchor:vec(.5,32/48),collider:Ft.Box(24,4,vec(.5,1))}),this.spritesheet=Sm[e.type].spritesheet,this.speed=Sm[e.type].speed,this.graphics.use(Ht.fromSpriteSheet(this.spritesheet,[0,1,2],2500/this.speed))}onPreUpdate(e,R){if(this.dead)return;let W=this.raycast(new Ray(vec(this.collider.bounds.left+1,Math.round(this.collider.bounds.bottom)-1),Oe.Down),1),Y=this.raycast(new Ray(vec(this.collider.bounds.right-1,Math.round(this.collider.bounds.bottom)-1),Oe.Down),1),X=this.direction===`left`&&W.length===0,ie=this.direction===`right`&&Y.length===0;(X||ie)&&(this.direction=this.direction===`left`?`right`:`left`),this.graphics.flipHorizontal=this.direction===`right`,this.direction===`left`?this.vel.x=-this.speed:this.vel.x=this.speed}onCollisionStart(e,R,W,Y){R.owner instanceof vm||R.owner instanceof _i&&R.owner.body.collisionType===Ye.Passive||(W===st.Left||W===st.Right)&&(this.direction=this.direction===`left`?`right`:`left`)}onKill(){this.graphics.current.pause(),this.vel.x=0,this.vel.y=0,this.body.useGravity=!1}static __type=[()=>bm,`spritesheet`,`speed`,`left`,`right`,`direction`,function(){return`left`},()=>Cm,`args`,`constructor`,`_engine`,`_elapsed`,`onPreUpdate`,`self`,`other`,`side`,`_contact`,`onCollisionStart`,`onKill`,`SpiderEnemy`,`P7!!3"'3#P.$.%J3&>'Pn(2)"0*P!2+'2,$0-P!2.!2/!20!21$02P"035w4`]};function __assignType$7(e,R){return e.__type=R,e}__name(__assignType$7,`__assignType`);const wm=Up.img.platform.toSprite(),Tm=new Xt({image:wm.image,destSize:{height:16,width:16},sourceView:{x:0,y:0,width:16,height:16}}),Em=new Xt({image:wm.image,destSize:{height:16,width:16},sourceView:{x:32,y:0,width:16,height:16}}),Dm=new Xt({image:wm.image,destSize:{height:16,width:16},sourceView:{x:16,y:0,width:16,height:16}}),Om=[`oneWay`,`MovingPlatformArgs`,`P!P)4!8MKw"y`];var MovingPlatform=class extends _i{constructor({oneWay:e=!0,...R},W){super({color:We.Green,anchor:vec(0,0),collisionType:Ye.Fixed,collisionGroup:Kp.Ground,...R});let Y=this.width-32;this.graphics.use(new Ut({members:[{graphic:Tm,offset:vec(0,0)},...Array.from({length:Y/16},__assignType$7((e,R)=>({graphic:Dm,offset:vec(16+R*16,0)}),[`_`,`i`,``,`P"2!"2""/#`])),{graphic:Em,offset:vec(this.width-16,0)}]})),W(this.actions),this.addComponent(new CarrierComponent),e&&this.addComponent(new OneWayCollisionComponent)}static __type=[()=>_i,()=>Om,`param0`,`actions`,``,`cb`,`constructor`,`MovingPlatform`,`P7!Pn"2#P!2$#/%2&"0'5w(`]};const km=[`x`,`y`,`pos`,`EnemyActor`,``,`spawn`,`EnemySpawnerArgs`,`P'4!'4"P!2#"w$/%4&Mw'y`];var EnemySpawner=class extends _i{OFFSCREEN_BUFFER=100;spawnedInstance=null;canSpawn=!0;spawn;constructor({x:e,y:R,spawn:W}){super({x:e,y:R}),this.spawn=W,this.on(`enterviewport`,()=>{this.spawnInstance()})}spawnInstance(){this.spawnedInstance||!this.canSpawn||(this.canSpawn=!1,this.spawnedInstance=this.spawn(this.pos),this.spawnedInstance.on(`kill`,()=>{this.spawnedInstance=null}),this.scene.engine.add(this.spawnedInstance))}onPreUpdate(e,R){let W=e.currentScene.camera.viewport,Y=this.OFFSCREEN_BUFFER,X=W.left-Y,ie=W.top-Y,ae=W.right+Y,le=W.bottom+Y,{x:_e,y:ye}=this.pos;if(_e<X||_e>ae||ye<ie||ye>le?this.spawnedInstance||(this.canSpawn=!0):this.spawnInstance(),this.spawnedInstance){let e=this.spawnedInstance.getGlobalPos();(e.x<X||e.x>ae||e.y<ie||e.y>le)&&(this.spawnedInstance.kill(),this.spawnedInstance=null)}}static __type=[()=>_i,`OFFSCREEN_BUFFER`,function(){return 100},`EnemyActor`,`spawnedInstance`,function(){return null},`canSpawn`,function(){return!0},`pos`,``,`spawn`,()=>km,`param0`,`constructor`,`spawnInstance`,`engine`,`_elapsed`,`onPreUpdate`,`EnemySpawner`,`P7!'3">#P"w$,J3%;>&)3';>(P!2)"w$/*3+Pn,2-"0.P"0/P!20'21$025w3`]};const Am={rows:1,columns:3,spriteWidth:48,spriteHeight:48},jm={purple:{speed:20,distance:60,spritesheet:ir.fromImageSource({image:Up.img.birdPurple,grid:Am})},orange:{speed:30,distance:100,spritesheet:ir.fromImageSource({image:Up.img.birdOrange,grid:Am})}},Mm=[()=>jm,`type`,`BirdEnemyArgs`,`P!Pi!g4"MKw#y`];var BirdEnemy=class extends bm{spritesheet;speed;distance;direction=`left`;elapsedMs=0;deathPosition=null;initialPos;constructor(e){super({...e,stompDuration:1500,anchor:vec(.5,.6),collider:Ft.Box(16,5,vec(.5,1)),collisionType:Ye.Passive}),this.spritesheet=jm[e.type].spritesheet,this.speed=jm[e.type].speed,this.distance=jm[e.type].distance,this.body.useGravity=!1,this.graphics.use(Ht.fromSpriteSheet(this.spritesheet,[0,1,2],3e3/this.speed)),this.initialPos=this.pos.clone(),this.canBeCarried=!1}onPreUpdate(e,R){this.elapsedMs+=R,this.dead&&this.deathPosition?(this.vel.y=10,this.pos.x+=Math.sin((this.pos.y-this.deathPosition.y)/2),this.rotation=-Math.sin((this.pos.x-this.deathPosition.x)/50)):(this.graphics.flipHorizontal=this.direction===`right`,this.direction===`left`?this.vel.x=-this.speed:this.vel.x=this.speed,this.pos.y+=Math.sin(this.elapsedMs/(this.speed*10)*Math.PI)*.3),this.pos.x<this.initialPos.x-this.distance?this.direction=`right`:this.pos.x>this.initialPos.x&&(this.direction=`left`)}onKill(){this.deathPosition=this.pos.clone(),this.graphics.current.pause(),this.vel.x=0,this.vel.y=0,this.body.useGravity=!1}static __type=[()=>bm,`spritesheet`,`speed`,`distance`,`left`,`right`,`direction`,function(){return`left`},`elapsedMs`,function(){return 0},`deathPosition`,function(){return null},`initialPos`,()=>Mm,`args`,`constructor`,`engine`,`elapsed`,`onPreUpdate`,`onKill`,`BirdEnemy`,`P7!!3"'3#'3$P.%.&J3'>('3);>*P!,J3+;>,!3-;Pn.2/"00P!21'22$03P"045w5`]},AxeHazard=class extends _i{elapsedMs=0;constructor(e){super({...e,anchor:vec(.5,0),width:12,height:48,rotation:0,collisionType:Ye.Passive,collisionGroup:Kp.Enemy,collider:Ft.Box(28,12,vec(.5,.5),vec(0,42))}),this.body.useGravity=!1,this.graphics.offset=vec(0,-8),this.graphics.use(Up.img.axe.toSprite()),this.addComponent(new DamageComponent({amount:1}))}onPreUpdate(e,R){this.elapsedMs+=R;let W=Math.PI/2,Y=this.elapsedMs/1e3;this.rotation=W*Math.cos(Math.sqrt(nm.y/600)*Y)}static __type=[()=>_i,`elapsedMs`,function(){return 0},`args`,`constructor`,`_engine`,`elapsed`,`onPreUpdate`,`AxeHazard`,`P7!'3";>#P!2$"0%P!2&'2'"0(5w)`]};function __assignType$6(e,R){return e.__type=R,e}__name(__assignType$6,`__assignType`);var CircularSawHazard=class extends PhysicsActor{direction=1;speed=25;bladeSize={width:24,height:12};lastGroundHit=null;constructor(e){super({...e,name:`circular-saw`,anchor:vec(.5,.5),width:4,height:4,collisionType:Ye.Passive,collisionGroup:Kp.Enemy}),this.pos.x+=this.width*this.anchor.x,this.pos.y-=this.height*this.anchor.y,this.body.useGravity=!1,this.graphics.use(Up.img.circularSaw.toSprite()),this.graphics.offset=vec(0,2);let R=new _i({pos:vec(0,0),anchor:vec(.5,1),width:this.bladeSize.width,height:this.bladeSize.height,collisionType:Ye.Passive,collisionGroup:Kp.Enemy});R.addComponent(new DamageComponent({amount:1})),this.addChild(R),this.addComponent(new CarriableComponent)}onInitialize(e){this.graphics.material=new RenderTopHalfMaterial(e.graphicsContext,this)}onPreUpdate(e,R){let W=this.direction===1?this.collider.bounds.right+this.bladeSize.width/2:this.collider.bounds.left-this.bladeSize.width/2,Y=this.collider.bounds.bottom-1,[X]=this.raycast(new Ray(vec(W,Y),Oe.Down),1,{collisionGroup:Kp.Ground}),[ie]=this.raycast(new Ray(vec(W,Y),this.direction===1?Oe.Right:Oe.Left),1,{collisionGroup:Kp.Ground});(!X&&this.lastGroundHit||ie)&&(this.direction*=-1);let ae=this.graphics.current;ae.rotation=(ae.rotation+toRadians(this.speed*5/R))%(Math.PI*2),this.vel.x=this.speed*this.direction,X&&(this.lastGroundHit=X)}static __type=[()=>PhysicsActor,`direction`,function(){return 1},`speed`,function(){return 25},`bladeSize`,function(){return{width:24,height:12}},`lastGroundHit`,function(){return null},`args`,`constructor`,`engine`,`onInitialize`,`_engine`,`elapsed`,`onPreUpdate`,`CircularSawHazard`,`P7!'3">#'3$>%!3&>'P!,J3(>)P!2*"0+P!2,$0-P!2.'2/"005w1`]},RenderTopHalfMaterial=class extends ti{constructor(e,R){super({name:`render-top-half-material`,fragmentSource:`#version 300 es
|
|
1099
|
+
`))}};const ou={major:4,minor:2,patch:1},su=N(`$ZodType`,((e,R)=>{var W;e??={},e._zod.def=R,e._zod.bag=e._zod.bag||{},e._zod.version=ou;let Y=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&Y.unshift(e);for(let R of Y)for(let W of R._zod.onattach)W(e);if(Y.length===0)(W=e._zod).deferred??(W.deferred=[]),e._zod.deferred?.push((()=>{e._zod.run=e._zod.parse}));else{let t=(e,R,W)=>{let Y,X=ce(e);for(let ie of R){if(ie._zod.def.when){if(!ie._zod.def.when(e))continue}else if(X)continue;let R=e.issues.length,ae=ie._zod.check(e);if(ae instanceof Promise&&!1===W?.async)throw new G;if(Y||ae instanceof Promise)Y=(Y??Promise.resolve()).then((async()=>{await ae,e.issues.length!==R&&(X||=ce(e,R))}));else{if(e.issues.length===R)continue;X||=ce(e,R)}}return Y?Y.then((()=>e)):e},A=(R,W,X)=>{if(ce(R))return R.aborted=!0,R;let ie=t(W,Y,X);if(ie instanceof Promise){if(!1===X.async)throw new G;return ie.then((R=>e._zod.parse(R,X)))}return e._zod.parse(ie,X)};e._zod.run=(R,W)=>{if(W.skipChecks)return e._zod.parse(R,W);if(W.direction===`backward`){let Y=e._zod.parse({value:R.value,issues:[]},{...W,skipChecks:!0});return Y instanceof Promise?Y.then((e=>A(e,R,W))):A(Y,R,W)}let X=e._zod.parse(R,W);if(X instanceof Promise){if(!1===W.async)throw new G;return X.then((e=>t(e,Y,W)))}return t(X,Y,W)}}e[`~standard`]={validate:R=>{try{let W=as(e,R);return W.success?{value:W.data}:{issues:W.error?.issues}}catch{return os(e,R).then((e=>e.success?{value:e.data}:{issues:e.error?.issues}))}},vendor:`zod`,version:1}})),cu=N(`$ZodString`,((e,R)=>{su.init(e,R),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Bt(e._zod.bag),e._zod.parse=(W,Y)=>{if(R.coerce)try{W.value=String(W.value)}catch{}return typeof W.value==`string`||W.issues.push({expected:`string`,code:`invalid_type`,input:W.value,inst:e}),W}})),lu=N(`$ZodStringFormat`,((e,R)=>{Yl.init(e,R),cu.init(e,R)})),uu=N(`$ZodGUID`,((e,R)=>{R.pattern??=hs,lu.init(e,R)})),du=N(`$ZodUUID`,((e,R)=>{if(R.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[R.version];if(e===void 0)throw Error(`Invalid UUID version: "${R.version}"`);R.pattern??=je(e)}else R.pattern??=je();lu.init(e,R)})),fu=N(`$ZodEmail`,((e,R)=>{R.pattern??=bs,lu.init(e,R)})),pu=N(`$ZodURL`,((e,R)=>{lu.init(e,R),e._zod.check=W=>{try{let Y=W.value.trim(),X=new URL(Y);R.hostname&&(R.hostname.lastIndex=0,R.hostname.test(X.hostname)||W.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:R.hostname.source,input:W.value,inst:e,continue:!R.abort})),R.protocol&&(R.protocol.lastIndex=0,R.protocol.test(X.protocol.endsWith(`:`)?X.protocol.slice(0,-1):X.protocol)||W.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:R.protocol.source,input:W.value,inst:e,continue:!R.abort})),R.normalize?W.value=X.href:W.value=Y;return}catch{W.issues.push({code:`invalid_format`,format:`url`,input:W.value,inst:e,continue:!R.abort})}}})),mu=N(`$ZodEmoji`,((e,R)=>{R.pattern??=At(),lu.init(e,R)})),hu=N(`$ZodNanoID`,((e,R)=>{R.pattern??=fs,lu.init(e,R)})),gu=N(`$ZodCUID`,((e,R)=>{R.pattern??=ss,lu.init(e,R)})),_u=N(`$ZodCUID2`,((e,R)=>{R.pattern??=cs,lu.init(e,R)})),vu=N(`$ZodULID`,((e,R)=>{R.pattern??=ls,lu.init(e,R)})),yu=N(`$ZodXID`,((e,R)=>{R.pattern??=us,lu.init(e,R)})),bu=N(`$ZodKSUID`,((e,R)=>{R.pattern??=ds,lu.init(e,R)})),xu=N(`$ZodISODateTime`,((e,R)=>{R.pattern??=ft(R),lu.init(e,R)})),Su=N(`$ZodISODate`,((e,R)=>{R.pattern??=$s,lu.init(e,R)})),Cu=N(`$ZodISOTime`,((e,R)=>{R.pattern??=pt(R),lu.init(e,R)})),wu=N(`$ZodISODuration`,((e,R)=>{R.pattern??=ps,lu.init(e,R)})),Tu=N(`$ZodIPv4`,((e,R)=>{R.pattern??=Ms,lu.init(e,R),e._zod.bag.format=`ipv4`})),Eu=N(`$ZodIPv6`,((e,R)=>{R.pattern??=Ns,lu.init(e,R),e._zod.bag.format=`ipv6`,e._zod.check=W=>{try{new URL(`http://[${W.value}]`)}catch{W.issues.push({code:`invalid_format`,format:`ipv6`,input:W.value,inst:e,continue:!R.abort})}}})),Du=N(`$ZodMAC`,((e,R)=>{R.pattern??=ot(R.delimiter),lu.init(e,R),e._zod.bag.format=`mac`})),Ou=N(`$ZodCIDRv4`,((e,R)=>{R.pattern??=Is,lu.init(e,R)})),ku=N(`$ZodCIDRv6`,((e,R)=>{R.pattern??=zs,lu.init(e,R),e._zod.check=W=>{let Y=W.value.split(`/`);try{if(Y.length!==2)throw Error();let[e,R]=Y;if(!R)throw Error();let W=Number(R);if(`${W}`!==R||W<0||W>128)throw Error();new URL(`http://[${e}]`)}catch{W.issues.push({code:`invalid_format`,format:`cidrv6`,input:W.value,inst:e,continue:!R.abort})}}}));function OA(e){if(e===``)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const Au=N(`$ZodBase64`,((e,R)=>{R.pattern??=Bs,lu.init(e,R),e._zod.bag.contentEncoding=`base64`,e._zod.check=W=>{OA(W.value)||W.issues.push({code:`invalid_format`,format:`base64`,input:W.value,inst:e,continue:!R.abort})}})),ju=N(`$ZodBase64URL`,((e,R)=>{R.pattern??=Hs,lu.init(e,R),e._zod.bag.contentEncoding=`base64url`,e._zod.check=W=>{(function(e){if(!Hs.test(e))return!1;let R=e.replace(/[-_]/g,(e=>e===`-`?`+`:`/`));return OA(R.padEnd(4*Math.ceil(R.length/4),`=`))})(W.value)||W.issues.push({code:`invalid_format`,format:`base64url`,input:W.value,inst:e,continue:!R.abort})}})),Mu=N(`$ZodE164`,((e,R)=>{R.pattern??=Xs,lu.init(e,R)})),Nu=N(`$ZodJWT`,((e,R)=>{lu.init(e,R),e._zod.check=W=>{(function(e,R=null){try{let W=e.split(`.`);if(W.length!==3)return!1;let[Y]=W;if(!Y)return!1;let X=JSON.parse(atob(Y));return!(`typ`in X&&X?.typ!==`JWT`||!X.alg||R&&(!(`alg`in X)||X.alg!==R))}catch{return!1}})(W.value,R.alg)||W.issues.push({code:`invalid_format`,format:`jwt`,input:W.value,inst:e,continue:!R.abort})}})),Pu=N(`$ZodCustomStringFormat`,((e,R)=>{lu.init(e,R),e._zod.check=W=>{R.fn(W.value)||W.issues.push({code:`invalid_format`,format:R.format,input:W.value,inst:e,continue:!R.abort})}})),Fu=N(`$ZodNumber`,((e,R)=>{su.init(e,R),e._zod.pattern=e._zod.bag.pattern??nc,e._zod.parse=(W,Y)=>{if(R.coerce)try{W.value=Number(W.value)}catch{}let X=W.value;if(typeof X==`number`&&!Number.isNaN(X)&&Number.isFinite(X))return W;let ie=typeof X==`number`?Number.isNaN(X)?`NaN`:Number.isFinite(X)?void 0:`Infinity`:void 0;return W.issues.push({expected:`number`,code:`invalid_type`,input:X,inst:e,...ie?{received:ie}:{}}),W}})),Iu=N(`$ZodNumberFormat`,((e,R)=>{Ll.init(e,R),Fu.init(e,R)})),Lu=N(`$ZodBoolean`,((e,R)=>{su.init(e,R),e._zod.pattern=sc,e._zod.parse=(W,Y)=>{if(R.coerce)try{W.value=!!W.value}catch{}let X=W.value;return typeof X==`boolean`||W.issues.push({expected:`boolean`,code:`invalid_type`,input:X,inst:e}),W}})),Ru=N(`$ZodBigInt`,((e,R)=>{su.init(e,R),e._zod.pattern=ec,e._zod.parse=(W,Y)=>{if(R.coerce)try{W.value=BigInt(W.value)}catch{}return typeof W.value==`bigint`||W.issues.push({expected:`bigint`,code:`invalid_type`,input:W.value,inst:e}),W}})),zu=N(`$ZodBigIntFormat`,((e,R)=>{Rl.init(e,R),Ru.init(e,R)})),Bu=N(`$ZodSymbol`,((e,R)=>{su.init(e,R),e._zod.parse=(R,W)=>{let Y=R.value;return typeof Y==`symbol`||R.issues.push({expected:`symbol`,code:`invalid_type`,input:Y,inst:e}),R}})),Vu=N(`$ZodUndefined`,((e,R)=>{su.init(e,R),e._zod.pattern=hc,e._zod.values=new Set([void 0]),e._zod.optin=`optional`,e._zod.optout=`optional`,e._zod.parse=(R,W)=>{let Y=R.value;return Y===void 0||R.issues.push({expected:`undefined`,code:`invalid_type`,input:Y,inst:e}),R}})),Hu=N(`$ZodNull`,((e,R)=>{su.init(e,R),e._zod.pattern=uc,e._zod.values=new Set([null]),e._zod.parse=(R,W)=>{let Y=R.value;return Y===null||R.issues.push({expected:`null`,code:`invalid_type`,input:Y,inst:e}),R}})),Uu=N(`$ZodAny`,((e,R)=>{su.init(e,R),e._zod.parse=e=>e})),Wu=N(`$ZodUnknown`,((e,R)=>{su.init(e,R),e._zod.parse=e=>e})),Gu=N(`$ZodNever`,((e,R)=>{su.init(e,R),e._zod.parse=(R,W)=>(R.issues.push({expected:`never`,code:`invalid_type`,input:R.value,inst:e}),R)})),Ku=N(`$ZodVoid`,((e,R)=>{su.init(e,R),e._zod.parse=(R,W)=>{let Y=R.value;return Y===void 0||R.issues.push({expected:`void`,code:`invalid_type`,input:Y,inst:e}),R}})),qu=N(`$ZodDate`,((e,R)=>{su.init(e,R),e._zod.parse=(W,Y)=>{if(R.coerce)try{W.value=new Date(W.value)}catch{}let X=W.value,ie=X instanceof Date;return ie&&!Number.isNaN(X.getTime())||W.issues.push({expected:`date`,code:`invalid_type`,input:X,...ie?{received:`Invalid Date`}:{},inst:e}),W}}));function oi(e,R,W){e.issues.length&&R.issues.push(...ge(W,e.issues)),R.value[W]=e.value}const Ju=N(`$ZodArray`,((e,R)=>{su.init(e,R),e._zod.parse=(W,Y)=>{let X=W.value;if(!Array.isArray(X))return W.issues.push({expected:`array`,code:`invalid_type`,input:X,inst:e}),W;W.value=Array(X.length);let ie=[];for(let e=0;e<X.length;e++){let ae=X[e],le=R.element._zod.run({value:ae,issues:[]},Y);le instanceof Promise?ie.push(le.then((R=>oi(R,W,e)))):oi(le,W,e)}return ie.length?Promise.all(ie).then((()=>W)):W}}));function ri(e,R,W,Y){e.issues.length&&R.issues.push(...ge(W,e.issues)),e.value===void 0?W in Y&&(R.value[W]=void 0):R.value[W]=e.value}function ai(e){let R=Object.keys(e.shape);for(let W of R)if(!e.shape?.[W]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${W}": expected a Zod schema`);let W=(Y=e.shape,Object.keys(Y).filter((e=>Y[e]._zod.optin===`optional`&&Y[e]._zod.optout===`optional`)));var Y;return{...e,keys:R,keySet:new Set(R),numKeys:R.length,optionalKeys:new Set(W)}}function li(e,R,W,Y,X,ie){let ae=[],le=X.keySet,_e=X.catchall._zod,ye=_e.def.type;for(let X in R){if(le.has(X))continue;if(ye===`never`){ae.push(X);continue}let ie=_e.run({value:R[X],issues:[]},Y);ie instanceof Promise?e.push(ie.then((e=>ri(e,W,X,R)))):ri(ie,W,X,R)}return ae.length&&W.issues.push({code:`unrecognized_keys`,keys:ae,input:R,inst:ie}),e.length?Promise.all(e).then((()=>W)):W}const Yu=N(`$ZodObject`,((e,R)=>{if(su.init(e,R),!Object.getOwnPropertyDescriptor(R,`shape`)?.get){let e=R.shape;Object.defineProperty(R,"shape",{get:()=>{let W={...e};return Object.defineProperty(R,"shape",{value:W}),W}})}let W=Z((()=>ai(R)));H(e._zod,`propValues`,(()=>{let e=R.shape,W={};for(let R in e){let Y=e[R]._zod;if(Y.values){W[R]??(W[R]=new Set);for(let e of Y.values)W[R].add(e)}}return W}));let Y=V,X=R.catchall,ie;e._zod.parse=(R,ae)=>{ie??=W.value;let le=R.value;if(!Y(le))return R.issues.push({expected:`object`,code:`invalid_type`,input:le,inst:e}),R;R.value={};let _e=[],ye=ie.shape;for(let e of ie.keys){let W=ye[e]._zod.run({value:le[e],issues:[]},ae);W instanceof Promise?_e.push(W.then((W=>ri(W,R,e,le)))):ri(W,R,e,le)}return X?li(_e,le,R,ae,W.value,e):_e.length?Promise.all(_e).then((()=>R)):R}})),Xu=N(`$ZodObjectJIT`,((e,R)=>{Yu.init(e,R);let W=e._zod.parse,Y=Z((()=>ai(R))),X,ie=V,ae=!Ba.jitless,le=ae&&Ka.value,_e=R.catchall,ye;e._zod.parse=(be,Ce)=>{ye??=Y.value;let Te=be.value;return ie(Te)?ae&&le&&!1===Ce?.async&&!0!==Ce.jitless?(X||=(e=>{let R=new IA([`shape`,`payload`,`ctx`]),W=Y.value,n=e=>{let R=K(e);return`shape[${R}]._zod.run({ value: input[${R}], issues: [] }, ctx)`};R.write(`const input = payload.value;`);let X=Object.create(null),ie=0;for(let e of W.keys)X[e]=`key_`+ ie++;R.write(`const newResult = {};`);for(let e of W.keys){let W=X[e],Y=K(e);R.write(`const ${W} = ${n(e)};`),R.write(`\n if (${W}.issues.length) {\n payload.issues = payload.issues.concat(${W}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${Y}, ...iss.path] : [${Y}]\n })));\n }\n \n \n if (${W}.value === undefined) {\n if (${Y} in input) {\n newResult[${Y}] = undefined;\n }\n } else {\n newResult[${Y}] = ${W}.value;\n }\n \n `)}R.write(`payload.value = newResult;`),R.write(`return payload;`);let ae=R.compile();return(R,W)=>ae(e,R,W)})(R.shape),be=X(be,Ce),_e?li([],Te,be,Ce,ye,e):be):W(be,Ce):(be.issues.push({expected:`object`,code:`invalid_type`,input:Te,inst:e}),be)}}));function di(e,R,W,Y){for(let W of e)if(W.issues.length===0)return R.value=W.value,R;let X=e.filter((e=>!ce(e)));return X.length===1?(R.value=X[0].value,X[0]):(R.issues.push({code:`invalid_union`,input:R.value,inst:W,errors:e.map((e=>e.issues.map((e=>he(e,Y,M())))))}),R)}const Zu=N(`$ZodUnion`,((e,R)=>{su.init(e,R),H(e._zod,`optin`,(()=>R.options.some((e=>e._zod.optin===`optional`))?`optional`:void 0)),H(e._zod,`optout`,(()=>R.options.some((e=>e._zod.optout===`optional`))?`optional`:void 0)),H(e._zod,`values`,(()=>{if(R.options.every((e=>e._zod.values)))return new Set(R.options.flatMap((e=>Array.from(e._zod.values))))})),H(e._zod,`pattern`,(()=>{if(R.options.every((e=>e._zod.pattern))){let e=R.options.map((e=>e._zod.pattern));return RegExp(`^(${e.map((e=>j(e.source))).join(`|`)})$`)}}));let W=R.options.length===1,Y=R.options[0]._zod.run;e._zod.parse=(X,ie)=>{if(W)return Y(X,ie);let ae=!1,le=[];for(let e of R.options){let R=e._zod.run({value:X.value,issues:[]},ie);if(R instanceof Promise)le.push(R),ae=!0;else{if(R.issues.length===0)return R;le.push(R)}}return ae?Promise.all(le).then((R=>di(R,X,e,ie))):di(le,X,e,ie)}}));function ui(e,R,W,Y){let X=e.filter((e=>e.issues.length===0));return X.length===1?(R.value=X[0].value,R):(X.length===0?R.issues.push({code:`invalid_union`,input:R.value,inst:W,errors:e.map((e=>e.issues.map((e=>he(e,Y,M())))))}):R.issues.push({code:`invalid_union`,input:R.value,inst:W,errors:[],inclusive:!1}),R)}const Qu=N(`$ZodXor`,((e,R)=>{Zu.init(e,R),R.inclusive=!1;let W=R.options.length===1,Y=R.options[0]._zod.run;e._zod.parse=(X,ie)=>{if(W)return Y(X,ie);let ae=!1,le=[];for(let e of R.options){let R=e._zod.run({value:X.value,issues:[]},ie);R instanceof Promise?(le.push(R),ae=!0):le.push(R)}return ae?Promise.all(le).then((R=>ui(R,X,e,ie))):ui(le,X,e,ie)}})),$u=N(`$ZodDiscriminatedUnion`,((e,R)=>{R.inclusive=!1,Zu.init(e,R);let W=e._zod.parse;H(e._zod,`propValues`,(()=>{let e={};for(let W of R.options){let Y=W._zod.propValues;if(!Y||Object.keys(Y).length===0)throw Error(`Invalid discriminated union option at index "${R.options.indexOf(W)}"`);for(let[R,W]of Object.entries(Y)){e[R]||(e[R]=new Set);for(let Y of W)e[R].add(Y)}}return e}));let Y=Z((()=>{let e=R.options,W=new Map;for(let Y of e){let e=Y._zod.propValues?.[R.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${R.options.indexOf(Y)}"`);for(let R of e){if(W.has(R))throw Error(`Duplicate discriminator value "${String(R)}"`);W.set(R,Y)}}return W}));e._zod.parse=(X,ie)=>{let ae=X.value;if(!V(ae))return X.issues.push({code:`invalid_type`,expected:`object`,input:ae,inst:e}),X;let le=Y.value.get(ae?.[R.discriminator]);return le?le._zod.run(X,ie):R.unionFallback?W(X,ie):(X.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:R.discriminator,input:ae,path:[R.discriminator],inst:e}),X)}})),ed=N(`$ZodIntersection`,((e,R)=>{su.init(e,R),e._zod.parse=(e,W)=>{let Y=e.value,X=R.left._zod.run({value:Y,issues:[]},W),ie=R.right._zod.run({value:Y,issues:[]},W);return X instanceof Promise||ie instanceof Promise?Promise.all([X,ie]).then((([R,W])=>Ci(e,R,W))):Ci(e,X,ie)}}));function Bi(e,R){if(e===R||e instanceof Date&&R instanceof Date&&+e==+R)return{valid:!0,data:e};if(ee(e)&&ee(R)){let W=Object.keys(R),Y=Object.keys(e).filter((e=>W.indexOf(e)!==-1)),X={...e,...R};for(let W of Y){let Y=Bi(e[W],R[W]);if(!Y.valid)return{valid:!1,mergeErrorPath:[W,...Y.mergeErrorPath]};X[W]=Y.data}return{valid:!0,data:X}}if(Array.isArray(e)&&Array.isArray(R)){if(e.length!==R.length)return{valid:!1,mergeErrorPath:[]};let W=[];for(let Y=0;Y<e.length;Y++){let X=Bi(e[Y],R[Y]);if(!X.valid)return{valid:!1,mergeErrorPath:[Y,...X.mergeErrorPath]};W.push(X.data)}return{valid:!0,data:W}}return{valid:!1,mergeErrorPath:[]}}function Ci(e,R,W){if(R.issues.length&&e.issues.push(...R.issues),W.issues.length&&e.issues.push(...W.issues),ce(e))return e;let Y=Bi(R.value,W.value);if(!Y.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(Y.mergeErrorPath)}`);return e.value=Y.data,e}const td=N(`$ZodTuple`,((e,R)=>{su.init(e,R);let W=R.items;e._zod.parse=(Y,X)=>{let ie=Y.value;if(!Array.isArray(ie))return Y.issues.push({input:ie,inst:e,expected:`tuple`,code:`invalid_type`}),Y;Y.value=[];let ae=[],le=[...W].reverse().findIndex((e=>e._zod.optin!==`optional`)),_e=le===-1?0:W.length-le;if(!R.rest){let R=ie.length>W.length,X=ie.length<_e-1;if(R||X)return Y.issues.push({...R?{code:`too_big`,maximum:W.length}:{code:`too_small`,minimum:W.length},input:ie,inst:e,origin:`array`}),Y}let ye=-1;for(let e of W){if(ye++,ye>=ie.length&&ye>=_e)continue;let R=e._zod.run({value:ie[ye],issues:[]},X);R instanceof Promise?ae.push(R.then((e=>Qi(e,Y,ye)))):Qi(R,Y,ye)}if(R.rest){let e=ie.slice(W.length);for(let W of e){ye++;let e=R.rest._zod.run({value:W,issues:[]},X);e instanceof Promise?ae.push(e.then((e=>Qi(e,Y,ye)))):Qi(e,Y,ye)}}return ae.length?Promise.all(ae).then((()=>Y)):Y}}));function Qi(e,R,W){e.issues.length&&R.issues.push(...ge(W,e.issues)),R.value[W]=e.value}const nd=N(`$ZodRecord`,((e,R)=>{su.init(e,R),e._zod.parse=(W,Y)=>{let X=W.value;if(!ee(X))return W.issues.push({expected:`record`,code:`invalid_type`,input:X,inst:e}),W;let ie=[],ae=R.keyType._zod.values;if(ae){W.value={};let le=new Set;for(let e of ae)if(typeof e==`string`||typeof e==`number`||typeof e==`symbol`){le.add(typeof e==`number`?e.toString():e);let ae=R.valueType._zod.run({value:X[e],issues:[]},Y);ae instanceof Promise?ie.push(ae.then((R=>{R.issues.length&&W.issues.push(...ge(e,R.issues)),W.value[e]=R.value}))):(ae.issues.length&&W.issues.push(...ge(e,ae.issues)),W.value[e]=ae.value)}let _e;for(let e in X)le.has(e)||(_e??=[],_e.push(e));_e&&_e.length>0&&W.issues.push({code:`unrecognized_keys`,input:X,inst:e,keys:_e})}else{W.value={};for(let ae of Reflect.ownKeys(X)){if(ae===`__proto__`)continue;let le=R.keyType._zod.run({value:ae,issues:[]},Y);if(le instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(le.issues.length){R.mode===`loose`?W.value[ae]=X[ae]:W.issues.push({code:`invalid_key`,origin:`record`,issues:le.issues.map((e=>he(e,Y,M()))),input:ae,path:[ae],inst:e});continue}let _e=R.valueType._zod.run({value:X[ae],issues:[]},Y);_e instanceof Promise?ie.push(_e.then((e=>{e.issues.length&&W.issues.push(...ge(ae,e.issues)),W.value[le.value]=e.value}))):(_e.issues.length&&W.issues.push(...ge(ae,_e.issues)),W.value[le.value]=_e.value)}}return ie.length?Promise.all(ie).then((()=>W)):W}})),rd=N(`$ZodMap`,((e,R)=>{su.init(e,R),e._zod.parse=(W,Y)=>{let X=W.value;if(!(X instanceof Map))return W.issues.push({expected:`map`,code:`invalid_type`,input:X,inst:e}),W;let ie=[];W.value=new Map;for(let[ae,le]of X){let _e=R.keyType._zod.run({value:ae,issues:[]},Y),ye=R.valueType._zod.run({value:le,issues:[]},Y);_e instanceof Promise||ye instanceof Promise?ie.push(Promise.all([_e,ye]).then((([R,ie])=>{wi(R,ie,W,ae,X,e,Y)}))):wi(_e,ye,W,ae,X,e,Y)}return ie.length?Promise.all(ie).then((()=>W)):W}}));function wi(e,R,W,Y,X,ie,ae){e.issues.length&&(qa.has(typeof Y)?W.issues.push(...ge(Y,e.issues)):W.issues.push({code:`invalid_key`,origin:`map`,input:X,inst:ie,issues:e.issues.map((e=>he(e,ae,M())))})),R.issues.length&&(qa.has(typeof Y)?W.issues.push(...ge(Y,R.issues)):W.issues.push({origin:`map`,code:`invalid_element`,input:X,inst:ie,key:Y,issues:R.issues.map((e=>he(e,ae,M())))})),W.value.set(e.value,R.value)}const id=N(`$ZodSet`,((e,R)=>{su.init(e,R),e._zod.parse=(W,Y)=>{let X=W.value;if(!(X instanceof Set))return W.issues.push({input:X,inst:e,expected:`set`,code:`invalid_type`}),W;let ie=[];W.value=new Set;for(let e of X){let X=R.valueType._zod.run({value:e,issues:[]},Y);X instanceof Promise?ie.push(X.then((e=>vi(e,W)))):vi(X,W)}return ie.length?Promise.all(ie).then((()=>W)):W}}));function vi(e,R){e.issues.length&&R.issues.push(...e.issues),R.value.add(e.value)}const ad=N(`$ZodEnum`,((e,R)=>{su.init(e,R);let W=O(R.entries),Y=new Set(W);e._zod.values=Y,e._zod.pattern=RegExp(`^(${W.filter((e=>qa.has(typeof e))).map((e=>typeof e==`string`?ne(e):e.toString())).join(`|`)})$`),e._zod.parse=(R,X)=>{let ie=R.value;return Y.has(ie)||R.issues.push({code:`invalid_value`,values:W,input:ie,inst:e}),R}})),od=N(`$ZodLiteral`,((e,R)=>{if(su.init(e,R),R.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let W=new Set(R.values);e._zod.values=W,e._zod.pattern=RegExp(`^(${R.values.map((e=>typeof e==`string`?ne(e):e?ne(e.toString()):String(e))).join(`|`)})$`),e._zod.parse=(Y,X)=>{let ie=Y.value;return W.has(ie)||Y.issues.push({code:`invalid_value`,values:R.values,input:ie,inst:e}),Y}})),sd=N(`$ZodFile`,((e,R)=>{su.init(e,R),e._zod.parse=(R,W)=>{let Y=R.value;return Y instanceof File||R.issues.push({expected:`file`,code:`invalid_type`,input:Y,inst:e}),R}})),cd=N(`$ZodTransform`,((e,R)=>{su.init(e,R),e._zod.parse=(W,Y)=>{if(Y.direction===`backward`)throw new T(e.constructor.name);let X=R.transform(W.value,W);if(Y.async)return(X instanceof Promise?X:Promise.resolve(X)).then((e=>(W.value=e,W)));if(X instanceof Promise)throw new G;return W.value=X,W}}));function xi(e,R){return e.issues.length&&R===void 0?{issues:[],value:void 0}:e}const ld=N(`$ZodOptional`,((e,R)=>{su.init(e,R),e._zod.optin=`optional`,e._zod.optout=`optional`,H(e._zod,`values`,(()=>R.innerType._zod.values?new Set([...R.innerType._zod.values,void 0]):void 0)),H(e._zod,`pattern`,(()=>{let e=R.innerType._zod.pattern;return e?RegExp(`^(${j(e.source)})?$`):void 0})),e._zod.parse=(e,W)=>{if(R.innerType._zod.optin===`optional`){let Y=R.innerType._zod.run(e,W);return Y instanceof Promise?Y.then((R=>xi(R,e.value))):xi(Y,e.value)}return e.value===void 0?e:R.innerType._zod.run(e,W)}})),ud=N(`$ZodNullable`,((e,R)=>{su.init(e,R),H(e._zod,`optin`,(()=>R.innerType._zod.optin)),H(e._zod,`optout`,(()=>R.innerType._zod.optout)),H(e._zod,`pattern`,(()=>{let e=R.innerType._zod.pattern;return e?RegExp(`^(${j(e.source)}|null)$`):void 0})),H(e._zod,`values`,(()=>R.innerType._zod.values?new Set([...R.innerType._zod.values,null]):void 0)),e._zod.parse=(e,W)=>e.value===null?e:R.innerType._zod.run(e,W)})),dd=N(`$ZodDefault`,((e,R)=>{su.init(e,R),e._zod.optin=`optional`,H(e._zod,`values`,(()=>R.innerType._zod.values)),e._zod.parse=(e,W)=>{if(W.direction===`backward`)return R.innerType._zod.run(e,W);if(e.value===void 0)return e.value=R.defaultValue,e;let Y=R.innerType._zod.run(e,W);return Y instanceof Promise?Y.then((e=>Ni(e,R))):Ni(Y,R)}}));function Ni(e,R){return e.value===void 0&&(e.value=R.defaultValue),e}const fd=N(`$ZodPrefault`,((e,R)=>{su.init(e,R),e._zod.optin=`optional`,H(e._zod,`values`,(()=>R.innerType._zod.values)),e._zod.parse=(e,W)=>(W.direction===`backward`||e.value===void 0&&(e.value=R.defaultValue),R.innerType._zod.run(e,W))})),pd=N(`$ZodNonOptional`,((e,R)=>{su.init(e,R),H(e._zod,`values`,(()=>{let e=R.innerType._zod.values;return e?new Set([...e].filter((e=>e!==void 0))):void 0})),e._zod.parse=(W,Y)=>{let X=R.innerType._zod.run(W,Y);return X instanceof Promise?X.then((R=>Ri(R,e))):Ri(X,e)}}));function Ri(e,R){return e.issues.length||e.value!==void 0||e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:R}),e}const md=N(`$ZodSuccess`,((e,R)=>{su.init(e,R),e._zod.parse=(e,W)=>{if(W.direction===`backward`)throw new T(`ZodSuccess`);let Y=R.innerType._zod.run(e,W);return Y instanceof Promise?Y.then((R=>(e.value=R.issues.length===0,e))):(e.value=Y.issues.length===0,e)}})),hd=N(`$ZodCatch`,((e,R)=>{su.init(e,R),H(e._zod,`optin`,(()=>R.innerType._zod.optin)),H(e._zod,`optout`,(()=>R.innerType._zod.optout)),H(e._zod,`values`,(()=>R.innerType._zod.values)),e._zod.parse=(e,W)=>{if(W.direction===`backward`)return R.innerType._zod.run(e,W);let Y=R.innerType._zod.run(e,W);return Y instanceof Promise?Y.then((Y=>(e.value=Y.value,Y.issues.length&&(e.value=R.catchValue({...e,error:{issues:Y.issues.map((e=>he(e,W,M())))},input:e.value}),e.issues=[]),e))):(e.value=Y.value,Y.issues.length&&(e.value=R.catchValue({...e,error:{issues:Y.issues.map((e=>he(e,W,M())))},input:e.value}),e.issues=[]),e)}})),gd=N(`$ZodNaN`,((e,R)=>{su.init(e,R),e._zod.parse=(R,W)=>(typeof R.value==`number`&&Number.isNaN(R.value)||R.issues.push({input:R.value,inst:e,expected:`nan`,code:`invalid_type`}),R)})),_d=N(`$ZodPipe`,((e,R)=>{su.init(e,R),H(e._zod,`values`,(()=>R.in._zod.values)),H(e._zod,`optin`,(()=>R.in._zod.optin)),H(e._zod,`optout`,(()=>R.out._zod.optout)),H(e._zod,`propValues`,(()=>R.in._zod.propValues)),e._zod.parse=(e,W)=>{if(W.direction===`backward`){let Y=R.out._zod.run(e,W);return Y instanceof Promise?Y.then((e=>Zi(e,R.in,W))):Zi(Y,R.in,W)}let Y=R.in._zod.run(e,W);return Y instanceof Promise?Y.then((e=>Zi(e,R.out,W))):Zi(Y,R.out,W)}}));function Zi(e,R,W){return e.issues.length?(e.aborted=!0,e):R._zod.run({value:e.value,issues:e.issues},W)}const vd=N(`$ZodCodec`,((e,R)=>{su.init(e,R),H(e._zod,`values`,(()=>R.in._zod.values)),H(e._zod,`optin`,(()=>R.in._zod.optin)),H(e._zod,`optout`,(()=>R.out._zod.optout)),H(e._zod,`propValues`,(()=>R.in._zod.propValues)),e._zod.parse=(e,W)=>{if((W.direction||`forward`)===`forward`){let Y=R.in._zod.run(e,W);return Y instanceof Promise?Y.then((e=>ji(e,R,W))):ji(Y,R,W)}{let Y=R.out._zod.run(e,W);return Y instanceof Promise?Y.then((e=>ji(e,R,W))):ji(Y,R,W)}}}));function ji(e,R,W){if(e.issues.length)return e.aborted=!0,e;if((W.direction||`forward`)===`forward`){let Y=R.transform(e.value,e);return Y instanceof Promise?Y.then((Y=>Yi(e,Y,R.out,W))):Yi(e,Y,R.out,W)}{let Y=R.reverseTransform(e.value,e);return Y instanceof Promise?Y.then((Y=>Yi(e,Y,R.in,W))):Yi(e,Y,R.in,W)}}function Yi(e,R,W,Y){return e.issues.length?(e.aborted=!0,e):W._zod.run({value:R,issues:e.issues},Y)}const yd=N(`$ZodReadonly`,((e,R)=>{su.init(e,R),H(e._zod,`propValues`,(()=>R.innerType._zod.propValues)),H(e._zod,`values`,(()=>R.innerType._zod.values)),H(e._zod,`optin`,(()=>R.innerType?._zod?.optin)),H(e._zod,`optout`,(()=>R.innerType?._zod?.optout)),e._zod.parse=(e,W)=>{if(W.direction===`backward`)return R.innerType._zod.run(e,W);let Y=R.innerType._zod.run(e,W);return Y instanceof Promise?Y.then(Pi):Pi(Y)}}));function Pi(e){return e.value=Object.freeze(e.value),e}const bd=N(`$ZodTemplateLiteral`,((e,R)=>{su.init(e,R);let W=[];for(let e of R.parts)if(typeof e==`object`&&e){if(!e._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...e._zod.traits].shift()}`);let R=e._zod.pattern instanceof RegExp?e._zod.pattern.source:e._zod.pattern;if(!R)throw Error(`Invalid template literal part: ${e._zod.traits}`);let Y=+!!R.startsWith(`^`),X=R.endsWith(`$`)?R.length-1:R.length;W.push(R.slice(Y,X))}else{if(e!==null&&!Ja.has(typeof e))throw Error(`Invalid template literal part: ${e}`);W.push(ne(`${e}`))}e._zod.pattern=RegExp(`^${W.join(``)}$`),e._zod.parse=(W,Y)=>typeof W.value==`string`?(e._zod.pattern.lastIndex=0,e._zod.pattern.test(W.value)||W.issues.push({input:W.value,inst:e,code:`invalid_format`,format:R.format??`template_literal`,pattern:e._zod.pattern.source}),W):(W.issues.push({input:W.value,inst:e,expected:`template_literal`,code:`invalid_type`}),W)})),xd=N(`$ZodFunction`,((e,R)=>(su.init(e,R),e._def=R,e._zod.def=R,e.implement=R=>{if(typeof R!=`function`)throw Error(`implement() must be called with a function`);return function(...W){let Y=e._def.input?es(e._def.input,W):W,X=Reflect.apply(R,this,Y);return e._def.output?es(e._def.output,X):X}},e.implementAsync=R=>{if(typeof R!=`function`)throw Error(`implementAsync() must be called with a function`);return async function(...W){let Y=e._def.input?await rs(e._def.input,W):W,X=await Reflect.apply(R,this,Y);return e._def.output?await rs(e._def.output,X):X}},e._zod.parse=(R,W)=>typeof R.value==`function`?(R.value=e._def.output&&e._def.output._zod.def.type===`promise`?e.implementAsync(R.value):e.implement(R.value),R):(R.issues.push({code:`invalid_type`,expected:`function`,input:R.value,inst:e}),R),e.input=(...R)=>{let W=e.constructor;return Array.isArray(R[0])?new W({type:`function`,input:new td({type:`tuple`,items:R[0],rest:R[1]}),output:e._def.output}):new W({type:`function`,input:R[0],output:e._def.output})},e.output=R=>new e.constructor({type:`function`,input:e._def.input,output:R}),e))),Sd=N(`$ZodPromise`,((e,R)=>{su.init(e,R),e._zod.parse=(e,W)=>Promise.resolve(e.value).then((e=>R.innerType._zod.run({value:e,issues:[]},W)))})),Cd=N(`$ZodLazy`,((e,R)=>{su.init(e,R),H(e._zod,`innerType`,(()=>R.getter())),H(e._zod,`pattern`,(()=>e._zod.innerType?._zod?.pattern)),H(e._zod,`propValues`,(()=>e._zod.innerType?._zod?.propValues)),H(e._zod,`optin`,(()=>e._zod.innerType?._zod?.optin??void 0)),H(e._zod,`optout`,(()=>e._zod.innerType?._zod?.optout??void 0)),e._zod.parse=(R,W)=>e._zod.innerType._zod.run(R,W)})),wd=N(`$ZodCustom`,((e,R)=>{Al.init(e,R),su.init(e,R),e._zod.parse=(e,R)=>e,e._zod.check=W=>{let Y=W.value,X=R.fn(Y);if(X instanceof Promise)return X.then((R=>en(R,W,Y,e)));en(X,W,Y,e)}}));function en(e,R,W,Y){if(!e){let e={code:`custom`,input:W,inst:Y,path:[...Y._zod.def.path??[]],continue:!Y._zod.def.abort};Y._zod.def.params&&(e.params=Y._zod.def.params),R.issues.push(pe(e))}}const tn=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`}};function t(R){return e[R]??null}let R={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,jwt:`JWT`,template_literal:`input`};return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${e.expected}, received ${(e=>{let R=typeof e;switch(R){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return R})(e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${re(e.values[0])}`:`Invalid option: expected one of ${U(e.values,`|`)}`;case`too_big`:{let R=e.inclusive?`<=`:`<`,W=t(e.origin);return W?`Too big: expected ${e.origin??`value`} to have ${R}${e.maximum.toString()} ${W.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${R}${e.maximum.toString()}`}case`too_small`:{let R=e.inclusive?`>=`:`>`,W=t(e.origin);return W?`Too small: expected ${e.origin} to have ${R}${e.minimum.toString()} ${W.unit}`:`Too small: expected ${e.origin} to be ${R}${e.minimum.toString()}`}case`invalid_format`:{let W=e;return W.format===`starts_with`?`Invalid string: must start with "${W.prefix}"`:W.format===`ends_with`?`Invalid string: must end with "${W.suffix}"`:W.format===`includes`?`Invalid string: must include "${W.includes}"`:W.format===`regex`?`Invalid string: must match pattern ${W.pattern}`:`Invalid ${R[W.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${U(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:default:return`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`}}};var Td,nn=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...R){let W=R[0];if(this._map.set(e,W),W&&typeof W==`object`&&`id`in W){if(this._idmap.has(W.id))throw Error(`ID ${W.id} already exists in the registry`);this._idmap.set(W.id,e)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let R=this._map.get(e);return R&&typeof R==`object`&&`id`in R&&this._idmap.delete(R.id),this._map.delete(e),this}get(e){let R=e._zod.parent;if(R){let W={...this.get(R)??{}};delete W.id;let Y={...W,...this._map.get(e)};return Object.keys(Y).length?Y:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};(Td=globalThis).__zod_globalRegistry??(Td.__zod_globalRegistry=new nn);const Ed=globalThis.__zod_globalRegistry;function sn(e,R){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...se(R)})}function rn(e,R){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...se(R)})}function an(e,R){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...se(R)})}function ln(e,R){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...se(R)})}function cn(e,R){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...se(R)})}function gn(e,R){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...se(R)})}function dn(e,R){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...se(R)})}function hn(e,R){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...se(R)})}function un(e,R){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...se(R)})}function In(e,R){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...se(R)})}function pn(e,R){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...se(R)})}function fn(e,R){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...se(R)})}function Bn(e,R){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...se(R)})}function Cn(e,R){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...se(R)})}function En(e,R){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...se(R)})}function Qn(e,R){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...se(R)})}function mn(e,R){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...se(R)})}function yn(e,R){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...se(R)})}function wn(e,R){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...se(R)})}function _n(e,R){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...se(R)})}function vn(e,R){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...se(R)})}function bn(e,R){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...se(R)})}function kn(e,R){return new Ml({check:`less_than`,...se(R),value:e,inclusive:!1})}function Dn(e,R){return new Ml({check:`less_than`,...se(R),value:e,inclusive:!0})}function Sn(e,R){return new Nl({check:`greater_than`,...se(R),value:e,inclusive:!1})}function xn(e,R){return new Nl({check:`greater_than`,...se(R),value:e,inclusive:!0})}function zn(e){return Sn(0,e)}function Fn(e){return kn(0,e)}function Ln(e){return Dn(0,e)}function Nn(e){return xn(0,e)}function Gn(e,R){return new Fl({check:`multiple_of`,...se(R),value:e})}function Tn(e,R){return new zl({check:`max_size`,...se(R),maximum:e})}function Rn(e,R){return new Bl({check:`min_size`,...se(R),minimum:e})}function Mn(e,R){return new Vl({check:`size_equals`,...se(R),size:e})}function On(e,R){return new Gl({check:`max_length`,...se(R),maximum:e})}function Un(e,R){return new ql({check:`min_length`,...se(R),minimum:e})}function Jn(e,R){return new Jl({check:`length_equals`,...se(R),length:e})}function Zn(e,R){return new Xl({check:`string_format`,format:`regex`,...se(R),pattern:e})}function qn(e){return new Zl({check:`string_format`,format:`lowercase`,...se(e)})}function jn(e){return new Ql({check:`string_format`,format:`uppercase`,...se(e)})}function Yn(e,R){return new eu({check:`string_format`,format:`includes`,...se(R),includes:e})}function Hn(e,R){return new tu({check:`string_format`,format:`starts_with`,...se(R),prefix:e})}function Pn(e,R){return new nu({check:`string_format`,format:`ends_with`,...se(R),suffix:e})}function $n(e,R,W){return new ru({check:`property`,property:e,schema:R,...se(W)})}function Kn(e,R){return new iu({check:`mime_type`,mime:e,...se(R)})}function Wn(e){return new au({check:`overwrite`,tx:e})}function Vn(e){return Wn((R=>R.normalize(e)))}function Xn(){return Wn((e=>e.trim()))}function eo(){return Wn((e=>e.toLowerCase()))}function to(){return Wn((e=>e.toUpperCase()))}function Ao(){return Wn((e=>function(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}(e)))}function io(e){let R=function(e,R){let W=new Al({check:`custom`,...se(R)});return W._zod.check=e,W}((W=>(W.addIssue=e=>{if(typeof e==`string`)W.issues.push(pe(e,W.value,R._zod.def));else{let Y=e;Y.fatal&&(Y.continue=!1),Y.code??=`custom`,Y.input??=W.value,Y.inst??=R,Y.continue??=!R._zod.def.abort,W.issues.push(pe(Y))}},e(W.value,W))));return R}function no(e,R,W,Y={}){let X=se(Y),ie={...se(Y),check:`string_format`,type:`string`,format:R,fn:typeof W==`function`?W:e=>W.test(e),...X};return W instanceof RegExp&&(ie.pattern=W),new e(ie)}function oo(e){let R=e?.target??`draft-2020-12`;return R===`draft-4`&&(R=`draft-04`),R===`draft-7`&&(R=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??Ed,target:R,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function so(e,R,W={path:[],schemaPath:[]}){var Y;let X=e._zod.def,ie=R.seen.get(e);if(ie)return ie.count++,W.schemaPath.includes(e)&&(ie.cycle=W.path),ie.schema;let ae={schema:{},count:1,cycle:void 0,path:W.path};R.seen.set(e,ae);let le=e._zod.toJSONSchema?.();if(le)ae.schema=le;else{let Y={...W,schemaPath:[...W.schemaPath,e],path:W.path},ie=e._zod.parent;if(ie)ae.ref=ie,so(ie,R,Y),R.seen.get(ie).isParent=!0;else if(e._zod.processJSONSchema)e._zod.processJSONSchema(R,ae.schema,Y);else{let W=ae.schema,ie=R.processors[X.type];if(!ie)throw Error(`[toJSONSchema]: Non-representable type encountered: ${X.type}`);ie(e,R,W,Y)}}let _e=R.metadataRegistry.get(e);return _e&&Object.assign(ae.schema,_e),R.io===`input`&&lo(e)&&(delete ae.schema.examples,delete ae.schema.default),R.io===`input`&&ae.schema._prefault&&((Y=ae.schema).default??(Y.default=ae.schema._prefault)),delete ae.schema._prefault,R.seen.get(e).schema}function ro(e,R){let W=e.seen.get(R);if(!W)throw Error(`Unprocessed schema. This is a bug in Zod.`);let i=R=>{if(R[1].schema.$ref)return;let Y=R[1],{ref:X,defId:ie}=(R=>{let Y=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let W=e.external.registry.get(R[0])?.id,X=e.external.uri??(e=>e);if(W)return{ref:X(W)};let ie=R[1].defId??R[1].schema.id??`schema`+ e.counter++;return R[1].defId=ie,{defId:ie,ref:`${X(`__shared`)}#/${Y}/${ie}`}}if(R[1]===W)return{ref:`#`};let X=`#/${Y}/`,ie=R[1].schema.id??`__schema`+ e.counter++;return{defId:ie,ref:X+ie}})(R);Y.def={...Y.schema},ie&&(Y.defId=ie);let ae=Y.schema;for(let e in ae)delete ae[e];ae.$ref=X};if(e.cycles===`throw`)for(let R of e.seen.entries()){let e=R[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>\n\nSet the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let W of e.seen.entries()){let Y=W[1];if(R===W[0]){i(W);continue}if(e.external){let Y=e.external.registry.get(W[0])?.id;if(R!==W[0]&&Y){i(W);continue}}(e.metadataRegistry.get(W[0])?.id||Y.cycle||Y.count>1&&e.reused===`ref`)&&i(W)}}function ao(e,R){let W=e.seen.get(R);if(!W)throw Error(`Unprocessed schema. This is a bug in Zod.`);let i=R=>{let W=e.seen.get(R),Y=W.def??W.schema,X={...Y};if(W.ref===null)return;let ie=W.ref;if(W.ref=null,ie){i(ie);let R=e.seen.get(ie).schema;!R.$ref||e.target!==`draft-07`&&e.target!==`draft-04`&&e.target!==`openapi-3.0`?(Object.assign(Y,R),Object.assign(Y,X)):(Y.allOf=Y.allOf??[],Y.allOf.push(R))}W.isParent||e.override({zodSchema:R,jsonSchema:Y,path:W.path??[]})};for(let R of[...e.seen.entries()].reverse())i(R[0]);let Y={};if(e.target===`draft-2020-12`?Y.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?Y.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?Y.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let W=e.external.registry.get(R)?.id;if(!W)throw Error("Schema is missing an `id` property");Y.$id=e.external.uri(W)}Object.assign(Y,W.def??W.schema);let X=e.external?.defs??{};for(let R of e.seen.entries()){let e=R[1];e.def&&e.defId&&(X[e.defId]=e.def)}e.external||Object.keys(X).length>0&&(e.target===`draft-2020-12`?Y.$defs=X:Y.definitions=X);try{let e=JSON.parse(JSON.stringify(Y));return Object.defineProperty(e,"~standard",{value:{...R[`~standard`],jsonSchema:{input:co(R,`input`),output:co(R,`output`)}},enumerable:!1,writable:!1}),e}catch{throw Error(`Error converting schema to JSON.`)}}function lo(e,R){let W=R??{seen:new Set};if(W.seen.has(e))return!1;W.seen.add(e);let Y=e._zod.def;if(Y.type===`transform`)return!0;if(Y.type===`array`)return lo(Y.element,W);if(Y.type===`set`)return lo(Y.valueType,W);if(Y.type===`lazy`)return lo(Y.getter(),W);if(Y.type===`promise`||Y.type===`optional`||Y.type===`nonoptional`||Y.type===`nullable`||Y.type===`readonly`||Y.type==="default"||Y.type===`prefault`)return lo(Y.innerType,W);if(Y.type===`intersection`)return lo(Y.left,W)||lo(Y.right,W);if(Y.type===`record`||Y.type===`map`)return lo(Y.keyType,W)||lo(Y.valueType,W);if(Y.type===`pipe`)return lo(Y.in,W)||lo(Y.out,W);if(Y.type===`object`){for(let e in Y.shape)if(lo(Y.shape[e],W))return!0;return!1}if(Y.type===`union`){for(let e of Y.options)if(lo(e,W))return!0;return!1}if(Y.type===`tuple`){for(let e of Y.items)if(lo(e,W))return!0;return!(!Y.rest||!lo(Y.rest,W))}return!1}const co=(e,R)=>W=>{let{libraryOptions:Y,target:X}=W??{},ie=oo({...Y??{},target:X,io:R,processors:{}});return so(e,ie),ro(ie,e),ao(ie,e)},Dd={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},ho=(e,R,W,Y)=>{let X=W;X.type=`string`;let{minimum:ie,maximum:ae,format:le,patterns:_e,contentEncoding:ye}=e._zod.bag;if(typeof ie==`number`&&(X.minLength=ie),typeof ae==`number`&&(X.maxLength=ae),le&&(X.format=Dd[le]??le,X.format===``&&delete X.format),ye&&(X.contentEncoding=ye),_e&&_e.size>0){let e=[..._e];e.length===1?X.pattern=e[0].source:e.length>1&&(X.allOf=[...e.map((e=>({...R.target===`draft-07`||R.target===`draft-04`||R.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source})))])}},uo=(e,R,W,Y)=>{let X=W,{minimum:ie,maximum:ae,format:le,multipleOf:_e,exclusiveMaximum:ye,exclusiveMinimum:be}=e._zod.bag;typeof le==`string`&&le.includes(`int`)?X.type=`integer`:X.type=`number`,typeof be==`number`&&(R.target===`draft-04`||R.target===`openapi-3.0`?(X.minimum=be,X.exclusiveMinimum=!0):X.exclusiveMinimum=be),typeof ie==`number`&&(X.minimum=ie,typeof be==`number`&&R.target!==`draft-04`&&(be>=ie?delete X.minimum:delete X.exclusiveMinimum)),typeof ye==`number`&&(R.target===`draft-04`||R.target===`openapi-3.0`?(X.maximum=ye,X.exclusiveMaximum=!0):X.exclusiveMaximum=ye),typeof ae==`number`&&(X.maximum=ae,typeof ye==`number`&&R.target!==`draft-04`&&(ye<=ae?delete X.maximum:delete X.exclusiveMaximum)),typeof _e==`number`&&(X.multipleOf=_e)},Io=(e,R,W,Y)=>{W.type=`boolean`},po=(e,R,W,Y)=>{if(R.unrepresentable===`throw`)throw Error(`BigInt cannot be represented in JSON Schema`)},fo=(e,R,W,Y)=>{if(R.unrepresentable===`throw`)throw Error(`Symbols cannot be represented in JSON Schema`)},Bo=(e,R,W,Y)=>{R.target===`openapi-3.0`?(W.type=`string`,W.nullable=!0,W.enum=[null]):W.type=`null`},Co=(e,R,W,Y)=>{if(R.unrepresentable===`throw`)throw Error(`Undefined cannot be represented in JSON Schema`)},Eo=(e,R,W,Y)=>{if(R.unrepresentable===`throw`)throw Error(`Void cannot be represented in JSON Schema`)},Qo=(e,R,W,Y)=>{W.not={}},mo=(e,R,W,Y)=>{if(R.unrepresentable===`throw`)throw Error(`Date cannot be represented in JSON Schema`)},yo=(e,R,W,Y)=>{let X=O(e._zod.def.entries);X.every((e=>typeof e==`number`))&&(W.type=`number`),X.every((e=>typeof e==`string`))&&(W.type=`string`),W.enum=X},wo=(e,R,W,Y)=>{let X=e._zod.def,ie=[];for(let e of X.values)if(e===void 0){if(R.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(R.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);ie.push(Number(e))}else ie.push(e);if(ie.length!==0)if(ie.length===1){let e=ie[0];W.type=e===null?`null`:typeof e,R.target===`draft-04`||R.target===`openapi-3.0`?W.enum=[e]:W.const=e}else ie.every((e=>typeof e==`number`))&&(W.type=`number`),ie.every((e=>typeof e==`string`))&&(W.type=`string`),ie.every((e=>typeof e==`boolean`))&&(W.type=`boolean`),ie.every((e=>e===null))&&(W.type=`null`),W.enum=ie},_o=(e,R,W,Y)=>{if(R.unrepresentable===`throw`)throw Error(`NaN cannot be represented in JSON Schema`)},vo=(e,R,W,Y)=>{let X=W,ie=e._zod.pattern;if(!ie)throw Error(`Pattern not found in template literal`);X.type=`string`,X.pattern=ie.source},bo=(e,R,W,Y)=>{let X=W,ie={type:`string`,format:`binary`,contentEncoding:`binary`},{minimum:ae,maximum:le,mime:_e}=e._zod.bag;ae!==void 0&&(ie.minLength=ae),le!==void 0&&(ie.maxLength=le),_e?_e.length===1?(ie.contentMediaType=_e[0],Object.assign(X,ie)):X.anyOf=_e.map((e=>({...ie,contentMediaType:e}))):Object.assign(X,ie)},ko=(e,R,W,Y)=>{W.type=`boolean`},Do=(e,R,W,Y)=>{if(R.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},So=(e,R,W,Y)=>{if(R.unrepresentable===`throw`)throw Error(`Function types cannot be represented in JSON Schema`)},xo=(e,R,W,Y)=>{if(R.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},zo=(e,R,W,Y)=>{if(R.unrepresentable===`throw`)throw Error(`Map cannot be represented in JSON Schema`)},Fo=(e,R,W,Y)=>{if(R.unrepresentable===`throw`)throw Error(`Set cannot be represented in JSON Schema`)},Lo=(e,R,W,Y)=>{let X=W,ie=e._zod.def,{minimum:ae,maximum:le}=e._zod.bag;typeof ae==`number`&&(X.minItems=ae),typeof le==`number`&&(X.maxItems=le),X.type=`array`,X.items=so(ie.element,R,{...Y,path:[...Y.path,`items`]})},No=(e,R,W,Y)=>{let X=W,ie=e._zod.def;X.type=`object`,X.properties={};let ae=ie.shape;for(let e in ae)X.properties[e]=so(ae[e],R,{...Y,path:[...Y.path,`properties`,e]});let le=new Set(Object.keys(ae)),_e=new Set([...le].filter((e=>{let W=ie.shape[e]._zod;return R.io===`input`?W.optin===void 0:W.optout===void 0})));_e.size>0&&(X.required=Array.from(_e)),ie.catchall?._zod.def.type===`never`?X.additionalProperties=!1:ie.catchall?ie.catchall&&(X.additionalProperties=so(ie.catchall,R,{...Y,path:[...Y.path,`additionalProperties`]})):R.io===`output`&&(X.additionalProperties=!1)},Go=(e,R,W,Y)=>{let X=e._zod.def,ie=!1===X.inclusive,ae=X.options.map(((e,W)=>so(e,R,{...Y,path:[...Y.path,ie?`oneOf`:`anyOf`,W]})));ie?W.oneOf=ae:W.anyOf=ae},To=(e,R,W,Y)=>{let X=e._zod.def,ie=so(X.left,R,{...Y,path:[...Y.path,`allOf`,0]}),ae=so(X.right,R,{...Y,path:[...Y.path,`allOf`,1]}),r=e=>`allOf`in e&&Object.keys(e).length===1;W.allOf=[...r(ie)?ie.allOf:[ie],...r(ae)?ae.allOf:[ae]]},Ro=(e,R,W,Y)=>{let X=W,ie=e._zod.def;X.type=`array`;let ae=R.target===`draft-2020-12`?`prefixItems`:`items`,le=R.target===`draft-2020-12`||R.target===`openapi-3.0`?`items`:`additionalItems`,_e=ie.items.map(((e,W)=>so(e,R,{...Y,path:[...Y.path,ae,W]}))),ye=ie.rest?so(ie.rest,R,{...Y,path:[...Y.path,le,...R.target===`openapi-3.0`?[ie.items.length]:[]]}):null;R.target===`draft-2020-12`?(X.prefixItems=_e,ye&&(X.items=ye)):R.target===`openapi-3.0`?(X.items={anyOf:_e},ye&&X.items.anyOf.push(ye),X.minItems=_e.length,ye||(X.maxItems=_e.length)):(X.items=_e,ye&&(X.additionalItems=ye));let{minimum:be,maximum:Ce}=e._zod.bag;typeof be==`number`&&(X.minItems=be),typeof Ce==`number`&&(X.maxItems=Ce)},Mo=(e,R,W,Y)=>{let X=W,ie=e._zod.def;X.type=`object`,R.target!==`draft-07`&&R.target!==`draft-2020-12`||(X.propertyNames=so(ie.keyType,R,{...Y,path:[...Y.path,`propertyNames`]})),X.additionalProperties=so(ie.valueType,R,{...Y,path:[...Y.path,`additionalProperties`]})},Oo=(e,R,W,Y)=>{let X=e._zod.def,ie=so(X.innerType,R,Y),ae=R.seen.get(e);R.target===`openapi-3.0`?(ae.ref=X.innerType,W.nullable=!0):W.anyOf=[ie,{type:`null`}]},Uo=(e,R,W,Y)=>{let X=e._zod.def;so(X.innerType,R,Y),R.seen.get(e).ref=X.innerType},Jo=(e,R,W,Y)=>{let X=e._zod.def;so(X.innerType,R,Y),R.seen.get(e).ref=X.innerType,W.default=JSON.parse(JSON.stringify(X.defaultValue))},Zo=(e,R,W,Y)=>{let X=e._zod.def;so(X.innerType,R,Y),R.seen.get(e).ref=X.innerType,R.io===`input`&&(W._prefault=JSON.parse(JSON.stringify(X.defaultValue)))},qo=(e,R,W,Y)=>{let X=e._zod.def;so(X.innerType,R,Y);let ie;R.seen.get(e).ref=X.innerType;try{ie=X.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}W.default=ie},jo=(e,R,W,Y)=>{let X=e._zod.def,ie=R.io===`input`?X.in._zod.def.type===`transform`?X.out:X.in:X.out;so(ie,R,Y),R.seen.get(e).ref=ie},Yo=(e,R,W,Y)=>{let X=e._zod.def;so(X.innerType,R,Y),R.seen.get(e).ref=X.innerType,W.readOnly=!0},Ho=(e,R,W,Y)=>{let X=e._zod.def;so(X.innerType,R,Y),R.seen.get(e).ref=X.innerType},Po=(e,R,W,Y)=>{let X=e._zod.def;so(X.innerType,R,Y),R.seen.get(e).ref=X.innerType},$o=(e,R,W,Y)=>{let X=e._zod.innerType;so(X,R,Y),R.seen.get(e).ref=X},Od=N(`ZodISODateTime`,((e,R)=>{xu.init(e,R),Jd.init(e,R)}));function Wo(e){return function(e,R){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...se(R)})}(Od,e)}const kd=N(`ZodISODate`,((e,R)=>{Su.init(e,R),Jd.init(e,R)}));function Xo(e){return function(e,R){return new e({type:`string`,format:`date`,check:`string_format`,...se(R)})}(kd,e)}const Ad=N(`ZodISOTime`,((e,R)=>{Cu.init(e,R),Jd.init(e,R)}));function ts(e){return function(e,R){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...se(R)})}(Ad,e)}const jd=N(`ZodISODuration`,((e,R)=>{wu.init(e,R),Jd.init(e,R)}));function is(e){return function(e,R){return new e({type:`string`,format:`duration`,check:`string_format`,...se(R)})}(jd,e)}const ns=(e,R)=>{Vo.init(e,R),e.name=`ZodError`,Object.defineProperties(e,{format:{value:R=>function(e,R=e=>e.message){let W={_errors:[]},i=e=>{for(let Y of e.issues)if(Y.code===`invalid_union`&&Y.errors.length)Y.errors.map((e=>i({issues:e})));else if(Y.code===`invalid_key`)i({issues:Y.issues});else if(Y.code===`invalid_element`)i({issues:Y.issues});else if(Y.path.length===0)W._errors.push(R(Y));else{let e=W,X=0;for(;X<Y.path.length;){let W=Y.path[X];X===Y.path.length-1?(e[W]=e[W]||{_errors:[]},e[W]._errors.push(R(Y))):e[W]=e[W]||{_errors:[]},e=e[W],X++}}};return i(e),W}(e,R)},flatten:{value:R=>function(e,R=e=>e.message){let W={},Y=[];for(let X of e.issues)X.path.length>0?(W[X.path[0]]=W[X.path[0]]||[],W[X.path[0]].push(R(X))):Y.push(R(X));return{formErrors:Y,fieldErrors:W}}(e,R)},addIssue:{value:R=>{e.issues.push(R),e.message=JSON.stringify(e.issues,J,2)}},addIssues:{value:R=>{e.issues.push(...R),e.message=JSON.stringify(e.issues,J,2)}},isEmpty:{get:()=>e.issues.length===0}})},Md=(N(`ZodError`,ns),N(`ZodError`,ns,{Parent:Error})),Nd=Ee(Md),Pd=me(Md),Fd=we(Md),Id=ve(Md),Ld=ke(Md),Rd=De(Md),zd=Se(Md),Bd=xe(Md),Vd=ze(Md),Hd=Fe(Md),Ud=Le(Md),Wd=Ne(Md),Gd=N(`ZodType`,((e,R)=>(su.init(e,R),Object.assign(e[`~standard`],{jsonSchema:{input:co(e,`input`),output:co(e,`output`)}}),e.toJSONSchema=((e,R={})=>W=>{let Y=oo({...W,processors:R});return so(e,Y),ro(Y,e),ao(Y,e)})(e,{}),e.def=R,e.type=R.type,Object.defineProperty(e,"_def",{value:R}),e.check=(...W)=>e.clone($(R,{checks:[...R.checks??[],...W.map((e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e))]})),e.clone=(R,W)=>oe(e,R,W),e.brand=()=>e,e.register=(R,W)=>(R.add(e,W),e),e.parse=(R,W)=>Nd(e,R,W,{callee:e.parse}),e.safeParse=(R,W)=>Fd(e,R,W),e.parseAsync=async(R,W)=>Pd(e,R,W,{callee:e.parseAsync}),e.safeParseAsync=async(R,W)=>Id(e,R,W),e.spa=e.safeParseAsync,e.encode=(R,W)=>Ld(e,R,W),e.decode=(R,W)=>Rd(e,R,W),e.encodeAsync=async(R,W)=>zd(e,R,W),e.decodeAsync=async(R,W)=>Bd(e,R,W),e.safeEncode=(R,W)=>Vd(e,R,W),e.safeDecode=(R,W)=>Hd(e,R,W),e.safeEncodeAsync=async(R,W)=>Ud(e,R,W),e.safeDecodeAsync=async(R,W)=>Wd(e,R,W),e.refine=(R,W)=>e.check(ll(R,W)),e.superRefine=R=>e.check(cl(R)),e.overwrite=R=>e.check(Wn(R)),e.optional=()=>Sa(e),e.nullable=()=>za(e),e.nullish=()=>Sa(za(e)),e.nonoptional=R=>Ma(e,R),e.array=()=>Kr(e),e.or=R=>ia([e,R]),e.and=R=>la(e,R),e.transform=R=>Ha(e,ka(R)),e.default=R=>Na(e,R),e.prefault=R=>Ta(e,R),e.catch=R=>Za(e,R),e.pipe=R=>Ha(e,R),e.readonly=()=>Wa(e),e.describe=R=>{let W=e.clone();return Ed.add(W,{description:R}),W},Object.defineProperty(e,"description",{get:()=>Ed.get(e)?.description,configurable:!0}),e.meta=(...R)=>{if(R.length===0)return Ed.get(e);let W=e.clone();return Ed.add(W,R[0]),W},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e))),Kd=N(`_ZodString`,((e,R)=>{cu.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(R,W,Y)=>ho(e,R,W);let W=e._zod.bag;e.format=W.format??null,e.minLength=W.minimum??null,e.maxLength=W.maximum??null,e.regex=(...R)=>e.check(Zn(...R)),e.includes=(...R)=>e.check(Yn(...R)),e.startsWith=(...R)=>e.check(Hn(...R)),e.endsWith=(...R)=>e.check(Pn(...R)),e.min=(...R)=>e.check(Un(...R)),e.max=(...R)=>e.check(On(...R)),e.length=(...R)=>e.check(Jn(...R)),e.nonempty=(...R)=>e.check(Un(1,...R)),e.lowercase=R=>e.check(qn(R)),e.uppercase=R=>e.check(jn(R)),e.trim=()=>e.check(Xn()),e.normalize=(...R)=>e.check(Vn(...R)),e.toLowerCase=()=>e.check(eo()),e.toUpperCase=()=>e.check(to()),e.slugify=()=>e.check(Ao())})),qd=N(`ZodString`,((e,R)=>{cu.init(e,R),Kd.init(e,R),e.email=R=>e.check(sn(Yd,R)),e.url=R=>e.check(dn(Qd,R)),e.jwt=R=>e.check(bn(hf,R)),e.emoji=R=>e.check(hn($d,R)),e.guid=R=>e.check(rn(Xd,R)),e.uuid=R=>e.check(an(Zd,R)),e.uuidv4=R=>e.check(ln(Zd,R)),e.uuidv6=R=>e.check(cn(Zd,R)),e.uuidv7=R=>e.check(gn(Zd,R)),e.nanoid=R=>e.check(un(ef,R)),e.guid=R=>e.check(rn(Xd,R)),e.cuid=R=>e.check(In(tf,R)),e.cuid2=R=>e.check(pn(nf,R)),e.ulid=R=>e.check(fn(rf,R)),e.base64=R=>e.check(wn(ff,R)),e.base64url=R=>e.check(_n(pf,R)),e.xid=R=>e.check(Bn(af,R)),e.ksuid=R=>e.check(Cn(of,R)),e.ipv4=R=>e.check(En(sf,R)),e.ipv6=R=>e.check(Qn(lf,R)),e.cidrv4=R=>e.check(mn(uf,R)),e.cidrv6=R=>e.check(yn(df,R)),e.e164=R=>e.check(vn(mf,R)),e.datetime=R=>e.check(Wo(R)),e.date=R=>e.check(Xo(R)),e.time=R=>e.check(ts(R)),e.duration=R=>e.check(is(R))}));function Qs(e){return function(e,R){return new e({type:`string`,...se(R)})}(qd,e)}const Jd=N(`ZodStringFormat`,((e,R)=>{lu.init(e,R),Kd.init(e,R)})),Yd=N(`ZodEmail`,((e,R)=>{fu.init(e,R),Jd.init(e,R)}));function ws(e){return sn(Yd,e)}const Xd=N(`ZodGUID`,((e,R)=>{uu.init(e,R),Jd.init(e,R)}));function vs(e){return rn(Xd,e)}const Zd=N(`ZodUUID`,((e,R)=>{du.init(e,R),Jd.init(e,R)}));function ks(e){return an(Zd,e)}function Ds(e){return ln(Zd,e)}function Ss(e){return cn(Zd,e)}function xs(e){return gn(Zd,e)}const Qd=N(`ZodURL`,((e,R)=>{pu.init(e,R),Jd.init(e,R)}));function Fs(e){return dn(Qd,e)}function Ls(e){return dn(Qd,{protocol:/^https?$/,hostname:Ws,...se(e)})}const $d=N(`ZodEmoji`,((e,R)=>{mu.init(e,R),Jd.init(e,R)}));function Gs(e){return hn($d,e)}const ef=N(`ZodNanoID`,((e,R)=>{hu.init(e,R),Jd.init(e,R)}));function Rs(e){return un(ef,e)}const tf=N(`ZodCUID`,((e,R)=>{gu.init(e,R),Jd.init(e,R)}));function Os(e){return In(tf,e)}const nf=N(`ZodCUID2`,((e,R)=>{_u.init(e,R),Jd.init(e,R)}));function Js(e){return pn(nf,e)}const rf=N(`ZodULID`,((e,R)=>{vu.init(e,R),Jd.init(e,R)}));function qs(e){return fn(rf,e)}const af=N(`ZodXID`,((e,R)=>{yu.init(e,R),Jd.init(e,R)}));function Ys(e){return Bn(af,e)}const of=N(`ZodKSUID`,((e,R)=>{bu.init(e,R),Jd.init(e,R)}));function Ps(e){return Cn(of,e)}const sf=N(`ZodIPv4`,((e,R)=>{Tu.init(e,R),Jd.init(e,R)}));function Ks(e){return En(sf,e)}const cf=N(`ZodMAC`,((e,R)=>{Du.init(e,R),Jd.init(e,R)}));function Vs(e){return function(e,R){return new e({type:`string`,format:`mac`,check:`string_format`,abort:!1,...se(R)})}(cf,e)}const lf=N(`ZodIPv6`,((e,R)=>{Eu.init(e,R),Jd.init(e,R)}));function er(e){return Qn(lf,e)}const uf=N(`ZodCIDRv4`,((e,R)=>{Ou.init(e,R),Jd.init(e,R)}));function Ar(e){return mn(uf,e)}const df=N(`ZodCIDRv6`,((e,R)=>{ku.init(e,R),Jd.init(e,R)}));function nr(e){return yn(df,e)}const ff=N(`ZodBase64`,((e,R)=>{Au.init(e,R),Jd.init(e,R)}));function sr(e){return wn(ff,e)}const pf=N(`ZodBase64URL`,((e,R)=>{ju.init(e,R),Jd.init(e,R)}));function ar(e){return _n(pf,e)}const mf=N(`ZodE164`,((e,R)=>{Mu.init(e,R),Jd.init(e,R)}));function cr(e){return vn(mf,e)}const hf=N(`ZodJWT`,((e,R)=>{Nu.init(e,R),Jd.init(e,R)}));function dr(e){return bn(hf,e)}const gf=N(`ZodCustomStringFormat`,((e,R)=>{Pu.init(e,R),Jd.init(e,R)}));function ur(e,R,W={}){return no(gf,e,R,W)}function Ir(e){return no(gf,`hostname`,Us,e)}function pr(e){return no(gf,`hex`,Hc,e)}function fr(e,R){let W=`${e}_${R?.enc??`hex`}`,Y=Aa[W];if(!Y)throw Error(`Unrecognized hash format: ${W}`);return no(gf,W,Y,R)}const _f=N(`ZodNumber`,((e,R)=>{Fu.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(R,W,Y)=>uo(e,R,W),e.gt=(R,W)=>e.check(Sn(R,W)),e.gte=(R,W)=>e.check(xn(R,W)),e.min=(R,W)=>e.check(xn(R,W)),e.lt=(R,W)=>e.check(kn(R,W)),e.lte=(R,W)=>e.check(Dn(R,W)),e.max=(R,W)=>e.check(Dn(R,W)),e.int=R=>e.check(Qr(R)),e.safe=R=>e.check(Qr(R)),e.positive=R=>e.check(Sn(0,R)),e.nonnegative=R=>e.check(xn(0,R)),e.negative=R=>e.check(kn(0,R)),e.nonpositive=R=>e.check(Dn(0,R)),e.multipleOf=(R,W)=>e.check(Gn(R,W)),e.step=(R,W)=>e.check(Gn(R,W)),e.finite=()=>e;let W=e._zod.bag;e.minValue=Math.max(W.minimum??-1/0,W.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(W.maximum??1/0,W.exclusiveMaximum??1/0)??null,e.isInt=(W.format??``).includes(`int`)||Number.isSafeInteger(W.multipleOf??.5),e.isFinite=!0,e.format=W.format??null}));function Cr(e){return function(e,R){return new e({type:`number`,checks:[],...se(R)})}(_f,e)}const vf=N(`ZodNumberFormat`,((e,R)=>{Iu.init(e,R),_f.init(e,R)}));function Qr(e){return function(e,R){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...se(R)})}(vf,e)}function mr(e){return function(e,R){return new e({type:`number`,check:`number_format`,abort:!1,format:`float32`,...se(R)})}(vf,e)}function yr(e){return function(e,R){return new e({type:`number`,check:`number_format`,abort:!1,format:`float64`,...se(R)})}(vf,e)}function wr(e){return function(e,R){return new e({type:`number`,check:`number_format`,abort:!1,format:`int32`,...se(R)})}(vf,e)}function _r(e){return function(e,R){return new e({type:`number`,check:`number_format`,abort:!1,format:`uint32`,...se(R)})}(vf,e)}const yf=N(`ZodBoolean`,((e,R)=>{Lu.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(e,R,W)=>Io(0,0,R)}));function br(e){return function(e,R){return new e({type:`boolean`,...se(R)})}(yf,e)}const bf=N(`ZodBigInt`,((e,R)=>{Ru.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(e,R,W)=>po(0,e),e.gte=(R,W)=>e.check(xn(R,W)),e.min=(R,W)=>e.check(xn(R,W)),e.gt=(R,W)=>e.check(Sn(R,W)),e.gte=(R,W)=>e.check(xn(R,W)),e.min=(R,W)=>e.check(xn(R,W)),e.lt=(R,W)=>e.check(kn(R,W)),e.lte=(R,W)=>e.check(Dn(R,W)),e.max=(R,W)=>e.check(Dn(R,W)),e.positive=R=>e.check(Sn(BigInt(0),R)),e.negative=R=>e.check(kn(BigInt(0),R)),e.nonpositive=R=>e.check(Dn(BigInt(0),R)),e.nonnegative=R=>e.check(xn(BigInt(0),R)),e.multipleOf=(R,W)=>e.check(Gn(R,W));let W=e._zod.bag;e.minValue=W.minimum??null,e.maxValue=W.maximum??null,e.format=W.format??null}));function Dr(e){return function(e,R){return new e({type:`bigint`,...se(R)})}(bf,e)}const xf=N(`ZodBigIntFormat`,((e,R)=>{zu.init(e,R),bf.init(e,R)}));function xr(e){return function(e,R){return new e({type:`bigint`,check:`bigint_format`,abort:!1,format:`int64`,...se(R)})}(xf,e)}function zr(e){return function(e,R){return new e({type:`bigint`,check:`bigint_format`,abort:!1,format:`uint64`,...se(R)})}(xf,e)}const Sf=N(`ZodSymbol`,((e,R)=>{Bu.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(e,R,W)=>fo(0,e)}));function Lr(e){return function(e,R){return new e({type:`symbol`,...se(R)})}(Sf,e)}const Cf=N(`ZodUndefined`,((e,R)=>{Vu.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(e,R,W)=>Co(0,e)}));function Gr(e){return function(e,R){return new e({type:`undefined`,...se(R)})}(Cf,e)}const wf=N(`ZodNull`,((e,R)=>{Hu.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(e,R,W)=>Bo(0,e,R)}));function Rr(e){return function(e,R){return new e({type:`null`,...se(R)})}(wf,e)}const Tf=N(`ZodAny`,((e,R)=>{Uu.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(e,R,W)=>{}}));function Or(){return function(e){return new e({type:`any`})}(Tf)}const Ef=N(`ZodUnknown`,((e,R)=>{Wu.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(e,R,W)=>{}}));function Jr(){return function(e){return new e({type:`unknown`})}(Ef)}const Df=N(`ZodNever`,((e,R)=>{Gu.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(e,R,W)=>Qo(0,0,R)}));function qr(e){return function(e,R){return new e({type:`never`,...se(R)})}(Df,e)}const Of=N(`ZodVoid`,((e,R)=>{Ku.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(e,R,W)=>Eo(0,e)}));function Yr(e){return function(e,R){return new e({type:`void`,...se(R)})}(Of,e)}const kf=N(`ZodDate`,((e,R)=>{qu.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(e,R,W)=>mo(0,e),e.min=(R,W)=>e.check(xn(R,W)),e.max=(R,W)=>e.check(Dn(R,W));let W=e._zod.bag;e.minDate=W.minimum?new Date(W.minimum):null,e.maxDate=W.maximum?new Date(W.maximum):null}));function Pr(e){return function(e,R){return new e({type:`date`,...se(R)})}(kf,e)}const Af=N(`ZodArray`,((e,R)=>{Ju.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(R,W,Y)=>Lo(e,R,W,Y),e.element=R.element,e.min=(R,W)=>e.check(Un(R,W)),e.nonempty=R=>e.check(Un(1,R)),e.max=(R,W)=>e.check(On(R,W)),e.length=(R,W)=>e.check(Jn(R,W)),e.unwrap=()=>e.element}));function Kr(e,R){return function(e,R,W){return new e({type:`array`,element:R,...se(W)})}(Af,e,R)}function Wr(e){let R=e._zod.def.shape;return Qa(Object.keys(R))}const jf=N(`ZodObject`,((e,R)=>{Xu.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(R,W,Y)=>No(e,R,W,Y),H(e,`shape`,(()=>R.shape)),e.keyof=()=>Qa(Object.keys(e._zod.def.shape)),e.catchall=R=>e.clone({...e._zod.def,catchall:R}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Jr()}),e.loose=()=>e.clone({...e._zod.def,catchall:Jr()}),e.strict=()=>e.clone({...e._zod.def,catchall:qr()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=R=>function(e,R){if(!ee(R))throw Error(`Invalid input to extend: expected a plain object`);let W=e._zod.def.checks;if(W&&W.length>0)throw Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");return oe(e,$(e._zod.def,{get shape(){let W={...e._zod.def.shape,...R};return P(this,`shape`,W),W},checks:[]}))}(e,R),e.safeExtend=R=>function(e,R){if(!ee(R))throw Error(`Invalid input to safeExtend: expected a plain object`);return oe(e,{...e._zod.def,get shape(){let W={...e._zod.def.shape,...R};return P(this,`shape`,W),W},checks:e._zod.def.checks})}(e,R),e.merge=R=>function(e,R){return oe(e,$(e._zod.def,{get shape(){let W={...e._zod.def.shape,...R._zod.def.shape};return P(this,`shape`,W),W},get catchall(){return R._zod.def.catchall},checks:[]}))}(e,R),e.pick=R=>function(e,R){let W=e._zod.def;return oe(e,$(e._zod.def,{get shape(){let e={};for(let Y in R){if(!(Y in W.shape))throw Error(`Unrecognized key: "${Y}"`);R[Y]&&(e[Y]=W.shape[Y])}return P(this,`shape`,e),e},checks:[]}))}(e,R),e.omit=R=>function(e,R){let W=e._zod.def;return oe(e,$(e._zod.def,{get shape(){let Y={...e._zod.def.shape};for(let e in R){if(!(e in W.shape))throw Error(`Unrecognized key: "${e}"`);R[e]&&delete Y[e]}return P(this,`shape`,Y),Y},checks:[]}))}(e,R),e.partial=(...R)=>function(e,R,W){return oe(R,$(R._zod.def,{get shape(){let Y=R._zod.def.shape,X={...Y};if(W)for(let R in W){if(!(R in Y))throw Error(`Unrecognized key: "${R}"`);W[R]&&(X[R]=e?new e({type:`optional`,innerType:Y[R]}):Y[R])}else for(let R in Y)X[R]=e?new e({type:`optional`,innerType:Y[R]}):Y[R];return P(this,`shape`,X),X},checks:[]}))}(Wf,e,R[0]),e.required=(...R)=>function(e,R,W){return oe(R,$(R._zod.def,{get shape(){let Y=R._zod.def.shape,X={...Y};if(W)for(let R in W){if(!(R in X))throw Error(`Unrecognized key: "${R}"`);W[R]&&(X[R]=new e({type:`nonoptional`,innerType:Y[R]}))}else for(let R in Y)X[R]=new e({type:`nonoptional`,innerType:Y[R]});return P(this,`shape`,X),X},checks:[]}))}(Jf,e,R[0])}));function Xr(e,R){return new jf({type:`object`,shape:e??{},...se(R)})}function ea(e,R){return new jf({type:`object`,shape:e,catchall:qr(),...se(R)})}function ta(e,R){return new jf({type:`object`,shape:e,catchall:Jr(),...se(R)})}const Mf=N(`ZodUnion`,((e,R)=>{Zu.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(R,W,Y)=>Go(e,R,W,Y),e.options=R.options}));function ia(e,R){return new Mf({type:`union`,options:e,...se(R)})}const Nf=N(`ZodXor`,((e,R)=>{Mf.init(e,R),Qu.init(e,R),e._zod.processJSONSchema=(R,W,Y)=>Go(e,R,W,Y),e.options=R.options}));function oa(e,R){return new Nf({type:`union`,options:e,inclusive:!1,...se(R)})}const Pf=N(`ZodDiscriminatedUnion`,((e,R)=>{Mf.init(e,R),$u.init(e,R)}));function ra(e,R,W){return new Pf({type:`union`,options:R,discriminator:e,...se(W)})}const Ff=N(`ZodIntersection`,((e,R)=>{ed.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(R,W,Y)=>To(e,R,W,Y)}));function la(e,R){return new Ff({type:`intersection`,left:e,right:R})}const If=N(`ZodTuple`,((e,R)=>{td.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(R,W,Y)=>Ro(e,R,W,Y),e.rest=R=>e.clone({...e._zod.def,rest:R})}));function ga(e,R,W){let Y=R instanceof su;return new If({type:`tuple`,items:e,rest:Y?R:null,...se(Y?W:R)})}const Lf=N(`ZodRecord`,((e,R)=>{nd.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(R,W,Y)=>Mo(e,R,W,Y),e.keyType=R.keyType,e.valueType=R.valueType}));function ha(e,R,W){return new Lf({type:`record`,keyType:e,valueType:R,...se(W)})}function ua(e,R,W){let Y=oe(e);return Y._zod.values=void 0,new Lf({type:`record`,keyType:Y,valueType:R,...se(W)})}function Ia(e,R,W){return new Lf({type:`record`,keyType:e,valueType:R,mode:`loose`,...se(W)})}const Rf=N(`ZodMap`,((e,R)=>{rd.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(e,R,W)=>zo(0,e),e.keyType=R.keyType,e.valueType=R.valueType}));function fa(e,R,W){return new Rf({type:`map`,keyType:e,valueType:R,...se(W)})}const zf=N(`ZodSet`,((e,R)=>{id.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(e,R,W)=>Fo(0,e),e.min=(...R)=>e.check(Rn(...R)),e.nonempty=R=>e.check(Rn(1,R)),e.max=(...R)=>e.check(Tn(...R)),e.size=(...R)=>e.check(Mn(...R))}));function Ca(e,R){return new zf({type:`set`,valueType:e,...se(R)})}const Bf=N(`ZodEnum`,((e,R)=>{ad.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(R,W,Y)=>yo(e,0,W),e.enum=R.entries,e.options=Object.values(R.entries);let W=new Set(Object.keys(R.entries));e.extract=(e,Y)=>{let X={};for(let Y of e){if(!W.has(Y))throw Error(`Key ${Y} not found in enum`);X[Y]=R.entries[Y]}return new Bf({...R,checks:[],...se(Y),entries:X})},e.exclude=(e,Y)=>{let X={...R.entries};for(let R of e){if(!W.has(R))throw Error(`Key ${R} not found in enum`);delete X[R]}return new Bf({...R,checks:[],...se(Y),entries:X})}}));function Qa(e,R){return new Bf({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map((e=>[e,e]))):e,...se(R)})}function ma(e,R){return new Bf({type:`enum`,entries:e,...se(R)})}const Vf=N(`ZodLiteral`,((e,R)=>{od.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(R,W,Y)=>wo(e,R,W),e.values=new Set(R.values),Object.defineProperty(e,"value",{get(){if(R.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return R.values[0]}})}));function wa(e,R){return new Vf({type:`literal`,values:Array.isArray(e)?e:[e],...se(R)})}const Hf=N(`ZodFile`,((e,R)=>{sd.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(R,W,Y)=>bo(e,0,W),e.min=(R,W)=>e.check(Rn(R,W)),e.max=(R,W)=>e.check(Tn(R,W)),e.mime=(R,W)=>e.check(Kn(Array.isArray(R)?R:[R],W))}));function va(e){return function(e,R){return new e({type:`file`,...se(R)})}(Hf,e)}const Uf=N(`ZodTransform`,((e,R)=>{cd.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(e,R,W)=>xo(0,e),e._zod.parse=(W,Y)=>{if(Y.direction===`backward`)throw new T(e.constructor.name);W.addIssue=Y=>{if(typeof Y==`string`)W.issues.push(pe(Y,W.value,R));else{let R=Y;R.fatal&&(R.continue=!1),R.code??=`custom`,R.input??=W.value,R.inst??=e,W.issues.push(pe(R))}};let X=R.transform(W.value,W);return X instanceof Promise?X.then((e=>(W.value=e,W))):(W.value=X,W)}}));function ka(e){return new Uf({type:`transform`,transform:e})}const Wf=N(`ZodOptional`,((e,R)=>{ld.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(R,W,Y)=>Po(e,R,0,Y),e.unwrap=()=>e._zod.def.innerType}));function Sa(e){return new Wf({type:`optional`,innerType:e})}const Gf=N(`ZodNullable`,((e,R)=>{ud.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(R,W,Y)=>Oo(e,R,W,Y),e.unwrap=()=>e._zod.def.innerType}));function za(e){return new Gf({type:`nullable`,innerType:e})}function Fa(e){return Sa(za(e))}const Kf=N(`ZodDefault`,((e,R)=>{dd.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(R,W,Y)=>Jo(e,R,W,Y),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap}));function Na(e,R){return new Kf({type:`default`,innerType:e,get defaultValue(){return typeof R==`function`?R():te(R)}})}const qf=N(`ZodPrefault`,((e,R)=>{fd.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(R,W,Y)=>Zo(e,R,W,Y),e.unwrap=()=>e._zod.def.innerType}));function Ta(e,R){return new qf({type:`prefault`,innerType:e,get defaultValue(){return typeof R==`function`?R():te(R)}})}const Jf=N(`ZodNonOptional`,((e,R)=>{pd.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(R,W,Y)=>Uo(e,R,0,Y),e.unwrap=()=>e._zod.def.innerType}));function Ma(e,R){return new Jf({type:`nonoptional`,innerType:e,...se(R)})}const Yf=N(`ZodSuccess`,((e,R)=>{md.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(e,R,W)=>ko(0,0,R),e.unwrap=()=>e._zod.def.innerType}));function Ua(e){return new Yf({type:`success`,innerType:e})}const Xf=N(`ZodCatch`,((e,R)=>{hd.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(R,W,Y)=>qo(e,R,W,Y),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap}));function Za(e,R){return new Xf({type:`catch`,innerType:e,catchValue:typeof R==`function`?R:()=>R})}const Zf=N(`ZodNaN`,((e,R)=>{gd.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(e,R,W)=>_o(0,e)}));function ja(e){return function(e,R){return new e({type:`nan`,...se(R)})}(Zf,e)}const Qf=N(`ZodPipe`,((e,R)=>{_d.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(R,W,Y)=>jo(e,R,0,Y),e.in=R.in,e.out=R.out}));function Ha(e,R){return new Qf({type:`pipe`,in:e,out:R})}const $f=N(`ZodCodec`,((e,R)=>{Qf.init(e,R),vd.init(e,R)}));function $a(e,R,W){return new $f({type:`pipe`,in:e,out:R,transform:W.decode,reverseTransform:W.encode})}const ep=N(`ZodReadonly`,((e,R)=>{yd.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(R,W,Y)=>Yo(e,R,W,Y),e.unwrap=()=>e._zod.def.innerType}));function Wa(e){return new ep({type:`readonly`,innerType:e})}const tp=N(`ZodTemplateLiteral`,((e,R)=>{bd.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(R,W,Y)=>vo(e,0,W)}));function Xa(e,R){return new tp({type:`template_literal`,parts:e,...se(R)})}const np=N(`ZodLazy`,((e,R)=>{Cd.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(R,W,Y)=>$o(e,R,0,Y),e.unwrap=()=>e._zod.def.getter()}));function tl(e){return new np({type:`lazy`,getter:e})}const rp=N(`ZodPromise`,((e,R)=>{Sd.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(R,W,Y)=>Ho(e,R,0,Y),e.unwrap=()=>e._zod.def.innerType}));function il(e){return new rp({type:`promise`,innerType:e})}const ip=N(`ZodFunction`,((e,R)=>{xd.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(e,R,W)=>So(0,e)}));function ol(e){return new ip({type:`function`,input:Array.isArray(e?.input)?ga(e?.input):e?.input??Kr(Jr()),output:e?.output??Jr()})}const ap=N(`ZodCustom`,((e,R)=>{wd.init(e,R),Gd.init(e,R),e._zod.processJSONSchema=(e,R,W)=>Do(0,e)}));function rl(e){let R=new Al({check:`custom`});return R._zod.check=e,R}function al(e,R){return function(e,R,W){let Y=se(W);return Y.abort??=!0,new e({type:`custom`,check:`custom`,fn:R,...Y})}(ap,e??(()=>!0),R)}function ll(e,R={}){return function(e,R,W){return new e({type:`custom`,check:`custom`,fn:R,...se(W)})}(ap,e,R)}function cl(e){return io(e)}const gl=function(e){let R=new Al({check:`describe`});return R._zod.onattach=[R=>{let W=Ed.get(R)??{};Ed.add(R,{...W,description:e})}],R._zod.check=()=>{},R},dl=function(e){let R=new Al({check:`meta`});return R._zod.onattach=[R=>{let W=Ed.get(R)??{};Ed.add(R,{...W,...e})}],R._zod.check=()=>{},R};function hl(e,R={error:`Input not instance of ${e.name}`}){let W=new ap({type:`custom`,check:`custom`,fn:R=>R instanceof e,abort:!0,...se(R)});return W._zod.bag.Class=e,W}const ul=(...e)=>function(e,R){let W=se(R),Y=W.truthy??[`true`,`1`,`yes`,`on`,`y`,`enabled`],X=W.falsy??[`false`,`0`,`no`,`off`,`n`,`disabled`];W.case!==`sensitive`&&(Y=Y.map((e=>typeof e==`string`?e.toLowerCase():e)),X=X.map((e=>typeof e==`string`?e.toLowerCase():e)));let ie=new Set(Y),ae=new Set(X),le=e.Codec??vd,_e=e.Boolean??Lu,ye=new le({type:`pipe`,in:new(e.String??cu)({type:`string`,error:W.error}),out:new _e({type:`boolean`,error:W.error}),transform:(e,R)=>{let Y=e;return W.case!==`sensitive`&&(Y=Y.toLowerCase()),!!ie.has(Y)||!ae.has(Y)&&(R.issues.push({code:`invalid_value`,expected:`stringbool`,values:[...ie,...ae],input:R.value,inst:ye,continue:!1}),{})},reverseTransform:(e,R)=>!0===e?Y[0]||`true`:X[0]||`false`,error:W.error});return ye}({Codec:$f,Boolean:yf,String:qd},...e);function Il(e){let R=tl((()=>ia([Qs(e),Cr(),br(),Rr(),Kr(R),ha(Qs(),R)])));return R}function pl(e,R){return Ha(ka(e),R)}var op;op||={},M({localeError:tn()});const sp=ra(`type`,[Xr({name:Qs(),type:wa(`int`),value:Cr().int()}),Xr({name:Qs(),type:wa(`bool`),value:br()}),Xr({name:Qs(),type:wa(`float`),value:Cr()}),Xr({name:Qs(),type:wa(`string`),value:Qs()}),Xr({name:Qs(),type:wa(`file`),value:Qs()}),Xr({name:Qs(),type:wa(`color`),value:Qs()}),Xr({name:Qs(),type:wa(`object`),value:Cr()})]),cp=Xr({name:Qs(),type:wa(`tilelayer`),class:Qs().optional(),height:Cr(),width:Cr(),x:Cr(),y:Cr(),id:Cr(),opacity:Cr(),properties:Kr(sp).optional(),visible:br(),tintcolor:Qs().optional(),parallaxx:Cr().optional(),parallaxy:Cr().optional(),offsetx:Cr().optional(),offsety:Cr().optional()}),lp=cp.extend({data:Kr(Cr()),encoding:wa(`csv`)}),up=cp.extend({data:Kr(Cr()),encoding:wa(`base64`),compression:wa(`gzip`)}),dp=cp.extend({data:Kr(Cr()),encoding:wa(`base64`),compression:wa(`zlib`)}),fp=cp.extend({data:Kr(Cr()),encoding:wa(`base64`),compression:wa(`zstandard`)}),pp=cp.extend({data:Qs(),encoding:wa(`base64`),compression:Qs().optional()}),mp=ia([Xr({x:Cr(),y:Cr(),width:Cr(),height:Cr(),data:Qs()}),Xr({x:Cr(),y:Cr(),width:Cr(),height:Cr(),data:Kr(Cr())})]),hp=ia([pp,lp,up,dp,fp,cp.extend({startx:Cr(),starty:Cr(),chunks:Kr(mp),encoding:Qs().optional(),compression:Qs().optional(),data:Gr()})]);function kl(e){return e.encoding===`base64`}function Dl(e){return e.encoding===`csv`||Array.isArray(e.data)}const gp=Xr({x:Cr(),y:Cr()}),_p=Kr(gp),vp=Xr({text:Qs(),color:Qs().optional(),fontfamily:Qs().optional(),pixelsize:Cr().optional(),wrap:br().optional(),halign:ia([wa(`left`),wa(`center`),wa(`right`),wa(`justify`)]).optional(),valign:ia([wa(`top`),wa(`center`),wa(`bottom`)]).optional()}),yp=Xr({id:Cr().optional(),name:Qs().optional(),type:Qs().optional(),x:Cr().optional(),y:Cr().optional(),rotation:Cr().optional(),height:Cr().optional(),width:Cr().optional(),visible:br().optional(),gid:Cr().optional(),text:vp.optional(),point:br().optional(),ellipse:br().optional(),polyline:Kr(gp).optional(),polygon:_p.optional(),template:Qs().optional(),properties:Kr(sp).optional()}),bp=Xr({duration:Cr(),tileid:Cr()}),xp=Xr({name:Qs(),draworder:Qs(),type:wa(`objectgroup`),class:Qs().optional(),x:Cr(),y:Cr(),id:Cr(),color:Qs().optional(),tintcolor:Qs().optional(),parallaxx:Cr().optional(),parallaxy:Cr().optional(),offsetx:Cr().optional(),offsety:Cr().optional(),opacity:Cr(),properties:Kr(sp).optional(),visible:br(),objects:Kr(yp)}),Sp=ia([hp,Xr({name:Qs(),x:Cr(),y:Cr(),id:Cr(),type:wa(`imagelayer`),class:Qs().optional(),image:Qs().optional(),opacity:Cr(),properties:Kr(sp).optional(),visible:br(),tintcolor:Qs().optional(),repeatx:br().optional(),repeaty:br().optional(),parallaxx:Cr().optional(),parallaxy:Cr().optional(),offsetx:Cr().optional(),offsety:Cr().optional(),transparentcolor:Qs().optional()}),xp]),Cp=Xr({draworder:Qs(),id:Cr().optional(),name:Qs(),x:Cr(),y:Cr(),opacity:Cr(),tintcolor:Qs().optional(),type:wa(`objectgroup`),visible:br(),objects:Kr(yp),properties:Kr(sp).optional()}),wp=Xr({id:Cr(),type:Qs().optional(),animation:Kr(bp).optional(),objectgroup:Cp.optional(),probability:Cr().optional(),properties:Kr(sp).optional(),image:Qs().optional(),imageheight:Cr().optional(),imagewidth:Cr().optional()}),Tp=Xr({name:Qs(),firstgid:Cr().optional(),class:Qs().optional(),objectalignment:ia([wa(`topleft`),wa(`top`),wa(`topright`),wa(`left`),wa(`center`),wa(`right`),wa(`bottomleft`),wa(`bottom`),wa(`bottomright`)]).optional(),image:Qs().optional(),imagewidth:Cr().optional(),imageheight:Cr().optional(),columns:Cr(),tileheight:Cr(),tilewidth:Cr(),tilecount:Cr(),grid:Xr({height:Cr(),width:Cr(),orientation:ia([wa(`isometric`),wa(`orthogonal`)])}).optional(),tileoffset:gp.optional(),spacing:Cr(),margin:Cr(),tiles:Kr(wp).optional(),properties:Kr(sp).optional()});function Ol(e){return!!e.image}function Ul(e){return!e.image}const Ep=Tp.extend({tiledversion:Qs().optional(),type:wa(`tileset`),version:Qs().optional()}),Dp=Xr({firstgid:Cr(),source:Qs()}),Op=ia([Tp,Dp]),kp=Xr({object:yp.extend({id:Cr().optional()}),tileset:Dp.optional(),type:wa(`template`)}),Ap=Xr({type:Qs(),class:Qs().optional(),tiledversion:Qs(),version:Qs(),width:Cr(),height:Cr(),tilewidth:Cr(),tileheight:Cr(),compressionlevel:Cr().optional(),infinite:br(),nextlayerid:Cr(),nextobjectid:Cr(),parallaxoriginx:Cr().optional(),parallaxoriginy:Cr().optional(),hexsidelength:Cr().optional(),staggeraxis:wa(`y`).or(wa(`x`)).optional(),staggerindex:wa(`odd`).or(wa(`even`)).optional(),orientation:ia([wa(`isometric`),wa(`orthogonal`),wa(`staggered`),wa(`hexagonal`)]),renderorder:ia([wa(`right-down`),wa(`right-up`),wa(`left-down`),wa(`left-up`)]),backgroundcolor:Qs().optional(),layers:Kr(Sp),tilesets:Kr(Op),properties:Kr(sp).optional()});function Hl(e){return!!e.chunks}function Pl(e){return!e.source}function $l(e){return!!e.source}var jp=class Kl{constructor(e,R,W,Y){this.x=e,this.y=R,this.width=W,this.height=Y}combine(e){let R=this.x+this.width,W=this.y+this.height,Y=e.x+e.width,X=e.y+e.height,ie=Math.max(R,Y),ae=Math.max(W,X);return new Kl(Math.min(this.x,e.x),Math.min(this.y,e.y),ie-Math.min(this.x,e.x),ae-Math.min(this.y,e.y))}},Wl=class{constructor(){this._largestBounds=new jp(0,0,0,0)}_coerceNumber(e){return+e}_coerceBoolean(e){switch(e){case`0`:case`false`:return!1;case`true`:return!0;default:return!!e}}_coerceType(e,R){return e===`bool`?this._coerceBoolean(R):e===`int`||e===`float`||e===`object`?this._coerceNumber(R):R}_parsePropertiesNode(e,R){let W=[];if(e)for(let R of e.children){let e=R.getAttribute(`type`)??`string`,Y=R.getAttribute(`value`);Y||=R.innerHTML,W.push({name:R.getAttribute(`name`),type:e,value:this._coerceType(e,Y)})}R.properties=W}_parseAttributes(e,R){let W=`width.height.columns.firstgid.spacing.margin.tilecount.tilewidth.tileheight.opacity.compressionlevel.nextlayerid.nextobjectid.parallaxoriginx.parallaxoriginy.parallaxx.parallaxy.hexsidelength.offsetx.offsety.id.gid.x.y.rotation.probability`.split(`.`),Y=[`infinite`,`visible`,`repeatx`,`repeaty`];for(let X of e.attributes)W.indexOf(X.name)>-1?R[X.name]=this._coerceNumber(X.value):Y.indexOf(X.name)>-1?R[X.name]=this._coerceBoolean(X.value):R[X.name]=X.value}_parseToDocument(e){if(typeof DOMParser<`u`)return new DOMParser().parseFromString(e,`application/xml`);try{let{JSDOM:R}=S(371);return new R(e,{contentType:`application/xml`,encoding:`utf-8`}).window.document}catch{}let R=Error(`Could not find DOM parser`);throw console.error(R.message,R),R}parseObject(e,R=!0){let W={type:``,x:0,y:0};e.getAttribute(`template`)||(W.visible=!0,W.name=``,W.rotation=0,W.height=0,W.width=0),this._parseAttributes(e,W);let Y=e.querySelector(`properties`);Y&&this._parsePropertiesNode(Y,W);let X=e.querySelector(`text`);if(X){W.text={text:X.textContent};let e=X.getAttribute(`fontfamily`);e&&(W.text.fontfamily=e);let R=X.getAttribute(`color`);R&&(W.text.color=R);let Y=X.getAttribute(`pixelsize`);Y&&(W.text.pixelsize=this._coerceNumber(Y));let ie=X.getAttribute(`wrap`);ie&&(W.text.wrap=this._coerceBoolean(ie));let ae=X.getAttribute(`valign`);ae&&(W.text.valign=ae);let le=X.getAttribute(`halign`);le&&(W.text.halign=le)}e.querySelector(`point`)&&(W.point=!0),e.querySelector(`ellipse`)&&(W.ellipse=!0);let ie=e.querySelector(`polygon`);if(ie){let e=ie.getAttribute(`points`)?.split(` `);W.polygon=[],e&&e.forEach((e=>{let R=e.split(`,`);W.polygon.push({x:+R[0],y:+R[1]})}))}let ae=e.querySelector(`polyline`);if(ae){let e=ae.getAttribute(`points`)?.split(` `);W.polyline=[],e&&e.forEach((e=>{let R=e.split(`,`);W.polyline.push({x:+R[0],y:+R[1]})}))}if(R)try{return yp.parse(W)}catch(e){throw console.error(`Could not parse object`,W,e),e}return W}parseTileset(e,R=!0){let W={spacing:0,margin:0};if(this._parseAttributes(e,W),W.source)try{return Op.parse(W)}catch(e){console.error(`Could not parse external tileset`,W,e)}for(let Y of e.children)switch(Y.tagName){case`properties`:this._parsePropertiesNode(Y,W);break;case`tileoffset`:{let e={};this._parseAttributes(Y,e),W.tileoffset=e;break}case`grid`:{let e={};this._parseAttributes(Y,e),W.grid=e;break}case`image`:W.image=Y.getAttribute(`source`),W.imagewidth=this._coerceNumber(Y.getAttribute(`width`)),W.imageheight=this._coerceNumber(Y.getAttribute(`height`));break;case`tile`:{W.tiles||=[];let e={};this._parseAttributes(Y,e);for(let W of Y.children)switch(W.tagName){case`image`:e.image=W.getAttribute(`source`),e.imagewidth=this._coerceNumber(W.getAttribute(`width`)),e.imageheight=this._coerceNumber(W.getAttribute(`height`));break;case`objectgroup`:{let Y={type:`objectgroup`,name:``,visible:!0,x:0,y:0,opacity:1,objects:[]};this._parseAttributes(W,Y),e.objectgroup=Y;for(let e of W.children){let W=this.parseObject(e,R);Y.objects.push(W)}break}case`animation`:{let R=[];for(let e of W.children)R.push({duration:this._coerceNumber(e.getAttribute(`duration`)),tileid:this._coerceNumber(e.getAttribute(`tileid`))});e.animation=R;break}case`properties`:this._parsePropertiesNode(W,e)}if(R)try{W.tiles.push(wp.parse(e))}catch(R){throw console.error(`Could not parse Tile`,e,R),R}else W.tiles.push(e);break}}if(R)try{return Op.parse(W)}catch(e){throw console.error(`Could not parse Tileset`,W,e),e}return W}parseTileLayer(e,R,W=!0){let Y={type:`tilelayer`,x:0,y:0,opacity:1,visible:!0};this._parseAttributes(e,Y);for(let W of e.children)switch(W.tagName){case`properties`:this._parsePropertiesNode(W,Y);break;case`data`:{let e=W.getAttribute(`encoding`);e&&(Y.encoding=e);let X=W.getAttribute(`compression`);if(X&&(Y.compression=X),R){Y.width=0,Y.height=0,Y.chunks=[];let e=new jp(0,0,0,0);for(let R of W.children)if(R.tagName===`chunk`){let W={};switch(this._parseAttributes(R,W),Y.encoding){case`base64`:W.data=R.textContent?.trim();break;case`csv`:W.data=R.textContent?.split(`,`).map((e=>+e))}let X=new jp(W.x,W.y,W.width,W.height);e=e.combine(X),Y.chunks.push(W)}Y.width=e.width,Y.height=e.height,Y.startx=e.x,Y.starty=e.y,this._largestBounds=this._largestBounds.combine(new jp(Y.startx,Y.starty,Y.width,Y.height))}else switch(Y.encoding){case`base64`:Y.data=W.textContent?.trim();break;case`csv`:Y.data=W.textContent?.split(`,`).map((e=>+e))}}}if(W)try{return Sp.parse(Y)}catch(e){throw console.error(`Could not parse tiled tile layer`,Y,e),e}return Y}parseObjectGroup(e,R=!0){let W={type:`objectgroup`,draworder:`topdown`,visible:!0,x:0,y:0,opacity:1,objects:[]};this._parseAttributes(e,W);for(let Y of e.children)switch(Y.tagName){case`properties`:this._parsePropertiesNode(Y,W);break;case`object`:{let e=this.parseObject(Y,R);W.objects.push(e);break}}if(R)try{return Sp.parse(W)}catch(e){throw console.error(`Could not parse object group`,W,e),e}return W}parseImageLayer(e,R=!0){let W={type:`imagelayer`,visible:!0,x:0,y:0,opacity:1},Y=e.querySelector(`image`);W.image=Y?.getAttribute(`source`);let X=e.querySelector(`properties`);X&&this._parsePropertiesNode(X,W);let ie=Y?.getAttribute(`trans`);if(ie&&(W.transparentcolor=`#`+ie),this._parseAttributes(e,W),R)try{return Sp.parse(W)}catch(e){throw console.error(`Could not parse layer`,W,e),e}return W}parseExternalTemplate(e,R=!0){let W=this._parseToDocument(e).querySelector(`template`),Y={type:`template`},X=W.querySelector(`object`);X&&(Y.object=this.parseObject(X,R));let ie=W.querySelector(`tileset`);if(ie&&(Y.tileset=this.parseTileset(ie,R)),R)try{return kp.parse(Y)}catch(e){throw console.error(`Could not parse template`,Y,e),e}return Y}parseExternalTileset(e,R=!0){let W=this._parseToDocument(e).querySelector(`tileset`),Y=this.parseTileset(W,R);if(Y.type=`tileset`,this._parseAttributes(W,Y),R)try{return Ep.parse(Y)}catch(e){throw console.error(`Could not parse tileset file`,Y,e),e}return Y}parse(e,R=!0){let W=this._parseToDocument(e).querySelector(`map`),Y={type:`map`,compressionlevel:-1,layers:[],tilesets:[]};this._parseAttributes(W,Y);let n=(e,R=!0)=>{switch(e.tagName){case`group`:for(let W of e.children)n(W,R);break;case`layer`:{let W=this.parseTileLayer(e,Y.infinite,R);Y.layers.push(W);break}case`properties`:this._parsePropertiesNode(e,Y);break;case`tileset`:{let W=this.parseTileset(e,R);Y.tilesets.push(W);break}case`objectgroup`:{let W=this.parseObjectGroup(e,R);Y.layers.push(W);break}case`imagelayer`:{let W=this.parseImageLayer(e,R);Y.layers.push(W);break}}};for(let e of W.children)n(e,R);if(R)try{return Ap.parse(Y)}catch(e){throw console.error(`Could not parse Tiled map`,e),e}return Y}},Mp=S(668);let Np,Pp,Fp;const Ip={env:{emscripten_notify_memory_growth:function(e){Fp=new Uint8Array(Pp.exports.memory.buffer)}}};var ic=class{init(){return Np||(Np=typeof fetch<`u`?fetch(`data:application/wasm;base64,`+Lp).then((e=>e.arrayBuffer())).then((e=>WebAssembly.instantiate(e,Ip))).then(this._init):WebAssembly.instantiate(Buffer.from(Lp,`base64`),Ip).then(this._init),Np)}_init(e){Pp=e.instance,Ip.env.emscripten_notify_memory_growth(0)}decode(e,R=0){if(!Pp)throw Error(`ZSTDDecoder: Await .init() before decoding.`);let W=e.byteLength,Y=Pp.exports.malloc(W);Fp.set(e,Y),R||=Number(Pp.exports.ZSTD_findDecompressedSize(Y,W));let X=Pp.exports.malloc(R),ie=Pp.exports.ZSTD_decompress(X,R,Y,W),ae=Fp.slice(X,X+ie);return Pp.exports.free(Y),Pp.exports.free(X),ae}};const Lp=`AGFzbQEAAAABpQEVYAF/AX9gAn9/AGADf39/AX9gBX9/f39/AX9gAX8AYAJ/fwF/YAR/f39/AX9gA39/fwBgBn9/f39/fwF/YAd/f39/f39/AX9gAn9/AX5gAn5+AX5gAABgBX9/f39/AGAGf39/f39/AGAIf39/f39/f38AYAl/f39/f39/f38AYAABf2AIf39/f39/f38Bf2ANf39/f39/f39/f39/fwF/YAF/AX4CJwEDZW52H2Vtc2NyaXB0ZW5f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JqIAEgAmooAgA2AgAgAkEDSw0ACwsgAkUNAgNAIAAgAkF/aiICaiABIAJqLQAAOgAAIAINAAsMAgsgAkEDTQ0AIAIhBANAIAMgASgCADYCACABQQRqIQEgA0EEaiEDIARBfGoiBEEDSw0ACyACQQNxIQILIAJFDQADQCADIAEtAAA6AAAgA0EBaiEDIAFBAWohASACQX9qIgINAAsLIAAL8wICAn8BfgJAIAJFDQAgACACaiIDQX9qIAE6AAAgACABOgAAIAJBA0kNACADQX5qIAE6AAAgACABOgABIANBfWogAToAACAAIAE6AAIgAkEHSQ0AIANBfGogAToAACAAIAE6AAMgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIAIAQgA0EEcUEYciIEayICQSBJDQAgAa0iBUIghiAFhCEFIAMgBGohAQNAIAEgBTcDGCABIAU3AxAgASAFNwMIIAEgBTcDACABQSBqIQEgAkFgaiICQR9LDQALCyAACy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAIajYCACADCy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAFajYCACADCx8AIAAgASACKAIEEAg2AgAgARAEGiAAIAJBCGo2AgQLCAAgAGdBH3MLugUBDX8jAEEQayIKJAACfyAEQQNNBEAgCkEANgIMIApBDGogAyAEEAsaIAAgASACIApBDGpBBBAVIgBBbCAAEAMbIAAgACAESxsMAQsgAEEAIAEoAgBBAXRBAmoQECENQVQgAygAACIGQQ9xIgBBCksNABogAiAAQQVqNgIAIAMgBGoiAkF8aiEMIAJBeWohDiACQXtqIRAgAEEGaiELQQQhBSAGQQR2IQRBICAAdCIAQQF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BA2oiBU8NAUG4fwsQGgwCCyAGQQFqIQYgAiAFayECIAMgBWohAyAEKAIMRQ0ACyAEKAI4BEAgAkEDTQRAIABBuH8QGgwCCyADQQRqIQMLIAQoAighAiAEKQMYIQcgAEEANgIEIAAgAyABazYCACAAIAIgBmytIAcgB0J/URs3AwgLIARBQGskAAslAQF/IwBBEGsiAiQAIAIgACABEFEgAigCACEAIAJBEGokACAAC30BBH8jAEGQBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALzAEBAX8gACABKAK00AE2ApjiASAAIAEoAgQiAjYCwOABIAAgAjYCvOABIAAgAiABKAIIaiICNgK44AEgACACNgLE4AEgASgCuNABBEAgAEKBgICAEDcDiOEBIAAgAUGk0ABqNgIMIAAgAUGUIGo2AgggACABQZwwajYCBCAAIAFBDGo2AgAgAEGs0AFqIAFBqNABaigCADYCACAAQbDQAWogAUGs0AFqKAIANgIAIABBtNABaiABQbDQAWooAgA2AgAPCyAAQgA3A4jhAQs7ACACRQRAQbp/DwsgBEUEQEFsDwsgAiAEEGAEQCAAIAEgAiADIAQgBRBhDwsgACABIAIgAyAEIAUQZQtGAQF/IwBBEGsiBSQAIAVBCGogBBAOAn8gBS0ACQRAIAAgASACIAMgBBAyDAELIAAgASACIAMgBBA0CyEAIAVBEGokACAACzQAIAAgAyAEIAUQNiIFEAMEQCAFDwsgBSAESQR/IAEgAiADIAVqIAQgBWsgABA1BUG4fwsLRgEBfyMAQRBrIgUkACAFQQhqIAQQDgJ/IAUtAAkEQCAAIAEgAiADIAQQYgwBCyAAIAEgAiADIAQQNQshACAFQRBqJAAgAAtZAQF/QQ8hAiABIABJBEAgAUEEdCAAbiECCyAAQQh2IgEgAkEYbCIAQYwIaigCAGwgAEGICGooAgBqIgJBA3YgAmogAEGACGooAgAgAEGECGooAgAgAWxqSQs3ACAA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AAAGEAAAAAAAAAYTAAAAAAAABhYAAAAAAAAGGQAAAAAAAAYcAAAAAAAABh8AAAAAAAAGIgAAAAAAAQYlAAAAAAABBikAAAAAAAIGLwAAAAAAAwY7AAAAAAAEBlMAAAAAAAcGgwAAAAAACQYDAgAAEAAABAQAAAAAAAAEBQAAACAAAAUGAAAAAAAABQcAAAAgAAAFCQAAAAAAAAUKAAAAAAAABgwAAAAAAAAGDwAAAAAAAAYSAAAAAAAABhUAAAAAAAAGGAAAAAAAAAYbAAAAAAAABh4AAAAAAAAGIQAAAAAAAQYjAAAAAAABBicAAAAAAAIGKwAAAAAAAwYzAAAAAAAEBkMAAAAAAAUGYwAAAAAACAYDAQAAIAAABAQAAAAwAAAEBAAAABAAAAQFAAAAIAAABQcAAAAgAAAFCAAAACAAAAUKAAAAIAAABQsAAAAAAAAGDgAAAAAAAAYRAAAAAAAABhQAAAAAAAAGFwAAAAAAAAYaAAAAAAAABh0AAAAAAAAGIAAAAAAAEAYDAAEAAAAPBgOAAAAAAA4GA0AAAAAADQYDIAAAAAAMBgMQAAAAAAsGAwgAAAAACgYDBABBpB0L2QEBAAAAAwAAAAcAAAAPAAAAHwAAAD8AAAB/AAAA/wAAAP8BAAD/AwAA/wcAAP8PAAD/HwAA/z8AAP9/AAD//wAA//8BAP//AwD//wcA//8PAP//HwD//z8A//9/AP///wD///8B////A////wf///8P////H////z////9/AAAAAAEAAAACAAAABAAAAAAAAAACAAAABAAAAAgAAAAAAAAAAQAAAAIAAAABAAAABAAAAAQAAAAEAAAABAAAAAgAAAAIAAAACAAAAAcAAAAIAAAACQAAAAoAAAALAEGgIAsDwBBQ`;var oc=class{static decode(e,R){var W,Y,X,ie,ae,le;if(e.length%4>0)throw Error(`Invalid string. Length must be a multiple of 4`);var _e=43,ye=47,be=48,Ce=97,Te=65,Oe=45,Ae=95;function I(e){var R=e.charCodeAt(0);if(R===_e||R===Oe)return 62;if(R===ye||R===Ae)return 63;if(R<be)return-1;if(R<be+10)return R-be+26+26;if(R<Te+26)return R-Te;if(R<Ce+26)return R-Ce+26;throw Error(`Could not decode elt`)}var Me=e.length;ae=e.charAt(Me-2)===`=`?2:+(e.charAt(Me-1)===`=`),le=new Uint8Array(3*e.length/4-ae),X=ae>0?e.length-4:e.length;var Pe=0;function B(e){le[Pe++]=e}for(W=0,Y=0;W<X;W+=4,Y+=3)B((16711680&(ie=I(e.charAt(W))<<18|I(e.charAt(W+1))<<12|I(e.charAt(W+2))<<6|I(e.charAt(W+3))))>>16),B((65280&ie)>>8),B(255&ie);return ae===2?B(255&(ie=I(e.charAt(W))<<2|I(e.charAt(W+1))>>4)):ae===1&&(B((ie=I(e.charAt(W))<<10|I(e.charAt(W+1))<<4|I(e.charAt(W+2))>>2)>>8&255),B(255&ie)),new Promise((e=>{let i=function(e){for(var R=0,W=e.length-1;W>=0;W--)R=256*R+1*e[W];return R};if(R===`zlib`||R===`gzip`){var Y=(le=(0,Mp.inflate)(le)).length/4,X=Array(Y);for(W=0;W<Y;W++)X[W]=i(le.slice(4*W,4*W+4));e(X)}if(R===`zstd`){let R=new ic;R.init().then((()=>{var Y=(le=R.decode(le)).length/4,X=Array(Y);for(W=0;W<Y;W++)X[W]=i(le.slice(4*W,4*W+4));e(X)}))}if(!R){for(Y=le.length/4,X=Array(Y),W=0;W<Y;W++)X[W]=i(le.slice(4*W,4*W+4));e(X)}}))}};const Rp={TileData:{Tiled:`ex-tiled`},ZIndex:{ZIndex:`zindex`},Camera:{Camera:`camera`,Zoom:`zoom`},Animation:{Strategy:`animationstrategy`},Layer:{Solid:`solid`},Collision:{Type:`collisiontype`}},rc=async(e,R)=>{let W=await fetch(e);switch(R.toLowerCase()){case`xml`:default:return await W.text();case`json`:return await W.json()}},ac=e=>R=>R?.name&&e?R.name.toLocaleLowerCase().localeCompare(e.toLocaleLowerCase())===0:R?.name===e,lc=e=>R=>R?.class&&e?R.class.toLocaleLowerCase().localeCompare(e.toLocaleLowerCase())===0:R?.class===e,cc=e=>{let R=new Map;for(let[W,Y]of e)R.set(W.toLocaleLowerCase(),Y);return R},gc=(e,R,W=!0)=>Y=>{let X=cc(Y.properties);if(R!==void 0){let Y=R;typeof R==`string`&&(Y=W?R.toLocaleLowerCase():R);let ie=X.get(e.toLocaleLowerCase());return typeof ie==`string`?(W?ie.toLocaleLowerCase():ie)===Y:X.get(e.toLocaleLowerCase())===Y}return X.has(e.toLocaleLowerCase())},dc=(e,R)=>W=>R(cc(W.properties).get(e.toLocaleLowerCase())),pc=e=>!!(e&2147483648),fc=e=>!!(e&1073741824),Bc=e=>!!(e&536870912),Cc=e=>536870911&e;var Ec=class{constructor(e){this.type=e,this._loaded=!1,this.cache=new Map}getOrAdd(...e){let R=this.cache.get(e.join(`+`));return R||(R=new this.type(...e),this.cache.set(e.join(`+`),R),R)}values(){if(this._loaded)return Array.from(this.cache.values());throw Error(`Read through cache not yet loaded! No values to return!`)}async load(){let e=Array.from(this.cache.entries()),R=await Promise.allSettled(e.map((e=>e[1].load()))),W=0;for(let Y=0;Y<R.length;Y++){let X=R[Y];X.status===`rejected`&&(console.error(`Error loading resource at ${e[Y][0]}, is your pathMap correct? or your Tiled map corrupted?`,X.reason),W++)}if(W)throw Error(`Error loading ${W} resources`);this._loaded=!0}};function Qc(e,R){try{if(R)for(let W of R){let R=W.value;typeof W.value==`string`&&(R=W.value.toLocaleLowerCase()),e.properties.set(W.name.toLocaleLowerCase(),R)}}catch(R){console.error(`Unable to map properties onto ${e}`,R)}}function mc(e){let R=e.match(/[^/\\&\?]+\.\w{2,4}(?=([\#\?&].*$|$))/gi);if(R)return R[0];throw Error(`Could not locate filename from path: ${e}`)}function yc(e,R){for(let{path:W,output:Y}of R)if(typeof W==`string`){if(e.includes(W))return Y}else{let R=e.match(W);if(R)return Y.replace(`[match]`,R[0])}return e}function wc(e,R){if(!R)return!1;for(let{path:W,output:Y}of R)if(typeof W==`string`){if(e.includes(W))return!0}else if(e.match(W))return!0;return!1}function _c(e,R,W){if(wc(R,W)&&W)return yc(R,W);if(R.indexOf(`/`)===0)return R;let Y=e.split(`/`),X=R.split(`/`);return Y[Y.length-1].includes(`.`)&&Y.pop(),Y.concat(X).join(`/`)}var vc=class{constructor(e){this.properties=new Map,this.tiledObject=e.tiledObject,this.name=this.tiledObject.name,this.class=this.tiledObject.type,this.id=this.tiledObject.id??-1,this.x=this.tiledObject.x??0,this.y=this.tiledObject.y??0,this.rotation=this.tiledObject.rotation??0}},bc=class extends vc{constructor(e,R){if(super({tiledObject:e}),!e.template)throw Error(`Invalid template`);if(this.source=e.template,this.gid=e.gid,this.instanceObject=e,this.template=R,R.object){this.name=this.name||R.object.name,this.class=this.class||R.object.class;for(let[e,W]of R.object.properties.entries())this.properties.has(e)||this.properties.set(e,W)}if(R.tileset&&R.object.tiledObject.gid){let e=R.tileset.getTileByGid(R.object.tiledObject.gid);if(e){this.class=this.class||e.class;for(let[R,W]of e.properties.entries())this.properties.has(R)||this.properties.set(R,W)}}}},kc=class extends vc{constructor(e,R,W,Y){super({tiledObject:e}),this.gid=R,this.width=W,this.height=Y}},Dc=class extends vc{},Sc=class extends vc{constructor(e,R,W,Y){var X;super({tiledObject:e}),this.font=new si({family:R.fontfamily??`sans-serif`,color:R.color?We.fromHex(R.color):We.Black,size:R.pixelsize??16,unit:Wt.Px,textAlign:this._textAlignFromTiled(R.halign),baseAlign:this._textBaselineFromTiled(R.valign),quality:Y});let ie=(X=R.wrap)!=null&&X;this.text=new ci({text:R.text,font:this.font,...ie?{maxWidth:W+10}:{}})}_textBaselineFromTiled(e){switch(e){case`bottom`:return Kt.Bottom;case`center`:return Kt.Middle;default:return Kt.Top}}_textAlignFromTiled(e){switch(e){case`left`:default:return Gt.Left;case`center`:return Gt.Center;case`right`:return Gt.Right;case`justify`:return Gt.Start}}},xc=class extends vc{constructor(e,R,W){super({tiledObject:e}),this.width=R,this.height=W}},zc=class extends vc{constructor(e,R,W,Y){super({tiledObject:e}),this.width=R,this.height=W,this.anchor=Y}},Fc=class extends vc{constructor(e,R){super({tiledObject:e}),this.points=[],this.localPoints=[],this.localPoints=R.map((e=>vec(e.x,e.y))),this.points=R.map((e=>vec(e.x,e.y).rotate(toRadians(this.rotation)).add(vec(this.x,this.y))))}},Lc=class extends vc{constructor(e,R){super({tiledObject:e}),this.points=[],this.points=R.map((e=>vec(e.x,e.y)))}};function Nc(e,R){let W;if(e.point)W=new Dc({tiledObject:e});else if(e.ellipse)e.width&&e.height?(W=new xc(e,e.width,e.height),W.x+=e.width/2,W.y+=e.height/2):W=new xc(e,20,20);else if(e.polygon)W=new Fc(e,e.polygon);else if(e.polyline)W=new Lc(e,e.polyline);else if(e.text)W=new Sc(e,e.text,e.width??0,R?.textQuality??4);else if(e.gid&&!e.template){W=new kc(e,e.gid,e.width??0,e.height??0);let Y=R?.getTilesetForTileGid(e.gid),X=e.type;if(Y){let R=Y?.getTileByGid(e.gid);if(X||=R?.class,R?.properties)for(let[e,Y]of R.properties.entries())W.properties.has(e)||W.properties.set(e,Y)}W.class=X}else if(e.template&&R){let Y=R.templates.find((R=>mc(R.templatePath)===mc(e.template)));if(!Y)throw Error(`Template object id ${e.id} with name ${e.name} is missing a loaded template file, there should be one loaded from ${e.template}! Is your tiled map or template corrupted?`);W=new bc(e,Y)}else W=e.width&&e.height?new zc(e,e.width,e.height,Oe.Zero):new zc(e,20,20,Oe.Half);return Qc(W,e.properties),W}function Gc(e,R){let W=[];for(let Y of e.objects){let e=Nc(Y,R);W.push(e)}return W}var Tc=class{constructor(e){let{templatePath:R,object:W,tiledTemplate:Y,tileset:X}=e;this.templatePath=R,this.object=W,this.tiledTemplate=Y,this.tileset=X}},Rc=class{constructor(e){this.objects=[],this.colliders=[],this.animation=[],this.properties=new Map;let{id:R,tileset:W,tiledTile:Y}=e;this.id=R,this.tileset=W,this.tiledTile=Y,this.class=Y.type,Qc(this,Y.properties),Y.objectgroup&&Y.objectgroup.objects&&(this.objects=Gc(Y.objectgroup)),Y.animation&&(this.animation=Y.animation)}},Mc=class{constructor(e){this.firstGid=-1,this.tileCount=0,this.tileWidth=0,this.tileHeight=0,this.tileOffset=vec(0,0),this.tiles=[],this.objectalignment=`bottomleft`,this.orientation=`orthogonal`,this.properties=new Map;let{name:R,tiledTileset:W,image:Y,tileToImage:X,firstGid:ie}=e;if(this.name=R,this.tiledTileset=W,this.firstGid=ie,Ol(W)){Qc(this,W.properties);let e=W.spacing,R=Math.floor((W.imagewidth+e)/(W.tilewidth+e)),X=Math.floor((W.imageheight+e)/(W.tileheight+e));if(this.class=W.class,this.orientation=W.grid?.orientation??`orthogonal`,this.horizontalFlipTransform=Me.identity().translate(W.tilewidth,0).scale(-1,1),this.verticalFlipTransform=Me.identity().translate(0,W.tileheight).scale(1,-1),this.diagonalFlipTransform=Me.identity().translate(0,0).rotate(-Math.PI/2).scale(-1,1),this.objectalignment=W.objectalignment??(this.orientation===`orthogonal`?`bottomleft`:`bottom`),Y&&(this.spritesheet=ir.fromImageSource({image:Y,grid:{rows:X,columns:R,spriteWidth:W.tilewidth,spriteHeight:W.tileheight},spacing:{originOffset:{x:W.margin??0,y:W.margin??0},margin:{x:W.spacing??0,y:W.spacing??0}}})),this.tileCount=W.tilecount,this.tileWidth=W.tilewidth,this.tileHeight=W.tileheight,W.tileoffset&&(this.tileOffset=vec(W.tileoffset.x,W.tileoffset.y)),W.tiles)for(let e of W.tiles)this.tiles.push(new Rc({id:e.id,tileset:this,tiledTile:e,image:Y}))}if(Ul(W)&&W.firstgid!==void 0){this.horizontalFlipTransform=Me.identity().translate(W.tilewidth,0).scale(-1,1),this.verticalFlipTransform=Me.identity().translate(0,W.tileheight).scale(1,-1),this.diagonalFlipTransform=Me.identity().translate(0,0).rotate(-Math.PI/2).scale(-1,1),this.objectalignment=W.objectalignment??(this.orientation===`orthogonal`?`bottomleft`:`bottom`),this.orientation=W.grid?.orientation??`orthogonal`,this.tileCount=W.tilecount,this.tileWidth=W.tilewidth,this.tileHeight=W.tileheight,W.tileoffset&&(this.tileOffset=vec(W.tileoffset.x,W.tileoffset.y));let e=[];if(W.tiles)for(let R of W.tiles){let W=X?.get(R);W&&e.push(W.toSprite()),this.tiles.push(new Rc({id:R.id,tileset:this,tiledTile:R,image:W}))}X&&(this.spritesheet=new ir({sprites:e}))}}getTilesetAlignmentAnchor(e){switch(e??this.objectalignment){case`topleft`:return vec(0,0);case`top`:return vec(.5,0);case`topright`:return vec(1,0);case`left`:return vec(0,.5);case`center`:return vec(.5,.5);case`right`:return vec(1,.5);case`bottomleft`:default:return vec(0,1);case`bottom`:return vec(.5,1);case`bottomright`:return vec(1,1)}}getTileByGid(e){let R=Cc(e)-this.firstGid;return this.tiles.find((e=>e.id===R))}getTilesByClassName(e){return this.tiles.filter(lc(e))}getTilesByProperty(e,R,W=!0){return this.tiles.filter(gc(e,R,W))}getTilesByPropertyValueMatcher(e,R){return this.tiles.filter(dc(e,R))}getSpriteForGid(e){let R=pc(e),W=fc(e),Y=Bc(e),X=Cc(e),ie=X-this.firstGid;if(this.spritesheet){let e=this.spritesheet.sprites[ie];return(Y||R||W)&&(e=e.clone()),Y&&(e.rotation=-Math.PI/2,e.scale=vec(-1,1)),R&&(e.scale=vec((Y?1:-1)*e.scale.x,(Y?-1:1)*e.scale.y)),W&&(e.scale=vec((Y?-1:1)*e.scale.x,(Y?1:-1)*e.scale.y)),e}throw Error(`Tileset: [${this.name}] Could not find sprite for gid: [${e}] normalized gid: [${X}]`)}_isometricTiledCoordToWorld(e){let R=this.tileWidth,W=this.tileHeight/2,Y=e.y/W,X=e.x/W;return vec((X-Y)*R/2+0,(X+Y)*W/2)}getCollidersForGid(e,R){let{anchor:W,scale:Y,orientationOverride:X,offset:ie}={anchor:Oe.Zero,scale:Oe.One,offset:Oe.Zero,orientationOverride:void 0,...R},ae=X??this.orientation,le=this.getTileByGid(e),_e=[];if(le&&le.objects)for(let R of le.objects){if(R instanceof Fc){let W=R.points.map((e=>e.scale(Y)));W=this._applyFlipsToPoints(W,e),ae===`isometric`&&(W=W.map((e=>this._isometricTiledCoordToWorld(e)))),W=W.map((e=>e.add(ie)));let X=Ft.Polygon(W,Oe.Zero,!0);X.isConvex()?_e.push(X):_e.push(X.triangulate())}if(R instanceof zc){let W=R.width,X=R.height,le=R.anchor,ye=lt.fromDimension(W*Y.x,X*Y.y,le).getPoints().map((e=>e.rotate(toRadians(R.rotation)).add(vec(R.x,R.y))));ae===`isometric`&&(ye=ye.map((e=>this._isometricTiledCoordToWorld(e)))),ye=this._applyFlipsToPoints(ye,e),ye=ye.map((e=>e.add(ie)));let be=Ft.Polygon(ye);_e.push(be)}if(R instanceof xc){let e=vec(R.x,R.y);ae===`isometric`&&(e=this._isometricTiledCoordToWorld(e)),e=e.add(ie);let W=Math.min(R.width/2,R.height/2),X=Ft.Circle(W,e.scale(Y));_e.push(X)}}return _e}_applyFlipsToPoints(e,R){let W=pc(R),Y=fc(R);return Bc(R)&&(e=e.map((e=>this.diagonalFlipTransform.multiply(e)))),W&&(e=e.map((e=>this.horizontalFlipTransform.multiply(e)))),Y&&(e=e.map((e=>this.verticalFlipTransform.multiply(e)))),e}getAnimationForGid(e){let R=this.getTileByGid(e);if(R&&R.animation?.length){let e=[];for(let W of R.animation)e.push({graphic:this.getSpriteForGid(W.tileid+this.firstGid),duration:W.duration});return new Ht({frames:e,strategy:zt.Loop})}return null}},Oc=class{constructor(e,R,W){this.path=e,this.strict=!0,this.headless=!1,this.orientation=`orthogonal`,this.fileLoader=rc;let{fileLoader:Y,parser:X,pathMap:ie,imageLoader:ae,strict:le,headless:_e,orientation:ye}={...W};this.headless=_e??this.headless,this.orientation=ye??this.orientation,this.strict=le??this.strict,this.fileLoader=Y??this.fileLoader,this.imageLoader=ae??new Ec(An),this.parser=X??new Wl,this.firstGid=R,this.pathMap=ie}async load(){let e=this.path.includes(`.tsx`)?`xml`:`json`;try{let R=await this.fileLoader(this.path,e),W;if(W=e===`json`?this.strict?Ep.parse(R):R:this.parser.parseExternalTileset(R,this.strict),Ol(W)){let e=_c(this.path,W.image,this.pathMap),R=this.headless?void 0:this.imageLoader.getOrAdd(e);this.data=new Mc({name:W.name,tiledTileset:W,firstGid:this.firstGid,image:R})}if(Ul(W)){let e=this.headless?void 0:new Map;if(e){let R=[];if(W.tiles){for(let Y of W.tiles)if(Y.image){let W=_c(this.path,Y.image,this.pathMap),X=this.imageLoader.getOrAdd(W);e.set(Y,X),R.push(X)}}}W.firstgid=this.firstGid,this.data=new Mc({name:W.name,tiledTileset:W,firstGid:this.firstGid,tileToImage:e})}if(this.headless||await this.imageLoader.load(),this.data)return this.data}catch(e){throw console.error(`Could not load tileset at path ${this.path}`),e}throw Error(`No tileset at path ${this.path}`)}isLoaded(){return!!this.data}},Uc=class{constructor(e,R){this.templatePath=e,this.headless=!1,this.strict=!0,this.fileLoader=rc;let{fileLoader:W,parser:Y,pathMap:X,imageLoader:ie,strict:ae,headless:le}={...R};this.headless=le??this.headless,this.strict=ae??this.strict,this.fileLoader=W??this.fileLoader,this.imageLoader=ie??new Ec(An),this.parser=Y??new Wl,this.pathMap=X}isLoaded(){return!!this.data}async load(){let e=this.templatePath.includes(`.tx`)?`xml`:`json`;try{let R=await this.fileLoader(this.templatePath,e),W;W=e===`xml`?this.parser.parseExternalTemplate(R,this.strict):this.strict?kp.parse(R):R;let Y=W,X=Nc(W.object),ie;return W.tileset&&(ie=await new Oc(_c(this.templatePath,W.tileset.source,this.pathMap),W.tileset.firstgid,{headless:this.headless,strict:this.strict,fileLoader:this.fileLoader,imageLoader:this.imageLoader,parser:this.parser,pathMap:this.pathMap}).load()),this.data=new Tc({templatePath:this.templatePath,tiledTemplate:Y,object:X,tileset:ie})}catch(e){throw console.error(`Could not load template at ${this.templatePath}, check to see if your pathMap is correct or if you're Tiled map is corrupted`),e}}},Jc=class extends Component{constructor(e){super();let{tiledObject:R}=e;this.tiledObject=R}},Zc=class extends Component{constructor(e){super();let{tiledTileLayer:R}=e;this.tiledTileLayer=R}},qc=class{get isInfinite(){return this._isInfinite}constructor(e,R,W){this.tiledTileLayer=e,this.resource=R,this.order=W,this.logger=Je.getInstance(),this.width=0,this.height=0,this.properties=new Map,this.data=[],this._isInfinite=!1,this._tileToChunkData=new WeakMap,this._tileToChunkIndex=new WeakMap,this._gidToTileInfo=new Map,this.name=e.name,this.id=e.id,this.class=e.class,this.width=e.width,this.height=e.height,this.visible=!!e.visible,Qc(this,e.properties)}getTilesByProperty(e,R,W=!0){return this.isometricMap.tiles.filter((Y=>{let X=Y.data.get(Rp.TileData.Tiled);return!!X&&gc(e,R,W)(X)})).map((e=>({exTile:e,tiledTile:e.data.get(Rp.TileData.Tiled)})))}getTilesByPropertyValueMatcher(e,R){return this.isometricMap.tiles.filter((W=>{let Y=W.data.get(Rp.TileData.Tiled);return!!Y&&dc(e,R)(Y)})).map((e=>({exTile:e,tiledTile:e.data.get(Rp.TileData.Tiled)})))}getTilesByGid(e){return this._gidToTileInfo.get(e)??[]}getTilesByClassName(e){return this.isometricMap.tiles.filter((R=>{let W=R.data.get(Rp.TileData.Tiled);return!!W&&lc(e)(W)})).map((e=>({exTile:e,tiledTile:e.data.get(Rp.TileData.Tiled)})))}_getGidForTile(e){let R=0;if(this._isInfinite){let W=this._tileToChunkData.get(e);if(W===void 0)throw Error(`Missing chunk data for excalibur tile`);let Y=this._tileToChunkIndex.get(e);if(Y===void 0)throw Error(`Missing chunk index for excalibur tile`);R=Cc(W[Y])}else{let W=this.isometricMap.tiles.indexOf(e);R=Cc(this.data[W])}return R}getTileByPoint(e){if(!this.isometricMap)return this.logger.warn(`IsometricMap has not yet been loaded! getTileByPoint() will only return null`),null;if(this.isometricMap){let R=this.isometricMap.getTileByPoint(e);if(!R)return null;let W=this._getGidForTile(R),Y;return W>0&&(Y=this.resource.getTilesetForTileGid(W).getTileByGid(W)),{tiledTile:Y,exTile:R}}return null}getTileByCoordinate(e,R){if(!this.isometricMap)return this.logger.warn(`IsometricMap has not yet been loaded! getTileByCoordinate() will only return null`),null;if(this.isometricMap){let W=this.isometricMap.getTile(e,R),Y=this._getGidForTile(W),X;return Y>0&&(X=this.resource.getTilesetForTileGid(Y).getTileByGid(Y)),{tiledTile:X,exTile:W}}return null}_recordTileData(e,R){let W=this._gidToTileInfo.get(e),Y=this.resource.getTilesetForTileGid(e).getTileByGid(e);W?W.push({exTile:R,tiledTile:Y}):W=[{exTile:R,tiledTile:Y}],this._gidToTileInfo.set(e,W),R.data.set(Rp.TileData.Tiled,Y)}updateTile(e,R,W,Y,X){this._recordTileData(R,e);let ie=this.resource.getLayerConfig(this.name)||this.resource.getLayerConfig(this.id);ie?.isSolid!==void 0&&(X=ie.isSolid),this.resource.useExcaliburWiring&&X&&(e.solid=!0);let ae=e.get(IsometricEntityComponent);ae&&(ae.elevation=this.order);let le=this.resource.getTilesetForTileGid(R),_e=le.getSpriteForGid(R);W&&(_e=_e.clone(),_e.tint=Y),e.addGraphic(_e,{offset:le.tileOffset});let ye=e.pos;if(le.orientation===`orthogonal`)ye=vec(0,0);else{let e=this.resource.map.tilewidth/2,R=this.resource.map.tileheight;ye=vec(e,R)}let be=le.getCollidersForGid(R,{offset:ye});for(let R of be)e.addCollider(R);ie!=null&&ie.useTileColliders&&be.length>0&&this.visible&&(e.solid=!0),ie!=null&&ie.useTileCollidersWhenInvisible&&be.length>0&&(e.solid=!0);let Ce=le.getAnimationForGid(R);if(Ce&&(W&&(Ce=Ce.clone(),Ce.tint=Y),e.clearGraphics(),e.addGraphic(Ce,{offset:le.tileOffset}),this.resource.useExcaliburWiring)){let e=le.getTileByGid(R)?.properties.get(Rp.Animation.Strategy);if(e&&typeof e==`string`)switch(e.toLowerCase()){case zt.End.toLowerCase():Ce.strategy=zt.End;break;case zt.Freeze.toLowerCase():Ce.strategy=zt.Freeze;break;case zt.Loop.toLowerCase():Ce.strategy=zt.Loop;break;case zt.PingPong.toLowerCase():Ce.strategy=zt.PingPong;break;default:this.logger.warn(`Unknown animation strategy in tileset ${le.name} on tile gid ${R}: ${e}`)}}}async load(){let e=this.resource.getLayerConfig(this.name)||this.resource.getLayerConfig(this.id),R=this.tiledTileLayer,W=!!this.properties.get(Rp.Layer.Solid),Y=(this.tiledTileLayer.opacity,!!this.tiledTileLayer.tintcolor),X=this.tiledTileLayer.tintcolor?We.fromHex(this.tiledTileLayer.tintcolor):We.Transparent,ie=vec(R.offsetx??0,R.offsety??0);this.tiledTileLayer.data&&kl(this.tiledTileLayer)?this.data=await oc.decode(this.tiledTileLayer.data,this.tiledTileLayer.compression):this.tiledTileLayer.data&&Dl(this.tiledTileLayer)&&(this.data=this.tiledTileLayer.data);let ae=this.order,le=this.properties.get(Rp.ZIndex.ZIndex);if(typeof le==`number`&&(ae=le),this.resource.map.infinite&&Hl(this.tiledTileLayer)){let W=this.resource.isometricTiledCoordToWorld(this.tiledTileLayer.startx,this.tiledTileLayer.starty),Y=vec(W.x*this.resource.map.tilewidth,W.y*this.resource.map.tileheight);this.isometricMap=new IsometricMap({name:this.name,pos:ie.add(Y),tileHeight:this.resource.map.tileheight,tileWidth:this.resource.map.tilewidth,columns:R.width,rows:R.height,elevation:ae}),e?.collisionGroup&&(this.isometricMap.get(Ti).group=e.collisionGroup)}else this.isometricMap=new IsometricMap({name:this.name,pos:ie,tileWidth:this.resource.map.tilewidth,tileHeight:this.resource.map.tileheight,columns:R.width,rows:R.height,elevation:ae}),e?.collisionGroup&&(this.isometricMap.get(Ti).group=e.collisionGroup);if(this.isometricMap.visible=this.tiledTileLayer.visible,this.isometricMap.opacity=this.tiledTileLayer.opacity,this.isometricMap.addComponent(new Zc({tiledTileLayer:R})),R.parallaxx||R.parallaxy){let e=vec(R.parallaxx??1,R.parallaxy??1);this.isometricMap.addComponent(new ParallaxComponent(e))}if(this.resource.map.infinite&&Hl(this.tiledTileLayer)){this._isInfinite=!0;let e=this.tiledTileLayer;for(let ie of this.tiledTileLayer.chunks){let ae=[];kl(this.tiledTileLayer)?ae=await oc.decode(ie.data,e.compression):Dl(this.tiledTileLayer)&&(ae=ie.data);for(let e=0;e<ae.length;e++){let le=ae[e],_e=e%ie.width+(ie.x-this.tiledTileLayer.startx),ye=Math.floor(e/ie.width)+(ie.y-this.tiledTileLayer.starty),be=this.isometricMap.tiles[_e+ye*R.width];this._tileToChunkData.set(be,ae),this._tileToChunkIndex.set(be,e),le!=0&&this.updateTile(be,le,Y,X,W)}}}else for(let e=0;e<this.data.length;e++){let R=this.data[e];if(R!==0){let ie=this.isometricMap.tiles[e];this.updateTile(ie,R,Y,X,W)}}}},jc=class{get isInfinite(){return this._isInfinite}getTilesByProperty(e,R,W=!0){return this.tilemap.tiles.filter((Y=>{let X=Y.data.get(Rp.TileData.Tiled);return!!X&&gc(e,R,W)(X)})).map((e=>({exTile:e,tiledTile:e.data.get(Rp.TileData.Tiled)})))}getTilesByPropertyValueMatcher(e,R){return this.tilemap.tiles.filter((W=>{let Y=W.data.get(Rp.TileData.Tiled);return!!Y&&dc(e,R)(Y)})).map((e=>({exTile:e,tiledTile:e.data.get(Rp.TileData.Tiled)})))}getTilesByGid(e){return this._gidToTileInfo.get(e)??[]}getTilesByClassName(e){return this.tilemap.tiles.filter((R=>{let W=R.data.get(Rp.TileData.Tiled);return!!W&&lc(e)(W)})).map((e=>({exTile:e,tiledTile:e.data.get(Rp.TileData.Tiled)})))}_getGidForTile(e){let R=0;if(this._isInfinite){let W=this._tileToChunkData.get(e);if(W===void 0)throw Error(`Missing chunk data for excalibur tile (${e.x}, ${e.y})`);let Y=this._tileToChunkIndex.get(e);if(Y===void 0)throw Error(`Missing chunk index for excalibur tile (${e.x}, ${e.y})`);R=Cc(W[Y])}else{let W=this.tilemap.tiles.indexOf(e);R=Cc(this.data[W])}return R}getTileByPoint(e){if(!this.tilemap)return this.logger.warn(`Tilemap has not yet been loaded! getTileByPoint() will only return null`),null;if(this.tilemap){let R=this.tilemap.getTileByPoint(e);if(!R)return null;let W=this._getGidForTile(R),Y;return W>0&&(Y=this.resource.getTilesetForTileGid(W).getTileByGid(W)),{tiledTile:Y,exTile:R}}return null}getTileByCoordinate(e,R){if(!this.tilemap)return this.logger.warn(`Tilemap has not yet been loaded! getTileByCoordinate() will only return null`),null;if(this.tilemap){let W=this.tilemap.getTile(e,R),Y=this._getGidForTile(W),X;return Y>0&&(X=this.resource.getTilesetForTileGid(Y).getTileByGid(Y)),{tiledTile:X,exTile:W}}return null}constructor(e,R,W){this.tiledTileLayer=e,this.resource=R,this.order=W,this.logger=Je.getInstance(),this.width=0,this.height=0,this.properties=new Map,this.data=[],this._gidToTileInfo=new Map,this._isInfinite=!1,this._tileToChunkData=new Map,this._tileToChunkIndex=new Map,this.name=e.name,this.id=e.id,this.class=e.class,this.width=e.width,this.height=e.height,this.visible=!!e.visible,Qc(this,e.properties)}_recordTileData(e,R){let W=this._gidToTileInfo.get(e),Y=this.resource.getTilesetForTileGid(e).getTileByGid(e);W?W.push({exTile:R,tiledTile:Y}):W=[{exTile:R,tiledTile:Y}],this._gidToTileInfo.set(e,W),R.data.set(Rp.TileData.Tiled,Y)}updateTile(e,R,W,Y,X){this._recordTileData(R,e);let ie=this.resource.getLayerConfig(this.name)||this.resource.getLayerConfig(this.id);ie?.isSolid!==void 0&&(X=ie.isSolid),this.resource.useExcaliburWiring&&X&&this.visible&&(e.solid=!0);let ae=this.resource.getTilesetForTileGid(R),le=this.resource.headless;if(!le){let X=ae.getSpriteForGid(R);W&&(X=X.clone(),X.tint=Y),e.addGraphic(X,{offset:ae.tileOffset})}let _e=ae.getCollidersForGid(R);for(let R of _e)e.addCollider(R);ie!=null&&ie.useTileColliders&&_e.length>0&&this.visible&&(e.solid=!0),ie!=null&&ie.useTileCollidersWhenInvisible&&_e.length>0&&(e.solid=!0);let ye=le?null:ae.getAnimationForGid(R);if(ye&&(W&&(ye=ye.clone(),ye.tint=Y),e.clearGraphics(),e.addGraphic(ye,{offset:ae.tileOffset}),this.resource.useExcaliburWiring)){let e=ae.getTileByGid(R)?.properties.get(Rp.Animation.Strategy);if(e&&typeof e==`string`)switch(e.toLowerCase()){case zt.End.toLowerCase():ye.strategy=zt.End;break;case zt.Freeze.toLowerCase():ye.strategy=zt.Freeze;break;case zt.Loop.toLowerCase():ye.strategy=zt.Loop;break;case zt.PingPong.toLowerCase():ye.strategy=zt.PingPong;break;default:this.logger.warn(`Unknown animation strategy in tileset ${ae.name} on tile gid ${R}: ${e}`)}}}async load(){let e=this.resource.getLayerConfig(this.name)||this.resource.getLayerConfig(this.id),R=this.tiledTileLayer.opacity,W=!!this.tiledTileLayer.tintcolor,Y=this.tiledTileLayer.tintcolor?We.fromHex(this.tiledTileLayer.tintcolor):We.Transparent,X=!!this.properties.get(Rp.Layer.Solid),ie=this.tiledTileLayer,ae=vec(ie.offsetx??0,ie.offsety??0);if(this.tiledTileLayer.data&&kl(this.tiledTileLayer)?this.data=await oc.decode(this.tiledTileLayer.data,this.tiledTileLayer.compression):this.tiledTileLayer.data&&Dl(this.tiledTileLayer)&&(this.data=this.tiledTileLayer.data),this.resource.map.infinite&&Hl(this.tiledTileLayer)){let R=vec(this.tiledTileLayer.startx*this.resource.map.tilewidth,this.tiledTileLayer.starty*this.resource.map.tileheight);this.tilemap=new TileMap({name:this.name,pos:ae.add(R),tileHeight:this.resource.map.tileheight,tileWidth:this.resource.map.tilewidth,columns:ie.width,rows:ie.height}),e?.collisionGroup&&(this.tilemap.get(Ti).group=e.collisionGroup)}else this.tilemap=new TileMap({name:this.name,pos:ae,tileWidth:this.resource.map.tilewidth,tileHeight:this.resource.map.tileheight,columns:ie.width,rows:ie.height}),e?.collisionGroup&&(this.tilemap.get(Ti).group=e.collisionGroup);this.tilemap.addComponent(new Zc({tiledTileLayer:ie}));let le=this.tilemap.get(Xe);if(le){le.z=this.order;let e=this.properties.get(Rp.ZIndex.ZIndex);typeof e==`number`&&(le.z=e)}let _e=this.tilemap.get(fi);if(_e&&(_e.isVisible=this.tiledTileLayer.visible,_e.opacity=R),ie.parallaxx||ie.parallaxy){let e=vec(ie.parallaxx??1,ie.parallaxy??1);this.tilemap.addComponent(new ParallaxComponent(e))}if(this.resource.map.infinite&&Hl(this.tiledTileLayer)){this._isInfinite=!0;let e=this.tiledTileLayer;for(let R of this.tiledTileLayer.chunks){let ae=[];kl(this.tiledTileLayer)?ae=await oc.decode(R.data,e.compression):Dl(this.tiledTileLayer)&&(ae=R.data);for(let e=0;e<ae.length;e++){let le=ae[e],_e=e%R.width+(R.x-this.tiledTileLayer.startx),ye=Math.floor(e/R.width)+(R.y-this.tiledTileLayer.starty),be=this.tilemap.tiles[_e+ye*ie.width];this._tileToChunkData.set(be,ae),this._tileToChunkIndex.set(be,e),le!==0&&this.updateTile(be,le,W,Y,X)}}}else for(let e=0;e<this.data.length;e++){let R=this.data[e];if(R!==0){let ie=this.tilemap.tiles[e];this.updateTile(ie,R,W,Y,X)}}}},Yc=class{constructor(e,R,W){this.tiledObjectLayer=e,this.resource=R,this.order=W,this.logger=Je.getInstance(),this.properties=new Map,this.objects=[],this.entities=[],this._objectToEntity=new Map,this._entityToObject=new Map,this._loaded=!1,this.name=e.name,this.class=e.class,Qc(this,e.properties)}_logLoadedWarning(e){this.logger.warn(`ObjectLayer ${this.name} is not yet loaded, ${e}() will always be empty!`)}getObjectsByName(e){return this._loaded||this._logLoadedWarning(`getObjectsByName`),this.objects.filter(ac(e))}getEntitiesByName(e){return this._loaded||this._logLoadedWarning(`getEntitiesByName`),this.entities.filter(ac(e))}getEntityByObject(e){return this._loaded||this._logLoadedWarning(`getEntityByObject`),this._objectToEntity.get(e)}getObjectByEntity(e){return this._loaded||this._logLoadedWarning(`getObjectByEntity`),this._entityToObject.get(e)}getObjectsByProperty(e,R,W=!0){return this._loaded||this._logLoadedWarning(`getObjectsByProperty`),this.objects.filter(gc(e,R,W))}getObjectsByPropertyValueMatcher(e,R){return this._loaded||this._logLoadedWarning(`getObjectsByPropertyValueMatcher`),this.objects.filter(dc(e,R))}getEntitiesByProperty(e,R,W=!0){return this._loaded||this._logLoadedWarning(`getEntitiesByProperty`),this.getObjectsByProperty(e,R,W).map((e=>this._objectToEntity.get(e))).filter((e=>!!e))}getEntitiesByPropertyValueMatcher(e,R){return this._loaded||this._logLoadedWarning(`getEntitiesByPropertyValueMatcher`),this.getObjectsByProperty(e,R).map((e=>this._objectToEntity.get(e))).filter((e=>!!e))}getObjectsByClassName(e){return this._loaded||this._logLoadedWarning(`getObjectsByClassName`),this.objects.filter(lc(e))}getEntitiesByClassName(e){return this._loaded||this._logLoadedWarning(`getEntitiesByClassName`),this.getObjectsByClassName(e).map((e=>this._objectToEntity.get(e))).filter((e=>!!e))}getTemplates(){return this._loaded||this._logLoadedWarning(`getTemplates`),this.objects.filter((e=>e instanceof bc))}runFactory(e){let R=vec(this.tiledObjectLayer.offsetx??0,this.tiledObjectLayer.offsety??0),W=this.objects.slice();for(let Y of W){let W=Y.class;if(Y instanceof bc&&(W||=Y.template.object.class),e!==W)continue;let X=vec((Y.x??0)+R.x,(Y.y??0)+R.y);this.resource.map.orientation===`isometric`&&(X=this.resource.isometricTiledCoordToWorld(X.x,X.y));let ie=this.resource.factories.get(e);if(ie){let e=ie({worldPos:X,name:Y.name,class:W,layer:this,object:Y,properties:Y.properties});e&&this._recordObjectEntityMapping(Y,e)}}}_actorFromObject(e,R,W){let Y=this.resource.headless,X=!!this.tiledObjectLayer.tintcolor,ie=this.tiledObjectLayer.tintcolor?We.fromHex(this.tiledObjectLayer.tintcolor):We.White;if(e instanceof kc&&W){let ae=this.resource.map.orientation===`isometric`&&W.orientation===`orthogonal`?`bottom`:void 0,le=W.getTilesetAlignmentAnchor(ae);R.anchor=le;let _e=vec((e.tiledObject.width??W.tileWidth)/W.tileWidth,(e.tiledObject.width??W.tileWidth)/W.tileWidth);if(!Y){let Y=W.getSpriteForGid(e.gid).clone();Y.destSize.width=e.tiledObject.width??Y.width,Y.destSize.height=e.tiledObject.height??Y.height,X&&(Y.tint=ie),R.graphics.use(Y),R.graphics.offset=W.tileOffset;let ae=W.getAnimationForGid(e.gid);if(ae){let e=ae.clone();e.scale=_e,X&&(e.tint=ie),R.graphics.use(e),R.graphics.offset=W.tileOffset}}let ye=e.tiledObject.width??0,be=e.tiledObject.height??0,Ce=-ye*le.x,Te=-be*le.y,Ae=this.resource.map.tilewidth/2,Me=this.resource.map.tileheight,Pe=vec(Ce,Te);this.resource.map.orientation===`isometric`&&(Pe=vec(Ce+Ae,Te+Me),W.orientation===`orthogonal`&&(Pe=Pe.sub(vec(Ae,Me))));let Re=W.getCollidersForGid(e.gid,{anchor:Oe.Zero,scale:_e,offset:Pe});if(Re.length)R.collider.useCompositeCollider(Re);else{let W=e.width,Y=e.height;if(this.resource.map.orientation===`isometric`){let R=e.height/2;W=R,Y=R}let X=Ft.Box(W,Y,this.resource.map.orientation===`isometric`?vec(1,1):vec(0,1));this.resource.map.orientation===`isometric`&&(X.points=X.points.map((e=>this.resource.isometricTiledCoordToWorld(e.x,e.y)))),R.collider.set(X)}}if(e instanceof Sc&&R.graphics.use(e.text),e instanceof Fc){let W=vec(e.x,e.y),Y=e.localPoints;this.resource.map.orientation===`isometric`&&(W=this.resource.isometricTiledCoordToWorld(W.x,W.y),Y=Y.map((e=>this.resource.isometricTiledCoordToWorld(e.x,e.y)))),R.anchor=vec(0,1),R.pos=W;let X=Ft.Polygon(Y,Oe.Zero,!0);X.isConvex()?R.collider.set(X):R.collider.set(X.triangulate())}if(e instanceof zc){R.anchor=e.anchor;let W=Ft.Box(e.width,e.height,e.anchor);this.resource.map.orientation===`isometric`&&(W.points=W.points.map((e=>this.resource.isometricTiledCoordToWorld(e.x,e.y)))),R.collider.set(W)}e instanceof xc&&R.collider.useCircleCollider(Math.min(e.width,e.height)/2)}async load(){let e=this.tiledObjectLayer.opacity,R=vec(this.tiledObjectLayer.offsetx??0,this.tiledObjectLayer.offsety??0),W=Gc(this.tiledObjectLayer,this.resource);for(let Y of W){let W=vec((Y.x??0)+R.x,(Y.y??0)+R.y);this.resource.map.orientation===`isometric`&&(W=this.resource.isometricTiledCoordToWorld(W.x,W.y));let X,ie=Y.class;if(Y instanceof bc&&(ie||=Y.template.object.class),ie){let e=this.resource.factories.get(ie);if(e){let R=e({worldPos:W,name:Y.name,class:ie,layer:this,object:Y,properties:Y.properties});R&&this._recordObjectEntityMapping(Y,R);continue}}let ae=this.properties.get(Rp.ZIndex.ZIndex);typeof ae==`number`&&(X=ae);let le=new _i({name:Y.tiledObject.name,pos:W,anchor:Oe.Zero,rotation:toRadians(Y.tiledObject.rotation??0),z:X}),_e=le.get(fi);if(_e&&(_e.visible=this.tiledObjectLayer.visible&&(Y.tiledObject.visible===void 0||!!Y.tiledObject.visible),_e.opacity=e),this.resource.map.orientation===`isometric`){let e=new IsometricEntityComponent({rows:this.resource.map.height,columns:this.resource.map.width,tileWidth:this.resource.map.tilewidth,tileHeight:this.resource.map.tileheight});e.elevation=X??this.order,le.addComponent(e)}if(this.resource.useExcaliburWiring){let e=Y.properties.get(Rp.Collision.Type);if(e&&typeof e==`string`)switch(e.toLowerCase()){case Ye.Active.toLowerCase():le.body.collisionType=Ye.Active;break;case Ye.Fixed.toLowerCase():le.body.collisionType=Ye.Fixed;break;case Ye.Passive.toLowerCase():le.body.collisionType=Ye.Passive;break;case Ye.PreventCollision.toLowerCase():le.body.collisionType=Ye.PreventCollision;break;default:this.logger.warn(`Unknown collision type in layer ${this.name}, for object id ${Y.id} and name ${Y.name}: ${e}`)}}if(Y instanceof bc){let e=Y.template.tileset,R=Y.template.object;R&&(Y.gid&&R instanceof kc&&(e=this.resource.getTilesetForTileGid(Y.gid),R=new kc(R.tiledObject,Y.gid,R.width,R.height)),this._actorFromObject(R,le,e))}else{let e;Y instanceof kc&&(e=this.resource.getTilesetForTileGid(Y.gid)),this._actorFromObject(Y,le,e)}this._recordObjectEntityMapping(Y,le)}this._loaded=!0}_recordObjectEntityMapping(e,R){R.addComponent(new Jc({tiledObject:e})),this.objects.push(e),this.entities.push(R),this._objectToEntity.set(e,R),this._entityToObject.set(R,e)}};const zp=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,Pc=e=>{if(typeof e!=`string`)throw TypeError(`Invalid argument expected string`);let R=e.match(zp);if(!R)throw Error(`Invalid argument not valid semver ('${e}' received)`);return R.shift(),R},$c=e=>e===`*`||e===`x`||e===`X`,Kc=e=>{let R=parseInt(e,10);return isNaN(R)?e:R},Wc=(e,R)=>{if($c(e)||$c(R))return 0;let[W,Y]=((e,R)=>typeof e==typeof R?[e,R]:[String(e),String(R)])(Kc(e),Kc(R));return W>Y?1:W<Y?-1:0},Vc=(e,R)=>{for(let W=0;W<Math.max(e.length,R.length);W++){let Y=Wc(e[W]||`0`,R[W]||`0`);if(Y!==0)return Y}return 0},Xc=(e,R,W)=>{Ag(W);let Y=((e,R)=>{let W=Pc(e),Y=Pc(R),X=W.pop(),ie=Y.pop(),ae=Vc(W,Y);return ae===0?X&&ie?Vc(X.split(`.`),ie.split(`.`)):X||ie?X?-1:1:0:ae})(e,R);return Bp[W].includes(Y)},Bp={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},Vp=Object.keys(Bp),Ag=e=>{if(typeof e!=`string`)throw TypeError(`Invalid operator type, expected string but got `+typeof e);if(Vp.indexOf(e)===-1)throw Error(`Invalid operator, expected one of ${Vp.join(`|`)}`)};var ig=class{constructor(e,R,W){this.tiledImageLayer=e,this.resource=R,this.order=W,this.properties=new Map,this.image=null,this.imageActor=null,this.name=e.name,this.class=e.class,Qc(this,e.properties),e.image&&(this.image=new An(_c(this.resource.path,e.image,this.resource.pathMap)))}async load(){let e=this.tiledImageLayer.opacity,R=!!this.tiledImageLayer.tintcolor,W=this.tiledImageLayer.tintcolor?We.fromHex(this.tiledImageLayer.tintcolor):We.White,Y=vec(this.tiledImageLayer.offsetx??0,this.tiledImageLayer.offsety??0),X=this.tiledImageLayer.parallaxx??1,ie=this.tiledImageLayer.parallaxy??1;if(this.image){this.resource.headless||await this.image.load(),this.imageActor=new _i({name:this.tiledImageLayer.name,pos:Y,anchor:Oe.Zero,z:this.order}),this.imageActor.addComponent(new ParallaxComponent(vec(X,ie)));let ae=this.image.toSprite();this.imageActor.graphics.use(ae),this.imageActor.graphics.visible=this.tiledImageLayer.visible,this.imageActor.graphics.opacity=e,R&&(ae.tint=W)}}},Hp=class ng{constructor(e,R){this.path=e,this.logger=Je.getInstance(),this.tilesets=[],this.templates=[],this.layers=[],this.mapFormat=`TMX`,this.strict=!0,this.factories=new Map,this.parser=new Wl,this.fileLoader=rc,this.startZIndex=0,this.textQuality=4,this.useExcaliburWiring=!0,this.useMapBackgroundColor=!1,this.useTilemapCameraStrategy=!1,this.headless=!1,this.layerConfig={},this._imageLoader=new Ec(An),this._tilesetLoader=new Ec(Oc),this._templateLoader=new Ec(Uc);let{mapFormatOverride:W,textQuality:Y,entityClassNameFactories:X,useExcaliburWiring:ie,useTilemapCameraStrategy:ae,useMapBackgroundColor:le,layerConfig:_e,pathMap:ye,fileLoader:be,strict:Ce,headless:Te,startZIndex:Oe}={...R};this.strict=Ce??this.strict,this.headless=Te??this.headless,this.useExcaliburWiring=ie??this.useExcaliburWiring,this.useTilemapCameraStrategy=ae??this.useTilemapCameraStrategy,this.useMapBackgroundColor=le??this.useMapBackgroundColor,this.layerConfig=_e??this.layerConfig,this.textQuality=Y??this.textQuality,this.startZIndex=Oe??this.startZIndex,this.fileLoader=be??this.fileLoader,this.pathMap=ye;for(let e in X)this.registerEntityFactory(e,X[e]);this.mapFormat=W??(e.includes(`.tmx`)?`TMX`:`TMJ`)}registerEntityFactory(e,R){if(this.factories.has(e)&&console.warn(`Another factory has already been registered for tiled class/type "${e}", this is probably a bug.`),this.factories.set(e,R),this.isLoaded())for(let R of this.getObjectLayers())R.runFactory(e)}unregisterEntityFactory(e){this.factories.has(e)||console.warn(`No factory has been registered for tiled class/type "${e}", cannot unregister!`),this.factories.delete(e)}getLayerConfig(e){return this.layerConfig[e]}getTilesetForTileGid(e){let R=Cc(e);if(this.tilesets){for(let e of this.tilesets)if(R>=e.firstGid&&R<=e.firstGid+e.tileCount-1)return e}throw Error(`No tileset exists for tiled gid [${e}] normalized [${R}]!`)}getTilesetByName(e){return this.tilesets.filter(ac(e))}getTilesetByClassName(e){return this.tilesets.filter(lc(e))}getTilesetByProperty(e,R){return this.tilesets.filter(gc(e,R))}getTileMetadataByClassName(e){let R=[];for(let W of this.tilesets)R=R.concat(W.tiles.filter(lc(e)));return R}getTileMetadataByProperty(e,R){let W=[];for(let Y of this.tilesets)W=W.concat(Y.tiles.filter(gc(e,R)));return W}getTilesByGid(e){if(this.map.orientation===`orthogonal`){let R=[];for(let W of this.getTileLayers())R=R.concat(W.getTilesByGid(e));return R}{let R=[];for(let W of this.getIsoTileLayers())R=R.concat(W.getTilesByGid(e));return R}}getTilesByClassName(e){if(this.map.orientation===`orthogonal`){let R=[];for(let W of this.getTileLayers())R=R.concat(W.getTilesByClassName(e));return R}{let R=[];for(let W of this.getIsoTileLayers())R=R.concat(W.getTilesByClassName(e));return R}}getTilesByProperty(e,R){if(this.map.orientation===`orthogonal`){let W=[];for(let Y of this.getTileLayers())W=W.concat(Y.getTilesByProperty(e,R));return W}{let W=[];for(let Y of this.getIsoTileLayers())W=W.concat(Y.getTilesByProperty(e,R));return W}}getTileByPoint(e,R){if(this.map.orientation===`isometric`){let W=this.getIsoTileLayers().find(ac(e));if(W)return W.getTileByPoint(R)}else{let W=this.getTileLayers().find(ac(e));if(W)return W.getTileByPoint(R)}return null}getTileByCoordinate(e,R,W){if(this.map.orientation===`isometric`){let Y=this.getIsoTileLayers().find(ac(e));if(Y)return Y.getTileByCoordinate(R,W)}else{let Y=this.getTileLayers().find(ac(e));if(Y)return Y.getTileByCoordinate(R,W)}return null}getTilesByPoint(e){if(this.map.orientation===`orthogonal`){let R=[];for(let W of this.getTileLayers()){let Y=W.getTileByPoint(e);Y&&R.push(Y)}return R}{let R=[];for(let W of this.getIsoTileLayers()){let Y=W.getTileByPoint(e);Y&&R.push(Y)}return R}}getTilesByCoordinate(e,R){if(this.map.orientation===`orthogonal`){let W=[];for(let Y of this.getTileLayers()){let X=Y.getTileByCoordinate(e,R);X&&W.push(X)}return W}{let W=[];for(let Y of this.getIsoTileLayers()){let X=Y.getTileByCoordinate(e,R);X&&W.push(X)}return W}}getObjectsByName(e){let R=[];for(let W of this.getObjectLayers())R=R.concat(W.getObjectsByName(e));return R}getEntitiesByName(e){let R=[];for(let W of this.getObjectLayers())R=R.concat(W.getEntitiesByName(e));return R}getEntityByObject(e){for(let R of this.getObjectLayers()){let W=R.getEntityByObject(e);if(W)return W}}getObjectByEntity(e){for(let R of this.getObjectLayers()){let W=R.getObjectByEntity(e);if(W)return W}}getObjectsByProperty(e,R){let W=[];for(let Y of this.getObjectLayers())W=W.concat(Y.getObjectsByProperty(e,R));return W}getEntitiesByProperty(e,R){let W=[];for(let Y of this.getObjectLayers())W=W.concat(Y.getEntitiesByProperty(e,R));return W}getObjectsByClassName(e){let R=[];for(let W of this.getObjectLayers())R=R.concat(W.getObjectsByClassName(e));return R}getEntitiesByClassName(e){let R=[];for(let W of this.getObjectLayers())R=R.concat(W.getEntitiesByClassName(e));return R}getImageLayers(e){let R=this.layers.filter((e=>e instanceof ig));return e?R.filter(ac(e)):R}getTileLayers(e){let R=this.layers.filter((e=>e instanceof jc));return e?R.filter(ac(e)):R}getIsoTileLayers(e){let R=this.layers.filter((e=>e instanceof qc));return e?R.filter(ac(e)):R}getObjectLayers(e){let R=this.layers.filter((e=>e instanceof Yc));return e?R.filter(ac(e)):R}getLayersByName(e){return this.layers.filter(ac(e))}getLayersByClassName(e){return this.layers.filter(lc(e))}getLayersByProperty(e,R){return this.layers.filter(gc(e,R))}_parseMap(e){return this.mapFormat===`TMX`?this.parser.parse(e,this.strict):e}async load(){let e=await this.fileLoader(this.path,this.mapFormat===`TMX`?`xml`:`json`),R;if(this.strict)try{R=this._parseMap(e)}catch(e){throw console.error(`Could not parse tiled map from location ${this.path}, attempted to interpret as ${this.mapFormat}.\nExcalibur only supports the latest version of Tiled formats as of the plugin's release.`),console.error(`Is your map file corrupted or being interpreted as the wrong type?`),e}else R=this._parseMap(e);Xc(ng.supportedTiledVersion,R.tiledversion??`0.0.0`,`>`)&&console.warn(`The excalibur tiled plugin officially supports ${ng.supportedTiledVersion}+, the current map has tiled version ${R.tiledversion}`),this.map=R,this._collectTilesets(),this._collectTemplates(),await Promise.all([this._tilesetLoader.load(),this.headless?Promise.resolve():this._imageLoader.load(),this._templateLoader.load()]),this.tilesets=[...this.tilesets,...this._tilesetLoader.values().map((e=>e.data))],this.templates=this._templateLoader.values().map((e=>e.data));let W=[],Y=this.startZIndex;for(let e of this.map.layers){if(e.type===`tilelayer`){if(this.map.orientation===`isometric`){let R=new qc(e,this,Y);W.push(R)}if(this.map.orientation===`orthogonal`){let R=new jc(e,this,Y);W.push(R)}}if(e.type===`objectgroup`){let R=new Yc(e,this,Y);W.push(R)}if(e.type===`imagelayer`){let R=new ig(e,this,Y);W.push(R)}Y++}await Promise.all(W.map((e=>e.load()))),this.layers=W}_collectTilesets(){for(let e of this.map.tilesets){if(Pl(e)){if(Ol(e)){let R=_c(this.path,e.image,this.pathMap),W=this._imageLoader.getOrAdd(R),Y=new Mc({name:e.name,tiledTileset:e,image:W,firstGid:e.firstgid});this.tilesets.push(Y)}if(Ul(e)){let R=new Map;if(e.tiles){for(let W of e.tiles)if(W.image){let e=_c(this.path,W.image,this.pathMap),Y=this._imageLoader.getOrAdd(e);R.set(W,Y)}}let W=new Mc({name:e.name,tiledTileset:e,tileToImage:R,firstGid:e.firstgid});this.tilesets.push(W)}}if($l(e)){let R=_c(this.path,e.source,this.pathMap);this._tilesetLoader.getOrAdd(R,e.firstgid,{strict:this.strict,headless:this.headless,parser:this.parser,fileLoader:this.fileLoader,imageLoader:this._imageLoader,pathMap:this.pathMap})}}}_collectTemplates(){let e=[];for(let R of this.map.layers)if(R.type===`objectgroup`){let W=R.objects.filter((e=>e.template)).map((e=>e.template));e=e.concat(W)}let R=e.filter(((e,R,W)=>W.findIndex((R=>R===e))===R));for(let e of R){let R=_c(this.path,e,this.pathMap);this._templateLoader.getOrAdd(R,{strict:this.strict,headless:this.headless,parser:this.parser,fileLoader:this.fileLoader,imageLoader:this._imageLoader,pathMap:this.pathMap})}}addToScene(e,R){if(!this.isLoaded())return void this.logger.warn(`TiledResource ${this.path} is not loaded! Nothing will be wired into excalibur!`);let{pos:W}={pos:vec(0,0),...R};for(let R of this.layers){if(R instanceof jc&&(R.tilemap.pos=R.tilemap.pos.add(W),e.add(R.tilemap)),R instanceof qc&&e.add(R.isometricMap),R instanceof Yc)for(let Y of R.entities){let R=Y.get(Xe);R&&(R.pos=R.pos.add(W)),e.add(Y)}R instanceof ig&&R.imageActor&&(R.imageActor.pos=R.imageActor.pos.add(W),e.add(R.imageActor))}if(this.useExcaliburWiring){let R=this.getObjectsByProperty(Rp.Camera.Camera,!0);if(R&&R.length){let W=R[0],Y=1,X=W.properties.get(Rp.Camera.Zoom);X&&typeof X==`number`&&(Y=X),this.map.orientation===`isometric`?e.camera.pos=this.isometricTiledCoordToWorld(W.x,W.y):e.camera.pos=vec(W.x,W.y),e.camera.zoom=Y}}if(this.useTilemapCameraStrategy){let R=this.getTileLayers()[0];if(R){let Y=lt.fromDimension(this.map.width*this.map.tilewidth,this.map.height*this.map.tileheight,Oe.Zero,W.add(R.tilemap.pos));e.camera.strategy.limitCameraBounds(Y)}}this.useMapBackgroundColor&&this.map.backgroundcolor&&(e.backgroundColor=We.fromHex(this.map.backgroundcolor))}isometricTiledCoordToWorld(e,R){let W=this.map.tilewidth,Y=this.map.tileheight,X=R/Y,ie=e/Y;return vec((ie-X)*W/2+0,(ie+X)*Y/2)}isLoaded(){return!!this.map}};Hp.supportedTiledVersion=`1.10.1`;const Up={img:{player:new An(`/res/images/Player.png`),level1Background:new An(`/res/images/Forest_Background_0.png`),spiderGreen:new An(`/res/images/Spider_1.png`),spiderGray:new An(`/res/images/Spider_2.png`),birdPurple:new An(`/res/images/Bird_1.png`),birdOrange:new An(`/res/images/Bird_2.png`),platform:new An(`/res/images/Platform.png`),bouncepadGreen:new An(`/res/images/Bouncepad_Green.png`),bouncepadRed:new An(`/res/images/Bouncepad_Red.png`),bouncepadWood:new An(`/res/images/Bouncepad_Wood.png`),axe:new An(`/res/images/Axe_Trap.png`),circularSaw:new An(`/res/images/Circular_Saw.png`),smokePuff:new An(`/res/images/Smoke_Puff.png`),smokeLand:new An(`/res/images/Smoke_Land.png`),coin:new An(`/res/images/Coin.png`),coinsUi:new An(`/res/images/Coins_Ui.png`)},fonts:{round:new FontSource(`/res/fonts/Round9x13.ttf`,`Round9x13`,{filtering:Yt.Pixel,quality:4})},music:{stage1:new Sound(`/res/music/stage1.mp3`),stage2:new Sound(`/res/music/stage2.mp3`)},sfx:{jump:new Sound(`/res/sfx/jump.wav`),jumpSpring:new Sound(`/res/sfx/jump-spring.wav`),land:new Sound(`/res/sfx/land.wav`),turnAround:new Sound(`/res/sfx/turn-around.wav`),stomp:new Sound(`/res/sfx/stomp.wav`),damage:new Sound(`/res/sfx/damage.wav`),collectCoin:new Sound(`/res/sfx/coin.wav`)},tiled:{level1:new Hp(`/res/tilemaps/level1.tmx`,{useTilemapCameraStrategy:!0})}};var DevLoader=class extends Ii{showPlayButton(){return Promise.resolve()}draw(){}dispose(){}static __type=[()=>Ii,`showPlayButton`,`draw`,`dispose`,`DevLoader`,`P7!P"0"P"0#P"0$5w%`]};const Wp=new DevLoader;for(let e of Object.values(Up))for(let R of Object.values(e))Wp.addResource(R);function __assignType$19(e,R){return e.__type=R,e}__name(__assignType$19,`__assignType`);var OneWayCollisionComponent=class extends Component{type=`one-way-collision`;onAdd(e){let R=e.onPreCollisionResolve.bind(e);e.onPreCollisionResolve=__assignType$19((...e)=>{this.onPreCollisionResolve(...e),R(...e)},[`args`,``,`P"@2!"/"`])}onPreCollisionResolve(e,R,W,Y){if(!(R.owner instanceof _i))return;let X=R.owner.pos.sub(R.owner.oldPos),ie=R.bounds.bottom-X.y<e.bounds.top+1;if(W!==st.Top||!ie){Y.cancel();return}}static __type=[()=>Component,`type`,function(){return`one-way-collision`},`owner`,`onAdd`,`self`,`other`,`side`,`contact`,`onPreCollisionResolve`,`OneWayCollisionComponent`,`P7!&3">#P!2$$0%P!2&!2'!2(!2)$0*5w+`]};function __assignType$18(e,R){return e.__type=R,e}__name(__assignType$18,`__assignType`);const Gp=[`Ground`,()=>1,`Player`,()=>2,`Enemy`,()=>4,`Item`,()=>8,`PhysicalItem`,()=>16,`Hazard`,()=>32,`Climbable`,()=>64,`Category`,`PC!>"C#>$C%>&C'>(C)>*C+>,C->.Bw/`],Kp={Ground:new et(`ground`,1,collideWith(2,4,16)),Player:new et(`player`,2,collideWith(1,4,8,32,16,64)),Enemy:new et(`enemy`,4,collideWith(1,2)),Hazard:new et(`hazard`,32,collideWith(2)),Item:new et(`item`,8,collideWith(2)),PhysicalItem:new et(`phys-item`,16,collideWith(1,2)),Climbable:new et(`climbable`,64,collideWith(2))};function collideWith(...e){return e.reduce(__assignType$18((e,R)=>e|R,[`acc`,`cat`,``,`P"2!"2""/#`]),0)}collideWith.__type=[()=>Gp,`categories`,`collideWith`,`Pn!@2""/#`];var OneWayPlatform=class extends _i{constructor(e){super({...e,collisionType:Ye.Fixed,collisionGroup:Kp.Ground,anchor:vec(0,0),height:16}),this.addComponent(new OneWayCollisionComponent)}static __type=[()=>_i,`args`,`constructor`,`OneWayPlatform`,`P7!P!2""0#5w$`]};const qp=[`K`,`T`,`Record`,`l'e#"Rb!b"Pde"!N#!w#y`];function __assignType$17(e,R){return e.__type=R,e}__name(__assignType$17,`__assignType`);var AnimationComponent=class extends Component{type=`animation`;_animations;_speed=1;_frameDurations=(WeakMap.Ω=[[`!`],[`'`]],new WeakMap);constructor(e){super(),this._animations=e}set(e,R=0,W){let Y=this.owner.graphics.current,X=this._animations[e];this.is(e)||(R?X.goToFrame(R,W):X.reset(),Y&&(X.scale.setTo(Y.scale.x,Y.scale.y),X.opacity=Y.opacity),this.owner.graphics.use(X))}get(e){return this._animations[e]}set speed(e){this._speed=e,e!==0&&this.current.frames.forEach(__assignType$17(R=>{this._frameDurations.has(R)||this._frameDurations.set(R,R.duration??0),R.duration=this._frameDurations.get(R)/e},[`frame`,``,`P"2!"/"`]))}get speed(){return this._speed}get current(){return this.owner.graphics.current}is(e){return this.current===this.get(e)}static __type=[`Keys`,()=>Component,`graphics`,`owner`,`type`,function(){return`animation`},()=>qp,`_animations`,`_speed`,function(){return 1},`_frameDurations`,function(){return WeakMap.Ω=[[`!`],[`'`]],new WeakMap},()=>qp,`animations`,`constructor`,`name`,`startFromFrame`,`durationLeft`,`set`,`get`,`animation`,`is`,`AnimationComponent`,`b!P7"P!P!4#MK3$&3%>&e!!!o'#3(;'3);>*!3+;>,Pe"!!o-#2."0/Pe"!20"21'228"03Pe"!20"04!!Pe"!25"065w7`]};function __assignType$16(e,R){return e.__type=R,e}__name(__assignType$16,`__assignType`);var ControlsComponent=class extends Component{type=`input`;controls={Left:[Ui.Left,Hi.DpadLeft],Right:[Ui.Right,Hi.DpadRight],Up:[Ui.Up,Hi.DpadUp],Down:[Ui.Down,Hi.DpadDown],Jump:[Ui.A,Hi.Face1],Run:[Ui.S,Hi.Face3]};isHeld(e){let R=this.owner.scene.engine,[W,Y]=this.controls[e];return!!(R.input.keyboard.isHeld(W)||this.getGamepad()?.isButtonHeld(Y))}wasPressed(e){let R=this.owner.scene.engine,[W,Y]=this.controls[e];return!!(R.input.keyboard.wasPressed(W)||this.getGamepad()?.wasButtonPressed(Y))}wasReleased(e){let R=this.owner.scene.engine,[W,Y]=this.controls[e];return!!(R.input.keyboard.wasReleased(W)||this.getGamepad()?.wasButtonReleased(Y))}getGamepad(){let e=this.owner.scene.engine;return[e.input.gamepads.at(0),e.input.gamepads.at(1),e.input.gamepads.at(2),e.input.gamepads.at(3)].find(__assignType$16(e=>e.connected,[`g`,``,`P"2!"/"`]))}getHeldXDirection(){let e=this.owner.scene.engine;for(let R of e.input.keyboard.getKeys().slice().reverse()){if(this.controls.Left.includes(R))return`Left`;if(this.controls.Right.includes(R))return`Right`}if(this.getGamepad()){if(this.isHeld(`Left`))return`Left`;if(this.isHeld(`Right`))return`Right`}}getHeldYDirection(){let e=this.owner.scene.engine;for(let R of e.input.keyboard.getKeys().slice().reverse()){if(this.controls.Up.includes(R))return`Up`;if(this.controls.Down.includes(R))return`Down`}if(this.getGamepad()){if(this.isHeld(`Up`))return`Up`;if(this.isHeld(`Down`))return`Down`}}static __type=[()=>Component,`owner`,`type`,function(){return`input`},`controls`,function(){return{Left:[Ui.Left,Hi.DpadLeft],Right:[Ui.Right,Hi.DpadRight],Up:[Ui.Up,Hi.DpadUp],Down:[Ui.Down,Hi.DpadDown],Jump:[Ui.A,Hi.Face1],Run:[Ui.S,Hi.Face3]}},()=>this.controls,`control`,`isHeld`,()=>this.controls,`wasPressed`,()=>this.controls,`wasReleased`,`getGamepad`,`Left`,`Right`,`getHeldXDirection`,`Up`,`Down`,`getHeldYDirection`,`ControlsComponent`,`P7!!3"&3#>$!3%>&Pi'g2("0)Pi*g2("0+Pi,g2("0-P"0.PP./.0-J01PP.2.3-J045w5`]},ClimbableComponent=class extends Component{static __type=[()=>Component,`ClimbableComponent`,`P7!5w"`]};function __assignType$15(e,R){return e.__type=R,e}__name(__assignType$15,`__assignType`);const Jp=[`left`,`right`,`top`,`bottom`,`Side`,`P.!.".#.$Jw%y`];var TouchingComponent=class extends Component{type=`touching`;contacts=(Map.Ω=[[`&`],[`contact`,`actor`,()=>Jp,`side`,`P!4!!4"n#4$M`]],new Map);left=(Set.Ω=[[`!`]],new Set);right=(Set.Ω=[[`!`]],new Set);top=(Set.Ω=[[`!`]],new Set);bottom=(Set.Ω=[[`!`]],new Set);passives=(Set.Ω=[[`!`]],new Set);onAdd(e){e.on(`collisionstart`,__assignType$15(e=>{let R=e.other.owner;if(R)if(R.get(Ti)?.collisionType===Ye.Passive)this.passives.add(R);else{let W=e.side.toLowerCase();this.contacts.set(e.contact.id,{contact:e.contact,actor:R,side:W}),this.updateSides()}},[`ev`,``,`P"2!"/"`])),e.on(`collisionend`,__assignType$15(e=>{let R=e.other.owner;R?.get(Ti)?.collisionType===Ye.Passive?this.passives.delete(R):(this.contacts.delete(e.lastContact.id),this.updateSides())},[`ev`,``,`P"2!"/"`]))}updateSides(){this.left.clear(),this.right.clear(),this.top.clear(),this.bottom.clear();for(let{side:e,actor:R}of this.contacts.values())this[e].add(R)}get ladders(){return new Set(Array.from(this.passives).filter(__assignType$15(e=>e.has(ClimbableComponent),[`e`,``,`P"2!"/"`])))}static __type=[()=>Component,`type`,function(){return`touching`},`contacts`,function(){return Map.Ω=[[`&`],[`contact`,`actor`,()=>Jp,`side`,`P!4!!4"n#4$M`]],new Map},`left`,function(){return Set.Ω=[[`!`]],new Set},`right`,function(){return Set.Ω=[[`!`]],new Set},`top`,function(){return Set.Ω=[[`!`]],new Set},`bottom`,function(){return Set.Ω=[[`!`]],new Set},`passives`,function(){return Set.Ω=[[`!`]],new Set},`owner`,`onAdd`,`updateSides`,`TouchingComponent`,`P7!&3">#!3$;>%!3&>'!3(>)!3*>+!3,>-!3.>/P!20$01P"02;!5w3`]},CarrierComponent=class extends Component{type=`carrier`;onAdd(e){e.on(`collisionstart`,this.onCollisionStart.bind(this)),e.on(`collisionend`,this.onCollisionEnd.bind(this)),e.on(`initialize`,this.onInitialize.bind(this))}onInitialize(){let e=this.owner;e.once(`postupdate`,()=>{--e.pos.y,e.once(`preupdate`,()=>{e.pos.y+=1})})}onCollisionStart(e){let R=e.other.owner;R.get(CarriableComponent)?.canBeCarried&&e.side===st.Top&&!this.owner.children.includes(R)&&this.addChild(R)}onCollisionEnd(e){let R=e.other.owner;this.owner.children.includes(R)&&this.removeChild(R)}addChild(e){this.owner.addChild(e),e.pos.x-=this.owner.pos.x,e.pos.y-=this.owner.pos.y}removeChild(e){this.owner.removeChild(e),this.owner.scene.add(e),e.pos.x+=this.owner.pos.x,e.pos.y+=this.owner.pos.y}static __type=[()=>Component,`owner`,`type`,function(){return`carrier`},`onAdd`,`onInitialize`,`event`,`onCollisionStart`,`onCollisionEnd`,`actor`,`addChild`,`removeChild`,`CarrierComponent`,`P7!!3"&3#>$P!2"$0%P$0&P!2'$0(P!2'$0)P!2*"0+P!2*"0,5w-`]},CarriableComponent=class extends Component{canBeCarried=!0;static __type=[()=>Component,`owner`,`canBeCarried`,function(){return!0},`CarriableComponent`,`P7!!3")3#>$5w%`]};const Yp=[`T`,`K`,()=>Xp,()=>Zp,`Omit`,`b!b"e!!e!!ge!"o$#o##w%y`],Xp=[`T`,`K`,`Pick`,`l+e#!e"!fRb!b"Pde""N#!w#y`],Zp=[`T`,`U`,`Exclude`,`l6!Re$!RPe#!e$"qk#%QRb!b"Pde"!p)w#y`];function __assignType$14(e,R){return e.__type=R,e}__name(__assignType$14,`__assignType`);var PhysicsActor=class extends _i{touching=new TouchingComponent;isOnGround=!1;_oldPosGlobal=vec(0,0);_ray1=new Ray(vec(0,0),vec(1,0));_ray2=new Ray(vec(0,0),vec(1,0));constructor(e){super(e),this.addComponent(new CarriableComponent)}onInitialize(e){this.addComponent(this.touching),this.on(`preupdate`,()=>{this.isOnGround=this.touching.bottom.size>0}),this.on(`postupdate`,()=>{let e=this.getGlobalPos();this._oldPosGlobal.setTo(e.x,e.y)})}get canBeCarried(){return this.get(CarriableComponent).canBeCarried}set canBeCarried(e){this.get(CarriableComponent).canBeCarried=e}raycast(e,R,W){return this.scene.physics.rayCast(e,{maxDistance:R,searchAllColliders:!0,...W}).filter(__assignType$14(e=>e.body!==this.body,[`hit`,``,`P"2!"/"`])).sort(__assignType$14((e,R)=>e.distance-R.distance,[`a`,`b`,``,`P"2!"2""/#`]))}raycastSide(e,R,W){let Y=this.collider.bounds,X=Math.round(Y.left)+1,ie=Math.round(Y.right)-1,ae=Math.round(Y.top)+1,le=Math.round(Y.bottom)-1;if(e===`left`||e===`right`){let R=e===`left`?X:ie,W=e===`left`?-1:1;this._ray1.pos.setTo(R,ae),this._ray1.dir.setTo(W,0),this._ray2.pos.setTo(R,le),this._ray2.dir.setTo(W,0)}else{let R=e===`top`?ae:le,W=e===`top`?-1:1;this._ray1.pos.setTo(X,R),this._ray1.dir.setTo(0,W),this._ray2.pos.setTo(ie,R),this._ray2.dir.setTo(0,W)}let _e=this.raycast(this._ray1,R,W),ye=this.raycast(this._ray2,R,W);if(ye.length===0)return _e;if(_e.length===0)return ye;let be=_e.slice();for(let e of ye)_e.indexOf(e)===-1&&be.push(e);return be}getGlobalOldPos(){return this._oldPosGlobal}static __type=[()=>_i,`touching`,function(){return new TouchingComponent},`isOnGround`,function(){return!1},`_oldPosGlobal`,function(){return vec(0,0)},`_ray1`,function(){return new Ray(vec(0,0),vec(1,0))},`_ray2`,function(){return new Ray(vec(0,0),vec(1,0))},`args`,`constructor`,`_engine`,`onInitialize`,`ray`,`distance`,()=>Yp,`maxDistance`,`opts`,`raycast`,`left`,`right`,`top`,`bottom`,`side`,()=>Yp,`maxDistance`,`raycastSide`,`getGlobalOldPos`,`PhysicsActor`,`P7!!3">#)3$>%!3&;>'!3(;>)!3*;>+P!2,"0-P!2.$0/!P!20'21!.3o2#248"05PP.6.7.8.9J2:'21!.<o;#248"0=P"0>5w?`]};let Qp=null,$p=!1;var em=class AudioManager{static levels=(Map.Ω=[[`!`],[`'`]],new Map([[Up.music.stage1,.1],[Up.music.stage2,.1],[Up.sfx.jump,.25],[Up.sfx.jumpSpring,.25],[Up.sfx.land,.25],[Up.sfx.turnAround,.25],[Up.sfx.stomp,.25],[Up.sfx.damage,.25],[Up.sfx.collectCoin,.25]]));static get isMuted(){return $p}static init(e=!1){$p=e;for(let e of Object.values(Up))for(let R of Object.values(e))R instanceof Sound&&(R.volume=$p?0:AudioManager.levels.get(R)??1)}static muteAll(){$p=!0;for(let e of Object.values(Up))for(let R of Object.values(e))R instanceof Sound&&(R.stop(),R.volume=0)}static unmuteAll(){$p=!1;for(let e of Object.values(Up))for(let R of Object.values(e))R instanceof Sound&&(R.volume=AudioManager.levels.get(R)??1);Qp&&(Qp.play(),Qp.loop=!0)}static playSong(e){Qp&&Qp.stop(),Qp=e,$p||Qp.play(),Qp.loop=!0}static playSfx(e,R={}){if($p)return;let{volume:W=AudioManager.levels.get(e),force:Y=!1}=R;(Y||!e.isPlaying())&&e.play(W)}static __type=[`levels`,function(){return Map.Ω=[[`!`],[`'`]],new Map([[Up.music.stage1,.1],[Up.music.stage2,.1],[Up.sfx.jump,.25],[Up.sfx.jumpSpring,.25],[Up.sfx.land,.25],[Up.sfx.turnAround,.25],[Up.sfx.stomp,.25],[Up.sfx.damage,.25],[Up.sfx.collectCoin,.25]])},`startMuted`,`init`,`muteAll`,`unmuteAll`,`song`,`playSong`,`sfx`,()=>tm,`opts`,()=>({}),`playSfx`,`AudioManager`,`!3!s>"!P"2#"0$sP"0%sP"0&sP!2'"0(sP!2)n*2+>,"0-s5w.`]};const tm=[`volume`,`force`,`PlaySfxOptions`,`P'4!8)4"8Mw#y`],nm=new Oe(0,1450),rm={rows:1,columns:3,spriteWidth:48,spriteHeight:48},im={green:{force:500,spritesheet:ir.fromImageSource({image:Up.img.bouncepadGreen,grid:rm})},red:{force:700,spritesheet:ir.fromImageSource({image:Up.img.bouncepadRed,grid:rm})}},am=[()=>im,`type`,`BouncepadArgs`,`P!Pi!g4"8MKw#y`];var Bouncepad=class extends _i{COMPRESS_TIME=250;COMPRESS_DISTANCE=2;spritesheet;force;animation;touching=new TouchingComponent;colliderShape;constructor({type:e=`green`,...R}){super({...R,name:`bouncepad`,anchor:vec(.5,1),width:16,height:16,collisionType:Ye.Fixed}),this.graphics.offset=vec(0,16),this.pos.x+=this.width*this.anchor.x,this.pos.y+=this.height*this.anchor.y,this.spritesheet=im[e].spritesheet,this.force=im[e].force,this.animation=new AnimationComponent({neutral:Ht.fromSpriteSheet(this.spritesheet,[2],0),compressed:Ht.fromSpriteSheet(this.spritesheet,[1],this.COMPRESS_TIME),released:Ht.fromSpriteSheet(this.spritesheet,[0,0,0,0,1],150)}),this.colliderShape=Ft.Box(16,16,this.anchor),this.collider.set(this.colliderShape),this.addTag(`bouncepad`),this.addComponent(this.animation),this.addComponent(this.touching),this.addComponent(new OneWayCollisionComponent)}onInitialize(e){this.graphics.use(this.animation.get(`neutral`)),this.animation.get(`compressed`).events.on(`loop`,()=>{this.release()}),this.animation.get(`released`).events.on(`loop`,()=>{this.animation.set(`neutral`)})}compress(){if(this.animation.current===this.animation.get(`compressed`))return;this.graphics.use(this.animation.get(`compressed`));let e=this.colliderShape.points[0],R=this.colliderShape.points[1];e.y+=this.COMPRESS_DISTANCE,R.y+=this.COMPRESS_DISTANCE,this.colliderShape.points=this.colliderShape.points;for(let e of this.touching.top)e instanceof _i&&(e.pos.y+=this.COMPRESS_DISTANCE)}release(){if(this.animation.current!==this.animation.get(`compressed`))return;this.graphics.use(this.animation.get(`released`));let e=this.colliderShape.points[0],R=this.colliderShape.points[1];e.y-=this.COMPRESS_DISTANCE,R.y-=this.COMPRESS_DISTANCE,this.colliderShape.points=this.colliderShape.points;for(let e of this.touching.top)e instanceof _i&&(e.pos.y-=this.COMPRESS_DISTANCE,e.vel.y=-this.force,em.playSfx(Up.sfx.jumpSpring))}onCollisionStart(e,R,W,Y){W===st.Top&&R.owner instanceof _i&&this.compress()}static __type=[()=>_i,`COMPRESS_TIME`,function(){return 250},`COMPRESS_DISTANCE`,function(){return 2},`spritesheet`,`force`,`neutral`,`compressed`,`released`,()=>AnimationComponent,`animation`,`touching`,function(){return new TouchingComponent},`colliderShape`,()=>am,`param0`,`constructor`,`_engine`,`onInitialize`,`compress`,`release`,`self`,`other`,`side`,`_contact`,`onCollisionStart`,`Bouncepad`,`P7!'3">#'3$>%!3&'3'PP.(.).*J7+3,!3->.!3/;Pn021"02P!23$04P"05P"06P!27!28!29!2:$0;5w<`]},StompableComponent=class extends Component{stomped=!1;stomp(){this.stomped||(this.stomped=!0,this.owner.graphics.current.scale=vec(1,.25))}isBeingStomped(e){let R=e.getGlobalPos().sub(e.getGlobalOldPos());return e.collider.bounds.bottom-R.y<this.owner.collider.bounds.top+1}static __type=[()=>Component,`owner`,`stomped`,function(){return!1},`stomp`,`PhysicsActor`,`other`,`isBeingStomped`,`StompableComponent`,`P7!!3")3#>$P"0%P"w&2'"0(5w)`]};const om=[`instant`,`stomp`,`KillMethod`,`P.!."Jw#y`],sm=[`stompDuration`,`KillableComponentArgs`,`P'4!8Mw"y`];var KillableComponent=class extends Component{dead=!1;events=(EventEmitter.Ω=[[()=>om,`method`,`kill`,`PPn!4"M4#M`]],new EventEmitter);stompDuration=700;constructor({stompDuration:e}={}){super(),this.stompDuration=e??700}kill(e){if(e===`stomp`&&!this.owner.has(StompableComponent))throw Error(`Cannot kill with stomp method: actor does not have a StompableComponent`);if(!this.dead){if(this.dead=!0,this.events.emit(`kill`,{method:e}),e===`instant`)this.owner.kill();else if(e===`stomp`){let e=this.owner.get(StompableComponent);this.owner.actions.callMethod(()=>{e.stomp()}).delay(this.stompDuration*.8).fade(0,this.stompDuration*.2).callMethod(()=>{this.owner.kill()})}}}static __type=[()=>Component,`owner`,`dead`,function(){return!1},`events`,function(){return EventEmitter.Ω=[[()=>om,`method`,`kill`,`PPn!4"M4#M`]],new EventEmitter},`stompDuration`,function(){return 700},()=>sm,`param0`,()=>({}),`constructor`,()=>om,`method`,`kill`,`KillableComponent`,`P7!!3")3#>$!3%>&'3';>(Pn)2*>+"0,Pn-2."0/5w0`]};const cm={puff:{spritesheet:ir.fromImageSource({image:Up.img.smokePuff,grid:{rows:1,columns:8,spriteWidth:32,spriteHeight:32}}),get animation(){return Ht.fromSpriteSheet(this.spritesheet,[0,1,2,3,4,5,6,7],50,zt.End)}},land:{spritesheet:ir.fromImageSource({image:Up.img.smokeLand,grid:{rows:1,columns:3,spriteWidth:32,spriteHeight:32}}),get animation(){return Ht.fromSpriteSheet(this.spritesheet,[0,0,0,1,1,2],60,zt.End)}}},lm=[`puff`,`land`,`type`,`SmokeArgs`,`P!PP.!."J4#MKw$y`];var Smoke=class extends _i{constructor({type:e,...R}){super({anchor:vec(.5,.5),...R});let W=cm[e].animation;W.events.on(`end`,()=>{this.kill()}),this.graphics.use(W),e===`puff`&&(this.vel.y=-20)}static __type=[()=>_i,()=>lm,`param0`,`constructor`,`Smoke`,`P7!Pn"2#"0$5w%`]},HealthComponent=class extends Component{_amount;_max;events=(EventEmitter.Ω=[[`die`,`amount`,`change`,`P$4!P'4"M4#M`]],new EventEmitter);constructor({amount:e}){super(),this._max=e,this._amount=e}get max(){return this._max}get amount(){return this._amount}set amount(e){this._amount=e,this.events.emit(`change`,{amount:e}),this._amount<=0&&this.events.emit(`die`)}static __type=[()=>Component,`_amount`,`_max`,`events`,function(){return EventEmitter.Ω=[[`die`,`amount`,`change`,`P$4!P'4"M4#M`]],new EventEmitter},`amount`,`param0`,`constructor`,`HealthComponent`,`P7!'3";'3#;!3$>%PP'4&M2'"0(!!5w)`]};const um=[`T`,`args`,``,`ReturnType`,`l>e"!R"RPde#!P"@2"h"!/#qk#'QRb!Pde"!p)w$y`];function __assignType$13(e,R){return e.__type=R,e}__name(__assignType$13,`__assignType`);var dm=class DamageableComponent extends Component{events=(EventEmitter.Ω=[[`amount`,`left`,`right`,`knockback`,`damage`,`PP'4!P.".#J4$8M4%M`]],new EventEmitter);INVINCIBILITY_DURATION=2e3;KNOCKBACK_DURATION=200;isInvincible=!1;isBeingKnockedBack=!1;damage(e,R){if(this.isInvincible)return;let W=this.owner.get(HealthComponent);if(this.events.emit(`damage`,{amount:e,knockback:R}),this.isInvincible=!0,em.playSfx(Up.sfx.damage),W&&(W.amount-=e),R){let e=100*(R===`left`?-1:1);this.owner.vel=vec(e,-300),this.owner.acc=vec(0,0),this.isBeingKnockedBack=!0}coroutine(this.owner.scene.engine,__assignType$13(function*(){let e=0;for(;e<Math.max(this.KNOCKBACK_DURATION,this.INVINCIBILITY_DURATION);)if(e+=yield 1,this.isBeingKnockedBack&&e>=this.KNOCKBACK_DURATION&&(this.isBeingKnockedBack=!1,this.owner.vel.x=0),e>=this.INVINCIBILITY_DURATION&&(this.isInvincible=!1),this.owner.graphics.current){let R=Math.floor(e/100)%2==0;this.owner.graphics.current.opacity=R?.35:1}this.owner.graphics.current&&(this.owner.graphics.current.opacity=1)},[()=>DamageableComponent,`this`,()=>um,``,`PP7!2"!o#"/$`]).bind(this))}static __type=[()=>Component,`owner`,`events`,function(){return EventEmitter.Ω=[[`amount`,`left`,`right`,`knockback`,`damage`,`PP'4!P.".#J4$8M4%M`]],new EventEmitter},`INVINCIBILITY_DURATION`,function(){return 2e3},`KNOCKBACK_DURATION`,function(){return 200},`isInvincible`,function(){return!1},`isBeingKnockedBack`,function(){return!1},`amount`,`left`,`right`,`knockback`,`damage`,`DamageableComponent`,`P7!!3"!3#>$'3%>&'3'>()3)>*)3+>,P'2-P.../J208"015w2`]},CollectableComponent=class extends Component{isCollected=!1;isCollectable=!0;static __type=[()=>Component,`isCollected`,function(){return!1},`isCollectable`,function(){return!0},`CollectableComponent`,`P7!)3">#)3$>%5w&`]};let fm=3;var pm=class GameManager{static events=(EventEmitter.Ω=[[()=>mm,`n!`]],new EventEmitter);static get coins(){return fm}static set coins(e){e<0&&(e=0),fm=e,GameManager.events.emit(`coinchange`,{coins:fm})}static __type=[`events`,function(){return EventEmitter.Ω=[[()=>mm,`n!`]],new EventEmitter},`GameManager`,`!3!s>"!5w#`]};const mm=[`coins`,`coinchange`,`GameManagerEvents`,`PP'4!M4"Mw#y`];function __assignType$12(e,R){return e.__type=R,e}__name(__assignType$12,`__assignType`);var CoinItem=class extends _i{elapsedMs=0;collected=!1;constructor(e){super({anchor:vec(.5,.75),collisionType:Ye.Passive,collisionGroup:Kp.Item,width:8,height:8,...e}),this.pos.x+=this.width*this.anchor.x,this.pos.y-=this.height*this.anchor.y,this.addComponent(new CollectableComponent),this.graphics.use(Up.img.coin.toSprite())}get collectable(){return this.get(CollectableComponent)}onPreUpdate(e,R){this.elapsedMs+=R,this.pos.y-=Math.sin(this.elapsedMs/200)/10}collect(){!this.collectable.isCollectable||this.collectable.isCollected||(em.playSfx(Up.sfx.collectCoin,{force:!0}),pm.coins+=1,this.collectable.isCollected=!0,this.actions.clearActions(),this.actions.runAction(new ParallelActions([new _a(this,__assignType$12(e=>e.moveBy(vec(0,-16),150),[`ctx`,``,`P"2!"/"`])),new _a(this,__assignType$12(e=>e.fade(0,150),[`ctx`,``,`P"2!"/"`]))])).callMethod(()=>{this.kill()}))}onPreCollisionResolve(e,R,W,Y){R.owner instanceof vm&&(this.collect(),Y.cancel())}static __type=[()=>_i,`elapsedMs`,function(){return 0},`collected`,function(){return!1},`args`,`constructor`,`engine`,`elapsed`,`onPreUpdate`,`collect`,`self`,`other`,`side`,`contact`,`onPreCollisionResolve`,`CoinItem`,`P7!'3">#)3$>%P!2&"0'!P!2('2)$0*P"0+P!2,!2-!2.!2/$005w1`]};function __assignType$11(e,R){return e.__type=R,e}__name(__assignType$11,`__assignType`);var LostCoin=class extends CoinItem{touching=new TouchingComponent;LIFETIME=3e3;TIME_UNTIL_COLLECTABLE=500;BOUNCE=1;FRICTION=.1;constructor(e){super({anchor:vec(.5,.5),collisionType:Ye.Active,collisionGroup:Kp.PhysicalItem,width:8,height:8,z:500,...e}),this.pos.x+=this.width*this.anchor.x,this.pos.y-=this.height*this.anchor.y,this.addComponent(this.touching),this.addComponent(new CarriableComponent),this.graphics.use(Up.img.coin.toSprite()),this.collectable.isCollectable=!1}onInitialize(e){this.actions.runAction(new ParallelActions([new _a(this,__assignType$11(e=>e.delay(this.TIME_UNTIL_COLLECTABLE).callMethod(()=>{this.collectable.isCollectable=!0}),[`ctx`,``,`P"2!"/"`])),new _a(this,__assignType$11(e=>e.delay(this.LIFETIME).callMethod(()=>this.kill()),[`ctx`,``,`P"2!"/"`]))]))}onPreUpdate(e,R){this.elapsedMs+=R;let W=Math.floor(this.elapsedMs/50)%2==0;this.graphics.current&&(this.graphics.current.opacity=W?.35:.65)}onPreCollisionResolve(e,R,W,Y){if(R.owner instanceof vm&&!this.collectable.isCollectable)return Y.cancel();super.onPreCollisionResolve(e,R,W,Y)}onPostCollisionResolve(e,R,W,Y){W===st.Bottom||W===st.Top?this.vel.x=this.oldVel.x*(1-this.FRICTION):(W==st.Left||W==st.Right)&&(this.vel.y=this.oldVel.y*(1-this.FRICTION))}onCollisionStart(e,R,W,Y){R.owner instanceof vm?super.onCollisionStart(e,R,W,Y):W===st.Bottom||W===st.Top?this.vel.y=this.oldVel.y*-this.BOUNCE:(W==st.Left||W==st.Right)&&(this.vel.x=this.oldVel.x*-this.BOUNCE)}static __type=[()=>CoinItem,`touching`,function(){return new TouchingComponent},`LIFETIME`,function(){return 3e3},`TIME_UNTIL_COLLECTABLE`,function(){return 500},`BOUNCE`,function(){return 1},`FRICTION`,function(){return .1},`args`,`constructor`,`_engine`,`onInitialize`,`engine`,`elapsed`,`onPreUpdate`,`self`,`other`,`side`,`contact`,`onPreCollisionResolve`,`_contact`,`onPostCollisionResolve`,`onCollisionStart`,`LostCoin`,`P7!!3">#'3$>%'3&>''3(>)'3*>+P!2,"0-P!2.$0/P!20'21$02P!23!24!25!26$07P!23!24!25!28$09P!23!24!25!26$0:5w;`]};const hm=[`K`,`T`,`Record`,`l'e#"Rb!b"Pde"!N#!w#y`];var CoyoteComponent=class extends Component{actions;counter={};constructor(e){super(),this.actions=e}onAdd(e){e.on(`preupdate`,this.onPreUpdate.bind(this))}onPreUpdate(e){for(let R in this.actions){let W=this.actions[R];W.condition(e.elapsed)?this.counter[R]=W.time:this.counter[R]=Math.max(0,this.counter[R]-e.elapsed)}}allow(e){return this.counter[e]>0}reset(e){this.counter[e]=0}static __type=[`T`,()=>Component,`actions`,()=>hm,`counter`,function(){return{}},`constructor`,`owner`,`onAdd`,`ev`,`onPreUpdate`,`action`,`allow`,`reset`,`CoyoteComponent`,`b!P7"e!!3#e!!g'o$#3%>&Pe"!2#"0'P!2($0)P!2*"0+Pe"!g2,"0-Pe"!g2,"0.5w/`]},FakeDie=class extends _i{constructor(e){super({...e,collisionType:Ye.Active,z:9999}),this.body.useGravity=!1,this.acc.y=nm.y/2,this.graphics.use(new ci({text:`// TODO: die`,color:We.White,font:new si({size:10,family:`sans-serif`})})),this.vel.y=-300,this.vel.x=randomInRange(-100,100)}onPreUpdate(e,R){this.isOffScreen&&this.kill()}static __type=[()=>_i,`args`,`constructor`,`_engine`,`_elapsed`,`onPreUpdate`,`FakeDie`,`P7!P!2""0#P!2$'2%$0&5w'`]};const gm=[`T`,`args`,``,`ReturnType`,`l>e"!R"RPde#!P"@2"h"!/#qk#'QRb!Pde"!p)w$y`];function __assignType$10(e,R){return e.__type=R,e}__name(__assignType$10,`__assignType`);const _m=ir.fromImageSource({image:Up.img.player,grid:{columns:4,rows:7,spriteWidth:48,spriteHeight:48}});var vm=class Player extends PhysicsActor{JUMP_GRAVITY=nm.y*.5;APEX_GRAVITY=nm.y*.3;MAX_FALL_SPEED=270;WALL_SLIDE_SPEED=80;LADDER_CLIMB_SPEED=75;ACCELERATION=300;STOP_DECELERATION=this.ACCELERATION;GROUND_TURN_DECELERATION=this.ACCELERATION*4;AIR_TURN_DECELERATION=this.ACCELERATION*7;WALK_MAX_VELOCITY=90;RUN_MAX_VELOCITY=150;SPRINT_MAX_VELOCITY=210;SPRINT_TRIGGER_TIME=1e3;JUMP_FORCE=300;RUN_JUMP_FORCE=this.JUMP_FORCE*1.1;SPRINT_JUMP_FORCE=this.JUMP_FORCE*1.2;WALL_JUMP_X_DISTANCE=4;WALL_JUMP_DURATION=70;FX_SQUISH_AMOUNT=8/48;animation=new AnimationComponent({idle:Ht.fromSpriteSheet(_m,[0,1,2,3],140),run:Ht.fromSpriteSheet(_m,[4,5,6,7],140),sprint:Ht.fromSpriteSheet(_m,[8,9,10,11],140),jump:Ht.fromSpriteSheet(_m,[12],140),fall:Ht.fromSpriteSheet(_m,[13],140),turn:Ht.fromSpriteSheet(_m,[16],140),ladder_climb:Ht.fromSpriteSheet(_m,[20,21],140),wall_slide:Ht.fromSpriteSheet(_m,[16],100,zt.Loop)});controls=new PlayerControlsComponent;coyote=new CoyoteComponent({jump:{time:70,condition:()=>this.isOnGround}});isUsingJumpGravity=!1;facing=`right`;isClimbingLadder=!1;isSlidingOnWall=!1;isWallJumping=!1;get maxXVelocity(){switch(!0){case this.controls.isSprinting:return this.SPRINT_MAX_VELOCITY;case this.controls.isRunning:return this.RUN_MAX_VELOCITY;default:return this.WALK_MAX_VELOCITY}}get maxFallingVelocity(){switch(!0){case this.isSlidingOnWall:return this.WALL_SLIDE_SPEED;default:return this.MAX_FALL_SPEED}}get bouncepad(){for(let e of this.touching.bottom)if(e.hasTag(`bouncepad`))return e}get isTouchingLadder(){return this.touching.ladders.size>0}get isAboveLadder(){return this.raycastSide(`bottom`,1,{searchAllColliders:!0}).filter(__assignType$10(e=>e.body.owner?.has(ClimbableComponent),[`hit`,``,`P"2!"/"`])).length>0}get isXMovementAllowed(){let{isBeingKnockedBack:e}=this.get(dm);return!this.isClimbingLadder&&!this.bouncepad&&!this.isWallJumping&&!e}constructor(e){super({...e,name:`player`,anchor:new Oe(.5,1),width:16,height:16,collisionType:Ye.Active,collisionGroup:Kp.Player,collider:Ft.Box(12,12,vec(.5,1))}),this.body.useGravity=!1;let R=new dm;this.addComponent(this.animation),this.addComponent(this.controls),this.addComponent(this.coyote),this.addComponent(R),this.addComponent(new HealthComponent({amount:3})),R.events.on(`damage`,__assignType$10(({amount:e})=>{if(pm.coins===0)this.scene?.entities.find(__assignType$10(e=>e instanceof FakeDie,[`e`,``,`P"2!"/"`]))||this.scene?.add(new FakeDie({x:this.getGlobalPos().x,y:this.getGlobalPos().y}));else{let R=pm.coins-e<0?pm.coins:e;pm.coins-=R;for(let e=0;e<R;e++)this.scene?.add(new LostCoin({pos:vec(this.facing===`left`?this.collider.bounds.right:this.collider.bounds.left,this.collider.bounds.top),vel:vec(100*(this.facing===`right`?-1:1),-200)}))}},[`param0`,``,`P"2!"/"`])),this.animation.get(`turn`).events.on(`frame`,__assignType$10(e=>{e.frameIndex===0&&em.playSfx(Up.sfx.turnAround)},[`frame`,``,`P"2!"/"`])),this.animation.get(`sprint`).events.on(`frame`,__assignType$10(e=>{e.frameIndex%2==0&&this.spawnSmokePuffAtFeet(this.facing===`left`?`right`:`left`,vec(-2,0))},[`frame`,``,`P"2!"/"`])),this.animation.get(`turn`).events.on(`frame`,__assignType$10(e=>{this.spawnSmokePuffAtFeet(this.facing===`left`?`right`:`left`)},[`_frame`,``,`P"2!"/"`])),this.animation.get(`wall_slide`).events.on(`loop`,__assignType$10(e=>{this.spawnSmokePuffAtHands(this.facing,vec(randomIntInRange(-1,1),0))},[`_frame`,``,`P"2!"/"`])),this.addTag(`player`),globalThis.player=this}onInitialize(e){super.onInitialize(e),this.graphics.offset=new Oe(0,16),this.animation.set(`idle`)}onPreUpdate(e,R){this.isOnGround&&(this.isUsingJumpGravity=!1,this.isWallJumping=!1,this.isSlidingOnWall=!1),this.isTouchingLadder||(this.isClimbingLadder=!1),!this.isOnWall(`right`)&&!this.isOnWall(`left`)&&(this.isSlidingOnWall=!1),this.handleInput(e,R)}update(e,R){let W=!1;this.vel.y<0&&(this.isUsingJumpGravity=this.controls.isHeld(`Jump`)),this.isUsingJumpGravity&&this.vel.y>-10&&this.vel.y<10&&(W=!0),W?this.acc.setTo(0,this.APEX_GRAVITY):this.isUsingJumpGravity?this.acc.setTo(0,this.JUMP_GRAVITY):this.acc.setTo(0,nm.y),this.isClimbingLadder&&(this.acc.setTo(0,0),this.vel.setTo(0,0)),this.vel.y>=this.maxFallingVelocity&&(this.vel.y=this.maxFallingVelocity,this.acc.y=0),super.update(e,R)}onPostUpdate(e,R){let{isBeingKnockedBack:W}=this.get(dm);this.animation.speed=Math.min(1+(Math.abs(this.vel.x)/200)**2*3,3),this.handleAnimation(),!this.isWallJumping&&!W&&this.applyDeceleration()}onPreCollisionResolve(e,R,W,Y){super.onPreCollisionResolve(e,R,W,Y);let X=R.owner.has(StompableComponent)?R.owner.get(StompableComponent):void 0;X&&X&&!X.stomped&&X.isBeingStomped(this)&&(this.stomp(R.owner),Y.cancel())}onCollisionStart(e,R,W,Y){if(Y.isCanceled())return;let X=R.owner.get(Ti);if(X?.collisionType===Ye.Fixed||X?.collisionType===Ye.Active){let e=this.oldVel.y>0;W===st.Bottom&&e&&(R.owner instanceof Bouncepad&&(this.vel.x=0),this.land())}}handleInput(e,R){let W=this.controls.wasPressed(`Jump`),Y=this.controls.isHeld(`Jump`),X=this.controls.getHeldXDirection(),ie=this.controls.getHeldYDirection(),ae=this.isOnWall(`left`,4),le=this.isOnWall(`right`,4);if(X&&this.isXMovementAllowed){let e=X===`Left`?-1:1,R=this.ACCELERATION*e;if(this.facing=e===-1?`left`:`right`,this.acc.x+=R,!this.isOnGround&&this.vel.y>0){let e=this.isOnWall(`right`),R=this.isOnWall(`left`);e&&X===`Right`||R&&X===`Left`?this.isSlidingOnWall=!0:this.isSlidingOnWall=!1}}else this.isSlidingOnWall=!1;ie&&this.climbLadder(),W?this.isClimbingLadder?(this.isClimbingLadder=!1,ie!==`Down`&&this.jump()):this.isOnGround||this.coyote.allow(`jump`)?this.jump():(ae||le)&&this.wallJump(ae?`left`:`right`):!Y&&this.vel.y<0&&this.vel.y>-200&&!this.isClimbingLadder&&(this.vel.y*=.5,this.isUsingJumpGravity=!1)}handleAnimation(){let e=this.animation.current.currentFrameIndex,R=this.animation.current.currentFrameTimeLeft,W=this.controls.getHeldXDirection();if(this.graphics.flipHorizontal=this.facing===`left`,this.isSlidingOnWall)this.animation.is(`wall_slide`)||em.playSfx(Up.sfx.land),this.animation.set(`wall_slide`);else if(this.isClimbingLadder)this.animation.set(`ladder_climb`),this.vel.y===0&&this.animation.current.goToFrame(0);else if(this.isOnGround){if(this.controls.isTurning)this.animation.set(`turn`);else if(!W||W===`Left`&&this.vel.x<0||W===`Right`&&this.vel.x>0){if(this.controls.isSprinting&&Math.abs(this.vel.x)>this.RUN_MAX_VELOCITY){let W=this.animation.is(`run`);this.animation.set(`sprint`,W?e:0,W?R:0)}else if(this.vel.x!==0){let W=this.animation.is(`sprint`);this.animation.set(`run`,W?e:0,W?R:0)}}else this.animation.set(`idle`);Math.round(this.vel.x)===0&&this.animation.set(`idle`)}else this.vel.y!==0&&(this.vel.y<0?this.animation.set(`jump`):this.animation.set(`fall`));this.animation.is(`jump`)&&this.oldVel.y>=0&&this.vel.y<0&&coroutine(this.scene.engine,__assignType$10(function*(){let e=1+1*this.FX_SQUISH_AMOUNT,R=mi.EaseOutCubic,W=this.vel.y,Y=0;for(;this.vel.y<W*.25;)Y+=yield 1,Y<70&&this.squishGraphic(R(Math.min(Y,70),1,e,70));for(Y=0;!this.touching.bottom.size;)Y+=yield 1,Y<70&&this.squishGraphic(R(Math.min(Y,70),e,1,140));this.squishGraphic(1)},[()=>Player,`this`,()=>gm,``,`PP7!2"!o#"/$`]).bind(this))}land(){this.isOnGround=!0,em.playSfx(Up.sfx.land),this.spawnSmoke(`land`,{pos:vec(this.center.x,this.collider.bounds.bottom-8),scale:vec(.5,.5)});let e=1-this.FX_SQUISH_AMOUNT,R=mi.EaseOutCubic;coroutine(this.scene.engine,__assignType$10(function*(){let W=0;for(;W<70&&this.isOnGround;)W+=yield 1,this.squishGraphic(R(Math.min(W,70),1,e,70));for(this.squishGraphic(e),W=0;W<70&&this.isOnGround;)W+=yield 1,this.squishGraphic(R(Math.min(W,70),e,1,70));this.squishGraphic(1)},[()=>Player,`this`,()=>gm,``,`PP7!2"!o#"/$`]).bind(this))}climbLadder(){let e=this.controls.getHeldYDirection();if(this.isTouchingLadder){let R=Array.from(this.touching.ladders).sort(__assignType$10((e,R)=>Math.abs(this.collider.bounds.bottom-e.collider.bounds.bottom)-Math.abs(this.collider.bounds.bottom-R.collider.bounds.bottom),[`a`,`b`,``,`P"2!"2""/#`])).at(0),W=e===`Up`?-1:1,Y=Math.abs(this.pos.x-R.center.x)<8,X=__assignType$10(e=>Math.floor(Math.round(e)/16),[`n`,``,`P'2!"/"`]),ie=X(this.collider.bounds.bottom)===X(R.collider.bounds.bottom);e===`Up`&&!this.isClimbingLadder&&ie&&Y&&(this.isClimbingLadder=!0),this.isClimbingLadder&&(this.pos.x=R.center.x,this.vel.y=this.LADDER_CLIMB_SPEED*W,this.vel.x=0,this.isOnGround&&e===`Down`&&(this.isClimbingLadder=!1))}else this.isAboveLadder&&e===`Down`&&(this.isClimbingLadder=!0,this.pos.y=Math.ceil(this.pos.y)+1)}jump(e,R=!0){if(this.isOnGround=!1,this.coyote.reset(`jump`),this.bouncepad){this.bouncepad.release();return}e===void 0&&(e=this.JUMP_FORCE,this.controls.isSprinting?e=this.SPRINT_JUMP_FORCE:this.controls.isRunning&&(e=this.RUN_JUMP_FORCE)),this.vel.y=-e,R&&em.playSfx(Up.sfx.jump)}wallJump(e){this.isWallJumping||(this.jump(),this.isWallJumping=!0,this.spawnSmokePuffAtFeet(e,vec(0,-4)),coroutine(this.scene.engine,__assignType$10(function*(){let R=0,W=e===`left`?1:-1,Y=this.WALL_JUMP_X_DISTANCE/(this.WALL_JUMP_DURATION/1e3)*W;for(;R<this.WALL_JUMP_DURATION&&this.isWallJumping;)R+=yield 1,this.vel.x=Y;this.isWallJumping&&(this.controls.getHeldXDirection()||(this.vel.x=0)),this.isWallJumping=!1},[()=>Player,`this`,()=>gm,``,`PP7!2"!o#"/$`]).bind(this)))}stomp(e){let R=e.get(KillableComponent);if(R.dead)return;this.land(),R.kill(`stomp`),em.playSfx(Up.sfx.stomp);let W=this.controls.isSprinting?this.SPRINT_JUMP_FORCE:this.RUN_JUMP_FORCE;this.jump(W,!1)}isOnWall(e,R=1){return this.raycastSide(e,R,{filter:__assignType$10(e=>e.body.group===Kp.Ground,[`hit`,``,`P"2!"/"`])}).length>0}applyDeceleration(){let e=this.isOnGround,R=Math.abs(this.vel.x)>this.maxXVelocity;e?this.controls.isTurning?this.acc.x=-this.GROUND_TURN_DECELERATION*Math.sign(this.vel.x):(!this.controls.isMoving||R)&&this.vel.x!==0&&(this.acc.x=-this.STOP_DECELERATION*Math.sign(this.vel.x)):this.controls.isTurning?this.acc.x=-this.AIR_TURN_DECELERATION*Math.sign(this.vel.x):R&&(this.vel.x=clamp(this.vel.x,-this.maxXVelocity,this.maxXVelocity),this.acc.x=0),Math.sign(this.vel.x)!==0&&Math.sign(this.vel.x)!==Math.sign(this.acc.x)&&Math.abs(this.vel.x)<1&&(this.vel.x=0,this.acc.x=0)}squishGraphic(e){let R=e,W=2-R;this.graphics.current.scale=vec(W,R)}spawnSmoke(e,R){this.scene?.add(new Smoke({type:e,z:this.z+1,...R}))}spawnSmokePuffAtFeet(e,R=vec(0,0)){this.spawnSmoke(`puff`,{pos:vec(e===`left`?this.collider.bounds.left+R.x:this.collider.bounds.right-R.x,this.collider.bounds.bottom+R.y),scale:vec(.35,.35)})}spawnSmokePuffAtHands(e,R=vec(0,0)){this.spawnSmoke(`puff`,{pos:vec(e===`left`?this.collider.bounds.left+R.x:this.collider.bounds.right-R.x,this.center.y+R.y),scale:vec(.35,.35)})}static __type=[()=>PhysicsActor,`JUMP_GRAVITY`,function(){return nm.y*.5},`APEX_GRAVITY`,function(){return nm.y*.3},`MAX_FALL_SPEED`,function(){return 270},`WALL_SLIDE_SPEED`,function(){return 80},`LADDER_CLIMB_SPEED`,function(){return 75},`ACCELERATION`,function(){return 300},`STOP_DECELERATION`,function(){return this.ACCELERATION},`GROUND_TURN_DECELERATION`,function(){return this.ACCELERATION*4},`AIR_TURN_DECELERATION`,function(){return this.ACCELERATION*7},`WALK_MAX_VELOCITY`,function(){return 90},`RUN_MAX_VELOCITY`,function(){return 150},`SPRINT_MAX_VELOCITY`,function(){return 210},`SPRINT_TRIGGER_TIME`,function(){return 1e3},`JUMP_FORCE`,function(){return 300},`RUN_JUMP_FORCE`,function(){return this.JUMP_FORCE*1.1},`SPRINT_JUMP_FORCE`,function(){return this.JUMP_FORCE*1.2},`WALL_JUMP_X_DISTANCE`,function(){return 4},`WALL_JUMP_DURATION`,function(){return 70},`FX_SQUISH_AMOUNT`,function(){return 8/48},`animation`,function(){return new AnimationComponent({idle:Ht.fromSpriteSheet(_m,[0,1,2,3],140),run:Ht.fromSpriteSheet(_m,[4,5,6,7],140),sprint:Ht.fromSpriteSheet(_m,[8,9,10,11],140),jump:Ht.fromSpriteSheet(_m,[12],140),fall:Ht.fromSpriteSheet(_m,[13],140),turn:Ht.fromSpriteSheet(_m,[16],140),ladder_climb:Ht.fromSpriteSheet(_m,[20,21],140),wall_slide:Ht.fromSpriteSheet(_m,[16],100,zt.Loop)})},`controls`,function(){return new PlayerControlsComponent},`coyote`,function(){return new CoyoteComponent({jump:{time:70,condition:()=>this.isOnGround}})},`isUsingJumpGravity`,function(){return!1},`left`,`right`,`facing`,function(){return`right`},`isClimbingLadder`,function(){return!1},`isSlidingOnWall`,function(){return!1},`isWallJumping`,function(){return!1},`x`,`y`,`z`,`args`,`constructor`,`engine`,`onInitialize`,`elapsed`,`onPreUpdate`,`update`,`_engine`,`_elapsed`,`onPostUpdate`,`self`,`other`,`side`,`contact`,`onPreCollisionResolve`,`onCollisionStart`,`handleInput`,`handleAnimation`,`land`,`climbLadder`,`force`,`playSfx`,`jump`,`left`,`right`,`wallJump`,`stomp`,`left`,`right`,`distance`,`isOnWall`,`applyDeceleration`,`scale`,`squishGraphic`,`puff`,`land`,`type`,`pos`,`spawnSmoke`,`left`,`right`,`offset`,`spawnSmokePuffAtFeet`,`left`,`right`,`spawnSmokePuffAtHands`,`Player`,`P7!!3">#!3$>%'3&>''3(>)'3*>+'3,>-!3.>/!30>1!32>3'34>5'36>7'38>9'3:>;'3<>=!3>>?!3@>A'3B>C'3D>E!3F>G!3H>I!3J>K!3L>M)3N>OP.P.QJ3R>S)3T>U)3V>W)3X>Y!!!!!!PP'4Z'4['4\\8M2]"0^P!2_"0\`P!2_'2a$0bP!2_'2a$0cP!2d'2e$0fP!2g!2h!2i!2j$0kP!2g!2h!2i!2j$0lP!2d'2e"0mP"0nP"0oP"0pP'2q8"2r"0sPP.t.uJ2i"0vP!2h"0wPP.x.yJ2i"2z"0{P"0|P'2}"0~PP..J2P!4!4}8M2]"0PP..
J2i"2"0PP..J2i"2"05w`]},PlayerControlsComponent=class extends ControlsComponent{sprintTimer=0;onAdd(e){super.onAdd?.(e),e.on(`postupdate`,__assignType$10(({elapsed:e})=>{let R=this.owner.isOnGround,W=!R&&!this.isSprinting,Y=this.isTurning&&R;this.isRunning&&R&&!Y?this.sprintTimer=Math.min(this.sprintTimer+e,this.owner.SPRINT_TRIGGER_TIME):(!this.isRunning||Y||W)&&(this.sprintTimer=0)},[`param0`,``,`P"2!"/"`]))}get isMoving(){return this.getHeldXDirection()!==void 0}get isRunning(){return this.isMoving&&this.isHeld(`Run`)}get isSprinting(){return this.isRunning&&this.sprintTimer>=this.owner.SPRINT_TRIGGER_TIME}get isTurning(){let e=this.getHeldXDirection(),{isBeingKnockedBack:R}=this.owner.get(dm);return R?!1:e===`Left`&&this.owner.vel.x>0||e===`Right`&&this.owner.vel.x<0}static __type=[()=>ControlsComponent,()=>vm,`owner`,`sprintTimer`,function(){return 0},()=>vm,`onAdd`,`PlayerControlsComponent`,`P7!P7"3#'3$>%PP7&2#$0'!!!!5w(`]};function __assignType$9(e,R){return e.__type=R,e}__name(__assignType$9,`__assignType`);var ScrollingBackground=class extends nt{xSpeed;ySpeed;image;graphics=new fi;transform=new Xe;constructor(e){let{xSpeed:R=.25,ySpeed:W=.1,z:Y=-100,image:X}=e;super(),this.addComponent(this.graphics),this.addComponent(this.transform),this.image=X,this.xSpeed=R,this.ySpeed=W,this.graphics.anchor=vec(.5,.5),this.transform.pos=vec(0,0),this.transform.z=Y}onInitialize(e){let R=this.image.toSprite(),W=this.scene.camera.viewport.width,Y=this.scene.camera.viewport.height,X=Math.ceil(W/R.width)+1,ie=Math.ceil(Y/R.height)+1;this.graphics.use(new Ut({members:Array.from({length:X*ie}).map(__assignType$9((e,W)=>{let Y=W%X,ae=Math.floor(W/ie);return{graphic:R,offset:vec(R.width*Y,R.height*ae)}},[`_`,`i`,``,`P"2!"2""/#`]))})),this.on(`pretransformdraw`,()=>{let W=this.scene.camera,Y=W.drawPos.x-e.halfDrawWidth,X=W.drawPos.y-e.halfDrawHeight;this.transform.pos.x=Y,this.transform.pos.y=X;let ie=Y*-this.xSpeed%R.width+R.width,ae=X*-this.ySpeed%R.height+R.height;this.graphics.offset.setTo(ie,ae)})}static __type=[()=>nt,`xSpeed`,`ySpeed`,`image`,`graphics`,function(){return new fi},`transform`,function(){return new Xe},`z`,`args`,`constructor`,`_engine`,`onInitialize`,`ScrollingBackground`,`P7!'3"'3#!3$!3%>&!3'>(PP!4$'4"8'4#8'4)8M2*"0+P!2,$0-5w.`]};function __assignType$8(e,R){return e.__type=R,e}__name(__assignType$8,`__assignType`);var Tween=class{engine;value;_startValue=0;_targetValue=0;_easing;_duration=0;_elapsed=0;constructor(e,R,W){let{easing:Y=mi.Linear,duration:X=1e3}=W;this.engine=e,this.value=R,this._startValue=R,this._targetValue=R,this._easing=Y,this._duration=X,e.on(`preupdate`,this.onUpdate)}onUpdate=__assignType$8(e=>{this._elapsed<this._duration&&(this._elapsed=Math.min(this._duration,this._elapsed+e.elapsed),this.value=this._easing(this._elapsed,this._startValue,this._targetValue,this._duration))},[`ev`,``,`P!2!"/"`]);set(e,R=!1){this._elapsed=0,R?(this.value=e,this._startValue=e,this._targetValue=e):(this._startValue=this.value,this._targetValue=e)}destroy(){this.engine.off(`preupdate`,this.onUpdate)}static __type=[`engine`,`value`,`_startValue`,function(){return 0},`_targetValue`,function(){return 0},`_easing`,`_duration`,function(){return 0},`_elapsed`,function(){return 0},`easing`,`duration`,`opts`,`constructor`,`onUpdate`,function(){return __assignType$8(e=>{this._elapsed<this._duration&&(this._elapsed=Math.min(this._duration,this._elapsed+e.elapsed),this.value=this._easing(this._elapsed,this._startValue,this._targetValue,this._duration))},[`ev`,``,`P!2!"/"`])},`immediately`,`set`,`destroy`,`Tween`,`!3!'3"'3#;>$'3%;>&!3';'3(;>)'3*;>+P!2!'2"P!4,8'4-8M2."0/!30>1P'2""22"03P"045w5`]},LockToPlayerStrategy=class{FOLLOW_DAMPING=.5;TURN_TWEEN_DURATION=400;X_EDGE_BUFFER=20;Y_EDGE_BUFFER=40;target;xOffset;facing=`right`;isFirstUpdate=!0;constructor(e){this.target=e,this.xOffset=new Tween(this.target.scene.engine,0,{easing:mi.Linear,duration:this.TURN_TWEEN_DURATION}),this.turn(`right`,!0)}action(e,R,W,Y){let X=e.getGlobalPos(),ie=X.x-R.pos.x+this.xOffset.value,ae=X.y-R.pos.y,le=ie<-this.X_EDGE_BUFFER,_e=ie>this.X_EDGE_BUFFER,ye=ae<-this.Y_EDGE_BUFFER,be=ae>this.Y_EDGE_BUFFER,Ce=R.pos.x,Te=R.pos.y;if((le&&this.facing!==`left`||_e&&this.facing!==`right`)&&this.turn(le?`left`:`right`),le?Ce=X.x+this.X_EDGE_BUFFER+this.xOffset.value:_e&&(Ce=X.x-this.X_EDGE_BUFFER+this.xOffset.value),(ye||be)&&(Te=ye?X.y+this.Y_EDGE_BUFFER:X.y-this.Y_EDGE_BUFFER),this.isFirstUpdate)return this.isFirstUpdate=!1,vec(Ce,Te);if(le||_e){let e=Ce-R.pos.x,W=Te-R.pos.y;Math.abs(e)>.1&&(Ce-=e*this.FOLLOW_DAMPING),Math.abs(W)>.1&&(Te-=W*this.FOLLOW_DAMPING)}return vec(Ce,Te)}turn(e,R=!1){this.facing=e,e===`left`?this.xOffset.set(-this.X_EDGE_BUFFER*4,R):this.xOffset.set(this.X_EDGE_BUFFER*4,R)}static __type=[`FOLLOW_DAMPING`,function(){return .5},`TURN_TWEEN_DURATION`,function(){return 400},`X_EDGE_BUFFER`,function(){return 20},`Y_EDGE_BUFFER`,function(){return 40},`Player`,`target`,()=>Tween,`xOffset`,`left`,`right`,`facing`,function(){return`right`},`isFirstUpdate`,function(){return!0},`constructor`,`camera`,`_engine`,`_elapsed`,`action`,`left`,`right`,`direction`,`immediately`,`turn`,`LockToPlayerStrategy`,`'3!>"'3#>$'3%>&'3'>("w)3*P7+3,P.-..J3/>0)31;>2P"w)2*"03P"w)2*!24!25'26"07PP.8.9J2:"2;"0<5"x"w=`]},DamageComponent=class extends Component{amount;cancelContactOnDamage;constructor({amount:e,cancelContactOnDamage:R}){super(),this.amount=e,this.cancelContactOnDamage=R??!0}onAdd(e){e.on(`precollision`,this.onPreCollisionResolve.bind(this))}onPreCollisionResolve(e){let R=this.owner.get(KillableComponent),W=this.owner.get(StompableComponent),Y=R?.dead??!1,X=e.other.owner,ie=X.get(dm),ae=X instanceof PhysicsActor&&W?.isBeingStomped(X);ie&&(this.cancelContactOnDamage&&e.contact.cancel(),!Y&&!ae&&ie.damage(this.amount,X.center.x<this.owner.center.x?`left`:`right`))}static __type=[()=>Component,`owner`,`amount`,`cancelContactOnDamage`,`param0`,`constructor`,`onAdd`,`event`,`onPreCollisionResolve`,`DamageComponent`,`P7!!3"'3#)3$PP'4#)4$8M2%"0&P!2"$0'P!2("0)5w*`]};const ym=[`stompDuration`,`EnemyActorArgs`,`P!P'4!8MKw"y`];var bm=class EnemyActor extends PhysicsActor{killable;stompable;constructor({stompDuration:e,...R}){super({collisionType:Ye.Active,collisionGroup:Kp.Enemy,...R}),this.killable=new KillableComponent({stompDuration:e}),this.stompable=new StompableComponent,this.addComponent(new DamageComponent({amount:1})),this.addComponent(this.stompable),this.addComponent(this.killable),this.killable.events.on(`kill`,this.onKill.bind(this))}get dead(){return this.killable.dead}set dead(e){this.killable.dead=e}onPreCollisionResolve(e,R,W,Y){R.owner instanceof EnemyActor&&Y.cancel()}onKill(){}static __type=[()=>PhysicsActor,()=>KillableComponent,`killable`,()=>StompableComponent,`stompable`,()=>ym,`param0`,`constructor`,`self`,`other`,`side`,`contact`,`onPreCollisionResolve`,`onKill`,`EnemyActor`,`P7!P7"3#<P7$3%<Pn&2'"0(!P!2)!2*!2+!2,$0-P"0.5w/`]};const xm={rows:1,columns:3,spriteWidth:64,spriteHeight:48},Sm={green:{speed:20,spritesheet:ir.fromImageSource({image:Up.img.spiderGreen,grid:xm})},gray:{speed:30,spritesheet:ir.fromImageSource({image:Up.img.spiderGray,grid:xm})}},Cm=[()=>Sm,`type`,`SpiderEnemyArgs`,`P!Pi!g4"MKw#y`];var SpiderEnemy=class extends bm{spritesheet;speed;direction=`left`;constructor(e){super({...e,anchor:vec(.5,32/48),collider:Ft.Box(24,4,vec(.5,1))}),this.spritesheet=Sm[e.type].spritesheet,this.speed=Sm[e.type].speed,this.graphics.use(Ht.fromSpriteSheet(this.spritesheet,[0,1,2],2500/this.speed))}onPreUpdate(e,R){if(this.dead)return;let W=this.raycast(new Ray(vec(this.collider.bounds.left+1,Math.round(this.collider.bounds.bottom)-1),Oe.Down),1),Y=this.raycast(new Ray(vec(this.collider.bounds.right-1,Math.round(this.collider.bounds.bottom)-1),Oe.Down),1),X=this.direction===`left`&&W.length===0,ie=this.direction===`right`&&Y.length===0;(X||ie)&&(this.direction=this.direction===`left`?`right`:`left`),this.graphics.flipHorizontal=this.direction===`right`,this.direction===`left`?this.vel.x=-this.speed:this.vel.x=this.speed}onCollisionStart(e,R,W,Y){R.owner instanceof vm||R.owner instanceof _i&&R.owner.body.collisionType===Ye.Passive||(W===st.Left||W===st.Right)&&(this.direction=this.direction===`left`?`right`:`left`)}onKill(){this.graphics.current.pause(),this.vel.x=0,this.vel.y=0,this.body.useGravity=!1}static __type=[()=>bm,`spritesheet`,`speed`,`left`,`right`,`direction`,function(){return`left`},()=>Cm,`args`,`constructor`,`_engine`,`_elapsed`,`onPreUpdate`,`self`,`other`,`side`,`_contact`,`onCollisionStart`,`onKill`,`SpiderEnemy`,`P7!!3"'3#P.$.%J3&>'Pn(2)"0*P!2+'2,$0-P!2.!2/!20!21$02P"035w4`]};function __assignType$7(e,R){return e.__type=R,e}__name(__assignType$7,`__assignType`);const wm=Up.img.platform.toSprite(),Tm=new Xt({image:wm.image,destSize:{height:16,width:16},sourceView:{x:0,y:0,width:16,height:16}}),Em=new Xt({image:wm.image,destSize:{height:16,width:16},sourceView:{x:32,y:0,width:16,height:16}}),Dm=new Xt({image:wm.image,destSize:{height:16,width:16},sourceView:{x:16,y:0,width:16,height:16}}),Om=[`oneWay`,`MovingPlatformArgs`,`P!P)4!8MKw"y`];var MovingPlatform=class extends _i{constructor({oneWay:e=!0,...R},W){super({color:We.Green,anchor:vec(0,0),collisionType:Ye.Fixed,collisionGroup:Kp.Ground,...R});let Y=this.width-32;this.graphics.use(new Ut({members:[{graphic:Tm,offset:vec(0,0)},...Array.from({length:Y/16},__assignType$7((e,R)=>({graphic:Dm,offset:vec(16+R*16,0)}),[`_`,`i`,``,`P"2!"2""/#`])),{graphic:Em,offset:vec(this.width-16,0)}]})),W(this.actions),this.addComponent(new CarrierComponent),e&&this.addComponent(new OneWayCollisionComponent)}static __type=[()=>_i,()=>Om,`param0`,`actions`,``,`cb`,`constructor`,`MovingPlatform`,`P7!Pn"2#P!2$#/%2&"0'5w(`]};const km=[`x`,`y`,`pos`,`EnemyActor`,``,`spawn`,`EnemySpawnerArgs`,`P'4!'4"P!2#"w$/%4&Mw'y`];var EnemySpawner=class extends _i{OFFSCREEN_BUFFER=100;spawnedInstance=null;canSpawn=!0;spawn;constructor({x:e,y:R,spawn:W}){super({x:e,y:R}),this.spawn=W,this.on(`enterviewport`,()=>{this.spawnInstance()})}spawnInstance(){this.spawnedInstance||!this.canSpawn||(this.canSpawn=!1,this.spawnedInstance=this.spawn(this.pos),this.spawnedInstance.on(`kill`,()=>{this.spawnedInstance=null}),this.scene.engine.add(this.spawnedInstance))}onPreUpdate(e,R){let W=e.currentScene.camera.viewport,Y=this.OFFSCREEN_BUFFER,X=W.left-Y,ie=W.top-Y,ae=W.right+Y,le=W.bottom+Y,{x:_e,y:ye}=this.pos;if(_e<X||_e>ae||ye<ie||ye>le?this.spawnedInstance||(this.canSpawn=!0):this.spawnInstance(),this.spawnedInstance){let e=this.spawnedInstance.getGlobalPos();(e.x<X||e.x>ae||e.y<ie||e.y>le)&&(this.spawnedInstance.kill(),this.spawnedInstance=null)}}static __type=[()=>_i,`OFFSCREEN_BUFFER`,function(){return 100},`EnemyActor`,`spawnedInstance`,function(){return null},`canSpawn`,function(){return!0},`pos`,``,`spawn`,()=>km,`param0`,`constructor`,`spawnInstance`,`engine`,`_elapsed`,`onPreUpdate`,`EnemySpawner`,`P7!'3">#P"w$,J3%;>&)3';>(P!2)"w$/*3+Pn,2-"0.P"0/P!20'21$025w3`]};const Am={rows:1,columns:3,spriteWidth:48,spriteHeight:48},jm={purple:{speed:20,distance:60,spritesheet:ir.fromImageSource({image:Up.img.birdPurple,grid:Am})},orange:{speed:30,distance:100,spritesheet:ir.fromImageSource({image:Up.img.birdOrange,grid:Am})}},Mm=[()=>jm,`type`,`BirdEnemyArgs`,`P!Pi!g4"MKw#y`];var BirdEnemy=class extends bm{spritesheet;speed;distance;direction=`left`;elapsedMs=0;deathPosition=null;initialPos;constructor(e){super({...e,stompDuration:1500,anchor:vec(.5,.6),collider:Ft.Box(16,5,vec(.5,1)),collisionType:Ye.Passive}),this.spritesheet=jm[e.type].spritesheet,this.speed=jm[e.type].speed,this.distance=jm[e.type].distance,this.body.useGravity=!1,this.graphics.use(Ht.fromSpriteSheet(this.spritesheet,[0,1,2],3e3/this.speed)),this.initialPos=this.pos.clone(),this.canBeCarried=!1}onPreUpdate(e,R){this.elapsedMs+=R,this.dead&&this.deathPosition?(this.vel.y=10,this.pos.x+=Math.sin((this.pos.y-this.deathPosition.y)/2),this.rotation=-Math.sin((this.pos.x-this.deathPosition.x)/50)):(this.graphics.flipHorizontal=this.direction===`right`,this.direction===`left`?this.vel.x=-this.speed:this.vel.x=this.speed,this.pos.y+=Math.sin(this.elapsedMs/(this.speed*10)*Math.PI)*.3),this.pos.x<this.initialPos.x-this.distance?this.direction=`right`:this.pos.x>this.initialPos.x&&(this.direction=`left`)}onKill(){this.deathPosition=this.pos.clone(),this.graphics.current.pause(),this.vel.x=0,this.vel.y=0,this.body.useGravity=!1}static __type=[()=>bm,`spritesheet`,`speed`,`distance`,`left`,`right`,`direction`,function(){return`left`},`elapsedMs`,function(){return 0},`deathPosition`,function(){return null},`initialPos`,()=>Mm,`args`,`constructor`,`engine`,`elapsed`,`onPreUpdate`,`onKill`,`BirdEnemy`,`P7!!3"'3#'3$P.%.&J3'>('3);>*P!,J3+;>,!3-;Pn.2/"00P!21'22$03P"045w5`]},AxeHazard=class extends _i{elapsedMs=0;constructor(e){super({...e,anchor:vec(.5,0),width:12,height:48,rotation:0,collisionType:Ye.Passive,collisionGroup:Kp.Enemy,collider:Ft.Box(28,12,vec(.5,.5),vec(0,42))}),this.body.useGravity=!1,this.graphics.offset=vec(0,-8),this.graphics.use(Up.img.axe.toSprite()),this.addComponent(new DamageComponent({amount:1}))}onPreUpdate(e,R){this.elapsedMs+=R;let W=Math.PI/2,Y=this.elapsedMs/1e3;this.rotation=W*Math.cos(Math.sqrt(nm.y/600)*Y)}static __type=[()=>_i,`elapsedMs`,function(){return 0},`args`,`constructor`,`_engine`,`elapsed`,`onPreUpdate`,`AxeHazard`,`P7!'3";>#P!2$"0%P!2&'2'"0(5w)`]};function __assignType$6(e,R){return e.__type=R,e}__name(__assignType$6,`__assignType`);var CircularSawHazard=class extends PhysicsActor{direction=1;speed=25;bladeSize={width:24,height:12};lastGroundHit=null;constructor(e){super({...e,name:`circular-saw`,anchor:vec(.5,.5),width:4,height:4,collisionType:Ye.Passive,collisionGroup:Kp.Enemy}),this.pos.x+=this.width*this.anchor.x,this.pos.y-=this.height*this.anchor.y,this.body.useGravity=!1,this.graphics.use(Up.img.circularSaw.toSprite()),this.graphics.offset=vec(0,2);let R=new _i({pos:vec(0,0),anchor:vec(.5,1),width:this.bladeSize.width,height:this.bladeSize.height,collisionType:Ye.Passive,collisionGroup:Kp.Enemy});R.addComponent(new DamageComponent({amount:1})),this.addChild(R),this.addComponent(new CarriableComponent)}onInitialize(e){this.graphics.material=new RenderTopHalfMaterial(e.graphicsContext,this)}onPreUpdate(e,R){let W=this.direction===1?this.collider.bounds.right+this.bladeSize.width/2:this.collider.bounds.left-this.bladeSize.width/2,Y=this.collider.bounds.bottom-1,[X]=this.raycast(new Ray(vec(W,Y),Oe.Down),1,{collisionGroup:Kp.Ground}),[ie]=this.raycast(new Ray(vec(W,Y),this.direction===1?Oe.Right:Oe.Left),1,{collisionGroup:Kp.Ground});(!X&&this.lastGroundHit||ie)&&(this.direction*=-1);let ae=this.graphics.current;ae.rotation=(ae.rotation+toRadians(this.speed*5/R))%(Math.PI*2),this.vel.x=this.speed*this.direction,X&&(this.lastGroundHit=X)}static __type=[()=>PhysicsActor,`direction`,function(){return 1},`speed`,function(){return 25},`bladeSize`,function(){return{width:24,height:12}},`lastGroundHit`,function(){return null},`args`,`constructor`,`engine`,`onInitialize`,`_engine`,`elapsed`,`onPreUpdate`,`CircularSawHazard`,`P7!'3">#'3$>%!3&>'P!,J3(>)P!2*"0+P!2,$0-P!2.'2/"005w1`]},RenderTopHalfMaterial=class extends ti{constructor(e,R){super({name:`render-top-half-material`,fragmentSource:`#version 300 es
|
|
1100
1100
|
precision mediump float;
|
|
1101
1101
|
|
|
1102
1102
|
uniform sampler2D u_graphic;
|