diff --git a/assets/CanvasPool-Dff9nFgq.js b/assets/CanvasPool-DQqeIevT.js similarity index 91% rename from assets/CanvasPool-Dff9nFgq.js rename to assets/CanvasPool-DQqeIevT.js index 9519dcb..e2b6d61 100644 --- a/assets/CanvasPool-Dff9nFgq.js +++ b/assets/CanvasPool-DQqeIevT.js @@ -1 +1 @@ -import{D as n,n as c}from"./index-D1nj3bjZ.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-B5lVtmvj.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/assets/SharedSystems-CoG3pQxX.js b/assets/SharedSystems-Cql4UvKc.js similarity index 99% rename from assets/SharedSystems-CoG3pQxX.js rename to assets/SharedSystems-Cql4UvKc.js index 0cb7c21..5e8b270 100644 --- a/assets/SharedSystems-CoG3pQxX.js +++ b/assets/SharedSystems-Cql4UvKc.js @@ -1,4 +1,4 @@ -import{s as ze,G as re,u as se,v as We,k as ae,M as v,E as d,e as O,x as ne,y as g,z as Ve,F as y,R as F,H,I as ie,J as Ne,t as m,S as f,h as U,w as oe,K,L as je,b as Y,B as C,i as A,N as S,j as T,O as w,Q as $e,a as qe,C as P,V as le,W as de,X as ue,Y as ce,Z as he,_ as Ke,P as Ye,c as Je,T as J,D as fe,$ as X,a0 as Xe,a1 as Qe,a2 as Ze}from"./index-D1nj3bjZ.js";import{S as pe,B as me,c as et}from"./colorToUniform-C2GHuDhf.js";const ve=class I extends ze{constructor(e){e={...I.defaultOptions,...e},super(e),this.enabled=!0,this._state=pe.for2d(),this.blendMode=e.blendMode,this.padding=e.padding,typeof e.antialias=="boolean"?this.antialias=e.antialias?"on":"off":this.antialias=e.antialias,this.resolution=e.resolution,this.blendRequired=e.blendRequired,this.clipToViewport=e.clipToViewport,this.addResource("uTexture",0,1)}apply(e,t,r,s){e.applyFilter(this,t,r,s)}get blendMode(){return this._state.blendMode}set blendMode(e){this._state.blendMode=e}static from(e){const{gpu:t,gl:r,...s}=e;let n,i;return t&&(n=re.from(t)),r&&(i=se.from(r)),new I({gpuProgram:n,glProgram:i,...s})}};ve.defaultOptions={blendMode:"normal",resolution:1,padding:0,antialias:"off",blendRequired:!1,clipToViewport:!0};let tt=ve;var rt=`in vec2 vMaskCoord; +import{s as ze,G as re,u as se,v as We,k as ae,M as v,E as d,e as O,x as ne,y as g,z as Ve,F as y,R as F,H,I as ie,J as Ne,t as m,S as f,h as U,w as oe,K,L as je,b as Y,B as C,i as A,N as S,j as T,O as w,Q as $e,a as qe,C as P,V as le,W as de,X as ue,Y as ce,Z as he,_ as Ke,P as Ye,c as Je,T as J,D as fe,$ as X,a0 as Xe,a1 as Qe,a2 as Ze}from"./index-B5lVtmvj.js";import{S as pe,B as me,c as et}from"./colorToUniform-C2GHuDhf.js";const ve=class I extends ze{constructor(e){e={...I.defaultOptions,...e},super(e),this.enabled=!0,this._state=pe.for2d(),this.blendMode=e.blendMode,this.padding=e.padding,typeof e.antialias=="boolean"?this.antialias=e.antialias?"on":"off":this.antialias=e.antialias,this.resolution=e.resolution,this.blendRequired=e.blendRequired,this.clipToViewport=e.clipToViewport,this.addResource("uTexture",0,1)}apply(e,t,r,s){e.applyFilter(this,t,r,s)}get blendMode(){return this._state.blendMode}set blendMode(e){this._state.blendMode=e}static from(e){const{gpu:t,gl:r,...s}=e;let n,i;return t&&(n=re.from(t)),r&&(i=se.from(r)),new I({gpuProgram:n,glProgram:i,...s})}};ve.defaultOptions={blendMode:"normal",resolution:1,padding:0,antialias:"off",blendRequired:!1,clipToViewport:!0};let tt=ve;var rt=`in vec2 vMaskCoord; in vec2 vTextureCoord; uniform sampler2D uTexture; diff --git a/assets/WebGLRenderer-DIyxxzaL.js b/assets/WebGLRenderer-BL_L2csm.js similarity index 99% rename from assets/WebGLRenderer-DIyxxzaL.js rename to assets/WebGLRenderer-BL_L2csm.js index 00ec04d..22c715d 100644 --- a/assets/WebGLRenderer-DIyxxzaL.js +++ b/assets/WebGLRenderer-BL_L2csm.js @@ -1,4 +1,4 @@ -import{E as d,B,w as m,D as b,K,a3 as Be,u as Ae,s as G,t as S,j as $,S as p,O as L,h as A,i as H,k as U,p as z,M as Y,a4 as q,a5 as Ne,a6 as ye,a7 as Z,a8 as Ie,e as x,A as De,R as Ce}from"./index-D1nj3bjZ.js";import{S as O,b as Q}from"./colorToUniform-C2GHuDhf.js";import{e as Ge,G as Ue,c as Oe,b as Pe,U as Fe,R as Me,B as J,d as N,f as Le,S as He,a as we}from"./SharedSystems-CoG3pQxX.js";class ee{constructor(){this._didUpload=!1,this._tempState=O.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))(v||{});class Ve{constructor(e,r){this._lastBindBaseLocation=-1,this._lastBindCallId=-1,this.buffer=e||null,this.updateID=-1,this.byteLength=-1,this.type=r}}class te{constructor(e){this._gpuBuffers=Object.create(null),this._boundBufferBases=Object.create(null),this._minBaseLocation=0,this._nextBindBaseIndex=this._minBaseLocation,this._bindCallId=0,this._renderer=e,this._renderer.renderableGC.addManagedHash(this,"_gpuBuffers")}destroy(){this._renderer=null,this._gl=null,this._gpuBuffers=null,this._boundBufferBases=null}contextChange(){const e=this._gl=this._renderer.gl;this._gpuBuffers=Object.create(null),this._maxBindings=e.MAX_UNIFORM_BUFFER_BINDINGS?e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS):0}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;this._boundBufferBases[r]!==e&&(this._boundBufferBases[r]=e,e._lastBindBaseLocation=r,s.bindBufferBase(s.UNIFORM_BUFFER,r,e.buffer))}nextBindBase(e){this._bindCallId++,this._minBaseLocation=0,e&&(this._boundBufferBases[0]=null,this._minBaseLocation=1,this._nextBindBaseIndex<1&&(this._nextBindBaseIndex=1))}freeLocationForBufferBase(e){let r=this.getLastBindBaseLocation(e);if(r>=this._minBaseLocation)return e._lastBindCallId=this._bindCallId,r;let s=0,n=this._nextBindBaseIndex;for(;s<2;){n>=this._maxBindings&&(n=this._minBaseLocation,s++);const i=this._boundBufferBases[n];if(i&&i._lastBindCallId===this._bindCallId){n++;continue}break}return r=n,this._nextBindBaseIndex=n+1,s>=2?-1:(e._lastBindCallId=this._bindCallId,this._boundBufferBases[r]=null,r)}getLastBindBaseLocation(e){const r=e._lastBindBaseLocation;return this._boundBufferBases[r]===e?r:-1}bindBufferRange(e,r,s,n){const{_gl:i}=this;s||(s=0),r||(r=0),this._boundBufferBases[r]=null,i.bindBufferRange(i.UNIFORM_BUFFER,r||0,e.buffer,s*256,n||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,i=e.descriptor.usage&B.STATIC?r.STATIC_DRAW:r.DYNAMIC_DRAW;return n?s.byteLength>=n.byteLength?r.bufferSubData(s.type,0,n,0,e._updateSize/n.BYTES_PER_ELEMENT):(s.byteLength=n.byteLength,r.bufferData(s.type,n,i)):(s.byteLength=e.descriptor.size,r.bufferData(s.type,s.byteLength,i)),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=v.ARRAY_BUFFER;e.descriptor.usage&B.INDEX?s=v.ELEMENT_ARRAY_BUFFER:e.descriptor.usage&B.UNIFORM&&(s=v.UNIFORM_BUFFER);const n=new Ve(r.createBuffer(),s);return this._gpuBuffers[e.uid]=n,e.on("destroy",this.onBufferDestroy,this),n}}te.extension={type:[d.WebGLSystem],name:"buffer"};const P=class re{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={...re.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=b.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:[d.WebGLSystem],name:"context"};P.defaultOptions={context:null,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:void 0,preferWebGLVersion:2,multiView:!1};let ke=P;var D=(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))(D||{}),se=(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))(se||{}),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 w={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 w[t]??w.float32}const We={"point-list":0,"line-list":1,"line-strip":3,"triangle-list":4,"triangle-strip":5};class ne{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}}ne.extension={type:[d.WebGLSystem],name:"geometry"};const je=new Be({attributes:{aPosition:[-1,-1,3,-1,-1,3]}}),F=class ie{constructor(e){this.useBackBuffer=!1,this._useBackBufferThisRender=!1,this._renderer=e}init(e={}){const{useBackBuffer:r,antialias:s}={...ie.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=O.for2d();const n=new Ae({vertex:` +import{E as d,B,w as m,D as b,K,a3 as Be,u as Ae,s as G,t as S,j as $,S as p,O as L,h as A,i as H,k as U,p as z,M as Y,a4 as q,a5 as Ne,a6 as ye,a7 as Z,a8 as Ie,e as x,A as De,R as Ce}from"./index-B5lVtmvj.js";import{S as O,b as Q}from"./colorToUniform-C2GHuDhf.js";import{e as Ge,G as Ue,c as Oe,b as Pe,U as Fe,R as Me,B as J,d as N,f as Le,S as He,a as we}from"./SharedSystems-Cql4UvKc.js";class ee{constructor(){this._didUpload=!1,this._tempState=O.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))(v||{});class Ve{constructor(e,r){this._lastBindBaseLocation=-1,this._lastBindCallId=-1,this.buffer=e||null,this.updateID=-1,this.byteLength=-1,this.type=r}}class te{constructor(e){this._gpuBuffers=Object.create(null),this._boundBufferBases=Object.create(null),this._minBaseLocation=0,this._nextBindBaseIndex=this._minBaseLocation,this._bindCallId=0,this._renderer=e,this._renderer.renderableGC.addManagedHash(this,"_gpuBuffers")}destroy(){this._renderer=null,this._gl=null,this._gpuBuffers=null,this._boundBufferBases=null}contextChange(){const e=this._gl=this._renderer.gl;this._gpuBuffers=Object.create(null),this._maxBindings=e.MAX_UNIFORM_BUFFER_BINDINGS?e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS):0}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;this._boundBufferBases[r]!==e&&(this._boundBufferBases[r]=e,e._lastBindBaseLocation=r,s.bindBufferBase(s.UNIFORM_BUFFER,r,e.buffer))}nextBindBase(e){this._bindCallId++,this._minBaseLocation=0,e&&(this._boundBufferBases[0]=null,this._minBaseLocation=1,this._nextBindBaseIndex<1&&(this._nextBindBaseIndex=1))}freeLocationForBufferBase(e){let r=this.getLastBindBaseLocation(e);if(r>=this._minBaseLocation)return e._lastBindCallId=this._bindCallId,r;let s=0,n=this._nextBindBaseIndex;for(;s<2;){n>=this._maxBindings&&(n=this._minBaseLocation,s++);const i=this._boundBufferBases[n];if(i&&i._lastBindCallId===this._bindCallId){n++;continue}break}return r=n,this._nextBindBaseIndex=n+1,s>=2?-1:(e._lastBindCallId=this._bindCallId,this._boundBufferBases[r]=null,r)}getLastBindBaseLocation(e){const r=e._lastBindBaseLocation;return this._boundBufferBases[r]===e?r:-1}bindBufferRange(e,r,s,n){const{_gl:i}=this;s||(s=0),r||(r=0),this._boundBufferBases[r]=null,i.bindBufferRange(i.UNIFORM_BUFFER,r||0,e.buffer,s*256,n||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,i=e.descriptor.usage&B.STATIC?r.STATIC_DRAW:r.DYNAMIC_DRAW;return n?s.byteLength>=n.byteLength?r.bufferSubData(s.type,0,n,0,e._updateSize/n.BYTES_PER_ELEMENT):(s.byteLength=n.byteLength,r.bufferData(s.type,n,i)):(s.byteLength=e.descriptor.size,r.bufferData(s.type,s.byteLength,i)),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=v.ARRAY_BUFFER;e.descriptor.usage&B.INDEX?s=v.ELEMENT_ARRAY_BUFFER:e.descriptor.usage&B.UNIFORM&&(s=v.UNIFORM_BUFFER);const n=new Ve(r.createBuffer(),s);return this._gpuBuffers[e.uid]=n,e.on("destroy",this.onBufferDestroy,this),n}}te.extension={type:[d.WebGLSystem],name:"buffer"};const P=class re{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={...re.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=b.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:[d.WebGLSystem],name:"context"};P.defaultOptions={context:null,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:void 0,preferWebGLVersion:2,multiView:!1};let ke=P;var D=(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))(D||{}),se=(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))(se||{}),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 w={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 w[t]??w.float32}const We={"point-list":0,"line-list":1,"line-strip":3,"triangle-list":4,"triangle-strip":5};class ne{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}}ne.extension={type:[d.WebGLSystem],name:"geometry"};const je=new Be({attributes:{aPosition:[-1,-1,3,-1,-1,3]}}),F=class ie{constructor(e){this.useBackBuffer=!1,this._useBackBufferThisRender=!1,this._renderer=e}init(e={}){const{useBackBuffer:r,antialias:s}={...ie.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=O.for2d();const n=new Ae({vertex:` attribute vec2 aPosition; out vec2 vUv; diff --git a/assets/WebGPURenderer-DO1jTWXi.js b/assets/WebGPURenderer-CKlOPZqb.js similarity index 99% rename from assets/WebGPURenderer-DO1jTWXi.js rename to assets/WebGPURenderer-CKlOPZqb.js index 6e5b4dc..823a3e2 100644 --- a/assets/WebGPURenderer-DO1jTWXi.js +++ b/assets/WebGPURenderer-CKlOPZqb.js @@ -1,4 +1,4 @@ -import{E as f,g as R,f as oe,D as T,S as C,B as P,b as ae,c as E,d as U,w as A,h as y,i as ue,j as ce,k as L,M as k,l as D,m as de,o as he,p as pe,q as H,s as z,t as M,e as B,A as le,R as fe}from"./index-D1nj3bjZ.js";import{S as F,l as ge,a as me}from"./colorToUniform-C2GHuDhf.js";import{c as _e,u as be,U as ye,B as xe,G as Ge,e as Be,R as Se,t as Pe,S as Te,a as Ce}from"./SharedSystems-CoG3pQxX.js";import{C as w}from"./CanvasPool-Dff9nFgq.js";const x=F.for2d();class O{start(e,t,r){const s=e.renderer,i=s.encoder,n=r.gpuProgram;this._shader=r,this._geometry=t,i.setGeometry(t,n),x.blendMode="normal",s.pipeline.getPipeline(t,n,x);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)}x.blendMode=t.blendMode;const n=s.bindGroup.getBindGroup(t.bindGroup,r,1),o=s.pipeline.getPipeline(this._geometry,r,x,t.topology);t.bindGroup._touch(s.textureGC.count),i.setPipeline(o),i.renderPassEncoder.setBindGroup(1,n),i.renderPassEncoder.drawIndexed(t.size,1,t.start)}}O.extension={type:[f.WebGPUPipesAdaptor],name:"batch"};class I{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 p in i){const h=e.resources[p]??e.resources[i[p]];let l;if(h._resourceType==="uniformGroup"){const d=h;o.ubo.updateUniformGroup(d);const _=d.buffer;l={buffer:o.buffer.getGPUBuffer(_),offset:0,size:_.descriptor.size}}else if(h._resourceType==="buffer"){const d=h;l={buffer:o.buffer.getGPUBuffer(d),offset:0,size:d.descriptor.size}}else if(h._resourceType==="bufferResource"){const d=h;l={buffer:o.buffer.getGPUBuffer(d.buffer),offset:d.offset,size:d.size}}else if(h._resourceType==="textureSampler"){const d=h;l=o.texture.getGpuSampler(d)}else if(h._resourceType==="textureSource"){const d=h;l=o.texture.getGpuSource(d).createView({})}n.push({binding:i[p],resource:l})}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}}I.extension={type:[f.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&&(oe(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:[f.WebGPUSystem],name:"buffer"};class ve{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 T.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}}v.extension={type:[f.WebGPUSystem],name:"device"};v.defaultOptions={powerPreference:void 0,forceFallbackAdapter:!1};class N{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}}N.extension={type:[f.WebGPUSystem],name:"encoder",priority:1};class j{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:C.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}}j.extension={type:[f.WebGPUSystem],name:"stencil"};const G={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 Ue(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 Me(a,e){const{size:t,align:r}=G[a.data.type],s=(r-t)/4,i=a.data.type.indexOf("i32")>=0?"dataInt32":"data";return` +import{E as f,g as R,f as oe,D as T,S as C,B as P,b as ae,c as E,d as U,w as A,h as y,i as ue,j as ce,k as L,M as k,l as D,m as de,o as he,p as pe,q as H,s as z,t as M,e as B,A as le,R as fe}from"./index-B5lVtmvj.js";import{S as F,l as ge,a as me}from"./colorToUniform-C2GHuDhf.js";import{c as _e,u as be,U as ye,B as xe,G as Ge,e as Be,R as Se,t as Pe,S as Te,a as Ce}from"./SharedSystems-Cql4UvKc.js";import{C as w}from"./CanvasPool-DQqeIevT.js";const x=F.for2d();class O{start(e,t,r){const s=e.renderer,i=s.encoder,n=r.gpuProgram;this._shader=r,this._geometry=t,i.setGeometry(t,n),x.blendMode="normal",s.pipeline.getPipeline(t,n,x);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)}x.blendMode=t.blendMode;const n=s.bindGroup.getBindGroup(t.bindGroup,r,1),o=s.pipeline.getPipeline(this._geometry,r,x,t.topology);t.bindGroup._touch(s.textureGC.count),i.setPipeline(o),i.renderPassEncoder.setBindGroup(1,n),i.renderPassEncoder.drawIndexed(t.size,1,t.start)}}O.extension={type:[f.WebGPUPipesAdaptor],name:"batch"};class I{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 p in i){const h=e.resources[p]??e.resources[i[p]];let l;if(h._resourceType==="uniformGroup"){const d=h;o.ubo.updateUniformGroup(d);const _=d.buffer;l={buffer:o.buffer.getGPUBuffer(_),offset:0,size:_.descriptor.size}}else if(h._resourceType==="buffer"){const d=h;l={buffer:o.buffer.getGPUBuffer(d),offset:0,size:d.descriptor.size}}else if(h._resourceType==="bufferResource"){const d=h;l={buffer:o.buffer.getGPUBuffer(d.buffer),offset:d.offset,size:d.size}}else if(h._resourceType==="textureSampler"){const d=h;l=o.texture.getGpuSampler(d)}else if(h._resourceType==="textureSource"){const d=h;l=o.texture.getGpuSource(d).createView({})}n.push({binding:i[p],resource:l})}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}}I.extension={type:[f.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&&(oe(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:[f.WebGPUSystem],name:"buffer"};class ve{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 T.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}}v.extension={type:[f.WebGPUSystem],name:"device"};v.defaultOptions={powerPreference:void 0,forceFallbackAdapter:!1};class N{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}}N.extension={type:[f.WebGPUSystem],name:"encoder",priority:1};class j{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:C.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}}j.extension={type:[f.WebGPUSystem],name:"stencil"};const G={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 Ue(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 Me(a,e){const{size:t,align:r}=G[a.data.type],s=(r-t)/4,i=a.data.type.indexOf("i32")>=0?"dataInt32":"data";return` v = uv.${a.data.name}; ${e!==0?`offset += ${e};`:""} diff --git a/assets/browserAll-C3Dbe2Hk.js b/assets/browserAll-CmPU-C4a.js similarity index 99% rename from assets/browserAll-C3Dbe2Hk.js rename to assets/browserAll-CmPU-C4a.js index 7e0b9dd..1732f77 100644 --- a/assets/browserAll-C3Dbe2Hk.js +++ b/assets/browserAll-CmPU-C4a.js @@ -1 +1 @@ -import{P as m,r as J,E as w,T as B,U as Q,a as ee,w as y,e as z,C as Z}from"./index-D1nj3bjZ.js";import"./webworkerAll-DKsR-o4z.js";import"./colorToUniform-C2GHuDhf.js";import"./CanvasPool-Dff9nFgq.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||(B.system.add(this._tickerUpdate,this,Q.INTERACTION),this._tickerAdded=!0)}removeTickerListener(){this._tickerAdded&&(B.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.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}};L.extension={name:"events",type:[w.WebGLSystem,w.CanvasSystem,w.WebGPUSystem],priority:-1};L.defaultEventFeatures={move:!0,globalMove:!0,click:!0,wheel:!0};let q=L;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,T as B,U as Q,a as ee,w as y,e as z,C as Z}from"./index-B5lVtmvj.js";import"./webworkerAll-DoE3MJwQ.js";import"./colorToUniform-C2GHuDhf.js";import"./CanvasPool-DQqeIevT.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||(B.system.add(this._tickerUpdate,this,Q.INTERACTION),this._tickerAdded=!0)}removeTickerListener(){this._tickerAdded&&(B.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.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}};L.extension={name:"events",type:[w.WebGLSystem,w.CanvasSystem,w.WebGPUSystem],priority:-1};L.defaultEventFeatures={move:!0,globalMove:!0,click:!0,wheel:!0};let q=L;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/assets/index-D1nj3bjZ.js b/assets/index-B5lVtmvj.js similarity index 97% rename from assets/index-D1nj3bjZ.js rename to assets/index-B5lVtmvj.js index 6d07e25..febd35d 100644 --- a/assets/index-D1nj3bjZ.js +++ b/assets/index-B5lVtmvj.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/browserAll-C3Dbe2Hk.js","assets/webworkerAll-DKsR-o4z.js","assets/colorToUniform-C2GHuDhf.js","assets/CanvasPool-Dff9nFgq.js","assets/WebGPURenderer-DO1jTWXi.js","assets/SharedSystems-CoG3pQxX.js","assets/WebGLRenderer-DIyxxzaL.js"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/browserAll-CmPU-C4a.js","assets/webworkerAll-DoE3MJwQ.js","assets/colorToUniform-C2GHuDhf.js","assets/CanvasPool-DQqeIevT.js","assets/WebGPURenderer-CKlOPZqb.js","assets/SharedSystems-Cql4UvKc.js","assets/WebGLRenderer-BL_L2csm.js"])))=>i.map(i=>d[i]); var Hw=Object.defineProperty;var Uw=(e,t,n)=>t in e?Hw(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var zn=(e,t,n)=>Uw(e,typeof t!="symbol"?t+"":t,n);function Gw(e,t){for(var n=0;ni[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))i(o);new MutationObserver(o=>{for(const a of o)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&i(l)}).observe(document,{childList:!0,subtree:!0});function n(o){const a={};return o.integrity&&(a.integrity=o.integrity),o.referrerPolicy&&(a.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?a.credentials="include":o.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function i(o){if(o.ep)return;o.ep=!0;const a=n(o);fetch(o.href,a)}})();function ra(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var gh={exports:{}},go={},yh={exports:{}},Ht={};/** * @license React * react.production.min.js @@ -201,7 +201,7 @@ export default theme;`}function fd(e={},...t){const{breakpoints:n,mixins:i={},sp } `,by={Label:RM,Filename:IM},$M=({text:e,isPlaceholder:t,placeholder:n,...i},o)=>U.jsxs(by.Label,{children:[U.jsx("input",{...i,ref:o}),e?U.jsx("span",{"aria-placeholder":n,className:t?"MuiFileInput-placeholder":"",children:typeof e=="string"?e:U.jsxs(by.Filename,{children:[U.jsx("span",{children:e.filename}),U.jsxs("span",{children:[".",e.extension]})]})}):null]}),zM=Pe.forwardRef($M);function OM(e){return e.length>0}function LM(e){return e.reduce((t,n)=>t+n.size,0)}function Sd(e){return typeof window<"u"&&e instanceof File}function BM(e){return Array.from(e)}function NM(e){var i;const t=(Sd(e)?e.name:((i=e[0])==null?void 0:i.name)||"").split("."),n=t.pop();return{filename:t.join("."),extension:n}}const FM=typeof window<"u"?Pe.useLayoutEffect:Pe.useEffect,Lv=Pe.forwardRef((e,t)=>{var W;const{value:n,onChange:i,disabled:o,getInputText:a,getSizeText:l,placeholder:c,hideSizeText:d,inputProps:f,InputProps:p,multiple:g,className:x,clearIconButtonProps:v={},...w}=e,{className:_="",...b}=v,T=Pe.useRef(null),{startAdornment:$,...P}=p||{},M=g||(f==null?void 0:f.multiple)||((W=p==null?void 0:p.inputProps)==null?void 0:W.multiple)||!1,A=()=>{T.current&&(T.current.value="")},O=Q=>{const V=Q.target.files,K=V?BM(V):[];g?(i==null||i(K),K.length===0&&A()):(i==null||i(K[0]||null),K[0]||A())},B=Q=>{Q.preventDefault(),!o&&(i==null||i(g?[]:null))},G=Array.isArray(n)?OM(n):Sd(n);FM(()=>{const Q=T.current;Q&&!G&&(Q.value="")},[G]);const J=()=>n===null||Array.isArray(n)&&n.length===0?c||"":typeof a=="function"&&n!==void 0?a(n):n&&G?Array.isArray(n)&&n.length>1?`${n.length} files`:NM(n):"",S=()=>{if(typeof l=="function"&&n!==void 0)return l(n);if(G){if(Array.isArray(n)){const Q=LM(n);return wy(Q)}if(Sd(n))return wy(n.size)}return""};return U.jsx(PM,{ref:t,type:"file",disabled:o,onChange:O,className:`MuiFileInput-TextField ${x||""}`,InputProps:{startAdornment:U.jsx(ay,{position:"start",children:$}),endAdornment:U.jsxs(ay,{position:"end",style:{visibility:G?"visible":"hidden"},children:[d?null:U.jsx(kv,{variant:"caption",mr:"2px",lineHeight:1,className:"MuiFileInput-Typography-size-text",children:S()}),U.jsx(Tk,{"aria-label":"Clear",title:"Clear",size:"small",disabled:o,className:`${_} MuiFileInput-ClearIconButton`,onClick:B,...b})]}),...P,inputProps:{text:J(),multiple:M,ref:T,isPlaceholder:!G,placeholder:c,...f,...p==null?void 0:p.inputProps},inputComponent:zM},...w})});class Zo{constructor(t,n){zn(this,"x",0);zn(this,"y",0);this.x=t,this.y=n}toString(){return`(${this.x}, ${this.y})`}}class DM{constructor(t){zn(this,"width",0);zn(this,"height",0);zn(this,"obstacles",new Map);this.parseGraph(t)}parseGraph(t){const n=t.trim().split(` `);if(n.length<4)throw new Error("Invalid map file");const i=Number(n[1].split(" ")[1]);if(i!==n.length-4)throw new Error("Invalid map file, check height");this.height=i;const o=Number(n[2].split(" ")[1]);this.width=o;let a=n.slice(4);for(let l=0;l{n(o),o&&o.text().then(a=>{let l=new DM(a);e(l)})};return U.jsxs(ri,{children:[U.jsx("h1",{children:"Map"}),U.jsx(Lv,{value:t,onChange:i,placeholder:"Select a map file"})]})}var Bv=(e=>(e[e.NONE=0]="NONE",e[e.X_MINUS=1]="X_MINUS",e[e.X_PLUS=2]="X_PLUS",e[e.Y_MINUS=3]="Y_MINUS",e[e.Y_PLUS=4]="Y_PLUS",e))(Bv||{});function Sy(e){switch(e){case 0:return 0;case 1:return Math.PI;case 2:return 0;case 3:return-Math.PI/2;case 4:return Math.PI/2}}function WM(e){switch(e){case"X_MINUS":return 1;case"X_PLUS":return 2;case"Y_MINUS":return 3;case"Y_PLUS":return 4;default:return 0}}class HM{constructor(t=new Zo(0,0),n=0){zn(this,"position",new Zo(0,0));zn(this,"orientation",0);this.position=t,this.orientation=n}}function UM(e){let t=e.trim().split(` -`),n=[];for(let i of t){let o=[];const a=/(\((\d+),(\d+),?([XY]{1}_[A-Z]{4,5})?\),)/g;for(;;){let l=a.exec(i);if(l===null)break;if(l===null||l.length!==5)throw new Error("Invalid solution");let c=Number(l[2]),d=Number(l[3]),f=WM(l[4]),p=new HM(new Zo(c,d),f);o.push(p)}n.push(o)}return n}function GM({onSolutionChange:e}){const[t,n]=Pe.useState(null),i=o=>{n(o),o&&o.text().then(a=>{e(UM(a))})};return U.jsxs(ri,{children:[U.jsx("h1",{children:"Solution"}),U.jsx(Lv,{value:t,onChange:i,placeholder:"Select a solution file"})]})}const VM=ui(U.jsx("path",{d:"M6 6h2v12H6zm3.5 6 8.5 6V6z"}),"SkipPrevious"),YM=ui(U.jsx("path",{d:"M8 5v14l11-7z"}),"PlayArrow"),XM=ui(U.jsx("path",{d:"M6 5h4v14H6zm8 0h4v14h-4z"}),"PauseTwoTone"),KM=ui(U.jsx("path",{d:"m6 18 8.5-6L6 6zM16 6v12h2V6z"}),"SkipNext"),qM=ui(U.jsx("path",{d:"M12 5V2L8 6l4 4V7c3.31 0 6 2.69 6 6 0 2.97-2.17 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93 0-4.42-3.58-8-8-8m-6 8c0-1.65.67-3.15 1.76-4.24L6.34 7.34C4.9 8.79 4 10.79 4 13c0 4.08 3.05 7.44 7 7.93v-2.02c-2.83-.48-5-2.94-5-5.91"}),"RestartAlt"),QM=ui(U.jsx("path",{d:"M7 7h10v3l4-4-4-4v3H5v6h2zm10 10H7v-3l-4 4 4 4v-3h12v-6h-2z"}),"Repeat"),ZM=ui(U.jsx("path",{fillRule:"evenodd",d:"M21 1H3c-1.1 0-2 .9-2 2v18c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V3c0-1.1-.9-2-2-2M7 7h10v3l4-4-4-4v3H5v6h2zm10 10H7v-3l-4 4 4 4v-3h12v-6h-2z"}),"RepeatOn");function JM({playAnimation:e,onPlayAnimationChange:t,onSkipBackward:n,onSkipForward:i,onRestart:o,onSpeedChange:a,loopAnimation:l,onLoopAnimationChange:c}){const d=(f,p)=>{f.preventDefault(),typeof p=="number"&&a(p)};return U.jsxs(ri,{display:"flex",flexDirection:"column",alignItems:"center",children:[U.jsx(ri,{display:"flex",justifyContent:"center",children:U.jsxs(Jg,{size:"large",variant:"outlined",children:[U.jsx(wo,{onClick:n,children:U.jsx(VM,{})}),U.jsx(wo,{onClick:()=>t(!e),children:e?U.jsx(XM,{}):U.jsx(YM,{})}),U.jsx(wo,{onClick:i,children:U.jsx(KM,{})})]})}),U.jsx(ri,{display:"flex",justifyContent:"center",children:U.jsxs(Jg,{size:"large",variant:"outlined",children:[U.jsx(wo,{onClick:o,children:U.jsx(qM,{})}),U.jsx(wo,{onClick:()=>c(!l),children:l?U.jsx(ZM,{}):U.jsx(QM,{})})]})}),U.jsx(ri,{sx:{width:1/2},display:"flex",justifyContent:"center",children:U.jsx(wM,{defaultValue:2,step:.2,marks:!0,min:.2,max:10,valueLabelDisplay:"auto",onChange:d})})]})}function tT({onGraphChange:e,onSolutionChange:t,playAnimation:n,onPlayAnimationChange:i,onSkipBackward:o,onSkipForward:a,onRestart:l,onSpeedChange:c,loopAnimation:d,onLoopAnimationChange:f}){const p="JustinShetty/mapf-visualizer";return U.jsxs(bM,{direction:"column",spacing:2,children:[U.jsx(jM,{onGraphChange:e}),U.jsx(Do,{}),U.jsx(GM,{onSolutionChange:t}),U.jsx(Do,{}),U.jsx(JM,{playAnimation:n,onPlayAnimationChange:i,onSkipBackward:o,onSkipForward:a,onRestart:l,onSpeedChange:c,loopAnimation:d,onLoopAnimationChange:f}),U.jsx(Do,{}),U.jsx("a",{target:"_blank",href:`https://github.com/${p}`,style:{color:"white"},children:p})]})}const eT="modulepreload",nT=function(e){return"/mapf-visualizer/"+e},_y={},ou=function(t,n,i){let o=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),c=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));o=Promise.allSettled(n.map(d=>{if(d=nT(d),d in _y)return;_y[d]=!0;const f=d.endsWith(".css"),p=f?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${p}`))return;const g=document.createElement("link");if(g.rel=f?"stylesheet":eT,f||(g.as="script"),g.crossOrigin="",g.href=d,c&&g.setAttribute("nonce",c),document.head.appendChild(g),f)return new Promise((x,v)=>{g.addEventListener("load",x),g.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${d}`)))})}))}function a(l){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=l,window.dispatchEvent(c),!c.defaultPrevented)throw l}return o.then(l=>{for(const c of l||[])c.status==="rejected"&&a(c.reason);return t().catch(a)})};var ne=(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))(ne||{});const _d=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},Rl=(e,t)=>_d(e).priority??t,vr={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...e){return e.map(_d).forEach(t=>{t.type.forEach(n=>{var i,o;return(o=(i=this._removeHandlers)[n])==null?void 0:o.call(i,t)})}),this},add(...e){return e.map(_d).forEach(t=>{t.type.forEach(n=>{var a,l;const i=this._addHandlers,o=this._queue;i[n]?(l=i[n])==null||l.call(i,t):(o[n]=o[n]||[],(a=o[n])==null||a.push(t))})}),this},handle(e,t,n){var l;const i=this._addHandlers,o=this._removeHandlers;if(i[e]||o[e])throw new Error(`Extension type ${e} already has a handler`);i[e]=t,o[e]=n;const a=this._queue;return a[e]&&((l=a[e])==null||l.forEach(c=>t(c)),delete a[e]),this},handleByMap(e,t){return this.handle(e,n=>{n.name&&(t[n.name]=n.ref)},n=>{n.name&&delete t[n.name]})},handleByNamedList(e,t,n=-1){return this.handle(e,i=>{t.findIndex(a=>a.name===i.name)>=0||(t.push({name:i.name,value:i.ref}),t.sort((a,l)=>Rl(l.value,n)-Rl(a.value,n)))},i=>{const o=t.findIndex(a=>a.name===i.name);o!==-1&&t.splice(o,1)})},handleByList(e,t,n=-1){return this.handle(e,i=>{t.includes(i.ref)||(t.push(i.ref),t.sort((o,a)=>Rl(a,n)-Rl(o,n)))},i=>{const o=t.indexOf(i.ref);o!==-1&&t.splice(o,1)})}},rT={extension:{type:ne.Environment,name:"browser",priority:-1},test:()=>!0,load:async()=>{await ou(()=>import("./browserAll-C3Dbe2Hk.js"),__vite__mapDeps([0,1,2,3]))}},iT={extension:{type:ne.Environment,name:"webworker",priority:0},test:()=>typeof self<"u"&&self.WorkerGlobalScope!==void 0,load:async()=>{await ou(()=>import("./webworkerAll-DKsR-o4z.js"),__vite__mapDeps([1,2,3]))}};class bn{constructor(t,n,i){this._x=n||0,this._y=i||0,this._observer=t}clone(t){return new bn(t??this._observer,this._x,this._y)}set(t=0,n=t){return(this._x!==t||this._y!==n)&&(this._x=t,this._y=n,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))}}var zh={exports:{}},Cy;function sT(){return Cy||(Cy=1,function(e){var t=Object.prototype.hasOwnProperty,n="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(n=!1));function o(d,f,p){this.fn=d,this.context=f,this.once=p||!1}function a(d,f,p,g,x){if(typeof p!="function")throw new TypeError("The listener must be a function");var v=new o(p,g||d,x),w=n?n+f:f;return d._events[w]?d._events[w].fn?d._events[w]=[d._events[w],v]:d._events[w].push(v):(d._events[w]=v,d._eventsCount++),d}function l(d,f){--d._eventsCount===0?d._events=new i:delete d._events[f]}function c(){this._events=new i,this._eventsCount=0}c.prototype.eventNames=function(){var f=[],p,g;if(this._eventsCount===0)return f;for(g in p=this._events)t.call(p,g)&&f.push(n?g.slice(1):g);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(p)):f},c.prototype.listeners=function(f){var p=n?n+f:f,g=this._events[p];if(!g)return[];if(g.fn)return[g.fn];for(var x=0,v=g.length,w=new Array(v);xEi[e],uY:e=>Ai[e],vX:e=>Ri[e],vY:e=>Ii[e],inv:e=>e&8?e&15:-e&7,add:(e,t)=>Cd[e][t],sub:(e,t)=>Cd[e][be.inv(t)],rotate180:e=>e^4,isVertical:e=>(e&3)===2,byDirection:(e,t)=>Math.abs(e)*2<=Math.abs(t)?t>=0?be.S:be.N:Math.abs(t)*2<=Math.abs(e)?e>0?be.E:be.W:t>0?e>0?be.SE:be.SW:e>0?be.NE:be.NW,matrixAppendRotationInv:(e,t,n=0,i=0)=>{const o=Nv[be.inv(t)];o.tx=n,o.ty=i,e.append(o)}},$l=[new Vt,new Vt,new Vt,new Vt];class Ae{constructor(t=0,n=0,i=0,o=0){this.type="rectangle",this.x=Number(t),this.y=Number(n),this.width=Number(i),this.height=Number(o)}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 Ae(0,0,0,0)}clone(){return new Ae(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,n){return this.width<=0||this.height<=0?!1:t>=this.x&&t=this.y&&n=g&&t<=x&&n>=v&&n<=w&&!(t>_&&tT&&n<$)}intersects(t,n){if(!n){const G=this.xt.right?t.right:this.right)<=G)return!1;const S=this.yt.bottom?t.bottom:this.bottom)>S}const i=this.left,o=this.right,a=this.top,l=this.bottom;if(o<=i||l<=a)return!1;const c=$l[0].set(t.left,t.top),d=$l[1].set(t.left,t.bottom),f=$l[2].set(t.right,t.top),p=$l[3].set(t.right,t.bottom);if(f.x<=c.x||d.y<=c.y)return!1;const g=Math.sign(n.a*n.d-n.b*n.c);if(g===0||(n.apply(c,c),n.apply(d,d),n.apply(f,f),n.apply(p,p),Math.max(c.x,d.x,f.x,p.x)<=i||Math.min(c.x,d.x,f.x,p.x)>=o||Math.max(c.y,d.y,f.y,p.y)<=a||Math.min(c.y,d.y,f.y,p.y)>=l))return!1;const x=g*(d.y-c.y),v=g*(c.x-d.x),w=x*i+v*a,_=x*o+v*a,b=x*i+v*l,T=x*o+v*l;if(Math.max(w,_,b,T)<=x*c.x+v*c.y||Math.min(w,_,b,T)>=x*p.x+v*p.y)return!1;const $=g*(c.y-f.y),P=g*(f.x-c.x),M=$*i+P*a,A=$*o+P*a,O=$*i+P*l,B=$*o+P*l;return!(Math.max(M,A,O,B)<=$*c.x+P*c.y||Math.min(M,A,O,B)>=$*p.x+P*p.y)}pad(t=0,n=t){return this.x-=t,this.y-=n,this.width+=t*2,this.height+=n*2,this}fit(t){const n=Math.max(this.x,t.x),i=Math.min(this.x+this.width,t.x+t.width),o=Math.max(this.y,t.y),a=Math.min(this.y+this.height,t.y+t.height);return this.x=n,this.width=Math.max(i-n,0),this.y=o,this.height=Math.max(a-o,0),this}ceil(t=1,n=.001){const i=Math.ceil((this.x+this.width-n)*t)/t,o=Math.ceil((this.y+this.height-n)*t)/t;return this.x=Math.floor((this.x+n)*t)/t,this.y=Math.floor((this.y+n)*t)/t,this.width=i-this.x,this.height=o-this.y,this}enlarge(t){const n=Math.min(this.x,t.x),i=Math.max(this.x+this.width,t.x+t.width),o=Math.min(this.y,t.y),a=Math.max(this.y+this.height,t.y+t.height);return this.x=n,this.width=i-n,this.y=o,this.height=a-o,this}getBounds(t){return t||(t=new Ae),t.copyFrom(this),t}toString(){return`[pixi.js/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}}const Lh={default:-1};function Fe(e="default"){return Lh[e]===void 0&&(Lh[e]=-1),++Lh[e]}const ky={},Ne="8.0.0",fT="8.3.4";function ke(e,t,n=3){if(ky[t])return;let i=new Error().stack;typeof i>"u"?console.warn("PixiJS Deprecation Warning: ",`${t} +`),n=[];for(let i of t){let o=[];const a=/(\((\d+),(\d+),?([XY]{1}_[A-Z]{4,5})?\),)/g;for(;;){let l=a.exec(i);if(l===null)break;if(l===null||l.length!==5)throw new Error("Invalid solution");let c=Number(l[2]),d=Number(l[3]),f=WM(l[4]),p=new HM(new Zo(c,d),f);o.push(p)}if(o.length===0)throw new Error("Invalid solution");n.push(o)}return n}function GM({onSolutionChange:e}){const[t,n]=Pe.useState(null),i=o=>{n(o),o&&o.text().then(a=>{e(UM(a))})};return U.jsxs(ri,{children:[U.jsx("h1",{children:"Solution"}),U.jsx(Lv,{value:t,onChange:i,placeholder:"Select a solution file"})]})}const VM=ui(U.jsx("path",{d:"M6 6h2v12H6zm3.5 6 8.5 6V6z"}),"SkipPrevious"),YM=ui(U.jsx("path",{d:"M8 5v14l11-7z"}),"PlayArrow"),XM=ui(U.jsx("path",{d:"M6 5h4v14H6zm8 0h4v14h-4z"}),"PauseTwoTone"),KM=ui(U.jsx("path",{d:"m6 18 8.5-6L6 6zM16 6v12h2V6z"}),"SkipNext"),qM=ui(U.jsx("path",{d:"M12 5V2L8 6l4 4V7c3.31 0 6 2.69 6 6 0 2.97-2.17 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93 0-4.42-3.58-8-8-8m-6 8c0-1.65.67-3.15 1.76-4.24L6.34 7.34C4.9 8.79 4 10.79 4 13c0 4.08 3.05 7.44 7 7.93v-2.02c-2.83-.48-5-2.94-5-5.91"}),"RestartAlt"),QM=ui(U.jsx("path",{d:"M7 7h10v3l4-4-4-4v3H5v6h2zm10 10H7v-3l-4 4 4 4v-3h12v-6h-2z"}),"Repeat"),ZM=ui(U.jsx("path",{fillRule:"evenodd",d:"M21 1H3c-1.1 0-2 .9-2 2v18c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V3c0-1.1-.9-2-2-2M7 7h10v3l4-4-4-4v3H5v6h2zm10 10H7v-3l-4 4 4 4v-3h12v-6h-2z"}),"RepeatOn");function JM({playAnimation:e,onPlayAnimationChange:t,onSkipBackward:n,onSkipForward:i,onRestart:o,onSpeedChange:a,loopAnimation:l,onLoopAnimationChange:c}){const d=(f,p)=>{f.preventDefault(),typeof p=="number"&&a(p)};return U.jsxs(ri,{display:"flex",flexDirection:"column",alignItems:"center",children:[U.jsx(ri,{display:"flex",justifyContent:"center",children:U.jsxs(Jg,{size:"large",variant:"outlined",children:[U.jsx(wo,{onClick:n,children:U.jsx(VM,{})}),U.jsx(wo,{onClick:()=>t(!e),children:e?U.jsx(XM,{}):U.jsx(YM,{})}),U.jsx(wo,{onClick:i,children:U.jsx(KM,{})})]})}),U.jsx(ri,{display:"flex",justifyContent:"center",children:U.jsxs(Jg,{size:"large",variant:"outlined",children:[U.jsx(wo,{onClick:o,children:U.jsx(qM,{})}),U.jsx(wo,{onClick:()=>c(!l),children:l?U.jsx(ZM,{}):U.jsx(QM,{})})]})}),U.jsx(ri,{sx:{width:1/2},display:"flex",justifyContent:"center",children:U.jsx(wM,{defaultValue:2,step:.2,marks:!0,min:.2,max:10,valueLabelDisplay:"auto",onChange:d})})]})}function tT({onGraphChange:e,onSolutionChange:t,playAnimation:n,onPlayAnimationChange:i,onSkipBackward:o,onSkipForward:a,onRestart:l,onSpeedChange:c,loopAnimation:d,onLoopAnimationChange:f}){const p="JustinShetty/mapf-visualizer";return U.jsxs(bM,{direction:"column",spacing:2,children:[U.jsx(jM,{onGraphChange:e}),U.jsx(Do,{}),U.jsx(GM,{onSolutionChange:t}),U.jsx(Do,{}),U.jsx(JM,{playAnimation:n,onPlayAnimationChange:i,onSkipBackward:o,onSkipForward:a,onRestart:l,onSpeedChange:c,loopAnimation:d,onLoopAnimationChange:f}),U.jsx(Do,{}),U.jsx("a",{target:"_blank",href:`https://github.com/${p}`,style:{color:"white"},children:p})]})}const eT="modulepreload",nT=function(e){return"/mapf-visualizer/"+e},_y={},ou=function(t,n,i){let o=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),c=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));o=Promise.allSettled(n.map(d=>{if(d=nT(d),d in _y)return;_y[d]=!0;const f=d.endsWith(".css"),p=f?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${p}`))return;const g=document.createElement("link");if(g.rel=f?"stylesheet":eT,f||(g.as="script"),g.crossOrigin="",g.href=d,c&&g.setAttribute("nonce",c),document.head.appendChild(g),f)return new Promise((x,v)=>{g.addEventListener("load",x),g.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${d}`)))})}))}function a(l){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=l,window.dispatchEvent(c),!c.defaultPrevented)throw l}return o.then(l=>{for(const c of l||[])c.status==="rejected"&&a(c.reason);return t().catch(a)})};var ne=(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))(ne||{});const _d=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},Rl=(e,t)=>_d(e).priority??t,vr={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...e){return e.map(_d).forEach(t=>{t.type.forEach(n=>{var i,o;return(o=(i=this._removeHandlers)[n])==null?void 0:o.call(i,t)})}),this},add(...e){return e.map(_d).forEach(t=>{t.type.forEach(n=>{var a,l;const i=this._addHandlers,o=this._queue;i[n]?(l=i[n])==null||l.call(i,t):(o[n]=o[n]||[],(a=o[n])==null||a.push(t))})}),this},handle(e,t,n){var l;const i=this._addHandlers,o=this._removeHandlers;if(i[e]||o[e])throw new Error(`Extension type ${e} already has a handler`);i[e]=t,o[e]=n;const a=this._queue;return a[e]&&((l=a[e])==null||l.forEach(c=>t(c)),delete a[e]),this},handleByMap(e,t){return this.handle(e,n=>{n.name&&(t[n.name]=n.ref)},n=>{n.name&&delete t[n.name]})},handleByNamedList(e,t,n=-1){return this.handle(e,i=>{t.findIndex(a=>a.name===i.name)>=0||(t.push({name:i.name,value:i.ref}),t.sort((a,l)=>Rl(l.value,n)-Rl(a.value,n)))},i=>{const o=t.findIndex(a=>a.name===i.name);o!==-1&&t.splice(o,1)})},handleByList(e,t,n=-1){return this.handle(e,i=>{t.includes(i.ref)||(t.push(i.ref),t.sort((o,a)=>Rl(a,n)-Rl(o,n)))},i=>{const o=t.indexOf(i.ref);o!==-1&&t.splice(o,1)})}},rT={extension:{type:ne.Environment,name:"browser",priority:-1},test:()=>!0,load:async()=>{await ou(()=>import("./browserAll-CmPU-C4a.js"),__vite__mapDeps([0,1,2,3]))}},iT={extension:{type:ne.Environment,name:"webworker",priority:0},test:()=>typeof self<"u"&&self.WorkerGlobalScope!==void 0,load:async()=>{await ou(()=>import("./webworkerAll-DoE3MJwQ.js"),__vite__mapDeps([1,2,3]))}};class bn{constructor(t,n,i){this._x=n||0,this._y=i||0,this._observer=t}clone(t){return new bn(t??this._observer,this._x,this._y)}set(t=0,n=t){return(this._x!==t||this._y!==n)&&(this._x=t,this._y=n,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))}}var zh={exports:{}},Cy;function sT(){return Cy||(Cy=1,function(e){var t=Object.prototype.hasOwnProperty,n="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(n=!1));function o(d,f,p){this.fn=d,this.context=f,this.once=p||!1}function a(d,f,p,g,x){if(typeof p!="function")throw new TypeError("The listener must be a function");var v=new o(p,g||d,x),w=n?n+f:f;return d._events[w]?d._events[w].fn?d._events[w]=[d._events[w],v]:d._events[w].push(v):(d._events[w]=v,d._eventsCount++),d}function l(d,f){--d._eventsCount===0?d._events=new i:delete d._events[f]}function c(){this._events=new i,this._eventsCount=0}c.prototype.eventNames=function(){var f=[],p,g;if(this._eventsCount===0)return f;for(g in p=this._events)t.call(p,g)&&f.push(n?g.slice(1):g);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(p)):f},c.prototype.listeners=function(f){var p=n?n+f:f,g=this._events[p];if(!g)return[];if(g.fn)return[g.fn];for(var x=0,v=g.length,w=new Array(v);xEi[e],uY:e=>Ai[e],vX:e=>Ri[e],vY:e=>Ii[e],inv:e=>e&8?e&15:-e&7,add:(e,t)=>Cd[e][t],sub:(e,t)=>Cd[e][be.inv(t)],rotate180:e=>e^4,isVertical:e=>(e&3)===2,byDirection:(e,t)=>Math.abs(e)*2<=Math.abs(t)?t>=0?be.S:be.N:Math.abs(t)*2<=Math.abs(e)?e>0?be.E:be.W:t>0?e>0?be.SE:be.SW:e>0?be.NE:be.NW,matrixAppendRotationInv:(e,t,n=0,i=0)=>{const o=Nv[be.inv(t)];o.tx=n,o.ty=i,e.append(o)}},$l=[new Vt,new Vt,new Vt,new Vt];class Ae{constructor(t=0,n=0,i=0,o=0){this.type="rectangle",this.x=Number(t),this.y=Number(n),this.width=Number(i),this.height=Number(o)}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 Ae(0,0,0,0)}clone(){return new Ae(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,n){return this.width<=0||this.height<=0?!1:t>=this.x&&t=this.y&&n=g&&t<=x&&n>=v&&n<=w&&!(t>_&&tT&&n<$)}intersects(t,n){if(!n){const G=this.xt.right?t.right:this.right)<=G)return!1;const S=this.yt.bottom?t.bottom:this.bottom)>S}const i=this.left,o=this.right,a=this.top,l=this.bottom;if(o<=i||l<=a)return!1;const c=$l[0].set(t.left,t.top),d=$l[1].set(t.left,t.bottom),f=$l[2].set(t.right,t.top),p=$l[3].set(t.right,t.bottom);if(f.x<=c.x||d.y<=c.y)return!1;const g=Math.sign(n.a*n.d-n.b*n.c);if(g===0||(n.apply(c,c),n.apply(d,d),n.apply(f,f),n.apply(p,p),Math.max(c.x,d.x,f.x,p.x)<=i||Math.min(c.x,d.x,f.x,p.x)>=o||Math.max(c.y,d.y,f.y,p.y)<=a||Math.min(c.y,d.y,f.y,p.y)>=l))return!1;const x=g*(d.y-c.y),v=g*(c.x-d.x),w=x*i+v*a,_=x*o+v*a,b=x*i+v*l,T=x*o+v*l;if(Math.max(w,_,b,T)<=x*c.x+v*c.y||Math.min(w,_,b,T)>=x*p.x+v*p.y)return!1;const $=g*(c.y-f.y),P=g*(f.x-c.x),M=$*i+P*a,A=$*o+P*a,O=$*i+P*l,B=$*o+P*l;return!(Math.max(M,A,O,B)<=$*c.x+P*c.y||Math.min(M,A,O,B)>=$*p.x+P*p.y)}pad(t=0,n=t){return this.x-=t,this.y-=n,this.width+=t*2,this.height+=n*2,this}fit(t){const n=Math.max(this.x,t.x),i=Math.min(this.x+this.width,t.x+t.width),o=Math.max(this.y,t.y),a=Math.min(this.y+this.height,t.y+t.height);return this.x=n,this.width=Math.max(i-n,0),this.y=o,this.height=Math.max(a-o,0),this}ceil(t=1,n=.001){const i=Math.ceil((this.x+this.width-n)*t)/t,o=Math.ceil((this.y+this.height-n)*t)/t;return this.x=Math.floor((this.x+n)*t)/t,this.y=Math.floor((this.y+n)*t)/t,this.width=i-this.x,this.height=o-this.y,this}enlarge(t){const n=Math.min(this.x,t.x),i=Math.max(this.x+this.width,t.x+t.width),o=Math.min(this.y,t.y),a=Math.max(this.y+this.height,t.y+t.height);return this.x=n,this.width=i-n,this.y=o,this.height=a-o,this}getBounds(t){return t||(t=new Ae),t.copyFrom(this),t}toString(){return`[pixi.js/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}}const Lh={default:-1};function Fe(e="default"){return Lh[e]===void 0&&(Lh[e]=-1),++Lh[e]}const ky={},Ne="8.0.0",fT="8.3.4";function ke(e,t,n=3){if(ky[t])return;let i=new Error().stack;typeof i>"u"?console.warn("PixiJS Deprecation Warning: ",`${t} Deprecated since v${e}`):(i=i.split(` `).splice(n).join(` `),console.groupCollapsed?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",`${t} @@ -224,7 +224,7 @@ Deprecated since v${e}`),console.warn(i))),ky[t]=!0}const Fv=()=>{};function Py( `}function hE(e,t,n){const i=n?t.maxSupportedFragmentPrecision:t.maxSupportedVertexPrecision;if(e.substring(0,9)!=="precision"){let o=n?t.requestedFragmentPrecision:t.requestedVertexPrecision;return o==="highp"&&i!=="highp"&&(o="mediump"),`precision ${o} float; ${e}`}else if(i!=="highp"&&e.substring(0,15)==="precision highp")return e.replace("precision highp","precision mediump");return e}function dE(e,t){return t?`#version 300 es ${e}`:e}const fE={},pE={};function mE(e,{name:t="pixi-program"},n=!0){t=t.replace(/\s+/g,"-"),t+=n?"-fragment":"-vertex";const i=n?fE:pE;return i[t]?(i[t]++,t+=`-${i[t]}`):i[t]=1,e.indexOf("#define SHADER_NAME")!==-1?e:`${`#define SHADER_NAME ${t}`} -${e}`}function gE(e,t){return t?e.replace("#version 300 es",""):e}const Xh={stripVersion:gE,ensurePrecision:hE,addProgramDefines:cE,setProgramName:mE,insertVersion:dE},Kh=Object.create(null),yx=class Ad{constructor(t){t={...Ad.defaultOptions,...t};const n=t.fragment.indexOf("#version 300 es")!==-1,i={stripVersion:n,ensurePrecision:{requestedFragmentPrecision:t.preferredFragmentPrecision,requestedVertexPrecision:t.preferredVertexPrecision,maxSupportedVertexPrecision:"highp",maxSupportedFragmentPrecision:uE()},setProgramName:{name:t.name},addProgramDefines:n,insertVersion:n};let o=t.fragment,a=t.vertex;Object.keys(Xh).forEach(l=>{const c=i[l];o=Xh[l](o,c,!0),a=Xh[l](a,c,!1)}),this.fragment=o,this.vertex=a,this.transformFeedbackVaryings=t.transformFeedbackVaryings,this._key=vf(`${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 n=`${t.vertex}:${t.fragment}`;return Kh[n]||(Kh[n]=new Ad(t)),Kh[n]}};yx.defaultOptions={preferredVertexPrecision:"highp",preferredFragmentPrecision:"mediump"};let vx=yx;const Xy={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 yE(e){return Xy[e]??Xy.float32}const vE={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 xE({source:e,entryPoint:t}){const n={},i=e.indexOf(`fn ${t}`);if(i!==-1){const o=e.indexOf("->",i);if(o!==-1){const a=e.substring(i,o),l=/@location\((\d+)\)\s+([a-zA-Z0-9_]+)\s*:\s*([a-zA-Z0-9_<>]+)(?:,|\s|$)/g;let c;for(;(c=l.exec(a))!==null;){const d=vE[c[3]]??"float32";n[c[2]]={location:parseInt(c[1],10),format:d,stride:yE(d).stride,offset:0,instance:!1,start:0}}}}return n}function qh(e){var g,x;const t=/(^|[^/])@(group|binding)\(\d+\)[^;]+;/g,n=/@group\((\d+)\)/,i=/@binding\((\d+)\)/,o=/var(<[^>]+>)? (\w+)/,a=/:\s*(\w+)/,l=/struct\s+(\w+)\s*{([^}]+)}/g,c=/(\w+)\s*:\s*([\w\<\>]+)/g,d=/struct\s+(\w+)/,f=(g=e.match(t))==null?void 0:g.map(v=>({group:parseInt(v.match(n)[1],10),binding:parseInt(v.match(i)[1],10),name:v.match(o)[2],isUniform:v.match(o)[1]==="",type:v.match(a)[1]}));if(!f)return{groups:[],structs:[]};const p=((x=e.match(l))==null?void 0:x.map(v=>{const w=v.match(d)[1],_=v.match(c).reduce((b,T)=>{const[$,P]=T.split(":");return b[$.trim()]=P.trim(),b},{});return _?{name:w,members:_}:null}).filter(({name:v})=>f.some(w=>w.type===v)))??[];return{groups:f,structs:p}}var Oo=(e=>(e[e.VERTEX=1]="VERTEX",e[e.FRAGMENT=2]="FRAGMENT",e[e.COMPUTE=4]="COMPUTE",e))(Oo||{});function wE({groups:e}){const t=[];for(let n=0;nn.has(l.name)?!1:(n.add(l.name),!0)),a=[...e.groups,...t.groups].filter(l=>{const c=`${l.name}-${l.binding}`;return i.has(c)?!1:(i.add(c),!0)});return{structs:o,groups:a}}const Qh=Object.create(null);class Au{constructor(t){var c,d;this._layoutKey=0,this._attributeLocationsKey=0;const{fragment:n,vertex:i,layout:o,gpuLayout:a,name:l}=t;if(this.name=l,this.fragment=n,this.vertex=i,n.source===i.source){const f=qh(n.source);this.structsAndGroups=f}else{const f=qh(i.source),p=qh(n.source);this.structsAndGroups=SE(f,p)}this.layout=o??bE(this.structsAndGroups),this.gpuLayout=a??wE(this.structsAndGroups),this.autoAssignGlobalUniforms=((c=this.layout[0])==null?void 0:c.globalUniforms)!==void 0,this.autoAssignLocalUniforms=((d=this.layout[1])==null?void 0:d.localUniforms)!==void 0,this._generateProgramKey()}_generateProgramKey(){const{vertex:t,fragment:n}=this,i=t.source+n.source+t.entryPoint+n.entryPoint;this._layoutKey=vf(i,"program")}get attributeData(){return this._attributeData??(this._attributeData=xE(this.vertex)),this._attributeData}destroy(){this.gpuLayout=null,this.layout=null,this.structsAndGroups=null,this.fragment=null,this.vertex=null}static from(t){const n=`${t.vertex.source}:${t.fragment.source}:${t.fragment.entryPoint}:${t.vertex.entryPoint}`;return Qh[n]||(Qh[n]=new Au(t)),Qh[n]}}const xx=["f32","i32","vec2","vec3","vec4","mat2x2","mat3x3","mat4x4","mat3x2","mat4x2","mat2x3","mat4x3","mat2x4","mat3x4","vec2","vec3","vec4"],_E=xx.reduce((e,t)=>(e[t]=!0,e),{});function CE(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 wx=class bx{constructor(t,n){this._touched=0,this.uid=Fe("uniform"),this._resourceType="uniformGroup",this._resourceId=Fe("resource"),this.isUniformGroup=!0,this._dirtyId=0,this.destroyed=!1,n={...bx.defaultOptions,...n},this.uniformStructures=t;const i={};for(const o in t){const a=t[o];if(a.name=o,a.size=a.size??1,!_E[a.type])throw new Error(`Uniform type ${a.type} is not supported. Supported uniform types are: ${xx.join(", ")}`);a.value??(a.value=CE(a.type,a.size)),i[o]=a.value}this.uniforms=i,this._dirtyId=1,this.ubo=n.ubo,this.isStatic=n.isStatic,this._signature=vf(Object.keys(i).map(o=>`${o}-${t[o].type}`).join("-"),"uniform-group")}update(){this._dirtyId++}};wx.defaultOptions={ubo:!1,isStatic:!1};let Sx=wx;class Xl{constructor(t){this.resources=Object.create(null),this._dirty=!0;let n=0;for(const i in t){const o=t[i];this.setResource(o,n++)}this._updateKey()}_updateKey(){if(!this._dirty)return;this._dirty=!1;const t=[];let n=0;for(const i in this.resources)t[n++]=this.resources[i]._resourceId;this._key=t.join("|")}setResource(t,n){var o,a;const i=this.resources[n];t!==i&&(i&&((o=t.off)==null||o.call(t,"change",this.onResourceChange,this)),(a=t.on)==null||a.call(t,"change",this.onResourceChange,this),this.resources[n]=t,this._dirty=!0)}getResource(t){return this.resources[t]}_touch(t){const n=this.resources;for(const i in n)n[i]._touched=t}destroy(){var n;const t=this.resources;for(const i in t){const o=t[i];(n=o.off)==null||n.call(o,"change",this.onResourceChange,this)}this.resources=null}onResourceChange(t){if(this._dirty=!0,t.destroyed){const n=this.resources;for(const i in n)n[i]===t&&(n[i]=null)}else this._updateKey()}}var Rd=(e=>(e[e.WEBGL=1]="WEBGL",e[e.WEBGPU=2]="WEBGPU",e[e.BOTH=3]="BOTH",e))(Rd||{});class xf extends Or{constructor(t){super(),this._uniformBindMap=Object.create(null),this._ownedBindGroups=[];let{gpuProgram:n,glProgram:i,groups:o,resources:a,compatibleRenderers:l,groupMap:c}=t;this.gpuProgram=n,this.glProgram=i,l===void 0&&(l=0,n&&(l|=Rd.WEBGPU),i&&(l|=Rd.WEBGL)),this.compatibleRenderers=l;const d={};if(!a&&!o&&(a={}),a&&o)throw new Error("[Shader] Cannot have both resources and groups");if(!n&&o&&!c)throw new Error("[Shader] No group map or WebGPU shader provided - consider using resources instead.");if(!n&&o&&c)for(const f in c)for(const p in c[f]){const g=c[f][p];d[g]={group:f,binding:p,name:g}}else if(n&&o&&!c){const f=n.structsAndGroups.groups;c={},f.forEach(p=>{c[p.group]=c[p.group]||{},c[p.group][p.binding]=p.name,d[p.name]=p})}else if(a){o={},c={},n&&n.structsAndGroups.groups.forEach(g=>{c[g.group]=c[g.group]||{},c[g.group][g.binding]=g.name,d[g.name]=g});let f=0;for(const p in a)d[p]||(o[99]||(o[99]=new Xl,this._ownedBindGroups.push(o[99])),d[p]={group:99,binding:f,name:p},c[99]=c[99]||{},c[99][f]=p,f++);for(const p in a){const g=p;let x=a[p];!x.source&&!x._resourceType&&(x=new Sx(x));const v=d[g];v&&(o[v.group]||(o[v.group]=new Xl,this._ownedBindGroups.push(o[v.group])),o[v.group].setResource(x,v.binding))}}this.groups=o,this._uniformBindMap=c,this.resources=this._buildResourceAccessor(o,d)}addResource(t,n,i){var o,a;(o=this._uniformBindMap)[n]||(o[n]={}),(a=this._uniformBindMap[n])[i]||(a[i]=t),this.groups[n]||(this.groups[n]=new Xl,this._ownedBindGroups.push(this.groups[n]))}_buildResourceAccessor(t,n){const i={};for(const o in n){const a=n[o];Object.defineProperty(i,a.name,{get(){return t[a.group].getResource(a.binding)},set(l){t[a.group].setResource(l,a.binding)}})}return i}destroy(t=!1){var n,i;this.emit("destroy",this),t&&((n=this.gpuProgram)==null||n.destroy(),(i=this.glProgram)==null||i.destroy()),this.gpuProgram=null,this.glProgram=null,this.removeAllListeners(),this._uniformBindMap=null,this._ownedBindGroups.forEach(o=>{o.destroy()}),this._ownedBindGroups=null,this.resources=null,this.groups=null}static from(t){const{gpu:n,gl:i,...o}=t;let a,l;return n&&(a=Au.from(n)),i&&(l=vx.from(i)),new xf({gpuProgram:a,glProgram:l,...o})}}const Id=[];vr.handleByNamedList(ne.Environment,Id);async function kE(e){if(!e)for(let t=0;t80*R){q=nt=k[0],rt=ht=k[1];for(var lt=R;ltnt&&(nt=dt),ut>ht&&(ht=ut);pt=Math.max(nt-q,ht-rt),pt=pt!==0?32767/pt:0}return i(E,F,R,q,rt,pt,0),F}function t(k,I,R,L,D){var E,F;if(D===tt(k,I,R,L)>0)for(E=I;E=I;E-=L)F=Q(E,k[E],k[E+1],F);return F&&M(F,F.next)&&(V(F),F=F.next),F}function n(k,I){if(!k)return k;I||(I=k);var R=k,L;do if(L=!1,!R.steiner&&(M(R,R.next)||P(R.prev,R,R.next)===0)){if(V(R),R=I=R.prev,R===R.next)break;L=!0}else R=R.next;while(L||R!==I);return I}function i(k,I,R,L,D,E,F){if(k){!F&&E&&v(k,L,D,E);for(var q=k,rt,nt;k.prev!==k.next;){if(rt=k.prev,nt=k.next,E?a(k,L,D,E):o(k)){I.push(rt.i/R|0),I.push(k.i/R|0),I.push(nt.i/R|0),V(k),k=nt.next,q=nt.next;continue}if(k=nt,k===q){F?F===1?(k=l(n(k),I,R),i(k,I,R,L,D,E,2)):F===2&&c(k,I,R,L,D,E):i(n(k),I,R,L,D,E,1);break}}}}function o(k){var I=k.prev,R=k,L=k.next;if(P(I,R,L)>=0)return!1;for(var D=I.x,E=R.x,F=L.x,q=I.y,rt=R.y,nt=L.y,ht=DE?D>F?D:F:E>F?E:F,pt=q>rt?q>nt?q:nt:rt>nt?rt:nt,lt=L.next;lt!==I;){if(lt.x>=ht&<.x<=ut&<.y>=dt&<.y<=pt&&T(D,q,E,rt,F,nt,lt.x,lt.y)&&P(lt.prev,lt,lt.next)>=0)return!1;lt=lt.next}return!0}function a(k,I,R,L){var D=k.prev,E=k,F=k.next;if(P(D,E,F)>=0)return!1;for(var q=D.x,rt=E.x,nt=F.x,ht=D.y,dt=E.y,ut=F.y,pt=qrt?q>nt?q:nt:rt>nt?rt:nt,_t=ht>dt?ht>ut?ht:ut:dt>ut?dt:ut,Tt=_(pt,lt,I,R,L),Rt=_(It,_t,I,R,L),mt=k.prevZ,Et=k.nextZ;mt&&mt.z>=Tt&&Et&&Et.z<=Rt;){if(mt.x>=pt&&mt.x<=It&&mt.y>=lt&&mt.y<=_t&&mt!==D&&mt!==F&&T(q,ht,rt,dt,nt,ut,mt.x,mt.y)&&P(mt.prev,mt,mt.next)>=0||(mt=mt.prevZ,Et.x>=pt&&Et.x<=It&&Et.y>=lt&&Et.y<=_t&&Et!==D&&Et!==F&&T(q,ht,rt,dt,nt,ut,Et.x,Et.y)&&P(Et.prev,Et,Et.next)>=0))return!1;Et=Et.nextZ}for(;mt&&mt.z>=Tt;){if(mt.x>=pt&&mt.x<=It&&mt.y>=lt&&mt.y<=_t&&mt!==D&&mt!==F&&T(q,ht,rt,dt,nt,ut,mt.x,mt.y)&&P(mt.prev,mt,mt.next)>=0)return!1;mt=mt.prevZ}for(;Et&&Et.z<=Rt;){if(Et.x>=pt&&Et.x<=It&&Et.y>=lt&&Et.y<=_t&&Et!==D&&Et!==F&&T(q,ht,rt,dt,nt,ut,Et.x,Et.y)&&P(Et.prev,Et,Et.next)>=0)return!1;Et=Et.nextZ}return!0}function l(k,I,R){var L=k;do{var D=L.prev,E=L.next.next;!M(D,E)&&A(D,L,L.next,E)&&J(D,E)&&J(E,D)&&(I.push(D.i/R|0),I.push(L.i/R|0),I.push(E.i/R|0),V(L),V(L.next),L=k=E),L=L.next}while(L!==k);return n(L)}function c(k,I,R,L,D,E){var F=k;do{for(var q=F.next.next;q!==F.prev;){if(F.i!==q.i&&$(F,q)){var rt=W(F,q);F=n(F,F.next),rt=n(rt,rt.next),i(F,I,R,L,D,E,0),i(rt,I,R,L,D,E,0);return}q=q.next}F=F.next}while(F!==k)}function d(k,I,R,L){var D=[],E,F,q,rt,nt;for(E=0,F=I.length;E=R.next.y&&R.next.y!==R.y){var q=R.x+(D-R.y)*(R.next.x-R.x)/(R.next.y-R.y);if(q<=L&&q>E&&(E=q,F=R.x=R.x&&R.x>=nt&&L!==R.x&&T(DF.x||R.x===F.x&&x(F,R)))&&(F=R,dt=ut)),R=R.next;while(R!==rt);return F}function x(k,I){return P(k.prev,k,I.prev)<0&&P(I.next,k,k.next)<0}function v(k,I,R,L){var D=k;do D.z===0&&(D.z=_(D.x,D.y,I,R,L)),D.prevZ=D.prev,D.nextZ=D.next,D=D.next;while(D!==k);D.prevZ.nextZ=null,D.prevZ=null,w(D)}function w(k){var I,R,L,D,E,F,q,rt,nt=1;do{for(R=k,k=null,E=null,F=0;R;){for(F++,L=R,q=0,I=0;I0||rt>0&&L;)q!==0&&(rt===0||!L||R.z<=L.z)?(D=R,R=R.nextZ,q--):(D=L,L=L.nextZ,rt--),E?E.nextZ=D:k=D,D.prevZ=E,E=D;R=L}E.nextZ=null,nt*=2}while(F>1);return k}function _(k,I,R,L,D){return k=(k-R)*D|0,I=(I-L)*D|0,k=(k|k<<8)&16711935,k=(k|k<<4)&252645135,k=(k|k<<2)&858993459,k=(k|k<<1)&1431655765,I=(I|I<<8)&16711935,I=(I|I<<4)&252645135,I=(I|I<<2)&858993459,I=(I|I<<1)&1431655765,k|I<<1}function b(k){var I=k,R=k;do(I.x=(k-F)*(E-q)&&(k-F)*(L-q)>=(R-F)*(I-q)&&(R-F)*(E-q)>=(D-F)*(L-q)}function $(k,I){return k.next.i!==I.i&&k.prev.i!==I.i&&!G(k,I)&&(J(k,I)&&J(I,k)&&S(k,I)&&(P(k.prev,k,I.prev)||P(k,I.prev,I))||M(k,I)&&P(k.prev,k,k.next)>0&&P(I.prev,I,I.next)>0)}function P(k,I,R){return(I.y-k.y)*(R.x-I.x)-(I.x-k.x)*(R.y-I.y)}function M(k,I){return k.x===I.x&&k.y===I.y}function A(k,I,R,L){var D=B(P(k,I,R)),E=B(P(k,I,L)),F=B(P(R,L,k)),q=B(P(R,L,I));return!!(D!==E&&F!==q||D===0&&O(k,R,I)||E===0&&O(k,L,I)||F===0&&O(R,k,L)||q===0&&O(R,I,L))}function O(k,I,R){return I.x<=Math.max(k.x,R.x)&&I.x>=Math.min(k.x,R.x)&&I.y<=Math.max(k.y,R.y)&&I.y>=Math.min(k.y,R.y)}function B(k){return k>0?1:k<0?-1:0}function G(k,I){var R=k;do{if(R.i!==k.i&&R.next.i!==k.i&&R.i!==I.i&&R.next.i!==I.i&&A(R,R.next,k,I))return!0;R=R.next}while(R!==k);return!1}function J(k,I){return P(k.prev,k,k.next)<0?P(k,I,k.next)>=0&&P(k,k.prev,I)>=0:P(k,I,k.prev)<0||P(k,k.next,I)<0}function S(k,I){var R=k,L=!1,D=(k.x+I.x)/2,E=(k.y+I.y)/2;do R.y>E!=R.next.y>E&&R.next.y!==R.y&&D<(R.next.x-R.x)*(E-R.y)/(R.next.y-R.y)+R.x&&(L=!L),R=R.next;while(R!==k);return L}function W(k,I){var R=new K(k.i,k.x,k.y),L=new K(I.i,I.x,I.y),D=k.next,E=I.prev;return k.next=I,I.prev=k,R.next=D,D.prev=R,L.next=R,R.prev=L,E.next=L,L.prev=E,L}function Q(k,I,R,L){var D=new K(k,I,R);return L?(D.next=L.next,D.prev=L,L.next.prev=D,L.next=D):(D.prev=D,D.next=D),D}function V(k){k.next.prev=k.prev,k.prev.next=k.next,k.prevZ&&(k.prevZ.nextZ=k.nextZ),k.nextZ&&(k.nextZ.prevZ=k.prevZ)}function K(k,I,R){this.i=k,this.x=I,this.y=R,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}e.deviation=function(k,I,R,L){var D=I&&I.length,E=D?I[0]*R:k.length,F=Math.abs(tt(k,0,E,R));if(D)for(var q=0,rt=I.length;q0&&(L+=k[D-1].length,R.holes.push(L))}return R},Ll.exports}var TE=ME();const EE=ra(TE);var _x=(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))(_x||{});class AE{constructor(t){this.items=[],this._name=t}emit(t,n,i,o,a,l,c,d){const{name:f,items:p}=this;for(let g=0,x=p.length;g{this.runners[n]=new AE(n)})}_addSystems(t){let n;for(n in t){const i=t[n];this._addSystem(i.value,i.name)}}_addSystem(t,n){const i=new t(this);if(this[n])throw new Error(`Whoops! The name "${n}" is already in use`);this[n]=i,this._systemsHash[n]=i;for(const o in this.runners)this.runners[o].add(i);return this}_addPipes(t,n){const i=n.reduce((o,a)=>(o[a.name]=a.value,o),{});t.forEach(o=>{const a=o.value,l=o.name,c=i[l];this.renderPipes[l]=new a(this,c?new c:null)})}destroy(t=!1){this.runners.destroy.items.reverse(),this.runners.destroy.emit(t),Object.values(this.runners).forEach(n=>{n.destroy()}),this._systemsHash=null,this.renderPipes=null}generateTexture(t){return this.textureGenerator.generateTexture(t)}get roundPixels(){return!!this._roundPixels}_unsafeEvalCheck(){if(!PE())throw new Error("Current environment does not allow unsafe-eval, please use pixi.js/unsafe-eval module to enable support.")}};Cx.defaultOptions={resolution:1,failIfMajorPerformanceCaveat:!1,roundPixels:!1};let Px=Cx,Bl;function IE(e){return Bl!==void 0||(Bl=(()=>{var n;const t={stencil:!0,failIfMajorPerformanceCaveat:e??Px.defaultOptions.failIfMajorPerformanceCaveat};try{if(!li.get().getWebGLRenderingContext())return!1;let o=li.get().createCanvas().getContext("webgl",t);const a=!!((n=o==null?void 0:o.getContextAttributes())!=null&&n.stencil);if(o){const l=o.getExtension("WEBGL_lose_context");l&&l.loseContext()}return o=null,a}catch{return!1}})()),Bl}let Nl;async function $E(e={}){return Nl!==void 0||(Nl=await(async()=>{const t=li.get().getNavigator().gpu;if(!t)return!1;try{return await(await t.requestAdapter(e)).requestDevice(),!0}catch{return!1}})()),Nl}const qy=["webgl","webgpu","canvas"];async function zE(e){let t=[];e.preference?(t.push(e.preference),qy.forEach(a=>{a!==e.preference&&t.push(a)})):t=qy.slice();let n,i={};for(let a=0;a{const{WebGPURenderer:d}=await import("./WebGPURenderer-DO1jTWXi.js");return{WebGPURenderer:d}},__vite__mapDeps([4,2,5,3]));n=c,i={...e,...e.webgpu};break}else if(l==="webgl"&&IE(e.failIfMajorPerformanceCaveat??Px.defaultOptions.failIfMajorPerformanceCaveat)){const{WebGLRenderer:c}=await ou(async()=>{const{WebGLRenderer:d}=await import("./WebGLRenderer-DIyxxzaL.js");return{WebGLRenderer:d}},__vite__mapDeps([6,2,5]));n=c,i={...e,...e.webgl};break}else if(l==="canvas")throw i={...e},new Error("CanvasRenderer is not yet implemented")}if(delete i.webgpu,delete i.webgl,!n)throw new Error("No available renderer for the current environment");const o=new n;return await o.init(i),o}const Mx="8.6.6";class Tx{static init(){var t;(t=globalThis.__PIXI_APP_INIT__)==null||t.call(globalThis,this,Mx)}static destroy(){}}Tx.extension=ne.Application;class OE{constructor(t){this._renderer=t}init(){var t;(t=globalThis.__PIXI_RENDERER_INIT__)==null||t.call(globalThis,this._renderer,Mx)}destroy(){this._renderer=null}}OE.extension={type:[ne.WebGLSystem,ne.WebGPUSystem],name:"initHook",priority:-10};const Ex=class $d{constructor(...t){this.stage=new Oe,t[0]!==void 0&&ke(Ne,"Application constructor options are deprecated, please use Application.init() instead.")}async init(t){t={...t},this.renderer=await zE(t),$d._plugins.forEach(n=>{n.init.call(this,t)})}render(){this.renderer.render({container:this.stage})}get canvas(){return this.renderer.canvas}get view(){return ke(Ne,"Application.view is deprecated, please use Application.canvas instead."),this.renderer.canvas}get screen(){return this.renderer.screen}destroy(t=!1,n=!1){const i=$d._plugins.slice(0);i.reverse(),i.forEach(o=>{o.destroy.call(this)}),this.stage.destroy(n),this.stage=null,this.renderer.destroy(t),this.renderer=null}};Ex._plugins=[];let Ax=Ex;vr.handleByList(ne.Application,Ax._plugins);vr.add(Tx);const Rx=class zd{constructor(t,n,i,o){this.uid=Fe("fillGradient"),this.type="linear",this.gradientStops=[],this._styleKey=null,this.x0=t,this.y0=n,this.x1=i,this.y1=o}addColorStop(t,n){return this.gradientStops.push({offset:t,color:_n.shared.setValue(n).toHexa()}),this._styleKey=null,this}buildLinearGradient(){if(this.texture)return;const t=zd.defaultTextureSize,{gradientStops:n}=this,i=li.get().createCanvas();i.width=t,i.height=t;const o=i.getContext("2d"),a=o.createLinearGradient(0,0,zd.defaultTextureSize,1);for(let _=0;_`${o.offset}-${o.color}`).join("-"),n=this.texture.uid,i=this.transform.toArray().join("-");return`fill-gradient-${this.uid}-${t}-${n}-${i}-${this.x0}-${this.y0}-${this.x1}-${this.y1}`}};Rx.defaultTextureSize=256;let LE=Rx;const Qy={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 BE{constructor(t,n){this.uid=Fe("fillPattern"),this.transform=new Jt,this._styleKey=null,this.texture=t,this.transform.scale(1/t.frame.width,1/t.frame.height),n&&(t.source.style.addressModeU=Qy[n].addressModeU,t.source.style.addressModeV=Qy[n].addressModeV)}setTransform(t){const n=this.texture;this.transform.copyFrom(t),this.transform.invert(),this.transform.scale(1/n.frame.width,1/n.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 Zh,Zy;function NE(){if(Zy)return Zh;Zy=1,Zh=n;var e={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},t=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function n(a){var l=[];return a.replace(t,function(c,d,f){var p=d.toLowerCase();for(f=o(f),p=="m"&&f.length>2&&(l.push([d].concat(f.splice(0,2))),p="l",d=d=="m"?"l":"L");;){if(f.length==e[p])return f.unshift(d),l.push(f);if(f.length0&&(o=i.pop(),o?(a=o.startX,l=o.startY):(a=0,l=0)),o=null;break;default:mr(`Unknown SVG path command: ${f}`)}f!=="Z"&&f!=="z"&&o===null&&(o={startX:a,startY:l},i.push(o))}return t}class wf{constructor(t=0,n=0,i=0){this.type="circle",this.x=t,this.y=n,this.radius=i}clone(){return new wf(this.x,this.y,this.radius)}contains(t,n){if(this.radius<=0)return!1;const i=this.radius*this.radius;let o=this.x-t,a=this.y-n;return o*=o,a*=a,o+a<=i}strokeContains(t,n,i,o=.5){if(this.radius===0)return!1;const a=this.x-t,l=this.y-n,c=this.radius,d=(1-o)*i,f=Math.sqrt(a*a+l*l);return f<=c+d&&f>c-(i-d)}getBounds(t){return t||(t=new Ae),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 bf{constructor(t=0,n=0,i=0,o=0){this.type="ellipse",this.x=t,this.y=n,this.halfWidth=i,this.halfHeight=o}clone(){return new bf(this.x,this.y,this.halfWidth,this.halfHeight)}contains(t,n){if(this.halfWidth<=0||this.halfHeight<=0)return!1;let i=(t-this.x)/this.halfWidth,o=(n-this.y)/this.halfHeight;return i*=i,o*=o,i+o<=1}strokeContains(t,n,i,o=.5){const{halfWidth:a,halfHeight:l}=this;if(a<=0||l<=0)return!1;const c=i*(1-o),d=i-c,f=a-d,p=l-d,g=a+c,x=l+c,v=t-this.x,w=n-this.y,_=v*v/(f*f)+w*w/(p*p),b=v*v/(g*g)+w*w/(x*x);return _>1&&b<=1}getBounds(t){return t||(t=new Ae),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 WE(e,t,n,i,o,a){const l=e-n,c=t-i,d=o-n,f=a-i,p=l*d+c*f,g=d*d+f*f;let x=-1;g!==0&&(x=p/g);let v,w;x<0?(v=n,w=i):x>1?(v=o,w=a):(v=n+x*d,w=i+x*f);const _=e-v,b=t-w;return _*_+b*b}class Ho{constructor(...t){this.type="polygon";let n=Array.isArray(t[0])?t[0]:t;if(typeof n[0]!="number"){const i=[];for(let o=0,a=n.length;on!=p>n&&t<(f-c)*((n-d)/(p-d))+c&&(i=!i)}return i}strokeContains(t,n,i,o=.5){const a=i*i,l=a*(1-o),c=a-l,{points:d}=this,f=d.length-(this.closePath?0:2);for(let p=0;po?f:o,a=pl?p:l}return t.x=i,t.width=o-i,t.y=a,t.height=l-a,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,n)=>`${t}, ${n}`,"")}]`}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 Fl=(e,t,n,i,o,a,l)=>{const c=e-n,d=t-i,f=Math.sqrt(c*c+d*d);return f>=o-a&&f<=o+l};class Sf{constructor(t=0,n=0,i=0,o=0,a=20){this.type="roundedRectangle",this.x=t,this.y=n,this.width=i,this.height=o,this.radius=a}getBounds(t){return t||(t=new Ae),t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t}clone(){return new Sf(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,n){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&n>=this.y&&n<=this.y+this.height){const i=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(n>=this.y+i&&n<=this.y+this.height-i||t>=this.x+i&&t<=this.x+this.width-i)return!0;let o=t-(this.x+i),a=n-(this.y+i);const l=i*i;if(o*o+a*a<=l||(o=t-(this.x+this.width-i),o*o+a*a<=l)||(a=n-(this.y+this.height-i),o*o+a*a<=l)||(o=t-(this.x+i),o*o+a*a<=l))return!0}return!1}strokeContains(t,n,i,o=.5){const{x:a,y:l,width:c,height:d,radius:f}=this,p=i*(1-o),g=i-p,x=a+f,v=l+f,w=c-f*2,_=d-f*2,b=a+c,T=l+d;return(t>=a-p&&t<=a+g||t>=b-g&&t<=b+p)&&n>=v&&n<=v+_||(n>=l-p&&n<=l+g||n>=T-g&&n<=T+p)&&t>=x&&t<=x+w?!0:tb-f&&nb-f&&n>T-f&&Fl(t,n,b-f,T-f,f,g,p)||tT-f&&Fl(t,n,x,T-f,f,g,p)}toString(){return`[pixi.js/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`}}const HE=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(` +${e}`}function gE(e,t){return t?e.replace("#version 300 es",""):e}const Xh={stripVersion:gE,ensurePrecision:hE,addProgramDefines:cE,setProgramName:mE,insertVersion:dE},Kh=Object.create(null),yx=class Ad{constructor(t){t={...Ad.defaultOptions,...t};const n=t.fragment.indexOf("#version 300 es")!==-1,i={stripVersion:n,ensurePrecision:{requestedFragmentPrecision:t.preferredFragmentPrecision,requestedVertexPrecision:t.preferredVertexPrecision,maxSupportedVertexPrecision:"highp",maxSupportedFragmentPrecision:uE()},setProgramName:{name:t.name},addProgramDefines:n,insertVersion:n};let o=t.fragment,a=t.vertex;Object.keys(Xh).forEach(l=>{const c=i[l];o=Xh[l](o,c,!0),a=Xh[l](a,c,!1)}),this.fragment=o,this.vertex=a,this.transformFeedbackVaryings=t.transformFeedbackVaryings,this._key=vf(`${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 n=`${t.vertex}:${t.fragment}`;return Kh[n]||(Kh[n]=new Ad(t)),Kh[n]}};yx.defaultOptions={preferredVertexPrecision:"highp",preferredFragmentPrecision:"mediump"};let vx=yx;const Xy={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 yE(e){return Xy[e]??Xy.float32}const vE={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 xE({source:e,entryPoint:t}){const n={},i=e.indexOf(`fn ${t}`);if(i!==-1){const o=e.indexOf("->",i);if(o!==-1){const a=e.substring(i,o),l=/@location\((\d+)\)\s+([a-zA-Z0-9_]+)\s*:\s*([a-zA-Z0-9_<>]+)(?:,|\s|$)/g;let c;for(;(c=l.exec(a))!==null;){const d=vE[c[3]]??"float32";n[c[2]]={location:parseInt(c[1],10),format:d,stride:yE(d).stride,offset:0,instance:!1,start:0}}}}return n}function qh(e){var g,x;const t=/(^|[^/])@(group|binding)\(\d+\)[^;]+;/g,n=/@group\((\d+)\)/,i=/@binding\((\d+)\)/,o=/var(<[^>]+>)? (\w+)/,a=/:\s*(\w+)/,l=/struct\s+(\w+)\s*{([^}]+)}/g,c=/(\w+)\s*:\s*([\w\<\>]+)/g,d=/struct\s+(\w+)/,f=(g=e.match(t))==null?void 0:g.map(v=>({group:parseInt(v.match(n)[1],10),binding:parseInt(v.match(i)[1],10),name:v.match(o)[2],isUniform:v.match(o)[1]==="",type:v.match(a)[1]}));if(!f)return{groups:[],structs:[]};const p=((x=e.match(l))==null?void 0:x.map(v=>{const w=v.match(d)[1],_=v.match(c).reduce((b,T)=>{const[$,P]=T.split(":");return b[$.trim()]=P.trim(),b},{});return _?{name:w,members:_}:null}).filter(({name:v})=>f.some(w=>w.type===v)))??[];return{groups:f,structs:p}}var Oo=(e=>(e[e.VERTEX=1]="VERTEX",e[e.FRAGMENT=2]="FRAGMENT",e[e.COMPUTE=4]="COMPUTE",e))(Oo||{});function wE({groups:e}){const t=[];for(let n=0;nn.has(l.name)?!1:(n.add(l.name),!0)),a=[...e.groups,...t.groups].filter(l=>{const c=`${l.name}-${l.binding}`;return i.has(c)?!1:(i.add(c),!0)});return{structs:o,groups:a}}const Qh=Object.create(null);class Au{constructor(t){var c,d;this._layoutKey=0,this._attributeLocationsKey=0;const{fragment:n,vertex:i,layout:o,gpuLayout:a,name:l}=t;if(this.name=l,this.fragment=n,this.vertex=i,n.source===i.source){const f=qh(n.source);this.structsAndGroups=f}else{const f=qh(i.source),p=qh(n.source);this.structsAndGroups=SE(f,p)}this.layout=o??bE(this.structsAndGroups),this.gpuLayout=a??wE(this.structsAndGroups),this.autoAssignGlobalUniforms=((c=this.layout[0])==null?void 0:c.globalUniforms)!==void 0,this.autoAssignLocalUniforms=((d=this.layout[1])==null?void 0:d.localUniforms)!==void 0,this._generateProgramKey()}_generateProgramKey(){const{vertex:t,fragment:n}=this,i=t.source+n.source+t.entryPoint+n.entryPoint;this._layoutKey=vf(i,"program")}get attributeData(){return this._attributeData??(this._attributeData=xE(this.vertex)),this._attributeData}destroy(){this.gpuLayout=null,this.layout=null,this.structsAndGroups=null,this.fragment=null,this.vertex=null}static from(t){const n=`${t.vertex.source}:${t.fragment.source}:${t.fragment.entryPoint}:${t.vertex.entryPoint}`;return Qh[n]||(Qh[n]=new Au(t)),Qh[n]}}const xx=["f32","i32","vec2","vec3","vec4","mat2x2","mat3x3","mat4x4","mat3x2","mat4x2","mat2x3","mat4x3","mat2x4","mat3x4","vec2","vec3","vec4"],_E=xx.reduce((e,t)=>(e[t]=!0,e),{});function CE(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 wx=class bx{constructor(t,n){this._touched=0,this.uid=Fe("uniform"),this._resourceType="uniformGroup",this._resourceId=Fe("resource"),this.isUniformGroup=!0,this._dirtyId=0,this.destroyed=!1,n={...bx.defaultOptions,...n},this.uniformStructures=t;const i={};for(const o in t){const a=t[o];if(a.name=o,a.size=a.size??1,!_E[a.type])throw new Error(`Uniform type ${a.type} is not supported. Supported uniform types are: ${xx.join(", ")}`);a.value??(a.value=CE(a.type,a.size)),i[o]=a.value}this.uniforms=i,this._dirtyId=1,this.ubo=n.ubo,this.isStatic=n.isStatic,this._signature=vf(Object.keys(i).map(o=>`${o}-${t[o].type}`).join("-"),"uniform-group")}update(){this._dirtyId++}};wx.defaultOptions={ubo:!1,isStatic:!1};let Sx=wx;class Xl{constructor(t){this.resources=Object.create(null),this._dirty=!0;let n=0;for(const i in t){const o=t[i];this.setResource(o,n++)}this._updateKey()}_updateKey(){if(!this._dirty)return;this._dirty=!1;const t=[];let n=0;for(const i in this.resources)t[n++]=this.resources[i]._resourceId;this._key=t.join("|")}setResource(t,n){var o,a;const i=this.resources[n];t!==i&&(i&&((o=t.off)==null||o.call(t,"change",this.onResourceChange,this)),(a=t.on)==null||a.call(t,"change",this.onResourceChange,this),this.resources[n]=t,this._dirty=!0)}getResource(t){return this.resources[t]}_touch(t){const n=this.resources;for(const i in n)n[i]._touched=t}destroy(){var n;const t=this.resources;for(const i in t){const o=t[i];(n=o.off)==null||n.call(o,"change",this.onResourceChange,this)}this.resources=null}onResourceChange(t){if(this._dirty=!0,t.destroyed){const n=this.resources;for(const i in n)n[i]===t&&(n[i]=null)}else this._updateKey()}}var Rd=(e=>(e[e.WEBGL=1]="WEBGL",e[e.WEBGPU=2]="WEBGPU",e[e.BOTH=3]="BOTH",e))(Rd||{});class xf extends Or{constructor(t){super(),this._uniformBindMap=Object.create(null),this._ownedBindGroups=[];let{gpuProgram:n,glProgram:i,groups:o,resources:a,compatibleRenderers:l,groupMap:c}=t;this.gpuProgram=n,this.glProgram=i,l===void 0&&(l=0,n&&(l|=Rd.WEBGPU),i&&(l|=Rd.WEBGL)),this.compatibleRenderers=l;const d={};if(!a&&!o&&(a={}),a&&o)throw new Error("[Shader] Cannot have both resources and groups");if(!n&&o&&!c)throw new Error("[Shader] No group map or WebGPU shader provided - consider using resources instead.");if(!n&&o&&c)for(const f in c)for(const p in c[f]){const g=c[f][p];d[g]={group:f,binding:p,name:g}}else if(n&&o&&!c){const f=n.structsAndGroups.groups;c={},f.forEach(p=>{c[p.group]=c[p.group]||{},c[p.group][p.binding]=p.name,d[p.name]=p})}else if(a){o={},c={},n&&n.structsAndGroups.groups.forEach(g=>{c[g.group]=c[g.group]||{},c[g.group][g.binding]=g.name,d[g.name]=g});let f=0;for(const p in a)d[p]||(o[99]||(o[99]=new Xl,this._ownedBindGroups.push(o[99])),d[p]={group:99,binding:f,name:p},c[99]=c[99]||{},c[99][f]=p,f++);for(const p in a){const g=p;let x=a[p];!x.source&&!x._resourceType&&(x=new Sx(x));const v=d[g];v&&(o[v.group]||(o[v.group]=new Xl,this._ownedBindGroups.push(o[v.group])),o[v.group].setResource(x,v.binding))}}this.groups=o,this._uniformBindMap=c,this.resources=this._buildResourceAccessor(o,d)}addResource(t,n,i){var o,a;(o=this._uniformBindMap)[n]||(o[n]={}),(a=this._uniformBindMap[n])[i]||(a[i]=t),this.groups[n]||(this.groups[n]=new Xl,this._ownedBindGroups.push(this.groups[n]))}_buildResourceAccessor(t,n){const i={};for(const o in n){const a=n[o];Object.defineProperty(i,a.name,{get(){return t[a.group].getResource(a.binding)},set(l){t[a.group].setResource(l,a.binding)}})}return i}destroy(t=!1){var n,i;this.emit("destroy",this),t&&((n=this.gpuProgram)==null||n.destroy(),(i=this.glProgram)==null||i.destroy()),this.gpuProgram=null,this.glProgram=null,this.removeAllListeners(),this._uniformBindMap=null,this._ownedBindGroups.forEach(o=>{o.destroy()}),this._ownedBindGroups=null,this.resources=null,this.groups=null}static from(t){const{gpu:n,gl:i,...o}=t;let a,l;return n&&(a=Au.from(n)),i&&(l=vx.from(i)),new xf({gpuProgram:a,glProgram:l,...o})}}const Id=[];vr.handleByNamedList(ne.Environment,Id);async function kE(e){if(!e)for(let t=0;t80*R){q=nt=k[0],rt=ht=k[1];for(var lt=R;ltnt&&(nt=dt),ut>ht&&(ht=ut);pt=Math.max(nt-q,ht-rt),pt=pt!==0?32767/pt:0}return i(E,F,R,q,rt,pt,0),F}function t(k,I,R,L,D){var E,F;if(D===tt(k,I,R,L)>0)for(E=I;E=I;E-=L)F=Q(E,k[E],k[E+1],F);return F&&M(F,F.next)&&(V(F),F=F.next),F}function n(k,I){if(!k)return k;I||(I=k);var R=k,L;do if(L=!1,!R.steiner&&(M(R,R.next)||P(R.prev,R,R.next)===0)){if(V(R),R=I=R.prev,R===R.next)break;L=!0}else R=R.next;while(L||R!==I);return I}function i(k,I,R,L,D,E,F){if(k){!F&&E&&v(k,L,D,E);for(var q=k,rt,nt;k.prev!==k.next;){if(rt=k.prev,nt=k.next,E?a(k,L,D,E):o(k)){I.push(rt.i/R|0),I.push(k.i/R|0),I.push(nt.i/R|0),V(k),k=nt.next,q=nt.next;continue}if(k=nt,k===q){F?F===1?(k=l(n(k),I,R),i(k,I,R,L,D,E,2)):F===2&&c(k,I,R,L,D,E):i(n(k),I,R,L,D,E,1);break}}}}function o(k){var I=k.prev,R=k,L=k.next;if(P(I,R,L)>=0)return!1;for(var D=I.x,E=R.x,F=L.x,q=I.y,rt=R.y,nt=L.y,ht=DE?D>F?D:F:E>F?E:F,pt=q>rt?q>nt?q:nt:rt>nt?rt:nt,lt=L.next;lt!==I;){if(lt.x>=ht&<.x<=ut&<.y>=dt&<.y<=pt&&T(D,q,E,rt,F,nt,lt.x,lt.y)&&P(lt.prev,lt,lt.next)>=0)return!1;lt=lt.next}return!0}function a(k,I,R,L){var D=k.prev,E=k,F=k.next;if(P(D,E,F)>=0)return!1;for(var q=D.x,rt=E.x,nt=F.x,ht=D.y,dt=E.y,ut=F.y,pt=qrt?q>nt?q:nt:rt>nt?rt:nt,_t=ht>dt?ht>ut?ht:ut:dt>ut?dt:ut,Tt=_(pt,lt,I,R,L),Rt=_(It,_t,I,R,L),mt=k.prevZ,Et=k.nextZ;mt&&mt.z>=Tt&&Et&&Et.z<=Rt;){if(mt.x>=pt&&mt.x<=It&&mt.y>=lt&&mt.y<=_t&&mt!==D&&mt!==F&&T(q,ht,rt,dt,nt,ut,mt.x,mt.y)&&P(mt.prev,mt,mt.next)>=0||(mt=mt.prevZ,Et.x>=pt&&Et.x<=It&&Et.y>=lt&&Et.y<=_t&&Et!==D&&Et!==F&&T(q,ht,rt,dt,nt,ut,Et.x,Et.y)&&P(Et.prev,Et,Et.next)>=0))return!1;Et=Et.nextZ}for(;mt&&mt.z>=Tt;){if(mt.x>=pt&&mt.x<=It&&mt.y>=lt&&mt.y<=_t&&mt!==D&&mt!==F&&T(q,ht,rt,dt,nt,ut,mt.x,mt.y)&&P(mt.prev,mt,mt.next)>=0)return!1;mt=mt.prevZ}for(;Et&&Et.z<=Rt;){if(Et.x>=pt&&Et.x<=It&&Et.y>=lt&&Et.y<=_t&&Et!==D&&Et!==F&&T(q,ht,rt,dt,nt,ut,Et.x,Et.y)&&P(Et.prev,Et,Et.next)>=0)return!1;Et=Et.nextZ}return!0}function l(k,I,R){var L=k;do{var D=L.prev,E=L.next.next;!M(D,E)&&A(D,L,L.next,E)&&J(D,E)&&J(E,D)&&(I.push(D.i/R|0),I.push(L.i/R|0),I.push(E.i/R|0),V(L),V(L.next),L=k=E),L=L.next}while(L!==k);return n(L)}function c(k,I,R,L,D,E){var F=k;do{for(var q=F.next.next;q!==F.prev;){if(F.i!==q.i&&$(F,q)){var rt=W(F,q);F=n(F,F.next),rt=n(rt,rt.next),i(F,I,R,L,D,E,0),i(rt,I,R,L,D,E,0);return}q=q.next}F=F.next}while(F!==k)}function d(k,I,R,L){var D=[],E,F,q,rt,nt;for(E=0,F=I.length;E=R.next.y&&R.next.y!==R.y){var q=R.x+(D-R.y)*(R.next.x-R.x)/(R.next.y-R.y);if(q<=L&&q>E&&(E=q,F=R.x=R.x&&R.x>=nt&&L!==R.x&&T(DF.x||R.x===F.x&&x(F,R)))&&(F=R,dt=ut)),R=R.next;while(R!==rt);return F}function x(k,I){return P(k.prev,k,I.prev)<0&&P(I.next,k,k.next)<0}function v(k,I,R,L){var D=k;do D.z===0&&(D.z=_(D.x,D.y,I,R,L)),D.prevZ=D.prev,D.nextZ=D.next,D=D.next;while(D!==k);D.prevZ.nextZ=null,D.prevZ=null,w(D)}function w(k){var I,R,L,D,E,F,q,rt,nt=1;do{for(R=k,k=null,E=null,F=0;R;){for(F++,L=R,q=0,I=0;I0||rt>0&&L;)q!==0&&(rt===0||!L||R.z<=L.z)?(D=R,R=R.nextZ,q--):(D=L,L=L.nextZ,rt--),E?E.nextZ=D:k=D,D.prevZ=E,E=D;R=L}E.nextZ=null,nt*=2}while(F>1);return k}function _(k,I,R,L,D){return k=(k-R)*D|0,I=(I-L)*D|0,k=(k|k<<8)&16711935,k=(k|k<<4)&252645135,k=(k|k<<2)&858993459,k=(k|k<<1)&1431655765,I=(I|I<<8)&16711935,I=(I|I<<4)&252645135,I=(I|I<<2)&858993459,I=(I|I<<1)&1431655765,k|I<<1}function b(k){var I=k,R=k;do(I.x=(k-F)*(E-q)&&(k-F)*(L-q)>=(R-F)*(I-q)&&(R-F)*(E-q)>=(D-F)*(L-q)}function $(k,I){return k.next.i!==I.i&&k.prev.i!==I.i&&!G(k,I)&&(J(k,I)&&J(I,k)&&S(k,I)&&(P(k.prev,k,I.prev)||P(k,I.prev,I))||M(k,I)&&P(k.prev,k,k.next)>0&&P(I.prev,I,I.next)>0)}function P(k,I,R){return(I.y-k.y)*(R.x-I.x)-(I.x-k.x)*(R.y-I.y)}function M(k,I){return k.x===I.x&&k.y===I.y}function A(k,I,R,L){var D=B(P(k,I,R)),E=B(P(k,I,L)),F=B(P(R,L,k)),q=B(P(R,L,I));return!!(D!==E&&F!==q||D===0&&O(k,R,I)||E===0&&O(k,L,I)||F===0&&O(R,k,L)||q===0&&O(R,I,L))}function O(k,I,R){return I.x<=Math.max(k.x,R.x)&&I.x>=Math.min(k.x,R.x)&&I.y<=Math.max(k.y,R.y)&&I.y>=Math.min(k.y,R.y)}function B(k){return k>0?1:k<0?-1:0}function G(k,I){var R=k;do{if(R.i!==k.i&&R.next.i!==k.i&&R.i!==I.i&&R.next.i!==I.i&&A(R,R.next,k,I))return!0;R=R.next}while(R!==k);return!1}function J(k,I){return P(k.prev,k,k.next)<0?P(k,I,k.next)>=0&&P(k,k.prev,I)>=0:P(k,I,k.prev)<0||P(k,k.next,I)<0}function S(k,I){var R=k,L=!1,D=(k.x+I.x)/2,E=(k.y+I.y)/2;do R.y>E!=R.next.y>E&&R.next.y!==R.y&&D<(R.next.x-R.x)*(E-R.y)/(R.next.y-R.y)+R.x&&(L=!L),R=R.next;while(R!==k);return L}function W(k,I){var R=new K(k.i,k.x,k.y),L=new K(I.i,I.x,I.y),D=k.next,E=I.prev;return k.next=I,I.prev=k,R.next=D,D.prev=R,L.next=R,R.prev=L,E.next=L,L.prev=E,L}function Q(k,I,R,L){var D=new K(k,I,R);return L?(D.next=L.next,D.prev=L,L.next.prev=D,L.next=D):(D.prev=D,D.next=D),D}function V(k){k.next.prev=k.prev,k.prev.next=k.next,k.prevZ&&(k.prevZ.nextZ=k.nextZ),k.nextZ&&(k.nextZ.prevZ=k.prevZ)}function K(k,I,R){this.i=k,this.x=I,this.y=R,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}e.deviation=function(k,I,R,L){var D=I&&I.length,E=D?I[0]*R:k.length,F=Math.abs(tt(k,0,E,R));if(D)for(var q=0,rt=I.length;q0&&(L+=k[D-1].length,R.holes.push(L))}return R},Ll.exports}var TE=ME();const EE=ra(TE);var _x=(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))(_x||{});class AE{constructor(t){this.items=[],this._name=t}emit(t,n,i,o,a,l,c,d){const{name:f,items:p}=this;for(let g=0,x=p.length;g{this.runners[n]=new AE(n)})}_addSystems(t){let n;for(n in t){const i=t[n];this._addSystem(i.value,i.name)}}_addSystem(t,n){const i=new t(this);if(this[n])throw new Error(`Whoops! The name "${n}" is already in use`);this[n]=i,this._systemsHash[n]=i;for(const o in this.runners)this.runners[o].add(i);return this}_addPipes(t,n){const i=n.reduce((o,a)=>(o[a.name]=a.value,o),{});t.forEach(o=>{const a=o.value,l=o.name,c=i[l];this.renderPipes[l]=new a(this,c?new c:null)})}destroy(t=!1){this.runners.destroy.items.reverse(),this.runners.destroy.emit(t),Object.values(this.runners).forEach(n=>{n.destroy()}),this._systemsHash=null,this.renderPipes=null}generateTexture(t){return this.textureGenerator.generateTexture(t)}get roundPixels(){return!!this._roundPixels}_unsafeEvalCheck(){if(!PE())throw new Error("Current environment does not allow unsafe-eval, please use pixi.js/unsafe-eval module to enable support.")}};Cx.defaultOptions={resolution:1,failIfMajorPerformanceCaveat:!1,roundPixels:!1};let Px=Cx,Bl;function IE(e){return Bl!==void 0||(Bl=(()=>{var n;const t={stencil:!0,failIfMajorPerformanceCaveat:e??Px.defaultOptions.failIfMajorPerformanceCaveat};try{if(!li.get().getWebGLRenderingContext())return!1;let o=li.get().createCanvas().getContext("webgl",t);const a=!!((n=o==null?void 0:o.getContextAttributes())!=null&&n.stencil);if(o){const l=o.getExtension("WEBGL_lose_context");l&&l.loseContext()}return o=null,a}catch{return!1}})()),Bl}let Nl;async function $E(e={}){return Nl!==void 0||(Nl=await(async()=>{const t=li.get().getNavigator().gpu;if(!t)return!1;try{return await(await t.requestAdapter(e)).requestDevice(),!0}catch{return!1}})()),Nl}const qy=["webgl","webgpu","canvas"];async function zE(e){let t=[];e.preference?(t.push(e.preference),qy.forEach(a=>{a!==e.preference&&t.push(a)})):t=qy.slice();let n,i={};for(let a=0;a{const{WebGPURenderer:d}=await import("./WebGPURenderer-CKlOPZqb.js");return{WebGPURenderer:d}},__vite__mapDeps([4,2,5,3]));n=c,i={...e,...e.webgpu};break}else if(l==="webgl"&&IE(e.failIfMajorPerformanceCaveat??Px.defaultOptions.failIfMajorPerformanceCaveat)){const{WebGLRenderer:c}=await ou(async()=>{const{WebGLRenderer:d}=await import("./WebGLRenderer-BL_L2csm.js");return{WebGLRenderer:d}},__vite__mapDeps([6,2,5]));n=c,i={...e,...e.webgl};break}else if(l==="canvas")throw i={...e},new Error("CanvasRenderer is not yet implemented")}if(delete i.webgpu,delete i.webgl,!n)throw new Error("No available renderer for the current environment");const o=new n;return await o.init(i),o}const Mx="8.6.6";class Tx{static init(){var t;(t=globalThis.__PIXI_APP_INIT__)==null||t.call(globalThis,this,Mx)}static destroy(){}}Tx.extension=ne.Application;class OE{constructor(t){this._renderer=t}init(){var t;(t=globalThis.__PIXI_RENDERER_INIT__)==null||t.call(globalThis,this._renderer,Mx)}destroy(){this._renderer=null}}OE.extension={type:[ne.WebGLSystem,ne.WebGPUSystem],name:"initHook",priority:-10};const Ex=class $d{constructor(...t){this.stage=new Oe,t[0]!==void 0&&ke(Ne,"Application constructor options are deprecated, please use Application.init() instead.")}async init(t){t={...t},this.renderer=await zE(t),$d._plugins.forEach(n=>{n.init.call(this,t)})}render(){this.renderer.render({container:this.stage})}get canvas(){return this.renderer.canvas}get view(){return ke(Ne,"Application.view is deprecated, please use Application.canvas instead."),this.renderer.canvas}get screen(){return this.renderer.screen}destroy(t=!1,n=!1){const i=$d._plugins.slice(0);i.reverse(),i.forEach(o=>{o.destroy.call(this)}),this.stage.destroy(n),this.stage=null,this.renderer.destroy(t),this.renderer=null}};Ex._plugins=[];let Ax=Ex;vr.handleByList(ne.Application,Ax._plugins);vr.add(Tx);const Rx=class zd{constructor(t,n,i,o){this.uid=Fe("fillGradient"),this.type="linear",this.gradientStops=[],this._styleKey=null,this.x0=t,this.y0=n,this.x1=i,this.y1=o}addColorStop(t,n){return this.gradientStops.push({offset:t,color:_n.shared.setValue(n).toHexa()}),this._styleKey=null,this}buildLinearGradient(){if(this.texture)return;const t=zd.defaultTextureSize,{gradientStops:n}=this,i=li.get().createCanvas();i.width=t,i.height=t;const o=i.getContext("2d"),a=o.createLinearGradient(0,0,zd.defaultTextureSize,1);for(let _=0;_`${o.offset}-${o.color}`).join("-"),n=this.texture.uid,i=this.transform.toArray().join("-");return`fill-gradient-${this.uid}-${t}-${n}-${i}-${this.x0}-${this.y0}-${this.x1}-${this.y1}`}};Rx.defaultTextureSize=256;let LE=Rx;const Qy={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 BE{constructor(t,n){this.uid=Fe("fillPattern"),this.transform=new Jt,this._styleKey=null,this.texture=t,this.transform.scale(1/t.frame.width,1/t.frame.height),n&&(t.source.style.addressModeU=Qy[n].addressModeU,t.source.style.addressModeV=Qy[n].addressModeV)}setTransform(t){const n=this.texture;this.transform.copyFrom(t),this.transform.invert(),this.transform.scale(1/n.frame.width,1/n.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 Zh,Zy;function NE(){if(Zy)return Zh;Zy=1,Zh=n;var e={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},t=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function n(a){var l=[];return a.replace(t,function(c,d,f){var p=d.toLowerCase();for(f=o(f),p=="m"&&f.length>2&&(l.push([d].concat(f.splice(0,2))),p="l",d=d=="m"?"l":"L");;){if(f.length==e[p])return f.unshift(d),l.push(f);if(f.length0&&(o=i.pop(),o?(a=o.startX,l=o.startY):(a=0,l=0)),o=null;break;default:mr(`Unknown SVG path command: ${f}`)}f!=="Z"&&f!=="z"&&o===null&&(o={startX:a,startY:l},i.push(o))}return t}class wf{constructor(t=0,n=0,i=0){this.type="circle",this.x=t,this.y=n,this.radius=i}clone(){return new wf(this.x,this.y,this.radius)}contains(t,n){if(this.radius<=0)return!1;const i=this.radius*this.radius;let o=this.x-t,a=this.y-n;return o*=o,a*=a,o+a<=i}strokeContains(t,n,i,o=.5){if(this.radius===0)return!1;const a=this.x-t,l=this.y-n,c=this.radius,d=(1-o)*i,f=Math.sqrt(a*a+l*l);return f<=c+d&&f>c-(i-d)}getBounds(t){return t||(t=new Ae),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 bf{constructor(t=0,n=0,i=0,o=0){this.type="ellipse",this.x=t,this.y=n,this.halfWidth=i,this.halfHeight=o}clone(){return new bf(this.x,this.y,this.halfWidth,this.halfHeight)}contains(t,n){if(this.halfWidth<=0||this.halfHeight<=0)return!1;let i=(t-this.x)/this.halfWidth,o=(n-this.y)/this.halfHeight;return i*=i,o*=o,i+o<=1}strokeContains(t,n,i,o=.5){const{halfWidth:a,halfHeight:l}=this;if(a<=0||l<=0)return!1;const c=i*(1-o),d=i-c,f=a-d,p=l-d,g=a+c,x=l+c,v=t-this.x,w=n-this.y,_=v*v/(f*f)+w*w/(p*p),b=v*v/(g*g)+w*w/(x*x);return _>1&&b<=1}getBounds(t){return t||(t=new Ae),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 WE(e,t,n,i,o,a){const l=e-n,c=t-i,d=o-n,f=a-i,p=l*d+c*f,g=d*d+f*f;let x=-1;g!==0&&(x=p/g);let v,w;x<0?(v=n,w=i):x>1?(v=o,w=a):(v=n+x*d,w=i+x*f);const _=e-v,b=t-w;return _*_+b*b}class Ho{constructor(...t){this.type="polygon";let n=Array.isArray(t[0])?t[0]:t;if(typeof n[0]!="number"){const i=[];for(let o=0,a=n.length;on!=p>n&&t<(f-c)*((n-d)/(p-d))+c&&(i=!i)}return i}strokeContains(t,n,i,o=.5){const a=i*i,l=a*(1-o),c=a-l,{points:d}=this,f=d.length-(this.closePath?0:2);for(let p=0;po?f:o,a=pl?p:l}return t.x=i,t.width=o-i,t.y=a,t.height=l-a,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,n)=>`${t}, ${n}`,"")}]`}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 Fl=(e,t,n,i,o,a,l)=>{const c=e-n,d=t-i,f=Math.sqrt(c*c+d*d);return f>=o-a&&f<=o+l};class Sf{constructor(t=0,n=0,i=0,o=0,a=20){this.type="roundedRectangle",this.x=t,this.y=n,this.width=i,this.height=o,this.radius=a}getBounds(t){return t||(t=new Ae),t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t}clone(){return new Sf(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,n){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&n>=this.y&&n<=this.y+this.height){const i=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(n>=this.y+i&&n<=this.y+this.height-i||t>=this.x+i&&t<=this.x+this.width-i)return!0;let o=t-(this.x+i),a=n-(this.y+i);const l=i*i;if(o*o+a*a<=l||(o=t-(this.x+this.width-i),o*o+a*a<=l)||(a=n-(this.y+this.height-i),o*o+a*a<=l)||(o=t-(this.x+i),o*o+a*a<=l))return!0}return!1}strokeContains(t,n,i,o=.5){const{x:a,y:l,width:c,height:d,radius:f}=this,p=i*(1-o),g=i-p,x=a+f,v=l+f,w=c-f*2,_=d-f*2,b=a+c,T=l+d;return(t>=a-p&&t<=a+g||t>=b-g&&t<=b+p)&&n>=v&&n<=v+_||(n>=l-p&&n<=l+g||n>=T-g&&n<=T+p)&&t>=x&&t<=x+w?!0:tb-f&&nb-f&&n>T-f&&Fl(t,n,b-f,T-f,f,g,p)||tT-f&&Fl(t,n,x,T-f,f,g,p)}toString(){return`[pixi.js/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`}}const HE=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(` `);function UE(e){let t="";for(let n=0;n0&&(t+=` else `),n>>=0;return $x[n]||YE(e,t,n)}let Jh=0;function YE(e,t,n){const i={};let o=0;Jh||(Jh=Ix());for(let l=0;l0){const l=new Uint8Array(e,n*8,a);new Uint8Array(t,n*8,a).set(l)}}const XE={normal:"normal-npm",add:"add-npm",screen:"screen-npm"};var KE=(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))(KE||{});function e0(e,t){return t.alphaMode==="no-premultiply-alpha"&&XE[e]||e}class qE{constructor(){this.ids=Object.create(null),this.textures=[],this.count=0}clear(){for(let t=0;t0?zx[--Od]:new QE}function r0(e){zx[Od++]=e}let ko=0;const Ox=class Kl{constructor(t={}){this.uid=Fe("batcher"),this.dirty=!0,this.batchIndex=0,this.batches=[],this._elements=[],Kl.defaultOptions.maxTextures=Kl.defaultOptions.maxTextures??Ix(),t={...Kl.defaultOptions,...t};const{maxTextures:n,attributesInitialSize:i,indicesInitialSize:o}=t;this.attributeBuffer=new Jy(i*4),this.indexBuffer=new Uint16Array(o),this.maxTextures=n}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 d=this.attributeBuffer.float32View,f=this.attributeBuffer.uint32View,p=this.indexBuffer;let g=this._batchIndexSize,x=this._batchIndexStart,v="startBatch";const w=this.maxTextures;for(let _=this.elementStart;_=w||M)&&(this._finishBatch(i,x,g-x,o,l,c,t,v),v="renderBatch",x=g,l=P,c=b.topology,i=n0(),o=i.textures,o.clear(),++ko),b._textureId=$._textureBindLocation=o.count,o.ids[$.uid]=o.count,o.textures[o.count++]=$,b._batch=i,g+=b.indexSize,b.packAsQuad?(this.packQuadAttributes(b,d,f,b._attributeStart,b._textureId),this.packQuadIndex(p,b._indexStart,b._attributeStart/this.vertexSize)):(this.packAttributes(b,d,f,b._attributeStart,b._textureId),this.packIndex(b,p,b._indexStart,b._attributeStart/this.vertexSize))}o.count>0&&(this._finishBatch(i,x,g-x,o,l,c,t,v),x=g,++ko),this.elementStart=this.elementSize,this._batchIndexStart=x,this._batchIndexSize=g}_finishBatch(t,n,i,o,a,l,c,d){t.gpuBindGroup=null,t.bindGroup=null,t.action=d,t.batcher=this,t.textures=o,t.blendMode=a,t.topology=l,t.start=n,t.size=i,++ko,this.batches[this.batchIndex++]=t,c.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 n=Math.max(t,this.attributeBuffer.size*2),i=new Jy(n);t0(this.attributeBuffer.rawBinaryData,i.rawBinaryData),this.attributeBuffer=i}_resizeIndexBuffer(t){const n=this.indexBuffer;let i=Math.max(t,n.length*1.5);i+=i%2;const o=i>65535?new Uint32Array(i):new Uint16Array(i);if(o.BYTES_PER_ELEMENT!==n.BYTES_PER_ELEMENT)for(let a=0;a(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))(fn||{});class ea extends Or{constructor(t){let{data:n,size:i}=t;const{usage:o,label:a,shrinkToFit:l}=t;super(),this.uid=Fe("buffer"),this._resourceType="buffer",this._resourceId=Fe("resource"),this._touched=0,this._updateID=1,this._dataInt32=null,this.shrinkToFit=!0,this.destroyed=!1,n instanceof Array&&(n=new Float32Array(n)),this._data=n,i??(i=n==null?void 0:n.byteLength);const c=!!n;this.descriptor={size:i,usage:o,mappedAtCreation:c,label:a},this.shrinkToFit=l??!0}get data(){return this._data}set data(t){this.setDataWithSize(t,t.length,!0)}get dataInt32(){return this._dataInt32||(this._dataInt32=new Int32Array(this.data.buffer)),this._dataInt32}get static(){return!!(this.descriptor.usage&fn.STATIC)}set static(t){t?this.descriptor.usage|=fn.STATIC:this.descriptor.usage&=~fn.STATIC}setDataWithSize(t,n,i){if(this._updateID++,this._updateSize=n*t.BYTES_PER_ELEMENT,this._data===t){i&&this.emit("update",this);return}const o=this._data;if(this._data=t,this._dataInt32=null,!o||o.length!==t.length){!this.shrinkToFit&&o&&t.byteLengthc&&(c=v),w>d&&(d=w),vn.destroy()),this.attributes=null,this.buffers=null,this.indexBuffer=null,this._bounds=null}}const nA=new Float32Array(1),rA=new Uint32Array(1);class iA extends eA{constructor(){const n=new ea({data:nA,label:"attribute-batch-buffer",usage:fn.VERTEX|fn.COPY_DST,shrinkToFit:!1}),i=new ea({data:rA,label:"index-batch-buffer",usage:fn.INDEX|fn.COPY_DST,shrinkToFit:!1}),o=6*4;super({attributes:{aPosition:{buffer:n,format:"float32x2",stride:o,offset:0},aUV:{buffer:n,format:"float32x2",stride:o,offset:2*4},aColor:{buffer:n,format:"unorm8x4",stride:o,offset:4*4},aTextureIdAndRound:{buffer:n,format:"uint16x2",stride:o,offset:5*4}},indexBuffer:i})}}function i0(e,t,n){if(e)for(const i in e){const o=i.toLocaleLowerCase(),a=t[o];if(a){let l=e[i];i==="header"&&(l=l.replace(/@in\s+[^;]+;\s*/g,"").replace(/@out\s+[^;]+;\s*/g,"")),n&&a.push(`//----${n}----//`),a.push(l)}else mr(`${i} placement hook does not exist in shader`)}}const sA=/\{\{(.*?)\}\}/g;function s0(e){var i;const t={};return(((i=e.match(sA))==null?void 0:i.map(o=>o.replace(/[{()}]/g,"")))??[]).forEach(o=>{t[o]=[]}),t}function o0(e,t){let n;const i=/@in\s+([^;]+);/g;for(;(n=i.exec(e))!==null;)t.push(n[1])}function a0(e,t,n=!1){const i=[];o0(t,i),e.forEach(c=>{c.header&&o0(c.header,i)});const o=i;n&&o.sort();const a=o.map((c,d)=>` @location(${d}) ${c},`).join(` `);let l=t.replace(/@in\s+[^;]+;\s*/g,"");return l=l.replace("{{in}}",` diff --git a/assets/webworkerAll-DKsR-o4z.js b/assets/webworkerAll-DoE3MJwQ.js similarity index 99% rename from assets/webworkerAll-DKsR-o4z.js rename to assets/webworkerAll-DoE3MJwQ.js index a4d3c12..80c2a32 100644 --- a/assets/webworkerAll-DKsR-o4z.js +++ b/assets/webworkerAll-DoE3MJwQ.js @@ -1,4 +1,4 @@ -import{E as y,U as Wt,T as Pe,a as Ke,a0 as k,a1 as W,Z as F,a9 as $,aa as Re,ab as Me,ac as te,ad as me,D as X,t as A,M as U,w as j,O as fe,ae as At,af as G,ag as oe,a3 as _e,k as Y,c as je,F as H,P as zt,R as xe,H as Ye,b as N,B as L,y as T,ah as Gt,ai as be,K as pe,aj as Q,s as ye,u as Ht,G as Lt,ak as Dt,l as Xe,a4 as Ne,q as qe,a7 as Qe,p as Ot,m as It,o as Et,a5 as Vt,a6 as $t,a8 as Kt,al as jt,am as ge,n as Fe,e as P,an as Yt}from"./index-D1nj3bjZ.js";import{S as re,c as ne,a as Xt,b as Nt,B as Je}from"./colorToUniform-C2GHuDhf.js";import{C as V}from"./CanvasPool-Dff9nFgq.js";class Ze{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}}Ze.extension=y.Application;class et{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?Pe.shared:new Pe,e.autoStart&&this.start()}static destroy(){if(this._ticker){const e=this._ticker;this.ticker=null,e.destroy()}}}et.extension=y.Application;class qt extends Ke{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 k(W,"BitmapFont.font is deprecated, please use BitmapFont.fontFamily instead."),this.fontFamily}get pageTextures(){return k(W,"BitmapFont.pageTextures is deprecated, please use BitmapFont.pages instead."),this.pages}get size(){return k(W,"BitmapFont.size is deprecated, please use BitmapFont.fontMetrics.fontSize instead."),this.fontMetrics.fontSize}get distanceFieldRange(){return k(W,"BitmapFont.distanceFieldRange is deprecated, please use BitmapFont.distanceField.range instead."),this.distanceField.range}get distanceFieldType(){return k(W,"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 ke=["align","breakWords","cssOverrides","fontVariant","fontWeight","leading","letterSpacing","lineHeight","padding","textBaseline","trim","whiteSpace","wordWrap","wordWrapWidth","fontFamily","fontStyle","fontSize"];function tt(n){const e=[];let t=0;for(let r=0;r{this._fill=Re({...this._originalFill},$.defaultFillStyle)})),this._fill=Re(e===0?"black":e,$.defaultFillStyle),this.update())}get stroke(){return this._originalStroke}set stroke(e){e!==this._originalStroke&&(this._originalStroke=e,this._isFillStyle(e)&&(this._originalStroke=this._createProxy({...$.defaultStrokeStyle,...e},()=>{this._stroke=Me({...this._originalStroke},$.defaultStrokeStyle)})),this._stroke=Me(e,$.defaultStrokeStyle),this.update())}_generateKey(){return this._styleKey=tt(this),this._styleKey}update(){this._styleKey=null,this.emit("update",this)}reset(){const e=K.defaultTextStyle;for(const t in e)this[t]=e[t]}get styleKey(){return this._styleKey||this._generateKey()}clone(){return new K({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&&!(F.isColorLike(e)||e instanceof te||e instanceof me)}};Se.defaultDropShadow={alpha:1,angle:Math.PI/6,blur:0,color:"black",distance:5};Se.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 E=Se;function Zt(n){const e=n;if(typeof e.dropShadow=="boolean"&&e.dropShadow){const t=E.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){k(W,"strokeThickness is now a part of stroke");const t=e.stroke;let r={};if(F.isColorLike(t))r.color=t;else if(t instanceof te||t instanceof me)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)){k(W,"gradient fill is now a fill pattern: `new FillGradient(...)`");let t;n.fontSize==null?n.fontSize=E.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=>F.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 le={willReadFrequently:!0},z=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 b=0;b0)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",le);let s=0,a="",o="";const l=Object.create(null),{letterSpacing:d,whiteSpace:h}=t,c=p._collapseSpaces(h),f=p._collapseNewlines(h);let m=!c;const g=t.wordWrapWidth+d,u=p._tokenize(e);for(let _=0;_g)if(a!==""&&(o+=p._addLine(a),a="",s=0),p.canBreakWords(x,t.breakWords)){const b=p.wordWrapSplit(x);for(let S=0;Sg&&(o+=p._addLine(a),m=!1,a="",s=0),a+=v,s+=M}}else{a.length>0&&(o+=p._addLine(a),a="",s=0);const b=_===u.length-1;o+=p._addLine(x,!b),m=!1,a="",s=0}else w+s>g&&(m=!1,o+=p._addLine(a),a="",s=0),(a.length>0||!p.isBreakingSpace(x)||m)&&(a+=x,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 y,U as Wt,T as Pe,a as Ke,a0 as k,a1 as W,Z as F,a9 as $,aa as Re,ab as Me,ac as te,ad as me,D as X,t as A,M as U,w as j,O as fe,ae as At,af as G,ag as oe,a3 as _e,k as Y,c as je,F as H,P as zt,R as xe,H as Ye,b as N,B as L,y as T,ah as Gt,ai as be,K as pe,aj as Q,s as ye,u as Ht,G as Lt,ak as Dt,l as Xe,a4 as Ne,q as qe,a7 as Qe,p as Ot,m as It,o as Et,a5 as Vt,a6 as $t,a8 as Kt,al as jt,am as ge,n as Fe,e as P,an as Yt}from"./index-B5lVtmvj.js";import{S as re,c as ne,a as Xt,b as Nt,B as Je}from"./colorToUniform-C2GHuDhf.js";import{C as V}from"./CanvasPool-DQqeIevT.js";class Ze{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}}Ze.extension=y.Application;class et{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?Pe.shared:new Pe,e.autoStart&&this.start()}static destroy(){if(this._ticker){const e=this._ticker;this.ticker=null,e.destroy()}}}et.extension=y.Application;class qt extends Ke{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 k(W,"BitmapFont.font is deprecated, please use BitmapFont.fontFamily instead."),this.fontFamily}get pageTextures(){return k(W,"BitmapFont.pageTextures is deprecated, please use BitmapFont.pages instead."),this.pages}get size(){return k(W,"BitmapFont.size is deprecated, please use BitmapFont.fontMetrics.fontSize instead."),this.fontMetrics.fontSize}get distanceFieldRange(){return k(W,"BitmapFont.distanceFieldRange is deprecated, please use BitmapFont.distanceField.range instead."),this.distanceField.range}get distanceFieldType(){return k(W,"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 ke=["align","breakWords","cssOverrides","fontVariant","fontWeight","leading","letterSpacing","lineHeight","padding","textBaseline","trim","whiteSpace","wordWrap","wordWrapWidth","fontFamily","fontStyle","fontSize"];function tt(n){const e=[];let t=0;for(let r=0;r{this._fill=Re({...this._originalFill},$.defaultFillStyle)})),this._fill=Re(e===0?"black":e,$.defaultFillStyle),this.update())}get stroke(){return this._originalStroke}set stroke(e){e!==this._originalStroke&&(this._originalStroke=e,this._isFillStyle(e)&&(this._originalStroke=this._createProxy({...$.defaultStrokeStyle,...e},()=>{this._stroke=Me({...this._originalStroke},$.defaultStrokeStyle)})),this._stroke=Me(e,$.defaultStrokeStyle),this.update())}_generateKey(){return this._styleKey=tt(this),this._styleKey}update(){this._styleKey=null,this.emit("update",this)}reset(){const e=K.defaultTextStyle;for(const t in e)this[t]=e[t]}get styleKey(){return this._styleKey||this._generateKey()}clone(){return new K({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&&!(F.isColorLike(e)||e instanceof te||e instanceof me)}};Se.defaultDropShadow={alpha:1,angle:Math.PI/6,blur:0,color:"black",distance:5};Se.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 E=Se;function Zt(n){const e=n;if(typeof e.dropShadow=="boolean"&&e.dropShadow){const t=E.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){k(W,"strokeThickness is now a part of stroke");const t=e.stroke;let r={};if(F.isColorLike(t))r.color=t;else if(t instanceof te||t instanceof me)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)){k(W,"gradient fill is now a fill pattern: `new FillGradient(...)`");let t;n.fontSize==null?n.fontSize=E.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=>F.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 le={willReadFrequently:!0},z=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 b=0;b0)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",le);let s=0,a="",o="";const l=Object.create(null),{letterSpacing:d,whiteSpace:h}=t,c=p._collapseSpaces(h),f=p._collapseNewlines(h);let m=!c;const g=t.wordWrapWidth+d,u=p._tokenize(e);for(let _=0;_g)if(a!==""&&(o+=p._addLine(a),a="",s=0),p.canBreakWords(x,t.breakWords)){const b=p.wordWrapSplit(x);for(let S=0;Sg&&(o+=p._addLine(a),m=!1,a="",s=0),a+=v,s+=M}}else{a.length>0&&(o+=p._addLine(a),a="",s=0);const b=_===u.length-1;o+=p._addLine(x,!b),m=!1,a="",s=0}else w+s>g&&(m=!1,o+=p._addLine(a),a="",s=0),(a.length>0||!p.isBreakingSpace(x)||m)&&(a+=x,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]})();z.experimentalLetterSpacing=!1;z._fonts={};z._newlines=[10,13];z._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];z._measurementCache={};let I=z;function se(n,e){if(n.texture===A.WHITE&&!n.fill)return F.shared.setValue(n.color).setAlpha(n.alpha??1).toHexa();if(n.fill){if(n.fill instanceof me){const t=n.fill,r=e.createPattern(t.texture.source.resource,"repeat"),i=t.transform.copyTo(U.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,F.shared.setValue(i.color).toHex())}),r}}}else{const t=e.createPattern(n.texture.source.resource,"repeat"),r=n.matrix.copyTo(U.shared);return r.scale(n.texture.frame.width,n.texture.frame.height),t.setTransform(r),t}return j("FillStyle not recognised",n),"red"}function it(n){if(n==="")return[];typeof n=="string"&&(n=[n]);const e=[];for(let t=0,r=n.length;t!this._currentChars.includes(w)).filter((w,b,S)=>S.indexOf(w)===b);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,m=!1;const g=i.width/this.resolution,u=i.height/this.resolution;for(let w=0;wg&&(d+=f,f=D,l=0,d+f>u)){a.update();const O=this._nextPage();i=O.canvasAndContext.canvas,s=O.canvasAndContext.context,a=O.texture.source,d=0}const q=v/h-(((_=o.dropShadow)==null?void 0:_.distance)??0)-(((x=o._stroke)==null?void 0:x.width)??0);if(this.chars[b]={id:b.codePointAt(0),xOffset:-this._padding,yOffset:-this._padding,xAdvance:q,kerning:{}},m){this._drawGlyph(s,S,l+c,d+c,h,o);const O=a.width*h,C=a.height*h,ae=new fe(l/O*a.width,d/C*a.height,M/O*a.width,D/C*a.height);this.chars[b].texture=new A({source:a,frame:ae}),l+=Math.ceil(M)}}a.update(),this._currentX=l,this._currentY=d,this._skipKerning&&this._applyKerning(t,s)}get pageTextures(){return k(W,"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 _=0;_{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,m=e.wordWrapWidth*c;for(let g=0;gm?(h(),d(l),_||s.charPositions.push(0)):(l.start=s.width,d(l),_||s.charPositions.push(0)),u==="\r"||u===` diff --git a/index.html b/index.html index ff93f12..01b51c0 100644 --- a/index.html +++ b/index.html @@ -14,7 +14,7 @@ /> MAPF Visualizer - +