pixi.js 8.2.0-main.b9529c8 → 8.2.1-dev.1054a19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * PixiJS - v8.2.0
3
- * Compiled Tue, 25 Jun 2024 11:06:28 UTC
2
+ * PixiJS - v8.2.1
3
+ * Compiled Tue, 25 Jun 2024 11:46:34 UTC
4
4
  *
5
5
  * PixiJS is licensed under the MIT License.
6
6
  * http://www.opensource.org/licenses/mit-license
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * PixiJS - v8.2.0
3
- * Compiled Tue, 25 Jun 2024 11:06:28 UTC
2
+ * PixiJS - v8.2.1
3
+ * Compiled Tue, 25 Jun 2024 11:46:34 UTC
4
4
  *
5
5
  * PixiJS is licensed under the MIT License.
6
6
  * http://www.opensource.org/licenses/mit-license
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * PixiJS - v8.2.0
3
- * Compiled Tue, 25 Jun 2024 11:06:28 UTC
2
+ * PixiJS - v8.2.1
3
+ * Compiled Tue, 25 Jun 2024 11:46:34 UTC
4
4
  *
5
5
  * PixiJS is licensed under the MIT License.
6
6
  * http://www.opensource.org/licenses/mit-license
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * PixiJS - v8.2.0
3
- * Compiled Tue, 25 Jun 2024 11:06:28 UTC
2
+ * PixiJS - v8.2.1
3
+ * Compiled Tue, 25 Jun 2024 11:46:34 UTC
4
4
  *
5
5
  * PixiJS is licensed under the MIT License.
6
6
  * http://www.opensource.org/licenses/mit-license
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * PixiJS - v8.2.0
3
- * Compiled Tue, 25 Jun 2024 11:06:28 UTC
2
+ * PixiJS - v8.2.1
3
+ * Compiled Tue, 25 Jun 2024 11:46:34 UTC
4
4
  *
5
5
  * PixiJS is licensed under the MIT License.
6
6
  * http://www.opensource.org/licenses/mit-license
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * PixiJS - v8.2.0
3
- * Compiled Tue, 25 Jun 2024 11:06:28 UTC
2
+ * PixiJS - v8.2.1
3
+ * Compiled Tue, 25 Jun 2024 11:46:34 UTC
4
4
  *
5
5
  * PixiJS is licensed under the MIT License.
6
6
  * http://www.opensource.org/licenses/mit-license
package/dist/pixi.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * PixiJS - v8.2.0
3
- * Compiled Tue, 25 Jun 2024 11:06:28 UTC
2
+ * PixiJS - v8.2.1
3
+ * Compiled Tue, 25 Jun 2024 11:46:34 UTC
4
4
  *
5
5
  * PixiJS is licensed under the MIT License.
6
6
  * http://www.opensource.org/licenses/mit-license
@@ -39014,7 +39014,7 @@ ${e}`);
39014
39014
 
39015
39015
  "use strict";
39016
39016
  let saidHello = false;
39017
- const VERSION = "8.2.0";
39017
+ const VERSION = "8.2.1";
39018
39018
  function sayHello(type) {
39019
39019
  if (saidHello) {
39020
39020
  return;
package/dist/pixi.min.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * PixiJS - v8.2.0
3
- * Compiled Tue, 25 Jun 2024 11:06:28 UTC
2
+ * PixiJS - v8.2.1
3
+ * Compiled Tue, 25 Jun 2024 11:46:34 UTC
4
4
  *
5
5
  * PixiJS is licensed under the MIT License.
6
6
  * http://www.opensource.org/licenses/mit-license
@@ -1963,7 +1963,7 @@ fn setSaturation(c: vec3<f32>, s: f32) -> vec3<f32> {
1963
1963
  `))}class fl{constructor(t){this._cache={},this._uniformGroupSyncHash={},this._renderer=t,this.gl=null,this._cache={}}contextChange(t){this.gl=t}updateUniformGroup(t,e,i){const s=this._renderer.shader._getProgramData(e);(!t.isStatic||t._dirtyId!==s.uniformDirtyGroups[t.uid])&&(s.uniformDirtyGroups[t.uid]=t._dirtyId,this._getUniformSyncFunction(t,e)(s.uniformData,t.uniforms,this._renderer,i))}_getUniformSyncFunction(t,e){var i;return((i=this._uniformGroupSyncHash[t._signature])==null?void 0:i[e._key])||this._createUniformSyncFunction(t,e)}_createUniformSyncFunction(t,e){const i=this._uniformGroupSyncHash[t._signature]||(this._uniformGroupSyncHash[t._signature]={}),s=this._getSignature(t,e._uniformData,"u");return this._cache[s]||(this._cache[s]=this._generateUniformsSync(t,e._uniformData)),i[e._key]=this._cache[s],i[e._key]}_generateUniformsSync(t,e){return p_(t,e)}_getSignature(t,e,i){const s=t.uniforms,n=[`${i}-`];for(const o in s)n.push(o),e[o]&&n.push(e[o].type);return n.join("-")}destroy(){this._renderer=null,this._cache=null}}fl.extension={type:[x.WebGLSystem],name:"uniformGroup"};function lE(r){return r=r.replaceAll("texture2D","texture").replaceAll("gl_FragColor","finalColor").replaceAll("varying","in"),r=`
1964
1964
  out vec4 finalColor;
1965
1965
  ${r}
1966
- `,r}const uE={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,uint:1,uvec2:2,uvec3:3,uvec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function hE(r){return uE[r]}function f_(r){const t={};return t.normal=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t.add=[r.ONE,r.ONE],t.multiply=[r.DST_COLOR,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA],t.screen=[r.ONE,r.ONE_MINUS_SRC_COLOR,r.ONE,r.ONE_MINUS_SRC_ALPHA],t.none=[0,0],t["normal-npm"]=[r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA],t["add-npm"]=[r.SRC_ALPHA,r.ONE,r.ONE,r.ONE],t["screen-npm"]=[r.SRC_ALPHA,r.ONE_MINUS_SRC_COLOR,r.ONE,r.ONE_MINUS_SRC_ALPHA],t.erase=[r.ZERO,r.ONE_MINUS_SRC_ALPHA],t}const cE=0,dE=1,pE=2,fE=3,mE=4,gE=5,m_=class gu{constructor(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode="none",this._blendEq=!1,this.map=[],this.map[cE]=this.setBlend,this.map[dE]=this.setOffset,this.map[pE]=this.setCullFace,this.map[fE]=this.setDepthTest,this.map[mE]=this.setFrontFace,this.map[gE]=this.setDepthMask,this.checks=[],this.defaultState=Dt.for2d()}contextChange(t){this.gl=t,this.blendModesMap=f_(t),this.reset()}set(t){if(t=t||this.defaultState,this.stateId!==t.data){let e=this.stateId^t.data,i=0;for(;e;)e&1&&this.map[i].call(this,!!(t.data&1<<i)),e=e>>1,i++;this.stateId=t.data}for(let e=0;e<this.checks.length;e++)this.checks[e](this,t)}forceState(t){t=t||this.defaultState;for(let e=0;e<this.map.length;e++)this.map[e].call(this,!!(t.data&1<<e));for(let e=0;e<this.checks.length;e++)this.checks[e](this,t);this.stateId=t.data}setBlend(t){this._updateCheck(gu._checkBlendMode,t),this.gl[t?"enable":"disable"](this.gl.BLEND)}setOffset(t){this._updateCheck(gu._checkPolygonOffset,t),this.gl[t?"enable":"disable"](this.gl.POLYGON_OFFSET_FILL)}setDepthTest(t){this.gl[t?"enable":"disable"](this.gl.DEPTH_TEST)}setDepthMask(t){this.gl.depthMask(t)}setCullFace(t){this.gl[t?"enable":"disable"](this.gl.CULL_FACE)}setFrontFace(t){this.gl.frontFace(this.gl[t?"CW":"CCW"])}setBlendMode(t){if(this.blendModesMap[t]||(t="normal"),t===this.blendMode)return;this.blendMode=t;const e=this.blendModesMap[t],i=this.gl;e.length===2?i.blendFunc(e[0],e[1]):i.blendFuncSeparate(e[0],e[1],e[2],e[3]),e.length===6?(this._blendEq=!0,i.blendEquationSeparate(e[4],e[5])):this._blendEq&&(this._blendEq=!1,i.blendEquationSeparate(i.FUNC_ADD,i.FUNC_ADD))}setPolygonOffset(t,e){this.gl.polygonOffset(t,e)}reset(){this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,!1),this.forceState(this.defaultState),this._blendEq=!0,this.blendMode="",this.setBlendMode("normal")}_updateCheck(t,e){const i=this.checks.indexOf(t);e&&i===-1?this.checks.push(t):!e&&i!==-1&&this.checks.splice(i,1)}static _checkBlendMode(t,e){t.setBlendMode(e.blendMode)}static _checkPolygonOffset(t,e){t.setPolygonOffset(1,e.polygonOffset)}destroy(){this.gl=null,this.checks.length=0}};m_.extension={type:[x.WebGLSystem],name:"state"};let g_=m_;class __{constructor(t){this.target=Ka.TEXTURE_2D,this.texture=t,this.width=-1,this.height=-1,this.type=z.UNSIGNED_BYTE,this.internalFormat=ws.RGBA,this.format=ws.RGBA,this.samplerType=0}}const b_={id:"buffer",upload(r,t,e){t.width===r.width||t.height===r.height?e.texSubImage2D(e.TEXTURE_2D,0,0,0,r.width,r.height,t.format,t.type,r.resource):e.texImage2D(t.target,0,t.internalFormat,r.width,r.height,0,t.format,t.type,r.resource),t.width=r.width,t.height=r.height}},_E={"bc1-rgba-unorm":!0,"bc1-rgba-unorm-srgb":!0,"bc2-rgba-unorm":!0,"bc2-rgba-unorm-srgb":!0,"bc3-rgba-unorm":!0,"bc3-rgba-unorm-srgb":!0,"bc4-r-unorm":!0,"bc4-r-snorm":!0,"bc5-rg-unorm":!0,"bc5-rg-snorm":!0,"bc6h-rgb-ufloat":!0,"bc6h-rgb-float":!0,"bc7-rgba-unorm":!0,"bc7-rgba-unorm-srgb":!0,"etc2-rgb8unorm":!0,"etc2-rgb8unorm-srgb":!0,"etc2-rgb8a1unorm":!0,"etc2-rgb8a1unorm-srgb":!0,"etc2-rgba8unorm":!0,"etc2-rgba8unorm-srgb":!0,"eac-r11unorm":!0,"eac-r11snorm":!0,"eac-rg11unorm":!0,"eac-rg11snorm":!0,"astc-4x4-unorm":!0,"astc-4x4-unorm-srgb":!0,"astc-5x4-unorm":!0,"astc-5x4-unorm-srgb":!0,"astc-5x5-unorm":!0,"astc-5x5-unorm-srgb":!0,"astc-6x5-unorm":!0,"astc-6x5-unorm-srgb":!0,"astc-6x6-unorm":!0,"astc-6x6-unorm-srgb":!0,"astc-8x5-unorm":!0,"astc-8x5-unorm-srgb":!0,"astc-8x6-unorm":!0,"astc-8x6-unorm-srgb":!0,"astc-8x8-unorm":!0,"astc-8x8-unorm-srgb":!0,"astc-10x5-unorm":!0,"astc-10x5-unorm-srgb":!0,"astc-10x6-unorm":!0,"astc-10x6-unorm-srgb":!0,"astc-10x8-unorm":!0,"astc-10x8-unorm-srgb":!0,"astc-10x10-unorm":!0,"astc-10x10-unorm-srgb":!0,"astc-12x10-unorm":!0,"astc-12x10-unorm-srgb":!0,"astc-12x12-unorm":!0,"astc-12x12-unorm-srgb":!0},v_={id:"compressed",upload(r,t,e){e.pixelStorei(e.UNPACK_ALIGNMENT,4);let i=r.pixelWidth,s=r.pixelHeight;const n=!!_E[r.format];for(let o=0;o<r.resource.length;o++){const a=r.resource[o];n?e.compressedTexImage2D(e.TEXTURE_2D,o,t.internalFormat,i,s,0,a):e.texImage2D(e.TEXTURE_2D,o,t.internalFormat,i,s,0,t.format,t.type,a),i=Math.max(i>>1,1),s=Math.max(s>>1,1)}}},ml={id:"image",upload(r,t,e,i){const s=r.alphaMode==="premultiply-alpha-on-upload";e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,s);const n=t.width,o=t.height,a=r.pixelWidth,l=r.pixelHeight,u=r.resourceWidth,h=r.resourceHeight;u<a||h<l?((n!==a||o!==l)&&e.texImage2D(t.target,0,t.internalFormat,a,l,0,t.format,t.type,null),i===2?e.texSubImage2D(e.TEXTURE_2D,0,0,0,u,h,t.format,t.type,r.resource):e.texSubImage2D(e.TEXTURE_2D,0,0,0,t.format,t.type,r.resource)):n===a||o===l?e.texSubImage2D(e.TEXTURE_2D,0,0,0,t.format,t.type,r.resource):i===2?e.texImage2D(t.target,0,t.internalFormat,a,l,0,t.format,t.type,r.resource):e.texImage2D(t.target,0,t.internalFormat,t.format,t.type,r.resource),t.width=a,t.height=l}},y_={id:"video",upload(r,t,e,i){if(!r.isValid){e.texImage2D(t.target,0,t.internalFormat,1,1,0,t.format,t.type,null);return}ml.upload(r,t,e,i)}},gl={linear:9729,nearest:9728},x_={linear:{linear:9987,nearest:9985},nearest:{linear:9986,nearest:9984}},Gs={"clamp-to-edge":33071,repeat:10497,"mirror-repeat":33648},T_={never:512,less:513,equal:514,"less-equal":515,greater:516,"not-equal":517,"greater-equal":518,always:519};function _l(r,t,e,i,s,n,o,a){const l=n;if(!a||r.addressModeU!=="repeat"||r.addressModeV!=="repeat"||r.addressModeW!=="repeat"){const u=Gs[o?"clamp-to-edge":r.addressModeU],h=Gs[o?"clamp-to-edge":r.addressModeV],c=Gs[o?"clamp-to-edge":r.addressModeW];t[s](l,t.TEXTURE_WRAP_S,u),t[s](l,t.TEXTURE_WRAP_T,h),t.TEXTURE_WRAP_R&&t[s](l,t.TEXTURE_WRAP_R,c)}if((!a||r.magFilter!=="linear")&&t[s](l,t.TEXTURE_MAG_FILTER,gl[r.magFilter]),e){if(!a||r.mipmapFilter!=="linear"){const u=x_[r.minFilter][r.mipmapFilter];t[s](l,t.TEXTURE_MIN_FILTER,u)}}else t[s](l,t.TEXTURE_MIN_FILTER,gl[r.minFilter]);if(i&&r.maxAnisotropy>1){const u=Math.min(r.maxAnisotropy,t.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY_EXT));t[s](l,i.TEXTURE_MAX_ANISOTROPY_EXT,u)}r.compare&&t[s](l,t.TEXTURE_COMPARE_FUNC,T_[r.compare])}function S_(r){return{r8unorm:r.RED,r8snorm:r.RED,r8uint:r.RED,r8sint:r.RED,r16uint:r.RED,r16sint:r.RED,r16float:r.RED,rg8unorm:r.RG,rg8snorm:r.RG,rg8uint:r.RG,rg8sint:r.RG,r32uint:r.RED,r32sint:r.RED,r32float:r.RED,rg16uint:r.RG,rg16sint:r.RG,rg16float:r.RG,rgba8unorm:r.RGBA,"rgba8unorm-srgb":r.RGBA,rgba8snorm:r.RGBA,rgba8uint:r.RGBA,rgba8sint:r.RGBA,bgra8unorm:r.RGBA,"bgra8unorm-srgb":r.RGBA,rgb9e5ufloat:r.RGB,rgb10a2unorm:r.RGBA,rg11b10ufloat:r.RGB,rg32uint:r.RG,rg32sint:r.RG,rg32float:r.RG,rgba16uint:r.RGBA,rgba16sint:r.RGBA,rgba16float:r.RGBA,rgba32uint:r.RGBA,rgba32sint:r.RGBA,rgba32float:r.RGBA,stencil8:r.STENCIL_INDEX8,depth16unorm:r.DEPTH_COMPONENT,depth24plus:r.DEPTH_COMPONENT,"depth24plus-stencil8":r.DEPTH_STENCIL,depth32float:r.DEPTH_COMPONENT,"depth32float-stencil8":r.DEPTH_STENCIL}}var bE=Object.defineProperty,vE=Object.defineProperties,yE=Object.getOwnPropertyDescriptors,E_=Object.getOwnPropertySymbols,xE=Object.prototype.hasOwnProperty,TE=Object.prototype.propertyIsEnumerable,A_=(r,t,e)=>t in r?bE(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,Se=(r,t)=>{for(var e in t||(t={}))xE.call(t,e)&&A_(r,e,t[e]);if(E_)for(var e of E_(t))TE.call(t,e)&&A_(r,e,t[e]);return r},SE=(r,t)=>vE(r,yE(t));function P_(r,t){let e={},i=r.RGBA;return r instanceof V.get().getWebGLRenderingContext()?t.srgb&&(e={"rgba8unorm-srgb":t.srgb.SRGB8_ALPHA8_EXT,"bgra8unorm-srgb":t.srgb.SRGB8_ALPHA8_EXT}):(e={"rgba8unorm-srgb":r.SRGB8_ALPHA8,"bgra8unorm-srgb":r.SRGB8_ALPHA8},i=r.RGBA8),Se(Se(Se(Se(Se(Se(SE(Se({r8unorm:r.R8,r8snorm:r.R8_SNORM,r8uint:r.R8UI,r8sint:r.R8I,r16uint:r.R16UI,r16sint:r.R16I,r16float:r.R16F,rg8unorm:r.RG8,rg8snorm:r.RG8_SNORM,rg8uint:r.RG8UI,rg8sint:r.RG8I,r32uint:r.R32UI,r32sint:r.R32I,r32float:r.R32F,rg16uint:r.RG16UI,rg16sint:r.RG16I,rg16float:r.RG16F,rgba8unorm:r.RGBA},e),{rgba8snorm:r.RGBA8_SNORM,rgba8uint:r.RGBA8UI,rgba8sint:r.RGBA8I,bgra8unorm:i,rgb9e5ufloat:r.RGB9_E5,rgb10a2unorm:r.RGB10_A2,rg11b10ufloat:r.R11F_G11F_B10F,rg32uint:r.RG32UI,rg32sint:r.RG32I,rg32float:r.RG32F,rgba16uint:r.RGBA16UI,rgba16sint:r.RGBA16I,rgba16float:r.RGBA16F,rgba32uint:r.RGBA32UI,rgba32sint:r.RGBA32I,rgba32float:r.RGBA32F,stencil8:r.STENCIL_INDEX8,depth16unorm:r.DEPTH_COMPONENT16,depth24plus:r.DEPTH_COMPONENT24,"depth24plus-stencil8":r.DEPTH24_STENCIL8,depth32float:r.DEPTH_COMPONENT32F,"depth32float-stencil8":r.DEPTH32F_STENCIL8}),t.s3tc?{"bc1-rgba-unorm":t.s3tc.COMPRESSED_RGBA_S3TC_DXT1_EXT,"bc2-rgba-unorm":t.s3tc.COMPRESSED_RGBA_S3TC_DXT3_EXT,"bc3-rgba-unorm":t.s3tc.COMPRESSED_RGBA_S3TC_DXT5_EXT}:{}),t.s3tc_sRGB?{"bc1-rgba-unorm-srgb":t.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,"bc2-rgba-unorm-srgb":t.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,"bc3-rgba-unorm-srgb":t.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}:{}),t.rgtc?{"bc4-r-unorm":t.rgtc.COMPRESSED_RED_RGTC1_EXT,"bc4-r-snorm":t.rgtc.COMPRESSED_SIGNED_RED_RGTC1_EXT,"bc5-rg-unorm":t.rgtc.COMPRESSED_RED_GREEN_RGTC2_EXT,"bc5-rg-snorm":t.rgtc.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}:{}),t.bptc?{"bc6h-rgb-float":t.bptc.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,"bc6h-rgb-ufloat":t.bptc.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,"bc7-rgba-unorm":t.bptc.COMPRESSED_RGBA_BPTC_UNORM_EXT,"bc7-rgba-unorm-srgb":t.bptc.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT}:{}),t.etc?{"etc2-rgb8unorm":t.etc.COMPRESSED_RGB8_ETC2,"etc2-rgb8unorm-srgb":t.etc.COMPRESSED_SRGB8_ETC2,"etc2-rgb8a1unorm":t.etc.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,"etc2-rgb8a1unorm-srgb":t.etc.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,"etc2-rgba8unorm":t.etc.COMPRESSED_RGBA8_ETC2_EAC,"etc2-rgba8unorm-srgb":t.etc.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,"eac-r11unorm":t.etc.COMPRESSED_R11_EAC,"eac-rg11unorm":t.etc.COMPRESSED_SIGNED_RG11_EAC}:{}),t.astc?{"astc-4x4-unorm":t.astc.COMPRESSED_RGBA_ASTC_4x4_KHR,"astc-4x4-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,"astc-5x4-unorm":t.astc.COMPRESSED_RGBA_ASTC_5x4_KHR,"astc-5x4-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR,"astc-5x5-unorm":t.astc.COMPRESSED_RGBA_ASTC_5x5_KHR,"astc-5x5-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,"astc-6x5-unorm":t.astc.COMPRESSED_RGBA_ASTC_6x5_KHR,"astc-6x5-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,"astc-6x6-unorm":t.astc.COMPRESSED_RGBA_ASTC_6x6_KHR,"astc-6x6-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,"astc-8x5-unorm":t.astc.COMPRESSED_RGBA_ASTC_8x5_KHR,"astc-8x5-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,"astc-8x6-unorm":t.astc.COMPRESSED_RGBA_ASTC_8x6_KHR,"astc-8x6-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,"astc-8x8-unorm":t.astc.COMPRESSED_RGBA_ASTC_8x8_KHR,"astc-8x8-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,"astc-10x5-unorm":t.astc.COMPRESSED_RGBA_ASTC_10x5_KHR,"astc-10x5-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,"astc-10x6-unorm":t.astc.COMPRESSED_RGBA_ASTC_10x6_KHR,"astc-10x6-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,"astc-10x8-unorm":t.astc.COMPRESSED_RGBA_ASTC_10x8_KHR,"astc-10x8-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,"astc-10x10-unorm":t.astc.COMPRESSED_RGBA_ASTC_10x10_KHR,"astc-10x10-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,"astc-12x10-unorm":t.astc.COMPRESSED_RGBA_ASTC_12x10_KHR,"astc-12x10-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,"astc-12x12-unorm":t.astc.COMPRESSED_RGBA_ASTC_12x12_KHR,"astc-12x12-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR}:{})}function w_(r){return{r8unorm:r.UNSIGNED_BYTE,r8snorm:r.BYTE,r8uint:r.UNSIGNED_BYTE,r8sint:r.BYTE,r16uint:r.UNSIGNED_SHORT,r16sint:r.SHORT,r16float:r.HALF_FLOAT,rg8unorm:r.UNSIGNED_BYTE,rg8snorm:r.BYTE,rg8uint:r.UNSIGNED_BYTE,rg8sint:r.BYTE,r32uint:r.UNSIGNED_INT,r32sint:r.INT,r32float:r.FLOAT,rg16uint:r.UNSIGNED_SHORT,rg16sint:r.SHORT,rg16float:r.HALF_FLOAT,rgba8unorm:r.UNSIGNED_BYTE,"rgba8unorm-srgb":r.UNSIGNED_BYTE,rgba8snorm:r.BYTE,rgba8uint:r.UNSIGNED_BYTE,rgba8sint:r.BYTE,bgra8unorm:r.UNSIGNED_BYTE,"bgra8unorm-srgb":r.UNSIGNED_BYTE,rgb9e5ufloat:r.UNSIGNED_INT_5_9_9_9_REV,rgb10a2unorm:r.UNSIGNED_INT_2_10_10_10_REV,rg11b10ufloat:r.UNSIGNED_INT_10F_11F_11F_REV,rg32uint:r.UNSIGNED_INT,rg32sint:r.INT,rg32float:r.FLOAT,rgba16uint:r.UNSIGNED_SHORT,rgba16sint:r.SHORT,rgba16float:r.HALF_FLOAT,rgba32uint:r.UNSIGNED_INT,rgba32sint:r.INT,rgba32float:r.FLOAT,stencil8:r.UNSIGNED_BYTE,depth16unorm:r.UNSIGNED_SHORT,depth24plus:r.UNSIGNED_INT,"depth24plus-stencil8":r.UNSIGNED_INT_24_8,depth32float:r.FLOAT,"depth32float-stencil8":r.FLOAT_32_UNSIGNED_INT_24_8_REV}}function EE(r){r instanceof Uint8ClampedArray&&(r=new Uint8Array(r.buffer));const t=r.length;for(let e=0;e<t;e+=4){const i=r[e+3];if(i!==0){const s=255.001/i;r[e]=r[e]*s+.5,r[e+1]=r[e+1]*s+.5,r[e+2]=r[e+2]*s+.5}}}const AE=4;class bl{constructor(t){this.managedTextures=[],this._glTextures=Object.create(null),this._glSamplers=Object.create(null),this._boundTextures=[],this._activeTextureLocation=-1,this._boundSamplers=Object.create(null),this._uploads={image:ml,buffer:b_,video:y_,compressed:v_},this._useSeparateSamplers=!1,this._renderer=t}contextChange(t){this._gl=t,this._mapFormatToInternalFormat||(this._mapFormatToInternalFormat=P_(t,this._renderer.context.extensions),this._mapFormatToType=w_(t),this._mapFormatToFormat=S_(t)),this._glTextures=Object.create(null),this._glSamplers=Object.create(null),this._boundSamplers=Object.create(null);for(let e=0;e<16;e++)this.bind(P.EMPTY,e)}initSource(t){this.bind(t)}bind(t,e=0){const i=t.source;t?(this.bindSource(i,e),this._useSeparateSamplers&&this._bindSampler(i.style,e)):(this.bindSource(null,e),this._useSeparateSamplers&&this._bindSampler(null,e))}bindSource(t,e=0){const i=this._gl;if(t._touched=this._renderer.textureGC.count,this._boundTextures[e]!==t){this._boundTextures[e]=t,this._activateLocation(e),t=t||P.EMPTY.source;const s=this.getGlSource(t);i.bindTexture(s.target,s.texture)}}_bindSampler(t,e=0){const i=this._gl;if(!t){this._boundSamplers[e]=null,i.bindSampler(e,null);return}const s=this._getGlSampler(t);this._boundSamplers[e]!==s&&(this._boundSamplers[e]=s,i.bindSampler(e,s))}unbind(t){const e=t.source,i=this._boundTextures,s=this._gl;for(let n=0;n<i.length;n++)if(i[n]===e){this._activateLocation(n);const o=this.getGlSource(e);s.bindTexture(o.target,null),i[n]=null}}_activateLocation(t){this._activeTextureLocation!==t&&(this._activeTextureLocation=t,this._gl.activeTexture(this._gl.TEXTURE0+t))}_initSource(t){const e=this._gl,i=new __(e.createTexture());if(i.type=this._mapFormatToType[t.format],i.internalFormat=this._mapFormatToInternalFormat[t.format],i.format=this._mapFormatToFormat[t.format],t.autoGenerateMipmaps&&(this._renderer.context.supports.nonPowOf2mipmaps||t.isPowerOfTwo)){const s=Math.max(t.width,t.height);t.mipLevelCount=Math.floor(Math.log2(s))+1}return this._glTextures[t.uid]=i,this.managedTextures.includes(t)||(t.on("update",this.onSourceUpdate,this),t.on("resize",this.onSourceUpdate,this),t.on("styleChange",this.onStyleChange,this),t.on("destroy",this.onSourceDestroy,this),t.on("unload",this.onSourceUnload,this),t.on("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.push(t)),this.onSourceUpdate(t),this.updateStyle(t,!1),i}onStyleChange(t){this.updateStyle(t,!1)}updateStyle(t,e){const i=this._gl,s=this.getGlSource(t);i.bindTexture(i.TEXTURE_2D,s.texture),this._boundTextures[this._activeTextureLocation]=t,_l(t.style,i,t.mipLevelCount>1,this._renderer.context.extensions.anisotropicFiltering,"texParameteri",i.TEXTURE_2D,!this._renderer.context.supports.nonPowOf2wrapping&&!t.isPowerOfTwo,e)}onSourceUnload(t){const e=this._glTextures[t.uid];e&&(this.unbind(t),this._glTextures[t.uid]=null,this._gl.deleteTexture(e.texture))}onSourceUpdate(t){const e=this._gl,i=this.getGlSource(t);e.bindTexture(e.TEXTURE_2D,i.texture),this._boundTextures[this._activeTextureLocation]=t,this._uploads[t.uploadMethodId]?this._uploads[t.uploadMethodId].upload(t,i,e,this._renderer.context.webGLVersion):e.texImage2D(e.TEXTURE_2D,0,e.RGBA,t.pixelWidth,t.pixelHeight,0,e.RGBA,e.UNSIGNED_BYTE,null),t.autoGenerateMipmaps&&t.mipLevelCount>1&&this.onUpdateMipmaps(t,!1)}onUpdateMipmaps(t,e=!0){e&&this.bindSource(t,0);const i=this.getGlSource(t);this._gl.generateMipmap(i.target)}onSourceDestroy(t){t.off("destroy",this.onSourceDestroy,this),t.off("update",this.onSourceUpdate,this),t.off("resize",this.onSourceUpdate,this),t.off("unload",this.onSourceUnload,this),t.off("styleChange",this.onStyleChange,this),t.off("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.splice(this.managedTextures.indexOf(t),1),this.onSourceUnload(t)}_initSampler(t){const e=this._gl,i=this._gl.createSampler();return this._glSamplers[t._resourceId]=i,_l(t,e,this._boundTextures[this._activeTextureLocation].mipLevelCount>1,this._renderer.context.extensions.anisotropicFiltering,"samplerParameteri",i,!1,!0),this._glSamplers[t._resourceId]}_getGlSampler(t){return this._glSamplers[t._resourceId]||this._initSampler(t)}getGlSource(t){return this._glTextures[t.uid]||this._initSource(t)}generateCanvas(t){const{pixels:e,width:i,height:s}=this.getPixels(t),n=V.get().createCanvas();n.width=i,n.height=s;const o=n.getContext("2d");if(o){const a=o.createImageData(i,s);a.data.set(e),o.putImageData(a,0,0)}return n}getPixels(t){const e=t.source.resolution,i=t.frame,s=Math.max(Math.round(i.width*e),1),n=Math.max(Math.round(i.height*e),1),o=new Uint8Array(AE*s*n),a=this._renderer,l=a.renderTarget.getRenderTarget(t),u=a.renderTarget.getGpuRenderTarget(l),h=a.gl;return h.bindFramebuffer(h.FRAMEBUFFER,u.resolveTargetFramebuffer),h.readPixels(Math.round(i.x*e),Math.round(i.y*e),s,n,h.RGBA,h.UNSIGNED_BYTE,o),{pixels:new Uint8ClampedArray(o.buffer),width:s,height:n}}destroy(){this.managedTextures.slice().forEach(t=>this.onSourceDestroy(t)),this.managedTextures=null,this._renderer=null}}bl.extension={type:[x.WebGLSystem],name:"texture"};class vl{init(){const t=new nt({uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uTransformMatrix:{value:new G,type:"mat3x3<f32>"},uRound:{value:0,type:"f32"}}),e=Ft(),i=Xe({name:"graphics",bits:[ji,Wi(e),Qi,je]});this.shader=new Et({glProgram:i,resources:{localUniforms:t,batchSamplers:Yi(e)}})}execute(t,e){const i=e.context,s=i.customShader||this.shader,n=t.renderer,o=n.graphicsContext,{geometry:a,instructions:l}=o.getContextRenderData(i);s.groups[0]=n.globalUniforms.bindGroup,n.state.set(t.state),n.shader.bind(s),n.geometry.bind(a,s.glProgram);const u=l.instructions;for(let h=0;h<l.instructionSize;h++){const c=u[h];if(c.size){for(let p=0;p<c.textures.textures.length;p++)n.texture.bind(c.textures.textures[p],p);n.geometry.draw("triangle-list",c.size,c.start)}}}destroy(){this.shader.destroy(!0),this.shader=null}}vl.extension={type:[x.WebGLPipesAdaptor],name:"graphics"};class yl{init(){const t=Xe({name:"mesh",bits:[Qi,Eg,je]});this._shader=new Et({glProgram:t,resources:{uTexture:P.EMPTY.source,textureUniforms:{uTextureMatrix:{type:"mat3x3<f32>",value:new G}}}})}execute(t,e){const i=t.renderer;let s=e._shader;if(s){if(!s.glProgram)return}else{s=this._shader;const n=e.texture,o=n.source;s.resources.uTexture=o,s.resources.uSampler=o.style,s.resources.textureUniforms.uniforms.uTextureMatrix=n.textureMatrix.mapCoord}s.groups[100]=i.globalUniforms.bindGroup,s.groups[101]=t.localUniformsBindGroup,i.encoder.draw({geometry:e._geometry,shader:s,state:e.state})}destroy(){this._shader.destroy(!0),this._shader=null}}yl.extension={type:[x.WebGLPipesAdaptor],name:"mesh"};class xl{constructor(t){this._renderer=t}addRenderable(t,e){this._renderer.renderPipes.batch.break(e),e.add(t)}execute(t){t.isRenderable&&t.render(this._renderer)}destroy(){this._renderer=null}}xl.extension={type:[x.WebGLPipes,x.WebGPUPipes,x.CanvasPipes],name:"customRender"};function Tl(r,t){const e=r.instructionSet,i=e.instructions;for(let s=0;s<e.instructionSize;s++){const n=i[s];t[n.renderPipeId].execute(n)}}class Sl{constructor(t){this._renderer=t}addRenderGroup(t,e){this._renderer.renderPipes.batch.break(e),e.add(t)}execute(t){t.isRenderable&&(this._renderer.globalUniforms.push({worldTransformMatrix:t.worldTransform,worldColor:t.worldColorAlpha}),Tl(t,this._renderer.renderPipes),this._renderer.globalUniforms.pop())}destroy(){this._renderer=null}}Sl.extension={type:[x.WebGLPipes,x.WebGPUPipes,x.CanvasPipes],name:"renderGroup"};function El(r,t=[]){t.push(r);for(let e=0;e<r.renderGroupChildren.length;e++)El(r.renderGroupChildren[e],t);return t}function Al(r,t,e){const i=r>>16&255,s=r>>8&255,n=r&255,o=t>>16&255,a=t>>8&255,l=t&255,u=i+(o-i)*e,h=s+(a-s)*e,c=n+(l-n)*e;return(u<<16)+(h<<8)+c}const tr=16777215;function Pl(r,t){return r===tr||t===tr?r+t-tr:Al(r,t,.5)}function PE(r,t,e){const i=(e>>24&255)/255,s=t*i*255,n=((r&255)<<16)+(r&65280)+(r>>16&255),o=e&16777215;let a;return n===tr||o===tr?a=n+o-tr:a=Al(n,o,.5),a+(s<<24)}const wE=new K;function wl(r,t=!1){R_(r);const e=r.childrenToUpdate,i=r.updateTick++;for(const s in e){const n=Number(s),o=e[s],a=o.list,l=o.index;for(let u=0;u<l;u++){const h=a[u];h.parentRenderGroup===r&&h.relativeRenderGroupDepth===n&&Rl(h,i,0)}o.index=0}if(t)for(let s=0;s<r.renderGroupChildren.length;s++)wl(r.renderGroupChildren[s],t)}function R_(r){const t=r.root;let e;if(r.renderGroupParent){const i=r.renderGroupParent;r.worldTransform.appendFrom(t.relativeGroupTransform,i.worldTransform),r.worldColor=Pl(t.groupColor,i.worldColor),e=t.groupAlpha*i.worldAlpha}else r.worldTransform.copyFrom(t.localTransform),r.worldColor=t.localColor,e=t.localAlpha;e=e<0?0:e>1?1:e,r.worldAlpha=e,r.worldColorAlpha=r.worldColor+((e*255|0)<<24)}function Rl(r,t,e){if(t===r.updateTick)return;r.updateTick=t,r.didChange=!1;const i=r.localTransform;r.updateLocalTransform();const s=r.parent;if(s&&!s.renderGroup?(e=e|r._updateFlags,r.relativeGroupTransform.appendFrom(i,s.relativeGroupTransform),e&&M_(r,s,e)):(e=r._updateFlags,r.relativeGroupTransform.copyFrom(i),e&&M_(r,wE,e)),!r.renderGroup){const n=r.children,o=n.length;for(let l=0;l<o;l++)Rl(n[l],t,e);const a=r.parentRenderGroup;r.renderPipeId&&!a.structureDidChange&&a.updateRenderable(r)}}function M_(r,t,e){if(e&ui){r.groupColor=Pl(r.localColor,t.groupColor);let i=r.localAlpha*t.groupAlpha;i=i<0?0:i>1?1:i,r.groupAlpha=i,r.groupColorAlpha=r.groupColor+((i*255|0)<<24)}e&an&&(r.groupBlendMode=r.localBlendMode==="inherit"?t.groupBlendMode:r.localBlendMode),e&lr&&(r.globalDisplayStatus=r.localDisplayStatus&t.globalDisplayStatus),r._updateFlags=0}function C_(r,t){const{list:e,index:i}=r.childrenRenderablesToUpdate;let s=!1;for(let n=0;n<i;n++){const o=e[n];if(s=t[o.renderPipeId].validateRenderable(o),s)break}return r.structureDidChange=s,s}const RE=new G;class Ml{constructor(t){this._renderer=t}render({container:t,transform:e}){t.isRenderGroup=!0;const i=t.parent,s=t.renderGroup.renderGroupParent;t.parent=null,t.renderGroup.renderGroupParent=null;const n=this._renderer,o=El(t.renderGroup,[]);let a=RE;e&&(a=a.copyFrom(t.renderGroup.localTransform),t.renderGroup.localTransform.copyFrom(e));const l=n.renderPipes;for(let u=0;u<o.length;u++){const h=o[u];h.runOnRender(),h.instructionSet.renderPipes=l,h.structureDidChange||C_(h,l),wl(h),h.structureDidChange?(h.structureDidChange=!1,Ag(h,l)):ME(h),h.childrenRenderablesToUpdate.index=0,n.renderPipes.batch.upload(h.instructionSet)}n.globalUniforms.start({worldTransformMatrix:e?t.renderGroup.localTransform:t.renderGroup.worldTransform,worldColor:t.renderGroup.worldColorAlpha}),Tl(t.renderGroup,l),l.uniformBatch&&l.uniformBatch.renderEnd(),e&&t.renderGroup.localTransform.copyFrom(a),t.parent=i,t.renderGroup.renderGroupParent=s}destroy(){this._renderer=null}}Ml.extension={type:[x.WebGLSystem,x.WebGPUSystem,x.CanvasSystem],name:"renderGroup"};function ME(r){const{list:t,index:e}=r.childrenRenderablesToUpdate;for(let i=0;i<e;i++){const s=t[i];s.didViewUpdate&&r.updateRenderable(s)}}class Cl{constructor(t){this._gpuSpriteHash=Object.create(null),this._renderer=t}addRenderable(t,e){const i=this._getGpuSprite(t);t._didSpriteUpdate&&this._updateBatchableSprite(t,i),this._renderer.renderPipes.batch.addToBatch(i)}updateRenderable(t){const e=this._gpuSpriteHash[t.uid];t._didSpriteUpdate&&this._updateBatchableSprite(t,e),e.batcher.updateElement(e)}validateRenderable(t){const e=t._texture,i=this._getGpuSprite(t);return i.texture._source!==e._source?!i.batcher.checkAndUpdateTexture(i,e):!1}destroyRenderable(t){const e=this._gpuSpriteHash[t.uid];H.return(e),this._gpuSpriteHash[t.uid]=null}_updateBatchableSprite(t,e){t._didSpriteUpdate=!1,e.bounds=t.bounds,e.texture=t._texture}_getGpuSprite(t){return this._gpuSpriteHash[t.uid]||this._initGPUSprite(t)}_initGPUSprite(t){const e=H.get(Bi);return e.renderable=t,e.texture=t._texture,e.bounds=t.bounds,e.roundPixels=this._renderer._roundPixels|t._roundPixels,this._gpuSpriteHash[t.uid]=e,t._didSpriteUpdate=!1,t.on("destroyed",()=>{this.destroyRenderable(t)}),e}destroy(){for(const t in this._gpuSpriteHash)H.return(this._gpuSpriteHash[t]);this._gpuSpriteHash=null,this._renderer=null}}Cl.extension={type:[x.WebGLPipes,x.WebGPUPipes,x.CanvasPipes],name:"sprite"};var CE=Object.defineProperty,O_=Object.getOwnPropertySymbols,OE=Object.prototype.hasOwnProperty,GE=Object.prototype.propertyIsEnumerable,G_=(r,t,e)=>t in r?CE(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,B_=(r,t)=>{for(var e in t||(t={}))OE.call(t,e)&&G_(r,e,t[e]);if(O_)for(var e of O_(t))GE.call(t,e)&&G_(r,e,t[e]);return r};const Ol=class gv{constructor(){this.clearBeforeRender=!0,this._backgroundColor=new j(0),this.color=this._backgroundColor,this.alpha=1}init(t){t=B_(B_({},gv.defaultOptions),t),this.clearBeforeRender=t.clearBeforeRender,this.color=t.background||t.backgroundColor||this._backgroundColor,this.alpha=t.backgroundAlpha,this._backgroundColor.setAlpha(t.backgroundAlpha)}get color(){return this._backgroundColor}set color(t){this._backgroundColor.setValue(t)}get alpha(){return this._backgroundColor.alpha}set alpha(t){this._backgroundColor.setAlpha(t)}get colorRgba(){return this._backgroundColor.toArray()}destroy(){}};Ol.extension={type:[x.WebGLSystem,x.WebGPUSystem,x.CanvasSystem],name:"background",priority:0},Ol.defaultOptions={backgroundAlpha:1,backgroundColor:0,clearBeforeRender:!0};let I_=Ol;const Kr={};U.handle(x.BlendMode,r=>{if(!r.name)throw new Error("BlendMode extension must have a name property");Kr[r.name]=r.ref},r=>{delete Kr[r.name]});class Gl{constructor(t){this._isAdvanced=!1,this._filterHash=Object.create(null),this._renderer=t}setBlendMode(t,e,i){if(this._activeBlendMode===e){this._isAdvanced&&this._renderableList.push(t);return}this._activeBlendMode=e,this._isAdvanced&&this._endAdvancedBlendMode(i),this._isAdvanced=!!Kr[e],this._isAdvanced&&(this._beginAdvancedBlendMode(i),this._renderableList.push(t))}_beginAdvancedBlendMode(t){this._renderer.renderPipes.batch.break(t);const e=this._activeBlendMode;if(!Kr[e])return;let i=this._filterHash[e];i||(i=this._filterHash[e]=new nr,i.filters=[new Kr[e]]);const s={renderPipeId:"filter",action:"pushFilter",renderables:[],filterEffect:i,canBundle:!1};this._renderableList=s.renderables,t.add(s)}_endAdvancedBlendMode(t){this._renderableList=null,this._renderer.renderPipes.batch.break(t),t.add({renderPipeId:"filter",action:"popFilter",canBundle:!1})}buildStart(){this._isAdvanced=!1}buildEnd(t){this._isAdvanced&&this._endAdvancedBlendMode(t)}destroy(){this._renderer=null,this._renderableList=null;for(const t in this._filterHash)this._filterHash[t].destroy();this._filterHash=null}}Gl.extension={type:[x.WebGLPipes,x.WebGPUPipes,x.CanvasPipes],name:"blendMode"};var BE=Object.defineProperty,F_=Object.getOwnPropertySymbols,IE=Object.prototype.hasOwnProperty,FE=Object.prototype.propertyIsEnumerable,D_=(r,t,e)=>t in r?BE(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,Bl=(r,t)=>{for(var e in t||(t={}))IE.call(t,e)&&D_(r,e,t[e]);if(F_)for(var e of F_(t))FE.call(t,e)&&D_(r,e,t[e]);return r};const Il={png:"image/png",jpg:"image/jpeg",webp:"image/webp"},Fl=class _v{constructor(t){this._renderer=t}_normalizeOptions(t,e={}){return t instanceof K||t instanceof P?Bl({target:t},e):Bl(Bl({},e),t)}async image(t){const e=new Image;return e.src=await this.base64(t),e}async base64(t){t=this._normalizeOptions(t,_v.defaultImageOptions);const{format:e,quality:i}=t,s=this.canvas(t);if(s.toBlob!==void 0)return new Promise((n,o)=>{s.toBlob(a=>{if(!a){o(new Error("ICanvas.toBlob failed!"));return}const l=new FileReader;l.onload=()=>n(l.result),l.onerror=o,l.readAsDataURL(a)},Il[e],i)});if(s.toDataURL!==void 0)return s.toDataURL(Il[e],i);if(s.convertToBlob!==void 0){const n=await s.convertToBlob({type:Il[e],quality:i});return new Promise((o,a)=>{const l=new FileReader;l.onload=()=>o(l.result),l.onerror=a,l.readAsDataURL(n)})}throw new Error("Extract.base64() requires ICanvas.toDataURL, ICanvas.toBlob, or ICanvas.convertToBlob to be implemented")}canvas(t){t=this._normalizeOptions(t);const e=t.target,i=this._renderer;if(e instanceof P)return i.texture.generateCanvas(e);const s=i.textureGenerator.generateTexture(t),n=i.texture.generateCanvas(s);return s.destroy(),n}pixels(t){t=this._normalizeOptions(t);const e=t.target,i=this._renderer,s=e instanceof P?e:i.textureGenerator.generateTexture(t),n=i.texture.getPixels(s);return e instanceof K&&s.destroy(),n}texture(t){return t=this._normalizeOptions(t),t.target instanceof P?t.target:this._renderer.textureGenerator.generateTexture(t)}download(t){var e;t=this._normalizeOptions(t);const i=this.canvas(t),s=document.createElement("a");s.download=(e=t.filename)!=null?e:"image.png",s.href=i.toDataURL("image/png"),document.body.appendChild(s),s.click(),document.body.removeChild(s)}log(t){var e;const i=(e=t.width)!=null?e:200;t=this._normalizeOptions(t);const s=this.canvas(t),n=s.toDataURL();console.log(`[Pixi Texture] ${s.width}px ${s.height}px`);const o=["font-size: 1px;",`padding: ${i}px 300px;`,`background: url(${n}) no-repeat;`,"background-size: contain;"].join(" ");console.log("%c ",o)}destroy(){this._renderer=null}};Fl.extension={type:[x.WebGLSystem,x.WebGPUSystem],name:"extract"},Fl.defaultImageOptions={format:"png",quality:1};let U_=Fl;class k_ extends P{static create(t){return new P({source:new et(t)})}resize(t,e,i){return this.source.resize(t,e,i),this}}var DE=Object.defineProperty,UE=Object.defineProperties,kE=Object.getOwnPropertyDescriptors,L_=Object.getOwnPropertySymbols,LE=Object.prototype.hasOwnProperty,$E=Object.prototype.propertyIsEnumerable,$_=(r,t,e)=>t in r?DE(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,NE=(r,t)=>{for(var e in t||(t={}))LE.call(t,e)&&$_(r,e,t[e]);if(L_)for(var e of L_(t))$E.call(t,e)&&$_(r,e,t[e]);return r},HE=(r,t)=>UE(r,kE(t));const XE=new W,zE=new ut,jE=[0,0,0,0];class Dl{constructor(t){this._renderer=t}generateTexture(t){var e;t instanceof K&&(t={target:t,frame:void 0,textureSourceOptions:{},resolution:void 0});const i=t.resolution||this._renderer.resolution,s=t.antialias||this._renderer.view.antialias,n=t.target;let o=t.clearColor;o?o=Array.isArray(o)&&o.length===4?o:j.shared.setValue(o).toArray():o=jE;const a=((e=t.frame)==null?void 0:e.copyTo(XE))||li(n,zE).rectangle;a.width=Math.max(a.width,1/i)|0,a.height=Math.max(a.height,1/i)|0;const l=k_.create(HE(NE({},t.textureSourceOptions),{width:a.width,height:a.height,resolution:i,antialias:s})),u=G.shared.translate(-a.x,-a.y);return this._renderer.render({container:n,transform:u,target:l,clearColor:o}),l.source.updateMipmaps(),l}destroy(){this._renderer=null}}Dl.extension={type:[x.WebGLSystem,x.WebGPUSystem],name:"textureGenerator"};class Ul{constructor(t){this._stackIndex=0,this._globalUniformDataStack=[],this._uniformsPool=[],this._activeUniforms=[],this._bindGroupPool=[],this._activeBindGroups=[],this._renderer=t}reset(){this._stackIndex=0;for(let t=0;t<this._activeUniforms.length;t++)this._uniformsPool.push(this._activeUniforms[t]);for(let t=0;t<this._activeBindGroups.length;t++)this._bindGroupPool.push(this._activeBindGroups[t]);this._activeUniforms.length=0,this._activeBindGroups.length=0}start(t){this.reset(),this.push(t)}bind({size:t,projectionMatrix:e,worldTransformMatrix:i,worldColor:s,offset:n}){const o=this._renderer.renderTarget.renderTarget,a=this._stackIndex?this._globalUniformDataStack[this._stackIndex-1]:{projectionData:o,worldTransformMatrix:new G,worldColor:4294967295,offset:new Y},l={projectionMatrix:e||this._renderer.renderTarget.projectionMatrix,resolution:t||o.size,worldTransformMatrix:i||a.worldTransformMatrix,worldColor:s||a.worldColor,offset:n||a.offset,bindGroup:null},u=this._uniformsPool.pop()||this._createUniforms();this._activeUniforms.push(u);const h=u.uniforms;h.uProjectionMatrix=l.projectionMatrix,h.uResolution=l.resolution,h.uWorldTransformMatrix.copyFrom(l.worldTransformMatrix),h.uWorldTransformMatrix.tx-=l.offset.x,h.uWorldTransformMatrix.ty-=l.offset.y,Tr(l.worldColor,h.uWorldColorAlpha,0),u.update();let c;this._renderer.renderPipes.uniformBatch?c=this._renderer.renderPipes.uniformBatch.getUniformBindGroup(u,!1):(c=this._bindGroupPool.pop()||new Ht,this._activeBindGroups.push(c),c.setResource(u,0)),l.bindGroup=c,this._currentGlobalUniformData=l}push(t){this.bind(t),this._globalUniformDataStack[this._stackIndex++]=this._currentGlobalUniformData}pop(){this._currentGlobalUniformData=this._globalUniformDataStack[--this._stackIndex-1],this._renderer.type===St.WEBGL&&this._currentGlobalUniformData.bindGroup.resources[0].update()}get bindGroup(){return this._currentGlobalUniformData.bindGroup}get uniformGroup(){return this._currentGlobalUniformData.bindGroup.resources[0]}_createUniforms(){return new nt({uProjectionMatrix:{value:new G,type:"mat3x3<f32>"},uWorldTransformMatrix:{value:new G,type:"mat3x3<f32>"},uWorldColorAlpha:{value:new Float32Array(4),type:"vec4<f32>"},uResolution:{value:[0,0],type:"vec2<f32>"}},{isStatic:!0})}destroy(){this._renderer=null}}Ul.extension={type:[x.WebGLSystem,x.WebGPUSystem,x.CanvasSystem],name:"globalUniforms"};let N_=!1;const kl="8.2.0";function H_(r){if(!N_){if(V.get().getNavigator().userAgent.toLowerCase().indexOf("chrome")>-1){const t=[`%c %c %c %c %c PixiJS %c v${kl} (${r}) http://www.pixijs.com/
1966
+ `,r}const uE={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,uint:1,uvec2:2,uvec3:3,uvec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function hE(r){return uE[r]}function f_(r){const t={};return t.normal=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t.add=[r.ONE,r.ONE],t.multiply=[r.DST_COLOR,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA],t.screen=[r.ONE,r.ONE_MINUS_SRC_COLOR,r.ONE,r.ONE_MINUS_SRC_ALPHA],t.none=[0,0],t["normal-npm"]=[r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA],t["add-npm"]=[r.SRC_ALPHA,r.ONE,r.ONE,r.ONE],t["screen-npm"]=[r.SRC_ALPHA,r.ONE_MINUS_SRC_COLOR,r.ONE,r.ONE_MINUS_SRC_ALPHA],t.erase=[r.ZERO,r.ONE_MINUS_SRC_ALPHA],t}const cE=0,dE=1,pE=2,fE=3,mE=4,gE=5,m_=class gu{constructor(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode="none",this._blendEq=!1,this.map=[],this.map[cE]=this.setBlend,this.map[dE]=this.setOffset,this.map[pE]=this.setCullFace,this.map[fE]=this.setDepthTest,this.map[mE]=this.setFrontFace,this.map[gE]=this.setDepthMask,this.checks=[],this.defaultState=Dt.for2d()}contextChange(t){this.gl=t,this.blendModesMap=f_(t),this.reset()}set(t){if(t=t||this.defaultState,this.stateId!==t.data){let e=this.stateId^t.data,i=0;for(;e;)e&1&&this.map[i].call(this,!!(t.data&1<<i)),e=e>>1,i++;this.stateId=t.data}for(let e=0;e<this.checks.length;e++)this.checks[e](this,t)}forceState(t){t=t||this.defaultState;for(let e=0;e<this.map.length;e++)this.map[e].call(this,!!(t.data&1<<e));for(let e=0;e<this.checks.length;e++)this.checks[e](this,t);this.stateId=t.data}setBlend(t){this._updateCheck(gu._checkBlendMode,t),this.gl[t?"enable":"disable"](this.gl.BLEND)}setOffset(t){this._updateCheck(gu._checkPolygonOffset,t),this.gl[t?"enable":"disable"](this.gl.POLYGON_OFFSET_FILL)}setDepthTest(t){this.gl[t?"enable":"disable"](this.gl.DEPTH_TEST)}setDepthMask(t){this.gl.depthMask(t)}setCullFace(t){this.gl[t?"enable":"disable"](this.gl.CULL_FACE)}setFrontFace(t){this.gl.frontFace(this.gl[t?"CW":"CCW"])}setBlendMode(t){if(this.blendModesMap[t]||(t="normal"),t===this.blendMode)return;this.blendMode=t;const e=this.blendModesMap[t],i=this.gl;e.length===2?i.blendFunc(e[0],e[1]):i.blendFuncSeparate(e[0],e[1],e[2],e[3]),e.length===6?(this._blendEq=!0,i.blendEquationSeparate(e[4],e[5])):this._blendEq&&(this._blendEq=!1,i.blendEquationSeparate(i.FUNC_ADD,i.FUNC_ADD))}setPolygonOffset(t,e){this.gl.polygonOffset(t,e)}reset(){this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,!1),this.forceState(this.defaultState),this._blendEq=!0,this.blendMode="",this.setBlendMode("normal")}_updateCheck(t,e){const i=this.checks.indexOf(t);e&&i===-1?this.checks.push(t):!e&&i!==-1&&this.checks.splice(i,1)}static _checkBlendMode(t,e){t.setBlendMode(e.blendMode)}static _checkPolygonOffset(t,e){t.setPolygonOffset(1,e.polygonOffset)}destroy(){this.gl=null,this.checks.length=0}};m_.extension={type:[x.WebGLSystem],name:"state"};let g_=m_;class __{constructor(t){this.target=Ka.TEXTURE_2D,this.texture=t,this.width=-1,this.height=-1,this.type=z.UNSIGNED_BYTE,this.internalFormat=ws.RGBA,this.format=ws.RGBA,this.samplerType=0}}const b_={id:"buffer",upload(r,t,e){t.width===r.width||t.height===r.height?e.texSubImage2D(e.TEXTURE_2D,0,0,0,r.width,r.height,t.format,t.type,r.resource):e.texImage2D(t.target,0,t.internalFormat,r.width,r.height,0,t.format,t.type,r.resource),t.width=r.width,t.height=r.height}},_E={"bc1-rgba-unorm":!0,"bc1-rgba-unorm-srgb":!0,"bc2-rgba-unorm":!0,"bc2-rgba-unorm-srgb":!0,"bc3-rgba-unorm":!0,"bc3-rgba-unorm-srgb":!0,"bc4-r-unorm":!0,"bc4-r-snorm":!0,"bc5-rg-unorm":!0,"bc5-rg-snorm":!0,"bc6h-rgb-ufloat":!0,"bc6h-rgb-float":!0,"bc7-rgba-unorm":!0,"bc7-rgba-unorm-srgb":!0,"etc2-rgb8unorm":!0,"etc2-rgb8unorm-srgb":!0,"etc2-rgb8a1unorm":!0,"etc2-rgb8a1unorm-srgb":!0,"etc2-rgba8unorm":!0,"etc2-rgba8unorm-srgb":!0,"eac-r11unorm":!0,"eac-r11snorm":!0,"eac-rg11unorm":!0,"eac-rg11snorm":!0,"astc-4x4-unorm":!0,"astc-4x4-unorm-srgb":!0,"astc-5x4-unorm":!0,"astc-5x4-unorm-srgb":!0,"astc-5x5-unorm":!0,"astc-5x5-unorm-srgb":!0,"astc-6x5-unorm":!0,"astc-6x5-unorm-srgb":!0,"astc-6x6-unorm":!0,"astc-6x6-unorm-srgb":!0,"astc-8x5-unorm":!0,"astc-8x5-unorm-srgb":!0,"astc-8x6-unorm":!0,"astc-8x6-unorm-srgb":!0,"astc-8x8-unorm":!0,"astc-8x8-unorm-srgb":!0,"astc-10x5-unorm":!0,"astc-10x5-unorm-srgb":!0,"astc-10x6-unorm":!0,"astc-10x6-unorm-srgb":!0,"astc-10x8-unorm":!0,"astc-10x8-unorm-srgb":!0,"astc-10x10-unorm":!0,"astc-10x10-unorm-srgb":!0,"astc-12x10-unorm":!0,"astc-12x10-unorm-srgb":!0,"astc-12x12-unorm":!0,"astc-12x12-unorm-srgb":!0},v_={id:"compressed",upload(r,t,e){e.pixelStorei(e.UNPACK_ALIGNMENT,4);let i=r.pixelWidth,s=r.pixelHeight;const n=!!_E[r.format];for(let o=0;o<r.resource.length;o++){const a=r.resource[o];n?e.compressedTexImage2D(e.TEXTURE_2D,o,t.internalFormat,i,s,0,a):e.texImage2D(e.TEXTURE_2D,o,t.internalFormat,i,s,0,t.format,t.type,a),i=Math.max(i>>1,1),s=Math.max(s>>1,1)}}},ml={id:"image",upload(r,t,e,i){const s=r.alphaMode==="premultiply-alpha-on-upload";e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,s);const n=t.width,o=t.height,a=r.pixelWidth,l=r.pixelHeight,u=r.resourceWidth,h=r.resourceHeight;u<a||h<l?((n!==a||o!==l)&&e.texImage2D(t.target,0,t.internalFormat,a,l,0,t.format,t.type,null),i===2?e.texSubImage2D(e.TEXTURE_2D,0,0,0,u,h,t.format,t.type,r.resource):e.texSubImage2D(e.TEXTURE_2D,0,0,0,t.format,t.type,r.resource)):n===a||o===l?e.texSubImage2D(e.TEXTURE_2D,0,0,0,t.format,t.type,r.resource):i===2?e.texImage2D(t.target,0,t.internalFormat,a,l,0,t.format,t.type,r.resource):e.texImage2D(t.target,0,t.internalFormat,t.format,t.type,r.resource),t.width=a,t.height=l}},y_={id:"video",upload(r,t,e,i){if(!r.isValid){e.texImage2D(t.target,0,t.internalFormat,1,1,0,t.format,t.type,null);return}ml.upload(r,t,e,i)}},gl={linear:9729,nearest:9728},x_={linear:{linear:9987,nearest:9985},nearest:{linear:9986,nearest:9984}},Gs={"clamp-to-edge":33071,repeat:10497,"mirror-repeat":33648},T_={never:512,less:513,equal:514,"less-equal":515,greater:516,"not-equal":517,"greater-equal":518,always:519};function _l(r,t,e,i,s,n,o,a){const l=n;if(!a||r.addressModeU!=="repeat"||r.addressModeV!=="repeat"||r.addressModeW!=="repeat"){const u=Gs[o?"clamp-to-edge":r.addressModeU],h=Gs[o?"clamp-to-edge":r.addressModeV],c=Gs[o?"clamp-to-edge":r.addressModeW];t[s](l,t.TEXTURE_WRAP_S,u),t[s](l,t.TEXTURE_WRAP_T,h),t.TEXTURE_WRAP_R&&t[s](l,t.TEXTURE_WRAP_R,c)}if((!a||r.magFilter!=="linear")&&t[s](l,t.TEXTURE_MAG_FILTER,gl[r.magFilter]),e){if(!a||r.mipmapFilter!=="linear"){const u=x_[r.minFilter][r.mipmapFilter];t[s](l,t.TEXTURE_MIN_FILTER,u)}}else t[s](l,t.TEXTURE_MIN_FILTER,gl[r.minFilter]);if(i&&r.maxAnisotropy>1){const u=Math.min(r.maxAnisotropy,t.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY_EXT));t[s](l,i.TEXTURE_MAX_ANISOTROPY_EXT,u)}r.compare&&t[s](l,t.TEXTURE_COMPARE_FUNC,T_[r.compare])}function S_(r){return{r8unorm:r.RED,r8snorm:r.RED,r8uint:r.RED,r8sint:r.RED,r16uint:r.RED,r16sint:r.RED,r16float:r.RED,rg8unorm:r.RG,rg8snorm:r.RG,rg8uint:r.RG,rg8sint:r.RG,r32uint:r.RED,r32sint:r.RED,r32float:r.RED,rg16uint:r.RG,rg16sint:r.RG,rg16float:r.RG,rgba8unorm:r.RGBA,"rgba8unorm-srgb":r.RGBA,rgba8snorm:r.RGBA,rgba8uint:r.RGBA,rgba8sint:r.RGBA,bgra8unorm:r.RGBA,"bgra8unorm-srgb":r.RGBA,rgb9e5ufloat:r.RGB,rgb10a2unorm:r.RGBA,rg11b10ufloat:r.RGB,rg32uint:r.RG,rg32sint:r.RG,rg32float:r.RG,rgba16uint:r.RGBA,rgba16sint:r.RGBA,rgba16float:r.RGBA,rgba32uint:r.RGBA,rgba32sint:r.RGBA,rgba32float:r.RGBA,stencil8:r.STENCIL_INDEX8,depth16unorm:r.DEPTH_COMPONENT,depth24plus:r.DEPTH_COMPONENT,"depth24plus-stencil8":r.DEPTH_STENCIL,depth32float:r.DEPTH_COMPONENT,"depth32float-stencil8":r.DEPTH_STENCIL}}var bE=Object.defineProperty,vE=Object.defineProperties,yE=Object.getOwnPropertyDescriptors,E_=Object.getOwnPropertySymbols,xE=Object.prototype.hasOwnProperty,TE=Object.prototype.propertyIsEnumerable,A_=(r,t,e)=>t in r?bE(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,Se=(r,t)=>{for(var e in t||(t={}))xE.call(t,e)&&A_(r,e,t[e]);if(E_)for(var e of E_(t))TE.call(t,e)&&A_(r,e,t[e]);return r},SE=(r,t)=>vE(r,yE(t));function P_(r,t){let e={},i=r.RGBA;return r instanceof V.get().getWebGLRenderingContext()?t.srgb&&(e={"rgba8unorm-srgb":t.srgb.SRGB8_ALPHA8_EXT,"bgra8unorm-srgb":t.srgb.SRGB8_ALPHA8_EXT}):(e={"rgba8unorm-srgb":r.SRGB8_ALPHA8,"bgra8unorm-srgb":r.SRGB8_ALPHA8},i=r.RGBA8),Se(Se(Se(Se(Se(Se(SE(Se({r8unorm:r.R8,r8snorm:r.R8_SNORM,r8uint:r.R8UI,r8sint:r.R8I,r16uint:r.R16UI,r16sint:r.R16I,r16float:r.R16F,rg8unorm:r.RG8,rg8snorm:r.RG8_SNORM,rg8uint:r.RG8UI,rg8sint:r.RG8I,r32uint:r.R32UI,r32sint:r.R32I,r32float:r.R32F,rg16uint:r.RG16UI,rg16sint:r.RG16I,rg16float:r.RG16F,rgba8unorm:r.RGBA},e),{rgba8snorm:r.RGBA8_SNORM,rgba8uint:r.RGBA8UI,rgba8sint:r.RGBA8I,bgra8unorm:i,rgb9e5ufloat:r.RGB9_E5,rgb10a2unorm:r.RGB10_A2,rg11b10ufloat:r.R11F_G11F_B10F,rg32uint:r.RG32UI,rg32sint:r.RG32I,rg32float:r.RG32F,rgba16uint:r.RGBA16UI,rgba16sint:r.RGBA16I,rgba16float:r.RGBA16F,rgba32uint:r.RGBA32UI,rgba32sint:r.RGBA32I,rgba32float:r.RGBA32F,stencil8:r.STENCIL_INDEX8,depth16unorm:r.DEPTH_COMPONENT16,depth24plus:r.DEPTH_COMPONENT24,"depth24plus-stencil8":r.DEPTH24_STENCIL8,depth32float:r.DEPTH_COMPONENT32F,"depth32float-stencil8":r.DEPTH32F_STENCIL8}),t.s3tc?{"bc1-rgba-unorm":t.s3tc.COMPRESSED_RGBA_S3TC_DXT1_EXT,"bc2-rgba-unorm":t.s3tc.COMPRESSED_RGBA_S3TC_DXT3_EXT,"bc3-rgba-unorm":t.s3tc.COMPRESSED_RGBA_S3TC_DXT5_EXT}:{}),t.s3tc_sRGB?{"bc1-rgba-unorm-srgb":t.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,"bc2-rgba-unorm-srgb":t.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,"bc3-rgba-unorm-srgb":t.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}:{}),t.rgtc?{"bc4-r-unorm":t.rgtc.COMPRESSED_RED_RGTC1_EXT,"bc4-r-snorm":t.rgtc.COMPRESSED_SIGNED_RED_RGTC1_EXT,"bc5-rg-unorm":t.rgtc.COMPRESSED_RED_GREEN_RGTC2_EXT,"bc5-rg-snorm":t.rgtc.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}:{}),t.bptc?{"bc6h-rgb-float":t.bptc.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,"bc6h-rgb-ufloat":t.bptc.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,"bc7-rgba-unorm":t.bptc.COMPRESSED_RGBA_BPTC_UNORM_EXT,"bc7-rgba-unorm-srgb":t.bptc.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT}:{}),t.etc?{"etc2-rgb8unorm":t.etc.COMPRESSED_RGB8_ETC2,"etc2-rgb8unorm-srgb":t.etc.COMPRESSED_SRGB8_ETC2,"etc2-rgb8a1unorm":t.etc.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,"etc2-rgb8a1unorm-srgb":t.etc.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,"etc2-rgba8unorm":t.etc.COMPRESSED_RGBA8_ETC2_EAC,"etc2-rgba8unorm-srgb":t.etc.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,"eac-r11unorm":t.etc.COMPRESSED_R11_EAC,"eac-rg11unorm":t.etc.COMPRESSED_SIGNED_RG11_EAC}:{}),t.astc?{"astc-4x4-unorm":t.astc.COMPRESSED_RGBA_ASTC_4x4_KHR,"astc-4x4-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,"astc-5x4-unorm":t.astc.COMPRESSED_RGBA_ASTC_5x4_KHR,"astc-5x4-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR,"astc-5x5-unorm":t.astc.COMPRESSED_RGBA_ASTC_5x5_KHR,"astc-5x5-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,"astc-6x5-unorm":t.astc.COMPRESSED_RGBA_ASTC_6x5_KHR,"astc-6x5-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,"astc-6x6-unorm":t.astc.COMPRESSED_RGBA_ASTC_6x6_KHR,"astc-6x6-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,"astc-8x5-unorm":t.astc.COMPRESSED_RGBA_ASTC_8x5_KHR,"astc-8x5-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,"astc-8x6-unorm":t.astc.COMPRESSED_RGBA_ASTC_8x6_KHR,"astc-8x6-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,"astc-8x8-unorm":t.astc.COMPRESSED_RGBA_ASTC_8x8_KHR,"astc-8x8-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,"astc-10x5-unorm":t.astc.COMPRESSED_RGBA_ASTC_10x5_KHR,"astc-10x5-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,"astc-10x6-unorm":t.astc.COMPRESSED_RGBA_ASTC_10x6_KHR,"astc-10x6-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,"astc-10x8-unorm":t.astc.COMPRESSED_RGBA_ASTC_10x8_KHR,"astc-10x8-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,"astc-10x10-unorm":t.astc.COMPRESSED_RGBA_ASTC_10x10_KHR,"astc-10x10-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,"astc-12x10-unorm":t.astc.COMPRESSED_RGBA_ASTC_12x10_KHR,"astc-12x10-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,"astc-12x12-unorm":t.astc.COMPRESSED_RGBA_ASTC_12x12_KHR,"astc-12x12-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR}:{})}function w_(r){return{r8unorm:r.UNSIGNED_BYTE,r8snorm:r.BYTE,r8uint:r.UNSIGNED_BYTE,r8sint:r.BYTE,r16uint:r.UNSIGNED_SHORT,r16sint:r.SHORT,r16float:r.HALF_FLOAT,rg8unorm:r.UNSIGNED_BYTE,rg8snorm:r.BYTE,rg8uint:r.UNSIGNED_BYTE,rg8sint:r.BYTE,r32uint:r.UNSIGNED_INT,r32sint:r.INT,r32float:r.FLOAT,rg16uint:r.UNSIGNED_SHORT,rg16sint:r.SHORT,rg16float:r.HALF_FLOAT,rgba8unorm:r.UNSIGNED_BYTE,"rgba8unorm-srgb":r.UNSIGNED_BYTE,rgba8snorm:r.BYTE,rgba8uint:r.UNSIGNED_BYTE,rgba8sint:r.BYTE,bgra8unorm:r.UNSIGNED_BYTE,"bgra8unorm-srgb":r.UNSIGNED_BYTE,rgb9e5ufloat:r.UNSIGNED_INT_5_9_9_9_REV,rgb10a2unorm:r.UNSIGNED_INT_2_10_10_10_REV,rg11b10ufloat:r.UNSIGNED_INT_10F_11F_11F_REV,rg32uint:r.UNSIGNED_INT,rg32sint:r.INT,rg32float:r.FLOAT,rgba16uint:r.UNSIGNED_SHORT,rgba16sint:r.SHORT,rgba16float:r.HALF_FLOAT,rgba32uint:r.UNSIGNED_INT,rgba32sint:r.INT,rgba32float:r.FLOAT,stencil8:r.UNSIGNED_BYTE,depth16unorm:r.UNSIGNED_SHORT,depth24plus:r.UNSIGNED_INT,"depth24plus-stencil8":r.UNSIGNED_INT_24_8,depth32float:r.FLOAT,"depth32float-stencil8":r.FLOAT_32_UNSIGNED_INT_24_8_REV}}function EE(r){r instanceof Uint8ClampedArray&&(r=new Uint8Array(r.buffer));const t=r.length;for(let e=0;e<t;e+=4){const i=r[e+3];if(i!==0){const s=255.001/i;r[e]=r[e]*s+.5,r[e+1]=r[e+1]*s+.5,r[e+2]=r[e+2]*s+.5}}}const AE=4;class bl{constructor(t){this.managedTextures=[],this._glTextures=Object.create(null),this._glSamplers=Object.create(null),this._boundTextures=[],this._activeTextureLocation=-1,this._boundSamplers=Object.create(null),this._uploads={image:ml,buffer:b_,video:y_,compressed:v_},this._useSeparateSamplers=!1,this._renderer=t}contextChange(t){this._gl=t,this._mapFormatToInternalFormat||(this._mapFormatToInternalFormat=P_(t,this._renderer.context.extensions),this._mapFormatToType=w_(t),this._mapFormatToFormat=S_(t)),this._glTextures=Object.create(null),this._glSamplers=Object.create(null),this._boundSamplers=Object.create(null);for(let e=0;e<16;e++)this.bind(P.EMPTY,e)}initSource(t){this.bind(t)}bind(t,e=0){const i=t.source;t?(this.bindSource(i,e),this._useSeparateSamplers&&this._bindSampler(i.style,e)):(this.bindSource(null,e),this._useSeparateSamplers&&this._bindSampler(null,e))}bindSource(t,e=0){const i=this._gl;if(t._touched=this._renderer.textureGC.count,this._boundTextures[e]!==t){this._boundTextures[e]=t,this._activateLocation(e),t=t||P.EMPTY.source;const s=this.getGlSource(t);i.bindTexture(s.target,s.texture)}}_bindSampler(t,e=0){const i=this._gl;if(!t){this._boundSamplers[e]=null,i.bindSampler(e,null);return}const s=this._getGlSampler(t);this._boundSamplers[e]!==s&&(this._boundSamplers[e]=s,i.bindSampler(e,s))}unbind(t){const e=t.source,i=this._boundTextures,s=this._gl;for(let n=0;n<i.length;n++)if(i[n]===e){this._activateLocation(n);const o=this.getGlSource(e);s.bindTexture(o.target,null),i[n]=null}}_activateLocation(t){this._activeTextureLocation!==t&&(this._activeTextureLocation=t,this._gl.activeTexture(this._gl.TEXTURE0+t))}_initSource(t){const e=this._gl,i=new __(e.createTexture());if(i.type=this._mapFormatToType[t.format],i.internalFormat=this._mapFormatToInternalFormat[t.format],i.format=this._mapFormatToFormat[t.format],t.autoGenerateMipmaps&&(this._renderer.context.supports.nonPowOf2mipmaps||t.isPowerOfTwo)){const s=Math.max(t.width,t.height);t.mipLevelCount=Math.floor(Math.log2(s))+1}return this._glTextures[t.uid]=i,this.managedTextures.includes(t)||(t.on("update",this.onSourceUpdate,this),t.on("resize",this.onSourceUpdate,this),t.on("styleChange",this.onStyleChange,this),t.on("destroy",this.onSourceDestroy,this),t.on("unload",this.onSourceUnload,this),t.on("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.push(t)),this.onSourceUpdate(t),this.updateStyle(t,!1),i}onStyleChange(t){this.updateStyle(t,!1)}updateStyle(t,e){const i=this._gl,s=this.getGlSource(t);i.bindTexture(i.TEXTURE_2D,s.texture),this._boundTextures[this._activeTextureLocation]=t,_l(t.style,i,t.mipLevelCount>1,this._renderer.context.extensions.anisotropicFiltering,"texParameteri",i.TEXTURE_2D,!this._renderer.context.supports.nonPowOf2wrapping&&!t.isPowerOfTwo,e)}onSourceUnload(t){const e=this._glTextures[t.uid];e&&(this.unbind(t),this._glTextures[t.uid]=null,this._gl.deleteTexture(e.texture))}onSourceUpdate(t){const e=this._gl,i=this.getGlSource(t);e.bindTexture(e.TEXTURE_2D,i.texture),this._boundTextures[this._activeTextureLocation]=t,this._uploads[t.uploadMethodId]?this._uploads[t.uploadMethodId].upload(t,i,e,this._renderer.context.webGLVersion):e.texImage2D(e.TEXTURE_2D,0,e.RGBA,t.pixelWidth,t.pixelHeight,0,e.RGBA,e.UNSIGNED_BYTE,null),t.autoGenerateMipmaps&&t.mipLevelCount>1&&this.onUpdateMipmaps(t,!1)}onUpdateMipmaps(t,e=!0){e&&this.bindSource(t,0);const i=this.getGlSource(t);this._gl.generateMipmap(i.target)}onSourceDestroy(t){t.off("destroy",this.onSourceDestroy,this),t.off("update",this.onSourceUpdate,this),t.off("resize",this.onSourceUpdate,this),t.off("unload",this.onSourceUnload,this),t.off("styleChange",this.onStyleChange,this),t.off("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.splice(this.managedTextures.indexOf(t),1),this.onSourceUnload(t)}_initSampler(t){const e=this._gl,i=this._gl.createSampler();return this._glSamplers[t._resourceId]=i,_l(t,e,this._boundTextures[this._activeTextureLocation].mipLevelCount>1,this._renderer.context.extensions.anisotropicFiltering,"samplerParameteri",i,!1,!0),this._glSamplers[t._resourceId]}_getGlSampler(t){return this._glSamplers[t._resourceId]||this._initSampler(t)}getGlSource(t){return this._glTextures[t.uid]||this._initSource(t)}generateCanvas(t){const{pixels:e,width:i,height:s}=this.getPixels(t),n=V.get().createCanvas();n.width=i,n.height=s;const o=n.getContext("2d");if(o){const a=o.createImageData(i,s);a.data.set(e),o.putImageData(a,0,0)}return n}getPixels(t){const e=t.source.resolution,i=t.frame,s=Math.max(Math.round(i.width*e),1),n=Math.max(Math.round(i.height*e),1),o=new Uint8Array(AE*s*n),a=this._renderer,l=a.renderTarget.getRenderTarget(t),u=a.renderTarget.getGpuRenderTarget(l),h=a.gl;return h.bindFramebuffer(h.FRAMEBUFFER,u.resolveTargetFramebuffer),h.readPixels(Math.round(i.x*e),Math.round(i.y*e),s,n,h.RGBA,h.UNSIGNED_BYTE,o),{pixels:new Uint8ClampedArray(o.buffer),width:s,height:n}}destroy(){this.managedTextures.slice().forEach(t=>this.onSourceDestroy(t)),this.managedTextures=null,this._renderer=null}}bl.extension={type:[x.WebGLSystem],name:"texture"};class vl{init(){const t=new nt({uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uTransformMatrix:{value:new G,type:"mat3x3<f32>"},uRound:{value:0,type:"f32"}}),e=Ft(),i=Xe({name:"graphics",bits:[ji,Wi(e),Qi,je]});this.shader=new Et({glProgram:i,resources:{localUniforms:t,batchSamplers:Yi(e)}})}execute(t,e){const i=e.context,s=i.customShader||this.shader,n=t.renderer,o=n.graphicsContext,{geometry:a,instructions:l}=o.getContextRenderData(i);s.groups[0]=n.globalUniforms.bindGroup,n.state.set(t.state),n.shader.bind(s),n.geometry.bind(a,s.glProgram);const u=l.instructions;for(let h=0;h<l.instructionSize;h++){const c=u[h];if(c.size){for(let p=0;p<c.textures.textures.length;p++)n.texture.bind(c.textures.textures[p],p);n.geometry.draw("triangle-list",c.size,c.start)}}}destroy(){this.shader.destroy(!0),this.shader=null}}vl.extension={type:[x.WebGLPipesAdaptor],name:"graphics"};class yl{init(){const t=Xe({name:"mesh",bits:[Qi,Eg,je]});this._shader=new Et({glProgram:t,resources:{uTexture:P.EMPTY.source,textureUniforms:{uTextureMatrix:{type:"mat3x3<f32>",value:new G}}}})}execute(t,e){const i=t.renderer;let s=e._shader;if(s){if(!s.glProgram)return}else{s=this._shader;const n=e.texture,o=n.source;s.resources.uTexture=o,s.resources.uSampler=o.style,s.resources.textureUniforms.uniforms.uTextureMatrix=n.textureMatrix.mapCoord}s.groups[100]=i.globalUniforms.bindGroup,s.groups[101]=t.localUniformsBindGroup,i.encoder.draw({geometry:e._geometry,shader:s,state:e.state})}destroy(){this._shader.destroy(!0),this._shader=null}}yl.extension={type:[x.WebGLPipesAdaptor],name:"mesh"};class xl{constructor(t){this._renderer=t}addRenderable(t,e){this._renderer.renderPipes.batch.break(e),e.add(t)}execute(t){t.isRenderable&&t.render(this._renderer)}destroy(){this._renderer=null}}xl.extension={type:[x.WebGLPipes,x.WebGPUPipes,x.CanvasPipes],name:"customRender"};function Tl(r,t){const e=r.instructionSet,i=e.instructions;for(let s=0;s<e.instructionSize;s++){const n=i[s];t[n.renderPipeId].execute(n)}}class Sl{constructor(t){this._renderer=t}addRenderGroup(t,e){this._renderer.renderPipes.batch.break(e),e.add(t)}execute(t){t.isRenderable&&(this._renderer.globalUniforms.push({worldTransformMatrix:t.worldTransform,worldColor:t.worldColorAlpha}),Tl(t,this._renderer.renderPipes),this._renderer.globalUniforms.pop())}destroy(){this._renderer=null}}Sl.extension={type:[x.WebGLPipes,x.WebGPUPipes,x.CanvasPipes],name:"renderGroup"};function El(r,t=[]){t.push(r);for(let e=0;e<r.renderGroupChildren.length;e++)El(r.renderGroupChildren[e],t);return t}function Al(r,t,e){const i=r>>16&255,s=r>>8&255,n=r&255,o=t>>16&255,a=t>>8&255,l=t&255,u=i+(o-i)*e,h=s+(a-s)*e,c=n+(l-n)*e;return(u<<16)+(h<<8)+c}const tr=16777215;function Pl(r,t){return r===tr||t===tr?r+t-tr:Al(r,t,.5)}function PE(r,t,e){const i=(e>>24&255)/255,s=t*i*255,n=((r&255)<<16)+(r&65280)+(r>>16&255),o=e&16777215;let a;return n===tr||o===tr?a=n+o-tr:a=Al(n,o,.5),a+(s<<24)}const wE=new K;function wl(r,t=!1){R_(r);const e=r.childrenToUpdate,i=r.updateTick++;for(const s in e){const n=Number(s),o=e[s],a=o.list,l=o.index;for(let u=0;u<l;u++){const h=a[u];h.parentRenderGroup===r&&h.relativeRenderGroupDepth===n&&Rl(h,i,0)}o.index=0}if(t)for(let s=0;s<r.renderGroupChildren.length;s++)wl(r.renderGroupChildren[s],t)}function R_(r){const t=r.root;let e;if(r.renderGroupParent){const i=r.renderGroupParent;r.worldTransform.appendFrom(t.relativeGroupTransform,i.worldTransform),r.worldColor=Pl(t.groupColor,i.worldColor),e=t.groupAlpha*i.worldAlpha}else r.worldTransform.copyFrom(t.localTransform),r.worldColor=t.localColor,e=t.localAlpha;e=e<0?0:e>1?1:e,r.worldAlpha=e,r.worldColorAlpha=r.worldColor+((e*255|0)<<24)}function Rl(r,t,e){if(t===r.updateTick)return;r.updateTick=t,r.didChange=!1;const i=r.localTransform;r.updateLocalTransform();const s=r.parent;if(s&&!s.renderGroup?(e=e|r._updateFlags,r.relativeGroupTransform.appendFrom(i,s.relativeGroupTransform),e&&M_(r,s,e)):(e=r._updateFlags,r.relativeGroupTransform.copyFrom(i),e&&M_(r,wE,e)),!r.renderGroup){const n=r.children,o=n.length;for(let l=0;l<o;l++)Rl(n[l],t,e);const a=r.parentRenderGroup;r.renderPipeId&&!a.structureDidChange&&a.updateRenderable(r)}}function M_(r,t,e){if(e&ui){r.groupColor=Pl(r.localColor,t.groupColor);let i=r.localAlpha*t.groupAlpha;i=i<0?0:i>1?1:i,r.groupAlpha=i,r.groupColorAlpha=r.groupColor+((i*255|0)<<24)}e&an&&(r.groupBlendMode=r.localBlendMode==="inherit"?t.groupBlendMode:r.localBlendMode),e&lr&&(r.globalDisplayStatus=r.localDisplayStatus&t.globalDisplayStatus),r._updateFlags=0}function C_(r,t){const{list:e,index:i}=r.childrenRenderablesToUpdate;let s=!1;for(let n=0;n<i;n++){const o=e[n];if(s=t[o.renderPipeId].validateRenderable(o),s)break}return r.structureDidChange=s,s}const RE=new G;class Ml{constructor(t){this._renderer=t}render({container:t,transform:e}){t.isRenderGroup=!0;const i=t.parent,s=t.renderGroup.renderGroupParent;t.parent=null,t.renderGroup.renderGroupParent=null;const n=this._renderer,o=El(t.renderGroup,[]);let a=RE;e&&(a=a.copyFrom(t.renderGroup.localTransform),t.renderGroup.localTransform.copyFrom(e));const l=n.renderPipes;for(let u=0;u<o.length;u++){const h=o[u];h.runOnRender(),h.instructionSet.renderPipes=l,h.structureDidChange||C_(h,l),wl(h),h.structureDidChange?(h.structureDidChange=!1,Ag(h,l)):ME(h),h.childrenRenderablesToUpdate.index=0,n.renderPipes.batch.upload(h.instructionSet)}n.globalUniforms.start({worldTransformMatrix:e?t.renderGroup.localTransform:t.renderGroup.worldTransform,worldColor:t.renderGroup.worldColorAlpha}),Tl(t.renderGroup,l),l.uniformBatch&&l.uniformBatch.renderEnd(),e&&t.renderGroup.localTransform.copyFrom(a),t.parent=i,t.renderGroup.renderGroupParent=s}destroy(){this._renderer=null}}Ml.extension={type:[x.WebGLSystem,x.WebGPUSystem,x.CanvasSystem],name:"renderGroup"};function ME(r){const{list:t,index:e}=r.childrenRenderablesToUpdate;for(let i=0;i<e;i++){const s=t[i];s.didViewUpdate&&r.updateRenderable(s)}}class Cl{constructor(t){this._gpuSpriteHash=Object.create(null),this._renderer=t}addRenderable(t,e){const i=this._getGpuSprite(t);t._didSpriteUpdate&&this._updateBatchableSprite(t,i),this._renderer.renderPipes.batch.addToBatch(i)}updateRenderable(t){const e=this._gpuSpriteHash[t.uid];t._didSpriteUpdate&&this._updateBatchableSprite(t,e),e.batcher.updateElement(e)}validateRenderable(t){const e=t._texture,i=this._getGpuSprite(t);return i.texture._source!==e._source?!i.batcher.checkAndUpdateTexture(i,e):!1}destroyRenderable(t){const e=this._gpuSpriteHash[t.uid];H.return(e),this._gpuSpriteHash[t.uid]=null}_updateBatchableSprite(t,e){t._didSpriteUpdate=!1,e.bounds=t.bounds,e.texture=t._texture}_getGpuSprite(t){return this._gpuSpriteHash[t.uid]||this._initGPUSprite(t)}_initGPUSprite(t){const e=H.get(Bi);return e.renderable=t,e.texture=t._texture,e.bounds=t.bounds,e.roundPixels=this._renderer._roundPixels|t._roundPixels,this._gpuSpriteHash[t.uid]=e,t._didSpriteUpdate=!1,t.on("destroyed",()=>{this.destroyRenderable(t)}),e}destroy(){for(const t in this._gpuSpriteHash)H.return(this._gpuSpriteHash[t]);this._gpuSpriteHash=null,this._renderer=null}}Cl.extension={type:[x.WebGLPipes,x.WebGPUPipes,x.CanvasPipes],name:"sprite"};var CE=Object.defineProperty,O_=Object.getOwnPropertySymbols,OE=Object.prototype.hasOwnProperty,GE=Object.prototype.propertyIsEnumerable,G_=(r,t,e)=>t in r?CE(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,B_=(r,t)=>{for(var e in t||(t={}))OE.call(t,e)&&G_(r,e,t[e]);if(O_)for(var e of O_(t))GE.call(t,e)&&G_(r,e,t[e]);return r};const Ol=class gv{constructor(){this.clearBeforeRender=!0,this._backgroundColor=new j(0),this.color=this._backgroundColor,this.alpha=1}init(t){t=B_(B_({},gv.defaultOptions),t),this.clearBeforeRender=t.clearBeforeRender,this.color=t.background||t.backgroundColor||this._backgroundColor,this.alpha=t.backgroundAlpha,this._backgroundColor.setAlpha(t.backgroundAlpha)}get color(){return this._backgroundColor}set color(t){this._backgroundColor.setValue(t)}get alpha(){return this._backgroundColor.alpha}set alpha(t){this._backgroundColor.setAlpha(t)}get colorRgba(){return this._backgroundColor.toArray()}destroy(){}};Ol.extension={type:[x.WebGLSystem,x.WebGPUSystem,x.CanvasSystem],name:"background",priority:0},Ol.defaultOptions={backgroundAlpha:1,backgroundColor:0,clearBeforeRender:!0};let I_=Ol;const Kr={};U.handle(x.BlendMode,r=>{if(!r.name)throw new Error("BlendMode extension must have a name property");Kr[r.name]=r.ref},r=>{delete Kr[r.name]});class Gl{constructor(t){this._isAdvanced=!1,this._filterHash=Object.create(null),this._renderer=t}setBlendMode(t,e,i){if(this._activeBlendMode===e){this._isAdvanced&&this._renderableList.push(t);return}this._activeBlendMode=e,this._isAdvanced&&this._endAdvancedBlendMode(i),this._isAdvanced=!!Kr[e],this._isAdvanced&&(this._beginAdvancedBlendMode(i),this._renderableList.push(t))}_beginAdvancedBlendMode(t){this._renderer.renderPipes.batch.break(t);const e=this._activeBlendMode;if(!Kr[e])return;let i=this._filterHash[e];i||(i=this._filterHash[e]=new nr,i.filters=[new Kr[e]]);const s={renderPipeId:"filter",action:"pushFilter",renderables:[],filterEffect:i,canBundle:!1};this._renderableList=s.renderables,t.add(s)}_endAdvancedBlendMode(t){this._renderableList=null,this._renderer.renderPipes.batch.break(t),t.add({renderPipeId:"filter",action:"popFilter",canBundle:!1})}buildStart(){this._isAdvanced=!1}buildEnd(t){this._isAdvanced&&this._endAdvancedBlendMode(t)}destroy(){this._renderer=null,this._renderableList=null;for(const t in this._filterHash)this._filterHash[t].destroy();this._filterHash=null}}Gl.extension={type:[x.WebGLPipes,x.WebGPUPipes,x.CanvasPipes],name:"blendMode"};var BE=Object.defineProperty,F_=Object.getOwnPropertySymbols,IE=Object.prototype.hasOwnProperty,FE=Object.prototype.propertyIsEnumerable,D_=(r,t,e)=>t in r?BE(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,Bl=(r,t)=>{for(var e in t||(t={}))IE.call(t,e)&&D_(r,e,t[e]);if(F_)for(var e of F_(t))FE.call(t,e)&&D_(r,e,t[e]);return r};const Il={png:"image/png",jpg:"image/jpeg",webp:"image/webp"},Fl=class _v{constructor(t){this._renderer=t}_normalizeOptions(t,e={}){return t instanceof K||t instanceof P?Bl({target:t},e):Bl(Bl({},e),t)}async image(t){const e=new Image;return e.src=await this.base64(t),e}async base64(t){t=this._normalizeOptions(t,_v.defaultImageOptions);const{format:e,quality:i}=t,s=this.canvas(t);if(s.toBlob!==void 0)return new Promise((n,o)=>{s.toBlob(a=>{if(!a){o(new Error("ICanvas.toBlob failed!"));return}const l=new FileReader;l.onload=()=>n(l.result),l.onerror=o,l.readAsDataURL(a)},Il[e],i)});if(s.toDataURL!==void 0)return s.toDataURL(Il[e],i);if(s.convertToBlob!==void 0){const n=await s.convertToBlob({type:Il[e],quality:i});return new Promise((o,a)=>{const l=new FileReader;l.onload=()=>o(l.result),l.onerror=a,l.readAsDataURL(n)})}throw new Error("Extract.base64() requires ICanvas.toDataURL, ICanvas.toBlob, or ICanvas.convertToBlob to be implemented")}canvas(t){t=this._normalizeOptions(t);const e=t.target,i=this._renderer;if(e instanceof P)return i.texture.generateCanvas(e);const s=i.textureGenerator.generateTexture(t),n=i.texture.generateCanvas(s);return s.destroy(),n}pixels(t){t=this._normalizeOptions(t);const e=t.target,i=this._renderer,s=e instanceof P?e:i.textureGenerator.generateTexture(t),n=i.texture.getPixels(s);return e instanceof K&&s.destroy(),n}texture(t){return t=this._normalizeOptions(t),t.target instanceof P?t.target:this._renderer.textureGenerator.generateTexture(t)}download(t){var e;t=this._normalizeOptions(t);const i=this.canvas(t),s=document.createElement("a");s.download=(e=t.filename)!=null?e:"image.png",s.href=i.toDataURL("image/png"),document.body.appendChild(s),s.click(),document.body.removeChild(s)}log(t){var e;const i=(e=t.width)!=null?e:200;t=this._normalizeOptions(t);const s=this.canvas(t),n=s.toDataURL();console.log(`[Pixi Texture] ${s.width}px ${s.height}px`);const o=["font-size: 1px;",`padding: ${i}px 300px;`,`background: url(${n}) no-repeat;`,"background-size: contain;"].join(" ");console.log("%c ",o)}destroy(){this._renderer=null}};Fl.extension={type:[x.WebGLSystem,x.WebGPUSystem],name:"extract"},Fl.defaultImageOptions={format:"png",quality:1};let U_=Fl;class k_ extends P{static create(t){return new P({source:new et(t)})}resize(t,e,i){return this.source.resize(t,e,i),this}}var DE=Object.defineProperty,UE=Object.defineProperties,kE=Object.getOwnPropertyDescriptors,L_=Object.getOwnPropertySymbols,LE=Object.prototype.hasOwnProperty,$E=Object.prototype.propertyIsEnumerable,$_=(r,t,e)=>t in r?DE(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,NE=(r,t)=>{for(var e in t||(t={}))LE.call(t,e)&&$_(r,e,t[e]);if(L_)for(var e of L_(t))$E.call(t,e)&&$_(r,e,t[e]);return r},HE=(r,t)=>UE(r,kE(t));const XE=new W,zE=new ut,jE=[0,0,0,0];class Dl{constructor(t){this._renderer=t}generateTexture(t){var e;t instanceof K&&(t={target:t,frame:void 0,textureSourceOptions:{},resolution:void 0});const i=t.resolution||this._renderer.resolution,s=t.antialias||this._renderer.view.antialias,n=t.target;let o=t.clearColor;o?o=Array.isArray(o)&&o.length===4?o:j.shared.setValue(o).toArray():o=jE;const a=((e=t.frame)==null?void 0:e.copyTo(XE))||li(n,zE).rectangle;a.width=Math.max(a.width,1/i)|0,a.height=Math.max(a.height,1/i)|0;const l=k_.create(HE(NE({},t.textureSourceOptions),{width:a.width,height:a.height,resolution:i,antialias:s})),u=G.shared.translate(-a.x,-a.y);return this._renderer.render({container:n,transform:u,target:l,clearColor:o}),l.source.updateMipmaps(),l}destroy(){this._renderer=null}}Dl.extension={type:[x.WebGLSystem,x.WebGPUSystem],name:"textureGenerator"};class Ul{constructor(t){this._stackIndex=0,this._globalUniformDataStack=[],this._uniformsPool=[],this._activeUniforms=[],this._bindGroupPool=[],this._activeBindGroups=[],this._renderer=t}reset(){this._stackIndex=0;for(let t=0;t<this._activeUniforms.length;t++)this._uniformsPool.push(this._activeUniforms[t]);for(let t=0;t<this._activeBindGroups.length;t++)this._bindGroupPool.push(this._activeBindGroups[t]);this._activeUniforms.length=0,this._activeBindGroups.length=0}start(t){this.reset(),this.push(t)}bind({size:t,projectionMatrix:e,worldTransformMatrix:i,worldColor:s,offset:n}){const o=this._renderer.renderTarget.renderTarget,a=this._stackIndex?this._globalUniformDataStack[this._stackIndex-1]:{projectionData:o,worldTransformMatrix:new G,worldColor:4294967295,offset:new Y},l={projectionMatrix:e||this._renderer.renderTarget.projectionMatrix,resolution:t||o.size,worldTransformMatrix:i||a.worldTransformMatrix,worldColor:s||a.worldColor,offset:n||a.offset,bindGroup:null},u=this._uniformsPool.pop()||this._createUniforms();this._activeUniforms.push(u);const h=u.uniforms;h.uProjectionMatrix=l.projectionMatrix,h.uResolution=l.resolution,h.uWorldTransformMatrix.copyFrom(l.worldTransformMatrix),h.uWorldTransformMatrix.tx-=l.offset.x,h.uWorldTransformMatrix.ty-=l.offset.y,Tr(l.worldColor,h.uWorldColorAlpha,0),u.update();let c;this._renderer.renderPipes.uniformBatch?c=this._renderer.renderPipes.uniformBatch.getUniformBindGroup(u,!1):(c=this._bindGroupPool.pop()||new Ht,this._activeBindGroups.push(c),c.setResource(u,0)),l.bindGroup=c,this._currentGlobalUniformData=l}push(t){this.bind(t),this._globalUniformDataStack[this._stackIndex++]=this._currentGlobalUniformData}pop(){this._currentGlobalUniformData=this._globalUniformDataStack[--this._stackIndex-1],this._renderer.type===St.WEBGL&&this._currentGlobalUniformData.bindGroup.resources[0].update()}get bindGroup(){return this._currentGlobalUniformData.bindGroup}get uniformGroup(){return this._currentGlobalUniformData.bindGroup.resources[0]}_createUniforms(){return new nt({uProjectionMatrix:{value:new G,type:"mat3x3<f32>"},uWorldTransformMatrix:{value:new G,type:"mat3x3<f32>"},uWorldColorAlpha:{value:new Float32Array(4),type:"vec4<f32>"},uResolution:{value:[0,0],type:"vec2<f32>"}},{isStatic:!0})}destroy(){this._renderer=null}}Ul.extension={type:[x.WebGLSystem,x.WebGPUSystem,x.CanvasSystem],name:"globalUniforms"};let N_=!1;const kl="8.2.1";function H_(r){if(!N_){if(V.get().getNavigator().userAgent.toLowerCase().indexOf("chrome")>-1){const t=[`%c %c %c %c %c PixiJS %c v${kl} (${r}) http://www.pixijs.com/
1967
1967
 
1968
1968
  `,"background: #E72264; padding:5px 0;","background: #6CA2EA; padding:5px 0;","background: #B5D33D; padding:5px 0;","background: #FED23F; padding:5px 0;","color: #FFFFFF; background: #E72264; padding:5px 0;","color: #E72264; background: #FFFFFF; padding:5px 0;"];globalThis.console.log(...t)}else globalThis.console&&globalThis.console.log(`PixiJS ${kl} - ${r} - http://www.pixijs.com/`);N_=!0}}class Bs{constructor(t){this._renderer=t}init(t){if(t.hello){let e=this._renderer.name;this._renderer.type===St.WEBGL&&(e+=` ${this._renderer.context.webGLVersion}`),H_(e)}}}Bs.extension={type:[x.WebGLSystem,x.WebGPUSystem,x.CanvasSystem],name:"hello",priority:-2},Bs.defaultOptions={hello:!1};var VE=Object.defineProperty,X_=Object.getOwnPropertySymbols,WE=Object.prototype.hasOwnProperty,YE=Object.prototype.propertyIsEnumerable,z_=(r,t,e)=>t in r?VE(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,j_=(r,t)=>{for(var e in t||(t={}))WE.call(t,e)&&z_(r,e,t[e]);if(X_)for(var e of X_(t))YE.call(t,e)&&z_(r,e,t[e]);return r};const Ll=class bv{constructor(t){this._renderer=t,this.count=0,this.checkCount=0}init(t){t=j_(j_({},bv.defaultOptions),t),this.checkCountMax=t.textureGCCheckCountMax,this.maxIdle=t.textureGCAMaxIdle,this.active=t.textureGCActive}postrender(){this._renderer.renderingToScreen&&(this.count++,this.active&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))}run(){const t=this._renderer.texture.managedTextures;for(let e=0;e<t.length;e++){const i=t[e];i.autoGarbageCollect&&i.resource&&i._touched>-1&&this.count-i._touched>this.maxIdle&&(i._touched=-1,i.unload())}}destroy(){this._renderer=null}};Ll.extension={type:[x.WebGLSystem,x.WebGPUSystem],name:"textureGC"},Ll.defaultOptions={textureGCActive:!0,textureGCAMaxIdle:3600,textureGCCheckCountMax:600};let $l=Ll;U.add($l);var KE=Object.defineProperty,V_=Object.getOwnPropertySymbols,qE=Object.prototype.hasOwnProperty,ZE=Object.prototype.propertyIsEnumerable,W_=(r,t,e)=>t in r?KE(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,Y_=(r,t)=>{for(var e in t||(t={}))qE.call(t,e)&&W_(r,e,t[e]);if(V_)for(var e of V_(t))ZE.call(t,e)&&W_(r,e,t[e]);return r};const Nl=class vv{get resolution(){return this.texture.source._resolution}set resolution(t){this.texture.source.resize(this.texture.source.width,this.texture.source.height,t)}init(t){t=Y_(Y_({},vv.defaultOptions),t),t.view&&(t.canvas=t.view),this.screen=new W(0,0,t.width,t.height),this.canvas=t.canvas||V.get().createCanvas(),this.antialias=!!t.antialias,this.texture=ol(this.canvas,t),this.renderTarget=new Rs({colorTextures:[this.texture],depth:!!t.depth,isRoot:!0}),this.texture.source.transparent=t.backgroundAlpha<1,this.multiView=!!t.multiView,this.autoDensity&&(this.canvas.style.width=`${this.texture.width}px`,this.canvas.style.height=`${this.texture.height}px`),this.resolution=t.resolution}resize(t,e,i){this.texture.source.resize(t,e,i),this.screen.width=this.texture.frame.width,this.screen.height=this.texture.frame.height,this.autoDensity&&(this.canvas.style.width=`${t}px`,this.canvas.style.height=`${e}px`)}destroy(t=!1){(typeof t=="boolean"?t:t!=null&&t.removeView)&&this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)}};Nl.extension={type:[x.WebGLSystem,x.WebGPUSystem,x.CanvasSystem],name:"view",priority:0},Nl.defaultOptions={width:800,height:600,autoDensity:!1,antialias:!1};let K_=Nl;const Hl=[I_,Ul,Bs,K_,Ml,$l,Dl,U_,aa],Xl=[Gl,Ha,Cl,Sl,Xa,ja,za,xl],QE=[...Hl,nl,kg,Og,Va,bl,ll,qa,fl,pl,Ja,g_,tl,Qa],JE=[...Xl],tA=[$a,yl,vl],q_=[],Z_=[],Q_=[];U.handleByNamedList(x.WebGLSystem,q_),U.handleByNamedList(x.WebGLPipes,Z_),U.handleByNamedList(x.WebGLPipesAdaptor,Q_),U.add(...QE,...JE,...tA);class J_ extends Ir{constructor(){const t={name:"webgl",type:St.WEBGL,systems:q_,renderPipes:Z_,renderPipeAdaptors:Q_};super(t)}}var eA={__proto__:null,WebGLRenderer:J_};class zl{constructor(t){this._hash=Object.create(null),this._renderer=t}contextChange(t){this._gpu=t}getBindGroup(t,e,i){return t._updateKey(),this._hash[t._key]||this._createBindGroup(t,e,i)}_createBindGroup(t,e,i){var s;const n=this._gpu.device,o=e.layout[i],a=[],l=this._renderer;for(const c in o){const p=(s=t.resources[c])!=null?s:t.resources[o[c]];let f;if(p._resourceType==="uniformGroup"){const m=p;l.ubo.updateUniformGroup(m);const _=m.buffer;f={buffer:l.buffer.getGPUBuffer(_),offset:0,size:_.descriptor.size}}else if(p._resourceType==="buffer"){const m=p;f={buffer:l.buffer.getGPUBuffer(m),offset:0,size:m.descriptor.size}}else if(p._resourceType==="bufferResource"){const m=p;f={buffer:l.buffer.getGPUBuffer(m.buffer),offset:m.offset,size:m.size}}else if(p._resourceType==="textureSampler"){const m=p;f=l.texture.getGpuSampler(m)}else if(p._resourceType==="textureSource"){const m=p;f=l.texture.getGpuSource(m).createView({})}a.push({binding:o[c],resource:f})}const u=l.shader.getProgramData(e).bindGroups[i],h=n.createBindGroup({layout:u,entries:a});return this._hash[t._key]=h,h}destroy(){for(const t of Object.keys(this._hash))this._hash[t]=null;this._hash=null,this._renderer=null}}zl.extension={type:[x.WebGPUSystem],name:"bindGroup"};class jl{constructor(){this._gpuBuffers=Object.create(null),this._managedBuffers=[]}contextChange(t){this._gpu=t}getGPUBuffer(t){return this._gpuBuffers[t.uid]||this.createGPUBuffer(t)}updateBuffer(t){const e=this._gpuBuffers[t.uid]||this.createGPUBuffer(t),i=t.data;return t._updateID&&i&&(t._updateID=0,this._gpu.device.queue.writeBuffer(e,0,i.buffer,0,(t._updateSize||i.byteLength)+3&-4)),e}destroyAll(){for(const t in this._gpuBuffers)this._gpuBuffers[t].destroy();this._gpuBuffers={}}createGPUBuffer(t){this._gpuBuffers[t.uid]||(t.on("update",this.updateBuffer,this),t.on("change",this.onBufferChange,this),t.on("destroy",this.onBufferDestroy,this));const e=this._gpu.device.createBuffer(t.descriptor);return t._updateID=0,t.data&&(xi(t.data.buffer,e.getMappedRange()),e.unmap()),this._gpuBuffers[t.uid]=e,this._managedBuffers.push(t),e}onBufferChange(t){this._gpuBuffers[t.uid].destroy(),t._updateID=0,this._gpuBuffers[t.uid]=this.createGPUBuffer(t)}onBufferDestroy(t){this._managedBuffers.splice(this._managedBuffers.indexOf(t),1),this._destroyBuffer(t)}destroy(){this._managedBuffers.forEach(t=>this._destroyBuffer(t)),this._managedBuffers=null,this._gpuBuffers=null}_destroyBuffer(t){this._gpuBuffers[t.uid].destroy(),t.off("update",this.updateBuffer,this),t.off("change",this.onBufferChange,this),t.off("destroy",this.onBufferDestroy,this),this._gpuBuffers[t.uid]=null}}jl.extension={type:[x.WebGPUSystem],name:"buffer"};function rA(r,t){const e=r.descriptor.size,i=t.gpu.device,s=new vt({data:new Float32Array(24e5),usage:X.MAP_READ|X.COPY_DST}),n=t.buffer.createGPUBuffer(s),o=i.createCommandEncoder();o.copyBufferToBuffer(t.buffer.getGPUBuffer(r),0,n,0,e),i.queue.submit([o.finish()]),n.mapAsync(GPUMapMode.READ,0,e).then(()=>{n.getMappedRange(0,e),n.unmap()})}class tb{constructor({minUniformOffsetAlignment:t}){this._minUniformOffsetAlignment=256,this.byteIndex=0,this._minUniformOffsetAlignment=t,this.data=new Float32Array(65535)}clear(){this.byteIndex=0}addEmptyGroup(t){if(t>this._minUniformOffsetAlignment/4)throw new Error(`UniformBufferBatch: array is too large: ${t*4}`);const e=this.byteIndex;let i=e+t*4;if(i=Math.ceil(i/this._minUniformOffsetAlignment)*this._minUniformOffsetAlignment,i>this.data.length*4)throw new Error("UniformBufferBatch: ubo batch got too big");return this.byteIndex=i,e}addGroup(t){const e=this.addEmptyGroup(t.length);for(let i=0;i<t.length;i++)this.data[e/4+i]=t[i];return e}destroy(){this._buffer.destroy(),this._buffer=null,this.data=null}}class Vl{constructor(t){this._colorMaskCache=15,this._renderer=t}setMask(t){this._colorMaskCache!==t&&(this._colorMaskCache=t,this._renderer.pipeline.setColorMask(t))}destroy(){this._renderer=null,this._colorMaskCache=null}}Vl.extension={type:[x.WebGPUSystem],name:"colorMask"};class Is{constructor(t){this._renderer=t}async init(t){return this._initPromise?this._initPromise:(this._initPromise=this._createDeviceAndAdaptor(t).then(e=>{this.gpu=e,this._renderer.runners.contextChange.emit(this.gpu)}),this._initPromise)}contextChange(t){this._renderer.gpu=t}async _createDeviceAndAdaptor(t){const e=await navigator.gpu.requestAdapter({powerPreference:t.powerPreference,forceFallbackAdapter:t.forceFallbackAdapter}),i=["texture-compression-bc","texture-compression-astc","texture-compression-etc2"].filter(n=>e.features.has(n)),s=await e.requestDevice({requiredFeatures:i});return{adapter:e,device:s}}destroy(){this.gpu=null,this._renderer=null}}Is.extension={type:[x.WebGPUSystem],name:"device"},Is.defaultOptions={powerPreference:void 0,forceFallbackAdapter:!1};var iA=Object.defineProperty,eb=Object.getOwnPropertySymbols,sA=Object.prototype.hasOwnProperty,nA=Object.prototype.propertyIsEnumerable,rb=(r,t,e)=>t in r?iA(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,ib=(r,t)=>{for(var e in t||(t={}))sA.call(t,e)&&rb(r,e,t[e]);if(eb)for(var e of eb(t))nA.call(t,e)&&rb(r,e,t[e]);return r};class Wl{constructor(t){this._boundBindGroup=Object.create(null),this._boundVertexBuffer=Object.create(null),this._renderer=t}renderStart(){this.commandFinished=new Promise(t=>{this._resolveCommandFinished=t}),this.commandEncoder=this._renderer.gpu.device.createCommandEncoder()}beginRenderPass(t){this.endRenderPass(),this._clearCache(),this.renderPassEncoder=this.commandEncoder.beginRenderPass(t.descriptor)}endRenderPass(){this.renderPassEncoder&&this.renderPassEncoder.end(),this.renderPassEncoder=null}setViewport(t){this.renderPassEncoder.setViewport(t.x,t.y,t.width,t.height,0,1)}setPipelineFromGeometryProgramAndState(t,e,i,s){const n=this._renderer.pipeline.getPipeline(t,e,i,s);this.setPipeline(n)}setPipeline(t){this._boundPipeline!==t&&(this._boundPipeline=t,this.renderPassEncoder.setPipeline(t))}_setVertexBuffer(t,e){this._boundVertexBuffer[t]!==e&&(this._boundVertexBuffer[t]=e,this.renderPassEncoder.setVertexBuffer(t,this._renderer.buffer.updateBuffer(e)))}_setIndexBuffer(t){if(this._boundIndexBuffer===t)return;this._boundIndexBuffer=t;const e=t.data.BYTES_PER_ELEMENT===2?"uint16":"uint32";this.renderPassEncoder.setIndexBuffer(this._renderer.buffer.updateBuffer(t),e)}resetBindGroup(t){this._boundBindGroup[t]=null}setBindGroup(t,e,i){if(this._boundBindGroup[t]===e)return;this._boundBindGroup[t]=e,e._touch(this._renderer.textureGC.count);const s=this._renderer.bindGroup.getBindGroup(e,i,t);this.renderPassEncoder.setBindGroup(t,s)}setGeometry(t){for(const e in t.attributes){const i=t.attributes[e];this._setVertexBuffer(i.location,i.buffer)}t.indexBuffer&&this._setIndexBuffer(t.indexBuffer)}_setShaderBindGroups(t,e){for(const i in t.groups){const s=t.groups[i];e||this._syncBindGroup(s),this.setBindGroup(i,s,t.gpuProgram)}}_syncBindGroup(t){for(const e in t.resources){const i=t.resources[e];i.isUniformGroup&&this._renderer.ubo.updateUniformGroup(i)}}draw(t){const{geometry:e,shader:i,state:s,topology:n,size:o,start:a,instanceCount:l,skipSync:u}=t;this.setPipelineFromGeometryProgramAndState(e,i.gpuProgram,s,n),this.setGeometry(e),this._setShaderBindGroups(i,u),e.indexBuffer?this.renderPassEncoder.drawIndexed(o||e.indexBuffer.data.length,l||e.instanceCount,a||0):this.renderPassEncoder.draw(o||e.getSize(),l||e.instanceCount,a||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 t=this._renderer.renderTarget.adaptor.getDescriptor(this._renderer.renderTarget.renderTarget,!1,[0,0,0,1]);this.renderPassEncoder=this.commandEncoder.beginRenderPass(t);const e=this._boundPipeline,i=ib({},this._boundVertexBuffer),s=this._boundIndexBuffer,n=ib({},this._boundBindGroup);this._clearCache();const o=this._renderer.renderTarget.viewport;this.renderPassEncoder.setViewport(o.x,o.y,o.width,o.height,0,1),this.setPipeline(e);for(const a in i)this._setVertexBuffer(a,i[a]);for(const a in n)this.setBindGroup(a,n[a],null);this._setIndexBuffer(s)}_clearCache(){for(let t=0;t<16;t++)this._boundBindGroup[t]=null,this._boundVertexBuffer[t]=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(t){this._gpu=t}}Wl.extension={type:[x.WebGPUSystem],name:"encoder",priority:1};class Yl{constructor(t){this._renderTargetStencilState=Object.create(null),this._renderer=t,t.renderTarget.onRenderTargetChange.add(this)}onRenderTargetChange(t){let e=this._renderTargetStencilState[t.uid];e||(e=this._renderTargetStencilState[t.uid]={stencilMode:st.DISABLED,stencilReference:0}),this._activeRenderTarget=t,this.setStencilMode(e.stencilMode,e.stencilReference)}setStencilMode(t,e){const i=this._renderTargetStencilState[this._activeRenderTarget.uid];i.stencilMode=t,i.stencilReference=e;const s=this._renderer;s.pipeline.setStencilMode(t),s.encoder.renderPassEncoder.setStencilReference(e)}destroy(){this._renderer.renderTarget.onRenderTargetChange.remove(this),this._renderer=null,this._activeRenderTarget=null,this._renderTargetStencilState=null}}Yl.extension={type:[x.WebGPUSystem],name:"stencil"};const qr={i32:{align:4,size:4},u32:{align:4,size:4},f32:{align:4,size:4},f16:{align:2,size:2},"vec2<i32>":{align:8,size:8},"vec2<u32>":{align:8,size:8},"vec2<f32>":{align:8,size:8},"vec2<f16>":{align:4,size:4},"vec3<i32>":{align:16,size:12},"vec3<u32>":{align:16,size:12},"vec3<f32>":{align:16,size:12},"vec3<f16>":{align:8,size:6},"vec4<i32>":{align:16,size:16},"vec4<u32>":{align:16,size:16},"vec4<f32>":{align:16,size:16},"vec4<f16>":{align:8,size:8},"mat2x2<f32>":{align:8,size:16},"mat2x2<f16>":{align:4,size:8},"mat3x2<f32>":{align:8,size:24},"mat3x2<f16>":{align:4,size:12},"mat4x2<f32>":{align:8,size:32},"mat4x2<f16>":{align:4,size:16},"mat2x3<f32>":{align:16,size:32},"mat2x3<f16>":{align:8,size:16},"mat3x3<f32>":{align:16,size:48},"mat3x3<f16>":{align:8,size:24},"mat4x3<f32>":{align:16,size:64},"mat4x3<f16>":{align:8,size:32},"mat2x4<f32>":{align:16,size:32},"mat2x4<f16>":{align:8,size:16},"mat3x4<f32>":{align:16,size:48},"mat3x4<f16>":{align:8,size:24},"mat4x4<f32>":{align:16,size:64},"mat4x4<f16>":{align:8,size:32}};function sb(r){const t=r.map(i=>({data:i,offset:0,size:0}));let e=0;for(let i=0;i<t.length;i++){const s=t[i];let n=qr[s.data.type].size;const o=qr[s.data.type].align;if(!qr[s.data.type])throw new Error(`[Pixi.js] WebGPU UniformBuffer: Unknown type ${s.data.type}`);s.data.size>1&&(n=Math.max(n,o)*s.data.size),e=Math.ceil(e/o)*o,s.size=n,s.offset=e,e+=n}return e=Math.ceil(e/16)*16,{uboElements:t,size:e}}function nb(r,t){const{size:e,align:i}=qr[r.data.type],s=(i-e)/4;return`
1969
1969
  v = uv.${r.data.name};
package/dist/pixi.min.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * PixiJS - v8.2.0
3
- * Compiled Tue, 25 Jun 2024 11:06:28 UTC
2
+ * PixiJS - v8.2.1
3
+ * Compiled Tue, 25 Jun 2024 11:46:34 UTC
4
4
  *
5
5
  * PixiJS is licensed under the MIT License.
6
6
  * http://www.opensource.org/licenses/mit-license
@@ -1963,7 +1963,7 @@ fn setSaturation(c: vec3<f32>, s: f32) -> vec3<f32> {
1963
1963
  `))}class pu{constructor(t){this._cache={},this._uniformGroupSyncHash={},this._renderer=t,this.gl=null,this._cache={}}contextChange(t){this.gl=t}updateUniformGroup(t,e,s){const i=this._renderer.shader._getProgramData(e);(!t.isStatic||t._dirtyId!==i.uniformDirtyGroups[t.uid])&&(i.uniformDirtyGroups[t.uid]=t._dirtyId,this._getUniformSyncFunction(t,e)(i.uniformData,t.uniforms,this._renderer,s))}_getUniformSyncFunction(t,e){var s;return((s=this._uniformGroupSyncHash[t._signature])==null?void 0:s[e._key])||this._createUniformSyncFunction(t,e)}_createUniformSyncFunction(t,e){const s=this._uniformGroupSyncHash[t._signature]||(this._uniformGroupSyncHash[t._signature]={}),i=this._getSignature(t,e._uniformData,"u");return this._cache[i]||(this._cache[i]=this._generateUniformsSync(t,e._uniformData)),s[e._key]=this._cache[i],s[e._key]}_generateUniformsSync(t,e){return g_(t,e)}_getSignature(t,e,s){const i=t.uniforms,n=[`${s}-`];for(const o in i)n.push(o),e[o]&&n.push(e[o].type);return n.join("-")}destroy(){this._renderer=null,this._cache=null}}pu.extension={type:[v.WebGLSystem],name:"uniformGroup"};function vE(r){return r=r.replaceAll("texture2D","texture").replaceAll("gl_FragColor","finalColor").replaceAll("varying","in"),r=`
1964
1964
  out vec4 finalColor;
1965
1965
  ${r}
1966
- `,r}const yE={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,uint:1,uvec2:2,uvec3:3,uvec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function TE(r){return yE[r]}function __(r){const t={};return t.normal=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t.add=[r.ONE,r.ONE],t.multiply=[r.DST_COLOR,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA],t.screen=[r.ONE,r.ONE_MINUS_SRC_COLOR,r.ONE,r.ONE_MINUS_SRC_ALPHA],t.none=[0,0],t["normal-npm"]=[r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA],t["add-npm"]=[r.SRC_ALPHA,r.ONE,r.ONE,r.ONE],t["screen-npm"]=[r.SRC_ALPHA,r.ONE_MINUS_SRC_COLOR,r.ONE,r.ONE_MINUS_SRC_ALPHA],t.erase=[r.ZERO,r.ONE_MINUS_SRC_ALPHA],t}const SE=0,EE=1,AE=2,PE=3,wE=4,RE=5,x_=class fl{constructor(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode="none",this._blendEq=!1,this.map=[],this.map[SE]=this.setBlend,this.map[EE]=this.setOffset,this.map[AE]=this.setCullFace,this.map[PE]=this.setDepthTest,this.map[wE]=this.setFrontFace,this.map[RE]=this.setDepthMask,this.checks=[],this.defaultState=Bt.for2d()}contextChange(t){this.gl=t,this.blendModesMap=__(t),this.reset()}set(t){if(t=t||this.defaultState,this.stateId!==t.data){let e=this.stateId^t.data,s=0;for(;e;)e&1&&this.map[s].call(this,!!(t.data&1<<s)),e=e>>1,s++;this.stateId=t.data}for(let e=0;e<this.checks.length;e++)this.checks[e](this,t)}forceState(t){t=t||this.defaultState;for(let e=0;e<this.map.length;e++)this.map[e].call(this,!!(t.data&1<<e));for(let e=0;e<this.checks.length;e++)this.checks[e](this,t);this.stateId=t.data}setBlend(t){this._updateCheck(fl._checkBlendMode,t),this.gl[t?"enable":"disable"](this.gl.BLEND)}setOffset(t){this._updateCheck(fl._checkPolygonOffset,t),this.gl[t?"enable":"disable"](this.gl.POLYGON_OFFSET_FILL)}setDepthTest(t){this.gl[t?"enable":"disable"](this.gl.DEPTH_TEST)}setDepthMask(t){this.gl.depthMask(t)}setCullFace(t){this.gl[t?"enable":"disable"](this.gl.CULL_FACE)}setFrontFace(t){this.gl.frontFace(this.gl[t?"CW":"CCW"])}setBlendMode(t){if(this.blendModesMap[t]||(t="normal"),t===this.blendMode)return;this.blendMode=t;const e=this.blendModesMap[t],s=this.gl;e.length===2?s.blendFunc(e[0],e[1]):s.blendFuncSeparate(e[0],e[1],e[2],e[3]),e.length===6?(this._blendEq=!0,s.blendEquationSeparate(e[4],e[5])):this._blendEq&&(this._blendEq=!1,s.blendEquationSeparate(s.FUNC_ADD,s.FUNC_ADD))}setPolygonOffset(t,e){this.gl.polygonOffset(t,e)}reset(){this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,!1),this.forceState(this.defaultState),this._blendEq=!0,this.blendMode="",this.setBlendMode("normal")}_updateCheck(t,e){const s=this.checks.indexOf(t);e&&s===-1?this.checks.push(t):!e&&s!==-1&&this.checks.splice(s,1)}static _checkBlendMode(t,e){t.setBlendMode(e.blendMode)}static _checkPolygonOffset(t,e){t.setPolygonOffset(1,e.polygonOffset)}destroy(){this.gl=null,this.checks.length=0}};x_.extension={type:[v.WebGLSystem],name:"state"};let b_=x_;class v_{constructor(t){this.target=Ya.TEXTURE_2D,this.texture=t,this.width=-1,this.height=-1,this.type=X.UNSIGNED_BYTE,this.internalFormat=wi.RGBA,this.format=wi.RGBA,this.samplerType=0}}const y_={id:"buffer",upload(r,t,e){t.width===r.width||t.height===r.height?e.texSubImage2D(e.TEXTURE_2D,0,0,0,r.width,r.height,t.format,t.type,r.resource):e.texImage2D(t.target,0,t.internalFormat,r.width,r.height,0,t.format,t.type,r.resource),t.width=r.width,t.height=r.height}},ME={"bc1-rgba-unorm":!0,"bc1-rgba-unorm-srgb":!0,"bc2-rgba-unorm":!0,"bc2-rgba-unorm-srgb":!0,"bc3-rgba-unorm":!0,"bc3-rgba-unorm-srgb":!0,"bc4-r-unorm":!0,"bc4-r-snorm":!0,"bc5-rg-unorm":!0,"bc5-rg-snorm":!0,"bc6h-rgb-ufloat":!0,"bc6h-rgb-float":!0,"bc7-rgba-unorm":!0,"bc7-rgba-unorm-srgb":!0,"etc2-rgb8unorm":!0,"etc2-rgb8unorm-srgb":!0,"etc2-rgb8a1unorm":!0,"etc2-rgb8a1unorm-srgb":!0,"etc2-rgba8unorm":!0,"etc2-rgba8unorm-srgb":!0,"eac-r11unorm":!0,"eac-r11snorm":!0,"eac-rg11unorm":!0,"eac-rg11snorm":!0,"astc-4x4-unorm":!0,"astc-4x4-unorm-srgb":!0,"astc-5x4-unorm":!0,"astc-5x4-unorm-srgb":!0,"astc-5x5-unorm":!0,"astc-5x5-unorm-srgb":!0,"astc-6x5-unorm":!0,"astc-6x5-unorm-srgb":!0,"astc-6x6-unorm":!0,"astc-6x6-unorm-srgb":!0,"astc-8x5-unorm":!0,"astc-8x5-unorm-srgb":!0,"astc-8x6-unorm":!0,"astc-8x6-unorm-srgb":!0,"astc-8x8-unorm":!0,"astc-8x8-unorm-srgb":!0,"astc-10x5-unorm":!0,"astc-10x5-unorm-srgb":!0,"astc-10x6-unorm":!0,"astc-10x6-unorm-srgb":!0,"astc-10x8-unorm":!0,"astc-10x8-unorm-srgb":!0,"astc-10x10-unorm":!0,"astc-10x10-unorm-srgb":!0,"astc-12x10-unorm":!0,"astc-12x10-unorm-srgb":!0,"astc-12x12-unorm":!0,"astc-12x12-unorm-srgb":!0},T_={id:"compressed",upload(r,t,e){e.pixelStorei(e.UNPACK_ALIGNMENT,4);let s=r.pixelWidth,i=r.pixelHeight;const n=!!ME[r.format];for(let o=0;o<r.resource.length;o++){const a=r.resource[o];n?e.compressedTexImage2D(e.TEXTURE_2D,o,t.internalFormat,s,i,0,a):e.texImage2D(e.TEXTURE_2D,o,t.internalFormat,s,i,0,t.format,t.type,a),s=Math.max(s>>1,1),i=Math.max(i>>1,1)}}},fu={id:"image",upload(r,t,e,s){const i=r.alphaMode==="premultiply-alpha-on-upload";e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i);const n=t.width,o=t.height,a=r.pixelWidth,u=r.pixelHeight,l=r.resourceWidth,h=r.resourceHeight;l<a||h<u?((n!==a||o!==u)&&e.texImage2D(t.target,0,t.internalFormat,a,u,0,t.format,t.type,null),s===2?e.texSubImage2D(e.TEXTURE_2D,0,0,0,l,h,t.format,t.type,r.resource):e.texSubImage2D(e.TEXTURE_2D,0,0,0,t.format,t.type,r.resource)):n===a||o===u?e.texSubImage2D(e.TEXTURE_2D,0,0,0,t.format,t.type,r.resource):s===2?e.texImage2D(t.target,0,t.internalFormat,a,u,0,t.format,t.type,r.resource):e.texImage2D(t.target,0,t.internalFormat,t.format,t.type,r.resource),t.width=a,t.height=u}},S_={id:"video",upload(r,t,e,s){if(!r.isValid){e.texImage2D(t.target,0,t.internalFormat,1,1,0,t.format,t.type,null);return}fu.upload(r,t,e,s)}},mu={linear:9729,nearest:9728},E_={linear:{linear:9987,nearest:9985},nearest:{linear:9986,nearest:9984}},Gi={"clamp-to-edge":33071,repeat:10497,"mirror-repeat":33648},A_={never:512,less:513,equal:514,"less-equal":515,greater:516,"not-equal":517,"greater-equal":518,always:519};function gu(r,t,e,s,i,n,o,a){const u=n;if(!a||r.addressModeU!=="repeat"||r.addressModeV!=="repeat"||r.addressModeW!=="repeat"){const l=Gi[o?"clamp-to-edge":r.addressModeU],h=Gi[o?"clamp-to-edge":r.addressModeV],c=Gi[o?"clamp-to-edge":r.addressModeW];t[i](u,t.TEXTURE_WRAP_S,l),t[i](u,t.TEXTURE_WRAP_T,h),t.TEXTURE_WRAP_R&&t[i](u,t.TEXTURE_WRAP_R,c)}if((!a||r.magFilter!=="linear")&&t[i](u,t.TEXTURE_MAG_FILTER,mu[r.magFilter]),e){if(!a||r.mipmapFilter!=="linear"){const l=E_[r.minFilter][r.mipmapFilter];t[i](u,t.TEXTURE_MIN_FILTER,l)}}else t[i](u,t.TEXTURE_MIN_FILTER,mu[r.minFilter]);if(s&&r.maxAnisotropy>1){const l=Math.min(r.maxAnisotropy,t.getParameter(s.MAX_TEXTURE_MAX_ANISOTROPY_EXT));t[i](u,s.TEXTURE_MAX_ANISOTROPY_EXT,l)}r.compare&&t[i](u,t.TEXTURE_COMPARE_FUNC,A_[r.compare])}function P_(r){return{r8unorm:r.RED,r8snorm:r.RED,r8uint:r.RED,r8sint:r.RED,r16uint:r.RED,r16sint:r.RED,r16float:r.RED,rg8unorm:r.RG,rg8snorm:r.RG,rg8uint:r.RG,rg8sint:r.RG,r32uint:r.RED,r32sint:r.RED,r32float:r.RED,rg16uint:r.RG,rg16sint:r.RG,rg16float:r.RG,rgba8unorm:r.RGBA,"rgba8unorm-srgb":r.RGBA,rgba8snorm:r.RGBA,rgba8uint:r.RGBA,rgba8sint:r.RGBA,bgra8unorm:r.RGBA,"bgra8unorm-srgb":r.RGBA,rgb9e5ufloat:r.RGB,rgb10a2unorm:r.RGBA,rg11b10ufloat:r.RGB,rg32uint:r.RG,rg32sint:r.RG,rg32float:r.RG,rgba16uint:r.RGBA,rgba16sint:r.RGBA,rgba16float:r.RGBA,rgba32uint:r.RGBA,rgba32sint:r.RGBA,rgba32float:r.RGBA,stencil8:r.STENCIL_INDEX8,depth16unorm:r.DEPTH_COMPONENT,depth24plus:r.DEPTH_COMPONENT,"depth24plus-stencil8":r.DEPTH_STENCIL,depth32float:r.DEPTH_COMPONENT,"depth32float-stencil8":r.DEPTH_STENCIL}}var OE=Object.defineProperty,CE=Object.defineProperties,GE=Object.getOwnPropertyDescriptors,w_=Object.getOwnPropertySymbols,IE=Object.prototype.hasOwnProperty,BE=Object.prototype.propertyIsEnumerable,R_=(r,t,e)=>t in r?OE(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,Ae=(r,t)=>{for(var e in t||(t={}))IE.call(t,e)&&R_(r,e,t[e]);if(w_)for(var e of w_(t))BE.call(t,e)&&R_(r,e,t[e]);return r},FE=(r,t)=>CE(r,GE(t));function M_(r,t){let e={},s=r.RGBA;return r instanceof j.get().getWebGLRenderingContext()?t.srgb&&(e={"rgba8unorm-srgb":t.srgb.SRGB8_ALPHA8_EXT,"bgra8unorm-srgb":t.srgb.SRGB8_ALPHA8_EXT}):(e={"rgba8unorm-srgb":r.SRGB8_ALPHA8,"bgra8unorm-srgb":r.SRGB8_ALPHA8},s=r.RGBA8),Ae(Ae(Ae(Ae(Ae(Ae(FE(Ae({r8unorm:r.R8,r8snorm:r.R8_SNORM,r8uint:r.R8UI,r8sint:r.R8I,r16uint:r.R16UI,r16sint:r.R16I,r16float:r.R16F,rg8unorm:r.RG8,rg8snorm:r.RG8_SNORM,rg8uint:r.RG8UI,rg8sint:r.RG8I,r32uint:r.R32UI,r32sint:r.R32I,r32float:r.R32F,rg16uint:r.RG16UI,rg16sint:r.RG16I,rg16float:r.RG16F,rgba8unorm:r.RGBA},e),{rgba8snorm:r.RGBA8_SNORM,rgba8uint:r.RGBA8UI,rgba8sint:r.RGBA8I,bgra8unorm:s,rgb9e5ufloat:r.RGB9_E5,rgb10a2unorm:r.RGB10_A2,rg11b10ufloat:r.R11F_G11F_B10F,rg32uint:r.RG32UI,rg32sint:r.RG32I,rg32float:r.RG32F,rgba16uint:r.RGBA16UI,rgba16sint:r.RGBA16I,rgba16float:r.RGBA16F,rgba32uint:r.RGBA32UI,rgba32sint:r.RGBA32I,rgba32float:r.RGBA32F,stencil8:r.STENCIL_INDEX8,depth16unorm:r.DEPTH_COMPONENT16,depth24plus:r.DEPTH_COMPONENT24,"depth24plus-stencil8":r.DEPTH24_STENCIL8,depth32float:r.DEPTH_COMPONENT32F,"depth32float-stencil8":r.DEPTH32F_STENCIL8}),t.s3tc?{"bc1-rgba-unorm":t.s3tc.COMPRESSED_RGBA_S3TC_DXT1_EXT,"bc2-rgba-unorm":t.s3tc.COMPRESSED_RGBA_S3TC_DXT3_EXT,"bc3-rgba-unorm":t.s3tc.COMPRESSED_RGBA_S3TC_DXT5_EXT}:{}),t.s3tc_sRGB?{"bc1-rgba-unorm-srgb":t.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,"bc2-rgba-unorm-srgb":t.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,"bc3-rgba-unorm-srgb":t.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}:{}),t.rgtc?{"bc4-r-unorm":t.rgtc.COMPRESSED_RED_RGTC1_EXT,"bc4-r-snorm":t.rgtc.COMPRESSED_SIGNED_RED_RGTC1_EXT,"bc5-rg-unorm":t.rgtc.COMPRESSED_RED_GREEN_RGTC2_EXT,"bc5-rg-snorm":t.rgtc.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}:{}),t.bptc?{"bc6h-rgb-float":t.bptc.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,"bc6h-rgb-ufloat":t.bptc.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,"bc7-rgba-unorm":t.bptc.COMPRESSED_RGBA_BPTC_UNORM_EXT,"bc7-rgba-unorm-srgb":t.bptc.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT}:{}),t.etc?{"etc2-rgb8unorm":t.etc.COMPRESSED_RGB8_ETC2,"etc2-rgb8unorm-srgb":t.etc.COMPRESSED_SRGB8_ETC2,"etc2-rgb8a1unorm":t.etc.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,"etc2-rgb8a1unorm-srgb":t.etc.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,"etc2-rgba8unorm":t.etc.COMPRESSED_RGBA8_ETC2_EAC,"etc2-rgba8unorm-srgb":t.etc.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,"eac-r11unorm":t.etc.COMPRESSED_R11_EAC,"eac-rg11unorm":t.etc.COMPRESSED_SIGNED_RG11_EAC}:{}),t.astc?{"astc-4x4-unorm":t.astc.COMPRESSED_RGBA_ASTC_4x4_KHR,"astc-4x4-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,"astc-5x4-unorm":t.astc.COMPRESSED_RGBA_ASTC_5x4_KHR,"astc-5x4-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR,"astc-5x5-unorm":t.astc.COMPRESSED_RGBA_ASTC_5x5_KHR,"astc-5x5-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,"astc-6x5-unorm":t.astc.COMPRESSED_RGBA_ASTC_6x5_KHR,"astc-6x5-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,"astc-6x6-unorm":t.astc.COMPRESSED_RGBA_ASTC_6x6_KHR,"astc-6x6-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,"astc-8x5-unorm":t.astc.COMPRESSED_RGBA_ASTC_8x5_KHR,"astc-8x5-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,"astc-8x6-unorm":t.astc.COMPRESSED_RGBA_ASTC_8x6_KHR,"astc-8x6-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,"astc-8x8-unorm":t.astc.COMPRESSED_RGBA_ASTC_8x8_KHR,"astc-8x8-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,"astc-10x5-unorm":t.astc.COMPRESSED_RGBA_ASTC_10x5_KHR,"astc-10x5-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,"astc-10x6-unorm":t.astc.COMPRESSED_RGBA_ASTC_10x6_KHR,"astc-10x6-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,"astc-10x8-unorm":t.astc.COMPRESSED_RGBA_ASTC_10x8_KHR,"astc-10x8-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,"astc-10x10-unorm":t.astc.COMPRESSED_RGBA_ASTC_10x10_KHR,"astc-10x10-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,"astc-12x10-unorm":t.astc.COMPRESSED_RGBA_ASTC_12x10_KHR,"astc-12x10-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,"astc-12x12-unorm":t.astc.COMPRESSED_RGBA_ASTC_12x12_KHR,"astc-12x12-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR}:{})}function O_(r){return{r8unorm:r.UNSIGNED_BYTE,r8snorm:r.BYTE,r8uint:r.UNSIGNED_BYTE,r8sint:r.BYTE,r16uint:r.UNSIGNED_SHORT,r16sint:r.SHORT,r16float:r.HALF_FLOAT,rg8unorm:r.UNSIGNED_BYTE,rg8snorm:r.BYTE,rg8uint:r.UNSIGNED_BYTE,rg8sint:r.BYTE,r32uint:r.UNSIGNED_INT,r32sint:r.INT,r32float:r.FLOAT,rg16uint:r.UNSIGNED_SHORT,rg16sint:r.SHORT,rg16float:r.HALF_FLOAT,rgba8unorm:r.UNSIGNED_BYTE,"rgba8unorm-srgb":r.UNSIGNED_BYTE,rgba8snorm:r.BYTE,rgba8uint:r.UNSIGNED_BYTE,rgba8sint:r.BYTE,bgra8unorm:r.UNSIGNED_BYTE,"bgra8unorm-srgb":r.UNSIGNED_BYTE,rgb9e5ufloat:r.UNSIGNED_INT_5_9_9_9_REV,rgb10a2unorm:r.UNSIGNED_INT_2_10_10_10_REV,rg11b10ufloat:r.UNSIGNED_INT_10F_11F_11F_REV,rg32uint:r.UNSIGNED_INT,rg32sint:r.INT,rg32float:r.FLOAT,rgba16uint:r.UNSIGNED_SHORT,rgba16sint:r.SHORT,rgba16float:r.HALF_FLOAT,rgba32uint:r.UNSIGNED_INT,rgba32sint:r.INT,rgba32float:r.FLOAT,stencil8:r.UNSIGNED_BYTE,depth16unorm:r.UNSIGNED_SHORT,depth24plus:r.UNSIGNED_INT,"depth24plus-stencil8":r.UNSIGNED_INT_24_8,depth32float:r.FLOAT,"depth32float-stencil8":r.FLOAT_32_UNSIGNED_INT_24_8_REV}}function DE(r){r instanceof Uint8ClampedArray&&(r=new Uint8Array(r.buffer));const t=r.length;for(let e=0;e<t;e+=4){const s=r[e+3];if(s!==0){const i=255.001/s;r[e]=r[e]*i+.5,r[e+1]=r[e+1]*i+.5,r[e+2]=r[e+2]*i+.5}}}const UE=4;class _u{constructor(t){this.managedTextures=[],this._glTextures=Object.create(null),this._glSamplers=Object.create(null),this._boundTextures=[],this._activeTextureLocation=-1,this._boundSamplers=Object.create(null),this._uploads={image:fu,buffer:y_,video:S_,compressed:T_},this._useSeparateSamplers=!1,this._renderer=t}contextChange(t){this._gl=t,this._mapFormatToInternalFormat||(this._mapFormatToInternalFormat=M_(t,this._renderer.context.extensions),this._mapFormatToType=O_(t),this._mapFormatToFormat=P_(t)),this._glTextures=Object.create(null),this._glSamplers=Object.create(null),this._boundSamplers=Object.create(null);for(let e=0;e<16;e++)this.bind(A.EMPTY,e)}initSource(t){this.bind(t)}bind(t,e=0){const s=t.source;t?(this.bindSource(s,e),this._useSeparateSamplers&&this._bindSampler(s.style,e)):(this.bindSource(null,e),this._useSeparateSamplers&&this._bindSampler(null,e))}bindSource(t,e=0){const s=this._gl;if(t._touched=this._renderer.textureGC.count,this._boundTextures[e]!==t){this._boundTextures[e]=t,this._activateLocation(e),t=t||A.EMPTY.source;const i=this.getGlSource(t);s.bindTexture(i.target,i.texture)}}_bindSampler(t,e=0){const s=this._gl;if(!t){this._boundSamplers[e]=null,s.bindSampler(e,null);return}const i=this._getGlSampler(t);this._boundSamplers[e]!==i&&(this._boundSamplers[e]=i,s.bindSampler(e,i))}unbind(t){const e=t.source,s=this._boundTextures,i=this._gl;for(let n=0;n<s.length;n++)if(s[n]===e){this._activateLocation(n);const o=this.getGlSource(e);i.bindTexture(o.target,null),s[n]=null}}_activateLocation(t){this._activeTextureLocation!==t&&(this._activeTextureLocation=t,this._gl.activeTexture(this._gl.TEXTURE0+t))}_initSource(t){const e=this._gl,s=new v_(e.createTexture());if(s.type=this._mapFormatToType[t.format],s.internalFormat=this._mapFormatToInternalFormat[t.format],s.format=this._mapFormatToFormat[t.format],t.autoGenerateMipmaps&&(this._renderer.context.supports.nonPowOf2mipmaps||t.isPowerOfTwo)){const i=Math.max(t.width,t.height);t.mipLevelCount=Math.floor(Math.log2(i))+1}return this._glTextures[t.uid]=s,this.managedTextures.includes(t)||(t.on("update",this.onSourceUpdate,this),t.on("resize",this.onSourceUpdate,this),t.on("styleChange",this.onStyleChange,this),t.on("destroy",this.onSourceDestroy,this),t.on("unload",this.onSourceUnload,this),t.on("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.push(t)),this.onSourceUpdate(t),this.updateStyle(t,!1),s}onStyleChange(t){this.updateStyle(t,!1)}updateStyle(t,e){const s=this._gl,i=this.getGlSource(t);s.bindTexture(s.TEXTURE_2D,i.texture),this._boundTextures[this._activeTextureLocation]=t,gu(t.style,s,t.mipLevelCount>1,this._renderer.context.extensions.anisotropicFiltering,"texParameteri",s.TEXTURE_2D,!this._renderer.context.supports.nonPowOf2wrapping&&!t.isPowerOfTwo,e)}onSourceUnload(t){const e=this._glTextures[t.uid];e&&(this.unbind(t),this._glTextures[t.uid]=null,this._gl.deleteTexture(e.texture))}onSourceUpdate(t){const e=this._gl,s=this.getGlSource(t);e.bindTexture(e.TEXTURE_2D,s.texture),this._boundTextures[this._activeTextureLocation]=t,this._uploads[t.uploadMethodId]?this._uploads[t.uploadMethodId].upload(t,s,e,this._renderer.context.webGLVersion):e.texImage2D(e.TEXTURE_2D,0,e.RGBA,t.pixelWidth,t.pixelHeight,0,e.RGBA,e.UNSIGNED_BYTE,null),t.autoGenerateMipmaps&&t.mipLevelCount>1&&this.onUpdateMipmaps(t,!1)}onUpdateMipmaps(t,e=!0){e&&this.bindSource(t,0);const s=this.getGlSource(t);this._gl.generateMipmap(s.target)}onSourceDestroy(t){t.off("destroy",this.onSourceDestroy,this),t.off("update",this.onSourceUpdate,this),t.off("resize",this.onSourceUpdate,this),t.off("unload",this.onSourceUnload,this),t.off("styleChange",this.onStyleChange,this),t.off("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.splice(this.managedTextures.indexOf(t),1),this.onSourceUnload(t)}_initSampler(t){const e=this._gl,s=this._gl.createSampler();return this._glSamplers[t._resourceId]=s,gu(t,e,this._boundTextures[this._activeTextureLocation].mipLevelCount>1,this._renderer.context.extensions.anisotropicFiltering,"samplerParameteri",s,!1,!0),this._glSamplers[t._resourceId]}_getGlSampler(t){return this._glSamplers[t._resourceId]||this._initSampler(t)}getGlSource(t){return this._glTextures[t.uid]||this._initSource(t)}generateCanvas(t){const{pixels:e,width:s,height:i}=this.getPixels(t),n=j.get().createCanvas();n.width=s,n.height=i;const o=n.getContext("2d");if(o){const a=o.createImageData(s,i);a.data.set(e),o.putImageData(a,0,0)}return n}getPixels(t){const e=t.source.resolution,s=t.frame,i=Math.max(Math.round(s.width*e),1),n=Math.max(Math.round(s.height*e),1),o=new Uint8Array(UE*i*n),a=this._renderer,u=a.renderTarget.getRenderTarget(t),l=a.renderTarget.getGpuRenderTarget(u),h=a.gl;return h.bindFramebuffer(h.FRAMEBUFFER,l.resolveTargetFramebuffer),h.readPixels(Math.round(s.x*e),Math.round(s.y*e),i,n,h.RGBA,h.UNSIGNED_BYTE,o),{pixels:new Uint8ClampedArray(o.buffer),width:i,height:n}}destroy(){this.managedTextures.slice().forEach(t=>this.onSourceDestroy(t)),this.managedTextures=null,this._renderer=null}}_u.extension={type:[v.WebGLSystem],name:"texture"};class xu{init(){const t=new it({uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uTransformMatrix:{value:new C,type:"mat3x3<f32>"},uRound:{value:0,type:"f32"}}),e=It(),s=$e({name:"graphics",bits:[js,Ws(e),Qs,Ne]});this.shader=new Pt({glProgram:s,resources:{localUniforms:t,batchSamplers:Ys(e)}})}execute(t,e){const s=e.context,i=s.customShader||this.shader,n=t.renderer,o=n.graphicsContext,{geometry:a,instructions:u}=o.getContextRenderData(s);i.groups[0]=n.globalUniforms.bindGroup,n.state.set(t.state),n.shader.bind(i),n.geometry.bind(a,i.glProgram);const l=u.instructions;for(let h=0;h<u.instructionSize;h++){const c=l[h];if(c.size){for(let d=0;d<c.textures.textures.length;d++)n.texture.bind(c.textures.textures[d],d);n.geometry.draw("triangle-list",c.size,c.start)}}}destroy(){this.shader.destroy(!0),this.shader=null}}xu.extension={type:[v.WebGLPipesAdaptor],name:"graphics"};class bu{init(){const t=$e({name:"mesh",bits:[Qs,wg,Ne]});this._shader=new Pt({glProgram:t,resources:{uTexture:A.EMPTY.source,textureUniforms:{uTextureMatrix:{type:"mat3x3<f32>",value:new C}}}})}execute(t,e){const s=t.renderer;let i=e._shader;if(i){if(!i.glProgram)return}else{i=this._shader;const n=e.texture,o=n.source;i.resources.uTexture=o,i.resources.uSampler=o.style,i.resources.textureUniforms.uniforms.uTextureMatrix=n.textureMatrix.mapCoord}i.groups[100]=s.globalUniforms.bindGroup,i.groups[101]=t.localUniformsBindGroup,s.encoder.draw({geometry:e._geometry,shader:i,state:e.state})}destroy(){this._shader.destroy(!0),this._shader=null}}bu.extension={type:[v.WebGLPipesAdaptor],name:"mesh"};class vu{constructor(t){this._renderer=t}addRenderable(t,e){this._renderer.renderPipes.batch.break(e),e.add(t)}execute(t){t.isRenderable&&t.render(this._renderer)}destroy(){this._renderer=null}}vu.extension={type:[v.WebGLPipes,v.WebGPUPipes,v.CanvasPipes],name:"customRender"};function yu(r,t){const e=r.instructionSet,s=e.instructions;for(let i=0;i<e.instructionSize;i++){const n=s[i];t[n.renderPipeId].execute(n)}}class Tu{constructor(t){this._renderer=t}addRenderGroup(t,e){this._renderer.renderPipes.batch.break(e),e.add(t)}execute(t){t.isRenderable&&(this._renderer.globalUniforms.push({worldTransformMatrix:t.worldTransform,worldColor:t.worldColorAlpha}),yu(t,this._renderer.renderPipes),this._renderer.globalUniforms.pop())}destroy(){this._renderer=null}}Tu.extension={type:[v.WebGLPipes,v.WebGPUPipes,v.CanvasPipes],name:"renderGroup"};function Su(r,t=[]){t.push(r);for(let e=0;e<r.renderGroupChildren.length;e++)Su(r.renderGroupChildren[e],t);return t}function Eu(r,t,e){const s=r>>16&255,i=r>>8&255,n=r&255,o=t>>16&255,a=t>>8&255,u=t&255,l=s+(o-s)*e,h=i+(a-i)*e,c=n+(u-n)*e;return(l<<16)+(h<<8)+c}const qe=16777215;function Au(r,t){return r===qe||t===qe?r+t-qe:Eu(r,t,.5)}function kE(r,t,e){const s=(e>>24&255)/255,i=t*s*255,n=((r&255)<<16)+(r&65280)+(r>>16&255),o=e&16777215;let a;return n===qe||o===qe?a=n+o-qe:a=Eu(n,o,.5),a+(i<<24)}const $E=new Y;function Pu(r,t=!1){C_(r);const e=r.childrenToUpdate,s=r.updateTick++;for(const i in e){const n=Number(i),o=e[i],a=o.list,u=o.index;for(let l=0;l<u;l++){const h=a[l];h.parentRenderGroup===r&&h.relativeRenderGroupDepth===n&&wu(h,s,0)}o.index=0}if(t)for(let i=0;i<r.renderGroupChildren.length;i++)Pu(r.renderGroupChildren[i],t)}function C_(r){const t=r.root;let e;if(r.renderGroupParent){const s=r.renderGroupParent;r.worldTransform.appendFrom(t.relativeGroupTransform,s.worldTransform),r.worldColor=Au(t.groupColor,s.worldColor),e=t.groupAlpha*s.worldAlpha}else r.worldTransform.copyFrom(t.localTransform),r.worldColor=t.localColor,e=t.localAlpha;e=e<0?0:e>1?1:e,r.worldAlpha=e,r.worldColorAlpha=r.worldColor+((e*255|0)<<24)}function wu(r,t,e){if(t===r.updateTick)return;r.updateTick=t,r.didChange=!1;const s=r.localTransform;r.updateLocalTransform();const i=r.parent;if(i&&!i.renderGroup?(e=e|r._updateFlags,r.relativeGroupTransform.appendFrom(s,i.relativeGroupTransform),e&&G_(r,i,e)):(e=r._updateFlags,r.relativeGroupTransform.copyFrom(s),e&&G_(r,$E,e)),!r.renderGroup){const n=r.children,o=n.length;for(let u=0;u<o;u++)wu(n[u],t,e);const a=r.parentRenderGroup;r.renderPipeId&&!a.structureDidChange&&a.updateRenderable(r)}}function G_(r,t,e){if(e&ds){r.groupColor=Au(r.localColor,t.groupColor);let s=r.localAlpha*t.groupAlpha;s=s<0?0:s>1?1:s,r.groupAlpha=s,r.groupColorAlpha=r.groupColor+((s*255|0)<<24)}e&an&&(r.groupBlendMode=r.localBlendMode==="inherit"?t.groupBlendMode:r.localBlendMode),e&cr&&(r.globalDisplayStatus=r.localDisplayStatus&t.globalDisplayStatus),r._updateFlags=0}function I_(r,t){const{list:e,index:s}=r.childrenRenderablesToUpdate;let i=!1;for(let n=0;n<s;n++){const o=e[n];if(i=t[o.renderPipeId].validateRenderable(o),i)break}return r.structureDidChange=i,i}const LE=new C;class Ru{constructor(t){this._renderer=t}render({container:t,transform:e}){t.isRenderGroup=!0;const s=t.parent,i=t.renderGroup.renderGroupParent;t.parent=null,t.renderGroup.renderGroupParent=null;const n=this._renderer,o=Su(t.renderGroup,[]);let a=LE;e&&(a=a.copyFrom(t.renderGroup.localTransform),t.renderGroup.localTransform.copyFrom(e));const u=n.renderPipes;for(let l=0;l<o.length;l++){const h=o[l];h.runOnRender(),h.instructionSet.renderPipes=u,h.structureDidChange||I_(h,u),Pu(h),h.structureDidChange?(h.structureDidChange=!1,Rg(h,u)):NE(h),h.childrenRenderablesToUpdate.index=0,n.renderPipes.batch.upload(h.instructionSet)}n.globalUniforms.start({worldTransformMatrix:e?t.renderGroup.localTransform:t.renderGroup.worldTransform,worldColor:t.renderGroup.worldColorAlpha}),yu(t.renderGroup,u),u.uniformBatch&&u.uniformBatch.renderEnd(),e&&t.renderGroup.localTransform.copyFrom(a),t.parent=s,t.renderGroup.renderGroupParent=i}destroy(){this._renderer=null}}Ru.extension={type:[v.WebGLSystem,v.WebGPUSystem,v.CanvasSystem],name:"renderGroup"};function NE(r){const{list:t,index:e}=r.childrenRenderablesToUpdate;for(let s=0;s<e;s++){const i=t[s];i.didViewUpdate&&r.updateRenderable(i)}}class Mu{constructor(t){this._gpuSpriteHash=Object.create(null),this._renderer=t}addRenderable(t,e){const s=this._getGpuSprite(t);t._didSpriteUpdate&&this._updateBatchableSprite(t,s),this._renderer.renderPipes.batch.addToBatch(s)}updateRenderable(t){const e=this._gpuSpriteHash[t.uid];t._didSpriteUpdate&&this._updateBatchableSprite(t,e),e.batcher.updateElement(e)}validateRenderable(t){const e=t._texture,s=this._getGpuSprite(t);return s.texture._source!==e._source?!s.batcher.checkAndUpdateTexture(s,e):!1}destroyRenderable(t){const e=this._gpuSpriteHash[t.uid];N.return(e),this._gpuSpriteHash[t.uid]=null}_updateBatchableSprite(t,e){t._didSpriteUpdate=!1,e.bounds=t.bounds,e.texture=t._texture}_getGpuSprite(t){return this._gpuSpriteHash[t.uid]||this._initGPUSprite(t)}_initGPUSprite(t){const e=N.get(Ds);return e.renderable=t,e.texture=t._texture,e.bounds=t.bounds,e.roundPixels=this._renderer._roundPixels|t._roundPixels,this._gpuSpriteHash[t.uid]=e,t._didSpriteUpdate=!1,t.on("destroyed",()=>{this.destroyRenderable(t)}),e}destroy(){for(const t in this._gpuSpriteHash)N.return(this._gpuSpriteHash[t]);this._gpuSpriteHash=null,this._renderer=null}}Mu.extension={type:[v.WebGLPipes,v.WebGPUPipes,v.CanvasPipes],name:"sprite"};var HE=Object.defineProperty,B_=Object.getOwnPropertySymbols,XE=Object.prototype.hasOwnProperty,zE=Object.prototype.propertyIsEnumerable,F_=(r,t,e)=>t in r?HE(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,D_=(r,t)=>{for(var e in t||(t={}))XE.call(t,e)&&F_(r,e,t[e]);if(B_)for(var e of B_(t))zE.call(t,e)&&F_(r,e,t[e]);return r};const Ou=class mb{constructor(){this.clearBeforeRender=!0,this._backgroundColor=new z(0),this.color=this._backgroundColor,this.alpha=1}init(t){t=D_(D_({},mb.defaultOptions),t),this.clearBeforeRender=t.clearBeforeRender,this.color=t.background||t.backgroundColor||this._backgroundColor,this.alpha=t.backgroundAlpha,this._backgroundColor.setAlpha(t.backgroundAlpha)}get color(){return this._backgroundColor}set color(t){this._backgroundColor.setValue(t)}get alpha(){return this._backgroundColor.alpha}set alpha(t){this._backgroundColor.setAlpha(t)}get colorRgba(){return this._backgroundColor.toArray()}destroy(){}};Ou.extension={type:[v.WebGLSystem,v.WebGPUSystem,v.CanvasSystem],name:"background",priority:0},Ou.defaultOptions={backgroundAlpha:1,backgroundColor:0,clearBeforeRender:!0};let U_=Ou;const Zr={};D.handle(v.BlendMode,r=>{if(!r.name)throw new Error("BlendMode extension must have a name property");Zr[r.name]=r.ref},r=>{delete Zr[r.name]});class Cu{constructor(t){this._isAdvanced=!1,this._filterHash=Object.create(null),this._renderer=t}setBlendMode(t,e,s){if(this._activeBlendMode===e){this._isAdvanced&&this._renderableList.push(t);return}this._activeBlendMode=e,this._isAdvanced&&this._endAdvancedBlendMode(s),this._isAdvanced=!!Zr[e],this._isAdvanced&&(this._beginAdvancedBlendMode(s),this._renderableList.push(t))}_beginAdvancedBlendMode(t){this._renderer.renderPipes.batch.break(t);const e=this._activeBlendMode;if(!Zr[e])return;let s=this._filterHash[e];s||(s=this._filterHash[e]=new ur,s.filters=[new Zr[e]]);const i={renderPipeId:"filter",action:"pushFilter",renderables:[],filterEffect:s,canBundle:!1};this._renderableList=i.renderables,t.add(i)}_endAdvancedBlendMode(t){this._renderableList=null,this._renderer.renderPipes.batch.break(t),t.add({renderPipeId:"filter",action:"popFilter",canBundle:!1})}buildStart(){this._isAdvanced=!1}buildEnd(t){this._isAdvanced&&this._endAdvancedBlendMode(t)}destroy(){this._renderer=null,this._renderableList=null;for(const t in this._filterHash)this._filterHash[t].destroy();this._filterHash=null}}Cu.extension={type:[v.WebGLPipes,v.WebGPUPipes,v.CanvasPipes],name:"blendMode"};var jE=Object.defineProperty,k_=Object.getOwnPropertySymbols,VE=Object.prototype.hasOwnProperty,WE=Object.prototype.propertyIsEnumerable,$_=(r,t,e)=>t in r?jE(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,Gu=(r,t)=>{for(var e in t||(t={}))VE.call(t,e)&&$_(r,e,t[e]);if(k_)for(var e of k_(t))WE.call(t,e)&&$_(r,e,t[e]);return r};const Iu={png:"image/png",jpg:"image/jpeg",webp:"image/webp"},Bu=class gb{constructor(t){this._renderer=t}_normalizeOptions(t,e={}){return t instanceof Y||t instanceof A?Gu({target:t},e):Gu(Gu({},e),t)}async image(t){const e=new Image;return e.src=await this.base64(t),e}async base64(t){t=this._normalizeOptions(t,gb.defaultImageOptions);const{format:e,quality:s}=t,i=this.canvas(t);if(i.toBlob!==void 0)return new Promise((n,o)=>{i.toBlob(a=>{if(!a){o(new Error("ICanvas.toBlob failed!"));return}const u=new FileReader;u.onload=()=>n(u.result),u.onerror=o,u.readAsDataURL(a)},Iu[e],s)});if(i.toDataURL!==void 0)return i.toDataURL(Iu[e],s);if(i.convertToBlob!==void 0){const n=await i.convertToBlob({type:Iu[e],quality:s});return new Promise((o,a)=>{const u=new FileReader;u.onload=()=>o(u.result),u.onerror=a,u.readAsDataURL(n)})}throw new Error("Extract.base64() requires ICanvas.toDataURL, ICanvas.toBlob, or ICanvas.convertToBlob to be implemented")}canvas(t){t=this._normalizeOptions(t);const e=t.target,s=this._renderer;if(e instanceof A)return s.texture.generateCanvas(e);const i=s.textureGenerator.generateTexture(t),n=s.texture.generateCanvas(i);return i.destroy(),n}pixels(t){t=this._normalizeOptions(t);const e=t.target,s=this._renderer,i=e instanceof A?e:s.textureGenerator.generateTexture(t),n=s.texture.getPixels(i);return e instanceof Y&&i.destroy(),n}texture(t){return t=this._normalizeOptions(t),t.target instanceof A?t.target:this._renderer.textureGenerator.generateTexture(t)}download(t){var e;t=this._normalizeOptions(t);const s=this.canvas(t),i=document.createElement("a");i.download=(e=t.filename)!=null?e:"image.png",i.href=s.toDataURL("image/png"),document.body.appendChild(i),i.click(),document.body.removeChild(i)}log(t){var e;const s=(e=t.width)!=null?e:200;t=this._normalizeOptions(t);const i=this.canvas(t),n=i.toDataURL();console.log(`[Pixi Texture] ${i.width}px ${i.height}px`);const o=["font-size: 1px;",`padding: ${s}px 300px;`,`background: url(${n}) no-repeat;`,"background-size: contain;"].join(" ");console.log("%c ",o)}destroy(){this._renderer=null}};Bu.extension={type:[v.WebGLSystem,v.WebGPUSystem],name:"extract"},Bu.defaultImageOptions={format:"png",quality:1};let L_=Bu;class N_ extends A{static create(t){return new A({source:new tt(t)})}resize(t,e,s){return this.source.resize(t,e,s),this}}var YE=Object.defineProperty,KE=Object.defineProperties,qE=Object.getOwnPropertyDescriptors,H_=Object.getOwnPropertySymbols,ZE=Object.prototype.hasOwnProperty,QE=Object.prototype.propertyIsEnumerable,X_=(r,t,e)=>t in r?YE(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,JE=(r,t)=>{for(var e in t||(t={}))ZE.call(t,e)&&X_(r,e,t[e]);if(H_)for(var e of H_(t))QE.call(t,e)&&X_(r,e,t[e]);return r},tA=(r,t)=>KE(r,qE(t));const eA=new V,rA=new lt,sA=[0,0,0,0];class Fu{constructor(t){this._renderer=t}generateTexture(t){var e;t instanceof Y&&(t={target:t,frame:void 0,textureSourceOptions:{},resolution:void 0});const s=t.resolution||this._renderer.resolution,i=t.antialias||this._renderer.view.antialias,n=t.target;let o=t.clearColor;o?o=Array.isArray(o)&&o.length===4?o:z.shared.setValue(o).toArray():o=sA;const a=((e=t.frame)==null?void 0:e.copyTo(eA))||cs(n,rA).rectangle;a.width=Math.max(a.width,1/s)|0,a.height=Math.max(a.height,1/s)|0;const u=N_.create(tA(JE({},t.textureSourceOptions),{width:a.width,height:a.height,resolution:s,antialias:i})),l=C.shared.translate(-a.x,-a.y);return this._renderer.render({container:n,transform:l,target:u,clearColor:o}),u.source.updateMipmaps(),u}destroy(){this._renderer=null}}Fu.extension={type:[v.WebGLSystem,v.WebGPUSystem],name:"textureGenerator"};class Du{constructor(t){this._stackIndex=0,this._globalUniformDataStack=[],this._uniformsPool=[],this._activeUniforms=[],this._bindGroupPool=[],this._activeBindGroups=[],this._renderer=t}reset(){this._stackIndex=0;for(let t=0;t<this._activeUniforms.length;t++)this._uniformsPool.push(this._activeUniforms[t]);for(let t=0;t<this._activeBindGroups.length;t++)this._bindGroupPool.push(this._activeBindGroups[t]);this._activeUniforms.length=0,this._activeBindGroups.length=0}start(t){this.reset(),this.push(t)}bind({size:t,projectionMatrix:e,worldTransformMatrix:s,worldColor:i,offset:n}){const o=this._renderer.renderTarget.renderTarget,a=this._stackIndex?this._globalUniformDataStack[this._stackIndex-1]:{projectionData:o,worldTransformMatrix:new C,worldColor:4294967295,offset:new W},u={projectionMatrix:e||this._renderer.renderTarget.projectionMatrix,resolution:t||o.size,worldTransformMatrix:s||a.worldTransformMatrix,worldColor:i||a.worldColor,offset:n||a.offset,bindGroup:null},l=this._uniformsPool.pop()||this._createUniforms();this._activeUniforms.push(l);const h=l.uniforms;h.uProjectionMatrix=u.projectionMatrix,h.uResolution=u.resolution,h.uWorldTransformMatrix.copyFrom(u.worldTransformMatrix),h.uWorldTransformMatrix.tx-=u.offset.x,h.uWorldTransformMatrix.ty-=u.offset.y,Ar(u.worldColor,h.uWorldColorAlpha,0),l.update();let c;this._renderer.renderPipes.uniformBatch?c=this._renderer.renderPipes.uniformBatch.getUniformBindGroup(l,!1):(c=this._bindGroupPool.pop()||new Nt,this._activeBindGroups.push(c),c.setResource(l,0)),u.bindGroup=c,this._currentGlobalUniformData=u}push(t){this.bind(t),this._globalUniformDataStack[this._stackIndex++]=this._currentGlobalUniformData}pop(){this._currentGlobalUniformData=this._globalUniformDataStack[--this._stackIndex-1],this._renderer.type===Tt.WEBGL&&this._currentGlobalUniformData.bindGroup.resources[0].update()}get bindGroup(){return this._currentGlobalUniformData.bindGroup}get uniformGroup(){return this._currentGlobalUniformData.bindGroup.resources[0]}_createUniforms(){return new it({uProjectionMatrix:{value:new C,type:"mat3x3<f32>"},uWorldTransformMatrix:{value:new C,type:"mat3x3<f32>"},uWorldColorAlpha:{value:new Float32Array(4),type:"vec4<f32>"},uResolution:{value:[0,0],type:"vec2<f32>"}},{isStatic:!0})}destroy(){this._renderer=null}}Du.extension={type:[v.WebGLSystem,v.WebGPUSystem,v.CanvasSystem],name:"globalUniforms"};let z_=!1;const Uu="8.2.0";function j_(r){if(!z_){if(j.get().getNavigator().userAgent.toLowerCase().indexOf("chrome")>-1){const t=[`%c %c %c %c %c PixiJS %c v${Uu} (${r}) http://www.pixijs.com/
1966
+ `,r}const yE={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,uint:1,uvec2:2,uvec3:3,uvec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function TE(r){return yE[r]}function __(r){const t={};return t.normal=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t.add=[r.ONE,r.ONE],t.multiply=[r.DST_COLOR,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA],t.screen=[r.ONE,r.ONE_MINUS_SRC_COLOR,r.ONE,r.ONE_MINUS_SRC_ALPHA],t.none=[0,0],t["normal-npm"]=[r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA],t["add-npm"]=[r.SRC_ALPHA,r.ONE,r.ONE,r.ONE],t["screen-npm"]=[r.SRC_ALPHA,r.ONE_MINUS_SRC_COLOR,r.ONE,r.ONE_MINUS_SRC_ALPHA],t.erase=[r.ZERO,r.ONE_MINUS_SRC_ALPHA],t}const SE=0,EE=1,AE=2,PE=3,wE=4,RE=5,x_=class fl{constructor(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode="none",this._blendEq=!1,this.map=[],this.map[SE]=this.setBlend,this.map[EE]=this.setOffset,this.map[AE]=this.setCullFace,this.map[PE]=this.setDepthTest,this.map[wE]=this.setFrontFace,this.map[RE]=this.setDepthMask,this.checks=[],this.defaultState=Bt.for2d()}contextChange(t){this.gl=t,this.blendModesMap=__(t),this.reset()}set(t){if(t=t||this.defaultState,this.stateId!==t.data){let e=this.stateId^t.data,s=0;for(;e;)e&1&&this.map[s].call(this,!!(t.data&1<<s)),e=e>>1,s++;this.stateId=t.data}for(let e=0;e<this.checks.length;e++)this.checks[e](this,t)}forceState(t){t=t||this.defaultState;for(let e=0;e<this.map.length;e++)this.map[e].call(this,!!(t.data&1<<e));for(let e=0;e<this.checks.length;e++)this.checks[e](this,t);this.stateId=t.data}setBlend(t){this._updateCheck(fl._checkBlendMode,t),this.gl[t?"enable":"disable"](this.gl.BLEND)}setOffset(t){this._updateCheck(fl._checkPolygonOffset,t),this.gl[t?"enable":"disable"](this.gl.POLYGON_OFFSET_FILL)}setDepthTest(t){this.gl[t?"enable":"disable"](this.gl.DEPTH_TEST)}setDepthMask(t){this.gl.depthMask(t)}setCullFace(t){this.gl[t?"enable":"disable"](this.gl.CULL_FACE)}setFrontFace(t){this.gl.frontFace(this.gl[t?"CW":"CCW"])}setBlendMode(t){if(this.blendModesMap[t]||(t="normal"),t===this.blendMode)return;this.blendMode=t;const e=this.blendModesMap[t],s=this.gl;e.length===2?s.blendFunc(e[0],e[1]):s.blendFuncSeparate(e[0],e[1],e[2],e[3]),e.length===6?(this._blendEq=!0,s.blendEquationSeparate(e[4],e[5])):this._blendEq&&(this._blendEq=!1,s.blendEquationSeparate(s.FUNC_ADD,s.FUNC_ADD))}setPolygonOffset(t,e){this.gl.polygonOffset(t,e)}reset(){this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,!1),this.forceState(this.defaultState),this._blendEq=!0,this.blendMode="",this.setBlendMode("normal")}_updateCheck(t,e){const s=this.checks.indexOf(t);e&&s===-1?this.checks.push(t):!e&&s!==-1&&this.checks.splice(s,1)}static _checkBlendMode(t,e){t.setBlendMode(e.blendMode)}static _checkPolygonOffset(t,e){t.setPolygonOffset(1,e.polygonOffset)}destroy(){this.gl=null,this.checks.length=0}};x_.extension={type:[v.WebGLSystem],name:"state"};let b_=x_;class v_{constructor(t){this.target=Ya.TEXTURE_2D,this.texture=t,this.width=-1,this.height=-1,this.type=X.UNSIGNED_BYTE,this.internalFormat=wi.RGBA,this.format=wi.RGBA,this.samplerType=0}}const y_={id:"buffer",upload(r,t,e){t.width===r.width||t.height===r.height?e.texSubImage2D(e.TEXTURE_2D,0,0,0,r.width,r.height,t.format,t.type,r.resource):e.texImage2D(t.target,0,t.internalFormat,r.width,r.height,0,t.format,t.type,r.resource),t.width=r.width,t.height=r.height}},ME={"bc1-rgba-unorm":!0,"bc1-rgba-unorm-srgb":!0,"bc2-rgba-unorm":!0,"bc2-rgba-unorm-srgb":!0,"bc3-rgba-unorm":!0,"bc3-rgba-unorm-srgb":!0,"bc4-r-unorm":!0,"bc4-r-snorm":!0,"bc5-rg-unorm":!0,"bc5-rg-snorm":!0,"bc6h-rgb-ufloat":!0,"bc6h-rgb-float":!0,"bc7-rgba-unorm":!0,"bc7-rgba-unorm-srgb":!0,"etc2-rgb8unorm":!0,"etc2-rgb8unorm-srgb":!0,"etc2-rgb8a1unorm":!0,"etc2-rgb8a1unorm-srgb":!0,"etc2-rgba8unorm":!0,"etc2-rgba8unorm-srgb":!0,"eac-r11unorm":!0,"eac-r11snorm":!0,"eac-rg11unorm":!0,"eac-rg11snorm":!0,"astc-4x4-unorm":!0,"astc-4x4-unorm-srgb":!0,"astc-5x4-unorm":!0,"astc-5x4-unorm-srgb":!0,"astc-5x5-unorm":!0,"astc-5x5-unorm-srgb":!0,"astc-6x5-unorm":!0,"astc-6x5-unorm-srgb":!0,"astc-6x6-unorm":!0,"astc-6x6-unorm-srgb":!0,"astc-8x5-unorm":!0,"astc-8x5-unorm-srgb":!0,"astc-8x6-unorm":!0,"astc-8x6-unorm-srgb":!0,"astc-8x8-unorm":!0,"astc-8x8-unorm-srgb":!0,"astc-10x5-unorm":!0,"astc-10x5-unorm-srgb":!0,"astc-10x6-unorm":!0,"astc-10x6-unorm-srgb":!0,"astc-10x8-unorm":!0,"astc-10x8-unorm-srgb":!0,"astc-10x10-unorm":!0,"astc-10x10-unorm-srgb":!0,"astc-12x10-unorm":!0,"astc-12x10-unorm-srgb":!0,"astc-12x12-unorm":!0,"astc-12x12-unorm-srgb":!0},T_={id:"compressed",upload(r,t,e){e.pixelStorei(e.UNPACK_ALIGNMENT,4);let s=r.pixelWidth,i=r.pixelHeight;const n=!!ME[r.format];for(let o=0;o<r.resource.length;o++){const a=r.resource[o];n?e.compressedTexImage2D(e.TEXTURE_2D,o,t.internalFormat,s,i,0,a):e.texImage2D(e.TEXTURE_2D,o,t.internalFormat,s,i,0,t.format,t.type,a),s=Math.max(s>>1,1),i=Math.max(i>>1,1)}}},fu={id:"image",upload(r,t,e,s){const i=r.alphaMode==="premultiply-alpha-on-upload";e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i);const n=t.width,o=t.height,a=r.pixelWidth,u=r.pixelHeight,l=r.resourceWidth,h=r.resourceHeight;l<a||h<u?((n!==a||o!==u)&&e.texImage2D(t.target,0,t.internalFormat,a,u,0,t.format,t.type,null),s===2?e.texSubImage2D(e.TEXTURE_2D,0,0,0,l,h,t.format,t.type,r.resource):e.texSubImage2D(e.TEXTURE_2D,0,0,0,t.format,t.type,r.resource)):n===a||o===u?e.texSubImage2D(e.TEXTURE_2D,0,0,0,t.format,t.type,r.resource):s===2?e.texImage2D(t.target,0,t.internalFormat,a,u,0,t.format,t.type,r.resource):e.texImage2D(t.target,0,t.internalFormat,t.format,t.type,r.resource),t.width=a,t.height=u}},S_={id:"video",upload(r,t,e,s){if(!r.isValid){e.texImage2D(t.target,0,t.internalFormat,1,1,0,t.format,t.type,null);return}fu.upload(r,t,e,s)}},mu={linear:9729,nearest:9728},E_={linear:{linear:9987,nearest:9985},nearest:{linear:9986,nearest:9984}},Gi={"clamp-to-edge":33071,repeat:10497,"mirror-repeat":33648},A_={never:512,less:513,equal:514,"less-equal":515,greater:516,"not-equal":517,"greater-equal":518,always:519};function gu(r,t,e,s,i,n,o,a){const u=n;if(!a||r.addressModeU!=="repeat"||r.addressModeV!=="repeat"||r.addressModeW!=="repeat"){const l=Gi[o?"clamp-to-edge":r.addressModeU],h=Gi[o?"clamp-to-edge":r.addressModeV],c=Gi[o?"clamp-to-edge":r.addressModeW];t[i](u,t.TEXTURE_WRAP_S,l),t[i](u,t.TEXTURE_WRAP_T,h),t.TEXTURE_WRAP_R&&t[i](u,t.TEXTURE_WRAP_R,c)}if((!a||r.magFilter!=="linear")&&t[i](u,t.TEXTURE_MAG_FILTER,mu[r.magFilter]),e){if(!a||r.mipmapFilter!=="linear"){const l=E_[r.minFilter][r.mipmapFilter];t[i](u,t.TEXTURE_MIN_FILTER,l)}}else t[i](u,t.TEXTURE_MIN_FILTER,mu[r.minFilter]);if(s&&r.maxAnisotropy>1){const l=Math.min(r.maxAnisotropy,t.getParameter(s.MAX_TEXTURE_MAX_ANISOTROPY_EXT));t[i](u,s.TEXTURE_MAX_ANISOTROPY_EXT,l)}r.compare&&t[i](u,t.TEXTURE_COMPARE_FUNC,A_[r.compare])}function P_(r){return{r8unorm:r.RED,r8snorm:r.RED,r8uint:r.RED,r8sint:r.RED,r16uint:r.RED,r16sint:r.RED,r16float:r.RED,rg8unorm:r.RG,rg8snorm:r.RG,rg8uint:r.RG,rg8sint:r.RG,r32uint:r.RED,r32sint:r.RED,r32float:r.RED,rg16uint:r.RG,rg16sint:r.RG,rg16float:r.RG,rgba8unorm:r.RGBA,"rgba8unorm-srgb":r.RGBA,rgba8snorm:r.RGBA,rgba8uint:r.RGBA,rgba8sint:r.RGBA,bgra8unorm:r.RGBA,"bgra8unorm-srgb":r.RGBA,rgb9e5ufloat:r.RGB,rgb10a2unorm:r.RGBA,rg11b10ufloat:r.RGB,rg32uint:r.RG,rg32sint:r.RG,rg32float:r.RG,rgba16uint:r.RGBA,rgba16sint:r.RGBA,rgba16float:r.RGBA,rgba32uint:r.RGBA,rgba32sint:r.RGBA,rgba32float:r.RGBA,stencil8:r.STENCIL_INDEX8,depth16unorm:r.DEPTH_COMPONENT,depth24plus:r.DEPTH_COMPONENT,"depth24plus-stencil8":r.DEPTH_STENCIL,depth32float:r.DEPTH_COMPONENT,"depth32float-stencil8":r.DEPTH_STENCIL}}var OE=Object.defineProperty,CE=Object.defineProperties,GE=Object.getOwnPropertyDescriptors,w_=Object.getOwnPropertySymbols,IE=Object.prototype.hasOwnProperty,BE=Object.prototype.propertyIsEnumerable,R_=(r,t,e)=>t in r?OE(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,Ae=(r,t)=>{for(var e in t||(t={}))IE.call(t,e)&&R_(r,e,t[e]);if(w_)for(var e of w_(t))BE.call(t,e)&&R_(r,e,t[e]);return r},FE=(r,t)=>CE(r,GE(t));function M_(r,t){let e={},s=r.RGBA;return r instanceof j.get().getWebGLRenderingContext()?t.srgb&&(e={"rgba8unorm-srgb":t.srgb.SRGB8_ALPHA8_EXT,"bgra8unorm-srgb":t.srgb.SRGB8_ALPHA8_EXT}):(e={"rgba8unorm-srgb":r.SRGB8_ALPHA8,"bgra8unorm-srgb":r.SRGB8_ALPHA8},s=r.RGBA8),Ae(Ae(Ae(Ae(Ae(Ae(FE(Ae({r8unorm:r.R8,r8snorm:r.R8_SNORM,r8uint:r.R8UI,r8sint:r.R8I,r16uint:r.R16UI,r16sint:r.R16I,r16float:r.R16F,rg8unorm:r.RG8,rg8snorm:r.RG8_SNORM,rg8uint:r.RG8UI,rg8sint:r.RG8I,r32uint:r.R32UI,r32sint:r.R32I,r32float:r.R32F,rg16uint:r.RG16UI,rg16sint:r.RG16I,rg16float:r.RG16F,rgba8unorm:r.RGBA},e),{rgba8snorm:r.RGBA8_SNORM,rgba8uint:r.RGBA8UI,rgba8sint:r.RGBA8I,bgra8unorm:s,rgb9e5ufloat:r.RGB9_E5,rgb10a2unorm:r.RGB10_A2,rg11b10ufloat:r.R11F_G11F_B10F,rg32uint:r.RG32UI,rg32sint:r.RG32I,rg32float:r.RG32F,rgba16uint:r.RGBA16UI,rgba16sint:r.RGBA16I,rgba16float:r.RGBA16F,rgba32uint:r.RGBA32UI,rgba32sint:r.RGBA32I,rgba32float:r.RGBA32F,stencil8:r.STENCIL_INDEX8,depth16unorm:r.DEPTH_COMPONENT16,depth24plus:r.DEPTH_COMPONENT24,"depth24plus-stencil8":r.DEPTH24_STENCIL8,depth32float:r.DEPTH_COMPONENT32F,"depth32float-stencil8":r.DEPTH32F_STENCIL8}),t.s3tc?{"bc1-rgba-unorm":t.s3tc.COMPRESSED_RGBA_S3TC_DXT1_EXT,"bc2-rgba-unorm":t.s3tc.COMPRESSED_RGBA_S3TC_DXT3_EXT,"bc3-rgba-unorm":t.s3tc.COMPRESSED_RGBA_S3TC_DXT5_EXT}:{}),t.s3tc_sRGB?{"bc1-rgba-unorm-srgb":t.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,"bc2-rgba-unorm-srgb":t.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,"bc3-rgba-unorm-srgb":t.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}:{}),t.rgtc?{"bc4-r-unorm":t.rgtc.COMPRESSED_RED_RGTC1_EXT,"bc4-r-snorm":t.rgtc.COMPRESSED_SIGNED_RED_RGTC1_EXT,"bc5-rg-unorm":t.rgtc.COMPRESSED_RED_GREEN_RGTC2_EXT,"bc5-rg-snorm":t.rgtc.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}:{}),t.bptc?{"bc6h-rgb-float":t.bptc.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,"bc6h-rgb-ufloat":t.bptc.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,"bc7-rgba-unorm":t.bptc.COMPRESSED_RGBA_BPTC_UNORM_EXT,"bc7-rgba-unorm-srgb":t.bptc.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT}:{}),t.etc?{"etc2-rgb8unorm":t.etc.COMPRESSED_RGB8_ETC2,"etc2-rgb8unorm-srgb":t.etc.COMPRESSED_SRGB8_ETC2,"etc2-rgb8a1unorm":t.etc.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,"etc2-rgb8a1unorm-srgb":t.etc.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,"etc2-rgba8unorm":t.etc.COMPRESSED_RGBA8_ETC2_EAC,"etc2-rgba8unorm-srgb":t.etc.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,"eac-r11unorm":t.etc.COMPRESSED_R11_EAC,"eac-rg11unorm":t.etc.COMPRESSED_SIGNED_RG11_EAC}:{}),t.astc?{"astc-4x4-unorm":t.astc.COMPRESSED_RGBA_ASTC_4x4_KHR,"astc-4x4-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,"astc-5x4-unorm":t.astc.COMPRESSED_RGBA_ASTC_5x4_KHR,"astc-5x4-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR,"astc-5x5-unorm":t.astc.COMPRESSED_RGBA_ASTC_5x5_KHR,"astc-5x5-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,"astc-6x5-unorm":t.astc.COMPRESSED_RGBA_ASTC_6x5_KHR,"astc-6x5-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,"astc-6x6-unorm":t.astc.COMPRESSED_RGBA_ASTC_6x6_KHR,"astc-6x6-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,"astc-8x5-unorm":t.astc.COMPRESSED_RGBA_ASTC_8x5_KHR,"astc-8x5-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,"astc-8x6-unorm":t.astc.COMPRESSED_RGBA_ASTC_8x6_KHR,"astc-8x6-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,"astc-8x8-unorm":t.astc.COMPRESSED_RGBA_ASTC_8x8_KHR,"astc-8x8-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,"astc-10x5-unorm":t.astc.COMPRESSED_RGBA_ASTC_10x5_KHR,"astc-10x5-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,"astc-10x6-unorm":t.astc.COMPRESSED_RGBA_ASTC_10x6_KHR,"astc-10x6-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,"astc-10x8-unorm":t.astc.COMPRESSED_RGBA_ASTC_10x8_KHR,"astc-10x8-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,"astc-10x10-unorm":t.astc.COMPRESSED_RGBA_ASTC_10x10_KHR,"astc-10x10-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,"astc-12x10-unorm":t.astc.COMPRESSED_RGBA_ASTC_12x10_KHR,"astc-12x10-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,"astc-12x12-unorm":t.astc.COMPRESSED_RGBA_ASTC_12x12_KHR,"astc-12x12-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR}:{})}function O_(r){return{r8unorm:r.UNSIGNED_BYTE,r8snorm:r.BYTE,r8uint:r.UNSIGNED_BYTE,r8sint:r.BYTE,r16uint:r.UNSIGNED_SHORT,r16sint:r.SHORT,r16float:r.HALF_FLOAT,rg8unorm:r.UNSIGNED_BYTE,rg8snorm:r.BYTE,rg8uint:r.UNSIGNED_BYTE,rg8sint:r.BYTE,r32uint:r.UNSIGNED_INT,r32sint:r.INT,r32float:r.FLOAT,rg16uint:r.UNSIGNED_SHORT,rg16sint:r.SHORT,rg16float:r.HALF_FLOAT,rgba8unorm:r.UNSIGNED_BYTE,"rgba8unorm-srgb":r.UNSIGNED_BYTE,rgba8snorm:r.BYTE,rgba8uint:r.UNSIGNED_BYTE,rgba8sint:r.BYTE,bgra8unorm:r.UNSIGNED_BYTE,"bgra8unorm-srgb":r.UNSIGNED_BYTE,rgb9e5ufloat:r.UNSIGNED_INT_5_9_9_9_REV,rgb10a2unorm:r.UNSIGNED_INT_2_10_10_10_REV,rg11b10ufloat:r.UNSIGNED_INT_10F_11F_11F_REV,rg32uint:r.UNSIGNED_INT,rg32sint:r.INT,rg32float:r.FLOAT,rgba16uint:r.UNSIGNED_SHORT,rgba16sint:r.SHORT,rgba16float:r.HALF_FLOAT,rgba32uint:r.UNSIGNED_INT,rgba32sint:r.INT,rgba32float:r.FLOAT,stencil8:r.UNSIGNED_BYTE,depth16unorm:r.UNSIGNED_SHORT,depth24plus:r.UNSIGNED_INT,"depth24plus-stencil8":r.UNSIGNED_INT_24_8,depth32float:r.FLOAT,"depth32float-stencil8":r.FLOAT_32_UNSIGNED_INT_24_8_REV}}function DE(r){r instanceof Uint8ClampedArray&&(r=new Uint8Array(r.buffer));const t=r.length;for(let e=0;e<t;e+=4){const s=r[e+3];if(s!==0){const i=255.001/s;r[e]=r[e]*i+.5,r[e+1]=r[e+1]*i+.5,r[e+2]=r[e+2]*i+.5}}}const UE=4;class _u{constructor(t){this.managedTextures=[],this._glTextures=Object.create(null),this._glSamplers=Object.create(null),this._boundTextures=[],this._activeTextureLocation=-1,this._boundSamplers=Object.create(null),this._uploads={image:fu,buffer:y_,video:S_,compressed:T_},this._useSeparateSamplers=!1,this._renderer=t}contextChange(t){this._gl=t,this._mapFormatToInternalFormat||(this._mapFormatToInternalFormat=M_(t,this._renderer.context.extensions),this._mapFormatToType=O_(t),this._mapFormatToFormat=P_(t)),this._glTextures=Object.create(null),this._glSamplers=Object.create(null),this._boundSamplers=Object.create(null);for(let e=0;e<16;e++)this.bind(A.EMPTY,e)}initSource(t){this.bind(t)}bind(t,e=0){const s=t.source;t?(this.bindSource(s,e),this._useSeparateSamplers&&this._bindSampler(s.style,e)):(this.bindSource(null,e),this._useSeparateSamplers&&this._bindSampler(null,e))}bindSource(t,e=0){const s=this._gl;if(t._touched=this._renderer.textureGC.count,this._boundTextures[e]!==t){this._boundTextures[e]=t,this._activateLocation(e),t=t||A.EMPTY.source;const i=this.getGlSource(t);s.bindTexture(i.target,i.texture)}}_bindSampler(t,e=0){const s=this._gl;if(!t){this._boundSamplers[e]=null,s.bindSampler(e,null);return}const i=this._getGlSampler(t);this._boundSamplers[e]!==i&&(this._boundSamplers[e]=i,s.bindSampler(e,i))}unbind(t){const e=t.source,s=this._boundTextures,i=this._gl;for(let n=0;n<s.length;n++)if(s[n]===e){this._activateLocation(n);const o=this.getGlSource(e);i.bindTexture(o.target,null),s[n]=null}}_activateLocation(t){this._activeTextureLocation!==t&&(this._activeTextureLocation=t,this._gl.activeTexture(this._gl.TEXTURE0+t))}_initSource(t){const e=this._gl,s=new v_(e.createTexture());if(s.type=this._mapFormatToType[t.format],s.internalFormat=this._mapFormatToInternalFormat[t.format],s.format=this._mapFormatToFormat[t.format],t.autoGenerateMipmaps&&(this._renderer.context.supports.nonPowOf2mipmaps||t.isPowerOfTwo)){const i=Math.max(t.width,t.height);t.mipLevelCount=Math.floor(Math.log2(i))+1}return this._glTextures[t.uid]=s,this.managedTextures.includes(t)||(t.on("update",this.onSourceUpdate,this),t.on("resize",this.onSourceUpdate,this),t.on("styleChange",this.onStyleChange,this),t.on("destroy",this.onSourceDestroy,this),t.on("unload",this.onSourceUnload,this),t.on("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.push(t)),this.onSourceUpdate(t),this.updateStyle(t,!1),s}onStyleChange(t){this.updateStyle(t,!1)}updateStyle(t,e){const s=this._gl,i=this.getGlSource(t);s.bindTexture(s.TEXTURE_2D,i.texture),this._boundTextures[this._activeTextureLocation]=t,gu(t.style,s,t.mipLevelCount>1,this._renderer.context.extensions.anisotropicFiltering,"texParameteri",s.TEXTURE_2D,!this._renderer.context.supports.nonPowOf2wrapping&&!t.isPowerOfTwo,e)}onSourceUnload(t){const e=this._glTextures[t.uid];e&&(this.unbind(t),this._glTextures[t.uid]=null,this._gl.deleteTexture(e.texture))}onSourceUpdate(t){const e=this._gl,s=this.getGlSource(t);e.bindTexture(e.TEXTURE_2D,s.texture),this._boundTextures[this._activeTextureLocation]=t,this._uploads[t.uploadMethodId]?this._uploads[t.uploadMethodId].upload(t,s,e,this._renderer.context.webGLVersion):e.texImage2D(e.TEXTURE_2D,0,e.RGBA,t.pixelWidth,t.pixelHeight,0,e.RGBA,e.UNSIGNED_BYTE,null),t.autoGenerateMipmaps&&t.mipLevelCount>1&&this.onUpdateMipmaps(t,!1)}onUpdateMipmaps(t,e=!0){e&&this.bindSource(t,0);const s=this.getGlSource(t);this._gl.generateMipmap(s.target)}onSourceDestroy(t){t.off("destroy",this.onSourceDestroy,this),t.off("update",this.onSourceUpdate,this),t.off("resize",this.onSourceUpdate,this),t.off("unload",this.onSourceUnload,this),t.off("styleChange",this.onStyleChange,this),t.off("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.splice(this.managedTextures.indexOf(t),1),this.onSourceUnload(t)}_initSampler(t){const e=this._gl,s=this._gl.createSampler();return this._glSamplers[t._resourceId]=s,gu(t,e,this._boundTextures[this._activeTextureLocation].mipLevelCount>1,this._renderer.context.extensions.anisotropicFiltering,"samplerParameteri",s,!1,!0),this._glSamplers[t._resourceId]}_getGlSampler(t){return this._glSamplers[t._resourceId]||this._initSampler(t)}getGlSource(t){return this._glTextures[t.uid]||this._initSource(t)}generateCanvas(t){const{pixels:e,width:s,height:i}=this.getPixels(t),n=j.get().createCanvas();n.width=s,n.height=i;const o=n.getContext("2d");if(o){const a=o.createImageData(s,i);a.data.set(e),o.putImageData(a,0,0)}return n}getPixels(t){const e=t.source.resolution,s=t.frame,i=Math.max(Math.round(s.width*e),1),n=Math.max(Math.round(s.height*e),1),o=new Uint8Array(UE*i*n),a=this._renderer,u=a.renderTarget.getRenderTarget(t),l=a.renderTarget.getGpuRenderTarget(u),h=a.gl;return h.bindFramebuffer(h.FRAMEBUFFER,l.resolveTargetFramebuffer),h.readPixels(Math.round(s.x*e),Math.round(s.y*e),i,n,h.RGBA,h.UNSIGNED_BYTE,o),{pixels:new Uint8ClampedArray(o.buffer),width:i,height:n}}destroy(){this.managedTextures.slice().forEach(t=>this.onSourceDestroy(t)),this.managedTextures=null,this._renderer=null}}_u.extension={type:[v.WebGLSystem],name:"texture"};class xu{init(){const t=new it({uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uTransformMatrix:{value:new C,type:"mat3x3<f32>"},uRound:{value:0,type:"f32"}}),e=It(),s=$e({name:"graphics",bits:[js,Ws(e),Qs,Ne]});this.shader=new Pt({glProgram:s,resources:{localUniforms:t,batchSamplers:Ys(e)}})}execute(t,e){const s=e.context,i=s.customShader||this.shader,n=t.renderer,o=n.graphicsContext,{geometry:a,instructions:u}=o.getContextRenderData(s);i.groups[0]=n.globalUniforms.bindGroup,n.state.set(t.state),n.shader.bind(i),n.geometry.bind(a,i.glProgram);const l=u.instructions;for(let h=0;h<u.instructionSize;h++){const c=l[h];if(c.size){for(let d=0;d<c.textures.textures.length;d++)n.texture.bind(c.textures.textures[d],d);n.geometry.draw("triangle-list",c.size,c.start)}}}destroy(){this.shader.destroy(!0),this.shader=null}}xu.extension={type:[v.WebGLPipesAdaptor],name:"graphics"};class bu{init(){const t=$e({name:"mesh",bits:[Qs,wg,Ne]});this._shader=new Pt({glProgram:t,resources:{uTexture:A.EMPTY.source,textureUniforms:{uTextureMatrix:{type:"mat3x3<f32>",value:new C}}}})}execute(t,e){const s=t.renderer;let i=e._shader;if(i){if(!i.glProgram)return}else{i=this._shader;const n=e.texture,o=n.source;i.resources.uTexture=o,i.resources.uSampler=o.style,i.resources.textureUniforms.uniforms.uTextureMatrix=n.textureMatrix.mapCoord}i.groups[100]=s.globalUniforms.bindGroup,i.groups[101]=t.localUniformsBindGroup,s.encoder.draw({geometry:e._geometry,shader:i,state:e.state})}destroy(){this._shader.destroy(!0),this._shader=null}}bu.extension={type:[v.WebGLPipesAdaptor],name:"mesh"};class vu{constructor(t){this._renderer=t}addRenderable(t,e){this._renderer.renderPipes.batch.break(e),e.add(t)}execute(t){t.isRenderable&&t.render(this._renderer)}destroy(){this._renderer=null}}vu.extension={type:[v.WebGLPipes,v.WebGPUPipes,v.CanvasPipes],name:"customRender"};function yu(r,t){const e=r.instructionSet,s=e.instructions;for(let i=0;i<e.instructionSize;i++){const n=s[i];t[n.renderPipeId].execute(n)}}class Tu{constructor(t){this._renderer=t}addRenderGroup(t,e){this._renderer.renderPipes.batch.break(e),e.add(t)}execute(t){t.isRenderable&&(this._renderer.globalUniforms.push({worldTransformMatrix:t.worldTransform,worldColor:t.worldColorAlpha}),yu(t,this._renderer.renderPipes),this._renderer.globalUniforms.pop())}destroy(){this._renderer=null}}Tu.extension={type:[v.WebGLPipes,v.WebGPUPipes,v.CanvasPipes],name:"renderGroup"};function Su(r,t=[]){t.push(r);for(let e=0;e<r.renderGroupChildren.length;e++)Su(r.renderGroupChildren[e],t);return t}function Eu(r,t,e){const s=r>>16&255,i=r>>8&255,n=r&255,o=t>>16&255,a=t>>8&255,u=t&255,l=s+(o-s)*e,h=i+(a-i)*e,c=n+(u-n)*e;return(l<<16)+(h<<8)+c}const qe=16777215;function Au(r,t){return r===qe||t===qe?r+t-qe:Eu(r,t,.5)}function kE(r,t,e){const s=(e>>24&255)/255,i=t*s*255,n=((r&255)<<16)+(r&65280)+(r>>16&255),o=e&16777215;let a;return n===qe||o===qe?a=n+o-qe:a=Eu(n,o,.5),a+(i<<24)}const $E=new Y;function Pu(r,t=!1){C_(r);const e=r.childrenToUpdate,s=r.updateTick++;for(const i in e){const n=Number(i),o=e[i],a=o.list,u=o.index;for(let l=0;l<u;l++){const h=a[l];h.parentRenderGroup===r&&h.relativeRenderGroupDepth===n&&wu(h,s,0)}o.index=0}if(t)for(let i=0;i<r.renderGroupChildren.length;i++)Pu(r.renderGroupChildren[i],t)}function C_(r){const t=r.root;let e;if(r.renderGroupParent){const s=r.renderGroupParent;r.worldTransform.appendFrom(t.relativeGroupTransform,s.worldTransform),r.worldColor=Au(t.groupColor,s.worldColor),e=t.groupAlpha*s.worldAlpha}else r.worldTransform.copyFrom(t.localTransform),r.worldColor=t.localColor,e=t.localAlpha;e=e<0?0:e>1?1:e,r.worldAlpha=e,r.worldColorAlpha=r.worldColor+((e*255|0)<<24)}function wu(r,t,e){if(t===r.updateTick)return;r.updateTick=t,r.didChange=!1;const s=r.localTransform;r.updateLocalTransform();const i=r.parent;if(i&&!i.renderGroup?(e=e|r._updateFlags,r.relativeGroupTransform.appendFrom(s,i.relativeGroupTransform),e&&G_(r,i,e)):(e=r._updateFlags,r.relativeGroupTransform.copyFrom(s),e&&G_(r,$E,e)),!r.renderGroup){const n=r.children,o=n.length;for(let u=0;u<o;u++)wu(n[u],t,e);const a=r.parentRenderGroup;r.renderPipeId&&!a.structureDidChange&&a.updateRenderable(r)}}function G_(r,t,e){if(e&ds){r.groupColor=Au(r.localColor,t.groupColor);let s=r.localAlpha*t.groupAlpha;s=s<0?0:s>1?1:s,r.groupAlpha=s,r.groupColorAlpha=r.groupColor+((s*255|0)<<24)}e&an&&(r.groupBlendMode=r.localBlendMode==="inherit"?t.groupBlendMode:r.localBlendMode),e&cr&&(r.globalDisplayStatus=r.localDisplayStatus&t.globalDisplayStatus),r._updateFlags=0}function I_(r,t){const{list:e,index:s}=r.childrenRenderablesToUpdate;let i=!1;for(let n=0;n<s;n++){const o=e[n];if(i=t[o.renderPipeId].validateRenderable(o),i)break}return r.structureDidChange=i,i}const LE=new C;class Ru{constructor(t){this._renderer=t}render({container:t,transform:e}){t.isRenderGroup=!0;const s=t.parent,i=t.renderGroup.renderGroupParent;t.parent=null,t.renderGroup.renderGroupParent=null;const n=this._renderer,o=Su(t.renderGroup,[]);let a=LE;e&&(a=a.copyFrom(t.renderGroup.localTransform),t.renderGroup.localTransform.copyFrom(e));const u=n.renderPipes;for(let l=0;l<o.length;l++){const h=o[l];h.runOnRender(),h.instructionSet.renderPipes=u,h.structureDidChange||I_(h,u),Pu(h),h.structureDidChange?(h.structureDidChange=!1,Rg(h,u)):NE(h),h.childrenRenderablesToUpdate.index=0,n.renderPipes.batch.upload(h.instructionSet)}n.globalUniforms.start({worldTransformMatrix:e?t.renderGroup.localTransform:t.renderGroup.worldTransform,worldColor:t.renderGroup.worldColorAlpha}),yu(t.renderGroup,u),u.uniformBatch&&u.uniformBatch.renderEnd(),e&&t.renderGroup.localTransform.copyFrom(a),t.parent=s,t.renderGroup.renderGroupParent=i}destroy(){this._renderer=null}}Ru.extension={type:[v.WebGLSystem,v.WebGPUSystem,v.CanvasSystem],name:"renderGroup"};function NE(r){const{list:t,index:e}=r.childrenRenderablesToUpdate;for(let s=0;s<e;s++){const i=t[s];i.didViewUpdate&&r.updateRenderable(i)}}class Mu{constructor(t){this._gpuSpriteHash=Object.create(null),this._renderer=t}addRenderable(t,e){const s=this._getGpuSprite(t);t._didSpriteUpdate&&this._updateBatchableSprite(t,s),this._renderer.renderPipes.batch.addToBatch(s)}updateRenderable(t){const e=this._gpuSpriteHash[t.uid];t._didSpriteUpdate&&this._updateBatchableSprite(t,e),e.batcher.updateElement(e)}validateRenderable(t){const e=t._texture,s=this._getGpuSprite(t);return s.texture._source!==e._source?!s.batcher.checkAndUpdateTexture(s,e):!1}destroyRenderable(t){const e=this._gpuSpriteHash[t.uid];N.return(e),this._gpuSpriteHash[t.uid]=null}_updateBatchableSprite(t,e){t._didSpriteUpdate=!1,e.bounds=t.bounds,e.texture=t._texture}_getGpuSprite(t){return this._gpuSpriteHash[t.uid]||this._initGPUSprite(t)}_initGPUSprite(t){const e=N.get(Ds);return e.renderable=t,e.texture=t._texture,e.bounds=t.bounds,e.roundPixels=this._renderer._roundPixels|t._roundPixels,this._gpuSpriteHash[t.uid]=e,t._didSpriteUpdate=!1,t.on("destroyed",()=>{this.destroyRenderable(t)}),e}destroy(){for(const t in this._gpuSpriteHash)N.return(this._gpuSpriteHash[t]);this._gpuSpriteHash=null,this._renderer=null}}Mu.extension={type:[v.WebGLPipes,v.WebGPUPipes,v.CanvasPipes],name:"sprite"};var HE=Object.defineProperty,B_=Object.getOwnPropertySymbols,XE=Object.prototype.hasOwnProperty,zE=Object.prototype.propertyIsEnumerable,F_=(r,t,e)=>t in r?HE(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,D_=(r,t)=>{for(var e in t||(t={}))XE.call(t,e)&&F_(r,e,t[e]);if(B_)for(var e of B_(t))zE.call(t,e)&&F_(r,e,t[e]);return r};const Ou=class mb{constructor(){this.clearBeforeRender=!0,this._backgroundColor=new z(0),this.color=this._backgroundColor,this.alpha=1}init(t){t=D_(D_({},mb.defaultOptions),t),this.clearBeforeRender=t.clearBeforeRender,this.color=t.background||t.backgroundColor||this._backgroundColor,this.alpha=t.backgroundAlpha,this._backgroundColor.setAlpha(t.backgroundAlpha)}get color(){return this._backgroundColor}set color(t){this._backgroundColor.setValue(t)}get alpha(){return this._backgroundColor.alpha}set alpha(t){this._backgroundColor.setAlpha(t)}get colorRgba(){return this._backgroundColor.toArray()}destroy(){}};Ou.extension={type:[v.WebGLSystem,v.WebGPUSystem,v.CanvasSystem],name:"background",priority:0},Ou.defaultOptions={backgroundAlpha:1,backgroundColor:0,clearBeforeRender:!0};let U_=Ou;const Zr={};D.handle(v.BlendMode,r=>{if(!r.name)throw new Error("BlendMode extension must have a name property");Zr[r.name]=r.ref},r=>{delete Zr[r.name]});class Cu{constructor(t){this._isAdvanced=!1,this._filterHash=Object.create(null),this._renderer=t}setBlendMode(t,e,s){if(this._activeBlendMode===e){this._isAdvanced&&this._renderableList.push(t);return}this._activeBlendMode=e,this._isAdvanced&&this._endAdvancedBlendMode(s),this._isAdvanced=!!Zr[e],this._isAdvanced&&(this._beginAdvancedBlendMode(s),this._renderableList.push(t))}_beginAdvancedBlendMode(t){this._renderer.renderPipes.batch.break(t);const e=this._activeBlendMode;if(!Zr[e])return;let s=this._filterHash[e];s||(s=this._filterHash[e]=new ur,s.filters=[new Zr[e]]);const i={renderPipeId:"filter",action:"pushFilter",renderables:[],filterEffect:s,canBundle:!1};this._renderableList=i.renderables,t.add(i)}_endAdvancedBlendMode(t){this._renderableList=null,this._renderer.renderPipes.batch.break(t),t.add({renderPipeId:"filter",action:"popFilter",canBundle:!1})}buildStart(){this._isAdvanced=!1}buildEnd(t){this._isAdvanced&&this._endAdvancedBlendMode(t)}destroy(){this._renderer=null,this._renderableList=null;for(const t in this._filterHash)this._filterHash[t].destroy();this._filterHash=null}}Cu.extension={type:[v.WebGLPipes,v.WebGPUPipes,v.CanvasPipes],name:"blendMode"};var jE=Object.defineProperty,k_=Object.getOwnPropertySymbols,VE=Object.prototype.hasOwnProperty,WE=Object.prototype.propertyIsEnumerable,$_=(r,t,e)=>t in r?jE(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,Gu=(r,t)=>{for(var e in t||(t={}))VE.call(t,e)&&$_(r,e,t[e]);if(k_)for(var e of k_(t))WE.call(t,e)&&$_(r,e,t[e]);return r};const Iu={png:"image/png",jpg:"image/jpeg",webp:"image/webp"},Bu=class gb{constructor(t){this._renderer=t}_normalizeOptions(t,e={}){return t instanceof Y||t instanceof A?Gu({target:t},e):Gu(Gu({},e),t)}async image(t){const e=new Image;return e.src=await this.base64(t),e}async base64(t){t=this._normalizeOptions(t,gb.defaultImageOptions);const{format:e,quality:s}=t,i=this.canvas(t);if(i.toBlob!==void 0)return new Promise((n,o)=>{i.toBlob(a=>{if(!a){o(new Error("ICanvas.toBlob failed!"));return}const u=new FileReader;u.onload=()=>n(u.result),u.onerror=o,u.readAsDataURL(a)},Iu[e],s)});if(i.toDataURL!==void 0)return i.toDataURL(Iu[e],s);if(i.convertToBlob!==void 0){const n=await i.convertToBlob({type:Iu[e],quality:s});return new Promise((o,a)=>{const u=new FileReader;u.onload=()=>o(u.result),u.onerror=a,u.readAsDataURL(n)})}throw new Error("Extract.base64() requires ICanvas.toDataURL, ICanvas.toBlob, or ICanvas.convertToBlob to be implemented")}canvas(t){t=this._normalizeOptions(t);const e=t.target,s=this._renderer;if(e instanceof A)return s.texture.generateCanvas(e);const i=s.textureGenerator.generateTexture(t),n=s.texture.generateCanvas(i);return i.destroy(),n}pixels(t){t=this._normalizeOptions(t);const e=t.target,s=this._renderer,i=e instanceof A?e:s.textureGenerator.generateTexture(t),n=s.texture.getPixels(i);return e instanceof Y&&i.destroy(),n}texture(t){return t=this._normalizeOptions(t),t.target instanceof A?t.target:this._renderer.textureGenerator.generateTexture(t)}download(t){var e;t=this._normalizeOptions(t);const s=this.canvas(t),i=document.createElement("a");i.download=(e=t.filename)!=null?e:"image.png",i.href=s.toDataURL("image/png"),document.body.appendChild(i),i.click(),document.body.removeChild(i)}log(t){var e;const s=(e=t.width)!=null?e:200;t=this._normalizeOptions(t);const i=this.canvas(t),n=i.toDataURL();console.log(`[Pixi Texture] ${i.width}px ${i.height}px`);const o=["font-size: 1px;",`padding: ${s}px 300px;`,`background: url(${n}) no-repeat;`,"background-size: contain;"].join(" ");console.log("%c ",o)}destroy(){this._renderer=null}};Bu.extension={type:[v.WebGLSystem,v.WebGPUSystem],name:"extract"},Bu.defaultImageOptions={format:"png",quality:1};let L_=Bu;class N_ extends A{static create(t){return new A({source:new tt(t)})}resize(t,e,s){return this.source.resize(t,e,s),this}}var YE=Object.defineProperty,KE=Object.defineProperties,qE=Object.getOwnPropertyDescriptors,H_=Object.getOwnPropertySymbols,ZE=Object.prototype.hasOwnProperty,QE=Object.prototype.propertyIsEnumerable,X_=(r,t,e)=>t in r?YE(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,JE=(r,t)=>{for(var e in t||(t={}))ZE.call(t,e)&&X_(r,e,t[e]);if(H_)for(var e of H_(t))QE.call(t,e)&&X_(r,e,t[e]);return r},tA=(r,t)=>KE(r,qE(t));const eA=new V,rA=new lt,sA=[0,0,0,0];class Fu{constructor(t){this._renderer=t}generateTexture(t){var e;t instanceof Y&&(t={target:t,frame:void 0,textureSourceOptions:{},resolution:void 0});const s=t.resolution||this._renderer.resolution,i=t.antialias||this._renderer.view.antialias,n=t.target;let o=t.clearColor;o?o=Array.isArray(o)&&o.length===4?o:z.shared.setValue(o).toArray():o=sA;const a=((e=t.frame)==null?void 0:e.copyTo(eA))||cs(n,rA).rectangle;a.width=Math.max(a.width,1/s)|0,a.height=Math.max(a.height,1/s)|0;const u=N_.create(tA(JE({},t.textureSourceOptions),{width:a.width,height:a.height,resolution:s,antialias:i})),l=C.shared.translate(-a.x,-a.y);return this._renderer.render({container:n,transform:l,target:u,clearColor:o}),u.source.updateMipmaps(),u}destroy(){this._renderer=null}}Fu.extension={type:[v.WebGLSystem,v.WebGPUSystem],name:"textureGenerator"};class Du{constructor(t){this._stackIndex=0,this._globalUniformDataStack=[],this._uniformsPool=[],this._activeUniforms=[],this._bindGroupPool=[],this._activeBindGroups=[],this._renderer=t}reset(){this._stackIndex=0;for(let t=0;t<this._activeUniforms.length;t++)this._uniformsPool.push(this._activeUniforms[t]);for(let t=0;t<this._activeBindGroups.length;t++)this._bindGroupPool.push(this._activeBindGroups[t]);this._activeUniforms.length=0,this._activeBindGroups.length=0}start(t){this.reset(),this.push(t)}bind({size:t,projectionMatrix:e,worldTransformMatrix:s,worldColor:i,offset:n}){const o=this._renderer.renderTarget.renderTarget,a=this._stackIndex?this._globalUniformDataStack[this._stackIndex-1]:{projectionData:o,worldTransformMatrix:new C,worldColor:4294967295,offset:new W},u={projectionMatrix:e||this._renderer.renderTarget.projectionMatrix,resolution:t||o.size,worldTransformMatrix:s||a.worldTransformMatrix,worldColor:i||a.worldColor,offset:n||a.offset,bindGroup:null},l=this._uniformsPool.pop()||this._createUniforms();this._activeUniforms.push(l);const h=l.uniforms;h.uProjectionMatrix=u.projectionMatrix,h.uResolution=u.resolution,h.uWorldTransformMatrix.copyFrom(u.worldTransformMatrix),h.uWorldTransformMatrix.tx-=u.offset.x,h.uWorldTransformMatrix.ty-=u.offset.y,Ar(u.worldColor,h.uWorldColorAlpha,0),l.update();let c;this._renderer.renderPipes.uniformBatch?c=this._renderer.renderPipes.uniformBatch.getUniformBindGroup(l,!1):(c=this._bindGroupPool.pop()||new Nt,this._activeBindGroups.push(c),c.setResource(l,0)),u.bindGroup=c,this._currentGlobalUniformData=u}push(t){this.bind(t),this._globalUniformDataStack[this._stackIndex++]=this._currentGlobalUniformData}pop(){this._currentGlobalUniformData=this._globalUniformDataStack[--this._stackIndex-1],this._renderer.type===Tt.WEBGL&&this._currentGlobalUniformData.bindGroup.resources[0].update()}get bindGroup(){return this._currentGlobalUniformData.bindGroup}get uniformGroup(){return this._currentGlobalUniformData.bindGroup.resources[0]}_createUniforms(){return new it({uProjectionMatrix:{value:new C,type:"mat3x3<f32>"},uWorldTransformMatrix:{value:new C,type:"mat3x3<f32>"},uWorldColorAlpha:{value:new Float32Array(4),type:"vec4<f32>"},uResolution:{value:[0,0],type:"vec2<f32>"}},{isStatic:!0})}destroy(){this._renderer=null}}Du.extension={type:[v.WebGLSystem,v.WebGPUSystem,v.CanvasSystem],name:"globalUniforms"};let z_=!1;const Uu="8.2.1";function j_(r){if(!z_){if(j.get().getNavigator().userAgent.toLowerCase().indexOf("chrome")>-1){const t=[`%c %c %c %c %c PixiJS %c v${Uu} (${r}) http://www.pixijs.com/
1967
1967
 
1968
1968
  `,"background: #E72264; padding:5px 0;","background: #6CA2EA; padding:5px 0;","background: #B5D33D; padding:5px 0;","background: #FED23F; padding:5px 0;","color: #FFFFFF; background: #E72264; padding:5px 0;","color: #E72264; background: #FFFFFF; padding:5px 0;"];globalThis.console.log(...t)}else globalThis.console&&globalThis.console.log(`PixiJS ${Uu} - ${r} - http://www.pixijs.com/`);z_=!0}}class Ii{constructor(t){this._renderer=t}init(t){if(t.hello){let e=this._renderer.name;this._renderer.type===Tt.WEBGL&&(e+=` ${this._renderer.context.webGLVersion}`),j_(e)}}}Ii.extension={type:[v.WebGLSystem,v.WebGPUSystem,v.CanvasSystem],name:"hello",priority:-2},Ii.defaultOptions={hello:!1};var iA=Object.defineProperty,V_=Object.getOwnPropertySymbols,nA=Object.prototype.hasOwnProperty,oA=Object.prototype.propertyIsEnumerable,W_=(r,t,e)=>t in r?iA(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,Y_=(r,t)=>{for(var e in t||(t={}))nA.call(t,e)&&W_(r,e,t[e]);if(V_)for(var e of V_(t))oA.call(t,e)&&W_(r,e,t[e]);return r};const ku=class _b{constructor(t){this._renderer=t,this.count=0,this.checkCount=0}init(t){t=Y_(Y_({},_b.defaultOptions),t),this.checkCountMax=t.textureGCCheckCountMax,this.maxIdle=t.textureGCAMaxIdle,this.active=t.textureGCActive}postrender(){this._renderer.renderingToScreen&&(this.count++,this.active&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))}run(){const t=this._renderer.texture.managedTextures;for(let e=0;e<t.length;e++){const s=t[e];s.autoGarbageCollect&&s.resource&&s._touched>-1&&this.count-s._touched>this.maxIdle&&(s._touched=-1,s.unload())}}destroy(){this._renderer=null}};ku.extension={type:[v.WebGLSystem,v.WebGPUSystem],name:"textureGC"},ku.defaultOptions={textureGCActive:!0,textureGCAMaxIdle:60*60,textureGCCheckCountMax:600};let $u=ku;D.add($u);var aA=Object.defineProperty,K_=Object.getOwnPropertySymbols,uA=Object.prototype.hasOwnProperty,lA=Object.prototype.propertyIsEnumerable,q_=(r,t,e)=>t in r?aA(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,Z_=(r,t)=>{for(var e in t||(t={}))uA.call(t,e)&&q_(r,e,t[e]);if(K_)for(var e of K_(t))lA.call(t,e)&&q_(r,e,t[e]);return r};const Lu=class xb{get resolution(){return this.texture.source._resolution}set resolution(t){this.texture.source.resize(this.texture.source.width,this.texture.source.height,t)}init(t){t=Z_(Z_({},xb.defaultOptions),t),t.view&&(t.canvas=t.view),this.screen=new V(0,0,t.width,t.height),this.canvas=t.canvas||j.get().createCanvas(),this.antialias=!!t.antialias,this.texture=nu(this.canvas,t),this.renderTarget=new Ri({colorTextures:[this.texture],depth:!!t.depth,isRoot:!0}),this.texture.source.transparent=t.backgroundAlpha<1,this.multiView=!!t.multiView,this.autoDensity&&(this.canvas.style.width=`${this.texture.width}px`,this.canvas.style.height=`${this.texture.height}px`),this.resolution=t.resolution}resize(t,e,s){this.texture.source.resize(t,e,s),this.screen.width=this.texture.frame.width,this.screen.height=this.texture.frame.height,this.autoDensity&&(this.canvas.style.width=`${t}px`,this.canvas.style.height=`${e}px`)}destroy(t=!1){(typeof t=="boolean"?t:t!=null&&t.removeView)&&this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)}};Lu.extension={type:[v.WebGLSystem,v.WebGPUSystem,v.CanvasSystem],name:"view",priority:0},Lu.defaultOptions={width:800,height:600,autoDensity:!1,antialias:!1};let Q_=Lu;const Nu=[U_,Du,Ii,Q_,Ru,$u,Fu,L_,aa],Hu=[Cu,Na,Mu,Tu,Ha,za,Xa,vu],hA=[...Nu,iu,Ng,Bg,ja,_u,au,Ka,pu,du,Qa,b_,Ja,Za],cA=[...Hu],dA=[$a,bu,xu],J_=[],tx=[],ex=[];D.handleByNamedList(v.WebGLSystem,J_),D.handleByNamedList(v.WebGLPipes,tx),D.handleByNamedList(v.WebGLPipesAdaptor,ex),D.add(...hA,...cA,...dA);class rx extends Ur{constructor(){const t={name:"webgl",type:Tt.WEBGL,systems:J_,renderPipes:tx,renderPipeAdaptors:ex};super(t)}}var pA={__proto__:null,WebGLRenderer:rx};class Xu{constructor(t){this._hash=Object.create(null),this._renderer=t}contextChange(t){this._gpu=t}getBindGroup(t,e,s){return t._updateKey(),this._hash[t._key]||this._createBindGroup(t,e,s)}_createBindGroup(t,e,s){var i;const n=this._gpu.device,o=e.layout[s],a=[],u=this._renderer;for(const c in o){const d=(i=t.resources[c])!=null?i:t.resources[o[c]];let p;if(d._resourceType==="uniformGroup"){const f=d;u.ubo.updateUniformGroup(f);const g=f.buffer;p={buffer:u.buffer.getGPUBuffer(g),offset:0,size:g.descriptor.size}}else if(d._resourceType==="buffer"){const f=d;p={buffer:u.buffer.getGPUBuffer(f),offset:0,size:f.descriptor.size}}else if(d._resourceType==="bufferResource"){const f=d;p={buffer:u.buffer.getGPUBuffer(f.buffer),offset:f.offset,size:f.size}}else if(d._resourceType==="textureSampler"){const f=d;p=u.texture.getGpuSampler(f)}else if(d._resourceType==="textureSource"){const f=d;p=u.texture.getGpuSource(f).createView({})}a.push({binding:o[c],resource:p})}const l=u.shader.getProgramData(e).bindGroups[s],h=n.createBindGroup({layout:l,entries:a});return this._hash[t._key]=h,h}destroy(){for(const t of Object.keys(this._hash))this._hash[t]=null;this._hash=null,this._renderer=null}}Xu.extension={type:[v.WebGPUSystem],name:"bindGroup"};class zu{constructor(){this._gpuBuffers=Object.create(null),this._managedBuffers=[]}contextChange(t){this._gpu=t}getGPUBuffer(t){return this._gpuBuffers[t.uid]||this.createGPUBuffer(t)}updateBuffer(t){const e=this._gpuBuffers[t.uid]||this.createGPUBuffer(t),s=t.data;return t._updateID&&s&&(t._updateID=0,this._gpu.device.queue.writeBuffer(e,0,s.buffer,0,(t._updateSize||s.byteLength)+3&-4)),e}destroyAll(){for(const t in this._gpuBuffers)this._gpuBuffers[t].destroy();this._gpuBuffers={}}createGPUBuffer(t){this._gpuBuffers[t.uid]||(t.on("update",this.updateBuffer,this),t.on("change",this.onBufferChange,this),t.on("destroy",this.onBufferDestroy,this));const e=this._gpu.device.createBuffer(t.descriptor);return t._updateID=0,t.data&&(Es(t.data.buffer,e.getMappedRange()),e.unmap()),this._gpuBuffers[t.uid]=e,this._managedBuffers.push(t),e}onBufferChange(t){this._gpuBuffers[t.uid].destroy(),t._updateID=0,this._gpuBuffers[t.uid]=this.createGPUBuffer(t)}onBufferDestroy(t){this._managedBuffers.splice(this._managedBuffers.indexOf(t),1),this._destroyBuffer(t)}destroy(){this._managedBuffers.forEach(t=>this._destroyBuffer(t)),this._managedBuffers=null,this._gpuBuffers=null}_destroyBuffer(t){this._gpuBuffers[t.uid].destroy(),t.off("update",this.updateBuffer,this),t.off("change",this.onBufferChange,this),t.off("destroy",this.onBufferDestroy,this),this._gpuBuffers[t.uid]=null}}zu.extension={type:[v.WebGPUSystem],name:"buffer"};function fA(r,t){const e=r.descriptor.size,s=t.gpu.device,i=new bt({data:new Float32Array(24e5),usage:H.MAP_READ|H.COPY_DST}),n=t.buffer.createGPUBuffer(i),o=s.createCommandEncoder();o.copyBufferToBuffer(t.buffer.getGPUBuffer(r),0,n,0,e),s.queue.submit([o.finish()]),n.mapAsync(GPUMapMode.READ,0,e).then(()=>{n.getMappedRange(0,e),n.unmap()})}class sx{constructor({minUniformOffsetAlignment:t}){this._minUniformOffsetAlignment=256,this.byteIndex=0,this._minUniformOffsetAlignment=t,this.data=new Float32Array(65535)}clear(){this.byteIndex=0}addEmptyGroup(t){if(t>this._minUniformOffsetAlignment/4)throw new Error(`UniformBufferBatch: array is too large: ${t*4}`);const e=this.byteIndex;let s=e+t*4;if(s=Math.ceil(s/this._minUniformOffsetAlignment)*this._minUniformOffsetAlignment,s>this.data.length*4)throw new Error("UniformBufferBatch: ubo batch got too big");return this.byteIndex=s,e}addGroup(t){const e=this.addEmptyGroup(t.length);for(let s=0;s<t.length;s++)this.data[e/4+s]=t[s];return e}destroy(){this._buffer.destroy(),this._buffer=null,this.data=null}}class ju{constructor(t){this._colorMaskCache=15,this._renderer=t}setMask(t){this._colorMaskCache!==t&&(this._colorMaskCache=t,this._renderer.pipeline.setColorMask(t))}destroy(){this._renderer=null,this._colorMaskCache=null}}ju.extension={type:[v.WebGPUSystem],name:"colorMask"};class Bi{constructor(t){this._renderer=t}async init(t){return this._initPromise?this._initPromise:(this._initPromise=this._createDeviceAndAdaptor(t).then(e=>{this.gpu=e,this._renderer.runners.contextChange.emit(this.gpu)}),this._initPromise)}contextChange(t){this._renderer.gpu=t}async _createDeviceAndAdaptor(t){const e=await navigator.gpu.requestAdapter({powerPreference:t.powerPreference,forceFallbackAdapter:t.forceFallbackAdapter}),s=["texture-compression-bc","texture-compression-astc","texture-compression-etc2"].filter(n=>e.features.has(n)),i=await e.requestDevice({requiredFeatures:s});return{adapter:e,device:i}}destroy(){this.gpu=null,this._renderer=null}}Bi.extension={type:[v.WebGPUSystem],name:"device"},Bi.defaultOptions={powerPreference:void 0,forceFallbackAdapter:!1};var mA=Object.defineProperty,ix=Object.getOwnPropertySymbols,gA=Object.prototype.hasOwnProperty,_A=Object.prototype.propertyIsEnumerable,nx=(r,t,e)=>t in r?mA(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,ox=(r,t)=>{for(var e in t||(t={}))gA.call(t,e)&&nx(r,e,t[e]);if(ix)for(var e of ix(t))_A.call(t,e)&&nx(r,e,t[e]);return r};class Vu{constructor(t){this._boundBindGroup=Object.create(null),this._boundVertexBuffer=Object.create(null),this._renderer=t}renderStart(){this.commandFinished=new Promise(t=>{this._resolveCommandFinished=t}),this.commandEncoder=this._renderer.gpu.device.createCommandEncoder()}beginRenderPass(t){this.endRenderPass(),this._clearCache(),this.renderPassEncoder=this.commandEncoder.beginRenderPass(t.descriptor)}endRenderPass(){this.renderPassEncoder&&this.renderPassEncoder.end(),this.renderPassEncoder=null}setViewport(t){this.renderPassEncoder.setViewport(t.x,t.y,t.width,t.height,0,1)}setPipelineFromGeometryProgramAndState(t,e,s,i){const n=this._renderer.pipeline.getPipeline(t,e,s,i);this.setPipeline(n)}setPipeline(t){this._boundPipeline!==t&&(this._boundPipeline=t,this.renderPassEncoder.setPipeline(t))}_setVertexBuffer(t,e){this._boundVertexBuffer[t]!==e&&(this._boundVertexBuffer[t]=e,this.renderPassEncoder.setVertexBuffer(t,this._renderer.buffer.updateBuffer(e)))}_setIndexBuffer(t){if(this._boundIndexBuffer===t)return;this._boundIndexBuffer=t;const e=t.data.BYTES_PER_ELEMENT===2?"uint16":"uint32";this.renderPassEncoder.setIndexBuffer(this._renderer.buffer.updateBuffer(t),e)}resetBindGroup(t){this._boundBindGroup[t]=null}setBindGroup(t,e,s){if(this._boundBindGroup[t]===e)return;this._boundBindGroup[t]=e,e._touch(this._renderer.textureGC.count);const i=this._renderer.bindGroup.getBindGroup(e,s,t);this.renderPassEncoder.setBindGroup(t,i)}setGeometry(t){for(const e in t.attributes){const s=t.attributes[e];this._setVertexBuffer(s.location,s.buffer)}t.indexBuffer&&this._setIndexBuffer(t.indexBuffer)}_setShaderBindGroups(t,e){for(const s in t.groups){const i=t.groups[s];e||this._syncBindGroup(i),this.setBindGroup(s,i,t.gpuProgram)}}_syncBindGroup(t){for(const e in t.resources){const s=t.resources[e];s.isUniformGroup&&this._renderer.ubo.updateUniformGroup(s)}}draw(t){const{geometry:e,shader:s,state:i,topology:n,size:o,start:a,instanceCount:u,skipSync:l}=t;this.setPipelineFromGeometryProgramAndState(e,s.gpuProgram,i,n),this.setGeometry(e),this._setShaderBindGroups(s,l),e.indexBuffer?this.renderPassEncoder.drawIndexed(o||e.indexBuffer.data.length,u||e.instanceCount,a||0):this.renderPassEncoder.draw(o||e.getSize(),u||e.instanceCount,a||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 t=this._renderer.renderTarget.adaptor.getDescriptor(this._renderer.renderTarget.renderTarget,!1,[0,0,0,1]);this.renderPassEncoder=this.commandEncoder.beginRenderPass(t);const e=this._boundPipeline,s=ox({},this._boundVertexBuffer),i=this._boundIndexBuffer,n=ox({},this._boundBindGroup);this._clearCache();const o=this._renderer.renderTarget.viewport;this.renderPassEncoder.setViewport(o.x,o.y,o.width,o.height,0,1),this.setPipeline(e);for(const a in s)this._setVertexBuffer(a,s[a]);for(const a in n)this.setBindGroup(a,n[a],null);this._setIndexBuffer(i)}_clearCache(){for(let t=0;t<16;t++)this._boundBindGroup[t]=null,this._boundVertexBuffer[t]=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(t){this._gpu=t}}Vu.extension={type:[v.WebGPUSystem],name:"encoder",priority:1};class Wu{constructor(t){this._renderTargetStencilState=Object.create(null),this._renderer=t,t.renderTarget.onRenderTargetChange.add(this)}onRenderTargetChange(t){let e=this._renderTargetStencilState[t.uid];e||(e=this._renderTargetStencilState[t.uid]={stencilMode:st.DISABLED,stencilReference:0}),this._activeRenderTarget=t,this.setStencilMode(e.stencilMode,e.stencilReference)}setStencilMode(t,e){const s=this._renderTargetStencilState[this._activeRenderTarget.uid];s.stencilMode=t,s.stencilReference=e;const i=this._renderer;i.pipeline.setStencilMode(t),i.encoder.renderPassEncoder.setStencilReference(e)}destroy(){this._renderer.renderTarget.onRenderTargetChange.remove(this),this._renderer=null,this._activeRenderTarget=null,this._renderTargetStencilState=null}}Wu.extension={type:[v.WebGPUSystem],name:"stencil"};const Qr={i32:{align:4,size:4},u32:{align:4,size:4},f32:{align:4,size:4},f16:{align:2,size:2},"vec2<i32>":{align:8,size:8},"vec2<u32>":{align:8,size:8},"vec2<f32>":{align:8,size:8},"vec2<f16>":{align:4,size:4},"vec3<i32>":{align:16,size:12},"vec3<u32>":{align:16,size:12},"vec3<f32>":{align:16,size:12},"vec3<f16>":{align:8,size:6},"vec4<i32>":{align:16,size:16},"vec4<u32>":{align:16,size:16},"vec4<f32>":{align:16,size:16},"vec4<f16>":{align:8,size:8},"mat2x2<f32>":{align:8,size:16},"mat2x2<f16>":{align:4,size:8},"mat3x2<f32>":{align:8,size:24},"mat3x2<f16>":{align:4,size:12},"mat4x2<f32>":{align:8,size:32},"mat4x2<f16>":{align:4,size:16},"mat2x3<f32>":{align:16,size:32},"mat2x3<f16>":{align:8,size:16},"mat3x3<f32>":{align:16,size:48},"mat3x3<f16>":{align:8,size:24},"mat4x3<f32>":{align:16,size:64},"mat4x3<f16>":{align:8,size:32},"mat2x4<f32>":{align:16,size:32},"mat2x4<f16>":{align:8,size:16},"mat3x4<f32>":{align:16,size:48},"mat3x4<f16>":{align:8,size:24},"mat4x4<f32>":{align:16,size:64},"mat4x4<f16>":{align:8,size:32}};function ax(r){const t=r.map(s=>({data:s,offset:0,size:0}));let e=0;for(let s=0;s<t.length;s++){const i=t[s];let n=Qr[i.data.type].size;const o=Qr[i.data.type].align;if(!Qr[i.data.type])throw new Error(`[Pixi.js] WebGPU UniformBuffer: Unknown type ${i.data.type}`);i.data.size>1&&(n=Math.max(n,o)*i.data.size),e=Math.ceil(e/o)*o,i.size=n,i.offset=e,e+=n}return e=Math.ceil(e/16)*16,{uboElements:t,size:e}}function ux(r,t){const{size:e,align:s}=Qr[r.data.type],i=(s-e)/4;return`
1969
1969
  v = uv.${r.data.name};
package/dist/pixi.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * PixiJS - v8.2.0
3
- * Compiled Tue, 25 Jun 2024 11:06:28 UTC
2
+ * PixiJS - v8.2.1
3
+ * Compiled Tue, 25 Jun 2024 11:46:34 UTC
4
4
  *
5
5
  * PixiJS is licensed under the MIT License.
6
6
  * http://www.opensource.org/licenses/mit-license
@@ -39011,7 +39011,7 @@ GlobalUniformSystem.extension = {
39011
39011
 
39012
39012
  "use strict";
39013
39013
  let saidHello = false;
39014
- const VERSION = "8.2.0";
39014
+ const VERSION = "8.2.1";
39015
39015
  function sayHello(type) {
39016
39016
  if (saidHello) {
39017
39017
  return;
package/dist/webworker.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * PixiJS - v8.2.0
3
- * Compiled Tue, 25 Jun 2024 11:06:28 UTC
2
+ * PixiJS - v8.2.1
3
+ * Compiled Tue, 25 Jun 2024 11:46:34 UTC
4
4
  *
5
5
  * PixiJS is licensed under the MIT License.
6
6
  * http://www.opensource.org/licenses/mit-license
@@ -41271,7 +41271,7 @@ ${e}`);
41271
41271
 
41272
41272
  "use strict";
41273
41273
  let saidHello = false;
41274
- const VERSION = "8.2.0";
41274
+ const VERSION = "8.2.1";
41275
41275
  function sayHello(type) {
41276
41276
  if (saidHello) {
41277
41277
  return;
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * PixiJS - v8.2.0
3
- * Compiled Tue, 25 Jun 2024 11:06:28 UTC
2
+ * PixiJS - v8.2.1
3
+ * Compiled Tue, 25 Jun 2024 11:46:34 UTC
4
4
  *
5
5
  * PixiJS is licensed under the MIT License.
6
6
  * http://www.opensource.org/licenses/mit-license
@@ -1967,7 +1967,7 @@ fn setSaturation(c: vec3<f32>, s: f32) -> vec3<f32> {
1967
1967
  `))}class ol{constructor(t){this._cache={},this._uniformGroupSyncHash={},this._renderer=t,this.gl=null,this._cache={}}contextChange(t){this.gl=t}updateUniformGroup(t,e,i){const s=this._renderer.shader._getProgramData(e);(!t.isStatic||t._dirtyId!==s.uniformDirtyGroups[t.uid])&&(s.uniformDirtyGroups[t.uid]=t._dirtyId,this._getUniformSyncFunction(t,e)(s.uniformData,t.uniforms,this._renderer,i))}_getUniformSyncFunction(t,e){var i;return((i=this._uniformGroupSyncHash[t._signature])==null?void 0:i[e._key])||this._createUniformSyncFunction(t,e)}_createUniformSyncFunction(t,e){const i=this._uniformGroupSyncHash[t._signature]||(this._uniformGroupSyncHash[t._signature]={}),s=this._getSignature(t,e._uniformData,"u");return this._cache[s]||(this._cache[s]=this._generateUniformsSync(t,e._uniformData)),i[e._key]=this._cache[s],i[e._key]}_generateUniformsSync(t,e){return M0(t,e)}_getSignature(t,e,i){const s=t.uniforms,n=[`${i}-`];for(const a in s)n.push(a),e[a]&&n.push(e[a].type);return n.join("-")}destroy(){this._renderer=null,this._cache=null}}ol.extension={type:[v.WebGLSystem],name:"uniformGroup"};function KE(r){return r=r.replaceAll("texture2D","texture").replaceAll("gl_FragColor","finalColor").replaceAll("varying","in"),r=`
1968
1968
  out vec4 finalColor;
1969
1969
  ${r}
1970
- `,r}const ZE={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,uint:1,uvec2:2,uvec3:3,uvec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function QE(r){return ZE[r]}function D0(r){const t={};return t.normal=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t.add=[r.ONE,r.ONE],t.multiply=[r.DST_COLOR,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA],t.screen=[r.ONE,r.ONE_MINUS_SRC_COLOR,r.ONE,r.ONE_MINUS_SRC_ALPHA],t.none=[0,0],t["normal-npm"]=[r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA],t["add-npm"]=[r.SRC_ALPHA,r.ONE,r.ONE,r.ONE],t["screen-npm"]=[r.SRC_ALPHA,r.ONE_MINUS_SRC_COLOR,r.ONE,r.ONE_MINUS_SRC_ALPHA],t.erase=[r.ZERO,r.ONE_MINUS_SRC_ALPHA],t}const JE=0,t3=1,e3=2,r3=3,i3=4,s3=5,O0=class cc{constructor(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode="none",this._blendEq=!1,this.map=[],this.map[JE]=this.setBlend,this.map[t3]=this.setOffset,this.map[e3]=this.setCullFace,this.map[r3]=this.setDepthTest,this.map[i3]=this.setFrontFace,this.map[s3]=this.setDepthMask,this.checks=[],this.defaultState=Xt.for2d()}contextChange(t){this.gl=t,this.blendModesMap=D0(t),this.reset()}set(t){if(t=t||this.defaultState,this.stateId!==t.data){let e=this.stateId^t.data,i=0;for(;e;)e&1&&this.map[i].call(this,!!(t.data&1<<i)),e=e>>1,i++;this.stateId=t.data}for(let e=0;e<this.checks.length;e++)this.checks[e](this,t)}forceState(t){t=t||this.defaultState;for(let e=0;e<this.map.length;e++)this.map[e].call(this,!!(t.data&1<<e));for(let e=0;e<this.checks.length;e++)this.checks[e](this,t);this.stateId=t.data}setBlend(t){this._updateCheck(cc._checkBlendMode,t),this.gl[t?"enable":"disable"](this.gl.BLEND)}setOffset(t){this._updateCheck(cc._checkPolygonOffset,t),this.gl[t?"enable":"disable"](this.gl.POLYGON_OFFSET_FILL)}setDepthTest(t){this.gl[t?"enable":"disable"](this.gl.DEPTH_TEST)}setDepthMask(t){this.gl.depthMask(t)}setCullFace(t){this.gl[t?"enable":"disable"](this.gl.CULL_FACE)}setFrontFace(t){this.gl.frontFace(this.gl[t?"CW":"CCW"])}setBlendMode(t){if(this.blendModesMap[t]||(t="normal"),t===this.blendMode)return;this.blendMode=t;const e=this.blendModesMap[t],i=this.gl;e.length===2?i.blendFunc(e[0],e[1]):i.blendFuncSeparate(e[0],e[1],e[2],e[3]),e.length===6?(this._blendEq=!0,i.blendEquationSeparate(e[4],e[5])):this._blendEq&&(this._blendEq=!1,i.blendEquationSeparate(i.FUNC_ADD,i.FUNC_ADD))}setPolygonOffset(t,e){this.gl.polygonOffset(t,e)}reset(){this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,!1),this.forceState(this.defaultState),this._blendEq=!0,this.blendMode="",this.setBlendMode("normal")}_updateCheck(t,e){const i=this.checks.indexOf(t);e&&i===-1?this.checks.push(t):!e&&i!==-1&&this.checks.splice(i,1)}static _checkBlendMode(t,e){t.setBlendMode(e.blendMode)}static _checkPolygonOffset(t,e){t.setPolygonOffset(1,e.polygonOffset)}destroy(){this.gl=null,this.checks.length=0}};O0.extension={type:[v.WebGLSystem],name:"state"};let B0=O0;class G0{constructor(t){this.target=Hu.TEXTURE_2D,this.texture=t,this.width=-1,this.height=-1,this.type=z.UNSIGNED_BYTE,this.internalFormat=dn.RGBA,this.format=dn.RGBA,this.samplerType=0}}const F0={id:"buffer",upload(r,t,e){t.width===r.width||t.height===r.height?e.texSubImage2D(e.TEXTURE_2D,0,0,0,r.width,r.height,t.format,t.type,r.resource):e.texImage2D(t.target,0,t.internalFormat,r.width,r.height,0,t.format,t.type,r.resource),t.width=r.width,t.height=r.height}},n3={"bc1-rgba-unorm":!0,"bc1-rgba-unorm-srgb":!0,"bc2-rgba-unorm":!0,"bc2-rgba-unorm-srgb":!0,"bc3-rgba-unorm":!0,"bc3-rgba-unorm-srgb":!0,"bc4-r-unorm":!0,"bc4-r-snorm":!0,"bc5-rg-unorm":!0,"bc5-rg-snorm":!0,"bc6h-rgb-ufloat":!0,"bc6h-rgb-float":!0,"bc7-rgba-unorm":!0,"bc7-rgba-unorm-srgb":!0,"etc2-rgb8unorm":!0,"etc2-rgb8unorm-srgb":!0,"etc2-rgb8a1unorm":!0,"etc2-rgb8a1unorm-srgb":!0,"etc2-rgba8unorm":!0,"etc2-rgba8unorm-srgb":!0,"eac-r11unorm":!0,"eac-r11snorm":!0,"eac-rg11unorm":!0,"eac-rg11snorm":!0,"astc-4x4-unorm":!0,"astc-4x4-unorm-srgb":!0,"astc-5x4-unorm":!0,"astc-5x4-unorm-srgb":!0,"astc-5x5-unorm":!0,"astc-5x5-unorm-srgb":!0,"astc-6x5-unorm":!0,"astc-6x5-unorm-srgb":!0,"astc-6x6-unorm":!0,"astc-6x6-unorm-srgb":!0,"astc-8x5-unorm":!0,"astc-8x5-unorm-srgb":!0,"astc-8x6-unorm":!0,"astc-8x6-unorm-srgb":!0,"astc-8x8-unorm":!0,"astc-8x8-unorm-srgb":!0,"astc-10x5-unorm":!0,"astc-10x5-unorm-srgb":!0,"astc-10x6-unorm":!0,"astc-10x6-unorm-srgb":!0,"astc-10x8-unorm":!0,"astc-10x8-unorm-srgb":!0,"astc-10x10-unorm":!0,"astc-10x10-unorm-srgb":!0,"astc-12x10-unorm":!0,"astc-12x10-unorm-srgb":!0,"astc-12x12-unorm":!0,"astc-12x12-unorm-srgb":!0},I0={id:"compressed",upload(r,t,e){e.pixelStorei(e.UNPACK_ALIGNMENT,4);let i=r.pixelWidth,s=r.pixelHeight;const n=!!n3[r.format];for(let a=0;a<r.resource.length;a++){const o=r.resource[a];n?e.compressedTexImage2D(e.TEXTURE_2D,a,t.internalFormat,i,s,0,o):e.texImage2D(e.TEXTURE_2D,a,t.internalFormat,i,s,0,t.format,t.type,o),i=Math.max(i>>1,1),s=Math.max(s>>1,1)}}},ul={id:"image",upload(r,t,e,i){const s=r.alphaMode==="premultiply-alpha-on-upload";e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,s);const n=t.width,a=t.height,o=r.pixelWidth,u=r.pixelHeight,l=r.resourceWidth,c=r.resourceHeight;l<o||c<u?((n!==o||a!==u)&&e.texImage2D(t.target,0,t.internalFormat,o,u,0,t.format,t.type,null),i===2?e.texSubImage2D(e.TEXTURE_2D,0,0,0,l,c,t.format,t.type,r.resource):e.texSubImage2D(e.TEXTURE_2D,0,0,0,t.format,t.type,r.resource)):n===o||a===u?e.texSubImage2D(e.TEXTURE_2D,0,0,0,t.format,t.type,r.resource):i===2?e.texImage2D(t.target,0,t.internalFormat,o,u,0,t.format,t.type,r.resource):e.texImage2D(t.target,0,t.internalFormat,t.format,t.type,r.resource),t.width=o,t.height=u}},U0={id:"video",upload(r,t,e,i){if(!r.isValid){e.texImage2D(t.target,0,t.internalFormat,1,1,0,t.format,t.type,null);return}ul.upload(r,t,e,i)}},ll={linear:9729,nearest:9728},N0={linear:{linear:9987,nearest:9985},nearest:{linear:9986,nearest:9984}},_n={"clamp-to-edge":33071,repeat:10497,"mirror-repeat":33648},k0={never:512,less:513,equal:514,"less-equal":515,greater:516,"not-equal":517,"greater-equal":518,always:519};function cl(r,t,e,i,s,n,a,o){const u=n;if(!o||r.addressModeU!=="repeat"||r.addressModeV!=="repeat"||r.addressModeW!=="repeat"){const l=_n[a?"clamp-to-edge":r.addressModeU],c=_n[a?"clamp-to-edge":r.addressModeV],h=_n[a?"clamp-to-edge":r.addressModeW];t[s](u,t.TEXTURE_WRAP_S,l),t[s](u,t.TEXTURE_WRAP_T,c),t.TEXTURE_WRAP_R&&t[s](u,t.TEXTURE_WRAP_R,h)}if((!o||r.magFilter!=="linear")&&t[s](u,t.TEXTURE_MAG_FILTER,ll[r.magFilter]),e){if(!o||r.mipmapFilter!=="linear"){const l=N0[r.minFilter][r.mipmapFilter];t[s](u,t.TEXTURE_MIN_FILTER,l)}}else t[s](u,t.TEXTURE_MIN_FILTER,ll[r.minFilter]);if(i&&r.maxAnisotropy>1){const l=Math.min(r.maxAnisotropy,t.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY_EXT));t[s](u,i.TEXTURE_MAX_ANISOTROPY_EXT,l)}r.compare&&t[s](u,t.TEXTURE_COMPARE_FUNC,k0[r.compare])}function L0(r){return{r8unorm:r.RED,r8snorm:r.RED,r8uint:r.RED,r8sint:r.RED,r16uint:r.RED,r16sint:r.RED,r16float:r.RED,rg8unorm:r.RG,rg8snorm:r.RG,rg8uint:r.RG,rg8sint:r.RG,r32uint:r.RED,r32sint:r.RED,r32float:r.RED,rg16uint:r.RG,rg16sint:r.RG,rg16float:r.RG,rgba8unorm:r.RGBA,"rgba8unorm-srgb":r.RGBA,rgba8snorm:r.RGBA,rgba8uint:r.RGBA,rgba8sint:r.RGBA,bgra8unorm:r.RGBA,"bgra8unorm-srgb":r.RGBA,rgb9e5ufloat:r.RGB,rgb10a2unorm:r.RGBA,rg11b10ufloat:r.RGB,rg32uint:r.RG,rg32sint:r.RG,rg32float:r.RG,rgba16uint:r.RGBA,rgba16sint:r.RGBA,rgba16float:r.RGBA,rgba32uint:r.RGBA,rgba32sint:r.RGBA,rgba32float:r.RGBA,stencil8:r.STENCIL_INDEX8,depth16unorm:r.DEPTH_COMPONENT,depth24plus:r.DEPTH_COMPONENT,"depth24plus-stencil8":r.DEPTH_STENCIL,depth32float:r.DEPTH_COMPONENT,"depth32float-stencil8":r.DEPTH_STENCIL}}var a3=Object.defineProperty,o3=Object.defineProperties,u3=Object.getOwnPropertyDescriptors,$0=Object.getOwnPropertySymbols,l3=Object.prototype.hasOwnProperty,c3=Object.prototype.propertyIsEnumerable,H0=(r,t,e)=>t in r?a3(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,Ue=(r,t)=>{for(var e in t||(t={}))l3.call(t,e)&&H0(r,e,t[e]);if($0)for(var e of $0(t))c3.call(t,e)&&H0(r,e,t[e]);return r},h3=(r,t)=>o3(r,u3(t));function X0(r,t){let e={},i=r.RGBA;return r instanceof j.get().getWebGLRenderingContext()?t.srgb&&(e={"rgba8unorm-srgb":t.srgb.SRGB8_ALPHA8_EXT,"bgra8unorm-srgb":t.srgb.SRGB8_ALPHA8_EXT}):(e={"rgba8unorm-srgb":r.SRGB8_ALPHA8,"bgra8unorm-srgb":r.SRGB8_ALPHA8},i=r.RGBA8),Ue(Ue(Ue(Ue(Ue(Ue(h3(Ue({r8unorm:r.R8,r8snorm:r.R8_SNORM,r8uint:r.R8UI,r8sint:r.R8I,r16uint:r.R16UI,r16sint:r.R16I,r16float:r.R16F,rg8unorm:r.RG8,rg8snorm:r.RG8_SNORM,rg8uint:r.RG8UI,rg8sint:r.RG8I,r32uint:r.R32UI,r32sint:r.R32I,r32float:r.R32F,rg16uint:r.RG16UI,rg16sint:r.RG16I,rg16float:r.RG16F,rgba8unorm:r.RGBA},e),{rgba8snorm:r.RGBA8_SNORM,rgba8uint:r.RGBA8UI,rgba8sint:r.RGBA8I,bgra8unorm:i,rgb9e5ufloat:r.RGB9_E5,rgb10a2unorm:r.RGB10_A2,rg11b10ufloat:r.R11F_G11F_B10F,rg32uint:r.RG32UI,rg32sint:r.RG32I,rg32float:r.RG32F,rgba16uint:r.RGBA16UI,rgba16sint:r.RGBA16I,rgba16float:r.RGBA16F,rgba32uint:r.RGBA32UI,rgba32sint:r.RGBA32I,rgba32float:r.RGBA32F,stencil8:r.STENCIL_INDEX8,depth16unorm:r.DEPTH_COMPONENT16,depth24plus:r.DEPTH_COMPONENT24,"depth24plus-stencil8":r.DEPTH24_STENCIL8,depth32float:r.DEPTH_COMPONENT32F,"depth32float-stencil8":r.DEPTH32F_STENCIL8}),t.s3tc?{"bc1-rgba-unorm":t.s3tc.COMPRESSED_RGBA_S3TC_DXT1_EXT,"bc2-rgba-unorm":t.s3tc.COMPRESSED_RGBA_S3TC_DXT3_EXT,"bc3-rgba-unorm":t.s3tc.COMPRESSED_RGBA_S3TC_DXT5_EXT}:{}),t.s3tc_sRGB?{"bc1-rgba-unorm-srgb":t.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,"bc2-rgba-unorm-srgb":t.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,"bc3-rgba-unorm-srgb":t.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}:{}),t.rgtc?{"bc4-r-unorm":t.rgtc.COMPRESSED_RED_RGTC1_EXT,"bc4-r-snorm":t.rgtc.COMPRESSED_SIGNED_RED_RGTC1_EXT,"bc5-rg-unorm":t.rgtc.COMPRESSED_RED_GREEN_RGTC2_EXT,"bc5-rg-snorm":t.rgtc.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}:{}),t.bptc?{"bc6h-rgb-float":t.bptc.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,"bc6h-rgb-ufloat":t.bptc.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,"bc7-rgba-unorm":t.bptc.COMPRESSED_RGBA_BPTC_UNORM_EXT,"bc7-rgba-unorm-srgb":t.bptc.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT}:{}),t.etc?{"etc2-rgb8unorm":t.etc.COMPRESSED_RGB8_ETC2,"etc2-rgb8unorm-srgb":t.etc.COMPRESSED_SRGB8_ETC2,"etc2-rgb8a1unorm":t.etc.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,"etc2-rgb8a1unorm-srgb":t.etc.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,"etc2-rgba8unorm":t.etc.COMPRESSED_RGBA8_ETC2_EAC,"etc2-rgba8unorm-srgb":t.etc.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,"eac-r11unorm":t.etc.COMPRESSED_R11_EAC,"eac-rg11unorm":t.etc.COMPRESSED_SIGNED_RG11_EAC}:{}),t.astc?{"astc-4x4-unorm":t.astc.COMPRESSED_RGBA_ASTC_4x4_KHR,"astc-4x4-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,"astc-5x4-unorm":t.astc.COMPRESSED_RGBA_ASTC_5x4_KHR,"astc-5x4-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR,"astc-5x5-unorm":t.astc.COMPRESSED_RGBA_ASTC_5x5_KHR,"astc-5x5-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,"astc-6x5-unorm":t.astc.COMPRESSED_RGBA_ASTC_6x5_KHR,"astc-6x5-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,"astc-6x6-unorm":t.astc.COMPRESSED_RGBA_ASTC_6x6_KHR,"astc-6x6-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,"astc-8x5-unorm":t.astc.COMPRESSED_RGBA_ASTC_8x5_KHR,"astc-8x5-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,"astc-8x6-unorm":t.astc.COMPRESSED_RGBA_ASTC_8x6_KHR,"astc-8x6-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,"astc-8x8-unorm":t.astc.COMPRESSED_RGBA_ASTC_8x8_KHR,"astc-8x8-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,"astc-10x5-unorm":t.astc.COMPRESSED_RGBA_ASTC_10x5_KHR,"astc-10x5-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,"astc-10x6-unorm":t.astc.COMPRESSED_RGBA_ASTC_10x6_KHR,"astc-10x6-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,"astc-10x8-unorm":t.astc.COMPRESSED_RGBA_ASTC_10x8_KHR,"astc-10x8-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,"astc-10x10-unorm":t.astc.COMPRESSED_RGBA_ASTC_10x10_KHR,"astc-10x10-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,"astc-12x10-unorm":t.astc.COMPRESSED_RGBA_ASTC_12x10_KHR,"astc-12x10-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,"astc-12x12-unorm":t.astc.COMPRESSED_RGBA_ASTC_12x12_KHR,"astc-12x12-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR}:{})}function z0(r){return{r8unorm:r.UNSIGNED_BYTE,r8snorm:r.BYTE,r8uint:r.UNSIGNED_BYTE,r8sint:r.BYTE,r16uint:r.UNSIGNED_SHORT,r16sint:r.SHORT,r16float:r.HALF_FLOAT,rg8unorm:r.UNSIGNED_BYTE,rg8snorm:r.BYTE,rg8uint:r.UNSIGNED_BYTE,rg8sint:r.BYTE,r32uint:r.UNSIGNED_INT,r32sint:r.INT,r32float:r.FLOAT,rg16uint:r.UNSIGNED_SHORT,rg16sint:r.SHORT,rg16float:r.HALF_FLOAT,rgba8unorm:r.UNSIGNED_BYTE,"rgba8unorm-srgb":r.UNSIGNED_BYTE,rgba8snorm:r.BYTE,rgba8uint:r.UNSIGNED_BYTE,rgba8sint:r.BYTE,bgra8unorm:r.UNSIGNED_BYTE,"bgra8unorm-srgb":r.UNSIGNED_BYTE,rgb9e5ufloat:r.UNSIGNED_INT_5_9_9_9_REV,rgb10a2unorm:r.UNSIGNED_INT_2_10_10_10_REV,rg11b10ufloat:r.UNSIGNED_INT_10F_11F_11F_REV,rg32uint:r.UNSIGNED_INT,rg32sint:r.INT,rg32float:r.FLOAT,rgba16uint:r.UNSIGNED_SHORT,rgba16sint:r.SHORT,rgba16float:r.HALF_FLOAT,rgba32uint:r.UNSIGNED_INT,rgba32sint:r.INT,rgba32float:r.FLOAT,stencil8:r.UNSIGNED_BYTE,depth16unorm:r.UNSIGNED_SHORT,depth24plus:r.UNSIGNED_INT,"depth24plus-stencil8":r.UNSIGNED_INT_24_8,depth32float:r.FLOAT,"depth32float-stencil8":r.FLOAT_32_UNSIGNED_INT_24_8_REV}}function d3(r){r instanceof Uint8ClampedArray&&(r=new Uint8Array(r.buffer));const t=r.length;for(let e=0;e<t;e+=4){const i=r[e+3];if(i!==0){const s=255.001/i;r[e]=r[e]*s+.5,r[e+1]=r[e+1]*s+.5,r[e+2]=r[e+2]*s+.5}}}const f3=4;class hl{constructor(t){this.managedTextures=[],this._glTextures=Object.create(null),this._glSamplers=Object.create(null),this._boundTextures=[],this._activeTextureLocation=-1,this._boundSamplers=Object.create(null),this._uploads={image:ul,buffer:F0,video:U0,compressed:I0},this._useSeparateSamplers=!1,this._renderer=t}contextChange(t){this._gl=t,this._mapFormatToInternalFormat||(this._mapFormatToInternalFormat=X0(t,this._renderer.context.extensions),this._mapFormatToType=z0(t),this._mapFormatToFormat=L0(t)),this._glTextures=Object.create(null),this._glSamplers=Object.create(null),this._boundSamplers=Object.create(null);for(let e=0;e<16;e++)this.bind(w.EMPTY,e)}initSource(t){this.bind(t)}bind(t,e=0){const i=t.source;t?(this.bindSource(i,e),this._useSeparateSamplers&&this._bindSampler(i.style,e)):(this.bindSource(null,e),this._useSeparateSamplers&&this._bindSampler(null,e))}bindSource(t,e=0){const i=this._gl;if(t._touched=this._renderer.textureGC.count,this._boundTextures[e]!==t){this._boundTextures[e]=t,this._activateLocation(e),t=t||w.EMPTY.source;const s=this.getGlSource(t);i.bindTexture(s.target,s.texture)}}_bindSampler(t,e=0){const i=this._gl;if(!t){this._boundSamplers[e]=null,i.bindSampler(e,null);return}const s=this._getGlSampler(t);this._boundSamplers[e]!==s&&(this._boundSamplers[e]=s,i.bindSampler(e,s))}unbind(t){const e=t.source,i=this._boundTextures,s=this._gl;for(let n=0;n<i.length;n++)if(i[n]===e){this._activateLocation(n);const a=this.getGlSource(e);s.bindTexture(a.target,null),i[n]=null}}_activateLocation(t){this._activeTextureLocation!==t&&(this._activeTextureLocation=t,this._gl.activeTexture(this._gl.TEXTURE0+t))}_initSource(t){const e=this._gl,i=new G0(e.createTexture());if(i.type=this._mapFormatToType[t.format],i.internalFormat=this._mapFormatToInternalFormat[t.format],i.format=this._mapFormatToFormat[t.format],t.autoGenerateMipmaps&&(this._renderer.context.supports.nonPowOf2mipmaps||t.isPowerOfTwo)){const s=Math.max(t.width,t.height);t.mipLevelCount=Math.floor(Math.log2(s))+1}return this._glTextures[t.uid]=i,this.managedTextures.includes(t)||(t.on("update",this.onSourceUpdate,this),t.on("resize",this.onSourceUpdate,this),t.on("styleChange",this.onStyleChange,this),t.on("destroy",this.onSourceDestroy,this),t.on("unload",this.onSourceUnload,this),t.on("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.push(t)),this.onSourceUpdate(t),this.updateStyle(t,!1),i}onStyleChange(t){this.updateStyle(t,!1)}updateStyle(t,e){const i=this._gl,s=this.getGlSource(t);i.bindTexture(i.TEXTURE_2D,s.texture),this._boundTextures[this._activeTextureLocation]=t,cl(t.style,i,t.mipLevelCount>1,this._renderer.context.extensions.anisotropicFiltering,"texParameteri",i.TEXTURE_2D,!this._renderer.context.supports.nonPowOf2wrapping&&!t.isPowerOfTwo,e)}onSourceUnload(t){const e=this._glTextures[t.uid];e&&(this.unbind(t),this._glTextures[t.uid]=null,this._gl.deleteTexture(e.texture))}onSourceUpdate(t){const e=this._gl,i=this.getGlSource(t);e.bindTexture(e.TEXTURE_2D,i.texture),this._boundTextures[this._activeTextureLocation]=t,this._uploads[t.uploadMethodId]?this._uploads[t.uploadMethodId].upload(t,i,e,this._renderer.context.webGLVersion):e.texImage2D(e.TEXTURE_2D,0,e.RGBA,t.pixelWidth,t.pixelHeight,0,e.RGBA,e.UNSIGNED_BYTE,null),t.autoGenerateMipmaps&&t.mipLevelCount>1&&this.onUpdateMipmaps(t,!1)}onUpdateMipmaps(t,e=!0){e&&this.bindSource(t,0);const i=this.getGlSource(t);this._gl.generateMipmap(i.target)}onSourceDestroy(t){t.off("destroy",this.onSourceDestroy,this),t.off("update",this.onSourceUpdate,this),t.off("resize",this.onSourceUpdate,this),t.off("unload",this.onSourceUnload,this),t.off("styleChange",this.onStyleChange,this),t.off("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.splice(this.managedTextures.indexOf(t),1),this.onSourceUnload(t)}_initSampler(t){const e=this._gl,i=this._gl.createSampler();return this._glSamplers[t._resourceId]=i,cl(t,e,this._boundTextures[this._activeTextureLocation].mipLevelCount>1,this._renderer.context.extensions.anisotropicFiltering,"samplerParameteri",i,!1,!0),this._glSamplers[t._resourceId]}_getGlSampler(t){return this._glSamplers[t._resourceId]||this._initSampler(t)}getGlSource(t){return this._glTextures[t.uid]||this._initSource(t)}generateCanvas(t){const{pixels:e,width:i,height:s}=this.getPixels(t),n=j.get().createCanvas();n.width=i,n.height=s;const a=n.getContext("2d");if(a){const o=a.createImageData(i,s);o.data.set(e),a.putImageData(o,0,0)}return n}getPixels(t){const e=t.source.resolution,i=t.frame,s=Math.max(Math.round(i.width*e),1),n=Math.max(Math.round(i.height*e),1),a=new Uint8Array(f3*s*n),o=this._renderer,u=o.renderTarget.getRenderTarget(t),l=o.renderTarget.getGpuRenderTarget(u),c=o.gl;return c.bindFramebuffer(c.FRAMEBUFFER,l.resolveTargetFramebuffer),c.readPixels(Math.round(i.x*e),Math.round(i.y*e),s,n,c.RGBA,c.UNSIGNED_BYTE,a),{pixels:new Uint8ClampedArray(a.buffer),width:s,height:n}}destroy(){this.managedTextures.slice().forEach(t=>this.onSourceDestroy(t)),this.managedTextures=null,this._renderer=null}}hl.extension={type:[v.WebGLSystem],name:"texture"};class dl{init(){const t=new ut({uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uTransformMatrix:{value:new G,type:"mat3x3<f32>"},uRound:{value:0,type:"f32"}}),e=Ht(),i=lr({name:"graphics",bits:[Ps,Ds(e),Is,hr]});this.shader=new Ot({glProgram:i,resources:{localUniforms:t,batchSamplers:Os(e)}})}execute(t,e){const i=e.context,s=i.customShader||this.shader,n=t.renderer,a=n.graphicsContext,{geometry:o,instructions:u}=a.getContextRenderData(i);s.groups[0]=n.globalUniforms.bindGroup,n.state.set(t.state),n.shader.bind(s),n.geometry.bind(o,s.glProgram);const l=u.instructions;for(let c=0;c<u.instructionSize;c++){const h=l[c];if(h.size){for(let f=0;f<h.textures.textures.length;f++)n.texture.bind(h.textures.textures[f],f);n.geometry.draw("triangle-list",h.size,h.start)}}}destroy(){this.shader.destroy(!0),this.shader=null}}dl.extension={type:[v.WebGLPipesAdaptor],name:"graphics"};class fl{init(){const t=lr({name:"mesh",bits:[Is,$_,hr]});this._shader=new Ot({glProgram:t,resources:{uTexture:w.EMPTY.source,textureUniforms:{uTextureMatrix:{type:"mat3x3<f32>",value:new G}}}})}execute(t,e){const i=t.renderer;let s=e._shader;if(s){if(!s.glProgram)return}else{s=this._shader;const n=e.texture,a=n.source;s.resources.uTexture=a,s.resources.uSampler=a.style,s.resources.textureUniforms.uniforms.uTextureMatrix=n.textureMatrix.mapCoord}s.groups[100]=i.globalUniforms.bindGroup,s.groups[101]=t.localUniformsBindGroup,i.encoder.draw({geometry:e._geometry,shader:s,state:e.state})}destroy(){this._shader.destroy(!0),this._shader=null}}fl.extension={type:[v.WebGLPipesAdaptor],name:"mesh"};class pl{constructor(t){this._renderer=t}addRenderable(t,e){this._renderer.renderPipes.batch.break(e),e.add(t)}execute(t){t.isRenderable&&t.render(this._renderer)}destroy(){this._renderer=null}}pl.extension={type:[v.WebGLPipes,v.WebGPUPipes,v.CanvasPipes],name:"customRender"};function ml(r,t){const e=r.instructionSet,i=e.instructions;for(let s=0;s<e.instructionSize;s++){const n=i[s];t[n.renderPipeId].execute(n)}}class gl{constructor(t){this._renderer=t}addRenderGroup(t,e){this._renderer.renderPipes.batch.break(e),e.add(t)}execute(t){t.isRenderable&&(this._renderer.globalUniforms.push({worldTransformMatrix:t.worldTransform,worldColor:t.worldColorAlpha}),ml(t,this._renderer.renderPipes),this._renderer.globalUniforms.pop())}destroy(){this._renderer=null}}gl.extension={type:[v.WebGLPipes,v.WebGPUPipes,v.CanvasPipes],name:"renderGroup"};function _l(r,t=[]){t.push(r);for(let e=0;e<r.renderGroupChildren.length;e++)_l(r.renderGroupChildren[e],t);return t}function bl(r,t,e){const i=r>>16&255,s=r>>8&255,n=r&255,a=t>>16&255,o=t>>8&255,u=t&255,l=i+(a-i)*e,c=s+(o-s)*e,h=n+(u-n)*e;return(l<<16)+(c<<8)+h}const yr=16777215;function xl(r,t){return r===yr||t===yr?r+t-yr:bl(r,t,.5)}function p3(r,t,e){const i=(e>>24&255)/255,s=t*i*255,n=((r&255)<<16)+(r&65280)+(r>>16&255),a=e&16777215;let o;return n===yr||a===yr?o=n+a-yr:o=bl(n,a,.5),o+(s<<24)}const m3=new Z;function yl(r,t=!1){j0(r);const e=r.childrenToUpdate,i=r.updateTick++;for(const s in e){const n=Number(s),a=e[s],o=a.list,u=a.index;for(let l=0;l<u;l++){const c=o[l];c.parentRenderGroup===r&&c.relativeRenderGroupDepth===n&&vl(c,i,0)}a.index=0}if(t)for(let s=0;s<r.renderGroupChildren.length;s++)yl(r.renderGroupChildren[s],t)}function j0(r){const t=r.root;let e;if(r.renderGroupParent){const i=r.renderGroupParent;r.worldTransform.appendFrom(t.relativeGroupTransform,i.worldTransform),r.worldColor=xl(t.groupColor,i.worldColor),e=t.groupAlpha*i.worldAlpha}else r.worldTransform.copyFrom(t.localTransform),r.worldColor=t.localColor,e=t.localAlpha;e=e<0?0:e>1?1:e,r.worldAlpha=e,r.worldColorAlpha=r.worldColor+((e*255|0)<<24)}function vl(r,t,e){if(t===r.updateTick)return;r.updateTick=t,r.didChange=!1;const i=r.localTransform;r.updateLocalTransform();const s=r.parent;if(s&&!s.renderGroup?(e=e|r._updateFlags,r.relativeGroupTransform.appendFrom(i,s.relativeGroupTransform),e&&V0(r,s,e)):(e=r._updateFlags,r.relativeGroupTransform.copyFrom(i),e&&V0(r,m3,e)),!r.renderGroup){const n=r.children,a=n.length;for(let u=0;u<a;u++)vl(n[u],t,e);const o=r.parentRenderGroup;r.renderPipeId&&!o.structureDidChange&&o.updateRenderable(r)}}function V0(r,t,e){if(e&Ji){r.groupColor=xl(r.localColor,t.groupColor);let i=r.localAlpha*t.groupAlpha;i=i<0?0:i>1?1:i,r.groupAlpha=i,r.groupColorAlpha=r.groupColor+((i*255|0)<<24)}e&da&&(r.groupBlendMode=r.localBlendMode==="inherit"?t.groupBlendMode:r.localBlendMode),e&Xr&&(r.globalDisplayStatus=r.localDisplayStatus&t.globalDisplayStatus),r._updateFlags=0}function W0(r,t){const{list:e,index:i}=r.childrenRenderablesToUpdate;let s=!1;for(let n=0;n<i;n++){const a=e[n];if(s=t[a.renderPipeId].validateRenderable(a),s)break}return r.structureDidChange=s,s}const g3=new G;class Tl{constructor(t){this._renderer=t}render({container:t,transform:e}){t.isRenderGroup=!0;const i=t.parent,s=t.renderGroup.renderGroupParent;t.parent=null,t.renderGroup.renderGroupParent=null;const n=this._renderer,a=_l(t.renderGroup,[]);let o=g3;e&&(o=o.copyFrom(t.renderGroup.localTransform),t.renderGroup.localTransform.copyFrom(e));const u=n.renderPipes;for(let l=0;l<a.length;l++){const c=a[l];c.runOnRender(),c.instructionSet.renderPipes=u,c.structureDidChange||W0(c,u),yl(c),c.structureDidChange?(c.structureDidChange=!1,H_(c,u)):_3(c),c.childrenRenderablesToUpdate.index=0,n.renderPipes.batch.upload(c.instructionSet)}n.globalUniforms.start({worldTransformMatrix:e?t.renderGroup.localTransform:t.renderGroup.worldTransform,worldColor:t.renderGroup.worldColorAlpha}),ml(t.renderGroup,u),u.uniformBatch&&u.uniformBatch.renderEnd(),e&&t.renderGroup.localTransform.copyFrom(o),t.parent=i,t.renderGroup.renderGroupParent=s}destroy(){this._renderer=null}}Tl.extension={type:[v.WebGLSystem,v.WebGPUSystem,v.CanvasSystem],name:"renderGroup"};function _3(r){const{list:t,index:e}=r.childrenRenderablesToUpdate;for(let i=0;i<e;i++){const s=t[i];s.didViewUpdate&&r.updateRenderable(s)}}class Sl{constructor(t){this._gpuSpriteHash=Object.create(null),this._renderer=t}addRenderable(t,e){const i=this._getGpuSprite(t);t._didSpriteUpdate&&this._updateBatchableSprite(t,i),this._renderer.renderPipes.batch.addToBatch(i)}updateRenderable(t){const e=this._gpuSpriteHash[t.uid];t._didSpriteUpdate&&this._updateBatchableSprite(t,e),e.batcher.updateElement(e)}validateRenderable(t){const e=t._texture,i=this._getGpuSprite(t);return i.texture._source!==e._source?!i.batcher.checkAndUpdateTexture(i,e):!1}destroyRenderable(t){const e=this._gpuSpriteHash[t.uid];H.return(e),this._gpuSpriteHash[t.uid]=null}_updateBatchableSprite(t,e){t._didSpriteUpdate=!1,e.bounds=t.bounds,e.texture=t._texture}_getGpuSprite(t){return this._gpuSpriteHash[t.uid]||this._initGPUSprite(t)}_initGPUSprite(t){const e=H.get(_s);return e.renderable=t,e.texture=t._texture,e.bounds=t.bounds,e.roundPixels=this._renderer._roundPixels|t._roundPixels,this._gpuSpriteHash[t.uid]=e,t._didSpriteUpdate=!1,t.on("destroyed",()=>{this.destroyRenderable(t)}),e}destroy(){for(const t in this._gpuSpriteHash)H.return(this._gpuSpriteHash[t]);this._gpuSpriteHash=null,this._renderer=null}}Sl.extension={type:[v.WebGLPipes,v.WebGPUPipes,v.CanvasPipes],name:"sprite"};var b3=Object.defineProperty,Y0=Object.getOwnPropertySymbols,x3=Object.prototype.hasOwnProperty,y3=Object.prototype.propertyIsEnumerable,q0=(r,t,e)=>t in r?b3(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,K0=(r,t)=>{for(var e in t||(t={}))x3.call(t,e)&&q0(r,e,t[e]);if(Y0)for(var e of Y0(t))y3.call(t,e)&&q0(r,e,t[e]);return r};const Al=class Vb{constructor(){this.clearBeforeRender=!0,this._backgroundColor=new V(0),this.color=this._backgroundColor,this.alpha=1}init(t){t=K0(K0({},Vb.defaultOptions),t),this.clearBeforeRender=t.clearBeforeRender,this.color=t.background||t.backgroundColor||this._backgroundColor,this.alpha=t.backgroundAlpha,this._backgroundColor.setAlpha(t.backgroundAlpha)}get color(){return this._backgroundColor}set color(t){this._backgroundColor.setValue(t)}get alpha(){return this._backgroundColor.alpha}set alpha(t){this._backgroundColor.setAlpha(t)}get colorRgba(){return this._backgroundColor.toArray()}destroy(){}};Al.extension={type:[v.WebGLSystem,v.WebGPUSystem,v.CanvasSystem],name:"background",priority:0},Al.defaultOptions={backgroundAlpha:1,backgroundColor:0,clearBeforeRender:!0};let Z0=Al;const Ei={};k.handle(v.BlendMode,r=>{if(!r.name)throw new Error("BlendMode extension must have a name property");Ei[r.name]=r.ref},r=>{delete Ei[r.name]});class El{constructor(t){this._isAdvanced=!1,this._filterHash=Object.create(null),this._renderer=t}setBlendMode(t,e,i){if(this._activeBlendMode===e){this._isAdvanced&&this._renderableList.push(t);return}this._activeBlendMode=e,this._isAdvanced&&this._endAdvancedBlendMode(i),this._isAdvanced=!!Ei[e],this._isAdvanced&&(this._beginAdvancedBlendMode(i),this._renderableList.push(t))}_beginAdvancedBlendMode(t){this._renderer.renderPipes.batch.break(t);const e=this._activeBlendMode;if(!Ei[e])return;let i=this._filterHash[e];i||(i=this._filterHash[e]=new Lr,i.filters=[new Ei[e]]);const s={renderPipeId:"filter",action:"pushFilter",renderables:[],filterEffect:i,canBundle:!1};this._renderableList=s.renderables,t.add(s)}_endAdvancedBlendMode(t){this._renderableList=null,this._renderer.renderPipes.batch.break(t),t.add({renderPipeId:"filter",action:"popFilter",canBundle:!1})}buildStart(){this._isAdvanced=!1}buildEnd(t){this._isAdvanced&&this._endAdvancedBlendMode(t)}destroy(){this._renderer=null,this._renderableList=null;for(const t in this._filterHash)this._filterHash[t].destroy();this._filterHash=null}}El.extension={type:[v.WebGLPipes,v.WebGPUPipes,v.CanvasPipes],name:"blendMode"};var v3=Object.defineProperty,Q0=Object.getOwnPropertySymbols,T3=Object.prototype.hasOwnProperty,S3=Object.prototype.propertyIsEnumerable,J0=(r,t,e)=>t in r?v3(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,wl=(r,t)=>{for(var e in t||(t={}))T3.call(t,e)&&J0(r,e,t[e]);if(Q0)for(var e of Q0(t))S3.call(t,e)&&J0(r,e,t[e]);return r};const Cl={png:"image/png",jpg:"image/jpeg",webp:"image/webp"},Rl=class Wb{constructor(t){this._renderer=t}_normalizeOptions(t,e={}){return t instanceof Z||t instanceof w?wl({target:t},e):wl(wl({},e),t)}async image(t){const e=new Image;return e.src=await this.base64(t),e}async base64(t){t=this._normalizeOptions(t,Wb.defaultImageOptions);const{format:e,quality:i}=t,s=this.canvas(t);if(s.toBlob!==void 0)return new Promise((n,a)=>{s.toBlob(o=>{if(!o){a(new Error("ICanvas.toBlob failed!"));return}const u=new FileReader;u.onload=()=>n(u.result),u.onerror=a,u.readAsDataURL(o)},Cl[e],i)});if(s.toDataURL!==void 0)return s.toDataURL(Cl[e],i);if(s.convertToBlob!==void 0){const n=await s.convertToBlob({type:Cl[e],quality:i});return new Promise((a,o)=>{const u=new FileReader;u.onload=()=>a(u.result),u.onerror=o,u.readAsDataURL(n)})}throw new Error("Extract.base64() requires ICanvas.toDataURL, ICanvas.toBlob, or ICanvas.convertToBlob to be implemented")}canvas(t){t=this._normalizeOptions(t);const e=t.target,i=this._renderer;if(e instanceof w)return i.texture.generateCanvas(e);const s=i.textureGenerator.generateTexture(t),n=i.texture.generateCanvas(s);return s.destroy(),n}pixels(t){t=this._normalizeOptions(t);const e=t.target,i=this._renderer,s=e instanceof w?e:i.textureGenerator.generateTexture(t),n=i.texture.getPixels(s);return e instanceof Z&&s.destroy(),n}texture(t){return t=this._normalizeOptions(t),t.target instanceof w?t.target:this._renderer.textureGenerator.generateTexture(t)}download(t){var e;t=this._normalizeOptions(t);const i=this.canvas(t),s=document.createElement("a");s.download=(e=t.filename)!=null?e:"image.png",s.href=i.toDataURL("image/png"),document.body.appendChild(s),s.click(),document.body.removeChild(s)}log(t){var e;const i=(e=t.width)!=null?e:200;t=this._normalizeOptions(t);const s=this.canvas(t),n=s.toDataURL();console.log(`[Pixi Texture] ${s.width}px ${s.height}px`);const a=["font-size: 1px;",`padding: ${i}px 300px;`,`background: url(${n}) no-repeat;`,"background-size: contain;"].join(" ");console.log("%c ",a)}destroy(){this._renderer=null}};Rl.extension={type:[v.WebGLSystem,v.WebGPUSystem],name:"extract"},Rl.defaultImageOptions={format:"png",quality:1};let t2=Rl;class e2 extends w{static create(t){return new w({source:new rt(t)})}resize(t,e,i){return this.source.resize(t,e,i),this}}var A3=Object.defineProperty,E3=Object.defineProperties,w3=Object.getOwnPropertyDescriptors,r2=Object.getOwnPropertySymbols,C3=Object.prototype.hasOwnProperty,R3=Object.prototype.propertyIsEnumerable,i2=(r,t,e)=>t in r?A3(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,P3=(r,t)=>{for(var e in t||(t={}))C3.call(t,e)&&i2(r,e,t[e]);if(r2)for(var e of r2(t))R3.call(t,e)&&i2(r,e,t[e]);return r},M3=(r,t)=>E3(r,w3(t));const D3=new W,O3=new ft,B3=[0,0,0,0];class Pl{constructor(t){this._renderer=t}generateTexture(t){var e;t instanceof Z&&(t={target:t,frame:void 0,textureSourceOptions:{},resolution:void 0});const i=t.resolution||this._renderer.resolution,s=t.antialias||this._renderer.view.antialias,n=t.target;let a=t.clearColor;a?a=Array.isArray(a)&&a.length===4?a:V.shared.setValue(a).toArray():a=B3;const o=((e=t.frame)==null?void 0:e.copyTo(D3))||Qi(n,O3).rectangle;o.width=Math.max(o.width,1/i)|0,o.height=Math.max(o.height,1/i)|0;const u=e2.create(M3(P3({},t.textureSourceOptions),{width:o.width,height:o.height,resolution:i,antialias:s})),l=G.shared.translate(-o.x,-o.y);return this._renderer.render({container:n,transform:l,target:u,clearColor:a}),u.source.updateMipmaps(),u}destroy(){this._renderer=null}}Pl.extension={type:[v.WebGLSystem,v.WebGPUSystem],name:"textureGenerator"};class Ml{constructor(t){this._stackIndex=0,this._globalUniformDataStack=[],this._uniformsPool=[],this._activeUniforms=[],this._bindGroupPool=[],this._activeBindGroups=[],this._renderer=t}reset(){this._stackIndex=0;for(let t=0;t<this._activeUniforms.length;t++)this._uniformsPool.push(this._activeUniforms[t]);for(let t=0;t<this._activeBindGroups.length;t++)this._bindGroupPool.push(this._activeBindGroups[t]);this._activeUniforms.length=0,this._activeBindGroups.length=0}start(t){this.reset(),this.push(t)}bind({size:t,projectionMatrix:e,worldTransformMatrix:i,worldColor:s,offset:n}){const a=this._renderer.renderTarget.renderTarget,o=this._stackIndex?this._globalUniformDataStack[this._stackIndex-1]:{projectionData:a,worldTransformMatrix:new G,worldColor:4294967295,offset:new nt},u={projectionMatrix:e||this._renderer.renderTarget.projectionMatrix,resolution:t||a.size,worldTransformMatrix:i||o.worldTransformMatrix,worldColor:s||o.worldColor,offset:n||o.offset,bindGroup:null},l=this._uniformsPool.pop()||this._createUniforms();this._activeUniforms.push(l);const c=l.uniforms;c.uProjectionMatrix=u.projectionMatrix,c.uResolution=u.resolution,c.uWorldTransformMatrix.copyFrom(u.worldTransformMatrix),c.uWorldTransformMatrix.tx-=u.offset.x,c.uWorldTransformMatrix.ty-=u.offset.y,Qr(u.worldColor,c.uWorldColorAlpha,0),l.update();let h;this._renderer.renderPipes.uniformBatch?h=this._renderer.renderPipes.uniformBatch.getUniformBindGroup(l,!1):(h=this._bindGroupPool.pop()||new Zt,this._activeBindGroups.push(h),h.setResource(l,0)),u.bindGroup=h,this._currentGlobalUniformData=u}push(t){this.bind(t),this._globalUniformDataStack[this._stackIndex++]=this._currentGlobalUniformData}pop(){this._currentGlobalUniformData=this._globalUniformDataStack[--this._stackIndex-1],this._renderer.type===Dt.WEBGL&&this._currentGlobalUniformData.bindGroup.resources[0].update()}get bindGroup(){return this._currentGlobalUniformData.bindGroup}get uniformGroup(){return this._currentGlobalUniformData.bindGroup.resources[0]}_createUniforms(){return new ut({uProjectionMatrix:{value:new G,type:"mat3x3<f32>"},uWorldTransformMatrix:{value:new G,type:"mat3x3<f32>"},uWorldColorAlpha:{value:new Float32Array(4),type:"vec4<f32>"},uResolution:{value:[0,0],type:"vec2<f32>"}},{isStatic:!0})}destroy(){this._renderer=null}}Ml.extension={type:[v.WebGLSystem,v.WebGPUSystem,v.CanvasSystem],name:"globalUniforms"};let s2=!1;const Dl="8.2.0";function n2(r){if(!s2){if(j.get().getNavigator().userAgent.toLowerCase().indexOf("chrome")>-1){const t=[`%c %c %c %c %c PixiJS %c v${Dl} (${r}) http://www.pixijs.com/
1970
+ `,r}const ZE={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,uint:1,uvec2:2,uvec3:3,uvec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function QE(r){return ZE[r]}function D0(r){const t={};return t.normal=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t.add=[r.ONE,r.ONE],t.multiply=[r.DST_COLOR,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA],t.screen=[r.ONE,r.ONE_MINUS_SRC_COLOR,r.ONE,r.ONE_MINUS_SRC_ALPHA],t.none=[0,0],t["normal-npm"]=[r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA],t["add-npm"]=[r.SRC_ALPHA,r.ONE,r.ONE,r.ONE],t["screen-npm"]=[r.SRC_ALPHA,r.ONE_MINUS_SRC_COLOR,r.ONE,r.ONE_MINUS_SRC_ALPHA],t.erase=[r.ZERO,r.ONE_MINUS_SRC_ALPHA],t}const JE=0,t3=1,e3=2,r3=3,i3=4,s3=5,O0=class cc{constructor(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode="none",this._blendEq=!1,this.map=[],this.map[JE]=this.setBlend,this.map[t3]=this.setOffset,this.map[e3]=this.setCullFace,this.map[r3]=this.setDepthTest,this.map[i3]=this.setFrontFace,this.map[s3]=this.setDepthMask,this.checks=[],this.defaultState=Xt.for2d()}contextChange(t){this.gl=t,this.blendModesMap=D0(t),this.reset()}set(t){if(t=t||this.defaultState,this.stateId!==t.data){let e=this.stateId^t.data,i=0;for(;e;)e&1&&this.map[i].call(this,!!(t.data&1<<i)),e=e>>1,i++;this.stateId=t.data}for(let e=0;e<this.checks.length;e++)this.checks[e](this,t)}forceState(t){t=t||this.defaultState;for(let e=0;e<this.map.length;e++)this.map[e].call(this,!!(t.data&1<<e));for(let e=0;e<this.checks.length;e++)this.checks[e](this,t);this.stateId=t.data}setBlend(t){this._updateCheck(cc._checkBlendMode,t),this.gl[t?"enable":"disable"](this.gl.BLEND)}setOffset(t){this._updateCheck(cc._checkPolygonOffset,t),this.gl[t?"enable":"disable"](this.gl.POLYGON_OFFSET_FILL)}setDepthTest(t){this.gl[t?"enable":"disable"](this.gl.DEPTH_TEST)}setDepthMask(t){this.gl.depthMask(t)}setCullFace(t){this.gl[t?"enable":"disable"](this.gl.CULL_FACE)}setFrontFace(t){this.gl.frontFace(this.gl[t?"CW":"CCW"])}setBlendMode(t){if(this.blendModesMap[t]||(t="normal"),t===this.blendMode)return;this.blendMode=t;const e=this.blendModesMap[t],i=this.gl;e.length===2?i.blendFunc(e[0],e[1]):i.blendFuncSeparate(e[0],e[1],e[2],e[3]),e.length===6?(this._blendEq=!0,i.blendEquationSeparate(e[4],e[5])):this._blendEq&&(this._blendEq=!1,i.blendEquationSeparate(i.FUNC_ADD,i.FUNC_ADD))}setPolygonOffset(t,e){this.gl.polygonOffset(t,e)}reset(){this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,!1),this.forceState(this.defaultState),this._blendEq=!0,this.blendMode="",this.setBlendMode("normal")}_updateCheck(t,e){const i=this.checks.indexOf(t);e&&i===-1?this.checks.push(t):!e&&i!==-1&&this.checks.splice(i,1)}static _checkBlendMode(t,e){t.setBlendMode(e.blendMode)}static _checkPolygonOffset(t,e){t.setPolygonOffset(1,e.polygonOffset)}destroy(){this.gl=null,this.checks.length=0}};O0.extension={type:[v.WebGLSystem],name:"state"};let B0=O0;class G0{constructor(t){this.target=Hu.TEXTURE_2D,this.texture=t,this.width=-1,this.height=-1,this.type=z.UNSIGNED_BYTE,this.internalFormat=dn.RGBA,this.format=dn.RGBA,this.samplerType=0}}const F0={id:"buffer",upload(r,t,e){t.width===r.width||t.height===r.height?e.texSubImage2D(e.TEXTURE_2D,0,0,0,r.width,r.height,t.format,t.type,r.resource):e.texImage2D(t.target,0,t.internalFormat,r.width,r.height,0,t.format,t.type,r.resource),t.width=r.width,t.height=r.height}},n3={"bc1-rgba-unorm":!0,"bc1-rgba-unorm-srgb":!0,"bc2-rgba-unorm":!0,"bc2-rgba-unorm-srgb":!0,"bc3-rgba-unorm":!0,"bc3-rgba-unorm-srgb":!0,"bc4-r-unorm":!0,"bc4-r-snorm":!0,"bc5-rg-unorm":!0,"bc5-rg-snorm":!0,"bc6h-rgb-ufloat":!0,"bc6h-rgb-float":!0,"bc7-rgba-unorm":!0,"bc7-rgba-unorm-srgb":!0,"etc2-rgb8unorm":!0,"etc2-rgb8unorm-srgb":!0,"etc2-rgb8a1unorm":!0,"etc2-rgb8a1unorm-srgb":!0,"etc2-rgba8unorm":!0,"etc2-rgba8unorm-srgb":!0,"eac-r11unorm":!0,"eac-r11snorm":!0,"eac-rg11unorm":!0,"eac-rg11snorm":!0,"astc-4x4-unorm":!0,"astc-4x4-unorm-srgb":!0,"astc-5x4-unorm":!0,"astc-5x4-unorm-srgb":!0,"astc-5x5-unorm":!0,"astc-5x5-unorm-srgb":!0,"astc-6x5-unorm":!0,"astc-6x5-unorm-srgb":!0,"astc-6x6-unorm":!0,"astc-6x6-unorm-srgb":!0,"astc-8x5-unorm":!0,"astc-8x5-unorm-srgb":!0,"astc-8x6-unorm":!0,"astc-8x6-unorm-srgb":!0,"astc-8x8-unorm":!0,"astc-8x8-unorm-srgb":!0,"astc-10x5-unorm":!0,"astc-10x5-unorm-srgb":!0,"astc-10x6-unorm":!0,"astc-10x6-unorm-srgb":!0,"astc-10x8-unorm":!0,"astc-10x8-unorm-srgb":!0,"astc-10x10-unorm":!0,"astc-10x10-unorm-srgb":!0,"astc-12x10-unorm":!0,"astc-12x10-unorm-srgb":!0,"astc-12x12-unorm":!0,"astc-12x12-unorm-srgb":!0},I0={id:"compressed",upload(r,t,e){e.pixelStorei(e.UNPACK_ALIGNMENT,4);let i=r.pixelWidth,s=r.pixelHeight;const n=!!n3[r.format];for(let a=0;a<r.resource.length;a++){const o=r.resource[a];n?e.compressedTexImage2D(e.TEXTURE_2D,a,t.internalFormat,i,s,0,o):e.texImage2D(e.TEXTURE_2D,a,t.internalFormat,i,s,0,t.format,t.type,o),i=Math.max(i>>1,1),s=Math.max(s>>1,1)}}},ul={id:"image",upload(r,t,e,i){const s=r.alphaMode==="premultiply-alpha-on-upload";e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,s);const n=t.width,a=t.height,o=r.pixelWidth,u=r.pixelHeight,l=r.resourceWidth,c=r.resourceHeight;l<o||c<u?((n!==o||a!==u)&&e.texImage2D(t.target,0,t.internalFormat,o,u,0,t.format,t.type,null),i===2?e.texSubImage2D(e.TEXTURE_2D,0,0,0,l,c,t.format,t.type,r.resource):e.texSubImage2D(e.TEXTURE_2D,0,0,0,t.format,t.type,r.resource)):n===o||a===u?e.texSubImage2D(e.TEXTURE_2D,0,0,0,t.format,t.type,r.resource):i===2?e.texImage2D(t.target,0,t.internalFormat,o,u,0,t.format,t.type,r.resource):e.texImage2D(t.target,0,t.internalFormat,t.format,t.type,r.resource),t.width=o,t.height=u}},U0={id:"video",upload(r,t,e,i){if(!r.isValid){e.texImage2D(t.target,0,t.internalFormat,1,1,0,t.format,t.type,null);return}ul.upload(r,t,e,i)}},ll={linear:9729,nearest:9728},N0={linear:{linear:9987,nearest:9985},nearest:{linear:9986,nearest:9984}},_n={"clamp-to-edge":33071,repeat:10497,"mirror-repeat":33648},k0={never:512,less:513,equal:514,"less-equal":515,greater:516,"not-equal":517,"greater-equal":518,always:519};function cl(r,t,e,i,s,n,a,o){const u=n;if(!o||r.addressModeU!=="repeat"||r.addressModeV!=="repeat"||r.addressModeW!=="repeat"){const l=_n[a?"clamp-to-edge":r.addressModeU],c=_n[a?"clamp-to-edge":r.addressModeV],h=_n[a?"clamp-to-edge":r.addressModeW];t[s](u,t.TEXTURE_WRAP_S,l),t[s](u,t.TEXTURE_WRAP_T,c),t.TEXTURE_WRAP_R&&t[s](u,t.TEXTURE_WRAP_R,h)}if((!o||r.magFilter!=="linear")&&t[s](u,t.TEXTURE_MAG_FILTER,ll[r.magFilter]),e){if(!o||r.mipmapFilter!=="linear"){const l=N0[r.minFilter][r.mipmapFilter];t[s](u,t.TEXTURE_MIN_FILTER,l)}}else t[s](u,t.TEXTURE_MIN_FILTER,ll[r.minFilter]);if(i&&r.maxAnisotropy>1){const l=Math.min(r.maxAnisotropy,t.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY_EXT));t[s](u,i.TEXTURE_MAX_ANISOTROPY_EXT,l)}r.compare&&t[s](u,t.TEXTURE_COMPARE_FUNC,k0[r.compare])}function L0(r){return{r8unorm:r.RED,r8snorm:r.RED,r8uint:r.RED,r8sint:r.RED,r16uint:r.RED,r16sint:r.RED,r16float:r.RED,rg8unorm:r.RG,rg8snorm:r.RG,rg8uint:r.RG,rg8sint:r.RG,r32uint:r.RED,r32sint:r.RED,r32float:r.RED,rg16uint:r.RG,rg16sint:r.RG,rg16float:r.RG,rgba8unorm:r.RGBA,"rgba8unorm-srgb":r.RGBA,rgba8snorm:r.RGBA,rgba8uint:r.RGBA,rgba8sint:r.RGBA,bgra8unorm:r.RGBA,"bgra8unorm-srgb":r.RGBA,rgb9e5ufloat:r.RGB,rgb10a2unorm:r.RGBA,rg11b10ufloat:r.RGB,rg32uint:r.RG,rg32sint:r.RG,rg32float:r.RG,rgba16uint:r.RGBA,rgba16sint:r.RGBA,rgba16float:r.RGBA,rgba32uint:r.RGBA,rgba32sint:r.RGBA,rgba32float:r.RGBA,stencil8:r.STENCIL_INDEX8,depth16unorm:r.DEPTH_COMPONENT,depth24plus:r.DEPTH_COMPONENT,"depth24plus-stencil8":r.DEPTH_STENCIL,depth32float:r.DEPTH_COMPONENT,"depth32float-stencil8":r.DEPTH_STENCIL}}var a3=Object.defineProperty,o3=Object.defineProperties,u3=Object.getOwnPropertyDescriptors,$0=Object.getOwnPropertySymbols,l3=Object.prototype.hasOwnProperty,c3=Object.prototype.propertyIsEnumerable,H0=(r,t,e)=>t in r?a3(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,Ue=(r,t)=>{for(var e in t||(t={}))l3.call(t,e)&&H0(r,e,t[e]);if($0)for(var e of $0(t))c3.call(t,e)&&H0(r,e,t[e]);return r},h3=(r,t)=>o3(r,u3(t));function X0(r,t){let e={},i=r.RGBA;return r instanceof j.get().getWebGLRenderingContext()?t.srgb&&(e={"rgba8unorm-srgb":t.srgb.SRGB8_ALPHA8_EXT,"bgra8unorm-srgb":t.srgb.SRGB8_ALPHA8_EXT}):(e={"rgba8unorm-srgb":r.SRGB8_ALPHA8,"bgra8unorm-srgb":r.SRGB8_ALPHA8},i=r.RGBA8),Ue(Ue(Ue(Ue(Ue(Ue(h3(Ue({r8unorm:r.R8,r8snorm:r.R8_SNORM,r8uint:r.R8UI,r8sint:r.R8I,r16uint:r.R16UI,r16sint:r.R16I,r16float:r.R16F,rg8unorm:r.RG8,rg8snorm:r.RG8_SNORM,rg8uint:r.RG8UI,rg8sint:r.RG8I,r32uint:r.R32UI,r32sint:r.R32I,r32float:r.R32F,rg16uint:r.RG16UI,rg16sint:r.RG16I,rg16float:r.RG16F,rgba8unorm:r.RGBA},e),{rgba8snorm:r.RGBA8_SNORM,rgba8uint:r.RGBA8UI,rgba8sint:r.RGBA8I,bgra8unorm:i,rgb9e5ufloat:r.RGB9_E5,rgb10a2unorm:r.RGB10_A2,rg11b10ufloat:r.R11F_G11F_B10F,rg32uint:r.RG32UI,rg32sint:r.RG32I,rg32float:r.RG32F,rgba16uint:r.RGBA16UI,rgba16sint:r.RGBA16I,rgba16float:r.RGBA16F,rgba32uint:r.RGBA32UI,rgba32sint:r.RGBA32I,rgba32float:r.RGBA32F,stencil8:r.STENCIL_INDEX8,depth16unorm:r.DEPTH_COMPONENT16,depth24plus:r.DEPTH_COMPONENT24,"depth24plus-stencil8":r.DEPTH24_STENCIL8,depth32float:r.DEPTH_COMPONENT32F,"depth32float-stencil8":r.DEPTH32F_STENCIL8}),t.s3tc?{"bc1-rgba-unorm":t.s3tc.COMPRESSED_RGBA_S3TC_DXT1_EXT,"bc2-rgba-unorm":t.s3tc.COMPRESSED_RGBA_S3TC_DXT3_EXT,"bc3-rgba-unorm":t.s3tc.COMPRESSED_RGBA_S3TC_DXT5_EXT}:{}),t.s3tc_sRGB?{"bc1-rgba-unorm-srgb":t.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,"bc2-rgba-unorm-srgb":t.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,"bc3-rgba-unorm-srgb":t.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}:{}),t.rgtc?{"bc4-r-unorm":t.rgtc.COMPRESSED_RED_RGTC1_EXT,"bc4-r-snorm":t.rgtc.COMPRESSED_SIGNED_RED_RGTC1_EXT,"bc5-rg-unorm":t.rgtc.COMPRESSED_RED_GREEN_RGTC2_EXT,"bc5-rg-snorm":t.rgtc.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}:{}),t.bptc?{"bc6h-rgb-float":t.bptc.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,"bc6h-rgb-ufloat":t.bptc.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,"bc7-rgba-unorm":t.bptc.COMPRESSED_RGBA_BPTC_UNORM_EXT,"bc7-rgba-unorm-srgb":t.bptc.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT}:{}),t.etc?{"etc2-rgb8unorm":t.etc.COMPRESSED_RGB8_ETC2,"etc2-rgb8unorm-srgb":t.etc.COMPRESSED_SRGB8_ETC2,"etc2-rgb8a1unorm":t.etc.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,"etc2-rgb8a1unorm-srgb":t.etc.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,"etc2-rgba8unorm":t.etc.COMPRESSED_RGBA8_ETC2_EAC,"etc2-rgba8unorm-srgb":t.etc.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,"eac-r11unorm":t.etc.COMPRESSED_R11_EAC,"eac-rg11unorm":t.etc.COMPRESSED_SIGNED_RG11_EAC}:{}),t.astc?{"astc-4x4-unorm":t.astc.COMPRESSED_RGBA_ASTC_4x4_KHR,"astc-4x4-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,"astc-5x4-unorm":t.astc.COMPRESSED_RGBA_ASTC_5x4_KHR,"astc-5x4-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR,"astc-5x5-unorm":t.astc.COMPRESSED_RGBA_ASTC_5x5_KHR,"astc-5x5-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,"astc-6x5-unorm":t.astc.COMPRESSED_RGBA_ASTC_6x5_KHR,"astc-6x5-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,"astc-6x6-unorm":t.astc.COMPRESSED_RGBA_ASTC_6x6_KHR,"astc-6x6-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,"astc-8x5-unorm":t.astc.COMPRESSED_RGBA_ASTC_8x5_KHR,"astc-8x5-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,"astc-8x6-unorm":t.astc.COMPRESSED_RGBA_ASTC_8x6_KHR,"astc-8x6-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,"astc-8x8-unorm":t.astc.COMPRESSED_RGBA_ASTC_8x8_KHR,"astc-8x8-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,"astc-10x5-unorm":t.astc.COMPRESSED_RGBA_ASTC_10x5_KHR,"astc-10x5-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,"astc-10x6-unorm":t.astc.COMPRESSED_RGBA_ASTC_10x6_KHR,"astc-10x6-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,"astc-10x8-unorm":t.astc.COMPRESSED_RGBA_ASTC_10x8_KHR,"astc-10x8-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,"astc-10x10-unorm":t.astc.COMPRESSED_RGBA_ASTC_10x10_KHR,"astc-10x10-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,"astc-12x10-unorm":t.astc.COMPRESSED_RGBA_ASTC_12x10_KHR,"astc-12x10-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,"astc-12x12-unorm":t.astc.COMPRESSED_RGBA_ASTC_12x12_KHR,"astc-12x12-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR}:{})}function z0(r){return{r8unorm:r.UNSIGNED_BYTE,r8snorm:r.BYTE,r8uint:r.UNSIGNED_BYTE,r8sint:r.BYTE,r16uint:r.UNSIGNED_SHORT,r16sint:r.SHORT,r16float:r.HALF_FLOAT,rg8unorm:r.UNSIGNED_BYTE,rg8snorm:r.BYTE,rg8uint:r.UNSIGNED_BYTE,rg8sint:r.BYTE,r32uint:r.UNSIGNED_INT,r32sint:r.INT,r32float:r.FLOAT,rg16uint:r.UNSIGNED_SHORT,rg16sint:r.SHORT,rg16float:r.HALF_FLOAT,rgba8unorm:r.UNSIGNED_BYTE,"rgba8unorm-srgb":r.UNSIGNED_BYTE,rgba8snorm:r.BYTE,rgba8uint:r.UNSIGNED_BYTE,rgba8sint:r.BYTE,bgra8unorm:r.UNSIGNED_BYTE,"bgra8unorm-srgb":r.UNSIGNED_BYTE,rgb9e5ufloat:r.UNSIGNED_INT_5_9_9_9_REV,rgb10a2unorm:r.UNSIGNED_INT_2_10_10_10_REV,rg11b10ufloat:r.UNSIGNED_INT_10F_11F_11F_REV,rg32uint:r.UNSIGNED_INT,rg32sint:r.INT,rg32float:r.FLOAT,rgba16uint:r.UNSIGNED_SHORT,rgba16sint:r.SHORT,rgba16float:r.HALF_FLOAT,rgba32uint:r.UNSIGNED_INT,rgba32sint:r.INT,rgba32float:r.FLOAT,stencil8:r.UNSIGNED_BYTE,depth16unorm:r.UNSIGNED_SHORT,depth24plus:r.UNSIGNED_INT,"depth24plus-stencil8":r.UNSIGNED_INT_24_8,depth32float:r.FLOAT,"depth32float-stencil8":r.FLOAT_32_UNSIGNED_INT_24_8_REV}}function d3(r){r instanceof Uint8ClampedArray&&(r=new Uint8Array(r.buffer));const t=r.length;for(let e=0;e<t;e+=4){const i=r[e+3];if(i!==0){const s=255.001/i;r[e]=r[e]*s+.5,r[e+1]=r[e+1]*s+.5,r[e+2]=r[e+2]*s+.5}}}const f3=4;class hl{constructor(t){this.managedTextures=[],this._glTextures=Object.create(null),this._glSamplers=Object.create(null),this._boundTextures=[],this._activeTextureLocation=-1,this._boundSamplers=Object.create(null),this._uploads={image:ul,buffer:F0,video:U0,compressed:I0},this._useSeparateSamplers=!1,this._renderer=t}contextChange(t){this._gl=t,this._mapFormatToInternalFormat||(this._mapFormatToInternalFormat=X0(t,this._renderer.context.extensions),this._mapFormatToType=z0(t),this._mapFormatToFormat=L0(t)),this._glTextures=Object.create(null),this._glSamplers=Object.create(null),this._boundSamplers=Object.create(null);for(let e=0;e<16;e++)this.bind(w.EMPTY,e)}initSource(t){this.bind(t)}bind(t,e=0){const i=t.source;t?(this.bindSource(i,e),this._useSeparateSamplers&&this._bindSampler(i.style,e)):(this.bindSource(null,e),this._useSeparateSamplers&&this._bindSampler(null,e))}bindSource(t,e=0){const i=this._gl;if(t._touched=this._renderer.textureGC.count,this._boundTextures[e]!==t){this._boundTextures[e]=t,this._activateLocation(e),t=t||w.EMPTY.source;const s=this.getGlSource(t);i.bindTexture(s.target,s.texture)}}_bindSampler(t,e=0){const i=this._gl;if(!t){this._boundSamplers[e]=null,i.bindSampler(e,null);return}const s=this._getGlSampler(t);this._boundSamplers[e]!==s&&(this._boundSamplers[e]=s,i.bindSampler(e,s))}unbind(t){const e=t.source,i=this._boundTextures,s=this._gl;for(let n=0;n<i.length;n++)if(i[n]===e){this._activateLocation(n);const a=this.getGlSource(e);s.bindTexture(a.target,null),i[n]=null}}_activateLocation(t){this._activeTextureLocation!==t&&(this._activeTextureLocation=t,this._gl.activeTexture(this._gl.TEXTURE0+t))}_initSource(t){const e=this._gl,i=new G0(e.createTexture());if(i.type=this._mapFormatToType[t.format],i.internalFormat=this._mapFormatToInternalFormat[t.format],i.format=this._mapFormatToFormat[t.format],t.autoGenerateMipmaps&&(this._renderer.context.supports.nonPowOf2mipmaps||t.isPowerOfTwo)){const s=Math.max(t.width,t.height);t.mipLevelCount=Math.floor(Math.log2(s))+1}return this._glTextures[t.uid]=i,this.managedTextures.includes(t)||(t.on("update",this.onSourceUpdate,this),t.on("resize",this.onSourceUpdate,this),t.on("styleChange",this.onStyleChange,this),t.on("destroy",this.onSourceDestroy,this),t.on("unload",this.onSourceUnload,this),t.on("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.push(t)),this.onSourceUpdate(t),this.updateStyle(t,!1),i}onStyleChange(t){this.updateStyle(t,!1)}updateStyle(t,e){const i=this._gl,s=this.getGlSource(t);i.bindTexture(i.TEXTURE_2D,s.texture),this._boundTextures[this._activeTextureLocation]=t,cl(t.style,i,t.mipLevelCount>1,this._renderer.context.extensions.anisotropicFiltering,"texParameteri",i.TEXTURE_2D,!this._renderer.context.supports.nonPowOf2wrapping&&!t.isPowerOfTwo,e)}onSourceUnload(t){const e=this._glTextures[t.uid];e&&(this.unbind(t),this._glTextures[t.uid]=null,this._gl.deleteTexture(e.texture))}onSourceUpdate(t){const e=this._gl,i=this.getGlSource(t);e.bindTexture(e.TEXTURE_2D,i.texture),this._boundTextures[this._activeTextureLocation]=t,this._uploads[t.uploadMethodId]?this._uploads[t.uploadMethodId].upload(t,i,e,this._renderer.context.webGLVersion):e.texImage2D(e.TEXTURE_2D,0,e.RGBA,t.pixelWidth,t.pixelHeight,0,e.RGBA,e.UNSIGNED_BYTE,null),t.autoGenerateMipmaps&&t.mipLevelCount>1&&this.onUpdateMipmaps(t,!1)}onUpdateMipmaps(t,e=!0){e&&this.bindSource(t,0);const i=this.getGlSource(t);this._gl.generateMipmap(i.target)}onSourceDestroy(t){t.off("destroy",this.onSourceDestroy,this),t.off("update",this.onSourceUpdate,this),t.off("resize",this.onSourceUpdate,this),t.off("unload",this.onSourceUnload,this),t.off("styleChange",this.onStyleChange,this),t.off("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.splice(this.managedTextures.indexOf(t),1),this.onSourceUnload(t)}_initSampler(t){const e=this._gl,i=this._gl.createSampler();return this._glSamplers[t._resourceId]=i,cl(t,e,this._boundTextures[this._activeTextureLocation].mipLevelCount>1,this._renderer.context.extensions.anisotropicFiltering,"samplerParameteri",i,!1,!0),this._glSamplers[t._resourceId]}_getGlSampler(t){return this._glSamplers[t._resourceId]||this._initSampler(t)}getGlSource(t){return this._glTextures[t.uid]||this._initSource(t)}generateCanvas(t){const{pixels:e,width:i,height:s}=this.getPixels(t),n=j.get().createCanvas();n.width=i,n.height=s;const a=n.getContext("2d");if(a){const o=a.createImageData(i,s);o.data.set(e),a.putImageData(o,0,0)}return n}getPixels(t){const e=t.source.resolution,i=t.frame,s=Math.max(Math.round(i.width*e),1),n=Math.max(Math.round(i.height*e),1),a=new Uint8Array(f3*s*n),o=this._renderer,u=o.renderTarget.getRenderTarget(t),l=o.renderTarget.getGpuRenderTarget(u),c=o.gl;return c.bindFramebuffer(c.FRAMEBUFFER,l.resolveTargetFramebuffer),c.readPixels(Math.round(i.x*e),Math.round(i.y*e),s,n,c.RGBA,c.UNSIGNED_BYTE,a),{pixels:new Uint8ClampedArray(a.buffer),width:s,height:n}}destroy(){this.managedTextures.slice().forEach(t=>this.onSourceDestroy(t)),this.managedTextures=null,this._renderer=null}}hl.extension={type:[v.WebGLSystem],name:"texture"};class dl{init(){const t=new ut({uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uTransformMatrix:{value:new G,type:"mat3x3<f32>"},uRound:{value:0,type:"f32"}}),e=Ht(),i=lr({name:"graphics",bits:[Ps,Ds(e),Is,hr]});this.shader=new Ot({glProgram:i,resources:{localUniforms:t,batchSamplers:Os(e)}})}execute(t,e){const i=e.context,s=i.customShader||this.shader,n=t.renderer,a=n.graphicsContext,{geometry:o,instructions:u}=a.getContextRenderData(i);s.groups[0]=n.globalUniforms.bindGroup,n.state.set(t.state),n.shader.bind(s),n.geometry.bind(o,s.glProgram);const l=u.instructions;for(let c=0;c<u.instructionSize;c++){const h=l[c];if(h.size){for(let f=0;f<h.textures.textures.length;f++)n.texture.bind(h.textures.textures[f],f);n.geometry.draw("triangle-list",h.size,h.start)}}}destroy(){this.shader.destroy(!0),this.shader=null}}dl.extension={type:[v.WebGLPipesAdaptor],name:"graphics"};class fl{init(){const t=lr({name:"mesh",bits:[Is,$_,hr]});this._shader=new Ot({glProgram:t,resources:{uTexture:w.EMPTY.source,textureUniforms:{uTextureMatrix:{type:"mat3x3<f32>",value:new G}}}})}execute(t,e){const i=t.renderer;let s=e._shader;if(s){if(!s.glProgram)return}else{s=this._shader;const n=e.texture,a=n.source;s.resources.uTexture=a,s.resources.uSampler=a.style,s.resources.textureUniforms.uniforms.uTextureMatrix=n.textureMatrix.mapCoord}s.groups[100]=i.globalUniforms.bindGroup,s.groups[101]=t.localUniformsBindGroup,i.encoder.draw({geometry:e._geometry,shader:s,state:e.state})}destroy(){this._shader.destroy(!0),this._shader=null}}fl.extension={type:[v.WebGLPipesAdaptor],name:"mesh"};class pl{constructor(t){this._renderer=t}addRenderable(t,e){this._renderer.renderPipes.batch.break(e),e.add(t)}execute(t){t.isRenderable&&t.render(this._renderer)}destroy(){this._renderer=null}}pl.extension={type:[v.WebGLPipes,v.WebGPUPipes,v.CanvasPipes],name:"customRender"};function ml(r,t){const e=r.instructionSet,i=e.instructions;for(let s=0;s<e.instructionSize;s++){const n=i[s];t[n.renderPipeId].execute(n)}}class gl{constructor(t){this._renderer=t}addRenderGroup(t,e){this._renderer.renderPipes.batch.break(e),e.add(t)}execute(t){t.isRenderable&&(this._renderer.globalUniforms.push({worldTransformMatrix:t.worldTransform,worldColor:t.worldColorAlpha}),ml(t,this._renderer.renderPipes),this._renderer.globalUniforms.pop())}destroy(){this._renderer=null}}gl.extension={type:[v.WebGLPipes,v.WebGPUPipes,v.CanvasPipes],name:"renderGroup"};function _l(r,t=[]){t.push(r);for(let e=0;e<r.renderGroupChildren.length;e++)_l(r.renderGroupChildren[e],t);return t}function bl(r,t,e){const i=r>>16&255,s=r>>8&255,n=r&255,a=t>>16&255,o=t>>8&255,u=t&255,l=i+(a-i)*e,c=s+(o-s)*e,h=n+(u-n)*e;return(l<<16)+(c<<8)+h}const yr=16777215;function xl(r,t){return r===yr||t===yr?r+t-yr:bl(r,t,.5)}function p3(r,t,e){const i=(e>>24&255)/255,s=t*i*255,n=((r&255)<<16)+(r&65280)+(r>>16&255),a=e&16777215;let o;return n===yr||a===yr?o=n+a-yr:o=bl(n,a,.5),o+(s<<24)}const m3=new Z;function yl(r,t=!1){j0(r);const e=r.childrenToUpdate,i=r.updateTick++;for(const s in e){const n=Number(s),a=e[s],o=a.list,u=a.index;for(let l=0;l<u;l++){const c=o[l];c.parentRenderGroup===r&&c.relativeRenderGroupDepth===n&&vl(c,i,0)}a.index=0}if(t)for(let s=0;s<r.renderGroupChildren.length;s++)yl(r.renderGroupChildren[s],t)}function j0(r){const t=r.root;let e;if(r.renderGroupParent){const i=r.renderGroupParent;r.worldTransform.appendFrom(t.relativeGroupTransform,i.worldTransform),r.worldColor=xl(t.groupColor,i.worldColor),e=t.groupAlpha*i.worldAlpha}else r.worldTransform.copyFrom(t.localTransform),r.worldColor=t.localColor,e=t.localAlpha;e=e<0?0:e>1?1:e,r.worldAlpha=e,r.worldColorAlpha=r.worldColor+((e*255|0)<<24)}function vl(r,t,e){if(t===r.updateTick)return;r.updateTick=t,r.didChange=!1;const i=r.localTransform;r.updateLocalTransform();const s=r.parent;if(s&&!s.renderGroup?(e=e|r._updateFlags,r.relativeGroupTransform.appendFrom(i,s.relativeGroupTransform),e&&V0(r,s,e)):(e=r._updateFlags,r.relativeGroupTransform.copyFrom(i),e&&V0(r,m3,e)),!r.renderGroup){const n=r.children,a=n.length;for(let u=0;u<a;u++)vl(n[u],t,e);const o=r.parentRenderGroup;r.renderPipeId&&!o.structureDidChange&&o.updateRenderable(r)}}function V0(r,t,e){if(e&Ji){r.groupColor=xl(r.localColor,t.groupColor);let i=r.localAlpha*t.groupAlpha;i=i<0?0:i>1?1:i,r.groupAlpha=i,r.groupColorAlpha=r.groupColor+((i*255|0)<<24)}e&da&&(r.groupBlendMode=r.localBlendMode==="inherit"?t.groupBlendMode:r.localBlendMode),e&Xr&&(r.globalDisplayStatus=r.localDisplayStatus&t.globalDisplayStatus),r._updateFlags=0}function W0(r,t){const{list:e,index:i}=r.childrenRenderablesToUpdate;let s=!1;for(let n=0;n<i;n++){const a=e[n];if(s=t[a.renderPipeId].validateRenderable(a),s)break}return r.structureDidChange=s,s}const g3=new G;class Tl{constructor(t){this._renderer=t}render({container:t,transform:e}){t.isRenderGroup=!0;const i=t.parent,s=t.renderGroup.renderGroupParent;t.parent=null,t.renderGroup.renderGroupParent=null;const n=this._renderer,a=_l(t.renderGroup,[]);let o=g3;e&&(o=o.copyFrom(t.renderGroup.localTransform),t.renderGroup.localTransform.copyFrom(e));const u=n.renderPipes;for(let l=0;l<a.length;l++){const c=a[l];c.runOnRender(),c.instructionSet.renderPipes=u,c.structureDidChange||W0(c,u),yl(c),c.structureDidChange?(c.structureDidChange=!1,H_(c,u)):_3(c),c.childrenRenderablesToUpdate.index=0,n.renderPipes.batch.upload(c.instructionSet)}n.globalUniforms.start({worldTransformMatrix:e?t.renderGroup.localTransform:t.renderGroup.worldTransform,worldColor:t.renderGroup.worldColorAlpha}),ml(t.renderGroup,u),u.uniformBatch&&u.uniformBatch.renderEnd(),e&&t.renderGroup.localTransform.copyFrom(o),t.parent=i,t.renderGroup.renderGroupParent=s}destroy(){this._renderer=null}}Tl.extension={type:[v.WebGLSystem,v.WebGPUSystem,v.CanvasSystem],name:"renderGroup"};function _3(r){const{list:t,index:e}=r.childrenRenderablesToUpdate;for(let i=0;i<e;i++){const s=t[i];s.didViewUpdate&&r.updateRenderable(s)}}class Sl{constructor(t){this._gpuSpriteHash=Object.create(null),this._renderer=t}addRenderable(t,e){const i=this._getGpuSprite(t);t._didSpriteUpdate&&this._updateBatchableSprite(t,i),this._renderer.renderPipes.batch.addToBatch(i)}updateRenderable(t){const e=this._gpuSpriteHash[t.uid];t._didSpriteUpdate&&this._updateBatchableSprite(t,e),e.batcher.updateElement(e)}validateRenderable(t){const e=t._texture,i=this._getGpuSprite(t);return i.texture._source!==e._source?!i.batcher.checkAndUpdateTexture(i,e):!1}destroyRenderable(t){const e=this._gpuSpriteHash[t.uid];H.return(e),this._gpuSpriteHash[t.uid]=null}_updateBatchableSprite(t,e){t._didSpriteUpdate=!1,e.bounds=t.bounds,e.texture=t._texture}_getGpuSprite(t){return this._gpuSpriteHash[t.uid]||this._initGPUSprite(t)}_initGPUSprite(t){const e=H.get(_s);return e.renderable=t,e.texture=t._texture,e.bounds=t.bounds,e.roundPixels=this._renderer._roundPixels|t._roundPixels,this._gpuSpriteHash[t.uid]=e,t._didSpriteUpdate=!1,t.on("destroyed",()=>{this.destroyRenderable(t)}),e}destroy(){for(const t in this._gpuSpriteHash)H.return(this._gpuSpriteHash[t]);this._gpuSpriteHash=null,this._renderer=null}}Sl.extension={type:[v.WebGLPipes,v.WebGPUPipes,v.CanvasPipes],name:"sprite"};var b3=Object.defineProperty,Y0=Object.getOwnPropertySymbols,x3=Object.prototype.hasOwnProperty,y3=Object.prototype.propertyIsEnumerable,q0=(r,t,e)=>t in r?b3(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,K0=(r,t)=>{for(var e in t||(t={}))x3.call(t,e)&&q0(r,e,t[e]);if(Y0)for(var e of Y0(t))y3.call(t,e)&&q0(r,e,t[e]);return r};const Al=class Vb{constructor(){this.clearBeforeRender=!0,this._backgroundColor=new V(0),this.color=this._backgroundColor,this.alpha=1}init(t){t=K0(K0({},Vb.defaultOptions),t),this.clearBeforeRender=t.clearBeforeRender,this.color=t.background||t.backgroundColor||this._backgroundColor,this.alpha=t.backgroundAlpha,this._backgroundColor.setAlpha(t.backgroundAlpha)}get color(){return this._backgroundColor}set color(t){this._backgroundColor.setValue(t)}get alpha(){return this._backgroundColor.alpha}set alpha(t){this._backgroundColor.setAlpha(t)}get colorRgba(){return this._backgroundColor.toArray()}destroy(){}};Al.extension={type:[v.WebGLSystem,v.WebGPUSystem,v.CanvasSystem],name:"background",priority:0},Al.defaultOptions={backgroundAlpha:1,backgroundColor:0,clearBeforeRender:!0};let Z0=Al;const Ei={};k.handle(v.BlendMode,r=>{if(!r.name)throw new Error("BlendMode extension must have a name property");Ei[r.name]=r.ref},r=>{delete Ei[r.name]});class El{constructor(t){this._isAdvanced=!1,this._filterHash=Object.create(null),this._renderer=t}setBlendMode(t,e,i){if(this._activeBlendMode===e){this._isAdvanced&&this._renderableList.push(t);return}this._activeBlendMode=e,this._isAdvanced&&this._endAdvancedBlendMode(i),this._isAdvanced=!!Ei[e],this._isAdvanced&&(this._beginAdvancedBlendMode(i),this._renderableList.push(t))}_beginAdvancedBlendMode(t){this._renderer.renderPipes.batch.break(t);const e=this._activeBlendMode;if(!Ei[e])return;let i=this._filterHash[e];i||(i=this._filterHash[e]=new Lr,i.filters=[new Ei[e]]);const s={renderPipeId:"filter",action:"pushFilter",renderables:[],filterEffect:i,canBundle:!1};this._renderableList=s.renderables,t.add(s)}_endAdvancedBlendMode(t){this._renderableList=null,this._renderer.renderPipes.batch.break(t),t.add({renderPipeId:"filter",action:"popFilter",canBundle:!1})}buildStart(){this._isAdvanced=!1}buildEnd(t){this._isAdvanced&&this._endAdvancedBlendMode(t)}destroy(){this._renderer=null,this._renderableList=null;for(const t in this._filterHash)this._filterHash[t].destroy();this._filterHash=null}}El.extension={type:[v.WebGLPipes,v.WebGPUPipes,v.CanvasPipes],name:"blendMode"};var v3=Object.defineProperty,Q0=Object.getOwnPropertySymbols,T3=Object.prototype.hasOwnProperty,S3=Object.prototype.propertyIsEnumerable,J0=(r,t,e)=>t in r?v3(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,wl=(r,t)=>{for(var e in t||(t={}))T3.call(t,e)&&J0(r,e,t[e]);if(Q0)for(var e of Q0(t))S3.call(t,e)&&J0(r,e,t[e]);return r};const Cl={png:"image/png",jpg:"image/jpeg",webp:"image/webp"},Rl=class Wb{constructor(t){this._renderer=t}_normalizeOptions(t,e={}){return t instanceof Z||t instanceof w?wl({target:t},e):wl(wl({},e),t)}async image(t){const e=new Image;return e.src=await this.base64(t),e}async base64(t){t=this._normalizeOptions(t,Wb.defaultImageOptions);const{format:e,quality:i}=t,s=this.canvas(t);if(s.toBlob!==void 0)return new Promise((n,a)=>{s.toBlob(o=>{if(!o){a(new Error("ICanvas.toBlob failed!"));return}const u=new FileReader;u.onload=()=>n(u.result),u.onerror=a,u.readAsDataURL(o)},Cl[e],i)});if(s.toDataURL!==void 0)return s.toDataURL(Cl[e],i);if(s.convertToBlob!==void 0){const n=await s.convertToBlob({type:Cl[e],quality:i});return new Promise((a,o)=>{const u=new FileReader;u.onload=()=>a(u.result),u.onerror=o,u.readAsDataURL(n)})}throw new Error("Extract.base64() requires ICanvas.toDataURL, ICanvas.toBlob, or ICanvas.convertToBlob to be implemented")}canvas(t){t=this._normalizeOptions(t);const e=t.target,i=this._renderer;if(e instanceof w)return i.texture.generateCanvas(e);const s=i.textureGenerator.generateTexture(t),n=i.texture.generateCanvas(s);return s.destroy(),n}pixels(t){t=this._normalizeOptions(t);const e=t.target,i=this._renderer,s=e instanceof w?e:i.textureGenerator.generateTexture(t),n=i.texture.getPixels(s);return e instanceof Z&&s.destroy(),n}texture(t){return t=this._normalizeOptions(t),t.target instanceof w?t.target:this._renderer.textureGenerator.generateTexture(t)}download(t){var e;t=this._normalizeOptions(t);const i=this.canvas(t),s=document.createElement("a");s.download=(e=t.filename)!=null?e:"image.png",s.href=i.toDataURL("image/png"),document.body.appendChild(s),s.click(),document.body.removeChild(s)}log(t){var e;const i=(e=t.width)!=null?e:200;t=this._normalizeOptions(t);const s=this.canvas(t),n=s.toDataURL();console.log(`[Pixi Texture] ${s.width}px ${s.height}px`);const a=["font-size: 1px;",`padding: ${i}px 300px;`,`background: url(${n}) no-repeat;`,"background-size: contain;"].join(" ");console.log("%c ",a)}destroy(){this._renderer=null}};Rl.extension={type:[v.WebGLSystem,v.WebGPUSystem],name:"extract"},Rl.defaultImageOptions={format:"png",quality:1};let t2=Rl;class e2 extends w{static create(t){return new w({source:new rt(t)})}resize(t,e,i){return this.source.resize(t,e,i),this}}var A3=Object.defineProperty,E3=Object.defineProperties,w3=Object.getOwnPropertyDescriptors,r2=Object.getOwnPropertySymbols,C3=Object.prototype.hasOwnProperty,R3=Object.prototype.propertyIsEnumerable,i2=(r,t,e)=>t in r?A3(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,P3=(r,t)=>{for(var e in t||(t={}))C3.call(t,e)&&i2(r,e,t[e]);if(r2)for(var e of r2(t))R3.call(t,e)&&i2(r,e,t[e]);return r},M3=(r,t)=>E3(r,w3(t));const D3=new W,O3=new ft,B3=[0,0,0,0];class Pl{constructor(t){this._renderer=t}generateTexture(t){var e;t instanceof Z&&(t={target:t,frame:void 0,textureSourceOptions:{},resolution:void 0});const i=t.resolution||this._renderer.resolution,s=t.antialias||this._renderer.view.antialias,n=t.target;let a=t.clearColor;a?a=Array.isArray(a)&&a.length===4?a:V.shared.setValue(a).toArray():a=B3;const o=((e=t.frame)==null?void 0:e.copyTo(D3))||Qi(n,O3).rectangle;o.width=Math.max(o.width,1/i)|0,o.height=Math.max(o.height,1/i)|0;const u=e2.create(M3(P3({},t.textureSourceOptions),{width:o.width,height:o.height,resolution:i,antialias:s})),l=G.shared.translate(-o.x,-o.y);return this._renderer.render({container:n,transform:l,target:u,clearColor:a}),u.source.updateMipmaps(),u}destroy(){this._renderer=null}}Pl.extension={type:[v.WebGLSystem,v.WebGPUSystem],name:"textureGenerator"};class Ml{constructor(t){this._stackIndex=0,this._globalUniformDataStack=[],this._uniformsPool=[],this._activeUniforms=[],this._bindGroupPool=[],this._activeBindGroups=[],this._renderer=t}reset(){this._stackIndex=0;for(let t=0;t<this._activeUniforms.length;t++)this._uniformsPool.push(this._activeUniforms[t]);for(let t=0;t<this._activeBindGroups.length;t++)this._bindGroupPool.push(this._activeBindGroups[t]);this._activeUniforms.length=0,this._activeBindGroups.length=0}start(t){this.reset(),this.push(t)}bind({size:t,projectionMatrix:e,worldTransformMatrix:i,worldColor:s,offset:n}){const a=this._renderer.renderTarget.renderTarget,o=this._stackIndex?this._globalUniformDataStack[this._stackIndex-1]:{projectionData:a,worldTransformMatrix:new G,worldColor:4294967295,offset:new nt},u={projectionMatrix:e||this._renderer.renderTarget.projectionMatrix,resolution:t||a.size,worldTransformMatrix:i||o.worldTransformMatrix,worldColor:s||o.worldColor,offset:n||o.offset,bindGroup:null},l=this._uniformsPool.pop()||this._createUniforms();this._activeUniforms.push(l);const c=l.uniforms;c.uProjectionMatrix=u.projectionMatrix,c.uResolution=u.resolution,c.uWorldTransformMatrix.copyFrom(u.worldTransformMatrix),c.uWorldTransformMatrix.tx-=u.offset.x,c.uWorldTransformMatrix.ty-=u.offset.y,Qr(u.worldColor,c.uWorldColorAlpha,0),l.update();let h;this._renderer.renderPipes.uniformBatch?h=this._renderer.renderPipes.uniformBatch.getUniformBindGroup(l,!1):(h=this._bindGroupPool.pop()||new Zt,this._activeBindGroups.push(h),h.setResource(l,0)),u.bindGroup=h,this._currentGlobalUniformData=u}push(t){this.bind(t),this._globalUniformDataStack[this._stackIndex++]=this._currentGlobalUniformData}pop(){this._currentGlobalUniformData=this._globalUniformDataStack[--this._stackIndex-1],this._renderer.type===Dt.WEBGL&&this._currentGlobalUniformData.bindGroup.resources[0].update()}get bindGroup(){return this._currentGlobalUniformData.bindGroup}get uniformGroup(){return this._currentGlobalUniformData.bindGroup.resources[0]}_createUniforms(){return new ut({uProjectionMatrix:{value:new G,type:"mat3x3<f32>"},uWorldTransformMatrix:{value:new G,type:"mat3x3<f32>"},uWorldColorAlpha:{value:new Float32Array(4),type:"vec4<f32>"},uResolution:{value:[0,0],type:"vec2<f32>"}},{isStatic:!0})}destroy(){this._renderer=null}}Ml.extension={type:[v.WebGLSystem,v.WebGPUSystem,v.CanvasSystem],name:"globalUniforms"};let s2=!1;const Dl="8.2.1";function n2(r){if(!s2){if(j.get().getNavigator().userAgent.toLowerCase().indexOf("chrome")>-1){const t=[`%c %c %c %c %c PixiJS %c v${Dl} (${r}) http://www.pixijs.com/
1971
1971
 
1972
1972
  `,"background: #E72264; padding:5px 0;","background: #6CA2EA; padding:5px 0;","background: #B5D33D; padding:5px 0;","background: #FED23F; padding:5px 0;","color: #FFFFFF; background: #E72264; padding:5px 0;","color: #E72264; background: #FFFFFF; padding:5px 0;"];globalThis.console.log(...t)}else globalThis.console&&globalThis.console.log(`PixiJS ${Dl} - ${r} - http://www.pixijs.com/`);s2=!0}}class bn{constructor(t){this._renderer=t}init(t){if(t.hello){let e=this._renderer.name;this._renderer.type===Dt.WEBGL&&(e+=` ${this._renderer.context.webGLVersion}`),n2(e)}}}bn.extension={type:[v.WebGLSystem,v.WebGPUSystem,v.CanvasSystem],name:"hello",priority:-2},bn.defaultOptions={hello:!1};var G3=Object.defineProperty,a2=Object.getOwnPropertySymbols,F3=Object.prototype.hasOwnProperty,I3=Object.prototype.propertyIsEnumerable,o2=(r,t,e)=>t in r?G3(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,u2=(r,t)=>{for(var e in t||(t={}))F3.call(t,e)&&o2(r,e,t[e]);if(a2)for(var e of a2(t))I3.call(t,e)&&o2(r,e,t[e]);return r};const Ol=class Yb{constructor(t){this._renderer=t,this.count=0,this.checkCount=0}init(t){t=u2(u2({},Yb.defaultOptions),t),this.checkCountMax=t.textureGCCheckCountMax,this.maxIdle=t.textureGCAMaxIdle,this.active=t.textureGCActive}postrender(){this._renderer.renderingToScreen&&(this.count++,this.active&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))}run(){const t=this._renderer.texture.managedTextures;for(let e=0;e<t.length;e++){const i=t[e];i.autoGarbageCollect&&i.resource&&i._touched>-1&&this.count-i._touched>this.maxIdle&&(i._touched=-1,i.unload())}}destroy(){this._renderer=null}};Ol.extension={type:[v.WebGLSystem,v.WebGPUSystem],name:"textureGC"},Ol.defaultOptions={textureGCActive:!0,textureGCAMaxIdle:3600,textureGCCheckCountMax:600};let Bl=Ol;k.add(Bl);var U3=Object.defineProperty,l2=Object.getOwnPropertySymbols,N3=Object.prototype.hasOwnProperty,k3=Object.prototype.propertyIsEnumerable,c2=(r,t,e)=>t in r?U3(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,h2=(r,t)=>{for(var e in t||(t={}))N3.call(t,e)&&c2(r,e,t[e]);if(l2)for(var e of l2(t))k3.call(t,e)&&c2(r,e,t[e]);return r};const Gl=class qb{get resolution(){return this.texture.source._resolution}set resolution(t){this.texture.source.resize(this.texture.source.width,this.texture.source.height,t)}init(t){t=h2(h2({},qb.defaultOptions),t),t.view&&(t.canvas=t.view),this.screen=new W(0,0,t.width,t.height),this.canvas=t.canvas||j.get().createCanvas(),this.antialias=!!t.antialias,this.texture=Ju(this.canvas,t),this.renderTarget=new fn({colorTextures:[this.texture],depth:!!t.depth,isRoot:!0}),this.texture.source.transparent=t.backgroundAlpha<1,this.multiView=!!t.multiView,this.autoDensity&&(this.canvas.style.width=`${this.texture.width}px`,this.canvas.style.height=`${this.texture.height}px`),this.resolution=t.resolution}resize(t,e,i){this.texture.source.resize(t,e,i),this.screen.width=this.texture.frame.width,this.screen.height=this.texture.frame.height,this.autoDensity&&(this.canvas.style.width=`${t}px`,this.canvas.style.height=`${e}px`)}destroy(t=!1){(typeof t=="boolean"?t:t!=null&&t.removeView)&&this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)}};Gl.extension={type:[v.WebGLSystem,v.WebGPUSystem,v.CanvasSystem],name:"view",priority:0},Gl.defaultOptions={width:800,height:600,autoDensity:!1,antialias:!1};let d2=Gl;const Fl=[Z0,Ml,bn,d2,Tl,Bl,Pl,t2,tu],Il=[El,Fu,Sl,gl,Iu,Nu,Uu,pl],L3=[...Fl,Qu,e0,Y_,ku,hl,el,Xu,ol,al,Vu,B0,Wu,ju],$3=[...Il],H3=[Bu,fl,dl],f2=[],p2=[],m2=[];k.handleByNamedList(v.WebGLSystem,f2),k.handleByNamedList(v.WebGLPipes,p2),k.handleByNamedList(v.WebGLPipesAdaptor,m2),k.add(...L3,...$3,...H3);class g2 extends ci{constructor(){const t={name:"webgl",type:Dt.WEBGL,systems:f2,renderPipes:p2,renderPipeAdaptors:m2};super(t)}}var X3={__proto__:null,WebGLRenderer:g2};class Ul{constructor(t){this._hash=Object.create(null),this._renderer=t}contextChange(t){this._gpu=t}getBindGroup(t,e,i){return t._updateKey(),this._hash[t._key]||this._createBindGroup(t,e,i)}_createBindGroup(t,e,i){var s;const n=this._gpu.device,a=e.layout[i],o=[],u=this._renderer;for(const h in a){const f=(s=t.resources[h])!=null?s:t.resources[a[h]];let p;if(f._resourceType==="uniformGroup"){const m=f;u.ubo.updateUniformGroup(m);const _=m.buffer;p={buffer:u.buffer.getGPUBuffer(_),offset:0,size:_.descriptor.size}}else if(f._resourceType==="buffer"){const m=f;p={buffer:u.buffer.getGPUBuffer(m),offset:0,size:m.descriptor.size}}else if(f._resourceType==="bufferResource"){const m=f;p={buffer:u.buffer.getGPUBuffer(m.buffer),offset:m.offset,size:m.size}}else if(f._resourceType==="textureSampler"){const m=f;p=u.texture.getGpuSampler(m)}else if(f._resourceType==="textureSource"){const m=f;p=u.texture.getGpuSource(m).createView({})}o.push({binding:a[h],resource:p})}const l=u.shader.getProgramData(e).bindGroups[i],c=n.createBindGroup({layout:l,entries:o});return this._hash[t._key]=c,c}destroy(){for(const t of Object.keys(this._hash))this._hash[t]=null;this._hash=null,this._renderer=null}}Ul.extension={type:[v.WebGPUSystem],name:"bindGroup"};class Nl{constructor(){this._gpuBuffers=Object.create(null),this._managedBuffers=[]}contextChange(t){this._gpu=t}getGPUBuffer(t){return this._gpuBuffers[t.uid]||this.createGPUBuffer(t)}updateBuffer(t){const e=this._gpuBuffers[t.uid]||this.createGPUBuffer(t),i=t.data;return t._updateID&&i&&(t._updateID=0,this._gpu.device.queue.writeBuffer(e,0,i.buffer,0,(t._updateSize||i.byteLength)+3&-4)),e}destroyAll(){for(const t in this._gpuBuffers)this._gpuBuffers[t].destroy();this._gpuBuffers={}}createGPUBuffer(t){this._gpuBuffers[t.uid]||(t.on("update",this.updateBuffer,this),t.on("change",this.onBufferChange,this),t.on("destroy",this.onBufferDestroy,this));const e=this._gpu.device.createBuffer(t.descriptor);return t._updateID=0,t.data&&(ns(t.data.buffer,e.getMappedRange()),e.unmap()),this._gpuBuffers[t.uid]=e,this._managedBuffers.push(t),e}onBufferChange(t){this._gpuBuffers[t.uid].destroy(),t._updateID=0,this._gpuBuffers[t.uid]=this.createGPUBuffer(t)}onBufferDestroy(t){this._managedBuffers.splice(this._managedBuffers.indexOf(t),1),this._destroyBuffer(t)}destroy(){this._managedBuffers.forEach(t=>this._destroyBuffer(t)),this._managedBuffers=null,this._gpuBuffers=null}_destroyBuffer(t){this._gpuBuffers[t.uid].destroy(),t.off("update",this.updateBuffer,this),t.off("change",this.onBufferChange,this),t.off("destroy",this.onBufferDestroy,this),this._gpuBuffers[t.uid]=null}}Nl.extension={type:[v.WebGPUSystem],name:"buffer"};function z3(r,t){const e=r.descriptor.size,i=t.gpu.device,s=new Ct({data:new Float32Array(24e5),usage:X.MAP_READ|X.COPY_DST}),n=t.buffer.createGPUBuffer(s),a=i.createCommandEncoder();a.copyBufferToBuffer(t.buffer.getGPUBuffer(r),0,n,0,e),i.queue.submit([a.finish()]),n.mapAsync(GPUMapMode.READ,0,e).then(()=>{n.getMappedRange(0,e),n.unmap()})}class _2{constructor({minUniformOffsetAlignment:t}){this._minUniformOffsetAlignment=256,this.byteIndex=0,this._minUniformOffsetAlignment=t,this.data=new Float32Array(65535)}clear(){this.byteIndex=0}addEmptyGroup(t){if(t>this._minUniformOffsetAlignment/4)throw new Error(`UniformBufferBatch: array is too large: ${t*4}`);const e=this.byteIndex;let i=e+t*4;if(i=Math.ceil(i/this._minUniformOffsetAlignment)*this._minUniformOffsetAlignment,i>this.data.length*4)throw new Error("UniformBufferBatch: ubo batch got too big");return this.byteIndex=i,e}addGroup(t){const e=this.addEmptyGroup(t.length);for(let i=0;i<t.length;i++)this.data[e/4+i]=t[i];return e}destroy(){this._buffer.destroy(),this._buffer=null,this.data=null}}class kl{constructor(t){this._colorMaskCache=15,this._renderer=t}setMask(t){this._colorMaskCache!==t&&(this._colorMaskCache=t,this._renderer.pipeline.setColorMask(t))}destroy(){this._renderer=null,this._colorMaskCache=null}}kl.extension={type:[v.WebGPUSystem],name:"colorMask"};class xn{constructor(t){this._renderer=t}async init(t){return this._initPromise?this._initPromise:(this._initPromise=this._createDeviceAndAdaptor(t).then(e=>{this.gpu=e,this._renderer.runners.contextChange.emit(this.gpu)}),this._initPromise)}contextChange(t){this._renderer.gpu=t}async _createDeviceAndAdaptor(t){const e=await navigator.gpu.requestAdapter({powerPreference:t.powerPreference,forceFallbackAdapter:t.forceFallbackAdapter}),i=["texture-compression-bc","texture-compression-astc","texture-compression-etc2"].filter(n=>e.features.has(n)),s=await e.requestDevice({requiredFeatures:i});return{adapter:e,device:s}}destroy(){this.gpu=null,this._renderer=null}}xn.extension={type:[v.WebGPUSystem],name:"device"},xn.defaultOptions={powerPreference:void 0,forceFallbackAdapter:!1};var j3=Object.defineProperty,b2=Object.getOwnPropertySymbols,V3=Object.prototype.hasOwnProperty,W3=Object.prototype.propertyIsEnumerable,x2=(r,t,e)=>t in r?j3(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,y2=(r,t)=>{for(var e in t||(t={}))V3.call(t,e)&&x2(r,e,t[e]);if(b2)for(var e of b2(t))W3.call(t,e)&&x2(r,e,t[e]);return r};class Ll{constructor(t){this._boundBindGroup=Object.create(null),this._boundVertexBuffer=Object.create(null),this._renderer=t}renderStart(){this.commandFinished=new Promise(t=>{this._resolveCommandFinished=t}),this.commandEncoder=this._renderer.gpu.device.createCommandEncoder()}beginRenderPass(t){this.endRenderPass(),this._clearCache(),this.renderPassEncoder=this.commandEncoder.beginRenderPass(t.descriptor)}endRenderPass(){this.renderPassEncoder&&this.renderPassEncoder.end(),this.renderPassEncoder=null}setViewport(t){this.renderPassEncoder.setViewport(t.x,t.y,t.width,t.height,0,1)}setPipelineFromGeometryProgramAndState(t,e,i,s){const n=this._renderer.pipeline.getPipeline(t,e,i,s);this.setPipeline(n)}setPipeline(t){this._boundPipeline!==t&&(this._boundPipeline=t,this.renderPassEncoder.setPipeline(t))}_setVertexBuffer(t,e){this._boundVertexBuffer[t]!==e&&(this._boundVertexBuffer[t]=e,this.renderPassEncoder.setVertexBuffer(t,this._renderer.buffer.updateBuffer(e)))}_setIndexBuffer(t){if(this._boundIndexBuffer===t)return;this._boundIndexBuffer=t;const e=t.data.BYTES_PER_ELEMENT===2?"uint16":"uint32";this.renderPassEncoder.setIndexBuffer(this._renderer.buffer.updateBuffer(t),e)}resetBindGroup(t){this._boundBindGroup[t]=null}setBindGroup(t,e,i){if(this._boundBindGroup[t]===e)return;this._boundBindGroup[t]=e,e._touch(this._renderer.textureGC.count);const s=this._renderer.bindGroup.getBindGroup(e,i,t);this.renderPassEncoder.setBindGroup(t,s)}setGeometry(t){for(const e in t.attributes){const i=t.attributes[e];this._setVertexBuffer(i.location,i.buffer)}t.indexBuffer&&this._setIndexBuffer(t.indexBuffer)}_setShaderBindGroups(t,e){for(const i in t.groups){const s=t.groups[i];e||this._syncBindGroup(s),this.setBindGroup(i,s,t.gpuProgram)}}_syncBindGroup(t){for(const e in t.resources){const i=t.resources[e];i.isUniformGroup&&this._renderer.ubo.updateUniformGroup(i)}}draw(t){const{geometry:e,shader:i,state:s,topology:n,size:a,start:o,instanceCount:u,skipSync:l}=t;this.setPipelineFromGeometryProgramAndState(e,i.gpuProgram,s,n),this.setGeometry(e),this._setShaderBindGroups(i,l),e.indexBuffer?this.renderPassEncoder.drawIndexed(a||e.indexBuffer.data.length,u||e.instanceCount,o||0):this.renderPassEncoder.draw(a||e.getSize(),u||e.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 t=this._renderer.renderTarget.adaptor.getDescriptor(this._renderer.renderTarget.renderTarget,!1,[0,0,0,1]);this.renderPassEncoder=this.commandEncoder.beginRenderPass(t);const e=this._boundPipeline,i=y2({},this._boundVertexBuffer),s=this._boundIndexBuffer,n=y2({},this._boundBindGroup);this._clearCache();const a=this._renderer.renderTarget.viewport;this.renderPassEncoder.setViewport(a.x,a.y,a.width,a.height,0,1),this.setPipeline(e);for(const o in i)this._setVertexBuffer(o,i[o]);for(const o in n)this.setBindGroup(o,n[o],null);this._setIndexBuffer(s)}_clearCache(){for(let t=0;t<16;t++)this._boundBindGroup[t]=null,this._boundVertexBuffer[t]=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(t){this._gpu=t}}Ll.extension={type:[v.WebGPUSystem],name:"encoder",priority:1};class $l{constructor(t){this._renderTargetStencilState=Object.create(null),this._renderer=t,t.renderTarget.onRenderTargetChange.add(this)}onRenderTargetChange(t){let e=this._renderTargetStencilState[t.uid];e||(e=this._renderTargetStencilState[t.uid]={stencilMode:ot.DISABLED,stencilReference:0}),this._activeRenderTarget=t,this.setStencilMode(e.stencilMode,e.stencilReference)}setStencilMode(t,e){const i=this._renderTargetStencilState[this._activeRenderTarget.uid];i.stencilMode=t,i.stencilReference=e;const s=this._renderer;s.pipeline.setStencilMode(t),s.encoder.renderPassEncoder.setStencilReference(e)}destroy(){this._renderer.renderTarget.onRenderTargetChange.remove(this),this._renderer=null,this._activeRenderTarget=null,this._renderTargetStencilState=null}}$l.extension={type:[v.WebGPUSystem],name:"stencil"};const wi={i32:{align:4,size:4},u32:{align:4,size:4},f32:{align:4,size:4},f16:{align:2,size:2},"vec2<i32>":{align:8,size:8},"vec2<u32>":{align:8,size:8},"vec2<f32>":{align:8,size:8},"vec2<f16>":{align:4,size:4},"vec3<i32>":{align:16,size:12},"vec3<u32>":{align:16,size:12},"vec3<f32>":{align:16,size:12},"vec3<f16>":{align:8,size:6},"vec4<i32>":{align:16,size:16},"vec4<u32>":{align:16,size:16},"vec4<f32>":{align:16,size:16},"vec4<f16>":{align:8,size:8},"mat2x2<f32>":{align:8,size:16},"mat2x2<f16>":{align:4,size:8},"mat3x2<f32>":{align:8,size:24},"mat3x2<f16>":{align:4,size:12},"mat4x2<f32>":{align:8,size:32},"mat4x2<f16>":{align:4,size:16},"mat2x3<f32>":{align:16,size:32},"mat2x3<f16>":{align:8,size:16},"mat3x3<f32>":{align:16,size:48},"mat3x3<f16>":{align:8,size:24},"mat4x3<f32>":{align:16,size:64},"mat4x3<f16>":{align:8,size:32},"mat2x4<f32>":{align:16,size:32},"mat2x4<f16>":{align:8,size:16},"mat3x4<f32>":{align:16,size:48},"mat3x4<f16>":{align:8,size:24},"mat4x4<f32>":{align:16,size:64},"mat4x4<f16>":{align:8,size:32}};function v2(r){const t=r.map(i=>({data:i,offset:0,size:0}));let e=0;for(let i=0;i<t.length;i++){const s=t[i];let n=wi[s.data.type].size;const a=wi[s.data.type].align;if(!wi[s.data.type])throw new Error(`[Pixi.js] WebGPU UniformBuffer: Unknown type ${s.data.type}`);s.data.size>1&&(n=Math.max(n,a)*s.data.size),e=Math.ceil(e/a)*a,s.size=n,s.offset=e,e+=n}return e=Math.ceil(e/16)*16,{uboElements:t,size:e}}function T2(r,t){const{size:e,align:i}=wi[r.data.type],s=(i-e)/4;return`
1973
1973
  v = uv.${r.data.name};
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * PixiJS - v8.2.0
3
- * Compiled Tue, 25 Jun 2024 11:06:28 UTC
2
+ * PixiJS - v8.2.1
3
+ * Compiled Tue, 25 Jun 2024 11:46:34 UTC
4
4
  *
5
5
  * PixiJS is licensed under the MIT License.
6
6
  * http://www.opensource.org/licenses/mit-license
@@ -1967,7 +1967,7 @@ fn setSaturation(c: vec3<f32>, s: f32) -> vec3<f32> {
1967
1967
  `))}class ol{constructor(t){this._cache={},this._uniformGroupSyncHash={},this._renderer=t,this.gl=null,this._cache={}}contextChange(t){this.gl=t}updateUniformGroup(t,e,s){const i=this._renderer.shader._getProgramData(e);(!t.isStatic||t._dirtyId!==i.uniformDirtyGroups[t.uid])&&(i.uniformDirtyGroups[t.uid]=t._dirtyId,this._getUniformSyncFunction(t,e)(i.uniformData,t.uniforms,this._renderer,s))}_getUniformSyncFunction(t,e){var s;return((s=this._uniformGroupSyncHash[t._signature])==null?void 0:s[e._key])||this._createUniformSyncFunction(t,e)}_createUniformSyncFunction(t,e){const s=this._uniformGroupSyncHash[t._signature]||(this._uniformGroupSyncHash[t._signature]={}),i=this._getSignature(t,e._uniformData,"u");return this._cache[i]||(this._cache[i]=this._generateUniformsSync(t,e._uniformData)),s[e._key]=this._cache[i],s[e._key]}_generateUniformsSync(t,e){return B0(t,e)}_getSignature(t,e,s){const i=t.uniforms,n=[`${s}-`];for(const o in i)n.push(o),e[o]&&n.push(e[o].type);return n.join("-")}destroy(){this._renderer=null,this._cache=null}}ol.extension={type:[v.WebGLSystem],name:"uniformGroup"};function u3(r){return r=r.replaceAll("texture2D","texture").replaceAll("gl_FragColor","finalColor").replaceAll("varying","in"),r=`
1968
1968
  out vec4 finalColor;
1969
1969
  ${r}
1970
- `,r}const l3={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,uint:1,uvec2:2,uvec3:3,uvec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function c3(r){return l3[r]}function G0(r){const t={};return t.normal=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t.add=[r.ONE,r.ONE],t.multiply=[r.DST_COLOR,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA],t.screen=[r.ONE,r.ONE_MINUS_SRC_COLOR,r.ONE,r.ONE_MINUS_SRC_ALPHA],t.none=[0,0],t["normal-npm"]=[r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA],t["add-npm"]=[r.SRC_ALPHA,r.ONE,r.ONE,r.ONE],t["screen-npm"]=[r.SRC_ALPHA,r.ONE_MINUS_SRC_COLOR,r.ONE,r.ONE_MINUS_SRC_ALPHA],t.erase=[r.ZERO,r.ONE_MINUS_SRC_ALPHA],t}const h3=0,d3=1,p3=2,f3=3,m3=4,g3=5,I0=class uc{constructor(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode="none",this._blendEq=!1,this.map=[],this.map[h3]=this.setBlend,this.map[d3]=this.setOffset,this.map[p3]=this.setCullFace,this.map[f3]=this.setDepthTest,this.map[m3]=this.setFrontFace,this.map[g3]=this.setDepthMask,this.checks=[],this.defaultState=$t.for2d()}contextChange(t){this.gl=t,this.blendModesMap=G0(t),this.reset()}set(t){if(t=t||this.defaultState,this.stateId!==t.data){let e=this.stateId^t.data,s=0;for(;e;)e&1&&this.map[s].call(this,!!(t.data&1<<s)),e=e>>1,s++;this.stateId=t.data}for(let e=0;e<this.checks.length;e++)this.checks[e](this,t)}forceState(t){t=t||this.defaultState;for(let e=0;e<this.map.length;e++)this.map[e].call(this,!!(t.data&1<<e));for(let e=0;e<this.checks.length;e++)this.checks[e](this,t);this.stateId=t.data}setBlend(t){this._updateCheck(uc._checkBlendMode,t),this.gl[t?"enable":"disable"](this.gl.BLEND)}setOffset(t){this._updateCheck(uc._checkPolygonOffset,t),this.gl[t?"enable":"disable"](this.gl.POLYGON_OFFSET_FILL)}setDepthTest(t){this.gl[t?"enable":"disable"](this.gl.DEPTH_TEST)}setDepthMask(t){this.gl.depthMask(t)}setCullFace(t){this.gl[t?"enable":"disable"](this.gl.CULL_FACE)}setFrontFace(t){this.gl.frontFace(this.gl[t?"CW":"CCW"])}setBlendMode(t){if(this.blendModesMap[t]||(t="normal"),t===this.blendMode)return;this.blendMode=t;const e=this.blendModesMap[t],s=this.gl;e.length===2?s.blendFunc(e[0],e[1]):s.blendFuncSeparate(e[0],e[1],e[2],e[3]),e.length===6?(this._blendEq=!0,s.blendEquationSeparate(e[4],e[5])):this._blendEq&&(this._blendEq=!1,s.blendEquationSeparate(s.FUNC_ADD,s.FUNC_ADD))}setPolygonOffset(t,e){this.gl.polygonOffset(t,e)}reset(){this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,!1),this.forceState(this.defaultState),this._blendEq=!0,this.blendMode="",this.setBlendMode("normal")}_updateCheck(t,e){const s=this.checks.indexOf(t);e&&s===-1?this.checks.push(t):!e&&s!==-1&&this.checks.splice(s,1)}static _checkBlendMode(t,e){t.setBlendMode(e.blendMode)}static _checkPolygonOffset(t,e){t.setPolygonOffset(1,e.polygonOffset)}destroy(){this.gl=null,this.checks.length=0}};I0.extension={type:[v.WebGLSystem],name:"state"};let F0=I0;class U0{constructor(t){this.target=$u.TEXTURE_2D,this.texture=t,this.width=-1,this.height=-1,this.type=X.UNSIGNED_BYTE,this.internalFormat=hn.RGBA,this.format=hn.RGBA,this.samplerType=0}}const N0={id:"buffer",upload(r,t,e){t.width===r.width||t.height===r.height?e.texSubImage2D(e.TEXTURE_2D,0,0,0,r.width,r.height,t.format,t.type,r.resource):e.texImage2D(t.target,0,t.internalFormat,r.width,r.height,0,t.format,t.type,r.resource),t.width=r.width,t.height=r.height}},_3={"bc1-rgba-unorm":!0,"bc1-rgba-unorm-srgb":!0,"bc2-rgba-unorm":!0,"bc2-rgba-unorm-srgb":!0,"bc3-rgba-unorm":!0,"bc3-rgba-unorm-srgb":!0,"bc4-r-unorm":!0,"bc4-r-snorm":!0,"bc5-rg-unorm":!0,"bc5-rg-snorm":!0,"bc6h-rgb-ufloat":!0,"bc6h-rgb-float":!0,"bc7-rgba-unorm":!0,"bc7-rgba-unorm-srgb":!0,"etc2-rgb8unorm":!0,"etc2-rgb8unorm-srgb":!0,"etc2-rgb8a1unorm":!0,"etc2-rgb8a1unorm-srgb":!0,"etc2-rgba8unorm":!0,"etc2-rgba8unorm-srgb":!0,"eac-r11unorm":!0,"eac-r11snorm":!0,"eac-rg11unorm":!0,"eac-rg11snorm":!0,"astc-4x4-unorm":!0,"astc-4x4-unorm-srgb":!0,"astc-5x4-unorm":!0,"astc-5x4-unorm-srgb":!0,"astc-5x5-unorm":!0,"astc-5x5-unorm-srgb":!0,"astc-6x5-unorm":!0,"astc-6x5-unorm-srgb":!0,"astc-6x6-unorm":!0,"astc-6x6-unorm-srgb":!0,"astc-8x5-unorm":!0,"astc-8x5-unorm-srgb":!0,"astc-8x6-unorm":!0,"astc-8x6-unorm-srgb":!0,"astc-8x8-unorm":!0,"astc-8x8-unorm-srgb":!0,"astc-10x5-unorm":!0,"astc-10x5-unorm-srgb":!0,"astc-10x6-unorm":!0,"astc-10x6-unorm-srgb":!0,"astc-10x8-unorm":!0,"astc-10x8-unorm-srgb":!0,"astc-10x10-unorm":!0,"astc-10x10-unorm-srgb":!0,"astc-12x10-unorm":!0,"astc-12x10-unorm-srgb":!0,"astc-12x12-unorm":!0,"astc-12x12-unorm-srgb":!0},k0={id:"compressed",upload(r,t,e){e.pixelStorei(e.UNPACK_ALIGNMENT,4);let s=r.pixelWidth,i=r.pixelHeight;const n=!!_3[r.format];for(let o=0;o<r.resource.length;o++){const a=r.resource[o];n?e.compressedTexImage2D(e.TEXTURE_2D,o,t.internalFormat,s,i,0,a):e.texImage2D(e.TEXTURE_2D,o,t.internalFormat,s,i,0,t.format,t.type,a),s=Math.max(s>>1,1),i=Math.max(i>>1,1)}}},al={id:"image",upload(r,t,e,s){const i=r.alphaMode==="premultiply-alpha-on-upload";e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i);const n=t.width,o=t.height,a=r.pixelWidth,u=r.pixelHeight,l=r.resourceWidth,c=r.resourceHeight;l<a||c<u?((n!==a||o!==u)&&e.texImage2D(t.target,0,t.internalFormat,a,u,0,t.format,t.type,null),s===2?e.texSubImage2D(e.TEXTURE_2D,0,0,0,l,c,t.format,t.type,r.resource):e.texSubImage2D(e.TEXTURE_2D,0,0,0,t.format,t.type,r.resource)):n===a||o===u?e.texSubImage2D(e.TEXTURE_2D,0,0,0,t.format,t.type,r.resource):s===2?e.texImage2D(t.target,0,t.internalFormat,a,u,0,t.format,t.type,r.resource):e.texImage2D(t.target,0,t.internalFormat,t.format,t.type,r.resource),t.width=a,t.height=u}},L0={id:"video",upload(r,t,e,s){if(!r.isValid){e.texImage2D(t.target,0,t.internalFormat,1,1,0,t.format,t.type,null);return}al.upload(r,t,e,s)}},ul={linear:9729,nearest:9728},$0={linear:{linear:9987,nearest:9985},nearest:{linear:9986,nearest:9984}},gn={"clamp-to-edge":33071,repeat:10497,"mirror-repeat":33648},H0={never:512,less:513,equal:514,"less-equal":515,greater:516,"not-equal":517,"greater-equal":518,always:519};function ll(r,t,e,s,i,n,o,a){const u=n;if(!a||r.addressModeU!=="repeat"||r.addressModeV!=="repeat"||r.addressModeW!=="repeat"){const l=gn[o?"clamp-to-edge":r.addressModeU],c=gn[o?"clamp-to-edge":r.addressModeV],h=gn[o?"clamp-to-edge":r.addressModeW];t[i](u,t.TEXTURE_WRAP_S,l),t[i](u,t.TEXTURE_WRAP_T,c),t.TEXTURE_WRAP_R&&t[i](u,t.TEXTURE_WRAP_R,h)}if((!a||r.magFilter!=="linear")&&t[i](u,t.TEXTURE_MAG_FILTER,ul[r.magFilter]),e){if(!a||r.mipmapFilter!=="linear"){const l=$0[r.minFilter][r.mipmapFilter];t[i](u,t.TEXTURE_MIN_FILTER,l)}}else t[i](u,t.TEXTURE_MIN_FILTER,ul[r.minFilter]);if(s&&r.maxAnisotropy>1){const l=Math.min(r.maxAnisotropy,t.getParameter(s.MAX_TEXTURE_MAX_ANISOTROPY_EXT));t[i](u,s.TEXTURE_MAX_ANISOTROPY_EXT,l)}r.compare&&t[i](u,t.TEXTURE_COMPARE_FUNC,H0[r.compare])}function X0(r){return{r8unorm:r.RED,r8snorm:r.RED,r8uint:r.RED,r8sint:r.RED,r16uint:r.RED,r16sint:r.RED,r16float:r.RED,rg8unorm:r.RG,rg8snorm:r.RG,rg8uint:r.RG,rg8sint:r.RG,r32uint:r.RED,r32sint:r.RED,r32float:r.RED,rg16uint:r.RG,rg16sint:r.RG,rg16float:r.RG,rgba8unorm:r.RGBA,"rgba8unorm-srgb":r.RGBA,rgba8snorm:r.RGBA,rgba8uint:r.RGBA,rgba8sint:r.RGBA,bgra8unorm:r.RGBA,"bgra8unorm-srgb":r.RGBA,rgb9e5ufloat:r.RGB,rgb10a2unorm:r.RGBA,rg11b10ufloat:r.RGB,rg32uint:r.RG,rg32sint:r.RG,rg32float:r.RG,rgba16uint:r.RGBA,rgba16sint:r.RGBA,rgba16float:r.RGBA,rgba32uint:r.RGBA,rgba32sint:r.RGBA,rgba32float:r.RGBA,stencil8:r.STENCIL_INDEX8,depth16unorm:r.DEPTH_COMPONENT,depth24plus:r.DEPTH_COMPONENT,"depth24plus-stencil8":r.DEPTH_STENCIL,depth32float:r.DEPTH_COMPONENT,"depth32float-stencil8":r.DEPTH_STENCIL}}var x3=Object.defineProperty,b3=Object.defineProperties,v3=Object.getOwnPropertyDescriptors,z0=Object.getOwnPropertySymbols,y3=Object.prototype.hasOwnProperty,T3=Object.prototype.propertyIsEnumerable,j0=(r,t,e)=>t in r?x3(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,ke=(r,t)=>{for(var e in t||(t={}))y3.call(t,e)&&j0(r,e,t[e]);if(z0)for(var e of z0(t))T3.call(t,e)&&j0(r,e,t[e]);return r},A3=(r,t)=>b3(r,v3(t));function V0(r,t){let e={},s=r.RGBA;return r instanceof z.get().getWebGLRenderingContext()?t.srgb&&(e={"rgba8unorm-srgb":t.srgb.SRGB8_ALPHA8_EXT,"bgra8unorm-srgb":t.srgb.SRGB8_ALPHA8_EXT}):(e={"rgba8unorm-srgb":r.SRGB8_ALPHA8,"bgra8unorm-srgb":r.SRGB8_ALPHA8},s=r.RGBA8),ke(ke(ke(ke(ke(ke(A3(ke({r8unorm:r.R8,r8snorm:r.R8_SNORM,r8uint:r.R8UI,r8sint:r.R8I,r16uint:r.R16UI,r16sint:r.R16I,r16float:r.R16F,rg8unorm:r.RG8,rg8snorm:r.RG8_SNORM,rg8uint:r.RG8UI,rg8sint:r.RG8I,r32uint:r.R32UI,r32sint:r.R32I,r32float:r.R32F,rg16uint:r.RG16UI,rg16sint:r.RG16I,rg16float:r.RG16F,rgba8unorm:r.RGBA},e),{rgba8snorm:r.RGBA8_SNORM,rgba8uint:r.RGBA8UI,rgba8sint:r.RGBA8I,bgra8unorm:s,rgb9e5ufloat:r.RGB9_E5,rgb10a2unorm:r.RGB10_A2,rg11b10ufloat:r.R11F_G11F_B10F,rg32uint:r.RG32UI,rg32sint:r.RG32I,rg32float:r.RG32F,rgba16uint:r.RGBA16UI,rgba16sint:r.RGBA16I,rgba16float:r.RGBA16F,rgba32uint:r.RGBA32UI,rgba32sint:r.RGBA32I,rgba32float:r.RGBA32F,stencil8:r.STENCIL_INDEX8,depth16unorm:r.DEPTH_COMPONENT16,depth24plus:r.DEPTH_COMPONENT24,"depth24plus-stencil8":r.DEPTH24_STENCIL8,depth32float:r.DEPTH_COMPONENT32F,"depth32float-stencil8":r.DEPTH32F_STENCIL8}),t.s3tc?{"bc1-rgba-unorm":t.s3tc.COMPRESSED_RGBA_S3TC_DXT1_EXT,"bc2-rgba-unorm":t.s3tc.COMPRESSED_RGBA_S3TC_DXT3_EXT,"bc3-rgba-unorm":t.s3tc.COMPRESSED_RGBA_S3TC_DXT5_EXT}:{}),t.s3tc_sRGB?{"bc1-rgba-unorm-srgb":t.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,"bc2-rgba-unorm-srgb":t.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,"bc3-rgba-unorm-srgb":t.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}:{}),t.rgtc?{"bc4-r-unorm":t.rgtc.COMPRESSED_RED_RGTC1_EXT,"bc4-r-snorm":t.rgtc.COMPRESSED_SIGNED_RED_RGTC1_EXT,"bc5-rg-unorm":t.rgtc.COMPRESSED_RED_GREEN_RGTC2_EXT,"bc5-rg-snorm":t.rgtc.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}:{}),t.bptc?{"bc6h-rgb-float":t.bptc.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,"bc6h-rgb-ufloat":t.bptc.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,"bc7-rgba-unorm":t.bptc.COMPRESSED_RGBA_BPTC_UNORM_EXT,"bc7-rgba-unorm-srgb":t.bptc.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT}:{}),t.etc?{"etc2-rgb8unorm":t.etc.COMPRESSED_RGB8_ETC2,"etc2-rgb8unorm-srgb":t.etc.COMPRESSED_SRGB8_ETC2,"etc2-rgb8a1unorm":t.etc.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,"etc2-rgb8a1unorm-srgb":t.etc.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,"etc2-rgba8unorm":t.etc.COMPRESSED_RGBA8_ETC2_EAC,"etc2-rgba8unorm-srgb":t.etc.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,"eac-r11unorm":t.etc.COMPRESSED_R11_EAC,"eac-rg11unorm":t.etc.COMPRESSED_SIGNED_RG11_EAC}:{}),t.astc?{"astc-4x4-unorm":t.astc.COMPRESSED_RGBA_ASTC_4x4_KHR,"astc-4x4-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,"astc-5x4-unorm":t.astc.COMPRESSED_RGBA_ASTC_5x4_KHR,"astc-5x4-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR,"astc-5x5-unorm":t.astc.COMPRESSED_RGBA_ASTC_5x5_KHR,"astc-5x5-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,"astc-6x5-unorm":t.astc.COMPRESSED_RGBA_ASTC_6x5_KHR,"astc-6x5-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,"astc-6x6-unorm":t.astc.COMPRESSED_RGBA_ASTC_6x6_KHR,"astc-6x6-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,"astc-8x5-unorm":t.astc.COMPRESSED_RGBA_ASTC_8x5_KHR,"astc-8x5-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,"astc-8x6-unorm":t.astc.COMPRESSED_RGBA_ASTC_8x6_KHR,"astc-8x6-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,"astc-8x8-unorm":t.astc.COMPRESSED_RGBA_ASTC_8x8_KHR,"astc-8x8-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,"astc-10x5-unorm":t.astc.COMPRESSED_RGBA_ASTC_10x5_KHR,"astc-10x5-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,"astc-10x6-unorm":t.astc.COMPRESSED_RGBA_ASTC_10x6_KHR,"astc-10x6-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,"astc-10x8-unorm":t.astc.COMPRESSED_RGBA_ASTC_10x8_KHR,"astc-10x8-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,"astc-10x10-unorm":t.astc.COMPRESSED_RGBA_ASTC_10x10_KHR,"astc-10x10-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,"astc-12x10-unorm":t.astc.COMPRESSED_RGBA_ASTC_12x10_KHR,"astc-12x10-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,"astc-12x12-unorm":t.astc.COMPRESSED_RGBA_ASTC_12x12_KHR,"astc-12x12-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR}:{})}function W0(r){return{r8unorm:r.UNSIGNED_BYTE,r8snorm:r.BYTE,r8uint:r.UNSIGNED_BYTE,r8sint:r.BYTE,r16uint:r.UNSIGNED_SHORT,r16sint:r.SHORT,r16float:r.HALF_FLOAT,rg8unorm:r.UNSIGNED_BYTE,rg8snorm:r.BYTE,rg8uint:r.UNSIGNED_BYTE,rg8sint:r.BYTE,r32uint:r.UNSIGNED_INT,r32sint:r.INT,r32float:r.FLOAT,rg16uint:r.UNSIGNED_SHORT,rg16sint:r.SHORT,rg16float:r.HALF_FLOAT,rgba8unorm:r.UNSIGNED_BYTE,"rgba8unorm-srgb":r.UNSIGNED_BYTE,rgba8snorm:r.BYTE,rgba8uint:r.UNSIGNED_BYTE,rgba8sint:r.BYTE,bgra8unorm:r.UNSIGNED_BYTE,"bgra8unorm-srgb":r.UNSIGNED_BYTE,rgb9e5ufloat:r.UNSIGNED_INT_5_9_9_9_REV,rgb10a2unorm:r.UNSIGNED_INT_2_10_10_10_REV,rg11b10ufloat:r.UNSIGNED_INT_10F_11F_11F_REV,rg32uint:r.UNSIGNED_INT,rg32sint:r.INT,rg32float:r.FLOAT,rgba16uint:r.UNSIGNED_SHORT,rgba16sint:r.SHORT,rgba16float:r.HALF_FLOAT,rgba32uint:r.UNSIGNED_INT,rgba32sint:r.INT,rgba32float:r.FLOAT,stencil8:r.UNSIGNED_BYTE,depth16unorm:r.UNSIGNED_SHORT,depth24plus:r.UNSIGNED_INT,"depth24plus-stencil8":r.UNSIGNED_INT_24_8,depth32float:r.FLOAT,"depth32float-stencil8":r.FLOAT_32_UNSIGNED_INT_24_8_REV}}function S3(r){r instanceof Uint8ClampedArray&&(r=new Uint8Array(r.buffer));const t=r.length;for(let e=0;e<t;e+=4){const s=r[e+3];if(s!==0){const i=255.001/s;r[e]=r[e]*i+.5,r[e+1]=r[e+1]*i+.5,r[e+2]=r[e+2]*i+.5}}}const E3=4;class cl{constructor(t){this.managedTextures=[],this._glTextures=Object.create(null),this._glSamplers=Object.create(null),this._boundTextures=[],this._activeTextureLocation=-1,this._boundSamplers=Object.create(null),this._uploads={image:al,buffer:N0,video:L0,compressed:k0},this._useSeparateSamplers=!1,this._renderer=t}contextChange(t){this._gl=t,this._mapFormatToInternalFormat||(this._mapFormatToInternalFormat=V0(t,this._renderer.context.extensions),this._mapFormatToType=W0(t),this._mapFormatToFormat=X0(t)),this._glTextures=Object.create(null),this._glSamplers=Object.create(null),this._boundSamplers=Object.create(null);for(let e=0;e<16;e++)this.bind(w.EMPTY,e)}initSource(t){this.bind(t)}bind(t,e=0){const s=t.source;t?(this.bindSource(s,e),this._useSeparateSamplers&&this._bindSampler(s.style,e)):(this.bindSource(null,e),this._useSeparateSamplers&&this._bindSampler(null,e))}bindSource(t,e=0){const s=this._gl;if(t._touched=this._renderer.textureGC.count,this._boundTextures[e]!==t){this._boundTextures[e]=t,this._activateLocation(e),t=t||w.EMPTY.source;const i=this.getGlSource(t);s.bindTexture(i.target,i.texture)}}_bindSampler(t,e=0){const s=this._gl;if(!t){this._boundSamplers[e]=null,s.bindSampler(e,null);return}const i=this._getGlSampler(t);this._boundSamplers[e]!==i&&(this._boundSamplers[e]=i,s.bindSampler(e,i))}unbind(t){const e=t.source,s=this._boundTextures,i=this._gl;for(let n=0;n<s.length;n++)if(s[n]===e){this._activateLocation(n);const o=this.getGlSource(e);i.bindTexture(o.target,null),s[n]=null}}_activateLocation(t){this._activeTextureLocation!==t&&(this._activeTextureLocation=t,this._gl.activeTexture(this._gl.TEXTURE0+t))}_initSource(t){const e=this._gl,s=new U0(e.createTexture());if(s.type=this._mapFormatToType[t.format],s.internalFormat=this._mapFormatToInternalFormat[t.format],s.format=this._mapFormatToFormat[t.format],t.autoGenerateMipmaps&&(this._renderer.context.supports.nonPowOf2mipmaps||t.isPowerOfTwo)){const i=Math.max(t.width,t.height);t.mipLevelCount=Math.floor(Math.log2(i))+1}return this._glTextures[t.uid]=s,this.managedTextures.includes(t)||(t.on("update",this.onSourceUpdate,this),t.on("resize",this.onSourceUpdate,this),t.on("styleChange",this.onStyleChange,this),t.on("destroy",this.onSourceDestroy,this),t.on("unload",this.onSourceUnload,this),t.on("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.push(t)),this.onSourceUpdate(t),this.updateStyle(t,!1),s}onStyleChange(t){this.updateStyle(t,!1)}updateStyle(t,e){const s=this._gl,i=this.getGlSource(t);s.bindTexture(s.TEXTURE_2D,i.texture),this._boundTextures[this._activeTextureLocation]=t,ll(t.style,s,t.mipLevelCount>1,this._renderer.context.extensions.anisotropicFiltering,"texParameteri",s.TEXTURE_2D,!this._renderer.context.supports.nonPowOf2wrapping&&!t.isPowerOfTwo,e)}onSourceUnload(t){const e=this._glTextures[t.uid];e&&(this.unbind(t),this._glTextures[t.uid]=null,this._gl.deleteTexture(e.texture))}onSourceUpdate(t){const e=this._gl,s=this.getGlSource(t);e.bindTexture(e.TEXTURE_2D,s.texture),this._boundTextures[this._activeTextureLocation]=t,this._uploads[t.uploadMethodId]?this._uploads[t.uploadMethodId].upload(t,s,e,this._renderer.context.webGLVersion):e.texImage2D(e.TEXTURE_2D,0,e.RGBA,t.pixelWidth,t.pixelHeight,0,e.RGBA,e.UNSIGNED_BYTE,null),t.autoGenerateMipmaps&&t.mipLevelCount>1&&this.onUpdateMipmaps(t,!1)}onUpdateMipmaps(t,e=!0){e&&this.bindSource(t,0);const s=this.getGlSource(t);this._gl.generateMipmap(s.target)}onSourceDestroy(t){t.off("destroy",this.onSourceDestroy,this),t.off("update",this.onSourceUpdate,this),t.off("resize",this.onSourceUpdate,this),t.off("unload",this.onSourceUnload,this),t.off("styleChange",this.onStyleChange,this),t.off("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.splice(this.managedTextures.indexOf(t),1),this.onSourceUnload(t)}_initSampler(t){const e=this._gl,s=this._gl.createSampler();return this._glSamplers[t._resourceId]=s,ll(t,e,this._boundTextures[this._activeTextureLocation].mipLevelCount>1,this._renderer.context.extensions.anisotropicFiltering,"samplerParameteri",s,!1,!0),this._glSamplers[t._resourceId]}_getGlSampler(t){return this._glSamplers[t._resourceId]||this._initSampler(t)}getGlSource(t){return this._glTextures[t.uid]||this._initSource(t)}generateCanvas(t){const{pixels:e,width:s,height:i}=this.getPixels(t),n=z.get().createCanvas();n.width=s,n.height=i;const o=n.getContext("2d");if(o){const a=o.createImageData(s,i);a.data.set(e),o.putImageData(a,0,0)}return n}getPixels(t){const e=t.source.resolution,s=t.frame,i=Math.max(Math.round(s.width*e),1),n=Math.max(Math.round(s.height*e),1),o=new Uint8Array(E3*i*n),a=this._renderer,u=a.renderTarget.getRenderTarget(t),l=a.renderTarget.getGpuRenderTarget(u),c=a.gl;return c.bindFramebuffer(c.FRAMEBUFFER,l.resolveTargetFramebuffer),c.readPixels(Math.round(s.x*e),Math.round(s.y*e),i,n,c.RGBA,c.UNSIGNED_BYTE,o),{pixels:new Uint8ClampedArray(o.buffer),width:i,height:n}}destroy(){this.managedTextures.slice().forEach(t=>this.onSourceDestroy(t)),this.managedTextures=null,this._renderer=null}}cl.extension={type:[v.WebGLSystem],name:"texture"};class hl{init(){const t=new at({uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uTransformMatrix:{value:new B,type:"mat3x3<f32>"},uRound:{value:0,type:"f32"}}),e=Lt(),s=ar({name:"graphics",bits:[Ri,Di(e),Ii,lr]});this.shader=new Bt({glProgram:s,resources:{localUniforms:t,batchSamplers:Mi(e)}})}execute(t,e){const s=e.context,i=s.customShader||this.shader,n=t.renderer,o=n.graphicsContext,{geometry:a,instructions:u}=o.getContextRenderData(s);i.groups[0]=n.globalUniforms.bindGroup,n.state.set(t.state),n.shader.bind(i),n.geometry.bind(a,i.glProgram);const l=u.instructions;for(let c=0;c<u.instructionSize;c++){const h=l[c];if(h.size){for(let d=0;d<h.textures.textures.length;d++)n.texture.bind(h.textures.textures[d],d);n.geometry.draw("triangle-list",h.size,h.start)}}}destroy(){this.shader.destroy(!0),this.shader=null}}hl.extension={type:[v.WebGLPipesAdaptor],name:"graphics"};class dl{init(){const t=ar({name:"mesh",bits:[Ii,z_,lr]});this._shader=new Bt({glProgram:t,resources:{uTexture:w.EMPTY.source,textureUniforms:{uTextureMatrix:{type:"mat3x3<f32>",value:new B}}}})}execute(t,e){const s=t.renderer;let i=e._shader;if(i){if(!i.glProgram)return}else{i=this._shader;const n=e.texture,o=n.source;i.resources.uTexture=o,i.resources.uSampler=o.style,i.resources.textureUniforms.uniforms.uTextureMatrix=n.textureMatrix.mapCoord}i.groups[100]=s.globalUniforms.bindGroup,i.groups[101]=t.localUniformsBindGroup,s.encoder.draw({geometry:e._geometry,shader:i,state:e.state})}destroy(){this._shader.destroy(!0),this._shader=null}}dl.extension={type:[v.WebGLPipesAdaptor],name:"mesh"};class pl{constructor(t){this._renderer=t}addRenderable(t,e){this._renderer.renderPipes.batch.break(e),e.add(t)}execute(t){t.isRenderable&&t.render(this._renderer)}destroy(){this._renderer=null}}pl.extension={type:[v.WebGLPipes,v.WebGPUPipes,v.CanvasPipes],name:"customRender"};function fl(r,t){const e=r.instructionSet,s=e.instructions;for(let i=0;i<e.instructionSize;i++){const n=s[i];t[n.renderPipeId].execute(n)}}class ml{constructor(t){this._renderer=t}addRenderGroup(t,e){this._renderer.renderPipes.batch.break(e),e.add(t)}execute(t){t.isRenderable&&(this._renderer.globalUniforms.push({worldTransformMatrix:t.worldTransform,worldColor:t.worldColorAlpha}),fl(t,this._renderer.renderPipes),this._renderer.globalUniforms.pop())}destroy(){this._renderer=null}}ml.extension={type:[v.WebGLPipes,v.WebGPUPipes,v.CanvasPipes],name:"renderGroup"};function gl(r,t=[]){t.push(r);for(let e=0;e<r.renderGroupChildren.length;e++)gl(r.renderGroupChildren[e],t);return t}function _l(r,t,e){const s=r>>16&255,i=r>>8&255,n=r&255,o=t>>16&255,a=t>>8&255,u=t&255,l=s+(o-s)*e,c=i+(a-i)*e,h=n+(u-n)*e;return(l<<16)+(c<<8)+h}const xr=16777215;function xl(r,t){return r===xr||t===xr?r+t-xr:_l(r,t,.5)}function w3(r,t,e){const s=(e>>24&255)/255,i=t*s*255,n=((r&255)<<16)+(r&65280)+(r>>16&255),o=e&16777215;let a;return n===xr||o===xr?a=n+o-xr:a=_l(n,o,.5),a+(i<<24)}const C3=new K;function bl(r,t=!1){Y0(r);const e=r.childrenToUpdate,s=r.updateTick++;for(const i in e){const n=Number(i),o=e[i],a=o.list,u=o.index;for(let l=0;l<u;l++){const c=a[l];c.parentRenderGroup===r&&c.relativeRenderGroupDepth===n&&vl(c,s,0)}o.index=0}if(t)for(let i=0;i<r.renderGroupChildren.length;i++)bl(r.renderGroupChildren[i],t)}function Y0(r){const t=r.root;let e;if(r.renderGroupParent){const s=r.renderGroupParent;r.worldTransform.appendFrom(t.relativeGroupTransform,s.worldTransform),r.worldColor=xl(t.groupColor,s.worldColor),e=t.groupAlpha*s.worldAlpha}else r.worldTransform.copyFrom(t.localTransform),r.worldColor=t.localColor,e=t.localAlpha;e=e<0?0:e>1?1:e,r.worldAlpha=e,r.worldColorAlpha=r.worldColor+((e*255|0)<<24)}function vl(r,t,e){if(t===r.updateTick)return;r.updateTick=t,r.didChange=!1;const s=r.localTransform;r.updateLocalTransform();const i=r.parent;if(i&&!i.renderGroup?(e=e|r._updateFlags,r.relativeGroupTransform.appendFrom(s,i.relativeGroupTransform),e&&q0(r,i,e)):(e=r._updateFlags,r.relativeGroupTransform.copyFrom(s),e&&q0(r,C3,e)),!r.renderGroup){const n=r.children,o=n.length;for(let u=0;u<o;u++)vl(n[u],t,e);const a=r.parentRenderGroup;r.renderPipeId&&!a.structureDidChange&&a.updateRenderable(r)}}function q0(r,t,e){if(e&ei){r.groupColor=xl(r.localColor,t.groupColor);let s=r.localAlpha*t.groupAlpha;s=s<0?0:s>1?1:s,r.groupAlpha=s,r.groupColorAlpha=r.groupColor+((s*255|0)<<24)}e&po&&(r.groupBlendMode=r.localBlendMode==="inherit"?t.groupBlendMode:r.localBlendMode),e&Vr&&(r.globalDisplayStatus=r.localDisplayStatus&t.globalDisplayStatus),r._updateFlags=0}function K0(r,t){const{list:e,index:s}=r.childrenRenderablesToUpdate;let i=!1;for(let n=0;n<s;n++){const o=e[n];if(i=t[o.renderPipeId].validateRenderable(o),i)break}return r.structureDidChange=i,i}const R3=new B;class yl{constructor(t){this._renderer=t}render({container:t,transform:e}){t.isRenderGroup=!0;const s=t.parent,i=t.renderGroup.renderGroupParent;t.parent=null,t.renderGroup.renderGroupParent=null;const n=this._renderer,o=gl(t.renderGroup,[]);let a=R3;e&&(a=a.copyFrom(t.renderGroup.localTransform),t.renderGroup.localTransform.copyFrom(e));const u=n.renderPipes;for(let l=0;l<o.length;l++){const c=o[l];c.runOnRender(),c.instructionSet.renderPipes=u,c.structureDidChange||K0(c,u),bl(c),c.structureDidChange?(c.structureDidChange=!1,j_(c,u)):P3(c),c.childrenRenderablesToUpdate.index=0,n.renderPipes.batch.upload(c.instructionSet)}n.globalUniforms.start({worldTransformMatrix:e?t.renderGroup.localTransform:t.renderGroup.worldTransform,worldColor:t.renderGroup.worldColorAlpha}),fl(t.renderGroup,u),u.uniformBatch&&u.uniformBatch.renderEnd(),e&&t.renderGroup.localTransform.copyFrom(a),t.parent=s,t.renderGroup.renderGroupParent=i}destroy(){this._renderer=null}}yl.extension={type:[v.WebGLSystem,v.WebGPUSystem,v.CanvasSystem],name:"renderGroup"};function P3(r){const{list:t,index:e}=r.childrenRenderablesToUpdate;for(let s=0;s<e;s++){const i=t[s];i.didViewUpdate&&r.updateRenderable(i)}}class Tl{constructor(t){this._gpuSpriteHash=Object.create(null),this._renderer=t}addRenderable(t,e){const s=this._getGpuSprite(t);t._didSpriteUpdate&&this._updateBatchableSprite(t,s),this._renderer.renderPipes.batch.addToBatch(s)}updateRenderable(t){const e=this._gpuSpriteHash[t.uid];t._didSpriteUpdate&&this._updateBatchableSprite(t,e),e.batcher.updateElement(e)}validateRenderable(t){const e=t._texture,s=this._getGpuSprite(t);return s.texture._source!==e._source?!s.batcher.checkAndUpdateTexture(s,e):!1}destroyRenderable(t){const e=this._gpuSpriteHash[t.uid];$.return(e),this._gpuSpriteHash[t.uid]=null}_updateBatchableSprite(t,e){t._didSpriteUpdate=!1,e.bounds=t.bounds,e.texture=t._texture}_getGpuSprite(t){return this._gpuSpriteHash[t.uid]||this._initGPUSprite(t)}_initGPUSprite(t){const e=$.get(bi);return e.renderable=t,e.texture=t._texture,e.bounds=t.bounds,e.roundPixels=this._renderer._roundPixels|t._roundPixels,this._gpuSpriteHash[t.uid]=e,t._didSpriteUpdate=!1,t.on("destroyed",()=>{this.destroyRenderable(t)}),e}destroy(){for(const t in this._gpuSpriteHash)$.return(this._gpuSpriteHash[t]);this._gpuSpriteHash=null,this._renderer=null}}Tl.extension={type:[v.WebGLPipes,v.WebGPUPipes,v.CanvasPipes],name:"sprite"};var D3=Object.defineProperty,Z0=Object.getOwnPropertySymbols,M3=Object.prototype.hasOwnProperty,O3=Object.prototype.propertyIsEnumerable,Q0=(r,t,e)=>t in r?D3(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,J0=(r,t)=>{for(var e in t||(t={}))M3.call(t,e)&&Q0(r,e,t[e]);if(Z0)for(var e of Z0(t))O3.call(t,e)&&Q0(r,e,t[e]);return r};const Al=class jx{constructor(){this.clearBeforeRender=!0,this._backgroundColor=new j(0),this.color=this._backgroundColor,this.alpha=1}init(t){t=J0(J0({},jx.defaultOptions),t),this.clearBeforeRender=t.clearBeforeRender,this.color=t.background||t.backgroundColor||this._backgroundColor,this.alpha=t.backgroundAlpha,this._backgroundColor.setAlpha(t.backgroundAlpha)}get color(){return this._backgroundColor}set color(t){this._backgroundColor.setValue(t)}get alpha(){return this._backgroundColor.alpha}set alpha(t){this._backgroundColor.setAlpha(t)}get colorRgba(){return this._backgroundColor.toArray()}destroy(){}};Al.extension={type:[v.WebGLSystem,v.WebGPUSystem,v.CanvasSystem],name:"background",priority:0},Al.defaultOptions={backgroundAlpha:1,backgroundColor:0,clearBeforeRender:!0};let t2=Al;const Cs={};N.handle(v.BlendMode,r=>{if(!r.name)throw new Error("BlendMode extension must have a name property");Cs[r.name]=r.ref},r=>{delete Cs[r.name]});class Sl{constructor(t){this._isAdvanced=!1,this._filterHash=Object.create(null),this._renderer=t}setBlendMode(t,e,s){if(this._activeBlendMode===e){this._isAdvanced&&this._renderableList.push(t);return}this._activeBlendMode=e,this._isAdvanced&&this._endAdvancedBlendMode(s),this._isAdvanced=!!Cs[e],this._isAdvanced&&(this._beginAdvancedBlendMode(s),this._renderableList.push(t))}_beginAdvancedBlendMode(t){this._renderer.renderPipes.batch.break(t);const e=this._activeBlendMode;if(!Cs[e])return;let s=this._filterHash[e];s||(s=this._filterHash[e]=new Xr,s.filters=[new Cs[e]]);const i={renderPipeId:"filter",action:"pushFilter",renderables:[],filterEffect:s,canBundle:!1};this._renderableList=i.renderables,t.add(i)}_endAdvancedBlendMode(t){this._renderableList=null,this._renderer.renderPipes.batch.break(t),t.add({renderPipeId:"filter",action:"popFilter",canBundle:!1})}buildStart(){this._isAdvanced=!1}buildEnd(t){this._isAdvanced&&this._endAdvancedBlendMode(t)}destroy(){this._renderer=null,this._renderableList=null;for(const t in this._filterHash)this._filterHash[t].destroy();this._filterHash=null}}Sl.extension={type:[v.WebGLPipes,v.WebGPUPipes,v.CanvasPipes],name:"blendMode"};var B3=Object.defineProperty,e2=Object.getOwnPropertySymbols,G3=Object.prototype.hasOwnProperty,I3=Object.prototype.propertyIsEnumerable,r2=(r,t,e)=>t in r?B3(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,El=(r,t)=>{for(var e in t||(t={}))G3.call(t,e)&&r2(r,e,t[e]);if(e2)for(var e of e2(t))I3.call(t,e)&&r2(r,e,t[e]);return r};const wl={png:"image/png",jpg:"image/jpeg",webp:"image/webp"},Cl=class Vx{constructor(t){this._renderer=t}_normalizeOptions(t,e={}){return t instanceof K||t instanceof w?El({target:t},e):El(El({},e),t)}async image(t){const e=new Image;return e.src=await this.base64(t),e}async base64(t){t=this._normalizeOptions(t,Vx.defaultImageOptions);const{format:e,quality:s}=t,i=this.canvas(t);if(i.toBlob!==void 0)return new Promise((n,o)=>{i.toBlob(a=>{if(!a){o(new Error("ICanvas.toBlob failed!"));return}const u=new FileReader;u.onload=()=>n(u.result),u.onerror=o,u.readAsDataURL(a)},wl[e],s)});if(i.toDataURL!==void 0)return i.toDataURL(wl[e],s);if(i.convertToBlob!==void 0){const n=await i.convertToBlob({type:wl[e],quality:s});return new Promise((o,a)=>{const u=new FileReader;u.onload=()=>o(u.result),u.onerror=a,u.readAsDataURL(n)})}throw new Error("Extract.base64() requires ICanvas.toDataURL, ICanvas.toBlob, or ICanvas.convertToBlob to be implemented")}canvas(t){t=this._normalizeOptions(t);const e=t.target,s=this._renderer;if(e instanceof w)return s.texture.generateCanvas(e);const i=s.textureGenerator.generateTexture(t),n=s.texture.generateCanvas(i);return i.destroy(),n}pixels(t){t=this._normalizeOptions(t);const e=t.target,s=this._renderer,i=e instanceof w?e:s.textureGenerator.generateTexture(t),n=s.texture.getPixels(i);return e instanceof K&&i.destroy(),n}texture(t){return t=this._normalizeOptions(t),t.target instanceof w?t.target:this._renderer.textureGenerator.generateTexture(t)}download(t){var e;t=this._normalizeOptions(t);const s=this.canvas(t),i=document.createElement("a");i.download=(e=t.filename)!=null?e:"image.png",i.href=s.toDataURL("image/png"),document.body.appendChild(i),i.click(),document.body.removeChild(i)}log(t){var e;const s=(e=t.width)!=null?e:200;t=this._normalizeOptions(t);const i=this.canvas(t),n=i.toDataURL();console.log(`[Pixi Texture] ${i.width}px ${i.height}px`);const o=["font-size: 1px;",`padding: ${s}px 300px;`,`background: url(${n}) no-repeat;`,"background-size: contain;"].join(" ");console.log("%c ",o)}destroy(){this._renderer=null}};Cl.extension={type:[v.WebGLSystem,v.WebGPUSystem],name:"extract"},Cl.defaultImageOptions={format:"png",quality:1};let s2=Cl;class i2 extends w{static create(t){return new w({source:new et(t)})}resize(t,e,s){return this.source.resize(t,e,s),this}}var F3=Object.defineProperty,U3=Object.defineProperties,N3=Object.getOwnPropertyDescriptors,n2=Object.getOwnPropertySymbols,k3=Object.prototype.hasOwnProperty,L3=Object.prototype.propertyIsEnumerable,o2=(r,t,e)=>t in r?F3(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,$3=(r,t)=>{for(var e in t||(t={}))k3.call(t,e)&&o2(r,e,t[e]);if(n2)for(var e of n2(t))L3.call(t,e)&&o2(r,e,t[e]);return r},H3=(r,t)=>U3(r,N3(t));const X3=new V,z3=new pt,j3=[0,0,0,0];class Rl{constructor(t){this._renderer=t}generateTexture(t){var e;t instanceof K&&(t={target:t,frame:void 0,textureSourceOptions:{},resolution:void 0});const s=t.resolution||this._renderer.resolution,i=t.antialias||this._renderer.view.antialias,n=t.target;let o=t.clearColor;o?o=Array.isArray(o)&&o.length===4?o:j.shared.setValue(o).toArray():o=j3;const a=((e=t.frame)==null?void 0:e.copyTo(X3))||ti(n,z3).rectangle;a.width=Math.max(a.width,1/s)|0,a.height=Math.max(a.height,1/s)|0;const u=i2.create(H3($3({},t.textureSourceOptions),{width:a.width,height:a.height,resolution:s,antialias:i})),l=B.shared.translate(-a.x,-a.y);return this._renderer.render({container:n,transform:l,target:u,clearColor:o}),u.source.updateMipmaps(),u}destroy(){this._renderer=null}}Rl.extension={type:[v.WebGLSystem,v.WebGPUSystem],name:"textureGenerator"};class Pl{constructor(t){this._stackIndex=0,this._globalUniformDataStack=[],this._uniformsPool=[],this._activeUniforms=[],this._bindGroupPool=[],this._activeBindGroups=[],this._renderer=t}reset(){this._stackIndex=0;for(let t=0;t<this._activeUniforms.length;t++)this._uniformsPool.push(this._activeUniforms[t]);for(let t=0;t<this._activeBindGroups.length;t++)this._bindGroupPool.push(this._activeBindGroups[t]);this._activeUniforms.length=0,this._activeBindGroups.length=0}start(t){this.reset(),this.push(t)}bind({size:t,projectionMatrix:e,worldTransformMatrix:s,worldColor:i,offset:n}){const o=this._renderer.renderTarget.renderTarget,a=this._stackIndex?this._globalUniformDataStack[this._stackIndex-1]:{projectionData:o,worldTransformMatrix:new B,worldColor:4294967295,offset:new it},u={projectionMatrix:e||this._renderer.renderTarget.projectionMatrix,resolution:t||o.size,worldTransformMatrix:s||a.worldTransformMatrix,worldColor:i||a.worldColor,offset:n||a.offset,bindGroup:null},l=this._uniformsPool.pop()||this._createUniforms();this._activeUniforms.push(l);const c=l.uniforms;c.uProjectionMatrix=u.projectionMatrix,c.uResolution=u.resolution,c.uWorldTransformMatrix.copyFrom(u.worldTransformMatrix),c.uWorldTransformMatrix.tx-=u.offset.x,c.uWorldTransformMatrix.ty-=u.offset.y,es(u.worldColor,c.uWorldColorAlpha,0),l.update();let h;this._renderer.renderPipes.uniformBatch?h=this._renderer.renderPipes.uniformBatch.getUniformBindGroup(l,!1):(h=this._bindGroupPool.pop()||new Kt,this._activeBindGroups.push(h),h.setResource(l,0)),u.bindGroup=h,this._currentGlobalUniformData=u}push(t){this.bind(t),this._globalUniformDataStack[this._stackIndex++]=this._currentGlobalUniformData}pop(){this._currentGlobalUniformData=this._globalUniformDataStack[--this._stackIndex-1],this._renderer.type===Pt.WEBGL&&this._currentGlobalUniformData.bindGroup.resources[0].update()}get bindGroup(){return this._currentGlobalUniformData.bindGroup}get uniformGroup(){return this._currentGlobalUniformData.bindGroup.resources[0]}_createUniforms(){return new at({uProjectionMatrix:{value:new B,type:"mat3x3<f32>"},uWorldTransformMatrix:{value:new B,type:"mat3x3<f32>"},uWorldColorAlpha:{value:new Float32Array(4),type:"vec4<f32>"},uResolution:{value:[0,0],type:"vec2<f32>"}},{isStatic:!0})}destroy(){this._renderer=null}}Pl.extension={type:[v.WebGLSystem,v.WebGPUSystem,v.CanvasSystem],name:"globalUniforms"};let a2=!1;const Dl="8.2.0";function u2(r){if(!a2){if(z.get().getNavigator().userAgent.toLowerCase().indexOf("chrome")>-1){const t=[`%c %c %c %c %c PixiJS %c v${Dl} (${r}) http://www.pixijs.com/
1970
+ `,r}const l3={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,uint:1,uvec2:2,uvec3:3,uvec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function c3(r){return l3[r]}function G0(r){const t={};return t.normal=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t.add=[r.ONE,r.ONE],t.multiply=[r.DST_COLOR,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA],t.screen=[r.ONE,r.ONE_MINUS_SRC_COLOR,r.ONE,r.ONE_MINUS_SRC_ALPHA],t.none=[0,0],t["normal-npm"]=[r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA],t["add-npm"]=[r.SRC_ALPHA,r.ONE,r.ONE,r.ONE],t["screen-npm"]=[r.SRC_ALPHA,r.ONE_MINUS_SRC_COLOR,r.ONE,r.ONE_MINUS_SRC_ALPHA],t.erase=[r.ZERO,r.ONE_MINUS_SRC_ALPHA],t}const h3=0,d3=1,p3=2,f3=3,m3=4,g3=5,I0=class uc{constructor(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode="none",this._blendEq=!1,this.map=[],this.map[h3]=this.setBlend,this.map[d3]=this.setOffset,this.map[p3]=this.setCullFace,this.map[f3]=this.setDepthTest,this.map[m3]=this.setFrontFace,this.map[g3]=this.setDepthMask,this.checks=[],this.defaultState=$t.for2d()}contextChange(t){this.gl=t,this.blendModesMap=G0(t),this.reset()}set(t){if(t=t||this.defaultState,this.stateId!==t.data){let e=this.stateId^t.data,s=0;for(;e;)e&1&&this.map[s].call(this,!!(t.data&1<<s)),e=e>>1,s++;this.stateId=t.data}for(let e=0;e<this.checks.length;e++)this.checks[e](this,t)}forceState(t){t=t||this.defaultState;for(let e=0;e<this.map.length;e++)this.map[e].call(this,!!(t.data&1<<e));for(let e=0;e<this.checks.length;e++)this.checks[e](this,t);this.stateId=t.data}setBlend(t){this._updateCheck(uc._checkBlendMode,t),this.gl[t?"enable":"disable"](this.gl.BLEND)}setOffset(t){this._updateCheck(uc._checkPolygonOffset,t),this.gl[t?"enable":"disable"](this.gl.POLYGON_OFFSET_FILL)}setDepthTest(t){this.gl[t?"enable":"disable"](this.gl.DEPTH_TEST)}setDepthMask(t){this.gl.depthMask(t)}setCullFace(t){this.gl[t?"enable":"disable"](this.gl.CULL_FACE)}setFrontFace(t){this.gl.frontFace(this.gl[t?"CW":"CCW"])}setBlendMode(t){if(this.blendModesMap[t]||(t="normal"),t===this.blendMode)return;this.blendMode=t;const e=this.blendModesMap[t],s=this.gl;e.length===2?s.blendFunc(e[0],e[1]):s.blendFuncSeparate(e[0],e[1],e[2],e[3]),e.length===6?(this._blendEq=!0,s.blendEquationSeparate(e[4],e[5])):this._blendEq&&(this._blendEq=!1,s.blendEquationSeparate(s.FUNC_ADD,s.FUNC_ADD))}setPolygonOffset(t,e){this.gl.polygonOffset(t,e)}reset(){this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,!1),this.forceState(this.defaultState),this._blendEq=!0,this.blendMode="",this.setBlendMode("normal")}_updateCheck(t,e){const s=this.checks.indexOf(t);e&&s===-1?this.checks.push(t):!e&&s!==-1&&this.checks.splice(s,1)}static _checkBlendMode(t,e){t.setBlendMode(e.blendMode)}static _checkPolygonOffset(t,e){t.setPolygonOffset(1,e.polygonOffset)}destroy(){this.gl=null,this.checks.length=0}};I0.extension={type:[v.WebGLSystem],name:"state"};let F0=I0;class U0{constructor(t){this.target=$u.TEXTURE_2D,this.texture=t,this.width=-1,this.height=-1,this.type=X.UNSIGNED_BYTE,this.internalFormat=hn.RGBA,this.format=hn.RGBA,this.samplerType=0}}const N0={id:"buffer",upload(r,t,e){t.width===r.width||t.height===r.height?e.texSubImage2D(e.TEXTURE_2D,0,0,0,r.width,r.height,t.format,t.type,r.resource):e.texImage2D(t.target,0,t.internalFormat,r.width,r.height,0,t.format,t.type,r.resource),t.width=r.width,t.height=r.height}},_3={"bc1-rgba-unorm":!0,"bc1-rgba-unorm-srgb":!0,"bc2-rgba-unorm":!0,"bc2-rgba-unorm-srgb":!0,"bc3-rgba-unorm":!0,"bc3-rgba-unorm-srgb":!0,"bc4-r-unorm":!0,"bc4-r-snorm":!0,"bc5-rg-unorm":!0,"bc5-rg-snorm":!0,"bc6h-rgb-ufloat":!0,"bc6h-rgb-float":!0,"bc7-rgba-unorm":!0,"bc7-rgba-unorm-srgb":!0,"etc2-rgb8unorm":!0,"etc2-rgb8unorm-srgb":!0,"etc2-rgb8a1unorm":!0,"etc2-rgb8a1unorm-srgb":!0,"etc2-rgba8unorm":!0,"etc2-rgba8unorm-srgb":!0,"eac-r11unorm":!0,"eac-r11snorm":!0,"eac-rg11unorm":!0,"eac-rg11snorm":!0,"astc-4x4-unorm":!0,"astc-4x4-unorm-srgb":!0,"astc-5x4-unorm":!0,"astc-5x4-unorm-srgb":!0,"astc-5x5-unorm":!0,"astc-5x5-unorm-srgb":!0,"astc-6x5-unorm":!0,"astc-6x5-unorm-srgb":!0,"astc-6x6-unorm":!0,"astc-6x6-unorm-srgb":!0,"astc-8x5-unorm":!0,"astc-8x5-unorm-srgb":!0,"astc-8x6-unorm":!0,"astc-8x6-unorm-srgb":!0,"astc-8x8-unorm":!0,"astc-8x8-unorm-srgb":!0,"astc-10x5-unorm":!0,"astc-10x5-unorm-srgb":!0,"astc-10x6-unorm":!0,"astc-10x6-unorm-srgb":!0,"astc-10x8-unorm":!0,"astc-10x8-unorm-srgb":!0,"astc-10x10-unorm":!0,"astc-10x10-unorm-srgb":!0,"astc-12x10-unorm":!0,"astc-12x10-unorm-srgb":!0,"astc-12x12-unorm":!0,"astc-12x12-unorm-srgb":!0},k0={id:"compressed",upload(r,t,e){e.pixelStorei(e.UNPACK_ALIGNMENT,4);let s=r.pixelWidth,i=r.pixelHeight;const n=!!_3[r.format];for(let o=0;o<r.resource.length;o++){const a=r.resource[o];n?e.compressedTexImage2D(e.TEXTURE_2D,o,t.internalFormat,s,i,0,a):e.texImage2D(e.TEXTURE_2D,o,t.internalFormat,s,i,0,t.format,t.type,a),s=Math.max(s>>1,1),i=Math.max(i>>1,1)}}},al={id:"image",upload(r,t,e,s){const i=r.alphaMode==="premultiply-alpha-on-upload";e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i);const n=t.width,o=t.height,a=r.pixelWidth,u=r.pixelHeight,l=r.resourceWidth,c=r.resourceHeight;l<a||c<u?((n!==a||o!==u)&&e.texImage2D(t.target,0,t.internalFormat,a,u,0,t.format,t.type,null),s===2?e.texSubImage2D(e.TEXTURE_2D,0,0,0,l,c,t.format,t.type,r.resource):e.texSubImage2D(e.TEXTURE_2D,0,0,0,t.format,t.type,r.resource)):n===a||o===u?e.texSubImage2D(e.TEXTURE_2D,0,0,0,t.format,t.type,r.resource):s===2?e.texImage2D(t.target,0,t.internalFormat,a,u,0,t.format,t.type,r.resource):e.texImage2D(t.target,0,t.internalFormat,t.format,t.type,r.resource),t.width=a,t.height=u}},L0={id:"video",upload(r,t,e,s){if(!r.isValid){e.texImage2D(t.target,0,t.internalFormat,1,1,0,t.format,t.type,null);return}al.upload(r,t,e,s)}},ul={linear:9729,nearest:9728},$0={linear:{linear:9987,nearest:9985},nearest:{linear:9986,nearest:9984}},gn={"clamp-to-edge":33071,repeat:10497,"mirror-repeat":33648},H0={never:512,less:513,equal:514,"less-equal":515,greater:516,"not-equal":517,"greater-equal":518,always:519};function ll(r,t,e,s,i,n,o,a){const u=n;if(!a||r.addressModeU!=="repeat"||r.addressModeV!=="repeat"||r.addressModeW!=="repeat"){const l=gn[o?"clamp-to-edge":r.addressModeU],c=gn[o?"clamp-to-edge":r.addressModeV],h=gn[o?"clamp-to-edge":r.addressModeW];t[i](u,t.TEXTURE_WRAP_S,l),t[i](u,t.TEXTURE_WRAP_T,c),t.TEXTURE_WRAP_R&&t[i](u,t.TEXTURE_WRAP_R,h)}if((!a||r.magFilter!=="linear")&&t[i](u,t.TEXTURE_MAG_FILTER,ul[r.magFilter]),e){if(!a||r.mipmapFilter!=="linear"){const l=$0[r.minFilter][r.mipmapFilter];t[i](u,t.TEXTURE_MIN_FILTER,l)}}else t[i](u,t.TEXTURE_MIN_FILTER,ul[r.minFilter]);if(s&&r.maxAnisotropy>1){const l=Math.min(r.maxAnisotropy,t.getParameter(s.MAX_TEXTURE_MAX_ANISOTROPY_EXT));t[i](u,s.TEXTURE_MAX_ANISOTROPY_EXT,l)}r.compare&&t[i](u,t.TEXTURE_COMPARE_FUNC,H0[r.compare])}function X0(r){return{r8unorm:r.RED,r8snorm:r.RED,r8uint:r.RED,r8sint:r.RED,r16uint:r.RED,r16sint:r.RED,r16float:r.RED,rg8unorm:r.RG,rg8snorm:r.RG,rg8uint:r.RG,rg8sint:r.RG,r32uint:r.RED,r32sint:r.RED,r32float:r.RED,rg16uint:r.RG,rg16sint:r.RG,rg16float:r.RG,rgba8unorm:r.RGBA,"rgba8unorm-srgb":r.RGBA,rgba8snorm:r.RGBA,rgba8uint:r.RGBA,rgba8sint:r.RGBA,bgra8unorm:r.RGBA,"bgra8unorm-srgb":r.RGBA,rgb9e5ufloat:r.RGB,rgb10a2unorm:r.RGBA,rg11b10ufloat:r.RGB,rg32uint:r.RG,rg32sint:r.RG,rg32float:r.RG,rgba16uint:r.RGBA,rgba16sint:r.RGBA,rgba16float:r.RGBA,rgba32uint:r.RGBA,rgba32sint:r.RGBA,rgba32float:r.RGBA,stencil8:r.STENCIL_INDEX8,depth16unorm:r.DEPTH_COMPONENT,depth24plus:r.DEPTH_COMPONENT,"depth24plus-stencil8":r.DEPTH_STENCIL,depth32float:r.DEPTH_COMPONENT,"depth32float-stencil8":r.DEPTH_STENCIL}}var x3=Object.defineProperty,b3=Object.defineProperties,v3=Object.getOwnPropertyDescriptors,z0=Object.getOwnPropertySymbols,y3=Object.prototype.hasOwnProperty,T3=Object.prototype.propertyIsEnumerable,j0=(r,t,e)=>t in r?x3(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,ke=(r,t)=>{for(var e in t||(t={}))y3.call(t,e)&&j0(r,e,t[e]);if(z0)for(var e of z0(t))T3.call(t,e)&&j0(r,e,t[e]);return r},A3=(r,t)=>b3(r,v3(t));function V0(r,t){let e={},s=r.RGBA;return r instanceof z.get().getWebGLRenderingContext()?t.srgb&&(e={"rgba8unorm-srgb":t.srgb.SRGB8_ALPHA8_EXT,"bgra8unorm-srgb":t.srgb.SRGB8_ALPHA8_EXT}):(e={"rgba8unorm-srgb":r.SRGB8_ALPHA8,"bgra8unorm-srgb":r.SRGB8_ALPHA8},s=r.RGBA8),ke(ke(ke(ke(ke(ke(A3(ke({r8unorm:r.R8,r8snorm:r.R8_SNORM,r8uint:r.R8UI,r8sint:r.R8I,r16uint:r.R16UI,r16sint:r.R16I,r16float:r.R16F,rg8unorm:r.RG8,rg8snorm:r.RG8_SNORM,rg8uint:r.RG8UI,rg8sint:r.RG8I,r32uint:r.R32UI,r32sint:r.R32I,r32float:r.R32F,rg16uint:r.RG16UI,rg16sint:r.RG16I,rg16float:r.RG16F,rgba8unorm:r.RGBA},e),{rgba8snorm:r.RGBA8_SNORM,rgba8uint:r.RGBA8UI,rgba8sint:r.RGBA8I,bgra8unorm:s,rgb9e5ufloat:r.RGB9_E5,rgb10a2unorm:r.RGB10_A2,rg11b10ufloat:r.R11F_G11F_B10F,rg32uint:r.RG32UI,rg32sint:r.RG32I,rg32float:r.RG32F,rgba16uint:r.RGBA16UI,rgba16sint:r.RGBA16I,rgba16float:r.RGBA16F,rgba32uint:r.RGBA32UI,rgba32sint:r.RGBA32I,rgba32float:r.RGBA32F,stencil8:r.STENCIL_INDEX8,depth16unorm:r.DEPTH_COMPONENT16,depth24plus:r.DEPTH_COMPONENT24,"depth24plus-stencil8":r.DEPTH24_STENCIL8,depth32float:r.DEPTH_COMPONENT32F,"depth32float-stencil8":r.DEPTH32F_STENCIL8}),t.s3tc?{"bc1-rgba-unorm":t.s3tc.COMPRESSED_RGBA_S3TC_DXT1_EXT,"bc2-rgba-unorm":t.s3tc.COMPRESSED_RGBA_S3TC_DXT3_EXT,"bc3-rgba-unorm":t.s3tc.COMPRESSED_RGBA_S3TC_DXT5_EXT}:{}),t.s3tc_sRGB?{"bc1-rgba-unorm-srgb":t.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,"bc2-rgba-unorm-srgb":t.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,"bc3-rgba-unorm-srgb":t.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}:{}),t.rgtc?{"bc4-r-unorm":t.rgtc.COMPRESSED_RED_RGTC1_EXT,"bc4-r-snorm":t.rgtc.COMPRESSED_SIGNED_RED_RGTC1_EXT,"bc5-rg-unorm":t.rgtc.COMPRESSED_RED_GREEN_RGTC2_EXT,"bc5-rg-snorm":t.rgtc.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}:{}),t.bptc?{"bc6h-rgb-float":t.bptc.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,"bc6h-rgb-ufloat":t.bptc.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,"bc7-rgba-unorm":t.bptc.COMPRESSED_RGBA_BPTC_UNORM_EXT,"bc7-rgba-unorm-srgb":t.bptc.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT}:{}),t.etc?{"etc2-rgb8unorm":t.etc.COMPRESSED_RGB8_ETC2,"etc2-rgb8unorm-srgb":t.etc.COMPRESSED_SRGB8_ETC2,"etc2-rgb8a1unorm":t.etc.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,"etc2-rgb8a1unorm-srgb":t.etc.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,"etc2-rgba8unorm":t.etc.COMPRESSED_RGBA8_ETC2_EAC,"etc2-rgba8unorm-srgb":t.etc.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,"eac-r11unorm":t.etc.COMPRESSED_R11_EAC,"eac-rg11unorm":t.etc.COMPRESSED_SIGNED_RG11_EAC}:{}),t.astc?{"astc-4x4-unorm":t.astc.COMPRESSED_RGBA_ASTC_4x4_KHR,"astc-4x4-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,"astc-5x4-unorm":t.astc.COMPRESSED_RGBA_ASTC_5x4_KHR,"astc-5x4-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR,"astc-5x5-unorm":t.astc.COMPRESSED_RGBA_ASTC_5x5_KHR,"astc-5x5-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,"astc-6x5-unorm":t.astc.COMPRESSED_RGBA_ASTC_6x5_KHR,"astc-6x5-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,"astc-6x6-unorm":t.astc.COMPRESSED_RGBA_ASTC_6x6_KHR,"astc-6x6-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,"astc-8x5-unorm":t.astc.COMPRESSED_RGBA_ASTC_8x5_KHR,"astc-8x5-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,"astc-8x6-unorm":t.astc.COMPRESSED_RGBA_ASTC_8x6_KHR,"astc-8x6-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,"astc-8x8-unorm":t.astc.COMPRESSED_RGBA_ASTC_8x8_KHR,"astc-8x8-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,"astc-10x5-unorm":t.astc.COMPRESSED_RGBA_ASTC_10x5_KHR,"astc-10x5-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,"astc-10x6-unorm":t.astc.COMPRESSED_RGBA_ASTC_10x6_KHR,"astc-10x6-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,"astc-10x8-unorm":t.astc.COMPRESSED_RGBA_ASTC_10x8_KHR,"astc-10x8-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,"astc-10x10-unorm":t.astc.COMPRESSED_RGBA_ASTC_10x10_KHR,"astc-10x10-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,"astc-12x10-unorm":t.astc.COMPRESSED_RGBA_ASTC_12x10_KHR,"astc-12x10-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,"astc-12x12-unorm":t.astc.COMPRESSED_RGBA_ASTC_12x12_KHR,"astc-12x12-unorm-srgb":t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR}:{})}function W0(r){return{r8unorm:r.UNSIGNED_BYTE,r8snorm:r.BYTE,r8uint:r.UNSIGNED_BYTE,r8sint:r.BYTE,r16uint:r.UNSIGNED_SHORT,r16sint:r.SHORT,r16float:r.HALF_FLOAT,rg8unorm:r.UNSIGNED_BYTE,rg8snorm:r.BYTE,rg8uint:r.UNSIGNED_BYTE,rg8sint:r.BYTE,r32uint:r.UNSIGNED_INT,r32sint:r.INT,r32float:r.FLOAT,rg16uint:r.UNSIGNED_SHORT,rg16sint:r.SHORT,rg16float:r.HALF_FLOAT,rgba8unorm:r.UNSIGNED_BYTE,"rgba8unorm-srgb":r.UNSIGNED_BYTE,rgba8snorm:r.BYTE,rgba8uint:r.UNSIGNED_BYTE,rgba8sint:r.BYTE,bgra8unorm:r.UNSIGNED_BYTE,"bgra8unorm-srgb":r.UNSIGNED_BYTE,rgb9e5ufloat:r.UNSIGNED_INT_5_9_9_9_REV,rgb10a2unorm:r.UNSIGNED_INT_2_10_10_10_REV,rg11b10ufloat:r.UNSIGNED_INT_10F_11F_11F_REV,rg32uint:r.UNSIGNED_INT,rg32sint:r.INT,rg32float:r.FLOAT,rgba16uint:r.UNSIGNED_SHORT,rgba16sint:r.SHORT,rgba16float:r.HALF_FLOAT,rgba32uint:r.UNSIGNED_INT,rgba32sint:r.INT,rgba32float:r.FLOAT,stencil8:r.UNSIGNED_BYTE,depth16unorm:r.UNSIGNED_SHORT,depth24plus:r.UNSIGNED_INT,"depth24plus-stencil8":r.UNSIGNED_INT_24_8,depth32float:r.FLOAT,"depth32float-stencil8":r.FLOAT_32_UNSIGNED_INT_24_8_REV}}function S3(r){r instanceof Uint8ClampedArray&&(r=new Uint8Array(r.buffer));const t=r.length;for(let e=0;e<t;e+=4){const s=r[e+3];if(s!==0){const i=255.001/s;r[e]=r[e]*i+.5,r[e+1]=r[e+1]*i+.5,r[e+2]=r[e+2]*i+.5}}}const E3=4;class cl{constructor(t){this.managedTextures=[],this._glTextures=Object.create(null),this._glSamplers=Object.create(null),this._boundTextures=[],this._activeTextureLocation=-1,this._boundSamplers=Object.create(null),this._uploads={image:al,buffer:N0,video:L0,compressed:k0},this._useSeparateSamplers=!1,this._renderer=t}contextChange(t){this._gl=t,this._mapFormatToInternalFormat||(this._mapFormatToInternalFormat=V0(t,this._renderer.context.extensions),this._mapFormatToType=W0(t),this._mapFormatToFormat=X0(t)),this._glTextures=Object.create(null),this._glSamplers=Object.create(null),this._boundSamplers=Object.create(null);for(let e=0;e<16;e++)this.bind(w.EMPTY,e)}initSource(t){this.bind(t)}bind(t,e=0){const s=t.source;t?(this.bindSource(s,e),this._useSeparateSamplers&&this._bindSampler(s.style,e)):(this.bindSource(null,e),this._useSeparateSamplers&&this._bindSampler(null,e))}bindSource(t,e=0){const s=this._gl;if(t._touched=this._renderer.textureGC.count,this._boundTextures[e]!==t){this._boundTextures[e]=t,this._activateLocation(e),t=t||w.EMPTY.source;const i=this.getGlSource(t);s.bindTexture(i.target,i.texture)}}_bindSampler(t,e=0){const s=this._gl;if(!t){this._boundSamplers[e]=null,s.bindSampler(e,null);return}const i=this._getGlSampler(t);this._boundSamplers[e]!==i&&(this._boundSamplers[e]=i,s.bindSampler(e,i))}unbind(t){const e=t.source,s=this._boundTextures,i=this._gl;for(let n=0;n<s.length;n++)if(s[n]===e){this._activateLocation(n);const o=this.getGlSource(e);i.bindTexture(o.target,null),s[n]=null}}_activateLocation(t){this._activeTextureLocation!==t&&(this._activeTextureLocation=t,this._gl.activeTexture(this._gl.TEXTURE0+t))}_initSource(t){const e=this._gl,s=new U0(e.createTexture());if(s.type=this._mapFormatToType[t.format],s.internalFormat=this._mapFormatToInternalFormat[t.format],s.format=this._mapFormatToFormat[t.format],t.autoGenerateMipmaps&&(this._renderer.context.supports.nonPowOf2mipmaps||t.isPowerOfTwo)){const i=Math.max(t.width,t.height);t.mipLevelCount=Math.floor(Math.log2(i))+1}return this._glTextures[t.uid]=s,this.managedTextures.includes(t)||(t.on("update",this.onSourceUpdate,this),t.on("resize",this.onSourceUpdate,this),t.on("styleChange",this.onStyleChange,this),t.on("destroy",this.onSourceDestroy,this),t.on("unload",this.onSourceUnload,this),t.on("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.push(t)),this.onSourceUpdate(t),this.updateStyle(t,!1),s}onStyleChange(t){this.updateStyle(t,!1)}updateStyle(t,e){const s=this._gl,i=this.getGlSource(t);s.bindTexture(s.TEXTURE_2D,i.texture),this._boundTextures[this._activeTextureLocation]=t,ll(t.style,s,t.mipLevelCount>1,this._renderer.context.extensions.anisotropicFiltering,"texParameteri",s.TEXTURE_2D,!this._renderer.context.supports.nonPowOf2wrapping&&!t.isPowerOfTwo,e)}onSourceUnload(t){const e=this._glTextures[t.uid];e&&(this.unbind(t),this._glTextures[t.uid]=null,this._gl.deleteTexture(e.texture))}onSourceUpdate(t){const e=this._gl,s=this.getGlSource(t);e.bindTexture(e.TEXTURE_2D,s.texture),this._boundTextures[this._activeTextureLocation]=t,this._uploads[t.uploadMethodId]?this._uploads[t.uploadMethodId].upload(t,s,e,this._renderer.context.webGLVersion):e.texImage2D(e.TEXTURE_2D,0,e.RGBA,t.pixelWidth,t.pixelHeight,0,e.RGBA,e.UNSIGNED_BYTE,null),t.autoGenerateMipmaps&&t.mipLevelCount>1&&this.onUpdateMipmaps(t,!1)}onUpdateMipmaps(t,e=!0){e&&this.bindSource(t,0);const s=this.getGlSource(t);this._gl.generateMipmap(s.target)}onSourceDestroy(t){t.off("destroy",this.onSourceDestroy,this),t.off("update",this.onSourceUpdate,this),t.off("resize",this.onSourceUpdate,this),t.off("unload",this.onSourceUnload,this),t.off("styleChange",this.onStyleChange,this),t.off("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.splice(this.managedTextures.indexOf(t),1),this.onSourceUnload(t)}_initSampler(t){const e=this._gl,s=this._gl.createSampler();return this._glSamplers[t._resourceId]=s,ll(t,e,this._boundTextures[this._activeTextureLocation].mipLevelCount>1,this._renderer.context.extensions.anisotropicFiltering,"samplerParameteri",s,!1,!0),this._glSamplers[t._resourceId]}_getGlSampler(t){return this._glSamplers[t._resourceId]||this._initSampler(t)}getGlSource(t){return this._glTextures[t.uid]||this._initSource(t)}generateCanvas(t){const{pixels:e,width:s,height:i}=this.getPixels(t),n=z.get().createCanvas();n.width=s,n.height=i;const o=n.getContext("2d");if(o){const a=o.createImageData(s,i);a.data.set(e),o.putImageData(a,0,0)}return n}getPixels(t){const e=t.source.resolution,s=t.frame,i=Math.max(Math.round(s.width*e),1),n=Math.max(Math.round(s.height*e),1),o=new Uint8Array(E3*i*n),a=this._renderer,u=a.renderTarget.getRenderTarget(t),l=a.renderTarget.getGpuRenderTarget(u),c=a.gl;return c.bindFramebuffer(c.FRAMEBUFFER,l.resolveTargetFramebuffer),c.readPixels(Math.round(s.x*e),Math.round(s.y*e),i,n,c.RGBA,c.UNSIGNED_BYTE,o),{pixels:new Uint8ClampedArray(o.buffer),width:i,height:n}}destroy(){this.managedTextures.slice().forEach(t=>this.onSourceDestroy(t)),this.managedTextures=null,this._renderer=null}}cl.extension={type:[v.WebGLSystem],name:"texture"};class hl{init(){const t=new at({uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uTransformMatrix:{value:new B,type:"mat3x3<f32>"},uRound:{value:0,type:"f32"}}),e=Lt(),s=ar({name:"graphics",bits:[Ri,Di(e),Ii,lr]});this.shader=new Bt({glProgram:s,resources:{localUniforms:t,batchSamplers:Mi(e)}})}execute(t,e){const s=e.context,i=s.customShader||this.shader,n=t.renderer,o=n.graphicsContext,{geometry:a,instructions:u}=o.getContextRenderData(s);i.groups[0]=n.globalUniforms.bindGroup,n.state.set(t.state),n.shader.bind(i),n.geometry.bind(a,i.glProgram);const l=u.instructions;for(let c=0;c<u.instructionSize;c++){const h=l[c];if(h.size){for(let d=0;d<h.textures.textures.length;d++)n.texture.bind(h.textures.textures[d],d);n.geometry.draw("triangle-list",h.size,h.start)}}}destroy(){this.shader.destroy(!0),this.shader=null}}hl.extension={type:[v.WebGLPipesAdaptor],name:"graphics"};class dl{init(){const t=ar({name:"mesh",bits:[Ii,z_,lr]});this._shader=new Bt({glProgram:t,resources:{uTexture:w.EMPTY.source,textureUniforms:{uTextureMatrix:{type:"mat3x3<f32>",value:new B}}}})}execute(t,e){const s=t.renderer;let i=e._shader;if(i){if(!i.glProgram)return}else{i=this._shader;const n=e.texture,o=n.source;i.resources.uTexture=o,i.resources.uSampler=o.style,i.resources.textureUniforms.uniforms.uTextureMatrix=n.textureMatrix.mapCoord}i.groups[100]=s.globalUniforms.bindGroup,i.groups[101]=t.localUniformsBindGroup,s.encoder.draw({geometry:e._geometry,shader:i,state:e.state})}destroy(){this._shader.destroy(!0),this._shader=null}}dl.extension={type:[v.WebGLPipesAdaptor],name:"mesh"};class pl{constructor(t){this._renderer=t}addRenderable(t,e){this._renderer.renderPipes.batch.break(e),e.add(t)}execute(t){t.isRenderable&&t.render(this._renderer)}destroy(){this._renderer=null}}pl.extension={type:[v.WebGLPipes,v.WebGPUPipes,v.CanvasPipes],name:"customRender"};function fl(r,t){const e=r.instructionSet,s=e.instructions;for(let i=0;i<e.instructionSize;i++){const n=s[i];t[n.renderPipeId].execute(n)}}class ml{constructor(t){this._renderer=t}addRenderGroup(t,e){this._renderer.renderPipes.batch.break(e),e.add(t)}execute(t){t.isRenderable&&(this._renderer.globalUniforms.push({worldTransformMatrix:t.worldTransform,worldColor:t.worldColorAlpha}),fl(t,this._renderer.renderPipes),this._renderer.globalUniforms.pop())}destroy(){this._renderer=null}}ml.extension={type:[v.WebGLPipes,v.WebGPUPipes,v.CanvasPipes],name:"renderGroup"};function gl(r,t=[]){t.push(r);for(let e=0;e<r.renderGroupChildren.length;e++)gl(r.renderGroupChildren[e],t);return t}function _l(r,t,e){const s=r>>16&255,i=r>>8&255,n=r&255,o=t>>16&255,a=t>>8&255,u=t&255,l=s+(o-s)*e,c=i+(a-i)*e,h=n+(u-n)*e;return(l<<16)+(c<<8)+h}const xr=16777215;function xl(r,t){return r===xr||t===xr?r+t-xr:_l(r,t,.5)}function w3(r,t,e){const s=(e>>24&255)/255,i=t*s*255,n=((r&255)<<16)+(r&65280)+(r>>16&255),o=e&16777215;let a;return n===xr||o===xr?a=n+o-xr:a=_l(n,o,.5),a+(i<<24)}const C3=new K;function bl(r,t=!1){Y0(r);const e=r.childrenToUpdate,s=r.updateTick++;for(const i in e){const n=Number(i),o=e[i],a=o.list,u=o.index;for(let l=0;l<u;l++){const c=a[l];c.parentRenderGroup===r&&c.relativeRenderGroupDepth===n&&vl(c,s,0)}o.index=0}if(t)for(let i=0;i<r.renderGroupChildren.length;i++)bl(r.renderGroupChildren[i],t)}function Y0(r){const t=r.root;let e;if(r.renderGroupParent){const s=r.renderGroupParent;r.worldTransform.appendFrom(t.relativeGroupTransform,s.worldTransform),r.worldColor=xl(t.groupColor,s.worldColor),e=t.groupAlpha*s.worldAlpha}else r.worldTransform.copyFrom(t.localTransform),r.worldColor=t.localColor,e=t.localAlpha;e=e<0?0:e>1?1:e,r.worldAlpha=e,r.worldColorAlpha=r.worldColor+((e*255|0)<<24)}function vl(r,t,e){if(t===r.updateTick)return;r.updateTick=t,r.didChange=!1;const s=r.localTransform;r.updateLocalTransform();const i=r.parent;if(i&&!i.renderGroup?(e=e|r._updateFlags,r.relativeGroupTransform.appendFrom(s,i.relativeGroupTransform),e&&q0(r,i,e)):(e=r._updateFlags,r.relativeGroupTransform.copyFrom(s),e&&q0(r,C3,e)),!r.renderGroup){const n=r.children,o=n.length;for(let u=0;u<o;u++)vl(n[u],t,e);const a=r.parentRenderGroup;r.renderPipeId&&!a.structureDidChange&&a.updateRenderable(r)}}function q0(r,t,e){if(e&ei){r.groupColor=xl(r.localColor,t.groupColor);let s=r.localAlpha*t.groupAlpha;s=s<0?0:s>1?1:s,r.groupAlpha=s,r.groupColorAlpha=r.groupColor+((s*255|0)<<24)}e&po&&(r.groupBlendMode=r.localBlendMode==="inherit"?t.groupBlendMode:r.localBlendMode),e&Vr&&(r.globalDisplayStatus=r.localDisplayStatus&t.globalDisplayStatus),r._updateFlags=0}function K0(r,t){const{list:e,index:s}=r.childrenRenderablesToUpdate;let i=!1;for(let n=0;n<s;n++){const o=e[n];if(i=t[o.renderPipeId].validateRenderable(o),i)break}return r.structureDidChange=i,i}const R3=new B;class yl{constructor(t){this._renderer=t}render({container:t,transform:e}){t.isRenderGroup=!0;const s=t.parent,i=t.renderGroup.renderGroupParent;t.parent=null,t.renderGroup.renderGroupParent=null;const n=this._renderer,o=gl(t.renderGroup,[]);let a=R3;e&&(a=a.copyFrom(t.renderGroup.localTransform),t.renderGroup.localTransform.copyFrom(e));const u=n.renderPipes;for(let l=0;l<o.length;l++){const c=o[l];c.runOnRender(),c.instructionSet.renderPipes=u,c.structureDidChange||K0(c,u),bl(c),c.structureDidChange?(c.structureDidChange=!1,j_(c,u)):P3(c),c.childrenRenderablesToUpdate.index=0,n.renderPipes.batch.upload(c.instructionSet)}n.globalUniforms.start({worldTransformMatrix:e?t.renderGroup.localTransform:t.renderGroup.worldTransform,worldColor:t.renderGroup.worldColorAlpha}),fl(t.renderGroup,u),u.uniformBatch&&u.uniformBatch.renderEnd(),e&&t.renderGroup.localTransform.copyFrom(a),t.parent=s,t.renderGroup.renderGroupParent=i}destroy(){this._renderer=null}}yl.extension={type:[v.WebGLSystem,v.WebGPUSystem,v.CanvasSystem],name:"renderGroup"};function P3(r){const{list:t,index:e}=r.childrenRenderablesToUpdate;for(let s=0;s<e;s++){const i=t[s];i.didViewUpdate&&r.updateRenderable(i)}}class Tl{constructor(t){this._gpuSpriteHash=Object.create(null),this._renderer=t}addRenderable(t,e){const s=this._getGpuSprite(t);t._didSpriteUpdate&&this._updateBatchableSprite(t,s),this._renderer.renderPipes.batch.addToBatch(s)}updateRenderable(t){const e=this._gpuSpriteHash[t.uid];t._didSpriteUpdate&&this._updateBatchableSprite(t,e),e.batcher.updateElement(e)}validateRenderable(t){const e=t._texture,s=this._getGpuSprite(t);return s.texture._source!==e._source?!s.batcher.checkAndUpdateTexture(s,e):!1}destroyRenderable(t){const e=this._gpuSpriteHash[t.uid];$.return(e),this._gpuSpriteHash[t.uid]=null}_updateBatchableSprite(t,e){t._didSpriteUpdate=!1,e.bounds=t.bounds,e.texture=t._texture}_getGpuSprite(t){return this._gpuSpriteHash[t.uid]||this._initGPUSprite(t)}_initGPUSprite(t){const e=$.get(bi);return e.renderable=t,e.texture=t._texture,e.bounds=t.bounds,e.roundPixels=this._renderer._roundPixels|t._roundPixels,this._gpuSpriteHash[t.uid]=e,t._didSpriteUpdate=!1,t.on("destroyed",()=>{this.destroyRenderable(t)}),e}destroy(){for(const t in this._gpuSpriteHash)$.return(this._gpuSpriteHash[t]);this._gpuSpriteHash=null,this._renderer=null}}Tl.extension={type:[v.WebGLPipes,v.WebGPUPipes,v.CanvasPipes],name:"sprite"};var D3=Object.defineProperty,Z0=Object.getOwnPropertySymbols,M3=Object.prototype.hasOwnProperty,O3=Object.prototype.propertyIsEnumerable,Q0=(r,t,e)=>t in r?D3(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,J0=(r,t)=>{for(var e in t||(t={}))M3.call(t,e)&&Q0(r,e,t[e]);if(Z0)for(var e of Z0(t))O3.call(t,e)&&Q0(r,e,t[e]);return r};const Al=class jx{constructor(){this.clearBeforeRender=!0,this._backgroundColor=new j(0),this.color=this._backgroundColor,this.alpha=1}init(t){t=J0(J0({},jx.defaultOptions),t),this.clearBeforeRender=t.clearBeforeRender,this.color=t.background||t.backgroundColor||this._backgroundColor,this.alpha=t.backgroundAlpha,this._backgroundColor.setAlpha(t.backgroundAlpha)}get color(){return this._backgroundColor}set color(t){this._backgroundColor.setValue(t)}get alpha(){return this._backgroundColor.alpha}set alpha(t){this._backgroundColor.setAlpha(t)}get colorRgba(){return this._backgroundColor.toArray()}destroy(){}};Al.extension={type:[v.WebGLSystem,v.WebGPUSystem,v.CanvasSystem],name:"background",priority:0},Al.defaultOptions={backgroundAlpha:1,backgroundColor:0,clearBeforeRender:!0};let t2=Al;const Cs={};N.handle(v.BlendMode,r=>{if(!r.name)throw new Error("BlendMode extension must have a name property");Cs[r.name]=r.ref},r=>{delete Cs[r.name]});class Sl{constructor(t){this._isAdvanced=!1,this._filterHash=Object.create(null),this._renderer=t}setBlendMode(t,e,s){if(this._activeBlendMode===e){this._isAdvanced&&this._renderableList.push(t);return}this._activeBlendMode=e,this._isAdvanced&&this._endAdvancedBlendMode(s),this._isAdvanced=!!Cs[e],this._isAdvanced&&(this._beginAdvancedBlendMode(s),this._renderableList.push(t))}_beginAdvancedBlendMode(t){this._renderer.renderPipes.batch.break(t);const e=this._activeBlendMode;if(!Cs[e])return;let s=this._filterHash[e];s||(s=this._filterHash[e]=new Xr,s.filters=[new Cs[e]]);const i={renderPipeId:"filter",action:"pushFilter",renderables:[],filterEffect:s,canBundle:!1};this._renderableList=i.renderables,t.add(i)}_endAdvancedBlendMode(t){this._renderableList=null,this._renderer.renderPipes.batch.break(t),t.add({renderPipeId:"filter",action:"popFilter",canBundle:!1})}buildStart(){this._isAdvanced=!1}buildEnd(t){this._isAdvanced&&this._endAdvancedBlendMode(t)}destroy(){this._renderer=null,this._renderableList=null;for(const t in this._filterHash)this._filterHash[t].destroy();this._filterHash=null}}Sl.extension={type:[v.WebGLPipes,v.WebGPUPipes,v.CanvasPipes],name:"blendMode"};var B3=Object.defineProperty,e2=Object.getOwnPropertySymbols,G3=Object.prototype.hasOwnProperty,I3=Object.prototype.propertyIsEnumerable,r2=(r,t,e)=>t in r?B3(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,El=(r,t)=>{for(var e in t||(t={}))G3.call(t,e)&&r2(r,e,t[e]);if(e2)for(var e of e2(t))I3.call(t,e)&&r2(r,e,t[e]);return r};const wl={png:"image/png",jpg:"image/jpeg",webp:"image/webp"},Cl=class Vx{constructor(t){this._renderer=t}_normalizeOptions(t,e={}){return t instanceof K||t instanceof w?El({target:t},e):El(El({},e),t)}async image(t){const e=new Image;return e.src=await this.base64(t),e}async base64(t){t=this._normalizeOptions(t,Vx.defaultImageOptions);const{format:e,quality:s}=t,i=this.canvas(t);if(i.toBlob!==void 0)return new Promise((n,o)=>{i.toBlob(a=>{if(!a){o(new Error("ICanvas.toBlob failed!"));return}const u=new FileReader;u.onload=()=>n(u.result),u.onerror=o,u.readAsDataURL(a)},wl[e],s)});if(i.toDataURL!==void 0)return i.toDataURL(wl[e],s);if(i.convertToBlob!==void 0){const n=await i.convertToBlob({type:wl[e],quality:s});return new Promise((o,a)=>{const u=new FileReader;u.onload=()=>o(u.result),u.onerror=a,u.readAsDataURL(n)})}throw new Error("Extract.base64() requires ICanvas.toDataURL, ICanvas.toBlob, or ICanvas.convertToBlob to be implemented")}canvas(t){t=this._normalizeOptions(t);const e=t.target,s=this._renderer;if(e instanceof w)return s.texture.generateCanvas(e);const i=s.textureGenerator.generateTexture(t),n=s.texture.generateCanvas(i);return i.destroy(),n}pixels(t){t=this._normalizeOptions(t);const e=t.target,s=this._renderer,i=e instanceof w?e:s.textureGenerator.generateTexture(t),n=s.texture.getPixels(i);return e instanceof K&&i.destroy(),n}texture(t){return t=this._normalizeOptions(t),t.target instanceof w?t.target:this._renderer.textureGenerator.generateTexture(t)}download(t){var e;t=this._normalizeOptions(t);const s=this.canvas(t),i=document.createElement("a");i.download=(e=t.filename)!=null?e:"image.png",i.href=s.toDataURL("image/png"),document.body.appendChild(i),i.click(),document.body.removeChild(i)}log(t){var e;const s=(e=t.width)!=null?e:200;t=this._normalizeOptions(t);const i=this.canvas(t),n=i.toDataURL();console.log(`[Pixi Texture] ${i.width}px ${i.height}px`);const o=["font-size: 1px;",`padding: ${s}px 300px;`,`background: url(${n}) no-repeat;`,"background-size: contain;"].join(" ");console.log("%c ",o)}destroy(){this._renderer=null}};Cl.extension={type:[v.WebGLSystem,v.WebGPUSystem],name:"extract"},Cl.defaultImageOptions={format:"png",quality:1};let s2=Cl;class i2 extends w{static create(t){return new w({source:new et(t)})}resize(t,e,s){return this.source.resize(t,e,s),this}}var F3=Object.defineProperty,U3=Object.defineProperties,N3=Object.getOwnPropertyDescriptors,n2=Object.getOwnPropertySymbols,k3=Object.prototype.hasOwnProperty,L3=Object.prototype.propertyIsEnumerable,o2=(r,t,e)=>t in r?F3(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,$3=(r,t)=>{for(var e in t||(t={}))k3.call(t,e)&&o2(r,e,t[e]);if(n2)for(var e of n2(t))L3.call(t,e)&&o2(r,e,t[e]);return r},H3=(r,t)=>U3(r,N3(t));const X3=new V,z3=new pt,j3=[0,0,0,0];class Rl{constructor(t){this._renderer=t}generateTexture(t){var e;t instanceof K&&(t={target:t,frame:void 0,textureSourceOptions:{},resolution:void 0});const s=t.resolution||this._renderer.resolution,i=t.antialias||this._renderer.view.antialias,n=t.target;let o=t.clearColor;o?o=Array.isArray(o)&&o.length===4?o:j.shared.setValue(o).toArray():o=j3;const a=((e=t.frame)==null?void 0:e.copyTo(X3))||ti(n,z3).rectangle;a.width=Math.max(a.width,1/s)|0,a.height=Math.max(a.height,1/s)|0;const u=i2.create(H3($3({},t.textureSourceOptions),{width:a.width,height:a.height,resolution:s,antialias:i})),l=B.shared.translate(-a.x,-a.y);return this._renderer.render({container:n,transform:l,target:u,clearColor:o}),u.source.updateMipmaps(),u}destroy(){this._renderer=null}}Rl.extension={type:[v.WebGLSystem,v.WebGPUSystem],name:"textureGenerator"};class Pl{constructor(t){this._stackIndex=0,this._globalUniformDataStack=[],this._uniformsPool=[],this._activeUniforms=[],this._bindGroupPool=[],this._activeBindGroups=[],this._renderer=t}reset(){this._stackIndex=0;for(let t=0;t<this._activeUniforms.length;t++)this._uniformsPool.push(this._activeUniforms[t]);for(let t=0;t<this._activeBindGroups.length;t++)this._bindGroupPool.push(this._activeBindGroups[t]);this._activeUniforms.length=0,this._activeBindGroups.length=0}start(t){this.reset(),this.push(t)}bind({size:t,projectionMatrix:e,worldTransformMatrix:s,worldColor:i,offset:n}){const o=this._renderer.renderTarget.renderTarget,a=this._stackIndex?this._globalUniformDataStack[this._stackIndex-1]:{projectionData:o,worldTransformMatrix:new B,worldColor:4294967295,offset:new it},u={projectionMatrix:e||this._renderer.renderTarget.projectionMatrix,resolution:t||o.size,worldTransformMatrix:s||a.worldTransformMatrix,worldColor:i||a.worldColor,offset:n||a.offset,bindGroup:null},l=this._uniformsPool.pop()||this._createUniforms();this._activeUniforms.push(l);const c=l.uniforms;c.uProjectionMatrix=u.projectionMatrix,c.uResolution=u.resolution,c.uWorldTransformMatrix.copyFrom(u.worldTransformMatrix),c.uWorldTransformMatrix.tx-=u.offset.x,c.uWorldTransformMatrix.ty-=u.offset.y,es(u.worldColor,c.uWorldColorAlpha,0),l.update();let h;this._renderer.renderPipes.uniformBatch?h=this._renderer.renderPipes.uniformBatch.getUniformBindGroup(l,!1):(h=this._bindGroupPool.pop()||new Kt,this._activeBindGroups.push(h),h.setResource(l,0)),u.bindGroup=h,this._currentGlobalUniformData=u}push(t){this.bind(t),this._globalUniformDataStack[this._stackIndex++]=this._currentGlobalUniformData}pop(){this._currentGlobalUniformData=this._globalUniformDataStack[--this._stackIndex-1],this._renderer.type===Pt.WEBGL&&this._currentGlobalUniformData.bindGroup.resources[0].update()}get bindGroup(){return this._currentGlobalUniformData.bindGroup}get uniformGroup(){return this._currentGlobalUniformData.bindGroup.resources[0]}_createUniforms(){return new at({uProjectionMatrix:{value:new B,type:"mat3x3<f32>"},uWorldTransformMatrix:{value:new B,type:"mat3x3<f32>"},uWorldColorAlpha:{value:new Float32Array(4),type:"vec4<f32>"},uResolution:{value:[0,0],type:"vec2<f32>"}},{isStatic:!0})}destroy(){this._renderer=null}}Pl.extension={type:[v.WebGLSystem,v.WebGPUSystem,v.CanvasSystem],name:"globalUniforms"};let a2=!1;const Dl="8.2.1";function u2(r){if(!a2){if(z.get().getNavigator().userAgent.toLowerCase().indexOf("chrome")>-1){const t=[`%c %c %c %c %c PixiJS %c v${Dl} (${r}) http://www.pixijs.com/
1971
1971
 
1972
1972
  `,"background: #E72264; padding:5px 0;","background: #6CA2EA; padding:5px 0;","background: #B5D33D; padding:5px 0;","background: #FED23F; padding:5px 0;","color: #FFFFFF; background: #E72264; padding:5px 0;","color: #E72264; background: #FFFFFF; padding:5px 0;"];globalThis.console.log(...t)}else globalThis.console&&globalThis.console.log(`PixiJS ${Dl} - ${r} - http://www.pixijs.com/`);a2=!0}}class _n{constructor(t){this._renderer=t}init(t){if(t.hello){let e=this._renderer.name;this._renderer.type===Pt.WEBGL&&(e+=` ${this._renderer.context.webGLVersion}`),u2(e)}}}_n.extension={type:[v.WebGLSystem,v.WebGPUSystem,v.CanvasSystem],name:"hello",priority:-2},_n.defaultOptions={hello:!1};var V3=Object.defineProperty,l2=Object.getOwnPropertySymbols,W3=Object.prototype.hasOwnProperty,Y3=Object.prototype.propertyIsEnumerable,c2=(r,t,e)=>t in r?V3(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,h2=(r,t)=>{for(var e in t||(t={}))W3.call(t,e)&&c2(r,e,t[e]);if(l2)for(var e of l2(t))Y3.call(t,e)&&c2(r,e,t[e]);return r};const Ml=class Wx{constructor(t){this._renderer=t,this.count=0,this.checkCount=0}init(t){t=h2(h2({},Wx.defaultOptions),t),this.checkCountMax=t.textureGCCheckCountMax,this.maxIdle=t.textureGCAMaxIdle,this.active=t.textureGCActive}postrender(){this._renderer.renderingToScreen&&(this.count++,this.active&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))}run(){const t=this._renderer.texture.managedTextures;for(let e=0;e<t.length;e++){const s=t[e];s.autoGarbageCollect&&s.resource&&s._touched>-1&&this.count-s._touched>this.maxIdle&&(s._touched=-1,s.unload())}}destroy(){this._renderer=null}};Ml.extension={type:[v.WebGLSystem,v.WebGPUSystem],name:"textureGC"},Ml.defaultOptions={textureGCActive:!0,textureGCAMaxIdle:60*60,textureGCCheckCountMax:600};let Ol=Ml;N.add(Ol);var q3=Object.defineProperty,d2=Object.getOwnPropertySymbols,K3=Object.prototype.hasOwnProperty,Z3=Object.prototype.propertyIsEnumerable,p2=(r,t,e)=>t in r?q3(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,f2=(r,t)=>{for(var e in t||(t={}))K3.call(t,e)&&p2(r,e,t[e]);if(d2)for(var e of d2(t))Z3.call(t,e)&&p2(r,e,t[e]);return r};const Bl=class Yx{get resolution(){return this.texture.source._resolution}set resolution(t){this.texture.source.resize(this.texture.source.width,this.texture.source.height,t)}init(t){t=f2(f2({},Yx.defaultOptions),t),t.view&&(t.canvas=t.view),this.screen=new V(0,0,t.width,t.height),this.canvas=t.canvas||z.get().createCanvas(),this.antialias=!!t.antialias,this.texture=Qu(this.canvas,t),this.renderTarget=new dn({colorTextures:[this.texture],depth:!!t.depth,isRoot:!0}),this.texture.source.transparent=t.backgroundAlpha<1,this.multiView=!!t.multiView,this.autoDensity&&(this.canvas.style.width=`${this.texture.width}px`,this.canvas.style.height=`${this.texture.height}px`),this.resolution=t.resolution}resize(t,e,s){this.texture.source.resize(t,e,s),this.screen.width=this.texture.frame.width,this.screen.height=this.texture.frame.height,this.autoDensity&&(this.canvas.style.width=`${t}px`,this.canvas.style.height=`${e}px`)}destroy(t=!1){(typeof t=="boolean"?t:t!=null&&t.removeView)&&this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)}};Bl.extension={type:[v.WebGLSystem,v.WebGPUSystem,v.CanvasSystem],name:"view",priority:0},Bl.defaultOptions={width:800,height:600,autoDensity:!1,antialias:!1};let m2=Bl;const Gl=[t2,Pl,_n,m2,yl,Ol,Rl,s2,tu],Il=[Sl,Gu,Tl,ml,Iu,Uu,Fu,pl],Q3=[...Gl,Zu,i0,Z_,Nu,cl,tl,Hu,ol,nl,ju,F0,Vu,zu],J3=[...Il],tw=[Ou,dl,hl],g2=[],_2=[],x2=[];N.handleByNamedList(v.WebGLSystem,g2),N.handleByNamedList(v.WebGLPipes,_2),N.handleByNamedList(v.WebGLPipesAdaptor,x2),N.add(...Q3,...J3,...tw);class b2 extends ps{constructor(){const t={name:"webgl",type:Pt.WEBGL,systems:g2,renderPipes:_2,renderPipeAdaptors:x2};super(t)}}var ew={__proto__:null,WebGLRenderer:b2};class Fl{constructor(t){this._hash=Object.create(null),this._renderer=t}contextChange(t){this._gpu=t}getBindGroup(t,e,s){return t._updateKey(),this._hash[t._key]||this._createBindGroup(t,e,s)}_createBindGroup(t,e,s){var i;const n=this._gpu.device,o=e.layout[s],a=[],u=this._renderer;for(const h in o){const d=(i=t.resources[h])!=null?i:t.resources[o[h]];let p;if(d._resourceType==="uniformGroup"){const f=d;u.ubo.updateUniformGroup(f);const g=f.buffer;p={buffer:u.buffer.getGPUBuffer(g),offset:0,size:g.descriptor.size}}else if(d._resourceType==="buffer"){const f=d;p={buffer:u.buffer.getGPUBuffer(f),offset:0,size:f.descriptor.size}}else if(d._resourceType==="bufferResource"){const f=d;p={buffer:u.buffer.getGPUBuffer(f.buffer),offset:f.offset,size:f.size}}else if(d._resourceType==="textureSampler"){const f=d;p=u.texture.getGpuSampler(f)}else if(d._resourceType==="textureSource"){const f=d;p=u.texture.getGpuSource(f).createView({})}a.push({binding:o[h],resource:p})}const l=u.shader.getProgramData(e).bindGroups[s],c=n.createBindGroup({layout:l,entries:a});return this._hash[t._key]=c,c}destroy(){for(const t of Object.keys(this._hash))this._hash[t]=null;this._hash=null,this._renderer=null}}Fl.extension={type:[v.WebGPUSystem],name:"bindGroup"};class Ul{constructor(){this._gpuBuffers=Object.create(null),this._managedBuffers=[]}contextChange(t){this._gpu=t}getGPUBuffer(t){return this._gpuBuffers[t.uid]||this.createGPUBuffer(t)}updateBuffer(t){const e=this._gpuBuffers[t.uid]||this.createGPUBuffer(t),s=t.data;return t._updateID&&s&&(t._updateID=0,this._gpu.device.queue.writeBuffer(e,0,s.buffer,0,(t._updateSize||s.byteLength)+3&-4)),e}destroyAll(){for(const t in this._gpuBuffers)this._gpuBuffers[t].destroy();this._gpuBuffers={}}createGPUBuffer(t){this._gpuBuffers[t.uid]||(t.on("update",this.updateBuffer,this),t.on("change",this.onBufferChange,this),t.on("destroy",this.onBufferDestroy,this));const e=this._gpu.device.createBuffer(t.descriptor);return t._updateID=0,t.data&&(ai(t.data.buffer,e.getMappedRange()),e.unmap()),this._gpuBuffers[t.uid]=e,this._managedBuffers.push(t),e}onBufferChange(t){this._gpuBuffers[t.uid].destroy(),t._updateID=0,this._gpuBuffers[t.uid]=this.createGPUBuffer(t)}onBufferDestroy(t){this._managedBuffers.splice(this._managedBuffers.indexOf(t),1),this._destroyBuffer(t)}destroy(){this._managedBuffers.forEach(t=>this._destroyBuffer(t)),this._managedBuffers=null,this._gpuBuffers=null}_destroyBuffer(t){this._gpuBuffers[t.uid].destroy(),t.off("update",this.updateBuffer,this),t.off("change",this.onBufferChange,this),t.off("destroy",this.onBufferDestroy,this),this._gpuBuffers[t.uid]=null}}Ul.extension={type:[v.WebGPUSystem],name:"buffer"};function rw(r,t){const e=r.descriptor.size,s=t.gpu.device,i=new wt({data:new Float32Array(24e5),usage:H.MAP_READ|H.COPY_DST}),n=t.buffer.createGPUBuffer(i),o=s.createCommandEncoder();o.copyBufferToBuffer(t.buffer.getGPUBuffer(r),0,n,0,e),s.queue.submit([o.finish()]),n.mapAsync(GPUMapMode.READ,0,e).then(()=>{n.getMappedRange(0,e),n.unmap()})}class v2{constructor({minUniformOffsetAlignment:t}){this._minUniformOffsetAlignment=256,this.byteIndex=0,this._minUniformOffsetAlignment=t,this.data=new Float32Array(65535)}clear(){this.byteIndex=0}addEmptyGroup(t){if(t>this._minUniformOffsetAlignment/4)throw new Error(`UniformBufferBatch: array is too large: ${t*4}`);const e=this.byteIndex;let s=e+t*4;if(s=Math.ceil(s/this._minUniformOffsetAlignment)*this._minUniformOffsetAlignment,s>this.data.length*4)throw new Error("UniformBufferBatch: ubo batch got too big");return this.byteIndex=s,e}addGroup(t){const e=this.addEmptyGroup(t.length);for(let s=0;s<t.length;s++)this.data[e/4+s]=t[s];return e}destroy(){this._buffer.destroy(),this._buffer=null,this.data=null}}class Nl{constructor(t){this._colorMaskCache=15,this._renderer=t}setMask(t){this._colorMaskCache!==t&&(this._colorMaskCache=t,this._renderer.pipeline.setColorMask(t))}destroy(){this._renderer=null,this._colorMaskCache=null}}Nl.extension={type:[v.WebGPUSystem],name:"colorMask"};class xn{constructor(t){this._renderer=t}async init(t){return this._initPromise?this._initPromise:(this._initPromise=this._createDeviceAndAdaptor(t).then(e=>{this.gpu=e,this._renderer.runners.contextChange.emit(this.gpu)}),this._initPromise)}contextChange(t){this._renderer.gpu=t}async _createDeviceAndAdaptor(t){const e=await navigator.gpu.requestAdapter({powerPreference:t.powerPreference,forceFallbackAdapter:t.forceFallbackAdapter}),s=["texture-compression-bc","texture-compression-astc","texture-compression-etc2"].filter(n=>e.features.has(n)),i=await e.requestDevice({requiredFeatures:s});return{adapter:e,device:i}}destroy(){this.gpu=null,this._renderer=null}}xn.extension={type:[v.WebGPUSystem],name:"device"},xn.defaultOptions={powerPreference:void 0,forceFallbackAdapter:!1};var sw=Object.defineProperty,y2=Object.getOwnPropertySymbols,iw=Object.prototype.hasOwnProperty,nw=Object.prototype.propertyIsEnumerable,T2=(r,t,e)=>t in r?sw(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,A2=(r,t)=>{for(var e in t||(t={}))iw.call(t,e)&&T2(r,e,t[e]);if(y2)for(var e of y2(t))nw.call(t,e)&&T2(r,e,t[e]);return r};class kl{constructor(t){this._boundBindGroup=Object.create(null),this._boundVertexBuffer=Object.create(null),this._renderer=t}renderStart(){this.commandFinished=new Promise(t=>{this._resolveCommandFinished=t}),this.commandEncoder=this._renderer.gpu.device.createCommandEncoder()}beginRenderPass(t){this.endRenderPass(),this._clearCache(),this.renderPassEncoder=this.commandEncoder.beginRenderPass(t.descriptor)}endRenderPass(){this.renderPassEncoder&&this.renderPassEncoder.end(),this.renderPassEncoder=null}setViewport(t){this.renderPassEncoder.setViewport(t.x,t.y,t.width,t.height,0,1)}setPipelineFromGeometryProgramAndState(t,e,s,i){const n=this._renderer.pipeline.getPipeline(t,e,s,i);this.setPipeline(n)}setPipeline(t){this._boundPipeline!==t&&(this._boundPipeline=t,this.renderPassEncoder.setPipeline(t))}_setVertexBuffer(t,e){this._boundVertexBuffer[t]!==e&&(this._boundVertexBuffer[t]=e,this.renderPassEncoder.setVertexBuffer(t,this._renderer.buffer.updateBuffer(e)))}_setIndexBuffer(t){if(this._boundIndexBuffer===t)return;this._boundIndexBuffer=t;const e=t.data.BYTES_PER_ELEMENT===2?"uint16":"uint32";this.renderPassEncoder.setIndexBuffer(this._renderer.buffer.updateBuffer(t),e)}resetBindGroup(t){this._boundBindGroup[t]=null}setBindGroup(t,e,s){if(this._boundBindGroup[t]===e)return;this._boundBindGroup[t]=e,e._touch(this._renderer.textureGC.count);const i=this._renderer.bindGroup.getBindGroup(e,s,t);this.renderPassEncoder.setBindGroup(t,i)}setGeometry(t){for(const e in t.attributes){const s=t.attributes[e];this._setVertexBuffer(s.location,s.buffer)}t.indexBuffer&&this._setIndexBuffer(t.indexBuffer)}_setShaderBindGroups(t,e){for(const s in t.groups){const i=t.groups[s];e||this._syncBindGroup(i),this.setBindGroup(s,i,t.gpuProgram)}}_syncBindGroup(t){for(const e in t.resources){const s=t.resources[e];s.isUniformGroup&&this._renderer.ubo.updateUniformGroup(s)}}draw(t){const{geometry:e,shader:s,state:i,topology:n,size:o,start:a,instanceCount:u,skipSync:l}=t;this.setPipelineFromGeometryProgramAndState(e,s.gpuProgram,i,n),this.setGeometry(e),this._setShaderBindGroups(s,l),e.indexBuffer?this.renderPassEncoder.drawIndexed(o||e.indexBuffer.data.length,u||e.instanceCount,a||0):this.renderPassEncoder.draw(o||e.getSize(),u||e.instanceCount,a||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 t=this._renderer.renderTarget.adaptor.getDescriptor(this._renderer.renderTarget.renderTarget,!1,[0,0,0,1]);this.renderPassEncoder=this.commandEncoder.beginRenderPass(t);const e=this._boundPipeline,s=A2({},this._boundVertexBuffer),i=this._boundIndexBuffer,n=A2({},this._boundBindGroup);this._clearCache();const o=this._renderer.renderTarget.viewport;this.renderPassEncoder.setViewport(o.x,o.y,o.width,o.height,0,1),this.setPipeline(e);for(const a in s)this._setVertexBuffer(a,s[a]);for(const a in n)this.setBindGroup(a,n[a],null);this._setIndexBuffer(i)}_clearCache(){for(let t=0;t<16;t++)this._boundBindGroup[t]=null,this._boundVertexBuffer[t]=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(t){this._gpu=t}}kl.extension={type:[v.WebGPUSystem],name:"encoder",priority:1};class Ll{constructor(t){this._renderTargetStencilState=Object.create(null),this._renderer=t,t.renderTarget.onRenderTargetChange.add(this)}onRenderTargetChange(t){let e=this._renderTargetStencilState[t.uid];e||(e=this._renderTargetStencilState[t.uid]={stencilMode:ot.DISABLED,stencilReference:0}),this._activeRenderTarget=t,this.setStencilMode(e.stencilMode,e.stencilReference)}setStencilMode(t,e){const s=this._renderTargetStencilState[this._activeRenderTarget.uid];s.stencilMode=t,s.stencilReference=e;const i=this._renderer;i.pipeline.setStencilMode(t),i.encoder.renderPassEncoder.setStencilReference(e)}destroy(){this._renderer.renderTarget.onRenderTargetChange.remove(this),this._renderer=null,this._activeRenderTarget=null,this._renderTargetStencilState=null}}Ll.extension={type:[v.WebGPUSystem],name:"stencil"};const Rs={i32:{align:4,size:4},u32:{align:4,size:4},f32:{align:4,size:4},f16:{align:2,size:2},"vec2<i32>":{align:8,size:8},"vec2<u32>":{align:8,size:8},"vec2<f32>":{align:8,size:8},"vec2<f16>":{align:4,size:4},"vec3<i32>":{align:16,size:12},"vec3<u32>":{align:16,size:12},"vec3<f32>":{align:16,size:12},"vec3<f16>":{align:8,size:6},"vec4<i32>":{align:16,size:16},"vec4<u32>":{align:16,size:16},"vec4<f32>":{align:16,size:16},"vec4<f16>":{align:8,size:8},"mat2x2<f32>":{align:8,size:16},"mat2x2<f16>":{align:4,size:8},"mat3x2<f32>":{align:8,size:24},"mat3x2<f16>":{align:4,size:12},"mat4x2<f32>":{align:8,size:32},"mat4x2<f16>":{align:4,size:16},"mat2x3<f32>":{align:16,size:32},"mat2x3<f16>":{align:8,size:16},"mat3x3<f32>":{align:16,size:48},"mat3x3<f16>":{align:8,size:24},"mat4x3<f32>":{align:16,size:64},"mat4x3<f16>":{align:8,size:32},"mat2x4<f32>":{align:16,size:32},"mat2x4<f16>":{align:8,size:16},"mat3x4<f32>":{align:16,size:48},"mat3x4<f16>":{align:8,size:24},"mat4x4<f32>":{align:16,size:64},"mat4x4<f16>":{align:8,size:32}};function S2(r){const t=r.map(s=>({data:s,offset:0,size:0}));let e=0;for(let s=0;s<t.length;s++){const i=t[s];let n=Rs[i.data.type].size;const o=Rs[i.data.type].align;if(!Rs[i.data.type])throw new Error(`[Pixi.js] WebGPU UniformBuffer: Unknown type ${i.data.type}`);i.data.size>1&&(n=Math.max(n,o)*i.data.size),e=Math.ceil(e/o)*o,i.size=n,i.offset=e,e+=n}return e=Math.ceil(e/16)*16,{uboElements:t,size:e}}function E2(r,t){const{size:e,align:s}=Rs[r.data.type],i=(s-e)/4;return`
1973
1973
  v = uv.${r.data.name};
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * PixiJS - v8.2.0
3
- * Compiled Tue, 25 Jun 2024 11:06:28 UTC
2
+ * PixiJS - v8.2.1
3
+ * Compiled Tue, 25 Jun 2024 11:46:34 UTC
4
4
  *
5
5
  * PixiJS is licensed under the MIT License.
6
6
  * http://www.opensource.org/licenses/mit-license
@@ -41268,7 +41268,7 @@ GlobalUniformSystem.extension = {
41268
41268
 
41269
41269
  "use strict";
41270
41270
  let saidHello = false;
41271
- const VERSION = "8.2.0";
41271
+ const VERSION = "8.2.1";
41272
41272
  function sayHello(type) {
41273
41273
  if (saidHello) {
41274
41274
  return;
@@ -4,7 +4,7 @@ var adapter = require('../environment/adapter.js');
4
4
 
5
5
  "use strict";
6
6
  let saidHello = false;
7
- const VERSION = "8.2.0";
7
+ const VERSION = "8.2.1";
8
8
  function sayHello(type) {
9
9
  if (saidHello) {
10
10
  return;
@@ -2,7 +2,7 @@ import { DOMAdapter } from '../environment/adapter.mjs';
2
2
 
3
3
  "use strict";
4
4
  let saidHello = false;
5
- const VERSION = "8.2.0";
5
+ const VERSION = "8.2.1";
6
6
  function sayHello(type) {
7
7
  if (saidHello) {
8
8
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pixi.js",
3
- "version": "8.2.0-main.b9529c8",
3
+ "version": "8.2.1-dev.1054a19",
4
4
  "author": "PixiJS Team",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.mjs",