chatlab-cli 0.30.2 → 0.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chat-command-VBDMWOKL.mjs → chat-command-CHV7RLBH.mjs} +9 -8
- package/dist/{chat-command-VBDMWOKL.mjs.map → chat-command-CHV7RLBH.mjs.map} +1 -1
- package/dist/{chunk-326OCJOT.mjs → chunk-DA5T64RY.mjs} +2 -2
- package/dist/{chunk-M2PXDX4G.mjs → chunk-DBBL74RK.mjs} +31 -22
- package/dist/chunk-DBBL74RK.mjs.map +1 -0
- package/dist/{chunk-KBSAVUFV.mjs → chunk-EXD2SXWL.mjs} +89 -15
- package/dist/chunk-EXD2SXWL.mjs.map +1 -0
- package/dist/{chunk-D3DPCDII.mjs → chunk-JH5RAJT2.mjs} +83 -34
- package/dist/chunk-JH5RAJT2.mjs.map +1 -0
- package/dist/{chunk-5EE2EFPE.mjs → chunk-RD335EMA.mjs} +4 -4
- package/dist/{chunk-WV5GSRQM.mjs → chunk-RDCUGC24.mjs} +5 -15
- package/dist/chunk-RDCUGC24.mjs.map +1 -0
- package/dist/{chunk-TEX44HNL.mjs → chunk-SNCXU2QL.mjs} +5 -15
- package/dist/chunk-SNCXU2QL.mjs.map +1 -0
- package/dist/{chunk-36JGKW6K.mjs → chunk-T64GA5HP.mjs} +1134 -364
- package/dist/chunk-T64GA5HP.mjs.map +1 -0
- package/dist/{chunk-LVEJHB3X.mjs → chunk-UWWFOEGF.mjs} +494 -97
- package/dist/chunk-UWWFOEGF.mjs.map +1 -0
- package/dist/{chunk-ULNRUS55.mjs → chunk-WQCY45U2.mjs} +3 -3
- package/dist/chunk-YAQLYL52.mjs +14 -0
- package/dist/chunk-YAQLYL52.mjs.map +1 -0
- package/dist/{chunk-TCZHG3G7.mjs → chunk-YPQ72HMX.mjs} +2 -2
- package/dist/cli.mjs +8 -7
- package/dist/contacts-worker.mjs +2 -2
- package/dist/global-insight-worker.mjs +179 -0
- package/dist/global-insight-worker.mjs.map +1 -0
- package/dist/{http-L4AMELPZ.mjs → http-3B5ARN7A.mjs} +12 -11
- package/dist/{import-WWCSXGVS.mjs → import-2DZGNSEX.mjs} +10 -7
- package/dist/index.mjs +12 -11
- package/dist/{mcp-A4M3LT5O.mjs → mcp-44I6FUUQ.mjs} +12 -11
- package/dist/{mcp-A4M3LT5O.mjs.map → mcp-44I6FUUQ.mjs.map} +1 -1
- package/dist/people-relationships-worker.mjs +2 -2
- package/dist/semantic-index-worker.mjs +1 -1
- package/dist/{src-MPNBTFOE.mjs → src-R3QX6L3L.mjs} +26 -6
- package/dist/{stream-import-HIE7PNL4.mjs → stream-import-VUEL2TTU.mjs} +10 -7
- package/dist/{worker-runtime-BJXO24XX.mjs → worker-runtime-GJAOIIZW.mjs} +6 -5
- package/dist/{worker-runtime-BJXO24XX.mjs.map → worker-runtime-GJAOIIZW.mjs.map} +1 -1
- package/dist-web/assets/ActionToolsPanel-fAio70bI.css +1 -0
- package/dist-web/assets/ActionToolsPanel.vue_vue_type_script_setup_true_lang-CdJT0t2f.js +110 -0
- package/dist-web/assets/{BufferResource-q3rzaWWd.js → BufferResource-BPGkshPa.js} +1 -1
- package/dist-web/assets/{CanvasRenderer-BRk1y8tp.js → CanvasRenderer-DTKkZhq4.js} +1 -1
- package/dist-web/assets/{EChartWordcloud-Clg60FMo.js → EChartWordcloud-DU3ZYdgz.js} +1 -1
- package/dist-web/assets/{Filter-BJwode73.js → Filter-CHXKzS2l.js} +1 -1
- package/dist-web/assets/{LoadingState.vue_vue_type_script_setup_true_lang-D_dJuLWJ.js → LoadingState.vue_vue_type_script_setup_true_lang-DACMroOe.js} +1 -1
- package/dist-web/assets/MessageExportModal-h-zl0dx1.js +1 -0
- package/dist-web/assets/PageHeader-CK0hTsdx.js +1 -0
- package/dist-web/assets/PageHeader-XIXMTomn.css +1 -0
- package/dist-web/assets/{RelationshipGalaxyCanvas-CORMD7vL.js → RelationshipGalaxyCanvas-Dwdy5flh.js} +3 -3
- package/dist-web/assets/{RelationshipGalaxyThreeCanvas-B_w_P4ob.js → RelationshipGalaxyThreeCanvas-CtY4TGen.js} +1 -1
- package/dist-web/assets/{RenderTargetSystem-CGhV9R9E.js → RenderTargetSystem-BE56mKRG.js} +1 -1
- package/dist-web/assets/ThemeCard.vue_vue_type_script_setup_true_lang-BoZyssJF.js +1 -0
- package/dist-web/assets/TimeSelect.vue_vue_type_script_setup_true_lang-27hMyAUE.js +1 -0
- package/dist-web/assets/{WebGLRenderer-CAokTE5X.js → WebGLRenderer-Dm18dxOf.js} +1 -1
- package/dist-web/assets/{WebGPURenderer-DzP4ggSy.js → WebGPURenderer-BF6TF-is.js} +1 -1
- package/dist-web/assets/annual-summary-time-range-DVLXK1r4.js +1 -0
- package/dist-web/assets/base-CFPyD9Gy.js +1 -0
- package/dist-web/assets/{browserAll-CAZCK6dd.js → browserAll-Cn_CfkXl.js} +1 -1
- package/dist-web/assets/dateFormat-BcqNKTQ1.js +1 -0
- package/dist-web/assets/{electron-CkPDbAaS.js → electron-B6xOabTq.js} +1 -1
- package/dist-web/assets/electron-hcWiB7Gg.js +1 -0
- package/dist-web/assets/fetch-BPkgnY0R.js +1 -0
- package/dist-web/assets/{fetch-LX9jrJCC.js → fetch-BRXmDI_2.js} +1 -1
- package/dist-web/assets/{fetch-Apd5OLJw.js → fetch-BUm1isWe.js} +1 -1
- package/dist-web/assets/{fetch-B8rik0TM.js → fetch-CBOJwwJp.js} +3 -3
- package/dist-web/assets/{fetch-wqMSiaK3.js → fetch-CEhUu1Yu.js} +1 -1
- package/dist-web/assets/fetch-C_EfVFJi.js +3 -0
- package/dist-web/assets/{fetch-DQ9UNNAy.js → fetch-DL_u25Ui.js} +1 -1
- package/dist-web/assets/{fetch-BIEXkvDq.js → fetch-DMLq3xPG.js} +1 -1
- package/dist-web/assets/{fetch--UbRoBT7.js → fetch-DylpNKCR.js} +1 -1
- package/dist-web/assets/fetch-etgwVKIw.js +1 -0
- package/dist-web/assets/index-0x1QPzKZ.js +1 -0
- package/dist-web/assets/index-B5S9FnfP.js +1 -0
- package/dist-web/assets/index-BS6loLHW.js +1 -0
- package/dist-web/assets/index-BfO_LpDv.css +1 -0
- package/dist-web/assets/index-BrTlAl8b.js +1 -0
- package/dist-web/assets/index-ByUaiVQK.css +1 -0
- package/dist-web/assets/{index-S-YQRH1E.js → index-C3TnydSt.js} +1 -1
- package/dist-web/assets/index-CAWO10k1.js +2 -0
- package/dist-web/assets/index-C_0GHEcb.css +1 -0
- package/dist-web/assets/index-Chm17wNe.js +2 -0
- package/dist-web/assets/index-DAr_2DlV.js +173 -0
- package/dist-web/assets/index-Em6upenM.js +64 -0
- package/dist-web/assets/index-FoTy2Cce.js +1 -0
- package/dist-web/assets/index-YADL4XIp.js +22 -0
- package/dist-web/assets/index-ZsZwPLWy.css +1 -0
- package/dist-web/assets/index-_6lck7Bv.css +1 -0
- package/dist-web/assets/index-aMIgqj43.js +1 -0
- package/dist-web/assets/index-y7cxH1Et.css +1 -0
- package/dist-web/assets/index-zZVsV5HB.js +1 -0
- package/dist-web/assets/{people-page-header-Mupn-U_b.js → people-page-header-BdKM1qhX.js} +1 -1
- package/dist-web/assets/types-CZnACqaB.js +1 -0
- package/dist-web/assets/{vendor-echarts-hJVnODyU.js → vendor-echarts-B-i_56Av.js} +1 -1
- package/dist-web/assets/{vendor-echarts-wordcloud-k5ih2Jl4.js → vendor-echarts-wordcloud-Ca8n6qS6.js} +1 -1
- package/dist-web/assets/{vendor-nuxt-ui-DaLxYaC4.js → vendor-nuxt-ui-CS1uxE9C.js} +2 -2
- package/dist-web/assets/{vendor-reka-ui-CzM4kDQ7.js → vendor-reka-ui-Cta6JPvN.js} +1 -1
- package/dist-web/assets/{web-DbKs6-1b.js → web-BUZ-dZy0.js} +1 -1
- package/dist-web/assets/{webworkerAll-Bhv-hBqR.js → webworkerAll-BKGP--A4.js} +1 -1
- package/dist-web/index.html +4 -4
- package/package.json +1 -1
- package/dist/chunk-36JGKW6K.mjs.map +0 -1
- package/dist/chunk-D3DPCDII.mjs.map +0 -1
- package/dist/chunk-KBSAVUFV.mjs.map +0 -1
- package/dist/chunk-LVEJHB3X.mjs.map +0 -1
- package/dist/chunk-M2PXDX4G.mjs.map +0 -1
- package/dist/chunk-TEX44HNL.mjs.map +0 -1
- package/dist/chunk-WV5GSRQM.mjs.map +0 -1
- package/dist-web/assets/DebugToolsPanel-D_lFIW6j.css +0 -1
- package/dist-web/assets/DebugToolsPanel.vue_vue_type_script_setup_true_lang-F4n0zNX2.js +0 -110
- package/dist-web/assets/MessageExportModal-CGcdMOyw.js +0 -1
- package/dist-web/assets/PageHeader-Bbn87QZS.css +0 -1
- package/dist-web/assets/PageHeader-CZaqOdBQ.js +0 -1
- package/dist-web/assets/electron-D9vE5t3H.js +0 -1
- package/dist-web/assets/fetch-1pB-HbYw.js +0 -3
- package/dist-web/assets/fetch-CF_3ZqRa.js +0 -1
- package/dist-web/assets/fetch-FSNxSnAp.js +0 -1
- package/dist-web/assets/index---rXG1hZ.css +0 -1
- package/dist-web/assets/index-B01uUoHE.js +0 -1
- package/dist-web/assets/index-B4l3rHie.css +0 -1
- package/dist-web/assets/index-BSIyyt0z.js +0 -1
- package/dist-web/assets/index-Bh8z441f.js +0 -2
- package/dist-web/assets/index-C0rya8v4.js +0 -1
- package/dist-web/assets/index-C1p9CbmN.css +0 -1
- package/dist-web/assets/index-COpza1A4.css +0 -1
- package/dist-web/assets/index-CZbZv2fh.js +0 -64
- package/dist-web/assets/index-CqUuHQBQ.js +0 -22
- package/dist-web/assets/index-CzeTP5MJ.js +0 -173
- package/dist-web/assets/index-DgNxTM_8.js +0 -2
- package/dist-web/assets/index-DosG7LmJ.css +0 -1
- /package/dist/{chunk-326OCJOT.mjs.map → chunk-DA5T64RY.mjs.map} +0 -0
- /package/dist/{chunk-5EE2EFPE.mjs.map → chunk-RD335EMA.mjs.map} +0 -0
- /package/dist/{chunk-ULNRUS55.mjs.map → chunk-WQCY45U2.mjs.map} +0 -0
- /package/dist/{chunk-TCZHG3G7.mjs.map → chunk-YPQ72HMX.mjs.map} +0 -0
- /package/dist/{http-L4AMELPZ.mjs.map → http-3B5ARN7A.mjs.map} +0 -0
- /package/dist/{import-WWCSXGVS.mjs.map → import-2DZGNSEX.mjs.map} +0 -0
- /package/dist/{src-MPNBTFOE.mjs.map → src-R3QX6L3L.mjs.map} +0 -0
- /package/dist/{stream-import-HIE7PNL4.mjs.map → stream-import-VUEL2TTU.mjs.map} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/browserAll-
|
|
2
|
-
import{_ as Xe}from"./vendor-snapdom-XnBoh1gd.js";import{a2 as Qo}from"./index-CqUuHQBQ.js";import{b as Qi,a as Jo,m as ta}from"./index-DgNxTM_8.js";import{b as Ji,a as ea}from"./relationship-galaxy-viewport-Cwfa51ER.js";import{p as sa,d as ia,n as na,w as tn,z as ra,G as oa,P as aa,b as en}from"./vendor-reka-ui-CzM4kDQ7.js";var H=(i=>(i.Application="application",i.WebGLPipes="webgl-pipes",i.WebGLPipesAdaptor="webgl-pipes-adaptor",i.WebGLSystem="webgl-system",i.WebGPUPipes="webgpu-pipes",i.WebGPUPipesAdaptor="webgpu-pipes-adaptor",i.WebGPUSystem="webgpu-system",i.CanvasSystem="canvas-system",i.CanvasPipesAdaptor="canvas-pipes-adaptor",i.CanvasPipes="canvas-pipes",i.Asset="asset",i.LoadParser="load-parser",i.ResolveParser="resolve-parser",i.CacheParser="cache-parser",i.DetectionParser="detection-parser",i.MaskEffect="mask-effect",i.BlendMode="blend-mode",i.TextureSource="texture-source",i.TextureUploaderWebGL="texture-uploader-webgl",i.TextureUploaderWebGPU="texture-uploader-webgpu",i.Environment="environment",i.ShapeBuilder="shape-builder",i.Batcher="batcher",i))(H||{});const fi=i=>{if(typeof i=="function"||typeof i=="object"&&i.extension){if(!i.extension)throw new Error("Extension class must have an extension object");i={...typeof i.extension!="object"?{type:i.extension}:i.extension,ref:i}}if(typeof i=="object")i={...i};else throw new Error("Invalid extension type");return typeof i.type=="string"&&(i.type=[i.type]),i},cs=(i,t)=>fi(i).priority??t,ht={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...i){return i.map(fi).forEach(t=>{t.type.forEach(e=>this._removeHandlers[e]?.(t))}),this},add(...i){return i.map(fi).forEach(t=>{t.type.forEach(e=>{const s=this._addHandlers,n=this._queue;s[e]?s[e]?.(t):(n[e]=n[e]||[],n[e]?.push(t))})}),this},handle(i,t,e){const s=this._addHandlers,n=this._removeHandlers;if(s[i]||n[i])throw new Error(`Extension type ${i} already has a handler`);s[i]=t,n[i]=e;const r=this._queue;return r[i]&&(r[i]?.forEach(o=>t(o)),delete r[i]),this},handleByMap(i,t){return this.handle(i,e=>{e.name&&(t[e.name]=e.ref)},e=>{e.name&&delete t[e.name]})},handleByNamedList(i,t,e=-1){return this.handle(i,s=>{t.findIndex(r=>r.name===s.name)>=0||(t.push({name:s.name,value:s.ref}),t.sort((r,o)=>cs(o.value,e)-cs(r.value,e)))},s=>{const n=t.findIndex(r=>r.name===s.name);n!==-1&&t.splice(n,1)})},handleByList(i,t,e=-1){return this.handle(i,s=>{t.includes(s.ref)||(t.push(s.ref),t.sort((n,r)=>cs(r,e)-cs(n,e)))},s=>{const n=t.indexOf(s.ref);n!==-1&&t.splice(n,1)})},mixin(i,...t){for(const e of t)Object.defineProperties(i.prototype,Object.getOwnPropertyDescriptors(e))}},ha={extension:{type:H.Environment,name:"browser",priority:-1},test:()=>!0,load:async()=>{await Xe(()=>import("./browserAll-CAZCK6dd.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]))}},la={extension:{type:H.Environment,name:"webworker",priority:0},test:()=>typeof self<"u"&&self.WorkerGlobalScope!==void 0,load:async()=>{await Xe(()=>import("./webworkerAll-Bhv-hBqR.js"),__vite__mapDeps([1,2,3,4,5,6,7,8,9,10,11]))}};class mt{constructor(t,e,s){this._x=e||0,this._y=s||0,this._observer=t}clone(t){return new mt(t??this._observer,this._x,this._y)}set(t=0,e=t){return(this._x!==t||this._y!==e)&&(this._x=t,this._y=e,this._observer._onUpdate(this)),this}copyFrom(t){return(this._x!==t.x||this._y!==t.y)&&(this._x=t.x,this._y=t.y,this._observer._onUpdate(this)),this}copyTo(t){return t.set(this._x,this._y),t}equals(t){return t.x===this._x&&t.y===this._y}toString(){return`[pixi.js/math:ObservablePoint x=${this._x} y=${this._y} scope=${this._observer}]`}get x(){return this._x}set x(t){this._x!==t&&(this._x=t,this._observer._onUpdate(this))}get y(){return this._y}set y(t){this._y!==t&&(this._y=t,this._observer._onUpdate(this))}}var zs={exports:{}},sn;function ca(){return sn||(sn=1,(function(i){var t=Object.prototype.hasOwnProperty,e="~";function s(){}Object.create&&(s.prototype=Object.create(null),new s().__proto__||(e=!1));function n(h,l,c){this.fn=h,this.context=l,this.once=c||!1}function r(h,l,c,u,f){if(typeof c!="function")throw new TypeError("The listener must be a function");var d=new n(c,u||h,f),p=e?e+l:l;return h._events[p]?h._events[p].fn?h._events[p]=[h._events[p],d]:h._events[p].push(d):(h._events[p]=d,h._eventsCount++),h}function o(h,l){--h._eventsCount===0?h._events=new s:delete h._events[l]}function a(){this._events=new s,this._eventsCount=0}a.prototype.eventNames=function(){var l=[],c,u;if(this._eventsCount===0)return l;for(u in c=this._events)t.call(c,u)&&l.push(e?u.slice(1):u);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(c)):l},a.prototype.listeners=function(l){var c=e?e+l:l,u=this._events[c];if(!u)return[];if(u.fn)return[u.fn];for(var f=0,d=u.length,p=new Array(d);f<d;f++)p[f]=u[f].fn;return p},a.prototype.listenerCount=function(l){var c=e?e+l:l,u=this._events[c];return u?u.fn?1:u.length:0},a.prototype.emit=function(l,c,u,f,d,p){var x=e?e+l:l;if(!this._events[x])return!1;var g=this._events[x],m=arguments.length,_,y;if(g.fn){switch(g.once&&this.removeListener(l,g.fn,void 0,!0),m){case 1:return g.fn.call(g.context),!0;case 2:return g.fn.call(g.context,c),!0;case 3:return g.fn.call(g.context,c,u),!0;case 4:return g.fn.call(g.context,c,u,f),!0;case 5:return g.fn.call(g.context,c,u,f,d),!0;case 6:return g.fn.call(g.context,c,u,f,d,p),!0}for(y=1,_=new Array(m-1);y<m;y++)_[y-1]=arguments[y];g.fn.apply(g.context,_)}else{var b=g.length,w;for(y=0;y<b;y++)switch(g[y].once&&this.removeListener(l,g[y].fn,void 0,!0),m){case 1:g[y].fn.call(g[y].context);break;case 2:g[y].fn.call(g[y].context,c);break;case 3:g[y].fn.call(g[y].context,c,u);break;case 4:g[y].fn.call(g[y].context,c,u,f);break;default:if(!_)for(w=1,_=new Array(m-1);w<m;w++)_[w-1]=arguments[w];g[y].fn.apply(g[y].context,_)}}return!0},a.prototype.on=function(l,c,u){return r(this,l,c,u,!1)},a.prototype.once=function(l,c,u){return r(this,l,c,u,!0)},a.prototype.removeListener=function(l,c,u,f){var d=e?e+l:l;if(!this._events[d])return this;if(!c)return o(this,d),this;var p=this._events[d];if(p.fn)p.fn===c&&(!f||p.once)&&(!u||p.context===u)&&o(this,d);else{for(var x=0,g=[],m=p.length;x<m;x++)(p[x].fn!==c||f&&!p[x].once||u&&p[x].context!==u)&&g.push(p[x]);g.length?this._events[d]=g.length===1?g[0]:g:o(this,d)}return this},a.prototype.removeAllListeners=function(l){var c;return l?(c=e?e+l:l,this._events[c]&&o(this,c)):(this._events=new s,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=e,a.EventEmitter=a,i.exports=a})(zs)),zs.exports}var ua=ca();const Yt=Qo(ua),da=Math.PI*2,fa=180/Math.PI,pa=Math.PI/180;class X{constructor(t=0,e=0){this.x=0,this.y=0,this.x=t,this.y=e}clone(){return new X(this.x,this.y)}copyFrom(t){return this.set(t.x,t.y),this}copyTo(t){return t.set(this.x,this.y),t}equals(t){return t.x===this.x&&t.y===this.y}set(t=0,e=t){return this.x=t,this.y=e,this}toString(){return`[pixi.js/math:Point x=${this.x} y=${this.y}]`}static get shared(){return Hs.x=0,Hs.y=0,Hs}}const Hs=new X;class N{constructor(t=1,e=0,s=0,n=1,r=0,o=0){this.array=null,this.a=t,this.b=e,this.c=s,this.d=n,this.tx=r,this.ty=o}fromArray(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]}set(t,e,s,n,r,o){return this.a=t,this.b=e,this.c=s,this.d=n,this.tx=r,this.ty=o,this}toArray(t,e){this.array||(this.array=new Float32Array(9));const s=e||this.array;return t?(s[0]=this.a,s[1]=this.b,s[2]=0,s[3]=this.c,s[4]=this.d,s[5]=0,s[6]=this.tx,s[7]=this.ty,s[8]=1):(s[0]=this.a,s[1]=this.c,s[2]=this.tx,s[3]=this.b,s[4]=this.d,s[5]=this.ty,s[6]=0,s[7]=0,s[8]=1),s}apply(t,e){e=e||new X;const s=t.x,n=t.y;return e.x=this.a*s+this.c*n+this.tx,e.y=this.b*s+this.d*n+this.ty,e}applyInverse(t,e){e=e||new X;const s=this.a,n=this.b,r=this.c,o=this.d,a=this.tx,h=this.ty,l=1/(s*o+r*-n),c=t.x,u=t.y;return e.x=o*l*c+-r*l*u+(h*r-a*o)*l,e.y=s*l*u+-n*l*c+(-h*s+a*n)*l,e}translate(t,e){return this.tx+=t,this.ty+=e,this}scale(t,e){return this.a*=t,this.d*=e,this.c*=t,this.b*=e,this.tx*=t,this.ty*=e,this}rotate(t){const e=Math.cos(t),s=Math.sin(t),n=this.a,r=this.c,o=this.tx;return this.a=n*e-this.b*s,this.b=n*s+this.b*e,this.c=r*e-this.d*s,this.d=r*s+this.d*e,this.tx=o*e-this.ty*s,this.ty=o*s+this.ty*e,this}append(t){const e=this.a,s=this.b,n=this.c,r=this.d;return this.a=t.a*e+t.b*n,this.b=t.a*s+t.b*r,this.c=t.c*e+t.d*n,this.d=t.c*s+t.d*r,this.tx=t.tx*e+t.ty*n+this.tx,this.ty=t.tx*s+t.ty*r+this.ty,this}appendFrom(t,e){const s=t.a,n=t.b,r=t.c,o=t.d,a=t.tx,h=t.ty,l=e.a,c=e.b,u=e.c,f=e.d;return this.a=s*l+n*u,this.b=s*c+n*f,this.c=r*l+o*u,this.d=r*c+o*f,this.tx=a*l+h*u+e.tx,this.ty=a*c+h*f+e.ty,this}setTransform(t,e,s,n,r,o,a,h,l){return this.a=Math.cos(a+l)*r,this.b=Math.sin(a+l)*r,this.c=-Math.sin(a-h)*o,this.d=Math.cos(a-h)*o,this.tx=t-(s*this.a+n*this.c),this.ty=e-(s*this.b+n*this.d),this}prepend(t){const e=this.tx;if(t.a!==1||t.b!==0||t.c!==0||t.d!==1){const s=this.a,n=this.c;this.a=s*t.a+this.b*t.c,this.b=s*t.b+this.b*t.d,this.c=n*t.a+this.d*t.c,this.d=n*t.b+this.d*t.d}return this.tx=e*t.a+this.ty*t.c+t.tx,this.ty=e*t.b+this.ty*t.d+t.ty,this}decompose(t){const e=this.a,s=this.b,n=this.c,r=this.d,o=t.pivot,a=-Math.atan2(-n,r),h=Math.atan2(s,e),l=Math.abs(a+h);return l<1e-5||Math.abs(da-l)<1e-5?(t.rotation=h,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=a,t.skew.y=h),t.scale.x=Math.sqrt(e*e+s*s),t.scale.y=Math.sqrt(n*n+r*r),t.position.x=this.tx+(o.x*e+o.y*n),t.position.y=this.ty+(o.x*s+o.y*r),t}invert(){const t=this.a,e=this.b,s=this.c,n=this.d,r=this.tx,o=t*n-e*s;return this.a=n/o,this.b=-e/o,this.c=-s/o,this.d=t/o,this.tx=(s*this.ty-n*r)/o,this.ty=-(t*this.ty-e*r)/o,this}isIdentity(){return this.a===1&&this.b===0&&this.c===0&&this.d===1&&this.tx===0&&this.ty===0}identity(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this}clone(){const t=new N;return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t}copyTo(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t}copyFrom(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this}equals(t){return t.a===this.a&&t.b===this.b&&t.c===this.c&&t.d===this.d&&t.tx===this.tx&&t.ty===this.ty}toString(){return`[pixi.js:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`}static get IDENTITY(){return ma.identity()}static get shared(){return ga.identity()}}const ga=new N,ma=new N,le=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],ce=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],ue=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],de=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],pi=[],xr=[],us=Math.sign;function xa(){for(let i=0;i<16;i++){const t=[];pi.push(t);for(let e=0;e<16;e++){const s=us(le[i]*le[e]+ue[i]*ce[e]),n=us(ce[i]*le[e]+de[i]*ce[e]),r=us(le[i]*ue[e]+ue[i]*de[e]),o=us(ce[i]*ue[e]+de[i]*de[e]);for(let a=0;a<16;a++)if(le[a]===s&&ce[a]===n&&ue[a]===r&&de[a]===o){t.push(a);break}}}for(let i=0;i<16;i++){const t=new N;t.set(le[i],ce[i],ue[i],de[i],0,0),xr.push(t)}}xa();const Y={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:i=>le[i],uY:i=>ce[i],vX:i=>ue[i],vY:i=>de[i],inv:i=>i&8?i&15:-i&7,add:(i,t)=>pi[i][t],sub:(i,t)=>pi[i][Y.inv(t)],rotate180:i=>i^4,isVertical:i=>(i&3)===2,byDirection:(i,t)=>Math.abs(i)*2<=Math.abs(t)?t>=0?Y.S:Y.N:Math.abs(t)*2<=Math.abs(i)?i>0?Y.E:Y.W:t>0?i>0?Y.SE:Y.SW:i>0?Y.NE:Y.NW,matrixAppendRotationInv:(i,t,e=0,s=0,n=0,r=0)=>{const o=xr[Y.inv(t)],a=o.a,h=o.b,l=o.c,c=o.d,u=e-Math.min(0,a*n,l*r,a*n+l*r),f=s-Math.min(0,h*n,c*r,h*n+c*r),d=i.a,p=i.b,x=i.c,g=i.d;i.a=a*d+h*x,i.b=a*p+h*g,i.c=l*d+c*x,i.d=l*p+c*g,i.tx=u*d+f*x+i.tx,i.ty=u*p+f*g+i.ty},transformRectCoords:(i,t,e,s)=>{const{x:n,y:r,width:o,height:a}=i,{x:h,y:l,width:c,height:u}=t;return e===Y.E?(s.set(n+h,r+l,o,a),s):e===Y.S?s.set(c-r-a+h,n+l,a,o):e===Y.W?s.set(c-n-o+h,u-r-a+l,o,a):e===Y.N?s.set(r+h,u-n-o+l,a,o):s.set(n+h,r+l,o,a)}},ds=[new X,new X,new X,new X];class Q{constructor(t=0,e=0,s=0,n=0){this.type="rectangle",this.x=Number(t),this.y=Number(e),this.width=Number(s),this.height=Number(n)}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}isEmpty(){return this.left===this.right||this.top===this.bottom}static get EMPTY(){return new Q(0,0,0,0)}clone(){return new Q(this.x,this.y,this.width,this.height)}copyFromBounds(t){return this.x=t.minX,this.y=t.minY,this.width=t.maxX-t.minX,this.height=t.maxY-t.minY,this}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.copyFrom(this),t}contains(t,e){return this.width<=0||this.height<=0?!1:t>=this.x&&t<this.x+this.width&&e>=this.y&&e<this.y+this.height}strokeContains(t,e,s,n=.5){const{width:r,height:o}=this;if(r<=0||o<=0)return!1;const a=this.x,h=this.y,l=s*(1-n),c=s-l,u=a-l,f=a+r+l,d=h-l,p=h+o+l,x=a+c,g=a+r-c,m=h+c,_=h+o-c;return t>=u&&t<=f&&e>=d&&e<=p&&!(t>x&&t<g&&e>m&&e<_)}intersects(t,e){if(!e){const I=this.x<t.x?t.x:this.x;if((this.right>t.right?t.right:this.right)<=I)return!1;const M=this.y<t.y?t.y:this.y;return(this.bottom>t.bottom?t.bottom:this.bottom)>M}const s=this.left,n=this.right,r=this.top,o=this.bottom;if(n<=s||o<=r)return!1;const a=ds[0].set(t.left,t.top),h=ds[1].set(t.left,t.bottom),l=ds[2].set(t.right,t.top),c=ds[3].set(t.right,t.bottom);if(l.x<=a.x||h.y<=a.y)return!1;const u=Math.sign(e.a*e.d-e.b*e.c);if(u===0||(e.apply(a,a),e.apply(h,h),e.apply(l,l),e.apply(c,c),Math.max(a.x,h.x,l.x,c.x)<=s||Math.min(a.x,h.x,l.x,c.x)>=n||Math.max(a.y,h.y,l.y,c.y)<=r||Math.min(a.y,h.y,l.y,c.y)>=o))return!1;const f=u*(h.y-a.y),d=u*(a.x-h.x),p=f*s+d*r,x=f*n+d*r,g=f*s+d*o,m=f*n+d*o;if(Math.max(p,x,g,m)<=f*a.x+d*a.y||Math.min(p,x,g,m)>=f*c.x+d*c.y)return!1;const _=u*(a.y-l.y),y=u*(l.x-a.x),b=_*s+y*r,w=_*n+y*r,v=_*s+y*o,S=_*n+y*o;return!(Math.max(b,w,v,S)<=_*a.x+y*a.y||Math.min(b,w,v,S)>=_*c.x+y*c.y)}pad(t=0,e=t){return this.x-=t,this.y-=e,this.width+=t*2,this.height+=e*2,this}fit(t){const e=Math.max(this.x,t.x),s=Math.min(this.x+this.width,t.x+t.width),n=Math.max(this.y,t.y),r=Math.min(this.y+this.height,t.y+t.height);return this.x=e,this.width=Math.max(s-e,0),this.y=n,this.height=Math.max(r-n,0),this}ceil(t=1,e=.001){const s=Math.ceil((this.x+this.width-e)*t)/t,n=Math.ceil((this.y+this.height-e)*t)/t;return this.x=Math.floor((this.x+e)*t)/t,this.y=Math.floor((this.y+e)*t)/t,this.width=s-this.x,this.height=n-this.y,this}scale(t,e=t){return this.x*=t,this.y*=e,this.width*=t,this.height*=e,this}enlarge(t){const e=Math.min(this.x,t.x),s=Math.max(this.x+this.width,t.x+t.width),n=Math.min(this.y,t.y),r=Math.max(this.y+this.height,t.y+t.height);return this.x=e,this.width=s-e,this.y=n,this.height=r-n,this}getBounds(t){return t||(t=new Q),t.copyFrom(this),t}containsRect(t){if(this.width<=0||this.height<=0)return!1;const e=t.x,s=t.y,n=t.x+t.width,r=t.y+t.height;return e>=this.x&&e<this.x+this.width&&s>=this.y&&s<this.y+this.height&&n>=this.x&&n<this.x+this.width&&r>=this.y&&r<this.y+this.height}set(t,e,s,n){return this.x=t,this.y=e,this.width=s,this.height=n,this}toString(){return`[pixi.js/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}}const Os={default:-1};function at(i="default"){return Os[i]===void 0&&(Os[i]=-1),++Os[i]}const nn=new Set,ot="8.0.0",ya="8.3.4",Me={quiet:!1,noColor:!1},$=((i,t,e=3)=>{if(Me.quiet||nn.has(t))return;let s=new Error().stack;const n=`${t}
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/browserAll-Cn_CfkXl.js","assets/webworkerAll-BKGP--A4.js","assets/Filter-CHXKzS2l.js","assets/vendor-snapdom-XnBoh1gd.js","assets/index-YADL4XIp.js","assets/vendor-reka-ui-Cta6JPvN.js","assets/vendor-nuxt-ui-CS1uxE9C.js","assets/index-_6lck7Bv.css","assets/index-CAWO10k1.js","assets/LoadingState.vue_vue_type_script_setup_true_lang-DACMroOe.js","assets/people-page-header-BdKM1qhX.js","assets/relationship-galaxy-viewport-Cwfa51ER.js","assets/WebGPURenderer-BF6TF-is.js","assets/BufferResource-BPGkshPa.js","assets/RenderTargetSystem-BE56mKRG.js","assets/WebGLRenderer-Dm18dxOf.js","assets/CanvasRenderer-DTKkZhq4.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as Xe}from"./vendor-snapdom-XnBoh1gd.js";import{a4 as Qo}from"./index-YADL4XIp.js";import{b as Qi,a as Jo,m as ta}from"./index-CAWO10k1.js";import{b as Ji,a as ea}from"./relationship-galaxy-viewport-Cwfa51ER.js";import{p as sa,d as ia,n as na,w as tn,z as ra,G as oa,P as aa,b as en}from"./vendor-reka-ui-Cta6JPvN.js";var H=(i=>(i.Application="application",i.WebGLPipes="webgl-pipes",i.WebGLPipesAdaptor="webgl-pipes-adaptor",i.WebGLSystem="webgl-system",i.WebGPUPipes="webgpu-pipes",i.WebGPUPipesAdaptor="webgpu-pipes-adaptor",i.WebGPUSystem="webgpu-system",i.CanvasSystem="canvas-system",i.CanvasPipesAdaptor="canvas-pipes-adaptor",i.CanvasPipes="canvas-pipes",i.Asset="asset",i.LoadParser="load-parser",i.ResolveParser="resolve-parser",i.CacheParser="cache-parser",i.DetectionParser="detection-parser",i.MaskEffect="mask-effect",i.BlendMode="blend-mode",i.TextureSource="texture-source",i.TextureUploaderWebGL="texture-uploader-webgl",i.TextureUploaderWebGPU="texture-uploader-webgpu",i.Environment="environment",i.ShapeBuilder="shape-builder",i.Batcher="batcher",i))(H||{});const fi=i=>{if(typeof i=="function"||typeof i=="object"&&i.extension){if(!i.extension)throw new Error("Extension class must have an extension object");i={...typeof i.extension!="object"?{type:i.extension}:i.extension,ref:i}}if(typeof i=="object")i={...i};else throw new Error("Invalid extension type");return typeof i.type=="string"&&(i.type=[i.type]),i},cs=(i,t)=>fi(i).priority??t,ht={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...i){return i.map(fi).forEach(t=>{t.type.forEach(e=>this._removeHandlers[e]?.(t))}),this},add(...i){return i.map(fi).forEach(t=>{t.type.forEach(e=>{const s=this._addHandlers,n=this._queue;s[e]?s[e]?.(t):(n[e]=n[e]||[],n[e]?.push(t))})}),this},handle(i,t,e){const s=this._addHandlers,n=this._removeHandlers;if(s[i]||n[i])throw new Error(`Extension type ${i} already has a handler`);s[i]=t,n[i]=e;const r=this._queue;return r[i]&&(r[i]?.forEach(o=>t(o)),delete r[i]),this},handleByMap(i,t){return this.handle(i,e=>{e.name&&(t[e.name]=e.ref)},e=>{e.name&&delete t[e.name]})},handleByNamedList(i,t,e=-1){return this.handle(i,s=>{t.findIndex(r=>r.name===s.name)>=0||(t.push({name:s.name,value:s.ref}),t.sort((r,o)=>cs(o.value,e)-cs(r.value,e)))},s=>{const n=t.findIndex(r=>r.name===s.name);n!==-1&&t.splice(n,1)})},handleByList(i,t,e=-1){return this.handle(i,s=>{t.includes(s.ref)||(t.push(s.ref),t.sort((n,r)=>cs(r,e)-cs(n,e)))},s=>{const n=t.indexOf(s.ref);n!==-1&&t.splice(n,1)})},mixin(i,...t){for(const e of t)Object.defineProperties(i.prototype,Object.getOwnPropertyDescriptors(e))}},ha={extension:{type:H.Environment,name:"browser",priority:-1},test:()=>!0,load:async()=>{await Xe(()=>import("./browserAll-Cn_CfkXl.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]))}},la={extension:{type:H.Environment,name:"webworker",priority:0},test:()=>typeof self<"u"&&self.WorkerGlobalScope!==void 0,load:async()=>{await Xe(()=>import("./webworkerAll-BKGP--A4.js"),__vite__mapDeps([1,2,3,4,5,6,7,8,9,10,11]))}};class mt{constructor(t,e,s){this._x=e||0,this._y=s||0,this._observer=t}clone(t){return new mt(t??this._observer,this._x,this._y)}set(t=0,e=t){return(this._x!==t||this._y!==e)&&(this._x=t,this._y=e,this._observer._onUpdate(this)),this}copyFrom(t){return(this._x!==t.x||this._y!==t.y)&&(this._x=t.x,this._y=t.y,this._observer._onUpdate(this)),this}copyTo(t){return t.set(this._x,this._y),t}equals(t){return t.x===this._x&&t.y===this._y}toString(){return`[pixi.js/math:ObservablePoint x=${this._x} y=${this._y} scope=${this._observer}]`}get x(){return this._x}set x(t){this._x!==t&&(this._x=t,this._observer._onUpdate(this))}get y(){return this._y}set y(t){this._y!==t&&(this._y=t,this._observer._onUpdate(this))}}var zs={exports:{}},sn;function ca(){return sn||(sn=1,(function(i){var t=Object.prototype.hasOwnProperty,e="~";function s(){}Object.create&&(s.prototype=Object.create(null),new s().__proto__||(e=!1));function n(h,l,c){this.fn=h,this.context=l,this.once=c||!1}function r(h,l,c,u,f){if(typeof c!="function")throw new TypeError("The listener must be a function");var d=new n(c,u||h,f),p=e?e+l:l;return h._events[p]?h._events[p].fn?h._events[p]=[h._events[p],d]:h._events[p].push(d):(h._events[p]=d,h._eventsCount++),h}function o(h,l){--h._eventsCount===0?h._events=new s:delete h._events[l]}function a(){this._events=new s,this._eventsCount=0}a.prototype.eventNames=function(){var l=[],c,u;if(this._eventsCount===0)return l;for(u in c=this._events)t.call(c,u)&&l.push(e?u.slice(1):u);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(c)):l},a.prototype.listeners=function(l){var c=e?e+l:l,u=this._events[c];if(!u)return[];if(u.fn)return[u.fn];for(var f=0,d=u.length,p=new Array(d);f<d;f++)p[f]=u[f].fn;return p},a.prototype.listenerCount=function(l){var c=e?e+l:l,u=this._events[c];return u?u.fn?1:u.length:0},a.prototype.emit=function(l,c,u,f,d,p){var x=e?e+l:l;if(!this._events[x])return!1;var g=this._events[x],m=arguments.length,_,y;if(g.fn){switch(g.once&&this.removeListener(l,g.fn,void 0,!0),m){case 1:return g.fn.call(g.context),!0;case 2:return g.fn.call(g.context,c),!0;case 3:return g.fn.call(g.context,c,u),!0;case 4:return g.fn.call(g.context,c,u,f),!0;case 5:return g.fn.call(g.context,c,u,f,d),!0;case 6:return g.fn.call(g.context,c,u,f,d,p),!0}for(y=1,_=new Array(m-1);y<m;y++)_[y-1]=arguments[y];g.fn.apply(g.context,_)}else{var b=g.length,w;for(y=0;y<b;y++)switch(g[y].once&&this.removeListener(l,g[y].fn,void 0,!0),m){case 1:g[y].fn.call(g[y].context);break;case 2:g[y].fn.call(g[y].context,c);break;case 3:g[y].fn.call(g[y].context,c,u);break;case 4:g[y].fn.call(g[y].context,c,u,f);break;default:if(!_)for(w=1,_=new Array(m-1);w<m;w++)_[w-1]=arguments[w];g[y].fn.apply(g[y].context,_)}}return!0},a.prototype.on=function(l,c,u){return r(this,l,c,u,!1)},a.prototype.once=function(l,c,u){return r(this,l,c,u,!0)},a.prototype.removeListener=function(l,c,u,f){var d=e?e+l:l;if(!this._events[d])return this;if(!c)return o(this,d),this;var p=this._events[d];if(p.fn)p.fn===c&&(!f||p.once)&&(!u||p.context===u)&&o(this,d);else{for(var x=0,g=[],m=p.length;x<m;x++)(p[x].fn!==c||f&&!p[x].once||u&&p[x].context!==u)&&g.push(p[x]);g.length?this._events[d]=g.length===1?g[0]:g:o(this,d)}return this},a.prototype.removeAllListeners=function(l){var c;return l?(c=e?e+l:l,this._events[c]&&o(this,c)):(this._events=new s,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=e,a.EventEmitter=a,i.exports=a})(zs)),zs.exports}var ua=ca();const Yt=Qo(ua),da=Math.PI*2,fa=180/Math.PI,pa=Math.PI/180;class X{constructor(t=0,e=0){this.x=0,this.y=0,this.x=t,this.y=e}clone(){return new X(this.x,this.y)}copyFrom(t){return this.set(t.x,t.y),this}copyTo(t){return t.set(this.x,this.y),t}equals(t){return t.x===this.x&&t.y===this.y}set(t=0,e=t){return this.x=t,this.y=e,this}toString(){return`[pixi.js/math:Point x=${this.x} y=${this.y}]`}static get shared(){return Hs.x=0,Hs.y=0,Hs}}const Hs=new X;class N{constructor(t=1,e=0,s=0,n=1,r=0,o=0){this.array=null,this.a=t,this.b=e,this.c=s,this.d=n,this.tx=r,this.ty=o}fromArray(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]}set(t,e,s,n,r,o){return this.a=t,this.b=e,this.c=s,this.d=n,this.tx=r,this.ty=o,this}toArray(t,e){this.array||(this.array=new Float32Array(9));const s=e||this.array;return t?(s[0]=this.a,s[1]=this.b,s[2]=0,s[3]=this.c,s[4]=this.d,s[5]=0,s[6]=this.tx,s[7]=this.ty,s[8]=1):(s[0]=this.a,s[1]=this.c,s[2]=this.tx,s[3]=this.b,s[4]=this.d,s[5]=this.ty,s[6]=0,s[7]=0,s[8]=1),s}apply(t,e){e=e||new X;const s=t.x,n=t.y;return e.x=this.a*s+this.c*n+this.tx,e.y=this.b*s+this.d*n+this.ty,e}applyInverse(t,e){e=e||new X;const s=this.a,n=this.b,r=this.c,o=this.d,a=this.tx,h=this.ty,l=1/(s*o+r*-n),c=t.x,u=t.y;return e.x=o*l*c+-r*l*u+(h*r-a*o)*l,e.y=s*l*u+-n*l*c+(-h*s+a*n)*l,e}translate(t,e){return this.tx+=t,this.ty+=e,this}scale(t,e){return this.a*=t,this.d*=e,this.c*=t,this.b*=e,this.tx*=t,this.ty*=e,this}rotate(t){const e=Math.cos(t),s=Math.sin(t),n=this.a,r=this.c,o=this.tx;return this.a=n*e-this.b*s,this.b=n*s+this.b*e,this.c=r*e-this.d*s,this.d=r*s+this.d*e,this.tx=o*e-this.ty*s,this.ty=o*s+this.ty*e,this}append(t){const e=this.a,s=this.b,n=this.c,r=this.d;return this.a=t.a*e+t.b*n,this.b=t.a*s+t.b*r,this.c=t.c*e+t.d*n,this.d=t.c*s+t.d*r,this.tx=t.tx*e+t.ty*n+this.tx,this.ty=t.tx*s+t.ty*r+this.ty,this}appendFrom(t,e){const s=t.a,n=t.b,r=t.c,o=t.d,a=t.tx,h=t.ty,l=e.a,c=e.b,u=e.c,f=e.d;return this.a=s*l+n*u,this.b=s*c+n*f,this.c=r*l+o*u,this.d=r*c+o*f,this.tx=a*l+h*u+e.tx,this.ty=a*c+h*f+e.ty,this}setTransform(t,e,s,n,r,o,a,h,l){return this.a=Math.cos(a+l)*r,this.b=Math.sin(a+l)*r,this.c=-Math.sin(a-h)*o,this.d=Math.cos(a-h)*o,this.tx=t-(s*this.a+n*this.c),this.ty=e-(s*this.b+n*this.d),this}prepend(t){const e=this.tx;if(t.a!==1||t.b!==0||t.c!==0||t.d!==1){const s=this.a,n=this.c;this.a=s*t.a+this.b*t.c,this.b=s*t.b+this.b*t.d,this.c=n*t.a+this.d*t.c,this.d=n*t.b+this.d*t.d}return this.tx=e*t.a+this.ty*t.c+t.tx,this.ty=e*t.b+this.ty*t.d+t.ty,this}decompose(t){const e=this.a,s=this.b,n=this.c,r=this.d,o=t.pivot,a=-Math.atan2(-n,r),h=Math.atan2(s,e),l=Math.abs(a+h);return l<1e-5||Math.abs(da-l)<1e-5?(t.rotation=h,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=a,t.skew.y=h),t.scale.x=Math.sqrt(e*e+s*s),t.scale.y=Math.sqrt(n*n+r*r),t.position.x=this.tx+(o.x*e+o.y*n),t.position.y=this.ty+(o.x*s+o.y*r),t}invert(){const t=this.a,e=this.b,s=this.c,n=this.d,r=this.tx,o=t*n-e*s;return this.a=n/o,this.b=-e/o,this.c=-s/o,this.d=t/o,this.tx=(s*this.ty-n*r)/o,this.ty=-(t*this.ty-e*r)/o,this}isIdentity(){return this.a===1&&this.b===0&&this.c===0&&this.d===1&&this.tx===0&&this.ty===0}identity(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this}clone(){const t=new N;return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t}copyTo(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t}copyFrom(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this}equals(t){return t.a===this.a&&t.b===this.b&&t.c===this.c&&t.d===this.d&&t.tx===this.tx&&t.ty===this.ty}toString(){return`[pixi.js:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`}static get IDENTITY(){return ma.identity()}static get shared(){return ga.identity()}}const ga=new N,ma=new N,le=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],ce=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],ue=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],de=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],pi=[],xr=[],us=Math.sign;function xa(){for(let i=0;i<16;i++){const t=[];pi.push(t);for(let e=0;e<16;e++){const s=us(le[i]*le[e]+ue[i]*ce[e]),n=us(ce[i]*le[e]+de[i]*ce[e]),r=us(le[i]*ue[e]+ue[i]*de[e]),o=us(ce[i]*ue[e]+de[i]*de[e]);for(let a=0;a<16;a++)if(le[a]===s&&ce[a]===n&&ue[a]===r&&de[a]===o){t.push(a);break}}}for(let i=0;i<16;i++){const t=new N;t.set(le[i],ce[i],ue[i],de[i],0,0),xr.push(t)}}xa();const Y={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:i=>le[i],uY:i=>ce[i],vX:i=>ue[i],vY:i=>de[i],inv:i=>i&8?i&15:-i&7,add:(i,t)=>pi[i][t],sub:(i,t)=>pi[i][Y.inv(t)],rotate180:i=>i^4,isVertical:i=>(i&3)===2,byDirection:(i,t)=>Math.abs(i)*2<=Math.abs(t)?t>=0?Y.S:Y.N:Math.abs(t)*2<=Math.abs(i)?i>0?Y.E:Y.W:t>0?i>0?Y.SE:Y.SW:i>0?Y.NE:Y.NW,matrixAppendRotationInv:(i,t,e=0,s=0,n=0,r=0)=>{const o=xr[Y.inv(t)],a=o.a,h=o.b,l=o.c,c=o.d,u=e-Math.min(0,a*n,l*r,a*n+l*r),f=s-Math.min(0,h*n,c*r,h*n+c*r),d=i.a,p=i.b,x=i.c,g=i.d;i.a=a*d+h*x,i.b=a*p+h*g,i.c=l*d+c*x,i.d=l*p+c*g,i.tx=u*d+f*x+i.tx,i.ty=u*p+f*g+i.ty},transformRectCoords:(i,t,e,s)=>{const{x:n,y:r,width:o,height:a}=i,{x:h,y:l,width:c,height:u}=t;return e===Y.E?(s.set(n+h,r+l,o,a),s):e===Y.S?s.set(c-r-a+h,n+l,a,o):e===Y.W?s.set(c-n-o+h,u-r-a+l,o,a):e===Y.N?s.set(r+h,u-n-o+l,a,o):s.set(n+h,r+l,o,a)}},ds=[new X,new X,new X,new X];class Q{constructor(t=0,e=0,s=0,n=0){this.type="rectangle",this.x=Number(t),this.y=Number(e),this.width=Number(s),this.height=Number(n)}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}isEmpty(){return this.left===this.right||this.top===this.bottom}static get EMPTY(){return new Q(0,0,0,0)}clone(){return new Q(this.x,this.y,this.width,this.height)}copyFromBounds(t){return this.x=t.minX,this.y=t.minY,this.width=t.maxX-t.minX,this.height=t.maxY-t.minY,this}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.copyFrom(this),t}contains(t,e){return this.width<=0||this.height<=0?!1:t>=this.x&&t<this.x+this.width&&e>=this.y&&e<this.y+this.height}strokeContains(t,e,s,n=.5){const{width:r,height:o}=this;if(r<=0||o<=0)return!1;const a=this.x,h=this.y,l=s*(1-n),c=s-l,u=a-l,f=a+r+l,d=h-l,p=h+o+l,x=a+c,g=a+r-c,m=h+c,_=h+o-c;return t>=u&&t<=f&&e>=d&&e<=p&&!(t>x&&t<g&&e>m&&e<_)}intersects(t,e){if(!e){const I=this.x<t.x?t.x:this.x;if((this.right>t.right?t.right:this.right)<=I)return!1;const M=this.y<t.y?t.y:this.y;return(this.bottom>t.bottom?t.bottom:this.bottom)>M}const s=this.left,n=this.right,r=this.top,o=this.bottom;if(n<=s||o<=r)return!1;const a=ds[0].set(t.left,t.top),h=ds[1].set(t.left,t.bottom),l=ds[2].set(t.right,t.top),c=ds[3].set(t.right,t.bottom);if(l.x<=a.x||h.y<=a.y)return!1;const u=Math.sign(e.a*e.d-e.b*e.c);if(u===0||(e.apply(a,a),e.apply(h,h),e.apply(l,l),e.apply(c,c),Math.max(a.x,h.x,l.x,c.x)<=s||Math.min(a.x,h.x,l.x,c.x)>=n||Math.max(a.y,h.y,l.y,c.y)<=r||Math.min(a.y,h.y,l.y,c.y)>=o))return!1;const f=u*(h.y-a.y),d=u*(a.x-h.x),p=f*s+d*r,x=f*n+d*r,g=f*s+d*o,m=f*n+d*o;if(Math.max(p,x,g,m)<=f*a.x+d*a.y||Math.min(p,x,g,m)>=f*c.x+d*c.y)return!1;const _=u*(a.y-l.y),y=u*(l.x-a.x),b=_*s+y*r,w=_*n+y*r,v=_*s+y*o,S=_*n+y*o;return!(Math.max(b,w,v,S)<=_*a.x+y*a.y||Math.min(b,w,v,S)>=_*c.x+y*c.y)}pad(t=0,e=t){return this.x-=t,this.y-=e,this.width+=t*2,this.height+=e*2,this}fit(t){const e=Math.max(this.x,t.x),s=Math.min(this.x+this.width,t.x+t.width),n=Math.max(this.y,t.y),r=Math.min(this.y+this.height,t.y+t.height);return this.x=e,this.width=Math.max(s-e,0),this.y=n,this.height=Math.max(r-n,0),this}ceil(t=1,e=.001){const s=Math.ceil((this.x+this.width-e)*t)/t,n=Math.ceil((this.y+this.height-e)*t)/t;return this.x=Math.floor((this.x+e)*t)/t,this.y=Math.floor((this.y+e)*t)/t,this.width=s-this.x,this.height=n-this.y,this}scale(t,e=t){return this.x*=t,this.y*=e,this.width*=t,this.height*=e,this}enlarge(t){const e=Math.min(this.x,t.x),s=Math.max(this.x+this.width,t.x+t.width),n=Math.min(this.y,t.y),r=Math.max(this.y+this.height,t.y+t.height);return this.x=e,this.width=s-e,this.y=n,this.height=r-n,this}getBounds(t){return t||(t=new Q),t.copyFrom(this),t}containsRect(t){if(this.width<=0||this.height<=0)return!1;const e=t.x,s=t.y,n=t.x+t.width,r=t.y+t.height;return e>=this.x&&e<this.x+this.width&&s>=this.y&&s<this.y+this.height&&n>=this.x&&n<this.x+this.width&&r>=this.y&&r<this.y+this.height}set(t,e,s,n){return this.x=t,this.y=e,this.width=s,this.height=n,this}toString(){return`[pixi.js/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}}const Os={default:-1};function at(i="default"){return Os[i]===void 0&&(Os[i]=-1),++Os[i]}const nn=new Set,ot="8.0.0",ya="8.3.4",Me={quiet:!1,noColor:!1},$=((i,t,e=3)=>{if(Me.quiet||nn.has(t))return;let s=new Error().stack;const n=`${t}
|
|
3
3
|
Deprecated since v${i}`,r=typeof console.groupCollapsed=="function"&&!Me.noColor;typeof s>"u"?console.warn("PixiJS Deprecation Warning: ",n):(s=s.split(`
|
|
4
4
|
`).splice(e).join(`
|
|
5
5
|
`),r?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",n),console.warn(s),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",n),console.warn(s))),nn.add(t)});Object.defineProperties($,{quiet:{get:()=>Me.quiet,set:i=>{Me.quiet=i},enumerable:!0,configurable:!1},noColor:{get:()=>Me.noColor,set:i=>{Me.noColor=i},enumerable:!0,configurable:!1}});const yr=()=>{};function Ae(i){return i+=i===0?1:0,--i,i|=i>>>1,i|=i>>>2,i|=i>>>4,i|=i>>>8,i|=i>>>16,i+1}function rn(i){return!(i&i-1)&&!!i}function _r(i){const t={};for(const e in i)i[e]!==void 0&&(t[e]=i[e]);return t}const on=Object.create(null);function _a(i){const t=on[i];return t===void 0&&(on[i]=at("resource")),t}const br=class wr extends Yt{constructor(t={}){super(),this._resourceType="textureSampler",this._touched=0,this._maxAnisotropy=1,this.destroyed=!1,t={...wr.defaultOptions,...t},this.addressMode=t.addressMode,this.addressModeU=t.addressModeU??this.addressModeU,this.addressModeV=t.addressModeV??this.addressModeV,this.addressModeW=t.addressModeW??this.addressModeW,this.scaleMode=t.scaleMode,this.magFilter=t.magFilter??this.magFilter,this.minFilter=t.minFilter??this.minFilter,this.mipmapFilter=t.mipmapFilter??this.mipmapFilter,this.lodMinClamp=t.lodMinClamp,this.lodMaxClamp=t.lodMaxClamp,this.compare=t.compare,this.maxAnisotropy=t.maxAnisotropy??1}set addressMode(t){this.addressModeU=t,this.addressModeV=t,this.addressModeW=t}get addressMode(){return this.addressModeU}set wrapMode(t){$(ot,"TextureStyle.wrapMode is now TextureStyle.addressMode"),this.addressMode=t}get wrapMode(){return this.addressMode}set scaleMode(t){this.magFilter=t,this.minFilter=t,this.mipmapFilter=t}get scaleMode(){return this.magFilter}set maxAnisotropy(t){this._maxAnisotropy=Math.min(t,16),this._maxAnisotropy>1&&(this.scaleMode="linear")}get maxAnisotropy(){return this._maxAnisotropy}get _resourceId(){return this._sharedResourceId||this._generateResourceId()}update(){this._sharedResourceId=null,this.emit("change",this)}_generateResourceId(){const t=`${this.addressModeU}-${this.addressModeV}-${this.addressModeW}-${this.magFilter}-${this.minFilter}-${this.mipmapFilter}-${this.lodMinClamp}-${this.lodMaxClamp}-${this.compare}-${this._maxAnisotropy}`;return this._sharedResourceId=_a(t),this._resourceId}destroy(){this.destroyed=!0,this.emit("destroy",this),this.emit("change",this),this.removeAllListeners()}};br.defaultOptions={addressMode:"clamp-to-edge",scaleMode:"linear"};let Pe=br;const vr=class Sr extends Yt{constructor(t={}){super(),this.options=t,this._gpuData=Object.create(null),this._gcLastUsed=-1,this.uid=at("textureSource"),this._resourceType="textureSource",this._resourceId=at("resource"),this.uploadMethodId="unknown",this._resolution=1,this.pixelWidth=1,this.pixelHeight=1,this.width=1,this.height=1,this.sampleCount=1,this.mipLevelCount=1,this.autoGenerateMipmaps=!1,this.format="rgba8unorm",this.dimension="2d",this.viewDimension="2d",this.arrayLayerCount=1,this.antialias=!1,this.transient=!1,this._touched=0,this._batchTick=-1,this._textureBindLocation=-1,t={...Sr.defaultOptions,...t},this.label=t.label??"",this.resource=t.resource,this.autoGarbageCollect=t.autoGarbageCollect,this._resolution=t.resolution,t.width?this.pixelWidth=t.width*this._resolution:this.pixelWidth=this.resource?this.resourceWidth??1:1,t.height?this.pixelHeight=t.height*this._resolution:this.pixelHeight=this.resource?this.resourceHeight??1:1,this.width=this.pixelWidth/this._resolution,this.height=this.pixelHeight/this._resolution,this.format=t.format,this.dimension=t.dimensions,this.viewDimension=t.viewDimension??t.dimensions,this.arrayLayerCount=t.arrayLayerCount,this.mipLevelCount=t.mipLevelCount,this.autoGenerateMipmaps=t.autoGenerateMipmaps,this.sampleCount=t.sampleCount,this.antialias=t.antialias,this.transient=t.transient??!1,this.alphaMode=t.alphaMode,this.style=new Pe(_r(t)),this.destroyed=!1,this._refreshPOT()}get source(){return this}get style(){return this._style}set style(t){this.style!==t&&(this._style?.off("change",this._onStyleChange,this),this._style=t,this._style?.on("change",this._onStyleChange,this),this._onStyleChange())}set maxAnisotropy(t){this._style.maxAnisotropy=t}get maxAnisotropy(){return this._style.maxAnisotropy}get addressMode(){return this._style.addressMode}set addressMode(t){this._style.addressMode=t}get repeatMode(){return this._style.addressMode}set repeatMode(t){this._style.addressMode=t}get magFilter(){return this._style.magFilter}set magFilter(t){this._style.magFilter=t}get minFilter(){return this._style.minFilter}set minFilter(t){this._style.minFilter=t}get mipmapFilter(){return this._style.mipmapFilter}set mipmapFilter(t){this._style.mipmapFilter=t}get lodMinClamp(){return this._style.lodMinClamp}set lodMinClamp(t){this._style.lodMinClamp=t}get lodMaxClamp(){return this._style.lodMaxClamp}set lodMaxClamp(t){this._style.lodMaxClamp=t}_onStyleChange(){this.emit("styleChange",this)}update(){if(this.resource){const t=this._resolution;if(this.resize(this.resourceWidth/t,this.resourceHeight/t))return}this.emit("update",this)}destroy(){this.destroyed=!0,this.unload(),this.emit("destroy",this),this._style&&(this._style.destroy(),this._style=null),this.uploadMethodId=null,this.resource=null,this.removeAllListeners()}unload(){this._resourceId=at("resource"),this.emit("change",this),this.emit("unload",this);for(const t in this._gpuData)this._gpuData[t]?.destroy?.();this._gpuData=Object.create(null)}get resourceWidth(){const{resource:t}=this;return t.naturalWidth||t.videoWidth||t.displayWidth||t.width}get resourceHeight(){const{resource:t}=this;return t.naturalHeight||t.videoHeight||t.displayHeight||t.height}get resolution(){return this._resolution}set resolution(t){this._resolution!==t&&(this._resolution=t,this.width=this.pixelWidth/t,this.height=this.pixelHeight/t)}resize(t,e,s){s||(s=this._resolution),t||(t=this.width),e||(e=this.height);const n=Math.round(t*s),r=Math.round(e*s);return this.width=n/s,this.height=r/s,this._resolution=s,this.pixelWidth===n&&this.pixelHeight===r?!1:(this._refreshPOT(),this.pixelWidth=n,this.pixelHeight=r,this.emit("resize",this),this._resourceId=at("resource"),this.emit("change",this),!0)}updateMipmaps(){this.autoGenerateMipmaps&&this.mipLevelCount>1&&this.emit("updateMipmaps",this)}set wrapMode(t){this._style.wrapMode=t}get wrapMode(){return this._style.wrapMode}set scaleMode(t){this._style.scaleMode=t}get scaleMode(){return this._style.scaleMode}_refreshPOT(){this.isPowerOfTwo=rn(this.pixelWidth)&&rn(this.pixelHeight)}static test(t){throw new Error("Unimplemented")}};vr.defaultOptions={resolution:1,format:"bgra8unorm",alphaMode:"premultiply-alpha-on-upload",dimensions:"2d",viewDimension:"2d",arrayLayerCount:1,mipLevelCount:1,autoGenerateMipmaps:!1,sampleCount:1,antialias:!1,autoGarbageCollect:!1};let Rt=vr;class Bi extends Rt{constructor(t){const e=t.resource||new Float32Array(t.width*t.height*4);let s=t.format;s||(e instanceof Float32Array?s="rgba32float":e instanceof Int32Array||e instanceof Uint32Array?s="rgba32uint":e instanceof Int16Array||e instanceof Uint16Array?s="rgba16uint":(e instanceof Int8Array,s="bgra8unorm")),super({...t,resource:e,format:s}),this.uploadMethodId="buffer"}static test(t){return t instanceof Int8Array||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array}}Bi.extension=H.TextureSource;const an=new N;class ba{constructor(t,e){this.mapCoord=new N,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._updateID=0,this.clampOffset=0,typeof e>"u"?this.clampMargin=t.width<10?0:.5:this.clampMargin=e,this.isSimple=!1,this.texture=t}get texture(){return this._texture}set texture(t){this._texture!==t&&(this._texture?.removeListener("update",this.update,this),this._texture=t,this._texture.addListener("update",this.update,this)),this.update()}multiplyUvs(t,e){e===void 0&&(e=t);const s=this.mapCoord;for(let n=0;n<t.length;n+=2){const r=t[n],o=t[n+1];e[n]=r*s.a+o*s.c+s.tx,e[n+1]=r*s.b+o*s.d+s.ty}return e}update(){const t=this._texture;this._updateID++;const e=t.uvs;this.mapCoord.set(e.x1-e.x0,e.y1-e.y0,e.x3-e.x0,e.y3-e.y0,e.x0,e.y0);const s=t.orig,n=t.trim;n&&(an.set(s.width/n.width,0,0,s.height/n.height,-n.x/n.width,-n.y/n.height),this.mapCoord.append(an));const r=t.source,o=this.uClampFrame,a=this.clampMargin/r._resolution,h=this.clampOffset/r._resolution;return o[0]=(t.frame.x+a+h)/r.width,o[1]=(t.frame.y+a+h)/r.height,o[2]=(t.frame.x+t.frame.width-a+h)/r.width,o[3]=(t.frame.y+t.frame.height-a+h)/r.height,this.uClampOffset[0]=this.clampOffset/r.pixelWidth,this.uClampOffset[1]=this.clampOffset/r.pixelHeight,this.isSimple=t.frame.width===r.width&&t.frame.height===r.height&&t.rotate===0,!0}}class K extends Yt{constructor({source:t,label:e,frame:s,orig:n,trim:r,defaultAnchor:o,defaultBorders:a,rotate:h,dynamic:l}={}){if(super(),this.uid=at("texture"),this.uvs={x0:0,y0:0,x1:0,y1:0,x2:0,y2:0,x3:0,y3:0},this.frame=new Q,this.noFrame=!1,this.dynamic=!1,this.isTexture=!0,this.label=e,this.source=t?.source??new Rt,this.noFrame=!s,s)this.frame.copyFrom(s);else{const{width:c,height:u}=this._source;this.frame.width=c,this.frame.height=u}this.orig=n||this.frame,this.trim=r,this.rotate=h??0,this.defaultAnchor=o,this.defaultBorders=a,this.destroyed=!1,this.dynamic=l||!1,this.updateUvs()}set source(t){this._source&&this._source.off("resize",this.update,this),this._source=t,t.on("resize",this.update,this),this.emit("update",this)}get source(){return this._source}get textureMatrix(){return this._textureMatrix||(this._textureMatrix=new ba(this)),this._textureMatrix}get width(){return this.orig.width}get height(){return this.orig.height}updateUvs(){const{uvs:t,frame:e}=this,{width:s,height:n}=this._source,r=e.x/s,o=e.y/n,a=e.width/s,h=e.height/n;let l=this.rotate;if(l){const c=a/2,u=h/2,f=r+c,d=o+u;l=Y.add(l,Y.NW),t.x0=f+c*Y.uX(l),t.y0=d+u*Y.uY(l),l=Y.add(l,2),t.x1=f+c*Y.uX(l),t.y1=d+u*Y.uY(l),l=Y.add(l,2),t.x2=f+c*Y.uX(l),t.y2=d+u*Y.uY(l),l=Y.add(l,2),t.x3=f+c*Y.uX(l),t.y3=d+u*Y.uY(l)}else t.x0=r,t.y0=o,t.x1=r+a,t.y1=o,t.x2=r+a,t.y2=o+h,t.x3=r,t.y3=o+h}destroy(t=!1){this._source&&(this._source.off("resize",this.update,this),t&&(this._source.destroy(),this._source=null)),this._textureMatrix=null,this.destroyed=!0,this.emit("destroy",this),this.removeAllListeners()}update(){this.noFrame&&(this.frame.width=this._source.width,this.frame.height=this._source.height),this.updateUvs(),this.emit("update",this)}get baseTexture(){return $(ot,"Texture.baseTexture is now Texture.source"),this._source}}K.EMPTY=new K({label:"EMPTY",source:new Rt({label:"EMPTY"})});K.EMPTY.destroy=yr;K.WHITE=new K({source:new Bi({resource:new Uint8Array([255,255,255,255]),width:1,height:1,alphaMode:"premultiply-alpha-on-upload",label:"WHITE"}),label:"WHITE"});K.WHITE.destroy=yr;function Cr(i,t,e){const{width:s,height:n}=e.orig,r=e.trim;if(r){const o=r.width,a=r.height;i.minX=r.x-t._x*s,i.maxX=i.minX+o,i.minY=r.y-t._y*n,i.maxY=i.minY+a}else i.minX=-t._x*s,i.maxX=i.minX+s,i.minY=-t._y*n,i.maxY=i.minY+n}const hn=new N;class It{constructor(t=1/0,e=1/0,s=-1/0,n=-1/0){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=hn,this.minX=t,this.minY=e,this.maxX=s,this.maxY=n}isEmpty(){return this.minX>this.maxX||this.minY>this.maxY}get rectangle(){this._rectangle||(this._rectangle=new Q);const t=this._rectangle;return this.minX>this.maxX||this.minY>this.maxY?(t.x=0,t.y=0,t.width=0,t.height=0):t.copyFromBounds(this),t}clear(){return this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=hn,this}set(t,e,s,n){this.minX=t,this.minY=e,this.maxX=s,this.maxY=n}addFrame(t,e,s,n,r){r||(r=this.matrix);const o=r.a,a=r.b,h=r.c,l=r.d,c=r.tx,u=r.ty;let f=this.minX,d=this.minY,p=this.maxX,x=this.maxY,g=o*t+h*e+c,m=a*t+l*e+u;g<f&&(f=g),m<d&&(d=m),g>p&&(p=g),m>x&&(x=m),g=o*s+h*e+c,m=a*s+l*e+u,g<f&&(f=g),m<d&&(d=m),g>p&&(p=g),m>x&&(x=m),g=o*t+h*n+c,m=a*t+l*n+u,g<f&&(f=g),m<d&&(d=m),g>p&&(p=g),m>x&&(x=m),g=o*s+h*n+c,m=a*s+l*n+u,g<f&&(f=g),m<d&&(d=m),g>p&&(p=g),m>x&&(x=m),this.minX=f,this.minY=d,this.maxX=p,this.maxY=x}addRect(t,e){this.addFrame(t.x,t.y,t.x+t.width,t.y+t.height,e)}addBounds(t,e){this.addFrame(t.minX,t.minY,t.maxX,t.maxY,e)}addBoundsMask(t){this.minX=this.minX>t.minX?this.minX:t.minX,this.minY=this.minY>t.minY?this.minY:t.minY,this.maxX=this.maxX<t.maxX?this.maxX:t.maxX,this.maxY=this.maxY<t.maxY?this.maxY:t.maxY}applyMatrix(t){const e=this.minX,s=this.minY,n=this.maxX,r=this.maxY,{a:o,b:a,c:h,d:l,tx:c,ty:u}=t;let f=o*e+h*s+c,d=a*e+l*s+u;this.minX=f,this.minY=d,this.maxX=f,this.maxY=d,f=o*n+h*s+c,d=a*n+l*s+u,this.minX=f<this.minX?f:this.minX,this.minY=d<this.minY?d:this.minY,this.maxX=f>this.maxX?f:this.maxX,this.maxY=d>this.maxY?d:this.maxY,f=o*e+h*r+c,d=a*e+l*r+u,this.minX=f<this.minX?f:this.minX,this.minY=d<this.minY?d:this.minY,this.maxX=f>this.maxX?f:this.maxX,this.maxY=d>this.maxY?d:this.maxY,f=o*n+h*r+c,d=a*n+l*r+u,this.minX=f<this.minX?f:this.minX,this.minY=d<this.minY?d:this.minY,this.maxX=f>this.maxX?f:this.maxX,this.maxY=d>this.maxY?d:this.maxY}fit(t){return this.minX<t.left&&(this.minX=t.left),this.maxX>t.right&&(this.maxX=t.right),this.minY<t.top&&(this.minY=t.top),this.maxY>t.bottom&&(this.maxY=t.bottom),this}fitBounds(t,e,s,n){return this.minX<t&&(this.minX=t),this.maxX>e&&(this.maxX=e),this.minY<s&&(this.minY=s),this.maxY>n&&(this.maxY=n),this}pad(t,e=t){return this.minX-=t,this.maxX+=t,this.minY-=e,this.maxY+=e,this}ceil(){return this.minX=Math.floor(this.minX),this.minY=Math.floor(this.minY),this.maxX=Math.ceil(this.maxX),this.maxY=Math.ceil(this.maxY),this}clone(){return new It(this.minX,this.minY,this.maxX,this.maxY)}scale(t,e=t){return this.minX*=t,this.minY*=e,this.maxX*=t,this.maxY*=e,this}get x(){return this.minX}set x(t){const e=this.maxX-this.minX;this.minX=t,this.maxX=t+e}get y(){return this.minY}set y(t){const e=this.maxY-this.minY;this.minY=t,this.maxY=t+e}get width(){return this.maxX-this.minX}set width(t){this.maxX=this.minX+t}get height(){return this.maxY-this.minY}set height(t){this.maxY=this.minY+t}get left(){return this.minX}get right(){return this.maxX}get top(){return this.minY}get bottom(){return this.maxY}get isPositive(){return this.maxX-this.minX>0&&this.maxY-this.minY>0}get isValid(){return this.minX+this.minY!==1/0}addVertexData(t,e,s,n){let r=this.minX,o=this.minY,a=this.maxX,h=this.maxY;n||(n=this.matrix);const l=n.a,c=n.b,u=n.c,f=n.d,d=n.tx,p=n.ty;for(let x=e;x<s;x+=2){const g=t[x],m=t[x+1],_=l*g+u*m+d,y=c*g+f*m+p;r=_<r?_:r,o=y<o?y:o,a=_>a?_:a,h=y>h?y:h}this.minX=r,this.minY=o,this.maxX=a,this.maxY=h}containsPoint(t,e){return this.minX<=t&&this.minY<=e&&this.maxX>=t&&this.maxY>=e}toString(){return`[pixi.js:Bounds minX=${this.minX} minY=${this.minY} maxX=${this.maxX} maxY=${this.maxY} width=${this.width} height=${this.height}]`}copyFrom(t){return this.minX=t.minX,this.minY=t.minY,this.maxX=t.maxX,this.maxY=t.maxY,this}}var wa={grad:.9,turn:360,rad:360/(2*Math.PI)},$t=function(i){return typeof i=="string"?i.length>0:typeof i=="number"},ft=function(i,t,e){return t===void 0&&(t=0),e===void 0&&(e=Math.pow(10,t)),Math.round(e*i)/e+0},At=function(i,t,e){return t===void 0&&(t=0),e===void 0&&(e=1),i>e?e:i>t?i:t},Mr=function(i){return(i=isFinite(i)?i%360:0)>0?i:i+360},ln=function(i){return{r:At(i.r,0,255),g:At(i.g,0,255),b:At(i.b,0,255),a:At(i.a)}},Us=function(i){return{r:ft(i.r),g:ft(i.g),b:ft(i.b),a:ft(i.a,3)}},va=/^#([0-9a-f]{3,8})$/i,fs=function(i){var t=i.toString(16);return t.length<2?"0"+t:t},Tr=function(i){var t=i.r,e=i.g,s=i.b,n=i.a,r=Math.max(t,e,s),o=r-Math.min(t,e,s),a=o?r===t?(e-s)/o:r===e?2+(s-t)/o:4+(t-e)/o:0;return{h:60*(a<0?a+6:a),s:r?o/r*100:0,v:r/255*100,a:n}},Ar=function(i){var t=i.h,e=i.s,s=i.v,n=i.a;t=t/360*6,e/=100,s/=100;var r=Math.floor(t),o=s*(1-e),a=s*(1-(t-r)*e),h=s*(1-(1-t+r)*e),l=r%6;return{r:255*[s,a,o,o,h,s][l],g:255*[h,s,s,a,o,o][l],b:255*[o,o,h,s,s,a][l],a:n}},cn=function(i){return{h:Mr(i.h),s:At(i.s,0,100),l:At(i.l,0,100),a:At(i.a)}},un=function(i){return{h:ft(i.h),s:ft(i.s),l:ft(i.l),a:ft(i.a,3)}},dn=function(i){return Ar((e=(t=i).s,{h:t.h,s:(e*=((s=t.l)<50?s:100-s)/100)>0?2*e/(s+e)*100:0,v:s+e,a:t.a}));var t,e,s},Ve=function(i){return{h:(t=Tr(i)).h,s:(n=(200-(e=t.s))*(s=t.v)/100)>0&&n<200?e*s/100/(n<=100?n:200-n)*100:0,l:n/2,a:t.a};var t,e,s,n},Sa=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Ca=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Ma=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Ta=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,gi={string:[[function(i){var t=va.exec(i);return t?(i=t[1]).length<=4?{r:parseInt(i[0]+i[0],16),g:parseInt(i[1]+i[1],16),b:parseInt(i[2]+i[2],16),a:i.length===4?ft(parseInt(i[3]+i[3],16)/255,2):1}:i.length===6||i.length===8?{r:parseInt(i.substr(0,2),16),g:parseInt(i.substr(2,2),16),b:parseInt(i.substr(4,2),16),a:i.length===8?ft(parseInt(i.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(i){var t=Ma.exec(i)||Ta.exec(i);return t?t[2]!==t[4]||t[4]!==t[6]?null:ln({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(i){var t=Sa.exec(i)||Ca.exec(i);if(!t)return null;var e,s,n=cn({h:(e=t[1],s=t[2],s===void 0&&(s="deg"),Number(e)*(wa[s]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return dn(n)},"hsl"]],object:[[function(i){var t=i.r,e=i.g,s=i.b,n=i.a,r=n===void 0?1:n;return $t(t)&&$t(e)&&$t(s)?ln({r:Number(t),g:Number(e),b:Number(s),a:Number(r)}):null},"rgb"],[function(i){var t=i.h,e=i.s,s=i.l,n=i.a,r=n===void 0?1:n;if(!$t(t)||!$t(e)||!$t(s))return null;var o=cn({h:Number(t),s:Number(e),l:Number(s),a:Number(r)});return dn(o)},"hsl"],[function(i){var t=i.h,e=i.s,s=i.v,n=i.a,r=n===void 0?1:n;if(!$t(t)||!$t(e)||!$t(s))return null;var o=(function(a){return{h:Mr(a.h),s:At(a.s,0,100),v:At(a.v,0,100),a:At(a.a)}})({h:Number(t),s:Number(e),v:Number(s),a:Number(r)});return Ar(o)},"hsv"]]},fn=function(i,t){for(var e=0;e<t.length;e++){var s=t[e][0](i);if(s)return[s,t[e][1]]}return[null,void 0]},Aa=function(i){return typeof i=="string"?fn(i.trim(),gi.string):typeof i=="object"&&i!==null?fn(i,gi.object):[null,void 0]},Ys=function(i,t){var e=Ve(i);return{h:e.h,s:At(e.s+100*t,0,100),l:e.l,a:e.a}},Ns=function(i){return(299*i.r+587*i.g+114*i.b)/1e3/255},pn=function(i,t){var e=Ve(i);return{h:e.h,s:e.s,l:At(e.l+100*t,0,100),a:e.a}},mi=(function(){function i(t){this.parsed=Aa(t)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return i.prototype.isValid=function(){return this.parsed!==null},i.prototype.brightness=function(){return ft(Ns(this.rgba),2)},i.prototype.isDark=function(){return Ns(this.rgba)<.5},i.prototype.isLight=function(){return Ns(this.rgba)>=.5},i.prototype.toHex=function(){return t=Us(this.rgba),e=t.r,s=t.g,n=t.b,o=(r=t.a)<1?fs(ft(255*r)):"","#"+fs(e)+fs(s)+fs(n)+o;var t,e,s,n,r,o},i.prototype.toRgb=function(){return Us(this.rgba)},i.prototype.toRgbString=function(){return t=Us(this.rgba),e=t.r,s=t.g,n=t.b,(r=t.a)<1?"rgba("+e+", "+s+", "+n+", "+r+")":"rgb("+e+", "+s+", "+n+")";var t,e,s,n,r},i.prototype.toHsl=function(){return un(Ve(this.rgba))},i.prototype.toHslString=function(){return t=un(Ve(this.rgba)),e=t.h,s=t.s,n=t.l,(r=t.a)<1?"hsla("+e+", "+s+"%, "+n+"%, "+r+")":"hsl("+e+", "+s+"%, "+n+"%)";var t,e,s,n,r},i.prototype.toHsv=function(){return t=Tr(this.rgba),{h:ft(t.h),s:ft(t.s),v:ft(t.v),a:ft(t.a,3)};var t},i.prototype.invert=function(){return Ht({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},i.prototype.saturate=function(t){return t===void 0&&(t=.1),Ht(Ys(this.rgba,t))},i.prototype.desaturate=function(t){return t===void 0&&(t=.1),Ht(Ys(this.rgba,-t))},i.prototype.grayscale=function(){return Ht(Ys(this.rgba,-1))},i.prototype.lighten=function(t){return t===void 0&&(t=.1),Ht(pn(this.rgba,t))},i.prototype.darken=function(t){return t===void 0&&(t=.1),Ht(pn(this.rgba,-t))},i.prototype.rotate=function(t){return t===void 0&&(t=15),this.hue(this.hue()+t)},i.prototype.alpha=function(t){return typeof t=="number"?Ht({r:(e=this.rgba).r,g:e.g,b:e.b,a:t}):ft(this.rgba.a,3);var e},i.prototype.hue=function(t){var e=Ve(this.rgba);return typeof t=="number"?Ht({h:t,s:e.s,l:e.l,a:e.a}):ft(e.h)},i.prototype.isEqual=function(t){return this.toHex()===Ht(t).toHex()},i})(),Ht=function(i){return i instanceof mi?i:new mi(i)},gn=[],Pa=function(i){i.forEach(function(t){gn.indexOf(t)<0&&(t(mi,gi),gn.push(t))})};function ka(i,t){var e={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},s={};for(var n in e)s[e[n]]=n;var r={};i.prototype.toName=function(o){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var a,h,l=s[this.toHex()];if(l)return l;if(o?.closest){var c=this.toRgb(),u=1/0,f="black";if(!r.length)for(var d in e)r[d]=new i(e[d]).toRgb();for(var p in e){var x=(a=c,h=r[p],Math.pow(a.r-h.r,2)+Math.pow(a.g-h.g,2)+Math.pow(a.b-h.b,2));x<u&&(u=x,f=p)}return f}},t.string.push([function(o){var a=o.toLowerCase(),h=a==="transparent"?"#0000":e[a];return h?new i(h).toRgb():null},"name"])}Pa([ka]);const ke=class Ue{constructor(t=16777215){this._value=null,this._components=new Float32Array(4),this._components.fill(1),this._int=16777215,this.value=t}get red(){return this._components[0]}get green(){return this._components[1]}get blue(){return this._components[2]}get alpha(){return this._components[3]}setValue(t){return this.value=t,this}set value(t){if(t instanceof Ue)this._value=this._cloneSource(t._value),this._int=t._int,this._components.set(t._components);else{if(t===null)throw new Error("Cannot set Color#value to null");(this._value===null||!this._isSourceEqual(this._value,t))&&(this._value=this._cloneSource(t),this._normalize(this._value))}}get value(){return this._value}_cloneSource(t){return typeof t=="string"||typeof t=="number"||t instanceof Number||t===null?t:Array.isArray(t)||ArrayBuffer.isView(t)?t.slice(0):typeof t=="object"&&t!==null?{...t}:t}_isSourceEqual(t,e){const s=typeof t;if(s!==typeof e)return!1;if(s==="number"||s==="string"||t instanceof Number)return t===e;if(Array.isArray(t)&&Array.isArray(e)||ArrayBuffer.isView(t)&&ArrayBuffer.isView(e))return t.length!==e.length?!1:t.every((r,o)=>r===e[o]);if(t!==null&&e!==null){const r=Object.keys(t),o=Object.keys(e);return r.length!==o.length?!1:r.every(a=>t[a]===e[a])}return t===e}toRgba(){const[t,e,s,n]=this._components;return{r:t,g:e,b:s,a:n}}toRgb(){const[t,e,s]=this._components;return{r:t,g:e,b:s}}toRgbaString(){const[t,e,s]=this.toUint8RgbArray();return`rgba(${t},${e},${s},${this.alpha})`}toUint8RgbArray(t){const[e,s,n]=this._components;return this._arrayRgb||(this._arrayRgb=[]),t||(t=this._arrayRgb),t[0]=Math.round(e*255),t[1]=Math.round(s*255),t[2]=Math.round(n*255),t}toArray(t){this._arrayRgba||(this._arrayRgba=[]),t||(t=this._arrayRgba);const[e,s,n,r]=this._components;return t[0]=e,t[1]=s,t[2]=n,t[3]=r,t}toRgbArray(t){this._arrayRgb||(this._arrayRgb=[]),t||(t=this._arrayRgb);const[e,s,n]=this._components;return t[0]=e,t[1]=s,t[2]=n,t}toNumber(){return this._int}toBgrNumber(){const[t,e,s]=this.toUint8RgbArray();return(s<<16)+(e<<8)+t}toLittleEndianNumber(){const t=this._int;return(t>>16)+(t&65280)+((t&255)<<16)}multiply(t){const[e,s,n,r]=Ue._temp.setValue(t)._components;return this._components[0]*=e,this._components[1]*=s,this._components[2]*=n,this._components[3]*=r,this._refreshInt(),this._value=null,this}premultiply(t,e=!0){return e&&(this._components[0]*=t,this._components[1]*=t,this._components[2]*=t),this._components[3]=t,this._refreshInt(),this._value=null,this}toPremultiplied(t,e=!0){if(t===1)return(255<<24)+this._int;if(t===0)return e?0:this._int;let s=this._int>>16&255,n=this._int>>8&255,r=this._int&255;return e&&(s=s*t+.5|0,n=n*t+.5|0,r=r*t+.5|0),(t*255<<24)+(s<<16)+(n<<8)+r}toHex(){const t=this._int.toString(16);return`#${"000000".substring(0,6-t.length)+t}`}toHexa(){const e=Math.round(this._components[3]*255).toString(16);return this.toHex()+"00".substring(0,2-e.length)+e}setAlpha(t){return this._components[3]=this._clamp(t),this._value=null,this}_normalize(t){let e,s,n,r;if((typeof t=="number"||t instanceof Number)&&t>=0&&t<=16777215){const o=t;e=(o>>16&255)/255,s=(o>>8&255)/255,n=(o&255)/255,r=1}else if((Array.isArray(t)||t instanceof Float32Array)&&t.length>=3&&t.length<=4)t=this._clamp(t),[e,s,n,r=1]=t;else if((t instanceof Uint8Array||t instanceof Uint8ClampedArray)&&t.length>=3&&t.length<=4)t=this._clamp(t,0,255),[e,s,n,r=255]=t,e/=255,s/=255,n/=255,r/=255;else if(typeof t=="string"||typeof t=="object"){if(typeof t=="string"){const a=Ue.HEX_PATTERN.exec(t);a&&(t=`#${a[2]}`)}const o=Ht(t);o.isValid()&&({r:e,g:s,b:n,a:r}=o.rgba,e/=255,s/=255,n/=255)}if(e!==void 0)this._components[0]=e,this._components[1]=s,this._components[2]=n,this._components[3]=r,this._refreshInt();else throw new Error(`Unable to convert color ${t}`)}_refreshInt(){this._clamp(this._components);const[t,e,s]=this._components;this._int=(t*255<<16)+(e*255<<8)+(s*255|0)}_clamp(t,e=0,s=1){return typeof t=="number"?Math.min(Math.max(t,e),s):(t.forEach((n,r)=>{t[r]=Math.min(Math.max(n,e),s)}),t)}static isColorLike(t){return typeof t=="number"||typeof t=="string"||t instanceof Number||t instanceof Ue||Array.isArray(t)||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Float32Array||t.r!==void 0&&t.g!==void 0&&t.b!==void 0||t.r!==void 0&&t.g!==void 0&&t.b!==void 0&&t.a!==void 0||t.h!==void 0&&t.s!==void 0&&t.l!==void 0||t.h!==void 0&&t.s!==void 0&&t.l!==void 0&&t.a!==void 0||t.h!==void 0&&t.s!==void 0&&t.v!==void 0||t.h!==void 0&&t.s!==void 0&&t.v!==void 0&&t.a!==void 0}};ke.shared=new ke;ke._temp=new ke;ke.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;let nt=ke;const Ia={cullArea:null,cullable:!1,cullableChildren:!0};let Xs=0;const mn=500;function bt(...i){Xs!==mn&&(Xs++,Xs===mn?console.warn("PixiJS Warning: too many warnings, no more warnings will be reported to the console by PixiJS."):console.warn("PixiJS Warning: ",...i))}const is={_registeredResources:new Set,register(i){this._registeredResources.add(i)},unregister(i){this._registeredResources.delete(i)},release(){this._registeredResources.forEach(i=>i.clear())},get registeredCount(){return this._registeredResources.size},isRegistered(i){return this._registeredResources.has(i)},reset(){this._registeredResources.clear()}};class Ra{constructor(t,e){this._pool=[],this._count=0,this._index=0,this._classType=t,e&&this.prepopulate(e)}prepopulate(t){for(let e=0;e<t;e++)this._pool[this._index++]=new this._classType;this._count+=t}get(t){let e;return this._index>0?e=this._pool[--this._index]:(e=new this._classType,this._count++),e.init?.(t),e}return(t){t.reset?.(),this._pool[this._index++]=t}get totalSize(){return this._count}get totalFree(){return this._index}get totalUsed(){return this._count-this._index}clear(){if(this._pool.length>0&&this._pool[0].destroy)for(let t=0;t<this._index;t++)this._pool[t].destroy();this._pool.length=0,this._count=0,this._index=0}}class Ea{constructor(){this._poolsByClass=new Map}prepopulate(t,e){this.getPool(t).prepopulate(e)}get(t,e){return this.getPool(t).get(e)}return(t){this.getPool(t.constructor).return(t)}getPool(t){return this._poolsByClass.has(t)||this._poolsByClass.set(t,new Ra(t)),this._poolsByClass.get(t)}stats(){const t={};return this._poolsByClass.forEach(e=>{const s=t[e._classType.name]?e._classType.name+e._classType.ID:e._classType.name;t[s]={free:e.totalFree,used:e.totalUsed,size:e.totalSize}}),t}clear(){this._poolsByClass.forEach(t=>t.clear()),this._poolsByClass.clear()}}const vt=new Ea;is.register(vt);const Ba={get isCachedAsTexture(){return!!this.renderGroup?.isCachedAsTexture},cacheAsTexture(i){typeof i=="boolean"&&i===!1?this.disableRenderGroup():(this.enableRenderGroup(),this.renderGroup.enableCacheAsTexture(i===!0?{}:i))},updateCacheTexture(){this.renderGroup?.updateCacheTexture()},get cacheAsBitmap(){return this.isCachedAsTexture},set cacheAsBitmap(i){$("v8.6.0","cacheAsBitmap is deprecated, use cacheAsTexture instead."),this.cacheAsTexture(i)}};function Wa(i,t,e){const s=i.length;let n;if(t>=s||e===0)return;e=t+e>s?s-t:e;const r=s-e;for(n=t;n<r;++n)i[n]=i[n+e];i.length=r}const Ga={allowChildren:!0,removeChildren(i=0,t){const e=t??this.children.length,s=e-i,n=[];if(s>0&&s<=e){for(let o=e-1;o>=i;o--){const a=this.children[o];a&&(n.push(a),a.parent=null)}Wa(this.children,i,e);const r=this.renderGroup||this.parentRenderGroup;r&&r.removeChildren(n);for(let o=0;o<n.length;++o){const a=n[o];a.parentRenderLayer?.detach(a),this.emit("childRemoved",a,this,o),n[o].emit("removed",this)}return n.length>0&&this._didViewChangeTick++,n}else if(s===0&&this.children.length===0)return n;throw new RangeError("removeChildren: numeric values are outside the acceptable range.")},removeChildAt(i){const t=this.getChildAt(i);return this.removeChild(t)},getChildAt(i){if(i<0||i>=this.children.length)throw new Error(`getChildAt: Index (${i}) does not exist.`);return this.children[i]},setChildIndex(i,t){if(t<0||t>=this.children.length)throw new Error(`The index ${t} supplied is out of bounds ${this.children.length}`);this.getChildIndex(i),this.addChildAt(i,t)},getChildIndex(i){const t=this.children.indexOf(i);if(t===-1)throw new Error("The supplied Container must be a child of the caller");return t},addChildAt(i,t){this.allowChildren||$(ot,"addChildAt: Only Containers will be allowed to add children in v8.0.0");const{children:e}=this;if(t<0||t>e.length)throw new Error(`${i}addChildAt: The index ${t} supplied is out of bounds ${e.length}`);const s=i.parent===this;if(i.parent){const r=i.parent.children.indexOf(i);if(s){if(r===t)return i;i.parent.children.splice(r,1)}else i.removeFromParent()}t===e.length?e.push(i):e.splice(t,0,i),i.parent=this,i.didChange=!0,i._updateFlags=15;const n=this.renderGroup||this.parentRenderGroup;return n&&n.addChild(i),this.sortableChildren&&(this.sortDirty=!0),s||(this.emit("childAdded",i,this,t),i.emit("added",this)),i},swapChildren(i,t){if(i===t)return;const e=this.getChildIndex(i),s=this.getChildIndex(t);this.children[e]=t,this.children[s]=i;const n=this.renderGroup||this.parentRenderGroup;n&&(n.structureDidChange=!0),this._didContainerChangeTick++},removeFromParent(){this.parent?.removeChild(this)},reparentChild(...i){return i.length===1?this.reparentChildAt(i[0],this.children.length):(i.forEach(t=>this.reparentChildAt(t,this.children.length)),i[0])},reparentChildAt(i,t){if(i.parent===this)return this.setChildIndex(i,t),i;const e=i.worldTransform.clone();i.removeFromParent(),this.addChildAt(i,t);const s=this.worldTransform.clone();return s.invert(),e.prepend(s),i.setFromMatrix(e),i},replaceChild(i,t){i.updateLocalTransform(),this.addChildAt(t,this.getChildIndex(i)),t.setFromMatrix(i.localTransform),t.updateLocalTransform(),this.removeChild(i)}},Fa={collectRenderables(i,t,e){this.parentRenderLayer&&this.parentRenderLayer!==e||this.globalDisplayStatus<7||!this.includeInBuild||(this.sortableChildren&&this.sortChildren(),this.isSimple?this.collectRenderablesSimple(i,t,e):this.renderGroup?t.renderPipes.renderGroup.addRenderGroup(this.renderGroup,i):this.collectRenderablesWithEffects(i,t,e))},collectRenderablesSimple(i,t,e){const s=this.children,n=s.length;for(let r=0;r<n;r++)s[r].collectRenderables(i,t,e)},collectRenderablesWithEffects(i,t,e){const{renderPipes:s}=t;for(let n=0;n<this.effects.length;n++){const r=this.effects[n];s[r.pipe].push(r,this,i)}this.collectRenderablesSimple(i,t,e);for(let n=this.effects.length-1;n>=0;n--){const r=this.effects[n];s[r.pipe].pop(r,this,i)}}};class xn{constructor(){this.pipe="filter",this.priority=1}destroy(){for(let t=0;t<this.filters.length;t++)this.filters[t].destroy();this.filters=null,this.filterArea=null}}class Da{constructor(){this._effectClasses=[],this._tests=[],this._initialized=!1}init(){this._initialized||(this._initialized=!0,this._effectClasses.forEach(t=>{this.add({test:t.test,maskClass:t})}))}add(t){this._tests.push(t)}getMaskEffect(t){this._initialized||this.init();for(let e=0;e<this._tests.length;e++){const s=this._tests[e];if(s.test(t))return vt.get(s.maskClass,t)}return t}returnMaskEffect(t){vt.return(t)}}const xi=new Da;ht.handleByList(H.MaskEffect,xi._effectClasses);const La={_maskEffect:null,_maskOptions:{inverse:!1,channel:"red"},_filterEffect:null,effects:[],_markStructureAsChanged(){const i=this.renderGroup||this.parentRenderGroup;i&&(i.structureDidChange=!0)},addEffect(i){this.effects.indexOf(i)===-1&&(this.effects.push(i),this.effects.sort((e,s)=>e.priority-s.priority),this._markStructureAsChanged(),this._updateIsSimple())},removeEffect(i){const t=this.effects.indexOf(i);t!==-1&&(this.effects.splice(t,1),this._markStructureAsChanged(),this._updateIsSimple())},set mask(i){const t=this._maskEffect;t?.mask!==i&&(t&&(this.removeEffect(t),xi.returnMaskEffect(t),this._maskEffect=null),i!=null&&(this._maskEffect=xi.getMaskEffect(i),this.addEffect(this._maskEffect)))},get mask(){return this._maskEffect?.mask},setMask(i){this._maskOptions={...this._maskOptions,...i},i.mask&&(this.mask=i.mask),this._markStructureAsChanged()},set filters(i){!Array.isArray(i)&&i&&(i=[i]);const t=this._filterEffect||(this._filterEffect=new xn);i=i;const e=i?.length>0,s=t.filters?.length>0,n=e!==s;i=Array.isArray(i)?i.slice(0):i,t.filters=Object.freeze(i),n&&(e?this.addEffect(t):(this.removeEffect(t),t.filters=i??null))},get filters(){return this._filterEffect?.filters},set filterArea(i){this._filterEffect||(this._filterEffect=new xn),this._filterEffect.filterArea=i},get filterArea(){return this._filterEffect?.filterArea}},za={label:null,get name(){return $(ot,"Container.name property has been removed, use Container.label instead"),this.label},set name(i){$(ot,"Container.name property has been removed, use Container.label instead"),this.label=i},getChildByName(i,t=!1){return this.getChildByLabel(i,t)},getChildByLabel(i,t=!1){const e=this.children;for(let s=0;s<e.length;s++){const n=e[s];if(n.label===i||i instanceof RegExp&&i.test(n.label))return n}if(t)for(let s=0;s<e.length;s++){const r=e[s].getChildByLabel(i,!0);if(r)return r}return null},getChildrenByLabel(i,t=!1,e=[]){const s=this.children;for(let n=0;n<s.length;n++){const r=s[n];(r.label===i||i instanceof RegExp&&i.test(r.label))&&e.push(r)}if(t)for(let n=0;n<s.length;n++)s[n].getChildrenByLabel(i,!0,e);return e}},_t=vt.getPool(N),Kt=vt.getPool(It),Ha=new N,Oa={getFastGlobalBounds(i,t){t||(t=new It),t.clear(),this._getGlobalBoundsRecursive(!!i,t,this.parentRenderLayer),t.isValid||t.set(0,0,0,0);const e=this.renderGroup||this.parentRenderGroup;return t.applyMatrix(e.worldTransform),t},_getGlobalBoundsRecursive(i,t,e){let s=t;if(i&&this.parentRenderLayer&&this.parentRenderLayer!==e||this.localDisplayStatus!==7||!this.measurable)return;const n=!!this.effects.length;if((this.renderGroup||n)&&(s=Kt.get().clear()),this.boundsArea)t.addRect(this.boundsArea,this.worldTransform);else{if(this.renderPipeId){const o=this.bounds;s.addFrame(o.minX,o.minY,o.maxX,o.maxY,this.groupTransform)}const r=this.children;for(let o=0;o<r.length;o++)r[o]._getGlobalBoundsRecursive(i,s,e)}if(n){let r=!1;const o=this.renderGroup||this.parentRenderGroup;for(let a=0;a<this.effects.length;a++)this.effects[a].addBounds&&(r||(r=!0,s.applyMatrix(o.worldTransform)),this.effects[a].addBounds(s,!0));r&&s.applyMatrix(o.worldTransform.copyTo(Ha).invert()),t.addBounds(s),Kt.return(s)}else this.renderGroup&&(t.addBounds(s,this.relativeGroupTransform),Kt.return(s))}};function Pr(i,t,e){e.clear();let s,n;return i.parent?t?s=i.parent.worldTransform:(n=_t.get().identity(),s=Wi(i,n)):s=N.IDENTITY,kr(i,e,s,t),n&&_t.return(n),e.isValid||e.set(0,0,0,0),e}function kr(i,t,e,s){if(!i.visible||!i.measurable)return;let n;s?n=i.worldTransform:(i.updateLocalTransform(),n=_t.get(),n.appendFrom(i.localTransform,e));const r=t,o=!!i.effects.length;if(o&&(t=Kt.get().clear()),i.boundsArea)t.addRect(i.boundsArea,n);else{const a=i.bounds;a&&!a.isEmpty()&&(t.matrix=n,t.addBounds(a));for(let h=0;h<i.children.length;h++)kr(i.children[h],t,n,s)}if(o){for(let a=0;a<i.effects.length;a++)i.effects[a].addBounds?.(t);r.addBounds(t,N.IDENTITY),Kt.return(t)}s||_t.return(n)}function Wi(i,t){const e=i.parent;return e&&(Wi(e,t),e.updateLocalTransform(),t.append(e.localTransform)),t}function Ir(i,t){if(i===16777215||!t)return t;if(t===16777215||!i)return i;const e=i>>16&255,s=i>>8&255,n=i&255,r=t>>16&255,o=t>>8&255,a=t&255,h=e*r/255|0,l=s*o/255|0,c=n*a/255|0;return(h<<16)+(l<<8)+c}const yn=16777215;function _n(i,t){return i===yn?t:t===yn?i:Ir(i,t)}function Ms(i){return((i&255)<<16)+(i&65280)+(i>>16&255)}const Ua={getGlobalAlpha(i){if(i)return this.renderGroup?this.renderGroup.worldAlpha:this.parentRenderGroup?this.parentRenderGroup.worldAlpha*this.alpha:this.alpha;let t=this.alpha,e=this.parent;for(;e;)t*=e.alpha,e=e.parent;return t},getGlobalTransform(i=new N,t){if(t)return i.copyFrom(this.worldTransform);this.updateLocalTransform();const e=Wi(this,_t.get().identity());return i.appendFrom(this.localTransform,e),_t.return(e),i},getGlobalTint(i){if(i)return this.renderGroup?Ms(this.renderGroup.worldColor):this.parentRenderGroup?Ms(_n(this.localColor,this.parentRenderGroup.worldColor)):this.tint;let t=this.localColor,e=this.parent;for(;e;)t=_n(t,e.localColor),e=e.parent;return Ms(t)}};function Rr(i,t,e){return t.clear(),e||(e=N.IDENTITY),Er(i,t,e,i,!0),t.isValid||t.set(0,0,0,0),t}function Er(i,t,e,s,n){let r;if(n)r=_t.get(),r=e.copyTo(r);else{if(!i.visible||!i.measurable)return;i.updateLocalTransform();const h=i.localTransform;r=_t.get(),r.appendFrom(h,e)}const o=t,a=!!i.effects.length;if(a&&(t=Kt.get().clear()),i.boundsArea)t.addRect(i.boundsArea,r);else{i.renderPipeId&&(t.matrix=r,t.addBounds(i.bounds));const h=i.children;for(let l=0;l<h.length;l++)Er(h[l],t,r,s,!1)}if(a){for(let h=0;h<i.effects.length;h++)i.effects[h].addLocalBounds?.(t,s);o.addBounds(t,N.IDENTITY),Kt.return(t)}_t.return(r)}function Br(i,t){const e=i.children;for(let s=0;s<e.length;s++){const n=e[s],r=n.uid,o=(n._didViewChangeTick&65535)<<16|n._didContainerChangeTick&65535,a=t.index;(t.data[a]!==r||t.data[a+1]!==o)&&(t.data[t.index]=r,t.data[t.index+1]=o,t.didChange=!0),t.index=a+2,n.children.length&&Br(n,t)}return t.didChange}const Ya=new N,Na={_localBoundsCacheId:-1,_localBoundsCacheData:null,_setWidth(i,t){const e=Math.sign(this.scale.x)||1;t!==0?this.scale.x=i/t*e:this.scale.x=e},_setHeight(i,t){const e=Math.sign(this.scale.y)||1;t!==0?this.scale.y=i/t*e:this.scale.y=e},getLocalBounds(){this._localBoundsCacheData||(this._localBoundsCacheData={data:[],index:1,didChange:!1,localBounds:new It});const i=this._localBoundsCacheData;return i.index=1,i.didChange=!1,i.data[0]!==this._didViewChangeTick&&(i.didChange=!0,i.data[0]=this._didViewChangeTick),Br(this,i),i.didChange&&Rr(this,i.localBounds,Ya),i.localBounds},getBounds(i,t){return Pr(this,i,t||new It)}},Xa={_onRender:null,set onRender(i){const t=this.renderGroup||this.parentRenderGroup;if(!i){this._onRender&&t?.removeOnRender(this),this._onRender=null;return}this._onRender||t?.addOnRender(this),this._onRender=i},get onRender(){return this._onRender}},Va={_zIndex:0,sortDirty:!1,sortableChildren:!1,get zIndex(){return this._zIndex},set zIndex(i){this._zIndex!==i&&(this._zIndex=i,this.depthOfChildModified())},depthOfChildModified(){this.parent&&(this.parent.sortableChildren=!0,this.parent.sortDirty=!0),this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0)},sortChildren(){this.sortDirty&&(this.sortDirty=!1,this.children.sort($a))}};function $a(i,t){return i._zIndex-t._zIndex}const ja={getGlobalPosition(i=new X,t=!1){return this.parent?this.parent.toGlobal(this._position,i,t):(i.x=this._position.x,i.y=this._position.y),i},toGlobal(i,t,e=!1){const s=this.getGlobalTransform(_t.get(),e);return t=s.apply(i,t),_t.return(s),t},toLocal(i,t,e,s){t&&(i=t.toGlobal(i,e,s));const n=this.getGlobalTransform(_t.get(),s);return e=n.applyInverse(i,e),_t.return(n),e}};class Gi{constructor(){this.uid=at("instructionSet"),this.instructions=[],this.instructionSize=0,this.renderables=[],this.gcTick=0}reset(){this.instructionSize=0}destroy(){this.instructions.length=0,this.renderables.length=0,this.renderPipes=null,this.gcTick=0}add(t){this.instructions[this.instructionSize++]=t}log(){this.instructions.length=this.instructionSize,console.table(this.instructions,["type","action"])}}let qa=0;class Ka{constructor(t){this._poolKeyHash=Object.create(null),this._texturePool={},this.textureOptions=t||{},this.enableFullScreen=!1,this.textureStyle=new Pe(this.textureOptions)}createTexture(t,e,s,n){const r=new Rt({...this.textureOptions,width:t,height:e,resolution:1,antialias:s,autoGarbageCollect:!1,autoGenerateMipmaps:n});return new K({source:r,label:`texturePool_${qa++}`})}getOptimalTexture(t,e,s=1,n,r=!1){let o=Math.ceil(t*s-1e-6),a=Math.ceil(e*s-1e-6);o=Ae(o),a=Ae(a);const h=n?1:0,l=r?1:0,c=(o<<17)+(a<<2)+(l<<1)+h;this._texturePool[c]||(this._texturePool[c]=[]);let u=this._texturePool[c].pop();return u||(u=this.createTexture(o,a,n,r)),u.source._resolution=s,u.source.width=o/s,u.source.height=a/s,u.source.pixelWidth=o,u.source.pixelHeight=a,u.frame.x=0,u.frame.y=0,u.frame.width=t,u.frame.height=e,u.updateUvs(),this._poolKeyHash[u.uid]=c,u}getSameSizeTexture(t,e=!1){const s=t.source;return this.getOptimalTexture(t.width,t.height,s._resolution,e)}returnTexture(t,e=!1){const s=this._poolKeyHash[t.uid];e&&(t.source.style=this.textureStyle),this._texturePool[s].push(t)}clear(t){if(t=t!==!1,t)for(const e in this._texturePool){const s=this._texturePool[e];if(s)for(let n=0;n<s.length;n++)s[n].destroy(!0)}this._texturePool={}}}const Bs=new Ka;is.register(Bs);class Za{constructor(){this.renderPipeId="renderGroup",this.root=null,this.canBundle=!1,this.renderGroupParent=null,this.renderGroupChildren=[],this.worldTransform=new N,this.worldColorAlpha=4294967295,this.worldColor=16777215,this.worldAlpha=1,this.childrenToUpdate=Object.create(null),this.updateTick=0,this.gcTick=0,this.childrenRenderablesToUpdate={list:[],index:0},this.structureDidChange=!0,this.instructionSet=new Gi,this._onRenderContainers=[],this.textureNeedsUpdate=!0,this.isCachedAsTexture=!1,this._matrixDirty=7}init(t){this.root=t,t._onRender&&this.addOnRender(t),t.didChange=!0;const e=t.children;for(let s=0;s<e.length;s++){const n=e[s];n._updateFlags=15,this.addChild(n)}}enableCacheAsTexture(t={}){this.textureOptions=t,this.isCachedAsTexture=!0,this.textureNeedsUpdate=!0}disableCacheAsTexture(){this.isCachedAsTexture=!1,this.texture&&(Bs.returnTexture(this.texture,!0),this.texture=null)}updateCacheTexture(){this.textureNeedsUpdate=!0;const t=this._parentCacheAsTextureRenderGroup;t&&!t.textureNeedsUpdate&&t.updateCacheTexture()}reset(){this.renderGroupChildren.length=0;for(const t in this.childrenToUpdate){const e=this.childrenToUpdate[t];e.list.fill(null),e.index=0}this.childrenRenderablesToUpdate.index=0,this.childrenRenderablesToUpdate.list.fill(null),this.root=null,this.updateTick=0,this.structureDidChange=!0,this._onRenderContainers.length=0,this.renderGroupParent=null,this.disableCacheAsTexture()}get localTransform(){return this.root.localTransform}addRenderGroupChild(t){t.renderGroupParent&&t.renderGroupParent._removeRenderGroupChild(t),t.renderGroupParent=this,this.renderGroupChildren.push(t)}_removeRenderGroupChild(t){const e=this.renderGroupChildren.indexOf(t);e>-1&&this.renderGroupChildren.splice(e,1),t.renderGroupParent=null}addChild(t){if(this.structureDidChange=!0,t.parentRenderGroup=this,t.updateTick=-1,t.parent===this.root?t.relativeRenderGroupDepth=1:t.relativeRenderGroupDepth=t.parent.relativeRenderGroupDepth+1,t.didChange=!0,this.onChildUpdate(t),t.renderGroup){this.addRenderGroupChild(t.renderGroup);return}t._onRender&&this.addOnRender(t);const e=t.children;for(let s=0;s<e.length;s++)this.addChild(e[s])}removeChild(t){if(this.structureDidChange=!0,t._onRender&&(t.renderGroup||this.removeOnRender(t)),t.parentRenderGroup=null,t.renderGroup){this._removeRenderGroupChild(t.renderGroup);return}const e=t.children;for(let s=0;s<e.length;s++)this.removeChild(e[s])}removeChildren(t){for(let e=0;e<t.length;e++)this.removeChild(t[e])}onChildUpdate(t){let e=this.childrenToUpdate[t.relativeRenderGroupDepth];e||(e=this.childrenToUpdate[t.relativeRenderGroupDepth]={index:0,list:[]}),e.list[e.index++]=t}updateRenderable(t){t.globalDisplayStatus<7||(this.instructionSet.renderPipes[t.renderPipeId].updateRenderable(t),t.didViewUpdate=!1)}onChildViewUpdate(t){this.childrenRenderablesToUpdate.list[this.childrenRenderablesToUpdate.index++]=t}get isRenderable(){return this.root.localDisplayStatus===7&&this.worldAlpha>0}addOnRender(t){this._onRenderContainers.push(t)}removeOnRender(t){this._onRenderContainers.splice(this._onRenderContainers.indexOf(t),1)}runOnRender(t){for(let e=0;e<this._onRenderContainers.length;e++)this._onRenderContainers[e]._onRender(t)}destroy(){this.disableCacheAsTexture(),this.renderGroupParent=null,this.root=null,this.childrenRenderablesToUpdate=null,this.childrenToUpdate=null,this.renderGroupChildren=null,this._onRenderContainers=null,this.instructionSet=null}getChildren(t=[]){const e=this.root.children;for(let s=0;s<e.length;s++)this._getChildren(e[s],t);return t}_getChildren(t,e=[]){if(e.push(t),t.renderGroup)return e;const s=t.children;for(let n=0;n<s.length;n++)this._getChildren(s[n],e);return e}invalidateMatrices(){this._matrixDirty=7}get inverseWorldTransform(){return(this._matrixDirty&1)===0?this._inverseWorldTransform:(this._matrixDirty&=-2,this._inverseWorldTransform||(this._inverseWorldTransform=new N),this._inverseWorldTransform.copyFrom(this.worldTransform).invert())}get textureOffsetInverseTransform(){return(this._matrixDirty&2)===0?this._textureOffsetInverseTransform:(this._matrixDirty&=-3,this._textureOffsetInverseTransform||(this._textureOffsetInverseTransform=new N),this._textureOffsetInverseTransform.copyFrom(this.inverseWorldTransform).translate(-this._textureBounds.x,-this._textureBounds.y))}get inverseParentTextureTransform(){if((this._matrixDirty&4)===0)return this._inverseParentTextureTransform;this._matrixDirty&=-5;const t=this._parentCacheAsTextureRenderGroup;return t?(this._inverseParentTextureTransform||(this._inverseParentTextureTransform=new N),this._inverseParentTextureTransform.copyFrom(this.worldTransform).prepend(t.inverseWorldTransform).translate(-t._textureBounds.x,-t._textureBounds.y)):this.worldTransform}get cacheToLocalTransform(){return this.isCachedAsTexture?this.textureOffsetInverseTransform:this._parentCacheAsTextureRenderGroup?this._parentCacheAsTextureRenderGroup.textureOffsetInverseTransform:null}}function Qa(i,t,e={}){for(const s in t)!e[s]&&t[s]!==void 0&&(i[s]=t[s])}const Vs=new mt(null),ps=new mt(null),$s=new mt(null,1,1),gs=new mt(null),bn=1,Ja=2,js=4;class kt extends Yt{constructor(t={}){super(),this.uid=at("renderable"),this._updateFlags=15,this.renderGroup=null,this.parentRenderGroup=null,this.parentRenderGroupIndex=0,this.didChange=!1,this.didViewUpdate=!1,this.relativeRenderGroupDepth=0,this.children=[],this.parent=null,this.includeInBuild=!0,this.measurable=!0,this.isSimple=!0,this.parentRenderLayer=null,this.updateTick=-1,this.localTransform=new N,this.relativeGroupTransform=new N,this.groupTransform=this.relativeGroupTransform,this.destroyed=!1,this._position=new mt(this,0,0),this._scale=$s,this._pivot=ps,this._origin=gs,this._skew=Vs,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._rotation=0,this.localColor=16777215,this.localAlpha=1,this.groupAlpha=1,this.groupColor=16777215,this.groupColorAlpha=4294967295,this.localBlendMode="inherit",this.groupBlendMode="normal",this.localDisplayStatus=7,this.globalDisplayStatus=7,this._didContainerChangeTick=0,this._didViewChangeTick=0,this._didLocalTransformChangeId=-1,this.effects=[],Qa(this,t,{children:!0,parent:!0,effects:!0}),t.children?.forEach(e=>this.addChild(e)),t.parent?.addChild(this)}static mixin(t){$("8.8.0","Container.mixin is deprecated, please use extensions.mixin instead."),ht.mixin(kt,t)}set _didChangeId(t){this._didViewChangeTick=t>>12&4095,this._didContainerChangeTick=t&4095}get _didChangeId(){return this._didContainerChangeTick&4095|(this._didViewChangeTick&4095)<<12}addChild(...t){if(this.allowChildren||$(ot,"addChild: Only Containers will be allowed to add children in v8.0.0"),t.length>1){for(let n=0;n<t.length;n++)this.addChild(t[n]);return t[0]}const e=t[0],s=this.renderGroup||this.parentRenderGroup;return e.parent===this?(this.children.splice(this.children.indexOf(e),1),this.children.push(e),s&&(s.structureDidChange=!0),e):(e.parent&&e.parent.removeChild(e),this.children.push(e),this.sortableChildren&&(this.sortDirty=!0),e.parent=this,e.didChange=!0,e._updateFlags=15,s&&s.addChild(e),this.emit("childAdded",e,this,this.children.length-1),e.emit("added",this),this._didViewChangeTick++,e._zIndex!==0&&e.depthOfChildModified(),e)}removeChild(...t){if(t.length>1){for(let n=0;n<t.length;n++)this.removeChild(t[n]);return t[0]}const e=t[0],s=this.children.indexOf(e);return s>-1&&(this._didViewChangeTick++,this.children.splice(s,1),this.renderGroup?this.renderGroup.removeChild(e):this.parentRenderGroup&&this.parentRenderGroup.removeChild(e),e.parentRenderLayer&&e.parentRenderLayer.detach(e),e.parent=null,this.emit("childRemoved",e,this,s),e.emit("removed",this)),e}_onUpdate(t){t&&t===this._skew&&this._updateSkew(),this._didContainerChangeTick++,!this.didChange&&(this.didChange=!0,this.parentRenderGroup&&this.parentRenderGroup.onChildUpdate(this))}set isRenderGroup(t){!!this.renderGroup!==t&&(t?this.enableRenderGroup():this.disableRenderGroup())}get isRenderGroup(){return!!this.renderGroup}enableRenderGroup(){if(this.renderGroup)return;const t=this.parentRenderGroup;t?.removeChild(this),this.renderGroup=vt.get(Za,this),this.groupTransform=N.IDENTITY,t?.addChild(this),this._updateIsSimple()}disableRenderGroup(){if(!this.renderGroup)return;const t=this.parentRenderGroup;t?.removeChild(this),vt.return(this.renderGroup),this.renderGroup=null,this.groupTransform=this.relativeGroupTransform,t?.addChild(this),this._updateIsSimple()}_updateIsSimple(){this.isSimple=!this.renderGroup&&this.effects.length===0}get worldTransform(){return this._worldTransform||(this._worldTransform=new N),this.renderGroup?this._worldTransform.copyFrom(this.renderGroup.worldTransform):this.parentRenderGroup&&this._worldTransform.appendFrom(this.relativeGroupTransform,this.parentRenderGroup.worldTransform),this._worldTransform}get x(){return this._position.x}set x(t){this._position.x=t}get y(){return this._position.y}set y(t){this._position.y=t}get position(){return this._position}set position(t){this._position.copyFrom(t)}get rotation(){return this._rotation}set rotation(t){this._rotation!==t&&(this._rotation=t,this._onUpdate(this._skew))}get angle(){return this.rotation*fa}set angle(t){this.rotation=t*pa}get pivot(){return this._pivot===ps&&(this._pivot=new mt(this,0,0)),this._pivot}set pivot(t){this._pivot===ps&&(this._pivot=new mt(this,0,0),this._origin!==gs&&bt("Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.")),typeof t=="number"?this._pivot.set(t):this._pivot.copyFrom(t)}get skew(){return this._skew===Vs&&(this._skew=new mt(this,0,0)),this._skew}set skew(t){this._skew===Vs&&(this._skew=new mt(this,0,0)),this._skew.copyFrom(t)}get scale(){return this._scale===$s&&(this._scale=new mt(this,1,1)),this._scale}set scale(t){this._scale===$s&&(this._scale=new mt(this,0,0)),typeof t=="string"&&(t=parseFloat(t)),typeof t=="number"?this._scale.set(t):this._scale.copyFrom(t)}get origin(){return this._origin===gs&&(this._origin=new mt(this,0,0)),this._origin}set origin(t){this._origin===gs&&(this._origin=new mt(this,0,0),this._pivot!==ps&&bt("Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.")),typeof t=="number"?this._origin.set(t):this._origin.copyFrom(t)}get width(){return Math.abs(this.scale.x*this.getLocalBounds().width)}set width(t){const e=this.getLocalBounds().width;this._setWidth(t,e)}get height(){return Math.abs(this.scale.y*this.getLocalBounds().height)}set height(t){const e=this.getLocalBounds().height;this._setHeight(t,e)}getSize(t){t||(t={});const e=this.getLocalBounds();return t.width=Math.abs(this.scale.x*e.width),t.height=Math.abs(this.scale.y*e.height),t}setSize(t,e){const s=this.getLocalBounds();typeof t=="object"?(e=t.height??t.width,t=t.width):e??(e=t),t!==void 0&&this._setWidth(t,s.width),e!==void 0&&this._setHeight(e,s.height)}_updateSkew(){const t=this._rotation,e=this._skew;this._cx=Math.cos(t+e._y),this._sx=Math.sin(t+e._y),this._cy=-Math.sin(t-e._x),this._sy=Math.cos(t-e._x)}updateTransform(t){return this.position.set(typeof t.x=="number"?t.x:this.position.x,typeof t.y=="number"?t.y:this.position.y),this.scale.set(typeof t.scaleX=="number"?t.scaleX:this.scale.x,typeof t.scaleY=="number"?t.scaleY:this.scale.y),this.rotation=typeof t.rotation=="number"?t.rotation:this.rotation,this.skew.set(typeof t.skewX=="number"?t.skewX:this.skew.x,typeof t.skewY=="number"?t.skewY:this.skew.y),this.pivot.set(typeof t.pivotX=="number"?t.pivotX:this.pivot.x,typeof t.pivotY=="number"?t.pivotY:this.pivot.y),this.origin.set(typeof t.originX=="number"?t.originX:this.origin.x,typeof t.originY=="number"?t.originY:this.origin.y),this}setFromMatrix(t){t.decompose(this)}updateLocalTransform(){const t=this._didContainerChangeTick;if(this._didLocalTransformChangeId===t)return;this._didLocalTransformChangeId=t;const e=this.localTransform,s=this._scale,n=this._pivot,r=this._origin,o=this._position,a=s._x,h=s._y,l=n._x,c=n._y,u=-r._x,f=-r._y;e.a=this._cx*a,e.b=this._sx*a,e.c=this._cy*h,e.d=this._sy*h,e.tx=o._x-(l*e.a+c*e.c)+(u*e.a+f*e.c)-u,e.ty=o._y-(l*e.b+c*e.d)+(u*e.b+f*e.d)-f}set alpha(t){t!==this.localAlpha&&(this.localAlpha=t,this._updateFlags|=bn,this._onUpdate())}get alpha(){return this.localAlpha}set tint(t){const s=nt.shared.setValue(t??16777215).toBgrNumber();s!==this.localColor&&(this.localColor=s,this._updateFlags|=bn,this._onUpdate())}get tint(){return Ms(this.localColor)}set blendMode(t){this.localBlendMode!==t&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=Ja,this.localBlendMode=t,this._onUpdate())}get blendMode(){return this.localBlendMode}get visible(){return!!(this.localDisplayStatus&2)}set visible(t){const e=t?2:0;(this.localDisplayStatus&2)!==e&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=js,this.localDisplayStatus^=2,this._onUpdate(),this.emit("visibleChanged",t))}get culled(){return!(this.localDisplayStatus&4)}set culled(t){const e=t?0:4;(this.localDisplayStatus&4)!==e&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=js,this.localDisplayStatus^=4,this._onUpdate())}get renderable(){return!!(this.localDisplayStatus&1)}set renderable(t){const e=t?1:0;(this.localDisplayStatus&1)!==e&&(this._updateFlags|=js,this.localDisplayStatus^=1,this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._onUpdate())}get isRenderable(){return this.localDisplayStatus===7&&this.groupAlpha>0}destroy(t=!1){if(this.destroyed)return;this.destroyed=!0;let e;if(this.children.length&&(e=this.removeChildren(0,this.children.length)),this.removeFromParent(),this.parent=null,this._maskEffect=null,this._filterEffect=null,this.effects=null,this._position=null,this._scale=null,this._pivot=null,this._origin=null,this._skew=null,this.emit("destroyed",this),this.removeAllListeners(),(typeof t=="boolean"?t:t?.children)&&e)for(let n=0;n<e.length;++n)e[n].destroy(t);this.renderGroup?.destroy(),this.renderGroup=null}}ht.mixin(kt,Ga,Oa,ja,Xa,Na,La,za,Va,Ia,Ba,Ua,Fa);class Fi extends kt{constructor(t){super(t),this.canBundle=!0,this.allowChildren=!1,this._roundPixels=0,this._lastUsed=-1,this._gpuData=Object.create(null),this.autoGarbageCollect=!0,this._gcLastUsed=-1,this._bounds=new It(0,1,0,0),this._boundsDirty=!0,this.autoGarbageCollect=t.autoGarbageCollect??!0}get bounds(){return this._boundsDirty?(this.updateBounds(),this._boundsDirty=!1,this._bounds):this._bounds}get roundPixels(){return!!this._roundPixels}set roundPixels(t){this._roundPixels=t?1:0}containsPoint(t){const e=this.bounds,{x:s,y:n}=t;return s>=e.minX&&s<=e.maxX&&n>=e.minY&&n<=e.maxY}onViewUpdate(){if(this._didViewChangeTick++,this._boundsDirty=!0,this.didViewUpdate)return;this.didViewUpdate=!0;const t=this.renderGroup||this.parentRenderGroup;t&&t.onChildViewUpdate(this)}unload(){this.emit("unload",this);for(const t in this._gpuData)this._gpuData[t]?.destroy();this._gpuData=Object.create(null),this.onViewUpdate()}destroy(t){this.unload(),super.destroy(t),this._bounds=null}collectRenderablesSimple(t,e,s){const{renderPipes:n}=e;n.blendMode.pushBlendMode(this,this.groupBlendMode,t);const o=n[this.renderPipeId];o?.addRenderable&&o.addRenderable(this,t),this.didViewUpdate=!1;const a=this.children,h=a.length;for(let l=0;l<h;l++)a[l].collectRenderables(t,e,s);n.blendMode.popBlendMode(t)}}class Ke extends Fi{constructor(t=K.EMPTY){t instanceof K&&(t={texture:t});const{texture:e=K.EMPTY,anchor:s,roundPixels:n,width:r,height:o,...a}=t;super({label:"Sprite",...a}),this.renderPipeId="sprite",this.batched=!0,this._visualBounds={minX:0,maxX:1,minY:0,maxY:0},this._anchor=new mt({_onUpdate:()=>{this.onViewUpdate()}}),s?this.anchor=s:e.defaultAnchor&&(this.anchor=e.defaultAnchor),this.texture=e,this.allowChildren=!1,this.roundPixels=n??!1,r!==void 0&&(this.width=r),o!==void 0&&(this.height=o)}static from(t,e=!1){return t instanceof K?new Ke(t):new Ke(K.from(t,e))}set texture(t){t||(t=K.EMPTY);const e=this._texture;e!==t&&(e&&e.dynamic&&e.off("update",this.onViewUpdate,this),t.dynamic&&t.on("update",this.onViewUpdate,this),this._texture=t,this._width&&this._setWidth(this._width,this._texture.orig.width),this._height&&this._setHeight(this._height,this._texture.orig.height),this.onViewUpdate())}get texture(){return this._texture}get visualBounds(){return Cr(this._visualBounds,this._anchor,this._texture),this._visualBounds}get sourceBounds(){return $("8.6.1","Sprite.sourceBounds is deprecated, use visualBounds instead."),this.visualBounds}updateBounds(){const t=this._anchor,e=this._texture,s=this._bounds,{width:n,height:r}=e.orig;s.minX=-t._x*n,s.maxX=s.minX+n,s.minY=-t._y*r,s.maxY=s.minY+r}destroy(t=!1){if(super.destroy(t),typeof t=="boolean"?t:t?.texture){const s=typeof t=="boolean"?t:t?.textureSource;this._texture.destroy(s)}this._texture=null,this._visualBounds=null,this._bounds=null,this._anchor=null}get anchor(){return this._anchor}set anchor(t){typeof t=="number"?this._anchor.set(t):this._anchor.copyFrom(t)}get width(){return Math.abs(this.scale.x)*this._texture.orig.width}set width(t){this._setWidth(t,this._texture.orig.width),this._width=t}get height(){return Math.abs(this.scale.y)*this._texture.orig.height}set height(t){this._setHeight(t,this._texture.orig.height),this._height=t}getSize(t){return t||(t={}),t.width=Math.abs(this.scale.x)*this._texture.orig.width,t.height=Math.abs(this.scale.y)*this._texture.orig.height,t}setSize(t,e){typeof t=="object"?(e=t.height??t.width,t=t.width):e??(e=t),t!==void 0&&this._setWidth(t,this._texture.orig.width),e!==void 0&&this._setHeight(e,this._texture.orig.height)}}const th=new It;function Wr(i,t,e){const s=th;i.measurable=!0,Pr(i,e,s),t.addBoundsMask(s),i.measurable=!1}function Gr(i,t,e){const s=Kt.get();i.measurable=!0;const n=_t.get().identity(),r=Fr(i,e,n);Rr(i,s,r),i.measurable=!1,t.addBoundsMask(s),_t.return(n),Kt.return(s)}function Fr(i,t,e){return i?(i!==t&&(Fr(i.parent,t,e),i.updateLocalTransform(),e.append(i.localTransform)),e):(bt("Mask bounds, renderable is not inside the root container"),e)}class Dr{constructor(t){this.priority=0,this.inverse=!1,this.channel="red",this.pipe="alphaMask",t?.mask&&this.init(t.mask)}init(t){this.mask=t,this.renderMaskToTexture=!(t instanceof Ke),this.mask.renderable=this.renderMaskToTexture,this.mask.includeInBuild=!this.renderMaskToTexture,this.mask.measurable=!1}reset(){this.mask!==null&&(this.mask.measurable=!0,this.mask=null)}addBounds(t,e){this.inverse||Wr(this.mask,t,e)}addLocalBounds(t,e){Gr(this.mask,t,e)}containsPoint(t,e){const s=this.mask;return e(s,t)}destroy(){this.reset()}static test(t){return t instanceof Ke}}Dr.extension=H.MaskEffect;class Lr{constructor(t){this.priority=0,this.pipe="colorMask",t?.mask&&this.init(t.mask)}init(t){this.mask=t}destroy(){}static test(t){return typeof t=="number"}}Lr.extension=H.MaskEffect;class zr{constructor(t){this.priority=0,this.pipe="stencilMask",t?.mask&&this.init(t.mask)}init(t){this.mask=t,this.mask.includeInBuild=!1,this.mask.measurable=!1}reset(){this.mask!==null&&(this.mask.measurable=!0,this.mask.includeInBuild=!0,this.mask=null)}addBounds(t,e){Wr(this.mask,t,e)}addLocalBounds(t,e){Gr(this.mask,t,e)}containsPoint(t,e){const s=this.mask;return e(s,t)}destroy(){this.reset()}static test(t){return t instanceof kt}}zr.extension=H.MaskEffect;const eh={createCanvas:(i,t)=>{const e=document.createElement("canvas");return e.width=i,e.height=t,e},createImage:()=>new Image,getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(i,t)=>fetch(i,t),parseXML:i=>new DOMParser().parseFromString(i,"text/xml")};let wn=eh;const ct={get(){return wn},set(i){wn=i}};class Hr extends Rt{constructor(t){t.resource||(t.resource=ct.get().createCanvas()),t.width||(t.width=t.resource.width,t.autoDensity||(t.width/=t.resolution)),t.height||(t.height=t.resource.height,t.autoDensity||(t.height/=t.resolution)),super(t),this.uploadMethodId="image",this.autoDensity=t.autoDensity,this.resizeCanvas(),this.transparent=!!t.transparent}resizeCanvas(){this.autoDensity&&"style"in this.resource&&(this.resource.style.width=`${this.width}px`,this.resource.style.height=`${this.height}px`),(this.resource.width!==this.pixelWidth||this.resource.height!==this.pixelHeight)&&(this.resource.width=this.pixelWidth,this.resource.height=this.pixelHeight)}resize(t=this.width,e=this.height,s=this._resolution){const n=super.resize(t,e,s);return n&&this.resizeCanvas(),n}static test(t){return globalThis.HTMLCanvasElement&&t instanceof HTMLCanvasElement||globalThis.OffscreenCanvas&&t instanceof OffscreenCanvas}get context2D(){return this._context2D||(this._context2D=this.resource.getContext("2d"))}}Hr.extension=H.TextureSource;class As extends Rt{constructor(t){super(t),this.uploadMethodId="image",this.autoGarbageCollect=!0}static test(t){return globalThis.HTMLImageElement&&t instanceof HTMLImageElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap||globalThis.VideoFrame&&t instanceof VideoFrame}}As.extension=H.TextureSource;var Ps=(i=>(i[i.INTERACTION=50]="INTERACTION",i[i.HIGH=25]="HIGH",i[i.NORMAL=0]="NORMAL",i[i.LOW=-25]="LOW",i[i.UTILITY=-50]="UTILITY",i))(Ps||{});class qs{constructor(t,e=null,s=0,n=!1){this.next=null,this.previous=null,this._destroyed=!1,this._fn=t,this._context=e,this.priority=s,this._once=n}match(t,e=null){return this._fn===t&&this._context===e}emit(t){this._fn&&(this._context?this._fn.call(this._context,t):this._fn(t));const e=this.next;return this._once&&this.destroy(!0),this._destroyed&&(this.next=null),e}connect(t){this.previous=t,t.next&&(t.next.previous=this),this.next=t.next,t.next=this}destroy(t=!1){this._destroyed=!0,this._fn=null,this._context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);const e=this.next;return this.next=t?null:e,this.previous=null,e}}const Or=class Ct{constructor(){this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new qs(null,null,1/0),this.deltaMS=1/Ct.targetFPMS,this.elapsedMS=1/Ct.targetFPMS,this._tick=t=>{this._requestId=null,this.started&&(this.update(t),this.started&&this._requestId===null&&this._head.next&&(this._requestId=requestAnimationFrame(this._tick)))}}_requestIfNeeded(){this._requestId===null&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))}_cancelIfNeeded(){this._requestId!==null&&(cancelAnimationFrame(this._requestId),this._requestId=null)}_startIfPossible(){this.started?this._requestIfNeeded():this.autoStart&&this.start()}add(t,e,s=Ps.NORMAL){return this._addListener(new qs(t,e,s))}addOnce(t,e,s=Ps.NORMAL){return this._addListener(new qs(t,e,s,!0))}_addListener(t){let e=this._head.next,s=this._head;if(!e)t.connect(s);else{for(;e;){if(t.priority>e.priority){t.connect(s);break}s=e,e=e.next}t.previous||t.connect(s)}return this._startIfPossible(),this}remove(t,e){let s=this._head.next;for(;s;)s.match(t,e)?s=s.destroy():s=s.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let t=0,e=this._head;for(;e=e.next;)t++;return t}start(){this.started||(this.started=!0,this._requestIfNeeded())}stop(){this.started&&(this.started=!1,this._cancelIfNeeded())}destroy(){if(!this._protected){this.stop();let t=this._head.next;for(;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}}update(t=performance.now()){let e;if(t>this.lastTime){if(e=this.elapsedMS=t-this.lastTime,e>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS){const r=t-this._lastFrame|0;if(r<this._minElapsedMS)return;this._lastFrame=t-r%this._minElapsedMS}this.deltaMS=e,this.deltaTime=this.deltaMS*Ct.targetFPMS;const s=this._head;let n=s.next;for(;n;)n=n.emit(this);s.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=t}get FPS(){return 1e3/this.elapsedMS}get minFPS(){return 1e3/this._maxElapsedMS}set minFPS(t){const e=Math.min(Math.max(0,t)/1e3,Ct.targetFPMS);this._maxElapsedMS=1/e,this._minElapsedMS&&t>this.maxFPS&&(this.maxFPS=t)}get maxFPS(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0}set maxFPS(t){t===0?this._minElapsedMS=0:(t<this.minFPS&&(this.minFPS=t),this._minElapsedMS=1/(t/1e3))}static get shared(){if(!Ct._shared){const t=Ct._shared=new Ct;t.autoStart=!0,t._protected=!0}return Ct._shared}static get system(){if(!Ct._system){const t=Ct._system=new Ct;t.autoStart=!0,t._protected=!0}return Ct._system}};Or.targetFPMS=.06;let ge=Or,Ks;async function sh(){return Ks??(Ks=(async()=>{const t=ct.get().createCanvas(1,1).getContext("webgl");if(!t)return"premultiply-alpha-on-upload";const e=await new Promise(o=>{const a=document.createElement("video");a.onloadeddata=()=>o(a),a.onerror=()=>o(null),a.autoplay=!1,a.crossOrigin="anonymous",a.preload="auto",a.src="data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=",a.load()});if(!e)return"premultiply-alpha-on-upload";const s=t.createTexture();t.bindTexture(t.TEXTURE_2D,s);const n=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,n),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,s,0),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,t.NONE),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,e);const r=new Uint8Array(4);return t.readPixels(0,0,1,1,t.RGBA,t.UNSIGNED_BYTE,r),t.deleteFramebuffer(n),t.deleteTexture(s),t.getExtension("WEBGL_lose_context")?.loseContext(),r[0]<=r[3]?"premultiplied-alpha":"premultiply-alpha-on-upload"})()),Ks}const Ws=class Ur extends Rt{constructor(t){super(t),this.isReady=!1,this.uploadMethodId="video",t={...Ur.defaultOptions,...t},this._autoUpdate=!0,this._isConnectedToTicker=!1,this._updateFPS=t.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=t.autoPlay!==!1,this.alphaMode=t.alphaMode??"premultiply-alpha-on-upload",this._videoFrameRequestCallback=this._videoFrameRequestCallback.bind(this),this._videoFrameRequestCallbackHandle=null,this._load=null,this._resolve=null,this._reject=null,this._onCanPlay=this._onCanPlay.bind(this),this._onCanPlayThrough=this._onCanPlayThrough.bind(this),this._onError=this._onError.bind(this),this._onPlayStart=this._onPlayStart.bind(this),this._onPlayStop=this._onPlayStop.bind(this),this._onSeeked=this._onSeeked.bind(this),this._onLoadedMetadata=this._onLoadedMetadata.bind(this),t.autoLoad!==!1&&this.load()}updateFrame(){if(!this.destroyed){if(this._updateFPS){const t=ge.shared.elapsedMS*this.resource.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-t)}(!this._updateFPS||this._msToNextUpdate<=0)&&(this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0),this.isValid&&this.update()}}_videoFrameRequestCallback(){this.updateFrame(),this.destroyed?this._videoFrameRequestCallbackHandle=null:this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback)}get isValid(){return!!this.resource.videoWidth&&!!this.resource.videoHeight}async load(){if(this._load)return this._load;const t=this.resource,e=this.options;return(t.readyState===t.HAVE_ENOUGH_DATA||t.readyState===t.HAVE_FUTURE_DATA)&&t.width&&t.height&&(t.complete=!0),t.addEventListener("play",this._onPlayStart),t.addEventListener("pause",this._onPlayStop),t.addEventListener("seeked",this._onSeeked),this._isSourceReady()?this._mediaReady():(e.preload||t.addEventListener("canplay",this._onCanPlay),t.addEventListener("canplaythrough",this._onCanPlayThrough),t.addEventListener("error",this._onError,!0)),this.isValid||t.addEventListener("loadedmetadata",this._onLoadedMetadata),this.alphaMode=await sh(),this._load=new Promise((s,n)=>{this.isValid?s(this):(this._resolve=s,this._reject=n,e.preloadTimeoutMs!==void 0&&(this._preloadTimeout=setTimeout(()=>{this._onError(new ErrorEvent(`Preload exceeded timeout of ${e.preloadTimeoutMs}ms`))})),t.load())}),this._load}_onError(t){this.resource.removeEventListener("error",this._onError,!0),this.emit("error",t),this._reject&&(this._reject(t),this._reject=null,this._resolve=null)}_isSourcePlaying(){const t=this.resource;return!t.paused&&!t.ended}_isSourceReady(){return this.resource.readyState>2}_onPlayStart(){this._configureAutoUpdate()}_onPlayStop(){this._configureAutoUpdate()}_onSeeked(){this._autoUpdate&&!this._isSourcePlaying()&&(this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0)}_onLoadedMetadata(){this.isValid&&this._mediaReady()}_onCanPlay(){this.resource.removeEventListener("canplay",this._onCanPlay),this._mediaReady()}_onCanPlayThrough(){this.resource.removeEventListener("canplaythrough",this._onCanPlayThrough),this._preloadTimeout&&(clearTimeout(this._preloadTimeout),this._preloadTimeout=void 0),this._mediaReady()}_mediaReady(){const t=this.resource;this.isValid&&(this.isReady=!0,this.resize(t.videoWidth,t.videoHeight)),this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0,this._resolve&&this.isValid&&(this._resolve(this),this._resolve=null,this._reject=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&this.resource.play()}destroy(){this._configureAutoUpdate();const t=this.resource;t&&(t.removeEventListener("play",this._onPlayStart),t.removeEventListener("pause",this._onPlayStop),t.removeEventListener("seeked",this._onSeeked),t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlayThrough),t.removeEventListener("loadedmetadata",this._onLoadedMetadata),t.removeEventListener("error",this._onError,!0),t.pause(),t.src="",t.load()),super.destroy()}get autoUpdate(){return this._autoUpdate}set autoUpdate(t){t!==this._autoUpdate&&(this._autoUpdate=t,this._configureAutoUpdate())}get updateFPS(){return this._updateFPS}set updateFPS(t){t!==this._updateFPS&&(this._updateFPS=t,this._configureAutoUpdate())}_configureAutoUpdate(){this._autoUpdate&&this._isSourcePlaying()?!this._updateFPS&&this.resource.requestVideoFrameCallback?(this._isConnectedToTicker&&(ge.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0),this._videoFrameRequestCallbackHandle===null&&(this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback))):(this._videoFrameRequestCallbackHandle!==null&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker||(ge.shared.add(this.updateFrame,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(this._videoFrameRequestCallbackHandle!==null&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(ge.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(t){return globalThis.HTMLVideoElement&&t instanceof HTMLVideoElement}};Ws.extension=H.TextureSource;Ws.defaultOptions={...Rt.defaultOptions,autoLoad:!0,autoPlay:!0,updateFPS:0,crossorigin:!0,loop:!1,muted:!0,playsinline:!0,preload:!1};Ws.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};let ih=Ws;const Se=(i,t,e=!1)=>(Array.isArray(i)||(i=[i]),t?i.map(s=>typeof s=="string"||e?t(s):s):i);class nh{constructor(){this._parsers=[],this._cache=new Map,this._cacheMap=new Map}reset(){this._cacheMap.clear(),this._cache.clear()}has(t){return this._cache.has(t)}get(t){const e=this._cache.get(t);return e||bt(`[Assets] Asset id ${t} was not found in the Cache`),e}set(t,e){const s=Se(t);let n;for(let h=0;h<this.parsers.length;h++){const l=this.parsers[h];if(l.test(e)){n=l.getCacheableAssets(s,e);break}}const r=new Map(Object.entries(n||{}));n||s.forEach(h=>{r.set(h,e)});const o=[...r.keys()],a={cacheKeys:o,keys:s};s.forEach(h=>{this._cacheMap.set(h,a)}),o.forEach(h=>{const l=n?n[h]:e;this._cache.has(h)&&this._cache.get(h)!==l&&bt("[Cache] already has key:",h),this._cache.set(h,r.get(h))})}remove(t){if(!this._cacheMap.has(t)){bt(`[Assets] Asset id ${t} was not found in the Cache`);return}const e=this._cacheMap.get(t);e.cacheKeys.forEach(n=>{this._cache.delete(n)}),e.keys.forEach(n=>{this._cacheMap.delete(n)})}get parsers(){return this._parsers}}const Ce=new nh,yi=[];ht.handleByList(H.TextureSource,yi);function Yr(i={}){const t=i&&i.resource,e=t?i.resource:i,s=t?i:{resource:i};for(let n=0;n<yi.length;n++){const r=yi[n];if(r.test(e))return new r(s)}throw new Error(`Could not find a source type for resource: ${s.resource}`)}function rh(i={},t=!1){const e=i&&i.resource,s=e?i.resource:i,n=e?i:{resource:i};if(!t&&Ce.has(s))return Ce.get(s);const r=new K({source:Yr(n)});return r.on("destroy",()=>{Ce.has(s)&&Ce.remove(s)}),t||Ce.set(s,r),r}function oh(i,t=!1){return typeof i=="string"?Ce.get(i):i instanceof Rt?new K({source:i}):rh(i,t)}K.from=oh;Rt.from=Yr;ht.add(Dr,Lr,zr,ih,As,Hr,Bi);var Nr=(i=>(i[i.Low=0]="Low",i[i.Normal=1]="Normal",i[i.High=2]="High",i))(Nr||{});function Ft(i){if(typeof i!="string")throw new TypeError(`Path must be a string. Received ${JSON.stringify(i)}`)}function Ge(i){return i.split("?")[0].split("#")[0]}function ah(i){return i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function hh(i,t,e){return i.replace(new RegExp(ah(t),"g"),e)}function lh(i,t){let e="",s=0,n=-1,r=0,o=-1;for(let a=0;a<=i.length;++a){if(a<i.length)o=i.charCodeAt(a);else{if(o===47)break;o=47}if(o===47){if(!(n===a-1||r===1))if(n!==a-1&&r===2){if(e.length<2||s!==2||e.charCodeAt(e.length-1)!==46||e.charCodeAt(e.length-2)!==46){if(e.length>2){const h=e.lastIndexOf("/");if(h!==e.length-1){h===-1?(e="",s=0):(e=e.slice(0,h),s=e.length-1-e.lastIndexOf("/")),n=a,r=0;continue}}else if(e.length===2||e.length===1){e="",s=0,n=a,r=0;continue}}}else e.length>0?e+=`/${i.slice(n+1,a)}`:e=i.slice(n+1,a),s=a-n-1;n=a,r=0}else o===46&&r!==-1?++r:r=-1}return e}const Ze={toPosix(i){return hh(i,"\\","/")},isUrl(i){return/^https?:/.test(this.toPosix(i))},isDataUrl(i){return/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(i)},isBlobUrl(i){return i.startsWith("blob:")},hasProtocol(i){return/^[^/:]+:/.test(this.toPosix(i))},getProtocol(i){Ft(i),i=this.toPosix(i);const t=/^file:\/\/\//.exec(i);if(t)return t[0];const e=/^[^/:]+:\/{0,2}/.exec(i);return e?e[0]:""},toAbsolute(i,t,e){if(Ft(i),this.isDataUrl(i)||this.isBlobUrl(i))return i;const s=Ge(this.toPosix(t??ct.get().getBaseUrl())),n=Ge(this.toPosix(e??this.rootname(s)));return i=this.toPosix(i),i.startsWith("/")?Ze.join(n,i.slice(1)):this.isAbsolute(i)?i:this.join(s,i)},normalize(i){if(Ft(i),i.length===0)return".";if(this.isDataUrl(i)||this.isBlobUrl(i))return i;i=this.toPosix(i);let t="";const e=i.startsWith("/");this.hasProtocol(i)&&(t=this.rootname(i),i=i.slice(t.length));const s=i.endsWith("/");return i=lh(i),i.length>0&&s&&(i+="/"),e?`/${i}`:t+i},isAbsolute(i){return Ft(i),i=this.toPosix(i),this.hasProtocol(i)?!0:i.startsWith("/")},join(...i){if(i.length===0)return".";let t;for(let e=0;e<i.length;++e){const s=i[e];if(Ft(s),s.length>0)if(t===void 0)t=s;else{const n=i[e-1]??"";this.joinExtensions.includes(this.extname(n).toLowerCase())?t+=`/../${s}`:t+=`/${s}`}}return t===void 0?".":this.normalize(t)},dirname(i){if(Ft(i),i.length===0)return".";i=this.toPosix(i);let t=i.charCodeAt(0);const e=t===47;let s=-1,n=!0;const r=this.getProtocol(i),o=i;i=i.slice(r.length);for(let a=i.length-1;a>=1;--a)if(t=i.charCodeAt(a),t===47){if(!n){s=a;break}}else n=!1;return s===-1?e?"/":this.isUrl(o)?r+i:r:e&&s===1?"//":r+i.slice(0,s)},rootname(i){Ft(i),i=this.toPosix(i);let t="";if(i.startsWith("/")?t="/":t=this.getProtocol(i),this.isUrl(i)){const e=i.indexOf("/",t.length);e!==-1?t=i.slice(0,e):t=i,t.endsWith("/")||(t+="/")}return t},basename(i,t){Ft(i),t&&Ft(t),i=Ge(this.toPosix(i));let e=0,s=-1,n=!0,r;if(t!==void 0&&t.length>0&&t.length<=i.length){if(t.length===i.length&&t===i)return"";let o=t.length-1,a=-1;for(r=i.length-1;r>=0;--r){const h=i.charCodeAt(r);if(h===47){if(!n){e=r+1;break}}else a===-1&&(n=!1,a=r+1),o>=0&&(h===t.charCodeAt(o)?--o===-1&&(s=r):(o=-1,s=a))}return e===s?s=a:s===-1&&(s=i.length),i.slice(e,s)}for(r=i.length-1;r>=0;--r)if(i.charCodeAt(r)===47){if(!n){e=r+1;break}}else s===-1&&(n=!1,s=r+1);return s===-1?"":i.slice(e,s)},extname(i){Ft(i),i=Ge(this.toPosix(i));let t=-1,e=0,s=-1,n=!0,r=0;for(let o=i.length-1;o>=0;--o){const a=i.charCodeAt(o);if(a===47){if(!n){e=o+1;break}continue}s===-1&&(n=!1,s=o+1),a===46?t===-1?t=o:r!==1&&(r=1):t!==-1&&(r=-1)}return t===-1||s===-1||r===0||r===1&&t===s-1&&t===e+1?"":i.slice(t,s)},parse(i){Ft(i);const t={root:"",dir:"",base:"",ext:"",name:""};if(i.length===0)return t;i=Ge(this.toPosix(i));let e=i.charCodeAt(0);const s=this.isAbsolute(i);let n;t.root=this.rootname(i),s||this.hasProtocol(i)?n=1:n=0;let r=-1,o=0,a=-1,h=!0,l=i.length-1,c=0;for(;l>=n;--l){if(e=i.charCodeAt(l),e===47){if(!h){o=l+1;break}continue}a===-1&&(h=!1,a=l+1),e===46?r===-1?r=l:c!==1&&(c=1):r!==-1&&(c=-1)}return r===-1||a===-1||c===0||c===1&&r===a-1&&r===o+1?a!==-1&&(o===0&&s?t.base=t.name=i.slice(1,a):t.base=t.name=i.slice(o,a)):(o===0&&s?(t.name=i.slice(1,r),t.base=i.slice(1,a)):(t.name=i.slice(o,r),t.base=i.slice(o,a)),t.ext=i.slice(r,a)),t.dir=this.dirname(i),t},sep:"/",delimiter:":",joinExtensions:[".html"]};function Xr(i,t,e,s,n){const r=t[e];for(let o=0;o<r.length;o++){const a=r[o];e<t.length-1?Xr(i.replace(s[e],a),t,e+1,s,n):n.push(i.replace(s[e],a))}}function ch(i){const t=/\{(.*?)\}/g,e=i.match(t),s=[];if(e){const n=[];e.forEach(r=>{const o=r.substring(1,r.length-1).split(",");n.push(o)}),Xr(i,n,0,e,s)}else s.push(i);return s}const vn=i=>!Array.isArray(i);class Vr{constructor(){this._defaultBundleIdentifierOptions={connector:"-",createBundleAssetId:(t,e)=>`${t}${this._bundleIdConnector}${e}`,extractAssetIdFromBundle:(t,e)=>e.replace(`${t}${this._bundleIdConnector}`,"")},this._bundleIdConnector=this._defaultBundleIdentifierOptions.connector,this._createBundleAssetId=this._defaultBundleIdentifierOptions.createBundleAssetId,this._extractAssetIdFromBundle=this._defaultBundleIdentifierOptions.extractAssetIdFromBundle,this._assetMap={},this._preferredOrder=[],this._parsers=[],this._resolverHash={},this._bundles={}}setBundleIdentifier(t){if(this._bundleIdConnector=t.connector??this._bundleIdConnector,this._createBundleAssetId=t.createBundleAssetId??this._createBundleAssetId,this._extractAssetIdFromBundle=t.extractAssetIdFromBundle??this._extractAssetIdFromBundle,this._extractAssetIdFromBundle("foo",this._createBundleAssetId("foo","bar"))!=="bar")throw new Error("[Resolver] GenerateBundleAssetId are not working correctly")}prefer(...t){t.forEach(e=>{this._preferredOrder.push(e),e.priority||(e.priority=Object.keys(e.params))}),this._resolverHash={}}set basePath(t){this._basePath=t}get basePath(){return this._basePath}set rootPath(t){this._rootPath=t}get rootPath(){return this._rootPath}get parsers(){return this._parsers}reset(){this.setBundleIdentifier(this._defaultBundleIdentifierOptions),this._assetMap={},this._preferredOrder=[],this._resolverHash={},this._rootPath=null,this._basePath=null,this._manifest=null,this._bundles={},this._defaultSearchParams=null}setDefaultSearchParams(t){if(typeof t=="string")this._defaultSearchParams=t;else{const e=t;this._defaultSearchParams=Object.keys(e).map(s=>`${encodeURIComponent(s)}=${encodeURIComponent(e[s])}`).join("&")}}getAlias(t){const{alias:e,src:s}=t;return Se(e||s,r=>typeof r=="string"?r:Array.isArray(r)?r.map(o=>o?.src??o):r?.src?r.src:r,!0)}removeAlias(t,e){this._assetMap[t]&&(e&&e!==this._resolverHash[t]||(delete this._resolverHash[t],delete this._assetMap[t]))}addManifest(t){this._manifest&&bt("[Resolver] Manifest already exists, this will be overwritten"),this._manifest=t,t.bundles.forEach(e=>{this.addBundle(e.name,e.assets)})}addBundle(t,e){const s=[];let n=e;Array.isArray(e)||(n=Object.entries(e).map(([r,o])=>typeof o=="string"||Array.isArray(o)?{alias:r,src:o}:{alias:r,...o})),n.forEach(r=>{const o=r.src,a=r.alias;let h;if(typeof a=="string"){const l=this._createBundleAssetId(t,a);s.push(l),h=[a,l]}else{const l=a.map(c=>this._createBundleAssetId(t,c));s.push(...l),h=[...a,...l]}this.add({...r,alias:h,src:o})}),this._bundles[t]=s}add(t){const e=[];Array.isArray(t)?e.push(...t):e.push(t);let s;s=r=>{this.hasKey(r)&&bt(`[Resolver] already has key: ${r} overwriting`)},Se(e).forEach(r=>{const{src:o}=r;let{data:a,format:h,loadParser:l,parser:c}=r;const u=Se(o).map(x=>typeof x=="string"?ch(x):Array.isArray(x)?x:[x]),f=this.getAlias(r);Array.isArray(f)?f.forEach(s):s(f);const d=[],p=x=>{const g=this._parsers.find(m=>m.test(x));return{src:x,...g?.parse(x)}};u.forEach(x=>{x.forEach(g=>{let m={};if(typeof g!="object"?m=p(g):(a=g.data??a,h=g.format??h,(g.loadParser||g.parser)&&(l=g.loadParser??l,c=g.parser??c),m={...p(g.src),...g}),!f)throw new Error(`[Resolver] alias is undefined for this asset: ${m.src}`);m=this._buildResolvedAsset(m,{aliases:f,data:a,format:h,loadParser:l,parser:c,progressSize:r.progressSize}),d.push(m)})}),f.forEach(x=>{this._assetMap[x]=d})})}resolveBundle(t){const e=vn(t);t=Se(t);const s={};return t.forEach(n=>{const r=this._bundles[n];if(r){const o=this.resolve(r),a={};for(const h in o){const l=o[h];a[this._extractAssetIdFromBundle(n,h)]=l}s[n]=a}}),e?s[t[0]]:s}resolveUrl(t){const e=this.resolve(t);if(typeof t!="string"){const s={};for(const n in e)s[n]=e[n].src;return s}return e.src}resolve(t){const e=vn(t);t=Se(t);const s={};return t.forEach(n=>{if(!this._resolverHash[n])if(this._assetMap[n]){let r=this._assetMap[n];const o=this._getPreferredOrder(r);o?.priority.forEach(a=>{o.params[a].forEach(h=>{const l=r.filter(c=>c[a]?c[a]===h:!1);l.length&&(r=l)})}),this._resolverHash[n]=r[0]}else this._resolverHash[n]=this._buildResolvedAsset({alias:[n],src:n},{});s[n]=this._resolverHash[n]}),e?s[t[0]]:s}hasKey(t){return!!this._assetMap[t]}hasBundle(t){return!!this._bundles[t]}_getPreferredOrder(t){for(let e=0;e<t.length;e++){const s=t[e],n=this._preferredOrder.find(r=>r.params.format.includes(s.format));if(n)return n}return this._preferredOrder[0]}_appendDefaultSearchParams(t){if(!this._defaultSearchParams)return t;const e=/\?/.test(t)?"&":"?";return`${t}${e}${this._defaultSearchParams}`}_buildResolvedAsset(t,e){const{aliases:s,data:n,loadParser:r,parser:o,format:a,progressSize:h}=e;return(this._basePath||this._rootPath)&&(t.src=Ze.toAbsolute(t.src,this._basePath,this._rootPath)),t.alias=s??t.alias??[t.src],t.src=this._appendDefaultSearchParams(t.src),t.data={...n||{},...t.data},t.loadParser=r??t.loadParser,t.parser=o??t.parser,t.format=a??t.format??uh(t.src),h!==void 0&&(t.progressSize=h),t}}Vr.RETINA_PREFIX=/@([0-9\.]+)x/;function uh(i){return i.split(".").pop().split("?").shift().split("#").shift()}const Sn=(i,t)=>{const e=t.split("?")[1];return e&&(i+=`?${e}`),i},$r=class Ye{constructor(t,e){this.linkedSheets=[];let s=t;t?.source instanceof Rt&&(s={texture:t,data:e});const{texture:n,data:r,cachePrefix:o=""}=s;this.cachePrefix=o,this._texture=n instanceof K?n:null,this.textureSource=n.source,this.textures={},this.animations={},this.data=r;const a=parseFloat(r.meta.scale);a?(this.resolution=a,n.source.resolution=this.resolution):this.resolution=n.source._resolution,this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}parse(){return new Promise(t=>{this._callback=t,this._batchIndex=0,this._frameKeys.length<=Ye.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()})}parseSync(){return this._processFrames(0,!0),this._processAnimations(),this.textures}_processFrames(t,e=!1){let s=t;const n=e?1/0:Ye.BATCH_SIZE;for(;s-t<n&&s<this._frameKeys.length;){const r=this._frameKeys[s],o=this._frames[r],a=o.frame;if(a){let h=null,l=null;const c=o.trimmed!==!1&&o.sourceSize?o.sourceSize:o.frame,u=new Q(0,0,Math.floor(c.w)/this.resolution,Math.floor(c.h)/this.resolution);o.rotated?h=new Q(Math.floor(a.x)/this.resolution,Math.floor(a.y)/this.resolution,Math.floor(a.h)/this.resolution,Math.floor(a.w)/this.resolution):h=new Q(Math.floor(a.x)/this.resolution,Math.floor(a.y)/this.resolution,Math.floor(a.w)/this.resolution,Math.floor(a.h)/this.resolution),o.trimmed!==!1&&o.spriteSourceSize&&(l=new Q(Math.floor(o.spriteSourceSize.x)/this.resolution,Math.floor(o.spriteSourceSize.y)/this.resolution,Math.floor(a.w)/this.resolution,Math.floor(a.h)/this.resolution)),this.textures[r]=new K({source:this.textureSource,frame:h,orig:u,trim:l,rotate:o.rotated?2:0,defaultAnchor:o.anchor,defaultBorders:o.borders,label:r.toString()})}s++}}_processAnimations(){const t=this.data.animations||{};for(const e in t){this.animations[e]=[];for(let s=0;s<t[e].length;s++){const n=t[e][s];this.animations[e].push(this.textures[n])}}}_parseComplete(){const t=this._callback;this._callback=null,this._batchIndex=0,t.call(this,this.textures)}_nextBatch(){this._processFrames(this._batchIndex*Ye.BATCH_SIZE),this._batchIndex++,setTimeout(()=>{this._batchIndex*Ye.BATCH_SIZE<this._frameKeys.length?this._nextBatch():(this._processAnimations(),this._parseComplete())},0)}destroy(t=!1){for(const e in this.textures)this.textures[e].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,t&&(this._texture?.destroy(),this.textureSource.destroy()),this._texture=null,this.textureSource=null,this.linkedSheets=[]}};$r.BATCH_SIZE=1e3;let Cn=$r;const dh=["jpg","png","jpeg","avif","webp","basis","etc2","bc7","bc6h","bc5","bc4","bc3","bc2","bc1","eac","astc"];function jr(i,t,e){const s={};if(i.forEach(n=>{s[n]=t}),Object.keys(t.textures).forEach(n=>{s[`${t.cachePrefix}${n}`]=t.textures[n]}),!e){const n=Ze.dirname(i[0]);t.linkedSheets.forEach((r,o)=>{const a=jr([`${n}/${t.data.meta.related_multi_packs[o]}`],r,!0);Object.assign(s,a)})}return s}const fh={extension:H.Asset,cache:{test:i=>i instanceof Cn,getCacheableAssets:(i,t)=>jr(i,t,!1)},resolver:{extension:{type:H.ResolveParser,name:"resolveSpritesheet"},test:i=>{const e=i.split("?")[0].split("."),s=e.pop(),n=e.pop();return s==="json"&&dh.includes(n)},parse:i=>{const t=i.split(".");return{resolution:parseFloat(Vr.RETINA_PREFIX.exec(i)?.[1]??"1"),format:t[t.length-2],src:i}}},loader:{name:"spritesheetLoader",id:"spritesheet",extension:{type:H.LoadParser,priority:Nr.Normal,name:"spritesheetLoader"},async testParse(i,t){return Ze.extname(t.src).toLowerCase()===".json"&&!!i.frames},async parse(i,t,e){const{texture:s,imageFilename:n,textureOptions:r,cachePrefix:o}=t?.data??{};let a=Ze.dirname(t.src);a&&a.lastIndexOf("/")!==a.length-1&&(a+="/");let h;if(s instanceof K)h=s;else{const u=Sn(a+(n??i.meta.image),t.src);h=(await e.load([{src:u,data:r}]))[u]}const l=new Cn({texture:h.source,data:i,cachePrefix:o});await l.parse();const c=i?.meta?.related_multi_packs;if(Array.isArray(c)){const u=[];for(const d of c){if(typeof d!="string")continue;let p=a+d;t.data?.ignoreMultiPack||(p=Sn(p,t.src),u.push(e.load({src:p,data:{textureOptions:r,ignoreMultiPack:!0}})))}const f=await Promise.all(u);l.linkedSheets=f,f.forEach(d=>{d.linkedSheets=[l].concat(l.linkedSheets.filter(p=>p!==d))})}return l},async unload(i,t,e){await e.unload(i.textureSource._sourceOrigin),i.destroy(!1)}}};ht.add(fh);const Zs=Object.create(null),Mn=Object.create(null);function Di(i,t){let e=Mn[i];return e===void 0&&(Zs[t]===void 0&&(Zs[t]=1),Mn[i]=e=Zs[t]++),e}let ms;function qr(){return(!ms||ms?.isContextLost())&&(ms=ct.get().createCanvas().getContext("webgl",{})),ms}let xs;function ph(){if(!xs){xs="mediump";const i=qr();i&&i.getShaderPrecisionFormat&&(xs=i.getShaderPrecisionFormat(i.FRAGMENT_SHADER,i.HIGH_FLOAT).precision?"highp":"mediump")}return xs}function gh(i,t,e){return t?i:e?(i=i.replace("out vec4 finalColor;",""),`
|
|
@@ -20,7 +20,7 @@ Deprecated since v${i}`,r=typeof console.groupCollapsed=="function"&&!Me.noColor
|
|
|
20
20
|
`}function mh(i,t,e){const s=e?t.maxSupportedFragmentPrecision:t.maxSupportedVertexPrecision;if(i.substring(0,9)!=="precision"){let n=e?t.requestedFragmentPrecision:t.requestedVertexPrecision;return n==="highp"&&s!=="highp"&&(n="mediump"),`precision ${n} float;
|
|
21
21
|
${i}`}else if(s!=="highp"&&i.substring(0,15)==="precision highp")return i.replace("precision highp","precision mediump");return i}function xh(i,t){return t?`#version 300 es
|
|
22
22
|
${i}`:i}const yh={},_h={};function bh(i,{name:t="pixi-program"},e=!0){t=t.replace(/\s+/g,"-"),t+=e?"-fragment":"-vertex";const s=e?yh:_h;return s[t]?(s[t]++,t+=`-${s[t]}`):s[t]=1,i.indexOf("#define SHADER_NAME")!==-1?i:`${`#define SHADER_NAME ${t}`}
|
|
23
|
-
${i}`}function wh(i,t){return t?i.replace("#version 300 es",""):i}const Qs={stripVersion:wh,ensurePrecision:mh,addProgramDefines:gh,setProgramName:bh,insertVersion:xh},Fe=Object.create(null),Kr=class _i{constructor(t){t={..._i.defaultOptions,...t};const e=t.fragment.indexOf("#version 300 es")!==-1,s={stripVersion:e,ensurePrecision:{requestedFragmentPrecision:t.preferredFragmentPrecision,requestedVertexPrecision:t.preferredVertexPrecision,maxSupportedVertexPrecision:"highp",maxSupportedFragmentPrecision:ph()},setProgramName:{name:t.name},addProgramDefines:e,insertVersion:e};let n=t.fragment,r=t.vertex;Object.keys(Qs).forEach(o=>{const a=s[o];n=Qs[o](n,a,!0),r=Qs[o](r,a,!1)}),this.fragment=n,this.vertex=r,this.transformFeedbackVaryings=t.transformFeedbackVaryings,this._key=Di(`${this.vertex}:${this.fragment}`,"gl-program")}destroy(){this.fragment=null,this.vertex=null,this._attributeData=null,this._uniformData=null,this._uniformBlockData=null,this.transformFeedbackVaryings=null,Fe[this._cacheKey]=null}static from(t){const e=`${t.vertex}:${t.fragment}`;return Fe[e]||(Fe[e]=new _i(t),Fe[e]._cacheKey=e),Fe[e]}};Kr.defaultOptions={preferredVertexPrecision:"highp",preferredFragmentPrecision:"mediump"};let Zr=Kr;const Tn={uint8x2:{size:2,stride:2,normalised:!1},uint8x4:{size:4,stride:4,normalised:!1},sint8x2:{size:2,stride:2,normalised:!1},sint8x4:{size:4,stride:4,normalised:!1},unorm8x2:{size:2,stride:2,normalised:!0},unorm8x4:{size:4,stride:4,normalised:!0},snorm8x2:{size:2,stride:2,normalised:!0},snorm8x4:{size:4,stride:4,normalised:!0},uint16x2:{size:2,stride:4,normalised:!1},uint16x4:{size:4,stride:8,normalised:!1},sint16x2:{size:2,stride:4,normalised:!1},sint16x4:{size:4,stride:8,normalised:!1},unorm16x2:{size:2,stride:4,normalised:!0},unorm16x4:{size:4,stride:8,normalised:!0},snorm16x2:{size:2,stride:4,normalised:!0},snorm16x4:{size:4,stride:8,normalised:!0},float16x2:{size:2,stride:4,normalised:!1},float16x4:{size:4,stride:8,normalised:!1},float32:{size:1,stride:4,normalised:!1},float32x2:{size:2,stride:8,normalised:!1},float32x3:{size:3,stride:12,normalised:!1},float32x4:{size:4,stride:16,normalised:!1},uint32:{size:1,stride:4,normalised:!1},uint32x2:{size:2,stride:8,normalised:!1},uint32x3:{size:3,stride:12,normalised:!1},uint32x4:{size:4,stride:16,normalised:!1},sint32:{size:1,stride:4,normalised:!1},sint32x2:{size:2,stride:8,normalised:!1},sint32x3:{size:3,stride:12,normalised:!1},sint32x4:{size:4,stride:16,normalised:!1}};function vh(i){return Tn[i]??Tn.float32}const Sh={f32:"float32","vec2<f32>":"float32x2","vec3<f32>":"float32x3","vec4<f32>":"float32x4",vec2f:"float32x2",vec3f:"float32x3",vec4f:"float32x4",i32:"sint32","vec2<i32>":"sint32x2","vec3<i32>":"sint32x3","vec4<i32>":"sint32x4",vec2i:"sint32x2",vec3i:"sint32x3",vec4i:"sint32x4",u32:"uint32","vec2<u32>":"uint32x2","vec3<u32>":"uint32x3","vec4<u32>":"uint32x4",vec2u:"uint32x2",vec3u:"uint32x3",vec4u:"uint32x4",bool:"uint32","vec2<bool>":"uint32x2","vec3<bool>":"uint32x3","vec4<bool>":"uint32x4"},An=/@location\((\d+)\)\s+([a-zA-Z0-9_]+)\s*:\s*([a-zA-Z0-9_<>]+)(?:,|\s|\)|$)/g;function Pn(i,t){let e;for(;(e=An.exec(i))!==null;){const s=Sh[e[3]]??"float32";t[e[2]]={location:parseInt(e[1],10),format:s,stride:vh(s).stride,offset:0,instance:!1,start:0}}An.lastIndex=0}function Ch(i){return i.replace(/\/\/.*$/gm,"").replace(/\/\*[\s\S]*?\*\//g,"")}function Mh({source:i,entryPoint:t}){const e={},s=Ch(i),n=s.indexOf(`fn ${t}(`);if(n===-1)return e;const r=s.indexOf("->",n);if(r===-1)return e;const o=s.substring(n,r);if(Pn(o,e),Object.keys(e).length===0){const a=o.match(/\(\s*\w+\s*:\s*(\w+)/);if(a){const h=a[1],l=new RegExp(`struct\\s+${h}\\s*\\{([^}]+)\\}`,"s"),c=s.match(l);c&&Pn(c[1],e)}}return e}function Js(i){const t=/(^|[^/])@(group|binding)\(\d+\)[^;]+;/g,e=/@group\((\d+)\)/,s=/@binding\((\d+)\)/,n=/var(<[^>]+>)? (\w+)/,r=/:\s*([\w<>]+)/,o=/struct\s+(\w+)\s*{([^}]+)}/g,a=/(\w+)\s*:\s*([\w\<\>]+)/g,h=/struct\s+(\w+)/,l=i.match(t)?.map(u=>({group:parseInt(u.match(e)[1],10),binding:parseInt(u.match(s)[1],10),name:u.match(n)[2],isUniform:u.match(n)[1]==="<uniform>",type:u.match(r)[1]}));if(!l)return{groups:[],structs:[]};const c=i.match(o)?.map(u=>{const f=u.match(h)[1],d=u.match(a).reduce((p,x)=>{const[g,m]=x.split(":");return p[g.trim()]=m.trim(),p},{});return d?{name:f,members:d}:null}).filter(({name:u})=>l.some(f=>f.type===u||f.type.includes(`<${u}>`)))??[];return{groups:l,structs:c}}var fe=(i=>(i[i.VERTEX=1]="VERTEX",i[i.FRAGMENT=2]="FRAGMENT",i[i.COMPUTE=4]="COMPUTE",i))(fe||{});function Th({groups:i}){const t=[];for(let e=0;e<i.length;e++){const s=i[e];t[s.group]||(t[s.group]=[]),s.isUniform?t[s.group].push({binding:s.binding,visibility:fe.VERTEX|fe.FRAGMENT,buffer:{type:"uniform"}}):s.type==="sampler"?t[s.group].push({binding:s.binding,visibility:fe.FRAGMENT,sampler:{type:"filtering"}}):s.type==="texture_2d"||s.type.startsWith("texture_2d<")?t[s.group].push({binding:s.binding,visibility:fe.FRAGMENT,texture:{sampleType:"float",viewDimension:"2d",multisampled:!1}}):s.type==="texture_2d_array"||s.type.startsWith("texture_2d_array<")?t[s.group].push({binding:s.binding,visibility:fe.FRAGMENT,texture:{sampleType:"float",viewDimension:"2d-array",multisampled:!1}}):(s.type==="texture_cube"||s.type.startsWith("texture_cube<"))&&t[s.group].push({binding:s.binding,visibility:fe.FRAGMENT,texture:{sampleType:"float",viewDimension:"cube",multisampled:!1}})}for(let e=0;e<t.length;e++)t[e]||(t[e]=[]);return t}function Ah({groups:i}){const t=[];for(let e=0;e<i.length;e++){const s=i[e];t[s.group]||(t[s.group]={}),t[s.group][s.name]=s.binding}return t}function Ph(i,t){const e=new Set,s=new Set,n=[...i.structs,...t.structs].filter(o=>e.has(o.name)?!1:(e.add(o.name),!0)),r=[...i.groups,...t.groups].filter(o=>{const a=`${o.name}-${o.binding}`;return s.has(a)?!1:(s.add(a),!0)});return{structs:n,groups:r}}const De=Object.create(null);class Gs{constructor(t){this._layoutKey=0,this._attributeLocationsKey=0;const{fragment:e,vertex:s,layout:n,gpuLayout:r,name:o}=t;if(this.name=o,this.fragment=e,this.vertex=s,e.source===s.source){const a=Js(e.source);this.structsAndGroups=a}else{const a=Js(s.source),h=Js(e.source);this.structsAndGroups=Ph(a,h)}this.layout=n??Ah(this.structsAndGroups),this.gpuLayout=r??Th(this.structsAndGroups),this.autoAssignGlobalUniforms=this.layout[0]?.globalUniforms!==void 0,this.autoAssignLocalUniforms=this.layout[1]?.localUniforms!==void 0,this._generateProgramKey()}_generateProgramKey(){const{vertex:t,fragment:e}=this,s=t.source+e.source+t.entryPoint+e.entryPoint;this._layoutKey=Di(s,"program")}get attributeData(){return this._attributeData??(this._attributeData=Mh(this.vertex)),this._attributeData}destroy(){this.gpuLayout=null,this.layout=null,this.structsAndGroups=null,this.fragment=null,this.vertex=null,De[this._cacheKey]=null}static from(t){const e=`${t.vertex.source}:${t.fragment.source}:${t.fragment.entryPoint}:${t.vertex.entryPoint}`;return De[e]||(De[e]=new Gs(t),De[e]._cacheKey=e),De[e]}}const Qr=["f32","i32","vec2<f32>","vec3<f32>","vec4<f32>","mat2x2<f32>","mat3x3<f32>","mat4x4<f32>","mat3x2<f32>","mat4x2<f32>","mat2x3<f32>","mat4x3<f32>","mat2x4<f32>","mat3x4<f32>","vec2<i32>","vec3<i32>","vec4<i32>"],kh=Qr.reduce((i,t)=>(i[t]=!0,i),{});function Ih(i,t){switch(i){case"f32":return 0;case"vec2<f32>":return new Float32Array(2*t);case"vec3<f32>":return new Float32Array(3*t);case"vec4<f32>":return new Float32Array(4*t);case"mat2x2<f32>":return new Float32Array([1,0,0,1]);case"mat3x3<f32>":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4x4<f32>":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}const Jr=class to{constructor(t,e){this._touched=0,this.uid=at("uniform"),this._resourceType="uniformGroup",this._resourceId=at("resource"),this.isUniformGroup=!0,this._dirtyId=0,this.destroyed=!1,e={...to.defaultOptions,...e},this.uniformStructures=t;const s={};for(const n in t){const r=t[n];if(r.name=n,r.size=r.size??1,!kh[r.type]){const o=r.type.match(/^array<(\w+(?:<\w+>)?),\s*(\d+)>$/);if(o){const[,a,h]=o;throw new Error(`Uniform type ${r.type} is not supported. Use type: '${a}', size: ${h} instead.`)}throw new Error(`Uniform type ${r.type} is not supported. Supported uniform types are: ${Qr.join(", ")}`)}r.value??(r.value=Ih(r.type,r.size)),s[n]=r.value}this.uniforms=s,this._dirtyId=1,this.ubo=e.ubo,this.isStatic=e.isStatic,this._signature=Di(Object.keys(s).map(n=>`${n}-${t[n].type}`).join("-"),"uniform-group")}update(){this._dirtyId++}};Jr.defaultOptions={ubo:!1,isStatic:!1};let eo=Jr;class Ts{constructor(t){this.resources=Object.create(null),this._dirty=!0;let e=0;for(const s in t){const n=t[s];this.setResource(n,e++)}this._updateKey()}_updateKey(){if(!this._dirty)return;this._dirty=!1;const t=[];let e=0;for(const s in this.resources)t[e++]=this.resources[s]._resourceId;this._key=t.join("|")}setResource(t,e){const s=this.resources[e];t!==s&&(s?.off?.("change",this.onResourceChange,this),t.on?.("change",this.onResourceChange,this),this.resources[e]=t,this._dirty=!0)}getResource(t){return this.resources[t]}_touch(t,e){const s=this.resources;for(const n in s)s[n]._gcLastUsed=t,s[n]._touched=e}destroy(){const t=this.resources;for(const e in t)t[e]?.off?.("change",this.onResourceChange,this);this.resources=null}onResourceChange(t){this._dirty=!0,t.destroyed?this.destroy():this._updateKey()}}var bi=(i=>(i[i.WEBGL=1]="WEBGL",i[i.WEBGPU=2]="WEBGPU",i[i.CANVAS=4]="CANVAS",i[i.BOTH=3]="BOTH",i))(bi||{});class Li extends Yt{constructor(t){super(),this.uid=at("shader"),this._uniformBindMap=Object.create(null),this._ownedBindGroups=[],this._destroyed=!1;let{gpuProgram:e,glProgram:s,groups:n,resources:r,compatibleRenderers:o,groupMap:a}=t;this.gpuProgram=e,this.glProgram=s,o===void 0&&(o=0,e&&(o|=bi.WEBGPU),s&&(o|=bi.WEBGL)),this.compatibleRenderers=o;const h={};if(!r&&!n&&(r={}),r&&n)throw new Error("[Shader] Cannot have both resources and groups");if(!e&&n&&!a)throw new Error("[Shader] No group map or WebGPU shader provided - consider using resources instead.");if(!e&&n&&a)for(const l in a)for(const c in a[l]){const u=a[l][c];h[u]={group:l,binding:c,name:u}}else if(e&&n&&!a){const l=e.structsAndGroups.groups;a={},l.forEach(c=>{a[c.group]=a[c.group]||{},a[c.group][c.binding]=c.name,h[c.name]=c})}else if(r){n={},a={},e&&e.structsAndGroups.groups.forEach(u=>{a[u.group]=a[u.group]||{},a[u.group][u.binding]=u.name,h[u.name]=u});let l=0;for(const c in r)h[c]||(n[99]||(n[99]=new Ts,this._ownedBindGroups.push(n[99])),h[c]={group:99,binding:l,name:c},a[99]=a[99]||{},a[99][l]=c,l++);for(const c in r){const u=c;let f=r[c];!f.source&&!f._resourceType&&(f=new eo(f));const d=h[u];d&&(n[d.group]||(n[d.group]=new Ts,this._ownedBindGroups.push(n[d.group])),n[d.group].setResource(f,d.binding))}}this.groups=n,this._uniformBindMap=a,this.resources=this._buildResourceAccessor(n,h)}addResource(t,e,s){var n,r;(n=this._uniformBindMap)[e]||(n[e]={}),(r=this._uniformBindMap[e])[s]||(r[s]=t),this.groups[e]||(this.groups[e]=new Ts,this._ownedBindGroups.push(this.groups[e]))}_buildResourceAccessor(t,e){const s={};for(const n in e){const r=e[n];Object.defineProperty(s,r.name,{get(){return t[r.group].getResource(r.binding)},set(o){t[r.group].setResource(o,r.binding)}})}return s}destroy(t=!1){this._destroyed||(this._destroyed=!0,this.emit("destroy",this),t&&(this.gpuProgram?.destroy(),this.glProgram?.destroy()),this.gpuProgram=null,this.glProgram=null,this.removeAllListeners(),this._uniformBindMap=null,this._ownedBindGroups.forEach(e=>{e.destroy()}),this._ownedBindGroups=null,this.resources=null,this.groups=null)}static from(t){const{gpu:e,gl:s,...n}=t;let r,o;return e&&(r=Gs.from(e)),s&&(o=Zr.from(s)),new Li({gpuProgram:r,glProgram:o,...n})}}const Rh={normal:0,add:1,multiply:2,screen:3,overlay:4,erase:5,"normal-npm":6,"add-npm":7,"screen-npm":8,min:9,max:10},ti=0,ei=1,si=2,ii=3,ni=4,ri=5,wi=class so{constructor(){this.data=0,this.blendMode="normal",this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(this.data&1<<ti)}set blend(t){!!(this.data&1<<ti)!==t&&(this.data^=1<<ti)}get offsets(){return!!(this.data&1<<ei)}set offsets(t){!!(this.data&1<<ei)!==t&&(this.data^=1<<ei)}set cullMode(t){if(t==="none"){this.culling=!1;return}this.culling=!0,this.clockwiseFrontFace=t==="front"}get cullMode(){return this.culling?this.clockwiseFrontFace?"front":"back":"none"}get culling(){return!!(this.data&1<<si)}set culling(t){!!(this.data&1<<si)!==t&&(this.data^=1<<si)}get depthTest(){return!!(this.data&1<<ii)}set depthTest(t){!!(this.data&1<<ii)!==t&&(this.data^=1<<ii)}get depthMask(){return!!(this.data&1<<ri)}set depthMask(t){!!(this.data&1<<ri)!==t&&(this.data^=1<<ri)}get clockwiseFrontFace(){return!!(this.data&1<<ni)}set clockwiseFrontFace(t){!!(this.data&1<<ni)!==t&&(this.data^=1<<ni)}get blendMode(){return this._blendMode}set blendMode(t){this.blend=t!=="none",this._blendMode=t,this._blendModeId=Rh[t]||0}get polygonOffset(){return this._polygonOffset}set polygonOffset(t){this.offsets=!!t,this._polygonOffset=t}toString(){return`[pixi.js/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`}static for2d(){const t=new so;return t.depthTest=!1,t.blend=!0,t}};wi.default2d=wi.for2d();let io=wi;const vi=[];ht.handleByNamedList(H.Environment,vi);async function Eh(i){if(!i)for(let t=0;t<vi.length;t++){const e=vi[t];if(e.value.test()){await e.value.load();return}}}let Le;function Bh(){if(typeof Le=="boolean")return Le;try{Le=new Function("param1","param2","param3","return param1[param2] === param3;")({a:"b"},"a","b")===!0}catch{Le=!1}return Le}function kn(i,t,e=2){const s=t&&t.length,n=s?t[0]*e:i.length;let r=no(i,0,n,e,!0);const o=[];if(!r||r.next===r.prev)return o;let a,h,l;if(s&&(r=Lh(i,t,r,e)),i.length>80*e){a=i[0],h=i[1];let c=a,u=h;for(let f=e;f<n;f+=e){const d=i[f],p=i[f+1];d<a&&(a=d),p<h&&(h=p),d>c&&(c=d),p>u&&(u=p)}l=Math.max(c-a,u-h),l=l!==0?32767/l:0}return Qe(r,o,e,a,h,l,0),o}function no(i,t,e,s,n){let r;if(n===qh(i,t,e,s)>0)for(let o=t;o<e;o+=s)r=In(o/s|0,i[o],i[o+1],r);else for(let o=e-s;o>=t;o-=s)r=In(o/s|0,i[o],i[o+1],r);return r&&Ie(r,r.next)&&(ts(r),r=r.next),r}function xe(i,t){if(!i)return i;t||(t=i);let e=i,s;do if(s=!1,!e.steiner&&(Ie(e,e.next)||it(e.prev,e,e.next)===0)){if(ts(e),e=t=e.prev,e===e.next)break;s=!0}else e=e.next;while(s||e!==t);return t}function Qe(i,t,e,s,n,r,o){if(!i)return;!o&&r&&Yh(i,s,n,r);let a=i;for(;i.prev!==i.next;){const h=i.prev,l=i.next;if(r?Gh(i,s,n,r):Wh(i)){t.push(h.i,i.i,l.i),ts(i),i=l.next,a=l.next;continue}if(i=l,i===a){o?o===1?(i=Fh(xe(i),t),Qe(i,t,e,s,n,r,2)):o===2&&Dh(i,t,e,s,n,r):Qe(xe(i),t,e,s,n,r,1);break}}}function Wh(i){const t=i.prev,e=i,s=i.next;if(it(t,e,s)>=0)return!1;const n=t.x,r=e.x,o=s.x,a=t.y,h=e.y,l=s.y,c=Math.min(n,r,o),u=Math.min(a,h,l),f=Math.max(n,r,o),d=Math.max(a,h,l);let p=s.next;for(;p!==t;){if(p.x>=c&&p.x<=f&&p.y>=u&&p.y<=d&&Ne(n,a,r,h,o,l,p.x,p.y)&&it(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function Gh(i,t,e,s){const n=i.prev,r=i,o=i.next;if(it(n,r,o)>=0)return!1;const a=n.x,h=r.x,l=o.x,c=n.y,u=r.y,f=o.y,d=Math.min(a,h,l),p=Math.min(c,u,f),x=Math.max(a,h,l),g=Math.max(c,u,f),m=Si(d,p,t,e,s),_=Si(x,g,t,e,s);let y=i.prevZ,b=i.nextZ;for(;y&&y.z>=m&&b&&b.z<=_;){if(y.x>=d&&y.x<=x&&y.y>=p&&y.y<=g&&y!==n&&y!==o&&Ne(a,c,h,u,l,f,y.x,y.y)&&it(y.prev,y,y.next)>=0||(y=y.prevZ,b.x>=d&&b.x<=x&&b.y>=p&&b.y<=g&&b!==n&&b!==o&&Ne(a,c,h,u,l,f,b.x,b.y)&&it(b.prev,b,b.next)>=0))return!1;b=b.nextZ}for(;y&&y.z>=m;){if(y.x>=d&&y.x<=x&&y.y>=p&&y.y<=g&&y!==n&&y!==o&&Ne(a,c,h,u,l,f,y.x,y.y)&&it(y.prev,y,y.next)>=0)return!1;y=y.prevZ}for(;b&&b.z<=_;){if(b.x>=d&&b.x<=x&&b.y>=p&&b.y<=g&&b!==n&&b!==o&&Ne(a,c,h,u,l,f,b.x,b.y)&&it(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function Fh(i,t){let e=i;do{const s=e.prev,n=e.next.next;!Ie(s,n)&&oo(s,e,e.next,n)&&Je(s,n)&&Je(n,s)&&(t.push(s.i,e.i,n.i),ts(e),ts(e.next),e=i=n),e=e.next}while(e!==i);return xe(e)}function Dh(i,t,e,s,n,r){let o=i;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&Vh(o,a)){let h=ao(o,a);o=xe(o,o.next),h=xe(h,h.next),Qe(o,t,e,s,n,r,0),Qe(h,t,e,s,n,r,0);return}a=a.next}o=o.next}while(o!==i)}function Lh(i,t,e,s){const n=[];for(let r=0,o=t.length;r<o;r++){const a=t[r]*s,h=r<o-1?t[r+1]*s:i.length,l=no(i,a,h,s,!1);l===l.next&&(l.steiner=!0),n.push(Xh(l))}n.sort(zh);for(let r=0;r<n.length;r++)e=Hh(n[r],e);return e}function zh(i,t){let e=i.x-t.x;if(e===0&&(e=i.y-t.y,e===0)){const s=(i.next.y-i.y)/(i.next.x-i.x),n=(t.next.y-t.y)/(t.next.x-t.x);e=s-n}return e}function Hh(i,t){const e=Oh(i,t);if(!e)return t;const s=ao(e,i);return xe(s,s.next),xe(e,e.next)}function Oh(i,t){let e=t;const s=i.x,n=i.y;let r=-1/0,o;if(Ie(i,e))return e;do{if(Ie(i,e.next))return e.next;if(n<=e.y&&n>=e.next.y&&e.next.y!==e.y){const u=e.x+(n-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(u<=s&&u>r&&(r=u,o=e.x<e.next.x?e:e.next,u===s))return o}e=e.next}while(e!==t);if(!o)return null;const a=o,h=o.x,l=o.y;let c=1/0;e=o;do{if(s>=e.x&&e.x>=h&&s!==e.x&&ro(n<l?s:r,n,h,l,n<l?r:s,n,e.x,e.y)){const u=Math.abs(n-e.y)/(s-e.x);Je(e,i)&&(u<c||u===c&&(e.x>o.x||e.x===o.x&&Uh(o,e)))&&(o=e,c=u)}e=e.next}while(e!==a);return o}function Uh(i,t){return it(i.prev,i,t.prev)<0&&it(t.next,i,i.next)<0}function Yh(i,t,e,s){let n=i;do n.z===0&&(n.z=Si(n.x,n.y,t,e,s)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next;while(n!==i);n.prevZ.nextZ=null,n.prevZ=null,Nh(n)}function Nh(i){let t,e=1;do{let s=i,n;i=null;let r=null;for(t=0;s;){t++;let o=s,a=0;for(let l=0;l<e&&(a++,o=o.nextZ,!!o);l++);let h=e;for(;a>0||h>0&&o;)a!==0&&(h===0||!o||s.z<=o.z)?(n=s,s=s.nextZ,a--):(n=o,o=o.nextZ,h--),r?r.nextZ=n:i=n,n.prevZ=r,r=n;s=o}r.nextZ=null,e*=2}while(t>1);return i}function Si(i,t,e,s,n){return i=(i-e)*n|0,t=(t-s)*n|0,i=(i|i<<8)&16711935,i=(i|i<<4)&252645135,i=(i|i<<2)&858993459,i=(i|i<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,i|t<<1}function Xh(i){let t=i,e=i;do(t.x<e.x||t.x===e.x&&t.y<e.y)&&(e=t),t=t.next;while(t!==i);return e}function ro(i,t,e,s,n,r,o,a){return(n-o)*(t-a)>=(i-o)*(r-a)&&(i-o)*(s-a)>=(e-o)*(t-a)&&(e-o)*(r-a)>=(n-o)*(s-a)}function Ne(i,t,e,s,n,r,o,a){return!(i===o&&t===a)&&ro(i,t,e,s,n,r,o,a)}function Vh(i,t){return i.next.i!==t.i&&i.prev.i!==t.i&&!$h(i,t)&&(Je(i,t)&&Je(t,i)&&jh(i,t)&&(it(i.prev,i,t.prev)||it(i,t.prev,t))||Ie(i,t)&&it(i.prev,i,i.next)>0&&it(t.prev,t,t.next)>0)}function it(i,t,e){return(t.y-i.y)*(e.x-t.x)-(t.x-i.x)*(e.y-t.y)}function Ie(i,t){return i.x===t.x&&i.y===t.y}function oo(i,t,e,s){const n=_s(it(i,t,e)),r=_s(it(i,t,s)),o=_s(it(e,s,i)),a=_s(it(e,s,t));return!!(n!==r&&o!==a||n===0&&ys(i,e,t)||r===0&&ys(i,s,t)||o===0&&ys(e,i,s)||a===0&&ys(e,t,s))}function ys(i,t,e){return t.x<=Math.max(i.x,e.x)&&t.x>=Math.min(i.x,e.x)&&t.y<=Math.max(i.y,e.y)&&t.y>=Math.min(i.y,e.y)}function _s(i){return i>0?1:i<0?-1:0}function $h(i,t){let e=i;do{if(e.i!==i.i&&e.next.i!==i.i&&e.i!==t.i&&e.next.i!==t.i&&oo(e,e.next,i,t))return!0;e=e.next}while(e!==i);return!1}function Je(i,t){return it(i.prev,i,i.next)<0?it(i,t,i.next)>=0&&it(i,i.prev,t)>=0:it(i,t,i.prev)<0||it(i,i.next,t)<0}function jh(i,t){let e=i,s=!1;const n=(i.x+t.x)/2,r=(i.y+t.y)/2;do e.y>r!=e.next.y>r&&e.next.y!==e.y&&n<(e.next.x-e.x)*(r-e.y)/(e.next.y-e.y)+e.x&&(s=!s),e=e.next;while(e!==i);return s}function ao(i,t){const e=Ci(i.i,i.x,i.y),s=Ci(t.i,t.x,t.y),n=i.next,r=t.prev;return i.next=t,t.prev=i,e.next=n,n.prev=e,s.next=e,e.prev=s,r.next=s,s.prev=r,s}function In(i,t,e,s){const n=Ci(i,t,e);return s?(n.next=s.next,n.prev=s,s.next.prev=n,s.next=n):(n.prev=n,n.next=n),n}function ts(i){i.next.prev=i.prev,i.prev.next=i.next,i.prevZ&&(i.prevZ.nextZ=i.nextZ),i.nextZ&&(i.nextZ.prevZ=i.prevZ)}function Ci(i,t,e){return{i,x:t,y:e,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function qh(i,t,e,s){let n=0;for(let r=t,o=e-s;r<e;r+=s)n+=(i[o]-i[r])*(i[r+1]+i[o+1]),o=r;return n}const Kh=kn.default||kn;var ho=(i=>(i[i.NONE=0]="NONE",i[i.COLOR=16384]="COLOR",i[i.STENCIL=1024]="STENCIL",i[i.DEPTH=256]="DEPTH",i[i.COLOR_DEPTH=16640]="COLOR_DEPTH",i[i.COLOR_STENCIL=17408]="COLOR_STENCIL",i[i.DEPTH_STENCIL=1280]="DEPTH_STENCIL",i[i.ALL=17664]="ALL",i))(ho||{});class Zh{constructor(t){this.items=[],this._name=t}emit(t,e,s,n,r,o,a,h){const{name:l,items:c}=this;for(let u=0,f=c.length;u<f;u++)c[u][l](t,e,s,n,r,o,a,h);return this}add(t){return t[this._name]&&(this.remove(t),this.items.push(t)),this}remove(t){const e=this.items.indexOf(t);return e!==-1&&this.items.splice(e,1),this}contains(t){return this.items.indexOf(t)!==-1}removeAll(){return this.items.length=0,this}destroy(){this.removeAll(),this.items=null,this._name=null}get empty(){return this.items.length===0}get name(){return this._name}}const Qh=["init","destroy","contextChange","resolutionChange","resetState","renderEnd","renderStart","render","update","postrender","prerender"],lo=class co extends Yt{constructor(t){super(),this.tick=0,this.uid=at("renderer"),this.runners=Object.create(null),this.renderPipes=Object.create(null),this._initOptions={},this._systemsHash=Object.create(null),this.type=t.type,this.name=t.name,this.config=t;const e=[...Qh,...this.config.runners??[]];this._addRunners(...e),this._unsafeEvalCheck()}async init(t={}){const e=t.skipExtensionImports===!0?!0:t.manageImports===!1;await Eh(e),this._addSystems(this.config.systems),this._addPipes(this.config.renderPipes,this.config.renderPipeAdaptors);for(const s in this._systemsHash)t={...this._systemsHash[s].constructor.defaultOptions,...t};t={...co.defaultOptions,...t},this._roundPixels=t.roundPixels?1:0;for(let s=0;s<this.runners.init.items.length;s++)await this.runners.init.items[s].init(t);this._initOptions=t}render(t,e){this.tick++;let s=t;if(s instanceof kt&&(s={container:s},e&&($(ot,"passing a second argument is deprecated, please use render options instead"),s.target=e.renderTexture)),s.target||(s.target=this.view.renderTarget),s.target===this.view.renderTarget&&(this._lastObjectRendered=s.container,s.clearColor??(s.clearColor=this.background.colorRgba),s.clear??(s.clear=this.background.clearBeforeRender)),s.clearColor){const n=Array.isArray(s.clearColor)&&s.clearColor.length===4;s.clearColor=n?s.clearColor:nt.shared.setValue(s.clearColor).toArray()}s.transform||(s.container.updateLocalTransform(),s.transform=s.container.localTransform),s.container.visible&&(s.container.enableRenderGroup(),this.runners.prerender.emit(s),this.runners.renderStart.emit(s),this.runners.render.emit(s),this.runners.renderEnd.emit(s),this.runners.postrender.emit(s))}resize(t,e,s){const n=this.view.resolution;this.view.resize(t,e,s),this.emit("resize",this.view.screen.width,this.view.screen.height,this.view.resolution),s!==void 0&&s!==n&&this.runners.resolutionChange.emit(s)}clear(t={}){const e=this;t.target||(t.target=e.renderTarget.renderTarget),t.clearColor||(t.clearColor=this.background.colorRgba),t.clear??(t.clear=ho.ALL);const{clear:s,clearColor:n,target:r,mipLevel:o,layer:a}=t;nt.shared.setValue(n??this.background.colorRgba),e.renderTarget.clear(r,s,nt.shared.toArray(),o??0,a??0)}get resolution(){return this.view.resolution}set resolution(t){this.view.resolution=t,this.runners.resolutionChange.emit(t)}get width(){return this.view.texture.frame.width}get height(){return this.view.texture.frame.height}get canvas(){return this.view.canvas}get lastObjectRendered(){return this._lastObjectRendered}get renderingToScreen(){return this.renderTarget.renderingToScreen}get screen(){return this.view.screen}_addRunners(...t){t.forEach(e=>{this.runners[e]=new Zh(e)})}_addSystems(t){let e;for(e in t){const s=t[e];this._addSystem(s.value,s.name)}}_addSystem(t,e){const s=new t(this);if(this[e])throw new Error(`Whoops! The name "${e}" is already in use`);this[e]=s,this._systemsHash[e]=s;for(const n in this.runners)this.runners[n].add(s);return this}_addPipes(t,e){const s=e.reduce((n,r)=>(n[r.name]=r.value,n),{});t.forEach(n=>{const r=n.value,o=n.name,a=s[o];this.renderPipes[o]=new r(this,a?new a:null),this.runners.destroy.add(this.renderPipes[o])})}destroy(t=!1){this.runners.destroy.items.reverse(),this.runners.destroy.emit(t),(t===!0||typeof t=="object"&&t.releaseGlobalResources)&&is.release(),Object.values(this.runners).forEach(e=>{e.destroy()}),this._systemsHash=null,this.renderPipes=null,this.removeAllListeners()}generateTexture(t){return this.textureGenerator.generateTexture(t)}get roundPixels(){return!!this._roundPixels}_unsafeEvalCheck(){if(!Bh())throw new Error("Current environment does not allow unsafe-eval, please use pixi.js/unsafe-eval module to enable support.")}resetState(){this.runners.resetState.emit()}};lo.defaultOptions={resolution:1,failIfMajorPerformanceCaveat:!1,roundPixels:!1};let uo=lo,bs;function Jh(i){return bs!==void 0||(bs=(()=>{const t={stencil:!0,failIfMajorPerformanceCaveat:i??uo.defaultOptions.failIfMajorPerformanceCaveat};try{if(!ct.get().getWebGLRenderingContext())return!1;let s=ct.get().createCanvas().getContext("webgl",t);const n=!!s?.getContextAttributes()?.stencil;if(s){const r=s.getExtension("WEBGL_lose_context");r&&r.loseContext()}return s=null,n}catch{return!1}})()),bs}let ws;async function tl(i={}){return ws!==void 0||(ws=await(async()=>{const t=ct.get().getNavigator().gpu;if(!t)return!1;try{return await(await t.requestAdapter(i)).requestDevice(),!0}catch{return!1}})()),ws}const Rn=["webgl","webgpu","canvas"];async function el(i){let t=[];i.preference?Array.isArray(i.preference)?t=i.preference.slice():(t.push(i.preference),Rn.forEach(r=>{r!==i.preference&&t.push(r)})):t=Rn.slice();let e,s={};for(let r=0;r<t.length;r++){const o=t[r];if(o==="webgpu"&&await tl()){const{WebGPURenderer:a}=await Xe(async()=>{const{WebGPURenderer:h}=await import("./WebGPURenderer-DzP4ggSy.js");return{WebGPURenderer:h}},__vite__mapDeps([12,13,14,2,3,4,5,6,7,8,9,10,11]));e=a,s={...i,...i.webgpu};break}else if(o==="webgl"&&Jh(i.failIfMajorPerformanceCaveat??uo.defaultOptions.failIfMajorPerformanceCaveat)){const{WebGLRenderer:a}=await Xe(async()=>{const{WebGLRenderer:h}=await import("./WebGLRenderer-CAokTE5X.js");return{WebGLRenderer:h}},__vite__mapDeps([15,13,14,2,3,4,5,6,7,8,9,10,11]));e=a,s={...i,...i.webgl};break}else if(o==="canvas"){const{CanvasRenderer:a}=await Xe(async()=>{const{CanvasRenderer:h}=await import("./CanvasRenderer-BRk1y8tp.js");return{CanvasRenderer:h}},__vite__mapDeps([16,14,2,3,4,5,6,7,8,9,10,11]));e=a,s={...i,...i.canvasOptions};break}}if(delete s.webgpu,delete s.webgl,delete s.canvasOptions,!e)throw new Error("No available renderer for the current environment");const n=new e;return await n.init(s),n}const fo="8.19.0";class po{static init(){globalThis.__PIXI_APP_INIT__?.(this,fo)}static destroy(){}}po.extension=H.Application;class sl{constructor(t){this._renderer=t}init(){globalThis.__PIXI_RENDERER_INIT__?.(this._renderer,fo)}destroy(){this._renderer=null}}sl.extension={type:[H.WebGLSystem,H.WebGPUSystem],name:"initHook",priority:-10};class go{static init(t){Object.defineProperty(this,"resizeTo",{configurable:!0,set(e){globalThis.removeEventListener("resize",this.queueResize),this._resizeTo=e,e&&(globalThis.addEventListener("resize",this.queueResize),this.resize())},get(){return this._resizeTo}}),this.queueResize=()=>{this._resizeTo&&(this._cancelResize(),this._resizeId=requestAnimationFrame(()=>this.resize()))},this._cancelResize=()=>{this._resizeId&&(cancelAnimationFrame(this._resizeId),this._resizeId=null)},this.resize=()=>{if(!this._resizeTo)return;this._cancelResize();let e,s;if(this._resizeTo===globalThis.window)e=globalThis.innerWidth,s=globalThis.innerHeight;else{const{clientWidth:n,clientHeight:r}=this._resizeTo;e=n,s=r}this.renderer.resize(e,s),this.render()},this._resizeId=null,this._resizeTo=null,this.resizeTo=t.resizeTo||null}static destroy(){globalThis.removeEventListener("resize",this.queueResize),this._cancelResize(),this._cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null}}go.extension=H.Application;class mo{static init(t){t=Object.assign({autoStart:!0,sharedTicker:!1},t),Object.defineProperty(this,"ticker",{configurable:!0,set(e){this._ticker&&this._ticker.remove(this.render,this),this._ticker=e,e&&e.add(this.render,this,Ps.LOW)},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?ge.shared:new ge,t.autoStart&&this.start()}static destroy(){if(this._ticker){const t=this._ticker;this.ticker=null,t.destroy()}}}mo.extension=H.Application;ht.add(go);ht.add(mo);const xo=class Mi{constructor(...t){this.stage=new kt,t[0]!==void 0&&$(ot,"Application constructor options are deprecated, please use Application.init() instead.")}async init(t){t={...t},this.stage||(this.stage=new kt),this.renderer=await el(t),Mi._plugins.forEach(e=>{e.init.call(this,t)})}render(){this.renderer.render({container:this.stage})}get canvas(){return this.renderer.canvas}get view(){return $(ot,"Application.view is deprecated, please use Application.canvas instead."),this.renderer.canvas}get screen(){return this.renderer.screen}get domContainerRoot(){return this.renderer.renderPipes.dom?._domElement}destroy(t=!1,e=!1){const s=Mi._plugins.slice(0);s.reverse(),s.forEach(n=>{n.destroy.call(this)}),this.stage.destroy(e),this.stage=null,this.renderer.destroy(t),this.renderer=null}};xo._plugins=[];let yo=xo;ht.handleByList(H.Application,yo._plugins);ht.add(po);const oi={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},il=/([astvzqmhlc])([^astvzqmhlc]*)/gi,nl=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;function rl(i){const t=[];return i.replace(il,(e,s,n)=>{let r=s.toLowerCase(),o=s;const a=ol(n);for(r==="m"&&a.length>2&&(t.push([o,...a.splice(0,2)]),r="l",o=o==="m"?"l":"L");;){if(a.length===oi[r])return t.push([o,...a]),"";if(a.length<oi[r])throw new Error("malformed path data");t.push([o,...a.splice(0,oi[r])])}}),t}function ol(i){const t=i.match(nl);return t?t.map(Number):[]}function al(i,t){const e=rl(i),s=[];let n=null,r=0,o=0;for(let a=0;a<e.length;a++){const h=e[a],l=h[0],c=h;switch(l){case"M":r=c[1],o=c[2],t.moveTo(r,o);break;case"m":r+=c[1],o+=c[2],t.moveTo(r,o);break;case"H":r=c[1],t.lineTo(r,o);break;case"h":r+=c[1],t.lineTo(r,o);break;case"V":o=c[1],t.lineTo(r,o);break;case"v":o+=c[1],t.lineTo(r,o);break;case"L":r=c[1],o=c[2],t.lineTo(r,o);break;case"l":r+=c[1],o+=c[2],t.lineTo(r,o);break;case"C":r=c[5],o=c[6],t.bezierCurveTo(c[1],c[2],c[3],c[4],r,o);break;case"c":t.bezierCurveTo(r+c[1],o+c[2],r+c[3],o+c[4],r+c[5],o+c[6]),r+=c[5],o+=c[6];break;case"S":r=c[3],o=c[4],t.bezierCurveToShort(c[1],c[2],r,o);break;case"s":t.bezierCurveToShort(r+c[1],o+c[2],r+c[3],o+c[4]),r+=c[3],o+=c[4];break;case"Q":r=c[3],o=c[4],t.quadraticCurveTo(c[1],c[2],r,o);break;case"q":t.quadraticCurveTo(r+c[1],o+c[2],r+c[3],o+c[4]),r+=c[3],o+=c[4];break;case"T":r=c[1],o=c[2],t.quadraticCurveToShort(r,o);break;case"t":r+=c[1],o+=c[2],t.quadraticCurveToShort(r,o);break;case"A":r=c[6],o=c[7],t.arcToSvg(c[1],c[2],c[3],c[4],c[5],r,o);break;case"a":r+=c[6],o+=c[7],t.arcToSvg(c[1],c[2],c[3],c[4],c[5],r,o);break;case"Z":case"z":t.closePath(),s.length>0&&(n=s.pop(),n?(r=n.startX,o=n.startY):(r=0,o=0)),n=null;break;default:bt(`Unknown SVG path command: ${l}`)}l!=="Z"&&l!=="z"&&n===null&&(n={startX:r,startY:o},s.push(n))}return t}class zi{constructor(t=0,e=0,s=0){this.type="circle",this.x=t,this.y=e,this.radius=s}clone(){return new zi(this.x,this.y,this.radius)}contains(t,e){if(this.radius<=0)return!1;const s=this.radius*this.radius;let n=this.x-t,r=this.y-e;return n*=n,r*=r,n+r<=s}strokeContains(t,e,s,n=.5){if(this.radius===0)return!1;const r=this.x-t,o=this.y-e,a=this.radius,h=(1-n)*s,l=Math.sqrt(r*r+o*o);return l<=a+h&&l>a-(s-h)}getBounds(t){return t||(t=new Q),t.x=this.x-this.radius,t.y=this.y-this.radius,t.width=this.radius*2,t.height=this.radius*2,t}copyFrom(t){return this.x=t.x,this.y=t.y,this.radius=t.radius,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`}}class Hi{constructor(t=0,e=0,s=0,n=0){this.type="ellipse",this.x=t,this.y=e,this.halfWidth=s,this.halfHeight=n}clone(){return new Hi(this.x,this.y,this.halfWidth,this.halfHeight)}contains(t,e){if(this.halfWidth<=0||this.halfHeight<=0)return!1;let s=(t-this.x)/this.halfWidth,n=(e-this.y)/this.halfHeight;return s*=s,n*=n,s+n<=1}strokeContains(t,e,s,n=.5){const{halfWidth:r,halfHeight:o}=this;if(r<=0||o<=0)return!1;const a=s*(1-n),h=s-a,l=r-h,c=o-h,u=r+a,f=o+a,d=t-this.x,p=e-this.y,x=d*d/(l*l)+p*p/(c*c),g=d*d/(u*u)+p*p/(f*f);return x>1&&g<=1}getBounds(t){return t||(t=new Q),t.x=this.x-this.halfWidth,t.y=this.y-this.halfHeight,t.width=this.halfWidth*2,t.height=this.halfHeight*2,t}copyFrom(t){return this.x=t.x,this.y=t.y,this.halfWidth=t.halfWidth,this.halfHeight=t.halfHeight,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:Ellipse x=${this.x} y=${this.y} halfWidth=${this.halfWidth} halfHeight=${this.halfHeight}]`}}function hl(i,t,e,s,n,r){const o=i-e,a=t-s,h=n-e,l=r-s,c=o*h+a*l,u=h*h+l*l;let f=-1;u!==0&&(f=c/u);let d,p;f<0?(d=e,p=s):f>1?(d=n,p=r):(d=e+f*h,p=s+f*l);const x=i-d,g=t-p;return x*x+g*g}let ll,cl;class $e{constructor(...t){this.type="polygon";let e=Array.isArray(t[0])?t[0]:t;if(typeof e[0]!="number"){const s=[];for(let n=0,r=e.length;n<r;n++)s.push(e[n].x,e[n].y);e=s}this.points=e,this.closePath=!0}isClockwise(){let t=0;const e=this.points,s=e.length;for(let n=0;n<s;n+=2){const r=e[n],o=e[n+1],a=e[(n+2)%s],h=e[(n+3)%s];t+=(a-r)*(h+o)}return t<0}containsPolygon(t){const e=this.getBounds(ll),s=t.getBounds(cl);if(!e.containsRect(s))return!1;const n=t.points;for(let r=0;r<n.length;r+=2){const o=n[r],a=n[r+1];if(!this.contains(o,a))return!1}return!0}clone(){const t=this.points.slice(),e=new $e(t);return e.closePath=this.closePath,e}contains(t,e){let s=!1;const n=this.points.length/2;for(let r=0,o=n-1;r<n;o=r++){const a=this.points[r*2],h=this.points[r*2+1],l=this.points[o*2],c=this.points[o*2+1];h>e!=c>e&&t<(l-a)*((e-h)/(c-h))+a&&(s=!s)}return s}strokeContains(t,e,s,n=.5){const r=s*s,o=r*(1-n),a=r-o,{points:h}=this,l=h.length-(this.closePath?0:2);for(let c=0;c<l;c+=2){const u=h[c],f=h[c+1],d=h[(c+2)%h.length],p=h[(c+3)%h.length],x=hl(t,e,u,f,d,p),g=Math.sign((d-u)*(e-f)-(p-f)*(t-u));if(x<=(g<0?a:o))return!0}return!1}getBounds(t){t||(t=new Q);const e=this.points;let s=1/0,n=-1/0,r=1/0,o=-1/0;for(let a=0,h=e.length;a<h;a+=2){const l=e[a],c=e[a+1];s=l<s?l:s,n=l>n?l:n,r=c<r?c:r,o=c>o?c:o}return t.x=s,t.width=n-s,t.y=r,t.height=o-r,t}copyFrom(t){return this.points=t.points.slice(),this.closePath=t.closePath,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:PolygoncloseStroke=${this.closePath}points=${this.points.reduce((t,e)=>`${t}, ${e}`,"")}]`}get lastX(){return this.points[this.points.length-2]}get lastY(){return this.points[this.points.length-1]}get x(){return $("8.11.0","Polygon.lastX is deprecated, please use Polygon.lastX instead."),this.points[this.points.length-2]}get y(){return $("8.11.0","Polygon.y is deprecated, please use Polygon.lastY instead."),this.points[this.points.length-1]}get startX(){return this.points[0]}get startY(){return this.points[1]}}const vs=(i,t,e,s,n,r,o)=>{const a=i-e,h=t-s,l=Math.sqrt(a*a+h*h);return l>=n-r&&l<=n+o};class Oi{constructor(t=0,e=0,s=0,n=0,r=20){this.type="roundedRectangle",this.x=t,this.y=e,this.width=s,this.height=n,this.radius=r}getBounds(t){return t||(t=new Q),t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t}clone(){return new Oi(this.x,this.y,this.width,this.height,this.radius)}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.copyFrom(this),t}contains(t,e){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){const s=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(e>=this.y+s&&e<=this.y+this.height-s||t>=this.x+s&&t<=this.x+this.width-s)return!0;let n=t-(this.x+s),r=e-(this.y+s);const o=s*s;if(n*n+r*r<=o||(n=t-(this.x+this.width-s),n*n+r*r<=o)||(r=e-(this.y+this.height-s),n*n+r*r<=o)||(n=t-(this.x+s),n*n+r*r<=o))return!0}return!1}strokeContains(t,e,s,n=.5){const{x:r,y:o,width:a,height:h,radius:l}=this,c=s*(1-n),u=s-c,f=r+l,d=o+l,p=a-l*2,x=h-l*2,g=r+a,m=o+h;return(t>=r-c&&t<=r+u||t>=g-u&&t<=g+c)&&e>=d&&e<=d+x||(e>=o-c&&e<=o+u||e>=m-u&&e<=m+c)&&t>=f&&t<=f+p?!0:t<f&&e<d&&vs(t,e,f,d,l,u,c)||t>g-l&&e<d&&vs(t,e,g-l,d,l,u,c)||t>g-l&&e>m-l&&vs(t,e,g-l,m-l,l,u,c)||t<f&&e>m-l&&vs(t,e,f,m-l,l,u,c)}toString(){return`[pixi.js/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`}}const _o={};function ul(i,t,e){let s=2166136261;for(let n=0;n<t;n++)s^=i[n].uid,s=Math.imul(s,16777619),s>>>=0;return _o[s]||dl(i,t,s,e)}function dl(i,t,e,s){const n={};let r=0;for(let a=0;a<s;a++){const h=a<t?i[a]:K.EMPTY.source;n[r++]=h.source,n[r++]=h.style}const o=new Ts(n);return _o[e]=o,o}class En{constructor(t){typeof t=="number"?this.rawBinaryData=new ArrayBuffer(t):t instanceof Uint8Array?this.rawBinaryData=t.buffer:this.rawBinaryData=t,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData),this.size=this.rawBinaryData.byteLength}get int8View(){return this._int8View||(this._int8View=new Int8Array(this.rawBinaryData)),this._int8View}get uint8View(){return this._uint8View||(this._uint8View=new Uint8Array(this.rawBinaryData)),this._uint8View}get int16View(){return this._int16View||(this._int16View=new Int16Array(this.rawBinaryData)),this._int16View}get int32View(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View}get float64View(){return this._float64Array||(this._float64Array=new Float64Array(this.rawBinaryData)),this._float64Array}get bigUint64View(){return this._bigUint64Array||(this._bigUint64Array=new BigUint64Array(this.rawBinaryData)),this._bigUint64Array}view(t){return this[`${t}View`]}destroy(){this.rawBinaryData=null,this.uint32View=null,this.float32View=null,this.uint16View=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._int32View=null,this._float64Array=null,this._bigUint64Array=null}static sizeOf(t){switch(t){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(`${t} isn't a valid view type`)}}}function Bn(i,t,e,s){if(e??(e=0),s??(s=Math.min(i.byteLength-e,t.byteLength)),!(e&7)&&!(s&7)){const n=s/8;new Float64Array(t,0,n).set(new Float64Array(i,e,n))}else if(!(e&3)&&!(s&3)){const n=s/4;new Float32Array(t,0,n).set(new Float32Array(i,e,n))}else new Uint8Array(t).set(new Uint8Array(i,e,s))}const fl={normal:"normal-npm",add:"add-npm",screen:"screen-npm"};var pl=(i=>(i[i.DISABLED=0]="DISABLED",i[i.RENDERING_MASK_ADD=1]="RENDERING_MASK_ADD",i[i.MASK_ACTIVE=2]="MASK_ACTIVE",i[i.INVERSE_MASK_ACTIVE=3]="INVERSE_MASK_ACTIVE",i[i.RENDERING_MASK_REMOVE=4]="RENDERING_MASK_REMOVE",i[i.NONE=5]="NONE",i))(pl||{});function Wn(i,t){return t.alphaMode==="no-premultiply-alpha"&&fl[i]||i}const gl=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(`
|
|
23
|
+
${i}`}function wh(i,t){return t?i.replace("#version 300 es",""):i}const Qs={stripVersion:wh,ensurePrecision:mh,addProgramDefines:gh,setProgramName:bh,insertVersion:xh},Fe=Object.create(null),Kr=class _i{constructor(t){t={..._i.defaultOptions,...t};const e=t.fragment.indexOf("#version 300 es")!==-1,s={stripVersion:e,ensurePrecision:{requestedFragmentPrecision:t.preferredFragmentPrecision,requestedVertexPrecision:t.preferredVertexPrecision,maxSupportedVertexPrecision:"highp",maxSupportedFragmentPrecision:ph()},setProgramName:{name:t.name},addProgramDefines:e,insertVersion:e};let n=t.fragment,r=t.vertex;Object.keys(Qs).forEach(o=>{const a=s[o];n=Qs[o](n,a,!0),r=Qs[o](r,a,!1)}),this.fragment=n,this.vertex=r,this.transformFeedbackVaryings=t.transformFeedbackVaryings,this._key=Di(`${this.vertex}:${this.fragment}`,"gl-program")}destroy(){this.fragment=null,this.vertex=null,this._attributeData=null,this._uniformData=null,this._uniformBlockData=null,this.transformFeedbackVaryings=null,Fe[this._cacheKey]=null}static from(t){const e=`${t.vertex}:${t.fragment}`;return Fe[e]||(Fe[e]=new _i(t),Fe[e]._cacheKey=e),Fe[e]}};Kr.defaultOptions={preferredVertexPrecision:"highp",preferredFragmentPrecision:"mediump"};let Zr=Kr;const Tn={uint8x2:{size:2,stride:2,normalised:!1},uint8x4:{size:4,stride:4,normalised:!1},sint8x2:{size:2,stride:2,normalised:!1},sint8x4:{size:4,stride:4,normalised:!1},unorm8x2:{size:2,stride:2,normalised:!0},unorm8x4:{size:4,stride:4,normalised:!0},snorm8x2:{size:2,stride:2,normalised:!0},snorm8x4:{size:4,stride:4,normalised:!0},uint16x2:{size:2,stride:4,normalised:!1},uint16x4:{size:4,stride:8,normalised:!1},sint16x2:{size:2,stride:4,normalised:!1},sint16x4:{size:4,stride:8,normalised:!1},unorm16x2:{size:2,stride:4,normalised:!0},unorm16x4:{size:4,stride:8,normalised:!0},snorm16x2:{size:2,stride:4,normalised:!0},snorm16x4:{size:4,stride:8,normalised:!0},float16x2:{size:2,stride:4,normalised:!1},float16x4:{size:4,stride:8,normalised:!1},float32:{size:1,stride:4,normalised:!1},float32x2:{size:2,stride:8,normalised:!1},float32x3:{size:3,stride:12,normalised:!1},float32x4:{size:4,stride:16,normalised:!1},uint32:{size:1,stride:4,normalised:!1},uint32x2:{size:2,stride:8,normalised:!1},uint32x3:{size:3,stride:12,normalised:!1},uint32x4:{size:4,stride:16,normalised:!1},sint32:{size:1,stride:4,normalised:!1},sint32x2:{size:2,stride:8,normalised:!1},sint32x3:{size:3,stride:12,normalised:!1},sint32x4:{size:4,stride:16,normalised:!1}};function vh(i){return Tn[i]??Tn.float32}const Sh={f32:"float32","vec2<f32>":"float32x2","vec3<f32>":"float32x3","vec4<f32>":"float32x4",vec2f:"float32x2",vec3f:"float32x3",vec4f:"float32x4",i32:"sint32","vec2<i32>":"sint32x2","vec3<i32>":"sint32x3","vec4<i32>":"sint32x4",vec2i:"sint32x2",vec3i:"sint32x3",vec4i:"sint32x4",u32:"uint32","vec2<u32>":"uint32x2","vec3<u32>":"uint32x3","vec4<u32>":"uint32x4",vec2u:"uint32x2",vec3u:"uint32x3",vec4u:"uint32x4",bool:"uint32","vec2<bool>":"uint32x2","vec3<bool>":"uint32x3","vec4<bool>":"uint32x4"},An=/@location\((\d+)\)\s+([a-zA-Z0-9_]+)\s*:\s*([a-zA-Z0-9_<>]+)(?:,|\s|\)|$)/g;function Pn(i,t){let e;for(;(e=An.exec(i))!==null;){const s=Sh[e[3]]??"float32";t[e[2]]={location:parseInt(e[1],10),format:s,stride:vh(s).stride,offset:0,instance:!1,start:0}}An.lastIndex=0}function Ch(i){return i.replace(/\/\/.*$/gm,"").replace(/\/\*[\s\S]*?\*\//g,"")}function Mh({source:i,entryPoint:t}){const e={},s=Ch(i),n=s.indexOf(`fn ${t}(`);if(n===-1)return e;const r=s.indexOf("->",n);if(r===-1)return e;const o=s.substring(n,r);if(Pn(o,e),Object.keys(e).length===0){const a=o.match(/\(\s*\w+\s*:\s*(\w+)/);if(a){const h=a[1],l=new RegExp(`struct\\s+${h}\\s*\\{([^}]+)\\}`,"s"),c=s.match(l);c&&Pn(c[1],e)}}return e}function Js(i){const t=/(^|[^/])@(group|binding)\(\d+\)[^;]+;/g,e=/@group\((\d+)\)/,s=/@binding\((\d+)\)/,n=/var(<[^>]+>)? (\w+)/,r=/:\s*([\w<>]+)/,o=/struct\s+(\w+)\s*{([^}]+)}/g,a=/(\w+)\s*:\s*([\w\<\>]+)/g,h=/struct\s+(\w+)/,l=i.match(t)?.map(u=>({group:parseInt(u.match(e)[1],10),binding:parseInt(u.match(s)[1],10),name:u.match(n)[2],isUniform:u.match(n)[1]==="<uniform>",type:u.match(r)[1]}));if(!l)return{groups:[],structs:[]};const c=i.match(o)?.map(u=>{const f=u.match(h)[1],d=u.match(a).reduce((p,x)=>{const[g,m]=x.split(":");return p[g.trim()]=m.trim(),p},{});return d?{name:f,members:d}:null}).filter(({name:u})=>l.some(f=>f.type===u||f.type.includes(`<${u}>`)))??[];return{groups:l,structs:c}}var fe=(i=>(i[i.VERTEX=1]="VERTEX",i[i.FRAGMENT=2]="FRAGMENT",i[i.COMPUTE=4]="COMPUTE",i))(fe||{});function Th({groups:i}){const t=[];for(let e=0;e<i.length;e++){const s=i[e];t[s.group]||(t[s.group]=[]),s.isUniform?t[s.group].push({binding:s.binding,visibility:fe.VERTEX|fe.FRAGMENT,buffer:{type:"uniform"}}):s.type==="sampler"?t[s.group].push({binding:s.binding,visibility:fe.FRAGMENT,sampler:{type:"filtering"}}):s.type==="texture_2d"||s.type.startsWith("texture_2d<")?t[s.group].push({binding:s.binding,visibility:fe.FRAGMENT,texture:{sampleType:"float",viewDimension:"2d",multisampled:!1}}):s.type==="texture_2d_array"||s.type.startsWith("texture_2d_array<")?t[s.group].push({binding:s.binding,visibility:fe.FRAGMENT,texture:{sampleType:"float",viewDimension:"2d-array",multisampled:!1}}):(s.type==="texture_cube"||s.type.startsWith("texture_cube<"))&&t[s.group].push({binding:s.binding,visibility:fe.FRAGMENT,texture:{sampleType:"float",viewDimension:"cube",multisampled:!1}})}for(let e=0;e<t.length;e++)t[e]||(t[e]=[]);return t}function Ah({groups:i}){const t=[];for(let e=0;e<i.length;e++){const s=i[e];t[s.group]||(t[s.group]={}),t[s.group][s.name]=s.binding}return t}function Ph(i,t){const e=new Set,s=new Set,n=[...i.structs,...t.structs].filter(o=>e.has(o.name)?!1:(e.add(o.name),!0)),r=[...i.groups,...t.groups].filter(o=>{const a=`${o.name}-${o.binding}`;return s.has(a)?!1:(s.add(a),!0)});return{structs:n,groups:r}}const De=Object.create(null);class Gs{constructor(t){this._layoutKey=0,this._attributeLocationsKey=0;const{fragment:e,vertex:s,layout:n,gpuLayout:r,name:o}=t;if(this.name=o,this.fragment=e,this.vertex=s,e.source===s.source){const a=Js(e.source);this.structsAndGroups=a}else{const a=Js(s.source),h=Js(e.source);this.structsAndGroups=Ph(a,h)}this.layout=n??Ah(this.structsAndGroups),this.gpuLayout=r??Th(this.structsAndGroups),this.autoAssignGlobalUniforms=this.layout[0]?.globalUniforms!==void 0,this.autoAssignLocalUniforms=this.layout[1]?.localUniforms!==void 0,this._generateProgramKey()}_generateProgramKey(){const{vertex:t,fragment:e}=this,s=t.source+e.source+t.entryPoint+e.entryPoint;this._layoutKey=Di(s,"program")}get attributeData(){return this._attributeData??(this._attributeData=Mh(this.vertex)),this._attributeData}destroy(){this.gpuLayout=null,this.layout=null,this.structsAndGroups=null,this.fragment=null,this.vertex=null,De[this._cacheKey]=null}static from(t){const e=`${t.vertex.source}:${t.fragment.source}:${t.fragment.entryPoint}:${t.vertex.entryPoint}`;return De[e]||(De[e]=new Gs(t),De[e]._cacheKey=e),De[e]}}const Qr=["f32","i32","vec2<f32>","vec3<f32>","vec4<f32>","mat2x2<f32>","mat3x3<f32>","mat4x4<f32>","mat3x2<f32>","mat4x2<f32>","mat2x3<f32>","mat4x3<f32>","mat2x4<f32>","mat3x4<f32>","vec2<i32>","vec3<i32>","vec4<i32>"],kh=Qr.reduce((i,t)=>(i[t]=!0,i),{});function Ih(i,t){switch(i){case"f32":return 0;case"vec2<f32>":return new Float32Array(2*t);case"vec3<f32>":return new Float32Array(3*t);case"vec4<f32>":return new Float32Array(4*t);case"mat2x2<f32>":return new Float32Array([1,0,0,1]);case"mat3x3<f32>":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4x4<f32>":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}const Jr=class to{constructor(t,e){this._touched=0,this.uid=at("uniform"),this._resourceType="uniformGroup",this._resourceId=at("resource"),this.isUniformGroup=!0,this._dirtyId=0,this.destroyed=!1,e={...to.defaultOptions,...e},this.uniformStructures=t;const s={};for(const n in t){const r=t[n];if(r.name=n,r.size=r.size??1,!kh[r.type]){const o=r.type.match(/^array<(\w+(?:<\w+>)?),\s*(\d+)>$/);if(o){const[,a,h]=o;throw new Error(`Uniform type ${r.type} is not supported. Use type: '${a}', size: ${h} instead.`)}throw new Error(`Uniform type ${r.type} is not supported. Supported uniform types are: ${Qr.join(", ")}`)}r.value??(r.value=Ih(r.type,r.size)),s[n]=r.value}this.uniforms=s,this._dirtyId=1,this.ubo=e.ubo,this.isStatic=e.isStatic,this._signature=Di(Object.keys(s).map(n=>`${n}-${t[n].type}`).join("-"),"uniform-group")}update(){this._dirtyId++}};Jr.defaultOptions={ubo:!1,isStatic:!1};let eo=Jr;class Ts{constructor(t){this.resources=Object.create(null),this._dirty=!0;let e=0;for(const s in t){const n=t[s];this.setResource(n,e++)}this._updateKey()}_updateKey(){if(!this._dirty)return;this._dirty=!1;const t=[];let e=0;for(const s in this.resources)t[e++]=this.resources[s]._resourceId;this._key=t.join("|")}setResource(t,e){const s=this.resources[e];t!==s&&(s?.off?.("change",this.onResourceChange,this),t.on?.("change",this.onResourceChange,this),this.resources[e]=t,this._dirty=!0)}getResource(t){return this.resources[t]}_touch(t,e){const s=this.resources;for(const n in s)s[n]._gcLastUsed=t,s[n]._touched=e}destroy(){const t=this.resources;for(const e in t)t[e]?.off?.("change",this.onResourceChange,this);this.resources=null}onResourceChange(t){this._dirty=!0,t.destroyed?this.destroy():this._updateKey()}}var bi=(i=>(i[i.WEBGL=1]="WEBGL",i[i.WEBGPU=2]="WEBGPU",i[i.CANVAS=4]="CANVAS",i[i.BOTH=3]="BOTH",i))(bi||{});class Li extends Yt{constructor(t){super(),this.uid=at("shader"),this._uniformBindMap=Object.create(null),this._ownedBindGroups=[],this._destroyed=!1;let{gpuProgram:e,glProgram:s,groups:n,resources:r,compatibleRenderers:o,groupMap:a}=t;this.gpuProgram=e,this.glProgram=s,o===void 0&&(o=0,e&&(o|=bi.WEBGPU),s&&(o|=bi.WEBGL)),this.compatibleRenderers=o;const h={};if(!r&&!n&&(r={}),r&&n)throw new Error("[Shader] Cannot have both resources and groups");if(!e&&n&&!a)throw new Error("[Shader] No group map or WebGPU shader provided - consider using resources instead.");if(!e&&n&&a)for(const l in a)for(const c in a[l]){const u=a[l][c];h[u]={group:l,binding:c,name:u}}else if(e&&n&&!a){const l=e.structsAndGroups.groups;a={},l.forEach(c=>{a[c.group]=a[c.group]||{},a[c.group][c.binding]=c.name,h[c.name]=c})}else if(r){n={},a={},e&&e.structsAndGroups.groups.forEach(u=>{a[u.group]=a[u.group]||{},a[u.group][u.binding]=u.name,h[u.name]=u});let l=0;for(const c in r)h[c]||(n[99]||(n[99]=new Ts,this._ownedBindGroups.push(n[99])),h[c]={group:99,binding:l,name:c},a[99]=a[99]||{},a[99][l]=c,l++);for(const c in r){const u=c;let f=r[c];!f.source&&!f._resourceType&&(f=new eo(f));const d=h[u];d&&(n[d.group]||(n[d.group]=new Ts,this._ownedBindGroups.push(n[d.group])),n[d.group].setResource(f,d.binding))}}this.groups=n,this._uniformBindMap=a,this.resources=this._buildResourceAccessor(n,h)}addResource(t,e,s){var n,r;(n=this._uniformBindMap)[e]||(n[e]={}),(r=this._uniformBindMap[e])[s]||(r[s]=t),this.groups[e]||(this.groups[e]=new Ts,this._ownedBindGroups.push(this.groups[e]))}_buildResourceAccessor(t,e){const s={};for(const n in e){const r=e[n];Object.defineProperty(s,r.name,{get(){return t[r.group].getResource(r.binding)},set(o){t[r.group].setResource(o,r.binding)}})}return s}destroy(t=!1){this._destroyed||(this._destroyed=!0,this.emit("destroy",this),t&&(this.gpuProgram?.destroy(),this.glProgram?.destroy()),this.gpuProgram=null,this.glProgram=null,this.removeAllListeners(),this._uniformBindMap=null,this._ownedBindGroups.forEach(e=>{e.destroy()}),this._ownedBindGroups=null,this.resources=null,this.groups=null)}static from(t){const{gpu:e,gl:s,...n}=t;let r,o;return e&&(r=Gs.from(e)),s&&(o=Zr.from(s)),new Li({gpuProgram:r,glProgram:o,...n})}}const Rh={normal:0,add:1,multiply:2,screen:3,overlay:4,erase:5,"normal-npm":6,"add-npm":7,"screen-npm":8,min:9,max:10},ti=0,ei=1,si=2,ii=3,ni=4,ri=5,wi=class so{constructor(){this.data=0,this.blendMode="normal",this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(this.data&1<<ti)}set blend(t){!!(this.data&1<<ti)!==t&&(this.data^=1<<ti)}get offsets(){return!!(this.data&1<<ei)}set offsets(t){!!(this.data&1<<ei)!==t&&(this.data^=1<<ei)}set cullMode(t){if(t==="none"){this.culling=!1;return}this.culling=!0,this.clockwiseFrontFace=t==="front"}get cullMode(){return this.culling?this.clockwiseFrontFace?"front":"back":"none"}get culling(){return!!(this.data&1<<si)}set culling(t){!!(this.data&1<<si)!==t&&(this.data^=1<<si)}get depthTest(){return!!(this.data&1<<ii)}set depthTest(t){!!(this.data&1<<ii)!==t&&(this.data^=1<<ii)}get depthMask(){return!!(this.data&1<<ri)}set depthMask(t){!!(this.data&1<<ri)!==t&&(this.data^=1<<ri)}get clockwiseFrontFace(){return!!(this.data&1<<ni)}set clockwiseFrontFace(t){!!(this.data&1<<ni)!==t&&(this.data^=1<<ni)}get blendMode(){return this._blendMode}set blendMode(t){this.blend=t!=="none",this._blendMode=t,this._blendModeId=Rh[t]||0}get polygonOffset(){return this._polygonOffset}set polygonOffset(t){this.offsets=!!t,this._polygonOffset=t}toString(){return`[pixi.js/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`}static for2d(){const t=new so;return t.depthTest=!1,t.blend=!0,t}};wi.default2d=wi.for2d();let io=wi;const vi=[];ht.handleByNamedList(H.Environment,vi);async function Eh(i){if(!i)for(let t=0;t<vi.length;t++){const e=vi[t];if(e.value.test()){await e.value.load();return}}}let Le;function Bh(){if(typeof Le=="boolean")return Le;try{Le=new Function("param1","param2","param3","return param1[param2] === param3;")({a:"b"},"a","b")===!0}catch{Le=!1}return Le}function kn(i,t,e=2){const s=t&&t.length,n=s?t[0]*e:i.length;let r=no(i,0,n,e,!0);const o=[];if(!r||r.next===r.prev)return o;let a,h,l;if(s&&(r=Lh(i,t,r,e)),i.length>80*e){a=i[0],h=i[1];let c=a,u=h;for(let f=e;f<n;f+=e){const d=i[f],p=i[f+1];d<a&&(a=d),p<h&&(h=p),d>c&&(c=d),p>u&&(u=p)}l=Math.max(c-a,u-h),l=l!==0?32767/l:0}return Qe(r,o,e,a,h,l,0),o}function no(i,t,e,s,n){let r;if(n===qh(i,t,e,s)>0)for(let o=t;o<e;o+=s)r=In(o/s|0,i[o],i[o+1],r);else for(let o=e-s;o>=t;o-=s)r=In(o/s|0,i[o],i[o+1],r);return r&&Ie(r,r.next)&&(ts(r),r=r.next),r}function xe(i,t){if(!i)return i;t||(t=i);let e=i,s;do if(s=!1,!e.steiner&&(Ie(e,e.next)||it(e.prev,e,e.next)===0)){if(ts(e),e=t=e.prev,e===e.next)break;s=!0}else e=e.next;while(s||e!==t);return t}function Qe(i,t,e,s,n,r,o){if(!i)return;!o&&r&&Yh(i,s,n,r);let a=i;for(;i.prev!==i.next;){const h=i.prev,l=i.next;if(r?Gh(i,s,n,r):Wh(i)){t.push(h.i,i.i,l.i),ts(i),i=l.next,a=l.next;continue}if(i=l,i===a){o?o===1?(i=Fh(xe(i),t),Qe(i,t,e,s,n,r,2)):o===2&&Dh(i,t,e,s,n,r):Qe(xe(i),t,e,s,n,r,1);break}}}function Wh(i){const t=i.prev,e=i,s=i.next;if(it(t,e,s)>=0)return!1;const n=t.x,r=e.x,o=s.x,a=t.y,h=e.y,l=s.y,c=Math.min(n,r,o),u=Math.min(a,h,l),f=Math.max(n,r,o),d=Math.max(a,h,l);let p=s.next;for(;p!==t;){if(p.x>=c&&p.x<=f&&p.y>=u&&p.y<=d&&Ne(n,a,r,h,o,l,p.x,p.y)&&it(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function Gh(i,t,e,s){const n=i.prev,r=i,o=i.next;if(it(n,r,o)>=0)return!1;const a=n.x,h=r.x,l=o.x,c=n.y,u=r.y,f=o.y,d=Math.min(a,h,l),p=Math.min(c,u,f),x=Math.max(a,h,l),g=Math.max(c,u,f),m=Si(d,p,t,e,s),_=Si(x,g,t,e,s);let y=i.prevZ,b=i.nextZ;for(;y&&y.z>=m&&b&&b.z<=_;){if(y.x>=d&&y.x<=x&&y.y>=p&&y.y<=g&&y!==n&&y!==o&&Ne(a,c,h,u,l,f,y.x,y.y)&&it(y.prev,y,y.next)>=0||(y=y.prevZ,b.x>=d&&b.x<=x&&b.y>=p&&b.y<=g&&b!==n&&b!==o&&Ne(a,c,h,u,l,f,b.x,b.y)&&it(b.prev,b,b.next)>=0))return!1;b=b.nextZ}for(;y&&y.z>=m;){if(y.x>=d&&y.x<=x&&y.y>=p&&y.y<=g&&y!==n&&y!==o&&Ne(a,c,h,u,l,f,y.x,y.y)&&it(y.prev,y,y.next)>=0)return!1;y=y.prevZ}for(;b&&b.z<=_;){if(b.x>=d&&b.x<=x&&b.y>=p&&b.y<=g&&b!==n&&b!==o&&Ne(a,c,h,u,l,f,b.x,b.y)&&it(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function Fh(i,t){let e=i;do{const s=e.prev,n=e.next.next;!Ie(s,n)&&oo(s,e,e.next,n)&&Je(s,n)&&Je(n,s)&&(t.push(s.i,e.i,n.i),ts(e),ts(e.next),e=i=n),e=e.next}while(e!==i);return xe(e)}function Dh(i,t,e,s,n,r){let o=i;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&Vh(o,a)){let h=ao(o,a);o=xe(o,o.next),h=xe(h,h.next),Qe(o,t,e,s,n,r,0),Qe(h,t,e,s,n,r,0);return}a=a.next}o=o.next}while(o!==i)}function Lh(i,t,e,s){const n=[];for(let r=0,o=t.length;r<o;r++){const a=t[r]*s,h=r<o-1?t[r+1]*s:i.length,l=no(i,a,h,s,!1);l===l.next&&(l.steiner=!0),n.push(Xh(l))}n.sort(zh);for(let r=0;r<n.length;r++)e=Hh(n[r],e);return e}function zh(i,t){let e=i.x-t.x;if(e===0&&(e=i.y-t.y,e===0)){const s=(i.next.y-i.y)/(i.next.x-i.x),n=(t.next.y-t.y)/(t.next.x-t.x);e=s-n}return e}function Hh(i,t){const e=Oh(i,t);if(!e)return t;const s=ao(e,i);return xe(s,s.next),xe(e,e.next)}function Oh(i,t){let e=t;const s=i.x,n=i.y;let r=-1/0,o;if(Ie(i,e))return e;do{if(Ie(i,e.next))return e.next;if(n<=e.y&&n>=e.next.y&&e.next.y!==e.y){const u=e.x+(n-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(u<=s&&u>r&&(r=u,o=e.x<e.next.x?e:e.next,u===s))return o}e=e.next}while(e!==t);if(!o)return null;const a=o,h=o.x,l=o.y;let c=1/0;e=o;do{if(s>=e.x&&e.x>=h&&s!==e.x&&ro(n<l?s:r,n,h,l,n<l?r:s,n,e.x,e.y)){const u=Math.abs(n-e.y)/(s-e.x);Je(e,i)&&(u<c||u===c&&(e.x>o.x||e.x===o.x&&Uh(o,e)))&&(o=e,c=u)}e=e.next}while(e!==a);return o}function Uh(i,t){return it(i.prev,i,t.prev)<0&&it(t.next,i,i.next)<0}function Yh(i,t,e,s){let n=i;do n.z===0&&(n.z=Si(n.x,n.y,t,e,s)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next;while(n!==i);n.prevZ.nextZ=null,n.prevZ=null,Nh(n)}function Nh(i){let t,e=1;do{let s=i,n;i=null;let r=null;for(t=0;s;){t++;let o=s,a=0;for(let l=0;l<e&&(a++,o=o.nextZ,!!o);l++);let h=e;for(;a>0||h>0&&o;)a!==0&&(h===0||!o||s.z<=o.z)?(n=s,s=s.nextZ,a--):(n=o,o=o.nextZ,h--),r?r.nextZ=n:i=n,n.prevZ=r,r=n;s=o}r.nextZ=null,e*=2}while(t>1);return i}function Si(i,t,e,s,n){return i=(i-e)*n|0,t=(t-s)*n|0,i=(i|i<<8)&16711935,i=(i|i<<4)&252645135,i=(i|i<<2)&858993459,i=(i|i<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,i|t<<1}function Xh(i){let t=i,e=i;do(t.x<e.x||t.x===e.x&&t.y<e.y)&&(e=t),t=t.next;while(t!==i);return e}function ro(i,t,e,s,n,r,o,a){return(n-o)*(t-a)>=(i-o)*(r-a)&&(i-o)*(s-a)>=(e-o)*(t-a)&&(e-o)*(r-a)>=(n-o)*(s-a)}function Ne(i,t,e,s,n,r,o,a){return!(i===o&&t===a)&&ro(i,t,e,s,n,r,o,a)}function Vh(i,t){return i.next.i!==t.i&&i.prev.i!==t.i&&!$h(i,t)&&(Je(i,t)&&Je(t,i)&&jh(i,t)&&(it(i.prev,i,t.prev)||it(i,t.prev,t))||Ie(i,t)&&it(i.prev,i,i.next)>0&&it(t.prev,t,t.next)>0)}function it(i,t,e){return(t.y-i.y)*(e.x-t.x)-(t.x-i.x)*(e.y-t.y)}function Ie(i,t){return i.x===t.x&&i.y===t.y}function oo(i,t,e,s){const n=_s(it(i,t,e)),r=_s(it(i,t,s)),o=_s(it(e,s,i)),a=_s(it(e,s,t));return!!(n!==r&&o!==a||n===0&&ys(i,e,t)||r===0&&ys(i,s,t)||o===0&&ys(e,i,s)||a===0&&ys(e,t,s))}function ys(i,t,e){return t.x<=Math.max(i.x,e.x)&&t.x>=Math.min(i.x,e.x)&&t.y<=Math.max(i.y,e.y)&&t.y>=Math.min(i.y,e.y)}function _s(i){return i>0?1:i<0?-1:0}function $h(i,t){let e=i;do{if(e.i!==i.i&&e.next.i!==i.i&&e.i!==t.i&&e.next.i!==t.i&&oo(e,e.next,i,t))return!0;e=e.next}while(e!==i);return!1}function Je(i,t){return it(i.prev,i,i.next)<0?it(i,t,i.next)>=0&&it(i,i.prev,t)>=0:it(i,t,i.prev)<0||it(i,i.next,t)<0}function jh(i,t){let e=i,s=!1;const n=(i.x+t.x)/2,r=(i.y+t.y)/2;do e.y>r!=e.next.y>r&&e.next.y!==e.y&&n<(e.next.x-e.x)*(r-e.y)/(e.next.y-e.y)+e.x&&(s=!s),e=e.next;while(e!==i);return s}function ao(i,t){const e=Ci(i.i,i.x,i.y),s=Ci(t.i,t.x,t.y),n=i.next,r=t.prev;return i.next=t,t.prev=i,e.next=n,n.prev=e,s.next=e,e.prev=s,r.next=s,s.prev=r,s}function In(i,t,e,s){const n=Ci(i,t,e);return s?(n.next=s.next,n.prev=s,s.next.prev=n,s.next=n):(n.prev=n,n.next=n),n}function ts(i){i.next.prev=i.prev,i.prev.next=i.next,i.prevZ&&(i.prevZ.nextZ=i.nextZ),i.nextZ&&(i.nextZ.prevZ=i.prevZ)}function Ci(i,t,e){return{i,x:t,y:e,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function qh(i,t,e,s){let n=0;for(let r=t,o=e-s;r<e;r+=s)n+=(i[o]-i[r])*(i[r+1]+i[o+1]),o=r;return n}const Kh=kn.default||kn;var ho=(i=>(i[i.NONE=0]="NONE",i[i.COLOR=16384]="COLOR",i[i.STENCIL=1024]="STENCIL",i[i.DEPTH=256]="DEPTH",i[i.COLOR_DEPTH=16640]="COLOR_DEPTH",i[i.COLOR_STENCIL=17408]="COLOR_STENCIL",i[i.DEPTH_STENCIL=1280]="DEPTH_STENCIL",i[i.ALL=17664]="ALL",i))(ho||{});class Zh{constructor(t){this.items=[],this._name=t}emit(t,e,s,n,r,o,a,h){const{name:l,items:c}=this;for(let u=0,f=c.length;u<f;u++)c[u][l](t,e,s,n,r,o,a,h);return this}add(t){return t[this._name]&&(this.remove(t),this.items.push(t)),this}remove(t){const e=this.items.indexOf(t);return e!==-1&&this.items.splice(e,1),this}contains(t){return this.items.indexOf(t)!==-1}removeAll(){return this.items.length=0,this}destroy(){this.removeAll(),this.items=null,this._name=null}get empty(){return this.items.length===0}get name(){return this._name}}const Qh=["init","destroy","contextChange","resolutionChange","resetState","renderEnd","renderStart","render","update","postrender","prerender"],lo=class co extends Yt{constructor(t){super(),this.tick=0,this.uid=at("renderer"),this.runners=Object.create(null),this.renderPipes=Object.create(null),this._initOptions={},this._systemsHash=Object.create(null),this.type=t.type,this.name=t.name,this.config=t;const e=[...Qh,...this.config.runners??[]];this._addRunners(...e),this._unsafeEvalCheck()}async init(t={}){const e=t.skipExtensionImports===!0?!0:t.manageImports===!1;await Eh(e),this._addSystems(this.config.systems),this._addPipes(this.config.renderPipes,this.config.renderPipeAdaptors);for(const s in this._systemsHash)t={...this._systemsHash[s].constructor.defaultOptions,...t};t={...co.defaultOptions,...t},this._roundPixels=t.roundPixels?1:0;for(let s=0;s<this.runners.init.items.length;s++)await this.runners.init.items[s].init(t);this._initOptions=t}render(t,e){this.tick++;let s=t;if(s instanceof kt&&(s={container:s},e&&($(ot,"passing a second argument is deprecated, please use render options instead"),s.target=e.renderTexture)),s.target||(s.target=this.view.renderTarget),s.target===this.view.renderTarget&&(this._lastObjectRendered=s.container,s.clearColor??(s.clearColor=this.background.colorRgba),s.clear??(s.clear=this.background.clearBeforeRender)),s.clearColor){const n=Array.isArray(s.clearColor)&&s.clearColor.length===4;s.clearColor=n?s.clearColor:nt.shared.setValue(s.clearColor).toArray()}s.transform||(s.container.updateLocalTransform(),s.transform=s.container.localTransform),s.container.visible&&(s.container.enableRenderGroup(),this.runners.prerender.emit(s),this.runners.renderStart.emit(s),this.runners.render.emit(s),this.runners.renderEnd.emit(s),this.runners.postrender.emit(s))}resize(t,e,s){const n=this.view.resolution;this.view.resize(t,e,s),this.emit("resize",this.view.screen.width,this.view.screen.height,this.view.resolution),s!==void 0&&s!==n&&this.runners.resolutionChange.emit(s)}clear(t={}){const e=this;t.target||(t.target=e.renderTarget.renderTarget),t.clearColor||(t.clearColor=this.background.colorRgba),t.clear??(t.clear=ho.ALL);const{clear:s,clearColor:n,target:r,mipLevel:o,layer:a}=t;nt.shared.setValue(n??this.background.colorRgba),e.renderTarget.clear(r,s,nt.shared.toArray(),o??0,a??0)}get resolution(){return this.view.resolution}set resolution(t){this.view.resolution=t,this.runners.resolutionChange.emit(t)}get width(){return this.view.texture.frame.width}get height(){return this.view.texture.frame.height}get canvas(){return this.view.canvas}get lastObjectRendered(){return this._lastObjectRendered}get renderingToScreen(){return this.renderTarget.renderingToScreen}get screen(){return this.view.screen}_addRunners(...t){t.forEach(e=>{this.runners[e]=new Zh(e)})}_addSystems(t){let e;for(e in t){const s=t[e];this._addSystem(s.value,s.name)}}_addSystem(t,e){const s=new t(this);if(this[e])throw new Error(`Whoops! The name "${e}" is already in use`);this[e]=s,this._systemsHash[e]=s;for(const n in this.runners)this.runners[n].add(s);return this}_addPipes(t,e){const s=e.reduce((n,r)=>(n[r.name]=r.value,n),{});t.forEach(n=>{const r=n.value,o=n.name,a=s[o];this.renderPipes[o]=new r(this,a?new a:null),this.runners.destroy.add(this.renderPipes[o])})}destroy(t=!1){this.runners.destroy.items.reverse(),this.runners.destroy.emit(t),(t===!0||typeof t=="object"&&t.releaseGlobalResources)&&is.release(),Object.values(this.runners).forEach(e=>{e.destroy()}),this._systemsHash=null,this.renderPipes=null,this.removeAllListeners()}generateTexture(t){return this.textureGenerator.generateTexture(t)}get roundPixels(){return!!this._roundPixels}_unsafeEvalCheck(){if(!Bh())throw new Error("Current environment does not allow unsafe-eval, please use pixi.js/unsafe-eval module to enable support.")}resetState(){this.runners.resetState.emit()}};lo.defaultOptions={resolution:1,failIfMajorPerformanceCaveat:!1,roundPixels:!1};let uo=lo,bs;function Jh(i){return bs!==void 0||(bs=(()=>{const t={stencil:!0,failIfMajorPerformanceCaveat:i??uo.defaultOptions.failIfMajorPerformanceCaveat};try{if(!ct.get().getWebGLRenderingContext())return!1;let s=ct.get().createCanvas().getContext("webgl",t);const n=!!s?.getContextAttributes()?.stencil;if(s){const r=s.getExtension("WEBGL_lose_context");r&&r.loseContext()}return s=null,n}catch{return!1}})()),bs}let ws;async function tl(i={}){return ws!==void 0||(ws=await(async()=>{const t=ct.get().getNavigator().gpu;if(!t)return!1;try{return await(await t.requestAdapter(i)).requestDevice(),!0}catch{return!1}})()),ws}const Rn=["webgl","webgpu","canvas"];async function el(i){let t=[];i.preference?Array.isArray(i.preference)?t=i.preference.slice():(t.push(i.preference),Rn.forEach(r=>{r!==i.preference&&t.push(r)})):t=Rn.slice();let e,s={};for(let r=0;r<t.length;r++){const o=t[r];if(o==="webgpu"&&await tl()){const{WebGPURenderer:a}=await Xe(async()=>{const{WebGPURenderer:h}=await import("./WebGPURenderer-BF6TF-is.js");return{WebGPURenderer:h}},__vite__mapDeps([12,13,14,2,3,4,5,6,7,8,9,10,11]));e=a,s={...i,...i.webgpu};break}else if(o==="webgl"&&Jh(i.failIfMajorPerformanceCaveat??uo.defaultOptions.failIfMajorPerformanceCaveat)){const{WebGLRenderer:a}=await Xe(async()=>{const{WebGLRenderer:h}=await import("./WebGLRenderer-Dm18dxOf.js");return{WebGLRenderer:h}},__vite__mapDeps([15,13,14,2,3,4,5,6,7,8,9,10,11]));e=a,s={...i,...i.webgl};break}else if(o==="canvas"){const{CanvasRenderer:a}=await Xe(async()=>{const{CanvasRenderer:h}=await import("./CanvasRenderer-DTKkZhq4.js");return{CanvasRenderer:h}},__vite__mapDeps([16,14,2,3,4,5,6,7,8,9,10,11]));e=a,s={...i,...i.canvasOptions};break}}if(delete s.webgpu,delete s.webgl,delete s.canvasOptions,!e)throw new Error("No available renderer for the current environment");const n=new e;return await n.init(s),n}const fo="8.19.0";class po{static init(){globalThis.__PIXI_APP_INIT__?.(this,fo)}static destroy(){}}po.extension=H.Application;class sl{constructor(t){this._renderer=t}init(){globalThis.__PIXI_RENDERER_INIT__?.(this._renderer,fo)}destroy(){this._renderer=null}}sl.extension={type:[H.WebGLSystem,H.WebGPUSystem],name:"initHook",priority:-10};class go{static init(t){Object.defineProperty(this,"resizeTo",{configurable:!0,set(e){globalThis.removeEventListener("resize",this.queueResize),this._resizeTo=e,e&&(globalThis.addEventListener("resize",this.queueResize),this.resize())},get(){return this._resizeTo}}),this.queueResize=()=>{this._resizeTo&&(this._cancelResize(),this._resizeId=requestAnimationFrame(()=>this.resize()))},this._cancelResize=()=>{this._resizeId&&(cancelAnimationFrame(this._resizeId),this._resizeId=null)},this.resize=()=>{if(!this._resizeTo)return;this._cancelResize();let e,s;if(this._resizeTo===globalThis.window)e=globalThis.innerWidth,s=globalThis.innerHeight;else{const{clientWidth:n,clientHeight:r}=this._resizeTo;e=n,s=r}this.renderer.resize(e,s),this.render()},this._resizeId=null,this._resizeTo=null,this.resizeTo=t.resizeTo||null}static destroy(){globalThis.removeEventListener("resize",this.queueResize),this._cancelResize(),this._cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null}}go.extension=H.Application;class mo{static init(t){t=Object.assign({autoStart:!0,sharedTicker:!1},t),Object.defineProperty(this,"ticker",{configurable:!0,set(e){this._ticker&&this._ticker.remove(this.render,this),this._ticker=e,e&&e.add(this.render,this,Ps.LOW)},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?ge.shared:new ge,t.autoStart&&this.start()}static destroy(){if(this._ticker){const t=this._ticker;this.ticker=null,t.destroy()}}}mo.extension=H.Application;ht.add(go);ht.add(mo);const xo=class Mi{constructor(...t){this.stage=new kt,t[0]!==void 0&&$(ot,"Application constructor options are deprecated, please use Application.init() instead.")}async init(t){t={...t},this.stage||(this.stage=new kt),this.renderer=await el(t),Mi._plugins.forEach(e=>{e.init.call(this,t)})}render(){this.renderer.render({container:this.stage})}get canvas(){return this.renderer.canvas}get view(){return $(ot,"Application.view is deprecated, please use Application.canvas instead."),this.renderer.canvas}get screen(){return this.renderer.screen}get domContainerRoot(){return this.renderer.renderPipes.dom?._domElement}destroy(t=!1,e=!1){const s=Mi._plugins.slice(0);s.reverse(),s.forEach(n=>{n.destroy.call(this)}),this.stage.destroy(e),this.stage=null,this.renderer.destroy(t),this.renderer=null}};xo._plugins=[];let yo=xo;ht.handleByList(H.Application,yo._plugins);ht.add(po);const oi={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},il=/([astvzqmhlc])([^astvzqmhlc]*)/gi,nl=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;function rl(i){const t=[];return i.replace(il,(e,s,n)=>{let r=s.toLowerCase(),o=s;const a=ol(n);for(r==="m"&&a.length>2&&(t.push([o,...a.splice(0,2)]),r="l",o=o==="m"?"l":"L");;){if(a.length===oi[r])return t.push([o,...a]),"";if(a.length<oi[r])throw new Error("malformed path data");t.push([o,...a.splice(0,oi[r])])}}),t}function ol(i){const t=i.match(nl);return t?t.map(Number):[]}function al(i,t){const e=rl(i),s=[];let n=null,r=0,o=0;for(let a=0;a<e.length;a++){const h=e[a],l=h[0],c=h;switch(l){case"M":r=c[1],o=c[2],t.moveTo(r,o);break;case"m":r+=c[1],o+=c[2],t.moveTo(r,o);break;case"H":r=c[1],t.lineTo(r,o);break;case"h":r+=c[1],t.lineTo(r,o);break;case"V":o=c[1],t.lineTo(r,o);break;case"v":o+=c[1],t.lineTo(r,o);break;case"L":r=c[1],o=c[2],t.lineTo(r,o);break;case"l":r+=c[1],o+=c[2],t.lineTo(r,o);break;case"C":r=c[5],o=c[6],t.bezierCurveTo(c[1],c[2],c[3],c[4],r,o);break;case"c":t.bezierCurveTo(r+c[1],o+c[2],r+c[3],o+c[4],r+c[5],o+c[6]),r+=c[5],o+=c[6];break;case"S":r=c[3],o=c[4],t.bezierCurveToShort(c[1],c[2],r,o);break;case"s":t.bezierCurveToShort(r+c[1],o+c[2],r+c[3],o+c[4]),r+=c[3],o+=c[4];break;case"Q":r=c[3],o=c[4],t.quadraticCurveTo(c[1],c[2],r,o);break;case"q":t.quadraticCurveTo(r+c[1],o+c[2],r+c[3],o+c[4]),r+=c[3],o+=c[4];break;case"T":r=c[1],o=c[2],t.quadraticCurveToShort(r,o);break;case"t":r+=c[1],o+=c[2],t.quadraticCurveToShort(r,o);break;case"A":r=c[6],o=c[7],t.arcToSvg(c[1],c[2],c[3],c[4],c[5],r,o);break;case"a":r+=c[6],o+=c[7],t.arcToSvg(c[1],c[2],c[3],c[4],c[5],r,o);break;case"Z":case"z":t.closePath(),s.length>0&&(n=s.pop(),n?(r=n.startX,o=n.startY):(r=0,o=0)),n=null;break;default:bt(`Unknown SVG path command: ${l}`)}l!=="Z"&&l!=="z"&&n===null&&(n={startX:r,startY:o},s.push(n))}return t}class zi{constructor(t=0,e=0,s=0){this.type="circle",this.x=t,this.y=e,this.radius=s}clone(){return new zi(this.x,this.y,this.radius)}contains(t,e){if(this.radius<=0)return!1;const s=this.radius*this.radius;let n=this.x-t,r=this.y-e;return n*=n,r*=r,n+r<=s}strokeContains(t,e,s,n=.5){if(this.radius===0)return!1;const r=this.x-t,o=this.y-e,a=this.radius,h=(1-n)*s,l=Math.sqrt(r*r+o*o);return l<=a+h&&l>a-(s-h)}getBounds(t){return t||(t=new Q),t.x=this.x-this.radius,t.y=this.y-this.radius,t.width=this.radius*2,t.height=this.radius*2,t}copyFrom(t){return this.x=t.x,this.y=t.y,this.radius=t.radius,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`}}class Hi{constructor(t=0,e=0,s=0,n=0){this.type="ellipse",this.x=t,this.y=e,this.halfWidth=s,this.halfHeight=n}clone(){return new Hi(this.x,this.y,this.halfWidth,this.halfHeight)}contains(t,e){if(this.halfWidth<=0||this.halfHeight<=0)return!1;let s=(t-this.x)/this.halfWidth,n=(e-this.y)/this.halfHeight;return s*=s,n*=n,s+n<=1}strokeContains(t,e,s,n=.5){const{halfWidth:r,halfHeight:o}=this;if(r<=0||o<=0)return!1;const a=s*(1-n),h=s-a,l=r-h,c=o-h,u=r+a,f=o+a,d=t-this.x,p=e-this.y,x=d*d/(l*l)+p*p/(c*c),g=d*d/(u*u)+p*p/(f*f);return x>1&&g<=1}getBounds(t){return t||(t=new Q),t.x=this.x-this.halfWidth,t.y=this.y-this.halfHeight,t.width=this.halfWidth*2,t.height=this.halfHeight*2,t}copyFrom(t){return this.x=t.x,this.y=t.y,this.halfWidth=t.halfWidth,this.halfHeight=t.halfHeight,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:Ellipse x=${this.x} y=${this.y} halfWidth=${this.halfWidth} halfHeight=${this.halfHeight}]`}}function hl(i,t,e,s,n,r){const o=i-e,a=t-s,h=n-e,l=r-s,c=o*h+a*l,u=h*h+l*l;let f=-1;u!==0&&(f=c/u);let d,p;f<0?(d=e,p=s):f>1?(d=n,p=r):(d=e+f*h,p=s+f*l);const x=i-d,g=t-p;return x*x+g*g}let ll,cl;class $e{constructor(...t){this.type="polygon";let e=Array.isArray(t[0])?t[0]:t;if(typeof e[0]!="number"){const s=[];for(let n=0,r=e.length;n<r;n++)s.push(e[n].x,e[n].y);e=s}this.points=e,this.closePath=!0}isClockwise(){let t=0;const e=this.points,s=e.length;for(let n=0;n<s;n+=2){const r=e[n],o=e[n+1],a=e[(n+2)%s],h=e[(n+3)%s];t+=(a-r)*(h+o)}return t<0}containsPolygon(t){const e=this.getBounds(ll),s=t.getBounds(cl);if(!e.containsRect(s))return!1;const n=t.points;for(let r=0;r<n.length;r+=2){const o=n[r],a=n[r+1];if(!this.contains(o,a))return!1}return!0}clone(){const t=this.points.slice(),e=new $e(t);return e.closePath=this.closePath,e}contains(t,e){let s=!1;const n=this.points.length/2;for(let r=0,o=n-1;r<n;o=r++){const a=this.points[r*2],h=this.points[r*2+1],l=this.points[o*2],c=this.points[o*2+1];h>e!=c>e&&t<(l-a)*((e-h)/(c-h))+a&&(s=!s)}return s}strokeContains(t,e,s,n=.5){const r=s*s,o=r*(1-n),a=r-o,{points:h}=this,l=h.length-(this.closePath?0:2);for(let c=0;c<l;c+=2){const u=h[c],f=h[c+1],d=h[(c+2)%h.length],p=h[(c+3)%h.length],x=hl(t,e,u,f,d,p),g=Math.sign((d-u)*(e-f)-(p-f)*(t-u));if(x<=(g<0?a:o))return!0}return!1}getBounds(t){t||(t=new Q);const e=this.points;let s=1/0,n=-1/0,r=1/0,o=-1/0;for(let a=0,h=e.length;a<h;a+=2){const l=e[a],c=e[a+1];s=l<s?l:s,n=l>n?l:n,r=c<r?c:r,o=c>o?c:o}return t.x=s,t.width=n-s,t.y=r,t.height=o-r,t}copyFrom(t){return this.points=t.points.slice(),this.closePath=t.closePath,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:PolygoncloseStroke=${this.closePath}points=${this.points.reduce((t,e)=>`${t}, ${e}`,"")}]`}get lastX(){return this.points[this.points.length-2]}get lastY(){return this.points[this.points.length-1]}get x(){return $("8.11.0","Polygon.lastX is deprecated, please use Polygon.lastX instead."),this.points[this.points.length-2]}get y(){return $("8.11.0","Polygon.y is deprecated, please use Polygon.lastY instead."),this.points[this.points.length-1]}get startX(){return this.points[0]}get startY(){return this.points[1]}}const vs=(i,t,e,s,n,r,o)=>{const a=i-e,h=t-s,l=Math.sqrt(a*a+h*h);return l>=n-r&&l<=n+o};class Oi{constructor(t=0,e=0,s=0,n=0,r=20){this.type="roundedRectangle",this.x=t,this.y=e,this.width=s,this.height=n,this.radius=r}getBounds(t){return t||(t=new Q),t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t}clone(){return new Oi(this.x,this.y,this.width,this.height,this.radius)}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.copyFrom(this),t}contains(t,e){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){const s=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(e>=this.y+s&&e<=this.y+this.height-s||t>=this.x+s&&t<=this.x+this.width-s)return!0;let n=t-(this.x+s),r=e-(this.y+s);const o=s*s;if(n*n+r*r<=o||(n=t-(this.x+this.width-s),n*n+r*r<=o)||(r=e-(this.y+this.height-s),n*n+r*r<=o)||(n=t-(this.x+s),n*n+r*r<=o))return!0}return!1}strokeContains(t,e,s,n=.5){const{x:r,y:o,width:a,height:h,radius:l}=this,c=s*(1-n),u=s-c,f=r+l,d=o+l,p=a-l*2,x=h-l*2,g=r+a,m=o+h;return(t>=r-c&&t<=r+u||t>=g-u&&t<=g+c)&&e>=d&&e<=d+x||(e>=o-c&&e<=o+u||e>=m-u&&e<=m+c)&&t>=f&&t<=f+p?!0:t<f&&e<d&&vs(t,e,f,d,l,u,c)||t>g-l&&e<d&&vs(t,e,g-l,d,l,u,c)||t>g-l&&e>m-l&&vs(t,e,g-l,m-l,l,u,c)||t<f&&e>m-l&&vs(t,e,f,m-l,l,u,c)}toString(){return`[pixi.js/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`}}const _o={};function ul(i,t,e){let s=2166136261;for(let n=0;n<t;n++)s^=i[n].uid,s=Math.imul(s,16777619),s>>>=0;return _o[s]||dl(i,t,s,e)}function dl(i,t,e,s){const n={};let r=0;for(let a=0;a<s;a++){const h=a<t?i[a]:K.EMPTY.source;n[r++]=h.source,n[r++]=h.style}const o=new Ts(n);return _o[e]=o,o}class En{constructor(t){typeof t=="number"?this.rawBinaryData=new ArrayBuffer(t):t instanceof Uint8Array?this.rawBinaryData=t.buffer:this.rawBinaryData=t,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData),this.size=this.rawBinaryData.byteLength}get int8View(){return this._int8View||(this._int8View=new Int8Array(this.rawBinaryData)),this._int8View}get uint8View(){return this._uint8View||(this._uint8View=new Uint8Array(this.rawBinaryData)),this._uint8View}get int16View(){return this._int16View||(this._int16View=new Int16Array(this.rawBinaryData)),this._int16View}get int32View(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View}get float64View(){return this._float64Array||(this._float64Array=new Float64Array(this.rawBinaryData)),this._float64Array}get bigUint64View(){return this._bigUint64Array||(this._bigUint64Array=new BigUint64Array(this.rawBinaryData)),this._bigUint64Array}view(t){return this[`${t}View`]}destroy(){this.rawBinaryData=null,this.uint32View=null,this.float32View=null,this.uint16View=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._int32View=null,this._float64Array=null,this._bigUint64Array=null}static sizeOf(t){switch(t){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(`${t} isn't a valid view type`)}}}function Bn(i,t,e,s){if(e??(e=0),s??(s=Math.min(i.byteLength-e,t.byteLength)),!(e&7)&&!(s&7)){const n=s/8;new Float64Array(t,0,n).set(new Float64Array(i,e,n))}else if(!(e&3)&&!(s&3)){const n=s/4;new Float32Array(t,0,n).set(new Float32Array(i,e,n))}else new Uint8Array(t).set(new Uint8Array(i,e,s))}const fl={normal:"normal-npm",add:"add-npm",screen:"screen-npm"};var pl=(i=>(i[i.DISABLED=0]="DISABLED",i[i.RENDERING_MASK_ADD=1]="RENDERING_MASK_ADD",i[i.MASK_ACTIVE=2]="MASK_ACTIVE",i[i.INVERSE_MASK_ACTIVE=3]="INVERSE_MASK_ACTIVE",i[i.RENDERING_MASK_REMOVE=4]="RENDERING_MASK_REMOVE",i[i.NONE=5]="NONE",i))(pl||{});function Wn(i,t){return t.alphaMode==="no-premultiply-alpha"&&fl[i]||i}const gl=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(`
|
|
24
24
|
`);function ml(i){let t="";for(let e=0;e<i;++e)e>0&&(t+=`
|
|
25
25
|
else `),e<i-1&&(t+=`if(test == ${e}.0){}`);return t}function xl(i,t){if(i===0)throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");const e=t.createShader(t.FRAGMENT_SHADER);try{for(;;){const s=gl.replace(/%forloop%/gi,ml(i));if(t.shaderSource(e,s),t.compileShader(e),!t.getShaderParameter(e,t.COMPILE_STATUS))i=i/2|0;else break}}finally{t.deleteShader(e)}return i}let _e=null;function yl(){if(_e)return _e;const i=qr();return _e=i.getParameter(i.MAX_TEXTURE_IMAGE_UNITS),_e=xl(_e,i),i.getExtension("WEBGL_lose_context")?.loseContext(),_e}class _l{constructor(){this.ids=Object.create(null),this.textures=[],this.count=0}clear(){for(let t=0;t<this.count;t++){const e=this.textures[t];this.textures[t]=null,this.ids[e.uid]=null}this.count=0}}class bl{constructor(){this.renderPipeId="batch",this.action="startBatch",this.start=0,this.size=0,this.textures=new _l,this.blendMode="normal",this.topology="triangle-strip",this.canBundle=!0}destroy(){this.textures=null,this.gpuBindGroup=null,this.bindGroup=null,this.batcher=null,this.elements=null}}const je=[];let ks=0;is.register({clear:()=>{if(je.length>0)for(const i of je)i&&i.destroy();je.length=0,ks=0}});function Gn(){return ks>0?je[--ks]:new bl}function Fn(i){i.elements=null,je[ks++]=i}let ze=0;const bo=class wo{constructor(t){this.uid=at("batcher"),this.dirty=!0,this.batchIndex=0,this.batches=[],this._elements=[],t={...wo.defaultOptions,...t},t.maxTextures||($("v8.8.0","maxTextures is a required option for Batcher now, please pass it in the options"),t.maxTextures=yl());const{maxTextures:e,attributesInitialSize:s,indicesInitialSize:n}=t;this.attributeBuffer=new En(s*4),this.indexBuffer=new Uint16Array(n),this.maxTextures=e}begin(){this.elementSize=0,this.elementStart=0,this.indexSize=0,this.attributeSize=0;for(let t=0;t<this.batchIndex;t++)Fn(this.batches[t]);this.batchIndex=0,this._batchIndexStart=0,this._batchIndexSize=0,this.dirty=!0}add(t){this._elements[this.elementSize++]=t,t._indexStart=this.indexSize,t._attributeStart=this.attributeSize,t._batcher=this,this.indexSize+=t.indexSize,this.attributeSize+=t.attributeSize*this.vertexSize}checkAndUpdateTexture(t,e){const s=t._batch.textures.ids[e._source.uid];return!s&&s!==0?!1:(t._textureId=s,t.texture=e,!0)}updateElement(t){this.dirty=!0;const e=this.attributeBuffer;t.packAsQuad?this.packQuadAttributes(t,e.float32View,e.uint32View,t._attributeStart,t._textureId):this.packAttributes(t,e.float32View,e.uint32View,t._attributeStart,t._textureId)}break(t){const e=this._elements;if(!e[this.elementStart])return;let s=Gn(),n=s.textures;n.clear();const r=e[this.elementStart];let o=Wn(r.blendMode,r.texture._source),a=r.topology;this.attributeSize*4>this.attributeBuffer.size&&this._resizeAttributeBuffer(this.attributeSize*4),this.indexSize>this.indexBuffer.length&&this._resizeIndexBuffer(this.indexSize);const h=this.attributeBuffer.float32View,l=this.attributeBuffer.uint32View,c=this.indexBuffer;let u=this._batchIndexSize,f=this._batchIndexStart,d="startBatch",p=[];const x=this.maxTextures;for(let g=this.elementStart;g<this.elementSize;++g){const m=e[g];e[g]=null;const y=m.texture._source,b=Wn(m.blendMode,y),w=o!==b||a!==m.topology;if(y._batchTick===ze&&!w){m._textureId=y._textureBindLocation,u+=m.indexSize,m.packAsQuad?(this.packQuadAttributes(m,h,l,m._attributeStart,m._textureId),this.packQuadIndex(c,m._indexStart,m._attributeStart/this.vertexSize)):(this.packAttributes(m,h,l,m._attributeStart,m._textureId),this.packIndex(m,c,m._indexStart,m._attributeStart/this.vertexSize)),m._batch=s,p.push(m);continue}y._batchTick=ze,(n.count>=x||w)&&(this._finishBatch(s,f,u-f,n,o,a,t,d,p),d="renderBatch",f=u,o=b,a=m.topology,s=Gn(),n=s.textures,n.clear(),p=[],++ze),m._textureId=y._textureBindLocation=n.count,n.ids[y.uid]=n.count,n.textures[n.count++]=y,m._batch=s,p.push(m),u+=m.indexSize,m.packAsQuad?(this.packQuadAttributes(m,h,l,m._attributeStart,m._textureId),this.packQuadIndex(c,m._indexStart,m._attributeStart/this.vertexSize)):(this.packAttributes(m,h,l,m._attributeStart,m._textureId),this.packIndex(m,c,m._indexStart,m._attributeStart/this.vertexSize))}n.count>0&&(this._finishBatch(s,f,u-f,n,o,a,t,d,p),f=u,++ze),this.elementStart=this.elementSize,this._batchIndexStart=f,this._batchIndexSize=u}_finishBatch(t,e,s,n,r,o,a,h,l){t.gpuBindGroup=null,t.bindGroup=null,t.action=h,t.batcher=this,t.textures=n,t.blendMode=r,t.topology=o,t.start=e,t.size=s,t.elements=l,++ze,this.batches[this.batchIndex++]=t,a.add(t)}finish(t){this.break(t)}ensureAttributeBuffer(t){t*4<=this.attributeBuffer.size||this._resizeAttributeBuffer(t*4)}ensureIndexBuffer(t){t<=this.indexBuffer.length||this._resizeIndexBuffer(t)}_resizeAttributeBuffer(t){const e=Math.max(t,this.attributeBuffer.size*2),s=new En(e);Bn(this.attributeBuffer.rawBinaryData,s.rawBinaryData),this.attributeBuffer=s}_resizeIndexBuffer(t){const e=this.indexBuffer;let s=Math.max(t,e.length*1.5);s+=s%2;const n=s>65535?new Uint32Array(s):new Uint16Array(s);if(n.BYTES_PER_ELEMENT!==e.BYTES_PER_ELEMENT)for(let r=0;r<e.length;r++)n[r]=e[r];else Bn(e.buffer,n.buffer);this.indexBuffer=n}packQuadIndex(t,e,s){t[e]=s+0,t[e+1]=s+1,t[e+2]=s+2,t[e+3]=s+0,t[e+4]=s+2,t[e+5]=s+3}packIndex(t,e,s,n){const r=t.indices,o=t.indexSize,a=t.indexOffset,h=t.attributeOffset;for(let l=0;l<o;l++)e[s++]=n+r[l+a]-h}destroy(t={}){if(this.batches!==null){for(let e=0;e<this.batchIndex;e++)Fn(this.batches[e]);this.batches=null,this.geometry.destroy(!0),this.geometry=null,t.shader&&(this.shader?.destroy(),this.shader=null);for(let e=0;e<this._elements.length;e++)this._elements[e]&&(this._elements[e]._batch=null);this._elements=null,this.indexBuffer=null,this.attributeBuffer.destroy(),this.attributeBuffer=null}}};bo.defaultOptions={maxTextures:null,attributesInitialSize:4,indicesInitialSize:6};let wl=bo;var wt=(i=>(i[i.MAP_READ=1]="MAP_READ",i[i.MAP_WRITE=2]="MAP_WRITE",i[i.COPY_SRC=4]="COPY_SRC",i[i.COPY_DST=8]="COPY_DST",i[i.INDEX=16]="INDEX",i[i.VERTEX=32]="VERTEX",i[i.UNIFORM=64]="UNIFORM",i[i.STORAGE=128]="STORAGE",i[i.INDIRECT=256]="INDIRECT",i[i.QUERY_RESOLVE=512]="QUERY_RESOLVE",i[i.STATIC=1024]="STATIC",i))(wt||{});class es extends Yt{constructor(t){let{data:e,size:s}=t;const{usage:n,label:r,shrinkToFit:o}=t;super(),this._gpuData=Object.create(null),this._gcLastUsed=-1,this.autoGarbageCollect=!0,this.uid=at("buffer"),this._resourceType="buffer",this._resourceId=at("resource"),this._touched=0,this._updateID=1,this._dataInt32=null,this.shrinkToFit=!0,this.destroyed=!1,e instanceof Array&&(e=new Float32Array(e)),this._data=e,s??(s=e?.byteLength);const a=!!e;this.descriptor={size:s,usage:n,mappedAtCreation:a,label:r},this.shrinkToFit=o??!0}get data(){return this._data}set data(t){this.setDataWithSize(t,t.length,!0)}get dataInt32(){return this._dataInt32||(this._dataInt32=new Int32Array(this.data.buffer)),this._dataInt32}get static(){return!!(this.descriptor.usage&wt.STATIC)}set static(t){t?this.descriptor.usage|=wt.STATIC:this.descriptor.usage&=~wt.STATIC}setDataWithSize(t,e,s){if(this._updateID++,this._updateSize=e*t.BYTES_PER_ELEMENT,this._data===t){s&&this.emit("update",this);return}const n=this._data;if(this._data=t,this._dataInt32=null,!n||n.length!==t.length){!this.shrinkToFit&&n&&t.byteLength<n.byteLength?s&&this.emit("update",this):(this.descriptor.size=t.byteLength,this._resourceId=at("resource"),this.emit("change",this));return}s&&this.emit("update",this)}update(t){this._updateSize=t??this._updateSize,this._updateID++,this.emit("update",this)}unload(){this.emit("unload",this);for(const t in this._gpuData)this._gpuData[t]?.destroy();this._gpuData=Object.create(null)}destroy(){this.destroyed=!0,this.unload(),this.emit("destroy",this),this.emit("change",this),this._data=null,this.descriptor=null,this.removeAllListeners()}}function vo(i,t){if(!(i instanceof es)){let e=t?wt.INDEX:wt.VERTEX;i instanceof Array&&(t?(i=new Uint32Array(i),e=wt.INDEX|wt.COPY_DST):(i=new Float32Array(i),e=wt.VERTEX|wt.COPY_DST)),i=new es({data:i,label:t?"index-mesh-buffer":"vertex-mesh-buffer",usage:e})}return i}function vl(i,t,e){const s=i.getAttribute(t);if(!s)return e.minX=0,e.minY=0,e.maxX=0,e.maxY=0,e;const n=s.buffer.data;let r=1/0,o=1/0,a=-1/0,h=-1/0;const l=n.BYTES_PER_ELEMENT,c=(s.offset||0)/l,u=(s.stride||8)/l;for(let f=c;f<n.length;f+=u){const d=n[f],p=n[f+1];d>a&&(a=d),p>h&&(h=p),d<r&&(r=d),p<o&&(o=p)}return e.minX=r,e.minY=o,e.maxX=a,e.maxY=h,e}function Sl(i){return(i instanceof es||Array.isArray(i)||i.BYTES_PER_ELEMENT)&&(i={buffer:i}),i.buffer=vo(i.buffer,!1),i}class Cl extends Yt{constructor(t={}){super(),this._gpuData=Object.create(null),this.autoGarbageCollect=!0,this._gcLastUsed=-1,this.uid=at("geometry"),this._layoutKey=0,this.instanceCount=1,this._bounds=new It,this._boundsDirty=!0;const{attributes:e,indexBuffer:s,topology:n}=t;if(this.buffers=[],this.attributes={},e)for(const r in e)this.addAttribute(r,e[r]);this.instanceCount=t.instanceCount??1,s&&this.addIndex(s),this.topology=n||"triangle-list"}onBufferUpdate(){this._boundsDirty=!0,this.emit("update",this)}getAttribute(t){return this.attributes[t]}getIndex(){return this.indexBuffer}getBuffer(t){return this.getAttribute(t).buffer}getSize(){for(const t in this.attributes){const e=this.attributes[t];return e.buffer.data.length/(e.stride/4||e.size)}return 0}addAttribute(t,e){const s=Sl(e);this.buffers.indexOf(s.buffer)===-1&&(this.buffers.push(s.buffer),s.buffer.on("update",this.onBufferUpdate,this),s.buffer.on("change",this.onBufferUpdate,this)),this.attributes[t]=s}addIndex(t){this.indexBuffer=vo(t,!0),this.buffers.push(this.indexBuffer)}get bounds(){return this._boundsDirty?(this._boundsDirty=!1,vl(this,"aPosition",this._bounds)):this._bounds}unload(){this.emit("unload",this);for(const t in this._gpuData)this._gpuData[t]?.destroy();this._gpuData=Object.create(null)}destroy(t=!1){this.emit("destroy",this),this.removeAllListeners(),t&&this.buffers.forEach(e=>e.destroy()),this.unload(),this.indexBuffer?.destroy(),this.attributes=null,this.buffers=null,this.indexBuffer=null,this._bounds=null}}const Ml=new Float32Array(1),Tl=new Uint32Array(1);class Al extends Cl{constructor(){const e=new es({data:Ml,label:"attribute-batch-buffer",usage:wt.VERTEX|wt.COPY_DST,shrinkToFit:!1}),s=new es({data:Tl,label:"index-batch-buffer",usage:wt.INDEX|wt.COPY_DST,shrinkToFit:!1}),n=24;super({attributes:{aPosition:{buffer:e,format:"float32x2",stride:n,offset:0},aUV:{buffer:e,format:"float32x2",stride:n,offset:8},aColor:{buffer:e,format:"unorm8x4",stride:n,offset:16},aTextureIdAndRound:{buffer:e,format:"uint16x2",stride:n,offset:20}},indexBuffer:s})}}function Dn(i,t,e){if(i)for(const s in i){const n=s.toLocaleLowerCase(),r=t[n];if(r){let o=i[s];s==="header"&&(o=o.replace(/@in\s+[^;]+;\s*/g,"").replace(/@out\s+[^;]+;\s*/g,"")),e&&r.push(`//----${e}----//`),r.push(o)}else bt(`${s} placement hook does not exist in shader`)}}const Pl=/\{\{(.*?)\}\}/g;function Ln(i){const t={};return(i.match(Pl)?.map(s=>s.replace(/[{()}]/g,""))??[]).forEach(s=>{t[s]=[]}),t}function zn(i,t){let e;const s=/@in\s+([^;]+);/g;for(;(e=s.exec(i))!==null;)t.push(e[1])}function Hn(i,t,e=!1){const s=[];zn(t,s),i.forEach(a=>{a.header&&zn(a.header,s)});const n=s;e&&n.sort();const r=n.map((a,h)=>` @location(${h}) ${a},`).join(`
|
|
26
26
|
`);let o=t.replace(/@in\s+[^;]+;\s*/g,"");return o=o.replace("{{in}}",`
|