diff --git a/front/dist/assets/CanvasPool-DfMFozUt.js b/front/dist/assets/CanvasPool-Df6Z7K0X.js similarity index 91% rename from front/dist/assets/CanvasPool-DfMFozUt.js rename to front/dist/assets/CanvasPool-Df6Z7K0X.js index 4930bfe..00bb645 100644 --- a/front/dist/assets/CanvasPool-DfMFozUt.js +++ b/front/dist/assets/CanvasPool-Df6Z7K0X.js @@ -1 +1 @@ -import{D as n,n as c}from"./index-CQrWNA4L.js";class l{constructor(a){this._canvasPool=Object.create(null),this.canvasOptions=a||{},this.enableFullScreen=!1}_createCanvasAndContext(a,t){const s=n.get().createCanvas();s.width=a,s.height=t;const e=s.getContext("2d");return{canvas:s,context:e}}getOptimalCanvasAndContext(a,t,s=1){a=Math.ceil(a*s-1e-6),t=Math.ceil(t*s-1e-6),a=c(a),t=c(t);const e=(a<<17)+(t<<1);this._canvasPool[e]||(this._canvasPool[e]=[]);let o=this._canvasPool[e].pop();return o||(o=this._createCanvasAndContext(a,t)),o}returnCanvasAndContext(a){const t=a.canvas,{width:s,height:e}=t,o=(s<<17)+(e<<1);a.context.clearRect(0,0,s,e),this._canvasPool[o].push(a)}clear(){this._canvasPool={}}}const C=new l;export{C}; +import{D as n,n as c}from"./index-DKTylTFu.js";class l{constructor(a){this._canvasPool=Object.create(null),this.canvasOptions=a||{},this.enableFullScreen=!1}_createCanvasAndContext(a,t){const s=n.get().createCanvas();s.width=a,s.height=t;const e=s.getContext("2d");return{canvas:s,context:e}}getOptimalCanvasAndContext(a,t,s=1){a=Math.ceil(a*s-1e-6),t=Math.ceil(t*s-1e-6),a=c(a),t=c(t);const e=(a<<17)+(t<<1);this._canvasPool[e]||(this._canvasPool[e]=[]);let o=this._canvasPool[e].pop();return o||(o=this._createCanvasAndContext(a,t)),o}returnCanvasAndContext(a){const t=a.canvas,{width:s,height:e}=t,o=(s<<17)+(e<<1);a.context.clearRect(0,0,s,e),this._canvasPool[o].push(a)}clear(){this._canvasPool={}}}const C=new l;export{C}; diff --git a/front/dist/assets/SharedSystems-BCvEDrAl.js b/front/dist/assets/SharedSystems-BYS0WgCL.js similarity index 99% rename from front/dist/assets/SharedSystems-BCvEDrAl.js rename to front/dist/assets/SharedSystems-BYS0WgCL.js index f99ead5..d14e477 100644 --- a/front/dist/assets/SharedSystems-BCvEDrAl.js +++ b/front/dist/assets/SharedSystems-BYS0WgCL.js @@ -1,4 +1,4 @@ -import{F as Oe,v as Fe,m as ee,M as v,G as He,x as Le,E as d,e as I,y as te,S as ze,z as b,H as We,R as E,I as re,J as se,K as Ve,a as m,d as f,k as B,w as ne,L as N,N as je,h as $,B as k,l as U,O as M,T as y,Q as S,V as Ne,c as $e,C as w,W as ae,X as ie,Y as oe,Z as le,_ as qe,P as Ke,i as Ye,b as q,D as ue,$ as K,a0 as Je,a1 as Xe,a2 as Qe}from"./index-CQrWNA4L.js";import{T as Y,B as Ze,c as et}from"./colorToUniform-DaN3ccwh.js";var tt=`in vec2 vMaskCoord; +import{F as Oe,v as Fe,m as ee,M as v,G as He,x as Le,E as d,e as I,y as te,S as ze,z as b,H as We,R as E,I as re,J as se,K as Ve,a as m,d as f,k as B,w as ne,L as N,N as je,h as $,B as k,l as U,O as M,T as y,Q as S,V as Ne,c as $e,C as w,W as ae,X as ie,Y as oe,Z as le,_ as qe,P as Ke,i as Ye,b as q,D as ue,$ as K,a0 as Je,a1 as Xe,a2 as Qe}from"./index-DKTylTFu.js";import{T as Y,B as Ze,c as et}from"./colorToUniform-fMvLSPph.js";var tt=`in vec2 vMaskCoord; in vec2 vTextureCoord; uniform sampler2D uTexture; diff --git a/front/dist/assets/WebGLRenderer-BzN8kj9-.js b/front/dist/assets/WebGLRenderer-oW2arDOf.js similarity index 99% rename from front/dist/assets/WebGLRenderer-BzN8kj9-.js rename to front/dist/assets/WebGLRenderer-oW2arDOf.js index a5be337..7bde8b6 100644 --- a/front/dist/assets/WebGLRenderer-BzN8kj9-.js +++ b/front/dist/assets/WebGLRenderer-oW2arDOf.js @@ -1,4 +1,4 @@ -import{E as l,S as G,B as A,w as m,D as S,L as j,a3 as xe,x as Ae,u as U,a as p,T as K,d as g,Q as L,k as B,l as Be,m as O,s as $,M as z,a4 as Y,a5 as Ne,a6 as Ie,a7 as q,a8 as De,e as x,A as ye,R as Ce}from"./index-CQrWNA4L.js";import{b as Z}from"./colorToUniform-DaN3ccwh.js";import{e as Ge,G as Ue,c as Oe,b as Pe,U as Fe,R as Me,B as Q,d as N,f as Le,S as He,a as we}from"./SharedSystems-BCvEDrAl.js";class J{constructor(){this._didUpload=!1,this._tempState=G.for2d()}init(e){e.renderer.runners.contextChange.add(this)}contextChange(){this._didUpload=!1}start(e,r,s){const n=e.renderer;n.shader.bind(s,this._didUpload),n.shader.updateUniformGroup(n.globalUniforms.uniformGroup),n.geometry.bind(r,s.glProgram)}execute(e,r){const s=e.renderer;this._didUpload=!0,this._tempState.blendMode=r.blendMode,s.state.set(this._tempState);const n=r.textures.textures;for(let i=0;i(t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",t))(T||{});class Ve{constructor(e,r){this.buffer=e||null,this.updateID=-1,this.byteLength=-1,this.type=r}}class ee{constructor(e){this._gpuBuffers=Object.create(null),this._boundBufferBases=Object.create(null),this._renderer=e,this._renderer.renderableGC.addManagedHash(this,"_gpuBuffers")}destroy(){this._renderer=null,this._gl=null,this._gpuBuffers=null,this._boundBufferBases=null}contextChange(){this._gpuBuffers=Object.create(null),this._gl=this._renderer.gl}getGlBuffer(e){return this._gpuBuffers[e.uid]||this.createGLBuffer(e)}bind(e){const{_gl:r}=this,s=this.getGlBuffer(e);r.bindBuffer(s.type,s.buffer)}bindBufferBase(e,r){const{_gl:s}=this;if(this._boundBufferBases[r]!==e){const n=this.getGlBuffer(e);this._boundBufferBases[r]=e,s.bindBufferBase(s.UNIFORM_BUFFER,r,n.buffer)}}bindBufferRange(e,r,s){const{_gl:n}=this;s=s||0;const i=this.getGlBuffer(e);n.bindBufferRange(n.UNIFORM_BUFFER,r||0,i.buffer,s*256,256)}updateBuffer(e){const{_gl:r}=this,s=this.getGlBuffer(e);if(e._updateID===s.updateID)return s;s.updateID=e._updateID,r.bindBuffer(s.type,s.buffer);const n=e.data;if(s.byteLength>=e.data.byteLength)r.bufferSubData(s.type,0,n,0,e._updateSize/n.BYTES_PER_ELEMENT);else{const i=e.descriptor.usage&A.STATIC?r.STATIC_DRAW:r.DYNAMIC_DRAW;s.byteLength=n.byteLength,r.bufferData(s.type,n,i)}return s}destroyAll(){const e=this._gl;for(const r in this._gpuBuffers)e.deleteBuffer(this._gpuBuffers[r].buffer);this._gpuBuffers=Object.create(null)}onBufferDestroy(e,r){const s=this._gpuBuffers[e.uid],n=this._gl;r||n.deleteBuffer(s.buffer),this._gpuBuffers[e.uid]=null}createGLBuffer(e){const{_gl:r}=this;let s=T.ARRAY_BUFFER;e.descriptor.usage&A.INDEX?s=T.ELEMENT_ARRAY_BUFFER:e.descriptor.usage&A.UNIFORM&&(s=T.UNIFORM_BUFFER);const n=new Ve(r.createBuffer(),s);return this._gpuBuffers[e.uid]=n,e.on("destroy",this.onBufferDestroy,this),n}}ee.extension={type:[l.WebGLSystem],name:"buffer"};const P=class te{constructor(e){this.supports={uint32Indices:!0,uniformBufferObject:!0,vertexArrayObject:!0,srgbTextures:!0,nonPowOf2wrapping:!0,msaa:!0,nonPowOf2mipmaps:!0},this._renderer=e,this.extensions=Object.create(null),this.handleContextLost=this.handleContextLost.bind(this),this.handleContextRestored=this.handleContextRestored.bind(this)}get isLost(){return!this.gl||this.gl.isContextLost()}contextChange(e){this.gl=e,this._renderer.gl=e}init(e){e={...te.defaultOptions,...e};let r=this.multiView=e.multiView;if(e.context&&r&&(m("Renderer created with both a context and multiview enabled. Disabling multiView as both cannot work together."),r=!1),r?this.canvas=S.get().createCanvas(this._renderer.canvas.width,this._renderer.canvas.height):this.canvas=this._renderer.view.canvas,e.context)this.initFromContext(e.context);else{const s=this._renderer.background.alpha<1,n=e.premultipliedAlpha??!0,i=e.antialias&&!this._renderer.backBuffer.useBackBuffer;this.createContext(e.preferWebGLVersion,{alpha:s,premultipliedAlpha:n,antialias:i,stencil:!0,preserveDrawingBuffer:e.preserveDrawingBuffer,powerPreference:e.powerPreference??"default"})}}ensureCanvasSize(e){if(!this.multiView){e!==this.canvas&&m("multiView is disabled, but targetCanvas is not the main canvas");return}const{canvas:r}=this;(r.width{var r;this.gl.isContextLost()&&((r=this.extensions.loseContext)==null||r.restoreContext())},0))}handleContextRestored(){this._renderer.runners.contextChange.emit(this.gl)}destroy(){var r;const e=this._renderer.view.canvas;this._renderer=null,e.removeEventListener("webglcontextlost",this.handleContextLost),e.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),(r=this.extensions.loseContext)==null||r.loseContext()}forceContextLoss(){var e;(e=this.extensions.loseContext)==null||e.loseContext(),this._contextLossForced=!0}validateContext(e){const r=e.getContextAttributes();r&&!r.stencil&&m("Provided WebGL context does not have a stencil buffer, masks may not render correctly");const s=this.supports,n=this.webGLVersion===2,i=this.extensions;s.uint32Indices=n||!!i.uint32ElementIndex,s.uniformBufferObject=n,s.vertexArrayObject=n||!!i.vertexArrayObject,s.srgbTextures=n||!!i.srgb,s.nonPowOf2wrapping=n,s.nonPowOf2mipmaps=n,s.msaa=n,s.uint32Indices||m("Provided WebGL context does not support 32 index buffer, large scenes may not render correctly")}};P.extension={type:[l.WebGLSystem],name:"context"};P.defaultOptions={context:null,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:void 0,preferWebGLVersion:2,multiView:!1};let ke=P;var y=(t=>(t[t.RGBA=6408]="RGBA",t[t.RGB=6407]="RGB",t[t.RG=33319]="RG",t[t.RED=6403]="RED",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.ALPHA=6406]="ALPHA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL",t))(y||{}),re=(t=>(t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",t))(re||{}),f=(t=>(t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.BYTE=5120]="BYTE",t[t.SHORT=5122]="SHORT",t[t.INT=5124]="INT",t[t.FLOAT=5126]="FLOAT",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.HALF_FLOAT=36193]="HALF_FLOAT",t))(f||{});const H={uint8x2:f.UNSIGNED_BYTE,uint8x4:f.UNSIGNED_BYTE,sint8x2:f.BYTE,sint8x4:f.BYTE,unorm8x2:f.UNSIGNED_BYTE,unorm8x4:f.UNSIGNED_BYTE,snorm8x2:f.BYTE,snorm8x4:f.BYTE,uint16x2:f.UNSIGNED_SHORT,uint16x4:f.UNSIGNED_SHORT,sint16x2:f.SHORT,sint16x4:f.SHORT,unorm16x2:f.UNSIGNED_SHORT,unorm16x4:f.UNSIGNED_SHORT,snorm16x2:f.SHORT,snorm16x4:f.SHORT,float16x2:f.HALF_FLOAT,float16x4:f.HALF_FLOAT,float32:f.FLOAT,float32x2:f.FLOAT,float32x3:f.FLOAT,float32x4:f.FLOAT,uint32:f.UNSIGNED_INT,uint32x2:f.UNSIGNED_INT,uint32x3:f.UNSIGNED_INT,uint32x4:f.UNSIGNED_INT,sint32:f.INT,sint32x2:f.INT,sint32x3:f.INT,sint32x4:f.INT};function Xe(t){return H[t]??H.float32}const We={"point-list":0,"line-list":1,"line-strip":3,"triangle-list":4,"triangle-strip":5};class se{constructor(e){this._geometryVaoHash=Object.create(null),this._renderer=e,this._activeGeometry=null,this._activeVao=null,this.hasVao=!0,this.hasInstance=!0,this._renderer.renderableGC.addManagedHash(this,"_geometryVaoHash")}contextChange(){const e=this.gl=this._renderer.gl;if(!this._renderer.context.supports.vertexArrayObject)throw new Error("[PixiJS] Vertex Array Objects are not supported on this device");const r=this._renderer.context.extensions.vertexArrayObject;r&&(e.createVertexArray=()=>r.createVertexArrayOES(),e.bindVertexArray=n=>r.bindVertexArrayOES(n),e.deleteVertexArray=n=>r.deleteVertexArrayOES(n));const s=this._renderer.context.extensions.vertexAttribDivisorANGLE;s&&(e.drawArraysInstanced=(n,i,a,o)=>{s.drawArraysInstancedANGLE(n,i,a,o)},e.drawElementsInstanced=(n,i,a,o,c)=>{s.drawElementsInstancedANGLE(n,i,a,o,c)},e.vertexAttribDivisor=(n,i)=>s.vertexAttribDivisorANGLE(n,i)),this._activeGeometry=null,this._activeVao=null,this._geometryVaoHash=Object.create(null)}bind(e,r){const s=this.gl;this._activeGeometry=e;const n=this.getVao(e,r);this._activeVao!==n&&(this._activeVao=n,s.bindVertexArray(n)),this.updateBuffers()}reset(){this.unbind()}updateBuffers(){const e=this._activeGeometry,r=this._renderer.buffer;for(let s=0;s1?i.drawElementsInstanced(o,r||a.indexBuffer.data.length,u,(s||0)*c,n):i.drawElements(o,r||a.indexBuffer.data.length,u,(s||0)*c)}else n>1?i.drawArraysInstanced(o,s||0,r||a.getSize(),n):i.drawArrays(o,s||0,r||a.getSize());return this}unbind(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null}destroy(){this._renderer=null,this.gl=null,this._activeVao=null,this._activeGeometry=null}}se.extension={type:[l.WebGLSystem],name:"geometry"};const je=new xe({attributes:{aPosition:[-1,-1,3,-1,-1,3]}}),F=class ne{constructor(e){this.useBackBuffer=!1,this._useBackBufferThisRender=!1,this._renderer=e}init(e={}){const{useBackBuffer:r,antialias:s}={...ne.defaultOptions,...e};this.useBackBuffer=r,this._antialias=s,this._renderer.context.supports.msaa||(m("antialiasing, is not supported on when using the back buffer"),this._antialias=!1),this._state=G.for2d();const n=new Ae({vertex:` +import{E as l,S as G,B as A,w as m,D as S,L as j,a3 as xe,x as Ae,u as U,a as p,T as K,d as g,Q as L,k as B,l as Be,m as O,s as $,M as z,a4 as Y,a5 as Ne,a6 as Ie,a7 as q,a8 as De,e as x,A as ye,R as Ce}from"./index-DKTylTFu.js";import{b as Z}from"./colorToUniform-fMvLSPph.js";import{e as Ge,G as Ue,c as Oe,b as Pe,U as Fe,R as Me,B as Q,d as N,f as Le,S as He,a as we}from"./SharedSystems-BYS0WgCL.js";class J{constructor(){this._didUpload=!1,this._tempState=G.for2d()}init(e){e.renderer.runners.contextChange.add(this)}contextChange(){this._didUpload=!1}start(e,r,s){const n=e.renderer;n.shader.bind(s,this._didUpload),n.shader.updateUniformGroup(n.globalUniforms.uniformGroup),n.geometry.bind(r,s.glProgram)}execute(e,r){const s=e.renderer;this._didUpload=!0,this._tempState.blendMode=r.blendMode,s.state.set(this._tempState);const n=r.textures.textures;for(let i=0;i(t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",t))(T||{});class Ve{constructor(e,r){this.buffer=e||null,this.updateID=-1,this.byteLength=-1,this.type=r}}class ee{constructor(e){this._gpuBuffers=Object.create(null),this._boundBufferBases=Object.create(null),this._renderer=e,this._renderer.renderableGC.addManagedHash(this,"_gpuBuffers")}destroy(){this._renderer=null,this._gl=null,this._gpuBuffers=null,this._boundBufferBases=null}contextChange(){this._gpuBuffers=Object.create(null),this._gl=this._renderer.gl}getGlBuffer(e){return this._gpuBuffers[e.uid]||this.createGLBuffer(e)}bind(e){const{_gl:r}=this,s=this.getGlBuffer(e);r.bindBuffer(s.type,s.buffer)}bindBufferBase(e,r){const{_gl:s}=this;if(this._boundBufferBases[r]!==e){const n=this.getGlBuffer(e);this._boundBufferBases[r]=e,s.bindBufferBase(s.UNIFORM_BUFFER,r,n.buffer)}}bindBufferRange(e,r,s){const{_gl:n}=this;s=s||0;const i=this.getGlBuffer(e);n.bindBufferRange(n.UNIFORM_BUFFER,r||0,i.buffer,s*256,256)}updateBuffer(e){const{_gl:r}=this,s=this.getGlBuffer(e);if(e._updateID===s.updateID)return s;s.updateID=e._updateID,r.bindBuffer(s.type,s.buffer);const n=e.data;if(s.byteLength>=e.data.byteLength)r.bufferSubData(s.type,0,n,0,e._updateSize/n.BYTES_PER_ELEMENT);else{const i=e.descriptor.usage&A.STATIC?r.STATIC_DRAW:r.DYNAMIC_DRAW;s.byteLength=n.byteLength,r.bufferData(s.type,n,i)}return s}destroyAll(){const e=this._gl;for(const r in this._gpuBuffers)e.deleteBuffer(this._gpuBuffers[r].buffer);this._gpuBuffers=Object.create(null)}onBufferDestroy(e,r){const s=this._gpuBuffers[e.uid],n=this._gl;r||n.deleteBuffer(s.buffer),this._gpuBuffers[e.uid]=null}createGLBuffer(e){const{_gl:r}=this;let s=T.ARRAY_BUFFER;e.descriptor.usage&A.INDEX?s=T.ELEMENT_ARRAY_BUFFER:e.descriptor.usage&A.UNIFORM&&(s=T.UNIFORM_BUFFER);const n=new Ve(r.createBuffer(),s);return this._gpuBuffers[e.uid]=n,e.on("destroy",this.onBufferDestroy,this),n}}ee.extension={type:[l.WebGLSystem],name:"buffer"};const P=class te{constructor(e){this.supports={uint32Indices:!0,uniformBufferObject:!0,vertexArrayObject:!0,srgbTextures:!0,nonPowOf2wrapping:!0,msaa:!0,nonPowOf2mipmaps:!0},this._renderer=e,this.extensions=Object.create(null),this.handleContextLost=this.handleContextLost.bind(this),this.handleContextRestored=this.handleContextRestored.bind(this)}get isLost(){return!this.gl||this.gl.isContextLost()}contextChange(e){this.gl=e,this._renderer.gl=e}init(e){e={...te.defaultOptions,...e};let r=this.multiView=e.multiView;if(e.context&&r&&(m("Renderer created with both a context and multiview enabled. Disabling multiView as both cannot work together."),r=!1),r?this.canvas=S.get().createCanvas(this._renderer.canvas.width,this._renderer.canvas.height):this.canvas=this._renderer.view.canvas,e.context)this.initFromContext(e.context);else{const s=this._renderer.background.alpha<1,n=e.premultipliedAlpha??!0,i=e.antialias&&!this._renderer.backBuffer.useBackBuffer;this.createContext(e.preferWebGLVersion,{alpha:s,premultipliedAlpha:n,antialias:i,stencil:!0,preserveDrawingBuffer:e.preserveDrawingBuffer,powerPreference:e.powerPreference??"default"})}}ensureCanvasSize(e){if(!this.multiView){e!==this.canvas&&m("multiView is disabled, but targetCanvas is not the main canvas");return}const{canvas:r}=this;(r.width{var r;this.gl.isContextLost()&&((r=this.extensions.loseContext)==null||r.restoreContext())},0))}handleContextRestored(){this._renderer.runners.contextChange.emit(this.gl)}destroy(){var r;const e=this._renderer.view.canvas;this._renderer=null,e.removeEventListener("webglcontextlost",this.handleContextLost),e.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),(r=this.extensions.loseContext)==null||r.loseContext()}forceContextLoss(){var e;(e=this.extensions.loseContext)==null||e.loseContext(),this._contextLossForced=!0}validateContext(e){const r=e.getContextAttributes();r&&!r.stencil&&m("Provided WebGL context does not have a stencil buffer, masks may not render correctly");const s=this.supports,n=this.webGLVersion===2,i=this.extensions;s.uint32Indices=n||!!i.uint32ElementIndex,s.uniformBufferObject=n,s.vertexArrayObject=n||!!i.vertexArrayObject,s.srgbTextures=n||!!i.srgb,s.nonPowOf2wrapping=n,s.nonPowOf2mipmaps=n,s.msaa=n,s.uint32Indices||m("Provided WebGL context does not support 32 index buffer, large scenes may not render correctly")}};P.extension={type:[l.WebGLSystem],name:"context"};P.defaultOptions={context:null,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:void 0,preferWebGLVersion:2,multiView:!1};let ke=P;var y=(t=>(t[t.RGBA=6408]="RGBA",t[t.RGB=6407]="RGB",t[t.RG=33319]="RG",t[t.RED=6403]="RED",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.ALPHA=6406]="ALPHA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL",t))(y||{}),re=(t=>(t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",t))(re||{}),f=(t=>(t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.BYTE=5120]="BYTE",t[t.SHORT=5122]="SHORT",t[t.INT=5124]="INT",t[t.FLOAT=5126]="FLOAT",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",t[t.HALF_FLOAT=36193]="HALF_FLOAT",t))(f||{});const H={uint8x2:f.UNSIGNED_BYTE,uint8x4:f.UNSIGNED_BYTE,sint8x2:f.BYTE,sint8x4:f.BYTE,unorm8x2:f.UNSIGNED_BYTE,unorm8x4:f.UNSIGNED_BYTE,snorm8x2:f.BYTE,snorm8x4:f.BYTE,uint16x2:f.UNSIGNED_SHORT,uint16x4:f.UNSIGNED_SHORT,sint16x2:f.SHORT,sint16x4:f.SHORT,unorm16x2:f.UNSIGNED_SHORT,unorm16x4:f.UNSIGNED_SHORT,snorm16x2:f.SHORT,snorm16x4:f.SHORT,float16x2:f.HALF_FLOAT,float16x4:f.HALF_FLOAT,float32:f.FLOAT,float32x2:f.FLOAT,float32x3:f.FLOAT,float32x4:f.FLOAT,uint32:f.UNSIGNED_INT,uint32x2:f.UNSIGNED_INT,uint32x3:f.UNSIGNED_INT,uint32x4:f.UNSIGNED_INT,sint32:f.INT,sint32x2:f.INT,sint32x3:f.INT,sint32x4:f.INT};function Xe(t){return H[t]??H.float32}const We={"point-list":0,"line-list":1,"line-strip":3,"triangle-list":4,"triangle-strip":5};class se{constructor(e){this._geometryVaoHash=Object.create(null),this._renderer=e,this._activeGeometry=null,this._activeVao=null,this.hasVao=!0,this.hasInstance=!0,this._renderer.renderableGC.addManagedHash(this,"_geometryVaoHash")}contextChange(){const e=this.gl=this._renderer.gl;if(!this._renderer.context.supports.vertexArrayObject)throw new Error("[PixiJS] Vertex Array Objects are not supported on this device");const r=this._renderer.context.extensions.vertexArrayObject;r&&(e.createVertexArray=()=>r.createVertexArrayOES(),e.bindVertexArray=n=>r.bindVertexArrayOES(n),e.deleteVertexArray=n=>r.deleteVertexArrayOES(n));const s=this._renderer.context.extensions.vertexAttribDivisorANGLE;s&&(e.drawArraysInstanced=(n,i,a,o)=>{s.drawArraysInstancedANGLE(n,i,a,o)},e.drawElementsInstanced=(n,i,a,o,c)=>{s.drawElementsInstancedANGLE(n,i,a,o,c)},e.vertexAttribDivisor=(n,i)=>s.vertexAttribDivisorANGLE(n,i)),this._activeGeometry=null,this._activeVao=null,this._geometryVaoHash=Object.create(null)}bind(e,r){const s=this.gl;this._activeGeometry=e;const n=this.getVao(e,r);this._activeVao!==n&&(this._activeVao=n,s.bindVertexArray(n)),this.updateBuffers()}reset(){this.unbind()}updateBuffers(){const e=this._activeGeometry,r=this._renderer.buffer;for(let s=0;s1?i.drawElementsInstanced(o,r||a.indexBuffer.data.length,u,(s||0)*c,n):i.drawElements(o,r||a.indexBuffer.data.length,u,(s||0)*c)}else n>1?i.drawArraysInstanced(o,s||0,r||a.getSize(),n):i.drawArrays(o,s||0,r||a.getSize());return this}unbind(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null}destroy(){this._renderer=null,this.gl=null,this._activeVao=null,this._activeGeometry=null}}se.extension={type:[l.WebGLSystem],name:"geometry"};const je=new xe({attributes:{aPosition:[-1,-1,3,-1,-1,3]}}),F=class ne{constructor(e){this.useBackBuffer=!1,this._useBackBufferThisRender=!1,this._renderer=e}init(e={}){const{useBackBuffer:r,antialias:s}={...ne.defaultOptions,...e};this.useBackBuffer=r,this._antialias=s,this._renderer.context.supports.msaa||(m("antialiasing, is not supported on when using the back buffer"),this._antialias=!1),this._state=G.for2d();const n=new Ae({vertex:` attribute vec2 aPosition; out vec2 vUv; diff --git a/front/dist/assets/WebGPURenderer-YFZ97DWp.js b/front/dist/assets/WebGPURenderer-CMHfAOBn.js similarity index 99% rename from front/dist/assets/WebGPURenderer-YFZ97DWp.js rename to front/dist/assets/WebGPURenderer-CMHfAOBn.js index bba8499..875cea2 100644 --- a/front/dist/assets/WebGPURenderer-YFZ97DWp.js +++ b/front/dist/assets/WebGPURenderer-CMHfAOBn.js @@ -1,4 +1,4 @@ -import{S as w,E as l,g as R,f as ne,D as P,d as T,B as S,h as oe,i as E,j as v,w as A,k as b,l as ae,T as ue,m as k,M as L,o as D,p as ce,q as de,s as he,t as H,u as z,a as U,e as G,A as pe,R as le}from"./index-CQrWNA4L.js";import{l as fe,a as ge}from"./colorToUniform-DaN3ccwh.js";import{c as me,u as _e,U as be,B as ye,G as xe,e as Ge,R as Be,t as Se,S as Pe,a as Te}from"./SharedSystems-BCvEDrAl.js";import{C as M}from"./CanvasPool-DfMFozUt.js";const y=w.for2d();class F{start(e,t,r){const s=e.renderer,i=s.encoder,n=r.gpuProgram;this._shader=r,this._geometry=t,i.setGeometry(t,n),y.blendMode="normal",s.pipeline.getPipeline(t,n,y);const o=s.globalUniforms.bindGroup;i.resetBindGroup(1),i.setBindGroup(0,o,n)}execute(e,t){const r=this._shader.gpuProgram,s=e.renderer,i=s.encoder;if(!t.bindGroup){const u=t.textures;t.bindGroup=R(u.textures,u.count)}y.blendMode=t.blendMode;const n=s.bindGroup.getBindGroup(t.bindGroup,r,1),o=s.pipeline.getPipeline(this._geometry,r,y);t.bindGroup._touch(s.textureGC.count),i.setPipeline(o),i.renderPassEncoder.setBindGroup(1,n),i.renderPassEncoder.drawIndexed(t.size,1,t.start)}}F.extension={type:[l.WebGPUPipesAdaptor],name:"batch"};class O{constructor(e){this._hash=Object.create(null),this._renderer=e,this._renderer.renderableGC.addManagedHash(this,"_hash")}contextChange(e){this._gpu=e}getBindGroup(e,t,r){return e._updateKey(),this._hash[e._key]||this._createBindGroup(e,t,r)}_createBindGroup(e,t,r){const s=this._gpu.device,i=t.layout[r],n=[],o=this._renderer;for(const f in i){const h=e.resources[f]??e.resources[i[f]];let p;if(h._resourceType==="uniformGroup"){const d=h;o.ubo.updateUniformGroup(d);const g=d.buffer;p={buffer:o.buffer.getGPUBuffer(g),offset:0,size:g.descriptor.size}}else if(h._resourceType==="buffer"){const d=h;p={buffer:o.buffer.getGPUBuffer(d),offset:0,size:d.descriptor.size}}else if(h._resourceType==="bufferResource"){const d=h;p={buffer:o.buffer.getGPUBuffer(d.buffer),offset:d.offset,size:d.size}}else if(h._resourceType==="textureSampler"){const d=h;p=o.texture.getGpuSampler(d)}else if(h._resourceType==="textureSource"){const d=h;p=o.texture.getGpuSource(d).createView({})}n.push({binding:i[f],resource:p})}const u=o.shader.getProgramData(t).bindGroups[r],c=s.createBindGroup({layout:u,entries:n});return this._hash[e._key]=c,c}destroy(){for(const e of Object.keys(this._hash))this._hash[e]=null;this._hash=null,this._renderer=null}}O.extension={type:[l.WebGPUSystem],name:"bindGroup"};class W{constructor(e){this._gpuBuffers=Object.create(null),this._managedBuffers=[],e.renderableGC.addManagedHash(this,"_gpuBuffers")}contextChange(e){this._gpu=e}getGPUBuffer(e){return this._gpuBuffers[e.uid]||this.createGPUBuffer(e)}updateBuffer(e){const t=this._gpuBuffers[e.uid]||this.createGPUBuffer(e),r=e.data;return e._updateID&&r&&(e._updateID=0,this._gpu.device.queue.writeBuffer(t,0,r.buffer,0,(e._updateSize||r.byteLength)+3&-4)),t}destroyAll(){for(const e in this._gpuBuffers)this._gpuBuffers[e].destroy();this._gpuBuffers={}}createGPUBuffer(e){this._gpuBuffers[e.uid]||(e.on("update",this.updateBuffer,this),e.on("change",this.onBufferChange,this),e.on("destroy",this.onBufferDestroy,this),this._managedBuffers.push(e));const t=this._gpu.device.createBuffer(e.descriptor);return e._updateID=0,e.data&&(ne(e.data.buffer,t.getMappedRange()),t.unmap()),this._gpuBuffers[e.uid]=t,t}onBufferChange(e){this._gpuBuffers[e.uid].destroy(),e._updateID=0,this._gpuBuffers[e.uid]=this.createGPUBuffer(e)}onBufferDestroy(e){this._managedBuffers.splice(this._managedBuffers.indexOf(e),1),this._destroyBuffer(e)}destroy(){this._managedBuffers.forEach(e=>this._destroyBuffer(e)),this._managedBuffers=null,this._gpuBuffers=null}_destroyBuffer(e){this._gpuBuffers[e.uid].destroy(),e.off("update",this.updateBuffer,this),e.off("change",this.onBufferChange,this),e.off("destroy",this.onBufferDestroy,this),this._gpuBuffers[e.uid]=null}}W.extension={type:[l.WebGPUSystem],name:"buffer"};class Ce{constructor({minUniformOffsetAlignment:e}){this._minUniformOffsetAlignment=256,this.byteIndex=0,this._minUniformOffsetAlignment=e,this.data=new Float32Array(65535)}clear(){this.byteIndex=0}addEmptyGroup(e){if(e>this._minUniformOffsetAlignment/4)throw new Error(`UniformBufferBatch: array is too large: ${e*4}`);const t=this.byteIndex;let r=t+e*4;if(r=Math.ceil(r/this._minUniformOffsetAlignment)*this._minUniformOffsetAlignment,r>this.data.length*4)throw new Error("UniformBufferBatch: ubo batch got too big");return this.byteIndex=r,t}addGroup(e){const t=this.addEmptyGroup(e.length);for(let r=0;r{this.gpu=t,this._renderer.runners.contextChange.emit(this.gpu)}),this._initPromise)}contextChange(e){this._renderer.gpu=e}async _createDeviceAndAdaptor(e){const t=await P.get().getNavigator().gpu.requestAdapter({powerPreference:e.powerPreference,forceFallbackAdapter:e.forceFallbackAdapter}),r=["texture-compression-bc","texture-compression-astc","texture-compression-etc2"].filter(i=>t.features.has(i)),s=await t.requestDevice({requiredFeatures:r});return{adapter:t,device:s}}destroy(){this.gpu=null,this._renderer=null}}C.extension={type:[l.WebGPUSystem],name:"device"};C.defaultOptions={powerPreference:void 0,forceFallbackAdapter:!1};class V{constructor(e){this._boundBindGroup=Object.create(null),this._boundVertexBuffer=Object.create(null),this._renderer=e}renderStart(){this.commandFinished=new Promise(e=>{this._resolveCommandFinished=e}),this.commandEncoder=this._renderer.gpu.device.createCommandEncoder()}beginRenderPass(e){this.endRenderPass(),this._clearCache(),this.renderPassEncoder=this.commandEncoder.beginRenderPass(e.descriptor)}endRenderPass(){this.renderPassEncoder&&this.renderPassEncoder.end(),this.renderPassEncoder=null}setViewport(e){this.renderPassEncoder.setViewport(e.x,e.y,e.width,e.height,0,1)}setPipelineFromGeometryProgramAndState(e,t,r,s){const i=this._renderer.pipeline.getPipeline(e,t,r,s);this.setPipeline(i)}setPipeline(e){this._boundPipeline!==e&&(this._boundPipeline=e,this.renderPassEncoder.setPipeline(e))}_setVertexBuffer(e,t){this._boundVertexBuffer[e]!==t&&(this._boundVertexBuffer[e]=t,this.renderPassEncoder.setVertexBuffer(e,this._renderer.buffer.updateBuffer(t)))}_setIndexBuffer(e){if(this._boundIndexBuffer===e)return;this._boundIndexBuffer=e;const t=e.data.BYTES_PER_ELEMENT===2?"uint16":"uint32";this.renderPassEncoder.setIndexBuffer(this._renderer.buffer.updateBuffer(e),t)}resetBindGroup(e){this._boundBindGroup[e]=null}setBindGroup(e,t,r){if(this._boundBindGroup[e]===t)return;this._boundBindGroup[e]=t,t._touch(this._renderer.textureGC.count);const s=this._renderer.bindGroup.getBindGroup(t,r,e);this.renderPassEncoder.setBindGroup(e,s)}setGeometry(e,t){const r=this._renderer.pipeline.getBufferNamesToBind(e,t);for(const s in r)this._setVertexBuffer(s,e.attributes[r[s]].buffer);e.indexBuffer&&this._setIndexBuffer(e.indexBuffer)}_setShaderBindGroups(e,t){for(const r in e.groups){const s=e.groups[r];t||this._syncBindGroup(s),this.setBindGroup(r,s,e.gpuProgram)}}_syncBindGroup(e){for(const t in e.resources){const r=e.resources[t];r.isUniformGroup&&this._renderer.ubo.updateUniformGroup(r)}}draw(e){const{geometry:t,shader:r,state:s,topology:i,size:n,start:o,instanceCount:u,skipSync:c}=e;this.setPipelineFromGeometryProgramAndState(t,r.gpuProgram,s,i),this.setGeometry(t,r.gpuProgram),this._setShaderBindGroups(r,c),t.indexBuffer?this.renderPassEncoder.drawIndexed(n||t.indexBuffer.data.length,u||t.instanceCount,o||0):this.renderPassEncoder.draw(n||t.getSize(),u||t.instanceCount,o||0)}finishRenderPass(){this.renderPassEncoder&&(this.renderPassEncoder.end(),this.renderPassEncoder=null)}postrender(){this.finishRenderPass(),this._gpu.device.queue.submit([this.commandEncoder.finish()]),this._resolveCommandFinished(),this.commandEncoder=null}restoreRenderPass(){const e=this._renderer.renderTarget.adaptor.getDescriptor(this._renderer.renderTarget.renderTarget,!1,[0,0,0,1]);this.renderPassEncoder=this.commandEncoder.beginRenderPass(e);const t=this._boundPipeline,r={...this._boundVertexBuffer},s=this._boundIndexBuffer,i={...this._boundBindGroup};this._clearCache();const n=this._renderer.renderTarget.viewport;this.renderPassEncoder.setViewport(n.x,n.y,n.width,n.height,0,1),this.setPipeline(t);for(const o in r)this._setVertexBuffer(o,r[o]);for(const o in i)this.setBindGroup(o,i[o],null);this._setIndexBuffer(s)}_clearCache(){for(let e=0;e<16;e++)this._boundBindGroup[e]=null,this._boundVertexBuffer[e]=null;this._boundIndexBuffer=null,this._boundPipeline=null}destroy(){this._renderer=null,this._gpu=null,this._boundBindGroup=null,this._boundVertexBuffer=null,this._boundIndexBuffer=null,this._boundPipeline=null}contextChange(e){this._gpu=e}}V.extension={type:[l.WebGPUSystem],name:"encoder",priority:1};class N{constructor(e){this._renderTargetStencilState=Object.create(null),this._renderer=e,e.renderTarget.onRenderTargetChange.add(this)}onRenderTargetChange(e){let t=this._renderTargetStencilState[e.uid];t||(t=this._renderTargetStencilState[e.uid]={stencilMode:T.DISABLED,stencilReference:0}),this._activeRenderTarget=e,this.setStencilMode(t.stencilMode,t.stencilReference)}setStencilMode(e,t){const r=this._renderTargetStencilState[this._activeRenderTarget.uid];r.stencilMode=e,r.stencilReference=t;const s=this._renderer;s.pipeline.setStencilMode(e),s.encoder.renderPassEncoder.setStencilReference(t)}destroy(){this._renderer.renderTarget.onRenderTargetChange.remove(this),this._renderer=null,this._activeRenderTarget=null,this._renderTargetStencilState=null}}N.extension={type:[l.WebGPUSystem],name:"stencil"};const x={i32:{align:4,size:4},u32:{align:4,size:4},f32:{align:4,size:4},f16:{align:2,size:2},"vec2":{align:8,size:8},"vec2":{align:8,size:8},"vec2":{align:8,size:8},"vec2":{align:4,size:4},"vec3":{align:16,size:12},"vec3":{align:16,size:12},"vec3":{align:16,size:12},"vec3":{align:8,size:6},"vec4":{align:16,size:16},"vec4":{align:16,size:16},"vec4":{align:16,size:16},"vec4":{align:8,size:8},"mat2x2":{align:8,size:16},"mat2x2":{align:4,size:8},"mat3x2":{align:8,size:24},"mat3x2":{align:4,size:12},"mat4x2":{align:8,size:32},"mat4x2":{align:4,size:16},"mat2x3":{align:16,size:32},"mat2x3":{align:8,size:16},"mat3x3":{align:16,size:48},"mat3x3":{align:8,size:24},"mat4x3":{align:16,size:64},"mat4x3":{align:8,size:32},"mat2x4":{align:16,size:32},"mat2x4":{align:8,size:16},"mat3x4":{align:16,size:48},"mat3x4":{align:8,size:24},"mat4x4":{align:16,size:64},"mat4x4":{align:8,size:32}};function ve(a){const e=a.map(r=>({data:r,offset:0,size:0}));let t=0;for(let r=0;r1&&(i=Math.max(i,n)*s.data.size),t=Math.ceil(t/n)*n,s.size=i,s.offset=t,t+=i}return t=Math.ceil(t/16)*16,{uboElements:e,size:t}}function Ue(a,e){const{size:t,align:r}=x[a.data.type],s=(r-t)/4;return` +import{S as w,E as l,g as R,f as ne,D as P,d as T,B as S,h as oe,i as E,j as v,w as A,k as b,l as ae,T as ue,m as k,M as L,o as D,p as ce,q as de,s as he,t as H,u as z,a as U,e as G,A as pe,R as le}from"./index-DKTylTFu.js";import{l as fe,a as ge}from"./colorToUniform-fMvLSPph.js";import{c as me,u as _e,U as be,B as ye,G as xe,e as Ge,R as Be,t as Se,S as Pe,a as Te}from"./SharedSystems-BYS0WgCL.js";import{C as M}from"./CanvasPool-Df6Z7K0X.js";const y=w.for2d();class F{start(e,t,r){const s=e.renderer,i=s.encoder,n=r.gpuProgram;this._shader=r,this._geometry=t,i.setGeometry(t,n),y.blendMode="normal",s.pipeline.getPipeline(t,n,y);const o=s.globalUniforms.bindGroup;i.resetBindGroup(1),i.setBindGroup(0,o,n)}execute(e,t){const r=this._shader.gpuProgram,s=e.renderer,i=s.encoder;if(!t.bindGroup){const u=t.textures;t.bindGroup=R(u.textures,u.count)}y.blendMode=t.blendMode;const n=s.bindGroup.getBindGroup(t.bindGroup,r,1),o=s.pipeline.getPipeline(this._geometry,r,y);t.bindGroup._touch(s.textureGC.count),i.setPipeline(o),i.renderPassEncoder.setBindGroup(1,n),i.renderPassEncoder.drawIndexed(t.size,1,t.start)}}F.extension={type:[l.WebGPUPipesAdaptor],name:"batch"};class O{constructor(e){this._hash=Object.create(null),this._renderer=e,this._renderer.renderableGC.addManagedHash(this,"_hash")}contextChange(e){this._gpu=e}getBindGroup(e,t,r){return e._updateKey(),this._hash[e._key]||this._createBindGroup(e,t,r)}_createBindGroup(e,t,r){const s=this._gpu.device,i=t.layout[r],n=[],o=this._renderer;for(const f in i){const h=e.resources[f]??e.resources[i[f]];let p;if(h._resourceType==="uniformGroup"){const d=h;o.ubo.updateUniformGroup(d);const g=d.buffer;p={buffer:o.buffer.getGPUBuffer(g),offset:0,size:g.descriptor.size}}else if(h._resourceType==="buffer"){const d=h;p={buffer:o.buffer.getGPUBuffer(d),offset:0,size:d.descriptor.size}}else if(h._resourceType==="bufferResource"){const d=h;p={buffer:o.buffer.getGPUBuffer(d.buffer),offset:d.offset,size:d.size}}else if(h._resourceType==="textureSampler"){const d=h;p=o.texture.getGpuSampler(d)}else if(h._resourceType==="textureSource"){const d=h;p=o.texture.getGpuSource(d).createView({})}n.push({binding:i[f],resource:p})}const u=o.shader.getProgramData(t).bindGroups[r],c=s.createBindGroup({layout:u,entries:n});return this._hash[e._key]=c,c}destroy(){for(const e of Object.keys(this._hash))this._hash[e]=null;this._hash=null,this._renderer=null}}O.extension={type:[l.WebGPUSystem],name:"bindGroup"};class W{constructor(e){this._gpuBuffers=Object.create(null),this._managedBuffers=[],e.renderableGC.addManagedHash(this,"_gpuBuffers")}contextChange(e){this._gpu=e}getGPUBuffer(e){return this._gpuBuffers[e.uid]||this.createGPUBuffer(e)}updateBuffer(e){const t=this._gpuBuffers[e.uid]||this.createGPUBuffer(e),r=e.data;return e._updateID&&r&&(e._updateID=0,this._gpu.device.queue.writeBuffer(t,0,r.buffer,0,(e._updateSize||r.byteLength)+3&-4)),t}destroyAll(){for(const e in this._gpuBuffers)this._gpuBuffers[e].destroy();this._gpuBuffers={}}createGPUBuffer(e){this._gpuBuffers[e.uid]||(e.on("update",this.updateBuffer,this),e.on("change",this.onBufferChange,this),e.on("destroy",this.onBufferDestroy,this),this._managedBuffers.push(e));const t=this._gpu.device.createBuffer(e.descriptor);return e._updateID=0,e.data&&(ne(e.data.buffer,t.getMappedRange()),t.unmap()),this._gpuBuffers[e.uid]=t,t}onBufferChange(e){this._gpuBuffers[e.uid].destroy(),e._updateID=0,this._gpuBuffers[e.uid]=this.createGPUBuffer(e)}onBufferDestroy(e){this._managedBuffers.splice(this._managedBuffers.indexOf(e),1),this._destroyBuffer(e)}destroy(){this._managedBuffers.forEach(e=>this._destroyBuffer(e)),this._managedBuffers=null,this._gpuBuffers=null}_destroyBuffer(e){this._gpuBuffers[e.uid].destroy(),e.off("update",this.updateBuffer,this),e.off("change",this.onBufferChange,this),e.off("destroy",this.onBufferDestroy,this),this._gpuBuffers[e.uid]=null}}W.extension={type:[l.WebGPUSystem],name:"buffer"};class Ce{constructor({minUniformOffsetAlignment:e}){this._minUniformOffsetAlignment=256,this.byteIndex=0,this._minUniformOffsetAlignment=e,this.data=new Float32Array(65535)}clear(){this.byteIndex=0}addEmptyGroup(e){if(e>this._minUniformOffsetAlignment/4)throw new Error(`UniformBufferBatch: array is too large: ${e*4}`);const t=this.byteIndex;let r=t+e*4;if(r=Math.ceil(r/this._minUniformOffsetAlignment)*this._minUniformOffsetAlignment,r>this.data.length*4)throw new Error("UniformBufferBatch: ubo batch got too big");return this.byteIndex=r,t}addGroup(e){const t=this.addEmptyGroup(e.length);for(let r=0;r{this.gpu=t,this._renderer.runners.contextChange.emit(this.gpu)}),this._initPromise)}contextChange(e){this._renderer.gpu=e}async _createDeviceAndAdaptor(e){const t=await P.get().getNavigator().gpu.requestAdapter({powerPreference:e.powerPreference,forceFallbackAdapter:e.forceFallbackAdapter}),r=["texture-compression-bc","texture-compression-astc","texture-compression-etc2"].filter(i=>t.features.has(i)),s=await t.requestDevice({requiredFeatures:r});return{adapter:t,device:s}}destroy(){this.gpu=null,this._renderer=null}}C.extension={type:[l.WebGPUSystem],name:"device"};C.defaultOptions={powerPreference:void 0,forceFallbackAdapter:!1};class V{constructor(e){this._boundBindGroup=Object.create(null),this._boundVertexBuffer=Object.create(null),this._renderer=e}renderStart(){this.commandFinished=new Promise(e=>{this._resolveCommandFinished=e}),this.commandEncoder=this._renderer.gpu.device.createCommandEncoder()}beginRenderPass(e){this.endRenderPass(),this._clearCache(),this.renderPassEncoder=this.commandEncoder.beginRenderPass(e.descriptor)}endRenderPass(){this.renderPassEncoder&&this.renderPassEncoder.end(),this.renderPassEncoder=null}setViewport(e){this.renderPassEncoder.setViewport(e.x,e.y,e.width,e.height,0,1)}setPipelineFromGeometryProgramAndState(e,t,r,s){const i=this._renderer.pipeline.getPipeline(e,t,r,s);this.setPipeline(i)}setPipeline(e){this._boundPipeline!==e&&(this._boundPipeline=e,this.renderPassEncoder.setPipeline(e))}_setVertexBuffer(e,t){this._boundVertexBuffer[e]!==t&&(this._boundVertexBuffer[e]=t,this.renderPassEncoder.setVertexBuffer(e,this._renderer.buffer.updateBuffer(t)))}_setIndexBuffer(e){if(this._boundIndexBuffer===e)return;this._boundIndexBuffer=e;const t=e.data.BYTES_PER_ELEMENT===2?"uint16":"uint32";this.renderPassEncoder.setIndexBuffer(this._renderer.buffer.updateBuffer(e),t)}resetBindGroup(e){this._boundBindGroup[e]=null}setBindGroup(e,t,r){if(this._boundBindGroup[e]===t)return;this._boundBindGroup[e]=t,t._touch(this._renderer.textureGC.count);const s=this._renderer.bindGroup.getBindGroup(t,r,e);this.renderPassEncoder.setBindGroup(e,s)}setGeometry(e,t){const r=this._renderer.pipeline.getBufferNamesToBind(e,t);for(const s in r)this._setVertexBuffer(s,e.attributes[r[s]].buffer);e.indexBuffer&&this._setIndexBuffer(e.indexBuffer)}_setShaderBindGroups(e,t){for(const r in e.groups){const s=e.groups[r];t||this._syncBindGroup(s),this.setBindGroup(r,s,e.gpuProgram)}}_syncBindGroup(e){for(const t in e.resources){const r=e.resources[t];r.isUniformGroup&&this._renderer.ubo.updateUniformGroup(r)}}draw(e){const{geometry:t,shader:r,state:s,topology:i,size:n,start:o,instanceCount:u,skipSync:c}=e;this.setPipelineFromGeometryProgramAndState(t,r.gpuProgram,s,i),this.setGeometry(t,r.gpuProgram),this._setShaderBindGroups(r,c),t.indexBuffer?this.renderPassEncoder.drawIndexed(n||t.indexBuffer.data.length,u||t.instanceCount,o||0):this.renderPassEncoder.draw(n||t.getSize(),u||t.instanceCount,o||0)}finishRenderPass(){this.renderPassEncoder&&(this.renderPassEncoder.end(),this.renderPassEncoder=null)}postrender(){this.finishRenderPass(),this._gpu.device.queue.submit([this.commandEncoder.finish()]),this._resolveCommandFinished(),this.commandEncoder=null}restoreRenderPass(){const e=this._renderer.renderTarget.adaptor.getDescriptor(this._renderer.renderTarget.renderTarget,!1,[0,0,0,1]);this.renderPassEncoder=this.commandEncoder.beginRenderPass(e);const t=this._boundPipeline,r={...this._boundVertexBuffer},s=this._boundIndexBuffer,i={...this._boundBindGroup};this._clearCache();const n=this._renderer.renderTarget.viewport;this.renderPassEncoder.setViewport(n.x,n.y,n.width,n.height,0,1),this.setPipeline(t);for(const o in r)this._setVertexBuffer(o,r[o]);for(const o in i)this.setBindGroup(o,i[o],null);this._setIndexBuffer(s)}_clearCache(){for(let e=0;e<16;e++)this._boundBindGroup[e]=null,this._boundVertexBuffer[e]=null;this._boundIndexBuffer=null,this._boundPipeline=null}destroy(){this._renderer=null,this._gpu=null,this._boundBindGroup=null,this._boundVertexBuffer=null,this._boundIndexBuffer=null,this._boundPipeline=null}contextChange(e){this._gpu=e}}V.extension={type:[l.WebGPUSystem],name:"encoder",priority:1};class N{constructor(e){this._renderTargetStencilState=Object.create(null),this._renderer=e,e.renderTarget.onRenderTargetChange.add(this)}onRenderTargetChange(e){let t=this._renderTargetStencilState[e.uid];t||(t=this._renderTargetStencilState[e.uid]={stencilMode:T.DISABLED,stencilReference:0}),this._activeRenderTarget=e,this.setStencilMode(t.stencilMode,t.stencilReference)}setStencilMode(e,t){const r=this._renderTargetStencilState[this._activeRenderTarget.uid];r.stencilMode=e,r.stencilReference=t;const s=this._renderer;s.pipeline.setStencilMode(e),s.encoder.renderPassEncoder.setStencilReference(t)}destroy(){this._renderer.renderTarget.onRenderTargetChange.remove(this),this._renderer=null,this._activeRenderTarget=null,this._renderTargetStencilState=null}}N.extension={type:[l.WebGPUSystem],name:"stencil"};const x={i32:{align:4,size:4},u32:{align:4,size:4},f32:{align:4,size:4},f16:{align:2,size:2},"vec2":{align:8,size:8},"vec2":{align:8,size:8},"vec2":{align:8,size:8},"vec2":{align:4,size:4},"vec3":{align:16,size:12},"vec3":{align:16,size:12},"vec3":{align:16,size:12},"vec3":{align:8,size:6},"vec4":{align:16,size:16},"vec4":{align:16,size:16},"vec4":{align:16,size:16},"vec4":{align:8,size:8},"mat2x2":{align:8,size:16},"mat2x2":{align:4,size:8},"mat3x2":{align:8,size:24},"mat3x2":{align:4,size:12},"mat4x2":{align:8,size:32},"mat4x2":{align:4,size:16},"mat2x3":{align:16,size:32},"mat2x3":{align:8,size:16},"mat3x3":{align:16,size:48},"mat3x3":{align:8,size:24},"mat4x3":{align:16,size:64},"mat4x3":{align:8,size:32},"mat2x4":{align:16,size:32},"mat2x4":{align:8,size:16},"mat3x4":{align:16,size:48},"mat3x4":{align:8,size:24},"mat4x4":{align:16,size:64},"mat4x4":{align:8,size:32}};function ve(a){const e=a.map(r=>({data:r,offset:0,size:0}));let t=0;for(let r=0;r1&&(i=Math.max(i,n)*s.data.size),t=Math.ceil(t/n)*n,s.size=i,s.offset=t,t+=i}return t=Math.ceil(t/16)*16,{uboElements:e,size:t}}function Ue(a,e){const{size:t,align:r}=x[a.data.type],s=(r-t)/4;return` v = uv.${a.data.name}; ${e!==0?`offset += ${e};`:""} diff --git a/front/dist/assets/browserAll-Cebvaqxr.js b/front/dist/assets/browserAll-CrdAKifF.js similarity index 99% rename from front/dist/assets/browserAll-Cebvaqxr.js rename to front/dist/assets/browserAll-CrdAKifF.js index a75c0eb..c1d8742 100644 --- a/front/dist/assets/browserAll-Cebvaqxr.js +++ b/front/dist/assets/browserAll-CrdAKifF.js @@ -1 +1 @@ -import{P as m,r as J,E as w,b as L,U as Q,c as ee,w as y,e as z,C as Z}from"./index-CQrWNA4L.js";import"./webworkerAll-D0j8Dh1V.js";import"./colorToUniform-DaN3ccwh.js";import"./CanvasPool-DfMFozUt.js";class M{constructor(e){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=M.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new m,this.page=new m,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get data(){return this}composedPath(){return this.manager&&(!this.path||this.path[this.path.length-1]!==this.target)&&(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}initEvent(e,t,i){throw new Error("initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}initUIEvent(e,t,i,n,s){throw new Error("initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){this.propagationStopped=!0}}var O=/iPhone/i,C=/iPod/i,S=/iPad/i,U=/\biOS-universal(?:.+)Mac\b/i,k=/\bAndroid(?:.+)Mobile\b/i,H=/Android/i,b=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,A=/Silk/i,g=/Windows Phone/i,X=/\bWindows(?:.+)ARM\b/i,R=/BlackBerry/i,F=/BB10/i,Y=/Opera Mini/i,K=/\b(CriOS|Chrome)(?:.+)Mobile/i,$=/Mobile(?:.+)Firefox\b/i,G=function(r){return typeof r<"u"&&r.platform==="MacIntel"&&typeof r.maxTouchPoints=="number"&&r.maxTouchPoints>1&&typeof MSStream>"u"};function te(r){return function(e){return e.test(r)}}function W(r){var e={userAgent:"",platform:"",maxTouchPoints:0};!r&&typeof navigator<"u"?e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof r=="string"?e.userAgent=r:r&&r.userAgent&&(e={userAgent:r.userAgent,platform:r.platform,maxTouchPoints:r.maxTouchPoints||0});var t=e.userAgent,i=t.split("[FBAN");typeof i[1]<"u"&&(t=i[0]),i=t.split("Twitter"),typeof i[1]<"u"&&(t=i[0]);var n=te(t),s={apple:{phone:n(O)&&!n(g),ipod:n(C),tablet:!n(O)&&(n(S)||G(e))&&!n(g),universal:n(U),device:(n(O)||n(C)||n(S)||n(U)||G(e))&&!n(g)},amazon:{phone:n(b),tablet:!n(b)&&n(A),device:n(b)||n(A)},android:{phone:!n(g)&&n(b)||!n(g)&&n(k),tablet:!n(g)&&!n(b)&&!n(k)&&(n(A)||n(H)),device:!n(g)&&(n(b)||n(A)||n(k)||n(H))||n(/\bokhttp\b/i)},windows:{phone:n(g),tablet:n(X),device:n(g)||n(X)},other:{blackberry:n(R),blackberry10:n(F),opera:n(Y),firefox:n($),chrome:n(K),device:n(R)||n(F)||n(Y)||n($)||n(K)},any:!1,phone:!1,tablet:!1};return s.any=s.apple.device||s.android.device||s.windows.device||s.other.device,s.phone=s.apple.phone||s.android.phone||s.windows.phone,s.tablet=s.apple.tablet||s.android.tablet||s.windows.tablet,s}const ie=W.default??W,ne=ie(globalThis.navigator),se=9,I=100,oe=0,re=0,j=2,N=1,ae=-1e3,he=-1e3,le=2;class V{constructor(e,t=ne){this._mobileInfo=t,this.debug=!1,this._isActive=!1,this._isMobileAccessibility=!1,this._pool=[],this._renderId=0,this._children=[],this._androidUpdateCount=0,this._androidUpdateFrequency=500,this._hookDiv=null,(t.tablet||t.phone)&&this._createTouchHook();const i=document.createElement("div");i.style.width=`${I}px`,i.style.height=`${I}px`,i.style.position="absolute",i.style.top=`${oe}px`,i.style.left=`${re}px`,i.style.zIndex=j.toString(),this._div=i,this._renderer=e,this._onKeyDown=this._onKeyDown.bind(this),this._onMouseMove=this._onMouseMove.bind(this),globalThis.addEventListener("keydown",this._onKeyDown,!1)}get isActive(){return this._isActive}get isMobileAccessibility(){return this._isMobileAccessibility}get hookDiv(){return this._hookDiv}_createTouchHook(){const e=document.createElement("button");e.style.width=`${N}px`,e.style.height=`${N}px`,e.style.position="absolute",e.style.top=`${ae}px`,e.style.left=`${he}px`,e.style.zIndex=le.toString(),e.style.backgroundColor="#FF0000",e.title="select to enable accessibility for this content",e.addEventListener("focus",()=>{this._isMobileAccessibility=!0,this._activate(),this._destroyTouchHook()}),document.body.appendChild(e),this._hookDiv=e}_destroyTouchHook(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)}_activate(){var e;this._isActive||(this._isActive=!0,globalThis.document.addEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown,!1),this._renderer.runners.postrender.add(this),(e=this._renderer.view.canvas.parentNode)==null||e.appendChild(this._div))}_deactivate(){var e;!this._isActive||this._isMobileAccessibility||(this._isActive=!1,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.addEventListener("keydown",this._onKeyDown,!1),this._renderer.runners.postrender.remove(this),(e=this._div.parentNode)==null||e.removeChild(this._div))}_updateAccessibleObjects(e){if(!e.visible||!e.accessibleChildren)return;e.accessible&&e.isInteractive()&&(e._accessibleActive||this._addChild(e),e._renderId=this._renderId);const t=e.children;if(t)for(let i=0;i title : ${e.title}
tabIndex: ${e.tabIndex}`}_capHitArea(e){e.x<0&&(e.width+=e.x,e.x=0),e.y<0&&(e.height+=e.y,e.y=0);const{width:t,height:i}=this._renderer;e.x+e.width>t&&(e.width=t-e.x),e.y+e.height>i&&(e.height=i-e.y)}_addChild(e){let t=this._pool.pop();t||(t=document.createElement("button"),t.style.width=`${I}px`,t.style.height=`${I}px`,t.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",t.style.position="absolute",t.style.zIndex=j.toString(),t.style.borderStyle="none",navigator.userAgent.toLowerCase().includes("chrome")?t.setAttribute("aria-live","off"):t.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?t.setAttribute("aria-relevant","additions"):t.setAttribute("aria-relevant","text"),t.addEventListener("click",this._onClick.bind(this)),t.addEventListener("focus",this._onFocus.bind(this)),t.addEventListener("focusout",this._onFocusOut.bind(this))),t.style.pointerEvents=e.accessiblePointerEvents,t.type=e.accessibleType,e.accessibleTitle&&e.accessibleTitle!==null?t.title=e.accessibleTitle:(!e.accessibleHint||e.accessibleHint===null)&&(t.title=`container ${e.tabIndex}`),e.accessibleHint&&e.accessibleHint!==null&&t.setAttribute("aria-label",e.accessibleHint),this.debug&&this._updateDebugHTML(t),e._accessibleActive=!0,e._accessibleDiv=t,t.container=e,this._children.push(e),this._div.appendChild(e._accessibleDiv),e._accessibleDiv.tabIndex=e.tabIndex}_dispatchEvent(e,t){const{container:i}=e.target,n=this._renderer.events.rootBoundary,s=Object.assign(new M(n),{target:i});n.rootTarget=this._renderer.lastObjectRendered,t.forEach(o=>n.dispatchEvent(s,o))}_onClick(e){this._dispatchEvent(e,["click","pointertap","tap"])}_onFocus(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","assertive"),this._dispatchEvent(e,["mouseover"])}_onFocusOut(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","polite"),this._dispatchEvent(e,["mouseout"])}_onKeyDown(e){e.keyCode===se&&this._activate()}_onMouseMove(e){e.movementX===0&&e.movementY===0||this._deactivate()}destroy(){this._destroyTouchHook(),this._div=null,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown),this._pool=null,this._children=null,this._renderer=null}}V.extension={type:[w.WebGLSystem,w.WebGPUSystem],name:"accessibility"};const ue={accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:null,accessibleType:"button",accessiblePointerEvents:"auto",accessibleChildren:!0,_renderId:-1};class de{constructor(){this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this._tickerAdded=!1,this._pauseUpdate=!0}init(e){this.removeTickerListener(),this.events=e,this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this._tickerAdded=!1,this._pauseUpdate=!0}get pauseUpdate(){return this._pauseUpdate}set pauseUpdate(e){this._pauseUpdate=e}addTickerListener(){this._tickerAdded||!this.domElement||(L.system.add(this._tickerUpdate,this,Q.INTERACTION),this._tickerAdded=!0)}removeTickerListener(){this._tickerAdded&&(L.system.remove(this._tickerUpdate,this),this._tickerAdded=!1)}pointerMoved(){this._didMove=!0}_update(){if(!this.domElement||this._pauseUpdate)return;if(this._didMove){this._didMove=!1;return}const e=this.events._rootPointerEvent;this.events.supportsTouchEvents&&e.pointerType==="touch"||globalThis.document.dispatchEvent(new PointerEvent("pointermove",{clientX:e.clientX,clientY:e.clientY,pointerType:e.pointerType,pointerId:e.pointerId}))}_tickerUpdate(e){this._deltaTime+=e.deltaTime,!(this._deltaTimei.priority-n.priority)}dispatchEvent(e,t){e.propagationStopped=!1,e.propagationImmediatelyStopped=!1,this.propagate(e,t),this.dispatch.emit(t||e.type,e)}mapEvent(e){if(!this.rootTarget)return;const t=this.mappingTable[e.type];if(t)for(let i=0,n=t.length;i=0;n--)if(e.currentTarget=i[n],this.notifyTarget(e,t),e.propagationStopped||e.propagationImmediatelyStopped)return}}all(e,t,i=this._allInteractiveElements){if(i.length===0)return;e.eventPhase=e.BUBBLING_PHASE;const n=Array.isArray(t)?t:[t];for(let s=i.length-1;s>=0;s--)n.forEach(o=>{e.currentTarget=i[s],this.notifyTarget(e,o)})}propagationPath(e){const t=[e];for(let i=0;i=0;h--){const l=v[h],u=this.hitTestMoveRecursive(l,this._isInteractive(t)?t:l.eventMode,i,n,s,o||s(e,i));if(u){if(u.length>0&&!u[u.length-1].parent)continue;const d=e.isInteractive();(u.length>0||d)&&(d&&this._allInteractiveElements.push(e),u.push(e)),this._hitElements.length===0&&(this._hitElements=u),a=!0}}}const c=this._isInteractive(t),p=e.isInteractive();return p&&p&&this._allInteractiveElements.push(e),o||this._hitElements.length>0?null:a?this._hitElements:c&&!s(e,i)&&n(e,i)?p?[e]:[]:null}hitTestRecursive(e,t,i,n,s){if(this._interactivePrune(e)||s(e,i))return null;if((e.eventMode==="dynamic"||t==="dynamic")&&(E.pauseUpdate=!1),e.interactiveChildren&&e.children){const c=e.children,p=i;for(let v=c.length-1;v>=0;v--){const h=c[v],l=this.hitTestRecursive(h,this._isInteractive(t)?t:h.eventMode,p,n,s);if(l){if(l.length>0&&!l[l.length-1].parent)continue;const u=e.isInteractive();return(l.length>0||u)&&l.push(e),l}}}const o=this._isInteractive(t),a=e.isInteractive();return o&&n(e,i)?a?[e]:[]:null}_isInteractive(e){return e==="static"||e==="dynamic"}_interactivePrune(e){return!e||!e.visible||!e.renderable||!e.includeInBuild||!e.measurable||e.eventMode==="none"||e.eventMode==="passive"&&!e.interactiveChildren}hitPruneFn(e,t){if(e.hitArea&&(e.worldTransform.applyInverse(t,P),!e.hitArea.contains(P.x,P.y)))return!0;if(e.effects&&e.effects.length)for(let i=0;i0&&s!==t.target){const v=e.type==="mousemove"?"mouseout":"pointerout",h=this.createPointerEvent(e,v,s);if(this.dispatchEvent(h,"pointerout"),i&&this.dispatchEvent(h,"mouseout"),!t.composedPath().includes(s)){const l=this.createPointerEvent(e,"pointerleave",s);for(l.eventPhase=l.AT_TARGET;l.target&&!t.composedPath().includes(l.target);)l.currentTarget=l.target,this.notifyTarget(l),i&&this.notifyTarget(l,"mouseleave"),l.target=l.target.parent;this.freeEvent(l)}this.freeEvent(h)}if(s!==t.target){const v=e.type==="mousemove"?"mouseover":"pointerover",h=this.clonePointerEvent(t,v);this.dispatchEvent(h,"pointerover"),i&&this.dispatchEvent(h,"mouseover");let l=s==null?void 0:s.parent;for(;l&&l!==this.rootTarget.parent&&l!==t.target;)l=l.parent;if(!l||l===this.rootTarget.parent){const d=this.clonePointerEvent(t,"pointerenter");for(d.eventPhase=d.AT_TARGET;d.target&&d.target!==s&&d.target!==this.rootTarget.parent;)d.currentTarget=d.target,this.notifyTarget(d),i&&this.notifyTarget(d,"mouseenter"),d.target=d.target.parent;this.freeEvent(d)}this.freeEvent(h)}const o=[],a=this.enableGlobalMoveEvents??!0;this.moveOnAll?o.push("pointermove"):this.dispatchEvent(t,"pointermove"),a&&o.push("globalpointermove"),t.pointerType==="touch"&&(this.moveOnAll?o.splice(1,0,"touchmove"):this.dispatchEvent(t,"touchmove"),a&&o.push("globaltouchmove")),i&&(this.moveOnAll?o.splice(1,0,"mousemove"):this.dispatchEvent(t,"mousemove"),a&&o.push("globalmousemove"),this.cursor=(p=t.target)==null?void 0:p.cursor),o.length>0&&this.all(t,o),this._allInteractiveElements.length=0,this._hitElements.length=0,n.overTargets=t.composedPath(),this.freeEvent(t)}mapPointerOver(e){var o;if(!(e instanceof f)){y("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.trackingData(e.pointerId),i=this.createPointerEvent(e),n=i.pointerType==="mouse"||i.pointerType==="pen";this.dispatchEvent(i,"pointerover"),n&&this.dispatchEvent(i,"mouseover"),i.pointerType==="mouse"&&(this.cursor=(o=i.target)==null?void 0:o.cursor);const s=this.clonePointerEvent(i,"pointerenter");for(s.eventPhase=s.AT_TARGET;s.target&&s.target!==this.rootTarget.parent;)s.currentTarget=s.target,this.notifyTarget(s),n&&this.notifyTarget(s,"mouseenter"),s.target=s.target.parent;t.overTargets=i.composedPath(),this.freeEvent(i),this.freeEvent(s)}mapPointerOut(e){if(!(e instanceof f)){y("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.trackingData(e.pointerId);if(t.overTargets){const i=e.pointerType==="mouse"||e.pointerType==="pen",n=this.findMountedTarget(t.overTargets),s=this.createPointerEvent(e,"pointerout",n);this.dispatchEvent(s),i&&this.dispatchEvent(s,"mouseout");const o=this.createPointerEvent(e,"pointerleave",n);for(o.eventPhase=o.AT_TARGET;o.target&&o.target!==this.rootTarget.parent;)o.currentTarget=o.target,this.notifyTarget(o),i&&this.notifyTarget(o,"mouseleave"),o.target=o.target.parent;t.overTargets=null,this.freeEvent(s),this.freeEvent(o)}this.cursor=null}mapPointerUp(e){if(!(e instanceof f)){y("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=performance.now(),i=this.createPointerEvent(e);if(this.dispatchEvent(i,"pointerup"),i.pointerType==="touch")this.dispatchEvent(i,"touchend");else if(i.pointerType==="mouse"||i.pointerType==="pen"){const a=i.button===2;this.dispatchEvent(i,a?"rightup":"mouseup")}const n=this.trackingData(e.pointerId),s=this.findMountedTarget(n.pressTargetsByButton[e.button]);let o=s;if(s&&!i.composedPath().includes(s)){let a=s;for(;a&&!i.composedPath().includes(a);){if(i.currentTarget=a,this.notifyTarget(i,"pointerupoutside"),i.pointerType==="touch")this.notifyTarget(i,"touchendoutside");else if(i.pointerType==="mouse"||i.pointerType==="pen"){const c=i.button===2;this.notifyTarget(i,c?"rightupoutside":"mouseupoutside")}a=a.parent}delete n.pressTargetsByButton[e.button],o=a}if(o){const a=this.clonePointerEvent(i,"click");a.target=o,a.path=null,n.clicksByButton[e.button]||(n.clicksByButton[e.button]={clickCount:0,target:a.target,timeStamp:t});const c=n.clicksByButton[e.button];if(c.target===a.target&&t-c.timeStamp<200?++c.clickCount:c.clickCount=1,c.target=a.target,c.timeStamp=t,a.detail=c.clickCount,a.pointerType==="mouse"){const p=a.button===2;this.dispatchEvent(a,p?"rightclick":"click")}else a.pointerType==="touch"&&this.dispatchEvent(a,"tap");this.dispatchEvent(a,"pointertap"),this.freeEvent(a)}this.freeEvent(i)}mapPointerUpOutside(e){if(!(e instanceof f)){y("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.trackingData(e.pointerId),i=this.findMountedTarget(t.pressTargetsByButton[e.button]),n=this.createPointerEvent(e);if(i){let s=i;for(;s;)n.currentTarget=s,this.notifyTarget(n,"pointerupoutside"),n.pointerType==="touch"?this.notifyTarget(n,"touchendoutside"):(n.pointerType==="mouse"||n.pointerType==="pen")&&this.notifyTarget(n,n.button===2?"rightupoutside":"mouseupoutside"),s=s.parent;delete t.pressTargetsByButton[e.button]}this.freeEvent(n)}mapWheel(e){if(!(e instanceof T)){y("EventBoundary cannot map a non-wheel event as a wheel event");return}const t=this.createWheelEvent(e);this.dispatchEvent(t),this.freeEvent(t)}findMountedTarget(e){if(!e)return null;let t=e[0];for(let i=1;i(i==="globalMove"&&(this.rootBoundary.enableGlobalMoveEvents=n),t[i]=n,!0)}),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerMove=this._onPointerMove.bind(this),this._onPointerUp=this._onPointerUp.bind(this),this._onPointerOverOut=this._onPointerOverOut.bind(this),this.onWheel=this.onWheel.bind(this)}static get defaultEventMode(){return this._defaultEventMode}init(e){const{canvas:t,resolution:i}=this.renderer;this.setTargetElement(t),this.resolution=i,x._defaultEventMode=e.eventMode??"passive",Object.assign(this.features,e.eventFeatures??{}),this.rootBoundary.enableGlobalMoveEvents=this.features.globalMove}resolutionChange(e){this.resolution=e}destroy(){this.setTargetElement(null),this.renderer=null,this._currentCursor=null}setCursor(e){e=e||"default";let t=!0;if(globalThis.OffscreenCanvas&&this.domElement instanceof OffscreenCanvas&&(t=!1),this._currentCursor===e)return;this._currentCursor=e;const i=this.cursorStyles[e];if(i)switch(typeof i){case"string":t&&(this.domElement.style.cursor=i);break;case"function":i(e);break;case"object":t&&Object.assign(this.domElement.style,i);break}else t&&typeof e=="string"&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,e)&&(this.domElement.style.cursor=e)}get pointer(){return this._rootPointerEvent}_onPointerDown(e){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;const t=this._normalizeToPointerData(e);this.autoPreventDefault&&t[0].isNormalized&&(e.cancelable||!("cancelable"in e))&&e.preventDefault();for(let i=0,n=t.length;i0&&(t=e.composedPath()[0]);const i=t!==this.domElement?"outside":"",n=this._normalizeToPointerData(e);for(let s=0,o=n.length;s"u"&&(s.button=0),typeof s.buttons>"u"&&(s.buttons=1),typeof s.isPrimary>"u"&&(s.isPrimary=e.touches.length===1&&e.type==="touchstart"),typeof s.width>"u"&&(s.width=s.radiusX||1),typeof s.height>"u"&&(s.height=s.radiusY||1),typeof s.tiltX>"u"&&(s.tiltX=0),typeof s.tiltY>"u"&&(s.tiltY=0),typeof s.pointerType>"u"&&(s.pointerType="touch"),typeof s.pointerId>"u"&&(s.pointerId=s.identifier||0),typeof s.pressure>"u"&&(s.pressure=s.force||.5),typeof s.twist>"u"&&(s.twist=0),typeof s.tangentialPressure>"u"&&(s.tangentialPressure=0),typeof s.layerX>"u"&&(s.layerX=s.offsetX=s.clientX),typeof s.layerY>"u"&&(s.layerY=s.offsetY=s.clientY),s.isNormalized=!0,s.type=e.type,t.push(s)}else if(!globalThis.MouseEvent||e instanceof MouseEvent&&(!this.supportsPointerEvents||!(e instanceof globalThis.PointerEvent))){const i=e;typeof i.isPrimary>"u"&&(i.isPrimary=!0),typeof i.width>"u"&&(i.width=1),typeof i.height>"u"&&(i.height=1),typeof i.tiltX>"u"&&(i.tiltX=0),typeof i.tiltY>"u"&&(i.tiltY=0),typeof i.pointerType>"u"&&(i.pointerType="mouse"),typeof i.pointerId>"u"&&(i.pointerId=fe),typeof i.pressure>"u"&&(i.pressure=.5),typeof i.twist>"u"&&(i.twist=0),typeof i.tangentialPressure>"u"&&(i.tangentialPressure=0),i.isNormalized=!0,t.push(i)}else t.push(e);return t}normalizeWheelEvent(e){const t=this._rootWheelEvent;return this._transferMouseData(t,e),t.deltaX=e.deltaX,t.deltaY=e.deltaY,t.deltaZ=e.deltaZ,t.deltaMode=e.deltaMode,this.mapPositionToPoint(t.screen,e.clientX,e.clientY),t.global.copyFrom(t.screen),t.offset.copyFrom(t.screen),t.nativeEvent=e,t.type=e.type,t}_bootstrapEvent(e,t){return e.originalEvent=null,e.nativeEvent=t,e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist,this._transferMouseData(e,t),this.mapPositionToPoint(e.screen,t.clientX,t.clientY),e.global.copyFrom(e.screen),e.offset.copyFrom(e.screen),e.isTrusted=t.isTrusted,e.type==="pointerleave"&&(e.type="pointerout"),e.type.startsWith("mouse")&&(e.type=e.type.replace("mouse","pointer")),e.type.startsWith("touch")&&(e.type=ge[e.type]||e.type),e}_transferMouseData(e,t){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=performance.now(),e.type=t.type,e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.client.x=t.clientX,e.client.y=t.clientY,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.movement.x=t.movementX,e.movement.y=t.movementY,e.page.x=t.pageX,e.page.y=t.pageY,e.relatedTarget=null,e.shiftKey=t.shiftKey}};B.extension={name:"events",type:[w.WebGLSystem,w.CanvasSystem,w.WebGPUSystem],priority:-1};B.defaultEventFeatures={move:!0,globalMove:!0,click:!0,wheel:!0};let q=B;const me={onclick:null,onmousedown:null,onmouseenter:null,onmouseleave:null,onmousemove:null,onglobalmousemove:null,onmouseout:null,onmouseover:null,onmouseup:null,onmouseupoutside:null,onpointercancel:null,onpointerdown:null,onpointerenter:null,onpointerleave:null,onpointermove:null,onglobalpointermove:null,onpointerout:null,onpointerover:null,onpointertap:null,onpointerup:null,onpointerupoutside:null,onrightclick:null,onrightdown:null,onrightup:null,onrightupoutside:null,ontap:null,ontouchcancel:null,ontouchend:null,ontouchendoutside:null,ontouchmove:null,onglobaltouchmove:null,ontouchstart:null,onwheel:null,get interactive(){return this.eventMode==="dynamic"||this.eventMode==="static"},set interactive(r){this.eventMode=r?"static":"passive"},_internalEventMode:void 0,get eventMode(){return this._internalEventMode??q.defaultEventMode},set eventMode(r){this._internalEventMode=r},isInteractive(){return this.eventMode==="static"||this.eventMode==="dynamic"},interactiveChildren:!0,hitArea:null,addEventListener(r,e,t){const i=typeof t=="boolean"&&t||typeof t=="object"&&t.capture,n=typeof t=="object"?t.signal:void 0,s=typeof t=="object"?t.once===!0:!1,o=typeof e=="function"?void 0:e;r=i?`${r}capture`:r;const a=typeof e=="function"?e:e.handleEvent,c=this;n&&n.addEventListener("abort",()=>{c.off(r,a,o)}),s?c.once(r,a,o):c.on(r,a,o)},removeEventListener(r,e,t){const i=typeof t=="boolean"&&t||typeof t=="object"&&t.capture,n=typeof e=="function"?void 0:e;r=i?`${r}capture`:r,e=typeof e=="function"?e:e.handleEvent,this.off(r,e,n)},dispatchEvent(r){if(!(r instanceof M))throw new Error("Container cannot propagate events outside of the Federated Events API");return r.defaultPrevented=!1,r.path=null,r.target=this,r.manager.dispatchEvent(r),!r.defaultPrevented}};z.add(V);Z.mixin(ue);z.add(q);Z.mixin(me); +import{P as m,r as J,E as w,b as L,U as Q,c as ee,w as y,e as z,C as Z}from"./index-DKTylTFu.js";import"./webworkerAll-DZ1ir_jf.js";import"./colorToUniform-fMvLSPph.js";import"./CanvasPool-Df6Z7K0X.js";class M{constructor(e){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=M.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new m,this.page=new m,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get data(){return this}composedPath(){return this.manager&&(!this.path||this.path[this.path.length-1]!==this.target)&&(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}initEvent(e,t,i){throw new Error("initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}initUIEvent(e,t,i,n,s){throw new Error("initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){this.propagationStopped=!0}}var O=/iPhone/i,C=/iPod/i,S=/iPad/i,U=/\biOS-universal(?:.+)Mac\b/i,k=/\bAndroid(?:.+)Mobile\b/i,H=/Android/i,b=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,A=/Silk/i,g=/Windows Phone/i,X=/\bWindows(?:.+)ARM\b/i,R=/BlackBerry/i,F=/BB10/i,Y=/Opera Mini/i,K=/\b(CriOS|Chrome)(?:.+)Mobile/i,$=/Mobile(?:.+)Firefox\b/i,G=function(r){return typeof r<"u"&&r.platform==="MacIntel"&&typeof r.maxTouchPoints=="number"&&r.maxTouchPoints>1&&typeof MSStream>"u"};function te(r){return function(e){return e.test(r)}}function W(r){var e={userAgent:"",platform:"",maxTouchPoints:0};!r&&typeof navigator<"u"?e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof r=="string"?e.userAgent=r:r&&r.userAgent&&(e={userAgent:r.userAgent,platform:r.platform,maxTouchPoints:r.maxTouchPoints||0});var t=e.userAgent,i=t.split("[FBAN");typeof i[1]<"u"&&(t=i[0]),i=t.split("Twitter"),typeof i[1]<"u"&&(t=i[0]);var n=te(t),s={apple:{phone:n(O)&&!n(g),ipod:n(C),tablet:!n(O)&&(n(S)||G(e))&&!n(g),universal:n(U),device:(n(O)||n(C)||n(S)||n(U)||G(e))&&!n(g)},amazon:{phone:n(b),tablet:!n(b)&&n(A),device:n(b)||n(A)},android:{phone:!n(g)&&n(b)||!n(g)&&n(k),tablet:!n(g)&&!n(b)&&!n(k)&&(n(A)||n(H)),device:!n(g)&&(n(b)||n(A)||n(k)||n(H))||n(/\bokhttp\b/i)},windows:{phone:n(g),tablet:n(X),device:n(g)||n(X)},other:{blackberry:n(R),blackberry10:n(F),opera:n(Y),firefox:n($),chrome:n(K),device:n(R)||n(F)||n(Y)||n($)||n(K)},any:!1,phone:!1,tablet:!1};return s.any=s.apple.device||s.android.device||s.windows.device||s.other.device,s.phone=s.apple.phone||s.android.phone||s.windows.phone,s.tablet=s.apple.tablet||s.android.tablet||s.windows.tablet,s}const ie=W.default??W,ne=ie(globalThis.navigator),se=9,I=100,oe=0,re=0,j=2,N=1,ae=-1e3,he=-1e3,le=2;class V{constructor(e,t=ne){this._mobileInfo=t,this.debug=!1,this._isActive=!1,this._isMobileAccessibility=!1,this._pool=[],this._renderId=0,this._children=[],this._androidUpdateCount=0,this._androidUpdateFrequency=500,this._hookDiv=null,(t.tablet||t.phone)&&this._createTouchHook();const i=document.createElement("div");i.style.width=`${I}px`,i.style.height=`${I}px`,i.style.position="absolute",i.style.top=`${oe}px`,i.style.left=`${re}px`,i.style.zIndex=j.toString(),this._div=i,this._renderer=e,this._onKeyDown=this._onKeyDown.bind(this),this._onMouseMove=this._onMouseMove.bind(this),globalThis.addEventListener("keydown",this._onKeyDown,!1)}get isActive(){return this._isActive}get isMobileAccessibility(){return this._isMobileAccessibility}get hookDiv(){return this._hookDiv}_createTouchHook(){const e=document.createElement("button");e.style.width=`${N}px`,e.style.height=`${N}px`,e.style.position="absolute",e.style.top=`${ae}px`,e.style.left=`${he}px`,e.style.zIndex=le.toString(),e.style.backgroundColor="#FF0000",e.title="select to enable accessibility for this content",e.addEventListener("focus",()=>{this._isMobileAccessibility=!0,this._activate(),this._destroyTouchHook()}),document.body.appendChild(e),this._hookDiv=e}_destroyTouchHook(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)}_activate(){var e;this._isActive||(this._isActive=!0,globalThis.document.addEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown,!1),this._renderer.runners.postrender.add(this),(e=this._renderer.view.canvas.parentNode)==null||e.appendChild(this._div))}_deactivate(){var e;!this._isActive||this._isMobileAccessibility||(this._isActive=!1,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.addEventListener("keydown",this._onKeyDown,!1),this._renderer.runners.postrender.remove(this),(e=this._div.parentNode)==null||e.removeChild(this._div))}_updateAccessibleObjects(e){if(!e.visible||!e.accessibleChildren)return;e.accessible&&e.isInteractive()&&(e._accessibleActive||this._addChild(e),e._renderId=this._renderId);const t=e.children;if(t)for(let i=0;i title : ${e.title}
tabIndex: ${e.tabIndex}`}_capHitArea(e){e.x<0&&(e.width+=e.x,e.x=0),e.y<0&&(e.height+=e.y,e.y=0);const{width:t,height:i}=this._renderer;e.x+e.width>t&&(e.width=t-e.x),e.y+e.height>i&&(e.height=i-e.y)}_addChild(e){let t=this._pool.pop();t||(t=document.createElement("button"),t.style.width=`${I}px`,t.style.height=`${I}px`,t.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",t.style.position="absolute",t.style.zIndex=j.toString(),t.style.borderStyle="none",navigator.userAgent.toLowerCase().includes("chrome")?t.setAttribute("aria-live","off"):t.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?t.setAttribute("aria-relevant","additions"):t.setAttribute("aria-relevant","text"),t.addEventListener("click",this._onClick.bind(this)),t.addEventListener("focus",this._onFocus.bind(this)),t.addEventListener("focusout",this._onFocusOut.bind(this))),t.style.pointerEvents=e.accessiblePointerEvents,t.type=e.accessibleType,e.accessibleTitle&&e.accessibleTitle!==null?t.title=e.accessibleTitle:(!e.accessibleHint||e.accessibleHint===null)&&(t.title=`container ${e.tabIndex}`),e.accessibleHint&&e.accessibleHint!==null&&t.setAttribute("aria-label",e.accessibleHint),this.debug&&this._updateDebugHTML(t),e._accessibleActive=!0,e._accessibleDiv=t,t.container=e,this._children.push(e),this._div.appendChild(e._accessibleDiv),e._accessibleDiv.tabIndex=e.tabIndex}_dispatchEvent(e,t){const{container:i}=e.target,n=this._renderer.events.rootBoundary,s=Object.assign(new M(n),{target:i});n.rootTarget=this._renderer.lastObjectRendered,t.forEach(o=>n.dispatchEvent(s,o))}_onClick(e){this._dispatchEvent(e,["click","pointertap","tap"])}_onFocus(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","assertive"),this._dispatchEvent(e,["mouseover"])}_onFocusOut(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","polite"),this._dispatchEvent(e,["mouseout"])}_onKeyDown(e){e.keyCode===se&&this._activate()}_onMouseMove(e){e.movementX===0&&e.movementY===0||this._deactivate()}destroy(){this._destroyTouchHook(),this._div=null,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown),this._pool=null,this._children=null,this._renderer=null}}V.extension={type:[w.WebGLSystem,w.WebGPUSystem],name:"accessibility"};const ue={accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:null,accessibleType:"button",accessiblePointerEvents:"auto",accessibleChildren:!0,_renderId:-1};class de{constructor(){this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this._tickerAdded=!1,this._pauseUpdate=!0}init(e){this.removeTickerListener(),this.events=e,this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this._tickerAdded=!1,this._pauseUpdate=!0}get pauseUpdate(){return this._pauseUpdate}set pauseUpdate(e){this._pauseUpdate=e}addTickerListener(){this._tickerAdded||!this.domElement||(L.system.add(this._tickerUpdate,this,Q.INTERACTION),this._tickerAdded=!0)}removeTickerListener(){this._tickerAdded&&(L.system.remove(this._tickerUpdate,this),this._tickerAdded=!1)}pointerMoved(){this._didMove=!0}_update(){if(!this.domElement||this._pauseUpdate)return;if(this._didMove){this._didMove=!1;return}const e=this.events._rootPointerEvent;this.events.supportsTouchEvents&&e.pointerType==="touch"||globalThis.document.dispatchEvent(new PointerEvent("pointermove",{clientX:e.clientX,clientY:e.clientY,pointerType:e.pointerType,pointerId:e.pointerId}))}_tickerUpdate(e){this._deltaTime+=e.deltaTime,!(this._deltaTimei.priority-n.priority)}dispatchEvent(e,t){e.propagationStopped=!1,e.propagationImmediatelyStopped=!1,this.propagate(e,t),this.dispatch.emit(t||e.type,e)}mapEvent(e){if(!this.rootTarget)return;const t=this.mappingTable[e.type];if(t)for(let i=0,n=t.length;i=0;n--)if(e.currentTarget=i[n],this.notifyTarget(e,t),e.propagationStopped||e.propagationImmediatelyStopped)return}}all(e,t,i=this._allInteractiveElements){if(i.length===0)return;e.eventPhase=e.BUBBLING_PHASE;const n=Array.isArray(t)?t:[t];for(let s=i.length-1;s>=0;s--)n.forEach(o=>{e.currentTarget=i[s],this.notifyTarget(e,o)})}propagationPath(e){const t=[e];for(let i=0;i=0;h--){const l=v[h],u=this.hitTestMoveRecursive(l,this._isInteractive(t)?t:l.eventMode,i,n,s,o||s(e,i));if(u){if(u.length>0&&!u[u.length-1].parent)continue;const d=e.isInteractive();(u.length>0||d)&&(d&&this._allInteractiveElements.push(e),u.push(e)),this._hitElements.length===0&&(this._hitElements=u),a=!0}}}const c=this._isInteractive(t),p=e.isInteractive();return p&&p&&this._allInteractiveElements.push(e),o||this._hitElements.length>0?null:a?this._hitElements:c&&!s(e,i)&&n(e,i)?p?[e]:[]:null}hitTestRecursive(e,t,i,n,s){if(this._interactivePrune(e)||s(e,i))return null;if((e.eventMode==="dynamic"||t==="dynamic")&&(E.pauseUpdate=!1),e.interactiveChildren&&e.children){const c=e.children,p=i;for(let v=c.length-1;v>=0;v--){const h=c[v],l=this.hitTestRecursive(h,this._isInteractive(t)?t:h.eventMode,p,n,s);if(l){if(l.length>0&&!l[l.length-1].parent)continue;const u=e.isInteractive();return(l.length>0||u)&&l.push(e),l}}}const o=this._isInteractive(t),a=e.isInteractive();return o&&n(e,i)?a?[e]:[]:null}_isInteractive(e){return e==="static"||e==="dynamic"}_interactivePrune(e){return!e||!e.visible||!e.renderable||!e.includeInBuild||!e.measurable||e.eventMode==="none"||e.eventMode==="passive"&&!e.interactiveChildren}hitPruneFn(e,t){if(e.hitArea&&(e.worldTransform.applyInverse(t,P),!e.hitArea.contains(P.x,P.y)))return!0;if(e.effects&&e.effects.length)for(let i=0;i0&&s!==t.target){const v=e.type==="mousemove"?"mouseout":"pointerout",h=this.createPointerEvent(e,v,s);if(this.dispatchEvent(h,"pointerout"),i&&this.dispatchEvent(h,"mouseout"),!t.composedPath().includes(s)){const l=this.createPointerEvent(e,"pointerleave",s);for(l.eventPhase=l.AT_TARGET;l.target&&!t.composedPath().includes(l.target);)l.currentTarget=l.target,this.notifyTarget(l),i&&this.notifyTarget(l,"mouseleave"),l.target=l.target.parent;this.freeEvent(l)}this.freeEvent(h)}if(s!==t.target){const v=e.type==="mousemove"?"mouseover":"pointerover",h=this.clonePointerEvent(t,v);this.dispatchEvent(h,"pointerover"),i&&this.dispatchEvent(h,"mouseover");let l=s==null?void 0:s.parent;for(;l&&l!==this.rootTarget.parent&&l!==t.target;)l=l.parent;if(!l||l===this.rootTarget.parent){const d=this.clonePointerEvent(t,"pointerenter");for(d.eventPhase=d.AT_TARGET;d.target&&d.target!==s&&d.target!==this.rootTarget.parent;)d.currentTarget=d.target,this.notifyTarget(d),i&&this.notifyTarget(d,"mouseenter"),d.target=d.target.parent;this.freeEvent(d)}this.freeEvent(h)}const o=[],a=this.enableGlobalMoveEvents??!0;this.moveOnAll?o.push("pointermove"):this.dispatchEvent(t,"pointermove"),a&&o.push("globalpointermove"),t.pointerType==="touch"&&(this.moveOnAll?o.splice(1,0,"touchmove"):this.dispatchEvent(t,"touchmove"),a&&o.push("globaltouchmove")),i&&(this.moveOnAll?o.splice(1,0,"mousemove"):this.dispatchEvent(t,"mousemove"),a&&o.push("globalmousemove"),this.cursor=(p=t.target)==null?void 0:p.cursor),o.length>0&&this.all(t,o),this._allInteractiveElements.length=0,this._hitElements.length=0,n.overTargets=t.composedPath(),this.freeEvent(t)}mapPointerOver(e){var o;if(!(e instanceof f)){y("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.trackingData(e.pointerId),i=this.createPointerEvent(e),n=i.pointerType==="mouse"||i.pointerType==="pen";this.dispatchEvent(i,"pointerover"),n&&this.dispatchEvent(i,"mouseover"),i.pointerType==="mouse"&&(this.cursor=(o=i.target)==null?void 0:o.cursor);const s=this.clonePointerEvent(i,"pointerenter");for(s.eventPhase=s.AT_TARGET;s.target&&s.target!==this.rootTarget.parent;)s.currentTarget=s.target,this.notifyTarget(s),n&&this.notifyTarget(s,"mouseenter"),s.target=s.target.parent;t.overTargets=i.composedPath(),this.freeEvent(i),this.freeEvent(s)}mapPointerOut(e){if(!(e instanceof f)){y("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.trackingData(e.pointerId);if(t.overTargets){const i=e.pointerType==="mouse"||e.pointerType==="pen",n=this.findMountedTarget(t.overTargets),s=this.createPointerEvent(e,"pointerout",n);this.dispatchEvent(s),i&&this.dispatchEvent(s,"mouseout");const o=this.createPointerEvent(e,"pointerleave",n);for(o.eventPhase=o.AT_TARGET;o.target&&o.target!==this.rootTarget.parent;)o.currentTarget=o.target,this.notifyTarget(o),i&&this.notifyTarget(o,"mouseleave"),o.target=o.target.parent;t.overTargets=null,this.freeEvent(s),this.freeEvent(o)}this.cursor=null}mapPointerUp(e){if(!(e instanceof f)){y("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=performance.now(),i=this.createPointerEvent(e);if(this.dispatchEvent(i,"pointerup"),i.pointerType==="touch")this.dispatchEvent(i,"touchend");else if(i.pointerType==="mouse"||i.pointerType==="pen"){const a=i.button===2;this.dispatchEvent(i,a?"rightup":"mouseup")}const n=this.trackingData(e.pointerId),s=this.findMountedTarget(n.pressTargetsByButton[e.button]);let o=s;if(s&&!i.composedPath().includes(s)){let a=s;for(;a&&!i.composedPath().includes(a);){if(i.currentTarget=a,this.notifyTarget(i,"pointerupoutside"),i.pointerType==="touch")this.notifyTarget(i,"touchendoutside");else if(i.pointerType==="mouse"||i.pointerType==="pen"){const c=i.button===2;this.notifyTarget(i,c?"rightupoutside":"mouseupoutside")}a=a.parent}delete n.pressTargetsByButton[e.button],o=a}if(o){const a=this.clonePointerEvent(i,"click");a.target=o,a.path=null,n.clicksByButton[e.button]||(n.clicksByButton[e.button]={clickCount:0,target:a.target,timeStamp:t});const c=n.clicksByButton[e.button];if(c.target===a.target&&t-c.timeStamp<200?++c.clickCount:c.clickCount=1,c.target=a.target,c.timeStamp=t,a.detail=c.clickCount,a.pointerType==="mouse"){const p=a.button===2;this.dispatchEvent(a,p?"rightclick":"click")}else a.pointerType==="touch"&&this.dispatchEvent(a,"tap");this.dispatchEvent(a,"pointertap"),this.freeEvent(a)}this.freeEvent(i)}mapPointerUpOutside(e){if(!(e instanceof f)){y("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.trackingData(e.pointerId),i=this.findMountedTarget(t.pressTargetsByButton[e.button]),n=this.createPointerEvent(e);if(i){let s=i;for(;s;)n.currentTarget=s,this.notifyTarget(n,"pointerupoutside"),n.pointerType==="touch"?this.notifyTarget(n,"touchendoutside"):(n.pointerType==="mouse"||n.pointerType==="pen")&&this.notifyTarget(n,n.button===2?"rightupoutside":"mouseupoutside"),s=s.parent;delete t.pressTargetsByButton[e.button]}this.freeEvent(n)}mapWheel(e){if(!(e instanceof T)){y("EventBoundary cannot map a non-wheel event as a wheel event");return}const t=this.createWheelEvent(e);this.dispatchEvent(t),this.freeEvent(t)}findMountedTarget(e){if(!e)return null;let t=e[0];for(let i=1;i(i==="globalMove"&&(this.rootBoundary.enableGlobalMoveEvents=n),t[i]=n,!0)}),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerMove=this._onPointerMove.bind(this),this._onPointerUp=this._onPointerUp.bind(this),this._onPointerOverOut=this._onPointerOverOut.bind(this),this.onWheel=this.onWheel.bind(this)}static get defaultEventMode(){return this._defaultEventMode}init(e){const{canvas:t,resolution:i}=this.renderer;this.setTargetElement(t),this.resolution=i,x._defaultEventMode=e.eventMode??"passive",Object.assign(this.features,e.eventFeatures??{}),this.rootBoundary.enableGlobalMoveEvents=this.features.globalMove}resolutionChange(e){this.resolution=e}destroy(){this.setTargetElement(null),this.renderer=null,this._currentCursor=null}setCursor(e){e=e||"default";let t=!0;if(globalThis.OffscreenCanvas&&this.domElement instanceof OffscreenCanvas&&(t=!1),this._currentCursor===e)return;this._currentCursor=e;const i=this.cursorStyles[e];if(i)switch(typeof i){case"string":t&&(this.domElement.style.cursor=i);break;case"function":i(e);break;case"object":t&&Object.assign(this.domElement.style,i);break}else t&&typeof e=="string"&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,e)&&(this.domElement.style.cursor=e)}get pointer(){return this._rootPointerEvent}_onPointerDown(e){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;const t=this._normalizeToPointerData(e);this.autoPreventDefault&&t[0].isNormalized&&(e.cancelable||!("cancelable"in e))&&e.preventDefault();for(let i=0,n=t.length;i0&&(t=e.composedPath()[0]);const i=t!==this.domElement?"outside":"",n=this._normalizeToPointerData(e);for(let s=0,o=n.length;s"u"&&(s.button=0),typeof s.buttons>"u"&&(s.buttons=1),typeof s.isPrimary>"u"&&(s.isPrimary=e.touches.length===1&&e.type==="touchstart"),typeof s.width>"u"&&(s.width=s.radiusX||1),typeof s.height>"u"&&(s.height=s.radiusY||1),typeof s.tiltX>"u"&&(s.tiltX=0),typeof s.tiltY>"u"&&(s.tiltY=0),typeof s.pointerType>"u"&&(s.pointerType="touch"),typeof s.pointerId>"u"&&(s.pointerId=s.identifier||0),typeof s.pressure>"u"&&(s.pressure=s.force||.5),typeof s.twist>"u"&&(s.twist=0),typeof s.tangentialPressure>"u"&&(s.tangentialPressure=0),typeof s.layerX>"u"&&(s.layerX=s.offsetX=s.clientX),typeof s.layerY>"u"&&(s.layerY=s.offsetY=s.clientY),s.isNormalized=!0,s.type=e.type,t.push(s)}else if(!globalThis.MouseEvent||e instanceof MouseEvent&&(!this.supportsPointerEvents||!(e instanceof globalThis.PointerEvent))){const i=e;typeof i.isPrimary>"u"&&(i.isPrimary=!0),typeof i.width>"u"&&(i.width=1),typeof i.height>"u"&&(i.height=1),typeof i.tiltX>"u"&&(i.tiltX=0),typeof i.tiltY>"u"&&(i.tiltY=0),typeof i.pointerType>"u"&&(i.pointerType="mouse"),typeof i.pointerId>"u"&&(i.pointerId=fe),typeof i.pressure>"u"&&(i.pressure=.5),typeof i.twist>"u"&&(i.twist=0),typeof i.tangentialPressure>"u"&&(i.tangentialPressure=0),i.isNormalized=!0,t.push(i)}else t.push(e);return t}normalizeWheelEvent(e){const t=this._rootWheelEvent;return this._transferMouseData(t,e),t.deltaX=e.deltaX,t.deltaY=e.deltaY,t.deltaZ=e.deltaZ,t.deltaMode=e.deltaMode,this.mapPositionToPoint(t.screen,e.clientX,e.clientY),t.global.copyFrom(t.screen),t.offset.copyFrom(t.screen),t.nativeEvent=e,t.type=e.type,t}_bootstrapEvent(e,t){return e.originalEvent=null,e.nativeEvent=t,e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist,this._transferMouseData(e,t),this.mapPositionToPoint(e.screen,t.clientX,t.clientY),e.global.copyFrom(e.screen),e.offset.copyFrom(e.screen),e.isTrusted=t.isTrusted,e.type==="pointerleave"&&(e.type="pointerout"),e.type.startsWith("mouse")&&(e.type=e.type.replace("mouse","pointer")),e.type.startsWith("touch")&&(e.type=ge[e.type]||e.type),e}_transferMouseData(e,t){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=performance.now(),e.type=t.type,e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.client.x=t.clientX,e.client.y=t.clientY,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.movement.x=t.movementX,e.movement.y=t.movementY,e.page.x=t.pageX,e.page.y=t.pageY,e.relatedTarget=null,e.shiftKey=t.shiftKey}};B.extension={name:"events",type:[w.WebGLSystem,w.CanvasSystem,w.WebGPUSystem],priority:-1};B.defaultEventFeatures={move:!0,globalMove:!0,click:!0,wheel:!0};let q=B;const me={onclick:null,onmousedown:null,onmouseenter:null,onmouseleave:null,onmousemove:null,onglobalmousemove:null,onmouseout:null,onmouseover:null,onmouseup:null,onmouseupoutside:null,onpointercancel:null,onpointerdown:null,onpointerenter:null,onpointerleave:null,onpointermove:null,onglobalpointermove:null,onpointerout:null,onpointerover:null,onpointertap:null,onpointerup:null,onpointerupoutside:null,onrightclick:null,onrightdown:null,onrightup:null,onrightupoutside:null,ontap:null,ontouchcancel:null,ontouchend:null,ontouchendoutside:null,ontouchmove:null,onglobaltouchmove:null,ontouchstart:null,onwheel:null,get interactive(){return this.eventMode==="dynamic"||this.eventMode==="static"},set interactive(r){this.eventMode=r?"static":"passive"},_internalEventMode:void 0,get eventMode(){return this._internalEventMode??q.defaultEventMode},set eventMode(r){this._internalEventMode=r},isInteractive(){return this.eventMode==="static"||this.eventMode==="dynamic"},interactiveChildren:!0,hitArea:null,addEventListener(r,e,t){const i=typeof t=="boolean"&&t||typeof t=="object"&&t.capture,n=typeof t=="object"?t.signal:void 0,s=typeof t=="object"?t.once===!0:!1,o=typeof e=="function"?void 0:e;r=i?`${r}capture`:r;const a=typeof e=="function"?e:e.handleEvent,c=this;n&&n.addEventListener("abort",()=>{c.off(r,a,o)}),s?c.once(r,a,o):c.on(r,a,o)},removeEventListener(r,e,t){const i=typeof t=="boolean"&&t||typeof t=="object"&&t.capture,n=typeof e=="function"?void 0:e;r=i?`${r}capture`:r,e=typeof e=="function"?e:e.handleEvent,this.off(r,e,n)},dispatchEvent(r){if(!(r instanceof M))throw new Error("Container cannot propagate events outside of the Federated Events API");return r.defaultPrevented=!1,r.path=null,r.target=this,r.manager.dispatchEvent(r),!r.defaultPrevented}};z.add(V);Z.mixin(ue);z.add(q);Z.mixin(me); diff --git a/front/dist/assets/colorToUniform-DaN3ccwh.js b/front/dist/assets/colorToUniform-fMvLSPph.js similarity index 97% rename from front/dist/assets/colorToUniform-DaN3ccwh.js rename to front/dist/assets/colorToUniform-fMvLSPph.js index e7d875e..73ac978 100644 --- a/front/dist/assets/colorToUniform-DaN3ccwh.js +++ b/front/dist/assets/colorToUniform-fMvLSPph.js @@ -1,4 +1,4 @@ -import{T as h,a as x,n as c}from"./index-CQrWNA4L.js";let m=0;class f{constructor(e){this._poolKeyHash=Object.create(null),this._texturePool={},this.textureOptions=e||{},this.enableFullScreen=!1}createTexture(e,o,t){const i=new h({...this.textureOptions,width:e,height:o,resolution:1,antialias:t,autoGarbageCollect:!0});return new x({source:i,label:`texturePool_${m++}`})}getOptimalTexture(e,o,t=1,i){let s=Math.ceil(e*t-1e-6),u=Math.ceil(o*t-1e-6);s=c(s),u=c(u);const n=(s<<17)+(u<<1)+(i?1:0);this._texturePool[n]||(this._texturePool[n]=[]);let r=this._texturePool[n].pop();return r||(r=this.createTexture(s,u,i)),r.source._resolution=t,r.source.width=s/t,r.source.height=u/t,r.source.pixelWidth=s,r.source.pixelHeight=u,r.frame.x=0,r.frame.y=0,r.frame.width=e,r.frame.height=o,r.updateUvs(),this._poolKeyHash[r.uid]=n,r}getSameSizeTexture(e,o=!1){const t=e.source;return this.getOptimalTexture(e.width,e.height,t._resolution,o)}returnTexture(e){const o=this._poolKeyHash[e.uid];this._texturePool[o].push(e)}clear(e){if(e=e!==!1,e)for(const o in this._texturePool){const t=this._texturePool[o];if(t)for(let i=0;i, diff --git a/front/dist/assets/index-CQrWNA4L.js b/front/dist/assets/index-DKTylTFu.js similarity index 98% rename from front/dist/assets/index-CQrWNA4L.js rename to front/dist/assets/index-DKTylTFu.js index 1317d66..0e290d5 100644 --- a/front/dist/assets/index-CQrWNA4L.js +++ b/front/dist/assets/index-DKTylTFu.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/browserAll-Cebvaqxr.js","assets/webworkerAll-D0j8Dh1V.js","assets/colorToUniform-DaN3ccwh.js","assets/CanvasPool-DfMFozUt.js","assets/WebGPURenderer-YFZ97DWp.js","assets/SharedSystems-BCvEDrAl.js","assets/WebGLRenderer-BzN8kj9-.js"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/browserAll-CrdAKifF.js","assets/webworkerAll-DZ1ir_jf.js","assets/colorToUniform-fMvLSPph.js","assets/CanvasPool-Df6Z7K0X.js","assets/WebGPURenderer-CMHfAOBn.js","assets/SharedSystems-BYS0WgCL.js","assets/WebGLRenderer-oW2arDOf.js"])))=>i.map(i=>d[i]); var Sf=Object.defineProperty;var Cf=(e,t,s)=>t in e?Sf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var Bt=(e,t,s)=>Cf(e,typeof t!="symbol"?t+"":t,s);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const n of r)if(n.type==="childList")for(const o of n.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function s(r){const n={};return r.integrity&&(n.integrity=r.integrity),r.referrerPolicy&&(n.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?n.credentials="include":r.crossOrigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function i(r){if(r.ep)return;r.ep=!0;const n=s(r);fetch(r.href,n)}})();/** * @vue/shared v3.5.12 * (c) 2018-present Yuxi (Evan) You and Vue contributors @@ -80,7 +80,7 @@ var Sf=Object.defineProperty;var Cf=(e,t,s)=>t in e?Sf(e,t,{enumerable:!0,config * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Pn=as("ZapIcon",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),pm=(e,t,s,i)=>({board:e,state:t,rounds:s,finalState:i}),mm=(e,t,s)=>({type:e,energy:t,x:s.x,y:s.y});var Di=(e=>(e.Ground="g",e.Water="w",e))(Di||{});const Oh=(e,t,s)=>({energy:e,players:t,lighthouses:s}),gm=(e,t,s,i,r,n,o)=>({id:e,name:t,energy:s,score:i,keys:r,color:n,x:o.x,y:o.y}),ym=(e,t,s,i,r)=>({id:e,energy:t,ownerId:s,links:i,x:r.x,y:r.y}),xm=(e,t,s)=>({name:e,state:t,turns:s}),_m=(e,t)=>({name:e,state:t}),bm=(e,t)=>({x:e,y:t}),vm="modulepreload",wm=function(e){return"/codeconz-lighthouses-engine/"+e},bl={},Fr=function(t,s,i){let r=Promise.resolve();if(s&&s.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));r=Promise.allSettled(s.map(l=>{if(l=wm(l),l in bl)return;bl[l]=!0;const h=l.endsWith(".css"),c=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${c}`))return;const u=document.createElement("link");if(u.rel=h?"stylesheet":vm,h||(u.as="script"),u.crossOrigin="",u.href=l,a&&u.setAttribute("nonce",a),document.head.appendChild(u),h)return new Promise((f,m)=>{u.addEventListener("load",f),u.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${l}`)))})}))}function n(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return r.then(o=>{for(const a of o||[])a.status==="rejected"&&n(a.reason);return t().catch(n)})};var Tt=(e=>(e.Application="application",e.WebGLPipes="webgl-pipes",e.WebGLPipesAdaptor="webgl-pipes-adaptor",e.WebGLSystem="webgl-system",e.WebGPUPipes="webgpu-pipes",e.WebGPUPipesAdaptor="webgpu-pipes-adaptor",e.WebGPUSystem="webgpu-system",e.CanvasSystem="canvas-system",e.CanvasPipesAdaptor="canvas-pipes-adaptor",e.CanvasPipes="canvas-pipes",e.Asset="asset",e.LoadParser="load-parser",e.ResolveParser="resolve-parser",e.CacheParser="cache-parser",e.DetectionParser="detection-parser",e.MaskEffect="mask-effect",e.BlendMode="blend-mode",e.TextureSource="texture-source",e.Environment="environment",e.ShapeBuilder="shape-builder",e.Batcher="batcher",e))(Tt||{});const yo=e=>{if(typeof e=="function"||typeof e=="object"&&e.extension){if(!e.extension)throw new Error("Extension class must have an extension object");e={...typeof e.extension!="object"?{type:e.extension}:e.extension,ref:e}}if(typeof e=="object")e={...e};else throw new Error("Invalid extension type");return typeof e.type=="string"&&(e.type=[e.type]),e},or=(e,t)=>yo(e).priority??t,Xe={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...e){return e.map(yo).forEach(t=>{t.type.forEach(s=>{var i,r;return(r=(i=this._removeHandlers)[s])==null?void 0:r.call(i,t)})}),this},add(...e){return e.map(yo).forEach(t=>{t.type.forEach(s=>{var n,o;const i=this._addHandlers,r=this._queue;i[s]?(o=i[s])==null||o.call(i,t):(r[s]=r[s]||[],(n=r[s])==null||n.push(t))})}),this},handle(e,t,s){var o;const i=this._addHandlers,r=this._removeHandlers;if(i[e]||r[e])throw new Error(`Extension type ${e} already has a handler`);i[e]=t,r[e]=s;const n=this._queue;return n[e]&&((o=n[e])==null||o.forEach(a=>t(a)),delete n[e]),this},handleByMap(e,t){return this.handle(e,s=>{s.name&&(t[s.name]=s.ref)},s=>{s.name&&delete t[s.name]})},handleByNamedList(e,t,s=-1){return this.handle(e,i=>{t.findIndex(n=>n.name===i.name)>=0||(t.push({name:i.name,value:i.ref}),t.sort((n,o)=>or(o.value,s)-or(n.value,s)))},i=>{const r=t.findIndex(n=>n.name===i.name);r!==-1&&t.splice(r,1)})},handleByList(e,t,s=-1){return this.handle(e,i=>{t.includes(i.ref)||(t.push(i.ref),t.sort((r,n)=>or(n,s)-or(r,s)))},i=>{const r=t.indexOf(i.ref);r!==-1&&t.splice(r,1)})}},Sm={extension:{type:Tt.Environment,name:"browser",priority:-1},test:()=>!0,load:async()=>{await Fr(()=>import("./browserAll-Cebvaqxr.js"),__vite__mapDeps([0,1,2,3]))}},Cm={extension:{type:Tt.Environment,name:"webworker",priority:0},test:()=>typeof self<"u"&&self.WorkerGlobalScope!==void 0,load:async()=>{await Fr(()=>import("./webworkerAll-D0j8Dh1V.js"),__vite__mapDeps([1,2,3]))}};class Me{constructor(t,s,i){this._x=s||0,this._y=i||0,this._observer=t}clone(t){return new Me(t??this._observer,this._x,this._y)}set(t=0,s=t){return(this._x!==t||this._y!==s)&&(this._x=t,this._y=s,this._observer._onUpdate(this)),this}copyFrom(t){return(this._x!==t.x||this._y!==t.y)&&(this._x=t.x,this._y=t.y,this._observer._onUpdate(this)),this}copyTo(t){return t.set(this._x,this._y),t}equals(t){return t.x===this._x&&t.y===this._y}toString(){return`[pixi.js/math:ObservablePoint x=0 y=0 scope=${this._observer}]`}get x(){return this._x}set x(t){this._x!==t&&(this._x=t,this._observer._onUpdate(this))}get y(){return this._y}set y(t){this._y!==t&&(this._y=t,this._observer._onUpdate(this))}}function la(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Lh={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,s="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(s=!1));function r(l,h,c){this.fn=l,this.context=h,this.once=c||!1}function n(l,h,c,u,f){if(typeof c!="function")throw new TypeError("The listener must be a function");var m=new r(c,u||l,f),d=s?s+h:h;return l._events[d]?l._events[d].fn?l._events[d]=[l._events[d],m]:l._events[d].push(m):(l._events[d]=m,l._eventsCount++),l}function o(l,h){--l._eventsCount===0?l._events=new i:delete l._events[h]}function a(){this._events=new i,this._eventsCount=0}a.prototype.eventNames=function(){var h=[],c,u;if(this._eventsCount===0)return h;for(u in c=this._events)t.call(c,u)&&h.push(s?u.slice(1):u);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(c)):h},a.prototype.listeners=function(h){var c=s?s+h:h,u=this._events[c];if(!u)return[];if(u.fn)return[u.fn];for(var f=0,m=u.length,d=new Array(m);fRs[e],uY:e=>Fs[e],vX:e=>Bs[e],vY:e=>Os[e],inv:e=>e&8?e&15:-e&7,add:(e,t)=>xo[e][t],sub:(e,t)=>xo[e][Ut.inv(t)],rotate180:e=>e^4,isVertical:e=>(e&3)===2,byDirection:(e,t)=>Math.abs(e)*2<=Math.abs(t)?t>=0?Ut.S:Ut.N:Math.abs(t)*2<=Math.abs(e)?e>0?Ut.E:Ut.W:t>0?e>0?Ut.SE:Ut.SW:e>0?Ut.NE:Ut.NW,matrixAppendRotationInv:(e,t,s=0,i=0)=>{const r=Nh[Ut.inv(t)];r.tx=s,r.ty=i,e.append(r)}},lr=[new ue,new ue,new ue,new ue];class ne{constructor(t=0,s=0,i=0,r=0){this.type="rectangle",this.x=Number(t),this.y=Number(s),this.width=Number(i),this.height=Number(r)}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}isEmpty(){return this.left===this.right||this.top===this.bottom}static get EMPTY(){return new ne(0,0,0,0)}clone(){return new ne(this.x,this.y,this.width,this.height)}copyFromBounds(t){return this.x=t.minX,this.y=t.minY,this.width=t.maxX-t.minX,this.height=t.maxY-t.minY,this}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.copyFrom(this),t}contains(t,s){return this.width<=0||this.height<=0?!1:t>=this.x&&t=this.y&&s=l&&t<=h&&s>=c&&s<=u&&!(t>f&&td&&st.right?t.right:this.right)<=G)return!1;const k=this.yt.bottom?t.bottom:this.bottom)>k}const i=this.left,r=this.right,n=this.top,o=this.bottom;if(r<=i||o<=n)return!1;const a=lr[0].set(t.left,t.top),l=lr[1].set(t.left,t.bottom),h=lr[2].set(t.right,t.top),c=lr[3].set(t.right,t.bottom);if(h.x<=a.x||l.y<=a.y)return!1;const u=Math.sign(s.a*s.d-s.b*s.c);if(u===0||(s.apply(a,a),s.apply(l,l),s.apply(h,h),s.apply(c,c),Math.max(a.x,l.x,h.x,c.x)<=i||Math.min(a.x,l.x,h.x,c.x)>=r||Math.max(a.y,l.y,h.y,c.y)<=n||Math.min(a.y,l.y,h.y,c.y)>=o))return!1;const f=u*(l.y-a.y),m=u*(a.x-l.x),d=f*i+m*n,y=f*r+m*n,g=f*i+m*o,v=f*r+m*o;if(Math.max(d,y,g,v)<=f*a.x+m*a.y||Math.min(d,y,g,v)>=f*c.x+m*c.y)return!1;const w=u*(a.y-h.y),A=u*(h.x-a.x),M=w*i+A*n,I=w*r+A*n,N=w*i+A*o,V=w*r+A*o;return!(Math.max(M,I,N,V)<=w*a.x+A*a.y||Math.min(M,I,N,V)>=w*c.x+A*c.y)}pad(t=0,s=t){return this.x-=t,this.y-=s,this.width+=t*2,this.height+=s*2,this}fit(t){const s=Math.max(this.x,t.x),i=Math.min(this.x+this.width,t.x+t.width),r=Math.max(this.y,t.y),n=Math.min(this.y+this.height,t.y+t.height);return this.x=s,this.width=Math.max(i-s,0),this.y=r,this.height=Math.max(n-r,0),this}ceil(t=1,s=.001){const i=Math.ceil((this.x+this.width-s)*t)/t,r=Math.ceil((this.y+this.height-s)*t)/t;return this.x=Math.floor((this.x+s)*t)/t,this.y=Math.floor((this.y+s)*t)/t,this.width=i-this.x,this.height=r-this.y,this}enlarge(t){const s=Math.min(this.x,t.x),i=Math.max(this.x+this.width,t.x+t.width),r=Math.min(this.y,t.y),n=Math.max(this.y+this.height,t.y+t.height);return this.x=s,this.width=i-s,this.y=r,this.height=n-r,this}getBounds(t){return t=t||new ne,t.copyFrom(this),t}toString(){return`[pixi.js/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}}const En={default:-1};function Qt(e="default"){return En[e]===void 0&&(En[e]=-1),++En[e]}const vl={},Zt="8.0.0",Rm="8.3.4";function Xt(e,t,s=3){if(vl[t])return;let i=new Error().stack;typeof i>"u"?console.warn("PixiJS Deprecation Warning: ",`${t} + */const Pn=as("ZapIcon",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),pm=(e,t,s,i)=>({board:e,state:t,rounds:s,finalState:i}),mm=(e,t,s)=>({type:e,energy:t,x:s.x,y:s.y});var Di=(e=>(e.Ground="g",e.Water="w",e))(Di||{});const Oh=(e,t,s)=>({energy:e,players:t,lighthouses:s}),gm=(e,t,s,i,r,n,o)=>({id:e,name:t,energy:s,score:i,keys:r,color:n,x:o.x,y:o.y}),ym=(e,t,s,i,r)=>({id:e,energy:t,ownerId:s,links:i,x:r.x,y:r.y}),xm=(e,t,s)=>({name:e,state:t,turns:s}),_m=(e,t)=>({name:e,state:t}),bm=(e,t)=>({x:e,y:t}),vm="modulepreload",wm=function(e){return"/codeconz-lighthouses-engine/"+e},bl={},Fr=function(t,s,i){let r=Promise.resolve();if(s&&s.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));r=Promise.allSettled(s.map(l=>{if(l=wm(l),l in bl)return;bl[l]=!0;const h=l.endsWith(".css"),c=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${c}`))return;const u=document.createElement("link");if(u.rel=h?"stylesheet":vm,h||(u.as="script"),u.crossOrigin="",u.href=l,a&&u.setAttribute("nonce",a),document.head.appendChild(u),h)return new Promise((f,m)=>{u.addEventListener("load",f),u.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${l}`)))})}))}function n(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return r.then(o=>{for(const a of o||[])a.status==="rejected"&&n(a.reason);return t().catch(n)})};var Tt=(e=>(e.Application="application",e.WebGLPipes="webgl-pipes",e.WebGLPipesAdaptor="webgl-pipes-adaptor",e.WebGLSystem="webgl-system",e.WebGPUPipes="webgpu-pipes",e.WebGPUPipesAdaptor="webgpu-pipes-adaptor",e.WebGPUSystem="webgpu-system",e.CanvasSystem="canvas-system",e.CanvasPipesAdaptor="canvas-pipes-adaptor",e.CanvasPipes="canvas-pipes",e.Asset="asset",e.LoadParser="load-parser",e.ResolveParser="resolve-parser",e.CacheParser="cache-parser",e.DetectionParser="detection-parser",e.MaskEffect="mask-effect",e.BlendMode="blend-mode",e.TextureSource="texture-source",e.Environment="environment",e.ShapeBuilder="shape-builder",e.Batcher="batcher",e))(Tt||{});const yo=e=>{if(typeof e=="function"||typeof e=="object"&&e.extension){if(!e.extension)throw new Error("Extension class must have an extension object");e={...typeof e.extension!="object"?{type:e.extension}:e.extension,ref:e}}if(typeof e=="object")e={...e};else throw new Error("Invalid extension type");return typeof e.type=="string"&&(e.type=[e.type]),e},or=(e,t)=>yo(e).priority??t,Xe={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...e){return e.map(yo).forEach(t=>{t.type.forEach(s=>{var i,r;return(r=(i=this._removeHandlers)[s])==null?void 0:r.call(i,t)})}),this},add(...e){return e.map(yo).forEach(t=>{t.type.forEach(s=>{var n,o;const i=this._addHandlers,r=this._queue;i[s]?(o=i[s])==null||o.call(i,t):(r[s]=r[s]||[],(n=r[s])==null||n.push(t))})}),this},handle(e,t,s){var o;const i=this._addHandlers,r=this._removeHandlers;if(i[e]||r[e])throw new Error(`Extension type ${e} already has a handler`);i[e]=t,r[e]=s;const n=this._queue;return n[e]&&((o=n[e])==null||o.forEach(a=>t(a)),delete n[e]),this},handleByMap(e,t){return this.handle(e,s=>{s.name&&(t[s.name]=s.ref)},s=>{s.name&&delete t[s.name]})},handleByNamedList(e,t,s=-1){return this.handle(e,i=>{t.findIndex(n=>n.name===i.name)>=0||(t.push({name:i.name,value:i.ref}),t.sort((n,o)=>or(o.value,s)-or(n.value,s)))},i=>{const r=t.findIndex(n=>n.name===i.name);r!==-1&&t.splice(r,1)})},handleByList(e,t,s=-1){return this.handle(e,i=>{t.includes(i.ref)||(t.push(i.ref),t.sort((r,n)=>or(n,s)-or(r,s)))},i=>{const r=t.indexOf(i.ref);r!==-1&&t.splice(r,1)})}},Sm={extension:{type:Tt.Environment,name:"browser",priority:-1},test:()=>!0,load:async()=>{await Fr(()=>import("./browserAll-CrdAKifF.js"),__vite__mapDeps([0,1,2,3]))}},Cm={extension:{type:Tt.Environment,name:"webworker",priority:0},test:()=>typeof self<"u"&&self.WorkerGlobalScope!==void 0,load:async()=>{await Fr(()=>import("./webworkerAll-DZ1ir_jf.js"),__vite__mapDeps([1,2,3]))}};class Me{constructor(t,s,i){this._x=s||0,this._y=i||0,this._observer=t}clone(t){return new Me(t??this._observer,this._x,this._y)}set(t=0,s=t){return(this._x!==t||this._y!==s)&&(this._x=t,this._y=s,this._observer._onUpdate(this)),this}copyFrom(t){return(this._x!==t.x||this._y!==t.y)&&(this._x=t.x,this._y=t.y,this._observer._onUpdate(this)),this}copyTo(t){return t.set(this._x,this._y),t}equals(t){return t.x===this._x&&t.y===this._y}toString(){return`[pixi.js/math:ObservablePoint x=0 y=0 scope=${this._observer}]`}get x(){return this._x}set x(t){this._x!==t&&(this._x=t,this._observer._onUpdate(this))}get y(){return this._y}set y(t){this._y!==t&&(this._y=t,this._observer._onUpdate(this))}}function la(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Lh={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,s="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(s=!1));function r(l,h,c){this.fn=l,this.context=h,this.once=c||!1}function n(l,h,c,u,f){if(typeof c!="function")throw new TypeError("The listener must be a function");var m=new r(c,u||l,f),d=s?s+h:h;return l._events[d]?l._events[d].fn?l._events[d]=[l._events[d],m]:l._events[d].push(m):(l._events[d]=m,l._eventsCount++),l}function o(l,h){--l._eventsCount===0?l._events=new i:delete l._events[h]}function a(){this._events=new i,this._eventsCount=0}a.prototype.eventNames=function(){var h=[],c,u;if(this._eventsCount===0)return h;for(u in c=this._events)t.call(c,u)&&h.push(s?u.slice(1):u);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(c)):h},a.prototype.listeners=function(h){var c=s?s+h:h,u=this._events[c];if(!u)return[];if(u.fn)return[u.fn];for(var f=0,m=u.length,d=new Array(m);fRs[e],uY:e=>Fs[e],vX:e=>Bs[e],vY:e=>Os[e],inv:e=>e&8?e&15:-e&7,add:(e,t)=>xo[e][t],sub:(e,t)=>xo[e][Ut.inv(t)],rotate180:e=>e^4,isVertical:e=>(e&3)===2,byDirection:(e,t)=>Math.abs(e)*2<=Math.abs(t)?t>=0?Ut.S:Ut.N:Math.abs(t)*2<=Math.abs(e)?e>0?Ut.E:Ut.W:t>0?e>0?Ut.SE:Ut.SW:e>0?Ut.NE:Ut.NW,matrixAppendRotationInv:(e,t,s=0,i=0)=>{const r=Nh[Ut.inv(t)];r.tx=s,r.ty=i,e.append(r)}},lr=[new ue,new ue,new ue,new ue];class ne{constructor(t=0,s=0,i=0,r=0){this.type="rectangle",this.x=Number(t),this.y=Number(s),this.width=Number(i),this.height=Number(r)}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}isEmpty(){return this.left===this.right||this.top===this.bottom}static get EMPTY(){return new ne(0,0,0,0)}clone(){return new ne(this.x,this.y,this.width,this.height)}copyFromBounds(t){return this.x=t.minX,this.y=t.minY,this.width=t.maxX-t.minX,this.height=t.maxY-t.minY,this}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.copyFrom(this),t}contains(t,s){return this.width<=0||this.height<=0?!1:t>=this.x&&t=this.y&&s=l&&t<=h&&s>=c&&s<=u&&!(t>f&&td&&st.right?t.right:this.right)<=G)return!1;const k=this.yt.bottom?t.bottom:this.bottom)>k}const i=this.left,r=this.right,n=this.top,o=this.bottom;if(r<=i||o<=n)return!1;const a=lr[0].set(t.left,t.top),l=lr[1].set(t.left,t.bottom),h=lr[2].set(t.right,t.top),c=lr[3].set(t.right,t.bottom);if(h.x<=a.x||l.y<=a.y)return!1;const u=Math.sign(s.a*s.d-s.b*s.c);if(u===0||(s.apply(a,a),s.apply(l,l),s.apply(h,h),s.apply(c,c),Math.max(a.x,l.x,h.x,c.x)<=i||Math.min(a.x,l.x,h.x,c.x)>=r||Math.max(a.y,l.y,h.y,c.y)<=n||Math.min(a.y,l.y,h.y,c.y)>=o))return!1;const f=u*(l.y-a.y),m=u*(a.x-l.x),d=f*i+m*n,y=f*r+m*n,g=f*i+m*o,v=f*r+m*o;if(Math.max(d,y,g,v)<=f*a.x+m*a.y||Math.min(d,y,g,v)>=f*c.x+m*c.y)return!1;const w=u*(a.y-h.y),A=u*(h.x-a.x),M=w*i+A*n,I=w*r+A*n,N=w*i+A*o,V=w*r+A*o;return!(Math.max(M,I,N,V)<=w*a.x+A*a.y||Math.min(M,I,N,V)>=w*c.x+A*c.y)}pad(t=0,s=t){return this.x-=t,this.y-=s,this.width+=t*2,this.height+=s*2,this}fit(t){const s=Math.max(this.x,t.x),i=Math.min(this.x+this.width,t.x+t.width),r=Math.max(this.y,t.y),n=Math.min(this.y+this.height,t.y+t.height);return this.x=s,this.width=Math.max(i-s,0),this.y=r,this.height=Math.max(n-r,0),this}ceil(t=1,s=.001){const i=Math.ceil((this.x+this.width-s)*t)/t,r=Math.ceil((this.y+this.height-s)*t)/t;return this.x=Math.floor((this.x+s)*t)/t,this.y=Math.floor((this.y+s)*t)/t,this.width=i-this.x,this.height=r-this.y,this}enlarge(t){const s=Math.min(this.x,t.x),i=Math.max(this.x+this.width,t.x+t.width),r=Math.min(this.y,t.y),n=Math.max(this.y+this.height,t.y+t.height);return this.x=s,this.width=i-s,this.y=r,this.height=n-r,this}getBounds(t){return t=t||new ne,t.copyFrom(this),t}toString(){return`[pixi.js/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}}const En={default:-1};function Qt(e="default"){return En[e]===void 0&&(En[e]=-1),++En[e]}const vl={},Zt="8.0.0",Rm="8.3.4";function Xt(e,t,s=3){if(vl[t])return;let i=new Error().stack;typeof i>"u"?console.warn("PixiJS Deprecation Warning: ",`${t} Deprecated since v${e}`):(i=i.split(` `).splice(s).join(` `),console.groupCollapsed?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",`${t} @@ -103,7 +103,7 @@ Deprecated since v${e}`),console.warn(i))),vl[t]=!0}const Dh=()=>{};function o1( `}function Ag(e,t,s){const i=s?t.maxSupportedFragmentPrecision:t.maxSupportedVertexPrecision;if(e.substring(0,9)!=="precision"){let r=s?t.requestedFragmentPrecision:t.requestedVertexPrecision;return r==="highp"&&i!=="highp"&&(r="mediump"),`precision ${r} float; ${e}`}else if(i!=="highp"&&e.substring(0,15)==="precision highp")return e.replace("precision highp","precision mediump");return e}function Pg(e,t){return t?`#version 300 es ${e}`:e}const Tg={},Eg={};function kg(e,{name:t="pixi-program"},s=!0){t=t.replace(/\s+/g,"-"),t+=s?"-fragment":"-vertex";const i=s?Tg:Eg;return i[t]?(i[t]++,t+=`-${i[t]}`):i[t]=1,e.indexOf("#define SHADER_NAME")!==-1?e:`${`#define SHADER_NAME ${t}`} -${e}`}function Ig(e,t){return t?e.replace("#version 300 es",""):e}const Gn={stripVersion:Ig,ensurePrecision:Ag,addProgramDefines:Mg,setProgramName:kg,insertVersion:Pg},$n=Object.create(null),mu=class Co{constructor(t){t={...Co.defaultOptions,...t};const s=t.fragment.indexOf("#version 300 es")!==-1,i={stripVersion:s,ensurePrecision:{requestedFragmentPrecision:t.preferredFragmentPrecision,requestedVertexPrecision:t.preferredVertexPrecision,maxSupportedVertexPrecision:"highp",maxSupportedFragmentPrecision:Cg()},setProgramName:{name:t.name},addProgramDefines:s,insertVersion:s};let r=t.fragment,n=t.vertex;Object.keys(Gn).forEach(o=>{const a=i[o];r=Gn[o](r,a,!0),n=Gn[o](n,a,!1)}),this.fragment=r,this.vertex=n,this._key=fa(`${this.vertex}:${this.fragment}`,"gl-program")}destroy(){this.fragment=null,this.vertex=null,this._attributeData=null,this._uniformData=null,this._uniformBlockData=null,this.transformFeedbackVaryings=null}static from(t){const s=`${t.vertex}:${t.fragment}`;return $n[s]||($n[s]=new Co(t)),$n[s]}};mu.defaultOptions={preferredVertexPrecision:"highp",preferredFragmentPrecision:"mediump"};let Xr=mu;const Gl={uint8x2:{size:2,stride:2,normalised:!1},uint8x4:{size:4,stride:4,normalised:!1},sint8x2:{size:2,stride:2,normalised:!1},sint8x4:{size:4,stride:4,normalised:!1},unorm8x2:{size:2,stride:2,normalised:!0},unorm8x4:{size:4,stride:4,normalised:!0},snorm8x2:{size:2,stride:2,normalised:!0},snorm8x4:{size:4,stride:4,normalised:!0},uint16x2:{size:2,stride:4,normalised:!1},uint16x4:{size:4,stride:8,normalised:!1},sint16x2:{size:2,stride:4,normalised:!1},sint16x4:{size:4,stride:8,normalised:!1},unorm16x2:{size:2,stride:4,normalised:!0},unorm16x4:{size:4,stride:8,normalised:!0},snorm16x2:{size:2,stride:4,normalised:!0},snorm16x4:{size:4,stride:8,normalised:!0},float16x2:{size:2,stride:4,normalised:!1},float16x4:{size:4,stride:8,normalised:!1},float32:{size:1,stride:4,normalised:!1},float32x2:{size:2,stride:8,normalised:!1},float32x3:{size:3,stride:12,normalised:!1},float32x4:{size:4,stride:16,normalised:!1},uint32:{size:1,stride:4,normalised:!1},uint32x2:{size:2,stride:8,normalised:!1},uint32x3:{size:3,stride:12,normalised:!1},uint32x4:{size:4,stride:16,normalised:!1},sint32:{size:1,stride:4,normalised:!1},sint32x2:{size:2,stride:8,normalised:!1},sint32x3:{size:3,stride:12,normalised:!1},sint32x4:{size:4,stride:16,normalised:!1}};function Rg(e){return Gl[e]??Gl.float32}const Fg={f32:"float32","vec2":"float32x2","vec3":"float32x3","vec4":"float32x4",vec2f:"float32x2",vec3f:"float32x3",vec4f:"float32x4",i32:"sint32","vec2":"sint32x2","vec3":"sint32x3","vec4":"sint32x4",u32:"uint32","vec2":"uint32x2","vec3":"uint32x3","vec4":"uint32x4",bool:"uint32","vec2":"uint32x2","vec3":"uint32x3","vec4":"uint32x4"};function Bg({source:e,entryPoint:t}){const s={},i=e.indexOf(`fn ${t}`);if(i!==-1){const r=e.indexOf("->",i);if(r!==-1){const n=e.substring(i,r),o=/@location\((\d+)\)\s+([a-zA-Z0-9_]+)\s*:\s*([a-zA-Z0-9_<>]+)(?:,|\s|$)/g;let a;for(;(a=o.exec(n))!==null;){const l=Fg[a[3]]??"float32";s[a[2]]={location:parseInt(a[1],10),format:l,stride:Rg(l).stride,offset:0,instance:!1,start:0}}}}return s}function Hn(e){var u,f;const t=/(^|[^/])@(group|binding)\(\d+\)[^;]+;/g,s=/@group\((\d+)\)/,i=/@binding\((\d+)\)/,r=/var(<[^>]+>)? (\w+)/,n=/:\s*(\w+)/,o=/struct\s+(\w+)\s*{([^}]+)}/g,a=/(\w+)\s*:\s*([\w\<\>]+)/g,l=/struct\s+(\w+)/,h=(u=e.match(t))==null?void 0:u.map(m=>({group:parseInt(m.match(s)[1],10),binding:parseInt(m.match(i)[1],10),name:m.match(r)[2],isUniform:m.match(r)[1]==="",type:m.match(n)[1]}));if(!h)return{groups:[],structs:[]};const c=((f=e.match(o))==null?void 0:f.map(m=>{const d=m.match(l)[1],y=m.match(a).reduce((g,v)=>{const[w,A]=v.split(":");return g[w.trim()]=A.trim(),g},{});return y?{name:d,members:y}:null}).filter(({name:m})=>h.some(d=>d.type===m)))??[];return{groups:h,structs:c}}var vi=(e=>(e[e.VERTEX=1]="VERTEX",e[e.FRAGMENT=2]="FRAGMENT",e[e.COMPUTE=4]="COMPUTE",e))(vi||{});function Og({groups:e}){const t=[];for(let s=0;ss.has(o.name)?!1:(s.add(o.name),!0)),n=[...e.groups,...t.groups].filter(o=>{const a=`${o.name}-${o.binding}`;return i.has(a)?!1:(i.add(a),!0)});return{structs:r,groups:n}}const zn=Object.create(null);class li{constructor(t){var a,l;this._layoutKey=0,this._attributeLocationsKey=0;const{fragment:s,vertex:i,layout:r,gpuLayout:n,name:o}=t;if(this.name=o,this.fragment=s,this.vertex=i,s.source===i.source){const h=Hn(s.source);this.structsAndGroups=h}else{const h=Hn(i.source),c=Hn(s.source);this.structsAndGroups=Ng(h,c)}this.layout=r??Lg(this.structsAndGroups),this.gpuLayout=n??Og(this.structsAndGroups),this.autoAssignGlobalUniforms=((a=this.layout[0])==null?void 0:a.globalUniforms)!==void 0,this.autoAssignLocalUniforms=((l=this.layout[1])==null?void 0:l.localUniforms)!==void 0,this._generateProgramKey()}_generateProgramKey(){const{vertex:t,fragment:s}=this,i=t.source+s.source+t.entryPoint+s.entryPoint;this._layoutKey=fa(i,"program")}get attributeData(){return this._attributeData??(this._attributeData=Bg(this.vertex)),this._attributeData}destroy(){this.gpuLayout=null,this.layout=null,this.structsAndGroups=null,this.fragment=null,this.vertex=null}static from(t){const s=`${t.vertex.source}:${t.fragment.source}:${t.fragment.entryPoint}:${t.vertex.entryPoint}`;return zn[s]||(zn[s]=new li(t)),zn[s]}}const gu=["f32","i32","vec2","vec3","vec4","mat2x2","mat3x3","mat4x4","mat3x2","mat4x2","mat2x3","mat4x3","mat2x4","mat3x4"],Dg=gu.reduce((e,t)=>(e[t]=!0,e),{});function Ug(e,t){switch(e){case"f32":return 0;case"vec2":return new Float32Array(2*t);case"vec3":return new Float32Array(3*t);case"vec4":return new Float32Array(4*t);case"mat2x2":return new Float32Array([1,0,0,1]);case"mat3x3":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4x4":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}const yu=class xu{constructor(t,s){this._touched=0,this.uid=Qt("uniform"),this._resourceType="uniformGroup",this._resourceId=Qt("resource"),this.isUniformGroup=!0,this._dirtyId=0,this.destroyed=!1,s={...xu.defaultOptions,...s},this.uniformStructures=t;const i={};for(const r in t){const n=t[r];if(n.name=r,n.size=n.size??1,!Dg[n.type])throw new Error(`Uniform type ${n.type} is not supported. Supported uniform types are: ${gu.join(", ")}`);n.value??(n.value=Ug(n.type,n.size)),i[r]=n.value}this.uniforms=i,this._dirtyId=1,this.ubo=s.ubo,this.isStatic=s.isStatic,this._signature=fa(Object.keys(i).map(r=>`${r}-${t[r].type}`).join("-"),"uniform-group")}update(){this._dirtyId++}};yu.defaultOptions={ubo:!1,isStatic:!1};let da=yu;class wr{constructor(t){this.resources=Object.create(null),this._dirty=!0;let s=0;for(const i in t){const r=t[i];this.setResource(r,s++)}this._updateKey()}_updateKey(){if(!this._dirty)return;this._dirty=!1;const t=[];let s=0;for(const i in this.resources)t[s++]=this.resources[i]._resourceId;this._key=t.join("|")}setResource(t,s){var r,n;const i=this.resources[s];t!==i&&(i&&((r=t.off)==null||r.call(t,"change",this.onResourceChange,this)),(n=t.on)==null||n.call(t,"change",this.onResourceChange,this),this.resources[s]=t,this._dirty=!0)}getResource(t){return this.resources[t]}_touch(t){const s=this.resources;for(const i in s)s[i]._touched=t}destroy(){var s;const t=this.resources;for(const i in t){const r=t[i];(s=r.off)==null||s.call(r,"change",this.onResourceChange,this)}this.resources=null}onResourceChange(t){if(this._dirty=!0,t.destroyed){const s=this.resources;for(const i in s)s[i]===t&&(s[i]=null)}else this._updateKey()}}var Mo=(e=>(e[e.WEBGL=1]="WEBGL",e[e.WEBGPU=2]="WEBGPU",e[e.BOTH=3]="BOTH",e))(Mo||{});class qr extends ls{constructor(t){super(),this._uniformBindMap=Object.create(null),this._ownedBindGroups=[];let{gpuProgram:s,glProgram:i,groups:r,resources:n,compatibleRenderers:o,groupMap:a}=t;this.gpuProgram=s,this.glProgram=i,o===void 0&&(o=0,s&&(o|=Mo.WEBGPU),i&&(o|=Mo.WEBGL)),this.compatibleRenderers=o;const l={};if(!n&&!r&&(n={}),n&&r)throw new Error("[Shader] Cannot have both resources and groups");if(!s&&r&&!a)throw new Error("[Shader] No group map or WebGPU shader provided - consider using resources instead.");if(!s&&r&&a)for(const h in a)for(const c in a[h]){const u=a[h][c];l[u]={group:h,binding:c,name:u}}else if(s&&r&&!a){const h=s.structsAndGroups.groups;a={},h.forEach(c=>{a[c.group]=a[c.group]||{},a[c.group][c.binding]=c.name,l[c.name]=c})}else if(n){r={},a={},s&&s.structsAndGroups.groups.forEach(u=>{a[u.group]=a[u.group]||{},a[u.group][u.binding]=u.name,l[u.name]=u});let h=0;for(const c in n)l[c]||(r[99]||(r[99]=new wr,this._ownedBindGroups.push(r[99])),l[c]={group:99,binding:h,name:c},a[99]=a[99]||{},a[99][h]=c,h++);for(const c in n){const u=c;let f=n[c];!f.source&&!f._resourceType&&(f=new da(f));const m=l[u];m&&(r[m.group]||(r[m.group]=new wr,this._ownedBindGroups.push(r[m.group])),r[m.group].setResource(f,m.binding))}}this.groups=r,this._uniformBindMap=a,this.resources=this._buildResourceAccessor(r,l)}addResource(t,s,i){var r,n;(r=this._uniformBindMap)[s]||(r[s]={}),(n=this._uniformBindMap[s])[i]||(n[i]=t),this.groups[s]||(this.groups[s]=new wr,this._ownedBindGroups.push(this.groups[s]))}_buildResourceAccessor(t,s){const i={};for(const r in s){const n=s[r];Object.defineProperty(i,n.name,{get(){return t[n.group].getResource(n.binding)},set(o){t[n.group].setResource(o,n.binding)}})}return i}destroy(t=!1){var s,i;this.emit("destroy",this),t&&((s=this.gpuProgram)==null||s.destroy(),(i=this.glProgram)==null||i.destroy()),this.gpuProgram=null,this.glProgram=null,this.removeAllListeners(),this._uniformBindMap=null,this._ownedBindGroups.forEach(r=>{r.destroy()}),this._ownedBindGroups=null,this.resources=null,this.groups=null}static from(t){const{gpu:s,gl:i,...r}=t;let n,o;return s&&(n=li.from(s)),i&&(o=Xr.from(i)),new qr({gpuProgram:n,glProgram:o,...r})}}const Vg={normal:0,add:1,multiply:2,screen:3,overlay:4,erase:5,"normal-npm":6,"add-npm":7,"screen-npm":8,min:9,max:10},jn=0,Yn=1,Wn=2,Xn=3,qn=4,Kn=5,Ao=class _u{constructor(){this.data=0,this.blendMode="normal",this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(this.data&1<80*s){a=h=e[0],l=c=e[1];for(var d=s;dh&&(h=u),f>c&&(c=f);m=Math.max(h-a,c-l),m=m!==0?32767/m:0}return Gi(n,o,s,a,l,m,0),o}function vu(e,t,s,i,r){var n,o;if(r===Io(e,t,s,i)>0)for(n=t;n=t;n-=i)o=$l(n,e[n],e[n+1],o);return o&&Zr(o,o.next)&&(Hi(o),o=o.next),o}function Gs(e,t){if(!e)return e;t||(t=e);var s=e,i;do if(i=!1,!s.steiner&&(Zr(s,s.next)||Vt(s.prev,s,s.next)===0)){if(Hi(s),s=t=s.prev,s===s.next)break;i=!0}else s=s.next;while(i||s!==t);return t}function Gi(e,t,s,i,r,n,o){if(e){!o&&n&&t0(e,i,r,n);for(var a=e,l,h;e.prev!==e.next;){if(l=e.prev,h=e.next,n?Yg(e,i,r,n):jg(e)){t.push(l.i/s|0),t.push(e.i/s|0),t.push(h.i/s|0),Hi(e),e=h.next,a=h.next;continue}if(e=h,e===a){o?o===1?(e=Wg(Gs(e),t,s),Gi(e,t,s,i,r,n,2)):o===2&&Xg(e,t,s,i,r,n):Gi(Gs(e),t,s,i,r,n,1);break}}}}function jg(e){var t=e.prev,s=e,i=e.next;if(Vt(t,s,i)>=0)return!1;for(var r=t.x,n=s.x,o=i.x,a=t.y,l=s.y,h=i.y,c=rn?r>o?r:o:n>o?n:o,m=a>l?a>h?a:h:l>h?l:h,d=i.next;d!==t;){if(d.x>=c&&d.x<=f&&d.y>=u&&d.y<=m&&Zs(r,a,n,l,o,h,d.x,d.y)&&Vt(d.prev,d,d.next)>=0)return!1;d=d.next}return!0}function Yg(e,t,s,i){var r=e.prev,n=e,o=e.next;if(Vt(r,n,o)>=0)return!1;for(var a=r.x,l=n.x,h=o.x,c=r.y,u=n.y,f=o.y,m=al?a>h?a:h:l>h?l:h,g=c>u?c>f?c:f:u>f?u:f,v=Eo(m,d,t,s,i),w=Eo(y,g,t,s,i),A=e.prevZ,M=e.nextZ;A&&A.z>=v&&M&&M.z<=w;){if(A.x>=m&&A.x<=y&&A.y>=d&&A.y<=g&&A!==r&&A!==o&&Zs(a,c,l,u,h,f,A.x,A.y)&&Vt(A.prev,A,A.next)>=0||(A=A.prevZ,M.x>=m&&M.x<=y&&M.y>=d&&M.y<=g&&M!==r&&M!==o&&Zs(a,c,l,u,h,f,M.x,M.y)&&Vt(M.prev,M,M.next)>=0))return!1;M=M.nextZ}for(;A&&A.z>=v;){if(A.x>=m&&A.x<=y&&A.y>=d&&A.y<=g&&A!==r&&A!==o&&Zs(a,c,l,u,h,f,A.x,A.y)&&Vt(A.prev,A,A.next)>=0)return!1;A=A.prevZ}for(;M&&M.z<=w;){if(M.x>=m&&M.x<=y&&M.y>=d&&M.y<=g&&M!==r&&M!==o&&Zs(a,c,l,u,h,f,M.x,M.y)&&Vt(M.prev,M,M.next)>=0)return!1;M=M.nextZ}return!0}function Wg(e,t,s){var i=e;do{var r=i.prev,n=i.next.next;!Zr(r,n)&&wu(r,i,i.next,n)&&$i(r,n)&&$i(n,r)&&(t.push(r.i/s|0),t.push(i.i/s|0),t.push(n.i/s|0),Hi(i),Hi(i.next),i=e=n),i=i.next}while(i!==e);return Gs(i)}function Xg(e,t,s,i,r,n){var o=e;do{for(var a=o.next.next;a!==o.prev;){if(o.i!==a.i&&i0(o,a)){var l=Su(o,a);o=Gs(o,o.next),l=Gs(l,l.next),Gi(o,t,s,i,r,n,0),Gi(l,t,s,i,r,n,0);return}a=a.next}o=o.next}while(o!==e)}function qg(e,t,s,i){var r=[],n,o,a,l,h;for(n=0,o=t.length;n=s.next.y&&s.next.y!==s.y){var a=s.x+(r-s.y)*(s.next.x-s.x)/(s.next.y-s.y);if(a<=i&&a>n&&(n=a,o=s.x=s.x&&s.x>=h&&i!==s.x&&Zs(ro.x||s.x===o.x&&Jg(o,s)))&&(o=s,u=f)),s=s.next;while(s!==l);return o}function Jg(e,t){return Vt(e.prev,e,t.prev)<0&&Vt(t.next,e,e.next)<0}function t0(e,t,s,i){var r=e;do r.z===0&&(r.z=Eo(r.x,r.y,t,s,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==e);r.prevZ.nextZ=null,r.prevZ=null,e0(r)}function e0(e){var t,s,i,r,n,o,a,l,h=1;do{for(s=e,e=null,n=null,o=0;s;){for(o++,i=s,a=0,t=0;t0||l>0&&i;)a!==0&&(l===0||!i||s.z<=i.z)?(r=s,s=s.nextZ,a--):(r=i,i=i.nextZ,l--),n?n.nextZ=r:e=r,r.prevZ=n,n=r;s=i}n.nextZ=null,h*=2}while(o>1);return e}function Eo(e,t,s,i,r){return e=(e-s)*r|0,t=(t-i)*r|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function s0(e){var t=e,s=e;do(t.x=(e-o)*(n-a)&&(e-o)*(i-a)>=(s-o)*(t-a)&&(s-o)*(n-a)>=(r-o)*(i-a)}function i0(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!r0(e,t)&&($i(e,t)&&$i(t,e)&&n0(e,t)&&(Vt(e.prev,e,t.prev)||Vt(e,t.prev,t))||Zr(e,t)&&Vt(e.prev,e,e.next)>0&&Vt(t.prev,t,t.next)>0)}function Vt(e,t,s){return(t.y-e.y)*(s.x-t.x)-(t.x-e.x)*(s.y-t.y)}function Zr(e,t){return e.x===t.x&&e.y===t.y}function wu(e,t,s,i){var r=fr(Vt(e,t,s)),n=fr(Vt(e,t,i)),o=fr(Vt(s,i,e)),a=fr(Vt(s,i,t));return!!(r!==n&&o!==a||r===0&&ur(e,s,t)||n===0&&ur(e,i,t)||o===0&&ur(s,e,i)||a===0&&ur(s,t,i))}function ur(e,t,s){return t.x<=Math.max(e.x,s.x)&&t.x>=Math.min(e.x,s.x)&&t.y<=Math.max(e.y,s.y)&&t.y>=Math.min(e.y,s.y)}function fr(e){return e>0?1:e<0?-1:0}function r0(e,t){var s=e;do{if(s.i!==e.i&&s.next.i!==e.i&&s.i!==t.i&&s.next.i!==t.i&&wu(s,s.next,e,t))return!0;s=s.next}while(s!==e);return!1}function $i(e,t){return Vt(e.prev,e,e.next)<0?Vt(e,t,e.next)>=0&&Vt(e,e.prev,t)>=0:Vt(e,t,e.prev)<0||Vt(e,e.next,t)<0}function n0(e,t){var s=e,i=!1,r=(e.x+t.x)/2,n=(e.y+t.y)/2;do s.y>n!=s.next.y>n&&s.next.y!==s.y&&r<(s.next.x-s.x)*(n-s.y)/(s.next.y-s.y)+s.x&&(i=!i),s=s.next;while(s!==e);return i}function Su(e,t){var s=new ko(e.i,e.x,e.y),i=new ko(t.i,t.x,t.y),r=e.next,n=t.prev;return e.next=t,t.prev=e,s.next=r,r.prev=s,i.next=s,s.prev=i,n.next=i,i.prev=n,i}function $l(e,t,s,i){var r=new ko(e,t,s);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function Hi(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function ko(e,t,s){this.i=e,this.x=t,this.y=s,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}Kr.deviation=function(e,t,s,i){var r=t&&t.length,n=r?t[0]*s:e.length,o=Math.abs(Io(e,0,n,s));if(r)for(var a=0,l=t.length;a0&&(i+=e[r-1].length,s.holes.push(i))}return s};var o0=pa.exports;const a0=la(o0);var Cu=(e=>(e[e.NONE=0]="NONE",e[e.COLOR=16384]="COLOR",e[e.STENCIL=1024]="STENCIL",e[e.DEPTH=256]="DEPTH",e[e.COLOR_DEPTH=16640]="COLOR_DEPTH",e[e.COLOR_STENCIL=17408]="COLOR_STENCIL",e[e.DEPTH_STENCIL=1280]="DEPTH_STENCIL",e[e.ALL=17664]="ALL",e))(Cu||{});class l0{constructor(t){this.items=[],this._name=t}emit(t,s,i,r,n,o,a,l){const{name:h,items:c}=this;for(let u=0,f=c.length;u{this.runners[s]=new l0(s)})}_addSystems(t){let s;for(s in t){const i=t[s];this._addSystem(i.value,i.name)}}_addSystem(t,s){const i=new t(this);if(this[s])throw new Error(`Whoops! The name "${s}" is already in use`);this[s]=i,this._systemsHash[s]=i;for(const r in this.runners)this.runners[r].add(i);return this}_addPipes(t,s){const i=s.reduce((r,n)=>(r[n.name]=n.value,r),{});t.forEach(r=>{const n=r.value,o=r.name,a=i[o];this.renderPipes[o]=new n(this,a?new a:null)})}destroy(t=!1){this.runners.destroy.items.reverse(),this.runners.destroy.emit(t),Object.values(this.runners).forEach(s=>{s.destroy()}),this._systemsHash=null,this.renderPipes=null}generateTexture(t){return this.textureGenerator.generateTexture(t)}get roundPixels(){return!!this._roundPixels}_unsafeEvalCheck(){if(!zg())throw new Error("Current environment does not allow unsafe-eval, please use pixi.js/unsafe-eval module to enable support.")}};Mu.defaultOptions={resolution:1,failIfMajorPerformanceCaveat:!1,roundPixels:!1};let Pu=Mu,dr;function h0(e){return dr!==void 0||(dr=(()=>{var s;const t={stencil:!0,failIfMajorPerformanceCaveat:e??Pu.defaultOptions.failIfMajorPerformanceCaveat};try{if(!bs.get().getWebGLRenderingContext())return!1;let r=bs.get().createCanvas().getContext("webgl",t);const n=!!((s=r==null?void 0:r.getContextAttributes())!=null&&s.stencil);if(r){const o=r.getExtension("WEBGL_lose_context");o&&o.loseContext()}return r=null,n}catch{return!1}})()),dr}let pr;async function u0(e={}){return pr!==void 0||(pr=await(async()=>{const t=bs.get().getNavigator().gpu;if(!t)return!1;try{return await(await t.requestAdapter(e)).requestDevice(),!0}catch{return!1}})()),pr}const Hl=["webgl","webgpu","canvas"];async function f0(e){let t=[];e.preference?(t.push(e.preference),Hl.forEach(n=>{n!==e.preference&&t.push(n)})):t=Hl.slice();let s,i={};for(let n=0;n{const{WebGPURenderer:l}=await import("./WebGPURenderer-YFZ97DWp.js");return{WebGPURenderer:l}},__vite__mapDeps([4,2,5,3]));s=a,i={...e,...e.webgpu};break}else if(o==="webgl"&&h0(e.failIfMajorPerformanceCaveat??Pu.defaultOptions.failIfMajorPerformanceCaveat)){const{WebGLRenderer:a}=await Fr(async()=>{const{WebGLRenderer:l}=await import("./WebGLRenderer-BzN8kj9-.js");return{WebGLRenderer:l}},__vite__mapDeps([6,2,5]));s=a,i={...e,...e.webgl};break}else if(o==="canvas")throw i={...e},new Error("CanvasRenderer is not yet implemented")}if(delete i.webgpu,delete i.webgl,!s)throw new Error("No available renderer for the current environment");const r=new s;return await r.init(i),r}const Tu="8.5.1";class Eu{static init(){var t;(t=globalThis.__PIXI_APP_INIT__)==null||t.call(globalThis,this,Tu)}static destroy(){}}Eu.extension=Tt.Application;class d0{constructor(t){this._renderer=t}init(){var t;(t=globalThis.__PIXI_RENDERER_INIT__)==null||t.call(globalThis,this._renderer,Tu)}destroy(){this._renderer=null}}d0.extension={type:[Tt.WebGLSystem,Tt.WebGPUSystem],name:"initHook",priority:-10};const ku=class Ro{constructor(...t){this.stage=new oe,t[0]!==void 0&&Xt(Zt,"Application constructor options are deprecated, please use Application.init() instead.")}async init(t){t={...t},this.renderer=await f0(t),Ro._plugins.forEach(s=>{s.init.call(this,t)})}render(){this.renderer.render({container:this.stage})}get canvas(){return this.renderer.canvas}get view(){return Xt(Zt,"Application.view is deprecated, please use Application.canvas instead."),this.renderer.canvas}get screen(){return this.renderer.screen}destroy(t=!1,s=!1){const i=Ro._plugins.slice(0);i.reverse(),i.forEach(r=>{r.destroy.call(this)}),this.stage.destroy(s),this.stage=null,this.renderer.destroy(t),this.renderer=null}};ku._plugins=[];let Iu=ku;Xe.handleByList(Tt.Application,Iu._plugins);Xe.add(Eu);const Ru=class Fo{constructor(t,s,i,r){this.uid=Qt("fillGradient"),this.type="linear",this.gradientStops=[],this._styleKey=null,this.x0=t,this.y0=s,this.x1=i,this.y1=r}addColorStop(t,s){return this.gradientStops.push({offset:t,color:ge.shared.setValue(s).toHexa()}),this._styleKey=null,this}buildLinearGradient(){const t=Fo.defaultTextureSize,{gradientStops:s}=this,i=bs.get().createCanvas();i.width=t,i.height=t;const r=i.getContext("2d"),n=r.createLinearGradient(0,0,Fo.defaultTextureSize,1);for(let y=0;y`${r.offset}-${r.color}`).join("-"),s=this.texture.uid,i=this.transform.toArray().join("-");return`fill-gradient-${this.uid}-${t}-${s}-${i}-${this.x0}-${this.y0}-${this.x1}-${this.y1}`}};Ru.defaultTextureSize=256;let p0=Ru;const zl={repeat:{addressModeU:"repeat",addressModeV:"repeat"},"repeat-x":{addressModeU:"repeat",addressModeV:"clamp-to-edge"},"repeat-y":{addressModeU:"clamp-to-edge",addressModeV:"repeat"},"no-repeat":{addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"}};class m0{constructor(t,s){this.uid=Qt("fillPattern"),this.transform=new Pt,this._styleKey=null,this.texture=t,this.transform.scale(1/t.frame.width,1/t.frame.height),s&&(t.source.style.addressModeU=zl[s].addressModeU,t.source.style.addressModeV=zl[s].addressModeV)}setTransform(t){const s=this.texture;this.transform.copyFrom(t),this.transform.invert(),this.transform.scale(1/s.frame.width,1/s.frame.height),this._styleKey=null}get styleKey(){return this._styleKey?this._styleKey:(this._styleKey=`fill-pattern-${this.uid}-${this.texture.uid}-${this.transform.toArray().join("-")}`,this._styleKey)}}var g0=x0,Zn={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},y0=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function x0(e){var t=[];return e.replace(y0,function(s,i,r){var n=i.toLowerCase();for(r=b0(r),n=="m"&&r.length>2&&(t.push([i].concat(r.splice(0,2))),n="l",i=i=="m"?"l":"L");;){if(r.length==Zn[n])return r.unshift(i),t.push(r);if(r.length0&&(r=i.pop(),r?(n=r.startX,o=r.startY):(n=0,o=0)),r=null;break;default:je(`Unknown SVG path command: ${h}`)}h!=="Z"&&h!=="z"&&r===null&&(r={startX:n,startY:o},i.push(r))}return t}class ma{constructor(t=0,s=0,i=0){this.type="circle",this.x=t,this.y=s,this.radius=i}clone(){return new ma(this.x,this.y,this.radius)}contains(t,s){if(this.radius<=0)return!1;const i=this.radius*this.radius;let r=this.x-t,n=this.y-s;return r*=r,n*=n,r+n<=i}strokeContains(t,s,i){if(this.radius===0)return!1;const r=this.x-t,n=this.y-s,o=this.radius,a=i/2,l=Math.sqrt(r*r+n*n);return lo-a}getBounds(t){return t=t||new ne,t.x=this.x-this.radius,t.y=this.y-this.radius,t.width=this.radius*2,t.height=this.radius*2,t}copyFrom(t){return this.x=t.x,this.y=t.y,this.radius=t.radius,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`}}class ga{constructor(t=0,s=0,i=0,r=0){this.type="ellipse",this.x=t,this.y=s,this.halfWidth=i,this.halfHeight=r}clone(){return new ga(this.x,this.y,this.halfWidth,this.halfHeight)}contains(t,s){if(this.halfWidth<=0||this.halfHeight<=0)return!1;let i=(t-this.x)/this.halfWidth,r=(s-this.y)/this.halfHeight;return i*=i,r*=r,i+r<=1}strokeContains(t,s,i){const{halfWidth:r,halfHeight:n}=this;if(r<=0||n<=0)return!1;const o=i/2,a=r-o,l=n-o,h=r+o,c=n+o,u=t-this.x,f=s-this.y,m=u*u/(a*a)+f*f/(l*l),d=u*u/(h*h)+f*f/(c*c);return m>1&&d<=1}getBounds(t){return t=t||new ne,t.x=this.x-this.halfWidth,t.y=this.y-this.halfHeight,t.width=this.halfWidth*2,t.height=this.halfHeight*2,t}copyFrom(t){return this.x=t.x,this.y=t.y,this.halfWidth=t.halfWidth,this.halfHeight=t.halfHeight,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:Ellipse x=${this.x} y=${this.y} halfWidth=${this.halfWidth} halfHeight=${this.halfHeight}]`}}function S0(e,t,s,i,r,n){const o=e-s,a=t-i,l=r-s,h=n-i,c=o*l+a*h,u=l*l+h*h;let f=-1;u!==0&&(f=c/u);let m,d;f<0?(m=s,d=i):f>1?(m=r,d=n):(m=s+f*l,d=i+f*h);const y=e-m,g=t-d;return y*y+g*g}class ki{constructor(...t){this.type="polygon";let s=Array.isArray(t[0])?t[0]:t;if(typeof s[0]!="number"){const i=[];for(let r=0,n=s.length;rs!=c>s&&t<(h-a)*((s-l)/(c-l))+a&&(i=!i)}return i}strokeContains(t,s,i){const r=i/2,n=r*r,{points:o}=this,a=o.length-(this.closePath?0:2);for(let l=0;lr?h:r,n=co?c:o}return t.x=i,t.width=r-i,t.y=n,t.height=o-n,t}copyFrom(t){return this.points=t.points.slice(),this.closePath=t.closePath,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:PolygoncloseStroke=${this.closePath}points=${this.points.reduce((t,s)=>`${t}, ${s}`,"")}]`}get lastX(){return this.points[this.points.length-2]}get lastY(){return this.points[this.points.length-1]}get x(){return this.points[this.points.length-2]}get y(){return this.points[this.points.length-1]}}const mr=(e,t,s,i,r,n)=>{const o=e-s,a=t-i,l=Math.sqrt(o*o+a*a);return l>=r-n&&l<=r+n};class ya{constructor(t=0,s=0,i=0,r=0,n=20){this.type="roundedRectangle",this.x=t,this.y=s,this.width=i,this.height=r,this.radius=n}getBounds(t){return t=t||new ne,t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t}clone(){return new ya(this.x,this.y,this.width,this.height,this.radius)}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.copyFrom(this),t}contains(t,s){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&s>=this.y&&s<=this.y+this.height){const i=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(s>=this.y+i&&s<=this.y+this.height-i||t>=this.x+i&&t<=this.x+this.width-i)return!0;let r=t-(this.x+i),n=s-(this.y+i);const o=i*i;if(r*r+n*n<=o||(r=t-(this.x+this.width-i),r*r+n*n<=o)||(n=s-(this.y+this.height-i),r*r+n*n<=o)||(r=t-(this.x+i),r*r+n*n<=o))return!0}return!1}strokeContains(t,s,i){const{x:r,y:n,width:o,height:a,radius:l}=this,h=i/2,c=r+l,u=n+l,f=o-l*2,m=a-l*2,d=r+o,y=n+a;return(t>=r-h&&t<=r+h||t>=d-h&&t<=d+h)&&s>=u&&s<=u+m||(s>=n-h&&s<=n+h||s>=y-h&&s<=y+h)&&t>=c&&t<=c+f?!0:td-l&&sd-l&&s>y-l&&mr(t,s,d-l,y-l,l,h)||ty-l&&mr(t,s,c,y-l,l,h)}toString(){return`[pixi.js/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`}}const C0=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(` +${e}`}function Ig(e,t){return t?e.replace("#version 300 es",""):e}const Gn={stripVersion:Ig,ensurePrecision:Ag,addProgramDefines:Mg,setProgramName:kg,insertVersion:Pg},$n=Object.create(null),mu=class Co{constructor(t){t={...Co.defaultOptions,...t};const s=t.fragment.indexOf("#version 300 es")!==-1,i={stripVersion:s,ensurePrecision:{requestedFragmentPrecision:t.preferredFragmentPrecision,requestedVertexPrecision:t.preferredVertexPrecision,maxSupportedVertexPrecision:"highp",maxSupportedFragmentPrecision:Cg()},setProgramName:{name:t.name},addProgramDefines:s,insertVersion:s};let r=t.fragment,n=t.vertex;Object.keys(Gn).forEach(o=>{const a=i[o];r=Gn[o](r,a,!0),n=Gn[o](n,a,!1)}),this.fragment=r,this.vertex=n,this._key=fa(`${this.vertex}:${this.fragment}`,"gl-program")}destroy(){this.fragment=null,this.vertex=null,this._attributeData=null,this._uniformData=null,this._uniformBlockData=null,this.transformFeedbackVaryings=null}static from(t){const s=`${t.vertex}:${t.fragment}`;return $n[s]||($n[s]=new Co(t)),$n[s]}};mu.defaultOptions={preferredVertexPrecision:"highp",preferredFragmentPrecision:"mediump"};let Xr=mu;const Gl={uint8x2:{size:2,stride:2,normalised:!1},uint8x4:{size:4,stride:4,normalised:!1},sint8x2:{size:2,stride:2,normalised:!1},sint8x4:{size:4,stride:4,normalised:!1},unorm8x2:{size:2,stride:2,normalised:!0},unorm8x4:{size:4,stride:4,normalised:!0},snorm8x2:{size:2,stride:2,normalised:!0},snorm8x4:{size:4,stride:4,normalised:!0},uint16x2:{size:2,stride:4,normalised:!1},uint16x4:{size:4,stride:8,normalised:!1},sint16x2:{size:2,stride:4,normalised:!1},sint16x4:{size:4,stride:8,normalised:!1},unorm16x2:{size:2,stride:4,normalised:!0},unorm16x4:{size:4,stride:8,normalised:!0},snorm16x2:{size:2,stride:4,normalised:!0},snorm16x4:{size:4,stride:8,normalised:!0},float16x2:{size:2,stride:4,normalised:!1},float16x4:{size:4,stride:8,normalised:!1},float32:{size:1,stride:4,normalised:!1},float32x2:{size:2,stride:8,normalised:!1},float32x3:{size:3,stride:12,normalised:!1},float32x4:{size:4,stride:16,normalised:!1},uint32:{size:1,stride:4,normalised:!1},uint32x2:{size:2,stride:8,normalised:!1},uint32x3:{size:3,stride:12,normalised:!1},uint32x4:{size:4,stride:16,normalised:!1},sint32:{size:1,stride:4,normalised:!1},sint32x2:{size:2,stride:8,normalised:!1},sint32x3:{size:3,stride:12,normalised:!1},sint32x4:{size:4,stride:16,normalised:!1}};function Rg(e){return Gl[e]??Gl.float32}const Fg={f32:"float32","vec2":"float32x2","vec3":"float32x3","vec4":"float32x4",vec2f:"float32x2",vec3f:"float32x3",vec4f:"float32x4",i32:"sint32","vec2":"sint32x2","vec3":"sint32x3","vec4":"sint32x4",u32:"uint32","vec2":"uint32x2","vec3":"uint32x3","vec4":"uint32x4",bool:"uint32","vec2":"uint32x2","vec3":"uint32x3","vec4":"uint32x4"};function Bg({source:e,entryPoint:t}){const s={},i=e.indexOf(`fn ${t}`);if(i!==-1){const r=e.indexOf("->",i);if(r!==-1){const n=e.substring(i,r),o=/@location\((\d+)\)\s+([a-zA-Z0-9_]+)\s*:\s*([a-zA-Z0-9_<>]+)(?:,|\s|$)/g;let a;for(;(a=o.exec(n))!==null;){const l=Fg[a[3]]??"float32";s[a[2]]={location:parseInt(a[1],10),format:l,stride:Rg(l).stride,offset:0,instance:!1,start:0}}}}return s}function Hn(e){var u,f;const t=/(^|[^/])@(group|binding)\(\d+\)[^;]+;/g,s=/@group\((\d+)\)/,i=/@binding\((\d+)\)/,r=/var(<[^>]+>)? (\w+)/,n=/:\s*(\w+)/,o=/struct\s+(\w+)\s*{([^}]+)}/g,a=/(\w+)\s*:\s*([\w\<\>]+)/g,l=/struct\s+(\w+)/,h=(u=e.match(t))==null?void 0:u.map(m=>({group:parseInt(m.match(s)[1],10),binding:parseInt(m.match(i)[1],10),name:m.match(r)[2],isUniform:m.match(r)[1]==="",type:m.match(n)[1]}));if(!h)return{groups:[],structs:[]};const c=((f=e.match(o))==null?void 0:f.map(m=>{const d=m.match(l)[1],y=m.match(a).reduce((g,v)=>{const[w,A]=v.split(":");return g[w.trim()]=A.trim(),g},{});return y?{name:d,members:y}:null}).filter(({name:m})=>h.some(d=>d.type===m)))??[];return{groups:h,structs:c}}var vi=(e=>(e[e.VERTEX=1]="VERTEX",e[e.FRAGMENT=2]="FRAGMENT",e[e.COMPUTE=4]="COMPUTE",e))(vi||{});function Og({groups:e}){const t=[];for(let s=0;ss.has(o.name)?!1:(s.add(o.name),!0)),n=[...e.groups,...t.groups].filter(o=>{const a=`${o.name}-${o.binding}`;return i.has(a)?!1:(i.add(a),!0)});return{structs:r,groups:n}}const zn=Object.create(null);class li{constructor(t){var a,l;this._layoutKey=0,this._attributeLocationsKey=0;const{fragment:s,vertex:i,layout:r,gpuLayout:n,name:o}=t;if(this.name=o,this.fragment=s,this.vertex=i,s.source===i.source){const h=Hn(s.source);this.structsAndGroups=h}else{const h=Hn(i.source),c=Hn(s.source);this.structsAndGroups=Ng(h,c)}this.layout=r??Lg(this.structsAndGroups),this.gpuLayout=n??Og(this.structsAndGroups),this.autoAssignGlobalUniforms=((a=this.layout[0])==null?void 0:a.globalUniforms)!==void 0,this.autoAssignLocalUniforms=((l=this.layout[1])==null?void 0:l.localUniforms)!==void 0,this._generateProgramKey()}_generateProgramKey(){const{vertex:t,fragment:s}=this,i=t.source+s.source+t.entryPoint+s.entryPoint;this._layoutKey=fa(i,"program")}get attributeData(){return this._attributeData??(this._attributeData=Bg(this.vertex)),this._attributeData}destroy(){this.gpuLayout=null,this.layout=null,this.structsAndGroups=null,this.fragment=null,this.vertex=null}static from(t){const s=`${t.vertex.source}:${t.fragment.source}:${t.fragment.entryPoint}:${t.vertex.entryPoint}`;return zn[s]||(zn[s]=new li(t)),zn[s]}}const gu=["f32","i32","vec2","vec3","vec4","mat2x2","mat3x3","mat4x4","mat3x2","mat4x2","mat2x3","mat4x3","mat2x4","mat3x4"],Dg=gu.reduce((e,t)=>(e[t]=!0,e),{});function Ug(e,t){switch(e){case"f32":return 0;case"vec2":return new Float32Array(2*t);case"vec3":return new Float32Array(3*t);case"vec4":return new Float32Array(4*t);case"mat2x2":return new Float32Array([1,0,0,1]);case"mat3x3":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4x4":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}const yu=class xu{constructor(t,s){this._touched=0,this.uid=Qt("uniform"),this._resourceType="uniformGroup",this._resourceId=Qt("resource"),this.isUniformGroup=!0,this._dirtyId=0,this.destroyed=!1,s={...xu.defaultOptions,...s},this.uniformStructures=t;const i={};for(const r in t){const n=t[r];if(n.name=r,n.size=n.size??1,!Dg[n.type])throw new Error(`Uniform type ${n.type} is not supported. Supported uniform types are: ${gu.join(", ")}`);n.value??(n.value=Ug(n.type,n.size)),i[r]=n.value}this.uniforms=i,this._dirtyId=1,this.ubo=s.ubo,this.isStatic=s.isStatic,this._signature=fa(Object.keys(i).map(r=>`${r}-${t[r].type}`).join("-"),"uniform-group")}update(){this._dirtyId++}};yu.defaultOptions={ubo:!1,isStatic:!1};let da=yu;class wr{constructor(t){this.resources=Object.create(null),this._dirty=!0;let s=0;for(const i in t){const r=t[i];this.setResource(r,s++)}this._updateKey()}_updateKey(){if(!this._dirty)return;this._dirty=!1;const t=[];let s=0;for(const i in this.resources)t[s++]=this.resources[i]._resourceId;this._key=t.join("|")}setResource(t,s){var r,n;const i=this.resources[s];t!==i&&(i&&((r=t.off)==null||r.call(t,"change",this.onResourceChange,this)),(n=t.on)==null||n.call(t,"change",this.onResourceChange,this),this.resources[s]=t,this._dirty=!0)}getResource(t){return this.resources[t]}_touch(t){const s=this.resources;for(const i in s)s[i]._touched=t}destroy(){var s;const t=this.resources;for(const i in t){const r=t[i];(s=r.off)==null||s.call(r,"change",this.onResourceChange,this)}this.resources=null}onResourceChange(t){if(this._dirty=!0,t.destroyed){const s=this.resources;for(const i in s)s[i]===t&&(s[i]=null)}else this._updateKey()}}var Mo=(e=>(e[e.WEBGL=1]="WEBGL",e[e.WEBGPU=2]="WEBGPU",e[e.BOTH=3]="BOTH",e))(Mo||{});class qr extends ls{constructor(t){super(),this._uniformBindMap=Object.create(null),this._ownedBindGroups=[];let{gpuProgram:s,glProgram:i,groups:r,resources:n,compatibleRenderers:o,groupMap:a}=t;this.gpuProgram=s,this.glProgram=i,o===void 0&&(o=0,s&&(o|=Mo.WEBGPU),i&&(o|=Mo.WEBGL)),this.compatibleRenderers=o;const l={};if(!n&&!r&&(n={}),n&&r)throw new Error("[Shader] Cannot have both resources and groups");if(!s&&r&&!a)throw new Error("[Shader] No group map or WebGPU shader provided - consider using resources instead.");if(!s&&r&&a)for(const h in a)for(const c in a[h]){const u=a[h][c];l[u]={group:h,binding:c,name:u}}else if(s&&r&&!a){const h=s.structsAndGroups.groups;a={},h.forEach(c=>{a[c.group]=a[c.group]||{},a[c.group][c.binding]=c.name,l[c.name]=c})}else if(n){r={},a={},s&&s.structsAndGroups.groups.forEach(u=>{a[u.group]=a[u.group]||{},a[u.group][u.binding]=u.name,l[u.name]=u});let h=0;for(const c in n)l[c]||(r[99]||(r[99]=new wr,this._ownedBindGroups.push(r[99])),l[c]={group:99,binding:h,name:c},a[99]=a[99]||{},a[99][h]=c,h++);for(const c in n){const u=c;let f=n[c];!f.source&&!f._resourceType&&(f=new da(f));const m=l[u];m&&(r[m.group]||(r[m.group]=new wr,this._ownedBindGroups.push(r[m.group])),r[m.group].setResource(f,m.binding))}}this.groups=r,this._uniformBindMap=a,this.resources=this._buildResourceAccessor(r,l)}addResource(t,s,i){var r,n;(r=this._uniformBindMap)[s]||(r[s]={}),(n=this._uniformBindMap[s])[i]||(n[i]=t),this.groups[s]||(this.groups[s]=new wr,this._ownedBindGroups.push(this.groups[s]))}_buildResourceAccessor(t,s){const i={};for(const r in s){const n=s[r];Object.defineProperty(i,n.name,{get(){return t[n.group].getResource(n.binding)},set(o){t[n.group].setResource(o,n.binding)}})}return i}destroy(t=!1){var s,i;this.emit("destroy",this),t&&((s=this.gpuProgram)==null||s.destroy(),(i=this.glProgram)==null||i.destroy()),this.gpuProgram=null,this.glProgram=null,this.removeAllListeners(),this._uniformBindMap=null,this._ownedBindGroups.forEach(r=>{r.destroy()}),this._ownedBindGroups=null,this.resources=null,this.groups=null}static from(t){const{gpu:s,gl:i,...r}=t;let n,o;return s&&(n=li.from(s)),i&&(o=Xr.from(i)),new qr({gpuProgram:n,glProgram:o,...r})}}const Vg={normal:0,add:1,multiply:2,screen:3,overlay:4,erase:5,"normal-npm":6,"add-npm":7,"screen-npm":8,min:9,max:10},jn=0,Yn=1,Wn=2,Xn=3,qn=4,Kn=5,Ao=class _u{constructor(){this.data=0,this.blendMode="normal",this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(this.data&1<80*s){a=h=e[0],l=c=e[1];for(var d=s;dh&&(h=u),f>c&&(c=f);m=Math.max(h-a,c-l),m=m!==0?32767/m:0}return Gi(n,o,s,a,l,m,0),o}function vu(e,t,s,i,r){var n,o;if(r===Io(e,t,s,i)>0)for(n=t;n=t;n-=i)o=$l(n,e[n],e[n+1],o);return o&&Zr(o,o.next)&&(Hi(o),o=o.next),o}function Gs(e,t){if(!e)return e;t||(t=e);var s=e,i;do if(i=!1,!s.steiner&&(Zr(s,s.next)||Vt(s.prev,s,s.next)===0)){if(Hi(s),s=t=s.prev,s===s.next)break;i=!0}else s=s.next;while(i||s!==t);return t}function Gi(e,t,s,i,r,n,o){if(e){!o&&n&&t0(e,i,r,n);for(var a=e,l,h;e.prev!==e.next;){if(l=e.prev,h=e.next,n?Yg(e,i,r,n):jg(e)){t.push(l.i/s|0),t.push(e.i/s|0),t.push(h.i/s|0),Hi(e),e=h.next,a=h.next;continue}if(e=h,e===a){o?o===1?(e=Wg(Gs(e),t,s),Gi(e,t,s,i,r,n,2)):o===2&&Xg(e,t,s,i,r,n):Gi(Gs(e),t,s,i,r,n,1);break}}}}function jg(e){var t=e.prev,s=e,i=e.next;if(Vt(t,s,i)>=0)return!1;for(var r=t.x,n=s.x,o=i.x,a=t.y,l=s.y,h=i.y,c=rn?r>o?r:o:n>o?n:o,m=a>l?a>h?a:h:l>h?l:h,d=i.next;d!==t;){if(d.x>=c&&d.x<=f&&d.y>=u&&d.y<=m&&Zs(r,a,n,l,o,h,d.x,d.y)&&Vt(d.prev,d,d.next)>=0)return!1;d=d.next}return!0}function Yg(e,t,s,i){var r=e.prev,n=e,o=e.next;if(Vt(r,n,o)>=0)return!1;for(var a=r.x,l=n.x,h=o.x,c=r.y,u=n.y,f=o.y,m=al?a>h?a:h:l>h?l:h,g=c>u?c>f?c:f:u>f?u:f,v=Eo(m,d,t,s,i),w=Eo(y,g,t,s,i),A=e.prevZ,M=e.nextZ;A&&A.z>=v&&M&&M.z<=w;){if(A.x>=m&&A.x<=y&&A.y>=d&&A.y<=g&&A!==r&&A!==o&&Zs(a,c,l,u,h,f,A.x,A.y)&&Vt(A.prev,A,A.next)>=0||(A=A.prevZ,M.x>=m&&M.x<=y&&M.y>=d&&M.y<=g&&M!==r&&M!==o&&Zs(a,c,l,u,h,f,M.x,M.y)&&Vt(M.prev,M,M.next)>=0))return!1;M=M.nextZ}for(;A&&A.z>=v;){if(A.x>=m&&A.x<=y&&A.y>=d&&A.y<=g&&A!==r&&A!==o&&Zs(a,c,l,u,h,f,A.x,A.y)&&Vt(A.prev,A,A.next)>=0)return!1;A=A.prevZ}for(;M&&M.z<=w;){if(M.x>=m&&M.x<=y&&M.y>=d&&M.y<=g&&M!==r&&M!==o&&Zs(a,c,l,u,h,f,M.x,M.y)&&Vt(M.prev,M,M.next)>=0)return!1;M=M.nextZ}return!0}function Wg(e,t,s){var i=e;do{var r=i.prev,n=i.next.next;!Zr(r,n)&&wu(r,i,i.next,n)&&$i(r,n)&&$i(n,r)&&(t.push(r.i/s|0),t.push(i.i/s|0),t.push(n.i/s|0),Hi(i),Hi(i.next),i=e=n),i=i.next}while(i!==e);return Gs(i)}function Xg(e,t,s,i,r,n){var o=e;do{for(var a=o.next.next;a!==o.prev;){if(o.i!==a.i&&i0(o,a)){var l=Su(o,a);o=Gs(o,o.next),l=Gs(l,l.next),Gi(o,t,s,i,r,n,0),Gi(l,t,s,i,r,n,0);return}a=a.next}o=o.next}while(o!==e)}function qg(e,t,s,i){var r=[],n,o,a,l,h;for(n=0,o=t.length;n=s.next.y&&s.next.y!==s.y){var a=s.x+(r-s.y)*(s.next.x-s.x)/(s.next.y-s.y);if(a<=i&&a>n&&(n=a,o=s.x=s.x&&s.x>=h&&i!==s.x&&Zs(ro.x||s.x===o.x&&Jg(o,s)))&&(o=s,u=f)),s=s.next;while(s!==l);return o}function Jg(e,t){return Vt(e.prev,e,t.prev)<0&&Vt(t.next,e,e.next)<0}function t0(e,t,s,i){var r=e;do r.z===0&&(r.z=Eo(r.x,r.y,t,s,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==e);r.prevZ.nextZ=null,r.prevZ=null,e0(r)}function e0(e){var t,s,i,r,n,o,a,l,h=1;do{for(s=e,e=null,n=null,o=0;s;){for(o++,i=s,a=0,t=0;t0||l>0&&i;)a!==0&&(l===0||!i||s.z<=i.z)?(r=s,s=s.nextZ,a--):(r=i,i=i.nextZ,l--),n?n.nextZ=r:e=r,r.prevZ=n,n=r;s=i}n.nextZ=null,h*=2}while(o>1);return e}function Eo(e,t,s,i,r){return e=(e-s)*r|0,t=(t-i)*r|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function s0(e){var t=e,s=e;do(t.x=(e-o)*(n-a)&&(e-o)*(i-a)>=(s-o)*(t-a)&&(s-o)*(n-a)>=(r-o)*(i-a)}function i0(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!r0(e,t)&&($i(e,t)&&$i(t,e)&&n0(e,t)&&(Vt(e.prev,e,t.prev)||Vt(e,t.prev,t))||Zr(e,t)&&Vt(e.prev,e,e.next)>0&&Vt(t.prev,t,t.next)>0)}function Vt(e,t,s){return(t.y-e.y)*(s.x-t.x)-(t.x-e.x)*(s.y-t.y)}function Zr(e,t){return e.x===t.x&&e.y===t.y}function wu(e,t,s,i){var r=fr(Vt(e,t,s)),n=fr(Vt(e,t,i)),o=fr(Vt(s,i,e)),a=fr(Vt(s,i,t));return!!(r!==n&&o!==a||r===0&&ur(e,s,t)||n===0&&ur(e,i,t)||o===0&&ur(s,e,i)||a===0&&ur(s,t,i))}function ur(e,t,s){return t.x<=Math.max(e.x,s.x)&&t.x>=Math.min(e.x,s.x)&&t.y<=Math.max(e.y,s.y)&&t.y>=Math.min(e.y,s.y)}function fr(e){return e>0?1:e<0?-1:0}function r0(e,t){var s=e;do{if(s.i!==e.i&&s.next.i!==e.i&&s.i!==t.i&&s.next.i!==t.i&&wu(s,s.next,e,t))return!0;s=s.next}while(s!==e);return!1}function $i(e,t){return Vt(e.prev,e,e.next)<0?Vt(e,t,e.next)>=0&&Vt(e,e.prev,t)>=0:Vt(e,t,e.prev)<0||Vt(e,e.next,t)<0}function n0(e,t){var s=e,i=!1,r=(e.x+t.x)/2,n=(e.y+t.y)/2;do s.y>n!=s.next.y>n&&s.next.y!==s.y&&r<(s.next.x-s.x)*(n-s.y)/(s.next.y-s.y)+s.x&&(i=!i),s=s.next;while(s!==e);return i}function Su(e,t){var s=new ko(e.i,e.x,e.y),i=new ko(t.i,t.x,t.y),r=e.next,n=t.prev;return e.next=t,t.prev=e,s.next=r,r.prev=s,i.next=s,s.prev=i,n.next=i,i.prev=n,i}function $l(e,t,s,i){var r=new ko(e,t,s);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function Hi(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function ko(e,t,s){this.i=e,this.x=t,this.y=s,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}Kr.deviation=function(e,t,s,i){var r=t&&t.length,n=r?t[0]*s:e.length,o=Math.abs(Io(e,0,n,s));if(r)for(var a=0,l=t.length;a0&&(i+=e[r-1].length,s.holes.push(i))}return s};var o0=pa.exports;const a0=la(o0);var Cu=(e=>(e[e.NONE=0]="NONE",e[e.COLOR=16384]="COLOR",e[e.STENCIL=1024]="STENCIL",e[e.DEPTH=256]="DEPTH",e[e.COLOR_DEPTH=16640]="COLOR_DEPTH",e[e.COLOR_STENCIL=17408]="COLOR_STENCIL",e[e.DEPTH_STENCIL=1280]="DEPTH_STENCIL",e[e.ALL=17664]="ALL",e))(Cu||{});class l0{constructor(t){this.items=[],this._name=t}emit(t,s,i,r,n,o,a,l){const{name:h,items:c}=this;for(let u=0,f=c.length;u{this.runners[s]=new l0(s)})}_addSystems(t){let s;for(s in t){const i=t[s];this._addSystem(i.value,i.name)}}_addSystem(t,s){const i=new t(this);if(this[s])throw new Error(`Whoops! The name "${s}" is already in use`);this[s]=i,this._systemsHash[s]=i;for(const r in this.runners)this.runners[r].add(i);return this}_addPipes(t,s){const i=s.reduce((r,n)=>(r[n.name]=n.value,r),{});t.forEach(r=>{const n=r.value,o=r.name,a=i[o];this.renderPipes[o]=new n(this,a?new a:null)})}destroy(t=!1){this.runners.destroy.items.reverse(),this.runners.destroy.emit(t),Object.values(this.runners).forEach(s=>{s.destroy()}),this._systemsHash=null,this.renderPipes=null}generateTexture(t){return this.textureGenerator.generateTexture(t)}get roundPixels(){return!!this._roundPixels}_unsafeEvalCheck(){if(!zg())throw new Error("Current environment does not allow unsafe-eval, please use pixi.js/unsafe-eval module to enable support.")}};Mu.defaultOptions={resolution:1,failIfMajorPerformanceCaveat:!1,roundPixels:!1};let Pu=Mu,dr;function h0(e){return dr!==void 0||(dr=(()=>{var s;const t={stencil:!0,failIfMajorPerformanceCaveat:e??Pu.defaultOptions.failIfMajorPerformanceCaveat};try{if(!bs.get().getWebGLRenderingContext())return!1;let r=bs.get().createCanvas().getContext("webgl",t);const n=!!((s=r==null?void 0:r.getContextAttributes())!=null&&s.stencil);if(r){const o=r.getExtension("WEBGL_lose_context");o&&o.loseContext()}return r=null,n}catch{return!1}})()),dr}let pr;async function u0(e={}){return pr!==void 0||(pr=await(async()=>{const t=bs.get().getNavigator().gpu;if(!t)return!1;try{return await(await t.requestAdapter(e)).requestDevice(),!0}catch{return!1}})()),pr}const Hl=["webgl","webgpu","canvas"];async function f0(e){let t=[];e.preference?(t.push(e.preference),Hl.forEach(n=>{n!==e.preference&&t.push(n)})):t=Hl.slice();let s,i={};for(let n=0;n{const{WebGPURenderer:l}=await import("./WebGPURenderer-CMHfAOBn.js");return{WebGPURenderer:l}},__vite__mapDeps([4,2,5,3]));s=a,i={...e,...e.webgpu};break}else if(o==="webgl"&&h0(e.failIfMajorPerformanceCaveat??Pu.defaultOptions.failIfMajorPerformanceCaveat)){const{WebGLRenderer:a}=await Fr(async()=>{const{WebGLRenderer:l}=await import("./WebGLRenderer-oW2arDOf.js");return{WebGLRenderer:l}},__vite__mapDeps([6,2,5]));s=a,i={...e,...e.webgl};break}else if(o==="canvas")throw i={...e},new Error("CanvasRenderer is not yet implemented")}if(delete i.webgpu,delete i.webgl,!s)throw new Error("No available renderer for the current environment");const r=new s;return await r.init(i),r}const Tu="8.5.1";class Eu{static init(){var t;(t=globalThis.__PIXI_APP_INIT__)==null||t.call(globalThis,this,Tu)}static destroy(){}}Eu.extension=Tt.Application;class d0{constructor(t){this._renderer=t}init(){var t;(t=globalThis.__PIXI_RENDERER_INIT__)==null||t.call(globalThis,this._renderer,Tu)}destroy(){this._renderer=null}}d0.extension={type:[Tt.WebGLSystem,Tt.WebGPUSystem],name:"initHook",priority:-10};const ku=class Ro{constructor(...t){this.stage=new oe,t[0]!==void 0&&Xt(Zt,"Application constructor options are deprecated, please use Application.init() instead.")}async init(t){t={...t},this.renderer=await f0(t),Ro._plugins.forEach(s=>{s.init.call(this,t)})}render(){this.renderer.render({container:this.stage})}get canvas(){return this.renderer.canvas}get view(){return Xt(Zt,"Application.view is deprecated, please use Application.canvas instead."),this.renderer.canvas}get screen(){return this.renderer.screen}destroy(t=!1,s=!1){const i=Ro._plugins.slice(0);i.reverse(),i.forEach(r=>{r.destroy.call(this)}),this.stage.destroy(s),this.stage=null,this.renderer.destroy(t),this.renderer=null}};ku._plugins=[];let Iu=ku;Xe.handleByList(Tt.Application,Iu._plugins);Xe.add(Eu);const Ru=class Fo{constructor(t,s,i,r){this.uid=Qt("fillGradient"),this.type="linear",this.gradientStops=[],this._styleKey=null,this.x0=t,this.y0=s,this.x1=i,this.y1=r}addColorStop(t,s){return this.gradientStops.push({offset:t,color:ge.shared.setValue(s).toHexa()}),this._styleKey=null,this}buildLinearGradient(){const t=Fo.defaultTextureSize,{gradientStops:s}=this,i=bs.get().createCanvas();i.width=t,i.height=t;const r=i.getContext("2d"),n=r.createLinearGradient(0,0,Fo.defaultTextureSize,1);for(let y=0;y`${r.offset}-${r.color}`).join("-"),s=this.texture.uid,i=this.transform.toArray().join("-");return`fill-gradient-${this.uid}-${t}-${s}-${i}-${this.x0}-${this.y0}-${this.x1}-${this.y1}`}};Ru.defaultTextureSize=256;let p0=Ru;const zl={repeat:{addressModeU:"repeat",addressModeV:"repeat"},"repeat-x":{addressModeU:"repeat",addressModeV:"clamp-to-edge"},"repeat-y":{addressModeU:"clamp-to-edge",addressModeV:"repeat"},"no-repeat":{addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"}};class m0{constructor(t,s){this.uid=Qt("fillPattern"),this.transform=new Pt,this._styleKey=null,this.texture=t,this.transform.scale(1/t.frame.width,1/t.frame.height),s&&(t.source.style.addressModeU=zl[s].addressModeU,t.source.style.addressModeV=zl[s].addressModeV)}setTransform(t){const s=this.texture;this.transform.copyFrom(t),this.transform.invert(),this.transform.scale(1/s.frame.width,1/s.frame.height),this._styleKey=null}get styleKey(){return this._styleKey?this._styleKey:(this._styleKey=`fill-pattern-${this.uid}-${this.texture.uid}-${this.transform.toArray().join("-")}`,this._styleKey)}}var g0=x0,Zn={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},y0=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function x0(e){var t=[];return e.replace(y0,function(s,i,r){var n=i.toLowerCase();for(r=b0(r),n=="m"&&r.length>2&&(t.push([i].concat(r.splice(0,2))),n="l",i=i=="m"?"l":"L");;){if(r.length==Zn[n])return r.unshift(i),t.push(r);if(r.length0&&(r=i.pop(),r?(n=r.startX,o=r.startY):(n=0,o=0)),r=null;break;default:je(`Unknown SVG path command: ${h}`)}h!=="Z"&&h!=="z"&&r===null&&(r={startX:n,startY:o},i.push(r))}return t}class ma{constructor(t=0,s=0,i=0){this.type="circle",this.x=t,this.y=s,this.radius=i}clone(){return new ma(this.x,this.y,this.radius)}contains(t,s){if(this.radius<=0)return!1;const i=this.radius*this.radius;let r=this.x-t,n=this.y-s;return r*=r,n*=n,r+n<=i}strokeContains(t,s,i){if(this.radius===0)return!1;const r=this.x-t,n=this.y-s,o=this.radius,a=i/2,l=Math.sqrt(r*r+n*n);return lo-a}getBounds(t){return t=t||new ne,t.x=this.x-this.radius,t.y=this.y-this.radius,t.width=this.radius*2,t.height=this.radius*2,t}copyFrom(t){return this.x=t.x,this.y=t.y,this.radius=t.radius,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`}}class ga{constructor(t=0,s=0,i=0,r=0){this.type="ellipse",this.x=t,this.y=s,this.halfWidth=i,this.halfHeight=r}clone(){return new ga(this.x,this.y,this.halfWidth,this.halfHeight)}contains(t,s){if(this.halfWidth<=0||this.halfHeight<=0)return!1;let i=(t-this.x)/this.halfWidth,r=(s-this.y)/this.halfHeight;return i*=i,r*=r,i+r<=1}strokeContains(t,s,i){const{halfWidth:r,halfHeight:n}=this;if(r<=0||n<=0)return!1;const o=i/2,a=r-o,l=n-o,h=r+o,c=n+o,u=t-this.x,f=s-this.y,m=u*u/(a*a)+f*f/(l*l),d=u*u/(h*h)+f*f/(c*c);return m>1&&d<=1}getBounds(t){return t=t||new ne,t.x=this.x-this.halfWidth,t.y=this.y-this.halfHeight,t.width=this.halfWidth*2,t.height=this.halfHeight*2,t}copyFrom(t){return this.x=t.x,this.y=t.y,this.halfWidth=t.halfWidth,this.halfHeight=t.halfHeight,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:Ellipse x=${this.x} y=${this.y} halfWidth=${this.halfWidth} halfHeight=${this.halfHeight}]`}}function S0(e,t,s,i,r,n){const o=e-s,a=t-i,l=r-s,h=n-i,c=o*l+a*h,u=l*l+h*h;let f=-1;u!==0&&(f=c/u);let m,d;f<0?(m=s,d=i):f>1?(m=r,d=n):(m=s+f*l,d=i+f*h);const y=e-m,g=t-d;return y*y+g*g}class ki{constructor(...t){this.type="polygon";let s=Array.isArray(t[0])?t[0]:t;if(typeof s[0]!="number"){const i=[];for(let r=0,n=s.length;rs!=c>s&&t<(h-a)*((s-l)/(c-l))+a&&(i=!i)}return i}strokeContains(t,s,i){const r=i/2,n=r*r,{points:o}=this,a=o.length-(this.closePath?0:2);for(let l=0;lr?h:r,n=co?c:o}return t.x=i,t.width=r-i,t.y=n,t.height=o-n,t}copyFrom(t){return this.points=t.points.slice(),this.closePath=t.closePath,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:PolygoncloseStroke=${this.closePath}points=${this.points.reduce((t,s)=>`${t}, ${s}`,"")}]`}get lastX(){return this.points[this.points.length-2]}get lastY(){return this.points[this.points.length-1]}get x(){return this.points[this.points.length-2]}get y(){return this.points[this.points.length-1]}}const mr=(e,t,s,i,r,n)=>{const o=e-s,a=t-i,l=Math.sqrt(o*o+a*a);return l>=r-n&&l<=r+n};class ya{constructor(t=0,s=0,i=0,r=0,n=20){this.type="roundedRectangle",this.x=t,this.y=s,this.width=i,this.height=r,this.radius=n}getBounds(t){return t=t||new ne,t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t}clone(){return new ya(this.x,this.y,this.width,this.height,this.radius)}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.copyFrom(this),t}contains(t,s){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&s>=this.y&&s<=this.y+this.height){const i=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(s>=this.y+i&&s<=this.y+this.height-i||t>=this.x+i&&t<=this.x+this.width-i)return!0;let r=t-(this.x+i),n=s-(this.y+i);const o=i*i;if(r*r+n*n<=o||(r=t-(this.x+this.width-i),r*r+n*n<=o)||(n=s-(this.y+this.height-i),r*r+n*n<=o)||(r=t-(this.x+i),r*r+n*n<=o))return!0}return!1}strokeContains(t,s,i){const{x:r,y:n,width:o,height:a,radius:l}=this,h=i/2,c=r+l,u=n+l,f=o-l*2,m=a-l*2,d=r+o,y=n+a;return(t>=r-h&&t<=r+h||t>=d-h&&t<=d+h)&&s>=u&&s<=u+m||(s>=n-h&&s<=n+h||s>=y-h&&s<=y+h)&&t>=c&&t<=c+f?!0:td-l&&sd-l&&s>y-l&&mr(t,s,d-l,y-l,l,h)||ty-l&&mr(t,s,c,y-l,l,h)}toString(){return`[pixi.js/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`}}const C0=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(` `);function M0(e){let t="";for(let s=0;s0&&(t+=` else `),s>>=0;return Bu[s]||T0(e,t,s)}let Qn=0;function T0(e,t,s){const i={};let r=0;Qn||(Qn=Fu());for(let o=0;o0){const o=new Uint8Array(e,s*8,n);new Uint8Array(t,s*8,n).set(o)}}const E0={normal:"normal-npm",add:"add-npm",screen:"screen-npm"};var k0=(e=>(e[e.DISABLED=0]="DISABLED",e[e.RENDERING_MASK_ADD=1]="RENDERING_MASK_ADD",e[e.MASK_ACTIVE=2]="MASK_ACTIVE",e[e.INVERSE_MASK_ACTIVE=3]="INVERSE_MASK_ACTIVE",e[e.RENDERING_MASK_REMOVE=4]="RENDERING_MASK_REMOVE",e[e.NONE=5]="NONE",e))(k0||{});function Wl(e,t){return t.alphaMode==="no-premultiply-alpha"&&E0[e]||e}class I0{constructor(){this.ids=Object.create(null),this.textures=[],this.count=0}clear(){for(let t=0;t0?Ou[--Bo]:new R0}function ql(e){Ou[Bo++]=e}let pi=0;const Lu=class Sr{constructor(t={}){this.uid=Qt("batcher"),this.dirty=!0,this.batchIndex=0,this.batches=[],this._elements=[],Sr.defaultOptions.maxTextures=Sr.defaultOptions.maxTextures??Fu(),t={...Sr.defaultOptions,...t};const{maxTextures:s,attributesInitialSize:i,indicesInitialSize:r}=t;this.attributeBuffer=new jl(i*4),this.indexBuffer=new Uint16Array(r),this.maxTextures=s}begin(){this.elementSize=0,this.elementStart=0,this.indexSize=0,this.attributeSize=0;for(let t=0;tthis.attributeBuffer.size&&this._resizeAttributeBuffer(this.attributeSize*4),this.indexSize>this.indexBuffer.length&&this._resizeIndexBuffer(this.indexSize);const a=this.attributeBuffer.float32View,l=this.attributeBuffer.uint32View,h=this.indexBuffer;let c=this._batchIndexSize,u=this._batchIndexStart,f="startBatch";const m=this.maxTextures;for(let d=this.elementStart;d=m||A)&&(this._finishBatch(i,u,c-u,r,o,t,f),f="renderBatch",u=c,o=w,i=Xl(),r=i.textures,r.clear(),++pi),y._textureId=v._textureBindLocation=r.count,r.ids[v.uid]=r.count,r.textures[r.count++]=v,y._batch=i,c+=y.indexSize,y.packAsQuad?(this.packQuadAttributes(y,a,l,y._attributeStart,y._textureId),this.packQuadIndex(h,y._indexStart,y._attributeStart/this.vertexSize)):(this.packAttributes(y,a,l,y._attributeStart,y._textureId),this.packIndex(y,h,y._indexStart,y._attributeStart/this.vertexSize))}r.count>0&&(this._finishBatch(i,u,c-u,r,o,t,f),u=c,++pi),this.elementStart=this.elementSize,this._batchIndexStart=u,this._batchIndexSize=c}_finishBatch(t,s,i,r,n,o,a){t.gpuBindGroup=null,t.bindGroup=null,t.action=a,t.batcher=this,t.textures=r,t.blendMode=n,t.start=s,t.size=i,++pi,this.batches[this.batchIndex++]=t,o.add(t)}finish(t){this.break(t)}ensureAttributeBuffer(t){t*4<=this.attributeBuffer.size||this._resizeAttributeBuffer(t*4)}ensureIndexBuffer(t){t<=this.indexBuffer.length||this._resizeIndexBuffer(t)}_resizeAttributeBuffer(t){const s=Math.max(t,this.attributeBuffer.size*2),i=new jl(s);Yl(this.attributeBuffer.rawBinaryData,i.rawBinaryData),this.attributeBuffer=i}_resizeIndexBuffer(t){const s=this.indexBuffer;let i=Math.max(t,s.length*1.5);i+=i%2;const r=i>65535?new Uint32Array(i):new Uint16Array(i);if(r.BYTES_PER_ELEMENT!==s.BYTES_PER_ELEMENT)for(let n=0;n(e[e.MAP_READ=1]="MAP_READ",e[e.MAP_WRITE=2]="MAP_WRITE",e[e.COPY_SRC=4]="COPY_SRC",e[e.COPY_DST=8]="COPY_DST",e[e.INDEX=16]="INDEX",e[e.VERTEX=32]="VERTEX",e[e.UNIFORM=64]="UNIFORM",e[e.STORAGE=128]="STORAGE",e[e.INDIRECT=256]="INDIRECT",e[e.QUERY_RESOLVE=512]="QUERY_RESOLVE",e[e.STATIC=1024]="STATIC",e))(_e||{});class zi extends ls{constructor(t){let{data:s,size:i}=t;const{usage:r,label:n,shrinkToFit:o}=t;super(),this.uid=Qt("buffer"),this._resourceType="buffer",this._resourceId=Qt("resource"),this._touched=0,this._updateID=1,this.shrinkToFit=!0,this.destroyed=!1,s instanceof Array&&(s=new Float32Array(s)),this._data=s,i=i??(s==null?void 0:s.byteLength);const a=!!s;this.descriptor={size:i,usage:r,mappedAtCreation:a,label:n},this.shrinkToFit=o??!0}get data(){return this._data}set data(t){this.setDataWithSize(t,t.length,!0)}get static(){return!!(this.descriptor.usage&_e.STATIC)}set static(t){t?this.descriptor.usage|=_e.STATIC:this.descriptor.usage&=~_e.STATIC}setDataWithSize(t,s,i){if(this._updateID++,this._updateSize=s*t.BYTES_PER_ELEMENT,this._data===t){i&&this.emit("update",this);return}const r=this._data;if(this._data=t,r.length!==t.length){!this.shrinkToFit&&t.byteLengtha&&(a=m),d>l&&(l=d),ms.destroy()),this.attributes=null,this.buffers=null,this.indexBuffer=null,this._bounds=null}}const N0=new Float32Array(1),D0=new Uint32Array(1);class U0 extends L0{constructor(){const s=new zi({data:N0,label:"attribute-batch-buffer",usage:_e.VERTEX|_e.COPY_DST,shrinkToFit:!1}),i=new zi({data:D0,label:"index-batch-buffer",usage:_e.INDEX|_e.COPY_DST,shrinkToFit:!1}),r=6*4;super({attributes:{aPosition:{buffer:s,format:"float32x2",stride:r,offset:0},aUV:{buffer:s,format:"float32x2",stride:r,offset:2*4},aColor:{buffer:s,format:"unorm8x4",stride:r,offset:4*4},aTextureIdAndRound:{buffer:s,format:"uint16x2",stride:r,offset:5*4}},indexBuffer:i})}}function Kl(e,t,s){if(e)for(const i in e){const r=i.toLocaleLowerCase(),n=t[r];if(n){let o=e[i];i==="header"&&(o=o.replace(/@in\s+[^;]+;\s*/g,"").replace(/@out\s+[^;]+;\s*/g,"")),s&&n.push(`//----${s}----//`),n.push(o)}else je(`${i} placement hook does not exist in shader`)}}const V0=/\{\{(.*?)\}\}/g;function Zl(e){var i;const t={};return(((i=e.match(V0))==null?void 0:i.map(r=>r.replace(/[{()}]/g,"")))??[]).forEach(r=>{t[r]=[]}),t}function Ql(e,t){let s;const i=/@in\s+([^;]+);/g;for(;(s=i.exec(e))!==null;)t.push(s[1])}function Jl(e,t,s=!1){const i=[];Ql(t,i),e.forEach(a=>{a.header&&Ql(a.header,i)});const r=i;s&&r.sort();const n=r.map((a,l)=>` @location(${l}) ${a},`).join(` `);let o=t.replace(/@in\s+[^;]+;\s*/g,"");return o=o.replace("{{in}}",` @@ -518,4 +518,4 @@ fn mainFragment( rgb.b *= result.a; return vec4(rgb, result.a); -}`;class ix extends $g{constructor(t={}){const s=new da({uColorMatrix:{value:[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],type:"f32",size:20},uAlpha:{value:1,type:"f32"}}),i=li.from({vertex:{source:pc,entryPoint:"mainVertex"},fragment:{source:pc,entryPoint:"mainFragment"}}),r=Xr.from({vertex:ex,fragment:sx,name:"color-matrix-filter"});super({...t,gpuProgram:i,glProgram:r,resources:{colorMatrixUniforms:s}}),this.alpha=1}_loadMatrix(t,s=!1){let i=t;s&&(this._multiply(i,this.matrix,t),i=this._colorMatrix(i)),this.resources.colorMatrixUniforms.uniforms.uColorMatrix=i,this.resources.colorMatrixUniforms.update()}_multiply(t,s,i){return t[0]=s[0]*i[0]+s[1]*i[5]+s[2]*i[10]+s[3]*i[15],t[1]=s[0]*i[1]+s[1]*i[6]+s[2]*i[11]+s[3]*i[16],t[2]=s[0]*i[2]+s[1]*i[7]+s[2]*i[12]+s[3]*i[17],t[3]=s[0]*i[3]+s[1]*i[8]+s[2]*i[13]+s[3]*i[18],t[4]=s[0]*i[4]+s[1]*i[9]+s[2]*i[14]+s[3]*i[19]+s[4],t[5]=s[5]*i[0]+s[6]*i[5]+s[7]*i[10]+s[8]*i[15],t[6]=s[5]*i[1]+s[6]*i[6]+s[7]*i[11]+s[8]*i[16],t[7]=s[5]*i[2]+s[6]*i[7]+s[7]*i[12]+s[8]*i[17],t[8]=s[5]*i[3]+s[6]*i[8]+s[7]*i[13]+s[8]*i[18],t[9]=s[5]*i[4]+s[6]*i[9]+s[7]*i[14]+s[8]*i[19]+s[9],t[10]=s[10]*i[0]+s[11]*i[5]+s[12]*i[10]+s[13]*i[15],t[11]=s[10]*i[1]+s[11]*i[6]+s[12]*i[11]+s[13]*i[16],t[12]=s[10]*i[2]+s[11]*i[7]+s[12]*i[12]+s[13]*i[17],t[13]=s[10]*i[3]+s[11]*i[8]+s[12]*i[13]+s[13]*i[18],t[14]=s[10]*i[4]+s[11]*i[9]+s[12]*i[14]+s[13]*i[19]+s[14],t[15]=s[15]*i[0]+s[16]*i[5]+s[17]*i[10]+s[18]*i[15],t[16]=s[15]*i[1]+s[16]*i[6]+s[17]*i[11]+s[18]*i[16],t[17]=s[15]*i[2]+s[16]*i[7]+s[17]*i[12]+s[18]*i[17],t[18]=s[15]*i[3]+s[16]*i[8]+s[17]*i[13]+s[18]*i[18],t[19]=s[15]*i[4]+s[16]*i[9]+s[17]*i[14]+s[18]*i[19]+s[19],t}_colorMatrix(t){const s=new Float32Array(t);return s[4]/=255,s[9]/=255,s[14]/=255,s[19]/=255,s}brightness(t,s){const i=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0];this._loadMatrix(i,s)}tint(t,s){const[i,r,n]=ge.shared.setValue(t).toArray(),o=[i,0,0,0,0,0,r,0,0,0,0,0,n,0,0,0,0,0,1,0];this._loadMatrix(o,s)}greyscale(t,s){const i=[t,t,t,0,0,t,t,t,0,0,t,t,t,0,0,0,0,0,1,0];this._loadMatrix(i,s)}grayscale(t,s){this.greyscale(t,s)}blackAndWhite(t){const s=[.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0];this._loadMatrix(s,t)}hue(t,s){t=(t||0)/180*Math.PI;const i=Math.cos(t),r=Math.sin(t),n=Math.sqrt,o=1/3,a=n(o),l=i+(1-i)*o,h=o*(1-i)-a*r,c=o*(1-i)+a*r,u=o*(1-i)+a*r,f=i+o*(1-i),m=o*(1-i)-a*r,d=o*(1-i)-a*r,y=o*(1-i)+a*r,g=i+o*(1-i),v=[l,h,c,0,0,u,f,m,0,0,d,y,g,0,0,0,0,0,1,0];this._loadMatrix(v,s)}contrast(t,s){const i=(t||0)+1,r=-.5*(i-1),n=[i,0,0,0,r,0,i,0,0,r,0,0,i,0,r,0,0,0,1,0];this._loadMatrix(n,s)}saturate(t=0,s){const i=t*2/3+1,r=(i-1)*-.5,n=[i,r,r,0,0,r,i,r,0,0,r,r,i,0,0,0,0,0,1,0];this._loadMatrix(n,s)}desaturate(){this.saturate(-1)}negative(t){const s=[-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0];this._loadMatrix(s,t)}sepia(t){const s=[.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0];this._loadMatrix(s,t)}technicolor(t){const s=[1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0];this._loadMatrix(s,t)}polaroid(t){const s=[1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0];this._loadMatrix(s,t)}toBGR(t){const s=[0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0];this._loadMatrix(s,t)}kodachrome(t){const s=[1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0];this._loadMatrix(s,t)}browni(t){const s=[.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0];this._loadMatrix(s,t)}vintage(t){const s=[.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0];this._loadMatrix(s,t)}colorTone(t,s,i,r,n){t=t||.2,s=s||.15,i=i||16770432,r=r||3375104;const o=ge.shared,[a,l,h]=o.setValue(i).toArray(),[c,u,f]=o.setValue(r).toArray(),m=[.3,.59,.11,0,0,a,l,h,t,0,c,u,f,s,0,a-c,l-u,h-f,0,0];this._loadMatrix(m,n)}night(t,s){t=t||.1;const i=[t*-2,-t,0,0,0,-t,0,t,0,0,0,t,t*2,0,0,0,0,0,1,0];this._loadMatrix(i,s)}predator(t,s){const i=[11.224130630493164*t,-4.794486999511719*t,-2.8746118545532227*t,0*t,.40342438220977783*t,-3.6330697536468506*t,9.193157196044922*t,-2.951810836791992*t,0*t,-1.316135048866272*t,-3.2184197902679443*t,-4.2375030517578125*t,7.476448059082031*t,0*t,.8044459223747253*t,0,0,0,1,0];this._loadMatrix(i,s)}lsd(t){const s=[2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0];this._loadMatrix(s,t)}reset(){const t=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0];this._loadMatrix(t,!1)}get matrix(){return this.resources.colorMatrixUniforms.uniforms.uColorMatrix}set matrix(t){this.resources.colorMatrixUniforms.uniforms.uColorMatrix=t}get alpha(){return this.resources.colorMatrixUniforms.uniforms.uAlpha}set alpha(t){this.resources.colorMatrixUniforms.uniforms.uAlpha=t}}class We extends Qh{constructor(t){t instanceof gi&&(t={context:t});const{context:s,roundPixels:i,...r}=t||{};super({label:"Graphics",...r}),this.renderPipeId="graphics",s?this._context=s:this._context=this._ownedContext=new gi,this._context.on("update",this.onViewUpdate,this),this.allowChildren=!1,this.roundPixels=i??!1}set context(t){t!==this._context&&(this._context.off("update",this.onViewUpdate,this),this._context=t,this._context.on("update",this.onViewUpdate,this),this.onViewUpdate())}get context(){return this._context}get bounds(){return this._context.bounds}addBounds(t){t.addBounds(this._context.bounds)}containsPoint(t){return this._context.containsPoint(t)}destroy(t){this._ownedContext&&!t?this._ownedContext.destroy(t):(t===!0||(t==null?void 0:t.context)===!0)&&this._context.destroy(t),this._ownedContext=null,this._context=null,super.destroy(t)}_callContextMethod(t,s){return this.context[t](...s),this}setFillStyle(...t){return this._callContextMethod("setFillStyle",t)}setStrokeStyle(...t){return this._callContextMethod("setStrokeStyle",t)}fill(...t){return this._callContextMethod("fill",t)}stroke(...t){return this._callContextMethod("stroke",t)}texture(...t){return this._callContextMethod("texture",t)}beginPath(){return this._callContextMethod("beginPath",[])}cut(){return this._callContextMethod("cut",[])}arc(...t){return this._callContextMethod("arc",t)}arcTo(...t){return this._callContextMethod("arcTo",t)}arcToSvg(...t){return this._callContextMethod("arcToSvg",t)}bezierCurveTo(...t){return this._callContextMethod("bezierCurveTo",t)}closePath(){return this._callContextMethod("closePath",[])}ellipse(...t){return this._callContextMethod("ellipse",t)}circle(...t){return this._callContextMethod("circle",t)}path(...t){return this._callContextMethod("path",t)}lineTo(...t){return this._callContextMethod("lineTo",t)}moveTo(...t){return this._callContextMethod("moveTo",t)}quadraticCurveTo(...t){return this._callContextMethod("quadraticCurveTo",t)}rect(...t){return this._callContextMethod("rect",t)}roundRect(...t){return this._callContextMethod("roundRect",t)}poly(...t){return this._callContextMethod("poly",t)}regularPoly(...t){return this._callContextMethod("regularPoly",t)}roundPoly(...t){return this._callContextMethod("roundPoly",t)}roundShape(...t){return this._callContextMethod("roundShape",t)}filletRect(...t){return this._callContextMethod("filletRect",t)}chamferRect(...t){return this._callContextMethod("chamferRect",t)}star(...t){return this._callContextMethod("star",t)}svg(...t){return this._callContextMethod("svg",t)}restore(...t){return this._callContextMethod("restore",t)}save(){return this._callContextMethod("save",[])}getTransform(){return this.context.getTransform()}resetTransform(){return this._callContextMethod("resetTransform",[])}rotateTransform(...t){return this._callContextMethod("rotate",t)}scaleTransform(...t){return this._callContextMethod("scale",t)}setTransform(...t){return this._callContextMethod("setTransform",t)}transform(...t){return this._callContextMethod("transform",t)}translateTransform(...t){return this._callContextMethod("translate",t)}clear(){return this._callContextMethod("clear",[])}get fillStyle(){return this._context.fillStyle}set fillStyle(t){this._context.fillStyle=t}get strokeStyle(){return this._context.strokeStyle}set strokeStyle(t){this._context.strokeStyle=t}clone(t=!1){return t?new We(this._context.clone()):(this._ownedContext=null,new We(this._context))}lineStyle(t,s,i){Xt(Zt,"Graphics#lineStyle is no longer needed. Use Graphics#setStrokeStyle to set the stroke style.");const r={};return t&&(r.width=t),s&&(r.color=s),i&&(r.alpha=i),this.context.strokeStyle=r,this}beginFill(t,s){Xt(Zt,"Graphics#beginFill is no longer needed. Use Graphics#fill to fill the shape with the desired style.");const i={};return t&&(i.color=t),s&&(i.alpha=s),this.context.fillStyle=i,this}endFill(){Xt(Zt,"Graphics#endFill is no longer needed. Use Graphics#fill to fill the shape with the desired style."),this.context.fill();const t=this.context.strokeStyle;return(t.width!==gi.defaultStrokeStyle.width||t.color!==gi.defaultStrokeStyle.color||t.alpha!==gi.defaultStrokeStyle.alpha)&&this.context.stroke(),this}drawCircle(...t){return Xt(Zt,"Graphics#drawCircle has been renamed to Graphics#circle"),this._callContextMethod("circle",t)}drawEllipse(...t){return Xt(Zt,"Graphics#drawEllipse has been renamed to Graphics#ellipse"),this._callContextMethod("ellipse",t)}drawPolygon(...t){return Xt(Zt,"Graphics#drawPolygon has been renamed to Graphics#poly"),this._callContextMethod("poly",t)}drawRect(...t){return Xt(Zt,"Graphics#drawRect has been renamed to Graphics#rect"),this._callContextMethod("rect",t)}drawRoundedRect(...t){return Xt(Zt,"Graphics#drawRoundedRect has been renamed to Graphics#roundRect"),this._callContextMethod("roundRect",t)}drawStar(...t){return Xt(Zt,"Graphics#drawStar has been renamed to Graphics#star"),this._callContextMethod("star",t)}}Xe.add(Sm,Cm);class rx{constructor(t,s){this.game=t,this.hover=s}async init(t,s){const i=new Iu;await i.init({resizeTo:t}),t.appendChild(i.canvas);const r=this.game.board[0].length,n=this.game.board.length,o=(i.renderer.width-50)/r,a=(i.renderer.height-50)/n,l=Math.min(o,a),h=i.renderer.width/2-r*l/2,c=i.renderer.height/2-n*l/2,u=new nx(this.game,l,this.hover,h,c);i.stage.addChild(u);const f=new We;f.rect(h,c,l*r,l*n).stroke({color:6316128,width:1}),i.stage.addChild(f);const m=_i.shared;m.autoStart=!1,s.init(u,m)}}class nx extends oe{constructor(s,i,r,n,o){super();Bt(this,"tiles");Bt(this,"players");Bt(this,"lighthouses");Bt(this,"links",new Map);this.game=s,this.tileSize=i,this.position.set(n,o),this.tiles=s.board.map(a=>a.map(l=>{const h=new ax(l,this.tileSize,r);return this.addChild(h),h})),this.players=s.state.players.reduce((a,l)=>{const h=new Do(l,this.tileSize);return this.tiles[l.y][l.x].move(h),a.set(l.id,h),a},new Map),this.lighthouses=s.state.lighthouses.reduce((a,l)=>{const h=new cx(l,this.tileSize);return this.tiles[l.y][l.x].lighthouse=h,a.set(l.id,h),a},new Map)}render(s){s.energy.forEach((r,n)=>r.forEach((o,a)=>{this.tiles[n][a].setEnergy(o)})),s.players.forEach(r=>{const n=this.players.get(r.id);this.tiles[r.y][r.x].move(n)});const i=new Array;s.lighthouses.forEach(r=>{const n=this.lighthouses.get(r.id),o=this.players.get(r.ownerId);n.update(o),r.links.forEach(a=>{if(o===void 0){console.warn("Lighthouse has links but no owner",r);return}const l=ox(r.id,a);i.push(l),this.links.has(l)||this.registerLink(l,r.id,a,o.color)})});for(const[r,n]of this.links)i.includes(r)||(this.removeChild(n),this.links.delete(r));return!0}registerLink(s,i,r,n){if(this.links.get(s))return;const o=this.lighthouses.get(i),a=this.lighthouses.get(r),l=new We;l.moveTo(o.parent.x+this.tileSize/2,o.parent.y+this.tileSize/2),l.lineTo(a.parent.x+this.tileSize/2,a.parent.y+this.tileSize/2),l.stroke({color:n,width:1}),this.addChild(l),this.links.set(s,l)}}const ox=(e,t)=>es instanceof Do);t.sort((s,i)=>s.zIndex-i.zIndex).forEach((s,i)=>{s.position.x=s.parentSize*.5+i*s.size/t.length})}}class Do extends We{constructor(s,i){super();Bt(this,"size");Bt(this,"color");this.parentSize=i,this.size=i*.75,this.color=s?s.color:16777215,this.rect(0,0,this.size,this.size).fill({color:this.color}),this.pivot.set(this.size*.5),this.position.set(this.parentSize*.5);const r=new ix;r.brightness(.7,!0),this.filters=[r]}}class cx extends We{constructor(s,i){super();Bt(this,"ownedBy");const r=i*.4;this.label=`Lighthouse(${s.id})`,this.position.set(i*.5),this.rotation=Math.PI/4,this.pivot.set(r*.5),this.rect(0,0,r,r).fill({color:15790320})}update(s){this.tint=s?s.color:16777215}}class hx extends We{constructor(t){super(),this.label="WaterBackground",this.rect(0,0,t,t).fill({color:0})}}class ux extends We{constructor(s){super();Bt(this,"energy");this.parentSize=s,this.label="IslandBackground",this.energy=0,this.rect(0,0,s,s).fill({color:6316128}),this.setEnergy(0)}setEnergy(s){this.energy=s,this.tint=6316128+Math.round(s*.75)*65793}}class fx extends We{constructor(t){super(),this.label="Marker",this.position.set(t*.5),this.rect(0,0,1,1).fill({color:15790320})}}var Xi=[16711680,5769983,14614282,12454655,716799,5373706,16746240,1342965,720793,16765696];Xi=[16711680,16776960,65280,65535,255,16711935,16711680,16776960,65280,65535];Xi=[16711680,16744448,16776960,32768,255,8388736,16711680,16744448,16776960,32768];Xi=[16734558,16749132,16763450,9095462,1671876,6966419,16734558,16749132,16763450,9095462];Xi=[16711680,16746240,16765696,14614282,10616586,720793,716799,1342965,5769983,12454655,13421772];const dx=e=>Xi[e],px=e=>{let t=e.toString(16);for(;t.length<6;)t="0"+t;return t},mx=e=>pm(gx(e.topology),Uo(e.setup),e.rounds.map(xx),Uo(e.finalStatus)),gx=e=>e.map((t,s)=>t.map((i,r)=>mm(yx(i),0,ba([s,r])))),yx=e=>e?Di.Ground:Di.Water,ba=e=>bm(e[1],e[0]),Uo=e=>Oh(e.energy,e.players.map(qu),e.lighthouses.map(bx)),xx=(e,t)=>{const s=`Round ${t+1}`,i=Uo(e.setup),r=JSON.parse(JSON.stringify(i)),n=e.turns.map(o=>_x(o,r));return xm(s,i,n)},_x=(e,t)=>{const s=qu(e.player),i=`${s.name} turn`,r=t.players.map(o=>o.id===s.id?s:o),n=Oh(t.energy,r,t.lighthouses);return Object.assign(t,n),_m(i,n)},qu=e=>gm(e.id,e.name,e.energy,e.score,e.keys,dx(e.id-1),ba(e.position)),bx=e=>ym(e.id,e.energy,e.ownerId,e.connections,ba(e.position)),Vo=5,vx=Vo*2+1;class wx{constructor(t,s){Bt(this,"started");Bt(this,"title");Bt(this,"subtitle");Bt(this,"energy");Bt(this,"players");Bt(this,"lighthouses");this.board=s,this.started=!1,this.title=t.title,this.subtitle=t.subtitle,this.energy=t.energy,this.players=t.players,this.lighthouses=t.lighthouses}merge(t){this.energy=t.energy,t.players.forEach(s=>{const i=this.players.find(r=>r.id==s.id);i.energy=s.energy,i.score=s.score}),this.lighthouses=t.lighthouses}get scoreboard(){return this.players.sort((t,s)=>s.score-t.score)}hoverInfo(t){return t.x===void 0||t.y===void 0?{show:!1,tile:void 0,lighthouse:void 0,players:[]}:{show:!0,tile:this.tileInfo(t.x,t.y),lighthouse:this.lighthouseInfo(t.x,t.y),players:this.playersInfo(t.x,t.y)}}tileInfo(t,s){return{x:t,y:s,type:this.board[s][t].type,energy:this.energy[s][t]}}lighthouseInfo(t,s){const i=this.lighthouses.find(r=>r.x==t&&r.y==s);if(i)return{id:i.id,energy:i.energy,ownerId:i.ownerId}}playersInfo(t,s){return this.players.filter(i=>i.x===t&&i.y===s).map(i=>({id:i.id,name:i.name,keys:i.keys}))}}const yr=(e,t,s)=>({title:e,subtitle:t,energy:s.energy,players:s.players,lighthouses:s.lighthouses});class Sx{constructor(t,s){Bt(this,"tick");Bt(this,"cursor");Bt(this,"frames");Bt(this,"forward",!0);Bt(this,"tileset");Bt(this,"ticker");Bt(this,"status");this.game=t,this.speed=s,this.tick=this.speed,this.cursor=0,this.frames=[yr("Game Start","",this.game.state),...this.game.rounds.flatMap(i=>[yr(i.name,"Start",i.state),...i.turns.map(r=>yr(i.name,r.name,r.state))]),yr("Game End","",this.game.finalState)],this.status=Ls(new wx(this.frames[0],this.game.board))}init(t,s){this.tileset=t,this.ticker=s,this.ticker.add(()=>{var i;this.status.value.started=!0,!(--this.tick>0)&&(this.tick=vx-this.speed*2,this.next()||((i=this.ticker)==null||i.stop(),this.status.value.started=!1))})}get scoreboard(){return this.currFrame.players.sort((t,s)=>s.score-t.score)}set frame(t){this.pause(),this.cursor=t,this.sync()}get frame(){return this.cursor}restart(){this.cursor=0,this.sync(),this.pause()}play(){var t;this.status.value.started=!0,(t=this.ticker)==null||t.start()}pause(){var t;this.status.value.started=!1,(t=this.ticker)==null||t.stop()}next(){return this.nextFrame?this.sync():!1}prev(){return this.prevFrame?this.sync():!1}sync(){var t;return Object.assign(this.status.value,this.currFrame),(t=this.tileset)==null?void 0:t.render(this.currFrame)}get currFrame(){return this.frames[this.cursor]}get nextFrame(){return this.isEnd?!1:this.frames[++this.cursor]}get prevFrame(){return this.isStart?!1:this.frames[--this.cursor]}get isStart(){return this.cursor===0}get isEnd(){return this.cursor===this.frames.length-1}}function xr(e){return[null,void 0,!1].indexOf(e)!==-1}function Cx(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Ku(e){var t={exports:{}};return e(t,t.exports),t.exports}var mc=Ku(function(e,t){e.exports=function(){var s=["decimals","thousand","mark","prefix","suffix","encoder","decoder","negativeBefore","negative","edit","undo"];function i(d){return d.split("").reverse().join("")}function r(d,y){return d.substring(0,y.length)===y}function n(d,y){return d.slice(-1*y.length)===y}function o(d,y,g){if((d[y]||d[g])&&d[y]===d[g])throw new Error(y)}function a(d){return typeof d=="number"&&isFinite(d)}function l(d,y){return d=d.toString().split("e"),(+((d=(d=Math.round(+(d[0]+"e"+(d[1]?+d[1]+y:y)))).toString().split("e"))[0]+"e"+(d[1]?+d[1]-y:-y))).toFixed(y)}function h(d,y,g,v,w,A,M,I,N,V,G,P){var k,tt,H,j=P,Y="",Z="";return A&&(P=A(P)),!!a(P)&&(d!==!1&&parseFloat(P.toFixed(d))===0&&(P=0),P<0&&(k=!0,P=Math.abs(P)),d!==!1&&(P=l(P,d)),(P=P.toString()).indexOf(".")!==-1?(H=(tt=P.split("."))[0],g&&(Y=g+tt[1])):H=P,y&&(H=i(H).match(/.{1,3}/g),H=i(H.join(i(y)))),k&&I&&(Z+=I),v&&(Z+=v),k&&N&&(Z+=N),Z+=H,Z+=Y,w&&(Z+=w),V&&(Z=V(Z,j)),Z)}function c(d,y,g,v,w,A,M,I,N,V,G,P){var k,tt="";return G&&(P=G(P)),!(!P||typeof P!="string")&&(I&&r(P,I)&&(P=P.replace(I,""),k=!0),v&&r(P,v)&&(P=P.replace(v,"")),N&&r(P,N)&&(P=P.replace(N,""),k=!0),w&&n(P,w)&&(P=P.slice(0,-1*w.length)),y&&(P=P.split(y).join("")),g&&(P=P.replace(g,".")),k&&(tt+="-"),(tt=(tt+=P).replace(/[^0-9\.\-.]/g,""))!==""&&(tt=Number(tt),M&&(tt=M(tt)),!!a(tt)&&tt))}function u(d){var y,g,v,w={};for(d.suffix===void 0&&(d.suffix=d.postfix),y=0;y=0&&v<8))throw new Error(g);w[g]=v}else if(g==="encoder"||g==="decoder"||g==="edit"||g==="undo"){if(typeof v!="function")throw new Error(g);w[g]=v}else{if(typeof v!="string")throw new Error(g);w[g]=v}return o(w,"mark","thousand"),o(w,"prefix","negative"),o(w,"prefix","negativeBefore"),w}function f(d,y,g){var v,w=[];for(v=0;v0&&(g(x,p),setTimeout(function(){v(x,p)},B))}function m(x){return Math.max(Math.min(x,100),0)}function d(x){return Array.isArray(x)?x:[x]}function y(x){var p=(x=String(x)).split(".");return p.length>1?p[1].length:0}function g(x,p){x.classList&&!/\s/.test(p)?x.classList.add(p):x.className+=" "+p}function v(x,p){x.classList&&!/\s/.test(p)?x.classList.remove(p):x.className=x.className.replace(new RegExp("(^|\\b)"+p.split(" ").join("|")+"(\\b|$)","gi")," ")}function w(x,p){return x.classList?x.classList.contains(p):new RegExp("\\b"+p+"\\b").test(x.className)}function A(x){var p=window.pageXOffset!==void 0,B=(x.compatMode||"")==="CSS1Compat";return{x:p?window.pageXOffset:B?x.documentElement.scrollLeft:x.body.scrollLeft,y:p?window.pageYOffset:B?x.documentElement.scrollTop:x.body.scrollTop}}function M(){return window.navigator.pointerEnabled?{start:"pointerdown",move:"pointermove",end:"pointerup"}:window.navigator.msPointerEnabled?{start:"MSPointerDown",move:"MSPointerMove",end:"MSPointerUp"}:{start:"mousedown touchstart",move:"mousemove touchmove",end:"mouseup touchend"}}function I(){var x=!1;try{var p=Object.defineProperty({},"passive",{get:function(){x=!0}});window.addEventListener("test",null,p)}catch{}return x}function N(){return window.CSS&&CSS.supports&&CSS.supports("touch-action","none")}function V(x,p){return 100/(p-x)}function G(x,p,B){return 100*p/(x[B+1]-x[B])}function P(x,p){return G(x,x[0]<0?p+Math.abs(x[0]):p-x[0],0)}function k(x,p){return p*(x[1]-x[0])/100+x[0]}function tt(x,p){for(var B=1;x>=p[B];)B+=1;return B}function H(x,p,B){if(B>=x.slice(-1)[0])return 100;var q=tt(B,x),U=x[q-1],ot=x[q],St=p[q-1],_t=p[q];return St+P([U,ot],B)/V(St,_t)}function j(x,p,B){if(B>=100)return x.slice(-1)[0];var q=tt(B,p),U=x[q-1],ot=x[q],St=p[q-1];return k([U,ot],(B-St)*V(St,p[q]))}function Y(x,p,B,q){if(q===100)return q;var U=tt(q,x),ot=x[U-1],St=x[U];return B?q-ot>(St-ot)/2?St:ot:p[U-1]?x[U-1]+h(q-x[U-1],p[U-1]):q}var Z,rt;s.PipsMode=void 0,(rt=s.PipsMode||(s.PipsMode={})).Range="range",rt.Steps="steps",rt.Positions="positions",rt.Count="count",rt.Values="values",s.PipsType=void 0,(Z=s.PipsType||(s.PipsType={}))[Z.None=-1]="None",Z[Z.NoValue=0]="NoValue",Z[Z.LargeValue=1]="LargeValue",Z[Z.SmallValue=2]="SmallValue";var ft=function(){function x(p,B,q){var U;this.xPct=[],this.xVal=[],this.xSteps=[],this.xNumSteps=[],this.xHighestCompleteStep=[],this.xSteps=[q||!1],this.xNumSteps=[!1],this.snap=B;var ot=[];for(Object.keys(p).forEach(function(St){ot.push([d(p[St]),St])}),ot.sort(function(St,_t){return St[0][0]-_t[0][0]}),U=0;Uthis.xPct[ot+1];)ot++;else p===this.xPct[this.xPct.length-1]&&(ot=this.xPct.length-2);q||p!==this.xPct[ot+1]||ot++,B===null&&(B=[]);var St=1,_t=B[ot],bt=0,Pe=0,Jt=0,dt=0;for(U=q?(p-this.xPct[ot])/(this.xPct[ot+1]-this.xPct[ot]):(this.xPct[ot+1]-p)/(this.xPct[ot+1]-this.xPct[ot]);_t>0;)bt=this.xPct[ot+1+dt]-this.xPct[ot+dt],B[ot+dt]*St+100-100*U>100?(Pe=bt*U,St=(_t-100*U)/B[ot+dt],U=1):(Pe=B[ot+dt]*bt/100*St,St=0),q?(Jt-=Pe,this.xPct.length+dt>=1&&dt--):(Jt+=Pe,this.xPct.length-dt>=1&&dt++),_t=B[ot+dt]*St;return p+Jt},x.prototype.toStepping=function(p){return p=H(this.xVal,this.xPct,p)},x.prototype.fromStepping=function(p){return j(this.xVal,this.xPct,p)},x.prototype.getStep=function(p){return p=Y(this.xPct,this.xSteps,this.snap,p)},x.prototype.getDefaultStep=function(p,B,q){var U=tt(p,this.xPct);return(p===100||B&&p===this.xPct[U-1])&&(U=Math.max(U-1,1)),(this.xVal[U]-this.xVal[U-1])/q},x.prototype.getNearbySteps=function(p){var B=tt(p,this.xPct);return{stepBefore:{startValue:this.xVal[B-2],step:this.xNumSteps[B-2],highestStep:this.xHighestCompleteStep[B-2]},thisStep:{startValue:this.xVal[B-1],step:this.xNumSteps[B-1],highestStep:this.xHighestCompleteStep[B-1]},stepAfter:{startValue:this.xVal[B],step:this.xNumSteps[B],highestStep:this.xHighestCompleteStep[B]}}},x.prototype.countStepDecimals=function(){var p=this.xNumSteps.map(y);return Math.max.apply(null,p)},x.prototype.hasNoSize=function(){return this.xVal[0]===this.xVal[this.xVal.length-1]},x.prototype.convert=function(p){return this.getStep(this.toStepping(p))},x.prototype.handleEntryPoint=function(p,B){var q;if(!u(q=p==="min"?0:p==="max"?100:parseFloat(p))||!u(B[0]))throw new Error("noUiSlider: 'range' value isn't numeric.");this.xPct.push(q),this.xVal.push(B[0]);var U=Number(B[1]);q?this.xSteps.push(!isNaN(U)&&U):isNaN(U)||(this.xSteps[0]=U),this.xHighestCompleteStep.push(0)},x.prototype.handleStepPoint=function(p,B){if(B)if(this.xVal[p]!==this.xVal[p+1]){this.xSteps[p]=G([this.xVal[p],this.xVal[p+1]],B,0)/V(this.xPct[p],this.xPct[p+1]);var q=(this.xVal[p+1]-this.xVal[p])/this.xNumSteps[p],U=Math.ceil(Number(q.toFixed(3))-1),ot=this.xVal[p]+this.xNumSteps[p]*U;this.xHighestCompleteStep[p]=ot}else this.xSteps[p]=this.xHighestCompleteStep[p]=this.xVal[p]},x}(),yt={to:function(x){return x===void 0?"":x.toFixed(2)},from:Number},Q={target:"target",base:"base",origin:"origin",handle:"handle",handleLower:"handle-lower",handleUpper:"handle-upper",touchArea:"touch-area",horizontal:"horizontal",vertical:"vertical",background:"background",connect:"connect",connects:"connects",ltr:"ltr",rtl:"rtl",textDirectionLtr:"txt-dir-ltr",textDirectionRtl:"txt-dir-rtl",draggable:"draggable",drag:"state-drag",tap:"state-tap",active:"active",tooltip:"tooltip",pips:"pips",pipsHorizontal:"pips-horizontal",pipsVertical:"pips-vertical",marker:"marker",markerHorizontal:"marker-horizontal",markerVertical:"marker-vertical",markerNormal:"marker-normal",markerLarge:"marker-large",markerSub:"marker-sub",value:"value",valueHorizontal:"value-horizontal",valueVertical:"value-vertical",valueNormal:"value-normal",valueLarge:"value-large",valueSub:"value-sub"},et={tooltips:".__tooltips",aria:".__aria"};function Dt(x,p){if(!u(p))throw new Error("noUiSlider: 'step' is not numeric.");x.singleStep=p}function ct(x,p){if(!u(p))throw new Error("noUiSlider: 'keyboardPageMultiplier' is not numeric.");x.keyboardPageMultiplier=p}function qt(x,p){if(!u(p))throw new Error("noUiSlider: 'keyboardMultiplier' is not numeric.");x.keyboardMultiplier=p}function fe(x,p){if(!u(p))throw new Error("noUiSlider: 'keyboardDefaultStep' is not numeric.");x.keyboardDefaultStep=p}function Ft(x,p){if(typeof p!="object"||Array.isArray(p))throw new Error("noUiSlider: 'range' is not an object.");if(p.min===void 0||p.max===void 0)throw new Error("noUiSlider: Missing 'min' or 'max' in 'range'.");x.spectrum=new ft(p,x.snap||!1,x.singleStep)}function it(x,p){if(p=d(p),!Array.isArray(p)||!p.length)throw new Error("noUiSlider: 'start' option is incorrect.");x.handles=p.length,x.start=p}function wt(x,p){if(typeof p!="boolean")throw new Error("noUiSlider: 'snap' option must be a boolean.");x.snap=p}function Ie(x,p){if(typeof p!="boolean")throw new Error("noUiSlider: 'animate' option must be a boolean.");x.animate=p}function Le(x,p){if(typeof p!="number")throw new Error("noUiSlider: 'animationDuration' option must be a number.");x.animationDuration=p}function Ne(x,p){var B,q=[!1];if(p==="lower"?p=[!0,!1]:p==="upper"&&(p=[!1,!0]),p===!0||p===!1){for(B=1;B1)throw new Error("noUiSlider: 'padding' option must not exceed 100% of the range.")}}function E(x,p){switch(p){case"ltr":x.dir=0;break;case"rtl":x.dir=1;break;default:throw new Error("noUiSlider: 'direction' option was not recognized.")}}function O(x,p){if(typeof p!="string")throw new Error("noUiSlider: 'behaviour' must be a string containing options.");var B=p.indexOf("tap")>=0,q=p.indexOf("drag")>=0,U=p.indexOf("fixed")>=0,ot=p.indexOf("snap")>=0,St=p.indexOf("hover")>=0,_t=p.indexOf("unconstrained")>=0,bt=p.indexOf("drag-all")>=0,Pe=p.indexOf("smooth-steps")>=0;if(U){if(x.handles!==2)throw new Error("noUiSlider: 'fixed' behaviour must be used with 2 handles");De(x,x.start[1]-x.start[0])}if(_t&&(x.margin||x.limit))throw new Error("noUiSlider: 'unconstrained' behaviour cannot be used with margin or limit");x.events={tap:B||ot,drag:q,dragAll:bt,smoothSteps:Pe,fixed:U,snap:ot,hover:St,unconstrained:_t}}function R(x,p){if(p!==!1)if(p===!0||r(p)){x.tooltips=[];for(var B=0;B= 2) required for mode 'count'.");for(var C=b.values-1,T=100/C,L=[];C--;)L[C]=C*T;return L.push(100),Ca(L,b.stepped)}return b.mode===s.PipsMode.Positions?Ca(b.values,b.stepped):b.mode===s.PipsMode.Values?b.stepped?b.values.map(function(K){return dt.fromStepping(dt.getStep(dt.toStepping(K)))}):b.values:[]}function Ca(b,C){return b.map(function(T){return dt.fromStepping(C?dt.getStep(T):T)})}function nf(b){function C($t,It){return Number(($t+It).toFixed(7))}var T=rf(b),L={},K=dt.xVal[0],X=dt.xVal[dt.xVal.length-1],pt=!1,st=!1,zt=0;return(T=l(T.slice().sort(function($t,It){return $t-It})))[0]!==K&&(T.unshift(K),pt=!0),T[T.length-1]!==X&&(T.push(X),st=!0),T.forEach(function($t,It){var Nt,At,te,de,Wt,Fa,hn,Ba,Oa,La,un=$t,zs=T[It+1],Na=b.mode===s.PipsMode.Steps;for(Na&&(Nt=dt.xNumSteps[It]),Nt||(Nt=zs-un),zs===void 0&&(zs=un),Nt=Math.max(Nt,1e-7),At=un;At<=zs;At=C(At,Nt)){for(Ba=(Wt=(de=dt.toStepping(At))-zt)/(b.density||1),La=Wt/(Oa=Math.round(Ba)),te=1;te<=Oa;te+=1)L[(Fa=zt+te*La).toFixed(5)]=[dt.fromStepping(Fa),0];hn=T.indexOf(At)>-1?s.PipsType.LargeValue:Na?s.PipsType.SmallValue:s.PipsType.NoValue,!It&&pt&&At!==zs&&(hn=0),At===zs&&st||(L[de.toFixed(5)]=[At,hn]),zt=de}}),L}function of(b,C,T){var L,K,X=Hs.createElement("div"),pt=((L={})[s.PipsType.None]="",L[s.PipsType.NoValue]=p.cssClasses.valueNormal,L[s.PipsType.LargeValue]=p.cssClasses.valueLarge,L[s.PipsType.SmallValue]=p.cssClasses.valueSub,L),st=((K={})[s.PipsType.None]="",K[s.PipsType.NoValue]=p.cssClasses.markerNormal,K[s.PipsType.LargeValue]=p.cssClasses.markerLarge,K[s.PipsType.SmallValue]=p.cssClasses.markerSub,K),zt=[p.cssClasses.valueHorizontal,p.cssClasses.valueVertical],$t=[p.cssClasses.markerHorizontal,p.cssClasses.markerVertical];function It(At,te){var de=te===p.cssClasses.value,Wt=de?pt:st;return te+" "+(de?zt:$t)[p.ort]+" "+Wt[At]}function Nt(At,te,de){if((de=C?C(te,de):de)!==s.PipsType.None){var Wt=Ze(X,!1);Wt.className=It(de,p.cssClasses.marker),Wt.style[p.style]=At+"%",de>s.PipsType.NoValue&&((Wt=Ze(X,!1)).className=It(de,p.cssClasses.value),Wt.setAttribute("data-value",String(te)),Wt.style[p.style]=At+"%",Wt.innerHTML=String(T.to(te)))}}return g(X,p.cssClasses.pips),g(X,p.ort===0?p.cssClasses.pipsHorizontal:p.cssClasses.pipsVertical),Object.keys(b).forEach(function(At){Nt(At,b[At][0],b[At][1])}),X}function sn(){St&&(n(St),St=null)}function rn(b){sn();var C=nf(b),T=b.filter,L=b.format||{to:function(K){return String(Math.round(K))}};return St=Jt.appendChild(of(C,T,L))}function Ma(){var b=q.getBoundingClientRect(),C="offset"+["Width","Height"][p.ort];return p.ort===0?b.width||q[C]:b.height||q[C]}function Ms(b,C,T,L){var K=function(pt){var st=af(pt,L.pageOffset,L.target||C);return!!st&&!(wa()&&!L.doNotReject)&&!(w(Jt,p.cssClasses.tap)&&!L.doNotReject)&&!(b===bt.start&&st.buttons!==void 0&&st.buttons>1)&&(!L.hover||!st.buttons)&&(Pe||st.preventDefault(),st.calcPoint=st.points[p.ort],void T(st,L))},X=[];return b.split(" ").forEach(function(pt){C.addEventListener(pt,K,!!Pe&&{passive:!0}),X.push([pt,K])}),X}function af(b,C,T){var L=b.type.indexOf("touch")===0,K=b.type.indexOf("mouse")===0,X=b.type.indexOf("pointer")===0,pt=0,st=0;if(b.type.indexOf("MSPointer")===0&&(X=!0),b.type==="mousedown"&&!b.buttons&&!b.touches)return!1;if(L){var zt=function(Nt){var At=Nt.target;return At===T||T.contains(At)||b.composed&&b.composedPath().shift()===T};if(b.type==="touchstart"){var $t=Array.prototype.filter.call(b.touches,zt);if($t.length>1)return!1;pt=$t[0].pageX,st=$t[0].pageY}else{var It=Array.prototype.find.call(b.changedTouches,zt);if(!It)return!1;pt=It.pageX,st=It.pageY}}return C=C||A(Hs),(K||X)&&(pt=b.clientX+C.x,st=b.clientY+C.y),b.pageOffset=C,b.points=[pt,st],b.cursor=K||X,b}function Aa(b){var C=100*(b-c(q,p.ort))/Ma();return C=m(C),p.dir?100-C:C}function lf(b){var C=100,T=!1;return U.forEach(function(L,K){if(!tn(K)){var X=Gt[K],pt=Math.abs(X-b);(ptX||pt===100&&C===100)&&(T=K,C=pt)}}),T}function cf(b,C){b.type==="mouseout"&&b.target.nodeName==="HTML"&&b.relatedTarget===null&&nn(b,C)}function hf(b,C){if(navigator.appVersion.indexOf("MSIE 9")===-1&&b.buttons===0&&C.buttonsProperty!==0)return nn(b,C);var T=(p.dir?-1:1)*(b.calcPoint-C.startCalcPoint);Pa(T>0,100*T/C.baseSize,C.locations,C.handleNumbers,C.connect)}function nn(b,C){C.handle&&(v(C.handle,p.cssClasses.active),Jr-=1),C.listeners.forEach(function(T){qi.removeEventListener(T[0],T[1])}),Jr===0&&(v(Jt,p.cssClasses.drag),cn(),b.cursor&&(Ki.style.cursor="",Ki.removeEventListener("selectstart",a))),p.events.smoothSteps&&(C.handleNumbers.forEach(function(T){As(T,Gt[T],!0,!0,!1,!1)}),C.handleNumbers.forEach(function(T){Ht("update",T)})),C.handleNumbers.forEach(function(T){Ht("change",T),Ht("set",T),Ht("end",T)})}function on(b,C){if(!C.handleNumbers.some(tn)){var T;C.handleNumbers.length===1&&(T=U[C.handleNumbers[0]].children[0],Jr+=1,g(T,p.cssClasses.active)),b.stopPropagation();var L=[],K=Ms(bt.move,qi,hf,{target:b.target,handle:T,connect:C.connect,listeners:L,startCalcPoint:b.calcPoint,baseSize:Ma(),pageOffset:b.pageOffset,handleNumbers:C.handleNumbers,buttonsProperty:b.buttons,locations:Gt.slice()}),X=Ms(bt.end,qi,nn,{target:b.target,handle:T,listeners:L,doNotReject:!0,handleNumbers:C.handleNumbers}),pt=Ms("mouseout",qi,cf,{target:b.target,handle:T,listeners:L,doNotReject:!0,handleNumbers:C.handleNumbers});L.push.apply(L,K.concat(X,pt)),b.cursor&&(Ki.style.cursor=getComputedStyle(b.target).cursor,U.length>1&&g(Jt,p.cssClasses.drag),Ki.addEventListener("selectstart",a,!1)),C.handleNumbers.forEach(function(st){Ht("start",st)})}}function uf(b){b.stopPropagation();var C=Aa(b.calcPoint),T=lf(C);T!==!1&&(p.events.snap||f(Jt,p.cssClasses.tap,p.animationDuration),As(T,C,!0,!0),cn(),Ht("slide",T,!0),Ht("update",T,!0),p.events.snap?on(b,{handleNumbers:[T]}):(Ht("change",T,!0),Ht("set",T,!0)))}function ff(b){var C=Aa(b.calcPoint),T=dt.getStep(C),L=dt.fromStepping(T);Object.keys(Ke).forEach(function(K){K.split(".")[0]==="hover"&&Ke[K].forEach(function(X){X.call(Ji,L)})})}function df(b,C){if(wa()||tn(C))return!1;var T=["Left","Right"],L=["Down","Up"],K=["PageDown","PageUp"],X=["Home","End"];p.dir&&!p.ort?T.reverse():p.ort&&!p.dir&&(L.reverse(),K.reverse());var pt,st=b.key.replace("Arrow",""),zt=st===K[0],$t=st===K[1],It=st===L[0]||st===T[0]||zt,Nt=st===L[1]||st===T[1]||$t,At=st===X[0],te=st===X[1];if(!(It||Nt||At||te))return!0;if(b.preventDefault(),Nt||It){var de=It?0:1,Wt=Ra(C)[de];if(Wt===null)return!1;Wt===!1&&(Wt=dt.getDefaultStep(Gt[C],It,p.keyboardDefaultStep)),Wt*=$t||zt?p.keyboardPageMultiplier:p.keyboardMultiplier,Wt=Math.max(Wt,1e-7),Wt*=It?-1:1,pt=qe[C]+Wt}else pt=te?p.spectrum.xVal[p.spectrum.xVal.length-1]:p.spectrum.xVal[0];return As(C,dt.toStepping(pt),!0,!0),Ht("slide",C),Ht("update",C),Ht("change",C),Ht("set",C),!1}function pf(b){b.fixed||U.forEach(function(C,T){Ms(bt.start,C.children[0],on,{handleNumbers:[T]})}),b.tap&&Ms(bt.start,q,uf,{}),b.hover&&Ms(bt.move,q,ff,{hover:!0}),b.drag&&ot.forEach(function(C,T){if(C!==!1&&T!==0&&T!==ot.length-1){var L=U[T-1],K=U[T],X=[C],pt=[L,K],st=[T-1,T];g(C,p.cssClasses.draggable),b.fixed&&(X.push(L.children[0]),X.push(K.children[0])),b.dragAll&&(pt=U,st=ye),X.forEach(function(zt){Ms(bt.start,zt,on,{handles:pt,handleNumbers:st,connect:C})})}})}function an(b,C){Ke[b]=Ke[b]||[],Ke[b].push(C),b.split(".")[0]==="update"&&U.forEach(function(T,L){Ht("update",L)})}function mf(b){return b===et.aria||b===et.tooltips}function ci(b){var C=b&&b.split(".")[0],T=C?b.substring(C.length):b;Object.keys(Ke).forEach(function(L){var K=L.split(".")[0],X=L.substring(K.length);C&&C!==K||T&&T!==X||mf(X)&&T!==X||delete Ke[L]})}function Ht(b,C,T){Object.keys(Ke).forEach(function(L){var K=L.split(".")[0];b===K&&Ke[L].forEach(function(X){X.call(Ji,qe.map(p.format.to),C,qe.slice(),T||!1,Gt.slice(),Ji)})})}function Zi(b,C,T,L,K,X,pt){var st;return U.length>1&&!p.events.unconstrained&&(L&&C>0&&(st=dt.getAbsoluteDistance(b[C-1],p.margin,!1),T=Math.max(T,st)),K&&C1&&p.limit&&(L&&C>0&&(st=dt.getAbsoluteDistance(b[C-1],p.limit,!1),T=Math.min(T,st)),K&&C1?L.forEach(function(Nt,At){var te=Zi(X,Nt,X[Nt]+C,zt[At],$t[At],!1,st);te===!1?C=0:(C=te-X[Nt],X[Nt]=te)}):zt=$t=[!0];var It=!1;L.forEach(function(Nt,At){It=As(Nt,T[Nt]+C,zt[At],$t[At],!1,st)||It}),It&&(L.forEach(function(Nt){Ht("update",Nt),Ht("slide",Nt)}),K!=null&&Ht("drag",pt))}function Ta(b,C){return p.dir?100-b-C:b}function gf(b,C){Gt[b]=C,qe[b]=dt.fromStepping(C);var T="translate("+ln(Ta(C,0)-Zu+"%","0")+")";U[b].style[p.transformRule]=T,Ea(b),Ea(b+1)}function cn(){ye.forEach(function(b){var C=Gt[b]>50?-1:1,T=3+(U.length+C*b);U[b].style.zIndex=String(T)})}function As(b,C,T,L,K,X){return K||(C=Zi(Gt,b,C,T,L,!1,X)),C!==!1&&(gf(b,C),!0)}function Ea(b){if(ot[b]){var C=0,T=100;b!==0&&(C=Gt[b-1]),b!==ot.length-1&&(T=Gt[b]);var L=T-C,K="translate("+ln(Ta(C,L)+"%","0")+")",X="scale("+ln(L/100,"1")+")";ot[b].style[p.transformRule]=K+" "+X}}function ka(b,C){return b===null||b===!1||b===void 0?Gt[C]:(typeof b=="number"&&(b=String(b)),(b=p.format.from(b))!==!1&&(b=dt.toStepping(b)),b===!1||isNaN(b)?Gt[C]:b)}function Qi(b,C,T){var L=d(b),K=Gt[0]===void 0;C=C===void 0||C,p.animate&&!K&&f(Jt,p.cssClasses.tap,p.animationDuration),ye.forEach(function(st){As(st,ka(L[st],st),!0,!1,T)});var X=ye.length===1?0:1;if(K&&dt.hasNoSize()&&(T=!0,Gt[0]=0,ye.length>1)){var pt=100/(ye.length-1);ye.forEach(function(st){Gt[st]=st*pt})}for(;X=0&&bT.stepAfter.startValue&&(K=T.stepAfter.startValue-L),X=L>T.thisStep.startValue?T.thisStep.step:T.stepBefore.step!==!1&&L-T.stepBefore.highestStep,C===100?K=null:C===0&&(X=null);var pt=dt.countStepDecimals();return K!==null&&K!==!1&&(K=Number(K.toFixed(pt))),X!==null&&X!==!1&&(X=Number(X.toFixed(pt))),[X,K]}function bf(){return ye.map(Ra)}function vf(b,C){var T=Ia(),L=["margin","limit","padding","range","animate","snap","step","format","pips","tooltips"];L.forEach(function(X){b[X]!==void 0&&(B[X]=b[X])});var K=nt(B);L.forEach(function(X){b[X]!==void 0&&(p[X]=K[X])}),dt=K.spectrum,p.margin=K.margin,p.limit=K.limit,p.padding=K.padding,p.pips?rn(p.pips):sn(),p.tooltips?Sa():en(),Gt=[],Qi(o(b.start)?b.start:T,C)}function wf(){q=tf(Jt),Ju(p.connect,q),pf(p.events),Qi(p.start),p.pips&&rn(p.pips),p.tooltips&&Sa(),sf()}wf();var Ji={destroy:_f,steps:bf,on:an,off:ci,get:Ia,set:Qi,setHandle:xf,reset:yf,__moveHandles:function(b,C,T){Pa(b,C,Gt,T)},options:B,updateOptions:vf,target:Jt,removePips:sn,removeTooltips:en,getPositions:function(){return Gt.slice()},getTooltips:function(){return _t},getOrigins:function(){return U},pips:rn};return Ji}function xt(x,p){if(!x||!x.nodeName)throw new Error("noUiSlider: create requires a single element, got: "+x);if(x.noUiSlider)throw new Error("noUiSlider: Slider was already initialized.");var B=ht(x,nt(p),p);return x.noUiSlider=B,B}var Et={__spectrum:ft,cssClasses:Q,create:xt};s.create=xt,s.cssClasses=Q,s.default=Et,Object.defineProperty(s,"__esModule",{value:!0})})(t)}));function gc(e,t){if(!Array.isArray(e)||!Array.isArray(t))return!1;const s=t.slice().sort();return e.length===t.length&&e.slice().sort().every(function(i,r){return i===s[r]})}var Or={name:"Slider",emits:["input","update:modelValue","start","slide","drag","update","change","set","end"],props:{value:{validator:function(e){return t=>typeof t=="number"||t instanceof Array||t==null||t===!1},required:!1},modelValue:{validator:function(e){return t=>typeof t=="number"||t instanceof Array||t==null||t===!1},required:!1},id:{type:[String,Number],required:!1},disabled:{type:Boolean,required:!1,default:!1},min:{type:Number,required:!1,default:0},max:{type:Number,required:!1,default:100},step:{type:Number,required:!1,default:1},orientation:{type:String,required:!1,default:"horizontal"},direction:{type:String,required:!1,default:"ltr"},tooltips:{type:Boolean,required:!1,default:!0},options:{type:Object,required:!1,default:()=>({})},merge:{type:Number,required:!1,default:-1},format:{type:[Object,Function,Boolean],required:!1,default:null},classes:{type:Object,required:!1,default:()=>({})},showTooltip:{type:String,required:!1,default:"always"},tooltipPosition:{type:String,required:!1,default:null},lazy:{type:Boolean,required:!1,default:!0},ariaLabelledby:{type:String,required:!1,default:void 0},aria:{required:!1,type:Object,default:()=>({})}},setup(e,t){const s=function(o,a,l){const{value:h,modelValue:c,min:u}=sr(o);let f=c&&c.value!==void 0?c:h;const m=Ls(f.value);if(xr(f.value)&&(f=Ls(u.value)),Array.isArray(f.value)&&f.value.length==0)throw new Error("Slider v-model must not be an empty array");return{value:f,initialValue:m}}(e),i=function(o,a,l){const{classes:h,showTooltip:c,tooltipPosition:u,orientation:f}=sr(o),m=es(()=>({target:"slider-target",focused:"slider-focused",tooltipFocus:"slider-tooltip-focus",tooltipDrag:"slider-tooltip-drag",ltr:"slider-ltr",rtl:"slider-rtl",horizontal:"slider-horizontal",vertical:"slider-vertical",textDirectionRtl:"slider-txt-dir-rtl",textDirectionLtr:"slider-txt-dir-ltr",base:"slider-base",connects:"slider-connects",connect:"slider-connect",origin:"slider-origin",handle:"slider-handle",handleLower:"slider-handle-lower",handleUpper:"slider-handle-upper",touchArea:"slider-touch-area",tooltip:"slider-tooltip",tooltipTop:"slider-tooltip-top",tooltipBottom:"slider-tooltip-bottom",tooltipLeft:"slider-tooltip-left",tooltipRight:"slider-tooltip-right",tooltipHidden:"slider-tooltip-hidden",active:"slider-active",draggable:"slider-draggable",tap:"slider-state-tap",drag:"slider-state-drag",pips:"slider-pips",pipsHorizontal:"slider-pips-horizontal",pipsVertical:"slider-pips-vertical",marker:"slider-marker",markerHorizontal:"slider-marker-horizontal",markerVertical:"slider-marker-vertical",markerNormal:"slider-marker-normal",markerLarge:"slider-marker-large",markerSub:"slider-marker-sub",value:"slider-value",valueHorizontal:"slider-value-horizontal",valueVertical:"slider-value-vertical",valueNormal:"slider-value-normal",valueLarge:"slider-value-large",valueSub:"slider-value-sub",...h.value}));return{classList:es(()=>{const d={...m.value};return Object.keys(d).forEach(y=>{d[y]=Array.isArray(d[y])?d[y].filter(g=>g!==null).join(" "):d[y]}),c.value!=="always"&&(d.target+=` ${c.value==="drag"?d.tooltipDrag:d.tooltipFocus}`),f.value==="horizontal"&&(d.tooltip+=u.value==="bottom"?` ${d.tooltipBottom}`:` ${d.tooltipTop}`),f.value==="vertical"&&(d.tooltip+=u.value==="right"?` ${d.tooltipRight}`:` ${d.tooltipLeft}`),d})}}(e),r=function(o,a,l){const{format:h,step:c}=sr(o),u=l.value,f=l.classList,m=es(()=>h&&h.value?typeof h.value=="function"?{to:h.value}:mc({...h.value}):mc({decimals:c.value>=0?0:2})),d=es(()=>Array.isArray(u.value)?u.value.map(y=>m.value):m.value);return{tooltipFormat:m,tooltipsFormat:d,tooltipsMerge:(y,g,v)=>{var w=getComputedStyle(y).direction==="rtl",A=y.noUiSlider.options.direction==="rtl",M=y.noUiSlider.options.orientation==="vertical",I=y.noUiSlider.getTooltips(),N=y.noUiSlider.getOrigins();I.forEach(function(V,G){V&&N[G].appendChild(V)}),y.noUiSlider.on("update",function(V,G,P,k,tt){var H=[[]],j=[[]],Y=[[]],Z=0;I[0]&&(H[0][0]=0,j[0][0]=tt[0],Y[0][0]=m.value.to(parseFloat(V[0])));for(var rt=1;rtg)&&(H[++Z]=[],Y[Z]=[],j[Z]=[]),I[rt]&&(H[Z].push(rt),Y[Z].push(m.value.to(parseFloat(V[rt]))),j[Z].push(tt[rt]));H.forEach(function(ft,yt){for(var Q=ft.length,et=0;et{I[Dt].classList.contains(it)&&I[Dt].classList.remove(it)})}else I[Dt].style.display="none",f.value.tooltipHidden.split(" ").forEach(it=>{I[Dt].classList.add(it)})}})})}}}(e,0,{value:s.value,classList:i.classList}),n=function(o,a,l){const{orientation:h,direction:c,tooltips:u,step:f,min:m,max:d,merge:y,id:g,disabled:v,options:w,classes:A,format:M,lazy:I,ariaLabelledby:N,aria:V}=sr(o),G=l.value,P=l.initialValue,k=l.tooltipsFormat,tt=l.tooltipsMerge,H=l.tooltipFormat,j=l.classList,Y=Ls(null),Z=Ls(null),rt=Ls(!1),ft=es(()=>{let it={cssPrefix:"",cssClasses:j.value,orientation:h.value,direction:c.value,tooltips:!!u.value&&k.value,connect:"lower",start:xr(G.value)?m.value:G.value,range:{min:m.value,max:d.value}};if(f.value>0&&(it.step=f.value),Array.isArray(G.value)&&(it.connect=!0),N&&N.value||V&&Object.keys(V.value).length){let wt=Array.isArray(G.value)?G.value:[G.value];it.handleAttributes=wt.map(Ie=>Object.assign({},V.value,N&&N.value?{"aria-labelledby":N.value}:{}))}return M.value&&(it.ariaFormat=H.value),it}),yt=es(()=>{let it={id:g&&g.value?g.value:void 0};return v.value&&(it.disabled=!0),it}),Q=es(()=>Array.isArray(G.value)),et=()=>{let it=Z.value.get();return Array.isArray(it)?it.map(wt=>parseFloat(wt)):parseFloat(it)},Dt=function(it){let wt=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];Z.value.set(it,wt)},ct=it=>{a.emit("input",it),a.emit("update:modelValue",it),a.emit("update",it)},qt=()=>{Z.value=Mx.create(Y.value,Object.assign({},ft.value,w.value)),u.value&&Q.value&&y.value>=0&&tt(Y.value,y.value," - "),Z.value.on("set",()=>{const it=et();a.emit("change",it),a.emit("set",it),I.value&&ct(it)}),Z.value.on("update",()=>{if(!rt.value)return;const it=et();Q.value&&gc(G.value,it)||!Q.value&&G.value==it?a.emit("update",it):I.value||ct(it)}),Z.value.on("start",()=>{a.emit("start",et())}),Z.value.on("end",()=>{a.emit("end",et())}),Z.value.on("slide",()=>{a.emit("slide",et())}),Z.value.on("drag",()=>{a.emit("drag",et())}),Y.value.querySelectorAll("[data-handle]").forEach(it=>{it.onblur=()=>{Y.value&&j.value.focused.split(" ").forEach(wt=>{Y.value.classList.remove(wt)})},it.onfocus=()=>{j.value.focused.split(" ").forEach(wt=>{Y.value.classList.add(wt)})}}),rt.value=!0},fe=()=>{Z.value.off(),Z.value.destroy(),Z.value=null},Ft=(it,wt)=>{rt.value=!1,fe(),qt()};return ea(qt),sa(fe),ae(Q,Ft,{immediate:!1}),ae(m,Ft,{immediate:!1}),ae(d,Ft,{immediate:!1}),ae(f,Ft,{immediate:!1}),ae(h,Ft,{immediate:!1}),ae(c,Ft,{immediate:!1}),ae(u,Ft,{immediate:!1}),ae(y,Ft,{immediate:!1}),ae(M,Ft,{immediate:!1,deep:!0}),ae(w,Ft,{immediate:!1,deep:!0}),ae(A,Ft,{immediate:!1,deep:!0}),ae(G,(it,wt)=>{wt&&(typeof wt=="object"&&typeof it=="object"&&it&&Object.keys(wt)>Object.keys(it)||typeof wt=="object"&&typeof it!="object"||xr(it))&&Ft()},{immediate:!1}),ae(G,it=>{if(xr(it))return void Dt(m.value,!1);let wt=et();Q.value&&!Array.isArray(wt)&&(wt=[wt]),(Q.value&&!gc(it,wt)||!Q.value&&it!=wt)&&Dt(it,!1)},{deep:!0}),{slider:Y,slider$:Z,isRange:Q,sliderProps:yt,init:qt,destroy:fe,refresh:Ft,update:Dt,reset:()=>{ct(P.value)}}}(e,t,{value:s.value,initialValue:s.initialValue,tooltipFormat:r.tooltipFormat,tooltipsFormat:r.tooltipsFormat,tooltipsMerge:r.tooltipsMerge,classList:i.classList});return{...i,...r,...n}}};Or.render=function(e,t,s,i,r,n){return Kt(),ee("div",Ch(e.sliderProps,{ref:"slider"}),null,16)},Or.__file="src/Slider.vue";const Ax={class:"h-screen w-screen overflow-hidden bg-gray-950"},Px={key:"1",class:"flex h-full w-full items-center justify-center"},Tx={for:"file-dropzone",class:"relative flex cursor-pointer flex-col items-center justify-center overflow-visible rounded-lg border-2 border-gray-600 bg-gray-500"},Ex={class:"flex flex-col items-center justify-center space-y-4 p-6 text-slate-200"},kx={key:1,class:"flex h-full w-full bg-black text-slate-100"},Ix={class:"flex w-80 flex-col bg-[#0a1606]"},Rx=["src"],Fx={class:"flex grow flex-col justify-center"},Bx={class:"flex gap-3 text-xs"},Ox={class:"flex items-center gap-1 text-yellow-300"},Lx={class:"flex items-center gap-1 text-blue-300"},Nx={class:"flex items-center gap-1 text-wrap text-xs text-slate-400"},Dx={key:0},Ux={class:"flex grow flex-col bg-black py-4 text-slate-100"},Vx={class:"flex basis-1/12 flex-col justify-end text-center"},Gx={class:"font-bold"},$x={class:"basis-1/5 space-y-2 text-center"},Hx={class:"flex justify-center gap-8 pb-2"},zx={class:"mx-auto flex items-center justify-center gap-4 text-slate-400"},jx={class:"mx-auto flex items-center justify-center gap-4 text-slate-400"},Yx={key:0,class:"text-xs"},Wx={key:0},Xx={class:"flex items-center justify-center gap-2"},qx={class:"flex items-center gap-1 text-blue-300"},Kx={key:0,class:"flex items-center justify-center gap-2"},Zx={class:"flex items-center gap-1 text-blue-300"},Qx={class:"flex items-center justify-center gap-2 pt-1"},Jx={key:1},t1={key:1,class:"text-xs text-slate-500"},e1=Sd({__name:"App",setup(e){var t=["text-[#ff0000]","text-[#ff8700]","text-[#ffd300]","text-[#deff0a]","text-[#a1ff0a]","text-[#0aff99]","text-[#0aefff]","text-[#147df5]","text-[#580aff]","text-[#be0aff]","text-[#cccccc]"];const s=m=>m?t[m-1]:"text-slate-100";var i=Ls(!0),r={},n={},o={},a={},l={};const h=Cd("stageContainer"),c=Gr({x:void 0,y:void 0}),u=async m=>{const d=m.target;if(!d.files||d.files.length==0)return;const y=d.files[0],g=new FileReader;g.onload=async()=>{const v=JSON.parse(g.result);r=mx(v),n=new rx(r,c),o=new Sx(r,Vo),a=o.status,l=es(()=>a.value.hoverInfo(c)),i.value=!1},g.readAsText(y)},f=async()=>{if(!i){if(!h.value){console.error("Stage container not found");return}n.init(h.value,o)}};return(m,d)=>(Kt(),ee("div",Ax,[Ct(Tp,{name:"fade",mode:"out-in",onAfterEnter:f},{default:lo(()=>{var y,g,v,w,A,M,I;return[gt(i)?(Kt(),ee("div",Px,[ut("label",Tx,[d[9]||(d[9]=ut("img",{alt:"Lighthouse logo",src:xl,class:"absolute -top-64 w-64"},null,-1)),ut("div",Ex,[Ct(_l,{class:"w-8"}),d[8]||(d[8]=ut("p",{class:"text-center"},[ut("span",{class:"text-white"},"Upload"),Sh(" a JSON game ")],-1))]),ut("input",{id:"file-dropzone",type:"file",class:"hidden",onChange:u},null,32)])])):(Kt(),ee("div",kx,[ut("div",Ix,[d[10]||(d[10]=ut("div",{class:"flex h-40 items-center justify-center border-b-2 border-[#12230d]"},[ut("img",{alt:"Lighthouse logo",src:xl,class:"h-28 w-28"})],-1)),Ct(qp,{name:"list",tag:"div",class:"flex flex-col gap-4 p-4 text-slate-100"},{default:lo(()=>[(Kt(!0),ee(xe,null,_n(gt(a).scoreboard,N=>(Kt(),ee("div",{class:"flex gap-4",key:N.id},[ut("img",{class:"w-12",alt:"Player avatar",src:`https://api.dicebear.com/8.x/bottts-neutral/svg?backgroundColor=${gt(px)(N.color)}&radius=25&seed=${N.id}`},null,8,Rx),ut("div",Fx,[ut("span",{class:ti(["text-sm font-bold",[gt(t)[N.id-1]]])},ve(N.name),3),ut("div",Bx,[ut("span",Ox,[Ct(lm,{class:"w-4"}),ut("span",null,ve(N.score),1)]),ut("span",Lx,[Ct(Pn,{class:"w-4"}),ut("span",null,ve(N.energy),1)])]),ut("div",Nx,[Ct(am,{class:"w-4"}),N.keys.length==0?(Kt(),ee("span",Dx,"No keys")):(Kt(!0),ee(xe,{key:1},_n(N.keys,V=>(Kt(),ee("span",null,ve(V),1))),256))])])]))),128))]),_:1})]),ut("div",Ux,[ut("div",Vx,[ut("p",Gx,ve(gt(a).title),1),ut("p",null,ve(gt(a).subtitle),1)]),ut("div",{ref_key:"stageContainer",ref:h,class:"relative w-full grow"},null,512),ut("div",$x,[ut("div",Hx,[ut("button",{onClick:d[0]||(d[0]=(...N)=>gt(o).restart&>(o).restart(...N)),title:"Restart"},[Ct(um)]),ut("button",{onClick:d[1]||(d[1]=(...N)=>gt(o).prev&>(o).prev(...N)),title:"Previous Frame"},[Ct(fm)]),gt(a).started?(Kt(),ee("button",{key:0,onClick:d[2]||(d[2]=(...N)=>gt(o).pause&>(o).pause(...N)),title:"Pause"},[Ct(cm)])):(Kt(),ee("button",{key:1,onClick:d[3]||(d[3]=(...N)=>gt(o).play&>(o).play(...N)),title:"Play"},[Ct(hm)])),ut("button",{onClick:d[4]||(d[4]=(...N)=>gt(o).next&>(o).next(...N)),title:"Next Frame"},[Ct(dm)]),ut("button",{title:"Load new game",onClick:d[5]||(d[5]=N=>re(i)?i.value=!0:i=!0)},[Ct(_l)])]),ut("div",zx,[d[11]||(d[11]=ut("span",null,"Slower",-1)),Ct(gt(Or),{modelValue:gt(o).speed,"onUpdate:modelValue":d[6]||(d[6]=N=>gt(o).speed=N),min:1,max:gt(Vo),lazy:!1,tooltips:!1,class:"w-40"},null,8,["modelValue","max"]),d[12]||(d[12]=ut("span",null,"Faster",-1))]),ut("div",jx,[d[13]||(d[13]=ut("span",null,"Frame",-1)),Ct(gt(Or),{modelValue:gt(o).frame,"onUpdate:modelValue":d[7]||(d[7]=N=>gt(o).frame=N),min:0,max:gt(o).frames.length-1,lazy:!1,tooltips:!1,disabled:gt(a).started,class:"w-80"},null,8,["modelValue","max","disabled"])]),gt(l).show?(Kt(),ee("div",Yx,[((y=gt(l).tile)==null?void 0:y.type)==gt(Di).Ground?(Kt(),ee("div",Wx,[ut("div",Xx,[ut("span",null,"Tile("+ve((g=gt(l).tile)==null?void 0:g.x)+","+ve((v=gt(l).tile)==null?void 0:v.y)+")",1),ut("div",qx,[Ct(Pn,{class:"w-3"}),ut("span",null,ve((w=gt(l).tile)==null?void 0:w.energy),1)])]),gt(l).lighthouse?(Kt(),ee("div",Kx,[ut("span",{class:ti([s((A=gt(l).lighthouse)==null?void 0:A.ownerId)])},"Lighthouse("+ve((M=gt(l).lighthouse)==null?void 0:M.id)+")",3),ut("div",Zx,[Ct(Pn,{class:"w-3"}),ut("span",null,ve((I=gt(l).lighthouse)==null?void 0:I.energy),1)])])):pp("",!0),ut("div",Qx,[(Kt(!0),ee(xe,null,_n(gt(l).players,N=>(Kt(),ee("span",{class:ti(["font-bold",[gt(t)[N.id-1]]]),key:N.id},ve(N.name),3))),128))])])):(Kt(),ee("p",Jx,"Water tile"))])):(Kt(),ee("div",t1," Hover over a tile to check its data "))])])]))]}),_:1})]))}}),s1=(e,t)=>{const s=e.__vccOpts||e;for(const[i,r]of t)s[i]=r;return s},i1=s1(e1,[["__scopeId","data-v-71b68733"]]),r1=sm(i1);r1.mount("#app");export{Tu as $,Pu as A,_e as B,oe as C,bs as D,Tt as E,$g as F,li as G,Yh as H,Ye as I,Fl as J,Ui as K,Rg as L,Pt as M,zg as N,Qt as O,ue as P,ne as Q,Mo as R,Gg as S,cs as T,wo as U,l0 as V,Ol as W,cg as X,Nn as Y,ge as Z,Xh as _,Ot as a,Xt as a0,Zt as a1,d0 as a2,L0 as a3,ey as a4,iy as a5,ly as a6,hy as a7,uy as a8,gi as a9,wi as aa,fc as ab,p0 as ac,m0 as ad,ua as ae,Ks as af,oi as ag,Hu as ah,Wl as ai,jl as aj,Om as ak,We as al,Nm as am,ju as an,_i as b,ls as c,k0 as d,Xe as e,Yl as f,P0 as g,zi as h,wr as i,fa as j,Cu as k,nu as l,da as m,o1 as n,ty as o,sy as p,oy as q,qm as r,Fu as s,cy as t,qr as u,Lm as v,je as w,Xr as x,dy as y,rs as z}; +}`;class ix extends $g{constructor(t={}){const s=new da({uColorMatrix:{value:[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],type:"f32",size:20},uAlpha:{value:1,type:"f32"}}),i=li.from({vertex:{source:pc,entryPoint:"mainVertex"},fragment:{source:pc,entryPoint:"mainFragment"}}),r=Xr.from({vertex:ex,fragment:sx,name:"color-matrix-filter"});super({...t,gpuProgram:i,glProgram:r,resources:{colorMatrixUniforms:s}}),this.alpha=1}_loadMatrix(t,s=!1){let i=t;s&&(this._multiply(i,this.matrix,t),i=this._colorMatrix(i)),this.resources.colorMatrixUniforms.uniforms.uColorMatrix=i,this.resources.colorMatrixUniforms.update()}_multiply(t,s,i){return t[0]=s[0]*i[0]+s[1]*i[5]+s[2]*i[10]+s[3]*i[15],t[1]=s[0]*i[1]+s[1]*i[6]+s[2]*i[11]+s[3]*i[16],t[2]=s[0]*i[2]+s[1]*i[7]+s[2]*i[12]+s[3]*i[17],t[3]=s[0]*i[3]+s[1]*i[8]+s[2]*i[13]+s[3]*i[18],t[4]=s[0]*i[4]+s[1]*i[9]+s[2]*i[14]+s[3]*i[19]+s[4],t[5]=s[5]*i[0]+s[6]*i[5]+s[7]*i[10]+s[8]*i[15],t[6]=s[5]*i[1]+s[6]*i[6]+s[7]*i[11]+s[8]*i[16],t[7]=s[5]*i[2]+s[6]*i[7]+s[7]*i[12]+s[8]*i[17],t[8]=s[5]*i[3]+s[6]*i[8]+s[7]*i[13]+s[8]*i[18],t[9]=s[5]*i[4]+s[6]*i[9]+s[7]*i[14]+s[8]*i[19]+s[9],t[10]=s[10]*i[0]+s[11]*i[5]+s[12]*i[10]+s[13]*i[15],t[11]=s[10]*i[1]+s[11]*i[6]+s[12]*i[11]+s[13]*i[16],t[12]=s[10]*i[2]+s[11]*i[7]+s[12]*i[12]+s[13]*i[17],t[13]=s[10]*i[3]+s[11]*i[8]+s[12]*i[13]+s[13]*i[18],t[14]=s[10]*i[4]+s[11]*i[9]+s[12]*i[14]+s[13]*i[19]+s[14],t[15]=s[15]*i[0]+s[16]*i[5]+s[17]*i[10]+s[18]*i[15],t[16]=s[15]*i[1]+s[16]*i[6]+s[17]*i[11]+s[18]*i[16],t[17]=s[15]*i[2]+s[16]*i[7]+s[17]*i[12]+s[18]*i[17],t[18]=s[15]*i[3]+s[16]*i[8]+s[17]*i[13]+s[18]*i[18],t[19]=s[15]*i[4]+s[16]*i[9]+s[17]*i[14]+s[18]*i[19]+s[19],t}_colorMatrix(t){const s=new Float32Array(t);return s[4]/=255,s[9]/=255,s[14]/=255,s[19]/=255,s}brightness(t,s){const i=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0];this._loadMatrix(i,s)}tint(t,s){const[i,r,n]=ge.shared.setValue(t).toArray(),o=[i,0,0,0,0,0,r,0,0,0,0,0,n,0,0,0,0,0,1,0];this._loadMatrix(o,s)}greyscale(t,s){const i=[t,t,t,0,0,t,t,t,0,0,t,t,t,0,0,0,0,0,1,0];this._loadMatrix(i,s)}grayscale(t,s){this.greyscale(t,s)}blackAndWhite(t){const s=[.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0];this._loadMatrix(s,t)}hue(t,s){t=(t||0)/180*Math.PI;const i=Math.cos(t),r=Math.sin(t),n=Math.sqrt,o=1/3,a=n(o),l=i+(1-i)*o,h=o*(1-i)-a*r,c=o*(1-i)+a*r,u=o*(1-i)+a*r,f=i+o*(1-i),m=o*(1-i)-a*r,d=o*(1-i)-a*r,y=o*(1-i)+a*r,g=i+o*(1-i),v=[l,h,c,0,0,u,f,m,0,0,d,y,g,0,0,0,0,0,1,0];this._loadMatrix(v,s)}contrast(t,s){const i=(t||0)+1,r=-.5*(i-1),n=[i,0,0,0,r,0,i,0,0,r,0,0,i,0,r,0,0,0,1,0];this._loadMatrix(n,s)}saturate(t=0,s){const i=t*2/3+1,r=(i-1)*-.5,n=[i,r,r,0,0,r,i,r,0,0,r,r,i,0,0,0,0,0,1,0];this._loadMatrix(n,s)}desaturate(){this.saturate(-1)}negative(t){const s=[-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0];this._loadMatrix(s,t)}sepia(t){const s=[.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0];this._loadMatrix(s,t)}technicolor(t){const s=[1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0];this._loadMatrix(s,t)}polaroid(t){const s=[1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0];this._loadMatrix(s,t)}toBGR(t){const s=[0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0];this._loadMatrix(s,t)}kodachrome(t){const s=[1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0];this._loadMatrix(s,t)}browni(t){const s=[.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0];this._loadMatrix(s,t)}vintage(t){const s=[.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0];this._loadMatrix(s,t)}colorTone(t,s,i,r,n){t=t||.2,s=s||.15,i=i||16770432,r=r||3375104;const o=ge.shared,[a,l,h]=o.setValue(i).toArray(),[c,u,f]=o.setValue(r).toArray(),m=[.3,.59,.11,0,0,a,l,h,t,0,c,u,f,s,0,a-c,l-u,h-f,0,0];this._loadMatrix(m,n)}night(t,s){t=t||.1;const i=[t*-2,-t,0,0,0,-t,0,t,0,0,0,t,t*2,0,0,0,0,0,1,0];this._loadMatrix(i,s)}predator(t,s){const i=[11.224130630493164*t,-4.794486999511719*t,-2.8746118545532227*t,0*t,.40342438220977783*t,-3.6330697536468506*t,9.193157196044922*t,-2.951810836791992*t,0*t,-1.316135048866272*t,-3.2184197902679443*t,-4.2375030517578125*t,7.476448059082031*t,0*t,.8044459223747253*t,0,0,0,1,0];this._loadMatrix(i,s)}lsd(t){const s=[2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0];this._loadMatrix(s,t)}reset(){const t=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0];this._loadMatrix(t,!1)}get matrix(){return this.resources.colorMatrixUniforms.uniforms.uColorMatrix}set matrix(t){this.resources.colorMatrixUniforms.uniforms.uColorMatrix=t}get alpha(){return this.resources.colorMatrixUniforms.uniforms.uAlpha}set alpha(t){this.resources.colorMatrixUniforms.uniforms.uAlpha=t}}class We extends Qh{constructor(t){t instanceof gi&&(t={context:t});const{context:s,roundPixels:i,...r}=t||{};super({label:"Graphics",...r}),this.renderPipeId="graphics",s?this._context=s:this._context=this._ownedContext=new gi,this._context.on("update",this.onViewUpdate,this),this.allowChildren=!1,this.roundPixels=i??!1}set context(t){t!==this._context&&(this._context.off("update",this.onViewUpdate,this),this._context=t,this._context.on("update",this.onViewUpdate,this),this.onViewUpdate())}get context(){return this._context}get bounds(){return this._context.bounds}addBounds(t){t.addBounds(this._context.bounds)}containsPoint(t){return this._context.containsPoint(t)}destroy(t){this._ownedContext&&!t?this._ownedContext.destroy(t):(t===!0||(t==null?void 0:t.context)===!0)&&this._context.destroy(t),this._ownedContext=null,this._context=null,super.destroy(t)}_callContextMethod(t,s){return this.context[t](...s),this}setFillStyle(...t){return this._callContextMethod("setFillStyle",t)}setStrokeStyle(...t){return this._callContextMethod("setStrokeStyle",t)}fill(...t){return this._callContextMethod("fill",t)}stroke(...t){return this._callContextMethod("stroke",t)}texture(...t){return this._callContextMethod("texture",t)}beginPath(){return this._callContextMethod("beginPath",[])}cut(){return this._callContextMethod("cut",[])}arc(...t){return this._callContextMethod("arc",t)}arcTo(...t){return this._callContextMethod("arcTo",t)}arcToSvg(...t){return this._callContextMethod("arcToSvg",t)}bezierCurveTo(...t){return this._callContextMethod("bezierCurveTo",t)}closePath(){return this._callContextMethod("closePath",[])}ellipse(...t){return this._callContextMethod("ellipse",t)}circle(...t){return this._callContextMethod("circle",t)}path(...t){return this._callContextMethod("path",t)}lineTo(...t){return this._callContextMethod("lineTo",t)}moveTo(...t){return this._callContextMethod("moveTo",t)}quadraticCurveTo(...t){return this._callContextMethod("quadraticCurveTo",t)}rect(...t){return this._callContextMethod("rect",t)}roundRect(...t){return this._callContextMethod("roundRect",t)}poly(...t){return this._callContextMethod("poly",t)}regularPoly(...t){return this._callContextMethod("regularPoly",t)}roundPoly(...t){return this._callContextMethod("roundPoly",t)}roundShape(...t){return this._callContextMethod("roundShape",t)}filletRect(...t){return this._callContextMethod("filletRect",t)}chamferRect(...t){return this._callContextMethod("chamferRect",t)}star(...t){return this._callContextMethod("star",t)}svg(...t){return this._callContextMethod("svg",t)}restore(...t){return this._callContextMethod("restore",t)}save(){return this._callContextMethod("save",[])}getTransform(){return this.context.getTransform()}resetTransform(){return this._callContextMethod("resetTransform",[])}rotateTransform(...t){return this._callContextMethod("rotate",t)}scaleTransform(...t){return this._callContextMethod("scale",t)}setTransform(...t){return this._callContextMethod("setTransform",t)}transform(...t){return this._callContextMethod("transform",t)}translateTransform(...t){return this._callContextMethod("translate",t)}clear(){return this._callContextMethod("clear",[])}get fillStyle(){return this._context.fillStyle}set fillStyle(t){this._context.fillStyle=t}get strokeStyle(){return this._context.strokeStyle}set strokeStyle(t){this._context.strokeStyle=t}clone(t=!1){return t?new We(this._context.clone()):(this._ownedContext=null,new We(this._context))}lineStyle(t,s,i){Xt(Zt,"Graphics#lineStyle is no longer needed. Use Graphics#setStrokeStyle to set the stroke style.");const r={};return t&&(r.width=t),s&&(r.color=s),i&&(r.alpha=i),this.context.strokeStyle=r,this}beginFill(t,s){Xt(Zt,"Graphics#beginFill is no longer needed. Use Graphics#fill to fill the shape with the desired style.");const i={};return t&&(i.color=t),s&&(i.alpha=s),this.context.fillStyle=i,this}endFill(){Xt(Zt,"Graphics#endFill is no longer needed. Use Graphics#fill to fill the shape with the desired style."),this.context.fill();const t=this.context.strokeStyle;return(t.width!==gi.defaultStrokeStyle.width||t.color!==gi.defaultStrokeStyle.color||t.alpha!==gi.defaultStrokeStyle.alpha)&&this.context.stroke(),this}drawCircle(...t){return Xt(Zt,"Graphics#drawCircle has been renamed to Graphics#circle"),this._callContextMethod("circle",t)}drawEllipse(...t){return Xt(Zt,"Graphics#drawEllipse has been renamed to Graphics#ellipse"),this._callContextMethod("ellipse",t)}drawPolygon(...t){return Xt(Zt,"Graphics#drawPolygon has been renamed to Graphics#poly"),this._callContextMethod("poly",t)}drawRect(...t){return Xt(Zt,"Graphics#drawRect has been renamed to Graphics#rect"),this._callContextMethod("rect",t)}drawRoundedRect(...t){return Xt(Zt,"Graphics#drawRoundedRect has been renamed to Graphics#roundRect"),this._callContextMethod("roundRect",t)}drawStar(...t){return Xt(Zt,"Graphics#drawStar has been renamed to Graphics#star"),this._callContextMethod("star",t)}}Xe.add(Sm,Cm);class rx{constructor(t,s){this.game=t,this.hover=s}async init(t,s){const i=new Iu;await i.init({resizeTo:t}),t.appendChild(i.canvas);const r=this.game.board[0].length,n=this.game.board.length,o=(i.renderer.width-50)/r,a=(i.renderer.height-50)/n,l=Math.min(o,a),h=i.renderer.width/2-r*l/2,c=i.renderer.height/2-n*l/2,u=new nx(this.game,l,this.hover,h,c);i.stage.addChild(u);const f=new We;f.rect(h,c,l*r,l*n).stroke({color:6316128,width:1}),i.stage.addChild(f);const m=_i.shared;m.autoStart=!1,s.init(u,m)}}class nx extends oe{constructor(s,i,r,n,o){super();Bt(this,"tiles");Bt(this,"players");Bt(this,"lighthouses");Bt(this,"links",new Map);this.game=s,this.tileSize=i,this.position.set(n,o),this.tiles=s.board.map(a=>a.map(l=>{const h=new ax(l,this.tileSize,r);return this.addChild(h),h})),this.players=s.state.players.reduce((a,l)=>{const h=new Do(l,this.tileSize);return this.tiles[l.y][l.x].move(h),a.set(l.id,h),a},new Map),this.lighthouses=s.state.lighthouses.reduce((a,l)=>{const h=new cx(l,this.tileSize);return this.tiles[l.y][l.x].lighthouse=h,a.set(l.id,h),a},new Map)}render(s){s.energy.forEach((r,n)=>r.forEach((o,a)=>{this.tiles[n][a].setEnergy(o)})),s.players.forEach(r=>{const n=this.players.get(r.id);this.tiles[r.y][r.x].move(n)});const i=new Array;s.lighthouses.forEach(r=>{const n=this.lighthouses.get(r.id),o=this.players.get(r.ownerId);n.update(o),r.links.forEach(a=>{if(o===void 0){console.warn("Lighthouse has links but no owner",r);return}const l=ox(r.id,a);i.push(l),this.links.has(l)||this.registerLink(l,r.id,a,o.color)})});for(const[r,n]of this.links)i.includes(r)||(this.removeChild(n),this.links.delete(r));return!0}registerLink(s,i,r,n){if(this.links.get(s))return;const o=this.lighthouses.get(i),a=this.lighthouses.get(r),l=new We;l.moveTo(o.parent.x+this.tileSize/2,o.parent.y+this.tileSize/2),l.lineTo(a.parent.x+this.tileSize/2,a.parent.y+this.tileSize/2),l.stroke({color:n,width:1}),this.addChild(l),this.links.set(s,l)}}const ox=(e,t)=>es instanceof Do);t.sort((s,i)=>s.zIndex-i.zIndex).forEach((s,i)=>{s.position.x=s.parentSize*.5+i*s.size/t.length})}}class Do extends We{constructor(s,i){super();Bt(this,"size");Bt(this,"color");this.parentSize=i,this.size=i*.75,this.color=s?s.color:16777215,this.rect(0,0,this.size,this.size).fill({color:this.color}),this.pivot.set(this.size*.5),this.position.set(this.parentSize*.5);const r=new ix;r.brightness(.7,!0),this.filters=[r]}}class cx extends We{constructor(s,i){super();Bt(this,"ownedBy");const r=i*.4;this.label=`Lighthouse(${s.id})`,this.position.set(i*.5),this.rotation=Math.PI/4,this.pivot.set(r*.5),this.rect(0,0,r,r).fill({color:15790320})}update(s){this.tint=s?s.color:16777215}}class hx extends We{constructor(t){super(),this.label="WaterBackground",this.rect(0,0,t,t).fill({color:0})}}class ux extends We{constructor(s){super();Bt(this,"energy");this.parentSize=s,this.label="IslandBackground",this.energy=0,this.rect(0,0,s,s).fill({color:6316128}),this.setEnergy(0)}setEnergy(s){this.energy=s,this.tint=6316128+Math.round(s*.75)*65793}}class fx extends We{constructor(t){super(),this.label="Marker",this.position.set(t*.5),this.rect(0,0,1,1).fill({color:15790320})}}var Xi=[16711680,5769983,14614282,12454655,716799,5373706,16746240,1342965,720793,16765696];Xi=[16711680,16776960,65280,65535,255,16711935,16711680,16776960,65280,65535];Xi=[16711680,16744448,16776960,32768,255,8388736,16711680,16744448,16776960,32768];Xi=[16734558,16749132,16763450,9095462,1671876,6966419,16734558,16749132,16763450,9095462];Xi=[16711680,16746240,16765696,14614282,10616586,720793,716799,1342965,5769983,12454655,13421772];const dx=e=>Xi[e],px=e=>{let t=e.toString(16);for(;t.length<6;)t="0"+t;return t},mx=e=>pm(gx(e.topology),Uo(e.setup),e.rounds.map(xx),Uo(e.finalStatus)),gx=e=>e.map((t,s)=>t.map((i,r)=>mm(yx(i),0,ba([s,r])))),yx=e=>e?Di.Ground:Di.Water,ba=e=>bm(e[1],e[0]),Uo=e=>Oh(e.energy,e.players.map(qu),e.lighthouses.map(bx)),xx=(e,t)=>{const s=`Round ${t+1}`,i=Uo(e.setup),r=JSON.parse(JSON.stringify(i)),n=e.turns.map(o=>_x(o,r));return xm(s,i,n)},_x=(e,t)=>{const s=qu(e.player),i=`${s.name} turn`,r=t.players.map(o=>o.id===s.id?s:o),n=Oh(t.energy,r,t.lighthouses);return Object.assign(t,n),_m(i,n)},qu=e=>gm(e.id,e.name,e.energy,e.score,e.keys,dx(e.id-1),ba(e.position)),bx=e=>ym(e.id,e.energy,e.ownerId,e.connections,ba(e.position)),Vo=5,vx=Vo*2+1;class wx{constructor(t,s){Bt(this,"started");Bt(this,"title");Bt(this,"subtitle");Bt(this,"energy");Bt(this,"players");Bt(this,"lighthouses");this.board=s,this.started=!1,this.title=t.title,this.subtitle=t.subtitle,this.energy=t.energy,this.players=t.players,this.lighthouses=t.lighthouses}merge(t){this.energy=t.energy,t.players.forEach(s=>{const i=this.players.find(r=>r.id==s.id);i.energy=s.energy,i.score=s.score}),this.lighthouses=t.lighthouses}get scoreboard(){return this.players.sort((t,s)=>s.score-t.score)}hoverInfo(t){return t.x===void 0||t.y===void 0?{show:!1,tile:void 0,lighthouse:void 0,players:[]}:{show:!0,tile:this.tileInfo(t.x,t.y),lighthouse:this.lighthouseInfo(t.x,t.y),players:this.playersInfo(t.x,t.y)}}tileInfo(t,s){return{x:t,y:s,type:this.board[s][t].type,energy:this.energy[s][t]}}lighthouseInfo(t,s){const i=this.lighthouses.find(r=>r.x==t&&r.y==s);if(i)return{id:i.id,energy:i.energy,ownerId:i.ownerId}}playersInfo(t,s){return this.players.filter(i=>i.x===t&&i.y===s).map(i=>({id:i.id,name:i.name,keys:i.keys}))}}const yr=(e,t,s)=>({title:e,subtitle:t,energy:s.energy,players:s.players,lighthouses:s.lighthouses});class Sx{constructor(t,s){Bt(this,"tick");Bt(this,"cursor");Bt(this,"frames");Bt(this,"forward",!0);Bt(this,"tileset");Bt(this,"ticker");Bt(this,"status");this.game=t,this.speed=s,this.tick=this.speed,this.cursor=0,this.frames=[yr("Game Start","",this.game.state),...this.game.rounds.flatMap(i=>[yr(i.name,"Start",i.state),...i.turns.map(r=>yr(i.name,r.name,r.state))]),yr("Game End","",this.game.finalState)],this.status=Ls(new wx(this.frames[0],this.game.board))}init(t,s){this.tileset=t,this.ticker=s,this.ticker.add(()=>{var i;this.status.value.started=!0,!(--this.tick>0)&&(this.tick=vx-this.speed*2,this.next()||((i=this.ticker)==null||i.stop(),this.status.value.started=!1))})}get scoreboard(){return this.currFrame.players.sort((t,s)=>s.score-t.score)}set frame(t){this.pause(),this.cursor=t,this.sync()}get frame(){return this.cursor}restart(){this.cursor=0,this.sync(),this.pause()}play(){var t;this.status.value.started=!0,(t=this.ticker)==null||t.start()}pause(){var t;this.status.value.started=!1,(t=this.ticker)==null||t.stop()}next(){return this.nextFrame?this.sync():!1}prev(){return this.prevFrame?this.sync():!1}sync(){var t;return Object.assign(this.status.value,this.currFrame),(t=this.tileset)==null?void 0:t.render(this.currFrame)}get currFrame(){return this.frames[this.cursor]}get nextFrame(){return this.isEnd?!1:this.frames[++this.cursor]}get prevFrame(){return this.isStart?!1:this.frames[--this.cursor]}get isStart(){return this.cursor===0}get isEnd(){return this.cursor===this.frames.length-1}}function xr(e){return[null,void 0,!1].indexOf(e)!==-1}function Cx(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Ku(e){var t={exports:{}};return e(t,t.exports),t.exports}var mc=Ku(function(e,t){e.exports=function(){var s=["decimals","thousand","mark","prefix","suffix","encoder","decoder","negativeBefore","negative","edit","undo"];function i(d){return d.split("").reverse().join("")}function r(d,y){return d.substring(0,y.length)===y}function n(d,y){return d.slice(-1*y.length)===y}function o(d,y,g){if((d[y]||d[g])&&d[y]===d[g])throw new Error(y)}function a(d){return typeof d=="number"&&isFinite(d)}function l(d,y){return d=d.toString().split("e"),(+((d=(d=Math.round(+(d[0]+"e"+(d[1]?+d[1]+y:y)))).toString().split("e"))[0]+"e"+(d[1]?+d[1]-y:-y))).toFixed(y)}function h(d,y,g,v,w,A,M,I,N,V,G,P){var k,tt,H,j=P,Y="",Z="";return A&&(P=A(P)),!!a(P)&&(d!==!1&&parseFloat(P.toFixed(d))===0&&(P=0),P<0&&(k=!0,P=Math.abs(P)),d!==!1&&(P=l(P,d)),(P=P.toString()).indexOf(".")!==-1?(H=(tt=P.split("."))[0],g&&(Y=g+tt[1])):H=P,y&&(H=i(H).match(/.{1,3}/g),H=i(H.join(i(y)))),k&&I&&(Z+=I),v&&(Z+=v),k&&N&&(Z+=N),Z+=H,Z+=Y,w&&(Z+=w),V&&(Z=V(Z,j)),Z)}function c(d,y,g,v,w,A,M,I,N,V,G,P){var k,tt="";return G&&(P=G(P)),!(!P||typeof P!="string")&&(I&&r(P,I)&&(P=P.replace(I,""),k=!0),v&&r(P,v)&&(P=P.replace(v,"")),N&&r(P,N)&&(P=P.replace(N,""),k=!0),w&&n(P,w)&&(P=P.slice(0,-1*w.length)),y&&(P=P.split(y).join("")),g&&(P=P.replace(g,".")),k&&(tt+="-"),(tt=(tt+=P).replace(/[^0-9\.\-.]/g,""))!==""&&(tt=Number(tt),M&&(tt=M(tt)),!!a(tt)&&tt))}function u(d){var y,g,v,w={};for(d.suffix===void 0&&(d.suffix=d.postfix),y=0;y=0&&v<8))throw new Error(g);w[g]=v}else if(g==="encoder"||g==="decoder"||g==="edit"||g==="undo"){if(typeof v!="function")throw new Error(g);w[g]=v}else{if(typeof v!="string")throw new Error(g);w[g]=v}return o(w,"mark","thousand"),o(w,"prefix","negative"),o(w,"prefix","negativeBefore"),w}function f(d,y,g){var v,w=[];for(v=0;v0&&(g(x,p),setTimeout(function(){v(x,p)},B))}function m(x){return Math.max(Math.min(x,100),0)}function d(x){return Array.isArray(x)?x:[x]}function y(x){var p=(x=String(x)).split(".");return p.length>1?p[1].length:0}function g(x,p){x.classList&&!/\s/.test(p)?x.classList.add(p):x.className+=" "+p}function v(x,p){x.classList&&!/\s/.test(p)?x.classList.remove(p):x.className=x.className.replace(new RegExp("(^|\\b)"+p.split(" ").join("|")+"(\\b|$)","gi")," ")}function w(x,p){return x.classList?x.classList.contains(p):new RegExp("\\b"+p+"\\b").test(x.className)}function A(x){var p=window.pageXOffset!==void 0,B=(x.compatMode||"")==="CSS1Compat";return{x:p?window.pageXOffset:B?x.documentElement.scrollLeft:x.body.scrollLeft,y:p?window.pageYOffset:B?x.documentElement.scrollTop:x.body.scrollTop}}function M(){return window.navigator.pointerEnabled?{start:"pointerdown",move:"pointermove",end:"pointerup"}:window.navigator.msPointerEnabled?{start:"MSPointerDown",move:"MSPointerMove",end:"MSPointerUp"}:{start:"mousedown touchstart",move:"mousemove touchmove",end:"mouseup touchend"}}function I(){var x=!1;try{var p=Object.defineProperty({},"passive",{get:function(){x=!0}});window.addEventListener("test",null,p)}catch{}return x}function N(){return window.CSS&&CSS.supports&&CSS.supports("touch-action","none")}function V(x,p){return 100/(p-x)}function G(x,p,B){return 100*p/(x[B+1]-x[B])}function P(x,p){return G(x,x[0]<0?p+Math.abs(x[0]):p-x[0],0)}function k(x,p){return p*(x[1]-x[0])/100+x[0]}function tt(x,p){for(var B=1;x>=p[B];)B+=1;return B}function H(x,p,B){if(B>=x.slice(-1)[0])return 100;var q=tt(B,x),U=x[q-1],ot=x[q],St=p[q-1],_t=p[q];return St+P([U,ot],B)/V(St,_t)}function j(x,p,B){if(B>=100)return x.slice(-1)[0];var q=tt(B,p),U=x[q-1],ot=x[q],St=p[q-1];return k([U,ot],(B-St)*V(St,p[q]))}function Y(x,p,B,q){if(q===100)return q;var U=tt(q,x),ot=x[U-1],St=x[U];return B?q-ot>(St-ot)/2?St:ot:p[U-1]?x[U-1]+h(q-x[U-1],p[U-1]):q}var Z,rt;s.PipsMode=void 0,(rt=s.PipsMode||(s.PipsMode={})).Range="range",rt.Steps="steps",rt.Positions="positions",rt.Count="count",rt.Values="values",s.PipsType=void 0,(Z=s.PipsType||(s.PipsType={}))[Z.None=-1]="None",Z[Z.NoValue=0]="NoValue",Z[Z.LargeValue=1]="LargeValue",Z[Z.SmallValue=2]="SmallValue";var ft=function(){function x(p,B,q){var U;this.xPct=[],this.xVal=[],this.xSteps=[],this.xNumSteps=[],this.xHighestCompleteStep=[],this.xSteps=[q||!1],this.xNumSteps=[!1],this.snap=B;var ot=[];for(Object.keys(p).forEach(function(St){ot.push([d(p[St]),St])}),ot.sort(function(St,_t){return St[0][0]-_t[0][0]}),U=0;Uthis.xPct[ot+1];)ot++;else p===this.xPct[this.xPct.length-1]&&(ot=this.xPct.length-2);q||p!==this.xPct[ot+1]||ot++,B===null&&(B=[]);var St=1,_t=B[ot],bt=0,Pe=0,Jt=0,dt=0;for(U=q?(p-this.xPct[ot])/(this.xPct[ot+1]-this.xPct[ot]):(this.xPct[ot+1]-p)/(this.xPct[ot+1]-this.xPct[ot]);_t>0;)bt=this.xPct[ot+1+dt]-this.xPct[ot+dt],B[ot+dt]*St+100-100*U>100?(Pe=bt*U,St=(_t-100*U)/B[ot+dt],U=1):(Pe=B[ot+dt]*bt/100*St,St=0),q?(Jt-=Pe,this.xPct.length+dt>=1&&dt--):(Jt+=Pe,this.xPct.length-dt>=1&&dt++),_t=B[ot+dt]*St;return p+Jt},x.prototype.toStepping=function(p){return p=H(this.xVal,this.xPct,p)},x.prototype.fromStepping=function(p){return j(this.xVal,this.xPct,p)},x.prototype.getStep=function(p){return p=Y(this.xPct,this.xSteps,this.snap,p)},x.prototype.getDefaultStep=function(p,B,q){var U=tt(p,this.xPct);return(p===100||B&&p===this.xPct[U-1])&&(U=Math.max(U-1,1)),(this.xVal[U]-this.xVal[U-1])/q},x.prototype.getNearbySteps=function(p){var B=tt(p,this.xPct);return{stepBefore:{startValue:this.xVal[B-2],step:this.xNumSteps[B-2],highestStep:this.xHighestCompleteStep[B-2]},thisStep:{startValue:this.xVal[B-1],step:this.xNumSteps[B-1],highestStep:this.xHighestCompleteStep[B-1]},stepAfter:{startValue:this.xVal[B],step:this.xNumSteps[B],highestStep:this.xHighestCompleteStep[B]}}},x.prototype.countStepDecimals=function(){var p=this.xNumSteps.map(y);return Math.max.apply(null,p)},x.prototype.hasNoSize=function(){return this.xVal[0]===this.xVal[this.xVal.length-1]},x.prototype.convert=function(p){return this.getStep(this.toStepping(p))},x.prototype.handleEntryPoint=function(p,B){var q;if(!u(q=p==="min"?0:p==="max"?100:parseFloat(p))||!u(B[0]))throw new Error("noUiSlider: 'range' value isn't numeric.");this.xPct.push(q),this.xVal.push(B[0]);var U=Number(B[1]);q?this.xSteps.push(!isNaN(U)&&U):isNaN(U)||(this.xSteps[0]=U),this.xHighestCompleteStep.push(0)},x.prototype.handleStepPoint=function(p,B){if(B)if(this.xVal[p]!==this.xVal[p+1]){this.xSteps[p]=G([this.xVal[p],this.xVal[p+1]],B,0)/V(this.xPct[p],this.xPct[p+1]);var q=(this.xVal[p+1]-this.xVal[p])/this.xNumSteps[p],U=Math.ceil(Number(q.toFixed(3))-1),ot=this.xVal[p]+this.xNumSteps[p]*U;this.xHighestCompleteStep[p]=ot}else this.xSteps[p]=this.xHighestCompleteStep[p]=this.xVal[p]},x}(),yt={to:function(x){return x===void 0?"":x.toFixed(2)},from:Number},Q={target:"target",base:"base",origin:"origin",handle:"handle",handleLower:"handle-lower",handleUpper:"handle-upper",touchArea:"touch-area",horizontal:"horizontal",vertical:"vertical",background:"background",connect:"connect",connects:"connects",ltr:"ltr",rtl:"rtl",textDirectionLtr:"txt-dir-ltr",textDirectionRtl:"txt-dir-rtl",draggable:"draggable",drag:"state-drag",tap:"state-tap",active:"active",tooltip:"tooltip",pips:"pips",pipsHorizontal:"pips-horizontal",pipsVertical:"pips-vertical",marker:"marker",markerHorizontal:"marker-horizontal",markerVertical:"marker-vertical",markerNormal:"marker-normal",markerLarge:"marker-large",markerSub:"marker-sub",value:"value",valueHorizontal:"value-horizontal",valueVertical:"value-vertical",valueNormal:"value-normal",valueLarge:"value-large",valueSub:"value-sub"},et={tooltips:".__tooltips",aria:".__aria"};function Dt(x,p){if(!u(p))throw new Error("noUiSlider: 'step' is not numeric.");x.singleStep=p}function ct(x,p){if(!u(p))throw new Error("noUiSlider: 'keyboardPageMultiplier' is not numeric.");x.keyboardPageMultiplier=p}function qt(x,p){if(!u(p))throw new Error("noUiSlider: 'keyboardMultiplier' is not numeric.");x.keyboardMultiplier=p}function fe(x,p){if(!u(p))throw new Error("noUiSlider: 'keyboardDefaultStep' is not numeric.");x.keyboardDefaultStep=p}function Ft(x,p){if(typeof p!="object"||Array.isArray(p))throw new Error("noUiSlider: 'range' is not an object.");if(p.min===void 0||p.max===void 0)throw new Error("noUiSlider: Missing 'min' or 'max' in 'range'.");x.spectrum=new ft(p,x.snap||!1,x.singleStep)}function it(x,p){if(p=d(p),!Array.isArray(p)||!p.length)throw new Error("noUiSlider: 'start' option is incorrect.");x.handles=p.length,x.start=p}function wt(x,p){if(typeof p!="boolean")throw new Error("noUiSlider: 'snap' option must be a boolean.");x.snap=p}function Ie(x,p){if(typeof p!="boolean")throw new Error("noUiSlider: 'animate' option must be a boolean.");x.animate=p}function Le(x,p){if(typeof p!="number")throw new Error("noUiSlider: 'animationDuration' option must be a number.");x.animationDuration=p}function Ne(x,p){var B,q=[!1];if(p==="lower"?p=[!0,!1]:p==="upper"&&(p=[!1,!0]),p===!0||p===!1){for(B=1;B1)throw new Error("noUiSlider: 'padding' option must not exceed 100% of the range.")}}function E(x,p){switch(p){case"ltr":x.dir=0;break;case"rtl":x.dir=1;break;default:throw new Error("noUiSlider: 'direction' option was not recognized.")}}function O(x,p){if(typeof p!="string")throw new Error("noUiSlider: 'behaviour' must be a string containing options.");var B=p.indexOf("tap")>=0,q=p.indexOf("drag")>=0,U=p.indexOf("fixed")>=0,ot=p.indexOf("snap")>=0,St=p.indexOf("hover")>=0,_t=p.indexOf("unconstrained")>=0,bt=p.indexOf("drag-all")>=0,Pe=p.indexOf("smooth-steps")>=0;if(U){if(x.handles!==2)throw new Error("noUiSlider: 'fixed' behaviour must be used with 2 handles");De(x,x.start[1]-x.start[0])}if(_t&&(x.margin||x.limit))throw new Error("noUiSlider: 'unconstrained' behaviour cannot be used with margin or limit");x.events={tap:B||ot,drag:q,dragAll:bt,smoothSteps:Pe,fixed:U,snap:ot,hover:St,unconstrained:_t}}function R(x,p){if(p!==!1)if(p===!0||r(p)){x.tooltips=[];for(var B=0;B= 2) required for mode 'count'.");for(var C=b.values-1,T=100/C,L=[];C--;)L[C]=C*T;return L.push(100),Ca(L,b.stepped)}return b.mode===s.PipsMode.Positions?Ca(b.values,b.stepped):b.mode===s.PipsMode.Values?b.stepped?b.values.map(function(K){return dt.fromStepping(dt.getStep(dt.toStepping(K)))}):b.values:[]}function Ca(b,C){return b.map(function(T){return dt.fromStepping(C?dt.getStep(T):T)})}function nf(b){function C($t,It){return Number(($t+It).toFixed(7))}var T=rf(b),L={},K=dt.xVal[0],X=dt.xVal[dt.xVal.length-1],pt=!1,st=!1,zt=0;return(T=l(T.slice().sort(function($t,It){return $t-It})))[0]!==K&&(T.unshift(K),pt=!0),T[T.length-1]!==X&&(T.push(X),st=!0),T.forEach(function($t,It){var Nt,At,te,de,Wt,Fa,hn,Ba,Oa,La,un=$t,zs=T[It+1],Na=b.mode===s.PipsMode.Steps;for(Na&&(Nt=dt.xNumSteps[It]),Nt||(Nt=zs-un),zs===void 0&&(zs=un),Nt=Math.max(Nt,1e-7),At=un;At<=zs;At=C(At,Nt)){for(Ba=(Wt=(de=dt.toStepping(At))-zt)/(b.density||1),La=Wt/(Oa=Math.round(Ba)),te=1;te<=Oa;te+=1)L[(Fa=zt+te*La).toFixed(5)]=[dt.fromStepping(Fa),0];hn=T.indexOf(At)>-1?s.PipsType.LargeValue:Na?s.PipsType.SmallValue:s.PipsType.NoValue,!It&&pt&&At!==zs&&(hn=0),At===zs&&st||(L[de.toFixed(5)]=[At,hn]),zt=de}}),L}function of(b,C,T){var L,K,X=Hs.createElement("div"),pt=((L={})[s.PipsType.None]="",L[s.PipsType.NoValue]=p.cssClasses.valueNormal,L[s.PipsType.LargeValue]=p.cssClasses.valueLarge,L[s.PipsType.SmallValue]=p.cssClasses.valueSub,L),st=((K={})[s.PipsType.None]="",K[s.PipsType.NoValue]=p.cssClasses.markerNormal,K[s.PipsType.LargeValue]=p.cssClasses.markerLarge,K[s.PipsType.SmallValue]=p.cssClasses.markerSub,K),zt=[p.cssClasses.valueHorizontal,p.cssClasses.valueVertical],$t=[p.cssClasses.markerHorizontal,p.cssClasses.markerVertical];function It(At,te){var de=te===p.cssClasses.value,Wt=de?pt:st;return te+" "+(de?zt:$t)[p.ort]+" "+Wt[At]}function Nt(At,te,de){if((de=C?C(te,de):de)!==s.PipsType.None){var Wt=Ze(X,!1);Wt.className=It(de,p.cssClasses.marker),Wt.style[p.style]=At+"%",de>s.PipsType.NoValue&&((Wt=Ze(X,!1)).className=It(de,p.cssClasses.value),Wt.setAttribute("data-value",String(te)),Wt.style[p.style]=At+"%",Wt.innerHTML=String(T.to(te)))}}return g(X,p.cssClasses.pips),g(X,p.ort===0?p.cssClasses.pipsHorizontal:p.cssClasses.pipsVertical),Object.keys(b).forEach(function(At){Nt(At,b[At][0],b[At][1])}),X}function sn(){St&&(n(St),St=null)}function rn(b){sn();var C=nf(b),T=b.filter,L=b.format||{to:function(K){return String(Math.round(K))}};return St=Jt.appendChild(of(C,T,L))}function Ma(){var b=q.getBoundingClientRect(),C="offset"+["Width","Height"][p.ort];return p.ort===0?b.width||q[C]:b.height||q[C]}function Ms(b,C,T,L){var K=function(pt){var st=af(pt,L.pageOffset,L.target||C);return!!st&&!(wa()&&!L.doNotReject)&&!(w(Jt,p.cssClasses.tap)&&!L.doNotReject)&&!(b===bt.start&&st.buttons!==void 0&&st.buttons>1)&&(!L.hover||!st.buttons)&&(Pe||st.preventDefault(),st.calcPoint=st.points[p.ort],void T(st,L))},X=[];return b.split(" ").forEach(function(pt){C.addEventListener(pt,K,!!Pe&&{passive:!0}),X.push([pt,K])}),X}function af(b,C,T){var L=b.type.indexOf("touch")===0,K=b.type.indexOf("mouse")===0,X=b.type.indexOf("pointer")===0,pt=0,st=0;if(b.type.indexOf("MSPointer")===0&&(X=!0),b.type==="mousedown"&&!b.buttons&&!b.touches)return!1;if(L){var zt=function(Nt){var At=Nt.target;return At===T||T.contains(At)||b.composed&&b.composedPath().shift()===T};if(b.type==="touchstart"){var $t=Array.prototype.filter.call(b.touches,zt);if($t.length>1)return!1;pt=$t[0].pageX,st=$t[0].pageY}else{var It=Array.prototype.find.call(b.changedTouches,zt);if(!It)return!1;pt=It.pageX,st=It.pageY}}return C=C||A(Hs),(K||X)&&(pt=b.clientX+C.x,st=b.clientY+C.y),b.pageOffset=C,b.points=[pt,st],b.cursor=K||X,b}function Aa(b){var C=100*(b-c(q,p.ort))/Ma();return C=m(C),p.dir?100-C:C}function lf(b){var C=100,T=!1;return U.forEach(function(L,K){if(!tn(K)){var X=Gt[K],pt=Math.abs(X-b);(ptX||pt===100&&C===100)&&(T=K,C=pt)}}),T}function cf(b,C){b.type==="mouseout"&&b.target.nodeName==="HTML"&&b.relatedTarget===null&&nn(b,C)}function hf(b,C){if(navigator.appVersion.indexOf("MSIE 9")===-1&&b.buttons===0&&C.buttonsProperty!==0)return nn(b,C);var T=(p.dir?-1:1)*(b.calcPoint-C.startCalcPoint);Pa(T>0,100*T/C.baseSize,C.locations,C.handleNumbers,C.connect)}function nn(b,C){C.handle&&(v(C.handle,p.cssClasses.active),Jr-=1),C.listeners.forEach(function(T){qi.removeEventListener(T[0],T[1])}),Jr===0&&(v(Jt,p.cssClasses.drag),cn(),b.cursor&&(Ki.style.cursor="",Ki.removeEventListener("selectstart",a))),p.events.smoothSteps&&(C.handleNumbers.forEach(function(T){As(T,Gt[T],!0,!0,!1,!1)}),C.handleNumbers.forEach(function(T){Ht("update",T)})),C.handleNumbers.forEach(function(T){Ht("change",T),Ht("set",T),Ht("end",T)})}function on(b,C){if(!C.handleNumbers.some(tn)){var T;C.handleNumbers.length===1&&(T=U[C.handleNumbers[0]].children[0],Jr+=1,g(T,p.cssClasses.active)),b.stopPropagation();var L=[],K=Ms(bt.move,qi,hf,{target:b.target,handle:T,connect:C.connect,listeners:L,startCalcPoint:b.calcPoint,baseSize:Ma(),pageOffset:b.pageOffset,handleNumbers:C.handleNumbers,buttonsProperty:b.buttons,locations:Gt.slice()}),X=Ms(bt.end,qi,nn,{target:b.target,handle:T,listeners:L,doNotReject:!0,handleNumbers:C.handleNumbers}),pt=Ms("mouseout",qi,cf,{target:b.target,handle:T,listeners:L,doNotReject:!0,handleNumbers:C.handleNumbers});L.push.apply(L,K.concat(X,pt)),b.cursor&&(Ki.style.cursor=getComputedStyle(b.target).cursor,U.length>1&&g(Jt,p.cssClasses.drag),Ki.addEventListener("selectstart",a,!1)),C.handleNumbers.forEach(function(st){Ht("start",st)})}}function uf(b){b.stopPropagation();var C=Aa(b.calcPoint),T=lf(C);T!==!1&&(p.events.snap||f(Jt,p.cssClasses.tap,p.animationDuration),As(T,C,!0,!0),cn(),Ht("slide",T,!0),Ht("update",T,!0),p.events.snap?on(b,{handleNumbers:[T]}):(Ht("change",T,!0),Ht("set",T,!0)))}function ff(b){var C=Aa(b.calcPoint),T=dt.getStep(C),L=dt.fromStepping(T);Object.keys(Ke).forEach(function(K){K.split(".")[0]==="hover"&&Ke[K].forEach(function(X){X.call(Ji,L)})})}function df(b,C){if(wa()||tn(C))return!1;var T=["Left","Right"],L=["Down","Up"],K=["PageDown","PageUp"],X=["Home","End"];p.dir&&!p.ort?T.reverse():p.ort&&!p.dir&&(L.reverse(),K.reverse());var pt,st=b.key.replace("Arrow",""),zt=st===K[0],$t=st===K[1],It=st===L[0]||st===T[0]||zt,Nt=st===L[1]||st===T[1]||$t,At=st===X[0],te=st===X[1];if(!(It||Nt||At||te))return!0;if(b.preventDefault(),Nt||It){var de=It?0:1,Wt=Ra(C)[de];if(Wt===null)return!1;Wt===!1&&(Wt=dt.getDefaultStep(Gt[C],It,p.keyboardDefaultStep)),Wt*=$t||zt?p.keyboardPageMultiplier:p.keyboardMultiplier,Wt=Math.max(Wt,1e-7),Wt*=It?-1:1,pt=qe[C]+Wt}else pt=te?p.spectrum.xVal[p.spectrum.xVal.length-1]:p.spectrum.xVal[0];return As(C,dt.toStepping(pt),!0,!0),Ht("slide",C),Ht("update",C),Ht("change",C),Ht("set",C),!1}function pf(b){b.fixed||U.forEach(function(C,T){Ms(bt.start,C.children[0],on,{handleNumbers:[T]})}),b.tap&&Ms(bt.start,q,uf,{}),b.hover&&Ms(bt.move,q,ff,{hover:!0}),b.drag&&ot.forEach(function(C,T){if(C!==!1&&T!==0&&T!==ot.length-1){var L=U[T-1],K=U[T],X=[C],pt=[L,K],st=[T-1,T];g(C,p.cssClasses.draggable),b.fixed&&(X.push(L.children[0]),X.push(K.children[0])),b.dragAll&&(pt=U,st=ye),X.forEach(function(zt){Ms(bt.start,zt,on,{handles:pt,handleNumbers:st,connect:C})})}})}function an(b,C){Ke[b]=Ke[b]||[],Ke[b].push(C),b.split(".")[0]==="update"&&U.forEach(function(T,L){Ht("update",L)})}function mf(b){return b===et.aria||b===et.tooltips}function ci(b){var C=b&&b.split(".")[0],T=C?b.substring(C.length):b;Object.keys(Ke).forEach(function(L){var K=L.split(".")[0],X=L.substring(K.length);C&&C!==K||T&&T!==X||mf(X)&&T!==X||delete Ke[L]})}function Ht(b,C,T){Object.keys(Ke).forEach(function(L){var K=L.split(".")[0];b===K&&Ke[L].forEach(function(X){X.call(Ji,qe.map(p.format.to),C,qe.slice(),T||!1,Gt.slice(),Ji)})})}function Zi(b,C,T,L,K,X,pt){var st;return U.length>1&&!p.events.unconstrained&&(L&&C>0&&(st=dt.getAbsoluteDistance(b[C-1],p.margin,!1),T=Math.max(T,st)),K&&C1&&p.limit&&(L&&C>0&&(st=dt.getAbsoluteDistance(b[C-1],p.limit,!1),T=Math.min(T,st)),K&&C1?L.forEach(function(Nt,At){var te=Zi(X,Nt,X[Nt]+C,zt[At],$t[At],!1,st);te===!1?C=0:(C=te-X[Nt],X[Nt]=te)}):zt=$t=[!0];var It=!1;L.forEach(function(Nt,At){It=As(Nt,T[Nt]+C,zt[At],$t[At],!1,st)||It}),It&&(L.forEach(function(Nt){Ht("update",Nt),Ht("slide",Nt)}),K!=null&&Ht("drag",pt))}function Ta(b,C){return p.dir?100-b-C:b}function gf(b,C){Gt[b]=C,qe[b]=dt.fromStepping(C);var T="translate("+ln(Ta(C,0)-Zu+"%","0")+")";U[b].style[p.transformRule]=T,Ea(b),Ea(b+1)}function cn(){ye.forEach(function(b){var C=Gt[b]>50?-1:1,T=3+(U.length+C*b);U[b].style.zIndex=String(T)})}function As(b,C,T,L,K,X){return K||(C=Zi(Gt,b,C,T,L,!1,X)),C!==!1&&(gf(b,C),!0)}function Ea(b){if(ot[b]){var C=0,T=100;b!==0&&(C=Gt[b-1]),b!==ot.length-1&&(T=Gt[b]);var L=T-C,K="translate("+ln(Ta(C,L)+"%","0")+")",X="scale("+ln(L/100,"1")+")";ot[b].style[p.transformRule]=K+" "+X}}function ka(b,C){return b===null||b===!1||b===void 0?Gt[C]:(typeof b=="number"&&(b=String(b)),(b=p.format.from(b))!==!1&&(b=dt.toStepping(b)),b===!1||isNaN(b)?Gt[C]:b)}function Qi(b,C,T){var L=d(b),K=Gt[0]===void 0;C=C===void 0||C,p.animate&&!K&&f(Jt,p.cssClasses.tap,p.animationDuration),ye.forEach(function(st){As(st,ka(L[st],st),!0,!1,T)});var X=ye.length===1?0:1;if(K&&dt.hasNoSize()&&(T=!0,Gt[0]=0,ye.length>1)){var pt=100/(ye.length-1);ye.forEach(function(st){Gt[st]=st*pt})}for(;X=0&&bT.stepAfter.startValue&&(K=T.stepAfter.startValue-L),X=L>T.thisStep.startValue?T.thisStep.step:T.stepBefore.step!==!1&&L-T.stepBefore.highestStep,C===100?K=null:C===0&&(X=null);var pt=dt.countStepDecimals();return K!==null&&K!==!1&&(K=Number(K.toFixed(pt))),X!==null&&X!==!1&&(X=Number(X.toFixed(pt))),[X,K]}function bf(){return ye.map(Ra)}function vf(b,C){var T=Ia(),L=["margin","limit","padding","range","animate","snap","step","format","pips","tooltips"];L.forEach(function(X){b[X]!==void 0&&(B[X]=b[X])});var K=nt(B);L.forEach(function(X){b[X]!==void 0&&(p[X]=K[X])}),dt=K.spectrum,p.margin=K.margin,p.limit=K.limit,p.padding=K.padding,p.pips?rn(p.pips):sn(),p.tooltips?Sa():en(),Gt=[],Qi(o(b.start)?b.start:T,C)}function wf(){q=tf(Jt),Ju(p.connect,q),pf(p.events),Qi(p.start),p.pips&&rn(p.pips),p.tooltips&&Sa(),sf()}wf();var Ji={destroy:_f,steps:bf,on:an,off:ci,get:Ia,set:Qi,setHandle:xf,reset:yf,__moveHandles:function(b,C,T){Pa(b,C,Gt,T)},options:B,updateOptions:vf,target:Jt,removePips:sn,removeTooltips:en,getPositions:function(){return Gt.slice()},getTooltips:function(){return _t},getOrigins:function(){return U},pips:rn};return Ji}function xt(x,p){if(!x||!x.nodeName)throw new Error("noUiSlider: create requires a single element, got: "+x);if(x.noUiSlider)throw new Error("noUiSlider: Slider was already initialized.");var B=ht(x,nt(p),p);return x.noUiSlider=B,B}var Et={__spectrum:ft,cssClasses:Q,create:xt};s.create=xt,s.cssClasses=Q,s.default=Et,Object.defineProperty(s,"__esModule",{value:!0})})(t)}));function gc(e,t){if(!Array.isArray(e)||!Array.isArray(t))return!1;const s=t.slice().sort();return e.length===t.length&&e.slice().sort().every(function(i,r){return i===s[r]})}var Or={name:"Slider",emits:["input","update:modelValue","start","slide","drag","update","change","set","end"],props:{value:{validator:function(e){return t=>typeof t=="number"||t instanceof Array||t==null||t===!1},required:!1},modelValue:{validator:function(e){return t=>typeof t=="number"||t instanceof Array||t==null||t===!1},required:!1},id:{type:[String,Number],required:!1},disabled:{type:Boolean,required:!1,default:!1},min:{type:Number,required:!1,default:0},max:{type:Number,required:!1,default:100},step:{type:Number,required:!1,default:1},orientation:{type:String,required:!1,default:"horizontal"},direction:{type:String,required:!1,default:"ltr"},tooltips:{type:Boolean,required:!1,default:!0},options:{type:Object,required:!1,default:()=>({})},merge:{type:Number,required:!1,default:-1},format:{type:[Object,Function,Boolean],required:!1,default:null},classes:{type:Object,required:!1,default:()=>({})},showTooltip:{type:String,required:!1,default:"always"},tooltipPosition:{type:String,required:!1,default:null},lazy:{type:Boolean,required:!1,default:!0},ariaLabelledby:{type:String,required:!1,default:void 0},aria:{required:!1,type:Object,default:()=>({})}},setup(e,t){const s=function(o,a,l){const{value:h,modelValue:c,min:u}=sr(o);let f=c&&c.value!==void 0?c:h;const m=Ls(f.value);if(xr(f.value)&&(f=Ls(u.value)),Array.isArray(f.value)&&f.value.length==0)throw new Error("Slider v-model must not be an empty array");return{value:f,initialValue:m}}(e),i=function(o,a,l){const{classes:h,showTooltip:c,tooltipPosition:u,orientation:f}=sr(o),m=es(()=>({target:"slider-target",focused:"slider-focused",tooltipFocus:"slider-tooltip-focus",tooltipDrag:"slider-tooltip-drag",ltr:"slider-ltr",rtl:"slider-rtl",horizontal:"slider-horizontal",vertical:"slider-vertical",textDirectionRtl:"slider-txt-dir-rtl",textDirectionLtr:"slider-txt-dir-ltr",base:"slider-base",connects:"slider-connects",connect:"slider-connect",origin:"slider-origin",handle:"slider-handle",handleLower:"slider-handle-lower",handleUpper:"slider-handle-upper",touchArea:"slider-touch-area",tooltip:"slider-tooltip",tooltipTop:"slider-tooltip-top",tooltipBottom:"slider-tooltip-bottom",tooltipLeft:"slider-tooltip-left",tooltipRight:"slider-tooltip-right",tooltipHidden:"slider-tooltip-hidden",active:"slider-active",draggable:"slider-draggable",tap:"slider-state-tap",drag:"slider-state-drag",pips:"slider-pips",pipsHorizontal:"slider-pips-horizontal",pipsVertical:"slider-pips-vertical",marker:"slider-marker",markerHorizontal:"slider-marker-horizontal",markerVertical:"slider-marker-vertical",markerNormal:"slider-marker-normal",markerLarge:"slider-marker-large",markerSub:"slider-marker-sub",value:"slider-value",valueHorizontal:"slider-value-horizontal",valueVertical:"slider-value-vertical",valueNormal:"slider-value-normal",valueLarge:"slider-value-large",valueSub:"slider-value-sub",...h.value}));return{classList:es(()=>{const d={...m.value};return Object.keys(d).forEach(y=>{d[y]=Array.isArray(d[y])?d[y].filter(g=>g!==null).join(" "):d[y]}),c.value!=="always"&&(d.target+=` ${c.value==="drag"?d.tooltipDrag:d.tooltipFocus}`),f.value==="horizontal"&&(d.tooltip+=u.value==="bottom"?` ${d.tooltipBottom}`:` ${d.tooltipTop}`),f.value==="vertical"&&(d.tooltip+=u.value==="right"?` ${d.tooltipRight}`:` ${d.tooltipLeft}`),d})}}(e),r=function(o,a,l){const{format:h,step:c}=sr(o),u=l.value,f=l.classList,m=es(()=>h&&h.value?typeof h.value=="function"?{to:h.value}:mc({...h.value}):mc({decimals:c.value>=0?0:2})),d=es(()=>Array.isArray(u.value)?u.value.map(y=>m.value):m.value);return{tooltipFormat:m,tooltipsFormat:d,tooltipsMerge:(y,g,v)=>{var w=getComputedStyle(y).direction==="rtl",A=y.noUiSlider.options.direction==="rtl",M=y.noUiSlider.options.orientation==="vertical",I=y.noUiSlider.getTooltips(),N=y.noUiSlider.getOrigins();I.forEach(function(V,G){V&&N[G].appendChild(V)}),y.noUiSlider.on("update",function(V,G,P,k,tt){var H=[[]],j=[[]],Y=[[]],Z=0;I[0]&&(H[0][0]=0,j[0][0]=tt[0],Y[0][0]=m.value.to(parseFloat(V[0])));for(var rt=1;rtg)&&(H[++Z]=[],Y[Z]=[],j[Z]=[]),I[rt]&&(H[Z].push(rt),Y[Z].push(m.value.to(parseFloat(V[rt]))),j[Z].push(tt[rt]));H.forEach(function(ft,yt){for(var Q=ft.length,et=0;et{I[Dt].classList.contains(it)&&I[Dt].classList.remove(it)})}else I[Dt].style.display="none",f.value.tooltipHidden.split(" ").forEach(it=>{I[Dt].classList.add(it)})}})})}}}(e,0,{value:s.value,classList:i.classList}),n=function(o,a,l){const{orientation:h,direction:c,tooltips:u,step:f,min:m,max:d,merge:y,id:g,disabled:v,options:w,classes:A,format:M,lazy:I,ariaLabelledby:N,aria:V}=sr(o),G=l.value,P=l.initialValue,k=l.tooltipsFormat,tt=l.tooltipsMerge,H=l.tooltipFormat,j=l.classList,Y=Ls(null),Z=Ls(null),rt=Ls(!1),ft=es(()=>{let it={cssPrefix:"",cssClasses:j.value,orientation:h.value,direction:c.value,tooltips:!!u.value&&k.value,connect:"lower",start:xr(G.value)?m.value:G.value,range:{min:m.value,max:d.value}};if(f.value>0&&(it.step=f.value),Array.isArray(G.value)&&(it.connect=!0),N&&N.value||V&&Object.keys(V.value).length){let wt=Array.isArray(G.value)?G.value:[G.value];it.handleAttributes=wt.map(Ie=>Object.assign({},V.value,N&&N.value?{"aria-labelledby":N.value}:{}))}return M.value&&(it.ariaFormat=H.value),it}),yt=es(()=>{let it={id:g&&g.value?g.value:void 0};return v.value&&(it.disabled=!0),it}),Q=es(()=>Array.isArray(G.value)),et=()=>{let it=Z.value.get();return Array.isArray(it)?it.map(wt=>parseFloat(wt)):parseFloat(it)},Dt=function(it){let wt=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];Z.value.set(it,wt)},ct=it=>{a.emit("input",it),a.emit("update:modelValue",it),a.emit("update",it)},qt=()=>{Z.value=Mx.create(Y.value,Object.assign({},ft.value,w.value)),u.value&&Q.value&&y.value>=0&&tt(Y.value,y.value," - "),Z.value.on("set",()=>{const it=et();a.emit("change",it),a.emit("set",it),I.value&&ct(it)}),Z.value.on("update",()=>{if(!rt.value)return;const it=et();Q.value&&gc(G.value,it)||!Q.value&&G.value==it?a.emit("update",it):I.value||ct(it)}),Z.value.on("start",()=>{a.emit("start",et())}),Z.value.on("end",()=>{a.emit("end",et())}),Z.value.on("slide",()=>{a.emit("slide",et())}),Z.value.on("drag",()=>{a.emit("drag",et())}),Y.value.querySelectorAll("[data-handle]").forEach(it=>{it.onblur=()=>{Y.value&&j.value.focused.split(" ").forEach(wt=>{Y.value.classList.remove(wt)})},it.onfocus=()=>{j.value.focused.split(" ").forEach(wt=>{Y.value.classList.add(wt)})}}),rt.value=!0},fe=()=>{Z.value.off(),Z.value.destroy(),Z.value=null},Ft=(it,wt)=>{rt.value=!1,fe(),qt()};return ea(qt),sa(fe),ae(Q,Ft,{immediate:!1}),ae(m,Ft,{immediate:!1}),ae(d,Ft,{immediate:!1}),ae(f,Ft,{immediate:!1}),ae(h,Ft,{immediate:!1}),ae(c,Ft,{immediate:!1}),ae(u,Ft,{immediate:!1}),ae(y,Ft,{immediate:!1}),ae(M,Ft,{immediate:!1,deep:!0}),ae(w,Ft,{immediate:!1,deep:!0}),ae(A,Ft,{immediate:!1,deep:!0}),ae(G,(it,wt)=>{wt&&(typeof wt=="object"&&typeof it=="object"&&it&&Object.keys(wt)>Object.keys(it)||typeof wt=="object"&&typeof it!="object"||xr(it))&&Ft()},{immediate:!1}),ae(G,it=>{if(xr(it))return void Dt(m.value,!1);let wt=et();Q.value&&!Array.isArray(wt)&&(wt=[wt]),(Q.value&&!gc(it,wt)||!Q.value&&it!=wt)&&Dt(it,!1)},{deep:!0}),{slider:Y,slider$:Z,isRange:Q,sliderProps:yt,init:qt,destroy:fe,refresh:Ft,update:Dt,reset:()=>{ct(P.value)}}}(e,t,{value:s.value,initialValue:s.initialValue,tooltipFormat:r.tooltipFormat,tooltipsFormat:r.tooltipsFormat,tooltipsMerge:r.tooltipsMerge,classList:i.classList});return{...i,...r,...n}}};Or.render=function(e,t,s,i,r,n){return Kt(),ee("div",Ch(e.sliderProps,{ref:"slider"}),null,16)},Or.__file="src/Slider.vue";const Ax={class:"h-screen w-screen overflow-hidden bg-gray-950"},Px={key:"1",class:"flex h-full w-full items-center justify-center"},Tx={for:"file-dropzone",class:"relative flex cursor-pointer flex-col items-center justify-center overflow-visible rounded-lg border-2 border-gray-600 bg-gray-500"},Ex={class:"flex flex-col items-center justify-center space-y-4 p-6 text-slate-200"},kx={key:1,class:"flex h-full w-full bg-black text-slate-100"},Ix={class:"flex w-80 flex-col bg-[#0a1606]"},Rx=["src"],Fx={class:"flex grow flex-col justify-center"},Bx={class:"flex gap-3 text-xs"},Ox={class:"flex items-center gap-1 text-yellow-300"},Lx={class:"flex items-center gap-1 text-blue-300"},Nx={class:"flex items-center gap-1 text-wrap text-xs text-slate-400"},Dx={key:0},Ux={class:"flex grow flex-col bg-black py-4 text-slate-100"},Vx={class:"flex basis-1/12 flex-col justify-end text-center"},Gx={class:"font-bold"},$x={class:"basis-1/5 space-y-2 text-center"},Hx={class:"flex justify-center gap-8 pb-2"},zx={class:"mx-auto flex items-center justify-center gap-4 text-slate-400"},jx={class:"mx-auto flex items-center justify-center gap-4 text-slate-400"},Yx={key:0,class:"text-xs"},Wx={key:0},Xx={class:"flex items-center justify-center gap-2"},qx={class:"flex items-center gap-1 text-blue-300"},Kx={key:0,class:"flex items-center justify-center gap-2"},Zx={class:"flex items-center gap-1 text-blue-300"},Qx={class:"flex items-center justify-center gap-2 pt-1"},Jx={key:1},t1={key:1,class:"text-xs text-slate-500"},e1=Sd({__name:"App",setup(e){var t=["text-[#ff0000]","text-[#ff8700]","text-[#ffd300]","text-[#deff0a]","text-[#a1ff0a]","text-[#0aff99]","text-[#0aefff]","text-[#147df5]","text-[#580aff]","text-[#be0aff]","text-[#cccccc]"];const s=m=>m?t[m-1]:"text-slate-100";var i=Ls(!0),r={},n={},o={},a={},l={};const h=Cd("stageContainer"),c=Gr({x:void 0,y:void 0}),u=async m=>{const d=m.target;if(!d.files||d.files.length==0)return;const y=d.files[0],g=new FileReader;g.onload=async()=>{const v=JSON.parse(g.result);r=mx(v),n=new rx(r,c),o=new Sx(r,Vo),a=o.status,l=es(()=>a.value.hoverInfo(c)),i.value=!1},g.readAsText(y)},f=async()=>{if(!h.value){console.warn("Stage container not found");return}n.init(h.value,o)};return(m,d)=>(Kt(),ee("div",Ax,[Ct(Tp,{name:"fade",mode:"out-in",onAfterEnter:f},{default:lo(()=>{var y,g,v,w,A,M,I;return[gt(i)?(Kt(),ee("div",Px,[ut("label",Tx,[d[9]||(d[9]=ut("img",{alt:"Lighthouse logo",src:xl,class:"absolute -top-64 w-64"},null,-1)),ut("div",Ex,[Ct(_l,{class:"w-8"}),d[8]||(d[8]=ut("p",{class:"text-center"},[ut("span",{class:"text-white"},"Upload"),Sh(" a JSON game ")],-1))]),ut("input",{id:"file-dropzone",type:"file",class:"hidden",onChange:u},null,32)])])):(Kt(),ee("div",kx,[ut("div",Ix,[d[10]||(d[10]=ut("div",{class:"flex h-40 items-center justify-center border-b-2 border-[#12230d]"},[ut("img",{alt:"Lighthouse logo",src:xl,class:"h-28 w-28"})],-1)),Ct(qp,{name:"list",tag:"div",class:"flex flex-col gap-4 p-4 text-slate-100"},{default:lo(()=>[(Kt(!0),ee(xe,null,_n(gt(a).scoreboard,N=>(Kt(),ee("div",{class:"flex gap-4",key:N.id},[ut("img",{class:"w-12",alt:"Player avatar",src:`https://api.dicebear.com/8.x/bottts-neutral/svg?backgroundColor=${gt(px)(N.color)}&radius=25&seed=${N.id}`},null,8,Rx),ut("div",Fx,[ut("span",{class:ti(["text-sm font-bold",[gt(t)[N.id-1]]])},ve(N.name),3),ut("div",Bx,[ut("span",Ox,[Ct(lm,{class:"w-4"}),ut("span",null,ve(N.score),1)]),ut("span",Lx,[Ct(Pn,{class:"w-4"}),ut("span",null,ve(N.energy),1)])]),ut("div",Nx,[Ct(am,{class:"w-4"}),N.keys.length==0?(Kt(),ee("span",Dx,"No keys")):(Kt(!0),ee(xe,{key:1},_n(N.keys,V=>(Kt(),ee("span",null,ve(V),1))),256))])])]))),128))]),_:1})]),ut("div",Ux,[ut("div",Vx,[ut("p",Gx,ve(gt(a).title),1),ut("p",null,ve(gt(a).subtitle),1)]),ut("div",{ref_key:"stageContainer",ref:h,class:"relative w-full grow"},null,512),ut("div",$x,[ut("div",Hx,[ut("button",{onClick:d[0]||(d[0]=(...N)=>gt(o).restart&>(o).restart(...N)),title:"Restart"},[Ct(um)]),ut("button",{onClick:d[1]||(d[1]=(...N)=>gt(o).prev&>(o).prev(...N)),title:"Previous Frame"},[Ct(fm)]),gt(a).started?(Kt(),ee("button",{key:0,onClick:d[2]||(d[2]=(...N)=>gt(o).pause&>(o).pause(...N)),title:"Pause"},[Ct(cm)])):(Kt(),ee("button",{key:1,onClick:d[3]||(d[3]=(...N)=>gt(o).play&>(o).play(...N)),title:"Play"},[Ct(hm)])),ut("button",{onClick:d[4]||(d[4]=(...N)=>gt(o).next&>(o).next(...N)),title:"Next Frame"},[Ct(dm)]),ut("button",{title:"Load new game",onClick:d[5]||(d[5]=N=>re(i)?i.value=!0:i=!0)},[Ct(_l)])]),ut("div",zx,[d[11]||(d[11]=ut("span",null,"Slower",-1)),Ct(gt(Or),{modelValue:gt(o).speed,"onUpdate:modelValue":d[6]||(d[6]=N=>gt(o).speed=N),min:1,max:gt(Vo),lazy:!1,tooltips:!1,class:"w-40"},null,8,["modelValue","max"]),d[12]||(d[12]=ut("span",null,"Faster",-1))]),ut("div",jx,[d[13]||(d[13]=ut("span",null,"Frame",-1)),Ct(gt(Or),{modelValue:gt(o).frame,"onUpdate:modelValue":d[7]||(d[7]=N=>gt(o).frame=N),min:0,max:gt(o).frames.length-1,lazy:!1,tooltips:!1,disabled:gt(a).started,class:"w-80"},null,8,["modelValue","max","disabled"])]),gt(l).show?(Kt(),ee("div",Yx,[((y=gt(l).tile)==null?void 0:y.type)==gt(Di).Ground?(Kt(),ee("div",Wx,[ut("div",Xx,[ut("span",null,"Tile("+ve((g=gt(l).tile)==null?void 0:g.x)+","+ve((v=gt(l).tile)==null?void 0:v.y)+")",1),ut("div",qx,[Ct(Pn,{class:"w-3"}),ut("span",null,ve((w=gt(l).tile)==null?void 0:w.energy),1)])]),gt(l).lighthouse?(Kt(),ee("div",Kx,[ut("span",{class:ti([s((A=gt(l).lighthouse)==null?void 0:A.ownerId)])},"Lighthouse("+ve((M=gt(l).lighthouse)==null?void 0:M.id)+")",3),ut("div",Zx,[Ct(Pn,{class:"w-3"}),ut("span",null,ve((I=gt(l).lighthouse)==null?void 0:I.energy),1)])])):pp("",!0),ut("div",Qx,[(Kt(!0),ee(xe,null,_n(gt(l).players,N=>(Kt(),ee("span",{class:ti(["font-bold",[gt(t)[N.id-1]]]),key:N.id},ve(N.name),3))),128))])])):(Kt(),ee("p",Jx,"Water tile"))])):(Kt(),ee("div",t1," Hover over a tile to check its data "))])])]))]}),_:1})]))}}),s1=(e,t)=>{const s=e.__vccOpts||e;for(const[i,r]of t)s[i]=r;return s},i1=s1(e1,[["__scopeId","data-v-638ad12b"]]),r1=sm(i1);r1.mount("#app");export{Tu as $,Pu as A,_e as B,oe as C,bs as D,Tt as E,$g as F,li as G,Yh as H,Ye as I,Fl as J,Ui as K,Rg as L,Pt as M,zg as N,Qt as O,ue as P,ne as Q,Mo as R,Gg as S,cs as T,wo as U,l0 as V,Ol as W,cg as X,Nn as Y,ge as Z,Xh as _,Ot as a,Xt as a0,Zt as a1,d0 as a2,L0 as a3,ey as a4,iy as a5,ly as a6,hy as a7,uy as a8,gi as a9,wi as aa,fc as ab,p0 as ac,m0 as ad,ua as ae,Ks as af,oi as ag,Hu as ah,Wl as ai,jl as aj,Om as ak,We as al,Nm as am,ju as an,_i as b,ls as c,k0 as d,Xe as e,Yl as f,P0 as g,zi as h,wr as i,fa as j,Cu as k,nu as l,da as m,o1 as n,ty as o,sy as p,oy as q,qm as r,Fu as s,cy as t,qr as u,Lm as v,je as w,Xr as x,dy as y,rs as z}; diff --git a/front/dist/assets/index-D00qmZF7.css b/front/dist/assets/index-DlXr-n9N.css similarity index 98% rename from front/dist/assets/index-D00qmZF7.css rename to front/dist/assets/index-DlXr-n9N.css index c4bda3c..7f23532 100644 --- a/front/dist/assets/index-D00qmZF7.css +++ b/front/dist/assets/index-DlXr-n9N.css @@ -1 +1 @@ -.slider-target,.slider-target *{-webkit-touch-callout:none;-webkit-tap-highlight-color:rgba(0,0,0,0);box-sizing:border-box;touch-action:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.slider-target{position:relative}.slider-base,.slider-connects{height:100%;position:relative;width:100%;z-index:1}.slider-connects{overflow:hidden;z-index:0}.slider-connect,.slider-origin{height:100%;position:absolute;right:0;top:0;transform-origin:0 0;transform-style:flat;width:100%;will-change:transform;z-index:1}.slider-txt-dir-rtl.slider-horizontal .slider-origin{left:0;right:auto}.slider-vertical .slider-origin{top:-100%;width:0}.slider-horizontal .slider-origin{height:0}.slider-handle{backface-visibility:hidden;position:absolute}.slider-touch-area{height:100%;width:100%}.slider-state-tap .slider-connect,.slider-state-tap .slider-origin{transition:transform .3s}.slider-state-drag *{cursor:inherit!important}.slider-tooltip-drag .slider-tooltip,.slider-tooltip-focus .slider-tooltip{display:none!important}.slider-tooltip-drag .slider-active .slider-tooltip,.slider-tooltip-drag.slider-state-drag .slider-tooltip:not(.slider-tooltip-hidden),.slider-tooltip-focus.slider-focused .slider-tooltip:not(.slider-tooltip-hidden){display:block!important}.slider-horizontal{height:var(--slider-height,6px)}.slider-horizontal .slider-handle{height:var(--slider-handle-height,16px);right:calc(var(--slider-handle-width, 16px)/2*-1);top:calc((var(--slider-handle-height, 16px) - var(--slider-height, 6px))/2*-1 + -1px);width:var(--slider-handle-width,16px)}.slider-vertical{height:var(--slider-vertical-height,300px);width:var(--slider-height,6px)}.slider-vertical .slider-handle{bottom:calc(var(--slider-handle-width, 16px)/2*-1);height:var(--slider-handle-width,16px);right:calc((var(--slider-handle-height, 16px) - var(--slider-height, 6px))/2*-1 + -1px);width:var(--slider-handle-height,16px)}.slider-txt-dir-rtl.slider-horizontal .slider-handle{left:calc(var(--slider-handle-width, 16px)/2*-1);right:auto}.slider-base{background-color:var(--slider-bg,#d1d5db)}.slider-base,.slider-connects{border-radius:var(--slider-radius,9999px)}.slider-connect{background:var(--slider-connect-bg,#10b981);cursor:pointer}.slider-draggable{cursor:ew-resize}.slider-vertical .slider-draggable{cursor:ns-resize}.slider-handle{background:var(--slider-handle-bg,#fff);border:var(--slider-handle-border,0);border-radius:var(--slider-handle-radius,9999px);box-shadow:var(--slider-handle-shadow,.5px .5px 2px 1px rgba(0,0,0,.32));cursor:grab;height:var(--slider-handle-height,16px);width:var(--slider-handle-width,16px)}.slider-handle:focus{box-shadow:0 0 0 var(--slider-handle-ring-width,3px) var(--slider-handle-ring-color,rgba(16,185,129,.188)),var(--slider-handle-shadow,.5px .5px 2px 1px rgba(0,0,0,.32));outline:none}.slider-active{box-shadow:var(--slider-handle-shadow-active,.5px .5px 2px 1px rgba(0,0,0,.42));cursor:grabbing}[disabled] .slider-connect{background:var(--slider-connect-bg-disabled,#9ca3af)}[disabled] .slider-handle,[disabled].slider-handle,[disabled].slider-target{cursor:not-allowed}[disabled] .slider-tooltip{background:var(--slider-tooltip-bg-disabled,#9ca3af);border-color:var(--slider-tooltip-bg-disabled,#9ca3af)}.slider-tooltip{background:var(--slider-tooltip-bg,#10b981);border:1px solid var(--slider-tooltip-bg,#10b981);border-radius:var(--slider-tooltip-radius,5px);color:var(--slider-tooltip-color,#fff);display:block;font-size:var(--slider-tooltip-font-size,.875rem);font-weight:var(--slider-tooltip-font-weight,600);line-height:var(--slider-tooltip-line-height,1.25rem);min-width:var(--slider-tooltip-min-width,20px);padding:var(--slider-tooltip-py,2px) var(--slider-tooltip-px,6px);position:absolute;text-align:center;white-space:nowrap}.slider-horizontal .slider-tooltip-top{bottom:calc(var(--slider-handle-height, 16px) + var(--slider-tooltip-arrow-size, 5px) + var(--slider-tooltip-distance, 3px));left:50%;transform:translate(-50%)}.slider-horizontal .slider-tooltip-top:before{border:var(--slider-tooltip-arrow-size,5px) solid transparent;border-top-color:inherit;bottom:calc(var(--slider-tooltip-arrow-size, 5px)*-2);content:"";height:0;left:50%;position:absolute;transform:translate(-50%);width:0}.slider-horizontal .slider-tooltip-bottom{left:50%;top:calc(var(--slider-handle-height, 16px) + var(--slider-tooltip-arrow-size, 5px) + var(--slider-tooltip-distance, 3px));transform:translate(-50%)}.slider-horizontal .slider-tooltip-bottom:before{border:var(--slider-tooltip-arrow-size,5px) solid transparent;border-bottom-color:inherit;content:"";height:0;left:50%;position:absolute;top:calc(var(--slider-tooltip-arrow-size, 5px)*-2);transform:translate(-50%);width:0}.slider-vertical .slider-tooltip-left{right:calc(var(--slider-handle-height, 16px) + var(--slider-tooltip-arrow-size, 5px) + var(--slider-tooltip-distance, 3px));top:50%;transform:translateY(-50%)}.slider-vertical .slider-tooltip-left:before{border:var(--slider-tooltip-arrow-size,5px) solid transparent;border-left-color:inherit;content:"";height:0;position:absolute;right:calc(var(--slider-tooltip-arrow-size, 5px)*-2);top:50%;transform:translateY(-50%);width:0}.slider-vertical .slider-tooltip-right{left:calc(var(--slider-handle-height, 16px) + var(--slider-tooltip-arrow-size, 5px) + var(--slider-tooltip-distance, 3px));top:50%;transform:translateY(-50%)}.slider-vertical .slider-tooltip-right:before{border:var(--slider-tooltip-arrow-size,5px) solid transparent;border-right-color:inherit;content:"";height:0;left:calc(var(--slider-tooltip-arrow-size, 5px)*-2);position:absolute;top:50%;transform:translateY(-50%);width:0}.slider-horizontal .slider-origin>.slider-tooltip{left:auto;transform:translate(50%)}.slider-horizontal .slider-origin>.slider-tooltip-top{bottom:calc(var(--slider-tooltip-arrow-size, 5px) + (var(--slider-handle-height, 16px) - var(--slider-height, 6px))/2 + var(--slider-tooltip-distance, 3px) + 1px)}.slider-horizontal .slider-origin>.slider-tooltip-bottom{top:calc(var(--slider-tooltip-arrow-size, 5px) + (var(--slider-handle-height, 16px) - var(--slider-height, 6px))/2 + var(--slider-tooltip-distance, 3px) + var(--slider-height, 6px) - 1px)}.slider-vertical .slider-origin>.slider-tooltip{top:auto;transform:translateY(calc((var(--slider-tooltip-line-height, 1.25rem) - var(--slider-tooltip-py, 2px))*-1 + 1px))}.slider-vertical .slider-origin>.slider-tooltip-left{right:calc(var(--slider-tooltip-arrow-size, 5px) + var(--slider-height, 6px) + (var(--slider-handle-height, 16px) - var(--slider-height, 6px))/2 + var(--slider-tooltip-distance, 3px) - 1px)}.slider-vertical .slider-origin>.slider-tooltip-right{left:calc(var(--slider-tooltip-arrow-size, 5px) + var(--slider-height, 6px) + (var(--slider-handle-height, 16px) - var(--slider-height, 6px))/2 + var(--slider-tooltip-distance, 3px) - var(--slider-height, 6px) + 1px)}.list-move[data-v-71b68733]{transition:all .5s ease}.fade-enter-active[data-v-71b68733],.fade-leave-active[data-v-71b68733]{transition:opacity .5s ease}.fade-enter-from[data-v-71b68733],.fade-leave-to[data-v-71b68733]{opacity:0}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.absolute{position:absolute}.relative{position:relative}.-top-64{top:-16rem}.mx-auto{margin-left:auto;margin-right:auto}.flex{display:flex}.hidden{display:none}.h-28{height:7rem}.h-40{height:10rem}.h-full{height:100%}.h-screen{height:100vh}.w-12{width:3rem}.w-28{width:7rem}.w-3{width:.75rem}.w-4{width:1rem}.w-40{width:10rem}.w-64{width:16rem}.w-8{width:2rem}.w-80{width:20rem}.w-full{width:100%}.w-screen{width:100vw}.grow{flex-grow:1}.basis-1\/12{flex-basis:8.333333%}.basis-1\/5{flex-basis:20%}.cursor-pointer{cursor:pointer}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-8{gap:2rem}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.text-wrap{text-wrap:wrap}.rounded-lg{border-radius:.5rem}.border-2{border-width:2px}.border-b-2{border-bottom-width:2px}.border-\[\#12230d\]{--tw-border-opacity: 1;border-color:rgb(18 35 13 / var(--tw-border-opacity))}.border-gray-600{--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity))}.bg-\[\#0a1606\]{--tw-bg-opacity: 1;background-color:rgb(10 22 6 / var(--tw-bg-opacity))}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity))}.bg-gray-500{--tw-bg-opacity: 1;background-color:rgb(107 114 128 / var(--tw-bg-opacity))}.bg-gray-950{--tw-bg-opacity: 1;background-color:rgb(3 7 18 / var(--tw-bg-opacity))}.p-4{padding:1rem}.p-6{padding:1.5rem}.py-4{padding-top:1rem;padding-bottom:1rem}.pb-2{padding-bottom:.5rem}.pt-1{padding-top:.25rem}.text-center{text-align:center}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.text-\[\#0aefff\]{--tw-text-opacity: 1;color:rgb(10 239 255 / var(--tw-text-opacity))}.text-\[\#0aff99\]{--tw-text-opacity: 1;color:rgb(10 255 153 / var(--tw-text-opacity))}.text-\[\#147df5\]{--tw-text-opacity: 1;color:rgb(20 125 245 / var(--tw-text-opacity))}.text-\[\#580aff\]{--tw-text-opacity: 1;color:rgb(88 10 255 / var(--tw-text-opacity))}.text-\[\#a1ff0a\]{--tw-text-opacity: 1;color:rgb(161 255 10 / var(--tw-text-opacity))}.text-\[\#be0aff\]{--tw-text-opacity: 1;color:rgb(190 10 255 / var(--tw-text-opacity))}.text-\[\#cccccc\]{--tw-text-opacity: 1;color:rgb(204 204 204 / var(--tw-text-opacity))}.text-\[\#deff0a\]{--tw-text-opacity: 1;color:rgb(222 255 10 / var(--tw-text-opacity))}.text-\[\#ff0000\]{--tw-text-opacity: 1;color:rgb(255 0 0 / var(--tw-text-opacity))}.text-\[\#ff8700\]{--tw-text-opacity: 1;color:rgb(255 135 0 / var(--tw-text-opacity))}.text-\[\#ffd300\]{--tw-text-opacity: 1;color:rgb(255 211 0 / var(--tw-text-opacity))}.text-blue-300{--tw-text-opacity: 1;color:rgb(147 197 253 / var(--tw-text-opacity))}.text-slate-100{--tw-text-opacity: 1;color:rgb(241 245 249 / var(--tw-text-opacity))}.text-slate-200{--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity))}.text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.text-yellow-300{--tw-text-opacity: 1;color:rgb(253 224 71 / var(--tw-text-opacity))}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s} +.slider-target,.slider-target *{-webkit-touch-callout:none;-webkit-tap-highlight-color:rgba(0,0,0,0);box-sizing:border-box;touch-action:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.slider-target{position:relative}.slider-base,.slider-connects{height:100%;position:relative;width:100%;z-index:1}.slider-connects{overflow:hidden;z-index:0}.slider-connect,.slider-origin{height:100%;position:absolute;right:0;top:0;transform-origin:0 0;transform-style:flat;width:100%;will-change:transform;z-index:1}.slider-txt-dir-rtl.slider-horizontal .slider-origin{left:0;right:auto}.slider-vertical .slider-origin{top:-100%;width:0}.slider-horizontal .slider-origin{height:0}.slider-handle{backface-visibility:hidden;position:absolute}.slider-touch-area{height:100%;width:100%}.slider-state-tap .slider-connect,.slider-state-tap .slider-origin{transition:transform .3s}.slider-state-drag *{cursor:inherit!important}.slider-tooltip-drag .slider-tooltip,.slider-tooltip-focus .slider-tooltip{display:none!important}.slider-tooltip-drag .slider-active .slider-tooltip,.slider-tooltip-drag.slider-state-drag .slider-tooltip:not(.slider-tooltip-hidden),.slider-tooltip-focus.slider-focused .slider-tooltip:not(.slider-tooltip-hidden){display:block!important}.slider-horizontal{height:var(--slider-height,6px)}.slider-horizontal .slider-handle{height:var(--slider-handle-height,16px);right:calc(var(--slider-handle-width, 16px)/2*-1);top:calc((var(--slider-handle-height, 16px) - var(--slider-height, 6px))/2*-1 + -1px);width:var(--slider-handle-width,16px)}.slider-vertical{height:var(--slider-vertical-height,300px);width:var(--slider-height,6px)}.slider-vertical .slider-handle{bottom:calc(var(--slider-handle-width, 16px)/2*-1);height:var(--slider-handle-width,16px);right:calc((var(--slider-handle-height, 16px) - var(--slider-height, 6px))/2*-1 + -1px);width:var(--slider-handle-height,16px)}.slider-txt-dir-rtl.slider-horizontal .slider-handle{left:calc(var(--slider-handle-width, 16px)/2*-1);right:auto}.slider-base{background-color:var(--slider-bg,#d1d5db)}.slider-base,.slider-connects{border-radius:var(--slider-radius,9999px)}.slider-connect{background:var(--slider-connect-bg,#10b981);cursor:pointer}.slider-draggable{cursor:ew-resize}.slider-vertical .slider-draggable{cursor:ns-resize}.slider-handle{background:var(--slider-handle-bg,#fff);border:var(--slider-handle-border,0);border-radius:var(--slider-handle-radius,9999px);box-shadow:var(--slider-handle-shadow,.5px .5px 2px 1px rgba(0,0,0,.32));cursor:grab;height:var(--slider-handle-height,16px);width:var(--slider-handle-width,16px)}.slider-handle:focus{box-shadow:0 0 0 var(--slider-handle-ring-width,3px) var(--slider-handle-ring-color,rgba(16,185,129,.188)),var(--slider-handle-shadow,.5px .5px 2px 1px rgba(0,0,0,.32));outline:none}.slider-active{box-shadow:var(--slider-handle-shadow-active,.5px .5px 2px 1px rgba(0,0,0,.42));cursor:grabbing}[disabled] .slider-connect{background:var(--slider-connect-bg-disabled,#9ca3af)}[disabled] .slider-handle,[disabled].slider-handle,[disabled].slider-target{cursor:not-allowed}[disabled] .slider-tooltip{background:var(--slider-tooltip-bg-disabled,#9ca3af);border-color:var(--slider-tooltip-bg-disabled,#9ca3af)}.slider-tooltip{background:var(--slider-tooltip-bg,#10b981);border:1px solid var(--slider-tooltip-bg,#10b981);border-radius:var(--slider-tooltip-radius,5px);color:var(--slider-tooltip-color,#fff);display:block;font-size:var(--slider-tooltip-font-size,.875rem);font-weight:var(--slider-tooltip-font-weight,600);line-height:var(--slider-tooltip-line-height,1.25rem);min-width:var(--slider-tooltip-min-width,20px);padding:var(--slider-tooltip-py,2px) var(--slider-tooltip-px,6px);position:absolute;text-align:center;white-space:nowrap}.slider-horizontal .slider-tooltip-top{bottom:calc(var(--slider-handle-height, 16px) + var(--slider-tooltip-arrow-size, 5px) + var(--slider-tooltip-distance, 3px));left:50%;transform:translate(-50%)}.slider-horizontal .slider-tooltip-top:before{border:var(--slider-tooltip-arrow-size,5px) solid transparent;border-top-color:inherit;bottom:calc(var(--slider-tooltip-arrow-size, 5px)*-2);content:"";height:0;left:50%;position:absolute;transform:translate(-50%);width:0}.slider-horizontal .slider-tooltip-bottom{left:50%;top:calc(var(--slider-handle-height, 16px) + var(--slider-tooltip-arrow-size, 5px) + var(--slider-tooltip-distance, 3px));transform:translate(-50%)}.slider-horizontal .slider-tooltip-bottom:before{border:var(--slider-tooltip-arrow-size,5px) solid transparent;border-bottom-color:inherit;content:"";height:0;left:50%;position:absolute;top:calc(var(--slider-tooltip-arrow-size, 5px)*-2);transform:translate(-50%);width:0}.slider-vertical .slider-tooltip-left{right:calc(var(--slider-handle-height, 16px) + var(--slider-tooltip-arrow-size, 5px) + var(--slider-tooltip-distance, 3px));top:50%;transform:translateY(-50%)}.slider-vertical .slider-tooltip-left:before{border:var(--slider-tooltip-arrow-size,5px) solid transparent;border-left-color:inherit;content:"";height:0;position:absolute;right:calc(var(--slider-tooltip-arrow-size, 5px)*-2);top:50%;transform:translateY(-50%);width:0}.slider-vertical .slider-tooltip-right{left:calc(var(--slider-handle-height, 16px) + var(--slider-tooltip-arrow-size, 5px) + var(--slider-tooltip-distance, 3px));top:50%;transform:translateY(-50%)}.slider-vertical .slider-tooltip-right:before{border:var(--slider-tooltip-arrow-size,5px) solid transparent;border-right-color:inherit;content:"";height:0;left:calc(var(--slider-tooltip-arrow-size, 5px)*-2);position:absolute;top:50%;transform:translateY(-50%);width:0}.slider-horizontal .slider-origin>.slider-tooltip{left:auto;transform:translate(50%)}.slider-horizontal .slider-origin>.slider-tooltip-top{bottom:calc(var(--slider-tooltip-arrow-size, 5px) + (var(--slider-handle-height, 16px) - var(--slider-height, 6px))/2 + var(--slider-tooltip-distance, 3px) + 1px)}.slider-horizontal .slider-origin>.slider-tooltip-bottom{top:calc(var(--slider-tooltip-arrow-size, 5px) + (var(--slider-handle-height, 16px) - var(--slider-height, 6px))/2 + var(--slider-tooltip-distance, 3px) + var(--slider-height, 6px) - 1px)}.slider-vertical .slider-origin>.slider-tooltip{top:auto;transform:translateY(calc((var(--slider-tooltip-line-height, 1.25rem) - var(--slider-tooltip-py, 2px))*-1 + 1px))}.slider-vertical .slider-origin>.slider-tooltip-left{right:calc(var(--slider-tooltip-arrow-size, 5px) + var(--slider-height, 6px) + (var(--slider-handle-height, 16px) - var(--slider-height, 6px))/2 + var(--slider-tooltip-distance, 3px) - 1px)}.slider-vertical .slider-origin>.slider-tooltip-right{left:calc(var(--slider-tooltip-arrow-size, 5px) + var(--slider-height, 6px) + (var(--slider-handle-height, 16px) - var(--slider-height, 6px))/2 + var(--slider-tooltip-distance, 3px) - var(--slider-height, 6px) + 1px)}.list-move[data-v-638ad12b]{transition:all .5s ease}.fade-enter-active[data-v-638ad12b],.fade-leave-active[data-v-638ad12b]{transition:opacity .5s ease}.fade-enter-from[data-v-638ad12b],.fade-leave-to[data-v-638ad12b]{opacity:0}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.absolute{position:absolute}.relative{position:relative}.-top-64{top:-16rem}.mx-auto{margin-left:auto;margin-right:auto}.flex{display:flex}.hidden{display:none}.h-28{height:7rem}.h-40{height:10rem}.h-full{height:100%}.h-screen{height:100vh}.w-12{width:3rem}.w-28{width:7rem}.w-3{width:.75rem}.w-4{width:1rem}.w-40{width:10rem}.w-64{width:16rem}.w-8{width:2rem}.w-80{width:20rem}.w-full{width:100%}.w-screen{width:100vw}.grow{flex-grow:1}.basis-1\/12{flex-basis:8.333333%}.basis-1\/5{flex-basis:20%}.cursor-pointer{cursor:pointer}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-8{gap:2rem}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.text-wrap{text-wrap:wrap}.rounded-lg{border-radius:.5rem}.border-2{border-width:2px}.border-b-2{border-bottom-width:2px}.border-\[\#12230d\]{--tw-border-opacity: 1;border-color:rgb(18 35 13 / var(--tw-border-opacity))}.border-gray-600{--tw-border-opacity: 1;border-color:rgb(75 85 99 / var(--tw-border-opacity))}.bg-\[\#0a1606\]{--tw-bg-opacity: 1;background-color:rgb(10 22 6 / var(--tw-bg-opacity))}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity))}.bg-gray-500{--tw-bg-opacity: 1;background-color:rgb(107 114 128 / var(--tw-bg-opacity))}.bg-gray-950{--tw-bg-opacity: 1;background-color:rgb(3 7 18 / var(--tw-bg-opacity))}.p-4{padding:1rem}.p-6{padding:1.5rem}.py-4{padding-top:1rem;padding-bottom:1rem}.pb-2{padding-bottom:.5rem}.pt-1{padding-top:.25rem}.text-center{text-align:center}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.text-\[\#0aefff\]{--tw-text-opacity: 1;color:rgb(10 239 255 / var(--tw-text-opacity))}.text-\[\#0aff99\]{--tw-text-opacity: 1;color:rgb(10 255 153 / var(--tw-text-opacity))}.text-\[\#147df5\]{--tw-text-opacity: 1;color:rgb(20 125 245 / var(--tw-text-opacity))}.text-\[\#580aff\]{--tw-text-opacity: 1;color:rgb(88 10 255 / var(--tw-text-opacity))}.text-\[\#a1ff0a\]{--tw-text-opacity: 1;color:rgb(161 255 10 / var(--tw-text-opacity))}.text-\[\#be0aff\]{--tw-text-opacity: 1;color:rgb(190 10 255 / var(--tw-text-opacity))}.text-\[\#cccccc\]{--tw-text-opacity: 1;color:rgb(204 204 204 / var(--tw-text-opacity))}.text-\[\#deff0a\]{--tw-text-opacity: 1;color:rgb(222 255 10 / var(--tw-text-opacity))}.text-\[\#ff0000\]{--tw-text-opacity: 1;color:rgb(255 0 0 / var(--tw-text-opacity))}.text-\[\#ff8700\]{--tw-text-opacity: 1;color:rgb(255 135 0 / var(--tw-text-opacity))}.text-\[\#ffd300\]{--tw-text-opacity: 1;color:rgb(255 211 0 / var(--tw-text-opacity))}.text-blue-300{--tw-text-opacity: 1;color:rgb(147 197 253 / var(--tw-text-opacity))}.text-slate-100{--tw-text-opacity: 1;color:rgb(241 245 249 / var(--tw-text-opacity))}.text-slate-200{--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity))}.text-slate-400{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.text-yellow-300{--tw-text-opacity: 1;color:rgb(253 224 71 / var(--tw-text-opacity))}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s} diff --git a/front/dist/assets/webworkerAll-D0j8Dh1V.js b/front/dist/assets/webworkerAll-DZ1ir_jf.js similarity index 99% rename from front/dist/assets/webworkerAll-D0j8Dh1V.js rename to front/dist/assets/webworkerAll-DZ1ir_jf.js index f9533de..4116580 100644 --- a/front/dist/assets/webworkerAll-D0j8Dh1V.js +++ b/front/dist/assets/webworkerAll-DZ1ir_jf.js @@ -1,4 +1,4 @@ -import{E as b,U as Wt,b as Ce,c as $e,a0 as U,a1 as A,Z as M,a9 as V,aa as Pe,ab as Re,ac as te,ad as ge,D as X,a as z,M as W,w as j,Q as ue,ae as At,af as H,ag as ae,a3 as me,m as K,i as je,P as zt,R as _e,I as Ke,h as N,B as L,S as re,z as v,ah as Gt,ai as xe,L as fe,aj as Q,u as be,x as Ht,G as Dt,ak as Lt,o as Ye,a4 as Xe,t as Ne,a7 as qe,s as It,p as Ot,q as Et,a5 as Vt,a6 as $t,a8 as jt,al as Kt,am as pe,n as Me,e as P,an as Yt}from"./index-CQrWNA4L.js";import{T as D,c as ne,a as Xt,b as Nt,B as Qe}from"./colorToUniform-DaN3ccwh.js";import{C as E}from"./CanvasPool-DfMFozUt.js";class Je{static init(e){Object.defineProperty(this,"resizeTo",{set(t){globalThis.removeEventListener("resize",this.queueResize),this._resizeTo=t,t&&(globalThis.addEventListener("resize",this.queueResize),this.resize())},get(){return this._resizeTo}}),this.queueResize=()=>{this._resizeTo&&(this._cancelResize(),this._resizeId=requestAnimationFrame(()=>this.resize()))},this._cancelResize=()=>{this._resizeId&&(cancelAnimationFrame(this._resizeId),this._resizeId=null)},this.resize=()=>{if(!this._resizeTo)return;this._cancelResize();let t,r;if(this._resizeTo===globalThis.window)t=globalThis.innerWidth,r=globalThis.innerHeight;else{const{clientWidth:i,clientHeight:s}=this._resizeTo;t=i,r=s}this.renderer.resize(t,r),this.render()},this._resizeId=null,this._resizeTo=null,this.resizeTo=e.resizeTo||null}static destroy(){globalThis.removeEventListener("resize",this.queueResize),this._cancelResize(),this._cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null}}Je.extension=b.Application;class Ze{static init(e){e=Object.assign({autoStart:!0,sharedTicker:!1},e),Object.defineProperty(this,"ticker",{set(t){this._ticker&&this._ticker.remove(this.render,this),this._ticker=t,t&&t.add(this.render,this,Wt.LOW)},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=e.sharedTicker?Ce.shared:new Ce,e.autoStart&&this.start()}static destroy(){if(this._ticker){const e=this._ticker;this.ticker=null,e.destroy()}}}Ze.extension=b.Application;class qt extends $e{constructor(){super(...arguments),this.chars=Object.create(null),this.lineHeight=0,this.fontFamily="",this.fontMetrics={fontSize:0,ascent:0,descent:0},this.baseLineOffset=0,this.distanceField={type:"none",range:0},this.pages=[],this.applyFillAsTint=!0,this.baseMeasurementFontSize=100,this.baseRenderedFontSize=100}get font(){return U(A,"BitmapFont.font is deprecated, please use BitmapFont.fontFamily instead."),this.fontFamily}get pageTextures(){return U(A,"BitmapFont.pageTextures is deprecated, please use BitmapFont.pages instead."),this.pages}get size(){return U(A,"BitmapFont.size is deprecated, please use BitmapFont.fontMetrics.fontSize instead."),this.fontMetrics.fontSize}get distanceFieldRange(){return U(A,"BitmapFont.distanceFieldRange is deprecated, please use BitmapFont.distanceField.range instead."),this.distanceField.range}get distanceFieldType(){return U(A,"BitmapFont.distanceFieldType is deprecated, please use BitmapFont.distanceField.type instead."),this.distanceField.type}destroy(e=!1){var t;this.emit("destroy",this),this.removeAllListeners();for(const r in this.chars)(t=this.chars[r].texture)==null||t.destroy();this.chars=null,e&&(this.pages.forEach(r=>r.texture.destroy(!0)),this.pages=null)}}const Fe=["align","breakWords","cssOverrides","fontVariant","fontWeight","leading","letterSpacing","lineHeight","padding","textBaseline","trim","whiteSpace","wordWrap","wordWrapWidth","fontFamily","fontStyle","fontSize"];function et(n){const e=[];let t=0;for(let r=0;r{this._fill=Pe({...this._originalFill},V.defaultFillStyle)})),this._fill=Pe(e===0?"black":e,V.defaultFillStyle),this.update())}get stroke(){return this._originalStroke}set stroke(e){e!==this._originalStroke&&(this._originalStroke=e,this._isFillStyle(e)&&(this._originalStroke=this._createProxy({...V.defaultStrokeStyle,...e},()=>{this._stroke=Re({...this._originalStroke},V.defaultStrokeStyle)})),this._stroke=Re(e,V.defaultStrokeStyle),this.update())}_generateKey(){return this._styleKey=et(this),this._styleKey}update(){this._styleKey=null,this.emit("update",this)}reset(){const e=$.defaultTextStyle;for(const t in e)this[t]=e[t]}get styleKey(){return this._styleKey||this._generateKey()}clone(){return new $({align:this.align,breakWords:this.breakWords,dropShadow:this._dropShadow?{...this._dropShadow}:null,fill:this._fill,fontFamily:this.fontFamily,fontSize:this.fontSize,fontStyle:this.fontStyle,fontVariant:this.fontVariant,fontWeight:this.fontWeight,leading:this.leading,letterSpacing:this.letterSpacing,lineHeight:this.lineHeight,padding:this.padding,stroke:this._stroke,textBaseline:this.textBaseline,whiteSpace:this.whiteSpace,wordWrap:this.wordWrap,wordWrapWidth:this.wordWrapWidth})}destroy(e=!1){var r,i,s,a;if(this.removeAllListeners(),typeof e=="boolean"?e:e==null?void 0:e.texture){const o=typeof e=="boolean"?e:e==null?void 0:e.textureSource;(r=this._fill)!=null&&r.texture&&this._fill.texture.destroy(o),(i=this._originalFill)!=null&&i.texture&&this._originalFill.texture.destroy(o),(s=this._stroke)!=null&&s.texture&&this._stroke.texture.destroy(o),(a=this._originalStroke)!=null&&a.texture&&this._originalStroke.texture.destroy(o)}this._fill=null,this._stroke=null,this.dropShadow=null,this._originalStroke=null,this._originalFill=null}_createProxy(e,t){return new Proxy(e,{set:(r,i,s)=>(r[i]=s,t==null||t(i,s),this.update(),!0)})}_isFillStyle(e){return(e??null)!==null&&!(M.isColorLike(e)||e instanceof te||e instanceof ge)}};ye.defaultDropShadow={alpha:1,angle:Math.PI/6,blur:0,color:"black",distance:5};ye.defaultTextStyle={align:"left",breakWords:!1,dropShadow:null,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",leading:0,letterSpacing:0,lineHeight:0,padding:0,stroke:null,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100};let O=ye;function Zt(n){const e=n;if(typeof e.dropShadow=="boolean"&&e.dropShadow){const t=O.defaultDropShadow;n.dropShadow={alpha:e.dropShadowAlpha??t.alpha,angle:e.dropShadowAngle??t.angle,blur:e.dropShadowBlur??t.blur,color:e.dropShadowColor??t.color,distance:e.dropShadowDistance??t.distance}}if(e.strokeThickness!==void 0){U(A,"strokeThickness is now a part of stroke");const t=e.stroke;let r={};if(M.isColorLike(t))r.color=t;else if(t instanceof te||t instanceof ge)r.fill=t;else if(Object.hasOwnProperty.call(t,"color")||Object.hasOwnProperty.call(t,"fill"))r=t;else throw new Error("Invalid stroke value.");n.stroke={...r,width:e.strokeThickness}}if(Array.isArray(e.fillGradientStops)){U(A,"gradient fill is now a fill pattern: `new FillGradient(...)`");let t;n.fontSize==null?n.fontSize=O.defaultTextStyle.fontSize:typeof n.fontSize=="string"?t=parseInt(n.fontSize,10):t=n.fontSize;const r=new te(0,0,0,t*1.7),i=e.fillGradientStops.map(s=>M.shared.setValue(s).toNumber());i.forEach((s,a)=>{const o=a/(i.length-1);r.addColorStop(o,s)}),n.fill={fill:r}}}const er=["serif","sans-serif","monospace","cursive","fantasy","system-ui"];function ie(n){const e=typeof n.fontSize=="number"?`${n.fontSize}px`:n.fontSize;let t=n.fontFamily;Array.isArray(n.fontFamily)||(t=n.fontFamily.split(","));for(let r=t.length-1;r>=0;r--){let i=t[r].trim();!/([\"\'])[^\'\"]+\1/.test(i)&&!er.includes(i)&&(i=`"${i}"`),t[r]=i}return`${n.fontStyle} ${n.fontVariant} ${n.fontWeight} ${e} ${t.join(",")}`}const oe={willReadFrequently:!0},G=class p{static get experimentalLetterSpacingSupported(){let e=p._experimentalLetterSpacingSupported;if(e!==void 0){const t=X.get().getCanvasRenderingContext2D().prototype;e=p._experimentalLetterSpacingSupported="letterSpacing"in t||"textLetterSpacing"in t}return e}constructor(e,t,r,i,s,a,o,l,d){this.text=e,this.style=t,this.width=r,this.height=i,this.lines=s,this.lineWidths=a,this.lineHeight=o,this.maxLineWidth=l,this.fontProperties=d}static measureText(e=" ",t,r=p._canvas,i=t.wordWrap){var w;const s=`${e}:${t.styleKey}`;if(p._measurementCache[s])return p._measurementCache[s];const a=ie(t),o=p.measureFont(a);o.fontSize===0&&(o.fontSize=t.fontSize,o.ascent=t.fontSize);const l=p.__context;l.font=a;const h=(i?p._wordWrap(e,t,r):e).split(/(?:\r\n|\r|\n)/),c=new Array(h.length);let f=0;for(let y=0;y0)if(i)a-=t,d-=t;else{const h=(p.graphemeSegmenter(e).length-1)*t;a+=h,d+=h}return Math.max(a,d)}static _wordWrap(e,t,r=p._canvas){const i=r.getContext("2d",oe);let s=0,a="",o="";const l=Object.create(null),{letterSpacing:d,whiteSpace:h}=t,c=p._collapseSpaces(h),f=p._collapseNewlines(h);let _=!c;const g=t.wordWrapWidth+d,u=p._tokenize(e);for(let x=0;xg)if(a!==""&&(o+=p._addLine(a),a="",s=0),p.canBreakWords(m,t.breakWords)){const y=p.wordWrapSplit(m);for(let S=0;Sg&&(o+=p._addLine(a),_=!1,a="",s=0),a+=B,s+=F}}else{a.length>0&&(o+=p._addLine(a),a="",s=0);const y=x===u.length-1;o+=p._addLine(m,!y),_=!1,a="",s=0}else w+s>g&&(_=!1,o+=p._addLine(a),a="",s=0),(a.length>0||!p.isBreakingSpace(m)||_)&&(a+=m,s+=w)}return o+=p._addLine(a,!1),o}static _addLine(e,t=!0){return e=p._trimRight(e),e=t?`${e} +import{E as b,U as Wt,b as Ce,c as $e,a0 as U,a1 as A,Z as M,a9 as V,aa as Pe,ab as Re,ac as te,ad as ge,D as X,a as z,M as W,w as j,Q as ue,ae as At,af as H,ag as ae,a3 as me,m as K,i as je,P as zt,R as _e,I as Ke,h as N,B as L,S as re,z as v,ah as Gt,ai as xe,L as fe,aj as Q,u as be,x as Ht,G as Dt,ak as Lt,o as Ye,a4 as Xe,t as Ne,a7 as qe,s as It,p as Ot,q as Et,a5 as Vt,a6 as $t,a8 as jt,al as Kt,am as pe,n as Me,e as P,an as Yt}from"./index-DKTylTFu.js";import{T as D,c as ne,a as Xt,b as Nt,B as Qe}from"./colorToUniform-fMvLSPph.js";import{C as E}from"./CanvasPool-Df6Z7K0X.js";class Je{static init(e){Object.defineProperty(this,"resizeTo",{set(t){globalThis.removeEventListener("resize",this.queueResize),this._resizeTo=t,t&&(globalThis.addEventListener("resize",this.queueResize),this.resize())},get(){return this._resizeTo}}),this.queueResize=()=>{this._resizeTo&&(this._cancelResize(),this._resizeId=requestAnimationFrame(()=>this.resize()))},this._cancelResize=()=>{this._resizeId&&(cancelAnimationFrame(this._resizeId),this._resizeId=null)},this.resize=()=>{if(!this._resizeTo)return;this._cancelResize();let t,r;if(this._resizeTo===globalThis.window)t=globalThis.innerWidth,r=globalThis.innerHeight;else{const{clientWidth:i,clientHeight:s}=this._resizeTo;t=i,r=s}this.renderer.resize(t,r),this.render()},this._resizeId=null,this._resizeTo=null,this.resizeTo=e.resizeTo||null}static destroy(){globalThis.removeEventListener("resize",this.queueResize),this._cancelResize(),this._cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null}}Je.extension=b.Application;class Ze{static init(e){e=Object.assign({autoStart:!0,sharedTicker:!1},e),Object.defineProperty(this,"ticker",{set(t){this._ticker&&this._ticker.remove(this.render,this),this._ticker=t,t&&t.add(this.render,this,Wt.LOW)},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=e.sharedTicker?Ce.shared:new Ce,e.autoStart&&this.start()}static destroy(){if(this._ticker){const e=this._ticker;this.ticker=null,e.destroy()}}}Ze.extension=b.Application;class qt extends $e{constructor(){super(...arguments),this.chars=Object.create(null),this.lineHeight=0,this.fontFamily="",this.fontMetrics={fontSize:0,ascent:0,descent:0},this.baseLineOffset=0,this.distanceField={type:"none",range:0},this.pages=[],this.applyFillAsTint=!0,this.baseMeasurementFontSize=100,this.baseRenderedFontSize=100}get font(){return U(A,"BitmapFont.font is deprecated, please use BitmapFont.fontFamily instead."),this.fontFamily}get pageTextures(){return U(A,"BitmapFont.pageTextures is deprecated, please use BitmapFont.pages instead."),this.pages}get size(){return U(A,"BitmapFont.size is deprecated, please use BitmapFont.fontMetrics.fontSize instead."),this.fontMetrics.fontSize}get distanceFieldRange(){return U(A,"BitmapFont.distanceFieldRange is deprecated, please use BitmapFont.distanceField.range instead."),this.distanceField.range}get distanceFieldType(){return U(A,"BitmapFont.distanceFieldType is deprecated, please use BitmapFont.distanceField.type instead."),this.distanceField.type}destroy(e=!1){var t;this.emit("destroy",this),this.removeAllListeners();for(const r in this.chars)(t=this.chars[r].texture)==null||t.destroy();this.chars=null,e&&(this.pages.forEach(r=>r.texture.destroy(!0)),this.pages=null)}}const Fe=["align","breakWords","cssOverrides","fontVariant","fontWeight","leading","letterSpacing","lineHeight","padding","textBaseline","trim","whiteSpace","wordWrap","wordWrapWidth","fontFamily","fontStyle","fontSize"];function et(n){const e=[];let t=0;for(let r=0;r{this._fill=Pe({...this._originalFill},V.defaultFillStyle)})),this._fill=Pe(e===0?"black":e,V.defaultFillStyle),this.update())}get stroke(){return this._originalStroke}set stroke(e){e!==this._originalStroke&&(this._originalStroke=e,this._isFillStyle(e)&&(this._originalStroke=this._createProxy({...V.defaultStrokeStyle,...e},()=>{this._stroke=Re({...this._originalStroke},V.defaultStrokeStyle)})),this._stroke=Re(e,V.defaultStrokeStyle),this.update())}_generateKey(){return this._styleKey=et(this),this._styleKey}update(){this._styleKey=null,this.emit("update",this)}reset(){const e=$.defaultTextStyle;for(const t in e)this[t]=e[t]}get styleKey(){return this._styleKey||this._generateKey()}clone(){return new $({align:this.align,breakWords:this.breakWords,dropShadow:this._dropShadow?{...this._dropShadow}:null,fill:this._fill,fontFamily:this.fontFamily,fontSize:this.fontSize,fontStyle:this.fontStyle,fontVariant:this.fontVariant,fontWeight:this.fontWeight,leading:this.leading,letterSpacing:this.letterSpacing,lineHeight:this.lineHeight,padding:this.padding,stroke:this._stroke,textBaseline:this.textBaseline,whiteSpace:this.whiteSpace,wordWrap:this.wordWrap,wordWrapWidth:this.wordWrapWidth})}destroy(e=!1){var r,i,s,a;if(this.removeAllListeners(),typeof e=="boolean"?e:e==null?void 0:e.texture){const o=typeof e=="boolean"?e:e==null?void 0:e.textureSource;(r=this._fill)!=null&&r.texture&&this._fill.texture.destroy(o),(i=this._originalFill)!=null&&i.texture&&this._originalFill.texture.destroy(o),(s=this._stroke)!=null&&s.texture&&this._stroke.texture.destroy(o),(a=this._originalStroke)!=null&&a.texture&&this._originalStroke.texture.destroy(o)}this._fill=null,this._stroke=null,this.dropShadow=null,this._originalStroke=null,this._originalFill=null}_createProxy(e,t){return new Proxy(e,{set:(r,i,s)=>(r[i]=s,t==null||t(i,s),this.update(),!0)})}_isFillStyle(e){return(e??null)!==null&&!(M.isColorLike(e)||e instanceof te||e instanceof ge)}};ye.defaultDropShadow={alpha:1,angle:Math.PI/6,blur:0,color:"black",distance:5};ye.defaultTextStyle={align:"left",breakWords:!1,dropShadow:null,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",leading:0,letterSpacing:0,lineHeight:0,padding:0,stroke:null,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100};let O=ye;function Zt(n){const e=n;if(typeof e.dropShadow=="boolean"&&e.dropShadow){const t=O.defaultDropShadow;n.dropShadow={alpha:e.dropShadowAlpha??t.alpha,angle:e.dropShadowAngle??t.angle,blur:e.dropShadowBlur??t.blur,color:e.dropShadowColor??t.color,distance:e.dropShadowDistance??t.distance}}if(e.strokeThickness!==void 0){U(A,"strokeThickness is now a part of stroke");const t=e.stroke;let r={};if(M.isColorLike(t))r.color=t;else if(t instanceof te||t instanceof ge)r.fill=t;else if(Object.hasOwnProperty.call(t,"color")||Object.hasOwnProperty.call(t,"fill"))r=t;else throw new Error("Invalid stroke value.");n.stroke={...r,width:e.strokeThickness}}if(Array.isArray(e.fillGradientStops)){U(A,"gradient fill is now a fill pattern: `new FillGradient(...)`");let t;n.fontSize==null?n.fontSize=O.defaultTextStyle.fontSize:typeof n.fontSize=="string"?t=parseInt(n.fontSize,10):t=n.fontSize;const r=new te(0,0,0,t*1.7),i=e.fillGradientStops.map(s=>M.shared.setValue(s).toNumber());i.forEach((s,a)=>{const o=a/(i.length-1);r.addColorStop(o,s)}),n.fill={fill:r}}}const er=["serif","sans-serif","monospace","cursive","fantasy","system-ui"];function ie(n){const e=typeof n.fontSize=="number"?`${n.fontSize}px`:n.fontSize;let t=n.fontFamily;Array.isArray(n.fontFamily)||(t=n.fontFamily.split(","));for(let r=t.length-1;r>=0;r--){let i=t[r].trim();!/([\"\'])[^\'\"]+\1/.test(i)&&!er.includes(i)&&(i=`"${i}"`),t[r]=i}return`${n.fontStyle} ${n.fontVariant} ${n.fontWeight} ${e} ${t.join(",")}`}const oe={willReadFrequently:!0},G=class p{static get experimentalLetterSpacingSupported(){let e=p._experimentalLetterSpacingSupported;if(e!==void 0){const t=X.get().getCanvasRenderingContext2D().prototype;e=p._experimentalLetterSpacingSupported="letterSpacing"in t||"textLetterSpacing"in t}return e}constructor(e,t,r,i,s,a,o,l,d){this.text=e,this.style=t,this.width=r,this.height=i,this.lines=s,this.lineWidths=a,this.lineHeight=o,this.maxLineWidth=l,this.fontProperties=d}static measureText(e=" ",t,r=p._canvas,i=t.wordWrap){var w;const s=`${e}:${t.styleKey}`;if(p._measurementCache[s])return p._measurementCache[s];const a=ie(t),o=p.measureFont(a);o.fontSize===0&&(o.fontSize=t.fontSize,o.ascent=t.fontSize);const l=p.__context;l.font=a;const h=(i?p._wordWrap(e,t,r):e).split(/(?:\r\n|\r|\n)/),c=new Array(h.length);let f=0;for(let y=0;y0)if(i)a-=t,d-=t;else{const h=(p.graphemeSegmenter(e).length-1)*t;a+=h,d+=h}return Math.max(a,d)}static _wordWrap(e,t,r=p._canvas){const i=r.getContext("2d",oe);let s=0,a="",o="";const l=Object.create(null),{letterSpacing:d,whiteSpace:h}=t,c=p._collapseSpaces(h),f=p._collapseNewlines(h);let _=!c;const g=t.wordWrapWidth+d,u=p._tokenize(e);for(let x=0;xg)if(a!==""&&(o+=p._addLine(a),a="",s=0),p.canBreakWords(m,t.breakWords)){const y=p.wordWrapSplit(m);for(let S=0;Sg&&(o+=p._addLine(a),_=!1,a="",s=0),a+=B,s+=F}}else{a.length>0&&(o+=p._addLine(a),a="",s=0);const y=x===u.length-1;o+=p._addLine(m,!y),_=!1,a="",s=0}else w+s>g&&(_=!1,o+=p._addLine(a),a="",s=0),(a.length>0||!p.isBreakingSpace(m)||_)&&(a+=m,s+=w)}return o+=p._addLine(a,!1),o}static _addLine(e,t=!0){return e=p._trimRight(e),e=t?`${e} `:e,e}static _getFromCache(e,t,r,i){let s=r[e];return typeof s!="number"&&(s=p._measureText(e,t,i)+t,r[e]=s),s}static _collapseSpaces(e){return e==="normal"||e==="pre-line"}static _collapseNewlines(e){return e==="normal"}static _trimRight(e){if(typeof e!="string")return"";for(let t=e.length-1;t>=0;t--){const r=e[t];if(!p.isBreakingSpace(r))break;e=e.slice(0,-1)}return e}static _isNewline(e){return typeof e!="string"?!1:p._newlines.includes(e.charCodeAt(0))}static isBreakingSpace(e,t){return typeof e!="string"?!1:p._breakingSpaces.includes(e.charCodeAt(0))}static _tokenize(e){const t=[];let r="";if(typeof e!="string")return t;for(let i=0;i{if(typeof(Intl==null?void 0:Intl.Segmenter)=="function"){const n=new Intl.Segmenter;return e=>[...n.segment(e)].map(t=>t.segment)}return n=>[...n]})();G.experimentalLetterSpacing=!1;G._fonts={};G._newlines=[10,13];G._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];G._measurementCache={};let I=G;function se(n,e){if(n.texture===z.WHITE&&!n.fill)return M.shared.setValue(n.color).setAlpha(n.alpha??1).toHexa();if(n.fill){if(n.fill instanceof ge){const t=n.fill,r=e.createPattern(t.texture.source.resource,"repeat"),i=t.transform.copyTo(W.shared);return i.scale(t.texture.frame.width,t.texture.frame.height),r.setTransform(i),r}else if(n.fill instanceof te){const t=n.fill;if(t.type==="linear"){const r=e.createLinearGradient(t.x0,t.y0,t.x1,t.y1);return t.gradientStops.forEach(i=>{r.addColorStop(i.offset,M.shared.setValue(i.color).toHex())}),r}}}else{const t=e.createPattern(n.texture.source.resource,"repeat"),r=n.matrix.copyTo(W.shared);return r.scale(n.texture.frame.width,n.texture.frame.height),t.setTransform(r),t}return j("FillStyle not recognised",n),"red"}function rt(n){if(n==="")return[];typeof n=="string"&&(n=[n]);const e=[];for(let t=0,r=n.length;t!this._currentChars.includes(x)).filter((x,m,w)=>w.indexOf(x)===m);if(!t.length)return;this._currentChars=[...this._currentChars,...t];let r;this._currentPageIndex===-1?r=this._nextPage():r=this.pages[this._currentPageIndex];let{canvas:i,context:s}=r.canvasAndContext,a=r.texture.source;const o=this._style;let l=this._currentX,d=this._currentY;const h=this.baseRenderedFontSize/this.baseMeasurementFontSize,c=this._padding*h;let f=0,_=!1;for(let x=0;xthis._textureSize&&(d+=f,f=C,l=0,d+f>this._textureSize)){a.update();const k=this._nextPage();i=k.canvasAndContext.canvas,s=k.canvasAndContext.context,a=k.texture.source,d=0}const F=S/h-(((g=o.dropShadow)==null?void 0:g.distance)??0)-(((u=o._stroke)==null?void 0:u.width)??0);if(this.chars[m]={id:m.codePointAt(0),xOffset:-this._padding,yOffset:-this._padding,xAdvance:F,kerning:{}},_){this._drawGlyph(s,w,l+c,d+c,h,o);const k=a.width*h,Y=a.height*h,q=new ue(l/k*a.width,d/Y*a.height,T/k*a.width,C/Y*a.height);this.chars[m].texture=new z({source:a,frame:q}),l+=Math.ceil(T)}}a.update(),this._currentX=l,this._currentY=d,this._skipKerning&&this._applyKerning(t,s)}get pageTextures(){return U(A,"BitmapFont.pageTextures is deprecated, please use BitmapFont.pages instead."),this.pages}_applyKerning(e,t){const r=this._measureCache;for(let i=0;i{const u=s.width;for(let x=0;x{let g=s.chars.length-1;if(r){let u=s.chars[g];for(;u===" ";)s.width-=t.chars[u].xAdvance,u=s.chars[--g]}i.width=Math.max(i.width,s.width),s={width:0,charPositions:[],chars:[],spaceWidth:0,spacesIndex:[]},o=!0,i.lines.push(s),i.height+=t.lineHeight},c=t.baseMeasurementFontSize/e.fontSize,f=e.letterSpacing*c,_=e.wordWrapWidth*c;for(let g=0;g_?(h(),d(l),x||s.charPositions.push(0)):(l.start=s.width,d(l),x||s.charPositions.push(0)),u==="\r"||u===` diff --git a/front/dist/index.html b/front/dist/index.html index 5e7fc87..8b306e9 100644 --- a/front/dist/index.html +++ b/front/dist/index.html @@ -6,8 +6,8 @@ Lighthouses - - + + diff --git a/front/src/App.vue b/front/src/App.vue index 5d52dc3..92050fe 100644 --- a/front/src/App.vue +++ b/front/src/App.vue @@ -67,11 +67,8 @@ }; const initStage = async () => { - if (loadFile) { - return; - } if (!stageContainer.value) { - console.error("Stage container not found"); + console.warn("Stage container not found"); return; } stage.init(stageContainer.value, playback);