@drincs/pixi-vn 1.2.19 → 1.2.20

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/index.cjs CHANGED
@@ -1,9 +1,9 @@
1
- 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var vI=Object.create;var Ff=Object.defineProperty;var TI=Object.getOwnPropertyDescriptor;var SI=Object.getOwnPropertyNames;var EI=Object.getPrototypeOf,CI=Object.prototype.hasOwnProperty;var OC=r=>{throw TypeError(r)};var AI=(r,e,t)=>e in r?Ff(r,e,{enumerable:true,configurable:true,writable:true,value:t}):r[e]=t;var Kb=(r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+r+'" is not supported')});var f=(r,e)=>()=>(r&&(e=r(r=0)),e);var Qr=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),Zi=(r,e)=>{for(var t in e)Ff(r,t,{get:e[t],enumerable:true});},PI=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of SI(e))!CI.call(r,s)&&s!==t&&Ff(r,s,{get:()=>e[s],enumerable:!(i=TI(e,s))||i.enumerable});return r};var tu=(r,e,t)=>(t=r!=null?vI(EI(r)):{},PI(Ff(t,"default",{value:r,enumerable:true}),r));var R=(r,e,t)=>AI(r,typeof e!="symbol"?e+"":e,t),Zb=(r,e,t)=>e.has(r)||OC("Cannot "+t);var v=(r,e,t)=>(Zb(r,e,"read from private field"),t?t.call(r):e.get(r)),Ce=(r,e,t)=>e.has(r)?OC("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),ee=(r,e,t,i)=>(Zb(r,e,"write to private field"),e.set(r,t),t),q=(r,e,t)=>(Zb(r,e,"access private method"),t);var Gf=(r,e,t,i)=>({set _(s){ee(r,e,s);},get _(){return v(r,e,i)}});var x,Qb,ru,V,B=f(()=>{x=(r=>(r.Application="application",r.WebGLPipes="webgl-pipes",r.WebGLPipesAdaptor="webgl-pipes-adaptor",r.WebGLSystem="webgl-system",r.WebGPUPipes="webgpu-pipes",r.WebGPUPipesAdaptor="webgpu-pipes-adaptor",r.WebGPUSystem="webgpu-system",r.CanvasSystem="canvas-system",r.CanvasPipesAdaptor="canvas-pipes-adaptor",r.CanvasPipes="canvas-pipes",r.Asset="asset",r.LoadParser="load-parser",r.ResolveParser="resolve-parser",r.CacheParser="cache-parser",r.DetectionParser="detection-parser",r.MaskEffect="mask-effect",r.BlendMode="blend-mode",r.TextureSource="texture-source",r.Environment="environment",r.ShapeBuilder="shape-builder",r.Batcher="batcher",r))(x||{}),Qb=r=>{if(typeof r=="function"||typeof r=="object"&&r.extension){if(!r.extension)throw new Error("Extension class must have an extension object");r={...typeof r.extension!="object"?{type:r.extension}:r.extension,ref:r};}if(typeof r=="object")r={...r};else throw new Error("Invalid extension type");return typeof r.type=="string"&&(r.type=[r.type]),r},ru=(r,e)=>Qb(r).priority??e,V={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...r){return r.map(Qb).forEach(e=>{e.type.forEach(t=>this._removeHandlers[t]?.(e));}),this},add(...r){return r.map(Qb).forEach(e=>{e.type.forEach(t=>{let i=this._addHandlers,s=this._queue;i[t]?i[t]?.(e):(s[t]=s[t]||[],s[t]?.push(e));});}),this},handle(r,e,t){let i=this._addHandlers,s=this._removeHandlers;if(i[r]||s[r])throw new Error(`Extension type ${r} already has a handler`);i[r]=e,s[r]=t;let n=this._queue;return n[r]&&(n[r]?.forEach(o=>e(o)),delete n[r]),this},handleByMap(r,e){return this.handle(r,t=>{t.name&&(e[t.name]=t.ref);},t=>{t.name&&delete e[t.name];})},handleByNamedList(r,e,t=-1){return this.handle(r,i=>{e.findIndex(n=>n.name===i.name)>=0||(e.push({name:i.name,value:i.ref}),e.sort((n,o)=>ru(o.value,t)-ru(n.value,t)));},i=>{let s=e.findIndex(n=>n.name===i.name);s!==-1&&e.splice(s,1);})},handleByList(r,e,t=-1){return this.handle(r,i=>{e.includes(i.ref)||(e.push(i.ref),e.sort((s,n)=>ru(n,t)-ru(s,t)));},i=>{let s=e.indexOf(i.ref);s!==-1&&e.splice(s,1);})},mixin(r,...e){for(let t of e)Object.defineProperties(r.prototype,Object.getOwnPropertyDescriptors(t));}};});var GC=Qr((AG,Jb)=>{var wI=Object.prototype.hasOwnProperty,rr="~";function wc(){}Object.create&&(wc.prototype=Object.create(null),new wc().__proto__||(rr=false));function BI(r,e,t){this.fn=r,this.context=e,this.once=t||false;}function FC(r,e,t,i,s){if(typeof t!="function")throw new TypeError("The listener must be a function");var n=new BI(t,i||r,s),o=rr?rr+e:e;return r._events[o]?r._events[o].fn?r._events[o]=[r._events[o],n]:r._events[o].push(n):(r._events[o]=n,r._eventsCount++),r}function Uf(r,e){--r._eventsCount===0?r._events=new wc:delete r._events[e];}function Wt(){this._events=new wc,this._eventsCount=0;}Wt.prototype.eventNames=function(){var e=[],t,i;if(this._eventsCount===0)return e;for(i in t=this._events)wI.call(t,i)&&e.push(rr?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e};Wt.prototype.listeners=function(e){var t=rr?rr+e:e,i=this._events[t];if(!i)return [];if(i.fn)return [i.fn];for(var s=0,n=i.length,o=new Array(n);s<n;s++)o[s]=i[s].fn;return o};Wt.prototype.listenerCount=function(e){var t=rr?rr+e:e,i=this._events[t];return i?i.fn?1:i.length:0};Wt.prototype.emit=function(e,t,i,s,n,o){var a=rr?rr+e:e;if(!this._events[a])return false;var u=this._events[a],l=arguments.length,c,h;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,true),l){case 1:return u.fn.call(u.context),true;case 2:return u.fn.call(u.context,t),true;case 3:return u.fn.call(u.context,t,i),true;case 4:return u.fn.call(u.context,t,i,s),true;case 5:return u.fn.call(u.context,t,i,s,n),true;case 6:return u.fn.call(u.context,t,i,s,n,o),true}for(h=1,c=new Array(l-1);h<l;h++)c[h-1]=arguments[h];u.fn.apply(u.context,c);}else {var d=u.length,p;for(h=0;h<d;h++)switch(u[h].once&&this.removeListener(e,u[h].fn,void 0,true),l){case 1:u[h].fn.call(u[h].context);break;case 2:u[h].fn.call(u[h].context,t);break;case 3:u[h].fn.call(u[h].context,t,i);break;case 4:u[h].fn.call(u[h].context,t,i,s);break;default:if(!c)for(p=1,c=new Array(l-1);p<l;p++)c[p-1]=arguments[p];u[h].fn.apply(u[h].context,c);}}return true};Wt.prototype.on=function(e,t,i){return FC(this,e,t,i,false)};Wt.prototype.once=function(e,t,i){return FC(this,e,t,i,true)};Wt.prototype.removeListener=function(e,t,i,s){var n=rr?rr+e:e;if(!this._events[n])return this;if(!t)return Uf(this,n),this;var o=this._events[n];if(o.fn)o.fn===t&&(!s||o.once)&&(!i||o.context===i)&&Uf(this,n);else {for(var a=0,u=[],l=o.length;a<l;a++)(o[a].fn!==t||s&&!o[a].once||i&&o[a].context!==i)&&u.push(o[a]);u.length?this._events[n]=u.length===1?u[0]:u:Uf(this,n);}return this};Wt.prototype.removeAllListeners=function(e){var t;return e?(t=rr?rr+e:e,this._events[t]&&Uf(this,t)):(this._events=new wc,this._eventsCount=0),this};Wt.prototype.off=Wt.prototype.removeListener;Wt.prototype.addListener=Wt.prototype.on;Wt.prefixed=rr;Wt.EventEmitter=Wt;typeof Jb<"u"&&(Jb.exports=Wt);});var UC,_e,Ut=f(()=>{UC=tu(GC()),_e=UC.default;});var RI,Qi,Bt,Fr,YC,LC,ey,MI,Lf,jC,$C,NC,HC,VC,Bc,II,DI,kI,OI,iy,zC,FI,ty,ry,WC,sy,Jr,XC,qC,KC=f(()=>{RI={grad:.9,turn:360,rad:360/(2*Math.PI)},Qi=function(r){return typeof r=="string"?r.length>0:typeof r=="number"},Bt=function(r,e,t){return e===void 0&&(e=0),t===void 0&&(t=Math.pow(10,e)),Math.round(t*r)/t+0},Fr=function(r,e,t){return e===void 0&&(e=0),t===void 0&&(t=1),r>t?t:r>e?r:e},YC=function(r){return (r=isFinite(r)?r%360:0)>0?r:r+360},LC=function(r){return {r:Fr(r.r,0,255),g:Fr(r.g,0,255),b:Fr(r.b,0,255),a:Fr(r.a)}},ey=function(r){return {r:Bt(r.r),g:Bt(r.g),b:Bt(r.b),a:Bt(r.a,3)}},MI=/^#([0-9a-f]{3,8})$/i,Lf=function(r){var e=r.toString(16);return e.length<2?"0"+e:e},jC=function(r){var e=r.r,t=r.g,i=r.b,s=r.a,n=Math.max(e,t,i),o=n-Math.min(e,t,i),a=o?n===e?(t-i)/o:n===t?2+(i-e)/o:4+(e-t)/o:0;return {h:60*(a<0?a+6:a),s:n?o/n*100:0,v:n/255*100,a:s}},$C=function(r){var e=r.h,t=r.s,i=r.v,s=r.a;e=e/360*6,t/=100,i/=100;var n=Math.floor(e),o=i*(1-t),a=i*(1-(e-n)*t),u=i*(1-(1-e+n)*t),l=n%6;return {r:255*[i,a,o,o,u,i][l],g:255*[u,i,i,a,o,o][l],b:255*[o,o,u,i,i,a][l],a:s}},NC=function(r){return {h:YC(r.h),s:Fr(r.s,0,100),l:Fr(r.l,0,100),a:Fr(r.a)}},HC=function(r){return {h:Bt(r.h),s:Bt(r.s),l:Bt(r.l),a:Bt(r.a,3)}},VC=function(r){return $C((t=(e=r).s,{h:e.h,s:(t*=((i=e.l)<50?i:100-i)/100)>0?2*t/(i+t)*100:0,v:i+t,a:e.a}));var e,t,i;},Bc=function(r){return {h:(e=jC(r)).h,s:(s=(200-(t=e.s))*(i=e.v)/100)>0&&s<200?t*i/100/(s<=100?s:200-s)*100:0,l:s/2,a:e.a};var e,t,i,s;},II=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,DI=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,kI=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,OI=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,iy={string:[[function(r){var e=MI.exec(r);return e?(r=e[1]).length<=4?{r:parseInt(r[0]+r[0],16),g:parseInt(r[1]+r[1],16),b:parseInt(r[2]+r[2],16),a:r.length===4?Bt(parseInt(r[3]+r[3],16)/255,2):1}:r.length===6||r.length===8?{r:parseInt(r.substr(0,2),16),g:parseInt(r.substr(2,2),16),b:parseInt(r.substr(4,2),16),a:r.length===8?Bt(parseInt(r.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(r){var e=kI.exec(r)||OI.exec(r);return e?e[2]!==e[4]||e[4]!==e[6]?null:LC({r:Number(e[1])/(e[2]?100/255:1),g:Number(e[3])/(e[4]?100/255:1),b:Number(e[5])/(e[6]?100/255:1),a:e[7]===void 0?1:Number(e[7])/(e[8]?100:1)}):null},"rgb"],[function(r){var e=II.exec(r)||DI.exec(r);if(!e)return null;var t,i,s=NC({h:(t=e[1],i=e[2],i===void 0&&(i="deg"),Number(t)*(RI[i]||1)),s:Number(e[3]),l:Number(e[4]),a:e[5]===void 0?1:Number(e[5])/(e[6]?100:1)});return VC(s)},"hsl"]],object:[[function(r){var e=r.r,t=r.g,i=r.b,s=r.a,n=s===void 0?1:s;return Qi(e)&&Qi(t)&&Qi(i)?LC({r:Number(e),g:Number(t),b:Number(i),a:Number(n)}):null},"rgb"],[function(r){var e=r.h,t=r.s,i=r.l,s=r.a,n=s===void 0?1:s;if(!Qi(e)||!Qi(t)||!Qi(i))return null;var o=NC({h:Number(e),s:Number(t),l:Number(i),a:Number(n)});return VC(o)},"hsl"],[function(r){var e=r.h,t=r.s,i=r.v,s=r.a,n=s===void 0?1:s;if(!Qi(e)||!Qi(t)||!Qi(i))return null;var o=function(a){return {h:YC(a.h),s:Fr(a.s,0,100),v:Fr(a.v,0,100),a:Fr(a.a)}}({h:Number(e),s:Number(t),v:Number(i),a:Number(n)});return $C(o)},"hsv"]]},zC=function(r,e){for(var t=0;t<e.length;t++){var i=e[t][0](r);if(i)return [i,e[t][1]]}return [null,void 0]},FI=function(r){return typeof r=="string"?zC(r.trim(),iy.string):typeof r=="object"&&r!==null?zC(r,iy.object):[null,void 0]},ty=function(r,e){var t=Bc(r);return {h:t.h,s:Fr(t.s+100*e,0,100),l:t.l,a:t.a}},ry=function(r){return (299*r.r+587*r.g+114*r.b)/1e3/255},WC=function(r,e){var t=Bc(r);return {h:t.h,s:t.s,l:Fr(t.l+100*e,0,100),a:t.a}},sy=function(){function r(e){this.parsed=FI(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1};}return r.prototype.isValid=function(){return this.parsed!==null},r.prototype.brightness=function(){return Bt(ry(this.rgba),2)},r.prototype.isDark=function(){return ry(this.rgba)<.5},r.prototype.isLight=function(){return ry(this.rgba)>=.5},r.prototype.toHex=function(){return e=ey(this.rgba),t=e.r,i=e.g,s=e.b,o=(n=e.a)<1?Lf(Bt(255*n)):"","#"+Lf(t)+Lf(i)+Lf(s)+o;var e,t,i,s,n,o;},r.prototype.toRgb=function(){return ey(this.rgba)},r.prototype.toRgbString=function(){return e=ey(this.rgba),t=e.r,i=e.g,s=e.b,(n=e.a)<1?"rgba("+t+", "+i+", "+s+", "+n+")":"rgb("+t+", "+i+", "+s+")";var e,t,i,s,n;},r.prototype.toHsl=function(){return HC(Bc(this.rgba))},r.prototype.toHslString=function(){return e=HC(Bc(this.rgba)),t=e.h,i=e.s,s=e.l,(n=e.a)<1?"hsla("+t+", "+i+"%, "+s+"%, "+n+")":"hsl("+t+", "+i+"%, "+s+"%)";var e,t,i,s,n;},r.prototype.toHsv=function(){return e=jC(this.rgba),{h:Bt(e.h),s:Bt(e.s),v:Bt(e.v),a:Bt(e.a,3)};var e;},r.prototype.invert=function(){return Jr({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e;},r.prototype.saturate=function(e){return e===void 0&&(e=.1),Jr(ty(this.rgba,e))},r.prototype.desaturate=function(e){return e===void 0&&(e=.1),Jr(ty(this.rgba,-e))},r.prototype.grayscale=function(){return Jr(ty(this.rgba,-1))},r.prototype.lighten=function(e){return e===void 0&&(e=.1),Jr(WC(this.rgba,e))},r.prototype.darken=function(e){return e===void 0&&(e=.1),Jr(WC(this.rgba,-e))},r.prototype.rotate=function(e){return e===void 0&&(e=15),this.hue(this.hue()+e)},r.prototype.alpha=function(e){return typeof e=="number"?Jr({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):Bt(this.rgba.a,3);var t;},r.prototype.hue=function(e){var t=Bc(this.rgba);return typeof e=="number"?Jr({h:e,s:t.s,l:t.l,a:t.a}):Bt(t.h)},r.prototype.isEqual=function(e){return this.toHex()===Jr(e).toHex()},r}(),Jr=function(r){return r instanceof sy?r:new sy(r)},XC=[],qC=function(r){r.forEach(function(e){XC.indexOf(e)<0&&(e(sy,iy),XC.push(e));});};});function ZC(r,e){var t={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"},i={};for(var s in t)i[t[s]]=s;var n={};r.prototype.toName=function(o){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return "transparent";var a,u,l=i[this.toHex()];if(l)return l;if(o?.closest){var c=this.toRgb(),h=1/0,d="black";if(!n.length)for(var p in t)n[p]=new r(t[p]).toRgb();for(var m in t){var b=(a=c,u=n[m],Math.pow(a.r-u.r,2)+Math.pow(a.g-u.g,2)+Math.pow(a.b-u.b,2));b<h&&(h=b,d=m);}return d}},e.string.push([function(o){var a=o.toLowerCase(),u=a==="transparent"?"#0000":t[a];return u?new r(u).toRgb():null},"name"]);}var QC=f(()=>{});var iu,te,gt=f(()=>{KC();QC();qC([ZC]);iu=class Rc{constructor(e=16777215){this._value=null,this._components=new Float32Array(4),this._components.fill(1),this._int=16777215,this.value=e;}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(e){return this.value=e,this}set value(e){if(e instanceof Rc)this._value=this._cloneSource(e._value),this._int=e._int,this._components.set(e._components);else {if(e===null)throw new Error("Cannot set Color#value to null");(this._value===null||!this._isSourceEqual(this._value,e))&&(this._value=this._cloneSource(e),this._normalize(this._value));}}get value(){return this._value}_cloneSource(e){return typeof e=="string"||typeof e=="number"||e instanceof Number||e===null?e:Array.isArray(e)||ArrayBuffer.isView(e)?e.slice(0):typeof e=="object"&&e!==null?{...e}:e}_isSourceEqual(e,t){let i=typeof e;if(i!==typeof t)return false;if(i==="number"||i==="string"||e instanceof Number)return e===t;if(Array.isArray(e)&&Array.isArray(t)||ArrayBuffer.isView(e)&&ArrayBuffer.isView(t))return e.length!==t.length?false:e.every((n,o)=>n===t[o]);if(e!==null&&t!==null){let n=Object.keys(e),o=Object.keys(t);return n.length!==o.length?false:n.every(a=>e[a]===t[a])}return e===t}toRgba(){let[e,t,i,s]=this._components;return {r:e,g:t,b:i,a:s}}toRgb(){let[e,t,i]=this._components;return {r:e,g:t,b:i}}toRgbaString(){let[e,t,i]=this.toUint8RgbArray();return `rgba(${e},${t},${i},${this.alpha})`}toUint8RgbArray(e){let[t,i,s]=this._components;return this._arrayRgb||(this._arrayRgb=[]),e||(e=this._arrayRgb),e[0]=Math.round(t*255),e[1]=Math.round(i*255),e[2]=Math.round(s*255),e}toArray(e){this._arrayRgba||(this._arrayRgba=[]),e||(e=this._arrayRgba);let[t,i,s,n]=this._components;return e[0]=t,e[1]=i,e[2]=s,e[3]=n,e}toRgbArray(e){this._arrayRgb||(this._arrayRgb=[]),e||(e=this._arrayRgb);let[t,i,s]=this._components;return e[0]=t,e[1]=i,e[2]=s,e}toNumber(){return this._int}toBgrNumber(){let[e,t,i]=this.toUint8RgbArray();return (i<<16)+(t<<8)+e}toLittleEndianNumber(){let e=this._int;return (e>>16)+(e&65280)+((e&255)<<16)}multiply(e){let[t,i,s,n]=Rc._temp.setValue(e)._components;return this._components[0]*=t,this._components[1]*=i,this._components[2]*=s,this._components[3]*=n,this._refreshInt(),this._value=null,this}premultiply(e,t=true){return t&&(this._components[0]*=e,this._components[1]*=e,this._components[2]*=e),this._components[3]=e,this._refreshInt(),this._value=null,this}toPremultiplied(e,t=true){if(e===1)return (255<<24)+this._int;if(e===0)return t?0:this._int;let i=this._int>>16&255,s=this._int>>8&255,n=this._int&255;return t&&(i=i*e+.5|0,s=s*e+.5|0,n=n*e+.5|0),(e*255<<24)+(i<<16)+(s<<8)+n}toHex(){let e=this._int.toString(16);return `#${"000000".substring(0,6-e.length)+e}`}toHexa(){let t=Math.round(this._components[3]*255).toString(16);return this.toHex()+"00".substring(0,2-t.length)+t}setAlpha(e){return this._components[3]=this._clamp(e),this}_normalize(e){let t,i,s,n;if((typeof e=="number"||e instanceof Number)&&e>=0&&e<=16777215){let o=e;t=(o>>16&255)/255,i=(o>>8&255)/255,s=(o&255)/255,n=1;}else if((Array.isArray(e)||e instanceof Float32Array)&&e.length>=3&&e.length<=4)e=this._clamp(e),[t,i,s,n=1]=e;else if((e instanceof Uint8Array||e instanceof Uint8ClampedArray)&&e.length>=3&&e.length<=4)e=this._clamp(e,0,255),[t,i,s,n=255]=e,t/=255,i/=255,s/=255,n/=255;else if(typeof e=="string"||typeof e=="object"){if(typeof e=="string"){let a=Rc.HEX_PATTERN.exec(e);a&&(e=`#${a[2]}`);}let o=Jr(e);o.isValid()&&({r:t,g:i,b:s,a:n}=o.rgba,t/=255,i/=255,s/=255);}if(t!==void 0)this._components[0]=t,this._components[1]=i,this._components[2]=s,this._components[3]=n,this._refreshInt();else throw new Error(`Unable to convert color ${e}`)}_refreshInt(){this._clamp(this._components);let[e,t,i]=this._components;this._int=(e*255<<16)+(t*255<<8)+(i*255|0);}_clamp(e,t=0,i=1){return typeof e=="number"?Math.min(Math.max(e,t),i):(e.forEach((s,n)=>{e[n]=Math.min(Math.max(s,t),i);}),e)}static isColorLike(e){return typeof e=="number"||typeof e=="string"||e instanceof Number||e instanceof Rc||Array.isArray(e)||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Float32Array||e.r!==void 0&&e.g!==void 0&&e.b!==void 0||e.r!==void 0&&e.g!==void 0&&e.b!==void 0&&e.a!==void 0||e.h!==void 0&&e.s!==void 0&&e.l!==void 0||e.h!==void 0&&e.s!==void 0&&e.l!==void 0&&e.a!==void 0||e.h!==void 0&&e.s!==void 0&&e.v!==void 0||e.h!==void 0&&e.s!==void 0&&e.v!==void 0&&e.a!==void 0}};iu.shared=new iu;iu._temp=new iu;iu.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;te=iu;});var Nf,ny=f(()=>{Nf={cullArea:null,cullable:false,cullableChildren:true};});var Hf,Vf,zf,Wf=f(()=>{Hf=Math.PI*2,Vf=180/Math.PI,zf=Math.PI/180;});var me,oy,cr=f(()=>{me=class r{constructor(e=0,t=0){this.x=0,this.y=0,this.x=e,this.y=t;}clone(){return new r(this.x,this.y)}copyFrom(e){return this.set(e.x,e.y),this}copyTo(e){return e.set(this.x,this.y),e}equals(e){return e.x===this.x&&e.y===this.y}set(e=0,t=e){return this.x=e,this.y=t,this}toString(){return `[pixi.js/math:Point x=${this.x} y=${this.y}]`}static get shared(){return oy.x=0,oy.y=0,oy}},oy=new me;});var G,GI,UI,Te=f(()=>{Wf();cr();G=class r{constructor(e=1,t=0,i=0,s=1,n=0,o=0){this.array=null,this.a=e,this.b=t,this.c=i,this.d=s,this.tx=n,this.ty=o;}fromArray(e){this.a=e[0],this.b=e[1],this.c=e[3],this.d=e[4],this.tx=e[2],this.ty=e[5];}set(e,t,i,s,n,o){return this.a=e,this.b=t,this.c=i,this.d=s,this.tx=n,this.ty=o,this}toArray(e,t){this.array||(this.array=new Float32Array(9));let i=t||this.array;return e?(i[0]=this.a,i[1]=this.b,i[2]=0,i[3]=this.c,i[4]=this.d,i[5]=0,i[6]=this.tx,i[7]=this.ty,i[8]=1):(i[0]=this.a,i[1]=this.c,i[2]=this.tx,i[3]=this.b,i[4]=this.d,i[5]=this.ty,i[6]=0,i[7]=0,i[8]=1),i}apply(e,t){t=t||new me;let i=e.x,s=e.y;return t.x=this.a*i+this.c*s+this.tx,t.y=this.b*i+this.d*s+this.ty,t}applyInverse(e,t){t=t||new me;let i=this.a,s=this.b,n=this.c,o=this.d,a=this.tx,u=this.ty,l=1/(i*o+n*-s),c=e.x,h=e.y;return t.x=o*l*c+-n*l*h+(u*n-a*o)*l,t.y=i*l*h+-s*l*c+(-u*i+a*s)*l,t}translate(e,t){return this.tx+=e,this.ty+=t,this}scale(e,t){return this.a*=e,this.d*=t,this.c*=e,this.b*=t,this.tx*=e,this.ty*=t,this}rotate(e){let t=Math.cos(e),i=Math.sin(e),s=this.a,n=this.c,o=this.tx;return this.a=s*t-this.b*i,this.b=s*i+this.b*t,this.c=n*t-this.d*i,this.d=n*i+this.d*t,this.tx=o*t-this.ty*i,this.ty=o*i+this.ty*t,this}append(e){let t=this.a,i=this.b,s=this.c,n=this.d;return this.a=e.a*t+e.b*s,this.b=e.a*i+e.b*n,this.c=e.c*t+e.d*s,this.d=e.c*i+e.d*n,this.tx=e.tx*t+e.ty*s+this.tx,this.ty=e.tx*i+e.ty*n+this.ty,this}appendFrom(e,t){let i=e.a,s=e.b,n=e.c,o=e.d,a=e.tx,u=e.ty,l=t.a,c=t.b,h=t.c,d=t.d;return this.a=i*l+s*h,this.b=i*c+s*d,this.c=n*l+o*h,this.d=n*c+o*d,this.tx=a*l+u*h+t.tx,this.ty=a*c+u*d+t.ty,this}setTransform(e,t,i,s,n,o,a,u,l){return this.a=Math.cos(a+l)*n,this.b=Math.sin(a+l)*n,this.c=-Math.sin(a-u)*o,this.d=Math.cos(a-u)*o,this.tx=e-(i*this.a+s*this.c),this.ty=t-(i*this.b+s*this.d),this}prepend(e){let t=this.tx;if(e.a!==1||e.b!==0||e.c!==0||e.d!==1){let i=this.a,s=this.c;this.a=i*e.a+this.b*e.c,this.b=i*e.b+this.b*e.d,this.c=s*e.a+this.d*e.c,this.d=s*e.b+this.d*e.d;}return this.tx=t*e.a+this.ty*e.c+e.tx,this.ty=t*e.b+this.ty*e.d+e.ty,this}decompose(e){let t=this.a,i=this.b,s=this.c,n=this.d,o=e.pivot,a=-Math.atan2(-s,n),u=Math.atan2(i,t),l=Math.abs(a+u);return l<1e-5||Math.abs(Hf-l)<1e-5?(e.rotation=u,e.skew.x=e.skew.y=0):(e.rotation=0,e.skew.x=a,e.skew.y=u),e.scale.x=Math.sqrt(t*t+i*i),e.scale.y=Math.sqrt(s*s+n*n),e.position.x=this.tx+(o.x*t+o.y*s),e.position.y=this.ty+(o.x*i+o.y*n),e}invert(){let e=this.a,t=this.b,i=this.c,s=this.d,n=this.tx,o=e*s-t*i;return this.a=s/o,this.b=-t/o,this.c=-i/o,this.d=e/o,this.tx=(i*this.ty-s*n)/o,this.ty=-(e*this.ty-t*n)/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(){let e=new r;return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyTo(e){return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyFrom(e){return this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.ty,this}equals(e){return e.a===this.a&&e.b===this.b&&e.c===this.c&&e.d===this.d&&e.tx===this.tx&&e.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 UI.identity()}static get shared(){return GI.identity()}},GI=new G,UI=new G;});var Ne,ws=f(()=>{Ne=class r{constructor(e,t,i){this._x=t||0,this._y=i||0,this._observer=e;}clone(e){return new r(e??this._observer,this._x,this._y)}set(e=0,t=e){return (this._x!==e||this._y!==t)&&(this._x=e,this._y=t,this._observer._onUpdate(this)),this}copyFrom(e){return (this._x!==e.x||this._y!==e.y)&&(this._x=e.x,this._y=e.y,this._observer._onUpdate(this)),this}copyTo(e){return e.set(this._x,this._y),e}equals(e){return e.x===this._x&&e.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(e){this._x!==e&&(this._x=e,this._observer._onUpdate(this));}get y(){return this._y}set y(e){this._y!==e&&(this._y=e,this._observer._onUpdate(this));}};});function ce(r="default"){return Mc[r]===void 0&&(Mc[r]=-1),++Mc[r]}function JC(){for(let r in Mc)delete Mc[r];}var Mc,Et=f(()=>{Mc={default:-1};});function U(r,e,t=3){if(eA[e])return;let i=new Error().stack;typeof i>"u"?console.warn("PixiJS Deprecation Warning: ",`${e}
1
+ 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var vI=Object.create;var Ff=Object.defineProperty;var TI=Object.getOwnPropertyDescriptor;var SI=Object.getOwnPropertyNames;var EI=Object.getPrototypeOf,CI=Object.prototype.hasOwnProperty;var OC=r=>{throw TypeError(r)};var AI=(r,e,t)=>e in r?Ff(r,e,{enumerable:true,configurable:true,writable:true,value:t}):r[e]=t;var Kb=(r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+r+'" is not supported')});var f=(r,e)=>()=>(r&&(e=r(r=0)),e);var Qr=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),Zi=(r,e)=>{for(var t in e)Ff(r,t,{get:e[t],enumerable:true});},PI=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of SI(e))!CI.call(r,s)&&s!==t&&Ff(r,s,{get:()=>e[s],enumerable:!(i=TI(e,s))||i.enumerable});return r};var tu=(r,e,t)=>(t=r!=null?vI(EI(r)):{},PI(Ff(t,"default",{value:r,enumerable:true}),r));var R=(r,e,t)=>AI(r,typeof e!="symbol"?e+"":e,t),Zb=(r,e,t)=>e.has(r)||OC("Cannot "+t);var v=(r,e,t)=>(Zb(r,e,"read from private field"),t?t.call(r):e.get(r)),Ce=(r,e,t)=>e.has(r)?OC("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),ee=(r,e,t,i)=>(Zb(r,e,"write to private field"),e.set(r,t),t),q=(r,e,t)=>(Zb(r,e,"access private method"),t);var Gf=(r,e,t,i)=>({set _(s){ee(r,e,s);},get _(){return v(r,e,i)}});var x,Qb,ru,V,B=f(()=>{x=(r=>(r.Application="application",r.WebGLPipes="webgl-pipes",r.WebGLPipesAdaptor="webgl-pipes-adaptor",r.WebGLSystem="webgl-system",r.WebGPUPipes="webgpu-pipes",r.WebGPUPipesAdaptor="webgpu-pipes-adaptor",r.WebGPUSystem="webgpu-system",r.CanvasSystem="canvas-system",r.CanvasPipesAdaptor="canvas-pipes-adaptor",r.CanvasPipes="canvas-pipes",r.Asset="asset",r.LoadParser="load-parser",r.ResolveParser="resolve-parser",r.CacheParser="cache-parser",r.DetectionParser="detection-parser",r.MaskEffect="mask-effect",r.BlendMode="blend-mode",r.TextureSource="texture-source",r.Environment="environment",r.ShapeBuilder="shape-builder",r.Batcher="batcher",r))(x||{}),Qb=r=>{if(typeof r=="function"||typeof r=="object"&&r.extension){if(!r.extension)throw new Error("Extension class must have an extension object");r={...typeof r.extension!="object"?{type:r.extension}:r.extension,ref:r};}if(typeof r=="object")r={...r};else throw new Error("Invalid extension type");return typeof r.type=="string"&&(r.type=[r.type]),r},ru=(r,e)=>Qb(r).priority??e,V={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...r){return r.map(Qb).forEach(e=>{e.type.forEach(t=>this._removeHandlers[t]?.(e));}),this},add(...r){return r.map(Qb).forEach(e=>{e.type.forEach(t=>{let i=this._addHandlers,s=this._queue;i[t]?i[t]?.(e):(s[t]=s[t]||[],s[t]?.push(e));});}),this},handle(r,e,t){let i=this._addHandlers,s=this._removeHandlers;if(i[r]||s[r])throw new Error(`Extension type ${r} already has a handler`);i[r]=e,s[r]=t;let n=this._queue;return n[r]&&(n[r]?.forEach(o=>e(o)),delete n[r]),this},handleByMap(r,e){return this.handle(r,t=>{t.name&&(e[t.name]=t.ref);},t=>{t.name&&delete e[t.name];})},handleByNamedList(r,e,t=-1){return this.handle(r,i=>{e.findIndex(n=>n.name===i.name)>=0||(e.push({name:i.name,value:i.ref}),e.sort((n,o)=>ru(o.value,t)-ru(n.value,t)));},i=>{let s=e.findIndex(n=>n.name===i.name);s!==-1&&e.splice(s,1);})},handleByList(r,e,t=-1){return this.handle(r,i=>{e.includes(i.ref)||(e.push(i.ref),e.sort((s,n)=>ru(n,t)-ru(s,t)));},i=>{let s=e.indexOf(i.ref);s!==-1&&e.splice(s,1);})},mixin(r,...e){for(let t of e)Object.defineProperties(r.prototype,Object.getOwnPropertyDescriptors(t));}};});var GC=Qr((AG,Jb)=>{var wI=Object.prototype.hasOwnProperty,rr="~";function wc(){}Object.create&&(wc.prototype=Object.create(null),new wc().__proto__||(rr=false));function BI(r,e,t){this.fn=r,this.context=e,this.once=t||false;}function FC(r,e,t,i,s){if(typeof t!="function")throw new TypeError("The listener must be a function");var n=new BI(t,i||r,s),o=rr?rr+e:e;return r._events[o]?r._events[o].fn?r._events[o]=[r._events[o],n]:r._events[o].push(n):(r._events[o]=n,r._eventsCount++),r}function Uf(r,e){--r._eventsCount===0?r._events=new wc:delete r._events[e];}function Wt(){this._events=new wc,this._eventsCount=0;}Wt.prototype.eventNames=function(){var e=[],t,i;if(this._eventsCount===0)return e;for(i in t=this._events)wI.call(t,i)&&e.push(rr?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e};Wt.prototype.listeners=function(e){var t=rr?rr+e:e,i=this._events[t];if(!i)return [];if(i.fn)return [i.fn];for(var s=0,n=i.length,o=new Array(n);s<n;s++)o[s]=i[s].fn;return o};Wt.prototype.listenerCount=function(e){var t=rr?rr+e:e,i=this._events[t];return i?i.fn?1:i.length:0};Wt.prototype.emit=function(e,t,i,s,n,o){var a=rr?rr+e:e;if(!this._events[a])return false;var u=this._events[a],l=arguments.length,c,h;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,true),l){case 1:return u.fn.call(u.context),true;case 2:return u.fn.call(u.context,t),true;case 3:return u.fn.call(u.context,t,i),true;case 4:return u.fn.call(u.context,t,i,s),true;case 5:return u.fn.call(u.context,t,i,s,n),true;case 6:return u.fn.call(u.context,t,i,s,n,o),true}for(h=1,c=new Array(l-1);h<l;h++)c[h-1]=arguments[h];u.fn.apply(u.context,c);}else {var d=u.length,p;for(h=0;h<d;h++)switch(u[h].once&&this.removeListener(e,u[h].fn,void 0,true),l){case 1:u[h].fn.call(u[h].context);break;case 2:u[h].fn.call(u[h].context,t);break;case 3:u[h].fn.call(u[h].context,t,i);break;case 4:u[h].fn.call(u[h].context,t,i,s);break;default:if(!c)for(p=1,c=new Array(l-1);p<l;p++)c[p-1]=arguments[p];u[h].fn.apply(u[h].context,c);}}return true};Wt.prototype.on=function(e,t,i){return FC(this,e,t,i,false)};Wt.prototype.once=function(e,t,i){return FC(this,e,t,i,true)};Wt.prototype.removeListener=function(e,t,i,s){var n=rr?rr+e:e;if(!this._events[n])return this;if(!t)return Uf(this,n),this;var o=this._events[n];if(o.fn)o.fn===t&&(!s||o.once)&&(!i||o.context===i)&&Uf(this,n);else {for(var a=0,u=[],l=o.length;a<l;a++)(o[a].fn!==t||s&&!o[a].once||i&&o[a].context!==i)&&u.push(o[a]);u.length?this._events[n]=u.length===1?u[0]:u:Uf(this,n);}return this};Wt.prototype.removeAllListeners=function(e){var t;return e?(t=rr?rr+e:e,this._events[t]&&Uf(this,t)):(this._events=new wc,this._eventsCount=0),this};Wt.prototype.off=Wt.prototype.removeListener;Wt.prototype.addListener=Wt.prototype.on;Wt.prefixed=rr;Wt.EventEmitter=Wt;typeof Jb<"u"&&(Jb.exports=Wt);});var UC,_e,Ut=f(()=>{UC=tu(GC()),_e=UC.default;});var RI,Qi,Bt,Or,YC,LC,ey,MI,Lf,jC,$C,NC,HC,VC,Bc,II,DI,kI,OI,iy,zC,FI,ty,ry,WC,sy,Jr,XC,qC,KC=f(()=>{RI={grad:.9,turn:360,rad:360/(2*Math.PI)},Qi=function(r){return typeof r=="string"?r.length>0:typeof r=="number"},Bt=function(r,e,t){return e===void 0&&(e=0),t===void 0&&(t=Math.pow(10,e)),Math.round(t*r)/t+0},Or=function(r,e,t){return e===void 0&&(e=0),t===void 0&&(t=1),r>t?t:r>e?r:e},YC=function(r){return (r=isFinite(r)?r%360:0)>0?r:r+360},LC=function(r){return {r:Or(r.r,0,255),g:Or(r.g,0,255),b:Or(r.b,0,255),a:Or(r.a)}},ey=function(r){return {r:Bt(r.r),g:Bt(r.g),b:Bt(r.b),a:Bt(r.a,3)}},MI=/^#([0-9a-f]{3,8})$/i,Lf=function(r){var e=r.toString(16);return e.length<2?"0"+e:e},jC=function(r){var e=r.r,t=r.g,i=r.b,s=r.a,n=Math.max(e,t,i),o=n-Math.min(e,t,i),a=o?n===e?(t-i)/o:n===t?2+(i-e)/o:4+(e-t)/o:0;return {h:60*(a<0?a+6:a),s:n?o/n*100:0,v:n/255*100,a:s}},$C=function(r){var e=r.h,t=r.s,i=r.v,s=r.a;e=e/360*6,t/=100,i/=100;var n=Math.floor(e),o=i*(1-t),a=i*(1-(e-n)*t),u=i*(1-(1-e+n)*t),l=n%6;return {r:255*[i,a,o,o,u,i][l],g:255*[u,i,i,a,o,o][l],b:255*[o,o,u,i,i,a][l],a:s}},NC=function(r){return {h:YC(r.h),s:Or(r.s,0,100),l:Or(r.l,0,100),a:Or(r.a)}},HC=function(r){return {h:Bt(r.h),s:Bt(r.s),l:Bt(r.l),a:Bt(r.a,3)}},VC=function(r){return $C((t=(e=r).s,{h:e.h,s:(t*=((i=e.l)<50?i:100-i)/100)>0?2*t/(i+t)*100:0,v:i+t,a:e.a}));var e,t,i;},Bc=function(r){return {h:(e=jC(r)).h,s:(s=(200-(t=e.s))*(i=e.v)/100)>0&&s<200?t*i/100/(s<=100?s:200-s)*100:0,l:s/2,a:e.a};var e,t,i,s;},II=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,DI=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,kI=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,OI=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,iy={string:[[function(r){var e=MI.exec(r);return e?(r=e[1]).length<=4?{r:parseInt(r[0]+r[0],16),g:parseInt(r[1]+r[1],16),b:parseInt(r[2]+r[2],16),a:r.length===4?Bt(parseInt(r[3]+r[3],16)/255,2):1}:r.length===6||r.length===8?{r:parseInt(r.substr(0,2),16),g:parseInt(r.substr(2,2),16),b:parseInt(r.substr(4,2),16),a:r.length===8?Bt(parseInt(r.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(r){var e=kI.exec(r)||OI.exec(r);return e?e[2]!==e[4]||e[4]!==e[6]?null:LC({r:Number(e[1])/(e[2]?100/255:1),g:Number(e[3])/(e[4]?100/255:1),b:Number(e[5])/(e[6]?100/255:1),a:e[7]===void 0?1:Number(e[7])/(e[8]?100:1)}):null},"rgb"],[function(r){var e=II.exec(r)||DI.exec(r);if(!e)return null;var t,i,s=NC({h:(t=e[1],i=e[2],i===void 0&&(i="deg"),Number(t)*(RI[i]||1)),s:Number(e[3]),l:Number(e[4]),a:e[5]===void 0?1:Number(e[5])/(e[6]?100:1)});return VC(s)},"hsl"]],object:[[function(r){var e=r.r,t=r.g,i=r.b,s=r.a,n=s===void 0?1:s;return Qi(e)&&Qi(t)&&Qi(i)?LC({r:Number(e),g:Number(t),b:Number(i),a:Number(n)}):null},"rgb"],[function(r){var e=r.h,t=r.s,i=r.l,s=r.a,n=s===void 0?1:s;if(!Qi(e)||!Qi(t)||!Qi(i))return null;var o=NC({h:Number(e),s:Number(t),l:Number(i),a:Number(n)});return VC(o)},"hsl"],[function(r){var e=r.h,t=r.s,i=r.v,s=r.a,n=s===void 0?1:s;if(!Qi(e)||!Qi(t)||!Qi(i))return null;var o=function(a){return {h:YC(a.h),s:Or(a.s,0,100),v:Or(a.v,0,100),a:Or(a.a)}}({h:Number(e),s:Number(t),v:Number(i),a:Number(n)});return $C(o)},"hsv"]]},zC=function(r,e){for(var t=0;t<e.length;t++){var i=e[t][0](r);if(i)return [i,e[t][1]]}return [null,void 0]},FI=function(r){return typeof r=="string"?zC(r.trim(),iy.string):typeof r=="object"&&r!==null?zC(r,iy.object):[null,void 0]},ty=function(r,e){var t=Bc(r);return {h:t.h,s:Or(t.s+100*e,0,100),l:t.l,a:t.a}},ry=function(r){return (299*r.r+587*r.g+114*r.b)/1e3/255},WC=function(r,e){var t=Bc(r);return {h:t.h,s:t.s,l:Or(t.l+100*e,0,100),a:t.a}},sy=function(){function r(e){this.parsed=FI(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1};}return r.prototype.isValid=function(){return this.parsed!==null},r.prototype.brightness=function(){return Bt(ry(this.rgba),2)},r.prototype.isDark=function(){return ry(this.rgba)<.5},r.prototype.isLight=function(){return ry(this.rgba)>=.5},r.prototype.toHex=function(){return e=ey(this.rgba),t=e.r,i=e.g,s=e.b,o=(n=e.a)<1?Lf(Bt(255*n)):"","#"+Lf(t)+Lf(i)+Lf(s)+o;var e,t,i,s,n,o;},r.prototype.toRgb=function(){return ey(this.rgba)},r.prototype.toRgbString=function(){return e=ey(this.rgba),t=e.r,i=e.g,s=e.b,(n=e.a)<1?"rgba("+t+", "+i+", "+s+", "+n+")":"rgb("+t+", "+i+", "+s+")";var e,t,i,s,n;},r.prototype.toHsl=function(){return HC(Bc(this.rgba))},r.prototype.toHslString=function(){return e=HC(Bc(this.rgba)),t=e.h,i=e.s,s=e.l,(n=e.a)<1?"hsla("+t+", "+i+"%, "+s+"%, "+n+")":"hsl("+t+", "+i+"%, "+s+"%)";var e,t,i,s,n;},r.prototype.toHsv=function(){return e=jC(this.rgba),{h:Bt(e.h),s:Bt(e.s),v:Bt(e.v),a:Bt(e.a,3)};var e;},r.prototype.invert=function(){return Jr({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e;},r.prototype.saturate=function(e){return e===void 0&&(e=.1),Jr(ty(this.rgba,e))},r.prototype.desaturate=function(e){return e===void 0&&(e=.1),Jr(ty(this.rgba,-e))},r.prototype.grayscale=function(){return Jr(ty(this.rgba,-1))},r.prototype.lighten=function(e){return e===void 0&&(e=.1),Jr(WC(this.rgba,e))},r.prototype.darken=function(e){return e===void 0&&(e=.1),Jr(WC(this.rgba,-e))},r.prototype.rotate=function(e){return e===void 0&&(e=15),this.hue(this.hue()+e)},r.prototype.alpha=function(e){return typeof e=="number"?Jr({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):Bt(this.rgba.a,3);var t;},r.prototype.hue=function(e){var t=Bc(this.rgba);return typeof e=="number"?Jr({h:e,s:t.s,l:t.l,a:t.a}):Bt(t.h)},r.prototype.isEqual=function(e){return this.toHex()===Jr(e).toHex()},r}(),Jr=function(r){return r instanceof sy?r:new sy(r)},XC=[],qC=function(r){r.forEach(function(e){XC.indexOf(e)<0&&(e(sy,iy),XC.push(e));});};});function ZC(r,e){var t={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"},i={};for(var s in t)i[t[s]]=s;var n={};r.prototype.toName=function(o){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return "transparent";var a,u,l=i[this.toHex()];if(l)return l;if(o?.closest){var c=this.toRgb(),h=1/0,d="black";if(!n.length)for(var p in t)n[p]=new r(t[p]).toRgb();for(var m in t){var b=(a=c,u=n[m],Math.pow(a.r-u.r,2)+Math.pow(a.g-u.g,2)+Math.pow(a.b-u.b,2));b<h&&(h=b,d=m);}return d}},e.string.push([function(o){var a=o.toLowerCase(),u=a==="transparent"?"#0000":t[a];return u?new r(u).toRgb():null},"name"]);}var QC=f(()=>{});var iu,te,gt=f(()=>{KC();QC();qC([ZC]);iu=class Rc{constructor(e=16777215){this._value=null,this._components=new Float32Array(4),this._components.fill(1),this._int=16777215,this.value=e;}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(e){return this.value=e,this}set value(e){if(e instanceof Rc)this._value=this._cloneSource(e._value),this._int=e._int,this._components.set(e._components);else {if(e===null)throw new Error("Cannot set Color#value to null");(this._value===null||!this._isSourceEqual(this._value,e))&&(this._value=this._cloneSource(e),this._normalize(this._value));}}get value(){return this._value}_cloneSource(e){return typeof e=="string"||typeof e=="number"||e instanceof Number||e===null?e:Array.isArray(e)||ArrayBuffer.isView(e)?e.slice(0):typeof e=="object"&&e!==null?{...e}:e}_isSourceEqual(e,t){let i=typeof e;if(i!==typeof t)return false;if(i==="number"||i==="string"||e instanceof Number)return e===t;if(Array.isArray(e)&&Array.isArray(t)||ArrayBuffer.isView(e)&&ArrayBuffer.isView(t))return e.length!==t.length?false:e.every((n,o)=>n===t[o]);if(e!==null&&t!==null){let n=Object.keys(e),o=Object.keys(t);return n.length!==o.length?false:n.every(a=>e[a]===t[a])}return e===t}toRgba(){let[e,t,i,s]=this._components;return {r:e,g:t,b:i,a:s}}toRgb(){let[e,t,i]=this._components;return {r:e,g:t,b:i}}toRgbaString(){let[e,t,i]=this.toUint8RgbArray();return `rgba(${e},${t},${i},${this.alpha})`}toUint8RgbArray(e){let[t,i,s]=this._components;return this._arrayRgb||(this._arrayRgb=[]),e||(e=this._arrayRgb),e[0]=Math.round(t*255),e[1]=Math.round(i*255),e[2]=Math.round(s*255),e}toArray(e){this._arrayRgba||(this._arrayRgba=[]),e||(e=this._arrayRgba);let[t,i,s,n]=this._components;return e[0]=t,e[1]=i,e[2]=s,e[3]=n,e}toRgbArray(e){this._arrayRgb||(this._arrayRgb=[]),e||(e=this._arrayRgb);let[t,i,s]=this._components;return e[0]=t,e[1]=i,e[2]=s,e}toNumber(){return this._int}toBgrNumber(){let[e,t,i]=this.toUint8RgbArray();return (i<<16)+(t<<8)+e}toLittleEndianNumber(){let e=this._int;return (e>>16)+(e&65280)+((e&255)<<16)}multiply(e){let[t,i,s,n]=Rc._temp.setValue(e)._components;return this._components[0]*=t,this._components[1]*=i,this._components[2]*=s,this._components[3]*=n,this._refreshInt(),this._value=null,this}premultiply(e,t=true){return t&&(this._components[0]*=e,this._components[1]*=e,this._components[2]*=e),this._components[3]=e,this._refreshInt(),this._value=null,this}toPremultiplied(e,t=true){if(e===1)return (255<<24)+this._int;if(e===0)return t?0:this._int;let i=this._int>>16&255,s=this._int>>8&255,n=this._int&255;return t&&(i=i*e+.5|0,s=s*e+.5|0,n=n*e+.5|0),(e*255<<24)+(i<<16)+(s<<8)+n}toHex(){let e=this._int.toString(16);return `#${"000000".substring(0,6-e.length)+e}`}toHexa(){let t=Math.round(this._components[3]*255).toString(16);return this.toHex()+"00".substring(0,2-t.length)+t}setAlpha(e){return this._components[3]=this._clamp(e),this}_normalize(e){let t,i,s,n;if((typeof e=="number"||e instanceof Number)&&e>=0&&e<=16777215){let o=e;t=(o>>16&255)/255,i=(o>>8&255)/255,s=(o&255)/255,n=1;}else if((Array.isArray(e)||e instanceof Float32Array)&&e.length>=3&&e.length<=4)e=this._clamp(e),[t,i,s,n=1]=e;else if((e instanceof Uint8Array||e instanceof Uint8ClampedArray)&&e.length>=3&&e.length<=4)e=this._clamp(e,0,255),[t,i,s,n=255]=e,t/=255,i/=255,s/=255,n/=255;else if(typeof e=="string"||typeof e=="object"){if(typeof e=="string"){let a=Rc.HEX_PATTERN.exec(e);a&&(e=`#${a[2]}`);}let o=Jr(e);o.isValid()&&({r:t,g:i,b:s,a:n}=o.rgba,t/=255,i/=255,s/=255);}if(t!==void 0)this._components[0]=t,this._components[1]=i,this._components[2]=s,this._components[3]=n,this._refreshInt();else throw new Error(`Unable to convert color ${e}`)}_refreshInt(){this._clamp(this._components);let[e,t,i]=this._components;this._int=(e*255<<16)+(t*255<<8)+(i*255|0);}_clamp(e,t=0,i=1){return typeof e=="number"?Math.min(Math.max(e,t),i):(e.forEach((s,n)=>{e[n]=Math.min(Math.max(s,t),i);}),e)}static isColorLike(e){return typeof e=="number"||typeof e=="string"||e instanceof Number||e instanceof Rc||Array.isArray(e)||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Float32Array||e.r!==void 0&&e.g!==void 0&&e.b!==void 0||e.r!==void 0&&e.g!==void 0&&e.b!==void 0&&e.a!==void 0||e.h!==void 0&&e.s!==void 0&&e.l!==void 0||e.h!==void 0&&e.s!==void 0&&e.l!==void 0&&e.a!==void 0||e.h!==void 0&&e.s!==void 0&&e.v!==void 0||e.h!==void 0&&e.s!==void 0&&e.v!==void 0&&e.a!==void 0}};iu.shared=new iu;iu._temp=new iu;iu.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;te=iu;});var Nf,ny=f(()=>{Nf={cullArea:null,cullable:false,cullableChildren:true};});var Hf,Vf,zf,Wf=f(()=>{Hf=Math.PI*2,Vf=180/Math.PI,zf=Math.PI/180;});var me,oy,cr=f(()=>{me=class r{constructor(e=0,t=0){this.x=0,this.y=0,this.x=e,this.y=t;}clone(){return new r(this.x,this.y)}copyFrom(e){return this.set(e.x,e.y),this}copyTo(e){return e.set(this.x,this.y),e}equals(e){return e.x===this.x&&e.y===this.y}set(e=0,t=e){return this.x=e,this.y=t,this}toString(){return `[pixi.js/math:Point x=${this.x} y=${this.y}]`}static get shared(){return oy.x=0,oy.y=0,oy}},oy=new me;});var G,GI,UI,Te=f(()=>{Wf();cr();G=class r{constructor(e=1,t=0,i=0,s=1,n=0,o=0){this.array=null,this.a=e,this.b=t,this.c=i,this.d=s,this.tx=n,this.ty=o;}fromArray(e){this.a=e[0],this.b=e[1],this.c=e[3],this.d=e[4],this.tx=e[2],this.ty=e[5];}set(e,t,i,s,n,o){return this.a=e,this.b=t,this.c=i,this.d=s,this.tx=n,this.ty=o,this}toArray(e,t){this.array||(this.array=new Float32Array(9));let i=t||this.array;return e?(i[0]=this.a,i[1]=this.b,i[2]=0,i[3]=this.c,i[4]=this.d,i[5]=0,i[6]=this.tx,i[7]=this.ty,i[8]=1):(i[0]=this.a,i[1]=this.c,i[2]=this.tx,i[3]=this.b,i[4]=this.d,i[5]=this.ty,i[6]=0,i[7]=0,i[8]=1),i}apply(e,t){t=t||new me;let i=e.x,s=e.y;return t.x=this.a*i+this.c*s+this.tx,t.y=this.b*i+this.d*s+this.ty,t}applyInverse(e,t){t=t||new me;let i=this.a,s=this.b,n=this.c,o=this.d,a=this.tx,u=this.ty,l=1/(i*o+n*-s),c=e.x,h=e.y;return t.x=o*l*c+-n*l*h+(u*n-a*o)*l,t.y=i*l*h+-s*l*c+(-u*i+a*s)*l,t}translate(e,t){return this.tx+=e,this.ty+=t,this}scale(e,t){return this.a*=e,this.d*=t,this.c*=e,this.b*=t,this.tx*=e,this.ty*=t,this}rotate(e){let t=Math.cos(e),i=Math.sin(e),s=this.a,n=this.c,o=this.tx;return this.a=s*t-this.b*i,this.b=s*i+this.b*t,this.c=n*t-this.d*i,this.d=n*i+this.d*t,this.tx=o*t-this.ty*i,this.ty=o*i+this.ty*t,this}append(e){let t=this.a,i=this.b,s=this.c,n=this.d;return this.a=e.a*t+e.b*s,this.b=e.a*i+e.b*n,this.c=e.c*t+e.d*s,this.d=e.c*i+e.d*n,this.tx=e.tx*t+e.ty*s+this.tx,this.ty=e.tx*i+e.ty*n+this.ty,this}appendFrom(e,t){let i=e.a,s=e.b,n=e.c,o=e.d,a=e.tx,u=e.ty,l=t.a,c=t.b,h=t.c,d=t.d;return this.a=i*l+s*h,this.b=i*c+s*d,this.c=n*l+o*h,this.d=n*c+o*d,this.tx=a*l+u*h+t.tx,this.ty=a*c+u*d+t.ty,this}setTransform(e,t,i,s,n,o,a,u,l){return this.a=Math.cos(a+l)*n,this.b=Math.sin(a+l)*n,this.c=-Math.sin(a-u)*o,this.d=Math.cos(a-u)*o,this.tx=e-(i*this.a+s*this.c),this.ty=t-(i*this.b+s*this.d),this}prepend(e){let t=this.tx;if(e.a!==1||e.b!==0||e.c!==0||e.d!==1){let i=this.a,s=this.c;this.a=i*e.a+this.b*e.c,this.b=i*e.b+this.b*e.d,this.c=s*e.a+this.d*e.c,this.d=s*e.b+this.d*e.d;}return this.tx=t*e.a+this.ty*e.c+e.tx,this.ty=t*e.b+this.ty*e.d+e.ty,this}decompose(e){let t=this.a,i=this.b,s=this.c,n=this.d,o=e.pivot,a=-Math.atan2(-s,n),u=Math.atan2(i,t),l=Math.abs(a+u);return l<1e-5||Math.abs(Hf-l)<1e-5?(e.rotation=u,e.skew.x=e.skew.y=0):(e.rotation=0,e.skew.x=a,e.skew.y=u),e.scale.x=Math.sqrt(t*t+i*i),e.scale.y=Math.sqrt(s*s+n*n),e.position.x=this.tx+(o.x*t+o.y*s),e.position.y=this.ty+(o.x*i+o.y*n),e}invert(){let e=this.a,t=this.b,i=this.c,s=this.d,n=this.tx,o=e*s-t*i;return this.a=s/o,this.b=-t/o,this.c=-i/o,this.d=e/o,this.tx=(i*this.ty-s*n)/o,this.ty=-(e*this.ty-t*n)/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(){let e=new r;return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyTo(e){return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyFrom(e){return this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.ty,this}equals(e){return e.a===this.a&&e.b===this.b&&e.c===this.c&&e.d===this.d&&e.tx===this.tx&&e.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 UI.identity()}static get shared(){return GI.identity()}},GI=new G,UI=new G;});var Ne,ws=f(()=>{Ne=class r{constructor(e,t,i){this._x=t||0,this._y=i||0,this._observer=e;}clone(e){return new r(e??this._observer,this._x,this._y)}set(e=0,t=e){return (this._x!==e||this._y!==t)&&(this._x=e,this._y=t,this._observer._onUpdate(this)),this}copyFrom(e){return (this._x!==e.x||this._y!==e.y)&&(this._x=e.x,this._y=e.y,this._observer._onUpdate(this)),this}copyTo(e){return e.set(this._x,this._y),e}equals(e){return e.x===this._x&&e.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(e){this._x!==e&&(this._x=e,this._observer._onUpdate(this));}get y(){return this._y}set y(e){this._y!==e&&(this._y=e,this._observer._onUpdate(this));}};});function ce(r="default"){return Mc[r]===void 0&&(Mc[r]=-1),++Mc[r]}function JC(){for(let r in Mc)delete Mc[r];}var Mc,Et=f(()=>{Mc={default:-1};});function U(r,e,t=3){if(eA[e])return;let i=new Error().stack;typeof i>"u"?console.warn("PixiJS Deprecation Warning: ",`${e}
2
2
  Deprecated since v${r}`):(i=i.split(`
3
3
  `).splice(t).join(`
4
4
  `),console.groupCollapsed?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",`${e}
5
5
  Deprecated since v${r}`),console.warn(i),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",`${e}
6
- Deprecated since v${r}`),console.warn(i))),eA[e]=true;}var eA,Y,Xf,Pe=f(()=>{eA={},Y="8.0.0",Xf="8.3.4";});var Ji,Yf=f(()=>{Ji=class{constructor(e,t){this._pool=[],this._count=0,this._index=0,this._classType=e,t&&this.prepopulate(t);}prepopulate(e){for(let t=0;t<e;t++)this._pool[this._index++]=new this._classType;this._count+=e;}get(e){let t;return this._index>0?t=this._pool[--this._index]:t=new this._classType,t.init?.(e),t}return(e){e.reset?.(),this._pool[this._index++]=e;}get totalSize(){return this._count}get totalFree(){return this._index}get totalUsed(){return this._count-this._index}clear(){this._pool.length=0,this._index=0;}};});var Ic,Ve,Si=f(()=>{Yf();Ic=class{constructor(){this._poolsByClass=new Map;}prepopulate(e,t){this.getPool(e).prepopulate(t);}get(e,t){return this.getPool(e).get(t)}return(e){this.getPool(e.constructor).return(e);}getPool(e){return this._poolsByClass.has(e)||this._poolsByClass.set(e,new Ji(e)),this._poolsByClass.get(e)}stats(){let e={};return this._poolsByClass.forEach(t=>{let i=e[t._classType.name]?t._classType.name+t._classType.ID:t._classType.name;e[i]={free:t.totalFree,used:t.totalUsed,size:t.totalSize};}),e}},Ve=new Ic;});var jf,ay=f(()=>{Pe();jf={get isCachedAsTexture(){return !!this.renderGroup?.isCachedAsTexture},cacheAsTexture(r){typeof r=="boolean"&&r===false?this.disableRenderGroup():(this.enableRenderGroup(),this.renderGroup.enableCacheAsTexture(r===true?{}:r));},updateCacheTexture(){this.renderGroup?.updateCacheTexture();},get cacheAsBitmap(){return this.isCachedAsTexture},set cacheAsBitmap(r){U("v8.6.0","cacheAsBitmap is deprecated, use cacheAsTexture instead."),this.cacheAsTexture(r);}};});function su(r,e,t){let i=r.length,s;if(e>=i||t===0)return;t=e+t>i?i-e:t;let n=i-t;for(s=e;s<n;++s)r[s]=r[s+t];r.length=n;}var $f=f(()=>{});var qf,uy=f(()=>{$f();Pe();qf={allowChildren:true,removeChildren(r=0,e){let t=e??this.children.length,i=t-r,s=[];if(i>0&&i<=t){for(let o=t-1;o>=r;o--){let a=this.children[o];a&&(s.push(a),a.parent=null);}su(this.children,r,t);let n=this.renderGroup||this.parentRenderGroup;n&&n.removeChildren(s);for(let o=0;o<s.length;++o){let a=s[o];a.parentRenderLayer?.detach(a),this.emit("childRemoved",a,this,o),s[o].emit("removed",this);}return s.length>0&&this._didViewChangeTick++,s}else if(i===0&&this.children.length===0)return s;throw new RangeError("removeChildren: numeric values are outside the acceptable range.")},removeChildAt(r){let e=this.getChildAt(r);return this.removeChild(e)},getChildAt(r){if(r<0||r>=this.children.length)throw new Error(`getChildAt: Index (${r}) does not exist.`);return this.children[r]},setChildIndex(r,e){if(e<0||e>=this.children.length)throw new Error(`The index ${e} supplied is out of bounds ${this.children.length}`);this.getChildIndex(r),this.addChildAt(r,e);},getChildIndex(r){let e=this.children.indexOf(r);if(e===-1)throw new Error("The supplied Container must be a child of the caller");return e},addChildAt(r,e){this.allowChildren||U(Y,"addChildAt: Only Containers will be allowed to add children in v8.0.0");let{children:t}=this;if(e<0||e>t.length)throw new Error(`${r}addChildAt: The index ${e} supplied is out of bounds ${t.length}`);if(r.parent){let s=r.parent.children.indexOf(r);if(r.parent===this&&s===e)return r;s!==-1&&r.parent.children.splice(s,1);}e===t.length?t.push(r):t.splice(e,0,r),r.parent=this,r.didChange=true,r._updateFlags=15;let i=this.renderGroup||this.parentRenderGroup;return i&&i.addChild(r),this.sortableChildren&&(this.sortDirty=true),this.emit("childAdded",r,this,e),r.emit("added",this),r},swapChildren(r,e){if(r===e)return;let t=this.getChildIndex(r),i=this.getChildIndex(e);this.children[t]=e,this.children[i]=r;let s=this.renderGroup||this.parentRenderGroup;s&&(s.structureDidChange=true),this._didContainerChangeTick++;},removeFromParent(){this.parent?.removeChild(this);},reparentChild(...r){return r.length===1?this.reparentChildAt(r[0],this.children.length):(r.forEach(e=>this.reparentChildAt(e,this.children.length)),r[0])},reparentChildAt(r,e){if(r.parent===this)return this.setChildIndex(r,e),r;let t=r.worldTransform.clone();r.removeFromParent(),this.addChildAt(r,e);let i=this.worldTransform.clone();return i.invert(),t.prepend(i),r.setFromMatrix(t),r}};});var Kf,ly=f(()=>{Kf={collectRenderables(r,e,t){this.parentRenderLayer&&this.parentRenderLayer!==t||this.globalDisplayStatus<7||!this.includeInBuild||(this.sortableChildren&&this.sortChildren(),this.isSimple?this.collectRenderablesSimple(r,e,t):this.renderGroup?e.renderPipes.renderGroup.addRenderGroup(this.renderGroup,r):this.collectRenderablesWithEffects(r,e,t));},collectRenderablesSimple(r,e,t){let i=this.children,s=i.length;for(let n=0;n<s;n++)i[n].collectRenderables(r,e,t);},collectRenderablesWithEffects(r,e,t){let{renderPipes:i}=e;for(let s=0;s<this.effects.length;s++){let n=this.effects[s];i[n.pipe].push(n,this,r);}this.collectRenderablesSimple(r,e,t);for(let s=this.effects.length-1;s>=0;s--){let n=this.effects[s];i[n.pipe].pop(n,this,r);}}};});var ei,Dc=f(()=>{ei=class{constructor(){this.pipe="filter",this.priority=1;}destroy(){for(let e=0;e<this.filters.length;e++)this.filters[e].destroy();this.filters=null,this.filterArea=null;}};});var kc,nu,cy=f(()=>{B();Si();kc=class{constructor(){this._effectClasses=[],this._tests=[],this._initialized=false;}init(){this._initialized||(this._initialized=true,this._effectClasses.forEach(e=>{this.add({test:e.test,maskClass:e});}));}add(e){this._tests.push(e);}getMaskEffect(e){this._initialized||this.init();for(let t=0;t<this._tests.length;t++){let i=this._tests[t];if(i.test(e))return Ve.get(i.maskClass,e)}return e}returnMaskEffect(e){Ve.return(e);}},nu=new kc;V.handleByList(x.MaskEffect,nu._effectClasses);});var Zf,hy=f(()=>{Dc();cy();Zf={_maskEffect:null,_maskOptions:{inverse:false},_filterEffect:null,effects:[],_markStructureAsChanged(){let r=this.renderGroup||this.parentRenderGroup;r&&(r.structureDidChange=true);},addEffect(r){this.effects.indexOf(r)===-1&&(this.effects.push(r),this.effects.sort((t,i)=>t.priority-i.priority),this._markStructureAsChanged(),this._updateIsSimple());},removeEffect(r){let e=this.effects.indexOf(r);e!==-1&&(this.effects.splice(e,1),this._markStructureAsChanged(),this._updateIsSimple());},set mask(r){let e=this._maskEffect;e?.mask!==r&&(e&&(this.removeEffect(e),nu.returnMaskEffect(e),this._maskEffect=null),r!=null&&(this._maskEffect=nu.getMaskEffect(r),this.addEffect(this._maskEffect)));},get mask(){return this._maskEffect?.mask},setMask(r){this._maskOptions={...this._maskOptions,...r},r.mask&&(this.mask=r.mask),this._markStructureAsChanged();},set filters(r){!Array.isArray(r)&&r&&(r=[r]);let e=this._filterEffect||(this._filterEffect=new ei);r=r;let t=r?.length>0,i=e.filters?.length>0,s=t!==i;r=Array.isArray(r)?r.slice(0):r,e.filters=Object.freeze(r),s&&(t?this.addEffect(e):(this.removeEffect(e),e.filters=r??null));},get filters(){return this._filterEffect?.filters},set filterArea(r){this._filterEffect||(this._filterEffect=new ei),this._filterEffect.filterArea=r;},get filterArea(){return this._filterEffect?.filterArea}};});var Qf,dy=f(()=>{Pe();Qf={label:null,get name(){return U(Y,"Container.name property has been removed, use Container.label instead"),this.label},set name(r){U(Y,"Container.name property has been removed, use Container.label instead"),this.label=r;},getChildByName(r,e=false){return this.getChildByLabel(r,e)},getChildByLabel(r,e=false){let t=this.children;for(let i=0;i<t.length;i++){let s=t[i];if(s.label===r||r instanceof RegExp&&r.test(s.label))return s}if(e)for(let i=0;i<t.length;i++){let n=t[i].getChildByLabel(r,true);if(n)return n}return null},getChildrenByLabel(r,e=false,t=[]){let i=this.children;for(let s=0;s<i.length;s++){let n=i[s];(n.label===r||r instanceof RegExp&&r.test(n.label))&&t.push(n);}if(e)for(let s=0;s<i.length;s++)i[s].getChildrenByLabel(r,true,t);return t}};});var Jf;exports.Rectangle=void 0;var ct=f(()=>{cr();Jf=[new me,new me,new me,new me],exports.Rectangle=class r{constructor(e=0,t=0,i=0,s=0){this.type="rectangle",this.x=Number(e),this.y=Number(t),this.width=Number(i),this.height=Number(s);}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 r(0,0,0,0)}clone(){return new r(this.x,this.y,this.width,this.height)}copyFromBounds(e){return this.x=e.minX,this.y=e.minY,this.width=e.maxX-e.minX,this.height=e.maxY-e.minY,this}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this}copyTo(e){return e.copyFrom(this),e}contains(e,t){return this.width<=0||this.height<=0?false:e>=this.x&&e<this.x+this.width&&t>=this.y&&t<this.y+this.height}strokeContains(e,t,i,s=.5){let{width:n,height:o}=this;if(n<=0||o<=0)return false;let a=this.x,u=this.y,l=i*(1-s),c=i-l,h=a-l,d=a+n+l,p=u-l,m=u+o+l,b=a+c,_=a+n-c,g=u+c,y=u+o-c;return e>=h&&e<=d&&t>=p&&t<=m&&!(e>b&&e<_&&t>g&&t<y)}intersects(e,t){if(!t){let A=this.x<e.x?e.x:this.x;if((this.right>e.right?e.right:this.right)<=A)return false;let M=this.y<e.y?e.y:this.y;return (this.bottom>e.bottom?e.bottom:this.bottom)>M}let i=this.left,s=this.right,n=this.top,o=this.bottom;if(s<=i||o<=n)return false;let a=Jf[0].set(e.left,e.top),u=Jf[1].set(e.left,e.bottom),l=Jf[2].set(e.right,e.top),c=Jf[3].set(e.right,e.bottom);if(l.x<=a.x||u.y<=a.y)return false;let h=Math.sign(t.a*t.d-t.b*t.c);if(h===0||(t.apply(a,a),t.apply(u,u),t.apply(l,l),t.apply(c,c),Math.max(a.x,u.x,l.x,c.x)<=i||Math.min(a.x,u.x,l.x,c.x)>=s||Math.max(a.y,u.y,l.y,c.y)<=n||Math.min(a.y,u.y,l.y,c.y)>=o))return false;let d=h*(u.y-a.y),p=h*(a.x-u.x),m=d*i+p*n,b=d*s+p*n,_=d*i+p*o,g=d*s+p*o;if(Math.max(m,b,_,g)<=d*a.x+p*a.y||Math.min(m,b,_,g)>=d*c.x+p*c.y)return false;let y=h*(a.y-l.y),S=h*(l.x-a.x),E=y*i+S*n,F=y*s+S*n,T=y*i+S*o,C=y*s+S*o;return !(Math.max(E,F,T,C)<=y*a.x+S*a.y||Math.min(E,F,T,C)>=y*c.x+S*c.y)}pad(e=0,t=e){return this.x-=e,this.y-=t,this.width+=e*2,this.height+=t*2,this}fit(e){let t=Math.max(this.x,e.x),i=Math.min(this.x+this.width,e.x+e.width),s=Math.max(this.y,e.y),n=Math.min(this.y+this.height,e.y+e.height);return this.x=t,this.width=Math.max(i-t,0),this.y=s,this.height=Math.max(n-s,0),this}ceil(e=1,t=.001){let i=Math.ceil((this.x+this.width-t)*e)/e,s=Math.ceil((this.y+this.height-t)*e)/e;return this.x=Math.floor((this.x+t)*e)/e,this.y=Math.floor((this.y+t)*e)/e,this.width=i-this.x,this.height=s-this.y,this}enlarge(e){let t=Math.min(this.x,e.x),i=Math.max(this.x+this.width,e.x+e.width),s=Math.min(this.y,e.y),n=Math.max(this.y+this.height,e.y+e.height);return this.x=t,this.width=i-t,this.y=s,this.height=n-s,this}getBounds(e){return e||(e=new r),e.copyFrom(this),e}containsRect(e){if(this.width<=0||this.height<=0)return false;let t=e.x,i=e.y,s=e.x+e.width,n=e.y+e.height;return t>=this.x&&t<this.x+this.width&&i>=this.y&&i<this.y+this.height&&s>=this.x&&s<this.x+this.width&&n>=this.y&&n<this.y+this.height}set(e,t,i,s){return this.x=e,this.y=t,this.width=i,this.height=s,this}toString(){return `[pixi.js/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}};});var tA,Ae,Lt=f(()=>{Te();ct();tA=new G,Ae=class r{constructor(e=1/0,t=1/0,i=-1/0,s=-1/0){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=tA,this.minX=e,this.minY=t,this.maxX=i,this.maxY=s;}isEmpty(){return this.minX>this.maxX||this.minY>this.maxY}get rectangle(){this._rectangle||(this._rectangle=new exports.Rectangle);let e=this._rectangle;return this.minX>this.maxX||this.minY>this.maxY?(e.x=0,e.y=0,e.width=0,e.height=0):e.copyFromBounds(this),e}clear(){return this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=tA,this}set(e,t,i,s){this.minX=e,this.minY=t,this.maxX=i,this.maxY=s;}addFrame(e,t,i,s,n){n||(n=this.matrix);let o=n.a,a=n.b,u=n.c,l=n.d,c=n.tx,h=n.ty,d=this.minX,p=this.minY,m=this.maxX,b=this.maxY,_=o*e+u*t+c,g=a*e+l*t+h;_<d&&(d=_),g<p&&(p=g),_>m&&(m=_),g>b&&(b=g),_=o*i+u*t+c,g=a*i+l*t+h,_<d&&(d=_),g<p&&(p=g),_>m&&(m=_),g>b&&(b=g),_=o*e+u*s+c,g=a*e+l*s+h,_<d&&(d=_),g<p&&(p=g),_>m&&(m=_),g>b&&(b=g),_=o*i+u*s+c,g=a*i+l*s+h,_<d&&(d=_),g<p&&(p=g),_>m&&(m=_),g>b&&(b=g),this.minX=d,this.minY=p,this.maxX=m,this.maxY=b;}addRect(e,t){this.addFrame(e.x,e.y,e.x+e.width,e.y+e.height,t);}addBounds(e,t){this.addFrame(e.minX,e.minY,e.maxX,e.maxY,t);}addBoundsMask(e){this.minX=this.minX>e.minX?this.minX:e.minX,this.minY=this.minY>e.minY?this.minY:e.minY,this.maxX=this.maxX<e.maxX?this.maxX:e.maxX,this.maxY=this.maxY<e.maxY?this.maxY:e.maxY;}applyMatrix(e){let t=this.minX,i=this.minY,s=this.maxX,n=this.maxY,{a:o,b:a,c:u,d:l,tx:c,ty:h}=e,d=o*t+u*i+c,p=a*t+l*i+h;this.minX=d,this.minY=p,this.maxX=d,this.maxY=p,d=o*s+u*i+c,p=a*s+l*i+h,this.minX=d<this.minX?d:this.minX,this.minY=p<this.minY?p:this.minY,this.maxX=d>this.maxX?d:this.maxX,this.maxY=p>this.maxY?p:this.maxY,d=o*t+u*n+c,p=a*t+l*n+h,this.minX=d<this.minX?d:this.minX,this.minY=p<this.minY?p:this.minY,this.maxX=d>this.maxX?d:this.maxX,this.maxY=p>this.maxY?p:this.maxY,d=o*s+u*n+c,p=a*s+l*n+h,this.minX=d<this.minX?d:this.minX,this.minY=p<this.minY?p:this.minY,this.maxX=d>this.maxX?d:this.maxX,this.maxY=p>this.maxY?p:this.maxY;}fit(e){return this.minX<e.left&&(this.minX=e.left),this.maxX>e.right&&(this.maxX=e.right),this.minY<e.top&&(this.minY=e.top),this.maxY>e.bottom&&(this.maxY=e.bottom),this}fitBounds(e,t,i,s){return this.minX<e&&(this.minX=e),this.maxX>t&&(this.maxX=t),this.minY<i&&(this.minY=i),this.maxY>s&&(this.maxY=s),this}pad(e,t=e){return this.minX-=e,this.maxX+=e,this.minY-=t,this.maxY+=t,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 r(this.minX,this.minY,this.maxX,this.maxY)}scale(e,t=e){return this.minX*=e,this.minY*=t,this.maxX*=e,this.maxY*=t,this}get x(){return this.minX}set x(e){let t=this.maxX-this.minX;this.minX=e,this.maxX=e+t;}get y(){return this.minY}set y(e){let t=this.maxY-this.minY;this.minY=e,this.maxY=e+t;}get width(){return this.maxX-this.minX}set width(e){this.maxX=this.minX+e;}get height(){return this.maxY-this.minY}set height(e){this.maxY=this.minY+e;}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(e,t,i,s){let n=this.minX,o=this.minY,a=this.maxX,u=this.maxY;s||(s=this.matrix);let l=s.a,c=s.b,h=s.c,d=s.d,p=s.tx,m=s.ty;for(let b=t;b<i;b+=2){let _=e[b],g=e[b+1],y=l*_+h*g+p,S=c*_+d*g+m;n=y<n?y:n,o=S<o?S:o,a=y>a?y:a,u=S>u?S:u;}this.minX=n,this.minY=o,this.maxX=a,this.maxY=u;}containsPoint(e,t){return this.minX<=e&&this.minY<=t&&this.maxX>=e&&this.maxY>=t}toString(){return `[pixi.js:Bounds minX=${this.minX} minY=${this.minY} maxX=${this.maxX} maxY=${this.maxY} width=${this.width} height=${this.height}]`}copyFrom(e){return this.minX=e.minX,this.minY=e.minY,this.maxX=e.maxX,this.maxY=e.maxY,this}};});var ut,ir,Bs=f(()=>{Te();Yf();Lt();ut=new Ji(G),ir=new Ji(Ae);});var LI,ep,fy=f(()=>{Te();Lt();Bs();LI=new G,ep={getFastGlobalBounds(r,e){e||(e=new Ae),e.clear(),this._getGlobalBoundsRecursive(!!r,e,this.parentRenderLayer),e.isValid||e.set(0,0,0,0);let t=this.renderGroup||this.parentRenderGroup;return e.applyMatrix(t.worldTransform),e},_getGlobalBoundsRecursive(r,e,t){let i=e;if(r&&this.parentRenderLayer&&this.parentRenderLayer!==t||this.localDisplayStatus!==7||!this.measurable)return;let s=!!this.effects.length;if((this.renderGroup||s)&&(i=ir.get().clear()),this.boundsArea)e.addRect(this.boundsArea,this.worldTransform);else {if(this.renderPipeId){let o=this.bounds;i.addFrame(o.minX,o.minY,o.maxX,o.maxY,this.groupTransform);}let n=this.children;for(let o=0;o<n.length;o++)n[o]._getGlobalBoundsRecursive(r,i,t);}if(s){let n=false,o=this.renderGroup||this.parentRenderGroup;for(let a=0;a<this.effects.length;a++)this.effects[a].addBounds&&(n||(n=true,i.applyMatrix(o.worldTransform)),this.effects[a].addBounds(i,true));n&&(i.applyMatrix(o.worldTransform.copyTo(LI).invert()),e.addBounds(i,this.relativeGroupTransform)),e.addBounds(i),ir.return(i);}else this.renderGroup&&(e.addBounds(i,this.relativeGroupTransform),ir.return(i));}};});function Ei(r,e,t){t.clear();let i,s;return r.parent?e?i=r.parent.worldTransform:(s=ut.get().identity(),i=ou(r,s)):i=G.IDENTITY,rA(r,t,i,e),s&&ut.return(s),t.isValid||t.set(0,0,0,0),t}function rA(r,e,t,i){if(!r.visible||!r.measurable)return;let s;i?s=r.worldTransform:(r.updateLocalTransform(),s=ut.get(),s.appendFrom(r.localTransform,t));let n=e,o=!!r.effects.length;if(o&&(e=ir.get().clear()),r.boundsArea)e.addRect(r.boundsArea,s);else {r.bounds&&(e.matrix=s,e.addBounds(r.bounds));for(let a=0;a<r.children.length;a++)rA(r.children[a],e,s,i);}if(o){for(let a=0;a<r.effects.length;a++)r.effects[a].addBounds?.(e);n.addBounds(e,G.IDENTITY),ir.return(e);}i||ut.return(s);}function ou(r,e){let t=r.parent;return t&&(ou(t,e),t.updateLocalTransform(),e.append(t.localTransform)),e}var Kn=f(()=>{Te();Bs();});function au(r,e){if(r===16777215||!e)return e;if(e===16777215||!r)return r;let t=r>>16&255,i=r>>8&255,s=r&255,n=e>>16&255,o=e>>8&255,a=e&255,u=t*n/255|0,l=i*o/255|0,c=s*a/255|0;return (u<<16)+(l<<8)+c}var tp=f(()=>{});function Rs(r,e){return r===iA?e:e===iA?r:au(r,e)}var iA,rp=f(()=>{tp();iA=16777215;});function es(r){return ((r&255)<<16)+(r&65280)+(r>>16&255)}var ip,sp=f(()=>{Kn();Bs();rp();ip={getGlobalAlpha(r){if(r)return this.renderGroup?this.renderGroup.worldAlpha:this.parentRenderGroup?this.parentRenderGroup.worldAlpha*this.alpha:this.alpha;let e=this.alpha,t=this.parent;for(;t;)e*=t.alpha,t=t.parent;return e},getGlobalTransform(r,e){if(e)return r.copyFrom(this.worldTransform);this.updateLocalTransform();let t=ou(this,ut.get().identity());return r.appendFrom(this.localTransform,t),ut.return(t),r},getGlobalTint(r){if(r)return this.renderGroup?es(this.renderGroup.worldColor):this.parentRenderGroup?es(Rs(this.localColor,this.parentRenderGroup.worldColor)):this.tint;let e=this.localColor,t=this.parent;for(;t;)e=Rs(e,t.localColor),t=t.parent;return es(e)}};});function Ms(r,e,t){return e.clear(),t||(t=G.IDENTITY),sA(r,e,t,r,true),e.isValid||e.set(0,0,0,0),e}function sA(r,e,t,i,s){let n;if(s)n=ut.get(),n=t.copyTo(n);else {if(!r.visible||!r.measurable)return;r.updateLocalTransform();let u=r.localTransform;n=ut.get(),n.appendFrom(u,t);}let o=e,a=!!r.effects.length;if(a&&(e=ir.get().clear()),r.boundsArea)e.addRect(r.boundsArea,n);else {r.renderPipeId&&(e.matrix=n,e.addBounds(r.bounds));let u=r.children;for(let l=0;l<u.length;l++)sA(u[l],e,n,i,false);}if(a){for(let u=0;u<r.effects.length;u++)r.effects[u].addLocalBounds?.(e,i);o.addBounds(e,G.IDENTITY),ir.return(e);}ut.return(n);}var Oc=f(()=>{Te();Bs();});function Fc(r,e){let t=r.children;for(let i=0;i<t.length;i++){let s=t[i],n=s.uid,o=(s._didViewChangeTick&65535)<<16|s._didContainerChangeTick&65535,a=e.index;(e.data[a]!==n||e.data[a+1]!==o)&&(e.data[e.index]=n,e.data[e.index+1]=o,e.didChange=true),e.index=a+2,s.children.length&&Fc(s,e);}return e.didChange}var py=f(()=>{});var NI,np,my=f(()=>{Te();Lt();Kn();Oc();py();NI=new G,np={_localBoundsCacheId:-1,_localBoundsCacheData:null,_setWidth(r,e){let t=Math.sign(this.scale.x)||1;e!==0?this.scale.x=r/e*t:this.scale.x=t;},_setHeight(r,e){let t=Math.sign(this.scale.y)||1;e!==0?this.scale.y=r/e*t:this.scale.y=t;},getLocalBounds(){this._localBoundsCacheData||(this._localBoundsCacheData={data:[],index:1,didChange:false,localBounds:new Ae});let r=this._localBoundsCacheData;return r.index=1,r.didChange=false,r.data[0]!==this._didViewChangeTick&&(r.didChange=true,r.data[0]=this._didViewChangeTick),Fc(this,r),r.didChange&&Ms(this,r.localBounds,NI),r.localBounds},getBounds(r,e){return Ei(this,r,e||new Ae)}};});var op,gy=f(()=>{op={_onRender:null,set onRender(r){let e=this.renderGroup||this.parentRenderGroup;if(!r){this._onRender&&e?.removeOnRender(this),this._onRender=null;return}this._onRender||e?.addOnRender(this),this._onRender=r;},get onRender(){return this._onRender}};});function HI(r,e){return r._zIndex-e._zIndex}var ap,xy=f(()=>{ap={_zIndex:0,sortDirty:false,sortableChildren:false,get zIndex(){return this._zIndex},set zIndex(r){this._zIndex!==r&&(this._zIndex=r,this.depthOfChildModified());},depthOfChildModified(){this.parent&&(this.parent.sortableChildren=true,this.parent.sortDirty=true),this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=true);},sortChildren(){this.sortDirty&&(this.sortDirty=false,this.children.sort(HI));}};});var up,_y=f(()=>{cr();Bs();up={getGlobalPosition(r=new me,e=false){return this.parent?this.parent.toGlobal(this._position,r,e):(r.x=this._position.x,r.y=this._position.y),r},toGlobal(r,e,t=false){let i=this.getGlobalTransform(ut.get(),t);return e=i.apply(r,e),ut.return(i),e},toLocal(r,e,t,i){e&&(r=e.toGlobal(r,t,i));let s=this.getGlobalTransform(ut.get(),i);return t=s.applyInverse(r,t),ut.return(s),t}};});var Is,lp=f(()=>{Et();Is=class{constructor(){this.uid=ce("instructionSet"),this.instructions=[],this.instructionSize=0,this.renderables=[],this.gcTick=0;}reset(){this.instructionSize=0;}add(e){this.instructions[this.instructionSize++]=e;}log(){this.instructions.length=this.instructionSize,console.table(this.instructions,["type","action"]);}};});function ti(r){return r+=r===0?1:0,--r,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r+1}function Gc(r){return !(r&r-1)&&!!r}function nA(r){let e=(r>65535?1:0)<<4;r>>>=e;let t=(r>255?1:0)<<3;return r>>>=t,e|=t,t=(r>15?1:0)<<2,r>>>=t,e|=t,t=(r>3?1:0)<<1,r>>>=t,e|=t,e|r>>1}var uu=f(()=>{});function Rt(r){let e={};for(let t in r)r[t]!==void 0&&(e[t]=r[t]);return e}var Ds=f(()=>{});function VI(r){let e=oA[r];return e===void 0&&(oA[r]=ce("resource")),e}var oA,aA,xt,ts=f(()=>{Ut();Et();Pe();oA=Object.create(null);aA=class uA extends _e{constructor(e={}){super(),this._resourceType="textureSampler",this._touched=0,this._maxAnisotropy=1,this.destroyed=false,e={...uA.defaultOptions,...e},this.addressMode=e.addressMode,this.addressModeU=e.addressModeU??this.addressModeU,this.addressModeV=e.addressModeV??this.addressModeV,this.addressModeW=e.addressModeW??this.addressModeW,this.scaleMode=e.scaleMode,this.magFilter=e.magFilter??this.magFilter,this.minFilter=e.minFilter??this.minFilter,this.mipmapFilter=e.mipmapFilter??this.mipmapFilter,this.lodMinClamp=e.lodMinClamp,this.lodMaxClamp=e.lodMaxClamp,this.compare=e.compare,this.maxAnisotropy=e.maxAnisotropy??1;}set addressMode(e){this.addressModeU=e,this.addressModeV=e,this.addressModeW=e;}get addressMode(){return this.addressModeU}set wrapMode(e){U(Y,"TextureStyle.wrapMode is now TextureStyle.addressMode"),this.addressMode=e;}get wrapMode(){return this.addressMode}set scaleMode(e){this.magFilter=e,this.minFilter=e,this.mipmapFilter=e;}get scaleMode(){return this.magFilter}set maxAnisotropy(e){this._maxAnisotropy=Math.min(e,16),this._maxAnisotropy>1&&(this.scaleMode="linear");}get maxAnisotropy(){return this._maxAnisotropy}get _resourceId(){return this._sharedResourceId||this._generateResourceId()}update(){this.emit("change",this),this._sharedResourceId=null;}_generateResourceId(){let e=`${this.addressModeU}-${this.addressModeV}-${this.addressModeW}-${this.magFilter}-${this.minFilter}-${this.mipmapFilter}-${this.lodMinClamp}-${this.lodMaxClamp}-${this.compare}-${this._maxAnisotropy}`;return this._sharedResourceId=VI(e),this._resourceId}destroy(){this.destroyed=true,this.emit("destroy",this),this.emit("change",this),this.removeAllListeners();}};aA.defaultOptions={addressMode:"clamp-to-edge",scaleMode:"linear"};xt=aA;});var lA,ge,Ct=f(()=>{Ut();uu();Ds();Et();ts();lA=class cA extends _e{constructor(e={}){super(),this.options=e,this.uid=ce("textureSource"),this._resourceType="textureSource",this._resourceId=ce("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=false,this.format="rgba8unorm",this.dimension="2d",this.antialias=false,this._touched=0,this._batchTick=-1,this._textureBindLocation=-1,e={...cA.defaultOptions,...e},this.label=e.label??"",this.resource=e.resource,this.autoGarbageCollect=e.autoGarbageCollect,this._resolution=e.resolution,e.width?this.pixelWidth=e.width*this._resolution:this.pixelWidth=this.resource?this.resourceWidth??1:1,e.height?this.pixelHeight=e.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=e.format,this.dimension=e.dimensions,this.mipLevelCount=e.mipLevelCount,this.autoGenerateMipmaps=e.autoGenerateMipmaps,this.sampleCount=e.sampleCount,this.antialias=e.antialias,this.alphaMode=e.alphaMode,this.style=new xt(Rt(e)),this.destroyed=false,this._refreshPOT();}get source(){return this}get style(){return this._style}set style(e){this.style!==e&&(this._style?.off("change",this._onStyleChange,this),this._style=e,this._style?.on("change",this._onStyleChange,this),this._onStyleChange());}get addressMode(){return this._style.addressMode}set addressMode(e){this._style.addressMode=e;}get repeatMode(){return this._style.addressMode}set repeatMode(e){this._style.addressMode=e;}get magFilter(){return this._style.magFilter}set magFilter(e){this._style.magFilter=e;}get minFilter(){return this._style.minFilter}set minFilter(e){this._style.minFilter=e;}get mipmapFilter(){return this._style.mipmapFilter}set mipmapFilter(e){this._style.mipmapFilter=e;}get lodMinClamp(){return this._style.lodMinClamp}set lodMinClamp(e){this._style.lodMinClamp=e;}get lodMaxClamp(){return this._style.lodMaxClamp}set lodMaxClamp(e){this._style.lodMaxClamp=e;}_onStyleChange(){this.emit("styleChange",this);}update(){if(this.resource){let e=this._resolution;if(this.resize(this.resourceWidth/e,this.resourceHeight/e))return}this.emit("update",this);}destroy(){this.destroyed=true,this.emit("destroy",this),this.emit("change",this),this._style&&(this._style.destroy(),this._style=null),this.uploadMethodId=null,this.resource=null,this.removeAllListeners();}unload(){this._resourceId=ce("resource"),this.emit("change",this),this.emit("unload",this);}get resourceWidth(){let{resource:e}=this;return e.naturalWidth||e.videoWidth||e.displayWidth||e.width}get resourceHeight(){let{resource:e}=this;return e.naturalHeight||e.videoHeight||e.displayHeight||e.height}get resolution(){return this._resolution}set resolution(e){this._resolution!==e&&(this._resolution=e,this.width=this.pixelWidth/e,this.height=this.pixelHeight/e);}resize(e,t,i){i||(i=this._resolution),e||(e=this.width),t||(t=this.height);let s=Math.round(e*i),n=Math.round(t*i);return this.width=s/i,this.height=n/i,this._resolution=i,this.pixelWidth===s&&this.pixelHeight===n?false:(this._refreshPOT(),this.pixelWidth=s,this.pixelHeight=n,this.emit("resize",this),this._resourceId=ce("resource"),this.emit("change",this),true)}updateMipmaps(){this.autoGenerateMipmaps&&this.mipLevelCount>1&&this.emit("updateMipmaps",this);}set wrapMode(e){this._style.wrapMode=e;}get wrapMode(){return this._style.wrapMode}set scaleMode(e){this._style.scaleMode=e;}get scaleMode(){return this._style.scaleMode}_refreshPOT(){this.isPowerOfTwo=Gc(this.pixelWidth)&&Gc(this.pixelHeight);}static test(e){throw new Error("Unimplemented")}};lA.defaultOptions={resolution:1,format:"bgra8unorm",alphaMode:"premultiply-alpha-on-upload",dimensions:"2d",mipLevelCount:1,autoGenerateMipmaps:false,sampleCount:1,antialias:false,autoGarbageCollect:false};ge=lA;});function zI(){for(let r=0;r<16;r++){let e=[];by.push(e);for(let t=0;t<16;t++){let i=cp(Zn[r]*Zn[t]+Jn[r]*Qn[t]),s=cp(Qn[r]*Zn[t]+eo[r]*Qn[t]),n=cp(Zn[r]*Jn[t]+Jn[r]*eo[t]),o=cp(Qn[r]*Jn[t]+eo[r]*eo[t]);for(let a=0;a<16;a++)if(Zn[a]===i&&Qn[a]===s&&Jn[a]===n&&eo[a]===o){e.push(a);break}}}for(let r=0;r<16;r++){let e=new G;e.set(Zn[r],Qn[r],Jn[r],eo[r],0,0),hA.push(e);}}var Zn,Qn,Jn,eo,by,hA,cp,be,hp=f(()=>{Te();Zn=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],Qn=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],Jn=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],eo=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],by=[],hA=[],cp=Math.sign;zI();be={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:r=>Zn[r],uY:r=>Qn[r],vX:r=>Jn[r],vY:r=>eo[r],inv:r=>r&8?r&15:-r&7,add:(r,e)=>by[r][e],sub:(r,e)=>by[r][be.inv(e)],rotate180:r=>r^4,isVertical:r=>(r&3)===2,byDirection:(r,e)=>Math.abs(r)*2<=Math.abs(e)?e>=0?be.S:be.N:Math.abs(e)*2<=Math.abs(r)?r>0?be.E:be.W:e>0?r>0?be.SE:be.SW:r>0?be.NE:be.NW,matrixAppendRotationInv:(r,e,t=0,i=0)=>{let s=hA[be.inv(e)];s.tx=t,s.ty=i,r.append(s);}};});var Uc,yy=f(()=>{Uc=()=>{};});var rs,dp=f(()=>{B();Ct();rs=class extends ge{constructor(e){let t=e.resource||new Float32Array(e.width*e.height*4),i=e.format;i||(t instanceof Float32Array?i="rgba32float":t instanceof Int32Array||t instanceof Uint32Array?i="rgba32uint":t instanceof Int16Array||t instanceof Uint16Array?i="rgba16uint":(i="bgra8unorm")),super({...e,resource:t,format:i}),this.uploadMethodId="buffer";}static test(e){return e instanceof Int8Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array}};rs.extension=x.TextureSource;});var dA,ks,fp=f(()=>{Te();dA=new G,ks=class{constructor(e,t){this.mapCoord=new G,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,typeof t>"u"?this.clampMargin=e.width<10?0:.5:this.clampMargin=t,this.isSimple=false,this.texture=e;}get texture(){return this._texture}set texture(e){this.texture!==e&&(this._texture?.removeListener("update",this.update,this),this._texture=e,this._texture.addListener("update",this.update,this),this.update());}multiplyUvs(e,t){t===void 0&&(t=e);let i=this.mapCoord;for(let s=0;s<e.length;s+=2){let n=e[s],o=e[s+1];t[s]=n*i.a+o*i.c+i.tx,t[s+1]=n*i.b+o*i.d+i.ty;}return t}update(){let e=this._texture;this._updateID++;let t=e.uvs;this.mapCoord.set(t.x1-t.x0,t.y1-t.y0,t.x3-t.x0,t.y3-t.y0,t.x0,t.y0);let i=e.orig,s=e.trim;s&&(dA.set(i.width/s.width,0,0,i.height/s.height,-s.x/s.width,-s.y/s.height),this.mapCoord.append(dA));let n=e.source,o=this.uClampFrame,a=this.clampMargin/n._resolution,u=this.clampOffset/n._resolution;return o[0]=(e.frame.x+a+u)/n.width,o[1]=(e.frame.y+a+u)/n.height,o[2]=(e.frame.x+e.frame.width-a+u)/n.width,o[3]=(e.frame.y+e.frame.height-a+u)/n.height,this.uClampOffset[0]=this.clampOffset/n.pixelWidth,this.uClampOffset[1]=this.clampOffset/n.pixelHeight,this.isSimple=e.frame.width===n.width&&e.frame.height===n.height&&e.rotate===0,true}};});exports.Texture=void 0;var ye=f(()=>{Ut();hp();ct();Et();Pe();yy();dp();Ct();fp();exports.Texture=class extends _e{constructor({source:e,label:t,frame:i,orig:s,trim:n,defaultAnchor:o,defaultBorders:a,rotate:u,dynamic:l}={}){if(super(),this.uid=ce("texture"),this.uvs={x0:0,y0:0,x1:0,y1:0,x2:0,y2:0,x3:0,y3:0},this.frame=new exports.Rectangle,this.noFrame=false,this.dynamic=false,this.isTexture=true,this.label=t,this.source=e?.source??new ge,this.noFrame=!i,i)this.frame.copyFrom(i);else {let{width:c,height:h}=this._source;this.frame.width=c,this.frame.height=h;}this.orig=s||this.frame,this.trim=n,this.rotate=u??0,this.defaultAnchor=o,this.defaultBorders=a,this.destroyed=false,this.dynamic=l||false,this.updateUvs();}set source(e){this._source&&this._source.off("resize",this.update,this),this._source=e,e.on("resize",this.update,this),this.emit("update",this);}get source(){return this._source}get textureMatrix(){return this._textureMatrix||(this._textureMatrix=new ks(this)),this._textureMatrix}get width(){return this.orig.width}get height(){return this.orig.height}updateUvs(){let{uvs:e,frame:t}=this,{width:i,height:s}=this._source,n=t.x/i,o=t.y/s,a=t.width/i,u=t.height/s,l=this.rotate;if(l){let c=a/2,h=u/2,d=n+c,p=o+h;l=be.add(l,be.NW),e.x0=d+c*be.uX(l),e.y0=p+h*be.uY(l),l=be.add(l,2),e.x1=d+c*be.uX(l),e.y1=p+h*be.uY(l),l=be.add(l,2),e.x2=d+c*be.uX(l),e.y2=p+h*be.uY(l),l=be.add(l,2),e.x3=d+c*be.uX(l),e.y3=p+h*be.uY(l);}else e.x0=n,e.y0=o,e.x1=n+a,e.y1=o,e.x2=n+a,e.y2=o+u,e.x3=n,e.y3=o+u;}destroy(e=false){this._source&&e&&(this._source.destroy(),this._source=null),this._textureMatrix=null,this.destroyed=true,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 U(Y,"Texture.baseTexture is now Texture.source"),this._source}};exports.Texture.EMPTY=new exports.Texture({label:"EMPTY",source:new ge({label:"EMPTY"})});exports.Texture.EMPTY.destroy=Uc;exports.Texture.WHITE=new exports.Texture({source:new rs({resource:new Uint8Array([255,255,255,255]),width:1,height:1,alphaMode:"premultiply-alpha-on-upload",label:"WHITE"}),label:"WHITE"});exports.Texture.WHITE.destroy=Uc;});var WI,Lc,Me,ri=f(()=>{uu();Ct();ye();ts();WI=0,Lc=class{constructor(e){this._poolKeyHash=Object.create(null),this._texturePool={},this.textureOptions=e||{},this.enableFullScreen=false,this.textureStyle=new xt(this.textureOptions);}createTexture(e,t,i){let s=new ge({...this.textureOptions,width:e,height:t,resolution:1,antialias:i,autoGarbageCollect:false});return new exports.Texture({source:s,label:`texturePool_${WI++}`})}getOptimalTexture(e,t,i=1,s){let n=Math.ceil(e*i-1e-6),o=Math.ceil(t*i-1e-6);n=ti(n),o=ti(o);let a=(n<<17)+(o<<1)+(s?1:0);this._texturePool[a]||(this._texturePool[a]=[]);let u=this._texturePool[a].pop();return u||(u=this.createTexture(n,o,s)),u.source._resolution=i,u.source.width=n/i,u.source.height=o/i,u.source.pixelWidth=n,u.source.pixelHeight=o,u.frame.x=0,u.frame.y=0,u.frame.width=e,u.frame.height=t,u.updateUvs(),this._poolKeyHash[u.uid]=a,u}getSameSizeTexture(e,t=false){let i=e.source;return this.getOptimalTexture(e.width,e.height,i._resolution,t)}returnTexture(e,t=false){let i=this._poolKeyHash[e.uid];t&&(e.source.style=this.textureStyle),this._texturePool[i].push(e);}clear(e){if(e=e!==false,e)for(let t in this._texturePool){let i=this._texturePool[t];if(i)for(let s=0;s<i.length;s++)i[s].destroy(true);}this._texturePool={};}},Me=new Lc;});var lu,vy=f(()=>{Te();lp();ri();lu=class{constructor(){this.renderPipeId="renderGroup",this.root=null,this.canBundle=false,this.renderGroupParent=null,this.renderGroupChildren=[],this.worldTransform=new G,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=true,this.instructionSet=new Is,this._onRenderContainers=[],this.textureNeedsUpdate=true,this.isCachedAsTexture=false,this._matrixDirty=7;}init(e){this.root=e,e._onRender&&this.addOnRender(e),e.didChange=true;let t=e.children;for(let i=0;i<t.length;i++){let s=t[i];s._updateFlags=15,this.addChild(s);}}enableCacheAsTexture(e={}){this.textureOptions=e,this.isCachedAsTexture=true,this.textureNeedsUpdate=true;}disableCacheAsTexture(){this.isCachedAsTexture=false,this.texture&&(Me.returnTexture(this.texture),this.texture=null);}updateCacheTexture(){this.textureNeedsUpdate=true;}reset(){this.renderGroupChildren.length=0;for(let e in this.childrenToUpdate){let t=this.childrenToUpdate[e];t.list.fill(null),t.index=0;}this.childrenRenderablesToUpdate.index=0,this.childrenRenderablesToUpdate.list.fill(null),this.root=null,this.updateTick=0,this.structureDidChange=true,this._onRenderContainers.length=0,this.renderGroupParent=null,this.disableCacheAsTexture();}get localTransform(){return this.root.localTransform}addRenderGroupChild(e){e.renderGroupParent&&e.renderGroupParent._removeRenderGroupChild(e),e.renderGroupParent=this,this.renderGroupChildren.push(e);}_removeRenderGroupChild(e){let t=this.renderGroupChildren.indexOf(e);t>-1&&this.renderGroupChildren.splice(t,1),e.renderGroupParent=null;}addChild(e){if(this.structureDidChange=true,e.parentRenderGroup=this,e.updateTick=-1,e.parent===this.root?e.relativeRenderGroupDepth=1:e.relativeRenderGroupDepth=e.parent.relativeRenderGroupDepth+1,e.didChange=true,this.onChildUpdate(e),e.renderGroup){this.addRenderGroupChild(e.renderGroup);return}e._onRender&&this.addOnRender(e);let t=e.children;for(let i=0;i<t.length;i++)this.addChild(t[i]);}removeChild(e){if(this.structureDidChange=true,e._onRender&&(e.renderGroup||this.removeOnRender(e)),e.parentRenderGroup=null,e.renderGroup){this._removeRenderGroupChild(e.renderGroup);return}let t=e.children;for(let i=0;i<t.length;i++)this.removeChild(t[i]);}removeChildren(e){for(let t=0;t<e.length;t++)this.removeChild(e[t]);}onChildUpdate(e){let t=this.childrenToUpdate[e.relativeRenderGroupDepth];t||(t=this.childrenToUpdate[e.relativeRenderGroupDepth]={index:0,list:[]}),t.list[t.index++]=e;}updateRenderable(e){e.globalDisplayStatus<7||(this.instructionSet.renderPipes[e.renderPipeId].updateRenderable(e),e.didViewUpdate=false);}onChildViewUpdate(e){this.childrenRenderablesToUpdate.list[this.childrenRenderablesToUpdate.index++]=e;}get isRenderable(){return this.root.localDisplayStatus===7&&this.worldAlpha>0}addOnRender(e){this._onRenderContainers.push(e);}removeOnRender(e){this._onRenderContainers.splice(this._onRenderContainers.indexOf(e),1);}runOnRender(e){for(let t=0;t<this._onRenderContainers.length;t++)this._onRenderContainers[t]._onRender(e);}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(e=[]){let t=this.root.children;for(let i=0;i<t.length;i++)this._getChildren(t[i],e);return e}_getChildren(e,t=[]){if(t.push(e),e.renderGroup)return t;let i=e.children;for(let s=0;s<i.length;s++)this._getChildren(i[s],t);return t}invalidateMatrices(){this._matrixDirty=7;}get inverseWorldTransform(){return (this._matrixDirty&1)===0?this._inverseWorldTransform:(this._matrixDirty&=-2,this._inverseWorldTransform||(this._inverseWorldTransform=new G),this._inverseWorldTransform.copyFrom(this.worldTransform).invert())}get textureOffsetInverseTransform(){return (this._matrixDirty&2)===0?this._textureOffsetInverseTransform:(this._matrixDirty&=-3,this._textureOffsetInverseTransform||(this._textureOffsetInverseTransform=new G),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;let e=this._parentCacheAsTextureRenderGroup;return e?(this._inverseParentTextureTransform||(this._inverseParentTextureTransform=new G),this._inverseParentTextureTransform.copyFrom(this.worldTransform).prepend(e.inverseWorldTransform).translate(-e._textureBounds.x,-e._textureBounds.y)):this.worldTransform}get cacheToLocalTransform(){return this._parentCacheAsTextureRenderGroup?this._parentCacheAsTextureRenderGroup.textureOffsetInverseTransform:null}};});function to(r,e,t={}){for(let i in e)!t[i]&&e[i]!==void 0&&(r[i]=e[i]);}var pp=f(()=>{});var Ty,Sy,Ey,ro,cu,Os,fA;exports.PixiJSContainer=void 0;var hr=f(()=>{Ut();gt();ny();B();Te();Wf();ws();Et();Pe();Si();ay();uy();ly();hy();dy();fy();sp();my();gy();xy();_y();vy();pp();Ty=new Ne(null),Sy=new Ne(null),Ey=new Ne(null,1,1),ro=1,cu=2,Os=4,fA=8,exports.PixiJSContainer=class r extends _e{constructor(e={}){super(),this.uid=ce("renderable"),this._updateFlags=15,this.renderGroup=null,this.parentRenderGroup=null,this.parentRenderGroupIndex=0,this.didChange=false,this.didViewUpdate=false,this.relativeRenderGroupDepth=0,this.children=[],this.parent=null,this.includeInBuild=true,this.measurable=true,this.isSimple=true,this.updateTick=-1,this.localTransform=new G,this.relativeGroupTransform=new G,this.groupTransform=this.relativeGroupTransform,this.destroyed=false,this._position=new Ne(this,0,0),this._scale=Ey,this._pivot=Sy,this._skew=Ty,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=[],to(this,e,{children:true,parent:true,effects:true}),e.children?.forEach(t=>this.addChild(t)),e.parent?.addChild(this);}static mixin(e){U("8.8.0","Container.mixin is deprecated, please use extensions.mixin instead."),V.mixin(r,e);}set _didChangeId(e){this._didViewChangeTick=e>>12&4095,this._didContainerChangeTick=e&4095;}get _didChangeId(){return this._didContainerChangeTick&4095|(this._didViewChangeTick&4095)<<12}addChild(...e){if(this.allowChildren||U(Y,"addChild: Only Containers will be allowed to add children in v8.0.0"),e.length>1){for(let s=0;s<e.length;s++)this.addChild(e[s]);return e[0]}let t=e[0],i=this.renderGroup||this.parentRenderGroup;return t.parent===this?(this.children.splice(this.children.indexOf(t),1),this.children.push(t),i&&(i.structureDidChange=true),t):(t.parent&&t.parent.removeChild(t),this.children.push(t),this.sortableChildren&&(this.sortDirty=true),t.parent=this,t.didChange=true,t._updateFlags=15,i&&i.addChild(t),this.emit("childAdded",t,this,this.children.length-1),t.emit("added",this),this._didViewChangeTick++,t._zIndex!==0&&t.depthOfChildModified(),t)}removeChild(...e){if(e.length>1){for(let s=0;s<e.length;s++)this.removeChild(e[s]);return e[0]}let t=e[0],i=this.children.indexOf(t);return i>-1&&(this._didViewChangeTick++,this.children.splice(i,1),this.renderGroup?this.renderGroup.removeChild(t):this.parentRenderGroup&&this.parentRenderGroup.removeChild(t),t.parentRenderLayer&&t.parentRenderLayer.detach(t),t.parent=null,this.emit("childRemoved",t,this,i),t.emit("removed",this)),t}_onUpdate(e){e&&e===this._skew&&this._updateSkew(),this._didContainerChangeTick++,!this.didChange&&(this.didChange=true,this.parentRenderGroup&&this.parentRenderGroup.onChildUpdate(this));}set isRenderGroup(e){!!this.renderGroup!==e&&(e?this.enableRenderGroup():this.disableRenderGroup());}get isRenderGroup(){return !!this.renderGroup}enableRenderGroup(){if(this.renderGroup)return;let e=this.parentRenderGroup;e?.removeChild(this),this.renderGroup=Ve.get(lu,this),this.groupTransform=G.IDENTITY,e?.addChild(this),this._updateIsSimple();}disableRenderGroup(){if(!this.renderGroup)return;let e=this.parentRenderGroup;e?.removeChild(this),Ve.return(this.renderGroup),this.renderGroup=null,this.groupTransform=this.relativeGroupTransform,e?.addChild(this),this._updateIsSimple();}_updateIsSimple(){this.isSimple=!this.renderGroup&&this.effects.length===0;}get worldTransform(){return this._worldTransform||(this._worldTransform=new G),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(e){this._position.x=e;}get y(){return this._position.y}set y(e){this._position.y=e;}get position(){return this._position}set position(e){this._position.copyFrom(e);}get rotation(){return this._rotation}set rotation(e){this._rotation!==e&&(this._rotation=e,this._onUpdate(this._skew));}get angle(){return this.rotation*Vf}set angle(e){this.rotation=e*zf;}get pivot(){return this._pivot===Sy&&(this._pivot=new Ne(this,0,0)),this._pivot}set pivot(e){this._pivot===Sy&&(this._pivot=new Ne(this,0,0)),typeof e=="number"?this._pivot.set(e):this._pivot.copyFrom(e);}get skew(){return this._skew===Ty&&(this._skew=new Ne(this,0,0)),this._skew}set skew(e){this._skew===Ty&&(this._skew=new Ne(this,0,0)),this._skew.copyFrom(e);}get scale(){return this._scale===Ey&&(this._scale=new Ne(this,1,1)),this._scale}set scale(e){this._scale===Ey&&(this._scale=new Ne(this,0,0)),typeof e=="number"?this._scale.set(e):this._scale.copyFrom(e);}get width(){return Math.abs(this.scale.x*this.getLocalBounds().width)}set width(e){let t=this.getLocalBounds().width;this._setWidth(e,t);}get height(){return Math.abs(this.scale.y*this.getLocalBounds().height)}set height(e){let t=this.getLocalBounds().height;this._setHeight(e,t);}getSize(e){e||(e={});let t=this.getLocalBounds();return e.width=Math.abs(this.scale.x*t.width),e.height=Math.abs(this.scale.y*t.height),e}setSize(e,t){let i=this.getLocalBounds();typeof e=="object"?(t=e.height??e.width,e=e.width):t??(t=e),e!==void 0&&this._setWidth(e,i.width),t!==void 0&&this._setHeight(t,i.height);}_updateSkew(){let e=this._rotation,t=this._skew;this._cx=Math.cos(e+t._y),this._sx=Math.sin(e+t._y),this._cy=-Math.sin(e-t._x),this._sy=Math.cos(e-t._x);}updateTransform(e){return this.position.set(typeof e.x=="number"?e.x:this.position.x,typeof e.y=="number"?e.y:this.position.y),this.scale.set(typeof e.scaleX=="number"?e.scaleX||1:this.scale.x,typeof e.scaleY=="number"?e.scaleY||1:this.scale.y),this.rotation=typeof e.rotation=="number"?e.rotation:this.rotation,this.skew.set(typeof e.skewX=="number"?e.skewX:this.skew.x,typeof e.skewY=="number"?e.skewY:this.skew.y),this.pivot.set(typeof e.pivotX=="number"?e.pivotX:this.pivot.x,typeof e.pivotY=="number"?e.pivotY:this.pivot.y),this}setFromMatrix(e){e.decompose(this);}updateLocalTransform(){let e=this._didContainerChangeTick;if(this._didLocalTransformChangeId===e)return;this._didLocalTransformChangeId=e;let t=this.localTransform,i=this._scale,s=this._pivot,n=this._position,o=i._x,a=i._y,u=s._x,l=s._y;t.a=this._cx*o,t.b=this._sx*o,t.c=this._cy*a,t.d=this._sy*a,t.tx=n._x-(u*t.a+l*t.c),t.ty=n._y-(u*t.b+l*t.d);}set alpha(e){e!==this.localAlpha&&(this.localAlpha=e,this._updateFlags|=ro,this._onUpdate());}get alpha(){return this.localAlpha}set tint(e){let i=te.shared.setValue(e??16777215).toBgrNumber();i!==this.localColor&&(this.localColor=i,this._updateFlags|=ro,this._onUpdate());}get tint(){return es(this.localColor)}set blendMode(e){this.localBlendMode!==e&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=true),this._updateFlags|=cu,this.localBlendMode=e,this._onUpdate());}get blendMode(){return this.localBlendMode}get visible(){return !!(this.localDisplayStatus&2)}set visible(e){let t=e?2:0;(this.localDisplayStatus&2)!==t&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=true),this._updateFlags|=Os,this.localDisplayStatus^=2,this._onUpdate());}get culled(){return !(this.localDisplayStatus&4)}set culled(e){let t=e?0:4;(this.localDisplayStatus&4)!==t&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=true),this._updateFlags|=Os,this.localDisplayStatus^=4,this._onUpdate());}get renderable(){return !!(this.localDisplayStatus&1)}set renderable(e){let t=e?1:0;(this.localDisplayStatus&1)!==t&&(this._updateFlags|=Os,this.localDisplayStatus^=1,this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=true),this._onUpdate());}get isRenderable(){return this.localDisplayStatus===7&&this.groupAlpha>0}destroy(e=false){if(this.destroyed)return;this.destroyed=true;let t;if(this.children.length&&(t=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._skew=null,this.emit("destroyed",this),this.removeAllListeners(),(typeof e=="boolean"?e:e?.children)&&t)for(let s=0;s<t.length;++s)t[s].destroy(e);this.renderGroup?.destroy(),this.renderGroup=null;}};V.mixin(exports.PixiJSContainer,qf,ep,up,op,np,Zf,Qf,ap,Nf,jf,ip,Kf);});var Ci,Nc=f(()=>{cr();Ci=class r{constructor(e){this.bubbles=true,this.cancelBubble=true,this.cancelable=false,this.composed=false,this.defaultPrevented=false,this.eventPhase=r.prototype.NONE,this.propagationStopped=false,this.propagationImmediatelyStopped=false,this.layer=new me,this.page=new me,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e;}get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get data(){return this}composedPath(){return this.manager&&(!this.path||this.path[this.path.length-1]!==this.target)&&(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}initEvent(e,t,i){throw new Error("initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}initUIEvent(e,t,i,s,n){throw new Error("initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=true;}stopImmediatePropagation(){this.propagationImmediatelyStopped=true;}stopPropagation(){this.propagationStopped=true;}};});function XI(r){return function(e){return e.test(r)}}function Hc(r){var e={userAgent:"",platform:"",maxTouchPoints:0};!r&&typeof navigator<"u"?e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof r=="string"?e.userAgent=r:r&&r.userAgent&&(e={userAgent:r.userAgent,platform:r.platform,maxTouchPoints:r.maxTouchPoints||0});var t=e.userAgent,i=t.split("[FBAN");typeof i[1]<"u"&&(t=i[0]),i=t.split("Twitter"),typeof i[1]<"u"&&(t=i[0]);var s=XI(t),n={apple:{phone:s(Cy)&&!s(is),ipod:s(pA),tablet:!s(Cy)&&(s(mA)||EA(e))&&!s(is),universal:s(gA),device:(s(Cy)||s(pA)||s(mA)||s(gA)||EA(e))&&!s(is)},amazon:{phone:s(hu),tablet:!s(hu)&&s(mp),device:s(hu)||s(mp)},android:{phone:!s(is)&&s(hu)||!s(is)&&s(Ay),tablet:!s(is)&&!s(hu)&&!s(Ay)&&(s(mp)||s(xA)),device:!s(is)&&(s(hu)||s(mp)||s(Ay)||s(xA))||s(/\bokhttp\b/i)},windows:{phone:s(is),tablet:s(_A),device:s(is)||s(_A)},other:{blackberry:s(bA),blackberry10:s(yA),opera:s(vA),firefox:s(SA),chrome:s(TA),device:s(bA)||s(yA)||s(vA)||s(SA)||s(TA)},any:false,phone:false,tablet:false};return n.any=n.apple.device||n.android.device||n.windows.device||n.other.device,n.phone=n.apple.phone||n.android.phone||n.windows.phone,n.tablet=n.apple.tablet||n.android.tablet||n.windows.tablet,n}var Cy,pA,mA,gA,Ay,xA,hu,mp,is,_A,bA,yA,vA,TA,SA,EA,Py=f(()=>{Cy=/iPhone/i,pA=/iPod/i,mA=/iPad/i,gA=/\biOS-universal(?:.+)Mac\b/i,Ay=/\bAndroid(?:.+)Mobile\b/i,xA=/Android/i,hu=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,mp=/Silk/i,is=/Windows Phone/i,_A=/\bWindows(?:.+)ARM\b/i,bA=/BlackBerry/i,yA=/BB10/i,vA=/Opera Mini/i,TA=/\b(CriOS|Chrome)(?:.+)Mobile/i,SA=/Mobile(?:.+)Firefox\b/i,EA=function(r){return typeof r<"u"&&r.platform==="MacIntel"&&typeof r.maxTouchPoints=="number"&&r.maxTouchPoints>1&&typeof MSStream>"u"};});var CA=f(()=>{Py();Py();});var YI,gp,wy=f(()=>{CA();YI=Hc.default??Hc,gp=YI(globalThis.navigator);});var jI,xp,$I,qI,AA,PA,KI,ZI,QI,By,_p,Ry=f(()=>{Nc();B();wy();$f();jI=9,xp=100,$I=0,qI=0,AA=2,PA=1,KI=-1e3,ZI=-1e3,QI=2,By=class wA{constructor(e,t=gp){this._mobileInfo=t,this.debug=false,this._activateOnTab=true,this._deactivateOnMouseMove=true,this._isActive=false,this._isMobileAccessibility=false,this._div=null,this._pool=[],this._renderId=0,this._children=[],this._androidUpdateCount=0,this._androidUpdateFrequency=500,this._hookDiv=null,(t.tablet||t.phone)&&this._createTouchHook(),this._renderer=e;}get isActive(){return this._isActive}get isMobileAccessibility(){return this._isMobileAccessibility}get hookDiv(){return this._hookDiv}_createTouchHook(){let e=document.createElement("button");e.style.width=`${PA}px`,e.style.height=`${PA}px`,e.style.position="absolute",e.style.top=`${KI}px`,e.style.left=`${ZI}px`,e.style.zIndex=QI.toString(),e.style.backgroundColor="#FF0000",e.title="select to enable accessibility for this content",e.addEventListener("focus",()=>{this._isMobileAccessibility=true,this._activate(),this._destroyTouchHook();}),document.body.appendChild(e),this._hookDiv=e;}_destroyTouchHook(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null);}_activate(){if(this._isActive)return;this._isActive=true,this._div||(this._div=document.createElement("div"),this._div.style.width=`${xp}px`,this._div.style.height=`${xp}px`,this._div.style.position="absolute",this._div.style.top=`${$I}px`,this._div.style.left=`${qI}px`,this._div.style.zIndex=AA.toString(),this._div.style.pointerEvents="none"),this._activateOnTab&&(this._onKeyDown=this._onKeyDown.bind(this),globalThis.addEventListener("keydown",this._onKeyDown,false)),this._deactivateOnMouseMove&&(this._onMouseMove=this._onMouseMove.bind(this),globalThis.document.addEventListener("mousemove",this._onMouseMove,true));let e=this._renderer.view.canvas;if(e.parentNode)e.parentNode.appendChild(this._div),this._initAccessibilitySetup();else {let t=new MutationObserver(()=>{e.parentNode&&(e.parentNode.appendChild(this._div),t.disconnect(),this._initAccessibilitySetup());});t.observe(document.body,{childList:true,subtree:true});}}_initAccessibilitySetup(){this._renderer.runners.postrender.add(this),this._renderer.lastObjectRendered&&this._updateAccessibleObjects(this._renderer.lastObjectRendered);}_deactivate(){if(!(!this._isActive||this._isMobileAccessibility)){this._isActive=false,globalThis.document.removeEventListener("mousemove",this._onMouseMove,true),this._activateOnTab&&globalThis.addEventListener("keydown",this._onKeyDown,false),this._renderer.runners.postrender.remove(this);for(let e of this._children)e._accessibleDiv&&e._accessibleDiv.parentNode&&(e._accessibleDiv.parentNode.removeChild(e._accessibleDiv),e._accessibleDiv=null),e._accessibleActive=false;this._pool.forEach(e=>{e.parentNode&&e.parentNode.removeChild(e);}),this._div&&this._div.parentNode&&this._div.parentNode.removeChild(this._div),this._pool=[],this._children=[];}}_updateAccessibleObjects(e){if(!e.visible||!e.accessibleChildren)return;e.accessible&&(e._accessibleActive||this._addChild(e),e._renderId=this._renderId);let t=e.children;if(t)for(let i=0;i<t.length;i++)this._updateAccessibleObjects(t[i]);}init(e){let i={accessibilityOptions:{...wA.defaultOptions,...e?.accessibilityOptions||{}}};this.debug=i.accessibilityOptions.debug,this._activateOnTab=i.accessibilityOptions.activateOnTab,this._deactivateOnMouseMove=i.accessibilityOptions.deactivateOnMouseMove,i.accessibilityOptions.enabledByDefault?this._activate():this._activateOnTab&&(this._onKeyDown=this._onKeyDown.bind(this),globalThis.addEventListener("keydown",this._onKeyDown,false)),this._renderer.runners.postrender.remove(this);}postrender(){let e=performance.now();if(this._mobileInfo.android.device&&e<this._androidUpdateCount||(this._androidUpdateCount=e+this._androidUpdateFrequency,!this._renderer.renderingToScreen||!this._renderer.view.canvas))return;let t=new Set;if(this._renderer.lastObjectRendered){this._updateAccessibleObjects(this._renderer.lastObjectRendered);for(let i of this._children)i._renderId===this._renderId&&t.add(this._children.indexOf(i));}for(let i=this._children.length-1;i>=0;i--){let s=this._children[i];t.has(i)||(s._accessibleDiv&&s._accessibleDiv.parentNode&&(s._accessibleDiv.parentNode.removeChild(s._accessibleDiv),this._pool.push(s._accessibleDiv),s._accessibleDiv=null),s._accessibleActive=false,su(this._children,i,1));}if(this._renderer.renderingToScreen){let{x:i,y:s,width:n,height:o}=this._renderer.screen,a=this._div;a.style.left=`${i}px`,a.style.top=`${s}px`,a.style.width=`${n}px`,a.style.height=`${o}px`;}for(let i=0;i<this._children.length;i++){let s=this._children[i];if(!s._accessibleActive||!s._accessibleDiv)continue;let n=s._accessibleDiv,o=s.hitArea||s.getBounds().rectangle;if(s.hitArea){let a=s.worldTransform,u=this._renderer.resolution,l=this._renderer.resolution;n.style.left=`${(a.tx+o.x*a.a)*u}px`,n.style.top=`${(a.ty+o.y*a.d)*l}px`,n.style.width=`${o.width*a.a*u}px`,n.style.height=`${o.height*a.d*l}px`;}else {this._capHitArea(o);let a=this._renderer.resolution,u=this._renderer.resolution;n.style.left=`${o.x*a}px`,n.style.top=`${o.y*u}px`,n.style.width=`${o.width*a}px`,n.style.height=`${o.height*u}px`;}}this._renderId++;}_updateDebugHTML(e){e.innerHTML=`type: ${e.type}</br> title : ${e.title}</br> tabIndex: ${e.tabIndex}`;}_capHitArea(e){e.x<0&&(e.width+=e.x,e.x=0),e.y<0&&(e.height+=e.y,e.y=0);let{width:t,height:i}=this._renderer;e.x+e.width>t&&(e.width=t-e.x),e.y+e.height>i&&(e.height=i-e.y);}_addChild(e){let t=this._pool.pop();t||(e.accessibleType==="button"?t=document.createElement("button"):(t=document.createElement(e.accessibleType),t.style.cssText=`
6
+ Deprecated since v${r}`),console.warn(i))),eA[e]=true;}var eA,Y,Xf,Pe=f(()=>{eA={},Y="8.0.0",Xf="8.3.4";});var Ji,Yf=f(()=>{Ji=class{constructor(e,t){this._pool=[],this._count=0,this._index=0,this._classType=e,t&&this.prepopulate(t);}prepopulate(e){for(let t=0;t<e;t++)this._pool[this._index++]=new this._classType;this._count+=e;}get(e){let t;return this._index>0?t=this._pool[--this._index]:t=new this._classType,t.init?.(e),t}return(e){e.reset?.(),this._pool[this._index++]=e;}get totalSize(){return this._count}get totalFree(){return this._index}get totalUsed(){return this._count-this._index}clear(){this._pool.length=0,this._index=0;}};});var Ic,Ve,Si=f(()=>{Yf();Ic=class{constructor(){this._poolsByClass=new Map;}prepopulate(e,t){this.getPool(e).prepopulate(t);}get(e,t){return this.getPool(e).get(t)}return(e){this.getPool(e.constructor).return(e);}getPool(e){return this._poolsByClass.has(e)||this._poolsByClass.set(e,new Ji(e)),this._poolsByClass.get(e)}stats(){let e={};return this._poolsByClass.forEach(t=>{let i=e[t._classType.name]?t._classType.name+t._classType.ID:t._classType.name;e[i]={free:t.totalFree,used:t.totalUsed,size:t.totalSize};}),e}},Ve=new Ic;});var jf,ay=f(()=>{Pe();jf={get isCachedAsTexture(){return !!this.renderGroup?.isCachedAsTexture},cacheAsTexture(r){typeof r=="boolean"&&r===false?this.disableRenderGroup():(this.enableRenderGroup(),this.renderGroup.enableCacheAsTexture(r===true?{}:r));},updateCacheTexture(){this.renderGroup?.updateCacheTexture();},get cacheAsBitmap(){return this.isCachedAsTexture},set cacheAsBitmap(r){U("v8.6.0","cacheAsBitmap is deprecated, use cacheAsTexture instead."),this.cacheAsTexture(r);}};});function su(r,e,t){let i=r.length,s;if(e>=i||t===0)return;t=e+t>i?i-e:t;let n=i-t;for(s=e;s<n;++s)r[s]=r[s+t];r.length=n;}var $f=f(()=>{});var qf,uy=f(()=>{$f();Pe();qf={allowChildren:true,removeChildren(r=0,e){let t=e??this.children.length,i=t-r,s=[];if(i>0&&i<=t){for(let o=t-1;o>=r;o--){let a=this.children[o];a&&(s.push(a),a.parent=null);}su(this.children,r,t);let n=this.renderGroup||this.parentRenderGroup;n&&n.removeChildren(s);for(let o=0;o<s.length;++o){let a=s[o];a.parentRenderLayer?.detach(a),this.emit("childRemoved",a,this,o),s[o].emit("removed",this);}return s.length>0&&this._didViewChangeTick++,s}else if(i===0&&this.children.length===0)return s;throw new RangeError("removeChildren: numeric values are outside the acceptable range.")},removeChildAt(r){let e=this.getChildAt(r);return this.removeChild(e)},getChildAt(r){if(r<0||r>=this.children.length)throw new Error(`getChildAt: Index (${r}) does not exist.`);return this.children[r]},setChildIndex(r,e){if(e<0||e>=this.children.length)throw new Error(`The index ${e} supplied is out of bounds ${this.children.length}`);this.getChildIndex(r),this.addChildAt(r,e);},getChildIndex(r){let e=this.children.indexOf(r);if(e===-1)throw new Error("The supplied Container must be a child of the caller");return e},addChildAt(r,e){this.allowChildren||U(Y,"addChildAt: Only Containers will be allowed to add children in v8.0.0");let{children:t}=this;if(e<0||e>t.length)throw new Error(`${r}addChildAt: The index ${e} supplied is out of bounds ${t.length}`);if(r.parent){let s=r.parent.children.indexOf(r);if(r.parent===this&&s===e)return r;s!==-1&&r.parent.children.splice(s,1);}e===t.length?t.push(r):t.splice(e,0,r),r.parent=this,r.didChange=true,r._updateFlags=15;let i=this.renderGroup||this.parentRenderGroup;return i&&i.addChild(r),this.sortableChildren&&(this.sortDirty=true),this.emit("childAdded",r,this,e),r.emit("added",this),r},swapChildren(r,e){if(r===e)return;let t=this.getChildIndex(r),i=this.getChildIndex(e);this.children[t]=e,this.children[i]=r;let s=this.renderGroup||this.parentRenderGroup;s&&(s.structureDidChange=true),this._didContainerChangeTick++;},removeFromParent(){this.parent?.removeChild(this);},reparentChild(...r){return r.length===1?this.reparentChildAt(r[0],this.children.length):(r.forEach(e=>this.reparentChildAt(e,this.children.length)),r[0])},reparentChildAt(r,e){if(r.parent===this)return this.setChildIndex(r,e),r;let t=r.worldTransform.clone();r.removeFromParent(),this.addChildAt(r,e);let i=this.worldTransform.clone();return i.invert(),t.prepend(i),r.setFromMatrix(t),r}};});var Kf,ly=f(()=>{Kf={collectRenderables(r,e,t){this.parentRenderLayer&&this.parentRenderLayer!==t||this.globalDisplayStatus<7||!this.includeInBuild||(this.sortableChildren&&this.sortChildren(),this.isSimple?this.collectRenderablesSimple(r,e,t):this.renderGroup?e.renderPipes.renderGroup.addRenderGroup(this.renderGroup,r):this.collectRenderablesWithEffects(r,e,t));},collectRenderablesSimple(r,e,t){let i=this.children,s=i.length;for(let n=0;n<s;n++)i[n].collectRenderables(r,e,t);},collectRenderablesWithEffects(r,e,t){let{renderPipes:i}=e;for(let s=0;s<this.effects.length;s++){let n=this.effects[s];i[n.pipe].push(n,this,r);}this.collectRenderablesSimple(r,e,t);for(let s=this.effects.length-1;s>=0;s--){let n=this.effects[s];i[n.pipe].pop(n,this,r);}}};});var ei,Dc=f(()=>{ei=class{constructor(){this.pipe="filter",this.priority=1;}destroy(){for(let e=0;e<this.filters.length;e++)this.filters[e].destroy();this.filters=null,this.filterArea=null;}};});var kc,nu,cy=f(()=>{B();Si();kc=class{constructor(){this._effectClasses=[],this._tests=[],this._initialized=false;}init(){this._initialized||(this._initialized=true,this._effectClasses.forEach(e=>{this.add({test:e.test,maskClass:e});}));}add(e){this._tests.push(e);}getMaskEffect(e){this._initialized||this.init();for(let t=0;t<this._tests.length;t++){let i=this._tests[t];if(i.test(e))return Ve.get(i.maskClass,e)}return e}returnMaskEffect(e){Ve.return(e);}},nu=new kc;V.handleByList(x.MaskEffect,nu._effectClasses);});var Zf,hy=f(()=>{Dc();cy();Zf={_maskEffect:null,_maskOptions:{inverse:false},_filterEffect:null,effects:[],_markStructureAsChanged(){let r=this.renderGroup||this.parentRenderGroup;r&&(r.structureDidChange=true);},addEffect(r){this.effects.indexOf(r)===-1&&(this.effects.push(r),this.effects.sort((t,i)=>t.priority-i.priority),this._markStructureAsChanged(),this._updateIsSimple());},removeEffect(r){let e=this.effects.indexOf(r);e!==-1&&(this.effects.splice(e,1),this._markStructureAsChanged(),this._updateIsSimple());},set mask(r){let e=this._maskEffect;e?.mask!==r&&(e&&(this.removeEffect(e),nu.returnMaskEffect(e),this._maskEffect=null),r!=null&&(this._maskEffect=nu.getMaskEffect(r),this.addEffect(this._maskEffect)));},get mask(){return this._maskEffect?.mask},setMask(r){this._maskOptions={...this._maskOptions,...r},r.mask&&(this.mask=r.mask),this._markStructureAsChanged();},set filters(r){!Array.isArray(r)&&r&&(r=[r]);let e=this._filterEffect||(this._filterEffect=new ei);r=r;let t=r?.length>0,i=e.filters?.length>0,s=t!==i;r=Array.isArray(r)?r.slice(0):r,e.filters=Object.freeze(r),s&&(t?this.addEffect(e):(this.removeEffect(e),e.filters=r??null));},get filters(){return this._filterEffect?.filters},set filterArea(r){this._filterEffect||(this._filterEffect=new ei),this._filterEffect.filterArea=r;},get filterArea(){return this._filterEffect?.filterArea}};});var Qf,dy=f(()=>{Pe();Qf={label:null,get name(){return U(Y,"Container.name property has been removed, use Container.label instead"),this.label},set name(r){U(Y,"Container.name property has been removed, use Container.label instead"),this.label=r;},getChildByName(r,e=false){return this.getChildByLabel(r,e)},getChildByLabel(r,e=false){let t=this.children;for(let i=0;i<t.length;i++){let s=t[i];if(s.label===r||r instanceof RegExp&&r.test(s.label))return s}if(e)for(let i=0;i<t.length;i++){let n=t[i].getChildByLabel(r,true);if(n)return n}return null},getChildrenByLabel(r,e=false,t=[]){let i=this.children;for(let s=0;s<i.length;s++){let n=i[s];(n.label===r||r instanceof RegExp&&r.test(n.label))&&t.push(n);}if(e)for(let s=0;s<i.length;s++)i[s].getChildrenByLabel(r,true,t);return t}};});var Jf;exports.Rectangle=void 0;var ct=f(()=>{cr();Jf=[new me,new me,new me,new me],exports.Rectangle=class r{constructor(e=0,t=0,i=0,s=0){this.type="rectangle",this.x=Number(e),this.y=Number(t),this.width=Number(i),this.height=Number(s);}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 r(0,0,0,0)}clone(){return new r(this.x,this.y,this.width,this.height)}copyFromBounds(e){return this.x=e.minX,this.y=e.minY,this.width=e.maxX-e.minX,this.height=e.maxY-e.minY,this}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this}copyTo(e){return e.copyFrom(this),e}contains(e,t){return this.width<=0||this.height<=0?false:e>=this.x&&e<this.x+this.width&&t>=this.y&&t<this.y+this.height}strokeContains(e,t,i,s=.5){let{width:n,height:o}=this;if(n<=0||o<=0)return false;let a=this.x,u=this.y,l=i*(1-s),c=i-l,h=a-l,d=a+n+l,p=u-l,m=u+o+l,b=a+c,_=a+n-c,g=u+c,y=u+o-c;return e>=h&&e<=d&&t>=p&&t<=m&&!(e>b&&e<_&&t>g&&t<y)}intersects(e,t){if(!t){let A=this.x<e.x?e.x:this.x;if((this.right>e.right?e.right:this.right)<=A)return false;let M=this.y<e.y?e.y:this.y;return (this.bottom>e.bottom?e.bottom:this.bottom)>M}let i=this.left,s=this.right,n=this.top,o=this.bottom;if(s<=i||o<=n)return false;let a=Jf[0].set(e.left,e.top),u=Jf[1].set(e.left,e.bottom),l=Jf[2].set(e.right,e.top),c=Jf[3].set(e.right,e.bottom);if(l.x<=a.x||u.y<=a.y)return false;let h=Math.sign(t.a*t.d-t.b*t.c);if(h===0||(t.apply(a,a),t.apply(u,u),t.apply(l,l),t.apply(c,c),Math.max(a.x,u.x,l.x,c.x)<=i||Math.min(a.x,u.x,l.x,c.x)>=s||Math.max(a.y,u.y,l.y,c.y)<=n||Math.min(a.y,u.y,l.y,c.y)>=o))return false;let d=h*(u.y-a.y),p=h*(a.x-u.x),m=d*i+p*n,b=d*s+p*n,_=d*i+p*o,g=d*s+p*o;if(Math.max(m,b,_,g)<=d*a.x+p*a.y||Math.min(m,b,_,g)>=d*c.x+p*c.y)return false;let y=h*(a.y-l.y),S=h*(l.x-a.x),E=y*i+S*n,F=y*s+S*n,T=y*i+S*o,C=y*s+S*o;return !(Math.max(E,F,T,C)<=y*a.x+S*a.y||Math.min(E,F,T,C)>=y*c.x+S*c.y)}pad(e=0,t=e){return this.x-=e,this.y-=t,this.width+=e*2,this.height+=t*2,this}fit(e){let t=Math.max(this.x,e.x),i=Math.min(this.x+this.width,e.x+e.width),s=Math.max(this.y,e.y),n=Math.min(this.y+this.height,e.y+e.height);return this.x=t,this.width=Math.max(i-t,0),this.y=s,this.height=Math.max(n-s,0),this}ceil(e=1,t=.001){let i=Math.ceil((this.x+this.width-t)*e)/e,s=Math.ceil((this.y+this.height-t)*e)/e;return this.x=Math.floor((this.x+t)*e)/e,this.y=Math.floor((this.y+t)*e)/e,this.width=i-this.x,this.height=s-this.y,this}enlarge(e){let t=Math.min(this.x,e.x),i=Math.max(this.x+this.width,e.x+e.width),s=Math.min(this.y,e.y),n=Math.max(this.y+this.height,e.y+e.height);return this.x=t,this.width=i-t,this.y=s,this.height=n-s,this}getBounds(e){return e||(e=new r),e.copyFrom(this),e}containsRect(e){if(this.width<=0||this.height<=0)return false;let t=e.x,i=e.y,s=e.x+e.width,n=e.y+e.height;return t>=this.x&&t<this.x+this.width&&i>=this.y&&i<this.y+this.height&&s>=this.x&&s<this.x+this.width&&n>=this.y&&n<this.y+this.height}set(e,t,i,s){return this.x=e,this.y=t,this.width=i,this.height=s,this}toString(){return `[pixi.js/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}};});var tA,Ae,Lt=f(()=>{Te();ct();tA=new G,Ae=class r{constructor(e=1/0,t=1/0,i=-1/0,s=-1/0){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=tA,this.minX=e,this.minY=t,this.maxX=i,this.maxY=s;}isEmpty(){return this.minX>this.maxX||this.minY>this.maxY}get rectangle(){this._rectangle||(this._rectangle=new exports.Rectangle);let e=this._rectangle;return this.minX>this.maxX||this.minY>this.maxY?(e.x=0,e.y=0,e.width=0,e.height=0):e.copyFromBounds(this),e}clear(){return this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=tA,this}set(e,t,i,s){this.minX=e,this.minY=t,this.maxX=i,this.maxY=s;}addFrame(e,t,i,s,n){n||(n=this.matrix);let o=n.a,a=n.b,u=n.c,l=n.d,c=n.tx,h=n.ty,d=this.minX,p=this.minY,m=this.maxX,b=this.maxY,_=o*e+u*t+c,g=a*e+l*t+h;_<d&&(d=_),g<p&&(p=g),_>m&&(m=_),g>b&&(b=g),_=o*i+u*t+c,g=a*i+l*t+h,_<d&&(d=_),g<p&&(p=g),_>m&&(m=_),g>b&&(b=g),_=o*e+u*s+c,g=a*e+l*s+h,_<d&&(d=_),g<p&&(p=g),_>m&&(m=_),g>b&&(b=g),_=o*i+u*s+c,g=a*i+l*s+h,_<d&&(d=_),g<p&&(p=g),_>m&&(m=_),g>b&&(b=g),this.minX=d,this.minY=p,this.maxX=m,this.maxY=b;}addRect(e,t){this.addFrame(e.x,e.y,e.x+e.width,e.y+e.height,t);}addBounds(e,t){this.addFrame(e.minX,e.minY,e.maxX,e.maxY,t);}addBoundsMask(e){this.minX=this.minX>e.minX?this.minX:e.minX,this.minY=this.minY>e.minY?this.minY:e.minY,this.maxX=this.maxX<e.maxX?this.maxX:e.maxX,this.maxY=this.maxY<e.maxY?this.maxY:e.maxY;}applyMatrix(e){let t=this.minX,i=this.minY,s=this.maxX,n=this.maxY,{a:o,b:a,c:u,d:l,tx:c,ty:h}=e,d=o*t+u*i+c,p=a*t+l*i+h;this.minX=d,this.minY=p,this.maxX=d,this.maxY=p,d=o*s+u*i+c,p=a*s+l*i+h,this.minX=d<this.minX?d:this.minX,this.minY=p<this.minY?p:this.minY,this.maxX=d>this.maxX?d:this.maxX,this.maxY=p>this.maxY?p:this.maxY,d=o*t+u*n+c,p=a*t+l*n+h,this.minX=d<this.minX?d:this.minX,this.minY=p<this.minY?p:this.minY,this.maxX=d>this.maxX?d:this.maxX,this.maxY=p>this.maxY?p:this.maxY,d=o*s+u*n+c,p=a*s+l*n+h,this.minX=d<this.minX?d:this.minX,this.minY=p<this.minY?p:this.minY,this.maxX=d>this.maxX?d:this.maxX,this.maxY=p>this.maxY?p:this.maxY;}fit(e){return this.minX<e.left&&(this.minX=e.left),this.maxX>e.right&&(this.maxX=e.right),this.minY<e.top&&(this.minY=e.top),this.maxY>e.bottom&&(this.maxY=e.bottom),this}fitBounds(e,t,i,s){return this.minX<e&&(this.minX=e),this.maxX>t&&(this.maxX=t),this.minY<i&&(this.minY=i),this.maxY>s&&(this.maxY=s),this}pad(e,t=e){return this.minX-=e,this.maxX+=e,this.minY-=t,this.maxY+=t,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 r(this.minX,this.minY,this.maxX,this.maxY)}scale(e,t=e){return this.minX*=e,this.minY*=t,this.maxX*=e,this.maxY*=t,this}get x(){return this.minX}set x(e){let t=this.maxX-this.minX;this.minX=e,this.maxX=e+t;}get y(){return this.minY}set y(e){let t=this.maxY-this.minY;this.minY=e,this.maxY=e+t;}get width(){return this.maxX-this.minX}set width(e){this.maxX=this.minX+e;}get height(){return this.maxY-this.minY}set height(e){this.maxY=this.minY+e;}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(e,t,i,s){let n=this.minX,o=this.minY,a=this.maxX,u=this.maxY;s||(s=this.matrix);let l=s.a,c=s.b,h=s.c,d=s.d,p=s.tx,m=s.ty;for(let b=t;b<i;b+=2){let _=e[b],g=e[b+1],y=l*_+h*g+p,S=c*_+d*g+m;n=y<n?y:n,o=S<o?S:o,a=y>a?y:a,u=S>u?S:u;}this.minX=n,this.minY=o,this.maxX=a,this.maxY=u;}containsPoint(e,t){return this.minX<=e&&this.minY<=t&&this.maxX>=e&&this.maxY>=t}toString(){return `[pixi.js:Bounds minX=${this.minX} minY=${this.minY} maxX=${this.maxX} maxY=${this.maxY} width=${this.width} height=${this.height}]`}copyFrom(e){return this.minX=e.minX,this.minY=e.minY,this.maxX=e.maxX,this.maxY=e.maxY,this}};});var ut,ir,Bs=f(()=>{Te();Yf();Lt();ut=new Ji(G),ir=new Ji(Ae);});var LI,ep,fy=f(()=>{Te();Lt();Bs();LI=new G,ep={getFastGlobalBounds(r,e){e||(e=new Ae),e.clear(),this._getGlobalBoundsRecursive(!!r,e,this.parentRenderLayer),e.isValid||e.set(0,0,0,0);let t=this.renderGroup||this.parentRenderGroup;return e.applyMatrix(t.worldTransform),e},_getGlobalBoundsRecursive(r,e,t){let i=e;if(r&&this.parentRenderLayer&&this.parentRenderLayer!==t||this.localDisplayStatus!==7||!this.measurable)return;let s=!!this.effects.length;if((this.renderGroup||s)&&(i=ir.get().clear()),this.boundsArea)e.addRect(this.boundsArea,this.worldTransform);else {if(this.renderPipeId){let o=this.bounds;i.addFrame(o.minX,o.minY,o.maxX,o.maxY,this.groupTransform);}let n=this.children;for(let o=0;o<n.length;o++)n[o]._getGlobalBoundsRecursive(r,i,t);}if(s){let n=false,o=this.renderGroup||this.parentRenderGroup;for(let a=0;a<this.effects.length;a++)this.effects[a].addBounds&&(n||(n=true,i.applyMatrix(o.worldTransform)),this.effects[a].addBounds(i,true));n&&(i.applyMatrix(o.worldTransform.copyTo(LI).invert()),e.addBounds(i,this.relativeGroupTransform)),e.addBounds(i),ir.return(i);}else this.renderGroup&&(e.addBounds(i,this.relativeGroupTransform),ir.return(i));}};});function Ei(r,e,t){t.clear();let i,s;return r.parent?e?i=r.parent.worldTransform:(s=ut.get().identity(),i=ou(r,s)):i=G.IDENTITY,rA(r,t,i,e),s&&ut.return(s),t.isValid||t.set(0,0,0,0),t}function rA(r,e,t,i){if(!r.visible||!r.measurable)return;let s;i?s=r.worldTransform:(r.updateLocalTransform(),s=ut.get(),s.appendFrom(r.localTransform,t));let n=e,o=!!r.effects.length;if(o&&(e=ir.get().clear()),r.boundsArea)e.addRect(r.boundsArea,s);else {r.bounds&&(e.matrix=s,e.addBounds(r.bounds));for(let a=0;a<r.children.length;a++)rA(r.children[a],e,s,i);}if(o){for(let a=0;a<r.effects.length;a++)r.effects[a].addBounds?.(e);n.addBounds(e,G.IDENTITY),ir.return(e);}i||ut.return(s);}function ou(r,e){let t=r.parent;return t&&(ou(t,e),t.updateLocalTransform(),e.append(t.localTransform)),e}var Kn=f(()=>{Te();Bs();});function au(r,e){if(r===16777215||!e)return e;if(e===16777215||!r)return r;let t=r>>16&255,i=r>>8&255,s=r&255,n=e>>16&255,o=e>>8&255,a=e&255,u=t*n/255|0,l=i*o/255|0,c=s*a/255|0;return (u<<16)+(l<<8)+c}var tp=f(()=>{});function Rs(r,e){return r===iA?e:e===iA?r:au(r,e)}var iA,rp=f(()=>{tp();iA=16777215;});function es(r){return ((r&255)<<16)+(r&65280)+(r>>16&255)}var ip,sp=f(()=>{Kn();Bs();rp();ip={getGlobalAlpha(r){if(r)return this.renderGroup?this.renderGroup.worldAlpha:this.parentRenderGroup?this.parentRenderGroup.worldAlpha*this.alpha:this.alpha;let e=this.alpha,t=this.parent;for(;t;)e*=t.alpha,t=t.parent;return e},getGlobalTransform(r,e){if(e)return r.copyFrom(this.worldTransform);this.updateLocalTransform();let t=ou(this,ut.get().identity());return r.appendFrom(this.localTransform,t),ut.return(t),r},getGlobalTint(r){if(r)return this.renderGroup?es(this.renderGroup.worldColor):this.parentRenderGroup?es(Rs(this.localColor,this.parentRenderGroup.worldColor)):this.tint;let e=this.localColor,t=this.parent;for(;t;)e=Rs(e,t.localColor),t=t.parent;return es(e)}};});function Ms(r,e,t){return e.clear(),t||(t=G.IDENTITY),sA(r,e,t,r,true),e.isValid||e.set(0,0,0,0),e}function sA(r,e,t,i,s){let n;if(s)n=ut.get(),n=t.copyTo(n);else {if(!r.visible||!r.measurable)return;r.updateLocalTransform();let u=r.localTransform;n=ut.get(),n.appendFrom(u,t);}let o=e,a=!!r.effects.length;if(a&&(e=ir.get().clear()),r.boundsArea)e.addRect(r.boundsArea,n);else {r.renderPipeId&&(e.matrix=n,e.addBounds(r.bounds));let u=r.children;for(let l=0;l<u.length;l++)sA(u[l],e,n,i,false);}if(a){for(let u=0;u<r.effects.length;u++)r.effects[u].addLocalBounds?.(e,i);o.addBounds(e,G.IDENTITY),ir.return(e);}ut.return(n);}var Oc=f(()=>{Te();Bs();});function Fc(r,e){let t=r.children;for(let i=0;i<t.length;i++){let s=t[i],n=s.uid,o=(s._didViewChangeTick&65535)<<16|s._didContainerChangeTick&65535,a=e.index;(e.data[a]!==n||e.data[a+1]!==o)&&(e.data[e.index]=n,e.data[e.index+1]=o,e.didChange=true),e.index=a+2,s.children.length&&Fc(s,e);}return e.didChange}var py=f(()=>{});var NI,np,my=f(()=>{Te();Lt();Kn();Oc();py();NI=new G,np={_localBoundsCacheId:-1,_localBoundsCacheData:null,_setWidth(r,e){let t=Math.sign(this.scale.x)||1;e!==0?this.scale.x=r/e*t:this.scale.x=t;},_setHeight(r,e){let t=Math.sign(this.scale.y)||1;e!==0?this.scale.y=r/e*t:this.scale.y=t;},getLocalBounds(){this._localBoundsCacheData||(this._localBoundsCacheData={data:[],index:1,didChange:false,localBounds:new Ae});let r=this._localBoundsCacheData;return r.index=1,r.didChange=false,r.data[0]!==this._didViewChangeTick&&(r.didChange=true,r.data[0]=this._didViewChangeTick),Fc(this,r),r.didChange&&Ms(this,r.localBounds,NI),r.localBounds},getBounds(r,e){return Ei(this,r,e||new Ae)}};});var op,gy=f(()=>{op={_onRender:null,set onRender(r){let e=this.renderGroup||this.parentRenderGroup;if(!r){this._onRender&&e?.removeOnRender(this),this._onRender=null;return}this._onRender||e?.addOnRender(this),this._onRender=r;},get onRender(){return this._onRender}};});function HI(r,e){return r._zIndex-e._zIndex}var ap,xy=f(()=>{ap={_zIndex:0,sortDirty:false,sortableChildren:false,get zIndex(){return this._zIndex},set zIndex(r){this._zIndex!==r&&(this._zIndex=r,this.depthOfChildModified());},depthOfChildModified(){this.parent&&(this.parent.sortableChildren=true,this.parent.sortDirty=true),this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=true);},sortChildren(){this.sortDirty&&(this.sortDirty=false,this.children.sort(HI));}};});var up,_y=f(()=>{cr();Bs();up={getGlobalPosition(r=new me,e=false){return this.parent?this.parent.toGlobal(this._position,r,e):(r.x=this._position.x,r.y=this._position.y),r},toGlobal(r,e,t=false){let i=this.getGlobalTransform(ut.get(),t);return e=i.apply(r,e),ut.return(i),e},toLocal(r,e,t,i){e&&(r=e.toGlobal(r,t,i));let s=this.getGlobalTransform(ut.get(),i);return t=s.applyInverse(r,t),ut.return(s),t}};});var Is,lp=f(()=>{Et();Is=class{constructor(){this.uid=ce("instructionSet"),this.instructions=[],this.instructionSize=0,this.renderables=[],this.gcTick=0;}reset(){this.instructionSize=0;}add(e){this.instructions[this.instructionSize++]=e;}log(){this.instructions.length=this.instructionSize,console.table(this.instructions,["type","action"]);}};});function ti(r){return r+=r===0?1:0,--r,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r+1}function Gc(r){return !(r&r-1)&&!!r}function nA(r){let e=(r>65535?1:0)<<4;r>>>=e;let t=(r>255?1:0)<<3;return r>>>=t,e|=t,t=(r>15?1:0)<<2,r>>>=t,e|=t,t=(r>3?1:0)<<1,r>>>=t,e|=t,e|r>>1}var uu=f(()=>{});function Rt(r){let e={};for(let t in r)r[t]!==void 0&&(e[t]=r[t]);return e}var Ds=f(()=>{});function VI(r){let e=oA[r];return e===void 0&&(oA[r]=ce("resource")),e}var oA,aA,xt,ts=f(()=>{Ut();Et();Pe();oA=Object.create(null);aA=class uA extends _e{constructor(e={}){super(),this._resourceType="textureSampler",this._touched=0,this._maxAnisotropy=1,this.destroyed=false,e={...uA.defaultOptions,...e},this.addressMode=e.addressMode,this.addressModeU=e.addressModeU??this.addressModeU,this.addressModeV=e.addressModeV??this.addressModeV,this.addressModeW=e.addressModeW??this.addressModeW,this.scaleMode=e.scaleMode,this.magFilter=e.magFilter??this.magFilter,this.minFilter=e.minFilter??this.minFilter,this.mipmapFilter=e.mipmapFilter??this.mipmapFilter,this.lodMinClamp=e.lodMinClamp,this.lodMaxClamp=e.lodMaxClamp,this.compare=e.compare,this.maxAnisotropy=e.maxAnisotropy??1;}set addressMode(e){this.addressModeU=e,this.addressModeV=e,this.addressModeW=e;}get addressMode(){return this.addressModeU}set wrapMode(e){U(Y,"TextureStyle.wrapMode is now TextureStyle.addressMode"),this.addressMode=e;}get wrapMode(){return this.addressMode}set scaleMode(e){this.magFilter=e,this.minFilter=e,this.mipmapFilter=e;}get scaleMode(){return this.magFilter}set maxAnisotropy(e){this._maxAnisotropy=Math.min(e,16),this._maxAnisotropy>1&&(this.scaleMode="linear");}get maxAnisotropy(){return this._maxAnisotropy}get _resourceId(){return this._sharedResourceId||this._generateResourceId()}update(){this.emit("change",this),this._sharedResourceId=null;}_generateResourceId(){let e=`${this.addressModeU}-${this.addressModeV}-${this.addressModeW}-${this.magFilter}-${this.minFilter}-${this.mipmapFilter}-${this.lodMinClamp}-${this.lodMaxClamp}-${this.compare}-${this._maxAnisotropy}`;return this._sharedResourceId=VI(e),this._resourceId}destroy(){this.destroyed=true,this.emit("destroy",this),this.emit("change",this),this.removeAllListeners();}};aA.defaultOptions={addressMode:"clamp-to-edge",scaleMode:"linear"};xt=aA;});var lA,ge,Ct=f(()=>{Ut();uu();Ds();Et();ts();lA=class cA extends _e{constructor(e={}){super(),this.options=e,this.uid=ce("textureSource"),this._resourceType="textureSource",this._resourceId=ce("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=false,this.format="rgba8unorm",this.dimension="2d",this.antialias=false,this._touched=0,this._batchTick=-1,this._textureBindLocation=-1,e={...cA.defaultOptions,...e},this.label=e.label??"",this.resource=e.resource,this.autoGarbageCollect=e.autoGarbageCollect,this._resolution=e.resolution,e.width?this.pixelWidth=e.width*this._resolution:this.pixelWidth=this.resource?this.resourceWidth??1:1,e.height?this.pixelHeight=e.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=e.format,this.dimension=e.dimensions,this.mipLevelCount=e.mipLevelCount,this.autoGenerateMipmaps=e.autoGenerateMipmaps,this.sampleCount=e.sampleCount,this.antialias=e.antialias,this.alphaMode=e.alphaMode,this.style=new xt(Rt(e)),this.destroyed=false,this._refreshPOT();}get source(){return this}get style(){return this._style}set style(e){this.style!==e&&(this._style?.off("change",this._onStyleChange,this),this._style=e,this._style?.on("change",this._onStyleChange,this),this._onStyleChange());}get addressMode(){return this._style.addressMode}set addressMode(e){this._style.addressMode=e;}get repeatMode(){return this._style.addressMode}set repeatMode(e){this._style.addressMode=e;}get magFilter(){return this._style.magFilter}set magFilter(e){this._style.magFilter=e;}get minFilter(){return this._style.minFilter}set minFilter(e){this._style.minFilter=e;}get mipmapFilter(){return this._style.mipmapFilter}set mipmapFilter(e){this._style.mipmapFilter=e;}get lodMinClamp(){return this._style.lodMinClamp}set lodMinClamp(e){this._style.lodMinClamp=e;}get lodMaxClamp(){return this._style.lodMaxClamp}set lodMaxClamp(e){this._style.lodMaxClamp=e;}_onStyleChange(){this.emit("styleChange",this);}update(){if(this.resource){let e=this._resolution;if(this.resize(this.resourceWidth/e,this.resourceHeight/e))return}this.emit("update",this);}destroy(){this.destroyed=true,this.emit("destroy",this),this.emit("change",this),this._style&&(this._style.destroy(),this._style=null),this.uploadMethodId=null,this.resource=null,this.removeAllListeners();}unload(){this._resourceId=ce("resource"),this.emit("change",this),this.emit("unload",this);}get resourceWidth(){let{resource:e}=this;return e.naturalWidth||e.videoWidth||e.displayWidth||e.width}get resourceHeight(){let{resource:e}=this;return e.naturalHeight||e.videoHeight||e.displayHeight||e.height}get resolution(){return this._resolution}set resolution(e){this._resolution!==e&&(this._resolution=e,this.width=this.pixelWidth/e,this.height=this.pixelHeight/e);}resize(e,t,i){i||(i=this._resolution),e||(e=this.width),t||(t=this.height);let s=Math.round(e*i),n=Math.round(t*i);return this.width=s/i,this.height=n/i,this._resolution=i,this.pixelWidth===s&&this.pixelHeight===n?false:(this._refreshPOT(),this.pixelWidth=s,this.pixelHeight=n,this.emit("resize",this),this._resourceId=ce("resource"),this.emit("change",this),true)}updateMipmaps(){this.autoGenerateMipmaps&&this.mipLevelCount>1&&this.emit("updateMipmaps",this);}set wrapMode(e){this._style.wrapMode=e;}get wrapMode(){return this._style.wrapMode}set scaleMode(e){this._style.scaleMode=e;}get scaleMode(){return this._style.scaleMode}_refreshPOT(){this.isPowerOfTwo=Gc(this.pixelWidth)&&Gc(this.pixelHeight);}static test(e){throw new Error("Unimplemented")}};lA.defaultOptions={resolution:1,format:"bgra8unorm",alphaMode:"premultiply-alpha-on-upload",dimensions:"2d",mipLevelCount:1,autoGenerateMipmaps:false,sampleCount:1,antialias:false,autoGarbageCollect:false};ge=lA;});function zI(){for(let r=0;r<16;r++){let e=[];by.push(e);for(let t=0;t<16;t++){let i=cp(Zn[r]*Zn[t]+Jn[r]*Qn[t]),s=cp(Qn[r]*Zn[t]+eo[r]*Qn[t]),n=cp(Zn[r]*Jn[t]+Jn[r]*eo[t]),o=cp(Qn[r]*Jn[t]+eo[r]*eo[t]);for(let a=0;a<16;a++)if(Zn[a]===i&&Qn[a]===s&&Jn[a]===n&&eo[a]===o){e.push(a);break}}}for(let r=0;r<16;r++){let e=new G;e.set(Zn[r],Qn[r],Jn[r],eo[r],0,0),hA.push(e);}}var Zn,Qn,Jn,eo,by,hA,cp,be,hp=f(()=>{Te();Zn=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],Qn=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],Jn=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],eo=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],by=[],hA=[],cp=Math.sign;zI();be={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:r=>Zn[r],uY:r=>Qn[r],vX:r=>Jn[r],vY:r=>eo[r],inv:r=>r&8?r&15:-r&7,add:(r,e)=>by[r][e],sub:(r,e)=>by[r][be.inv(e)],rotate180:r=>r^4,isVertical:r=>(r&3)===2,byDirection:(r,e)=>Math.abs(r)*2<=Math.abs(e)?e>=0?be.S:be.N:Math.abs(e)*2<=Math.abs(r)?r>0?be.E:be.W:e>0?r>0?be.SE:be.SW:r>0?be.NE:be.NW,matrixAppendRotationInv:(r,e,t=0,i=0)=>{let s=hA[be.inv(e)];s.tx=t,s.ty=i,r.append(s);}};});var Uc,yy=f(()=>{Uc=()=>{};});var rs,dp=f(()=>{B();Ct();rs=class extends ge{constructor(e){let t=e.resource||new Float32Array(e.width*e.height*4),i=e.format;i||(t instanceof Float32Array?i="rgba32float":t instanceof Int32Array||t instanceof Uint32Array?i="rgba32uint":t instanceof Int16Array||t instanceof Uint16Array?i="rgba16uint":(i="bgra8unorm")),super({...e,resource:t,format:i}),this.uploadMethodId="buffer";}static test(e){return e instanceof Int8Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array}};rs.extension=x.TextureSource;});var dA,ks,fp=f(()=>{Te();dA=new G,ks=class{constructor(e,t){this.mapCoord=new G,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,typeof t>"u"?this.clampMargin=e.width<10?0:.5:this.clampMargin=t,this.isSimple=false,this.texture=e;}get texture(){return this._texture}set texture(e){this.texture!==e&&(this._texture?.removeListener("update",this.update,this),this._texture=e,this._texture.addListener("update",this.update,this),this.update());}multiplyUvs(e,t){t===void 0&&(t=e);let i=this.mapCoord;for(let s=0;s<e.length;s+=2){let n=e[s],o=e[s+1];t[s]=n*i.a+o*i.c+i.tx,t[s+1]=n*i.b+o*i.d+i.ty;}return t}update(){let e=this._texture;this._updateID++;let t=e.uvs;this.mapCoord.set(t.x1-t.x0,t.y1-t.y0,t.x3-t.x0,t.y3-t.y0,t.x0,t.y0);let i=e.orig,s=e.trim;s&&(dA.set(i.width/s.width,0,0,i.height/s.height,-s.x/s.width,-s.y/s.height),this.mapCoord.append(dA));let n=e.source,o=this.uClampFrame,a=this.clampMargin/n._resolution,u=this.clampOffset/n._resolution;return o[0]=(e.frame.x+a+u)/n.width,o[1]=(e.frame.y+a+u)/n.height,o[2]=(e.frame.x+e.frame.width-a+u)/n.width,o[3]=(e.frame.y+e.frame.height-a+u)/n.height,this.uClampOffset[0]=this.clampOffset/n.pixelWidth,this.uClampOffset[1]=this.clampOffset/n.pixelHeight,this.isSimple=e.frame.width===n.width&&e.frame.height===n.height&&e.rotate===0,true}};});exports.Texture=void 0;var ye=f(()=>{Ut();hp();ct();Et();Pe();yy();dp();Ct();fp();exports.Texture=class extends _e{constructor({source:e,label:t,frame:i,orig:s,trim:n,defaultAnchor:o,defaultBorders:a,rotate:u,dynamic:l}={}){if(super(),this.uid=ce("texture"),this.uvs={x0:0,y0:0,x1:0,y1:0,x2:0,y2:0,x3:0,y3:0},this.frame=new exports.Rectangle,this.noFrame=false,this.dynamic=false,this.isTexture=true,this.label=t,this.source=e?.source??new ge,this.noFrame=!i,i)this.frame.copyFrom(i);else {let{width:c,height:h}=this._source;this.frame.width=c,this.frame.height=h;}this.orig=s||this.frame,this.trim=n,this.rotate=u??0,this.defaultAnchor=o,this.defaultBorders=a,this.destroyed=false,this.dynamic=l||false,this.updateUvs();}set source(e){this._source&&this._source.off("resize",this.update,this),this._source=e,e.on("resize",this.update,this),this.emit("update",this);}get source(){return this._source}get textureMatrix(){return this._textureMatrix||(this._textureMatrix=new ks(this)),this._textureMatrix}get width(){return this.orig.width}get height(){return this.orig.height}updateUvs(){let{uvs:e,frame:t}=this,{width:i,height:s}=this._source,n=t.x/i,o=t.y/s,a=t.width/i,u=t.height/s,l=this.rotate;if(l){let c=a/2,h=u/2,d=n+c,p=o+h;l=be.add(l,be.NW),e.x0=d+c*be.uX(l),e.y0=p+h*be.uY(l),l=be.add(l,2),e.x1=d+c*be.uX(l),e.y1=p+h*be.uY(l),l=be.add(l,2),e.x2=d+c*be.uX(l),e.y2=p+h*be.uY(l),l=be.add(l,2),e.x3=d+c*be.uX(l),e.y3=p+h*be.uY(l);}else e.x0=n,e.y0=o,e.x1=n+a,e.y1=o,e.x2=n+a,e.y2=o+u,e.x3=n,e.y3=o+u;}destroy(e=false){this._source&&e&&(this._source.destroy(),this._source=null),this._textureMatrix=null,this.destroyed=true,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 U(Y,"Texture.baseTexture is now Texture.source"),this._source}};exports.Texture.EMPTY=new exports.Texture({label:"EMPTY",source:new ge({label:"EMPTY"})});exports.Texture.EMPTY.destroy=Uc;exports.Texture.WHITE=new exports.Texture({source:new rs({resource:new Uint8Array([255,255,255,255]),width:1,height:1,alphaMode:"premultiply-alpha-on-upload",label:"WHITE"}),label:"WHITE"});exports.Texture.WHITE.destroy=Uc;});var WI,Lc,Me,ri=f(()=>{uu();Ct();ye();ts();WI=0,Lc=class{constructor(e){this._poolKeyHash=Object.create(null),this._texturePool={},this.textureOptions=e||{},this.enableFullScreen=false,this.textureStyle=new xt(this.textureOptions);}createTexture(e,t,i){let s=new ge({...this.textureOptions,width:e,height:t,resolution:1,antialias:i,autoGarbageCollect:false});return new exports.Texture({source:s,label:`texturePool_${WI++}`})}getOptimalTexture(e,t,i=1,s){let n=Math.ceil(e*i-1e-6),o=Math.ceil(t*i-1e-6);n=ti(n),o=ti(o);let a=(n<<17)+(o<<1)+(s?1:0);this._texturePool[a]||(this._texturePool[a]=[]);let u=this._texturePool[a].pop();return u||(u=this.createTexture(n,o,s)),u.source._resolution=i,u.source.width=n/i,u.source.height=o/i,u.source.pixelWidth=n,u.source.pixelHeight=o,u.frame.x=0,u.frame.y=0,u.frame.width=e,u.frame.height=t,u.updateUvs(),this._poolKeyHash[u.uid]=a,u}getSameSizeTexture(e,t=false){let i=e.source;return this.getOptimalTexture(e.width,e.height,i._resolution,t)}returnTexture(e,t=false){let i=this._poolKeyHash[e.uid];t&&(e.source.style=this.textureStyle),this._texturePool[i].push(e);}clear(e){if(e=e!==false,e)for(let t in this._texturePool){let i=this._texturePool[t];if(i)for(let s=0;s<i.length;s++)i[s].destroy(true);}this._texturePool={};}},Me=new Lc;});var lu,vy=f(()=>{Te();lp();ri();lu=class{constructor(){this.renderPipeId="renderGroup",this.root=null,this.canBundle=false,this.renderGroupParent=null,this.renderGroupChildren=[],this.worldTransform=new G,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=true,this.instructionSet=new Is,this._onRenderContainers=[],this.textureNeedsUpdate=true,this.isCachedAsTexture=false,this._matrixDirty=7;}init(e){this.root=e,e._onRender&&this.addOnRender(e),e.didChange=true;let t=e.children;for(let i=0;i<t.length;i++){let s=t[i];s._updateFlags=15,this.addChild(s);}}enableCacheAsTexture(e={}){this.textureOptions=e,this.isCachedAsTexture=true,this.textureNeedsUpdate=true;}disableCacheAsTexture(){this.isCachedAsTexture=false,this.texture&&(Me.returnTexture(this.texture),this.texture=null);}updateCacheTexture(){this.textureNeedsUpdate=true;}reset(){this.renderGroupChildren.length=0;for(let e in this.childrenToUpdate){let t=this.childrenToUpdate[e];t.list.fill(null),t.index=0;}this.childrenRenderablesToUpdate.index=0,this.childrenRenderablesToUpdate.list.fill(null),this.root=null,this.updateTick=0,this.structureDidChange=true,this._onRenderContainers.length=0,this.renderGroupParent=null,this.disableCacheAsTexture();}get localTransform(){return this.root.localTransform}addRenderGroupChild(e){e.renderGroupParent&&e.renderGroupParent._removeRenderGroupChild(e),e.renderGroupParent=this,this.renderGroupChildren.push(e);}_removeRenderGroupChild(e){let t=this.renderGroupChildren.indexOf(e);t>-1&&this.renderGroupChildren.splice(t,1),e.renderGroupParent=null;}addChild(e){if(this.structureDidChange=true,e.parentRenderGroup=this,e.updateTick=-1,e.parent===this.root?e.relativeRenderGroupDepth=1:e.relativeRenderGroupDepth=e.parent.relativeRenderGroupDepth+1,e.didChange=true,this.onChildUpdate(e),e.renderGroup){this.addRenderGroupChild(e.renderGroup);return}e._onRender&&this.addOnRender(e);let t=e.children;for(let i=0;i<t.length;i++)this.addChild(t[i]);}removeChild(e){if(this.structureDidChange=true,e._onRender&&(e.renderGroup||this.removeOnRender(e)),e.parentRenderGroup=null,e.renderGroup){this._removeRenderGroupChild(e.renderGroup);return}let t=e.children;for(let i=0;i<t.length;i++)this.removeChild(t[i]);}removeChildren(e){for(let t=0;t<e.length;t++)this.removeChild(e[t]);}onChildUpdate(e){let t=this.childrenToUpdate[e.relativeRenderGroupDepth];t||(t=this.childrenToUpdate[e.relativeRenderGroupDepth]={index:0,list:[]}),t.list[t.index++]=e;}updateRenderable(e){e.globalDisplayStatus<7||(this.instructionSet.renderPipes[e.renderPipeId].updateRenderable(e),e.didViewUpdate=false);}onChildViewUpdate(e){this.childrenRenderablesToUpdate.list[this.childrenRenderablesToUpdate.index++]=e;}get isRenderable(){return this.root.localDisplayStatus===7&&this.worldAlpha>0}addOnRender(e){this._onRenderContainers.push(e);}removeOnRender(e){this._onRenderContainers.splice(this._onRenderContainers.indexOf(e),1);}runOnRender(e){for(let t=0;t<this._onRenderContainers.length;t++)this._onRenderContainers[t]._onRender(e);}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(e=[]){let t=this.root.children;for(let i=0;i<t.length;i++)this._getChildren(t[i],e);return e}_getChildren(e,t=[]){if(t.push(e),e.renderGroup)return t;let i=e.children;for(let s=0;s<i.length;s++)this._getChildren(i[s],t);return t}invalidateMatrices(){this._matrixDirty=7;}get inverseWorldTransform(){return (this._matrixDirty&1)===0?this._inverseWorldTransform:(this._matrixDirty&=-2,this._inverseWorldTransform||(this._inverseWorldTransform=new G),this._inverseWorldTransform.copyFrom(this.worldTransform).invert())}get textureOffsetInverseTransform(){return (this._matrixDirty&2)===0?this._textureOffsetInverseTransform:(this._matrixDirty&=-3,this._textureOffsetInverseTransform||(this._textureOffsetInverseTransform=new G),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;let e=this._parentCacheAsTextureRenderGroup;return e?(this._inverseParentTextureTransform||(this._inverseParentTextureTransform=new G),this._inverseParentTextureTransform.copyFrom(this.worldTransform).prepend(e.inverseWorldTransform).translate(-e._textureBounds.x,-e._textureBounds.y)):this.worldTransform}get cacheToLocalTransform(){return this._parentCacheAsTextureRenderGroup?this._parentCacheAsTextureRenderGroup.textureOffsetInverseTransform:null}};});function to(r,e,t={}){for(let i in e)!t[i]&&e[i]!==void 0&&(r[i]=e[i]);}var pp=f(()=>{});var Ty,Sy,Ey,ro,cu,Os,fA,ue,hr=f(()=>{Ut();gt();ny();B();Te();Wf();ws();Et();Pe();Si();ay();uy();ly();hy();dy();fy();sp();my();gy();xy();_y();vy();pp();Ty=new Ne(null),Sy=new Ne(null),Ey=new Ne(null,1,1),ro=1,cu=2,Os=4,fA=8,ue=class r extends _e{constructor(e={}){super(),this.uid=ce("renderable"),this._updateFlags=15,this.renderGroup=null,this.parentRenderGroup=null,this.parentRenderGroupIndex=0,this.didChange=false,this.didViewUpdate=false,this.relativeRenderGroupDepth=0,this.children=[],this.parent=null,this.includeInBuild=true,this.measurable=true,this.isSimple=true,this.updateTick=-1,this.localTransform=new G,this.relativeGroupTransform=new G,this.groupTransform=this.relativeGroupTransform,this.destroyed=false,this._position=new Ne(this,0,0),this._scale=Ey,this._pivot=Sy,this._skew=Ty,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=[],to(this,e,{children:true,parent:true,effects:true}),e.children?.forEach(t=>this.addChild(t)),e.parent?.addChild(this);}static mixin(e){U("8.8.0","Container.mixin is deprecated, please use extensions.mixin instead."),V.mixin(r,e);}set _didChangeId(e){this._didViewChangeTick=e>>12&4095,this._didContainerChangeTick=e&4095;}get _didChangeId(){return this._didContainerChangeTick&4095|(this._didViewChangeTick&4095)<<12}addChild(...e){if(this.allowChildren||U(Y,"addChild: Only Containers will be allowed to add children in v8.0.0"),e.length>1){for(let s=0;s<e.length;s++)this.addChild(e[s]);return e[0]}let t=e[0],i=this.renderGroup||this.parentRenderGroup;return t.parent===this?(this.children.splice(this.children.indexOf(t),1),this.children.push(t),i&&(i.structureDidChange=true),t):(t.parent&&t.parent.removeChild(t),this.children.push(t),this.sortableChildren&&(this.sortDirty=true),t.parent=this,t.didChange=true,t._updateFlags=15,i&&i.addChild(t),this.emit("childAdded",t,this,this.children.length-1),t.emit("added",this),this._didViewChangeTick++,t._zIndex!==0&&t.depthOfChildModified(),t)}removeChild(...e){if(e.length>1){for(let s=0;s<e.length;s++)this.removeChild(e[s]);return e[0]}let t=e[0],i=this.children.indexOf(t);return i>-1&&(this._didViewChangeTick++,this.children.splice(i,1),this.renderGroup?this.renderGroup.removeChild(t):this.parentRenderGroup&&this.parentRenderGroup.removeChild(t),t.parentRenderLayer&&t.parentRenderLayer.detach(t),t.parent=null,this.emit("childRemoved",t,this,i),t.emit("removed",this)),t}_onUpdate(e){e&&e===this._skew&&this._updateSkew(),this._didContainerChangeTick++,!this.didChange&&(this.didChange=true,this.parentRenderGroup&&this.parentRenderGroup.onChildUpdate(this));}set isRenderGroup(e){!!this.renderGroup!==e&&(e?this.enableRenderGroup():this.disableRenderGroup());}get isRenderGroup(){return !!this.renderGroup}enableRenderGroup(){if(this.renderGroup)return;let e=this.parentRenderGroup;e?.removeChild(this),this.renderGroup=Ve.get(lu,this),this.groupTransform=G.IDENTITY,e?.addChild(this),this._updateIsSimple();}disableRenderGroup(){if(!this.renderGroup)return;let e=this.parentRenderGroup;e?.removeChild(this),Ve.return(this.renderGroup),this.renderGroup=null,this.groupTransform=this.relativeGroupTransform,e?.addChild(this),this._updateIsSimple();}_updateIsSimple(){this.isSimple=!this.renderGroup&&this.effects.length===0;}get worldTransform(){return this._worldTransform||(this._worldTransform=new G),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(e){this._position.x=e;}get y(){return this._position.y}set y(e){this._position.y=e;}get position(){return this._position}set position(e){this._position.copyFrom(e);}get rotation(){return this._rotation}set rotation(e){this._rotation!==e&&(this._rotation=e,this._onUpdate(this._skew));}get angle(){return this.rotation*Vf}set angle(e){this.rotation=e*zf;}get pivot(){return this._pivot===Sy&&(this._pivot=new Ne(this,0,0)),this._pivot}set pivot(e){this._pivot===Sy&&(this._pivot=new Ne(this,0,0)),typeof e=="number"?this._pivot.set(e):this._pivot.copyFrom(e);}get skew(){return this._skew===Ty&&(this._skew=new Ne(this,0,0)),this._skew}set skew(e){this._skew===Ty&&(this._skew=new Ne(this,0,0)),this._skew.copyFrom(e);}get scale(){return this._scale===Ey&&(this._scale=new Ne(this,1,1)),this._scale}set scale(e){this._scale===Ey&&(this._scale=new Ne(this,0,0)),typeof e=="number"?this._scale.set(e):this._scale.copyFrom(e);}get width(){return Math.abs(this.scale.x*this.getLocalBounds().width)}set width(e){let t=this.getLocalBounds().width;this._setWidth(e,t);}get height(){return Math.abs(this.scale.y*this.getLocalBounds().height)}set height(e){let t=this.getLocalBounds().height;this._setHeight(e,t);}getSize(e){e||(e={});let t=this.getLocalBounds();return e.width=Math.abs(this.scale.x*t.width),e.height=Math.abs(this.scale.y*t.height),e}setSize(e,t){let i=this.getLocalBounds();typeof e=="object"?(t=e.height??e.width,e=e.width):t??(t=e),e!==void 0&&this._setWidth(e,i.width),t!==void 0&&this._setHeight(t,i.height);}_updateSkew(){let e=this._rotation,t=this._skew;this._cx=Math.cos(e+t._y),this._sx=Math.sin(e+t._y),this._cy=-Math.sin(e-t._x),this._sy=Math.cos(e-t._x);}updateTransform(e){return this.position.set(typeof e.x=="number"?e.x:this.position.x,typeof e.y=="number"?e.y:this.position.y),this.scale.set(typeof e.scaleX=="number"?e.scaleX||1:this.scale.x,typeof e.scaleY=="number"?e.scaleY||1:this.scale.y),this.rotation=typeof e.rotation=="number"?e.rotation:this.rotation,this.skew.set(typeof e.skewX=="number"?e.skewX:this.skew.x,typeof e.skewY=="number"?e.skewY:this.skew.y),this.pivot.set(typeof e.pivotX=="number"?e.pivotX:this.pivot.x,typeof e.pivotY=="number"?e.pivotY:this.pivot.y),this}setFromMatrix(e){e.decompose(this);}updateLocalTransform(){let e=this._didContainerChangeTick;if(this._didLocalTransformChangeId===e)return;this._didLocalTransformChangeId=e;let t=this.localTransform,i=this._scale,s=this._pivot,n=this._position,o=i._x,a=i._y,u=s._x,l=s._y;t.a=this._cx*o,t.b=this._sx*o,t.c=this._cy*a,t.d=this._sy*a,t.tx=n._x-(u*t.a+l*t.c),t.ty=n._y-(u*t.b+l*t.d);}set alpha(e){e!==this.localAlpha&&(this.localAlpha=e,this._updateFlags|=ro,this._onUpdate());}get alpha(){return this.localAlpha}set tint(e){let i=te.shared.setValue(e??16777215).toBgrNumber();i!==this.localColor&&(this.localColor=i,this._updateFlags|=ro,this._onUpdate());}get tint(){return es(this.localColor)}set blendMode(e){this.localBlendMode!==e&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=true),this._updateFlags|=cu,this.localBlendMode=e,this._onUpdate());}get blendMode(){return this.localBlendMode}get visible(){return !!(this.localDisplayStatus&2)}set visible(e){let t=e?2:0;(this.localDisplayStatus&2)!==t&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=true),this._updateFlags|=Os,this.localDisplayStatus^=2,this._onUpdate());}get culled(){return !(this.localDisplayStatus&4)}set culled(e){let t=e?0:4;(this.localDisplayStatus&4)!==t&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=true),this._updateFlags|=Os,this.localDisplayStatus^=4,this._onUpdate());}get renderable(){return !!(this.localDisplayStatus&1)}set renderable(e){let t=e?1:0;(this.localDisplayStatus&1)!==t&&(this._updateFlags|=Os,this.localDisplayStatus^=1,this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=true),this._onUpdate());}get isRenderable(){return this.localDisplayStatus===7&&this.groupAlpha>0}destroy(e=false){if(this.destroyed)return;this.destroyed=true;let t;if(this.children.length&&(t=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._skew=null,this.emit("destroyed",this),this.removeAllListeners(),(typeof e=="boolean"?e:e?.children)&&t)for(let s=0;s<t.length;++s)t[s].destroy(e);this.renderGroup?.destroy(),this.renderGroup=null;}};V.mixin(ue,qf,ep,up,op,np,Zf,Qf,ap,Nf,jf,ip,Kf);});var Ci,Nc=f(()=>{cr();Ci=class r{constructor(e){this.bubbles=true,this.cancelBubble=true,this.cancelable=false,this.composed=false,this.defaultPrevented=false,this.eventPhase=r.prototype.NONE,this.propagationStopped=false,this.propagationImmediatelyStopped=false,this.layer=new me,this.page=new me,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e;}get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get data(){return this}composedPath(){return this.manager&&(!this.path||this.path[this.path.length-1]!==this.target)&&(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}initEvent(e,t,i){throw new Error("initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}initUIEvent(e,t,i,s,n){throw new Error("initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=true;}stopImmediatePropagation(){this.propagationImmediatelyStopped=true;}stopPropagation(){this.propagationStopped=true;}};});function XI(r){return function(e){return e.test(r)}}function Hc(r){var e={userAgent:"",platform:"",maxTouchPoints:0};!r&&typeof navigator<"u"?e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof r=="string"?e.userAgent=r:r&&r.userAgent&&(e={userAgent:r.userAgent,platform:r.platform,maxTouchPoints:r.maxTouchPoints||0});var t=e.userAgent,i=t.split("[FBAN");typeof i[1]<"u"&&(t=i[0]),i=t.split("Twitter"),typeof i[1]<"u"&&(t=i[0]);var s=XI(t),n={apple:{phone:s(Cy)&&!s(is),ipod:s(pA),tablet:!s(Cy)&&(s(mA)||EA(e))&&!s(is),universal:s(gA),device:(s(Cy)||s(pA)||s(mA)||s(gA)||EA(e))&&!s(is)},amazon:{phone:s(hu),tablet:!s(hu)&&s(mp),device:s(hu)||s(mp)},android:{phone:!s(is)&&s(hu)||!s(is)&&s(Ay),tablet:!s(is)&&!s(hu)&&!s(Ay)&&(s(mp)||s(xA)),device:!s(is)&&(s(hu)||s(mp)||s(Ay)||s(xA))||s(/\bokhttp\b/i)},windows:{phone:s(is),tablet:s(_A),device:s(is)||s(_A)},other:{blackberry:s(bA),blackberry10:s(yA),opera:s(vA),firefox:s(SA),chrome:s(TA),device:s(bA)||s(yA)||s(vA)||s(SA)||s(TA)},any:false,phone:false,tablet:false};return n.any=n.apple.device||n.android.device||n.windows.device||n.other.device,n.phone=n.apple.phone||n.android.phone||n.windows.phone,n.tablet=n.apple.tablet||n.android.tablet||n.windows.tablet,n}var Cy,pA,mA,gA,Ay,xA,hu,mp,is,_A,bA,yA,vA,TA,SA,EA,Py=f(()=>{Cy=/iPhone/i,pA=/iPod/i,mA=/iPad/i,gA=/\biOS-universal(?:.+)Mac\b/i,Ay=/\bAndroid(?:.+)Mobile\b/i,xA=/Android/i,hu=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,mp=/Silk/i,is=/Windows Phone/i,_A=/\bWindows(?:.+)ARM\b/i,bA=/BlackBerry/i,yA=/BB10/i,vA=/Opera Mini/i,TA=/\b(CriOS|Chrome)(?:.+)Mobile/i,SA=/Mobile(?:.+)Firefox\b/i,EA=function(r){return typeof r<"u"&&r.platform==="MacIntel"&&typeof r.maxTouchPoints=="number"&&r.maxTouchPoints>1&&typeof MSStream>"u"};});var CA=f(()=>{Py();Py();});var YI,gp,wy=f(()=>{CA();YI=Hc.default??Hc,gp=YI(globalThis.navigator);});var jI,xp,$I,qI,AA,PA,KI,ZI,QI,By,_p,Ry=f(()=>{Nc();B();wy();$f();jI=9,xp=100,$I=0,qI=0,AA=2,PA=1,KI=-1e3,ZI=-1e3,QI=2,By=class wA{constructor(e,t=gp){this._mobileInfo=t,this.debug=false,this._activateOnTab=true,this._deactivateOnMouseMove=true,this._isActive=false,this._isMobileAccessibility=false,this._div=null,this._pool=[],this._renderId=0,this._children=[],this._androidUpdateCount=0,this._androidUpdateFrequency=500,this._hookDiv=null,(t.tablet||t.phone)&&this._createTouchHook(),this._renderer=e;}get isActive(){return this._isActive}get isMobileAccessibility(){return this._isMobileAccessibility}get hookDiv(){return this._hookDiv}_createTouchHook(){let e=document.createElement("button");e.style.width=`${PA}px`,e.style.height=`${PA}px`,e.style.position="absolute",e.style.top=`${KI}px`,e.style.left=`${ZI}px`,e.style.zIndex=QI.toString(),e.style.backgroundColor="#FF0000",e.title="select to enable accessibility for this content",e.addEventListener("focus",()=>{this._isMobileAccessibility=true,this._activate(),this._destroyTouchHook();}),document.body.appendChild(e),this._hookDiv=e;}_destroyTouchHook(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null);}_activate(){if(this._isActive)return;this._isActive=true,this._div||(this._div=document.createElement("div"),this._div.style.width=`${xp}px`,this._div.style.height=`${xp}px`,this._div.style.position="absolute",this._div.style.top=`${$I}px`,this._div.style.left=`${qI}px`,this._div.style.zIndex=AA.toString(),this._div.style.pointerEvents="none"),this._activateOnTab&&(this._onKeyDown=this._onKeyDown.bind(this),globalThis.addEventListener("keydown",this._onKeyDown,false)),this._deactivateOnMouseMove&&(this._onMouseMove=this._onMouseMove.bind(this),globalThis.document.addEventListener("mousemove",this._onMouseMove,true));let e=this._renderer.view.canvas;if(e.parentNode)e.parentNode.appendChild(this._div),this._initAccessibilitySetup();else {let t=new MutationObserver(()=>{e.parentNode&&(e.parentNode.appendChild(this._div),t.disconnect(),this._initAccessibilitySetup());});t.observe(document.body,{childList:true,subtree:true});}}_initAccessibilitySetup(){this._renderer.runners.postrender.add(this),this._renderer.lastObjectRendered&&this._updateAccessibleObjects(this._renderer.lastObjectRendered);}_deactivate(){if(!(!this._isActive||this._isMobileAccessibility)){this._isActive=false,globalThis.document.removeEventListener("mousemove",this._onMouseMove,true),this._activateOnTab&&globalThis.addEventListener("keydown",this._onKeyDown,false),this._renderer.runners.postrender.remove(this);for(let e of this._children)e._accessibleDiv&&e._accessibleDiv.parentNode&&(e._accessibleDiv.parentNode.removeChild(e._accessibleDiv),e._accessibleDiv=null),e._accessibleActive=false;this._pool.forEach(e=>{e.parentNode&&e.parentNode.removeChild(e);}),this._div&&this._div.parentNode&&this._div.parentNode.removeChild(this._div),this._pool=[],this._children=[];}}_updateAccessibleObjects(e){if(!e.visible||!e.accessibleChildren)return;e.accessible&&(e._accessibleActive||this._addChild(e),e._renderId=this._renderId);let t=e.children;if(t)for(let i=0;i<t.length;i++)this._updateAccessibleObjects(t[i]);}init(e){let i={accessibilityOptions:{...wA.defaultOptions,...e?.accessibilityOptions||{}}};this.debug=i.accessibilityOptions.debug,this._activateOnTab=i.accessibilityOptions.activateOnTab,this._deactivateOnMouseMove=i.accessibilityOptions.deactivateOnMouseMove,i.accessibilityOptions.enabledByDefault?this._activate():this._activateOnTab&&(this._onKeyDown=this._onKeyDown.bind(this),globalThis.addEventListener("keydown",this._onKeyDown,false)),this._renderer.runners.postrender.remove(this);}postrender(){let e=performance.now();if(this._mobileInfo.android.device&&e<this._androidUpdateCount||(this._androidUpdateCount=e+this._androidUpdateFrequency,!this._renderer.renderingToScreen||!this._renderer.view.canvas))return;let t=new Set;if(this._renderer.lastObjectRendered){this._updateAccessibleObjects(this._renderer.lastObjectRendered);for(let i of this._children)i._renderId===this._renderId&&t.add(this._children.indexOf(i));}for(let i=this._children.length-1;i>=0;i--){let s=this._children[i];t.has(i)||(s._accessibleDiv&&s._accessibleDiv.parentNode&&(s._accessibleDiv.parentNode.removeChild(s._accessibleDiv),this._pool.push(s._accessibleDiv),s._accessibleDiv=null),s._accessibleActive=false,su(this._children,i,1));}if(this._renderer.renderingToScreen){let{x:i,y:s,width:n,height:o}=this._renderer.screen,a=this._div;a.style.left=`${i}px`,a.style.top=`${s}px`,a.style.width=`${n}px`,a.style.height=`${o}px`;}for(let i=0;i<this._children.length;i++){let s=this._children[i];if(!s._accessibleActive||!s._accessibleDiv)continue;let n=s._accessibleDiv,o=s.hitArea||s.getBounds().rectangle;if(s.hitArea){let a=s.worldTransform,u=this._renderer.resolution,l=this._renderer.resolution;n.style.left=`${(a.tx+o.x*a.a)*u}px`,n.style.top=`${(a.ty+o.y*a.d)*l}px`,n.style.width=`${o.width*a.a*u}px`,n.style.height=`${o.height*a.d*l}px`;}else {this._capHitArea(o);let a=this._renderer.resolution,u=this._renderer.resolution;n.style.left=`${o.x*a}px`,n.style.top=`${o.y*u}px`,n.style.width=`${o.width*a}px`,n.style.height=`${o.height*u}px`;}}this._renderId++;}_updateDebugHTML(e){e.innerHTML=`type: ${e.type}</br> title : ${e.title}</br> tabIndex: ${e.tabIndex}`;}_capHitArea(e){e.x<0&&(e.width+=e.x,e.x=0),e.y<0&&(e.height+=e.y,e.y=0);let{width:t,height:i}=this._renderer;e.x+e.width>t&&(e.width=t-e.x),e.y+e.height>i&&(e.height=i-e.y);}_addChild(e){let t=this._pool.pop();t||(e.accessibleType==="button"?t=document.createElement("button"):(t=document.createElement(e.accessibleType),t.style.cssText=`
7
7
  color: transparent;
8
8
  pointer-events: none;
9
9
  padding: 0;
@@ -16,9 +16,9 @@ Deprecated since v${r}`),console.warn(i))),eA[e]=true;}var eA,Y,Xf,Pe=f(()=>{eA=
16
16
  -webkit-user-select: none;
17
17
  -moz-user-select: none;
18
18
  -ms-user-select: none;
19
- `,e.accessibleText&&(t.innerText=e.accessibleText)),t.style.width=`${xp}px`,t.style.height=`${xp}px`,t.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",t.style.position="absolute",t.style.zIndex=AA.toString(),t.style.borderStyle="none",navigator.userAgent.toLowerCase().includes("chrome")?t.setAttribute("aria-live","off"):t.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?t.setAttribute("aria-relevant","additions"):t.setAttribute("aria-relevant","text"),t.addEventListener("click",this._onClick.bind(this)),t.addEventListener("focus",this._onFocus.bind(this)),t.addEventListener("focusout",this._onFocusOut.bind(this))),t.style.pointerEvents=e.accessiblePointerEvents,t.type=e.accessibleType,e.accessibleTitle&&e.accessibleTitle!==null?t.title=e.accessibleTitle:(!e.accessibleHint||e.accessibleHint===null)&&(t.title=`container ${e.tabIndex}`),e.accessibleHint&&e.accessibleHint!==null&&t.setAttribute("aria-label",e.accessibleHint),this.debug&&this._updateDebugHTML(t),e._accessibleActive=true,e._accessibleDiv=t,t.container=e,this._children.push(e),this._div.appendChild(e._accessibleDiv),e.interactive&&(e._accessibleDiv.tabIndex=e.tabIndex);}_dispatchEvent(e,t){let{container:i}=e.target,s=this._renderer.events.rootBoundary,n=Object.assign(new Ci(s),{target:i});s.rootTarget=this._renderer.lastObjectRendered,t.forEach(o=>s.dispatchEvent(n,o));}_onClick(e){this._dispatchEvent(e,["click","pointertap","tap"]);}_onFocus(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","assertive"),this._dispatchEvent(e,["mouseover"]);}_onFocusOut(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","polite"),this._dispatchEvent(e,["mouseout"]);}_onKeyDown(e){e.keyCode!==jI||!this._activateOnTab||this._activate();}_onMouseMove(e){e.movementX===0&&e.movementY===0||this._deactivate();}destroy(){this._deactivate(),this._destroyTouchHook(),this._div=null,this._pool=null,this._children=null,this._renderer=null,this._activateOnTab&&globalThis.removeEventListener("keydown",this._onKeyDown);}setAccessibilityEnabled(e){e?this._activate():this._deactivate();}};By.extension={type:[x.WebGLSystem,x.WebGPUSystem],name:"accessibility"};By.defaultOptions={enabledByDefault:false,debug:false,activateOnTab:true,deactivateOnMouseMove:true};_p=By;});var bp,My=f(()=>{bp={accessible:false,accessibleTitle:null,accessibleHint:null,tabIndex:0,accessibleType:"button",accessibleText:null,accessiblePointerEvents:"auto",accessibleChildren:true,_accessibleActive:false,_accessibleDiv:null,_renderId:-1};});var BA=f(()=>{B();hr();Ry();My();V.add(_p);V.mixin(exports.PixiJSContainer,bp);});var io,Iy=f(()=>{B();io=class{static init(e){Object.defineProperty(this,"resizeTo",{set(t){globalThis.removeEventListener("resize",this.queueResize),this._resizeTo=t,t&&(globalThis.addEventListener("resize",this.queueResize),this.resize());},get(){return this._resizeTo}}),this.queueResize=()=>{this._resizeTo&&(this._cancelResize(),this._resizeId=requestAnimationFrame(()=>this.resize()));},this._cancelResize=()=>{this._resizeId&&(cancelAnimationFrame(this._resizeId),this._resizeId=null);},this.resize=()=>{if(!this._resizeTo)return;this._cancelResize();let t,i;if(this._resizeTo===globalThis.window)t=globalThis.innerWidth,i=globalThis.innerHeight;else {let{clientWidth:s,clientHeight:n}=this._resizeTo;t=s,i=n;}this.renderer.resize(t,i),this.render();},this._resizeId=null,this._resizeTo=null,this.resizeTo=e.resizeTo||null;}static destroy(){globalThis.removeEventListener("resize",this.queueResize),this._cancelResize(),this._cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null;}};io.extension=x.Application;});exports.UPDATE_PRIORITY=void 0;var so=f(()=>{exports.UPDATE_PRIORITY=(r=>(r[r.INTERACTION=50]="INTERACTION",r[r.HIGH=25]="HIGH",r[r.NORMAL=0]="NORMAL",r[r.LOW=-25]="LOW",r[r.UTILITY=-50]="UTILITY",r))(exports.UPDATE_PRIORITY||{});});var Fs,Dy=f(()=>{Fs=class{constructor(e,t=null,i=0,s=false){this.next=null,this.previous=null,this._destroyed=false,this._fn=e,this._context=t,this.priority=i,this._once=s;}match(e,t=null){return this._fn===e&&this._context===t}emit(e){this._fn&&(this._context?this._fn.call(this._context,e):this._fn(e));let t=this.next;return this._once&&this.destroy(true),this._destroyed&&(this.next=null),t}connect(e){this.previous=e,e.next&&(e.next.previous=this),this.next=e.next,e.next=this;}destroy(e=false){this._destroyed=true,this._fn=null,this._context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);let t=this.next;return this.next=e?null:t,this.previous=null,t}};});var RA,Ie,Gs=f(()=>{so();Dy();RA=class Sr{constructor(){this.autoStart=false,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=false,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=false,this._lastFrame=-1,this._head=new Fs(null,null,1/0),this.deltaMS=1/Sr.targetFPMS,this.elapsedMS=1/Sr.targetFPMS,this._tick=e=>{this._requestId=null,this.started&&(this.update(e),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(e,t,i=exports.UPDATE_PRIORITY.NORMAL){return this._addListener(new Fs(e,t,i))}addOnce(e,t,i=exports.UPDATE_PRIORITY.NORMAL){return this._addListener(new Fs(e,t,i,true))}_addListener(e){let t=this._head.next,i=this._head;if(!t)e.connect(i);else {for(;t;){if(e.priority>t.priority){e.connect(i);break}i=t,t=t.next;}e.previous||e.connect(i);}return this._startIfPossible(),this}remove(e,t){let i=this._head.next;for(;i;)i.match(e,t)?i=i.destroy():i=i.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let e=0,t=this._head;for(;t=t.next;)e++;return e}start(){this.started||(this.started=true,this._requestIfNeeded());}stop(){this.started&&(this.started=false,this._cancelIfNeeded());}destroy(){if(!this._protected){this.stop();let e=this._head.next;for(;e;)e=e.destroy(true);this._head.destroy(),this._head=null;}}update(e=performance.now()){let t;if(e>this.lastTime){if(t=this.elapsedMS=e-this.lastTime,t>this._maxElapsedMS&&(t=this._maxElapsedMS),t*=this.speed,this._minElapsedMS){let n=e-this._lastFrame|0;if(n<this._minElapsedMS)return;this._lastFrame=e-n%this._minElapsedMS;}this.deltaMS=t,this.deltaTime=this.deltaMS*Sr.targetFPMS;let i=this._head,s=i.next;for(;s;)s=s.emit(this);i.next||this._cancelIfNeeded();}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=e;}get FPS(){return 1e3/this.elapsedMS}get minFPS(){return 1e3/this._maxElapsedMS}set minFPS(e){let t=Math.min(this.maxFPS,e),i=Math.min(Math.max(0,t)/1e3,Sr.targetFPMS);this._maxElapsedMS=1/i;}get maxFPS(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0}set maxFPS(e){if(e===0)this._minElapsedMS=0;else {let t=Math.max(this.minFPS,e);this._minElapsedMS=1/(t/1e3);}}static get shared(){if(!Sr._shared){let e=Sr._shared=new Sr;e.autoStart=true,e._protected=true;}return Sr._shared}static get system(){if(!Sr._system){let e=Sr._system=new Sr;e.autoStart=true,e._protected=true;}return Sr._system}};RA.targetFPMS=.06;Ie=RA;});var no,ky=f(()=>{B();so();Gs();no=class{static init(e){e=Object.assign({autoStart:true,sharedTicker:false},e),Object.defineProperty(this,"ticker",{set(t){this._ticker&&this._ticker.remove(this.render,this),this._ticker=t,t&&t.add(this.render,this,exports.UPDATE_PRIORITY.LOW);},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop();},this.start=()=>{this._ticker.start();},this._ticker=null,this.ticker=e.sharedTicker?Ie.shared:new Ie,e.autoStart&&this.start();}static destroy(){if(this._ticker){let e=this._ticker;this.ticker=null,e.destroy();}}};no.extension=x.Application;});var Oy=f(()=>{B();Iy();ky();V.add(io);V.add(no);});function N(...r){Fy!==MA&&(Fy++,Fy===MA?console.warn("PixiJS Warning: too many warnings, no more warnings will be reported to the console by PixiJS."):console.warn("PixiJS Warning: ",...r));}var Fy,MA,Be=f(()=>{Fy=0,MA=500;});var Gy,Gr,yp=f(()=>{so();Gs();Gy=class{constructor(){this.interactionFrequency=10,this._deltaTime=0,this._didMove=false,this._tickerAdded=false,this._pauseUpdate=true;}init(e){this.removeTickerListener(),this.events=e,this.interactionFrequency=10,this._deltaTime=0,this._didMove=false,this._tickerAdded=false,this._pauseUpdate=true;}get pauseUpdate(){return this._pauseUpdate}set pauseUpdate(e){this._pauseUpdate=e;}addTickerListener(){this._tickerAdded||!this.domElement||(Ie.system.add(this._tickerUpdate,this,exports.UPDATE_PRIORITY.INTERACTION),this._tickerAdded=true);}removeTickerListener(){this._tickerAdded&&(Ie.system.remove(this._tickerUpdate,this),this._tickerAdded=false);}pointerMoved(){this._didMove=true;}_update(){if(!this.domElement||this._pauseUpdate)return;if(this._didMove){this._didMove=false;return}let e=this.events._rootPointerEvent;this.events.supportsTouchEvents&&e.pointerType==="touch"||globalThis.document.dispatchEvent(this.events.supportsPointerEvents?new PointerEvent("pointermove",{clientX:e.clientX,clientY:e.clientY,pointerType:e.pointerType,pointerId:e.pointerId}):new MouseEvent("mousemove",{clientX:e.clientX,clientY:e.clientY}));}_tickerUpdate(e){this._deltaTime+=e.deltaTime,!(this._deltaTime<this.interactionFrequency)&&(this._deltaTime=0,this._update());}},Gr=new Gy;});var ii,Vc=f(()=>{cr();Nc();ii=class extends Ci{constructor(){super(...arguments),this.client=new me,this.movement=new me,this.offset=new me,this.global=new me,this.screen=new me;}get clientX(){return this.client.x}get clientY(){return this.client.y}get x(){return this.clientX}get y(){return this.clientY}get movementX(){return this.movement.x}get movementY(){return this.movement.y}get offsetX(){return this.offset.x}get offsetY(){return this.offset.y}get globalX(){return this.global.x}get globalY(){return this.global.y}get screenX(){return this.screen.x}get screenY(){return this.screen.y}getLocalPosition(e,t,i){return e.worldTransform.applyInverse(i||this.global,t)}getModifierState(e){return "getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(e)}initMouseEvent(e,t,i,s,n,o,a,u,l,c,h,d,p,m,b){throw new Error("Method not implemented.")}};});var Nt,vp=f(()=>{Vc();Nt=class extends ii{constructor(){super(...arguments),this.width=0,this.height=0,this.isPrimary=false;}getCoalescedEvents(){return this.type==="pointermove"||this.type==="mousemove"||this.type==="touchmove"?[this]:[]}getPredictedEvents(){throw new Error("getPredictedEvents is not supported!")}};});var Ur,Tp=f(()=>{Vc();Ur=class extends ii{constructor(){super(...arguments),this.DOM_DELTA_PIXEL=0,this.DOM_DELTA_LINE=1,this.DOM_DELTA_PAGE=2;}};Ur.DOM_DELTA_PIXEL=0;Ur.DOM_DELTA_LINE=1;Ur.DOM_DELTA_PAGE=2;});var JI,eD,zc,du,Uy=f(()=>{Ut();cr();Be();yp();Vc();vp();Tp();JI=2048,eD=new me,zc=new me,du=class{constructor(e){this.dispatch=new _e,this.moveOnAll=false,this.enableGlobalMoveEvents=true,this.mappingState={trackingData:{}},this.eventPool=new Map,this._allInteractiveElements=[],this._hitElements=[],this._isPointerMoveEvent=false,this.rootTarget=e,this.hitPruneFn=this.hitPruneFn.bind(this),this.hitTestFn=this.hitTestFn.bind(this),this.mapPointerDown=this.mapPointerDown.bind(this),this.mapPointerMove=this.mapPointerMove.bind(this),this.mapPointerOut=this.mapPointerOut.bind(this),this.mapPointerOver=this.mapPointerOver.bind(this),this.mapPointerUp=this.mapPointerUp.bind(this),this.mapPointerUpOutside=this.mapPointerUpOutside.bind(this),this.mapWheel=this.mapWheel.bind(this),this.mappingTable={},this.addEventMapping("pointerdown",this.mapPointerDown),this.addEventMapping("pointermove",this.mapPointerMove),this.addEventMapping("pointerout",this.mapPointerOut),this.addEventMapping("pointerleave",this.mapPointerOut),this.addEventMapping("pointerover",this.mapPointerOver),this.addEventMapping("pointerup",this.mapPointerUp),this.addEventMapping("pointerupoutside",this.mapPointerUpOutside),this.addEventMapping("wheel",this.mapWheel);}addEventMapping(e,t){this.mappingTable[e]||(this.mappingTable[e]=[]),this.mappingTable[e].push({fn:t,priority:0}),this.mappingTable[e].sort((i,s)=>i.priority-s.priority);}dispatchEvent(e,t){e.propagationStopped=false,e.propagationImmediatelyStopped=false,this.propagate(e,t),this.dispatch.emit(t||e.type,e);}mapEvent(e){if(!this.rootTarget)return;let t=this.mappingTable[e.type];if(t)for(let i=0,s=t.length;i<s;i++)t[i].fn(e);else N(`[EventBoundary]: Event mapping not defined for ${e.type}`);}hitTest(e,t){Gr.pauseUpdate=true;let s=this._isPointerMoveEvent&&this.enableGlobalMoveEvents?"hitTestMoveRecursive":"hitTestRecursive",n=this[s](this.rootTarget,this.rootTarget.eventMode,eD.set(e,t),this.hitTestFn,this.hitPruneFn);return n&&n[0]}propagate(e,t){if(!e.target)return;let i=e.composedPath();e.eventPhase=e.CAPTURING_PHASE;for(let s=0,n=i.length-1;s<n;s++)if(e.currentTarget=i[s],this.notifyTarget(e,t),e.propagationStopped||e.propagationImmediatelyStopped)return;if(e.eventPhase=e.AT_TARGET,e.currentTarget=e.target,this.notifyTarget(e,t),!(e.propagationStopped||e.propagationImmediatelyStopped)){e.eventPhase=e.BUBBLING_PHASE;for(let s=i.length-2;s>=0;s--)if(e.currentTarget=i[s],this.notifyTarget(e,t),e.propagationStopped||e.propagationImmediatelyStopped)return}}all(e,t,i=this._allInteractiveElements){if(i.length===0)return;e.eventPhase=e.BUBBLING_PHASE;let s=Array.isArray(t)?t:[t];for(let n=i.length-1;n>=0;n--)s.forEach(o=>{e.currentTarget=i[n],this.notifyTarget(e,o);});}propagationPath(e){let t=[e];for(let i=0;i<JI&&e!==this.rootTarget&&e.parent;i++){if(!e.parent)throw new Error("Cannot find propagation path to disconnected target");t.push(e.parent),e=e.parent;}return t.reverse(),t}hitTestMoveRecursive(e,t,i,s,n,o=false){let a=false;if(this._interactivePrune(e))return null;if((e.eventMode==="dynamic"||t==="dynamic")&&(Gr.pauseUpdate=false),e.interactiveChildren&&e.children){let c=e.children;for(let h=c.length-1;h>=0;h--){let d=c[h],p=this.hitTestMoveRecursive(d,this._isInteractive(t)?t:d.eventMode,i,s,n,o||n(e,i));if(p){if(p.length>0&&!p[p.length-1].parent)continue;let m=e.isInteractive();(p.length>0||m)&&(m&&this._allInteractiveElements.push(e),p.push(e)),this._hitElements.length===0&&(this._hitElements=p),a=true;}}}let u=this._isInteractive(t),l=e.isInteractive();return l&&l&&this._allInteractiveElements.push(e),o||this._hitElements.length>0?null:a?this._hitElements:u&&!n(e,i)&&s(e,i)?l?[e]:[]:null}hitTestRecursive(e,t,i,s,n){if(this._interactivePrune(e)||n(e,i))return null;if((e.eventMode==="dynamic"||t==="dynamic")&&(Gr.pauseUpdate=false),e.interactiveChildren&&e.children){let u=e.children,l=i;for(let c=u.length-1;c>=0;c--){let h=u[c],d=this.hitTestRecursive(h,this._isInteractive(t)?t:h.eventMode,l,s,n);if(d){if(d.length>0&&!d[d.length-1].parent)continue;let p=e.isInteractive();return (d.length>0||p)&&d.push(e),d}}}let o=this._isInteractive(t),a=e.isInteractive();return o&&s(e,i)?a?[e]:[]:null}_isInteractive(e){return e==="static"||e==="dynamic"}_interactivePrune(e){return !e||!e.visible||!e.renderable||!e.measurable||e.eventMode==="none"||e.eventMode==="passive"&&!e.interactiveChildren}hitPruneFn(e,t){if(e.hitArea&&(e.worldTransform.applyInverse(t,zc),!e.hitArea.contains(zc.x,zc.y)))return true;if(e.effects&&e.effects.length)for(let i=0;i<e.effects.length;i++){let s=e.effects[i];if(s.containsPoint&&!s.containsPoint(t,this.hitTestFn))return true}return false}hitTestFn(e,t){return e.hitArea?true:e?.containsPoint?(e.worldTransform.applyInverse(t,zc),e.containsPoint(zc)):false}notifyTarget(e,t){if(!e.currentTarget.isInteractive())return;t??(t=e.type);let i=`on${t}`;e.currentTarget[i]?.(e);let s=e.eventPhase===e.CAPTURING_PHASE||e.eventPhase===e.AT_TARGET?`${t}capture`:t;this._notifyListeners(e,s),e.eventPhase===e.AT_TARGET&&this._notifyListeners(e,t);}mapPointerDown(e){if(!(e instanceof Nt)){N("EventBoundary cannot map a non-pointer event as a pointer event");return}let t=this.createPointerEvent(e);if(this.dispatchEvent(t,"pointerdown"),t.pointerType==="touch")this.dispatchEvent(t,"touchstart");else if(t.pointerType==="mouse"||t.pointerType==="pen"){let s=t.button===2;this.dispatchEvent(t,s?"rightdown":"mousedown");}let i=this.trackingData(e.pointerId);i.pressTargetsByButton[e.button]=t.composedPath(),this.freeEvent(t);}mapPointerMove(e){if(!(e instanceof Nt)){N("EventBoundary cannot map a non-pointer event as a pointer event");return}this._allInteractiveElements.length=0,this._hitElements.length=0,this._isPointerMoveEvent=true;let t=this.createPointerEvent(e);this._isPointerMoveEvent=false;let i=t.pointerType==="mouse"||t.pointerType==="pen",s=this.trackingData(e.pointerId),n=this.findMountedTarget(s.overTargets);if(s.overTargets?.length>0&&n!==t.target){let u=e.type==="mousemove"?"mouseout":"pointerout",l=this.createPointerEvent(e,u,n);if(this.dispatchEvent(l,"pointerout"),i&&this.dispatchEvent(l,"mouseout"),!t.composedPath().includes(n)){let c=this.createPointerEvent(e,"pointerleave",n);for(c.eventPhase=c.AT_TARGET;c.target&&!t.composedPath().includes(c.target);)c.currentTarget=c.target,this.notifyTarget(c),i&&this.notifyTarget(c,"mouseleave"),c.target=c.target.parent;this.freeEvent(c);}this.freeEvent(l);}if(n!==t.target){let u=e.type==="mousemove"?"mouseover":"pointerover",l=this.clonePointerEvent(t,u);this.dispatchEvent(l,"pointerover"),i&&this.dispatchEvent(l,"mouseover");let c=n?.parent;for(;c&&c!==this.rootTarget.parent&&c!==t.target;)c=c.parent;if(!c||c===this.rootTarget.parent){let d=this.clonePointerEvent(t,"pointerenter");for(d.eventPhase=d.AT_TARGET;d.target&&d.target!==n&&d.target!==this.rootTarget.parent;)d.currentTarget=d.target,this.notifyTarget(d),i&&this.notifyTarget(d,"mouseenter"),d.target=d.target.parent;this.freeEvent(d);}this.freeEvent(l);}let o=[],a=this.enableGlobalMoveEvents??true;this.moveOnAll?o.push("pointermove"):this.dispatchEvent(t,"pointermove"),a&&o.push("globalpointermove"),t.pointerType==="touch"&&(this.moveOnAll?o.splice(1,0,"touchmove"):this.dispatchEvent(t,"touchmove"),a&&o.push("globaltouchmove")),i&&(this.moveOnAll?o.splice(1,0,"mousemove"):this.dispatchEvent(t,"mousemove"),a&&o.push("globalmousemove"),this.cursor=t.target?.cursor),o.length>0&&this.all(t,o),this._allInteractiveElements.length=0,this._hitElements.length=0,s.overTargets=t.composedPath(),this.freeEvent(t);}mapPointerOver(e){if(!(e instanceof Nt)){N("EventBoundary cannot map a non-pointer event as a pointer event");return}let t=this.trackingData(e.pointerId),i=this.createPointerEvent(e),s=i.pointerType==="mouse"||i.pointerType==="pen";this.dispatchEvent(i,"pointerover"),s&&this.dispatchEvent(i,"mouseover"),i.pointerType==="mouse"&&(this.cursor=i.target?.cursor);let n=this.clonePointerEvent(i,"pointerenter");for(n.eventPhase=n.AT_TARGET;n.target&&n.target!==this.rootTarget.parent;)n.currentTarget=n.target,this.notifyTarget(n),s&&this.notifyTarget(n,"mouseenter"),n.target=n.target.parent;t.overTargets=i.composedPath(),this.freeEvent(i),this.freeEvent(n);}mapPointerOut(e){if(!(e instanceof Nt)){N("EventBoundary cannot map a non-pointer event as a pointer event");return}let t=this.trackingData(e.pointerId);if(t.overTargets){let i=e.pointerType==="mouse"||e.pointerType==="pen",s=this.findMountedTarget(t.overTargets),n=this.createPointerEvent(e,"pointerout",s);this.dispatchEvent(n),i&&this.dispatchEvent(n,"mouseout");let o=this.createPointerEvent(e,"pointerleave",s);for(o.eventPhase=o.AT_TARGET;o.target&&o.target!==this.rootTarget.parent;)o.currentTarget=o.target,this.notifyTarget(o),i&&this.notifyTarget(o,"mouseleave"),o.target=o.target.parent;t.overTargets=null,this.freeEvent(n),this.freeEvent(o);}this.cursor=null;}mapPointerUp(e){if(!(e instanceof Nt)){N("EventBoundary cannot map a non-pointer event as a pointer event");return}let t=performance.now(),i=this.createPointerEvent(e);if(this.dispatchEvent(i,"pointerup"),i.pointerType==="touch")this.dispatchEvent(i,"touchend");else if(i.pointerType==="mouse"||i.pointerType==="pen"){let a=i.button===2;this.dispatchEvent(i,a?"rightup":"mouseup");}let s=this.trackingData(e.pointerId),n=this.findMountedTarget(s.pressTargetsByButton[e.button]),o=n;if(n&&!i.composedPath().includes(n)){let a=n;for(;a&&!i.composedPath().includes(a);){if(i.currentTarget=a,this.notifyTarget(i,"pointerupoutside"),i.pointerType==="touch")this.notifyTarget(i,"touchendoutside");else if(i.pointerType==="mouse"||i.pointerType==="pen"){let u=i.button===2;this.notifyTarget(i,u?"rightupoutside":"mouseupoutside");}a=a.parent;}delete s.pressTargetsByButton[e.button],o=a;}if(o){let a=this.clonePointerEvent(i,"click");a.target=o,a.path=null,s.clicksByButton[e.button]||(s.clicksByButton[e.button]={clickCount:0,target:a.target,timeStamp:t});let u=s.clicksByButton[e.button];if(u.target===a.target&&t-u.timeStamp<200?++u.clickCount:u.clickCount=1,u.target=a.target,u.timeStamp=t,a.detail=u.clickCount,a.pointerType==="mouse"){let l=a.button===2;this.dispatchEvent(a,l?"rightclick":"click");}else a.pointerType==="touch"&&this.dispatchEvent(a,"tap");this.dispatchEvent(a,"pointertap"),this.freeEvent(a);}this.freeEvent(i);}mapPointerUpOutside(e){if(!(e instanceof Nt)){N("EventBoundary cannot map a non-pointer event as a pointer event");return}let t=this.trackingData(e.pointerId),i=this.findMountedTarget(t.pressTargetsByButton[e.button]),s=this.createPointerEvent(e);if(i){let n=i;for(;n;)s.currentTarget=n,this.notifyTarget(s,"pointerupoutside"),s.pointerType==="touch"?this.notifyTarget(s,"touchendoutside"):(s.pointerType==="mouse"||s.pointerType==="pen")&&this.notifyTarget(s,s.button===2?"rightupoutside":"mouseupoutside"),n=n.parent;delete t.pressTargetsByButton[e.button];}this.freeEvent(s);}mapWheel(e){if(!(e instanceof Ur)){N("EventBoundary cannot map a non-wheel event as a wheel event");return}let t=this.createWheelEvent(e);this.dispatchEvent(t),this.freeEvent(t);}findMountedTarget(e){if(!e)return null;let t=e[0];for(let i=1;i<e.length&&e[i].parent===t;i++)t=e[i];return t}createPointerEvent(e,t,i){let s=this.allocateEvent(Nt);return this.copyPointerData(e,s),this.copyMouseData(e,s),this.copyData(e,s),s.nativeEvent=e.nativeEvent,s.originalEvent=e,s.target=i??this.hitTest(s.global.x,s.global.y)??this._hitElements[0],typeof t=="string"&&(s.type=t),s}createWheelEvent(e){let t=this.allocateEvent(Ur);return this.copyWheelData(e,t),this.copyMouseData(e,t),this.copyData(e,t),t.nativeEvent=e.nativeEvent,t.originalEvent=e,t.target=this.hitTest(t.global.x,t.global.y),t}clonePointerEvent(e,t){let i=this.allocateEvent(Nt);return i.nativeEvent=e.nativeEvent,i.originalEvent=e.originalEvent,this.copyPointerData(e,i),this.copyMouseData(e,i),this.copyData(e,i),i.target=e.target,i.path=e.composedPath().slice(),i.type=t??i.type,i}copyWheelData(e,t){t.deltaMode=e.deltaMode,t.deltaX=e.deltaX,t.deltaY=e.deltaY,t.deltaZ=e.deltaZ;}copyPointerData(e,t){e instanceof Nt&&t instanceof Nt&&(t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist);}copyMouseData(e,t){e instanceof ii&&t instanceof ii&&(t.altKey=e.altKey,t.button=e.button,t.buttons=e.buttons,t.client.copyFrom(e.client),t.ctrlKey=e.ctrlKey,t.metaKey=e.metaKey,t.movement.copyFrom(e.movement),t.screen.copyFrom(e.screen),t.shiftKey=e.shiftKey,t.global.copyFrom(e.global));}copyData(e,t){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=performance.now(),t.type=e.type,t.detail=e.detail,t.view=e.view,t.which=e.which,t.layer.copyFrom(e.layer),t.page.copyFrom(e.page);}trackingData(e){return this.mappingState.trackingData[e]||(this.mappingState.trackingData[e]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[e]}allocateEvent(e){this.eventPool.has(e)||this.eventPool.set(e,[]);let t=this.eventPool.get(e).pop()||new e(this);return t.eventPhase=t.NONE,t.currentTarget=null,t.defaultPrevented=false,t.path=null,t.target=null,t}freeEvent(e){if(e.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!");let t=e.constructor;this.eventPool.has(t)||this.eventPool.set(t,[]),this.eventPool.get(t).push(e);}_notifyListeners(e,t){let i=e.currentTarget._events[t];if(i)if("fn"in i)i.once&&e.currentTarget.removeListener(t,i.fn,void 0,true),i.fn.call(i.context,e);else for(let s=0,n=i.length;s<n&&!e.propagationImmediatelyStopped;s++)i[s].once&&e.currentTarget.removeListener(t,i[s].fn,void 0,true),i[s].fn.call(i[s].context,e);}};});var tD,rD,Ny,fu,Sp=f(()=>{B();Uy();yp();vp();Tp();tD=1,rD={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},Ny=class Ly{constructor(e){this.supportsTouchEvents="ontouchstart"in globalThis,this.supportsPointerEvents=!!globalThis.PointerEvent,this.domElement=null,this.resolution=1,this.renderer=e,this.rootBoundary=new du(null),Gr.init(this),this.autoPreventDefault=true,this._eventsAdded=false,this._rootPointerEvent=new Nt(null),this._rootWheelEvent=new Ur(null),this.cursorStyles={default:"inherit",pointer:"pointer"},this.features=new Proxy({...Ly.defaultEventFeatures},{set:(t,i,s)=>(i==="globalMove"&&(this.rootBoundary.enableGlobalMoveEvents=s),t[i]=s,true)}),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerMove=this._onPointerMove.bind(this),this._onPointerUp=this._onPointerUp.bind(this),this._onPointerOverOut=this._onPointerOverOut.bind(this),this.onWheel=this.onWheel.bind(this);}static get defaultEventMode(){return this._defaultEventMode}init(e){let{canvas:t,resolution:i}=this.renderer;this.setTargetElement(t),this.resolution=i,Ly._defaultEventMode=e.eventMode??"passive",Object.assign(this.features,e.eventFeatures??{}),this.rootBoundary.enableGlobalMoveEvents=this.features.globalMove;}resolutionChange(e){this.resolution=e;}destroy(){this.setTargetElement(null),this.renderer=null,this._currentCursor=null;}setCursor(e){e||(e="default");let t=true;if(globalThis.OffscreenCanvas&&this.domElement instanceof OffscreenCanvas&&(t=false),this._currentCursor===e)return;this._currentCursor=e;let i=this.cursorStyles[e];if(i)switch(typeof i){case "string":t&&(this.domElement.style.cursor=i);break;case "function":i(e);break;case "object":t&&Object.assign(this.domElement.style,i);break}else t&&typeof e=="string"&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,e)&&(this.domElement.style.cursor=e);}get pointer(){return this._rootPointerEvent}_onPointerDown(e){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;let t=this._normalizeToPointerData(e);this.autoPreventDefault&&t[0].isNormalized&&(e.cancelable||!("cancelable"in e))&&e.preventDefault();for(let i=0,s=t.length;i<s;i++){let n=t[i],o=this._bootstrapEvent(this._rootPointerEvent,n);this.rootBoundary.mapEvent(o);}this.setCursor(this.rootBoundary.cursor);}_onPointerMove(e){if(!this.features.move)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,Gr.pointerMoved();let t=this._normalizeToPointerData(e);for(let i=0,s=t.length;i<s;i++){let n=this._bootstrapEvent(this._rootPointerEvent,t[i]);this.rootBoundary.mapEvent(n);}this.setCursor(this.rootBoundary.cursor);}_onPointerUp(e){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;let t=e.target;e.composedPath&&e.composedPath().length>0&&(t=e.composedPath()[0]);let i=t!==this.domElement?"outside":"",s=this._normalizeToPointerData(e);for(let n=0,o=s.length;n<o;n++){let a=this._bootstrapEvent(this._rootPointerEvent,s[n]);a.type+=i,this.rootBoundary.mapEvent(a);}this.setCursor(this.rootBoundary.cursor);}_onPointerOverOut(e){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;let t=this._normalizeToPointerData(e);for(let i=0,s=t.length;i<s;i++){let n=this._bootstrapEvent(this._rootPointerEvent,t[i]);this.rootBoundary.mapEvent(n);}this.setCursor(this.rootBoundary.cursor);}onWheel(e){if(!this.features.wheel)return;let t=this.normalizeWheelEvent(e);this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,this.rootBoundary.mapEvent(t);}setTargetElement(e){this._removeEvents(),this.domElement=e,Gr.domElement=e,this._addEvents();}_addEvents(){if(this._eventsAdded||!this.domElement)return;Gr.addTickerListener();let e=this.domElement.style;e&&(globalThis.navigator.msPointerEnabled?(e.msContentZooming="none",e.msTouchAction="none"):this.supportsPointerEvents&&(e.touchAction="none")),this.supportsPointerEvents?(globalThis.document.addEventListener("pointermove",this._onPointerMove,true),this.domElement.addEventListener("pointerdown",this._onPointerDown,true),this.domElement.addEventListener("pointerleave",this._onPointerOverOut,true),this.domElement.addEventListener("pointerover",this._onPointerOverOut,true),globalThis.addEventListener("pointerup",this._onPointerUp,true)):(globalThis.document.addEventListener("mousemove",this._onPointerMove,true),this.domElement.addEventListener("mousedown",this._onPointerDown,true),this.domElement.addEventListener("mouseout",this._onPointerOverOut,true),this.domElement.addEventListener("mouseover",this._onPointerOverOut,true),globalThis.addEventListener("mouseup",this._onPointerUp,true),this.supportsTouchEvents&&(this.domElement.addEventListener("touchstart",this._onPointerDown,true),this.domElement.addEventListener("touchend",this._onPointerUp,true),this.domElement.addEventListener("touchmove",this._onPointerMove,true))),this.domElement.addEventListener("wheel",this.onWheel,{passive:true,capture:true}),this._eventsAdded=true;}_removeEvents(){if(!this._eventsAdded||!this.domElement)return;Gr.removeTickerListener();let e=this.domElement.style;e&&(globalThis.navigator.msPointerEnabled?(e.msContentZooming="",e.msTouchAction=""):this.supportsPointerEvents&&(e.touchAction="")),this.supportsPointerEvents?(globalThis.document.removeEventListener("pointermove",this._onPointerMove,true),this.domElement.removeEventListener("pointerdown",this._onPointerDown,true),this.domElement.removeEventListener("pointerleave",this._onPointerOverOut,true),this.domElement.removeEventListener("pointerover",this._onPointerOverOut,true),globalThis.removeEventListener("pointerup",this._onPointerUp,true)):(globalThis.document.removeEventListener("mousemove",this._onPointerMove,true),this.domElement.removeEventListener("mousedown",this._onPointerDown,true),this.domElement.removeEventListener("mouseout",this._onPointerOverOut,true),this.domElement.removeEventListener("mouseover",this._onPointerOverOut,true),globalThis.removeEventListener("mouseup",this._onPointerUp,true),this.supportsTouchEvents&&(this.domElement.removeEventListener("touchstart",this._onPointerDown,true),this.domElement.removeEventListener("touchend",this._onPointerUp,true),this.domElement.removeEventListener("touchmove",this._onPointerMove,true))),this.domElement.removeEventListener("wheel",this.onWheel,true),this.domElement=null,this._eventsAdded=false;}mapPositionToPoint(e,t,i){let s=this.domElement.isConnected?this.domElement.getBoundingClientRect():{width:this.domElement.width,height:this.domElement.height,left:0,top:0},n=1/this.resolution;e.x=(t-s.left)*(this.domElement.width/s.width)*n,e.y=(i-s.top)*(this.domElement.height/s.height)*n;}_normalizeToPointerData(e){let t=[];if(this.supportsTouchEvents&&e instanceof TouchEvent)for(let i=0,s=e.changedTouches.length;i<s;i++){let n=e.changedTouches[i];typeof n.button>"u"&&(n.button=0),typeof n.buttons>"u"&&(n.buttons=1),typeof n.isPrimary>"u"&&(n.isPrimary=e.touches.length===1&&e.type==="touchstart"),typeof n.width>"u"&&(n.width=n.radiusX||1),typeof n.height>"u"&&(n.height=n.radiusY||1),typeof n.tiltX>"u"&&(n.tiltX=0),typeof n.tiltY>"u"&&(n.tiltY=0),typeof n.pointerType>"u"&&(n.pointerType="touch"),typeof n.pointerId>"u"&&(n.pointerId=n.identifier||0),typeof n.pressure>"u"&&(n.pressure=n.force||.5),typeof n.twist>"u"&&(n.twist=0),typeof n.tangentialPressure>"u"&&(n.tangentialPressure=0),typeof n.layerX>"u"&&(n.layerX=n.offsetX=n.clientX),typeof n.layerY>"u"&&(n.layerY=n.offsetY=n.clientY),n.isNormalized=true,n.type=e.type,t.push(n);}else if(!globalThis.MouseEvent||e instanceof MouseEvent&&(!this.supportsPointerEvents||!(e instanceof globalThis.PointerEvent))){let i=e;typeof i.isPrimary>"u"&&(i.isPrimary=true),typeof i.width>"u"&&(i.width=1),typeof i.height>"u"&&(i.height=1),typeof i.tiltX>"u"&&(i.tiltX=0),typeof i.tiltY>"u"&&(i.tiltY=0),typeof i.pointerType>"u"&&(i.pointerType="mouse"),typeof i.pointerId>"u"&&(i.pointerId=tD),typeof i.pressure>"u"&&(i.pressure=.5),typeof i.twist>"u"&&(i.twist=0),typeof i.tangentialPressure>"u"&&(i.tangentialPressure=0),i.isNormalized=true,t.push(i);}else t.push(e);return t}normalizeWheelEvent(e){let t=this._rootWheelEvent;return this._transferMouseData(t,e),t.deltaX=e.deltaX,t.deltaY=e.deltaY,t.deltaZ=e.deltaZ,t.deltaMode=e.deltaMode,this.mapPositionToPoint(t.screen,e.clientX,e.clientY),t.global.copyFrom(t.screen),t.offset.copyFrom(t.screen),t.nativeEvent=e,t.type=e.type,t}_bootstrapEvent(e,t){return e.originalEvent=null,e.nativeEvent=t,e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist,this._transferMouseData(e,t),this.mapPositionToPoint(e.screen,t.clientX,t.clientY),e.global.copyFrom(e.screen),e.offset.copyFrom(e.screen),e.isTrusted=t.isTrusted,e.type==="pointerleave"&&(e.type="pointerout"),e.type.startsWith("mouse")&&(e.type=e.type.replace("mouse","pointer")),e.type.startsWith("touch")&&(e.type=rD[e.type]||e.type),e}_transferMouseData(e,t){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=performance.now(),e.type=t.type,e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.client.x=t.clientX,e.client.y=t.clientY,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.movement.x=t.movementX,e.movement.y=t.movementY,e.page.x=t.pageX,e.page.y=t.pageY,e.relatedTarget=null,e.shiftKey=t.shiftKey;}};Ny.extension={name:"events",type:[x.WebGLSystem,x.CanvasSystem,x.WebGPUSystem],priority:-1};Ny.defaultEventFeatures={move:true,globalMove:true,click:true,wheel:true};fu=Ny;});var Ep,Hy=f(()=>{Sp();Nc();Ep={onclick:null,onmousedown:null,onmouseenter:null,onmouseleave:null,onmousemove:null,onglobalmousemove:null,onmouseout:null,onmouseover:null,onmouseup:null,onmouseupoutside:null,onpointercancel:null,onpointerdown:null,onpointerenter:null,onpointerleave:null,onpointermove:null,onglobalpointermove:null,onpointerout:null,onpointerover:null,onpointertap:null,onpointerup:null,onpointerupoutside:null,onrightclick:null,onrightdown:null,onrightup:null,onrightupoutside:null,ontap:null,ontouchcancel:null,ontouchend:null,ontouchendoutside:null,ontouchmove:null,onglobaltouchmove:null,ontouchstart:null,onwheel:null,get interactive(){return this.eventMode==="dynamic"||this.eventMode==="static"},set interactive(r){this.eventMode=r?"static":"passive";},_internalEventMode:void 0,get eventMode(){return this._internalEventMode??fu.defaultEventMode},set eventMode(r){this._internalEventMode=r;},isInteractive(){return this.eventMode==="static"||this.eventMode==="dynamic"},interactiveChildren:true,hitArea:null,addEventListener(r,e,t){let i=typeof t=="boolean"&&t||typeof t=="object"&&t.capture,s=typeof t=="object"?t.signal:void 0,n=typeof t=="object"?t.once===true:false,o=typeof e=="function"?void 0:e;r=i?`${r}capture`:r;let a=typeof e=="function"?e:e.handleEvent,u=this;s&&s.addEventListener("abort",()=>{u.off(r,a,o);}),n?u.once(r,a,o):u.on(r,a,o);},removeEventListener(r,e,t){let i=typeof t=="boolean"&&t||typeof t=="object"&&t.capture,s=typeof e=="function"?void 0:e;r=i?`${r}capture`:r,e=typeof e=="function"?e:e.handleEvent,this.off(r,e,s);},dispatchEvent(r){if(!(r instanceof Ci))throw new Error("Container cannot propagate events outside of the Federated Events API");return r.defaultPrevented=false,r.path=null,r.target=this,r.manager.dispatchEvent(r),!r.defaultPrevented}};});var IA=f(()=>{B();hr();Sp();Hy();V.add(fu);V.mixin(exports.PixiJSContainer,Ep);});var oo,Vy=f(()=>{B();oo=class{constructor(e){this._attachedDomElements=[],this._renderer=e,this._renderer.runners.postrender.add(this),this._domElement=document.createElement("div"),this._domElement.style.position="absolute",this._domElement.style.top="0",this._domElement.style.left="0",this._domElement.style.pointerEvents="none",this._domElement.style.zIndex="1000";}addRenderable(e,t){this._attachedDomElements.includes(e)||this._attachedDomElements.push(e);}updateRenderable(e){}validateRenderable(e){return true}postrender(){let e=this._attachedDomElements;if(e.length===0){this._domElement.remove();return}let t=this._renderer.view.canvas;this._domElement.parentNode!==t.parentNode&&t.parentNode?.appendChild(this._domElement);let i=parseFloat(t.style.width)/t.width*this._renderer.resolution,s=parseFloat(t.style.height)/t.height*this._renderer.resolution;this._domElement.style.transform=`translate(${t.offsetLeft}px, ${t.offsetTop}px) scale(${i}, ${s})`;for(let n=0;n<e.length;n++){let o=e[n],a=o.element;if(!o.parent||o.globalDisplayStatus<7)a?.remove(),e.splice(n,1),n--;else {this._domElement.contains(a)||(a.style.position="absolute",a.style.pointerEvents="auto",this._domElement.appendChild(a));let u=o.worldTransform,l=o._anchor,c=o.width*l.x,h=o.height*l.y;a.style.transformOrigin=`${c}px ${h}px`,a.style.transform=`matrix(${u.a}, ${u.b}, ${u.c}, ${u.d}, ${u.tx-c}, ${u.ty-h})`,a.style.opacity=o.groupAlpha.toString();}}}destroy(){this._renderer.runners.postrender.remove(this);for(let e=0;e<this._attachedDomElements.length;e++)this._attachedDomElements[e].element?.remove();this._attachedDomElements.length=0,this._domElement.remove(),this._renderer=null;}};oo.extension={type:[x.WebGLPipes,x.WebGPUPipes,x.CanvasPipes],name:"dom"};});var lt,si=f(()=>{Lt();hr();lt=class extends exports.PixiJSContainer{constructor(e){super(e),this.canBundle=true,this.allowChildren=false,this._roundPixels=0,this._lastUsed=-1,this._gpuData=Object.create(null),this._bounds=new Ae(0,1,0,0),this._boundsDirty=true;}get bounds(){return this._boundsDirty?(this.updateBounds(),this._boundsDirty=false,this._bounds):this._bounds}get roundPixels(){return !!this._roundPixels}set roundPixels(e){this._roundPixels=e?1:0;}containsPoint(e){let t=this.bounds,{x:i,y:s}=e;return i>=t.minX&&i<=t.maxX&&s>=t.minY&&s<=t.maxY}onViewUpdate(){if(this._didViewChangeTick++,this._boundsDirty=true,this.didViewUpdate)return;this.didViewUpdate=true;let e=this.renderGroup||this.parentRenderGroup;e&&e.onChildViewUpdate(this);}destroy(e){super.destroy(e),this._bounds=null;for(let t in this._gpuData)this._gpuData[t].destroy?.();this._gpuData=null;}collectRenderablesSimple(e,t,i){let{renderPipes:s}=t;s.blendMode.setBlendMode(this,this.groupBlendMode,e),s[this.renderPipeId].addRenderable(this,e),this.didViewUpdate=false;let o=this.children,a=o.length;for(let u=0;u<a;u++)o[u].collectRenderables(e,t,i);}};});var Cp,DA=f(()=>{cr();si();Cp=class extends lt{constructor(e={}){let{element:t,anchor:i,...s}=e;super({label:"DOMContainer",...s}),this.renderPipeId="dom",this.batched=false,this._anchor=new me(0,0),i&&(this.anchor=i),this.element=e.element||document.createElement("div");}get anchor(){return this._anchor}set anchor(e){typeof e=="number"?this._anchor.set(e):this._anchor.copyFrom(e);}set element(e){this._element!==e&&(this._element=e,this.onViewUpdate());}get element(){return this._element}updateBounds(){let e=this._bounds,t=this._element;if(!t){e.minX=0,e.minY=0,e.maxX=0,e.maxY=0;return}let{offsetWidth:i,offsetHeight:s}=t;e.minX=0,e.maxX=i,e.minY=0,e.maxY=s;}destroy(e=false){super.destroy(e),this._element?.parentNode?.removeChild(this._element),this._element=null,this._anchor=null;}};});var kA=f(()=>{B();Vy();V.add(oo);});var ze,Er=f(()=>{ze=(r=>(r[r.Low=0]="Low",r[r.Normal=1]="Normal",r[r.High=2]="High",r))(ze||{});});var Ap,zy=f(()=>{Ap={createCanvas:(r,e)=>{let t=document.createElement("canvas");return t.width=r,t.height=e,t},getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(r,e)=>fetch(r,e),parseXML:r=>new DOMParser().parseFromString(r,"text/xml")};});var OA,j,Ge=f(()=>{zy();OA=Ap,j={get(){return OA},set(r){OA=r;}};});function ni(r){if(typeof r!="string")throw new TypeError(`Path must be a string. Received ${JSON.stringify(r)}`)}function Wc(r){return r.split("?")[0].split("#")[0]}function iD(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function sD(r,e,t){return r.replace(new RegExp(iD(e),"g"),t)}function nD(r,e){let t="",i=0,s=-1,n=0,o=-1;for(let a=0;a<=r.length;++a){if(a<r.length)o=r.charCodeAt(a);else {if(o===47)break;o=47;}if(o===47){if(!(s===a-1||n===1))if(s!==a-1&&n===2){if(t.length<2||i!==2||t.charCodeAt(t.length-1)!==46||t.charCodeAt(t.length-2)!==46){if(t.length>2){let u=t.lastIndexOf("/");if(u!==t.length-1){u===-1?(t="",i=0):(t=t.slice(0,u),i=t.length-1-t.lastIndexOf("/")),s=a,n=0;continue}}else if(t.length===2||t.length===1){t="",i=0,s=a,n=0;continue}}}else t.length>0?t+=`/${r.slice(s+1,a)}`:t=r.slice(s+1,a),i=a-s-1;s=a,n=0;}else o===46&&n!==-1?++n:n=-1;}return t}var We,Us=f(()=>{Ge();We={toPosix(r){return sD(r,"\\","/")},isUrl(r){return /^https?:/.test(this.toPosix(r))},isDataUrl(r){return /^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(r)},isBlobUrl(r){return r.startsWith("blob:")},hasProtocol(r){return /^[^/:]+:/.test(this.toPosix(r))},getProtocol(r){ni(r),r=this.toPosix(r);let e=/^file:\/\/\//.exec(r);if(e)return e[0];let t=/^[^/:]+:\/{0,2}/.exec(r);return t?t[0]:""},toAbsolute(r,e,t){if(ni(r),this.isDataUrl(r)||this.isBlobUrl(r))return r;let i=Wc(this.toPosix(e??j.get().getBaseUrl())),s=Wc(this.toPosix(t??this.rootname(i)));return r=this.toPosix(r),r.startsWith("/")?We.join(s,r.slice(1)):this.isAbsolute(r)?r:this.join(i,r)},normalize(r){if(ni(r),r.length===0)return ".";if(this.isDataUrl(r)||this.isBlobUrl(r))return r;r=this.toPosix(r);let e="",t=r.startsWith("/");this.hasProtocol(r)&&(e=this.rootname(r),r=r.slice(e.length));let i=r.endsWith("/");return r=nD(r),r.length>0&&i&&(r+="/"),t?`/${r}`:e+r},isAbsolute(r){return ni(r),r=this.toPosix(r),this.hasProtocol(r)?true:r.startsWith("/")},join(...r){if(r.length===0)return ".";let e;for(let t=0;t<r.length;++t){let i=r[t];if(ni(i),i.length>0)if(e===void 0)e=i;else {let s=r[t-1]??"";this.joinExtensions.includes(this.extname(s).toLowerCase())?e+=`/../${i}`:e+=`/${i}`;}}return e===void 0?".":this.normalize(e)},dirname(r){if(ni(r),r.length===0)return ".";r=this.toPosix(r);let e=r.charCodeAt(0),t=e===47,i=-1,s=true,n=this.getProtocol(r),o=r;r=r.slice(n.length);for(let a=r.length-1;a>=1;--a)if(e=r.charCodeAt(a),e===47){if(!s){i=a;break}}else s=false;return i===-1?t?"/":this.isUrl(o)?n+r:n:t&&i===1?"//":n+r.slice(0,i)},rootname(r){ni(r),r=this.toPosix(r);let e="";if(r.startsWith("/")?e="/":e=this.getProtocol(r),this.isUrl(r)){let t=r.indexOf("/",e.length);t!==-1?e=r.slice(0,t):e=r,e.endsWith("/")||(e+="/");}return e},basename(r,e){ni(r),e&&ni(e),r=Wc(this.toPosix(r));let t=0,i=-1,s=true,n;if(e!==void 0&&e.length>0&&e.length<=r.length){if(e.length===r.length&&e===r)return "";let o=e.length-1,a=-1;for(n=r.length-1;n>=0;--n){let u=r.charCodeAt(n);if(u===47){if(!s){t=n+1;break}}else a===-1&&(s=false,a=n+1),o>=0&&(u===e.charCodeAt(o)?--o===-1&&(i=n):(o=-1,i=a));}return t===i?i=a:i===-1&&(i=r.length),r.slice(t,i)}for(n=r.length-1;n>=0;--n)if(r.charCodeAt(n)===47){if(!s){t=n+1;break}}else i===-1&&(s=false,i=n+1);return i===-1?"":r.slice(t,i)},extname(r){ni(r),r=Wc(this.toPosix(r));let e=-1,t=0,i=-1,s=true,n=0;for(let o=r.length-1;o>=0;--o){let a=r.charCodeAt(o);if(a===47){if(!s){t=o+1;break}continue}i===-1&&(s=false,i=o+1),a===46?e===-1?e=o:n!==1&&(n=1):e!==-1&&(n=-1);}return e===-1||i===-1||n===0||n===1&&e===i-1&&e===t+1?"":r.slice(e,i)},parse(r){ni(r);let e={root:"",dir:"",base:"",ext:"",name:""};if(r.length===0)return e;r=Wc(this.toPosix(r));let t=r.charCodeAt(0),i=this.isAbsolute(r),s;e.root=this.rootname(r),i||this.hasProtocol(r)?s=1:s=0;let o=-1,a=0,u=-1,l=true,c=r.length-1,h=0;for(;c>=s;--c){if(t=r.charCodeAt(c),t===47){if(!l){a=c+1;break}continue}u===-1&&(l=false,u=c+1),t===46?o===-1?o=c:h!==1&&(h=1):o!==-1&&(h=-1);}return o===-1||u===-1||h===0||h===1&&o===u-1&&o===a+1?u!==-1&&(a===0&&i?e.base=e.name=r.slice(1,u):e.base=e.name=r.slice(a,u)):(a===0&&i?(e.name=r.slice(1,o),e.base=r.slice(1,u)):(e.name=r.slice(a,o),e.base=r.slice(a,u)),e.ext=r.slice(o,u)),e.dir=this.dirname(r),e},sep:"/",delimiter:":",joinExtensions:[".html"]};});var Ht,pu=f(()=>{Ht=(r,e,t=false)=>(Array.isArray(r)||(r=[r]),e?r.map(i=>typeof i=="string"||t?e(i):i):r);});function FA(r,e,t,i,s){let n=e[t];for(let o=0;o<n.length;o++){let a=n[o];t<e.length-1?FA(r.replace(i[t],a),e,t+1,i,s):s.push(r.replace(i[t],a));}}function Pp(r){let e=/\{(.*?)\}/g,t=r.match(e),i=[];if(t){let s=[];t.forEach(n=>{let o=n.substring(1,n.length-1).split(",");s.push(o);}),FA(r,s,0,t,i);}else i.push(r);return i}var Wy=f(()=>{});var ss,Xc=f(()=>{ss=r=>!Array.isArray(r);});function Xy(r){return r.split(".").pop().split("?").shift().split("#").shift()}var Vt,Ls=f(()=>{Be();Us();pu();Wy();Xc();Vt=class{constructor(){this._defaultBundleIdentifierOptions={connector:"-",createBundleAssetId:(e,t)=>`${e}${this._bundleIdConnector}${t}`,extractAssetIdFromBundle:(e,t)=>t.replace(`${e}${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(e){if(this._bundleIdConnector=e.connector??this._bundleIdConnector,this._createBundleAssetId=e.createBundleAssetId??this._createBundleAssetId,this._extractAssetIdFromBundle=e.extractAssetIdFromBundle??this._extractAssetIdFromBundle,this._extractAssetIdFromBundle("foo",this._createBundleAssetId("foo","bar"))!=="bar")throw new Error("[Resolver] GenerateBundleAssetId are not working correctly")}prefer(...e){e.forEach(t=>{this._preferredOrder.push(t),t.priority||(t.priority=Object.keys(t.params));}),this._resolverHash={};}set basePath(e){this._basePath=e;}get basePath(){return this._basePath}set rootPath(e){this._rootPath=e;}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(e){if(typeof e=="string")this._defaultSearchParams=e;else {let t=e;this._defaultSearchParams=Object.keys(t).map(i=>`${encodeURIComponent(i)}=${encodeURIComponent(t[i])}`).join("&");}}getAlias(e){let{alias:t,src:i}=e;return Ht(t||i,n=>typeof n=="string"?n:Array.isArray(n)?n.map(o=>o?.src??o):n?.src?n.src:n,true)}addManifest(e){this._manifest&&N("[Resolver] Manifest already exists, this will be overwritten"),this._manifest=e,e.bundles.forEach(t=>{this.addBundle(t.name,t.assets);});}addBundle(e,t){let i=[],s=t;Array.isArray(t)||(s=Object.entries(t).map(([n,o])=>typeof o=="string"||Array.isArray(o)?{alias:n,src:o}:{alias:n,...o})),s.forEach(n=>{let o=n.src,a=n.alias,u;if(typeof a=="string"){let l=this._createBundleAssetId(e,a);i.push(l),u=[a,l];}else {let l=a.map(c=>this._createBundleAssetId(e,c));i.push(...l),u=[...a,...l];}this.add({...n,alias:u,src:o});}),this._bundles[e]=i;}add(e){let t=[];Array.isArray(e)?t.push(...e):t.push(e);let i;i=n=>{this.hasKey(n)&&N(`[Resolver] already has key: ${n} overwriting`);},Ht(t).forEach(n=>{let{src:o}=n,{data:a,format:u,loadParser:l}=n,c=Ht(o).map(p=>typeof p=="string"?Pp(p):Array.isArray(p)?p:[p]),h=this.getAlias(n);Array.isArray(h)?h.forEach(i):i(h);let d=[];c.forEach(p=>{p.forEach(m=>{let b={};if(typeof m!="object"){b.src=m;for(let _=0;_<this._parsers.length;_++){let g=this._parsers[_];if(g.test(m)){b=g.parse(m);break}}}else a=m.data??a,u=m.format??u,l=m.loadParser??l,b={...b,...m};if(!h)throw new Error(`[Resolver] alias is undefined for this asset: ${b.src}`);b=this._buildResolvedAsset(b,{aliases:h,data:a,format:u,loadParser:l}),d.push(b);});}),h.forEach(p=>{this._assetMap[p]=d;});});}resolveBundle(e){let t=ss(e);e=Ht(e);let i={};return e.forEach(s=>{let n=this._bundles[s];if(n){let o=this.resolve(n),a={};for(let u in o){let l=o[u];a[this._extractAssetIdFromBundle(s,u)]=l;}i[s]=a;}}),t?i[e[0]]:i}resolveUrl(e){let t=this.resolve(e);if(typeof e!="string"){let i={};for(let s in t)i[s]=t[s].src;return i}return t.src}resolve(e){let t=ss(e);e=Ht(e);let i={};return e.forEach(s=>{if(!this._resolverHash[s])if(this._assetMap[s]){let n=this._assetMap[s],o=this._getPreferredOrder(n);o?.priority.forEach(a=>{o.params[a].forEach(u=>{let l=n.filter(c=>c[a]?c[a]===u:false);l.length&&(n=l);});}),this._resolverHash[s]=n[0];}else this._resolverHash[s]=this._buildResolvedAsset({alias:[s],src:s},{});i[s]=this._resolverHash[s];}),t?i[e[0]]:i}hasKey(e){return !!this._assetMap[e]}hasBundle(e){return !!this._bundles[e]}_getPreferredOrder(e){for(let t=0;t<e.length;t++){let i=e[t],s=this._preferredOrder.find(n=>n.params.format.includes(i.format));if(s)return s}return this._preferredOrder[0]}_appendDefaultSearchParams(e){if(!this._defaultSearchParams)return e;let t=/\?/.test(e)?"&":"?";return `${e}${t}${this._defaultSearchParams}`}_buildResolvedAsset(e,t){let{aliases:i,data:s,loadParser:n,format:o}=t;return (this._basePath||this._rootPath)&&(e.src=We.toAbsolute(e.src,this._basePath,this._rootPath)),e.alias=i??e.alias??[e.src],e.src=this._appendDefaultSearchParams(e.src),e.data={...s||{},...e.data},e.loadParser=n??e.loadParser,e.format=o??e.format??Xy(e.src),e}};Vt.RETINA_PREFIX=/@([0-9\.]+)x/;});var ao,wp=f(()=>{ao=(r,e)=>{let t=e.split("?")[1];return t&&(r+=`?${t}`),r};});var GA,jc,Yy=f(()=>{ct();Ct();ye();GA=class Yc{constructor(e,t){this.linkedSheets=[];let i=e;e?.source instanceof ge&&(i={texture:e,data:t});let{texture:s,data:n,cachePrefix:o=""}=i;this.cachePrefix=o,this._texture=s instanceof exports.Texture?s:null,this.textureSource=s.source,this.textures={},this.animations={},this.data=n;let a=parseFloat(n.meta.scale);a?(this.resolution=a,s.source.resolution=this.resolution):this.resolution=s.source._resolution,this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null;}parse(){return new Promise(e=>{this._callback=e,this._batchIndex=0,this._frameKeys.length<=Yc.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch();})}_processFrames(e){let t=e,i=Yc.BATCH_SIZE;for(;t-e<i&&t<this._frameKeys.length;){let s=this._frameKeys[t],n=this._frames[s],o=n.frame;if(o){let a=null,u=null,l=n.trimmed!==false&&n.sourceSize?n.sourceSize:n.frame,c=new exports.Rectangle(0,0,Math.floor(l.w)/this.resolution,Math.floor(l.h)/this.resolution);n.rotated?a=new exports.Rectangle(Math.floor(o.x)/this.resolution,Math.floor(o.y)/this.resolution,Math.floor(o.h)/this.resolution,Math.floor(o.w)/this.resolution):a=new exports.Rectangle(Math.floor(o.x)/this.resolution,Math.floor(o.y)/this.resolution,Math.floor(o.w)/this.resolution,Math.floor(o.h)/this.resolution),n.trimmed!==false&&n.spriteSourceSize&&(u=new exports.Rectangle(Math.floor(n.spriteSourceSize.x)/this.resolution,Math.floor(n.spriteSourceSize.y)/this.resolution,Math.floor(o.w)/this.resolution,Math.floor(o.h)/this.resolution)),this.textures[s]=new exports.Texture({source:this.textureSource,frame:a,orig:c,trim:u,rotate:n.rotated?2:0,defaultAnchor:n.anchor,defaultBorders:n.borders,label:s.toString()});}t++;}}_processAnimations(){let e=this.data.animations||{};for(let t in e){this.animations[t]=[];for(let i=0;i<e[t].length;i++){let s=e[t][i];this.animations[t].push(this.textures[s]);}}}_parseComplete(){let e=this._callback;this._callback=null,this._batchIndex=0,e.call(this,this.textures);}_nextBatch(){this._processFrames(this._batchIndex*Yc.BATCH_SIZE),this._batchIndex++,setTimeout(()=>{this._batchIndex*Yc.BATCH_SIZE<this._frameKeys.length?this._nextBatch():(this._processAnimations(),this._parseComplete());},0);}destroy(e=false){for(let t in this.textures)this.textures[t].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,e&&(this._texture?.destroy(),this.textureSource.destroy()),this._texture=null,this.textureSource=null,this.linkedSheets=[];}};GA.BATCH_SIZE=1e3;jc=GA;});function UA(r,e,t){let i={};if(r.forEach(s=>{i[s]=e;}),Object.keys(e.textures).forEach(s=>{i[`${e.cachePrefix}${s}`]=e.textures[s];}),!t){let s=We.dirname(r[0]);e.linkedSheets.forEach((n,o)=>{let a=UA([`${s}/${e.data.meta.related_multi_packs[o]}`],n,true);Object.assign(i,a);});}return i}var oD,Bp,jy=f(()=>{Er();Ls();wp();B();ye();Us();Yy();oD=["jpg","png","jpeg","avif","webp","basis","etc2","bc7","bc6h","bc5","bc4","bc3","bc2","bc1","eac","astc"];Bp={extension:x.Asset,cache:{test:r=>r instanceof jc,getCacheableAssets:(r,e)=>UA(r,e,false)},resolver:{extension:{type:x.ResolveParser,name:"resolveSpritesheet"},test:r=>{let t=r.split("?")[0].split("."),i=t.pop(),s=t.pop();return i==="json"&&oD.includes(s)},parse:r=>{let e=r.split(".");return {resolution:parseFloat(Vt.RETINA_PREFIX.exec(r)?.[1]??"1"),format:e[e.length-2],src:r}}},loader:{name:"spritesheetLoader",extension:{type:x.LoadParser,priority:ze.Normal,name:"spritesheetLoader"},async testParse(r,e){return We.extname(e.src).toLowerCase()===".json"&&!!r.frames},async parse(r,e,t){let{texture:i,imageFilename:s,textureOptions:n,cachePrefix:o}=e?.data??{},a=We.dirname(e.src);a&&a.lastIndexOf("/")!==a.length-1&&(a+="/");let u;if(i instanceof exports.Texture)u=i;else {let h=ao(a+(s??r.meta.image),e.src);u=(await t.load([{src:h,data:n}]))[h];}let l=new jc({texture:u.source,data:r,cachePrefix:o});await l.parse();let c=r?.meta?.related_multi_packs;if(Array.isArray(c)){let h=[];for(let p of c){if(typeof p!="string")continue;let m=a+p;e.data?.ignoreMultiPack||(m=ao(m,e.src),h.push(t.load({src:m,data:{textureOptions:n,ignoreMultiPack:true}})));}let d=await Promise.all(h);l.linkedSheets=d,d.forEach(p=>{p.linkedSheets=[l].concat(l.linkedSheets.filter(m=>m!==p));});}return l},async unload(r,e,t){await t.unload(r.textureSource._sourceOrigin),r.destroy(false);}}};});var Rp=f(()=>{B();jy();V.add(Bp);});function mu(r,e,t){let{width:i,height:s}=t.orig,n=t.trim;if(n){let o=n.width,a=n.height;r.minX=n.x-e._x*i,r.maxX=r.minX+o,r.minY=n.y-e._y*s,r.maxY=r.minY+a;}else r.minX=-e._x*i,r.maxX=r.minX+i,r.minY=-e._y*s,r.maxY=r.minY+s;}var Mp=f(()=>{});exports.PixiJSSprite=void 0;var Ns=f(()=>{ws();ye();Mp();Pe();si();exports.PixiJSSprite=class r extends lt{constructor(e=exports.Texture.EMPTY){e instanceof exports.Texture&&(e={texture:e});let{texture:t=exports.Texture.EMPTY,anchor:i,roundPixels:s,width:n,height:o,...a}=e;super({label:"Sprite",...a}),this.renderPipeId="sprite",this.batched=true,this._visualBounds={minX:0,maxX:1,minY:0,maxY:0},this._anchor=new Ne({_onUpdate:()=>{this.onViewUpdate();}}),i?this.anchor=i:t.defaultAnchor&&(this.anchor=t.defaultAnchor),this.texture=t,this.allowChildren=false,this.roundPixels=s??false,n!==void 0&&(this.width=n),o!==void 0&&(this.height=o);}static from(e,t=false){return e instanceof exports.Texture?new r(e):new r(exports.Texture.from(e,t))}set texture(e){e||(e=exports.Texture.EMPTY);let t=this._texture;t!==e&&(t&&t.dynamic&&t.off("update",this.onViewUpdate,this),e.dynamic&&e.on("update",this.onViewUpdate,this),this._texture=e,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 mu(this._visualBounds,this._anchor,this._texture),this._visualBounds}get sourceBounds(){return U("8.6.1","Sprite.sourceBounds is deprecated, use visualBounds instead."),this.visualBounds}updateBounds(){let e=this._anchor,t=this._texture,i=this._bounds,{width:s,height:n}=t.orig;i.minX=-e._x*s,i.maxX=i.minX+s,i.minY=-e._y*n,i.maxY=i.minY+n;}destroy(e=false){if(super.destroy(e),typeof e=="boolean"?e:e?.texture){let i=typeof e=="boolean"?e:e?.textureSource;this._texture.destroy(i);}this._texture=null,this._visualBounds=null,this._bounds=null,this._anchor=null,this._gpuData=null;}get anchor(){return this._anchor}set anchor(e){typeof e=="number"?this._anchor.set(e):this._anchor.copyFrom(e);}get width(){return Math.abs(this.scale.x)*this._texture.orig.width}set width(e){this._setWidth(e,this._texture.orig.width),this._width=e;}get height(){return Math.abs(this.scale.y)*this._texture.orig.height}set height(e){this._setHeight(e,this._texture.orig.height),this._height=e;}getSize(e){return e||(e={}),e.width=Math.abs(this.scale.x)*this._texture.orig.width,e.height=Math.abs(this.scale.y)*this._texture.orig.height,e}setSize(e,t){typeof e=="object"?(t=e.height??e.width,e=e.width):t??(t=e),e!==void 0&&this._setWidth(e,this._texture.orig.width),t!==void 0&&this._setHeight(t,this._texture.orig.height);}};});function Hs(r,e,t){let i=aD;r.measurable=true,Ei(r,t,i),e.addBoundsMask(i),r.measurable=false;}var aD,$c=f(()=>{Lt();Kn();aD=new Ae;});function Vs(r,e,t){let i=ir.get();r.measurable=true;let s=ut.get().identity(),n=LA(r,t,s);Ms(r,i,n),r.measurable=false,e.addBoundsMask(i),ut.return(s),ir.return(i);}function LA(r,e,t){return r?(r!==e&&(LA(r.parent,e,t),r.updateLocalTransform(),t.append(r.localTransform)),t):(N("Mask bounds, renderable is not inside the root container"),t)}var qc=f(()=>{Oc();Bs();Be();});var uo,$y=f(()=>{B();Ns();$c();qc();uo=class{constructor(e){this.priority=0,this.inverse=false,this.pipe="alphaMask",e?.mask&&this.init(e.mask);}init(e){this.mask=e,this.renderMaskToTexture=!(e instanceof exports.PixiJSSprite),this.mask.renderable=this.renderMaskToTexture,this.mask.includeInBuild=!this.renderMaskToTexture,this.mask.measurable=false;}reset(){this.mask.measurable=true,this.mask=null;}addBounds(e,t){this.inverse||Hs(this.mask,e,t);}addLocalBounds(e,t){Vs(this.mask,e,t);}containsPoint(e,t){let i=this.mask;return t(i,e)}destroy(){this.reset();}static test(e){return e instanceof exports.PixiJSSprite}};uo.extension=x.MaskEffect;});var lo,qy=f(()=>{B();lo=class{constructor(e){this.priority=0,this.pipe="colorMask",e?.mask&&this.init(e.mask);}init(e){this.mask=e;}destroy(){}static test(e){return typeof e=="number"}};lo.extension=x.MaskEffect;});var co,Ky=f(()=>{B();hr();$c();qc();co=class{constructor(e){this.priority=0,this.pipe="stencilMask",e?.mask&&this.init(e.mask);}init(e){this.mask=e,this.mask.includeInBuild=false,this.mask.measurable=false;}reset(){this.mask.measurable=true,this.mask.includeInBuild=true,this.mask=null;}addBounds(e,t){Hs(this.mask,e,t);}addLocalBounds(e,t){Vs(this.mask,e,t);}containsPoint(e,t){let i=this.mask;return t(i,e)}destroy(){this.reset();}static test(e){return e instanceof exports.PixiJSContainer}};co.extension=x.MaskEffect;});var At,ho=f(()=>{Ge();B();Ct();At=class extends ge{constructor(e){e.resource||(e.resource=j.get().createCanvas()),e.width||(e.width=e.resource.width,e.autoDensity||(e.width/=e.resolution)),e.height||(e.height=e.resource.height,e.autoDensity||(e.height/=e.resolution)),super(e),this.uploadMethodId="image",this.autoDensity=e.autoDensity,this.resizeCanvas(),this.transparent=!!e.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(e=this.width,t=this.height,i=this._resolution){let s=super.resize(e,t,i);return s&&this.resizeCanvas(),s}static test(e){return globalThis.HTMLCanvasElement&&e instanceof HTMLCanvasElement||globalThis.OffscreenCanvas&&e instanceof OffscreenCanvas}get context2D(){return this._context2D||(this._context2D=this.resource.getContext("2d"))}};At.extension=x.TextureSource;});var Yt,fo=f(()=>{B();Ct();Yt=class extends ge{constructor(e){super(e),this.uploadMethodId="image",this.autoGarbageCollect=true;}static test(e){return globalThis.HTMLImageElement&&e instanceof HTMLImageElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap||globalThis.VideoFrame&&e instanceof VideoFrame}};Yt.extension=x.TextureSource;});async function gu(){return Zy??(Zy=(async()=>{let e=document.createElement("canvas").getContext("webgl");if(!e)return "premultiply-alpha-on-upload";let t=await new Promise(o=>{let a=document.createElement("video");a.onloadeddata=()=>o(a),a.onerror=()=>o(null),a.autoplay=false,a.crossOrigin="anonymous",a.preload="auto",a.src="data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=",a.load();});if(!t)return "premultiply-alpha-on-upload";let i=e.createTexture();e.bindTexture(e.TEXTURE_2D,i);let s=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,s),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,i,0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,false),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,e.NONE),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t);let n=new Uint8Array(4);return e.readPixels(0,0,1,1,e.RGBA,e.UNSIGNED_BYTE,n),e.deleteFramebuffer(s),e.deleteTexture(i),e.getExtension("WEBGL_lose_context")?.loseContext(),n[0]<=n[3]?"premultiplied-alpha":"premultiply-alpha-on-upload"})()),Zy}var Zy,Ip=f(()=>{});var Dp,zs,kp=f(()=>{B();Gs();Ip();Ct();Dp=class NA extends ge{constructor(e){super(e),this.isReady=false,this.uploadMethodId="video",e={...NA.defaultOptions,...e},this._autoUpdate=true,this._isConnectedToTicker=false,this._updateFPS=e.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=e.autoPlay!==false,this.alphaMode=e.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),e.autoLoad!==false&&this.load();}updateFrame(){if(!this.destroyed){if(this._updateFPS){let e=Ie.shared.elapsedMS*this.resource.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-e);}(!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;let e=this.resource,t=this.options;return (e.readyState===e.HAVE_ENOUGH_DATA||e.readyState===e.HAVE_FUTURE_DATA)&&e.width&&e.height&&(e.complete=true),e.addEventListener("play",this._onPlayStart),e.addEventListener("pause",this._onPlayStop),e.addEventListener("seeked",this._onSeeked),this._isSourceReady()?this._mediaReady():(t.preload||e.addEventListener("canplay",this._onCanPlay),e.addEventListener("canplaythrough",this._onCanPlayThrough),e.addEventListener("error",this._onError,true)),this.alphaMode=await gu(),this._load=new Promise((i,s)=>{this.isValid?i(this):(this._resolve=i,this._reject=s,t.preloadTimeoutMs!==void 0&&(this._preloadTimeout=setTimeout(()=>{this._onError(new ErrorEvent(`Preload exceeded timeout of ${t.preloadTimeoutMs}ms`));})),e.load());}),this._load}_onError(e){this.resource.removeEventListener("error",this._onError,true),this.emit("error",e),this._reject&&(this._reject(e),this._reject=null,this._resolve=null);}_isSourcePlaying(){let e=this.resource;return !e.paused&&!e.ended}_isSourceReady(){return this.resource.readyState>2}_onPlayStart(){this.isValid||this._mediaReady(),this._configureAutoUpdate();}_onPlayStop(){this._configureAutoUpdate();}_onSeeked(){this._autoUpdate&&!this._isSourcePlaying()&&(this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0);}_onCanPlay(){this.resource.removeEventListener("canplay",this._onCanPlay),this._mediaReady();}_onCanPlayThrough(){this.resource.removeEventListener("canplaythrough",this._onCanPlay),this._preloadTimeout&&(clearTimeout(this._preloadTimeout),this._preloadTimeout=void 0),this._mediaReady();}_mediaReady(){let e=this.resource;this.isValid&&(this.isReady=true,this.resize(e.videoWidth,e.videoHeight)),this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0,this._resolve&&(this._resolve(this),this._resolve=null,this._reject=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&this.resource.play();}destroy(){this._configureAutoUpdate();let e=this.resource;e&&(e.removeEventListener("play",this._onPlayStart),e.removeEventListener("pause",this._onPlayStop),e.removeEventListener("seeked",this._onSeeked),e.removeEventListener("canplay",this._onCanPlay),e.removeEventListener("canplaythrough",this._onCanPlayThrough),e.removeEventListener("error",this._onError,true),e.pause(),e.src="",e.load()),super.destroy();}get autoUpdate(){return this._autoUpdate}set autoUpdate(e){e!==this._autoUpdate&&(this._autoUpdate=e,this._configureAutoUpdate());}get updateFPS(){return this._updateFPS}set updateFPS(e){e!==this._updateFPS&&(this._updateFPS=e,this._configureAutoUpdate());}_configureAutoUpdate(){this._autoUpdate&&this._isSourcePlaying()?!this._updateFPS&&this.resource.requestVideoFrameCallback?(this._isConnectedToTicker&&(Ie.shared.remove(this.updateFrame,this),this._isConnectedToTicker=false,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||(Ie.shared.add(this.updateFrame,this),this._isConnectedToTicker=true,this._msToNextUpdate=0)):(this._videoFrameRequestCallbackHandle!==null&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(Ie.shared.remove(this.updateFrame,this),this._isConnectedToTicker=false,this._msToNextUpdate=0));}static test(e){return globalThis.HTMLVideoElement&&e instanceof HTMLVideoElement}};Dp.extension=x.TextureSource;Dp.defaultOptions={...ge.defaultOptions,autoLoad:true,autoPlay:true,updateFPS:0,crossorigin:true,loop:false,muted:true,playsinline:true,preload:false};Dp.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};zs=Dp;});var Qy,Se,Ai=f(()=>{Be();pu();Qy=class{constructor(){this._parsers=[],this._cache=new Map,this._cacheMap=new Map;}reset(){this._cacheMap.clear(),this._cache.clear();}has(e){return this._cache.has(e)}get(e){let t=this._cache.get(e);return t||N(`[Assets] Asset id ${e} was not found in the Cache`),t}set(e,t){let i=Ht(e),s;for(let u=0;u<this.parsers.length;u++){let l=this.parsers[u];if(l.test(t)){s=l.getCacheableAssets(i,t);break}}let n=new Map(Object.entries(s||{}));s||i.forEach(u=>{n.set(u,t);});let o=[...n.keys()],a={cacheKeys:o,keys:i};i.forEach(u=>{this._cacheMap.set(u,a);}),o.forEach(u=>{let l=s?s[u]:t;this._cache.has(u)&&this._cache.get(u)!==l&&N("[Cache] already has key:",u),this._cache.set(u,n.get(u));});}remove(e){if(!this._cacheMap.has(e)){N(`[Assets] Asset id ${e} was not found in the Cache`);return}let t=this._cacheMap.get(e);t.cacheKeys.forEach(s=>{this._cache.delete(s);}),t.keys.forEach(s=>{this._cacheMap.delete(s);});}get parsers(){return this._parsers}},Se=new Qy;});function HA(r={}){return e0(r)}function e0(r={}){let e=r&&r.resource,t=e?r.resource:r,i=e?r:{resource:r};for(let s=0;s<Jy.length;s++){let n=Jy[s];if(n.test(t))return new n(i)}throw new Error(`Could not find a source type for resource: ${i.resource}`)}function t0(r={},e=false){let t=r&&r.resource,i=t?r.resource:r,s=t?r:{resource:r};if(!e&&Se.has(i))return Se.get(i);let n=new exports.Texture({source:e0(s)});return n.on("destroy",()=>{Se.has(i)&&Se.remove(i);}),e||Se.set(i,n),n}function r0(r,e=false){return typeof r=="string"?Se.get(r):r instanceof ge?new exports.Texture({source:r}):t0(r,e)}var Jy,i0=f(()=>{Ai();B();Ct();ye();Jy=[];V.handleByList(x.TextureSource,Jy);exports.Texture.from=r0;ge.from=e0;});var Op=f(()=>{B();$y();qy();Ky();dp();ho();fo();kp();i0();V.add(uo,lo,co,zs,Yt,At,rs);});var _t,ns=f(()=>{_t=class{constructor(e){this.resources=Object.create(null),this._dirty=true;let t=0;for(let i in e){let s=e[i];this.setResource(s,t++);}this._updateKey();}_updateKey(){if(!this._dirty)return;this._dirty=false;let e=[],t=0;for(let i in this.resources)e[t++]=this.resources[i]._resourceId;this._key=e.join("|");}setResource(e,t){let i=this.resources[t];e!==i&&(i&&e.off?.("change",this.onResourceChange,this),e.on?.("change",this.onResourceChange,this),this.resources[t]=e,this._dirty=true);}getResource(e){return this.resources[e]}_touch(e){let t=this.resources;for(let i in t)t[i]._touched=e;}destroy(){let e=this.resources;for(let t in e)e[t].off?.("change",this.onResourceChange,this);this.resources=null;}onResourceChange(e){if(this._dirty=true,e.destroyed){let t=this.resources;for(let i in t)t[i]===e&&(t[i]=null);}else this._updateKey();}};});function Ws(r,e,t){let i=2166136261;for(let s=0;s<e;s++)i^=r[s].uid,i=Math.imul(i,16777619),i>>>=0;return VA[i]||uD(r,e,i,t)}function uD(r,e,t,i){let s={},n=0;for(let a=0;a<i;a++){let u=a<e?r[a]:exports.Texture.EMPTY.source;s[n++]=u.source,s[n++]=u.style;}let o=new _t(s);return VA[t]=o,o}var VA,Kc=f(()=>{ns();ye();VA={};});var Lr,Fp=f(()=>{Lr=class{constructor(e){typeof e=="number"?this.rawBinaryData=new ArrayBuffer(e):e instanceof Uint8Array?this.rawBinaryData=e.buffer:this.rawBinaryData=e,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(e){return this[`${e}View`]}destroy(){this.rawBinaryData=null,this._int8View=null,this._uint8View=null,this._int16View=null,this.uint16View=null,this._int32View=null,this.uint32View=null,this.float32View=null;}static sizeOf(e){switch(e){case "int8":case "uint8":return 1;case "int16":case "uint16":return 2;case "int32":case "uint32":case "float32":return 4;default:throw new Error(`${e} isn't a valid view type`)}}};});function po(r,e){let t=r.byteLength/8|0,i=new Float64Array(r,0,t);new Float64Array(e,0,t).set(i);let n=r.byteLength-t*8;if(n>0){let o=new Uint8Array(r,t*8,n);new Uint8Array(e,t*8,n).set(o);}}var Gp=f(()=>{});var Up,He,Xs=f(()=>{Up={normal:"normal-npm",add:"add-npm",screen:"screen-npm"},He=(r=>(r[r.DISABLED=0]="DISABLED",r[r.RENDERING_MASK_ADD=1]="RENDERING_MASK_ADD",r[r.MASK_ACTIVE=2]="MASK_ACTIVE",r[r.INVERSE_MASK_ACTIVE=3]="INVERSE_MASK_ACTIVE",r[r.RENDERING_MASK_REMOVE=4]="RENDERING_MASK_REMOVE",r[r.NONE=5]="NONE",r))(He||{});});function oi(r,e){return e.alphaMode==="no-premultiply-alpha"&&Up[r]||r}var xu=f(()=>{Xs();});function _u(){return (!Lp||Lp?.isContextLost())&&(Lp=j.get().createCanvas().getContext("webgl",{})),Lp}var Lp,Np=f(()=>{Ge();});function cD(r){let e="";for(let t=0;t<r;++t)t>0&&(e+=`
19
+ `,e.accessibleText&&(t.innerText=e.accessibleText)),t.style.width=`${xp}px`,t.style.height=`${xp}px`,t.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",t.style.position="absolute",t.style.zIndex=AA.toString(),t.style.borderStyle="none",navigator.userAgent.toLowerCase().includes("chrome")?t.setAttribute("aria-live","off"):t.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?t.setAttribute("aria-relevant","additions"):t.setAttribute("aria-relevant","text"),t.addEventListener("click",this._onClick.bind(this)),t.addEventListener("focus",this._onFocus.bind(this)),t.addEventListener("focusout",this._onFocusOut.bind(this))),t.style.pointerEvents=e.accessiblePointerEvents,t.type=e.accessibleType,e.accessibleTitle&&e.accessibleTitle!==null?t.title=e.accessibleTitle:(!e.accessibleHint||e.accessibleHint===null)&&(t.title=`container ${e.tabIndex}`),e.accessibleHint&&e.accessibleHint!==null&&t.setAttribute("aria-label",e.accessibleHint),this.debug&&this._updateDebugHTML(t),e._accessibleActive=true,e._accessibleDiv=t,t.container=e,this._children.push(e),this._div.appendChild(e._accessibleDiv),e.interactive&&(e._accessibleDiv.tabIndex=e.tabIndex);}_dispatchEvent(e,t){let{container:i}=e.target,s=this._renderer.events.rootBoundary,n=Object.assign(new Ci(s),{target:i});s.rootTarget=this._renderer.lastObjectRendered,t.forEach(o=>s.dispatchEvent(n,o));}_onClick(e){this._dispatchEvent(e,["click","pointertap","tap"]);}_onFocus(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","assertive"),this._dispatchEvent(e,["mouseover"]);}_onFocusOut(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","polite"),this._dispatchEvent(e,["mouseout"]);}_onKeyDown(e){e.keyCode!==jI||!this._activateOnTab||this._activate();}_onMouseMove(e){e.movementX===0&&e.movementY===0||this._deactivate();}destroy(){this._deactivate(),this._destroyTouchHook(),this._div=null,this._pool=null,this._children=null,this._renderer=null,this._activateOnTab&&globalThis.removeEventListener("keydown",this._onKeyDown);}setAccessibilityEnabled(e){e?this._activate():this._deactivate();}};By.extension={type:[x.WebGLSystem,x.WebGPUSystem],name:"accessibility"};By.defaultOptions={enabledByDefault:false,debug:false,activateOnTab:true,deactivateOnMouseMove:true};_p=By;});var bp,My=f(()=>{bp={accessible:false,accessibleTitle:null,accessibleHint:null,tabIndex:0,accessibleType:"button",accessibleText:null,accessiblePointerEvents:"auto",accessibleChildren:true,_accessibleActive:false,_accessibleDiv:null,_renderId:-1};});var BA=f(()=>{B();hr();Ry();My();V.add(_p);V.mixin(ue,bp);});var io,Iy=f(()=>{B();io=class{static init(e){Object.defineProperty(this,"resizeTo",{set(t){globalThis.removeEventListener("resize",this.queueResize),this._resizeTo=t,t&&(globalThis.addEventListener("resize",this.queueResize),this.resize());},get(){return this._resizeTo}}),this.queueResize=()=>{this._resizeTo&&(this._cancelResize(),this._resizeId=requestAnimationFrame(()=>this.resize()));},this._cancelResize=()=>{this._resizeId&&(cancelAnimationFrame(this._resizeId),this._resizeId=null);},this.resize=()=>{if(!this._resizeTo)return;this._cancelResize();let t,i;if(this._resizeTo===globalThis.window)t=globalThis.innerWidth,i=globalThis.innerHeight;else {let{clientWidth:s,clientHeight:n}=this._resizeTo;t=s,i=n;}this.renderer.resize(t,i),this.render();},this._resizeId=null,this._resizeTo=null,this.resizeTo=e.resizeTo||null;}static destroy(){globalThis.removeEventListener("resize",this.queueResize),this._cancelResize(),this._cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null;}};io.extension=x.Application;});exports.UPDATE_PRIORITY=void 0;var so=f(()=>{exports.UPDATE_PRIORITY=(r=>(r[r.INTERACTION=50]="INTERACTION",r[r.HIGH=25]="HIGH",r[r.NORMAL=0]="NORMAL",r[r.LOW=-25]="LOW",r[r.UTILITY=-50]="UTILITY",r))(exports.UPDATE_PRIORITY||{});});var Fs,Dy=f(()=>{Fs=class{constructor(e,t=null,i=0,s=false){this.next=null,this.previous=null,this._destroyed=false,this._fn=e,this._context=t,this.priority=i,this._once=s;}match(e,t=null){return this._fn===e&&this._context===t}emit(e){this._fn&&(this._context?this._fn.call(this._context,e):this._fn(e));let t=this.next;return this._once&&this.destroy(true),this._destroyed&&(this.next=null),t}connect(e){this.previous=e,e.next&&(e.next.previous=this),this.next=e.next,e.next=this;}destroy(e=false){this._destroyed=true,this._fn=null,this._context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);let t=this.next;return this.next=e?null:t,this.previous=null,t}};});var RA,Ie,Gs=f(()=>{so();Dy();RA=class Sr{constructor(){this.autoStart=false,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=false,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=false,this._lastFrame=-1,this._head=new Fs(null,null,1/0),this.deltaMS=1/Sr.targetFPMS,this.elapsedMS=1/Sr.targetFPMS,this._tick=e=>{this._requestId=null,this.started&&(this.update(e),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(e,t,i=exports.UPDATE_PRIORITY.NORMAL){return this._addListener(new Fs(e,t,i))}addOnce(e,t,i=exports.UPDATE_PRIORITY.NORMAL){return this._addListener(new Fs(e,t,i,true))}_addListener(e){let t=this._head.next,i=this._head;if(!t)e.connect(i);else {for(;t;){if(e.priority>t.priority){e.connect(i);break}i=t,t=t.next;}e.previous||e.connect(i);}return this._startIfPossible(),this}remove(e,t){let i=this._head.next;for(;i;)i.match(e,t)?i=i.destroy():i=i.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let e=0,t=this._head;for(;t=t.next;)e++;return e}start(){this.started||(this.started=true,this._requestIfNeeded());}stop(){this.started&&(this.started=false,this._cancelIfNeeded());}destroy(){if(!this._protected){this.stop();let e=this._head.next;for(;e;)e=e.destroy(true);this._head.destroy(),this._head=null;}}update(e=performance.now()){let t;if(e>this.lastTime){if(t=this.elapsedMS=e-this.lastTime,t>this._maxElapsedMS&&(t=this._maxElapsedMS),t*=this.speed,this._minElapsedMS){let n=e-this._lastFrame|0;if(n<this._minElapsedMS)return;this._lastFrame=e-n%this._minElapsedMS;}this.deltaMS=t,this.deltaTime=this.deltaMS*Sr.targetFPMS;let i=this._head,s=i.next;for(;s;)s=s.emit(this);i.next||this._cancelIfNeeded();}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=e;}get FPS(){return 1e3/this.elapsedMS}get minFPS(){return 1e3/this._maxElapsedMS}set minFPS(e){let t=Math.min(this.maxFPS,e),i=Math.min(Math.max(0,t)/1e3,Sr.targetFPMS);this._maxElapsedMS=1/i;}get maxFPS(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0}set maxFPS(e){if(e===0)this._minElapsedMS=0;else {let t=Math.max(this.minFPS,e);this._minElapsedMS=1/(t/1e3);}}static get shared(){if(!Sr._shared){let e=Sr._shared=new Sr;e.autoStart=true,e._protected=true;}return Sr._shared}static get system(){if(!Sr._system){let e=Sr._system=new Sr;e.autoStart=true,e._protected=true;}return Sr._system}};RA.targetFPMS=.06;Ie=RA;});var no,ky=f(()=>{B();so();Gs();no=class{static init(e){e=Object.assign({autoStart:true,sharedTicker:false},e),Object.defineProperty(this,"ticker",{set(t){this._ticker&&this._ticker.remove(this.render,this),this._ticker=t,t&&t.add(this.render,this,exports.UPDATE_PRIORITY.LOW);},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop();},this.start=()=>{this._ticker.start();},this._ticker=null,this.ticker=e.sharedTicker?Ie.shared:new Ie,e.autoStart&&this.start();}static destroy(){if(this._ticker){let e=this._ticker;this.ticker=null,e.destroy();}}};no.extension=x.Application;});var Oy=f(()=>{B();Iy();ky();V.add(io);V.add(no);});function N(...r){Fy!==MA&&(Fy++,Fy===MA?console.warn("PixiJS Warning: too many warnings, no more warnings will be reported to the console by PixiJS."):console.warn("PixiJS Warning: ",...r));}var Fy,MA,Be=f(()=>{Fy=0,MA=500;});var Gy,Fr,yp=f(()=>{so();Gs();Gy=class{constructor(){this.interactionFrequency=10,this._deltaTime=0,this._didMove=false,this._tickerAdded=false,this._pauseUpdate=true;}init(e){this.removeTickerListener(),this.events=e,this.interactionFrequency=10,this._deltaTime=0,this._didMove=false,this._tickerAdded=false,this._pauseUpdate=true;}get pauseUpdate(){return this._pauseUpdate}set pauseUpdate(e){this._pauseUpdate=e;}addTickerListener(){this._tickerAdded||!this.domElement||(Ie.system.add(this._tickerUpdate,this,exports.UPDATE_PRIORITY.INTERACTION),this._tickerAdded=true);}removeTickerListener(){this._tickerAdded&&(Ie.system.remove(this._tickerUpdate,this),this._tickerAdded=false);}pointerMoved(){this._didMove=true;}_update(){if(!this.domElement||this._pauseUpdate)return;if(this._didMove){this._didMove=false;return}let e=this.events._rootPointerEvent;this.events.supportsTouchEvents&&e.pointerType==="touch"||globalThis.document.dispatchEvent(this.events.supportsPointerEvents?new PointerEvent("pointermove",{clientX:e.clientX,clientY:e.clientY,pointerType:e.pointerType,pointerId:e.pointerId}):new MouseEvent("mousemove",{clientX:e.clientX,clientY:e.clientY}));}_tickerUpdate(e){this._deltaTime+=e.deltaTime,!(this._deltaTime<this.interactionFrequency)&&(this._deltaTime=0,this._update());}},Fr=new Gy;});var ii,Vc=f(()=>{cr();Nc();ii=class extends Ci{constructor(){super(...arguments),this.client=new me,this.movement=new me,this.offset=new me,this.global=new me,this.screen=new me;}get clientX(){return this.client.x}get clientY(){return this.client.y}get x(){return this.clientX}get y(){return this.clientY}get movementX(){return this.movement.x}get movementY(){return this.movement.y}get offsetX(){return this.offset.x}get offsetY(){return this.offset.y}get globalX(){return this.global.x}get globalY(){return this.global.y}get screenX(){return this.screen.x}get screenY(){return this.screen.y}getLocalPosition(e,t,i){return e.worldTransform.applyInverse(i||this.global,t)}getModifierState(e){return "getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(e)}initMouseEvent(e,t,i,s,n,o,a,u,l,c,h,d,p,m,b){throw new Error("Method not implemented.")}};});var Nt,vp=f(()=>{Vc();Nt=class extends ii{constructor(){super(...arguments),this.width=0,this.height=0,this.isPrimary=false;}getCoalescedEvents(){return this.type==="pointermove"||this.type==="mousemove"||this.type==="touchmove"?[this]:[]}getPredictedEvents(){throw new Error("getPredictedEvents is not supported!")}};});var Gr,Tp=f(()=>{Vc();Gr=class extends ii{constructor(){super(...arguments),this.DOM_DELTA_PIXEL=0,this.DOM_DELTA_LINE=1,this.DOM_DELTA_PAGE=2;}};Gr.DOM_DELTA_PIXEL=0;Gr.DOM_DELTA_LINE=1;Gr.DOM_DELTA_PAGE=2;});var JI,eD,zc,du,Uy=f(()=>{Ut();cr();Be();yp();Vc();vp();Tp();JI=2048,eD=new me,zc=new me,du=class{constructor(e){this.dispatch=new _e,this.moveOnAll=false,this.enableGlobalMoveEvents=true,this.mappingState={trackingData:{}},this.eventPool=new Map,this._allInteractiveElements=[],this._hitElements=[],this._isPointerMoveEvent=false,this.rootTarget=e,this.hitPruneFn=this.hitPruneFn.bind(this),this.hitTestFn=this.hitTestFn.bind(this),this.mapPointerDown=this.mapPointerDown.bind(this),this.mapPointerMove=this.mapPointerMove.bind(this),this.mapPointerOut=this.mapPointerOut.bind(this),this.mapPointerOver=this.mapPointerOver.bind(this),this.mapPointerUp=this.mapPointerUp.bind(this),this.mapPointerUpOutside=this.mapPointerUpOutside.bind(this),this.mapWheel=this.mapWheel.bind(this),this.mappingTable={},this.addEventMapping("pointerdown",this.mapPointerDown),this.addEventMapping("pointermove",this.mapPointerMove),this.addEventMapping("pointerout",this.mapPointerOut),this.addEventMapping("pointerleave",this.mapPointerOut),this.addEventMapping("pointerover",this.mapPointerOver),this.addEventMapping("pointerup",this.mapPointerUp),this.addEventMapping("pointerupoutside",this.mapPointerUpOutside),this.addEventMapping("wheel",this.mapWheel);}addEventMapping(e,t){this.mappingTable[e]||(this.mappingTable[e]=[]),this.mappingTable[e].push({fn:t,priority:0}),this.mappingTable[e].sort((i,s)=>i.priority-s.priority);}dispatchEvent(e,t){e.propagationStopped=false,e.propagationImmediatelyStopped=false,this.propagate(e,t),this.dispatch.emit(t||e.type,e);}mapEvent(e){if(!this.rootTarget)return;let t=this.mappingTable[e.type];if(t)for(let i=0,s=t.length;i<s;i++)t[i].fn(e);else N(`[EventBoundary]: Event mapping not defined for ${e.type}`);}hitTest(e,t){Fr.pauseUpdate=true;let s=this._isPointerMoveEvent&&this.enableGlobalMoveEvents?"hitTestMoveRecursive":"hitTestRecursive",n=this[s](this.rootTarget,this.rootTarget.eventMode,eD.set(e,t),this.hitTestFn,this.hitPruneFn);return n&&n[0]}propagate(e,t){if(!e.target)return;let i=e.composedPath();e.eventPhase=e.CAPTURING_PHASE;for(let s=0,n=i.length-1;s<n;s++)if(e.currentTarget=i[s],this.notifyTarget(e,t),e.propagationStopped||e.propagationImmediatelyStopped)return;if(e.eventPhase=e.AT_TARGET,e.currentTarget=e.target,this.notifyTarget(e,t),!(e.propagationStopped||e.propagationImmediatelyStopped)){e.eventPhase=e.BUBBLING_PHASE;for(let s=i.length-2;s>=0;s--)if(e.currentTarget=i[s],this.notifyTarget(e,t),e.propagationStopped||e.propagationImmediatelyStopped)return}}all(e,t,i=this._allInteractiveElements){if(i.length===0)return;e.eventPhase=e.BUBBLING_PHASE;let s=Array.isArray(t)?t:[t];for(let n=i.length-1;n>=0;n--)s.forEach(o=>{e.currentTarget=i[n],this.notifyTarget(e,o);});}propagationPath(e){let t=[e];for(let i=0;i<JI&&e!==this.rootTarget&&e.parent;i++){if(!e.parent)throw new Error("Cannot find propagation path to disconnected target");t.push(e.parent),e=e.parent;}return t.reverse(),t}hitTestMoveRecursive(e,t,i,s,n,o=false){let a=false;if(this._interactivePrune(e))return null;if((e.eventMode==="dynamic"||t==="dynamic")&&(Fr.pauseUpdate=false),e.interactiveChildren&&e.children){let c=e.children;for(let h=c.length-1;h>=0;h--){let d=c[h],p=this.hitTestMoveRecursive(d,this._isInteractive(t)?t:d.eventMode,i,s,n,o||n(e,i));if(p){if(p.length>0&&!p[p.length-1].parent)continue;let m=e.isInteractive();(p.length>0||m)&&(m&&this._allInteractiveElements.push(e),p.push(e)),this._hitElements.length===0&&(this._hitElements=p),a=true;}}}let u=this._isInteractive(t),l=e.isInteractive();return l&&l&&this._allInteractiveElements.push(e),o||this._hitElements.length>0?null:a?this._hitElements:u&&!n(e,i)&&s(e,i)?l?[e]:[]:null}hitTestRecursive(e,t,i,s,n){if(this._interactivePrune(e)||n(e,i))return null;if((e.eventMode==="dynamic"||t==="dynamic")&&(Fr.pauseUpdate=false),e.interactiveChildren&&e.children){let u=e.children,l=i;for(let c=u.length-1;c>=0;c--){let h=u[c],d=this.hitTestRecursive(h,this._isInteractive(t)?t:h.eventMode,l,s,n);if(d){if(d.length>0&&!d[d.length-1].parent)continue;let p=e.isInteractive();return (d.length>0||p)&&d.push(e),d}}}let o=this._isInteractive(t),a=e.isInteractive();return o&&s(e,i)?a?[e]:[]:null}_isInteractive(e){return e==="static"||e==="dynamic"}_interactivePrune(e){return !e||!e.visible||!e.renderable||!e.measurable||e.eventMode==="none"||e.eventMode==="passive"&&!e.interactiveChildren}hitPruneFn(e,t){if(e.hitArea&&(e.worldTransform.applyInverse(t,zc),!e.hitArea.contains(zc.x,zc.y)))return true;if(e.effects&&e.effects.length)for(let i=0;i<e.effects.length;i++){let s=e.effects[i];if(s.containsPoint&&!s.containsPoint(t,this.hitTestFn))return true}return false}hitTestFn(e,t){return e.hitArea?true:e?.containsPoint?(e.worldTransform.applyInverse(t,zc),e.containsPoint(zc)):false}notifyTarget(e,t){if(!e.currentTarget.isInteractive())return;t??(t=e.type);let i=`on${t}`;e.currentTarget[i]?.(e);let s=e.eventPhase===e.CAPTURING_PHASE||e.eventPhase===e.AT_TARGET?`${t}capture`:t;this._notifyListeners(e,s),e.eventPhase===e.AT_TARGET&&this._notifyListeners(e,t);}mapPointerDown(e){if(!(e instanceof Nt)){N("EventBoundary cannot map a non-pointer event as a pointer event");return}let t=this.createPointerEvent(e);if(this.dispatchEvent(t,"pointerdown"),t.pointerType==="touch")this.dispatchEvent(t,"touchstart");else if(t.pointerType==="mouse"||t.pointerType==="pen"){let s=t.button===2;this.dispatchEvent(t,s?"rightdown":"mousedown");}let i=this.trackingData(e.pointerId);i.pressTargetsByButton[e.button]=t.composedPath(),this.freeEvent(t);}mapPointerMove(e){if(!(e instanceof Nt)){N("EventBoundary cannot map a non-pointer event as a pointer event");return}this._allInteractiveElements.length=0,this._hitElements.length=0,this._isPointerMoveEvent=true;let t=this.createPointerEvent(e);this._isPointerMoveEvent=false;let i=t.pointerType==="mouse"||t.pointerType==="pen",s=this.trackingData(e.pointerId),n=this.findMountedTarget(s.overTargets);if(s.overTargets?.length>0&&n!==t.target){let u=e.type==="mousemove"?"mouseout":"pointerout",l=this.createPointerEvent(e,u,n);if(this.dispatchEvent(l,"pointerout"),i&&this.dispatchEvent(l,"mouseout"),!t.composedPath().includes(n)){let c=this.createPointerEvent(e,"pointerleave",n);for(c.eventPhase=c.AT_TARGET;c.target&&!t.composedPath().includes(c.target);)c.currentTarget=c.target,this.notifyTarget(c),i&&this.notifyTarget(c,"mouseleave"),c.target=c.target.parent;this.freeEvent(c);}this.freeEvent(l);}if(n!==t.target){let u=e.type==="mousemove"?"mouseover":"pointerover",l=this.clonePointerEvent(t,u);this.dispatchEvent(l,"pointerover"),i&&this.dispatchEvent(l,"mouseover");let c=n?.parent;for(;c&&c!==this.rootTarget.parent&&c!==t.target;)c=c.parent;if(!c||c===this.rootTarget.parent){let d=this.clonePointerEvent(t,"pointerenter");for(d.eventPhase=d.AT_TARGET;d.target&&d.target!==n&&d.target!==this.rootTarget.parent;)d.currentTarget=d.target,this.notifyTarget(d),i&&this.notifyTarget(d,"mouseenter"),d.target=d.target.parent;this.freeEvent(d);}this.freeEvent(l);}let o=[],a=this.enableGlobalMoveEvents??true;this.moveOnAll?o.push("pointermove"):this.dispatchEvent(t,"pointermove"),a&&o.push("globalpointermove"),t.pointerType==="touch"&&(this.moveOnAll?o.splice(1,0,"touchmove"):this.dispatchEvent(t,"touchmove"),a&&o.push("globaltouchmove")),i&&(this.moveOnAll?o.splice(1,0,"mousemove"):this.dispatchEvent(t,"mousemove"),a&&o.push("globalmousemove"),this.cursor=t.target?.cursor),o.length>0&&this.all(t,o),this._allInteractiveElements.length=0,this._hitElements.length=0,s.overTargets=t.composedPath(),this.freeEvent(t);}mapPointerOver(e){if(!(e instanceof Nt)){N("EventBoundary cannot map a non-pointer event as a pointer event");return}let t=this.trackingData(e.pointerId),i=this.createPointerEvent(e),s=i.pointerType==="mouse"||i.pointerType==="pen";this.dispatchEvent(i,"pointerover"),s&&this.dispatchEvent(i,"mouseover"),i.pointerType==="mouse"&&(this.cursor=i.target?.cursor);let n=this.clonePointerEvent(i,"pointerenter");for(n.eventPhase=n.AT_TARGET;n.target&&n.target!==this.rootTarget.parent;)n.currentTarget=n.target,this.notifyTarget(n),s&&this.notifyTarget(n,"mouseenter"),n.target=n.target.parent;t.overTargets=i.composedPath(),this.freeEvent(i),this.freeEvent(n);}mapPointerOut(e){if(!(e instanceof Nt)){N("EventBoundary cannot map a non-pointer event as a pointer event");return}let t=this.trackingData(e.pointerId);if(t.overTargets){let i=e.pointerType==="mouse"||e.pointerType==="pen",s=this.findMountedTarget(t.overTargets),n=this.createPointerEvent(e,"pointerout",s);this.dispatchEvent(n),i&&this.dispatchEvent(n,"mouseout");let o=this.createPointerEvent(e,"pointerleave",s);for(o.eventPhase=o.AT_TARGET;o.target&&o.target!==this.rootTarget.parent;)o.currentTarget=o.target,this.notifyTarget(o),i&&this.notifyTarget(o,"mouseleave"),o.target=o.target.parent;t.overTargets=null,this.freeEvent(n),this.freeEvent(o);}this.cursor=null;}mapPointerUp(e){if(!(e instanceof Nt)){N("EventBoundary cannot map a non-pointer event as a pointer event");return}let t=performance.now(),i=this.createPointerEvent(e);if(this.dispatchEvent(i,"pointerup"),i.pointerType==="touch")this.dispatchEvent(i,"touchend");else if(i.pointerType==="mouse"||i.pointerType==="pen"){let a=i.button===2;this.dispatchEvent(i,a?"rightup":"mouseup");}let s=this.trackingData(e.pointerId),n=this.findMountedTarget(s.pressTargetsByButton[e.button]),o=n;if(n&&!i.composedPath().includes(n)){let a=n;for(;a&&!i.composedPath().includes(a);){if(i.currentTarget=a,this.notifyTarget(i,"pointerupoutside"),i.pointerType==="touch")this.notifyTarget(i,"touchendoutside");else if(i.pointerType==="mouse"||i.pointerType==="pen"){let u=i.button===2;this.notifyTarget(i,u?"rightupoutside":"mouseupoutside");}a=a.parent;}delete s.pressTargetsByButton[e.button],o=a;}if(o){let a=this.clonePointerEvent(i,"click");a.target=o,a.path=null,s.clicksByButton[e.button]||(s.clicksByButton[e.button]={clickCount:0,target:a.target,timeStamp:t});let u=s.clicksByButton[e.button];if(u.target===a.target&&t-u.timeStamp<200?++u.clickCount:u.clickCount=1,u.target=a.target,u.timeStamp=t,a.detail=u.clickCount,a.pointerType==="mouse"){let l=a.button===2;this.dispatchEvent(a,l?"rightclick":"click");}else a.pointerType==="touch"&&this.dispatchEvent(a,"tap");this.dispatchEvent(a,"pointertap"),this.freeEvent(a);}this.freeEvent(i);}mapPointerUpOutside(e){if(!(e instanceof Nt)){N("EventBoundary cannot map a non-pointer event as a pointer event");return}let t=this.trackingData(e.pointerId),i=this.findMountedTarget(t.pressTargetsByButton[e.button]),s=this.createPointerEvent(e);if(i){let n=i;for(;n;)s.currentTarget=n,this.notifyTarget(s,"pointerupoutside"),s.pointerType==="touch"?this.notifyTarget(s,"touchendoutside"):(s.pointerType==="mouse"||s.pointerType==="pen")&&this.notifyTarget(s,s.button===2?"rightupoutside":"mouseupoutside"),n=n.parent;delete t.pressTargetsByButton[e.button];}this.freeEvent(s);}mapWheel(e){if(!(e instanceof Gr)){N("EventBoundary cannot map a non-wheel event as a wheel event");return}let t=this.createWheelEvent(e);this.dispatchEvent(t),this.freeEvent(t);}findMountedTarget(e){if(!e)return null;let t=e[0];for(let i=1;i<e.length&&e[i].parent===t;i++)t=e[i];return t}createPointerEvent(e,t,i){let s=this.allocateEvent(Nt);return this.copyPointerData(e,s),this.copyMouseData(e,s),this.copyData(e,s),s.nativeEvent=e.nativeEvent,s.originalEvent=e,s.target=i??this.hitTest(s.global.x,s.global.y)??this._hitElements[0],typeof t=="string"&&(s.type=t),s}createWheelEvent(e){let t=this.allocateEvent(Gr);return this.copyWheelData(e,t),this.copyMouseData(e,t),this.copyData(e,t),t.nativeEvent=e.nativeEvent,t.originalEvent=e,t.target=this.hitTest(t.global.x,t.global.y),t}clonePointerEvent(e,t){let i=this.allocateEvent(Nt);return i.nativeEvent=e.nativeEvent,i.originalEvent=e.originalEvent,this.copyPointerData(e,i),this.copyMouseData(e,i),this.copyData(e,i),i.target=e.target,i.path=e.composedPath().slice(),i.type=t??i.type,i}copyWheelData(e,t){t.deltaMode=e.deltaMode,t.deltaX=e.deltaX,t.deltaY=e.deltaY,t.deltaZ=e.deltaZ;}copyPointerData(e,t){e instanceof Nt&&t instanceof Nt&&(t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist);}copyMouseData(e,t){e instanceof ii&&t instanceof ii&&(t.altKey=e.altKey,t.button=e.button,t.buttons=e.buttons,t.client.copyFrom(e.client),t.ctrlKey=e.ctrlKey,t.metaKey=e.metaKey,t.movement.copyFrom(e.movement),t.screen.copyFrom(e.screen),t.shiftKey=e.shiftKey,t.global.copyFrom(e.global));}copyData(e,t){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=performance.now(),t.type=e.type,t.detail=e.detail,t.view=e.view,t.which=e.which,t.layer.copyFrom(e.layer),t.page.copyFrom(e.page);}trackingData(e){return this.mappingState.trackingData[e]||(this.mappingState.trackingData[e]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[e]}allocateEvent(e){this.eventPool.has(e)||this.eventPool.set(e,[]);let t=this.eventPool.get(e).pop()||new e(this);return t.eventPhase=t.NONE,t.currentTarget=null,t.defaultPrevented=false,t.path=null,t.target=null,t}freeEvent(e){if(e.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!");let t=e.constructor;this.eventPool.has(t)||this.eventPool.set(t,[]),this.eventPool.get(t).push(e);}_notifyListeners(e,t){let i=e.currentTarget._events[t];if(i)if("fn"in i)i.once&&e.currentTarget.removeListener(t,i.fn,void 0,true),i.fn.call(i.context,e);else for(let s=0,n=i.length;s<n&&!e.propagationImmediatelyStopped;s++)i[s].once&&e.currentTarget.removeListener(t,i[s].fn,void 0,true),i[s].fn.call(i[s].context,e);}};});var tD,rD,Ny,fu,Sp=f(()=>{B();Uy();yp();vp();Tp();tD=1,rD={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},Ny=class Ly{constructor(e){this.supportsTouchEvents="ontouchstart"in globalThis,this.supportsPointerEvents=!!globalThis.PointerEvent,this.domElement=null,this.resolution=1,this.renderer=e,this.rootBoundary=new du(null),Fr.init(this),this.autoPreventDefault=true,this._eventsAdded=false,this._rootPointerEvent=new Nt(null),this._rootWheelEvent=new Gr(null),this.cursorStyles={default:"inherit",pointer:"pointer"},this.features=new Proxy({...Ly.defaultEventFeatures},{set:(t,i,s)=>(i==="globalMove"&&(this.rootBoundary.enableGlobalMoveEvents=s),t[i]=s,true)}),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerMove=this._onPointerMove.bind(this),this._onPointerUp=this._onPointerUp.bind(this),this._onPointerOverOut=this._onPointerOverOut.bind(this),this.onWheel=this.onWheel.bind(this);}static get defaultEventMode(){return this._defaultEventMode}init(e){let{canvas:t,resolution:i}=this.renderer;this.setTargetElement(t),this.resolution=i,Ly._defaultEventMode=e.eventMode??"passive",Object.assign(this.features,e.eventFeatures??{}),this.rootBoundary.enableGlobalMoveEvents=this.features.globalMove;}resolutionChange(e){this.resolution=e;}destroy(){this.setTargetElement(null),this.renderer=null,this._currentCursor=null;}setCursor(e){e||(e="default");let t=true;if(globalThis.OffscreenCanvas&&this.domElement instanceof OffscreenCanvas&&(t=false),this._currentCursor===e)return;this._currentCursor=e;let i=this.cursorStyles[e];if(i)switch(typeof i){case "string":t&&(this.domElement.style.cursor=i);break;case "function":i(e);break;case "object":t&&Object.assign(this.domElement.style,i);break}else t&&typeof e=="string"&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,e)&&(this.domElement.style.cursor=e);}get pointer(){return this._rootPointerEvent}_onPointerDown(e){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;let t=this._normalizeToPointerData(e);this.autoPreventDefault&&t[0].isNormalized&&(e.cancelable||!("cancelable"in e))&&e.preventDefault();for(let i=0,s=t.length;i<s;i++){let n=t[i],o=this._bootstrapEvent(this._rootPointerEvent,n);this.rootBoundary.mapEvent(o);}this.setCursor(this.rootBoundary.cursor);}_onPointerMove(e){if(!this.features.move)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,Fr.pointerMoved();let t=this._normalizeToPointerData(e);for(let i=0,s=t.length;i<s;i++){let n=this._bootstrapEvent(this._rootPointerEvent,t[i]);this.rootBoundary.mapEvent(n);}this.setCursor(this.rootBoundary.cursor);}_onPointerUp(e){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;let t=e.target;e.composedPath&&e.composedPath().length>0&&(t=e.composedPath()[0]);let i=t!==this.domElement?"outside":"",s=this._normalizeToPointerData(e);for(let n=0,o=s.length;n<o;n++){let a=this._bootstrapEvent(this._rootPointerEvent,s[n]);a.type+=i,this.rootBoundary.mapEvent(a);}this.setCursor(this.rootBoundary.cursor);}_onPointerOverOut(e){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;let t=this._normalizeToPointerData(e);for(let i=0,s=t.length;i<s;i++){let n=this._bootstrapEvent(this._rootPointerEvent,t[i]);this.rootBoundary.mapEvent(n);}this.setCursor(this.rootBoundary.cursor);}onWheel(e){if(!this.features.wheel)return;let t=this.normalizeWheelEvent(e);this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,this.rootBoundary.mapEvent(t);}setTargetElement(e){this._removeEvents(),this.domElement=e,Fr.domElement=e,this._addEvents();}_addEvents(){if(this._eventsAdded||!this.domElement)return;Fr.addTickerListener();let e=this.domElement.style;e&&(globalThis.navigator.msPointerEnabled?(e.msContentZooming="none",e.msTouchAction="none"):this.supportsPointerEvents&&(e.touchAction="none")),this.supportsPointerEvents?(globalThis.document.addEventListener("pointermove",this._onPointerMove,true),this.domElement.addEventListener("pointerdown",this._onPointerDown,true),this.domElement.addEventListener("pointerleave",this._onPointerOverOut,true),this.domElement.addEventListener("pointerover",this._onPointerOverOut,true),globalThis.addEventListener("pointerup",this._onPointerUp,true)):(globalThis.document.addEventListener("mousemove",this._onPointerMove,true),this.domElement.addEventListener("mousedown",this._onPointerDown,true),this.domElement.addEventListener("mouseout",this._onPointerOverOut,true),this.domElement.addEventListener("mouseover",this._onPointerOverOut,true),globalThis.addEventListener("mouseup",this._onPointerUp,true),this.supportsTouchEvents&&(this.domElement.addEventListener("touchstart",this._onPointerDown,true),this.domElement.addEventListener("touchend",this._onPointerUp,true),this.domElement.addEventListener("touchmove",this._onPointerMove,true))),this.domElement.addEventListener("wheel",this.onWheel,{passive:true,capture:true}),this._eventsAdded=true;}_removeEvents(){if(!this._eventsAdded||!this.domElement)return;Fr.removeTickerListener();let e=this.domElement.style;e&&(globalThis.navigator.msPointerEnabled?(e.msContentZooming="",e.msTouchAction=""):this.supportsPointerEvents&&(e.touchAction="")),this.supportsPointerEvents?(globalThis.document.removeEventListener("pointermove",this._onPointerMove,true),this.domElement.removeEventListener("pointerdown",this._onPointerDown,true),this.domElement.removeEventListener("pointerleave",this._onPointerOverOut,true),this.domElement.removeEventListener("pointerover",this._onPointerOverOut,true),globalThis.removeEventListener("pointerup",this._onPointerUp,true)):(globalThis.document.removeEventListener("mousemove",this._onPointerMove,true),this.domElement.removeEventListener("mousedown",this._onPointerDown,true),this.domElement.removeEventListener("mouseout",this._onPointerOverOut,true),this.domElement.removeEventListener("mouseover",this._onPointerOverOut,true),globalThis.removeEventListener("mouseup",this._onPointerUp,true),this.supportsTouchEvents&&(this.domElement.removeEventListener("touchstart",this._onPointerDown,true),this.domElement.removeEventListener("touchend",this._onPointerUp,true),this.domElement.removeEventListener("touchmove",this._onPointerMove,true))),this.domElement.removeEventListener("wheel",this.onWheel,true),this.domElement=null,this._eventsAdded=false;}mapPositionToPoint(e,t,i){let s=this.domElement.isConnected?this.domElement.getBoundingClientRect():{width:this.domElement.width,height:this.domElement.height,left:0,top:0},n=1/this.resolution;e.x=(t-s.left)*(this.domElement.width/s.width)*n,e.y=(i-s.top)*(this.domElement.height/s.height)*n;}_normalizeToPointerData(e){let t=[];if(this.supportsTouchEvents&&e instanceof TouchEvent)for(let i=0,s=e.changedTouches.length;i<s;i++){let n=e.changedTouches[i];typeof n.button>"u"&&(n.button=0),typeof n.buttons>"u"&&(n.buttons=1),typeof n.isPrimary>"u"&&(n.isPrimary=e.touches.length===1&&e.type==="touchstart"),typeof n.width>"u"&&(n.width=n.radiusX||1),typeof n.height>"u"&&(n.height=n.radiusY||1),typeof n.tiltX>"u"&&(n.tiltX=0),typeof n.tiltY>"u"&&(n.tiltY=0),typeof n.pointerType>"u"&&(n.pointerType="touch"),typeof n.pointerId>"u"&&(n.pointerId=n.identifier||0),typeof n.pressure>"u"&&(n.pressure=n.force||.5),typeof n.twist>"u"&&(n.twist=0),typeof n.tangentialPressure>"u"&&(n.tangentialPressure=0),typeof n.layerX>"u"&&(n.layerX=n.offsetX=n.clientX),typeof n.layerY>"u"&&(n.layerY=n.offsetY=n.clientY),n.isNormalized=true,n.type=e.type,t.push(n);}else if(!globalThis.MouseEvent||e instanceof MouseEvent&&(!this.supportsPointerEvents||!(e instanceof globalThis.PointerEvent))){let i=e;typeof i.isPrimary>"u"&&(i.isPrimary=true),typeof i.width>"u"&&(i.width=1),typeof i.height>"u"&&(i.height=1),typeof i.tiltX>"u"&&(i.tiltX=0),typeof i.tiltY>"u"&&(i.tiltY=0),typeof i.pointerType>"u"&&(i.pointerType="mouse"),typeof i.pointerId>"u"&&(i.pointerId=tD),typeof i.pressure>"u"&&(i.pressure=.5),typeof i.twist>"u"&&(i.twist=0),typeof i.tangentialPressure>"u"&&(i.tangentialPressure=0),i.isNormalized=true,t.push(i);}else t.push(e);return t}normalizeWheelEvent(e){let t=this._rootWheelEvent;return this._transferMouseData(t,e),t.deltaX=e.deltaX,t.deltaY=e.deltaY,t.deltaZ=e.deltaZ,t.deltaMode=e.deltaMode,this.mapPositionToPoint(t.screen,e.clientX,e.clientY),t.global.copyFrom(t.screen),t.offset.copyFrom(t.screen),t.nativeEvent=e,t.type=e.type,t}_bootstrapEvent(e,t){return e.originalEvent=null,e.nativeEvent=t,e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist,this._transferMouseData(e,t),this.mapPositionToPoint(e.screen,t.clientX,t.clientY),e.global.copyFrom(e.screen),e.offset.copyFrom(e.screen),e.isTrusted=t.isTrusted,e.type==="pointerleave"&&(e.type="pointerout"),e.type.startsWith("mouse")&&(e.type=e.type.replace("mouse","pointer")),e.type.startsWith("touch")&&(e.type=rD[e.type]||e.type),e}_transferMouseData(e,t){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=performance.now(),e.type=t.type,e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.client.x=t.clientX,e.client.y=t.clientY,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.movement.x=t.movementX,e.movement.y=t.movementY,e.page.x=t.pageX,e.page.y=t.pageY,e.relatedTarget=null,e.shiftKey=t.shiftKey;}};Ny.extension={name:"events",type:[x.WebGLSystem,x.CanvasSystem,x.WebGPUSystem],priority:-1};Ny.defaultEventFeatures={move:true,globalMove:true,click:true,wheel:true};fu=Ny;});var Ep,Hy=f(()=>{Sp();Nc();Ep={onclick:null,onmousedown:null,onmouseenter:null,onmouseleave:null,onmousemove:null,onglobalmousemove:null,onmouseout:null,onmouseover:null,onmouseup:null,onmouseupoutside:null,onpointercancel:null,onpointerdown:null,onpointerenter:null,onpointerleave:null,onpointermove:null,onglobalpointermove:null,onpointerout:null,onpointerover:null,onpointertap:null,onpointerup:null,onpointerupoutside:null,onrightclick:null,onrightdown:null,onrightup:null,onrightupoutside:null,ontap:null,ontouchcancel:null,ontouchend:null,ontouchendoutside:null,ontouchmove:null,onglobaltouchmove:null,ontouchstart:null,onwheel:null,get interactive(){return this.eventMode==="dynamic"||this.eventMode==="static"},set interactive(r){this.eventMode=r?"static":"passive";},_internalEventMode:void 0,get eventMode(){return this._internalEventMode??fu.defaultEventMode},set eventMode(r){this._internalEventMode=r;},isInteractive(){return this.eventMode==="static"||this.eventMode==="dynamic"},interactiveChildren:true,hitArea:null,addEventListener(r,e,t){let i=typeof t=="boolean"&&t||typeof t=="object"&&t.capture,s=typeof t=="object"?t.signal:void 0,n=typeof t=="object"?t.once===true:false,o=typeof e=="function"?void 0:e;r=i?`${r}capture`:r;let a=typeof e=="function"?e:e.handleEvent,u=this;s&&s.addEventListener("abort",()=>{u.off(r,a,o);}),n?u.once(r,a,o):u.on(r,a,o);},removeEventListener(r,e,t){let i=typeof t=="boolean"&&t||typeof t=="object"&&t.capture,s=typeof e=="function"?void 0:e;r=i?`${r}capture`:r,e=typeof e=="function"?e:e.handleEvent,this.off(r,e,s);},dispatchEvent(r){if(!(r instanceof Ci))throw new Error("Container cannot propagate events outside of the Federated Events API");return r.defaultPrevented=false,r.path=null,r.target=this,r.manager.dispatchEvent(r),!r.defaultPrevented}};});var IA=f(()=>{B();hr();Sp();Hy();V.add(fu);V.mixin(ue,Ep);});var oo,Vy=f(()=>{B();oo=class{constructor(e){this._attachedDomElements=[],this._renderer=e,this._renderer.runners.postrender.add(this),this._domElement=document.createElement("div"),this._domElement.style.position="absolute",this._domElement.style.top="0",this._domElement.style.left="0",this._domElement.style.pointerEvents="none",this._domElement.style.zIndex="1000";}addRenderable(e,t){this._attachedDomElements.includes(e)||this._attachedDomElements.push(e);}updateRenderable(e){}validateRenderable(e){return true}postrender(){let e=this._attachedDomElements;if(e.length===0){this._domElement.remove();return}let t=this._renderer.view.canvas;this._domElement.parentNode!==t.parentNode&&t.parentNode?.appendChild(this._domElement);let i=parseFloat(t.style.width)/t.width*this._renderer.resolution,s=parseFloat(t.style.height)/t.height*this._renderer.resolution;this._domElement.style.transform=`translate(${t.offsetLeft}px, ${t.offsetTop}px) scale(${i}, ${s})`;for(let n=0;n<e.length;n++){let o=e[n],a=o.element;if(!o.parent||o.globalDisplayStatus<7)a?.remove(),e.splice(n,1),n--;else {this._domElement.contains(a)||(a.style.position="absolute",a.style.pointerEvents="auto",this._domElement.appendChild(a));let u=o.worldTransform,l=o._anchor,c=o.width*l.x,h=o.height*l.y;a.style.transformOrigin=`${c}px ${h}px`,a.style.transform=`matrix(${u.a}, ${u.b}, ${u.c}, ${u.d}, ${u.tx-c}, ${u.ty-h})`,a.style.opacity=o.groupAlpha.toString();}}}destroy(){this._renderer.runners.postrender.remove(this);for(let e=0;e<this._attachedDomElements.length;e++)this._attachedDomElements[e].element?.remove();this._attachedDomElements.length=0,this._domElement.remove(),this._renderer=null;}};oo.extension={type:[x.WebGLPipes,x.WebGPUPipes,x.CanvasPipes],name:"dom"};});var lt,si=f(()=>{Lt();hr();lt=class extends ue{constructor(e){super(e),this.canBundle=true,this.allowChildren=false,this._roundPixels=0,this._lastUsed=-1,this._gpuData=Object.create(null),this._bounds=new Ae(0,1,0,0),this._boundsDirty=true;}get bounds(){return this._boundsDirty?(this.updateBounds(),this._boundsDirty=false,this._bounds):this._bounds}get roundPixels(){return !!this._roundPixels}set roundPixels(e){this._roundPixels=e?1:0;}containsPoint(e){let t=this.bounds,{x:i,y:s}=e;return i>=t.minX&&i<=t.maxX&&s>=t.minY&&s<=t.maxY}onViewUpdate(){if(this._didViewChangeTick++,this._boundsDirty=true,this.didViewUpdate)return;this.didViewUpdate=true;let e=this.renderGroup||this.parentRenderGroup;e&&e.onChildViewUpdate(this);}destroy(e){super.destroy(e),this._bounds=null;for(let t in this._gpuData)this._gpuData[t].destroy?.();this._gpuData=null;}collectRenderablesSimple(e,t,i){let{renderPipes:s}=t;s.blendMode.setBlendMode(this,this.groupBlendMode,e),s[this.renderPipeId].addRenderable(this,e),this.didViewUpdate=false;let o=this.children,a=o.length;for(let u=0;u<a;u++)o[u].collectRenderables(e,t,i);}};});var Cp,DA=f(()=>{cr();si();Cp=class extends lt{constructor(e={}){let{element:t,anchor:i,...s}=e;super({label:"DOMContainer",...s}),this.renderPipeId="dom",this.batched=false,this._anchor=new me(0,0),i&&(this.anchor=i),this.element=e.element||document.createElement("div");}get anchor(){return this._anchor}set anchor(e){typeof e=="number"?this._anchor.set(e):this._anchor.copyFrom(e);}set element(e){this._element!==e&&(this._element=e,this.onViewUpdate());}get element(){return this._element}updateBounds(){let e=this._bounds,t=this._element;if(!t){e.minX=0,e.minY=0,e.maxX=0,e.maxY=0;return}let{offsetWidth:i,offsetHeight:s}=t;e.minX=0,e.maxX=i,e.minY=0,e.maxY=s;}destroy(e=false){super.destroy(e),this._element?.parentNode?.removeChild(this._element),this._element=null,this._anchor=null;}};});var kA=f(()=>{B();Vy();V.add(oo);});var ze,Er=f(()=>{ze=(r=>(r[r.Low=0]="Low",r[r.Normal=1]="Normal",r[r.High=2]="High",r))(ze||{});});var Ap,zy=f(()=>{Ap={createCanvas:(r,e)=>{let t=document.createElement("canvas");return t.width=r,t.height=e,t},getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(r,e)=>fetch(r,e),parseXML:r=>new DOMParser().parseFromString(r,"text/xml")};});var OA,j,Fe=f(()=>{zy();OA=Ap,j={get(){return OA},set(r){OA=r;}};});function ni(r){if(typeof r!="string")throw new TypeError(`Path must be a string. Received ${JSON.stringify(r)}`)}function Wc(r){return r.split("?")[0].split("#")[0]}function iD(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function sD(r,e,t){return r.replace(new RegExp(iD(e),"g"),t)}function nD(r,e){let t="",i=0,s=-1,n=0,o=-1;for(let a=0;a<=r.length;++a){if(a<r.length)o=r.charCodeAt(a);else {if(o===47)break;o=47;}if(o===47){if(!(s===a-1||n===1))if(s!==a-1&&n===2){if(t.length<2||i!==2||t.charCodeAt(t.length-1)!==46||t.charCodeAt(t.length-2)!==46){if(t.length>2){let u=t.lastIndexOf("/");if(u!==t.length-1){u===-1?(t="",i=0):(t=t.slice(0,u),i=t.length-1-t.lastIndexOf("/")),s=a,n=0;continue}}else if(t.length===2||t.length===1){t="",i=0,s=a,n=0;continue}}}else t.length>0?t+=`/${r.slice(s+1,a)}`:t=r.slice(s+1,a),i=a-s-1;s=a,n=0;}else o===46&&n!==-1?++n:n=-1;}return t}var We,Us=f(()=>{Fe();We={toPosix(r){return sD(r,"\\","/")},isUrl(r){return /^https?:/.test(this.toPosix(r))},isDataUrl(r){return /^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(r)},isBlobUrl(r){return r.startsWith("blob:")},hasProtocol(r){return /^[^/:]+:/.test(this.toPosix(r))},getProtocol(r){ni(r),r=this.toPosix(r);let e=/^file:\/\/\//.exec(r);if(e)return e[0];let t=/^[^/:]+:\/{0,2}/.exec(r);return t?t[0]:""},toAbsolute(r,e,t){if(ni(r),this.isDataUrl(r)||this.isBlobUrl(r))return r;let i=Wc(this.toPosix(e??j.get().getBaseUrl())),s=Wc(this.toPosix(t??this.rootname(i)));return r=this.toPosix(r),r.startsWith("/")?We.join(s,r.slice(1)):this.isAbsolute(r)?r:this.join(i,r)},normalize(r){if(ni(r),r.length===0)return ".";if(this.isDataUrl(r)||this.isBlobUrl(r))return r;r=this.toPosix(r);let e="",t=r.startsWith("/");this.hasProtocol(r)&&(e=this.rootname(r),r=r.slice(e.length));let i=r.endsWith("/");return r=nD(r),r.length>0&&i&&(r+="/"),t?`/${r}`:e+r},isAbsolute(r){return ni(r),r=this.toPosix(r),this.hasProtocol(r)?true:r.startsWith("/")},join(...r){if(r.length===0)return ".";let e;for(let t=0;t<r.length;++t){let i=r[t];if(ni(i),i.length>0)if(e===void 0)e=i;else {let s=r[t-1]??"";this.joinExtensions.includes(this.extname(s).toLowerCase())?e+=`/../${i}`:e+=`/${i}`;}}return e===void 0?".":this.normalize(e)},dirname(r){if(ni(r),r.length===0)return ".";r=this.toPosix(r);let e=r.charCodeAt(0),t=e===47,i=-1,s=true,n=this.getProtocol(r),o=r;r=r.slice(n.length);for(let a=r.length-1;a>=1;--a)if(e=r.charCodeAt(a),e===47){if(!s){i=a;break}}else s=false;return i===-1?t?"/":this.isUrl(o)?n+r:n:t&&i===1?"//":n+r.slice(0,i)},rootname(r){ni(r),r=this.toPosix(r);let e="";if(r.startsWith("/")?e="/":e=this.getProtocol(r),this.isUrl(r)){let t=r.indexOf("/",e.length);t!==-1?e=r.slice(0,t):e=r,e.endsWith("/")||(e+="/");}return e},basename(r,e){ni(r),e&&ni(e),r=Wc(this.toPosix(r));let t=0,i=-1,s=true,n;if(e!==void 0&&e.length>0&&e.length<=r.length){if(e.length===r.length&&e===r)return "";let o=e.length-1,a=-1;for(n=r.length-1;n>=0;--n){let u=r.charCodeAt(n);if(u===47){if(!s){t=n+1;break}}else a===-1&&(s=false,a=n+1),o>=0&&(u===e.charCodeAt(o)?--o===-1&&(i=n):(o=-1,i=a));}return t===i?i=a:i===-1&&(i=r.length),r.slice(t,i)}for(n=r.length-1;n>=0;--n)if(r.charCodeAt(n)===47){if(!s){t=n+1;break}}else i===-1&&(s=false,i=n+1);return i===-1?"":r.slice(t,i)},extname(r){ni(r),r=Wc(this.toPosix(r));let e=-1,t=0,i=-1,s=true,n=0;for(let o=r.length-1;o>=0;--o){let a=r.charCodeAt(o);if(a===47){if(!s){t=o+1;break}continue}i===-1&&(s=false,i=o+1),a===46?e===-1?e=o:n!==1&&(n=1):e!==-1&&(n=-1);}return e===-1||i===-1||n===0||n===1&&e===i-1&&e===t+1?"":r.slice(e,i)},parse(r){ni(r);let e={root:"",dir:"",base:"",ext:"",name:""};if(r.length===0)return e;r=Wc(this.toPosix(r));let t=r.charCodeAt(0),i=this.isAbsolute(r),s;e.root=this.rootname(r),i||this.hasProtocol(r)?s=1:s=0;let o=-1,a=0,u=-1,l=true,c=r.length-1,h=0;for(;c>=s;--c){if(t=r.charCodeAt(c),t===47){if(!l){a=c+1;break}continue}u===-1&&(l=false,u=c+1),t===46?o===-1?o=c:h!==1&&(h=1):o!==-1&&(h=-1);}return o===-1||u===-1||h===0||h===1&&o===u-1&&o===a+1?u!==-1&&(a===0&&i?e.base=e.name=r.slice(1,u):e.base=e.name=r.slice(a,u)):(a===0&&i?(e.name=r.slice(1,o),e.base=r.slice(1,u)):(e.name=r.slice(a,o),e.base=r.slice(a,u)),e.ext=r.slice(o,u)),e.dir=this.dirname(r),e},sep:"/",delimiter:":",joinExtensions:[".html"]};});var Ht,pu=f(()=>{Ht=(r,e,t=false)=>(Array.isArray(r)||(r=[r]),e?r.map(i=>typeof i=="string"||t?e(i):i):r);});function FA(r,e,t,i,s){let n=e[t];for(let o=0;o<n.length;o++){let a=n[o];t<e.length-1?FA(r.replace(i[t],a),e,t+1,i,s):s.push(r.replace(i[t],a));}}function Pp(r){let e=/\{(.*?)\}/g,t=r.match(e),i=[];if(t){let s=[];t.forEach(n=>{let o=n.substring(1,n.length-1).split(",");s.push(o);}),FA(r,s,0,t,i);}else i.push(r);return i}var Wy=f(()=>{});var ss,Xc=f(()=>{ss=r=>!Array.isArray(r);});function Xy(r){return r.split(".").pop().split("?").shift().split("#").shift()}var Vt,Ls=f(()=>{Be();Us();pu();Wy();Xc();Vt=class{constructor(){this._defaultBundleIdentifierOptions={connector:"-",createBundleAssetId:(e,t)=>`${e}${this._bundleIdConnector}${t}`,extractAssetIdFromBundle:(e,t)=>t.replace(`${e}${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(e){if(this._bundleIdConnector=e.connector??this._bundleIdConnector,this._createBundleAssetId=e.createBundleAssetId??this._createBundleAssetId,this._extractAssetIdFromBundle=e.extractAssetIdFromBundle??this._extractAssetIdFromBundle,this._extractAssetIdFromBundle("foo",this._createBundleAssetId("foo","bar"))!=="bar")throw new Error("[Resolver] GenerateBundleAssetId are not working correctly")}prefer(...e){e.forEach(t=>{this._preferredOrder.push(t),t.priority||(t.priority=Object.keys(t.params));}),this._resolverHash={};}set basePath(e){this._basePath=e;}get basePath(){return this._basePath}set rootPath(e){this._rootPath=e;}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(e){if(typeof e=="string")this._defaultSearchParams=e;else {let t=e;this._defaultSearchParams=Object.keys(t).map(i=>`${encodeURIComponent(i)}=${encodeURIComponent(t[i])}`).join("&");}}getAlias(e){let{alias:t,src:i}=e;return Ht(t||i,n=>typeof n=="string"?n:Array.isArray(n)?n.map(o=>o?.src??o):n?.src?n.src:n,true)}addManifest(e){this._manifest&&N("[Resolver] Manifest already exists, this will be overwritten"),this._manifest=e,e.bundles.forEach(t=>{this.addBundle(t.name,t.assets);});}addBundle(e,t){let i=[],s=t;Array.isArray(t)||(s=Object.entries(t).map(([n,o])=>typeof o=="string"||Array.isArray(o)?{alias:n,src:o}:{alias:n,...o})),s.forEach(n=>{let o=n.src,a=n.alias,u;if(typeof a=="string"){let l=this._createBundleAssetId(e,a);i.push(l),u=[a,l];}else {let l=a.map(c=>this._createBundleAssetId(e,c));i.push(...l),u=[...a,...l];}this.add({...n,alias:u,src:o});}),this._bundles[e]=i;}add(e){let t=[];Array.isArray(e)?t.push(...e):t.push(e);let i;i=n=>{this.hasKey(n)&&N(`[Resolver] already has key: ${n} overwriting`);},Ht(t).forEach(n=>{let{src:o}=n,{data:a,format:u,loadParser:l}=n,c=Ht(o).map(p=>typeof p=="string"?Pp(p):Array.isArray(p)?p:[p]),h=this.getAlias(n);Array.isArray(h)?h.forEach(i):i(h);let d=[];c.forEach(p=>{p.forEach(m=>{let b={};if(typeof m!="object"){b.src=m;for(let _=0;_<this._parsers.length;_++){let g=this._parsers[_];if(g.test(m)){b=g.parse(m);break}}}else a=m.data??a,u=m.format??u,l=m.loadParser??l,b={...b,...m};if(!h)throw new Error(`[Resolver] alias is undefined for this asset: ${b.src}`);b=this._buildResolvedAsset(b,{aliases:h,data:a,format:u,loadParser:l}),d.push(b);});}),h.forEach(p=>{this._assetMap[p]=d;});});}resolveBundle(e){let t=ss(e);e=Ht(e);let i={};return e.forEach(s=>{let n=this._bundles[s];if(n){let o=this.resolve(n),a={};for(let u in o){let l=o[u];a[this._extractAssetIdFromBundle(s,u)]=l;}i[s]=a;}}),t?i[e[0]]:i}resolveUrl(e){let t=this.resolve(e);if(typeof e!="string"){let i={};for(let s in t)i[s]=t[s].src;return i}return t.src}resolve(e){let t=ss(e);e=Ht(e);let i={};return e.forEach(s=>{if(!this._resolverHash[s])if(this._assetMap[s]){let n=this._assetMap[s],o=this._getPreferredOrder(n);o?.priority.forEach(a=>{o.params[a].forEach(u=>{let l=n.filter(c=>c[a]?c[a]===u:false);l.length&&(n=l);});}),this._resolverHash[s]=n[0];}else this._resolverHash[s]=this._buildResolvedAsset({alias:[s],src:s},{});i[s]=this._resolverHash[s];}),t?i[e[0]]:i}hasKey(e){return !!this._assetMap[e]}hasBundle(e){return !!this._bundles[e]}_getPreferredOrder(e){for(let t=0;t<e.length;t++){let i=e[t],s=this._preferredOrder.find(n=>n.params.format.includes(i.format));if(s)return s}return this._preferredOrder[0]}_appendDefaultSearchParams(e){if(!this._defaultSearchParams)return e;let t=/\?/.test(e)?"&":"?";return `${e}${t}${this._defaultSearchParams}`}_buildResolvedAsset(e,t){let{aliases:i,data:s,loadParser:n,format:o}=t;return (this._basePath||this._rootPath)&&(e.src=We.toAbsolute(e.src,this._basePath,this._rootPath)),e.alias=i??e.alias??[e.src],e.src=this._appendDefaultSearchParams(e.src),e.data={...s||{},...e.data},e.loadParser=n??e.loadParser,e.format=o??e.format??Xy(e.src),e}};Vt.RETINA_PREFIX=/@([0-9\.]+)x/;});var ao,wp=f(()=>{ao=(r,e)=>{let t=e.split("?")[1];return t&&(r+=`?${t}`),r};});var GA,jc,Yy=f(()=>{ct();Ct();ye();GA=class Yc{constructor(e,t){this.linkedSheets=[];let i=e;e?.source instanceof ge&&(i={texture:e,data:t});let{texture:s,data:n,cachePrefix:o=""}=i;this.cachePrefix=o,this._texture=s instanceof exports.Texture?s:null,this.textureSource=s.source,this.textures={},this.animations={},this.data=n;let a=parseFloat(n.meta.scale);a?(this.resolution=a,s.source.resolution=this.resolution):this.resolution=s.source._resolution,this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null;}parse(){return new Promise(e=>{this._callback=e,this._batchIndex=0,this._frameKeys.length<=Yc.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch();})}_processFrames(e){let t=e,i=Yc.BATCH_SIZE;for(;t-e<i&&t<this._frameKeys.length;){let s=this._frameKeys[t],n=this._frames[s],o=n.frame;if(o){let a=null,u=null,l=n.trimmed!==false&&n.sourceSize?n.sourceSize:n.frame,c=new exports.Rectangle(0,0,Math.floor(l.w)/this.resolution,Math.floor(l.h)/this.resolution);n.rotated?a=new exports.Rectangle(Math.floor(o.x)/this.resolution,Math.floor(o.y)/this.resolution,Math.floor(o.h)/this.resolution,Math.floor(o.w)/this.resolution):a=new exports.Rectangle(Math.floor(o.x)/this.resolution,Math.floor(o.y)/this.resolution,Math.floor(o.w)/this.resolution,Math.floor(o.h)/this.resolution),n.trimmed!==false&&n.spriteSourceSize&&(u=new exports.Rectangle(Math.floor(n.spriteSourceSize.x)/this.resolution,Math.floor(n.spriteSourceSize.y)/this.resolution,Math.floor(o.w)/this.resolution,Math.floor(o.h)/this.resolution)),this.textures[s]=new exports.Texture({source:this.textureSource,frame:a,orig:c,trim:u,rotate:n.rotated?2:0,defaultAnchor:n.anchor,defaultBorders:n.borders,label:s.toString()});}t++;}}_processAnimations(){let e=this.data.animations||{};for(let t in e){this.animations[t]=[];for(let i=0;i<e[t].length;i++){let s=e[t][i];this.animations[t].push(this.textures[s]);}}}_parseComplete(){let e=this._callback;this._callback=null,this._batchIndex=0,e.call(this,this.textures);}_nextBatch(){this._processFrames(this._batchIndex*Yc.BATCH_SIZE),this._batchIndex++,setTimeout(()=>{this._batchIndex*Yc.BATCH_SIZE<this._frameKeys.length?this._nextBatch():(this._processAnimations(),this._parseComplete());},0);}destroy(e=false){for(let t in this.textures)this.textures[t].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,e&&(this._texture?.destroy(),this.textureSource.destroy()),this._texture=null,this.textureSource=null,this.linkedSheets=[];}};GA.BATCH_SIZE=1e3;jc=GA;});function UA(r,e,t){let i={};if(r.forEach(s=>{i[s]=e;}),Object.keys(e.textures).forEach(s=>{i[`${e.cachePrefix}${s}`]=e.textures[s];}),!t){let s=We.dirname(r[0]);e.linkedSheets.forEach((n,o)=>{let a=UA([`${s}/${e.data.meta.related_multi_packs[o]}`],n,true);Object.assign(i,a);});}return i}var oD,Bp,jy=f(()=>{Er();Ls();wp();B();ye();Us();Yy();oD=["jpg","png","jpeg","avif","webp","basis","etc2","bc7","bc6h","bc5","bc4","bc3","bc2","bc1","eac","astc"];Bp={extension:x.Asset,cache:{test:r=>r instanceof jc,getCacheableAssets:(r,e)=>UA(r,e,false)},resolver:{extension:{type:x.ResolveParser,name:"resolveSpritesheet"},test:r=>{let t=r.split("?")[0].split("."),i=t.pop(),s=t.pop();return i==="json"&&oD.includes(s)},parse:r=>{let e=r.split(".");return {resolution:parseFloat(Vt.RETINA_PREFIX.exec(r)?.[1]??"1"),format:e[e.length-2],src:r}}},loader:{name:"spritesheetLoader",extension:{type:x.LoadParser,priority:ze.Normal,name:"spritesheetLoader"},async testParse(r,e){return We.extname(e.src).toLowerCase()===".json"&&!!r.frames},async parse(r,e,t){let{texture:i,imageFilename:s,textureOptions:n,cachePrefix:o}=e?.data??{},a=We.dirname(e.src);a&&a.lastIndexOf("/")!==a.length-1&&(a+="/");let u;if(i instanceof exports.Texture)u=i;else {let h=ao(a+(s??r.meta.image),e.src);u=(await t.load([{src:h,data:n}]))[h];}let l=new jc({texture:u.source,data:r,cachePrefix:o});await l.parse();let c=r?.meta?.related_multi_packs;if(Array.isArray(c)){let h=[];for(let p of c){if(typeof p!="string")continue;let m=a+p;e.data?.ignoreMultiPack||(m=ao(m,e.src),h.push(t.load({src:m,data:{textureOptions:n,ignoreMultiPack:true}})));}let d=await Promise.all(h);l.linkedSheets=d,d.forEach(p=>{p.linkedSheets=[l].concat(l.linkedSheets.filter(m=>m!==p));});}return l},async unload(r,e,t){await t.unload(r.textureSource._sourceOrigin),r.destroy(false);}}};});var Rp=f(()=>{B();jy();V.add(Bp);});function mu(r,e,t){let{width:i,height:s}=t.orig,n=t.trim;if(n){let o=n.width,a=n.height;r.minX=n.x-e._x*i,r.maxX=r.minX+o,r.minY=n.y-e._y*s,r.maxY=r.minY+a;}else r.minX=-e._x*i,r.maxX=r.minX+i,r.minY=-e._y*s,r.maxY=r.minY+s;}var Mp=f(()=>{});var Ge,Ns=f(()=>{ws();ye();Mp();Pe();si();Ge=class r extends lt{constructor(e=exports.Texture.EMPTY){e instanceof exports.Texture&&(e={texture:e});let{texture:t=exports.Texture.EMPTY,anchor:i,roundPixels:s,width:n,height:o,...a}=e;super({label:"Sprite",...a}),this.renderPipeId="sprite",this.batched=true,this._visualBounds={minX:0,maxX:1,minY:0,maxY:0},this._anchor=new Ne({_onUpdate:()=>{this.onViewUpdate();}}),i?this.anchor=i:t.defaultAnchor&&(this.anchor=t.defaultAnchor),this.texture=t,this.allowChildren=false,this.roundPixels=s??false,n!==void 0&&(this.width=n),o!==void 0&&(this.height=o);}static from(e,t=false){return e instanceof exports.Texture?new r(e):new r(exports.Texture.from(e,t))}set texture(e){e||(e=exports.Texture.EMPTY);let t=this._texture;t!==e&&(t&&t.dynamic&&t.off("update",this.onViewUpdate,this),e.dynamic&&e.on("update",this.onViewUpdate,this),this._texture=e,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 mu(this._visualBounds,this._anchor,this._texture),this._visualBounds}get sourceBounds(){return U("8.6.1","Sprite.sourceBounds is deprecated, use visualBounds instead."),this.visualBounds}updateBounds(){let e=this._anchor,t=this._texture,i=this._bounds,{width:s,height:n}=t.orig;i.minX=-e._x*s,i.maxX=i.minX+s,i.minY=-e._y*n,i.maxY=i.minY+n;}destroy(e=false){if(super.destroy(e),typeof e=="boolean"?e:e?.texture){let i=typeof e=="boolean"?e:e?.textureSource;this._texture.destroy(i);}this._texture=null,this._visualBounds=null,this._bounds=null,this._anchor=null,this._gpuData=null;}get anchor(){return this._anchor}set anchor(e){typeof e=="number"?this._anchor.set(e):this._anchor.copyFrom(e);}get width(){return Math.abs(this.scale.x)*this._texture.orig.width}set width(e){this._setWidth(e,this._texture.orig.width),this._width=e;}get height(){return Math.abs(this.scale.y)*this._texture.orig.height}set height(e){this._setHeight(e,this._texture.orig.height),this._height=e;}getSize(e){return e||(e={}),e.width=Math.abs(this.scale.x)*this._texture.orig.width,e.height=Math.abs(this.scale.y)*this._texture.orig.height,e}setSize(e,t){typeof e=="object"?(t=e.height??e.width,e=e.width):t??(t=e),e!==void 0&&this._setWidth(e,this._texture.orig.width),t!==void 0&&this._setHeight(t,this._texture.orig.height);}};});function Hs(r,e,t){let i=aD;r.measurable=true,Ei(r,t,i),e.addBoundsMask(i),r.measurable=false;}var aD,$c=f(()=>{Lt();Kn();aD=new Ae;});function Vs(r,e,t){let i=ir.get();r.measurable=true;let s=ut.get().identity(),n=LA(r,t,s);Ms(r,i,n),r.measurable=false,e.addBoundsMask(i),ut.return(s),ir.return(i);}function LA(r,e,t){return r?(r!==e&&(LA(r.parent,e,t),r.updateLocalTransform(),t.append(r.localTransform)),t):(N("Mask bounds, renderable is not inside the root container"),t)}var qc=f(()=>{Oc();Bs();Be();});var uo,$y=f(()=>{B();Ns();$c();qc();uo=class{constructor(e){this.priority=0,this.inverse=false,this.pipe="alphaMask",e?.mask&&this.init(e.mask);}init(e){this.mask=e,this.renderMaskToTexture=!(e instanceof Ge),this.mask.renderable=this.renderMaskToTexture,this.mask.includeInBuild=!this.renderMaskToTexture,this.mask.measurable=false;}reset(){this.mask.measurable=true,this.mask=null;}addBounds(e,t){this.inverse||Hs(this.mask,e,t);}addLocalBounds(e,t){Vs(this.mask,e,t);}containsPoint(e,t){let i=this.mask;return t(i,e)}destroy(){this.reset();}static test(e){return e instanceof Ge}};uo.extension=x.MaskEffect;});var lo,qy=f(()=>{B();lo=class{constructor(e){this.priority=0,this.pipe="colorMask",e?.mask&&this.init(e.mask);}init(e){this.mask=e;}destroy(){}static test(e){return typeof e=="number"}};lo.extension=x.MaskEffect;});var co,Ky=f(()=>{B();hr();$c();qc();co=class{constructor(e){this.priority=0,this.pipe="stencilMask",e?.mask&&this.init(e.mask);}init(e){this.mask=e,this.mask.includeInBuild=false,this.mask.measurable=false;}reset(){this.mask.measurable=true,this.mask.includeInBuild=true,this.mask=null;}addBounds(e,t){Hs(this.mask,e,t);}addLocalBounds(e,t){Vs(this.mask,e,t);}containsPoint(e,t){let i=this.mask;return t(i,e)}destroy(){this.reset();}static test(e){return e instanceof ue}};co.extension=x.MaskEffect;});var At,ho=f(()=>{Fe();B();Ct();At=class extends ge{constructor(e){e.resource||(e.resource=j.get().createCanvas()),e.width||(e.width=e.resource.width,e.autoDensity||(e.width/=e.resolution)),e.height||(e.height=e.resource.height,e.autoDensity||(e.height/=e.resolution)),super(e),this.uploadMethodId="image",this.autoDensity=e.autoDensity,this.resizeCanvas(),this.transparent=!!e.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(e=this.width,t=this.height,i=this._resolution){let s=super.resize(e,t,i);return s&&this.resizeCanvas(),s}static test(e){return globalThis.HTMLCanvasElement&&e instanceof HTMLCanvasElement||globalThis.OffscreenCanvas&&e instanceof OffscreenCanvas}get context2D(){return this._context2D||(this._context2D=this.resource.getContext("2d"))}};At.extension=x.TextureSource;});var Yt,fo=f(()=>{B();Ct();Yt=class extends ge{constructor(e){super(e),this.uploadMethodId="image",this.autoGarbageCollect=true;}static test(e){return globalThis.HTMLImageElement&&e instanceof HTMLImageElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap||globalThis.VideoFrame&&e instanceof VideoFrame}};Yt.extension=x.TextureSource;});async function gu(){return Zy??(Zy=(async()=>{let e=document.createElement("canvas").getContext("webgl");if(!e)return "premultiply-alpha-on-upload";let t=await new Promise(o=>{let a=document.createElement("video");a.onloadeddata=()=>o(a),a.onerror=()=>o(null),a.autoplay=false,a.crossOrigin="anonymous",a.preload="auto",a.src="data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=",a.load();});if(!t)return "premultiply-alpha-on-upload";let i=e.createTexture();e.bindTexture(e.TEXTURE_2D,i);let s=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,s),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,i,0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,false),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,e.NONE),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t);let n=new Uint8Array(4);return e.readPixels(0,0,1,1,e.RGBA,e.UNSIGNED_BYTE,n),e.deleteFramebuffer(s),e.deleteTexture(i),e.getExtension("WEBGL_lose_context")?.loseContext(),n[0]<=n[3]?"premultiplied-alpha":"premultiply-alpha-on-upload"})()),Zy}var Zy,Ip=f(()=>{});var Dp,zs,kp=f(()=>{B();Gs();Ip();Ct();Dp=class NA extends ge{constructor(e){super(e),this.isReady=false,this.uploadMethodId="video",e={...NA.defaultOptions,...e},this._autoUpdate=true,this._isConnectedToTicker=false,this._updateFPS=e.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=e.autoPlay!==false,this.alphaMode=e.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),e.autoLoad!==false&&this.load();}updateFrame(){if(!this.destroyed){if(this._updateFPS){let e=Ie.shared.elapsedMS*this.resource.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-e);}(!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;let e=this.resource,t=this.options;return (e.readyState===e.HAVE_ENOUGH_DATA||e.readyState===e.HAVE_FUTURE_DATA)&&e.width&&e.height&&(e.complete=true),e.addEventListener("play",this._onPlayStart),e.addEventListener("pause",this._onPlayStop),e.addEventListener("seeked",this._onSeeked),this._isSourceReady()?this._mediaReady():(t.preload||e.addEventListener("canplay",this._onCanPlay),e.addEventListener("canplaythrough",this._onCanPlayThrough),e.addEventListener("error",this._onError,true)),this.alphaMode=await gu(),this._load=new Promise((i,s)=>{this.isValid?i(this):(this._resolve=i,this._reject=s,t.preloadTimeoutMs!==void 0&&(this._preloadTimeout=setTimeout(()=>{this._onError(new ErrorEvent(`Preload exceeded timeout of ${t.preloadTimeoutMs}ms`));})),e.load());}),this._load}_onError(e){this.resource.removeEventListener("error",this._onError,true),this.emit("error",e),this._reject&&(this._reject(e),this._reject=null,this._resolve=null);}_isSourcePlaying(){let e=this.resource;return !e.paused&&!e.ended}_isSourceReady(){return this.resource.readyState>2}_onPlayStart(){this.isValid||this._mediaReady(),this._configureAutoUpdate();}_onPlayStop(){this._configureAutoUpdate();}_onSeeked(){this._autoUpdate&&!this._isSourcePlaying()&&(this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0);}_onCanPlay(){this.resource.removeEventListener("canplay",this._onCanPlay),this._mediaReady();}_onCanPlayThrough(){this.resource.removeEventListener("canplaythrough",this._onCanPlay),this._preloadTimeout&&(clearTimeout(this._preloadTimeout),this._preloadTimeout=void 0),this._mediaReady();}_mediaReady(){let e=this.resource;this.isValid&&(this.isReady=true,this.resize(e.videoWidth,e.videoHeight)),this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0,this._resolve&&(this._resolve(this),this._resolve=null,this._reject=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&this.resource.play();}destroy(){this._configureAutoUpdate();let e=this.resource;e&&(e.removeEventListener("play",this._onPlayStart),e.removeEventListener("pause",this._onPlayStop),e.removeEventListener("seeked",this._onSeeked),e.removeEventListener("canplay",this._onCanPlay),e.removeEventListener("canplaythrough",this._onCanPlayThrough),e.removeEventListener("error",this._onError,true),e.pause(),e.src="",e.load()),super.destroy();}get autoUpdate(){return this._autoUpdate}set autoUpdate(e){e!==this._autoUpdate&&(this._autoUpdate=e,this._configureAutoUpdate());}get updateFPS(){return this._updateFPS}set updateFPS(e){e!==this._updateFPS&&(this._updateFPS=e,this._configureAutoUpdate());}_configureAutoUpdate(){this._autoUpdate&&this._isSourcePlaying()?!this._updateFPS&&this.resource.requestVideoFrameCallback?(this._isConnectedToTicker&&(Ie.shared.remove(this.updateFrame,this),this._isConnectedToTicker=false,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||(Ie.shared.add(this.updateFrame,this),this._isConnectedToTicker=true,this._msToNextUpdate=0)):(this._videoFrameRequestCallbackHandle!==null&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(Ie.shared.remove(this.updateFrame,this),this._isConnectedToTicker=false,this._msToNextUpdate=0));}static test(e){return globalThis.HTMLVideoElement&&e instanceof HTMLVideoElement}};Dp.extension=x.TextureSource;Dp.defaultOptions={...ge.defaultOptions,autoLoad:true,autoPlay:true,updateFPS:0,crossorigin:true,loop:false,muted:true,playsinline:true,preload:false};Dp.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};zs=Dp;});var Qy,Se,Ai=f(()=>{Be();pu();Qy=class{constructor(){this._parsers=[],this._cache=new Map,this._cacheMap=new Map;}reset(){this._cacheMap.clear(),this._cache.clear();}has(e){return this._cache.has(e)}get(e){let t=this._cache.get(e);return t||N(`[Assets] Asset id ${e} was not found in the Cache`),t}set(e,t){let i=Ht(e),s;for(let u=0;u<this.parsers.length;u++){let l=this.parsers[u];if(l.test(t)){s=l.getCacheableAssets(i,t);break}}let n=new Map(Object.entries(s||{}));s||i.forEach(u=>{n.set(u,t);});let o=[...n.keys()],a={cacheKeys:o,keys:i};i.forEach(u=>{this._cacheMap.set(u,a);}),o.forEach(u=>{let l=s?s[u]:t;this._cache.has(u)&&this._cache.get(u)!==l&&N("[Cache] already has key:",u),this._cache.set(u,n.get(u));});}remove(e){if(!this._cacheMap.has(e)){N(`[Assets] Asset id ${e} was not found in the Cache`);return}let t=this._cacheMap.get(e);t.cacheKeys.forEach(s=>{this._cache.delete(s);}),t.keys.forEach(s=>{this._cacheMap.delete(s);});}get parsers(){return this._parsers}},Se=new Qy;});function HA(r={}){return e0(r)}function e0(r={}){let e=r&&r.resource,t=e?r.resource:r,i=e?r:{resource:r};for(let s=0;s<Jy.length;s++){let n=Jy[s];if(n.test(t))return new n(i)}throw new Error(`Could not find a source type for resource: ${i.resource}`)}function t0(r={},e=false){let t=r&&r.resource,i=t?r.resource:r,s=t?r:{resource:r};if(!e&&Se.has(i))return Se.get(i);let n=new exports.Texture({source:e0(s)});return n.on("destroy",()=>{Se.has(i)&&Se.remove(i);}),e||Se.set(i,n),n}function r0(r,e=false){return typeof r=="string"?Se.get(r):r instanceof ge?new exports.Texture({source:r}):t0(r,e)}var Jy,i0=f(()=>{Ai();B();Ct();ye();Jy=[];V.handleByList(x.TextureSource,Jy);exports.Texture.from=r0;ge.from=e0;});var Op=f(()=>{B();$y();qy();Ky();dp();ho();fo();kp();i0();V.add(uo,lo,co,zs,Yt,At,rs);});var _t,ns=f(()=>{_t=class{constructor(e){this.resources=Object.create(null),this._dirty=true;let t=0;for(let i in e){let s=e[i];this.setResource(s,t++);}this._updateKey();}_updateKey(){if(!this._dirty)return;this._dirty=false;let e=[],t=0;for(let i in this.resources)e[t++]=this.resources[i]._resourceId;this._key=e.join("|");}setResource(e,t){let i=this.resources[t];e!==i&&(i&&e.off?.("change",this.onResourceChange,this),e.on?.("change",this.onResourceChange,this),this.resources[t]=e,this._dirty=true);}getResource(e){return this.resources[e]}_touch(e){let t=this.resources;for(let i in t)t[i]._touched=e;}destroy(){let e=this.resources;for(let t in e)e[t].off?.("change",this.onResourceChange,this);this.resources=null;}onResourceChange(e){if(this._dirty=true,e.destroyed){let t=this.resources;for(let i in t)t[i]===e&&(t[i]=null);}else this._updateKey();}};});function Ws(r,e,t){let i=2166136261;for(let s=0;s<e;s++)i^=r[s].uid,i=Math.imul(i,16777619),i>>>=0;return VA[i]||uD(r,e,i,t)}function uD(r,e,t,i){let s={},n=0;for(let a=0;a<i;a++){let u=a<e?r[a]:exports.Texture.EMPTY.source;s[n++]=u.source,s[n++]=u.style;}let o=new _t(s);return VA[t]=o,o}var VA,Kc=f(()=>{ns();ye();VA={};});var Ur,Fp=f(()=>{Ur=class{constructor(e){typeof e=="number"?this.rawBinaryData=new ArrayBuffer(e):e instanceof Uint8Array?this.rawBinaryData=e.buffer:this.rawBinaryData=e,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(e){return this[`${e}View`]}destroy(){this.rawBinaryData=null,this._int8View=null,this._uint8View=null,this._int16View=null,this.uint16View=null,this._int32View=null,this.uint32View=null,this.float32View=null;}static sizeOf(e){switch(e){case "int8":case "uint8":return 1;case "int16":case "uint16":return 2;case "int32":case "uint32":case "float32":return 4;default:throw new Error(`${e} isn't a valid view type`)}}};});function po(r,e){let t=r.byteLength/8|0,i=new Float64Array(r,0,t);new Float64Array(e,0,t).set(i);let n=r.byteLength-t*8;if(n>0){let o=new Uint8Array(r,t*8,n);new Uint8Array(e,t*8,n).set(o);}}var Gp=f(()=>{});var Up,He,Xs=f(()=>{Up={normal:"normal-npm",add:"add-npm",screen:"screen-npm"},He=(r=>(r[r.DISABLED=0]="DISABLED",r[r.RENDERING_MASK_ADD=1]="RENDERING_MASK_ADD",r[r.MASK_ACTIVE=2]="MASK_ACTIVE",r[r.INVERSE_MASK_ACTIVE=3]="INVERSE_MASK_ACTIVE",r[r.RENDERING_MASK_REMOVE=4]="RENDERING_MASK_REMOVE",r[r.NONE=5]="NONE",r))(He||{});});function oi(r,e){return e.alphaMode==="no-premultiply-alpha"&&Up[r]||r}var xu=f(()=>{Xs();});function _u(){return (!Lp||Lp?.isContextLost())&&(Lp=j.get().createCanvas().getContext("webgl",{})),Lp}var Lp,Np=f(()=>{Fe();});function cD(r){let e="";for(let t=0;t<r;++t)t>0&&(e+=`
20
20
  else `),t<r-1&&(e+=`if(test == ${t}.0){}`);return e}function bu(r,e){if(r===0)throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");let t=e.createShader(e.FRAGMENT_SHADER);try{for(;;){let i=lD.replace(/%forloop%/gi,cD(r));if(e.shaderSource(t,i),e.compileShader(t),!e.getShaderParameter(t,e.COMPILE_STATUS))r=r/2|0;else break}}finally{e.deleteShader(t);}return r}var lD,Hp=f(()=>{lD=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(`
21
- `);});function Vp(){if(yu)return yu;let r=_u();return yu=r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS),yu=bu(yu,r),r.getExtension("WEBGL_lose_context")?.loseContext(),yu}var yu,s0=f(()=>{Np();Hp();yu=null;});var vu,n0=f(()=>{vu=class{constructor(){this.ids=Object.create(null),this.textures=[],this.count=0;}clear(){for(let e=0;e<this.count;e++){let t=this.textures[e];this.textures[e]=null,this.ids[t.uid]=null;}this.count=0;}};});function zA(){return o0>0?XA[--o0]:new Qc}function WA(r){XA[o0++]=r;}var Qc,XA,o0,Zc,YA,zp,a0=f(()=>{Et();Fp();Pe();Gp();xu();s0();n0();Qc=class{constructor(){this.renderPipeId="batch",this.action="startBatch",this.start=0,this.size=0,this.textures=new vu,this.blendMode="normal",this.topology="triangle-strip",this.canBundle=true;}destroy(){this.textures=null,this.gpuBindGroup=null,this.bindGroup=null,this.batcher=null;}},XA=[],o0=0;Zc=0,YA=class jA{constructor(e){this.uid=ce("batcher"),this.dirty=true,this.batchIndex=0,this.batches=[],this._elements=[],e={...jA.defaultOptions,...e},e.maxTextures||(U("v8.8.0","maxTextures is a required option for Batcher now, please pass it in the options"),e.maxTextures=Vp());let{maxTextures:t,attributesInitialSize:i,indicesInitialSize:s}=e;this.attributeBuffer=new Lr(i*4),this.indexBuffer=new Uint16Array(s),this.maxTextures=t;}begin(){this.elementSize=0,this.elementStart=0,this.indexSize=0,this.attributeSize=0;for(let e=0;e<this.batchIndex;e++)WA(this.batches[e]);this.batchIndex=0,this._batchIndexStart=0,this._batchIndexSize=0,this.dirty=true;}add(e){this._elements[this.elementSize++]=e,e._indexStart=this.indexSize,e._attributeStart=this.attributeSize,e._batcher=this,this.indexSize+=e.indexSize,this.attributeSize+=e.attributeSize*this.vertexSize;}checkAndUpdateTexture(e,t){let i=e._batch.textures.ids[t._source.uid];return !i&&i!==0?false:(e._textureId=i,e.texture=t,true)}updateElement(e){this.dirty=true;let t=this.attributeBuffer;e.packAsQuad?this.packQuadAttributes(e,t.float32View,t.uint32View,e._attributeStart,e._textureId):this.packAttributes(e,t.float32View,t.uint32View,e._attributeStart,e._textureId);}break(e){let t=this._elements;if(!t[this.elementStart])return;let i=zA(),s=i.textures;s.clear();let n=t[this.elementStart],o=oi(n.blendMode,n.texture._source),a=n.topology;this.attributeSize*4>this.attributeBuffer.size&&this._resizeAttributeBuffer(this.attributeSize*4),this.indexSize>this.indexBuffer.length&&this._resizeIndexBuffer(this.indexSize);let u=this.attributeBuffer.float32View,l=this.attributeBuffer.uint32View,c=this.indexBuffer,h=this._batchIndexSize,d=this._batchIndexStart,p="startBatch",m=this.maxTextures;for(let b=this.elementStart;b<this.elementSize;++b){let _=t[b];t[b]=null;let y=_.texture._source,S=oi(_.blendMode,y),E=o!==S||a!==_.topology;if(y._batchTick===Zc&&!E){_._textureId=y._textureBindLocation,h+=_.indexSize,_.packAsQuad?(this.packQuadAttributes(_,u,l,_._attributeStart,_._textureId),this.packQuadIndex(c,_._indexStart,_._attributeStart/this.vertexSize)):(this.packAttributes(_,u,l,_._attributeStart,_._textureId),this.packIndex(_,c,_._indexStart,_._attributeStart/this.vertexSize)),_._batch=i;continue}y._batchTick=Zc,(s.count>=m||E)&&(this._finishBatch(i,d,h-d,s,o,a,e,p),p="renderBatch",d=h,o=S,a=_.topology,i=zA(),s=i.textures,s.clear(),++Zc),_._textureId=y._textureBindLocation=s.count,s.ids[y.uid]=s.count,s.textures[s.count++]=y,_._batch=i,h+=_.indexSize,_.packAsQuad?(this.packQuadAttributes(_,u,l,_._attributeStart,_._textureId),this.packQuadIndex(c,_._indexStart,_._attributeStart/this.vertexSize)):(this.packAttributes(_,u,l,_._attributeStart,_._textureId),this.packIndex(_,c,_._indexStart,_._attributeStart/this.vertexSize));}s.count>0&&(this._finishBatch(i,d,h-d,s,o,a,e,p),d=h,++Zc),this.elementStart=this.elementSize,this._batchIndexStart=d,this._batchIndexSize=h;}_finishBatch(e,t,i,s,n,o,a,u){e.gpuBindGroup=null,e.bindGroup=null,e.action=u,e.batcher=this,e.textures=s,e.blendMode=n,e.topology=o,e.start=t,e.size=i,++Zc,this.batches[this.batchIndex++]=e,a.add(e);}finish(e){this.break(e);}ensureAttributeBuffer(e){e*4<=this.attributeBuffer.size||this._resizeAttributeBuffer(e*4);}ensureIndexBuffer(e){e<=this.indexBuffer.length||this._resizeIndexBuffer(e);}_resizeAttributeBuffer(e){let t=Math.max(e,this.attributeBuffer.size*2),i=new Lr(t);po(this.attributeBuffer.rawBinaryData,i.rawBinaryData),this.attributeBuffer=i;}_resizeIndexBuffer(e){let t=this.indexBuffer,i=Math.max(e,t.length*1.5);i+=i%2;let s=i>65535?new Uint32Array(i):new Uint16Array(i);if(s.BYTES_PER_ELEMENT!==t.BYTES_PER_ELEMENT)for(let n=0;n<t.length;n++)s[n]=t[n];else po(t.buffer,s.buffer);this.indexBuffer=s;}packQuadIndex(e,t,i){e[t]=i+0,e[t+1]=i+1,e[t+2]=i+2,e[t+3]=i+0,e[t+4]=i+2,e[t+5]=i+3;}packIndex(e,t,i,s){let n=e.indices,o=e.indexSize,a=e.indexOffset,u=e.attributeOffset;for(let l=0;l<o;l++)t[i++]=s+n[l+a]-u;}destroy(){for(let e=0;e<this.batches.length;e++)WA(this.batches[e]);this.batches=null;for(let e=0;e<this._elements.length;e++)this._elements[e]._batch=null;this._elements=null,this.indexBuffer=null,this.attributeBuffer.destroy(),this.attributeBuffer=null;}};YA.defaultOptions={maxTextures:null,attributesInitialSize:4,indicesInitialSize:6};zp=YA;});var he,Pi=f(()=>{he=(r=>(r[r.MAP_READ=1]="MAP_READ",r[r.MAP_WRITE=2]="MAP_WRITE",r[r.COPY_SRC=4]="COPY_SRC",r[r.COPY_DST=8]="COPY_DST",r[r.INDEX=16]="INDEX",r[r.VERTEX=32]="VERTEX",r[r.UNIFORM=64]="UNIFORM",r[r.STORAGE=128]="STORAGE",r[r.INDIRECT=256]="INDIRECT",r[r.QUERY_RESOLVE=512]="QUERY_RESOLVE",r[r.STATIC=1024]="STATIC",r))(he||{});});var tt,os=f(()=>{Ut();Et();Pi();tt=class extends _e{constructor(e){let{data:t,size:i}=e,{usage:s,label:n,shrinkToFit:o}=e;super(),this.uid=ce("buffer"),this._resourceType="buffer",this._resourceId=ce("resource"),this._touched=0,this._updateID=1,this._dataInt32=null,this.shrinkToFit=true,this.destroyed=false,t instanceof Array&&(t=new Float32Array(t)),this._data=t,i??(i=t?.byteLength);let a=!!t;this.descriptor={size:i,usage:s,mappedAtCreation:a,label:n},this.shrinkToFit=o??true;}get data(){return this._data}set data(e){this.setDataWithSize(e,e.length,true);}get dataInt32(){return this._dataInt32||(this._dataInt32=new Int32Array(this.data.buffer)),this._dataInt32}get static(){return !!(this.descriptor.usage&he.STATIC)}set static(e){e?this.descriptor.usage|=he.STATIC:this.descriptor.usage&=~he.STATIC;}setDataWithSize(e,t,i){if(this._updateID++,this._updateSize=t*e.BYTES_PER_ELEMENT,this._data===e){i&&this.emit("update",this);return}let s=this._data;if(this._data=e,this._dataInt32=null,!s||s.length!==e.length){!this.shrinkToFit&&s&&e.byteLength<s.byteLength?i&&this.emit("update",this):(this.descriptor.size=e.byteLength,this._resourceId=ce("resource"),this.emit("change",this));return}i&&this.emit("update",this);}update(e){this._updateSize=e??this._updateSize,this._updateID++,this.emit("update",this);}destroy(){this.destroyed=true,this.emit("destroy",this),this.emit("change",this),this._data=null,this.descriptor=null,this.removeAllListeners();}};});function Jc(r,e){if(!(r instanceof tt)){let t=e?he.INDEX:he.VERTEX;r instanceof Array&&(e?(r=new Uint32Array(r),t=he.INDEX|he.COPY_DST):(r=new Float32Array(r),t=he.VERTEX|he.COPY_DST)),r=new tt({data:r,label:e?"index-mesh-buffer":"vertex-mesh-buffer",usage:t});}return r}var u0=f(()=>{os();Pi();});function Wp(r,e,t){let i=r.getAttribute(e);if(!i)return t.minX=0,t.minY=0,t.maxX=0,t.maxY=0,t;let s=i.buffer.data,n=1/0,o=1/0,a=-1/0,u=-1/0,l=s.BYTES_PER_ELEMENT,c=(i.offset||0)/l,h=(i.stride||2*4)/l;for(let d=c;d<s.length;d+=h){let p=s[d],m=s[d+1];p>a&&(a=p),m>u&&(u=m),p<n&&(n=p),m<o&&(o=m);}return t.minX=n,t.minY=o,t.maxX=a,t.maxY=u,t}var l0=f(()=>{});function hD(r){return (r instanceof tt||Array.isArray(r)||r.BYTES_PER_ELEMENT)&&(r={buffer:r}),r.buffer=Jc(r.buffer,false),r}var jt,Ys=f(()=>{Ut();Lt();Et();os();u0();l0();jt=class extends _e{constructor(e={}){super(),this.uid=ce("geometry"),this._layoutKey=0,this.instanceCount=1,this._bounds=new Ae,this._boundsDirty=true;let{attributes:t,indexBuffer:i,topology:s}=e;if(this.buffers=[],this.attributes={},t)for(let n in t)this.addAttribute(n,t[n]);this.instanceCount=e.instanceCount??1,i&&this.addIndex(i),this.topology=s||"triangle-list";}onBufferUpdate(){this._boundsDirty=true,this.emit("update",this);}getAttribute(e){return this.attributes[e]}getIndex(){return this.indexBuffer}getBuffer(e){return this.getAttribute(e).buffer}getSize(){for(let e in this.attributes){let t=this.attributes[e];return t.buffer.data.length/(t.stride/4||t.size)}return 0}addAttribute(e,t){let i=hD(t);this.buffers.indexOf(i.buffer)===-1&&(this.buffers.push(i.buffer),i.buffer.on("update",this.onBufferUpdate,this),i.buffer.on("change",this.onBufferUpdate,this)),this.attributes[e]=i;}addIndex(e){this.indexBuffer=Jc(e,true),this.buffers.push(this.indexBuffer);}get bounds(){return this._boundsDirty?(this._boundsDirty=false,Wp(this,"aPosition",this._bounds)):this._bounds}destroy(e=false){this.emit("destroy",this),this.removeAllListeners(),e&&this.buffers.forEach(t=>t.destroy()),this.attributes=null,this.buffers=null,this.indexBuffer=null,this._bounds=null;}};});var dD,fD,Tu,c0=f(()=>{os();Pi();Ys();dD=new Float32Array(1),fD=new Uint32Array(1),Tu=class extends jt{constructor(){let t=new tt({data:dD,label:"attribute-batch-buffer",usage:he.VERTEX|he.COPY_DST,shrinkToFit:false}),i=new tt({data:fD,label:"index-batch-buffer",usage:he.INDEX|he.COPY_DST,shrinkToFit:false}),s=6*4;super({attributes:{aPosition:{buffer:t,format:"float32x2",stride:s,offset:0},aUV:{buffer:t,format:"float32x2",stride:s,offset:2*4},aColor:{buffer:t,format:"unorm8x4",stride:s,offset:4*4},aTextureIdAndRound:{buffer:t,format:"uint16x2",stride:s,offset:5*4}},indexBuffer:i});}};});function ai(r,e){let t=$A[r];return t===void 0&&(h0[e]===void 0&&(h0[e]=1),$A[r]=t=h0[e]++),t}var h0,$A,Su=f(()=>{h0=Object.create(null),$A=Object.create(null);});function Yp(){if(!Xp){Xp="mediump";let r=_u();r&&r.getShaderPrecisionFormat&&(Xp=r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).precision?"highp":"mediump");}return Xp}var Xp,d0=f(()=>{Np();});function jp(r,e,t){return e?r:t?(r=r.replace("out vec4 finalColor;",""),`
21
+ `);});function Vp(){if(yu)return yu;let r=_u();return yu=r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS),yu=bu(yu,r),r.getExtension("WEBGL_lose_context")?.loseContext(),yu}var yu,s0=f(()=>{Np();Hp();yu=null;});var vu,n0=f(()=>{vu=class{constructor(){this.ids=Object.create(null),this.textures=[],this.count=0;}clear(){for(let e=0;e<this.count;e++){let t=this.textures[e];this.textures[e]=null,this.ids[t.uid]=null;}this.count=0;}};});function zA(){return o0>0?XA[--o0]:new Qc}function WA(r){XA[o0++]=r;}var Qc,XA,o0,Zc,YA,zp,a0=f(()=>{Et();Fp();Pe();Gp();xu();s0();n0();Qc=class{constructor(){this.renderPipeId="batch",this.action="startBatch",this.start=0,this.size=0,this.textures=new vu,this.blendMode="normal",this.topology="triangle-strip",this.canBundle=true;}destroy(){this.textures=null,this.gpuBindGroup=null,this.bindGroup=null,this.batcher=null;}},XA=[],o0=0;Zc=0,YA=class jA{constructor(e){this.uid=ce("batcher"),this.dirty=true,this.batchIndex=0,this.batches=[],this._elements=[],e={...jA.defaultOptions,...e},e.maxTextures||(U("v8.8.0","maxTextures is a required option for Batcher now, please pass it in the options"),e.maxTextures=Vp());let{maxTextures:t,attributesInitialSize:i,indicesInitialSize:s}=e;this.attributeBuffer=new Ur(i*4),this.indexBuffer=new Uint16Array(s),this.maxTextures=t;}begin(){this.elementSize=0,this.elementStart=0,this.indexSize=0,this.attributeSize=0;for(let e=0;e<this.batchIndex;e++)WA(this.batches[e]);this.batchIndex=0,this._batchIndexStart=0,this._batchIndexSize=0,this.dirty=true;}add(e){this._elements[this.elementSize++]=e,e._indexStart=this.indexSize,e._attributeStart=this.attributeSize,e._batcher=this,this.indexSize+=e.indexSize,this.attributeSize+=e.attributeSize*this.vertexSize;}checkAndUpdateTexture(e,t){let i=e._batch.textures.ids[t._source.uid];return !i&&i!==0?false:(e._textureId=i,e.texture=t,true)}updateElement(e){this.dirty=true;let t=this.attributeBuffer;e.packAsQuad?this.packQuadAttributes(e,t.float32View,t.uint32View,e._attributeStart,e._textureId):this.packAttributes(e,t.float32View,t.uint32View,e._attributeStart,e._textureId);}break(e){let t=this._elements;if(!t[this.elementStart])return;let i=zA(),s=i.textures;s.clear();let n=t[this.elementStart],o=oi(n.blendMode,n.texture._source),a=n.topology;this.attributeSize*4>this.attributeBuffer.size&&this._resizeAttributeBuffer(this.attributeSize*4),this.indexSize>this.indexBuffer.length&&this._resizeIndexBuffer(this.indexSize);let u=this.attributeBuffer.float32View,l=this.attributeBuffer.uint32View,c=this.indexBuffer,h=this._batchIndexSize,d=this._batchIndexStart,p="startBatch",m=this.maxTextures;for(let b=this.elementStart;b<this.elementSize;++b){let _=t[b];t[b]=null;let y=_.texture._source,S=oi(_.blendMode,y),E=o!==S||a!==_.topology;if(y._batchTick===Zc&&!E){_._textureId=y._textureBindLocation,h+=_.indexSize,_.packAsQuad?(this.packQuadAttributes(_,u,l,_._attributeStart,_._textureId),this.packQuadIndex(c,_._indexStart,_._attributeStart/this.vertexSize)):(this.packAttributes(_,u,l,_._attributeStart,_._textureId),this.packIndex(_,c,_._indexStart,_._attributeStart/this.vertexSize)),_._batch=i;continue}y._batchTick=Zc,(s.count>=m||E)&&(this._finishBatch(i,d,h-d,s,o,a,e,p),p="renderBatch",d=h,o=S,a=_.topology,i=zA(),s=i.textures,s.clear(),++Zc),_._textureId=y._textureBindLocation=s.count,s.ids[y.uid]=s.count,s.textures[s.count++]=y,_._batch=i,h+=_.indexSize,_.packAsQuad?(this.packQuadAttributes(_,u,l,_._attributeStart,_._textureId),this.packQuadIndex(c,_._indexStart,_._attributeStart/this.vertexSize)):(this.packAttributes(_,u,l,_._attributeStart,_._textureId),this.packIndex(_,c,_._indexStart,_._attributeStart/this.vertexSize));}s.count>0&&(this._finishBatch(i,d,h-d,s,o,a,e,p),d=h,++Zc),this.elementStart=this.elementSize,this._batchIndexStart=d,this._batchIndexSize=h;}_finishBatch(e,t,i,s,n,o,a,u){e.gpuBindGroup=null,e.bindGroup=null,e.action=u,e.batcher=this,e.textures=s,e.blendMode=n,e.topology=o,e.start=t,e.size=i,++Zc,this.batches[this.batchIndex++]=e,a.add(e);}finish(e){this.break(e);}ensureAttributeBuffer(e){e*4<=this.attributeBuffer.size||this._resizeAttributeBuffer(e*4);}ensureIndexBuffer(e){e<=this.indexBuffer.length||this._resizeIndexBuffer(e);}_resizeAttributeBuffer(e){let t=Math.max(e,this.attributeBuffer.size*2),i=new Ur(t);po(this.attributeBuffer.rawBinaryData,i.rawBinaryData),this.attributeBuffer=i;}_resizeIndexBuffer(e){let t=this.indexBuffer,i=Math.max(e,t.length*1.5);i+=i%2;let s=i>65535?new Uint32Array(i):new Uint16Array(i);if(s.BYTES_PER_ELEMENT!==t.BYTES_PER_ELEMENT)for(let n=0;n<t.length;n++)s[n]=t[n];else po(t.buffer,s.buffer);this.indexBuffer=s;}packQuadIndex(e,t,i){e[t]=i+0,e[t+1]=i+1,e[t+2]=i+2,e[t+3]=i+0,e[t+4]=i+2,e[t+5]=i+3;}packIndex(e,t,i,s){let n=e.indices,o=e.indexSize,a=e.indexOffset,u=e.attributeOffset;for(let l=0;l<o;l++)t[i++]=s+n[l+a]-u;}destroy(){for(let e=0;e<this.batches.length;e++)WA(this.batches[e]);this.batches=null;for(let e=0;e<this._elements.length;e++)this._elements[e]._batch=null;this._elements=null,this.indexBuffer=null,this.attributeBuffer.destroy(),this.attributeBuffer=null;}};YA.defaultOptions={maxTextures:null,attributesInitialSize:4,indicesInitialSize:6};zp=YA;});var he,Pi=f(()=>{he=(r=>(r[r.MAP_READ=1]="MAP_READ",r[r.MAP_WRITE=2]="MAP_WRITE",r[r.COPY_SRC=4]="COPY_SRC",r[r.COPY_DST=8]="COPY_DST",r[r.INDEX=16]="INDEX",r[r.VERTEX=32]="VERTEX",r[r.UNIFORM=64]="UNIFORM",r[r.STORAGE=128]="STORAGE",r[r.INDIRECT=256]="INDIRECT",r[r.QUERY_RESOLVE=512]="QUERY_RESOLVE",r[r.STATIC=1024]="STATIC",r))(he||{});});var tt,os=f(()=>{Ut();Et();Pi();tt=class extends _e{constructor(e){let{data:t,size:i}=e,{usage:s,label:n,shrinkToFit:o}=e;super(),this.uid=ce("buffer"),this._resourceType="buffer",this._resourceId=ce("resource"),this._touched=0,this._updateID=1,this._dataInt32=null,this.shrinkToFit=true,this.destroyed=false,t instanceof Array&&(t=new Float32Array(t)),this._data=t,i??(i=t?.byteLength);let a=!!t;this.descriptor={size:i,usage:s,mappedAtCreation:a,label:n},this.shrinkToFit=o??true;}get data(){return this._data}set data(e){this.setDataWithSize(e,e.length,true);}get dataInt32(){return this._dataInt32||(this._dataInt32=new Int32Array(this.data.buffer)),this._dataInt32}get static(){return !!(this.descriptor.usage&he.STATIC)}set static(e){e?this.descriptor.usage|=he.STATIC:this.descriptor.usage&=~he.STATIC;}setDataWithSize(e,t,i){if(this._updateID++,this._updateSize=t*e.BYTES_PER_ELEMENT,this._data===e){i&&this.emit("update",this);return}let s=this._data;if(this._data=e,this._dataInt32=null,!s||s.length!==e.length){!this.shrinkToFit&&s&&e.byteLength<s.byteLength?i&&this.emit("update",this):(this.descriptor.size=e.byteLength,this._resourceId=ce("resource"),this.emit("change",this));return}i&&this.emit("update",this);}update(e){this._updateSize=e??this._updateSize,this._updateID++,this.emit("update",this);}destroy(){this.destroyed=true,this.emit("destroy",this),this.emit("change",this),this._data=null,this.descriptor=null,this.removeAllListeners();}};});function Jc(r,e){if(!(r instanceof tt)){let t=e?he.INDEX:he.VERTEX;r instanceof Array&&(e?(r=new Uint32Array(r),t=he.INDEX|he.COPY_DST):(r=new Float32Array(r),t=he.VERTEX|he.COPY_DST)),r=new tt({data:r,label:e?"index-mesh-buffer":"vertex-mesh-buffer",usage:t});}return r}var u0=f(()=>{os();Pi();});function Wp(r,e,t){let i=r.getAttribute(e);if(!i)return t.minX=0,t.minY=0,t.maxX=0,t.maxY=0,t;let s=i.buffer.data,n=1/0,o=1/0,a=-1/0,u=-1/0,l=s.BYTES_PER_ELEMENT,c=(i.offset||0)/l,h=(i.stride||2*4)/l;for(let d=c;d<s.length;d+=h){let p=s[d],m=s[d+1];p>a&&(a=p),m>u&&(u=m),p<n&&(n=p),m<o&&(o=m);}return t.minX=n,t.minY=o,t.maxX=a,t.maxY=u,t}var l0=f(()=>{});function hD(r){return (r instanceof tt||Array.isArray(r)||r.BYTES_PER_ELEMENT)&&(r={buffer:r}),r.buffer=Jc(r.buffer,false),r}var jt,Ys=f(()=>{Ut();Lt();Et();os();u0();l0();jt=class extends _e{constructor(e={}){super(),this.uid=ce("geometry"),this._layoutKey=0,this.instanceCount=1,this._bounds=new Ae,this._boundsDirty=true;let{attributes:t,indexBuffer:i,topology:s}=e;if(this.buffers=[],this.attributes={},t)for(let n in t)this.addAttribute(n,t[n]);this.instanceCount=e.instanceCount??1,i&&this.addIndex(i),this.topology=s||"triangle-list";}onBufferUpdate(){this._boundsDirty=true,this.emit("update",this);}getAttribute(e){return this.attributes[e]}getIndex(){return this.indexBuffer}getBuffer(e){return this.getAttribute(e).buffer}getSize(){for(let e in this.attributes){let t=this.attributes[e];return t.buffer.data.length/(t.stride/4||t.size)}return 0}addAttribute(e,t){let i=hD(t);this.buffers.indexOf(i.buffer)===-1&&(this.buffers.push(i.buffer),i.buffer.on("update",this.onBufferUpdate,this),i.buffer.on("change",this.onBufferUpdate,this)),this.attributes[e]=i;}addIndex(e){this.indexBuffer=Jc(e,true),this.buffers.push(this.indexBuffer);}get bounds(){return this._boundsDirty?(this._boundsDirty=false,Wp(this,"aPosition",this._bounds)):this._bounds}destroy(e=false){this.emit("destroy",this),this.removeAllListeners(),e&&this.buffers.forEach(t=>t.destroy()),this.attributes=null,this.buffers=null,this.indexBuffer=null,this._bounds=null;}};});var dD,fD,Tu,c0=f(()=>{os();Pi();Ys();dD=new Float32Array(1),fD=new Uint32Array(1),Tu=class extends jt{constructor(){let t=new tt({data:dD,label:"attribute-batch-buffer",usage:he.VERTEX|he.COPY_DST,shrinkToFit:false}),i=new tt({data:fD,label:"index-batch-buffer",usage:he.INDEX|he.COPY_DST,shrinkToFit:false}),s=6*4;super({attributes:{aPosition:{buffer:t,format:"float32x2",stride:s,offset:0},aUV:{buffer:t,format:"float32x2",stride:s,offset:2*4},aColor:{buffer:t,format:"unorm8x4",stride:s,offset:4*4},aTextureIdAndRound:{buffer:t,format:"uint16x2",stride:s,offset:5*4}},indexBuffer:i});}};});function ai(r,e){let t=$A[r];return t===void 0&&(h0[e]===void 0&&(h0[e]=1),$A[r]=t=h0[e]++),t}var h0,$A,Su=f(()=>{h0=Object.create(null),$A=Object.create(null);});function Yp(){if(!Xp){Xp="mediump";let r=_u();r&&r.getShaderPrecisionFormat&&(Xp=r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).precision?"highp":"mediump");}return Xp}var Xp,d0=f(()=>{Np();});function jp(r,e,t){return e?r:t?(r=r.replace("out vec4 finalColor;",""),`
22
22
 
23
23
  #ifdef GL_ES // This checks if it is WebGL1
24
24
  #define in varying
@@ -198,7 +198,7 @@ ${s.join(`
198
198
  uniform mat3 uWorldTransformMatrix;
199
199
  uniform vec4 uWorldColorAlpha;
200
200
  uniform vec2 uResolution;
201
- `}};});function Nr({bits:r,name:e}){let t=im({template:{fragment:om,vertex:nm},bits:[lm,...r]});return $e.from({name:e,vertex:{source:t.vertex,entryPoint:"main"},fragment:{source:t.fragment,entryPoint:"main"}})}function Hr({bits:r,name:e}){return new je({name:e,...sm({template:{vertex:am,fragment:um},bits:[cm,...r]})})}var as=f(()=>{dr();Cr();k0();O0();F0();});var Ks,Zs,Cu=f(()=>{Ks={name:"color-bit",vertex:{header:`
201
+ `}};});function Lr({bits:r,name:e}){let t=im({template:{fragment:om,vertex:nm},bits:[lm,...r]});return $e.from({name:e,vertex:{source:t.vertex,entryPoint:"main"},fragment:{source:t.fragment,entryPoint:"main"}})}function Nr({bits:r,name:e}){return new je({name:e,...sm({template:{vertex:am,fragment:um},bits:[cm,...r]})})}var as=f(()=>{dr();Cr();k0();O0();F0();});var Ks,Zs,Cu=f(()=>{Ks={name:"color-bit",vertex:{header:`
202
202
  @in aColor: vec4<f32>;
203
203
  `,main:`
204
204
  vColor *= vec4<f32>(aColor.rgb * aColor.a, aColor.a);
@@ -247,17 +247,17 @@ ${s.join(`
247
247
  `,main:`
248
248
 
249
249
  ${ED(r)}
250
- `}}),U0[r]}var G0,U0,Au=f(()=>{G0={};U0={};});var Vr,zr,us=f(()=>{Vr={name:"round-pixels-bit",vertex:{header:`
250
+ `}}),U0[r]}var G0,U0,Au=f(()=>{G0={};U0={};});var Hr,Vr,us=f(()=>{Hr={name:"round-pixels-bit",vertex:{header:`
251
251
  fn roundPixels(position: vec2<f32>, targetSize: vec2<f32>) -> vec2<f32>
252
252
  {
253
253
  return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;
254
254
  }
255
- `}},zr={name:"round-pixels-bit",vertex:{header:`
255
+ `}},Vr={name:"round-pixels-bit",vertex:{header:`
256
256
  vec2 roundPixels(vec2 position, vec2 targetSize)
257
257
  {
258
258
  return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;
259
259
  }
260
- `}};});var sh,hm,L0=f(()=>{sh=["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>"],hm=sh.reduce((r,e)=>(r[e]=true,r),{});});function dm(r,e){switch(r){case "f32":return 0;case "vec2<f32>":return new Float32Array(2*e);case "vec3<f32>":return new Float32Array(3*e);case "vec4<f32>":return new Float32Array(4*e);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}var N0=f(()=>{});var rP,xe,ht=f(()=>{Et();Su();L0();N0();rP=class iP{constructor(e,t){this._touched=0,this.uid=ce("uniform"),this._resourceType="uniformGroup",this._resourceId=ce("resource"),this.isUniformGroup=true,this._dirtyId=0,this.destroyed=false,t={...iP.defaultOptions,...t},this.uniformStructures=e;let i={};for(let s in e){let n=e[s];if(n.name=s,n.size=n.size??1,!hm[n.type])throw new Error(`Uniform type ${n.type} is not supported. Supported uniform types are: ${sh.join(", ")}`);n.value??(n.value=dm(n.type,n.size)),i[s]=n.value;}this.uniforms=i,this._dirtyId=1,this.ubo=t.ubo,this.isStatic=t.isStatic,this._signature=ai(Object.keys(i).map(s=>`${s}-${e[s].type}`).join("-"),"uniform-group");}update(){this._dirtyId++;}};rP.defaultOptions={ubo:false,isStatic:false};xe=rP;});function en(r){let e=sP[r];if(e)return e;let t=new Int32Array(r);for(let i=0;i<r;i++)t[i]=i;return e=sP[r]=new xe({uTextures:{value:t,type:"i32",size:r}},{isStatic:true}),e}var sP,nh=f(()=>{ht();sP={};});var qe,Ar=f(()=>{qe=(r=>(r[r.WEBGL=1]="WEBGL",r[r.WEBGPU=2]="WEBGPU",r[r.BOTH=3]="BOTH",r))(qe||{});});var rt,Wr=f(()=>{Ut();Et();dr();ns();Cr();Ar();ht();rt=class r extends _e{constructor(e){super(),this.uid=ce("shader"),this._uniformBindMap=Object.create(null),this._ownedBindGroups=[];let{gpuProgram:t,glProgram:i,groups:s,resources:n,compatibleRenderers:o,groupMap:a}=e;this.gpuProgram=t,this.glProgram=i,o===void 0&&(o=0,t&&(o|=qe.WEBGPU),i&&(o|=qe.WEBGL)),this.compatibleRenderers=o;let u={};if(!n&&!s&&(n={}),n&&s)throw new Error("[Shader] Cannot have both resources and groups");if(!t&&s&&!a)throw new Error("[Shader] No group map or WebGPU shader provided - consider using resources instead.");if(!t&&s&&a)for(let l in a)for(let c in a[l]){let h=a[l][c];u[h]={group:l,binding:c,name:h};}else if(t&&s&&!a){let l=t.structsAndGroups.groups;a={},l.forEach(c=>{a[c.group]=a[c.group]||{},a[c.group][c.binding]=c.name,u[c.name]=c;});}else if(n){s={},a={},t&&t.structsAndGroups.groups.forEach(h=>{a[h.group]=a[h.group]||{},a[h.group][h.binding]=h.name,u[h.name]=h;});let l=0;for(let c in n)u[c]||(s[99]||(s[99]=new _t,this._ownedBindGroups.push(s[99])),u[c]={group:99,binding:l,name:c},a[99]=a[99]||{},a[99][l]=c,l++);for(let c in n){let h=c,d=n[c];!d.source&&!d._resourceType&&(d=new xe(d));let p=u[h];p&&(s[p.group]||(s[p.group]=new _t,this._ownedBindGroups.push(s[p.group])),s[p.group].setResource(d,p.binding));}}this.groups=s,this._uniformBindMap=a,this.resources=this._buildResourceAccessor(s,u);}addResource(e,t,i){var s,n;(s=this._uniformBindMap)[t]||(s[t]={}),(n=this._uniformBindMap[t])[i]||(n[i]=e),this.groups[t]||(this.groups[t]=new _t,this._ownedBindGroups.push(this.groups[t]));}_buildResourceAccessor(e,t){let i={};for(let s in t){let n=t[s];Object.defineProperty(i,n.name,{get(){return e[n.group].getResource(n.binding)},set(o){e[n.group].setResource(o,n.binding);}});}return i}destroy(e=false){this.emit("destroy",this),e&&(this.gpuProgram?.destroy(),this.glProgram?.destroy()),this.gpuProgram=null,this.glProgram=null,this.removeAllListeners(),this._uniformBindMap=null,this._ownedBindGroups.forEach(t=>{t.destroy();}),this._ownedBindGroups=null,this.resources=null,this.groups=null;}static from(e){let{gpu:t,gl:i,...s}=e,n,o;return t&&(n=$e.from(t)),i&&(o=je.from(i)),new r({gpuProgram:n,glProgram:o,...s})}};});var Pu,H0=f(()=>{as();Cu();Au();us();nh();Wr();Pu=class extends rt{constructor(e){let t=Hr({name:"batch",bits:[Zs,Js(e),zr]}),i=Nr({name:"batch",bits:[Ks,Qs(e),Vr]});super({glProgram:t,gpuProgram:i,resources:{batchSamplers:en(e)}});}};});var V0,nP,mo,fm=f(()=>{B();a0();c0();H0();V0=null,nP=class oP extends zp{constructor(e){super(e),this.geometry=new Tu,this.name=oP.extension.name,this.vertexSize=6,V0??(V0=new Pu(e.maxTextures)),this.shader=V0;}packAttributes(e,t,i,s,n){let o=n<<16|e.roundPixels&65535,a=e.transform,u=a.a,l=a.b,c=a.c,h=a.d,d=a.tx,p=a.ty,{positions:m,uvs:b}=e,_=e.color,g=e.attributeOffset,y=g+e.attributeSize;for(let S=g;S<y;S++){let E=S*2,F=m[E],T=m[E+1];t[s++]=u*F+c*T+d,t[s++]=h*T+l*F+p,t[s++]=b[E],t[s++]=b[E+1],i[s++]=_,i[s++]=o;}}packQuadAttributes(e,t,i,s,n){let o=e.texture,a=e.transform,u=a.a,l=a.b,c=a.c,h=a.d,d=a.tx,p=a.ty,m=e.bounds,b=m.maxX,_=m.minX,g=m.maxY,y=m.minY,S=o.uvs,E=e.color,F=n<<16|e.roundPixels&65535;t[s+0]=u*_+c*y+d,t[s+1]=h*y+l*_+p,t[s+2]=S.x0,t[s+3]=S.y0,i[s+4]=E,i[s+5]=F,t[s+6]=u*b+c*y+d,t[s+7]=h*y+l*b+p,t[s+8]=S.x1,t[s+9]=S.y1,i[s+10]=E,i[s+11]=F,t[s+12]=u*b+c*g+d,t[s+13]=h*g+l*b+p,t[s+14]=S.x2,t[s+15]=S.y2,i[s+16]=E,i[s+17]=F,t[s+18]=u*_+c*g+d,t[s+19]=h*g+l*_+p,t[s+20]=S.x3,t[s+21]=S.y3,i[s+22]=E,i[s+23]=F;}};nP.extension={type:[x.Batcher],name:"default"};mo=nP;});function pm(r,e,t,i,s,n,o,a=null){let u=0;t*=e,s*=n;let l=a.a,c=a.b,h=a.c,d=a.d,p=a.tx,m=a.ty;for(;u<o;){let b=r[t],_=r[t+1];i[s]=l*b+h*_+p,i[s+1]=c*b+d*_+m,s+=n,t+=e,u++;}}function mm(r,e,t,i){let s=0;for(e*=t;s<i;)r[e]=0,r[e+1]=0,e+=t,s++;}var z0=f(()=>{});function oh(r,e,t,i,s){let n=e.a,o=e.b,a=e.c,u=e.d,l=e.tx,c=e.ty;t||(t=0),i||(i=2),s||(s=r.length/i-t);let h=t*i;for(let d=0;d<s;d++){let p=r[h],m=r[h+1];r[h]=n*p+a*m+l,r[h+1]=o*p+u*m+c,h+=i;}}var W0=f(()=>{});var CD,ls,gm=f(()=>{Te();tp();CD=new G,ls=class{constructor(){this.packAsQuad=false,this.batcherName="default",this.topology="triangle-list",this.applyTransform=true,this.roundPixels=0,this._batcher=null,this._batch=null;}get uvs(){return this.geometryData.uvs}get positions(){return this.geometryData.vertices}get indices(){return this.geometryData.indices}get blendMode(){return this.renderable&&this.applyTransform?this.renderable.groupBlendMode:"normal"}get color(){let e=this.baseColor,t=e>>16|e&65280|(e&255)<<16,i=this.renderable;return i?au(t,i.groupColor)+(this.alpha*i.groupAlpha*255<<24):t+(this.alpha*255<<24)}get transform(){return this.renderable?.groupTransform||CD}copyTo(e){e.indexOffset=this.indexOffset,e.indexSize=this.indexSize,e.attributeOffset=this.attributeOffset,e.attributeSize=this.attributeSize,e.baseColor=this.baseColor,e.alpha=this.alpha,e.texture=this.texture,e.geometryData=this.geometryData,e.topology=this.topology;}reset(){this.applyTransform=true,this.renderable=null,this.topology="triangle-list";}};});var tn,xm,_m,X0=f(()=>{B();tn={extension:{type:x.ShapeBuilder,name:"circle"},build(r,e){let t,i,s,n,o,a;if(r.type==="circle"){let E=r;if(o=a=E.radius,o<=0)return false;t=E.x,i=E.y,s=n=0;}else if(r.type==="ellipse"){let E=r;if(o=E.halfWidth,a=E.halfHeight,o<=0||a<=0)return false;t=E.x,i=E.y,s=n=0;}else {let E=r,F=E.width/2,T=E.height/2;t=E.x+F,i=E.y+T,o=a=Math.max(0,Math.min(E.radius,Math.min(F,T))),s=F-o,n=T-a;}if(s<0||n<0)return false;let u=Math.ceil(2.3*Math.sqrt(o+a)),l=u*8+(s?4:0)+(n?4:0);if(l===0)return false;if(u===0)return e[0]=e[6]=t+s,e[1]=e[3]=i+n,e[2]=e[4]=t-s,e[5]=e[7]=i-n,true;let c=0,h=u*4+(s?2:0)+2,d=h,p=l,m=s+o,b=n,_=t+m,g=t-m,y=i+b;if(e[c++]=_,e[c++]=y,e[--h]=y,e[--h]=g,n){let E=i-b;e[d++]=g,e[d++]=E,e[--p]=E,e[--p]=_;}for(let E=1;E<u;E++){let F=Math.PI/2*(E/u),T=s+Math.cos(F)*o,C=n+Math.sin(F)*a,A=t+T,P=t-T,M=i+C,k=i-C;e[c++]=A,e[c++]=M,e[--h]=M,e[--h]=P,e[d++]=P,e[d++]=k,e[--p]=k,e[--p]=A;}m=s,b=n+a,_=t+m,g=t-m,y=i+b;let S=i-b;return e[c++]=_,e[c++]=y,e[--p]=S,e[--p]=_,s&&(e[c++]=g,e[c++]=y,e[--p]=S,e[--p]=g),true},triangulate(r,e,t,i,s,n){if(r.length===0)return;let o=0,a=0;for(let c=0;c<r.length;c+=2)o+=r[c],a+=r[c+1];o/=r.length/2,a/=r.length/2;let u=i;e[u*t]=o,e[u*t+1]=a;let l=u++;for(let c=0;c<r.length;c+=2)e[u*t]=r[c],e[u*t+1]=r[c+1],c>0&&(s[n++]=u,s[n++]=l,s[n++]=u-1),u++;s[n++]=l+1,s[n++]=l,s[n++]=u-1;}},xm={...tn,extension:{...tn.extension,name:"ellipse"}},_m={...tn,extension:{...tn.extension,name:"roundedRectangle"}};});var bm,ym,aP=f(()=>{bm=1e-4,ym=1e-4;});function vm(r){let e=r.length;if(e<6)return 1;let t=0;for(let i=0,s=r[e-2],n=r[e-1];i<e;i+=2){let o=r[i],a=r[i+1];t+=(o-s)*(a+n),s=o,n=a;}return t<0?-1:1}var Y0=f(()=>{});function uP(r,e,t,i,s,n,o,a){let u=r-t*s,l=e-i*s,c=r+t*n,h=e+i*n,d,p;o?(d=i,p=-t):(d=-i,p=t);let m=u+d,b=l+p,_=c+d,g=h+p;return a.push(m,b),a.push(_,g),2}function go(r,e,t,i,s,n,o,a){let u=t-r,l=i-e,c=Math.atan2(u,l),h=Math.atan2(s-r,n-e);a&&c<h?c+=Math.PI*2:!a&&c>h&&(h+=Math.PI*2);let d=c,p=h-c,m=Math.abs(p),b=Math.sqrt(u*u+l*l),_=(15*m*Math.sqrt(b)/Math.PI>>0)+1,g=p/_;if(d+=g,a){o.push(r,e),o.push(t,i);for(let y=1,S=d;y<_;y++,S+=g)o.push(r,e),o.push(r+Math.sin(S)*b,e+Math.cos(S)*b);o.push(r,e),o.push(s,n);}else {o.push(t,i),o.push(r,e);for(let y=1,S=d;y<_;y++,S+=g)o.push(r+Math.sin(S)*b,e+Math.cos(S)*b),o.push(r,e);o.push(s,n),o.push(r,e);}return _*2}function Tm(r,e,t,i,s,n){let o=1e-4;if(r.length===0)return;let a=e,u=a.alignment;if(e.alignment!==.5){let Re=vm(r);t&&(Re*=-1),u=(u-.5)*Re+.5;}let l=new me(r[0],r[1]),c=new me(r[r.length-2],r[r.length-1]),h=i,d=Math.abs(l.x-c.x)<o&&Math.abs(l.y-c.y)<o;if(h){r=r.slice(),d&&(r.pop(),r.pop(),c.set(r[r.length-2],r[r.length-1]));let Re=(l.x+c.x)*.5,mt=(c.y+l.y)*.5;r.unshift(Re,mt),r.push(Re,mt);}let p=s,m=r.length/2,b=r.length,_=p.length/2,g=a.width/2,y=g*g,S=a.miterLimit*a.miterLimit,E=r[0],F=r[1],T=r[2],C=r[3],A=0,P=0,M=-(F-C),k=E-T,L=0,pe=0,ve=Math.sqrt(M*M+k*k);M/=ve,k/=ve,M*=g,k*=g;let Or=u,X=(1-Or)*2,Q=Or*2;h||(a.cap==="round"?b+=go(E-M*(X-Q)*.5,F-k*(X-Q)*.5,E-M*X,F-k*X,E+M*Q,F+k*Q,p,true)+2:a.cap==="square"&&(b+=uP(E,F,M,k,X,Q,true,p))),p.push(E-M*X,F-k*X),p.push(E+M*Q,F+k*Q);for(let Re=1;Re<m-1;++Re){E=r[(Re-1)*2],F=r[(Re-1)*2+1],T=r[Re*2],C=r[Re*2+1],A=r[(Re+1)*2],P=r[(Re+1)*2+1],M=-(F-C),k=E-T,ve=Math.sqrt(M*M+k*k),M/=ve,k/=ve,M*=g,k*=g,L=-(C-P),pe=T-A,ve=Math.sqrt(L*L+pe*pe),L/=ve,pe/=ve,L*=g,pe*=g;let mt=T-E,Zr=F-C,As=T-A,Ps=P-C,Pc=mt*As+Zr*Ps,qi=Zr*As-Ps*mt,Ki=qi<0;if(Math.abs(qi)<.001*Math.abs(Pc)){p.push(T-M*X,C-k*X),p.push(T+M*Q,C+k*Q),Pc>=0&&(a.join==="round"?b+=go(T,C,T-M*X,C-k*X,T-L*X,C-pe*X,p,false)+4:b+=2,p.push(T-L*Q,C-pe*Q),p.push(T+L*X,C+pe*X));continue}let eu=(-M+E)*(-k+C)-(-M+T)*(-k+F),DC=(-L+A)*(-pe+C)-(-L+T)*(-pe+P),kf=(mt*DC-As*eu)/qi,Of=(Ps*eu-Zr*DC)/qi,qb=(kf-T)*(kf-T)+(Of-C)*(Of-C),Yn=T+(kf-T)*X,jn=C+(Of-C)*X,$n=T-(kf-T)*Q,qn=C-(Of-C)*Q,bI=Math.min(mt*mt+Zr*Zr,As*As+Ps*Ps),kC=Ki?X:Q,yI=bI+kC*kC*y;qb<=yI?a.join==="bevel"||qb/y>S?(Ki?(p.push(Yn,jn),p.push(T+M*Q,C+k*Q),p.push(Yn,jn),p.push(T+L*Q,C+pe*Q)):(p.push(T-M*X,C-k*X),p.push($n,qn),p.push(T-L*X,C-pe*X),p.push($n,qn)),b+=2):a.join==="round"?Ki?(p.push(Yn,jn),p.push(T+M*Q,C+k*Q),b+=go(T,C,T+M*Q,C+k*Q,T+L*Q,C+pe*Q,p,true)+4,p.push(Yn,jn),p.push(T+L*Q,C+pe*Q)):(p.push(T-M*X,C-k*X),p.push($n,qn),b+=go(T,C,T-M*X,C-k*X,T-L*X,C-pe*X,p,false)+4,p.push(T-L*X,C-pe*X),p.push($n,qn)):(p.push(Yn,jn),p.push($n,qn)):(p.push(T-M*X,C-k*X),p.push(T+M*Q,C+k*Q),a.join==="round"?Ki?b+=go(T,C,T+M*Q,C+k*Q,T+L*Q,C+pe*Q,p,true)+2:b+=go(T,C,T-M*X,C-k*X,T-L*X,C-pe*X,p,false)+2:a.join==="miter"&&qb/y<=S&&(Ki?(p.push($n,qn),p.push($n,qn)):(p.push(Yn,jn),p.push(Yn,jn)),b+=2),p.push(T-L*X,C-pe*X),p.push(T+L*Q,C+pe*Q),b+=2);}E=r[(m-2)*2],F=r[(m-2)*2+1],T=r[(m-1)*2],C=r[(m-1)*2+1],M=-(F-C),k=E-T,ve=Math.sqrt(M*M+k*k),M/=ve,k/=ve,M*=g,k*=g,p.push(T-M*X,C-k*X),p.push(T+M*Q,C+k*Q),h||(a.cap==="round"?b+=go(T-M*(X-Q)*.5,C-k*(X-Q)*.5,T-M*X,C-k*X,T+M*Q,C+k*Q,p,false)+2:a.cap==="square"&&(b+=uP(T,C,M,k,X,Q,false,p)));let Ye=1e-4*1e-4;for(let Re=_;Re<b+_-2;++Re)E=p[Re*2],F=p[Re*2+1],T=p[(Re+1)*2],C=p[(Re+1)*2+1],A=p[(Re+2)*2],P=p[(Re+2)*2+1],!(Math.abs(E*(C-P)+T*(P-F)+A*(F-C))<Ye)&&n.push(Re,Re+1,Re+2);}var j0=f(()=>{cr();Y0();});function Sm(r,e,t,i){let s=1e-4;if(r.length===0)return;let n=r[0],o=r[1],a=r[r.length-2],u=r[r.length-1],l=e||Math.abs(n-a)<s&&Math.abs(o-u)<s,c=t,h=r.length/2,d=c.length/2;for(let p=0;p<h;p++)c.push(r[p*2]),c.push(r[p*2+1]);for(let p=0;p<h-1;p++)i.push(d+p,d+p+1);l&&i.push(d+h-1,d);}var $0=f(()=>{});function Am(r,e,t=2){let i=e&&e.length,s=i?e[0]*t:r.length,n=cP(r,0,s,t,true),o=[];if(!n||n.next===n.prev)return o;let a,u,l;if(i&&(n=RD(r,e,n,t)),r.length>80*t){a=1/0,u=1/0;let c=-1/0,h=-1/0;for(let d=t;d<s;d+=t){let p=r[d],m=r[d+1];p<a&&(a=p),m<u&&(u=m),p>c&&(c=p),m>h&&(h=m);}l=Math.max(c-a,h-u),l=l!==0?32767/l:0;}return uh(n,o,t,a,u,l,0),o}function cP(r,e,t,i,s){let n;if(s===HD(r,e,t,i)>0)for(let o=e;o<t;o+=i)n=lP(o/i|0,r[o],r[o+1],n);else for(let o=t-i;o>=e;o-=i)n=lP(o/i|0,r[o],r[o+1],n);return n&&wu(n,n.next)&&(ch(n),n=n.next),n}function xo(r,e){if(!r)return r;e||(e=r);let t=r,i;do if(i=false,!t.steiner&&(wu(t,t.next)||ot(t.prev,t,t.next)===0)){if(ch(t),t=e=t.prev,t===t.next)break;i=true;}else t=t.next;while(i||t!==e);return e}function uh(r,e,t,i,s,n,o){if(!r)return;!o&&n&&OD(r,i,s,n);let a=r;for(;r.prev!==r.next;){let u=r.prev,l=r.next;if(n?PD(r,i,s,n):AD(r)){e.push(u.i,r.i,l.i),ch(r),r=l.next,a=l.next;continue}if(r=l,r===a){o?o===1?(r=wD(xo(r),e),uh(r,e,t,i,s,n,2)):o===2&&BD(r,e,t,i,s,n):uh(xo(r),e,t,i,s,n,1);break}}}function AD(r){let e=r.prev,t=r,i=r.next;if(ot(e,t,i)>=0)return false;let s=e.x,n=t.x,o=i.x,a=e.y,u=t.y,l=i.y,c=Math.min(s,n,o),h=Math.min(a,u,l),d=Math.max(s,n,o),p=Math.max(a,u,l),m=i.next;for(;m!==e;){if(m.x>=c&&m.x<=d&&m.y>=h&&m.y<=p&&ah(s,a,n,u,o,l,m.x,m.y)&&ot(m.prev,m,m.next)>=0)return false;m=m.next;}return true}function PD(r,e,t,i){let s=r.prev,n=r,o=r.next;if(ot(s,n,o)>=0)return false;let a=s.x,u=n.x,l=o.x,c=s.y,h=n.y,d=o.y,p=Math.min(a,u,l),m=Math.min(c,h,d),b=Math.max(a,u,l),_=Math.max(c,h,d),g=q0(p,m,e,t,i),y=q0(b,_,e,t,i),S=r.prevZ,E=r.nextZ;for(;S&&S.z>=g&&E&&E.z<=y;){if(S.x>=p&&S.x<=b&&S.y>=m&&S.y<=_&&S!==s&&S!==o&&ah(a,c,u,h,l,d,S.x,S.y)&&ot(S.prev,S,S.next)>=0||(S=S.prevZ,E.x>=p&&E.x<=b&&E.y>=m&&E.y<=_&&E!==s&&E!==o&&ah(a,c,u,h,l,d,E.x,E.y)&&ot(E.prev,E,E.next)>=0))return false;E=E.nextZ;}for(;S&&S.z>=g;){if(S.x>=p&&S.x<=b&&S.y>=m&&S.y<=_&&S!==s&&S!==o&&ah(a,c,u,h,l,d,S.x,S.y)&&ot(S.prev,S,S.next)>=0)return false;S=S.prevZ;}for(;E&&E.z<=y;){if(E.x>=p&&E.x<=b&&E.y>=m&&E.y<=_&&E!==s&&E!==o&&ah(a,c,u,h,l,d,E.x,E.y)&&ot(E.prev,E,E.next)>=0)return false;E=E.nextZ;}return true}function wD(r,e){let t=r;do{let i=t.prev,s=t.next.next;!wu(i,s)&&dP(i,t,t.next,s)&&lh(i,s)&&lh(s,i)&&(e.push(i.i,t.i,s.i),ch(t),ch(t.next),t=r=s),t=t.next;}while(t!==r);return xo(t)}function BD(r,e,t,i,s,n){let o=r;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&UD(o,a)){let u=fP(o,a);o=xo(o,o.next),u=xo(u,u.next),uh(o,e,t,i,s,n,0),uh(u,e,t,i,s,n,0);return}a=a.next;}o=o.next;}while(o!==r)}function RD(r,e,t,i){let s=[];for(let n=0,o=e.length;n<o;n++){let a=e[n]*i,u=n<o-1?e[n+1]*i:r.length,l=cP(r,a,u,i,false);l===l.next&&(l.steiner=true),s.push(GD(l));}s.sort(MD);for(let n=0;n<s.length;n++)t=ID(s[n],t);return t}function MD(r,e){let t=r.x-e.x;if(t===0&&(t=r.y-e.y,t===0)){let i=(r.next.y-r.y)/(r.next.x-r.x),s=(e.next.y-e.y)/(e.next.x-e.x);t=i-s;}return t}function ID(r,e){let t=DD(r,e);if(!t)return e;let i=fP(t,r);return xo(i,i.next),xo(t,t.next)}function DD(r,e){let t=e,i=r.x,s=r.y,n=-1/0,o;if(wu(r,t))return t;do{if(wu(r,t.next))return t.next;if(s<=t.y&&s>=t.next.y&&t.next.y!==t.y){let h=t.x+(s-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(h<=i&&h>n&&(n=h,o=t.x<t.next.x?t:t.next,h===i))return o}t=t.next;}while(t!==e);if(!o)return null;let a=o,u=o.x,l=o.y,c=1/0;t=o;do{if(i>=t.x&&t.x>=u&&i!==t.x&&hP(s<l?i:n,s,u,l,s<l?n:i,s,t.x,t.y)){let h=Math.abs(s-t.y)/(i-t.x);lh(t,r)&&(h<c||h===c&&(t.x>o.x||t.x===o.x&&kD(o,t)))&&(o=t,c=h);}t=t.next;}while(t!==a);return o}function kD(r,e){return ot(r.prev,r,e.prev)<0&&ot(e.next,r,r.next)<0}function OD(r,e,t,i){let s=r;do s.z===0&&(s.z=q0(s.x,s.y,e,t,i)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next;while(s!==r);s.prevZ.nextZ=null,s.prevZ=null,FD(s);}function FD(r){let e,t=1;do{let i=r,s;r=null;let n=null;for(e=0;i;){e++;let o=i,a=0;for(let l=0;l<t&&(a++,o=o.nextZ,!!o);l++);let u=t;for(;a>0||u>0&&o;)a!==0&&(u===0||!o||i.z<=o.z)?(s=i,i=i.nextZ,a--):(s=o,o=o.nextZ,u--),n?n.nextZ=s:r=s,s.prevZ=n,n=s;i=o;}n.nextZ=null,t*=2;}while(e>1);return r}function q0(r,e,t,i,s){return r=(r-t)*s|0,e=(e-i)*s|0,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,r|e<<1}function GD(r){let e=r,t=r;do(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next;while(e!==r);return t}function hP(r,e,t,i,s,n,o,a){return (s-o)*(e-a)>=(r-o)*(n-a)&&(r-o)*(i-a)>=(t-o)*(e-a)&&(t-o)*(n-a)>=(s-o)*(i-a)}function ah(r,e,t,i,s,n,o,a){return !(r===o&&e===a)&&hP(r,e,t,i,s,n,o,a)}function UD(r,e){return r.next.i!==e.i&&r.prev.i!==e.i&&!LD(r,e)&&(lh(r,e)&&lh(e,r)&&ND(r,e)&&(ot(r.prev,r,e.prev)||ot(r,e.prev,e))||wu(r,e)&&ot(r.prev,r,r.next)>0&&ot(e.prev,e,e.next)>0)}function ot(r,e,t){return (e.y-r.y)*(t.x-e.x)-(e.x-r.x)*(t.y-e.y)}function wu(r,e){return r.x===e.x&&r.y===e.y}function dP(r,e,t,i){let s=Cm(ot(r,e,t)),n=Cm(ot(r,e,i)),o=Cm(ot(t,i,r)),a=Cm(ot(t,i,e));return !!(s!==n&&o!==a||s===0&&Em(r,t,e)||n===0&&Em(r,i,e)||o===0&&Em(t,r,i)||a===0&&Em(t,e,i))}function Em(r,e,t){return e.x<=Math.max(r.x,t.x)&&e.x>=Math.min(r.x,t.x)&&e.y<=Math.max(r.y,t.y)&&e.y>=Math.min(r.y,t.y)}function Cm(r){return r>0?1:r<0?-1:0}function LD(r,e){let t=r;do{if(t.i!==r.i&&t.next.i!==r.i&&t.i!==e.i&&t.next.i!==e.i&&dP(t,t.next,r,e))return true;t=t.next;}while(t!==r);return false}function lh(r,e){return ot(r.prev,r,r.next)<0?ot(r,e,r.next)>=0&&ot(r,r.prev,e)>=0:ot(r,e,r.prev)<0||ot(r,r.next,e)<0}function ND(r,e){let t=r,i=false,s=(r.x+e.x)/2,n=(r.y+e.y)/2;do t.y>n!=t.next.y>n&&t.next.y!==t.y&&s<(t.next.x-t.x)*(n-t.y)/(t.next.y-t.y)+t.x&&(i=!i),t=t.next;while(t!==r);return i}function fP(r,e){let t=K0(r.i,r.x,r.y),i=K0(e.i,e.x,e.y),s=r.next,n=e.prev;return r.next=e,e.prev=r,t.next=s,s.prev=t,i.next=t,t.prev=i,n.next=i,i.prev=n,i}function lP(r,e,t,i){let s=K0(r,e,t);return i?(s.next=i.next,s.prev=i,i.next.prev=s,i.next=s):(s.prev=s,s.next=s),s}function ch(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ);}function K0(r,e,t){return {i:r,x:e,y:t,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:false}}function HD(r,e,t,i){let s=0;for(let n=e,o=t-i;n<t;n+=i)s+=(r[o]-r[n])*(r[n+1]+r[o+1]),o=n;return s}var pP=f(()=>{});var Pm,Z0=f(()=>{pP();Ut();Pm=Am.default||Am;});function Bu(r,e,t,i,s,n,o){let a=Pm(r,e,2);if(!a)return;for(let l=0;l<a.length;l+=3)n[o++]=a[l]+s,n[o++]=a[l+1]+s,n[o++]=a[l+2]+s;let u=s*i;for(let l=0;l<r.length;l+=2)t[u]=r[l],t[u+1]=r[l+1],u+=i;}var wm=f(()=>{Z0();});var VD,Bm,Q0=f(()=>{B();wm();VD=[],Bm={extension:{type:x.ShapeBuilder,name:"polygon"},build(r,e){for(let t=0;t<r.points.length;t++)e[t]=r.points[t];return true},triangulate(r,e,t,i,s,n){Bu(r,VD,e,t,i,s,n);}};});var Rm,J0=f(()=>{B();Rm={extension:{type:x.ShapeBuilder,name:"rectangle"},build(r,e){let t=r,i=t.x,s=t.y,n=t.width,o=t.height;return n>0&&o>0?(e[0]=i,e[1]=s,e[2]=i+n,e[3]=s,e[4]=i+n,e[5]=s+o,e[6]=i,e[7]=s+o,true):false},triangulate(r,e,t,i,s,n){let o=0;i*=t,e[i+o]=r[0],e[i+o+1]=r[1],o+=t,e[i+o]=r[2],e[i+o+1]=r[3],o+=t,e[i+o]=r[6],e[i+o+1]=r[7],o+=t,e[i+o]=r[4],e[i+o+1]=r[5],o+=t;let a=i/t;s[n++]=a,s[n++]=a+1,s[n++]=a+2,s[n++]=a+1,s[n++]=a+3,s[n++]=a+2;}};});var Mm,ev=f(()=>{B();Mm={extension:{type:x.ShapeBuilder,name:"triangle"},build(r,e){return e[0]=r.x,e[1]=r.y,e[2]=r.x2,e[3]=r.y2,e[4]=r.x3,e[5]=r.y3,true},triangulate(r,e,t,i,s,n){let o=0;i*=t,e[i+o]=r[0],e[i+o+1]=r[1],o+=t,e[i+o]=r[2],e[i+o+1]=r[3],o+=t,e[i+o]=r[4],e[i+o+1]=r[5];let a=i/t;s[n++]=a,s[n++]=a+1,s[n++]=a+2;}};});function gP(r,e){for(let t=0;t<e.length;t++){let i=e[t];r.addColorStop(i.offset,i.color);}}function xP(r,e){let t=j.get().createCanvas(r,e),i=t.getContext("2d");return {canvas:t,context:i}}function zD(r){let e=r[0]??{};return (typeof e=="number"||r[1])&&(U("8.5.2","use options object instead"),e={type:"linear",start:{x:r[0],y:r[1]},end:{x:r[2],y:r[3]},textureSpace:r[4],textureSize:r[5]??qt.defaultLinearOptions.textureSize}),e}var mP,rv,qt,_o=f(()=>{gt();Ge();Te();fo();ye();Et();Pe();Ds();mP=[{offset:0,color:"white"},{offset:1,color:"black"}],rv=class tv{constructor(...e){this.uid=ce("fillGradient"),this.type="linear",this.colorStops=[];let t=zD(e);t={...t.type==="radial"?tv.defaultRadialOptions:tv.defaultLinearOptions,...Rt(t)},this._textureSize=t.textureSize,this._wrapMode=t.wrapMode,t.type==="radial"?(this.center=t.center,this.outerCenter=t.outerCenter??this.center,this.innerRadius=t.innerRadius,this.outerRadius=t.outerRadius,this.scale=t.scale,this.rotation=t.rotation):(this.start=t.start,this.end=t.end),this.textureSpace=t.textureSpace,this.type=t.type,t.colorStops.forEach(s=>{this.addColorStop(s.offset,s.color);});}addColorStop(e,t){return this.colorStops.push({offset:e,color:te.shared.setValue(t).toHexa()}),this}buildLinearGradient(){if(this.texture)return;let{x:e,y:t}=this.start,{x:i,y:s}=this.end,n=i-e,o=s-t,a=n<0||o<0;if(this._wrapMode==="clamp-to-edge"){if(n<0){let _=e;e=i,i=_,n*=-1;}if(o<0){let _=t;t=s,s=_,o*=-1;}}let u=this.colorStops.length?this.colorStops:mP,l=this._textureSize,{canvas:c,context:h}=xP(l,1),d=a?h.createLinearGradient(this._textureSize,0,0,0):h.createLinearGradient(0,0,this._textureSize,0);gP(d,u),h.fillStyle=d,h.fillRect(0,0,l,1),this.texture=new exports.Texture({source:new Yt({resource:c,addressMode:this._wrapMode})});let p=Math.sqrt(n*n+o*o),m=Math.atan2(o,n),b=new G;b.scale(p/l,1),b.rotate(m),b.translate(e,t),this.textureSpace==="local"&&b.scale(l,l),this.transform=b;}buildGradient(){this.type==="linear"?this.buildLinearGradient():this.buildRadialGradient();}buildRadialGradient(){if(this.texture)return;let e=this.colorStops.length?this.colorStops:mP,t=this._textureSize,{canvas:i,context:s}=xP(t,t),{x:n,y:o}=this.center,{x:a,y:u}=this.outerCenter,l=this.innerRadius,c=this.outerRadius,h=a-c,d=u-c,p=t/(c*2),m=(n-h)*p,b=(o-d)*p,_=s.createRadialGradient(m,b,l*p,(a-h)*p,(u-d)*p,c*p);gP(_,e),s.fillStyle=e[e.length-1].color,s.fillRect(0,0,t,t),s.fillStyle=_,s.translate(m,b),s.rotate(this.rotation),s.scale(1,this.scale),s.translate(-m,-b),s.fillRect(0,0,t,t),this.texture=new exports.Texture({source:new Yt({resource:i,addressMode:this._wrapMode})});let g=new G;g.scale(1/p,1/p),g.translate(h,d),this.textureSpace==="local"&&g.scale(t,t),this.transform=g;}get styleKey(){return this.uid}destroy(){this.texture?.destroy(true),this.texture=null;}};rv.defaultLinearOptions={start:{x:0,y:0},end:{x:0,y:1},colorStops:[],textureSpace:"local",type:"linear",textureSize:256,wrapMode:"clamp-to-edge"};rv.defaultRadialOptions={center:{x:.5,y:.5},innerRadius:0,outerRadius:.5,colorStops:[],scale:1,textureSpace:"local",type:"radial",textureSize:256,wrapMode:"clamp-to-edge"};qt=rv;});function Im(r,e,t,i){let s=e.matrix?r.copyFrom(e.matrix).invert():r.identity();if(e.textureSpace==="local"){let o=t.getBounds(XD);e.width&&o.pad(e.width);let{x:a,y:u}=o,l=1/o.width,c=1/o.height,h=-a*l,d=-u*c,p=s.a,m=s.b,b=s.c,_=s.d;s.a*=l,s.b*=l,s.c*=c,s.d*=c,s.tx=h*p+d*b+s.tx,s.ty=h*m+d*_+s.ty;}else s.translate(e.texture.frame.x,e.texture.frame.y),s.scale(1/e.texture.source.width,1/e.texture.source.height);let n=e.texture.source.style;return !(e.fill instanceof qt)&&n.addressMode==="clamp-to-edge"&&(n.addressMode="repeat",n.update()),i&&s.append(WD.copyFrom(i).invert()),s}var WD,XD,iv=f(()=>{Te();ct();_o();WD=new G,XD=new exports.Rectangle;});function Dm(r,e){let{geometryData:t,batches:i}=e;i.length=0,t.indices.length=0,t.vertices.length=0,t.uvs.length=0;for(let s=0;s<r.instructions.length;s++){let n=r.instructions[s];if(n.action==="texture")$D(n.data,i,t);else if(n.action==="fill"||n.action==="stroke"){let o=n.action==="stroke",a=n.data.path.shapePath,u=n.data.style,l=n.data.hole;o&&l&&_P(l.shapePath,u,true,i,t),l&&(a.shapePrimitives[a.shapePrimitives.length-1].holes=l.shapePath.shapePrimitives),_P(a,u,o,i,t);}}}function $D(r,e,t){let i=[],s=Ru.rectangle,n=YD;n.x=r.dx,n.y=r.dy,n.width=r.dw,n.height=r.dh;let o=r.transform;if(!s.build(n,i))return;let{vertices:a,uvs:u,indices:l}=t,c=l.length,h=a.length/2;o&&oh(i,o),s.triangulate(i,a,2,h,l,c);let d=r.image,p=d.uvs;u.push(p.x0,p.y0,p.x1,p.y1,p.x3,p.y3,p.x2,p.y2);let m=Ve.get(ls);m.indexOffset=c,m.indexSize=l.length-c,m.attributeOffset=h,m.attributeSize=a.length/2-h,m.baseColor=r.style,m.alpha=r.alpha,m.texture=d,m.geometryData=t,e.push(m);}function _P(r,e,t,i,s){let{vertices:n,uvs:o,indices:a}=s;r.shapePrimitives.forEach(({shape:u,transform:l,holes:c})=>{let h=[],d=Ru[u.type];if(!d.build(u,h))return;let p=a.length,m=n.length/2,b="triangle-list";if(l&&oh(h,l),t){let S=u.closePath??true,E=e;E.pixelLine?(Sm(h,S,n,a),b="line-list"):Tm(h,E,false,S,n,a);}else if(c){let S=[],E=h.slice();qD(c).forEach(T=>{S.push(E.length/2),E.push(...T);}),Bu(E,S,n,2,m,a,p);}else d.triangulate(h,n,2,m,a,p);let _=o.length/2,g=e.texture;if(g!==exports.Texture.WHITE){let S=Im(jD,e,u,l);pm(n,2,m,o,_,2,n.length/2-m,S);}else mm(o,_,2,n.length/2-m);let y=Ve.get(ls);y.indexOffset=p,y.indexSize=a.length-p,y.attributeOffset=m,y.attributeSize=n.length/2-m,y.baseColor=e.color,y.alpha=e.alpha,y.texture=g,y.geometryData=s,y.topology=b,i.push(y);});}function qD(r){let e=[];for(let t=0;t<r.length;t++){let i=r[t].shape,s=[];Ru[i.type].build(i,s)&&e.push(s);}return e}var Ru,YD,jD,sv=f(()=>{B();Te();ct();z0();W0();ye();Si();gm();X0();j0();$0();Q0();J0();ev();iv();wm();Ru={};V.handleByMap(x.ShapeBuilder,Ru);V.add(Rm,Bm,Mm,tn,xm,_m);YD=new exports.Rectangle,jD=new G;});var hh,dh,ov,rn,fh=f(()=>{B();Kc();fm();lp();Pe();Si();sv();hh=class{constructor(){this.batches=[],this.geometryData={vertices:[],uvs:[],indices:[]};}},dh=class{constructor(){this.instructions=new Is;}init(e){this.batcher=new mo({maxTextures:e}),this.instructions.reset();}get geometry(){return U(Xf,"GraphicsContextRenderData#geometry is deprecated, please use batcher.geometry instead."),this.batcher.geometry}},ov=class nv{constructor(e){this._gpuContextHash={},this._graphicsDataContextHash=Object.create(null),this._renderer=e,e.renderableGC.addManagedHash(this,"_gpuContextHash"),e.renderableGC.addManagedHash(this,"_graphicsDataContextHash");}init(e){nv.defaultOptions.bezierSmoothness=e?.bezierSmoothness??nv.defaultOptions.bezierSmoothness;}getContextRenderData(e){return this._graphicsDataContextHash[e.uid]||this._initContextRenderData(e)}updateGpuContext(e){let t=this._gpuContextHash[e.uid]||this._initContext(e);if(e.dirty){t?this._cleanGraphicsContextData(e):t=this._initContext(e),Dm(e,t);let i=e.batchMode;e.customShader||i==="no-batch"?t.isBatchable=false:i==="auto"?t.isBatchable=t.geometryData.vertices.length<400:t.isBatchable=true,e.dirty=false;}return t}getGpuContext(e){return this._gpuContextHash[e.uid]||this._initContext(e)}_initContextRenderData(e){let t=Ve.get(dh,{maxTextures:this._renderer.limits.maxBatchableTextures}),{batches:i,geometryData:s}=this._gpuContextHash[e.uid],n=s.vertices.length,o=s.indices.length;for(let c=0;c<i.length;c++)i[c].applyTransform=false;let a=t.batcher;a.ensureAttributeBuffer(n),a.ensureIndexBuffer(o),a.begin();for(let c=0;c<i.length;c++){let h=i[c];a.add(h);}a.finish(t.instructions);let u=a.geometry;u.indexBuffer.setDataWithSize(a.indexBuffer,a.indexSize,true),u.buffers[0].setDataWithSize(a.attributeBuffer.float32View,a.attributeSize,true);let l=a.batches;for(let c=0;c<l.length;c++){let h=l[c];h.bindGroup=Ws(h.textures.textures,h.textures.count,this._renderer.limits.maxBatchableTextures);}return this._graphicsDataContextHash[e.uid]=t,t}_initContext(e){let t=new hh;return t.context=e,this._gpuContextHash[e.uid]=t,e.on("destroy",this.onGraphicsContextDestroy,this),this._gpuContextHash[e.uid]}onGraphicsContextDestroy(e){this._cleanGraphicsContextData(e),e.off("destroy",this.onGraphicsContextDestroy,this),this._gpuContextHash[e.uid]=null;}_cleanGraphicsContextData(e){let t=this._gpuContextHash[e.uid];t.isBatchable||this._graphicsDataContextHash[e.uid]&&(Ve.return(this.getContextRenderData(e)),this._graphicsDataContextHash[e.uid]=null),t.batches&&t.batches.forEach(i=>{Ve.return(i);});}destroy(){for(let e in this._gpuContextHash)this._gpuContextHash[e]&&this.onGraphicsContextDestroy(this._gpuContextHash[e].context);}};ov.extension={type:[x.WebGLSystem,x.WebGPUSystem,x.CanvasSystem],name:"graphicsContext"};ov.defaultOptions={bezierSmoothness:.5};rn=ov;});var KD,av,uv,lv,cv,hv,dv,fv,Qe,Pr=f(()=>{KD={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},av=0,uv=1,lv=2,cv=3,hv=4,dv=5,fv=class bP{constructor(){this.data=0,this.blendMode="normal",this.polygonOffset=0,this.blend=true,this.depthMask=true;}get blend(){return !!(this.data&1<<av)}set blend(e){!!(this.data&1<<av)!==e&&(this.data^=1<<av);}get offsets(){return !!(this.data&1<<uv)}set offsets(e){!!(this.data&1<<uv)!==e&&(this.data^=1<<uv);}set cullMode(e){if(e==="none"){this.culling=false;return}this.culling=true,this.clockwiseFrontFace=e==="front";}get cullMode(){return this.culling?this.clockwiseFrontFace?"front":"back":"none"}get culling(){return !!(this.data&1<<lv)}set culling(e){!!(this.data&1<<lv)!==e&&(this.data^=1<<lv);}get depthTest(){return !!(this.data&1<<cv)}set depthTest(e){!!(this.data&1<<cv)!==e&&(this.data^=1<<cv);}get depthMask(){return !!(this.data&1<<dv)}set depthMask(e){!!(this.data&1<<dv)!==e&&(this.data^=1<<dv);}get clockwiseFrontFace(){return !!(this.data&1<<hv)}set clockwiseFrontFace(e){!!(this.data&1<<hv)!==e&&(this.data^=1<<hv);}get blendMode(){return this._blendMode}set blendMode(e){this.blend=e!=="none",this._blendMode=e,this._blendModeId=KD[e]||0;}get polygonOffset(){return this._polygonOffset}set polygonOffset(e){this.offsets=!!e,this._polygonOffset=e;}toString(){return `[pixi.js/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`}static for2d(){let e=new bP;return e.depthTest=false,e.blend=true,e}};fv.default2d=fv.for2d();Qe=fv;});function yP(r,e,t,i){t[i++]=(r>>16&255)/255,t[i++]=(r>>8&255)/255,t[i++]=(r&255)/255,t[i++]=e;}function Xr(r,e,t){let i=(r>>24&255)/255;e[t++]=(r&255)/255*i,e[t++]=(r>>8&255)/255*i,e[t++]=(r>>16&255)/255*i,e[t++]=i;}var bo=f(()=>{});var ph,yo,pv=f(()=>{B();Pr();Si();bo();gm();ph=class{constructor(){this.batches=[],this.batched=false;}destroy(){this.batches.forEach(e=>{Ve.return(e);}),this.batches.length=0;}},yo=class{constructor(e,t){this.state=Qe.for2d(),this.renderer=e,this._adaptor=t,this.renderer.runners.contextChange.add(this);}contextChange(){this._adaptor.contextChange(this.renderer);}validateRenderable(e){let t=e.context,i=!!e._gpuData,s=this.renderer.graphicsContext.updateGpuContext(t);return !!(s.isBatchable||i!==s.isBatchable)}addRenderable(e,t){let i=this.renderer.graphicsContext.updateGpuContext(e.context);e.didViewUpdate&&this._rebuild(e),i.isBatchable?this._addToBatcher(e,t):(this.renderer.renderPipes.batch.break(t),t.add(e));}updateRenderable(e){let i=this._getGpuDataForRenderable(e).batches;for(let s=0;s<i.length;s++){let n=i[s];n._batcher.updateElement(n);}}execute(e){if(!e.isRenderable)return;let t=this.renderer,i=e.context;if(!t.graphicsContext.getGpuContext(i).batches.length)return;let n=i.customShader||this._adaptor.shader;this.state.blendMode=e.groupBlendMode;let o=n.resources.localUniforms.uniforms;o.uTransformMatrix=e.groupTransform,o.uRound=t._roundPixels|e._roundPixels,Xr(e.groupColorAlpha,o.uColor,0),this._adaptor.execute(this,e);}_rebuild(e){let t=this._getGpuDataForRenderable(e),i=this.renderer.graphicsContext.updateGpuContext(e.context);t.destroy(),i.isBatchable&&this._updateBatchesForRenderable(e,t);}_addToBatcher(e,t){let i=this.renderer.renderPipes.batch,s=this._getGpuDataForRenderable(e).batches;for(let n=0;n<s.length;n++){let o=s[n];i.addToBatch(o,t);}}_getGpuDataForRenderable(e){return e._gpuData[this.renderer.uid]||this._initGpuDataForRenderable(e)}_initGpuDataForRenderable(e){let t=new ph;return e._gpuData[this.renderer.uid]=t,t}_updateBatchesForRenderable(e,t){let i=e.context,s=this.renderer.graphicsContext.getGpuContext(i),n=this.renderer._roundPixels|e._roundPixels;t.batches=s.batches.map(o=>{let a=Ve.get(ls);return o.copyTo(a),a.renderable=e,a.roundPixels=n,a});}destroy(){this.renderer=null,this._adaptor.destroy(),this._adaptor=null,this.state=null;}};yo.extension={type:[x.WebGLPipes,x.WebGPUPipes,x.CanvasPipes],name:"graphics"};});var mv=f(()=>{B();fh();pv();V.add(yo);V.add(rn);});var wi,mh=f(()=>{wi=class{constructor(){this.batcherName="default",this.packAsQuad=false,this.indexOffset=0,this.attributeOffset=0,this.roundPixels=0,this._batcher=null,this._batch=null,this._textureMatrixUpdateId=-1,this._uvUpdateId=-1;}get blendMode(){return this.renderable.groupBlendMode}get topology(){return this._topology||this.geometry.topology}set topology(e){this._topology=e;}reset(){this.renderable=null,this.texture=null,this._batcher=null,this._batch=null,this.geometry=null,this._uvUpdateId=-1,this._textureMatrixUpdateId=-1;}setTexture(e){this.texture!==e&&(this.texture=e,this._textureMatrixUpdateId=-1);}get uvs(){let t=this.geometry.getBuffer("aUV"),i=t.data,s=i,n=this.texture.textureMatrix;return n.isSimple||(s=this._transformedUvs,(this._textureMatrixUpdateId!==n._updateID||this._uvUpdateId!==t._updateID)&&((!s||s.length<i.length)&&(s=this._transformedUvs=new Float32Array(i.length)),this._textureMatrixUpdateId=n._updateID,this._uvUpdateId=t._updateID,n.multiplyUvs(i,s))),s}get positions(){return this.geometry.positions}get indices(){return this.geometry.indices}get color(){return this.renderable.groupColorAlpha}get groupTransform(){return this.renderable.groupTransform}get attributeSize(){return this.geometry.positions.length/2}get indexSize(){return this.geometry.indices.length}};});var Mu,vo,gv=f(()=>{B();Te();ns();ht();xu();bo();mh();Mu=class{destroy(){}},vo=class{constructor(e,t){this.localUniforms=new xe({uTransformMatrix:{value:new G,type:"mat3x3<f32>"},uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uRound:{value:0,type:"f32"}}),this.localUniformsBindGroup=new _t({0:this.localUniforms}),this.renderer=e,this._adaptor=t,this._adaptor.init();}validateRenderable(e){let t=this._getMeshData(e),i=t.batched,s=e.batched;if(t.batched=s,i!==s)return true;if(s){let n=e._geometry;if(n.indices.length!==t.indexSize||n.positions.length!==t.vertexSize)return t.indexSize=n.indices.length,t.vertexSize=n.positions.length,true;let o=this._getBatchableMesh(e);return o.texture.uid!==e._texture.uid&&(o._textureMatrixUpdateId=-1),!o._batcher.checkAndUpdateTexture(o,e._texture)}return false}addRenderable(e,t){let i=this.renderer.renderPipes.batch,{batched:s}=this._getMeshData(e);if(s){let n=this._getBatchableMesh(e);n.setTexture(e._texture),n.geometry=e._geometry,i.addToBatch(n,t);}else i.break(t),t.add(e);}updateRenderable(e){if(e.batched){let t=this._getBatchableMesh(e);t.setTexture(e._texture),t.geometry=e._geometry,t._batcher.updateElement(t);}}execute(e){if(!e.isRenderable)return;e.state.blendMode=oi(e.groupBlendMode,e.texture._source);let t=this.localUniforms;t.uniforms.uTransformMatrix=e.groupTransform,t.uniforms.uRound=this.renderer._roundPixels|e._roundPixels,t.update(),Xr(e.groupColorAlpha,t.uniforms.uColor,0),this._adaptor.execute(this,e);}_getMeshData(e){var t,i;return (t=e._gpuData)[i=this.renderer.uid]||(t[i]=new Mu),e._gpuData[this.renderer.uid].meshData||this._initMeshData(e)}_initMeshData(e){return e._gpuData[this.renderer.uid].meshData={batched:e.batched,indexSize:e._geometry.indices?.length,vertexSize:e._geometry.positions?.length},e._gpuData[this.renderer.uid].meshData}_getBatchableMesh(e){var t,i;return (t=e._gpuData)[i=this.renderer.uid]||(t[i]=new Mu),e._gpuData[this.renderer.uid].batchableMesh||this._initBatchableMesh(e)}_initBatchableMesh(e){let t=new wi;return t.renderable=e,t.setTexture(e._texture),t.transform=e.groupTransform,t.roundPixels=this.renderer._roundPixels|e._roundPixels,e._gpuData[this.renderer.uid].batchableMesh=t,t}destroy(){this.localUniforms=null,this.localUniformsBindGroup=null,this._adaptor.destroy(),this._adaptor=null,this.renderer=null;}};vo.extension={type:[x.WebGLPipes,x.WebGPUPipes,x.CanvasPipes],name:"mesh"};});var xv=f(()=>{B();gv();V.add(vo);});var Iu,_v=f(()=>{Iu=class{execute(e,t){let i=e.state,s=e.renderer,n=t.shader||e.defaultShader;n.resources.uTexture=t.texture._source,n.resources.uniforms=e.localUniforms;let o=s.gl,a=e.getBuffers(t);s.shader.bind(n),s.state.set(i),s.geometry.bind(a.geometry,n.glProgram);let l=a.geometry.indexBuffer.data.BYTES_PER_ELEMENT===2?o.UNSIGNED_SHORT:o.UNSIGNED_INT;o.drawElements(o.TRIANGLES,t.particleChildren.length*6,l,0);}};});function gh(r,e=null){let t=r*6;if(t>65535?e||(e=new Uint32Array(t)):e||(e=new Uint16Array(t)),e.length!==t)throw new Error(`Out buffer length is incorrect, got ${e.length} and expected ${t}`);for(let i=0,s=0;i<t;i+=6,s+=4)e[i+0]=s+0,e[i+1]=s+1,e[i+2]=s+2,e[i+3]=s+0,e[i+4]=s+2,e[i+5]=s+3;return e}var bv=f(()=>{});function km(r){return {dynamicUpdate:vP(r,true),staticUpdate:vP(r,false)}}function vP(r,e){let t=[];t.push(`
260
+ `}};});var sh,hm,L0=f(()=>{sh=["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>"],hm=sh.reduce((r,e)=>(r[e]=true,r),{});});function dm(r,e){switch(r){case "f32":return 0;case "vec2<f32>":return new Float32Array(2*e);case "vec3<f32>":return new Float32Array(3*e);case "vec4<f32>":return new Float32Array(4*e);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}var N0=f(()=>{});var rP,xe,ht=f(()=>{Et();Su();L0();N0();rP=class iP{constructor(e,t){this._touched=0,this.uid=ce("uniform"),this._resourceType="uniformGroup",this._resourceId=ce("resource"),this.isUniformGroup=true,this._dirtyId=0,this.destroyed=false,t={...iP.defaultOptions,...t},this.uniformStructures=e;let i={};for(let s in e){let n=e[s];if(n.name=s,n.size=n.size??1,!hm[n.type])throw new Error(`Uniform type ${n.type} is not supported. Supported uniform types are: ${sh.join(", ")}`);n.value??(n.value=dm(n.type,n.size)),i[s]=n.value;}this.uniforms=i,this._dirtyId=1,this.ubo=t.ubo,this.isStatic=t.isStatic,this._signature=ai(Object.keys(i).map(s=>`${s}-${e[s].type}`).join("-"),"uniform-group");}update(){this._dirtyId++;}};rP.defaultOptions={ubo:false,isStatic:false};xe=rP;});function en(r){let e=sP[r];if(e)return e;let t=new Int32Array(r);for(let i=0;i<r;i++)t[i]=i;return e=sP[r]=new xe({uTextures:{value:t,type:"i32",size:r}},{isStatic:true}),e}var sP,nh=f(()=>{ht();sP={};});var qe,Ar=f(()=>{qe=(r=>(r[r.WEBGL=1]="WEBGL",r[r.WEBGPU=2]="WEBGPU",r[r.BOTH=3]="BOTH",r))(qe||{});});var rt,zr=f(()=>{Ut();Et();dr();ns();Cr();Ar();ht();rt=class r extends _e{constructor(e){super(),this.uid=ce("shader"),this._uniformBindMap=Object.create(null),this._ownedBindGroups=[];let{gpuProgram:t,glProgram:i,groups:s,resources:n,compatibleRenderers:o,groupMap:a}=e;this.gpuProgram=t,this.glProgram=i,o===void 0&&(o=0,t&&(o|=qe.WEBGPU),i&&(o|=qe.WEBGL)),this.compatibleRenderers=o;let u={};if(!n&&!s&&(n={}),n&&s)throw new Error("[Shader] Cannot have both resources and groups");if(!t&&s&&!a)throw new Error("[Shader] No group map or WebGPU shader provided - consider using resources instead.");if(!t&&s&&a)for(let l in a)for(let c in a[l]){let h=a[l][c];u[h]={group:l,binding:c,name:h};}else if(t&&s&&!a){let l=t.structsAndGroups.groups;a={},l.forEach(c=>{a[c.group]=a[c.group]||{},a[c.group][c.binding]=c.name,u[c.name]=c;});}else if(n){s={},a={},t&&t.structsAndGroups.groups.forEach(h=>{a[h.group]=a[h.group]||{},a[h.group][h.binding]=h.name,u[h.name]=h;});let l=0;for(let c in n)u[c]||(s[99]||(s[99]=new _t,this._ownedBindGroups.push(s[99])),u[c]={group:99,binding:l,name:c},a[99]=a[99]||{},a[99][l]=c,l++);for(let c in n){let h=c,d=n[c];!d.source&&!d._resourceType&&(d=new xe(d));let p=u[h];p&&(s[p.group]||(s[p.group]=new _t,this._ownedBindGroups.push(s[p.group])),s[p.group].setResource(d,p.binding));}}this.groups=s,this._uniformBindMap=a,this.resources=this._buildResourceAccessor(s,u);}addResource(e,t,i){var s,n;(s=this._uniformBindMap)[t]||(s[t]={}),(n=this._uniformBindMap[t])[i]||(n[i]=e),this.groups[t]||(this.groups[t]=new _t,this._ownedBindGroups.push(this.groups[t]));}_buildResourceAccessor(e,t){let i={};for(let s in t){let n=t[s];Object.defineProperty(i,n.name,{get(){return e[n.group].getResource(n.binding)},set(o){e[n.group].setResource(o,n.binding);}});}return i}destroy(e=false){this.emit("destroy",this),e&&(this.gpuProgram?.destroy(),this.glProgram?.destroy()),this.gpuProgram=null,this.glProgram=null,this.removeAllListeners(),this._uniformBindMap=null,this._ownedBindGroups.forEach(t=>{t.destroy();}),this._ownedBindGroups=null,this.resources=null,this.groups=null;}static from(e){let{gpu:t,gl:i,...s}=e,n,o;return t&&(n=$e.from(t)),i&&(o=je.from(i)),new r({gpuProgram:n,glProgram:o,...s})}};});var Pu,H0=f(()=>{as();Cu();Au();us();nh();zr();Pu=class extends rt{constructor(e){let t=Nr({name:"batch",bits:[Zs,Js(e),Vr]}),i=Lr({name:"batch",bits:[Ks,Qs(e),Hr]});super({glProgram:t,gpuProgram:i,resources:{batchSamplers:en(e)}});}};});var V0,nP,mo,fm=f(()=>{B();a0();c0();H0();V0=null,nP=class oP extends zp{constructor(e){super(e),this.geometry=new Tu,this.name=oP.extension.name,this.vertexSize=6,V0??(V0=new Pu(e.maxTextures)),this.shader=V0;}packAttributes(e,t,i,s,n){let o=n<<16|e.roundPixels&65535,a=e.transform,u=a.a,l=a.b,c=a.c,h=a.d,d=a.tx,p=a.ty,{positions:m,uvs:b}=e,_=e.color,g=e.attributeOffset,y=g+e.attributeSize;for(let S=g;S<y;S++){let E=S*2,F=m[E],T=m[E+1];t[s++]=u*F+c*T+d,t[s++]=h*T+l*F+p,t[s++]=b[E],t[s++]=b[E+1],i[s++]=_,i[s++]=o;}}packQuadAttributes(e,t,i,s,n){let o=e.texture,a=e.transform,u=a.a,l=a.b,c=a.c,h=a.d,d=a.tx,p=a.ty,m=e.bounds,b=m.maxX,_=m.minX,g=m.maxY,y=m.minY,S=o.uvs,E=e.color,F=n<<16|e.roundPixels&65535;t[s+0]=u*_+c*y+d,t[s+1]=h*y+l*_+p,t[s+2]=S.x0,t[s+3]=S.y0,i[s+4]=E,i[s+5]=F,t[s+6]=u*b+c*y+d,t[s+7]=h*y+l*b+p,t[s+8]=S.x1,t[s+9]=S.y1,i[s+10]=E,i[s+11]=F,t[s+12]=u*b+c*g+d,t[s+13]=h*g+l*b+p,t[s+14]=S.x2,t[s+15]=S.y2,i[s+16]=E,i[s+17]=F,t[s+18]=u*_+c*g+d,t[s+19]=h*g+l*_+p,t[s+20]=S.x3,t[s+21]=S.y3,i[s+22]=E,i[s+23]=F;}};nP.extension={type:[x.Batcher],name:"default"};mo=nP;});function pm(r,e,t,i,s,n,o,a=null){let u=0;t*=e,s*=n;let l=a.a,c=a.b,h=a.c,d=a.d,p=a.tx,m=a.ty;for(;u<o;){let b=r[t],_=r[t+1];i[s]=l*b+h*_+p,i[s+1]=c*b+d*_+m,s+=n,t+=e,u++;}}function mm(r,e,t,i){let s=0;for(e*=t;s<i;)r[e]=0,r[e+1]=0,e+=t,s++;}var z0=f(()=>{});function oh(r,e,t,i,s){let n=e.a,o=e.b,a=e.c,u=e.d,l=e.tx,c=e.ty;t||(t=0),i||(i=2),s||(s=r.length/i-t);let h=t*i;for(let d=0;d<s;d++){let p=r[h],m=r[h+1];r[h]=n*p+a*m+l,r[h+1]=o*p+u*m+c,h+=i;}}var W0=f(()=>{});var CD,ls,gm=f(()=>{Te();tp();CD=new G,ls=class{constructor(){this.packAsQuad=false,this.batcherName="default",this.topology="triangle-list",this.applyTransform=true,this.roundPixels=0,this._batcher=null,this._batch=null;}get uvs(){return this.geometryData.uvs}get positions(){return this.geometryData.vertices}get indices(){return this.geometryData.indices}get blendMode(){return this.renderable&&this.applyTransform?this.renderable.groupBlendMode:"normal"}get color(){let e=this.baseColor,t=e>>16|e&65280|(e&255)<<16,i=this.renderable;return i?au(t,i.groupColor)+(this.alpha*i.groupAlpha*255<<24):t+(this.alpha*255<<24)}get transform(){return this.renderable?.groupTransform||CD}copyTo(e){e.indexOffset=this.indexOffset,e.indexSize=this.indexSize,e.attributeOffset=this.attributeOffset,e.attributeSize=this.attributeSize,e.baseColor=this.baseColor,e.alpha=this.alpha,e.texture=this.texture,e.geometryData=this.geometryData,e.topology=this.topology;}reset(){this.applyTransform=true,this.renderable=null,this.topology="triangle-list";}};});var tn,xm,_m,X0=f(()=>{B();tn={extension:{type:x.ShapeBuilder,name:"circle"},build(r,e){let t,i,s,n,o,a;if(r.type==="circle"){let E=r;if(o=a=E.radius,o<=0)return false;t=E.x,i=E.y,s=n=0;}else if(r.type==="ellipse"){let E=r;if(o=E.halfWidth,a=E.halfHeight,o<=0||a<=0)return false;t=E.x,i=E.y,s=n=0;}else {let E=r,F=E.width/2,T=E.height/2;t=E.x+F,i=E.y+T,o=a=Math.max(0,Math.min(E.radius,Math.min(F,T))),s=F-o,n=T-a;}if(s<0||n<0)return false;let u=Math.ceil(2.3*Math.sqrt(o+a)),l=u*8+(s?4:0)+(n?4:0);if(l===0)return false;if(u===0)return e[0]=e[6]=t+s,e[1]=e[3]=i+n,e[2]=e[4]=t-s,e[5]=e[7]=i-n,true;let c=0,h=u*4+(s?2:0)+2,d=h,p=l,m=s+o,b=n,_=t+m,g=t-m,y=i+b;if(e[c++]=_,e[c++]=y,e[--h]=y,e[--h]=g,n){let E=i-b;e[d++]=g,e[d++]=E,e[--p]=E,e[--p]=_;}for(let E=1;E<u;E++){let F=Math.PI/2*(E/u),T=s+Math.cos(F)*o,C=n+Math.sin(F)*a,A=t+T,P=t-T,M=i+C,k=i-C;e[c++]=A,e[c++]=M,e[--h]=M,e[--h]=P,e[d++]=P,e[d++]=k,e[--p]=k,e[--p]=A;}m=s,b=n+a,_=t+m,g=t-m,y=i+b;let S=i-b;return e[c++]=_,e[c++]=y,e[--p]=S,e[--p]=_,s&&(e[c++]=g,e[c++]=y,e[--p]=S,e[--p]=g),true},triangulate(r,e,t,i,s,n){if(r.length===0)return;let o=0,a=0;for(let c=0;c<r.length;c+=2)o+=r[c],a+=r[c+1];o/=r.length/2,a/=r.length/2;let u=i;e[u*t]=o,e[u*t+1]=a;let l=u++;for(let c=0;c<r.length;c+=2)e[u*t]=r[c],e[u*t+1]=r[c+1],c>0&&(s[n++]=u,s[n++]=l,s[n++]=u-1),u++;s[n++]=l+1,s[n++]=l,s[n++]=u-1;}},xm={...tn,extension:{...tn.extension,name:"ellipse"}},_m={...tn,extension:{...tn.extension,name:"roundedRectangle"}};});var bm,ym,aP=f(()=>{bm=1e-4,ym=1e-4;});function vm(r){let e=r.length;if(e<6)return 1;let t=0;for(let i=0,s=r[e-2],n=r[e-1];i<e;i+=2){let o=r[i],a=r[i+1];t+=(o-s)*(a+n),s=o,n=a;}return t<0?-1:1}var Y0=f(()=>{});function uP(r,e,t,i,s,n,o,a){let u=r-t*s,l=e-i*s,c=r+t*n,h=e+i*n,d,p;o?(d=i,p=-t):(d=-i,p=t);let m=u+d,b=l+p,_=c+d,g=h+p;return a.push(m,b),a.push(_,g),2}function go(r,e,t,i,s,n,o,a){let u=t-r,l=i-e,c=Math.atan2(u,l),h=Math.atan2(s-r,n-e);a&&c<h?c+=Math.PI*2:!a&&c>h&&(h+=Math.PI*2);let d=c,p=h-c,m=Math.abs(p),b=Math.sqrt(u*u+l*l),_=(15*m*Math.sqrt(b)/Math.PI>>0)+1,g=p/_;if(d+=g,a){o.push(r,e),o.push(t,i);for(let y=1,S=d;y<_;y++,S+=g)o.push(r,e),o.push(r+Math.sin(S)*b,e+Math.cos(S)*b);o.push(r,e),o.push(s,n);}else {o.push(t,i),o.push(r,e);for(let y=1,S=d;y<_;y++,S+=g)o.push(r+Math.sin(S)*b,e+Math.cos(S)*b),o.push(r,e);o.push(s,n),o.push(r,e);}return _*2}function Tm(r,e,t,i,s,n){let o=1e-4;if(r.length===0)return;let a=e,u=a.alignment;if(e.alignment!==.5){let Re=vm(r);t&&(Re*=-1),u=(u-.5)*Re+.5;}let l=new me(r[0],r[1]),c=new me(r[r.length-2],r[r.length-1]),h=i,d=Math.abs(l.x-c.x)<o&&Math.abs(l.y-c.y)<o;if(h){r=r.slice(),d&&(r.pop(),r.pop(),c.set(r[r.length-2],r[r.length-1]));let Re=(l.x+c.x)*.5,mt=(c.y+l.y)*.5;r.unshift(Re,mt),r.push(Re,mt);}let p=s,m=r.length/2,b=r.length,_=p.length/2,g=a.width/2,y=g*g,S=a.miterLimit*a.miterLimit,E=r[0],F=r[1],T=r[2],C=r[3],A=0,P=0,M=-(F-C),k=E-T,L=0,pe=0,ve=Math.sqrt(M*M+k*k);M/=ve,k/=ve,M*=g,k*=g;let kr=u,X=(1-kr)*2,Q=kr*2;h||(a.cap==="round"?b+=go(E-M*(X-Q)*.5,F-k*(X-Q)*.5,E-M*X,F-k*X,E+M*Q,F+k*Q,p,true)+2:a.cap==="square"&&(b+=uP(E,F,M,k,X,Q,true,p))),p.push(E-M*X,F-k*X),p.push(E+M*Q,F+k*Q);for(let Re=1;Re<m-1;++Re){E=r[(Re-1)*2],F=r[(Re-1)*2+1],T=r[Re*2],C=r[Re*2+1],A=r[(Re+1)*2],P=r[(Re+1)*2+1],M=-(F-C),k=E-T,ve=Math.sqrt(M*M+k*k),M/=ve,k/=ve,M*=g,k*=g,L=-(C-P),pe=T-A,ve=Math.sqrt(L*L+pe*pe),L/=ve,pe/=ve,L*=g,pe*=g;let mt=T-E,Zr=F-C,As=T-A,Ps=P-C,Pc=mt*As+Zr*Ps,qi=Zr*As-Ps*mt,Ki=qi<0;if(Math.abs(qi)<.001*Math.abs(Pc)){p.push(T-M*X,C-k*X),p.push(T+M*Q,C+k*Q),Pc>=0&&(a.join==="round"?b+=go(T,C,T-M*X,C-k*X,T-L*X,C-pe*X,p,false)+4:b+=2,p.push(T-L*Q,C-pe*Q),p.push(T+L*X,C+pe*X));continue}let eu=(-M+E)*(-k+C)-(-M+T)*(-k+F),DC=(-L+A)*(-pe+C)-(-L+T)*(-pe+P),kf=(mt*DC-As*eu)/qi,Of=(Ps*eu-Zr*DC)/qi,qb=(kf-T)*(kf-T)+(Of-C)*(Of-C),Yn=T+(kf-T)*X,jn=C+(Of-C)*X,$n=T-(kf-T)*Q,qn=C-(Of-C)*Q,bI=Math.min(mt*mt+Zr*Zr,As*As+Ps*Ps),kC=Ki?X:Q,yI=bI+kC*kC*y;qb<=yI?a.join==="bevel"||qb/y>S?(Ki?(p.push(Yn,jn),p.push(T+M*Q,C+k*Q),p.push(Yn,jn),p.push(T+L*Q,C+pe*Q)):(p.push(T-M*X,C-k*X),p.push($n,qn),p.push(T-L*X,C-pe*X),p.push($n,qn)),b+=2):a.join==="round"?Ki?(p.push(Yn,jn),p.push(T+M*Q,C+k*Q),b+=go(T,C,T+M*Q,C+k*Q,T+L*Q,C+pe*Q,p,true)+4,p.push(Yn,jn),p.push(T+L*Q,C+pe*Q)):(p.push(T-M*X,C-k*X),p.push($n,qn),b+=go(T,C,T-M*X,C-k*X,T-L*X,C-pe*X,p,false)+4,p.push(T-L*X,C-pe*X),p.push($n,qn)):(p.push(Yn,jn),p.push($n,qn)):(p.push(T-M*X,C-k*X),p.push(T+M*Q,C+k*Q),a.join==="round"?Ki?b+=go(T,C,T+M*Q,C+k*Q,T+L*Q,C+pe*Q,p,true)+2:b+=go(T,C,T-M*X,C-k*X,T-L*X,C-pe*X,p,false)+2:a.join==="miter"&&qb/y<=S&&(Ki?(p.push($n,qn),p.push($n,qn)):(p.push(Yn,jn),p.push(Yn,jn)),b+=2),p.push(T-L*X,C-pe*X),p.push(T+L*Q,C+pe*Q),b+=2);}E=r[(m-2)*2],F=r[(m-2)*2+1],T=r[(m-1)*2],C=r[(m-1)*2+1],M=-(F-C),k=E-T,ve=Math.sqrt(M*M+k*k),M/=ve,k/=ve,M*=g,k*=g,p.push(T-M*X,C-k*X),p.push(T+M*Q,C+k*Q),h||(a.cap==="round"?b+=go(T-M*(X-Q)*.5,C-k*(X-Q)*.5,T-M*X,C-k*X,T+M*Q,C+k*Q,p,false)+2:a.cap==="square"&&(b+=uP(T,C,M,k,X,Q,false,p)));let Ye=1e-4*1e-4;for(let Re=_;Re<b+_-2;++Re)E=p[Re*2],F=p[Re*2+1],T=p[(Re+1)*2],C=p[(Re+1)*2+1],A=p[(Re+2)*2],P=p[(Re+2)*2+1],!(Math.abs(E*(C-P)+T*(P-F)+A*(F-C))<Ye)&&n.push(Re,Re+1,Re+2);}var j0=f(()=>{cr();Y0();});function Sm(r,e,t,i){let s=1e-4;if(r.length===0)return;let n=r[0],o=r[1],a=r[r.length-2],u=r[r.length-1],l=e||Math.abs(n-a)<s&&Math.abs(o-u)<s,c=t,h=r.length/2,d=c.length/2;for(let p=0;p<h;p++)c.push(r[p*2]),c.push(r[p*2+1]);for(let p=0;p<h-1;p++)i.push(d+p,d+p+1);l&&i.push(d+h-1,d);}var $0=f(()=>{});function Am(r,e,t=2){let i=e&&e.length,s=i?e[0]*t:r.length,n=cP(r,0,s,t,true),o=[];if(!n||n.next===n.prev)return o;let a,u,l;if(i&&(n=RD(r,e,n,t)),r.length>80*t){a=1/0,u=1/0;let c=-1/0,h=-1/0;for(let d=t;d<s;d+=t){let p=r[d],m=r[d+1];p<a&&(a=p),m<u&&(u=m),p>c&&(c=p),m>h&&(h=m);}l=Math.max(c-a,h-u),l=l!==0?32767/l:0;}return uh(n,o,t,a,u,l,0),o}function cP(r,e,t,i,s){let n;if(s===HD(r,e,t,i)>0)for(let o=e;o<t;o+=i)n=lP(o/i|0,r[o],r[o+1],n);else for(let o=t-i;o>=e;o-=i)n=lP(o/i|0,r[o],r[o+1],n);return n&&wu(n,n.next)&&(ch(n),n=n.next),n}function xo(r,e){if(!r)return r;e||(e=r);let t=r,i;do if(i=false,!t.steiner&&(wu(t,t.next)||ot(t.prev,t,t.next)===0)){if(ch(t),t=e=t.prev,t===t.next)break;i=true;}else t=t.next;while(i||t!==e);return e}function uh(r,e,t,i,s,n,o){if(!r)return;!o&&n&&OD(r,i,s,n);let a=r;for(;r.prev!==r.next;){let u=r.prev,l=r.next;if(n?PD(r,i,s,n):AD(r)){e.push(u.i,r.i,l.i),ch(r),r=l.next,a=l.next;continue}if(r=l,r===a){o?o===1?(r=wD(xo(r),e),uh(r,e,t,i,s,n,2)):o===2&&BD(r,e,t,i,s,n):uh(xo(r),e,t,i,s,n,1);break}}}function AD(r){let e=r.prev,t=r,i=r.next;if(ot(e,t,i)>=0)return false;let s=e.x,n=t.x,o=i.x,a=e.y,u=t.y,l=i.y,c=Math.min(s,n,o),h=Math.min(a,u,l),d=Math.max(s,n,o),p=Math.max(a,u,l),m=i.next;for(;m!==e;){if(m.x>=c&&m.x<=d&&m.y>=h&&m.y<=p&&ah(s,a,n,u,o,l,m.x,m.y)&&ot(m.prev,m,m.next)>=0)return false;m=m.next;}return true}function PD(r,e,t,i){let s=r.prev,n=r,o=r.next;if(ot(s,n,o)>=0)return false;let a=s.x,u=n.x,l=o.x,c=s.y,h=n.y,d=o.y,p=Math.min(a,u,l),m=Math.min(c,h,d),b=Math.max(a,u,l),_=Math.max(c,h,d),g=q0(p,m,e,t,i),y=q0(b,_,e,t,i),S=r.prevZ,E=r.nextZ;for(;S&&S.z>=g&&E&&E.z<=y;){if(S.x>=p&&S.x<=b&&S.y>=m&&S.y<=_&&S!==s&&S!==o&&ah(a,c,u,h,l,d,S.x,S.y)&&ot(S.prev,S,S.next)>=0||(S=S.prevZ,E.x>=p&&E.x<=b&&E.y>=m&&E.y<=_&&E!==s&&E!==o&&ah(a,c,u,h,l,d,E.x,E.y)&&ot(E.prev,E,E.next)>=0))return false;E=E.nextZ;}for(;S&&S.z>=g;){if(S.x>=p&&S.x<=b&&S.y>=m&&S.y<=_&&S!==s&&S!==o&&ah(a,c,u,h,l,d,S.x,S.y)&&ot(S.prev,S,S.next)>=0)return false;S=S.prevZ;}for(;E&&E.z<=y;){if(E.x>=p&&E.x<=b&&E.y>=m&&E.y<=_&&E!==s&&E!==o&&ah(a,c,u,h,l,d,E.x,E.y)&&ot(E.prev,E,E.next)>=0)return false;E=E.nextZ;}return true}function wD(r,e){let t=r;do{let i=t.prev,s=t.next.next;!wu(i,s)&&dP(i,t,t.next,s)&&lh(i,s)&&lh(s,i)&&(e.push(i.i,t.i,s.i),ch(t),ch(t.next),t=r=s),t=t.next;}while(t!==r);return xo(t)}function BD(r,e,t,i,s,n){let o=r;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&UD(o,a)){let u=fP(o,a);o=xo(o,o.next),u=xo(u,u.next),uh(o,e,t,i,s,n,0),uh(u,e,t,i,s,n,0);return}a=a.next;}o=o.next;}while(o!==r)}function RD(r,e,t,i){let s=[];for(let n=0,o=e.length;n<o;n++){let a=e[n]*i,u=n<o-1?e[n+1]*i:r.length,l=cP(r,a,u,i,false);l===l.next&&(l.steiner=true),s.push(GD(l));}s.sort(MD);for(let n=0;n<s.length;n++)t=ID(s[n],t);return t}function MD(r,e){let t=r.x-e.x;if(t===0&&(t=r.y-e.y,t===0)){let i=(r.next.y-r.y)/(r.next.x-r.x),s=(e.next.y-e.y)/(e.next.x-e.x);t=i-s;}return t}function ID(r,e){let t=DD(r,e);if(!t)return e;let i=fP(t,r);return xo(i,i.next),xo(t,t.next)}function DD(r,e){let t=e,i=r.x,s=r.y,n=-1/0,o;if(wu(r,t))return t;do{if(wu(r,t.next))return t.next;if(s<=t.y&&s>=t.next.y&&t.next.y!==t.y){let h=t.x+(s-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(h<=i&&h>n&&(n=h,o=t.x<t.next.x?t:t.next,h===i))return o}t=t.next;}while(t!==e);if(!o)return null;let a=o,u=o.x,l=o.y,c=1/0;t=o;do{if(i>=t.x&&t.x>=u&&i!==t.x&&hP(s<l?i:n,s,u,l,s<l?n:i,s,t.x,t.y)){let h=Math.abs(s-t.y)/(i-t.x);lh(t,r)&&(h<c||h===c&&(t.x>o.x||t.x===o.x&&kD(o,t)))&&(o=t,c=h);}t=t.next;}while(t!==a);return o}function kD(r,e){return ot(r.prev,r,e.prev)<0&&ot(e.next,r,r.next)<0}function OD(r,e,t,i){let s=r;do s.z===0&&(s.z=q0(s.x,s.y,e,t,i)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next;while(s!==r);s.prevZ.nextZ=null,s.prevZ=null,FD(s);}function FD(r){let e,t=1;do{let i=r,s;r=null;let n=null;for(e=0;i;){e++;let o=i,a=0;for(let l=0;l<t&&(a++,o=o.nextZ,!!o);l++);let u=t;for(;a>0||u>0&&o;)a!==0&&(u===0||!o||i.z<=o.z)?(s=i,i=i.nextZ,a--):(s=o,o=o.nextZ,u--),n?n.nextZ=s:r=s,s.prevZ=n,n=s;i=o;}n.nextZ=null,t*=2;}while(e>1);return r}function q0(r,e,t,i,s){return r=(r-t)*s|0,e=(e-i)*s|0,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,r|e<<1}function GD(r){let e=r,t=r;do(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next;while(e!==r);return t}function hP(r,e,t,i,s,n,o,a){return (s-o)*(e-a)>=(r-o)*(n-a)&&(r-o)*(i-a)>=(t-o)*(e-a)&&(t-o)*(n-a)>=(s-o)*(i-a)}function ah(r,e,t,i,s,n,o,a){return !(r===o&&e===a)&&hP(r,e,t,i,s,n,o,a)}function UD(r,e){return r.next.i!==e.i&&r.prev.i!==e.i&&!LD(r,e)&&(lh(r,e)&&lh(e,r)&&ND(r,e)&&(ot(r.prev,r,e.prev)||ot(r,e.prev,e))||wu(r,e)&&ot(r.prev,r,r.next)>0&&ot(e.prev,e,e.next)>0)}function ot(r,e,t){return (e.y-r.y)*(t.x-e.x)-(e.x-r.x)*(t.y-e.y)}function wu(r,e){return r.x===e.x&&r.y===e.y}function dP(r,e,t,i){let s=Cm(ot(r,e,t)),n=Cm(ot(r,e,i)),o=Cm(ot(t,i,r)),a=Cm(ot(t,i,e));return !!(s!==n&&o!==a||s===0&&Em(r,t,e)||n===0&&Em(r,i,e)||o===0&&Em(t,r,i)||a===0&&Em(t,e,i))}function Em(r,e,t){return e.x<=Math.max(r.x,t.x)&&e.x>=Math.min(r.x,t.x)&&e.y<=Math.max(r.y,t.y)&&e.y>=Math.min(r.y,t.y)}function Cm(r){return r>0?1:r<0?-1:0}function LD(r,e){let t=r;do{if(t.i!==r.i&&t.next.i!==r.i&&t.i!==e.i&&t.next.i!==e.i&&dP(t,t.next,r,e))return true;t=t.next;}while(t!==r);return false}function lh(r,e){return ot(r.prev,r,r.next)<0?ot(r,e,r.next)>=0&&ot(r,r.prev,e)>=0:ot(r,e,r.prev)<0||ot(r,r.next,e)<0}function ND(r,e){let t=r,i=false,s=(r.x+e.x)/2,n=(r.y+e.y)/2;do t.y>n!=t.next.y>n&&t.next.y!==t.y&&s<(t.next.x-t.x)*(n-t.y)/(t.next.y-t.y)+t.x&&(i=!i),t=t.next;while(t!==r);return i}function fP(r,e){let t=K0(r.i,r.x,r.y),i=K0(e.i,e.x,e.y),s=r.next,n=e.prev;return r.next=e,e.prev=r,t.next=s,s.prev=t,i.next=t,t.prev=i,n.next=i,i.prev=n,i}function lP(r,e,t,i){let s=K0(r,e,t);return i?(s.next=i.next,s.prev=i,i.next.prev=s,i.next=s):(s.prev=s,s.next=s),s}function ch(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ);}function K0(r,e,t){return {i:r,x:e,y:t,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:false}}function HD(r,e,t,i){let s=0;for(let n=e,o=t-i;n<t;n+=i)s+=(r[o]-r[n])*(r[n+1]+r[o+1]),o=n;return s}var pP=f(()=>{});var Pm,Z0=f(()=>{pP();Ut();Pm=Am.default||Am;});function Bu(r,e,t,i,s,n,o){let a=Pm(r,e,2);if(!a)return;for(let l=0;l<a.length;l+=3)n[o++]=a[l]+s,n[o++]=a[l+1]+s,n[o++]=a[l+2]+s;let u=s*i;for(let l=0;l<r.length;l+=2)t[u]=r[l],t[u+1]=r[l+1],u+=i;}var wm=f(()=>{Z0();});var VD,Bm,Q0=f(()=>{B();wm();VD=[],Bm={extension:{type:x.ShapeBuilder,name:"polygon"},build(r,e){for(let t=0;t<r.points.length;t++)e[t]=r.points[t];return true},triangulate(r,e,t,i,s,n){Bu(r,VD,e,t,i,s,n);}};});var Rm,J0=f(()=>{B();Rm={extension:{type:x.ShapeBuilder,name:"rectangle"},build(r,e){let t=r,i=t.x,s=t.y,n=t.width,o=t.height;return n>0&&o>0?(e[0]=i,e[1]=s,e[2]=i+n,e[3]=s,e[4]=i+n,e[5]=s+o,e[6]=i,e[7]=s+o,true):false},triangulate(r,e,t,i,s,n){let o=0;i*=t,e[i+o]=r[0],e[i+o+1]=r[1],o+=t,e[i+o]=r[2],e[i+o+1]=r[3],o+=t,e[i+o]=r[6],e[i+o+1]=r[7],o+=t,e[i+o]=r[4],e[i+o+1]=r[5],o+=t;let a=i/t;s[n++]=a,s[n++]=a+1,s[n++]=a+2,s[n++]=a+1,s[n++]=a+3,s[n++]=a+2;}};});var Mm,ev=f(()=>{B();Mm={extension:{type:x.ShapeBuilder,name:"triangle"},build(r,e){return e[0]=r.x,e[1]=r.y,e[2]=r.x2,e[3]=r.y2,e[4]=r.x3,e[5]=r.y3,true},triangulate(r,e,t,i,s,n){let o=0;i*=t,e[i+o]=r[0],e[i+o+1]=r[1],o+=t,e[i+o]=r[2],e[i+o+1]=r[3],o+=t,e[i+o]=r[4],e[i+o+1]=r[5];let a=i/t;s[n++]=a,s[n++]=a+1,s[n++]=a+2;}};});function gP(r,e){for(let t=0;t<e.length;t++){let i=e[t];r.addColorStop(i.offset,i.color);}}function xP(r,e){let t=j.get().createCanvas(r,e),i=t.getContext("2d");return {canvas:t,context:i}}function zD(r){let e=r[0]??{};return (typeof e=="number"||r[1])&&(U("8.5.2","use options object instead"),e={type:"linear",start:{x:r[0],y:r[1]},end:{x:r[2],y:r[3]},textureSpace:r[4],textureSize:r[5]??qt.defaultLinearOptions.textureSize}),e}var mP,rv,qt,_o=f(()=>{gt();Fe();Te();fo();ye();Et();Pe();Ds();mP=[{offset:0,color:"white"},{offset:1,color:"black"}],rv=class tv{constructor(...e){this.uid=ce("fillGradient"),this.type="linear",this.colorStops=[];let t=zD(e);t={...t.type==="radial"?tv.defaultRadialOptions:tv.defaultLinearOptions,...Rt(t)},this._textureSize=t.textureSize,this._wrapMode=t.wrapMode,t.type==="radial"?(this.center=t.center,this.outerCenter=t.outerCenter??this.center,this.innerRadius=t.innerRadius,this.outerRadius=t.outerRadius,this.scale=t.scale,this.rotation=t.rotation):(this.start=t.start,this.end=t.end),this.textureSpace=t.textureSpace,this.type=t.type,t.colorStops.forEach(s=>{this.addColorStop(s.offset,s.color);});}addColorStop(e,t){return this.colorStops.push({offset:e,color:te.shared.setValue(t).toHexa()}),this}buildLinearGradient(){if(this.texture)return;let{x:e,y:t}=this.start,{x:i,y:s}=this.end,n=i-e,o=s-t,a=n<0||o<0;if(this._wrapMode==="clamp-to-edge"){if(n<0){let _=e;e=i,i=_,n*=-1;}if(o<0){let _=t;t=s,s=_,o*=-1;}}let u=this.colorStops.length?this.colorStops:mP,l=this._textureSize,{canvas:c,context:h}=xP(l,1),d=a?h.createLinearGradient(this._textureSize,0,0,0):h.createLinearGradient(0,0,this._textureSize,0);gP(d,u),h.fillStyle=d,h.fillRect(0,0,l,1),this.texture=new exports.Texture({source:new Yt({resource:c,addressMode:this._wrapMode})});let p=Math.sqrt(n*n+o*o),m=Math.atan2(o,n),b=new G;b.scale(p/l,1),b.rotate(m),b.translate(e,t),this.textureSpace==="local"&&b.scale(l,l),this.transform=b;}buildGradient(){this.type==="linear"?this.buildLinearGradient():this.buildRadialGradient();}buildRadialGradient(){if(this.texture)return;let e=this.colorStops.length?this.colorStops:mP,t=this._textureSize,{canvas:i,context:s}=xP(t,t),{x:n,y:o}=this.center,{x:a,y:u}=this.outerCenter,l=this.innerRadius,c=this.outerRadius,h=a-c,d=u-c,p=t/(c*2),m=(n-h)*p,b=(o-d)*p,_=s.createRadialGradient(m,b,l*p,(a-h)*p,(u-d)*p,c*p);gP(_,e),s.fillStyle=e[e.length-1].color,s.fillRect(0,0,t,t),s.fillStyle=_,s.translate(m,b),s.rotate(this.rotation),s.scale(1,this.scale),s.translate(-m,-b),s.fillRect(0,0,t,t),this.texture=new exports.Texture({source:new Yt({resource:i,addressMode:this._wrapMode})});let g=new G;g.scale(1/p,1/p),g.translate(h,d),this.textureSpace==="local"&&g.scale(t,t),this.transform=g;}get styleKey(){return this.uid}destroy(){this.texture?.destroy(true),this.texture=null;}};rv.defaultLinearOptions={start:{x:0,y:0},end:{x:0,y:1},colorStops:[],textureSpace:"local",type:"linear",textureSize:256,wrapMode:"clamp-to-edge"};rv.defaultRadialOptions={center:{x:.5,y:.5},innerRadius:0,outerRadius:.5,colorStops:[],scale:1,textureSpace:"local",type:"radial",textureSize:256,wrapMode:"clamp-to-edge"};qt=rv;});function Im(r,e,t,i){let s=e.matrix?r.copyFrom(e.matrix).invert():r.identity();if(e.textureSpace==="local"){let o=t.getBounds(XD);e.width&&o.pad(e.width);let{x:a,y:u}=o,l=1/o.width,c=1/o.height,h=-a*l,d=-u*c,p=s.a,m=s.b,b=s.c,_=s.d;s.a*=l,s.b*=l,s.c*=c,s.d*=c,s.tx=h*p+d*b+s.tx,s.ty=h*m+d*_+s.ty;}else s.translate(e.texture.frame.x,e.texture.frame.y),s.scale(1/e.texture.source.width,1/e.texture.source.height);let n=e.texture.source.style;return !(e.fill instanceof qt)&&n.addressMode==="clamp-to-edge"&&(n.addressMode="repeat",n.update()),i&&s.append(WD.copyFrom(i).invert()),s}var WD,XD,iv=f(()=>{Te();ct();_o();WD=new G,XD=new exports.Rectangle;});function Dm(r,e){let{geometryData:t,batches:i}=e;i.length=0,t.indices.length=0,t.vertices.length=0,t.uvs.length=0;for(let s=0;s<r.instructions.length;s++){let n=r.instructions[s];if(n.action==="texture")$D(n.data,i,t);else if(n.action==="fill"||n.action==="stroke"){let o=n.action==="stroke",a=n.data.path.shapePath,u=n.data.style,l=n.data.hole;o&&l&&_P(l.shapePath,u,true,i,t),l&&(a.shapePrimitives[a.shapePrimitives.length-1].holes=l.shapePath.shapePrimitives),_P(a,u,o,i,t);}}}function $D(r,e,t){let i=[],s=Ru.rectangle,n=YD;n.x=r.dx,n.y=r.dy,n.width=r.dw,n.height=r.dh;let o=r.transform;if(!s.build(n,i))return;let{vertices:a,uvs:u,indices:l}=t,c=l.length,h=a.length/2;o&&oh(i,o),s.triangulate(i,a,2,h,l,c);let d=r.image,p=d.uvs;u.push(p.x0,p.y0,p.x1,p.y1,p.x3,p.y3,p.x2,p.y2);let m=Ve.get(ls);m.indexOffset=c,m.indexSize=l.length-c,m.attributeOffset=h,m.attributeSize=a.length/2-h,m.baseColor=r.style,m.alpha=r.alpha,m.texture=d,m.geometryData=t,e.push(m);}function _P(r,e,t,i,s){let{vertices:n,uvs:o,indices:a}=s;r.shapePrimitives.forEach(({shape:u,transform:l,holes:c})=>{let h=[],d=Ru[u.type];if(!d.build(u,h))return;let p=a.length,m=n.length/2,b="triangle-list";if(l&&oh(h,l),t){let S=u.closePath??true,E=e;E.pixelLine?(Sm(h,S,n,a),b="line-list"):Tm(h,E,false,S,n,a);}else if(c){let S=[],E=h.slice();qD(c).forEach(T=>{S.push(E.length/2),E.push(...T);}),Bu(E,S,n,2,m,a,p);}else d.triangulate(h,n,2,m,a,p);let _=o.length/2,g=e.texture;if(g!==exports.Texture.WHITE){let S=Im(jD,e,u,l);pm(n,2,m,o,_,2,n.length/2-m,S);}else mm(o,_,2,n.length/2-m);let y=Ve.get(ls);y.indexOffset=p,y.indexSize=a.length-p,y.attributeOffset=m,y.attributeSize=n.length/2-m,y.baseColor=e.color,y.alpha=e.alpha,y.texture=g,y.geometryData=s,y.topology=b,i.push(y);});}function qD(r){let e=[];for(let t=0;t<r.length;t++){let i=r[t].shape,s=[];Ru[i.type].build(i,s)&&e.push(s);}return e}var Ru,YD,jD,sv=f(()=>{B();Te();ct();z0();W0();ye();Si();gm();X0();j0();$0();Q0();J0();ev();iv();wm();Ru={};V.handleByMap(x.ShapeBuilder,Ru);V.add(Rm,Bm,Mm,tn,xm,_m);YD=new exports.Rectangle,jD=new G;});var hh,dh,ov,rn,fh=f(()=>{B();Kc();fm();lp();Pe();Si();sv();hh=class{constructor(){this.batches=[],this.geometryData={vertices:[],uvs:[],indices:[]};}},dh=class{constructor(){this.instructions=new Is;}init(e){this.batcher=new mo({maxTextures:e}),this.instructions.reset();}get geometry(){return U(Xf,"GraphicsContextRenderData#geometry is deprecated, please use batcher.geometry instead."),this.batcher.geometry}},ov=class nv{constructor(e){this._gpuContextHash={},this._graphicsDataContextHash=Object.create(null),this._renderer=e,e.renderableGC.addManagedHash(this,"_gpuContextHash"),e.renderableGC.addManagedHash(this,"_graphicsDataContextHash");}init(e){nv.defaultOptions.bezierSmoothness=e?.bezierSmoothness??nv.defaultOptions.bezierSmoothness;}getContextRenderData(e){return this._graphicsDataContextHash[e.uid]||this._initContextRenderData(e)}updateGpuContext(e){let t=this._gpuContextHash[e.uid]||this._initContext(e);if(e.dirty){t?this._cleanGraphicsContextData(e):t=this._initContext(e),Dm(e,t);let i=e.batchMode;e.customShader||i==="no-batch"?t.isBatchable=false:i==="auto"?t.isBatchable=t.geometryData.vertices.length<400:t.isBatchable=true,e.dirty=false;}return t}getGpuContext(e){return this._gpuContextHash[e.uid]||this._initContext(e)}_initContextRenderData(e){let t=Ve.get(dh,{maxTextures:this._renderer.limits.maxBatchableTextures}),{batches:i,geometryData:s}=this._gpuContextHash[e.uid],n=s.vertices.length,o=s.indices.length;for(let c=0;c<i.length;c++)i[c].applyTransform=false;let a=t.batcher;a.ensureAttributeBuffer(n),a.ensureIndexBuffer(o),a.begin();for(let c=0;c<i.length;c++){let h=i[c];a.add(h);}a.finish(t.instructions);let u=a.geometry;u.indexBuffer.setDataWithSize(a.indexBuffer,a.indexSize,true),u.buffers[0].setDataWithSize(a.attributeBuffer.float32View,a.attributeSize,true);let l=a.batches;for(let c=0;c<l.length;c++){let h=l[c];h.bindGroup=Ws(h.textures.textures,h.textures.count,this._renderer.limits.maxBatchableTextures);}return this._graphicsDataContextHash[e.uid]=t,t}_initContext(e){let t=new hh;return t.context=e,this._gpuContextHash[e.uid]=t,e.on("destroy",this.onGraphicsContextDestroy,this),this._gpuContextHash[e.uid]}onGraphicsContextDestroy(e){this._cleanGraphicsContextData(e),e.off("destroy",this.onGraphicsContextDestroy,this),this._gpuContextHash[e.uid]=null;}_cleanGraphicsContextData(e){let t=this._gpuContextHash[e.uid];t.isBatchable||this._graphicsDataContextHash[e.uid]&&(Ve.return(this.getContextRenderData(e)),this._graphicsDataContextHash[e.uid]=null),t.batches&&t.batches.forEach(i=>{Ve.return(i);});}destroy(){for(let e in this._gpuContextHash)this._gpuContextHash[e]&&this.onGraphicsContextDestroy(this._gpuContextHash[e].context);}};ov.extension={type:[x.WebGLSystem,x.WebGPUSystem,x.CanvasSystem],name:"graphicsContext"};ov.defaultOptions={bezierSmoothness:.5};rn=ov;});var KD,av,uv,lv,cv,hv,dv,fv,Qe,Pr=f(()=>{KD={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},av=0,uv=1,lv=2,cv=3,hv=4,dv=5,fv=class bP{constructor(){this.data=0,this.blendMode="normal",this.polygonOffset=0,this.blend=true,this.depthMask=true;}get blend(){return !!(this.data&1<<av)}set blend(e){!!(this.data&1<<av)!==e&&(this.data^=1<<av);}get offsets(){return !!(this.data&1<<uv)}set offsets(e){!!(this.data&1<<uv)!==e&&(this.data^=1<<uv);}set cullMode(e){if(e==="none"){this.culling=false;return}this.culling=true,this.clockwiseFrontFace=e==="front";}get cullMode(){return this.culling?this.clockwiseFrontFace?"front":"back":"none"}get culling(){return !!(this.data&1<<lv)}set culling(e){!!(this.data&1<<lv)!==e&&(this.data^=1<<lv);}get depthTest(){return !!(this.data&1<<cv)}set depthTest(e){!!(this.data&1<<cv)!==e&&(this.data^=1<<cv);}get depthMask(){return !!(this.data&1<<dv)}set depthMask(e){!!(this.data&1<<dv)!==e&&(this.data^=1<<dv);}get clockwiseFrontFace(){return !!(this.data&1<<hv)}set clockwiseFrontFace(e){!!(this.data&1<<hv)!==e&&(this.data^=1<<hv);}get blendMode(){return this._blendMode}set blendMode(e){this.blend=e!=="none",this._blendMode=e,this._blendModeId=KD[e]||0;}get polygonOffset(){return this._polygonOffset}set polygonOffset(e){this.offsets=!!e,this._polygonOffset=e;}toString(){return `[pixi.js/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`}static for2d(){let e=new bP;return e.depthTest=false,e.blend=true,e}};fv.default2d=fv.for2d();Qe=fv;});function yP(r,e,t,i){t[i++]=(r>>16&255)/255,t[i++]=(r>>8&255)/255,t[i++]=(r&255)/255,t[i++]=e;}function Wr(r,e,t){let i=(r>>24&255)/255;e[t++]=(r&255)/255*i,e[t++]=(r>>8&255)/255*i,e[t++]=(r>>16&255)/255*i,e[t++]=i;}var bo=f(()=>{});var ph,yo,pv=f(()=>{B();Pr();Si();bo();gm();ph=class{constructor(){this.batches=[],this.batched=false;}destroy(){this.batches.forEach(e=>{Ve.return(e);}),this.batches.length=0;}},yo=class{constructor(e,t){this.state=Qe.for2d(),this.renderer=e,this._adaptor=t,this.renderer.runners.contextChange.add(this);}contextChange(){this._adaptor.contextChange(this.renderer);}validateRenderable(e){let t=e.context,i=!!e._gpuData,s=this.renderer.graphicsContext.updateGpuContext(t);return !!(s.isBatchable||i!==s.isBatchable)}addRenderable(e,t){let i=this.renderer.graphicsContext.updateGpuContext(e.context);e.didViewUpdate&&this._rebuild(e),i.isBatchable?this._addToBatcher(e,t):(this.renderer.renderPipes.batch.break(t),t.add(e));}updateRenderable(e){let i=this._getGpuDataForRenderable(e).batches;for(let s=0;s<i.length;s++){let n=i[s];n._batcher.updateElement(n);}}execute(e){if(!e.isRenderable)return;let t=this.renderer,i=e.context;if(!t.graphicsContext.getGpuContext(i).batches.length)return;let n=i.customShader||this._adaptor.shader;this.state.blendMode=e.groupBlendMode;let o=n.resources.localUniforms.uniforms;o.uTransformMatrix=e.groupTransform,o.uRound=t._roundPixels|e._roundPixels,Wr(e.groupColorAlpha,o.uColor,0),this._adaptor.execute(this,e);}_rebuild(e){let t=this._getGpuDataForRenderable(e),i=this.renderer.graphicsContext.updateGpuContext(e.context);t.destroy(),i.isBatchable&&this._updateBatchesForRenderable(e,t);}_addToBatcher(e,t){let i=this.renderer.renderPipes.batch,s=this._getGpuDataForRenderable(e).batches;for(let n=0;n<s.length;n++){let o=s[n];i.addToBatch(o,t);}}_getGpuDataForRenderable(e){return e._gpuData[this.renderer.uid]||this._initGpuDataForRenderable(e)}_initGpuDataForRenderable(e){let t=new ph;return e._gpuData[this.renderer.uid]=t,t}_updateBatchesForRenderable(e,t){let i=e.context,s=this.renderer.graphicsContext.getGpuContext(i),n=this.renderer._roundPixels|e._roundPixels;t.batches=s.batches.map(o=>{let a=Ve.get(ls);return o.copyTo(a),a.renderable=e,a.roundPixels=n,a});}destroy(){this.renderer=null,this._adaptor.destroy(),this._adaptor=null,this.state=null;}};yo.extension={type:[x.WebGLPipes,x.WebGPUPipes,x.CanvasPipes],name:"graphics"};});var mv=f(()=>{B();fh();pv();V.add(yo);V.add(rn);});var wi,mh=f(()=>{wi=class{constructor(){this.batcherName="default",this.packAsQuad=false,this.indexOffset=0,this.attributeOffset=0,this.roundPixels=0,this._batcher=null,this._batch=null,this._textureMatrixUpdateId=-1,this._uvUpdateId=-1;}get blendMode(){return this.renderable.groupBlendMode}get topology(){return this._topology||this.geometry.topology}set topology(e){this._topology=e;}reset(){this.renderable=null,this.texture=null,this._batcher=null,this._batch=null,this.geometry=null,this._uvUpdateId=-1,this._textureMatrixUpdateId=-1;}setTexture(e){this.texture!==e&&(this.texture=e,this._textureMatrixUpdateId=-1);}get uvs(){let t=this.geometry.getBuffer("aUV"),i=t.data,s=i,n=this.texture.textureMatrix;return n.isSimple||(s=this._transformedUvs,(this._textureMatrixUpdateId!==n._updateID||this._uvUpdateId!==t._updateID)&&((!s||s.length<i.length)&&(s=this._transformedUvs=new Float32Array(i.length)),this._textureMatrixUpdateId=n._updateID,this._uvUpdateId=t._updateID,n.multiplyUvs(i,s))),s}get positions(){return this.geometry.positions}get indices(){return this.geometry.indices}get color(){return this.renderable.groupColorAlpha}get groupTransform(){return this.renderable.groupTransform}get attributeSize(){return this.geometry.positions.length/2}get indexSize(){return this.geometry.indices.length}};});var Mu,vo,gv=f(()=>{B();Te();ns();ht();xu();bo();mh();Mu=class{destroy(){}},vo=class{constructor(e,t){this.localUniforms=new xe({uTransformMatrix:{value:new G,type:"mat3x3<f32>"},uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uRound:{value:0,type:"f32"}}),this.localUniformsBindGroup=new _t({0:this.localUniforms}),this.renderer=e,this._adaptor=t,this._adaptor.init();}validateRenderable(e){let t=this._getMeshData(e),i=t.batched,s=e.batched;if(t.batched=s,i!==s)return true;if(s){let n=e._geometry;if(n.indices.length!==t.indexSize||n.positions.length!==t.vertexSize)return t.indexSize=n.indices.length,t.vertexSize=n.positions.length,true;let o=this._getBatchableMesh(e);return o.texture.uid!==e._texture.uid&&(o._textureMatrixUpdateId=-1),!o._batcher.checkAndUpdateTexture(o,e._texture)}return false}addRenderable(e,t){let i=this.renderer.renderPipes.batch,{batched:s}=this._getMeshData(e);if(s){let n=this._getBatchableMesh(e);n.setTexture(e._texture),n.geometry=e._geometry,i.addToBatch(n,t);}else i.break(t),t.add(e);}updateRenderable(e){if(e.batched){let t=this._getBatchableMesh(e);t.setTexture(e._texture),t.geometry=e._geometry,t._batcher.updateElement(t);}}execute(e){if(!e.isRenderable)return;e.state.blendMode=oi(e.groupBlendMode,e.texture._source);let t=this.localUniforms;t.uniforms.uTransformMatrix=e.groupTransform,t.uniforms.uRound=this.renderer._roundPixels|e._roundPixels,t.update(),Wr(e.groupColorAlpha,t.uniforms.uColor,0),this._adaptor.execute(this,e);}_getMeshData(e){var t,i;return (t=e._gpuData)[i=this.renderer.uid]||(t[i]=new Mu),e._gpuData[this.renderer.uid].meshData||this._initMeshData(e)}_initMeshData(e){return e._gpuData[this.renderer.uid].meshData={batched:e.batched,indexSize:e._geometry.indices?.length,vertexSize:e._geometry.positions?.length},e._gpuData[this.renderer.uid].meshData}_getBatchableMesh(e){var t,i;return (t=e._gpuData)[i=this.renderer.uid]||(t[i]=new Mu),e._gpuData[this.renderer.uid].batchableMesh||this._initBatchableMesh(e)}_initBatchableMesh(e){let t=new wi;return t.renderable=e,t.setTexture(e._texture),t.transform=e.groupTransform,t.roundPixels=this.renderer._roundPixels|e._roundPixels,e._gpuData[this.renderer.uid].batchableMesh=t,t}destroy(){this.localUniforms=null,this.localUniformsBindGroup=null,this._adaptor.destroy(),this._adaptor=null,this.renderer=null;}};vo.extension={type:[x.WebGLPipes,x.WebGPUPipes,x.CanvasPipes],name:"mesh"};});var xv=f(()=>{B();gv();V.add(vo);});var Iu,_v=f(()=>{Iu=class{execute(e,t){let i=e.state,s=e.renderer,n=t.shader||e.defaultShader;n.resources.uTexture=t.texture._source,n.resources.uniforms=e.localUniforms;let o=s.gl,a=e.getBuffers(t);s.shader.bind(n),s.state.set(i),s.geometry.bind(a.geometry,n.glProgram);let l=a.geometry.indexBuffer.data.BYTES_PER_ELEMENT===2?o.UNSIGNED_SHORT:o.UNSIGNED_INT;o.drawElements(o.TRIANGLES,t.particleChildren.length*6,l,0);}};});function gh(r,e=null){let t=r*6;if(t>65535?e||(e=new Uint32Array(t)):e||(e=new Uint16Array(t)),e.length!==t)throw new Error(`Out buffer length is incorrect, got ${e.length} and expected ${t}`);for(let i=0,s=0;i<t;i+=6,s+=4)e[i+0]=s+0,e[i+1]=s+1,e[i+2]=s+2,e[i+3]=s+0,e[i+4]=s+2,e[i+5]=s+3;return e}var bv=f(()=>{});function km(r){return {dynamicUpdate:vP(r,true),staticUpdate:vP(r,false)}}function vP(r,e){let t=[];t.push(`
261
261
 
262
262
  var index = 0;
263
263
 
@@ -271,7 +271,7 @@ ${s.join(`
271
271
  `),t.unshift(`
272
272
  var stride = ${i};
273
273
  `);let s=t.join(`
274
- `);return new Function("ps","f32v","u32v",s)}var yv=f(()=>{js();});function ZD(r){let e=[];for(let t in r){let i=r[t];e.push(t,i.code,i.dynamic?"d":"s");}return e.join("_")}var Du,vv=f(()=>{os();Pi();Ys();js();Fp();bv();yv();Du=class{constructor(e){this._size=0,this._generateParticleUpdateCache={};let t=this._size=e.size??1e3,i=e.properties,s=0,n=0;for(let c in i){let h=i[c],d=$t(h.format);h.dynamic?n+=d.stride:s+=d.stride;}this._dynamicStride=n/4,this._staticStride=s/4,this.staticAttributeBuffer=new Lr(t*4*s),this.dynamicAttributeBuffer=new Lr(t*4*n),this.indexBuffer=gh(t);let o=new jt,a=0,u=0;this._staticBuffer=new tt({data:new Float32Array(1),label:"static-particle-buffer",shrinkToFit:false,usage:he.VERTEX|he.COPY_DST}),this._dynamicBuffer=new tt({data:new Float32Array(1),label:"dynamic-particle-buffer",shrinkToFit:false,usage:he.VERTEX|he.COPY_DST});for(let c in i){let h=i[c],d=$t(h.format);h.dynamic?(o.addAttribute(h.attributeName,{buffer:this._dynamicBuffer,stride:this._dynamicStride*4,offset:a*4,format:h.format}),a+=d.size):(o.addAttribute(h.attributeName,{buffer:this._staticBuffer,stride:this._staticStride*4,offset:u*4,format:h.format}),u+=d.size);}o.addIndex(this.indexBuffer);let l=this.getParticleUpdate(i);this._dynamicUpload=l.dynamicUpdate,this._staticUpload=l.staticUpdate,this.geometry=o;}getParticleUpdate(e){let t=ZD(e);return this._generateParticleUpdateCache[t]?this._generateParticleUpdateCache[t]:(this._generateParticleUpdateCache[t]=this.generateParticleUpdate(e),this._generateParticleUpdateCache[t])}generateParticleUpdate(e){return km(e)}update(e,t){e.length>this._size&&(t=true,this._size=Math.max(e.length,this._size*1.5|0),this.staticAttributeBuffer=new Lr(this._size*this._staticStride*4*4),this.dynamicAttributeBuffer=new Lr(this._size*this._dynamicStride*4*4),this.indexBuffer=gh(this._size),this.geometry.indexBuffer.setDataWithSize(this.indexBuffer,this.indexBuffer.byteLength,true));let i=this.dynamicAttributeBuffer;if(this._dynamicUpload(e,i.float32View,i.uint32View),this._dynamicBuffer.setDataWithSize(this.dynamicAttributeBuffer.float32View,e.length*this._dynamicStride*4,true),t){let s=this.staticAttributeBuffer;this._staticUpload(e,s.float32View,s.uint32View),this._staticBuffer.setDataWithSize(s.float32View,e.length*this._staticStride*4,true);}}destroy(){this._staticBuffer.destroy(),this._dynamicBuffer.destroy(),this.geometry.destroy();}};});var Om,Tv=f(()=>{Om=`varying vec2 vUV;
274
+ `);return new Function("ps","f32v","u32v",s)}var yv=f(()=>{js();});function ZD(r){let e=[];for(let t in r){let i=r[t];e.push(t,i.code,i.dynamic?"d":"s");}return e.join("_")}var Du,vv=f(()=>{os();Pi();Ys();js();Fp();bv();yv();Du=class{constructor(e){this._size=0,this._generateParticleUpdateCache={};let t=this._size=e.size??1e3,i=e.properties,s=0,n=0;for(let c in i){let h=i[c],d=$t(h.format);h.dynamic?n+=d.stride:s+=d.stride;}this._dynamicStride=n/4,this._staticStride=s/4,this.staticAttributeBuffer=new Ur(t*4*s),this.dynamicAttributeBuffer=new Ur(t*4*n),this.indexBuffer=gh(t);let o=new jt,a=0,u=0;this._staticBuffer=new tt({data:new Float32Array(1),label:"static-particle-buffer",shrinkToFit:false,usage:he.VERTEX|he.COPY_DST}),this._dynamicBuffer=new tt({data:new Float32Array(1),label:"dynamic-particle-buffer",shrinkToFit:false,usage:he.VERTEX|he.COPY_DST});for(let c in i){let h=i[c],d=$t(h.format);h.dynamic?(o.addAttribute(h.attributeName,{buffer:this._dynamicBuffer,stride:this._dynamicStride*4,offset:a*4,format:h.format}),a+=d.size):(o.addAttribute(h.attributeName,{buffer:this._staticBuffer,stride:this._staticStride*4,offset:u*4,format:h.format}),u+=d.size);}o.addIndex(this.indexBuffer);let l=this.getParticleUpdate(i);this._dynamicUpload=l.dynamicUpdate,this._staticUpload=l.staticUpdate,this.geometry=o;}getParticleUpdate(e){let t=ZD(e);return this._generateParticleUpdateCache[t]?this._generateParticleUpdateCache[t]:(this._generateParticleUpdateCache[t]=this.generateParticleUpdate(e),this._generateParticleUpdateCache[t])}generateParticleUpdate(e){return km(e)}update(e,t){e.length>this._size&&(t=true,this._size=Math.max(e.length,this._size*1.5|0),this.staticAttributeBuffer=new Ur(this._size*this._staticStride*4*4),this.dynamicAttributeBuffer=new Ur(this._size*this._dynamicStride*4*4),this.indexBuffer=gh(this._size),this.geometry.indexBuffer.setDataWithSize(this.indexBuffer,this.indexBuffer.byteLength,true));let i=this.dynamicAttributeBuffer;if(this._dynamicUpload(e,i.float32View,i.uint32View),this._dynamicBuffer.setDataWithSize(this.dynamicAttributeBuffer.float32View,e.length*this._dynamicStride*4,true),t){let s=this.staticAttributeBuffer;this._staticUpload(e,s.float32View,s.uint32View),this._staticBuffer.setDataWithSize(s.float32View,e.length*this._staticStride*4,true);}}destroy(){this._staticBuffer.destroy(),this._dynamicBuffer.destroy(),this.geometry.destroy();}};});var Om,Tv=f(()=>{Om=`varying vec2 vUV;
275
275
  varying vec4 vColor;
276
276
 
277
277
  uniform sampler2D uTexture;
@@ -371,7 +371,7 @@ fn mainFragment(
371
371
  var sample = textureSample(uTexture, uSampler, uv) * color;
372
372
 
373
373
  return sample;
374
- }`;});var ku,Cv=f(()=>{gt();Te();dr();Cr();Wr();ye();ts();Tv();Sv();Ev();ku=class extends rt{constructor(){let e=je.from({vertex:Fm,fragment:Om}),t=$e.from({fragment:{source:xh,entryPoint:"mainFragment"},vertex:{source:xh,entryPoint:"mainVertex"}});super({glProgram:e,gpuProgram:t,resources:{uTexture:exports.Texture.WHITE.source,uSampler:new xt({}),uniforms:{uTranslationMatrix:{value:new G,type:"mat3x3<f32>"},uColor:{value:new te(16777215),type:"vec4<f32>"},uRound:{value:1,type:"f32"},uResolution:{value:[0,0],type:"vec2<f32>"}}}});}};});var sn,Gm=f(()=>{Te();ht();xu();Pr();bo();vv();Cv();sn=class{constructor(e,t){this.state=Qe.for2d(),this.localUniforms=new xe({uTranslationMatrix:{value:new G,type:"mat3x3<f32>"},uColor:{value:new Float32Array(4),type:"vec4<f32>"},uRound:{value:1,type:"f32"},uResolution:{value:[0,0],type:"vec2<f32>"}}),this.renderer=e,this.adaptor=t,this.defaultShader=new ku,this.state=Qe.for2d();}validateRenderable(e){return false}addRenderable(e,t){this.renderer.renderPipes.batch.break(t),t.add(e);}getBuffers(e){return e._gpuData[this.renderer.uid]||this._initBuffer(e)}_initBuffer(e){return e._gpuData[this.renderer.uid]=new Du({size:e.particleChildren.length,properties:e._properties}),e._gpuData[this.renderer.uid]}updateRenderable(e){}execute(e){let t=e.particleChildren;if(t.length===0)return;let i=this.renderer,s=this.getBuffers(e);e.texture||(e.texture=t[0].texture);let n=this.state;s.update(t,e._childrenDirty),e._childrenDirty=false,n.blendMode=oi(e.blendMode,e.texture._source);let o=this.localUniforms.uniforms,a=o.uTranslationMatrix;e.worldTransform.copyTo(a),a.prepend(i.globalUniforms.globalUniformData.projectionMatrix),o.uResolution=i.globalUniforms.globalUniformData.resolution,o.uRound=i._roundPixels|e._roundPixels,Xr(e.groupColorAlpha,o.uColor,0),this.adaptor.execute(this,e);}destroy(){this.defaultShader&&(this.defaultShader.destroy(),this.defaultShader=null);}};});var To,Av=f(()=>{B();_v();Gm();To=class extends sn{constructor(e){super(e,new Iu);}};To.extension={type:[x.WebGLPipes],name:"particle"};});var Ou,Pv=f(()=>{Ou=class{execute(e,t){let i=e.renderer,s=t.shader||e.defaultShader;s.groups[0]=i.renderPipes.uniformBatch.getUniformBindGroup(e.localUniforms,true),s.groups[1]=i.texture.getTextureBindGroup(t.texture);let n=e.state,o=e.getBuffers(t);i.encoder.draw({geometry:o.geometry,shader:t.shader||e.defaultShader,state:n,size:t.particleChildren.length*6});}};});var So,wv=f(()=>{B();Pv();Gm();So=class extends sn{constructor(e){super(e,new Ou);}};So.extension={type:[x.WebGPUPipes],name:"particle"};});var Bv=f(()=>{B();Av();wv();V.add(To);V.add(So);});function Eo(r,e){let{texture:t,bounds:i}=r;mu(i,e._anchor,t);let s=e._style._getFinalPadding();i.minX-=s,i.minY-=s,i.maxX-=s,i.maxY-=s;}var Um=f(()=>{Mp();});var Yr,Fu=f(()=>{Yr=class{constructor(){this.batcherName="default",this.topology="triangle-list",this.attributeSize=4,this.indexSize=6,this.packAsQuad=true,this.roundPixels=0,this._attributeStart=0,this._batcher=null,this._batch=null;}get blendMode(){return this.renderable.groupBlendMode}get color(){return this.renderable.groupColorAlpha}reset(){this.renderable=null,this.texture=null,this._batcher=null,this._batch=null,this.bounds=null;}destroy(){}};});var Gu,Rv=f(()=>{Fu();Gu=class extends Yr{constructor(e){super(),this._renderer=e,e.runners.resolutionChange.add(this);}resolutionChange(){let e=this.renderable;e._autoResolution&&e.onViewUpdate();}destroy(){this._renderer.canvasText.returnTexture(this.texture),this._renderer=null;}};});var Co,Mv=f(()=>{B();Um();Rv();Co=class{constructor(e){this._renderer=e;}validateRenderable(e){return e._didTextUpdate}addRenderable(e,t){let i=this._getGpuText(e);e._didTextUpdate&&(this._updateGpuText(e),e._didTextUpdate=false),this._renderer.renderPipes.batch.addToBatch(i,t);}updateRenderable(e){let t=this._getGpuText(e);t._batcher.updateElement(t);}_updateGpuText(e){let t=this._getGpuText(e);t.texture&&this._renderer.canvasText.returnTexture(t.texture),e._resolution=e._autoResolution?this._renderer.resolution:e.resolution,t.texture=t.texture=this._renderer.canvasText.getTexture(e),Eo(t,e);}_getGpuText(e){return e._gpuData[this._renderer.uid]||this.initGpuText(e)}initGpuText(e){let t=new Gu(this._renderer);return t.renderable=e,t.transform=e.groupTransform,t.bounds={minX:0,maxX:1,minY:0,maxY:0},t.roundPixels=this._renderer._roundPixels|e._roundPixels,e._gpuData[this._renderer.uid]=t,t}destroy(){this._renderer=null;}};Co.extension={type:[x.WebGLPipes,x.WebGPUPipes,x.CanvasPipes],name:"text"};});var TP,ui,_h=f(()=>{Te();Et();TP={repeat:{addressModeU:"repeat",addressModeV:"repeat"},"repeat-x":{addressModeU:"repeat",addressModeV:"clamp-to-edge"},"repeat-y":{addressModeU:"clamp-to-edge",addressModeV:"repeat"},"no-repeat":{addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"}},ui=class{constructor(e,t){this.uid=ce("fillPattern"),this.transform=new G,this._styleKey=null,this.texture=e,this.transform.scale(1/e.frame.width,1/e.frame.height),t&&(e.source.style.addressModeU=TP[t].addressModeU,e.source.style.addressModeV=TP[t].addressModeV);}setTransform(e){let t=this.texture;this.transform.copyFrom(e),this.transform.invert(),this.transform.scale(1/t.frame.width,1/t.frame.height),this._styleKey=null;}get styleKey(){return this._styleKey?this._styleKey:(this._styleKey=`fill-pattern-${this.uid}-${this.texture.uid}-${this.transform.toArray().join("-")}`,this._styleKey)}};});var EP=Qr((nz,SP)=>{SP.exports=JD;var Iv={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},QD=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function JD(r){var e=[];return r.replace(QD,function(t,i,s){var n=i.toLowerCase();for(s=tk(s),n=="m"&&s.length>2&&(e.push([i].concat(s.splice(0,2))),n="l",i=i=="m"?"l":"L");;){if(s.length==Iv[n])return s.unshift(i),e.push(s);if(s.length<Iv[n])throw new Error("malformed path data");e.push([i].concat(s.splice(0,Iv[n])));}}),e}var ek=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function tk(r){var e=r.match(ek);return e?e.map(Number):[]}});function Lm(r,e){let t=(0, CP.default)(r),i=[],s=null,n=0,o=0;for(let a=0;a<t.length;a++){let u=t[a],l=u[0],c=u;switch(l){case "M":n=c[1],o=c[2],e.moveTo(n,o);break;case "m":n+=c[1],o+=c[2],e.moveTo(n,o);break;case "H":n=c[1],e.lineTo(n,o);break;case "h":n+=c[1],e.lineTo(n,o);break;case "V":o=c[1],e.lineTo(n,o);break;case "v":o+=c[1],e.lineTo(n,o);break;case "L":n=c[1],o=c[2],e.lineTo(n,o);break;case "l":n+=c[1],o+=c[2],e.lineTo(n,o);break;case "C":n=c[5],o=c[6],e.bezierCurveTo(c[1],c[2],c[3],c[4],n,o);break;case "c":e.bezierCurveTo(n+c[1],o+c[2],n+c[3],o+c[4],n+c[5],o+c[6]),n+=c[5],o+=c[6];break;case "S":n=c[3],o=c[4],e.bezierCurveToShort(c[1],c[2],n,o);break;case "s":e.bezierCurveToShort(n+c[1],o+c[2],n+c[3],o+c[4]),n+=c[3],o+=c[4];break;case "Q":n=c[3],o=c[4],e.quadraticCurveTo(c[1],c[2],n,o);break;case "q":e.quadraticCurveTo(n+c[1],o+c[2],n+c[3],o+c[4]),n+=c[3],o+=c[4];break;case "T":n=c[1],o=c[2],e.quadraticCurveToShort(n,o);break;case "t":n+=c[1],o+=c[2],e.quadraticCurveToShort(n,o);break;case "A":n=c[6],o=c[7],e.arcToSvg(c[1],c[2],c[3],c[4],c[5],n,o);break;case "a":n+=c[6],o+=c[7],e.arcToSvg(c[1],c[2],c[3],c[4],c[5],n,o);break;case "Z":case "z":e.closePath(),i.length>0&&(s=i.pop(),s?(n=s.startX,o=s.startY):(n=0,o=0)),s=null;break;default:N(`Unknown SVG path command: ${l}`);}l!=="Z"&&l!=="z"&&s===null&&(s={startX:n,startY:o},i.push(s));}return e}var CP,Dv=f(()=>{CP=tu(EP());Be();});var Uu,kv=f(()=>{ct();Uu=class r{constructor(e=0,t=0,i=0){this.type="circle",this.x=e,this.y=t,this.radius=i;}clone(){return new r(this.x,this.y,this.radius)}contains(e,t){if(this.radius<=0)return false;let i=this.radius*this.radius,s=this.x-e,n=this.y-t;return s*=s,n*=n,s+n<=i}strokeContains(e,t,i,s=.5){if(this.radius===0)return false;let n=this.x-e,o=this.y-t,a=this.radius,u=(1-s)*i,l=Math.sqrt(n*n+o*o);return l<=a+u&&l>a-(i-u)}getBounds(e){return e||(e=new exports.Rectangle),e.x=this.x-this.radius,e.y=this.y-this.radius,e.width=this.radius*2,e.height=this.radius*2,e}copyFrom(e){return this.x=e.x,this.y=e.y,this.radius=e.radius,this}copyTo(e){return e.copyFrom(this),e}toString(){return `[pixi.js/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`}};});var Lu,Ov=f(()=>{ct();Lu=class r{constructor(e=0,t=0,i=0,s=0){this.type="ellipse",this.x=e,this.y=t,this.halfWidth=i,this.halfHeight=s;}clone(){return new r(this.x,this.y,this.halfWidth,this.halfHeight)}contains(e,t){if(this.halfWidth<=0||this.halfHeight<=0)return false;let i=(e-this.x)/this.halfWidth,s=(t-this.y)/this.halfHeight;return i*=i,s*=s,i+s<=1}strokeContains(e,t,i,s=.5){let{halfWidth:n,halfHeight:o}=this;if(n<=0||o<=0)return false;let a=i*(1-s),u=i-a,l=n-u,c=o-u,h=n+a,d=o+a,p=e-this.x,m=t-this.y,b=p*p/(l*l)+m*m/(c*c),_=p*p/(h*h)+m*m/(d*d);return b>1&&_<=1}getBounds(e){return e||(e=new exports.Rectangle),e.x=this.x-this.halfWidth,e.y=this.y-this.halfHeight,e.width=this.halfWidth*2,e.height=this.halfHeight*2,e}copyFrom(e){return this.x=e.x,this.y=e.y,this.halfWidth=e.halfWidth,this.halfHeight=e.halfHeight,this}copyTo(e){return e.copyFrom(this),e}toString(){return `[pixi.js/math:Ellipse x=${this.x} y=${this.y} halfWidth=${this.halfWidth} halfHeight=${this.halfHeight}]`}};});function nn(r,e,t,i,s,n){let o=r-t,a=e-i,u=s-t,l=n-i,c=o*u+a*l,h=u*u+l*l,d=-1;h!==0&&(d=c/h);let p,m;d<0?(p=t,m=i):d>1?(p=s,m=n):(p=t+d*u,m=i+d*l);let b=r-p,_=e-m;return b*b+_*_}var Nm=f(()=>{});var rk,ik,on,Fv=f(()=>{Nm();ct();on=class r{constructor(...e){this.type="polygon";let t=Array.isArray(e[0])?e[0]:e;if(typeof t[0]!="number"){let i=[];for(let s=0,n=t.length;s<n;s++)i.push(t[s].x,t[s].y);t=i;}this.points=t,this.closePath=true;}isClockwise(){let e=0,t=this.points,i=t.length;for(let s=0;s<i;s+=2){let n=t[s],o=t[s+1],a=t[(s+2)%i],u=t[(s+3)%i];e+=(a-n)*(u+o);}return e<0}containsPolygon(e){let t=this.getBounds(rk),i=e.getBounds(ik);if(!t.containsRect(i))return false;let s=e.points;for(let n=0;n<s.length;n+=2){let o=s[n],a=s[n+1];if(!this.contains(o,a))return false}return true}clone(){let e=this.points.slice(),t=new r(e);return t.closePath=this.closePath,t}contains(e,t){let i=false,s=this.points.length/2;for(let n=0,o=s-1;n<s;o=n++){let a=this.points[n*2],u=this.points[n*2+1],l=this.points[o*2],c=this.points[o*2+1];u>t!=c>t&&e<(l-a)*((t-u)/(c-u))+a&&(i=!i);}return i}strokeContains(e,t,i,s=.5){let n=i*i,o=n*(1-s),a=n-o,{points:u}=this,l=u.length-(this.closePath?0:2);for(let c=0;c<l;c+=2){let h=u[c],d=u[c+1],p=u[(c+2)%u.length],m=u[(c+3)%u.length],b=nn(e,t,h,d,p,m),_=Math.sign((p-h)*(t-d)-(m-d)*(e-h));if(b<=(_<0?a:o))return true}return false}getBounds(e){e||(e=new exports.Rectangle);let t=this.points,i=1/0,s=-1/0,n=1/0,o=-1/0;for(let a=0,u=t.length;a<u;a+=2){let l=t[a],c=t[a+1];i=l<i?l:i,s=l>s?l:s,n=c<n?c:n,o=c>o?c:o;}return e.x=i,e.width=s-i,e.y=n,e.height=o-n,e}copyFrom(e){return this.points=e.points.slice(),this.closePath=e.closePath,this}copyTo(e){return e.copyFrom(this),e}toString(){return `[pixi.js/math:PolygoncloseStroke=${this.closePath}points=${this.points.reduce((e,t)=>`${e}, ${t}`,"")}]`}get lastX(){return this.points[this.points.length-2]}get lastY(){return this.points[this.points.length-1]}get x(){return this.points[this.points.length-2]}get y(){return this.points[this.points.length-1]}};});var Hm,Nu,Gv=f(()=>{ct();Hm=(r,e,t,i,s,n,o)=>{let a=r-t,u=e-i,l=Math.sqrt(a*a+u*u);return l>=s-n&&l<=s+o},Nu=class r{constructor(e=0,t=0,i=0,s=0,n=20){this.type="roundedRectangle",this.x=e,this.y=t,this.width=i,this.height=s,this.radius=n;}getBounds(e){return e||(e=new exports.Rectangle),e.x=this.x,e.y=this.y,e.width=this.width,e.height=this.height,e}clone(){return new r(this.x,this.y,this.width,this.height,this.radius)}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this}copyTo(e){return e.copyFrom(this),e}contains(e,t){if(this.width<=0||this.height<=0)return false;if(e>=this.x&&e<=this.x+this.width&&t>=this.y&&t<=this.y+this.height){let i=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(t>=this.y+i&&t<=this.y+this.height-i||e>=this.x+i&&e<=this.x+this.width-i)return true;let s=e-(this.x+i),n=t-(this.y+i),o=i*i;if(s*s+n*n<=o||(s=e-(this.x+this.width-i),s*s+n*n<=o)||(n=t-(this.y+this.height-i),s*s+n*n<=o)||(s=e-(this.x+i),s*s+n*n<=o))return true}return false}strokeContains(e,t,i,s=.5){let{x:n,y:o,width:a,height:u,radius:l}=this,c=i*(1-s),h=i-c,d=n+l,p=o+l,m=a-l*2,b=u-l*2,_=n+a,g=o+u;return (e>=n-c&&e<=n+h||e>=_-h&&e<=_+c)&&t>=p&&t<=p+b||(t>=o-c&&t<=o+h||t>=g-h&&t<=g+c)&&e>=d&&e<=d+m?true:e<d&&t<p&&Hm(e,t,d,p,l,h,c)||e>_-l&&t<p&&Hm(e,t,_-l,p,l,h,c)||e>_-l&&t>g-l&&Hm(e,t,_-l,g-l,l,h,c)||e<d&&t>g-l&&Hm(e,t,d,g-l,l,h,c)}toString(){return `[pixi.js/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`}};});function Vu(r,e,t,i,s,n,o,a,u,l){let h=Math.min(.99,Math.max(0,l??rn.defaultOptions.bezierSmoothness)),d=(nk-h)/1;return d*=d,ok(e,t,i,s,n,o,a,u,r,d),r}function ok(r,e,t,i,s,n,o,a,u,l){Lv(r,e,t,i,s,n,o,a,u,l,0),u.push(o,a);}function Lv(r,e,t,i,s,n,o,a,u,l,c){if(c>sk)return;let h=Math.PI,d=(r+t)/2,p=(e+i)/2,m=(t+s)/2,b=(i+n)/2,_=(s+o)/2,g=(n+a)/2,y=(d+m)/2,S=(p+b)/2,E=(m+_)/2,F=(b+g)/2,T=(y+E)/2,C=(S+F)/2;if(c>0){let A=o-r,P=a-e,M=Math.abs((t-o)*P-(i-a)*A),k=Math.abs((s-o)*P-(n-a)*A),L,pe;if(M>Vm&&k>Vm){if((M+k)*(M+k)<=l*(A*A+P*P)){if(Hu<Uv){u.push(T,C);return}let ve=Math.atan2(n-i,s-t);if(L=Math.abs(ve-Math.atan2(i-e,t-r)),pe=Math.abs(Math.atan2(a-n,o-s)-ve),L>=h&&(L=2*h-L),pe>=h&&(pe=2*h-pe),L+pe<Hu){u.push(T,C);return}if(Ao!==0){if(L>Ao){u.push(t,i);return}if(pe>Ao){u.push(s,n);return}}}}else if(M>Vm){if(M*M<=l*(A*A+P*P)){if(Hu<Uv){u.push(T,C);return}if(L=Math.abs(Math.atan2(n-i,s-t)-Math.atan2(i-e,t-r)),L>=h&&(L=2*h-L),L<Hu){u.push(t,i),u.push(s,n);return}if(Ao!==0&&L>Ao){u.push(t,i);return}}}else if(k>Vm){if(k*k<=l*(A*A+P*P)){if(Hu<Uv){u.push(T,C);return}if(L=Math.abs(Math.atan2(a-n,o-s)-Math.atan2(n-i,s-t)),L>=h&&(L=2*h-L),L<Hu){u.push(t,i),u.push(s,n);return}if(Ao!==0&&L>Ao){u.push(s,n);return}}}else if(A=T-(r+o)/2,P=C-(e+a)/2,A*A+P*P<=l){u.push(T,C);return}}Lv(r,e,d,p,y,S,T,C,u,l,c+1),Lv(T,C,E,F,_,g,o,a,u,l,c+1);}var sk,Vm,nk,Uv,Hu,Ao,zm=f(()=>{fh();sk=8,Vm=11920929e-14,nk=1,Uv=.01,Hu=0,Ao=0;});function Wm(r,e,t,i,s,n,o,a){let l=Math.min(.99,Math.max(0,a??rn.defaultOptions.bezierSmoothness)),c=(lk-l)/1;return c*=c,hk(e,t,i,s,n,o,r,c),r}function hk(r,e,t,i,s,n,o,a){Nv(o,r,e,t,i,s,n,a,0),o.push(s,n);}function Nv(r,e,t,i,s,n,o,a,u){if(u>ak)return;let l=Math.PI,c=(e+i)/2,h=(t+s)/2,d=(i+n)/2,p=(s+o)/2,m=(c+d)/2,b=(h+p)/2,_=n-e,g=o-t,y=Math.abs((i-n)*g-(s-o)*_);if(y>uk){if(y*y<=a*(_*_+g*g)){if(AP<ck){r.push(m,b);return}let S=Math.abs(Math.atan2(o-s,n-i)-Math.atan2(s-t,i-e));if(S>=l&&(S=2*l-S),S<AP){r.push(m,b);return}}}else if(_=m-(e+n)/2,g=b-(t+o)/2,_*_+g*g<=a){r.push(m,b);return}Nv(r,e,t,c,h,m,b,a,u+1),Nv(r,m,b,d,p,n,o,a,u+1);}var ak,uk,lk,ck,AP,Hv=f(()=>{fh();ak=8,uk=11920929e-14,lk=1,ck=.01,AP=0;});function zu(r,e,t,i,s,n,o,a){let u=Math.abs(s-n);(!o&&s>n||o&&n>s)&&(u=2*Math.PI-u),a||(a=Math.max(6,Math.floor(6*Math.pow(i,1/3)*(u/Math.PI)))),a=Math.max(a,3);let l=u/a,c=s;l*=o?-1:1;for(let h=0;h<a+1;h++){let d=Math.cos(c),p=Math.sin(c),m=e+d*i,b=t+p*i;r.push(m,b),c+=l;}}var Xm=f(()=>{});function Ym(r,e,t,i,s,n){let o=r[r.length-2],u=r[r.length-1]-t,l=o-e,c=s-t,h=i-e,d=Math.abs(u*h-l*c);if(d<1e-8||n===0){(r[r.length-2]!==e||r[r.length-1]!==t)&&r.push(e,t);return}let p=u*u+l*l,m=c*c+h*h,b=u*c+l*h,_=n*Math.sqrt(p)/d,g=n*Math.sqrt(m)/d,y=_*b/p,S=g*b/m,E=_*h+g*l,F=_*c+g*u,T=l*(g+y),C=u*(g+y),A=h*(_+S),P=c*(_+S),M=Math.atan2(C-F,T-E),k=Math.atan2(P-F,A-E);zu(r,E+e,F+t,n,M,k,l*c>h*u);}var Vv=f(()=>{Xm();});function dk(r,e){let t=e===-1.5707963267948966?-0.551915024494:1.3333333333333333*Math.tan(e/4),i=e===1.5707963267948966?.551915024494:t,s=Math.cos(r),n=Math.sin(r),o=Math.cos(r+e),a=Math.sin(r+e);return [{x:s-n*i,y:n+s*i},{x:o+a*i,y:a-o*i},{x:o,y:a}]}function jm(r,e,t,i,s,n,o,a=0,u=0,l=0){if(n===0||o===0)return;let c=Math.sin(a*bh/360),h=Math.cos(a*bh/360),d=h*(e-i)/2+c*(t-s)/2,p=-c*(e-i)/2+h*(t-s)/2;if(d===0&&p===0)return;n=Math.abs(n),o=Math.abs(o);let m=Math.pow(d,2)/Math.pow(n,2)+Math.pow(p,2)/Math.pow(o,2);m>1&&(n*=Math.sqrt(m),o*=Math.sqrt(m)),fk(e,t,i,s,n,o,u,l,c,h,d,p,zv);let{ang1:b,ang2:_}=zv,{centerX:g,centerY:y}=zv,S=Math.abs(_)/(bh/4);Math.abs(1-S)<1e-7&&(S=1);let E=Math.max(Math.ceil(S),1);_/=E;let F=r[r.length-2],T=r[r.length-1],C={x:0,y:0};for(let A=0;A<E;A++){let P=dk(b,_),{x:M,y:k}=Wv(P[0],n,o,h,c,g,y,C),{x:L,y:pe}=Wv(P[1],n,o,h,c,g,y,C),{x:ve,y:Or}=Wv(P[2],n,o,h,c,g,y,C);Vu(r,F,T,M,k,L,pe,ve,Or),F=ve,T=Or,b+=_;}}var bh,zv,Wv,PP,fk,Xv=f(()=>{zm();bh=Math.PI*2,zv={centerX:0,centerY:0,ang1:0,ang2:0},Wv=({x:r,y:e},t,i,s,n,o,a,u)=>{r*=t,e*=i;let l=s*r-n*e,c=n*r+s*e;return u.x=l+o,u.y=c+a,u};PP=(r,e,t,i)=>{let s=r*i-e*t<0?-1:1,n=r*t+e*i;return n>1&&(n=1),n<-1&&(n=-1),s*Math.acos(n)},fk=(r,e,t,i,s,n,o,a,u,l,c,h,d)=>{let p=Math.pow(s,2),m=Math.pow(n,2),b=Math.pow(c,2),_=Math.pow(h,2),g=p*m-p*_-m*b;g<0&&(g=0),g/=p*_+m*b,g=Math.sqrt(g)*(o===a?-1:1);let y=g*s/n*h,S=g*-n/s*c,E=l*y-u*S+(r+t)/2,F=u*y+l*S+(e+i)/2,T=(c-y)/s,C=(h-S)/n,A=(-c-y)/s,P=(-h-S)/n,M=PP(1,0,T,C),k=PP(T,C,A,P);a===0&&k>0&&(k-=bh),a===1&&k<0&&(k+=bh),d.centerX=E,d.centerY=F,d.ang1=M,d.ang2=k;};});function $m(r,e,t){let i=(o,a)=>{let u=a.x-o.x,l=a.y-o.y,c=Math.sqrt(u*u+l*l),h=u/c,d=l/c;return {len:c,nx:h,ny:d}},s=(o,a)=>{o===0?r.moveTo(a.x,a.y):r.lineTo(a.x,a.y);},n=e[e.length-1];for(let o=0;o<e.length;o++){let a=e[o%e.length],u=a.radius??t;if(u<=0){s(o,a),n=a;continue}let l=e[(o+1)%e.length],c=i(a,n),h=i(a,l);if(c.len<1e-4||h.len<1e-4){s(o,a),n=a;continue}let d=Math.asin(c.nx*h.ny-c.ny*h.nx),p=1,m=false;c.nx*h.nx-c.ny*-h.ny<0?d<0?d=Math.PI+d:(d=Math.PI-d,p=-1,m=true):d>0&&(p=-1,m=true);let b=d/2,_,g=Math.abs(Math.cos(b)*u/Math.sin(b));g>Math.min(c.len/2,h.len/2)?(g=Math.min(c.len/2,h.len/2),_=Math.abs(g*Math.sin(b)/Math.cos(b))):_=u;let y=a.x+h.nx*g+-h.ny*_*p,S=a.y+h.ny*g+h.nx*_*p,E=Math.atan2(c.ny,c.nx)+Math.PI/2*p,F=Math.atan2(h.ny,h.nx)-Math.PI/2*p;o===0&&r.moveTo(y+Math.cos(E)*_,S+Math.sin(E)*_),r.arc(y,S,_,E,F,m),n=a;}}function qm(r,e,t,i){let s=(a,u)=>Math.sqrt((a.x-u.x)**2+(a.y-u.y)**2),n=(a,u,l)=>({x:a.x+(u.x-a.x)*l,y:a.y+(u.y-a.y)*l}),o=e.length;for(let a=0;a<o;a++){let u=e[(a+1)%o],l=u.radius??t;if(l<=0){a===0?r.moveTo(u.x,u.y):r.lineTo(u.x,u.y);continue}let c=e[a],h=e[(a+2)%o],d=s(c,u),p;if(d<1e-4)p=u;else {let _=Math.min(d/2,l);p=n(u,c,_/d);}let m=s(h,u),b;if(m<1e-4)b=u;else {let _=Math.min(m/2,l);b=n(u,h,_/m);}a===0?r.moveTo(p.x,p.y):r.lineTo(p.x,p.y),r.quadraticCurveTo(u.x,u.y,b.x,b.y,i);}}var Yv=f(()=>{});var pk,Wu,jv=f(()=>{kv();Ov();Fv();ct();Gv();Lt();zm();Hv();Xm();Vv();Xv();Yv();pk=new exports.Rectangle,Wu=class{constructor(e){this.shapePrimitives=[],this._currentPoly=null,this._bounds=new Ae,this._graphicsPath2D=e,this.signed=e.checkForHoles;}moveTo(e,t){return this.startPoly(e,t),this}lineTo(e,t){this._ensurePoly();let i=this._currentPoly.points,s=i[i.length-2],n=i[i.length-1];return (s!==e||n!==t)&&i.push(e,t),this}arc(e,t,i,s,n,o){this._ensurePoly(false);let a=this._currentPoly.points;return zu(a,e,t,i,s,n,o),this}arcTo(e,t,i,s,n){this._ensurePoly();let o=this._currentPoly.points;return Ym(o,e,t,i,s,n),this}arcToSvg(e,t,i,s,n,o,a){let u=this._currentPoly.points;return jm(u,this._currentPoly.lastX,this._currentPoly.lastY,o,a,e,t,i,s,n),this}bezierCurveTo(e,t,i,s,n,o,a){this._ensurePoly();let u=this._currentPoly;return Vu(this._currentPoly.points,u.lastX,u.lastY,e,t,i,s,n,o,a),this}quadraticCurveTo(e,t,i,s,n){this._ensurePoly();let o=this._currentPoly;return Wm(this._currentPoly.points,o.lastX,o.lastY,e,t,i,s,n),this}closePath(){return this.endPoly(true),this}addPath(e,t){this.endPoly(),t&&!t.isIdentity()&&(e=e.clone(true),e.transform(t));let i=this.shapePrimitives,s=i.length;for(let n=0;n<e.instructions.length;n++){let o=e.instructions[n];this[o.action](...o.data);}if(e.checkForHoles&&i.length-s>1){let n=null;for(let o=s;o<i.length;o++){let a=i[o];if(a.shape.type==="polygon"){let u=a.shape,l=n?.shape;l&&l.containsPolygon(u)?(n.holes||(n.holes=[]),n.holes.push(a),i.copyWithin(o,o+1),i.length--,o--):n=a;}}}return this}finish(e=false){this.endPoly(e);}rect(e,t,i,s,n){return this.drawShape(new exports.Rectangle(e,t,i,s),n),this}circle(e,t,i,s){return this.drawShape(new Uu(e,t,i),s),this}poly(e,t,i){let s=new on(e);return s.closePath=t,this.drawShape(s,i),this}regularPoly(e,t,i,s,n=0,o){s=Math.max(s|0,3);let a=-1*Math.PI/2+n,u=Math.PI*2/s,l=[];for(let c=0;c<s;c++){let h=a-c*u;l.push(e+i*Math.cos(h),t+i*Math.sin(h));}return this.poly(l,true,o),this}roundPoly(e,t,i,s,n,o=0,a){if(s=Math.max(s|0,3),n<=0)return this.regularPoly(e,t,i,s,o);let u=i*Math.sin(Math.PI/s)-.001;n=Math.min(n,u);let l=-1*Math.PI/2+o,c=Math.PI*2/s,h=(s-2)*Math.PI/s/2;for(let d=0;d<s;d++){let p=d*c+l,m=e+i*Math.cos(p),b=t+i*Math.sin(p),_=p+Math.PI+h,g=p-Math.PI-h,y=m+n*Math.cos(_),S=b+n*Math.sin(_),E=m+n*Math.cos(g),F=b+n*Math.sin(g);d===0?this.moveTo(y,S):this.lineTo(y,S),this.quadraticCurveTo(m,b,E,F,a);}return this.closePath()}roundShape(e,t,i=false,s){return e.length<3?this:(i?qm(this,e,t,s):$m(this,e,t),this.closePath())}filletRect(e,t,i,s,n){if(n===0)return this.rect(e,t,i,s);let o=Math.min(i,s)/2,a=Math.min(o,Math.max(-o,n)),u=e+i,l=t+s,c=a<0?-a:0,h=Math.abs(a);return this.moveTo(e,t+h).arcTo(e+c,t+c,e+h,t,h).lineTo(u-h,t).arcTo(u-c,t+c,u,t+h,h).lineTo(u,l-h).arcTo(u-c,l-c,e+i-h,l,h).lineTo(e+h,l).arcTo(e+c,l-c,e,l-h,h).closePath()}chamferRect(e,t,i,s,n,o){if(n<=0)return this.rect(e,t,i,s);let a=Math.min(n,Math.min(i,s)/2),u=e+i,l=t+s,c=[e+a,t,u-a,t,u,t+a,u,l-a,u-a,l,e+a,l,e,l-a,e,t+a];for(let h=c.length-1;h>=2;h-=2)c[h]===c[h-2]&&c[h-1]===c[h-3]&&c.splice(h-1,2);return this.poly(c,true,o)}ellipse(e,t,i,s,n){return this.drawShape(new Lu(e,t,i,s),n),this}roundRect(e,t,i,s,n,o){return this.drawShape(new Nu(e,t,i,s,n),o),this}drawShape(e,t){return this.endPoly(),this.shapePrimitives.push({shape:e,transform:t}),this}startPoly(e,t){let i=this._currentPoly;return i&&this.endPoly(),i=new on,i.points.push(e,t),this._currentPoly=i,this}endPoly(e=false){let t=this._currentPoly;return t&&t.points.length>2&&(t.closePath=e,this.shapePrimitives.push({shape:t})),this._currentPoly=null,this}_ensurePoly(e=true){if(!this._currentPoly&&(this._currentPoly=new on,e)){let t=this.shapePrimitives[this.shapePrimitives.length-1];if(t){let i=t.shape.x,s=t.shape.y;if(t.transform&&!t.transform.isIdentity()){let n=t.transform,o=i;i=n.a*i+n.c*s+n.tx,s=n.b*o+n.d*s+n.ty;}this._currentPoly.points.push(i,s);}else this._currentPoly.points.push(0,0);}}buildPath(){let e=this._graphicsPath2D;this.shapePrimitives.length=0,this._currentPoly=null;for(let t=0;t<e.instructions.length;t++){let i=e.instructions[t];this[i.action](...i.data);}this.finish();}get bounds(){let e=this._bounds;e.clear();let t=this.shapePrimitives;for(let i=0;i<t.length;i++){let s=t[i],n=s.shape.getBounds(pk);s.transform?e.addRect(n,s.transform):e.addRect(n);}return e}};});function yh(r,e){return r?r.prepend(e):e.clone()}var Bi,Km=f(()=>{cr();Et();Be();Dv();jv();Bi=class r{constructor(e,t=false){this.instructions=[],this.uid=ce("graphicsPath"),this._dirty=true,this.checkForHoles=t,typeof e=="string"?Lm(e,this):this.instructions=e?.slice()??[];}get shapePath(){return this._shapePath||(this._shapePath=new Wu(this)),this._dirty&&(this._dirty=false,this._shapePath.buildPath()),this._shapePath}addPath(e,t){return e=e.clone(),this.instructions.push({action:"addPath",data:[e,t]}),this._dirty=true,this}arc(...e){return this.instructions.push({action:"arc",data:e}),this._dirty=true,this}arcTo(...e){return this.instructions.push({action:"arcTo",data:e}),this._dirty=true,this}arcToSvg(...e){return this.instructions.push({action:"arcToSvg",data:e}),this._dirty=true,this}bezierCurveTo(...e){return this.instructions.push({action:"bezierCurveTo",data:e}),this._dirty=true,this}bezierCurveToShort(e,t,i,s,n){let o=this.instructions[this.instructions.length-1],a=this.getLastPoint(me.shared),u=0,l=0;if(!o||o.action!=="bezierCurveTo")u=a.x,l=a.y;else {u=o.data[2],l=o.data[3];let c=a.x,h=a.y;u=c+(c-u),l=h+(h-l);}return this.instructions.push({action:"bezierCurveTo",data:[u,l,e,t,i,s,n]}),this._dirty=true,this}closePath(){return this.instructions.push({action:"closePath",data:[]}),this._dirty=true,this}ellipse(...e){return this.instructions.push({action:"ellipse",data:e}),this._dirty=true,this}lineTo(...e){return this.instructions.push({action:"lineTo",data:e}),this._dirty=true,this}moveTo(...e){return this.instructions.push({action:"moveTo",data:e}),this}quadraticCurveTo(...e){return this.instructions.push({action:"quadraticCurveTo",data:e}),this._dirty=true,this}quadraticCurveToShort(e,t,i){let s=this.instructions[this.instructions.length-1],n=this.getLastPoint(me.shared),o=0,a=0;if(!s||s.action!=="quadraticCurveTo")o=n.x,a=n.y;else {o=s.data[0],a=s.data[1];let u=n.x,l=n.y;o=u+(u-o),a=l+(l-a);}return this.instructions.push({action:"quadraticCurveTo",data:[o,a,e,t,i]}),this._dirty=true,this}rect(e,t,i,s,n){return this.instructions.push({action:"rect",data:[e,t,i,s,n]}),this._dirty=true,this}circle(e,t,i,s){return this.instructions.push({action:"circle",data:[e,t,i,s]}),this._dirty=true,this}roundRect(...e){return this.instructions.push({action:"roundRect",data:e}),this._dirty=true,this}poly(...e){return this.instructions.push({action:"poly",data:e}),this._dirty=true,this}regularPoly(...e){return this.instructions.push({action:"regularPoly",data:e}),this._dirty=true,this}roundPoly(...e){return this.instructions.push({action:"roundPoly",data:e}),this._dirty=true,this}roundShape(...e){return this.instructions.push({action:"roundShape",data:e}),this._dirty=true,this}filletRect(...e){return this.instructions.push({action:"filletRect",data:e}),this._dirty=true,this}chamferRect(...e){return this.instructions.push({action:"chamferRect",data:e}),this._dirty=true,this}star(e,t,i,s,n,o,a){n||(n=s/2);let u=-1*Math.PI/2+o,l=i*2,c=Math.PI*2/l,h=[];for(let d=0;d<l;d++){let p=d%2?n:s,m=d*c+u;h.push(e+p*Math.cos(m),t+p*Math.sin(m));}return this.poly(h,true,a),this}clone(e=false){let t=new r;if(t.checkForHoles=this.checkForHoles,!e)t.instructions=this.instructions.slice();else for(let i=0;i<this.instructions.length;i++){let s=this.instructions[i];t.instructions.push({action:s.action,data:s.data.slice()});}return t}clear(){return this.instructions.length=0,this._dirty=true,this}transform(e){if(e.isIdentity())return this;let t=e.a,i=e.b,s=e.c,n=e.d,o=e.tx,a=e.ty,u=0,l=0,c=0,h=0,d=0,p=0,m=0,b=0;for(let _=0;_<this.instructions.length;_++){let g=this.instructions[_],y=g.data;switch(g.action){case "moveTo":case "lineTo":u=y[0],l=y[1],y[0]=t*u+s*l+o,y[1]=i*u+n*l+a;break;case "bezierCurveTo":c=y[0],h=y[1],d=y[2],p=y[3],u=y[4],l=y[5],y[0]=t*c+s*h+o,y[1]=i*c+n*h+a,y[2]=t*d+s*p+o,y[3]=i*d+n*p+a,y[4]=t*u+s*l+o,y[5]=i*u+n*l+a;break;case "quadraticCurveTo":c=y[0],h=y[1],u=y[2],l=y[3],y[0]=t*c+s*h+o,y[1]=i*c+n*h+a,y[2]=t*u+s*l+o,y[3]=i*u+n*l+a;break;case "arcToSvg":u=y[5],l=y[6],m=y[0],b=y[1],y[0]=t*m+s*b,y[1]=i*m+n*b,y[5]=t*u+s*l+o,y[6]=i*u+n*l+a;break;case "circle":y[4]=yh(y[3],e);break;case "rect":y[4]=yh(y[4],e);break;case "ellipse":y[8]=yh(y[8],e);break;case "roundRect":y[5]=yh(y[5],e);break;case "addPath":y[0].transform(e);break;case "poly":y[2]=yh(y[2],e);break;default:N("unknown transform action",g.action);break}}return this._dirty=true,this}get bounds(){return this.shapePath.bounds}getLastPoint(e){let t=this.instructions.length-1,i=this.instructions[t];if(!i)return e.x=0,e.y=0,e;for(;i.action==="closePath";){if(t--,t<0)return e.x=0,e.y=0,e;i=this.instructions[t];}switch(i.action){case "moveTo":case "lineTo":e.x=i.data[0],e.y=i.data[1];break;case "quadraticCurveTo":e.x=i.data[2],e.y=i.data[3];break;case "bezierCurveTo":e.x=i.data[4],e.y=i.data[5];break;case "arc":case "arcToSvg":e.x=i.data[5],e.y=i.data[6];break;case "addPath":i.data[0].getLastPoint(e);break}return e}};});function Ke(r,e,t){let i=r.getAttribute(e);return i?Number(i):t}var Zm=f(()=>{});function Qm(r,e){let t=r.querySelectorAll("defs");for(let i=0;i<t.length;i++){let s=t[i];for(let n=0;n<s.children.length;n++){let o=s.children[n];switch(o.nodeName.toLowerCase()){case "lineargradient":e.defs[o.id]=mk(o);break;case "radialgradient":e.defs[o.id]=gk();break;}}}}function mk(r){let e=Ke(r,"x1",0),t=Ke(r,"y1",0),i=Ke(r,"x2",1),s=Ke(r,"y2",0),n=r.getAttribute("gradientUnits")||"objectBoundingBox",o=new qt(e,t,i,s,n==="objectBoundingBox"?"local":"global");for(let a=0;a<r.children.length;a++){let u=r.children[a],l=Ke(u,"offset",0),c=te.shared.setValue(u.getAttribute("stop-color")).toNumber();o.addColorStop(l,c);}return o}function gk(r){return N("[SVG Parser] Radial gradients are not yet supported"),new qt(0,0,1,0)}var $v=f(()=>{gt();Be();_o();Zm();});function vh(r){let e=r.match(/url\s*\(\s*['"]?\s*#([^'"\s)]+)\s*['"]?\s*\)/i);return e?e[1]:""}var qv=f(()=>{});function Th(r,e){let t=r.getAttribute("style"),i={},s={},n={strokeStyle:i,fillStyle:s,useFill:false,useStroke:false};for(let o in Jm){let a=r.getAttribute(o);a&&wP(e,n,o,a.trim());}if(t){let o=t.split(";");for(let a=0;a<o.length;a++){let u=o[a].trim(),[l,c]=u.split(":");Jm[l]&&wP(e,n,l,c.trim());}}return {strokeStyle:n.useStroke?i:null,fillStyle:n.useFill?s:null,useFill:n.useFill,useStroke:n.useStroke}}function wP(r,e,t,i){switch(t){case "stroke":if(i!=="none"){if(i.startsWith("url(")){let s=vh(i);e.strokeStyle.fill=r.defs[s];}else e.strokeStyle.color=te.shared.setValue(i).toNumber();e.useStroke=true;}break;case "stroke-width":e.strokeStyle.width=Number(i);break;case "fill":if(i!=="none"){if(i.startsWith("url(")){let s=vh(i);e.fillStyle.fill=r.defs[s];}else e.fillStyle.color=te.shared.setValue(i).toNumber();e.useFill=true;}break;case "fill-opacity":e.fillStyle.alpha=Number(i);break;case "stroke-opacity":e.strokeStyle.alpha=Number(i);break;case "opacity":e.fillStyle.alpha=Number(i),e.strokeStyle.alpha=Number(i);break}}var Jm,Kv=f(()=>{gt();qv();Jm={fill:{type:"paint",default:0},"fill-opacity":{type:"number",default:1},stroke:{type:"paint",default:0},"stroke-width":{type:"number",default:1},"stroke-opacity":{type:"number",default:1},"stroke-linecap":{type:"string",default:"butt"},"stroke-linejoin":{type:"string",default:"miter"},"stroke-miterlimit":{type:"number",default:10},"stroke-dasharray":{type:"string",default:"none"},"stroke-dashoffset":{type:"number",default:0},opacity:{type:"number",default:1}};});function eg(r,e){if(typeof r=="string"){let o=document.createElement("div");o.innerHTML=r.trim(),r=o.querySelector("svg");}let t={context:e,defs:{},path:new Bi};Qm(r,t);let i=r.children,{fillStyle:s,strokeStyle:n}=Th(r,t);for(let o=0;o<i.length;o++){let a=i[o];a.nodeName.toLowerCase()!=="defs"&&BP(a,t,s,n);}return e}function BP(r,e,t,i){let s=r.children,{fillStyle:n,strokeStyle:o}=Th(r,e);n&&t?t={...t,...n}:n&&(t=n),o&&i?i={...i,...o}:o&&(i=o);let a=!t&&!i;a&&(t={color:0});let u,l,c,h,d,p,m,b,_,g,y,S,E,F,T,C,A;switch(r.nodeName.toLowerCase()){case "path":F=r.getAttribute("d"),r.getAttribute("fill-rule")==="evenodd"&&N("SVG Evenodd fill rule not supported, your svg may render incorrectly"),T=new Bi(F,true),e.context.path(T),t&&e.context.fill(t),i&&e.context.stroke(i);break;case "circle":m=Ke(r,"cx",0),b=Ke(r,"cy",0),_=Ke(r,"r",0),e.context.ellipse(m,b,_,_),t&&e.context.fill(t),i&&e.context.stroke(i);break;case "rect":u=Ke(r,"x",0),l=Ke(r,"y",0),C=Ke(r,"width",0),A=Ke(r,"height",0),g=Ke(r,"rx",0),y=Ke(r,"ry",0),g||y?e.context.roundRect(u,l,C,A,g||y):e.context.rect(u,l,C,A),t&&e.context.fill(t),i&&e.context.stroke(i);break;case "ellipse":m=Ke(r,"cx",0),b=Ke(r,"cy",0),g=Ke(r,"rx",0),y=Ke(r,"ry",0),e.context.beginPath(),e.context.ellipse(m,b,g,y),t&&e.context.fill(t),i&&e.context.stroke(i);break;case "line":c=Ke(r,"x1",0),h=Ke(r,"y1",0),d=Ke(r,"x2",0),p=Ke(r,"y2",0),e.context.beginPath(),e.context.moveTo(c,h),e.context.lineTo(d,p),i&&e.context.stroke(i);break;case "polygon":E=r.getAttribute("points"),S=E.match(/\d+/g).map(P=>parseInt(P,10)),e.context.poly(S,true),t&&e.context.fill(t),i&&e.context.stroke(i);break;case "polyline":E=r.getAttribute("points"),S=E.match(/\d+/g).map(P=>parseInt(P,10)),e.context.poly(S,false),i&&e.context.stroke(i);break;case "g":case "svg":break;default:{N(`[SVG parser] <${r.nodeName}> elements unsupported`);break}}a&&(t=null);for(let P=0;P<s.length;P++)BP(s[P],e,t,i);}var Zv=f(()=>{Be();Km();$v();Zm();Kv();});function xk(r){return te.isColorLike(r)}function RP(r){return r instanceof ui}function MP(r){return r instanceof qt}function _k(r){return r instanceof exports.Texture}function bk(r,e,t){let i=te.shared.setValue(e??0);return r.color=i.toNumber(),r.alpha=i.alpha===1?t.alpha:i.alpha,r.texture=exports.Texture.WHITE,{...t,...r}}function yk(r,e,t){return r.texture=e,{...t,...r}}function IP(r,e,t){return r.fill=e,r.color=16777215,r.texture=e.texture,r.matrix=e.transform,{...t,...r}}function DP(r,e,t){return e.buildGradient(),r.fill=e,r.color=16777215,r.texture=e.texture,r.matrix=e.transform,r.textureSpace=e.textureSpace,{...t,...r}}function vk(r,e){let t={...e,...r},i=te.shared.setValue(t.color);return t.alpha*=i.alpha,t.color=i.toNumber(),t}function li(r,e){if(r==null)return null;let t={},i=r;return xk(r)?bk(t,r,e):_k(r)?yk(t,r,e):RP(r)?IP(t,r,e):MP(r)?DP(t,r,e):i.fill&&RP(i.fill)?IP(i,i.fill,e):i.fill&&MP(i.fill)?DP(i,i.fill,e):vk(i,e)}function an(r,e){let{width:t,alignment:i,miterLimit:s,cap:n,join:o,pixelLine:a,...u}=e,l=li(r,u);return l?{width:t,alignment:i,miterLimit:s,cap:n,join:o,pixelLine:a,...l}:null}var tg=f(()=>{gt();ye();_o();_h();});var Tk,kP,Qv,dt,Po=f(()=>{Ut();gt();Te();cr();ye();Et();Pe();Lt();Km();Zv();tg();Tk=new me,kP=new G,Qv=class Ri extends _e{constructor(){super(...arguments),this.uid=ce("graphicsContext"),this.dirty=true,this.batchMode="auto",this.instructions=[],this._activePath=new Bi,this._transform=new G,this._fillStyle={...Ri.defaultFillStyle},this._strokeStyle={...Ri.defaultStrokeStyle},this._stateStack=[],this._tick=0,this._bounds=new Ae,this._boundsDirty=true;}clone(){let e=new Ri;return e.batchMode=this.batchMode,e.instructions=this.instructions.slice(),e._activePath=this._activePath.clone(),e._transform=this._transform.clone(),e._fillStyle={...this._fillStyle},e._strokeStyle={...this._strokeStyle},e._stateStack=this._stateStack.slice(),e._bounds=this._bounds.clone(),e._boundsDirty=true,e}get fillStyle(){return this._fillStyle}set fillStyle(e){this._fillStyle=li(e,Ri.defaultFillStyle);}get strokeStyle(){return this._strokeStyle}set strokeStyle(e){this._strokeStyle=an(e,Ri.defaultStrokeStyle);}setFillStyle(e){return this._fillStyle=li(e,Ri.defaultFillStyle),this}setStrokeStyle(e){return this._strokeStyle=li(e,Ri.defaultStrokeStyle),this}texture(e,t,i,s,n,o){return this.instructions.push({action:"texture",data:{image:e,dx:i||0,dy:s||0,dw:n||e.frame.width,dh:o||e.frame.height,transform:this._transform.clone(),alpha:this._fillStyle.alpha,style:t?te.shared.setValue(t).toNumber():16777215}}),this.onUpdate(),this}beginPath(){return this._activePath=new Bi,this}fill(e,t){let i,s=this.instructions[this.instructions.length-1];return this._tick===0&&s&&s.action==="stroke"?i=s.data.path:i=this._activePath.clone(),i?(e!=null&&(t!==void 0&&typeof e=="number"&&(U(Y,"GraphicsContext.fill(color, alpha) is deprecated, use GraphicsContext.fill({ color, alpha }) instead"),e={color:e,alpha:t}),this._fillStyle=li(e,Ri.defaultFillStyle)),this.instructions.push({action:"fill",data:{style:this.fillStyle,path:i}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this}_initNextPathLocation(){let{x:e,y:t}=this._activePath.getLastPoint(me.shared);this._activePath.clear(),this._activePath.moveTo(e,t);}stroke(e){let t,i=this.instructions[this.instructions.length-1];return this._tick===0&&i&&i.action==="fill"?t=i.data.path:t=this._activePath.clone(),t?(e!=null&&(this._strokeStyle=an(e,Ri.defaultStrokeStyle)),this.instructions.push({action:"stroke",data:{style:this.strokeStyle,path:t}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this}cut(){for(let e=0;e<2;e++){let t=this.instructions[this.instructions.length-1-e],i=this._activePath.clone();if(t&&(t.action==="stroke"||t.action==="fill"))if(t.data.hole)t.data.hole.addPath(i);else {t.data.hole=i;break}}return this._initNextPathLocation(),this}arc(e,t,i,s,n,o){this._tick++;let a=this._transform;return this._activePath.arc(a.a*e+a.c*t+a.tx,a.b*e+a.d*t+a.ty,i,s,n,o),this}arcTo(e,t,i,s,n){this._tick++;let o=this._transform;return this._activePath.arcTo(o.a*e+o.c*t+o.tx,o.b*e+o.d*t+o.ty,o.a*i+o.c*s+o.tx,o.b*i+o.d*s+o.ty,n),this}arcToSvg(e,t,i,s,n,o,a){this._tick++;let u=this._transform;return this._activePath.arcToSvg(e,t,i,s,n,u.a*o+u.c*a+u.tx,u.b*o+u.d*a+u.ty),this}bezierCurveTo(e,t,i,s,n,o,a){this._tick++;let u=this._transform;return this._activePath.bezierCurveTo(u.a*e+u.c*t+u.tx,u.b*e+u.d*t+u.ty,u.a*i+u.c*s+u.tx,u.b*i+u.d*s+u.ty,u.a*n+u.c*o+u.tx,u.b*n+u.d*o+u.ty,a),this}closePath(){return this._tick++,this._activePath?.closePath(),this}ellipse(e,t,i,s){return this._tick++,this._activePath.ellipse(e,t,i,s,this._transform.clone()),this}circle(e,t,i){return this._tick++,this._activePath.circle(e,t,i,this._transform.clone()),this}path(e){return this._tick++,this._activePath.addPath(e,this._transform.clone()),this}lineTo(e,t){this._tick++;let i=this._transform;return this._activePath.lineTo(i.a*e+i.c*t+i.tx,i.b*e+i.d*t+i.ty),this}moveTo(e,t){this._tick++;let i=this._transform,s=this._activePath.instructions,n=i.a*e+i.c*t+i.tx,o=i.b*e+i.d*t+i.ty;return s.length===1&&s[0].action==="moveTo"?(s[0].data[0]=n,s[0].data[1]=o,this):(this._activePath.moveTo(n,o),this)}quadraticCurveTo(e,t,i,s,n){this._tick++;let o=this._transform;return this._activePath.quadraticCurveTo(o.a*e+o.c*t+o.tx,o.b*e+o.d*t+o.ty,o.a*i+o.c*s+o.tx,o.b*i+o.d*s+o.ty,n),this}rect(e,t,i,s){return this._tick++,this._activePath.rect(e,t,i,s,this._transform.clone()),this}roundRect(e,t,i,s,n){return this._tick++,this._activePath.roundRect(e,t,i,s,n,this._transform.clone()),this}poly(e,t){return this._tick++,this._activePath.poly(e,t,this._transform.clone()),this}regularPoly(e,t,i,s,n=0,o){return this._tick++,this._activePath.regularPoly(e,t,i,s,n,o),this}roundPoly(e,t,i,s,n,o){return this._tick++,this._activePath.roundPoly(e,t,i,s,n,o),this}roundShape(e,t,i,s){return this._tick++,this._activePath.roundShape(e,t,i,s),this}filletRect(e,t,i,s,n){return this._tick++,this._activePath.filletRect(e,t,i,s,n),this}chamferRect(e,t,i,s,n,o){return this._tick++,this._activePath.chamferRect(e,t,i,s,n,o),this}star(e,t,i,s,n=0,o=0){return this._tick++,this._activePath.star(e,t,i,s,n,o,this._transform.clone()),this}svg(e){return this._tick++,eg(e,this),this}restore(){let e=this._stateStack.pop();return e&&(this._transform=e.transform,this._fillStyle=e.fillStyle,this._strokeStyle=e.strokeStyle),this}save(){return this._stateStack.push({transform:this._transform.clone(),fillStyle:{...this._fillStyle},strokeStyle:{...this._strokeStyle}}),this}getTransform(){return this._transform}resetTransform(){return this._transform.identity(),this}rotate(e){return this._transform.rotate(e),this}scale(e,t=e){return this._transform.scale(e,t),this}setTransform(e,t,i,s,n,o){return e instanceof G?(this._transform.set(e.a,e.b,e.c,e.d,e.tx,e.ty),this):(this._transform.set(e,t,i,s,n,o),this)}transform(e,t,i,s,n,o){return e instanceof G?(this._transform.append(e),this):(kP.set(e,t,i,s,n,o),this._transform.append(kP),this)}translate(e,t=e){return this._transform.translate(e,t),this}clear(){return this._activePath.clear(),this.instructions.length=0,this.resetTransform(),this.onUpdate(),this}onUpdate(){this.dirty||(this.emit("update",this,16),this.dirty=true,this._boundsDirty=true);}get bounds(){if(!this._boundsDirty)return this._bounds;let e=this._bounds;e.clear();for(let t=0;t<this.instructions.length;t++){let i=this.instructions[t],s=i.action;if(s==="fill"){let n=i.data;e.addBounds(n.path.bounds);}else if(s==="texture"){let n=i.data;e.addFrame(n.dx,n.dy,n.dx+n.dw,n.dy+n.dh,n.transform);}if(s==="stroke"){let n=i.data,o=n.style.alignment,a=n.style.width*(1-o),u=n.path.bounds;e.addFrame(u.minX-a,u.minY-a,u.maxX+a,u.maxY+a);}}return e}containsPoint(e){if(!this.bounds.containsPoint(e.x,e.y))return false;let t=this.instructions,i=false;for(let s=0;s<t.length;s++){let n=t[s],o=n.data,a=o.path;if(!n.action||!a)continue;let u=o.style,l=a.shapePath.shapePrimitives;for(let c=0;c<l.length;c++){let h=l[c].shape;if(!u||!h)continue;let d=l[c].transform,p=d?d.applyInverse(e,Tk):e;if(n.action==="fill")i=h.contains(p.x,p.y);else {let b=u;i=h.strokeContains(p.x,p.y,b.width,b.alignment);}let m=o.hole;if(m){let b=m.shapePath?.shapePrimitives;if(b)for(let _=0;_<b.length;_++)b[_].shape.contains(p.x,p.y)&&(i=false);}if(i)return true}}return i}destroy(e=false){if(this._stateStack.length=0,this._transform=null,this.emit("destroy",this),this.removeAllListeners(),typeof e=="boolean"?e:e?.texture){let i=typeof e=="boolean"?e:e?.textureSource;this._fillStyle.texture&&this._fillStyle.texture.destroy(i),this._strokeStyle.texture&&this._strokeStyle.texture.destroy(i);}this._fillStyle=null,this._strokeStyle=null,this.instructions=null,this._activePath=null,this._bounds=null,this._stateStack=null,this.customShader=null,this._transform=null;}};Qv.defaultFillStyle={color:16777215,alpha:1,texture:exports.Texture.WHITE,matrix:null,fill:null,textureSpace:"local"};Qv.defaultStrokeStyle={width:1,color:16777215,alpha:1,alignment:.5,miterLimit:10,cap:"butt",join:"miter",texture:exports.Texture.WHITE,matrix:null,fill:null,textureSpace:"local",pixelLine:false};dt=Qv;});function rg(r){let e=[],t=0;for(let i=0;i<OP.length;i++){let s=`_${OP[i]}`;e[t++]=r[s];}return t=FP(r._fill,e,t),t=Ek(r._stroke,e,t),t=Ck(r.dropShadow,e,t),t=Sk(r.filters,e,t),e.join("-")}function Sk(r,e,t){if(!r)return t;for(let i of r)e[t++]=i.uid;return t}function FP(r,e,t){return r&&(e[t++]=r.color,e[t++]=r.alpha,e[t++]=r.fill?.styleKey),t}function Ek(r,e,t){return r&&(t=FP(r,e,t),e[t++]=r.width,e[t++]=r.alignment,e[t++]=r.cap,e[t++]=r.join,e[t++]=r.miterLimit),t}function Ck(r,e,t){return r&&(e[t++]=r.alpha,e[t++]=r.angle,e[t++]=r.blur,e[t++]=r.distance,e[t++]=te.shared.setValue(r.color).toNumber()),t}var OP,Jv=f(()=>{gt();OP=["align","breakWords","cssOverrides","fontVariant","fontWeight","leading","letterSpacing","lineHeight","padding","textBaseline","trim","whiteSpace","wordWrap","wordWrapWidth","fontFamily","fontStyle","fontSize"];});function Ak(r){let e=r;if(typeof e.dropShadow=="boolean"&&e.dropShadow){let t=Mt.defaultDropShadow;r.dropShadow={alpha:e.dropShadowAlpha??t.alpha,angle:e.dropShadowAngle??t.angle,blur:e.dropShadowBlur??t.blur,color:e.dropShadowColor??t.color,distance:e.dropShadowDistance??t.distance};}if(e.strokeThickness!==void 0){U(Y,"strokeThickness is now a part of stroke");let t=e.stroke,i={};if(te.isColorLike(t))i.color=t;else if(t instanceof qt||t instanceof ui)i.fill=t;else if(Object.hasOwnProperty.call(t,"color")||Object.hasOwnProperty.call(t,"fill"))i=t;else throw new Error("Invalid stroke value.");r.stroke={...i,width:e.strokeThickness};}if(Array.isArray(e.fillGradientStops)){U(Y,"gradient fill is now a fill pattern: `new FillGradient(...)`");let t;r.fontSize==null?r.fontSize=Mt.defaultTextStyle.fontSize:typeof r.fontSize=="string"?t=parseInt(r.fontSize,10):t=r.fontSize;let i=new qt({start:{x:0,y:0},end:{x:0,y:(t||0)*1.7}}),s=e.fillGradientStops.map(n=>te.shared.setValue(n).toNumber());s.forEach((n,o)=>{let a=o/(s.length-1);i.addColorStop(a,n);}),r.fill={fill:i};}}var eT,Mt,un=f(()=>{Ut();gt();Pe();_o();_h();Po();tg();Jv();eT=class Xu extends _e{constructor(e={}){super(),Ak(e);let t={...Xu.defaultTextStyle,...e};for(let i in t){let s=i;this[s]=t[i];}this.update();}get align(){return this._align}set align(e){this._align=e,this.update();}get breakWords(){return this._breakWords}set breakWords(e){this._breakWords=e,this.update();}get dropShadow(){return this._dropShadow}set dropShadow(e){e!==null&&typeof e=="object"?this._dropShadow=this._createProxy({...Xu.defaultDropShadow,...e}):this._dropShadow=e?this._createProxy({...Xu.defaultDropShadow}):null,this.update();}get fontFamily(){return this._fontFamily}set fontFamily(e){this._fontFamily=e,this.update();}get fontSize(){return this._fontSize}set fontSize(e){typeof e=="string"?this._fontSize=parseInt(e,10):this._fontSize=e,this.update();}get fontStyle(){return this._fontStyle}set fontStyle(e){this._fontStyle=e.toLowerCase(),this.update();}get fontVariant(){return this._fontVariant}set fontVariant(e){this._fontVariant=e,this.update();}get fontWeight(){return this._fontWeight}set fontWeight(e){this._fontWeight=e,this.update();}get leading(){return this._leading}set leading(e){this._leading=e,this.update();}get letterSpacing(){return this._letterSpacing}set letterSpacing(e){this._letterSpacing=e,this.update();}get lineHeight(){return this._lineHeight}set lineHeight(e){this._lineHeight=e,this.update();}get padding(){return this._padding}set padding(e){this._padding=e,this.update();}get filters(){return this._filters}set filters(e){this._filters=e,this.update();}get trim(){return this._trim}set trim(e){this._trim=e,this.update();}get textBaseline(){return this._textBaseline}set textBaseline(e){this._textBaseline=e,this.update();}get whiteSpace(){return this._whiteSpace}set whiteSpace(e){this._whiteSpace=e,this.update();}get wordWrap(){return this._wordWrap}set wordWrap(e){this._wordWrap=e,this.update();}get wordWrapWidth(){return this._wordWrapWidth}set wordWrapWidth(e){this._wordWrapWidth=e,this.update();}get fill(){return this._originalFill}set fill(e){e!==this._originalFill&&(this._originalFill=e,this._isFillStyle(e)&&(this._originalFill=this._createProxy({...dt.defaultFillStyle,...e},()=>{this._fill=li({...this._originalFill},dt.defaultFillStyle);})),this._fill=li(e===0?"black":e,dt.defaultFillStyle),this.update());}get stroke(){return this._originalStroke}set stroke(e){e!==this._originalStroke&&(this._originalStroke=e,this._isFillStyle(e)&&(this._originalStroke=this._createProxy({...dt.defaultStrokeStyle,...e},()=>{this._stroke=an({...this._originalStroke},dt.defaultStrokeStyle);})),this._stroke=an(e,dt.defaultStrokeStyle),this.update());}_generateKey(){return this._styleKey=rg(this),this._styleKey}update(){this._styleKey=null,this.emit("update",this);}reset(){let e=Xu.defaultTextStyle;for(let t in e)this[t]=e[t];}get styleKey(){return this._styleKey||this._generateKey()}clone(){return new Xu({align:this.align,breakWords:this.breakWords,dropShadow:this._dropShadow?{...this._dropShadow}:null,fill:this._fill,fontFamily:this.fontFamily,fontSize:this.fontSize,fontStyle:this.fontStyle,fontVariant:this.fontVariant,fontWeight:this.fontWeight,leading:this.leading,letterSpacing:this.letterSpacing,lineHeight:this.lineHeight,padding:this.padding,stroke:this._stroke,textBaseline:this.textBaseline,whiteSpace:this.whiteSpace,wordWrap:this.wordWrap,wordWrapWidth:this.wordWrapWidth,filters:this._filters?[...this._filters]:void 0})}_getFinalPadding(){let e=0;if(this._filters)for(let t=0;t<this._filters.length;t++)e+=this._filters[t].padding;return Math.max(this._padding,e)}destroy(e=false){if(this.removeAllListeners(),typeof e=="boolean"?e:e?.texture){let i=typeof e=="boolean"?e:e?.textureSource;this._fill?.texture&&this._fill.texture.destroy(i),this._originalFill?.texture&&this._originalFill.texture.destroy(i),this._stroke?.texture&&this._stroke.texture.destroy(i),this._originalStroke?.texture&&this._originalStroke.texture.destroy(i);}this._fill=null,this._stroke=null,this.dropShadow=null,this._originalStroke=null,this._originalFill=null;}_createProxy(e,t){return new Proxy(e,{set:(i,s,n)=>(i[s]=n,t?.(s,n),this.update(),true)})}_isFillStyle(e){return (e??null)!==null&&!(te.isColorLike(e)||e instanceof qt||e instanceof ui)}};eT.defaultDropShadow={alpha:1,angle:Math.PI/6,blur:0,color:"black",distance:5};eT.defaultTextStyle={align:"left",breakWords:false,dropShadow:null,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",leading:0,letterSpacing:0,lineHeight:0,padding:0,stroke:null,textBaseline:"alphabetic",trim:false,whiteSpace:"pre",wordWrap:false,wordWrapWidth:100};Mt=eT;});function Yu(r,e,t,i){let s=Pk;s.minX=0,s.minY=0,s.maxX=r.width/i|0,s.maxY=r.height/i|0;let n=Me.getOptimalTexture(s.width,s.height,i,false);return n.source.uploadMethodId="image",n.source.resource=r,n.source.alphaMode="premultiply-alpha-on-upload",n.frame.width=e/i,n.frame.height=t/i,n.source.emit("update",n.source),n.updateUvs(),n}var Pk,ig=f(()=>{ri();Lt();Pk=new Ae;});var Sh,sr,wo=f(()=>{Ge();uu();Sh=class{constructor(e){this._canvasPool=Object.create(null),this.canvasOptions=e||{},this.enableFullScreen=false;}_createCanvasAndContext(e,t){let i=j.get().createCanvas();i.width=e,i.height=t;let s=i.getContext("2d");return {canvas:i,context:s}}getOptimalCanvasAndContext(e,t,i=1){e=Math.ceil(e*i-1e-6),t=Math.ceil(t*i-1e-6),e=ti(e),t=ti(t);let s=(e<<17)+(t<<1);this._canvasPool[s]||(this._canvasPool[s]=[]);let n=this._canvasPool[s].pop();return n||(n=this._createCanvasAndContext(e,t)),n}returnCanvasAndContext(e){let t=e.canvas,{width:i,height:s}=t,n=(i<<17)+(s<<1);e.context.clearRect(0,0,i,s),this._canvasPool[n].push(e);}clear(){this._canvasPool={};}},sr=new Sh;});function wk(r,e){Bo||(Bo=j.get().createCanvas(256,128),cs=Bo.getContext("2d",{willReadFrequently:true}),cs.globalCompositeOperation="copy",cs.globalAlpha=1),(Bo.width<r||Bo.height<e)&&(Bo.width=ti(r),Bo.height=ti(e));}function GP(r,e,t){for(let i=0,s=4*t*e;i<e;++i,s+=4)if(r[s+3]!==0)return false;return true}function UP(r,e,t,i,s){let n=4*e;for(let o=i,a=i*n+4*t;o<=s;++o,a+=n)if(r[a+3]!==0)return false;return true}function sg(...r){let e=r[0];e.canvas||(e={canvas:r[0],resolution:r[1]});let{canvas:t}=e,i=Math.min(e.resolution??1,1),s=e.width??t.width,n=e.height??t.height,o=e.output;if(wk(s,n),!cs)throw new TypeError("Failed to get canvas 2D context");cs.drawImage(t,0,0,s,n,0,0,s*i,n*i);let u=cs.getImageData(0,0,s,n).data,l=0,c=0,h=s-1,d=n-1;for(;c<n&&GP(u,s,c);)++c;if(c===n)return exports.Rectangle.EMPTY;for(;GP(u,s,d);)--d;for(;UP(u,s,l,c,d);)++l;for(;UP(u,s,h,c,d);)--h;return ++h,++d,cs.globalCompositeOperation="source-over",cs.strokeRect(l,c,h-l,d-c),cs.globalCompositeOperation="copy",o??(o=new exports.Rectangle),o.set(l/i,c/i,(h-l)/i,(d-c)/i),o}var Bo,cs,tT=f(()=>{Ge();uu();ct();Bo=null,cs=null;});function hs(r){let e=typeof r.fontSize=="number"?`${r.fontSize}px`:r.fontSize,t=r.fontFamily;Array.isArray(r.fontFamily)||(t=r.fontFamily.split(","));for(let i=t.length-1;i>=0;i--){let s=t[i].trim();!/([\"\'])[^\'\"]+\1/.test(s)&&!Bk.includes(s)&&(s=`"${s}"`),t[i]=s;}return `${r.fontStyle} ${r.fontVariant} ${r.fontWeight} ${e} ${t.join(",")}`}var Bk,Eh=f(()=>{Bk=["serif","sans-serif","monospace","cursive","fantasy","system-ui"];});var rT,Mi,It,Ro=f(()=>{Ge();Eh();rT={willReadFrequently:true},Mi=class J{static get experimentalLetterSpacingSupported(){let e=J._experimentalLetterSpacingSupported;if(e===void 0){let t=j.get().getCanvasRenderingContext2D().prototype;e=J._experimentalLetterSpacingSupported="letterSpacing"in t||"textLetterSpacing"in t;}return e}constructor(e,t,i,s,n,o,a,u,l){this.text=e,this.style=t,this.width=i,this.height=s,this.lines=n,this.lineWidths=o,this.lineHeight=a,this.maxLineWidth=u,this.fontProperties=l;}static measureText(e=" ",t,i=J._canvas,s=t.wordWrap){let n=hs(t),o=J.measureFont(n);o.fontSize===0&&(o.fontSize=t.fontSize,o.ascent=t.fontSize);let a=J.__context;a.font=n;let l=(s?J._wordWrap(e,t,i):e).split(/(?:\r\n|\r|\n)/),c=new Array(l.length),h=0;for(let g=0;g<l.length;g++){let y=J._measureText(l[g],t.letterSpacing,a);c[g]=y,h=Math.max(h,y);}let d=t._stroke?.width||0,p=h+d;t.dropShadow&&(p+=t.dropShadow.distance);let m=t.lineHeight||o.fontSize,b=Math.max(m,o.fontSize+d)+(l.length-1)*(m+t.leading);return t.dropShadow&&(b+=t.dropShadow.distance),new J(e,t,p,b,l,c,m+t.leading,h,o)}static _measureText(e,t,i){let s=false;J.experimentalLetterSpacingSupported&&(J.experimentalLetterSpacing?(i.letterSpacing=`${t}px`,i.textLetterSpacing=`${t}px`,s=true):(i.letterSpacing="0px",i.textLetterSpacing="0px"));let n=i.measureText(e),o=n.width,a=-n.actualBoundingBoxLeft,l=n.actualBoundingBoxRight-a;if(o>0)if(s)o-=t,l-=t;else {let c=(J.graphemeSegmenter(e).length-1)*t;o+=c,l+=c;}return Math.max(o,l)}static _wordWrap(e,t,i=J._canvas){let s=i.getContext("2d",rT),n=0,o="",a="",u=Object.create(null),{letterSpacing:l,whiteSpace:c}=t,h=J._collapseSpaces(c),d=J._collapseNewlines(c),p=!h,m=t.wordWrapWidth+l,b=J._tokenize(e);for(let _=0;_<b.length;_++){let g=b[_];if(J._isNewline(g)){if(!d){a+=J._addLine(o),p=!h,o="",n=0;continue}g=" ";}if(h){let S=J.isBreakingSpace(g),E=J.isBreakingSpace(o[o.length-1]);if(S&&E)continue}let y=J._getFromCache(g,l,u,s);if(y>m)if(o!==""&&(a+=J._addLine(o),o="",n=0),J.canBreakWords(g,t.breakWords)){let S=J.wordWrapSplit(g);for(let E=0;E<S.length;E++){let F=S[E],T=F,C=1;for(;S[E+C];){let P=S[E+C];if(!J.canBreakChars(T,P,g,E,t.breakWords))F+=P;else break;T=P,C++;}E+=C-1;let A=J._getFromCache(F,l,u,s);A+n>m&&(a+=J._addLine(o),p=false,o="",n=0),o+=F,n+=A;}}else {o.length>0&&(a+=J._addLine(o),o="",n=0);let S=_===b.length-1;a+=J._addLine(g,!S),p=false,o="",n=0;}else y+n>m&&(p=false,a+=J._addLine(o),o="",n=0),(o.length>0||!J.isBreakingSpace(g)||p)&&(o+=g,n+=y);}return a+=J._addLine(o,false),a}static _addLine(e,t=true){return e=J._trimRight(e),e=t?`${e}
374
+ }`;});var ku,Cv=f(()=>{gt();Te();dr();Cr();zr();ye();ts();Tv();Sv();Ev();ku=class extends rt{constructor(){let e=je.from({vertex:Fm,fragment:Om}),t=$e.from({fragment:{source:xh,entryPoint:"mainFragment"},vertex:{source:xh,entryPoint:"mainVertex"}});super({glProgram:e,gpuProgram:t,resources:{uTexture:exports.Texture.WHITE.source,uSampler:new xt({}),uniforms:{uTranslationMatrix:{value:new G,type:"mat3x3<f32>"},uColor:{value:new te(16777215),type:"vec4<f32>"},uRound:{value:1,type:"f32"},uResolution:{value:[0,0],type:"vec2<f32>"}}}});}};});var sn,Gm=f(()=>{Te();ht();xu();Pr();bo();vv();Cv();sn=class{constructor(e,t){this.state=Qe.for2d(),this.localUniforms=new xe({uTranslationMatrix:{value:new G,type:"mat3x3<f32>"},uColor:{value:new Float32Array(4),type:"vec4<f32>"},uRound:{value:1,type:"f32"},uResolution:{value:[0,0],type:"vec2<f32>"}}),this.renderer=e,this.adaptor=t,this.defaultShader=new ku,this.state=Qe.for2d();}validateRenderable(e){return false}addRenderable(e,t){this.renderer.renderPipes.batch.break(t),t.add(e);}getBuffers(e){return e._gpuData[this.renderer.uid]||this._initBuffer(e)}_initBuffer(e){return e._gpuData[this.renderer.uid]=new Du({size:e.particleChildren.length,properties:e._properties}),e._gpuData[this.renderer.uid]}updateRenderable(e){}execute(e){let t=e.particleChildren;if(t.length===0)return;let i=this.renderer,s=this.getBuffers(e);e.texture||(e.texture=t[0].texture);let n=this.state;s.update(t,e._childrenDirty),e._childrenDirty=false,n.blendMode=oi(e.blendMode,e.texture._source);let o=this.localUniforms.uniforms,a=o.uTranslationMatrix;e.worldTransform.copyTo(a),a.prepend(i.globalUniforms.globalUniformData.projectionMatrix),o.uResolution=i.globalUniforms.globalUniformData.resolution,o.uRound=i._roundPixels|e._roundPixels,Wr(e.groupColorAlpha,o.uColor,0),this.adaptor.execute(this,e);}destroy(){this.defaultShader&&(this.defaultShader.destroy(),this.defaultShader=null);}};});var To,Av=f(()=>{B();_v();Gm();To=class extends sn{constructor(e){super(e,new Iu);}};To.extension={type:[x.WebGLPipes],name:"particle"};});var Ou,Pv=f(()=>{Ou=class{execute(e,t){let i=e.renderer,s=t.shader||e.defaultShader;s.groups[0]=i.renderPipes.uniformBatch.getUniformBindGroup(e.localUniforms,true),s.groups[1]=i.texture.getTextureBindGroup(t.texture);let n=e.state,o=e.getBuffers(t);i.encoder.draw({geometry:o.geometry,shader:t.shader||e.defaultShader,state:n,size:t.particleChildren.length*6});}};});var So,wv=f(()=>{B();Pv();Gm();So=class extends sn{constructor(e){super(e,new Ou);}};So.extension={type:[x.WebGPUPipes],name:"particle"};});var Bv=f(()=>{B();Av();wv();V.add(To);V.add(So);});function Eo(r,e){let{texture:t,bounds:i}=r;mu(i,e._anchor,t);let s=e._style._getFinalPadding();i.minX-=s,i.minY-=s,i.maxX-=s,i.maxY-=s;}var Um=f(()=>{Mp();});var Xr,Fu=f(()=>{Xr=class{constructor(){this.batcherName="default",this.topology="triangle-list",this.attributeSize=4,this.indexSize=6,this.packAsQuad=true,this.roundPixels=0,this._attributeStart=0,this._batcher=null,this._batch=null;}get blendMode(){return this.renderable.groupBlendMode}get color(){return this.renderable.groupColorAlpha}reset(){this.renderable=null,this.texture=null,this._batcher=null,this._batch=null,this.bounds=null;}destroy(){}};});var Gu,Rv=f(()=>{Fu();Gu=class extends Xr{constructor(e){super(),this._renderer=e,e.runners.resolutionChange.add(this);}resolutionChange(){let e=this.renderable;e._autoResolution&&e.onViewUpdate();}destroy(){this._renderer.canvasText.returnTexture(this.texture),this._renderer=null;}};});var Co,Mv=f(()=>{B();Um();Rv();Co=class{constructor(e){this._renderer=e;}validateRenderable(e){return e._didTextUpdate}addRenderable(e,t){let i=this._getGpuText(e);e._didTextUpdate&&(this._updateGpuText(e),e._didTextUpdate=false),this._renderer.renderPipes.batch.addToBatch(i,t);}updateRenderable(e){let t=this._getGpuText(e);t._batcher.updateElement(t);}_updateGpuText(e){let t=this._getGpuText(e);t.texture&&this._renderer.canvasText.returnTexture(t.texture),e._resolution=e._autoResolution?this._renderer.resolution:e.resolution,t.texture=t.texture=this._renderer.canvasText.getTexture(e),Eo(t,e);}_getGpuText(e){return e._gpuData[this._renderer.uid]||this.initGpuText(e)}initGpuText(e){let t=new Gu(this._renderer);return t.renderable=e,t.transform=e.groupTransform,t.bounds={minX:0,maxX:1,minY:0,maxY:0},t.roundPixels=this._renderer._roundPixels|e._roundPixels,e._gpuData[this._renderer.uid]=t,t}destroy(){this._renderer=null;}};Co.extension={type:[x.WebGLPipes,x.WebGPUPipes,x.CanvasPipes],name:"text"};});var TP,ui,_h=f(()=>{Te();Et();TP={repeat:{addressModeU:"repeat",addressModeV:"repeat"},"repeat-x":{addressModeU:"repeat",addressModeV:"clamp-to-edge"},"repeat-y":{addressModeU:"clamp-to-edge",addressModeV:"repeat"},"no-repeat":{addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"}},ui=class{constructor(e,t){this.uid=ce("fillPattern"),this.transform=new G,this._styleKey=null,this.texture=e,this.transform.scale(1/e.frame.width,1/e.frame.height),t&&(e.source.style.addressModeU=TP[t].addressModeU,e.source.style.addressModeV=TP[t].addressModeV);}setTransform(e){let t=this.texture;this.transform.copyFrom(e),this.transform.invert(),this.transform.scale(1/t.frame.width,1/t.frame.height),this._styleKey=null;}get styleKey(){return this._styleKey?this._styleKey:(this._styleKey=`fill-pattern-${this.uid}-${this.texture.uid}-${this.transform.toArray().join("-")}`,this._styleKey)}};});var EP=Qr((nz,SP)=>{SP.exports=JD;var Iv={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},QD=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function JD(r){var e=[];return r.replace(QD,function(t,i,s){var n=i.toLowerCase();for(s=tk(s),n=="m"&&s.length>2&&(e.push([i].concat(s.splice(0,2))),n="l",i=i=="m"?"l":"L");;){if(s.length==Iv[n])return s.unshift(i),e.push(s);if(s.length<Iv[n])throw new Error("malformed path data");e.push([i].concat(s.splice(0,Iv[n])));}}),e}var ek=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function tk(r){var e=r.match(ek);return e?e.map(Number):[]}});function Lm(r,e){let t=(0, CP.default)(r),i=[],s=null,n=0,o=0;for(let a=0;a<t.length;a++){let u=t[a],l=u[0],c=u;switch(l){case "M":n=c[1],o=c[2],e.moveTo(n,o);break;case "m":n+=c[1],o+=c[2],e.moveTo(n,o);break;case "H":n=c[1],e.lineTo(n,o);break;case "h":n+=c[1],e.lineTo(n,o);break;case "V":o=c[1],e.lineTo(n,o);break;case "v":o+=c[1],e.lineTo(n,o);break;case "L":n=c[1],o=c[2],e.lineTo(n,o);break;case "l":n+=c[1],o+=c[2],e.lineTo(n,o);break;case "C":n=c[5],o=c[6],e.bezierCurveTo(c[1],c[2],c[3],c[4],n,o);break;case "c":e.bezierCurveTo(n+c[1],o+c[2],n+c[3],o+c[4],n+c[5],o+c[6]),n+=c[5],o+=c[6];break;case "S":n=c[3],o=c[4],e.bezierCurveToShort(c[1],c[2],n,o);break;case "s":e.bezierCurveToShort(n+c[1],o+c[2],n+c[3],o+c[4]),n+=c[3],o+=c[4];break;case "Q":n=c[3],o=c[4],e.quadraticCurveTo(c[1],c[2],n,o);break;case "q":e.quadraticCurveTo(n+c[1],o+c[2],n+c[3],o+c[4]),n+=c[3],o+=c[4];break;case "T":n=c[1],o=c[2],e.quadraticCurveToShort(n,o);break;case "t":n+=c[1],o+=c[2],e.quadraticCurveToShort(n,o);break;case "A":n=c[6],o=c[7],e.arcToSvg(c[1],c[2],c[3],c[4],c[5],n,o);break;case "a":n+=c[6],o+=c[7],e.arcToSvg(c[1],c[2],c[3],c[4],c[5],n,o);break;case "Z":case "z":e.closePath(),i.length>0&&(s=i.pop(),s?(n=s.startX,o=s.startY):(n=0,o=0)),s=null;break;default:N(`Unknown SVG path command: ${l}`);}l!=="Z"&&l!=="z"&&s===null&&(s={startX:n,startY:o},i.push(s));}return e}var CP,Dv=f(()=>{CP=tu(EP());Be();});var Uu,kv=f(()=>{ct();Uu=class r{constructor(e=0,t=0,i=0){this.type="circle",this.x=e,this.y=t,this.radius=i;}clone(){return new r(this.x,this.y,this.radius)}contains(e,t){if(this.radius<=0)return false;let i=this.radius*this.radius,s=this.x-e,n=this.y-t;return s*=s,n*=n,s+n<=i}strokeContains(e,t,i,s=.5){if(this.radius===0)return false;let n=this.x-e,o=this.y-t,a=this.radius,u=(1-s)*i,l=Math.sqrt(n*n+o*o);return l<=a+u&&l>a-(i-u)}getBounds(e){return e||(e=new exports.Rectangle),e.x=this.x-this.radius,e.y=this.y-this.radius,e.width=this.radius*2,e.height=this.radius*2,e}copyFrom(e){return this.x=e.x,this.y=e.y,this.radius=e.radius,this}copyTo(e){return e.copyFrom(this),e}toString(){return `[pixi.js/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`}};});var Lu,Ov=f(()=>{ct();Lu=class r{constructor(e=0,t=0,i=0,s=0){this.type="ellipse",this.x=e,this.y=t,this.halfWidth=i,this.halfHeight=s;}clone(){return new r(this.x,this.y,this.halfWidth,this.halfHeight)}contains(e,t){if(this.halfWidth<=0||this.halfHeight<=0)return false;let i=(e-this.x)/this.halfWidth,s=(t-this.y)/this.halfHeight;return i*=i,s*=s,i+s<=1}strokeContains(e,t,i,s=.5){let{halfWidth:n,halfHeight:o}=this;if(n<=0||o<=0)return false;let a=i*(1-s),u=i-a,l=n-u,c=o-u,h=n+a,d=o+a,p=e-this.x,m=t-this.y,b=p*p/(l*l)+m*m/(c*c),_=p*p/(h*h)+m*m/(d*d);return b>1&&_<=1}getBounds(e){return e||(e=new exports.Rectangle),e.x=this.x-this.halfWidth,e.y=this.y-this.halfHeight,e.width=this.halfWidth*2,e.height=this.halfHeight*2,e}copyFrom(e){return this.x=e.x,this.y=e.y,this.halfWidth=e.halfWidth,this.halfHeight=e.halfHeight,this}copyTo(e){return e.copyFrom(this),e}toString(){return `[pixi.js/math:Ellipse x=${this.x} y=${this.y} halfWidth=${this.halfWidth} halfHeight=${this.halfHeight}]`}};});function nn(r,e,t,i,s,n){let o=r-t,a=e-i,u=s-t,l=n-i,c=o*u+a*l,h=u*u+l*l,d=-1;h!==0&&(d=c/h);let p,m;d<0?(p=t,m=i):d>1?(p=s,m=n):(p=t+d*u,m=i+d*l);let b=r-p,_=e-m;return b*b+_*_}var Nm=f(()=>{});var rk,ik,on,Fv=f(()=>{Nm();ct();on=class r{constructor(...e){this.type="polygon";let t=Array.isArray(e[0])?e[0]:e;if(typeof t[0]!="number"){let i=[];for(let s=0,n=t.length;s<n;s++)i.push(t[s].x,t[s].y);t=i;}this.points=t,this.closePath=true;}isClockwise(){let e=0,t=this.points,i=t.length;for(let s=0;s<i;s+=2){let n=t[s],o=t[s+1],a=t[(s+2)%i],u=t[(s+3)%i];e+=(a-n)*(u+o);}return e<0}containsPolygon(e){let t=this.getBounds(rk),i=e.getBounds(ik);if(!t.containsRect(i))return false;let s=e.points;for(let n=0;n<s.length;n+=2){let o=s[n],a=s[n+1];if(!this.contains(o,a))return false}return true}clone(){let e=this.points.slice(),t=new r(e);return t.closePath=this.closePath,t}contains(e,t){let i=false,s=this.points.length/2;for(let n=0,o=s-1;n<s;o=n++){let a=this.points[n*2],u=this.points[n*2+1],l=this.points[o*2],c=this.points[o*2+1];u>t!=c>t&&e<(l-a)*((t-u)/(c-u))+a&&(i=!i);}return i}strokeContains(e,t,i,s=.5){let n=i*i,o=n*(1-s),a=n-o,{points:u}=this,l=u.length-(this.closePath?0:2);for(let c=0;c<l;c+=2){let h=u[c],d=u[c+1],p=u[(c+2)%u.length],m=u[(c+3)%u.length],b=nn(e,t,h,d,p,m),_=Math.sign((p-h)*(t-d)-(m-d)*(e-h));if(b<=(_<0?a:o))return true}return false}getBounds(e){e||(e=new exports.Rectangle);let t=this.points,i=1/0,s=-1/0,n=1/0,o=-1/0;for(let a=0,u=t.length;a<u;a+=2){let l=t[a],c=t[a+1];i=l<i?l:i,s=l>s?l:s,n=c<n?c:n,o=c>o?c:o;}return e.x=i,e.width=s-i,e.y=n,e.height=o-n,e}copyFrom(e){return this.points=e.points.slice(),this.closePath=e.closePath,this}copyTo(e){return e.copyFrom(this),e}toString(){return `[pixi.js/math:PolygoncloseStroke=${this.closePath}points=${this.points.reduce((e,t)=>`${e}, ${t}`,"")}]`}get lastX(){return this.points[this.points.length-2]}get lastY(){return this.points[this.points.length-1]}get x(){return this.points[this.points.length-2]}get y(){return this.points[this.points.length-1]}};});var Hm,Nu,Gv=f(()=>{ct();Hm=(r,e,t,i,s,n,o)=>{let a=r-t,u=e-i,l=Math.sqrt(a*a+u*u);return l>=s-n&&l<=s+o},Nu=class r{constructor(e=0,t=0,i=0,s=0,n=20){this.type="roundedRectangle",this.x=e,this.y=t,this.width=i,this.height=s,this.radius=n;}getBounds(e){return e||(e=new exports.Rectangle),e.x=this.x,e.y=this.y,e.width=this.width,e.height=this.height,e}clone(){return new r(this.x,this.y,this.width,this.height,this.radius)}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this}copyTo(e){return e.copyFrom(this),e}contains(e,t){if(this.width<=0||this.height<=0)return false;if(e>=this.x&&e<=this.x+this.width&&t>=this.y&&t<=this.y+this.height){let i=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(t>=this.y+i&&t<=this.y+this.height-i||e>=this.x+i&&e<=this.x+this.width-i)return true;let s=e-(this.x+i),n=t-(this.y+i),o=i*i;if(s*s+n*n<=o||(s=e-(this.x+this.width-i),s*s+n*n<=o)||(n=t-(this.y+this.height-i),s*s+n*n<=o)||(s=e-(this.x+i),s*s+n*n<=o))return true}return false}strokeContains(e,t,i,s=.5){let{x:n,y:o,width:a,height:u,radius:l}=this,c=i*(1-s),h=i-c,d=n+l,p=o+l,m=a-l*2,b=u-l*2,_=n+a,g=o+u;return (e>=n-c&&e<=n+h||e>=_-h&&e<=_+c)&&t>=p&&t<=p+b||(t>=o-c&&t<=o+h||t>=g-h&&t<=g+c)&&e>=d&&e<=d+m?true:e<d&&t<p&&Hm(e,t,d,p,l,h,c)||e>_-l&&t<p&&Hm(e,t,_-l,p,l,h,c)||e>_-l&&t>g-l&&Hm(e,t,_-l,g-l,l,h,c)||e<d&&t>g-l&&Hm(e,t,d,g-l,l,h,c)}toString(){return `[pixi.js/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`}};});function Vu(r,e,t,i,s,n,o,a,u,l){let h=Math.min(.99,Math.max(0,l??rn.defaultOptions.bezierSmoothness)),d=(nk-h)/1;return d*=d,ok(e,t,i,s,n,o,a,u,r,d),r}function ok(r,e,t,i,s,n,o,a,u,l){Lv(r,e,t,i,s,n,o,a,u,l,0),u.push(o,a);}function Lv(r,e,t,i,s,n,o,a,u,l,c){if(c>sk)return;let h=Math.PI,d=(r+t)/2,p=(e+i)/2,m=(t+s)/2,b=(i+n)/2,_=(s+o)/2,g=(n+a)/2,y=(d+m)/2,S=(p+b)/2,E=(m+_)/2,F=(b+g)/2,T=(y+E)/2,C=(S+F)/2;if(c>0){let A=o-r,P=a-e,M=Math.abs((t-o)*P-(i-a)*A),k=Math.abs((s-o)*P-(n-a)*A),L,pe;if(M>Vm&&k>Vm){if((M+k)*(M+k)<=l*(A*A+P*P)){if(Hu<Uv){u.push(T,C);return}let ve=Math.atan2(n-i,s-t);if(L=Math.abs(ve-Math.atan2(i-e,t-r)),pe=Math.abs(Math.atan2(a-n,o-s)-ve),L>=h&&(L=2*h-L),pe>=h&&(pe=2*h-pe),L+pe<Hu){u.push(T,C);return}if(Ao!==0){if(L>Ao){u.push(t,i);return}if(pe>Ao){u.push(s,n);return}}}}else if(M>Vm){if(M*M<=l*(A*A+P*P)){if(Hu<Uv){u.push(T,C);return}if(L=Math.abs(Math.atan2(n-i,s-t)-Math.atan2(i-e,t-r)),L>=h&&(L=2*h-L),L<Hu){u.push(t,i),u.push(s,n);return}if(Ao!==0&&L>Ao){u.push(t,i);return}}}else if(k>Vm){if(k*k<=l*(A*A+P*P)){if(Hu<Uv){u.push(T,C);return}if(L=Math.abs(Math.atan2(a-n,o-s)-Math.atan2(n-i,s-t)),L>=h&&(L=2*h-L),L<Hu){u.push(t,i),u.push(s,n);return}if(Ao!==0&&L>Ao){u.push(s,n);return}}}else if(A=T-(r+o)/2,P=C-(e+a)/2,A*A+P*P<=l){u.push(T,C);return}}Lv(r,e,d,p,y,S,T,C,u,l,c+1),Lv(T,C,E,F,_,g,o,a,u,l,c+1);}var sk,Vm,nk,Uv,Hu,Ao,zm=f(()=>{fh();sk=8,Vm=11920929e-14,nk=1,Uv=.01,Hu=0,Ao=0;});function Wm(r,e,t,i,s,n,o,a){let l=Math.min(.99,Math.max(0,a??rn.defaultOptions.bezierSmoothness)),c=(lk-l)/1;return c*=c,hk(e,t,i,s,n,o,r,c),r}function hk(r,e,t,i,s,n,o,a){Nv(o,r,e,t,i,s,n,a,0),o.push(s,n);}function Nv(r,e,t,i,s,n,o,a,u){if(u>ak)return;let l=Math.PI,c=(e+i)/2,h=(t+s)/2,d=(i+n)/2,p=(s+o)/2,m=(c+d)/2,b=(h+p)/2,_=n-e,g=o-t,y=Math.abs((i-n)*g-(s-o)*_);if(y>uk){if(y*y<=a*(_*_+g*g)){if(AP<ck){r.push(m,b);return}let S=Math.abs(Math.atan2(o-s,n-i)-Math.atan2(s-t,i-e));if(S>=l&&(S=2*l-S),S<AP){r.push(m,b);return}}}else if(_=m-(e+n)/2,g=b-(t+o)/2,_*_+g*g<=a){r.push(m,b);return}Nv(r,e,t,c,h,m,b,a,u+1),Nv(r,m,b,d,p,n,o,a,u+1);}var ak,uk,lk,ck,AP,Hv=f(()=>{fh();ak=8,uk=11920929e-14,lk=1,ck=.01,AP=0;});function zu(r,e,t,i,s,n,o,a){let u=Math.abs(s-n);(!o&&s>n||o&&n>s)&&(u=2*Math.PI-u),a||(a=Math.max(6,Math.floor(6*Math.pow(i,1/3)*(u/Math.PI)))),a=Math.max(a,3);let l=u/a,c=s;l*=o?-1:1;for(let h=0;h<a+1;h++){let d=Math.cos(c),p=Math.sin(c),m=e+d*i,b=t+p*i;r.push(m,b),c+=l;}}var Xm=f(()=>{});function Ym(r,e,t,i,s,n){let o=r[r.length-2],u=r[r.length-1]-t,l=o-e,c=s-t,h=i-e,d=Math.abs(u*h-l*c);if(d<1e-8||n===0){(r[r.length-2]!==e||r[r.length-1]!==t)&&r.push(e,t);return}let p=u*u+l*l,m=c*c+h*h,b=u*c+l*h,_=n*Math.sqrt(p)/d,g=n*Math.sqrt(m)/d,y=_*b/p,S=g*b/m,E=_*h+g*l,F=_*c+g*u,T=l*(g+y),C=u*(g+y),A=h*(_+S),P=c*(_+S),M=Math.atan2(C-F,T-E),k=Math.atan2(P-F,A-E);zu(r,E+e,F+t,n,M,k,l*c>h*u);}var Vv=f(()=>{Xm();});function dk(r,e){let t=e===-1.5707963267948966?-0.551915024494:1.3333333333333333*Math.tan(e/4),i=e===1.5707963267948966?.551915024494:t,s=Math.cos(r),n=Math.sin(r),o=Math.cos(r+e),a=Math.sin(r+e);return [{x:s-n*i,y:n+s*i},{x:o+a*i,y:a-o*i},{x:o,y:a}]}function jm(r,e,t,i,s,n,o,a=0,u=0,l=0){if(n===0||o===0)return;let c=Math.sin(a*bh/360),h=Math.cos(a*bh/360),d=h*(e-i)/2+c*(t-s)/2,p=-c*(e-i)/2+h*(t-s)/2;if(d===0&&p===0)return;n=Math.abs(n),o=Math.abs(o);let m=Math.pow(d,2)/Math.pow(n,2)+Math.pow(p,2)/Math.pow(o,2);m>1&&(n*=Math.sqrt(m),o*=Math.sqrt(m)),fk(e,t,i,s,n,o,u,l,c,h,d,p,zv);let{ang1:b,ang2:_}=zv,{centerX:g,centerY:y}=zv,S=Math.abs(_)/(bh/4);Math.abs(1-S)<1e-7&&(S=1);let E=Math.max(Math.ceil(S),1);_/=E;let F=r[r.length-2],T=r[r.length-1],C={x:0,y:0};for(let A=0;A<E;A++){let P=dk(b,_),{x:M,y:k}=Wv(P[0],n,o,h,c,g,y,C),{x:L,y:pe}=Wv(P[1],n,o,h,c,g,y,C),{x:ve,y:kr}=Wv(P[2],n,o,h,c,g,y,C);Vu(r,F,T,M,k,L,pe,ve,kr),F=ve,T=kr,b+=_;}}var bh,zv,Wv,PP,fk,Xv=f(()=>{zm();bh=Math.PI*2,zv={centerX:0,centerY:0,ang1:0,ang2:0},Wv=({x:r,y:e},t,i,s,n,o,a,u)=>{r*=t,e*=i;let l=s*r-n*e,c=n*r+s*e;return u.x=l+o,u.y=c+a,u};PP=(r,e,t,i)=>{let s=r*i-e*t<0?-1:1,n=r*t+e*i;return n>1&&(n=1),n<-1&&(n=-1),s*Math.acos(n)},fk=(r,e,t,i,s,n,o,a,u,l,c,h,d)=>{let p=Math.pow(s,2),m=Math.pow(n,2),b=Math.pow(c,2),_=Math.pow(h,2),g=p*m-p*_-m*b;g<0&&(g=0),g/=p*_+m*b,g=Math.sqrt(g)*(o===a?-1:1);let y=g*s/n*h,S=g*-n/s*c,E=l*y-u*S+(r+t)/2,F=u*y+l*S+(e+i)/2,T=(c-y)/s,C=(h-S)/n,A=(-c-y)/s,P=(-h-S)/n,M=PP(1,0,T,C),k=PP(T,C,A,P);a===0&&k>0&&(k-=bh),a===1&&k<0&&(k+=bh),d.centerX=E,d.centerY=F,d.ang1=M,d.ang2=k;};});function $m(r,e,t){let i=(o,a)=>{let u=a.x-o.x,l=a.y-o.y,c=Math.sqrt(u*u+l*l),h=u/c,d=l/c;return {len:c,nx:h,ny:d}},s=(o,a)=>{o===0?r.moveTo(a.x,a.y):r.lineTo(a.x,a.y);},n=e[e.length-1];for(let o=0;o<e.length;o++){let a=e[o%e.length],u=a.radius??t;if(u<=0){s(o,a),n=a;continue}let l=e[(o+1)%e.length],c=i(a,n),h=i(a,l);if(c.len<1e-4||h.len<1e-4){s(o,a),n=a;continue}let d=Math.asin(c.nx*h.ny-c.ny*h.nx),p=1,m=false;c.nx*h.nx-c.ny*-h.ny<0?d<0?d=Math.PI+d:(d=Math.PI-d,p=-1,m=true):d>0&&(p=-1,m=true);let b=d/2,_,g=Math.abs(Math.cos(b)*u/Math.sin(b));g>Math.min(c.len/2,h.len/2)?(g=Math.min(c.len/2,h.len/2),_=Math.abs(g*Math.sin(b)/Math.cos(b))):_=u;let y=a.x+h.nx*g+-h.ny*_*p,S=a.y+h.ny*g+h.nx*_*p,E=Math.atan2(c.ny,c.nx)+Math.PI/2*p,F=Math.atan2(h.ny,h.nx)-Math.PI/2*p;o===0&&r.moveTo(y+Math.cos(E)*_,S+Math.sin(E)*_),r.arc(y,S,_,E,F,m),n=a;}}function qm(r,e,t,i){let s=(a,u)=>Math.sqrt((a.x-u.x)**2+(a.y-u.y)**2),n=(a,u,l)=>({x:a.x+(u.x-a.x)*l,y:a.y+(u.y-a.y)*l}),o=e.length;for(let a=0;a<o;a++){let u=e[(a+1)%o],l=u.radius??t;if(l<=0){a===0?r.moveTo(u.x,u.y):r.lineTo(u.x,u.y);continue}let c=e[a],h=e[(a+2)%o],d=s(c,u),p;if(d<1e-4)p=u;else {let _=Math.min(d/2,l);p=n(u,c,_/d);}let m=s(h,u),b;if(m<1e-4)b=u;else {let _=Math.min(m/2,l);b=n(u,h,_/m);}a===0?r.moveTo(p.x,p.y):r.lineTo(p.x,p.y),r.quadraticCurveTo(u.x,u.y,b.x,b.y,i);}}var Yv=f(()=>{});var pk,Wu,jv=f(()=>{kv();Ov();Fv();ct();Gv();Lt();zm();Hv();Xm();Vv();Xv();Yv();pk=new exports.Rectangle,Wu=class{constructor(e){this.shapePrimitives=[],this._currentPoly=null,this._bounds=new Ae,this._graphicsPath2D=e,this.signed=e.checkForHoles;}moveTo(e,t){return this.startPoly(e,t),this}lineTo(e,t){this._ensurePoly();let i=this._currentPoly.points,s=i[i.length-2],n=i[i.length-1];return (s!==e||n!==t)&&i.push(e,t),this}arc(e,t,i,s,n,o){this._ensurePoly(false);let a=this._currentPoly.points;return zu(a,e,t,i,s,n,o),this}arcTo(e,t,i,s,n){this._ensurePoly();let o=this._currentPoly.points;return Ym(o,e,t,i,s,n),this}arcToSvg(e,t,i,s,n,o,a){let u=this._currentPoly.points;return jm(u,this._currentPoly.lastX,this._currentPoly.lastY,o,a,e,t,i,s,n),this}bezierCurveTo(e,t,i,s,n,o,a){this._ensurePoly();let u=this._currentPoly;return Vu(this._currentPoly.points,u.lastX,u.lastY,e,t,i,s,n,o,a),this}quadraticCurveTo(e,t,i,s,n){this._ensurePoly();let o=this._currentPoly;return Wm(this._currentPoly.points,o.lastX,o.lastY,e,t,i,s,n),this}closePath(){return this.endPoly(true),this}addPath(e,t){this.endPoly(),t&&!t.isIdentity()&&(e=e.clone(true),e.transform(t));let i=this.shapePrimitives,s=i.length;for(let n=0;n<e.instructions.length;n++){let o=e.instructions[n];this[o.action](...o.data);}if(e.checkForHoles&&i.length-s>1){let n=null;for(let o=s;o<i.length;o++){let a=i[o];if(a.shape.type==="polygon"){let u=a.shape,l=n?.shape;l&&l.containsPolygon(u)?(n.holes||(n.holes=[]),n.holes.push(a),i.copyWithin(o,o+1),i.length--,o--):n=a;}}}return this}finish(e=false){this.endPoly(e);}rect(e,t,i,s,n){return this.drawShape(new exports.Rectangle(e,t,i,s),n),this}circle(e,t,i,s){return this.drawShape(new Uu(e,t,i),s),this}poly(e,t,i){let s=new on(e);return s.closePath=t,this.drawShape(s,i),this}regularPoly(e,t,i,s,n=0,o){s=Math.max(s|0,3);let a=-1*Math.PI/2+n,u=Math.PI*2/s,l=[];for(let c=0;c<s;c++){let h=a-c*u;l.push(e+i*Math.cos(h),t+i*Math.sin(h));}return this.poly(l,true,o),this}roundPoly(e,t,i,s,n,o=0,a){if(s=Math.max(s|0,3),n<=0)return this.regularPoly(e,t,i,s,o);let u=i*Math.sin(Math.PI/s)-.001;n=Math.min(n,u);let l=-1*Math.PI/2+o,c=Math.PI*2/s,h=(s-2)*Math.PI/s/2;for(let d=0;d<s;d++){let p=d*c+l,m=e+i*Math.cos(p),b=t+i*Math.sin(p),_=p+Math.PI+h,g=p-Math.PI-h,y=m+n*Math.cos(_),S=b+n*Math.sin(_),E=m+n*Math.cos(g),F=b+n*Math.sin(g);d===0?this.moveTo(y,S):this.lineTo(y,S),this.quadraticCurveTo(m,b,E,F,a);}return this.closePath()}roundShape(e,t,i=false,s){return e.length<3?this:(i?qm(this,e,t,s):$m(this,e,t),this.closePath())}filletRect(e,t,i,s,n){if(n===0)return this.rect(e,t,i,s);let o=Math.min(i,s)/2,a=Math.min(o,Math.max(-o,n)),u=e+i,l=t+s,c=a<0?-a:0,h=Math.abs(a);return this.moveTo(e,t+h).arcTo(e+c,t+c,e+h,t,h).lineTo(u-h,t).arcTo(u-c,t+c,u,t+h,h).lineTo(u,l-h).arcTo(u-c,l-c,e+i-h,l,h).lineTo(e+h,l).arcTo(e+c,l-c,e,l-h,h).closePath()}chamferRect(e,t,i,s,n,o){if(n<=0)return this.rect(e,t,i,s);let a=Math.min(n,Math.min(i,s)/2),u=e+i,l=t+s,c=[e+a,t,u-a,t,u,t+a,u,l-a,u-a,l,e+a,l,e,l-a,e,t+a];for(let h=c.length-1;h>=2;h-=2)c[h]===c[h-2]&&c[h-1]===c[h-3]&&c.splice(h-1,2);return this.poly(c,true,o)}ellipse(e,t,i,s,n){return this.drawShape(new Lu(e,t,i,s),n),this}roundRect(e,t,i,s,n,o){return this.drawShape(new Nu(e,t,i,s,n),o),this}drawShape(e,t){return this.endPoly(),this.shapePrimitives.push({shape:e,transform:t}),this}startPoly(e,t){let i=this._currentPoly;return i&&this.endPoly(),i=new on,i.points.push(e,t),this._currentPoly=i,this}endPoly(e=false){let t=this._currentPoly;return t&&t.points.length>2&&(t.closePath=e,this.shapePrimitives.push({shape:t})),this._currentPoly=null,this}_ensurePoly(e=true){if(!this._currentPoly&&(this._currentPoly=new on,e)){let t=this.shapePrimitives[this.shapePrimitives.length-1];if(t){let i=t.shape.x,s=t.shape.y;if(t.transform&&!t.transform.isIdentity()){let n=t.transform,o=i;i=n.a*i+n.c*s+n.tx,s=n.b*o+n.d*s+n.ty;}this._currentPoly.points.push(i,s);}else this._currentPoly.points.push(0,0);}}buildPath(){let e=this._graphicsPath2D;this.shapePrimitives.length=0,this._currentPoly=null;for(let t=0;t<e.instructions.length;t++){let i=e.instructions[t];this[i.action](...i.data);}this.finish();}get bounds(){let e=this._bounds;e.clear();let t=this.shapePrimitives;for(let i=0;i<t.length;i++){let s=t[i],n=s.shape.getBounds(pk);s.transform?e.addRect(n,s.transform):e.addRect(n);}return e}};});function yh(r,e){return r?r.prepend(e):e.clone()}var Bi,Km=f(()=>{cr();Et();Be();Dv();jv();Bi=class r{constructor(e,t=false){this.instructions=[],this.uid=ce("graphicsPath"),this._dirty=true,this.checkForHoles=t,typeof e=="string"?Lm(e,this):this.instructions=e?.slice()??[];}get shapePath(){return this._shapePath||(this._shapePath=new Wu(this)),this._dirty&&(this._dirty=false,this._shapePath.buildPath()),this._shapePath}addPath(e,t){return e=e.clone(),this.instructions.push({action:"addPath",data:[e,t]}),this._dirty=true,this}arc(...e){return this.instructions.push({action:"arc",data:e}),this._dirty=true,this}arcTo(...e){return this.instructions.push({action:"arcTo",data:e}),this._dirty=true,this}arcToSvg(...e){return this.instructions.push({action:"arcToSvg",data:e}),this._dirty=true,this}bezierCurveTo(...e){return this.instructions.push({action:"bezierCurveTo",data:e}),this._dirty=true,this}bezierCurveToShort(e,t,i,s,n){let o=this.instructions[this.instructions.length-1],a=this.getLastPoint(me.shared),u=0,l=0;if(!o||o.action!=="bezierCurveTo")u=a.x,l=a.y;else {u=o.data[2],l=o.data[3];let c=a.x,h=a.y;u=c+(c-u),l=h+(h-l);}return this.instructions.push({action:"bezierCurveTo",data:[u,l,e,t,i,s,n]}),this._dirty=true,this}closePath(){return this.instructions.push({action:"closePath",data:[]}),this._dirty=true,this}ellipse(...e){return this.instructions.push({action:"ellipse",data:e}),this._dirty=true,this}lineTo(...e){return this.instructions.push({action:"lineTo",data:e}),this._dirty=true,this}moveTo(...e){return this.instructions.push({action:"moveTo",data:e}),this}quadraticCurveTo(...e){return this.instructions.push({action:"quadraticCurveTo",data:e}),this._dirty=true,this}quadraticCurveToShort(e,t,i){let s=this.instructions[this.instructions.length-1],n=this.getLastPoint(me.shared),o=0,a=0;if(!s||s.action!=="quadraticCurveTo")o=n.x,a=n.y;else {o=s.data[0],a=s.data[1];let u=n.x,l=n.y;o=u+(u-o),a=l+(l-a);}return this.instructions.push({action:"quadraticCurveTo",data:[o,a,e,t,i]}),this._dirty=true,this}rect(e,t,i,s,n){return this.instructions.push({action:"rect",data:[e,t,i,s,n]}),this._dirty=true,this}circle(e,t,i,s){return this.instructions.push({action:"circle",data:[e,t,i,s]}),this._dirty=true,this}roundRect(...e){return this.instructions.push({action:"roundRect",data:e}),this._dirty=true,this}poly(...e){return this.instructions.push({action:"poly",data:e}),this._dirty=true,this}regularPoly(...e){return this.instructions.push({action:"regularPoly",data:e}),this._dirty=true,this}roundPoly(...e){return this.instructions.push({action:"roundPoly",data:e}),this._dirty=true,this}roundShape(...e){return this.instructions.push({action:"roundShape",data:e}),this._dirty=true,this}filletRect(...e){return this.instructions.push({action:"filletRect",data:e}),this._dirty=true,this}chamferRect(...e){return this.instructions.push({action:"chamferRect",data:e}),this._dirty=true,this}star(e,t,i,s,n,o,a){n||(n=s/2);let u=-1*Math.PI/2+o,l=i*2,c=Math.PI*2/l,h=[];for(let d=0;d<l;d++){let p=d%2?n:s,m=d*c+u;h.push(e+p*Math.cos(m),t+p*Math.sin(m));}return this.poly(h,true,a),this}clone(e=false){let t=new r;if(t.checkForHoles=this.checkForHoles,!e)t.instructions=this.instructions.slice();else for(let i=0;i<this.instructions.length;i++){let s=this.instructions[i];t.instructions.push({action:s.action,data:s.data.slice()});}return t}clear(){return this.instructions.length=0,this._dirty=true,this}transform(e){if(e.isIdentity())return this;let t=e.a,i=e.b,s=e.c,n=e.d,o=e.tx,a=e.ty,u=0,l=0,c=0,h=0,d=0,p=0,m=0,b=0;for(let _=0;_<this.instructions.length;_++){let g=this.instructions[_],y=g.data;switch(g.action){case "moveTo":case "lineTo":u=y[0],l=y[1],y[0]=t*u+s*l+o,y[1]=i*u+n*l+a;break;case "bezierCurveTo":c=y[0],h=y[1],d=y[2],p=y[3],u=y[4],l=y[5],y[0]=t*c+s*h+o,y[1]=i*c+n*h+a,y[2]=t*d+s*p+o,y[3]=i*d+n*p+a,y[4]=t*u+s*l+o,y[5]=i*u+n*l+a;break;case "quadraticCurveTo":c=y[0],h=y[1],u=y[2],l=y[3],y[0]=t*c+s*h+o,y[1]=i*c+n*h+a,y[2]=t*u+s*l+o,y[3]=i*u+n*l+a;break;case "arcToSvg":u=y[5],l=y[6],m=y[0],b=y[1],y[0]=t*m+s*b,y[1]=i*m+n*b,y[5]=t*u+s*l+o,y[6]=i*u+n*l+a;break;case "circle":y[4]=yh(y[3],e);break;case "rect":y[4]=yh(y[4],e);break;case "ellipse":y[8]=yh(y[8],e);break;case "roundRect":y[5]=yh(y[5],e);break;case "addPath":y[0].transform(e);break;case "poly":y[2]=yh(y[2],e);break;default:N("unknown transform action",g.action);break}}return this._dirty=true,this}get bounds(){return this.shapePath.bounds}getLastPoint(e){let t=this.instructions.length-1,i=this.instructions[t];if(!i)return e.x=0,e.y=0,e;for(;i.action==="closePath";){if(t--,t<0)return e.x=0,e.y=0,e;i=this.instructions[t];}switch(i.action){case "moveTo":case "lineTo":e.x=i.data[0],e.y=i.data[1];break;case "quadraticCurveTo":e.x=i.data[2],e.y=i.data[3];break;case "bezierCurveTo":e.x=i.data[4],e.y=i.data[5];break;case "arc":case "arcToSvg":e.x=i.data[5],e.y=i.data[6];break;case "addPath":i.data[0].getLastPoint(e);break}return e}};});function Ke(r,e,t){let i=r.getAttribute(e);return i?Number(i):t}var Zm=f(()=>{});function Qm(r,e){let t=r.querySelectorAll("defs");for(let i=0;i<t.length;i++){let s=t[i];for(let n=0;n<s.children.length;n++){let o=s.children[n];switch(o.nodeName.toLowerCase()){case "lineargradient":e.defs[o.id]=mk(o);break;case "radialgradient":e.defs[o.id]=gk();break;}}}}function mk(r){let e=Ke(r,"x1",0),t=Ke(r,"y1",0),i=Ke(r,"x2",1),s=Ke(r,"y2",0),n=r.getAttribute("gradientUnits")||"objectBoundingBox",o=new qt(e,t,i,s,n==="objectBoundingBox"?"local":"global");for(let a=0;a<r.children.length;a++){let u=r.children[a],l=Ke(u,"offset",0),c=te.shared.setValue(u.getAttribute("stop-color")).toNumber();o.addColorStop(l,c);}return o}function gk(r){return N("[SVG Parser] Radial gradients are not yet supported"),new qt(0,0,1,0)}var $v=f(()=>{gt();Be();_o();Zm();});function vh(r){let e=r.match(/url\s*\(\s*['"]?\s*#([^'"\s)]+)\s*['"]?\s*\)/i);return e?e[1]:""}var qv=f(()=>{});function Th(r,e){let t=r.getAttribute("style"),i={},s={},n={strokeStyle:i,fillStyle:s,useFill:false,useStroke:false};for(let o in Jm){let a=r.getAttribute(o);a&&wP(e,n,o,a.trim());}if(t){let o=t.split(";");for(let a=0;a<o.length;a++){let u=o[a].trim(),[l,c]=u.split(":");Jm[l]&&wP(e,n,l,c.trim());}}return {strokeStyle:n.useStroke?i:null,fillStyle:n.useFill?s:null,useFill:n.useFill,useStroke:n.useStroke}}function wP(r,e,t,i){switch(t){case "stroke":if(i!=="none"){if(i.startsWith("url(")){let s=vh(i);e.strokeStyle.fill=r.defs[s];}else e.strokeStyle.color=te.shared.setValue(i).toNumber();e.useStroke=true;}break;case "stroke-width":e.strokeStyle.width=Number(i);break;case "fill":if(i!=="none"){if(i.startsWith("url(")){let s=vh(i);e.fillStyle.fill=r.defs[s];}else e.fillStyle.color=te.shared.setValue(i).toNumber();e.useFill=true;}break;case "fill-opacity":e.fillStyle.alpha=Number(i);break;case "stroke-opacity":e.strokeStyle.alpha=Number(i);break;case "opacity":e.fillStyle.alpha=Number(i),e.strokeStyle.alpha=Number(i);break}}var Jm,Kv=f(()=>{gt();qv();Jm={fill:{type:"paint",default:0},"fill-opacity":{type:"number",default:1},stroke:{type:"paint",default:0},"stroke-width":{type:"number",default:1},"stroke-opacity":{type:"number",default:1},"stroke-linecap":{type:"string",default:"butt"},"stroke-linejoin":{type:"string",default:"miter"},"stroke-miterlimit":{type:"number",default:10},"stroke-dasharray":{type:"string",default:"none"},"stroke-dashoffset":{type:"number",default:0},opacity:{type:"number",default:1}};});function eg(r,e){if(typeof r=="string"){let o=document.createElement("div");o.innerHTML=r.trim(),r=o.querySelector("svg");}let t={context:e,defs:{},path:new Bi};Qm(r,t);let i=r.children,{fillStyle:s,strokeStyle:n}=Th(r,t);for(let o=0;o<i.length;o++){let a=i[o];a.nodeName.toLowerCase()!=="defs"&&BP(a,t,s,n);}return e}function BP(r,e,t,i){let s=r.children,{fillStyle:n,strokeStyle:o}=Th(r,e);n&&t?t={...t,...n}:n&&(t=n),o&&i?i={...i,...o}:o&&(i=o);let a=!t&&!i;a&&(t={color:0});let u,l,c,h,d,p,m,b,_,g,y,S,E,F,T,C,A;switch(r.nodeName.toLowerCase()){case "path":F=r.getAttribute("d"),r.getAttribute("fill-rule")==="evenodd"&&N("SVG Evenodd fill rule not supported, your svg may render incorrectly"),T=new Bi(F,true),e.context.path(T),t&&e.context.fill(t),i&&e.context.stroke(i);break;case "circle":m=Ke(r,"cx",0),b=Ke(r,"cy",0),_=Ke(r,"r",0),e.context.ellipse(m,b,_,_),t&&e.context.fill(t),i&&e.context.stroke(i);break;case "rect":u=Ke(r,"x",0),l=Ke(r,"y",0),C=Ke(r,"width",0),A=Ke(r,"height",0),g=Ke(r,"rx",0),y=Ke(r,"ry",0),g||y?e.context.roundRect(u,l,C,A,g||y):e.context.rect(u,l,C,A),t&&e.context.fill(t),i&&e.context.stroke(i);break;case "ellipse":m=Ke(r,"cx",0),b=Ke(r,"cy",0),g=Ke(r,"rx",0),y=Ke(r,"ry",0),e.context.beginPath(),e.context.ellipse(m,b,g,y),t&&e.context.fill(t),i&&e.context.stroke(i);break;case "line":c=Ke(r,"x1",0),h=Ke(r,"y1",0),d=Ke(r,"x2",0),p=Ke(r,"y2",0),e.context.beginPath(),e.context.moveTo(c,h),e.context.lineTo(d,p),i&&e.context.stroke(i);break;case "polygon":E=r.getAttribute("points"),S=E.match(/\d+/g).map(P=>parseInt(P,10)),e.context.poly(S,true),t&&e.context.fill(t),i&&e.context.stroke(i);break;case "polyline":E=r.getAttribute("points"),S=E.match(/\d+/g).map(P=>parseInt(P,10)),e.context.poly(S,false),i&&e.context.stroke(i);break;case "g":case "svg":break;default:{N(`[SVG parser] <${r.nodeName}> elements unsupported`);break}}a&&(t=null);for(let P=0;P<s.length;P++)BP(s[P],e,t,i);}var Zv=f(()=>{Be();Km();$v();Zm();Kv();});function xk(r){return te.isColorLike(r)}function RP(r){return r instanceof ui}function MP(r){return r instanceof qt}function _k(r){return r instanceof exports.Texture}function bk(r,e,t){let i=te.shared.setValue(e??0);return r.color=i.toNumber(),r.alpha=i.alpha===1?t.alpha:i.alpha,r.texture=exports.Texture.WHITE,{...t,...r}}function yk(r,e,t){return r.texture=e,{...t,...r}}function IP(r,e,t){return r.fill=e,r.color=16777215,r.texture=e.texture,r.matrix=e.transform,{...t,...r}}function DP(r,e,t){return e.buildGradient(),r.fill=e,r.color=16777215,r.texture=e.texture,r.matrix=e.transform,r.textureSpace=e.textureSpace,{...t,...r}}function vk(r,e){let t={...e,...r},i=te.shared.setValue(t.color);return t.alpha*=i.alpha,t.color=i.toNumber(),t}function li(r,e){if(r==null)return null;let t={},i=r;return xk(r)?bk(t,r,e):_k(r)?yk(t,r,e):RP(r)?IP(t,r,e):MP(r)?DP(t,r,e):i.fill&&RP(i.fill)?IP(i,i.fill,e):i.fill&&MP(i.fill)?DP(i,i.fill,e):vk(i,e)}function an(r,e){let{width:t,alignment:i,miterLimit:s,cap:n,join:o,pixelLine:a,...u}=e,l=li(r,u);return l?{width:t,alignment:i,miterLimit:s,cap:n,join:o,pixelLine:a,...l}:null}var tg=f(()=>{gt();ye();_o();_h();});var Tk,kP,Qv,dt,Po=f(()=>{Ut();gt();Te();cr();ye();Et();Pe();Lt();Km();Zv();tg();Tk=new me,kP=new G,Qv=class Ri extends _e{constructor(){super(...arguments),this.uid=ce("graphicsContext"),this.dirty=true,this.batchMode="auto",this.instructions=[],this._activePath=new Bi,this._transform=new G,this._fillStyle={...Ri.defaultFillStyle},this._strokeStyle={...Ri.defaultStrokeStyle},this._stateStack=[],this._tick=0,this._bounds=new Ae,this._boundsDirty=true;}clone(){let e=new Ri;return e.batchMode=this.batchMode,e.instructions=this.instructions.slice(),e._activePath=this._activePath.clone(),e._transform=this._transform.clone(),e._fillStyle={...this._fillStyle},e._strokeStyle={...this._strokeStyle},e._stateStack=this._stateStack.slice(),e._bounds=this._bounds.clone(),e._boundsDirty=true,e}get fillStyle(){return this._fillStyle}set fillStyle(e){this._fillStyle=li(e,Ri.defaultFillStyle);}get strokeStyle(){return this._strokeStyle}set strokeStyle(e){this._strokeStyle=an(e,Ri.defaultStrokeStyle);}setFillStyle(e){return this._fillStyle=li(e,Ri.defaultFillStyle),this}setStrokeStyle(e){return this._strokeStyle=li(e,Ri.defaultStrokeStyle),this}texture(e,t,i,s,n,o){return this.instructions.push({action:"texture",data:{image:e,dx:i||0,dy:s||0,dw:n||e.frame.width,dh:o||e.frame.height,transform:this._transform.clone(),alpha:this._fillStyle.alpha,style:t?te.shared.setValue(t).toNumber():16777215}}),this.onUpdate(),this}beginPath(){return this._activePath=new Bi,this}fill(e,t){let i,s=this.instructions[this.instructions.length-1];return this._tick===0&&s&&s.action==="stroke"?i=s.data.path:i=this._activePath.clone(),i?(e!=null&&(t!==void 0&&typeof e=="number"&&(U(Y,"GraphicsContext.fill(color, alpha) is deprecated, use GraphicsContext.fill({ color, alpha }) instead"),e={color:e,alpha:t}),this._fillStyle=li(e,Ri.defaultFillStyle)),this.instructions.push({action:"fill",data:{style:this.fillStyle,path:i}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this}_initNextPathLocation(){let{x:e,y:t}=this._activePath.getLastPoint(me.shared);this._activePath.clear(),this._activePath.moveTo(e,t);}stroke(e){let t,i=this.instructions[this.instructions.length-1];return this._tick===0&&i&&i.action==="fill"?t=i.data.path:t=this._activePath.clone(),t?(e!=null&&(this._strokeStyle=an(e,Ri.defaultStrokeStyle)),this.instructions.push({action:"stroke",data:{style:this.strokeStyle,path:t}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this}cut(){for(let e=0;e<2;e++){let t=this.instructions[this.instructions.length-1-e],i=this._activePath.clone();if(t&&(t.action==="stroke"||t.action==="fill"))if(t.data.hole)t.data.hole.addPath(i);else {t.data.hole=i;break}}return this._initNextPathLocation(),this}arc(e,t,i,s,n,o){this._tick++;let a=this._transform;return this._activePath.arc(a.a*e+a.c*t+a.tx,a.b*e+a.d*t+a.ty,i,s,n,o),this}arcTo(e,t,i,s,n){this._tick++;let o=this._transform;return this._activePath.arcTo(o.a*e+o.c*t+o.tx,o.b*e+o.d*t+o.ty,o.a*i+o.c*s+o.tx,o.b*i+o.d*s+o.ty,n),this}arcToSvg(e,t,i,s,n,o,a){this._tick++;let u=this._transform;return this._activePath.arcToSvg(e,t,i,s,n,u.a*o+u.c*a+u.tx,u.b*o+u.d*a+u.ty),this}bezierCurveTo(e,t,i,s,n,o,a){this._tick++;let u=this._transform;return this._activePath.bezierCurveTo(u.a*e+u.c*t+u.tx,u.b*e+u.d*t+u.ty,u.a*i+u.c*s+u.tx,u.b*i+u.d*s+u.ty,u.a*n+u.c*o+u.tx,u.b*n+u.d*o+u.ty,a),this}closePath(){return this._tick++,this._activePath?.closePath(),this}ellipse(e,t,i,s){return this._tick++,this._activePath.ellipse(e,t,i,s,this._transform.clone()),this}circle(e,t,i){return this._tick++,this._activePath.circle(e,t,i,this._transform.clone()),this}path(e){return this._tick++,this._activePath.addPath(e,this._transform.clone()),this}lineTo(e,t){this._tick++;let i=this._transform;return this._activePath.lineTo(i.a*e+i.c*t+i.tx,i.b*e+i.d*t+i.ty),this}moveTo(e,t){this._tick++;let i=this._transform,s=this._activePath.instructions,n=i.a*e+i.c*t+i.tx,o=i.b*e+i.d*t+i.ty;return s.length===1&&s[0].action==="moveTo"?(s[0].data[0]=n,s[0].data[1]=o,this):(this._activePath.moveTo(n,o),this)}quadraticCurveTo(e,t,i,s,n){this._tick++;let o=this._transform;return this._activePath.quadraticCurveTo(o.a*e+o.c*t+o.tx,o.b*e+o.d*t+o.ty,o.a*i+o.c*s+o.tx,o.b*i+o.d*s+o.ty,n),this}rect(e,t,i,s){return this._tick++,this._activePath.rect(e,t,i,s,this._transform.clone()),this}roundRect(e,t,i,s,n){return this._tick++,this._activePath.roundRect(e,t,i,s,n,this._transform.clone()),this}poly(e,t){return this._tick++,this._activePath.poly(e,t,this._transform.clone()),this}regularPoly(e,t,i,s,n=0,o){return this._tick++,this._activePath.regularPoly(e,t,i,s,n,o),this}roundPoly(e,t,i,s,n,o){return this._tick++,this._activePath.roundPoly(e,t,i,s,n,o),this}roundShape(e,t,i,s){return this._tick++,this._activePath.roundShape(e,t,i,s),this}filletRect(e,t,i,s,n){return this._tick++,this._activePath.filletRect(e,t,i,s,n),this}chamferRect(e,t,i,s,n,o){return this._tick++,this._activePath.chamferRect(e,t,i,s,n,o),this}star(e,t,i,s,n=0,o=0){return this._tick++,this._activePath.star(e,t,i,s,n,o,this._transform.clone()),this}svg(e){return this._tick++,eg(e,this),this}restore(){let e=this._stateStack.pop();return e&&(this._transform=e.transform,this._fillStyle=e.fillStyle,this._strokeStyle=e.strokeStyle),this}save(){return this._stateStack.push({transform:this._transform.clone(),fillStyle:{...this._fillStyle},strokeStyle:{...this._strokeStyle}}),this}getTransform(){return this._transform}resetTransform(){return this._transform.identity(),this}rotate(e){return this._transform.rotate(e),this}scale(e,t=e){return this._transform.scale(e,t),this}setTransform(e,t,i,s,n,o){return e instanceof G?(this._transform.set(e.a,e.b,e.c,e.d,e.tx,e.ty),this):(this._transform.set(e,t,i,s,n,o),this)}transform(e,t,i,s,n,o){return e instanceof G?(this._transform.append(e),this):(kP.set(e,t,i,s,n,o),this._transform.append(kP),this)}translate(e,t=e){return this._transform.translate(e,t),this}clear(){return this._activePath.clear(),this.instructions.length=0,this.resetTransform(),this.onUpdate(),this}onUpdate(){this.dirty||(this.emit("update",this,16),this.dirty=true,this._boundsDirty=true);}get bounds(){if(!this._boundsDirty)return this._bounds;let e=this._bounds;e.clear();for(let t=0;t<this.instructions.length;t++){let i=this.instructions[t],s=i.action;if(s==="fill"){let n=i.data;e.addBounds(n.path.bounds);}else if(s==="texture"){let n=i.data;e.addFrame(n.dx,n.dy,n.dx+n.dw,n.dy+n.dh,n.transform);}if(s==="stroke"){let n=i.data,o=n.style.alignment,a=n.style.width*(1-o),u=n.path.bounds;e.addFrame(u.minX-a,u.minY-a,u.maxX+a,u.maxY+a);}}return e}containsPoint(e){if(!this.bounds.containsPoint(e.x,e.y))return false;let t=this.instructions,i=false;for(let s=0;s<t.length;s++){let n=t[s],o=n.data,a=o.path;if(!n.action||!a)continue;let u=o.style,l=a.shapePath.shapePrimitives;for(let c=0;c<l.length;c++){let h=l[c].shape;if(!u||!h)continue;let d=l[c].transform,p=d?d.applyInverse(e,Tk):e;if(n.action==="fill")i=h.contains(p.x,p.y);else {let b=u;i=h.strokeContains(p.x,p.y,b.width,b.alignment);}let m=o.hole;if(m){let b=m.shapePath?.shapePrimitives;if(b)for(let _=0;_<b.length;_++)b[_].shape.contains(p.x,p.y)&&(i=false);}if(i)return true}}return i}destroy(e=false){if(this._stateStack.length=0,this._transform=null,this.emit("destroy",this),this.removeAllListeners(),typeof e=="boolean"?e:e?.texture){let i=typeof e=="boolean"?e:e?.textureSource;this._fillStyle.texture&&this._fillStyle.texture.destroy(i),this._strokeStyle.texture&&this._strokeStyle.texture.destroy(i);}this._fillStyle=null,this._strokeStyle=null,this.instructions=null,this._activePath=null,this._bounds=null,this._stateStack=null,this.customShader=null,this._transform=null;}};Qv.defaultFillStyle={color:16777215,alpha:1,texture:exports.Texture.WHITE,matrix:null,fill:null,textureSpace:"local"};Qv.defaultStrokeStyle={width:1,color:16777215,alpha:1,alignment:.5,miterLimit:10,cap:"butt",join:"miter",texture:exports.Texture.WHITE,matrix:null,fill:null,textureSpace:"local",pixelLine:false};dt=Qv;});function rg(r){let e=[],t=0;for(let i=0;i<OP.length;i++){let s=`_${OP[i]}`;e[t++]=r[s];}return t=FP(r._fill,e,t),t=Ek(r._stroke,e,t),t=Ck(r.dropShadow,e,t),t=Sk(r.filters,e,t),e.join("-")}function Sk(r,e,t){if(!r)return t;for(let i of r)e[t++]=i.uid;return t}function FP(r,e,t){return r&&(e[t++]=r.color,e[t++]=r.alpha,e[t++]=r.fill?.styleKey),t}function Ek(r,e,t){return r&&(t=FP(r,e,t),e[t++]=r.width,e[t++]=r.alignment,e[t++]=r.cap,e[t++]=r.join,e[t++]=r.miterLimit),t}function Ck(r,e,t){return r&&(e[t++]=r.alpha,e[t++]=r.angle,e[t++]=r.blur,e[t++]=r.distance,e[t++]=te.shared.setValue(r.color).toNumber()),t}var OP,Jv=f(()=>{gt();OP=["align","breakWords","cssOverrides","fontVariant","fontWeight","leading","letterSpacing","lineHeight","padding","textBaseline","trim","whiteSpace","wordWrap","wordWrapWidth","fontFamily","fontStyle","fontSize"];});function Ak(r){let e=r;if(typeof e.dropShadow=="boolean"&&e.dropShadow){let t=Mt.defaultDropShadow;r.dropShadow={alpha:e.dropShadowAlpha??t.alpha,angle:e.dropShadowAngle??t.angle,blur:e.dropShadowBlur??t.blur,color:e.dropShadowColor??t.color,distance:e.dropShadowDistance??t.distance};}if(e.strokeThickness!==void 0){U(Y,"strokeThickness is now a part of stroke");let t=e.stroke,i={};if(te.isColorLike(t))i.color=t;else if(t instanceof qt||t instanceof ui)i.fill=t;else if(Object.hasOwnProperty.call(t,"color")||Object.hasOwnProperty.call(t,"fill"))i=t;else throw new Error("Invalid stroke value.");r.stroke={...i,width:e.strokeThickness};}if(Array.isArray(e.fillGradientStops)){U(Y,"gradient fill is now a fill pattern: `new FillGradient(...)`");let t;r.fontSize==null?r.fontSize=Mt.defaultTextStyle.fontSize:typeof r.fontSize=="string"?t=parseInt(r.fontSize,10):t=r.fontSize;let i=new qt({start:{x:0,y:0},end:{x:0,y:(t||0)*1.7}}),s=e.fillGradientStops.map(n=>te.shared.setValue(n).toNumber());s.forEach((n,o)=>{let a=o/(s.length-1);i.addColorStop(a,n);}),r.fill={fill:i};}}var eT,Mt,un=f(()=>{Ut();gt();Pe();_o();_h();Po();tg();Jv();eT=class Xu extends _e{constructor(e={}){super(),Ak(e);let t={...Xu.defaultTextStyle,...e};for(let i in t){let s=i;this[s]=t[i];}this.update();}get align(){return this._align}set align(e){this._align=e,this.update();}get breakWords(){return this._breakWords}set breakWords(e){this._breakWords=e,this.update();}get dropShadow(){return this._dropShadow}set dropShadow(e){e!==null&&typeof e=="object"?this._dropShadow=this._createProxy({...Xu.defaultDropShadow,...e}):this._dropShadow=e?this._createProxy({...Xu.defaultDropShadow}):null,this.update();}get fontFamily(){return this._fontFamily}set fontFamily(e){this._fontFamily=e,this.update();}get fontSize(){return this._fontSize}set fontSize(e){typeof e=="string"?this._fontSize=parseInt(e,10):this._fontSize=e,this.update();}get fontStyle(){return this._fontStyle}set fontStyle(e){this._fontStyle=e.toLowerCase(),this.update();}get fontVariant(){return this._fontVariant}set fontVariant(e){this._fontVariant=e,this.update();}get fontWeight(){return this._fontWeight}set fontWeight(e){this._fontWeight=e,this.update();}get leading(){return this._leading}set leading(e){this._leading=e,this.update();}get letterSpacing(){return this._letterSpacing}set letterSpacing(e){this._letterSpacing=e,this.update();}get lineHeight(){return this._lineHeight}set lineHeight(e){this._lineHeight=e,this.update();}get padding(){return this._padding}set padding(e){this._padding=e,this.update();}get filters(){return this._filters}set filters(e){this._filters=e,this.update();}get trim(){return this._trim}set trim(e){this._trim=e,this.update();}get textBaseline(){return this._textBaseline}set textBaseline(e){this._textBaseline=e,this.update();}get whiteSpace(){return this._whiteSpace}set whiteSpace(e){this._whiteSpace=e,this.update();}get wordWrap(){return this._wordWrap}set wordWrap(e){this._wordWrap=e,this.update();}get wordWrapWidth(){return this._wordWrapWidth}set wordWrapWidth(e){this._wordWrapWidth=e,this.update();}get fill(){return this._originalFill}set fill(e){e!==this._originalFill&&(this._originalFill=e,this._isFillStyle(e)&&(this._originalFill=this._createProxy({...dt.defaultFillStyle,...e},()=>{this._fill=li({...this._originalFill},dt.defaultFillStyle);})),this._fill=li(e===0?"black":e,dt.defaultFillStyle),this.update());}get stroke(){return this._originalStroke}set stroke(e){e!==this._originalStroke&&(this._originalStroke=e,this._isFillStyle(e)&&(this._originalStroke=this._createProxy({...dt.defaultStrokeStyle,...e},()=>{this._stroke=an({...this._originalStroke},dt.defaultStrokeStyle);})),this._stroke=an(e,dt.defaultStrokeStyle),this.update());}_generateKey(){return this._styleKey=rg(this),this._styleKey}update(){this._styleKey=null,this.emit("update",this);}reset(){let e=Xu.defaultTextStyle;for(let t in e)this[t]=e[t];}get styleKey(){return this._styleKey||this._generateKey()}clone(){return new Xu({align:this.align,breakWords:this.breakWords,dropShadow:this._dropShadow?{...this._dropShadow}:null,fill:this._fill,fontFamily:this.fontFamily,fontSize:this.fontSize,fontStyle:this.fontStyle,fontVariant:this.fontVariant,fontWeight:this.fontWeight,leading:this.leading,letterSpacing:this.letterSpacing,lineHeight:this.lineHeight,padding:this.padding,stroke:this._stroke,textBaseline:this.textBaseline,whiteSpace:this.whiteSpace,wordWrap:this.wordWrap,wordWrapWidth:this.wordWrapWidth,filters:this._filters?[...this._filters]:void 0})}_getFinalPadding(){let e=0;if(this._filters)for(let t=0;t<this._filters.length;t++)e+=this._filters[t].padding;return Math.max(this._padding,e)}destroy(e=false){if(this.removeAllListeners(),typeof e=="boolean"?e:e?.texture){let i=typeof e=="boolean"?e:e?.textureSource;this._fill?.texture&&this._fill.texture.destroy(i),this._originalFill?.texture&&this._originalFill.texture.destroy(i),this._stroke?.texture&&this._stroke.texture.destroy(i),this._originalStroke?.texture&&this._originalStroke.texture.destroy(i);}this._fill=null,this._stroke=null,this.dropShadow=null,this._originalStroke=null,this._originalFill=null;}_createProxy(e,t){return new Proxy(e,{set:(i,s,n)=>(i[s]=n,t?.(s,n),this.update(),true)})}_isFillStyle(e){return (e??null)!==null&&!(te.isColorLike(e)||e instanceof qt||e instanceof ui)}};eT.defaultDropShadow={alpha:1,angle:Math.PI/6,blur:0,color:"black",distance:5};eT.defaultTextStyle={align:"left",breakWords:false,dropShadow:null,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",leading:0,letterSpacing:0,lineHeight:0,padding:0,stroke:null,textBaseline:"alphabetic",trim:false,whiteSpace:"pre",wordWrap:false,wordWrapWidth:100};Mt=eT;});function Yu(r,e,t,i){let s=Pk;s.minX=0,s.minY=0,s.maxX=r.width/i|0,s.maxY=r.height/i|0;let n=Me.getOptimalTexture(s.width,s.height,i,false);return n.source.uploadMethodId="image",n.source.resource=r,n.source.alphaMode="premultiply-alpha-on-upload",n.frame.width=e/i,n.frame.height=t/i,n.source.emit("update",n.source),n.updateUvs(),n}var Pk,ig=f(()=>{ri();Lt();Pk=new Ae;});var Sh,sr,wo=f(()=>{Fe();uu();Sh=class{constructor(e){this._canvasPool=Object.create(null),this.canvasOptions=e||{},this.enableFullScreen=false;}_createCanvasAndContext(e,t){let i=j.get().createCanvas();i.width=e,i.height=t;let s=i.getContext("2d");return {canvas:i,context:s}}getOptimalCanvasAndContext(e,t,i=1){e=Math.ceil(e*i-1e-6),t=Math.ceil(t*i-1e-6),e=ti(e),t=ti(t);let s=(e<<17)+(t<<1);this._canvasPool[s]||(this._canvasPool[s]=[]);let n=this._canvasPool[s].pop();return n||(n=this._createCanvasAndContext(e,t)),n}returnCanvasAndContext(e){let t=e.canvas,{width:i,height:s}=t,n=(i<<17)+(s<<1);e.context.clearRect(0,0,i,s),this._canvasPool[n].push(e);}clear(){this._canvasPool={};}},sr=new Sh;});function wk(r,e){Bo||(Bo=j.get().createCanvas(256,128),cs=Bo.getContext("2d",{willReadFrequently:true}),cs.globalCompositeOperation="copy",cs.globalAlpha=1),(Bo.width<r||Bo.height<e)&&(Bo.width=ti(r),Bo.height=ti(e));}function GP(r,e,t){for(let i=0,s=4*t*e;i<e;++i,s+=4)if(r[s+3]!==0)return false;return true}function UP(r,e,t,i,s){let n=4*e;for(let o=i,a=i*n+4*t;o<=s;++o,a+=n)if(r[a+3]!==0)return false;return true}function sg(...r){let e=r[0];e.canvas||(e={canvas:r[0],resolution:r[1]});let{canvas:t}=e,i=Math.min(e.resolution??1,1),s=e.width??t.width,n=e.height??t.height,o=e.output;if(wk(s,n),!cs)throw new TypeError("Failed to get canvas 2D context");cs.drawImage(t,0,0,s,n,0,0,s*i,n*i);let u=cs.getImageData(0,0,s,n).data,l=0,c=0,h=s-1,d=n-1;for(;c<n&&GP(u,s,c);)++c;if(c===n)return exports.Rectangle.EMPTY;for(;GP(u,s,d);)--d;for(;UP(u,s,l,c,d);)++l;for(;UP(u,s,h,c,d);)--h;return ++h,++d,cs.globalCompositeOperation="source-over",cs.strokeRect(l,c,h-l,d-c),cs.globalCompositeOperation="copy",o??(o=new exports.Rectangle),o.set(l/i,c/i,(h-l)/i,(d-c)/i),o}var Bo,cs,tT=f(()=>{Fe();uu();ct();Bo=null,cs=null;});function hs(r){let e=typeof r.fontSize=="number"?`${r.fontSize}px`:r.fontSize,t=r.fontFamily;Array.isArray(r.fontFamily)||(t=r.fontFamily.split(","));for(let i=t.length-1;i>=0;i--){let s=t[i].trim();!/([\"\'])[^\'\"]+\1/.test(s)&&!Bk.includes(s)&&(s=`"${s}"`),t[i]=s;}return `${r.fontStyle} ${r.fontVariant} ${r.fontWeight} ${e} ${t.join(",")}`}var Bk,Eh=f(()=>{Bk=["serif","sans-serif","monospace","cursive","fantasy","system-ui"];});var rT,Mi,It,Ro=f(()=>{Fe();Eh();rT={willReadFrequently:true},Mi=class J{static get experimentalLetterSpacingSupported(){let e=J._experimentalLetterSpacingSupported;if(e===void 0){let t=j.get().getCanvasRenderingContext2D().prototype;e=J._experimentalLetterSpacingSupported="letterSpacing"in t||"textLetterSpacing"in t;}return e}constructor(e,t,i,s,n,o,a,u,l){this.text=e,this.style=t,this.width=i,this.height=s,this.lines=n,this.lineWidths=o,this.lineHeight=a,this.maxLineWidth=u,this.fontProperties=l;}static measureText(e=" ",t,i=J._canvas,s=t.wordWrap){let n=hs(t),o=J.measureFont(n);o.fontSize===0&&(o.fontSize=t.fontSize,o.ascent=t.fontSize);let a=J.__context;a.font=n;let l=(s?J._wordWrap(e,t,i):e).split(/(?:\r\n|\r|\n)/),c=new Array(l.length),h=0;for(let g=0;g<l.length;g++){let y=J._measureText(l[g],t.letterSpacing,a);c[g]=y,h=Math.max(h,y);}let d=t._stroke?.width||0,p=h+d;t.dropShadow&&(p+=t.dropShadow.distance);let m=t.lineHeight||o.fontSize,b=Math.max(m,o.fontSize+d)+(l.length-1)*(m+t.leading);return t.dropShadow&&(b+=t.dropShadow.distance),new J(e,t,p,b,l,c,m+t.leading,h,o)}static _measureText(e,t,i){let s=false;J.experimentalLetterSpacingSupported&&(J.experimentalLetterSpacing?(i.letterSpacing=`${t}px`,i.textLetterSpacing=`${t}px`,s=true):(i.letterSpacing="0px",i.textLetterSpacing="0px"));let n=i.measureText(e),o=n.width,a=-n.actualBoundingBoxLeft,l=n.actualBoundingBoxRight-a;if(o>0)if(s)o-=t,l-=t;else {let c=(J.graphemeSegmenter(e).length-1)*t;o+=c,l+=c;}return Math.max(o,l)}static _wordWrap(e,t,i=J._canvas){let s=i.getContext("2d",rT),n=0,o="",a="",u=Object.create(null),{letterSpacing:l,whiteSpace:c}=t,h=J._collapseSpaces(c),d=J._collapseNewlines(c),p=!h,m=t.wordWrapWidth+l,b=J._tokenize(e);for(let _=0;_<b.length;_++){let g=b[_];if(J._isNewline(g)){if(!d){a+=J._addLine(o),p=!h,o="",n=0;continue}g=" ";}if(h){let S=J.isBreakingSpace(g),E=J.isBreakingSpace(o[o.length-1]);if(S&&E)continue}let y=J._getFromCache(g,l,u,s);if(y>m)if(o!==""&&(a+=J._addLine(o),o="",n=0),J.canBreakWords(g,t.breakWords)){let S=J.wordWrapSplit(g);for(let E=0;E<S.length;E++){let F=S[E],T=F,C=1;for(;S[E+C];){let P=S[E+C];if(!J.canBreakChars(T,P,g,E,t.breakWords))F+=P;else break;T=P,C++;}E+=C-1;let A=J._getFromCache(F,l,u,s);A+n>m&&(a+=J._addLine(o),p=false,o="",n=0),o+=F,n+=A;}}else {o.length>0&&(a+=J._addLine(o),o="",n=0);let S=_===b.length-1;a+=J._addLine(g,!S),p=false,o="",n=0;}else y+n>m&&(p=false,a+=J._addLine(o),o="",n=0),(o.length>0||!J.isBreakingSpace(g)||p)&&(o+=g,n+=y);}return a+=J._addLine(o,false),a}static _addLine(e,t=true){return e=J._trimRight(e),e=t?`${e}
375
375
  `:e,e}static _getFromCache(e,t,i,s){let n=i[e];return typeof n!="number"&&(n=J._measureText(e,t,s)+t,i[e]=n),n}static _collapseSpaces(e){return e==="normal"||e==="pre-line"}static _collapseNewlines(e){return e==="normal"}static _trimRight(e){if(typeof e!="string")return "";for(let t=e.length-1;t>=0;t--){let i=e[t];if(!J.isBreakingSpace(i))break;e=e.slice(0,-1);}return e}static _isNewline(e){return typeof e!="string"?false:J._newlines.includes(e.charCodeAt(0))}static isBreakingSpace(e,t){return typeof e!="string"?false:J._breakingSpaces.includes(e.charCodeAt(0))}static _tokenize(e){let t=[],i="";if(typeof e!="string")return t;for(let s=0;s<e.length;s++){let n=e[s],o=e[s+1];if(J.isBreakingSpace(n,o)||J._isNewline(n)){i!==""&&(t.push(i),i=""),t.push(n);continue}i+=n;}return i!==""&&t.push(i),t}static canBreakWords(e,t){return t}static canBreakChars(e,t,i,s,n){return true}static wordWrapSplit(e){return J.graphemeSegmenter(e)}static measureFont(e){if(J._fonts[e])return J._fonts[e];let t=J._context;t.font=e;let i=t.measureText(J.METRICS_STRING+J.BASELINE_SYMBOL),s={ascent:i.actualBoundingBoxAscent,descent:i.actualBoundingBoxDescent,fontSize:i.actualBoundingBoxAscent+i.actualBoundingBoxDescent};return J._fonts[e]=s,s}static clearMetrics(e=""){e?delete J._fonts[e]:J._fonts={};}static get _canvas(){if(!J.__canvas){let e;try{let t=new OffscreenCanvas(0,0);if(t.getContext("2d",rT)?.measureText)return J.__canvas=t,t;e=j.get().createCanvas();}catch{e=j.get().createCanvas();}e.width=e.height=10,J.__canvas=e;}return J.__canvas}static get _context(){return J.__context||(J.__context=J._canvas.getContext("2d",rT)),J.__context}};Mi.METRICS_STRING="|\xC9q\xC5";Mi.BASELINE_SYMBOL="M";Mi.BASELINE_MULTIPLIER=1.4;Mi.HEIGHT_MULTIPLIER=2;Mi.graphemeSegmenter=(()=>{if(typeof Intl?.Segmenter=="function"){let r=new Intl.Segmenter;return e=>{let t=r.segment(e),i=[],s=0;for(let n of t)i[s++]=n.segment;return i}}return r=>[...r]})();Mi.experimentalLetterSpacing=false;Mi._fonts={};Mi._newlines=[10,13];Mi._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];It=Mi;});function ln(r,e,t,i=0){if(r.texture===exports.Texture.WHITE&&!r.fill)return te.shared.setValue(r.color).setAlpha(r.alpha??1).toHexa();if(r.fill){if(r.fill instanceof ui){let s=r.fill,n=e.createPattern(s.texture.source.resource,"repeat"),o=s.transform.copyTo(G.shared);return o.scale(s.texture.frame.width,s.texture.frame.height),n.setTransform(o),n}else if(r.fill instanceof qt){let s=r.fill,n=s.type==="linear",o=s.textureSpace==="local",a=1,u=1;o&&t&&(a=t.width+i,u=t.height+i);let l,c=false;if(n){let{start:h,end:d}=s;l=e.createLinearGradient(h.x*a,h.y*u,d.x*a,d.y*u),c=Math.abs(d.x-h.x)<Math.abs((d.y-h.y)*.1);}else {let{center:h,innerRadius:d,outerCenter:p,outerRadius:m}=s;l=e.createRadialGradient(h.x*a,h.y*u,d*a,p.x*a,p.y*u,m*a);}if(c&&o&&t){let h=t.lineHeight/u;for(let d=0;d<t.lines.length;d++){let p=(d*t.lineHeight+i/2)/u;s.colorStops.forEach(m=>{let b=p+m.offset*h;l.addColorStop(Math.floor(b*LP)/LP,te.shared.setValue(m.color).toHex());});}}else s.colorStops.forEach(h=>{l.addColorStop(h.offset,te.shared.setValue(h.color).toHex());});return l}}else {let s=e.createPattern(r.texture.source.resource,"repeat"),n=r.matrix.copyTo(G.shared);return n.scale(r.texture.frame.width,r.texture.frame.height),s.setTransform(n),s}return N("FillStyle not recognised",r),"red"}var LP,ng=f(()=>{gt();Te();ye();Be();_o();_h();LP=1e5;});var NP,iT,ds,og=f(()=>{gt();ct();wo();tT();Ro();Eh();ng();NP=new exports.Rectangle,iT=class{getCanvasAndContext(e){let{text:t,style:i,resolution:s=1}=e,n=i._getFinalPadding(),o=It.measureText(t||" ",i),a=Math.ceil(Math.ceil(Math.max(1,o.width)+n*2)*s),u=Math.ceil(Math.ceil(Math.max(1,o.height)+n*2)*s),l=sr.getOptimalCanvasAndContext(a,u);this._renderTextToCanvas(t,i,n,s,l);let c=i.trim?sg({canvas:l.canvas,width:a,height:u,resolution:1,output:NP}):NP.set(0,0,a,u);return {canvasAndContext:l,frame:c}}returnCanvasAndContext(e){sr.returnCanvasAndContext(e);}_renderTextToCanvas(e,t,i,s,n){let{canvas:o,context:a}=n,u=hs(t),l=It.measureText(e||" ",t),c=l.lines,h=l.lineHeight,d=l.lineWidths,p=l.maxLineWidth,m=l.fontProperties,b=o.height;if(a.resetTransform(),a.scale(s,s),a.textBaseline=t.textBaseline,t._stroke?.width){let S=t._stroke;a.lineWidth=S.width,a.miterLimit=S.miterLimit,a.lineJoin=S.join,a.lineCap=S.cap;}a.font=u;let _,g,y=t.dropShadow?2:1;for(let S=0;S<y;++S){let E=t.dropShadow&&S===0,F=E?Math.ceil(Math.max(1,b)+i*2):0,T=F*s;if(E){a.fillStyle="black",a.strokeStyle="black";let P=t.dropShadow,M=P.color,k=P.alpha;a.shadowColor=te.shared.setValue(M).setAlpha(k).toRgbaString();let L=P.blur*s,pe=P.distance*s;a.shadowBlur=L,a.shadowOffsetX=Math.cos(P.angle)*pe,a.shadowOffsetY=Math.sin(P.angle)*pe+T;}else {if(a.fillStyle=t._fill?ln(t._fill,a,l):null,t._stroke?.width){let P=t._stroke.width*t._stroke.alignment;a.strokeStyle=ln(t._stroke,a,l,P);}a.shadowColor="black";}let C=(h-m.fontSize)/2;h-m.fontSize<0&&(C=0);let A=t._stroke?.width??0;for(let P=0;P<c.length;P++)_=A/2,g=A/2+P*h+m.ascent+C,t.align==="right"?_+=p-d[P]:t.align==="center"&&(_+=(p-d[P])/2),t._stroke?.width&&this._drawLetterSpacing(c[P],t,n,_+i,g+i-F,true),t._fill!==void 0&&this._drawLetterSpacing(c[P],t,n,_+i,g+i-F);}}_drawLetterSpacing(e,t,i,s,n,o=false){let{context:a}=i,u=t.letterSpacing,l=false;if(It.experimentalLetterSpacingSupported&&(It.experimentalLetterSpacing?(a.letterSpacing=`${u}px`,a.textLetterSpacing=`${u}px`,l=true):(a.letterSpacing="0px",a.textLetterSpacing="0px")),u===0||l){o?a.strokeText(e,s,n):a.fillText(e,s,n);return}let c=s,h=It.graphemeSegmenter(e),d=a.measureText(e).width,p=0;for(let m=0;m<h.length;++m){let b=h[m];o?a.strokeText(b,c,n):a.fillText(b,c,n);let _="";for(let g=m+1;g<h.length;++g)_+=h[g];p=a.measureText(_).width,c+=d-p+u,d=p;}}},ds=new iT;});var Mo,sT=f(()=>{B();ri();ts();Pe();un();ig();og();Mo=class{constructor(e){this._renderer=e;}getTexture(e,t,i,s){typeof e=="string"&&(U("8.0.0","CanvasTextSystem.getTexture: Use object TextOptions instead of separate arguments"),e={text:e,style:i,resolution:t}),e.style instanceof Mt||(e.style=new Mt(e.style)),e.textureStyle instanceof xt||(e.textureStyle=new xt(e.textureStyle)),typeof e.text!="string"&&(e.text=e.text.toString());let{text:n,style:o,textureStyle:a}=e,u=e.resolution??this._renderer.resolution,{frame:l,canvasAndContext:c}=ds.getCanvasAndContext({text:n,style:o,resolution:u}),h=Yu(c.canvas,l.width,l.height,u);if(a&&(h.source.style=a),o.trim&&(l.pad(o.padding),h.frame.copyFrom(l),h.updateUvs()),o.filters){let d=this._applyFilters(h,o.filters);return this.returnTexture(h),ds.returnCanvasAndContext(c),d}return this._renderer.texture.initSource(h._source),ds.returnCanvasAndContext(c),h}returnTexture(e){let t=e.source;t.resource=null,t.uploadMethodId="unknown",t.alphaMode="no-premultiply-alpha",Me.returnTexture(e,true);}renderTextToCanvas(){U("8.10.0","CanvasTextSystem.renderTextToCanvas: no longer supported, use CanvasTextSystem.getTexture instead");}_applyFilters(e,t){let i=this._renderer.renderTarget.renderTarget,s=this._renderer.filter.generateFilteredTexture({texture:e,filters:t});return this._renderer.renderTarget.bind(i,false),s}destroy(){this._renderer=null;}};Mo.extension={type:[x.WebGLSystem,x.WebGPUSystem,x.CanvasSystem],name:"canvasText"};});var nT=f(()=>{B();Mv();sT();V.add(Mo);V.add(Co);});var cn,ag=f(()=>{Pe();si();Po();cn=class r extends lt{constructor(e){e instanceof dt&&(e={context:e});let{context:t,roundPixels:i,...s}=e||{};super({label:"Graphics",...s}),this.renderPipeId="graphics",t?this._context=t:this._context=this._ownedContext=new dt,this._context.on("update",this.onViewUpdate,this),this.didViewUpdate=true,this.allowChildren=false,this.roundPixels=i??false;}set context(e){e!==this._context&&(this._context.off("update",this.onViewUpdate,this),this._context=e,this._context.on("update",this.onViewUpdate,this),this.onViewUpdate());}get context(){return this._context}get bounds(){return this._context.bounds}updateBounds(){}containsPoint(e){return this._context.containsPoint(e)}destroy(e){this._ownedContext&&!e?this._ownedContext.destroy(e):(e===true||e?.context===true)&&this._context.destroy(e),this._ownedContext=null,this._context=null,super.destroy(e);}_callContextMethod(e,t){return this.context[e](...t),this}setFillStyle(...e){return this._callContextMethod("setFillStyle",e)}setStrokeStyle(...e){return this._callContextMethod("setStrokeStyle",e)}fill(...e){return this._callContextMethod("fill",e)}stroke(...e){return this._callContextMethod("stroke",e)}texture(...e){return this._callContextMethod("texture",e)}beginPath(){return this._callContextMethod("beginPath",[])}cut(){return this._callContextMethod("cut",[])}arc(...e){return this._callContextMethod("arc",e)}arcTo(...e){return this._callContextMethod("arcTo",e)}arcToSvg(...e){return this._callContextMethod("arcToSvg",e)}bezierCurveTo(...e){return this._callContextMethod("bezierCurveTo",e)}closePath(){return this._callContextMethod("closePath",[])}ellipse(...e){return this._callContextMethod("ellipse",e)}circle(...e){return this._callContextMethod("circle",e)}path(...e){return this._callContextMethod("path",e)}lineTo(...e){return this._callContextMethod("lineTo",e)}moveTo(...e){return this._callContextMethod("moveTo",e)}quadraticCurveTo(...e){return this._callContextMethod("quadraticCurveTo",e)}rect(...e){return this._callContextMethod("rect",e)}roundRect(...e){return this._callContextMethod("roundRect",e)}poly(...e){return this._callContextMethod("poly",e)}regularPoly(...e){return this._callContextMethod("regularPoly",e)}roundPoly(...e){return this._callContextMethod("roundPoly",e)}roundShape(...e){return this._callContextMethod("roundShape",e)}filletRect(...e){return this._callContextMethod("filletRect",e)}chamferRect(...e){return this._callContextMethod("chamferRect",e)}star(...e){return this._callContextMethod("star",e)}svg(...e){return this._callContextMethod("svg",e)}restore(...e){return this._callContextMethod("restore",e)}save(){return this._callContextMethod("save",[])}getTransform(){return this.context.getTransform()}resetTransform(){return this._callContextMethod("resetTransform",[])}rotateTransform(...e){return this._callContextMethod("rotate",e)}scaleTransform(...e){return this._callContextMethod("scale",e)}setTransform(...e){return this._callContextMethod("setTransform",e)}transform(...e){return this._callContextMethod("transform",e)}translateTransform(...e){return this._callContextMethod("translate",e)}clear(){return this._callContextMethod("clear",[])}get fillStyle(){return this._context.fillStyle}set fillStyle(e){this._context.fillStyle=e;}get strokeStyle(){return this._context.strokeStyle}set strokeStyle(e){this._context.strokeStyle=e;}clone(e=false){return e?new r(this._context.clone()):(this._ownedContext=null,new r(this._context))}lineStyle(e,t,i){U(Y,"Graphics#lineStyle is no longer needed. Use Graphics#setStrokeStyle to set the stroke style.");let s={};return e&&(s.width=e),t&&(s.color=t),i&&(s.alpha=i),this.context.strokeStyle=s,this}beginFill(e,t){U(Y,"Graphics#beginFill is no longer needed. Use Graphics#fill to fill the shape with the desired style.");let i={};return e!==void 0&&(i.color=e),t!==void 0&&(i.alpha=t),this.context.fillStyle=i,this}endFill(){U(Y,"Graphics#endFill is no longer needed. Use Graphics#fill to fill the shape with the desired style."),this.context.fill();let e=this.context.strokeStyle;return (e.width!==dt.defaultStrokeStyle.width||e.color!==dt.defaultStrokeStyle.color||e.alpha!==dt.defaultStrokeStyle.alpha)&&this.context.stroke(),this}drawCircle(...e){return U(Y,"Graphics#drawCircle has been renamed to Graphics#circle"),this._callContextMethod("circle",e)}drawEllipse(...e){return U(Y,"Graphics#drawEllipse has been renamed to Graphics#ellipse"),this._callContextMethod("ellipse",e)}drawPolygon(...e){return U(Y,"Graphics#drawPolygon has been renamed to Graphics#poly"),this._callContextMethod("poly",e)}drawRect(...e){return U(Y,"Graphics#drawRect has been renamed to Graphics#rect"),this._callContextMethod("rect",e)}drawRoundedRect(...e){return U(Y,"Graphics#drawRoundedRect has been renamed to Graphics#roundRect"),this._callContextMethod("roundRect",e)}drawStar(...e){return U(Y,"Graphics#drawStar has been renamed to Graphics#star"),this._callContextMethod("star",e)}};});var ug,lg,oT=f(()=>{ug={name:"local-uniform-msdf-bit",vertex:{header:`
376
376
  struct LocalUniforms {
377
377
  uColor:vec4<f32>,
@@ -469,10 +469,10 @@ fn mainFragment(
469
469
 
470
470
  return coverage;
471
471
  }
472
- `}};});var uT,lT,ju,cT=f(()=>{Te();as();Cu();Au();us();nh();Wr();ht();oT();aT();ju=class extends rt{constructor(e){let t=new xe({uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uTransformMatrix:{value:new G,type:"mat3x3<f32>"},uDistance:{value:4,type:"f32"},uRound:{value:0,type:"f32"}});uT??(uT=Nr({name:"sdf-shader",bits:[Ks,Qs(e),ug,cg,Vr]})),lT??(lT=Hr({name:"sdf-shader",bits:[Zs,Js(e),lg,hg,zr]})),super({glProgram:lT,gpuProgram:uT,resources:{localUniforms:t,batchSamplers:en(e)}});}};});var hn,dg=f(()=>{Ut();Pe();hn=class extends _e{constructor(){super(...arguments),this.chars=Object.create(null),this.lineHeight=0,this.fontFamily="",this.fontMetrics={fontSize:0,ascent:0,descent:0},this.baseLineOffset=0,this.distanceField={type:"none",range:0},this.pages=[],this.applyFillAsTint=true,this.baseMeasurementFontSize=100,this.baseRenderedFontSize=100;}get font(){return U(Y,"BitmapFont.font is deprecated, please use BitmapFont.fontFamily instead."),this.fontFamily}get pageTextures(){return U(Y,"BitmapFont.pageTextures is deprecated, please use BitmapFont.pages instead."),this.pages}get size(){return U(Y,"BitmapFont.size is deprecated, please use BitmapFont.fontMetrics.fontSize instead."),this.fontMetrics.fontSize}get distanceFieldRange(){return U(Y,"BitmapFont.distanceFieldRange is deprecated, please use BitmapFont.distanceField.range instead."),this.distanceField.range}get distanceFieldType(){return U(Y,"BitmapFont.distanceFieldType is deprecated, please use BitmapFont.distanceField.type instead."),this.distanceField.type}destroy(e=false){this.emit("destroy",this),this.removeAllListeners();for(let t in this.chars)this.chars[t].texture?.destroy();this.chars=null,e&&(this.pages.forEach(t=>t.texture.destroy(true)),this.pages=null);}};});var HP,Ch,hT=f(()=>{gt();ct();wo();fo();ye();ts();Pe();Ro();Eh();ng();un();dg();HP=class VP extends hn{constructor(e){super(),this.resolution=1,this.pages=[],this._padding=0,this._measureCache=Object.create(null),this._currentChars=[],this._currentX=0,this._currentY=0,this._currentMaxCharHeight=0,this._currentPageIndex=-1,this._skipKerning=false;let t={...VP.defaultOptions,...e};this._textureSize=t.textureSize,this._mipmap=t.mipmap;let i=t.style.clone();t.overrideFill&&(i._fill.color=16777215,i._fill.alpha=1,i._fill.texture=exports.Texture.WHITE,i._fill.fill=null),this.applyFillAsTint=t.overrideFill;let s=i.fontSize;i.fontSize=this.baseMeasurementFontSize;let n=hs(i);t.overrideSize?i._stroke&&(i._stroke.width*=this.baseRenderedFontSize/s):i.fontSize=this.baseRenderedFontSize=s,this._style=i,this._skipKerning=t.skipKerning??false,this.resolution=t.resolution??1,this._padding=t.padding??4,t.textureStyle&&(this._textureStyle=t.textureStyle instanceof xt?t.textureStyle:new xt(t.textureStyle)),this.fontMetrics=It.measureFont(n),this.lineHeight=i.lineHeight||this.fontMetrics.fontSize||i.fontSize;}ensureCharacters(e){let t=It.graphemeSegmenter(e).filter(_=>!this._currentChars.includes(_)).filter((_,g,y)=>y.indexOf(_)===g);if(!t.length)return;this._currentChars=[...this._currentChars,...t];let i;this._currentPageIndex===-1?i=this._nextPage():i=this.pages[this._currentPageIndex];let{canvas:s,context:n}=i.canvasAndContext,o=i.texture.source,a=this._style,u=this._currentX,l=this._currentY,c=this._currentMaxCharHeight,h=this.baseRenderedFontSize/this.baseMeasurementFontSize,d=this._padding*h,p=false,m=s.width/this.resolution,b=s.height/this.resolution;for(let _=0;_<t.length;_++){let g=t[_],y=It.measureText(g,a,s,false);y.lineHeight=y.height;let S=y.width*h,E=Math.ceil((a.fontStyle==="italic"?2:1)*S),F=y.height*h,T=E+d*2,C=F+d*2;if(p=false,g!==`
472
+ `}};});var uT,lT,ju,cT=f(()=>{Te();as();Cu();Au();us();nh();zr();ht();oT();aT();ju=class extends rt{constructor(e){let t=new xe({uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uTransformMatrix:{value:new G,type:"mat3x3<f32>"},uDistance:{value:4,type:"f32"},uRound:{value:0,type:"f32"}});uT??(uT=Lr({name:"sdf-shader",bits:[Ks,Qs(e),ug,cg,Hr]})),lT??(lT=Nr({name:"sdf-shader",bits:[Zs,Js(e),lg,hg,Vr]})),super({glProgram:lT,gpuProgram:uT,resources:{localUniforms:t,batchSamplers:en(e)}});}};});var hn,dg=f(()=>{Ut();Pe();hn=class extends _e{constructor(){super(...arguments),this.chars=Object.create(null),this.lineHeight=0,this.fontFamily="",this.fontMetrics={fontSize:0,ascent:0,descent:0},this.baseLineOffset=0,this.distanceField={type:"none",range:0},this.pages=[],this.applyFillAsTint=true,this.baseMeasurementFontSize=100,this.baseRenderedFontSize=100;}get font(){return U(Y,"BitmapFont.font is deprecated, please use BitmapFont.fontFamily instead."),this.fontFamily}get pageTextures(){return U(Y,"BitmapFont.pageTextures is deprecated, please use BitmapFont.pages instead."),this.pages}get size(){return U(Y,"BitmapFont.size is deprecated, please use BitmapFont.fontMetrics.fontSize instead."),this.fontMetrics.fontSize}get distanceFieldRange(){return U(Y,"BitmapFont.distanceFieldRange is deprecated, please use BitmapFont.distanceField.range instead."),this.distanceField.range}get distanceFieldType(){return U(Y,"BitmapFont.distanceFieldType is deprecated, please use BitmapFont.distanceField.type instead."),this.distanceField.type}destroy(e=false){this.emit("destroy",this),this.removeAllListeners();for(let t in this.chars)this.chars[t].texture?.destroy();this.chars=null,e&&(this.pages.forEach(t=>t.texture.destroy(true)),this.pages=null);}};});var HP,Ch,hT=f(()=>{gt();ct();wo();fo();ye();ts();Pe();Ro();Eh();ng();un();dg();HP=class VP extends hn{constructor(e){super(),this.resolution=1,this.pages=[],this._padding=0,this._measureCache=Object.create(null),this._currentChars=[],this._currentX=0,this._currentY=0,this._currentMaxCharHeight=0,this._currentPageIndex=-1,this._skipKerning=false;let t={...VP.defaultOptions,...e};this._textureSize=t.textureSize,this._mipmap=t.mipmap;let i=t.style.clone();t.overrideFill&&(i._fill.color=16777215,i._fill.alpha=1,i._fill.texture=exports.Texture.WHITE,i._fill.fill=null),this.applyFillAsTint=t.overrideFill;let s=i.fontSize;i.fontSize=this.baseMeasurementFontSize;let n=hs(i);t.overrideSize?i._stroke&&(i._stroke.width*=this.baseRenderedFontSize/s):i.fontSize=this.baseRenderedFontSize=s,this._style=i,this._skipKerning=t.skipKerning??false,this.resolution=t.resolution??1,this._padding=t.padding??4,t.textureStyle&&(this._textureStyle=t.textureStyle instanceof xt?t.textureStyle:new xt(t.textureStyle)),this.fontMetrics=It.measureFont(n),this.lineHeight=i.lineHeight||this.fontMetrics.fontSize||i.fontSize;}ensureCharacters(e){let t=It.graphemeSegmenter(e).filter(_=>!this._currentChars.includes(_)).filter((_,g,y)=>y.indexOf(_)===g);if(!t.length)return;this._currentChars=[...this._currentChars,...t];let i;this._currentPageIndex===-1?i=this._nextPage():i=this.pages[this._currentPageIndex];let{canvas:s,context:n}=i.canvasAndContext,o=i.texture.source,a=this._style,u=this._currentX,l=this._currentY,c=this._currentMaxCharHeight,h=this.baseRenderedFontSize/this.baseMeasurementFontSize,d=this._padding*h,p=false,m=s.width/this.resolution,b=s.height/this.resolution;for(let _=0;_<t.length;_++){let g=t[_],y=It.measureText(g,a,s,false);y.lineHeight=y.height;let S=y.width*h,E=Math.ceil((a.fontStyle==="italic"?2:1)*S),F=y.height*h,T=E+d*2,C=F+d*2;if(p=false,g!==`
473
473
  `&&g!=="\r"&&g!==" "&&g!==" "&&(p=true,c=Math.ceil(Math.max(C,c))),u+T>m&&(l+=c,c=C,u=0,l+c>b)){o.update();let P=this._nextPage();s=P.canvasAndContext.canvas,n=P.canvasAndContext.context,o=P.texture.source,u=0,l=0,c=0;}let A=S/h-(a.dropShadow?.distance??0)-(a._stroke?.width??0);if(this.chars[g]={id:g.codePointAt(0),xOffset:-this._padding,yOffset:-this._padding,xAdvance:A,kerning:{}},p){this._drawGlyph(n,y,u+d,l+d,h,a);let P=o.width*h,M=o.height*h,k=new exports.Rectangle(u/P*o.width,l/M*o.height,T/P*o.width,C/M*o.height);this.chars[g].texture=new exports.Texture({source:o,frame:k}),u+=Math.ceil(T);}}o.update(),this._currentX=u,this._currentY=l,this._currentMaxCharHeight=c,this._skipKerning&&this._applyKerning(t,n);}get pageTextures(){return U(Y,"BitmapFont.pageTextures is deprecated, please use BitmapFont.pages instead."),this.pages}_applyKerning(e,t){let i=this._measureCache;for(let s=0;s<e.length;s++){let n=e[s];for(let o=0;o<this._currentChars.length;o++){let a=this._currentChars[o],u=i[n];u||(u=i[n]=t.measureText(n).width);let l=i[a];l||(l=i[a]=t.measureText(a).width);let c=t.measureText(n+a).width,h=c-(u+l);h&&(this.chars[n].kerning[a]=h),c=t.measureText(n+a).width,h=c-(u+l),h&&(this.chars[a].kerning[n]=h);}}}_nextPage(){this._currentPageIndex++;let e=this.resolution,t=sr.getOptimalCanvasAndContext(this._textureSize,this._textureSize,e);this._setupContext(t.context,this._style,e);let i=e*(this.baseRenderedFontSize/this.baseMeasurementFontSize),s=new exports.Texture({source:new Yt({resource:t.canvas,resolution:i,alphaMode:"premultiply-alpha-on-upload",autoGenerateMipmaps:this._mipmap})});this._textureStyle&&(s.source.style=this._textureStyle);let n={canvasAndContext:t,texture:s};return this.pages[this._currentPageIndex]=n,n}_setupContext(e,t,i){t.fontSize=this.baseRenderedFontSize,e.scale(i,i),e.font=hs(t),t.fontSize=this.baseMeasurementFontSize,e.textBaseline=t.textBaseline;let s=t._stroke,n=s?.width??0;if(s&&(e.lineWidth=n,e.lineJoin=s.join,e.miterLimit=s.miterLimit,e.strokeStyle=ln(s,e)),t._fill&&(e.fillStyle=ln(t._fill,e)),t.dropShadow){let o=t.dropShadow,a=te.shared.setValue(o.color).toArray(),u=o.blur*i,l=o.distance*i;e.shadowColor=`rgba(${a[0]*255},${a[1]*255},${a[2]*255},${o.alpha})`,e.shadowBlur=u,e.shadowOffsetX=Math.cos(o.angle)*l,e.shadowOffsetY=Math.sin(o.angle)*l;}else e.shadowColor="black",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0;}_drawGlyph(e,t,i,s,n,o){let a=t.text,u=t.fontProperties,c=(o._stroke?.width??0)*n,h=i+c/2,d=s-c/2,p=u.descent*n,m=t.lineHeight*n;o.stroke&&c&&e.strokeText(a,h,d+m-p),o._fill&&e.fillText(a,h,d+m-p);}destroy(){super.destroy();for(let e=0;e<this.pages.length;e++){let{canvasAndContext:t,texture:i}=this.pages[e];sr.returnCanvasAndContext(t),i.destroy(true);}this.pages=null;}};HP.defaultOptions={textureSize:512,style:new Mt,mipmap:true};Ch=HP;});function $u(r,e,t,i){let s={width:0,height:0,offsetY:0,scale:e.fontSize/t.baseMeasurementFontSize,lines:[{width:0,charPositions:[],spaceWidth:0,spacesIndex:[],chars:[]}]};s.offsetY=t.baseLineOffset;let n=s.lines[0],o=null,a=true,u={width:0,start:0,index:0,positions:[],chars:[]},l=m=>{let b=n.width;for(let _=0;_<u.index;_++){let g=m.positions[_];n.chars.push(m.chars[_]),n.charPositions.push(g+b);}n.width+=m.width,a=false,u.width=0,u.index=0,u.chars.length=0;},c=()=>{let m=n.chars.length-1;if(i){let b=n.chars[m];for(;b===" ";)n.width-=t.chars[b].xAdvance,b=n.chars[--m];}s.width=Math.max(s.width,n.width),n={width:0,charPositions:[],chars:[],spaceWidth:0,spacesIndex:[]},a=true,s.lines.push(n),s.height+=t.lineHeight;},h=t.baseMeasurementFontSize/e.fontSize,d=e.letterSpacing*h,p=e.wordWrapWidth*h;for(let m=0;m<r.length+1;m++){let b,_=m===r.length;_||(b=r[m]);let g=t.chars[b]||t.chars[" "];if(/(?:\s)/.test(b)||b==="\r"||b===`
474
474
  `||_){if(!a&&e.wordWrap&&n.width+u.width-d>p?(c(),l(u),_||n.charPositions.push(0)):(u.start=n.width,l(u),_||n.charPositions.push(0)),b==="\r"||b===`
475
- `)n.width!==0&&c();else if(!_){let F=g.xAdvance+(g.kerning[o]||0)+d;n.width+=F,n.spaceWidth=F,n.spacesIndex.push(n.charPositions.length),n.chars.push(b);}}else {let E=g.kerning[o]||0,F=g.xAdvance+E+d;u.positions[u.index++]=u.width+E,u.chars.push(b),u.width+=F;}o=b;}return c(),e.align==="center"?Rk(s):e.align==="right"?Mk(s):e.align==="justify"&&Ik(s),s}function Rk(r){for(let e=0;e<r.lines.length;e++){let t=r.lines[e],i=r.width/2-t.width/2;for(let s=0;s<t.charPositions.length;s++)t.charPositions[s]+=i;}}function Mk(r){for(let e=0;e<r.lines.length;e++){let t=r.lines[e],i=r.width-t.width;for(let s=0;s<t.charPositions.length;s++)t.charPositions[s]+=i;}}function Ik(r){let e=r.width;for(let t=0;t<r.lines.length;t++){let i=r.lines[t],s=0,n=i.spacesIndex[s++],o=0,a=i.spacesIndex.length,l=(e-i.width)/a;for(let c=0;c<i.charPositions.length;c++)c===n&&(n=i.spacesIndex[s++],o+=l),i.charPositions[c]+=o;}}var fg=f(()=>{});function pg(r){if(r==="")return [];typeof r=="string"&&(r=[r]);let e=[];for(let t=0,i=r.length;t<i;t++){let s=r[t];if(Array.isArray(s)){if(s.length!==2)throw new Error(`[BitmapFont]: Invalid character range length, expecting 2 got ${s.length}.`);if(s[0].length===0||s[1].length===0)throw new Error("[BitmapFont]: Invalid character delimiter.");let n=s[0].charCodeAt(0),o=s[1].charCodeAt(0);if(o<n)throw new Error("[BitmapFont]: Invalid character range.");for(let a=n,u=o;a<=u;a++)e.push(String.fromCharCode(a));}else e.push(...Array.from(s));}if(e.length===0)throw new Error("[BitmapFont]: Empty set when resolving characters.");return e}var dT=f(()=>{});var mg,fT,fs,Ah=f(()=>{Ai();Pe();Be();Ro();un();hT();fg();dT();mg=0,fT=class{constructor(){this.ALPHA=[["a","z"],["A","Z"]," "],this.NUMERIC=[["0","9"]],this.ALPHANUMERIC=[["a","z"],["A","Z"],["0","9"]," "],this.ASCII=[[" ","~"]],this.defaultOptions={chars:this.ALPHANUMERIC,resolution:1,padding:4,skipKerning:false,textureStyle:null};}getFont(e,t){let i=`${t.fontFamily}-bitmap`,s=true;if(t._fill.fill&&!t._stroke)i+=t._fill.fill.styleKey,s=false;else if(t._stroke||t.dropShadow){let o=t.styleKey;o=o.substring(0,o.lastIndexOf("-")),i=`${o}-bitmap`,s=false;}if(!Se.has(i)){let o=new Ch({style:t,overrideFill:s,overrideSize:true,...this.defaultOptions});mg++,mg>50&&N("BitmapText",`You have dynamically created ${mg} bitmap fonts, this can be inefficient. Try pre installing your font styles using \`BitmapFont.install({name:"style1", style})\``),o.once("destroy",()=>{mg--,Se.remove(i);}),Se.set(i,o);}let n=Se.get(i);return n.ensureCharacters?.(e),n}getLayout(e,t,i=true){let s=this.getFont(e,t),n=It.graphemeSegmenter(e);return $u(n,t,s,i)}measureText(e,t,i=true){return this.getLayout(e,t,i)}install(...e){let t=e[0];typeof t=="string"&&(t={name:t,style:e[1],chars:e[2]?.chars,resolution:e[2]?.resolution,padding:e[2]?.padding,skipKerning:e[2]?.skipKerning},U(Y,"BitmapFontManager.install(name, style, options) is deprecated, use BitmapFontManager.install({name, style, ...options})"));let i=t?.name;if(!i)throw new Error("[BitmapFontManager] Property `name` is required.");t={...this.defaultOptions,...t};let s=t.style,n=s instanceof Mt?s:new Mt(s),o=n._fill.fill!==null&&n._fill.fill!==void 0,a=new Ch({style:n,overrideFill:o,skipKerning:t.skipKerning,padding:t.padding,resolution:t.resolution,overrideSize:false,textureStyle:t.textureStyle}),u=pg(t.chars);return a.ensureCharacters(u.join("")),Se.set(`${i}-bitmap`,a),a.once("destroy",()=>Se.remove(`${i}-bitmap`)),a}uninstall(e){let t=`${e}-bitmap`,i=Se.get(t);i&&i.destroy();}},fs=new fT;});function zP(r,e){e.groupTransform=r.groupTransform,e.groupColorAlpha=r.groupColorAlpha,e.groupColor=r.groupColor,e.groupBlendMode=r.groupBlendMode,e.globalDisplayStatus=r.globalDisplayStatus,e.groupTransform=r.groupTransform,e.localDisplayStatus=r.localDisplayStatus,e.groupAlpha=r.groupAlpha,e._roundPixels=r._roundPixels;}var Ph,Io,pT=f(()=>{Ai();B();ag();Ro();cT();Ah();fg();Ph=class extends cn{destroy(){this.context.customShader&&this.context.customShader.destroy(),super.destroy();}},Io=class{constructor(e){this._renderer=e,this._renderer.renderableGC.addManagedHash(this,"_gpuBitmapText");}validateRenderable(e){let t=this._getGpuBitmapText(e);return e._didTextUpdate&&(e._didTextUpdate=false,this._updateContext(e,t)),this._renderer.renderPipes.graphics.validateRenderable(t)}addRenderable(e,t){let i=this._getGpuBitmapText(e);zP(e,i),e._didTextUpdate&&(e._didTextUpdate=false,this._updateContext(e,i)),this._renderer.renderPipes.graphics.addRenderable(i,t),i.context.customShader&&this._updateDistanceField(e);}updateRenderable(e){let t=this._getGpuBitmapText(e);zP(e,t),this._renderer.renderPipes.graphics.updateRenderable(t),t.context.customShader&&this._updateDistanceField(e);}_updateContext(e,t){let{context:i}=t,s=fs.getFont(e.text,e._style);i.clear(),s.distanceField.type!=="none"&&(i.customShader||(i.customShader=new ju(this._renderer.limits.maxBatchableTextures)));let n=It.graphemeSegmenter(e.text),o=e._style,a=s.baseLineOffset,u=$u(n,o,s,true),l=0,c=o.padding,h=u.scale,d=u.width,p=u.height+u.offsetY;o._stroke&&(d+=o._stroke.width/h,p+=o._stroke.width/h),i.translate(-e._anchor._x*d-c,-e._anchor._y*p-c).scale(h,h);let m=s.applyFillAsTint?o._fill.color:16777215;for(let b=0;b<u.lines.length;b++){let _=u.lines[b];for(let g=0;g<_.charPositions.length;g++){let y=n[l++],S=s.chars[y];S?.texture&&i.texture(S.texture,m||"black",Math.round(_.charPositions[g]+S.xOffset),Math.round(a+S.yOffset));}a+=s.lineHeight;}}_getGpuBitmapText(e){return e._gpuData[this._renderer.uid]||this.initGpuText(e)}initGpuText(e){let t=new Ph;return e._gpuData[this._renderer.uid]=t,this._updateContext(e,t),t}_updateDistanceField(e){let t=this._getGpuBitmapText(e).context,i=e._style.fontFamily,s=Se.get(`${i}-bitmap`),{a:n,b:o,c:a,d:u}=e.groupTransform,l=Math.sqrt(n*n+o*o),c=Math.sqrt(a*a+u*u),h=(Math.abs(l)+Math.abs(c))/2,d=s.baseRenderedFontSize/e._style.fontSize,p=h*s.distanceField.range*(1/d);t.customShader.resources.localUniforms.uniforms.uDistance=p;}destroy(){this._renderer=null;}};Io.extension={type:[x.WebGLPipes,x.WebGPUPipes,x.CanvasPipes],name:"bitmapText"};});var mT=f(()=>{B();pT();V.add(Io);});var qu,gT=f(()=>{Fu();qu=class extends Yr{constructor(e){super(),this.generatingTexture=false,this._renderer=e,e.runners.resolutionChange.add(this);}resolutionChange(){let e=this.renderable;e._autoResolution&&e.onViewUpdate();}destroy(){this._renderer.htmlText.returnTexturePromise(this.texturePromise),this.texturePromise=null,this._renderer=null;}};});var Do,xT=f(()=>{B();ye();Um();gT();Do=class{constructor(e){this._renderer=e;}validateRenderable(e){return e._didTextUpdate}addRenderable(e,t){let i=this._getGpuText(e);e._didTextUpdate&&(this._updateGpuText(e).catch(s=>{console.error(s);}),e._didTextUpdate=false,Eo(i,e)),this._renderer.renderPipes.batch.addToBatch(i,t);}updateRenderable(e){let t=this._getGpuText(e);t._batcher.updateElement(t);}async _updateGpuText(e){e._didTextUpdate=false;let t=this._getGpuText(e);if(t.generatingTexture)return;t.texturePromise&&(this._renderer.htmlText.returnTexturePromise(t.texturePromise),t.texturePromise=null),t.generatingTexture=true,e._resolution=e._autoResolution?this._renderer.resolution:e.resolution;let i=this._renderer.htmlText.getTexturePromise(e);t.texturePromise=i,t.texture=await i;let s=e.renderGroup||e.parentRenderGroup;s&&(s.structureDidChange=true),t.generatingTexture=false,Eo(t,e);}_getGpuText(e){return e._gpuData[this._renderer.uid]||this.initGpuText(e)}initGpuText(e){let t=new qu(this._renderer);return t.renderable=e,t.transform=e.groupTransform,t.texture=exports.Texture.EMPTY,t.bounds={minX:0,maxX:1,minY:0,maxY:0},t.roundPixels=this._renderer._roundPixels|e._roundPixels,e._resolution=e._autoResolution?this._renderer.resolution:e.resolution,e._gpuData[this._renderer.uid]=t,t}destroy(){this._renderer=null;}};Do.extension={type:[x.WebGLPipes,x.WebGPUPipes,x.CanvasPipes],name:"htmlText"};});function gg(){let{userAgent:r}=j.get().getNavigator();return /^((?!chrome|android).)*safari/i.test(r)}var _T=f(()=>{Ge();});var WP,XP,dn,xg=f(()=>{WP="http://www.w3.org/2000/svg",XP="http://www.w3.org/1999/xhtml",dn=class{constructor(){this.svgRoot=document.createElementNS(WP,"svg"),this.foreignObject=document.createElementNS(WP,"foreignObject"),this.domElement=document.createElementNS(XP,"div"),this.styleElement=document.createElementNS(XP,"style"),this.image=new Image;let{foreignObject:e,svgRoot:t,styleElement:i,domElement:s}=this;e.setAttribute("width","10000"),e.setAttribute("height","10000"),e.style.overflow="hidden",t.appendChild(e),e.appendChild(i),e.appendChild(s);}};});function _g(r){let e=r._stroke,t=r._fill,s=[`div { ${[`color: ${te.shared.setValue(t.color).toHex()}`,`font-size: ${r.fontSize}px`,`font-family: ${r.fontFamily}`,`font-weight: ${r.fontWeight}`,`font-style: ${r.fontStyle}`,`font-variant: ${r.fontVariant}`,`letter-spacing: ${r.letterSpacing}px`,`text-align: ${r.align}`,`padding: ${r.padding}px`,`white-space: ${r.whiteSpace==="pre"&&r.wordWrap?"pre-wrap":r.whiteSpace}`,...r.lineHeight?[`line-height: ${r.lineHeight}px`]:[],...r.wordWrap?[`word-wrap: ${r.breakWords?"break-all":"break-word"}`,`max-width: ${r.wordWrapWidth}px`]:[],...e?[qP(e)]:[],...r.dropShadow?[$P(r.dropShadow)]:[],...r.cssOverrides].join(";")} }`];return Dk(r.tagStyles,s),s.join(" ")}function $P(r){let e=te.shared.setValue(r.color).setAlpha(r.alpha).toHexa(),t=Math.round(Math.cos(r.angle)*r.distance),i=Math.round(Math.sin(r.angle)*r.distance),s=`${t}px ${i}px`;return r.blur>0?`text-shadow: ${s} ${r.blur}px ${e}`:`text-shadow: ${s} ${e}`}function qP(r){return [`-webkit-text-stroke-width: ${r.width}px`,`-webkit-text-stroke-color: ${te.shared.setValue(r.color).toHex()}`,`text-stroke-width: ${r.width}px`,`text-stroke-color: ${te.shared.setValue(r.color).toHex()}`,"paint-order: stroke"].join(";")}function Dk(r,e){for(let t in r){let i=r[t],s=[];for(let n in i)jP[n]?s.push(jP[n](i[n])):YP[n]&&s.push(YP[n].replace("{{VALUE}}",i[n]));e.push(`${t} { ${s.join(";")} }`);}}var YP,jP,bT=f(()=>{gt();YP={fontSize:"font-size: {{VALUE}}px",fontFamily:"font-family: {{VALUE}}",fontWeight:"font-weight: {{VALUE}}",fontStyle:"font-style: {{VALUE}}",fontVariant:"font-variant: {{VALUE}}",letterSpacing:"letter-spacing: {{VALUE}}px",align:"text-align: {{VALUE}}",padding:"padding: {{VALUE}}px",whiteSpace:"white-space: {{VALUE}}",lineHeight:"line-height: {{VALUE}}px",wordWrapWidth:"max-width: {{VALUE}}px"},jP={fill:r=>`color: ${te.shared.setValue(r).toHex()}`,breakWords:r=>`word-wrap: ${r?"break-all":"break-word"}`,stroke:qP,dropShadow:$P};});var fn,bg=f(()=>{Be();un();bT();fn=class r extends Mt{constructor(e={}){super(e),this._cssOverrides=[],this.cssOverrides=e.cssOverrides??[],this.tagStyles=e.tagStyles??{};}set cssOverrides(e){this._cssOverrides=e instanceof Array?e:[e],this.update();}get cssOverrides(){return this._cssOverrides}update(){this._cssStyle=null,super.update();}clone(){return new r({align:this.align,breakWords:this.breakWords,dropShadow:this.dropShadow?{...this.dropShadow}:null,fill:this._fill,fontFamily:this.fontFamily,fontSize:this.fontSize,fontStyle:this.fontStyle,fontVariant:this.fontVariant,fontWeight:this.fontWeight,letterSpacing:this.letterSpacing,lineHeight:this.lineHeight,padding:this.padding,stroke:this._stroke,whiteSpace:this.whiteSpace,wordWrap:this.wordWrap,wordWrapWidth:this.wordWrapWidth,cssOverrides:this.cssOverrides,tagStyles:{...this.tagStyles}})}get cssStyle(){return this._cssStyle||(this._cssStyle=_g(this)),this._cssStyle}addOverride(...e){let t=e.filter(i=>!this.cssOverrides.includes(i));t.length>0&&(this.cssOverrides.push(...t),this.update());}removeOverride(...e){let t=e.filter(i=>this.cssOverrides.includes(i));t.length>0&&(this.cssOverrides=this.cssOverrides.filter(i=>!t.includes(i)),this.update());}set fill(e){typeof e!="string"&&typeof e!="number"&&N("[HTMLTextStyle] only color fill is not supported by HTMLText"),super.fill=e;}set stroke(e){e&&typeof e!="string"&&typeof e!="number"&&N("[HTMLTextStyle] only color stroke is not supported by HTMLText"),super.stroke=e;}};});function yg(r,e){let t=e.fontFamily,i=[],s={},n=/font-family:([^;"\s]+)/g,o=r.match(n);function a(u){s[u]||(i.push(u),s[u]=true);}if(Array.isArray(t))for(let u=0;u<t.length;u++)a(t[u]);else a(t);o&&o.forEach(u=>{let l=u.split(":")[1].trim();a(l);});for(let u in e.tagStyles){let l=e.tagStyles[u].fontFamily;a(l);}return i}var yT=f(()=>{});async function vg(r){let t=await(await j.get().fetch(r)).blob(),i=new FileReader;return await new Promise((n,o)=>{i.onloadend=()=>n(i.result),i.onerror=o,i.readAsDataURL(t);})}var vT=f(()=>{Ge();});async function wh(r,e){let t=await vg(e);return `@font-face {
475
+ `)n.width!==0&&c();else if(!_){let F=g.xAdvance+(g.kerning[o]||0)+d;n.width+=F,n.spaceWidth=F,n.spacesIndex.push(n.charPositions.length),n.chars.push(b);}}else {let E=g.kerning[o]||0,F=g.xAdvance+E+d;u.positions[u.index++]=u.width+E,u.chars.push(b),u.width+=F;}o=b;}return c(),e.align==="center"?Rk(s):e.align==="right"?Mk(s):e.align==="justify"&&Ik(s),s}function Rk(r){for(let e=0;e<r.lines.length;e++){let t=r.lines[e],i=r.width/2-t.width/2;for(let s=0;s<t.charPositions.length;s++)t.charPositions[s]+=i;}}function Mk(r){for(let e=0;e<r.lines.length;e++){let t=r.lines[e],i=r.width-t.width;for(let s=0;s<t.charPositions.length;s++)t.charPositions[s]+=i;}}function Ik(r){let e=r.width;for(let t=0;t<r.lines.length;t++){let i=r.lines[t],s=0,n=i.spacesIndex[s++],o=0,a=i.spacesIndex.length,l=(e-i.width)/a;for(let c=0;c<i.charPositions.length;c++)c===n&&(n=i.spacesIndex[s++],o+=l),i.charPositions[c]+=o;}}var fg=f(()=>{});function pg(r){if(r==="")return [];typeof r=="string"&&(r=[r]);let e=[];for(let t=0,i=r.length;t<i;t++){let s=r[t];if(Array.isArray(s)){if(s.length!==2)throw new Error(`[BitmapFont]: Invalid character range length, expecting 2 got ${s.length}.`);if(s[0].length===0||s[1].length===0)throw new Error("[BitmapFont]: Invalid character delimiter.");let n=s[0].charCodeAt(0),o=s[1].charCodeAt(0);if(o<n)throw new Error("[BitmapFont]: Invalid character range.");for(let a=n,u=o;a<=u;a++)e.push(String.fromCharCode(a));}else e.push(...Array.from(s));}if(e.length===0)throw new Error("[BitmapFont]: Empty set when resolving characters.");return e}var dT=f(()=>{});var mg,fT,fs,Ah=f(()=>{Ai();Pe();Be();Ro();un();hT();fg();dT();mg=0,fT=class{constructor(){this.ALPHA=[["a","z"],["A","Z"]," "],this.NUMERIC=[["0","9"]],this.ALPHANUMERIC=[["a","z"],["A","Z"],["0","9"]," "],this.ASCII=[[" ","~"]],this.defaultOptions={chars:this.ALPHANUMERIC,resolution:1,padding:4,skipKerning:false,textureStyle:null};}getFont(e,t){let i=`${t.fontFamily}-bitmap`,s=true;if(t._fill.fill&&!t._stroke)i+=t._fill.fill.styleKey,s=false;else if(t._stroke||t.dropShadow){let o=t.styleKey;o=o.substring(0,o.lastIndexOf("-")),i=`${o}-bitmap`,s=false;}if(!Se.has(i)){let o=new Ch({style:t,overrideFill:s,overrideSize:true,...this.defaultOptions});mg++,mg>50&&N("BitmapText",`You have dynamically created ${mg} bitmap fonts, this can be inefficient. Try pre installing your font styles using \`BitmapFont.install({name:"style1", style})\``),o.once("destroy",()=>{mg--,Se.remove(i);}),Se.set(i,o);}let n=Se.get(i);return n.ensureCharacters?.(e),n}getLayout(e,t,i=true){let s=this.getFont(e,t),n=It.graphemeSegmenter(e);return $u(n,t,s,i)}measureText(e,t,i=true){return this.getLayout(e,t,i)}install(...e){let t=e[0];typeof t=="string"&&(t={name:t,style:e[1],chars:e[2]?.chars,resolution:e[2]?.resolution,padding:e[2]?.padding,skipKerning:e[2]?.skipKerning},U(Y,"BitmapFontManager.install(name, style, options) is deprecated, use BitmapFontManager.install({name, style, ...options})"));let i=t?.name;if(!i)throw new Error("[BitmapFontManager] Property `name` is required.");t={...this.defaultOptions,...t};let s=t.style,n=s instanceof Mt?s:new Mt(s),o=n._fill.fill!==null&&n._fill.fill!==void 0,a=new Ch({style:n,overrideFill:o,skipKerning:t.skipKerning,padding:t.padding,resolution:t.resolution,overrideSize:false,textureStyle:t.textureStyle}),u=pg(t.chars);return a.ensureCharacters(u.join("")),Se.set(`${i}-bitmap`,a),a.once("destroy",()=>Se.remove(`${i}-bitmap`)),a}uninstall(e){let t=`${e}-bitmap`,i=Se.get(t);i&&i.destroy();}},fs=new fT;});function zP(r,e){e.groupTransform=r.groupTransform,e.groupColorAlpha=r.groupColorAlpha,e.groupColor=r.groupColor,e.groupBlendMode=r.groupBlendMode,e.globalDisplayStatus=r.globalDisplayStatus,e.groupTransform=r.groupTransform,e.localDisplayStatus=r.localDisplayStatus,e.groupAlpha=r.groupAlpha,e._roundPixels=r._roundPixels;}var Ph,Io,pT=f(()=>{Ai();B();ag();Ro();cT();Ah();fg();Ph=class extends cn{destroy(){this.context.customShader&&this.context.customShader.destroy(),super.destroy();}},Io=class{constructor(e){this._renderer=e,this._renderer.renderableGC.addManagedHash(this,"_gpuBitmapText");}validateRenderable(e){let t=this._getGpuBitmapText(e);return e._didTextUpdate&&(e._didTextUpdate=false,this._updateContext(e,t)),this._renderer.renderPipes.graphics.validateRenderable(t)}addRenderable(e,t){let i=this._getGpuBitmapText(e);zP(e,i),e._didTextUpdate&&(e._didTextUpdate=false,this._updateContext(e,i)),this._renderer.renderPipes.graphics.addRenderable(i,t),i.context.customShader&&this._updateDistanceField(e);}updateRenderable(e){let t=this._getGpuBitmapText(e);zP(e,t),this._renderer.renderPipes.graphics.updateRenderable(t),t.context.customShader&&this._updateDistanceField(e);}_updateContext(e,t){let{context:i}=t,s=fs.getFont(e.text,e._style);i.clear(),s.distanceField.type!=="none"&&(i.customShader||(i.customShader=new ju(this._renderer.limits.maxBatchableTextures)));let n=It.graphemeSegmenter(e.text),o=e._style,a=s.baseLineOffset,u=$u(n,o,s,true),l=0,c=o.padding,h=u.scale,d=u.width,p=u.height+u.offsetY;o._stroke&&(d+=o._stroke.width/h,p+=o._stroke.width/h),i.translate(-e._anchor._x*d-c,-e._anchor._y*p-c).scale(h,h);let m=s.applyFillAsTint?o._fill.color:16777215;for(let b=0;b<u.lines.length;b++){let _=u.lines[b];for(let g=0;g<_.charPositions.length;g++){let y=n[l++],S=s.chars[y];S?.texture&&i.texture(S.texture,m||"black",Math.round(_.charPositions[g]+S.xOffset),Math.round(a+S.yOffset));}a+=s.lineHeight;}}_getGpuBitmapText(e){return e._gpuData[this._renderer.uid]||this.initGpuText(e)}initGpuText(e){let t=new Ph;return e._gpuData[this._renderer.uid]=t,this._updateContext(e,t),t}_updateDistanceField(e){let t=this._getGpuBitmapText(e).context,i=e._style.fontFamily,s=Se.get(`${i}-bitmap`),{a:n,b:o,c:a,d:u}=e.groupTransform,l=Math.sqrt(n*n+o*o),c=Math.sqrt(a*a+u*u),h=(Math.abs(l)+Math.abs(c))/2,d=s.baseRenderedFontSize/e._style.fontSize,p=h*s.distanceField.range*(1/d);t.customShader.resources.localUniforms.uniforms.uDistance=p;}destroy(){this._renderer=null;}};Io.extension={type:[x.WebGLPipes,x.WebGPUPipes,x.CanvasPipes],name:"bitmapText"};});var mT=f(()=>{B();pT();V.add(Io);});var qu,gT=f(()=>{Fu();qu=class extends Xr{constructor(e){super(),this.generatingTexture=false,this._renderer=e,e.runners.resolutionChange.add(this);}resolutionChange(){let e=this.renderable;e._autoResolution&&e.onViewUpdate();}destroy(){this._renderer.htmlText.returnTexturePromise(this.texturePromise),this.texturePromise=null,this._renderer=null;}};});var Do,xT=f(()=>{B();ye();Um();gT();Do=class{constructor(e){this._renderer=e;}validateRenderable(e){return e._didTextUpdate}addRenderable(e,t){let i=this._getGpuText(e);e._didTextUpdate&&(this._updateGpuText(e).catch(s=>{console.error(s);}),e._didTextUpdate=false,Eo(i,e)),this._renderer.renderPipes.batch.addToBatch(i,t);}updateRenderable(e){let t=this._getGpuText(e);t._batcher.updateElement(t);}async _updateGpuText(e){e._didTextUpdate=false;let t=this._getGpuText(e);if(t.generatingTexture)return;t.texturePromise&&(this._renderer.htmlText.returnTexturePromise(t.texturePromise),t.texturePromise=null),t.generatingTexture=true,e._resolution=e._autoResolution?this._renderer.resolution:e.resolution;let i=this._renderer.htmlText.getTexturePromise(e);t.texturePromise=i,t.texture=await i;let s=e.renderGroup||e.parentRenderGroup;s&&(s.structureDidChange=true),t.generatingTexture=false,Eo(t,e);}_getGpuText(e){return e._gpuData[this._renderer.uid]||this.initGpuText(e)}initGpuText(e){let t=new qu(this._renderer);return t.renderable=e,t.transform=e.groupTransform,t.texture=exports.Texture.EMPTY,t.bounds={minX:0,maxX:1,minY:0,maxY:0},t.roundPixels=this._renderer._roundPixels|e._roundPixels,e._resolution=e._autoResolution?this._renderer.resolution:e.resolution,e._gpuData[this._renderer.uid]=t,t}destroy(){this._renderer=null;}};Do.extension={type:[x.WebGLPipes,x.WebGPUPipes,x.CanvasPipes],name:"htmlText"};});function gg(){let{userAgent:r}=j.get().getNavigator();return /^((?!chrome|android).)*safari/i.test(r)}var _T=f(()=>{Fe();});var WP,XP,dn,xg=f(()=>{WP="http://www.w3.org/2000/svg",XP="http://www.w3.org/1999/xhtml",dn=class{constructor(){this.svgRoot=document.createElementNS(WP,"svg"),this.foreignObject=document.createElementNS(WP,"foreignObject"),this.domElement=document.createElementNS(XP,"div"),this.styleElement=document.createElementNS(XP,"style"),this.image=new Image;let{foreignObject:e,svgRoot:t,styleElement:i,domElement:s}=this;e.setAttribute("width","10000"),e.setAttribute("height","10000"),e.style.overflow="hidden",t.appendChild(e),e.appendChild(i),e.appendChild(s);}};});function _g(r){let e=r._stroke,t=r._fill,s=[`div { ${[`color: ${te.shared.setValue(t.color).toHex()}`,`font-size: ${r.fontSize}px`,`font-family: ${r.fontFamily}`,`font-weight: ${r.fontWeight}`,`font-style: ${r.fontStyle}`,`font-variant: ${r.fontVariant}`,`letter-spacing: ${r.letterSpacing}px`,`text-align: ${r.align}`,`padding: ${r.padding}px`,`white-space: ${r.whiteSpace==="pre"&&r.wordWrap?"pre-wrap":r.whiteSpace}`,...r.lineHeight?[`line-height: ${r.lineHeight}px`]:[],...r.wordWrap?[`word-wrap: ${r.breakWords?"break-all":"break-word"}`,`max-width: ${r.wordWrapWidth}px`]:[],...e?[qP(e)]:[],...r.dropShadow?[$P(r.dropShadow)]:[],...r.cssOverrides].join(";")} }`];return Dk(r.tagStyles,s),s.join(" ")}function $P(r){let e=te.shared.setValue(r.color).setAlpha(r.alpha).toHexa(),t=Math.round(Math.cos(r.angle)*r.distance),i=Math.round(Math.sin(r.angle)*r.distance),s=`${t}px ${i}px`;return r.blur>0?`text-shadow: ${s} ${r.blur}px ${e}`:`text-shadow: ${s} ${e}`}function qP(r){return [`-webkit-text-stroke-width: ${r.width}px`,`-webkit-text-stroke-color: ${te.shared.setValue(r.color).toHex()}`,`text-stroke-width: ${r.width}px`,`text-stroke-color: ${te.shared.setValue(r.color).toHex()}`,"paint-order: stroke"].join(";")}function Dk(r,e){for(let t in r){let i=r[t],s=[];for(let n in i)jP[n]?s.push(jP[n](i[n])):YP[n]&&s.push(YP[n].replace("{{VALUE}}",i[n]));e.push(`${t} { ${s.join(";")} }`);}}var YP,jP,bT=f(()=>{gt();YP={fontSize:"font-size: {{VALUE}}px",fontFamily:"font-family: {{VALUE}}",fontWeight:"font-weight: {{VALUE}}",fontStyle:"font-style: {{VALUE}}",fontVariant:"font-variant: {{VALUE}}",letterSpacing:"letter-spacing: {{VALUE}}px",align:"text-align: {{VALUE}}",padding:"padding: {{VALUE}}px",whiteSpace:"white-space: {{VALUE}}",lineHeight:"line-height: {{VALUE}}px",wordWrapWidth:"max-width: {{VALUE}}px"},jP={fill:r=>`color: ${te.shared.setValue(r).toHex()}`,breakWords:r=>`word-wrap: ${r?"break-all":"break-word"}`,stroke:qP,dropShadow:$P};});var fn,bg=f(()=>{Be();un();bT();fn=class r extends Mt{constructor(e={}){super(e),this._cssOverrides=[],this.cssOverrides=e.cssOverrides??[],this.tagStyles=e.tagStyles??{};}set cssOverrides(e){this._cssOverrides=e instanceof Array?e:[e],this.update();}get cssOverrides(){return this._cssOverrides}update(){this._cssStyle=null,super.update();}clone(){return new r({align:this.align,breakWords:this.breakWords,dropShadow:this.dropShadow?{...this.dropShadow}:null,fill:this._fill,fontFamily:this.fontFamily,fontSize:this.fontSize,fontStyle:this.fontStyle,fontVariant:this.fontVariant,fontWeight:this.fontWeight,letterSpacing:this.letterSpacing,lineHeight:this.lineHeight,padding:this.padding,stroke:this._stroke,whiteSpace:this.whiteSpace,wordWrap:this.wordWrap,wordWrapWidth:this.wordWrapWidth,cssOverrides:this.cssOverrides,tagStyles:{...this.tagStyles}})}get cssStyle(){return this._cssStyle||(this._cssStyle=_g(this)),this._cssStyle}addOverride(...e){let t=e.filter(i=>!this.cssOverrides.includes(i));t.length>0&&(this.cssOverrides.push(...t),this.update());}removeOverride(...e){let t=e.filter(i=>this.cssOverrides.includes(i));t.length>0&&(this.cssOverrides=this.cssOverrides.filter(i=>!t.includes(i)),this.update());}set fill(e){typeof e!="string"&&typeof e!="number"&&N("[HTMLTextStyle] only color fill is not supported by HTMLText"),super.fill=e;}set stroke(e){e&&typeof e!="string"&&typeof e!="number"&&N("[HTMLTextStyle] only color stroke is not supported by HTMLText"),super.stroke=e;}};});function yg(r,e){let t=e.fontFamily,i=[],s={},n=/font-family:([^;"\s]+)/g,o=r.match(n);function a(u){s[u]||(i.push(u),s[u]=true);}if(Array.isArray(t))for(let u=0;u<t.length;u++)a(t[u]);else a(t);o&&o.forEach(u=>{let l=u.split(":")[1].trim();a(l);});for(let u in e.tagStyles){let l=e.tagStyles[u].fontFamily;a(l);}return i}var yT=f(()=>{});async function vg(r){let t=await(await j.get().fetch(r)).blob(),i=new FileReader;return await new Promise((n,o)=>{i.onloadend=()=>n(i.result),i.onerror=o,i.readAsDataURL(t);})}var vT=f(()=>{Fe();});async function wh(r,e){let t=await vg(e);return `@font-face {
476
476
  font-family: "${r.fontFamily}";
477
477
  src: url('${t}');
478
478
  font-weight: ${r.fontWeight};
@@ -573,7 +573,7 @@ fn mainFragment(
573
573
 
574
574
  outColor = texture(uTexture, coord, unclamped == coord ? 0.0 : -32.0);// lod-bias very negative to force lod 0
575
575
 
576
- `}};});var RT,MT,Qu,IT=f(()=>{Te();as();Oo();us();Wr();ht();ye();BT();Qu=class extends rt{constructor(){RT??(RT=Nr({name:"tiling-sprite-shader",bits:[ps,wg,Vr]})),MT??(MT=Hr({name:"tiling-sprite-shader",bits:[mn,Bg,zr]}));let e=new xe({uMapCoord:{value:new G,type:"mat3x3<f32>"},uClampFrame:{value:new Float32Array([0,0,1,1]),type:"vec4<f32>"},uClampOffset:{value:new Float32Array([0,0]),type:"vec2<f32>"},uTextureTransform:{value:new G,type:"mat3x3<f32>"},uSizeAnchor:{value:new Float32Array([100,100,.5,.5]),type:"vec4<f32>"}});super({glProgram:MT,gpuProgram:RT,resources:{localUniforms:new xe({uTransformMatrix:{value:new G,type:"mat3x3<f32>"},uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uRound:{value:0,type:"f32"}}),tilingUniforms:e,uTexture:exports.Texture.EMPTY.source,uSampler:exports.Texture.EMPTY.source.style}});}updateUniforms(e,t,i,s,n,o){let a=this.resources.tilingUniforms,u=o.width,l=o.height,c=o.textureMatrix,h=a.uniforms.uTextureTransform;h.set(i.a*u/e,i.b*u/t,i.c*l/e,i.d*l/t,i.tx/e,i.ty/t),h.invert(),a.uniforms.uMapCoord=c.mapCoord,a.uniforms.uClampFrame=c.uClampFrame,a.uniforms.uClampOffset=c.uClampOffset,a.uniforms.uTextureTransform=h,a.uniforms.uSizeAnchor[0]=e,a.uniforms.uSizeAnchor[1]=t,a.uniforms.uSizeAnchor[2]=s,a.uniforms.uSizeAnchor[3]=n,o&&(this.resources.uTexture=o.source,this.resources.uSampler=o.source.style);}};});var Ju,DT=f(()=>{pn();Ju=class extends fr{constructor(){super({positions:new Float32Array([0,0,1,0,1,1,0,1]),uvs:new Float32Array([0,0,1,0,1,1,0,1]),indices:new Uint32Array([0,1,2,0,2,3])});}};});function Rg(r,e){let t=r.anchor.x,i=r.anchor.y;e[0]=-t*r.width,e[1]=-i*r.height,e[2]=(1-t)*r.width,e[3]=-i*r.height,e[4]=(1-t)*r.width,e[5]=(1-i)*r.height,e[6]=-t*r.width,e[7]=(1-i)*r.height;}var kT=f(()=>{});function Mg(r,e,t,i){let s=0,n=r.length/(e||2),o=i.a,a=i.b,u=i.c,l=i.d,c=i.tx,h=i.ty;for(t*=e;s<n;){let d=r[t],p=r[t+1];r[t]=o*d+u*p+c,r[t+1]=a*d+l*p+h,t+=e,s++;}}var OT=f(()=>{});function Ig(r,e){let t=r.texture,i=t.frame.width,s=t.frame.height,n=0,o=0;r.applyAnchorToTexture&&(n=r.anchor.x,o=r.anchor.y),e[0]=e[6]=-n,e[2]=e[4]=1-n,e[1]=e[3]=-o,e[5]=e[7]=1-o;let a=G.shared;a.copyFrom(r._tileTransform.matrix),a.tx/=r.width,a.ty/=r.height,a.invert(),a.scale(r.width/i,r.height/s),Mg(e,2,0,a);}var FT=f(()=>{Te();OT();});var Dg,Bh,Fo,GT=f(()=>{B();xu();Pr();Ar();bo();mh();pn();IT();DT();kT();FT();Dg=new Ju,Bh=class{constructor(){this.canBatch=true,this.geometry=new fr({indices:Dg.indices.slice(),positions:Dg.positions.slice(),uvs:Dg.uvs.slice()});}destroy(){this.geometry.destroy(),this.shader?.destroy();}},Fo=class{constructor(e){this._state=Qe.default2d,this._renderer=e;}validateRenderable(e){let t=this._getTilingSpriteData(e),i=t.canBatch;this._updateCanBatch(e);let s=t.canBatch;if(s&&s===i){let{batchableMesh:n}=t;return !n._batcher.checkAndUpdateTexture(n,e.texture)}return i!==s}addRenderable(e,t){let i=this._renderer.renderPipes.batch;this._updateCanBatch(e);let s=this._getTilingSpriteData(e),{geometry:n,canBatch:o}=s;if(o){s.batchableMesh||(s.batchableMesh=new wi);let a=s.batchableMesh;e.didViewUpdate&&(this._updateBatchableMesh(e),a.geometry=n,a.renderable=e,a.transform=e.groupTransform,a.setTexture(e._texture)),a.roundPixels=this._renderer._roundPixels|e._roundPixels,i.addToBatch(a,t);}else i.break(t),s.shader||(s.shader=new Qu),this.updateRenderable(e),t.add(e);}execute(e){let{shader:t}=this._getTilingSpriteData(e);t.groups[0]=this._renderer.globalUniforms.bindGroup;let i=t.resources.localUniforms.uniforms;i.uTransformMatrix=e.groupTransform,i.uRound=this._renderer._roundPixels|e._roundPixels,Xr(e.groupColorAlpha,i.uColor,0),this._state.blendMode=oi(e.groupBlendMode,e.texture._source),this._renderer.encoder.draw({geometry:Dg,shader:t,state:this._state});}updateRenderable(e){let t=this._getTilingSpriteData(e),{canBatch:i}=t;if(i){let{batchableMesh:s}=t;e.didViewUpdate&&this._updateBatchableMesh(e),s._batcher.updateElement(s);}else if(e.didViewUpdate){let{shader:s}=t;s.updateUniforms(e.width,e.height,e._tileTransform.matrix,e.anchor.x,e.anchor.y,e.texture);}}_getTilingSpriteData(e){return e._gpuData[this._renderer.uid]||this._initTilingSpriteData(e)}_initTilingSpriteData(e){let t=new Bh;return t.renderable=e,e._gpuData[this._renderer.uid]=t,t}_updateBatchableMesh(e){let t=this._getTilingSpriteData(e),{geometry:i}=t,s=e.texture.source.style;s.addressMode!=="repeat"&&(s.addressMode="repeat",s.update()),Ig(e,i.uvs),Rg(e,i.positions);}destroy(){this._renderer=null;}_updateCanBatch(e){let t=this._getTilingSpriteData(e),i=e.texture,s=true;return this._renderer.type===qe.WEBGL&&(s=this._renderer.context.supports.nonPowOf2wrapping),t.canBatch=i.textureMatrix.isSimple&&(s||i.source.isPowerOfTwo),t.canBatch}};Fo.extension={type:[x.WebGLPipes,x.WebGPUPipes,x.CanvasPipes],name:"tilingSprite"};});var UT=f(()=>{B();GT();V.add(Fo);});var JP,gn,Rh=f(()=>{Pe();pn();JP=class ew extends fr{constructor(...e){super({});let t=e[0]??{};typeof t=="number"&&(U(Y,"PlaneGeometry constructor changed please use { width, height, verticesX, verticesY } instead"),t={width:t,height:e[1],verticesX:e[2],verticesY:e[3]}),this.build(t);}build(e){e={...ew.defaultOptions,...e},this.verticesX=this.verticesX??e.verticesX,this.verticesY=this.verticesY??e.verticesY,this.width=this.width??e.width,this.height=this.height??e.height;let t=this.verticesX*this.verticesY,i=[],s=[],n=[],o=this.verticesX-1,a=this.verticesY-1,u=this.width/o,l=this.height/a;for(let h=0;h<t;h++){let d=h%this.verticesX,p=h/this.verticesX|0;i.push(d*u,p*l),s.push(d/o,p/a);}let c=o*a;for(let h=0;h<c;h++){let d=h%o,p=h/o|0,m=p*this.verticesX+d,b=p*this.verticesX+d+1,_=(p+1)*this.verticesX+d,g=(p+1)*this.verticesX+d+1;n.push(m,b,_,b,g,_);}this.buffers[0].data=new Float32Array(i),this.buffers[1].data=new Float32Array(s),this.indexBuffer.data=new Uint32Array(n),this.buffers[0].update(),this.buffers[1].update(),this.indexBuffer.update();}};JP.defaultOptions={width:100,height:100,verticesX:10,verticesY:10};gn=JP;});var tw,ci,kg=f(()=>{Rh();tw=class rw extends gn{constructor(e={}){e={...rw.defaultOptions,...e},super({width:e.width,height:e.height,verticesX:4,verticesY:4}),this.update(e);}update(e){this.width=e.width??this.width,this.height=e.height??this.height,this._originalWidth=e.originalWidth??this._originalWidth,this._originalHeight=e.originalHeight??this._originalHeight,this._leftWidth=e.leftWidth??this._leftWidth,this._rightWidth=e.rightWidth??this._rightWidth,this._topHeight=e.topHeight??this._topHeight,this._bottomHeight=e.bottomHeight??this._bottomHeight,this._anchorX=e.anchor?.x,this._anchorY=e.anchor?.y,this.updateUvs(),this.updatePositions();}updatePositions(){let e=this.positions,{width:t,height:i,_leftWidth:s,_rightWidth:n,_topHeight:o,_bottomHeight:a,_anchorX:u,_anchorY:l}=this,c=s+n,h=t>c?1:t/c,d=o+a,p=i>d?1:i/d,m=Math.min(h,p),b=u*t,_=l*i;e[0]=e[8]=e[16]=e[24]=-b,e[2]=e[10]=e[18]=e[26]=s*m-b,e[4]=e[12]=e[20]=e[28]=t-n*m-b,e[6]=e[14]=e[22]=e[30]=t-b,e[1]=e[3]=e[5]=e[7]=-_,e[9]=e[11]=e[13]=e[15]=o*m-_,e[17]=e[19]=e[21]=e[23]=i-a*m-_,e[25]=e[27]=e[29]=e[31]=i-_,this.getBuffer("aPosition").update();}updateUvs(){let e=this.uvs;e[0]=e[8]=e[16]=e[24]=0,e[1]=e[3]=e[5]=e[7]=0,e[6]=e[14]=e[22]=e[30]=1,e[25]=e[27]=e[29]=e[31]=1;let t=1/this._originalWidth,i=1/this._originalHeight;e[2]=e[10]=e[18]=e[26]=t*this._leftWidth,e[9]=e[11]=e[13]=e[15]=i*this._topHeight,e[4]=e[12]=e[20]=e[28]=1-t*this._rightWidth,e[17]=e[19]=e[21]=e[23]=1-i*this._bottomHeight,this.getBuffer("aUV").update();}};tw.defaultOptions={width:100,height:100,leftWidth:10,topHeight:10,rightWidth:10,bottomHeight:10,originalWidth:100,originalHeight:100};ci=tw;});var Mh,Go,LT=f(()=>{B();mh();kg();Mh=class extends wi{constructor(){super(),this.geometry=new ci;}destroy(){this.geometry.destroy();}},Go=class{constructor(e){this._renderer=e;}addRenderable(e,t){let i=this._getGpuSprite(e);e.didViewUpdate&&this._updateBatchableSprite(e,i),this._renderer.renderPipes.batch.addToBatch(i,t);}updateRenderable(e){let t=this._getGpuSprite(e);e.didViewUpdate&&this._updateBatchableSprite(e,t),t._batcher.updateElement(t);}validateRenderable(e){let t=this._getGpuSprite(e);return !t._batcher.checkAndUpdateTexture(t,e._texture)}_updateBatchableSprite(e,t){t.geometry.update(e),t.setTexture(e._texture);}_getGpuSprite(e){return e._gpuData[this._renderer.uid]||this._initGPUSprite(e)}_initGPUSprite(e){let t=e._gpuData[this._renderer.uid]=new Mh,i=t;return i.renderable=e,i.transform=e.groupTransform,i.texture=e._texture,i.roundPixels=this._renderer._roundPixels|e._roundPixels,e.didViewUpdate||this._updateBatchableSprite(e,i),t}destroy(){this._renderer=null;}};Go.extension={type:[x.WebGLPipes,x.WebGPUPipes,x.CanvasPipes],name:"nineSliceSprite"};});var NT=f(()=>{B();LT();V.add(Go);});var Uo,HT=f(()=>{B();Uo=class{constructor(e){this._renderer=e;}push(e,t,i){this._renderer.renderPipes.batch.break(i),i.add({renderPipeId:"filter",canBundle:false,action:"pushFilter",container:t,filterEffect:e});}pop(e,t,i){this._renderer.renderPipes.batch.break(i),i.add({renderPipeId:"filter",action:"popFilter",canBundle:false});}execute(e){e.action==="pushFilter"?this._renderer.filter.push(e):e.action==="popFilter"&&this._renderer.filter.pop();}destroy(){this._renderer=null;}};Uo.extension={type:[x.WebGLPipes,x.WebGPUPipes,x.CanvasPipes],name:"filter"};});function Og(r,e){e.clear();let t=e.matrix;for(let i=0;i<r.length;i++){let s=r[i];s.globalDisplayStatus<7||(e.matrix=s.worldTransform,e.addBounds(s.bounds));}return e.matrix=t,e}var VT=f(()=>{});var kk,zT,Lo,WT=f(()=>{B();Te();ns();Ys();ht();ye();ri();Ar();Lt();VT();Be();kk=new jt({attributes:{aPosition:{buffer:new Float32Array([0,0,1,0,1,1,0,1]),format:"float32x2",stride:2*4,offset:0}},indexBuffer:new Uint32Array([0,1,2,0,2,3])}),zT=class{constructor(){this.skip=false,this.inputTexture=null,this.backTexture=null,this.filters=null,this.bounds=new Ae,this.container=null,this.blendRequired=false,this.outputRenderSurface=null,this.globalFrame={x:0,y:0,width:0,height:0};}},Lo=class{constructor(e){this._filterStackIndex=0,this._filterStack=[],this._filterGlobalUniforms=new xe({uInputSize:{value:new Float32Array(4),type:"vec4<f32>"},uInputPixel:{value:new Float32Array(4),type:"vec4<f32>"},uInputClamp:{value:new Float32Array(4),type:"vec4<f32>"},uOutputFrame:{value:new Float32Array(4),type:"vec4<f32>"},uGlobalFrame:{value:new Float32Array(4),type:"vec4<f32>"},uOutputTexture:{value:new Float32Array(4),type:"vec4<f32>"}}),this._globalFilterBindGroup=new _t({}),this.renderer=e;}get activeBackTexture(){return this._activeFilterData?.backTexture}push(e){let t=this.renderer,i=e.filterEffect.filters,s=this._pushFilterData();s.skip=false,s.filters=i,s.container=e.container,s.outputRenderSurface=t.renderTarget.renderSurface;let n=t.renderTarget.renderTarget.colorTexture.source,o=n.resolution,a=n.antialias;if(i.length===0){s.skip=true;return}let u=s.bounds;if(this._calculateFilterArea(e,u),this._calculateFilterBounds(s,t.renderTarget.rootViewPort,a,o,1),s.skip)return;let l=this._getPreviousFilterData(),c=this._findFilterResolution(o),h=0,d=0;l&&(h=l.bounds.minX,d=l.bounds.minY),this._calculateGlobalFrame(s,h,d,c,n.width,n.height),this._setupFilterTextures(s,u,t,l);}generateFilteredTexture({texture:e,filters:t}){let i=this._pushFilterData();this._activeFilterData=i,i.skip=false,i.filters=t;let s=e.source,n=s.resolution,o=s.antialias;if(t.length===0)return i.skip=true,e;let a=i.bounds;if(a.addRect(e.frame),this._calculateFilterBounds(i,a.rectangle,o,n,0),i.skip)return e;let u=n;this._calculateGlobalFrame(i,0,0,u,s.width,s.height),i.outputRenderSurface=Me.getOptimalTexture(a.width,a.height,i.resolution,i.antialias),i.backTexture=exports.Texture.EMPTY,i.inputTexture=e,this.renderer.renderTarget.finishRenderPass(),this._applyFiltersToTexture(i,true);let d=i.outputRenderSurface;return d.source.alphaMode="premultiplied-alpha",d}pop(){let e=this.renderer,t=this._popFilterData();t.skip||(e.globalUniforms.pop(),e.renderTarget.finishRenderPass(),this._activeFilterData=t,this._applyFiltersToTexture(t,false),t.blendRequired&&Me.returnTexture(t.backTexture),Me.returnTexture(t.inputTexture));}getBackTexture(e,t,i){let s=e.colorTexture.source._resolution,n=Me.getOptimalTexture(t.width,t.height,s,false),o=t.minX,a=t.minY;i&&(o-=i.minX,a-=i.minY),o=Math.floor(o*s),a=Math.floor(a*s);let u=Math.ceil(t.width*s),l=Math.ceil(t.height*s);return this.renderer.renderTarget.copyToTexture(e,n,{x:o,y:a},{width:u,height:l},{x:0,y:0}),n}applyFilter(e,t,i,s){let n=this.renderer,o=this._activeFilterData,u=o.outputRenderSurface===i,l=n.renderTarget.rootRenderTarget.colorTexture.source._resolution,c=this._findFilterResolution(l),h=0,d=0;if(u){let p=this._findPreviousFilterOffset();h=p.x,d=p.y;}this._updateFilterUniforms(t,i,o,h,d,c,u,s),this._setupBindGroupsAndRender(e,t,n);}calculateSpriteMatrix(e,t){let i=this._activeFilterData,s=e.set(i.inputTexture._source.width,0,0,i.inputTexture._source.height,i.bounds.minX,i.bounds.minY),n=t.worldTransform.copyTo(G.shared),o=t.renderGroup||t.parentRenderGroup;return o&&o.cacheToLocalTransform&&n.prepend(o.cacheToLocalTransform),n.invert(),s.prepend(n),s.scale(1/t.texture.frame.width,1/t.texture.frame.height),s.translate(t.anchor.x,t.anchor.y),s}destroy(){}_setupBindGroupsAndRender(e,t,i){if(i.renderPipes.uniformBatch){let s=i.renderPipes.uniformBatch.getUboResource(this._filterGlobalUniforms);this._globalFilterBindGroup.setResource(s,0);}else this._globalFilterBindGroup.setResource(this._filterGlobalUniforms,0);this._globalFilterBindGroup.setResource(t.source,1),this._globalFilterBindGroup.setResource(t.source.style,2),e.groups[0]=this._globalFilterBindGroup,i.encoder.draw({geometry:kk,shader:e,state:e._state,topology:"triangle-list"}),i.type===qe.WEBGL&&i.renderTarget.finishRenderPass();}_setupFilterTextures(e,t,i,s){if(e.backTexture=exports.Texture.EMPTY,e.blendRequired){i.renderTarget.finishRenderPass();let n=i.renderTarget.getRenderTarget(e.outputRenderSurface);e.backTexture=this.getBackTexture(n,t,s?.bounds);}e.inputTexture=Me.getOptimalTexture(t.width,t.height,e.resolution,e.antialias),i.renderTarget.bind(e.inputTexture,true),i.globalUniforms.push({offset:t});}_calculateGlobalFrame(e,t,i,s,n,o){let a=e.globalFrame;a.x=t*s,a.y=i*s,a.width=n*s,a.height=o*s;}_updateFilterUniforms(e,t,i,s,n,o,a,u){let l=this._filterGlobalUniforms.uniforms,c=l.uOutputFrame,h=l.uInputSize,d=l.uInputPixel,p=l.uInputClamp,m=l.uGlobalFrame,b=l.uOutputTexture;a?(c[0]=i.bounds.minX-s,c[1]=i.bounds.minY-n):(c[0]=0,c[1]=0),c[2]=e.frame.width,c[3]=e.frame.height,h[0]=e.source.width,h[1]=e.source.height,h[2]=1/h[0],h[3]=1/h[1],d[0]=e.source.pixelWidth,d[1]=e.source.pixelHeight,d[2]=1/d[0],d[3]=1/d[1],p[0]=.5*d[2],p[1]=.5*d[3],p[2]=e.frame.width*h[2]-.5*d[2],p[3]=e.frame.height*h[3]-.5*d[3];let _=this.renderer.renderTarget.rootRenderTarget.colorTexture;m[0]=s*o,m[1]=n*o,m[2]=_.source.width*o,m[3]=_.source.height*o,t instanceof exports.Texture&&(t.source.resource=null);let g=this.renderer.renderTarget.getRenderTarget(t);this.renderer.renderTarget.bind(t,!!u),t instanceof exports.Texture?(b[0]=t.frame.width,b[1]=t.frame.height):(b[0]=g.width,b[1]=g.height),b[2]=g.isRoot?-1:1,this._filterGlobalUniforms.update();}_findFilterResolution(e){let t=this._filterStackIndex-1;for(;t>0&&this._filterStack[t].skip;)--t;return t>0&&this._filterStack[t].inputTexture?this._filterStack[t].inputTexture.source._resolution:e}_findPreviousFilterOffset(){let e=0,t=0,i=this._filterStackIndex;for(;i>0;){i--;let s=this._filterStack[i];if(!s.skip){e=s.bounds.minX,t=s.bounds.minY;break}}return {x:e,y:t}}_calculateFilterArea(e,t){if(e.renderables?Og(e.renderables,t):e.filterEffect.filterArea?(t.clear(),t.addRect(e.filterEffect.filterArea),t.applyMatrix(e.container.worldTransform)):e.container.getFastGlobalBounds(true,t),e.container){let s=(e.container.renderGroup||e.container.parentRenderGroup).cacheToLocalTransform;s&&t.applyMatrix(s);}}_applyFiltersToTexture(e,t){let i=e.inputTexture,s=e.bounds,n=e.filters;if(this._globalFilterBindGroup.setResource(i.source.style,2),this._globalFilterBindGroup.setResource(e.backTexture.source,3),n.length===1)n[0].apply(this,i,e.outputRenderSurface,t);else {let o=e.inputTexture,a=Me.getOptimalTexture(s.width,s.height,o.source._resolution,false),u=a,l=0;for(l=0;l<n.length-1;++l){n[l].apply(this,o,u,true);let h=o;o=u,u=h;}n[l].apply(this,o,e.outputRenderSurface,t),Me.returnTexture(a);}}_calculateFilterBounds(e,t,i,s,n){let o=this.renderer,a=e.bounds,u=e.filters,l=1/0,c=0,h=true,d=false,p=false,m=true;for(let b=0;b<u.length;b++){let _=u[b];if(l=Math.min(l,_.resolution==="inherit"?s:_.resolution),c+=_.padding,_.antialias==="off"?h=false:_.antialias==="inherit"&&h&&(h=i),_.clipToViewport||(m=false),!!!(_.compatibleRenderers&o.type)){p=false;break}if(_.blendRequired&&!(o.backBuffer?.useBackBuffer??true)){N("Blend filter requires backBuffer on WebGL renderer to be enabled. Set `useBackBuffer: true` in the renderer options."),p=false;break}p=_.enabled||p,d||(d=_.blendRequired);}if(!p){e.skip=true;return}if(m&&a.fitBounds(0,t.width/s,0,t.height/s),a.scale(l).ceil().scale(1/l).pad((c|0)*n),!a.isPositive){e.skip=true;return}e.antialias=h,e.resolution=l,e.blendRequired=d;}_popFilterData(){return this._filterStackIndex--,this._filterStack[this._filterStackIndex]}_getPreviousFilterData(){let e,t=this._filterStackIndex-1;for(;t>1&&(t--,e=this._filterStack[t],!!e.skip););return e}_pushFilterData(){let e=this._filterStack[this._filterStackIndex];return e||(e=this._filterStack[this._filterStackIndex]=new zT),this._filterStackIndex++,e}};Lo.extension={type:[x.WebGLSystem,x.WebGPUSystem],name:"filter"};});var XT=f(()=>{B();HT();WT();V.add(Lo);V.add(Uo);});var Ok={};var iw=f(()=>{BA();Oy();IA();kA();Rp();Op();mv();xv();Bv();nT();mT();wT();UT();NT();XT();});var YT,sw=f(()=>{B();YT={extension:{type:x.Environment,name:"browser",priority:-1},test:()=>true,load:async()=>{await Promise.resolve().then(()=>(iw(),Ok));}};});var Fk={};var nw=f(()=>{Oy();Rp();Op();mv();xv();Bv();nT();mT();wT();UT();NT();XT();});var jT,ow=f(()=>{B();jT={extension:{type:x.Environment,name:"webworker",priority:0},test:()=>typeof self<"u"&&self.WorkerGlobalScope!==void 0,load:async()=>{await Promise.resolve().then(()=>(nw(),Fk));}};});var aw,Dt,Ii=f(()=>{dr();Cr();Wr();Pr();aw=class $T extends rt{constructor(e){e={...$T.defaultOptions,...e},super(e),this.enabled=true,this._state=Qe.for2d(),this.blendMode=e.blendMode,this.padding=e.padding,typeof e.antialias=="boolean"?this.antialias=e.antialias?"on":"off":this.antialias=e.antialias,this.resolution=e.resolution,this.blendRequired=e.blendRequired,this.clipToViewport=e.clipToViewport,this.addResource("uTexture",0,1);}apply(e,t,i,s){e.applyFilter(this,t,i,s);}get blendMode(){return this._state.blendMode}set blendMode(e){this._state.blendMode=e;}static from(e){let{gpu:t,gl:i,...s}=e,n,o;return t&&(n=$e.from(t)),i&&(o=je.from(i)),new $T({gpuProgram:n,glProgram:o,...s})}};aw.defaultOptions={blendMode:"normal",resolution:1,padding:0,antialias:"off",blendRequired:false,clipToViewport:true};Dt=aw;});var Fg,qT=f(()=>{Fg=`
576
+ `}};});var RT,MT,Qu,IT=f(()=>{Te();as();Oo();us();zr();ht();ye();BT();Qu=class extends rt{constructor(){RT??(RT=Lr({name:"tiling-sprite-shader",bits:[ps,wg,Hr]})),MT??(MT=Nr({name:"tiling-sprite-shader",bits:[mn,Bg,Vr]}));let e=new xe({uMapCoord:{value:new G,type:"mat3x3<f32>"},uClampFrame:{value:new Float32Array([0,0,1,1]),type:"vec4<f32>"},uClampOffset:{value:new Float32Array([0,0]),type:"vec2<f32>"},uTextureTransform:{value:new G,type:"mat3x3<f32>"},uSizeAnchor:{value:new Float32Array([100,100,.5,.5]),type:"vec4<f32>"}});super({glProgram:MT,gpuProgram:RT,resources:{localUniforms:new xe({uTransformMatrix:{value:new G,type:"mat3x3<f32>"},uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uRound:{value:0,type:"f32"}}),tilingUniforms:e,uTexture:exports.Texture.EMPTY.source,uSampler:exports.Texture.EMPTY.source.style}});}updateUniforms(e,t,i,s,n,o){let a=this.resources.tilingUniforms,u=o.width,l=o.height,c=o.textureMatrix,h=a.uniforms.uTextureTransform;h.set(i.a*u/e,i.b*u/t,i.c*l/e,i.d*l/t,i.tx/e,i.ty/t),h.invert(),a.uniforms.uMapCoord=c.mapCoord,a.uniforms.uClampFrame=c.uClampFrame,a.uniforms.uClampOffset=c.uClampOffset,a.uniforms.uTextureTransform=h,a.uniforms.uSizeAnchor[0]=e,a.uniforms.uSizeAnchor[1]=t,a.uniforms.uSizeAnchor[2]=s,a.uniforms.uSizeAnchor[3]=n,o&&(this.resources.uTexture=o.source,this.resources.uSampler=o.source.style);}};});var Ju,DT=f(()=>{pn();Ju=class extends fr{constructor(){super({positions:new Float32Array([0,0,1,0,1,1,0,1]),uvs:new Float32Array([0,0,1,0,1,1,0,1]),indices:new Uint32Array([0,1,2,0,2,3])});}};});function Rg(r,e){let t=r.anchor.x,i=r.anchor.y;e[0]=-t*r.width,e[1]=-i*r.height,e[2]=(1-t)*r.width,e[3]=-i*r.height,e[4]=(1-t)*r.width,e[5]=(1-i)*r.height,e[6]=-t*r.width,e[7]=(1-i)*r.height;}var kT=f(()=>{});function Mg(r,e,t,i){let s=0,n=r.length/(e||2),o=i.a,a=i.b,u=i.c,l=i.d,c=i.tx,h=i.ty;for(t*=e;s<n;){let d=r[t],p=r[t+1];r[t]=o*d+u*p+c,r[t+1]=a*d+l*p+h,t+=e,s++;}}var OT=f(()=>{});function Ig(r,e){let t=r.texture,i=t.frame.width,s=t.frame.height,n=0,o=0;r.applyAnchorToTexture&&(n=r.anchor.x,o=r.anchor.y),e[0]=e[6]=-n,e[2]=e[4]=1-n,e[1]=e[3]=-o,e[5]=e[7]=1-o;let a=G.shared;a.copyFrom(r._tileTransform.matrix),a.tx/=r.width,a.ty/=r.height,a.invert(),a.scale(r.width/i,r.height/s),Mg(e,2,0,a);}var FT=f(()=>{Te();OT();});var Dg,Bh,Fo,GT=f(()=>{B();xu();Pr();Ar();bo();mh();pn();IT();DT();kT();FT();Dg=new Ju,Bh=class{constructor(){this.canBatch=true,this.geometry=new fr({indices:Dg.indices.slice(),positions:Dg.positions.slice(),uvs:Dg.uvs.slice()});}destroy(){this.geometry.destroy(),this.shader?.destroy();}},Fo=class{constructor(e){this._state=Qe.default2d,this._renderer=e;}validateRenderable(e){let t=this._getTilingSpriteData(e),i=t.canBatch;this._updateCanBatch(e);let s=t.canBatch;if(s&&s===i){let{batchableMesh:n}=t;return !n._batcher.checkAndUpdateTexture(n,e.texture)}return i!==s}addRenderable(e,t){let i=this._renderer.renderPipes.batch;this._updateCanBatch(e);let s=this._getTilingSpriteData(e),{geometry:n,canBatch:o}=s;if(o){s.batchableMesh||(s.batchableMesh=new wi);let a=s.batchableMesh;e.didViewUpdate&&(this._updateBatchableMesh(e),a.geometry=n,a.renderable=e,a.transform=e.groupTransform,a.setTexture(e._texture)),a.roundPixels=this._renderer._roundPixels|e._roundPixels,i.addToBatch(a,t);}else i.break(t),s.shader||(s.shader=new Qu),this.updateRenderable(e),t.add(e);}execute(e){let{shader:t}=this._getTilingSpriteData(e);t.groups[0]=this._renderer.globalUniforms.bindGroup;let i=t.resources.localUniforms.uniforms;i.uTransformMatrix=e.groupTransform,i.uRound=this._renderer._roundPixels|e._roundPixels,Wr(e.groupColorAlpha,i.uColor,0),this._state.blendMode=oi(e.groupBlendMode,e.texture._source),this._renderer.encoder.draw({geometry:Dg,shader:t,state:this._state});}updateRenderable(e){let t=this._getTilingSpriteData(e),{canBatch:i}=t;if(i){let{batchableMesh:s}=t;e.didViewUpdate&&this._updateBatchableMesh(e),s._batcher.updateElement(s);}else if(e.didViewUpdate){let{shader:s}=t;s.updateUniforms(e.width,e.height,e._tileTransform.matrix,e.anchor.x,e.anchor.y,e.texture);}}_getTilingSpriteData(e){return e._gpuData[this._renderer.uid]||this._initTilingSpriteData(e)}_initTilingSpriteData(e){let t=new Bh;return t.renderable=e,e._gpuData[this._renderer.uid]=t,t}_updateBatchableMesh(e){let t=this._getTilingSpriteData(e),{geometry:i}=t,s=e.texture.source.style;s.addressMode!=="repeat"&&(s.addressMode="repeat",s.update()),Ig(e,i.uvs),Rg(e,i.positions);}destroy(){this._renderer=null;}_updateCanBatch(e){let t=this._getTilingSpriteData(e),i=e.texture,s=true;return this._renderer.type===qe.WEBGL&&(s=this._renderer.context.supports.nonPowOf2wrapping),t.canBatch=i.textureMatrix.isSimple&&(s||i.source.isPowerOfTwo),t.canBatch}};Fo.extension={type:[x.WebGLPipes,x.WebGPUPipes,x.CanvasPipes],name:"tilingSprite"};});var UT=f(()=>{B();GT();V.add(Fo);});var JP,gn,Rh=f(()=>{Pe();pn();JP=class ew extends fr{constructor(...e){super({});let t=e[0]??{};typeof t=="number"&&(U(Y,"PlaneGeometry constructor changed please use { width, height, verticesX, verticesY } instead"),t={width:t,height:e[1],verticesX:e[2],verticesY:e[3]}),this.build(t);}build(e){e={...ew.defaultOptions,...e},this.verticesX=this.verticesX??e.verticesX,this.verticesY=this.verticesY??e.verticesY,this.width=this.width??e.width,this.height=this.height??e.height;let t=this.verticesX*this.verticesY,i=[],s=[],n=[],o=this.verticesX-1,a=this.verticesY-1,u=this.width/o,l=this.height/a;for(let h=0;h<t;h++){let d=h%this.verticesX,p=h/this.verticesX|0;i.push(d*u,p*l),s.push(d/o,p/a);}let c=o*a;for(let h=0;h<c;h++){let d=h%o,p=h/o|0,m=p*this.verticesX+d,b=p*this.verticesX+d+1,_=(p+1)*this.verticesX+d,g=(p+1)*this.verticesX+d+1;n.push(m,b,_,b,g,_);}this.buffers[0].data=new Float32Array(i),this.buffers[1].data=new Float32Array(s),this.indexBuffer.data=new Uint32Array(n),this.buffers[0].update(),this.buffers[1].update(),this.indexBuffer.update();}};JP.defaultOptions={width:100,height:100,verticesX:10,verticesY:10};gn=JP;});var tw,ci,kg=f(()=>{Rh();tw=class rw extends gn{constructor(e={}){e={...rw.defaultOptions,...e},super({width:e.width,height:e.height,verticesX:4,verticesY:4}),this.update(e);}update(e){this.width=e.width??this.width,this.height=e.height??this.height,this._originalWidth=e.originalWidth??this._originalWidth,this._originalHeight=e.originalHeight??this._originalHeight,this._leftWidth=e.leftWidth??this._leftWidth,this._rightWidth=e.rightWidth??this._rightWidth,this._topHeight=e.topHeight??this._topHeight,this._bottomHeight=e.bottomHeight??this._bottomHeight,this._anchorX=e.anchor?.x,this._anchorY=e.anchor?.y,this.updateUvs(),this.updatePositions();}updatePositions(){let e=this.positions,{width:t,height:i,_leftWidth:s,_rightWidth:n,_topHeight:o,_bottomHeight:a,_anchorX:u,_anchorY:l}=this,c=s+n,h=t>c?1:t/c,d=o+a,p=i>d?1:i/d,m=Math.min(h,p),b=u*t,_=l*i;e[0]=e[8]=e[16]=e[24]=-b,e[2]=e[10]=e[18]=e[26]=s*m-b,e[4]=e[12]=e[20]=e[28]=t-n*m-b,e[6]=e[14]=e[22]=e[30]=t-b,e[1]=e[3]=e[5]=e[7]=-_,e[9]=e[11]=e[13]=e[15]=o*m-_,e[17]=e[19]=e[21]=e[23]=i-a*m-_,e[25]=e[27]=e[29]=e[31]=i-_,this.getBuffer("aPosition").update();}updateUvs(){let e=this.uvs;e[0]=e[8]=e[16]=e[24]=0,e[1]=e[3]=e[5]=e[7]=0,e[6]=e[14]=e[22]=e[30]=1,e[25]=e[27]=e[29]=e[31]=1;let t=1/this._originalWidth,i=1/this._originalHeight;e[2]=e[10]=e[18]=e[26]=t*this._leftWidth,e[9]=e[11]=e[13]=e[15]=i*this._topHeight,e[4]=e[12]=e[20]=e[28]=1-t*this._rightWidth,e[17]=e[19]=e[21]=e[23]=1-i*this._bottomHeight,this.getBuffer("aUV").update();}};tw.defaultOptions={width:100,height:100,leftWidth:10,topHeight:10,rightWidth:10,bottomHeight:10,originalWidth:100,originalHeight:100};ci=tw;});var Mh,Go,LT=f(()=>{B();mh();kg();Mh=class extends wi{constructor(){super(),this.geometry=new ci;}destroy(){this.geometry.destroy();}},Go=class{constructor(e){this._renderer=e;}addRenderable(e,t){let i=this._getGpuSprite(e);e.didViewUpdate&&this._updateBatchableSprite(e,i),this._renderer.renderPipes.batch.addToBatch(i,t);}updateRenderable(e){let t=this._getGpuSprite(e);e.didViewUpdate&&this._updateBatchableSprite(e,t),t._batcher.updateElement(t);}validateRenderable(e){let t=this._getGpuSprite(e);return !t._batcher.checkAndUpdateTexture(t,e._texture)}_updateBatchableSprite(e,t){t.geometry.update(e),t.setTexture(e._texture);}_getGpuSprite(e){return e._gpuData[this._renderer.uid]||this._initGPUSprite(e)}_initGPUSprite(e){let t=e._gpuData[this._renderer.uid]=new Mh,i=t;return i.renderable=e,i.transform=e.groupTransform,i.texture=e._texture,i.roundPixels=this._renderer._roundPixels|e._roundPixels,e.didViewUpdate||this._updateBatchableSprite(e,i),t}destroy(){this._renderer=null;}};Go.extension={type:[x.WebGLPipes,x.WebGPUPipes,x.CanvasPipes],name:"nineSliceSprite"};});var NT=f(()=>{B();LT();V.add(Go);});var Uo,HT=f(()=>{B();Uo=class{constructor(e){this._renderer=e;}push(e,t,i){this._renderer.renderPipes.batch.break(i),i.add({renderPipeId:"filter",canBundle:false,action:"pushFilter",container:t,filterEffect:e});}pop(e,t,i){this._renderer.renderPipes.batch.break(i),i.add({renderPipeId:"filter",action:"popFilter",canBundle:false});}execute(e){e.action==="pushFilter"?this._renderer.filter.push(e):e.action==="popFilter"&&this._renderer.filter.pop();}destroy(){this._renderer=null;}};Uo.extension={type:[x.WebGLPipes,x.WebGPUPipes,x.CanvasPipes],name:"filter"};});function Og(r,e){e.clear();let t=e.matrix;for(let i=0;i<r.length;i++){let s=r[i];s.globalDisplayStatus<7||(e.matrix=s.worldTransform,e.addBounds(s.bounds));}return e.matrix=t,e}var VT=f(()=>{});var kk,zT,Lo,WT=f(()=>{B();Te();ns();Ys();ht();ye();ri();Ar();Lt();VT();Be();kk=new jt({attributes:{aPosition:{buffer:new Float32Array([0,0,1,0,1,1,0,1]),format:"float32x2",stride:2*4,offset:0}},indexBuffer:new Uint32Array([0,1,2,0,2,3])}),zT=class{constructor(){this.skip=false,this.inputTexture=null,this.backTexture=null,this.filters=null,this.bounds=new Ae,this.container=null,this.blendRequired=false,this.outputRenderSurface=null,this.globalFrame={x:0,y:0,width:0,height:0};}},Lo=class{constructor(e){this._filterStackIndex=0,this._filterStack=[],this._filterGlobalUniforms=new xe({uInputSize:{value:new Float32Array(4),type:"vec4<f32>"},uInputPixel:{value:new Float32Array(4),type:"vec4<f32>"},uInputClamp:{value:new Float32Array(4),type:"vec4<f32>"},uOutputFrame:{value:new Float32Array(4),type:"vec4<f32>"},uGlobalFrame:{value:new Float32Array(4),type:"vec4<f32>"},uOutputTexture:{value:new Float32Array(4),type:"vec4<f32>"}}),this._globalFilterBindGroup=new _t({}),this.renderer=e;}get activeBackTexture(){return this._activeFilterData?.backTexture}push(e){let t=this.renderer,i=e.filterEffect.filters,s=this._pushFilterData();s.skip=false,s.filters=i,s.container=e.container,s.outputRenderSurface=t.renderTarget.renderSurface;let n=t.renderTarget.renderTarget.colorTexture.source,o=n.resolution,a=n.antialias;if(i.length===0){s.skip=true;return}let u=s.bounds;if(this._calculateFilterArea(e,u),this._calculateFilterBounds(s,t.renderTarget.rootViewPort,a,o,1),s.skip)return;let l=this._getPreviousFilterData(),c=this._findFilterResolution(o),h=0,d=0;l&&(h=l.bounds.minX,d=l.bounds.minY),this._calculateGlobalFrame(s,h,d,c,n.width,n.height),this._setupFilterTextures(s,u,t,l);}generateFilteredTexture({texture:e,filters:t}){let i=this._pushFilterData();this._activeFilterData=i,i.skip=false,i.filters=t;let s=e.source,n=s.resolution,o=s.antialias;if(t.length===0)return i.skip=true,e;let a=i.bounds;if(a.addRect(e.frame),this._calculateFilterBounds(i,a.rectangle,o,n,0),i.skip)return e;let u=n;this._calculateGlobalFrame(i,0,0,u,s.width,s.height),i.outputRenderSurface=Me.getOptimalTexture(a.width,a.height,i.resolution,i.antialias),i.backTexture=exports.Texture.EMPTY,i.inputTexture=e,this.renderer.renderTarget.finishRenderPass(),this._applyFiltersToTexture(i,true);let d=i.outputRenderSurface;return d.source.alphaMode="premultiplied-alpha",d}pop(){let e=this.renderer,t=this._popFilterData();t.skip||(e.globalUniforms.pop(),e.renderTarget.finishRenderPass(),this._activeFilterData=t,this._applyFiltersToTexture(t,false),t.blendRequired&&Me.returnTexture(t.backTexture),Me.returnTexture(t.inputTexture));}getBackTexture(e,t,i){let s=e.colorTexture.source._resolution,n=Me.getOptimalTexture(t.width,t.height,s,false),o=t.minX,a=t.minY;i&&(o-=i.minX,a-=i.minY),o=Math.floor(o*s),a=Math.floor(a*s);let u=Math.ceil(t.width*s),l=Math.ceil(t.height*s);return this.renderer.renderTarget.copyToTexture(e,n,{x:o,y:a},{width:u,height:l},{x:0,y:0}),n}applyFilter(e,t,i,s){let n=this.renderer,o=this._activeFilterData,u=o.outputRenderSurface===i,l=n.renderTarget.rootRenderTarget.colorTexture.source._resolution,c=this._findFilterResolution(l),h=0,d=0;if(u){let p=this._findPreviousFilterOffset();h=p.x,d=p.y;}this._updateFilterUniforms(t,i,o,h,d,c,u,s),this._setupBindGroupsAndRender(e,t,n);}calculateSpriteMatrix(e,t){let i=this._activeFilterData,s=e.set(i.inputTexture._source.width,0,0,i.inputTexture._source.height,i.bounds.minX,i.bounds.minY),n=t.worldTransform.copyTo(G.shared),o=t.renderGroup||t.parentRenderGroup;return o&&o.cacheToLocalTransform&&n.prepend(o.cacheToLocalTransform),n.invert(),s.prepend(n),s.scale(1/t.texture.frame.width,1/t.texture.frame.height),s.translate(t.anchor.x,t.anchor.y),s}destroy(){}_setupBindGroupsAndRender(e,t,i){if(i.renderPipes.uniformBatch){let s=i.renderPipes.uniformBatch.getUboResource(this._filterGlobalUniforms);this._globalFilterBindGroup.setResource(s,0);}else this._globalFilterBindGroup.setResource(this._filterGlobalUniforms,0);this._globalFilterBindGroup.setResource(t.source,1),this._globalFilterBindGroup.setResource(t.source.style,2),e.groups[0]=this._globalFilterBindGroup,i.encoder.draw({geometry:kk,shader:e,state:e._state,topology:"triangle-list"}),i.type===qe.WEBGL&&i.renderTarget.finishRenderPass();}_setupFilterTextures(e,t,i,s){if(e.backTexture=exports.Texture.EMPTY,e.blendRequired){i.renderTarget.finishRenderPass();let n=i.renderTarget.getRenderTarget(e.outputRenderSurface);e.backTexture=this.getBackTexture(n,t,s?.bounds);}e.inputTexture=Me.getOptimalTexture(t.width,t.height,e.resolution,e.antialias),i.renderTarget.bind(e.inputTexture,true),i.globalUniforms.push({offset:t});}_calculateGlobalFrame(e,t,i,s,n,o){let a=e.globalFrame;a.x=t*s,a.y=i*s,a.width=n*s,a.height=o*s;}_updateFilterUniforms(e,t,i,s,n,o,a,u){let l=this._filterGlobalUniforms.uniforms,c=l.uOutputFrame,h=l.uInputSize,d=l.uInputPixel,p=l.uInputClamp,m=l.uGlobalFrame,b=l.uOutputTexture;a?(c[0]=i.bounds.minX-s,c[1]=i.bounds.minY-n):(c[0]=0,c[1]=0),c[2]=e.frame.width,c[3]=e.frame.height,h[0]=e.source.width,h[1]=e.source.height,h[2]=1/h[0],h[3]=1/h[1],d[0]=e.source.pixelWidth,d[1]=e.source.pixelHeight,d[2]=1/d[0],d[3]=1/d[1],p[0]=.5*d[2],p[1]=.5*d[3],p[2]=e.frame.width*h[2]-.5*d[2],p[3]=e.frame.height*h[3]-.5*d[3];let _=this.renderer.renderTarget.rootRenderTarget.colorTexture;m[0]=s*o,m[1]=n*o,m[2]=_.source.width*o,m[3]=_.source.height*o,t instanceof exports.Texture&&(t.source.resource=null);let g=this.renderer.renderTarget.getRenderTarget(t);this.renderer.renderTarget.bind(t,!!u),t instanceof exports.Texture?(b[0]=t.frame.width,b[1]=t.frame.height):(b[0]=g.width,b[1]=g.height),b[2]=g.isRoot?-1:1,this._filterGlobalUniforms.update();}_findFilterResolution(e){let t=this._filterStackIndex-1;for(;t>0&&this._filterStack[t].skip;)--t;return t>0&&this._filterStack[t].inputTexture?this._filterStack[t].inputTexture.source._resolution:e}_findPreviousFilterOffset(){let e=0,t=0,i=this._filterStackIndex;for(;i>0;){i--;let s=this._filterStack[i];if(!s.skip){e=s.bounds.minX,t=s.bounds.minY;break}}return {x:e,y:t}}_calculateFilterArea(e,t){if(e.renderables?Og(e.renderables,t):e.filterEffect.filterArea?(t.clear(),t.addRect(e.filterEffect.filterArea),t.applyMatrix(e.container.worldTransform)):e.container.getFastGlobalBounds(true,t),e.container){let s=(e.container.renderGroup||e.container.parentRenderGroup).cacheToLocalTransform;s&&t.applyMatrix(s);}}_applyFiltersToTexture(e,t){let i=e.inputTexture,s=e.bounds,n=e.filters;if(this._globalFilterBindGroup.setResource(i.source.style,2),this._globalFilterBindGroup.setResource(e.backTexture.source,3),n.length===1)n[0].apply(this,i,e.outputRenderSurface,t);else {let o=e.inputTexture,a=Me.getOptimalTexture(s.width,s.height,o.source._resolution,false),u=a,l=0;for(l=0;l<n.length-1;++l){n[l].apply(this,o,u,true);let h=o;o=u,u=h;}n[l].apply(this,o,e.outputRenderSurface,t),Me.returnTexture(a);}}_calculateFilterBounds(e,t,i,s,n){let o=this.renderer,a=e.bounds,u=e.filters,l=1/0,c=0,h=true,d=false,p=false,m=true;for(let b=0;b<u.length;b++){let _=u[b];if(l=Math.min(l,_.resolution==="inherit"?s:_.resolution),c+=_.padding,_.antialias==="off"?h=false:_.antialias==="inherit"&&h&&(h=i),_.clipToViewport||(m=false),!!!(_.compatibleRenderers&o.type)){p=false;break}if(_.blendRequired&&!(o.backBuffer?.useBackBuffer??true)){N("Blend filter requires backBuffer on WebGL renderer to be enabled. Set `useBackBuffer: true` in the renderer options."),p=false;break}p=_.enabled||p,d||(d=_.blendRequired);}if(!p){e.skip=true;return}if(m&&a.fitBounds(0,t.width/s,0,t.height/s),a.scale(l).ceil().scale(1/l).pad((c|0)*n),!a.isPositive){e.skip=true;return}e.antialias=h,e.resolution=l,e.blendRequired=d;}_popFilterData(){return this._filterStackIndex--,this._filterStack[this._filterStackIndex]}_getPreviousFilterData(){let e,t=this._filterStackIndex-1;for(;t>1&&(t--,e=this._filterStack[t],!!e.skip););return e}_pushFilterData(){let e=this._filterStack[this._filterStackIndex];return e||(e=this._filterStack[this._filterStackIndex]=new zT),this._filterStackIndex++,e}};Lo.extension={type:[x.WebGLSystem,x.WebGPUSystem],name:"filter"};});var XT=f(()=>{B();HT();WT();V.add(Lo);V.add(Uo);});var Ok={};var iw=f(()=>{BA();Oy();IA();kA();Rp();Op();mv();xv();Bv();nT();mT();wT();UT();NT();XT();});var YT,sw=f(()=>{B();YT={extension:{type:x.Environment,name:"browser",priority:-1},test:()=>true,load:async()=>{await Promise.resolve().then(()=>(iw(),Ok));}};});var Fk={};var nw=f(()=>{Oy();Rp();Op();mv();xv();Bv();nT();mT();wT();UT();NT();XT();});var jT,ow=f(()=>{B();jT={extension:{type:x.Environment,name:"webworker",priority:0},test:()=>typeof self<"u"&&self.WorkerGlobalScope!==void 0,load:async()=>{await Promise.resolve().then(()=>(nw(),Fk));}};});var aw,Dt,Ii=f(()=>{dr();Cr();zr();Pr();aw=class $T extends rt{constructor(e){e={...$T.defaultOptions,...e},super(e),this.enabled=true,this._state=Qe.for2d(),this.blendMode=e.blendMode,this.padding=e.padding,typeof e.antialias=="boolean"?this.antialias=e.antialias?"on":"off":this.antialias=e.antialias,this.resolution=e.resolution,this.blendRequired=e.blendRequired,this.clipToViewport=e.clipToViewport,this.addResource("uTexture",0,1);}apply(e,t,i,s){e.applyFilter(this,t,i,s);}get blendMode(){return this._state.blendMode}set blendMode(e){this._state.blendMode=e;}static from(e){let{gpu:t,gl:i,...s}=e,n,o;return t&&(n=$e.from(t)),i&&(o=je.from(i)),new $T({gpuProgram:n,glProgram:o,...s})}};aw.defaultOptions={blendMode:"normal",resolution:1,padding:0,antialias:"off",blendRequired:false,clipToViewport:true};Dt=aw;});var Fg,qT=f(()=>{Fg=`
577
577
  in vec2 vTextureCoord;
578
578
  in vec4 vColor;
579
579
 
@@ -696,7 +696,7 @@ fn mainFragment(
696
696
  {MAIN}
697
697
 
698
698
  return out;
699
- }`;});function uw(r){let{source:e,functions:t,main:i}=r;return e.replace("{FUNCTIONS}",t).replace("{MAIN}",i)}var ue,at=f(()=>{dr();Cr();ht();ye();Ii();qT();KT();ZT();ue=class extends Dt{constructor(e){let t=e.gpu,i=uw({source:Ug,...t}),s=$e.from({vertex:{source:i,entryPoint:"mainVertex"},fragment:{source:i,entryPoint:"mainFragment"}}),n=e.gl,o=uw({source:Fg,...n}),a=je.from({vertex:Gg,fragment:o}),u=new xe({uBlend:{value:1,type:"f32"}});super({gpuProgram:s,glProgram:a,blendRequired:true,resources:{blendUniforms:u,uBackTexture:exports.Texture.EMPTY}});}};});var xn,Ih=f(()=>{xn=`
699
+ }`;});function uw(r){let{source:e,functions:t,main:i}=r;return e.replace("{FUNCTIONS}",t).replace("{MAIN}",i)}var ae,at=f(()=>{dr();Cr();ht();ye();Ii();qT();KT();ZT();ae=class extends Dt{constructor(e){let t=e.gpu,i=uw({source:Ug,...t}),s=$e.from({vertex:{source:i,entryPoint:"mainVertex"},fragment:{source:i,entryPoint:"mainFragment"}}),n=e.gl,o=uw({source:Fg,...n}),a=je.from({vertex:Gg,fragment:o}),u=new xe({uBlend:{value:1,type:"f32"}});super({gpuProgram:s,glProgram:a,blendRequired:true,resources:{blendUniforms:u,uBackTexture:exports.Texture.EMPTY}});}};});var xn,Ih=f(()=>{xn=`
700
700
  float getLuminosity(vec3 c) {
701
701
  return 0.3 * c.r + 0.59 * c.g + 0.11 * c.b;
702
702
  }
@@ -872,7 +872,7 @@ fn mainFragment(
872
872
 
873
873
  return color;
874
874
  }
875
- `;});var kh,lw=f(()=>{B();at();Ih();Dh();kh=class extends ue{constructor(){super({gl:{functions:`
875
+ `;});var kh,lw=f(()=>{B();at();Ih();Dh();kh=class extends ae{constructor(){super({gl:{functions:`
876
876
  ${xn}
877
877
 
878
878
  vec3 blendColor(vec3 base, vec3 blend, float opacity)
@@ -890,7 +890,7 @@ fn mainFragment(
890
890
  }
891
891
  `,main:`
892
892
  out = vec4<f32>(blendColorOpacity(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
893
- `}});}};kh.extension={name:"color",type:x.BlendMode};});var Oh,cw=f(()=>{B();at();Oh=class extends ue{constructor(){super({gl:{functions:`
893
+ `}});}};kh.extension={name:"color",type:x.BlendMode};});var Oh,cw=f(()=>{B();at();Oh=class extends ae{constructor(){super({gl:{functions:`
894
894
  float colorBurn(float base, float blend)
895
895
  {
896
896
  return max((1.0 - ((1.0 - base) / blend)), 0.0);
@@ -926,7 +926,7 @@ fn mainFragment(
926
926
  }
927
927
  `,main:`
928
928
  out = vec4<f32>(blendColorBurn(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
929
- `}});}};Oh.extension={name:"color-burn",type:x.BlendMode};});var Fh,hw=f(()=>{B();at();Fh=class extends ue{constructor(){super({gl:{functions:`
929
+ `}});}};Oh.extension={name:"color-burn",type:x.BlendMode};});var Fh,hw=f(()=>{B();at();Fh=class extends ae{constructor(){super({gl:{functions:`
930
930
  float colorDodge(float base, float blend)
931
931
  {
932
932
  return base / (1.0 - blend);
@@ -962,7 +962,7 @@ fn mainFragment(
962
962
  }
963
963
  `,main:`
964
964
  out = vec4<f32>(blendColorDodge(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
965
- `}});}};Fh.extension={name:"color-dodge",type:x.BlendMode};});var Gh,dw=f(()=>{B();at();Gh=class extends ue{constructor(){super({gl:{functions:`
965
+ `}});}};Fh.extension={name:"color-dodge",type:x.BlendMode};});var Gh,dw=f(()=>{B();at();Gh=class extends ae{constructor(){super({gl:{functions:`
966
966
  vec3 blendDarken(vec3 base, vec3 blend, float opacity)
967
967
  {
968
968
  return (min(base, blend) * opacity + base * (1.0 - opacity));
@@ -976,7 +976,7 @@ fn mainFragment(
976
976
  }
977
977
  `,main:`
978
978
  out = vec4<f32>(blendDarken(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
979
- `}});}};Gh.extension={name:"darken",type:x.BlendMode};});var Uh,fw=f(()=>{B();at();Uh=class extends ue{constructor(){super({gl:{functions:`
979
+ `}});}};Gh.extension={name:"darken",type:x.BlendMode};});var Uh,fw=f(()=>{B();at();Uh=class extends ae{constructor(){super({gl:{functions:`
980
980
  vec3 blendDifference(vec3 base, vec3 blend, float opacity)
981
981
  {
982
982
  return (abs(blend - base) * opacity + base * (1.0 - opacity));
@@ -990,7 +990,7 @@ fn mainFragment(
990
990
  }
991
991
  `,main:`
992
992
  out = vec4<f32>(blendDifference(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
993
- `}});}};Uh.extension={name:"difference",type:x.BlendMode};});var Lh,pw=f(()=>{B();at();Lh=class extends ue{constructor(){super({gl:{functions:`
993
+ `}});}};Uh.extension={name:"difference",type:x.BlendMode};});var Lh,pw=f(()=>{B();at();Lh=class extends ae{constructor(){super({gl:{functions:`
994
994
  float divide(float base, float blend)
995
995
  {
996
996
  return (blend > 0.0) ? clamp(base / blend, 0.0, 1.0) : 1.0;
@@ -1025,7 +1025,7 @@ fn mainFragment(
1025
1025
  }
1026
1026
  `,main:`
1027
1027
  out = vec4<f32>(blendDivide(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
1028
- `}});}};Lh.extension={name:"divide",type:x.BlendMode};});var Nh,mw=f(()=>{B();at();Nh=class extends ue{constructor(){super({gl:{functions:`
1028
+ `}});}};Lh.extension={name:"divide",type:x.BlendMode};});var Nh,mw=f(()=>{B();at();Nh=class extends ae{constructor(){super({gl:{functions:`
1029
1029
  vec3 exclusion(vec3 base, vec3 blend)
1030
1030
  {
1031
1031
  return base + blend - 2.0 * base * blend;
@@ -1049,7 +1049,7 @@ fn mainFragment(
1049
1049
  }
1050
1050
  `,main:`
1051
1051
  out = vec4<f32>(blendExclusion(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
1052
- `}});}};Nh.extension={name:"exclusion",type:x.BlendMode};});var Hh,gw=f(()=>{B();at();Hh=class extends ue{constructor(){super({gl:{functions:`
1052
+ `}});}};Nh.extension={name:"exclusion",type:x.BlendMode};});var Hh,gw=f(()=>{B();at();Hh=class extends ae{constructor(){super({gl:{functions:`
1053
1053
  float hardLight(float base, float blend)
1054
1054
  {
1055
1055
  return (blend < 0.5) ? 2.0 * base * blend : 1.0 - 2.0 * (1.0 - base) * (1.0 - blend);
@@ -1084,7 +1084,7 @@ fn mainFragment(
1084
1084
  }
1085
1085
  `,main:`
1086
1086
  out = vec4<f32>(blendHardLight(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
1087
- `}});}};Hh.extension={name:"hard-light",type:x.BlendMode};});var Vh,xw=f(()=>{B();at();Vh=class extends ue{constructor(){super({gl:{functions:`
1087
+ `}});}};Hh.extension={name:"hard-light",type:x.BlendMode};});var Vh,xw=f(()=>{B();at();Vh=class extends ae{constructor(){super({gl:{functions:`
1088
1088
  float hardMix(float base, float blend)
1089
1089
  {
1090
1090
  return (base + blend >= 1.0) ? 1.0 : 0.0;
@@ -1118,7 +1118,7 @@ fn mainFragment(
1118
1118
  }
1119
1119
  `,main:`
1120
1120
  out = vec4<f32>(blendHardMix(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
1121
- `}});}};Vh.extension={name:"hard-mix",type:x.BlendMode};});var zh,_w=f(()=>{B();at();zh=class extends ue{constructor(){super({gl:{functions:`
1121
+ `}});}};Vh.extension={name:"hard-mix",type:x.BlendMode};});var zh,_w=f(()=>{B();at();zh=class extends ae{constructor(){super({gl:{functions:`
1122
1122
  vec3 blendLighten(vec3 base, vec3 blend, float opacity)
1123
1123
  {
1124
1124
  return (max(base, blend) * opacity + base * (1.0 - opacity));
@@ -1132,7 +1132,7 @@ fn mainFragment(
1132
1132
  }
1133
1133
  `,main:`
1134
1134
  out = vec4<f32>(blendLighten(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
1135
- `}});}};zh.extension={name:"lighten",type:x.BlendMode};});var Wh,bw=f(()=>{B();at();Wh=class extends ue{constructor(){super({gl:{functions:`
1135
+ `}});}};zh.extension={name:"lighten",type:x.BlendMode};});var Wh,bw=f(()=>{B();at();Wh=class extends ae{constructor(){super({gl:{functions:`
1136
1136
  float linearBurn(float base, float blend)
1137
1137
  {
1138
1138
  return max(0.0, base + blend - 1.0);
@@ -1168,7 +1168,7 @@ fn mainFragment(
1168
1168
  }
1169
1169
  `,main:`
1170
1170
  out = vec4<f32>(blendLinearBurn(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
1171
- `}});}};Wh.extension={name:"linear-burn",type:x.BlendMode};});var Xh,yw=f(()=>{B();at();Xh=class extends ue{constructor(){super({gl:{functions:`
1171
+ `}});}};Wh.extension={name:"linear-burn",type:x.BlendMode};});var Xh,yw=f(()=>{B();at();Xh=class extends ae{constructor(){super({gl:{functions:`
1172
1172
  float linearDodge(float base, float blend) {
1173
1173
  return min(1.0, base + blend);
1174
1174
  }
@@ -1201,7 +1201,7 @@ fn mainFragment(
1201
1201
  }
1202
1202
  `,main:`
1203
1203
  out = vec4<f32>(blendLinearDodge(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
1204
- `}});}};Xh.extension={name:"linear-dodge",type:x.BlendMode};});var Yh,vw=f(()=>{B();at();Yh=class extends ue{constructor(){super({gl:{functions:`
1204
+ `}});}};Xh.extension={name:"linear-dodge",type:x.BlendMode};});var Yh,vw=f(()=>{B();at();Yh=class extends ae{constructor(){super({gl:{functions:`
1205
1205
  float linearBurn(float base, float blend) {
1206
1206
  return max(0.0, base + blend - 1.0);
1207
1207
  }
@@ -1253,7 +1253,7 @@ fn mainFragment(
1253
1253
  }
1254
1254
  `,main:`
1255
1255
  out = vec4<f32>(blendLinearLightOpacity(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
1256
- `}});}};Yh.extension={name:"linear-light",type:x.BlendMode};});var jh,Tw=f(()=>{B();at();Ih();Dh();jh=class extends ue{constructor(){super({gl:{functions:`
1256
+ `}});}};Yh.extension={name:"linear-light",type:x.BlendMode};});var jh,Tw=f(()=>{B();at();Ih();Dh();jh=class extends ae{constructor(){super({gl:{functions:`
1257
1257
  ${xn}
1258
1258
 
1259
1259
  vec3 blendLuminosity(vec3 base, vec3 blend, float opacity)
@@ -1273,7 +1273,7 @@ fn mainFragment(
1273
1273
  }
1274
1274
  `,main:`
1275
1275
  out = vec4<f32>(blendLuminosity(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
1276
- `}});}};jh.extension={name:"luminosity",type:x.BlendMode};});var $h,Sw=f(()=>{B();at();$h=class extends ue{constructor(){super({gl:{functions:`
1276
+ `}});}};jh.extension={name:"luminosity",type:x.BlendMode};});var $h,Sw=f(()=>{B();at();$h=class extends ae{constructor(){super({gl:{functions:`
1277
1277
  vec3 negation(vec3 base, vec3 blend)
1278
1278
  {
1279
1279
  return 1.0-abs(1.0-base-blend);
@@ -1297,7 +1297,7 @@ fn mainFragment(
1297
1297
  }
1298
1298
  `,main:`
1299
1299
  out = vec4<f32>(blendNegationOpacity(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
1300
- `}});}};$h.extension={name:"negation",type:x.BlendMode};});var qh,Ew=f(()=>{B();at();qh=class extends ue{constructor(){super({gl:{functions:`
1300
+ `}});}};$h.extension={name:"negation",type:x.BlendMode};});var qh,Ew=f(()=>{B();at();qh=class extends ae{constructor(){super({gl:{functions:`
1301
1301
  float overlay(float base, float blend)
1302
1302
  {
1303
1303
  return (base < 0.5) ? (2.0*base*blend) : (1.0-2.0*(1.0-base)*(1.0-blend));
@@ -1333,7 +1333,7 @@ fn mainFragment(
1333
1333
  }
1334
1334
  `,main:`
1335
1335
  out = vec4<f32>(blendOverlay(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
1336
- `}});}};qh.extension={name:"overlay",type:x.BlendMode};});var Kh,Cw=f(()=>{B();at();Kh=class extends ue{constructor(){super({gl:{functions:`
1336
+ `}});}};qh.extension={name:"overlay",type:x.BlendMode};});var Kh,Cw=f(()=>{B();at();Kh=class extends ae{constructor(){super({gl:{functions:`
1337
1337
  float pinLight(float base, float blend)
1338
1338
  {
1339
1339
  return (blend <= 0.5) ? min(base, 2.0 * blend) : max(base, 2.0 * (blend - 0.5));
@@ -1369,7 +1369,7 @@ fn mainFragment(
1369
1369
  }
1370
1370
  `,main:`
1371
1371
  out = vec4<f32>(blendPinLight(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
1372
- `}});}};Kh.extension={name:"pin-light",type:x.BlendMode};});var Zh,Aw=f(()=>{B();at();Ih();Dh();Zh=class extends ue{constructor(){super({gl:{functions:`
1372
+ `}});}};Kh.extension={name:"pin-light",type:x.BlendMode};});var Zh,Aw=f(()=>{B();at();Ih();Dh();Zh=class extends ae{constructor(){super({gl:{functions:`
1373
1373
  ${xn}
1374
1374
 
1375
1375
  vec3 blendSaturation(vec3 base, vec3 blend, float opacity)
@@ -1389,7 +1389,7 @@ fn mainFragment(
1389
1389
  }
1390
1390
  `,main:`
1391
1391
  out = vec4<f32>(blendSaturation(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
1392
- `}});}};Zh.extension={name:"saturation",type:x.BlendMode};});var Qh,Pw=f(()=>{B();at();Qh=class extends ue{constructor(){super({gl:{functions:`
1392
+ `}});}};Zh.extension={name:"saturation",type:x.BlendMode};});var Qh,Pw=f(()=>{B();at();Qh=class extends ae{constructor(){super({gl:{functions:`
1393
1393
  float softLight(float base, float blend)
1394
1394
  {
1395
1395
  return (blend < 0.5) ? (2.0 * base * blend + base * base * (1.0 - 2.0 * blend)) : (sqrt(base) * (2.0 * blend - 1.0) + 2.0 * base * (1.0 - blend));
@@ -1425,7 +1425,7 @@ fn mainFragment(
1425
1425
  }
1426
1426
  `,main:`
1427
1427
  out = vec4<f32>(blendSoftLight(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
1428
- `}});}};Qh.extension={name:"soft-light",type:x.BlendMode};});var Jh,ww=f(()=>{B();at();Jh=class extends ue{constructor(){super({gl:{functions:`
1428
+ `}});}};Qh.extension={name:"soft-light",type:x.BlendMode};});var Jh,ww=f(()=>{B();at();Jh=class extends ae{constructor(){super({gl:{functions:`
1429
1429
  float subtract(float base, float blend)
1430
1430
  {
1431
1431
  return max(0.0, base - blend);
@@ -1461,7 +1461,7 @@ fn mainFragment(
1461
1461
  }
1462
1462
  `,main:`
1463
1463
  out = vec4<f32>(blendSubtract(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
1464
- `}});}};Jh.extension={name:"subtract",type:x.BlendMode};});var ed,Bw=f(()=>{B();at();ed=class extends ue{constructor(){super({gl:{functions:`
1464
+ `}});}};Jh.extension={name:"subtract",type:x.BlendMode};});var ed,Bw=f(()=>{B();at();ed=class extends ae{constructor(){super({gl:{functions:`
1465
1465
  float colorBurn(float base, float blend)
1466
1466
  {
1467
1467
  return max((1.0-((1.0-base)/blend)),0.0);
@@ -1517,7 +1517,7 @@ fn mainFragment(
1517
1517
  }
1518
1518
  `,main:`
1519
1519
  out = vec4<f32>(blendVividLight(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
1520
- `}});}};ed.extension={name:"vivid-light",type:x.BlendMode};});async function td(r){if(!r)for(let e=0;e<QT.length;e++){let t=QT[e];if(t.value.test()){await t.value.load();return}}}async function Rw(r){return td(!r)}var QT,JT=f(()=>{B();QT=[];V.handleByNamedList(x.Environment,QT);});function el(){if(typeof rd=="boolean")return rd;try{rd=new Function("param1","param2","param3","return param1[param2] === param3;")({a:"b"},"a","b")===!0;}catch{rd=false;}return rd}var rd,Lg=f(()=>{});var bt,No=f(()=>{bt=(r=>(r[r.NONE=0]="NONE",r[r.COLOR=16384]="COLOR",r[r.STENCIL=1024]="STENCIL",r[r.DEPTH=256]="DEPTH",r[r.COLOR_DEPTH=16640]="COLOR_DEPTH",r[r.COLOR_STENCIL=17408]="COLOR_STENCIL",r[r.DEPTH_STENCIL=1280]="DEPTH_STENCIL",r[r.ALL=17664]="ALL",r))(bt||{});});var bn,Ng=f(()=>{bn=class{constructor(e){this.items=[],this._name=e;}emit(e,t,i,s,n,o,a,u){let{name:l,items:c}=this;for(let h=0,d=c.length;h<d;h++)c[h][l](e,t,i,s,n,o,a,u);return this}add(e){return e[this._name]&&(this.remove(e),this.items.push(e)),this}remove(e){let t=this.items.indexOf(e);return t!==-1&&this.items.splice(t,1),this}contains(e){return this.items.indexOf(e)!==-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}};});var Gk,Mw,Di,tl=f(()=>{gt();JT();hr();Lg();Et();Pe();No();Ng();Ut();Gk=["init","destroy","contextChange","resolutionChange","resetState","renderEnd","renderStart","render","update","postrender","prerender"],Mw=class Iw extends _e{constructor(e){super(),this.uid=ce("renderer"),this.runners=Object.create(null),this.renderPipes=Object.create(null),this._initOptions={},this._systemsHash=Object.create(null),this.type=e.type,this.name=e.name,this.config=e;let t=[...Gk,...this.config.runners??[]];this._addRunners(...t),this._unsafeEvalCheck();}async init(e={}){let t=e.skipExtensionImports===true?true:e.manageImports===false;await td(t),this._addSystems(this.config.systems),this._addPipes(this.config.renderPipes,this.config.renderPipeAdaptors);for(let i in this._systemsHash)e={...this._systemsHash[i].constructor.defaultOptions,...e};e={...Iw.defaultOptions,...e},this._roundPixels=e.roundPixels?1:0;for(let i=0;i<this.runners.init.items.length;i++)await this.runners.init.items[i].init(e);this._initOptions=e;}render(e,t){let i=e;if(i instanceof exports.PixiJSContainer&&(i={container:i},t&&(U(Y,"passing a second argument is deprecated, please use render options instead"),i.target=t.renderTexture)),i.target||(i.target=this.view.renderTarget),i.target===this.view.renderTarget&&(this._lastObjectRendered=i.container,i.clearColor??(i.clearColor=this.background.colorRgba),i.clear??(i.clear=this.background.clearBeforeRender)),i.clearColor){let s=Array.isArray(i.clearColor)&&i.clearColor.length===4;i.clearColor=s?i.clearColor:te.shared.setValue(i.clearColor).toArray();}i.transform||(i.container.updateLocalTransform(),i.transform=i.container.localTransform),i.container.enableRenderGroup(),this.runners.prerender.emit(i),this.runners.renderStart.emit(i),this.runners.render.emit(i),this.runners.renderEnd.emit(i),this.runners.postrender.emit(i);}resize(e,t,i){let s=this.view.resolution;this.view.resize(e,t,i),this.emit("resize",this.view.screen.width,this.view.screen.height,this.view.resolution),i!==void 0&&i!==s&&this.runners.resolutionChange.emit(i);}clear(e={}){let t=this;e.target||(e.target=t.renderTarget.renderTarget),e.clearColor||(e.clearColor=this.background.colorRgba),e.clear??(e.clear=bt.ALL);let{clear:i,clearColor:s,target:n}=e;te.shared.setValue(s??this.background.colorRgba),t.renderTarget.clear(n,i,te.shared.toArray());}get resolution(){return this.view.resolution}set resolution(e){this.view.resolution=e,this.runners.resolutionChange.emit(e);}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(...e){e.forEach(t=>{this.runners[t]=new bn(t);});}_addSystems(e){let t;for(t in e){let i=e[t];this._addSystem(i.value,i.name);}}_addSystem(e,t){let i=new e(this);if(this[t])throw new Error(`Whoops! The name "${t}" is already in use`);this[t]=i,this._systemsHash[t]=i;for(let s in this.runners)this.runners[s].add(i);return this}_addPipes(e,t){let i=t.reduce((s,n)=>(s[n.name]=n.value,s),{});e.forEach(s=>{let n=s.value,o=s.name,a=i[o];this.renderPipes[o]=new n(this,a?new a:null);});}destroy(e=false){this.runners.destroy.items.reverse(),this.runners.destroy.emit(e),Object.values(this.runners).forEach(t=>{t.destroy();}),this._systemsHash=null,this.renderPipes=null;}generateTexture(e){return this.textureGenerator.generateTexture(e)}get roundPixels(){return !!this._roundPixels}_unsafeEvalCheck(){if(!el())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();}};Mw.defaultOptions={resolution:1,failIfMajorPerformanceCaveat:false,roundPixels:false};Di=Mw;});function ki(r){return Hg!==void 0||(Hg=(()=>{let e={stencil:true,failIfMajorPerformanceCaveat:r??Di.defaultOptions.failIfMajorPerformanceCaveat};try{if(!j.get().getWebGLRenderingContext())return !1;let i=j.get().createCanvas().getContext("webgl",e),s=!!i?.getContextAttributes()?.stencil;if(i){let n=i.getExtension("WEBGL_lose_context");n&&n.loseContext();}return i=null,s}catch{return false}})()),Hg}var Hg,rl=f(()=>{Ge();tl();});async function Oi(r={}){return Vg!==void 0||(Vg=await(async()=>{let e=j.get().getNavigator().gpu;if(!e)return false;try{return await(await e.requestAdapter(r)).requestDevice(),!0}catch{return false}})()),Vg}var Vg,il=f(()=>{Ge();});var Ho,eS=f(()=>{B();Te();Kc();as();Cu();Au();Oo();us();Wr();ht();Ho=class{constructor(){this._maxTextures=0;}contextChange(e){let t=new xe({uTransformMatrix:{value:new G,type:"mat3x3<f32>"},uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uRound:{value:0,type:"f32"}});this._maxTextures=e.limits.maxBatchableTextures;let i=Nr({name:"graphics",bits:[Ks,Qs(this._maxTextures),Pg,Vr]});this.shader=new rt({gpuProgram:i,resources:{localUniforms:t}});}execute(e,t){let i=t.context,s=i.customShader||this.shader,n=e.renderer,o=n.graphicsContext,{batcher:a,instructions:u}=o.getContextRenderData(i),l=n.encoder;l.setGeometry(a.geometry,s.gpuProgram);let c=n.globalUniforms.bindGroup;l.setBindGroup(0,c,s.gpuProgram);let h=n.renderPipes.uniformBatch.getUniformBindGroup(s.resources.localUniforms,true);l.setBindGroup(2,h,s.gpuProgram);let d=u.instructions,p=null;for(let m=0;m<u.instructionSize;m++){let b=d[m];if(b.topology!==p&&(p=b.topology,l.setPipelineFromGeometryProgramAndState(a.geometry,s.gpuProgram,e.state,b.topology)),s.groups[1]=b.bindGroup,!b.gpuBindGroup){let _=b.textures;b.bindGroup=Ws(_.textures,_.count,this._maxTextures),b.gpuBindGroup=n.bindGroup.getBindGroup(b.bindGroup,s.gpuProgram,1);}l.setBindGroup(1,b.bindGroup,s.gpuProgram),l.renderPassEncoder.drawIndexed(b.size,1,b.start);}}destroy(){this.shader.destroy(true),this.shader=null;}};Ho.extension={type:[x.WebGPUPipesAdaptor],name:"graphics"};});var zg,Wg,Xg=f(()=>{zg={name:"texture-bit",vertex:{header:`
1520
+ `}});}};ed.extension={name:"vivid-light",type:x.BlendMode};});async function td(r){if(!r)for(let e=0;e<QT.length;e++){let t=QT[e];if(t.value.test()){await t.value.load();return}}}async function Rw(r){return td(!r)}var QT,JT=f(()=>{B();QT=[];V.handleByNamedList(x.Environment,QT);});function el(){if(typeof rd=="boolean")return rd;try{rd=new Function("param1","param2","param3","return param1[param2] === param3;")({a:"b"},"a","b")===!0;}catch{rd=false;}return rd}var rd,Lg=f(()=>{});var bt,No=f(()=>{bt=(r=>(r[r.NONE=0]="NONE",r[r.COLOR=16384]="COLOR",r[r.STENCIL=1024]="STENCIL",r[r.DEPTH=256]="DEPTH",r[r.COLOR_DEPTH=16640]="COLOR_DEPTH",r[r.COLOR_STENCIL=17408]="COLOR_STENCIL",r[r.DEPTH_STENCIL=1280]="DEPTH_STENCIL",r[r.ALL=17664]="ALL",r))(bt||{});});var bn,Ng=f(()=>{bn=class{constructor(e){this.items=[],this._name=e;}emit(e,t,i,s,n,o,a,u){let{name:l,items:c}=this;for(let h=0,d=c.length;h<d;h++)c[h][l](e,t,i,s,n,o,a,u);return this}add(e){return e[this._name]&&(this.remove(e),this.items.push(e)),this}remove(e){let t=this.items.indexOf(e);return t!==-1&&this.items.splice(t,1),this}contains(e){return this.items.indexOf(e)!==-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}};});var Gk,Mw,Di,tl=f(()=>{gt();JT();hr();Lg();Et();Pe();No();Ng();Ut();Gk=["init","destroy","contextChange","resolutionChange","resetState","renderEnd","renderStart","render","update","postrender","prerender"],Mw=class Iw extends _e{constructor(e){super(),this.uid=ce("renderer"),this.runners=Object.create(null),this.renderPipes=Object.create(null),this._initOptions={},this._systemsHash=Object.create(null),this.type=e.type,this.name=e.name,this.config=e;let t=[...Gk,...this.config.runners??[]];this._addRunners(...t),this._unsafeEvalCheck();}async init(e={}){let t=e.skipExtensionImports===true?true:e.manageImports===false;await td(t),this._addSystems(this.config.systems),this._addPipes(this.config.renderPipes,this.config.renderPipeAdaptors);for(let i in this._systemsHash)e={...this._systemsHash[i].constructor.defaultOptions,...e};e={...Iw.defaultOptions,...e},this._roundPixels=e.roundPixels?1:0;for(let i=0;i<this.runners.init.items.length;i++)await this.runners.init.items[i].init(e);this._initOptions=e;}render(e,t){let i=e;if(i instanceof ue&&(i={container:i},t&&(U(Y,"passing a second argument is deprecated, please use render options instead"),i.target=t.renderTexture)),i.target||(i.target=this.view.renderTarget),i.target===this.view.renderTarget&&(this._lastObjectRendered=i.container,i.clearColor??(i.clearColor=this.background.colorRgba),i.clear??(i.clear=this.background.clearBeforeRender)),i.clearColor){let s=Array.isArray(i.clearColor)&&i.clearColor.length===4;i.clearColor=s?i.clearColor:te.shared.setValue(i.clearColor).toArray();}i.transform||(i.container.updateLocalTransform(),i.transform=i.container.localTransform),i.container.enableRenderGroup(),this.runners.prerender.emit(i),this.runners.renderStart.emit(i),this.runners.render.emit(i),this.runners.renderEnd.emit(i),this.runners.postrender.emit(i);}resize(e,t,i){let s=this.view.resolution;this.view.resize(e,t,i),this.emit("resize",this.view.screen.width,this.view.screen.height,this.view.resolution),i!==void 0&&i!==s&&this.runners.resolutionChange.emit(i);}clear(e={}){let t=this;e.target||(e.target=t.renderTarget.renderTarget),e.clearColor||(e.clearColor=this.background.colorRgba),e.clear??(e.clear=bt.ALL);let{clear:i,clearColor:s,target:n}=e;te.shared.setValue(s??this.background.colorRgba),t.renderTarget.clear(n,i,te.shared.toArray());}get resolution(){return this.view.resolution}set resolution(e){this.view.resolution=e,this.runners.resolutionChange.emit(e);}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(...e){e.forEach(t=>{this.runners[t]=new bn(t);});}_addSystems(e){let t;for(t in e){let i=e[t];this._addSystem(i.value,i.name);}}_addSystem(e,t){let i=new e(this);if(this[t])throw new Error(`Whoops! The name "${t}" is already in use`);this[t]=i,this._systemsHash[t]=i;for(let s in this.runners)this.runners[s].add(i);return this}_addPipes(e,t){let i=t.reduce((s,n)=>(s[n.name]=n.value,s),{});e.forEach(s=>{let n=s.value,o=s.name,a=i[o];this.renderPipes[o]=new n(this,a?new a:null);});}destroy(e=false){this.runners.destroy.items.reverse(),this.runners.destroy.emit(e),Object.values(this.runners).forEach(t=>{t.destroy();}),this._systemsHash=null,this.renderPipes=null;}generateTexture(e){return this.textureGenerator.generateTexture(e)}get roundPixels(){return !!this._roundPixels}_unsafeEvalCheck(){if(!el())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();}};Mw.defaultOptions={resolution:1,failIfMajorPerformanceCaveat:false,roundPixels:false};Di=Mw;});function ki(r){return Hg!==void 0||(Hg=(()=>{let e={stencil:true,failIfMajorPerformanceCaveat:r??Di.defaultOptions.failIfMajorPerformanceCaveat};try{if(!j.get().getWebGLRenderingContext())return !1;let i=j.get().createCanvas().getContext("webgl",e),s=!!i?.getContextAttributes()?.stencil;if(i){let n=i.getExtension("WEBGL_lose_context");n&&n.loseContext();}return i=null,s}catch{return false}})()),Hg}var Hg,rl=f(()=>{Fe();tl();});async function Oi(r={}){return Vg!==void 0||(Vg=await(async()=>{let e=j.get().getNavigator().gpu;if(!e)return false;try{return await(await e.requestAdapter(r)).requestDevice(),!0}catch{return false}})()),Vg}var Vg,il=f(()=>{Fe();});var Ho,eS=f(()=>{B();Te();Kc();as();Cu();Au();Oo();us();zr();ht();Ho=class{constructor(){this._maxTextures=0;}contextChange(e){let t=new xe({uTransformMatrix:{value:new G,type:"mat3x3<f32>"},uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uRound:{value:0,type:"f32"}});this._maxTextures=e.limits.maxBatchableTextures;let i=Lr({name:"graphics",bits:[Ks,Qs(this._maxTextures),Pg,Hr]});this.shader=new rt({gpuProgram:i,resources:{localUniforms:t}});}execute(e,t){let i=t.context,s=i.customShader||this.shader,n=e.renderer,o=n.graphicsContext,{batcher:a,instructions:u}=o.getContextRenderData(i),l=n.encoder;l.setGeometry(a.geometry,s.gpuProgram);let c=n.globalUniforms.bindGroup;l.setBindGroup(0,c,s.gpuProgram);let h=n.renderPipes.uniformBatch.getUniformBindGroup(s.resources.localUniforms,true);l.setBindGroup(2,h,s.gpuProgram);let d=u.instructions,p=null;for(let m=0;m<u.instructionSize;m++){let b=d[m];if(b.topology!==p&&(p=b.topology,l.setPipelineFromGeometryProgramAndState(a.geometry,s.gpuProgram,e.state,b.topology)),s.groups[1]=b.bindGroup,!b.gpuBindGroup){let _=b.textures;b.bindGroup=Ws(_.textures,_.count,this._maxTextures),b.gpuBindGroup=n.bindGroup.getBindGroup(b.bindGroup,s.gpuProgram,1);}l.setBindGroup(1,b.bindGroup,s.gpuProgram),l.renderPassEncoder.drawIndexed(b.size,1,b.start);}}destroy(){this.shader.destroy(true),this.shader=null;}};Ho.extension={type:[x.WebGPUPipesAdaptor],name:"graphics"};});var zg,Wg,Xg=f(()=>{zg={name:"texture-bit",vertex:{header:`
1521
1521
 
1522
1522
  struct TextureUniforms {
1523
1523
  uTextureMatrix:mat3x3<f32>,
@@ -1543,7 +1543,7 @@ fn mainFragment(
1543
1543
 
1544
1544
  `,main:`
1545
1545
  outColor = texture(uTexture, vUV);
1546
- `}};});var Vo,tS=f(()=>{B();Te();as();Oo();us();Xg();Wr();ye();Be();Vo=class{init(){let e=Nr({name:"mesh",bits:[ps,zg,Vr]});this._shader=new rt({gpuProgram:e,resources:{uTexture:exports.Texture.EMPTY._source,uSampler:exports.Texture.EMPTY._source.style,textureUniforms:{uTextureMatrix:{type:"mat3x3<f32>",value:new G}}}});}execute(e,t){let i=e.renderer,s=t._shader;if(!s)s=this._shader,s.groups[2]=i.texture.getTextureBindGroup(t.texture);else if(!s.gpuProgram){N("Mesh shader has no gpuProgram",t.shader);return}let n=s.gpuProgram;if(n.autoAssignGlobalUniforms&&(s.groups[0]=i.globalUniforms.bindGroup),n.autoAssignLocalUniforms){let o=e.localUniforms;s.groups[1]=i.renderPipes.uniformBatch.getUniformBindGroup(o,true);}i.encoder.draw({geometry:t._geometry,shader:s,state:t.state});}destroy(){this._shader.destroy(true),this._shader=null;}};Vo.extension={type:[x.WebGPUPipesAdaptor],name:"mesh"};});var Yg,zo,rS=f(()=>{B();Pr();Kc();Yg=Qe.for2d(),zo=class{start(e,t,i){let s=e.renderer,n=s.encoder,o=i.gpuProgram;this._shader=i,this._geometry=t,n.setGeometry(t,o),Yg.blendMode="normal",s.pipeline.getPipeline(t,o,Yg);let a=s.globalUniforms.bindGroup;n.resetBindGroup(1),n.setBindGroup(0,a,o);}execute(e,t){let i=this._shader.gpuProgram,s=e.renderer,n=s.encoder;if(!t.bindGroup){let u=t.textures;t.bindGroup=Ws(u.textures,u.count,s.limits.maxBatchableTextures);}Yg.blendMode=t.blendMode;let o=s.bindGroup.getBindGroup(t.bindGroup,i,1),a=s.pipeline.getPipeline(this._geometry,i,Yg,t.topology);t.bindGroup._touch(s.textureGC.count),n.setPipeline(a),n.renderPassEncoder.setBindGroup(1,o),n.renderPassEncoder.drawIndexed(t.size,1,t.start);}};zo.extension={type:[x.WebGPUPipesAdaptor],name:"batch"};});var Wo,iS=f(()=>{B();Wo=class{constructor(e){this._renderer=e;}updateRenderable(){}destroyRenderable(){}validateRenderable(){return false}addRenderable(e,t){this._renderer.renderPipes.batch.break(t),t.add(e);}execute(e){e.isRenderable&&e.render(this._renderer);}destroy(){this._renderer=null;}};Wo.extension={type:[x.WebGLPipes,x.WebGPUPipes,x.CanvasPipes],name:"customRender"};});function Xo(r,e){let t=r.instructionSet,i=t.instructions;for(let s=0;s<t.instructionSize;s++){let n=i[s];e[n.renderPipeId].execute(n);}}var jg=f(()=>{});var Uk,Yo,sS=f(()=>{B();Te();Si();Fu();jg();Uk=new G,Yo=class{constructor(e){this._renderer=e;}addRenderGroup(e,t){e.isCachedAsTexture?this._addRenderableCacheAsTexture(e,t):this._addRenderableDirect(e,t);}execute(e){e.isRenderable&&(e.isCachedAsTexture?this._executeCacheAsTexture(e):this._executeDirect(e));}destroy(){this._renderer=null;}_addRenderableDirect(e,t){this._renderer.renderPipes.batch.break(t),e._batchableRenderGroup&&(Ve.return(e._batchableRenderGroup),e._batchableRenderGroup=null),t.add(e);}_addRenderableCacheAsTexture(e,t){let i=e._batchableRenderGroup??(e._batchableRenderGroup=Ve.get(Yr));i.renderable=e.root,i.transform=e.root.relativeGroupTransform,i.texture=e.texture,i.bounds=e._textureBounds,t.add(e),this._renderer.renderPipes.batch.addToBatch(i,t);}_executeCacheAsTexture(e){if(e.textureNeedsUpdate){e.textureNeedsUpdate=false;let t=Uk.identity().translate(-e._textureBounds.x,-e._textureBounds.y);this._renderer.renderTarget.push(e.texture,true,null,e.texture.frame),this._renderer.globalUniforms.push({worldTransformMatrix:t,worldColor:4294967295}),Xo(e,this._renderer.renderPipes),this._renderer.renderTarget.finishRenderPass(),this._renderer.renderTarget.pop(),this._renderer.globalUniforms.pop();}e._batchableRenderGroup._batcher.updateElement(e._batchableRenderGroup),e._batchableRenderGroup._batcher.geometry.buffers[0].update();}_executeDirect(e){this._renderer.globalUniforms.push({worldTransformMatrix:e.inverseParentTextureTransform,worldColor:e.worldColorAlpha}),Xo(e,this._renderer.renderPipes),this._renderer.globalUniforms.pop();}};Yo.extension={type:[x.WebGLPipes,x.WebGPUPipes,x.CanvasPipes],name:"renderGroup"};});function jo(r,e){e||(e=0);for(let t=e;t<r.length&&r[t];t++)r[t]=null;}var $g=f(()=>{});function id(r,e=false){nS(r);let t=r.childrenToUpdate,i=r.updateTick++;for(let s in t){let n=Number(s),o=t[s],a=o.list,u=o.index;for(let l=0;l<u;l++){let c=a[l];c.parentRenderGroup===r&&c.relativeRenderGroupDepth===n&&qg(c,i,0);}jo(a,u),o.index=0;}if(e)for(let s=0;s<r.renderGroupChildren.length;s++)id(r.renderGroupChildren[s],e);}function nS(r){let e=r.root,t;if(r.renderGroupParent){let i=r.renderGroupParent;r.worldTransform.appendFrom(e.relativeGroupTransform,i.worldTransform),r.worldColor=Rs(e.groupColor,i.worldColor),t=e.groupAlpha*i.worldAlpha;}else r.worldTransform.copyFrom(e.localTransform),r.worldColor=e.localColor,t=e.localAlpha;t=t<0?0:t>1?1:t,r.worldAlpha=t,r.worldColorAlpha=r.worldColor+((t*255|0)<<24);}function qg(r,e,t){if(e===r.updateTick)return;r.updateTick=e,r.didChange=false;let i=r.localTransform;r.updateLocalTransform();let s=r.parent;if(s&&!s.renderGroup?(t|=r._updateFlags,r.relativeGroupTransform.appendFrom(i,s.relativeGroupTransform),t&Dw&&kw(r,s,t)):(t=r._updateFlags,r.relativeGroupTransform.copyFrom(i),t&Dw&&kw(r,Lk,t)),!r.renderGroup){let n=r.children,o=n.length;for(let l=0;l<o;l++)qg(n[l],e,t);let a=r.parentRenderGroup,u=r;u.renderPipeId&&!a.structureDidChange&&a.updateRenderable(u);}}function kw(r,e,t){if(t&ro){r.groupColor=Rs(r.localColor,e.groupColor);let i=r.localAlpha*e.groupAlpha;i=i<0?0:i>1?1:i,r.groupAlpha=i,r.groupColorAlpha=r.groupColor+((i*255|0)<<24);}t&cu&&(r.groupBlendMode=r.localBlendMode==="inherit"?e.groupBlendMode:r.localBlendMode),t&Os&&(r.globalDisplayStatus=r.localDisplayStatus&e.globalDisplayStatus),r._updateFlags=0;}var Lk,Dw,oS=f(()=>{hr();$g();rp();Lk=new exports.PixiJSContainer,Dw=Os|ro|cu;});function Kg(r,e){let{list:t,index:i}=r.childrenRenderablesToUpdate,s=false;for(let n=0;n<i;n++){let o=t[n];if(s=e[o.renderPipeId].validateRenderable(o),s)break}return r.structureDidChange=s,s}var aS=f(()=>{});var Nk,$o,uS=f(()=>{B();Te();ri();Lt();$g();jg();oS();aS();Nk=new G,$o=class{constructor(e){this._renderer=e;}render({container:e,transform:t}){let i=e.parent,s=e.renderGroup.renderGroupParent;e.parent=null,e.renderGroup.renderGroupParent=null;let n=this._renderer,o=Nk;t&&(o=o.copyFrom(e.renderGroup.localTransform),e.renderGroup.localTransform.copyFrom(t));let a=n.renderPipes;this._updateCachedRenderGroups(e.renderGroup,null),this._updateRenderGroups(e.renderGroup),n.globalUniforms.start({worldTransformMatrix:t?e.renderGroup.localTransform:e.renderGroup.worldTransform,worldColor:e.renderGroup.worldColorAlpha}),Xo(e.renderGroup,a),a.uniformBatch&&a.uniformBatch.renderEnd(),t&&e.renderGroup.localTransform.copyFrom(o),e.parent=i,e.renderGroup.renderGroupParent=s;}destroy(){this._renderer=null;}_updateCachedRenderGroups(e,t){if(e.isCachedAsTexture){if(!e.updateCacheTexture)return;t=e;}e._parentCacheAsTextureRenderGroup=t;for(let i=e.renderGroupChildren.length-1;i>=0;i--)this._updateCachedRenderGroups(e.renderGroupChildren[i],t);if(e.invalidateMatrices(),e.isCachedAsTexture){if(e.textureNeedsUpdate){let i=e.root.getLocalBounds();i.ceil();let s=e.texture;e.texture&&Me.returnTexture(e.texture);let n=this._renderer,o=e.textureOptions.resolution||n.view.resolution,a=e.textureOptions.antialias??n.view.antialias;e.texture=Me.getOptimalTexture(i.width,i.height,o,a),e._textureBounds||(e._textureBounds=new Ae),e._textureBounds.copyFrom(i),s!==e.texture&&e.renderGroupParent&&(e.renderGroupParent.structureDidChange=true);}}else e.texture&&(Me.returnTexture(e.texture),e.texture=null);}_updateRenderGroups(e){let t=this._renderer,i=t.renderPipes;if(e.runOnRender(t),e.instructionSet.renderPipes=i,e.structureDidChange?jo(e.childrenRenderablesToUpdate.list,0):Kg(e,i),id(e),e.structureDidChange?(e.structureDidChange=false,this._buildInstructions(e,t)):this._updateRenderables(e),e.childrenRenderablesToUpdate.index=0,t.renderPipes.batch.upload(e.instructionSet),!(e.isCachedAsTexture&&!e.textureNeedsUpdate))for(let s=0;s<e.renderGroupChildren.length;s++)this._updateRenderGroups(e.renderGroupChildren[s]);}_updateRenderables(e){let{list:t,index:i}=e.childrenRenderablesToUpdate;for(let s=0;s<i;s++){let n=t[s];n.didViewUpdate&&e.updateRenderable(n);}jo(t,i);}_buildInstructions(e,t){let i=e.root,s=e.instructionSet;s.reset();let n=t.renderPipes?t:t.batch.renderer,o=n.renderPipes;o.batch.buildStart(s),o.blendMode.buildStart(),o.colorMask.buildStart(),i.sortableChildren&&i.sortChildren(),i.collectRenderablesWithEffects(s,n,null),o.batch.buildEnd(s),o.blendMode.buildEnd(s);}};$o.extension={type:[x.WebGLSystem,x.WebGPUSystem,x.CanvasSystem],name:"renderGroup"};});var qo,lS=f(()=>{B();Fu();qo=class{constructor(e){this._renderer=e;}addRenderable(e,t){let i=this._getGpuSprite(e);e.didViewUpdate&&this._updateBatchableSprite(e,i),this._renderer.renderPipes.batch.addToBatch(i,t);}updateRenderable(e){let t=this._getGpuSprite(e);e.didViewUpdate&&this._updateBatchableSprite(e,t),t._batcher.updateElement(t);}validateRenderable(e){let t=this._getGpuSprite(e);return !t._batcher.checkAndUpdateTexture(t,e._texture)}_updateBatchableSprite(e,t){t.bounds=e.visualBounds,t.texture=e._texture;}_getGpuSprite(e){return e._gpuData[this._renderer.uid]||this._initGPUSprite(e)}_initGPUSprite(e){let t=new Yr;return t.renderable=e,t.transform=e.groupTransform,t.texture=e._texture,t.bounds=e.visualBounds,t.roundPixels=this._renderer._roundPixels|e._roundPixels,e._gpuData[this._renderer.uid]=t,t}destroy(){this._renderer=null;}};qo.extension={type:[x.WebGLPipes,x.WebGPUPipes,x.CanvasPipes],name:"sprite"};});var Ow,yn,Zg=f(()=>{Ut();Ow=/^\s*data:(?:([\w-]+)\/([\w+.-]+))?(?:;charset=([\w-]+))?(?:;(base64))?,(.*)/i,yn="8.10.2";});var Ko,Zo,Qg=f(()=>{B();Zg();Ko=class{static init(){globalThis.__PIXI_APP_INIT__?.(this,yn);}static destroy(){}};Ko.extension=x.Application;Zo=class{constructor(e){this._renderer=e;}init(){globalThis.__PIXI_RENDERER_INIT__?.(this._renderer,yn);}destroy(){this._renderer=null;}};Zo.extension={type:[x.WebGLSystem,x.WebGPUSystem],name:"initHook",priority:-10};});var cS,sd,hS=f(()=>{B();Pr();fm();cS=class Fw{constructor(e,t){this.state=Qe.for2d(),this._batchersByInstructionSet=Object.create(null),this._activeBatches=Object.create(null),this.renderer=e,this._adaptor=t,this._adaptor.init?.(this);}static getBatcher(e){return new this._availableBatchers[e]}buildStart(e){let t=this._batchersByInstructionSet[e.uid];t||(t=this._batchersByInstructionSet[e.uid]=Object.create(null),t.default||(t.default=new mo({maxTextures:this.renderer.limits.maxBatchableTextures}))),this._activeBatches=t,this._activeBatch=this._activeBatches.default;for(let i in this._activeBatches)this._activeBatches[i].begin();}addToBatch(e,t){if(this._activeBatch.name!==e.batcherName){this._activeBatch.break(t);let i=this._activeBatches[e.batcherName];i||(i=this._activeBatches[e.batcherName]=Fw.getBatcher(e.batcherName),i.begin()),this._activeBatch=i;}this._activeBatch.add(e);}break(e){this._activeBatch.break(e);}buildEnd(e){this._activeBatch.break(e);let t=this._activeBatches;for(let i in t){let s=t[i],n=s.geometry;n.indexBuffer.setDataWithSize(s.indexBuffer,s.indexSize,true),n.buffers[0].setDataWithSize(s.attributeBuffer.float32View,s.attributeSize,false);}}upload(e){let t=this._batchersByInstructionSet[e.uid];for(let i in t){let s=t[i],n=s.geometry;s.dirty&&(s.dirty=false,n.buffers[0].update(s.attributeSize*4));}}execute(e){if(e.action==="startBatch"){let t=e.batcher,i=t.geometry,s=t.shader;this._adaptor.start(this,i,s);}this._adaptor.execute(this,e);}destroy(){this.state=null,this.renderer=null,this._adaptor=null;for(let e in this._activeBatches)this._activeBatches[e].destroy();this._activeBatches=null;}};cS.extension={type:[x.WebGLPipes,x.WebGPUPipes,x.CanvasPipes],name:"batch"};cS._availableBatchers=Object.create(null);sd=cS;V.handleByMap(x.Batcher,sd._availableBatchers);V.add(mo);});var Jg,dS=f(()=>{Jg=`in vec2 vMaskCoord;
1546
+ `}};});var Vo,tS=f(()=>{B();Te();as();Oo();us();Xg();zr();ye();Be();Vo=class{init(){let e=Lr({name:"mesh",bits:[ps,zg,Hr]});this._shader=new rt({gpuProgram:e,resources:{uTexture:exports.Texture.EMPTY._source,uSampler:exports.Texture.EMPTY._source.style,textureUniforms:{uTextureMatrix:{type:"mat3x3<f32>",value:new G}}}});}execute(e,t){let i=e.renderer,s=t._shader;if(!s)s=this._shader,s.groups[2]=i.texture.getTextureBindGroup(t.texture);else if(!s.gpuProgram){N("Mesh shader has no gpuProgram",t.shader);return}let n=s.gpuProgram;if(n.autoAssignGlobalUniforms&&(s.groups[0]=i.globalUniforms.bindGroup),n.autoAssignLocalUniforms){let o=e.localUniforms;s.groups[1]=i.renderPipes.uniformBatch.getUniformBindGroup(o,true);}i.encoder.draw({geometry:t._geometry,shader:s,state:t.state});}destroy(){this._shader.destroy(true),this._shader=null;}};Vo.extension={type:[x.WebGPUPipesAdaptor],name:"mesh"};});var Yg,zo,rS=f(()=>{B();Pr();Kc();Yg=Qe.for2d(),zo=class{start(e,t,i){let s=e.renderer,n=s.encoder,o=i.gpuProgram;this._shader=i,this._geometry=t,n.setGeometry(t,o),Yg.blendMode="normal",s.pipeline.getPipeline(t,o,Yg);let a=s.globalUniforms.bindGroup;n.resetBindGroup(1),n.setBindGroup(0,a,o);}execute(e,t){let i=this._shader.gpuProgram,s=e.renderer,n=s.encoder;if(!t.bindGroup){let u=t.textures;t.bindGroup=Ws(u.textures,u.count,s.limits.maxBatchableTextures);}Yg.blendMode=t.blendMode;let o=s.bindGroup.getBindGroup(t.bindGroup,i,1),a=s.pipeline.getPipeline(this._geometry,i,Yg,t.topology);t.bindGroup._touch(s.textureGC.count),n.setPipeline(a),n.renderPassEncoder.setBindGroup(1,o),n.renderPassEncoder.drawIndexed(t.size,1,t.start);}};zo.extension={type:[x.WebGPUPipesAdaptor],name:"batch"};});var Wo,iS=f(()=>{B();Wo=class{constructor(e){this._renderer=e;}updateRenderable(){}destroyRenderable(){}validateRenderable(){return false}addRenderable(e,t){this._renderer.renderPipes.batch.break(t),t.add(e);}execute(e){e.isRenderable&&e.render(this._renderer);}destroy(){this._renderer=null;}};Wo.extension={type:[x.WebGLPipes,x.WebGPUPipes,x.CanvasPipes],name:"customRender"};});function Xo(r,e){let t=r.instructionSet,i=t.instructions;for(let s=0;s<t.instructionSize;s++){let n=i[s];e[n.renderPipeId].execute(n);}}var jg=f(()=>{});var Uk,Yo,sS=f(()=>{B();Te();Si();Fu();jg();Uk=new G,Yo=class{constructor(e){this._renderer=e;}addRenderGroup(e,t){e.isCachedAsTexture?this._addRenderableCacheAsTexture(e,t):this._addRenderableDirect(e,t);}execute(e){e.isRenderable&&(e.isCachedAsTexture?this._executeCacheAsTexture(e):this._executeDirect(e));}destroy(){this._renderer=null;}_addRenderableDirect(e,t){this._renderer.renderPipes.batch.break(t),e._batchableRenderGroup&&(Ve.return(e._batchableRenderGroup),e._batchableRenderGroup=null),t.add(e);}_addRenderableCacheAsTexture(e,t){let i=e._batchableRenderGroup??(e._batchableRenderGroup=Ve.get(Xr));i.renderable=e.root,i.transform=e.root.relativeGroupTransform,i.texture=e.texture,i.bounds=e._textureBounds,t.add(e),this._renderer.renderPipes.batch.addToBatch(i,t);}_executeCacheAsTexture(e){if(e.textureNeedsUpdate){e.textureNeedsUpdate=false;let t=Uk.identity().translate(-e._textureBounds.x,-e._textureBounds.y);this._renderer.renderTarget.push(e.texture,true,null,e.texture.frame),this._renderer.globalUniforms.push({worldTransformMatrix:t,worldColor:4294967295}),Xo(e,this._renderer.renderPipes),this._renderer.renderTarget.finishRenderPass(),this._renderer.renderTarget.pop(),this._renderer.globalUniforms.pop();}e._batchableRenderGroup._batcher.updateElement(e._batchableRenderGroup),e._batchableRenderGroup._batcher.geometry.buffers[0].update();}_executeDirect(e){this._renderer.globalUniforms.push({worldTransformMatrix:e.inverseParentTextureTransform,worldColor:e.worldColorAlpha}),Xo(e,this._renderer.renderPipes),this._renderer.globalUniforms.pop();}};Yo.extension={type:[x.WebGLPipes,x.WebGPUPipes,x.CanvasPipes],name:"renderGroup"};});function jo(r,e){e||(e=0);for(let t=e;t<r.length&&r[t];t++)r[t]=null;}var $g=f(()=>{});function id(r,e=false){nS(r);let t=r.childrenToUpdate,i=r.updateTick++;for(let s in t){let n=Number(s),o=t[s],a=o.list,u=o.index;for(let l=0;l<u;l++){let c=a[l];c.parentRenderGroup===r&&c.relativeRenderGroupDepth===n&&qg(c,i,0);}jo(a,u),o.index=0;}if(e)for(let s=0;s<r.renderGroupChildren.length;s++)id(r.renderGroupChildren[s],e);}function nS(r){let e=r.root,t;if(r.renderGroupParent){let i=r.renderGroupParent;r.worldTransform.appendFrom(e.relativeGroupTransform,i.worldTransform),r.worldColor=Rs(e.groupColor,i.worldColor),t=e.groupAlpha*i.worldAlpha;}else r.worldTransform.copyFrom(e.localTransform),r.worldColor=e.localColor,t=e.localAlpha;t=t<0?0:t>1?1:t,r.worldAlpha=t,r.worldColorAlpha=r.worldColor+((t*255|0)<<24);}function qg(r,e,t){if(e===r.updateTick)return;r.updateTick=e,r.didChange=false;let i=r.localTransform;r.updateLocalTransform();let s=r.parent;if(s&&!s.renderGroup?(t|=r._updateFlags,r.relativeGroupTransform.appendFrom(i,s.relativeGroupTransform),t&Dw&&kw(r,s,t)):(t=r._updateFlags,r.relativeGroupTransform.copyFrom(i),t&Dw&&kw(r,Lk,t)),!r.renderGroup){let n=r.children,o=n.length;for(let l=0;l<o;l++)qg(n[l],e,t);let a=r.parentRenderGroup,u=r;u.renderPipeId&&!a.structureDidChange&&a.updateRenderable(u);}}function kw(r,e,t){if(t&ro){r.groupColor=Rs(r.localColor,e.groupColor);let i=r.localAlpha*e.groupAlpha;i=i<0?0:i>1?1:i,r.groupAlpha=i,r.groupColorAlpha=r.groupColor+((i*255|0)<<24);}t&cu&&(r.groupBlendMode=r.localBlendMode==="inherit"?e.groupBlendMode:r.localBlendMode),t&Os&&(r.globalDisplayStatus=r.localDisplayStatus&e.globalDisplayStatus),r._updateFlags=0;}var Lk,Dw,oS=f(()=>{hr();$g();rp();Lk=new ue,Dw=Os|ro|cu;});function Kg(r,e){let{list:t,index:i}=r.childrenRenderablesToUpdate,s=false;for(let n=0;n<i;n++){let o=t[n];if(s=e[o.renderPipeId].validateRenderable(o),s)break}return r.structureDidChange=s,s}var aS=f(()=>{});var Nk,$o,uS=f(()=>{B();Te();ri();Lt();$g();jg();oS();aS();Nk=new G,$o=class{constructor(e){this._renderer=e;}render({container:e,transform:t}){let i=e.parent,s=e.renderGroup.renderGroupParent;e.parent=null,e.renderGroup.renderGroupParent=null;let n=this._renderer,o=Nk;t&&(o=o.copyFrom(e.renderGroup.localTransform),e.renderGroup.localTransform.copyFrom(t));let a=n.renderPipes;this._updateCachedRenderGroups(e.renderGroup,null),this._updateRenderGroups(e.renderGroup),n.globalUniforms.start({worldTransformMatrix:t?e.renderGroup.localTransform:e.renderGroup.worldTransform,worldColor:e.renderGroup.worldColorAlpha}),Xo(e.renderGroup,a),a.uniformBatch&&a.uniformBatch.renderEnd(),t&&e.renderGroup.localTransform.copyFrom(o),e.parent=i,e.renderGroup.renderGroupParent=s;}destroy(){this._renderer=null;}_updateCachedRenderGroups(e,t){if(e.isCachedAsTexture){if(!e.updateCacheTexture)return;t=e;}e._parentCacheAsTextureRenderGroup=t;for(let i=e.renderGroupChildren.length-1;i>=0;i--)this._updateCachedRenderGroups(e.renderGroupChildren[i],t);if(e.invalidateMatrices(),e.isCachedAsTexture){if(e.textureNeedsUpdate){let i=e.root.getLocalBounds();i.ceil();let s=e.texture;e.texture&&Me.returnTexture(e.texture);let n=this._renderer,o=e.textureOptions.resolution||n.view.resolution,a=e.textureOptions.antialias??n.view.antialias;e.texture=Me.getOptimalTexture(i.width,i.height,o,a),e._textureBounds||(e._textureBounds=new Ae),e._textureBounds.copyFrom(i),s!==e.texture&&e.renderGroupParent&&(e.renderGroupParent.structureDidChange=true);}}else e.texture&&(Me.returnTexture(e.texture),e.texture=null);}_updateRenderGroups(e){let t=this._renderer,i=t.renderPipes;if(e.runOnRender(t),e.instructionSet.renderPipes=i,e.structureDidChange?jo(e.childrenRenderablesToUpdate.list,0):Kg(e,i),id(e),e.structureDidChange?(e.structureDidChange=false,this._buildInstructions(e,t)):this._updateRenderables(e),e.childrenRenderablesToUpdate.index=0,t.renderPipes.batch.upload(e.instructionSet),!(e.isCachedAsTexture&&!e.textureNeedsUpdate))for(let s=0;s<e.renderGroupChildren.length;s++)this._updateRenderGroups(e.renderGroupChildren[s]);}_updateRenderables(e){let{list:t,index:i}=e.childrenRenderablesToUpdate;for(let s=0;s<i;s++){let n=t[s];n.didViewUpdate&&e.updateRenderable(n);}jo(t,i);}_buildInstructions(e,t){let i=e.root,s=e.instructionSet;s.reset();let n=t.renderPipes?t:t.batch.renderer,o=n.renderPipes;o.batch.buildStart(s),o.blendMode.buildStart(),o.colorMask.buildStart(),i.sortableChildren&&i.sortChildren(),i.collectRenderablesWithEffects(s,n,null),o.batch.buildEnd(s),o.blendMode.buildEnd(s);}};$o.extension={type:[x.WebGLSystem,x.WebGPUSystem,x.CanvasSystem],name:"renderGroup"};});var qo,lS=f(()=>{B();Fu();qo=class{constructor(e){this._renderer=e;}addRenderable(e,t){let i=this._getGpuSprite(e);e.didViewUpdate&&this._updateBatchableSprite(e,i),this._renderer.renderPipes.batch.addToBatch(i,t);}updateRenderable(e){let t=this._getGpuSprite(e);e.didViewUpdate&&this._updateBatchableSprite(e,t),t._batcher.updateElement(t);}validateRenderable(e){let t=this._getGpuSprite(e);return !t._batcher.checkAndUpdateTexture(t,e._texture)}_updateBatchableSprite(e,t){t.bounds=e.visualBounds,t.texture=e._texture;}_getGpuSprite(e){return e._gpuData[this._renderer.uid]||this._initGPUSprite(e)}_initGPUSprite(e){let t=new Xr;return t.renderable=e,t.transform=e.groupTransform,t.texture=e._texture,t.bounds=e.visualBounds,t.roundPixels=this._renderer._roundPixels|e._roundPixels,e._gpuData[this._renderer.uid]=t,t}destroy(){this._renderer=null;}};qo.extension={type:[x.WebGLPipes,x.WebGPUPipes,x.CanvasPipes],name:"sprite"};});var Ow,yn,Zg=f(()=>{Ut();Ow=/^\s*data:(?:([\w-]+)\/([\w+.-]+))?(?:;charset=([\w-]+))?(?:;(base64))?,(.*)/i,yn="8.10.2";});var Ko,Zo,Qg=f(()=>{B();Zg();Ko=class{static init(){globalThis.__PIXI_APP_INIT__?.(this,yn);}static destroy(){}};Ko.extension=x.Application;Zo=class{constructor(e){this._renderer=e;}init(){globalThis.__PIXI_RENDERER_INIT__?.(this._renderer,yn);}destroy(){this._renderer=null;}};Zo.extension={type:[x.WebGLSystem,x.WebGPUSystem],name:"initHook",priority:-10};});var cS,sd,hS=f(()=>{B();Pr();fm();cS=class Fw{constructor(e,t){this.state=Qe.for2d(),this._batchersByInstructionSet=Object.create(null),this._activeBatches=Object.create(null),this.renderer=e,this._adaptor=t,this._adaptor.init?.(this);}static getBatcher(e){return new this._availableBatchers[e]}buildStart(e){let t=this._batchersByInstructionSet[e.uid];t||(t=this._batchersByInstructionSet[e.uid]=Object.create(null),t.default||(t.default=new mo({maxTextures:this.renderer.limits.maxBatchableTextures}))),this._activeBatches=t,this._activeBatch=this._activeBatches.default;for(let i in this._activeBatches)this._activeBatches[i].begin();}addToBatch(e,t){if(this._activeBatch.name!==e.batcherName){this._activeBatch.break(t);let i=this._activeBatches[e.batcherName];i||(i=this._activeBatches[e.batcherName]=Fw.getBatcher(e.batcherName),i.begin()),this._activeBatch=i;}this._activeBatch.add(e);}break(e){this._activeBatch.break(e);}buildEnd(e){this._activeBatch.break(e);let t=this._activeBatches;for(let i in t){let s=t[i],n=s.geometry;n.indexBuffer.setDataWithSize(s.indexBuffer,s.indexSize,true),n.buffers[0].setDataWithSize(s.attributeBuffer.float32View,s.attributeSize,false);}}upload(e){let t=this._batchersByInstructionSet[e.uid];for(let i in t){let s=t[i],n=s.geometry;s.dirty&&(s.dirty=false,n.buffers[0].update(s.attributeSize*4));}}execute(e){if(e.action==="startBatch"){let t=e.batcher,i=t.geometry,s=t.shader;this._adaptor.start(this,i,s);}this._adaptor.execute(this,e);}destroy(){this.state=null,this.renderer=null,this._adaptor=null;for(let e in this._activeBatches)this._activeBatches[e].destroy();this._activeBatches=null;}};cS.extension={type:[x.WebGLPipes,x.WebGPUPipes,x.CanvasPipes],name:"batch"};cS._availableBatchers=Object.create(null);sd=cS;V.handleByMap(x.Batcher,sd._availableBatchers);V.add(mo);});var Jg,dS=f(()=>{Jg=`in vec2 vMaskCoord;
1547
1547
  in vec2 vTextureCoord;
1548
1548
 
1549
1549
  uniform sampler2D uTexture;
@@ -1712,9 +1712,9 @@ fn mainFragment(
1712
1712
 
1713
1713
  return source * a;
1714
1714
  }
1715
- `;});var sl,mS=f(()=>{Te();dr();Cr();ht();fp();Ii();dS();fS();pS();sl=class extends Dt{constructor(e){let{sprite:t,...i}=e,s=new ks(t.texture),n=new xe({uFilterMatrix:{value:new G,type:"mat3x3<f32>"},uMaskClamp:{value:s.uClampFrame,type:"vec4<f32>"},uAlpha:{value:1,type:"f32"},uInverse:{value:e.inverse?1:0,type:"f32"}}),o=$e.from({vertex:{source:nd,entryPoint:"mainVertex"},fragment:{source:nd,entryPoint:"mainFragment"}}),a=je.from({vertex:ex,fragment:Jg,name:"mask-filter"});super({...i,gpuProgram:o,glProgram:a,resources:{filterUniforms:n,uMaskTexture:t.texture.source}}),this.sprite=t,this._textureMatrix=s;}set inverse(e){this.resources.filterUniforms.uniforms.uInverse=e?1:0;}get inverse(){return this.resources.filterUniforms.uniforms.uInverse===1}apply(e,t,i,s){this._textureMatrix.texture=this.sprite.texture,e.calculateSpriteMatrix(this.resources.filterUniforms.uniforms.uFilterMatrix,this.sprite).prepend(this._textureMatrix.mapCoord),this.resources.uMaskTexture=this.sprite.texture.source,e.applyFilter(this,t,i,s);}};});var Hk,gS,Qo,xS=f(()=>{B();Dc();mS();Lt();Kn();Ns();Si();ye();ri();Ar();Hk=new Ae,gS=class extends ei{constructor(){super(),this.filters=[new sl({sprite:new exports.PixiJSSprite(exports.Texture.EMPTY),inverse:false,resolution:"inherit",antialias:"inherit"})];}get sprite(){return this.filters[0].sprite}set sprite(e){this.filters[0].sprite=e;}get inverse(){return this.filters[0].inverse}set inverse(e){this.filters[0].inverse=e;}},Qo=class{constructor(e){this._activeMaskStage=[],this._renderer=e;}push(e,t,i){let s=this._renderer;if(s.renderPipes.batch.break(i),i.add({renderPipeId:"alphaMask",action:"pushMaskBegin",mask:e,inverse:t._maskOptions.inverse,canBundle:false,maskedContainer:t}),e.inverse=t._maskOptions.inverse,e.renderMaskToTexture){let n=e.mask;n.includeInBuild=true,n.collectRenderables(i,s,null),n.includeInBuild=false;}s.renderPipes.batch.break(i),i.add({renderPipeId:"alphaMask",action:"pushMaskEnd",mask:e,maskedContainer:t,inverse:t._maskOptions.inverse,canBundle:false});}pop(e,t,i){this._renderer.renderPipes.batch.break(i),i.add({renderPipeId:"alphaMask",action:"popMaskEnd",mask:e,inverse:t._maskOptions.inverse,canBundle:false});}execute(e){let t=this._renderer,i=e.mask.renderMaskToTexture;if(e.action==="pushMaskBegin"){let s=Ve.get(gS);if(s.inverse=e.inverse,i){e.mask.mask.measurable=true;let n=Ei(e.mask.mask,true,Hk);e.mask.mask.measurable=false,n.ceil();let o=t.renderTarget.renderTarget.colorTexture.source,a=Me.getOptimalTexture(n.width,n.height,o._resolution,o.antialias);t.renderTarget.push(a,true),t.globalUniforms.push({offset:n,worldColor:4294967295});let u=s.sprite;u.texture=a,u.worldTransform.tx=n.minX,u.worldTransform.ty=n.minY,this._activeMaskStage.push({filterEffect:s,maskedContainer:e.maskedContainer,filterTexture:a});}else s.sprite=e.mask.mask,this._activeMaskStage.push({filterEffect:s,maskedContainer:e.maskedContainer});}else if(e.action==="pushMaskEnd"){let s=this._activeMaskStage[this._activeMaskStage.length-1];i&&(t.type===qe.WEBGL&&t.renderTarget.finishRenderPass(),t.renderTarget.pop(),t.globalUniforms.pop()),t.filter.push({renderPipeId:"filter",action:"pushFilter",container:s.maskedContainer,filterEffect:s.filterEffect,canBundle:false});}else if(e.action==="popMaskEnd"){t.filter.pop();let s=this._activeMaskStage.pop();i&&Me.returnTexture(s.filterTexture),Ve.return(s.filterEffect);}}destroy(){this._renderer=null,this._activeMaskStage=null;}};Qo.extension={type:[x.WebGLPipes,x.WebGPUPipes,x.CanvasPipes],name:"alphaMask"};});var Jo,_S=f(()=>{B();Jo=class{constructor(e){this._colorStack=[],this._colorStackIndex=0,this._currentColor=0,this._renderer=e;}buildStart(){this._colorStack[0]=15,this._colorStackIndex=1,this._currentColor=15;}push(e,t,i){this._renderer.renderPipes.batch.break(i);let n=this._colorStack;n[this._colorStackIndex]=n[this._colorStackIndex-1]&e.mask;let o=this._colorStack[this._colorStackIndex];o!==this._currentColor&&(this._currentColor=o,i.add({renderPipeId:"colorMask",colorMask:o,canBundle:false})),this._colorStackIndex++;}pop(e,t,i){this._renderer.renderPipes.batch.break(i);let n=this._colorStack;this._colorStackIndex--;let o=n[this._colorStackIndex-1];o!==this._currentColor&&(this._currentColor=o,i.add({renderPipeId:"colorMask",colorMask:o,canBundle:false}));}execute(e){this._renderer.colorMask.setMask(e.colorMask);}destroy(){this._colorStack=null;}};Jo.extension={type:[x.WebGLPipes,x.WebGPUPipes,x.CanvasPipes],name:"colorMask"};});var ea,bS=f(()=>{B();No();Xs();ea=class{constructor(e){this._maskStackHash={},this._maskHash=new WeakMap,this._renderer=e;}push(e,t,i){var s;let n=e,o=this._renderer;o.renderPipes.batch.break(i),o.renderPipes.blendMode.setBlendMode(n.mask,"none",i),i.add({renderPipeId:"stencilMask",action:"pushMaskBegin",mask:e,inverse:t._maskOptions.inverse,canBundle:false});let a=n.mask;a.includeInBuild=true,this._maskHash.has(n)||this._maskHash.set(n,{instructionsStart:0,instructionsLength:0});let u=this._maskHash.get(n);u.instructionsStart=i.instructionSize,a.collectRenderables(i,o,null),a.includeInBuild=false,o.renderPipes.batch.break(i),i.add({renderPipeId:"stencilMask",action:"pushMaskEnd",mask:e,inverse:t._maskOptions.inverse,canBundle:false});let l=i.instructionSize-u.instructionsStart-1;u.instructionsLength=l;let c=o.renderTarget.renderTarget.uid;(s=this._maskStackHash)[c]??(s[c]=0);}pop(e,t,i){let s=e,n=this._renderer;n.renderPipes.batch.break(i),n.renderPipes.blendMode.setBlendMode(s.mask,"none",i),i.add({renderPipeId:"stencilMask",action:"popMaskBegin",inverse:t._maskOptions.inverse,canBundle:false});let o=this._maskHash.get(e);for(let a=0;a<o.instructionsLength;a++)i.instructions[i.instructionSize++]=i.instructions[o.instructionsStart++];i.add({renderPipeId:"stencilMask",action:"popMaskEnd",canBundle:false});}execute(e){var t;let i=this._renderer,s=i.renderTarget.renderTarget.uid,n=(t=this._maskStackHash)[s]??(t[s]=0);e.action==="pushMaskBegin"?(i.renderTarget.ensureDepthStencil(),i.stencil.setStencilMode(He.RENDERING_MASK_ADD,n),n++,i.colorMask.setMask(0)):e.action==="pushMaskEnd"?(e.inverse?i.stencil.setStencilMode(He.INVERSE_MASK_ACTIVE,n):i.stencil.setStencilMode(He.MASK_ACTIVE,n),i.colorMask.setMask(15)):e.action==="popMaskBegin"?(i.colorMask.setMask(0),n!==0?i.stencil.setStencilMode(He.RENDERING_MASK_REMOVE,n):(i.renderTarget.clear(null,bt.STENCIL),i.stencil.setStencilMode(He.DISABLED,n)),n--):e.action==="popMaskEnd"&&(e.inverse?i.stencil.setStencilMode(He.INVERSE_MASK_ACTIVE,n):i.stencil.setStencilMode(He.MASK_ACTIVE,n),i.colorMask.setMask(15)),this._maskStackHash[s]=n;}destroy(){this._renderer=null,this._maskStackHash=null,this._maskHash=null;}};ea.extension={type:[x.WebGLPipes,x.WebGPUPipes,x.CanvasPipes],name:"stencilMask"};});var yS,tx,vS=f(()=>{gt();B();yS=class Gw{constructor(){this.clearBeforeRender=true,this._backgroundColor=new te(0),this.color=this._backgroundColor,this.alpha=1;}init(e){e={...Gw.defaultOptions,...e},this.clearBeforeRender=e.clearBeforeRender,this.color=e.background||e.backgroundColor||this._backgroundColor,this.alpha=e.backgroundAlpha,this._backgroundColor.setAlpha(e.backgroundAlpha);}get color(){return this._backgroundColor}set color(e){this._backgroundColor.setValue(e);}get alpha(){return this._backgroundColor.alpha}set alpha(e){this._backgroundColor.setAlpha(e);}get colorRgba(){return this._backgroundColor.toArray()}destroy(){}};yS.extension={type:[x.WebGLSystem,x.WebGPUSystem,x.CanvasSystem],name:"background",priority:0};yS.defaultOptions={backgroundAlpha:1,backgroundColor:0,clearBeforeRender:true};tx=yS;});var od,ta,TS=f(()=>{B();Dc();Be();od={};V.handle(x.BlendMode,r=>{if(!r.name)throw new Error("BlendMode extension must have a name property");od[r.name]=r.ref;},r=>{delete od[r.name];});ta=class{constructor(e){this._isAdvanced=false,this._filterHash=Object.create(null),this._renderer=e,this._renderer.runners.prerender.add(this);}prerender(){this._activeBlendMode="normal",this._isAdvanced=false;}setBlendMode(e,t,i){if(this._activeBlendMode===t){this._isAdvanced&&this._renderableList.push(e);return}this._activeBlendMode=t,this._isAdvanced&&this._endAdvancedBlendMode(i),this._isAdvanced=!!od[t],this._isAdvanced&&(this._beginAdvancedBlendMode(i),this._renderableList.push(e));}_beginAdvancedBlendMode(e){this._renderer.renderPipes.batch.break(e);let t=this._activeBlendMode;if(!od[t]){N(`Unable to assign BlendMode: '${t}'. You may want to include: import 'pixi.js/advanced-blend-modes'`);return}let i=this._filterHash[t];i||(i=this._filterHash[t]=new ei,i.filters=[new od[t]]);let s={renderPipeId:"filter",action:"pushFilter",renderables:[],filterEffect:i,canBundle:false};this._renderableList=s.renderables,e.add(s);}_endAdvancedBlendMode(e){this._renderableList=null,this._renderer.renderPipes.batch.break(e),e.add({renderPipeId:"filter",action:"popFilter",canBundle:false});}buildStart(){this._isAdvanced=false;}buildEnd(e){this._isAdvanced&&this._endAdvancedBlendMode(e);}destroy(){this._renderer=null,this._renderableList=null;for(let e in this._filterHash)this._filterHash[e].destroy();this._filterHash=null;}};ta.extension={type:[x.WebGLPipes,x.WebGPUPipes,x.CanvasPipes],name:"blendMode"};});var SS,ES,rx,CS=f(()=>{B();hr();ye();SS={png:"image/png",jpg:"image/jpeg",webp:"image/webp"},ES=class Uw{constructor(e){this._renderer=e;}_normalizeOptions(e,t={}){return e instanceof exports.PixiJSContainer||e instanceof exports.Texture?{target:e,...t}:{...t,...e}}async image(e){let t=new Image;return t.src=await this.base64(e),t}async base64(e){e=this._normalizeOptions(e,Uw.defaultImageOptions);let{format:t,quality:i}=e,s=this.canvas(e);if(s.toBlob!==void 0)return new Promise((n,o)=>{s.toBlob(a=>{if(!a){o(new Error("ICanvas.toBlob failed!"));return}let u=new FileReader;u.onload=()=>n(u.result),u.onerror=o,u.readAsDataURL(a);},SS[t],i);});if(s.toDataURL!==void 0)return s.toDataURL(SS[t],i);if(s.convertToBlob!==void 0){let n=await s.convertToBlob({type:SS[t],quality:i});return new Promise((o,a)=>{let u=new FileReader;u.onload=()=>o(u.result),u.onerror=a,u.readAsDataURL(n);})}throw new Error("Extract.base64() requires ICanvas.toDataURL, ICanvas.toBlob, or ICanvas.convertToBlob to be implemented")}canvas(e){e=this._normalizeOptions(e);let t=e.target,i=this._renderer;if(t instanceof exports.Texture)return i.texture.generateCanvas(t);let s=i.textureGenerator.generateTexture(e),n=i.texture.generateCanvas(s);return s.destroy(true),n}pixels(e){e=this._normalizeOptions(e);let t=e.target,i=this._renderer,s=t instanceof exports.Texture?t:i.textureGenerator.generateTexture(e),n=i.texture.getPixels(s);return t instanceof exports.PixiJSContainer&&s.destroy(true),n}texture(e){return e=this._normalizeOptions(e),e.target instanceof exports.Texture?e.target:this._renderer.textureGenerator.generateTexture(e)}download(e){e=this._normalizeOptions(e);let t=this.canvas(e),i=document.createElement("a");i.download=e.filename??"image.png",i.href=t.toDataURL("image/png"),document.body.appendChild(i),i.click(),document.body.removeChild(i);}log(e){let t=e.width??200;e=this._normalizeOptions(e);let i=this.canvas(e),s=i.toDataURL();console.log(`[Pixi Texture] ${i.width}px ${i.height}px`);let n=["font-size: 1px;",`padding: ${t}px 300px;`,`background: url(${s}) no-repeat;`,"background-size: contain;"].join(" ");console.log("%c ",n);}destroy(){this._renderer=null;}};ES.extension={type:[x.WebGLSystem,x.WebGPUSystem],name:"extract"};ES.defaultImageOptions={format:"png",quality:1};rx=ES;});var nl,AS=f(()=>{Ct();ye();nl=class r extends exports.Texture{static create(e){return new r({source:new ge(e)})}resize(e,t,i){return this.source.resize(e,t,i),this}};});var Vk,zk,Wk,ra,PS=f(()=>{gt();B();Te();ct();Lt();Oc();hr();AS();Vk=new exports.Rectangle,zk=new Ae,Wk=[0,0,0,0],ra=class{constructor(e){this._renderer=e;}generateTexture(e){e instanceof exports.PixiJSContainer&&(e={target:e,frame:void 0,textureSourceOptions:{},resolution:void 0});let t=e.resolution||this._renderer.resolution,i=e.antialias||this._renderer.view.antialias,s=e.target,n=e.clearColor;n?n=Array.isArray(n)&&n.length===4?n:te.shared.setValue(n).toArray():n=Wk;let o=e.frame?.copyTo(Vk)||Ms(s,zk).rectangle;o.width=Math.max(o.width,1/t)|0,o.height=Math.max(o.height,1/t)|0;let a=nl.create({...e.textureSourceOptions,width:o.width,height:o.height,resolution:t,antialias:i}),u=G.shared.translate(-o.x,-o.y);return this._renderer.render({container:s,transform:u,target:a,clearColor:n}),a.source.updateMipmaps(),a}destroy(){this._renderer=null;}};ra.extension={type:[x.WebGLSystem,x.WebGPUSystem],name:"textureGenerator"};});var ia,wS=f(()=>{B();Te();cr();bo();ns();Ar();ht();ia=class{constructor(e){this._stackIndex=0,this._globalUniformDataStack=[],this._uniformsPool=[],this._activeUniforms=[],this._bindGroupPool=[],this._activeBindGroups=[],this._renderer=e;}reset(){this._stackIndex=0;for(let e=0;e<this._activeUniforms.length;e++)this._uniformsPool.push(this._activeUniforms[e]);for(let e=0;e<this._activeBindGroups.length;e++)this._bindGroupPool.push(this._activeBindGroups[e]);this._activeUniforms.length=0,this._activeBindGroups.length=0;}start(e){this.reset(),this.push(e);}bind({size:e,projectionMatrix:t,worldTransformMatrix:i,worldColor:s,offset:n}){let o=this._renderer.renderTarget.renderTarget,a=this._stackIndex?this._globalUniformDataStack[this._stackIndex-1]:{worldTransformMatrix:new G,worldColor:4294967295,offset:new me},u={projectionMatrix:t||this._renderer.renderTarget.projectionMatrix,resolution:e||o.size,worldTransformMatrix:i||a.worldTransformMatrix,worldColor:s||a.worldColor,offset:n||a.offset,bindGroup:null},l=this._uniformsPool.pop()||this._createUniforms();this._activeUniforms.push(l);let c=l.uniforms;c.uProjectionMatrix=u.projectionMatrix,c.uResolution=u.resolution,c.uWorldTransformMatrix.copyFrom(u.worldTransformMatrix),c.uWorldTransformMatrix.tx-=u.offset.x,c.uWorldTransformMatrix.ty-=u.offset.y,Xr(u.worldColor,c.uWorldColorAlpha,0),l.update();let h;this._renderer.renderPipes.uniformBatch?h=this._renderer.renderPipes.uniformBatch.getUniformBindGroup(l,false):(h=this._bindGroupPool.pop()||new _t,this._activeBindGroups.push(h),h.setResource(l,0)),u.bindGroup=h,this._currentGlobalUniformData=u;}push(e){this.bind(e),this._globalUniformDataStack[this._stackIndex++]=this._currentGlobalUniformData;}pop(){this._currentGlobalUniformData=this._globalUniformDataStack[--this._stackIndex-1],this._renderer.type===qe.WEBGL&&this._currentGlobalUniformData.bindGroup.resources[0].update();}get bindGroup(){return this._currentGlobalUniformData.bindGroup}get globalUniformData(){return this._currentGlobalUniformData}get uniformGroup(){return this._currentGlobalUniformData.bindGroup.resources[0]}_createUniforms(){return new xe({uProjectionMatrix:{value:new G,type:"mat3x3<f32>"},uWorldTransformMatrix:{value:new G,type:"mat3x3<f32>"},uWorldColorAlpha:{value:new Float32Array(4),type:"vec4<f32>"},uResolution:{value:[0,0],type:"vec2<f32>"}},{isStatic:true})}destroy(){this._renderer=null;}};ia.extension={type:[x.WebGLSystem,x.WebGPUSystem,x.CanvasSystem],name:"globalUniforms"};});var Xk,sa,BS=f(()=>{B();Gs();Xk=1,sa=class{constructor(){this._tasks=[],this._offset=0;}init(){Ie.system.add(this._update,this);}repeat(e,t,i=true){let s=Xk++,n=0;return i&&(this._offset+=1e3,n=this._offset),this._tasks.push({func:e,duration:t,start:performance.now(),offset:n,last:performance.now(),repeat:true,id:s}),s}cancel(e){for(let t=0;t<this._tasks.length;t++)if(this._tasks[t].id===e){this._tasks.splice(t,1);return}}_update(){let e=performance.now();for(let t=0;t<this._tasks.length;t++){let i=this._tasks[t];if(e-i.offset-i.last>=i.duration){let s=e-i.start;i.func(s),i.last=e;}}}destroy(){Ie.system.remove(this._update,this),this._tasks.length=0;}};sa.extension={type:[x.WebGLSystem,x.WebGPUSystem,x.CanvasSystem],name:"scheduler",priority:0};});function ix(r){if(!Lw){if(j.get().getNavigator().userAgent.toLowerCase().indexOf("chrome")>-1){let e=[`%c %c %c %c %c PixiJS %c v${yn} (${r}) http://www.pixijs.com/
1715
+ `;});var sl,mS=f(()=>{Te();dr();Cr();ht();fp();Ii();dS();fS();pS();sl=class extends Dt{constructor(e){let{sprite:t,...i}=e,s=new ks(t.texture),n=new xe({uFilterMatrix:{value:new G,type:"mat3x3<f32>"},uMaskClamp:{value:s.uClampFrame,type:"vec4<f32>"},uAlpha:{value:1,type:"f32"},uInverse:{value:e.inverse?1:0,type:"f32"}}),o=$e.from({vertex:{source:nd,entryPoint:"mainVertex"},fragment:{source:nd,entryPoint:"mainFragment"}}),a=je.from({vertex:ex,fragment:Jg,name:"mask-filter"});super({...i,gpuProgram:o,glProgram:a,resources:{filterUniforms:n,uMaskTexture:t.texture.source}}),this.sprite=t,this._textureMatrix=s;}set inverse(e){this.resources.filterUniforms.uniforms.uInverse=e?1:0;}get inverse(){return this.resources.filterUniforms.uniforms.uInverse===1}apply(e,t,i,s){this._textureMatrix.texture=this.sprite.texture,e.calculateSpriteMatrix(this.resources.filterUniforms.uniforms.uFilterMatrix,this.sprite).prepend(this._textureMatrix.mapCoord),this.resources.uMaskTexture=this.sprite.texture.source,e.applyFilter(this,t,i,s);}};});var Hk,gS,Qo,xS=f(()=>{B();Dc();mS();Lt();Kn();Ns();Si();ye();ri();Ar();Hk=new Ae,gS=class extends ei{constructor(){super(),this.filters=[new sl({sprite:new Ge(exports.Texture.EMPTY),inverse:false,resolution:"inherit",antialias:"inherit"})];}get sprite(){return this.filters[0].sprite}set sprite(e){this.filters[0].sprite=e;}get inverse(){return this.filters[0].inverse}set inverse(e){this.filters[0].inverse=e;}},Qo=class{constructor(e){this._activeMaskStage=[],this._renderer=e;}push(e,t,i){let s=this._renderer;if(s.renderPipes.batch.break(i),i.add({renderPipeId:"alphaMask",action:"pushMaskBegin",mask:e,inverse:t._maskOptions.inverse,canBundle:false,maskedContainer:t}),e.inverse=t._maskOptions.inverse,e.renderMaskToTexture){let n=e.mask;n.includeInBuild=true,n.collectRenderables(i,s,null),n.includeInBuild=false;}s.renderPipes.batch.break(i),i.add({renderPipeId:"alphaMask",action:"pushMaskEnd",mask:e,maskedContainer:t,inverse:t._maskOptions.inverse,canBundle:false});}pop(e,t,i){this._renderer.renderPipes.batch.break(i),i.add({renderPipeId:"alphaMask",action:"popMaskEnd",mask:e,inverse:t._maskOptions.inverse,canBundle:false});}execute(e){let t=this._renderer,i=e.mask.renderMaskToTexture;if(e.action==="pushMaskBegin"){let s=Ve.get(gS);if(s.inverse=e.inverse,i){e.mask.mask.measurable=true;let n=Ei(e.mask.mask,true,Hk);e.mask.mask.measurable=false,n.ceil();let o=t.renderTarget.renderTarget.colorTexture.source,a=Me.getOptimalTexture(n.width,n.height,o._resolution,o.antialias);t.renderTarget.push(a,true),t.globalUniforms.push({offset:n,worldColor:4294967295});let u=s.sprite;u.texture=a,u.worldTransform.tx=n.minX,u.worldTransform.ty=n.minY,this._activeMaskStage.push({filterEffect:s,maskedContainer:e.maskedContainer,filterTexture:a});}else s.sprite=e.mask.mask,this._activeMaskStage.push({filterEffect:s,maskedContainer:e.maskedContainer});}else if(e.action==="pushMaskEnd"){let s=this._activeMaskStage[this._activeMaskStage.length-1];i&&(t.type===qe.WEBGL&&t.renderTarget.finishRenderPass(),t.renderTarget.pop(),t.globalUniforms.pop()),t.filter.push({renderPipeId:"filter",action:"pushFilter",container:s.maskedContainer,filterEffect:s.filterEffect,canBundle:false});}else if(e.action==="popMaskEnd"){t.filter.pop();let s=this._activeMaskStage.pop();i&&Me.returnTexture(s.filterTexture),Ve.return(s.filterEffect);}}destroy(){this._renderer=null,this._activeMaskStage=null;}};Qo.extension={type:[x.WebGLPipes,x.WebGPUPipes,x.CanvasPipes],name:"alphaMask"};});var Jo,_S=f(()=>{B();Jo=class{constructor(e){this._colorStack=[],this._colorStackIndex=0,this._currentColor=0,this._renderer=e;}buildStart(){this._colorStack[0]=15,this._colorStackIndex=1,this._currentColor=15;}push(e,t,i){this._renderer.renderPipes.batch.break(i);let n=this._colorStack;n[this._colorStackIndex]=n[this._colorStackIndex-1]&e.mask;let o=this._colorStack[this._colorStackIndex];o!==this._currentColor&&(this._currentColor=o,i.add({renderPipeId:"colorMask",colorMask:o,canBundle:false})),this._colorStackIndex++;}pop(e,t,i){this._renderer.renderPipes.batch.break(i);let n=this._colorStack;this._colorStackIndex--;let o=n[this._colorStackIndex-1];o!==this._currentColor&&(this._currentColor=o,i.add({renderPipeId:"colorMask",colorMask:o,canBundle:false}));}execute(e){this._renderer.colorMask.setMask(e.colorMask);}destroy(){this._colorStack=null;}};Jo.extension={type:[x.WebGLPipes,x.WebGPUPipes,x.CanvasPipes],name:"colorMask"};});var ea,bS=f(()=>{B();No();Xs();ea=class{constructor(e){this._maskStackHash={},this._maskHash=new WeakMap,this._renderer=e;}push(e,t,i){var s;let n=e,o=this._renderer;o.renderPipes.batch.break(i),o.renderPipes.blendMode.setBlendMode(n.mask,"none",i),i.add({renderPipeId:"stencilMask",action:"pushMaskBegin",mask:e,inverse:t._maskOptions.inverse,canBundle:false});let a=n.mask;a.includeInBuild=true,this._maskHash.has(n)||this._maskHash.set(n,{instructionsStart:0,instructionsLength:0});let u=this._maskHash.get(n);u.instructionsStart=i.instructionSize,a.collectRenderables(i,o,null),a.includeInBuild=false,o.renderPipes.batch.break(i),i.add({renderPipeId:"stencilMask",action:"pushMaskEnd",mask:e,inverse:t._maskOptions.inverse,canBundle:false});let l=i.instructionSize-u.instructionsStart-1;u.instructionsLength=l;let c=o.renderTarget.renderTarget.uid;(s=this._maskStackHash)[c]??(s[c]=0);}pop(e,t,i){let s=e,n=this._renderer;n.renderPipes.batch.break(i),n.renderPipes.blendMode.setBlendMode(s.mask,"none",i),i.add({renderPipeId:"stencilMask",action:"popMaskBegin",inverse:t._maskOptions.inverse,canBundle:false});let o=this._maskHash.get(e);for(let a=0;a<o.instructionsLength;a++)i.instructions[i.instructionSize++]=i.instructions[o.instructionsStart++];i.add({renderPipeId:"stencilMask",action:"popMaskEnd",canBundle:false});}execute(e){var t;let i=this._renderer,s=i.renderTarget.renderTarget.uid,n=(t=this._maskStackHash)[s]??(t[s]=0);e.action==="pushMaskBegin"?(i.renderTarget.ensureDepthStencil(),i.stencil.setStencilMode(He.RENDERING_MASK_ADD,n),n++,i.colorMask.setMask(0)):e.action==="pushMaskEnd"?(e.inverse?i.stencil.setStencilMode(He.INVERSE_MASK_ACTIVE,n):i.stencil.setStencilMode(He.MASK_ACTIVE,n),i.colorMask.setMask(15)):e.action==="popMaskBegin"?(i.colorMask.setMask(0),n!==0?i.stencil.setStencilMode(He.RENDERING_MASK_REMOVE,n):(i.renderTarget.clear(null,bt.STENCIL),i.stencil.setStencilMode(He.DISABLED,n)),n--):e.action==="popMaskEnd"&&(e.inverse?i.stencil.setStencilMode(He.INVERSE_MASK_ACTIVE,n):i.stencil.setStencilMode(He.MASK_ACTIVE,n),i.colorMask.setMask(15)),this._maskStackHash[s]=n;}destroy(){this._renderer=null,this._maskStackHash=null,this._maskHash=null;}};ea.extension={type:[x.WebGLPipes,x.WebGPUPipes,x.CanvasPipes],name:"stencilMask"};});var yS,tx,vS=f(()=>{gt();B();yS=class Gw{constructor(){this.clearBeforeRender=true,this._backgroundColor=new te(0),this.color=this._backgroundColor,this.alpha=1;}init(e){e={...Gw.defaultOptions,...e},this.clearBeforeRender=e.clearBeforeRender,this.color=e.background||e.backgroundColor||this._backgroundColor,this.alpha=e.backgroundAlpha,this._backgroundColor.setAlpha(e.backgroundAlpha);}get color(){return this._backgroundColor}set color(e){this._backgroundColor.setValue(e);}get alpha(){return this._backgroundColor.alpha}set alpha(e){this._backgroundColor.setAlpha(e);}get colorRgba(){return this._backgroundColor.toArray()}destroy(){}};yS.extension={type:[x.WebGLSystem,x.WebGPUSystem,x.CanvasSystem],name:"background",priority:0};yS.defaultOptions={backgroundAlpha:1,backgroundColor:0,clearBeforeRender:true};tx=yS;});var od,ta,TS=f(()=>{B();Dc();Be();od={};V.handle(x.BlendMode,r=>{if(!r.name)throw new Error("BlendMode extension must have a name property");od[r.name]=r.ref;},r=>{delete od[r.name];});ta=class{constructor(e){this._isAdvanced=false,this._filterHash=Object.create(null),this._renderer=e,this._renderer.runners.prerender.add(this);}prerender(){this._activeBlendMode="normal",this._isAdvanced=false;}setBlendMode(e,t,i){if(this._activeBlendMode===t){this._isAdvanced&&this._renderableList.push(e);return}this._activeBlendMode=t,this._isAdvanced&&this._endAdvancedBlendMode(i),this._isAdvanced=!!od[t],this._isAdvanced&&(this._beginAdvancedBlendMode(i),this._renderableList.push(e));}_beginAdvancedBlendMode(e){this._renderer.renderPipes.batch.break(e);let t=this._activeBlendMode;if(!od[t]){N(`Unable to assign BlendMode: '${t}'. You may want to include: import 'pixi.js/advanced-blend-modes'`);return}let i=this._filterHash[t];i||(i=this._filterHash[t]=new ei,i.filters=[new od[t]]);let s={renderPipeId:"filter",action:"pushFilter",renderables:[],filterEffect:i,canBundle:false};this._renderableList=s.renderables,e.add(s);}_endAdvancedBlendMode(e){this._renderableList=null,this._renderer.renderPipes.batch.break(e),e.add({renderPipeId:"filter",action:"popFilter",canBundle:false});}buildStart(){this._isAdvanced=false;}buildEnd(e){this._isAdvanced&&this._endAdvancedBlendMode(e);}destroy(){this._renderer=null,this._renderableList=null;for(let e in this._filterHash)this._filterHash[e].destroy();this._filterHash=null;}};ta.extension={type:[x.WebGLPipes,x.WebGPUPipes,x.CanvasPipes],name:"blendMode"};});var SS,ES,rx,CS=f(()=>{B();hr();ye();SS={png:"image/png",jpg:"image/jpeg",webp:"image/webp"},ES=class Uw{constructor(e){this._renderer=e;}_normalizeOptions(e,t={}){return e instanceof ue||e instanceof exports.Texture?{target:e,...t}:{...t,...e}}async image(e){let t=new Image;return t.src=await this.base64(e),t}async base64(e){e=this._normalizeOptions(e,Uw.defaultImageOptions);let{format:t,quality:i}=e,s=this.canvas(e);if(s.toBlob!==void 0)return new Promise((n,o)=>{s.toBlob(a=>{if(!a){o(new Error("ICanvas.toBlob failed!"));return}let u=new FileReader;u.onload=()=>n(u.result),u.onerror=o,u.readAsDataURL(a);},SS[t],i);});if(s.toDataURL!==void 0)return s.toDataURL(SS[t],i);if(s.convertToBlob!==void 0){let n=await s.convertToBlob({type:SS[t],quality:i});return new Promise((o,a)=>{let u=new FileReader;u.onload=()=>o(u.result),u.onerror=a,u.readAsDataURL(n);})}throw new Error("Extract.base64() requires ICanvas.toDataURL, ICanvas.toBlob, or ICanvas.convertToBlob to be implemented")}canvas(e){e=this._normalizeOptions(e);let t=e.target,i=this._renderer;if(t instanceof exports.Texture)return i.texture.generateCanvas(t);let s=i.textureGenerator.generateTexture(e),n=i.texture.generateCanvas(s);return s.destroy(true),n}pixels(e){e=this._normalizeOptions(e);let t=e.target,i=this._renderer,s=t instanceof exports.Texture?t:i.textureGenerator.generateTexture(e),n=i.texture.getPixels(s);return t instanceof ue&&s.destroy(true),n}texture(e){return e=this._normalizeOptions(e),e.target instanceof exports.Texture?e.target:this._renderer.textureGenerator.generateTexture(e)}download(e){e=this._normalizeOptions(e);let t=this.canvas(e),i=document.createElement("a");i.download=e.filename??"image.png",i.href=t.toDataURL("image/png"),document.body.appendChild(i),i.click(),document.body.removeChild(i);}log(e){let t=e.width??200;e=this._normalizeOptions(e);let i=this.canvas(e),s=i.toDataURL();console.log(`[Pixi Texture] ${i.width}px ${i.height}px`);let n=["font-size: 1px;",`padding: ${t}px 300px;`,`background: url(${s}) no-repeat;`,"background-size: contain;"].join(" ");console.log("%c ",n);}destroy(){this._renderer=null;}};ES.extension={type:[x.WebGLSystem,x.WebGPUSystem],name:"extract"};ES.defaultImageOptions={format:"png",quality:1};rx=ES;});var nl,AS=f(()=>{Ct();ye();nl=class r extends exports.Texture{static create(e){return new r({source:new ge(e)})}resize(e,t,i){return this.source.resize(e,t,i),this}};});var Vk,zk,Wk,ra,PS=f(()=>{gt();B();Te();ct();Lt();Oc();hr();AS();Vk=new exports.Rectangle,zk=new Ae,Wk=[0,0,0,0],ra=class{constructor(e){this._renderer=e;}generateTexture(e){e instanceof ue&&(e={target:e,frame:void 0,textureSourceOptions:{},resolution:void 0});let t=e.resolution||this._renderer.resolution,i=e.antialias||this._renderer.view.antialias,s=e.target,n=e.clearColor;n?n=Array.isArray(n)&&n.length===4?n:te.shared.setValue(n).toArray():n=Wk;let o=e.frame?.copyTo(Vk)||Ms(s,zk).rectangle;o.width=Math.max(o.width,1/t)|0,o.height=Math.max(o.height,1/t)|0;let a=nl.create({...e.textureSourceOptions,width:o.width,height:o.height,resolution:t,antialias:i}),u=G.shared.translate(-o.x,-o.y);return this._renderer.render({container:s,transform:u,target:a,clearColor:n}),a.source.updateMipmaps(),a}destroy(){this._renderer=null;}};ra.extension={type:[x.WebGLSystem,x.WebGPUSystem],name:"textureGenerator"};});var ia,wS=f(()=>{B();Te();cr();bo();ns();Ar();ht();ia=class{constructor(e){this._stackIndex=0,this._globalUniformDataStack=[],this._uniformsPool=[],this._activeUniforms=[],this._bindGroupPool=[],this._activeBindGroups=[],this._renderer=e;}reset(){this._stackIndex=0;for(let e=0;e<this._activeUniforms.length;e++)this._uniformsPool.push(this._activeUniforms[e]);for(let e=0;e<this._activeBindGroups.length;e++)this._bindGroupPool.push(this._activeBindGroups[e]);this._activeUniforms.length=0,this._activeBindGroups.length=0;}start(e){this.reset(),this.push(e);}bind({size:e,projectionMatrix:t,worldTransformMatrix:i,worldColor:s,offset:n}){let o=this._renderer.renderTarget.renderTarget,a=this._stackIndex?this._globalUniformDataStack[this._stackIndex-1]:{worldTransformMatrix:new G,worldColor:4294967295,offset:new me},u={projectionMatrix:t||this._renderer.renderTarget.projectionMatrix,resolution:e||o.size,worldTransformMatrix:i||a.worldTransformMatrix,worldColor:s||a.worldColor,offset:n||a.offset,bindGroup:null},l=this._uniformsPool.pop()||this._createUniforms();this._activeUniforms.push(l);let c=l.uniforms;c.uProjectionMatrix=u.projectionMatrix,c.uResolution=u.resolution,c.uWorldTransformMatrix.copyFrom(u.worldTransformMatrix),c.uWorldTransformMatrix.tx-=u.offset.x,c.uWorldTransformMatrix.ty-=u.offset.y,Wr(u.worldColor,c.uWorldColorAlpha,0),l.update();let h;this._renderer.renderPipes.uniformBatch?h=this._renderer.renderPipes.uniformBatch.getUniformBindGroup(l,false):(h=this._bindGroupPool.pop()||new _t,this._activeBindGroups.push(h),h.setResource(l,0)),u.bindGroup=h,this._currentGlobalUniformData=u;}push(e){this.bind(e),this._globalUniformDataStack[this._stackIndex++]=this._currentGlobalUniformData;}pop(){this._currentGlobalUniformData=this._globalUniformDataStack[--this._stackIndex-1],this._renderer.type===qe.WEBGL&&this._currentGlobalUniformData.bindGroup.resources[0].update();}get bindGroup(){return this._currentGlobalUniformData.bindGroup}get globalUniformData(){return this._currentGlobalUniformData}get uniformGroup(){return this._currentGlobalUniformData.bindGroup.resources[0]}_createUniforms(){return new xe({uProjectionMatrix:{value:new G,type:"mat3x3<f32>"},uWorldTransformMatrix:{value:new G,type:"mat3x3<f32>"},uWorldColorAlpha:{value:new Float32Array(4),type:"vec4<f32>"},uResolution:{value:[0,0],type:"vec2<f32>"}},{isStatic:true})}destroy(){this._renderer=null;}};ia.extension={type:[x.WebGLSystem,x.WebGPUSystem,x.CanvasSystem],name:"globalUniforms"};});var Xk,sa,BS=f(()=>{B();Gs();Xk=1,sa=class{constructor(){this._tasks=[],this._offset=0;}init(){Ie.system.add(this._update,this);}repeat(e,t,i=true){let s=Xk++,n=0;return i&&(this._offset+=1e3,n=this._offset),this._tasks.push({func:e,duration:t,start:performance.now(),offset:n,last:performance.now(),repeat:true,id:s}),s}cancel(e){for(let t=0;t<this._tasks.length;t++)if(this._tasks[t].id===e){this._tasks.splice(t,1);return}}_update(){let e=performance.now();for(let t=0;t<this._tasks.length;t++){let i=this._tasks[t];if(e-i.offset-i.last>=i.duration){let s=e-i.start;i.func(s),i.last=e;}}}destroy(){Ie.system.remove(this._update,this),this._tasks.length=0;}};sa.extension={type:[x.WebGLSystem,x.WebGPUSystem,x.CanvasSystem],name:"scheduler",priority:0};});function ix(r){if(!Lw){if(j.get().getNavigator().userAgent.toLowerCase().indexOf("chrome")>-1){let e=[`%c %c %c %c %c PixiJS %c v${yn} (${r}) http://www.pixijs.com/
1716
1716
 
1717
- `,"background: #E72264; padding:5px 0;","background: #6CA2EA; padding:5px 0;","background: #B5D33D; padding:5px 0;","background: #FED23F; padding:5px 0;","color: #FFFFFF; background: #E72264; padding:5px 0;","color: #E72264; background: #FFFFFF; padding:5px 0;"];globalThis.console.log(...e);}else globalThis.console&&globalThis.console.log(`PixiJS ${yn} - ${r} - http://www.pixijs.com/`);Lw=true;}}var Lw,RS=f(()=>{Ge();Zg();Lw=false;});var vn,MS=f(()=>{B();RS();Ar();vn=class{constructor(e){this._renderer=e;}init(e){if(e.hello){let t=this._renderer.name;this._renderer.type===qe.WEBGL&&(t+=` ${this._renderer.context.webGLVersion}`),ix(t);}}};vn.extension={type:[x.WebGLSystem,x.WebGPUSystem,x.CanvasSystem],name:"hello",priority:-2};vn.defaultOptions={hello:false};});function sx(r){let e=false;for(let i in r)if(r[i]==null){e=true;break}if(!e)return r;let t=Object.create(null);for(let i in r){let s=r[i];s&&(t[i]=s);}return t}function nx(r){let e=0;for(let t=0;t<r.length;t++)r[t]==null?e++:r[t-e]=r[t];return r.length-=e,r}var IS=f(()=>{});var Yk,DS,ox,kS=f(()=>{B();IS();Yk=0,DS=class Nw{constructor(e){this._managedRenderables=[],this._managedHashes=[],this._managedArrays=[],this._renderer=e;}init(e){e={...Nw.defaultOptions,...e},this.maxUnusedTime=e.renderableGCMaxUnusedTime,this._frequency=e.renderableGCFrequency,this.enabled=e.renderableGCActive;}get enabled(){return !!this._handler}set enabled(e){this.enabled!==e&&(e?(this._handler=this._renderer.scheduler.repeat(()=>this.run(),this._frequency,false),this._hashHandler=this._renderer.scheduler.repeat(()=>{for(let t of this._managedHashes)t.context[t.hash]=sx(t.context[t.hash]);},this._frequency),this._arrayHandler=this._renderer.scheduler.repeat(()=>{for(let t of this._managedArrays)nx(t.context[t.hash]);},this._frequency)):(this._renderer.scheduler.cancel(this._handler),this._renderer.scheduler.cancel(this._hashHandler),this._renderer.scheduler.cancel(this._arrayHandler)));}addManagedHash(e,t){this._managedHashes.push({context:e,hash:t});}addManagedArray(e,t){this._managedArrays.push({context:e,hash:t});}prerender({container:e}){this._now=performance.now(),e.renderGroup.gcTick=Yk++,this._updateInstructionGCTick(e.renderGroup,e.renderGroup.gcTick);}addRenderable(e){this.enabled&&(e._lastUsed===-1&&(this._managedRenderables.push(e),e.once("destroyed",this._removeRenderable,this)),e._lastUsed=this._now);}run(){let e=this._now,t=this._managedRenderables,i=this._renderer.renderPipes,s=0;for(let n=0;n<t.length;n++){let o=t[n];if(o===null){s++;continue}let a=o.renderGroup??o.parentRenderGroup,u=a?.instructionSet?.gcTick??-1;if((a?.gcTick??0)===u&&(o._lastUsed=e),e-o._lastUsed>this.maxUnusedTime){if(!o.destroyed){let l=i;a&&(a.structureDidChange=true),l[o.renderPipeId].destroyRenderable(o);}o._lastUsed=-1,s++,o.off("destroyed",this._removeRenderable,this);}else t[n-s]=o;}t.length-=s;}destroy(){this.enabled=false,this._renderer=null,this._managedRenderables.length=0,this._managedHashes.length=0,this._managedArrays.length=0;}_removeRenderable(e){let t=this._managedRenderables.indexOf(e);t>=0&&(e.off("destroyed",this._removeRenderable,this),this._managedRenderables[t]=null);}_updateInstructionGCTick(e,t){e.instructionSet.gcTick=t;for(let i of e.renderGroupChildren)this._updateInstructionGCTick(i,t);}};DS.extension={type:[x.WebGLSystem,x.WebGPUSystem],name:"renderableGC",priority:0};DS.defaultOptions={renderableGCActive:true,renderableGCMaxUnusedTime:6e4,renderableGCFrequency:3e4};ox=DS;});var OS,ax,FS=f(()=>{B();OS=class Hw{constructor(e){this._renderer=e,this.count=0,this.checkCount=0;}init(e){e={...Hw.defaultOptions,...e},this.checkCountMax=e.textureGCCheckCountMax,this.maxIdle=e.textureGCAMaxIdle??e.textureGCMaxIdle,this.active=e.textureGCActive;}postrender(){this._renderer.renderingToScreen&&(this.count++,this.active&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())));}run(){let e=this._renderer.texture.managedTextures;for(let t=0;t<e.length;t++){let i=e[t];i.autoGarbageCollect&&i.resource&&i._touched>-1&&this.count-i._touched>this.maxIdle&&(i._touched=-1,i.unload());}}destroy(){this._renderer=null;}};OS.extension={type:[x.WebGLSystem,x.WebGPUSystem],name:"textureGC"};OS.defaultOptions={textureGCActive:true,textureGCAMaxIdle:null,textureGCMaxIdle:60*60,textureGCCheckCountMax:600};ax=OS;});var Vw,na,ux=f(()=>{Et();Ct();ye();Vw=class zw{constructor(e={}){if(this.uid=ce("renderTarget"),this.colorTextures=[],this.dirtyId=0,this.isRoot=false,this._size=new Float32Array(2),this._managedColorTextures=false,e={...zw.defaultOptions,...e},this.stencil=e.stencil,this.depth=e.depth,this.isRoot=e.isRoot,typeof e.colorTextures=="number"){this._managedColorTextures=true;for(let t=0;t<e.colorTextures;t++)this.colorTextures.push(new ge({width:e.width,height:e.height,resolution:e.resolution,antialias:e.antialias}));}else {this.colorTextures=[...e.colorTextures.map(i=>i.source)];let t=this.colorTexture.source;this.resize(t.width,t.height,t._resolution);}this.colorTexture.source.on("resize",this.onSourceResize,this),(e.depthStencilTexture||this.stencil)&&(e.depthStencilTexture instanceof exports.Texture||e.depthStencilTexture instanceof ge?this.depthStencilTexture=e.depthStencilTexture.source:this.ensureDepthStencilTexture());}get size(){let e=this._size;return e[0]=this.pixelWidth,e[1]=this.pixelHeight,e}get width(){return this.colorTexture.source.width}get height(){return this.colorTexture.source.height}get pixelWidth(){return this.colorTexture.source.pixelWidth}get pixelHeight(){return this.colorTexture.source.pixelHeight}get resolution(){return this.colorTexture.source._resolution}get colorTexture(){return this.colorTextures[0]}onSourceResize(e){this.resize(e.width,e.height,e._resolution,true);}ensureDepthStencilTexture(){this.depthStencilTexture||(this.depthStencilTexture=new ge({width:this.width,height:this.height,resolution:this.resolution,format:"depth24plus-stencil8",autoGenerateMipmaps:false,antialias:false,mipLevelCount:1}));}resize(e,t,i=this.resolution,s=false){this.dirtyId++,this.colorTextures.forEach((n,o)=>{s&&o===0||n.source.resize(e,t,i);}),this.depthStencilTexture&&this.depthStencilTexture.source.resize(e,t,i);}destroy(){this.colorTexture.source.off("resize",this.onSourceResize,this),this._managedColorTextures&&this.colorTextures.forEach(e=>{e.destroy();}),this.depthStencilTexture&&(this.depthStencilTexture.destroy(),delete this.depthStencilTexture);}};Vw.defaultOptions={width:0,height:0,resolution:1,colorTextures:1,stencil:false,depth:false,antialias:false,isRoot:false};na=Vw;});function al(r,e){if(!ol.has(r)){let t=new exports.Texture({source:new At({resource:r,...e})}),i=()=>{ol.get(r)===t&&ol.delete(r);};t.once("destroy",i),t.source.once("destroy",i),ol.set(r,t);}return ol.get(r)}function Ww(r){return ol.has(r)}var ol,lx=f(()=>{ho();ye();ol=new Map;});var GS,cx,US=f(()=>{Ge();B();ct();Pe();ux();lx();GS=class Xw{get autoDensity(){return this.texture.source.autoDensity}set autoDensity(e){this.texture.source.autoDensity=e;}get resolution(){return this.texture.source._resolution}set resolution(e){this.texture.source.resize(this.texture.source.width,this.texture.source.height,e);}init(e){e={...Xw.defaultOptions,...e},e.view&&(U(Y,"ViewSystem.view has been renamed to ViewSystem.canvas"),e.canvas=e.view),this.screen=new exports.Rectangle(0,0,e.width,e.height),this.canvas=e.canvas||j.get().createCanvas(),this.antialias=!!e.antialias,this.texture=al(this.canvas,e),this.renderTarget=new na({colorTextures:[this.texture],depth:!!e.depth,isRoot:true}),this.texture.source.transparent=e.backgroundAlpha<1,this.resolution=e.resolution;}resize(e,t,i){this.texture.source.resize(e,t,i),this.screen.width=this.texture.frame.width,this.screen.height=this.texture.frame.height;}destroy(e=false){(typeof e=="boolean"?e:!!e?.removeView)&&this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas);}};GS.extension={type:[x.WebGLSystem,x.WebGPUSystem,x.CanvasSystem],name:"view",priority:0};GS.defaultOptions={width:800,height:600,autoDensity:false,antialias:false};cx=GS;});var ul,ll,hx=f(()=>{iS();sS();uS();lS();Qg();hS();xS();_S();bS();vS();TS();CS();PS();wS();BS();MS();kS();FS();US();ul=[tx,ia,vn,cx,$o,ax,ra,rx,Zo,ox,sa],ll=[ta,sd,qo,Yo,Qo,ea,Jo,Wo];});var oa,LS=f(()=>{B();oa=class{constructor(e){this._hash=Object.create(null),this._renderer=e,this._renderer.renderableGC.addManagedHash(this,"_hash");}contextChange(e){this._gpu=e;}getBindGroup(e,t,i){return e._updateKey(),this._hash[e._key]||this._createBindGroup(e,t,i)}_createBindGroup(e,t,i){let s=this._gpu.device,n=t.layout[i],o=[],a=this._renderer;for(let c in n){let h=e.resources[c]??e.resources[n[c]],d;if(h._resourceType==="uniformGroup"){let p=h;a.ubo.updateUniformGroup(p);let m=p.buffer;d={buffer:a.buffer.getGPUBuffer(m),offset:0,size:m.descriptor.size};}else if(h._resourceType==="buffer"){let p=h;d={buffer:a.buffer.getGPUBuffer(p),offset:0,size:p.descriptor.size};}else if(h._resourceType==="bufferResource"){let p=h;d={buffer:a.buffer.getGPUBuffer(p.buffer),offset:p.offset,size:p.size};}else if(h._resourceType==="textureSampler"){let p=h;d=a.texture.getGpuSampler(p);}else if(h._resourceType==="textureSource"){let p=h;d=a.texture.getGpuSource(p).createView({});}o.push({binding:n[c],resource:d});}let u=a.shader.getProgramData(t).bindGroups[i],l=s.createBindGroup({layout:u,entries:o});return this._hash[e._key]=l,l}destroy(){for(let e of Object.keys(this._hash))this._hash[e]=null;this._hash=null,this._renderer=null;}};oa.extension={type:[x.WebGPUSystem],name:"bindGroup"};});var aa,NS=f(()=>{B();Gp();aa=class{constructor(e){this._gpuBuffers=Object.create(null),this._managedBuffers=[],e.renderableGC.addManagedHash(this,"_gpuBuffers");}contextChange(e){this._gpu=e;}getGPUBuffer(e){return this._gpuBuffers[e.uid]||this.createGPUBuffer(e)}updateBuffer(e){let t=this._gpuBuffers[e.uid]||this.createGPUBuffer(e),i=e.data;return e._updateID&&i&&(e._updateID=0,this._gpu.device.queue.writeBuffer(t,0,i.buffer,0,(e._updateSize||i.byteLength)+3&-4)),t}destroyAll(){for(let e in this._gpuBuffers)this._gpuBuffers[e].destroy();this._gpuBuffers={};}createGPUBuffer(e){this._gpuBuffers[e.uid]||(e.on("update",this.updateBuffer,this),e.on("change",this.onBufferChange,this),e.on("destroy",this.onBufferDestroy,this),this._managedBuffers.push(e));let t=this._gpu.device.createBuffer(e.descriptor);return e._updateID=0,e.data&&(po(e.data.buffer,t.getMappedRange()),t.unmap()),this._gpuBuffers[e.uid]=t,t}onBufferChange(e){this._gpuBuffers[e.uid].destroy(),e._updateID=0,this._gpuBuffers[e.uid]=this.createGPUBuffer(e);}onBufferDestroy(e){this._managedBuffers.splice(this._managedBuffers.indexOf(e),1),this._destroyBuffer(e);}destroy(){this._managedBuffers.forEach(e=>this._destroyBuffer(e)),this._managedBuffers=null,this._gpuBuffers=null;}_destroyBuffer(e){this._gpuBuffers[e.uid].destroy(),e.off("update",this.updateBuffer,this),e.off("change",this.onBufferChange,this),e.off("destroy",this.onBufferDestroy,this),this._gpuBuffers[e.uid]=null;}};aa.extension={type:[x.WebGPUSystem],name:"buffer"};});var ua,HS=f(()=>{B();ua=class{constructor(e){this._colorMaskCache=15,this._renderer=e;}setMask(e){this._colorMaskCache!==e&&(this._colorMaskCache=e,this._renderer.pipeline.setColorMask(e));}destroy(){this._renderer=null,this._colorMaskCache=null;}};ua.extension={type:[x.WebGPUSystem],name:"colorMask"};});var Tn,VS=f(()=>{Ge();B();Tn=class{constructor(e){this._renderer=e;}async init(e){return this._initPromise?this._initPromise:(this._initPromise=this._createDeviceAndAdaptor(e).then(t=>{this.gpu=t,this._renderer.runners.contextChange.emit(this.gpu);}),this._initPromise)}contextChange(e){this._renderer.gpu=e;}async _createDeviceAndAdaptor(e){let t=await j.get().getNavigator().gpu.requestAdapter({powerPreference:e.powerPreference,forceFallbackAdapter:e.forceFallbackAdapter}),i=["texture-compression-bc","texture-compression-astc","texture-compression-etc2"].filter(n=>t.features.has(n)),s=await t.requestDevice({requiredFeatures:i});return {adapter:t,device:s}}destroy(){this.gpu=null,this._renderer=null;}};Tn.extension={type:[x.WebGPUSystem],name:"device"};Tn.defaultOptions={powerPreference:void 0,forceFallbackAdapter:false};});var la,zS=f(()=>{B();la=class{constructor(e){this._boundBindGroup=Object.create(null),this._boundVertexBuffer=Object.create(null),this._renderer=e;}renderStart(){this.commandFinished=new Promise(e=>{this._resolveCommandFinished=e;}),this.commandEncoder=this._renderer.gpu.device.createCommandEncoder();}beginRenderPass(e){this.endRenderPass(),this._clearCache(),this.renderPassEncoder=this.commandEncoder.beginRenderPass(e.descriptor);}endRenderPass(){this.renderPassEncoder&&this.renderPassEncoder.end(),this.renderPassEncoder=null;}setViewport(e){this.renderPassEncoder.setViewport(e.x,e.y,e.width,e.height,0,1);}setPipelineFromGeometryProgramAndState(e,t,i,s){let n=this._renderer.pipeline.getPipeline(e,t,i,s);this.setPipeline(n);}setPipeline(e){this._boundPipeline!==e&&(this._boundPipeline=e,this.renderPassEncoder.setPipeline(e));}_setVertexBuffer(e,t){this._boundVertexBuffer[e]!==t&&(this._boundVertexBuffer[e]=t,this.renderPassEncoder.setVertexBuffer(e,this._renderer.buffer.updateBuffer(t)));}_setIndexBuffer(e){if(this._boundIndexBuffer===e)return;this._boundIndexBuffer=e;let t=e.data.BYTES_PER_ELEMENT===2?"uint16":"uint32";this.renderPassEncoder.setIndexBuffer(this._renderer.buffer.updateBuffer(e),t);}resetBindGroup(e){this._boundBindGroup[e]=null;}setBindGroup(e,t,i){if(this._boundBindGroup[e]===t)return;this._boundBindGroup[e]=t,t._touch(this._renderer.textureGC.count);let s=this._renderer.bindGroup.getBindGroup(t,i,e);this.renderPassEncoder.setBindGroup(e,s);}setGeometry(e,t){let i=this._renderer.pipeline.getBufferNamesToBind(e,t);for(let s in i)this._setVertexBuffer(s,e.attributes[i[s]].buffer);e.indexBuffer&&this._setIndexBuffer(e.indexBuffer);}_setShaderBindGroups(e,t){for(let i in e.groups){let s=e.groups[i];t||this._syncBindGroup(s),this.setBindGroup(i,s,e.gpuProgram);}}_syncBindGroup(e){for(let t in e.resources){let i=e.resources[t];i.isUniformGroup&&this._renderer.ubo.updateUniformGroup(i);}}draw(e){let{geometry:t,shader:i,state:s,topology:n,size:o,start:a,instanceCount:u,skipSync:l}=e;this.setPipelineFromGeometryProgramAndState(t,i.gpuProgram,s,n),this.setGeometry(t,i.gpuProgram),this._setShaderBindGroups(i,l),t.indexBuffer?this.renderPassEncoder.drawIndexed(o||t.indexBuffer.data.length,u??t.instanceCount,a||0):this.renderPassEncoder.draw(o||t.getSize(),u??t.instanceCount,a||0);}finishRenderPass(){this.renderPassEncoder&&(this.renderPassEncoder.end(),this.renderPassEncoder=null);}postrender(){this.finishRenderPass(),this._gpu.device.queue.submit([this.commandEncoder.finish()]),this._resolveCommandFinished(),this.commandEncoder=null;}restoreRenderPass(){let e=this._renderer.renderTarget.adaptor.getDescriptor(this._renderer.renderTarget.renderTarget,false,[0,0,0,1]);this.renderPassEncoder=this.commandEncoder.beginRenderPass(e);let t=this._boundPipeline,i={...this._boundVertexBuffer},s=this._boundIndexBuffer,n={...this._boundBindGroup};this._clearCache();let o=this._renderer.renderTarget.viewport;this.renderPassEncoder.setViewport(o.x,o.y,o.width,o.height,0,1),this.setPipeline(t);for(let a in i)this._setVertexBuffer(a,i[a]);for(let a in n)this.setBindGroup(a,n[a],null);this._setIndexBuffer(s);}_clearCache(){for(let e=0;e<16;e++)this._boundBindGroup[e]=null,this._boundVertexBuffer[e]=null;this._boundIndexBuffer=null,this._boundPipeline=null;}destroy(){this._renderer=null,this._gpu=null,this._boundBindGroup=null,this._boundVertexBuffer=null,this._boundIndexBuffer=null,this._boundPipeline=null;}contextChange(e){this._gpu=e;}};la.extension={type:[x.WebGPUSystem],name:"encoder",priority:1};});var ca,WS=f(()=>{B();ca=class{constructor(e){this._renderer=e;}contextChange(){this.maxTextures=this._renderer.device.gpu.device.limits.maxSampledTexturesPerShaderStage,this.maxBatchableTextures=this.maxTextures;}destroy(){}};ca.extension={type:[x.WebGPUSystem],name:"limits"};});var ha,XS=f(()=>{B();Xs();ha=class{constructor(e){this._renderTargetStencilState=Object.create(null),this._renderer=e,e.renderTarget.onRenderTargetChange.add(this);}onRenderTargetChange(e){let t=this._renderTargetStencilState[e.uid];t||(t=this._renderTargetStencilState[e.uid]={stencilMode:He.DISABLED,stencilReference:0}),this._activeRenderTarget=e,this.setStencilMode(t.stencilMode,t.stencilReference);}setStencilMode(e,t){let i=this._renderTargetStencilState[this._activeRenderTarget.uid];i.stencilMode=e,i.stencilReference=t;let s=this._renderer;s.pipeline.setStencilMode(e),s.encoder.renderPassEncoder.setStencilReference(t);}destroy(){this._renderer.renderTarget.onRenderTargetChange.remove(this),this._renderer=null,this._activeRenderTarget=null,this._renderTargetStencilState=null;}};ha.extension={type:[x.WebGPUSystem],name:"stencil"};});var Sn,dx=f(()=>{Lg();os();Pi();Sn=class{constructor(e){this._syncFunctionHash=Object.create(null),this._adaptor=e,this._systemCheck();}_systemCheck(){if(!el())throw new Error("Current environment does not allow unsafe-eval, please use pixi.js/unsafe-eval module to enable support.")}ensureUniformGroup(e){let t=this.getUniformGroupData(e);e.buffer||(e.buffer=new tt({data:new Float32Array(t.layout.size/4),usage:he.UNIFORM|he.COPY_DST}));}getUniformGroupData(e){return this._syncFunctionHash[e._signature]||this._initUniformGroup(e)}_initUniformGroup(e){let t=e._signature,i=this._syncFunctionHash[t];if(!i){let s=Object.keys(e.uniformStructures).map(a=>e.uniformStructures[a]),n=this._adaptor.createUboElements(s),o=this._generateUboSync(n.uboElements);i=this._syncFunctionHash[t]={layout:n,syncFunction:o};}return this._syncFunctionHash[t]}_generateUboSync(e){return this._adaptor.generateUboSync(e)}syncUniformGroup(e,t,i){let s=this.getUniformGroupData(e);e.buffer||(e.buffer=new tt({data:new Float32Array(s.layout.size/4),usage:he.UNIFORM|he.COPY_DST}));let n=null;return t||(t=e.buffer.data,n=e.buffer.dataInt32),i||(i=0),s.syncFunction(e.uniforms,t,n,i),true}updateUniformGroup(e){if(e.isStatic&&!e._dirtyId)return false;e._dirtyId=0;let t=this.syncUniformGroup(e);return e.buffer.update(),t}destroy(){this._syncFunctionHash=null;}};});function fx(r){let e=r.map(i=>({data:i,offset:0,size:0})),t=0;for(let i=0;i<e.length;i++){let s=e[i],n=da[s.data.type].size,o=da[s.data.type].align;if(!da[s.data.type])throw new Error(`[Pixi.js] WebGPU UniformBuffer: Unknown type ${s.data.type}`);s.data.size>1&&(n=Math.max(n,o)*s.data.size),t=Math.ceil(t/o)*o,s.size=n,s.offset=t,t+=n;}return t=Math.ceil(t/16)*16,{uboElements:e,size:t}}var da,px=f(()=>{da={i32:{align:4,size:4},u32:{align:4,size:4},f32:{align:4,size:4},f16:{align:2,size:2},"vec2<i32>":{align:8,size:8},"vec2<u32>":{align:8,size:8},"vec2<f32>":{align:8,size:8},"vec2<f16>":{align:4,size:4},"vec3<i32>":{align:16,size:12},"vec3<u32>":{align:16,size:12},"vec3<f32>":{align:16,size:12},"vec3<f16>":{align:8,size:6},"vec4<i32>":{align:16,size:16},"vec4<u32>":{align:16,size:16},"vec4<f32>":{align:16,size:16},"vec4<f16>":{align:8,size:8},"mat2x2<f32>":{align:8,size:16},"mat2x2<f16>":{align:4,size:8},"mat3x2<f32>":{align:8,size:24},"mat3x2<f16>":{align:4,size:12},"mat4x2<f32>":{align:8,size:32},"mat4x2<f16>":{align:4,size:16},"mat2x3<f32>":{align:16,size:32},"mat2x3<f16>":{align:8,size:16},"mat3x3<f32>":{align:16,size:48},"mat3x3<f16>":{align:8,size:24},"mat4x3<f32>":{align:16,size:64},"mat4x3<f16>":{align:8,size:32},"mat2x4<f32>":{align:16,size:32},"mat2x4<f16>":{align:8,size:16},"mat3x4<f32>":{align:16,size:48},"mat3x4<f16>":{align:8,size:24},"mat4x4<f32>":{align:16,size:64},"mat4x4<f16>":{align:8,size:32}};});var hi,mx=f(()=>{hi=[{type:"mat3x3<f32>",test:r=>r.value.a!==void 0,ubo:`
1717
+ `,"background: #E72264; padding:5px 0;","background: #6CA2EA; padding:5px 0;","background: #B5D33D; padding:5px 0;","background: #FED23F; padding:5px 0;","color: #FFFFFF; background: #E72264; padding:5px 0;","color: #E72264; background: #FFFFFF; padding:5px 0;"];globalThis.console.log(...e);}else globalThis.console&&globalThis.console.log(`PixiJS ${yn} - ${r} - http://www.pixijs.com/`);Lw=true;}}var Lw,RS=f(()=>{Fe();Zg();Lw=false;});var vn,MS=f(()=>{B();RS();Ar();vn=class{constructor(e){this._renderer=e;}init(e){if(e.hello){let t=this._renderer.name;this._renderer.type===qe.WEBGL&&(t+=` ${this._renderer.context.webGLVersion}`),ix(t);}}};vn.extension={type:[x.WebGLSystem,x.WebGPUSystem,x.CanvasSystem],name:"hello",priority:-2};vn.defaultOptions={hello:false};});function sx(r){let e=false;for(let i in r)if(r[i]==null){e=true;break}if(!e)return r;let t=Object.create(null);for(let i in r){let s=r[i];s&&(t[i]=s);}return t}function nx(r){let e=0;for(let t=0;t<r.length;t++)r[t]==null?e++:r[t-e]=r[t];return r.length-=e,r}var IS=f(()=>{});var Yk,DS,ox,kS=f(()=>{B();IS();Yk=0,DS=class Nw{constructor(e){this._managedRenderables=[],this._managedHashes=[],this._managedArrays=[],this._renderer=e;}init(e){e={...Nw.defaultOptions,...e},this.maxUnusedTime=e.renderableGCMaxUnusedTime,this._frequency=e.renderableGCFrequency,this.enabled=e.renderableGCActive;}get enabled(){return !!this._handler}set enabled(e){this.enabled!==e&&(e?(this._handler=this._renderer.scheduler.repeat(()=>this.run(),this._frequency,false),this._hashHandler=this._renderer.scheduler.repeat(()=>{for(let t of this._managedHashes)t.context[t.hash]=sx(t.context[t.hash]);},this._frequency),this._arrayHandler=this._renderer.scheduler.repeat(()=>{for(let t of this._managedArrays)nx(t.context[t.hash]);},this._frequency)):(this._renderer.scheduler.cancel(this._handler),this._renderer.scheduler.cancel(this._hashHandler),this._renderer.scheduler.cancel(this._arrayHandler)));}addManagedHash(e,t){this._managedHashes.push({context:e,hash:t});}addManagedArray(e,t){this._managedArrays.push({context:e,hash:t});}prerender({container:e}){this._now=performance.now(),e.renderGroup.gcTick=Yk++,this._updateInstructionGCTick(e.renderGroup,e.renderGroup.gcTick);}addRenderable(e){this.enabled&&(e._lastUsed===-1&&(this._managedRenderables.push(e),e.once("destroyed",this._removeRenderable,this)),e._lastUsed=this._now);}run(){let e=this._now,t=this._managedRenderables,i=this._renderer.renderPipes,s=0;for(let n=0;n<t.length;n++){let o=t[n];if(o===null){s++;continue}let a=o.renderGroup??o.parentRenderGroup,u=a?.instructionSet?.gcTick??-1;if((a?.gcTick??0)===u&&(o._lastUsed=e),e-o._lastUsed>this.maxUnusedTime){if(!o.destroyed){let l=i;a&&(a.structureDidChange=true),l[o.renderPipeId].destroyRenderable(o);}o._lastUsed=-1,s++,o.off("destroyed",this._removeRenderable,this);}else t[n-s]=o;}t.length-=s;}destroy(){this.enabled=false,this._renderer=null,this._managedRenderables.length=0,this._managedHashes.length=0,this._managedArrays.length=0;}_removeRenderable(e){let t=this._managedRenderables.indexOf(e);t>=0&&(e.off("destroyed",this._removeRenderable,this),this._managedRenderables[t]=null);}_updateInstructionGCTick(e,t){e.instructionSet.gcTick=t;for(let i of e.renderGroupChildren)this._updateInstructionGCTick(i,t);}};DS.extension={type:[x.WebGLSystem,x.WebGPUSystem],name:"renderableGC",priority:0};DS.defaultOptions={renderableGCActive:true,renderableGCMaxUnusedTime:6e4,renderableGCFrequency:3e4};ox=DS;});var OS,ax,FS=f(()=>{B();OS=class Hw{constructor(e){this._renderer=e,this.count=0,this.checkCount=0;}init(e){e={...Hw.defaultOptions,...e},this.checkCountMax=e.textureGCCheckCountMax,this.maxIdle=e.textureGCAMaxIdle??e.textureGCMaxIdle,this.active=e.textureGCActive;}postrender(){this._renderer.renderingToScreen&&(this.count++,this.active&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())));}run(){let e=this._renderer.texture.managedTextures;for(let t=0;t<e.length;t++){let i=e[t];i.autoGarbageCollect&&i.resource&&i._touched>-1&&this.count-i._touched>this.maxIdle&&(i._touched=-1,i.unload());}}destroy(){this._renderer=null;}};OS.extension={type:[x.WebGLSystem,x.WebGPUSystem],name:"textureGC"};OS.defaultOptions={textureGCActive:true,textureGCAMaxIdle:null,textureGCMaxIdle:60*60,textureGCCheckCountMax:600};ax=OS;});var Vw,na,ux=f(()=>{Et();Ct();ye();Vw=class zw{constructor(e={}){if(this.uid=ce("renderTarget"),this.colorTextures=[],this.dirtyId=0,this.isRoot=false,this._size=new Float32Array(2),this._managedColorTextures=false,e={...zw.defaultOptions,...e},this.stencil=e.stencil,this.depth=e.depth,this.isRoot=e.isRoot,typeof e.colorTextures=="number"){this._managedColorTextures=true;for(let t=0;t<e.colorTextures;t++)this.colorTextures.push(new ge({width:e.width,height:e.height,resolution:e.resolution,antialias:e.antialias}));}else {this.colorTextures=[...e.colorTextures.map(i=>i.source)];let t=this.colorTexture.source;this.resize(t.width,t.height,t._resolution);}this.colorTexture.source.on("resize",this.onSourceResize,this),(e.depthStencilTexture||this.stencil)&&(e.depthStencilTexture instanceof exports.Texture||e.depthStencilTexture instanceof ge?this.depthStencilTexture=e.depthStencilTexture.source:this.ensureDepthStencilTexture());}get size(){let e=this._size;return e[0]=this.pixelWidth,e[1]=this.pixelHeight,e}get width(){return this.colorTexture.source.width}get height(){return this.colorTexture.source.height}get pixelWidth(){return this.colorTexture.source.pixelWidth}get pixelHeight(){return this.colorTexture.source.pixelHeight}get resolution(){return this.colorTexture.source._resolution}get colorTexture(){return this.colorTextures[0]}onSourceResize(e){this.resize(e.width,e.height,e._resolution,true);}ensureDepthStencilTexture(){this.depthStencilTexture||(this.depthStencilTexture=new ge({width:this.width,height:this.height,resolution:this.resolution,format:"depth24plus-stencil8",autoGenerateMipmaps:false,antialias:false,mipLevelCount:1}));}resize(e,t,i=this.resolution,s=false){this.dirtyId++,this.colorTextures.forEach((n,o)=>{s&&o===0||n.source.resize(e,t,i);}),this.depthStencilTexture&&this.depthStencilTexture.source.resize(e,t,i);}destroy(){this.colorTexture.source.off("resize",this.onSourceResize,this),this._managedColorTextures&&this.colorTextures.forEach(e=>{e.destroy();}),this.depthStencilTexture&&(this.depthStencilTexture.destroy(),delete this.depthStencilTexture);}};Vw.defaultOptions={width:0,height:0,resolution:1,colorTextures:1,stencil:false,depth:false,antialias:false,isRoot:false};na=Vw;});function al(r,e){if(!ol.has(r)){let t=new exports.Texture({source:new At({resource:r,...e})}),i=()=>{ol.get(r)===t&&ol.delete(r);};t.once("destroy",i),t.source.once("destroy",i),ol.set(r,t);}return ol.get(r)}function Ww(r){return ol.has(r)}var ol,lx=f(()=>{ho();ye();ol=new Map;});var GS,cx,US=f(()=>{Fe();B();ct();Pe();ux();lx();GS=class Xw{get autoDensity(){return this.texture.source.autoDensity}set autoDensity(e){this.texture.source.autoDensity=e;}get resolution(){return this.texture.source._resolution}set resolution(e){this.texture.source.resize(this.texture.source.width,this.texture.source.height,e);}init(e){e={...Xw.defaultOptions,...e},e.view&&(U(Y,"ViewSystem.view has been renamed to ViewSystem.canvas"),e.canvas=e.view),this.screen=new exports.Rectangle(0,0,e.width,e.height),this.canvas=e.canvas||j.get().createCanvas(),this.antialias=!!e.antialias,this.texture=al(this.canvas,e),this.renderTarget=new na({colorTextures:[this.texture],depth:!!e.depth,isRoot:true}),this.texture.source.transparent=e.backgroundAlpha<1,this.resolution=e.resolution;}resize(e,t,i){this.texture.source.resize(e,t,i),this.screen.width=this.texture.frame.width,this.screen.height=this.texture.frame.height;}destroy(e=false){(typeof e=="boolean"?e:!!e?.removeView)&&this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas);}};GS.extension={type:[x.WebGLSystem,x.WebGPUSystem,x.CanvasSystem],name:"view",priority:0};GS.defaultOptions={width:800,height:600,autoDensity:false,antialias:false};cx=GS;});var ul,ll,hx=f(()=>{iS();sS();uS();lS();Qg();hS();xS();_S();bS();vS();TS();CS();PS();wS();BS();MS();kS();FS();US();ul=[tx,ia,vn,cx,$o,ax,ra,rx,Zo,ox,sa],ll=[ta,sd,qo,Yo,Qo,ea,Jo,Wo];});var oa,LS=f(()=>{B();oa=class{constructor(e){this._hash=Object.create(null),this._renderer=e,this._renderer.renderableGC.addManagedHash(this,"_hash");}contextChange(e){this._gpu=e;}getBindGroup(e,t,i){return e._updateKey(),this._hash[e._key]||this._createBindGroup(e,t,i)}_createBindGroup(e,t,i){let s=this._gpu.device,n=t.layout[i],o=[],a=this._renderer;for(let c in n){let h=e.resources[c]??e.resources[n[c]],d;if(h._resourceType==="uniformGroup"){let p=h;a.ubo.updateUniformGroup(p);let m=p.buffer;d={buffer:a.buffer.getGPUBuffer(m),offset:0,size:m.descriptor.size};}else if(h._resourceType==="buffer"){let p=h;d={buffer:a.buffer.getGPUBuffer(p),offset:0,size:p.descriptor.size};}else if(h._resourceType==="bufferResource"){let p=h;d={buffer:a.buffer.getGPUBuffer(p.buffer),offset:p.offset,size:p.size};}else if(h._resourceType==="textureSampler"){let p=h;d=a.texture.getGpuSampler(p);}else if(h._resourceType==="textureSource"){let p=h;d=a.texture.getGpuSource(p).createView({});}o.push({binding:n[c],resource:d});}let u=a.shader.getProgramData(t).bindGroups[i],l=s.createBindGroup({layout:u,entries:o});return this._hash[e._key]=l,l}destroy(){for(let e of Object.keys(this._hash))this._hash[e]=null;this._hash=null,this._renderer=null;}};oa.extension={type:[x.WebGPUSystem],name:"bindGroup"};});var aa,NS=f(()=>{B();Gp();aa=class{constructor(e){this._gpuBuffers=Object.create(null),this._managedBuffers=[],e.renderableGC.addManagedHash(this,"_gpuBuffers");}contextChange(e){this._gpu=e;}getGPUBuffer(e){return this._gpuBuffers[e.uid]||this.createGPUBuffer(e)}updateBuffer(e){let t=this._gpuBuffers[e.uid]||this.createGPUBuffer(e),i=e.data;return e._updateID&&i&&(e._updateID=0,this._gpu.device.queue.writeBuffer(t,0,i.buffer,0,(e._updateSize||i.byteLength)+3&-4)),t}destroyAll(){for(let e in this._gpuBuffers)this._gpuBuffers[e].destroy();this._gpuBuffers={};}createGPUBuffer(e){this._gpuBuffers[e.uid]||(e.on("update",this.updateBuffer,this),e.on("change",this.onBufferChange,this),e.on("destroy",this.onBufferDestroy,this),this._managedBuffers.push(e));let t=this._gpu.device.createBuffer(e.descriptor);return e._updateID=0,e.data&&(po(e.data.buffer,t.getMappedRange()),t.unmap()),this._gpuBuffers[e.uid]=t,t}onBufferChange(e){this._gpuBuffers[e.uid].destroy(),e._updateID=0,this._gpuBuffers[e.uid]=this.createGPUBuffer(e);}onBufferDestroy(e){this._managedBuffers.splice(this._managedBuffers.indexOf(e),1),this._destroyBuffer(e);}destroy(){this._managedBuffers.forEach(e=>this._destroyBuffer(e)),this._managedBuffers=null,this._gpuBuffers=null;}_destroyBuffer(e){this._gpuBuffers[e.uid].destroy(),e.off("update",this.updateBuffer,this),e.off("change",this.onBufferChange,this),e.off("destroy",this.onBufferDestroy,this),this._gpuBuffers[e.uid]=null;}};aa.extension={type:[x.WebGPUSystem],name:"buffer"};});var ua,HS=f(()=>{B();ua=class{constructor(e){this._colorMaskCache=15,this._renderer=e;}setMask(e){this._colorMaskCache!==e&&(this._colorMaskCache=e,this._renderer.pipeline.setColorMask(e));}destroy(){this._renderer=null,this._colorMaskCache=null;}};ua.extension={type:[x.WebGPUSystem],name:"colorMask"};});var Tn,VS=f(()=>{Fe();B();Tn=class{constructor(e){this._renderer=e;}async init(e){return this._initPromise?this._initPromise:(this._initPromise=this._createDeviceAndAdaptor(e).then(t=>{this.gpu=t,this._renderer.runners.contextChange.emit(this.gpu);}),this._initPromise)}contextChange(e){this._renderer.gpu=e;}async _createDeviceAndAdaptor(e){let t=await j.get().getNavigator().gpu.requestAdapter({powerPreference:e.powerPreference,forceFallbackAdapter:e.forceFallbackAdapter}),i=["texture-compression-bc","texture-compression-astc","texture-compression-etc2"].filter(n=>t.features.has(n)),s=await t.requestDevice({requiredFeatures:i});return {adapter:t,device:s}}destroy(){this.gpu=null,this._renderer=null;}};Tn.extension={type:[x.WebGPUSystem],name:"device"};Tn.defaultOptions={powerPreference:void 0,forceFallbackAdapter:false};});var la,zS=f(()=>{B();la=class{constructor(e){this._boundBindGroup=Object.create(null),this._boundVertexBuffer=Object.create(null),this._renderer=e;}renderStart(){this.commandFinished=new Promise(e=>{this._resolveCommandFinished=e;}),this.commandEncoder=this._renderer.gpu.device.createCommandEncoder();}beginRenderPass(e){this.endRenderPass(),this._clearCache(),this.renderPassEncoder=this.commandEncoder.beginRenderPass(e.descriptor);}endRenderPass(){this.renderPassEncoder&&this.renderPassEncoder.end(),this.renderPassEncoder=null;}setViewport(e){this.renderPassEncoder.setViewport(e.x,e.y,e.width,e.height,0,1);}setPipelineFromGeometryProgramAndState(e,t,i,s){let n=this._renderer.pipeline.getPipeline(e,t,i,s);this.setPipeline(n);}setPipeline(e){this._boundPipeline!==e&&(this._boundPipeline=e,this.renderPassEncoder.setPipeline(e));}_setVertexBuffer(e,t){this._boundVertexBuffer[e]!==t&&(this._boundVertexBuffer[e]=t,this.renderPassEncoder.setVertexBuffer(e,this._renderer.buffer.updateBuffer(t)));}_setIndexBuffer(e){if(this._boundIndexBuffer===e)return;this._boundIndexBuffer=e;let t=e.data.BYTES_PER_ELEMENT===2?"uint16":"uint32";this.renderPassEncoder.setIndexBuffer(this._renderer.buffer.updateBuffer(e),t);}resetBindGroup(e){this._boundBindGroup[e]=null;}setBindGroup(e,t,i){if(this._boundBindGroup[e]===t)return;this._boundBindGroup[e]=t,t._touch(this._renderer.textureGC.count);let s=this._renderer.bindGroup.getBindGroup(t,i,e);this.renderPassEncoder.setBindGroup(e,s);}setGeometry(e,t){let i=this._renderer.pipeline.getBufferNamesToBind(e,t);for(let s in i)this._setVertexBuffer(s,e.attributes[i[s]].buffer);e.indexBuffer&&this._setIndexBuffer(e.indexBuffer);}_setShaderBindGroups(e,t){for(let i in e.groups){let s=e.groups[i];t||this._syncBindGroup(s),this.setBindGroup(i,s,e.gpuProgram);}}_syncBindGroup(e){for(let t in e.resources){let i=e.resources[t];i.isUniformGroup&&this._renderer.ubo.updateUniformGroup(i);}}draw(e){let{geometry:t,shader:i,state:s,topology:n,size:o,start:a,instanceCount:u,skipSync:l}=e;this.setPipelineFromGeometryProgramAndState(t,i.gpuProgram,s,n),this.setGeometry(t,i.gpuProgram),this._setShaderBindGroups(i,l),t.indexBuffer?this.renderPassEncoder.drawIndexed(o||t.indexBuffer.data.length,u??t.instanceCount,a||0):this.renderPassEncoder.draw(o||t.getSize(),u??t.instanceCount,a||0);}finishRenderPass(){this.renderPassEncoder&&(this.renderPassEncoder.end(),this.renderPassEncoder=null);}postrender(){this.finishRenderPass(),this._gpu.device.queue.submit([this.commandEncoder.finish()]),this._resolveCommandFinished(),this.commandEncoder=null;}restoreRenderPass(){let e=this._renderer.renderTarget.adaptor.getDescriptor(this._renderer.renderTarget.renderTarget,false,[0,0,0,1]);this.renderPassEncoder=this.commandEncoder.beginRenderPass(e);let t=this._boundPipeline,i={...this._boundVertexBuffer},s=this._boundIndexBuffer,n={...this._boundBindGroup};this._clearCache();let o=this._renderer.renderTarget.viewport;this.renderPassEncoder.setViewport(o.x,o.y,o.width,o.height,0,1),this.setPipeline(t);for(let a in i)this._setVertexBuffer(a,i[a]);for(let a in n)this.setBindGroup(a,n[a],null);this._setIndexBuffer(s);}_clearCache(){for(let e=0;e<16;e++)this._boundBindGroup[e]=null,this._boundVertexBuffer[e]=null;this._boundIndexBuffer=null,this._boundPipeline=null;}destroy(){this._renderer=null,this._gpu=null,this._boundBindGroup=null,this._boundVertexBuffer=null,this._boundIndexBuffer=null,this._boundPipeline=null;}contextChange(e){this._gpu=e;}};la.extension={type:[x.WebGPUSystem],name:"encoder",priority:1};});var ca,WS=f(()=>{B();ca=class{constructor(e){this._renderer=e;}contextChange(){this.maxTextures=this._renderer.device.gpu.device.limits.maxSampledTexturesPerShaderStage,this.maxBatchableTextures=this.maxTextures;}destroy(){}};ca.extension={type:[x.WebGPUSystem],name:"limits"};});var ha,XS=f(()=>{B();Xs();ha=class{constructor(e){this._renderTargetStencilState=Object.create(null),this._renderer=e,e.renderTarget.onRenderTargetChange.add(this);}onRenderTargetChange(e){let t=this._renderTargetStencilState[e.uid];t||(t=this._renderTargetStencilState[e.uid]={stencilMode:He.DISABLED,stencilReference:0}),this._activeRenderTarget=e,this.setStencilMode(t.stencilMode,t.stencilReference);}setStencilMode(e,t){let i=this._renderTargetStencilState[this._activeRenderTarget.uid];i.stencilMode=e,i.stencilReference=t;let s=this._renderer;s.pipeline.setStencilMode(e),s.encoder.renderPassEncoder.setStencilReference(t);}destroy(){this._renderer.renderTarget.onRenderTargetChange.remove(this),this._renderer=null,this._activeRenderTarget=null,this._renderTargetStencilState=null;}};ha.extension={type:[x.WebGPUSystem],name:"stencil"};});var Sn,dx=f(()=>{Lg();os();Pi();Sn=class{constructor(e){this._syncFunctionHash=Object.create(null),this._adaptor=e,this._systemCheck();}_systemCheck(){if(!el())throw new Error("Current environment does not allow unsafe-eval, please use pixi.js/unsafe-eval module to enable support.")}ensureUniformGroup(e){let t=this.getUniformGroupData(e);e.buffer||(e.buffer=new tt({data:new Float32Array(t.layout.size/4),usage:he.UNIFORM|he.COPY_DST}));}getUniformGroupData(e){return this._syncFunctionHash[e._signature]||this._initUniformGroup(e)}_initUniformGroup(e){let t=e._signature,i=this._syncFunctionHash[t];if(!i){let s=Object.keys(e.uniformStructures).map(a=>e.uniformStructures[a]),n=this._adaptor.createUboElements(s),o=this._generateUboSync(n.uboElements);i=this._syncFunctionHash[t]={layout:n,syncFunction:o};}return this._syncFunctionHash[t]}_generateUboSync(e){return this._adaptor.generateUboSync(e)}syncUniformGroup(e,t,i){let s=this.getUniformGroupData(e);e.buffer||(e.buffer=new tt({data:new Float32Array(s.layout.size/4),usage:he.UNIFORM|he.COPY_DST}));let n=null;return t||(t=e.buffer.data,n=e.buffer.dataInt32),i||(i=0),s.syncFunction(e.uniforms,t,n,i),true}updateUniformGroup(e){if(e.isStatic&&!e._dirtyId)return false;e._dirtyId=0;let t=this.syncUniformGroup(e);return e.buffer.update(),t}destroy(){this._syncFunctionHash=null;}};});function fx(r){let e=r.map(i=>({data:i,offset:0,size:0})),t=0;for(let i=0;i<e.length;i++){let s=e[i],n=da[s.data.type].size,o=da[s.data.type].align;if(!da[s.data.type])throw new Error(`[Pixi.js] WebGPU UniformBuffer: Unknown type ${s.data.type}`);s.data.size>1&&(n=Math.max(n,o)*s.data.size),t=Math.ceil(t/o)*o,s.size=n,s.offset=t,t+=n;}return t=Math.ceil(t/16)*16,{uboElements:e,size:t}}var da,px=f(()=>{da={i32:{align:4,size:4},u32:{align:4,size:4},f32:{align:4,size:4},f16:{align:2,size:2},"vec2<i32>":{align:8,size:8},"vec2<u32>":{align:8,size:8},"vec2<f32>":{align:8,size:8},"vec2<f16>":{align:4,size:4},"vec3<i32>":{align:16,size:12},"vec3<u32>":{align:16,size:12},"vec3<f32>":{align:16,size:12},"vec3<f16>":{align:8,size:6},"vec4<i32>":{align:16,size:16},"vec4<u32>":{align:16,size:16},"vec4<f32>":{align:16,size:16},"vec4<f16>":{align:8,size:8},"mat2x2<f32>":{align:8,size:16},"mat2x2<f16>":{align:4,size:8},"mat3x2<f32>":{align:8,size:24},"mat3x2<f16>":{align:4,size:12},"mat4x2<f32>":{align:8,size:32},"mat4x2<f16>":{align:4,size:16},"mat2x3<f32>":{align:16,size:32},"mat2x3<f16>":{align:8,size:16},"mat3x3<f32>":{align:16,size:48},"mat3x3<f16>":{align:8,size:24},"mat4x3<f32>":{align:16,size:64},"mat4x3<f16>":{align:8,size:32},"mat2x4<f32>":{align:16,size:32},"mat2x4<f16>":{align:8,size:16},"mat3x4<f32>":{align:16,size:48},"mat3x4<f16>":{align:8,size:24},"mat4x4<f32>":{align:16,size:64},"mat4x4<f16>":{align:8,size:32}};});var hi,mx=f(()=>{hi=[{type:"mat3x3<f32>",test:r=>r.value.a!==void 0,ubo:`
1718
1718
  var matrix = uv[name].toArray(true);
1719
1719
  data[offset] = matrix[0];
1720
1720
  data[offset + 1] = matrix[1];
@@ -1858,7 +1858,7 @@ fn mainFragment(
1858
1858
  }
1859
1859
  ${s!==0?`arrayOffset += ${s};`:""}
1860
1860
  }
1861
- `}var YS=f(()=>{px();});function yx(r){return cl(r,"uboWgsl",bx,xx)}var jS=f(()=>{gx();_x();YS();});var fa,$S=f(()=>{B();dx();px();jS();fa=class extends Sn{constructor(){super({createUboElements:fx,generateUboSync:yx});}};fa.extension={type:[x.WebGPUSystem],name:"ubo"};});var Fi,ud=f(()=>{Ut();Et();Fi=class extends _e{constructor({buffer:e,offset:t,size:i}){super(),this.uid=ce("buffer"),this._resourceType="bufferResource",this._touched=0,this._resourceId=ce("resource"),this._bufferResource=true,this.destroyed=false,this.buffer=e,this.offset=t|0,this.size=i,this.buffer.on("change",this.onBufferChange,this);}onBufferChange(){this._resourceId=ce("resource"),this.emit("change",this);}destroy(e=false){this.destroyed=true,e&&this.buffer.destroy(),this.emit("change",this),this.buffer=null;}};});var dl,qS=f(()=>{dl=class{constructor({minUniformOffsetAlignment:e}){this._minUniformOffsetAlignment=256,this.byteIndex=0,this._minUniformOffsetAlignment=e,this.data=new Float32Array(65535);}clear(){this.byteIndex=0;}addEmptyGroup(e){if(e>this._minUniformOffsetAlignment/4)throw new Error(`UniformBufferBatch: array is too large: ${e*4}`);let t=this.byteIndex,i=t+e*4;if(i=Math.ceil(i/this._minUniformOffsetAlignment)*this._minUniformOffsetAlignment,i>this.data.length*4)throw new Error("UniformBufferBatch: ubo batch got too big");return this.byteIndex=i,t}addGroup(e){let t=this.addEmptyGroup(e.length);for(let i=0;i<e.length;i++)this.data[t/4+i]=e[i];return t}destroy(){this.data=null;}};});var En,pa,KS=f(()=>{B();os();ud();Pi();qS();ns();En=128,pa=class{constructor(e){this._bindGroupHash=Object.create(null),this._buffers=[],this._bindGroups=[],this._bufferResources=[],this._renderer=e,this._renderer.renderableGC.addManagedHash(this,"_bindGroupHash"),this._batchBuffer=new dl({minUniformOffsetAlignment:En});let t=256/En;for(let i=0;i<t;i++){let s=he.UNIFORM|he.COPY_DST;i===0&&(s|=he.COPY_SRC),this._buffers.push(new tt({data:this._batchBuffer.data,usage:s}));}}renderEnd(){this._uploadBindGroups(),this._resetBindGroups();}_resetBindGroups(){for(let e in this._bindGroupHash)this._bindGroupHash[e]=null;this._batchBuffer.clear();}getUniformBindGroup(e,t){if(!t&&this._bindGroupHash[e.uid])return this._bindGroupHash[e.uid];this._renderer.ubo.ensureUniformGroup(e);let i=e.buffer.data,s=this._batchBuffer.addEmptyGroup(i.length);return this._renderer.ubo.syncUniformGroup(e,this._batchBuffer.data,s/4),this._bindGroupHash[e.uid]=this._getBindGroup(s/En),this._bindGroupHash[e.uid]}getUboResource(e){this._renderer.ubo.updateUniformGroup(e);let t=e.buffer.data,i=this._batchBuffer.addGroup(t);return this._getBufferResource(i/En)}getArrayBindGroup(e){let t=this._batchBuffer.addGroup(e);return this._getBindGroup(t/En)}getArrayBufferResource(e){let i=this._batchBuffer.addGroup(e)/En;return this._getBufferResource(i)}_getBufferResource(e){if(!this._bufferResources[e]){let t=this._buffers[e%2];this._bufferResources[e]=new Fi({buffer:t,offset:(e/2|0)*256,size:En});}return this._bufferResources[e]}_getBindGroup(e){if(!this._bindGroups[e]){let t=new _t({0:this._getBufferResource(e)});this._bindGroups[e]=t;}return this._bindGroups[e]}_uploadBindGroups(){let e=this._renderer.buffer,t=this._buffers[0];t.update(this._batchBuffer.byteIndex),e.updateBuffer(t);let i=this._renderer.gpu.device.createCommandEncoder();for(let s=1;s<this._buffers.length;s++){let n=this._buffers[s];i.copyBufferToBuffer(e.getGPUBuffer(t),En,e.getGPUBuffer(n),0,this._batchBuffer.byteIndex);}this._renderer.gpu.device.queue.submit([i.finish()]);}destroy(){for(let e=0;e<this._bindGroups.length;e++)this._bindGroups[e].destroy();this._bindGroups=null,this._bindGroupHash=null;for(let e=0;e<this._buffers.length;e++)this._buffers[e].destroy();this._buffers=null;for(let e=0;e<this._bufferResources.length;e++)this._bufferResources[e].destroy();this._bufferResources=null,this._batchBuffer.destroy(),this._bindGroupHash=null,this._renderer=null;}};pa.extension={type:[x.WebGPUPipes],name:"uniformBatch"};});function fl(r,e){for(let t in r.attributes){let i=r.attributes[t],s=e[t];s?(i.format??(i.format=s.format),i.offset??(i.offset=s.offset),i.instance??(i.instance=s.instance)):N(`Attribute ${t} is not present in the shader, but is present in the geometry. Unable to infer attribute details.`);}jk(r);}function jk(r){let{buffers:e,attributes:t}=r,i={},s={};for(let n in e){let o=e[n];i[o.uid]=0,s[o.uid]=0;}for(let n in t){let o=t[n];i[o.buffer.uid]+=$t(o.format).stride;}for(let n in t){let o=t[n];o.stride??(o.stride=i[o.buffer.uid]),o.start??(o.start=s[o.buffer.uid]),s[o.buffer.uid]+=$t(o.format).stride;}}var vx=f(()=>{Be();js();});var jr,Tx=f(()=>{Xs();jr=[];jr[He.NONE]=void 0;jr[He.DISABLED]={stencilWriteMask:0,stencilReadMask:0};jr[He.RENDERING_MASK_ADD]={stencilFront:{compare:"equal",passOp:"increment-clamp"},stencilBack:{compare:"equal",passOp:"increment-clamp"}};jr[He.RENDERING_MASK_REMOVE]={stencilFront:{compare:"equal",passOp:"decrement-clamp"},stencilBack:{compare:"equal",passOp:"decrement-clamp"}};jr[He.MASK_ACTIVE]={stencilWriteMask:0,stencilFront:{compare:"equal",passOp:"keep"},stencilBack:{compare:"equal",passOp:"keep"}};jr[He.INVERSE_MASK_ACTIVE]={stencilWriteMask:0,stencilFront:{compare:"not-equal",passOp:"keep"},stencilBack:{compare:"not-equal",passOp:"keep"}};});function qk(r,e,t,i,s){return r<<24|e<<16|t<<10|i<<5|s}function Kk(r,e,t,i){return t<<6|r<<3|i<<1|e}var $k,ma,ZS=f(()=>{B();Be();vx();Xs();Su();Tx();$k={"point-list":0,"line-list":1,"line-strip":2,"triangle-list":3,"triangle-strip":4};ma=class{constructor(e){this._moduleCache=Object.create(null),this._bufferLayoutsCache=Object.create(null),this._bindingNamesCache=Object.create(null),this._pipeCache=Object.create(null),this._pipeStateCaches=Object.create(null),this._colorMask=15,this._multisampleCount=1,this._renderer=e;}contextChange(e){this._gpu=e,this.setStencilMode(He.DISABLED),this._updatePipeHash();}setMultisampleCount(e){this._multisampleCount!==e&&(this._multisampleCount=e,this._updatePipeHash());}setRenderTarget(e){this._multisampleCount=e.msaaSamples,this._depthStencilAttachment=e.descriptor.depthStencilAttachment?1:0,this._updatePipeHash();}setColorMask(e){this._colorMask!==e&&(this._colorMask=e,this._updatePipeHash());}setStencilMode(e){this._stencilMode!==e&&(this._stencilMode=e,this._stencilState=jr[e],this._updatePipeHash());}setPipeline(e,t,i,s){let n=this.getPipeline(e,t,i);s.setPipeline(n);}getPipeline(e,t,i,s){e._layoutKey||(fl(e,t.attributeData),this._generateBufferKey(e)),s||(s=e.topology);let n=qk(e._layoutKey,t._layoutKey,i.data,i._blendModeId,$k[s]);return this._pipeCache[n]?this._pipeCache[n]:(this._pipeCache[n]=this._createPipeline(e,t,i,s),this._pipeCache[n])}_createPipeline(e,t,i,s){let n=this._gpu.device,o=this._createVertexBufferLayouts(e,t),a=this._renderer.state.getColorTargets(i);a[0].writeMask=this._stencilMode===He.RENDERING_MASK_ADD?0:this._colorMask;let u=this._renderer.shader.getProgramData(t).pipeline,l={vertex:{module:this._getModule(t.vertex.source),entryPoint:t.vertex.entryPoint,buffers:o},fragment:{module:this._getModule(t.fragment.source),entryPoint:t.fragment.entryPoint,targets:a},primitive:{topology:s,cullMode:i.cullMode},layout:u,multisample:{count:this._multisampleCount},label:"PIXI Pipeline"};return this._depthStencilAttachment&&(l.depthStencil={...this._stencilState,format:"depth24plus-stencil8",depthWriteEnabled:i.depthTest,depthCompare:i.depthTest?"less":"always"}),n.createRenderPipeline(l)}_getModule(e){return this._moduleCache[e]||this._createModule(e)}_createModule(e){let t=this._gpu.device;return this._moduleCache[e]=t.createShaderModule({code:e}),this._moduleCache[e]}_generateBufferKey(e){let t=[],i=0,s=Object.keys(e.attributes).sort();for(let o=0;o<s.length;o++){let a=e.attributes[s[o]];t[i++]=a.offset,t[i++]=a.format,t[i++]=a.stride,t[i++]=a.instance;}let n=t.join("|");return e._layoutKey=ai(n,"geometry"),e._layoutKey}_generateAttributeLocationsKey(e){let t=[],i=0,s=Object.keys(e.attributeData).sort();for(let o=0;o<s.length;o++){let a=e.attributeData[s[o]];t[i++]=a.location;}let n=t.join("|");return e._attributeLocationsKey=ai(n,"programAttributes"),e._attributeLocationsKey}getBufferNamesToBind(e,t){let i=e._layoutKey<<16|t._attributeLocationsKey;if(this._bindingNamesCache[i])return this._bindingNamesCache[i];let s=this._createVertexBufferLayouts(e,t),n=Object.create(null),o=t.attributeData;for(let a=0;a<s.length;a++){let l=Object.values(s[a].attributes)[0].shaderLocation;for(let c in o)if(o[c].location===l){n[a]=c;break}}return this._bindingNamesCache[i]=n,n}_createVertexBufferLayouts(e,t){t._attributeLocationsKey||this._generateAttributeLocationsKey(t);let i=e._layoutKey<<16|t._attributeLocationsKey;if(this._bufferLayoutsCache[i])return this._bufferLayoutsCache[i];let s=[];return e.buffers.forEach(n=>{let o={arrayStride:0,stepMode:"vertex",attributes:[]},a=o.attributes;for(let u in t.attributeData){let l=e.attributes[u];(l.divisor??1)!==1&&N(`Attribute ${u} has an invalid divisor value of '${l.divisor}'. WebGPU only supports a divisor value of 1`),l.buffer===n&&(o.arrayStride=l.stride,o.stepMode=l.instance?"instance":"vertex",a.push({shaderLocation:t.attributeData[u].location,offset:l.offset,format:l.format}));}a.length&&s.push(o);}),this._bufferLayoutsCache[i]=s,s}_updatePipeHash(){let e=Kk(this._stencilMode,this._multisampleCount,this._colorMask,this._depthStencilAttachment);this._pipeStateCaches[e]||(this._pipeStateCaches[e]=Object.create(null)),this._pipeCache=this._pipeStateCaches[e];}destroy(){this._renderer=null,this._bufferLayoutsCache=null;}};ma.extension={type:[x.WebGPUSystem],name:"pipeline"};});function Sx(r,e,t,i,s,n){let o=n?1:-1;return r.identity(),r.a=1/i*2,r.d=o*(1/s*2),r.tx=-1-e*r.a,r.ty=-o-t*r.d,r}var QS=f(()=>{});function Ex(r){let e=r.colorTexture.source.resource;return globalThis.HTMLCanvasElement&&e instanceof HTMLCanvasElement&&document.body.contains(e)}var JS=f(()=>{});var Cn,Cx=f(()=>{Te();ct();No();QS();Ng();ho();Ct();ye();lx();JS();ux();Cn=class{constructor(e){this.rootViewPort=new exports.Rectangle,this.viewport=new exports.Rectangle,this.onRenderTargetChange=new bn("onRenderTargetChange"),this.projectionMatrix=new G,this.defaultClearColor=[0,0,0,0],this._renderSurfaceToRenderTargetHash=new Map,this._gpuRenderTargetHash=Object.create(null),this._renderTargetStack=[],this._renderer=e,e.renderableGC.addManagedHash(this,"_gpuRenderTargetHash");}finishRenderPass(){this.adaptor.finishRenderPass(this.renderTarget);}renderStart({target:e,clear:t,clearColor:i,frame:s}){this._renderTargetStack.length=0,this.push(e,t,i,s),this.rootViewPort.copyFrom(this.viewport),this.rootRenderTarget=this.renderTarget,this.renderingToScreen=Ex(this.rootRenderTarget),this.adaptor.prerender?.(this.rootRenderTarget);}postrender(){this.adaptor.postrender?.(this.rootRenderTarget);}bind(e,t=true,i,s){let n=this.getRenderTarget(e),o=this.renderTarget!==n;this.renderTarget=n,this.renderSurface=e;let a=this.getGpuRenderTarget(n);(n.pixelWidth!==a.width||n.pixelHeight!==a.height)&&(this.adaptor.resizeGpuRenderTarget(n),a.width=n.pixelWidth,a.height=n.pixelHeight);let u=n.colorTexture,l=this.viewport,c=u.pixelWidth,h=u.pixelHeight;if(!s&&e instanceof exports.Texture&&(s=e.frame),s){let d=u._resolution;l.x=s.x*d+.5|0,l.y=s.y*d+.5|0,l.width=s.width*d+.5|0,l.height=s.height*d+.5|0;}else l.x=0,l.y=0,l.width=c,l.height=h;return Sx(this.projectionMatrix,0,0,l.width/u.resolution,l.height/u.resolution,!n.isRoot),this.adaptor.startRenderPass(n,t,i,l),o&&this.onRenderTargetChange.emit(n),n}clear(e,t=bt.ALL,i){t&&(e&&(e=this.getRenderTarget(e)),this.adaptor.clear(e||this.renderTarget,t,i,this.viewport));}contextChange(){this._gpuRenderTargetHash=Object.create(null);}push(e,t=bt.ALL,i,s){let n=this.bind(e,t,i,s);return this._renderTargetStack.push({renderTarget:n,frame:s}),n}pop(){this._renderTargetStack.pop();let e=this._renderTargetStack[this._renderTargetStack.length-1];this.bind(e.renderTarget,false,null,e.frame);}getRenderTarget(e){return e.isTexture&&(e=e.source),this._renderSurfaceToRenderTargetHash.get(e)??this._initRenderTarget(e)}copyToTexture(e,t,i,s,n){i.x<0&&(s.width+=i.x,n.x-=i.x,i.x=0),i.y<0&&(s.height+=i.y,n.y-=i.y,i.y=0);let{pixelWidth:o,pixelHeight:a}=e;return s.width=Math.min(s.width,o-i.x),s.height=Math.min(s.height,a-i.y),this.adaptor.copyToTexture(e,t,i,s,n)}ensureDepthStencil(){this.renderTarget.stencil||(this.renderTarget.stencil=true,this.adaptor.startRenderPass(this.renderTarget,false,null,this.viewport));}destroy(){this._renderer=null,this._renderSurfaceToRenderTargetHash.forEach((e,t)=>{e!==t&&e.destroy();}),this._renderSurfaceToRenderTargetHash.clear(),this._gpuRenderTargetHash=Object.create(null);}_initRenderTarget(e){let t=null;return At.test(e)&&(e=al(e).source),e instanceof na?t=e:e instanceof ge&&(t=new na({colorTextures:[e]}),e.source instanceof At&&(t.isRoot=true),e.once("destroy",()=>{t.destroy(),this._renderSurfaceToRenderTargetHash.delete(e);let i=this._gpuRenderTargetHash[t.uid];i&&(this._gpuRenderTargetHash[t.uid]=null,this.adaptor.destroyGpuRenderTarget(i));})),this._renderSurfaceToRenderTargetHash.set(e,t),t}getGpuRenderTarget(e){return this._gpuRenderTargetHash[e.uid]||(this._gpuRenderTargetHash[e.uid]=this.adaptor.initGpuRenderTarget(e))}resetState(){this.renderTarget=null,this.renderSurface=null;}};});var pl,e2=f(()=>{pl=class{constructor(){this.contexts=[],this.msaaTextures=[],this.msaaSamples=1;}};});var ml,t2=f(()=>{No();ho();Ct();e2();ml=class{init(e,t){this._renderer=e,this._renderTargetSystem=t;}copyToTexture(e,t,i,s,n){let o=this._renderer,a=this._getGpuColorTexture(e),u=o.texture.getGpuSource(t.source);return o.encoder.commandEncoder.copyTextureToTexture({texture:a,origin:i},{texture:u,origin:n},s),t}startRenderPass(e,t=true,i,s){let o=this._renderTargetSystem.getGpuRenderTarget(e),a=this.getDescriptor(e,t,i);o.descriptor=a,this._renderer.pipeline.setRenderTarget(o),this._renderer.encoder.beginRenderPass(o),this._renderer.encoder.setViewport(s);}finishRenderPass(){this._renderer.encoder.endRenderPass();}_getGpuColorTexture(e){let t=this._renderTargetSystem.getGpuRenderTarget(e);return t.contexts[0]?t.contexts[0].getCurrentTexture():this._renderer.texture.getGpuSource(e.colorTextures[0].source)}getDescriptor(e,t,i){typeof t=="boolean"&&(t=t?bt.ALL:bt.NONE);let s=this._renderTargetSystem,n=s.getGpuRenderTarget(e),o=e.colorTextures.map((l,c)=>{let h=n.contexts[c],d,p;h?d=h.getCurrentTexture().createView():d=this._renderer.texture.getGpuSource(l).createView({mipLevelCount:1}),n.msaaTextures[c]&&(p=d,d=this._renderer.texture.getTextureView(n.msaaTextures[c]));let m=t&bt.COLOR?"clear":"load";return i??(i=s.defaultClearColor),{view:d,resolveTarget:p,clearValue:i,storeOp:"store",loadOp:m}}),a;if((e.stencil||e.depth)&&!e.depthStencilTexture&&(e.ensureDepthStencilTexture(),e.depthStencilTexture.source.sampleCount=n.msaa?4:1),e.depthStencilTexture){let l=t&bt.STENCIL?"clear":"load",c=t&bt.DEPTH?"clear":"load";a={view:this._renderer.texture.getGpuSource(e.depthStencilTexture.source).createView(),stencilStoreOp:"store",stencilLoadOp:l,depthClearValue:1,depthLoadOp:c,depthStoreOp:"store"};}return {colorAttachments:o,depthStencilAttachment:a}}clear(e,t=true,i,s){if(!t)return;let{gpu:n,encoder:o}=this._renderer,a=n.device;if(o.commandEncoder===null){let l=a.createCommandEncoder(),c=this.getDescriptor(e,t,i),h=l.beginRenderPass(c);h.setViewport(s.x,s.y,s.width,s.height,0,1),h.end();let d=l.finish();a.queue.submit([d]);}else this.startRenderPass(e,t,i,s);}initGpuRenderTarget(e){e.isRoot=true;let t=new pl;return e.colorTextures.forEach((i,s)=>{if(i instanceof At){let n=i.resource.getContext("webgpu"),o=i.transparent?"premultiplied":"opaque";try{n.configure({device:this._renderer.gpu.device,usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.COPY_SRC,format:"bgra8unorm",alphaMode:o});}catch(a){console.error(a);}t.contexts[s]=n;}if(t.msaa=i.source.antialias,i.source.antialias){let n=new ge({width:0,height:0,sampleCount:4});t.msaaTextures[s]=n;}}),t.msaa&&(t.msaaSamples=4,e.depthStencilTexture&&(e.depthStencilTexture.source.sampleCount=4)),t}destroyGpuRenderTarget(e){e.contexts.forEach(t=>{t.unconfigure();}),e.msaaTextures.forEach(t=>{t.destroy();}),e.msaaTextures.length=0,e.contexts.length=0;}ensureDepthStencilTexture(e){let t=this._renderTargetSystem.getGpuRenderTarget(e);e.depthStencilTexture&&t.msaa&&(e.depthStencilTexture.source.sampleCount=4);}resizeGpuRenderTarget(e){let t=this._renderTargetSystem.getGpuRenderTarget(e);t.width=e.width,t.height=e.height,t.msaa&&e.colorTextures.forEach((i,s)=>{t.msaaTextures[s]?.resize(i.source.width,i.source.height,i.source._resolution);});}};});var ga,r2=f(()=>{B();Cx();t2();ga=class extends Cn{constructor(e){super(e),this.adaptor=new ml,this.adaptor.init(e,this);}};ga.extension={type:[x.WebGPUSystem],name:"renderTarget"};});var xa,i2=f(()=>{B();xa=class{constructor(){this._gpuProgramData=Object.create(null);}contextChange(e){this._gpu=e;}getProgramData(e){return this._gpuProgramData[e._layoutKey]||this._createGPUProgramData(e)}_createGPUProgramData(e){let t=this._gpu.device,i=e.gpuLayout.map(n=>t.createBindGroupLayout({entries:n})),s={bindGroupLayouts:i};return this._gpuProgramData[e._layoutKey]={bindGroups:i,pipeline:t.createPipelineLayout(s)},this._gpuProgramData[e._layoutKey]}destroy(){this._gpu=null,this._gpuProgramData=null;}};xa.extension={type:[x.WebGPUSystem],name:"shader"};});var zt,s2=f(()=>{zt={};zt.normal={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"}};zt.add={alpha:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one",operation:"add"}};zt.multiply={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"dst",dstFactor:"one-minus-src-alpha",operation:"add"}};zt.screen={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one-minus-src",operation:"add"}};zt.overlay={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one-minus-src",operation:"add"}};zt.none={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"zero",dstFactor:"zero",operation:"add"}};zt["normal-npm"]={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha",operation:"add"}};zt["add-npm"]={alpha:{srcFactor:"one",dstFactor:"one",operation:"add"},color:{srcFactor:"src-alpha",dstFactor:"one",operation:"add"}};zt["screen-npm"]={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"src-alpha",dstFactor:"one-minus-src",operation:"add"}};zt.erase={alpha:{srcFactor:"zero",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"zero",dstFactor:"one-minus-src",operation:"add"}};zt.min={alpha:{srcFactor:"one",dstFactor:"one",operation:"min"},color:{srcFactor:"one",dstFactor:"one",operation:"min"}};zt.max={alpha:{srcFactor:"one",dstFactor:"one",operation:"max"},color:{srcFactor:"one",dstFactor:"one",operation:"max"}};});var _a,n2=f(()=>{B();Pr();s2();_a=class{constructor(){this.defaultState=new Qe,this.defaultState.blend=true;}contextChange(e){this.gpu=e;}getColorTargets(e){return [{format:"bgra8unorm",writeMask:0,blend:zt[e.blendMode]||zt.normal}]}destroy(){this.gpu=null;}};_a.extension={type:[x.WebGPUSystem],name:"state"};});var Ax,o2=f(()=>{Ax={type:"image",upload(r,e,t){let i=r.resource,s=(r.pixelWidth|0)*(r.pixelHeight|0),n=i.byteLength/s;t.device.queue.writeTexture({texture:e},i,{offset:0,rowsPerImage:r.pixelHeight,bytesPerRow:r.pixelHeight*n},{width:r.pixelWidth,height:r.pixelHeight,depthOrArrayLayers:1});}};});var ld,Zk,Px,a2=f(()=>{ld={"bc1-rgba-unorm":{blockBytes:8,blockWidth:4,blockHeight:4},"bc2-rgba-unorm":{blockBytes:16,blockWidth:4,blockHeight:4},"bc3-rgba-unorm":{blockBytes:16,blockWidth:4,blockHeight:4},"bc7-rgba-unorm":{blockBytes:16,blockWidth:4,blockHeight:4},"etc1-rgb-unorm":{blockBytes:8,blockWidth:4,blockHeight:4},"etc2-rgba8unorm":{blockBytes:16,blockWidth:4,blockHeight:4},"astc-4x4-unorm":{blockBytes:16,blockWidth:4,blockHeight:4}},Zk={blockBytes:4,blockWidth:1,blockHeight:1},Px={type:"compressed",upload(r,e,t){let i=r.pixelWidth,s=r.pixelHeight,n=ld[r.format]||Zk;for(let o=0;o<r.resource.length;o++){let a=r.resource[o],u=Math.ceil(i/n.blockWidth)*n.blockBytes;t.device.queue.writeTexture({texture:e,mipLevel:o},a,{offset:0,bytesPerRow:u},{width:Math.ceil(i/n.blockWidth)*n.blockWidth,height:Math.ceil(s/n.blockHeight)*n.blockHeight,depthOrArrayLayers:1}),i=Math.max(i>>1,1),s=Math.max(s>>1,1);}}};});var gl,wx=f(()=>{Ge();Be();gl={type:"image",upload(r,e,t){let i=r.resource;if(!i)return;if(globalThis.HTMLImageElement&&i instanceof HTMLImageElement){let a=j.get().createCanvas(i.width,i.height);a.getContext("2d").drawImage(i,0,0,i.width,i.height),r.resource=a,N("ImageSource: Image element passed, converting to canvas and replacing resource.");}let s=Math.min(e.width,r.resourceWidth||r.pixelWidth),n=Math.min(e.height,r.resourceHeight||r.pixelHeight),o=r.alphaMode==="premultiply-alpha-on-upload";t.device.queue.copyExternalImageToTexture({source:i},{texture:e,premultipliedAlpha:o},{width:s,height:n});}};});var Bx,u2=f(()=>{wx();Bx={type:"video",upload(r,e,t){gl.upload(r,e,t);}};});var xl,l2=f(()=>{xl=class{constructor(e){this.device=e,this.sampler=e.createSampler({minFilter:"linear"}),this.pipelines={};}_getMipmapPipeline(e){let t=this.pipelines[e];return t||(this.mipmapShaderModule||(this.mipmapShaderModule=this.device.createShaderModule({code:`
1861
+ `}var YS=f(()=>{px();});function yx(r){return cl(r,"uboWgsl",bx,xx)}var jS=f(()=>{gx();_x();YS();});var fa,$S=f(()=>{B();dx();px();jS();fa=class extends Sn{constructor(){super({createUboElements:fx,generateUboSync:yx});}};fa.extension={type:[x.WebGPUSystem],name:"ubo"};});var Fi,ud=f(()=>{Ut();Et();Fi=class extends _e{constructor({buffer:e,offset:t,size:i}){super(),this.uid=ce("buffer"),this._resourceType="bufferResource",this._touched=0,this._resourceId=ce("resource"),this._bufferResource=true,this.destroyed=false,this.buffer=e,this.offset=t|0,this.size=i,this.buffer.on("change",this.onBufferChange,this);}onBufferChange(){this._resourceId=ce("resource"),this.emit("change",this);}destroy(e=false){this.destroyed=true,e&&this.buffer.destroy(),this.emit("change",this),this.buffer=null;}};});var dl,qS=f(()=>{dl=class{constructor({minUniformOffsetAlignment:e}){this._minUniformOffsetAlignment=256,this.byteIndex=0,this._minUniformOffsetAlignment=e,this.data=new Float32Array(65535);}clear(){this.byteIndex=0;}addEmptyGroup(e){if(e>this._minUniformOffsetAlignment/4)throw new Error(`UniformBufferBatch: array is too large: ${e*4}`);let t=this.byteIndex,i=t+e*4;if(i=Math.ceil(i/this._minUniformOffsetAlignment)*this._minUniformOffsetAlignment,i>this.data.length*4)throw new Error("UniformBufferBatch: ubo batch got too big");return this.byteIndex=i,t}addGroup(e){let t=this.addEmptyGroup(e.length);for(let i=0;i<e.length;i++)this.data[t/4+i]=e[i];return t}destroy(){this.data=null;}};});var En,pa,KS=f(()=>{B();os();ud();Pi();qS();ns();En=128,pa=class{constructor(e){this._bindGroupHash=Object.create(null),this._buffers=[],this._bindGroups=[],this._bufferResources=[],this._renderer=e,this._renderer.renderableGC.addManagedHash(this,"_bindGroupHash"),this._batchBuffer=new dl({minUniformOffsetAlignment:En});let t=256/En;for(let i=0;i<t;i++){let s=he.UNIFORM|he.COPY_DST;i===0&&(s|=he.COPY_SRC),this._buffers.push(new tt({data:this._batchBuffer.data,usage:s}));}}renderEnd(){this._uploadBindGroups(),this._resetBindGroups();}_resetBindGroups(){for(let e in this._bindGroupHash)this._bindGroupHash[e]=null;this._batchBuffer.clear();}getUniformBindGroup(e,t){if(!t&&this._bindGroupHash[e.uid])return this._bindGroupHash[e.uid];this._renderer.ubo.ensureUniformGroup(e);let i=e.buffer.data,s=this._batchBuffer.addEmptyGroup(i.length);return this._renderer.ubo.syncUniformGroup(e,this._batchBuffer.data,s/4),this._bindGroupHash[e.uid]=this._getBindGroup(s/En),this._bindGroupHash[e.uid]}getUboResource(e){this._renderer.ubo.updateUniformGroup(e);let t=e.buffer.data,i=this._batchBuffer.addGroup(t);return this._getBufferResource(i/En)}getArrayBindGroup(e){let t=this._batchBuffer.addGroup(e);return this._getBindGroup(t/En)}getArrayBufferResource(e){let i=this._batchBuffer.addGroup(e)/En;return this._getBufferResource(i)}_getBufferResource(e){if(!this._bufferResources[e]){let t=this._buffers[e%2];this._bufferResources[e]=new Fi({buffer:t,offset:(e/2|0)*256,size:En});}return this._bufferResources[e]}_getBindGroup(e){if(!this._bindGroups[e]){let t=new _t({0:this._getBufferResource(e)});this._bindGroups[e]=t;}return this._bindGroups[e]}_uploadBindGroups(){let e=this._renderer.buffer,t=this._buffers[0];t.update(this._batchBuffer.byteIndex),e.updateBuffer(t);let i=this._renderer.gpu.device.createCommandEncoder();for(let s=1;s<this._buffers.length;s++){let n=this._buffers[s];i.copyBufferToBuffer(e.getGPUBuffer(t),En,e.getGPUBuffer(n),0,this._batchBuffer.byteIndex);}this._renderer.gpu.device.queue.submit([i.finish()]);}destroy(){for(let e=0;e<this._bindGroups.length;e++)this._bindGroups[e].destroy();this._bindGroups=null,this._bindGroupHash=null;for(let e=0;e<this._buffers.length;e++)this._buffers[e].destroy();this._buffers=null;for(let e=0;e<this._bufferResources.length;e++)this._bufferResources[e].destroy();this._bufferResources=null,this._batchBuffer.destroy(),this._bindGroupHash=null,this._renderer=null;}};pa.extension={type:[x.WebGPUPipes],name:"uniformBatch"};});function fl(r,e){for(let t in r.attributes){let i=r.attributes[t],s=e[t];s?(i.format??(i.format=s.format),i.offset??(i.offset=s.offset),i.instance??(i.instance=s.instance)):N(`Attribute ${t} is not present in the shader, but is present in the geometry. Unable to infer attribute details.`);}jk(r);}function jk(r){let{buffers:e,attributes:t}=r,i={},s={};for(let n in e){let o=e[n];i[o.uid]=0,s[o.uid]=0;}for(let n in t){let o=t[n];i[o.buffer.uid]+=$t(o.format).stride;}for(let n in t){let o=t[n];o.stride??(o.stride=i[o.buffer.uid]),o.start??(o.start=s[o.buffer.uid]),s[o.buffer.uid]+=$t(o.format).stride;}}var vx=f(()=>{Be();js();});var Yr,Tx=f(()=>{Xs();Yr=[];Yr[He.NONE]=void 0;Yr[He.DISABLED]={stencilWriteMask:0,stencilReadMask:0};Yr[He.RENDERING_MASK_ADD]={stencilFront:{compare:"equal",passOp:"increment-clamp"},stencilBack:{compare:"equal",passOp:"increment-clamp"}};Yr[He.RENDERING_MASK_REMOVE]={stencilFront:{compare:"equal",passOp:"decrement-clamp"},stencilBack:{compare:"equal",passOp:"decrement-clamp"}};Yr[He.MASK_ACTIVE]={stencilWriteMask:0,stencilFront:{compare:"equal",passOp:"keep"},stencilBack:{compare:"equal",passOp:"keep"}};Yr[He.INVERSE_MASK_ACTIVE]={stencilWriteMask:0,stencilFront:{compare:"not-equal",passOp:"keep"},stencilBack:{compare:"not-equal",passOp:"keep"}};});function qk(r,e,t,i,s){return r<<24|e<<16|t<<10|i<<5|s}function Kk(r,e,t,i){return t<<6|r<<3|i<<1|e}var $k,ma,ZS=f(()=>{B();Be();vx();Xs();Su();Tx();$k={"point-list":0,"line-list":1,"line-strip":2,"triangle-list":3,"triangle-strip":4};ma=class{constructor(e){this._moduleCache=Object.create(null),this._bufferLayoutsCache=Object.create(null),this._bindingNamesCache=Object.create(null),this._pipeCache=Object.create(null),this._pipeStateCaches=Object.create(null),this._colorMask=15,this._multisampleCount=1,this._renderer=e;}contextChange(e){this._gpu=e,this.setStencilMode(He.DISABLED),this._updatePipeHash();}setMultisampleCount(e){this._multisampleCount!==e&&(this._multisampleCount=e,this._updatePipeHash());}setRenderTarget(e){this._multisampleCount=e.msaaSamples,this._depthStencilAttachment=e.descriptor.depthStencilAttachment?1:0,this._updatePipeHash();}setColorMask(e){this._colorMask!==e&&(this._colorMask=e,this._updatePipeHash());}setStencilMode(e){this._stencilMode!==e&&(this._stencilMode=e,this._stencilState=Yr[e],this._updatePipeHash());}setPipeline(e,t,i,s){let n=this.getPipeline(e,t,i);s.setPipeline(n);}getPipeline(e,t,i,s){e._layoutKey||(fl(e,t.attributeData),this._generateBufferKey(e)),s||(s=e.topology);let n=qk(e._layoutKey,t._layoutKey,i.data,i._blendModeId,$k[s]);return this._pipeCache[n]?this._pipeCache[n]:(this._pipeCache[n]=this._createPipeline(e,t,i,s),this._pipeCache[n])}_createPipeline(e,t,i,s){let n=this._gpu.device,o=this._createVertexBufferLayouts(e,t),a=this._renderer.state.getColorTargets(i);a[0].writeMask=this._stencilMode===He.RENDERING_MASK_ADD?0:this._colorMask;let u=this._renderer.shader.getProgramData(t).pipeline,l={vertex:{module:this._getModule(t.vertex.source),entryPoint:t.vertex.entryPoint,buffers:o},fragment:{module:this._getModule(t.fragment.source),entryPoint:t.fragment.entryPoint,targets:a},primitive:{topology:s,cullMode:i.cullMode},layout:u,multisample:{count:this._multisampleCount},label:"PIXI Pipeline"};return this._depthStencilAttachment&&(l.depthStencil={...this._stencilState,format:"depth24plus-stencil8",depthWriteEnabled:i.depthTest,depthCompare:i.depthTest?"less":"always"}),n.createRenderPipeline(l)}_getModule(e){return this._moduleCache[e]||this._createModule(e)}_createModule(e){let t=this._gpu.device;return this._moduleCache[e]=t.createShaderModule({code:e}),this._moduleCache[e]}_generateBufferKey(e){let t=[],i=0,s=Object.keys(e.attributes).sort();for(let o=0;o<s.length;o++){let a=e.attributes[s[o]];t[i++]=a.offset,t[i++]=a.format,t[i++]=a.stride,t[i++]=a.instance;}let n=t.join("|");return e._layoutKey=ai(n,"geometry"),e._layoutKey}_generateAttributeLocationsKey(e){let t=[],i=0,s=Object.keys(e.attributeData).sort();for(let o=0;o<s.length;o++){let a=e.attributeData[s[o]];t[i++]=a.location;}let n=t.join("|");return e._attributeLocationsKey=ai(n,"programAttributes"),e._attributeLocationsKey}getBufferNamesToBind(e,t){let i=e._layoutKey<<16|t._attributeLocationsKey;if(this._bindingNamesCache[i])return this._bindingNamesCache[i];let s=this._createVertexBufferLayouts(e,t),n=Object.create(null),o=t.attributeData;for(let a=0;a<s.length;a++){let l=Object.values(s[a].attributes)[0].shaderLocation;for(let c in o)if(o[c].location===l){n[a]=c;break}}return this._bindingNamesCache[i]=n,n}_createVertexBufferLayouts(e,t){t._attributeLocationsKey||this._generateAttributeLocationsKey(t);let i=e._layoutKey<<16|t._attributeLocationsKey;if(this._bufferLayoutsCache[i])return this._bufferLayoutsCache[i];let s=[];return e.buffers.forEach(n=>{let o={arrayStride:0,stepMode:"vertex",attributes:[]},a=o.attributes;for(let u in t.attributeData){let l=e.attributes[u];(l.divisor??1)!==1&&N(`Attribute ${u} has an invalid divisor value of '${l.divisor}'. WebGPU only supports a divisor value of 1`),l.buffer===n&&(o.arrayStride=l.stride,o.stepMode=l.instance?"instance":"vertex",a.push({shaderLocation:t.attributeData[u].location,offset:l.offset,format:l.format}));}a.length&&s.push(o);}),this._bufferLayoutsCache[i]=s,s}_updatePipeHash(){let e=Kk(this._stencilMode,this._multisampleCount,this._colorMask,this._depthStencilAttachment);this._pipeStateCaches[e]||(this._pipeStateCaches[e]=Object.create(null)),this._pipeCache=this._pipeStateCaches[e];}destroy(){this._renderer=null,this._bufferLayoutsCache=null;}};ma.extension={type:[x.WebGPUSystem],name:"pipeline"};});function Sx(r,e,t,i,s,n){let o=n?1:-1;return r.identity(),r.a=1/i*2,r.d=o*(1/s*2),r.tx=-1-e*r.a,r.ty=-o-t*r.d,r}var QS=f(()=>{});function Ex(r){let e=r.colorTexture.source.resource;return globalThis.HTMLCanvasElement&&e instanceof HTMLCanvasElement&&document.body.contains(e)}var JS=f(()=>{});var Cn,Cx=f(()=>{Te();ct();No();QS();Ng();ho();Ct();ye();lx();JS();ux();Cn=class{constructor(e){this.rootViewPort=new exports.Rectangle,this.viewport=new exports.Rectangle,this.onRenderTargetChange=new bn("onRenderTargetChange"),this.projectionMatrix=new G,this.defaultClearColor=[0,0,0,0],this._renderSurfaceToRenderTargetHash=new Map,this._gpuRenderTargetHash=Object.create(null),this._renderTargetStack=[],this._renderer=e,e.renderableGC.addManagedHash(this,"_gpuRenderTargetHash");}finishRenderPass(){this.adaptor.finishRenderPass(this.renderTarget);}renderStart({target:e,clear:t,clearColor:i,frame:s}){this._renderTargetStack.length=0,this.push(e,t,i,s),this.rootViewPort.copyFrom(this.viewport),this.rootRenderTarget=this.renderTarget,this.renderingToScreen=Ex(this.rootRenderTarget),this.adaptor.prerender?.(this.rootRenderTarget);}postrender(){this.adaptor.postrender?.(this.rootRenderTarget);}bind(e,t=true,i,s){let n=this.getRenderTarget(e),o=this.renderTarget!==n;this.renderTarget=n,this.renderSurface=e;let a=this.getGpuRenderTarget(n);(n.pixelWidth!==a.width||n.pixelHeight!==a.height)&&(this.adaptor.resizeGpuRenderTarget(n),a.width=n.pixelWidth,a.height=n.pixelHeight);let u=n.colorTexture,l=this.viewport,c=u.pixelWidth,h=u.pixelHeight;if(!s&&e instanceof exports.Texture&&(s=e.frame),s){let d=u._resolution;l.x=s.x*d+.5|0,l.y=s.y*d+.5|0,l.width=s.width*d+.5|0,l.height=s.height*d+.5|0;}else l.x=0,l.y=0,l.width=c,l.height=h;return Sx(this.projectionMatrix,0,0,l.width/u.resolution,l.height/u.resolution,!n.isRoot),this.adaptor.startRenderPass(n,t,i,l),o&&this.onRenderTargetChange.emit(n),n}clear(e,t=bt.ALL,i){t&&(e&&(e=this.getRenderTarget(e)),this.adaptor.clear(e||this.renderTarget,t,i,this.viewport));}contextChange(){this._gpuRenderTargetHash=Object.create(null);}push(e,t=bt.ALL,i,s){let n=this.bind(e,t,i,s);return this._renderTargetStack.push({renderTarget:n,frame:s}),n}pop(){this._renderTargetStack.pop();let e=this._renderTargetStack[this._renderTargetStack.length-1];this.bind(e.renderTarget,false,null,e.frame);}getRenderTarget(e){return e.isTexture&&(e=e.source),this._renderSurfaceToRenderTargetHash.get(e)??this._initRenderTarget(e)}copyToTexture(e,t,i,s,n){i.x<0&&(s.width+=i.x,n.x-=i.x,i.x=0),i.y<0&&(s.height+=i.y,n.y-=i.y,i.y=0);let{pixelWidth:o,pixelHeight:a}=e;return s.width=Math.min(s.width,o-i.x),s.height=Math.min(s.height,a-i.y),this.adaptor.copyToTexture(e,t,i,s,n)}ensureDepthStencil(){this.renderTarget.stencil||(this.renderTarget.stencil=true,this.adaptor.startRenderPass(this.renderTarget,false,null,this.viewport));}destroy(){this._renderer=null,this._renderSurfaceToRenderTargetHash.forEach((e,t)=>{e!==t&&e.destroy();}),this._renderSurfaceToRenderTargetHash.clear(),this._gpuRenderTargetHash=Object.create(null);}_initRenderTarget(e){let t=null;return At.test(e)&&(e=al(e).source),e instanceof na?t=e:e instanceof ge&&(t=new na({colorTextures:[e]}),e.source instanceof At&&(t.isRoot=true),e.once("destroy",()=>{t.destroy(),this._renderSurfaceToRenderTargetHash.delete(e);let i=this._gpuRenderTargetHash[t.uid];i&&(this._gpuRenderTargetHash[t.uid]=null,this.adaptor.destroyGpuRenderTarget(i));})),this._renderSurfaceToRenderTargetHash.set(e,t),t}getGpuRenderTarget(e){return this._gpuRenderTargetHash[e.uid]||(this._gpuRenderTargetHash[e.uid]=this.adaptor.initGpuRenderTarget(e))}resetState(){this.renderTarget=null,this.renderSurface=null;}};});var pl,e2=f(()=>{pl=class{constructor(){this.contexts=[],this.msaaTextures=[],this.msaaSamples=1;}};});var ml,t2=f(()=>{No();ho();Ct();e2();ml=class{init(e,t){this._renderer=e,this._renderTargetSystem=t;}copyToTexture(e,t,i,s,n){let o=this._renderer,a=this._getGpuColorTexture(e),u=o.texture.getGpuSource(t.source);return o.encoder.commandEncoder.copyTextureToTexture({texture:a,origin:i},{texture:u,origin:n},s),t}startRenderPass(e,t=true,i,s){let o=this._renderTargetSystem.getGpuRenderTarget(e),a=this.getDescriptor(e,t,i);o.descriptor=a,this._renderer.pipeline.setRenderTarget(o),this._renderer.encoder.beginRenderPass(o),this._renderer.encoder.setViewport(s);}finishRenderPass(){this._renderer.encoder.endRenderPass();}_getGpuColorTexture(e){let t=this._renderTargetSystem.getGpuRenderTarget(e);return t.contexts[0]?t.contexts[0].getCurrentTexture():this._renderer.texture.getGpuSource(e.colorTextures[0].source)}getDescriptor(e,t,i){typeof t=="boolean"&&(t=t?bt.ALL:bt.NONE);let s=this._renderTargetSystem,n=s.getGpuRenderTarget(e),o=e.colorTextures.map((l,c)=>{let h=n.contexts[c],d,p;h?d=h.getCurrentTexture().createView():d=this._renderer.texture.getGpuSource(l).createView({mipLevelCount:1}),n.msaaTextures[c]&&(p=d,d=this._renderer.texture.getTextureView(n.msaaTextures[c]));let m=t&bt.COLOR?"clear":"load";return i??(i=s.defaultClearColor),{view:d,resolveTarget:p,clearValue:i,storeOp:"store",loadOp:m}}),a;if((e.stencil||e.depth)&&!e.depthStencilTexture&&(e.ensureDepthStencilTexture(),e.depthStencilTexture.source.sampleCount=n.msaa?4:1),e.depthStencilTexture){let l=t&bt.STENCIL?"clear":"load",c=t&bt.DEPTH?"clear":"load";a={view:this._renderer.texture.getGpuSource(e.depthStencilTexture.source).createView(),stencilStoreOp:"store",stencilLoadOp:l,depthClearValue:1,depthLoadOp:c,depthStoreOp:"store"};}return {colorAttachments:o,depthStencilAttachment:a}}clear(e,t=true,i,s){if(!t)return;let{gpu:n,encoder:o}=this._renderer,a=n.device;if(o.commandEncoder===null){let l=a.createCommandEncoder(),c=this.getDescriptor(e,t,i),h=l.beginRenderPass(c);h.setViewport(s.x,s.y,s.width,s.height,0,1),h.end();let d=l.finish();a.queue.submit([d]);}else this.startRenderPass(e,t,i,s);}initGpuRenderTarget(e){e.isRoot=true;let t=new pl;return e.colorTextures.forEach((i,s)=>{if(i instanceof At){let n=i.resource.getContext("webgpu"),o=i.transparent?"premultiplied":"opaque";try{n.configure({device:this._renderer.gpu.device,usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.COPY_SRC,format:"bgra8unorm",alphaMode:o});}catch(a){console.error(a);}t.contexts[s]=n;}if(t.msaa=i.source.antialias,i.source.antialias){let n=new ge({width:0,height:0,sampleCount:4});t.msaaTextures[s]=n;}}),t.msaa&&(t.msaaSamples=4,e.depthStencilTexture&&(e.depthStencilTexture.source.sampleCount=4)),t}destroyGpuRenderTarget(e){e.contexts.forEach(t=>{t.unconfigure();}),e.msaaTextures.forEach(t=>{t.destroy();}),e.msaaTextures.length=0,e.contexts.length=0;}ensureDepthStencilTexture(e){let t=this._renderTargetSystem.getGpuRenderTarget(e);e.depthStencilTexture&&t.msaa&&(e.depthStencilTexture.source.sampleCount=4);}resizeGpuRenderTarget(e){let t=this._renderTargetSystem.getGpuRenderTarget(e);t.width=e.width,t.height=e.height,t.msaa&&e.colorTextures.forEach((i,s)=>{t.msaaTextures[s]?.resize(i.source.width,i.source.height,i.source._resolution);});}};});var ga,r2=f(()=>{B();Cx();t2();ga=class extends Cn{constructor(e){super(e),this.adaptor=new ml,this.adaptor.init(e,this);}};ga.extension={type:[x.WebGPUSystem],name:"renderTarget"};});var xa,i2=f(()=>{B();xa=class{constructor(){this._gpuProgramData=Object.create(null);}contextChange(e){this._gpu=e;}getProgramData(e){return this._gpuProgramData[e._layoutKey]||this._createGPUProgramData(e)}_createGPUProgramData(e){let t=this._gpu.device,i=e.gpuLayout.map(n=>t.createBindGroupLayout({entries:n})),s={bindGroupLayouts:i};return this._gpuProgramData[e._layoutKey]={bindGroups:i,pipeline:t.createPipelineLayout(s)},this._gpuProgramData[e._layoutKey]}destroy(){this._gpu=null,this._gpuProgramData=null;}};xa.extension={type:[x.WebGPUSystem],name:"shader"};});var zt,s2=f(()=>{zt={};zt.normal={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"}};zt.add={alpha:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one",operation:"add"}};zt.multiply={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"dst",dstFactor:"one-minus-src-alpha",operation:"add"}};zt.screen={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one-minus-src",operation:"add"}};zt.overlay={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one-minus-src",operation:"add"}};zt.none={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"zero",dstFactor:"zero",operation:"add"}};zt["normal-npm"]={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha",operation:"add"}};zt["add-npm"]={alpha:{srcFactor:"one",dstFactor:"one",operation:"add"},color:{srcFactor:"src-alpha",dstFactor:"one",operation:"add"}};zt["screen-npm"]={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"src-alpha",dstFactor:"one-minus-src",operation:"add"}};zt.erase={alpha:{srcFactor:"zero",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"zero",dstFactor:"one-minus-src",operation:"add"}};zt.min={alpha:{srcFactor:"one",dstFactor:"one",operation:"min"},color:{srcFactor:"one",dstFactor:"one",operation:"min"}};zt.max={alpha:{srcFactor:"one",dstFactor:"one",operation:"max"},color:{srcFactor:"one",dstFactor:"one",operation:"max"}};});var _a,n2=f(()=>{B();Pr();s2();_a=class{constructor(){this.defaultState=new Qe,this.defaultState.blend=true;}contextChange(e){this.gpu=e;}getColorTargets(e){return [{format:"bgra8unorm",writeMask:0,blend:zt[e.blendMode]||zt.normal}]}destroy(){this.gpu=null;}};_a.extension={type:[x.WebGPUSystem],name:"state"};});var Ax,o2=f(()=>{Ax={type:"image",upload(r,e,t){let i=r.resource,s=(r.pixelWidth|0)*(r.pixelHeight|0),n=i.byteLength/s;t.device.queue.writeTexture({texture:e},i,{offset:0,rowsPerImage:r.pixelHeight,bytesPerRow:r.pixelHeight*n},{width:r.pixelWidth,height:r.pixelHeight,depthOrArrayLayers:1});}};});var ld,Zk,Px,a2=f(()=>{ld={"bc1-rgba-unorm":{blockBytes:8,blockWidth:4,blockHeight:4},"bc2-rgba-unorm":{blockBytes:16,blockWidth:4,blockHeight:4},"bc3-rgba-unorm":{blockBytes:16,blockWidth:4,blockHeight:4},"bc7-rgba-unorm":{blockBytes:16,blockWidth:4,blockHeight:4},"etc1-rgb-unorm":{blockBytes:8,blockWidth:4,blockHeight:4},"etc2-rgba8unorm":{blockBytes:16,blockWidth:4,blockHeight:4},"astc-4x4-unorm":{blockBytes:16,blockWidth:4,blockHeight:4}},Zk={blockBytes:4,blockWidth:1,blockHeight:1},Px={type:"compressed",upload(r,e,t){let i=r.pixelWidth,s=r.pixelHeight,n=ld[r.format]||Zk;for(let o=0;o<r.resource.length;o++){let a=r.resource[o],u=Math.ceil(i/n.blockWidth)*n.blockBytes;t.device.queue.writeTexture({texture:e,mipLevel:o},a,{offset:0,bytesPerRow:u},{width:Math.ceil(i/n.blockWidth)*n.blockWidth,height:Math.ceil(s/n.blockHeight)*n.blockHeight,depthOrArrayLayers:1}),i=Math.max(i>>1,1),s=Math.max(s>>1,1);}}};});var gl,wx=f(()=>{Fe();Be();gl={type:"image",upload(r,e,t){let i=r.resource;if(!i)return;if(globalThis.HTMLImageElement&&i instanceof HTMLImageElement){let a=j.get().createCanvas(i.width,i.height);a.getContext("2d").drawImage(i,0,0,i.width,i.height),r.resource=a,N("ImageSource: Image element passed, converting to canvas and replacing resource.");}let s=Math.min(e.width,r.resourceWidth||r.pixelWidth),n=Math.min(e.height,r.resourceHeight||r.pixelHeight),o=r.alphaMode==="premultiply-alpha-on-upload";t.device.queue.copyExternalImageToTexture({source:i},{texture:e,premultipliedAlpha:o},{width:s,height:n});}};});var Bx,u2=f(()=>{wx();Bx={type:"video",upload(r,e,t){gl.upload(r,e,t);}};});var xl,l2=f(()=>{xl=class{constructor(e){this.device=e,this.sampler=e.createSampler({minFilter:"linear"}),this.pipelines={};}_getMipmapPipeline(e){let t=this.pipelines[e];return t||(this.mipmapShaderModule||(this.mipmapShaderModule=this.device.createShaderModule({code:`
1862
1862
  var<private> pos : array<vec2<f32>, 3> = array<vec2<f32>, 3>(
1863
1863
  vec2<f32>(-1.0, -1.0), vec2<f32>(-1.0, 3.0), vec2<f32>(3.0, -1.0));
1864
1864
 
@@ -1882,7 +1882,7 @@ fn mainFragment(
1882
1882
  fn fragmentMain(@location(0) texCoord : vec2<f32>) -> @location(0) vec4<f32> {
1883
1883
  return textureSample(img, imgSampler, texCoord);
1884
1884
  }
1885
- `})),t=this.device.createRenderPipeline({layout:"auto",vertex:{module:this.mipmapShaderModule,entryPoint:"vertexMain"},fragment:{module:this.mipmapShaderModule,entryPoint:"fragmentMain",targets:[{format:e}]}}),this.pipelines[e]=t),t}generateMipmap(e){let t=this._getMipmapPipeline(e.format);if(e.dimension==="3d"||e.dimension==="1d")throw new Error("Generating mipmaps for non-2d textures is currently unsupported!");let i=e,s=e.depthOrArrayLayers||1,n=e.usage&GPUTextureUsage.RENDER_ATTACHMENT;if(!n){let u={size:{width:Math.ceil(e.width/2),height:Math.ceil(e.height/2),depthOrArrayLayers:s},format:e.format,usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_SRC|GPUTextureUsage.RENDER_ATTACHMENT,mipLevelCount:e.mipLevelCount-1};i=this.device.createTexture(u);}let o=this.device.createCommandEncoder({}),a=t.getBindGroupLayout(0);for(let u=0;u<s;++u){let l=e.createView({baseMipLevel:0,mipLevelCount:1,dimension:"2d",baseArrayLayer:u,arrayLayerCount:1}),c=n?1:0;for(let h=1;h<e.mipLevelCount;++h){let d=i.createView({baseMipLevel:c++,mipLevelCount:1,dimension:"2d",baseArrayLayer:u,arrayLayerCount:1}),p=o.beginRenderPass({colorAttachments:[{view:d,storeOp:"store",loadOp:"clear",clearValue:{r:0,g:0,b:0,a:0}}]}),m=this.device.createBindGroup({layout:a,entries:[{binding:0,resource:this.sampler},{binding:1,resource:l}]});p.setPipeline(t),p.setBindGroup(0,m),p.draw(3,1,0,0),p.end(),l=d;}}if(!n){let u={width:Math.ceil(e.width/2),height:Math.ceil(e.height/2),depthOrArrayLayers:s};for(let l=1;l<e.mipLevelCount;++l)o.copyTextureToTexture({texture:i,mipLevel:l-1},{texture:e,mipLevel:l},u),u.width=Math.ceil(u.width/2),u.height=Math.ceil(u.height/2);}return this.device.queue.submit([o.finish()]),n||i.destroy(),e}};});var ba,c2=f(()=>{Ge();B();ht();wo();ns();o2();a2();wx();u2();l2();ba=class{constructor(e){this.managedTextures=[],this._gpuSources=Object.create(null),this._gpuSamplers=Object.create(null),this._bindGroupHash=Object.create(null),this._textureViewHash=Object.create(null),this._uploads={image:gl,buffer:Ax,video:Bx,compressed:Px},this._renderer=e,e.renderableGC.addManagedHash(this,"_gpuSources"),e.renderableGC.addManagedHash(this,"_gpuSamplers"),e.renderableGC.addManagedHash(this,"_bindGroupHash"),e.renderableGC.addManagedHash(this,"_textureViewHash");}contextChange(e){this._gpu=e;}initSource(e){if(e.autoGenerateMipmaps){let u=Math.max(e.pixelWidth,e.pixelHeight);e.mipLevelCount=Math.floor(Math.log2(u))+1;}let t=GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST;e.uploadMethodId!=="compressed"&&(t|=GPUTextureUsage.RENDER_ATTACHMENT,t|=GPUTextureUsage.COPY_SRC);let i=ld[e.format]||{blockWidth:1,blockHeight:1},s=Math.ceil(e.pixelWidth/i.blockWidth)*i.blockWidth,n=Math.ceil(e.pixelHeight/i.blockHeight)*i.blockHeight,o={label:e.label,size:{width:s,height:n},format:e.format,sampleCount:e.sampleCount,mipLevelCount:e.mipLevelCount,dimension:e.dimension,usage:t},a=this._gpu.device.createTexture(o);return this._gpuSources[e.uid]=a,this.managedTextures.includes(e)||(e.on("update",this.onSourceUpdate,this),e.on("resize",this.onSourceResize,this),e.on("destroy",this.onSourceDestroy,this),e.on("unload",this.onSourceUnload,this),e.on("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.push(e)),this.onSourceUpdate(e),a}onSourceUpdate(e){let t=this.getGpuSource(e);t&&(this._uploads[e.uploadMethodId]&&this._uploads[e.uploadMethodId].upload(e,t,this._gpu),e.autoGenerateMipmaps&&e.mipLevelCount>1&&this.onUpdateMipmaps(e));}onSourceUnload(e){let t=this._gpuSources[e.uid];t&&(this._gpuSources[e.uid]=null,t.destroy());}onUpdateMipmaps(e){this._mipmapGenerator||(this._mipmapGenerator=new xl(this._gpu.device));let t=this.getGpuSource(e);this._mipmapGenerator.generateMipmap(t);}onSourceDestroy(e){e.off("update",this.onSourceUpdate,this),e.off("unload",this.onSourceUnload,this),e.off("destroy",this.onSourceDestroy,this),e.off("resize",this.onSourceResize,this),e.off("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.splice(this.managedTextures.indexOf(e),1),this.onSourceUnload(e);}onSourceResize(e){let t=this._gpuSources[e.uid];t?(t.width!==e.pixelWidth||t.height!==e.pixelHeight)&&(this._textureViewHash[e.uid]=null,this._bindGroupHash[e.uid]=null,this.onSourceUnload(e),this.initSource(e)):this.initSource(e);}_initSampler(e){return this._gpuSamplers[e._resourceId]=this._gpu.device.createSampler(e),this._gpuSamplers[e._resourceId]}getGpuSampler(e){return this._gpuSamplers[e._resourceId]||this._initSampler(e)}getGpuSource(e){return this._gpuSources[e.uid]||this.initSource(e)}getTextureBindGroup(e){return this._bindGroupHash[e.uid]??this._createTextureBindGroup(e)}_createTextureBindGroup(e){let t=e.source;return this._bindGroupHash[e.uid]=new _t({0:t,1:t.style,2:new xe({uTextureMatrix:{type:"mat3x3<f32>",value:e.textureMatrix.mapCoord}})}),this._bindGroupHash[e.uid]}getTextureView(e){let t=e.source;return this._textureViewHash[t.uid]??this._createTextureView(t)}_createTextureView(e){return this._textureViewHash[e.uid]=this.getGpuSource(e).createView(),this._textureViewHash[e.uid]}generateCanvas(e){let t=this._renderer,i=t.gpu.device.createCommandEncoder(),s=j.get().createCanvas();s.width=e.source.pixelWidth,s.height=e.source.pixelHeight;let n=s.getContext("webgpu");return n.configure({device:t.gpu.device,usage:GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC,format:j.get().getNavigator().gpu.getPreferredCanvasFormat(),alphaMode:"premultiplied"}),i.copyTextureToTexture({texture:t.texture.getGpuSource(e.source),origin:{x:0,y:0}},{texture:n.getCurrentTexture()},{width:s.width,height:s.height}),t.gpu.device.queue.submit([i.finish()]),s}getPixels(e){let t=this.generateCanvas(e),i=sr.getOptimalCanvasAndContext(t.width,t.height),s=i.context;s.drawImage(t,0,0);let{width:n,height:o}=t,a=s.getImageData(0,0,n,o),u=new Uint8ClampedArray(a.data.buffer);return sr.returnCanvasAndContext(i),{pixels:u,width:n,height:o}}destroy(){this.managedTextures.slice().forEach(e=>this.onSourceDestroy(e)),this.managedTextures=null;for(let e of Object.keys(this._bindGroupHash)){let t=Number(e);this._bindGroupHash[t]?.destroy(),this._bindGroupHash[t]=null;}this._gpu=null,this._mipmapGenerator=null,this._gpuSources=null,this._bindGroupHash=null,this._textureViewHash=null,this._gpuSamplers=null;}};ba.extension={type:[x.WebGPUSystem],name:"texture"};});var qw={};Zi(qw,{WebGPURenderer:()=>cd});var Qk,Jk,eO,Yw,jw,$w,cd,h2=f(()=>{B();eS();tS();rS();tl();hx();Ar();LS();NS();HS();VS();zS();WS();XS();$S();KS();ZS();r2();i2();n2();c2();Qk=[...ul,fa,la,Tn,ca,aa,ba,ga,xa,_a,ma,ua,ha,oa],Jk=[...ll,pa],eO=[zo,Vo,Ho],Yw=[],jw=[],$w=[];V.handleByNamedList(x.WebGPUSystem,Yw);V.handleByNamedList(x.WebGPUPipes,jw);V.handleByNamedList(x.WebGPUPipesAdaptor,$w);V.add(...Qk,...Jk,...eO);cd=class extends Di{constructor(){let e={name:"webgpu",type:qe.WEBGPU,systems:Yw,renderPipes:jw,renderPipeAdaptors:$w};super(e);}};});var ya,d2=f(()=>{B();Te();as();Cu();Au();Oo();us();nh();Wr();ht();ya=class{contextChange(e){let t=new xe({uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uTransformMatrix:{value:new G,type:"mat3x3<f32>"},uRound:{value:0,type:"f32"}}),i=e.limits.maxBatchableTextures,s=Hr({name:"graphics",bits:[Zs,Js(i),mn,zr]});this.shader=new rt({glProgram:s,resources:{localUniforms:t,batchSamplers:en(i)}});}execute(e,t){let i=t.context,s=i.customShader||this.shader,n=e.renderer,o=n.graphicsContext,{batcher:a,instructions:u}=o.getContextRenderData(i);s.groups[0]=n.globalUniforms.bindGroup,n.state.set(e.state),n.shader.bind(s),n.geometry.bind(a.geometry,s.glProgram);let l=u.instructions;for(let c=0;c<u.instructionSize;c++){let h=l[c];if(h.size){for(let d=0;d<h.textures.count;d++)n.texture.bind(h.textures.textures[d],d);n.geometry.draw(h.topology,h.size,h.start);}}}destroy(){this.shader.destroy(true),this.shader=null;}};ya.extension={type:[x.WebGLPipesAdaptor],name:"graphics"};});var va,f2=f(()=>{B();Te();as();Oo();us();Xg();Wr();ye();Be();va=class{init(){let e=Hr({name:"mesh",bits:[mn,Wg,zr]});this._shader=new rt({glProgram:e,resources:{uTexture:exports.Texture.EMPTY.source,textureUniforms:{uTextureMatrix:{type:"mat3x3<f32>",value:new G}}}});}execute(e,t){let i=e.renderer,s=t._shader;if(s){if(!s.glProgram){N("Mesh shader has no glProgram",t.shader);return}}else {s=this._shader;let n=t.texture,o=n.source;s.resources.uTexture=o,s.resources.uSampler=o.style,s.resources.textureUniforms.uniforms.uTextureMatrix=n.textureMatrix.mapCoord;}s.groups[100]=i.globalUniforms.bindGroup,s.groups[101]=e.localUniformsBindGroup,i.encoder.draw({geometry:t._geometry,shader:s,state:t.state});}destroy(){this._shader.destroy(true),this._shader=null;}};va.extension={type:[x.WebGLPipesAdaptor],name:"mesh"};});var Ta,p2=f(()=>{B();Pr();Ta=class{constructor(){this._tempState=Qe.for2d(),this._didUploadHash={};}init(e){e.renderer.runners.contextChange.add(this);}contextChange(){this._didUploadHash={};}start(e,t,i){let s=e.renderer,n=this._didUploadHash[i.uid];s.shader.bind(i,n),n||(this._didUploadHash[i.uid]=true),s.shader.updateUniformGroup(s.globalUniforms.uniformGroup),s.geometry.bind(t,i.glProgram);}execute(e,t){let i=e.renderer;this._tempState.blendMode=t.blendMode,i.state.set(this._tempState);let s=t.textures.textures;for(let n=0;n<t.textures.count;n++)i.texture.bind(s[n],n);i.geometry.draw(t.topology,t.size,t.start);}};Ta.extension={type:[x.WebGLPipesAdaptor],name:"batch"};});var Sa,m2=f(()=>{Sa=(r=>(r[r.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",r[r.ARRAY_BUFFER=34962]="ARRAY_BUFFER",r[r.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",r))(Sa||{});});var _l,g2=f(()=>{_l=class{constructor(e,t){this._lastBindBaseLocation=-1,this._lastBindCallId=-1,this.buffer=e||null,this.updateID=-1,this.byteLength=-1,this.type=t;}};});var Ea,x2=f(()=>{B();Pi();m2();g2();Ea=class{constructor(e){this._gpuBuffers=Object.create(null),this._boundBufferBases=Object.create(null),this._minBaseLocation=0,this._nextBindBaseIndex=this._minBaseLocation,this._bindCallId=0,this._renderer=e,this._renderer.renderableGC.addManagedHash(this,"_gpuBuffers");}destroy(){this._renderer=null,this._gl=null,this._gpuBuffers=null,this._boundBufferBases=null;}contextChange(){this._gl=this._renderer.gl,this._gpuBuffers=Object.create(null),this._maxBindings=this._renderer.limits.maxUniformBindings;}getGlBuffer(e){return this._gpuBuffers[e.uid]||this.createGLBuffer(e)}bind(e){let{_gl:t}=this,i=this.getGlBuffer(e);t.bindBuffer(i.type,i.buffer);}bindBufferBase(e,t){let{_gl:i}=this;this._boundBufferBases[t]!==e&&(this._boundBufferBases[t]=e,e._lastBindBaseLocation=t,i.bindBufferBase(i.UNIFORM_BUFFER,t,e.buffer));}nextBindBase(e){this._bindCallId++,this._minBaseLocation=0,e&&(this._boundBufferBases[0]=null,this._minBaseLocation=1,this._nextBindBaseIndex<1&&(this._nextBindBaseIndex=1));}freeLocationForBufferBase(e){let t=this.getLastBindBaseLocation(e);if(t>=this._minBaseLocation)return e._lastBindCallId=this._bindCallId,t;let i=0,s=this._nextBindBaseIndex;for(;i<2;){s>=this._maxBindings&&(s=this._minBaseLocation,i++);let n=this._boundBufferBases[s];if(n&&n._lastBindCallId===this._bindCallId){s++;continue}break}return t=s,this._nextBindBaseIndex=s+1,i>=2?-1:(e._lastBindCallId=this._bindCallId,this._boundBufferBases[t]=null,t)}getLastBindBaseLocation(e){let t=e._lastBindBaseLocation;return this._boundBufferBases[t]===e?t:-1}bindBufferRange(e,t,i,s){let{_gl:n}=this;i||(i=0),t||(t=0),this._boundBufferBases[t]=null,n.bindBufferRange(n.UNIFORM_BUFFER,t||0,e.buffer,i*256,s||256);}updateBuffer(e){let{_gl:t}=this,i=this.getGlBuffer(e);if(e._updateID===i.updateID)return i;i.updateID=e._updateID,t.bindBuffer(i.type,i.buffer);let s=e.data,n=e.descriptor.usage&he.STATIC?t.STATIC_DRAW:t.DYNAMIC_DRAW;return s?i.byteLength>=s.byteLength?t.bufferSubData(i.type,0,s,0,e._updateSize/s.BYTES_PER_ELEMENT):(i.byteLength=s.byteLength,t.bufferData(i.type,s,n)):(i.byteLength=e.descriptor.size,t.bufferData(i.type,i.byteLength,n)),i}destroyAll(){let e=this._gl;for(let t in this._gpuBuffers)e.deleteBuffer(this._gpuBuffers[t].buffer);this._gpuBuffers=Object.create(null);}onBufferDestroy(e,t){let i=this._gpuBuffers[e.uid],s=this._gl;t||s.deleteBuffer(i.buffer),this._gpuBuffers[e.uid]=null;}createGLBuffer(e){let{_gl:t}=this,i=Sa.ARRAY_BUFFER;e.descriptor.usage&he.INDEX?i=Sa.ELEMENT_ARRAY_BUFFER:e.descriptor.usage&he.UNIFORM&&(i=Sa.UNIFORM_BUFFER);let s=new _l(t.createBuffer(),i);return this._gpuBuffers[e.uid]=s,e.on("destroy",this.onBufferDestroy,this),s}resetState(){this._boundBufferBases=Object.create(null);}};Ea.extension={type:[x.WebGLSystem],name:"buffer"};});var _2,Rx,b2=f(()=>{Ge();B();Be();_2=class Kw{constructor(e){this.supports={uint32Indices:true,uniformBufferObject:true,vertexArrayObject:true,srgbTextures:true,nonPowOf2wrapping:true,msaa:true,nonPowOf2mipmaps:true},this._renderer=e,this.extensions=Object.create(null),this.handleContextLost=this.handleContextLost.bind(this),this.handleContextRestored=this.handleContextRestored.bind(this);}get isLost(){return !this.gl||this.gl.isContextLost()}contextChange(e){this.gl=e,this._renderer.gl=e;}init(e){e={...Kw.defaultOptions,...e};let t=this.multiView=e.multiView;if(e.context&&t&&(N("Renderer created with both a context and multiview enabled. Disabling multiView as both cannot work together."),t=false),t?this.canvas=j.get().createCanvas(this._renderer.canvas.width,this._renderer.canvas.height):this.canvas=this._renderer.view.canvas,e.context)this.initFromContext(e.context);else {let i=this._renderer.background.alpha<1,s=e.premultipliedAlpha??true,n=e.antialias&&!this._renderer.backBuffer.useBackBuffer;this.createContext(e.preferWebGLVersion,{alpha:i,premultipliedAlpha:s,antialias:n,stencil:true,preserveDrawingBuffer:e.preserveDrawingBuffer,powerPreference:e.powerPreference??"default"});}}ensureCanvasSize(e){if(!this.multiView){e!==this.canvas&&N("multiView is disabled, but targetCanvas is not the main canvas");return}let{canvas:t}=this;(t.width<e.width||t.height<e.height)&&(t.width=Math.max(e.width,e.width),t.height=Math.max(e.height,e.height));}initFromContext(e){this.gl=e,this.webGLVersion=e instanceof j.get().getWebGLRenderingContext()?1:2,this.getExtensions(),this.validateContext(e),this._renderer.runners.contextChange.emit(e);let t=this._renderer.view.canvas;t.addEventListener("webglcontextlost",this.handleContextLost,false),t.addEventListener("webglcontextrestored",this.handleContextRestored,false);}createContext(e,t){let i,s=this.canvas;if(e===2&&(i=s.getContext("webgl2",t)),!i&&(i=s.getContext("webgl",t),!i))throw new Error("This browser does not support WebGL. Try using the canvas renderer");this.gl=i,this.initFromContext(this.gl);}getExtensions(){let{gl:e}=this,t={anisotropicFiltering:e.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),s3tc:e.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:e.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:e.getExtension("WEBGL_compressed_texture_etc"),etc1:e.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:e.getExtension("WEBGL_compressed_texture_atc"),astc:e.getExtension("WEBGL_compressed_texture_astc"),bptc:e.getExtension("EXT_texture_compression_bptc"),rgtc:e.getExtension("EXT_texture_compression_rgtc"),loseContext:e.getExtension("WEBGL_lose_context")};if(this.webGLVersion===1)this.extensions={...t,drawBuffers:e.getExtension("WEBGL_draw_buffers"),depthTexture:e.getExtension("WEBGL_depth_texture"),vertexArrayObject:e.getExtension("OES_vertex_array_object")||e.getExtension("MOZ_OES_vertex_array_object")||e.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:e.getExtension("OES_element_index_uint"),floatTexture:e.getExtension("OES_texture_float"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),textureHalfFloat:e.getExtension("OES_texture_half_float"),textureHalfFloatLinear:e.getExtension("OES_texture_half_float_linear"),vertexAttribDivisorANGLE:e.getExtension("ANGLE_instanced_arrays"),srgb:e.getExtension("EXT_sRGB")};else {this.extensions={...t,colorBufferFloat:e.getExtension("EXT_color_buffer_float")};let i=e.getExtension("WEBGL_provoking_vertex");i&&i.provokingVertexWEBGL(i.FIRST_VERTEX_CONVENTION_WEBGL);}}handleContextLost(e){e.preventDefault(),this._contextLossForced&&(this._contextLossForced=false,setTimeout(()=>{this.gl.isContextLost()&&this.extensions.loseContext?.restoreContext();},0));}handleContextRestored(){this.getExtensions(),this._renderer.runners.contextChange.emit(this.gl);}destroy(){let e=this._renderer.view.canvas;this._renderer=null,e.removeEventListener("webglcontextlost",this.handleContextLost),e.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext?.loseContext();}forceContextLoss(){this.extensions.loseContext?.loseContext(),this._contextLossForced=true;}validateContext(e){let t=e.getContextAttributes();t&&!t.stencil&&N("Provided WebGL context does not have a stencil buffer, masks may not render correctly");let i=this.supports,s=this.webGLVersion===2,n=this.extensions;i.uint32Indices=s||!!n.uint32ElementIndex,i.uniformBufferObject=s,i.vertexArrayObject=s||!!n.vertexArrayObject,i.srgbTextures=s||!!n.srgb,i.nonPowOf2wrapping=s,i.nonPowOf2mipmaps=s,i.msaa=s,i.uint32Indices||N("Provided WebGL context does not support 32 index buffer, large scenes may not render correctly");}};_2.extension={type:[x.WebGLSystem],name:"context"};_2.defaultOptions={context:null,premultipliedAlpha:true,preserveDrawingBuffer:false,powerPreference:void 0,preferWebGLVersion:2,multiView:false};Rx=_2;});var bl,hd,y2,Ee,Mx=f(()=>{bl=(r=>(r[r.RGBA=6408]="RGBA",r[r.RGB=6407]="RGB",r[r.RG=33319]="RG",r[r.RED=6403]="RED",r[r.RGBA_INTEGER=36249]="RGBA_INTEGER",r[r.RGB_INTEGER=36248]="RGB_INTEGER",r[r.RG_INTEGER=33320]="RG_INTEGER",r[r.RED_INTEGER=36244]="RED_INTEGER",r[r.ALPHA=6406]="ALPHA",r[r.LUMINANCE=6409]="LUMINANCE",r[r.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",r[r.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",r[r.DEPTH_STENCIL=34041]="DEPTH_STENCIL",r))(bl||{}),hd=(r=>(r[r.TEXTURE_2D=3553]="TEXTURE_2D",r[r.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",r[r.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",r[r.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",r[r.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",r[r.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",r[r.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",r[r.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",r[r.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",r))(hd||{}),y2=(r=>(r[r.CLAMP=33071]="CLAMP",r[r.REPEAT=10497]="REPEAT",r[r.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",r))(y2||{}),Ee=(r=>(r[r.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",r[r.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",r[r.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",r[r.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",r[r.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",r[r.UNSIGNED_INT=5125]="UNSIGNED_INT",r[r.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",r[r.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",r[r.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",r[r.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",r[r.BYTE=5120]="BYTE",r[r.SHORT=5122]="SHORT",r[r.INT=5124]="INT",r[r.FLOAT=5126]="FLOAT",r[r.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",r[r.HALF_FLOAT=36193]="HALF_FLOAT",r))(Ee||{});});function Ix(r){return Zw[r]??Zw.float32}var Zw,v2=f(()=>{Mx();Zw={uint8x2:Ee.UNSIGNED_BYTE,uint8x4:Ee.UNSIGNED_BYTE,sint8x2:Ee.BYTE,sint8x4:Ee.BYTE,unorm8x2:Ee.UNSIGNED_BYTE,unorm8x4:Ee.UNSIGNED_BYTE,snorm8x2:Ee.BYTE,snorm8x4:Ee.BYTE,uint16x2:Ee.UNSIGNED_SHORT,uint16x4:Ee.UNSIGNED_SHORT,sint16x2:Ee.SHORT,sint16x4:Ee.SHORT,unorm16x2:Ee.UNSIGNED_SHORT,unorm16x4:Ee.UNSIGNED_SHORT,snorm16x2:Ee.SHORT,snorm16x4:Ee.SHORT,float16x2:Ee.HALF_FLOAT,float16x4:Ee.HALF_FLOAT,float32:Ee.FLOAT,float32x2:Ee.FLOAT,float32x3:Ee.FLOAT,float32x4:Ee.FLOAT,uint32:Ee.UNSIGNED_INT,uint32x2:Ee.UNSIGNED_INT,uint32x3:Ee.UNSIGNED_INT,uint32x4:Ee.UNSIGNED_INT,sint32:Ee.INT,sint32x2:Ee.INT,sint32x3:Ee.INT,sint32x4:Ee.INT};});var tO,Ca,T2=f(()=>{B();js();vx();v2();tO={"point-list":0,"line-list":1,"line-strip":3,"triangle-list":4,"triangle-strip":5},Ca=class{constructor(e){this._geometryVaoHash=Object.create(null),this._renderer=e,this._activeGeometry=null,this._activeVao=null,this.hasVao=true,this.hasInstance=true,this._renderer.renderableGC.addManagedHash(this,"_geometryVaoHash");}contextChange(){let e=this.gl=this._renderer.gl;if(!this._renderer.context.supports.vertexArrayObject)throw new Error("[PixiJS] Vertex Array Objects are not supported on this device");let t=this._renderer.context.extensions.vertexArrayObject;t&&(e.createVertexArray=()=>t.createVertexArrayOES(),e.bindVertexArray=s=>t.bindVertexArrayOES(s),e.deleteVertexArray=s=>t.deleteVertexArrayOES(s));let i=this._renderer.context.extensions.vertexAttribDivisorANGLE;i&&(e.drawArraysInstanced=(s,n,o,a)=>{i.drawArraysInstancedANGLE(s,n,o,a);},e.drawElementsInstanced=(s,n,o,a,u)=>{i.drawElementsInstancedANGLE(s,n,o,a,u);},e.vertexAttribDivisor=(s,n)=>i.vertexAttribDivisorANGLE(s,n)),this._activeGeometry=null,this._activeVao=null,this._geometryVaoHash=Object.create(null);}bind(e,t){let i=this.gl;this._activeGeometry=e;let s=this.getVao(e,t);this._activeVao!==s&&(this._activeVao=s,i.bindVertexArray(s)),this.updateBuffers();}resetState(){this.unbind();}updateBuffers(){let e=this._activeGeometry,t=this._renderer.buffer;for(let i=0;i<e.buffers.length;i++){let s=e.buffers[i];t.updateBuffer(s);}}checkCompatibility(e,t){let i=e.attributes,s=t._attributeData;for(let n in s)if(!i[n])throw new Error(`shader and geometry incompatible, geometry missing the "${n}" attribute`)}getSignature(e,t){let i=e.attributes,s=t._attributeData,n=["g",e.uid];for(let o in i)s[o]&&n.push(o,s[o].location);return n.join("-")}getVao(e,t){return this._geometryVaoHash[e.uid]?.[t._key]||this.initGeometryVao(e,t)}initGeometryVao(e,t,i=true){let s=this._renderer.gl,n=this._renderer.buffer;this._renderer.shader._getProgramData(t),this.checkCompatibility(e,t);let o=this.getSignature(e,t);this._geometryVaoHash[e.uid]||(this._geometryVaoHash[e.uid]=Object.create(null),e.on("destroy",this.onGeometryDestroy,this));let a=this._geometryVaoHash[e.uid],u=a[o];if(u)return a[t._key]=u,u;fl(e,t._attributeData);let l=e.buffers;u=s.createVertexArray(),s.bindVertexArray(u);for(let c=0;c<l.length;c++){let h=l[c];n.bind(h);}return this.activateVao(e,t),a[t._key]=u,a[o]=u,s.bindVertexArray(null),u}onGeometryDestroy(e,t){let i=this._geometryVaoHash[e.uid],s=this.gl;if(i){if(t)for(let n in i)this._activeVao!==i[n]&&this.unbind(),s.deleteVertexArray(i[n]);this._geometryVaoHash[e.uid]=null;}}destroyAll(e=false){let t=this.gl;for(let i in this._geometryVaoHash){if(e)for(let s in this._geometryVaoHash[i]){let n=this._geometryVaoHash[i];this._activeVao!==n&&this.unbind(),t.deleteVertexArray(n[s]);}this._geometryVaoHash[i]=null;}}activateVao(e,t){let i=this._renderer.gl,s=this._renderer.buffer,n=e.attributes;e.indexBuffer&&s.bind(e.indexBuffer);let o=null;for(let a in n){let u=n[a],l=u.buffer,c=s.getGlBuffer(l),h=t._attributeData[a];if(h){o!==c&&(s.bind(l),o=c);let d=h.location;i.enableVertexAttribArray(d);let p=$t(u.format),m=Ix(u.format);if(h.format?.substring(1,4)==="int"?i.vertexAttribIPointer(d,p.size,m,u.stride,u.offset):i.vertexAttribPointer(d,p.size,m,p.normalised,u.stride,u.offset),u.instance)if(this.hasInstance){let b=u.divisor??1;i.vertexAttribDivisor(d,b);}else throw new Error("geometry error, GPU Instancing is not supported on this device")}}}draw(e,t,i,s){let{gl:n}=this._renderer,o=this._activeGeometry,a=tO[e||o.topology];if(s??(s=o.instanceCount),o.indexBuffer){let u=o.indexBuffer.data.BYTES_PER_ELEMENT,l=u===2?n.UNSIGNED_SHORT:n.UNSIGNED_INT;s>1?n.drawElementsInstanced(a,t||o.indexBuffer.data.length,l,(i||0)*u,s):n.drawElements(a,t||o.indexBuffer.data.length,l,(i||0)*u);}else s>1?n.drawArraysInstanced(a,i||0,t||o.getSize(),s):n.drawArrays(a,i||0,t||o.getSize());return this}unbind(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null;}destroy(){this._renderer=null,this.gl=null,this._activeVao=null,this._activeGeometry=null;}};Ca.extension={type:[x.WebGLSystem],name:"geometry"};});var rO,S2,Dx,E2=f(()=>{B();Be();Ys();Wr();Pr();Ct();ye();dr();rO=new jt({attributes:{aPosition:[-1,-1,3,-1,-1,3]}}),S2=class Qw{constructor(e){this.useBackBuffer=false,this._useBackBufferThisRender=false,this._renderer=e;}init(e={}){let{useBackBuffer:t,antialias:i}={...Qw.defaultOptions,...e};this.useBackBuffer=t,this._antialias=i,this._renderer.context.supports.msaa||(N("antialiasing, is not supported on when using the back buffer"),this._antialias=false),this._state=Qe.for2d();let s=new je({vertex:`
1885
+ `})),t=this.device.createRenderPipeline({layout:"auto",vertex:{module:this.mipmapShaderModule,entryPoint:"vertexMain"},fragment:{module:this.mipmapShaderModule,entryPoint:"fragmentMain",targets:[{format:e}]}}),this.pipelines[e]=t),t}generateMipmap(e){let t=this._getMipmapPipeline(e.format);if(e.dimension==="3d"||e.dimension==="1d")throw new Error("Generating mipmaps for non-2d textures is currently unsupported!");let i=e,s=e.depthOrArrayLayers||1,n=e.usage&GPUTextureUsage.RENDER_ATTACHMENT;if(!n){let u={size:{width:Math.ceil(e.width/2),height:Math.ceil(e.height/2),depthOrArrayLayers:s},format:e.format,usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_SRC|GPUTextureUsage.RENDER_ATTACHMENT,mipLevelCount:e.mipLevelCount-1};i=this.device.createTexture(u);}let o=this.device.createCommandEncoder({}),a=t.getBindGroupLayout(0);for(let u=0;u<s;++u){let l=e.createView({baseMipLevel:0,mipLevelCount:1,dimension:"2d",baseArrayLayer:u,arrayLayerCount:1}),c=n?1:0;for(let h=1;h<e.mipLevelCount;++h){let d=i.createView({baseMipLevel:c++,mipLevelCount:1,dimension:"2d",baseArrayLayer:u,arrayLayerCount:1}),p=o.beginRenderPass({colorAttachments:[{view:d,storeOp:"store",loadOp:"clear",clearValue:{r:0,g:0,b:0,a:0}}]}),m=this.device.createBindGroup({layout:a,entries:[{binding:0,resource:this.sampler},{binding:1,resource:l}]});p.setPipeline(t),p.setBindGroup(0,m),p.draw(3,1,0,0),p.end(),l=d;}}if(!n){let u={width:Math.ceil(e.width/2),height:Math.ceil(e.height/2),depthOrArrayLayers:s};for(let l=1;l<e.mipLevelCount;++l)o.copyTextureToTexture({texture:i,mipLevel:l-1},{texture:e,mipLevel:l},u),u.width=Math.ceil(u.width/2),u.height=Math.ceil(u.height/2);}return this.device.queue.submit([o.finish()]),n||i.destroy(),e}};});var ba,c2=f(()=>{Fe();B();ht();wo();ns();o2();a2();wx();u2();l2();ba=class{constructor(e){this.managedTextures=[],this._gpuSources=Object.create(null),this._gpuSamplers=Object.create(null),this._bindGroupHash=Object.create(null),this._textureViewHash=Object.create(null),this._uploads={image:gl,buffer:Ax,video:Bx,compressed:Px},this._renderer=e,e.renderableGC.addManagedHash(this,"_gpuSources"),e.renderableGC.addManagedHash(this,"_gpuSamplers"),e.renderableGC.addManagedHash(this,"_bindGroupHash"),e.renderableGC.addManagedHash(this,"_textureViewHash");}contextChange(e){this._gpu=e;}initSource(e){if(e.autoGenerateMipmaps){let u=Math.max(e.pixelWidth,e.pixelHeight);e.mipLevelCount=Math.floor(Math.log2(u))+1;}let t=GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST;e.uploadMethodId!=="compressed"&&(t|=GPUTextureUsage.RENDER_ATTACHMENT,t|=GPUTextureUsage.COPY_SRC);let i=ld[e.format]||{blockWidth:1,blockHeight:1},s=Math.ceil(e.pixelWidth/i.blockWidth)*i.blockWidth,n=Math.ceil(e.pixelHeight/i.blockHeight)*i.blockHeight,o={label:e.label,size:{width:s,height:n},format:e.format,sampleCount:e.sampleCount,mipLevelCount:e.mipLevelCount,dimension:e.dimension,usage:t},a=this._gpu.device.createTexture(o);return this._gpuSources[e.uid]=a,this.managedTextures.includes(e)||(e.on("update",this.onSourceUpdate,this),e.on("resize",this.onSourceResize,this),e.on("destroy",this.onSourceDestroy,this),e.on("unload",this.onSourceUnload,this),e.on("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.push(e)),this.onSourceUpdate(e),a}onSourceUpdate(e){let t=this.getGpuSource(e);t&&(this._uploads[e.uploadMethodId]&&this._uploads[e.uploadMethodId].upload(e,t,this._gpu),e.autoGenerateMipmaps&&e.mipLevelCount>1&&this.onUpdateMipmaps(e));}onSourceUnload(e){let t=this._gpuSources[e.uid];t&&(this._gpuSources[e.uid]=null,t.destroy());}onUpdateMipmaps(e){this._mipmapGenerator||(this._mipmapGenerator=new xl(this._gpu.device));let t=this.getGpuSource(e);this._mipmapGenerator.generateMipmap(t);}onSourceDestroy(e){e.off("update",this.onSourceUpdate,this),e.off("unload",this.onSourceUnload,this),e.off("destroy",this.onSourceDestroy,this),e.off("resize",this.onSourceResize,this),e.off("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.splice(this.managedTextures.indexOf(e),1),this.onSourceUnload(e);}onSourceResize(e){let t=this._gpuSources[e.uid];t?(t.width!==e.pixelWidth||t.height!==e.pixelHeight)&&(this._textureViewHash[e.uid]=null,this._bindGroupHash[e.uid]=null,this.onSourceUnload(e),this.initSource(e)):this.initSource(e);}_initSampler(e){return this._gpuSamplers[e._resourceId]=this._gpu.device.createSampler(e),this._gpuSamplers[e._resourceId]}getGpuSampler(e){return this._gpuSamplers[e._resourceId]||this._initSampler(e)}getGpuSource(e){return this._gpuSources[e.uid]||this.initSource(e)}getTextureBindGroup(e){return this._bindGroupHash[e.uid]??this._createTextureBindGroup(e)}_createTextureBindGroup(e){let t=e.source;return this._bindGroupHash[e.uid]=new _t({0:t,1:t.style,2:new xe({uTextureMatrix:{type:"mat3x3<f32>",value:e.textureMatrix.mapCoord}})}),this._bindGroupHash[e.uid]}getTextureView(e){let t=e.source;return this._textureViewHash[t.uid]??this._createTextureView(t)}_createTextureView(e){return this._textureViewHash[e.uid]=this.getGpuSource(e).createView(),this._textureViewHash[e.uid]}generateCanvas(e){let t=this._renderer,i=t.gpu.device.createCommandEncoder(),s=j.get().createCanvas();s.width=e.source.pixelWidth,s.height=e.source.pixelHeight;let n=s.getContext("webgpu");return n.configure({device:t.gpu.device,usage:GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC,format:j.get().getNavigator().gpu.getPreferredCanvasFormat(),alphaMode:"premultiplied"}),i.copyTextureToTexture({texture:t.texture.getGpuSource(e.source),origin:{x:0,y:0}},{texture:n.getCurrentTexture()},{width:s.width,height:s.height}),t.gpu.device.queue.submit([i.finish()]),s}getPixels(e){let t=this.generateCanvas(e),i=sr.getOptimalCanvasAndContext(t.width,t.height),s=i.context;s.drawImage(t,0,0);let{width:n,height:o}=t,a=s.getImageData(0,0,n,o),u=new Uint8ClampedArray(a.data.buffer);return sr.returnCanvasAndContext(i),{pixels:u,width:n,height:o}}destroy(){this.managedTextures.slice().forEach(e=>this.onSourceDestroy(e)),this.managedTextures=null;for(let e of Object.keys(this._bindGroupHash)){let t=Number(e);this._bindGroupHash[t]?.destroy(),this._bindGroupHash[t]=null;}this._gpu=null,this._mipmapGenerator=null,this._gpuSources=null,this._bindGroupHash=null,this._textureViewHash=null,this._gpuSamplers=null;}};ba.extension={type:[x.WebGPUSystem],name:"texture"};});var qw={};Zi(qw,{WebGPURenderer:()=>cd});var Qk,Jk,eO,Yw,jw,$w,cd,h2=f(()=>{B();eS();tS();rS();tl();hx();Ar();LS();NS();HS();VS();zS();WS();XS();$S();KS();ZS();r2();i2();n2();c2();Qk=[...ul,fa,la,Tn,ca,aa,ba,ga,xa,_a,ma,ua,ha,oa],Jk=[...ll,pa],eO=[zo,Vo,Ho],Yw=[],jw=[],$w=[];V.handleByNamedList(x.WebGPUSystem,Yw);V.handleByNamedList(x.WebGPUPipes,jw);V.handleByNamedList(x.WebGPUPipesAdaptor,$w);V.add(...Qk,...Jk,...eO);cd=class extends Di{constructor(){let e={name:"webgpu",type:qe.WEBGPU,systems:Yw,renderPipes:jw,renderPipeAdaptors:$w};super(e);}};});var ya,d2=f(()=>{B();Te();as();Cu();Au();Oo();us();nh();zr();ht();ya=class{contextChange(e){let t=new xe({uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uTransformMatrix:{value:new G,type:"mat3x3<f32>"},uRound:{value:0,type:"f32"}}),i=e.limits.maxBatchableTextures,s=Nr({name:"graphics",bits:[Zs,Js(i),mn,Vr]});this.shader=new rt({glProgram:s,resources:{localUniforms:t,batchSamplers:en(i)}});}execute(e,t){let i=t.context,s=i.customShader||this.shader,n=e.renderer,o=n.graphicsContext,{batcher:a,instructions:u}=o.getContextRenderData(i);s.groups[0]=n.globalUniforms.bindGroup,n.state.set(e.state),n.shader.bind(s),n.geometry.bind(a.geometry,s.glProgram);let l=u.instructions;for(let c=0;c<u.instructionSize;c++){let h=l[c];if(h.size){for(let d=0;d<h.textures.count;d++)n.texture.bind(h.textures.textures[d],d);n.geometry.draw(h.topology,h.size,h.start);}}}destroy(){this.shader.destroy(true),this.shader=null;}};ya.extension={type:[x.WebGLPipesAdaptor],name:"graphics"};});var va,f2=f(()=>{B();Te();as();Oo();us();Xg();zr();ye();Be();va=class{init(){let e=Nr({name:"mesh",bits:[mn,Wg,Vr]});this._shader=new rt({glProgram:e,resources:{uTexture:exports.Texture.EMPTY.source,textureUniforms:{uTextureMatrix:{type:"mat3x3<f32>",value:new G}}}});}execute(e,t){let i=e.renderer,s=t._shader;if(s){if(!s.glProgram){N("Mesh shader has no glProgram",t.shader);return}}else {s=this._shader;let n=t.texture,o=n.source;s.resources.uTexture=o,s.resources.uSampler=o.style,s.resources.textureUniforms.uniforms.uTextureMatrix=n.textureMatrix.mapCoord;}s.groups[100]=i.globalUniforms.bindGroup,s.groups[101]=e.localUniformsBindGroup,i.encoder.draw({geometry:t._geometry,shader:s,state:t.state});}destroy(){this._shader.destroy(true),this._shader=null;}};va.extension={type:[x.WebGLPipesAdaptor],name:"mesh"};});var Ta,p2=f(()=>{B();Pr();Ta=class{constructor(){this._tempState=Qe.for2d(),this._didUploadHash={};}init(e){e.renderer.runners.contextChange.add(this);}contextChange(){this._didUploadHash={};}start(e,t,i){let s=e.renderer,n=this._didUploadHash[i.uid];s.shader.bind(i,n),n||(this._didUploadHash[i.uid]=true),s.shader.updateUniformGroup(s.globalUniforms.uniformGroup),s.geometry.bind(t,i.glProgram);}execute(e,t){let i=e.renderer;this._tempState.blendMode=t.blendMode,i.state.set(this._tempState);let s=t.textures.textures;for(let n=0;n<t.textures.count;n++)i.texture.bind(s[n],n);i.geometry.draw(t.topology,t.size,t.start);}};Ta.extension={type:[x.WebGLPipesAdaptor],name:"batch"};});var Sa,m2=f(()=>{Sa=(r=>(r[r.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",r[r.ARRAY_BUFFER=34962]="ARRAY_BUFFER",r[r.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",r))(Sa||{});});var _l,g2=f(()=>{_l=class{constructor(e,t){this._lastBindBaseLocation=-1,this._lastBindCallId=-1,this.buffer=e||null,this.updateID=-1,this.byteLength=-1,this.type=t;}};});var Ea,x2=f(()=>{B();Pi();m2();g2();Ea=class{constructor(e){this._gpuBuffers=Object.create(null),this._boundBufferBases=Object.create(null),this._minBaseLocation=0,this._nextBindBaseIndex=this._minBaseLocation,this._bindCallId=0,this._renderer=e,this._renderer.renderableGC.addManagedHash(this,"_gpuBuffers");}destroy(){this._renderer=null,this._gl=null,this._gpuBuffers=null,this._boundBufferBases=null;}contextChange(){this._gl=this._renderer.gl,this._gpuBuffers=Object.create(null),this._maxBindings=this._renderer.limits.maxUniformBindings;}getGlBuffer(e){return this._gpuBuffers[e.uid]||this.createGLBuffer(e)}bind(e){let{_gl:t}=this,i=this.getGlBuffer(e);t.bindBuffer(i.type,i.buffer);}bindBufferBase(e,t){let{_gl:i}=this;this._boundBufferBases[t]!==e&&(this._boundBufferBases[t]=e,e._lastBindBaseLocation=t,i.bindBufferBase(i.UNIFORM_BUFFER,t,e.buffer));}nextBindBase(e){this._bindCallId++,this._minBaseLocation=0,e&&(this._boundBufferBases[0]=null,this._minBaseLocation=1,this._nextBindBaseIndex<1&&(this._nextBindBaseIndex=1));}freeLocationForBufferBase(e){let t=this.getLastBindBaseLocation(e);if(t>=this._minBaseLocation)return e._lastBindCallId=this._bindCallId,t;let i=0,s=this._nextBindBaseIndex;for(;i<2;){s>=this._maxBindings&&(s=this._minBaseLocation,i++);let n=this._boundBufferBases[s];if(n&&n._lastBindCallId===this._bindCallId){s++;continue}break}return t=s,this._nextBindBaseIndex=s+1,i>=2?-1:(e._lastBindCallId=this._bindCallId,this._boundBufferBases[t]=null,t)}getLastBindBaseLocation(e){let t=e._lastBindBaseLocation;return this._boundBufferBases[t]===e?t:-1}bindBufferRange(e,t,i,s){let{_gl:n}=this;i||(i=0),t||(t=0),this._boundBufferBases[t]=null,n.bindBufferRange(n.UNIFORM_BUFFER,t||0,e.buffer,i*256,s||256);}updateBuffer(e){let{_gl:t}=this,i=this.getGlBuffer(e);if(e._updateID===i.updateID)return i;i.updateID=e._updateID,t.bindBuffer(i.type,i.buffer);let s=e.data,n=e.descriptor.usage&he.STATIC?t.STATIC_DRAW:t.DYNAMIC_DRAW;return s?i.byteLength>=s.byteLength?t.bufferSubData(i.type,0,s,0,e._updateSize/s.BYTES_PER_ELEMENT):(i.byteLength=s.byteLength,t.bufferData(i.type,s,n)):(i.byteLength=e.descriptor.size,t.bufferData(i.type,i.byteLength,n)),i}destroyAll(){let e=this._gl;for(let t in this._gpuBuffers)e.deleteBuffer(this._gpuBuffers[t].buffer);this._gpuBuffers=Object.create(null);}onBufferDestroy(e,t){let i=this._gpuBuffers[e.uid],s=this._gl;t||s.deleteBuffer(i.buffer),this._gpuBuffers[e.uid]=null;}createGLBuffer(e){let{_gl:t}=this,i=Sa.ARRAY_BUFFER;e.descriptor.usage&he.INDEX?i=Sa.ELEMENT_ARRAY_BUFFER:e.descriptor.usage&he.UNIFORM&&(i=Sa.UNIFORM_BUFFER);let s=new _l(t.createBuffer(),i);return this._gpuBuffers[e.uid]=s,e.on("destroy",this.onBufferDestroy,this),s}resetState(){this._boundBufferBases=Object.create(null);}};Ea.extension={type:[x.WebGLSystem],name:"buffer"};});var _2,Rx,b2=f(()=>{Fe();B();Be();_2=class Kw{constructor(e){this.supports={uint32Indices:true,uniformBufferObject:true,vertexArrayObject:true,srgbTextures:true,nonPowOf2wrapping:true,msaa:true,nonPowOf2mipmaps:true},this._renderer=e,this.extensions=Object.create(null),this.handleContextLost=this.handleContextLost.bind(this),this.handleContextRestored=this.handleContextRestored.bind(this);}get isLost(){return !this.gl||this.gl.isContextLost()}contextChange(e){this.gl=e,this._renderer.gl=e;}init(e){e={...Kw.defaultOptions,...e};let t=this.multiView=e.multiView;if(e.context&&t&&(N("Renderer created with both a context and multiview enabled. Disabling multiView as both cannot work together."),t=false),t?this.canvas=j.get().createCanvas(this._renderer.canvas.width,this._renderer.canvas.height):this.canvas=this._renderer.view.canvas,e.context)this.initFromContext(e.context);else {let i=this._renderer.background.alpha<1,s=e.premultipliedAlpha??true,n=e.antialias&&!this._renderer.backBuffer.useBackBuffer;this.createContext(e.preferWebGLVersion,{alpha:i,premultipliedAlpha:s,antialias:n,stencil:true,preserveDrawingBuffer:e.preserveDrawingBuffer,powerPreference:e.powerPreference??"default"});}}ensureCanvasSize(e){if(!this.multiView){e!==this.canvas&&N("multiView is disabled, but targetCanvas is not the main canvas");return}let{canvas:t}=this;(t.width<e.width||t.height<e.height)&&(t.width=Math.max(e.width,e.width),t.height=Math.max(e.height,e.height));}initFromContext(e){this.gl=e,this.webGLVersion=e instanceof j.get().getWebGLRenderingContext()?1:2,this.getExtensions(),this.validateContext(e),this._renderer.runners.contextChange.emit(e);let t=this._renderer.view.canvas;t.addEventListener("webglcontextlost",this.handleContextLost,false),t.addEventListener("webglcontextrestored",this.handleContextRestored,false);}createContext(e,t){let i,s=this.canvas;if(e===2&&(i=s.getContext("webgl2",t)),!i&&(i=s.getContext("webgl",t),!i))throw new Error("This browser does not support WebGL. Try using the canvas renderer");this.gl=i,this.initFromContext(this.gl);}getExtensions(){let{gl:e}=this,t={anisotropicFiltering:e.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),s3tc:e.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:e.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:e.getExtension("WEBGL_compressed_texture_etc"),etc1:e.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:e.getExtension("WEBGL_compressed_texture_atc"),astc:e.getExtension("WEBGL_compressed_texture_astc"),bptc:e.getExtension("EXT_texture_compression_bptc"),rgtc:e.getExtension("EXT_texture_compression_rgtc"),loseContext:e.getExtension("WEBGL_lose_context")};if(this.webGLVersion===1)this.extensions={...t,drawBuffers:e.getExtension("WEBGL_draw_buffers"),depthTexture:e.getExtension("WEBGL_depth_texture"),vertexArrayObject:e.getExtension("OES_vertex_array_object")||e.getExtension("MOZ_OES_vertex_array_object")||e.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:e.getExtension("OES_element_index_uint"),floatTexture:e.getExtension("OES_texture_float"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),textureHalfFloat:e.getExtension("OES_texture_half_float"),textureHalfFloatLinear:e.getExtension("OES_texture_half_float_linear"),vertexAttribDivisorANGLE:e.getExtension("ANGLE_instanced_arrays"),srgb:e.getExtension("EXT_sRGB")};else {this.extensions={...t,colorBufferFloat:e.getExtension("EXT_color_buffer_float")};let i=e.getExtension("WEBGL_provoking_vertex");i&&i.provokingVertexWEBGL(i.FIRST_VERTEX_CONVENTION_WEBGL);}}handleContextLost(e){e.preventDefault(),this._contextLossForced&&(this._contextLossForced=false,setTimeout(()=>{this.gl.isContextLost()&&this.extensions.loseContext?.restoreContext();},0));}handleContextRestored(){this.getExtensions(),this._renderer.runners.contextChange.emit(this.gl);}destroy(){let e=this._renderer.view.canvas;this._renderer=null,e.removeEventListener("webglcontextlost",this.handleContextLost),e.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext?.loseContext();}forceContextLoss(){this.extensions.loseContext?.loseContext(),this._contextLossForced=true;}validateContext(e){let t=e.getContextAttributes();t&&!t.stencil&&N("Provided WebGL context does not have a stencil buffer, masks may not render correctly");let i=this.supports,s=this.webGLVersion===2,n=this.extensions;i.uint32Indices=s||!!n.uint32ElementIndex,i.uniformBufferObject=s,i.vertexArrayObject=s||!!n.vertexArrayObject,i.srgbTextures=s||!!n.srgb,i.nonPowOf2wrapping=s,i.nonPowOf2mipmaps=s,i.msaa=s,i.uint32Indices||N("Provided WebGL context does not support 32 index buffer, large scenes may not render correctly");}};_2.extension={type:[x.WebGLSystem],name:"context"};_2.defaultOptions={context:null,premultipliedAlpha:true,preserveDrawingBuffer:false,powerPreference:void 0,preferWebGLVersion:2,multiView:false};Rx=_2;});var bl,hd,y2,Ee,Mx=f(()=>{bl=(r=>(r[r.RGBA=6408]="RGBA",r[r.RGB=6407]="RGB",r[r.RG=33319]="RG",r[r.RED=6403]="RED",r[r.RGBA_INTEGER=36249]="RGBA_INTEGER",r[r.RGB_INTEGER=36248]="RGB_INTEGER",r[r.RG_INTEGER=33320]="RG_INTEGER",r[r.RED_INTEGER=36244]="RED_INTEGER",r[r.ALPHA=6406]="ALPHA",r[r.LUMINANCE=6409]="LUMINANCE",r[r.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",r[r.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",r[r.DEPTH_STENCIL=34041]="DEPTH_STENCIL",r))(bl||{}),hd=(r=>(r[r.TEXTURE_2D=3553]="TEXTURE_2D",r[r.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",r[r.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",r[r.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",r[r.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",r[r.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",r[r.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",r[r.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",r[r.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",r))(hd||{}),y2=(r=>(r[r.CLAMP=33071]="CLAMP",r[r.REPEAT=10497]="REPEAT",r[r.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",r))(y2||{}),Ee=(r=>(r[r.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",r[r.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",r[r.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",r[r.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",r[r.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",r[r.UNSIGNED_INT=5125]="UNSIGNED_INT",r[r.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",r[r.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",r[r.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",r[r.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",r[r.BYTE=5120]="BYTE",r[r.SHORT=5122]="SHORT",r[r.INT=5124]="INT",r[r.FLOAT=5126]="FLOAT",r[r.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",r[r.HALF_FLOAT=36193]="HALF_FLOAT",r))(Ee||{});});function Ix(r){return Zw[r]??Zw.float32}var Zw,v2=f(()=>{Mx();Zw={uint8x2:Ee.UNSIGNED_BYTE,uint8x4:Ee.UNSIGNED_BYTE,sint8x2:Ee.BYTE,sint8x4:Ee.BYTE,unorm8x2:Ee.UNSIGNED_BYTE,unorm8x4:Ee.UNSIGNED_BYTE,snorm8x2:Ee.BYTE,snorm8x4:Ee.BYTE,uint16x2:Ee.UNSIGNED_SHORT,uint16x4:Ee.UNSIGNED_SHORT,sint16x2:Ee.SHORT,sint16x4:Ee.SHORT,unorm16x2:Ee.UNSIGNED_SHORT,unorm16x4:Ee.UNSIGNED_SHORT,snorm16x2:Ee.SHORT,snorm16x4:Ee.SHORT,float16x2:Ee.HALF_FLOAT,float16x4:Ee.HALF_FLOAT,float32:Ee.FLOAT,float32x2:Ee.FLOAT,float32x3:Ee.FLOAT,float32x4:Ee.FLOAT,uint32:Ee.UNSIGNED_INT,uint32x2:Ee.UNSIGNED_INT,uint32x3:Ee.UNSIGNED_INT,uint32x4:Ee.UNSIGNED_INT,sint32:Ee.INT,sint32x2:Ee.INT,sint32x3:Ee.INT,sint32x4:Ee.INT};});var tO,Ca,T2=f(()=>{B();js();vx();v2();tO={"point-list":0,"line-list":1,"line-strip":3,"triangle-list":4,"triangle-strip":5},Ca=class{constructor(e){this._geometryVaoHash=Object.create(null),this._renderer=e,this._activeGeometry=null,this._activeVao=null,this.hasVao=true,this.hasInstance=true,this._renderer.renderableGC.addManagedHash(this,"_geometryVaoHash");}contextChange(){let e=this.gl=this._renderer.gl;if(!this._renderer.context.supports.vertexArrayObject)throw new Error("[PixiJS] Vertex Array Objects are not supported on this device");let t=this._renderer.context.extensions.vertexArrayObject;t&&(e.createVertexArray=()=>t.createVertexArrayOES(),e.bindVertexArray=s=>t.bindVertexArrayOES(s),e.deleteVertexArray=s=>t.deleteVertexArrayOES(s));let i=this._renderer.context.extensions.vertexAttribDivisorANGLE;i&&(e.drawArraysInstanced=(s,n,o,a)=>{i.drawArraysInstancedANGLE(s,n,o,a);},e.drawElementsInstanced=(s,n,o,a,u)=>{i.drawElementsInstancedANGLE(s,n,o,a,u);},e.vertexAttribDivisor=(s,n)=>i.vertexAttribDivisorANGLE(s,n)),this._activeGeometry=null,this._activeVao=null,this._geometryVaoHash=Object.create(null);}bind(e,t){let i=this.gl;this._activeGeometry=e;let s=this.getVao(e,t);this._activeVao!==s&&(this._activeVao=s,i.bindVertexArray(s)),this.updateBuffers();}resetState(){this.unbind();}updateBuffers(){let e=this._activeGeometry,t=this._renderer.buffer;for(let i=0;i<e.buffers.length;i++){let s=e.buffers[i];t.updateBuffer(s);}}checkCompatibility(e,t){let i=e.attributes,s=t._attributeData;for(let n in s)if(!i[n])throw new Error(`shader and geometry incompatible, geometry missing the "${n}" attribute`)}getSignature(e,t){let i=e.attributes,s=t._attributeData,n=["g",e.uid];for(let o in i)s[o]&&n.push(o,s[o].location);return n.join("-")}getVao(e,t){return this._geometryVaoHash[e.uid]?.[t._key]||this.initGeometryVao(e,t)}initGeometryVao(e,t,i=true){let s=this._renderer.gl,n=this._renderer.buffer;this._renderer.shader._getProgramData(t),this.checkCompatibility(e,t);let o=this.getSignature(e,t);this._geometryVaoHash[e.uid]||(this._geometryVaoHash[e.uid]=Object.create(null),e.on("destroy",this.onGeometryDestroy,this));let a=this._geometryVaoHash[e.uid],u=a[o];if(u)return a[t._key]=u,u;fl(e,t._attributeData);let l=e.buffers;u=s.createVertexArray(),s.bindVertexArray(u);for(let c=0;c<l.length;c++){let h=l[c];n.bind(h);}return this.activateVao(e,t),a[t._key]=u,a[o]=u,s.bindVertexArray(null),u}onGeometryDestroy(e,t){let i=this._geometryVaoHash[e.uid],s=this.gl;if(i){if(t)for(let n in i)this._activeVao!==i[n]&&this.unbind(),s.deleteVertexArray(i[n]);this._geometryVaoHash[e.uid]=null;}}destroyAll(e=false){let t=this.gl;for(let i in this._geometryVaoHash){if(e)for(let s in this._geometryVaoHash[i]){let n=this._geometryVaoHash[i];this._activeVao!==n&&this.unbind(),t.deleteVertexArray(n[s]);}this._geometryVaoHash[i]=null;}}activateVao(e,t){let i=this._renderer.gl,s=this._renderer.buffer,n=e.attributes;e.indexBuffer&&s.bind(e.indexBuffer);let o=null;for(let a in n){let u=n[a],l=u.buffer,c=s.getGlBuffer(l),h=t._attributeData[a];if(h){o!==c&&(s.bind(l),o=c);let d=h.location;i.enableVertexAttribArray(d);let p=$t(u.format),m=Ix(u.format);if(h.format?.substring(1,4)==="int"?i.vertexAttribIPointer(d,p.size,m,u.stride,u.offset):i.vertexAttribPointer(d,p.size,m,p.normalised,u.stride,u.offset),u.instance)if(this.hasInstance){let b=u.divisor??1;i.vertexAttribDivisor(d,b);}else throw new Error("geometry error, GPU Instancing is not supported on this device")}}}draw(e,t,i,s){let{gl:n}=this._renderer,o=this._activeGeometry,a=tO[e||o.topology];if(s??(s=o.instanceCount),o.indexBuffer){let u=o.indexBuffer.data.BYTES_PER_ELEMENT,l=u===2?n.UNSIGNED_SHORT:n.UNSIGNED_INT;s>1?n.drawElementsInstanced(a,t||o.indexBuffer.data.length,l,(i||0)*u,s):n.drawElements(a,t||o.indexBuffer.data.length,l,(i||0)*u);}else s>1?n.drawArraysInstanced(a,i||0,t||o.getSize(),s):n.drawArrays(a,i||0,t||o.getSize());return this}unbind(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null;}destroy(){this._renderer=null,this.gl=null,this._activeVao=null,this._activeGeometry=null;}};Ca.extension={type:[x.WebGLSystem],name:"geometry"};});var rO,S2,Dx,E2=f(()=>{B();Be();Ys();zr();Pr();Ct();ye();dr();rO=new jt({attributes:{aPosition:[-1,-1,3,-1,-1,3]}}),S2=class Qw{constructor(e){this.useBackBuffer=false,this._useBackBufferThisRender=false,this._renderer=e;}init(e={}){let{useBackBuffer:t,antialias:i}={...Qw.defaultOptions,...e};this.useBackBuffer=t,this._antialias=i,this._renderer.context.supports.msaa||(N("antialiasing, is not supported on when using the back buffer"),this._antialias=false),this._state=Qe.for2d();let s=new je({vertex:`
1886
1886
  attribute vec2 aPosition;
1887
1887
  out vec2 vUv;
1888
1888
 
@@ -1901,7 +1901,7 @@ fn mainFragment(
1901
1901
 
1902
1902
  void main() {
1903
1903
  finalColor = texture(uTexture, vUv);
1904
- }`,name:"big-triangle"});this._bigTriangleShader=new rt({glProgram:s,resources:{uTexture:exports.Texture.WHITE.source}});}renderStart(e){let t=this._renderer.renderTarget.getRenderTarget(e.target);if(this._useBackBufferThisRender=this.useBackBuffer&&!!t.isRoot,this._useBackBufferThisRender){let i=this._renderer.renderTarget.getRenderTarget(e.target);this._targetTexture=i.colorTexture,e.target=this._getBackBufferTexture(i.colorTexture);}}renderEnd(){this._presentBackBuffer();}_presentBackBuffer(){let e=this._renderer;e.renderTarget.finishRenderPass(),this._useBackBufferThisRender&&(e.renderTarget.bind(this._targetTexture,false),this._bigTriangleShader.resources.uTexture=this._backBufferTexture.source,e.encoder.draw({geometry:rO,shader:this._bigTriangleShader,state:this._state}));}_getBackBufferTexture(e){return this._backBufferTexture=this._backBufferTexture||new exports.Texture({source:new ge({width:e.width,height:e.height,resolution:e._resolution,antialias:this._antialias})}),this._backBufferTexture.source.resize(e.width,e.height,e._resolution),this._backBufferTexture}destroy(){this._backBufferTexture&&(this._backBufferTexture.destroy(),this._backBufferTexture=null);}};S2.extension={type:[x.WebGLSystem],name:"backBuffer",priority:1};S2.defaultOptions={useBackBuffer:false};Dx=S2;});var Aa,C2=f(()=>{B();Aa=class{constructor(e){this._colorMaskCache=15,this._renderer=e;}setMask(e){this._colorMaskCache!==e&&(this._colorMaskCache=e,this._renderer.gl.colorMask(!!(e&8),!!(e&4),!!(e&2),!!(e&1)));}};Aa.extension={type:[x.WebGLSystem],name:"colorMask"};});var Pa,A2=f(()=>{B();Pa=class{constructor(e){this.commandFinished=Promise.resolve(),this._renderer=e;}setGeometry(e,t){this._renderer.geometry.bind(e,t.glProgram);}finishRenderPass(){}draw(e){let t=this._renderer,{geometry:i,shader:s,state:n,skipSync:o,topology:a,size:u,start:l,instanceCount:c}=e;t.shader.bind(s,o),t.geometry.bind(i,t.shader._activeProgram),n&&t.state.set(n),t.geometry.draw(a,u,l,c??i.instanceCount);}destroy(){this._renderer=null;}};Pa.extension={type:[x.WebGLSystem],name:"encoder"};});var wa,P2=f(()=>{B();Hp();wa=class{constructor(e){this._renderer=e;}contextChange(){let e=this._renderer.gl;this.maxTextures=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),this.maxBatchableTextures=bu(this.maxTextures,e),this.maxUniformBindings=e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS);}destroy(){}};wa.extension={type:[x.WebGLSystem],name:"limits"};});var Ba,w2=f(()=>{B();Tx();Xs();Ba=class{constructor(e){this._stencilCache={enabled:false,stencilReference:0,stencilMode:He.NONE},this._renderTargetStencilState=Object.create(null),e.renderTarget.onRenderTargetChange.add(this);}contextChange(e){this._gl=e,this._comparisonFuncMapping={always:e.ALWAYS,never:e.NEVER,equal:e.EQUAL,"not-equal":e.NOTEQUAL,less:e.LESS,"less-equal":e.LEQUAL,greater:e.GREATER,"greater-equal":e.GEQUAL},this._stencilOpsMapping={keep:e.KEEP,zero:e.ZERO,replace:e.REPLACE,invert:e.INVERT,"increment-clamp":e.INCR,"decrement-clamp":e.DECR,"increment-wrap":e.INCR_WRAP,"decrement-wrap":e.DECR_WRAP},this.resetState();}onRenderTargetChange(e){if(this._activeRenderTarget===e)return;this._activeRenderTarget=e;let t=this._renderTargetStencilState[e.uid];t||(t=this._renderTargetStencilState[e.uid]={stencilMode:He.DISABLED,stencilReference:0}),this.setStencilMode(t.stencilMode,t.stencilReference);}resetState(){this._stencilCache.enabled=false,this._stencilCache.stencilMode=He.NONE,this._stencilCache.stencilReference=0;}setStencilMode(e,t){let i=this._renderTargetStencilState[this._activeRenderTarget.uid],s=this._gl,n=jr[e],o=this._stencilCache;if(i.stencilMode=e,i.stencilReference=t,e===He.DISABLED){this._stencilCache.enabled&&(this._stencilCache.enabled=false,s.disable(s.STENCIL_TEST));return}this._stencilCache.enabled||(this._stencilCache.enabled=true,s.enable(s.STENCIL_TEST)),(e!==o.stencilMode||o.stencilReference!==t)&&(o.stencilMode=e,o.stencilReference=t,s.stencilFunc(this._comparisonFuncMapping[n.stencilBack.compare],t,255),s.stencilOp(s.KEEP,s.KEEP,this._stencilOpsMapping[n.stencilBack.passOp]));}};Ba.extension={type:[x.WebGLSystem],name:"stencil"};});function kx(r){let e=r.map(n=>({data:n,offset:0,size:0})),t=16,i=0,s=0;for(let n=0;n<e.length;n++){let o=e[n];if(i=dd[o.data.type],!i)throw new Error(`Unknown type ${o.data.type}`);o.data.size>1&&(i=Math.max(i,t)*o.data.size);let a=i===12?16:i;o.size=i;let u=s%t;u>0&&t-u<a?s+=(t-u)%16:s+=(i-u%i)%i,o.offset=s,s+=i;}return s=Math.ceil(s/16)*16,{uboElements:e,size:s}}var dd,Ox=f(()=>{dd={f32:4,i32:4,"vec2<f32>":8,"vec3<f32>":12,"vec4<f32>":16,"vec2<i32>":8,"vec3<i32>":12,"vec4<i32>":16,"mat2x2<f32>":32,"mat3x3<f32>":48,"mat4x4<f32>":64};});function Fx(r,e){let t=Math.max(dd[r.data.type]/16,1),i=r.data.value.length/r.data.size,s=(4-i%4)%4,n=r.data.type.indexOf("i32")>=0?"dataInt32":"data";return `
1904
+ }`,name:"big-triangle"});this._bigTriangleShader=new rt({glProgram:s,resources:{uTexture:exports.Texture.WHITE.source}});}renderStart(e){let t=this._renderer.renderTarget.getRenderTarget(e.target);if(this._useBackBufferThisRender=this.useBackBuffer&&!!t.isRoot,this._useBackBufferThisRender){let i=this._renderer.renderTarget.getRenderTarget(e.target);this._targetTexture=i.colorTexture,e.target=this._getBackBufferTexture(i.colorTexture);}}renderEnd(){this._presentBackBuffer();}_presentBackBuffer(){let e=this._renderer;e.renderTarget.finishRenderPass(),this._useBackBufferThisRender&&(e.renderTarget.bind(this._targetTexture,false),this._bigTriangleShader.resources.uTexture=this._backBufferTexture.source,e.encoder.draw({geometry:rO,shader:this._bigTriangleShader,state:this._state}));}_getBackBufferTexture(e){return this._backBufferTexture=this._backBufferTexture||new exports.Texture({source:new ge({width:e.width,height:e.height,resolution:e._resolution,antialias:this._antialias})}),this._backBufferTexture.source.resize(e.width,e.height,e._resolution),this._backBufferTexture}destroy(){this._backBufferTexture&&(this._backBufferTexture.destroy(),this._backBufferTexture=null);}};S2.extension={type:[x.WebGLSystem],name:"backBuffer",priority:1};S2.defaultOptions={useBackBuffer:false};Dx=S2;});var Aa,C2=f(()=>{B();Aa=class{constructor(e){this._colorMaskCache=15,this._renderer=e;}setMask(e){this._colorMaskCache!==e&&(this._colorMaskCache=e,this._renderer.gl.colorMask(!!(e&8),!!(e&4),!!(e&2),!!(e&1)));}};Aa.extension={type:[x.WebGLSystem],name:"colorMask"};});var Pa,A2=f(()=>{B();Pa=class{constructor(e){this.commandFinished=Promise.resolve(),this._renderer=e;}setGeometry(e,t){this._renderer.geometry.bind(e,t.glProgram);}finishRenderPass(){}draw(e){let t=this._renderer,{geometry:i,shader:s,state:n,skipSync:o,topology:a,size:u,start:l,instanceCount:c}=e;t.shader.bind(s,o),t.geometry.bind(i,t.shader._activeProgram),n&&t.state.set(n),t.geometry.draw(a,u,l,c??i.instanceCount);}destroy(){this._renderer=null;}};Pa.extension={type:[x.WebGLSystem],name:"encoder"};});var wa,P2=f(()=>{B();Hp();wa=class{constructor(e){this._renderer=e;}contextChange(){let e=this._renderer.gl;this.maxTextures=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),this.maxBatchableTextures=bu(this.maxTextures,e),this.maxUniformBindings=e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS);}destroy(){}};wa.extension={type:[x.WebGLSystem],name:"limits"};});var Ba,w2=f(()=>{B();Tx();Xs();Ba=class{constructor(e){this._stencilCache={enabled:false,stencilReference:0,stencilMode:He.NONE},this._renderTargetStencilState=Object.create(null),e.renderTarget.onRenderTargetChange.add(this);}contextChange(e){this._gl=e,this._comparisonFuncMapping={always:e.ALWAYS,never:e.NEVER,equal:e.EQUAL,"not-equal":e.NOTEQUAL,less:e.LESS,"less-equal":e.LEQUAL,greater:e.GREATER,"greater-equal":e.GEQUAL},this._stencilOpsMapping={keep:e.KEEP,zero:e.ZERO,replace:e.REPLACE,invert:e.INVERT,"increment-clamp":e.INCR,"decrement-clamp":e.DECR,"increment-wrap":e.INCR_WRAP,"decrement-wrap":e.DECR_WRAP},this.resetState();}onRenderTargetChange(e){if(this._activeRenderTarget===e)return;this._activeRenderTarget=e;let t=this._renderTargetStencilState[e.uid];t||(t=this._renderTargetStencilState[e.uid]={stencilMode:He.DISABLED,stencilReference:0}),this.setStencilMode(t.stencilMode,t.stencilReference);}resetState(){this._stencilCache.enabled=false,this._stencilCache.stencilMode=He.NONE,this._stencilCache.stencilReference=0;}setStencilMode(e,t){let i=this._renderTargetStencilState[this._activeRenderTarget.uid],s=this._gl,n=Yr[e],o=this._stencilCache;if(i.stencilMode=e,i.stencilReference=t,e===He.DISABLED){this._stencilCache.enabled&&(this._stencilCache.enabled=false,s.disable(s.STENCIL_TEST));return}this._stencilCache.enabled||(this._stencilCache.enabled=true,s.enable(s.STENCIL_TEST)),(e!==o.stencilMode||o.stencilReference!==t)&&(o.stencilMode=e,o.stencilReference=t,s.stencilFunc(this._comparisonFuncMapping[n.stencilBack.compare],t,255),s.stencilOp(s.KEEP,s.KEEP,this._stencilOpsMapping[n.stencilBack.passOp]));}};Ba.extension={type:[x.WebGLSystem],name:"stencil"};});function kx(r){let e=r.map(n=>({data:n,offset:0,size:0})),t=16,i=0,s=0;for(let n=0;n<e.length;n++){let o=e[n];if(i=dd[o.data.type],!i)throw new Error(`Unknown type ${o.data.type}`);o.data.size>1&&(i=Math.max(i,t)*o.data.size);let a=i===12?16:i;o.size=i;let u=s%t;u>0&&t-u<a?s+=(t-u)%16:s+=(i-u%i)%i,o.offset=s,s+=i;}return s=Math.ceil(s/16)*16,{uboElements:e,size:s}}var dd,Ox=f(()=>{dd={f32:4,i32:4,"vec2<f32>":8,"vec3<f32>":12,"vec4<f32>":16,"vec2<i32>":8,"vec3<i32>":12,"vec4<i32>":16,"mat2x2<f32>":32,"mat3x3<f32>":48,"mat4x4<f32>":64};});function Fx(r,e){let t=Math.max(dd[r.data.type]/16,1),i=r.data.value.length/r.data.size,s=(4-i%4)%4,n=r.data.type.indexOf("i32")>=0?"dataInt32":"data";return `
1905
1905
  v = uv.${r.data.name};
1906
1906
  offset += ${e};
1907
1907
 
@@ -2037,8 +2037,8 @@ fn mainFragment(
2037
2037
  cv = cu.value;
2038
2038
  v = uv["${i}"];
2039
2039
  ${a};`);}}return new Function("ud","uv","renderer","syncData",t.join(`
2040
- `))}var Y2=f(()=>{ud();ht();mx();X2();});var Da,j2=f(()=>{B();Y2();Da=class{constructor(e){this._cache={},this._uniformGroupSyncHash={},this._renderer=e,this.gl=null,this._cache={};}contextChange(e){this.gl=e;}updateUniformGroup(e,t,i){let s=this._renderer.shader._getProgramData(t);(!e.isStatic||e._dirtyId!==s.uniformDirtyGroups[e.uid])&&(s.uniformDirtyGroups[e.uid]=e._dirtyId,this._getUniformSyncFunction(e,t)(s.uniformData,e.uniforms,this._renderer,i));}_getUniformSyncFunction(e,t){return this._uniformGroupSyncHash[e._signature]?.[t._key]||this._createUniformSyncFunction(e,t)}_createUniformSyncFunction(e,t){let i=this._uniformGroupSyncHash[e._signature]||(this._uniformGroupSyncHash[e._signature]={}),s=this._getSignature(e,t._uniformData,"u");return this._cache[s]||(this._cache[s]=this._generateUniformsSync(e,t._uniformData)),i[t._key]=this._cache[s],i[t._key]}_generateUniformsSync(e,t){return Qx(e,t)}_getSignature(e,t,i){let s=e.uniforms,n=[`${i}-`];for(let o in s)n.push(o),t[o]&&n.push(t[o].type);return n.join("-")}destroy(){this._renderer=null,this._cache=null;}};Da.extension={type:[x.WebGLSystem],name:"uniformGroup"};});function Jx(r){let e={};if(e.normal=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e.add=[r.ONE,r.ONE],e.multiply=[r.DST_COLOR,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA],e.screen=[r.ONE,r.ONE_MINUS_SRC_COLOR,r.ONE,r.ONE_MINUS_SRC_ALPHA],e.none=[0,0],e["normal-npm"]=[r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA],e["add-npm"]=[r.SRC_ALPHA,r.ONE,r.ONE,r.ONE],e["screen-npm"]=[r.SRC_ALPHA,r.ONE_MINUS_SRC_COLOR,r.ONE,r.ONE_MINUS_SRC_ALPHA],e.erase=[r.ZERO,r.ONE_MINUS_SRC_ALPHA],!(r instanceof j.get().getWebGLRenderingContext()))e.min=[r.ONE,r.ONE,r.ONE,r.ONE,r.MIN,r.MIN],e.max=[r.ONE,r.ONE,r.ONE,r.ONE,r.MAX,r.MAX];else {let i=r.getExtension("EXT_blend_minmax");i&&(e.min=[r.ONE,r.ONE,r.ONE,r.ONE,i.MIN_EXT,i.MIN_EXT],e.max=[r.ONE,r.ONE,r.ONE,r.ONE,i.MAX_EXT,i.MAX_EXT]);}return e}var $2=f(()=>{Ge();});var sO,nO,oO,aO,uO,lO,t3,e_,K2=f(()=>{B();Pr();$2();sO=0,nO=1,oO=2,aO=3,uO=4,lO=5,t3=class q2{constructor(e){this._invertFrontFace=false,this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode="none",this._blendEq=false,this.map=[],this.map[sO]=this.setBlend,this.map[nO]=this.setOffset,this.map[oO]=this.setCullFace,this.map[aO]=this.setDepthTest,this.map[uO]=this.setFrontFace,this.map[lO]=this.setDepthMask,this.checks=[],this.defaultState=Qe.for2d(),e.renderTarget.onRenderTargetChange.add(this);}onRenderTargetChange(e){this._invertFrontFace=!e.isRoot,this._cullFace?this.setFrontFace(this._frontFace):this._frontFaceDirty=true;}contextChange(e){this.gl=e,this.blendModesMap=Jx(e),this.resetState();}set(e){if(e||(e=this.defaultState),this.stateId!==e.data){let t=this.stateId^e.data,i=0;for(;t;)t&1&&this.map[i].call(this,!!(e.data&1<<i)),t>>=1,i++;this.stateId=e.data;}for(let t=0;t<this.checks.length;t++)this.checks[t](this,e);}forceState(e){e||(e=this.defaultState);for(let t=0;t<this.map.length;t++)this.map[t].call(this,!!(e.data&1<<t));for(let t=0;t<this.checks.length;t++)this.checks[t](this,e);this.stateId=e.data;}setBlend(e){this._updateCheck(q2._checkBlendMode,e),this.gl[e?"enable":"disable"](this.gl.BLEND);}setOffset(e){this._updateCheck(q2._checkPolygonOffset,e),this.gl[e?"enable":"disable"](this.gl.POLYGON_OFFSET_FILL);}setDepthTest(e){this.gl[e?"enable":"disable"](this.gl.DEPTH_TEST);}setDepthMask(e){this.gl.depthMask(e);}setCullFace(e){this._cullFace=e,this.gl[e?"enable":"disable"](this.gl.CULL_FACE),this._cullFace&&this._frontFaceDirty&&this.setFrontFace(this._frontFace);}setFrontFace(e){this._frontFace=e,this._frontFaceDirty=false;let t=this._invertFrontFace?!e:e;this._glFrontFace!==t&&(this._glFrontFace=t,this.gl.frontFace(this.gl[t?"CW":"CCW"]));}setBlendMode(e){if(this.blendModesMap[e]||(e="normal"),e===this.blendMode)return;this.blendMode=e;let t=this.blendModesMap[e],i=this.gl;t.length===2?i.blendFunc(t[0],t[1]):i.blendFuncSeparate(t[0],t[1],t[2],t[3]),t.length===6?(this._blendEq=true,i.blendEquationSeparate(t[4],t[5])):this._blendEq&&(this._blendEq=false,i.blendEquationSeparate(i.FUNC_ADD,i.FUNC_ADD));}setPolygonOffset(e,t){this.gl.polygonOffset(e,t);}resetState(){this._glFrontFace=false,this._frontFace=false,this._cullFace=false,this._frontFaceDirty=false,this._invertFrontFace=false,this.gl.frontFace(this.gl.CCW),this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,false),this.forceState(this.defaultState),this._blendEq=true,this.blendMode="",this.setBlendMode("normal");}_updateCheck(e,t){let i=this.checks.indexOf(e);t&&i===-1?this.checks.push(e):!t&&i!==-1&&this.checks.splice(i,1);}static _checkBlendMode(e,t){e.setBlendMode(t.blendMode);}static _checkPolygonOffset(e,t){e.setPolygonOffset(1,t.polygonOffset);}destroy(){this.gl=null,this.checks.length=0;}};t3.extension={type:[x.WebGLSystem],name:"state"};e_=t3;});var El,Z2=f(()=>{Mx();El=class{constructor(e){this.target=hd.TEXTURE_2D,this.texture=e,this.width=-1,this.height=-1,this.type=Ee.UNSIGNED_BYTE,this.internalFormat=bl.RGBA,this.format=bl.RGBA,this.samplerType=0;}};});var t_,Q2=f(()=>{t_={id:"buffer",upload(r,e,t){e.width===r.width||e.height===r.height?t.texSubImage2D(t.TEXTURE_2D,0,0,0,r.width,r.height,e.format,e.type,r.resource):t.texImage2D(e.target,0,e.internalFormat,r.width,r.height,0,e.format,e.type,r.resource),e.width=r.width,e.height=r.height;}};});var cO,r_,J2=f(()=>{cO={"bc1-rgba-unorm":true,"bc1-rgba-unorm-srgb":true,"bc2-rgba-unorm":true,"bc2-rgba-unorm-srgb":true,"bc3-rgba-unorm":true,"bc3-rgba-unorm-srgb":true,"bc4-r-unorm":true,"bc4-r-snorm":true,"bc5-rg-unorm":true,"bc5-rg-snorm":true,"bc6h-rgb-ufloat":true,"bc6h-rgb-float":true,"bc7-rgba-unorm":true,"bc7-rgba-unorm-srgb":true,"etc2-rgb8unorm":true,"etc2-rgb8unorm-srgb":true,"etc2-rgb8a1unorm":true,"etc2-rgb8a1unorm-srgb":true,"etc2-rgba8unorm":true,"etc2-rgba8unorm-srgb":true,"eac-r11unorm":true,"eac-r11snorm":true,"eac-rg11unorm":true,"eac-rg11snorm":true,"astc-4x4-unorm":true,"astc-4x4-unorm-srgb":true,"astc-5x4-unorm":true,"astc-5x4-unorm-srgb":true,"astc-5x5-unorm":true,"astc-5x5-unorm-srgb":true,"astc-6x5-unorm":true,"astc-6x5-unorm-srgb":true,"astc-6x6-unorm":true,"astc-6x6-unorm-srgb":true,"astc-8x5-unorm":true,"astc-8x5-unorm-srgb":true,"astc-8x6-unorm":true,"astc-8x6-unorm-srgb":true,"astc-8x8-unorm":true,"astc-8x8-unorm-srgb":true,"astc-10x5-unorm":true,"astc-10x5-unorm-srgb":true,"astc-10x6-unorm":true,"astc-10x6-unorm-srgb":true,"astc-10x8-unorm":true,"astc-10x8-unorm-srgb":true,"astc-10x10-unorm":true,"astc-10x10-unorm-srgb":true,"astc-12x10-unorm":true,"astc-12x10-unorm-srgb":true,"astc-12x12-unorm":true,"astc-12x12-unorm-srgb":true},r_={id:"compressed",upload(r,e,t){t.pixelStorei(t.UNPACK_ALIGNMENT,4);let i=r.pixelWidth,s=r.pixelHeight,n=!!cO[r.format];for(let o=0;o<r.resource.length;o++){let a=r.resource[o];n?t.compressedTexImage2D(t.TEXTURE_2D,o,e.internalFormat,i,s,0,a):t.texImage2D(t.TEXTURE_2D,o,e.internalFormat,i,s,0,e.format,e.type,a),i=Math.max(i>>1,1),s=Math.max(s>>1,1);}}};});var Cl,i_=f(()=>{Cl={id:"image",upload(r,e,t,i){let s=e.width,n=e.height,o=r.pixelWidth,a=r.pixelHeight,u=r.resourceWidth,l=r.resourceHeight;u<o||l<a?((s!==o||n!==a)&&t.texImage2D(e.target,0,e.internalFormat,o,a,0,e.format,e.type,null),i===2?t.texSubImage2D(t.TEXTURE_2D,0,0,0,u,l,e.format,e.type,r.resource):t.texSubImage2D(t.TEXTURE_2D,0,0,0,e.format,e.type,r.resource)):s===o&&n===a?t.texSubImage2D(t.TEXTURE_2D,0,0,0,e.format,e.type,r.resource):i===2?t.texImage2D(e.target,0,e.internalFormat,o,a,0,e.format,e.type,r.resource):t.texImage2D(e.target,0,e.internalFormat,e.format,e.type,r.resource),e.width=o,e.height=a;}};});var s_,eE=f(()=>{i_();s_={id:"video",upload(r,e,t,i){if(!r.isValid){t.texImage2D(e.target,0,e.internalFormat,1,1,0,e.format,e.type,null);return}Cl.upload(r,e,t,i);}};});var md,n_,Al,o_,tE=f(()=>{md={linear:9729,nearest:9728},n_={linear:{linear:9987,nearest:9985},nearest:{linear:9986,nearest:9984}},Al={"clamp-to-edge":33071,repeat:10497,"mirror-repeat":33648},o_={never:512,less:513,equal:514,"less-equal":515,greater:516,"not-equal":517,"greater-equal":518,always:519};});function gd(r,e,t,i,s,n,o,a){let u=n;if(!a||r.addressModeU!=="repeat"||r.addressModeV!=="repeat"||r.addressModeW!=="repeat"){let l=Al[o?"clamp-to-edge":r.addressModeU],c=Al[o?"clamp-to-edge":r.addressModeV],h=Al[o?"clamp-to-edge":r.addressModeW];e[s](u,e.TEXTURE_WRAP_S,l),e[s](u,e.TEXTURE_WRAP_T,c),e.TEXTURE_WRAP_R&&e[s](u,e.TEXTURE_WRAP_R,h);}if((!a||r.magFilter!=="linear")&&e[s](u,e.TEXTURE_MAG_FILTER,md[r.magFilter]),t){if(!a||r.mipmapFilter!=="linear"){let l=n_[r.minFilter][r.mipmapFilter];e[s](u,e.TEXTURE_MIN_FILTER,l);}}else e[s](u,e.TEXTURE_MIN_FILTER,md[r.minFilter]);if(i&&r.maxAnisotropy>1){let l=Math.min(r.maxAnisotropy,e.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY_EXT));e[s](u,i.TEXTURE_MAX_ANISOTROPY_EXT,l);}r.compare&&e[s](u,e.TEXTURE_COMPARE_FUNC,o_[r.compare]);}var rE=f(()=>{tE();});function a_(r){return {r8unorm:r.RED,r8snorm:r.RED,r8uint:r.RED,r8sint:r.RED,r16uint:r.RED,r16sint:r.RED,r16float:r.RED,rg8unorm:r.RG,rg8snorm:r.RG,rg8uint:r.RG,rg8sint:r.RG,r32uint:r.RED,r32sint:r.RED,r32float:r.RED,rg16uint:r.RG,rg16sint:r.RG,rg16float:r.RG,rgba8unorm:r.RGBA,"rgba8unorm-srgb":r.RGBA,rgba8snorm:r.RGBA,rgba8uint:r.RGBA,rgba8sint:r.RGBA,bgra8unorm:r.RGBA,"bgra8unorm-srgb":r.RGBA,rgb9e5ufloat:r.RGB,rgb10a2unorm:r.RGBA,rg11b10ufloat:r.RGB,rg32uint:r.RG,rg32sint:r.RG,rg32float:r.RG,rgba16uint:r.RGBA,rgba16sint:r.RGBA,rgba16float:r.RGBA,rgba32uint:r.RGBA,rgba32sint:r.RGBA,rgba32float:r.RGBA,stencil8:r.STENCIL_INDEX8,depth16unorm:r.DEPTH_COMPONENT,depth24plus:r.DEPTH_COMPONENT,"depth24plus-stencil8":r.DEPTH_STENCIL,depth32float:r.DEPTH_COMPONENT,"depth32float-stencil8":r.DEPTH_STENCIL}}var iE=f(()=>{});function u_(r,e){let t={},i=r.RGBA;return r instanceof j.get().getWebGLRenderingContext()?e.srgb&&(t={"rgba8unorm-srgb":e.srgb.SRGB8_ALPHA8_EXT,"bgra8unorm-srgb":e.srgb.SRGB8_ALPHA8_EXT}):(t={"rgba8unorm-srgb":r.SRGB8_ALPHA8,"bgra8unorm-srgb":r.SRGB8_ALPHA8},i=r.RGBA8),{r8unorm:r.R8,r8snorm:r.R8_SNORM,r8uint:r.R8UI,r8sint:r.R8I,r16uint:r.R16UI,r16sint:r.R16I,r16float:r.R16F,rg8unorm:r.RG8,rg8snorm:r.RG8_SNORM,rg8uint:r.RG8UI,rg8sint:r.RG8I,r32uint:r.R32UI,r32sint:r.R32I,r32float:r.R32F,rg16uint:r.RG16UI,rg16sint:r.RG16I,rg16float:r.RG16F,rgba8unorm:r.RGBA,...t,rgba8snorm:r.RGBA8_SNORM,rgba8uint:r.RGBA8UI,rgba8sint:r.RGBA8I,bgra8unorm:i,rgb9e5ufloat:r.RGB9_E5,rgb10a2unorm:r.RGB10_A2,rg11b10ufloat:r.R11F_G11F_B10F,rg32uint:r.RG32UI,rg32sint:r.RG32I,rg32float:r.RG32F,rgba16uint:r.RGBA16UI,rgba16sint:r.RGBA16I,rgba16float:r.RGBA16F,rgba32uint:r.RGBA32UI,rgba32sint:r.RGBA32I,rgba32float:r.RGBA32F,stencil8:r.STENCIL_INDEX8,depth16unorm:r.DEPTH_COMPONENT16,depth24plus:r.DEPTH_COMPONENT24,"depth24plus-stencil8":r.DEPTH24_STENCIL8,depth32float:r.DEPTH_COMPONENT32F,"depth32float-stencil8":r.DEPTH32F_STENCIL8,...e.s3tc?{"bc1-rgba-unorm":e.s3tc.COMPRESSED_RGBA_S3TC_DXT1_EXT,"bc2-rgba-unorm":e.s3tc.COMPRESSED_RGBA_S3TC_DXT3_EXT,"bc3-rgba-unorm":e.s3tc.COMPRESSED_RGBA_S3TC_DXT5_EXT}:{},...e.s3tc_sRGB?{"bc1-rgba-unorm-srgb":e.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,"bc2-rgba-unorm-srgb":e.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,"bc3-rgba-unorm-srgb":e.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}:{},...e.rgtc?{"bc4-r-unorm":e.rgtc.COMPRESSED_RED_RGTC1_EXT,"bc4-r-snorm":e.rgtc.COMPRESSED_SIGNED_RED_RGTC1_EXT,"bc5-rg-unorm":e.rgtc.COMPRESSED_RED_GREEN_RGTC2_EXT,"bc5-rg-snorm":e.rgtc.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}:{},...e.bptc?{"bc6h-rgb-float":e.bptc.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,"bc6h-rgb-ufloat":e.bptc.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,"bc7-rgba-unorm":e.bptc.COMPRESSED_RGBA_BPTC_UNORM_EXT,"bc7-rgba-unorm-srgb":e.bptc.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT}:{},...e.etc?{"etc2-rgb8unorm":e.etc.COMPRESSED_RGB8_ETC2,"etc2-rgb8unorm-srgb":e.etc.COMPRESSED_SRGB8_ETC2,"etc2-rgb8a1unorm":e.etc.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,"etc2-rgb8a1unorm-srgb":e.etc.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,"etc2-rgba8unorm":e.etc.COMPRESSED_RGBA8_ETC2_EAC,"etc2-rgba8unorm-srgb":e.etc.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,"eac-r11unorm":e.etc.COMPRESSED_R11_EAC,"eac-rg11unorm":e.etc.COMPRESSED_SIGNED_RG11_EAC}:{},...e.astc?{"astc-4x4-unorm":e.astc.COMPRESSED_RGBA_ASTC_4x4_KHR,"astc-4x4-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,"astc-5x4-unorm":e.astc.COMPRESSED_RGBA_ASTC_5x4_KHR,"astc-5x4-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR,"astc-5x5-unorm":e.astc.COMPRESSED_RGBA_ASTC_5x5_KHR,"astc-5x5-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,"astc-6x5-unorm":e.astc.COMPRESSED_RGBA_ASTC_6x5_KHR,"astc-6x5-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,"astc-6x6-unorm":e.astc.COMPRESSED_RGBA_ASTC_6x6_KHR,"astc-6x6-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,"astc-8x5-unorm":e.astc.COMPRESSED_RGBA_ASTC_8x5_KHR,"astc-8x5-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,"astc-8x6-unorm":e.astc.COMPRESSED_RGBA_ASTC_8x6_KHR,"astc-8x6-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,"astc-8x8-unorm":e.astc.COMPRESSED_RGBA_ASTC_8x8_KHR,"astc-8x8-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,"astc-10x5-unorm":e.astc.COMPRESSED_RGBA_ASTC_10x5_KHR,"astc-10x5-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,"astc-10x6-unorm":e.astc.COMPRESSED_RGBA_ASTC_10x6_KHR,"astc-10x6-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,"astc-10x8-unorm":e.astc.COMPRESSED_RGBA_ASTC_10x8_KHR,"astc-10x8-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,"astc-10x10-unorm":e.astc.COMPRESSED_RGBA_ASTC_10x10_KHR,"astc-10x10-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,"astc-12x10-unorm":e.astc.COMPRESSED_RGBA_ASTC_12x10_KHR,"astc-12x10-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,"astc-12x12-unorm":e.astc.COMPRESSED_RGBA_ASTC_12x12_KHR,"astc-12x12-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR}:{}}}var sE=f(()=>{Ge();});function l_(r){return {r8unorm:r.UNSIGNED_BYTE,r8snorm:r.BYTE,r8uint:r.UNSIGNED_BYTE,r8sint:r.BYTE,r16uint:r.UNSIGNED_SHORT,r16sint:r.SHORT,r16float:r.HALF_FLOAT,rg8unorm:r.UNSIGNED_BYTE,rg8snorm:r.BYTE,rg8uint:r.UNSIGNED_BYTE,rg8sint:r.BYTE,r32uint:r.UNSIGNED_INT,r32sint:r.INT,r32float:r.FLOAT,rg16uint:r.UNSIGNED_SHORT,rg16sint:r.SHORT,rg16float:r.HALF_FLOAT,rgba8unorm:r.UNSIGNED_BYTE,"rgba8unorm-srgb":r.UNSIGNED_BYTE,rgba8snorm:r.BYTE,rgba8uint:r.UNSIGNED_BYTE,rgba8sint:r.BYTE,bgra8unorm:r.UNSIGNED_BYTE,"bgra8unorm-srgb":r.UNSIGNED_BYTE,rgb9e5ufloat:r.UNSIGNED_INT_5_9_9_9_REV,rgb10a2unorm:r.UNSIGNED_INT_2_10_10_10_REV,rg11b10ufloat:r.UNSIGNED_INT_10F_11F_11F_REV,rg32uint:r.UNSIGNED_INT,rg32sint:r.INT,rg32float:r.FLOAT,rgba16uint:r.UNSIGNED_SHORT,rgba16sint:r.SHORT,rgba16float:r.HALF_FLOAT,rgba32uint:r.UNSIGNED_INT,rgba32sint:r.INT,rgba32float:r.FLOAT,stencil8:r.UNSIGNED_BYTE,depth16unorm:r.UNSIGNED_SHORT,depth24plus:r.UNSIGNED_INT,"depth24plus-stencil8":r.UNSIGNED_INT_24_8,depth32float:r.FLOAT,"depth32float-stencil8":r.FLOAT_32_UNSIGNED_INT_24_8_REV}}var nE=f(()=>{});function r3(r){r instanceof Uint8ClampedArray&&(r=new Uint8Array(r.buffer));let e=r.length;for(let t=0;t<e;t+=4){let i=r[t+3];if(i!==0){let s=255.001/i;r[t]=r[t]*s+.5,r[t+1]=r[t+1]*s+.5,r[t+2]=r[t+2]*s+.5;}}}var i3=f(()=>{});var hO,ka,oE=f(()=>{Ge();B();ye();Z2();Q2();J2();i_();eE();rE();iE();sE();nE();hO=4,ka=class{constructor(e){this.managedTextures=[],this._glTextures=Object.create(null),this._glSamplers=Object.create(null),this._boundTextures=[],this._activeTextureLocation=-1,this._boundSamplers=Object.create(null),this._uploads={image:Cl,buffer:t_,video:s_,compressed:r_},this._premultiplyAlpha=false,this._useSeparateSamplers=false,this._renderer=e,this._renderer.renderableGC.addManagedHash(this,"_glTextures"),this._renderer.renderableGC.addManagedHash(this,"_glSamplers");}contextChange(e){this._gl=e,this._mapFormatToInternalFormat||(this._mapFormatToInternalFormat=u_(e,this._renderer.context.extensions),this._mapFormatToType=l_(e),this._mapFormatToFormat=a_(e)),this._glTextures=Object.create(null),this._glSamplers=Object.create(null),this._boundSamplers=Object.create(null),this._premultiplyAlpha=false;for(let t=0;t<16;t++)this.bind(exports.Texture.EMPTY,t);}initSource(e){this.bind(e);}bind(e,t=0){let i=e.source;e?(this.bindSource(i,t),this._useSeparateSamplers&&this._bindSampler(i.style,t)):(this.bindSource(null,t),this._useSeparateSamplers&&this._bindSampler(null,t));}bindSource(e,t=0){let i=this._gl;if(e._touched=this._renderer.textureGC.count,this._boundTextures[t]!==e){this._boundTextures[t]=e,this._activateLocation(t),e||(e=exports.Texture.EMPTY.source);let s=this.getGlSource(e);i.bindTexture(s.target,s.texture);}}_bindSampler(e,t=0){let i=this._gl;if(!e){this._boundSamplers[t]=null,i.bindSampler(t,null);return}let s=this._getGlSampler(e);this._boundSamplers[t]!==s&&(this._boundSamplers[t]=s,i.bindSampler(t,s));}unbind(e){let t=e.source,i=this._boundTextures,s=this._gl;for(let n=0;n<i.length;n++)if(i[n]===t){this._activateLocation(n);let o=this.getGlSource(t);s.bindTexture(o.target,null),i[n]=null;}}_activateLocation(e){this._activeTextureLocation!==e&&(this._activeTextureLocation=e,this._gl.activeTexture(this._gl.TEXTURE0+e));}_initSource(e){let t=this._gl,i=new El(t.createTexture());if(i.type=this._mapFormatToType[e.format],i.internalFormat=this._mapFormatToInternalFormat[e.format],i.format=this._mapFormatToFormat[e.format],e.autoGenerateMipmaps&&(this._renderer.context.supports.nonPowOf2mipmaps||e.isPowerOfTwo)){let s=Math.max(e.width,e.height);e.mipLevelCount=Math.floor(Math.log2(s))+1;}return this._glTextures[e.uid]=i,this.managedTextures.includes(e)||(e.on("update",this.onSourceUpdate,this),e.on("resize",this.onSourceUpdate,this),e.on("styleChange",this.onStyleChange,this),e.on("destroy",this.onSourceDestroy,this),e.on("unload",this.onSourceUnload,this),e.on("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.push(e)),this.onSourceUpdate(e),this.updateStyle(e,false),i}onStyleChange(e){this.updateStyle(e,false);}updateStyle(e,t){let i=this._gl,s=this.getGlSource(e);i.bindTexture(i.TEXTURE_2D,s.texture),this._boundTextures[this._activeTextureLocation]=e,gd(e.style,i,e.mipLevelCount>1,this._renderer.context.extensions.anisotropicFiltering,"texParameteri",i.TEXTURE_2D,!this._renderer.context.supports.nonPowOf2wrapping&&!e.isPowerOfTwo,t);}onSourceUnload(e){let t=this._glTextures[e.uid];t&&(this.unbind(e),this._glTextures[e.uid]=null,this._gl.deleteTexture(t.texture));}onSourceUpdate(e){let t=this._gl,i=this.getGlSource(e);t.bindTexture(t.TEXTURE_2D,i.texture),this._boundTextures[this._activeTextureLocation]=e;let s=e.alphaMode==="premultiply-alpha-on-upload";this._premultiplyAlpha!==s&&(this._premultiplyAlpha=s,t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,s)),this._uploads[e.uploadMethodId]?this._uploads[e.uploadMethodId].upload(e,i,t,this._renderer.context.webGLVersion):t.texImage2D(t.TEXTURE_2D,0,t.RGBA,e.pixelWidth,e.pixelHeight,0,t.RGBA,t.UNSIGNED_BYTE,null),e.autoGenerateMipmaps&&e.mipLevelCount>1&&this.onUpdateMipmaps(e,false);}onUpdateMipmaps(e,t=true){t&&this.bindSource(e,0);let i=this.getGlSource(e);this._gl.generateMipmap(i.target);}onSourceDestroy(e){e.off("destroy",this.onSourceDestroy,this),e.off("update",this.onSourceUpdate,this),e.off("resize",this.onSourceUpdate,this),e.off("unload",this.onSourceUnload,this),e.off("styleChange",this.onStyleChange,this),e.off("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.splice(this.managedTextures.indexOf(e),1),this.onSourceUnload(e);}_initSampler(e){let t=this._gl,i=this._gl.createSampler();return this._glSamplers[e._resourceId]=i,gd(e,t,this._boundTextures[this._activeTextureLocation].mipLevelCount>1,this._renderer.context.extensions.anisotropicFiltering,"samplerParameteri",i,false,true),this._glSamplers[e._resourceId]}_getGlSampler(e){return this._glSamplers[e._resourceId]||this._initSampler(e)}getGlSource(e){return this._glTextures[e.uid]||this._initSource(e)}generateCanvas(e){let{pixels:t,width:i,height:s}=this.getPixels(e),n=j.get().createCanvas();n.width=i,n.height=s;let o=n.getContext("2d");if(o){let a=o.createImageData(i,s);a.data.set(t),o.putImageData(a,0,0);}return n}getPixels(e){let t=e.source.resolution,i=e.frame,s=Math.max(Math.round(i.width*t),1),n=Math.max(Math.round(i.height*t),1),o=new Uint8Array(hO*s*n),a=this._renderer,u=a.renderTarget.getRenderTarget(e),l=a.renderTarget.getGpuRenderTarget(u),c=a.gl;return c.bindFramebuffer(c.FRAMEBUFFER,l.resolveTargetFramebuffer),c.readPixels(Math.round(i.x*t),Math.round(i.y*t),s,n,c.RGBA,c.UNSIGNED_BYTE,o),{pixels:new Uint8ClampedArray(o.buffer),width:s,height:n}}destroy(){this.managedTextures.slice().forEach(e=>this.onSourceDestroy(e)),this.managedTextures=null,this._renderer=null;}resetState(){this._activeTextureLocation=-1,this._boundTextures.fill(exports.Texture.EMPTY.source),this._boundSamplers=Object.create(null);let e=this._gl;this._premultiplyAlpha=false,e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this._premultiplyAlpha);}};ka.extension={type:[x.WebGLSystem],name:"texture"};});var a3={};Zi(a3,{WebGLRenderer:()=>xd});var dO,fO,pO,s3,n3,o3,xd,aE=f(()=>{B();d2();f2();p2();tl();hx();Ar();x2();b2();T2();E2();C2();A2();P2();w2();M2();k2();W2();j2();K2();oE();dO=[...ul,Ra,Dx,Rx,wa,Ea,ka,Ma,Ca,Da,Ia,Pa,e_,Ba,Aa],fO=[...ll],pO=[Ta,va,ya],s3=[],n3=[],o3=[];V.handleByNamedList(x.WebGLSystem,s3);V.handleByNamedList(x.WebGLPipes,n3);V.handleByNamedList(x.WebGLPipesAdaptor,o3);V.add(...dO,...fO,...pO);xd=class extends Di{constructor(){let e={name:"webgl",type:qe.WEBGL,systems:s3,renderPipes:n3,renderPipeAdaptors:o3};super(e);}};});async function c_(r){let e=[];r.preference?(e.push(r.preference),u3.forEach(n=>{n!==r.preference&&e.push(n);})):e=u3.slice();let t,i={};for(let n=0;n<e.length;n++){let o=e[n];if(o==="webgpu"&&await Oi()){let{WebGPURenderer:a}=await Promise.resolve().then(()=>(h2(),qw));t=a,i={...r,...r.webgpu};break}else if(o==="webgl"&&ki(r.failIfMajorPerformanceCaveat??Di.defaultOptions.failIfMajorPerformanceCaveat)){let{WebGLRenderer:a}=await Promise.resolve().then(()=>(aE(),a3));t=a,i={...r,...r.webgl};break}else if(o==="canvas")throw i={...r},new Error("CanvasRenderer is not yet implemented")}if(delete i.webgpu,delete i.webgl,!t)throw new Error("No available renderer for the current environment");let s=new t;return await s.init(i),s}var u3,uE=f(()=>{rl();il();tl();u3=["webgl","webgpu","canvas"];});var l3,_d,c3=f(()=>{B();uE();hr();Qg();Pe();l3=class lE{constructor(...e){this.stage=new exports.PixiJSContainer,e[0]!==void 0&&U(Y,"Application constructor options are deprecated, please use Application.init() instead.");}async init(e){e={...e},this.renderer=await c_(e),lE._plugins.forEach(t=>{t.init.call(this,e);});}render(){this.renderer.render({container:this.stage});}get canvas(){return this.renderer.canvas}get view(){return U(Y,"Application.view is deprecated, please use Application.canvas instead."),this.renderer.canvas}get screen(){return this.renderer.screen}destroy(e=false,t=false){let i=lE._plugins.slice(0);i.reverse(),i.forEach(s=>{s.destroy.call(this);}),this.stage.destroy(t),this.stage=null,this.renderer.destroy(e),this.renderer=null;}};l3._plugins=[];_d=l3;V.handleByList(x.Application,_d._plugins);V.add(Ko);});var Oa,cE=f(()=>{ct();ye();dg();Ah();Oa=class extends hn{constructor(e,t){super();let{textures:i,data:s}=e;Object.keys(s.pages).forEach(n=>{let o=s.pages[parseInt(n,10)],a=i[o.id];this.pages.push({texture:a});}),Object.keys(s.chars).forEach(n=>{let o=s.chars[n],{frame:a,source:u}=i[o.page],l=new exports.Rectangle(o.x+a.x,o.y+a.y,o.width,o.height),c=new exports.Texture({source:u,frame:l});this.chars[n]={id:n.codePointAt(0),xOffset:o.xOffset,yOffset:o.yOffset,xAdvance:o.xAdvance,kerning:o.kerning??{},texture:c};}),this.baseRenderedFontSize=s.fontSize,this.baseMeasurementFontSize=s.fontSize,this.fontMetrics={ascent:0,descent:0,fontSize:s.fontSize},this.baseLineOffset=s.baseLineOffset,this.lineHeight=s.lineHeight,this.fontFamily=s.fontFamily,this.distanceField=s.distanceField??{type:"none",range:0},this.url=t;}destroy(){super.destroy();for(let e=0;e<this.pages.length;e++){let{texture:t}=this.pages[e];t.destroy(true);}this.pages=null;}static install(e){fs.install(e);}static uninstall(e){fs.uninstall(e);}};});var Pl,hE=f(()=>{Pl={test(r){return typeof r=="string"&&r.startsWith("info face=")},parse(r){let e=r.match(/^[a-z]+\s+.+$/gm),t={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[],distanceField:[]};for(let h in e){let d=e[h].match(/^[a-z]+/gm)[0],p=e[h].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),m={};for(let b in p){let _=p[b].split("="),g=_[0],y=_[1].replace(/"/gm,""),S=parseFloat(y),E=isNaN(S)?y:S;m[g]=E;}t[d].push(m);}let i={chars:{},pages:[],lineHeight:0,fontSize:0,fontFamily:"",distanceField:null,baseLineOffset:0},[s]=t.info,[n]=t.common,[o]=t.distanceField??[];o&&(i.distanceField={range:parseInt(o.distanceRange,10),type:o.fieldType}),i.fontSize=parseInt(s.size,10),i.fontFamily=s.face,i.lineHeight=parseInt(n.lineHeight,10);let a=t.page;for(let h=0;h<a.length;h++)i.pages.push({id:parseInt(a[h].id,10)||0,file:a[h].file});let u={};i.baseLineOffset=i.lineHeight-parseInt(n.base,10);let l=t.char;for(let h=0;h<l.length;h++){let d=l[h],p=parseInt(d.id,10),m=d.letter??d.char??String.fromCharCode(p);m==="space"&&(m=" "),u[p]=m,i.chars[m]={id:p,page:parseInt(d.page,10)||0,x:parseInt(d.x,10),y:parseInt(d.y,10),width:parseInt(d.width,10),height:parseInt(d.height,10),xOffset:parseInt(d.xoffset,10),yOffset:parseInt(d.yoffset,10),xAdvance:parseInt(d.xadvance,10),kerning:{}};}let c=t.kerning||[];for(let h=0;h<c.length;h++){let d=parseInt(c[h].first,10),p=parseInt(c[h].second,10),m=parseInt(c[h].amount,10);i.chars[u[p]].kerning[u[d]]=m;}return i}};});var bd,dE=f(()=>{bd={test(r){let e=r;return typeof e!="string"&&"getElementsByTagName"in e&&e.getElementsByTagName("page").length&&e.getElementsByTagName("info")[0].getAttribute("face")!==null},parse(r){let e={chars:{},pages:[],lineHeight:0,fontSize:0,fontFamily:"",distanceField:null,baseLineOffset:0},t=r.getElementsByTagName("info")[0],i=r.getElementsByTagName("common")[0],s=r.getElementsByTagName("distanceField")[0];s&&(e.distanceField={type:s.getAttribute("fieldType"),range:parseInt(s.getAttribute("distanceRange"),10)});let n=r.getElementsByTagName("page"),o=r.getElementsByTagName("char"),a=r.getElementsByTagName("kerning");e.fontSize=parseInt(t.getAttribute("size"),10),e.fontFamily=t.getAttribute("face"),e.lineHeight=parseInt(i.getAttribute("lineHeight"),10);for(let l=0;l<n.length;l++)e.pages.push({id:parseInt(n[l].getAttribute("id"),10)||0,file:n[l].getAttribute("file")});let u={};e.baseLineOffset=e.lineHeight-parseInt(i.getAttribute("base"),10);for(let l=0;l<o.length;l++){let c=o[l],h=parseInt(c.getAttribute("id"),10),d=c.getAttribute("letter")??c.getAttribute("char")??String.fromCharCode(h);d==="space"&&(d=" "),u[h]=d,e.chars[d]={id:h,page:parseInt(c.getAttribute("page"),10)||0,x:parseInt(c.getAttribute("x"),10),y:parseInt(c.getAttribute("y"),10),width:parseInt(c.getAttribute("width"),10),height:parseInt(c.getAttribute("height"),10),xOffset:parseInt(c.getAttribute("xoffset"),10),yOffset:parseInt(c.getAttribute("yoffset"),10),xAdvance:parseInt(c.getAttribute("xadvance"),10),kerning:{}};}for(let l=0;l<a.length;l++){let c=parseInt(a[l].getAttribute("first"),10),h=parseInt(a[l].getAttribute("second"),10),d=parseInt(a[l].getAttribute("amount"),10);e.chars[u[h]].kerning[u[c]]=d;}return e}};});var yd,fE=f(()=>{Ge();dE();yd={test(r){return typeof r=="string"&&r.includes("<font>")?bd.test(j.get().parseXML(r)):false},parse(r){return bd.parse(j.get().parseXML(r))}};});var mO,h_,d_,pE=f(()=>{Er();wp();Ge();B();Us();cE();hE();fE();mO=[".xml",".fnt"],h_={extension:{type:x.CacheParser,name:"cacheBitmapFont"},test:r=>r instanceof Oa,getCacheableAssets(r,e){let t={};return r.forEach(i=>{t[i]=e,t[`${i}-bitmap`]=e;}),t[`${e.fontFamily}-bitmap`]=e,t}},d_={extension:{type:x.LoadParser,priority:ze.Normal},name:"loadBitmapFont",test(r){return mO.includes(We.extname(r).toLowerCase())},async testParse(r){return Pl.test(r)||yd.test(r)},async parse(r,e,t){let i=Pl.test(r)?Pl.parse(r):yd.parse(r),{src:s}=e,{pages:n}=i,o=[],a=i.distanceField?{scaleMode:"linear",alphaMode:"premultiply-alpha-on-upload",autoGenerateMipmaps:false,resolution:1}:{};for(let h=0;h<n.length;++h){let d=n[h].file,p=We.join(We.dirname(s),d);p=ao(p,s),o.push({src:p,data:a});}let u=await t.load(o),l=o.map(h=>u[h.src]);return new Oa({data:i,textures:l},s)},async load(r,e){return await(await j.get().fetch(r)).text()},async unload(r,e,t){await Promise.all(r.pages.map(i=>t.unload(i.texture.source._sourceOrigin))),r.destroy();}};});var wl,mE=f(()=>{wl=class{constructor(e,t=false){this._loader=e,this._assetList=[],this._isLoading=false,this._maxConcurrent=1,this.verbose=t;}add(e){e.forEach(t=>{this._assetList.push(t);}),this.verbose&&console.log("[BackgroundLoader] assets: ",this._assetList),this._isActive&&!this._isLoading&&this._next();}async _next(){if(this._assetList.length&&this._isActive){this._isLoading=true;let e=[],t=Math.min(this._assetList.length,this._maxConcurrent);for(let i=0;i<t;i++)e.push(this._assetList.pop());await this._loader.load(e),this._isLoading=false,this._next();}}get active(){return this._isActive}set active(e){this._isActive!==e&&(this._isActive=e,e&&!this._isLoading&&this._next());}};});var f_,gE=f(()=>{B();ye();f_={extension:{type:x.CacheParser,name:"cacheTextureArray"},test:r=>Array.isArray(r)&&r.every(e=>e instanceof exports.Texture),getCacheableAssets:(r,e)=>{let t={};return r.forEach(i=>{e.forEach((s,n)=>{t[i+(n===0?"":n+1)]=s;});}),t}};});async function Bl(r){if("Image"in globalThis)return new Promise(e=>{let t=new Image;t.onload=()=>{e(true);},t.onerror=()=>{e(false);},t.src=r;});if("createImageBitmap"in globalThis&&"fetch"in globalThis){try{let e=await(await fetch(r)).blob();await createImageBitmap(e);}catch{return false}return true}return false}var p_=f(()=>{});var m_,xE=f(()=>{B();p_();m_={extension:{type:x.DetectionParser,priority:1},test:async()=>Bl("data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A="),add:async r=>[...r,"avif"],remove:async r=>r.filter(e=>e!=="avif")};});var h3,g_,_E=f(()=>{B();h3=["png","jpg","jpeg"],g_={extension:{type:x.DetectionParser,priority:-1},test:()=>Promise.resolve(true),add:async r=>[...r,...h3],remove:async r=>r.filter(e=>!h3.includes(e))};});function An(r){return gO?false:document.createElement("video").canPlayType(r)!==""}var gO,vd=f(()=>{gO="WorkerGlobalScope"in globalThis&&globalThis instanceof globalThis.WorkerGlobalScope;});var x_,bE=f(()=>{B();vd();x_={extension:{type:x.DetectionParser,priority:0},test:async()=>An("video/mp4"),add:async r=>[...r,"mp4","m4v"],remove:async r=>r.filter(e=>e!=="mp4"&&e!=="m4v")};});var __,yE=f(()=>{B();vd();__={extension:{type:x.DetectionParser,priority:0},test:async()=>An("video/ogg"),add:async r=>[...r,"ogv"],remove:async r=>r.filter(e=>e!=="ogv")};});var b_,vE=f(()=>{B();vd();b_={extension:{type:x.DetectionParser,priority:0},test:async()=>An("video/webm"),add:async r=>[...r,"webm"],remove:async r=>r.filter(e=>e!=="webm")};});var y_,TE=f(()=>{B();p_();y_={extension:{type:x.DetectionParser,priority:0},test:async()=>Bl("data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA="),add:async r=>[...r,"webp"],remove:async r=>r.filter(e=>e!=="webp")};});var Rl,SE=f(()=>{Be();Us();pu();Xc();Rl=class{constructor(){this._parsers=[],this._parsersValidated=false,this.parsers=new Proxy(this._parsers,{set:(e,t,i)=>(this._parsersValidated=false,e[t]=i,true)}),this.promiseCache={};}reset(){this._parsersValidated=false,this.promiseCache={};}_getLoadPromiseAndParser(e,t){let i={promise:null,parser:null};return i.promise=(async()=>{let s=null,n=null;if(t.loadParser&&(n=this._parserHash[t.loadParser],n||N(`[Assets] specified load parser "${t.loadParser}" not found while loading ${e}`)),!n){for(let o=0;o<this.parsers.length;o++){let a=this.parsers[o];if(a.load&&a.test?.(e,t,this)){n=a;break}}if(!n)return N(`[Assets] ${e} could not be loaded as we don't know how to parse it, ensure the correct parser has been added`),null}s=await n.load(e,t,this),i.parser=n;for(let o=0;o<this.parsers.length;o++){let a=this.parsers[o];a.parse&&a.parse&&await a.testParse?.(s,t,this)&&(s=await a.parse(s,t,this)||s,i.parser=a);}return s})(),i}async load(e,t){this._parsersValidated||this._validateParsers();let i=0,s={},n=ss(e),o=Ht(e,l=>({alias:[l],src:l,data:{}})),a=o.length,u=o.map(async l=>{let c=We.toAbsolute(l.src);if(!s[l.src])try{this.promiseCache[c]||(this.promiseCache[c]=this._getLoadPromiseAndParser(c,l)),s[l.src]=await this.promiseCache[c].promise,t&&t(++i/a);}catch(h){throw delete this.promiseCache[c],delete s[l.src],new Error(`[Loader.load] Failed to load ${c}.
2041
- ${h}`)}});return await Promise.all(u),n?s[o[0].src]:s}async unload(e){let i=Ht(e,s=>({alias:[s],src:s})).map(async s=>{let n=We.toAbsolute(s.src),o=this.promiseCache[n];if(o){let a=await o.promise;delete this.promiseCache[n],await o.parser?.unload?.(a,s,this);}});await Promise.all(i);}_validateParsers(){this._parsersValidated=true,this._parserHash=this._parsers.filter(e=>e.name).reduce((e,t)=>(t.name?e[t.name]&&N(`[Assets] loadParser name conflict "${t.name}"`):N("[Assets] loadParser should have a name"),{...e,[t.name]:t}),{});}};});function pr(r,e){if(Array.isArray(e)){for(let t of e)if(r.startsWith(`data:${t}`))return true;return false}return r.startsWith(`data:${e}`)}var Pn=f(()=>{});function it(r,e){let t=r.split("?")[0],i=We.extname(t).toLowerCase();return Array.isArray(e)?e.includes(i):i===e}var wr=f(()=>{Us();});var xO,_O,v_,EE=f(()=>{Ge();B();Pn();wr();Er();xO=".json",_O="application/json",v_={extension:{type:x.LoadParser,priority:ze.Low},name:"loadJson",test(r){return pr(r,_O)||it(r,xO)},async load(r){return await(await j.get().fetch(r)).json()}};});var bO,yO,T_,CE=f(()=>{Ge();B();Pn();wr();Er();bO=".txt",yO="text/plain",T_={name:"loadTxt",extension:{type:x.LoadParser,priority:ze.Low,name:"loadTxt"},test(r){return pr(r,yO)||it(r,bO)},async load(r){return await(await j.get().fetch(r)).text()}};});function AE(r){let e=We.extname(r),s=We.basename(r,e).replace(/(-|_)/g," ").toLowerCase().split(" ").map(a=>a.charAt(0).toUpperCase()+a.slice(1)),n=s.length>0;for(let a of s)if(!a.match(EO)){n=false;break}let o=s.join(" ");return n||(o=`"${o.replace(/[\\"]/g,"\\$&")}"`),o}function AO(r){return CO.test(r)?r:encodeURI(r)}var vO,TO,SO,EO,CO,S_,PE=f(()=>{Ge();B();Be();Us();Ai();Pn();wr();Er();vO=["normal","bold","100","200","300","400","500","600","700","800","900"],TO=[".ttf",".otf",".woff",".woff2"],SO=["font/ttf","font/otf","font/woff","font/woff2"],EO=/^(--|-?[A-Z_])[0-9A-Z_-]*$/i;CO=/^[0-9A-Za-z%:/?#\[\]@!\$&'()\*\+,;=\-._~]*$/;S_={extension:{type:x.LoadParser,priority:ze.Low},name:"loadWebFont",test(r){return pr(r,SO)||it(r,TO)},async load(r,e){let t=j.get().getFontFaceSet();if(t){let i=[],s=e.data?.family??AE(r),n=e.data?.weights?.filter(a=>vO.includes(a))??["normal"],o=e.data??{};for(let a=0;a<n.length;a++){let u=n[a],l=new FontFace(s,`url(${AO(r)})`,{...o,weight:u});await l.load(),t.add(l),i.push(l);}return Se.set(`${s}-and-url`,{url:r,fontFaces:i}),i.length===1?i[0]:i}return N("[loadWebFont] FontFace API is not supported. Skipping loading font"),null},unload(r){(Array.isArray(r)?r:[r]).forEach(e=>{Se.remove(`${e.family}-and-url`),j.get().getFontFaceSet().delete(e);});}};});function wn(r,e=1){let t=Vt.RETINA_PREFIX?.exec(r);return t?parseFloat(t[1]):e}var Td=f(()=>{Ls();});function Kt(r,e,t){r.label=t,r._sourceOrigin=t;let i=new exports.Texture({source:r,label:t}),s=()=>{delete e.promiseCache[t],Se.has(t)&&Se.remove(t);};return i.source.once("destroy",()=>{e.promiseCache[t]&&(N("[Assets] A TextureSource managed by Assets was destroyed instead of unloaded! Use Assets.unload() instead of destroying the TextureSource."),s());}),i.once("destroy",()=>{r.destroyed||(N("[Assets] A Texture managed by Assets was destroyed instead of unloaded! Use Assets.unload() instead of destroying the Texture."),s());}),i}var ms=f(()=>{ye();Be();Ai();});async function BO(r,e,t,i){let n=await(await j.get().fetch(r)).blob(),o=URL.createObjectURL(n),a=new Image;a.src=o,a.crossOrigin=i,await a.decode(),URL.revokeObjectURL(o);let u=document.createElement("canvas"),l=u.getContext("2d"),c=e.data?.resolution||wn(r),h=e.data?.width??a.width,d=e.data?.height??a.height;u.width=h*c,u.height=d*c,l.drawImage(a,0,0,h*c,d*c);let{parseAsGraphicsContext:p,...m}=e.data??{},b=new Yt({resource:u,alphaMode:"premultiply-alpha-on-upload",resolution:c,...m});return Kt(b,t,r)}async function RO(r){let t=await(await j.get().fetch(r)).text(),i=new dt;return i.svg(t),i}var PO,wO,E_,wE=f(()=>{Ge();B();fo();Po();Td();Pn();wr();Er();ms();PO=".svg",wO="image/svg+xml",E_={extension:{type:x.LoadParser,priority:ze.Low,name:"loadSVG"},name:"loadSVG",config:{crossOrigin:"anonymous",parseAsGraphicsContext:false},test(r){return pr(r,wO)||it(r,PO)},async load(r,e,t){return e.data?.parseAsGraphicsContext??this.config.parseAsGraphicsContext?RO(r):BO(r,e,t,this.config.crossOrigin)},unload(r){r.destroy(true);}};});var MO,Ml,Il,d3=f(()=>{MO=`(function () {
2040
+ `))}var Y2=f(()=>{ud();ht();mx();X2();});var Da,j2=f(()=>{B();Y2();Da=class{constructor(e){this._cache={},this._uniformGroupSyncHash={},this._renderer=e,this.gl=null,this._cache={};}contextChange(e){this.gl=e;}updateUniformGroup(e,t,i){let s=this._renderer.shader._getProgramData(t);(!e.isStatic||e._dirtyId!==s.uniformDirtyGroups[e.uid])&&(s.uniformDirtyGroups[e.uid]=e._dirtyId,this._getUniformSyncFunction(e,t)(s.uniformData,e.uniforms,this._renderer,i));}_getUniformSyncFunction(e,t){return this._uniformGroupSyncHash[e._signature]?.[t._key]||this._createUniformSyncFunction(e,t)}_createUniformSyncFunction(e,t){let i=this._uniformGroupSyncHash[e._signature]||(this._uniformGroupSyncHash[e._signature]={}),s=this._getSignature(e,t._uniformData,"u");return this._cache[s]||(this._cache[s]=this._generateUniformsSync(e,t._uniformData)),i[t._key]=this._cache[s],i[t._key]}_generateUniformsSync(e,t){return Qx(e,t)}_getSignature(e,t,i){let s=e.uniforms,n=[`${i}-`];for(let o in s)n.push(o),t[o]&&n.push(t[o].type);return n.join("-")}destroy(){this._renderer=null,this._cache=null;}};Da.extension={type:[x.WebGLSystem],name:"uniformGroup"};});function Jx(r){let e={};if(e.normal=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e.add=[r.ONE,r.ONE],e.multiply=[r.DST_COLOR,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA],e.screen=[r.ONE,r.ONE_MINUS_SRC_COLOR,r.ONE,r.ONE_MINUS_SRC_ALPHA],e.none=[0,0],e["normal-npm"]=[r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA],e["add-npm"]=[r.SRC_ALPHA,r.ONE,r.ONE,r.ONE],e["screen-npm"]=[r.SRC_ALPHA,r.ONE_MINUS_SRC_COLOR,r.ONE,r.ONE_MINUS_SRC_ALPHA],e.erase=[r.ZERO,r.ONE_MINUS_SRC_ALPHA],!(r instanceof j.get().getWebGLRenderingContext()))e.min=[r.ONE,r.ONE,r.ONE,r.ONE,r.MIN,r.MIN],e.max=[r.ONE,r.ONE,r.ONE,r.ONE,r.MAX,r.MAX];else {let i=r.getExtension("EXT_blend_minmax");i&&(e.min=[r.ONE,r.ONE,r.ONE,r.ONE,i.MIN_EXT,i.MIN_EXT],e.max=[r.ONE,r.ONE,r.ONE,r.ONE,i.MAX_EXT,i.MAX_EXT]);}return e}var $2=f(()=>{Fe();});var sO,nO,oO,aO,uO,lO,t3,e_,K2=f(()=>{B();Pr();$2();sO=0,nO=1,oO=2,aO=3,uO=4,lO=5,t3=class q2{constructor(e){this._invertFrontFace=false,this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode="none",this._blendEq=false,this.map=[],this.map[sO]=this.setBlend,this.map[nO]=this.setOffset,this.map[oO]=this.setCullFace,this.map[aO]=this.setDepthTest,this.map[uO]=this.setFrontFace,this.map[lO]=this.setDepthMask,this.checks=[],this.defaultState=Qe.for2d(),e.renderTarget.onRenderTargetChange.add(this);}onRenderTargetChange(e){this._invertFrontFace=!e.isRoot,this._cullFace?this.setFrontFace(this._frontFace):this._frontFaceDirty=true;}contextChange(e){this.gl=e,this.blendModesMap=Jx(e),this.resetState();}set(e){if(e||(e=this.defaultState),this.stateId!==e.data){let t=this.stateId^e.data,i=0;for(;t;)t&1&&this.map[i].call(this,!!(e.data&1<<i)),t>>=1,i++;this.stateId=e.data;}for(let t=0;t<this.checks.length;t++)this.checks[t](this,e);}forceState(e){e||(e=this.defaultState);for(let t=0;t<this.map.length;t++)this.map[t].call(this,!!(e.data&1<<t));for(let t=0;t<this.checks.length;t++)this.checks[t](this,e);this.stateId=e.data;}setBlend(e){this._updateCheck(q2._checkBlendMode,e),this.gl[e?"enable":"disable"](this.gl.BLEND);}setOffset(e){this._updateCheck(q2._checkPolygonOffset,e),this.gl[e?"enable":"disable"](this.gl.POLYGON_OFFSET_FILL);}setDepthTest(e){this.gl[e?"enable":"disable"](this.gl.DEPTH_TEST);}setDepthMask(e){this.gl.depthMask(e);}setCullFace(e){this._cullFace=e,this.gl[e?"enable":"disable"](this.gl.CULL_FACE),this._cullFace&&this._frontFaceDirty&&this.setFrontFace(this._frontFace);}setFrontFace(e){this._frontFace=e,this._frontFaceDirty=false;let t=this._invertFrontFace?!e:e;this._glFrontFace!==t&&(this._glFrontFace=t,this.gl.frontFace(this.gl[t?"CW":"CCW"]));}setBlendMode(e){if(this.blendModesMap[e]||(e="normal"),e===this.blendMode)return;this.blendMode=e;let t=this.blendModesMap[e],i=this.gl;t.length===2?i.blendFunc(t[0],t[1]):i.blendFuncSeparate(t[0],t[1],t[2],t[3]),t.length===6?(this._blendEq=true,i.blendEquationSeparate(t[4],t[5])):this._blendEq&&(this._blendEq=false,i.blendEquationSeparate(i.FUNC_ADD,i.FUNC_ADD));}setPolygonOffset(e,t){this.gl.polygonOffset(e,t);}resetState(){this._glFrontFace=false,this._frontFace=false,this._cullFace=false,this._frontFaceDirty=false,this._invertFrontFace=false,this.gl.frontFace(this.gl.CCW),this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,false),this.forceState(this.defaultState),this._blendEq=true,this.blendMode="",this.setBlendMode("normal");}_updateCheck(e,t){let i=this.checks.indexOf(e);t&&i===-1?this.checks.push(e):!t&&i!==-1&&this.checks.splice(i,1);}static _checkBlendMode(e,t){e.setBlendMode(t.blendMode);}static _checkPolygonOffset(e,t){e.setPolygonOffset(1,t.polygonOffset);}destroy(){this.gl=null,this.checks.length=0;}};t3.extension={type:[x.WebGLSystem],name:"state"};e_=t3;});var El,Z2=f(()=>{Mx();El=class{constructor(e){this.target=hd.TEXTURE_2D,this.texture=e,this.width=-1,this.height=-1,this.type=Ee.UNSIGNED_BYTE,this.internalFormat=bl.RGBA,this.format=bl.RGBA,this.samplerType=0;}};});var t_,Q2=f(()=>{t_={id:"buffer",upload(r,e,t){e.width===r.width||e.height===r.height?t.texSubImage2D(t.TEXTURE_2D,0,0,0,r.width,r.height,e.format,e.type,r.resource):t.texImage2D(e.target,0,e.internalFormat,r.width,r.height,0,e.format,e.type,r.resource),e.width=r.width,e.height=r.height;}};});var cO,r_,J2=f(()=>{cO={"bc1-rgba-unorm":true,"bc1-rgba-unorm-srgb":true,"bc2-rgba-unorm":true,"bc2-rgba-unorm-srgb":true,"bc3-rgba-unorm":true,"bc3-rgba-unorm-srgb":true,"bc4-r-unorm":true,"bc4-r-snorm":true,"bc5-rg-unorm":true,"bc5-rg-snorm":true,"bc6h-rgb-ufloat":true,"bc6h-rgb-float":true,"bc7-rgba-unorm":true,"bc7-rgba-unorm-srgb":true,"etc2-rgb8unorm":true,"etc2-rgb8unorm-srgb":true,"etc2-rgb8a1unorm":true,"etc2-rgb8a1unorm-srgb":true,"etc2-rgba8unorm":true,"etc2-rgba8unorm-srgb":true,"eac-r11unorm":true,"eac-r11snorm":true,"eac-rg11unorm":true,"eac-rg11snorm":true,"astc-4x4-unorm":true,"astc-4x4-unorm-srgb":true,"astc-5x4-unorm":true,"astc-5x4-unorm-srgb":true,"astc-5x5-unorm":true,"astc-5x5-unorm-srgb":true,"astc-6x5-unorm":true,"astc-6x5-unorm-srgb":true,"astc-6x6-unorm":true,"astc-6x6-unorm-srgb":true,"astc-8x5-unorm":true,"astc-8x5-unorm-srgb":true,"astc-8x6-unorm":true,"astc-8x6-unorm-srgb":true,"astc-8x8-unorm":true,"astc-8x8-unorm-srgb":true,"astc-10x5-unorm":true,"astc-10x5-unorm-srgb":true,"astc-10x6-unorm":true,"astc-10x6-unorm-srgb":true,"astc-10x8-unorm":true,"astc-10x8-unorm-srgb":true,"astc-10x10-unorm":true,"astc-10x10-unorm-srgb":true,"astc-12x10-unorm":true,"astc-12x10-unorm-srgb":true,"astc-12x12-unorm":true,"astc-12x12-unorm-srgb":true},r_={id:"compressed",upload(r,e,t){t.pixelStorei(t.UNPACK_ALIGNMENT,4);let i=r.pixelWidth,s=r.pixelHeight,n=!!cO[r.format];for(let o=0;o<r.resource.length;o++){let a=r.resource[o];n?t.compressedTexImage2D(t.TEXTURE_2D,o,e.internalFormat,i,s,0,a):t.texImage2D(t.TEXTURE_2D,o,e.internalFormat,i,s,0,e.format,e.type,a),i=Math.max(i>>1,1),s=Math.max(s>>1,1);}}};});var Cl,i_=f(()=>{Cl={id:"image",upload(r,e,t,i){let s=e.width,n=e.height,o=r.pixelWidth,a=r.pixelHeight,u=r.resourceWidth,l=r.resourceHeight;u<o||l<a?((s!==o||n!==a)&&t.texImage2D(e.target,0,e.internalFormat,o,a,0,e.format,e.type,null),i===2?t.texSubImage2D(t.TEXTURE_2D,0,0,0,u,l,e.format,e.type,r.resource):t.texSubImage2D(t.TEXTURE_2D,0,0,0,e.format,e.type,r.resource)):s===o&&n===a?t.texSubImage2D(t.TEXTURE_2D,0,0,0,e.format,e.type,r.resource):i===2?t.texImage2D(e.target,0,e.internalFormat,o,a,0,e.format,e.type,r.resource):t.texImage2D(e.target,0,e.internalFormat,e.format,e.type,r.resource),e.width=o,e.height=a;}};});var s_,eE=f(()=>{i_();s_={id:"video",upload(r,e,t,i){if(!r.isValid){t.texImage2D(e.target,0,e.internalFormat,1,1,0,e.format,e.type,null);return}Cl.upload(r,e,t,i);}};});var md,n_,Al,o_,tE=f(()=>{md={linear:9729,nearest:9728},n_={linear:{linear:9987,nearest:9985},nearest:{linear:9986,nearest:9984}},Al={"clamp-to-edge":33071,repeat:10497,"mirror-repeat":33648},o_={never:512,less:513,equal:514,"less-equal":515,greater:516,"not-equal":517,"greater-equal":518,always:519};});function gd(r,e,t,i,s,n,o,a){let u=n;if(!a||r.addressModeU!=="repeat"||r.addressModeV!=="repeat"||r.addressModeW!=="repeat"){let l=Al[o?"clamp-to-edge":r.addressModeU],c=Al[o?"clamp-to-edge":r.addressModeV],h=Al[o?"clamp-to-edge":r.addressModeW];e[s](u,e.TEXTURE_WRAP_S,l),e[s](u,e.TEXTURE_WRAP_T,c),e.TEXTURE_WRAP_R&&e[s](u,e.TEXTURE_WRAP_R,h);}if((!a||r.magFilter!=="linear")&&e[s](u,e.TEXTURE_MAG_FILTER,md[r.magFilter]),t){if(!a||r.mipmapFilter!=="linear"){let l=n_[r.minFilter][r.mipmapFilter];e[s](u,e.TEXTURE_MIN_FILTER,l);}}else e[s](u,e.TEXTURE_MIN_FILTER,md[r.minFilter]);if(i&&r.maxAnisotropy>1){let l=Math.min(r.maxAnisotropy,e.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY_EXT));e[s](u,i.TEXTURE_MAX_ANISOTROPY_EXT,l);}r.compare&&e[s](u,e.TEXTURE_COMPARE_FUNC,o_[r.compare]);}var rE=f(()=>{tE();});function a_(r){return {r8unorm:r.RED,r8snorm:r.RED,r8uint:r.RED,r8sint:r.RED,r16uint:r.RED,r16sint:r.RED,r16float:r.RED,rg8unorm:r.RG,rg8snorm:r.RG,rg8uint:r.RG,rg8sint:r.RG,r32uint:r.RED,r32sint:r.RED,r32float:r.RED,rg16uint:r.RG,rg16sint:r.RG,rg16float:r.RG,rgba8unorm:r.RGBA,"rgba8unorm-srgb":r.RGBA,rgba8snorm:r.RGBA,rgba8uint:r.RGBA,rgba8sint:r.RGBA,bgra8unorm:r.RGBA,"bgra8unorm-srgb":r.RGBA,rgb9e5ufloat:r.RGB,rgb10a2unorm:r.RGBA,rg11b10ufloat:r.RGB,rg32uint:r.RG,rg32sint:r.RG,rg32float:r.RG,rgba16uint:r.RGBA,rgba16sint:r.RGBA,rgba16float:r.RGBA,rgba32uint:r.RGBA,rgba32sint:r.RGBA,rgba32float:r.RGBA,stencil8:r.STENCIL_INDEX8,depth16unorm:r.DEPTH_COMPONENT,depth24plus:r.DEPTH_COMPONENT,"depth24plus-stencil8":r.DEPTH_STENCIL,depth32float:r.DEPTH_COMPONENT,"depth32float-stencil8":r.DEPTH_STENCIL}}var iE=f(()=>{});function u_(r,e){let t={},i=r.RGBA;return r instanceof j.get().getWebGLRenderingContext()?e.srgb&&(t={"rgba8unorm-srgb":e.srgb.SRGB8_ALPHA8_EXT,"bgra8unorm-srgb":e.srgb.SRGB8_ALPHA8_EXT}):(t={"rgba8unorm-srgb":r.SRGB8_ALPHA8,"bgra8unorm-srgb":r.SRGB8_ALPHA8},i=r.RGBA8),{r8unorm:r.R8,r8snorm:r.R8_SNORM,r8uint:r.R8UI,r8sint:r.R8I,r16uint:r.R16UI,r16sint:r.R16I,r16float:r.R16F,rg8unorm:r.RG8,rg8snorm:r.RG8_SNORM,rg8uint:r.RG8UI,rg8sint:r.RG8I,r32uint:r.R32UI,r32sint:r.R32I,r32float:r.R32F,rg16uint:r.RG16UI,rg16sint:r.RG16I,rg16float:r.RG16F,rgba8unorm:r.RGBA,...t,rgba8snorm:r.RGBA8_SNORM,rgba8uint:r.RGBA8UI,rgba8sint:r.RGBA8I,bgra8unorm:i,rgb9e5ufloat:r.RGB9_E5,rgb10a2unorm:r.RGB10_A2,rg11b10ufloat:r.R11F_G11F_B10F,rg32uint:r.RG32UI,rg32sint:r.RG32I,rg32float:r.RG32F,rgba16uint:r.RGBA16UI,rgba16sint:r.RGBA16I,rgba16float:r.RGBA16F,rgba32uint:r.RGBA32UI,rgba32sint:r.RGBA32I,rgba32float:r.RGBA32F,stencil8:r.STENCIL_INDEX8,depth16unorm:r.DEPTH_COMPONENT16,depth24plus:r.DEPTH_COMPONENT24,"depth24plus-stencil8":r.DEPTH24_STENCIL8,depth32float:r.DEPTH_COMPONENT32F,"depth32float-stencil8":r.DEPTH32F_STENCIL8,...e.s3tc?{"bc1-rgba-unorm":e.s3tc.COMPRESSED_RGBA_S3TC_DXT1_EXT,"bc2-rgba-unorm":e.s3tc.COMPRESSED_RGBA_S3TC_DXT3_EXT,"bc3-rgba-unorm":e.s3tc.COMPRESSED_RGBA_S3TC_DXT5_EXT}:{},...e.s3tc_sRGB?{"bc1-rgba-unorm-srgb":e.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,"bc2-rgba-unorm-srgb":e.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,"bc3-rgba-unorm-srgb":e.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}:{},...e.rgtc?{"bc4-r-unorm":e.rgtc.COMPRESSED_RED_RGTC1_EXT,"bc4-r-snorm":e.rgtc.COMPRESSED_SIGNED_RED_RGTC1_EXT,"bc5-rg-unorm":e.rgtc.COMPRESSED_RED_GREEN_RGTC2_EXT,"bc5-rg-snorm":e.rgtc.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}:{},...e.bptc?{"bc6h-rgb-float":e.bptc.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,"bc6h-rgb-ufloat":e.bptc.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,"bc7-rgba-unorm":e.bptc.COMPRESSED_RGBA_BPTC_UNORM_EXT,"bc7-rgba-unorm-srgb":e.bptc.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT}:{},...e.etc?{"etc2-rgb8unorm":e.etc.COMPRESSED_RGB8_ETC2,"etc2-rgb8unorm-srgb":e.etc.COMPRESSED_SRGB8_ETC2,"etc2-rgb8a1unorm":e.etc.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,"etc2-rgb8a1unorm-srgb":e.etc.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,"etc2-rgba8unorm":e.etc.COMPRESSED_RGBA8_ETC2_EAC,"etc2-rgba8unorm-srgb":e.etc.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,"eac-r11unorm":e.etc.COMPRESSED_R11_EAC,"eac-rg11unorm":e.etc.COMPRESSED_SIGNED_RG11_EAC}:{},...e.astc?{"astc-4x4-unorm":e.astc.COMPRESSED_RGBA_ASTC_4x4_KHR,"astc-4x4-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,"astc-5x4-unorm":e.astc.COMPRESSED_RGBA_ASTC_5x4_KHR,"astc-5x4-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR,"astc-5x5-unorm":e.astc.COMPRESSED_RGBA_ASTC_5x5_KHR,"astc-5x5-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,"astc-6x5-unorm":e.astc.COMPRESSED_RGBA_ASTC_6x5_KHR,"astc-6x5-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,"astc-6x6-unorm":e.astc.COMPRESSED_RGBA_ASTC_6x6_KHR,"astc-6x6-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,"astc-8x5-unorm":e.astc.COMPRESSED_RGBA_ASTC_8x5_KHR,"astc-8x5-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,"astc-8x6-unorm":e.astc.COMPRESSED_RGBA_ASTC_8x6_KHR,"astc-8x6-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,"astc-8x8-unorm":e.astc.COMPRESSED_RGBA_ASTC_8x8_KHR,"astc-8x8-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,"astc-10x5-unorm":e.astc.COMPRESSED_RGBA_ASTC_10x5_KHR,"astc-10x5-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,"astc-10x6-unorm":e.astc.COMPRESSED_RGBA_ASTC_10x6_KHR,"astc-10x6-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,"astc-10x8-unorm":e.astc.COMPRESSED_RGBA_ASTC_10x8_KHR,"astc-10x8-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,"astc-10x10-unorm":e.astc.COMPRESSED_RGBA_ASTC_10x10_KHR,"astc-10x10-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,"astc-12x10-unorm":e.astc.COMPRESSED_RGBA_ASTC_12x10_KHR,"astc-12x10-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,"astc-12x12-unorm":e.astc.COMPRESSED_RGBA_ASTC_12x12_KHR,"astc-12x12-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR}:{}}}var sE=f(()=>{Fe();});function l_(r){return {r8unorm:r.UNSIGNED_BYTE,r8snorm:r.BYTE,r8uint:r.UNSIGNED_BYTE,r8sint:r.BYTE,r16uint:r.UNSIGNED_SHORT,r16sint:r.SHORT,r16float:r.HALF_FLOAT,rg8unorm:r.UNSIGNED_BYTE,rg8snorm:r.BYTE,rg8uint:r.UNSIGNED_BYTE,rg8sint:r.BYTE,r32uint:r.UNSIGNED_INT,r32sint:r.INT,r32float:r.FLOAT,rg16uint:r.UNSIGNED_SHORT,rg16sint:r.SHORT,rg16float:r.HALF_FLOAT,rgba8unorm:r.UNSIGNED_BYTE,"rgba8unorm-srgb":r.UNSIGNED_BYTE,rgba8snorm:r.BYTE,rgba8uint:r.UNSIGNED_BYTE,rgba8sint:r.BYTE,bgra8unorm:r.UNSIGNED_BYTE,"bgra8unorm-srgb":r.UNSIGNED_BYTE,rgb9e5ufloat:r.UNSIGNED_INT_5_9_9_9_REV,rgb10a2unorm:r.UNSIGNED_INT_2_10_10_10_REV,rg11b10ufloat:r.UNSIGNED_INT_10F_11F_11F_REV,rg32uint:r.UNSIGNED_INT,rg32sint:r.INT,rg32float:r.FLOAT,rgba16uint:r.UNSIGNED_SHORT,rgba16sint:r.SHORT,rgba16float:r.HALF_FLOAT,rgba32uint:r.UNSIGNED_INT,rgba32sint:r.INT,rgba32float:r.FLOAT,stencil8:r.UNSIGNED_BYTE,depth16unorm:r.UNSIGNED_SHORT,depth24plus:r.UNSIGNED_INT,"depth24plus-stencil8":r.UNSIGNED_INT_24_8,depth32float:r.FLOAT,"depth32float-stencil8":r.FLOAT_32_UNSIGNED_INT_24_8_REV}}var nE=f(()=>{});function r3(r){r instanceof Uint8ClampedArray&&(r=new Uint8Array(r.buffer));let e=r.length;for(let t=0;t<e;t+=4){let i=r[t+3];if(i!==0){let s=255.001/i;r[t]=r[t]*s+.5,r[t+1]=r[t+1]*s+.5,r[t+2]=r[t+2]*s+.5;}}}var i3=f(()=>{});var hO,ka,oE=f(()=>{Fe();B();ye();Z2();Q2();J2();i_();eE();rE();iE();sE();nE();hO=4,ka=class{constructor(e){this.managedTextures=[],this._glTextures=Object.create(null),this._glSamplers=Object.create(null),this._boundTextures=[],this._activeTextureLocation=-1,this._boundSamplers=Object.create(null),this._uploads={image:Cl,buffer:t_,video:s_,compressed:r_},this._premultiplyAlpha=false,this._useSeparateSamplers=false,this._renderer=e,this._renderer.renderableGC.addManagedHash(this,"_glTextures"),this._renderer.renderableGC.addManagedHash(this,"_glSamplers");}contextChange(e){this._gl=e,this._mapFormatToInternalFormat||(this._mapFormatToInternalFormat=u_(e,this._renderer.context.extensions),this._mapFormatToType=l_(e),this._mapFormatToFormat=a_(e)),this._glTextures=Object.create(null),this._glSamplers=Object.create(null),this._boundSamplers=Object.create(null),this._premultiplyAlpha=false;for(let t=0;t<16;t++)this.bind(exports.Texture.EMPTY,t);}initSource(e){this.bind(e);}bind(e,t=0){let i=e.source;e?(this.bindSource(i,t),this._useSeparateSamplers&&this._bindSampler(i.style,t)):(this.bindSource(null,t),this._useSeparateSamplers&&this._bindSampler(null,t));}bindSource(e,t=0){let i=this._gl;if(e._touched=this._renderer.textureGC.count,this._boundTextures[t]!==e){this._boundTextures[t]=e,this._activateLocation(t),e||(e=exports.Texture.EMPTY.source);let s=this.getGlSource(e);i.bindTexture(s.target,s.texture);}}_bindSampler(e,t=0){let i=this._gl;if(!e){this._boundSamplers[t]=null,i.bindSampler(t,null);return}let s=this._getGlSampler(e);this._boundSamplers[t]!==s&&(this._boundSamplers[t]=s,i.bindSampler(t,s));}unbind(e){let t=e.source,i=this._boundTextures,s=this._gl;for(let n=0;n<i.length;n++)if(i[n]===t){this._activateLocation(n);let o=this.getGlSource(t);s.bindTexture(o.target,null),i[n]=null;}}_activateLocation(e){this._activeTextureLocation!==e&&(this._activeTextureLocation=e,this._gl.activeTexture(this._gl.TEXTURE0+e));}_initSource(e){let t=this._gl,i=new El(t.createTexture());if(i.type=this._mapFormatToType[e.format],i.internalFormat=this._mapFormatToInternalFormat[e.format],i.format=this._mapFormatToFormat[e.format],e.autoGenerateMipmaps&&(this._renderer.context.supports.nonPowOf2mipmaps||e.isPowerOfTwo)){let s=Math.max(e.width,e.height);e.mipLevelCount=Math.floor(Math.log2(s))+1;}return this._glTextures[e.uid]=i,this.managedTextures.includes(e)||(e.on("update",this.onSourceUpdate,this),e.on("resize",this.onSourceUpdate,this),e.on("styleChange",this.onStyleChange,this),e.on("destroy",this.onSourceDestroy,this),e.on("unload",this.onSourceUnload,this),e.on("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.push(e)),this.onSourceUpdate(e),this.updateStyle(e,false),i}onStyleChange(e){this.updateStyle(e,false);}updateStyle(e,t){let i=this._gl,s=this.getGlSource(e);i.bindTexture(i.TEXTURE_2D,s.texture),this._boundTextures[this._activeTextureLocation]=e,gd(e.style,i,e.mipLevelCount>1,this._renderer.context.extensions.anisotropicFiltering,"texParameteri",i.TEXTURE_2D,!this._renderer.context.supports.nonPowOf2wrapping&&!e.isPowerOfTwo,t);}onSourceUnload(e){let t=this._glTextures[e.uid];t&&(this.unbind(e),this._glTextures[e.uid]=null,this._gl.deleteTexture(t.texture));}onSourceUpdate(e){let t=this._gl,i=this.getGlSource(e);t.bindTexture(t.TEXTURE_2D,i.texture),this._boundTextures[this._activeTextureLocation]=e;let s=e.alphaMode==="premultiply-alpha-on-upload";this._premultiplyAlpha!==s&&(this._premultiplyAlpha=s,t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,s)),this._uploads[e.uploadMethodId]?this._uploads[e.uploadMethodId].upload(e,i,t,this._renderer.context.webGLVersion):t.texImage2D(t.TEXTURE_2D,0,t.RGBA,e.pixelWidth,e.pixelHeight,0,t.RGBA,t.UNSIGNED_BYTE,null),e.autoGenerateMipmaps&&e.mipLevelCount>1&&this.onUpdateMipmaps(e,false);}onUpdateMipmaps(e,t=true){t&&this.bindSource(e,0);let i=this.getGlSource(e);this._gl.generateMipmap(i.target);}onSourceDestroy(e){e.off("destroy",this.onSourceDestroy,this),e.off("update",this.onSourceUpdate,this),e.off("resize",this.onSourceUpdate,this),e.off("unload",this.onSourceUnload,this),e.off("styleChange",this.onStyleChange,this),e.off("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.splice(this.managedTextures.indexOf(e),1),this.onSourceUnload(e);}_initSampler(e){let t=this._gl,i=this._gl.createSampler();return this._glSamplers[e._resourceId]=i,gd(e,t,this._boundTextures[this._activeTextureLocation].mipLevelCount>1,this._renderer.context.extensions.anisotropicFiltering,"samplerParameteri",i,false,true),this._glSamplers[e._resourceId]}_getGlSampler(e){return this._glSamplers[e._resourceId]||this._initSampler(e)}getGlSource(e){return this._glTextures[e.uid]||this._initSource(e)}generateCanvas(e){let{pixels:t,width:i,height:s}=this.getPixels(e),n=j.get().createCanvas();n.width=i,n.height=s;let o=n.getContext("2d");if(o){let a=o.createImageData(i,s);a.data.set(t),o.putImageData(a,0,0);}return n}getPixels(e){let t=e.source.resolution,i=e.frame,s=Math.max(Math.round(i.width*t),1),n=Math.max(Math.round(i.height*t),1),o=new Uint8Array(hO*s*n),a=this._renderer,u=a.renderTarget.getRenderTarget(e),l=a.renderTarget.getGpuRenderTarget(u),c=a.gl;return c.bindFramebuffer(c.FRAMEBUFFER,l.resolveTargetFramebuffer),c.readPixels(Math.round(i.x*t),Math.round(i.y*t),s,n,c.RGBA,c.UNSIGNED_BYTE,o),{pixels:new Uint8ClampedArray(o.buffer),width:s,height:n}}destroy(){this.managedTextures.slice().forEach(e=>this.onSourceDestroy(e)),this.managedTextures=null,this._renderer=null;}resetState(){this._activeTextureLocation=-1,this._boundTextures.fill(exports.Texture.EMPTY.source),this._boundSamplers=Object.create(null);let e=this._gl;this._premultiplyAlpha=false,e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this._premultiplyAlpha);}};ka.extension={type:[x.WebGLSystem],name:"texture"};});var a3={};Zi(a3,{WebGLRenderer:()=>xd});var dO,fO,pO,s3,n3,o3,xd,aE=f(()=>{B();d2();f2();p2();tl();hx();Ar();x2();b2();T2();E2();C2();A2();P2();w2();M2();k2();W2();j2();K2();oE();dO=[...ul,Ra,Dx,Rx,wa,Ea,ka,Ma,Ca,Da,Ia,Pa,e_,Ba,Aa],fO=[...ll],pO=[Ta,va,ya],s3=[],n3=[],o3=[];V.handleByNamedList(x.WebGLSystem,s3);V.handleByNamedList(x.WebGLPipes,n3);V.handleByNamedList(x.WebGLPipesAdaptor,o3);V.add(...dO,...fO,...pO);xd=class extends Di{constructor(){let e={name:"webgl",type:qe.WEBGL,systems:s3,renderPipes:n3,renderPipeAdaptors:o3};super(e);}};});async function c_(r){let e=[];r.preference?(e.push(r.preference),u3.forEach(n=>{n!==r.preference&&e.push(n);})):e=u3.slice();let t,i={};for(let n=0;n<e.length;n++){let o=e[n];if(o==="webgpu"&&await Oi()){let{WebGPURenderer:a}=await Promise.resolve().then(()=>(h2(),qw));t=a,i={...r,...r.webgpu};break}else if(o==="webgl"&&ki(r.failIfMajorPerformanceCaveat??Di.defaultOptions.failIfMajorPerformanceCaveat)){let{WebGLRenderer:a}=await Promise.resolve().then(()=>(aE(),a3));t=a,i={...r,...r.webgl};break}else if(o==="canvas")throw i={...r},new Error("CanvasRenderer is not yet implemented")}if(delete i.webgpu,delete i.webgl,!t)throw new Error("No available renderer for the current environment");let s=new t;return await s.init(i),s}var u3,uE=f(()=>{rl();il();tl();u3=["webgl","webgpu","canvas"];});var l3,_d,c3=f(()=>{B();uE();hr();Qg();Pe();l3=class lE{constructor(...e){this.stage=new ue,e[0]!==void 0&&U(Y,"Application constructor options are deprecated, please use Application.init() instead.");}async init(e){e={...e},this.renderer=await c_(e),lE._plugins.forEach(t=>{t.init.call(this,e);});}render(){this.renderer.render({container:this.stage});}get canvas(){return this.renderer.canvas}get view(){return U(Y,"Application.view is deprecated, please use Application.canvas instead."),this.renderer.canvas}get screen(){return this.renderer.screen}destroy(e=false,t=false){let i=lE._plugins.slice(0);i.reverse(),i.forEach(s=>{s.destroy.call(this);}),this.stage.destroy(t),this.stage=null,this.renderer.destroy(e),this.renderer=null;}};l3._plugins=[];_d=l3;V.handleByList(x.Application,_d._plugins);V.add(Ko);});var Oa,cE=f(()=>{ct();ye();dg();Ah();Oa=class extends hn{constructor(e,t){super();let{textures:i,data:s}=e;Object.keys(s.pages).forEach(n=>{let o=s.pages[parseInt(n,10)],a=i[o.id];this.pages.push({texture:a});}),Object.keys(s.chars).forEach(n=>{let o=s.chars[n],{frame:a,source:u}=i[o.page],l=new exports.Rectangle(o.x+a.x,o.y+a.y,o.width,o.height),c=new exports.Texture({source:u,frame:l});this.chars[n]={id:n.codePointAt(0),xOffset:o.xOffset,yOffset:o.yOffset,xAdvance:o.xAdvance,kerning:o.kerning??{},texture:c};}),this.baseRenderedFontSize=s.fontSize,this.baseMeasurementFontSize=s.fontSize,this.fontMetrics={ascent:0,descent:0,fontSize:s.fontSize},this.baseLineOffset=s.baseLineOffset,this.lineHeight=s.lineHeight,this.fontFamily=s.fontFamily,this.distanceField=s.distanceField??{type:"none",range:0},this.url=t;}destroy(){super.destroy();for(let e=0;e<this.pages.length;e++){let{texture:t}=this.pages[e];t.destroy(true);}this.pages=null;}static install(e){fs.install(e);}static uninstall(e){fs.uninstall(e);}};});var Pl,hE=f(()=>{Pl={test(r){return typeof r=="string"&&r.startsWith("info face=")},parse(r){let e=r.match(/^[a-z]+\s+.+$/gm),t={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[],distanceField:[]};for(let h in e){let d=e[h].match(/^[a-z]+/gm)[0],p=e[h].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),m={};for(let b in p){let _=p[b].split("="),g=_[0],y=_[1].replace(/"/gm,""),S=parseFloat(y),E=isNaN(S)?y:S;m[g]=E;}t[d].push(m);}let i={chars:{},pages:[],lineHeight:0,fontSize:0,fontFamily:"",distanceField:null,baseLineOffset:0},[s]=t.info,[n]=t.common,[o]=t.distanceField??[];o&&(i.distanceField={range:parseInt(o.distanceRange,10),type:o.fieldType}),i.fontSize=parseInt(s.size,10),i.fontFamily=s.face,i.lineHeight=parseInt(n.lineHeight,10);let a=t.page;for(let h=0;h<a.length;h++)i.pages.push({id:parseInt(a[h].id,10)||0,file:a[h].file});let u={};i.baseLineOffset=i.lineHeight-parseInt(n.base,10);let l=t.char;for(let h=0;h<l.length;h++){let d=l[h],p=parseInt(d.id,10),m=d.letter??d.char??String.fromCharCode(p);m==="space"&&(m=" "),u[p]=m,i.chars[m]={id:p,page:parseInt(d.page,10)||0,x:parseInt(d.x,10),y:parseInt(d.y,10),width:parseInt(d.width,10),height:parseInt(d.height,10),xOffset:parseInt(d.xoffset,10),yOffset:parseInt(d.yoffset,10),xAdvance:parseInt(d.xadvance,10),kerning:{}};}let c=t.kerning||[];for(let h=0;h<c.length;h++){let d=parseInt(c[h].first,10),p=parseInt(c[h].second,10),m=parseInt(c[h].amount,10);i.chars[u[p]].kerning[u[d]]=m;}return i}};});var bd,dE=f(()=>{bd={test(r){let e=r;return typeof e!="string"&&"getElementsByTagName"in e&&e.getElementsByTagName("page").length&&e.getElementsByTagName("info")[0].getAttribute("face")!==null},parse(r){let e={chars:{},pages:[],lineHeight:0,fontSize:0,fontFamily:"",distanceField:null,baseLineOffset:0},t=r.getElementsByTagName("info")[0],i=r.getElementsByTagName("common")[0],s=r.getElementsByTagName("distanceField")[0];s&&(e.distanceField={type:s.getAttribute("fieldType"),range:parseInt(s.getAttribute("distanceRange"),10)});let n=r.getElementsByTagName("page"),o=r.getElementsByTagName("char"),a=r.getElementsByTagName("kerning");e.fontSize=parseInt(t.getAttribute("size"),10),e.fontFamily=t.getAttribute("face"),e.lineHeight=parseInt(i.getAttribute("lineHeight"),10);for(let l=0;l<n.length;l++)e.pages.push({id:parseInt(n[l].getAttribute("id"),10)||0,file:n[l].getAttribute("file")});let u={};e.baseLineOffset=e.lineHeight-parseInt(i.getAttribute("base"),10);for(let l=0;l<o.length;l++){let c=o[l],h=parseInt(c.getAttribute("id"),10),d=c.getAttribute("letter")??c.getAttribute("char")??String.fromCharCode(h);d==="space"&&(d=" "),u[h]=d,e.chars[d]={id:h,page:parseInt(c.getAttribute("page"),10)||0,x:parseInt(c.getAttribute("x"),10),y:parseInt(c.getAttribute("y"),10),width:parseInt(c.getAttribute("width"),10),height:parseInt(c.getAttribute("height"),10),xOffset:parseInt(c.getAttribute("xoffset"),10),yOffset:parseInt(c.getAttribute("yoffset"),10),xAdvance:parseInt(c.getAttribute("xadvance"),10),kerning:{}};}for(let l=0;l<a.length;l++){let c=parseInt(a[l].getAttribute("first"),10),h=parseInt(a[l].getAttribute("second"),10),d=parseInt(a[l].getAttribute("amount"),10);e.chars[u[h]].kerning[u[c]]=d;}return e}};});var yd,fE=f(()=>{Fe();dE();yd={test(r){return typeof r=="string"&&r.includes("<font>")?bd.test(j.get().parseXML(r)):false},parse(r){return bd.parse(j.get().parseXML(r))}};});var mO,h_,d_,pE=f(()=>{Er();wp();Fe();B();Us();cE();hE();fE();mO=[".xml",".fnt"],h_={extension:{type:x.CacheParser,name:"cacheBitmapFont"},test:r=>r instanceof Oa,getCacheableAssets(r,e){let t={};return r.forEach(i=>{t[i]=e,t[`${i}-bitmap`]=e;}),t[`${e.fontFamily}-bitmap`]=e,t}},d_={extension:{type:x.LoadParser,priority:ze.Normal},name:"loadBitmapFont",test(r){return mO.includes(We.extname(r).toLowerCase())},async testParse(r){return Pl.test(r)||yd.test(r)},async parse(r,e,t){let i=Pl.test(r)?Pl.parse(r):yd.parse(r),{src:s}=e,{pages:n}=i,o=[],a=i.distanceField?{scaleMode:"linear",alphaMode:"premultiply-alpha-on-upload",autoGenerateMipmaps:false,resolution:1}:{};for(let h=0;h<n.length;++h){let d=n[h].file,p=We.join(We.dirname(s),d);p=ao(p,s),o.push({src:p,data:a});}let u=await t.load(o),l=o.map(h=>u[h.src]);return new Oa({data:i,textures:l},s)},async load(r,e){return await(await j.get().fetch(r)).text()},async unload(r,e,t){await Promise.all(r.pages.map(i=>t.unload(i.texture.source._sourceOrigin))),r.destroy();}};});var wl,mE=f(()=>{wl=class{constructor(e,t=false){this._loader=e,this._assetList=[],this._isLoading=false,this._maxConcurrent=1,this.verbose=t;}add(e){e.forEach(t=>{this._assetList.push(t);}),this.verbose&&console.log("[BackgroundLoader] assets: ",this._assetList),this._isActive&&!this._isLoading&&this._next();}async _next(){if(this._assetList.length&&this._isActive){this._isLoading=true;let e=[],t=Math.min(this._assetList.length,this._maxConcurrent);for(let i=0;i<t;i++)e.push(this._assetList.pop());await this._loader.load(e),this._isLoading=false,this._next();}}get active(){return this._isActive}set active(e){this._isActive!==e&&(this._isActive=e,e&&!this._isLoading&&this._next());}};});var f_,gE=f(()=>{B();ye();f_={extension:{type:x.CacheParser,name:"cacheTextureArray"},test:r=>Array.isArray(r)&&r.every(e=>e instanceof exports.Texture),getCacheableAssets:(r,e)=>{let t={};return r.forEach(i=>{e.forEach((s,n)=>{t[i+(n===0?"":n+1)]=s;});}),t}};});async function Bl(r){if("Image"in globalThis)return new Promise(e=>{let t=new Image;t.onload=()=>{e(true);},t.onerror=()=>{e(false);},t.src=r;});if("createImageBitmap"in globalThis&&"fetch"in globalThis){try{let e=await(await fetch(r)).blob();await createImageBitmap(e);}catch{return false}return true}return false}var p_=f(()=>{});var m_,xE=f(()=>{B();p_();m_={extension:{type:x.DetectionParser,priority:1},test:async()=>Bl("data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A="),add:async r=>[...r,"avif"],remove:async r=>r.filter(e=>e!=="avif")};});var h3,g_,_E=f(()=>{B();h3=["png","jpg","jpeg"],g_={extension:{type:x.DetectionParser,priority:-1},test:()=>Promise.resolve(true),add:async r=>[...r,...h3],remove:async r=>r.filter(e=>!h3.includes(e))};});function An(r){return gO?false:document.createElement("video").canPlayType(r)!==""}var gO,vd=f(()=>{gO="WorkerGlobalScope"in globalThis&&globalThis instanceof globalThis.WorkerGlobalScope;});var x_,bE=f(()=>{B();vd();x_={extension:{type:x.DetectionParser,priority:0},test:async()=>An("video/mp4"),add:async r=>[...r,"mp4","m4v"],remove:async r=>r.filter(e=>e!=="mp4"&&e!=="m4v")};});var __,yE=f(()=>{B();vd();__={extension:{type:x.DetectionParser,priority:0},test:async()=>An("video/ogg"),add:async r=>[...r,"ogv"],remove:async r=>r.filter(e=>e!=="ogv")};});var b_,vE=f(()=>{B();vd();b_={extension:{type:x.DetectionParser,priority:0},test:async()=>An("video/webm"),add:async r=>[...r,"webm"],remove:async r=>r.filter(e=>e!=="webm")};});var y_,TE=f(()=>{B();p_();y_={extension:{type:x.DetectionParser,priority:0},test:async()=>Bl("data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA="),add:async r=>[...r,"webp"],remove:async r=>r.filter(e=>e!=="webp")};});var Rl,SE=f(()=>{Be();Us();pu();Xc();Rl=class{constructor(){this._parsers=[],this._parsersValidated=false,this.parsers=new Proxy(this._parsers,{set:(e,t,i)=>(this._parsersValidated=false,e[t]=i,true)}),this.promiseCache={};}reset(){this._parsersValidated=false,this.promiseCache={};}_getLoadPromiseAndParser(e,t){let i={promise:null,parser:null};return i.promise=(async()=>{let s=null,n=null;if(t.loadParser&&(n=this._parserHash[t.loadParser],n||N(`[Assets] specified load parser "${t.loadParser}" not found while loading ${e}`)),!n){for(let o=0;o<this.parsers.length;o++){let a=this.parsers[o];if(a.load&&a.test?.(e,t,this)){n=a;break}}if(!n)return N(`[Assets] ${e} could not be loaded as we don't know how to parse it, ensure the correct parser has been added`),null}s=await n.load(e,t,this),i.parser=n;for(let o=0;o<this.parsers.length;o++){let a=this.parsers[o];a.parse&&a.parse&&await a.testParse?.(s,t,this)&&(s=await a.parse(s,t,this)||s,i.parser=a);}return s})(),i}async load(e,t){this._parsersValidated||this._validateParsers();let i=0,s={},n=ss(e),o=Ht(e,l=>({alias:[l],src:l,data:{}})),a=o.length,u=o.map(async l=>{let c=We.toAbsolute(l.src);if(!s[l.src])try{this.promiseCache[c]||(this.promiseCache[c]=this._getLoadPromiseAndParser(c,l)),s[l.src]=await this.promiseCache[c].promise,t&&t(++i/a);}catch(h){throw delete this.promiseCache[c],delete s[l.src],new Error(`[Loader.load] Failed to load ${c}.
2041
+ ${h}`)}});return await Promise.all(u),n?s[o[0].src]:s}async unload(e){let i=Ht(e,s=>({alias:[s],src:s})).map(async s=>{let n=We.toAbsolute(s.src),o=this.promiseCache[n];if(o){let a=await o.promise;delete this.promiseCache[n],await o.parser?.unload?.(a,s,this);}});await Promise.all(i);}_validateParsers(){this._parsersValidated=true,this._parserHash=this._parsers.filter(e=>e.name).reduce((e,t)=>(t.name?e[t.name]&&N(`[Assets] loadParser name conflict "${t.name}"`):N("[Assets] loadParser should have a name"),{...e,[t.name]:t}),{});}};});function pr(r,e){if(Array.isArray(e)){for(let t of e)if(r.startsWith(`data:${t}`))return true;return false}return r.startsWith(`data:${e}`)}var Pn=f(()=>{});function it(r,e){let t=r.split("?")[0],i=We.extname(t).toLowerCase();return Array.isArray(e)?e.includes(i):i===e}var wr=f(()=>{Us();});var xO,_O,v_,EE=f(()=>{Fe();B();Pn();wr();Er();xO=".json",_O="application/json",v_={extension:{type:x.LoadParser,priority:ze.Low},name:"loadJson",test(r){return pr(r,_O)||it(r,xO)},async load(r){return await(await j.get().fetch(r)).json()}};});var bO,yO,T_,CE=f(()=>{Fe();B();Pn();wr();Er();bO=".txt",yO="text/plain",T_={name:"loadTxt",extension:{type:x.LoadParser,priority:ze.Low,name:"loadTxt"},test(r){return pr(r,yO)||it(r,bO)},async load(r){return await(await j.get().fetch(r)).text()}};});function AE(r){let e=We.extname(r),s=We.basename(r,e).replace(/(-|_)/g," ").toLowerCase().split(" ").map(a=>a.charAt(0).toUpperCase()+a.slice(1)),n=s.length>0;for(let a of s)if(!a.match(EO)){n=false;break}let o=s.join(" ");return n||(o=`"${o.replace(/[\\"]/g,"\\$&")}"`),o}function AO(r){return CO.test(r)?r:encodeURI(r)}var vO,TO,SO,EO,CO,S_,PE=f(()=>{Fe();B();Be();Us();Ai();Pn();wr();Er();vO=["normal","bold","100","200","300","400","500","600","700","800","900"],TO=[".ttf",".otf",".woff",".woff2"],SO=["font/ttf","font/otf","font/woff","font/woff2"],EO=/^(--|-?[A-Z_])[0-9A-Z_-]*$/i;CO=/^[0-9A-Za-z%:/?#\[\]@!\$&'()\*\+,;=\-._~]*$/;S_={extension:{type:x.LoadParser,priority:ze.Low},name:"loadWebFont",test(r){return pr(r,SO)||it(r,TO)},async load(r,e){let t=j.get().getFontFaceSet();if(t){let i=[],s=e.data?.family??AE(r),n=e.data?.weights?.filter(a=>vO.includes(a))??["normal"],o=e.data??{};for(let a=0;a<n.length;a++){let u=n[a],l=new FontFace(s,`url(${AO(r)})`,{...o,weight:u});await l.load(),t.add(l),i.push(l);}return Se.set(`${s}-and-url`,{url:r,fontFaces:i}),i.length===1?i[0]:i}return N("[loadWebFont] FontFace API is not supported. Skipping loading font"),null},unload(r){(Array.isArray(r)?r:[r]).forEach(e=>{Se.remove(`${e.family}-and-url`),j.get().getFontFaceSet().delete(e);});}};});function wn(r,e=1){let t=Vt.RETINA_PREFIX?.exec(r);return t?parseFloat(t[1]):e}var Td=f(()=>{Ls();});function Kt(r,e,t){r.label=t,r._sourceOrigin=t;let i=new exports.Texture({source:r,label:t}),s=()=>{delete e.promiseCache[t],Se.has(t)&&Se.remove(t);};return i.source.once("destroy",()=>{e.promiseCache[t]&&(N("[Assets] A TextureSource managed by Assets was destroyed instead of unloaded! Use Assets.unload() instead of destroying the TextureSource."),s());}),i.once("destroy",()=>{r.destroyed||(N("[Assets] A Texture managed by Assets was destroyed instead of unloaded! Use Assets.unload() instead of destroying the Texture."),s());}),i}var ms=f(()=>{ye();Be();Ai();});async function BO(r,e,t,i){let n=await(await j.get().fetch(r)).blob(),o=URL.createObjectURL(n),a=new Image;a.src=o,a.crossOrigin=i,await a.decode(),URL.revokeObjectURL(o);let u=document.createElement("canvas"),l=u.getContext("2d"),c=e.data?.resolution||wn(r),h=e.data?.width??a.width,d=e.data?.height??a.height;u.width=h*c,u.height=d*c,l.drawImage(a,0,0,h*c,d*c);let{parseAsGraphicsContext:p,...m}=e.data??{},b=new Yt({resource:u,alphaMode:"premultiply-alpha-on-upload",resolution:c,...m});return Kt(b,t,r)}async function RO(r){let t=await(await j.get().fetch(r)).text(),i=new dt;return i.svg(t),i}var PO,wO,E_,wE=f(()=>{Fe();B();fo();Po();Td();Pn();wr();Er();ms();PO=".svg",wO="image/svg+xml",E_={extension:{type:x.LoadParser,priority:ze.Low,name:"loadSVG"},name:"loadSVG",config:{crossOrigin:"anonymous",parseAsGraphicsContext:false},test(r){return pr(r,wO)||it(r,PO)},async load(r,e,t){return e.data?.parseAsGraphicsContext??this.config.parseAsGraphicsContext?RO(r):BO(r,e,t,this.config.crossOrigin)},unload(r){r.destroy(true);}};});var MO,Ml,Il,d3=f(()=>{MO=`(function () {
2042
2042
  'use strict';
2043
2043
 
2044
2044
  const WHITE_PNG = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+ip1sAAAAASUVORK5CYII=";
@@ -2088,7 +2088,7 @@ ${h}`)}});return await Promise.all(u),n?s[o[0].src]:s}async unload(e){let i=Ht(e
2088
2088
  };
2089
2089
 
2090
2090
  })();
2091
- `,Dl=null,Sd=class{constructor(){Dl||(Dl=URL.createObjectURL(new Blob([IO],{type:"application/javascript"}))),this.worker=new Worker(Dl);}};Sd.revokeObjectURL=function(){Dl&&(URL.revokeObjectURL(Dl),Dl=null);};});var p3,BE,RE,Ed,ME=f(()=>{d3();f3();p3=0,RE=class{constructor(){this._initialized=false,this._createdWorkers=0,this._workerPool=[],this._queue=[],this._resolveHash={};}isImageBitmapSupported(){return this._isImageBitmapSupported!==void 0?this._isImageBitmapSupported:(this._isImageBitmapSupported=new Promise(e=>{let{worker:t}=new Il;t.addEventListener("message",i=>{t.terminate(),Il.revokeObjectURL(),e(i.data);});}),this._isImageBitmapSupported)}loadImageBitmap(e,t){return this._run("loadImageBitmap",[e,t?.data?.alphaMode])}async _initWorkers(){this._initialized||(this._initialized=true);}_getWorker(){BE===void 0&&(BE=navigator.hardwareConcurrency||4);let e=this._workerPool.pop();return !e&&this._createdWorkers<BE&&(this._createdWorkers++,e=new Sd().worker,e.addEventListener("message",t=>{this._complete(t.data),this._returnWorker(t.target),this._next();})),e}_returnWorker(e){this._workerPool.push(e);}_complete(e){e.error!==void 0?this._resolveHash[e.uuid].reject(e.error):this._resolveHash[e.uuid].resolve(e.data),this._resolveHash[e.uuid]=null;}async _run(e,t){await this._initWorkers();let i=new Promise((s,n)=>{this._queue.push({id:e,arguments:t,resolve:s,reject:n});});return this._next(),i}_next(){if(!this._queue.length)return;let e=this._getWorker();if(!e)return;let t=this._queue.pop(),i=t.id;this._resolveHash[p3]={resolve:t.resolve,reject:t.reject},e.postMessage({data:t.arguments,uuid:p3++,id:i});}},Ed=new RE;});async function IE(r,e){let t=await j.get().fetch(r);if(!t.ok)throw new Error(`[loadImageBitmap] Failed to fetch ${r}: ${t.status} ${t.statusText}`);let i=await t.blob();return e?.data?.alphaMode==="premultiplied-alpha"?createImageBitmap(i,{premultiplyAlpha:"none"}):createImageBitmap(i)}var DO,kO,kl,C_=f(()=>{Ge();B();fo();Td();Pn();wr();ME();Er();ms();DO=[".jpeg",".jpg",".png",".webp",".avif"],kO=["image/jpeg","image/png","image/webp","image/avif"];kl={name:"loadTextures",extension:{type:x.LoadParser,priority:ze.High,name:"loadTextures"},config:{preferWorkers:true,preferCreateImageBitmap:true,crossOrigin:"anonymous"},test(r){return pr(r,kO)||it(r,DO)},async load(r,e,t){let i=null;globalThis.createImageBitmap&&this.config.preferCreateImageBitmap?this.config.preferWorkers&&await Ed.isImageBitmapSupported()?i=await Ed.loadImageBitmap(r,e):i=await IE(r,e):i=await new Promise((n,o)=>{i=new Image,i.crossOrigin=this.config.crossOrigin,i.src=r,i.complete?n(i):(i.onload=()=>{n(i);},i.onerror=o);});let s=new Yt({resource:i,alphaMode:"premultiply-alpha-on-upload",resolution:e.data?.resolution||wn(r),...e.data});return Kt(s,t,r)},unload(r){r.destroy(true);}};});function DE(r,e,t){t===void 0&&!e.startsWith("data:")?r.crossOrigin=OE(e):t!==false&&(r.crossOrigin=typeof t=="string"?t:"anonymous");}function kE(r){return new Promise((e,t)=>{r.addEventListener("canplaythrough",i),r.addEventListener("error",s),r.load();function i(){n(),e();}function s(o){n(),t(o);}function n(){r.removeEventListener("canplaythrough",i),r.removeEventListener("error",s);}})}function OE(r,e=globalThis.location){if(r.startsWith("data:"))return "";e||(e=globalThis.location);let t=new URL(r,document.baseURI);return t.hostname!==e.hostname||t.port!==e.port||t.protocol!==e.protocol?"anonymous":""}var m3,OO,A_,FE=f(()=>{B();kp();Ip();Td();Pn();wr();ms();m3=[".mp4",".m4v",".webm",".ogg",".ogv",".h264",".avi",".mov"],OO=m3.map(r=>`video/${r.substring(1)}`);A_={name:"loadVideo",extension:{type:x.LoadParser,name:"loadVideo"},test(r){let e=pr(r,OO),t=it(r,m3);return e||t},async load(r,e,t){let i={...zs.defaultOptions,resolution:e.data?.resolution||wn(r),alphaMode:e.data?.alphaMode||await gu(),...e.data},s=document.createElement("video"),n={preload:i.autoLoad!==false?"auto":void 0,"webkit-playsinline":i.playsinline!==false?"":void 0,playsinline:i.playsinline!==false?"":void 0,muted:i.muted===true?"":void 0,loop:i.loop===true?"":void 0,autoplay:i.autoPlay!==false?"":void 0};Object.keys(n).forEach(u=>{let l=n[u];l!==void 0&&s.setAttribute(u,l);}),i.muted===true&&(s.muted=true),DE(s,r,i.crossorigin);let o=document.createElement("source"),a;if(r.startsWith("data:"))a=r.slice(5,r.indexOf(";"));else if(!r.startsWith("blob:")){let u=r.split("?")[0].slice(r.lastIndexOf(".")+1).toLowerCase();a=zs.MIME_TYPES[u]||`video/${u}`;}return o.src=r,a&&(o.type=a),new Promise(u=>{let l=async()=>{let c=new zs({...i,resource:s});s.removeEventListener("canplay",l),e.data.preload&&await kE(s),u(Kt(c,t,r));};i.preload&&!i.autoPlay&&s.load(),s.addEventListener("canplay",l),s.appendChild(o);})},unload(r){r.destroy(true);}};});var Ol,P_=f(()=>{B();C_();Ls();Ol={extension:{type:x.ResolveParser,name:"resolveTexture"},test:kl.test,parse:r=>({resolution:parseFloat(Vt.RETINA_PREFIX.exec(r)?.[1]??"1"),format:r.split(".").pop(),src:r})};});var w_,GE=f(()=>{B();Ls();P_();w_={extension:{type:x.ResolveParser,priority:-2,name:"resolveJson"},test:r=>Vt.RETINA_PREFIX.test(r)&&r.endsWith(".json"),parse:Ol.parse};});var Cd;exports.Assets=void 0;var g3,x3=f(()=>{B();pE();Be();mE();Ai();gE();xE();_E();bE();yE();vE();TE();SE();EE();CE();PE();wE();C_();FE();GE();P_();Ls();pu();Xc();Cd=class{constructor(){this._detections=[],this._initialized=false,this.resolver=new Vt,this.loader=new Rl,this.cache=Se,this._backgroundLoader=new wl(this.loader),this._backgroundLoader.active=true,this.reset();}async init(e={}){if(this._initialized){N("[Assets]AssetManager already initialized, did you load before calling this Assets.init()?");return}if(this._initialized=true,e.defaultSearchParams&&this.resolver.setDefaultSearchParams(e.defaultSearchParams),e.basePath&&(this.resolver.basePath=e.basePath),e.bundleIdentifier&&this.resolver.setBundleIdentifier(e.bundleIdentifier),e.manifest){let n=e.manifest;typeof n=="string"&&(n=await this.load(n)),this.resolver.addManifest(n);}let t=e.texturePreference?.resolution??1,i=typeof t=="number"?[t]:t,s=await this._detectFormats({preferredFormats:e.texturePreference?.format,skipDetections:e.skipDetections,detections:this._detections});this.resolver.prefer({params:{format:s,resolution:i}}),e.preferences&&this.setPreferences(e.preferences);}add(e){this.resolver.add(e);}async load(e,t){this._initialized||await this.init();let i=ss(e),s=Ht(e).map(a=>{if(typeof a!="string"){let u=this.resolver.getAlias(a);return u.some(l=>!this.resolver.hasKey(l))&&this.add(a),Array.isArray(u)?u[0]:u}return this.resolver.hasKey(a)||this.add({alias:a,src:a}),a}),n=this.resolver.resolve(s),o=await this._mapLoadToResolve(n,t);return i?o[s[0]]:o}addBundle(e,t){this.resolver.addBundle(e,t);}async loadBundle(e,t){this._initialized||await this.init();let i=false;typeof e=="string"&&(i=true,e=[e]);let s=this.resolver.resolveBundle(e),n={},o=Object.keys(s),a=0,u=0,l=()=>{t?.(++a/u);},c=o.map(h=>{let d=s[h];return u+=Object.keys(d).length,this._mapLoadToResolve(d,l).then(p=>{n[h]=p;})});return await Promise.all(c),i?n[e[0]]:n}async backgroundLoad(e){this._initialized||await this.init(),typeof e=="string"&&(e=[e]);let t=this.resolver.resolve(e);this._backgroundLoader.add(Object.values(t));}async backgroundLoadBundle(e){this._initialized||await this.init(),typeof e=="string"&&(e=[e]);let t=this.resolver.resolveBundle(e);Object.values(t).forEach(i=>{this._backgroundLoader.add(Object.values(i));});}reset(){this.resolver.reset(),this.loader.reset(),this.cache.reset(),this._initialized=false;}get(e){if(typeof e=="string")return Se.get(e);let t={};for(let i=0;i<e.length;i++)t[i]=Se.get(e[i]);return t}async _mapLoadToResolve(e,t){let i=[...new Set(Object.values(e))];this._backgroundLoader.active=false;let s=await this.loader.load(i,t);this._backgroundLoader.active=true;let n={};return i.forEach(o=>{let a=s[o.src],u=[o.src];o.alias&&u.push(...o.alias),u.forEach(l=>{n[l]=a;}),Se.set(u,a);}),n}async unload(e){this._initialized||await this.init();let t=Ht(e).map(s=>typeof s!="string"?s.src:s),i=this.resolver.resolve(t);await this._unloadFromResolved(i);}async unloadBundle(e){this._initialized||await this.init(),e=Ht(e);let t=this.resolver.resolveBundle(e),i=Object.keys(t).map(s=>this._unloadFromResolved(t[s]));await Promise.all(i);}async _unloadFromResolved(e){let t=Object.values(e);t.forEach(i=>{Se.remove(i.src);}),await this.loader.unload(t);}async _detectFormats(e){let t=[];e.preferredFormats&&(t=Array.isArray(e.preferredFormats)?e.preferredFormats:[e.preferredFormats]);for(let i of e.detections)e.skipDetections||await i.test()?t=await i.add(t):e.skipDetections||(t=await i.remove(t));return t=t.filter((i,s)=>t.indexOf(i)===s),t}get detections(){return this._detections}setPreferences(e){this.loader.parsers.forEach(t=>{t.config&&Object.keys(t.config).filter(i=>i in e).forEach(i=>{t.config[i]=e[i];});});}},exports.Assets=new Cd;V.handleByList(x.LoadParser,exports.Assets.loader.parsers).handleByList(x.ResolveParser,exports.Assets.resolver.parsers).handleByList(x.CacheParser,exports.Assets.cache.parsers).handleByList(x.DetectionParser,exports.Assets.detections);V.add(f_,g_,m_,y_,x_,__,b_,v_,T_,S_,E_,kl,A_,d_,h_,Ol,w_);g3={loader:x.LoadParser,resolver:x.ResolveParser,cache:x.CacheParser,detection:x.DetectionParser};V.handle(x.Asset,r=>{let e=r.ref;Object.entries(g3).filter(([t])=>!!e[t]).forEach(([t,i])=>V.add(Object.assign(e[t],{extension:e[t].extension??i})));},r=>{let e=r.ref;Object.keys(g3).filter(t=>!!e[t]).forEach(t=>V.remove(e[t]));});});var _3,b3=f(()=>{B();rl();il();_3={extension:{type:x.DetectionParser,priority:3},test:async()=>!!(await Oi()||ki()),add:async r=>[...r,"basis"],remove:async r=>r.filter(e=>e!=="basis")};});var $r,Fl=f(()=>{Ct();$r=class extends ge{constructor(e){super(e),this.uploadMethodId="compressed",this.resource=e.resource,this.mipLevelCount=this.resource.length;}};});function Ad(){if(B_)return B_;let e=document.createElement("canvas").getContext("webgl");return e?(B_=[...e.getExtension("EXT_texture_compression_bptc")?["bc6h-rgb-ufloat","bc6h-rgb-float","bc7-rgba-unorm","bc7-rgba-unorm-srgb"]:[],...e.getExtension("WEBGL_compressed_texture_s3tc")?["bc1-rgba-unorm","bc2-rgba-unorm","bc3-rgba-unorm"]:[],...e.getExtension("WEBGL_compressed_texture_s3tc_srgb")?["bc1-rgba-unorm-srgb","bc2-rgba-unorm-srgb","bc3-rgba-unorm-srgb"]:[],...e.getExtension("EXT_texture_compression_rgtc")?["bc4-r-unorm","bc4-r-snorm","bc5-rg-unorm","bc5-rg-snorm"]:[],...e.getExtension("WEBGL_compressed_texture_etc")?["etc2-rgb8unorm","etc2-rgb8unorm-srgb","etc2-rgba8unorm","etc2-rgba8unorm-srgb","etc2-rgb8a1unorm","etc2-rgb8a1unorm-srgb","eac-r11unorm","eac-rg11unorm"]:[],...e.getExtension("WEBGL_compressed_texture_astc")?["astc-4x4-unorm","astc-4x4-unorm-srgb","astc-5x4-unorm","astc-5x4-unorm-srgb","astc-5x5-unorm","astc-5x5-unorm-srgb","astc-6x5-unorm","astc-6x5-unorm-srgb","astc-6x6-unorm","astc-6x6-unorm-srgb","astc-8x5-unorm","astc-8x5-unorm-srgb","astc-8x6-unorm","astc-8x6-unorm-srgb","astc-8x8-unorm","astc-8x8-unorm-srgb","astc-10x5-unorm","astc-10x5-unorm-srgb","astc-10x6-unorm","astc-10x6-unorm-srgb","astc-10x8-unorm","astc-10x8-unorm-srgb","astc-10x10-unorm","astc-10x10-unorm-srgb","astc-12x10-unorm","astc-12x10-unorm-srgb","astc-12x12-unorm","astc-12x12-unorm-srgb"]:[]],B_):[]}var B_,UE=f(()=>{});async function Pd(){if(R_)return R_;let r=await j.get().getNavigator().gpu.requestAdapter();return R_=[...r.features.has("texture-compression-bc")?["bc1-rgba-unorm","bc1-rgba-unorm-srgb","bc2-rgba-unorm","bc2-rgba-unorm-srgb","bc3-rgba-unorm","bc3-rgba-unorm-srgb","bc4-r-unorm","bc4-r-snorm","bc5-rg-unorm","bc5-rg-snorm","bc6h-rgb-ufloat","bc6h-rgb-float","bc7-rgba-unorm","bc7-rgba-unorm-srgb"]:[],...r.features.has("texture-compression-etc2")?["etc2-rgb8unorm","etc2-rgb8unorm-srgb","etc2-rgb8a1unorm","etc2-rgb8a1unorm-srgb","etc2-rgba8unorm","etc2-rgba8unorm-srgb","eac-r11unorm","eac-r11snorm","eac-rg11unorm","eac-rg11snorm"]:[],...r.features.has("texture-compression-astc")?["astc-4x4-unorm","astc-4x4-unorm-srgb","astc-5x4-unorm","astc-5x4-unorm-srgb","astc-5x5-unorm","astc-5x5-unorm-srgb","astc-6x5-unorm","astc-6x5-unorm-srgb","astc-6x6-unorm","astc-6x6-unorm-srgb","astc-8x5-unorm","astc-8x5-unorm-srgb","astc-8x6-unorm","astc-8x6-unorm-srgb","astc-8x8-unorm","astc-8x8-unorm-srgb","astc-10x5-unorm","astc-10x5-unorm-srgb","astc-10x6-unorm","astc-10x6-unorm-srgb","astc-10x8-unorm","astc-10x8-unorm-srgb","astc-10x10-unorm","astc-10x10-unorm-srgb","astc-12x10-unorm","astc-12x10-unorm-srgb","astc-12x12-unorm","astc-12x12-unorm-srgb"]:[]],R_}var R_,LE=f(()=>{Ge();});async function Gl(){return M_!==void 0||(M_=await(async()=>{let r=await Oi(),e=ki();if(r&&e){let t=await Pd(),i=Ad();return t.filter(s=>i.includes(s))}else {if(r)return await Pd();if(e)return Ad()}return []})()),M_}var M_,I_=f(()=>{rl();il();UE();LE();});async function Gi(){if(D_!==void 0)return D_;let r=await Gl();return D_=[...NE,...r],D_}var NE,D_,Ul=f(()=>{I_();NE=["r8unorm","r8snorm","r8uint","r8sint","r16uint","r16sint","r16float","rg8unorm","rg8snorm","rg8uint","rg8sint","r32uint","r32sint","r32float","rg16uint","rg16sint","rg16float","rgba8unorm","rgba8unorm-srgb","rgba8snorm","rgba8uint","rgba8sint","bgra8unorm","bgra8unorm-srgb","rgb9e5ufloat","rgb10a2unorm","rg11b10ufloat","rg32uint","rg32sint","rg32float","rgba16uint","rgba16sint","rgba16float","rgba32uint","rgba32sint","rgba32float","stencil8","depth16unorm","depth24plus","depth24plus-stencil8","depth32float","depth32float-stencil8"];});var FO,Ll,wd,y3=f(()=>{FO=`(function () {
2091
+ `,Dl=null,Sd=class{constructor(){Dl||(Dl=URL.createObjectURL(new Blob([IO],{type:"application/javascript"}))),this.worker=new Worker(Dl);}};Sd.revokeObjectURL=function(){Dl&&(URL.revokeObjectURL(Dl),Dl=null);};});var p3,BE,RE,Ed,ME=f(()=>{d3();f3();p3=0,RE=class{constructor(){this._initialized=false,this._createdWorkers=0,this._workerPool=[],this._queue=[],this._resolveHash={};}isImageBitmapSupported(){return this._isImageBitmapSupported!==void 0?this._isImageBitmapSupported:(this._isImageBitmapSupported=new Promise(e=>{let{worker:t}=new Il;t.addEventListener("message",i=>{t.terminate(),Il.revokeObjectURL(),e(i.data);});}),this._isImageBitmapSupported)}loadImageBitmap(e,t){return this._run("loadImageBitmap",[e,t?.data?.alphaMode])}async _initWorkers(){this._initialized||(this._initialized=true);}_getWorker(){BE===void 0&&(BE=navigator.hardwareConcurrency||4);let e=this._workerPool.pop();return !e&&this._createdWorkers<BE&&(this._createdWorkers++,e=new Sd().worker,e.addEventListener("message",t=>{this._complete(t.data),this._returnWorker(t.target),this._next();})),e}_returnWorker(e){this._workerPool.push(e);}_complete(e){e.error!==void 0?this._resolveHash[e.uuid].reject(e.error):this._resolveHash[e.uuid].resolve(e.data),this._resolveHash[e.uuid]=null;}async _run(e,t){await this._initWorkers();let i=new Promise((s,n)=>{this._queue.push({id:e,arguments:t,resolve:s,reject:n});});return this._next(),i}_next(){if(!this._queue.length)return;let e=this._getWorker();if(!e)return;let t=this._queue.pop(),i=t.id;this._resolveHash[p3]={resolve:t.resolve,reject:t.reject},e.postMessage({data:t.arguments,uuid:p3++,id:i});}},Ed=new RE;});async function IE(r,e){let t=await j.get().fetch(r);if(!t.ok)throw new Error(`[loadImageBitmap] Failed to fetch ${r}: ${t.status} ${t.statusText}`);let i=await t.blob();return e?.data?.alphaMode==="premultiplied-alpha"?createImageBitmap(i,{premultiplyAlpha:"none"}):createImageBitmap(i)}var DO,kO,kl,C_=f(()=>{Fe();B();fo();Td();Pn();wr();ME();Er();ms();DO=[".jpeg",".jpg",".png",".webp",".avif"],kO=["image/jpeg","image/png","image/webp","image/avif"];kl={name:"loadTextures",extension:{type:x.LoadParser,priority:ze.High,name:"loadTextures"},config:{preferWorkers:true,preferCreateImageBitmap:true,crossOrigin:"anonymous"},test(r){return pr(r,kO)||it(r,DO)},async load(r,e,t){let i=null;globalThis.createImageBitmap&&this.config.preferCreateImageBitmap?this.config.preferWorkers&&await Ed.isImageBitmapSupported()?i=await Ed.loadImageBitmap(r,e):i=await IE(r,e):i=await new Promise((n,o)=>{i=new Image,i.crossOrigin=this.config.crossOrigin,i.src=r,i.complete?n(i):(i.onload=()=>{n(i);},i.onerror=o);});let s=new Yt({resource:i,alphaMode:"premultiply-alpha-on-upload",resolution:e.data?.resolution||wn(r),...e.data});return Kt(s,t,r)},unload(r){r.destroy(true);}};});function DE(r,e,t){t===void 0&&!e.startsWith("data:")?r.crossOrigin=OE(e):t!==false&&(r.crossOrigin=typeof t=="string"?t:"anonymous");}function kE(r){return new Promise((e,t)=>{r.addEventListener("canplaythrough",i),r.addEventListener("error",s),r.load();function i(){n(),e();}function s(o){n(),t(o);}function n(){r.removeEventListener("canplaythrough",i),r.removeEventListener("error",s);}})}function OE(r,e=globalThis.location){if(r.startsWith("data:"))return "";e||(e=globalThis.location);let t=new URL(r,document.baseURI);return t.hostname!==e.hostname||t.port!==e.port||t.protocol!==e.protocol?"anonymous":""}var m3,OO,A_,FE=f(()=>{B();kp();Ip();Td();Pn();wr();ms();m3=[".mp4",".m4v",".webm",".ogg",".ogv",".h264",".avi",".mov"],OO=m3.map(r=>`video/${r.substring(1)}`);A_={name:"loadVideo",extension:{type:x.LoadParser,name:"loadVideo"},test(r){let e=pr(r,OO),t=it(r,m3);return e||t},async load(r,e,t){let i={...zs.defaultOptions,resolution:e.data?.resolution||wn(r),alphaMode:e.data?.alphaMode||await gu(),...e.data},s=document.createElement("video"),n={preload:i.autoLoad!==false?"auto":void 0,"webkit-playsinline":i.playsinline!==false?"":void 0,playsinline:i.playsinline!==false?"":void 0,muted:i.muted===true?"":void 0,loop:i.loop===true?"":void 0,autoplay:i.autoPlay!==false?"":void 0};Object.keys(n).forEach(u=>{let l=n[u];l!==void 0&&s.setAttribute(u,l);}),i.muted===true&&(s.muted=true),DE(s,r,i.crossorigin);let o=document.createElement("source"),a;if(r.startsWith("data:"))a=r.slice(5,r.indexOf(";"));else if(!r.startsWith("blob:")){let u=r.split("?")[0].slice(r.lastIndexOf(".")+1).toLowerCase();a=zs.MIME_TYPES[u]||`video/${u}`;}return o.src=r,a&&(o.type=a),new Promise(u=>{let l=async()=>{let c=new zs({...i,resource:s});s.removeEventListener("canplay",l),e.data.preload&&await kE(s),u(Kt(c,t,r));};i.preload&&!i.autoPlay&&s.load(),s.addEventListener("canplay",l),s.appendChild(o);})},unload(r){r.destroy(true);}};});var Ol,P_=f(()=>{B();C_();Ls();Ol={extension:{type:x.ResolveParser,name:"resolveTexture"},test:kl.test,parse:r=>({resolution:parseFloat(Vt.RETINA_PREFIX.exec(r)?.[1]??"1"),format:r.split(".").pop(),src:r})};});var w_,GE=f(()=>{B();Ls();P_();w_={extension:{type:x.ResolveParser,priority:-2,name:"resolveJson"},test:r=>Vt.RETINA_PREFIX.test(r)&&r.endsWith(".json"),parse:Ol.parse};});var Cd;exports.Assets=void 0;var g3,x3=f(()=>{B();pE();Be();mE();Ai();gE();xE();_E();bE();yE();vE();TE();SE();EE();CE();PE();wE();C_();FE();GE();P_();Ls();pu();Xc();Cd=class{constructor(){this._detections=[],this._initialized=false,this.resolver=new Vt,this.loader=new Rl,this.cache=Se,this._backgroundLoader=new wl(this.loader),this._backgroundLoader.active=true,this.reset();}async init(e={}){if(this._initialized){N("[Assets]AssetManager already initialized, did you load before calling this Assets.init()?");return}if(this._initialized=true,e.defaultSearchParams&&this.resolver.setDefaultSearchParams(e.defaultSearchParams),e.basePath&&(this.resolver.basePath=e.basePath),e.bundleIdentifier&&this.resolver.setBundleIdentifier(e.bundleIdentifier),e.manifest){let n=e.manifest;typeof n=="string"&&(n=await this.load(n)),this.resolver.addManifest(n);}let t=e.texturePreference?.resolution??1,i=typeof t=="number"?[t]:t,s=await this._detectFormats({preferredFormats:e.texturePreference?.format,skipDetections:e.skipDetections,detections:this._detections});this.resolver.prefer({params:{format:s,resolution:i}}),e.preferences&&this.setPreferences(e.preferences);}add(e){this.resolver.add(e);}async load(e,t){this._initialized||await this.init();let i=ss(e),s=Ht(e).map(a=>{if(typeof a!="string"){let u=this.resolver.getAlias(a);return u.some(l=>!this.resolver.hasKey(l))&&this.add(a),Array.isArray(u)?u[0]:u}return this.resolver.hasKey(a)||this.add({alias:a,src:a}),a}),n=this.resolver.resolve(s),o=await this._mapLoadToResolve(n,t);return i?o[s[0]]:o}addBundle(e,t){this.resolver.addBundle(e,t);}async loadBundle(e,t){this._initialized||await this.init();let i=false;typeof e=="string"&&(i=true,e=[e]);let s=this.resolver.resolveBundle(e),n={},o=Object.keys(s),a=0,u=0,l=()=>{t?.(++a/u);},c=o.map(h=>{let d=s[h];return u+=Object.keys(d).length,this._mapLoadToResolve(d,l).then(p=>{n[h]=p;})});return await Promise.all(c),i?n[e[0]]:n}async backgroundLoad(e){this._initialized||await this.init(),typeof e=="string"&&(e=[e]);let t=this.resolver.resolve(e);this._backgroundLoader.add(Object.values(t));}async backgroundLoadBundle(e){this._initialized||await this.init(),typeof e=="string"&&(e=[e]);let t=this.resolver.resolveBundle(e);Object.values(t).forEach(i=>{this._backgroundLoader.add(Object.values(i));});}reset(){this.resolver.reset(),this.loader.reset(),this.cache.reset(),this._initialized=false;}get(e){if(typeof e=="string")return Se.get(e);let t={};for(let i=0;i<e.length;i++)t[i]=Se.get(e[i]);return t}async _mapLoadToResolve(e,t){let i=[...new Set(Object.values(e))];this._backgroundLoader.active=false;let s=await this.loader.load(i,t);this._backgroundLoader.active=true;let n={};return i.forEach(o=>{let a=s[o.src],u=[o.src];o.alias&&u.push(...o.alias),u.forEach(l=>{n[l]=a;}),Se.set(u,a);}),n}async unload(e){this._initialized||await this.init();let t=Ht(e).map(s=>typeof s!="string"?s.src:s),i=this.resolver.resolve(t);await this._unloadFromResolved(i);}async unloadBundle(e){this._initialized||await this.init(),e=Ht(e);let t=this.resolver.resolveBundle(e),i=Object.keys(t).map(s=>this._unloadFromResolved(t[s]));await Promise.all(i);}async _unloadFromResolved(e){let t=Object.values(e);t.forEach(i=>{Se.remove(i.src);}),await this.loader.unload(t);}async _detectFormats(e){let t=[];e.preferredFormats&&(t=Array.isArray(e.preferredFormats)?e.preferredFormats:[e.preferredFormats]);for(let i of e.detections)e.skipDetections||await i.test()?t=await i.add(t):e.skipDetections||(t=await i.remove(t));return t=t.filter((i,s)=>t.indexOf(i)===s),t}get detections(){return this._detections}setPreferences(e){this.loader.parsers.forEach(t=>{t.config&&Object.keys(t.config).filter(i=>i in e).forEach(i=>{t.config[i]=e[i];});});}},exports.Assets=new Cd;V.handleByList(x.LoadParser,exports.Assets.loader.parsers).handleByList(x.ResolveParser,exports.Assets.resolver.parsers).handleByList(x.CacheParser,exports.Assets.cache.parsers).handleByList(x.DetectionParser,exports.Assets.detections);V.add(f_,g_,m_,y_,x_,__,b_,v_,T_,S_,E_,kl,A_,d_,h_,Ol,w_);g3={loader:x.LoadParser,resolver:x.ResolveParser,cache:x.CacheParser,detection:x.DetectionParser};V.handle(x.Asset,r=>{let e=r.ref;Object.entries(g3).filter(([t])=>!!e[t]).forEach(([t,i])=>V.add(Object.assign(e[t],{extension:e[t].extension??i})));},r=>{let e=r.ref;Object.keys(g3).filter(t=>!!e[t]).forEach(t=>V.remove(e[t]));});});var _3,b3=f(()=>{B();rl();il();_3={extension:{type:x.DetectionParser,priority:3},test:async()=>!!(await Oi()||ki()),add:async r=>[...r,"basis"],remove:async r=>r.filter(e=>e!=="basis")};});var jr,Fl=f(()=>{Ct();jr=class extends ge{constructor(e){super(e),this.uploadMethodId="compressed",this.resource=e.resource,this.mipLevelCount=this.resource.length;}};});function Ad(){if(B_)return B_;let e=document.createElement("canvas").getContext("webgl");return e?(B_=[...e.getExtension("EXT_texture_compression_bptc")?["bc6h-rgb-ufloat","bc6h-rgb-float","bc7-rgba-unorm","bc7-rgba-unorm-srgb"]:[],...e.getExtension("WEBGL_compressed_texture_s3tc")?["bc1-rgba-unorm","bc2-rgba-unorm","bc3-rgba-unorm"]:[],...e.getExtension("WEBGL_compressed_texture_s3tc_srgb")?["bc1-rgba-unorm-srgb","bc2-rgba-unorm-srgb","bc3-rgba-unorm-srgb"]:[],...e.getExtension("EXT_texture_compression_rgtc")?["bc4-r-unorm","bc4-r-snorm","bc5-rg-unorm","bc5-rg-snorm"]:[],...e.getExtension("WEBGL_compressed_texture_etc")?["etc2-rgb8unorm","etc2-rgb8unorm-srgb","etc2-rgba8unorm","etc2-rgba8unorm-srgb","etc2-rgb8a1unorm","etc2-rgb8a1unorm-srgb","eac-r11unorm","eac-rg11unorm"]:[],...e.getExtension("WEBGL_compressed_texture_astc")?["astc-4x4-unorm","astc-4x4-unorm-srgb","astc-5x4-unorm","astc-5x4-unorm-srgb","astc-5x5-unorm","astc-5x5-unorm-srgb","astc-6x5-unorm","astc-6x5-unorm-srgb","astc-6x6-unorm","astc-6x6-unorm-srgb","astc-8x5-unorm","astc-8x5-unorm-srgb","astc-8x6-unorm","astc-8x6-unorm-srgb","astc-8x8-unorm","astc-8x8-unorm-srgb","astc-10x5-unorm","astc-10x5-unorm-srgb","astc-10x6-unorm","astc-10x6-unorm-srgb","astc-10x8-unorm","astc-10x8-unorm-srgb","astc-10x10-unorm","astc-10x10-unorm-srgb","astc-12x10-unorm","astc-12x10-unorm-srgb","astc-12x12-unorm","astc-12x12-unorm-srgb"]:[]],B_):[]}var B_,UE=f(()=>{});async function Pd(){if(R_)return R_;let r=await j.get().getNavigator().gpu.requestAdapter();return R_=[...r.features.has("texture-compression-bc")?["bc1-rgba-unorm","bc1-rgba-unorm-srgb","bc2-rgba-unorm","bc2-rgba-unorm-srgb","bc3-rgba-unorm","bc3-rgba-unorm-srgb","bc4-r-unorm","bc4-r-snorm","bc5-rg-unorm","bc5-rg-snorm","bc6h-rgb-ufloat","bc6h-rgb-float","bc7-rgba-unorm","bc7-rgba-unorm-srgb"]:[],...r.features.has("texture-compression-etc2")?["etc2-rgb8unorm","etc2-rgb8unorm-srgb","etc2-rgb8a1unorm","etc2-rgb8a1unorm-srgb","etc2-rgba8unorm","etc2-rgba8unorm-srgb","eac-r11unorm","eac-r11snorm","eac-rg11unorm","eac-rg11snorm"]:[],...r.features.has("texture-compression-astc")?["astc-4x4-unorm","astc-4x4-unorm-srgb","astc-5x4-unorm","astc-5x4-unorm-srgb","astc-5x5-unorm","astc-5x5-unorm-srgb","astc-6x5-unorm","astc-6x5-unorm-srgb","astc-6x6-unorm","astc-6x6-unorm-srgb","astc-8x5-unorm","astc-8x5-unorm-srgb","astc-8x6-unorm","astc-8x6-unorm-srgb","astc-8x8-unorm","astc-8x8-unorm-srgb","astc-10x5-unorm","astc-10x5-unorm-srgb","astc-10x6-unorm","astc-10x6-unorm-srgb","astc-10x8-unorm","astc-10x8-unorm-srgb","astc-10x10-unorm","astc-10x10-unorm-srgb","astc-12x10-unorm","astc-12x10-unorm-srgb","astc-12x12-unorm","astc-12x12-unorm-srgb"]:[]],R_}var R_,LE=f(()=>{Fe();});async function Gl(){return M_!==void 0||(M_=await(async()=>{let r=await Oi(),e=ki();if(r&&e){let t=await Pd(),i=Ad();return t.filter(s=>i.includes(s))}else {if(r)return await Pd();if(e)return Ad()}return []})()),M_}var M_,I_=f(()=>{rl();il();UE();LE();});async function Gi(){if(D_!==void 0)return D_;let r=await Gl();return D_=[...NE,...r],D_}var NE,D_,Ul=f(()=>{I_();NE=["r8unorm","r8snorm","r8uint","r8sint","r16uint","r16sint","r16float","rg8unorm","rg8snorm","rg8uint","rg8sint","r32uint","r32sint","r32float","rg16uint","rg16sint","rg16float","rgba8unorm","rgba8unorm-srgb","rgba8snorm","rgba8uint","rgba8sint","bgra8unorm","bgra8unorm-srgb","rgb9e5ufloat","rgb10a2unorm","rg11b10ufloat","rg32uint","rg32sint","rg32float","rgba16uint","rgba16sint","rgba16float","rgba32uint","rgba32sint","rgba32float","stencil8","depth16unorm","depth24plus","depth24plus-stencil8","depth32float","depth32float-stencil8"];});var FO,Ll,wd,y3=f(()=>{FO=`(function () {
2092
2092
  'use strict';
2093
2093
 
2094
2094
  function createLevelBuffers(basisTexture, basisTranscoderFormat) {
@@ -2224,8 +2224,8 @@ ${h}`)}});return await Promise.all(u),n?s[o[0].src]:s}async unload(e){let i=Ht(e
2224
2224
  };
2225
2225
 
2226
2226
  })();
2227
- `,Ll=null,wd=class{constructor(){Ll||(Ll=URL.createObjectURL(new Blob([FO],{type:"application/javascript"}))),this.worker=new Worker(Ll);}};wd.revokeObjectURL=function(){Ll&&(URL.revokeObjectURL(Ll),Ll=null);};});function v3(r){Object.assign(Nl,r);}var Nl,HE=f(()=>{Nl={jsUrl:"https://files.pixijs.download/transcoders/basis/basis_transcoder.js",wasmUrl:"https://files.pixijs.download/transcoders/basis/basis_transcoder.wasm"};});function GO(r){return Bd||(Bd=new wd().worker,Bd.onmessage=e=>{let{success:t,url:i,textureOptions:s}=e.data;t||console.warn("Failed to load Basis texture",i),T3[i](s);},Bd.postMessage({type:"init",jsUrl:Nl.jsUrl,wasmUrl:Nl.wasmUrl,supportedTextures:r})),Bd}function k_(r,e){let t=GO(e);return new Promise(i=>{T3[r]=i,t.postMessage({type:"load",url:r});})}var Bd,T3,VE=f(()=>{y3();HE();T3={};});var S3,E3=f(()=>{Er();ms();wr();B();Fl();Ul();VE();S3={extension:{type:x.LoadParser,priority:ze.High,name:"loadBasis"},name:"loadBasis",test(r){return it(r,[".basis"])},async load(r,e,t){let i=await Gi(),s=await k_(r,i),n=new $r(s);return Kt(n,t,r)},unload(r){Array.isArray(r)?r.forEach(e=>e.destroy(true)):r.destroy(true);}};});function C3(r,e){let t=r.getNumImages(),i=r.getNumLevels(0);if(!r.startTranscoding())throw new Error("startTranscoding failed");let n=[];for(let o=0;o<i;++o)for(let a=0;a<t;++a){let u=r.getImageTranscodedSizeInBytes(a,o,e),l=new Uint8Array(u);if(!r.transcodeImage(l,a,o,e,1,0))throw new Error("transcodeImage failed");n.push(l);}return n}var A3=f(()=>{});function P3(r){let e=UO[r];if(e)return e;throw new Error(`Unsupported transcoderFormat: ${r}`)}var UO,w3=f(()=>{UO={"bc3-rgba-unorm":3,"bc7-rgba-unorm":6,"etc2-rgba8unorm":1,"astc-4x4-unorm":10,rgba8unorm:13,rgba4unorm:16};});function kt(r){return r.charCodeAt(0)+(r.charCodeAt(1)<<8)+(r.charCodeAt(2)<<16)+(r.charCodeAt(3)<<24)}var LO,NO,O_,F_,nr,Rd,Zt,ne,G_,zE=f(()=>{LO={MAGIC:0,SIZE:1,FLAGS:2,HEIGHT:3,WIDTH:4,MIPMAP_COUNT:7,PIXEL_FORMAT:19,PF_FLAGS:20,FOURCC:21,RGB_BITCOUNT:22,R_BIT_MASK:23,G_BIT_MASK:24,B_BIT_MASK:25,A_BIT_MASK:26},NO={DXGI_FORMAT:0,RESOURCE_DIMENSION:1,MISC_FLAG:2,ARRAY_SIZE:3,MISC_FLAGS2:4},O_=(r=>(r[r.DXGI_FORMAT_UNKNOWN=0]="DXGI_FORMAT_UNKNOWN",r[r.DXGI_FORMAT_R32G32B32A32_TYPELESS=1]="DXGI_FORMAT_R32G32B32A32_TYPELESS",r[r.DXGI_FORMAT_R32G32B32A32_FLOAT=2]="DXGI_FORMAT_R32G32B32A32_FLOAT",r[r.DXGI_FORMAT_R32G32B32A32_UINT=3]="DXGI_FORMAT_R32G32B32A32_UINT",r[r.DXGI_FORMAT_R32G32B32A32_SINT=4]="DXGI_FORMAT_R32G32B32A32_SINT",r[r.DXGI_FORMAT_R32G32B32_TYPELESS=5]="DXGI_FORMAT_R32G32B32_TYPELESS",r[r.DXGI_FORMAT_R32G32B32_FLOAT=6]="DXGI_FORMAT_R32G32B32_FLOAT",r[r.DXGI_FORMAT_R32G32B32_UINT=7]="DXGI_FORMAT_R32G32B32_UINT",r[r.DXGI_FORMAT_R32G32B32_SINT=8]="DXGI_FORMAT_R32G32B32_SINT",r[r.DXGI_FORMAT_R16G16B16A16_TYPELESS=9]="DXGI_FORMAT_R16G16B16A16_TYPELESS",r[r.DXGI_FORMAT_R16G16B16A16_FLOAT=10]="DXGI_FORMAT_R16G16B16A16_FLOAT",r[r.DXGI_FORMAT_R16G16B16A16_UNORM=11]="DXGI_FORMAT_R16G16B16A16_UNORM",r[r.DXGI_FORMAT_R16G16B16A16_UINT=12]="DXGI_FORMAT_R16G16B16A16_UINT",r[r.DXGI_FORMAT_R16G16B16A16_SNORM=13]="DXGI_FORMAT_R16G16B16A16_SNORM",r[r.DXGI_FORMAT_R16G16B16A16_SINT=14]="DXGI_FORMAT_R16G16B16A16_SINT",r[r.DXGI_FORMAT_R32G32_TYPELESS=15]="DXGI_FORMAT_R32G32_TYPELESS",r[r.DXGI_FORMAT_R32G32_FLOAT=16]="DXGI_FORMAT_R32G32_FLOAT",r[r.DXGI_FORMAT_R32G32_UINT=17]="DXGI_FORMAT_R32G32_UINT",r[r.DXGI_FORMAT_R32G32_SINT=18]="DXGI_FORMAT_R32G32_SINT",r[r.DXGI_FORMAT_R32G8X24_TYPELESS=19]="DXGI_FORMAT_R32G8X24_TYPELESS",r[r.DXGI_FORMAT_D32_FLOAT_S8X24_UINT=20]="DXGI_FORMAT_D32_FLOAT_S8X24_UINT",r[r.DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS=21]="DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS",r[r.DXGI_FORMAT_X32_TYPELESS_G8X24_UINT=22]="DXGI_FORMAT_X32_TYPELESS_G8X24_UINT",r[r.DXGI_FORMAT_R10G10B10A2_TYPELESS=23]="DXGI_FORMAT_R10G10B10A2_TYPELESS",r[r.DXGI_FORMAT_R10G10B10A2_UNORM=24]="DXGI_FORMAT_R10G10B10A2_UNORM",r[r.DXGI_FORMAT_R10G10B10A2_UINT=25]="DXGI_FORMAT_R10G10B10A2_UINT",r[r.DXGI_FORMAT_R11G11B10_FLOAT=26]="DXGI_FORMAT_R11G11B10_FLOAT",r[r.DXGI_FORMAT_R8G8B8A8_TYPELESS=27]="DXGI_FORMAT_R8G8B8A8_TYPELESS",r[r.DXGI_FORMAT_R8G8B8A8_UNORM=28]="DXGI_FORMAT_R8G8B8A8_UNORM",r[r.DXGI_FORMAT_R8G8B8A8_UNORM_SRGB=29]="DXGI_FORMAT_R8G8B8A8_UNORM_SRGB",r[r.DXGI_FORMAT_R8G8B8A8_UINT=30]="DXGI_FORMAT_R8G8B8A8_UINT",r[r.DXGI_FORMAT_R8G8B8A8_SNORM=31]="DXGI_FORMAT_R8G8B8A8_SNORM",r[r.DXGI_FORMAT_R8G8B8A8_SINT=32]="DXGI_FORMAT_R8G8B8A8_SINT",r[r.DXGI_FORMAT_R16G16_TYPELESS=33]="DXGI_FORMAT_R16G16_TYPELESS",r[r.DXGI_FORMAT_R16G16_FLOAT=34]="DXGI_FORMAT_R16G16_FLOAT",r[r.DXGI_FORMAT_R16G16_UNORM=35]="DXGI_FORMAT_R16G16_UNORM",r[r.DXGI_FORMAT_R16G16_UINT=36]="DXGI_FORMAT_R16G16_UINT",r[r.DXGI_FORMAT_R16G16_SNORM=37]="DXGI_FORMAT_R16G16_SNORM",r[r.DXGI_FORMAT_R16G16_SINT=38]="DXGI_FORMAT_R16G16_SINT",r[r.DXGI_FORMAT_R32_TYPELESS=39]="DXGI_FORMAT_R32_TYPELESS",r[r.DXGI_FORMAT_D32_FLOAT=40]="DXGI_FORMAT_D32_FLOAT",r[r.DXGI_FORMAT_R32_FLOAT=41]="DXGI_FORMAT_R32_FLOAT",r[r.DXGI_FORMAT_R32_UINT=42]="DXGI_FORMAT_R32_UINT",r[r.DXGI_FORMAT_R32_SINT=43]="DXGI_FORMAT_R32_SINT",r[r.DXGI_FORMAT_R24G8_TYPELESS=44]="DXGI_FORMAT_R24G8_TYPELESS",r[r.DXGI_FORMAT_D24_UNORM_S8_UINT=45]="DXGI_FORMAT_D24_UNORM_S8_UINT",r[r.DXGI_FORMAT_R24_UNORM_X8_TYPELESS=46]="DXGI_FORMAT_R24_UNORM_X8_TYPELESS",r[r.DXGI_FORMAT_X24_TYPELESS_G8_UINT=47]="DXGI_FORMAT_X24_TYPELESS_G8_UINT",r[r.DXGI_FORMAT_R8G8_TYPELESS=48]="DXGI_FORMAT_R8G8_TYPELESS",r[r.DXGI_FORMAT_R8G8_UNORM=49]="DXGI_FORMAT_R8G8_UNORM",r[r.DXGI_FORMAT_R8G8_UINT=50]="DXGI_FORMAT_R8G8_UINT",r[r.DXGI_FORMAT_R8G8_SNORM=51]="DXGI_FORMAT_R8G8_SNORM",r[r.DXGI_FORMAT_R8G8_SINT=52]="DXGI_FORMAT_R8G8_SINT",r[r.DXGI_FORMAT_R16_TYPELESS=53]="DXGI_FORMAT_R16_TYPELESS",r[r.DXGI_FORMAT_R16_FLOAT=54]="DXGI_FORMAT_R16_FLOAT",r[r.DXGI_FORMAT_D16_UNORM=55]="DXGI_FORMAT_D16_UNORM",r[r.DXGI_FORMAT_R16_UNORM=56]="DXGI_FORMAT_R16_UNORM",r[r.DXGI_FORMAT_R16_UINT=57]="DXGI_FORMAT_R16_UINT",r[r.DXGI_FORMAT_R16_SNORM=58]="DXGI_FORMAT_R16_SNORM",r[r.DXGI_FORMAT_R16_SINT=59]="DXGI_FORMAT_R16_SINT",r[r.DXGI_FORMAT_R8_TYPELESS=60]="DXGI_FORMAT_R8_TYPELESS",r[r.DXGI_FORMAT_R8_UNORM=61]="DXGI_FORMAT_R8_UNORM",r[r.DXGI_FORMAT_R8_UINT=62]="DXGI_FORMAT_R8_UINT",r[r.DXGI_FORMAT_R8_SNORM=63]="DXGI_FORMAT_R8_SNORM",r[r.DXGI_FORMAT_R8_SINT=64]="DXGI_FORMAT_R8_SINT",r[r.DXGI_FORMAT_A8_UNORM=65]="DXGI_FORMAT_A8_UNORM",r[r.DXGI_FORMAT_R1_UNORM=66]="DXGI_FORMAT_R1_UNORM",r[r.DXGI_FORMAT_R9G9B9E5_SHAREDEXP=67]="DXGI_FORMAT_R9G9B9E5_SHAREDEXP",r[r.DXGI_FORMAT_R8G8_B8G8_UNORM=68]="DXGI_FORMAT_R8G8_B8G8_UNORM",r[r.DXGI_FORMAT_G8R8_G8B8_UNORM=69]="DXGI_FORMAT_G8R8_G8B8_UNORM",r[r.DXGI_FORMAT_BC1_TYPELESS=70]="DXGI_FORMAT_BC1_TYPELESS",r[r.DXGI_FORMAT_BC1_UNORM=71]="DXGI_FORMAT_BC1_UNORM",r[r.DXGI_FORMAT_BC1_UNORM_SRGB=72]="DXGI_FORMAT_BC1_UNORM_SRGB",r[r.DXGI_FORMAT_BC2_TYPELESS=73]="DXGI_FORMAT_BC2_TYPELESS",r[r.DXGI_FORMAT_BC2_UNORM=74]="DXGI_FORMAT_BC2_UNORM",r[r.DXGI_FORMAT_BC2_UNORM_SRGB=75]="DXGI_FORMAT_BC2_UNORM_SRGB",r[r.DXGI_FORMAT_BC3_TYPELESS=76]="DXGI_FORMAT_BC3_TYPELESS",r[r.DXGI_FORMAT_BC3_UNORM=77]="DXGI_FORMAT_BC3_UNORM",r[r.DXGI_FORMAT_BC3_UNORM_SRGB=78]="DXGI_FORMAT_BC3_UNORM_SRGB",r[r.DXGI_FORMAT_BC4_TYPELESS=79]="DXGI_FORMAT_BC4_TYPELESS",r[r.DXGI_FORMAT_BC4_UNORM=80]="DXGI_FORMAT_BC4_UNORM",r[r.DXGI_FORMAT_BC4_SNORM=81]="DXGI_FORMAT_BC4_SNORM",r[r.DXGI_FORMAT_BC5_TYPELESS=82]="DXGI_FORMAT_BC5_TYPELESS",r[r.DXGI_FORMAT_BC5_UNORM=83]="DXGI_FORMAT_BC5_UNORM",r[r.DXGI_FORMAT_BC5_SNORM=84]="DXGI_FORMAT_BC5_SNORM",r[r.DXGI_FORMAT_B5G6R5_UNORM=85]="DXGI_FORMAT_B5G6R5_UNORM",r[r.DXGI_FORMAT_B5G5R5A1_UNORM=86]="DXGI_FORMAT_B5G5R5A1_UNORM",r[r.DXGI_FORMAT_B8G8R8A8_UNORM=87]="DXGI_FORMAT_B8G8R8A8_UNORM",r[r.DXGI_FORMAT_B8G8R8X8_UNORM=88]="DXGI_FORMAT_B8G8R8X8_UNORM",r[r.DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM=89]="DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM",r[r.DXGI_FORMAT_B8G8R8A8_TYPELESS=90]="DXGI_FORMAT_B8G8R8A8_TYPELESS",r[r.DXGI_FORMAT_B8G8R8A8_UNORM_SRGB=91]="DXGI_FORMAT_B8G8R8A8_UNORM_SRGB",r[r.DXGI_FORMAT_B8G8R8X8_TYPELESS=92]="DXGI_FORMAT_B8G8R8X8_TYPELESS",r[r.DXGI_FORMAT_B8G8R8X8_UNORM_SRGB=93]="DXGI_FORMAT_B8G8R8X8_UNORM_SRGB",r[r.DXGI_FORMAT_BC6H_TYPELESS=94]="DXGI_FORMAT_BC6H_TYPELESS",r[r.DXGI_FORMAT_BC6H_UF16=95]="DXGI_FORMAT_BC6H_UF16",r[r.DXGI_FORMAT_BC6H_SF16=96]="DXGI_FORMAT_BC6H_SF16",r[r.DXGI_FORMAT_BC7_TYPELESS=97]="DXGI_FORMAT_BC7_TYPELESS",r[r.DXGI_FORMAT_BC7_UNORM=98]="DXGI_FORMAT_BC7_UNORM",r[r.DXGI_FORMAT_BC7_UNORM_SRGB=99]="DXGI_FORMAT_BC7_UNORM_SRGB",r[r.DXGI_FORMAT_AYUV=100]="DXGI_FORMAT_AYUV",r[r.DXGI_FORMAT_Y410=101]="DXGI_FORMAT_Y410",r[r.DXGI_FORMAT_Y416=102]="DXGI_FORMAT_Y416",r[r.DXGI_FORMAT_NV12=103]="DXGI_FORMAT_NV12",r[r.DXGI_FORMAT_P010=104]="DXGI_FORMAT_P010",r[r.DXGI_FORMAT_P016=105]="DXGI_FORMAT_P016",r[r.DXGI_FORMAT_420_OPAQUE=106]="DXGI_FORMAT_420_OPAQUE",r[r.DXGI_FORMAT_YUY2=107]="DXGI_FORMAT_YUY2",r[r.DXGI_FORMAT_Y210=108]="DXGI_FORMAT_Y210",r[r.DXGI_FORMAT_Y216=109]="DXGI_FORMAT_Y216",r[r.DXGI_FORMAT_NV11=110]="DXGI_FORMAT_NV11",r[r.DXGI_FORMAT_AI44=111]="DXGI_FORMAT_AI44",r[r.DXGI_FORMAT_IA44=112]="DXGI_FORMAT_IA44",r[r.DXGI_FORMAT_P8=113]="DXGI_FORMAT_P8",r[r.DXGI_FORMAT_A8P8=114]="DXGI_FORMAT_A8P8",r[r.DXGI_FORMAT_B4G4R4A4_UNORM=115]="DXGI_FORMAT_B4G4R4A4_UNORM",r[r.DXGI_FORMAT_P208=116]="DXGI_FORMAT_P208",r[r.DXGI_FORMAT_V208=117]="DXGI_FORMAT_V208",r[r.DXGI_FORMAT_V408=118]="DXGI_FORMAT_V408",r[r.DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE=119]="DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE",r[r.DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE=120]="DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE",r[r.DXGI_FORMAT_FORCE_UINT=121]="DXGI_FORMAT_FORCE_UINT",r))(O_||{}),F_=(r=>(r[r.DDS_DIMENSION_TEXTURE1D=2]="DDS_DIMENSION_TEXTURE1D",r[r.DDS_DIMENSION_TEXTURE2D=3]="DDS_DIMENSION_TEXTURE2D",r[r.DDS_DIMENSION_TEXTURE3D=6]="DDS_DIMENSION_TEXTURE3D",r))(F_||{});nr=(r=>(r[r.UNKNOWN=0]="UNKNOWN",r[r.R8G8B8=20]="R8G8B8",r[r.A8R8G8B8=21]="A8R8G8B8",r[r.X8R8G8B8=22]="X8R8G8B8",r[r.R5G6B5=23]="R5G6B5",r[r.X1R5G5B5=24]="X1R5G5B5",r[r.A1R5G5B5=25]="A1R5G5B5",r[r.A4R4G4B4=26]="A4R4G4B4",r[r.R3G3B2=27]="R3G3B2",r[r.A8=28]="A8",r[r.A8R3G3B2=29]="A8R3G3B2",r[r.X4R4G4B4=30]="X4R4G4B4",r[r.A2B10G10R10=31]="A2B10G10R10",r[r.A8B8G8R8=32]="A8B8G8R8",r[r.X8B8G8R8=33]="X8B8G8R8",r[r.G16R16=34]="G16R16",r[r.A2R10G10B10=35]="A2R10G10B10",r[r.A16B16G16R16=36]="A16B16G16R16",r[r.A8P8=40]="A8P8",r[r.P8=41]="P8",r[r.L8=50]="L8",r[r.A8L8=51]="A8L8",r[r.A4L4=52]="A4L4",r[r.V8U8=60]="V8U8",r[r.L6V5U5=61]="L6V5U5",r[r.X8L8V8U8=62]="X8L8V8U8",r[r.Q8W8V8U8=63]="Q8W8V8U8",r[r.V16U16=64]="V16U16",r[r.A2W10V10U10=67]="A2W10V10U10",r[r.Q16W16V16U16=110]="Q16W16V16U16",r[r.R16F=111]="R16F",r[r.G16R16F=112]="G16R16F",r[r.A16B16G16R16F=113]="A16B16G16R16F",r[r.R32F=114]="R32F",r[r.G32R32F=115]="G32R32F",r[r.A32B32G32R32F=116]="A32B32G32R32F",r[r.UYVY=kt("UYVY")]="UYVY",r[r.R8G8_B8G8=kt("RGBG")]="R8G8_B8G8",r[r.YUY2=kt("YUY2")]="YUY2",r[r.D3DFMT_G8R8_G8B8=kt("GRGB")]="D3DFMT_G8R8_G8B8",r[r.DXT1=kt("DXT1")]="DXT1",r[r.DXT2=kt("DXT2")]="DXT2",r[r.DXT3=kt("DXT3")]="DXT3",r[r.DXT4=kt("DXT4")]="DXT4",r[r.DXT5=kt("DXT5")]="DXT5",r[r.ATI1=kt("ATI1")]="ATI1",r[r.AT1N=kt("AT1N")]="AT1N",r[r.ATI2=kt("ATI2")]="ATI2",r[r.AT2N=kt("AT2N")]="AT2N",r[r.BC4U=kt("BC4U")]="BC4U",r[r.BC4S=kt("BC4S")]="BC4S",r[r.BC5U=kt("BC5U")]="BC5U",r[r.BC5S=kt("BC5S")]="BC5S",r[r.DX10=kt("DX10")]="DX10",r))(nr||{}),Rd={[nr.DXT1]:"bc1-rgba-unorm",[nr.DXT2]:"bc2-rgba-unorm",[nr.DXT3]:"bc2-rgba-unorm",[nr.DXT4]:"bc3-rgba-unorm",[nr.DXT5]:"bc3-rgba-unorm",[nr.ATI1]:"bc4-r-unorm",[nr.BC4U]:"bc4-r-unorm",[nr.BC4S]:"bc4-r-snorm",[nr.ATI2]:"bc5-rg-unorm",[nr.BC5U]:"bc5-rg-unorm",[nr.BC5S]:"bc5-rg-snorm",36:"rgba16uint",110:"rgba16sint",111:"r16float",112:"rg16float",113:"rgba16float",114:"r32float",115:"rg32float",116:"rgba32float"},Zt={70:"bc1-rgba-unorm",71:"bc1-rgba-unorm",72:"bc1-rgba-unorm-srgb",73:"bc2-rgba-unorm",74:"bc2-rgba-unorm",75:"bc2-rgba-unorm-srgb",76:"bc3-rgba-unorm",77:"bc3-rgba-unorm",78:"bc3-rgba-unorm-srgb",79:"bc4-r-unorm",80:"bc4-r-unorm",81:"bc4-r-snorm",82:"bc5-rg-unorm",83:"bc5-rg-unorm",84:"bc5-rg-snorm",94:"bc6h-rgb-ufloat",95:"bc6h-rgb-ufloat",96:"bc6h-rgb-float",97:"bc7-rgba-unorm",98:"bc7-rgba-unorm",99:"bc7-rgba-unorm-srgb",28:"rgba8unorm",29:"rgba8unorm-srgb",87:"bgra8unorm",91:"bgra8unorm-srgb",41:"r32float",49:"rg8unorm",56:"r16uint",61:"r8unorm",24:"rgb10a2unorm",11:"rgba16uint",13:"rgba16sint",10:"rgba16float",54:"r16float",34:"rg16float",16:"rg32float",2:"rgba32float"},ne={MAGIC_VALUE:542327876,MAGIC_SIZE:4,HEADER_SIZE:124,HEADER_DX10_SIZE:20,PIXEL_FORMAT_FLAGS:{ALPHAPIXELS:1,ALPHA:2,FOURCC:4,RGB:64,RGBA:65,YUV:512,LUMINANCE:131072,LUMINANCEA:131073},RESOURCE_MISC_TEXTURECUBE:4,HEADER_FIELDS:LO,HEADER_DX10_FIELDS:NO,DXGI_FORMAT:O_,D3D10_RESOURCE_DIMENSION:F_,D3DFMT:nr},G_={"bc1-rgba-unorm":8,"bc1-rgba-unorm-srgb":8,"bc2-rgba-unorm":16,"bc2-rgba-unorm-srgb":16,"bc3-rgba-unorm":16,"bc3-rgba-unorm-srgb":16,"bc4-r-unorm":8,"bc4-r-snorm":8,"bc5-rg-unorm":16,"bc5-rg-snorm":16,"bc6h-rgb-ufloat":16,"bc6h-rgb-float":16,"bc7-rgba-unorm":16,"bc7-rgba-unorm-srgb":16};});function U_(r,e){let{format:t,fourCC:i,width:s,height:n,dataOffset:o,mipmapCount:a}=VO(r);if(!e.includes(t))throw new Error(`Unsupported texture format: ${i} ${t}, supported: ${e}`);if(a<=1)return {format:t,width:s,height:n,resource:[new Uint8Array(r,o)],alphaMode:"no-premultiply-alpha"};let u=HO(t,s,n,o,a,r);return {format:t,width:s,height:n,resource:u,alphaMode:"no-premultiply-alpha"}}function HO(r,e,t,i,s,n){let o=[],a=G_[r],u=e,l=t,c=i;for(let h=0;h<s;++h){let d=Math.ceil(Math.max(4,u)/4)*4,p=Math.ceil(Math.max(4,l)/4)*4,m=a?d/4*p/4*a:u*l*4,b=new Uint8Array(n,c,m);o.push(b),c+=m,u=Math.max(u>>1,1),l=Math.max(l>>1,1);}return o}function VO(r){let e=new Uint32Array(r,0,ne.HEADER_SIZE/Uint32Array.BYTES_PER_ELEMENT);if(e[ne.HEADER_FIELDS.MAGIC]!==ne.MAGIC_VALUE)throw new Error("Invalid magic number in DDS header");let t=e[ne.HEADER_FIELDS.HEIGHT],i=e[ne.HEADER_FIELDS.WIDTH],s=Math.max(1,e[ne.HEADER_FIELDS.MIPMAP_COUNT]),n=e[ne.HEADER_FIELDS.PF_FLAGS],o=e[ne.HEADER_FIELDS.FOURCC],a=zO(e,n,o,r),u=ne.MAGIC_SIZE+ne.HEADER_SIZE+(o===ne.D3DFMT.DX10?ne.HEADER_DX10_SIZE:0);return {format:a,fourCC:o,width:i,height:t,dataOffset:u,mipmapCount:s}}function zO(r,e,t,i){if(e&ne.PIXEL_FORMAT_FLAGS.FOURCC){if(t===ne.D3DFMT.DX10){let s=new Uint32Array(i,ne.MAGIC_SIZE+ne.HEADER_SIZE,ne.HEADER_DX10_SIZE/Uint32Array.BYTES_PER_ELEMENT);if(s[ne.HEADER_DX10_FIELDS.MISC_FLAG]===ne.RESOURCE_MISC_TEXTURECUBE)throw new Error("DDSParser does not support cubemap textures");if(s[ne.HEADER_DX10_FIELDS.RESOURCE_DIMENSION]===ne.D3D10_RESOURCE_DIMENSION.DDS_DIMENSION_TEXTURE3D)throw new Error("DDSParser does not supported 3D texture data");let a=s[ne.HEADER_DX10_FIELDS.DXGI_FORMAT];if(a in Zt)return Zt[a];throw new Error(`DDSParser cannot parse texture data with DXGI format ${a}`)}if(t in Rd)return Rd[t];throw new Error(`DDSParser cannot parse texture data with fourCC format ${t}`)}if(e&ne.PIXEL_FORMAT_FLAGS.RGB||e&ne.PIXEL_FORMAT_FLAGS.RGBA)return WO(r);throw e&ne.PIXEL_FORMAT_FLAGS.YUV?new Error("DDSParser does not supported YUV uncompressed texture data."):e&ne.PIXEL_FORMAT_FLAGS.LUMINANCE||e&ne.PIXEL_FORMAT_FLAGS.LUMINANCEA?new Error("DDSParser does not support single-channel (lumninance) texture data!"):e&ne.PIXEL_FORMAT_FLAGS.ALPHA||e&ne.PIXEL_FORMAT_FLAGS.ALPHAPIXELS?new Error("DDSParser does not support single-channel (alpha) texture data!"):new Error("DDSParser failed to load a texture file due to an unknown reason!")}function WO(r){let e=r[ne.HEADER_FIELDS.RGB_BITCOUNT],t=r[ne.HEADER_FIELDS.R_BIT_MASK],i=r[ne.HEADER_FIELDS.G_BIT_MASK],s=r[ne.HEADER_FIELDS.B_BIT_MASK],n=r[ne.HEADER_FIELDS.A_BIT_MASK];switch(e){case 32:if(t===255&&i===65280&&s===16711680&&n===4278190080)return Zt[ne.DXGI_FORMAT.DXGI_FORMAT_R8G8B8A8_UNORM];if(t===16711680&&i===65280&&s===255&&n===4278190080)return Zt[ne.DXGI_FORMAT.DXGI_FORMAT_B8G8R8A8_UNORM];if(t===1072693248&&i===1047552&&s===1023&&n===3221225472)return Zt[ne.DXGI_FORMAT.DXGI_FORMAT_R10G10B10A2_UNORM];if(t===65535&&i===4294901760&&s===0&&n===0)return Zt[ne.DXGI_FORMAT.DXGI_FORMAT_R16G16_UNORM];if(t===4294967295&&i===0&&s===0&&n===0)return Zt[ne.DXGI_FORMAT.DXGI_FORMAT_R32_FLOAT];break;case 24:break;case 16:if(t===31744&&i===992&&s===31&&n===32768)return Zt[ne.DXGI_FORMAT.DXGI_FORMAT_B5G5R5A1_UNORM];if(t===63488&&i===2016&&s===31&&n===0)return Zt[ne.DXGI_FORMAT.DXGI_FORMAT_B5G6R5_UNORM];if(t===3840&&i===240&&s===15&&n===61440)return Zt[ne.DXGI_FORMAT.DXGI_FORMAT_B4G4R4A4_UNORM];if(t===255&&i===0&&s===0&&n===65280)return Zt[ne.DXGI_FORMAT.DXGI_FORMAT_R8G8_UNORM];if(t===65535&&i===0&&s===0&&n===0)return Zt[ne.DXGI_FORMAT.DXGI_FORMAT_R16_UNORM];break;case 8:if(t===255&&i===0&&s===0&&n===0)return Zt[ne.DXGI_FORMAT.DXGI_FORMAT_R8_UNORM];break}throw new Error(`DDSParser does not support uncompressed texture with configuration:
2228
- bitCount = ${e}, rBitMask = ${t}, gBitMask = ${i}, aBitMask = ${n}`)}var WE=f(()=>{zE();});var B3,R3=f(()=>{Er();ms();wr();B();Fl();Ul();WE();B3={extension:{type:x.LoadParser,priority:ze.High,name:"loadDDS"},name:"loadDDS",test(r){return it(r,[".dds"])},async load(r,e,t){let i=await Gi(),n=await(await fetch(r)).arrayBuffer(),o=U_(n,i),a=new $r(o);return Kt(a,t,r)},unload(r){Array.isArray(r)?r.forEach(e=>e.destroy(true)):r.destroy(true);}};});var XE,XO,YO,jO,$O,qO,KO,ZO,QO,JO,nt,YE=f(()=>{XE=(r=>(r[r.RGBA8_SNORM=36759]="RGBA8_SNORM",r[r.RGBA=6408]="RGBA",r[r.RGBA8UI=36220]="RGBA8UI",r[r.SRGB8_ALPHA8=35907]="SRGB8_ALPHA8",r[r.RGBA8I=36238]="RGBA8I",r[r.RGBA8=32856]="RGBA8",r[r.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",r[r.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",r[r.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",r[r.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",r[r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=35917]="COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT",r[r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT=35918]="COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT",r[r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=35919]="COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT",r[r.COMPRESSED_SRGB_S3TC_DXT1_EXT=35916]="COMPRESSED_SRGB_S3TC_DXT1_EXT",r[r.COMPRESSED_RED_RGTC1_EXT=36283]="COMPRESSED_RED_RGTC1_EXT",r[r.COMPRESSED_SIGNED_RED_RGTC1_EXT=36284]="COMPRESSED_SIGNED_RED_RGTC1_EXT",r[r.COMPRESSED_RED_GREEN_RGTC2_EXT=36285]="COMPRESSED_RED_GREEN_RGTC2_EXT",r[r.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT=36286]="COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT",r[r.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",r[r.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",r[r.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",r[r.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",r[r.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",r[r.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC",r[r.COMPRESSED_SRGB8_ETC2=37493]="COMPRESSED_SRGB8_ETC2",r[r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",r[r.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37494]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",r[r.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37495]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",r[r.COMPRESSED_RGBA_ASTC_4x4_KHR=37808]="COMPRESSED_RGBA_ASTC_4x4_KHR",r[r.COMPRESSED_RGBA_ASTC_5x4_KHR=37809]="COMPRESSED_RGBA_ASTC_5x4_KHR",r[r.COMPRESSED_RGBA_ASTC_5x5_KHR=37810]="COMPRESSED_RGBA_ASTC_5x5_KHR",r[r.COMPRESSED_RGBA_ASTC_6x5_KHR=37811]="COMPRESSED_RGBA_ASTC_6x5_KHR",r[r.COMPRESSED_RGBA_ASTC_6x6_KHR=37812]="COMPRESSED_RGBA_ASTC_6x6_KHR",r[r.COMPRESSED_RGBA_ASTC_8x5_KHR=37813]="COMPRESSED_RGBA_ASTC_8x5_KHR",r[r.COMPRESSED_RGBA_ASTC_8x6_KHR=37814]="COMPRESSED_RGBA_ASTC_8x6_KHR",r[r.COMPRESSED_RGBA_ASTC_8x8_KHR=37815]="COMPRESSED_RGBA_ASTC_8x8_KHR",r[r.COMPRESSED_RGBA_ASTC_10x5_KHR=37816]="COMPRESSED_RGBA_ASTC_10x5_KHR",r[r.COMPRESSED_RGBA_ASTC_10x6_KHR=37817]="COMPRESSED_RGBA_ASTC_10x6_KHR",r[r.COMPRESSED_RGBA_ASTC_10x8_KHR=37818]="COMPRESSED_RGBA_ASTC_10x8_KHR",r[r.COMPRESSED_RGBA_ASTC_10x10_KHR=37819]="COMPRESSED_RGBA_ASTC_10x10_KHR",r[r.COMPRESSED_RGBA_ASTC_12x10_KHR=37820]="COMPRESSED_RGBA_ASTC_12x10_KHR",r[r.COMPRESSED_RGBA_ASTC_12x12_KHR=37821]="COMPRESSED_RGBA_ASTC_12x12_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR=37840]="COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR=37841]="COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR=37842]="COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR=37843]="COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR=37844]="COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR=37845]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR=37846]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR=37847]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR=37848]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR=37849]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR=37850]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR=37851]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR=37852]="COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR=37853]="COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR",r[r.COMPRESSED_RGBA_BPTC_UNORM_EXT=36492]="COMPRESSED_RGBA_BPTC_UNORM_EXT",r[r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT=36493]="COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT",r[r.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT=36494]="COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT",r[r.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT=36495]="COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT",r))(XE||{}),XO={33776:"bc1-rgba-unorm",33777:"bc1-rgba-unorm",33778:"bc2-rgba-unorm",33779:"bc3-rgba-unorm",35916:"bc1-rgba-unorm-srgb",35917:"bc1-rgba-unorm-srgb",35918:"bc2-rgba-unorm-srgb",35919:"bc3-rgba-unorm-srgb",36283:"bc4-r-unorm",36284:"bc4-r-snorm",36285:"bc5-rg-unorm",36286:"bc5-rg-snorm",37488:"eac-r11unorm",37490:"eac-rg11snorm",37492:"etc2-rgb8unorm",37496:"etc2-rgba8unorm",37493:"etc2-rgb8unorm-srgb",37497:"etc2-rgba8unorm-srgb",37494:"etc2-rgb8a1unorm",37495:"etc2-rgb8a1unorm-srgb",37808:"astc-4x4-unorm",37840:"astc-4x4-unorm-srgb",37809:"astc-5x4-unorm",37841:"astc-5x4-unorm-srgb",37810:"astc-5x5-unorm",37842:"astc-5x5-unorm-srgb",37811:"astc-6x5-unorm",37843:"astc-6x5-unorm-srgb",37812:"astc-6x6-unorm",37844:"astc-6x6-unorm-srgb",37813:"astc-8x5-unorm",37845:"astc-8x5-unorm-srgb",37814:"astc-8x6-unorm",37846:"astc-8x6-unorm-srgb",37815:"astc-8x8-unorm",37847:"astc-8x8-unorm-srgb",37816:"astc-10x5-unorm",37848:"astc-10x5-unorm-srgb",37817:"astc-10x6-unorm",37849:"astc-10x6-unorm-srgb",37818:"astc-10x8-unorm",37850:"astc-10x8-unorm-srgb",37819:"astc-10x10-unorm",37851:"astc-10x10-unorm-srgb",37820:"astc-12x10-unorm",37852:"astc-12x10-unorm-srgb",37821:"astc-12x12-unorm",37853:"astc-12x12-unorm-srgb",36492:"bc7-rgba-unorm",36493:"bc7-rgba-unorm-srgb",36494:"bc6h-rgb-float",36495:"bc6h-rgb-ufloat",35907:"rgba8unorm-srgb",36759:"rgba8snorm",36220:"rgba8uint",36238:"rgba8sint",6408:"rgba8unorm"},YO=[171,75,84,88,32,49,49,187,13,10,26,10],jO={FILE_IDENTIFIER:0,ENDIANNESS:12,GL_TYPE:16,GL_TYPE_SIZE:20,GL_FORMAT:24,GL_INTERNAL_FORMAT:28,GL_BASE_INTERNAL_FORMAT:32,PIXEL_WIDTH:36,PIXEL_HEIGHT:40,PIXEL_DEPTH:44,NUMBER_OF_ARRAY_ELEMENTS:48,NUMBER_OF_FACES:52,NUMBER_OF_MIPMAP_LEVELS:56,BYTES_OF_KEY_VALUE_DATA:60},$O=64,qO=67305985,KO={5121:1,5123:2,5124:4,5125:4,5126:4,36193:8},ZO={6408:4,6407:3,33319:2,6403:1,6409:1,6410:2,6406:1},QO={32819:2,32820:2,33635:2},JO={33776:.5,33777:.5,33778:1,33779:1,35916:.5,35917:.5,35918:1,35919:1,36283:.5,36284:.5,36285:1,36286:1,37488:.5,37489:.5,37490:1,37491:1,37492:.5,37496:1,37493:.5,37497:1,37494:.5,37495:.5,37808:1,37840:1,37809:.8,37841:.8,37810:.64,37842:.64,37811:.53375,37843:.53375,37812:.445,37844:.445,37813:.4,37845:.4,37814:.33375,37846:.33375,37815:.25,37847:.25,37816:.32,37848:.32,37817:.26625,37849:.26625,37818:.2,37850:.2,37819:.16,37851:.16,37820:.13375,37852:.13375,37821:.11125,37853:.11125,36492:1,36493:1,36494:1,36495:1},nt={FILE_HEADER_SIZE:$O,FILE_IDENTIFIER:YO,FORMATS_TO_COMPONENTS:ZO,INTERNAL_FORMAT_TO_BYTES_PER_PIXEL:JO,INTERNAL_FORMAT_TO_TEXTURE_FORMATS:XO,FIELDS:jO,TYPES_TO_BYTES_PER_COMPONENT:KO,TYPES_TO_BYTES_PER_PIXEL:QO,ENDIANNESS:qO};});function L_(r,e){let t=new DataView(r);if(!iF(t))throw new Error("Invalid KTX identifier in header");let{littleEndian:i,glType:s,glFormat:n,glInternalFormat:o,pixelWidth:a,pixelHeight:u,numberOfMipmapLevels:l,offset:c}=rF(t),h=nt.INTERNAL_FORMAT_TO_TEXTURE_FORMATS[o];if(!h)throw new Error(`Unknown texture format ${o}`);if(!e.includes(h))throw new Error(`Unsupported texture format: ${h}, supportedFormats: ${e}`);let d=tF(s,n,o),p=eF(t,s,d,a,u,c,l,i);return {format:h,width:a,height:u,resource:p,alphaMode:"no-premultiply-alpha"}}function eF(r,e,t,i,s,n,o,a){let u=i+3&-4,l=s+3&-4,c=i*s;e===0&&(c=u*l);let h=c*t,d=i,p=s,m=u,b=l,_=n,g=new Array(o);for(let y=0;y<o;y++){let S=r.getUint32(_,a),E=_+4;g[y]=new Uint8Array(r.buffer,E,h),E+=h,_+=S+4,_=_%4!==0?_+4-_%4:_,d=d>>1||1,p=p>>1||1,m=d+4-1&-4,b=p+4-1&-4,h=m*b*t;}return g}function tF(r,e,t){let i=nt.INTERNAL_FORMAT_TO_BYTES_PER_PIXEL[t];if(r!==0&&(nt.TYPES_TO_BYTES_PER_COMPONENT[r]?i=nt.TYPES_TO_BYTES_PER_COMPONENT[r]*nt.FORMATS_TO_COMPONENTS[e]:i=nt.TYPES_TO_BYTES_PER_PIXEL[r]),i===void 0)throw new Error("Unable to resolve the pixel format stored in the *.ktx file!");return i}function rF(r){let e=r.getUint32(nt.FIELDS.ENDIANNESS,true)===nt.ENDIANNESS,t=r.getUint32(nt.FIELDS.GL_TYPE,e),i=r.getUint32(nt.FIELDS.GL_FORMAT,e),s=r.getUint32(nt.FIELDS.GL_INTERNAL_FORMAT,e),n=r.getUint32(nt.FIELDS.PIXEL_WIDTH,e),o=r.getUint32(nt.FIELDS.PIXEL_HEIGHT,e)||1,a=r.getUint32(nt.FIELDS.PIXEL_DEPTH,e)||1,u=r.getUint32(nt.FIELDS.NUMBER_OF_ARRAY_ELEMENTS,e)||1,l=r.getUint32(nt.FIELDS.NUMBER_OF_FACES,e),c=r.getUint32(nt.FIELDS.NUMBER_OF_MIPMAP_LEVELS,e),h=r.getUint32(nt.FIELDS.BYTES_OF_KEY_VALUE_DATA,e);if(o===0||a!==1)throw new Error("Only 2D textures are supported");if(l!==1)throw new Error("CubeTextures are not supported by KTXLoader yet!");if(u!==1)throw new Error("WebGL does not support array textures");return {littleEndian:e,glType:t,glFormat:i,glInternalFormat:s,pixelWidth:n,pixelHeight:o,numberOfMipmapLevels:c,offset:nt.FILE_HEADER_SIZE+h}}function iF(r){for(let e=0;e<nt.FILE_IDENTIFIER.length;e++)if(r.getUint8(e)!==nt.FILE_IDENTIFIER[e])return false;return true}var jE=f(()=>{YE();});var M3,I3=f(()=>{Er();ms();wr();B();Fl();Ul();jE();M3={extension:{type:x.LoadParser,priority:ze.High,name:"loadKTX"},name:"loadKTX",test(r){return it(r,".ktx")},async load(r,e,t){let i=await Gi(),n=await(await fetch(r)).arrayBuffer(),o=L_(n,i),a=new $r(o);return Kt(a,t,r)},unload(r){Array.isArray(r)?r.forEach(e=>e.destroy(true)):r.destroy(true);}};});var sF,Hl,Md,D3=f(()=>{sF=`(function () {
2227
+ `,Ll=null,wd=class{constructor(){Ll||(Ll=URL.createObjectURL(new Blob([FO],{type:"application/javascript"}))),this.worker=new Worker(Ll);}};wd.revokeObjectURL=function(){Ll&&(URL.revokeObjectURL(Ll),Ll=null);};});function v3(r){Object.assign(Nl,r);}var Nl,HE=f(()=>{Nl={jsUrl:"https://files.pixijs.download/transcoders/basis/basis_transcoder.js",wasmUrl:"https://files.pixijs.download/transcoders/basis/basis_transcoder.wasm"};});function GO(r){return Bd||(Bd=new wd().worker,Bd.onmessage=e=>{let{success:t,url:i,textureOptions:s}=e.data;t||console.warn("Failed to load Basis texture",i),T3[i](s);},Bd.postMessage({type:"init",jsUrl:Nl.jsUrl,wasmUrl:Nl.wasmUrl,supportedTextures:r})),Bd}function k_(r,e){let t=GO(e);return new Promise(i=>{T3[r]=i,t.postMessage({type:"load",url:r});})}var Bd,T3,VE=f(()=>{y3();HE();T3={};});var S3,E3=f(()=>{Er();ms();wr();B();Fl();Ul();VE();S3={extension:{type:x.LoadParser,priority:ze.High,name:"loadBasis"},name:"loadBasis",test(r){return it(r,[".basis"])},async load(r,e,t){let i=await Gi(),s=await k_(r,i),n=new jr(s);return Kt(n,t,r)},unload(r){Array.isArray(r)?r.forEach(e=>e.destroy(true)):r.destroy(true);}};});function C3(r,e){let t=r.getNumImages(),i=r.getNumLevels(0);if(!r.startTranscoding())throw new Error("startTranscoding failed");let n=[];for(let o=0;o<i;++o)for(let a=0;a<t;++a){let u=r.getImageTranscodedSizeInBytes(a,o,e),l=new Uint8Array(u);if(!r.transcodeImage(l,a,o,e,1,0))throw new Error("transcodeImage failed");n.push(l);}return n}var A3=f(()=>{});function P3(r){let e=UO[r];if(e)return e;throw new Error(`Unsupported transcoderFormat: ${r}`)}var UO,w3=f(()=>{UO={"bc3-rgba-unorm":3,"bc7-rgba-unorm":6,"etc2-rgba8unorm":1,"astc-4x4-unorm":10,rgba8unorm:13,rgba4unorm:16};});function kt(r){return r.charCodeAt(0)+(r.charCodeAt(1)<<8)+(r.charCodeAt(2)<<16)+(r.charCodeAt(3)<<24)}var LO,NO,O_,F_,nr,Rd,Zt,ne,G_,zE=f(()=>{LO={MAGIC:0,SIZE:1,FLAGS:2,HEIGHT:3,WIDTH:4,MIPMAP_COUNT:7,PIXEL_FORMAT:19,PF_FLAGS:20,FOURCC:21,RGB_BITCOUNT:22,R_BIT_MASK:23,G_BIT_MASK:24,B_BIT_MASK:25,A_BIT_MASK:26},NO={DXGI_FORMAT:0,RESOURCE_DIMENSION:1,MISC_FLAG:2,ARRAY_SIZE:3,MISC_FLAGS2:4},O_=(r=>(r[r.DXGI_FORMAT_UNKNOWN=0]="DXGI_FORMAT_UNKNOWN",r[r.DXGI_FORMAT_R32G32B32A32_TYPELESS=1]="DXGI_FORMAT_R32G32B32A32_TYPELESS",r[r.DXGI_FORMAT_R32G32B32A32_FLOAT=2]="DXGI_FORMAT_R32G32B32A32_FLOAT",r[r.DXGI_FORMAT_R32G32B32A32_UINT=3]="DXGI_FORMAT_R32G32B32A32_UINT",r[r.DXGI_FORMAT_R32G32B32A32_SINT=4]="DXGI_FORMAT_R32G32B32A32_SINT",r[r.DXGI_FORMAT_R32G32B32_TYPELESS=5]="DXGI_FORMAT_R32G32B32_TYPELESS",r[r.DXGI_FORMAT_R32G32B32_FLOAT=6]="DXGI_FORMAT_R32G32B32_FLOAT",r[r.DXGI_FORMAT_R32G32B32_UINT=7]="DXGI_FORMAT_R32G32B32_UINT",r[r.DXGI_FORMAT_R32G32B32_SINT=8]="DXGI_FORMAT_R32G32B32_SINT",r[r.DXGI_FORMAT_R16G16B16A16_TYPELESS=9]="DXGI_FORMAT_R16G16B16A16_TYPELESS",r[r.DXGI_FORMAT_R16G16B16A16_FLOAT=10]="DXGI_FORMAT_R16G16B16A16_FLOAT",r[r.DXGI_FORMAT_R16G16B16A16_UNORM=11]="DXGI_FORMAT_R16G16B16A16_UNORM",r[r.DXGI_FORMAT_R16G16B16A16_UINT=12]="DXGI_FORMAT_R16G16B16A16_UINT",r[r.DXGI_FORMAT_R16G16B16A16_SNORM=13]="DXGI_FORMAT_R16G16B16A16_SNORM",r[r.DXGI_FORMAT_R16G16B16A16_SINT=14]="DXGI_FORMAT_R16G16B16A16_SINT",r[r.DXGI_FORMAT_R32G32_TYPELESS=15]="DXGI_FORMAT_R32G32_TYPELESS",r[r.DXGI_FORMAT_R32G32_FLOAT=16]="DXGI_FORMAT_R32G32_FLOAT",r[r.DXGI_FORMAT_R32G32_UINT=17]="DXGI_FORMAT_R32G32_UINT",r[r.DXGI_FORMAT_R32G32_SINT=18]="DXGI_FORMAT_R32G32_SINT",r[r.DXGI_FORMAT_R32G8X24_TYPELESS=19]="DXGI_FORMAT_R32G8X24_TYPELESS",r[r.DXGI_FORMAT_D32_FLOAT_S8X24_UINT=20]="DXGI_FORMAT_D32_FLOAT_S8X24_UINT",r[r.DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS=21]="DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS",r[r.DXGI_FORMAT_X32_TYPELESS_G8X24_UINT=22]="DXGI_FORMAT_X32_TYPELESS_G8X24_UINT",r[r.DXGI_FORMAT_R10G10B10A2_TYPELESS=23]="DXGI_FORMAT_R10G10B10A2_TYPELESS",r[r.DXGI_FORMAT_R10G10B10A2_UNORM=24]="DXGI_FORMAT_R10G10B10A2_UNORM",r[r.DXGI_FORMAT_R10G10B10A2_UINT=25]="DXGI_FORMAT_R10G10B10A2_UINT",r[r.DXGI_FORMAT_R11G11B10_FLOAT=26]="DXGI_FORMAT_R11G11B10_FLOAT",r[r.DXGI_FORMAT_R8G8B8A8_TYPELESS=27]="DXGI_FORMAT_R8G8B8A8_TYPELESS",r[r.DXGI_FORMAT_R8G8B8A8_UNORM=28]="DXGI_FORMAT_R8G8B8A8_UNORM",r[r.DXGI_FORMAT_R8G8B8A8_UNORM_SRGB=29]="DXGI_FORMAT_R8G8B8A8_UNORM_SRGB",r[r.DXGI_FORMAT_R8G8B8A8_UINT=30]="DXGI_FORMAT_R8G8B8A8_UINT",r[r.DXGI_FORMAT_R8G8B8A8_SNORM=31]="DXGI_FORMAT_R8G8B8A8_SNORM",r[r.DXGI_FORMAT_R8G8B8A8_SINT=32]="DXGI_FORMAT_R8G8B8A8_SINT",r[r.DXGI_FORMAT_R16G16_TYPELESS=33]="DXGI_FORMAT_R16G16_TYPELESS",r[r.DXGI_FORMAT_R16G16_FLOAT=34]="DXGI_FORMAT_R16G16_FLOAT",r[r.DXGI_FORMAT_R16G16_UNORM=35]="DXGI_FORMAT_R16G16_UNORM",r[r.DXGI_FORMAT_R16G16_UINT=36]="DXGI_FORMAT_R16G16_UINT",r[r.DXGI_FORMAT_R16G16_SNORM=37]="DXGI_FORMAT_R16G16_SNORM",r[r.DXGI_FORMAT_R16G16_SINT=38]="DXGI_FORMAT_R16G16_SINT",r[r.DXGI_FORMAT_R32_TYPELESS=39]="DXGI_FORMAT_R32_TYPELESS",r[r.DXGI_FORMAT_D32_FLOAT=40]="DXGI_FORMAT_D32_FLOAT",r[r.DXGI_FORMAT_R32_FLOAT=41]="DXGI_FORMAT_R32_FLOAT",r[r.DXGI_FORMAT_R32_UINT=42]="DXGI_FORMAT_R32_UINT",r[r.DXGI_FORMAT_R32_SINT=43]="DXGI_FORMAT_R32_SINT",r[r.DXGI_FORMAT_R24G8_TYPELESS=44]="DXGI_FORMAT_R24G8_TYPELESS",r[r.DXGI_FORMAT_D24_UNORM_S8_UINT=45]="DXGI_FORMAT_D24_UNORM_S8_UINT",r[r.DXGI_FORMAT_R24_UNORM_X8_TYPELESS=46]="DXGI_FORMAT_R24_UNORM_X8_TYPELESS",r[r.DXGI_FORMAT_X24_TYPELESS_G8_UINT=47]="DXGI_FORMAT_X24_TYPELESS_G8_UINT",r[r.DXGI_FORMAT_R8G8_TYPELESS=48]="DXGI_FORMAT_R8G8_TYPELESS",r[r.DXGI_FORMAT_R8G8_UNORM=49]="DXGI_FORMAT_R8G8_UNORM",r[r.DXGI_FORMAT_R8G8_UINT=50]="DXGI_FORMAT_R8G8_UINT",r[r.DXGI_FORMAT_R8G8_SNORM=51]="DXGI_FORMAT_R8G8_SNORM",r[r.DXGI_FORMAT_R8G8_SINT=52]="DXGI_FORMAT_R8G8_SINT",r[r.DXGI_FORMAT_R16_TYPELESS=53]="DXGI_FORMAT_R16_TYPELESS",r[r.DXGI_FORMAT_R16_FLOAT=54]="DXGI_FORMAT_R16_FLOAT",r[r.DXGI_FORMAT_D16_UNORM=55]="DXGI_FORMAT_D16_UNORM",r[r.DXGI_FORMAT_R16_UNORM=56]="DXGI_FORMAT_R16_UNORM",r[r.DXGI_FORMAT_R16_UINT=57]="DXGI_FORMAT_R16_UINT",r[r.DXGI_FORMAT_R16_SNORM=58]="DXGI_FORMAT_R16_SNORM",r[r.DXGI_FORMAT_R16_SINT=59]="DXGI_FORMAT_R16_SINT",r[r.DXGI_FORMAT_R8_TYPELESS=60]="DXGI_FORMAT_R8_TYPELESS",r[r.DXGI_FORMAT_R8_UNORM=61]="DXGI_FORMAT_R8_UNORM",r[r.DXGI_FORMAT_R8_UINT=62]="DXGI_FORMAT_R8_UINT",r[r.DXGI_FORMAT_R8_SNORM=63]="DXGI_FORMAT_R8_SNORM",r[r.DXGI_FORMAT_R8_SINT=64]="DXGI_FORMAT_R8_SINT",r[r.DXGI_FORMAT_A8_UNORM=65]="DXGI_FORMAT_A8_UNORM",r[r.DXGI_FORMAT_R1_UNORM=66]="DXGI_FORMAT_R1_UNORM",r[r.DXGI_FORMAT_R9G9B9E5_SHAREDEXP=67]="DXGI_FORMAT_R9G9B9E5_SHAREDEXP",r[r.DXGI_FORMAT_R8G8_B8G8_UNORM=68]="DXGI_FORMAT_R8G8_B8G8_UNORM",r[r.DXGI_FORMAT_G8R8_G8B8_UNORM=69]="DXGI_FORMAT_G8R8_G8B8_UNORM",r[r.DXGI_FORMAT_BC1_TYPELESS=70]="DXGI_FORMAT_BC1_TYPELESS",r[r.DXGI_FORMAT_BC1_UNORM=71]="DXGI_FORMAT_BC1_UNORM",r[r.DXGI_FORMAT_BC1_UNORM_SRGB=72]="DXGI_FORMAT_BC1_UNORM_SRGB",r[r.DXGI_FORMAT_BC2_TYPELESS=73]="DXGI_FORMAT_BC2_TYPELESS",r[r.DXGI_FORMAT_BC2_UNORM=74]="DXGI_FORMAT_BC2_UNORM",r[r.DXGI_FORMAT_BC2_UNORM_SRGB=75]="DXGI_FORMAT_BC2_UNORM_SRGB",r[r.DXGI_FORMAT_BC3_TYPELESS=76]="DXGI_FORMAT_BC3_TYPELESS",r[r.DXGI_FORMAT_BC3_UNORM=77]="DXGI_FORMAT_BC3_UNORM",r[r.DXGI_FORMAT_BC3_UNORM_SRGB=78]="DXGI_FORMAT_BC3_UNORM_SRGB",r[r.DXGI_FORMAT_BC4_TYPELESS=79]="DXGI_FORMAT_BC4_TYPELESS",r[r.DXGI_FORMAT_BC4_UNORM=80]="DXGI_FORMAT_BC4_UNORM",r[r.DXGI_FORMAT_BC4_SNORM=81]="DXGI_FORMAT_BC4_SNORM",r[r.DXGI_FORMAT_BC5_TYPELESS=82]="DXGI_FORMAT_BC5_TYPELESS",r[r.DXGI_FORMAT_BC5_UNORM=83]="DXGI_FORMAT_BC5_UNORM",r[r.DXGI_FORMAT_BC5_SNORM=84]="DXGI_FORMAT_BC5_SNORM",r[r.DXGI_FORMAT_B5G6R5_UNORM=85]="DXGI_FORMAT_B5G6R5_UNORM",r[r.DXGI_FORMAT_B5G5R5A1_UNORM=86]="DXGI_FORMAT_B5G5R5A1_UNORM",r[r.DXGI_FORMAT_B8G8R8A8_UNORM=87]="DXGI_FORMAT_B8G8R8A8_UNORM",r[r.DXGI_FORMAT_B8G8R8X8_UNORM=88]="DXGI_FORMAT_B8G8R8X8_UNORM",r[r.DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM=89]="DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM",r[r.DXGI_FORMAT_B8G8R8A8_TYPELESS=90]="DXGI_FORMAT_B8G8R8A8_TYPELESS",r[r.DXGI_FORMAT_B8G8R8A8_UNORM_SRGB=91]="DXGI_FORMAT_B8G8R8A8_UNORM_SRGB",r[r.DXGI_FORMAT_B8G8R8X8_TYPELESS=92]="DXGI_FORMAT_B8G8R8X8_TYPELESS",r[r.DXGI_FORMAT_B8G8R8X8_UNORM_SRGB=93]="DXGI_FORMAT_B8G8R8X8_UNORM_SRGB",r[r.DXGI_FORMAT_BC6H_TYPELESS=94]="DXGI_FORMAT_BC6H_TYPELESS",r[r.DXGI_FORMAT_BC6H_UF16=95]="DXGI_FORMAT_BC6H_UF16",r[r.DXGI_FORMAT_BC6H_SF16=96]="DXGI_FORMAT_BC6H_SF16",r[r.DXGI_FORMAT_BC7_TYPELESS=97]="DXGI_FORMAT_BC7_TYPELESS",r[r.DXGI_FORMAT_BC7_UNORM=98]="DXGI_FORMAT_BC7_UNORM",r[r.DXGI_FORMAT_BC7_UNORM_SRGB=99]="DXGI_FORMAT_BC7_UNORM_SRGB",r[r.DXGI_FORMAT_AYUV=100]="DXGI_FORMAT_AYUV",r[r.DXGI_FORMAT_Y410=101]="DXGI_FORMAT_Y410",r[r.DXGI_FORMAT_Y416=102]="DXGI_FORMAT_Y416",r[r.DXGI_FORMAT_NV12=103]="DXGI_FORMAT_NV12",r[r.DXGI_FORMAT_P010=104]="DXGI_FORMAT_P010",r[r.DXGI_FORMAT_P016=105]="DXGI_FORMAT_P016",r[r.DXGI_FORMAT_420_OPAQUE=106]="DXGI_FORMAT_420_OPAQUE",r[r.DXGI_FORMAT_YUY2=107]="DXGI_FORMAT_YUY2",r[r.DXGI_FORMAT_Y210=108]="DXGI_FORMAT_Y210",r[r.DXGI_FORMAT_Y216=109]="DXGI_FORMAT_Y216",r[r.DXGI_FORMAT_NV11=110]="DXGI_FORMAT_NV11",r[r.DXGI_FORMAT_AI44=111]="DXGI_FORMAT_AI44",r[r.DXGI_FORMAT_IA44=112]="DXGI_FORMAT_IA44",r[r.DXGI_FORMAT_P8=113]="DXGI_FORMAT_P8",r[r.DXGI_FORMAT_A8P8=114]="DXGI_FORMAT_A8P8",r[r.DXGI_FORMAT_B4G4R4A4_UNORM=115]="DXGI_FORMAT_B4G4R4A4_UNORM",r[r.DXGI_FORMAT_P208=116]="DXGI_FORMAT_P208",r[r.DXGI_FORMAT_V208=117]="DXGI_FORMAT_V208",r[r.DXGI_FORMAT_V408=118]="DXGI_FORMAT_V408",r[r.DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE=119]="DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE",r[r.DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE=120]="DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE",r[r.DXGI_FORMAT_FORCE_UINT=121]="DXGI_FORMAT_FORCE_UINT",r))(O_||{}),F_=(r=>(r[r.DDS_DIMENSION_TEXTURE1D=2]="DDS_DIMENSION_TEXTURE1D",r[r.DDS_DIMENSION_TEXTURE2D=3]="DDS_DIMENSION_TEXTURE2D",r[r.DDS_DIMENSION_TEXTURE3D=6]="DDS_DIMENSION_TEXTURE3D",r))(F_||{});nr=(r=>(r[r.UNKNOWN=0]="UNKNOWN",r[r.R8G8B8=20]="R8G8B8",r[r.A8R8G8B8=21]="A8R8G8B8",r[r.X8R8G8B8=22]="X8R8G8B8",r[r.R5G6B5=23]="R5G6B5",r[r.X1R5G5B5=24]="X1R5G5B5",r[r.A1R5G5B5=25]="A1R5G5B5",r[r.A4R4G4B4=26]="A4R4G4B4",r[r.R3G3B2=27]="R3G3B2",r[r.A8=28]="A8",r[r.A8R3G3B2=29]="A8R3G3B2",r[r.X4R4G4B4=30]="X4R4G4B4",r[r.A2B10G10R10=31]="A2B10G10R10",r[r.A8B8G8R8=32]="A8B8G8R8",r[r.X8B8G8R8=33]="X8B8G8R8",r[r.G16R16=34]="G16R16",r[r.A2R10G10B10=35]="A2R10G10B10",r[r.A16B16G16R16=36]="A16B16G16R16",r[r.A8P8=40]="A8P8",r[r.P8=41]="P8",r[r.L8=50]="L8",r[r.A8L8=51]="A8L8",r[r.A4L4=52]="A4L4",r[r.V8U8=60]="V8U8",r[r.L6V5U5=61]="L6V5U5",r[r.X8L8V8U8=62]="X8L8V8U8",r[r.Q8W8V8U8=63]="Q8W8V8U8",r[r.V16U16=64]="V16U16",r[r.A2W10V10U10=67]="A2W10V10U10",r[r.Q16W16V16U16=110]="Q16W16V16U16",r[r.R16F=111]="R16F",r[r.G16R16F=112]="G16R16F",r[r.A16B16G16R16F=113]="A16B16G16R16F",r[r.R32F=114]="R32F",r[r.G32R32F=115]="G32R32F",r[r.A32B32G32R32F=116]="A32B32G32R32F",r[r.UYVY=kt("UYVY")]="UYVY",r[r.R8G8_B8G8=kt("RGBG")]="R8G8_B8G8",r[r.YUY2=kt("YUY2")]="YUY2",r[r.D3DFMT_G8R8_G8B8=kt("GRGB")]="D3DFMT_G8R8_G8B8",r[r.DXT1=kt("DXT1")]="DXT1",r[r.DXT2=kt("DXT2")]="DXT2",r[r.DXT3=kt("DXT3")]="DXT3",r[r.DXT4=kt("DXT4")]="DXT4",r[r.DXT5=kt("DXT5")]="DXT5",r[r.ATI1=kt("ATI1")]="ATI1",r[r.AT1N=kt("AT1N")]="AT1N",r[r.ATI2=kt("ATI2")]="ATI2",r[r.AT2N=kt("AT2N")]="AT2N",r[r.BC4U=kt("BC4U")]="BC4U",r[r.BC4S=kt("BC4S")]="BC4S",r[r.BC5U=kt("BC5U")]="BC5U",r[r.BC5S=kt("BC5S")]="BC5S",r[r.DX10=kt("DX10")]="DX10",r))(nr||{}),Rd={[nr.DXT1]:"bc1-rgba-unorm",[nr.DXT2]:"bc2-rgba-unorm",[nr.DXT3]:"bc2-rgba-unorm",[nr.DXT4]:"bc3-rgba-unorm",[nr.DXT5]:"bc3-rgba-unorm",[nr.ATI1]:"bc4-r-unorm",[nr.BC4U]:"bc4-r-unorm",[nr.BC4S]:"bc4-r-snorm",[nr.ATI2]:"bc5-rg-unorm",[nr.BC5U]:"bc5-rg-unorm",[nr.BC5S]:"bc5-rg-snorm",36:"rgba16uint",110:"rgba16sint",111:"r16float",112:"rg16float",113:"rgba16float",114:"r32float",115:"rg32float",116:"rgba32float"},Zt={70:"bc1-rgba-unorm",71:"bc1-rgba-unorm",72:"bc1-rgba-unorm-srgb",73:"bc2-rgba-unorm",74:"bc2-rgba-unorm",75:"bc2-rgba-unorm-srgb",76:"bc3-rgba-unorm",77:"bc3-rgba-unorm",78:"bc3-rgba-unorm-srgb",79:"bc4-r-unorm",80:"bc4-r-unorm",81:"bc4-r-snorm",82:"bc5-rg-unorm",83:"bc5-rg-unorm",84:"bc5-rg-snorm",94:"bc6h-rgb-ufloat",95:"bc6h-rgb-ufloat",96:"bc6h-rgb-float",97:"bc7-rgba-unorm",98:"bc7-rgba-unorm",99:"bc7-rgba-unorm-srgb",28:"rgba8unorm",29:"rgba8unorm-srgb",87:"bgra8unorm",91:"bgra8unorm-srgb",41:"r32float",49:"rg8unorm",56:"r16uint",61:"r8unorm",24:"rgb10a2unorm",11:"rgba16uint",13:"rgba16sint",10:"rgba16float",54:"r16float",34:"rg16float",16:"rg32float",2:"rgba32float"},ne={MAGIC_VALUE:542327876,MAGIC_SIZE:4,HEADER_SIZE:124,HEADER_DX10_SIZE:20,PIXEL_FORMAT_FLAGS:{ALPHAPIXELS:1,ALPHA:2,FOURCC:4,RGB:64,RGBA:65,YUV:512,LUMINANCE:131072,LUMINANCEA:131073},RESOURCE_MISC_TEXTURECUBE:4,HEADER_FIELDS:LO,HEADER_DX10_FIELDS:NO,DXGI_FORMAT:O_,D3D10_RESOURCE_DIMENSION:F_,D3DFMT:nr},G_={"bc1-rgba-unorm":8,"bc1-rgba-unorm-srgb":8,"bc2-rgba-unorm":16,"bc2-rgba-unorm-srgb":16,"bc3-rgba-unorm":16,"bc3-rgba-unorm-srgb":16,"bc4-r-unorm":8,"bc4-r-snorm":8,"bc5-rg-unorm":16,"bc5-rg-snorm":16,"bc6h-rgb-ufloat":16,"bc6h-rgb-float":16,"bc7-rgba-unorm":16,"bc7-rgba-unorm-srgb":16};});function U_(r,e){let{format:t,fourCC:i,width:s,height:n,dataOffset:o,mipmapCount:a}=VO(r);if(!e.includes(t))throw new Error(`Unsupported texture format: ${i} ${t}, supported: ${e}`);if(a<=1)return {format:t,width:s,height:n,resource:[new Uint8Array(r,o)],alphaMode:"no-premultiply-alpha"};let u=HO(t,s,n,o,a,r);return {format:t,width:s,height:n,resource:u,alphaMode:"no-premultiply-alpha"}}function HO(r,e,t,i,s,n){let o=[],a=G_[r],u=e,l=t,c=i;for(let h=0;h<s;++h){let d=Math.ceil(Math.max(4,u)/4)*4,p=Math.ceil(Math.max(4,l)/4)*4,m=a?d/4*p/4*a:u*l*4,b=new Uint8Array(n,c,m);o.push(b),c+=m,u=Math.max(u>>1,1),l=Math.max(l>>1,1);}return o}function VO(r){let e=new Uint32Array(r,0,ne.HEADER_SIZE/Uint32Array.BYTES_PER_ELEMENT);if(e[ne.HEADER_FIELDS.MAGIC]!==ne.MAGIC_VALUE)throw new Error("Invalid magic number in DDS header");let t=e[ne.HEADER_FIELDS.HEIGHT],i=e[ne.HEADER_FIELDS.WIDTH],s=Math.max(1,e[ne.HEADER_FIELDS.MIPMAP_COUNT]),n=e[ne.HEADER_FIELDS.PF_FLAGS],o=e[ne.HEADER_FIELDS.FOURCC],a=zO(e,n,o,r),u=ne.MAGIC_SIZE+ne.HEADER_SIZE+(o===ne.D3DFMT.DX10?ne.HEADER_DX10_SIZE:0);return {format:a,fourCC:o,width:i,height:t,dataOffset:u,mipmapCount:s}}function zO(r,e,t,i){if(e&ne.PIXEL_FORMAT_FLAGS.FOURCC){if(t===ne.D3DFMT.DX10){let s=new Uint32Array(i,ne.MAGIC_SIZE+ne.HEADER_SIZE,ne.HEADER_DX10_SIZE/Uint32Array.BYTES_PER_ELEMENT);if(s[ne.HEADER_DX10_FIELDS.MISC_FLAG]===ne.RESOURCE_MISC_TEXTURECUBE)throw new Error("DDSParser does not support cubemap textures");if(s[ne.HEADER_DX10_FIELDS.RESOURCE_DIMENSION]===ne.D3D10_RESOURCE_DIMENSION.DDS_DIMENSION_TEXTURE3D)throw new Error("DDSParser does not supported 3D texture data");let a=s[ne.HEADER_DX10_FIELDS.DXGI_FORMAT];if(a in Zt)return Zt[a];throw new Error(`DDSParser cannot parse texture data with DXGI format ${a}`)}if(t in Rd)return Rd[t];throw new Error(`DDSParser cannot parse texture data with fourCC format ${t}`)}if(e&ne.PIXEL_FORMAT_FLAGS.RGB||e&ne.PIXEL_FORMAT_FLAGS.RGBA)return WO(r);throw e&ne.PIXEL_FORMAT_FLAGS.YUV?new Error("DDSParser does not supported YUV uncompressed texture data."):e&ne.PIXEL_FORMAT_FLAGS.LUMINANCE||e&ne.PIXEL_FORMAT_FLAGS.LUMINANCEA?new Error("DDSParser does not support single-channel (lumninance) texture data!"):e&ne.PIXEL_FORMAT_FLAGS.ALPHA||e&ne.PIXEL_FORMAT_FLAGS.ALPHAPIXELS?new Error("DDSParser does not support single-channel (alpha) texture data!"):new Error("DDSParser failed to load a texture file due to an unknown reason!")}function WO(r){let e=r[ne.HEADER_FIELDS.RGB_BITCOUNT],t=r[ne.HEADER_FIELDS.R_BIT_MASK],i=r[ne.HEADER_FIELDS.G_BIT_MASK],s=r[ne.HEADER_FIELDS.B_BIT_MASK],n=r[ne.HEADER_FIELDS.A_BIT_MASK];switch(e){case 32:if(t===255&&i===65280&&s===16711680&&n===4278190080)return Zt[ne.DXGI_FORMAT.DXGI_FORMAT_R8G8B8A8_UNORM];if(t===16711680&&i===65280&&s===255&&n===4278190080)return Zt[ne.DXGI_FORMAT.DXGI_FORMAT_B8G8R8A8_UNORM];if(t===1072693248&&i===1047552&&s===1023&&n===3221225472)return Zt[ne.DXGI_FORMAT.DXGI_FORMAT_R10G10B10A2_UNORM];if(t===65535&&i===4294901760&&s===0&&n===0)return Zt[ne.DXGI_FORMAT.DXGI_FORMAT_R16G16_UNORM];if(t===4294967295&&i===0&&s===0&&n===0)return Zt[ne.DXGI_FORMAT.DXGI_FORMAT_R32_FLOAT];break;case 24:break;case 16:if(t===31744&&i===992&&s===31&&n===32768)return Zt[ne.DXGI_FORMAT.DXGI_FORMAT_B5G5R5A1_UNORM];if(t===63488&&i===2016&&s===31&&n===0)return Zt[ne.DXGI_FORMAT.DXGI_FORMAT_B5G6R5_UNORM];if(t===3840&&i===240&&s===15&&n===61440)return Zt[ne.DXGI_FORMAT.DXGI_FORMAT_B4G4R4A4_UNORM];if(t===255&&i===0&&s===0&&n===65280)return Zt[ne.DXGI_FORMAT.DXGI_FORMAT_R8G8_UNORM];if(t===65535&&i===0&&s===0&&n===0)return Zt[ne.DXGI_FORMAT.DXGI_FORMAT_R16_UNORM];break;case 8:if(t===255&&i===0&&s===0&&n===0)return Zt[ne.DXGI_FORMAT.DXGI_FORMAT_R8_UNORM];break}throw new Error(`DDSParser does not support uncompressed texture with configuration:
2228
+ bitCount = ${e}, rBitMask = ${t}, gBitMask = ${i}, aBitMask = ${n}`)}var WE=f(()=>{zE();});var B3,R3=f(()=>{Er();ms();wr();B();Fl();Ul();WE();B3={extension:{type:x.LoadParser,priority:ze.High,name:"loadDDS"},name:"loadDDS",test(r){return it(r,[".dds"])},async load(r,e,t){let i=await Gi(),n=await(await fetch(r)).arrayBuffer(),o=U_(n,i),a=new jr(o);return Kt(a,t,r)},unload(r){Array.isArray(r)?r.forEach(e=>e.destroy(true)):r.destroy(true);}};});var XE,XO,YO,jO,$O,qO,KO,ZO,QO,JO,nt,YE=f(()=>{XE=(r=>(r[r.RGBA8_SNORM=36759]="RGBA8_SNORM",r[r.RGBA=6408]="RGBA",r[r.RGBA8UI=36220]="RGBA8UI",r[r.SRGB8_ALPHA8=35907]="SRGB8_ALPHA8",r[r.RGBA8I=36238]="RGBA8I",r[r.RGBA8=32856]="RGBA8",r[r.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",r[r.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",r[r.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",r[r.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",r[r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=35917]="COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT",r[r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT=35918]="COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT",r[r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=35919]="COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT",r[r.COMPRESSED_SRGB_S3TC_DXT1_EXT=35916]="COMPRESSED_SRGB_S3TC_DXT1_EXT",r[r.COMPRESSED_RED_RGTC1_EXT=36283]="COMPRESSED_RED_RGTC1_EXT",r[r.COMPRESSED_SIGNED_RED_RGTC1_EXT=36284]="COMPRESSED_SIGNED_RED_RGTC1_EXT",r[r.COMPRESSED_RED_GREEN_RGTC2_EXT=36285]="COMPRESSED_RED_GREEN_RGTC2_EXT",r[r.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT=36286]="COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT",r[r.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",r[r.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",r[r.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",r[r.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",r[r.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",r[r.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC",r[r.COMPRESSED_SRGB8_ETC2=37493]="COMPRESSED_SRGB8_ETC2",r[r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",r[r.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37494]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",r[r.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37495]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",r[r.COMPRESSED_RGBA_ASTC_4x4_KHR=37808]="COMPRESSED_RGBA_ASTC_4x4_KHR",r[r.COMPRESSED_RGBA_ASTC_5x4_KHR=37809]="COMPRESSED_RGBA_ASTC_5x4_KHR",r[r.COMPRESSED_RGBA_ASTC_5x5_KHR=37810]="COMPRESSED_RGBA_ASTC_5x5_KHR",r[r.COMPRESSED_RGBA_ASTC_6x5_KHR=37811]="COMPRESSED_RGBA_ASTC_6x5_KHR",r[r.COMPRESSED_RGBA_ASTC_6x6_KHR=37812]="COMPRESSED_RGBA_ASTC_6x6_KHR",r[r.COMPRESSED_RGBA_ASTC_8x5_KHR=37813]="COMPRESSED_RGBA_ASTC_8x5_KHR",r[r.COMPRESSED_RGBA_ASTC_8x6_KHR=37814]="COMPRESSED_RGBA_ASTC_8x6_KHR",r[r.COMPRESSED_RGBA_ASTC_8x8_KHR=37815]="COMPRESSED_RGBA_ASTC_8x8_KHR",r[r.COMPRESSED_RGBA_ASTC_10x5_KHR=37816]="COMPRESSED_RGBA_ASTC_10x5_KHR",r[r.COMPRESSED_RGBA_ASTC_10x6_KHR=37817]="COMPRESSED_RGBA_ASTC_10x6_KHR",r[r.COMPRESSED_RGBA_ASTC_10x8_KHR=37818]="COMPRESSED_RGBA_ASTC_10x8_KHR",r[r.COMPRESSED_RGBA_ASTC_10x10_KHR=37819]="COMPRESSED_RGBA_ASTC_10x10_KHR",r[r.COMPRESSED_RGBA_ASTC_12x10_KHR=37820]="COMPRESSED_RGBA_ASTC_12x10_KHR",r[r.COMPRESSED_RGBA_ASTC_12x12_KHR=37821]="COMPRESSED_RGBA_ASTC_12x12_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR=37840]="COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR=37841]="COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR=37842]="COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR=37843]="COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR=37844]="COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR=37845]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR=37846]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR=37847]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR=37848]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR=37849]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR=37850]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR=37851]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR=37852]="COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR",r[r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR=37853]="COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR",r[r.COMPRESSED_RGBA_BPTC_UNORM_EXT=36492]="COMPRESSED_RGBA_BPTC_UNORM_EXT",r[r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT=36493]="COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT",r[r.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT=36494]="COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT",r[r.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT=36495]="COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT",r))(XE||{}),XO={33776:"bc1-rgba-unorm",33777:"bc1-rgba-unorm",33778:"bc2-rgba-unorm",33779:"bc3-rgba-unorm",35916:"bc1-rgba-unorm-srgb",35917:"bc1-rgba-unorm-srgb",35918:"bc2-rgba-unorm-srgb",35919:"bc3-rgba-unorm-srgb",36283:"bc4-r-unorm",36284:"bc4-r-snorm",36285:"bc5-rg-unorm",36286:"bc5-rg-snorm",37488:"eac-r11unorm",37490:"eac-rg11snorm",37492:"etc2-rgb8unorm",37496:"etc2-rgba8unorm",37493:"etc2-rgb8unorm-srgb",37497:"etc2-rgba8unorm-srgb",37494:"etc2-rgb8a1unorm",37495:"etc2-rgb8a1unorm-srgb",37808:"astc-4x4-unorm",37840:"astc-4x4-unorm-srgb",37809:"astc-5x4-unorm",37841:"astc-5x4-unorm-srgb",37810:"astc-5x5-unorm",37842:"astc-5x5-unorm-srgb",37811:"astc-6x5-unorm",37843:"astc-6x5-unorm-srgb",37812:"astc-6x6-unorm",37844:"astc-6x6-unorm-srgb",37813:"astc-8x5-unorm",37845:"astc-8x5-unorm-srgb",37814:"astc-8x6-unorm",37846:"astc-8x6-unorm-srgb",37815:"astc-8x8-unorm",37847:"astc-8x8-unorm-srgb",37816:"astc-10x5-unorm",37848:"astc-10x5-unorm-srgb",37817:"astc-10x6-unorm",37849:"astc-10x6-unorm-srgb",37818:"astc-10x8-unorm",37850:"astc-10x8-unorm-srgb",37819:"astc-10x10-unorm",37851:"astc-10x10-unorm-srgb",37820:"astc-12x10-unorm",37852:"astc-12x10-unorm-srgb",37821:"astc-12x12-unorm",37853:"astc-12x12-unorm-srgb",36492:"bc7-rgba-unorm",36493:"bc7-rgba-unorm-srgb",36494:"bc6h-rgb-float",36495:"bc6h-rgb-ufloat",35907:"rgba8unorm-srgb",36759:"rgba8snorm",36220:"rgba8uint",36238:"rgba8sint",6408:"rgba8unorm"},YO=[171,75,84,88,32,49,49,187,13,10,26,10],jO={FILE_IDENTIFIER:0,ENDIANNESS:12,GL_TYPE:16,GL_TYPE_SIZE:20,GL_FORMAT:24,GL_INTERNAL_FORMAT:28,GL_BASE_INTERNAL_FORMAT:32,PIXEL_WIDTH:36,PIXEL_HEIGHT:40,PIXEL_DEPTH:44,NUMBER_OF_ARRAY_ELEMENTS:48,NUMBER_OF_FACES:52,NUMBER_OF_MIPMAP_LEVELS:56,BYTES_OF_KEY_VALUE_DATA:60},$O=64,qO=67305985,KO={5121:1,5123:2,5124:4,5125:4,5126:4,36193:8},ZO={6408:4,6407:3,33319:2,6403:1,6409:1,6410:2,6406:1},QO={32819:2,32820:2,33635:2},JO={33776:.5,33777:.5,33778:1,33779:1,35916:.5,35917:.5,35918:1,35919:1,36283:.5,36284:.5,36285:1,36286:1,37488:.5,37489:.5,37490:1,37491:1,37492:.5,37496:1,37493:.5,37497:1,37494:.5,37495:.5,37808:1,37840:1,37809:.8,37841:.8,37810:.64,37842:.64,37811:.53375,37843:.53375,37812:.445,37844:.445,37813:.4,37845:.4,37814:.33375,37846:.33375,37815:.25,37847:.25,37816:.32,37848:.32,37817:.26625,37849:.26625,37818:.2,37850:.2,37819:.16,37851:.16,37820:.13375,37852:.13375,37821:.11125,37853:.11125,36492:1,36493:1,36494:1,36495:1},nt={FILE_HEADER_SIZE:$O,FILE_IDENTIFIER:YO,FORMATS_TO_COMPONENTS:ZO,INTERNAL_FORMAT_TO_BYTES_PER_PIXEL:JO,INTERNAL_FORMAT_TO_TEXTURE_FORMATS:XO,FIELDS:jO,TYPES_TO_BYTES_PER_COMPONENT:KO,TYPES_TO_BYTES_PER_PIXEL:QO,ENDIANNESS:qO};});function L_(r,e){let t=new DataView(r);if(!iF(t))throw new Error("Invalid KTX identifier in header");let{littleEndian:i,glType:s,glFormat:n,glInternalFormat:o,pixelWidth:a,pixelHeight:u,numberOfMipmapLevels:l,offset:c}=rF(t),h=nt.INTERNAL_FORMAT_TO_TEXTURE_FORMATS[o];if(!h)throw new Error(`Unknown texture format ${o}`);if(!e.includes(h))throw new Error(`Unsupported texture format: ${h}, supportedFormats: ${e}`);let d=tF(s,n,o),p=eF(t,s,d,a,u,c,l,i);return {format:h,width:a,height:u,resource:p,alphaMode:"no-premultiply-alpha"}}function eF(r,e,t,i,s,n,o,a){let u=i+3&-4,l=s+3&-4,c=i*s;e===0&&(c=u*l);let h=c*t,d=i,p=s,m=u,b=l,_=n,g=new Array(o);for(let y=0;y<o;y++){let S=r.getUint32(_,a),E=_+4;g[y]=new Uint8Array(r.buffer,E,h),E+=h,_+=S+4,_=_%4!==0?_+4-_%4:_,d=d>>1||1,p=p>>1||1,m=d+4-1&-4,b=p+4-1&-4,h=m*b*t;}return g}function tF(r,e,t){let i=nt.INTERNAL_FORMAT_TO_BYTES_PER_PIXEL[t];if(r!==0&&(nt.TYPES_TO_BYTES_PER_COMPONENT[r]?i=nt.TYPES_TO_BYTES_PER_COMPONENT[r]*nt.FORMATS_TO_COMPONENTS[e]:i=nt.TYPES_TO_BYTES_PER_PIXEL[r]),i===void 0)throw new Error("Unable to resolve the pixel format stored in the *.ktx file!");return i}function rF(r){let e=r.getUint32(nt.FIELDS.ENDIANNESS,true)===nt.ENDIANNESS,t=r.getUint32(nt.FIELDS.GL_TYPE,e),i=r.getUint32(nt.FIELDS.GL_FORMAT,e),s=r.getUint32(nt.FIELDS.GL_INTERNAL_FORMAT,e),n=r.getUint32(nt.FIELDS.PIXEL_WIDTH,e),o=r.getUint32(nt.FIELDS.PIXEL_HEIGHT,e)||1,a=r.getUint32(nt.FIELDS.PIXEL_DEPTH,e)||1,u=r.getUint32(nt.FIELDS.NUMBER_OF_ARRAY_ELEMENTS,e)||1,l=r.getUint32(nt.FIELDS.NUMBER_OF_FACES,e),c=r.getUint32(nt.FIELDS.NUMBER_OF_MIPMAP_LEVELS,e),h=r.getUint32(nt.FIELDS.BYTES_OF_KEY_VALUE_DATA,e);if(o===0||a!==1)throw new Error("Only 2D textures are supported");if(l!==1)throw new Error("CubeTextures are not supported by KTXLoader yet!");if(u!==1)throw new Error("WebGL does not support array textures");return {littleEndian:e,glType:t,glFormat:i,glInternalFormat:s,pixelWidth:n,pixelHeight:o,numberOfMipmapLevels:c,offset:nt.FILE_HEADER_SIZE+h}}function iF(r){for(let e=0;e<nt.FILE_IDENTIFIER.length;e++)if(r.getUint8(e)!==nt.FILE_IDENTIFIER[e])return false;return true}var jE=f(()=>{YE();});var M3,I3=f(()=>{Er();ms();wr();B();Fl();Ul();jE();M3={extension:{type:x.LoadParser,priority:ze.High,name:"loadKTX"},name:"loadKTX",test(r){return it(r,".ktx")},async load(r,e,t){let i=await Gi(),n=await(await fetch(r)).arrayBuffer(),o=L_(n,i),a=new jr(o);return Kt(a,t,r)},unload(r){Array.isArray(r)?r.forEach(e=>e.destroy(true)):r.destroy(true);}};});var sF,Hl,Md,D3=f(()=>{sF=`(function () {
2229
2229
  'use strict';
2230
2230
 
2231
2231
  const converters = {
@@ -2469,8 +2469,8 @@ ${h}`)}});return await Promise.all(u),n?s[o[0].src]:s}async unload(e){let i=Ht(e
2469
2469
  };
2470
2470
 
2471
2471
  })();
2472
- `,Hl=null,Md=class{constructor(){Hl||(Hl=URL.createObjectURL(new Blob([sF],{type:"application/javascript"}))),this.worker=new Worker(Hl);}};Md.revokeObjectURL=function(){Hl&&(URL.revokeObjectURL(Hl),Hl=null);};});function k3(r){Object.assign(Vl,r);}var Vl,$E=f(()=>{Vl={jsUrl:"https://files.pixijs.download/transcoders/ktx/libktx.js",wasmUrl:"https://files.pixijs.download/transcoders/ktx/libktx.wasm"};});function nF(r){return Id||(Id=new Md().worker,Id.onmessage=e=>{let{success:t,url:i,textureOptions:s}=e.data;t||console.warn("Failed to load KTX texture",i),O3[i](s);},Id.postMessage({type:"init",jsUrl:Vl.jsUrl,wasmUrl:Vl.wasmUrl,supportedTextures:r})),Id}function N_(r,e){let t=nF(e);return new Promise(i=>{O3[r]=i,t.postMessage({type:"load",url:r});})}var Id,O3,qE=f(()=>{D3();$E();O3={};});var F3,G3=f(()=>{Er();ms();wr();B();Fl();Ul();qE();F3={extension:{type:x.LoadParser,priority:ze.High,name:"loadKTX2"},name:"loadKTX2",test(r){return it(r,".ktx2")},async load(r,e,t){let i=await Gi(),s=await N_(r,i),n=new $r(s);return Kt(n,t,r)},async unload(r){Array.isArray(r)?r.forEach(e=>e.destroy(true)):r.destroy(true);}};});function L3(r){let e=r.format;if(KE[e]){let t=KE[e].convertFunction,i=r.resource;for(let s=0;s<i.length;s++)i[s]=t(i[s]);r.format=KE[e].convertedFormat;}}function U3(r){let e=r.byteLength/3,t=new Uint32Array(e);for(let i=0;i<e;++i)t[i]=r[i*3]+(r[i*3+1]<<8)+(r[i*3+2]<<16)+4278190080;return new Uint8Array(t.buffer)}var KE,N3=f(()=>{KE={rgb8unorm:{convertedFormat:"rgba8unorm",convertFunction:U3},"rgb8unorm-srgb":{convertedFormat:"rgba8unorm-srgb",convertFunction:U3}};});function H3(r){let e=[];for(let t=0;t<r.numLevels;t++){let i=r.getImageData(t,0,0),s=new Uint8Array(i.byteLength);s.set(i),e.push(s);}return e}var V3=f(()=>{});function H_(r){let e=oF[r];if(e)return e;throw new Error(`Unsupported glInternalFormat: ${r}`)}var oF,ZE=f(()=>{oF={6408:"rgba8unorm",32856:"bgra8unorm",32857:"rgb10a2unorm",33189:"depth16unorm",33190:"depth24plus",33321:"r8unorm",33323:"rg8unorm",33325:"r16float",33326:"r32float",33327:"rg16float",33328:"rg32float",33329:"r8sint",33330:"r8uint",33331:"r16sint",33332:"r16uint",33333:"r32sint",33334:"r32uint",33335:"rg8sint",33336:"rg8uint",33337:"rg16sint",33338:"rg16uint",33339:"rg32sint",33340:"rg32uint",33778:"bc2-rgba-unorm",33779:"bc3-rgba-unorm",34836:"rgba32float",34842:"rgba16float",35056:"depth24plus-stencil8",35898:"rg11b10ufloat",35901:"rgb9e5ufloat",35907:"rgba8unorm-srgb",36012:"depth32float",36013:"depth32float-stencil8",36168:"stencil8",36208:"rgba32uint",36214:"rgba16uint",36220:"rgba8uint",36226:"rgba32sint",36232:"rgba16sint",36238:"rgba8sint",36492:"bc7-rgba-unorm",36756:"r8snorm",36757:"rg8snorm",36759:"rgba8snorm",37496:"etc2-rgba8unorm",37808:"astc-4x4-unorm"};});function V_(r){let e=aF[r];if(e)return e;throw new Error(`Unsupported VkFormat: ${r}`)}var aF,QE=f(()=>{aF={23:"rgb8unorm",37:"rgba8unorm",43:"rgba8unorm-srgb"};});function z3(r){return r.classId===2?V_(r.vkFormat):H_(r.glInternalformat)}var W3=f(()=>{ZE();QE();});function X3(r){let e=uF[r];if(e)return e;throw new Error(`Unsupported transcoderFormat: ${r}`)}var uF,Y3=f(()=>{uF={"bc3-rgba-unorm":"BC3_RGBA","bc7-rgba-unorm":"BC7_M5_RGBA","etc2-rgba8unorm":"ETC2_RGBA","astc-4x4-unorm":"ASTC_4x4_RGBA",rgba8unorm:"RGBA32",rg11b10ufloat:"R11F_G11F_B10F"};});var zl,j3,JE=f(()=>{Ls();wr();B();zl=["basis","bc7","bc6h","astc","etc2","bc5","bc4","bc3","bc2","bc1","eac"],j3={extension:x.ResolveParser,test:r=>it(r,[".ktx",".ktx2",".dds"]),parse:r=>{let e,t=r.split(".");if(t.length>2){let i=t[t.length-2];zl.includes(i)&&(e=i);}else e=t[t.length-1];return {resolution:parseFloat(Vt.RETINA_PREFIX.exec(r)?.[1]??"1"),format:e,src:r}}};});function lF(r){let e=["basis"],t={};return r.forEach(i=>{let s=i.split("-")[0];s&&!t[s]&&(t[s]=true,e.push(s));}),e.sort((i,s)=>{let n=zl.indexOf(i),o=zl.indexOf(s);return n===-1?1:o===-1?-1:n-o}),e}var z_,$3,q3=f(()=>{B();I_();rl();il();JE();$3={extension:{type:x.DetectionParser,priority:2},test:async()=>!!(await Oi()||ki()),add:async r=>{let e=await Gl();return z_=lF(e),[...z_,...r]},remove:async r=>z_?r.filter(e=>!(e in z_)):r};});var cF,e1,W_,t1=f(()=>{Lt();Kn();cF=new Ae,e1=class{cull(e,t,i=true){this._cullRecursive(e,t,i);}_cullRecursive(e,t,i=true){if(e.cullable&&e.measurable&&e.includeInBuild){let s=e.cullArea??Ei(e,i,cF);e.culled=s.x>=t.x+t.width||s.y>=t.y+t.height||s.x+s.width<=t.x||s.y+s.height<=t.y;}else e.culled=false;if(!(!e.cullableChildren||e.culled||!e.renderable||!e.measurable||!e.includeInBuild))for(let s=0;s<e.children.length;s++)this._cullRecursive(e.children[s],t,i);}};e1.shared=new e1;W_=e1;});var Dd,K3=f(()=>{B();t1();Dd=class{static init(){this._renderRef=this.render.bind(this),this.render=()=>{W_.shared.cull(this.stage,this.renderer.screen),this.renderer.render({container:this.stage});};}static destroy(){this.render=this._renderRef;}};Dd.extension={priority:10,type:x.Application,name:"culler"};});var kd=Qr(Wl=>{function hF(r,e,t){if(t===void 0&&(t=Array.prototype),r&&typeof t.find=="function")return t.find.call(r,e);for(var i=0;i<r.length;i++)if(Object.prototype.hasOwnProperty.call(r,i)){var s=r[i];if(e.call(void 0,s,i,r))return s}}function r1(r,e){return e===void 0&&(e=Object),e&&typeof e.freeze=="function"?e.freeze(r):r}function dF(r,e){if(r===null||typeof r!="object")throw new TypeError("target is not an object");for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t]);return r}var Z3=r1({HTML:"text/html",isHTML:function(r){return r===Z3.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),Q3=r1({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(r){return r===Q3.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});Wl.assign=dF;Wl.find=hF;Wl.freeze=r1;Wl.MIME_TYPE=Z3;Wl.NAMESPACE=Q3;});var f1=Qr(Bn=>{var oB=kd(),Ui=oB.find,Od=oB.NAMESPACE;function fF(r){return r!==""}function pF(r){return r?r.split(/[\t\n\f\r ]+/).filter(fF):[]}function mF(r,e){return r.hasOwnProperty(e)||(r[e]=true),r}function J3(r){if(!r)return [];var e=pF(r);return Object.keys(e.reduce(mF,{}))}function gF(r){return function(e){return r&&r.indexOf(e)!==-1}}function Gd(r,e){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t]);}function gr(r,e){var t=r.prototype;if(!(t instanceof e)){let s=function(){};s.prototype=e.prototype,s=new s,Gd(t,s),r.prototype=t=s;}t.constructor!=r&&(typeof r!="function"&&console.error("unknown Class:"+r),t.constructor=r);}var xr={},di=xr.ELEMENT_NODE=1,Yl=xr.ATTRIBUTE_NODE=2,X_=xr.TEXT_NODE=3,aB=xr.CDATA_SECTION_NODE=4,uB=xr.ENTITY_REFERENCE_NODE=5,xF=xr.ENTITY_NODE=6,lB=xr.PROCESSING_INSTRUCTION_NODE=7,cB=xr.COMMENT_NODE=8,hB=xr.DOCUMENT_NODE=9,dB=xr.DOCUMENT_TYPE_NODE=10,xs=xr.DOCUMENT_FRAGMENT_NODE=11,_F=xr.NOTATION_NODE=12,Qt={},Ot={};Qt.INDEX_SIZE_ERR=(Ot[1]="Index size error",1);Qt.DOMSTRING_SIZE_ERR=(Ot[2]="DOMString size error",2);var mr=Qt.HIERARCHY_REQUEST_ERR=(Ot[3]="Hierarchy request error",3);Qt.WRONG_DOCUMENT_ERR=(Ot[4]="Wrong document",4);Qt.INVALID_CHARACTER_ERR=(Ot[5]="Invalid character",5);Qt.NO_DATA_ALLOWED_ERR=(Ot[6]="No data allowed",6);Qt.NO_MODIFICATION_ALLOWED_ERR=(Ot[7]="No modification allowed",7);var fB=Qt.NOT_FOUND_ERR=(Ot[8]="Not found",8);Qt.NOT_SUPPORTED_ERR=(Ot[9]="Not supported",9);var eB=Qt.INUSE_ATTRIBUTE_ERR=(Ot[10]="Attribute in use",10);Qt.INVALID_STATE_ERR=(Ot[11]="Invalid state",11);Qt.SYNTAX_ERR=(Ot[12]="Syntax error",12);Qt.INVALID_MODIFICATION_ERR=(Ot[13]="Invalid modification",13);Qt.NAMESPACE_ERR=(Ot[14]="Invalid namespace",14);Qt.INVALID_ACCESS_ERR=(Ot[15]="Invalid access",15);function ft(r,e){if(e instanceof Error)var t=e;else t=this,Error.call(this,Ot[r]),this.message=Ot[r],Error.captureStackTrace&&Error.captureStackTrace(this,ft);return t.code=r,e&&(this.message=this.message+": "+e),t}ft.prototype=Error.prototype;Gd(Qt,ft);function gs(){}gs.prototype={length:0,item:function(r){return r>=0&&r<this.length?this[r]:null},toString:function(r,e){for(var t=[],i=0;i<this.length;i++)Xl(this[i],t,r,e);return t.join("")},filter:function(r){return Array.prototype.filter.call(this,r)},indexOf:function(r){return Array.prototype.indexOf.call(this,r)}};function jl(r,e){this._node=r,this._refresh=e,n1(this);}function n1(r){var e=r._node._inc||r._node.ownerDocument._inc;if(r._inc!==e){var t=r._refresh(r._node);if(CB(r,"length",t.length),!r.$$length||t.length<r.$$length)for(var i=t.length;i in r;i++)Object.prototype.hasOwnProperty.call(r,i)&&delete r[i];Gd(t,r),r._inc=e;}}jl.prototype.item=function(r){return n1(this),this[r]||null};gr(jl,gs);function Y_(){}function pB(r,e){for(var t=r.length;t--;)if(r[t]===e)return t}function tB(r,e,t,i){if(i?e[pB(e,i)]=t:e[e.length++]=t,r){t.ownerElement=r;var s=r.ownerDocument;s&&(i&&xB(s,r,i),bF(s,r,t));}}function rB(r,e,t){var i=pB(e,t);if(i>=0){for(var s=e.length-1;i<s;)e[i]=e[++i];if(e.length=s,r){var n=r.ownerDocument;n&&(xB(n,r,t),t.ownerElement=null);}}else throw new ft(fB,new Error(r.tagName+"@"+t))}Y_.prototype={length:0,item:gs.prototype.item,getNamedItem:function(r){for(var e=this.length;e--;){var t=this[e];if(t.nodeName==r)return t}},setNamedItem:function(r){var e=r.ownerElement;if(e&&e!=this._ownerElement)throw new ft(eB);var t=this.getNamedItem(r.nodeName);return tB(this._ownerElement,this,r,t),t},setNamedItemNS:function(r){var e=r.ownerElement,t;if(e&&e!=this._ownerElement)throw new ft(eB);return t=this.getNamedItemNS(r.namespaceURI,r.localName),tB(this._ownerElement,this,r,t),t},removeNamedItem:function(r){var e=this.getNamedItem(r);return rB(this._ownerElement,this,e),e},removeNamedItemNS:function(r,e){var t=this.getNamedItemNS(r,e);return rB(this._ownerElement,this,t),t},getNamedItemNS:function(r,e){for(var t=this.length;t--;){var i=this[t];if(i.localName==e&&i.namespaceURI==r)return i}return null}};function mB(){}mB.prototype={hasFeature:function(r,e){return true},createDocument:function(r,e,t){var i=new Ud;if(i.implementation=this,i.childNodes=new gs,i.doctype=t||null,t&&i.appendChild(t),e){var s=i.createElementNS(r,e);i.appendChild(s);}return i},createDocumentType:function(r,e,t){var i=new q_;return i.name=r,i.nodeName=r,i.publicId=e||"",i.systemId=t||"",i}};function Le(){}Le.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(r,e){return j_(this,r,e)},replaceChild:function(r,e){j_(this,r,e,bB),e&&this.removeChild(e);},removeChild:function(r){return _B(this,r)},appendChild:function(r){return this.insertBefore(r,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(r){return s1(this.ownerDocument||this,this,r)},normalize:function(){for(var r=this.firstChild;r;){var e=r.nextSibling;e&&e.nodeType==X_&&r.nodeType==X_?(this.removeChild(e),r.appendData(e.data)):(r.normalize(),r=e);}},isSupported:function(r,e){return this.ownerDocument.implementation.hasFeature(r,e)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(r){for(var e=this;e;){var t=e._nsMap;if(t){for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&t[i]===r)return i}e=e.nodeType==Yl?e.ownerDocument:e.parentNode;}return null},lookupNamespaceURI:function(r){for(var e=this;e;){var t=e._nsMap;if(t&&Object.prototype.hasOwnProperty.call(t,r))return t[r];e=e.nodeType==Yl?e.ownerDocument:e.parentNode;}return null},isDefaultNamespace:function(r){var e=this.lookupPrefix(r);return e==null}};function gB(r){return r=="<"&&"&lt;"||r==">"&&"&gt;"||r=="&"&&"&amp;"||r=='"'&&"&quot;"||"&#"+r.charCodeAt()+";"}Gd(xr,Le);Gd(xr,Le.prototype);function Fd(r,e){if(e(r))return true;if(r=r.firstChild)do if(Fd(r,e))return true;while(r=r.nextSibling)}function Ud(){this.ownerDocument=this;}function bF(r,e,t){r&&r._inc++;var i=t.namespaceURI;i===Od.XMLNS&&(e._nsMap[t.prefix?t.localName:""]=t.value);}function xB(r,e,t,i){r&&r._inc++;var s=t.namespaceURI;s===Od.XMLNS&&delete e._nsMap[t.prefix?t.localName:""];}function o1(r,e,t){if(r&&r._inc){r._inc++;var i=e.childNodes;if(t)i[i.length++]=t;else {for(var s=e.firstChild,n=0;s;)i[n++]=s,s=s.nextSibling;i.length=n,delete i[i.length];}}}function _B(r,e){var t=e.previousSibling,i=e.nextSibling;return t?t.nextSibling=i:r.firstChild=i,i?i.previousSibling=t:r.lastChild=t,e.parentNode=null,e.previousSibling=null,e.nextSibling=null,o1(r.ownerDocument,r),e}function yF(r){return r&&(r.nodeType===Le.DOCUMENT_NODE||r.nodeType===Le.DOCUMENT_FRAGMENT_NODE||r.nodeType===Le.ELEMENT_NODE)}function vF(r){return r&&(Li(r)||a1(r)||_s(r)||r.nodeType===Le.DOCUMENT_FRAGMENT_NODE||r.nodeType===Le.COMMENT_NODE||r.nodeType===Le.PROCESSING_INSTRUCTION_NODE)}function _s(r){return r&&r.nodeType===Le.DOCUMENT_TYPE_NODE}function Li(r){return r&&r.nodeType===Le.ELEMENT_NODE}function a1(r){return r&&r.nodeType===Le.TEXT_NODE}function iB(r,e){var t=r.childNodes||[];if(Ui(t,Li)||_s(e))return false;var i=Ui(t,_s);return !(e&&i&&t.indexOf(i)>t.indexOf(e))}function sB(r,e){var t=r.childNodes||[];function i(n){return Li(n)&&n!==e}if(Ui(t,i))return false;var s=Ui(t,_s);return !(e&&s&&t.indexOf(s)>t.indexOf(e))}function TF(r,e,t){if(!yF(r))throw new ft(mr,"Unexpected parent node type "+r.nodeType);if(t&&t.parentNode!==r)throw new ft(fB,"child not in parent");if(!vF(e)||_s(e)&&r.nodeType!==Le.DOCUMENT_NODE)throw new ft(mr,"Unexpected node type "+e.nodeType+" for parent node type "+r.nodeType)}function SF(r,e,t){var i=r.childNodes||[],s=e.childNodes||[];if(e.nodeType===Le.DOCUMENT_FRAGMENT_NODE){var n=s.filter(Li);if(n.length>1||Ui(s,a1))throw new ft(mr,"More than one element or text in fragment");if(n.length===1&&!iB(r,t))throw new ft(mr,"Element in fragment can not be inserted before doctype")}if(Li(e)&&!iB(r,t))throw new ft(mr,"Only one element can be added and only after doctype");if(_s(e)){if(Ui(i,_s))throw new ft(mr,"Only one doctype is allowed");var o=Ui(i,Li);if(t&&i.indexOf(o)<i.indexOf(t))throw new ft(mr,"Doctype can only be inserted before an element");if(!t&&o)throw new ft(mr,"Doctype can not be appended since element is present")}}function bB(r,e,t){var i=r.childNodes||[],s=e.childNodes||[];if(e.nodeType===Le.DOCUMENT_FRAGMENT_NODE){var n=s.filter(Li);if(n.length>1||Ui(s,a1))throw new ft(mr,"More than one element or text in fragment");if(n.length===1&&!sB(r,t))throw new ft(mr,"Element in fragment can not be inserted before doctype")}if(Li(e)&&!sB(r,t))throw new ft(mr,"Only one element can be added and only after doctype");if(_s(e)){let u=function(l){return _s(l)&&l!==t};if(Ui(i,u))throw new ft(mr,"Only one doctype is allowed");var o=Ui(i,Li);if(t&&i.indexOf(o)<i.indexOf(t))throw new ft(mr,"Doctype can only be inserted before an element")}}function j_(r,e,t,i){TF(r,e,t),r.nodeType===Le.DOCUMENT_NODE&&(i||SF)(r,e,t);var s=e.parentNode;if(s&&s.removeChild(e),e.nodeType===xs){var n=e.firstChild;if(n==null)return e;var o=e.lastChild;}else n=o=e;var a=t?t.previousSibling:r.lastChild;n.previousSibling=a,o.nextSibling=t,a?a.nextSibling=n:r.firstChild=n,t==null?r.lastChild=o:t.previousSibling=o;do n.parentNode=r;while(n!==o&&(n=n.nextSibling));return o1(r.ownerDocument||r,r),e.nodeType==xs&&(e.firstChild=e.lastChild=null),e}function EF(r,e){return e.parentNode&&e.parentNode.removeChild(e),e.parentNode=r,e.previousSibling=r.lastChild,e.nextSibling=null,e.previousSibling?e.previousSibling.nextSibling=e:r.firstChild=e,r.lastChild=e,o1(r.ownerDocument,r,e),e}Ud.prototype={nodeName:"#document",nodeType:hB,doctype:null,documentElement:null,_inc:1,insertBefore:function(r,e){if(r.nodeType==xs){for(var t=r.firstChild;t;){var i=t.nextSibling;this.insertBefore(t,e),t=i;}return r}return j_(this,r,e),r.ownerDocument=this,this.documentElement===null&&r.nodeType===di&&(this.documentElement=r),r},removeChild:function(r){return this.documentElement==r&&(this.documentElement=null),_B(this,r)},replaceChild:function(r,e){j_(this,r,e,bB),r.ownerDocument=this,e&&this.removeChild(e),Li(r)&&(this.documentElement=r);},importNode:function(r,e){return EB(this,r,e)},getElementById:function(r){var e=null;return Fd(this.documentElement,function(t){if(t.nodeType==di&&t.getAttribute("id")==r)return e=t,true}),e},getElementsByClassName:function(r){var e=J3(r);return new jl(this,function(t){var i=[];return e.length>0&&Fd(t.documentElement,function(s){if(s!==t&&s.nodeType===di){var n=s.getAttribute("class");if(n){var o=r===n;if(!o){var a=J3(n);o=e.every(gF(a));}o&&i.push(s);}}}),i})},createElement:function(r){var e=new Fa;e.ownerDocument=this,e.nodeName=r,e.tagName=r,e.localName=r,e.childNodes=new gs;var t=e.attributes=new Y_;return t._ownerElement=e,e},createDocumentFragment:function(){var r=new K_;return r.ownerDocument=this,r.childNodes=new gs,r},createTextNode:function(r){var e=new u1;return e.ownerDocument=this,e.appendData(r),e},createComment:function(r){var e=new l1;return e.ownerDocument=this,e.appendData(r),e},createCDATASection:function(r){var e=new c1;return e.ownerDocument=this,e.appendData(r),e},createProcessingInstruction:function(r,e){var t=new d1;return t.ownerDocument=this,t.tagName=t.nodeName=t.target=r,t.nodeValue=t.data=e,t},createAttribute:function(r){var e=new $_;return e.ownerDocument=this,e.name=r,e.nodeName=r,e.localName=r,e.specified=true,e},createEntityReference:function(r){var e=new h1;return e.ownerDocument=this,e.nodeName=r,e},createElementNS:function(r,e){var t=new Fa,i=e.split(":"),s=t.attributes=new Y_;return t.childNodes=new gs,t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.namespaceURI=r,i.length==2?(t.prefix=i[0],t.localName=i[1]):t.localName=e,s._ownerElement=t,t},createAttributeNS:function(r,e){var t=new $_,i=e.split(":");return t.ownerDocument=this,t.nodeName=e,t.name=e,t.namespaceURI=r,t.specified=true,i.length==2?(t.prefix=i[0],t.localName=i[1]):t.localName=e,t}};gr(Ud,Le);function Fa(){this._nsMap={};}Fa.prototype={nodeType:di,hasAttribute:function(r){return this.getAttributeNode(r)!=null},getAttribute:function(r){var e=this.getAttributeNode(r);return e&&e.value||""},getAttributeNode:function(r){return this.attributes.getNamedItem(r)},setAttribute:function(r,e){var t=this.ownerDocument.createAttribute(r);t.value=t.nodeValue=""+e,this.setAttributeNode(t);},removeAttribute:function(r){var e=this.getAttributeNode(r);e&&this.removeAttributeNode(e);},appendChild:function(r){return r.nodeType===xs?this.insertBefore(r,null):EF(this,r)},setAttributeNode:function(r){return this.attributes.setNamedItem(r)},setAttributeNodeNS:function(r){return this.attributes.setNamedItemNS(r)},removeAttributeNode:function(r){return this.attributes.removeNamedItem(r.nodeName)},removeAttributeNS:function(r,e){var t=this.getAttributeNodeNS(r,e);t&&this.removeAttributeNode(t);},hasAttributeNS:function(r,e){return this.getAttributeNodeNS(r,e)!=null},getAttributeNS:function(r,e){var t=this.getAttributeNodeNS(r,e);return t&&t.value||""},setAttributeNS:function(r,e,t){var i=this.ownerDocument.createAttributeNS(r,e);i.value=i.nodeValue=""+t,this.setAttributeNode(i);},getAttributeNodeNS:function(r,e){return this.attributes.getNamedItemNS(r,e)},getElementsByTagName:function(r){return new jl(this,function(e){var t=[];return Fd(e,function(i){i!==e&&i.nodeType==di&&(r==="*"||i.tagName==r)&&t.push(i);}),t})},getElementsByTagNameNS:function(r,e){return new jl(this,function(t){var i=[];return Fd(t,function(s){s!==t&&s.nodeType===di&&(r==="*"||s.namespaceURI===r)&&(e==="*"||s.localName==e)&&i.push(s);}),i})}};Ud.prototype.getElementsByTagName=Fa.prototype.getElementsByTagName;Ud.prototype.getElementsByTagNameNS=Fa.prototype.getElementsByTagNameNS;gr(Fa,Le);function $_(){}$_.prototype.nodeType=Yl;gr($_,Le);function Ld(){}Ld.prototype={data:"",substringData:function(r,e){return this.data.substring(r,r+e)},appendData:function(r){r=this.data+r,this.nodeValue=this.data=r,this.length=r.length;},insertData:function(r,e){this.replaceData(r,0,e);},appendChild:function(r){throw new Error(Ot[mr])},deleteData:function(r,e){this.replaceData(r,e,"");},replaceData:function(r,e,t){var i=this.data.substring(0,r),s=this.data.substring(r+e);t=i+t+s,this.nodeValue=this.data=t,this.length=t.length;}};gr(Ld,Le);function u1(){}u1.prototype={nodeName:"#text",nodeType:X_,splitText:function(r){var e=this.data,t=e.substring(r);e=e.substring(0,r),this.data=this.nodeValue=e,this.length=e.length;var i=this.ownerDocument.createTextNode(t);return this.parentNode&&this.parentNode.insertBefore(i,this.nextSibling),i}};gr(u1,Ld);function l1(){}l1.prototype={nodeName:"#comment",nodeType:cB};gr(l1,Ld);function c1(){}c1.prototype={nodeName:"#cdata-section",nodeType:aB};gr(c1,Ld);function q_(){}q_.prototype.nodeType=dB;gr(q_,Le);function yB(){}yB.prototype.nodeType=_F;gr(yB,Le);function vB(){}vB.prototype.nodeType=xF;gr(vB,Le);function h1(){}h1.prototype.nodeType=uB;gr(h1,Le);function K_(){}K_.prototype.nodeName="#document-fragment";K_.prototype.nodeType=xs;gr(K_,Le);function d1(){}d1.prototype.nodeType=lB;gr(d1,Le);function TB(){}TB.prototype.serializeToString=function(r,e,t){return SB.call(r,e,t)};Le.prototype.toString=SB;function SB(r,e){var t=[],i=this.nodeType==9&&this.documentElement||this,s=i.prefix,n=i.namespaceURI;if(n&&s==null){var s=i.lookupPrefix(n);if(s==null)var o=[{namespace:n,prefix:null}];}return Xl(this,t,r,e,o),t.join("")}function nB(r,e,t){var i=r.prefix||"",s=r.namespaceURI;if(!s||i==="xml"&&s===Od.XML||s===Od.XMLNS)return false;for(var n=t.length;n--;){var o=t[n];if(o.prefix===i)return o.namespace!==s}return true}function i1(r,e,t){r.push(" ",e,'="',t.replace(/[<>&"\t\n\r]/g,gB),'"');}function Xl(r,e,t,i,s){if(s||(s=[]),i)if(r=i(r),r){if(typeof r=="string"){e.push(r);return}}else return;switch(r.nodeType){case di:var n=r.attributes,o=n.length,g=r.firstChild,a=r.tagName;t=Od.isHTML(r.namespaceURI)||t;var u=a;if(!t&&!r.prefix&&r.namespaceURI){for(var l,c=0;c<n.length;c++)if(n.item(c).name==="xmlns"){l=n.item(c).value;break}if(!l)for(var h=s.length-1;h>=0;h--){var d=s[h];if(d.prefix===""&&d.namespace===r.namespaceURI){l=d.namespace;break}}if(l!==r.namespaceURI)for(var h=s.length-1;h>=0;h--){var d=s[h];if(d.namespace===r.namespaceURI){d.prefix&&(u=d.prefix+":"+a);break}}}e.push("<",u);for(var p=0;p<o;p++){var m=n.item(p);m.prefix=="xmlns"?s.push({prefix:m.localName,namespace:m.value}):m.nodeName=="xmlns"&&s.push({prefix:"",namespace:m.value});}for(var p=0;p<o;p++){var m=n.item(p);if(nB(m,t,s)){var b=m.prefix||"",_=m.namespaceURI;i1(e,b?"xmlns:"+b:"xmlns",_),s.push({prefix:b,namespace:_});}Xl(m,e,t,i,s);}if(a===u&&nB(r,t,s)){var b=r.prefix||"",_=r.namespaceURI;i1(e,b?"xmlns:"+b:"xmlns",_),s.push({prefix:b,namespace:_});}if(g||t&&!/^(?:meta|link|img|br|hr|input)$/i.test(a)){if(e.push(">"),t&&/^script$/i.test(a))for(;g;)g.data?e.push(g.data):Xl(g,e,t,i,s.slice()),g=g.nextSibling;else for(;g;)Xl(g,e,t,i,s.slice()),g=g.nextSibling;e.push("</",u,">");}else e.push("/>");return;case hB:case xs:for(var g=r.firstChild;g;)Xl(g,e,t,i,s.slice()),g=g.nextSibling;return;case Yl:return i1(e,r.name,r.value);case X_:return e.push(r.data.replace(/[<&>]/g,gB));case aB:return e.push("<![CDATA[",r.data,"]]>");case cB:return e.push("<!--",r.data,"-->");case dB:var y=r.publicId,S=r.systemId;if(e.push("<!DOCTYPE ",r.name),y)e.push(" PUBLIC ",y),S&&S!="."&&e.push(" ",S),e.push(">");else if(S&&S!=".")e.push(" SYSTEM ",S,">");else {var E=r.internalSubset;E&&e.push(" [",E,"]"),e.push(">");}return;case lB:return e.push("<?",r.target," ",r.data,"?>");case uB:return e.push("&",r.nodeName,";");default:e.push("??",r.nodeName);}}function EB(r,e,t){var i;switch(e.nodeType){case di:i=e.cloneNode(false),i.ownerDocument=r;case xs:break;case Yl:t=true;break}if(i||(i=e.cloneNode(false)),i.ownerDocument=r,i.parentNode=null,t)for(var s=e.firstChild;s;)i.appendChild(EB(r,s,t)),s=s.nextSibling;return i}function s1(r,e,t){var i=new e.constructor;for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){var n=e[s];typeof n!="object"&&n!=i[s]&&(i[s]=n);}switch(e.childNodes&&(i.childNodes=new gs),i.ownerDocument=r,i.nodeType){case di:var o=e.attributes,a=i.attributes=new Y_,u=o.length;a._ownerElement=i;for(var l=0;l<u;l++)i.setAttributeNode(s1(r,o.item(l),true));break;case Yl:t=true;}if(t)for(var c=e.firstChild;c;)i.appendChild(s1(r,c,t)),c=c.nextSibling;return i}function CB(r,e,t){r[e]=t;}try{if(Object.defineProperty){let r=function(e){switch(e.nodeType){case di:case xs:var t=[];for(e=e.firstChild;e;)e.nodeType!==7&&e.nodeType!==8&&t.push(r(e)),e=e.nextSibling;return t.join("");default:return e.nodeValue}};CF=r,Object.defineProperty(jl.prototype,"length",{get:function(){return n1(this),this.$$length}}),Object.defineProperty(Le.prototype,"textContent",{get:function(){return r(this)},set:function(e){switch(this.nodeType){case di:case xs:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e;}}}),CB=function(e,t,i){e["$$"+t]=i;};}}catch{}var CF;Bn.DocumentType=q_;Bn.DOMException=ft;Bn.DOMImplementation=mB;Bn.Element=Fa;Bn.Node=Le;Bn.NodeList=gs;Bn.XMLSerializer=TB;});var PB=Qr(Nd=>{var AB=kd().freeze;Nd.XML_ENTITIES=AB({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'});Nd.HTML_ENTITIES=AB({Aacute:"\xC1",aacute:"\xE1",Abreve:"\u0102",abreve:"\u0103",ac:"\u223E",acd:"\u223F",acE:"\u223E\u0333",Acirc:"\xC2",acirc:"\xE2",acute:"\xB4",Acy:"\u0410",acy:"\u0430",AElig:"\xC6",aelig:"\xE6",af:"\u2061",Afr:"\u{1D504}",afr:"\u{1D51E}",Agrave:"\xC0",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",Alpha:"\u0391",alpha:"\u03B1",Amacr:"\u0100",amacr:"\u0101",amalg:"\u2A3F",AMP:"&",amp:"&",And:"\u2A53",and:"\u2227",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",Aogon:"\u0104",aogon:"\u0105",Aopf:"\u{1D538}",aopf:"\u{1D552}",ap:"\u2248",apacir:"\u2A6F",apE:"\u2A70",ape:"\u224A",apid:"\u224B",apos:"'",ApplyFunction:"\u2061",approx:"\u2248",approxeq:"\u224A",Aring:"\xC5",aring:"\xE5",Ascr:"\u{1D49C}",ascr:"\u{1D4B6}",Assign:"\u2254",ast:"*",asymp:"\u2248",asympeq:"\u224D",Atilde:"\xC3",atilde:"\xE3",Auml:"\xC4",auml:"\xE4",awconint:"\u2233",awint:"\u2A11",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",Backslash:"\u2216",Barv:"\u2AE7",barvee:"\u22BD",Barwed:"\u2306",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",Bcy:"\u0411",bcy:"\u0431",bdquo:"\u201E",becaus:"\u2235",Because:"\u2235",because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",Bernoullis:"\u212C",Beta:"\u0392",beta:"\u03B2",beth:"\u2136",between:"\u226C",Bfr:"\u{1D505}",bfr:"\u{1D51F}",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bNot:"\u2AED",bnot:"\u2310",Bopf:"\u{1D539}",bopf:"\u{1D553}",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxbox:"\u29C9",boxDL:"\u2557",boxDl:"\u2556",boxdL:"\u2555",boxdl:"\u2510",boxDR:"\u2554",boxDr:"\u2553",boxdR:"\u2552",boxdr:"\u250C",boxH:"\u2550",boxh:"\u2500",boxHD:"\u2566",boxHd:"\u2564",boxhD:"\u2565",boxhd:"\u252C",boxHU:"\u2569",boxHu:"\u2567",boxhU:"\u2568",boxhu:"\u2534",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxUL:"\u255D",boxUl:"\u255C",boxuL:"\u255B",boxul:"\u2518",boxUR:"\u255A",boxUr:"\u2559",boxuR:"\u2558",boxur:"\u2514",boxV:"\u2551",boxv:"\u2502",boxVH:"\u256C",boxVh:"\u256B",boxvH:"\u256A",boxvh:"\u253C",boxVL:"\u2563",boxVl:"\u2562",boxvL:"\u2561",boxvl:"\u2524",boxVR:"\u2560",boxVr:"\u255F",boxvR:"\u255E",boxvr:"\u251C",bprime:"\u2035",Breve:"\u02D8",breve:"\u02D8",brvbar:"\xA6",Bscr:"\u212C",bscr:"\u{1D4B7}",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpE:"\u2AAE",bumpe:"\u224F",Bumpeq:"\u224E",bumpeq:"\u224F",Cacute:"\u0106",cacute:"\u0107",Cap:"\u22D2",cap:"\u2229",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",CapitalDifferentialD:"\u2145",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",Cayleys:"\u212D",ccaps:"\u2A4D",Ccaron:"\u010C",ccaron:"\u010D",Ccedil:"\xC7",ccedil:"\xE7",Ccirc:"\u0108",ccirc:"\u0109",Cconint:"\u2230",ccups:"\u2A4C",ccupssm:"\u2A50",Cdot:"\u010A",cdot:"\u010B",cedil:"\xB8",Cedilla:"\xB8",cemptyv:"\u29B2",cent:"\xA2",CenterDot:"\xB7",centerdot:"\xB7",Cfr:"\u212D",cfr:"\u{1D520}",CHcy:"\u0427",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",Chi:"\u03A7",chi:"\u03C7",cir:"\u25CB",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",CircleDot:"\u2299",circledR:"\xAE",circledS:"\u24C8",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",cirE:"\u29C3",cire:"\u2257",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201D",CloseCurlyQuote:"\u2019",clubs:"\u2663",clubsuit:"\u2663",Colon:"\u2237",colon:":",Colone:"\u2A74",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",Congruent:"\u2261",Conint:"\u222F",conint:"\u222E",ContourIntegral:"\u222E",Copf:"\u2102",copf:"\u{1D554}",coprod:"\u2210",Coproduct:"\u2210",COPY:"\xA9",copy:"\xA9",copysr:"\u2117",CounterClockwiseContourIntegral:"\u2233",crarr:"\u21B5",Cross:"\u2A2F",cross:"\u2717",Cscr:"\u{1D49E}",cscr:"\u{1D4B8}",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",Cup:"\u22D3",cup:"\u222A",cupbrcap:"\u2A48",CupCap:"\u224D",cupcap:"\u2A46",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",Dagger:"\u2021",dagger:"\u2020",daleth:"\u2138",Darr:"\u21A1",dArr:"\u21D3",darr:"\u2193",dash:"\u2010",Dashv:"\u2AE4",dashv:"\u22A3",dbkarow:"\u290F",dblac:"\u02DD",Dcaron:"\u010E",dcaron:"\u010F",Dcy:"\u0414",dcy:"\u0434",DD:"\u2145",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21CA",DDotrahd:"\u2911",ddotseq:"\u2A77",deg:"\xB0",Del:"\u2207",Delta:"\u0394",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",Dfr:"\u{1D507}",dfr:"\u{1D521}",dHar:"\u2965",dharl:"\u21C3",dharr:"\u21C2",DiacriticalAcute:"\xB4",DiacriticalDot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",DiacriticalGrave:"`",DiacriticalTilde:"\u02DC",diam:"\u22C4",Diamond:"\u22C4",diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",DifferentialD:"\u2146",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",DJcy:"\u0402",djcy:"\u0452",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",Dopf:"\u{1D53B}",dopf:"\u{1D555}",Dot:"\xA8",dot:"\u02D9",DotDot:"\u20DC",doteq:"\u2250",doteqdot:"\u2251",DotEqual:"\u2250",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",DoubleContourIntegral:"\u222F",DoubleDot:"\xA8",DoubleDownArrow:"\u21D3",DoubleLeftArrow:"\u21D0",DoubleLeftRightArrow:"\u21D4",DoubleLeftTee:"\u2AE4",DoubleLongLeftArrow:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",DoubleLongRightArrow:"\u27F9",DoubleRightArrow:"\u21D2",DoubleRightTee:"\u22A8",DoubleUpArrow:"\u21D1",DoubleUpDownArrow:"\u21D5",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",Downarrow:"\u21D3",downarrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21F5",DownBreve:"\u0311",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVector:"\u21BD",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295F",DownRightVector:"\u21C1",DownRightVectorBar:"\u2957",DownTee:"\u22A4",DownTeeArrow:"\u21A7",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",Dscr:"\u{1D49F}",dscr:"\u{1D4B9}",DScy:"\u0405",dscy:"\u0455",dsol:"\u29F6",Dstrok:"\u0110",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",DZcy:"\u040F",dzcy:"\u045F",dzigrarr:"\u27FF",Eacute:"\xC9",eacute:"\xE9",easter:"\u2A6E",Ecaron:"\u011A",ecaron:"\u011B",ecir:"\u2256",Ecirc:"\xCA",ecirc:"\xEA",ecolon:"\u2255",Ecy:"\u042D",ecy:"\u044D",eDDot:"\u2A77",Edot:"\u0116",eDot:"\u2251",edot:"\u0117",ee:"\u2147",efDot:"\u2252",Efr:"\u{1D508}",efr:"\u{1D522}",eg:"\u2A9A",Egrave:"\xC8",egrave:"\xE8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",Element:"\u2208",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",Emacr:"\u0112",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",EmptySmallSquare:"\u25FB",emptyv:"\u2205",EmptyVerySmallSquare:"\u25AB",emsp:"\u2003",emsp13:"\u2004",emsp14:"\u2005",ENG:"\u014A",eng:"\u014B",ensp:"\u2002",Eogon:"\u0118",eogon:"\u0119",Eopf:"\u{1D53C}",eopf:"\u{1D556}",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",Epsilon:"\u0395",epsilon:"\u03B5",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",Equal:"\u2A75",equals:"=",EqualTilde:"\u2242",equest:"\u225F",Equilibrium:"\u21CC",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erarr:"\u2971",erDot:"\u2253",Escr:"\u2130",escr:"\u212F",esdot:"\u2250",Esim:"\u2A73",esim:"\u2242",Eta:"\u0397",eta:"\u03B7",ETH:"\xD0",eth:"\xF0",Euml:"\xCB",euml:"\xEB",euro:"\u20AC",excl:"!",exist:"\u2203",Exists:"\u2203",expectation:"\u2130",ExponentialE:"\u2147",exponentiale:"\u2147",fallingdotseq:"\u2252",Fcy:"\u0424",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",Ffr:"\u{1D509}",ffr:"\u{1D523}",filig:"\uFB01",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",Fopf:"\u{1D53D}",fopf:"\u{1D557}",ForAll:"\u2200",forall:"\u2200",fork:"\u22D4",forkv:"\u2AD9",Fouriertrf:"\u2131",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",Fscr:"\u2131",fscr:"\u{1D4BB}",gacute:"\u01F5",Gamma:"\u0393",gamma:"\u03B3",Gammad:"\u03DC",gammad:"\u03DD",gap:"\u2A86",Gbreve:"\u011E",gbreve:"\u011F",Gcedil:"\u0122",Gcirc:"\u011C",gcirc:"\u011D",Gcy:"\u0413",gcy:"\u0433",Gdot:"\u0120",gdot:"\u0121",gE:"\u2267",ge:"\u2265",gEl:"\u2A8C",gel:"\u22DB",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",ges:"\u2A7E",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",Gfr:"\u{1D50A}",gfr:"\u{1D524}",Gg:"\u22D9",gg:"\u226B",ggg:"\u22D9",gimel:"\u2137",GJcy:"\u0403",gjcy:"\u0453",gl:"\u2277",gla:"\u2AA5",glE:"\u2A92",glj:"\u2AA4",gnap:"\u2A8A",gnapprox:"\u2A8A",gnE:"\u2269",gne:"\u2A88",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",Gopf:"\u{1D53E}",gopf:"\u{1D558}",grave:"`",GreaterEqual:"\u2265",GreaterEqualLess:"\u22DB",GreaterFullEqual:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2A7E",GreaterTilde:"\u2273",Gscr:"\u{1D4A2}",gscr:"\u210A",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",Gt:"\u226B",GT:">",gt:">",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",Hacek:"\u02C7",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",HARDcy:"\u042A",hardcy:"\u044A",hArr:"\u21D4",harr:"\u2194",harrcir:"\u2948",harrw:"\u21AD",Hat:"^",hbar:"\u210F",Hcirc:"\u0124",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",Hfr:"\u210C",hfr:"\u{1D525}",HilbertSpace:"\u210B",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",Hopf:"\u210D",hopf:"\u{1D559}",horbar:"\u2015",HorizontalLine:"\u2500",Hscr:"\u210B",hscr:"\u{1D4BD}",hslash:"\u210F",Hstrok:"\u0126",hstrok:"\u0127",HumpDownHump:"\u224E",HumpEqual:"\u224F",hybull:"\u2043",hyphen:"\u2010",Iacute:"\xCD",iacute:"\xED",ic:"\u2063",Icirc:"\xCE",icirc:"\xEE",Icy:"\u0418",icy:"\u0438",Idot:"\u0130",IEcy:"\u0415",iecy:"\u0435",iexcl:"\xA1",iff:"\u21D4",Ifr:"\u2111",ifr:"\u{1D526}",Igrave:"\xCC",igrave:"\xEC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",IJlig:"\u0132",ijlig:"\u0133",Im:"\u2111",Imacr:"\u012A",imacr:"\u012B",image:"\u2111",ImaginaryI:"\u2148",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22B7",imped:"\u01B5",Implies:"\u21D2",in:"\u2208",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",Int:"\u222C",int:"\u222B",intcal:"\u22BA",integers:"\u2124",Integral:"\u222B",intercal:"\u22BA",Intersection:"\u22C2",intlarhk:"\u2A17",intprod:"\u2A3C",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",IOcy:"\u0401",iocy:"\u0451",Iogon:"\u012E",iogon:"\u012F",Iopf:"\u{1D540}",iopf:"\u{1D55A}",Iota:"\u0399",iota:"\u03B9",iprod:"\u2A3C",iquest:"\xBF",Iscr:"\u2110",iscr:"\u{1D4BE}",isin:"\u2208",isindot:"\u22F5",isinE:"\u22F9",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",Itilde:"\u0128",itilde:"\u0129",Iukcy:"\u0406",iukcy:"\u0456",Iuml:"\xCF",iuml:"\xEF",Jcirc:"\u0134",jcirc:"\u0135",Jcy:"\u0419",jcy:"\u0439",Jfr:"\u{1D50D}",jfr:"\u{1D527}",jmath:"\u0237",Jopf:"\u{1D541}",jopf:"\u{1D55B}",Jscr:"\u{1D4A5}",jscr:"\u{1D4BF}",Jsercy:"\u0408",jsercy:"\u0458",Jukcy:"\u0404",jukcy:"\u0454",Kappa:"\u039A",kappa:"\u03BA",kappav:"\u03F0",Kcedil:"\u0136",kcedil:"\u0137",Kcy:"\u041A",kcy:"\u043A",Kfr:"\u{1D50E}",kfr:"\u{1D528}",kgreen:"\u0138",KHcy:"\u0425",khcy:"\u0445",KJcy:"\u040C",kjcy:"\u045C",Kopf:"\u{1D542}",kopf:"\u{1D55C}",Kscr:"\u{1D4A6}",kscr:"\u{1D4C0}",lAarr:"\u21DA",Lacute:"\u0139",lacute:"\u013A",laemptyv:"\u29B4",lagran:"\u2112",Lambda:"\u039B",lambda:"\u03BB",Lang:"\u27EA",lang:"\u27E8",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",Laplacetrf:"\u2112",laquo:"\xAB",Larr:"\u219E",lArr:"\u21D0",larr:"\u2190",larrb:"\u21E4",larrbfs:"\u291F",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",lat:"\u2AAB",lAtail:"\u291B",latail:"\u2919",late:"\u2AAD",lates:"\u2AAD\uFE00",lBarr:"\u290E",lbarr:"\u290C",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",Lcaron:"\u013D",lcaron:"\u013E",Lcedil:"\u013B",lcedil:"\u013C",lceil:"\u2308",lcub:"{",Lcy:"\u041B",lcy:"\u043B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",lE:"\u2266",le:"\u2264",LeftAngleBracket:"\u27E8",LeftArrow:"\u2190",Leftarrow:"\u21D0",leftarrow:"\u2190",LeftArrowBar:"\u21E4",LeftArrowRightArrow:"\u21C6",leftarrowtail:"\u21A2",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21C3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230A",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",LeftRightArrow:"\u2194",Leftrightarrow:"\u21D4",leftrightarrow:"\u2194",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",LeftRightVector:"\u294E",LeftTee:"\u22A3",LeftTeeArrow:"\u21A4",LeftTeeVector:"\u295A",leftthreetimes:"\u22CB",LeftTriangle:"\u22B2",LeftTriangleBar:"\u29CF",LeftTriangleEqual:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21BF",LeftUpVectorBar:"\u2958",LeftVector:"\u21BC",LeftVectorBar:"\u2952",lEg:"\u2A8B",leg:"\u22DA",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",les:"\u2A7D",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",LessEqualGreater:"\u22DA",LessFullEqual:"\u2266",LessGreater:"\u2276",lessgtr:"\u2276",LessLess:"\u2AA1",lesssim:"\u2272",LessSlantEqual:"\u2A7D",LessTilde:"\u2272",lfisht:"\u297C",lfloor:"\u230A",Lfr:"\u{1D50F}",lfr:"\u{1D529}",lg:"\u2276",lgE:"\u2A91",lHar:"\u2962",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",LJcy:"\u0409",ljcy:"\u0459",Ll:"\u22D8",ll:"\u226A",llarr:"\u21C7",llcorner:"\u231E",Lleftarrow:"\u21DA",llhard:"\u296B",lltri:"\u25FA",Lmidot:"\u013F",lmidot:"\u0140",lmoust:"\u23B0",lmoustache:"\u23B0",lnap:"\u2A89",lnapprox:"\u2A89",lnE:"\u2268",lne:"\u2A87",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",LongLeftArrow:"\u27F5",Longleftarrow:"\u27F8",longleftarrow:"\u27F5",LongLeftRightArrow:"\u27F7",Longleftrightarrow:"\u27FA",longleftrightarrow:"\u27F7",longmapsto:"\u27FC",LongRightArrow:"\u27F6",Longrightarrow:"\u27F9",longrightarrow:"\u27F6",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",Lopf:"\u{1D543}",lopf:"\u{1D55D}",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",Lscr:"\u2112",lscr:"\u{1D4C1}",Lsh:"\u21B0",lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",Lstrok:"\u0141",lstrok:"\u0142",Lt:"\u226A",LT:"<",lt:"<",ltcc:"\u2AA6",ltcir:"\u2A79",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",ltrPar:"\u2996",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",Map:"\u2905",map:"\u21A6",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",Mcy:"\u041C",mcy:"\u043C",mdash:"\u2014",mDDot:"\u223A",measuredangle:"\u2221",MediumSpace:"\u205F",Mellintrf:"\u2133",Mfr:"\u{1D510}",mfr:"\u{1D52A}",mho:"\u2127",micro:"\xB5",mid:"\u2223",midast:"*",midcir:"\u2AF0",middot:"\xB7",minus:"\u2212",minusb:"\u229F",minusd:"\u2238",minusdu:"\u2A2A",MinusPlus:"\u2213",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",Mopf:"\u{1D544}",mopf:"\u{1D55E}",mp:"\u2213",Mscr:"\u2133",mscr:"\u{1D4C2}",mstpos:"\u223E",Mu:"\u039C",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nabla:"\u2207",Nacute:"\u0143",nacute:"\u0144",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266E",natural:"\u266E",naturals:"\u2115",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",Ncaron:"\u0147",ncaron:"\u0148",Ncedil:"\u0145",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",Ncy:"\u041D",ncy:"\u043D",ndash:"\u2013",ne:"\u2260",nearhk:"\u2924",neArr:"\u21D7",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",NestedGreaterGreater:"\u226B",NestedLessLess:"\u226A",NewLine:`
2473
- `,nexist:"\u2204",nexists:"\u2204",Nfr:"\u{1D511}",nfr:"\u{1D52B}",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",nGg:"\u22D9\u0338",ngsim:"\u2275",nGt:"\u226B\u20D2",ngt:"\u226F",ngtr:"\u226F",nGtv:"\u226B\u0338",nhArr:"\u21CE",nharr:"\u21AE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",NJcy:"\u040A",njcy:"\u045A",nlArr:"\u21CD",nlarr:"\u219A",nldr:"\u2025",nlE:"\u2266\u0338",nle:"\u2270",nLeftarrow:"\u21CD",nleftarrow:"\u219A",nLeftrightarrow:"\u21CE",nleftrightarrow:"\u21AE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nLl:"\u22D8\u0338",nlsim:"\u2274",nLt:"\u226A\u20D2",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nLtv:"\u226A\u0338",nmid:"\u2224",NoBreak:"\u2060",NonBreakingSpace:"\xA0",Nopf:"\u2115",nopf:"\u{1D55F}",Not:"\u2AEC",not:"\xAC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",notin:"\u2209",notindot:"\u22F5\u0338",notinE:"\u22F9\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrArr:"\u21CF",nrarr:"\u219B",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nRightarrow:"\u21CF",nrightarrow:"\u219B",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",Nscr:"\u{1D4A9}",nscr:"\u{1D4C3}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",Ntilde:"\xD1",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",Nu:"\u039D",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvap:"\u224D\u20D2",nVDash:"\u22AF",nVdash:"\u22AE",nvDash:"\u22AD",nvdash:"\u22AC",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvHarr:"\u2904",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwarhk:"\u2923",nwArr:"\u21D6",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",Oacute:"\xD3",oacute:"\xF3",oast:"\u229B",ocir:"\u229A",Ocirc:"\xD4",ocirc:"\xF4",Ocy:"\u041E",ocy:"\u043E",odash:"\u229D",Odblac:"\u0150",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",OElig:"\u0152",oelig:"\u0153",ofcir:"\u29BF",Ofr:"\u{1D512}",ofr:"\u{1D52C}",ogon:"\u02DB",Ograve:"\xD2",ograve:"\xF2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",Omacr:"\u014C",omacr:"\u014D",Omega:"\u03A9",omega:"\u03C9",Omicron:"\u039F",omicron:"\u03BF",omid:"\u29B6",ominus:"\u2296",Oopf:"\u{1D546}",oopf:"\u{1D560}",opar:"\u29B7",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",operp:"\u29B9",oplus:"\u2295",Or:"\u2A54",or:"\u2228",orarr:"\u21BB",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oS:"\u24C8",Oscr:"\u{1D4AA}",oscr:"\u2134",Oslash:"\xD8",oslash:"\xF8",osol:"\u2298",Otilde:"\xD5",otilde:"\xF5",Otimes:"\u2A37",otimes:"\u2297",otimesas:"\u2A36",Ouml:"\xD6",ouml:"\xF6",ovbar:"\u233D",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",par:"\u2225",para:"\xB6",parallel:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",PartialD:"\u2202",Pcy:"\u041F",pcy:"\u043F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",Pfr:"\u{1D513}",pfr:"\u{1D52D}",Phi:"\u03A6",phi:"\u03C6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",Pi:"\u03A0",pi:"\u03C0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plus:"+",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",PlusMinus:"\xB1",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",Poincareplane:"\u210C",pointint:"\u2A15",Popf:"\u2119",popf:"\u{1D561}",pound:"\xA3",Pr:"\u2ABB",pr:"\u227A",prap:"\u2AB7",prcue:"\u227C",prE:"\u2AB3",pre:"\u2AAF",prec:"\u227A",precapprox:"\u2AB7",preccurlyeq:"\u227C",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",precsim:"\u227E",Prime:"\u2033",prime:"\u2032",primes:"\u2119",prnap:"\u2AB9",prnE:"\u2AB5",prnsim:"\u22E8",prod:"\u220F",Product:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",Proportion:"\u2237",Proportional:"\u221D",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",Pscr:"\u{1D4AB}",pscr:"\u{1D4C5}",Psi:"\u03A8",psi:"\u03C8",puncsp:"\u2008",Qfr:"\u{1D514}",qfr:"\u{1D52E}",qint:"\u2A0C",Qopf:"\u211A",qopf:"\u{1D562}",qprime:"\u2057",Qscr:"\u{1D4AC}",qscr:"\u{1D4C6}",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",QUOT:'"',quot:'"',rAarr:"\u21DB",race:"\u223D\u0331",Racute:"\u0154",racute:"\u0155",radic:"\u221A",raemptyv:"\u29B3",Rang:"\u27EB",rang:"\u27E9",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",Rarr:"\u21A0",rArr:"\u21D2",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",Rarrtl:"\u2916",rarrtl:"\u21A3",rarrw:"\u219D",rAtail:"\u291C",ratail:"\u291A",ratio:"\u2236",rationals:"\u211A",RBarr:"\u2910",rBarr:"\u290F",rbarr:"\u290D",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",Rcaron:"\u0158",rcaron:"\u0159",Rcedil:"\u0156",rcedil:"\u0157",rceil:"\u2309",rcub:"}",Rcy:"\u0420",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",Re:"\u211C",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",rect:"\u25AD",REG:"\xAE",reg:"\xAE",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",rfisht:"\u297D",rfloor:"\u230B",Rfr:"\u211C",rfr:"\u{1D52F}",rHar:"\u2964",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",Rho:"\u03A1",rho:"\u03C1",rhov:"\u03F1",RightAngleBracket:"\u27E9",RightArrow:"\u2192",Rightarrow:"\u21D2",rightarrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",rightarrowtail:"\u21A3",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",rightthreetimes:"\u22CC",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",Ropf:"\u211D",ropf:"\u{1D563}",roplus:"\u2A2E",rotimes:"\u2A35",RoundImplies:"\u2970",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",Rrightarrow:"\u21DB",rsaquo:"\u203A",Rscr:"\u211B",rscr:"\u{1D4C7}",Rsh:"\u21B1",rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",RuleDelayed:"\u29F4",ruluhar:"\u2968",rx:"\u211E",Sacute:"\u015A",sacute:"\u015B",sbquo:"\u201A",Sc:"\u2ABC",sc:"\u227B",scap:"\u2AB8",Scaron:"\u0160",scaron:"\u0161",sccue:"\u227D",scE:"\u2AB4",sce:"\u2AB0",Scedil:"\u015E",scedil:"\u015F",Scirc:"\u015C",scirc:"\u015D",scnap:"\u2ABA",scnE:"\u2AB6",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",Scy:"\u0421",scy:"\u0441",sdot:"\u22C5",sdotb:"\u22A1",sdote:"\u2A66",searhk:"\u2925",seArr:"\u21D8",searr:"\u2198",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",Sfr:"\u{1D516}",sfr:"\u{1D530}",sfrown:"\u2322",sharp:"\u266F",SHCHcy:"\u0429",shchcy:"\u0449",SHcy:"\u0428",shcy:"\u0448",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",shortmid:"\u2223",shortparallel:"\u2225",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",shy:"\xAD",Sigma:"\u03A3",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",SmallCircle:"\u2218",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",SOFTcy:"\u042C",softcy:"\u044C",sol:"/",solb:"\u29C4",solbar:"\u233F",Sopf:"\u{1D54A}",sopf:"\u{1D564}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",Sqrt:"\u221A",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25A1",Square:"\u25A1",square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",squarf:"\u25AA",squf:"\u25AA",srarr:"\u2192",Sscr:"\u{1D4AE}",sscr:"\u{1D4C8}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",Star:"\u22C6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",Sub:"\u22D0",sub:"\u2282",subdot:"\u2ABD",subE:"\u2AC5",sube:"\u2286",subedot:"\u2AC3",submult:"\u2AC1",subnE:"\u2ACB",subne:"\u228A",subplus:"\u2ABF",subrarr:"\u2979",Subset:"\u22D0",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2AC5",SubsetEqual:"\u2286",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succ:"\u227B",succapprox:"\u2AB8",succcurlyeq:"\u227D",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",SuchThat:"\u220B",Sum:"\u2211",sum:"\u2211",sung:"\u266A",Sup:"\u22D1",sup:"\u2283",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",supdot:"\u2ABE",supdsub:"\u2AD8",supE:"\u2AC6",supe:"\u2287",supedot:"\u2AC4",Superset:"\u2283",SupersetEqual:"\u2287",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supnE:"\u2ACC",supne:"\u228B",supplus:"\u2AC0",Supset:"\u22D1",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swarhk:"\u2926",swArr:"\u21D9",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",Tab:" ",target:"\u2316",Tau:"\u03A4",tau:"\u03C4",tbrk:"\u23B4",Tcaron:"\u0164",tcaron:"\u0165",Tcedil:"\u0162",tcedil:"\u0163",Tcy:"\u0422",tcy:"\u0442",tdot:"\u20DB",telrec:"\u2315",Tfr:"\u{1D517}",tfr:"\u{1D531}",there4:"\u2234",Therefore:"\u2234",therefore:"\u2234",Theta:"\u0398",theta:"\u03B8",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",ThickSpace:"\u205F\u200A",thinsp:"\u2009",ThinSpace:"\u2009",thkap:"\u2248",thksim:"\u223C",THORN:"\xDE",thorn:"\xFE",Tilde:"\u223C",tilde:"\u02DC",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",times:"\xD7",timesb:"\u22A0",timesbar:"\u2A31",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",top:"\u22A4",topbot:"\u2336",topcir:"\u2AF1",Topf:"\u{1D54B}",topf:"\u{1D565}",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",TRADE:"\u2122",trade:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",TripleDot:"\u20DB",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",Tscr:"\u{1D4AF}",tscr:"\u{1D4C9}",TScy:"\u0426",tscy:"\u0446",TSHcy:"\u040B",tshcy:"\u045B",Tstrok:"\u0166",tstrok:"\u0167",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",Uacute:"\xDA",uacute:"\xFA",Uarr:"\u219F",uArr:"\u21D1",uarr:"\u2191",Uarrocir:"\u2949",Ubrcy:"\u040E",ubrcy:"\u045E",Ubreve:"\u016C",ubreve:"\u016D",Ucirc:"\xDB",ucirc:"\xFB",Ucy:"\u0423",ucy:"\u0443",udarr:"\u21C5",Udblac:"\u0170",udblac:"\u0171",udhar:"\u296E",ufisht:"\u297E",Ufr:"\u{1D518}",ufr:"\u{1D532}",Ugrave:"\xD9",ugrave:"\xF9",uHar:"\u2963",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",Umacr:"\u016A",umacr:"\u016B",uml:"\xA8",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",Uogon:"\u0172",uogon:"\u0173",Uopf:"\u{1D54C}",uopf:"\u{1D566}",UpArrow:"\u2191",Uparrow:"\u21D1",uparrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",UpDownArrow:"\u2195",Updownarrow:"\u21D5",updownarrow:"\u2195",UpEquilibrium:"\u296E",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03D2",upsi:"\u03C5",upsih:"\u03D2",Upsilon:"\u03A5",upsilon:"\u03C5",UpTee:"\u22A5",UpTeeArrow:"\u21A5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",Uring:"\u016E",uring:"\u016F",urtri:"\u25F9",Uscr:"\u{1D4B0}",uscr:"\u{1D4CA}",utdot:"\u22F0",Utilde:"\u0168",utilde:"\u0169",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",Uuml:"\xDC",uuml:"\xFC",uwangle:"\u29A7",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",vArr:"\u21D5",varr:"\u2195",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",Vbar:"\u2AEB",vBar:"\u2AE8",vBarv:"\u2AE9",Vcy:"\u0412",vcy:"\u0432",VDash:"\u22AB",Vdash:"\u22A9",vDash:"\u22A8",vdash:"\u22A2",Vdashl:"\u2AE6",Vee:"\u22C1",vee:"\u2228",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",Verbar:"\u2016",verbar:"|",Vert:"\u2016",vert:"|",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",Vfr:"\u{1D519}",vfr:"\u{1D533}",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",Vopf:"\u{1D54D}",vopf:"\u{1D567}",vprop:"\u221D",vrtri:"\u22B3",Vscr:"\u{1D4B1}",vscr:"\u{1D4CB}",vsubnE:"\u2ACB\uFE00",vsubne:"\u228A\uFE00",vsupnE:"\u2ACC\uFE00",vsupne:"\u228B\uFE00",Vvdash:"\u22AA",vzigzag:"\u299A",Wcirc:"\u0174",wcirc:"\u0175",wedbar:"\u2A5F",Wedge:"\u22C0",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118",Wfr:"\u{1D51A}",wfr:"\u{1D534}",Wopf:"\u{1D54E}",wopf:"\u{1D568}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",Wscr:"\u{1D4B2}",wscr:"\u{1D4CC}",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",Xfr:"\u{1D51B}",xfr:"\u{1D535}",xhArr:"\u27FA",xharr:"\u27F7",Xi:"\u039E",xi:"\u03BE",xlArr:"\u27F8",xlarr:"\u27F5",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",Xopf:"\u{1D54F}",xopf:"\u{1D569}",xoplus:"\u2A01",xotime:"\u2A02",xrArr:"\u27F9",xrarr:"\u27F6",Xscr:"\u{1D4B3}",xscr:"\u{1D4CD}",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",Yacute:"\xDD",yacute:"\xFD",YAcy:"\u042F",yacy:"\u044F",Ycirc:"\u0176",ycirc:"\u0177",Ycy:"\u042B",ycy:"\u044B",yen:"\xA5",Yfr:"\u{1D51C}",yfr:"\u{1D536}",YIcy:"\u0407",yicy:"\u0457",Yopf:"\u{1D550}",yopf:"\u{1D56A}",Yscr:"\u{1D4B4}",yscr:"\u{1D4CE}",YUcy:"\u042E",yucy:"\u044E",Yuml:"\u0178",yuml:"\xFF",Zacute:"\u0179",zacute:"\u017A",Zcaron:"\u017D",zcaron:"\u017E",Zcy:"\u0417",zcy:"\u0437",Zdot:"\u017B",zdot:"\u017C",zeetrf:"\u2128",ZeroWidthSpace:"\u200B",Zeta:"\u0396",zeta:"\u03B6",Zfr:"\u2128",zfr:"\u{1D537}",ZHcy:"\u0416",zhcy:"\u0436",zigrarr:"\u21DD",Zopf:"\u2124",zopf:"\u{1D56B}",Zscr:"\u{1D4B5}",zscr:"\u{1D4CF}",zwj:"\u200D",zwnj:"\u200C"});Nd.entityMap=Nd.HTML_ENTITIES;});var OB=Qr(m1=>{var Wd=kd().NAMESPACE,p1=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,wB=new RegExp("[\\-\\.0-9"+p1.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),BB=new RegExp("^"+p1.source+wB.source+"*(?::"+p1.source+wB.source+"*)?$"),Hd=0,Rn=1,$l=2,Vd=3,ql=4,Kl=5,zd=6,Z_=7;function Zl(r,e){this.message=r,this.locator=e,Error.captureStackTrace&&Error.captureStackTrace(this,Zl);}Zl.prototype=new Error;Zl.prototype.name=Zl.name;function IB(){}IB.prototype={parse:function(r,e,t){var i=this.domBuilder;i.startDocument(),DB(e,e={}),AF(r,e,t,i,this.errorHandler),i.endDocument();}};function AF(r,e,t,i,s){function n(X){if(X>65535){X-=65536;var Q=55296+(X>>10),Ye=56320+(X&1023);return String.fromCharCode(Q,Ye)}else return String.fromCharCode(X)}function o(X){var Q=X.slice(1,-1);return Object.hasOwnProperty.call(t,Q)?t[Q]:Q.charAt(0)==="#"?n(parseInt(Q.substr(1).replace("x","0x"))):(s.error("entity not found:"+X),X)}function a(X){if(X>b){var Q=r.substring(b,X).replace(/&#?\w+;/g,o);d&&u(b),i.characters(Q,0,X-b),b=X;}}function u(X,Q){for(;X>=c&&(Q=h.exec(r));)l=Q.index,c=l+Q[0].length,d.lineNumber++;d.columnNumber=X-l+1;}for(var l=0,c=0,h=/.*(?:\r\n?|\n)|.*$/g,d=i.locator,p=[{currentNSMap:e}],m={},b=0;;){try{var _=r.indexOf("<",b);if(_<0){if(!r.substr(b).match(/^\s*$/)){var g=i.doc,y=g.createTextNode(r.substr(b));g.appendChild(y),i.currentElement=y;}return}switch(_>b&&a(_),r.charAt(_+1)){case "/":var k=r.indexOf(">",_+3),S=r.substring(_+2,k).replace(/[ \t\n\r]+$/g,""),E=p.pop();k<0?(S=r.substring(_+2).replace(/[\s<].*/,""),s.error("end tag name: "+S+" is not complete:"+E.tagName),k=_+1+S.length):S.match(/\s</)&&(S=S.replace(/[\s<].*/,""),s.error("end tag name: "+S+" maybe not complete"),k=_+1+S.length);var F=E.localNSMap,T=E.tagName==S,C=T||E.tagName&&E.tagName.toLowerCase()==S.toLowerCase();if(C){if(i.endElement(E.uri,E.localName,S),F)for(var A in F)Object.prototype.hasOwnProperty.call(F,A)&&i.endPrefixMapping(A);T||s.fatalError("end tag name: "+S+" is not match the current start tagName:"+E.tagName);}else p.push(E);k++;break;case "?":d&&u(_),k=MF(r,_,i);break;case "!":d&&u(_),k=RF(r,_,i,s);break;default:d&&u(_);var P=new kB,M=p[p.length-1].currentNSMap,k=PF(r,_,P,M,o,s),L=P.length;if(!P.closed&&BF(r,k,P.tagName,m)&&(P.closed=!0,t.nbsp||s.warning("unclosed xml attribute")),d&&L){for(var pe=RB(d,{}),ve=0;ve<L;ve++){var Or=P[ve];u(Or.offset),Or.locator=RB(d,{});}i.locator=pe,MB(P,i,M)&&p.push(P),i.locator=d;}else MB(P,i,M)&&p.push(P);Wd.isHTML(P.uri)&&!P.closed?k=wF(r,k,P.tagName,o,i):k++;}}catch(X){if(X instanceof Zl)throw X;s.error("element parse error: "+X),k=-1;}k>b?b=k:a(Math.max(_,b)+1);}}function RB(r,e){return e.lineNumber=r.lineNumber,e.columnNumber=r.columnNumber,e}function PF(r,e,t,i,s,n){function o(p,m,b){t.attributeNames.hasOwnProperty(p)&&n.fatalError("Attribute "+p+" redefined"),t.addValue(p,m.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,s),b);}for(var a,u,l=++e,c=Hd;;){var h=r.charAt(l);switch(h){case "=":if(c===Rn)a=r.slice(e,l),c=Vd;else if(c===$l)c=Vd;else throw new Error("attribute equal must after attrName");break;case "'":case '"':if(c===Vd||c===Rn)if(c===Rn&&(n.warning('attribute value must after "="'),a=r.slice(e,l)),e=l+1,l=r.indexOf(h,e),l>0)u=r.slice(e,l),o(a,u,e-1),c=Kl;else throw new Error("attribute value no end '"+h+"' match");else if(c==ql)u=r.slice(e,l),o(a,u,e),n.warning('attribute "'+a+'" missed start quot('+h+")!!"),e=l+1,c=Kl;else throw new Error('attribute value must after "="');break;case "/":switch(c){case Hd:t.setTagName(r.slice(e,l));case Kl:case zd:case Z_:c=Z_,t.closed=true;case ql:case Rn:break;case $l:t.closed=true;break;default:throw new Error("attribute invalid close char('/')")}break;case "":return n.error("unexpected end of input"),c==Hd&&t.setTagName(r.slice(e,l)),l;case ">":switch(c){case Hd:t.setTagName(r.slice(e,l));case Kl:case zd:case Z_:break;case ql:case Rn:u=r.slice(e,l),u.slice(-1)==="/"&&(t.closed=true,u=u.slice(0,-1));case $l:c===$l&&(u=a),c==ql?(n.warning('attribute "'+u+'" missed quot(")!'),o(a,u,e)):((!Wd.isHTML(i[""])||!u.match(/^(?:disabled|checked|selected)$/i))&&n.warning('attribute "'+u+'" missed value!! "'+u+'" instead!!'),o(u,u,e));break;case Vd:throw new Error("attribute value missed!!")}return l;case "\x80":h=" ";default:if(h<=" ")switch(c){case Hd:t.setTagName(r.slice(e,l)),c=zd;break;case Rn:a=r.slice(e,l),c=$l;break;case ql:var u=r.slice(e,l);n.warning('attribute "'+u+'" missed quot(")!!'),o(a,u,e);case Kl:c=zd;break}else switch(c){case $l:t.tagName;(!Wd.isHTML(i[""])||!a.match(/^(?:disabled|checked|selected)$/i))&&n.warning('attribute "'+a+'" missed value!! "'+a+'" instead2!!'),o(a,a,e),e=l,c=Rn;break;case Kl:n.warning('attribute space is required"'+a+'"!!');case zd:c=Rn,e=l;break;case Vd:c=ql,e=l;break;case Z_:throw new Error("elements closed character '/' and '>' must be connected to")}}l++;}}function MB(r,e,t){for(var i=r.tagName,s=null,h=r.length;h--;){var n=r[h],o=n.qName,a=n.value,d=o.indexOf(":");if(d>0)var u=n.prefix=o.slice(0,d),l=o.slice(d+1),c=u==="xmlns"&&l;else l=o,u=null,c=o==="xmlns"&&"";n.localName=l,c!==false&&(s==null&&(s={},DB(t,t={})),t[c]=s[c]=a,n.uri=Wd.XMLNS,e.startPrefixMapping(c,a));}for(var h=r.length;h--;){n=r[h];var u=n.prefix;u&&(u==="xml"&&(n.uri=Wd.XML),u!=="xmlns"&&(n.uri=t[u||""]));}var d=i.indexOf(":");d>0?(u=r.prefix=i.slice(0,d),l=r.localName=i.slice(d+1)):(u=null,l=r.localName=i);var p=r.uri=t[u||""];if(e.startElement(p,l,i,r),r.closed){if(e.endElement(p,l,i),s)for(u in s)Object.prototype.hasOwnProperty.call(s,u)&&e.endPrefixMapping(u);}else return r.currentNSMap=t,r.localNSMap=s,true}function wF(r,e,t,i,s){if(/^(?:script|textarea)$/i.test(t)){var n=r.indexOf("</"+t+">",e),o=r.substring(e+1,n);if(/[&<]/.test(o))return /^script$/i.test(t)?(s.characters(o,0,o.length),n):(o=o.replace(/&#?\w+;/g,i),s.characters(o,0,o.length),n)}return e+1}function BF(r,e,t,i){var s=i[t];return s==null&&(s=r.lastIndexOf("</"+t+">"),s<e&&(s=r.lastIndexOf("</"+t)),i[t]=s),s<e}function DB(r,e){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t]);}function RF(r,e,t,i){var s=r.charAt(e+2);switch(s){case "-":if(r.charAt(e+3)==="-"){var n=r.indexOf("-->",e+4);return n>e?(t.comment(r,e+4,n-e-4),n+3):(i.error("Unclosed comment"),-1)}else return -1;default:if(r.substr(e+3,6)=="CDATA["){var n=r.indexOf("]]>",e+9);return t.startCDATA(),t.characters(r,e+9,n-e-9),t.endCDATA(),n+3}var o=IF(r,e),a=o.length;if(a>1&&/!doctype/i.test(o[0][0])){var u=o[1][0],l=false,c=false;a>3&&(/^public$/i.test(o[2][0])?(l=o[3][0],c=a>4&&o[4][0]):/^system$/i.test(o[2][0])&&(c=o[3][0]));var h=o[a-1];return t.startDTD(u,l,c),t.endDTD(),h.index+h[0].length}}return -1}function MF(r,e,t){var i=r.indexOf("?>",e);if(i){var s=r.substring(e,i).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);if(s){s[0].length;return t.processingInstruction(s[1],s[2]),i+2}else return -1}return -1}function kB(){this.attributeNames={};}kB.prototype={setTagName:function(r){if(!BB.test(r))throw new Error("invalid tagName:"+r);this.tagName=r;},addValue:function(r,e,t){if(!BB.test(r))throw new Error("invalid attribute:"+r);this.attributeNames[r]=this.length,this[this.length++]={qName:r,value:e,offset:t};},length:0,getLocalName:function(r){return this[r].localName},getLocator:function(r){return this[r].locator},getQName:function(r){return this[r].qName},getURI:function(r){return this[r].uri},getValue:function(r){return this[r].value}};function IF(r,e){var t,i=[],s=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(s.lastIndex=e,s.exec(r);t=s.exec(r);)if(i.push(t),t[1])return i}m1.XMLReader=IB;m1.ParseError=Zl;});var VB=Qr(J_=>{var DF=kd(),kF=f1(),FB=PB(),LB=OB(),OF=kF.DOMImplementation,GB=DF.NAMESPACE,FF=LB.ParseError,GF=LB.XMLReader;function NB(r){return r.replace(/\r[\n\u0085]/g,`
2472
+ `,Hl=null,Md=class{constructor(){Hl||(Hl=URL.createObjectURL(new Blob([sF],{type:"application/javascript"}))),this.worker=new Worker(Hl);}};Md.revokeObjectURL=function(){Hl&&(URL.revokeObjectURL(Hl),Hl=null);};});function k3(r){Object.assign(Vl,r);}var Vl,$E=f(()=>{Vl={jsUrl:"https://files.pixijs.download/transcoders/ktx/libktx.js",wasmUrl:"https://files.pixijs.download/transcoders/ktx/libktx.wasm"};});function nF(r){return Id||(Id=new Md().worker,Id.onmessage=e=>{let{success:t,url:i,textureOptions:s}=e.data;t||console.warn("Failed to load KTX texture",i),O3[i](s);},Id.postMessage({type:"init",jsUrl:Vl.jsUrl,wasmUrl:Vl.wasmUrl,supportedTextures:r})),Id}function N_(r,e){let t=nF(e);return new Promise(i=>{O3[r]=i,t.postMessage({type:"load",url:r});})}var Id,O3,qE=f(()=>{D3();$E();O3={};});var F3,G3=f(()=>{Er();ms();wr();B();Fl();Ul();qE();F3={extension:{type:x.LoadParser,priority:ze.High,name:"loadKTX2"},name:"loadKTX2",test(r){return it(r,".ktx2")},async load(r,e,t){let i=await Gi(),s=await N_(r,i),n=new jr(s);return Kt(n,t,r)},async unload(r){Array.isArray(r)?r.forEach(e=>e.destroy(true)):r.destroy(true);}};});function L3(r){let e=r.format;if(KE[e]){let t=KE[e].convertFunction,i=r.resource;for(let s=0;s<i.length;s++)i[s]=t(i[s]);r.format=KE[e].convertedFormat;}}function U3(r){let e=r.byteLength/3,t=new Uint32Array(e);for(let i=0;i<e;++i)t[i]=r[i*3]+(r[i*3+1]<<8)+(r[i*3+2]<<16)+4278190080;return new Uint8Array(t.buffer)}var KE,N3=f(()=>{KE={rgb8unorm:{convertedFormat:"rgba8unorm",convertFunction:U3},"rgb8unorm-srgb":{convertedFormat:"rgba8unorm-srgb",convertFunction:U3}};});function H3(r){let e=[];for(let t=0;t<r.numLevels;t++){let i=r.getImageData(t,0,0),s=new Uint8Array(i.byteLength);s.set(i),e.push(s);}return e}var V3=f(()=>{});function H_(r){let e=oF[r];if(e)return e;throw new Error(`Unsupported glInternalFormat: ${r}`)}var oF,ZE=f(()=>{oF={6408:"rgba8unorm",32856:"bgra8unorm",32857:"rgb10a2unorm",33189:"depth16unorm",33190:"depth24plus",33321:"r8unorm",33323:"rg8unorm",33325:"r16float",33326:"r32float",33327:"rg16float",33328:"rg32float",33329:"r8sint",33330:"r8uint",33331:"r16sint",33332:"r16uint",33333:"r32sint",33334:"r32uint",33335:"rg8sint",33336:"rg8uint",33337:"rg16sint",33338:"rg16uint",33339:"rg32sint",33340:"rg32uint",33778:"bc2-rgba-unorm",33779:"bc3-rgba-unorm",34836:"rgba32float",34842:"rgba16float",35056:"depth24plus-stencil8",35898:"rg11b10ufloat",35901:"rgb9e5ufloat",35907:"rgba8unorm-srgb",36012:"depth32float",36013:"depth32float-stencil8",36168:"stencil8",36208:"rgba32uint",36214:"rgba16uint",36220:"rgba8uint",36226:"rgba32sint",36232:"rgba16sint",36238:"rgba8sint",36492:"bc7-rgba-unorm",36756:"r8snorm",36757:"rg8snorm",36759:"rgba8snorm",37496:"etc2-rgba8unorm",37808:"astc-4x4-unorm"};});function V_(r){let e=aF[r];if(e)return e;throw new Error(`Unsupported VkFormat: ${r}`)}var aF,QE=f(()=>{aF={23:"rgb8unorm",37:"rgba8unorm",43:"rgba8unorm-srgb"};});function z3(r){return r.classId===2?V_(r.vkFormat):H_(r.glInternalformat)}var W3=f(()=>{ZE();QE();});function X3(r){let e=uF[r];if(e)return e;throw new Error(`Unsupported transcoderFormat: ${r}`)}var uF,Y3=f(()=>{uF={"bc3-rgba-unorm":"BC3_RGBA","bc7-rgba-unorm":"BC7_M5_RGBA","etc2-rgba8unorm":"ETC2_RGBA","astc-4x4-unorm":"ASTC_4x4_RGBA",rgba8unorm:"RGBA32",rg11b10ufloat:"R11F_G11F_B10F"};});var zl,j3,JE=f(()=>{Ls();wr();B();zl=["basis","bc7","bc6h","astc","etc2","bc5","bc4","bc3","bc2","bc1","eac"],j3={extension:x.ResolveParser,test:r=>it(r,[".ktx",".ktx2",".dds"]),parse:r=>{let e,t=r.split(".");if(t.length>2){let i=t[t.length-2];zl.includes(i)&&(e=i);}else e=t[t.length-1];return {resolution:parseFloat(Vt.RETINA_PREFIX.exec(r)?.[1]??"1"),format:e,src:r}}};});function lF(r){let e=["basis"],t={};return r.forEach(i=>{let s=i.split("-")[0];s&&!t[s]&&(t[s]=true,e.push(s));}),e.sort((i,s)=>{let n=zl.indexOf(i),o=zl.indexOf(s);return n===-1?1:o===-1?-1:n-o}),e}var z_,$3,q3=f(()=>{B();I_();rl();il();JE();$3={extension:{type:x.DetectionParser,priority:2},test:async()=>!!(await Oi()||ki()),add:async r=>{let e=await Gl();return z_=lF(e),[...z_,...r]},remove:async r=>z_?r.filter(e=>!(e in z_)):r};});var cF,e1,W_,t1=f(()=>{Lt();Kn();cF=new Ae,e1=class{cull(e,t,i=true){this._cullRecursive(e,t,i);}_cullRecursive(e,t,i=true){if(e.cullable&&e.measurable&&e.includeInBuild){let s=e.cullArea??Ei(e,i,cF);e.culled=s.x>=t.x+t.width||s.y>=t.y+t.height||s.x+s.width<=t.x||s.y+s.height<=t.y;}else e.culled=false;if(!(!e.cullableChildren||e.culled||!e.renderable||!e.measurable||!e.includeInBuild))for(let s=0;s<e.children.length;s++)this._cullRecursive(e.children[s],t,i);}};e1.shared=new e1;W_=e1;});var Dd,K3=f(()=>{B();t1();Dd=class{static init(){this._renderRef=this.render.bind(this),this.render=()=>{W_.shared.cull(this.stage,this.renderer.screen),this.renderer.render({container:this.stage});};}static destroy(){this.render=this._renderRef;}};Dd.extension={priority:10,type:x.Application,name:"culler"};});var kd=Qr(Wl=>{function hF(r,e,t){if(t===void 0&&(t=Array.prototype),r&&typeof t.find=="function")return t.find.call(r,e);for(var i=0;i<r.length;i++)if(Object.prototype.hasOwnProperty.call(r,i)){var s=r[i];if(e.call(void 0,s,i,r))return s}}function r1(r,e){return e===void 0&&(e=Object),e&&typeof e.freeze=="function"?e.freeze(r):r}function dF(r,e){if(r===null||typeof r!="object")throw new TypeError("target is not an object");for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t]);return r}var Z3=r1({HTML:"text/html",isHTML:function(r){return r===Z3.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),Q3=r1({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(r){return r===Q3.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});Wl.assign=dF;Wl.find=hF;Wl.freeze=r1;Wl.MIME_TYPE=Z3;Wl.NAMESPACE=Q3;});var f1=Qr(Bn=>{var oB=kd(),Ui=oB.find,Od=oB.NAMESPACE;function fF(r){return r!==""}function pF(r){return r?r.split(/[\t\n\f\r ]+/).filter(fF):[]}function mF(r,e){return r.hasOwnProperty(e)||(r[e]=true),r}function J3(r){if(!r)return [];var e=pF(r);return Object.keys(e.reduce(mF,{}))}function gF(r){return function(e){return r&&r.indexOf(e)!==-1}}function Gd(r,e){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t]);}function gr(r,e){var t=r.prototype;if(!(t instanceof e)){let s=function(){};s.prototype=e.prototype,s=new s,Gd(t,s),r.prototype=t=s;}t.constructor!=r&&(typeof r!="function"&&console.error("unknown Class:"+r),t.constructor=r);}var xr={},di=xr.ELEMENT_NODE=1,Yl=xr.ATTRIBUTE_NODE=2,X_=xr.TEXT_NODE=3,aB=xr.CDATA_SECTION_NODE=4,uB=xr.ENTITY_REFERENCE_NODE=5,xF=xr.ENTITY_NODE=6,lB=xr.PROCESSING_INSTRUCTION_NODE=7,cB=xr.COMMENT_NODE=8,hB=xr.DOCUMENT_NODE=9,dB=xr.DOCUMENT_TYPE_NODE=10,xs=xr.DOCUMENT_FRAGMENT_NODE=11,_F=xr.NOTATION_NODE=12,Qt={},Ot={};Qt.INDEX_SIZE_ERR=(Ot[1]="Index size error",1);Qt.DOMSTRING_SIZE_ERR=(Ot[2]="DOMString size error",2);var mr=Qt.HIERARCHY_REQUEST_ERR=(Ot[3]="Hierarchy request error",3);Qt.WRONG_DOCUMENT_ERR=(Ot[4]="Wrong document",4);Qt.INVALID_CHARACTER_ERR=(Ot[5]="Invalid character",5);Qt.NO_DATA_ALLOWED_ERR=(Ot[6]="No data allowed",6);Qt.NO_MODIFICATION_ALLOWED_ERR=(Ot[7]="No modification allowed",7);var fB=Qt.NOT_FOUND_ERR=(Ot[8]="Not found",8);Qt.NOT_SUPPORTED_ERR=(Ot[9]="Not supported",9);var eB=Qt.INUSE_ATTRIBUTE_ERR=(Ot[10]="Attribute in use",10);Qt.INVALID_STATE_ERR=(Ot[11]="Invalid state",11);Qt.SYNTAX_ERR=(Ot[12]="Syntax error",12);Qt.INVALID_MODIFICATION_ERR=(Ot[13]="Invalid modification",13);Qt.NAMESPACE_ERR=(Ot[14]="Invalid namespace",14);Qt.INVALID_ACCESS_ERR=(Ot[15]="Invalid access",15);function ft(r,e){if(e instanceof Error)var t=e;else t=this,Error.call(this,Ot[r]),this.message=Ot[r],Error.captureStackTrace&&Error.captureStackTrace(this,ft);return t.code=r,e&&(this.message=this.message+": "+e),t}ft.prototype=Error.prototype;Gd(Qt,ft);function gs(){}gs.prototype={length:0,item:function(r){return r>=0&&r<this.length?this[r]:null},toString:function(r,e){for(var t=[],i=0;i<this.length;i++)Xl(this[i],t,r,e);return t.join("")},filter:function(r){return Array.prototype.filter.call(this,r)},indexOf:function(r){return Array.prototype.indexOf.call(this,r)}};function jl(r,e){this._node=r,this._refresh=e,n1(this);}function n1(r){var e=r._node._inc||r._node.ownerDocument._inc;if(r._inc!==e){var t=r._refresh(r._node);if(CB(r,"length",t.length),!r.$$length||t.length<r.$$length)for(var i=t.length;i in r;i++)Object.prototype.hasOwnProperty.call(r,i)&&delete r[i];Gd(t,r),r._inc=e;}}jl.prototype.item=function(r){return n1(this),this[r]||null};gr(jl,gs);function Y_(){}function pB(r,e){for(var t=r.length;t--;)if(r[t]===e)return t}function tB(r,e,t,i){if(i?e[pB(e,i)]=t:e[e.length++]=t,r){t.ownerElement=r;var s=r.ownerDocument;s&&(i&&xB(s,r,i),bF(s,r,t));}}function rB(r,e,t){var i=pB(e,t);if(i>=0){for(var s=e.length-1;i<s;)e[i]=e[++i];if(e.length=s,r){var n=r.ownerDocument;n&&(xB(n,r,t),t.ownerElement=null);}}else throw new ft(fB,new Error(r.tagName+"@"+t))}Y_.prototype={length:0,item:gs.prototype.item,getNamedItem:function(r){for(var e=this.length;e--;){var t=this[e];if(t.nodeName==r)return t}},setNamedItem:function(r){var e=r.ownerElement;if(e&&e!=this._ownerElement)throw new ft(eB);var t=this.getNamedItem(r.nodeName);return tB(this._ownerElement,this,r,t),t},setNamedItemNS:function(r){var e=r.ownerElement,t;if(e&&e!=this._ownerElement)throw new ft(eB);return t=this.getNamedItemNS(r.namespaceURI,r.localName),tB(this._ownerElement,this,r,t),t},removeNamedItem:function(r){var e=this.getNamedItem(r);return rB(this._ownerElement,this,e),e},removeNamedItemNS:function(r,e){var t=this.getNamedItemNS(r,e);return rB(this._ownerElement,this,t),t},getNamedItemNS:function(r,e){for(var t=this.length;t--;){var i=this[t];if(i.localName==e&&i.namespaceURI==r)return i}return null}};function mB(){}mB.prototype={hasFeature:function(r,e){return true},createDocument:function(r,e,t){var i=new Ud;if(i.implementation=this,i.childNodes=new gs,i.doctype=t||null,t&&i.appendChild(t),e){var s=i.createElementNS(r,e);i.appendChild(s);}return i},createDocumentType:function(r,e,t){var i=new q_;return i.name=r,i.nodeName=r,i.publicId=e||"",i.systemId=t||"",i}};function Le(){}Le.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(r,e){return j_(this,r,e)},replaceChild:function(r,e){j_(this,r,e,bB),e&&this.removeChild(e);},removeChild:function(r){return _B(this,r)},appendChild:function(r){return this.insertBefore(r,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(r){return s1(this.ownerDocument||this,this,r)},normalize:function(){for(var r=this.firstChild;r;){var e=r.nextSibling;e&&e.nodeType==X_&&r.nodeType==X_?(this.removeChild(e),r.appendData(e.data)):(r.normalize(),r=e);}},isSupported:function(r,e){return this.ownerDocument.implementation.hasFeature(r,e)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(r){for(var e=this;e;){var t=e._nsMap;if(t){for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&t[i]===r)return i}e=e.nodeType==Yl?e.ownerDocument:e.parentNode;}return null},lookupNamespaceURI:function(r){for(var e=this;e;){var t=e._nsMap;if(t&&Object.prototype.hasOwnProperty.call(t,r))return t[r];e=e.nodeType==Yl?e.ownerDocument:e.parentNode;}return null},isDefaultNamespace:function(r){var e=this.lookupPrefix(r);return e==null}};function gB(r){return r=="<"&&"&lt;"||r==">"&&"&gt;"||r=="&"&&"&amp;"||r=='"'&&"&quot;"||"&#"+r.charCodeAt()+";"}Gd(xr,Le);Gd(xr,Le.prototype);function Fd(r,e){if(e(r))return true;if(r=r.firstChild)do if(Fd(r,e))return true;while(r=r.nextSibling)}function Ud(){this.ownerDocument=this;}function bF(r,e,t){r&&r._inc++;var i=t.namespaceURI;i===Od.XMLNS&&(e._nsMap[t.prefix?t.localName:""]=t.value);}function xB(r,e,t,i){r&&r._inc++;var s=t.namespaceURI;s===Od.XMLNS&&delete e._nsMap[t.prefix?t.localName:""];}function o1(r,e,t){if(r&&r._inc){r._inc++;var i=e.childNodes;if(t)i[i.length++]=t;else {for(var s=e.firstChild,n=0;s;)i[n++]=s,s=s.nextSibling;i.length=n,delete i[i.length];}}}function _B(r,e){var t=e.previousSibling,i=e.nextSibling;return t?t.nextSibling=i:r.firstChild=i,i?i.previousSibling=t:r.lastChild=t,e.parentNode=null,e.previousSibling=null,e.nextSibling=null,o1(r.ownerDocument,r),e}function yF(r){return r&&(r.nodeType===Le.DOCUMENT_NODE||r.nodeType===Le.DOCUMENT_FRAGMENT_NODE||r.nodeType===Le.ELEMENT_NODE)}function vF(r){return r&&(Li(r)||a1(r)||_s(r)||r.nodeType===Le.DOCUMENT_FRAGMENT_NODE||r.nodeType===Le.COMMENT_NODE||r.nodeType===Le.PROCESSING_INSTRUCTION_NODE)}function _s(r){return r&&r.nodeType===Le.DOCUMENT_TYPE_NODE}function Li(r){return r&&r.nodeType===Le.ELEMENT_NODE}function a1(r){return r&&r.nodeType===Le.TEXT_NODE}function iB(r,e){var t=r.childNodes||[];if(Ui(t,Li)||_s(e))return false;var i=Ui(t,_s);return !(e&&i&&t.indexOf(i)>t.indexOf(e))}function sB(r,e){var t=r.childNodes||[];function i(n){return Li(n)&&n!==e}if(Ui(t,i))return false;var s=Ui(t,_s);return !(e&&s&&t.indexOf(s)>t.indexOf(e))}function TF(r,e,t){if(!yF(r))throw new ft(mr,"Unexpected parent node type "+r.nodeType);if(t&&t.parentNode!==r)throw new ft(fB,"child not in parent");if(!vF(e)||_s(e)&&r.nodeType!==Le.DOCUMENT_NODE)throw new ft(mr,"Unexpected node type "+e.nodeType+" for parent node type "+r.nodeType)}function SF(r,e,t){var i=r.childNodes||[],s=e.childNodes||[];if(e.nodeType===Le.DOCUMENT_FRAGMENT_NODE){var n=s.filter(Li);if(n.length>1||Ui(s,a1))throw new ft(mr,"More than one element or text in fragment");if(n.length===1&&!iB(r,t))throw new ft(mr,"Element in fragment can not be inserted before doctype")}if(Li(e)&&!iB(r,t))throw new ft(mr,"Only one element can be added and only after doctype");if(_s(e)){if(Ui(i,_s))throw new ft(mr,"Only one doctype is allowed");var o=Ui(i,Li);if(t&&i.indexOf(o)<i.indexOf(t))throw new ft(mr,"Doctype can only be inserted before an element");if(!t&&o)throw new ft(mr,"Doctype can not be appended since element is present")}}function bB(r,e,t){var i=r.childNodes||[],s=e.childNodes||[];if(e.nodeType===Le.DOCUMENT_FRAGMENT_NODE){var n=s.filter(Li);if(n.length>1||Ui(s,a1))throw new ft(mr,"More than one element or text in fragment");if(n.length===1&&!sB(r,t))throw new ft(mr,"Element in fragment can not be inserted before doctype")}if(Li(e)&&!sB(r,t))throw new ft(mr,"Only one element can be added and only after doctype");if(_s(e)){let u=function(l){return _s(l)&&l!==t};if(Ui(i,u))throw new ft(mr,"Only one doctype is allowed");var o=Ui(i,Li);if(t&&i.indexOf(o)<i.indexOf(t))throw new ft(mr,"Doctype can only be inserted before an element")}}function j_(r,e,t,i){TF(r,e,t),r.nodeType===Le.DOCUMENT_NODE&&(i||SF)(r,e,t);var s=e.parentNode;if(s&&s.removeChild(e),e.nodeType===xs){var n=e.firstChild;if(n==null)return e;var o=e.lastChild;}else n=o=e;var a=t?t.previousSibling:r.lastChild;n.previousSibling=a,o.nextSibling=t,a?a.nextSibling=n:r.firstChild=n,t==null?r.lastChild=o:t.previousSibling=o;do n.parentNode=r;while(n!==o&&(n=n.nextSibling));return o1(r.ownerDocument||r,r),e.nodeType==xs&&(e.firstChild=e.lastChild=null),e}function EF(r,e){return e.parentNode&&e.parentNode.removeChild(e),e.parentNode=r,e.previousSibling=r.lastChild,e.nextSibling=null,e.previousSibling?e.previousSibling.nextSibling=e:r.firstChild=e,r.lastChild=e,o1(r.ownerDocument,r,e),e}Ud.prototype={nodeName:"#document",nodeType:hB,doctype:null,documentElement:null,_inc:1,insertBefore:function(r,e){if(r.nodeType==xs){for(var t=r.firstChild;t;){var i=t.nextSibling;this.insertBefore(t,e),t=i;}return r}return j_(this,r,e),r.ownerDocument=this,this.documentElement===null&&r.nodeType===di&&(this.documentElement=r),r},removeChild:function(r){return this.documentElement==r&&(this.documentElement=null),_B(this,r)},replaceChild:function(r,e){j_(this,r,e,bB),r.ownerDocument=this,e&&this.removeChild(e),Li(r)&&(this.documentElement=r);},importNode:function(r,e){return EB(this,r,e)},getElementById:function(r){var e=null;return Fd(this.documentElement,function(t){if(t.nodeType==di&&t.getAttribute("id")==r)return e=t,true}),e},getElementsByClassName:function(r){var e=J3(r);return new jl(this,function(t){var i=[];return e.length>0&&Fd(t.documentElement,function(s){if(s!==t&&s.nodeType===di){var n=s.getAttribute("class");if(n){var o=r===n;if(!o){var a=J3(n);o=e.every(gF(a));}o&&i.push(s);}}}),i})},createElement:function(r){var e=new Fa;e.ownerDocument=this,e.nodeName=r,e.tagName=r,e.localName=r,e.childNodes=new gs;var t=e.attributes=new Y_;return t._ownerElement=e,e},createDocumentFragment:function(){var r=new K_;return r.ownerDocument=this,r.childNodes=new gs,r},createTextNode:function(r){var e=new u1;return e.ownerDocument=this,e.appendData(r),e},createComment:function(r){var e=new l1;return e.ownerDocument=this,e.appendData(r),e},createCDATASection:function(r){var e=new c1;return e.ownerDocument=this,e.appendData(r),e},createProcessingInstruction:function(r,e){var t=new d1;return t.ownerDocument=this,t.tagName=t.nodeName=t.target=r,t.nodeValue=t.data=e,t},createAttribute:function(r){var e=new $_;return e.ownerDocument=this,e.name=r,e.nodeName=r,e.localName=r,e.specified=true,e},createEntityReference:function(r){var e=new h1;return e.ownerDocument=this,e.nodeName=r,e},createElementNS:function(r,e){var t=new Fa,i=e.split(":"),s=t.attributes=new Y_;return t.childNodes=new gs,t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.namespaceURI=r,i.length==2?(t.prefix=i[0],t.localName=i[1]):t.localName=e,s._ownerElement=t,t},createAttributeNS:function(r,e){var t=new $_,i=e.split(":");return t.ownerDocument=this,t.nodeName=e,t.name=e,t.namespaceURI=r,t.specified=true,i.length==2?(t.prefix=i[0],t.localName=i[1]):t.localName=e,t}};gr(Ud,Le);function Fa(){this._nsMap={};}Fa.prototype={nodeType:di,hasAttribute:function(r){return this.getAttributeNode(r)!=null},getAttribute:function(r){var e=this.getAttributeNode(r);return e&&e.value||""},getAttributeNode:function(r){return this.attributes.getNamedItem(r)},setAttribute:function(r,e){var t=this.ownerDocument.createAttribute(r);t.value=t.nodeValue=""+e,this.setAttributeNode(t);},removeAttribute:function(r){var e=this.getAttributeNode(r);e&&this.removeAttributeNode(e);},appendChild:function(r){return r.nodeType===xs?this.insertBefore(r,null):EF(this,r)},setAttributeNode:function(r){return this.attributes.setNamedItem(r)},setAttributeNodeNS:function(r){return this.attributes.setNamedItemNS(r)},removeAttributeNode:function(r){return this.attributes.removeNamedItem(r.nodeName)},removeAttributeNS:function(r,e){var t=this.getAttributeNodeNS(r,e);t&&this.removeAttributeNode(t);},hasAttributeNS:function(r,e){return this.getAttributeNodeNS(r,e)!=null},getAttributeNS:function(r,e){var t=this.getAttributeNodeNS(r,e);return t&&t.value||""},setAttributeNS:function(r,e,t){var i=this.ownerDocument.createAttributeNS(r,e);i.value=i.nodeValue=""+t,this.setAttributeNode(i);},getAttributeNodeNS:function(r,e){return this.attributes.getNamedItemNS(r,e)},getElementsByTagName:function(r){return new jl(this,function(e){var t=[];return Fd(e,function(i){i!==e&&i.nodeType==di&&(r==="*"||i.tagName==r)&&t.push(i);}),t})},getElementsByTagNameNS:function(r,e){return new jl(this,function(t){var i=[];return Fd(t,function(s){s!==t&&s.nodeType===di&&(r==="*"||s.namespaceURI===r)&&(e==="*"||s.localName==e)&&i.push(s);}),i})}};Ud.prototype.getElementsByTagName=Fa.prototype.getElementsByTagName;Ud.prototype.getElementsByTagNameNS=Fa.prototype.getElementsByTagNameNS;gr(Fa,Le);function $_(){}$_.prototype.nodeType=Yl;gr($_,Le);function Ld(){}Ld.prototype={data:"",substringData:function(r,e){return this.data.substring(r,r+e)},appendData:function(r){r=this.data+r,this.nodeValue=this.data=r,this.length=r.length;},insertData:function(r,e){this.replaceData(r,0,e);},appendChild:function(r){throw new Error(Ot[mr])},deleteData:function(r,e){this.replaceData(r,e,"");},replaceData:function(r,e,t){var i=this.data.substring(0,r),s=this.data.substring(r+e);t=i+t+s,this.nodeValue=this.data=t,this.length=t.length;}};gr(Ld,Le);function u1(){}u1.prototype={nodeName:"#text",nodeType:X_,splitText:function(r){var e=this.data,t=e.substring(r);e=e.substring(0,r),this.data=this.nodeValue=e,this.length=e.length;var i=this.ownerDocument.createTextNode(t);return this.parentNode&&this.parentNode.insertBefore(i,this.nextSibling),i}};gr(u1,Ld);function l1(){}l1.prototype={nodeName:"#comment",nodeType:cB};gr(l1,Ld);function c1(){}c1.prototype={nodeName:"#cdata-section",nodeType:aB};gr(c1,Ld);function q_(){}q_.prototype.nodeType=dB;gr(q_,Le);function yB(){}yB.prototype.nodeType=_F;gr(yB,Le);function vB(){}vB.prototype.nodeType=xF;gr(vB,Le);function h1(){}h1.prototype.nodeType=uB;gr(h1,Le);function K_(){}K_.prototype.nodeName="#document-fragment";K_.prototype.nodeType=xs;gr(K_,Le);function d1(){}d1.prototype.nodeType=lB;gr(d1,Le);function TB(){}TB.prototype.serializeToString=function(r,e,t){return SB.call(r,e,t)};Le.prototype.toString=SB;function SB(r,e){var t=[],i=this.nodeType==9&&this.documentElement||this,s=i.prefix,n=i.namespaceURI;if(n&&s==null){var s=i.lookupPrefix(n);if(s==null)var o=[{namespace:n,prefix:null}];}return Xl(this,t,r,e,o),t.join("")}function nB(r,e,t){var i=r.prefix||"",s=r.namespaceURI;if(!s||i==="xml"&&s===Od.XML||s===Od.XMLNS)return false;for(var n=t.length;n--;){var o=t[n];if(o.prefix===i)return o.namespace!==s}return true}function i1(r,e,t){r.push(" ",e,'="',t.replace(/[<>&"\t\n\r]/g,gB),'"');}function Xl(r,e,t,i,s){if(s||(s=[]),i)if(r=i(r),r){if(typeof r=="string"){e.push(r);return}}else return;switch(r.nodeType){case di:var n=r.attributes,o=n.length,g=r.firstChild,a=r.tagName;t=Od.isHTML(r.namespaceURI)||t;var u=a;if(!t&&!r.prefix&&r.namespaceURI){for(var l,c=0;c<n.length;c++)if(n.item(c).name==="xmlns"){l=n.item(c).value;break}if(!l)for(var h=s.length-1;h>=0;h--){var d=s[h];if(d.prefix===""&&d.namespace===r.namespaceURI){l=d.namespace;break}}if(l!==r.namespaceURI)for(var h=s.length-1;h>=0;h--){var d=s[h];if(d.namespace===r.namespaceURI){d.prefix&&(u=d.prefix+":"+a);break}}}e.push("<",u);for(var p=0;p<o;p++){var m=n.item(p);m.prefix=="xmlns"?s.push({prefix:m.localName,namespace:m.value}):m.nodeName=="xmlns"&&s.push({prefix:"",namespace:m.value});}for(var p=0;p<o;p++){var m=n.item(p);if(nB(m,t,s)){var b=m.prefix||"",_=m.namespaceURI;i1(e,b?"xmlns:"+b:"xmlns",_),s.push({prefix:b,namespace:_});}Xl(m,e,t,i,s);}if(a===u&&nB(r,t,s)){var b=r.prefix||"",_=r.namespaceURI;i1(e,b?"xmlns:"+b:"xmlns",_),s.push({prefix:b,namespace:_});}if(g||t&&!/^(?:meta|link|img|br|hr|input)$/i.test(a)){if(e.push(">"),t&&/^script$/i.test(a))for(;g;)g.data?e.push(g.data):Xl(g,e,t,i,s.slice()),g=g.nextSibling;else for(;g;)Xl(g,e,t,i,s.slice()),g=g.nextSibling;e.push("</",u,">");}else e.push("/>");return;case hB:case xs:for(var g=r.firstChild;g;)Xl(g,e,t,i,s.slice()),g=g.nextSibling;return;case Yl:return i1(e,r.name,r.value);case X_:return e.push(r.data.replace(/[<&>]/g,gB));case aB:return e.push("<![CDATA[",r.data,"]]>");case cB:return e.push("<!--",r.data,"-->");case dB:var y=r.publicId,S=r.systemId;if(e.push("<!DOCTYPE ",r.name),y)e.push(" PUBLIC ",y),S&&S!="."&&e.push(" ",S),e.push(">");else if(S&&S!=".")e.push(" SYSTEM ",S,">");else {var E=r.internalSubset;E&&e.push(" [",E,"]"),e.push(">");}return;case lB:return e.push("<?",r.target," ",r.data,"?>");case uB:return e.push("&",r.nodeName,";");default:e.push("??",r.nodeName);}}function EB(r,e,t){var i;switch(e.nodeType){case di:i=e.cloneNode(false),i.ownerDocument=r;case xs:break;case Yl:t=true;break}if(i||(i=e.cloneNode(false)),i.ownerDocument=r,i.parentNode=null,t)for(var s=e.firstChild;s;)i.appendChild(EB(r,s,t)),s=s.nextSibling;return i}function s1(r,e,t){var i=new e.constructor;for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){var n=e[s];typeof n!="object"&&n!=i[s]&&(i[s]=n);}switch(e.childNodes&&(i.childNodes=new gs),i.ownerDocument=r,i.nodeType){case di:var o=e.attributes,a=i.attributes=new Y_,u=o.length;a._ownerElement=i;for(var l=0;l<u;l++)i.setAttributeNode(s1(r,o.item(l),true));break;case Yl:t=true;}if(t)for(var c=e.firstChild;c;)i.appendChild(s1(r,c,t)),c=c.nextSibling;return i}function CB(r,e,t){r[e]=t;}try{if(Object.defineProperty){let r=function(e){switch(e.nodeType){case di:case xs:var t=[];for(e=e.firstChild;e;)e.nodeType!==7&&e.nodeType!==8&&t.push(r(e)),e=e.nextSibling;return t.join("");default:return e.nodeValue}};CF=r,Object.defineProperty(jl.prototype,"length",{get:function(){return n1(this),this.$$length}}),Object.defineProperty(Le.prototype,"textContent",{get:function(){return r(this)},set:function(e){switch(this.nodeType){case di:case xs:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e;}}}),CB=function(e,t,i){e["$$"+t]=i;};}}catch{}var CF;Bn.DocumentType=q_;Bn.DOMException=ft;Bn.DOMImplementation=mB;Bn.Element=Fa;Bn.Node=Le;Bn.NodeList=gs;Bn.XMLSerializer=TB;});var PB=Qr(Nd=>{var AB=kd().freeze;Nd.XML_ENTITIES=AB({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'});Nd.HTML_ENTITIES=AB({Aacute:"\xC1",aacute:"\xE1",Abreve:"\u0102",abreve:"\u0103",ac:"\u223E",acd:"\u223F",acE:"\u223E\u0333",Acirc:"\xC2",acirc:"\xE2",acute:"\xB4",Acy:"\u0410",acy:"\u0430",AElig:"\xC6",aelig:"\xE6",af:"\u2061",Afr:"\u{1D504}",afr:"\u{1D51E}",Agrave:"\xC0",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",Alpha:"\u0391",alpha:"\u03B1",Amacr:"\u0100",amacr:"\u0101",amalg:"\u2A3F",AMP:"&",amp:"&",And:"\u2A53",and:"\u2227",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",Aogon:"\u0104",aogon:"\u0105",Aopf:"\u{1D538}",aopf:"\u{1D552}",ap:"\u2248",apacir:"\u2A6F",apE:"\u2A70",ape:"\u224A",apid:"\u224B",apos:"'",ApplyFunction:"\u2061",approx:"\u2248",approxeq:"\u224A",Aring:"\xC5",aring:"\xE5",Ascr:"\u{1D49C}",ascr:"\u{1D4B6}",Assign:"\u2254",ast:"*",asymp:"\u2248",asympeq:"\u224D",Atilde:"\xC3",atilde:"\xE3",Auml:"\xC4",auml:"\xE4",awconint:"\u2233",awint:"\u2A11",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",Backslash:"\u2216",Barv:"\u2AE7",barvee:"\u22BD",Barwed:"\u2306",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",Bcy:"\u0411",bcy:"\u0431",bdquo:"\u201E",becaus:"\u2235",Because:"\u2235",because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",Bernoullis:"\u212C",Beta:"\u0392",beta:"\u03B2",beth:"\u2136",between:"\u226C",Bfr:"\u{1D505}",bfr:"\u{1D51F}",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bNot:"\u2AED",bnot:"\u2310",Bopf:"\u{1D539}",bopf:"\u{1D553}",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxbox:"\u29C9",boxDL:"\u2557",boxDl:"\u2556",boxdL:"\u2555",boxdl:"\u2510",boxDR:"\u2554",boxDr:"\u2553",boxdR:"\u2552",boxdr:"\u250C",boxH:"\u2550",boxh:"\u2500",boxHD:"\u2566",boxHd:"\u2564",boxhD:"\u2565",boxhd:"\u252C",boxHU:"\u2569",boxHu:"\u2567",boxhU:"\u2568",boxhu:"\u2534",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxUL:"\u255D",boxUl:"\u255C",boxuL:"\u255B",boxul:"\u2518",boxUR:"\u255A",boxUr:"\u2559",boxuR:"\u2558",boxur:"\u2514",boxV:"\u2551",boxv:"\u2502",boxVH:"\u256C",boxVh:"\u256B",boxvH:"\u256A",boxvh:"\u253C",boxVL:"\u2563",boxVl:"\u2562",boxvL:"\u2561",boxvl:"\u2524",boxVR:"\u2560",boxVr:"\u255F",boxvR:"\u255E",boxvr:"\u251C",bprime:"\u2035",Breve:"\u02D8",breve:"\u02D8",brvbar:"\xA6",Bscr:"\u212C",bscr:"\u{1D4B7}",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpE:"\u2AAE",bumpe:"\u224F",Bumpeq:"\u224E",bumpeq:"\u224F",Cacute:"\u0106",cacute:"\u0107",Cap:"\u22D2",cap:"\u2229",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",CapitalDifferentialD:"\u2145",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",Cayleys:"\u212D",ccaps:"\u2A4D",Ccaron:"\u010C",ccaron:"\u010D",Ccedil:"\xC7",ccedil:"\xE7",Ccirc:"\u0108",ccirc:"\u0109",Cconint:"\u2230",ccups:"\u2A4C",ccupssm:"\u2A50",Cdot:"\u010A",cdot:"\u010B",cedil:"\xB8",Cedilla:"\xB8",cemptyv:"\u29B2",cent:"\xA2",CenterDot:"\xB7",centerdot:"\xB7",Cfr:"\u212D",cfr:"\u{1D520}",CHcy:"\u0427",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",Chi:"\u03A7",chi:"\u03C7",cir:"\u25CB",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",CircleDot:"\u2299",circledR:"\xAE",circledS:"\u24C8",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",cirE:"\u29C3",cire:"\u2257",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201D",CloseCurlyQuote:"\u2019",clubs:"\u2663",clubsuit:"\u2663",Colon:"\u2237",colon:":",Colone:"\u2A74",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",Congruent:"\u2261",Conint:"\u222F",conint:"\u222E",ContourIntegral:"\u222E",Copf:"\u2102",copf:"\u{1D554}",coprod:"\u2210",Coproduct:"\u2210",COPY:"\xA9",copy:"\xA9",copysr:"\u2117",CounterClockwiseContourIntegral:"\u2233",crarr:"\u21B5",Cross:"\u2A2F",cross:"\u2717",Cscr:"\u{1D49E}",cscr:"\u{1D4B8}",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",Cup:"\u22D3",cup:"\u222A",cupbrcap:"\u2A48",CupCap:"\u224D",cupcap:"\u2A46",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",Dagger:"\u2021",dagger:"\u2020",daleth:"\u2138",Darr:"\u21A1",dArr:"\u21D3",darr:"\u2193",dash:"\u2010",Dashv:"\u2AE4",dashv:"\u22A3",dbkarow:"\u290F",dblac:"\u02DD",Dcaron:"\u010E",dcaron:"\u010F",Dcy:"\u0414",dcy:"\u0434",DD:"\u2145",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21CA",DDotrahd:"\u2911",ddotseq:"\u2A77",deg:"\xB0",Del:"\u2207",Delta:"\u0394",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",Dfr:"\u{1D507}",dfr:"\u{1D521}",dHar:"\u2965",dharl:"\u21C3",dharr:"\u21C2",DiacriticalAcute:"\xB4",DiacriticalDot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",DiacriticalGrave:"`",DiacriticalTilde:"\u02DC",diam:"\u22C4",Diamond:"\u22C4",diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",DifferentialD:"\u2146",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",DJcy:"\u0402",djcy:"\u0452",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",Dopf:"\u{1D53B}",dopf:"\u{1D555}",Dot:"\xA8",dot:"\u02D9",DotDot:"\u20DC",doteq:"\u2250",doteqdot:"\u2251",DotEqual:"\u2250",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",DoubleContourIntegral:"\u222F",DoubleDot:"\xA8",DoubleDownArrow:"\u21D3",DoubleLeftArrow:"\u21D0",DoubleLeftRightArrow:"\u21D4",DoubleLeftTee:"\u2AE4",DoubleLongLeftArrow:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",DoubleLongRightArrow:"\u27F9",DoubleRightArrow:"\u21D2",DoubleRightTee:"\u22A8",DoubleUpArrow:"\u21D1",DoubleUpDownArrow:"\u21D5",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",Downarrow:"\u21D3",downarrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21F5",DownBreve:"\u0311",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVector:"\u21BD",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295F",DownRightVector:"\u21C1",DownRightVectorBar:"\u2957",DownTee:"\u22A4",DownTeeArrow:"\u21A7",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",Dscr:"\u{1D49F}",dscr:"\u{1D4B9}",DScy:"\u0405",dscy:"\u0455",dsol:"\u29F6",Dstrok:"\u0110",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",DZcy:"\u040F",dzcy:"\u045F",dzigrarr:"\u27FF",Eacute:"\xC9",eacute:"\xE9",easter:"\u2A6E",Ecaron:"\u011A",ecaron:"\u011B",ecir:"\u2256",Ecirc:"\xCA",ecirc:"\xEA",ecolon:"\u2255",Ecy:"\u042D",ecy:"\u044D",eDDot:"\u2A77",Edot:"\u0116",eDot:"\u2251",edot:"\u0117",ee:"\u2147",efDot:"\u2252",Efr:"\u{1D508}",efr:"\u{1D522}",eg:"\u2A9A",Egrave:"\xC8",egrave:"\xE8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",Element:"\u2208",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",Emacr:"\u0112",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",EmptySmallSquare:"\u25FB",emptyv:"\u2205",EmptyVerySmallSquare:"\u25AB",emsp:"\u2003",emsp13:"\u2004",emsp14:"\u2005",ENG:"\u014A",eng:"\u014B",ensp:"\u2002",Eogon:"\u0118",eogon:"\u0119",Eopf:"\u{1D53C}",eopf:"\u{1D556}",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",Epsilon:"\u0395",epsilon:"\u03B5",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",Equal:"\u2A75",equals:"=",EqualTilde:"\u2242",equest:"\u225F",Equilibrium:"\u21CC",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erarr:"\u2971",erDot:"\u2253",Escr:"\u2130",escr:"\u212F",esdot:"\u2250",Esim:"\u2A73",esim:"\u2242",Eta:"\u0397",eta:"\u03B7",ETH:"\xD0",eth:"\xF0",Euml:"\xCB",euml:"\xEB",euro:"\u20AC",excl:"!",exist:"\u2203",Exists:"\u2203",expectation:"\u2130",ExponentialE:"\u2147",exponentiale:"\u2147",fallingdotseq:"\u2252",Fcy:"\u0424",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",Ffr:"\u{1D509}",ffr:"\u{1D523}",filig:"\uFB01",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",Fopf:"\u{1D53D}",fopf:"\u{1D557}",ForAll:"\u2200",forall:"\u2200",fork:"\u22D4",forkv:"\u2AD9",Fouriertrf:"\u2131",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",Fscr:"\u2131",fscr:"\u{1D4BB}",gacute:"\u01F5",Gamma:"\u0393",gamma:"\u03B3",Gammad:"\u03DC",gammad:"\u03DD",gap:"\u2A86",Gbreve:"\u011E",gbreve:"\u011F",Gcedil:"\u0122",Gcirc:"\u011C",gcirc:"\u011D",Gcy:"\u0413",gcy:"\u0433",Gdot:"\u0120",gdot:"\u0121",gE:"\u2267",ge:"\u2265",gEl:"\u2A8C",gel:"\u22DB",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",ges:"\u2A7E",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",Gfr:"\u{1D50A}",gfr:"\u{1D524}",Gg:"\u22D9",gg:"\u226B",ggg:"\u22D9",gimel:"\u2137",GJcy:"\u0403",gjcy:"\u0453",gl:"\u2277",gla:"\u2AA5",glE:"\u2A92",glj:"\u2AA4",gnap:"\u2A8A",gnapprox:"\u2A8A",gnE:"\u2269",gne:"\u2A88",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",Gopf:"\u{1D53E}",gopf:"\u{1D558}",grave:"`",GreaterEqual:"\u2265",GreaterEqualLess:"\u22DB",GreaterFullEqual:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2A7E",GreaterTilde:"\u2273",Gscr:"\u{1D4A2}",gscr:"\u210A",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",Gt:"\u226B",GT:">",gt:">",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",Hacek:"\u02C7",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",HARDcy:"\u042A",hardcy:"\u044A",hArr:"\u21D4",harr:"\u2194",harrcir:"\u2948",harrw:"\u21AD",Hat:"^",hbar:"\u210F",Hcirc:"\u0124",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",Hfr:"\u210C",hfr:"\u{1D525}",HilbertSpace:"\u210B",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",Hopf:"\u210D",hopf:"\u{1D559}",horbar:"\u2015",HorizontalLine:"\u2500",Hscr:"\u210B",hscr:"\u{1D4BD}",hslash:"\u210F",Hstrok:"\u0126",hstrok:"\u0127",HumpDownHump:"\u224E",HumpEqual:"\u224F",hybull:"\u2043",hyphen:"\u2010",Iacute:"\xCD",iacute:"\xED",ic:"\u2063",Icirc:"\xCE",icirc:"\xEE",Icy:"\u0418",icy:"\u0438",Idot:"\u0130",IEcy:"\u0415",iecy:"\u0435",iexcl:"\xA1",iff:"\u21D4",Ifr:"\u2111",ifr:"\u{1D526}",Igrave:"\xCC",igrave:"\xEC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",IJlig:"\u0132",ijlig:"\u0133",Im:"\u2111",Imacr:"\u012A",imacr:"\u012B",image:"\u2111",ImaginaryI:"\u2148",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22B7",imped:"\u01B5",Implies:"\u21D2",in:"\u2208",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",Int:"\u222C",int:"\u222B",intcal:"\u22BA",integers:"\u2124",Integral:"\u222B",intercal:"\u22BA",Intersection:"\u22C2",intlarhk:"\u2A17",intprod:"\u2A3C",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",IOcy:"\u0401",iocy:"\u0451",Iogon:"\u012E",iogon:"\u012F",Iopf:"\u{1D540}",iopf:"\u{1D55A}",Iota:"\u0399",iota:"\u03B9",iprod:"\u2A3C",iquest:"\xBF",Iscr:"\u2110",iscr:"\u{1D4BE}",isin:"\u2208",isindot:"\u22F5",isinE:"\u22F9",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",Itilde:"\u0128",itilde:"\u0129",Iukcy:"\u0406",iukcy:"\u0456",Iuml:"\xCF",iuml:"\xEF",Jcirc:"\u0134",jcirc:"\u0135",Jcy:"\u0419",jcy:"\u0439",Jfr:"\u{1D50D}",jfr:"\u{1D527}",jmath:"\u0237",Jopf:"\u{1D541}",jopf:"\u{1D55B}",Jscr:"\u{1D4A5}",jscr:"\u{1D4BF}",Jsercy:"\u0408",jsercy:"\u0458",Jukcy:"\u0404",jukcy:"\u0454",Kappa:"\u039A",kappa:"\u03BA",kappav:"\u03F0",Kcedil:"\u0136",kcedil:"\u0137",Kcy:"\u041A",kcy:"\u043A",Kfr:"\u{1D50E}",kfr:"\u{1D528}",kgreen:"\u0138",KHcy:"\u0425",khcy:"\u0445",KJcy:"\u040C",kjcy:"\u045C",Kopf:"\u{1D542}",kopf:"\u{1D55C}",Kscr:"\u{1D4A6}",kscr:"\u{1D4C0}",lAarr:"\u21DA",Lacute:"\u0139",lacute:"\u013A",laemptyv:"\u29B4",lagran:"\u2112",Lambda:"\u039B",lambda:"\u03BB",Lang:"\u27EA",lang:"\u27E8",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",Laplacetrf:"\u2112",laquo:"\xAB",Larr:"\u219E",lArr:"\u21D0",larr:"\u2190",larrb:"\u21E4",larrbfs:"\u291F",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",lat:"\u2AAB",lAtail:"\u291B",latail:"\u2919",late:"\u2AAD",lates:"\u2AAD\uFE00",lBarr:"\u290E",lbarr:"\u290C",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",Lcaron:"\u013D",lcaron:"\u013E",Lcedil:"\u013B",lcedil:"\u013C",lceil:"\u2308",lcub:"{",Lcy:"\u041B",lcy:"\u043B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",lE:"\u2266",le:"\u2264",LeftAngleBracket:"\u27E8",LeftArrow:"\u2190",Leftarrow:"\u21D0",leftarrow:"\u2190",LeftArrowBar:"\u21E4",LeftArrowRightArrow:"\u21C6",leftarrowtail:"\u21A2",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21C3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230A",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",LeftRightArrow:"\u2194",Leftrightarrow:"\u21D4",leftrightarrow:"\u2194",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",LeftRightVector:"\u294E",LeftTee:"\u22A3",LeftTeeArrow:"\u21A4",LeftTeeVector:"\u295A",leftthreetimes:"\u22CB",LeftTriangle:"\u22B2",LeftTriangleBar:"\u29CF",LeftTriangleEqual:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21BF",LeftUpVectorBar:"\u2958",LeftVector:"\u21BC",LeftVectorBar:"\u2952",lEg:"\u2A8B",leg:"\u22DA",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",les:"\u2A7D",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",LessEqualGreater:"\u22DA",LessFullEqual:"\u2266",LessGreater:"\u2276",lessgtr:"\u2276",LessLess:"\u2AA1",lesssim:"\u2272",LessSlantEqual:"\u2A7D",LessTilde:"\u2272",lfisht:"\u297C",lfloor:"\u230A",Lfr:"\u{1D50F}",lfr:"\u{1D529}",lg:"\u2276",lgE:"\u2A91",lHar:"\u2962",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",LJcy:"\u0409",ljcy:"\u0459",Ll:"\u22D8",ll:"\u226A",llarr:"\u21C7",llcorner:"\u231E",Lleftarrow:"\u21DA",llhard:"\u296B",lltri:"\u25FA",Lmidot:"\u013F",lmidot:"\u0140",lmoust:"\u23B0",lmoustache:"\u23B0",lnap:"\u2A89",lnapprox:"\u2A89",lnE:"\u2268",lne:"\u2A87",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",LongLeftArrow:"\u27F5",Longleftarrow:"\u27F8",longleftarrow:"\u27F5",LongLeftRightArrow:"\u27F7",Longleftrightarrow:"\u27FA",longleftrightarrow:"\u27F7",longmapsto:"\u27FC",LongRightArrow:"\u27F6",Longrightarrow:"\u27F9",longrightarrow:"\u27F6",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",Lopf:"\u{1D543}",lopf:"\u{1D55D}",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",Lscr:"\u2112",lscr:"\u{1D4C1}",Lsh:"\u21B0",lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",Lstrok:"\u0141",lstrok:"\u0142",Lt:"\u226A",LT:"<",lt:"<",ltcc:"\u2AA6",ltcir:"\u2A79",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",ltrPar:"\u2996",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",Map:"\u2905",map:"\u21A6",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",Mcy:"\u041C",mcy:"\u043C",mdash:"\u2014",mDDot:"\u223A",measuredangle:"\u2221",MediumSpace:"\u205F",Mellintrf:"\u2133",Mfr:"\u{1D510}",mfr:"\u{1D52A}",mho:"\u2127",micro:"\xB5",mid:"\u2223",midast:"*",midcir:"\u2AF0",middot:"\xB7",minus:"\u2212",minusb:"\u229F",minusd:"\u2238",minusdu:"\u2A2A",MinusPlus:"\u2213",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",Mopf:"\u{1D544}",mopf:"\u{1D55E}",mp:"\u2213",Mscr:"\u2133",mscr:"\u{1D4C2}",mstpos:"\u223E",Mu:"\u039C",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nabla:"\u2207",Nacute:"\u0143",nacute:"\u0144",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266E",natural:"\u266E",naturals:"\u2115",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",Ncaron:"\u0147",ncaron:"\u0148",Ncedil:"\u0145",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",Ncy:"\u041D",ncy:"\u043D",ndash:"\u2013",ne:"\u2260",nearhk:"\u2924",neArr:"\u21D7",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",NestedGreaterGreater:"\u226B",NestedLessLess:"\u226A",NewLine:`
2473
+ `,nexist:"\u2204",nexists:"\u2204",Nfr:"\u{1D511}",nfr:"\u{1D52B}",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",nGg:"\u22D9\u0338",ngsim:"\u2275",nGt:"\u226B\u20D2",ngt:"\u226F",ngtr:"\u226F",nGtv:"\u226B\u0338",nhArr:"\u21CE",nharr:"\u21AE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",NJcy:"\u040A",njcy:"\u045A",nlArr:"\u21CD",nlarr:"\u219A",nldr:"\u2025",nlE:"\u2266\u0338",nle:"\u2270",nLeftarrow:"\u21CD",nleftarrow:"\u219A",nLeftrightarrow:"\u21CE",nleftrightarrow:"\u21AE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nLl:"\u22D8\u0338",nlsim:"\u2274",nLt:"\u226A\u20D2",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nLtv:"\u226A\u0338",nmid:"\u2224",NoBreak:"\u2060",NonBreakingSpace:"\xA0",Nopf:"\u2115",nopf:"\u{1D55F}",Not:"\u2AEC",not:"\xAC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",notin:"\u2209",notindot:"\u22F5\u0338",notinE:"\u22F9\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrArr:"\u21CF",nrarr:"\u219B",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nRightarrow:"\u21CF",nrightarrow:"\u219B",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",Nscr:"\u{1D4A9}",nscr:"\u{1D4C3}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",Ntilde:"\xD1",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",Nu:"\u039D",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvap:"\u224D\u20D2",nVDash:"\u22AF",nVdash:"\u22AE",nvDash:"\u22AD",nvdash:"\u22AC",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvHarr:"\u2904",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwarhk:"\u2923",nwArr:"\u21D6",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",Oacute:"\xD3",oacute:"\xF3",oast:"\u229B",ocir:"\u229A",Ocirc:"\xD4",ocirc:"\xF4",Ocy:"\u041E",ocy:"\u043E",odash:"\u229D",Odblac:"\u0150",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",OElig:"\u0152",oelig:"\u0153",ofcir:"\u29BF",Ofr:"\u{1D512}",ofr:"\u{1D52C}",ogon:"\u02DB",Ograve:"\xD2",ograve:"\xF2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",Omacr:"\u014C",omacr:"\u014D",Omega:"\u03A9",omega:"\u03C9",Omicron:"\u039F",omicron:"\u03BF",omid:"\u29B6",ominus:"\u2296",Oopf:"\u{1D546}",oopf:"\u{1D560}",opar:"\u29B7",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",operp:"\u29B9",oplus:"\u2295",Or:"\u2A54",or:"\u2228",orarr:"\u21BB",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oS:"\u24C8",Oscr:"\u{1D4AA}",oscr:"\u2134",Oslash:"\xD8",oslash:"\xF8",osol:"\u2298",Otilde:"\xD5",otilde:"\xF5",Otimes:"\u2A37",otimes:"\u2297",otimesas:"\u2A36",Ouml:"\xD6",ouml:"\xF6",ovbar:"\u233D",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",par:"\u2225",para:"\xB6",parallel:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",PartialD:"\u2202",Pcy:"\u041F",pcy:"\u043F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",Pfr:"\u{1D513}",pfr:"\u{1D52D}",Phi:"\u03A6",phi:"\u03C6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",Pi:"\u03A0",pi:"\u03C0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plus:"+",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",PlusMinus:"\xB1",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",Poincareplane:"\u210C",pointint:"\u2A15",Popf:"\u2119",popf:"\u{1D561}",pound:"\xA3",Pr:"\u2ABB",pr:"\u227A",prap:"\u2AB7",prcue:"\u227C",prE:"\u2AB3",pre:"\u2AAF",prec:"\u227A",precapprox:"\u2AB7",preccurlyeq:"\u227C",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",precsim:"\u227E",Prime:"\u2033",prime:"\u2032",primes:"\u2119",prnap:"\u2AB9",prnE:"\u2AB5",prnsim:"\u22E8",prod:"\u220F",Product:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",Proportion:"\u2237",Proportional:"\u221D",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",Pscr:"\u{1D4AB}",pscr:"\u{1D4C5}",Psi:"\u03A8",psi:"\u03C8",puncsp:"\u2008",Qfr:"\u{1D514}",qfr:"\u{1D52E}",qint:"\u2A0C",Qopf:"\u211A",qopf:"\u{1D562}",qprime:"\u2057",Qscr:"\u{1D4AC}",qscr:"\u{1D4C6}",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",QUOT:'"',quot:'"',rAarr:"\u21DB",race:"\u223D\u0331",Racute:"\u0154",racute:"\u0155",radic:"\u221A",raemptyv:"\u29B3",Rang:"\u27EB",rang:"\u27E9",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",Rarr:"\u21A0",rArr:"\u21D2",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",Rarrtl:"\u2916",rarrtl:"\u21A3",rarrw:"\u219D",rAtail:"\u291C",ratail:"\u291A",ratio:"\u2236",rationals:"\u211A",RBarr:"\u2910",rBarr:"\u290F",rbarr:"\u290D",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",Rcaron:"\u0158",rcaron:"\u0159",Rcedil:"\u0156",rcedil:"\u0157",rceil:"\u2309",rcub:"}",Rcy:"\u0420",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",Re:"\u211C",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",rect:"\u25AD",REG:"\xAE",reg:"\xAE",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",rfisht:"\u297D",rfloor:"\u230B",Rfr:"\u211C",rfr:"\u{1D52F}",rHar:"\u2964",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",Rho:"\u03A1",rho:"\u03C1",rhov:"\u03F1",RightAngleBracket:"\u27E9",RightArrow:"\u2192",Rightarrow:"\u21D2",rightarrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",rightarrowtail:"\u21A3",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",rightthreetimes:"\u22CC",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",Ropf:"\u211D",ropf:"\u{1D563}",roplus:"\u2A2E",rotimes:"\u2A35",RoundImplies:"\u2970",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",Rrightarrow:"\u21DB",rsaquo:"\u203A",Rscr:"\u211B",rscr:"\u{1D4C7}",Rsh:"\u21B1",rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",RuleDelayed:"\u29F4",ruluhar:"\u2968",rx:"\u211E",Sacute:"\u015A",sacute:"\u015B",sbquo:"\u201A",Sc:"\u2ABC",sc:"\u227B",scap:"\u2AB8",Scaron:"\u0160",scaron:"\u0161",sccue:"\u227D",scE:"\u2AB4",sce:"\u2AB0",Scedil:"\u015E",scedil:"\u015F",Scirc:"\u015C",scirc:"\u015D",scnap:"\u2ABA",scnE:"\u2AB6",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",Scy:"\u0421",scy:"\u0441",sdot:"\u22C5",sdotb:"\u22A1",sdote:"\u2A66",searhk:"\u2925",seArr:"\u21D8",searr:"\u2198",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",Sfr:"\u{1D516}",sfr:"\u{1D530}",sfrown:"\u2322",sharp:"\u266F",SHCHcy:"\u0429",shchcy:"\u0449",SHcy:"\u0428",shcy:"\u0448",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",shortmid:"\u2223",shortparallel:"\u2225",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",shy:"\xAD",Sigma:"\u03A3",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",SmallCircle:"\u2218",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",SOFTcy:"\u042C",softcy:"\u044C",sol:"/",solb:"\u29C4",solbar:"\u233F",Sopf:"\u{1D54A}",sopf:"\u{1D564}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",Sqrt:"\u221A",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25A1",Square:"\u25A1",square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",squarf:"\u25AA",squf:"\u25AA",srarr:"\u2192",Sscr:"\u{1D4AE}",sscr:"\u{1D4C8}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",Star:"\u22C6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",Sub:"\u22D0",sub:"\u2282",subdot:"\u2ABD",subE:"\u2AC5",sube:"\u2286",subedot:"\u2AC3",submult:"\u2AC1",subnE:"\u2ACB",subne:"\u228A",subplus:"\u2ABF",subrarr:"\u2979",Subset:"\u22D0",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2AC5",SubsetEqual:"\u2286",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succ:"\u227B",succapprox:"\u2AB8",succcurlyeq:"\u227D",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",SuchThat:"\u220B",Sum:"\u2211",sum:"\u2211",sung:"\u266A",Sup:"\u22D1",sup:"\u2283",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",supdot:"\u2ABE",supdsub:"\u2AD8",supE:"\u2AC6",supe:"\u2287",supedot:"\u2AC4",Superset:"\u2283",SupersetEqual:"\u2287",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supnE:"\u2ACC",supne:"\u228B",supplus:"\u2AC0",Supset:"\u22D1",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swarhk:"\u2926",swArr:"\u21D9",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",Tab:" ",target:"\u2316",Tau:"\u03A4",tau:"\u03C4",tbrk:"\u23B4",Tcaron:"\u0164",tcaron:"\u0165",Tcedil:"\u0162",tcedil:"\u0163",Tcy:"\u0422",tcy:"\u0442",tdot:"\u20DB",telrec:"\u2315",Tfr:"\u{1D517}",tfr:"\u{1D531}",there4:"\u2234",Therefore:"\u2234",therefore:"\u2234",Theta:"\u0398",theta:"\u03B8",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",ThickSpace:"\u205F\u200A",thinsp:"\u2009",ThinSpace:"\u2009",thkap:"\u2248",thksim:"\u223C",THORN:"\xDE",thorn:"\xFE",Tilde:"\u223C",tilde:"\u02DC",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",times:"\xD7",timesb:"\u22A0",timesbar:"\u2A31",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",top:"\u22A4",topbot:"\u2336",topcir:"\u2AF1",Topf:"\u{1D54B}",topf:"\u{1D565}",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",TRADE:"\u2122",trade:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",TripleDot:"\u20DB",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",Tscr:"\u{1D4AF}",tscr:"\u{1D4C9}",TScy:"\u0426",tscy:"\u0446",TSHcy:"\u040B",tshcy:"\u045B",Tstrok:"\u0166",tstrok:"\u0167",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",Uacute:"\xDA",uacute:"\xFA",Uarr:"\u219F",uArr:"\u21D1",uarr:"\u2191",Uarrocir:"\u2949",Ubrcy:"\u040E",ubrcy:"\u045E",Ubreve:"\u016C",ubreve:"\u016D",Ucirc:"\xDB",ucirc:"\xFB",Ucy:"\u0423",ucy:"\u0443",udarr:"\u21C5",Udblac:"\u0170",udblac:"\u0171",udhar:"\u296E",ufisht:"\u297E",Ufr:"\u{1D518}",ufr:"\u{1D532}",Ugrave:"\xD9",ugrave:"\xF9",uHar:"\u2963",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",Umacr:"\u016A",umacr:"\u016B",uml:"\xA8",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",Uogon:"\u0172",uogon:"\u0173",Uopf:"\u{1D54C}",uopf:"\u{1D566}",UpArrow:"\u2191",Uparrow:"\u21D1",uparrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",UpDownArrow:"\u2195",Updownarrow:"\u21D5",updownarrow:"\u2195",UpEquilibrium:"\u296E",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03D2",upsi:"\u03C5",upsih:"\u03D2",Upsilon:"\u03A5",upsilon:"\u03C5",UpTee:"\u22A5",UpTeeArrow:"\u21A5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",Uring:"\u016E",uring:"\u016F",urtri:"\u25F9",Uscr:"\u{1D4B0}",uscr:"\u{1D4CA}",utdot:"\u22F0",Utilde:"\u0168",utilde:"\u0169",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",Uuml:"\xDC",uuml:"\xFC",uwangle:"\u29A7",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",vArr:"\u21D5",varr:"\u2195",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",Vbar:"\u2AEB",vBar:"\u2AE8",vBarv:"\u2AE9",Vcy:"\u0412",vcy:"\u0432",VDash:"\u22AB",Vdash:"\u22A9",vDash:"\u22A8",vdash:"\u22A2",Vdashl:"\u2AE6",Vee:"\u22C1",vee:"\u2228",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",Verbar:"\u2016",verbar:"|",Vert:"\u2016",vert:"|",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",Vfr:"\u{1D519}",vfr:"\u{1D533}",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",Vopf:"\u{1D54D}",vopf:"\u{1D567}",vprop:"\u221D",vrtri:"\u22B3",Vscr:"\u{1D4B1}",vscr:"\u{1D4CB}",vsubnE:"\u2ACB\uFE00",vsubne:"\u228A\uFE00",vsupnE:"\u2ACC\uFE00",vsupne:"\u228B\uFE00",Vvdash:"\u22AA",vzigzag:"\u299A",Wcirc:"\u0174",wcirc:"\u0175",wedbar:"\u2A5F",Wedge:"\u22C0",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118",Wfr:"\u{1D51A}",wfr:"\u{1D534}",Wopf:"\u{1D54E}",wopf:"\u{1D568}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",Wscr:"\u{1D4B2}",wscr:"\u{1D4CC}",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",Xfr:"\u{1D51B}",xfr:"\u{1D535}",xhArr:"\u27FA",xharr:"\u27F7",Xi:"\u039E",xi:"\u03BE",xlArr:"\u27F8",xlarr:"\u27F5",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",Xopf:"\u{1D54F}",xopf:"\u{1D569}",xoplus:"\u2A01",xotime:"\u2A02",xrArr:"\u27F9",xrarr:"\u27F6",Xscr:"\u{1D4B3}",xscr:"\u{1D4CD}",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",Yacute:"\xDD",yacute:"\xFD",YAcy:"\u042F",yacy:"\u044F",Ycirc:"\u0176",ycirc:"\u0177",Ycy:"\u042B",ycy:"\u044B",yen:"\xA5",Yfr:"\u{1D51C}",yfr:"\u{1D536}",YIcy:"\u0407",yicy:"\u0457",Yopf:"\u{1D550}",yopf:"\u{1D56A}",Yscr:"\u{1D4B4}",yscr:"\u{1D4CE}",YUcy:"\u042E",yucy:"\u044E",Yuml:"\u0178",yuml:"\xFF",Zacute:"\u0179",zacute:"\u017A",Zcaron:"\u017D",zcaron:"\u017E",Zcy:"\u0417",zcy:"\u0437",Zdot:"\u017B",zdot:"\u017C",zeetrf:"\u2128",ZeroWidthSpace:"\u200B",Zeta:"\u0396",zeta:"\u03B6",Zfr:"\u2128",zfr:"\u{1D537}",ZHcy:"\u0416",zhcy:"\u0436",zigrarr:"\u21DD",Zopf:"\u2124",zopf:"\u{1D56B}",Zscr:"\u{1D4B5}",zscr:"\u{1D4CF}",zwj:"\u200D",zwnj:"\u200C"});Nd.entityMap=Nd.HTML_ENTITIES;});var OB=Qr(m1=>{var Wd=kd().NAMESPACE,p1=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,wB=new RegExp("[\\-\\.0-9"+p1.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),BB=new RegExp("^"+p1.source+wB.source+"*(?::"+p1.source+wB.source+"*)?$"),Hd=0,Rn=1,$l=2,Vd=3,ql=4,Kl=5,zd=6,Z_=7;function Zl(r,e){this.message=r,this.locator=e,Error.captureStackTrace&&Error.captureStackTrace(this,Zl);}Zl.prototype=new Error;Zl.prototype.name=Zl.name;function IB(){}IB.prototype={parse:function(r,e,t){var i=this.domBuilder;i.startDocument(),DB(e,e={}),AF(r,e,t,i,this.errorHandler),i.endDocument();}};function AF(r,e,t,i,s){function n(X){if(X>65535){X-=65536;var Q=55296+(X>>10),Ye=56320+(X&1023);return String.fromCharCode(Q,Ye)}else return String.fromCharCode(X)}function o(X){var Q=X.slice(1,-1);return Object.hasOwnProperty.call(t,Q)?t[Q]:Q.charAt(0)==="#"?n(parseInt(Q.substr(1).replace("x","0x"))):(s.error("entity not found:"+X),X)}function a(X){if(X>b){var Q=r.substring(b,X).replace(/&#?\w+;/g,o);d&&u(b),i.characters(Q,0,X-b),b=X;}}function u(X,Q){for(;X>=c&&(Q=h.exec(r));)l=Q.index,c=l+Q[0].length,d.lineNumber++;d.columnNumber=X-l+1;}for(var l=0,c=0,h=/.*(?:\r\n?|\n)|.*$/g,d=i.locator,p=[{currentNSMap:e}],m={},b=0;;){try{var _=r.indexOf("<",b);if(_<0){if(!r.substr(b).match(/^\s*$/)){var g=i.doc,y=g.createTextNode(r.substr(b));g.appendChild(y),i.currentElement=y;}return}switch(_>b&&a(_),r.charAt(_+1)){case "/":var k=r.indexOf(">",_+3),S=r.substring(_+2,k).replace(/[ \t\n\r]+$/g,""),E=p.pop();k<0?(S=r.substring(_+2).replace(/[\s<].*/,""),s.error("end tag name: "+S+" is not complete:"+E.tagName),k=_+1+S.length):S.match(/\s</)&&(S=S.replace(/[\s<].*/,""),s.error("end tag name: "+S+" maybe not complete"),k=_+1+S.length);var F=E.localNSMap,T=E.tagName==S,C=T||E.tagName&&E.tagName.toLowerCase()==S.toLowerCase();if(C){if(i.endElement(E.uri,E.localName,S),F)for(var A in F)Object.prototype.hasOwnProperty.call(F,A)&&i.endPrefixMapping(A);T||s.fatalError("end tag name: "+S+" is not match the current start tagName:"+E.tagName);}else p.push(E);k++;break;case "?":d&&u(_),k=MF(r,_,i);break;case "!":d&&u(_),k=RF(r,_,i,s);break;default:d&&u(_);var P=new kB,M=p[p.length-1].currentNSMap,k=PF(r,_,P,M,o,s),L=P.length;if(!P.closed&&BF(r,k,P.tagName,m)&&(P.closed=!0,t.nbsp||s.warning("unclosed xml attribute")),d&&L){for(var pe=RB(d,{}),ve=0;ve<L;ve++){var kr=P[ve];u(kr.offset),kr.locator=RB(d,{});}i.locator=pe,MB(P,i,M)&&p.push(P),i.locator=d;}else MB(P,i,M)&&p.push(P);Wd.isHTML(P.uri)&&!P.closed?k=wF(r,k,P.tagName,o,i):k++;}}catch(X){if(X instanceof Zl)throw X;s.error("element parse error: "+X),k=-1;}k>b?b=k:a(Math.max(_,b)+1);}}function RB(r,e){return e.lineNumber=r.lineNumber,e.columnNumber=r.columnNumber,e}function PF(r,e,t,i,s,n){function o(p,m,b){t.attributeNames.hasOwnProperty(p)&&n.fatalError("Attribute "+p+" redefined"),t.addValue(p,m.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,s),b);}for(var a,u,l=++e,c=Hd;;){var h=r.charAt(l);switch(h){case "=":if(c===Rn)a=r.slice(e,l),c=Vd;else if(c===$l)c=Vd;else throw new Error("attribute equal must after attrName");break;case "'":case '"':if(c===Vd||c===Rn)if(c===Rn&&(n.warning('attribute value must after "="'),a=r.slice(e,l)),e=l+1,l=r.indexOf(h,e),l>0)u=r.slice(e,l),o(a,u,e-1),c=Kl;else throw new Error("attribute value no end '"+h+"' match");else if(c==ql)u=r.slice(e,l),o(a,u,e),n.warning('attribute "'+a+'" missed start quot('+h+")!!"),e=l+1,c=Kl;else throw new Error('attribute value must after "="');break;case "/":switch(c){case Hd:t.setTagName(r.slice(e,l));case Kl:case zd:case Z_:c=Z_,t.closed=true;case ql:case Rn:break;case $l:t.closed=true;break;default:throw new Error("attribute invalid close char('/')")}break;case "":return n.error("unexpected end of input"),c==Hd&&t.setTagName(r.slice(e,l)),l;case ">":switch(c){case Hd:t.setTagName(r.slice(e,l));case Kl:case zd:case Z_:break;case ql:case Rn:u=r.slice(e,l),u.slice(-1)==="/"&&(t.closed=true,u=u.slice(0,-1));case $l:c===$l&&(u=a),c==ql?(n.warning('attribute "'+u+'" missed quot(")!'),o(a,u,e)):((!Wd.isHTML(i[""])||!u.match(/^(?:disabled|checked|selected)$/i))&&n.warning('attribute "'+u+'" missed value!! "'+u+'" instead!!'),o(u,u,e));break;case Vd:throw new Error("attribute value missed!!")}return l;case "\x80":h=" ";default:if(h<=" ")switch(c){case Hd:t.setTagName(r.slice(e,l)),c=zd;break;case Rn:a=r.slice(e,l),c=$l;break;case ql:var u=r.slice(e,l);n.warning('attribute "'+u+'" missed quot(")!!'),o(a,u,e);case Kl:c=zd;break}else switch(c){case $l:t.tagName;(!Wd.isHTML(i[""])||!a.match(/^(?:disabled|checked|selected)$/i))&&n.warning('attribute "'+a+'" missed value!! "'+a+'" instead2!!'),o(a,a,e),e=l,c=Rn;break;case Kl:n.warning('attribute space is required"'+a+'"!!');case zd:c=Rn,e=l;break;case Vd:c=ql,e=l;break;case Z_:throw new Error("elements closed character '/' and '>' must be connected to")}}l++;}}function MB(r,e,t){for(var i=r.tagName,s=null,h=r.length;h--;){var n=r[h],o=n.qName,a=n.value,d=o.indexOf(":");if(d>0)var u=n.prefix=o.slice(0,d),l=o.slice(d+1),c=u==="xmlns"&&l;else l=o,u=null,c=o==="xmlns"&&"";n.localName=l,c!==false&&(s==null&&(s={},DB(t,t={})),t[c]=s[c]=a,n.uri=Wd.XMLNS,e.startPrefixMapping(c,a));}for(var h=r.length;h--;){n=r[h];var u=n.prefix;u&&(u==="xml"&&(n.uri=Wd.XML),u!=="xmlns"&&(n.uri=t[u||""]));}var d=i.indexOf(":");d>0?(u=r.prefix=i.slice(0,d),l=r.localName=i.slice(d+1)):(u=null,l=r.localName=i);var p=r.uri=t[u||""];if(e.startElement(p,l,i,r),r.closed){if(e.endElement(p,l,i),s)for(u in s)Object.prototype.hasOwnProperty.call(s,u)&&e.endPrefixMapping(u);}else return r.currentNSMap=t,r.localNSMap=s,true}function wF(r,e,t,i,s){if(/^(?:script|textarea)$/i.test(t)){var n=r.indexOf("</"+t+">",e),o=r.substring(e+1,n);if(/[&<]/.test(o))return /^script$/i.test(t)?(s.characters(o,0,o.length),n):(o=o.replace(/&#?\w+;/g,i),s.characters(o,0,o.length),n)}return e+1}function BF(r,e,t,i){var s=i[t];return s==null&&(s=r.lastIndexOf("</"+t+">"),s<e&&(s=r.lastIndexOf("</"+t)),i[t]=s),s<e}function DB(r,e){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t]);}function RF(r,e,t,i){var s=r.charAt(e+2);switch(s){case "-":if(r.charAt(e+3)==="-"){var n=r.indexOf("-->",e+4);return n>e?(t.comment(r,e+4,n-e-4),n+3):(i.error("Unclosed comment"),-1)}else return -1;default:if(r.substr(e+3,6)=="CDATA["){var n=r.indexOf("]]>",e+9);return t.startCDATA(),t.characters(r,e+9,n-e-9),t.endCDATA(),n+3}var o=IF(r,e),a=o.length;if(a>1&&/!doctype/i.test(o[0][0])){var u=o[1][0],l=false,c=false;a>3&&(/^public$/i.test(o[2][0])?(l=o[3][0],c=a>4&&o[4][0]):/^system$/i.test(o[2][0])&&(c=o[3][0]));var h=o[a-1];return t.startDTD(u,l,c),t.endDTD(),h.index+h[0].length}}return -1}function MF(r,e,t){var i=r.indexOf("?>",e);if(i){var s=r.substring(e,i).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);if(s){s[0].length;return t.processingInstruction(s[1],s[2]),i+2}else return -1}return -1}function kB(){this.attributeNames={};}kB.prototype={setTagName:function(r){if(!BB.test(r))throw new Error("invalid tagName:"+r);this.tagName=r;},addValue:function(r,e,t){if(!BB.test(r))throw new Error("invalid attribute:"+r);this.attributeNames[r]=this.length,this[this.length++]={qName:r,value:e,offset:t};},length:0,getLocalName:function(r){return this[r].localName},getLocator:function(r){return this[r].locator},getQName:function(r){return this[r].qName},getURI:function(r){return this[r].uri},getValue:function(r){return this[r].value}};function IF(r,e){var t,i=[],s=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(s.lastIndex=e,s.exec(r);t=s.exec(r);)if(i.push(t),t[1])return i}m1.XMLReader=IB;m1.ParseError=Zl;});var VB=Qr(J_=>{var DF=kd(),kF=f1(),FB=PB(),LB=OB(),OF=kF.DOMImplementation,GB=DF.NAMESPACE,FF=LB.ParseError,GF=LB.XMLReader;function NB(r){return r.replace(/\r[\n\u0085]/g,`
2474
2474
  `).replace(/[\r\u0085\u2028]/g,`
2475
2475
  `)}function HB(r){this.options=r||{locator:{}};}HB.prototype.parseFromString=function(r,e){var t=this.options,i=new GF,s=t.domBuilder||new Xd,n=t.errorHandler,o=t.locator,a=t.xmlns||{},u=/\/x?html?$/.test(e),l=u?FB.HTML_ENTITIES:FB.XML_ENTITIES;o&&s.setDocumentLocator(o),i.errorHandler=UF(n,s,o),i.domBuilder=t.domBuilder||s,u&&(a[""]=GB.HTML),a.xml=a.xml||GB.XML;var c=t.normalizeLineEndings||NB;return r&&typeof r=="string"?i.parse(c(r),a,l):i.errorHandler.error("invalid doc source"),s.doc};function UF(r,e,t){if(!r){if(e instanceof Xd)return e;r=e;}var i={},s=r instanceof Function;t=t||{};function n(o){var a=r[o];!a&&s&&(a=r.length==2?function(u){r(o,u);}:r),i[o]=a&&function(u){a("[xmldom "+o+"] "+u+g1(t));}||function(){};}return n("warning"),n("error"),n("fatalError"),i}function Xd(){this.cdata=false;}function Ql(r,e){e.lineNumber=r.lineNumber,e.columnNumber=r.columnNumber;}Xd.prototype={startDocument:function(){this.doc=new OF().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId);},startElement:function(r,e,t,i){var s=this.doc,n=s.createElementNS(r,t||e),o=i.length;Q_(this,n),this.currentElement=n,this.locator&&Ql(this.locator,n);for(var a=0;a<o;a++){var r=i.getURI(a),u=i.getValue(a),t=i.getQName(a),l=s.createAttributeNS(r,t);this.locator&&Ql(i.getLocator(a),l),l.value=l.nodeValue=u,n.setAttributeNode(l);}},endElement:function(r,e,t){var i=this.currentElement;i.tagName;this.currentElement=i.parentNode;},startPrefixMapping:function(r,e){},endPrefixMapping:function(r){},processingInstruction:function(r,e){var t=this.doc.createProcessingInstruction(r,e);this.locator&&Ql(this.locator,t),Q_(this,t);},ignorableWhitespace:function(r,e,t){},characters:function(r,e,t){if(r=UB.apply(this,arguments),r){if(this.cdata)var i=this.doc.createCDATASection(r);else var i=this.doc.createTextNode(r);this.currentElement?this.currentElement.appendChild(i):/^\s*$/.test(r)&&this.doc.appendChild(i),this.locator&&Ql(this.locator,i);}},skippedEntity:function(r){},endDocument:function(){this.doc.normalize();},setDocumentLocator:function(r){(this.locator=r)&&(r.lineNumber=0);},comment:function(r,e,t){r=UB.apply(this,arguments);var i=this.doc.createComment(r);this.locator&&Ql(this.locator,i),Q_(this,i);},startCDATA:function(){this.cdata=true;},endCDATA:function(){this.cdata=false;},startDTD:function(r,e,t){var i=this.doc.implementation;if(i&&i.createDocumentType){var s=i.createDocumentType(r,e,t);this.locator&&Ql(this.locator,s),Q_(this,s),this.doc.doctype=s;}},warning:function(r){console.warn("[xmldom warning] "+r,g1(this.locator));},error:function(r){console.error("[xmldom error] "+r,g1(this.locator));},fatalError:function(r){throw new FF(r,this.locator)}};function g1(r){if(r)return `
2476
2476
  @`+(r.systemId||"")+"#[line:"+r.lineNumber+",col:"+r.columnNumber+"]"}function UB(r,e,t){return typeof r=="string"?r.substr(e,t):r.length>=e+t||e?new java.lang.String(r,e,t)+"":r}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(r){Xd.prototype[r]=function(){return null};});function Q_(r,e){r.currentElement?r.currentElement.appendChild(e):r.doc.appendChild(e);}J_.__DOMHandler=Xd;J_.normalizeLineEndings=NB;J_.DOMParser=HB;});var WB=Qr(eb=>{var zB=f1();eb.DOMImplementation=zB.DOMImplementation;eb.XMLSerializer=zB.XMLSerializer;eb.DOMParser=VB().DOMParser;});var XB,YB,jB=f(()=>{XB=tu(WB()),YB={createCanvas:(r,e)=>new OffscreenCanvas(r??0,e??0),getCanvasRenderingContext2D:()=>OffscreenCanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>globalThis.location.href,getFontFaceSet:()=>globalThis.fonts,fetch:(r,e)=>fetch(r,e),parseXML:r=>new XB.DOMParser().parseFromString(r,"text/xml")};});var Mn,Yd=f(()=>{Mn=`in vec2 aPosition;
@@ -3018,7 +3018,7 @@ fn mainFragment(
3018
3018
  var offset = gfu.uInputSize.zw * (filterUniforms.uRotation * (map.xy - 0.5)) * filterUniforms.uScale;
3019
3019
 
3020
3020
  return textureSample(uTexture, uSampler, clamp(uv + offset, gfu.uInputClamp.xy, gfu.uInputClamp.zw));
3021
- }`;});var db,rR=f(()=>{Te();cr();dr();Cr();ht();Ns();Pe();Ii();P1();w1();B1();db=class extends Dt{constructor(...e){let t=e[0];t instanceof exports.PixiJSSprite&&(e[1]&&U(Y,"DisplacementFilter now uses options object instead of params. {sprite, scale}"),t={sprite:t,scale:e[1]});let{sprite:i,scale:s,...n}=t,o=s??20;typeof o=="number"&&(o=new me(o,o));let a=new xe({uFilterMatrix:{value:new G,type:"mat3x3<f32>"},uScale:{value:o,type:"vec2<f32>"},uRotation:{value:new Float32Array([0,0,0,0]),type:"mat2x2<f32>"}}),u=je.from({vertex:hb,fragment:cb,name:"displacement-filter"}),l=$e.from({vertex:{source:Kd,entryPoint:"mainVertex"},fragment:{source:Kd,entryPoint:"mainFragment"}}),c=i.texture.source;super({...n,gpuProgram:l,glProgram:u,resources:{filterUniforms:a,uMapTexture:c,uMapSampler:c.style}}),this._sprite=t.sprite,this._sprite.renderable=false;}apply(e,t,i,s){let n=this.resources.filterUniforms.uniforms;e.calculateSpriteMatrix(n.uFilterMatrix,this._sprite);let o=this._sprite.worldTransform,a=Math.sqrt(o.a*o.a+o.b*o.b),u=Math.sqrt(o.c*o.c+o.d*o.d);a!==0&&u!==0&&(n.uRotation[0]=o.a/a,n.uRotation[1]=o.b/a,n.uRotation[2]=o.c/u,n.uRotation[3]=o.d/u),this.resources.uMapTexture=this._sprite.texture.source,e.applyFilter(this,t,i,s);}get scale(){return this.resources.filterUniforms.uniforms.uScale}};});var fb,R1=f(()=>{fb=`
3021
+ }`;});var db,rR=f(()=>{Te();cr();dr();Cr();ht();Ns();Pe();Ii();P1();w1();B1();db=class extends Dt{constructor(...e){let t=e[0];t instanceof Ge&&(e[1]&&U(Y,"DisplacementFilter now uses options object instead of params. {sprite, scale}"),t={sprite:t,scale:e[1]});let{sprite:i,scale:s,...n}=t,o=s??20;typeof o=="number"&&(o=new me(o,o));let a=new xe({uFilterMatrix:{value:new G,type:"mat3x3<f32>"},uScale:{value:o,type:"vec2<f32>"},uRotation:{value:new Float32Array([0,0,0,0]),type:"mat2x2<f32>"}}),u=je.from({vertex:hb,fragment:cb,name:"displacement-filter"}),l=$e.from({vertex:{source:Kd,entryPoint:"mainVertex"},fragment:{source:Kd,entryPoint:"mainFragment"}}),c=i.texture.source;super({...n,gpuProgram:l,glProgram:u,resources:{filterUniforms:a,uMapTexture:c,uMapSampler:c.style}}),this._sprite=t.sprite,this._sprite.renderable=false;}apply(e,t,i,s){let n=this.resources.filterUniforms.uniforms;e.calculateSpriteMatrix(n.uFilterMatrix,this._sprite);let o=this._sprite.worldTransform,a=Math.sqrt(o.a*o.a+o.b*o.b),u=Math.sqrt(o.c*o.c+o.d*o.d);a!==0&&u!==0&&(n.uRotation[0]=o.a/a,n.uRotation[1]=o.b/a,n.uRotation[2]=o.c/u,n.uRotation[3]=o.d/u),this.resources.uMapTexture=this._sprite.texture.source,e.applyFilter(this,t,i,s);}get scale(){return this.resources.filterUniforms.uniforms.uScale}};});var fb,R1=f(()=>{fb=`
3022
3022
  in vec2 vTextureCoord;
3023
3023
  in vec4 vColor;
3024
3024
 
@@ -3223,11 +3223,11 @@ fn setSaturation(c: vec3<f32>, s: f32) -> vec3<f32> {
3223
3223
  }
3224
3224
 
3225
3225
  return result;
3226
- }`;});function Qd(r,e,t,i,s,n,o,a){let u=o-t,l=a-i,c=s-t,h=n-i,d=r-t,p=e-i,m=u*u+l*l,b=u*c+l*h,_=u*d+l*p,g=c*c+h*h,y=c*d+h*p,S=1/(m*g-b*b),E=(g*_-b*y)*S,F=(m*y-b*_)*S;return E>=0&&F>=0&&E+F<1}var I1=f(()=>{});var pb,lR=f(()=>{Nm();ct();pb=class r{constructor(e=0,t=0,i=0,s=0,n=0,o=0){this.type="triangle",this.x=e,this.y=t,this.x2=i,this.y2=s,this.x3=n,this.y3=o;}contains(e,t){let i=(this.x-this.x3)*(t-this.y3)-(this.y-this.y3)*(e-this.x3),s=(this.x2-this.x)*(t-this.y)-(this.y2-this.y)*(e-this.x);if(i<0!=s<0&&i!==0&&s!==0)return false;let n=(this.x3-this.x2)*(t-this.y2)-(this.y3-this.y2)*(e-this.x2);return n===0||n<0==i+s<=0}strokeContains(e,t,i,s=.5){let n=i/2,o=n*n,{x:a,x2:u,x3:l,y:c,y2:h,y3:d}=this;return nn(e,t,a,c,u,d)<=o||nn(e,t,u,h,l,d)<=o||nn(e,t,l,d,a,c)<=o}clone(){return new r(this.x,this.y,this.x2,this.y2,this.x3,this.y3)}copyFrom(e){return this.x=e.x,this.y=e.y,this.x2=e.x2,this.y2=e.y2,this.x3=e.x3,this.y3=e.y3,this}copyTo(e){return e.copyFrom(this),e}getBounds(e){e||(e=new exports.Rectangle);let t=Math.min(this.x,this.x2,this.x3),i=Math.max(this.x,this.x2,this.x3),s=Math.min(this.y,this.y2,this.y3),n=Math.max(this.y,this.y2,this.y3);return e.x=t,e.y=s,e.width=i-t,e.height=n-s,e}};});var cR,mb,D1=f(()=>{hr();so();Gs();cR=class hR{constructor(e){this._tick=()=>{this.timeout=setTimeout(this._processQueue,0);},this._processQueue=()=>{let{queue:t}=this,i=0;for(;t.length&&i<hR.uploadsPerFrame;){let s=t.shift();this.uploadQueueItem(s),i++;}t.length?Ie.system.addOnce(this._tick,this,exports.UPDATE_PRIORITY.UTILITY):this._resolve();},this.renderer=e,this.queue=[],this.resolves=[];}getQueue(){return [...this.queue]}add(e){let t=Array.isArray(e)?e:[e];for(let i of t)i instanceof exports.PixiJSContainer?this._addContainer(i):this.resolveQueueItem(i,this.queue);return this}_addContainer(e){this.resolveQueueItem(e,this.queue);for(let t of e.children)this._addContainer(t);}upload(e){return e&&this.add(e),new Promise(t=>{this.queue.length?(this.resolves.push(t),this.dedupeQueue(),Ie.system.addOnce(this._tick,this,exports.UPDATE_PRIORITY.UTILITY)):t();})}dedupeQueue(){let e=Object.create(null),t=0;for(let i=0;i<this.queue.length;i++){let s=this.queue[i];e[s.uid]||(e[s.uid]=true,this.queue[t++]=s);}this.queue.length=t;}_resolve(){let{resolves:e}=this,t=e.slice(0);e.length=0;for(let i of t)i();}};cR.uploadsPerFrame=4;mb=cR;});var _r,Ga=f(()=>{I1();Ys();Pr();ye();Pe();si();pn();_r=class extends lt{constructor(...e){let t=e[0];t instanceof jt&&(U(Y,"Mesh: use new Mesh({ geometry, shader }) instead"),t={geometry:t,shader:e[1]},e[3]&&(U(Y,"Mesh: drawMode argument has been removed, use geometry.topology instead"),t.geometry.topology=e[3]));let{geometry:i,shader:s,texture:n,roundPixels:o,state:a,...u}=t;super({label:"Mesh",...u}),this.renderPipeId="mesh",this._shader=null,this.allowChildren=false,this.shader=s??null,this.texture=n??s?.texture??exports.Texture.WHITE,this.state=a??Qe.for2d(),this._geometry=i,this._geometry.on("update",this.onViewUpdate,this),this.roundPixels=o??false;}get material(){return U(Y,"mesh.material property has been removed, use mesh.shader instead"),this._shader}set shader(e){this._shader!==e&&(this._shader=e,this.onViewUpdate());}get shader(){return this._shader}set geometry(e){this._geometry!==e&&(this._geometry?.off("update",this.onViewUpdate,this),e.on("update",this.onViewUpdate,this),this._geometry=e,this.onViewUpdate());}get geometry(){return this._geometry}set texture(e){e||(e=exports.Texture.EMPTY);let t=this._texture;t!==e&&(t&&t.dynamic&&t.off("update",this.onViewUpdate,this),e.dynamic&&e.on("update",this.onViewUpdate,this),this.shader&&(this.shader.texture=e),this._texture=e,this.onViewUpdate());}get texture(){return this._texture}get batched(){return this._shader||(this.state.data&12)!==0?false:this._geometry instanceof fr?this._geometry.batchMode==="auto"?this._geometry.positions.length/2<=100:this._geometry.batchMode==="batch":false}get bounds(){return this._geometry.bounds}updateBounds(){this._bounds=this._geometry.bounds;}containsPoint(e){let{x:t,y:i}=e;if(!this.bounds.containsPoint(t,i))return false;let s=this.geometry.getBuffer("aPosition").data,n=this.geometry.topology==="triangle-strip"?3:1;if(this.geometry.getIndex()){let o=this.geometry.getIndex().data,a=o.length;for(let u=0;u+2<a;u+=n){let l=o[u]*2,c=o[u+1]*2,h=o[u+2]*2;if(Qd(t,i,s[l],s[l+1],s[c],s[c+1],s[h],s[h+1]))return true}}else {let o=s.length/2;for(let a=0;a+2<o;a+=n){let u=a*2,l=(a+1)*2,c=(a+2)*2;if(Qd(t,i,s[u],s[u+1],s[l],s[l+1],s[c],s[c+1]))return true}}return false}destroy(e){if(super.destroy(e),typeof e=="boolean"?e:e?.texture){let i=typeof e=="boolean"?e:e?.textureSource;this._texture.destroy(i);}this._geometry?.off("update",this.onViewUpdate,this),this._texture=null,this._geometry=null,this._shader=null,this._gpuData=null;}};});var tc,k1=f(()=>{ye();so();Gs();Ns();tc=class r extends exports.PixiJSSprite{constructor(...e){let t=e[0];Array.isArray(e[0])&&(t={textures:e[0],autoUpdate:e[1]});let{animationSpeed:i=1,autoPlay:s=false,autoUpdate:n=true,loop:o=true,onComplete:a=null,onFrameChange:u=null,onLoop:l=null,textures:c,updateAnchor:h=false,...d}=t,[p]=c;super({...d,texture:p instanceof exports.Texture?p:p.texture}),this._textures=null,this._durations=null,this._autoUpdate=n,this._isConnectedToTicker=false,this.animationSpeed=i,this.loop=o,this.updateAnchor=h,this.onComplete=a,this.onFrameChange=u,this.onLoop=l,this._currentTime=0,this._playing=false,this._previousFrame=null,this.textures=c,s&&this.play();}stop(){this._playing&&(this._playing=false,this._autoUpdate&&this._isConnectedToTicker&&(Ie.shared.remove(this.update,this),this._isConnectedToTicker=false));}play(){this._playing||(this._playing=true,this._autoUpdate&&!this._isConnectedToTicker&&(Ie.shared.add(this.update,this,exports.UPDATE_PRIORITY.HIGH),this._isConnectedToTicker=true));}gotoAndStop(e){this.stop(),this.currentFrame=e;}gotoAndPlay(e){this.currentFrame=e,this.play();}update(e){if(!this._playing)return;let t=e.deltaTime,i=this.animationSpeed*t,s=this.currentFrame;if(this._durations!==null){let n=this._currentTime%1*this._durations[this.currentFrame];for(n+=i/60*1e3;n<0;)this._currentTime--,n+=this._durations[this.currentFrame];let o=Math.sign(this.animationSpeed*t);for(this._currentTime=Math.floor(this._currentTime);n>=this._durations[this.currentFrame];)n-=this._durations[this.currentFrame]*o,this._currentTime+=o;this._currentTime+=n/this._durations[this.currentFrame];}else this._currentTime+=i;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):s!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFrame<s||this.animationSpeed<0&&this.currentFrame>s)&&this.onLoop(),this._updateTexture());}_updateTexture(){let e=this.currentFrame;this._previousFrame!==e&&(this._previousFrame=e,this.texture=this._textures[e],this.updateAnchor&&this.texture.defaultAnchor&&this.anchor.copyFrom(this.texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame));}destroy(){this.stop(),super.destroy(),this.onComplete=null,this.onFrameChange=null,this.onLoop=null;}static fromFrames(e){let t=[];for(let i=0;i<e.length;++i)t.push(exports.Texture.from(e[i]));return new r(t)}static fromImages(e){let t=[];for(let i=0;i<e.length;++i)t.push(exports.Texture.from(e[i]));return new r(t)}get totalFrames(){return this._textures.length}get textures(){return this._textures}set textures(e){if(e[0]instanceof exports.Texture)this._textures=e,this._durations=null;else {this._textures=[],this._durations=[];for(let t=0;t<e.length;t++)this._textures.push(e[t].texture),this._durations.push(e[t].time);}this._previousFrame=null,this.gotoAndStop(0),this._updateTexture();}get currentFrame(){let e=Math.floor(this._currentTime)%this._textures.length;return e<0&&(e+=this._textures.length),e}set currentFrame(e){if(e<0||e>this.totalFrames-1)throw new Error(`[AnimatedSprite]: Invalid frame index value ${e}, expected to be between 0 and totalFrames ${this.totalFrames}.`);let t=this.currentFrame;this._currentTime=e,t!==this.currentFrame&&this._updateTexture();}get playing(){return this._playing}get autoUpdate(){return this._autoUpdate}set autoUpdate(e){e!==this._autoUpdate&&(this._autoUpdate=e,!this._autoUpdate&&this._isConnectedToTicker?(Ie.shared.remove(this.update,this),this._isConnectedToTicker=false):this._autoUpdate&&!this._isConnectedToTicker&&this._playing&&(Ie.shared.add(this.update,this),this._isConnectedToTicker=true));}};});var rc,O1=f(()=>{Te();ws();rc=class{constructor({matrix:e,observer:t}={}){this.dirty=true,this._matrix=e??new G,this.observer=t,this.position=new Ne(this,0,0),this.scale=new Ne(this,1,1),this.pivot=new Ne(this,0,0),this.skew=new Ne(this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1;}get matrix(){let e=this._matrix;return this.dirty&&(e.a=this._cx*this.scale.x,e.b=this._sx*this.scale.x,e.c=this._cy*this.scale.y,e.d=this._sy*this.scale.y,e.tx=this.position.x-(this.pivot.x*e.a+this.pivot.y*e.c),e.ty=this.position.y-(this.pivot.x*e.b+this.pivot.y*e.d),this.dirty=false),e}_onUpdate(e){this.dirty=true,e===this.skew&&this.updateSkew(),this.observer?._onUpdate(this);}updateSkew(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this.dirty=true;}toString(){return `[pixi.js/math:Transform position=(${this.position.x}, ${this.position.y}) rotation=${this.rotation} scale=(${this.scale.x}, ${this.scale.y}) skew=(${this.skew.x}, ${this.skew.y}) ]`}setFromMatrix(e){e.decompose(this),this.dirty=true;}get rotation(){return this._rotation}set rotation(e){this._rotation!==e&&(this._rotation=e,this._onUpdate(this.skew));}};});var dR,xb,F1=f(()=>{Ai();ws();ye();Pe();Be();O1();si();dR=class gb extends lt{constructor(...e){let t=e[0]||{};t instanceof exports.Texture&&(t={texture:t}),e.length>1&&(U(Y,"use new TilingSprite({ texture, width:100, height:100 }) instead"),t.width=e[1],t.height=e[2]),t={...gb.defaultOptions,...t};let{texture:i,anchor:s,tilePosition:n,tileScale:o,tileRotation:a,width:u,height:l,applyAnchorToTexture:c,roundPixels:h,...d}=t??{};super({label:"TilingSprite",...d}),this.renderPipeId="tilingSprite",this.batched=true,this.allowChildren=false,this._anchor=new Ne({_onUpdate:()=>{this.onViewUpdate();}}),this.applyAnchorToTexture=c,this.texture=i,this._width=u??i.width,this._height=l??i.height,this._tileTransform=new rc({observer:{_onUpdate:()=>this.onViewUpdate()}}),s&&(this.anchor=s),this.tilePosition=n,this.tileScale=o,this.tileRotation=a,this.roundPixels=h??false;}static from(e,t={}){return typeof e=="string"?new gb({texture:Se.get(e),...t}):new gb({texture:e,...t})}get uvRespectAnchor(){return N("uvRespectAnchor is deprecated, please use applyAnchorToTexture instead"),this.applyAnchorToTexture}set uvRespectAnchor(e){N("uvRespectAnchor is deprecated, please use applyAnchorToTexture instead"),this.applyAnchorToTexture=e;}get clampMargin(){return this._texture.textureMatrix.clampMargin}set clampMargin(e){this._texture.textureMatrix.clampMargin=e;}get anchor(){return this._anchor}set anchor(e){typeof e=="number"?this._anchor.set(e):this._anchor.copyFrom(e);}get tilePosition(){return this._tileTransform.position}set tilePosition(e){this._tileTransform.position.copyFrom(e);}get tileScale(){return this._tileTransform.scale}set tileScale(e){typeof e=="number"?this._tileTransform.scale.set(e):this._tileTransform.scale.copyFrom(e);}set tileRotation(e){this._tileTransform.rotation=e;}get tileRotation(){return this._tileTransform.rotation}get tileTransform(){return this._tileTransform}set texture(e){e||(e=exports.Texture.EMPTY);let t=this._texture;t!==e&&(t&&t.dynamic&&t.off("update",this.onViewUpdate,this),e.dynamic&&e.on("update",this.onViewUpdate,this),this._texture=e,this.onViewUpdate());}get texture(){return this._texture}set width(e){this._width=e,this.onViewUpdate();}get width(){return this._width}set height(e){this._height=e,this.onViewUpdate();}get height(){return this._height}setSize(e,t){typeof e=="object"&&(t=e.height??e.width,e=e.width),this._width=e,this._height=t??e,this.onViewUpdate();}getSize(e){return e||(e={}),e.width=this._width,e.height=this._height,e}updateBounds(){let e=this._bounds,t=this._anchor,i=this._width,s=this._height;e.minX=-t._x*i,e.maxX=e.minX+i,e.minY=-t._y*s,e.maxY=e.minY+s;}containsPoint(e){let t=this._width,i=this._height,s=-t*this._anchor._x,n=0;return e.x>=s&&e.x<=s+t&&(n=-i*this._anchor._y,e.y>=n&&e.y<=n+i)}destroy(e=false){if(super.destroy(e),this._anchor=null,this._tileTransform=null,this._bounds=null,typeof e=="boolean"?e:e?.texture){let i=typeof e=="boolean"?e:e?.textureSource;this._texture.destroy(i);}this._texture=null;}};dR.defaultOptions={texture:exports.Texture.EMPTY,anchor:{x:0,y:0},tilePosition:{x:0,y:0},tileScale:{x:1,y:1},tileRotation:0,applyAnchorToTexture:false};xb=dR;});function In(r,e){let t=r[0]??{};return (typeof t=="string"||r[1])&&(U(Y,`use new ${e}({ text: "hi!", style }) instead`),t={text:t,style:r[1]}),t}var Ni,Jd=f(()=>{ws();Pe();si();Ni=class extends lt{constructor(e,t){let{text:i,resolution:s,style:n,anchor:o,width:a,height:u,roundPixels:l,...c}=e;super({...c}),this.batched=true,this._resolution=null,this._autoResolution=true,this._didTextUpdate=true,this._styleClass=t,this.text=i??"",this.style=n,this.resolution=s??null,this.allowChildren=false,this._anchor=new Ne({_onUpdate:()=>{this.onViewUpdate();}}),o&&(this.anchor=o),this.roundPixels=l??false,a!==void 0&&(this.width=a),u!==void 0&&(this.height=u);}get anchor(){return this._anchor}set anchor(e){typeof e=="number"?this._anchor.set(e):this._anchor.copyFrom(e);}set text(e){e=e.toString(),this._text!==e&&(this._text=e,this.onViewUpdate());}get text(){return this._text}set resolution(e){this._autoResolution=e===null,this._resolution=e,this.onViewUpdate();}get resolution(){return this._resolution}get style(){return this._style}set style(e){e||(e={}),this._style?.off("update",this.onViewUpdate,this),e instanceof this._styleClass?this._style=e:this._style=new this._styleClass(e),this._style.on("update",this.onViewUpdate,this),this.onViewUpdate();}get width(){return Math.abs(this.scale.x)*this.bounds.width}set width(e){this._setWidth(e,this.bounds.width);}get height(){return Math.abs(this.scale.y)*this.bounds.height}set height(e){this._setHeight(e,this.bounds.height);}getSize(e){return e||(e={}),e.width=Math.abs(this.scale.x)*this.bounds.width,e.height=Math.abs(this.scale.y)*this.bounds.height,e}setSize(e,t){typeof e=="object"?(t=e.height??e.width,e=e.width):t??(t=e),e!==void 0&&this._setWidth(e,this.bounds.width),t!==void 0&&this._setHeight(t,this.bounds.height);}containsPoint(e){let t=this.bounds.width,i=this.bounds.height,s=-t*this.anchor.x,n=0;return e.x>=s&&e.x<=s+t&&(n=-i*this.anchor.y,e.y>=n&&e.y<=n+i)}onViewUpdate(){this.didViewUpdate||(this._didTextUpdate=true),super.onViewUpdate();}destroy(e=false){super.destroy(e),this.owner=null,this._bounds=null,this._anchor=null,(typeof e=="boolean"?e:e?.style)&&this._style.destroy(e),this._style=null,this._text=null;}};});exports.PixiJSText=void 0;var _b=f(()=>{ts();Jd();og();Ro();un();exports.PixiJSText=class extends Ni{constructor(...e){let t=In(e,"Text");super(t,Mt),this.renderPipeId="text",t.textureStyle&&(this.textureStyle=t.textureStyle instanceof xt?t.textureStyle:new xt(t.textureStyle));}updateBounds(){let e=this._bounds,t=this._anchor,i=0,s=0;if(this._style.trim){let{frame:n,canvasAndContext:o}=ds.getCanvasAndContext({text:this.text,style:this._style,resolution:1});ds.returnCanvasAndContext(o),i=n.width,s=n.height;}else {let n=It.measureText(this._text,this._style);i=n.width,s=n.height;}e.minX=-t._x*i,e.maxX=e.minX+i,e.minY=-t._y*s,e.maxY=e.minY+s;}};});var ic,G1=f(()=>{Ct();ye();hr();ag();Po();Ga();Ns();k1();F1();_b();D1();ic=class extends mb{resolveQueueItem(e,t){return e instanceof exports.PixiJSContainer?this.resolveContainerQueueItem(e,t):e instanceof ge||e instanceof exports.Texture?t.push(e.source):e instanceof dt&&t.push(e),null}resolveContainerQueueItem(e,t){e instanceof exports.PixiJSSprite||e instanceof xb||e instanceof _r?t.push(e.texture.source):e instanceof exports.PixiJSText?t.push(e):e instanceof cn?t.push(e.context):e instanceof tc&&e.textures.forEach(i=>{i.source?t.push(i.source):t.push(i.texture.source);});}resolveGraphicsContextQueueItem(e){this.renderer.graphicsContext.getGpuContext(e);let{instructions:t}=e;for(let i of t)if(i.action==="texture"){let{image:s}=i.data;return s.source}else if(i.action==="fill"){let{texture:s}=i.data.style;return s.source}return null}};});var sc,U1=f(()=>{Be();Jd();un();Ah();sc=class extends Ni{constructor(...e){var t;let i=In(e,"BitmapText");i.style??(i.style=i.style||{}),(t=i.style).fill??(t.fill=16777215),super(i,Mt),this.renderPipeId="bitmapText";}updateBounds(){let e=this._bounds,t=this._anchor,i=fs.measureText(this.text,this._style),s=i.scale,n=i.offsetY*s,o=i.width*s,a=i.height*s,u=this._style._stroke;u&&(o+=u.width,a+=u.width),e.minX=-t._x*o,e.maxX=e.minX+o,e.minY=-t._y*(a+n),e.maxY=e.minY+a;}set resolution(e){e!==null&&N("[BitmapText] dynamically updating the resolution is not supported. Resolution should be managed by the BitmapFont.");}get resolution(){return this._resolution}};});var nc,L1=f(()=>{ts();Jd();bg();Ag();nc=class extends Ni{constructor(...e){let t=In(e,"HtmlText");super(t,fn),this.renderPipeId="htmlText",t.textureStyle&&(this.textureStyle=t.textureStyle instanceof xt?t.textureStyle:new xt(t.textureStyle));}updateBounds(){let e=this._bounds,t=this._anchor,i=Zu(this.text,this._style),{width:s,height:n}=i;e.minX=-t._x*s,e.maxX=e.minX+s,e.minY=-t._y*n,e.maxY=e.minY+n;}};});var oc,N1=f(()=>{Ct();Po();_b();U1();L1();G1();oc=class extends ic{uploadQueueItem(e){e instanceof ge?this.uploadTextureSource(e):e instanceof exports.PixiJSText?this.uploadText(e):e instanceof nc?this.uploadHTMLText(e):e instanceof sc?this.uploadBitmapText(e):e instanceof dt&&this.uploadGraphicsContext(e);}uploadTextureSource(e){this.renderer.texture.initSource(e);}uploadText(e){this.renderer.renderPipes.text.initGpuText(e);}uploadBitmapText(e){this.renderer.renderPipes.bitmapText.initGpuText(e);}uploadHTMLText(e){this.renderer.renderPipes.htmlText.initGpuText(e);}uploadGraphicsContext(e){this.renderer.graphicsContext.getGpuContext(e);let{instructions:t}=e;for(let i of t)if(i.action==="texture"){let{image:s}=i.data;this.uploadTextureSource(s.source);}else if(i.action==="fill"){let{texture:s}=i.data.style;this.uploadTextureSource(s.source);}return null}};});var ef,fR=f(()=>{B();N1();ef=class extends oc{destroy(){clearTimeout(this.timeout),this.renderer=null,this.queue=null,this.resolves=null;}};ef.extension={type:[x.WebGLSystem,x.WebGPUSystem],name:"prepare"};});function pR(r){let e=[],t=0;for(let i=0;i<r;i++)e[t]={texture:{sampleType:"float",viewDimension:"2d",multisampled:false},binding:t,visibility:GPUShaderStage.FRAGMENT},t++,e[t]={sampler:{type:"filtering"},binding:t,visibility:GPUShaderStage.FRAGMENT},t++;return e}var mR=f(()=>{});function gR(r){let e={},t=0;for(let i=0;i<r;i++)e[`textureSource${i+1}`]=t++,e[`textureSampler${i+1}`]=t++;return e}var xR=f(()=>{});function _R(r){let e=r.split(/([\n{}])/g).map(s=>s.trim()).filter(s=>s.length),t="";return e.map(s=>{let n=t+s;return s==="{"?t+=" ":s==="}"&&(t=t.substr(0,t.length-4),n=t+s),n}).join(`
3226
+ }`;});function Qd(r,e,t,i,s,n,o,a){let u=o-t,l=a-i,c=s-t,h=n-i,d=r-t,p=e-i,m=u*u+l*l,b=u*c+l*h,_=u*d+l*p,g=c*c+h*h,y=c*d+h*p,S=1/(m*g-b*b),E=(g*_-b*y)*S,F=(m*y-b*_)*S;return E>=0&&F>=0&&E+F<1}var I1=f(()=>{});var pb,lR=f(()=>{Nm();ct();pb=class r{constructor(e=0,t=0,i=0,s=0,n=0,o=0){this.type="triangle",this.x=e,this.y=t,this.x2=i,this.y2=s,this.x3=n,this.y3=o;}contains(e,t){let i=(this.x-this.x3)*(t-this.y3)-(this.y-this.y3)*(e-this.x3),s=(this.x2-this.x)*(t-this.y)-(this.y2-this.y)*(e-this.x);if(i<0!=s<0&&i!==0&&s!==0)return false;let n=(this.x3-this.x2)*(t-this.y2)-(this.y3-this.y2)*(e-this.x2);return n===0||n<0==i+s<=0}strokeContains(e,t,i,s=.5){let n=i/2,o=n*n,{x:a,x2:u,x3:l,y:c,y2:h,y3:d}=this;return nn(e,t,a,c,u,d)<=o||nn(e,t,u,h,l,d)<=o||nn(e,t,l,d,a,c)<=o}clone(){return new r(this.x,this.y,this.x2,this.y2,this.x3,this.y3)}copyFrom(e){return this.x=e.x,this.y=e.y,this.x2=e.x2,this.y2=e.y2,this.x3=e.x3,this.y3=e.y3,this}copyTo(e){return e.copyFrom(this),e}getBounds(e){e||(e=new exports.Rectangle);let t=Math.min(this.x,this.x2,this.x3),i=Math.max(this.x,this.x2,this.x3),s=Math.min(this.y,this.y2,this.y3),n=Math.max(this.y,this.y2,this.y3);return e.x=t,e.y=s,e.width=i-t,e.height=n-s,e}};});var cR,mb,D1=f(()=>{hr();so();Gs();cR=class hR{constructor(e){this._tick=()=>{this.timeout=setTimeout(this._processQueue,0);},this._processQueue=()=>{let{queue:t}=this,i=0;for(;t.length&&i<hR.uploadsPerFrame;){let s=t.shift();this.uploadQueueItem(s),i++;}t.length?Ie.system.addOnce(this._tick,this,exports.UPDATE_PRIORITY.UTILITY):this._resolve();},this.renderer=e,this.queue=[],this.resolves=[];}getQueue(){return [...this.queue]}add(e){let t=Array.isArray(e)?e:[e];for(let i of t)i instanceof ue?this._addContainer(i):this.resolveQueueItem(i,this.queue);return this}_addContainer(e){this.resolveQueueItem(e,this.queue);for(let t of e.children)this._addContainer(t);}upload(e){return e&&this.add(e),new Promise(t=>{this.queue.length?(this.resolves.push(t),this.dedupeQueue(),Ie.system.addOnce(this._tick,this,exports.UPDATE_PRIORITY.UTILITY)):t();})}dedupeQueue(){let e=Object.create(null),t=0;for(let i=0;i<this.queue.length;i++){let s=this.queue[i];e[s.uid]||(e[s.uid]=true,this.queue[t++]=s);}this.queue.length=t;}_resolve(){let{resolves:e}=this,t=e.slice(0);e.length=0;for(let i of t)i();}};cR.uploadsPerFrame=4;mb=cR;});var _r,Ga=f(()=>{I1();Ys();Pr();ye();Pe();si();pn();_r=class extends lt{constructor(...e){let t=e[0];t instanceof jt&&(U(Y,"Mesh: use new Mesh({ geometry, shader }) instead"),t={geometry:t,shader:e[1]},e[3]&&(U(Y,"Mesh: drawMode argument has been removed, use geometry.topology instead"),t.geometry.topology=e[3]));let{geometry:i,shader:s,texture:n,roundPixels:o,state:a,...u}=t;super({label:"Mesh",...u}),this.renderPipeId="mesh",this._shader=null,this.allowChildren=false,this.shader=s??null,this.texture=n??s?.texture??exports.Texture.WHITE,this.state=a??Qe.for2d(),this._geometry=i,this._geometry.on("update",this.onViewUpdate,this),this.roundPixels=o??false;}get material(){return U(Y,"mesh.material property has been removed, use mesh.shader instead"),this._shader}set shader(e){this._shader!==e&&(this._shader=e,this.onViewUpdate());}get shader(){return this._shader}set geometry(e){this._geometry!==e&&(this._geometry?.off("update",this.onViewUpdate,this),e.on("update",this.onViewUpdate,this),this._geometry=e,this.onViewUpdate());}get geometry(){return this._geometry}set texture(e){e||(e=exports.Texture.EMPTY);let t=this._texture;t!==e&&(t&&t.dynamic&&t.off("update",this.onViewUpdate,this),e.dynamic&&e.on("update",this.onViewUpdate,this),this.shader&&(this.shader.texture=e),this._texture=e,this.onViewUpdate());}get texture(){return this._texture}get batched(){return this._shader||(this.state.data&12)!==0?false:this._geometry instanceof fr?this._geometry.batchMode==="auto"?this._geometry.positions.length/2<=100:this._geometry.batchMode==="batch":false}get bounds(){return this._geometry.bounds}updateBounds(){this._bounds=this._geometry.bounds;}containsPoint(e){let{x:t,y:i}=e;if(!this.bounds.containsPoint(t,i))return false;let s=this.geometry.getBuffer("aPosition").data,n=this.geometry.topology==="triangle-strip"?3:1;if(this.geometry.getIndex()){let o=this.geometry.getIndex().data,a=o.length;for(let u=0;u+2<a;u+=n){let l=o[u]*2,c=o[u+1]*2,h=o[u+2]*2;if(Qd(t,i,s[l],s[l+1],s[c],s[c+1],s[h],s[h+1]))return true}}else {let o=s.length/2;for(let a=0;a+2<o;a+=n){let u=a*2,l=(a+1)*2,c=(a+2)*2;if(Qd(t,i,s[u],s[u+1],s[l],s[l+1],s[c],s[c+1]))return true}}return false}destroy(e){if(super.destroy(e),typeof e=="boolean"?e:e?.texture){let i=typeof e=="boolean"?e:e?.textureSource;this._texture.destroy(i);}this._geometry?.off("update",this.onViewUpdate,this),this._texture=null,this._geometry=null,this._shader=null,this._gpuData=null;}};});var tc,k1=f(()=>{ye();so();Gs();Ns();tc=class r extends Ge{constructor(...e){let t=e[0];Array.isArray(e[0])&&(t={textures:e[0],autoUpdate:e[1]});let{animationSpeed:i=1,autoPlay:s=false,autoUpdate:n=true,loop:o=true,onComplete:a=null,onFrameChange:u=null,onLoop:l=null,textures:c,updateAnchor:h=false,...d}=t,[p]=c;super({...d,texture:p instanceof exports.Texture?p:p.texture}),this._textures=null,this._durations=null,this._autoUpdate=n,this._isConnectedToTicker=false,this.animationSpeed=i,this.loop=o,this.updateAnchor=h,this.onComplete=a,this.onFrameChange=u,this.onLoop=l,this._currentTime=0,this._playing=false,this._previousFrame=null,this.textures=c,s&&this.play();}stop(){this._playing&&(this._playing=false,this._autoUpdate&&this._isConnectedToTicker&&(Ie.shared.remove(this.update,this),this._isConnectedToTicker=false));}play(){this._playing||(this._playing=true,this._autoUpdate&&!this._isConnectedToTicker&&(Ie.shared.add(this.update,this,exports.UPDATE_PRIORITY.HIGH),this._isConnectedToTicker=true));}gotoAndStop(e){this.stop(),this.currentFrame=e;}gotoAndPlay(e){this.currentFrame=e,this.play();}update(e){if(!this._playing)return;let t=e.deltaTime,i=this.animationSpeed*t,s=this.currentFrame;if(this._durations!==null){let n=this._currentTime%1*this._durations[this.currentFrame];for(n+=i/60*1e3;n<0;)this._currentTime--,n+=this._durations[this.currentFrame];let o=Math.sign(this.animationSpeed*t);for(this._currentTime=Math.floor(this._currentTime);n>=this._durations[this.currentFrame];)n-=this._durations[this.currentFrame]*o,this._currentTime+=o;this._currentTime+=n/this._durations[this.currentFrame];}else this._currentTime+=i;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):s!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFrame<s||this.animationSpeed<0&&this.currentFrame>s)&&this.onLoop(),this._updateTexture());}_updateTexture(){let e=this.currentFrame;this._previousFrame!==e&&(this._previousFrame=e,this.texture=this._textures[e],this.updateAnchor&&this.texture.defaultAnchor&&this.anchor.copyFrom(this.texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame));}destroy(){this.stop(),super.destroy(),this.onComplete=null,this.onFrameChange=null,this.onLoop=null;}static fromFrames(e){let t=[];for(let i=0;i<e.length;++i)t.push(exports.Texture.from(e[i]));return new r(t)}static fromImages(e){let t=[];for(let i=0;i<e.length;++i)t.push(exports.Texture.from(e[i]));return new r(t)}get totalFrames(){return this._textures.length}get textures(){return this._textures}set textures(e){if(e[0]instanceof exports.Texture)this._textures=e,this._durations=null;else {this._textures=[],this._durations=[];for(let t=0;t<e.length;t++)this._textures.push(e[t].texture),this._durations.push(e[t].time);}this._previousFrame=null,this.gotoAndStop(0),this._updateTexture();}get currentFrame(){let e=Math.floor(this._currentTime)%this._textures.length;return e<0&&(e+=this._textures.length),e}set currentFrame(e){if(e<0||e>this.totalFrames-1)throw new Error(`[AnimatedSprite]: Invalid frame index value ${e}, expected to be between 0 and totalFrames ${this.totalFrames}.`);let t=this.currentFrame;this._currentTime=e,t!==this.currentFrame&&this._updateTexture();}get playing(){return this._playing}get autoUpdate(){return this._autoUpdate}set autoUpdate(e){e!==this._autoUpdate&&(this._autoUpdate=e,!this._autoUpdate&&this._isConnectedToTicker?(Ie.shared.remove(this.update,this),this._isConnectedToTicker=false):this._autoUpdate&&!this._isConnectedToTicker&&this._playing&&(Ie.shared.add(this.update,this),this._isConnectedToTicker=true));}};});var rc,O1=f(()=>{Te();ws();rc=class{constructor({matrix:e,observer:t}={}){this.dirty=true,this._matrix=e??new G,this.observer=t,this.position=new Ne(this,0,0),this.scale=new Ne(this,1,1),this.pivot=new Ne(this,0,0),this.skew=new Ne(this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1;}get matrix(){let e=this._matrix;return this.dirty&&(e.a=this._cx*this.scale.x,e.b=this._sx*this.scale.x,e.c=this._cy*this.scale.y,e.d=this._sy*this.scale.y,e.tx=this.position.x-(this.pivot.x*e.a+this.pivot.y*e.c),e.ty=this.position.y-(this.pivot.x*e.b+this.pivot.y*e.d),this.dirty=false),e}_onUpdate(e){this.dirty=true,e===this.skew&&this.updateSkew(),this.observer?._onUpdate(this);}updateSkew(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this.dirty=true;}toString(){return `[pixi.js/math:Transform position=(${this.position.x}, ${this.position.y}) rotation=${this.rotation} scale=(${this.scale.x}, ${this.scale.y}) skew=(${this.skew.x}, ${this.skew.y}) ]`}setFromMatrix(e){e.decompose(this),this.dirty=true;}get rotation(){return this._rotation}set rotation(e){this._rotation!==e&&(this._rotation=e,this._onUpdate(this.skew));}};});var dR,xb,F1=f(()=>{Ai();ws();ye();Pe();Be();O1();si();dR=class gb extends lt{constructor(...e){let t=e[0]||{};t instanceof exports.Texture&&(t={texture:t}),e.length>1&&(U(Y,"use new TilingSprite({ texture, width:100, height:100 }) instead"),t.width=e[1],t.height=e[2]),t={...gb.defaultOptions,...t};let{texture:i,anchor:s,tilePosition:n,tileScale:o,tileRotation:a,width:u,height:l,applyAnchorToTexture:c,roundPixels:h,...d}=t??{};super({label:"TilingSprite",...d}),this.renderPipeId="tilingSprite",this.batched=true,this.allowChildren=false,this._anchor=new Ne({_onUpdate:()=>{this.onViewUpdate();}}),this.applyAnchorToTexture=c,this.texture=i,this._width=u??i.width,this._height=l??i.height,this._tileTransform=new rc({observer:{_onUpdate:()=>this.onViewUpdate()}}),s&&(this.anchor=s),this.tilePosition=n,this.tileScale=o,this.tileRotation=a,this.roundPixels=h??false;}static from(e,t={}){return typeof e=="string"?new gb({texture:Se.get(e),...t}):new gb({texture:e,...t})}get uvRespectAnchor(){return N("uvRespectAnchor is deprecated, please use applyAnchorToTexture instead"),this.applyAnchorToTexture}set uvRespectAnchor(e){N("uvRespectAnchor is deprecated, please use applyAnchorToTexture instead"),this.applyAnchorToTexture=e;}get clampMargin(){return this._texture.textureMatrix.clampMargin}set clampMargin(e){this._texture.textureMatrix.clampMargin=e;}get anchor(){return this._anchor}set anchor(e){typeof e=="number"?this._anchor.set(e):this._anchor.copyFrom(e);}get tilePosition(){return this._tileTransform.position}set tilePosition(e){this._tileTransform.position.copyFrom(e);}get tileScale(){return this._tileTransform.scale}set tileScale(e){typeof e=="number"?this._tileTransform.scale.set(e):this._tileTransform.scale.copyFrom(e);}set tileRotation(e){this._tileTransform.rotation=e;}get tileRotation(){return this._tileTransform.rotation}get tileTransform(){return this._tileTransform}set texture(e){e||(e=exports.Texture.EMPTY);let t=this._texture;t!==e&&(t&&t.dynamic&&t.off("update",this.onViewUpdate,this),e.dynamic&&e.on("update",this.onViewUpdate,this),this._texture=e,this.onViewUpdate());}get texture(){return this._texture}set width(e){this._width=e,this.onViewUpdate();}get width(){return this._width}set height(e){this._height=e,this.onViewUpdate();}get height(){return this._height}setSize(e,t){typeof e=="object"&&(t=e.height??e.width,e=e.width),this._width=e,this._height=t??e,this.onViewUpdate();}getSize(e){return e||(e={}),e.width=this._width,e.height=this._height,e}updateBounds(){let e=this._bounds,t=this._anchor,i=this._width,s=this._height;e.minX=-t._x*i,e.maxX=e.minX+i,e.minY=-t._y*s,e.maxY=e.minY+s;}containsPoint(e){let t=this._width,i=this._height,s=-t*this._anchor._x,n=0;return e.x>=s&&e.x<=s+t&&(n=-i*this._anchor._y,e.y>=n&&e.y<=n+i)}destroy(e=false){if(super.destroy(e),this._anchor=null,this._tileTransform=null,this._bounds=null,typeof e=="boolean"?e:e?.texture){let i=typeof e=="boolean"?e:e?.textureSource;this._texture.destroy(i);}this._texture=null;}};dR.defaultOptions={texture:exports.Texture.EMPTY,anchor:{x:0,y:0},tilePosition:{x:0,y:0},tileScale:{x:1,y:1},tileRotation:0,applyAnchorToTexture:false};xb=dR;});function In(r,e){let t=r[0]??{};return (typeof t=="string"||r[1])&&(U(Y,`use new ${e}({ text: "hi!", style }) instead`),t={text:t,style:r[1]}),t}var Ni,Jd=f(()=>{ws();Pe();si();Ni=class extends lt{constructor(e,t){let{text:i,resolution:s,style:n,anchor:o,width:a,height:u,roundPixels:l,...c}=e;super({...c}),this.batched=true,this._resolution=null,this._autoResolution=true,this._didTextUpdate=true,this._styleClass=t,this.text=i??"",this.style=n,this.resolution=s??null,this.allowChildren=false,this._anchor=new Ne({_onUpdate:()=>{this.onViewUpdate();}}),o&&(this.anchor=o),this.roundPixels=l??false,a!==void 0&&(this.width=a),u!==void 0&&(this.height=u);}get anchor(){return this._anchor}set anchor(e){typeof e=="number"?this._anchor.set(e):this._anchor.copyFrom(e);}set text(e){e=e.toString(),this._text!==e&&(this._text=e,this.onViewUpdate());}get text(){return this._text}set resolution(e){this._autoResolution=e===null,this._resolution=e,this.onViewUpdate();}get resolution(){return this._resolution}get style(){return this._style}set style(e){e||(e={}),this._style?.off("update",this.onViewUpdate,this),e instanceof this._styleClass?this._style=e:this._style=new this._styleClass(e),this._style.on("update",this.onViewUpdate,this),this.onViewUpdate();}get width(){return Math.abs(this.scale.x)*this.bounds.width}set width(e){this._setWidth(e,this.bounds.width);}get height(){return Math.abs(this.scale.y)*this.bounds.height}set height(e){this._setHeight(e,this.bounds.height);}getSize(e){return e||(e={}),e.width=Math.abs(this.scale.x)*this.bounds.width,e.height=Math.abs(this.scale.y)*this.bounds.height,e}setSize(e,t){typeof e=="object"?(t=e.height??e.width,e=e.width):t??(t=e),e!==void 0&&this._setWidth(e,this.bounds.width),t!==void 0&&this._setHeight(t,this.bounds.height);}containsPoint(e){let t=this.bounds.width,i=this.bounds.height,s=-t*this.anchor.x,n=0;return e.x>=s&&e.x<=s+t&&(n=-i*this.anchor.y,e.y>=n&&e.y<=n+i)}onViewUpdate(){this.didViewUpdate||(this._didTextUpdate=true),super.onViewUpdate();}destroy(e=false){super.destroy(e),this.owner=null,this._bounds=null,this._anchor=null,(typeof e=="boolean"?e:e?.style)&&this._style.destroy(e),this._style=null,this._text=null;}};});var $r,_b=f(()=>{ts();Jd();og();Ro();un();$r=class extends Ni{constructor(...e){let t=In(e,"Text");super(t,Mt),this.renderPipeId="text",t.textureStyle&&(this.textureStyle=t.textureStyle instanceof xt?t.textureStyle:new xt(t.textureStyle));}updateBounds(){let e=this._bounds,t=this._anchor,i=0,s=0;if(this._style.trim){let{frame:n,canvasAndContext:o}=ds.getCanvasAndContext({text:this.text,style:this._style,resolution:1});ds.returnCanvasAndContext(o),i=n.width,s=n.height;}else {let n=It.measureText(this._text,this._style);i=n.width,s=n.height;}e.minX=-t._x*i,e.maxX=e.minX+i,e.minY=-t._y*s,e.maxY=e.minY+s;}};});var ic,G1=f(()=>{Ct();ye();hr();ag();Po();Ga();Ns();k1();F1();_b();D1();ic=class extends mb{resolveQueueItem(e,t){return e instanceof ue?this.resolveContainerQueueItem(e,t):e instanceof ge||e instanceof exports.Texture?t.push(e.source):e instanceof dt&&t.push(e),null}resolveContainerQueueItem(e,t){e instanceof Ge||e instanceof xb||e instanceof _r?t.push(e.texture.source):e instanceof $r?t.push(e):e instanceof cn?t.push(e.context):e instanceof tc&&e.textures.forEach(i=>{i.source?t.push(i.source):t.push(i.texture.source);});}resolveGraphicsContextQueueItem(e){this.renderer.graphicsContext.getGpuContext(e);let{instructions:t}=e;for(let i of t)if(i.action==="texture"){let{image:s}=i.data;return s.source}else if(i.action==="fill"){let{texture:s}=i.data.style;return s.source}return null}};});var sc,U1=f(()=>{Be();Jd();un();Ah();sc=class extends Ni{constructor(...e){var t;let i=In(e,"BitmapText");i.style??(i.style=i.style||{}),(t=i.style).fill??(t.fill=16777215),super(i,Mt),this.renderPipeId="bitmapText";}updateBounds(){let e=this._bounds,t=this._anchor,i=fs.measureText(this.text,this._style),s=i.scale,n=i.offsetY*s,o=i.width*s,a=i.height*s,u=this._style._stroke;u&&(o+=u.width,a+=u.width),e.minX=-t._x*o,e.maxX=e.minX+o,e.minY=-t._y*(a+n),e.maxY=e.minY+a;}set resolution(e){e!==null&&N("[BitmapText] dynamically updating the resolution is not supported. Resolution should be managed by the BitmapFont.");}get resolution(){return this._resolution}};});var nc,L1=f(()=>{ts();Jd();bg();Ag();nc=class extends Ni{constructor(...e){let t=In(e,"HtmlText");super(t,fn),this.renderPipeId="htmlText",t.textureStyle&&(this.textureStyle=t.textureStyle instanceof xt?t.textureStyle:new xt(t.textureStyle));}updateBounds(){let e=this._bounds,t=this._anchor,i=Zu(this.text,this._style),{width:s,height:n}=i;e.minX=-t._x*s,e.maxX=e.minX+s,e.minY=-t._y*n,e.maxY=e.minY+n;}};});var oc,N1=f(()=>{Ct();Po();_b();U1();L1();G1();oc=class extends ic{uploadQueueItem(e){e instanceof ge?this.uploadTextureSource(e):e instanceof $r?this.uploadText(e):e instanceof nc?this.uploadHTMLText(e):e instanceof sc?this.uploadBitmapText(e):e instanceof dt&&this.uploadGraphicsContext(e);}uploadTextureSource(e){this.renderer.texture.initSource(e);}uploadText(e){this.renderer.renderPipes.text.initGpuText(e);}uploadBitmapText(e){this.renderer.renderPipes.bitmapText.initGpuText(e);}uploadHTMLText(e){this.renderer.renderPipes.htmlText.initGpuText(e);}uploadGraphicsContext(e){this.renderer.graphicsContext.getGpuContext(e);let{instructions:t}=e;for(let i of t)if(i.action==="texture"){let{image:s}=i.data;this.uploadTextureSource(s.source);}else if(i.action==="fill"){let{texture:s}=i.data.style;this.uploadTextureSource(s.source);}return null}};});var ef,fR=f(()=>{B();N1();ef=class extends oc{destroy(){clearTimeout(this.timeout),this.renderer=null,this.queue=null,this.resolves=null;}};ef.extension={type:[x.WebGLSystem,x.WebGPUSystem],name:"prepare"};});function pR(r){let e=[],t=0;for(let i=0;i<r;i++)e[t]={texture:{sampleType:"float",viewDimension:"2d",multisampled:false},binding:t,visibility:GPUShaderStage.FRAGMENT},t++,e[t]={sampler:{type:"filtering"},binding:t,visibility:GPUShaderStage.FRAGMENT},t++;return e}var mR=f(()=>{});function gR(r){let e={},t=0;for(let i=0;i<r;i++)e[`textureSource${i+1}`]=t++,e[`textureSampler${i+1}`]=t++;return e}var xR=f(()=>{});function _R(r){let e=r.split(/([\n{}])/g).map(s=>s.trim()).filter(s=>s.length),t="";return e.map(s=>{let n=t+s;return s==="{"?t+=" ":s==="}"&&(t=t.substr(0,t.length-4),n=t+s),n}).join(`
3227
3227
  `)}var bR=f(()=>{});var bb,yR=f(()=>{$c();qc();bb=class{constructor(e){this.priority=0,this.pipe="scissorMask",this.mask=e,this.mask.renderable=false,this.mask.measurable=false;}addBounds(e,t){Hs(this.mask,e,t);}addLocalBounds(e,t){Vs(this.mask,e,t);}containsPoint(e,t){let i=this.mask;return t(i,e)}reset(){this.mask.measurable=true,this.mask=null;}destroy(){this.reset();}};});function vR(r){return r=r.replaceAll("texture2D","texture").replaceAll("gl_FragColor","finalColor").replaceAll("varying","in"),r=`
3228
3228
  out vec4 finalColor;
3229
3229
  ${r}
3230
- `,r}var TR=f(()=>{});function SR(r){return HF[r]}var HF,ER=f(()=>{HF={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,uint:1,uvec2:2,uvec3:3,uvec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};});var CR,AR,PR=f(()=>{Pe();CR={POINTS:"point-list",LINES:"line-list",LINE_STRIP:"line-strip",TRIANGLES:"triangle-list",TRIANGLE_STRIP:"triangle-strip"},AR=new Proxy(CR,{get(r,e){return U(Y,`DRAW_MODES.${e} is deprecated, use '${CR[e]}' instead`),r[e]}});});var tf,wR,rf,BR,RR=f(()=>{Pe();tf=(r=>(r.CLAMP="clamp-to-edge",r.REPEAT="repeat",r.MIRRORED_REPEAT="mirror-repeat",r))(tf||{}),wR=new Proxy(tf,{get(r,e){return U(Y,`DRAW_MODES.${e} is deprecated, use '${tf[e]}' instead`),r[e]}}),rf=(r=>(r.NEAREST="nearest",r.LINEAR="linear",r))(rf||{}),BR=new Proxy(rf,{get(r,e){return U(Y,`DRAW_MODES.${e} is deprecated, use '${rf[e]}' instead`),r[e]}});});var yb,MR=f(()=>{hp();yb=class{constructor(){this.x0=0,this.y0=0,this.x1=1,this.y1=0,this.x2=1,this.y2=1,this.x3=0,this.y3=1,this.uvsFloat32=new Float32Array(8);}set(e,t,i){let s=t.width,n=t.height;if(i){let o=e.width/2/s,a=e.height/2/n,u=e.x/s+o,l=e.y/n+a;i=be.add(i,be.NW),this.x0=u+o*be.uX(i),this.y0=l+a*be.uY(i),i=be.add(i,2),this.x1=u+o*be.uX(i),this.y1=l+a*be.uY(i),i=be.add(i,2),this.x2=u+o*be.uX(i),this.y2=l+a*be.uY(i),i=be.add(i,2),this.x3=u+o*be.uX(i),this.y3=l+a*be.uY(i);}else this.x0=e.x/s,this.y0=e.y/n,this.x1=(e.x+e.width)/s,this.y1=e.y/n,this.x2=(e.x+e.width)/s,this.y2=(e.y+e.height)/n,this.x3=e.x/s,this.y3=(e.y+e.height)/n;this.uvsFloat32[0]=this.x0,this.uvsFloat32[1]=this.y0,this.uvsFloat32[2]=this.x1,this.uvsFloat32[3]=this.y1,this.uvsFloat32[4]=this.x2,this.uvsFloat32[5]=this.y2,this.uvsFloat32[6]=this.x3,this.uvsFloat32[7]=this.y3;}toString(){return `[pixi.js/core:TextureUvs x0=${this.x0} y0=${this.y0} x1=${this.x1} y1=${this.y1} x2=${this.x2} y2=${this.y2} x3=${this.x3} y3=${this.y3}]`}};});function IR(r){let e=r.toString(),t=e.indexOf("{"),i=e.lastIndexOf("}");if(t===-1||i===-1)throw new Error("getFunctionBody: No body found in function definition");return e.slice(t+1,i).trim()}var DR=f(()=>{});function kR(r,e){return U("8.7.0","Use container.getFastGlobalBounds() instead"),r.getFastGlobalBounds(true,e)}var OR=f(()=>{Pe();});var vb,FR=f(()=>{si();vb=class extends lt{constructor(e){typeof e=="function"&&(e={render:e});let{render:t,...i}=e;super({label:"RenderContainer",...i}),this.renderPipeId="customRender",this.batched=false,t&&(this.render=t),this.containsPoint=e.containsPoint??(()=>false),this.addBounds=e.addBounds??(()=>false);}updateBounds(){this._bounds.clear(),this.addBounds(this._bounds);}render(e){}};});function GR(r,e,t){U("8.7.0","Please use container.collectRenderables instead.");let i=t.renderPipes?t:t.batch.renderer;return r.collectRenderables(e,i,null)}var UR=f(()=>{Pe();});function LR(r,e){let t=e._scale,i=e._pivot,s=e._position,n=t._x,o=t._y,a=i._x,u=i._y;r.a=e._cx*n,r.b=e._sx*n,r.c=e._cy*o,r.d=e._sy*o,r.tx=s._x-(a*r.a+u*r.c),r.ty=s._y-(a*r.b+u*r.d);}var NR=f(()=>{});function HR(r,e,t){let i=r.a,s=r.b,n=r.c,o=r.d,a=r.tx,u=r.ty,l=e.a,c=e.b,h=e.c,d=e.d;t.a=i*l+s*h,t.b=i*c+s*d,t.c=n*l+o*h,t.d=n*c+o*d,t.tx=a*l+u*h+e.tx,t.ty=a*c+u*d+e.ty;}var VR=f(()=>{});var zR,VF,XR,YR=f(()=>{Be();hr();zR=class WR extends exports.PixiJSContainer{constructor(e={}){e={...WR.defaultOptions,...e},super(),this.renderLayerChildren=[],this.sortableChildren=e.sortableChildren,this.sortFunction=e.sortFunction;}attach(...e){for(let t=0;t<e.length;t++){let i=e[t];if(i.parentRenderLayer){if(i.parentRenderLayer===this)continue;i.parentRenderLayer.detach(i);}this.renderLayerChildren.push(i),i.parentRenderLayer=this;let s=this.renderGroup||this.parentRenderGroup;s&&(s.structureDidChange=true);}return e[0]}detach(...e){for(let t=0;t<e.length;t++){let i=e[t],s=this.renderLayerChildren.indexOf(i);s!==-1&&this.renderLayerChildren.splice(s,1),i.parentRenderLayer=null;let n=this.renderGroup||this.parentRenderGroup;n&&(n.structureDidChange=true);}return e[0]}detachAll(){let e=this.renderLayerChildren;for(let t=0;t<e.length;t++)e[t].parentRenderLayer=null;this.renderLayerChildren.length=0;}collectRenderables(e,t,i){let s=this.renderLayerChildren,n=s.length;this.sortableChildren&&this.sortRenderLayerChildren();for(let o=0;o<n;o++)s[o].parent||N("Container must be added to both layer and scene graph. Layers only handle render order - the scene graph is required for transforms (addChild)",s[o]),s[o].collectRenderables(e,t,this);}sortRenderLayerChildren(){this.renderLayerChildren.sort(this.sortFunction);}_getGlobalBoundsRecursive(e,t,i){if(!e)return;let s=this.renderLayerChildren;for(let n=0;n<s.length;n++)s[n]._getGlobalBoundsRecursive(true,t,this);}};zR.defaultOptions={sortableChildren:false,sortFunction:(r,e)=>r.zIndex-e.zIndex};VF=zR,XR=VF;});function Tb(r,e,t,i){let s=t.buffers[0],n=s.data,{verticesX:o,verticesY:a}=t,u=r/(o-1),l=e/(a-1),c=0,h=i[0],d=i[1],p=i[2],m=i[3],b=i[4],_=i[5],g=i[6],y=i[7],S=i[8];for(let E=0;E<n.length;E+=2){let F=c%o*u,T=(c/o|0)*l,C=h*F+d*T+p,A=m*F+b*T+_,P=g*F+y*T+S;n[E]=C/P,n[E+1]=A/P,c++;}s.update();}var H1=f(()=>{});function $R(r,e){let t=e[0],i=e[1],s=e[2],n=e[3],o=e[4],a=e[5],u=e[6],l=e[7],c=e[8];return r[0]=o*c-a*l,r[1]=s*l-i*c,r[2]=i*a-s*o,r[3]=a*u-n*c,r[4]=t*c-s*u,r[5]=s*n-t*a,r[6]=n*l-o*u,r[7]=i*u-t*l,r[8]=t*o-i*n,r}function qR(r,e,t){let i=e[0],s=e[1],n=e[2],o=e[3],a=e[4],u=e[5],l=e[6],c=e[7],h=e[8],d=t[0],p=t[1],m=t[2],b=t[3],_=t[4],g=t[5],y=t[6],S=t[7],E=t[8];return r[0]=d*i+p*o+m*l,r[1]=d*s+p*a+m*c,r[2]=d*n+p*u+m*h,r[3]=b*i+_*o+g*l,r[4]=b*s+_*a+g*c,r[5]=b*n+_*u+g*h,r[6]=y*i+S*o+E*l,r[7]=y*s+S*a+E*c,r[8]=y*n+S*u+E*h,r}function zF(r,e,t){let i=t[0],s=t[1],n=t[2];return r[0]=e[0]*i+e[1]*s+e[2]*n,r[1]=e[3]*i+e[4]*s+e[5]*n,r[2]=e[6]*i+e[7]*s+e[8]*n,r}function jR(r,e,t,i,s,n,o,a,u){let l=WF;l[0]=e,l[1]=i,l[2]=n,l[3]=t,l[4]=s,l[5]=o,l[6]=1,l[7]=1,l[8]=1;let c=$R(r,l);Sb[0]=a,Sb[1]=u,Sb[2]=1;let h=zF(XF,c,Sb),d=r;return r[0]=h[0],r[1]=0,r[2]=0,r[3]=0,r[4]=h[1],r[5]=0,r[6]=0,r[7]=0,r[8]=h[2],qR(r,d,l)}function Eb(r,e,t,i,s,n,o,a,u,l,c,h,d,p,m,b,_){let g=jR(YF,e,t,n,o,l,c,p,m),y=jR(jF,i,s,a,u,h,d,b,_);return qR(r,$R(g,g),y)}var WF,XF,Sb,YF,jF,V1=f(()=>{WF=[0,0,0,0,0,0,0,0,0],XF=[0,0,0],Sb=[0,0,0];YF=[0,0,0,0,0,0,0,0,0],jF=[0,0,0,0,0,0,0,0,0];});var ac,z1=f(()=>{Rh();H1();V1();ac=class extends gn{constructor(e){super(e),this._projectionMatrix=[0,0,0,0,0,0,0,0,0];let{width:t,height:i}=e;this.corners=[0,0,t,0,t,i,0,i];}setCorners(e,t,i,s,n,o,a,u){let l=this.corners;l[0]=e,l[1]=t,l[2]=i,l[3]=s,l[4]=n,l[5]=o,l[6]=a,l[7]=u,this.updateProjection();}updateProjection(){let{width:e,height:t}=this,i=this.corners,s=Eb(this._projectionMatrix,0,0,i[0],i[1],e,0,i[2],i[3],e,t,i[4],i[5],0,t,i[6],i[7]);Tb(e,t,this,s);}};});var KR,QR,JR=f(()=>{ye();Ds();Ga();z1();KR=class ZR extends _r{constructor(e){e={...ZR.defaultOptions,...e};let{texture:t,verticesX:i,verticesY:s,...n}=e,o=new ac(Rt({width:t.width,height:t.height,verticesX:i,verticesY:s}));super(Rt({...n,geometry:o})),this._texture=t,this.geometry.setCorners(e.x0,e.y0,e.x1,e.y1,e.x2,e.y2,e.x3,e.y3);}textureUpdated(){let e=this.geometry;if(!e)return;let{width:t,height:i}=this.texture;(e.width!==t||e.height!==i)&&(e.width=t,e.height=i,e.updateProjection());}set texture(e){this._texture!==e&&(super.texture=e,this.textureUpdated());}get texture(){return this._texture}setCorners(e,t,i,s,n,o,a,u){this.geometry.setCorners(e,t,i,s,n,o,a,u);}};KR.defaultOptions={texture:exports.Texture.WHITE,verticesX:10,verticesY:10,x0:0,y0:0,x1:100,y1:0,x2:100,y2:100,x3:0,y3:100};QR=KR;});var Cb,eM=f(()=>{Ds();Ga();Rh();Cb=class extends _r{constructor(e){let{texture:t,verticesX:i,verticesY:s,...n}=e,o=new gn(Rt({width:t.width,height:t.height,verticesX:i,verticesY:s}));super(Rt({...n,geometry:o,texture:t})),this.texture=t,this.autoResize=true;}textureUpdated(){let e=this.geometry,{width:t,height:i}=this.texture;this.autoResize&&(e.width!==t||e.height!==i)&&(e.width=t,e.height=i,e.build({}));}set texture(e){this._texture?.off("update",this.textureUpdated,this),super.texture=e,e.on("update",this.textureUpdated,this),this.textureUpdated();}get texture(){return this._texture}destroy(e){this.texture.off("update",this.textureUpdated,this),super.destroy(e);}};});var tM,Ab,W1=f(()=>{pn();tM=class rM extends fr{constructor(e){let{width:t,points:i,textureScale:s}={...rM.defaultOptions,...e};super({positions:new Float32Array(i.length*4),uvs:new Float32Array(i.length*4),indices:new Uint32Array((i.length-1)*6)}),this.points=i,this._width=t,this.textureScale=s,this._build();}get width(){return this._width}_build(){let e=this.points;if(!e)return;let t=this.getBuffer("aPosition"),i=this.getBuffer("aUV"),s=this.getIndex();if(e.length<1)return;t.data.length/4!==e.length&&(t.data=new Float32Array(e.length*4),i.data=new Float32Array(e.length*4),s.data=new Uint16Array((e.length-1)*6));let n=i.data,o=s.data;n[0]=0,n[1]=0,n[2]=0,n[3]=1;let a=0,u=e[0],l=this._width*this.textureScale,c=e.length;for(let d=0;d<c;d++){let p=d*4;if(this.textureScale>0){let m=u.x-e[d].x,b=u.y-e[d].y,_=Math.sqrt(m*m+b*b);u=e[d],a+=_/l;}else a=d/(c-1);n[p]=a,n[p+1]=0,n[p+2]=a,n[p+3]=1;}let h=0;for(let d=0;d<c-1;d++){let p=d*2;o[h++]=p,o[h++]=p+1,o[h++]=p+2,o[h++]=p+2,o[h++]=p+1,o[h++]=p+3;}i.update(),s.update(),this.updateVertices();}updateVertices(){let e=this.points;if(e.length<1)return;let t=e[0],i,s=0,n=0,o=this.buffers[0].data,a=e.length,u=this.textureScale>0?this.textureScale*this._width/2:this._width/2;for(let l=0;l<a;l++){let c=e[l],h=l*4;l<e.length-1?i=e[l+1]:i=c,n=-(i.x-t.x),s=i.y-t.y;let p=Math.sqrt(s*s+n*n);p<1e-6?(s=0,n=0):(s/=p,n/=p,s*=u,n*=u),o[h]=c.x+s,o[h+1]=c.y+n,o[h+2]=c.x-s,o[h+3]=c.y-n,t=c;}this.buffers[0].update();}update(){this.textureScale>0?this._build():this.updateVertices();}};tM.defaultOptions={width:200,points:[],textureScale:0};Ab=tM;});var iM,nM,oM=f(()=>{Ds();Ga();W1();iM=class sM extends _r{constructor(e){let{texture:t,points:i,textureScale:s,...n}={...sM.defaultOptions,...e},o=new Ab(Rt({width:t.height,points:i,textureScale:s}));s>0&&(t.source.style.addressMode="repeat"),super(Rt({...n,texture:t,geometry:o})),this.autoUpdate=true,this.onRender=this._render;}_render(){let e=this.geometry;(this.autoUpdate||e._width!==this.texture.height)&&(e._width=this.texture.height,e.update());}};iM.defaultOptions={textureScale:0};nM=iM;});var Pb,aM=f(()=>{Ds();Ga();pn();Pb=class extends _r{constructor(e){let{texture:t,vertices:i,uvs:s,indices:n,topology:o,...a}=e,u=new fr(Rt({positions:i,uvs:s,indices:n,topology:o}));super(Rt({...a,texture:t,geometry:u})),this.autoUpdate=true,this.onRender=this._render;}get vertices(){return this.geometry.getBuffer("aPosition").data}set vertices(e){this.geometry.getBuffer("aPosition").data=e;}_render(){this.autoUpdate&&this.geometry.getBuffer("aPosition").update();}};});function uM(r,e){let{width:t,height:i}=r.frame;return e.scale(1/t,1/i),e}var lM=f(()=>{});var cM,hM,dM=f(()=>{gt();ye();sp();pp();cM=class X1{constructor(e){if(e instanceof exports.Texture)this.texture=e,to(this,X1.defaultOptions,{});else {let t={...X1.defaultOptions,...e};to(this,t,{});}}get alpha(){return this._alpha}set alpha(e){this._alpha=Math.min(Math.max(e,0),1),this._updateColor();}get tint(){return es(this._tint)}set tint(e){typeof e=="number"?this._tint=e:this._tint=te.shared.setValue(e??16777215).toBgrNumber(),this._updateColor();}_updateColor(){this.color=this._tint+((this._alpha*255|0)<<24);}};cM.defaultOptions={anchorX:0,anchorY:0,x:0,y:0,scaleX:1,scaleY:1,rotation:0,tint:16777215,alpha:1};hM=cM;});var sf,Y1=f(()=>{sf={vertex:{attributeName:"aVertex",format:"float32x2",code:`
3230
+ `,r}var TR=f(()=>{});function SR(r){return HF[r]}var HF,ER=f(()=>{HF={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,uint:1,uvec2:2,uvec3:3,uvec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};});var CR,AR,PR=f(()=>{Pe();CR={POINTS:"point-list",LINES:"line-list",LINE_STRIP:"line-strip",TRIANGLES:"triangle-list",TRIANGLE_STRIP:"triangle-strip"},AR=new Proxy(CR,{get(r,e){return U(Y,`DRAW_MODES.${e} is deprecated, use '${CR[e]}' instead`),r[e]}});});var tf,wR,rf,BR,RR=f(()=>{Pe();tf=(r=>(r.CLAMP="clamp-to-edge",r.REPEAT="repeat",r.MIRRORED_REPEAT="mirror-repeat",r))(tf||{}),wR=new Proxy(tf,{get(r,e){return U(Y,`DRAW_MODES.${e} is deprecated, use '${tf[e]}' instead`),r[e]}}),rf=(r=>(r.NEAREST="nearest",r.LINEAR="linear",r))(rf||{}),BR=new Proxy(rf,{get(r,e){return U(Y,`DRAW_MODES.${e} is deprecated, use '${rf[e]}' instead`),r[e]}});});var yb,MR=f(()=>{hp();yb=class{constructor(){this.x0=0,this.y0=0,this.x1=1,this.y1=0,this.x2=1,this.y2=1,this.x3=0,this.y3=1,this.uvsFloat32=new Float32Array(8);}set(e,t,i){let s=t.width,n=t.height;if(i){let o=e.width/2/s,a=e.height/2/n,u=e.x/s+o,l=e.y/n+a;i=be.add(i,be.NW),this.x0=u+o*be.uX(i),this.y0=l+a*be.uY(i),i=be.add(i,2),this.x1=u+o*be.uX(i),this.y1=l+a*be.uY(i),i=be.add(i,2),this.x2=u+o*be.uX(i),this.y2=l+a*be.uY(i),i=be.add(i,2),this.x3=u+o*be.uX(i),this.y3=l+a*be.uY(i);}else this.x0=e.x/s,this.y0=e.y/n,this.x1=(e.x+e.width)/s,this.y1=e.y/n,this.x2=(e.x+e.width)/s,this.y2=(e.y+e.height)/n,this.x3=e.x/s,this.y3=(e.y+e.height)/n;this.uvsFloat32[0]=this.x0,this.uvsFloat32[1]=this.y0,this.uvsFloat32[2]=this.x1,this.uvsFloat32[3]=this.y1,this.uvsFloat32[4]=this.x2,this.uvsFloat32[5]=this.y2,this.uvsFloat32[6]=this.x3,this.uvsFloat32[7]=this.y3;}toString(){return `[pixi.js/core:TextureUvs x0=${this.x0} y0=${this.y0} x1=${this.x1} y1=${this.y1} x2=${this.x2} y2=${this.y2} x3=${this.x3} y3=${this.y3}]`}};});function IR(r){let e=r.toString(),t=e.indexOf("{"),i=e.lastIndexOf("}");if(t===-1||i===-1)throw new Error("getFunctionBody: No body found in function definition");return e.slice(t+1,i).trim()}var DR=f(()=>{});function kR(r,e){return U("8.7.0","Use container.getFastGlobalBounds() instead"),r.getFastGlobalBounds(true,e)}var OR=f(()=>{Pe();});var vb,FR=f(()=>{si();vb=class extends lt{constructor(e){typeof e=="function"&&(e={render:e});let{render:t,...i}=e;super({label:"RenderContainer",...i}),this.renderPipeId="customRender",this.batched=false,t&&(this.render=t),this.containsPoint=e.containsPoint??(()=>false),this.addBounds=e.addBounds??(()=>false);}updateBounds(){this._bounds.clear(),this.addBounds(this._bounds);}render(e){}};});function GR(r,e,t){U("8.7.0","Please use container.collectRenderables instead.");let i=t.renderPipes?t:t.batch.renderer;return r.collectRenderables(e,i,null)}var UR=f(()=>{Pe();});function LR(r,e){let t=e._scale,i=e._pivot,s=e._position,n=t._x,o=t._y,a=i._x,u=i._y;r.a=e._cx*n,r.b=e._sx*n,r.c=e._cy*o,r.d=e._sy*o,r.tx=s._x-(a*r.a+u*r.c),r.ty=s._y-(a*r.b+u*r.d);}var NR=f(()=>{});function HR(r,e,t){let i=r.a,s=r.b,n=r.c,o=r.d,a=r.tx,u=r.ty,l=e.a,c=e.b,h=e.c,d=e.d;t.a=i*l+s*h,t.b=i*c+s*d,t.c=n*l+o*h,t.d=n*c+o*d,t.tx=a*l+u*h+e.tx,t.ty=a*c+u*d+e.ty;}var VR=f(()=>{});var zR,VF,XR,YR=f(()=>{Be();hr();zR=class WR extends ue{constructor(e={}){e={...WR.defaultOptions,...e},super(),this.renderLayerChildren=[],this.sortableChildren=e.sortableChildren,this.sortFunction=e.sortFunction;}attach(...e){for(let t=0;t<e.length;t++){let i=e[t];if(i.parentRenderLayer){if(i.parentRenderLayer===this)continue;i.parentRenderLayer.detach(i);}this.renderLayerChildren.push(i),i.parentRenderLayer=this;let s=this.renderGroup||this.parentRenderGroup;s&&(s.structureDidChange=true);}return e[0]}detach(...e){for(let t=0;t<e.length;t++){let i=e[t],s=this.renderLayerChildren.indexOf(i);s!==-1&&this.renderLayerChildren.splice(s,1),i.parentRenderLayer=null;let n=this.renderGroup||this.parentRenderGroup;n&&(n.structureDidChange=true);}return e[0]}detachAll(){let e=this.renderLayerChildren;for(let t=0;t<e.length;t++)e[t].parentRenderLayer=null;this.renderLayerChildren.length=0;}collectRenderables(e,t,i){let s=this.renderLayerChildren,n=s.length;this.sortableChildren&&this.sortRenderLayerChildren();for(let o=0;o<n;o++)s[o].parent||N("Container must be added to both layer and scene graph. Layers only handle render order - the scene graph is required for transforms (addChild)",s[o]),s[o].collectRenderables(e,t,this);}sortRenderLayerChildren(){this.renderLayerChildren.sort(this.sortFunction);}_getGlobalBoundsRecursive(e,t,i){if(!e)return;let s=this.renderLayerChildren;for(let n=0;n<s.length;n++)s[n]._getGlobalBoundsRecursive(true,t,this);}};zR.defaultOptions={sortableChildren:false,sortFunction:(r,e)=>r.zIndex-e.zIndex};VF=zR,XR=VF;});function Tb(r,e,t,i){let s=t.buffers[0],n=s.data,{verticesX:o,verticesY:a}=t,u=r/(o-1),l=e/(a-1),c=0,h=i[0],d=i[1],p=i[2],m=i[3],b=i[4],_=i[5],g=i[6],y=i[7],S=i[8];for(let E=0;E<n.length;E+=2){let F=c%o*u,T=(c/o|0)*l,C=h*F+d*T+p,A=m*F+b*T+_,P=g*F+y*T+S;n[E]=C/P,n[E+1]=A/P,c++;}s.update();}var H1=f(()=>{});function $R(r,e){let t=e[0],i=e[1],s=e[2],n=e[3],o=e[4],a=e[5],u=e[6],l=e[7],c=e[8];return r[0]=o*c-a*l,r[1]=s*l-i*c,r[2]=i*a-s*o,r[3]=a*u-n*c,r[4]=t*c-s*u,r[5]=s*n-t*a,r[6]=n*l-o*u,r[7]=i*u-t*l,r[8]=t*o-i*n,r}function qR(r,e,t){let i=e[0],s=e[1],n=e[2],o=e[3],a=e[4],u=e[5],l=e[6],c=e[7],h=e[8],d=t[0],p=t[1],m=t[2],b=t[3],_=t[4],g=t[5],y=t[6],S=t[7],E=t[8];return r[0]=d*i+p*o+m*l,r[1]=d*s+p*a+m*c,r[2]=d*n+p*u+m*h,r[3]=b*i+_*o+g*l,r[4]=b*s+_*a+g*c,r[5]=b*n+_*u+g*h,r[6]=y*i+S*o+E*l,r[7]=y*s+S*a+E*c,r[8]=y*n+S*u+E*h,r}function zF(r,e,t){let i=t[0],s=t[1],n=t[2];return r[0]=e[0]*i+e[1]*s+e[2]*n,r[1]=e[3]*i+e[4]*s+e[5]*n,r[2]=e[6]*i+e[7]*s+e[8]*n,r}function jR(r,e,t,i,s,n,o,a,u){let l=WF;l[0]=e,l[1]=i,l[2]=n,l[3]=t,l[4]=s,l[5]=o,l[6]=1,l[7]=1,l[8]=1;let c=$R(r,l);Sb[0]=a,Sb[1]=u,Sb[2]=1;let h=zF(XF,c,Sb),d=r;return r[0]=h[0],r[1]=0,r[2]=0,r[3]=0,r[4]=h[1],r[5]=0,r[6]=0,r[7]=0,r[8]=h[2],qR(r,d,l)}function Eb(r,e,t,i,s,n,o,a,u,l,c,h,d,p,m,b,_){let g=jR(YF,e,t,n,o,l,c,p,m),y=jR(jF,i,s,a,u,h,d,b,_);return qR(r,$R(g,g),y)}var WF,XF,Sb,YF,jF,V1=f(()=>{WF=[0,0,0,0,0,0,0,0,0],XF=[0,0,0],Sb=[0,0,0];YF=[0,0,0,0,0,0,0,0,0],jF=[0,0,0,0,0,0,0,0,0];});var ac,z1=f(()=>{Rh();H1();V1();ac=class extends gn{constructor(e){super(e),this._projectionMatrix=[0,0,0,0,0,0,0,0,0];let{width:t,height:i}=e;this.corners=[0,0,t,0,t,i,0,i];}setCorners(e,t,i,s,n,o,a,u){let l=this.corners;l[0]=e,l[1]=t,l[2]=i,l[3]=s,l[4]=n,l[5]=o,l[6]=a,l[7]=u,this.updateProjection();}updateProjection(){let{width:e,height:t}=this,i=this.corners,s=Eb(this._projectionMatrix,0,0,i[0],i[1],e,0,i[2],i[3],e,t,i[4],i[5],0,t,i[6],i[7]);Tb(e,t,this,s);}};});var KR,QR,JR=f(()=>{ye();Ds();Ga();z1();KR=class ZR extends _r{constructor(e){e={...ZR.defaultOptions,...e};let{texture:t,verticesX:i,verticesY:s,...n}=e,o=new ac(Rt({width:t.width,height:t.height,verticesX:i,verticesY:s}));super(Rt({...n,geometry:o})),this._texture=t,this.geometry.setCorners(e.x0,e.y0,e.x1,e.y1,e.x2,e.y2,e.x3,e.y3);}textureUpdated(){let e=this.geometry;if(!e)return;let{width:t,height:i}=this.texture;(e.width!==t||e.height!==i)&&(e.width=t,e.height=i,e.updateProjection());}set texture(e){this._texture!==e&&(super.texture=e,this.textureUpdated());}get texture(){return this._texture}setCorners(e,t,i,s,n,o,a,u){this.geometry.setCorners(e,t,i,s,n,o,a,u);}};KR.defaultOptions={texture:exports.Texture.WHITE,verticesX:10,verticesY:10,x0:0,y0:0,x1:100,y1:0,x2:100,y2:100,x3:0,y3:100};QR=KR;});var Cb,eM=f(()=>{Ds();Ga();Rh();Cb=class extends _r{constructor(e){let{texture:t,verticesX:i,verticesY:s,...n}=e,o=new gn(Rt({width:t.width,height:t.height,verticesX:i,verticesY:s}));super(Rt({...n,geometry:o,texture:t})),this.texture=t,this.autoResize=true;}textureUpdated(){let e=this.geometry,{width:t,height:i}=this.texture;this.autoResize&&(e.width!==t||e.height!==i)&&(e.width=t,e.height=i,e.build({}));}set texture(e){this._texture?.off("update",this.textureUpdated,this),super.texture=e,e.on("update",this.textureUpdated,this),this.textureUpdated();}get texture(){return this._texture}destroy(e){this.texture.off("update",this.textureUpdated,this),super.destroy(e);}};});var tM,Ab,W1=f(()=>{pn();tM=class rM extends fr{constructor(e){let{width:t,points:i,textureScale:s}={...rM.defaultOptions,...e};super({positions:new Float32Array(i.length*4),uvs:new Float32Array(i.length*4),indices:new Uint32Array((i.length-1)*6)}),this.points=i,this._width=t,this.textureScale=s,this._build();}get width(){return this._width}_build(){let e=this.points;if(!e)return;let t=this.getBuffer("aPosition"),i=this.getBuffer("aUV"),s=this.getIndex();if(e.length<1)return;t.data.length/4!==e.length&&(t.data=new Float32Array(e.length*4),i.data=new Float32Array(e.length*4),s.data=new Uint16Array((e.length-1)*6));let n=i.data,o=s.data;n[0]=0,n[1]=0,n[2]=0,n[3]=1;let a=0,u=e[0],l=this._width*this.textureScale,c=e.length;for(let d=0;d<c;d++){let p=d*4;if(this.textureScale>0){let m=u.x-e[d].x,b=u.y-e[d].y,_=Math.sqrt(m*m+b*b);u=e[d],a+=_/l;}else a=d/(c-1);n[p]=a,n[p+1]=0,n[p+2]=a,n[p+3]=1;}let h=0;for(let d=0;d<c-1;d++){let p=d*2;o[h++]=p,o[h++]=p+1,o[h++]=p+2,o[h++]=p+2,o[h++]=p+1,o[h++]=p+3;}i.update(),s.update(),this.updateVertices();}updateVertices(){let e=this.points;if(e.length<1)return;let t=e[0],i,s=0,n=0,o=this.buffers[0].data,a=e.length,u=this.textureScale>0?this.textureScale*this._width/2:this._width/2;for(let l=0;l<a;l++){let c=e[l],h=l*4;l<e.length-1?i=e[l+1]:i=c,n=-(i.x-t.x),s=i.y-t.y;let p=Math.sqrt(s*s+n*n);p<1e-6?(s=0,n=0):(s/=p,n/=p,s*=u,n*=u),o[h]=c.x+s,o[h+1]=c.y+n,o[h+2]=c.x-s,o[h+3]=c.y-n,t=c;}this.buffers[0].update();}update(){this.textureScale>0?this._build():this.updateVertices();}};tM.defaultOptions={width:200,points:[],textureScale:0};Ab=tM;});var iM,nM,oM=f(()=>{Ds();Ga();W1();iM=class sM extends _r{constructor(e){let{texture:t,points:i,textureScale:s,...n}={...sM.defaultOptions,...e},o=new Ab(Rt({width:t.height,points:i,textureScale:s}));s>0&&(t.source.style.addressMode="repeat"),super(Rt({...n,texture:t,geometry:o})),this.autoUpdate=true,this.onRender=this._render;}_render(){let e=this.geometry;(this.autoUpdate||e._width!==this.texture.height)&&(e._width=this.texture.height,e.update());}};iM.defaultOptions={textureScale:0};nM=iM;});var Pb,aM=f(()=>{Ds();Ga();pn();Pb=class extends _r{constructor(e){let{texture:t,vertices:i,uvs:s,indices:n,topology:o,...a}=e,u=new fr(Rt({positions:i,uvs:s,indices:n,topology:o}));super(Rt({...a,texture:t,geometry:u})),this.autoUpdate=true,this.onRender=this._render;}get vertices(){return this.geometry.getBuffer("aPosition").data}set vertices(e){this.geometry.getBuffer("aPosition").data=e;}_render(){this.autoUpdate&&this.geometry.getBuffer("aPosition").update();}};});function uM(r,e){let{width:t,height:i}=r.frame;return e.scale(1/t,1/i),e}var lM=f(()=>{});var cM,hM,dM=f(()=>{gt();ye();sp();pp();cM=class X1{constructor(e){if(e instanceof exports.Texture)this.texture=e,to(this,X1.defaultOptions,{});else {let t={...X1.defaultOptions,...e};to(this,t,{});}}get alpha(){return this._alpha}set alpha(e){this._alpha=Math.min(Math.max(e,0),1),this._updateColor();}get tint(){return es(this._tint)}set tint(e){typeof e=="number"?this._tint=e:this._tint=te.shared.setValue(e??16777215).toBgrNumber(),this._updateColor();}_updateColor(){this.color=this._tint+((this._alpha*255|0)<<24);}};cM.defaultOptions={anchorX:0,anchorY:0,x:0,y:0,scaleX:1,scaleY:1,rotation:0,tint:16777215,alpha:1};hM=cM;});var sf,Y1=f(()=>{sf={vertex:{attributeName:"aVertex",format:"float32x2",code:`
3231
3231
  const texture = p.texture;
3232
3232
  const sx = p.scaleX;
3233
3233
  const sy = p.scaleY;
@@ -3307,7 +3307,7 @@ fn setSaturation(c: vec3<f32>, s: f32) -> vec3<f32> {
3307
3307
  u32v[offset + stride] = c;
3308
3308
  u32v[offset + (stride * 2)] = c;
3309
3309
  u32v[offset + (stride * 3)] = c;
3310
- `,dynamic:false}};});var $F,fM,pM,mM=f(()=>{Lt();si();Y1();$F=new Ae(0,0,0,0),fM=class j1 extends lt{constructor(e={}){e={...j1.defaultOptions,...e,dynamicProperties:{...j1.defaultOptions.dynamicProperties,...e?.dynamicProperties}};let{dynamicProperties:t,shader:i,roundPixels:s,texture:n,particles:o,...a}=e;super({label:"ParticleContainer",...a}),this.renderPipeId="particle",this.batched=false,this._childrenDirty=false,this.texture=n||null,this.shader=i,this._properties={};for(let u in sf){let l=sf[u],c=t[u];this._properties[u]={...l,dynamic:c};}this.allowChildren=true,this.roundPixels=s??false,this.particleChildren=o??[];}addParticle(...e){for(let t=0;t<e.length;t++)this.particleChildren.push(e[t]);return this.onViewUpdate(),e[0]}removeParticle(...e){let t=false;for(let i=0;i<e.length;i++){let s=this.particleChildren.indexOf(e[i]);s>-1&&(this.particleChildren.splice(s,1),t=true);}return t&&this.onViewUpdate(),e[0]}update(){this._childrenDirty=true;}onViewUpdate(){this._childrenDirty=true,super.onViewUpdate();}get bounds(){return $F}updateBounds(){}destroy(e=false){if(super.destroy(e),typeof e=="boolean"?e:e?.texture){let i=typeof e=="boolean"?e:e?.textureSource,s=this.texture??this.particleChildren[0]?.texture;s&&s.destroy(i);}this.texture=null,this.shader?.destroy();}removeParticles(e,t){e??(e=0),t??(t=this.particleChildren.length);let i=this.particleChildren.splice(e,t-e);return this.onViewUpdate(),i}removeParticleAt(e){let t=this.particleChildren.splice(e,1);return this.onViewUpdate(),t[0]}addParticleAt(e,t){return this.particleChildren.splice(t,0,e),this.onViewUpdate(),e}addChild(...e){throw new Error("ParticleContainer.addChild() is not available. Please use ParticleContainer.addParticle()")}removeChild(...e){throw new Error("ParticleContainer.removeChild() is not available. Please use ParticleContainer.removeParticle()")}removeChildren(e,t){throw new Error("ParticleContainer.removeChildren() is not available. Please use ParticleContainer.removeParticles()")}removeChildAt(e){throw new Error("ParticleContainer.removeChildAt() is not available. Please use ParticleContainer.removeParticleAt()")}getChildAt(e){throw new Error("ParticleContainer.getChildAt() is not available. Please use ParticleContainer.getParticleAt()")}setChildIndex(e,t){throw new Error("ParticleContainer.setChildIndex() is not available. Please use ParticleContainer.setParticleIndex()")}getChildIndex(e){throw new Error("ParticleContainer.getChildIndex() is not available. Please use ParticleContainer.getParticleIndex()")}addChildAt(e,t){throw new Error("ParticleContainer.addChildAt() is not available. Please use ParticleContainer.addParticleAt()")}swapChildren(e,t){throw new Error("ParticleContainer.swapChildren() is not available. Please use ParticleContainer.swapParticles()")}reparentChild(...e){throw new Error("ParticleContainer.reparentChild() is not available with the particle container")}reparentChildAt(e,t){throw new Error("ParticleContainer.reparentChildAt() is not available with the particle container")}};fM.defaultOptions={dynamicProperties:{vertex:false,position:true,rotation:false,uvs:false,color:false},roundPixels:false};pM=fM;});var gM,$1,wb,_M=f(()=>{ws();ye();Pe();si();kg();gM=class xM extends lt{constructor(e){e instanceof exports.Texture&&(e={texture:e});let{width:t,height:i,anchor:s,leftWidth:n,rightWidth:o,topHeight:a,bottomHeight:u,texture:l,roundPixels:c,...h}=e;super({label:"NineSliceSprite",...h}),this.renderPipeId="nineSliceSprite",this.batched=true,this._leftWidth=n??l?.defaultBorders?.left??ci.defaultOptions.leftWidth,this._topHeight=a??l?.defaultBorders?.top??ci.defaultOptions.topHeight,this._rightWidth=o??l?.defaultBorders?.right??ci.defaultOptions.rightWidth,this._bottomHeight=u??l?.defaultBorders?.bottom??ci.defaultOptions.bottomHeight,this._width=t??l.width??ci.defaultOptions.width,this._height=i??l.height??ci.defaultOptions.height,this.allowChildren=false,this.texture=l??xM.defaultOptions.texture,this.roundPixels=c??false,this._anchor=new Ne({_onUpdate:()=>{this.onViewUpdate();}}),s?this.anchor=s:this.texture.defaultAnchor&&(this.anchor=this.texture.defaultAnchor);}get anchor(){return this._anchor}set anchor(e){typeof e=="number"?this._anchor.set(e):this._anchor.copyFrom(e);}get width(){return this._width}set width(e){this._width=e,this.onViewUpdate();}get height(){return this._height}set height(e){this._height=e,this.onViewUpdate();}setSize(e,t){typeof e=="object"&&(t=e.height??e.width,e=e.width),this._width=e,this._height=t??e,this.onViewUpdate();}getSize(e){return e||(e={}),e.width=this._width,e.height=this._height,e}get leftWidth(){return this._leftWidth}set leftWidth(e){this._leftWidth=e,this.onViewUpdate();}get topHeight(){return this._topHeight}set topHeight(e){this._topHeight=e,this.onViewUpdate();}get rightWidth(){return this._rightWidth}set rightWidth(e){this._rightWidth=e,this.onViewUpdate();}get bottomHeight(){return this._bottomHeight}set bottomHeight(e){this._bottomHeight=e,this.onViewUpdate();}get texture(){return this._texture}set texture(e){e||(e=exports.Texture.EMPTY);let t=this._texture;t!==e&&(t&&t.dynamic&&t.off("update",this.onViewUpdate,this),e.dynamic&&e.on("update",this.onViewUpdate,this),this._texture=e,this.onViewUpdate());}get originalWidth(){return this._texture.width}get originalHeight(){return this._texture.height}destroy(e){if(super.destroy(e),typeof e=="boolean"?e:e?.texture){let i=typeof e=="boolean"?e:e?.textureSource;this._texture.destroy(i);}this._texture=null;}updateBounds(){let e=this._bounds,t=this._anchor,i=this._width,s=this._height;e.minX=-t._x*i,e.maxX=e.minX+i,e.minY=-t._y*s,e.maxY=e.minY+s;}};gM.defaultOptions={texture:exports.Texture.EMPTY};$1=gM,wb=class extends $1{constructor(...e){let t=e[0];t instanceof exports.Texture&&(U(Y,"NineSlicePlane now uses the options object {texture, leftWidth, rightWidth, topHeight, bottomHeight}"),t={texture:t,leftWidth:e[1],topHeight:e[2],rightWidth:e[3],bottomHeight:e[4]}),U(Y,"NineSlicePlane is deprecated. Use NineSliceSprite instead."),super(t);}};});async function bM(r,e,t=200){let i=await e.extract.base64(r);await e.encoder.commandFinished;let s=t;console.log(`logging texture ${r.source.width}px ${r.source.height}px`);let n=["font-size: 1px;",`padding: ${s}px 300px;`,`background: url(${i}) no-repeat;`,"background-size: contain;"].join(" ");console.log("%c ",n);}var yM=f(()=>{});function q1(r,e=0,t={color:"#000000"}){r.renderGroup&&(t.color=qF[KF++]);let i="";for(let o=0;o<e;o++)i+=" ";let s=r.label;!s&&r instanceof exports.PixiJSSprite&&(s=`sprite:${r.texture.label}`);let n=`%c ${i}|- ${s} (worldX:${r.worldTransform.tx}, relativeRenderX:${r.relativeGroupTransform.tx}, renderX:${r.groupTransform.tx}, localX:${r.x})`;r.renderGroup&&(n+=" (RenderGroup)"),r.filters&&(n+="(*filters)"),console.log(n,`color:${t.color}; font-weight:bold;`),e++;for(let o=0;o<r.children.length;o++){let a=r.children[o];q1(a,e,{...t});}}function K1(r,e=0,t={index:0,color:"#000000"}){let i="";for(let n=0;n<e;n++)i+=" ";let s=`%c ${i}- ${t.index}: ${r.root.label} worldX:${r.worldTransform.tx}`;console.log(s,`color:${t.color}; font-weight:bold;`),e++;for(let n=0;n<r.renderGroupChildren.length;n++){let o=r.renderGroupChildren[n];K1(o,e,{...t,index:n});}}var qF,KF,vM=f(()=>{Ns();qF=["#000080","#228B22","#8B0000","#4169E1","#008080","#800000","#9400D3","#FF8C00","#556B2F","#8B008B"],KF=0;});var TM={};Zi(TM,{AbstractBitmapFont:()=>hn,AbstractRenderer:()=>Di,AbstractText:()=>Ni,AccessibilitySystem:()=>_p,AlphaFilter:()=>KB,AlphaMask:()=>uo,AlphaMaskPipe:()=>Qo,AnimatedSprite:()=>tc,Application:()=>_d,ApplicationInitHook:()=>Ko,Assets:()=>exports.Assets,AssetsClass:()=>Cd,BLEND_TO_NPM:()=>Up,BUFFER_TYPE:()=>Sa,BackgroundLoader:()=>wl,BackgroundSystem:()=>tx,Batch:()=>Qc,BatchGeometry:()=>Tu,BatchTextureArray:()=>vu,BatchableGraphics:()=>ls,BatchableHTMLText:()=>qu,BatchableMesh:()=>wi,BatchableSprite:()=>Yr,BatchableText:()=>Gu,Batcher:()=>zp,BatcherPipe:()=>sd,BigPool:()=>Ve,BindGroup:()=>_t,BindGroupSystem:()=>oa,BitmapFont:()=>Oa,BitmapFontManager:()=>fs,BitmapText:()=>sc,BitmapTextGraphics:()=>Ph,BitmapTextPipe:()=>Io,BlendModeFilter:()=>ue,BlendModePipe:()=>ta,BlurFilter:()=>$d,BlurFilterPass:()=>ec,Bounds:()=>Ae,BrowserAdapter:()=>Ap,Buffer:()=>tt,BufferImageSource:()=>rs,BufferResource:()=>Fi,BufferUsage:()=>he,CLEAR:()=>bt,Cache:()=>Se,CanvasPool:()=>sr,CanvasPoolClass:()=>Sh,CanvasSource:()=>At,CanvasTextGenerator:()=>ds,CanvasTextMetrics:()=>It,CanvasTextPipe:()=>Co,CanvasTextSystem:()=>Mo,Circle:()=>Uu,Color:()=>te,ColorBlend:()=>kh,ColorBurnBlend:()=>Oh,ColorDodgeBlend:()=>Fh,ColorMask:()=>lo,ColorMaskPipe:()=>Jo,ColorMatrixFilter:()=>lb,CompressedSource:()=>$r,Container:()=>exports.PixiJSContainer,Culler:()=>W_,CullerPlugin:()=>Dd,CustomRenderPipe:()=>Wo,D3D10_RESOURCE_DIMENSION:()=>F_,D3DFMT:()=>nr,DATA_URI:()=>Ow,DDS:()=>ne,DEG_TO_RAD:()=>zf,DEPRECATED_SCALE_MODES:()=>rf,DEPRECATED_WRAP_MODES:()=>tf,DOMAdapter:()=>j,DOMContainer:()=>Cp,DOMPipe:()=>oo,DRAW_MODES:()=>AR,DXGI_FORMAT:()=>O_,DXGI_TO_TEXTURE_FORMAT:()=>Zt,DarkenBlend:()=>Gh,DefaultBatcher:()=>mo,DefaultShader:()=>Pu,DifferenceBlend:()=>Uh,DisplacementFilter:()=>db,DivideBlend:()=>Lh,DynamicBitmapFont:()=>Ch,Ellipse:()=>Lu,EventBoundary:()=>du,EventEmitter:()=>_e,EventSystem:()=>fu,EventsTicker:()=>Gr,ExclusionBlend:()=>Nh,ExtensionType:()=>x,ExtractSystem:()=>rx,FOURCC_TO_TEXTURE_FORMAT:()=>Rd,FederatedContainer:()=>Ep,FederatedEvent:()=>Ci,FederatedMouseEvent:()=>ii,FederatedPointerEvent:()=>Nt,FederatedWheelEvent:()=>Ur,FillGradient:()=>qt,FillPattern:()=>ui,Filter:()=>Dt,FilterEffect:()=>ei,FilterPipe:()=>Uo,FilterSystem:()=>Lo,FontStylePromiseCache:()=>Ku,GAUSSIAN_VALUES:()=>Jl,GL_FORMATS:()=>bl,GL_INTERNAL_FORMAT:()=>XE,GL_TARGETS:()=>hd,GL_TYPES:()=>Ee,GL_WRAP_MODES:()=>y2,GenerateTextureSystem:()=>ra,Geometry:()=>jt,GlBackBufferSystem:()=>Dx,GlBatchAdaptor:()=>Ta,GlBuffer:()=>_l,GlBufferSystem:()=>Ea,GlColorMaskSystem:()=>Aa,GlContextSystem:()=>Rx,GlEncoderSystem:()=>Pa,GlGeometrySystem:()=>Ca,GlGraphicsAdaptor:()=>ya,GlLimitsSystem:()=>wa,GlMeshAdaptor:()=>va,GlParticleContainerAdaptor:()=>Iu,GlParticleContainerPipe:()=>To,GlProgram:()=>je,GlProgramData:()=>Tl,GlRenderTarget:()=>yl,GlRenderTargetAdaptor:()=>vl,GlRenderTargetSystem:()=>Ma,GlShaderSystem:()=>Ia,GlStateSystem:()=>e_,GlStencilSystem:()=>Ba,GlTexture:()=>El,GlTextureSystem:()=>ka,GlUboSystem:()=>Ra,GlUniformGroupSystem:()=>Da,GlobalUniformSystem:()=>ia,GpuBatchAdaptor:()=>zo,GpuBlendModesToPixi:()=>zt,GpuBufferSystem:()=>aa,GpuColorMaskSystem:()=>ua,GpuDeviceSystem:()=>Tn,GpuEncoderSystem:()=>la,GpuGraphicsAdaptor:()=>Ho,GpuGraphicsContext:()=>hh,GpuLimitsSystem:()=>ca,GpuMeshAdapter:()=>Vo,GpuMipmapGenerator:()=>xl,GpuParticleContainerAdaptor:()=>Ou,GpuParticleContainerPipe:()=>So,GpuProgram:()=>$e,GpuRenderTarget:()=>pl,GpuRenderTargetAdaptor:()=>ml,GpuRenderTargetSystem:()=>ga,GpuShaderSystem:()=>xa,GpuStateSystem:()=>_a,GpuStencilModesToPixi:()=>jr,GpuStencilSystem:()=>ha,GpuTextureSystem:()=>ba,GpuUboSystem:()=>fa,GpuUniformBatchPipe:()=>pa,Graphics:()=>cn,GraphicsContext:()=>dt,GraphicsContextRenderData:()=>dh,GraphicsContextSystem:()=>rn,GraphicsGpuData:()=>ph,GraphicsPath:()=>Bi,GraphicsPipe:()=>yo,HTMLText:()=>nc,HTMLTextPipe:()=>Do,HTMLTextRenderData:()=>dn,HTMLTextStyle:()=>fn,HTMLTextSystem:()=>ko,HardLightBlend:()=>Hh,HardMixBlend:()=>Vh,HelloSystem:()=>vn,IGLUniformData:()=>Lx,ImageSource:()=>Yt,InstructionSet:()=>Is,KTX:()=>nt,LightenBlend:()=>zh,LinearBurnBlend:()=>Wh,LinearDodgeBlend:()=>Xh,LinearLightBlend:()=>Yh,Loader:()=>Rl,LoaderParserPriority:()=>ze,LuminosityBlend:()=>jh,MaskEffectManager:()=>nu,MaskEffectManagerClass:()=>kc,MaskFilter:()=>sl,Matrix:()=>G,Mesh:()=>_r,MeshGeometry:()=>fr,MeshGpuData:()=>Mu,MeshPipe:()=>vo,MeshPlane:()=>Cb,MeshRope:()=>nM,MeshSimple:()=>Pb,NOOP:()=>Uc,NegationBlend:()=>$h,NineSliceGeometry:()=>ci,NineSlicePlane:()=>wb,NineSliceSprite:()=>$1,NineSliceSpriteGpuData:()=>Mh,NineSliceSpritePipe:()=>Go,NoiseFilter:()=>nR,ObservablePoint:()=>Ne,OverlayBlend:()=>qh,PI_2:()=>Hf,Particle:()=>hM,ParticleBuffer:()=>Du,ParticleContainer:()=>pM,ParticleContainerPipe:()=>sn,ParticleShader:()=>ku,PerspectiveMesh:()=>QR,PerspectivePlaneGeometry:()=>ac,PinLightBlend:()=>Kh,PipelineSystem:()=>ma,PlaneGeometry:()=>gn,Point:()=>me,Polygon:()=>on,Pool:()=>Ji,PoolGroupClass:()=>Ic,PrepareBase:()=>mb,PrepareQueue:()=>ic,PrepareSystem:()=>ef,PrepareUpload:()=>oc,QuadGeometry:()=>Ju,RAD_TO_DEG:()=>Vf,Rectangle:()=>exports.Rectangle,RenderContainer:()=>vb,RenderGroup:()=>lu,RenderGroupPipe:()=>Yo,RenderGroupSystem:()=>$o,RenderLayer:()=>XR,RenderTarget:()=>na,RenderTargetSystem:()=>Cn,RenderTexture:()=>nl,RenderableGCSystem:()=>ox,RendererInitHook:()=>Zo,RendererType:()=>qe,ResizePlugin:()=>io,Resolver:()=>Vt,RopeGeometry:()=>Ab,RoundedRectangle:()=>Nu,SCALE_MODES:()=>BR,STENCIL_MODES:()=>He,SVGParser:()=>eg,SaturationBlend:()=>Zh,SchedulerSystem:()=>sa,ScissorMask:()=>bb,SdfShader:()=>ju,Shader:()=>rt,ShaderStage:()=>$s,ShapePath:()=>Wu,SharedRenderPipes:()=>ll,SharedSystems:()=>ul,SoftLightBlend:()=>Qh,Sprite:()=>exports.PixiJSSprite,SpritePipe:()=>qo,Spritesheet:()=>jc,State:()=>Qe,StencilMask:()=>co,StencilMaskPipe:()=>ea,SubtractBlend:()=>Jh,SystemRunner:()=>bn,TEXTURE_FORMAT_BLOCK_SIZE:()=>G_,Text:()=>exports.PixiJSText,TextStyle:()=>Mt,Texture:()=>exports.Texture,TextureGCSystem:()=>ax,TextureMatrix:()=>ks,TexturePool:()=>Me,TexturePoolClass:()=>Lc,TextureSource:()=>ge,TextureStyle:()=>xt,TextureUvs:()=>yb,Ticker:()=>Ie,TickerListener:()=>Fs,TickerPlugin:()=>no,TilingSprite:()=>xb,TilingSpriteGpuData:()=>Bh,TilingSpritePipe:()=>Fo,TilingSpriteShader:()=>Qu,Transform:()=>rc,Triangle:()=>pb,UNIFORM_TO_ARRAY_SETTERS:()=>Zx,UNIFORM_TO_SINGLE_SETTERS:()=>Kx,UNIFORM_TYPES_MAP:()=>hm,UNIFORM_TYPES_VALUES:()=>sh,UPDATE_BLEND:()=>cu,UPDATE_COLOR:()=>ro,UPDATE_PRIORITY:()=>exports.UPDATE_PRIORITY,UPDATE_TRANSFORM:()=>fA,UPDATE_VISIBLE:()=>Os,UboBatch:()=>dl,UboSystem:()=>Sn,UniformGroup:()=>xe,VERSION:()=>yn,VideoSource:()=>zs,ViewContainer:()=>lt,ViewSystem:()=>cx,ViewableBuffer:()=>Lr,VividLightBlend:()=>ed,WGSL_ALIGN_SIZE_DATA:()=>da,WGSL_TO_STD40_SIZE:()=>dd,WRAP_MODES:()=>wR,WebGLRenderer:()=>xd,WebGPURenderer:()=>cd,WebWorkerAdapter:()=>YB,WorkerManager:()=>Ed,accessibilityTarget:()=>bp,addBits:()=>eh,addMaskBounds:()=>Hs,addMaskLocalBounds:()=>Vs,addProgramDefines:()=>jp,alphaFrag:()=>tb,alphaWgsl:()=>jd,applyMatrix:()=>Mg,applyProjectiveTransformationToPlane:()=>Tb,applyStyleParams:()=>gd,assignWithIgnore:()=>to,autoDetectEnvironment:()=>Rw,autoDetectRenderer:()=>c_,autoDetectSource:()=>HA,basisTranscoderUrls:()=>Nl,bgr2rgb:()=>es,bitmapFontCachePlugin:()=>h_,bitmapFontTextParser:()=>Pl,bitmapFontXMLParser:()=>bd,bitmapFontXMLStringParser:()=>yd,blendTemplateFrag:()=>Fg,blendTemplateVert:()=>Gg,blendTemplateWgsl:()=>Ug,blockDataMap:()=>ld,blurTemplateWgsl:()=>ob,boundsPool:()=>ir,browserExt:()=>YT,buildAdaptiveBezier:()=>Vu,buildAdaptiveQuadratic:()=>Wm,buildArc:()=>zu,buildArcTo:()=>Ym,buildArcToSvg:()=>jm,buildCircle:()=>tn,buildContextBatches:()=>Dm,buildEllipse:()=>xm,buildLine:()=>Tm,buildPixelLine:()=>Sm,buildPolygon:()=>Bm,buildRectangle:()=>Rm,buildRoundedRectangle:()=>_m,buildSimpleUvs:()=>mm,buildTriangle:()=>Mm,buildUvs:()=>pm,cacheAsTextureMixin:()=>jf,cacheTextureArray:()=>f_,calculateProjection:()=>Sx,checkChildrenDidChange:()=>Fc,checkDataUrl:()=>pr,checkExtension:()=>it,checkMaxIfStatementsInShader:()=>bu,childrenHelperMixin:()=>qf,cleanArray:()=>nx,cleanHash:()=>sx,clearList:()=>jo,closePointEps:()=>bm,collectAllRenderables:()=>GR,collectRenderablesMixin:()=>Kf,color32BitToUniform:()=>Xr,colorBit:()=>Ks,colorBitGl:()=>Zs,colorMatrixFilterFrag:()=>ub,colorMatrixFilterWgsl:()=>qd,colorToUniform:()=>yP,compareModeToGlCompare:()=>o_,compileHighShader:()=>im,compileHighShaderGl:()=>sm,compileHighShaderGlProgram:()=>Hr,compileHighShaderGpuProgram:()=>Nr,compileHooks:()=>th,compileInputs:()=>rh,compileOutputs:()=>rm,compileShader:()=>fd,compute2DProjection:()=>Eb,convertFormatIfRequired:()=>L3,convertToList:()=>Ht,copySearchParams:()=>ao,createIdFromString:()=>ai,createIndicesForQuads:()=>gh,createLevelBuffers:()=>C3,createLevelBuffersFromKTX:()=>H3,createStringVariations:()=>Pp,createTexture:()=>Kt,createUboElementsSTD40:()=>kx,createUboElementsWGSL:()=>fx,createUboSyncFunction:()=>cl,createUboSyncFunctionSTD40:()=>Gx,createUboSyncFunctionWGSL:()=>yx,crossOrigin:()=>DE,cullingMixin:()=>Nf,curveEps:()=>ym,defaultFilterVert:()=>Mn,defaultValue:()=>Sl,definedProps:()=>Rt,deprecation:()=>U,detectAvif:()=>m_,detectBasis:()=>_3,detectCompressed:()=>$3,detectDefaults:()=>g_,detectMp4:()=>x_,detectOgv:()=>__,detectVideoAlphaMode:()=>gu,detectWebm:()=>b_,detectWebp:()=>y_,determineCrossOrigin:()=>OE,displacementFrag:()=>cb,displacementVert:()=>hb,displacementWgsl:()=>Kd,earcut:()=>Pm,effectsMixin:()=>Zf,ensureAttributes:()=>fl,ensureIsBuffer:()=>Jc,ensurePrecision:()=>$p,ensureTextOptions:()=>In,executeInstructions:()=>Xo,extensions:()=>V,extractAttributesFromGlProgram:()=>Wx,extractAttributesFromGpuProgram:()=>Qp,extractFontFamilies:()=>yg,extractStructAndGroups:()=>Eu,extractSvgUrlId:()=>vh,fastCopy:()=>po,findMixin:()=>Qf,fontStringFromTextStyle:()=>hs,formatShader:()=>_R,fragmentGPUTemplate:()=>om,fragmentGlTemplate:()=>um,generateArraySyncSTD40:()=>Fx,generateArraySyncWGSL:()=>bx,generateBlurFragSource:()=>ib,generateBlurGlProgram:()=>nb,generateBlurProgram:()=>ab,generateBlurVertSource:()=>sb,generateGPULayout:()=>pR,generateGpuLayoutGroups:()=>Jp,generateLayout:()=>gR,generateLayoutHash:()=>em,generateParticleUpdateFunction:()=>km,generateProgram:()=>$x,generateShaderSyncCode:()=>Ux,generateTextStyleKey:()=>rg,generateTextureBatchBit:()=>Qs,generateTextureBatchBitGl:()=>Js,generateTextureMatrix:()=>Im,generateUniformsSync:()=>Qx,getAdjustedBlendModeBlend:()=>oi,getAttributeInfoFromFormat:()=>$t,getBatchSamplersUniformGroup:()=>en,getBitmapTextLayout:()=>$u,getCanvasBoundingBox:()=>sg,getCanvasFillStyle:()=>ln,getCanvasTexture:()=>al,getDefaultUniformValue:()=>dm,getFastGlobalBounds:()=>kR,getFastGlobalBoundsMixin:()=>ep,getFontCss:()=>Tg,getFontFamilyName:()=>AE,getGeometryBounds:()=>Wp,getGlTypeFromFormat:()=>Ix,getGlobalBounds:()=>Ei,getGlobalMixin:()=>ip,getGlobalRenderableBounds:()=>Og,getLocalBounds:()=>Ms,getMaxFragmentPrecision:()=>Yp,getMaxTexturesPerBatch:()=>Vp,getOrientationOfPoints:()=>vm,getPo2TextureFromSource:()=>Yu,getResolutionOfUrl:()=>wn,getSVGUrl:()=>Sg,getSupportedCompressedTextureFormats:()=>Gl,getSupportedGPUCompressedTextureFormats:()=>Pd,getSupportedGlCompressedTextureFormats:()=>Ad,getSupportedTextureFormats:()=>Gi,getTemporaryCanvasFromImage:()=>Eg,getTestContext:()=>_u,getTextureBatchBindGroup:()=>Ws,getTextureDefaultMatrix:()=>uM,getTextureFormatFromKTXTexture:()=>z3,getUboData:()=>Xx,getUniformData:()=>Yx,getUrlExtension:()=>Xy,glFormatToGPUFormat:()=>H_,glUploadBufferImageResource:()=>t_,glUploadCompressedTextureResource:()=>r_,glUploadImageResource:()=>Cl,glUploadVideoResource:()=>s_,globalUniformsBit:()=>lm,globalUniformsBitGl:()=>cm,globalUniformsUBOBitGl:()=>tP,gpuFormatToBasisTranscoderFormat:()=>P3,gpuFormatToKTXBasisTranscoderFormat:()=>X3,gpuUploadBufferImageResource:()=>Ax,gpuUploadCompressedTextureResource:()=>Px,gpuUploadImageResource:()=>gl,gpuUploadVideoResource:()=>Bx,groupD8:()=>be,hasCachedCanvasTexture:()=>Ww,hslWgsl:()=>aR,hslgl:()=>xn,hslgpu:()=>_n,injectBits:()=>ih,insertVersion:()=>qp,isMobile:()=>gp,isPow2:()=>Gc,isRenderingToScreen:()=>Ex,isSafari:()=>gg,isSingleItem:()=>ss,isWebGLSupported:()=>ki,isWebGPUSupported:()=>Oi,ktxTranscoderUrls:()=>Vl,loadBasis:()=>S3,loadBasisOnWorker:()=>k_,loadBitmapFont:()=>d_,loadDDS:()=>B3,loadEnvironmentExtensions:()=>td,loadFontAsBase64:()=>vg,loadFontCSS:()=>wh,loadImageBitmap:()=>IE,loadJson:()=>v_,loadKTX:()=>M3,loadKTX2:()=>F3,loadKTX2onWorker:()=>N_,loadSVGImage:()=>Cg,loadSvg:()=>E_,loadTextures:()=>kl,loadTxt:()=>T_,loadVideoTextures:()=>A_,loadWebFont:()=>S_,localUniformBit:()=>ps,localUniformBitGl:()=>mn,localUniformBitGroup2:()=>Pg,localUniformMSDFBit:()=>ug,localUniformMSDFBitGl:()=>lg,log2:()=>nA,logDebugTexture:()=>bM,logProgramError:()=>jx,logRenderGroupScene:()=>K1,logScene:()=>q1,mSDFBit:()=>cg,mSDFBitGl:()=>hg,mapFormatToGlFormat:()=>a_,mapFormatToGlInternalFormat:()=>u_,mapFormatToGlType:()=>l_,mapGlToVertexFormat:()=>Vx,mapSize:()=>SR,mapType:()=>pd,mapWebGLBlendModesToPixi:()=>Jx,maskFrag:()=>Jg,maskVert:()=>ex,maskWgsl:()=>nd,matrixPool:()=>ut,measureHtmlText:()=>Zu,measureMixin:()=>np,migrateFragmentFromV7toV8:()=>vR,mipmapScaleModeToGlFilter:()=>n_,multiplyColors:()=>Rs,multiplyHexColors:()=>au,nextPow2:()=>ti,noiseFrag:()=>fb,noiseWgsl:()=>Zd,nonCompressedFormats:()=>NE,normalizeExtensionPriority:()=>ru,onRenderMixin:()=>op,parseDDS:()=>U_,parseFunctionBody:()=>IR,parseKTX:()=>L_,parseSVGDefinitions:()=>Qm,parseSVGFloatAttribute:()=>Ke,parseSVGPath:()=>Lm,parseSVGStyle:()=>Th,particleData:()=>sf,particlesFrag:()=>Om,particlesVert:()=>Fm,particlesWgsl:()=>xh,path:()=>We,pointInTriangle:()=>Qd,preloadVideo:()=>kE,removeItems:()=>su,removeStructAndGroupDuplicates:()=>tm,resetUids:()=>JC,resolveCharacters:()=>pg,resolveCompressedTextureUrl:()=>j3,resolveJsonUrl:()=>w_,resolveTextureUrl:()=>Ol,resourceToTexture:()=>t0,roundPixelsBit:()=>Vr,roundPixelsBitGl:()=>zr,roundedShapeArc:()=>$m,roundedShapeQuadraticCurve:()=>qm,sayHello:()=>ix,scaleModeToGlFilter:()=>md,setBasisTranscoderPath:()=>v3,setKTXTranscoderPath:()=>k3,setPositions:()=>Rg,setProgramName:()=>Kp,setUvs:()=>Ig,shapeBuilders:()=>Ru,sortMixin:()=>ap,spritesheetAsset:()=>Bp,squaredDistanceToLineSegment:()=>nn,stripVersion:()=>Zp,styleAttributes:()=>Jm,testImageFormat:()=>Bl,testVideoFormat:()=>An,textStyleToCSS:()=>_g,textureBit:()=>zg,textureBitGl:()=>Wg,textureFrom:()=>r0,tilingBit:()=>wg,tilingBitGl:()=>Bg,toFillStyle:()=>li,toLocalGlobalMixin:()=>up,toStrokeStyle:()=>an,transformVertices:()=>oh,triangulateWithHoles:()=>Bu,uboSyncFunctionsSTD40:()=>ad,uboSyncFunctionsWGSL:()=>xx,uid:()=>ce,uniformParsers:()=>hi,unpremultiplyAlpha:()=>r3,unsafeEvalSupported:()=>el,updateLocalTransform:()=>LR,updateQuadBounds:()=>mu,updateRenderGroupTransform:()=>nS,updateRenderGroupTransforms:()=>id,updateTextBounds:()=>Eo,updateTransformAndChildren:()=>qg,updateTransformBackwards:()=>ou,updateWorldTransform:()=>HR,v8_0_0:()=>Y,v8_3_4:()=>Xf,validFormats:()=>zl,validateRenderables:()=>Kg,vertexGPUTemplate:()=>nm,vertexGlTemplate:()=>am,vkFormatToGPUFormat:()=>V_,warn:()=>N,webworkerExt:()=>jT,wrapModeToGlAddress:()=>Al});var ke=f(()=>{sw();ow();B();B();Op();Rp();Ry();My();lw();cw();hw();dw();fw();pw();mw();gw();xw();_w();bw();yw();vw();Tw();Sw();Ew();Cw();Aw();Pw();ww();Bw();c3();Iy();ky();x3();mE();Ai();gE();xE();_E();bE();yE();vE();TE();p_();vd();SE();Er();EE();CE();PE();wE();C_();FE();ms();ME();GE();P_();Ls();Pn();wr();pu();wp();Wy();Xc();gt();b3();E3();A3();w3();HE();VE();zE();R3();WE();I3();jE();YE();G3();N3();V3();W3();ZE();Y3();$E();QE();qE();q3();JE();t1();K3();ny();DA();Vy();Ge();JT();zy();jB();Uy();Sp();yp();Nc();Hy();Vc();vp();Tp();qT();KT();ZT();uR();x1();_1();T1();C1();A1();Yd();P1();w1();B1();R1();M1();dS();fS();pS();at();Ih();Dh();ZB();eR();E1();rb();b1();v1();y1();S1();tR();rR();oR();Ii();Dc();HT();WT();mS();hp();Te();Wf();uu();Nm();ws();cr();I1();kv();Ov();Fv();ct();Gv();lR();D1();G1();fR();N1();p2();Hp();s0();mR();xR();Kc();rS();a0();hS();c0();n0();fm();H0();as();k0();w0();B0();R0();M0();bR();I0();O0();Cu();Au();F0();Oo();us();Xg();$y();xS();qy();_S();cy();yR();Ky();bS();$c();qc();uE();m2();g2();x2();No();b2();T2();v2();E2();C2();A2();P2();I2();w2();M2();D2();k2();O2();nh();dr();F2();W2();j2();TR();G2();Nx();vx();L2();z2();d0();Np();N2();H2();V2();ER();zx();f0();p0();m0();g0();x0();Ox();R2();B2();Y2();X2();K2();$2();Mx();Z2();oE();Q2();J2();i_();eE();rE();UE();iE();sE();nE();tE();i3();aE();LS();NS();qS();HS();VS();zS();WS();XS();$S();KS();ZS();QS();e2();t2();r2();ns();Cr();i2();px();jS();v0();T0();YS();E0();C0();A0();s2();n2();Tx();c2();o2();a2();wx();u2();LE();l2();h2();vS();TS();os();ud();Pi();Gp();CS();PS();PR();Ys();z0();u0();js();l0();W0();lp();wS();JS();ux();Cx();BS();S0();Wr();L0();dx();ht();gx();N0();_x();mx();MS();Xs();xu();Pr();tl();hx();Ng();wo();RR();kS();AS();dp();ho();Fl();fo();Ct();kp();ye();FS();fp();ri();ts();MR();lx();I_();Ul();i0();Su();DR();US();Ar();Tv();Sv();Ev();Lt();OR();Kn();Oc();VT();Bs();ay();uy();ly();hy();dy();fy();sp();my();gy();xy();_y();hr();iS();FR();vy();sS();uS();pp();py();$g();UR();Ds();jg();rp();tp();NR();oS();VR();aS();d2();bo();eS();gm();zm();Hv();Xm();Vv();Xv();X0();j0();$0();Q0();J0();ev();aP();_o();_h();ag();Po();fh();pv();Km();Yv();jv();$v();Zm();Dv();Kv();Zv();qv();sv();tg();iv();Y0();wm();YR();JR();z1();H1();V1();eM();Rh();oM();aM();W1();f2();tS();mh();lM();Ga();pn();gv();_v();Pv();Av();wv();dM();vv();mM();Gm();Y1();Cv();bv();yv();k1();kg();_M();LT();BT();IT();F1();GT();OT();DT();kT();FT();Fu();Ns();lS();dg();hE();dE();fE();pE();cE();Ah();U1();pT();hT();fg();dT();gT();L1();xT();xg();bg();PT();yT();ST();ET();CT();vT();TT();AT();Ag();bT();Jd();Rv();og();Ro();Mv();sT();Eh();ng();cT();oT();aT();_b();un();Jv();ig();Um();si();Yy();jy();so();Gs();Dy();Ip();wy();_T();rl();il();Lg();tT();Zg();Ut();IS();$f();Et();Mp();Fp();Qg();Pe();yM();vM();Be();yy();O1();Td();Us();Yf();Si();RS();Z0();V.add(YT,jT);});var IM=Qr((Ub,MM)=>{(function(r,e){typeof Ub=="object"?MM.exports=Ub=e():typeof define=="function"&&define.amd?define([],e):r.CryptoJS=e();})(Ub,function(){var r=r||function(e,t){var i;if(typeof window<"u"&&window.crypto&&(i=window.crypto),typeof self<"u"&&self.crypto&&(i=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(i=globalThis.crypto),!i&&typeof window<"u"&&window.msCrypto&&(i=window.msCrypto),!i&&typeof global<"u"&&global.crypto&&(i=global.crypto),!i&&typeof Kb=="function")try{i=Kb("crypto");}catch{}var s=function(){if(i){if(typeof i.getRandomValues=="function")try{return i.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof i.randomBytes=="function")try{return i.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},n=Object.create||function(){function g(){}return function(y){var S;return g.prototype=y,S=new g,g.prototype=null,S}}(),o={},a=o.lib={},u=a.Base=function(){return {extend:function(g){var y=n(this);return g&&y.mixIn(g),(!y.hasOwnProperty("init")||this.init===y.init)&&(y.init=function(){y.$super.init.apply(this,arguments);}),y.init.prototype=y,y.$super=this,y},create:function(){var g=this.extend();return g.init.apply(g,arguments),g},init:function(){},mixIn:function(g){for(var y in g)g.hasOwnProperty(y)&&(this[y]=g[y]);g.hasOwnProperty("toString")&&(this.toString=g.toString);},clone:function(){return this.init.prototype.extend(this)}}}(),l=a.WordArray=u.extend({init:function(g,y){g=this.words=g||[],y!=t?this.sigBytes=y:this.sigBytes=g.length*4;},toString:function(g){return (g||h).stringify(this)},concat:function(g){var y=this.words,S=g.words,E=this.sigBytes,F=g.sigBytes;if(this.clamp(),E%4)for(var T=0;T<F;T++){var C=S[T>>>2]>>>24-T%4*8&255;y[E+T>>>2]|=C<<24-(E+T)%4*8;}else for(var A=0;A<F;A+=4)y[E+A>>>2]=S[A>>>2];return this.sigBytes+=F,this},clamp:function(){var g=this.words,y=this.sigBytes;g[y>>>2]&=4294967295<<32-y%4*8,g.length=e.ceil(y/4);},clone:function(){var g=u.clone.call(this);return g.words=this.words.slice(0),g},random:function(g){for(var y=[],S=0;S<g;S+=4)y.push(s());return new l.init(y,g)}}),c=o.enc={},h=c.Hex={stringify:function(g){for(var y=g.words,S=g.sigBytes,E=[],F=0;F<S;F++){var T=y[F>>>2]>>>24-F%4*8&255;E.push((T>>>4).toString(16)),E.push((T&15).toString(16));}return E.join("")},parse:function(g){for(var y=g.length,S=[],E=0;E<y;E+=2)S[E>>>3]|=parseInt(g.substr(E,2),16)<<24-E%8*4;return new l.init(S,y/2)}},d=c.Latin1={stringify:function(g){for(var y=g.words,S=g.sigBytes,E=[],F=0;F<S;F++){var T=y[F>>>2]>>>24-F%4*8&255;E.push(String.fromCharCode(T));}return E.join("")},parse:function(g){for(var y=g.length,S=[],E=0;E<y;E++)S[E>>>2]|=(g.charCodeAt(E)&255)<<24-E%4*8;return new l.init(S,y)}},p=c.Utf8={stringify:function(g){try{return decodeURIComponent(escape(d.stringify(g)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(g){return d.parse(unescape(encodeURIComponent(g)))}},m=a.BufferedBlockAlgorithm=u.extend({reset:function(){this._data=new l.init,this._nDataBytes=0;},_append:function(g){typeof g=="string"&&(g=p.parse(g)),this._data.concat(g),this._nDataBytes+=g.sigBytes;},_process:function(g){var y,S=this._data,E=S.words,F=S.sigBytes,T=this.blockSize,C=T*4,A=F/C;g?A=e.ceil(A):A=e.max((A|0)-this._minBufferSize,0);var P=A*T,M=e.min(P*4,F);if(P){for(var k=0;k<P;k+=T)this._doProcessBlock(E,k);y=E.splice(0,P),S.sigBytes-=M;}return new l.init(y,M)},clone:function(){var g=u.clone.call(this);return g._data=this._data.clone(),g},_minBufferSize:0});a.Hasher=m.extend({cfg:u.extend(),init:function(g){this.cfg=this.cfg.extend(g),this.reset();},reset:function(){m.reset.call(this),this._doReset();},update:function(g){return this._append(g),this._process(),this},finalize:function(g){g&&this._append(g);var y=this._doFinalize();return y},blockSize:512/32,_createHelper:function(g){return function(y,S){return new g.init(S).finalize(y)}},_createHmacHelper:function(g){return function(y,S){return new _.HMAC.init(g,S).finalize(y)}}});var _=o.algo={};return o}(Math);return r});});var iC=Qr((Lb,DM)=>{(function(r,e){typeof Lb=="object"?DM.exports=Lb=e(IM()):typeof define=="function"&&define.amd?define(["./core"],e):e(r.CryptoJS);})(Lb,function(r){return function(){var e=r,t=e.lib,i=t.WordArray,s=t.Hasher,n=e.algo,o=[],a=n.SHA1=s.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878,3285377520]);},_doProcessBlock:function(u,l){for(var c=this._hash.words,h=c[0],d=c[1],p=c[2],m=c[3],b=c[4],_=0;_<80;_++){if(_<16)o[_]=u[l+_]|0;else {var g=o[_-3]^o[_-8]^o[_-14]^o[_-16];o[_]=g<<1|g>>>31;}var y=(h<<5|h>>>27)+b+o[_];_<20?y+=(d&p|~d&m)+1518500249:_<40?y+=(d^p^m)+1859775393:_<60?y+=(d&p|d&m|p&m)-1894007588:y+=(d^p^m)-899497514,b=m,m=p,p=d<<30|d>>>2,d=h,h=y;}c[0]=c[0]+h|0,c[1]=c[1]+d|0,c[2]=c[2]+p|0,c[3]=c[3]+m|0,c[4]=c[4]+b|0;},_doFinalize:function(){var u=this._data,l=u.words,c=this._nDataBytes*8,h=u.sigBytes*8;return l[h>>>5]|=128<<24-h%32,l[(h+64>>>9<<4)+14]=Math.floor(c/4294967296),l[(h+64>>>9<<4)+15]=c,u.sigBytes=l.length*4,this._process(),this._hash},clone:function(){var u=s.clone.call(this);return u._hash=this._hash.clone(),u}});e.SHA1=s._createHelper(a),e.HmacSHA1=s._createHmacHelper(a);}(),r.SHA1});});var hI=Qr((CC,cI)=>{(function(r,e){var t=e(r);if(typeof define=="function"&&define.amd)define("DeepDiff",function(){return t});else if(typeof CC=="object"||typeof navigator=="object"&&navigator.product.match(/ReactNative/i))cI.exports=t;else {var i=r.DeepDiff;t.noConflict=function(){return r.DeepDiff===t&&(r.DeepDiff=i),t},r.DeepDiff=t;}})(CC,function(r){var e=["N","E","A","D"];function t(T,C){T.super_=C,T.prototype=Object.create(C.prototype,{constructor:{value:T,enumerable:false,writable:true,configurable:true}});}function i(T,C){Object.defineProperty(this,"kind",{value:T,enumerable:true}),C&&C.length&&Object.defineProperty(this,"path",{value:C,enumerable:true});}function s(T,C,A){s.super_.call(this,"E",T),Object.defineProperty(this,"lhs",{value:C,enumerable:true}),Object.defineProperty(this,"rhs",{value:A,enumerable:true});}t(s,i);function n(T,C){n.super_.call(this,"N",T),Object.defineProperty(this,"rhs",{value:C,enumerable:true});}t(n,i);function o(T,C){o.super_.call(this,"D",T),Object.defineProperty(this,"lhs",{value:C,enumerable:true});}t(o,i);function a(T,C,A){a.super_.call(this,"A",T),Object.defineProperty(this,"index",{value:C,enumerable:true}),Object.defineProperty(this,"item",{value:A,enumerable:true});}t(a,i);function u(T,C,A){var P=T.slice((C)+1||T.length);return T.length=C<0?T.length+C:C,T.push.apply(T,P),T}function l(T){var C=typeof T;return C!=="object"?C:T===Math?"math":T===null?"null":Array.isArray(T)?"array":Object.prototype.toString.call(T)==="[object Date]"?"date":typeof T.toString=="function"&&/^\/.*\//.test(T.toString())?"regexp":"object"}function c(T){var C=0;if(T.length===0)return C;for(var A=0;A<T.length;A++){var P=T.charCodeAt(A);C=(C<<5)-C+P,C=C&C;}return C}function h(T){var C=0,A=l(T);if(A==="array"){T.forEach(function(pe){C+=h(pe);});var P="[type: array, hash: "+C+"]";return C+c(P)}if(A==="object"){for(var M in T)if(T.hasOwnProperty(M)){var k="[ type: object, key: "+M+", value hash: "+h(T[M])+"]";C+=c(k);}return C}var L="[ type: "+A+" ; value: "+T+"]";return C+c(L)}function d(T,C,A,P,M,k,L,pe){A=A||[],M=M||[],L=L||[];var ve=M.slice(0);if(typeof k<"u"&&k!==null){if(P){if(typeof P=="function"&&P(ve,k))return;if(typeof P=="object"){if(P.prefilter&&P.prefilter(ve,k))return;if(P.normalize){var Or=P.normalize(ve,k,T,C);Or&&(T=Or[0],C=Or[1]);}}}ve.push(k);}l(T)==="regexp"&&l(C)==="regexp"&&(T=T.toString(),C=C.toString());var X=typeof T,Q=typeof C,Ye,Re,mt,Zr,As=X!=="undefined"||L&&L.length>0&&L[L.length-1].lhs&&Object.getOwnPropertyDescriptor(L[L.length-1].lhs,k),Ps=Q!=="undefined"||L&&L.length>0&&L[L.length-1].rhs&&Object.getOwnPropertyDescriptor(L[L.length-1].rhs,k);if(!As&&Ps)A.push(new n(ve,C));else if(!Ps&&As)A.push(new o(ve,T));else if(l(T)!==l(C))A.push(new s(ve,T,C));else if(l(T)==="date"&&T-C!==0)A.push(new s(ve,T,C));else if(X==="object"&&T!==null&&C!==null){for(Ye=L.length-1;Ye>-1;--Ye)if(L[Ye].lhs===T){Zr=true;break}if(Zr)T!==C&&A.push(new s(ve,T,C));else {if(L.push({lhs:T,rhs:C}),Array.isArray(T)){for(pe&&(T.sort(function(Ki,eu){return h(Ki)-h(eu)}),C.sort(function(Ki,eu){return h(Ki)-h(eu)})),Ye=C.length-1,Re=T.length-1;Ye>Re;)A.push(new a(ve,Ye,new n(void 0,C[Ye--])));for(;Re>Ye;)A.push(new a(ve,Re,new o(void 0,T[Re--])));for(;Ye>=0;--Ye)d(T[Ye],C[Ye],A,P,ve,Ye,L,pe);}else {var Pc=Object.keys(T),qi=Object.keys(C);for(Ye=0;Ye<Pc.length;++Ye)mt=Pc[Ye],Zr=qi.indexOf(mt),Zr>=0?(d(T[mt],C[mt],A,P,ve,mt,L,pe),qi[Zr]=null):d(T[mt],void 0,A,P,ve,mt,L,pe);for(Ye=0;Ye<qi.length;++Ye)mt=qi[Ye],mt&&d(void 0,C[mt],A,P,ve,mt,L,pe);}L.length=L.length-1;}}else T!==C&&(X==="number"&&isNaN(T)&&isNaN(C)||A.push(new s(ve,T,C)));}function p(T,C,A,P,M){var k=[];if(d(T,C,k,P,null,null,null,M),A)for(var L=0;L<k.length;++L)A(k[L]);return k}function m(T,C,A,P,M,k,L){return d(T,C,A,P,M,k,L,true)}function b(T,C,A,P){var M=P?function(L){L&&P.push(L);}:void 0,k=p(T,C,M,A);return P||(k.length?k:void 0)}function _(T,C,A,P){var M=P?function(L){L&&P.push(L);}:void 0,k=p(T,C,M,A,true);return P||(k.length?k:void 0)}function g(T,C,A){if(A.path&&A.path.length){var P=T[C],M,k=A.path.length-1;for(M=0;M<k;M++)P=P[A.path[M]];switch(A.kind){case "A":g(P[A.path[M]],A.index,A.item);break;case "D":delete P[A.path[M]];break;case "E":case "N":P[A.path[M]]=A.rhs;break}}else switch(A.kind){case "A":g(T[C],A.index,A.item);break;case "D":T=u(T,C);break;case "E":case "N":T[C]=A.rhs;break}return T}function y(T,C,A){if(typeof A>"u"&&C&&~e.indexOf(C.kind)&&(A=C),T&&A&&A.kind){for(var P=T,M=-1,k=A.path?A.path.length-1:0;++M<k;)typeof P[A.path[M]]>"u"&&(P[A.path[M]]=typeof A.path[M+1]<"u"&&typeof A.path[M+1]=="number"?[]:{}),P=P[A.path[M]];switch(A.kind){case "A":A.path&&typeof P[A.path[M]]>"u"&&(P[A.path[M]]=[]),g(A.path?P[A.path[M]]:P,A.index,A.item);break;case "D":delete P[A.path[M]];break;case "E":case "N":P[A.path[M]]=A.rhs;break}}}function S(T,C,A){if(A.path&&A.path.length){var P=T[C],M,k=A.path.length-1;for(M=0;M<k;M++)P=P[A.path[M]];switch(A.kind){case "A":S(P[A.path[M]],A.index,A.item);break;case "D":P[A.path[M]]=A.lhs;break;case "E":P[A.path[M]]=A.lhs;break;case "N":delete P[A.path[M]];break}}else switch(A.kind){case "A":S(T[C],A.index,A.item);break;case "D":T[C]=A.lhs;break;case "E":T[C]=A.lhs;break;case "N":T=u(T,C);break}return T}function E(T,C,A){if(T&&C&&A&&A.kind){var P=T,M,k;for(k=A.path.length-1,M=0;M<k;M++)typeof P[A.path[M]]>"u"&&(P[A.path[M]]={}),P=P[A.path[M]];switch(A.kind){case "A":S(P[A.path[M]],A.index,A.item);break;case "D":P[A.path[M]]=A.lhs;break;case "E":P[A.path[M]]=A.lhs;break;case "N":delete P[A.path[M]];break}}}function F(T,C,A){if(T&&C){var P=function(M){(!A||A(T,C,M))&&y(T,C,M);};p(T,C,P);}}return Object.defineProperties(b,{diff:{value:b,enumerable:true},orderIndependentDiff:{value:_,enumerable:true},observableDiff:{value:p,enumerable:true},orderIndependentObservableDiff:{value:m,enumerable:true},orderIndepHash:{value:h,enumerable:true},applyDiff:{value:F,enumerable:true},applyChange:{value:y,enumerable:true},revertChange:{value:E,enumerable:true},isConflict:{value:function(){return typeof $conflict<"u"},enumerable:true}}),b.DeepDiff=b,r&&(r.DeepDiff=b),b});});ke();var SC={};Zi(SC,{CanvasBaseItem:()=>vf,CanvasEvent:()=>yf,CanvasManagerStatic:()=>O,Container:()=>Ln,FadeAlphaTicker:()=>$i,ImageContainer:()=>Ze,ImageSprite:()=>Ue,MoveTicker:()=>vr,RegisteredCanvasComponents:()=>tr,RegisteredEvents:()=>Hi,RegisteredTickers:()=>lr,RotateTicker:()=>Ec,Sprite:()=>ji,Text:()=>Nn,TickerBase:()=>ur,VideoSprite:()=>Jt,ZoomTicker:()=>Ts,addImage:()=>Sf,addImageCointainer:()=>Tf,addVideo:()=>Ef,canvas:()=>I,canvasComponentDecorator:()=>zM,eventDecorator:()=>WM,getTexture:()=>vi,loadImage:()=>ZM,loadVideo:()=>JM,moveIn:()=>iI,moveOut:()=>$b,pushIn:()=>nI,pushOut:()=>TC,removeWithDissolve:()=>Af,removeWithFade:()=>rI,shakeEffect:()=>qM,showImage:()=>QM,showImageContainer:()=>KM,showVideo:()=>eI,showWithDissolve:()=>yC,showWithFade:()=>tI,tickerDecorator:()=>$M,zoomIn:()=>sI,zoomOut:()=>vC});ke();var Xe={};Zi(Xe,{DistortionFilter:()=>Bb,EqualizerFilter:()=>qr,Filter:()=>Pt,MonoFilter:()=>Rb,ReverbFilter:()=>Mb,StereoFilter:()=>Ib,StreamFilter:()=>Db,TelephoneFilter:()=>kb});var SM;function EM(r){return SM=r,r}function Oe(){return SM}var Pt=class{constructor(e,t){this.init(e,t);}init(e,t){this.destination=e,this.source=t||e;}connect(e){this.source?.connect(e);}disconnect(){this.source?.disconnect();}destroy(){this.disconnect(),this.destination=null,this.source=null;}};var Bb=class extends Pt{constructor(e=0){let t;if(!Oe().useLegacy){let{audioContext:i}=Oe().context;t=i.createWaveShaper();}super(t),this._distortion=t,this.amount=e;}set amount(e){if(this._amount=e,Oe().useLegacy)return;let t=e*1e3,i=44100,s=new Float32Array(i),n=Math.PI/180,o=0,a;for(;o<i;++o)a=o*2/i-1,s[o]=(3+t)*a*20*n/(Math.PI+t*Math.abs(a));this._distortion.curve=s,this._distortion.oversample="4x";}get amount(){return this._amount}destroy(){this._distortion=null,super.destroy();}};var yt=class{static setParamValue(e,t){if(e.setValueAtTime){let i=Oe().context;e.setValueAtTime(t,i.audioContext.currentTime);}else e.value=t;return t}};var Fe=class extends Pt{constructor(r=0,e=0,t=0,i=0,s=0,n=0,o=0,a=0,u=0,l=0){let c=[],h=[{f:Fe.F32,type:"lowshelf",gain:r},{f:Fe.F64,type:"peaking",gain:e},{f:Fe.F125,type:"peaking",gain:t},{f:Fe.F250,type:"peaking",gain:i},{f:Fe.F500,type:"peaking",gain:s},{f:Fe.F1K,type:"peaking",gain:n},{f:Fe.F2K,type:"peaking",gain:o},{f:Fe.F4K,type:"peaking",gain:a},{f:Fe.F8K,type:"peaking",gain:u},{f:Fe.F16K,type:"highshelf",gain:l}];Oe().useLegacy||(c=h.map(d=>{let p=Oe().context.audioContext.createBiquadFilter();return p.type=d.type,yt.setParamValue(p.Q,1),p.frequency.value=d.f,yt.setParamValue(p.gain,d.gain),p})),super(c[0],c[c.length-1]),this.bands=c,this.bandsMap={};for(let d=0;d<this.bands.length;d++){let p=this.bands[d];d>0&&this.bands[d-1].connect(p),this.bandsMap[p.frequency.value]=p;}}setGain(r,e=0){if(!this.bandsMap[r])throw new Error(`No band found for frequency ${r}`);yt.setParamValue(this.bandsMap[r].gain,e);}getGain(r){if(!this.bandsMap[r])throw new Error(`No band found for frequency ${r}`);return this.bandsMap[r].gain.value}set f32(r){this.setGain(Fe.F32,r);}get f32(){return this.getGain(Fe.F32)}set f64(r){this.setGain(Fe.F64,r);}get f64(){return this.getGain(Fe.F64)}set f125(r){this.setGain(Fe.F125,r);}get f125(){return this.getGain(Fe.F125)}set f250(r){this.setGain(Fe.F250,r);}get f250(){return this.getGain(Fe.F250)}set f500(r){this.setGain(Fe.F500,r);}get f500(){return this.getGain(Fe.F500)}set f1k(r){this.setGain(Fe.F1K,r);}get f1k(){return this.getGain(Fe.F1K)}set f2k(r){this.setGain(Fe.F2K,r);}get f2k(){return this.getGain(Fe.F2K)}set f4k(r){this.setGain(Fe.F4K,r);}get f4k(){return this.getGain(Fe.F4K)}set f8k(r){this.setGain(Fe.F8K,r);}get f8k(){return this.getGain(Fe.F8K)}set f16k(r){this.setGain(Fe.F16K,r);}get f16k(){return this.getGain(Fe.F16K)}reset(){this.bands.forEach(r=>{yt.setParamValue(r.gain,0);});}destroy(){this.bands.forEach(r=>{r.disconnect();}),this.bands=null,this.bandsMap=null;}},qr=Fe;qr.F32=32;qr.F64=64;qr.F125=125;qr.F250=250;qr.F500=500;qr.F1K=1e3;qr.F2K=2e3;qr.F4K=4e3;qr.F8K=8e3;qr.F16K=16e3;var Rb=class extends Pt{constructor(){let e,t;if(!Oe().useLegacy){let{audioContext:i}=Oe().context;t=i.createChannelSplitter(),e=i.createChannelMerger(),e.connect(t);}super(e,t),this._merger=e;}destroy(){this._merger?.disconnect(),this._merger=null,super.destroy();}};var Mb=class extends Pt{constructor(e=3,t=2,i=false){super(null),this._seconds=this._clamp(e,1,50),this._decay=this._clamp(t,0,100),this._reverse=i,this._rebuild();}_clamp(e,t,i){return Math.min(i,Math.max(t,e))}get seconds(){return this._seconds}set seconds(e){this._seconds=this._clamp(e,1,50),this._rebuild();}get decay(){return this._decay}set decay(e){this._decay=this._clamp(e,0,100),this._rebuild();}get reverse(){return this._reverse}set reverse(e){this._reverse=e,this._rebuild();}_rebuild(){if(Oe().useLegacy)return;let{audioContext:e}=Oe().context,t=e.sampleRate,i=t*this._seconds,s=e.createBuffer(2,i,t),n=s.getChannelData(0),o=s.getChannelData(1),a;for(let l=0;l<i;l++)a=this._reverse?i-l:l,n[l]=(Math.random()*2-1)*Math.pow(1-a/i,this._decay),o[l]=(Math.random()*2-1)*Math.pow(1-a/i,this._decay);let u=e.createConvolver();u.buffer=s,this.init(u);}};var Ib=class extends Pt{constructor(e=0){let t,i,s;if(!Oe().useLegacy){let{audioContext:n}=Oe().context;n.createStereoPanner?(t=n.createStereoPanner(),s=t):(i=n.createPanner(),i.panningModel="equalpower",s=i);}super(s),this._stereo=t,this._panner=i,this.pan=e;}set pan(e){this._pan=e,this._stereo?yt.setParamValue(this._stereo.pan,e):this._panner&&this._panner.setPosition(e,0,1-Math.abs(e));}get pan(){return this._pan}destroy(){super.destroy(),this._stereo=null,this._panner=null;}};var Db=class extends Pt{constructor(){let e,t;if(!Oe().useLegacy){let{audioContext:i}=Oe().context;e=i.createMediaStreamDestination(),t=i.createMediaStreamSource(e.stream);}super(e,t),this._stream=e?.stream;}get stream(){return this._stream}destroy(){this._stream=null,super.destroy();}};var kb=class extends Pt{constructor(){let e,t;if(!Oe().useLegacy){let{audioContext:i}=Oe().context,s=i.createBiquadFilter(),n=i.createBiquadFilter(),o=i.createBiquadFilter(),a=i.createBiquadFilter();s.type="lowpass",yt.setParamValue(s.frequency,2e3),n.type="lowpass",yt.setParamValue(n.frequency,2e3),o.type="highpass",yt.setParamValue(o.frequency,500),a.type="highpass",yt.setParamValue(a.frequency,500),s.connect(n),n.connect(o),o.connect(a),e=s,t=a;}super(e,t);}};ke();var nf=class extends _e{constructor(){super(...arguments),this.speed=1,this.muted=false,this.volume=1,this.paused=false;}refresh(){this.emit("refresh");}refreshPaused(){this.emit("refreshPaused");}get filters(){return console.warn("HTML Audio does not support filters"),null}set filters(e){console.warn("HTML Audio does not support filters");}get audioContext(){return console.warn("HTML Audio does not support audioContext"),null}toggleMute(){return this.muted=!this.muted,this.refresh(),this.muted}togglePause(){return this.paused=!this.paused,this.refreshPaused(),this.paused}destroy(){this.removeAllListeners();}};ke();var ZF=0,Z1=class extends _e{constructor(r){super(),this.id=ZF++,this.init(r);}set(r,e){if(this[r]===void 0)throw new Error(`Property with name ${r} does not exist.`);switch(r){case "speed":this.speed=e;break;case "volume":this.volume=e;break;case "paused":this.paused=e;break;case "loop":this.loop=e;break;case "muted":this.muted=e;break}return this}get progress(){let{currentTime:r}=this._source;return r/this._duration}get paused(){return this._paused}set paused(r){this._paused=r,this.refreshPaused();}_onPlay(){this._playing=true;}_onPause(){this._playing=false;}init(r){this._playing=false,this._duration=r.source.duration;let e=this._source=r.source.cloneNode(false);e.src=r.parent.url,e.onplay=this._onPlay.bind(this),e.onpause=this._onPause.bind(this),r.context.on("refresh",this.refresh,this),r.context.on("refreshPaused",this.refreshPaused,this),this._media=r;}_internalStop(){this._source&&this._playing&&(this._source.onended=null,this._source.pause());}stop(){this._internalStop(),this._source&&this.emit("stop");}get speed(){return this._speed}set speed(r){this._speed=r,this.refresh();}get volume(){return this._volume}set volume(r){this._volume=r,this.refresh();}get loop(){return this._loop}set loop(r){this._loop=r,this.refresh();}get muted(){return this._muted}set muted(r){this._muted=r,this.refresh();}get filters(){return console.warn("HTML Audio does not support filters"),null}set filters(r){console.warn("HTML Audio does not support filters");}refresh(){let r=this._media.context,e=this._media.parent;this._source.loop=this._loop||e.loop;let t=r.volume*(r.muted?0:1),i=e.volume*(e.muted?0:1),s=this._volume*(this._muted?0:1);this._source.volume=s*t*i,this._source.playbackRate=this._speed*r.speed*e.speed;}refreshPaused(){let r=this._media.context,e=this._media.parent,t=this._paused||e.paused||r.paused;t!==this._pausedReal&&(this._pausedReal=t,t?(this._internalStop(),this.emit("paused")):(this.emit("resumed"),this.play({start:this._source.currentTime,end:this._end,volume:this._volume,speed:this._speed,loop:this._loop})),this.emit("pause",t));}play(r){let{start:e,end:t,speed:i,loop:s,volume:n,muted:o}=r;t&&console.assert(t>e,"End time is before start time"),this._speed=i,this._volume=n,this._loop=!!s,this._muted=o,this.refresh(),this.loop&&t!==null&&(console.warn('Looping not support when specifying an "end" time'),this.loop=false),this._start=e,this._end=t||this._duration,this._start=Math.max(0,this._start-Z1.PADDING),this._end=Math.min(this._end+Z1.PADDING,this._duration),this._source.onloadedmetadata=()=>{this._source&&(this._source.currentTime=e,this._source.onloadedmetadata=null,this.emit("progress",e/this._duration,this._duration),Ie.shared.add(this._onUpdate,this));},this._source.onended=this._onComplete.bind(this),this._source.play(),this.emit("start");}_onUpdate(){this.emit("progress",this.progress,this._duration),this._source.currentTime>=this._end&&!this._source.loop&&this._onComplete();}_onComplete(){Ie.shared.remove(this._onUpdate,this),this._internalStop(),this.emit("progress",1,this._duration),this.emit("end",this);}destroy(){Ie.shared.remove(this._onUpdate,this),this.removeAllListeners();let r=this._source;r&&(r.onended=null,r.onplay=null,r.onpause=null,this._internalStop()),this._source=null,this._speed=1,this._volume=1,this._loop=false,this._end=null,this._start=0,this._duration=0,this._playing=false,this._pausedReal=false,this._paused=false,this._muted=false,this._media&&(this._media.context.off("refresh",this.refresh,this),this._media.context.off("refreshPaused",this.refreshPaused,this),this._media=null);}toString(){return `[HTMLAudioInstance id=${this.id}]`}},Ob=Z1;Ob.PADDING=.1;ke();var of=class extends _e{init(e){this.parent=e,this._source=e.options.source||new Audio,e.url&&(this._source.src=e.url);}create(){return new Ob(this)}get isPlayable(){return !!this._source&&this._source.readyState===4}get duration(){return this._source.duration}get context(){return this.parent.context}get filters(){return null}set filters(e){console.warn("HTML Audio does not support filters");}destroy(){this.removeAllListeners(),this.parent=null,this._source&&(this._source.src="",this._source.load(),this._source=null);}get source(){return this._source}load(e){let t=this._source,i=this.parent;if(t.readyState===4){i.isLoaded=true;let u=i.autoPlayStart();e&&setTimeout(()=>{e(null,i,u);},0);return}if(!i.url){e(new Error("sound.url or sound.source must be set"));return}t.src=i.url;let s=()=>{a(),i.isLoaded=true;let u=i.autoPlayStart();e&&e(null,i,u);},n=()=>{a(),e&&e(new Error("Sound loading has been aborted"));},o=()=>{a();let u=`Failed to load audio element (code: ${t.error.code})`;e?e(new Error(u)):console.error(u);},a=()=>{t.removeEventListener("canplaythrough",s),t.removeEventListener("load",s),t.removeEventListener("abort",n),t.removeEventListener("error",o);};t.addEventListener("canplaythrough",s,false),t.addEventListener("load",s,false),t.addEventListener("abort",n,false),t.addEventListener("error",o,false),t.load();}};ke();var af=class{constructor(e,t){this.parent=e,Object.assign(this,t),this.duration=this.end-this.start,console.assert(this.duration>0,"End time must be after start time");}play(e){return this.parent.play({complete:e,speed:this.speed||this.parent.speed,end:this.end,start:this.start,loop:this.loop})}destroy(){this.parent=null;}};var Ua=["ogg","oga","opus","m4a","mp3","mpeg","wav","aiff","wma","mid","caf"],Q1=["audio/mpeg","audio/ogg"],La={};function CM(r){let e={m4a:"audio/mp4",oga:"audio/ogg",opus:'audio/ogg; codecs="opus"',caf:'audio/x-caf; codecs="opus"',...{}},t=document.createElement("audio"),i={},s=/^no$/;Ua.forEach(n=>{let o=t.canPlayType(`audio/${n}`).replace(s,""),a=e[n]?t.canPlayType(e[n]).replace(s,""):"";i[n]=!!o||!!a;}),Object.assign(La,i);}CM();ke();ke();var JF=0,uf=class extends _e{constructor(e){super(),this.id=JF++,this._media=null,this._paused=false,this._muted=false,this._elapsed=0,this.init(e);}set(e,t){if(this[e]===void 0)throw new Error(`Property with name ${e} does not exist.`);switch(e){case "speed":this.speed=t;break;case "volume":this.volume=t;break;case "muted":this.muted=t;break;case "loop":this.loop=t;break;case "paused":this.paused=t;break}return this}stop(){this._source&&(this._internalStop(),this.emit("stop"));}get speed(){return this._speed}set speed(e){this._speed=e,this.refresh(),this._update(true);}get volume(){return this._volume}set volume(e){this._volume=e,this.refresh();}get muted(){return this._muted}set muted(e){this._muted=e,this.refresh();}get loop(){return this._loop}set loop(e){this._loop=e,this.refresh();}get filters(){return this._filters}set filters(e){this._filters&&(this._filters?.filter(t=>t).forEach(t=>t.disconnect()),this._filters=null,this._source.connect(this._gain)),this._filters=e?.length?e.slice(0):null,this.refresh();}refresh(){if(!this._source)return;let e=this._media.context,t=this._media.parent;this._source.loop=this._loop||t.loop;let i=e.volume*(e.muted?0:1),s=t.volume*(t.muted?0:1),n=this._volume*(this._muted?0:1);yt.setParamValue(this._gain.gain,n*s*i),yt.setParamValue(this._source.playbackRate,this._speed*t.speed*e.speed),this.applyFilters();}applyFilters(){if(this._filters?.length){this._source.disconnect();let e=this._source;this._filters.forEach(t=>{e.connect(t.destination),e=t;}),e.connect(this._gain);}}refreshPaused(){let e=this._media.context,t=this._media.parent,i=this._paused||t.paused||e.paused;i!==this._pausedReal&&(this._pausedReal=i,i?(this._internalStop(),this.emit("paused")):(this.emit("resumed"),this.play({start:this._elapsed%this._duration,end:this._end,speed:this._speed,loop:this._loop,volume:this._volume})),this.emit("pause",i));}play(e){let{start:t,end:i,speed:s,loop:n,volume:o,muted:a,filters:u}=e;i&&console.assert(i>t,"End time is before start time"),this._paused=false;let{source:l,gain:c}=this._media.nodes.cloneBufferSource();this._source=l,this._gain=c,this._speed=s,this._volume=o,this._loop=!!n,this._muted=a,this._filters=u,this.refresh();let h=this._source.buffer.duration;this._duration=h,this._end=i,this._lastUpdate=this._now(),this._elapsed=t,this._source.onended=this._onComplete.bind(this),this._loop?(this._source.loopEnd=i,this._source.loopStart=t,this._source.start(0,t)):i?this._source.start(0,t,i-t):this._source.start(0,t),this.emit("start"),this._update(true),this.enableTicker(true);}enableTicker(e){Ie.shared.remove(this._updateListener,this),e&&Ie.shared.add(this._updateListener,this);}get progress(){return this._progress}get paused(){return this._paused}set paused(e){this._paused=e,this.refreshPaused();}destroy(){this.removeAllListeners(),this._internalStop(),this._gain&&(this._gain.disconnect(),this._gain=null),this._media&&(this._media.context.events.off("refresh",this.refresh,this),this._media.context.events.off("refreshPaused",this.refreshPaused,this),this._media=null),this._filters?.forEach(e=>e.disconnect()),this._filters=null,this._end=null,this._speed=1,this._volume=1,this._loop=false,this._elapsed=0,this._duration=0,this._paused=false,this._muted=false,this._pausedReal=false;}toString(){return `[WebAudioInstance id=${this.id}]`}_now(){return this._media.context.audioContext.currentTime}_updateListener(){this._update();}_update(e=false){if(this._source){let t=this._now(),i=t-this._lastUpdate;if(i>0||e){let s=this._source.playbackRate.value;this._elapsed+=i*s,this._lastUpdate=t;let n=this._duration,o;if(this._source.loopStart){let a=this._source.loopEnd-this._source.loopStart;o=(this._source.loopStart+this._elapsed%a)/n;}else o=this._elapsed%n/n;this._progress=o,this.emit("progress",this._progress,n);}}}init(e){this._media=e,e.context.events.on("refresh",this.refresh,this),e.context.events.on("refreshPaused",this.refreshPaused,this);}_internalStop(){if(this._source){this.enableTicker(false),this._source.onended=null,this._source.stop(0),this._source.disconnect();try{this._source.buffer=null;}catch(e){console.warn("Failed to set AudioBufferSourceNode.buffer to null:",e);}this._source=null;}}_onComplete(){if(this._source){this.enableTicker(false),this._source.onended=null,this._source.disconnect();try{this._source.buffer=null;}catch(e){console.warn("Failed to set AudioBufferSourceNode.buffer to null:",e);}}this._source=null,this._progress=1,this.emit("progress",1,this._duration),this.emit("end",this);}};var Na=class{constructor(e,t){this._output=t,this._input=e;}get destination(){return this._input}get filters(){return this._filters}set filters(e){if(this._filters&&(this._filters.forEach(t=>{t&&t.disconnect();}),this._filters=null,this._input.connect(this._output)),e&&e.length){this._filters=e.slice(0),this._input.disconnect();let t=null;e.forEach(i=>{t===null?this._input.connect(i.destination):t.connect(i.destination),t=i;}),t.connect(this._output);}}destroy(){this.filters=null,this._input=null,this._output=null;}};var AM=class extends Na{constructor(r){let e=r.audioContext,t=e.createBufferSource(),i=e.createGain(),s=e.createAnalyser();t.connect(s),s.connect(i),i.connect(r.destination),super(s,i),this.context=r,this.bufferSource=t,this.gain=i,this.analyser=s;}get script(){return this._script||(this._script=this.context.audioContext.createScriptProcessor(AM.BUFFER_SIZE),this._script.connect(this.context.destination)),this._script}destroy(){super.destroy(),this.bufferSource.disconnect(),this._script&&this._script.disconnect(),this.gain.disconnect(),this.analyser.disconnect(),this.bufferSource=null,this._script=null,this.gain=null,this.analyser=null,this.context=null;}cloneBufferSource(){let r=this.bufferSource,e=this.context.audioContext.createBufferSource();e.buffer=r.buffer,yt.setParamValue(e.playbackRate,r.playbackRate.value),e.loop=r.loop;let t=this.context.audioContext.createGain();return e.connect(t),t.connect(this.destination),{source:e,gain:t}}get bufferSize(){return this.script.bufferSize}},Fb=AM;Fb.BUFFER_SIZE=0;var Ha=class{init(e){this.parent=e,this._nodes=new Fb(this.context),this._source=this._nodes.bufferSource,this.source=e.options.source;}destroy(){this.parent=null,this._nodes.destroy(),this._nodes=null;try{this._source.buffer=null;}catch(e){console.warn("Failed to set AudioBufferSourceNode.buffer to null:",e);}this._source=null,this.source=null;}create(){return new uf(this)}get context(){return this.parent.context}get isPlayable(){return !!this._source&&!!this._source.buffer}get filters(){return this._nodes.filters}set filters(e){this._nodes.filters=e;}get duration(){return console.assert(this.isPlayable,"Sound not yet playable, no duration"),this._source.buffer.duration}get buffer(){return this._source.buffer}set buffer(e){this._source.buffer=e;}get nodes(){return this._nodes}load(e){this.source?this._decode(this.source,e):this.parent.url?this._loadUrl(e):e?e(new Error("sound.url or sound.source must be set")):console.error("sound.url or sound.source must be set");}async _loadUrl(e){let t=this.parent.url,i=await j.get().fetch(t);this._decode(await i.arrayBuffer(),e);}_decode(e,t){let i=(s,n)=>{if(s)t&&t(s);else {this.parent.isLoaded=true,this.buffer=n;let o=this.parent.autoPlayStart();t&&t(null,this.parent,o);}};e instanceof AudioBuffer?i(null,e):this.parent.context.decode(e,i);}};var uc=class{static from(r){let e={};typeof r=="string"?e.url=r:r instanceof ArrayBuffer||r instanceof AudioBuffer||r instanceof HTMLAudioElement?e.source=r:Array.isArray(r)?e.url=r:e=r,e={autoPlay:false,singleInstance:false,url:null,source:null,preload:false,volume:1,speed:1,complete:null,loaded:null,loop:false,...e},Object.freeze(e);let t=Oe().useLegacy?new of:new Ha;return new uc(t,e)}constructor(r,e){this.media=r,this.options=e,this._instances=[],this._sprites={},this.media.init(this);let t=e.complete;this._autoPlayOptions=t?{complete:t}:null,this.isLoaded=false,this._preloadQueue=null,this.isPlaying=false,this.autoPlay=e.autoPlay,this.singleInstance=e.singleInstance,this.preload=e.preload||this.autoPlay,this.url=Array.isArray(e.url)?this.preferUrl(e.url):e.url,this.speed=e.speed,this.volume=e.volume,this.loop=e.loop,e.sprites&&this.addSprites(e.sprites),this.preload&&this._preload(e.loaded);}preferUrl(r){let[e]=r.map(t=>({url:t,ext:We.extname(t).slice(1)})).filter(({ext:t})=>La[t]).sort((t,i)=>Ua.indexOf(t.ext)-Ua.indexOf(i.ext));if(!e)throw new Error("No supported file type found");return e.url}get context(){return Oe().context}pause(){return this.isPlaying=false,this.paused=true,this}resume(){return this.isPlaying=this._instances.length>0,this.paused=false,this}get paused(){return this._paused}set paused(r){this._paused=r,this.refreshPaused();}get speed(){return this._speed}set speed(r){this._speed=r,this.refresh();}get filters(){return this.media.filters}set filters(r){this.media.filters=r;}addSprites(r,e){if(typeof r=="object"){let i={};for(let s in r)i[s]=this.addSprites(s,r[s]);return i}console.assert(!this._sprites[r],`Alias ${r} is already taken`);let t=new af(this,e);return this._sprites[r]=t,t}destroy(){this._removeInstances(),this.removeSprites(),this.media.destroy(),this.media=null,this._sprites=null,this._instances=null;}removeSprites(r){if(r){let e=this._sprites[r];e!==void 0&&(e.destroy(),delete this._sprites[r]);}else for(let e in this._sprites)this.removeSprites(e);return this}get isPlayable(){return this.isLoaded&&this.media&&this.media.isPlayable}stop(){if(!this.isPlayable)return this.autoPlay=false,this._autoPlayOptions=null,this;this.isPlaying=false;for(let r=this._instances.length-1;r>=0;r--)this._instances[r].stop();return this}play(r,e){let t;if(typeof r=="string"?t={sprite:r,loop:this.loop,complete:e}:typeof r=="function"?(t={},t.complete=r):t=r,t={complete:null,loaded:null,sprite:null,end:null,start:0,volume:1,speed:1,muted:false,loop:false,...t||{}},t.sprite){let s=t.sprite;console.assert(!!this._sprites[s],`Alias ${s} is not available`);let n=this._sprites[s];t.start=n.start+(t.start||0),t.end=n.end,t.speed=n.speed||1,t.loop=n.loop||t.loop,delete t.sprite;}if(t.offset&&(t.start=t.offset),!this.isLoaded)return this._preloadQueue?new Promise(s=>{this._preloadQueue.push(()=>{s(this.play(t));});}):(this._preloadQueue=[],this.autoPlay=true,this._autoPlayOptions=t,new Promise((s,n)=>{this._preload((o,a,u)=>{this._preloadQueue.forEach(l=>l()),this._preloadQueue=null,o?n(o):(t.loaded&&t.loaded(o,a,u),s(u));});}));(this.singleInstance||t.singleInstance)&&this._removeInstances();let i=this._createInstance();return this._instances.push(i),this.isPlaying=true,i.once("end",()=>{t.complete&&t.complete(this),this._onComplete(i);}),i.once("stop",()=>{this._onComplete(i);}),i.play(t),i}refresh(){let r=this._instances.length;for(let e=0;e<r;e++)this._instances[e].refresh();}refreshPaused(){let r=this._instances.length;for(let e=0;e<r;e++)this._instances[e].refreshPaused();}get volume(){return this._volume}set volume(r){this._volume=r,this.refresh();}get muted(){return this._muted}set muted(r){this._muted=r,this.refresh();}get loop(){return this._loop}set loop(r){this._loop=r,this.refresh();}_preload(r){this.media.load(r);}get instances(){return this._instances}get sprites(){return this._sprites}get duration(){return this.media.duration}autoPlayStart(){let r;return this.autoPlay&&(r=this.play(this._autoPlayOptions)),r}_removeInstances(){for(let r=this._instances.length-1;r>=0;r--)this._poolInstance(this._instances[r]);this._instances.length=0;}_onComplete(r){if(this._instances){let e=this._instances.indexOf(r);e>-1&&this._instances.splice(e,1),this.isPlaying=this._instances.length>0;}this._poolInstance(r);}_createInstance(){if(uc._pool.length>0){let r=uc._pool.pop();return r.init(this.media),r}return this.media.create()}_poolInstance(r){r.destroy(),uc._pool.indexOf(r)<0&&uc._pool.push(r);}},Rr=uc;Rr._pool=[];ke();var lc=class r extends Na{constructor(){let e=window,t=new r.AudioContext,i=t.createDynamicsCompressor(),s=t.createAnalyser();s.connect(i),i.connect(t.destination),super(s,i),this.autoPause=true,this._ctx=t,this._offlineCtx=new r.OfflineAudioContext(1,2,e.OfflineAudioContext?Math.max(8e3,Math.min(96e3,t.sampleRate)):44100),this.compressor=i,this.analyser=s,this.events=new _e,this.volume=1,this.speed=1,this.muted=false,this.paused=false,this._locked=t.state==="suspended"&&("ontouchstart"in globalThis||"onclick"in globalThis),this._locked&&(this._unlock(),this._unlock=this._unlock.bind(this),document.addEventListener("mousedown",this._unlock,true),document.addEventListener("touchstart",this._unlock,true),document.addEventListener("touchend",this._unlock,true)),this.onFocus=this.onFocus.bind(this),this.onBlur=this.onBlur.bind(this),globalThis.addEventListener("focus",this.onFocus),globalThis.addEventListener("blur",this.onBlur);}onFocus(){if(!this.autoPause)return;let e=this._ctx.state;(e==="suspended"||e==="interrupted"||!this._locked)&&(this.paused=this._pausedOnBlur,this.refreshPaused());}onBlur(){this.autoPause&&(this._locked||(this._pausedOnBlur=this._paused,this.paused=true,this.refreshPaused()));}_unlock(){this._locked&&(this.playEmptySound(),this._ctx.state==="running"&&(document.removeEventListener("mousedown",this._unlock,true),document.removeEventListener("touchend",this._unlock,true),document.removeEventListener("touchstart",this._unlock,true),this._locked=false));}playEmptySound(){let e=this._ctx.createBufferSource();e.buffer=this._ctx.createBuffer(1,1,22050),e.connect(this._ctx.destination),e.start(0,0,0),e.context.state==="suspended"&&e.context.resume();}static get AudioContext(){let e=window;return e.AudioContext||e.webkitAudioContext||null}static get OfflineAudioContext(){let e=window;return e.OfflineAudioContext||e.webkitOfflineAudioContext||null}destroy(){super.destroy();let e=this._ctx;typeof e.close<"u"&&e.close(),globalThis.removeEventListener("focus",this.onFocus),globalThis.removeEventListener("blur",this.onBlur),this.events.removeAllListeners(),this.analyser.disconnect(),this.compressor.disconnect(),this.analyser=null,this.compressor=null,this.events=null,this._offlineCtx=null,this._ctx=null;}get audioContext(){return this._ctx}get offlineContext(){return this._offlineCtx}set paused(e){e&&this._ctx.state==="running"?this._ctx.suspend():!e&&this._ctx.state==="suspended"&&this._ctx.resume(),this._paused=e;}get paused(){return this._paused}refresh(){this.events.emit("refresh");}refreshPaused(){this.events.emit("refreshPaused");}toggleMute(){return this.muted=!this.muted,this.refresh(),this.muted}togglePause(){return this.paused=!this.paused,this.refreshPaused(),this._paused}decode(e,t){let i=n=>{t(new Error(n?.message||"Unable to decode file"));},s=this._offlineCtx.decodeAudioData(e,n=>{t(null,n);},i);s&&s.catch(i);}};var cc=class{constructor(){this.init();}init(){return this.supported&&(this._webAudioContext=new lc),this._htmlAudioContext=new nf,this._sounds={},this.useLegacy=!this.supported,this}get context(){return this._context}get filtersAll(){return this.useLegacy?[]:this._context.filters}set filtersAll(e){this.useLegacy||(this._context.filters=e);}get supported(){return lc.AudioContext!==null}add(e,t){if(typeof e=="object"){let n={};for(let o in e){let a=this._getOptions(e[o],t);n[o]=this.add(o,a);}return n}if(console.assert(!this._sounds[e],`Sound with alias ${e} already exists.`),t instanceof Rr)return this._sounds[e]=t,t;let i=this._getOptions(t),s=Rr.from(i);return this._sounds[e]=s,s}_getOptions(e,t){let i;return typeof e=="string"?i={url:e}:Array.isArray(e)?i={url:e}:e instanceof ArrayBuffer||e instanceof AudioBuffer||e instanceof HTMLAudioElement?i={source:e}:i=e,i={...i,...t||{}},i}get useLegacy(){return this._useLegacy}set useLegacy(e){this._useLegacy=e,this._context=!e&&this.supported?this._webAudioContext:this._htmlAudioContext;}get disableAutoPause(){return !this._webAudioContext.autoPause}set disableAutoPause(e){this._webAudioContext.autoPause=!e;}remove(e){return this.exists(e,true),this._sounds[e].destroy(),delete this._sounds[e],this}get volumeAll(){return this._context.volume}set volumeAll(e){this._context.volume=e,this._context.refresh();}get speedAll(){return this._context.speed}set speedAll(e){this._context.speed=e,this._context.refresh();}togglePauseAll(){return this._context.togglePause()}pauseAll(){return this._context.paused=true,this._context.refreshPaused(),this}resumeAll(){return this._context.paused=false,this._context.refreshPaused(),this}toggleMuteAll(){return this._context.toggleMute()}muteAll(){return this._context.muted=true,this._context.refresh(),this}unmuteAll(){return this._context.muted=false,this._context.refresh(),this}removeAll(){for(let e in this._sounds)this._sounds[e].destroy(),delete this._sounds[e];return this}stopAll(){for(let e in this._sounds)this._sounds[e].stop();return this}exists(e,t=false){let i=!!this._sounds[e];return t&&console.assert(i,`No sound matching alias '${e}'.`),i}isPlaying(){for(let e in this._sounds)if(this._sounds[e].isPlaying)return true;return false}find(e){return this.exists(e,true),this._sounds[e]}play(e,t){return this.find(e).play(t)}stop(e){return this.find(e).stop()}pause(e){return this.find(e).pause()}resume(e){return this.find(e).resume()}volume(e,t){let i=this.find(e);return t!==void 0&&(i.volume=t),i.volume}speed(e,t){let i=this.find(e);return t!==void 0&&(i.speed=t),i.speed}duration(e){return this.find(e).duration}close(){return this.removeAll(),this._sounds=null,this._webAudioContext&&(this._webAudioContext.destroy(),this._webAudioContext=null),this._htmlAudioContext&&(this._htmlAudioContext.destroy(),this._htmlAudioContext=null),this._context=null,this}};ke();ke();var PM=r=>{let e=r.src,t=r?.alias?.[0];return (!t||r.src===t)&&(t=We.basename(e,We.extname(e))),t},wM={extension:x.Asset,detection:{test:async()=>true,add:async r=>[...r,...Ua.filter(e=>La[e])],remove:async r=>r.filter(e=>r.includes(e))},loader:{name:"sound",extension:{type:[x.LoadParser],priority:ze.High},test(r){let e=We.extname(r).slice(1);return !!La[e]||Q1.some(t=>r.startsWith(`data:${t}`))},async load(r,e){let t=await new Promise((i,s)=>Rr.from({...e.data,url:r,preload:true,loaded(n,o){n?s(n):i(o),e.data?.loaded?.(n,o);}}));return Oe().add(PM(e),t),t},async unload(r,e){Oe().remove(PM(e));}}};V.add(wM);var we=EM(new cc);var lf="1.2.19";var Dn="repeat";function J1(r){return {type:"pause",duration:r}}var eC={DistortionFilter:Xe.DistortionFilter,EqualizerFilter:Xe.EqualizerFilter,MonoFilter:Xe.MonoFilter,ReverbFilter:Xe.ReverbFilter,StereoFilter:Xe.StereoFilter,StreamFilter:Xe.StreamFilter,TelephoneFilter:Xe.TelephoneFilter},BM=["webm","mp4","ogv","mov","avi","wmv","flv","mkv","3gp","mpg","mpeg","m4v","f4v","m2v","asf","vob","ts","m2ts","mts","divx","xvid","rm","rmvb","dat","swf","mpv","mxf","vcd","svcd","dvd","dv","3g2","m2p","m2ts","m2v","m4v","mpe","mpg","mpv2","ogm","qt","rm","ts","vob","wmv","xvid","flv","mkv","mov","mp4","webm","avi","ogv","m4v","f4v","m2v","asf","vob","ts","m2ts","mts","divx","xvid","rm","rmvb","dat","swf","mpv","mxf","vcd","svcd","dvd","dv","3g2","m2p","m2ts","m2v","m4v","mpe","mpg","mpv2","ogm","qt","rm","ts","vob","wmv","xvid","flv","mkv","mov","mp4","webm","avi","ogv","m4v","f4v","m2v","asf","vob"],br="__game_layer__",hc="Container",Gb="ImageContainer",tC="Image",dc="Sprite",fc="Text",rC="Video",le={CURRENT_DIALOGUE_MEMORY_KEY:"___current_dialogue_memory___",LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY:"___last_dialogue_added_in_step_memory___",CURRENT_MENU_OPTIONS_MEMORY_KEY:"___current_menu_options_memory___",LAST_MENU_OPTIONS_ADDED_IN_STEP_MEMORY_KEY:"___last_menu_options_added_in_step_memory___",CURRENT_INPUT_VALUE_MEMORY_KEY:"_input_value_",LAST_INPUT_ADDED_IN_STEP_MEMORY_KEY:"___last_input_added_in_step_memory___",CURRENT_INPUT_INFO_MEMORY_KEY:"___current_input_info_memory___",CHARACTER_CATEGORY_KEY:"___character___",ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY:"___glue___",OPENED_LABELS_COUNTER_KEY:"___opened_labels_counter___",ALL_CHOICES_MADE_KEY:"___all_choices_made___",CURRENT_STEP_TIMES_COUNTER_KEY:"___current_step_times_counter___",LAST_STEP_GLUED:"___last_step_glued___"};var w;(s=>(s.log=(n,...o)=>console.log(`[Pixi\u2019VN] ${n}`,...o),s.warn=(n,...o)=>console.warn(`[Pixi\u2019VN] ${n}`,...o),s.error=(n,...o)=>console.error(`[Pixi\u2019VN] ${n}`,...o),s.info=(n,...o)=>console.info(`[Pixi\u2019VN] ${n}`,...o)))(w||(w={}));function fe(r){try{if(typeof r>"u")return r;let e=JSON.stringify(r);return JSON.parse(e)}catch(e){throw w.error("Error creating exportable element",r,e),new Error("[Pixi\u2019VN] Error creating exportable element")}}async function RM(r){var e;let t={importPixi:false,...r};t.app&&(t.renderer=t.app.renderer,t.stage=t.app.stage),t.importPixi&&!t.pixi&&(t.pixi=await Promise.resolve().then(()=>(ke(),TM))),window.__PIXI_DEVTOOLS__={...window.__PIXI_DEVTOOLS__||{},app:t.app,stage:t.stage,renderer:t.renderer,extensions:[...((e=window.__PIXI_DEVTOOLS__)==null?void 0:e.extensions)||[],...t.extensions||[]],plugins:{}};}var OM=tu(iC());ke();var iG={extension:{type:"sceneProperties",name:"additional-positions"},testNode(r){return r instanceof Ue||r instanceof Jt||r instanceof Ze},testProp(r){switch(r){case "xAlign":case "yAlign":case "xPercentagePosition":case "yPercentagePosition":case "positionType":return true;default:return false}},setProperty(r,e,t){if(r instanceof Ue||r instanceof Jt||r instanceof Ze)switch(e){case "xAlign":r.xAlign=t/100;break;case "yAlign":r.yAlign=t/100;break;case "xPercentagePosition":r.xPercentagePosition=t/100;break;case "yPercentagePosition":r.yPercentagePosition=t/100;break}},getProperties(r){return [{value:r.positionType,prop:"positionType",entry:{section:"Transform",type:"text",label:"Position Type"}},{value:r.xAlign*100,prop:"xAlign",entry:{section:"Transform",type:"range",label:"X Align",tooltip:"0% is left, 100% is right",options:{min:0,max:100}}},{value:r.yAlign*100,prop:"yAlign",entry:{section:"Transform",type:"range",label:"Y Align",tooltip:"0% is top, 100% is bottom",options:{min:0,max:100}}},{value:r.xPercentagePosition*100,prop:"xPercentagePosition",entry:{section:"Transform",type:"range",label:"X Percentage Position",tooltip:"0% is left, 100% is right",options:{min:0,max:100}}},{value:r.yPercentagePosition*100,prop:"yPercentagePosition",entry:{section:"Transform",type:"range",label:"Y Percentage Position",tooltip:"0% is top, 100% is bottom",options:{min:0,max:100}}}]}},kM=iG;function sG(r,e){let t=0;return async(...i)=>{let s=Date.now();if(s-t>=e)return t=s,await r(...i)}}var $=class ${constructor(){}static get app(){if(!$._app)throw new Error("[Pixi\u2019VN] CanvasManagerStatic.app is undefined");return $._app}static get gameLayer(){let e=this.app.stage.getChildByLabel(br);return e||(e=new exports.PixiJSContainer,e.label=br,this.app.stage.addChild(e)),e}static async init(e,t,i,s,n){return $.canvasWidth=t,$.canvasHeight=i,$._app=new _d,$.app.init({resolution:window.devicePixelRatio||1,autoDensity:true,width:t,height:i,...s}).then(()=>{let{app:o=$.app,extensions:a=[],...u}=n||{};RM({app:o,extensions:[kM,...a],...u}),$._isInitialized=true,$.addCanvasIntoHTMLElement(e),window.addEventListener("resize",$.resize),$.resize(),$.gameLayer;})}static addCanvasIntoHTMLElement(e){$._isInitialized?e.appendChild($.app.canvas):w.error("GameWindowManager is not initialized");}static addHtmlLayer(e,t,i={position:"absolute",pointerEvents:"none"}){let s=document.createElement("div");s.setAttribute("id",e),s.style.position=i.position,s.style.pointerEvents=i.pointerEvents;let n=t.appendChild(s);return $.htmlLayers.push(s),$.resize(),n}static removeHtmlLayer(e){let t=$.htmlLayers.find(i=>i.id===e);t&&(t.remove(),$.htmlLayers=$.htmlLayers.filter(i=>i.id!==e));}static getHtmlLayer(e){return $.htmlLayers.find(t=>t.id===e)}static get screenScale(){let e=Math.max(document.documentElement.clientWidth,window.innerWidth||0),t=Math.max(document.documentElement.clientHeight,window.innerHeight||0);return Math.min(e/$.canvasWidth,t/$.canvasHeight)}static get screenWidth(){return Math.floor($.screenScale*$.canvasWidth)}static get screenHeight(){return Math.floor($.screenScale*$.canvasHeight)}static get horizontalMargin(){return (Math.max(document.documentElement.clientWidth,window.innerWidth||0)-$.screenWidth)/2}static get verticalMargin(){return (Math.max(document.documentElement.clientHeight,window.innerHeight||0)-$.screenHeight)/2}static async resize(){await sG(async()=>{if($._isInitialized){let i=$.app.canvas.style;i.width=`${$.screenWidth}px`,i.height=`${$.screenHeight}px`,i.marginLeft=`${$.horizontalMargin}px`,i.marginRight=`${$.horizontalMargin}px`,i.marginTop=`${$.verticalMargin}px`,i.marginBottom=`${$.verticalMargin}px`;}let t=$.htmlLayers.map(i=>{i.style.width=`${$.screenWidth}px`,i.style.height=`${$.screenHeight}px`,i.style.marginLeft=`${$.horizontalMargin}px`,i.style.marginRight=`${$.horizontalMargin}px`,i.style.marginTop=`${$.verticalMargin}px`,i.style.marginBottom=`${$.verticalMargin}px`;});await Promise.all(t);},10)();}static get childrenAliasesOrder(){return $.gameLayer.children.filter(e=>e.label).sort((e,t)=>$.gameLayer.getChildIndex(e)-$.gameLayer.getChildIndex(t)).map(e=>e.label)}static get currentTickersWithoutCreatedBySteps(){return Object.fromEntries(Object.entries($._currentTickers).filter(([e,t])=>!t.createdByTicketSteps))}static generateTickerId(e){try{return (0,OM.default)(JSON.stringify(e)).toString()+"_"+Math.random().toString(36).substring(7)}catch(t){throw new Error(`[Pixi\u2019VN] Error to generate ticker id: ${t}`)}}static addTickerTimeoutInfo(e,t,i,s){typeof e=="string"&&(e=[e]),$._currentTickersTimeouts[i]={aliases:e,ticker:t,canBeDeletedBeforeEnd:s};}static removeTickerTimeoutInfo(e){typeof e!="string"&&(e=e.toString()),$._currentTickersTimeouts[e]&&delete $._currentTickersTimeouts[e];}static removeTickerTimeout(e){typeof e!="string"&&(e=e.toString()),clearTimeout(Number(e)),$.removeTickerTimeoutInfo(e);}static removeTickerTimeoutsByAlias(e,t){Object.entries($._currentTickersTimeouts).forEach(([i,s])=>{let n=s.aliases.filter(o=>o!==e);if(n.length===0){let o=s.canBeDeletedBeforeEnd;(!t||o)&&$.removeTickerTimeout(i);}else $._currentTickersTimeouts[i].aliases=n;});}};R($,"_app"),R($,"htmlLayers",[]),R($,"canvasWidth",300),R($,"canvasHeight",300),R($,"_isInitialized",false),R($,"_currentTickers",{}),R($,"_currentTickersSequence",{}),R($,"_currentTickersTimeouts",{}),R($,"_tickersToCompleteOnStepEnd",{tikersIds:[],stepAlias:[]}),R($,"_tickersOnPause",{});var O=$;ke();var pc=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,LM=new Set,sC=typeof process=="object"&&process?process:{},NM=(r,e,t,i)=>{typeof sC.emitWarning=="function"?sC.emitWarning(r,e,t,i):console.error(`[${t}] ${e}: ${r}`);},Vb=globalThis.AbortController,FM=globalThis.AbortSignal;if(typeof Vb>"u"){FM=class{constructor(){R(this,"onabort");R(this,"_onabort",[]);R(this,"reason");R(this,"aborted",false);}addEventListener(i,s){this._onabort.push(s);}},Vb=class{constructor(){R(this,"signal",new FM);e();}abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=true;for(let s of this.signal._onabort)s(i);this.signal.onabort?.(i);}}};let r=sC.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{r&&(r=false,NM("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e));};}var nG=r=>!LM.has(r),kn=r=>r&&r===Math.floor(r)&&r>0&&isFinite(r),HM=r=>kn(r)?r<=Math.pow(2,8)?Uint8Array:r<=Math.pow(2,16)?Uint16Array:r<=Math.pow(2,32)?Uint32Array:r<=Number.MAX_SAFE_INTEGER?mc:null:null,mc=class extends Array{constructor(e){super(e),this.fill(0);}},gc,Va=class Va{constructor(e,t){R(this,"heap");R(this,"length");if(!v(Va,gc))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0;}static create(e){let t=HM(e);if(!t)return [];ee(Va,gc,true);let i=new Va(e,t);return ee(Va,gc,false),i}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}};gc=new WeakMap,Ce(Va,gc,false);var nC=Va,GM,UM,fi,Mr,pi,za,mi,xc,_c,wt,gi,vt,et,de,or,Ir,er,Ft,xi,Gt,_i,bi,Dr,yi,Un,ar,bc,z,oC,Wa,bs,hf,kr,VM,Xa,yc,df,On,Fn,aC,Nb,Hb,Je,uC,cf,Gn,lC,cC=class cC{constructor(e){Ce(this,z);Ce(this,fi);Ce(this,Mr);Ce(this,pi);Ce(this,za);Ce(this,mi);Ce(this,xc);Ce(this,_c);R(this,"ttl");R(this,"ttlResolution");R(this,"ttlAutopurge");R(this,"updateAgeOnGet");R(this,"updateAgeOnHas");R(this,"allowStale");R(this,"noDisposeOnSet");R(this,"noUpdateTTL");R(this,"maxEntrySize");R(this,"sizeCalculation");R(this,"noDeleteOnFetchRejection");R(this,"noDeleteOnStaleGet");R(this,"allowStaleOnFetchAbort");R(this,"allowStaleOnFetchRejection");R(this,"ignoreFetchAbort");Ce(this,wt);Ce(this,gi);Ce(this,vt);Ce(this,et);Ce(this,de);Ce(this,or);Ce(this,Ir);Ce(this,er);Ce(this,Ft);Ce(this,xi);Ce(this,Gt);Ce(this,_i);Ce(this,bi);Ce(this,Dr);Ce(this,yi);Ce(this,Un);Ce(this,ar);Ce(this,bc);Ce(this,Wa,()=>{});Ce(this,bs,()=>{});Ce(this,hf,()=>{});Ce(this,kr,()=>false);Ce(this,Xa,e=>{});Ce(this,yc,(e,t,i)=>{});Ce(this,df,(e,t,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});R(this,GM,"LRUCache");let{max:t=0,ttl:i,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:u,dispose:l,onInsert:c,disposeAfter:h,noDisposeOnSet:d,noUpdateTTL:p,maxSize:m=0,maxEntrySize:b=0,sizeCalculation:_,fetchMethod:g,memoMethod:y,noDeleteOnFetchRejection:S,noDeleteOnStaleGet:E,allowStaleOnFetchRejection:F,allowStaleOnFetchAbort:T,ignoreFetchAbort:C}=e;if(t!==0&&!kn(t))throw new TypeError("max option must be a nonnegative integer");let A=t?HM(t):Array;if(!A)throw new Error("invalid max value: "+t);if(ee(this,fi,t),ee(this,Mr,m),this.maxEntrySize=b||v(this,Mr),this.sizeCalculation=_,this.sizeCalculation){if(!v(this,Mr)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(y!==void 0&&typeof y!="function")throw new TypeError("memoMethod must be a function if defined");if(ee(this,_c,y),g!==void 0&&typeof g!="function")throw new TypeError("fetchMethod must be a function if specified");if(ee(this,xc,g),ee(this,Un,!!g),ee(this,vt,new Map),ee(this,et,new Array(t).fill(void 0)),ee(this,de,new Array(t).fill(void 0)),ee(this,or,new A(t)),ee(this,Ir,new A(t)),ee(this,er,0),ee(this,Ft,0),ee(this,xi,nC.create(t)),ee(this,wt,0),ee(this,gi,0),typeof l=="function"&&ee(this,pi,l),typeof c=="function"&&ee(this,za,c),typeof h=="function"?(ee(this,mi,h),ee(this,Gt,[])):(ee(this,mi,void 0),ee(this,Gt,void 0)),ee(this,yi,!!v(this,pi)),ee(this,bc,!!v(this,za)),ee(this,ar,!!v(this,mi)),this.noDisposeOnSet=!!d,this.noUpdateTTL=!!p,this.noDeleteOnFetchRejection=!!S,this.allowStaleOnFetchRejection=!!F,this.allowStaleOnFetchAbort=!!T,this.ignoreFetchAbort=!!C,this.maxEntrySize!==0){if(v(this,Mr)!==0&&!kn(v(this,Mr)))throw new TypeError("maxSize must be a positive integer if specified");if(!kn(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");q(this,z,VM).call(this);}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!E,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=kn(s)||s===0?s:1,this.ttlAutopurge=!!n,this.ttl=i||0,this.ttl){if(!kn(this.ttl))throw new TypeError("ttl must be a positive integer if specified");q(this,z,oC).call(this);}if(v(this,fi)===0&&this.ttl===0&&v(this,Mr)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!v(this,fi)&&!v(this,Mr)){let P="LRU_CACHE_UNBOUNDED";nG(P)&&(LM.add(P),NM("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",P,cC));}}static unsafeExposeInternals(e){return {starts:v(e,bi),ttls:v(e,Dr),sizes:v(e,_i),keyMap:v(e,vt),keyList:v(e,et),valList:v(e,de),next:v(e,or),prev:v(e,Ir),get head(){return v(e,er)},get tail(){return v(e,Ft)},free:v(e,xi),isBackgroundFetch:t=>{var i;return q(i=e,z,Je).call(i,t)},backgroundFetch:(t,i,s,n)=>{var o;return q(o=e,z,Hb).call(o,t,i,s,n)},moveToTail:t=>{var i;return q(i=e,z,cf).call(i,t)},indexes:t=>{var i;return q(i=e,z,On).call(i,t)},rindexes:t=>{var i;return q(i=e,z,Fn).call(i,t)},isStale:t=>{var i;return v(i=e,kr).call(i,t)}}}get max(){return v(this,fi)}get maxSize(){return v(this,Mr)}get calculatedSize(){return v(this,gi)}get size(){return v(this,wt)}get fetchMethod(){return v(this,xc)}get memoMethod(){return v(this,_c)}get dispose(){return v(this,pi)}get onInsert(){return v(this,za)}get disposeAfter(){return v(this,mi)}getRemainingTTL(e){return v(this,vt).has(e)?1/0:0}*entries(){for(let e of q(this,z,On).call(this))v(this,de)[e]!==void 0&&v(this,et)[e]!==void 0&&!q(this,z,Je).call(this,v(this,de)[e])&&(yield [v(this,et)[e],v(this,de)[e]]);}*rentries(){for(let e of q(this,z,Fn).call(this))v(this,de)[e]!==void 0&&v(this,et)[e]!==void 0&&!q(this,z,Je).call(this,v(this,de)[e])&&(yield [v(this,et)[e],v(this,de)[e]]);}*keys(){for(let e of q(this,z,On).call(this)){let t=v(this,et)[e];t!==void 0&&!q(this,z,Je).call(this,v(this,de)[e])&&(yield t);}}*rkeys(){for(let e of q(this,z,Fn).call(this)){let t=v(this,et)[e];t!==void 0&&!q(this,z,Je).call(this,v(this,de)[e])&&(yield t);}}*values(){for(let e of q(this,z,On).call(this))v(this,de)[e]!==void 0&&!q(this,z,Je).call(this,v(this,de)[e])&&(yield v(this,de)[e]);}*rvalues(){for(let e of q(this,z,Fn).call(this))v(this,de)[e]!==void 0&&!q(this,z,Je).call(this,v(this,de)[e])&&(yield v(this,de)[e]);}[(UM=Symbol.iterator,GM=Symbol.toStringTag,UM)](){return this.entries()}find(e,t={}){for(let i of q(this,z,On).call(this)){let s=v(this,de)[i],n=q(this,z,Je).call(this,s)?s.__staleWhileFetching:s;if(n!==void 0&&e(n,v(this,et)[i],this))return this.get(v(this,et)[i],t)}}forEach(e,t=this){for(let i of q(this,z,On).call(this)){let s=v(this,de)[i],n=q(this,z,Je).call(this,s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,v(this,et)[i],this);}}rforEach(e,t=this){for(let i of q(this,z,Fn).call(this)){let s=v(this,de)[i],n=q(this,z,Je).call(this,s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,v(this,et)[i],this);}}purgeStale(){let e=false;for(let t of q(this,z,Fn).call(this,{allowStale:true}))v(this,kr).call(this,t)&&(q(this,z,Gn).call(this,v(this,et)[t],"expire"),e=true);return e}info(e){let t=v(this,vt).get(e);if(t===void 0)return;let i=v(this,de)[t],s=q(this,z,Je).call(this,i)?i.__staleWhileFetching:i;if(s===void 0)return;let n={value:s};if(v(this,Dr)&&v(this,bi)){let o=v(this,Dr)[t],a=v(this,bi)[t];if(o&&a){let u=o-(pc.now()-a);n.ttl=u,n.start=Date.now();}}return v(this,_i)&&(n.size=v(this,_i)[t]),n}dump(){let e=[];for(let t of q(this,z,On).call(this,{allowStale:true})){let i=v(this,et)[t],s=v(this,de)[t],n=q(this,z,Je).call(this,s)?s.__staleWhileFetching:s;if(n===void 0||i===void 0)continue;let o={value:n};if(v(this,Dr)&&v(this,bi)){o.ttl=v(this,Dr)[t];let a=pc.now()-v(this,bi)[t];o.start=Math.floor(Date.now()-a);}v(this,_i)&&(o.size=v(this,_i)[t]),e.unshift([i,o]);}return e}load(e){this.clear();for(let[t,i]of e){if(i.start){let s=Date.now()-i.start;i.start=pc.now()-s;}this.set(t,i.value,i);}}set(e,t,i={}){var d,p,m,b;if(t===void 0)return this.delete(e),this;let{ttl:s=this.ttl,start:n,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:u}=i,{noUpdateTTL:l=this.noUpdateTTL}=i,c=v(this,df).call(this,e,t,i.size||0,a);if(this.maxEntrySize&&c>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=true),q(this,z,Gn).call(this,e,"set"),this;let h=v(this,wt)===0?void 0:v(this,vt).get(e);if(h===void 0)h=v(this,wt)===0?v(this,Ft):v(this,xi).length!==0?v(this,xi).pop():v(this,wt)===v(this,fi)?q(this,z,Nb).call(this,false):v(this,wt),v(this,et)[h]=e,v(this,de)[h]=t,v(this,vt).set(e,h),v(this,or)[v(this,Ft)]=h,v(this,Ir)[h]=v(this,Ft),ee(this,Ft,h),Gf(this,wt)._++,v(this,yc).call(this,h,c,u),u&&(u.set="add"),l=false,v(this,bc)&&((d=v(this,za))==null||d.call(this,t,e,"add"));else {q(this,z,cf).call(this,h);let _=v(this,de)[h];if(t!==_){if(v(this,Un)&&q(this,z,Je).call(this,_)){_.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:g}=_;g!==void 0&&!o&&(v(this,yi)&&((p=v(this,pi))==null||p.call(this,g,e,"set")),v(this,ar)&&v(this,Gt)?.push([g,e,"set"]));}else o||(v(this,yi)&&((m=v(this,pi))==null||m.call(this,_,e,"set")),v(this,ar)&&v(this,Gt)?.push([_,e,"set"]));if(v(this,Xa).call(this,h),v(this,yc).call(this,h,c,u),v(this,de)[h]=t,u){u.set="replace";let g=_&&q(this,z,Je).call(this,_)?_.__staleWhileFetching:_;g!==void 0&&(u.oldValue=g);}}else u&&(u.set="update");v(this,bc)&&this.onInsert?.(t,e,t===_?"update":"replace");}if(s!==0&&!v(this,Dr)&&q(this,z,oC).call(this),v(this,Dr)&&(l||v(this,hf).call(this,h,s,n),u&&v(this,bs).call(this,u,h)),!o&&v(this,ar)&&v(this,Gt)){let _=v(this,Gt),g;for(;g=_?.shift();)(b=v(this,mi))==null||b.call(this,...g);}return this}pop(){var e;try{for(;v(this,wt);){let t=v(this,de)[v(this,er)];if(q(this,z,Nb).call(this,!0),q(this,z,Je).call(this,t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(v(this,ar)&&v(this,Gt)){let t=v(this,Gt),i;for(;i=t?.shift();)(e=v(this,mi))==null||e.call(this,...i);}}}has(e,t={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=t,n=v(this,vt).get(e);if(n!==void 0){let o=v(this,de)[n];if(q(this,z,Je).call(this,o)&&o.__staleWhileFetching===void 0)return false;if(v(this,kr).call(this,n))s&&(s.has="stale",v(this,bs).call(this,s,n));else return i&&v(this,Wa).call(this,n),s&&(s.has="hit",v(this,bs).call(this,s,n)),true}else s&&(s.has="miss");return false}peek(e,t={}){let{allowStale:i=this.allowStale}=t,s=v(this,vt).get(e);if(s===void 0||!i&&v(this,kr).call(this,s))return;let n=v(this,de)[s];return q(this,z,Je).call(this,n)?n.__staleWhileFetching:n}async fetch(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:u=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:h=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:p=this.ignoreFetchAbort,allowStaleOnFetchAbort:m=this.allowStaleOnFetchAbort,context:b,forceRefresh:_=false,status:g,signal:y}=t;if(!v(this,Un))return g&&(g.fetch="get"),this.get(e,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:g});let S={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:o,noDisposeOnSet:a,size:u,sizeCalculation:l,noUpdateTTL:c,noDeleteOnFetchRejection:h,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:m,ignoreFetchAbort:p,status:g,signal:y},E=v(this,vt).get(e);if(E===void 0){g&&(g.fetch="miss");let F=q(this,z,Hb).call(this,e,E,S,b);return F.__returned=F}else {let F=v(this,de)[E];if(q(this,z,Je).call(this,F)){let M=i&&F.__staleWhileFetching!==void 0;return g&&(g.fetch="inflight",M&&(g.returnedStale=true)),M?F.__staleWhileFetching:F.__returned=F}let T=v(this,kr).call(this,E);if(!_&&!T)return g&&(g.fetch="hit"),q(this,z,cf).call(this,E),s&&v(this,Wa).call(this,E),g&&v(this,bs).call(this,g,E),F;let C=q(this,z,Hb).call(this,e,E,S,b),P=C.__staleWhileFetching!==void 0&&i;return g&&(g.fetch=T?"stale":"refresh",P&&T&&(g.returnedStale=true)),P?C.__staleWhileFetching:C.__returned=C}}async forceFetch(e,t={}){let i=await this.fetch(e,t);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(e,t={}){let i=v(this,_c);if(!i)throw new Error("no memoMethod provided to constructor");let{context:s,forceRefresh:n,...o}=t,a=this.get(e,o);if(!n&&a!==void 0)return a;let u=i(e,a,{options:o,context:s});return this.set(e,u,o),u}get(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:o}=t,a=v(this,vt).get(e);if(a!==void 0){let u=v(this,de)[a],l=q(this,z,Je).call(this,u);return o&&v(this,bs).call(this,o,a),v(this,kr).call(this,a)?(o&&(o.get="stale"),l?(o&&i&&u.__staleWhileFetching!==void 0&&(o.returnedStale=true),i?u.__staleWhileFetching:void 0):(n||q(this,z,Gn).call(this,e,"expire"),o&&i&&(o.returnedStale=true),i?u:void 0)):(o&&(o.get="hit"),l?u.__staleWhileFetching:(q(this,z,cf).call(this,a),s&&v(this,Wa).call(this,a),u))}else o&&(o.get="miss");}delete(e){return q(this,z,Gn).call(this,e,"delete")}clear(){return q(this,z,lC).call(this,"delete")}};fi=new WeakMap,Mr=new WeakMap,pi=new WeakMap,za=new WeakMap,mi=new WeakMap,xc=new WeakMap,_c=new WeakMap,wt=new WeakMap,gi=new WeakMap,vt=new WeakMap,et=new WeakMap,de=new WeakMap,or=new WeakMap,Ir=new WeakMap,er=new WeakMap,Ft=new WeakMap,xi=new WeakMap,Gt=new WeakMap,_i=new WeakMap,bi=new WeakMap,Dr=new WeakMap,yi=new WeakMap,Un=new WeakMap,ar=new WeakMap,bc=new WeakMap,z=new WeakSet,oC=function(){let e=new mc(v(this,fi)),t=new mc(v(this,fi));ee(this,Dr,e),ee(this,bi,t),ee(this,hf,(n,o,a=pc.now())=>{if(t[n]=o!==0?a:0,e[n]=o,o!==0&&this.ttlAutopurge){let u=setTimeout(()=>{v(this,kr).call(this,n)&&q(this,z,Gn).call(this,v(this,et)[n],"expire");},o+1);u.unref&&u.unref();}}),ee(this,Wa,n=>{t[n]=e[n]!==0?pc.now():0;}),ee(this,bs,(n,o)=>{if(e[o]){let a=e[o],u=t[o];if(!a||!u)return;n.ttl=a,n.start=u,n.now=i||s();let l=n.now-u;n.remainingTTL=a-l;}});let i=0,s=()=>{let n=pc.now();if(this.ttlResolution>0){i=n;let o=setTimeout(()=>i=0,this.ttlResolution);o.unref&&o.unref();}return n};this.getRemainingTTL=n=>{let o=v(this,vt).get(n);if(o===void 0)return 0;let a=e[o],u=t[o];if(!a||!u)return 1/0;let l=(i||s())-u;return a-l},ee(this,kr,n=>{let o=t[n],a=e[n];return !!a&&!!o&&(i||s())-o>a});},Wa=new WeakMap,bs=new WeakMap,hf=new WeakMap,kr=new WeakMap,VM=function(){let e=new mc(v(this,fi));ee(this,gi,0),ee(this,_i,e),ee(this,Xa,t=>{ee(this,gi,v(this,gi)-e[t]),e[t]=0;}),ee(this,df,(t,i,s,n)=>{if(q(this,z,Je).call(this,i))return 0;if(!kn(s))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(s=n(i,t),!kn(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return s}),ee(this,yc,(t,i,s)=>{if(e[t]=i,v(this,Mr)){let n=v(this,Mr)-e[t];for(;v(this,gi)>n;)q(this,z,Nb).call(this,true);}ee(this,gi,v(this,gi)+e[t]),s&&(s.entrySize=i,s.totalCalculatedSize=v(this,gi));});},Xa=new WeakMap,yc=new WeakMap,df=new WeakMap,On=function*({allowStale:e=this.allowStale}={}){if(v(this,wt))for(let t=v(this,Ft);!(!q(this,z,aC).call(this,t)||((e||!v(this,kr).call(this,t))&&(yield t),t===v(this,er)));)t=v(this,Ir)[t];},Fn=function*({allowStale:e=this.allowStale}={}){if(v(this,wt))for(let t=v(this,er);!(!q(this,z,aC).call(this,t)||((e||!v(this,kr).call(this,t))&&(yield t),t===v(this,Ft)));)t=v(this,or)[t];},aC=function(e){return e!==void 0&&v(this,vt).get(v(this,et)[e])===e},Nb=function(e){var n;let t=v(this,er),i=v(this,et)[t],s=v(this,de)[t];return v(this,Un)&&q(this,z,Je).call(this,s)?s.__abortController.abort(new Error("evicted")):(v(this,yi)||v(this,ar))&&(v(this,yi)&&((n=v(this,pi))==null||n.call(this,s,i,"evict")),v(this,ar)&&v(this,Gt)?.push([s,i,"evict"])),v(this,Xa).call(this,t),e&&(v(this,et)[t]=void 0,v(this,de)[t]=void 0,v(this,xi).push(t)),v(this,wt)===1?(ee(this,er,ee(this,Ft,0)),v(this,xi).length=0):ee(this,er,v(this,or)[t]),v(this,vt).delete(i),Gf(this,wt)._--,t},Hb=function(e,t,i,s){let n=t===void 0?void 0:v(this,de)[t];if(q(this,z,Je).call(this,n))return n;let o=new Vb,{signal:a}=i;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let u={signal:o.signal,options:i,context:s},l=(b,_=false)=>{let{aborted:g}=o.signal,y=i.ignoreFetchAbort&&b!==void 0;if(i.status&&(g&&!_?(i.status.fetchAborted=true,i.status.fetchError=o.signal.reason,y&&(i.status.fetchAbortIgnored=true)):i.status.fetchResolved=true),g&&!y&&!_)return h(o.signal.reason);let S=p;return v(this,de)[t]===p&&(b===void 0?S.__staleWhileFetching?v(this,de)[t]=S.__staleWhileFetching:q(this,z,Gn).call(this,e,"fetch"):(i.status&&(i.status.fetchUpdated=true),this.set(e,b,u.options))),b},c=b=>(i.status&&(i.status.fetchRejected=true,i.status.fetchError=b),h(b)),h=b=>{let{aborted:_}=o.signal,g=_&&i.allowStaleOnFetchAbort,y=g||i.allowStaleOnFetchRejection,S=y||i.noDeleteOnFetchRejection,E=p;if(v(this,de)[t]===p&&(!S||E.__staleWhileFetching===void 0?q(this,z,Gn).call(this,e,"fetch"):g||(v(this,de)[t]=E.__staleWhileFetching)),y)return i.status&&E.__staleWhileFetching!==void 0&&(i.status.returnedStale=true),E.__staleWhileFetching;if(E.__returned===E)throw b},d=(b,_)=>{var y;let g=(y=v(this,xc))==null?void 0:y.call(this,e,n,u);g&&g instanceof Promise&&g.then(S=>b(S===void 0?void 0:S),_),o.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(b(void 0),i.allowStaleOnFetchAbort&&(b=S=>l(S,true)));});};i.status&&(i.status.fetchDispatched=true);let p=new Promise(d).then(l,c),m=Object.assign(p,{__abortController:o,__staleWhileFetching:n,__returned:void 0});return t===void 0?(this.set(e,m,{...u.options,status:void 0}),t=v(this,vt).get(e)):v(this,de)[t]=m,m},Je=function(e){if(!v(this,Un))return false;let t=e;return !!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof Vb},uC=function(e,t){v(this,Ir)[t]=e,v(this,or)[e]=t;},cf=function(e){e!==v(this,Ft)&&(e===v(this,er)?ee(this,er,v(this,or)[e]):q(this,z,uC).call(this,v(this,Ir)[e],v(this,or)[e]),q(this,z,uC).call(this,v(this,Ft),e),ee(this,Ft,e));},Gn=function(e,t){var s,n;let i=false;if(v(this,wt)!==0){let o=v(this,vt).get(e);if(o!==void 0)if(i=true,v(this,wt)===1)q(this,z,lC).call(this,t);else {v(this,Xa).call(this,o);let a=v(this,de)[o];if(q(this,z,Je).call(this,a)?a.__abortController.abort(new Error("deleted")):(v(this,yi)||v(this,ar))&&(v(this,yi)&&((s=v(this,pi))==null||s.call(this,a,e,t)),v(this,ar)&&v(this,Gt)?.push([a,e,t])),v(this,vt).delete(e),v(this,et)[o]=void 0,v(this,de)[o]=void 0,o===v(this,Ft))ee(this,Ft,v(this,Ir)[o]);else if(o===v(this,er))ee(this,er,v(this,or)[o]);else {let u=v(this,Ir)[o];v(this,or)[u]=v(this,or)[o];let l=v(this,or)[o];v(this,Ir)[l]=v(this,Ir)[o];}Gf(this,wt)._--,v(this,xi).push(o);}}if(v(this,ar)&&v(this,Gt)?.length){let o=v(this,Gt),a;for(;a=o?.shift();)(n=v(this,mi))==null||n.call(this,...a);}return i},lC=function(e){var t,i;for(let s of q(this,z,Fn).call(this,{allowStale:true})){let n=v(this,de)[s];if(q(this,z,Je).call(this,n))n.__abortController.abort(new Error("deleted"));else {let o=v(this,et)[s];v(this,yi)&&((t=v(this,pi))==null||t.call(this,n,o,e)),v(this,ar)&&v(this,Gt)?.push([n,o,e]);}}if(v(this,vt).clear(),v(this,de).fill(void 0),v(this,et).fill(void 0),v(this,Dr)&&v(this,bi)&&(v(this,Dr).fill(0),v(this,bi).fill(0)),v(this,_i)&&v(this,_i).fill(0),ee(this,er,0),ee(this,Ft,0),v(this,xi).length=0,ee(this,gi,0),ee(this,wt,0),v(this,ar)&&v(this,Gt)){let s=v(this,Gt),n;for(;n=s?.shift();)(i=v(this,mi))==null||i.call(this,...n);}};var zb=cC;var Tt=class{constructor(e){R(this,"cache");R(this,"map",new Map);this.cache=new zb({max:e.cacheSize}),this.map=new Map;}get[Symbol.iterator](){return this.map[Symbol.iterator]}get[Symbol.toStringTag](){return this.map[Symbol.toStringTag]}clear(){return this.cache.clear(),this.map.clear()}delete(e){let t=this.map.delete(e);return t&&this.cache.delete(e),t}get forEach(){return this.map.forEach}get(e){let t=this.cache.get(e);return t||this.map.get(e)}has(e){return this.map.has(e)}set(e,t){return this.map.set(e,t),this.cache.set(e,t),this}get size(){return this.map.size}entries(){return this.map.entries()}keys(){return this.map.keys()}values(){return this.map.values()}};var ff=new Tt({cacheSize:5});function zM(r){return function(e){Wb.add(e,r);}}var Wb;(s=>{function r(n,o){o||(o=n.name),ff.get(o)&&w.warn(`CanvasElement "${o}" already registered`),n.prototype.pixivnId=o,ff.set(o,n);}s.add=r;function e(n){try{let o=ff.get(n);if(!o){w.error(`CanvasElement "${n}" not found, did you forget to register it with the canvasComponentDecorator?`);return}return new o,o}catch(o){w.error(`Error while getting CanvasElement "${n}"`,o);return}}s.get=e;function t(){return Array.from(ff.values())}s.values=t;function i(n){return ff.has(n)}s.has=i;})(Wb||(Wb={}));var tr=Wb;var vc=new Tt({cacheSize:5});function WM(r){return function(e){Xb.add(e,r);}}var Xb;(n=>{function r(o,a){a||(a=o.name),vc.get(a)&&w.info(`Event "${a}" already exists, it will be overwritten`),o.prototype.id=a,vc.set(a,o);}n.add=r;function e(o){try{let a=vc.get(o);if(!a){w.error(`Event "${o}" not found, did you forget to register it with the eventDecorator?`);return}return new a,a}catch(a){w.error(`Error while getting Event "${o}"`,a);return}}n.get=e;function t(o){try{let a=vc.get(o);if(!a){w.error(`Event "${o}" not found, did you forget to register it with the eventDecorator?`);return}return new a}catch(a){w.error(`Error while getting Event "${o}"`,a);return}}n.getInstance=t;function i(){return Array.from(vc.values())}n.values=i;function s(o){return vc.has(o)}n.has=s;})(Xb||(Xb={}));var Hi=Xb;async function Yb(r){let e=oG(r.pixivnId);if(e)await e.setMemory(r);else throw new Error("[Pixi\u2019VN] The element "+r.pixivnId+" could not be created");return e}function oG(r){try{let e=tr.get(r);return e?new e:void 0}catch(e){w.error(`Error while getting CanvasElement ${r}`,e);return}}ke();function hC(r){return "memory"in r?r.memory:r instanceof exports.PixiJSText?dC(r):r instanceof exports.PixiJSSprite?pf(r):Ya(r)}function aG(r){return {width:r.width,height:r.height,isRenderGroup:r.isRenderGroup,blendMode:r.blendMode,tint:r.tint,alpha:r.alpha,angle:r.angle,renderable:r.renderable,rotation:r.rotation,scale:{x:r.scale.x,y:r.scale.y},pivot:{x:r.pivot.x,y:r.pivot.y},position:{x:r.position.x,y:r.position.y},skew:{x:r.skew.x,y:r.skew.y},visible:r.visible,x:r.x,y:r.y,boundsArea:r.boundsArea,cursor:r.cursor,eventMode:r.eventMode,interactive:r.interactive,interactiveChildren:r.interactiveChildren,hitArea:r.hitArea}}function XM(r,e){return {url:r.source.label,alias:e===r.source.label?void 0:e}}function Ya(r,e){let t=uG(r,hc),s=e?.childrenExport||false?r.children.sort((n,o)=>r.getChildIndex(n)-r.getChildIndex(o)).map(n=>hC(n)):[];return {pixivnId:t,elements:s,...aG(r)}}function pf(r){let e=Ya(r),t=e.pixivnId??dc,i=jM(r),s="textureAlias"in r?XM(r.texture,r.textureAlias):XM(r.texture);return {...e,pixivnId:t,textureData:s,anchor:{x:r.anchor.x,y:r.anchor.y},roundPixels:r.roundPixels,onEvents:i}}function dC(r){let e=Ya(r),t=e.pixivnId??fc,i=jM(r);return {...e,pixivnId:t,anchor:{x:r.anchor.x,y:r.anchor.y},text:r.text,resolution:r.resolution,style:lG(r.style),roundPixels:r.roundPixels,onEvents:i}}function uG(r,e){return Object.prototype.hasOwnProperty.call(r,"pixivnId")?r.pixivnId:e}function jM(r){return "onEvents"in r?r.onEvents:{}}function YM(r,e){if(typeof r!="object"||r===null)return r;w.warn(`Unsupported property type for Text.style.${e}: FillGradient or FillPattern.`,r);}function lG(r){return {align:r.align,breakWords:r.breakWords,dropShadow:r.dropShadow,fill:YM(r.stroke,"fill"),fontFamily:r.fontFamily,fontSize:r.fontSize,fontStyle:r.fontStyle,fontVariant:r.fontVariant,fontWeight:r.fontWeight,leading:r.leading,letterSpacing:r.letterSpacing,lineHeight:r.lineHeight,padding:r.padding,stroke:YM(r.stroke,"stroke"),textBaseline:r.textBaseline,trim:r.trim,whiteSpace:r.whiteSpace,wordWrap:r.wordWrap,wordWrapWidth:r.wordWrapWidth}}var Ln=class extends exports.PixiJSContainer{constructor(t){super(t);R(this,"pixivnId",hc);R(this,"_onEvents",{});this.pixivnId=this.constructor.prototype.pixivnId||hc;}get memory(){return Ya(this,{childrenExport:true})}set memory(t){}async setMemory(t){return this.memory=t,await this.importChildren(t),await Vi(this,t)}async importChildren(t){for(let i=0;i<t.elements.length;i++){let s=t.elements[i],n=await Yb(s);this.addChild(n);}}get onEvents(){return this._onEvents}onEvent(t,i){let s=i.prototype.id,n=Hi.getInstance(s);return this._onEvents[t]=s,n?super.on(t,()=>{n.fn(t,this);}):w.error(`Event ${s} not found`),this}on(t,i,s){return super.on(t,i,s)}};tr.add(Ln,hc);async function Vi(r,e,t){let i=t?.ignoreScale||false,s=t?.end;"isRenderGroup"in e&&e.isRenderGroup!==void 0&&(r.isRenderGroup=e.isRenderGroup),"blendMode"in e&&e.blendMode!==void 0&&(r.blendMode=e.blendMode),"tint"in e&&e.tint!==void 0&&(r.tint=e.tint),"alpha"in e&&e.alpha!==void 0&&(r.alpha=e.alpha),"angle"in e&&e.angle!==void 0&&(r.angle=e.angle),"renderable"in e&&e.renderable!==void 0&&(r.renderable=e.renderable),"rotation"in e&&e.rotation!==void 0&&(r.rotation=e.rotation),!i&&"scale"in e&&e.scale!==void 0&&(typeof e.scale=="number"?r.scale.set(e.scale,e.scale):r.scale.set(e.scale.x,e.scale.y)),"pivot"in e&&e.pivot!==void 0&&(typeof e.pivot=="number"?r.pivot.set(e.pivot,e.pivot):r.pivot.set(e.pivot.x,e.pivot.y)),"position"in e&&e.position!==void 0&&r.position.set(e.position.x,e.position.y),"skew"in e&&e.skew!==void 0&&r.skew.set(e.skew.x,e.skew.y),"visible"in e&&e.visible!==void 0&&(r.visible=e.visible),"x"in e&&e.x!==void 0&&(r.x=e.x),"y"in e&&e.y!==void 0&&(r.y=e.y),"boundsArea"in e&&e.boundsArea!==void 0&&(r.boundsArea=e.boundsArea),"cursor"in e&&e.cursor!==void 0&&(r.cursor=e.cursor),"eventMode"in e&&e.eventMode!==void 0&&(r.eventMode=e.eventMode),"interactive"in e&&e.interactive!==void 0&&(r.interactive=e.interactive),"interactiveChildren"in e&&e.interactiveChildren!==void 0&&(r.interactiveChildren=e.interactiveChildren),"hitArea"in e&&e.hitArea!==void 0&&(r.hitArea=e.hitArea),s&&await s(),i||("width"in e&&e.width!==void 0&&(r.width=e.width),"height"in e&&e.height!==void 0&&(r.height=e.height));}ke();var mf=class mf{static init(e){mf._getScreen=e.getScreen;}static get screen(){return mf._getScreen()}};R(mf,"_getScreen");var yr=mf;function ys(r,e,t,i,s,n=0){return i=i*(s?-1:1),r==="width"?e*(yr.screen.width-t)+i+n*t+(s?t:0):e*(yr.screen.height-t)+i+n*t+(s?t:0)}function zi(r,e,t,i,s,n=0){return i=i*(s?-1:1),r==="width"?(e-i-n*t-(s?t:0))/(yr.screen.width-t):(e-i-n*t-(s?t:0))/(yr.screen.height-t)}function vs(r,e){return r==="width"?e*yr.screen.width:e*yr.screen.height}function Wi(r,e){return r==="width"?e/yr.screen.width:e/yr.screen.height}function pt(r,e){if(e=e%360,e<0&&(e+=360),e===0)return {x:r.x,y:r.y};if(e===90)return {x:-r.y,y:r.x};if(e===180)return {x:-r.x,y:-r.y};if(e===270)return {x:r.y,y:-r.x};if(e>0&&e<90){let t=e*Math.PI/180,i=Math.cos(t),s=Math.sin(t),n=r.x*i-r.y*s,o=r.x*s+r.y*i;return r.x!==0&&Math.sign(n)!==Math.sign(r.x)&&(n=-n),r.y!==0&&Math.sign(o)!==Math.sign(r.y)&&(o=-o),{x:n,y:o}}else if(e>90&&e<180){let t=(e-90)*Math.PI/180,i=Math.cos(t),s=Math.sin(t),n=-r.y*s-r.x*i,o=r.y*i-r.x*s;return r.x!==0&&Math.sign(n)!==Math.sign(r.x)&&(n=-n),r.y!==0&&Math.sign(o)!==Math.sign(r.y)&&(o=-o),{x:n,y:o}}else if(e>180&&e<270){let t=(e-180)*Math.PI/180,i=Math.cos(t),s=Math.sin(t),n=-r.x*i+r.y*s,o=-r.x*s-r.y*i;return r.x!==0&&Math.sign(n)!==Math.sign(r.x)&&(n=-n),r.y!==0&&Math.sign(o)!==Math.sign(r.y)&&(o=-o),{x:n,y:o}}else if(e>270&&e<360){let t=(e-270)*Math.PI/180,i=Math.cos(t),s=Math.sin(t),n=r.y*s-r.x*i,o=-r.y*i-r.x*s;return r.x!==0&&Math.sign(n)!==Math.sign(r.x)&&(n=-n),r.y!==0&&Math.sign(o)!==Math.sign(r.y)&&(o=-o),{x:n,y:o}}return {x:0,y:0}}function fC(r,e){if(e=e%360,e<0&&(e+=360),e===0)return {x:r.x,y:r.y};if(e===90)return {x:r.y,y:-r.x};if(e===180)return {x:-r.x,y:-r.y};if(e===270)return {x:-r.y,y:r.x};if(e>0&&e<90){let t=e*Math.PI/180,i=Math.cos(t),s=Math.sin(t);return {x:r.x*i+r.y*s,y:-r.x*s+r.y*i}}else if(e>90&&e<180){let t=(e-90)*Math.PI/180,i=Math.cos(t),s=Math.sin(t);return {x:r.y*i-r.x*s,y:-r.y*s-r.x*i}}else if(e>180&&e<270){let t=(e-180)*Math.PI/180,i=Math.cos(t),s=Math.sin(t);return {x:-r.x*i-r.y*s,y:r.x*s-r.y*i}}else if(e>270&&e<360){let t=(e-270)*Math.PI/180,i=Math.cos(t),s=Math.sin(t);return {x:-r.y*i+r.x*s,y:r.y*s+r.x*i}}return {x:0,y:0}}function Xi(r){let e=r.width,t=r.height,i=r.angle%360;return i<0&&(i+=360),i===0||i===180?e:i===90||i===270?t:Math.abs(e*Math.cos(i*Math.PI/180))+Math.abs(t*Math.sin(i*Math.PI/180))}function Yi(r){let e=r.width,t=r.height,i=r.angle%360;return i<0&&(i+=360),i===0||i===180?t:i===90||i===270?e:Math.abs(t*Math.cos(i*Math.PI/180))+Math.abs(e*Math.sin(i*Math.PI/180))}ke();var cG=new RegExp(`(${BM.join("|")})$`);function gf(r){let e=exports.Assets.cache.has(r)?exports.Assets.get(r):null;return e instanceof exports.Texture&&(r=e.source?.label||r),cG.test(r)}function ja(r){return r&&(typeof r.align!="number"&&(r.xAlign!=null&&(r.align===void 0?(r.align={x:r.xAlign},delete r.xAlign):(r.align.x=r.xAlign,delete r.xAlign)),r.yAlign!=null&&(r.align===void 0?(r.align={y:r.yAlign},delete r.yAlign):(r.align.y=r.yAlign,delete r.yAlign))),typeof r.percentagePosition!="number"&&(r.xPercentagePosition!=null&&(r.percentagePosition===void 0?(r.percentagePosition={x:r.xPercentagePosition},delete r.xPercentagePosition):(r.percentagePosition.x=r.xPercentagePosition,delete r.xPercentagePosition)),r.yPercentagePosition!=null&&(r.percentagePosition===void 0?(r.percentagePosition={y:r.yPercentagePosition},delete r.yPercentagePosition):(r.percentagePosition.y=r.yPercentagePosition,delete r.yPercentagePosition))),r)}ke();ke();async function vi(r){if(r!=="EMPTY"){if(!r){w.error("Texture not found",r);return}if(exports.Assets.cache.has(r)){let e=exports.Assets.get(r);if(e)return e}return exports.Assets.load(r).then(e=>{if(!e){w.error("Texture not found",r);return}if(!(e instanceof exports.Texture)){w.error("File not is a file",r);return}return e}).catch(e=>{w.error("Error loading file",e);})}}ke();var ji=class r extends exports.PixiJSSprite{constructor(t){super(t);R(this,"pixivnId",dc);R(this,"_textureAlias");R(this,"_onEvents",{});this.pixivnId=this.constructor.prototype.pixivnId||dc;}get textureAlias(){return this._textureAlias?this._textureAlias:this.texture.source.label}set textureAlias(t){this._textureAlias=t;}get memory(){return pf(this)}set memory(t){}async setMemory(t){return this.memory=t,await xf(this,t)}get onEvents(){return this._onEvents}onEvent(t,i){let s=i.prototype.id,n=Hi.getInstance(s);return this._onEvents[t]=s,n?(super.on(t,()=>{n.fn(t,this);}),this.interactive||(this.interactive=true,this.eventMode="dynamic")):w.error(`Event ${s} not found`),this}on(t,i,s){return super.on(t,i,s)}static from(t,i){let s=exports.PixiJSSprite.from(t,i),n=new r;return n.texture=s.texture,n}};tr.add(ji,dc);async function xf(r,e,t){let i=t?.ignoreTexture||false;if(await Vi(r,e),!i){if("textureImage"in e&&e.textureImage&&e.textureImage.image){let n=await vi(e.textureImage.image);n&&(r.texture=n);}if("textureData"in e&&(e.textureData.alias&&(r.textureAlias=e.textureData.alias),e.textureData.url!=="EMPTY")){let n=e.textureData.url;e.textureData.alias&&exports.Assets.resolver.hasKey(e.textureData.alias)&&(n=e.textureData.alias);let o=await vi(n);o&&(r.texture=o);}}let s=t?.half;if(s&&await s(),"anchor"in e&&e.anchor!==void 0&&(typeof e.anchor=="number"?r.anchor.set(e.anchor,e.anchor):r.anchor.set(e.anchor.x,e.anchor.y)),"roundPixels"in e&&e.roundPixels!==void 0&&(r.roundPixels=e.roundPixels),"onEvents"in e)for(let n in e.onEvents){let o=e.onEvents[n],a=Hi.get(o);a&&r.onEvent(n,a);}}var Ue=class r extends ji{constructor(t,i){t=ja(t);let s,n;t&&"align"in t&&t?.align!==void 0&&(s=t.align,delete t.align),t&&"percentagePosition"in t&&t?.percentagePosition!==void 0&&(n=t.percentagePosition,delete t.percentagePosition);super(t);R(this,"pixivnId",tC);R(this,"_loadIsStarted",false);R(this,"_align");R(this,"_percentagePosition");i&&(this.textureAlias=i),s&&(this.align=s),n&&(this.percentagePosition=n);}get memory(){return {...pf(this),pixivnId:this.pixivnId,align:this._align,percentagePosition:this._percentagePosition,loadIsStarted:this._loadIsStarted}}set memory(t){}async setMemory(t){this.memory=t,await _f(this,t),this.reloadPosition();}static from(t,i){let s=exports.PixiJSSprite.from(t,i),n=new r;return n.texture=s.texture,n}get loadIsStarted(){return this._loadIsStarted}async load(){return this._loadIsStarted=true,vi(this.textureAlias).then(t=>{this._loadIsStarted=false,t&&(this.texture=t);}).catch(t=>{this._loadIsStarted=false,w.error("Error into ImageSprite.load()",t);})}set texture(t){super.texture=t,this.reloadPosition();}get texture(){return super.texture}get haveEmptyTexture(){return this.texture._source.label==="EMPTY"}set align(t){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),typeof t=="number"?(this._align.x=t,this._align.y=t):(t.x!==void 0&&(this._align.x=t.x),t.y!==void 0&&(this._align.y=t.y)),this.reloadPosition();}get align(){let t=pt(this.pivot,this.angle),i=pt(this.scale,this.angle);return {x:zi("width",this.x,Xi(this),t.x,i.x<0,this.anchor.x),y:zi("height",this.y,Yi(this),t.y,i.y<0,this.anchor.y)}}set xAlign(t){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),this._align.x=t,this.reloadPosition();}get xAlign(){let t=pt(this.pivot,this.angle),i=pt(this.scale,this.angle);return zi("width",this.x,Xi(this),t.x,i.x<0,this.anchor.x)}set yAlign(t){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),this._align.y=t,this.reloadPosition();}get yAlign(){let t=pt(this.pivot,this.angle),i=pt(this.scale,this.angle);return zi("height",this.y,Yi(this),t.y,i.y<0,this.anchor.y)}set percentagePosition(t){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),typeof t=="number"?(this._percentagePosition.x=t,this._percentagePosition.y=t):(t.x!==void 0&&(this._percentagePosition.x=t.x),t.y!==void 0&&(this._percentagePosition.y=t.y)),this.reloadPosition();}get percentagePosition(){return {x:Wi("width",this.x),y:Wi("height",this.y)}}get xPercentagePosition(){return Wi("width",this.x)}set xPercentagePosition(t){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.x=t,this.reloadPosition();}get yPercentagePosition(){return Wi("height",this.y)}set yPercentagePosition(t){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.y=t,this.reloadPosition();}get positionType(){return this._align?"align":this._percentagePosition?"percentage":"pixel"}get positionInfo(){return this._align?{x:this._align.x||0,y:this._align.y||0,type:"align"}:this._percentagePosition?{x:this._percentagePosition.x||0,y:this._percentagePosition.y||0,type:"percentage"}:{x:this.x,y:this.y,type:"pixel"}}set positionInfo(t){t.type==="align"?this.align={x:t.x,y:t.y}:t.type==="percentage"?this.percentagePosition={x:t.x,y:t.y}:this.position.set(t.x,t.y);}reloadPosition(){if(this._align){let t=pt(this.pivot,this.angle),i=pt(this.scale,this.angle);this._align.x!==void 0&&(super.x=ys("width",this._align.x,Xi(this),t.x,i.x<0,this.anchor.x)),this._align.y!==void 0&&(super.y=ys("height",this._align.y,Yi(this),t.y,i.y<0,this.anchor.y));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=vs("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=vs("height",this._percentagePosition.y)));}get position(){return super.position}set position(t){this._align=void 0,this._percentagePosition=void 0,super.position=t;}get x(){return super.x}set x(t){this._align=void 0,this._percentagePosition=void 0,super.x=t;}get y(){return super.y}set y(t){this._align=void 0,this._percentagePosition=void 0,super.y=t;}};tr.add(Ue,tC);async function _f(r,e,t){let i=t?.ignoreTexture||false;return e=ja(e),await xf(r,e,{half:async()=>{"align"in e&&e.align!==void 0&&(r.align=e.align),"percentagePosition"in e&&e.percentagePosition!==void 0&&(r.percentagePosition=e.percentagePosition),i||"imageLink"in e&&e.imageLink!==void 0&&(r.textureAlias=e.imageLink),"loadIsStarted"in e&&e.loadIsStarted&&await r.load();},ignoreTexture:t?.ignoreTexture})}ke();var Jt=class r extends Ue{constructor(t,i){let s,n,o;t&&"loop"in t&&t?.loop!==void 0&&(s=t.loop,delete t.loop),t&&"paused"in t&&t?.paused!==void 0&&(n=t.paused,delete t.paused),t&&"currentTime"in t&&t?.currentTime!==void 0&&(o=t.currentTime,delete t.currentTime);super(t,i);R(this,"pixivnId",rC);R(this,"_looop",false);R(this,"_paused",false);R(this,"_currentTime",0);s&&(this.loop=s),n&&(this.paused=n),o&&(this.currentTime=o);}get memory(){return {...super.memory,pixivnId:this.pixivnId,loop:this.loop,paused:this._paused,currentTime:this.currentTime}}set memory(t){}async setMemory(t){return this.memory=t,await pC(this,t)}static from(t,i){let s=exports.PixiJSSprite.from(t,i),n=new r;return n.texture=s.texture,n}async load(){await super.load(),this.loop=this._looop,this.currentTime=this._currentTime,this.paused=this._paused;}get loop(){return this.texture?.source?.resource?.loop||false}set loop(t){this._looop=t,this.texture?.source?.resource&&(this.texture.source.resource.loop=t);}get paused(){return this.texture?.source?.resource?.paused||false}set paused(t){t?this.pause():this.play();}pause(){this._paused=true,this.texture?.source?.resource&&this.texture.source.resource.pause();}play(){this._paused=false,this.texture?.source?.resource&&this.texture.source.resource.play();}get currentTime(){return this.texture?.source?.resource?.currentTime||0}set currentTime(t){let i=this.duration;i&&t>=i&&(t=0),this._currentTime=t,this.texture?.source?.resource&&(this.texture.source.resource.currentTime=t);}restart(){this.currentTime=0;}get duration(){if(this.texture?.source?.resource)return this.texture.source.resource.duration||0}};tr.add(Jt,rC);async function pC(r,e,t){await _f(r,e,{ignoreTexture:t?.ignoreTexture}),"loop"in e&&e.loop!==void 0&&(r.loop=e.loop),"currentTime"in e&&e.currentTime!==void 0&&(r.currentTime=e.currentTime),"paused"in e&&e.paused!==void 0&&(r.paused=e.paused);}var Ze=class extends Ln{constructor(t,i=[]){t=ja(t);let s,n,o;t&&"anchor"in t&&t?.anchor!==void 0&&(o=t.anchor,delete t.anchor),t&&"align"in t&&t?.align!==void 0&&(s=t.align,delete t.align),t&&"percentagePosition"in t&&t?.percentagePosition!==void 0&&(n=t.percentagePosition,delete t.percentagePosition);super(t);R(this,"pixivnId",Gb);R(this,"_loadIsStarted",false);R(this,"_anchor");R(this,"_align");R(this,"_percentagePosition");t=ja(t),i&&i.forEach(a=>{let u;gf(a)?u=new Jt(void 0,a):u=new Ue(void 0,a),this.addChild(u);}),o&&(this.anchor=o),s&&(this.align=s),n&&(this.percentagePosition=n);}get memory(){return {...super.memory,pixivnId:Gb,anchor:this._anchor,align:this._align,percentagePosition:this._percentagePosition,loadIsStarted:this._loadIsStarted}}set memory(t){}async setMemory(t){this.memory=t,await this.importChildren(t),await mC(this,t),this.reloadAnchor(),this.reloadPosition();}get loadIsStarted(){return this._loadIsStarted}async load(){this._loadIsStarted=true;let t=Array(this.children.length);for(let i=0;i<this.children.length;i++)t[i]=this.children[i].load();return Promise.all(t).then(()=>{this._loadIsStarted=false,this.reloadAnchor(),this.reloadPosition();}).catch(i=>{this._loadIsStarted=false,w.error("Error into ImageContainer.load()",i);})}get texture(){return this.children.length>0?this.children[0].texture:new exports.Texture}get haveEmptyTexture(){return this.children.some(t=>t.texture._source.label==="EMPTY")}get anchor(){let t=super.pivot.x/this.width,i=super.pivot.y/this.height;return {x:t,y:i}}set anchor(t){typeof t=="number"?this._anchor={x:t,y:t}:this._anchor=t,this.reloadAnchor();}reloadAnchor(){this._anchor&&super.pivot.set(this._anchor.x*this.width,this._anchor.y*this.height);}get pivot(){return super.pivot}set pivot(t){this._anchor=void 0,super.pivot=t;}set align(t){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),typeof t=="number"?(this._align.x=t,this._align.y=t):(t.x!==void 0&&(this._align.x=t.x),t.y!==void 0&&(this._align.y=t.y)),this.reloadPosition();}get align(){let t=pt(this.pivot,this.angle),i=pt(this.scale,this.angle);return {x:zi("width",this.x,Xi(this),t.x,i.x<0,this.anchor.x),y:zi("height",this.y,Yi(this),t.y,i.y<0,this.anchor.y)}}set xAlign(t){this._percentagePosition&&(this._percentagePosition=void 0),this._align===void 0&&(this._align={}),this._align.x=t,this.reloadPosition();}get xAlign(){let t=pt(this.pivot,this.angle),i=pt(this.scale,this.angle);return zi("width",this.x,Xi(this),t.x,i.x<0,this.anchor.x)}set yAlign(t){this._percentagePosition&&(this._percentagePosition=void 0),this._align===void 0&&(this._align={}),this._align.y=t,this.reloadPosition();}get yAlign(){let t=pt(this.pivot,this.angle),i=pt(this.scale,this.angle);return zi("height",this.y,Yi(this),t.y,i.y<0,this.anchor.y)}set percentagePosition(t){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),typeof t=="number"?(this._percentagePosition.x=t,this._percentagePosition.y=t):(t.x!==void 0&&(this._percentagePosition.x=t.x),t.y!==void 0&&(this._percentagePosition.y=t.y)),this.reloadPosition();}get percentagePosition(){return {x:Wi("width",this.x),y:Wi("height",this.y)}}set xPercentagePosition(t){this._align&&(this._align=void 0),this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.x=t,this.reloadPosition();}get xPercentagePosition(){return Wi("width",this.x)}set yPercentagePosition(t){this._align&&(this._align=void 0),this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.y=t,this.reloadPosition();}get yPercentagePosition(){return Wi("height",this.y)}get positionType(){return this._align?"align":this._percentagePosition?"percentage":"pixel"}get positionInfo(){return this._align?{x:this._align.x||0,y:this._align.y||0,type:"align"}:this._percentagePosition?{x:this._percentagePosition.x||0,y:this._percentagePosition.y||0,type:"percentage"}:{x:this.x,y:this.y,type:"pixel"}}set positionInfo(t){t.type==="align"?this.align={x:t.x,y:t.y}:t.type==="percentage"?this.percentagePosition={x:t.x,y:t.y}:this.position.set(t.x,t.y);}reloadPosition(){if(this._align){let t=pt(this.pivot,this.angle),i=pt(this.scale,this.angle);this._align.x!==void 0&&(super.x=ys("width",this._align.x,Xi(this),t.x,i.x<0)),this._align.y!==void 0&&(super.y=ys("height",this._align.y,Yi(this),t.y,i.y<0));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=vs("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=vs("height",this._percentagePosition.y)));}get position(){return super.position}set position(t){this._align=void 0,this._percentagePosition=void 0,super.position=t;}get x(){return super.x}set x(t){this._align=void 0,this._percentagePosition=void 0,super.x=t;}get y(){return super.y}set y(t){this._align=void 0,this._percentagePosition=void 0,super.y=t;}};tr.add(Ze,Gb);async function mC(r,e,t){e=ja(e),Vi(r,e,{...t,end:async()=>{"anchor"in e&&e.anchor!==void 0&&(r.anchor=e.anchor),"align"in e&&e.align!==void 0&&(r.align=e.align),"percentagePosition"in e&&e.percentagePosition!==void 0&&(r.percentagePosition=e.percentagePosition),"loadIsStarted"in e&&e.loadIsStarted&&await r.load();}});}ke();var Nn=class extends exports.PixiJSText{constructor(t){super(t);R(this,"pixivnId",fc);R(this,"_onEvents",{});this.pixivnId=this.constructor.prototype.pixivnId||fc;}get memory(){return dC(this)}set memory(t){}async setMemory(t){return this.memory=t,await gC(this,t)}get onEvents(){return this._onEvents}onEvent(t,i){let s=i.prototype.id,n=Hi.getInstance(s);return this._onEvents[t]=s,n?(super.on(t,()=>{n.fn(t,this);}),this.interactive||(this.interactive=true,this.eventMode="dynamic")):w.error(`Event ${s} not found`),this}on(t,i,s){return super.on(t,i,s)}};tr.add(Nn,fc);async function gC(r,e){if(await Vi(r,e),"anchor"in e&&e.anchor!==void 0&&(typeof e.anchor=="number"?r.anchor.set(e.anchor,e.anchor):r.anchor.set(e.anchor.x,e.anchor.y)),"text"in e&&e.text!==void 0&&(r.text=e.text),"resolution"in e&&e.resolution!==void 0&&(r.resolution=e.resolution),"style"in e&&e.style!==void 0&&(r.style=e.style),"roundPixels"in e&&e.roundPixels!==void 0&&(r.roundPixels=e.roundPixels),"onEvents"in e)for(let t in e.onEvents){let i=e.onEvents[t],s=Hi.get(i);s&&r.onEvent(t,s);}}var ur=class{constructor(e,t,i){R(this,"id","ticker_id_not_set");R(this,"args");R(this,"duration");R(this,"priority");this.args=e,this.duration=t,this.priority=i,this.id=this.constructor.prototype.id;}fn(e,t,i,s){throw new Error("[Pixi\u2019VN] The method TickerBase.fn() must be overridden")}onEndOfTicker(e,t,i){let s="aliasToRemoveAfter"in i&&i.aliasToRemoveAfter||[];typeof s=="string"&&(s=[s]);let n="tickerAliasToResume"in i&&i.tickerAliasToResume||[];typeof n=="string"&&(n=[n]),I.onEndOfTicker(t,{aliasToRemoveAfter:s,tickerAliasToResume:n});}};var Tc=new Tt({cacheSize:5});function $M(r){return function(e){jb.add(e,r);}}var jb;(n=>{function r(o,a){a||(a=o.name),Tc.get(a)&&w.info(`Ticker "${a}" already exists, it will be overwritten`),o.prototype.id=a,Tc.set(a,o);}n.add=r;function e(o){try{let a=Tc.get(o);if(!a){w.error(`Event "${o}" not found, did you forget to register it with the tickerDecorator?`);return}return a}catch(a){w.error(`Error while getting Event "${o}"`,a);return}}n.get=e;function t(o,a,u,l){try{let c=Tc.get(o);if(!c){w.error(`Ticker "${o}" not found, did you forget to register it with the tickerDecorator?`);return}return new c(a,u,l)}catch(c){w.error(`Error while getting Ticker "${o}"`,c);return}}n.getInstance=t;function i(){return Array.from(Tc.values())}n.values=i;function s(o){return Tc.has(o)}n.has=s;})(jb||(jb={}));var lr=jb;var Sc="aliasToRemoveAfter";var bf=class{get app(){return O.app}get gameLayer(){return O.gameLayer}get isInitialized(){return O._isInitialized}get htmlLayout(){return O.htmlLayers[0]}set htmlLayout(e){this.addHtmlLayer("ui",e);}get canvasWidth(){return O.canvasWidth}get canvasHeight(){return O.canvasHeight}set canvasWidth(e){O.canvasWidth=e;}set canvasHeight(e){O.canvasHeight=e;}get screen(){return this.app.screen}async init(e,t,i,s,n){if(typeof t=="number"&&typeof i=="number")return await O.init(e,t,i,s,n);if(typeof t!="number"&&typeof i!="number")return await O.init(e,t.width,t.height,t,i);throw new Error("Invalid parameters")}initializeHTMLLayout(e){this.addHtmlLayer("ui",e);}get children(){return O.gameLayer.children}async copyCanvasElementProperty(e,t){if(typeof t=="string"){let i=this.find(t);if(i)t=i;else {w.error(`Canvas element ${t} not found`);return}}if(typeof e=="string"){let i=this.find(e);if(i)e=i;else {w.error(`Canvas element ${e} not found`);return}}e instanceof exports.PixiJSContainer&&(e=e.memory),"isRenderGroup"in e&&delete e.isRenderGroup,"scale"in e&&delete e.scale,"visible"in e&&delete e.visible,"boundsArea"in e&&delete e.boundsArea,"text"in e&&delete e.text,"resolution"in e&&delete e.resolution,"style"in e&&delete e.style,"height"in e&&delete e.height,"width"in e&&delete e.width,t instanceof Jt?await pC(t,e,{ignoreTexture:true}):t instanceof Ue?await _f(t,e,{ignoreTexture:true}):t instanceof ji?await xf(t,e,{ignoreTexture:true}):t instanceof Nn?await gC(t,e):t instanceof Ze?await mC(t,e):t instanceof exports.PixiJSContainer&&await Vi(t,e);}transferTickers(e,t,i="move"){O._currentTickersSequence[e]&&(i==="move"?O._currentTickersSequence[t]=fe(O._currentTickersSequence[e]):i==="duplicate"&&(O._currentTickersSequence[t]=fe(O._currentTickersSequence[e]))),Object.entries(O._currentTickers).forEach(([s,n])=>{if(n.createdByTicketSteps?.canvasElementAlias===e&&this.removeTicker(s),n.canvasElementAliases.includes(e)&&(i==="move"?n.canvasElementAliases=n.canvasElementAliases.map(o=>o===e?t:o):i==="duplicate"&&n.canvasElementAliases.find(o=>o===e)&&n.canvasElementAliases.push(t),n.args.hasOwnProperty(Sc))){let o=n.args.aliasToRemoveAfter;typeof o=="string"&&(o=[o]),Array.isArray(o)&&(i==="move"?n.args.aliasToRemoveAfter=o.map(a=>a===e?t:a):i==="duplicate"&&o.find(a=>a===e)&&(n.args.aliasToRemoveAfter=[...o,t]));}}),Object.values(O._currentTickersTimeouts).forEach(s=>{s.aliases.includes(e)&&(i==="move"?s.aliases=s.aliases.map(n=>n===e?t:n):i==="duplicate"&&s.aliases.find(n=>n===e)&&s.aliases.push(t));}),O._currentTickersSequence[t]&&Object.keys(O._currentTickersSequence[t]).forEach(s=>{this.runTickersSequence(t,s);}),i==="duplicate"&&O._currentTickersSequence[e]&&Object.keys(O._currentTickersSequence[e]).forEach(s=>{this.runTickersSequence(e,s);});}add(e,t,i={}){if(e===br){w.error(`The alias ${br} is reserved`);return}let s=this.find(e),n=i?.ignoreOldStyle;s&&!n&&this.copyCanvasElementProperty(s,t);let o=i.zIndex;s&&!this.gameLayer.children.includes(s)?w.error(`The canvas element ${e} exist in the memory but it is not on the canvas, so the zIndex is not set`):s&&(o===void 0&&(o=this.gameLayer.getChildIndex(s)),this.remove(e,{ignoreTickers:true})),o!==void 0?(t.label=e,this.gameLayer.addChildAt(t,o)):(t.label=e,this.gameLayer.addChild(t));}remove(e,t={}){if(e===br){w.error(`The alias ${br} is reserved`);return}let i=t.ignoreTickers;typeof e=="string"&&(e=[e]),e.forEach(s=>{this.gameLayer.getChildrenByLabel(s).forEach(n=>{this.gameLayer.removeChild(n),!i&&this.unlinkComponentFromTicker(s);});});}find(e){if(e===br)return this.gameLayer;let t=this.gameLayer.getChildByLabel(e);if(t)return t}canvasElementIsOnCanvas(e){return this.gameLayer.children.includes(e)}removeAll(){this.gameLayer.removeChildren(),this.removeAllTickers();}editAlias(e,t,i={}){let s=this.find(e);s&&(s.label=t),!i.ignoreTickers&&this.transferTickers(e,t,"move");}get currentTickers(){return O._currentTickers}get currentTickersSteps(){return O._currentTickersSequence}addTicker(e,t){let i=t.id;if(typeof e=="string"&&(e=[e]),!lr.getInstance(i,t.args,t.duration,t.priority)){w.error(`Ticker ${i} not found`);return}let s={fn:()=>{},id:i,args:fe(t.args),canvasElementAliases:e,priority:t.priority,duration:t.duration,onEndOfTicker:()=>{}},n=O.generateTickerId(s);if(this.pushTicker(n,s,t),this.pushEndOfTicker(n,s,t),t.duration){let o=setTimeout(()=>{O.removeTickerTimeoutInfo(o),O._currentTickersTimeouts[o.toString()]&&this.onEndOfTicker(n,{aliasToRemoveAfter:Sc in t.args?t.args.aliasToRemoveAfter||[]:[],tickerAliasToResume:"tickerAliasToResume"in t.args?t.args.tickerAliasToResume||[]:[],ignoreTickerSteps:true});},t.duration*1e3);O.addTickerTimeoutInfo(e,i,o.toString(),true);}return n}pushTicker(e,t,i){O._currentTickers[e]=t,t.fn=s=>{let n=O._currentTickers[e];if(n){let o=n.canvasElementAliases;if(t.createdByTicketSteps){if(this.isTickerPaused(t.createdByTicketSteps.canvasElementAlias,t.createdByTicketSteps.id))return}else o=o.filter(a=>!this.isTickerPaused(a,e));i?.fn(s,n.args,o,e);}},this.app.ticker.add(t.fn,void 0,t.priority);}pushEndOfTicker(e,t,i){t.onEndOfTicker=()=>{i.onEndOfTicker(t.canvasElementAliases,e,t.args);};}addTickersSequence(e,t,i=0){if(t.length==0){w.warn("The steps of the tickers is empty");return}e in O._currentTickersSequence||(O._currentTickersSequence[e]={});let s={currentStepNumber:i,steps:t.map(o=>o===Dn||o.hasOwnProperty("type")&&o.type==="pause"?o:{ticker:o.id,args:fe(o.args),duration:o.duration})},n=O.generateTickerId(s);return O._currentTickersSequence[e][n]=s,this.runTickersSequence(e,n),n}runTickersSequence(e,t){if(!O._currentTickersSequence[e]||!O._currentTickersSequence[e][t])return;let i=O._currentTickersSequence[e][t].steps[O._currentTickersSequence[e][t].currentStepNumber];if(i===Dn&&(i=O._currentTickersSequence[e][t].steps[0],O._currentTickersSequence[e][t].currentStepNumber=0,i===Dn)){w.error("TikersSteps has a RepeatType in the first step");return}if(i.hasOwnProperty("type")&&i.type==="pause"){let u=setTimeout(()=>{let l=O._currentTickersTimeouts[u.toString()];l&&l.aliases.forEach(c=>{this.nextTickerStep(c,t);}),O.removeTickerTimeoutInfo(u);},i.duration*1e3);O.addTickerTimeoutInfo(e,"steps",u.toString(),false);return}let s=lr.getInstance(i.ticker,i.args,i.duration,i.priority);if(!s){w.error(`Ticker ${i.ticker} not found`);return}let n=s.id,o={fn:()=>{},id:n,args:fe(s.args),canvasElementAliases:[e],priority:s.priority,duration:s.duration,createdByTicketSteps:{canvasElementAlias:e,id:t},onEndOfTicker:()=>{}},a=O.generateTickerId(o);if(this.pushTicker(a,o,s),s.duration){let u=setTimeout(()=>{let l=O._currentTickersTimeouts[u.toString()];l&&(this.onEndOfTicker(a,{aliasToRemoveAfter:Sc in s.args?s.args.aliasToRemoveAfter||[]:[],tickerAliasToResume:"tickerAliasToResume"in s.args?s.args.tickerAliasToResume||[]:[],ignoreTickerSteps:true}),l.aliases.forEach(c=>{this.nextTickerStep(c,t);})),O.removeTickerTimeoutInfo(u);},s.duration*1e3);O.addTickerTimeoutInfo(e,n,u.toString(),false);}}nextTickerStep(e,t){if(O._currentTickersSequence[e]&&O._currentTickersSequence[e][t]){let i=O._currentTickersSequence[e][t];i.currentStepNumber+1<i.steps.length?(i.currentStepNumber++,O._currentTickersSequence[e][t]=i,this.runTickersSequence(e,t)):t&&O._currentTickersSequence[e]&&O._currentTickersSequence[e][t]&&(delete O._currentTickersSequence[e][t],Object.entries(O._currentTickers).forEach(([s,n])=>{n.createdByTicketSteps?.canvasElementAlias===e&&n.createdByTicketSteps.id===t&&this.removeTicker(s);}));}}onEndOfTicker(e,t){let i=O._currentTickers[e],s=t.ignoreTickerSteps||false;this.remove(t.aliasToRemoveAfter),this.resumeTicker(t.tickerAliasToResume),i&&(this.removeTicker(e),!s&&i.duration==null&&i.createdByTicketSteps&&this.nextTickerStep(i.createdByTicketSteps.canvasElementAlias,i.createdByTicketSteps.id));}unlinkComponentFromTicker(e,t){if(typeof e=="string"&&(e=[e]),!t){e.forEach(s=>{Object.entries(O._currentTickers).forEach(([n,o])=>{o.canvasElementAliases.includes(s)&&(o.canvasElementAliases.length===1?this.removeTicker(n):o.canvasElementAliases=o.canvasElementAliases.filter(a=>a!==s));}),O._currentTickersSequence[s]&&delete O._currentTickersSequence[s],O.removeTickerTimeoutsByAlias(s,false);});return}let i;typeof t=="string"?i=t:t instanceof ur?i=t.id:i=t.prototype.id,e.forEach(s=>{O._currentTickersSequence[s]&&Object.entries(O._currentTickersSequence[s]).forEach(([n,o])=>{o.steps.find(a=>typeof a=="object"&&"ticker"in a&&a.ticker===i)&&delete O._currentTickersSequence[s][n];});}),Object.entries(O._currentTickers).forEach(([s,n])=>{n.id===i&&(O._currentTickers[s].canvasElementAliases=n.canvasElementAliases.filter(o=>!e.includes(o)));}),Object.entries(O._currentTickersTimeouts).forEach(([s,n])=>{n.ticker===i&&n.canBeDeletedBeforeEnd&&(O._currentTickersTimeouts[s].aliases=n.aliases.filter(o=>!e.includes(o)));}),this.removeTickersWithoutAssociatedCanvasElement();}removeTickersWithoutAssociatedCanvasElement(){Object.entries(O._currentTickers).forEach(([e,t])=>{t.canvasElementAliases=t.canvasElementAliases.filter(i=>this.find(i)),t.canvasElementAliases.length===0&&this.onEndOfTicker(e,{aliasToRemoveAfter:Sc in t.args?t.args.aliasToRemoveAfter:[],tickerAliasToResume:"tickerAliasToResume"in t.args?t.args.tickerAliasToResume:[],ignoreTickerSteps:true});}),Object.entries(O._currentTickersSequence).forEach(([e,t])=>{t===void 0&&delete O._currentTickersSequence[e];}),Object.entries(O._currentTickersTimeouts).forEach(([e,{aliases:t}])=>{t.length===0&&O.removeTickerTimeout(e);});}removeAllTickers(){O._currentTickersSequence={},Object.keys(O._currentTickers).forEach(e=>{this.removeTicker(e);}),O._currentTickers={};for(let e in O._currentTickersTimeouts)O.removeTickerTimeout(e);O._tickersToCompleteOnStepEnd={tikersIds:[],stepAlias:[]},O._tickersOnPause={};}removeTicker(e){typeof e=="string"&&(e=[e]),e.forEach(t=>{let i=O._currentTickers[t];if(i){if(i.args.hasOwnProperty(Sc)){let s=i.args.aliasToRemoveAfter;this.remove(s);}this.app.ticker.remove(i.fn),delete O._currentTickers[t];}});}pauseTicker(e,t={}){let i=O._tickersOnPause[e];if(!i){O._tickersOnPause[e]=t;return}t.tickerIdsExcluded&&(i.tickerIdsExcluded?O._tickersOnPause[e].tickerIdsExcluded=[...i.tickerIdsExcluded,...t.tickerIdsExcluded]:O._tickersOnPause[e].tickerIdsExcluded=t.tickerIdsExcluded),t.tickerIdsIncluded&&(i.tickerIdsIncluded?O._tickersOnPause[e].tickerIdsIncluded=[...i.tickerIdsIncluded,...t.tickerIdsIncluded]:O._tickersOnPause[e].tickerIdsIncluded=t.tickerIdsIncluded);}resumeTicker(e){typeof e=="string"&&(e=[e]),e.forEach(t=>{delete O._tickersOnPause[t];});}isTickerPaused(e,t){let i=O._tickersOnPause[e];if(i){if(t){if("tickerIdsIncluded"in i&&i.tickerIdsIncluded)return i.tickerIdsIncluded.includes(t);if("tickerIdsExcluded"in i&&i.tickerIdsExcluded)return !i.tickerIdsExcluded.includes(t)}return true}return false}completeTickerOnStepEnd(e){e.alias?O._tickersToCompleteOnStepEnd.stepAlias.push({id:e.id,alias:e.alias}):O._tickersToCompleteOnStepEnd.tikersIds.push({id:e.id});}forceCompletionOfTicker(e,t){if(t){let i=O._currentTickersSequence[t];i&&i[e]&&(i[e].steps.includes(Dn)?w.error(`The ticker alias: ${t} id: ${e} contains a RepeatType, so it can't be forced to complete`,i[e]):i[e].steps.forEach(s=>{if(typeof s=="object"&&"ticker"in s){let n=lr.getInstance(s.ticker,s.args,s.duration,s.priority);n&&n.onEndOfTicker([t],e,s.args);}}));}else {let i=O._currentTickers[e];i&&i.onEndOfTicker();}}addLayer(e,t){if(e===br){w.error(`The alias ${br} is reserved`);return}return t.label=e,O.app.stage.addChild(t)}getLayer(e){return O.app.stage.getChildByLabel(e)}removeLayer(e){O.app.stage.getChildrenByLabel(e);}addHtmlLayer(e,t,i){return O.addHtmlLayer(e,t,i)}removeHtmlLayer(e){return O.removeHtmlLayer(e)}getHtmlLayer(e){return O.getHtmlLayer(e)}async extractImage(){return (await this.app.renderer.extract.image(this.gameLayer)).src}clear(){this.removeAll();}export(){let e={};return this.children.forEach(t=>{t.label&&(e[t.label]=hC(t));}),{tickers:fe(O.currentTickersWithoutCreatedBySteps),tickersSteps:fe(O._currentTickersSequence),elements:fe(e),stage:fe(Ya(this.gameLayer)),elementAliasesOrder:fe(O.childrenAliasesOrder),tickersOnPause:fe(O._tickersOnPause),tickersToCompleteOnStepEnd:fe(O._tickersToCompleteOnStepEnd)}}async restore(e){try{let t={};if(e.hasOwnProperty("elementAliasesOrder")&&e.hasOwnProperty("elements")){let i=e.elements,s=e.elementAliasesOrder,n=s.filter(a=>i[a]).map(a=>Yb(i[a])),o=await Promise.all(n);this.clear(),o.forEach((a,u)=>{let l=s[u];this.add(l,a),O.childrenAliasesOrder.push(l);});}else {w.error("The data does not have the properties elementAliasesOrder and elements");return}if(e.hasOwnProperty("stage")&&e.hasOwnProperty("stage")?Vi(this.gameLayer,e.stage,{ignoreScale:!0}):w.error("The data does not have the properties stage"),e.hasOwnProperty("tickers")){let i=e.tickers;Object.entries(i).forEach(([s,n])=>{let o=n.canvasElementAliases,a=lr.getInstance(n.id,n.args,n.duration,n.priority);if(a){let u=this.addTicker(o,a);u&&(t[s]=u);}else w.error(`Ticker ${n.id} not found`);});}if(e.hasOwnProperty("tickersSteps")){let i=e.tickersSteps;Object.entries(i).forEach(([s,n])=>{O._currentTickersSequence[s]=n,Object.keys(n).forEach(o=>{this.runTickersSequence(s,o);});});}if(e.hasOwnProperty("tickersOnPause")){let i=e.tickersOnPause;Object.keys(i).forEach(s=>{let n=i[s];"tickerIdsExcluded"in n&&n.tickerIdsExcluded&&(i[s].tickerIdsExcluded=n.tickerIdsExcluded.map(o=>t[o]||o)),"tickerIdsIncluded"in n&&n.tickerIdsIncluded&&(i[s].tickerIdsIncluded=n.tickerIdsIncluded.map(o=>t[o]||o));}),O._tickersOnPause=i;}if(e.hasOwnProperty("tickersToCompleteOnStepEnd")){let i=e.tickersToCompleteOnStepEnd,s=i.tikersIds.map(o=>({id:t[o.id]||o.id})),n=i.stepAlias.map(o=>({id:o.id,alias:o.alias}));O._tickersToCompleteOnStepEnd={tikersIds:s,stepAlias:n};}}catch(t){w.error("Error importing data",t);}}};var yf=class{constructor(){R(this,"id","event_id_not_set");this.id=this.constructor.prototype.id;}fn(e,t){throw new Error("[Pixi\u2019VN] The method CanvasEvent.fn() must be overridden")}};var vf=class{constructor(){R(this,"pixivnId","canvas_element_id_not_set");}get memory(){throw new Error("[Pixi\u2019VN] The method CanvasBaseItem.memory must be overridden")}set memory(e){throw new Error("[Pixi\u2019VN] The method CanvasBaseItems.memory must be overridden")}setMemory(e){throw new Error("[Pixi\u2019VN] The method CanvasBaseItems.memory must be overridden")}};ke();ke();function Hn(r){return (r instanceof Ue||r instanceof Ze)&&r.haveEmptyTexture?false:!(r instanceof exports.PixiJSSprite&&r.texture?.label=="EMPTY")}function Vn(r,e,t){let{limit:i}=t;r[e]===void 0||!t||r[e]===i||(typeof r[e]=="number"?t.type==="linear"?r[e]=xC(r[e],t):t.type==="exponential"&&(r[e]=_C(r[e],t)):r[e]!==void 0&&typeof r[e]=="object"&&r[e].haveOwnProperty("x")&&r[e].haveOwnProperty("y")&&typeof r[e].x=="number"&&typeof r[e].y=="number"&&(t.type==="linear"?(r[e].x=xC(r[e].x,t),r[e].y=xC(r[e].y,t)):t.type==="exponential"&&(r[e].x=_C(r[e].x,t),r[e].y=_C(r[e].y,t))));}function xC(r,e){let{limit:t,amt:i}=e;if(t!==void 0){if(r>t&&i>0)return t;if(r<t&&i<0)return t}return r+i}function _C(r,e){let{limit:t}=e;if(t!==void 0){if(r>t&&e.percentage>0)return t;if(r<t&&e.percentage<0)return t}return r+r*e.percentage}var hG=5,$i=class extends ur{constructor(e={},t,i){super(e,t,i);}fn(e,t,i,s){t.speed===void 0&&(t.duration===void 0?t.speed=hG:t.speed=600/(t.duration*60));let{type:n="hide",startOnlyIfHaveTexture:o,speedProgression:a}=t,u=this.speedConvert(t.speed),l=this.getLimit(t);n==="hide"&&l<0&&(l=0),n==="show"&&l>1&&(l=1),i.filter(c=>{let h=I.find(c);return !(!h||o&&!Hn(h))}).forEach(c=>{let h=I.find(c);if(h&&h instanceof exports.PixiJSContainer){if(n==="show"&&h.alpha<l?h.alpha+=u*e.deltaTime:n==="hide"&&h.alpha>l&&(h.alpha-=u*e.deltaTime),n==="show"&&h.alpha>=l){this.onEndOfTicker(c,s,t);return}else if(n==="hide"&&h.alpha<=l){this.onEndOfTicker(c,s,t);return}if(u<1e-5&&!(a&&a.type=="linear"&&a.amt!=0)){w.warn("The speed of the FadeAlphaTicker must be greater than 0."),this.onEndOfTicker(c,s,t,{editAlpha:false});return}}}),a&&Vn(t,"speed",a);}onEndOfTicker(e,t,i,s={editAlpha:true}){typeof e=="string"&&(e=[e]),e.forEach(n=>{let o=I.find(n);if(o&&s.editAlpha){let a=this.getLimit(i);o.alpha=a;}}),super.onEndOfTicker(e,t,i);}getLimit(e){let{type:t="hide",limit:i=t==="hide"?0:1}=e;return i}speedConvert(e){return e/600}};lr.add($i);ke();var bC={};Zi(bC,{createExportableElement:()=>fe});var dG=10;function fG(r,e){let t=fe(r.destination);if(t.type==="align"){let i,s;e instanceof exports.PixiJSSprite&&(i=e.anchor.x,s=e.anchor.y);let n=pt(e.pivot,e.angle),o=pt(e.scale,e.angle);t.x=ys("width",t.x,Xi(e),n.x,o.x<0,i),t.y=ys("height",t.y,Yi(e),n.y,o.y<0,s);}return t.type==="percentage"&&(t.x=vs("width",t.x),t.y=vs("height",t.y)),t}var vr=class extends ur{fn(e,t,i,s){t.speed===void 0&&(t.speed=dG);let{speed:n,startOnlyIfHaveTexture:o,speedProgression:a}=t;i.filter(u=>{let l=I.find(u);return !(!l||o&&!Hn(l))}).forEach(u=>{let l=I.find(u);if(l&&l instanceof exports.PixiJSContainer){let c=fG(t,l),h=c.x-l.x,d=c.y-l.y,p=h>0?1:-1,m=d>0?1:-1,b,_;if(typeof n=="number"){let g=this.speedConvert(n);h===0||d===0?b=_=g:(b=Math.abs(h/(h+d))*g,_=Math.abs(d/(h+d))*g);}else b=this.speedConvert(n.x),_=this.speedConvert(n.y);if(b>0){l.x+=p*b*e.deltaTime;let g=c.x-l.x;(p<0&&g>0||p>0&&g<0)&&(l.x=c.x);}if(_>0){l.y+=m*_*e.deltaTime;let g=c.y-l.y;(m<0&&g>0||m>0&&g<0)&&(l.y=c.y);}if(l.x==c.x&&l.y==c.y){this.onEndOfTicker(u,s,t);return}else if(b<1e-5&&_<1e-5&&!(a&&a.type=="linear"&&a.amt!=0)){w.warn("The speed of the MoveTicker must be greater than 0."),this.onEndOfTicker(u,s,t,{editPosition:false});return}}}),a&&Vn(t,"speed",a);}onEndOfTicker(e,t,i,s={editPosition:true}){typeof e=="string"&&(e=[e]),e.forEach(n=>{let o=I.find(n);if(o){let a=i.destination;s.editPosition&&(o instanceof Ue||o instanceof Ze?o.positionInfo=a:(o.x=a.x,o.y=a.y));}}),super.onEndOfTicker(e,t,i);}speedConvert(e){return e*(66/400)}};lr.add(vr);ke();var pG=1,Ec=class extends ur{constructor(e={},t,i){super(e,t,i);}fn(e,t,i,s){t.speed===void 0&&(t.speed=pG);let{clockwise:n=true,speedProgression:o,limit:a}=t,u=this.speedConvert(t.speed);i.filter(l=>{let c=I.find(l);return !(!c||t.startOnlyIfHaveTexture&&!Hn(c))}).forEach(l=>{let c=I.find(l);if(c&&c instanceof exports.PixiJSContainer&&(n?c.rotation+=u*e.deltaTime:c.rotation-=u*e.deltaTime,a!==void 0&&(n&&c.angle>=a?(c.angle=a,this.onEndOfTicker(l,s,t)):!n&&c.angle<=a&&(c.angle=a,this.onEndOfTicker(l,s,t))),u<1e-5&&!(o&&o.type=="linear"&&o.amt!=0))){w.warn("The speed of the RotateTicker must be greater than 0."),this.onEndOfTicker(l,s,t,{editRotation:false});return}}),o&&Vn(t,"speed",o);}onEndOfTicker(e,t,i,s={editRotation:true}){let{limit:n}=i;typeof e=="string"&&(e=[e]),e.forEach(o=>{let a=I.find(o);a&&s.editRotation&&n!==void 0&&(a.angle=n);}),super.onEndOfTicker(e,t,i);}speedConvert(e){return e/100}};lr.add(Ec);ke();var mG=10,Ts=class extends ur{constructor(e={},t,i){super(e,t,i);}fn(e,t,i,s){t.speed===void 0&&(t.speed=mG);let{speed:n,type:o="zoom",startOnlyIfHaveTexture:a,speedProgression:u}=t,l,c;typeof n=="number"?(l=this.speedConvert(n),c=this.speedConvert(n)):(l=this.speedConvert(n.x),c=this.speedConvert(n.y));let h=this.getLimit(t);i.filter(d=>{let p=I.find(d);return !(!p||a&&!Hn(p))}).forEach(d=>{let p=I.find(d);if(p&&p instanceof exports.PixiJSContainer){if(o==="zoom"&&(p.scale.x<h.x||p.scale.y<h.y)?(p.scale.x+=l*e.deltaTime,p.scale.y+=c*e.deltaTime):o==="unzoom"&&(p.scale.x>h.x||p.scale.y>h.y)&&(p.scale.x-=l*e.deltaTime,p.scale.y-=c*e.deltaTime),o==="zoom"){if(p.scale.x>h.x&&(p.scale.x=h.x),p.scale.y>h.y&&(p.scale.y=h.y),p.scale.x>=h.x&&p.scale.y>=h.y){this.onEndOfTicker(d,s,t);return}}else if(o==="unzoom"&&(p.scale.x<h.x&&(p.scale.x=h.x),p.scale.y<h.y&&(p.scale.y=h.y),p.scale.x<=h.x&&p.scale.y<=h.y)){this.onEndOfTicker(d,s,t);return}if((l<1e-5&&c<1e-5||l<1e-5&&p.scale.y==h.y||c<1e-5&&p.scale.x==h.x)&&!(u&&u.type=="linear"&&u.amt!=0)){w.warn("The speed of the ZoomTicker must be greater than 0."),this.onEndOfTicker(d,s,t,{editScale:false});return}}}),u&&Vn(t,"speed",u);}speedConvert(e){return e/600}onEndOfTicker(e,t,i,s={editScale:true}){let{isZoomInOut:n}=i;typeof e=="string"&&(e=[e]),e.forEach(o=>{let a=I.find(o);if(a){if(s.editScale){let u=this.getLimit(i);a.scale.x=u.x,a.scale.y=u.y;}if(n){let{pivot:u,position:l}=n;a.pivot=u.x,a.position=l;}}}),super.onEndOfTicker(e,t,i);}getLimit(e){let{type:t="zoom",limit:i}=e,s=t==="zoom"?1/0:0,n=t==="zoom"?1/0:0;return i&&(typeof i=="number"?(s=i,n=i):(s=i.x,n=i.y)),{x:s,y:n}}};lr.add(Ts);async function qM(r,e={},t){let i=I.find(r);if(!i){w.error(`The element with the alias ${r} does not exist. So the shake effect can't be applied.`);return}let s={x:i.position.x,y:i.position.y},n=e.speed||20,o=e.speedProgression||void 0,a=e.startOnlyIfHaveTexture||false,u=e.type||"horizontal",l=e.maximumShockSize||10,c=(e.shocksNumber||10)-1;if(c<2){w.error("The number of shocks must be at least 3.");return}let h=Math.floor(c/2),d=Math.ceil(c/2),p=[];for(let _=0;_<h;_++){let g={x:s.x,y:s.y},y=l*(_+1)/h;u==="horizontal"?_%2!==0?g.x=s.x+y:g.x=s.x-y:_%2!==0?g.y=s.y+y:g.y=s.y-y,p.push(new vr({destination:g,speed:n,speedProgression:o,startOnlyIfHaveTexture:a},void 0,t));}let m=h%2===0;for(let _=d;_>0;_--){let g={x:s.x,y:s.y},y=l*(_+1)/(d-1);u==="horizontal"?_%2===0&&!m||_%2!==0&&m?g.x=s.x-y:g.x=s.x+y:_%2===0&&!m||_%2!==0&&m?g.y=s.y-y:g.y=s.y+y,p.push(new vr({destination:g,speed:n,speedProgression:o,startOnlyIfHaveTexture:a},void 0,t));}p.push(new vr({destination:s,speed:n,speedProgression:o,startOnlyIfHaveTexture:a,tickerAliasToResume:r},void 0,t));let b=I.addTickersSequence(r,p);b&&(I.completeTickerOnStepEnd({id:b,alias:r}),I.pauseTicker(r,{tickerIdsExcluded:[b]}));}function Tf(r,e,t){let i=new Ze(t,e);return I.add(r,i),i}async function KM(r,e,t){let i=new Ze(t,e);return await i.load(),I.add(r,i),i}ke();function Sf(r,e,t){if(!e)if(exports.Assets.resolver.hasKey(r))e=r;else throw new Error(`The image ${r} does not exist in the cache.`);let i=new Ue(t,e);return I.add(r,i),i}async function ZM(r){if(!Array.isArray(r))return [r];let e=Array(r.length);for(let t=0;t<r.length;t++)e[t]=vi(r[t].textureAlias);return Promise.all(e).then(t=>t.map((i,s)=>i?(r[s].texture=i,r[s]):(r[s].load(),r[s])))}async function QM(r,e,t){if(!e)if(exports.Assets.resolver.hasKey(r))e=r;else throw new Error(`The image ${r} does not exist in the cache.`);let i=new Ue(t,e);return await i.load(),I.add(r,i),i}ke();function Ef(r,e,t){if(!e)if(exports.Assets.resolver.hasKey(r))e=r;else throw new Error(`The video ${r} does not exist in the cache.`);let i=new Jt(t,e);return I.add(r,i),i}async function JM(r){if(!Array.isArray(r))return [r];let e=Array(r.length);for(let t=0;t<r.length;t++)e[t]=vi(r[t].textureAlias);return Promise.all(e).then(t=>t.map((i,s)=>i?(r[s].texture=i,r[s]):(r[s].load(),r[s])))}async function eI(r,e,t){if(!e)if(exports.Assets.resolver.hasKey(r))e=r;else throw new Error(`The video ${r} does not exist in the cache.`);let i=new Jt(t,e);return await i.load(),I.add(r,i),i}function Cf(r,e){if(typeof e=="string")return gf(e)?Ef(r,e):Sf(r,e);if(Array.isArray(e))return Tf(r,e);if(typeof e=="object"&&"value"in e&&"options"in e){if(typeof e.value=="string")return gf(e.value)?Ef(r,e.value,e.options):Sf(r,e.value,e.options);if(Array.isArray(e.value))return Tf(r,e.value,e.options)}return I.add(r,e),e}async function yC(r,e,t={},i){let{mustBeCompletedBeforeNextStep:s=true,tickerAliasToResume:n=[]}=t,o=[];e||(e=r),typeof n=="string"&&(n=[n]);let a;if(I.find(r)&&(a=r+"_temp_disolve",I.editAlias(r,a)),e=Cf(r,e),a&&I.copyCanvasElementProperty(a,r),a&&I.transferTickers(a,r,"duplicate"),e.alpha=0,a){let c=Af(a,t,i);c&&(o.push(...c),I.pauseTicker(a,{tickerIdsIncluded:c}),n.push(a));}let u=new $i({...t,type:"show",tickerAliasToResume:n,startOnlyIfHaveTexture:true},void 0,i),l=I.addTicker(r,u);if(l&&(s&&I.completeTickerOnStepEnd({id:l}),o.push(l)),(e instanceof Ue||e instanceof Ze)&&e.haveEmptyTexture&&await e.load(),o.length>0)return o}function Af(r,e={},t){let{mustBeCompletedBeforeNextStep:i=true,aliasToRemoveAfter:s=[]}=e;typeof r=="string"&&(r=[r]),typeof s=="string"&&(s=[s]),s.push(...r);let n=new $i({...e,type:"hide",aliasToRemoveAfter:s,startOnlyIfHaveTexture:true},void 0,t),o=I.addTicker(r,n);if(o)return i&&I.completeTickerOnStepEnd({id:o}),[o]}async function tI(r,e,t={},i){let{mustBeCompletedBeforeNextStep:s=true,aliasToRemoveAfter:n=[]}=t,o=[];if(e||(e=r),typeof n=="string"&&(n=[n]),!I.find(r))return yC(r,e,t,i);let a=r+"_temp_fade";I.editAlias(r,a),n.push(a),e=Cf(r,e),a&&I.copyCanvasElementProperty(a,r),a&&I.transferTickers(a,r,"duplicate"),e.alpha=0;let u=Af(a,{...t,tickerAliasToResume:r},i);u&&o.push(...u);let l=new $i({...t,type:"show",startOnlyIfHaveTexture:true,aliasToRemoveAfter:n},void 0,i),c=I.addTicker(r,l);if(c&&(s&&I.completeTickerOnStepEnd({id:c}),o.push(c),I.pauseTicker(r,{tickerIdsIncluded:[c]})),(e instanceof Ue||e instanceof Ze)&&e.haveEmptyTexture&&await e.load(),o.length>0)return o}function rI(r,e={},t){return Af(r,e,t)}async function iI(r,e,t={},i){let{direction:s="right",mustBeCompletedBeforeNextStep:n=true,tickerAliasToResume:o=[],aliasToRemoveAfter:a=[],removeOldComponentWithMoveOut:u}=t,l=[];e||(e=r),typeof o=="string"&&(o=[o]),typeof a=="string"&&(a=[a]);let c;I.find(r)&&(c=r+"_temp_movein",I.editAlias(r,c)),e=Cf(r,e),c&&I.copyCanvasElementProperty(c,r),c&&I.transferTickers(c,r,"move");let h;e instanceof Ue||e instanceof Ze?h=e.positionInfo:h={x:e.x,y:e.y,type:"pixel"};let d;switch(c&&(u?(d=$b(c,t,i),d&&(l.push(...d),o.push(c))):a.push(c)),(e instanceof Ue||e instanceof Ze)&&e.haveEmptyTexture&&await e.load(),c&&I.pauseTicker(c,{tickerIdsIncluded:d}),s){case "up":e.y=I.canvasHeight+e.height;break;case "down":e.y=-e.height;break;case "left":e.x=I.canvasWidth+e.width;break;case "right":e.x=-e.width;break}o.push(r);let p=new vr({...t,tickerAliasToResume:o,aliasToRemoveAfter:a,destination:h,startOnlyIfHaveTexture:true},void 0,i),m=I.addTicker(r,p);if(m&&(I.pauseTicker(r,{tickerIdsExcluded:[m]}),n&&I.completeTickerOnStepEnd({id:m}),l.push(m)),l.length>0)return l}function $b(r,e={},t){let{direction:i="right",mustBeCompletedBeforeNextStep:s=true,aliasToRemoveAfter:n=[]}=e;typeof n=="string"&&(n=[n]),n.push(r);let o=I.find(r);if(!o){w.warn("The canvas component is not found.");return}let a={x:o.x,y:o.y};switch(i){case "up":a.y=-o.height;break;case "down":a.y=I.canvasHeight+o.height;break;case "left":a.x=-o.width;break;case "right":a.x=I.canvasWidth+o.width;break}let u=new vr({...e,destination:a,startOnlyIfHaveTexture:true,aliasToRemoveAfter:n},void 0,t),l=I.addTicker(r,u);if(l)return I.pauseTicker(r,{tickerIdsExcluded:[l]}),s&&I.completeTickerOnStepEnd({id:l}),[l]}async function sI(r,e,t={},i){let{direction:s="right",mustBeCompletedBeforeNextStep:n=true,tickerAliasToResume:o=[],aliasToRemoveAfter:a=[]}=t,u=[];e||(e=r),typeof o=="string"&&(o=[o]),typeof a=="string"&&(a=[a]);let l,c=I.find(r);c&&(l=r+"_temp_zoom",I.editAlias(r,l)),e=Cf(r,e),l&&I.copyCanvasElementProperty(l,r),l&&I.transferTickers(l,r,"move"),s=="up"?(e.pivot.y=I.canvasHeight-e.y,e.pivot.x=I.canvasWidth/2-e.x,e.y=I.canvasHeight,e.x=I.canvasWidth/2):s=="down"?(e.pivot.y=0-e.y,e.pivot.x=I.canvasWidth/2-e.x,e.y=0,e.x=I.canvasWidth/2):s=="left"?(e.pivot.x=I.canvasWidth-e.x,e.pivot.y=I.canvasHeight/2-e.y,e.x=I.canvasWidth,e.y=I.canvasHeight/2):s=="right"&&(e.pivot.x=0-e.x,e.pivot.y=I.canvasHeight/2-e.y,e.x=0,e.y=I.canvasHeight/2),e.pivot=fC(e.pivot,e.angle),e.scale.set(0);let h=c?{pivot:{x:c.pivot.x,y:c.pivot.y},position:{x:c.x,y:c.y}}:void 0;if(l){if(t.removeOldComponentWithZoomOut){let m=vC(l,t,i);m&&(u.push(...m),o.push(l));}else a.push(l);I.pauseTicker(l);}o.push(r);let d=new Ts({...t,tickerAliasToResume:o,aliasToRemoveAfter:a,startOnlyIfHaveTexture:true,type:"zoom",limit:1,isZoomInOut:h},void 0,i),p=I.addTicker(r,d);if(p&&(I.pauseTicker(r,{tickerIdsExcluded:[p]}),n&&I.completeTickerOnStepEnd({id:p}),u.push(p)),(e instanceof Ue||e instanceof Ze)&&e.haveEmptyTexture&&await e.load(),u.length>0)return u}function vC(r,e={},t){let{direction:i="right",mustBeCompletedBeforeNextStep:s=true,aliasToRemoveAfter:n=[]}=e;typeof n=="string"&&(n=[n]),n.push(r);let o=I.find(r);if(!o){w.warn("The canvas component is not found.");return}i=="up"?(o.pivot.y=I.canvasHeight-o.y,o.pivot.x=I.canvasWidth/2-o.x,o.y=I.canvasHeight,o.x=I.canvasWidth/2):i=="down"?(o.pivot.y=0-o.y,o.pivot.x=I.canvasWidth/2-o.x,o.y=0,o.x=I.canvasWidth/2):i=="left"?(o.pivot.x=I.canvasWidth-o.x,o.pivot.y=I.canvasHeight/2-o.y,o.x=I.canvasWidth,o.y=I.canvasHeight/2):i=="right"&&(o.pivot.x=0-o.x,o.pivot.y=I.canvasHeight/2-o.y,o.x=0,o.y=I.canvasHeight/2),o.pivot=fC(o.pivot,o.angle),o.scale.set(1);let a=new Ts({...e,startOnlyIfHaveTexture:true,type:"unzoom",limit:0,aliasToRemoveAfter:n},void 0,t),u=I.addTicker(r,a);if(u)return I.pauseTicker(r,{tickerIdsExcluded:[u]}),s&&I.completeTickerOnStepEnd({id:u}),[u]}async function nI(r,e,t={},i){let{direction:s="right",mustBeCompletedBeforeNextStep:n=true,tickerAliasToResume:o=[]}=t,a=[];e||(e=r),typeof o=="string"&&(o=[o]);let u;I.find(r)&&(u=r+"_temp_push",I.editAlias(r,u)),e=Cf(r,e),u&&I.copyCanvasElementProperty(u,r),u&&I.transferTickers(u,r,"move");let l;if((e instanceof Ue||e instanceof Ze)&&e.haveEmptyTexture?l=e.positionInfo:l={x:e.x,y:e.y,type:"pixel"},s=="up"?e.y=-I.canvasHeight+e.y:s=="down"?e.y=I.canvasHeight+e.y:s=="left"?e.x=-I.canvasWidth+e.x:s=="right"&&(e.x=I.canvasWidth+e.x),u){let d=TC(u,{...t,direction:s=="up"?"down":s=="down"?"up":s=="left"?"right":"left"},i);d&&a.push(...d);}o.push(r);let c=new vr({...t,tickerAliasToResume:o,startOnlyIfHaveTexture:true,destination:l},void 0,i),h=I.addTicker(r,c);if(h&&(I.pauseTicker(r,{tickerIdsExcluded:[h]}),n&&I.completeTickerOnStepEnd({id:h}),a.push(h)),(e instanceof Ue||e instanceof Ze)&&e.haveEmptyTexture&&await e.load(),a.length>0)return a}function TC(r,e={direction:"right"},t){return $b(r,e,t)}var I=new bf;yr.init({getScreen:()=>I.screen});var EC={};Zi(EC,{CharacterBaseModel:()=>wf,CharacterStoredClass:()=>$a,RegisteredCharacters:()=>lI,getAllCharacters:()=>uI,getCharacterById:()=>aI,saveCharacter:()=>oI});var ie=class ie{static init(e){ie._getStepCounter=e.getStepCounter,ie._setStepCounter=e.setStepCounter,ie._getCurrentGameStepState=e.getCurrentGameStepState,ie._restoreGameStepState=e.restoreGameStepState,ie._getOpenedLabels=e.getOpenedLabels,e.onGoNextEnd&&(ie._onGoNextEnd=e.onGoNextEnd),ie._getVariable=e.getVariable,ie._setVariable=e.setVariable,ie._removeVariable=e.removeVariable,ie._getFlag=e.getFlag,ie._setFlag=e.setFlag,e.onLabelClosing&&(ie._onLabelClosing=e.onLabelClosing),ie._addHistoryItem=e.addHistoryItem,ie._getCurrentStepsRunningNumber=e.getCurrentStepsRunningNumber,ie._getCharacter=e.getCharacter;}static get stepCounter(){return ie._getStepCounter()}static set stepCounter(e){ie._setStepCounter(e);}static get currentGameStepState(){return ie._getCurrentGameStepState()}static get restoreGameStepState(){return ie._restoreGameStepState}static get openedLabels(){return ie._getOpenedLabels()}static get onGoNextEnd(){return ie._onGoNextEnd}static get getVariable(){return ie._getVariable}static get setVariable(){return ie._setVariable}static get removeVariable(){return ie._removeVariable}static get getFlag(){return ie._getFlag}static get setFlag(){return ie._setFlag}static get onLabelClosing(){return ie._onLabelClosing}static get addHistoryItem(){return ie._addHistoryItem}static get currentStepsRunningNumber(){return ie._getCurrentStepsRunningNumber()}static get getCharacter(){return ie._getCharacter}};R(ie,"_getStepCounter",()=>{throw w.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),R(ie,"_setStepCounter",()=>{throw w.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),R(ie,"_getCurrentGameStepState",()=>{throw w.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),R(ie,"_restoreGameStepState",()=>{throw w.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),R(ie,"_getOpenedLabels",()=>{throw w.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),R(ie,"_onGoNextEnd",async()=>{}),R(ie,"_getVariable",()=>{throw w.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),R(ie,"_setVariable",()=>{throw w.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),R(ie,"_removeVariable",()=>{throw w.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),R(ie,"_getFlag",()=>{throw w.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),R(ie,"_setFlag",()=>{throw w.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),R(ie,"_onLabelClosing",()=>{}),R(ie,"_addHistoryItem",()=>{throw w.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),R(ie,"_getCurrentStepsRunningNumber",()=>{throw w.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),R(ie,"_getCharacter",()=>{throw w.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented.")}),R(ie,"onEnd"),R(ie,"onError");var W=ie;var St=class St{constructor(){}static clearOldTempVariables(e){St.tempStorageDeadlines.forEach((t,i)=>{t>e&&(St.tempStorage.delete(i),St.tempStorageDeadlines.delete(i),St.storage.cache.delete(i));});}static setVariable(e,t){let i=St.tempStorage.has(e);t==null?(St.storage.map.delete(e),!i&&St.storage.cache.delete(e)):(St.storage.map.set(e,t),!i&&St.storage.cache.set(e,t));}static getVariable(e){let t=St.storage.cache.get(e);return t===void 0&&(t=St.tempStorage.get(e)),t===void 0&&(t=St.storage.map.get(e)),fe(t)}static removeVariable(e){St.storage.delete(e);}static setFlag(e,t){if(t)this.flags.includes(e)||this.flags.push(e);else {let i=this.flags.indexOf(e);i>-1&&this.flags.splice(i,1);}}static getFlag(e){return this.flags.includes(e)}};R(St,"storage",new Tt({cacheSize:20})),R(St,"startingStorage",[]),R(St,"flags",Array()),R(St,"tempStorage",new Map),R(St,"tempStorageDeadlines",new Map);var oe=St;var Pf=class{get storage(){return oe.storage.map}get cache(){return oe.storage.cache}get flags(){return oe.flags}get tempStorage(){return oe.tempStorage}get tempStorageDeadlines(){return oe.tempStorageDeadlines}set startingStorage(e){let t=[];Object.entries(e).forEach(([i,s])=>{t.push({key:i,value:s});}),oe.startingStorage=t;}setVariable(e,t){return oe.setVariable(e,t)}getVariable(e){return oe.getVariable(e)}removeVariable(e){return oe.removeVariable(e)}setTempVariable(e,t){if(t==null){this.removeTempVariable(e);return}else oe.tempStorage.set(e,t),oe.storage.cache.set(e,t),oe.tempStorageDeadlines.has(e)||oe.tempStorageDeadlines.set(e,W.openedLabels);}removeTempVariable(e){oe.tempStorage.has(e)&&(oe.tempStorage.delete(e),oe.tempStorageDeadlines.delete(e),oe.storage.cache.delete(e));}setFlag(e,t){return oe.setFlag(e,t)}getFlag(e){return oe.getFlag(e)}clear(){this.storage.clear(),this.cache.clear(),oe.flags=[],oe.tempStorage.clear(),oe.tempStorageDeadlines.clear(),oe.startingStorage.forEach(({key:e,value:t})=>{this.storage.set(e,t);});}export(){let e=[];[...this.storage.keys()].forEach(s=>{e.push({key:s,value:this.storage.get(s)});});let t=[];[...oe.tempStorage.keys()].forEach(s=>{t.push({key:s,value:oe.tempStorage.get(s)});});let i=[];return [...oe.tempStorageDeadlines.keys()].forEach(s=>{i.push({key:s,value:oe.tempStorageDeadlines.get(s)});}),fe({base:e,temp:t,tempDeadlines:i,flags:oe.flags})}restore(e){this.clear();try{e?(Array.isArray(e)&&e.forEach(t=>{if(t.key==="___temp_storage___"){let i=t.value;Object.entries(i).forEach(([s,n])=>{oe.tempStorage.set(s,n);});}else if(t.key==="___temp_storage_deadlines___"){let i=t.value;Object.entries(i).forEach(([s,n])=>{oe.tempStorageDeadlines.set(s,n);});}else t.key==="___flags___"?t.value.forEach(s=>{oe.flags.push(s);}):this.storage.set(t.key,t.value);}),"base"in e&&"temp"in e&&"tempDeadlines"in e?(e.base?.forEach(t=>{this.storage.set(t.key,t.value);}),e.temp?.forEach(t=>{oe.tempStorage.set(t.key,t.value);}),e.tempDeadlines?.forEach(t=>{oe.tempStorageDeadlines.set(t.key,t.value);})):Object.entries(e).forEach(([t,i])=>{t==="___temp_storage___"?Object.entries(i).forEach(([s,n])=>{oe.tempStorage.set(s,n);}):t==="___temp_storage_deadlines___"?Object.entries(i).forEach(([s,n])=>{oe.tempStorageDeadlines.set(s,n);}):t==="___flags___"?i.forEach(s=>{oe.flags.push(s);}):this.storage.set(t,i);})):w.warn("No storage data found");}catch(t){w.error("Error importing data",t);}}};var Cc=class{constructor(e,t){R(this,"_id");R(this,"categoryId");this.categoryId=e,this._id=t;}get id(){return this._id}setStorageProperty(e,t){let i=oe.getVariable(this.categoryId);i||(i={}),i.hasOwnProperty(this.id)||(i[this.id]={}),t==null?i[this.id].hasOwnProperty(e)&&delete i[this.id][e]:i[this.id]={...i[this.id],[e]:t},Object.keys(i[this.id]).length===0&&delete i[this.id],oe.setVariable(this.categoryId,i);}getStorageProperty(e,t=this.id){let i=oe.getVariable(this.categoryId);if(i&&i.hasOwnProperty(t)&&i[t].hasOwnProperty(e))return i[t][e]}};var Kr=new Pf;var xG="@",$a=class extends Cc{constructor(t,i=""){super(le.CHARACTER_CATEGORY_KEY,t+(i?xG+i:""));R(this,"sourceId");this.sourceId=t;}getStorageProperty(t){let i=super.getStorageProperty(t);return i===void 0&&(i=super.getStorageProperty(t,this.sourceId)),i}};var wf=class extends $a{constructor(t,i){super(typeof t=="string"?t:t.id,typeof t=="string"?"":t.emotion);R(this,"defaultName");R(this,"defaultSurname");R(this,"defaultAge");R(this,"_icon");R(this,"_color");this.defaultName=i.name,this.defaultSurname=i.surname,this.defaultAge=i.age,this._icon=i.icon,this._color=i.color;}get name(){return this.getStorageProperty("name")||this.defaultName||this.id}set name(t){this.setStorageProperty("name",t);}get surname(){return this.getStorageProperty("surname")||this.defaultSurname}set surname(t){this.setStorageProperty("surname",t);}get age(){return this.getStorageProperty("age")||this.defaultAge}set age(t){this.setStorageProperty("age",t);}get icon(){return this._icon}get color(){return this._color}};var qa=new Tt({cacheSize:10});function oI(r){return Ac.add(r)}function aI(r){return Ac.get(r)}function uI(){return Ac.values()}var Ac;(s=>{function r(n){try{let o=qa.get(n);if(!o){w.warn(`Character "${n}" not found, did you forget to register it with the RegisteredCharacters.add?`);return}return o}catch(o){w.error(`Error while getting Character "${n}"`,o);return}}s.get=r;function e(n){if(Array.isArray(n)){n.forEach(o=>e(o));return}qa.get(n.id)&&w.info(`Character id "${n.id}" already exists, it will be overwritten`),qa.set(n.id,n);}s.add=e;function t(){return Array.from(qa.values())}s.values=t;function i(n){return qa.has(n)}s.has=i;})(Ac||(Ac={}));var lI=Ac;var fI=tu(hI());function dI(r,e){let t=fe(r);return e.length>1&&"type"in e[0]&&(e=e.reverse()),e.forEach(i=>{"type"in i?_G(t,i):bG(t,i);}),t}function _G(r,e){let t=r;e.path&&e.path.length>0?e.path.forEach((i,s)=>{if(e.path&&s===e.path.length-1)switch(e.type){case "CHANGE":case "REMOVE":t[i]=e.oldValue;break;case "CREATE":Array.isArray(t)&&typeof i=="number"?t.splice(i,1):delete t[i];break}else t=t[i];}):w.warn("No path found, skipping diff",e);}function bG(r,e){let t=r;e.path&&e.path.length>0?e.path.forEach((i,s)=>{if(e.path&&s===e.path.length-1){if(e.kind==="E"||e.kind==="D")t[i]=e.lhs;else if(e.kind==="N")Number.isInteger(i)?Array.isArray(t)&&t.splice(i,1):typeof i=="string"&&delete t[i];else if(e.kind==="A"){let n=e.index;e.item.kind==="N"?t[i].splice(n,1):e.item.kind==="E"||e.item.kind==="D"?t[i][n]=e.item.lhs:e.item.kind==="A"?w.warn("Nested array found, skipping diff",e):w.warn("No array found, skipping diff",e);}}else t=t[i];}):w.warn("No path found, skipping diff",e);}var Ti=class Ti{static get originalStepData(){return Ti._originalStepData?fe(Ti._originalStepData):{path:"",storage:{},canvas:{elementAliasesOrder:[],elements:{},stage:{},tickers:{},tickersSteps:{},tickersOnPause:{},tickersToCompleteOnStepEnd:{tikersIds:[],stepAlias:[]}},sound:{soundAliasesOrder:[],soundsPlaying:{},playInStepIndex:{},filters:void 0},labelIndex:-1,openedLabels:[]}}static set originalStepData(e){Ti._originalStepData=fe(e);}};R(Ti,"_diffHistory",new Tt({cacheSize:5})),R(Ti,"_stepsInfoHistory",new Tt({cacheSize:5})),R(Ti,"_narrationHistory",new Tt({cacheSize:50})),R(Ti,"stepLimitSaved",20),R(Ti,"goBackRunning",false),R(Ti,"_originalStepData");var K=Ti;var Bf=class{get stepsInfoMap(){return K._stepsInfoHistory}get diffMap(){return K._diffHistory}get narrationMap(){return K._narrationHistory}get size(){return K._stepsInfoHistory.size}get lastKey(){return this.size===0?null:Math.max(...Array.from(this.keys()))}keys(){return K._stepsInfoHistory.keys()}get(e){let t=K._narrationHistory.get(e);if(!(t&&Object.keys(t).length===1&&t.stepIndex!==void 0))return t}delete(e){K._stepsInfoHistory.delete(e),K._diffHistory.delete(e),K._narrationHistory.delete(e);}internalRestoreOldGameState(e,t){if(e<=0||this.size==0)return t;let i=this.lastKey;if(typeof i!="number")return w.error("You can't go back, there is no step to go back"),t;let s=K._diffHistory.get(i);if(s)try{let n=dI(t,s);return W.stepCounter=i,this.delete(i),this.internalRestoreOldGameState(e-1,n)}catch(n){return w.error("Error applying diff",n),t}else return w.error("You can't go back, there is no step to go back"),t}async goBack(e,t=1){if(t<=0){w.warn("The parameter steps must be greater than 0");return}if(K._diffHistory.size<1){w.warn("You can't go back, there is no step to go back");return}if(K.goBackRunning){w.warn("Go back is already running");return}K.goBackRunning=true;try{let i=fe(this.internalRestoreOldGameState(t,K.originalStepData));if(i){await W.restoreGameStepState(i,e);let s=W.stepCounter-1,n=K._narrationHistory.get(s);if(n&&Object.keys(n).length===1&&n.stepIndex!==void 0){let o=K._stepsInfoHistory.get(s);if(o){let a=this.itemMapper({step:o});K._narrationHistory.set(o.index,a);}}}else w.error("Error going back");K.goBackRunning=!1;}catch(i){w.error("Error going back",i),K.goBackRunning=false;}}add(e,t={}){let i=K.originalStepData,{ignoreSameStep:s}=t,n=W.currentGameStepState;if(!s&&this.isSameStep(i,n))return;let o=this.lastKey;(async()=>{try{let u,l;if(typeof o=="number"&&(u=K._stepsInfoHistory.get(o),l=K._narrationHistory.get(o)),K._stepsInfoHistory.set(e.index,e),e.index!==0){let d=(0,fI.diff)(i,n);d?K._diffHistory.set(e.index,d):w.warn("It was not possible to create the difference between the two steps");}let c={},h=this.itemMapper({step:e},c);if(K._narrationHistory.set(e.index,h),u&&l&&typeof o=="number"){let d=this.itemMapper({...c,step:u},{});K._narrationHistory.set(o,d);}}catch(u){w.error("Error adding history step",u);}})(),K.originalStepData=n;}itemMapper(e,t){let{step:i,choiceIndexMade:s,inputValue:n,removeDialogue:o}=e,a=i.dialogue||i.dialoge;t&&i.isGlued&&(t.removeDialogue=true),o&&(a=void 0);let u=i.choices;if(t&&i.currentLabel&&i.choiceIndexMade!==void 0&&(t.choiceIndexMade=i.choiceIndexMade),i.inputValue&&t&&(t.inputValue=i.inputValue),a||u||n){let l=u?.map((c,h)=>{let d=false;return c.oneTime&&i.alreadyMadeChoices&&i.alreadyMadeChoices.includes(h)&&(d=true),{text:c.text,type:c.type,isResponse:false,hidden:d}});if(l){if(l.every(c=>c.hidden)){let c=l.find(h=>h.hidden===false);c&&(c.hidden=false);}s!==void 0&&(l[s].isResponse=true);}return {dialogue:a?{...a,character:a.character?W.getCharacter(a.character)||a.character:void 0}:void 0,playerMadeChoice:typeof s=="number",choices:l,stepIndex:i.index,inputValue:n}}return {stepIndex:i.index}}get narrativeHistory(){let e=[];return Array.from(this.keys()).sort((i,s)=>i-s).forEach(i=>{let s=this.get(i);s&&e.push(s);}),e}get currentLabelHistory(){let e=[],t=Array.from(this.keys()).sort((u,l)=>l-u);if(t.length===0)return e;let i=t[0];if(typeof i!="number")return e;let s=K._stepsInfoHistory.get(i);if(!s)return e;let n=s.openedLabels;if(!n||!Array.isArray(n)||n.length===0)return e;let o=n[0].currentStepIndex,a=n[0].label;return t.every((u,l)=>{let c=this.get(u);if(c){if(l===0)return e.push(c),true;let h=K._stepsInfoHistory.get(u);if(!h)return true;let d=h.openedLabels;if(!d||!Array.isArray(d)||d.length===0||d[0].label!==a||d[0].currentStepIndex>=o)return false;o=d[0].currentStepIndex,e.push(c);}return true}),e.reverse()}removeNarrativeHistory(e){if(e){let t=Array.from(this.keys()).sort((i,s)=>i-s);t=t.slice(0,e),t.forEach(i=>{K._narrationHistory.delete(i),K._stepsInfoHistory.delete(i),K._diffHistory.delete(i);});}else K._stepsInfoHistory.clear(),K._diffHistory.clear(),K._narrationHistory.clear();}get canGoBack(){let e=this.lastKey;return typeof e!="number"?false:K._diffHistory.has(e)}blockGoBack(){W.currentStepsRunningNumber===0&&K._diffHistory.clear();}isSameStep(e,t){if(e.openedLabels.length===t.openedLabels.length)try{let i=JSON.stringify(e.openedLabels),s=JSON.stringify(t.openedLabels);if(i===s&&e.path===t.path&&e.labelIndex===t.labelIndex)return !0}catch(i){return w.error("Error comparing opened labels",i),true}return false}clear(){K._stepsInfoHistory.clear(),K._diffHistory.clear(),K._narrationHistory.clear(),K._originalStepData=void 0;}get stepLimitSaved(){return K.stepLimitSaved}set stepLimitSaved(e){K.stepLimitSaved=e;}export(){let e=Array.from(this.keys()).sort((i,s)=>i-s);e.length>this.stepLimitSaved&&(e=e.slice(e.length-this.stepLimitSaved));let t=[];return e.forEach(i=>{let s=K._stepsInfoHistory.get(i);if(s){let n=K._diffHistory.get(i);t.push({...s,diff:n});}}),{stepsHistory:fe(t),originalStepData:fe(K._originalStepData)}}restoreNarrativeHistory(){let e=Array.from(this.keys()).sort((i,s)=>i-s),t={};e.forEach(i=>{let s=K._stepsInfoHistory.get(i);if(s){let n={...t};t={};let o=this.itemMapper({step:s,choiceIndexMade:n.choiceIndexMade,inputValue:n.inputValue,removeDialogue:n.removeDialogue},t);o&&K._narrationHistory.set(i,o);}});}async restore(e){this.clear();try{e.hasOwnProperty("stepsHistory")?(e.stepsHistory.forEach(i=>{i.diff&&K._diffHistory.set(i.index,i.diff);let s={...i,diff:void 0};K._stepsInfoHistory.set(i.index,s);}),this.restoreNarrativeHistory()):w.warn("Could not import stepsHistory data, so will be ignored"),e.hasOwnProperty("originalStepData")?K._originalStepData=e.originalStepData:w.warn("Could not import originalStepData data, so will be ignored");}catch(t){w.error("Error importing data",t);}}};var zn=new Bf;var pI={};var BC={};Zi(BC,{ChoiceMenuOption:()=>Za,ChoiceMenuOptionClose:()=>Ja,Close:()=>Qa,Label:()=>Ss,LabelAbstract:()=>Ka,NarrationManagerStatic:()=>H,RegisteredLabels:()=>Tr,narration:()=>Es,newChoiceOption:()=>gI,newCloseChoiceOption:()=>xI,newLabel:()=>wC});var Rf=new Tt({cacheSize:10}),AC;(s=>{function r(n){let o=Rf.get(n);if(!o){w.error(`Label "${n}" not found`);return}return o}s.get=r;function e(n){if(Array.isArray(n)){n.forEach(o=>e(o));return}Rf.has(n.id)&&w.info(`Label "${n.id}" already exists, it will be overwritten`),Rf.set(n.id,n);}s.add=e;function t(){return Array.from(Rf.values())}s.values=t;function i(n){return Rf.has(n)}s.has=i;})(AC||(AC={}));var Tr=AC;var mI=tu(iC());var Ka=class{constructor(e,t){R(this,"_id");R(this,"_onStepStart");R(this,"_onLoadingLabel");R(this,"_onStepEnd");this._id=e,this._onStepStart=t?.onStepStart,this._onLoadingLabel=t?.onLoadingLabel,this._onStepEnd=t?.onStepEnd;}get id(){return this._id}get onStepStart(){return async(e,t)=>{if(this._onLoadingLabel&&e===0&&await this._onLoadingLabel(e,t),this._onStepStart)return await this._onStepStart(e,t)}}get onLoadingLabel(){return this._onLoadingLabel}get onStepEnd(){return this._onStepEnd}};var Ss=class extends Ka{constructor(t,i,s){super(t,s);R(this,"_steps");this._steps=i;}get stepCount(){return this.steps.length}getStepById(t){return this.steps[t]}get steps(){return typeof this._steps=="function"?this._steps():this._steps}getStepSha(t){if(t<0||t>=this.steps.length)return w.warn("stepSha not found, setting to ERROR"),"error";try{let i=this.steps[t];return (0,mI.default)(i.toString().toLocaleLowerCase()).toString()}catch(i){return w.warn("stepSha not found, setting to ERROR",i),"error"}}};var TG="__close-label-id__";function PC(){return new Ss(TG,[],{})}var Za=class{constructor(e,t,i,s){R(this,"text");R(this,"_label");R(this,"type");R(this,"oneTime");R(this,"onlyHaveNoChoice");R(this,"autoSelect");R(this,"props",{});R(this,"devProps",{});let{type:n="call",oneTime:o=false,onlyHaveNoChoice:a=false,autoSelect:u=false,...l}=s||{};this.text=e,this._label=t,this.type=n,this.oneTime=o,this.onlyHaveNoChoice=a,this.autoSelect=u,this.devProps=l,this.props=i;}get label(){let e=this._label;if(typeof e=="string"){let t=Tr.get(e);t?e=t:(w.error(`Label ${e} not found, so it will be closed`),e=PC());}return e}};function gI(r,e,t,i){let s=typeof e=="string"?e:e.id;return {...i,label:s,props:t,text:r,type:i?.type||"call"}}var Qa="close";var Ja=class{constructor(e,t){R(this,"text");R(this,"closeCurrentLabel");R(this,"type",Qa);R(this,"oneTime");R(this,"onlyHaveNoChoice");R(this,"autoSelect");R(this,"props",{});R(this,"devProps",{});let{closeCurrentLabel:i=false,oneTime:s=false,onlyHaveNoChoice:n=false,autoSelect:o=false,...a}=t||{};this.text=e,this.closeCurrentLabel=i,this.oneTime=s,this.onlyHaveNoChoice=n,this.autoSelect=o,this.devProps=a;}};function xI(r,e){return {...e,type:Qa,text:r}}var Z=class Z{constructor(){}static get allOpenedLabels(){return W.getVariable(le.OPENED_LABELS_COUNTER_KEY)||{}}static set allOpenedLabels(e){W.setVariable(le.OPENED_LABELS_COUNTER_KEY,e);}static getCurrentStepTimesCounterData(e=""){let t=Z.currentLabelStepIndex;if(t===null)return w.error("currentLabelStepIndex is null"),null;let i=`${t}${e}`,s=Z.currentLabelId,n=Z._currentLabel;if(!s||t===null||!n)return w.error("currentLabelId or currentLabelStepIndex is null or currentLabel not found"),null;let o=n.getStepSha(t)||"error",a=W.getVariable(le.CURRENT_STEP_TIMES_COUNTER_KEY)||{};return a[s]||(a[s]={}),(!a[s][i]||a[s][i].stepSha1!=o)&&(a[s][i]={stepSha1:o}),a[s][i]}static setCurrentStepTimesCounterData(e="",t){let i=Z.currentLabelStepIndex,s=i+e,n=Z.currentLabelId;if(!n||i===null){w.error("currentLabelId or currentLabelStepIndex is null");return}let o=W.getVariable(le.CURRENT_STEP_TIMES_COUNTER_KEY)||{};o[n]||(o[n]={}),o[n][s]=t,W.setVariable(le.CURRENT_STEP_TIMES_COUNTER_KEY,o);}static getCurrentStepTimesCounter(e=""){let t=Z._stepCounter,i=Z.getCurrentStepTimesCounterData(e);if(!i)return w.error("getCurrentStepTimesCounter obj is null"),0;let s=i.stepCounters||i.lastStepIndexs||[];return s.find(o=>o===t)||(s.push(t),delete i.lastStepIndexs,i.stepCounters=s,Z.setCurrentStepTimesCounterData(e,i)),s.length}static getRandomNumber(e,t,i={}){let s=i.nestedId||"";if(i.onceOnly||false){let o=Z.getCurrentStepTimesCounterData(s);if(!o)return;let a=o.usedRandomNumbers||{},u=Array.from({length:t-e+1},(h,d)=>d+e).filter(h=>!a[`${e}-${t}`]?.includes(h));if(u.length===0)return;let l=Math.floor(Math.random()*u.length),c=u[l];return a[`${e}-${t}`]||(a[`${e}-${t}`]=[]),a[`${e}-${t}`].push(c),o.usedRandomNumbers=a,Z.setCurrentStepTimesCounterData(s,o),c}return Math.floor(Math.random()*(t-e+1))+e}static resetCurrentStepTimesCounter(e=""){let t=Z.currentLabelStepIndex,i=t+e,s=Z.currentLabelId;if(!s||t===null){w.error("currentLabelId or currentLabelStepIndex is null");return}let n=W.getVariable(le.CURRENT_STEP_TIMES_COUNTER_KEY)||{};n[s]||(n[s]={}),n[s][i]={stepCounters:[],stepSha1:""},W.setVariable(le.CURRENT_STEP_TIMES_COUNTER_KEY,n);}static get allChoicesMade(){return W.getVariable(le.ALL_CHOICES_MADE_KEY)||[]}static set allChoicesMade(e){W.setVariable(le.ALL_CHOICES_MADE_KEY,e);}static increaseStepCounter(){Z._stepCounter++;}static get openedLabels(){return fe(Z._openedLabels)}static set openedLabels(e){Z._openedLabels=fe(e);}static get originalOpenedLabels(){return fe(Z._originalOpenedLabels)}static set originalOpenedLabels(e){Z._originalOpenedLabels=fe(e);}static get _currentLabel(){if(Z.currentLabelId)return Tr.get(Z.currentLabelId)}static get currentLabelId(){if(Z._openedLabels.length>0)return Z._openedLabels[Z._openedLabels.length-1].label}static get currentLabelStepIndex(){return Z._openedLabels.length>0?Z._openedLabels[Z._openedLabels.length-1].currentStepIndex:null}static addLabelHistory(e,t){let i=Z.allOpenedLabels,s=Z.allOpenedLabels[e]?.biggestStep||0,n=Z.allOpenedLabels[e]?.openCount||0;(!s||s<t)&&(i[e]={biggestStep:t,openCount:n},Z.allOpenedLabels=i);}static addChoicesMade(e,t,i,s){let n=Z.allChoicesMade,o=n.findIndex(a=>a.labelId===e&&a.stepIndex===t&&a.choiceIndex===s&&a.stepSha1===i);o<0?n.push({labelId:e,stepIndex:t,choiceIndex:s,stepSha1:i,madeTimes:1}):n[o].madeTimes++,Z.allChoicesMade=n;}static pushNewLabel(e){if(!Tr.get(e))throw new Error(`[Pixi\u2019VN] Label ${e} not found`);Z._openedLabels.push({label:e,currentStepIndex:0});let i=Z.allOpenedLabels,s=Z.allOpenedLabels[e]?.biggestStep||0,n=Z.allOpenedLabels[e]?.openCount||0;i[e]={biggestStep:s,openCount:n+1},Z.allOpenedLabels=i;}static increaseCurrentStepIndex(){if(Z._openedLabels.length>0){let e=Z._openedLabels[Z._openedLabels.length-1];Z._openedLabels[Z._openedLabels.length-1]={...e,currentStepIndex:e.currentStepIndex+1};}}static set onStepStart(e){Z._onStepStart=e;}static get onStepStart(){return async(e,t)=>{let i=[];return Z.onLoadingLabel&&e===0&&i.push(Z.onLoadingLabel(e,t)),Z._onStepStart&&i.push(Z._onStepStart(e,t)),await Promise.all(i)}}};R(Z,"stepsRunning",0),R(Z,"goNextRequests",0),R(Z,"choiceMadeTemp"),R(Z,"lastHistoryStep",null),R(Z,"_stepCounter",0),R(Z,"_openedLabels",[]),R(Z,"_originalOpenedLabels",[]),R(Z,"_onStepStart"),R(Z,"onLoadingLabel"),R(Z,"onStepEnd");var H=Z;var Mf=class{get currentStepTimesCounter(){return H.getCurrentStepTimesCounter()}set currentStepTimesCounter(e){H.resetCurrentStepTimesCounter();}getRandomNumber(e,t,i={}){return H.getRandomNumber(e,t,i)}get stepCounter(){return H._stepCounter}get openedLabels(){return H.openedLabels}get currentLabel(){return H._currentLabel}addStepHistory(e,t={}){let{choiceMade:i,ignoreSameStep:s}=t,n,o,a,u=W.getVariable(le.LAST_STEP_GLUED)===this.stepCounter;W.getVariable(le.LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY)===this.stepCounter&&(n=W.getVariable(le.CURRENT_DIALOGUE_MEMORY_KEY)),W.getVariable(le.LAST_MENU_OPTIONS_ADDED_IN_STEP_MEMORY_KEY)===this.stepCounter&&(o=W.getVariable(le.CURRENT_MENU_OPTIONS_MEMORY_KEY)),W.getVariable(le.LAST_INPUT_ADDED_IN_STEP_MEMORY_KEY)===this.stepCounter&&(a=W.getVariable(le.CURRENT_INPUT_VALUE_MEMORY_KEY));let l=H.openedLabels,c={currentLabel:H.currentLabelId,dialogue:n,choices:o,stepSha1:e,index:this.stepCounter,labelStepIndex:H.currentLabelStepIndex,choiceIndexMade:i,inputValue:a,alreadyMadeChoices:this.alreadyCurrentStepMadeChoices,isGlued:u,openedLabels:l};H.originalOpenedLabels=l,W.addHistoryItem(c,{ignoreSameStep:s}),H.lastHistoryStep=c,H.increaseStepCounter();}closeCurrentLabel(){if(!H.currentLabelId){w.warn("No label to close");return}if(!this.currentLabel){w.error("currentLabel not found");return}let e=H.openedLabels;e.pop(),H.openedLabels=e,W.onLabelClosing(this.openedLabels.length);}closeAllLabels(){for(;H.openedLabels.length>0;)this.closeCurrentLabel(),W.onLabelClosing(this.openedLabels.length);}isLabelAlreadyCompleted(e){let t;typeof e=="string"?t=e:t=e.id;let s=H.allOpenedLabels[t]?.biggestStep||0;if(s){let n=Tr.get(t);if(n)return n.stepCount<=s}return false}get alreadyCurrentStepMadeChoicesObj(){let e=H.currentLabelStepIndex,t=this.currentLabel;if(e===null||!t)return;let i=t.getStepSha(e);return i||(w.warn("stepSha not found, setting to ERROR"),i="error"),H.allChoicesMade.filter(s=>s.labelId===t?.id&&s.stepIndex===e&&s.stepSha1===i)}get alreadyCurrentStepMadeChoices(){return this.alreadyCurrentStepMadeChoicesObj?.map(e=>e.choiceIndex)}get isCurrentStepAlreadyOpened(){let e=H.currentLabelId;if(e){let t=H.allOpenedLabels[e]?.openCount||0;if(H.currentLabelStepIndex&&t>=H.currentLabelStepIndex)return true}return false}getTimesLabelOpened(e){return H.allOpenedLabels[e]?.openCount||0}getTimesChoiceMade(e){return this.alreadyCurrentStepMadeChoicesObj?.find(t=>t.choiceIndex===e)?.madeTimes||0}addCurrentStepToHistory(){this.addStepHistory("dev",{ignoreSameStep:true});}getCanGoNext(e){let t=e?.showWarn||false,i=this.choiceMenuOptions;return i&&i.length>0?(t&&w.warn("The player must make a choice"),false):this.isRequiredInput?(t&&w.warn("The player must enter a value"),false):true}get canGoNext(){return H.stepsRunning!==0?false:this.getCanGoNext()}async onStepRun(e,t){let i=[];return e.onStepStart&&i.push(e.onStepStart(t,e)),H.onStepStart&&i.push(H.onStepStart(t,e)),await Promise.all(i)}async onStepEnd(e,t){let i=[];return e.onStepEnd&&i.push(e.onStepEnd(t,e)),H.onStepEnd&&i.push(H.onStepEnd(t,e)),await Promise.all(i)}async goNext(e,t={}){let{runNow:i=false}=t;if(!(!i&&!this.getCanGoNext({showWarn:true}))){if(!i&&H.stepsRunning!==0){H.goNextRequests++;return}try{this.currentLabel&&await this.onStepEnd(this.currentLabel,H.currentLabelStepIndex||0);}catch(s){w.error("Error running onStepEnd",s);}return H.stepsRunning===0&&await W.onGoNextEnd(),H.increaseCurrentStepIndex(),await this.runCurrentStep(e,t)}}async runCurrentStep(e,t={}){let{choiceMade:i}=t;if(H.currentLabelId){let s=H.currentLabelStepIndex;if(s===null){w.error("currentLabelStepIndex is null");return}let n=H._currentLabel;if(!n){w.error("currentLabel not found");return}if(n.stepCount>s){try{await this.onStepRun(n,s);}catch(u){w.error("Error running onStepStart",u),this.onStepError&&this.onStepError(u,e);return}let o=n.getStepById(s);if(!o){w.error("step not found");return}let a=n.getStepSha(s);a||(w.warn("stepSha not found, setting to ERROR"),a="error");try{H.stepsRunning++;let u=await o(e,{labelId:n.id}),l=this.choiceMenuOptions;if(l?.length===1&&l[0].autoSelect){let h=l[0];u=await this.selectChoice(h,e);}let c=H.lastHistoryStep;if(i!==void 0&&c){let h=c.stepSha1;h||(w.warn("stepSha not found, setting to ERROR"),h="error"),H.addChoicesMade(c.currentLabel||"error",typeof c.labelStepIndex=="number"?c.labelStepIndex:-1,c.stepSha1||"error",i),H.choiceMadeTemp=i;}return H.stepsRunning--,H.stepsRunning===0&&(H.addLabelHistory(n.id,s),this.addStepHistory(a,{...t,choiceMade:H.choiceMadeTemp}),H.choiceMadeTemp=void 0,H.goNextRequests>0)?(H.goNextRequests--,await this.goNext(e)):u}catch(u){H.stepsRunning>0&&H.stepsRunning--,w.error("Error running step",u),this.onStepError&&this.onStepError(u,e);return}}else {if(this.openedLabels.length>1)return this.closeCurrentLabel(),await this.goNext(e,t);if(this.openedLabels.length===1)return H.openedLabels=[],this.onGameEnd?await this.onGameEnd(e,{labelId:"end"}):void 0}}else if(this.openedLabels.length===0){if(H.openedLabels=H.originalOpenedLabels,this.onGameEnd)return await this.onGameEnd(e,{labelId:"end"});w.error("The end of the game is not managed, so the game is blocked. Read this documentation to know how to manage the end of the game: https://pixi-vn.web.app/start/other-narrative-features.html#how-manage-the-end-of-the-game");return}else w.error("currentLabelId not found");}async callLabel(e,t,i){let{choiceMade:s}=i||{},n;typeof e=="string"?n=e:n=e.id;try{let o=Tr.get(n);if(!o)throw new Error(`[Pixi\u2019VN] Label ${n} not found`);try{this.currentLabel&&await this.onStepEnd(this.currentLabel,H.currentLabelStepIndex||0);}catch(a){w.error("Error running onStepEnd",a);}H.pushNewLabel(o.id);}catch(o){w.error("Error calling label",o);return}return await this.runCurrentStep(t,{choiceMade:s})}async jumpLabel(e,t,i){this.openedLabels.length>0&&this.closeCurrentLabel();let{choiceMade:s}=i||{},n;typeof e=="string"?n=e:n=e.id;try{let o=Tr.get(n);if(!o)throw new Error(`[Pixi\u2019VN] Label ${n} not found`);try{this.currentLabel&&await this.onStepEnd(this.currentLabel,H.currentLabelStepIndex||0);}catch(a){w.error("Error running onStepEnd",a);}H.pushNewLabel(o.id);}catch(o){w.error("Error jumping label",o);return}return await this.runCurrentStep(t,{choiceMade:s})}async selectChoice(e,t){this.choiceMenuOptions=void 0;let i=e.type;switch(i){case "call":return await this.callLabel(e.label,{...e.props,...t},{choiceMade:e.choiceIndex});case "jump":return await this.jumpLabel(e.label,{...e.props,...t},{choiceMade:e.choiceIndex});case "close":return await this.closeChoiceMenu(e,{...e.props,...t});default:throw w.error(`Type ${i} not found`),new Error(`[Pixi\u2019VN] Type ${i} not found`)}}async closeChoiceMenu(e,t){if(e.type!=="close")throw w.error("For closeChoiceMenu, the type must be close"),new Error("[Pixi\u2019VN] For closeChoiceMenu, the type must be close");let i;return typeof e.choiceIndex=="number"&&(i=e.choiceIndex),e.closeCurrentLabel&&this.closeCurrentLabel(),this.goNext(t,{choiceMade:i})}get onGameEnd(){return W.onEnd}set onGameEnd(e){W.onEnd=e;}get onStepError(){let e=W.onError;return e?(t,i)=>e("step",t,i):void 0}set onStepError(e){W.onError=(t,i,s)=>e(i,s);}get dialogue(){let e=W.getVariable(le.CURRENT_DIALOGUE_MEMORY_KEY);if(e)return {...e,character:e.character?W.getCharacter(e.character)||e.character:void 0}}set dialogue(e){if(!e){W.setVariable(le.CURRENT_DIALOGUE_MEMORY_KEY,void 0);return}if((typeof e=="string"||Array.isArray(e))&&(e={text:e}),this.dialogGlue){let t=W.getVariable(le.CURRENT_DIALOGUE_MEMORY_KEY);if(t){let i=[];Array.isArray(t.text)?i=[...t.text]:i=[t.text],Array.isArray(e.text)?i=[...i,...e.text]:i=[...i,e.text],e.text=i,e.character=e.character||t.character;}W.setVariable(le.LAST_STEP_GLUED,this.stepCounter),this.dialogGlue=false;}try{W.setVariable(le.CURRENT_DIALOGUE_MEMORY_KEY,fe({...e,character:typeof e.character=="string"?e.character:e.character?.id})),W.setVariable(le.LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY,this.stepCounter);}catch(t){throw w.error("DialogueInterface cannot contain functions or classes"),t}}get choiceMenuOptions(){let e=W.getVariable(le.CURRENT_MENU_OPTIONS_MEMORY_KEY);if(e){let t=[],i=e.map((n,o)=>({...n,choiceIndex:o})),s=this.alreadyCurrentStepMadeChoices;if(i=i.filter((n,o)=>n.oneTime&&s&&s.includes(o)?false:n.onlyHaveNoChoice?(t.push(n),false):true),i.length>0)return i;if(t.length>0)return [t[0]]}}set choiceMenuOptions(e){if(!e||e.length===0){W.setVariable(le.CURRENT_MENU_OPTIONS_MEMORY_KEY,void 0);return}let t=e.map(i=>i instanceof Ja?{...i.devProps,text:i.text,type:Qa,closeCurrentLabel:i.closeCurrentLabel,oneTime:i.oneTime,onlyHaveNoChoice:i.onlyHaveNoChoice,autoSelect:i.autoSelect,props:i.props}:i instanceof Za?{...i.devProps,type:i.type,text:i.text,label:i.label.id,autoSelect:i.autoSelect,oneTime:i.oneTime,onlyHaveNoChoice:i.onlyHaveNoChoice,props:i.props}:i);try{W.setVariable(le.CURRENT_MENU_OPTIONS_MEMORY_KEY,fe(t)),W.setVariable(le.LAST_MENU_OPTIONS_ADDED_IN_STEP_MEMORY_KEY,this.stepCounter);}catch(i){throw w.error("ChoiceInterface cannot contain functions or classes"),i}}get dialogGlue(){return W.getFlag(le.ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY)}set dialogGlue(e){W.setFlag(le.ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY,e);}get inputValue(){return W.getVariable(le.CURRENT_INPUT_VALUE_MEMORY_KEY)}set inputValue(e){this.removeInputRequest(),W.setVariable(le.CURRENT_INPUT_VALUE_MEMORY_KEY,e),W.setVariable(le.LAST_INPUT_ADDED_IN_STEP_MEMORY_KEY,this.stepCounter);}get isRequiredInput(){return W.getVariable(le.CURRENT_INPUT_INFO_MEMORY_KEY)?.isRequired||false}get inputType(){return W.getVariable(le.CURRENT_INPUT_INFO_MEMORY_KEY)?.type}requestInput(e,t){e.isRequired=true,W.setVariable(le.CURRENT_INPUT_INFO_MEMORY_KEY,e),t!==void 0?W.setVariable(le.CURRENT_INPUT_VALUE_MEMORY_KEY,t):W.removeVariable(le.CURRENT_INPUT_VALUE_MEMORY_KEY);}removeInputRequest(){W.removeVariable(le.CURRENT_INPUT_INFO_MEMORY_KEY),W.removeVariable(le.CURRENT_INPUT_VALUE_MEMORY_KEY);}clear(){H.openedLabels=[],H._stepCounter=0;}export(){return {openedLabels:fe(H.openedLabels),stepCounter:this.stepCounter}}async onLoadingLabel(e){let t=this.openedLabels.map(async i=>{let s=[],n=Tr.get(i.label);return n&&(n.onLoadingLabel&&s.push(n.onLoadingLabel(e,n)),H.onLoadingLabel&&s.push(H.onLoadingLabel(e,n))),await Promise.all(s)});return await Promise.all(t)}async restore(e,t){this.clear();try{H.lastHistoryStep=t,e.hasOwnProperty("openedLabels")?(H.openedLabels=e.openedLabels,H.originalOpenedLabels=H.openedLabels):w.warn("Could not import openedLabels data, so will be ignored"),e.hasOwnProperty("stepCounter")?H._stepCounter=e.stepCounter:e.hasOwnProperty("lastStepIndex")?H._stepCounter=e.lastStepIndex:w.warn("Could not import stepCounter data, so will be ignored");try{await this.onLoadingLabel(H.currentLabelStepIndex||0);}catch(i){w.error("Error running onLoadingLabel",i);}}catch(i){w.error("Error importing data",i);}}};function wC(r,e,t){let i=new Ss(r,e,t);return Tr.add(i),i}var Es=new Mf;var MC={};Zi(MC,{Sound:()=>Wn,SoundManagerStatic:()=>se,sound:()=>Xn});var se=class{constructor(){}};R(se,"soundAliasesOrder",[]),R(se,"soundsPlaying",{}),R(se,"sounds",{});var Wn=class r extends Rr{constructor(){super(...arguments);R(this,"alias");}pause(){if(!this.alias)throw new Error("[Pixi\u2019VN] The alias is not defined.");let t=se.soundsPlaying[this.alias];if(!t)throw new Error("[Pixi\u2019VN] The alias is not found in the playInStepIndex.");return se.soundsPlaying[this.alias]={...t,paused:true},super.pause()}resume(){if(!this.alias)throw new Error("[Pixi\u2019VN] The alias is not defined.");let t=se.soundsPlaying[this.alias];if(!t)throw new Error("[Pixi\u2019VN] The alias is not found in the playInStepIndex.");return se.soundsPlaying[this.alias]={options:t.options,stepIndex:W.stepCounter,paused:false},super.resume()}destroy(){return this.alias&&delete se.soundsPlaying[this.alias],super.destroy()}stop(){if(!this.alias)throw new Error("[Pixi\u2019VN] The alias is not defined.");return delete se.soundsPlaying[this.alias],super.stop()}play(t){if(typeof t=="string"&&(this.alias=t),!this.alias)throw new Error("[Pixi\u2019VN] The alias is not defined.");return se.soundsPlaying[this.alias]={stepIndex:W.stepCounter,options:t,paused:false},super.play(t)}static from(t){let i=Rr.from(t);return new r(i.media,i.options)}};function If(r){let e=[];for(let t of r)t.type==="TelephoneFilter"?e.push(new Xe.TelephoneFilter):t.type==="StreamFilter"?e.push(new Xe.StreamFilter):t.type==="StereoFilter"?e.push(new Xe.StereoFilter(t.pan)):t.type==="ReverbFilter"?e.push(new Xe.ReverbFilter(t.seconds,t.decay,t.reverse)):t.type==="MonoFilter"?e.push(new Xe.MonoFilter):t.type==="EqualizerFilter"?e.push(new Xe.EqualizerFilter(t.f32,t.f64,t.f125,t.f250,t.f500,t.f1k,t.f2k,t.f4k,t.f8k,t.f16k)):t.type==="DistortionFilter"?e.push(new Xe.DistortionFilter(t.amount)):w.error("Unknown sound filter type");return e}function RC(r){if(!r)return;let e=[];for(let t of r)t instanceof Xe.TelephoneFilter?e.push({type:"TelephoneFilter"}):t instanceof Xe.StreamFilter?e.push({type:"StreamFilter"}):t instanceof Xe.StereoFilter?e.push({type:"StereoFilter",pan:t.pan}):t instanceof Xe.ReverbFilter?e.push({type:"ReverbFilter",seconds:t.seconds,decay:t.decay,reverse:t.reverse}):t instanceof Xe.MonoFilter?e.push({type:"MonoFilter"}):t instanceof Xe.EqualizerFilter?e.push({type:"EqualizerFilter",f32:t.f32,f64:t.f64,f125:t.f125,f250:t.f250,f500:t.f500,f1k:t.f1k,f2k:t.f2k,f4k:t.f4k,f8k:t.f8k,f16k:t.f16k}):t instanceof Xe.DistortionFilter?e.push({type:"DistortionFilter",amount:t.amount}):w.error("Unknown sound filter type");return e}var Df=class extends cc{constructor(){super();}get context(){return we.context}get filtersAll(){return we.filtersAll}set filtersAll(e){we.filtersAll=e.filter(t=>!(t instanceof Xe.Filter));}get supported(){return we.supported}getOptions(e,t){let i;return typeof e=="string"?i={url:e}:Array.isArray(e)?i={url:e}:e instanceof ArrayBuffer||e instanceof AudioBuffer||e instanceof HTMLAudioElement?i={source:e}:i=e,i={...i,...t||{}},i}add(e,t){if(typeof e=="object")throw new Error("[Pixi\u2019VN] The method add(map: SoundSourceMap, globalOptions?: Options) is deprecated. Use add(alias: string, options: Options | string | ArrayBuffer | AudioBuffer | HTMLAudioElement | Sound): Sound; instead.");this.exists(e)&&this.remove(e),t instanceof Rr&&(t=t.options);let i;if(t instanceof Wn)i=t;else {let s=this.getOptions(t||{});i=Wn.from(s);}return i.alias=e,!se.soundAliasesOrder.includes(e)&&se.soundAliasesOrder.push(e),se.sounds[e]=i,we.add(e,i),i}get useLegacy(){return we.useLegacy}set useLegacy(e){we.useLegacy=e;}get disableAutoPause(){return we.disableAutoPause}set disableAutoPause(e){we.disableAutoPause=e;}remove(e){return se.soundAliasesOrder=se.soundAliasesOrder.filter(t=>t!==e),delete se.soundsPlaying[e],delete se.sounds[e],we.remove(e)}get volumeAll(){return we.volumeAll}set volumeAll(e){we.volumeAll=e;}get speedAll(){return we.speedAll}set speedAll(e){we.speedAll=e;}togglePauseAll(){return we.togglePauseAll()}pauseAll(){return we.pauseAll()}resumeAll(){return we.resumeAll()}toggleMuteAll(){return we.toggleMuteAll()}muteAll(){return we.muteAll()}unmuteAll(){return we.unmuteAll()}removeAll(){return se.soundAliasesOrder=[],se.soundsPlaying={},se.sounds={},we.removeAll()}stopAll(){for(let e in se.sounds)se.sounds[e].stop();return se.soundsPlaying={},we.stopAll()}exists(e,t){return we.exists(e,t)||e in se.sounds}isPlaying(){return we.isPlaying()}find(e){let t=se.sounds[e];return t||(t=we.find(e),t&&(se.sounds[e]=t),t)}play(e,t){if(!this.exists(e))throw new Error("[Pixi\u2019VN] The alias is not found in the sound library.");return se.soundsPlaying[e]={stepIndex:W.stepCounter,options:t,paused:false},we.play(e,t)}stop(e){return delete se.soundsPlaying[e],we.stop(e)}pause(e){let t=se.soundsPlaying[e];if(!t)throw new Error("[Pixi\u2019VN] The alias is not found in the playInStepIndex.");return se.soundsPlaying[e]={...t,paused:true},we.pause(e)}resume(e){let t=se.soundsPlaying[e];if(!t)throw new Error("[Pixi\u2019VN] The alias is not found in the playInStepIndex.");return se.soundsPlaying[e]={options:t.options,stepIndex:W.stepCounter,paused:false},we.resume(e)}volume(e,t){return we.volume(e,t)}speed(e,t){return we.speed(e,t)}duration(e){return we.duration(e)}close(){return we.close()}clear(){this.stopAll();}export(){let e={};for(let t in se.soundsPlaying){let i=se.soundsPlaying[t],s=this.find(t);s&&(e[t]={...i,sound:{options:{...s.options,autoPlay:s.autoPlay,loop:s.loop,preload:s.preload,singleInstance:s.singleInstance,url:s.options.url,volume:s.options.volume},filters:RC(s.media.filters)}});}return {soundsPlaying:fe(e),soundAliasesOrder:fe(se.soundAliasesOrder),filters:fe(RC(this.filtersAll))}}removeOldSoundAndExport(){return this.export()}restore(e){let t=W.stepCounter-1;this.clear();try{if(e.hasOwnProperty("soundAliasesOrder"))se.soundAliasesOrder=e.soundAliasesOrder;else {w.error("The data does not have the properties soundAliasesOrder");return}if(e.hasOwnProperty("filters")){let i=e.filters;i&&(this.filtersAll=If(i));}if(e.hasOwnProperty("playInStepIndex")){let i=e.playInStepIndex;i&&(se.soundsPlaying=i);}if(e.hasOwnProperty("sounds")){let i=e.sounds;for(let s in i){let n=i[s],o=!1,a=this.add(s,{...n.options,autoPlay:!1});if(s in se.soundsPlaying){let u=se.soundsPlaying[s];(n.options.loop||u.options&&typeof u.options=="object"&&u.options.loop||u.stepIndex===t)&&(o=!0),n.filters&&(a.filters=If(n.filters)),o&&a.play();}}}if(e.hasOwnProperty("soundsPlaying")){let i=e.soundsPlaying;for(let s in i){let n=i[s];se.soundsPlaying[s]={paused:n.paused,stepIndex:n.stepIndex,options:n.options};let o=i[s].sound,a=!1,u;if(this.exists(s)?(u=this.find(s),o.options.url=u.options.url,o.options.volume=u.options.volume,u.options=o.options,u.autoPlay=!1,u.filters=o.filters?If(o.filters):[]):u=this.add(s,{...o.options,autoPlay:!1}),s in se.soundsPlaying){let l=se.soundsPlaying[s];(o.options.loop||l.options&&typeof l.options=="object"&&l.options.loop||l.stepIndex===t)&&(a=!0),o.filters&&(u.filters=If(o.filters)),a&&u.play();}}}else {w.error("The data does not have the properties soundsPlaying");return}}catch(i){w.error("Error importing data",i);}}};var Xn=new Df;ke();function _I(){console.info(`
3310
+ `,dynamic:false}};});var $F,fM,pM,mM=f(()=>{Lt();si();Y1();$F=new Ae(0,0,0,0),fM=class j1 extends lt{constructor(e={}){e={...j1.defaultOptions,...e,dynamicProperties:{...j1.defaultOptions.dynamicProperties,...e?.dynamicProperties}};let{dynamicProperties:t,shader:i,roundPixels:s,texture:n,particles:o,...a}=e;super({label:"ParticleContainer",...a}),this.renderPipeId="particle",this.batched=false,this._childrenDirty=false,this.texture=n||null,this.shader=i,this._properties={};for(let u in sf){let l=sf[u],c=t[u];this._properties[u]={...l,dynamic:c};}this.allowChildren=true,this.roundPixels=s??false,this.particleChildren=o??[];}addParticle(...e){for(let t=0;t<e.length;t++)this.particleChildren.push(e[t]);return this.onViewUpdate(),e[0]}removeParticle(...e){let t=false;for(let i=0;i<e.length;i++){let s=this.particleChildren.indexOf(e[i]);s>-1&&(this.particleChildren.splice(s,1),t=true);}return t&&this.onViewUpdate(),e[0]}update(){this._childrenDirty=true;}onViewUpdate(){this._childrenDirty=true,super.onViewUpdate();}get bounds(){return $F}updateBounds(){}destroy(e=false){if(super.destroy(e),typeof e=="boolean"?e:e?.texture){let i=typeof e=="boolean"?e:e?.textureSource,s=this.texture??this.particleChildren[0]?.texture;s&&s.destroy(i);}this.texture=null,this.shader?.destroy();}removeParticles(e,t){e??(e=0),t??(t=this.particleChildren.length);let i=this.particleChildren.splice(e,t-e);return this.onViewUpdate(),i}removeParticleAt(e){let t=this.particleChildren.splice(e,1);return this.onViewUpdate(),t[0]}addParticleAt(e,t){return this.particleChildren.splice(t,0,e),this.onViewUpdate(),e}addChild(...e){throw new Error("ParticleContainer.addChild() is not available. Please use ParticleContainer.addParticle()")}removeChild(...e){throw new Error("ParticleContainer.removeChild() is not available. Please use ParticleContainer.removeParticle()")}removeChildren(e,t){throw new Error("ParticleContainer.removeChildren() is not available. Please use ParticleContainer.removeParticles()")}removeChildAt(e){throw new Error("ParticleContainer.removeChildAt() is not available. Please use ParticleContainer.removeParticleAt()")}getChildAt(e){throw new Error("ParticleContainer.getChildAt() is not available. Please use ParticleContainer.getParticleAt()")}setChildIndex(e,t){throw new Error("ParticleContainer.setChildIndex() is not available. Please use ParticleContainer.setParticleIndex()")}getChildIndex(e){throw new Error("ParticleContainer.getChildIndex() is not available. Please use ParticleContainer.getParticleIndex()")}addChildAt(e,t){throw new Error("ParticleContainer.addChildAt() is not available. Please use ParticleContainer.addParticleAt()")}swapChildren(e,t){throw new Error("ParticleContainer.swapChildren() is not available. Please use ParticleContainer.swapParticles()")}reparentChild(...e){throw new Error("ParticleContainer.reparentChild() is not available with the particle container")}reparentChildAt(e,t){throw new Error("ParticleContainer.reparentChildAt() is not available with the particle container")}};fM.defaultOptions={dynamicProperties:{vertex:false,position:true,rotation:false,uvs:false,color:false},roundPixels:false};pM=fM;});var gM,$1,wb,_M=f(()=>{ws();ye();Pe();si();kg();gM=class xM extends lt{constructor(e){e instanceof exports.Texture&&(e={texture:e});let{width:t,height:i,anchor:s,leftWidth:n,rightWidth:o,topHeight:a,bottomHeight:u,texture:l,roundPixels:c,...h}=e;super({label:"NineSliceSprite",...h}),this.renderPipeId="nineSliceSprite",this.batched=true,this._leftWidth=n??l?.defaultBorders?.left??ci.defaultOptions.leftWidth,this._topHeight=a??l?.defaultBorders?.top??ci.defaultOptions.topHeight,this._rightWidth=o??l?.defaultBorders?.right??ci.defaultOptions.rightWidth,this._bottomHeight=u??l?.defaultBorders?.bottom??ci.defaultOptions.bottomHeight,this._width=t??l.width??ci.defaultOptions.width,this._height=i??l.height??ci.defaultOptions.height,this.allowChildren=false,this.texture=l??xM.defaultOptions.texture,this.roundPixels=c??false,this._anchor=new Ne({_onUpdate:()=>{this.onViewUpdate();}}),s?this.anchor=s:this.texture.defaultAnchor&&(this.anchor=this.texture.defaultAnchor);}get anchor(){return this._anchor}set anchor(e){typeof e=="number"?this._anchor.set(e):this._anchor.copyFrom(e);}get width(){return this._width}set width(e){this._width=e,this.onViewUpdate();}get height(){return this._height}set height(e){this._height=e,this.onViewUpdate();}setSize(e,t){typeof e=="object"&&(t=e.height??e.width,e=e.width),this._width=e,this._height=t??e,this.onViewUpdate();}getSize(e){return e||(e={}),e.width=this._width,e.height=this._height,e}get leftWidth(){return this._leftWidth}set leftWidth(e){this._leftWidth=e,this.onViewUpdate();}get topHeight(){return this._topHeight}set topHeight(e){this._topHeight=e,this.onViewUpdate();}get rightWidth(){return this._rightWidth}set rightWidth(e){this._rightWidth=e,this.onViewUpdate();}get bottomHeight(){return this._bottomHeight}set bottomHeight(e){this._bottomHeight=e,this.onViewUpdate();}get texture(){return this._texture}set texture(e){e||(e=exports.Texture.EMPTY);let t=this._texture;t!==e&&(t&&t.dynamic&&t.off("update",this.onViewUpdate,this),e.dynamic&&e.on("update",this.onViewUpdate,this),this._texture=e,this.onViewUpdate());}get originalWidth(){return this._texture.width}get originalHeight(){return this._texture.height}destroy(e){if(super.destroy(e),typeof e=="boolean"?e:e?.texture){let i=typeof e=="boolean"?e:e?.textureSource;this._texture.destroy(i);}this._texture=null;}updateBounds(){let e=this._bounds,t=this._anchor,i=this._width,s=this._height;e.minX=-t._x*i,e.maxX=e.minX+i,e.minY=-t._y*s,e.maxY=e.minY+s;}};gM.defaultOptions={texture:exports.Texture.EMPTY};$1=gM,wb=class extends $1{constructor(...e){let t=e[0];t instanceof exports.Texture&&(U(Y,"NineSlicePlane now uses the options object {texture, leftWidth, rightWidth, topHeight, bottomHeight}"),t={texture:t,leftWidth:e[1],topHeight:e[2],rightWidth:e[3],bottomHeight:e[4]}),U(Y,"NineSlicePlane is deprecated. Use NineSliceSprite instead."),super(t);}};});async function bM(r,e,t=200){let i=await e.extract.base64(r);await e.encoder.commandFinished;let s=t;console.log(`logging texture ${r.source.width}px ${r.source.height}px`);let n=["font-size: 1px;",`padding: ${s}px 300px;`,`background: url(${i}) no-repeat;`,"background-size: contain;"].join(" ");console.log("%c ",n);}var yM=f(()=>{});function q1(r,e=0,t={color:"#000000"}){r.renderGroup&&(t.color=qF[KF++]);let i="";for(let o=0;o<e;o++)i+=" ";let s=r.label;!s&&r instanceof Ge&&(s=`sprite:${r.texture.label}`);let n=`%c ${i}|- ${s} (worldX:${r.worldTransform.tx}, relativeRenderX:${r.relativeGroupTransform.tx}, renderX:${r.groupTransform.tx}, localX:${r.x})`;r.renderGroup&&(n+=" (RenderGroup)"),r.filters&&(n+="(*filters)"),console.log(n,`color:${t.color}; font-weight:bold;`),e++;for(let o=0;o<r.children.length;o++){let a=r.children[o];q1(a,e,{...t});}}function K1(r,e=0,t={index:0,color:"#000000"}){let i="";for(let n=0;n<e;n++)i+=" ";let s=`%c ${i}- ${t.index}: ${r.root.label} worldX:${r.worldTransform.tx}`;console.log(s,`color:${t.color}; font-weight:bold;`),e++;for(let n=0;n<r.renderGroupChildren.length;n++){let o=r.renderGroupChildren[n];K1(o,e,{...t,index:n});}}var qF,KF,vM=f(()=>{Ns();qF=["#000080","#228B22","#8B0000","#4169E1","#008080","#800000","#9400D3","#FF8C00","#556B2F","#8B008B"],KF=0;});var TM={};Zi(TM,{AbstractBitmapFont:()=>hn,AbstractRenderer:()=>Di,AbstractText:()=>Ni,AccessibilitySystem:()=>_p,AlphaFilter:()=>KB,AlphaMask:()=>uo,AlphaMaskPipe:()=>Qo,AnimatedSprite:()=>tc,Application:()=>_d,ApplicationInitHook:()=>Ko,Assets:()=>exports.Assets,AssetsClass:()=>Cd,BLEND_TO_NPM:()=>Up,BUFFER_TYPE:()=>Sa,BackgroundLoader:()=>wl,BackgroundSystem:()=>tx,Batch:()=>Qc,BatchGeometry:()=>Tu,BatchTextureArray:()=>vu,BatchableGraphics:()=>ls,BatchableHTMLText:()=>qu,BatchableMesh:()=>wi,BatchableSprite:()=>Xr,BatchableText:()=>Gu,Batcher:()=>zp,BatcherPipe:()=>sd,BigPool:()=>Ve,BindGroup:()=>_t,BindGroupSystem:()=>oa,BitmapFont:()=>Oa,BitmapFontManager:()=>fs,BitmapText:()=>sc,BitmapTextGraphics:()=>Ph,BitmapTextPipe:()=>Io,BlendModeFilter:()=>ae,BlendModePipe:()=>ta,BlurFilter:()=>$d,BlurFilterPass:()=>ec,Bounds:()=>Ae,BrowserAdapter:()=>Ap,Buffer:()=>tt,BufferImageSource:()=>rs,BufferResource:()=>Fi,BufferUsage:()=>he,CLEAR:()=>bt,Cache:()=>Se,CanvasPool:()=>sr,CanvasPoolClass:()=>Sh,CanvasSource:()=>At,CanvasTextGenerator:()=>ds,CanvasTextMetrics:()=>It,CanvasTextPipe:()=>Co,CanvasTextSystem:()=>Mo,Circle:()=>Uu,Color:()=>te,ColorBlend:()=>kh,ColorBurnBlend:()=>Oh,ColorDodgeBlend:()=>Fh,ColorMask:()=>lo,ColorMaskPipe:()=>Jo,ColorMatrixFilter:()=>lb,CompressedSource:()=>jr,Container:()=>ue,Culler:()=>W_,CullerPlugin:()=>Dd,CustomRenderPipe:()=>Wo,D3D10_RESOURCE_DIMENSION:()=>F_,D3DFMT:()=>nr,DATA_URI:()=>Ow,DDS:()=>ne,DEG_TO_RAD:()=>zf,DEPRECATED_SCALE_MODES:()=>rf,DEPRECATED_WRAP_MODES:()=>tf,DOMAdapter:()=>j,DOMContainer:()=>Cp,DOMPipe:()=>oo,DRAW_MODES:()=>AR,DXGI_FORMAT:()=>O_,DXGI_TO_TEXTURE_FORMAT:()=>Zt,DarkenBlend:()=>Gh,DefaultBatcher:()=>mo,DefaultShader:()=>Pu,DifferenceBlend:()=>Uh,DisplacementFilter:()=>db,DivideBlend:()=>Lh,DynamicBitmapFont:()=>Ch,Ellipse:()=>Lu,EventBoundary:()=>du,EventEmitter:()=>_e,EventSystem:()=>fu,EventsTicker:()=>Fr,ExclusionBlend:()=>Nh,ExtensionType:()=>x,ExtractSystem:()=>rx,FOURCC_TO_TEXTURE_FORMAT:()=>Rd,FederatedContainer:()=>Ep,FederatedEvent:()=>Ci,FederatedMouseEvent:()=>ii,FederatedPointerEvent:()=>Nt,FederatedWheelEvent:()=>Gr,FillGradient:()=>qt,FillPattern:()=>ui,Filter:()=>Dt,FilterEffect:()=>ei,FilterPipe:()=>Uo,FilterSystem:()=>Lo,FontStylePromiseCache:()=>Ku,GAUSSIAN_VALUES:()=>Jl,GL_FORMATS:()=>bl,GL_INTERNAL_FORMAT:()=>XE,GL_TARGETS:()=>hd,GL_TYPES:()=>Ee,GL_WRAP_MODES:()=>y2,GenerateTextureSystem:()=>ra,Geometry:()=>jt,GlBackBufferSystem:()=>Dx,GlBatchAdaptor:()=>Ta,GlBuffer:()=>_l,GlBufferSystem:()=>Ea,GlColorMaskSystem:()=>Aa,GlContextSystem:()=>Rx,GlEncoderSystem:()=>Pa,GlGeometrySystem:()=>Ca,GlGraphicsAdaptor:()=>ya,GlLimitsSystem:()=>wa,GlMeshAdaptor:()=>va,GlParticleContainerAdaptor:()=>Iu,GlParticleContainerPipe:()=>To,GlProgram:()=>je,GlProgramData:()=>Tl,GlRenderTarget:()=>yl,GlRenderTargetAdaptor:()=>vl,GlRenderTargetSystem:()=>Ma,GlShaderSystem:()=>Ia,GlStateSystem:()=>e_,GlStencilSystem:()=>Ba,GlTexture:()=>El,GlTextureSystem:()=>ka,GlUboSystem:()=>Ra,GlUniformGroupSystem:()=>Da,GlobalUniformSystem:()=>ia,GpuBatchAdaptor:()=>zo,GpuBlendModesToPixi:()=>zt,GpuBufferSystem:()=>aa,GpuColorMaskSystem:()=>ua,GpuDeviceSystem:()=>Tn,GpuEncoderSystem:()=>la,GpuGraphicsAdaptor:()=>Ho,GpuGraphicsContext:()=>hh,GpuLimitsSystem:()=>ca,GpuMeshAdapter:()=>Vo,GpuMipmapGenerator:()=>xl,GpuParticleContainerAdaptor:()=>Ou,GpuParticleContainerPipe:()=>So,GpuProgram:()=>$e,GpuRenderTarget:()=>pl,GpuRenderTargetAdaptor:()=>ml,GpuRenderTargetSystem:()=>ga,GpuShaderSystem:()=>xa,GpuStateSystem:()=>_a,GpuStencilModesToPixi:()=>Yr,GpuStencilSystem:()=>ha,GpuTextureSystem:()=>ba,GpuUboSystem:()=>fa,GpuUniformBatchPipe:()=>pa,Graphics:()=>cn,GraphicsContext:()=>dt,GraphicsContextRenderData:()=>dh,GraphicsContextSystem:()=>rn,GraphicsGpuData:()=>ph,GraphicsPath:()=>Bi,GraphicsPipe:()=>yo,HTMLText:()=>nc,HTMLTextPipe:()=>Do,HTMLTextRenderData:()=>dn,HTMLTextStyle:()=>fn,HTMLTextSystem:()=>ko,HardLightBlend:()=>Hh,HardMixBlend:()=>Vh,HelloSystem:()=>vn,IGLUniformData:()=>Lx,ImageSource:()=>Yt,InstructionSet:()=>Is,KTX:()=>nt,LightenBlend:()=>zh,LinearBurnBlend:()=>Wh,LinearDodgeBlend:()=>Xh,LinearLightBlend:()=>Yh,Loader:()=>Rl,LoaderParserPriority:()=>ze,LuminosityBlend:()=>jh,MaskEffectManager:()=>nu,MaskEffectManagerClass:()=>kc,MaskFilter:()=>sl,Matrix:()=>G,Mesh:()=>_r,MeshGeometry:()=>fr,MeshGpuData:()=>Mu,MeshPipe:()=>vo,MeshPlane:()=>Cb,MeshRope:()=>nM,MeshSimple:()=>Pb,NOOP:()=>Uc,NegationBlend:()=>$h,NineSliceGeometry:()=>ci,NineSlicePlane:()=>wb,NineSliceSprite:()=>$1,NineSliceSpriteGpuData:()=>Mh,NineSliceSpritePipe:()=>Go,NoiseFilter:()=>nR,ObservablePoint:()=>Ne,OverlayBlend:()=>qh,PI_2:()=>Hf,Particle:()=>hM,ParticleBuffer:()=>Du,ParticleContainer:()=>pM,ParticleContainerPipe:()=>sn,ParticleShader:()=>ku,PerspectiveMesh:()=>QR,PerspectivePlaneGeometry:()=>ac,PinLightBlend:()=>Kh,PipelineSystem:()=>ma,PlaneGeometry:()=>gn,Point:()=>me,Polygon:()=>on,Pool:()=>Ji,PoolGroupClass:()=>Ic,PrepareBase:()=>mb,PrepareQueue:()=>ic,PrepareSystem:()=>ef,PrepareUpload:()=>oc,QuadGeometry:()=>Ju,RAD_TO_DEG:()=>Vf,Rectangle:()=>exports.Rectangle,RenderContainer:()=>vb,RenderGroup:()=>lu,RenderGroupPipe:()=>Yo,RenderGroupSystem:()=>$o,RenderLayer:()=>XR,RenderTarget:()=>na,RenderTargetSystem:()=>Cn,RenderTexture:()=>nl,RenderableGCSystem:()=>ox,RendererInitHook:()=>Zo,RendererType:()=>qe,ResizePlugin:()=>io,Resolver:()=>Vt,RopeGeometry:()=>Ab,RoundedRectangle:()=>Nu,SCALE_MODES:()=>BR,STENCIL_MODES:()=>He,SVGParser:()=>eg,SaturationBlend:()=>Zh,SchedulerSystem:()=>sa,ScissorMask:()=>bb,SdfShader:()=>ju,Shader:()=>rt,ShaderStage:()=>$s,ShapePath:()=>Wu,SharedRenderPipes:()=>ll,SharedSystems:()=>ul,SoftLightBlend:()=>Qh,Sprite:()=>Ge,SpritePipe:()=>qo,Spritesheet:()=>jc,State:()=>Qe,StencilMask:()=>co,StencilMaskPipe:()=>ea,SubtractBlend:()=>Jh,SystemRunner:()=>bn,TEXTURE_FORMAT_BLOCK_SIZE:()=>G_,Text:()=>$r,TextStyle:()=>Mt,Texture:()=>exports.Texture,TextureGCSystem:()=>ax,TextureMatrix:()=>ks,TexturePool:()=>Me,TexturePoolClass:()=>Lc,TextureSource:()=>ge,TextureStyle:()=>xt,TextureUvs:()=>yb,Ticker:()=>Ie,TickerListener:()=>Fs,TickerPlugin:()=>no,TilingSprite:()=>xb,TilingSpriteGpuData:()=>Bh,TilingSpritePipe:()=>Fo,TilingSpriteShader:()=>Qu,Transform:()=>rc,Triangle:()=>pb,UNIFORM_TO_ARRAY_SETTERS:()=>Zx,UNIFORM_TO_SINGLE_SETTERS:()=>Kx,UNIFORM_TYPES_MAP:()=>hm,UNIFORM_TYPES_VALUES:()=>sh,UPDATE_BLEND:()=>cu,UPDATE_COLOR:()=>ro,UPDATE_PRIORITY:()=>exports.UPDATE_PRIORITY,UPDATE_TRANSFORM:()=>fA,UPDATE_VISIBLE:()=>Os,UboBatch:()=>dl,UboSystem:()=>Sn,UniformGroup:()=>xe,VERSION:()=>yn,VideoSource:()=>zs,ViewContainer:()=>lt,ViewSystem:()=>cx,ViewableBuffer:()=>Ur,VividLightBlend:()=>ed,WGSL_ALIGN_SIZE_DATA:()=>da,WGSL_TO_STD40_SIZE:()=>dd,WRAP_MODES:()=>wR,WebGLRenderer:()=>xd,WebGPURenderer:()=>cd,WebWorkerAdapter:()=>YB,WorkerManager:()=>Ed,accessibilityTarget:()=>bp,addBits:()=>eh,addMaskBounds:()=>Hs,addMaskLocalBounds:()=>Vs,addProgramDefines:()=>jp,alphaFrag:()=>tb,alphaWgsl:()=>jd,applyMatrix:()=>Mg,applyProjectiveTransformationToPlane:()=>Tb,applyStyleParams:()=>gd,assignWithIgnore:()=>to,autoDetectEnvironment:()=>Rw,autoDetectRenderer:()=>c_,autoDetectSource:()=>HA,basisTranscoderUrls:()=>Nl,bgr2rgb:()=>es,bitmapFontCachePlugin:()=>h_,bitmapFontTextParser:()=>Pl,bitmapFontXMLParser:()=>bd,bitmapFontXMLStringParser:()=>yd,blendTemplateFrag:()=>Fg,blendTemplateVert:()=>Gg,blendTemplateWgsl:()=>Ug,blockDataMap:()=>ld,blurTemplateWgsl:()=>ob,boundsPool:()=>ir,browserExt:()=>YT,buildAdaptiveBezier:()=>Vu,buildAdaptiveQuadratic:()=>Wm,buildArc:()=>zu,buildArcTo:()=>Ym,buildArcToSvg:()=>jm,buildCircle:()=>tn,buildContextBatches:()=>Dm,buildEllipse:()=>xm,buildLine:()=>Tm,buildPixelLine:()=>Sm,buildPolygon:()=>Bm,buildRectangle:()=>Rm,buildRoundedRectangle:()=>_m,buildSimpleUvs:()=>mm,buildTriangle:()=>Mm,buildUvs:()=>pm,cacheAsTextureMixin:()=>jf,cacheTextureArray:()=>f_,calculateProjection:()=>Sx,checkChildrenDidChange:()=>Fc,checkDataUrl:()=>pr,checkExtension:()=>it,checkMaxIfStatementsInShader:()=>bu,childrenHelperMixin:()=>qf,cleanArray:()=>nx,cleanHash:()=>sx,clearList:()=>jo,closePointEps:()=>bm,collectAllRenderables:()=>GR,collectRenderablesMixin:()=>Kf,color32BitToUniform:()=>Wr,colorBit:()=>Ks,colorBitGl:()=>Zs,colorMatrixFilterFrag:()=>ub,colorMatrixFilterWgsl:()=>qd,colorToUniform:()=>yP,compareModeToGlCompare:()=>o_,compileHighShader:()=>im,compileHighShaderGl:()=>sm,compileHighShaderGlProgram:()=>Nr,compileHighShaderGpuProgram:()=>Lr,compileHooks:()=>th,compileInputs:()=>rh,compileOutputs:()=>rm,compileShader:()=>fd,compute2DProjection:()=>Eb,convertFormatIfRequired:()=>L3,convertToList:()=>Ht,copySearchParams:()=>ao,createIdFromString:()=>ai,createIndicesForQuads:()=>gh,createLevelBuffers:()=>C3,createLevelBuffersFromKTX:()=>H3,createStringVariations:()=>Pp,createTexture:()=>Kt,createUboElementsSTD40:()=>kx,createUboElementsWGSL:()=>fx,createUboSyncFunction:()=>cl,createUboSyncFunctionSTD40:()=>Gx,createUboSyncFunctionWGSL:()=>yx,crossOrigin:()=>DE,cullingMixin:()=>Nf,curveEps:()=>ym,defaultFilterVert:()=>Mn,defaultValue:()=>Sl,definedProps:()=>Rt,deprecation:()=>U,detectAvif:()=>m_,detectBasis:()=>_3,detectCompressed:()=>$3,detectDefaults:()=>g_,detectMp4:()=>x_,detectOgv:()=>__,detectVideoAlphaMode:()=>gu,detectWebm:()=>b_,detectWebp:()=>y_,determineCrossOrigin:()=>OE,displacementFrag:()=>cb,displacementVert:()=>hb,displacementWgsl:()=>Kd,earcut:()=>Pm,effectsMixin:()=>Zf,ensureAttributes:()=>fl,ensureIsBuffer:()=>Jc,ensurePrecision:()=>$p,ensureTextOptions:()=>In,executeInstructions:()=>Xo,extensions:()=>V,extractAttributesFromGlProgram:()=>Wx,extractAttributesFromGpuProgram:()=>Qp,extractFontFamilies:()=>yg,extractStructAndGroups:()=>Eu,extractSvgUrlId:()=>vh,fastCopy:()=>po,findMixin:()=>Qf,fontStringFromTextStyle:()=>hs,formatShader:()=>_R,fragmentGPUTemplate:()=>om,fragmentGlTemplate:()=>um,generateArraySyncSTD40:()=>Fx,generateArraySyncWGSL:()=>bx,generateBlurFragSource:()=>ib,generateBlurGlProgram:()=>nb,generateBlurProgram:()=>ab,generateBlurVertSource:()=>sb,generateGPULayout:()=>pR,generateGpuLayoutGroups:()=>Jp,generateLayout:()=>gR,generateLayoutHash:()=>em,generateParticleUpdateFunction:()=>km,generateProgram:()=>$x,generateShaderSyncCode:()=>Ux,generateTextStyleKey:()=>rg,generateTextureBatchBit:()=>Qs,generateTextureBatchBitGl:()=>Js,generateTextureMatrix:()=>Im,generateUniformsSync:()=>Qx,getAdjustedBlendModeBlend:()=>oi,getAttributeInfoFromFormat:()=>$t,getBatchSamplersUniformGroup:()=>en,getBitmapTextLayout:()=>$u,getCanvasBoundingBox:()=>sg,getCanvasFillStyle:()=>ln,getCanvasTexture:()=>al,getDefaultUniformValue:()=>dm,getFastGlobalBounds:()=>kR,getFastGlobalBoundsMixin:()=>ep,getFontCss:()=>Tg,getFontFamilyName:()=>AE,getGeometryBounds:()=>Wp,getGlTypeFromFormat:()=>Ix,getGlobalBounds:()=>Ei,getGlobalMixin:()=>ip,getGlobalRenderableBounds:()=>Og,getLocalBounds:()=>Ms,getMaxFragmentPrecision:()=>Yp,getMaxTexturesPerBatch:()=>Vp,getOrientationOfPoints:()=>vm,getPo2TextureFromSource:()=>Yu,getResolutionOfUrl:()=>wn,getSVGUrl:()=>Sg,getSupportedCompressedTextureFormats:()=>Gl,getSupportedGPUCompressedTextureFormats:()=>Pd,getSupportedGlCompressedTextureFormats:()=>Ad,getSupportedTextureFormats:()=>Gi,getTemporaryCanvasFromImage:()=>Eg,getTestContext:()=>_u,getTextureBatchBindGroup:()=>Ws,getTextureDefaultMatrix:()=>uM,getTextureFormatFromKTXTexture:()=>z3,getUboData:()=>Xx,getUniformData:()=>Yx,getUrlExtension:()=>Xy,glFormatToGPUFormat:()=>H_,glUploadBufferImageResource:()=>t_,glUploadCompressedTextureResource:()=>r_,glUploadImageResource:()=>Cl,glUploadVideoResource:()=>s_,globalUniformsBit:()=>lm,globalUniformsBitGl:()=>cm,globalUniformsUBOBitGl:()=>tP,gpuFormatToBasisTranscoderFormat:()=>P3,gpuFormatToKTXBasisTranscoderFormat:()=>X3,gpuUploadBufferImageResource:()=>Ax,gpuUploadCompressedTextureResource:()=>Px,gpuUploadImageResource:()=>gl,gpuUploadVideoResource:()=>Bx,groupD8:()=>be,hasCachedCanvasTexture:()=>Ww,hslWgsl:()=>aR,hslgl:()=>xn,hslgpu:()=>_n,injectBits:()=>ih,insertVersion:()=>qp,isMobile:()=>gp,isPow2:()=>Gc,isRenderingToScreen:()=>Ex,isSafari:()=>gg,isSingleItem:()=>ss,isWebGLSupported:()=>ki,isWebGPUSupported:()=>Oi,ktxTranscoderUrls:()=>Vl,loadBasis:()=>S3,loadBasisOnWorker:()=>k_,loadBitmapFont:()=>d_,loadDDS:()=>B3,loadEnvironmentExtensions:()=>td,loadFontAsBase64:()=>vg,loadFontCSS:()=>wh,loadImageBitmap:()=>IE,loadJson:()=>v_,loadKTX:()=>M3,loadKTX2:()=>F3,loadKTX2onWorker:()=>N_,loadSVGImage:()=>Cg,loadSvg:()=>E_,loadTextures:()=>kl,loadTxt:()=>T_,loadVideoTextures:()=>A_,loadWebFont:()=>S_,localUniformBit:()=>ps,localUniformBitGl:()=>mn,localUniformBitGroup2:()=>Pg,localUniformMSDFBit:()=>ug,localUniformMSDFBitGl:()=>lg,log2:()=>nA,logDebugTexture:()=>bM,logProgramError:()=>jx,logRenderGroupScene:()=>K1,logScene:()=>q1,mSDFBit:()=>cg,mSDFBitGl:()=>hg,mapFormatToGlFormat:()=>a_,mapFormatToGlInternalFormat:()=>u_,mapFormatToGlType:()=>l_,mapGlToVertexFormat:()=>Vx,mapSize:()=>SR,mapType:()=>pd,mapWebGLBlendModesToPixi:()=>Jx,maskFrag:()=>Jg,maskVert:()=>ex,maskWgsl:()=>nd,matrixPool:()=>ut,measureHtmlText:()=>Zu,measureMixin:()=>np,migrateFragmentFromV7toV8:()=>vR,mipmapScaleModeToGlFilter:()=>n_,multiplyColors:()=>Rs,multiplyHexColors:()=>au,nextPow2:()=>ti,noiseFrag:()=>fb,noiseWgsl:()=>Zd,nonCompressedFormats:()=>NE,normalizeExtensionPriority:()=>ru,onRenderMixin:()=>op,parseDDS:()=>U_,parseFunctionBody:()=>IR,parseKTX:()=>L_,parseSVGDefinitions:()=>Qm,parseSVGFloatAttribute:()=>Ke,parseSVGPath:()=>Lm,parseSVGStyle:()=>Th,particleData:()=>sf,particlesFrag:()=>Om,particlesVert:()=>Fm,particlesWgsl:()=>xh,path:()=>We,pointInTriangle:()=>Qd,preloadVideo:()=>kE,removeItems:()=>su,removeStructAndGroupDuplicates:()=>tm,resetUids:()=>JC,resolveCharacters:()=>pg,resolveCompressedTextureUrl:()=>j3,resolveJsonUrl:()=>w_,resolveTextureUrl:()=>Ol,resourceToTexture:()=>t0,roundPixelsBit:()=>Hr,roundPixelsBitGl:()=>Vr,roundedShapeArc:()=>$m,roundedShapeQuadraticCurve:()=>qm,sayHello:()=>ix,scaleModeToGlFilter:()=>md,setBasisTranscoderPath:()=>v3,setKTXTranscoderPath:()=>k3,setPositions:()=>Rg,setProgramName:()=>Kp,setUvs:()=>Ig,shapeBuilders:()=>Ru,sortMixin:()=>ap,spritesheetAsset:()=>Bp,squaredDistanceToLineSegment:()=>nn,stripVersion:()=>Zp,styleAttributes:()=>Jm,testImageFormat:()=>Bl,testVideoFormat:()=>An,textStyleToCSS:()=>_g,textureBit:()=>zg,textureBitGl:()=>Wg,textureFrom:()=>r0,tilingBit:()=>wg,tilingBitGl:()=>Bg,toFillStyle:()=>li,toLocalGlobalMixin:()=>up,toStrokeStyle:()=>an,transformVertices:()=>oh,triangulateWithHoles:()=>Bu,uboSyncFunctionsSTD40:()=>ad,uboSyncFunctionsWGSL:()=>xx,uid:()=>ce,uniformParsers:()=>hi,unpremultiplyAlpha:()=>r3,unsafeEvalSupported:()=>el,updateLocalTransform:()=>LR,updateQuadBounds:()=>mu,updateRenderGroupTransform:()=>nS,updateRenderGroupTransforms:()=>id,updateTextBounds:()=>Eo,updateTransformAndChildren:()=>qg,updateTransformBackwards:()=>ou,updateWorldTransform:()=>HR,v8_0_0:()=>Y,v8_3_4:()=>Xf,validFormats:()=>zl,validateRenderables:()=>Kg,vertexGPUTemplate:()=>nm,vertexGlTemplate:()=>am,vkFormatToGPUFormat:()=>V_,warn:()=>N,webworkerExt:()=>jT,wrapModeToGlAddress:()=>Al});var De=f(()=>{sw();ow();B();B();Op();Rp();Ry();My();lw();cw();hw();dw();fw();pw();mw();gw();xw();_w();bw();yw();vw();Tw();Sw();Ew();Cw();Aw();Pw();ww();Bw();c3();Iy();ky();x3();mE();Ai();gE();xE();_E();bE();yE();vE();TE();p_();vd();SE();Er();EE();CE();PE();wE();C_();FE();ms();ME();GE();P_();Ls();Pn();wr();pu();wp();Wy();Xc();gt();b3();E3();A3();w3();HE();VE();zE();R3();WE();I3();jE();YE();G3();N3();V3();W3();ZE();Y3();$E();QE();qE();q3();JE();t1();K3();ny();DA();Vy();Fe();JT();zy();jB();Uy();Sp();yp();Nc();Hy();Vc();vp();Tp();qT();KT();ZT();uR();x1();_1();T1();C1();A1();Yd();P1();w1();B1();R1();M1();dS();fS();pS();at();Ih();Dh();ZB();eR();E1();rb();b1();v1();y1();S1();tR();rR();oR();Ii();Dc();HT();WT();mS();hp();Te();Wf();uu();Nm();ws();cr();I1();kv();Ov();Fv();ct();Gv();lR();D1();G1();fR();N1();p2();Hp();s0();mR();xR();Kc();rS();a0();hS();c0();n0();fm();H0();as();k0();w0();B0();R0();M0();bR();I0();O0();Cu();Au();F0();Oo();us();Xg();$y();xS();qy();_S();cy();yR();Ky();bS();$c();qc();uE();m2();g2();x2();No();b2();T2();v2();E2();C2();A2();P2();I2();w2();M2();D2();k2();O2();nh();dr();F2();W2();j2();TR();G2();Nx();vx();L2();z2();d0();Np();N2();H2();V2();ER();zx();f0();p0();m0();g0();x0();Ox();R2();B2();Y2();X2();K2();$2();Mx();Z2();oE();Q2();J2();i_();eE();rE();UE();iE();sE();nE();tE();i3();aE();LS();NS();qS();HS();VS();zS();WS();XS();$S();KS();ZS();QS();e2();t2();r2();ns();Cr();i2();px();jS();v0();T0();YS();E0();C0();A0();s2();n2();Tx();c2();o2();a2();wx();u2();LE();l2();h2();vS();TS();os();ud();Pi();Gp();CS();PS();PR();Ys();z0();u0();js();l0();W0();lp();wS();JS();ux();Cx();BS();S0();zr();L0();dx();ht();gx();N0();_x();mx();MS();Xs();xu();Pr();tl();hx();Ng();wo();RR();kS();AS();dp();ho();Fl();fo();Ct();kp();ye();FS();fp();ri();ts();MR();lx();I_();Ul();i0();Su();DR();US();Ar();Tv();Sv();Ev();Lt();OR();Kn();Oc();VT();Bs();ay();uy();ly();hy();dy();fy();sp();my();gy();xy();_y();hr();iS();FR();vy();sS();uS();pp();py();$g();UR();Ds();jg();rp();tp();NR();oS();VR();aS();d2();bo();eS();gm();zm();Hv();Xm();Vv();Xv();X0();j0();$0();Q0();J0();ev();aP();_o();_h();ag();Po();fh();pv();Km();Yv();jv();$v();Zm();Dv();Kv();Zv();qv();sv();tg();iv();Y0();wm();YR();JR();z1();H1();V1();eM();Rh();oM();aM();W1();f2();tS();mh();lM();Ga();pn();gv();_v();Pv();Av();wv();dM();vv();mM();Gm();Y1();Cv();bv();yv();k1();kg();_M();LT();BT();IT();F1();GT();OT();DT();kT();FT();Fu();Ns();lS();dg();hE();dE();fE();pE();cE();Ah();U1();pT();hT();fg();dT();gT();L1();xT();xg();bg();PT();yT();ST();ET();CT();vT();TT();AT();Ag();bT();Jd();Rv();og();Ro();Mv();sT();Eh();ng();cT();oT();aT();_b();un();Jv();ig();Um();si();Yy();jy();so();Gs();Dy();Ip();wy();_T();rl();il();Lg();tT();Zg();Ut();IS();$f();Et();Mp();Fp();Qg();Pe();yM();vM();Be();yy();O1();Td();Us();Yf();Si();RS();Z0();V.add(YT,jT);});var IM=Qr((Ub,MM)=>{(function(r,e){typeof Ub=="object"?MM.exports=Ub=e():typeof define=="function"&&define.amd?define([],e):r.CryptoJS=e();})(Ub,function(){var r=r||function(e,t){var i;if(typeof window<"u"&&window.crypto&&(i=window.crypto),typeof self<"u"&&self.crypto&&(i=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(i=globalThis.crypto),!i&&typeof window<"u"&&window.msCrypto&&(i=window.msCrypto),!i&&typeof global<"u"&&global.crypto&&(i=global.crypto),!i&&typeof Kb=="function")try{i=Kb("crypto");}catch{}var s=function(){if(i){if(typeof i.getRandomValues=="function")try{return i.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof i.randomBytes=="function")try{return i.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},n=Object.create||function(){function g(){}return function(y){var S;return g.prototype=y,S=new g,g.prototype=null,S}}(),o={},a=o.lib={},u=a.Base=function(){return {extend:function(g){var y=n(this);return g&&y.mixIn(g),(!y.hasOwnProperty("init")||this.init===y.init)&&(y.init=function(){y.$super.init.apply(this,arguments);}),y.init.prototype=y,y.$super=this,y},create:function(){var g=this.extend();return g.init.apply(g,arguments),g},init:function(){},mixIn:function(g){for(var y in g)g.hasOwnProperty(y)&&(this[y]=g[y]);g.hasOwnProperty("toString")&&(this.toString=g.toString);},clone:function(){return this.init.prototype.extend(this)}}}(),l=a.WordArray=u.extend({init:function(g,y){g=this.words=g||[],y!=t?this.sigBytes=y:this.sigBytes=g.length*4;},toString:function(g){return (g||h).stringify(this)},concat:function(g){var y=this.words,S=g.words,E=this.sigBytes,F=g.sigBytes;if(this.clamp(),E%4)for(var T=0;T<F;T++){var C=S[T>>>2]>>>24-T%4*8&255;y[E+T>>>2]|=C<<24-(E+T)%4*8;}else for(var A=0;A<F;A+=4)y[E+A>>>2]=S[A>>>2];return this.sigBytes+=F,this},clamp:function(){var g=this.words,y=this.sigBytes;g[y>>>2]&=4294967295<<32-y%4*8,g.length=e.ceil(y/4);},clone:function(){var g=u.clone.call(this);return g.words=this.words.slice(0),g},random:function(g){for(var y=[],S=0;S<g;S+=4)y.push(s());return new l.init(y,g)}}),c=o.enc={},h=c.Hex={stringify:function(g){for(var y=g.words,S=g.sigBytes,E=[],F=0;F<S;F++){var T=y[F>>>2]>>>24-F%4*8&255;E.push((T>>>4).toString(16)),E.push((T&15).toString(16));}return E.join("")},parse:function(g){for(var y=g.length,S=[],E=0;E<y;E+=2)S[E>>>3]|=parseInt(g.substr(E,2),16)<<24-E%8*4;return new l.init(S,y/2)}},d=c.Latin1={stringify:function(g){for(var y=g.words,S=g.sigBytes,E=[],F=0;F<S;F++){var T=y[F>>>2]>>>24-F%4*8&255;E.push(String.fromCharCode(T));}return E.join("")},parse:function(g){for(var y=g.length,S=[],E=0;E<y;E++)S[E>>>2]|=(g.charCodeAt(E)&255)<<24-E%4*8;return new l.init(S,y)}},p=c.Utf8={stringify:function(g){try{return decodeURIComponent(escape(d.stringify(g)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(g){return d.parse(unescape(encodeURIComponent(g)))}},m=a.BufferedBlockAlgorithm=u.extend({reset:function(){this._data=new l.init,this._nDataBytes=0;},_append:function(g){typeof g=="string"&&(g=p.parse(g)),this._data.concat(g),this._nDataBytes+=g.sigBytes;},_process:function(g){var y,S=this._data,E=S.words,F=S.sigBytes,T=this.blockSize,C=T*4,A=F/C;g?A=e.ceil(A):A=e.max((A|0)-this._minBufferSize,0);var P=A*T,M=e.min(P*4,F);if(P){for(var k=0;k<P;k+=T)this._doProcessBlock(E,k);y=E.splice(0,P),S.sigBytes-=M;}return new l.init(y,M)},clone:function(){var g=u.clone.call(this);return g._data=this._data.clone(),g},_minBufferSize:0});a.Hasher=m.extend({cfg:u.extend(),init:function(g){this.cfg=this.cfg.extend(g),this.reset();},reset:function(){m.reset.call(this),this._doReset();},update:function(g){return this._append(g),this._process(),this},finalize:function(g){g&&this._append(g);var y=this._doFinalize();return y},blockSize:512/32,_createHelper:function(g){return function(y,S){return new g.init(S).finalize(y)}},_createHmacHelper:function(g){return function(y,S){return new _.HMAC.init(g,S).finalize(y)}}});var _=o.algo={};return o}(Math);return r});});var iC=Qr((Lb,DM)=>{(function(r,e){typeof Lb=="object"?DM.exports=Lb=e(IM()):typeof define=="function"&&define.amd?define(["./core"],e):e(r.CryptoJS);})(Lb,function(r){return function(){var e=r,t=e.lib,i=t.WordArray,s=t.Hasher,n=e.algo,o=[],a=n.SHA1=s.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878,3285377520]);},_doProcessBlock:function(u,l){for(var c=this._hash.words,h=c[0],d=c[1],p=c[2],m=c[3],b=c[4],_=0;_<80;_++){if(_<16)o[_]=u[l+_]|0;else {var g=o[_-3]^o[_-8]^o[_-14]^o[_-16];o[_]=g<<1|g>>>31;}var y=(h<<5|h>>>27)+b+o[_];_<20?y+=(d&p|~d&m)+1518500249:_<40?y+=(d^p^m)+1859775393:_<60?y+=(d&p|d&m|p&m)-1894007588:y+=(d^p^m)-899497514,b=m,m=p,p=d<<30|d>>>2,d=h,h=y;}c[0]=c[0]+h|0,c[1]=c[1]+d|0,c[2]=c[2]+p|0,c[3]=c[3]+m|0,c[4]=c[4]+b|0;},_doFinalize:function(){var u=this._data,l=u.words,c=this._nDataBytes*8,h=u.sigBytes*8;return l[h>>>5]|=128<<24-h%32,l[(h+64>>>9<<4)+14]=Math.floor(c/4294967296),l[(h+64>>>9<<4)+15]=c,u.sigBytes=l.length*4,this._process(),this._hash},clone:function(){var u=s.clone.call(this);return u._hash=this._hash.clone(),u}});e.SHA1=s._createHelper(a),e.HmacSHA1=s._createHmacHelper(a);}(),r.SHA1});});var hI=Qr((CC,cI)=>{(function(r,e){var t=e(r);if(typeof define=="function"&&define.amd)define("DeepDiff",function(){return t});else if(typeof CC=="object"||typeof navigator=="object"&&navigator.product.match(/ReactNative/i))cI.exports=t;else {var i=r.DeepDiff;t.noConflict=function(){return r.DeepDiff===t&&(r.DeepDiff=i),t},r.DeepDiff=t;}})(CC,function(r){var e=["N","E","A","D"];function t(T,C){T.super_=C,T.prototype=Object.create(C.prototype,{constructor:{value:T,enumerable:false,writable:true,configurable:true}});}function i(T,C){Object.defineProperty(this,"kind",{value:T,enumerable:true}),C&&C.length&&Object.defineProperty(this,"path",{value:C,enumerable:true});}function s(T,C,A){s.super_.call(this,"E",T),Object.defineProperty(this,"lhs",{value:C,enumerable:true}),Object.defineProperty(this,"rhs",{value:A,enumerable:true});}t(s,i);function n(T,C){n.super_.call(this,"N",T),Object.defineProperty(this,"rhs",{value:C,enumerable:true});}t(n,i);function o(T,C){o.super_.call(this,"D",T),Object.defineProperty(this,"lhs",{value:C,enumerable:true});}t(o,i);function a(T,C,A){a.super_.call(this,"A",T),Object.defineProperty(this,"index",{value:C,enumerable:true}),Object.defineProperty(this,"item",{value:A,enumerable:true});}t(a,i);function u(T,C,A){var P=T.slice((C)+1||T.length);return T.length=C<0?T.length+C:C,T.push.apply(T,P),T}function l(T){var C=typeof T;return C!=="object"?C:T===Math?"math":T===null?"null":Array.isArray(T)?"array":Object.prototype.toString.call(T)==="[object Date]"?"date":typeof T.toString=="function"&&/^\/.*\//.test(T.toString())?"regexp":"object"}function c(T){var C=0;if(T.length===0)return C;for(var A=0;A<T.length;A++){var P=T.charCodeAt(A);C=(C<<5)-C+P,C=C&C;}return C}function h(T){var C=0,A=l(T);if(A==="array"){T.forEach(function(pe){C+=h(pe);});var P="[type: array, hash: "+C+"]";return C+c(P)}if(A==="object"){for(var M in T)if(T.hasOwnProperty(M)){var k="[ type: object, key: "+M+", value hash: "+h(T[M])+"]";C+=c(k);}return C}var L="[ type: "+A+" ; value: "+T+"]";return C+c(L)}function d(T,C,A,P,M,k,L,pe){A=A||[],M=M||[],L=L||[];var ve=M.slice(0);if(typeof k<"u"&&k!==null){if(P){if(typeof P=="function"&&P(ve,k))return;if(typeof P=="object"){if(P.prefilter&&P.prefilter(ve,k))return;if(P.normalize){var kr=P.normalize(ve,k,T,C);kr&&(T=kr[0],C=kr[1]);}}}ve.push(k);}l(T)==="regexp"&&l(C)==="regexp"&&(T=T.toString(),C=C.toString());var X=typeof T,Q=typeof C,Ye,Re,mt,Zr,As=X!=="undefined"||L&&L.length>0&&L[L.length-1].lhs&&Object.getOwnPropertyDescriptor(L[L.length-1].lhs,k),Ps=Q!=="undefined"||L&&L.length>0&&L[L.length-1].rhs&&Object.getOwnPropertyDescriptor(L[L.length-1].rhs,k);if(!As&&Ps)A.push(new n(ve,C));else if(!Ps&&As)A.push(new o(ve,T));else if(l(T)!==l(C))A.push(new s(ve,T,C));else if(l(T)==="date"&&T-C!==0)A.push(new s(ve,T,C));else if(X==="object"&&T!==null&&C!==null){for(Ye=L.length-1;Ye>-1;--Ye)if(L[Ye].lhs===T){Zr=true;break}if(Zr)T!==C&&A.push(new s(ve,T,C));else {if(L.push({lhs:T,rhs:C}),Array.isArray(T)){for(pe&&(T.sort(function(Ki,eu){return h(Ki)-h(eu)}),C.sort(function(Ki,eu){return h(Ki)-h(eu)})),Ye=C.length-1,Re=T.length-1;Ye>Re;)A.push(new a(ve,Ye,new n(void 0,C[Ye--])));for(;Re>Ye;)A.push(new a(ve,Re,new o(void 0,T[Re--])));for(;Ye>=0;--Ye)d(T[Ye],C[Ye],A,P,ve,Ye,L,pe);}else {var Pc=Object.keys(T),qi=Object.keys(C);for(Ye=0;Ye<Pc.length;++Ye)mt=Pc[Ye],Zr=qi.indexOf(mt),Zr>=0?(d(T[mt],C[mt],A,P,ve,mt,L,pe),qi[Zr]=null):d(T[mt],void 0,A,P,ve,mt,L,pe);for(Ye=0;Ye<qi.length;++Ye)mt=qi[Ye],mt&&d(void 0,C[mt],A,P,ve,mt,L,pe);}L.length=L.length-1;}}else T!==C&&(X==="number"&&isNaN(T)&&isNaN(C)||A.push(new s(ve,T,C)));}function p(T,C,A,P,M){var k=[];if(d(T,C,k,P,null,null,null,M),A)for(var L=0;L<k.length;++L)A(k[L]);return k}function m(T,C,A,P,M,k,L){return d(T,C,A,P,M,k,L,true)}function b(T,C,A,P){var M=P?function(L){L&&P.push(L);}:void 0,k=p(T,C,M,A);return P||(k.length?k:void 0)}function _(T,C,A,P){var M=P?function(L){L&&P.push(L);}:void 0,k=p(T,C,M,A,true);return P||(k.length?k:void 0)}function g(T,C,A){if(A.path&&A.path.length){var P=T[C],M,k=A.path.length-1;for(M=0;M<k;M++)P=P[A.path[M]];switch(A.kind){case "A":g(P[A.path[M]],A.index,A.item);break;case "D":delete P[A.path[M]];break;case "E":case "N":P[A.path[M]]=A.rhs;break}}else switch(A.kind){case "A":g(T[C],A.index,A.item);break;case "D":T=u(T,C);break;case "E":case "N":T[C]=A.rhs;break}return T}function y(T,C,A){if(typeof A>"u"&&C&&~e.indexOf(C.kind)&&(A=C),T&&A&&A.kind){for(var P=T,M=-1,k=A.path?A.path.length-1:0;++M<k;)typeof P[A.path[M]]>"u"&&(P[A.path[M]]=typeof A.path[M+1]<"u"&&typeof A.path[M+1]=="number"?[]:{}),P=P[A.path[M]];switch(A.kind){case "A":A.path&&typeof P[A.path[M]]>"u"&&(P[A.path[M]]=[]),g(A.path?P[A.path[M]]:P,A.index,A.item);break;case "D":delete P[A.path[M]];break;case "E":case "N":P[A.path[M]]=A.rhs;break}}}function S(T,C,A){if(A.path&&A.path.length){var P=T[C],M,k=A.path.length-1;for(M=0;M<k;M++)P=P[A.path[M]];switch(A.kind){case "A":S(P[A.path[M]],A.index,A.item);break;case "D":P[A.path[M]]=A.lhs;break;case "E":P[A.path[M]]=A.lhs;break;case "N":delete P[A.path[M]];break}}else switch(A.kind){case "A":S(T[C],A.index,A.item);break;case "D":T[C]=A.lhs;break;case "E":T[C]=A.lhs;break;case "N":T=u(T,C);break}return T}function E(T,C,A){if(T&&C&&A&&A.kind){var P=T,M,k;for(k=A.path.length-1,M=0;M<k;M++)typeof P[A.path[M]]>"u"&&(P[A.path[M]]={}),P=P[A.path[M]];switch(A.kind){case "A":S(P[A.path[M]],A.index,A.item);break;case "D":P[A.path[M]]=A.lhs;break;case "E":P[A.path[M]]=A.lhs;break;case "N":delete P[A.path[M]];break}}}function F(T,C,A){if(T&&C){var P=function(M){(!A||A(T,C,M))&&y(T,C,M);};p(T,C,P);}}return Object.defineProperties(b,{diff:{value:b,enumerable:true},orderIndependentDiff:{value:_,enumerable:true},observableDiff:{value:p,enumerable:true},orderIndependentObservableDiff:{value:m,enumerable:true},orderIndepHash:{value:h,enumerable:true},applyDiff:{value:F,enumerable:true},applyChange:{value:y,enumerable:true},revertChange:{value:E,enumerable:true},isConflict:{value:function(){return typeof $conflict<"u"},enumerable:true}}),b.DeepDiff=b,r&&(r.DeepDiff=b),b});});De();var SC={};Zi(SC,{CanvasBaseItem:()=>vf,CanvasEvent:()=>yf,CanvasManagerStatic:()=>O,Container:()=>Ln,FadeAlphaTicker:()=>$i,ImageContainer:()=>Ze,ImageSprite:()=>Ue,MoveTicker:()=>vr,RegisteredCanvasComponents:()=>tr,RegisteredEvents:()=>Hi,RegisteredTickers:()=>lr,RotateTicker:()=>Ec,Sprite:()=>ji,Text:()=>Nn,TickerBase:()=>ur,VideoSprite:()=>Jt,ZoomTicker:()=>Ts,addImage:()=>Sf,addImageCointainer:()=>Tf,addVideo:()=>Ef,canvas:()=>I,canvasComponentDecorator:()=>zM,eventDecorator:()=>WM,getTexture:()=>vi,loadImage:()=>ZM,loadVideo:()=>JM,moveIn:()=>iI,moveOut:()=>$b,pushIn:()=>nI,pushOut:()=>TC,removeWithDissolve:()=>Af,removeWithFade:()=>rI,shakeEffect:()=>qM,showImage:()=>QM,showImageContainer:()=>KM,showVideo:()=>eI,showWithDissolve:()=>yC,showWithFade:()=>tI,tickerDecorator:()=>$M,zoomIn:()=>sI,zoomOut:()=>vC});De();var Xe={};Zi(Xe,{DistortionFilter:()=>Bb,EqualizerFilter:()=>qr,Filter:()=>Pt,MonoFilter:()=>Rb,ReverbFilter:()=>Mb,StereoFilter:()=>Ib,StreamFilter:()=>Db,TelephoneFilter:()=>kb});var SM;function EM(r){return SM=r,r}function ke(){return SM}var Pt=class{constructor(e,t){this.init(e,t);}init(e,t){this.destination=e,this.source=t||e;}connect(e){this.source?.connect(e);}disconnect(){this.source?.disconnect();}destroy(){this.disconnect(),this.destination=null,this.source=null;}};var Bb=class extends Pt{constructor(e=0){let t;if(!ke().useLegacy){let{audioContext:i}=ke().context;t=i.createWaveShaper();}super(t),this._distortion=t,this.amount=e;}set amount(e){if(this._amount=e,ke().useLegacy)return;let t=e*1e3,i=44100,s=new Float32Array(i),n=Math.PI/180,o=0,a;for(;o<i;++o)a=o*2/i-1,s[o]=(3+t)*a*20*n/(Math.PI+t*Math.abs(a));this._distortion.curve=s,this._distortion.oversample="4x";}get amount(){return this._amount}destroy(){this._distortion=null,super.destroy();}};var yt=class{static setParamValue(e,t){if(e.setValueAtTime){let i=ke().context;e.setValueAtTime(t,i.audioContext.currentTime);}else e.value=t;return t}};var Oe=class extends Pt{constructor(r=0,e=0,t=0,i=0,s=0,n=0,o=0,a=0,u=0,l=0){let c=[],h=[{f:Oe.F32,type:"lowshelf",gain:r},{f:Oe.F64,type:"peaking",gain:e},{f:Oe.F125,type:"peaking",gain:t},{f:Oe.F250,type:"peaking",gain:i},{f:Oe.F500,type:"peaking",gain:s},{f:Oe.F1K,type:"peaking",gain:n},{f:Oe.F2K,type:"peaking",gain:o},{f:Oe.F4K,type:"peaking",gain:a},{f:Oe.F8K,type:"peaking",gain:u},{f:Oe.F16K,type:"highshelf",gain:l}];ke().useLegacy||(c=h.map(d=>{let p=ke().context.audioContext.createBiquadFilter();return p.type=d.type,yt.setParamValue(p.Q,1),p.frequency.value=d.f,yt.setParamValue(p.gain,d.gain),p})),super(c[0],c[c.length-1]),this.bands=c,this.bandsMap={};for(let d=0;d<this.bands.length;d++){let p=this.bands[d];d>0&&this.bands[d-1].connect(p),this.bandsMap[p.frequency.value]=p;}}setGain(r,e=0){if(!this.bandsMap[r])throw new Error(`No band found for frequency ${r}`);yt.setParamValue(this.bandsMap[r].gain,e);}getGain(r){if(!this.bandsMap[r])throw new Error(`No band found for frequency ${r}`);return this.bandsMap[r].gain.value}set f32(r){this.setGain(Oe.F32,r);}get f32(){return this.getGain(Oe.F32)}set f64(r){this.setGain(Oe.F64,r);}get f64(){return this.getGain(Oe.F64)}set f125(r){this.setGain(Oe.F125,r);}get f125(){return this.getGain(Oe.F125)}set f250(r){this.setGain(Oe.F250,r);}get f250(){return this.getGain(Oe.F250)}set f500(r){this.setGain(Oe.F500,r);}get f500(){return this.getGain(Oe.F500)}set f1k(r){this.setGain(Oe.F1K,r);}get f1k(){return this.getGain(Oe.F1K)}set f2k(r){this.setGain(Oe.F2K,r);}get f2k(){return this.getGain(Oe.F2K)}set f4k(r){this.setGain(Oe.F4K,r);}get f4k(){return this.getGain(Oe.F4K)}set f8k(r){this.setGain(Oe.F8K,r);}get f8k(){return this.getGain(Oe.F8K)}set f16k(r){this.setGain(Oe.F16K,r);}get f16k(){return this.getGain(Oe.F16K)}reset(){this.bands.forEach(r=>{yt.setParamValue(r.gain,0);});}destroy(){this.bands.forEach(r=>{r.disconnect();}),this.bands=null,this.bandsMap=null;}},qr=Oe;qr.F32=32;qr.F64=64;qr.F125=125;qr.F250=250;qr.F500=500;qr.F1K=1e3;qr.F2K=2e3;qr.F4K=4e3;qr.F8K=8e3;qr.F16K=16e3;var Rb=class extends Pt{constructor(){let e,t;if(!ke().useLegacy){let{audioContext:i}=ke().context;t=i.createChannelSplitter(),e=i.createChannelMerger(),e.connect(t);}super(e,t),this._merger=e;}destroy(){this._merger?.disconnect(),this._merger=null,super.destroy();}};var Mb=class extends Pt{constructor(e=3,t=2,i=false){super(null),this._seconds=this._clamp(e,1,50),this._decay=this._clamp(t,0,100),this._reverse=i,this._rebuild();}_clamp(e,t,i){return Math.min(i,Math.max(t,e))}get seconds(){return this._seconds}set seconds(e){this._seconds=this._clamp(e,1,50),this._rebuild();}get decay(){return this._decay}set decay(e){this._decay=this._clamp(e,0,100),this._rebuild();}get reverse(){return this._reverse}set reverse(e){this._reverse=e,this._rebuild();}_rebuild(){if(ke().useLegacy)return;let{audioContext:e}=ke().context,t=e.sampleRate,i=t*this._seconds,s=e.createBuffer(2,i,t),n=s.getChannelData(0),o=s.getChannelData(1),a;for(let l=0;l<i;l++)a=this._reverse?i-l:l,n[l]=(Math.random()*2-1)*Math.pow(1-a/i,this._decay),o[l]=(Math.random()*2-1)*Math.pow(1-a/i,this._decay);let u=e.createConvolver();u.buffer=s,this.init(u);}};var Ib=class extends Pt{constructor(e=0){let t,i,s;if(!ke().useLegacy){let{audioContext:n}=ke().context;n.createStereoPanner?(t=n.createStereoPanner(),s=t):(i=n.createPanner(),i.panningModel="equalpower",s=i);}super(s),this._stereo=t,this._panner=i,this.pan=e;}set pan(e){this._pan=e,this._stereo?yt.setParamValue(this._stereo.pan,e):this._panner&&this._panner.setPosition(e,0,1-Math.abs(e));}get pan(){return this._pan}destroy(){super.destroy(),this._stereo=null,this._panner=null;}};var Db=class extends Pt{constructor(){let e,t;if(!ke().useLegacy){let{audioContext:i}=ke().context;e=i.createMediaStreamDestination(),t=i.createMediaStreamSource(e.stream);}super(e,t),this._stream=e?.stream;}get stream(){return this._stream}destroy(){this._stream=null,super.destroy();}};var kb=class extends Pt{constructor(){let e,t;if(!ke().useLegacy){let{audioContext:i}=ke().context,s=i.createBiquadFilter(),n=i.createBiquadFilter(),o=i.createBiquadFilter(),a=i.createBiquadFilter();s.type="lowpass",yt.setParamValue(s.frequency,2e3),n.type="lowpass",yt.setParamValue(n.frequency,2e3),o.type="highpass",yt.setParamValue(o.frequency,500),a.type="highpass",yt.setParamValue(a.frequency,500),s.connect(n),n.connect(o),o.connect(a),e=s,t=a;}super(e,t);}};De();var nf=class extends _e{constructor(){super(...arguments),this.speed=1,this.muted=false,this.volume=1,this.paused=false;}refresh(){this.emit("refresh");}refreshPaused(){this.emit("refreshPaused");}get filters(){return console.warn("HTML Audio does not support filters"),null}set filters(e){console.warn("HTML Audio does not support filters");}get audioContext(){return console.warn("HTML Audio does not support audioContext"),null}toggleMute(){return this.muted=!this.muted,this.refresh(),this.muted}togglePause(){return this.paused=!this.paused,this.refreshPaused(),this.paused}destroy(){this.removeAllListeners();}};De();var ZF=0,Z1=class extends _e{constructor(r){super(),this.id=ZF++,this.init(r);}set(r,e){if(this[r]===void 0)throw new Error(`Property with name ${r} does not exist.`);switch(r){case "speed":this.speed=e;break;case "volume":this.volume=e;break;case "paused":this.paused=e;break;case "loop":this.loop=e;break;case "muted":this.muted=e;break}return this}get progress(){let{currentTime:r}=this._source;return r/this._duration}get paused(){return this._paused}set paused(r){this._paused=r,this.refreshPaused();}_onPlay(){this._playing=true;}_onPause(){this._playing=false;}init(r){this._playing=false,this._duration=r.source.duration;let e=this._source=r.source.cloneNode(false);e.src=r.parent.url,e.onplay=this._onPlay.bind(this),e.onpause=this._onPause.bind(this),r.context.on("refresh",this.refresh,this),r.context.on("refreshPaused",this.refreshPaused,this),this._media=r;}_internalStop(){this._source&&this._playing&&(this._source.onended=null,this._source.pause());}stop(){this._internalStop(),this._source&&this.emit("stop");}get speed(){return this._speed}set speed(r){this._speed=r,this.refresh();}get volume(){return this._volume}set volume(r){this._volume=r,this.refresh();}get loop(){return this._loop}set loop(r){this._loop=r,this.refresh();}get muted(){return this._muted}set muted(r){this._muted=r,this.refresh();}get filters(){return console.warn("HTML Audio does not support filters"),null}set filters(r){console.warn("HTML Audio does not support filters");}refresh(){let r=this._media.context,e=this._media.parent;this._source.loop=this._loop||e.loop;let t=r.volume*(r.muted?0:1),i=e.volume*(e.muted?0:1),s=this._volume*(this._muted?0:1);this._source.volume=s*t*i,this._source.playbackRate=this._speed*r.speed*e.speed;}refreshPaused(){let r=this._media.context,e=this._media.parent,t=this._paused||e.paused||r.paused;t!==this._pausedReal&&(this._pausedReal=t,t?(this._internalStop(),this.emit("paused")):(this.emit("resumed"),this.play({start:this._source.currentTime,end:this._end,volume:this._volume,speed:this._speed,loop:this._loop})),this.emit("pause",t));}play(r){let{start:e,end:t,speed:i,loop:s,volume:n,muted:o}=r;t&&console.assert(t>e,"End time is before start time"),this._speed=i,this._volume=n,this._loop=!!s,this._muted=o,this.refresh(),this.loop&&t!==null&&(console.warn('Looping not support when specifying an "end" time'),this.loop=false),this._start=e,this._end=t||this._duration,this._start=Math.max(0,this._start-Z1.PADDING),this._end=Math.min(this._end+Z1.PADDING,this._duration),this._source.onloadedmetadata=()=>{this._source&&(this._source.currentTime=e,this._source.onloadedmetadata=null,this.emit("progress",e/this._duration,this._duration),Ie.shared.add(this._onUpdate,this));},this._source.onended=this._onComplete.bind(this),this._source.play(),this.emit("start");}_onUpdate(){this.emit("progress",this.progress,this._duration),this._source.currentTime>=this._end&&!this._source.loop&&this._onComplete();}_onComplete(){Ie.shared.remove(this._onUpdate,this),this._internalStop(),this.emit("progress",1,this._duration),this.emit("end",this);}destroy(){Ie.shared.remove(this._onUpdate,this),this.removeAllListeners();let r=this._source;r&&(r.onended=null,r.onplay=null,r.onpause=null,this._internalStop()),this._source=null,this._speed=1,this._volume=1,this._loop=false,this._end=null,this._start=0,this._duration=0,this._playing=false,this._pausedReal=false,this._paused=false,this._muted=false,this._media&&(this._media.context.off("refresh",this.refresh,this),this._media.context.off("refreshPaused",this.refreshPaused,this),this._media=null);}toString(){return `[HTMLAudioInstance id=${this.id}]`}},Ob=Z1;Ob.PADDING=.1;De();var of=class extends _e{init(e){this.parent=e,this._source=e.options.source||new Audio,e.url&&(this._source.src=e.url);}create(){return new Ob(this)}get isPlayable(){return !!this._source&&this._source.readyState===4}get duration(){return this._source.duration}get context(){return this.parent.context}get filters(){return null}set filters(e){console.warn("HTML Audio does not support filters");}destroy(){this.removeAllListeners(),this.parent=null,this._source&&(this._source.src="",this._source.load(),this._source=null);}get source(){return this._source}load(e){let t=this._source,i=this.parent;if(t.readyState===4){i.isLoaded=true;let u=i.autoPlayStart();e&&setTimeout(()=>{e(null,i,u);},0);return}if(!i.url){e(new Error("sound.url or sound.source must be set"));return}t.src=i.url;let s=()=>{a(),i.isLoaded=true;let u=i.autoPlayStart();e&&e(null,i,u);},n=()=>{a(),e&&e(new Error("Sound loading has been aborted"));},o=()=>{a();let u=`Failed to load audio element (code: ${t.error.code})`;e?e(new Error(u)):console.error(u);},a=()=>{t.removeEventListener("canplaythrough",s),t.removeEventListener("load",s),t.removeEventListener("abort",n),t.removeEventListener("error",o);};t.addEventListener("canplaythrough",s,false),t.addEventListener("load",s,false),t.addEventListener("abort",n,false),t.addEventListener("error",o,false),t.load();}};De();var af=class{constructor(e,t){this.parent=e,Object.assign(this,t),this.duration=this.end-this.start,console.assert(this.duration>0,"End time must be after start time");}play(e){return this.parent.play({complete:e,speed:this.speed||this.parent.speed,end:this.end,start:this.start,loop:this.loop})}destroy(){this.parent=null;}};var Ua=["ogg","oga","opus","m4a","mp3","mpeg","wav","aiff","wma","mid","caf"],Q1=["audio/mpeg","audio/ogg"],La={};function CM(r){let e={m4a:"audio/mp4",oga:"audio/ogg",opus:'audio/ogg; codecs="opus"',caf:'audio/x-caf; codecs="opus"',...{}},t=document.createElement("audio"),i={},s=/^no$/;Ua.forEach(n=>{let o=t.canPlayType(`audio/${n}`).replace(s,""),a=e[n]?t.canPlayType(e[n]).replace(s,""):"";i[n]=!!o||!!a;}),Object.assign(La,i);}CM();De();De();var JF=0,uf=class extends _e{constructor(e){super(),this.id=JF++,this._media=null,this._paused=false,this._muted=false,this._elapsed=0,this.init(e);}set(e,t){if(this[e]===void 0)throw new Error(`Property with name ${e} does not exist.`);switch(e){case "speed":this.speed=t;break;case "volume":this.volume=t;break;case "muted":this.muted=t;break;case "loop":this.loop=t;break;case "paused":this.paused=t;break}return this}stop(){this._source&&(this._internalStop(),this.emit("stop"));}get speed(){return this._speed}set speed(e){this._speed=e,this.refresh(),this._update(true);}get volume(){return this._volume}set volume(e){this._volume=e,this.refresh();}get muted(){return this._muted}set muted(e){this._muted=e,this.refresh();}get loop(){return this._loop}set loop(e){this._loop=e,this.refresh();}get filters(){return this._filters}set filters(e){this._filters&&(this._filters?.filter(t=>t).forEach(t=>t.disconnect()),this._filters=null,this._source.connect(this._gain)),this._filters=e?.length?e.slice(0):null,this.refresh();}refresh(){if(!this._source)return;let e=this._media.context,t=this._media.parent;this._source.loop=this._loop||t.loop;let i=e.volume*(e.muted?0:1),s=t.volume*(t.muted?0:1),n=this._volume*(this._muted?0:1);yt.setParamValue(this._gain.gain,n*s*i),yt.setParamValue(this._source.playbackRate,this._speed*t.speed*e.speed),this.applyFilters();}applyFilters(){if(this._filters?.length){this._source.disconnect();let e=this._source;this._filters.forEach(t=>{e.connect(t.destination),e=t;}),e.connect(this._gain);}}refreshPaused(){let e=this._media.context,t=this._media.parent,i=this._paused||t.paused||e.paused;i!==this._pausedReal&&(this._pausedReal=i,i?(this._internalStop(),this.emit("paused")):(this.emit("resumed"),this.play({start:this._elapsed%this._duration,end:this._end,speed:this._speed,loop:this._loop,volume:this._volume})),this.emit("pause",i));}play(e){let{start:t,end:i,speed:s,loop:n,volume:o,muted:a,filters:u}=e;i&&console.assert(i>t,"End time is before start time"),this._paused=false;let{source:l,gain:c}=this._media.nodes.cloneBufferSource();this._source=l,this._gain=c,this._speed=s,this._volume=o,this._loop=!!n,this._muted=a,this._filters=u,this.refresh();let h=this._source.buffer.duration;this._duration=h,this._end=i,this._lastUpdate=this._now(),this._elapsed=t,this._source.onended=this._onComplete.bind(this),this._loop?(this._source.loopEnd=i,this._source.loopStart=t,this._source.start(0,t)):i?this._source.start(0,t,i-t):this._source.start(0,t),this.emit("start"),this._update(true),this.enableTicker(true);}enableTicker(e){Ie.shared.remove(this._updateListener,this),e&&Ie.shared.add(this._updateListener,this);}get progress(){return this._progress}get paused(){return this._paused}set paused(e){this._paused=e,this.refreshPaused();}destroy(){this.removeAllListeners(),this._internalStop(),this._gain&&(this._gain.disconnect(),this._gain=null),this._media&&(this._media.context.events.off("refresh",this.refresh,this),this._media.context.events.off("refreshPaused",this.refreshPaused,this),this._media=null),this._filters?.forEach(e=>e.disconnect()),this._filters=null,this._end=null,this._speed=1,this._volume=1,this._loop=false,this._elapsed=0,this._duration=0,this._paused=false,this._muted=false,this._pausedReal=false;}toString(){return `[WebAudioInstance id=${this.id}]`}_now(){return this._media.context.audioContext.currentTime}_updateListener(){this._update();}_update(e=false){if(this._source){let t=this._now(),i=t-this._lastUpdate;if(i>0||e){let s=this._source.playbackRate.value;this._elapsed+=i*s,this._lastUpdate=t;let n=this._duration,o;if(this._source.loopStart){let a=this._source.loopEnd-this._source.loopStart;o=(this._source.loopStart+this._elapsed%a)/n;}else o=this._elapsed%n/n;this._progress=o,this.emit("progress",this._progress,n);}}}init(e){this._media=e,e.context.events.on("refresh",this.refresh,this),e.context.events.on("refreshPaused",this.refreshPaused,this);}_internalStop(){if(this._source){this.enableTicker(false),this._source.onended=null,this._source.stop(0),this._source.disconnect();try{this._source.buffer=null;}catch(e){console.warn("Failed to set AudioBufferSourceNode.buffer to null:",e);}this._source=null;}}_onComplete(){if(this._source){this.enableTicker(false),this._source.onended=null,this._source.disconnect();try{this._source.buffer=null;}catch(e){console.warn("Failed to set AudioBufferSourceNode.buffer to null:",e);}}this._source=null,this._progress=1,this.emit("progress",1,this._duration),this.emit("end",this);}};var Na=class{constructor(e,t){this._output=t,this._input=e;}get destination(){return this._input}get filters(){return this._filters}set filters(e){if(this._filters&&(this._filters.forEach(t=>{t&&t.disconnect();}),this._filters=null,this._input.connect(this._output)),e&&e.length){this._filters=e.slice(0),this._input.disconnect();let t=null;e.forEach(i=>{t===null?this._input.connect(i.destination):t.connect(i.destination),t=i;}),t.connect(this._output);}}destroy(){this.filters=null,this._input=null,this._output=null;}};var AM=class extends Na{constructor(r){let e=r.audioContext,t=e.createBufferSource(),i=e.createGain(),s=e.createAnalyser();t.connect(s),s.connect(i),i.connect(r.destination),super(s,i),this.context=r,this.bufferSource=t,this.gain=i,this.analyser=s;}get script(){return this._script||(this._script=this.context.audioContext.createScriptProcessor(AM.BUFFER_SIZE),this._script.connect(this.context.destination)),this._script}destroy(){super.destroy(),this.bufferSource.disconnect(),this._script&&this._script.disconnect(),this.gain.disconnect(),this.analyser.disconnect(),this.bufferSource=null,this._script=null,this.gain=null,this.analyser=null,this.context=null;}cloneBufferSource(){let r=this.bufferSource,e=this.context.audioContext.createBufferSource();e.buffer=r.buffer,yt.setParamValue(e.playbackRate,r.playbackRate.value),e.loop=r.loop;let t=this.context.audioContext.createGain();return e.connect(t),t.connect(this.destination),{source:e,gain:t}}get bufferSize(){return this.script.bufferSize}},Fb=AM;Fb.BUFFER_SIZE=0;var Ha=class{init(e){this.parent=e,this._nodes=new Fb(this.context),this._source=this._nodes.bufferSource,this.source=e.options.source;}destroy(){this.parent=null,this._nodes.destroy(),this._nodes=null;try{this._source.buffer=null;}catch(e){console.warn("Failed to set AudioBufferSourceNode.buffer to null:",e);}this._source=null,this.source=null;}create(){return new uf(this)}get context(){return this.parent.context}get isPlayable(){return !!this._source&&!!this._source.buffer}get filters(){return this._nodes.filters}set filters(e){this._nodes.filters=e;}get duration(){return console.assert(this.isPlayable,"Sound not yet playable, no duration"),this._source.buffer.duration}get buffer(){return this._source.buffer}set buffer(e){this._source.buffer=e;}get nodes(){return this._nodes}load(e){this.source?this._decode(this.source,e):this.parent.url?this._loadUrl(e):e?e(new Error("sound.url or sound.source must be set")):console.error("sound.url or sound.source must be set");}async _loadUrl(e){let t=this.parent.url,i=await j.get().fetch(t);this._decode(await i.arrayBuffer(),e);}_decode(e,t){let i=(s,n)=>{if(s)t&&t(s);else {this.parent.isLoaded=true,this.buffer=n;let o=this.parent.autoPlayStart();t&&t(null,this.parent,o);}};e instanceof AudioBuffer?i(null,e):this.parent.context.decode(e,i);}};var uc=class{static from(r){let e={};typeof r=="string"?e.url=r:r instanceof ArrayBuffer||r instanceof AudioBuffer||r instanceof HTMLAudioElement?e.source=r:Array.isArray(r)?e.url=r:e=r,e={autoPlay:false,singleInstance:false,url:null,source:null,preload:false,volume:1,speed:1,complete:null,loaded:null,loop:false,...e},Object.freeze(e);let t=ke().useLegacy?new of:new Ha;return new uc(t,e)}constructor(r,e){this.media=r,this.options=e,this._instances=[],this._sprites={},this.media.init(this);let t=e.complete;this._autoPlayOptions=t?{complete:t}:null,this.isLoaded=false,this._preloadQueue=null,this.isPlaying=false,this.autoPlay=e.autoPlay,this.singleInstance=e.singleInstance,this.preload=e.preload||this.autoPlay,this.url=Array.isArray(e.url)?this.preferUrl(e.url):e.url,this.speed=e.speed,this.volume=e.volume,this.loop=e.loop,e.sprites&&this.addSprites(e.sprites),this.preload&&this._preload(e.loaded);}preferUrl(r){let[e]=r.map(t=>({url:t,ext:We.extname(t).slice(1)})).filter(({ext:t})=>La[t]).sort((t,i)=>Ua.indexOf(t.ext)-Ua.indexOf(i.ext));if(!e)throw new Error("No supported file type found");return e.url}get context(){return ke().context}pause(){return this.isPlaying=false,this.paused=true,this}resume(){return this.isPlaying=this._instances.length>0,this.paused=false,this}get paused(){return this._paused}set paused(r){this._paused=r,this.refreshPaused();}get speed(){return this._speed}set speed(r){this._speed=r,this.refresh();}get filters(){return this.media.filters}set filters(r){this.media.filters=r;}addSprites(r,e){if(typeof r=="object"){let i={};for(let s in r)i[s]=this.addSprites(s,r[s]);return i}console.assert(!this._sprites[r],`Alias ${r} is already taken`);let t=new af(this,e);return this._sprites[r]=t,t}destroy(){this._removeInstances(),this.removeSprites(),this.media.destroy(),this.media=null,this._sprites=null,this._instances=null;}removeSprites(r){if(r){let e=this._sprites[r];e!==void 0&&(e.destroy(),delete this._sprites[r]);}else for(let e in this._sprites)this.removeSprites(e);return this}get isPlayable(){return this.isLoaded&&this.media&&this.media.isPlayable}stop(){if(!this.isPlayable)return this.autoPlay=false,this._autoPlayOptions=null,this;this.isPlaying=false;for(let r=this._instances.length-1;r>=0;r--)this._instances[r].stop();return this}play(r,e){let t;if(typeof r=="string"?t={sprite:r,loop:this.loop,complete:e}:typeof r=="function"?(t={},t.complete=r):t=r,t={complete:null,loaded:null,sprite:null,end:null,start:0,volume:1,speed:1,muted:false,loop:false,...t||{}},t.sprite){let s=t.sprite;console.assert(!!this._sprites[s],`Alias ${s} is not available`);let n=this._sprites[s];t.start=n.start+(t.start||0),t.end=n.end,t.speed=n.speed||1,t.loop=n.loop||t.loop,delete t.sprite;}if(t.offset&&(t.start=t.offset),!this.isLoaded)return this._preloadQueue?new Promise(s=>{this._preloadQueue.push(()=>{s(this.play(t));});}):(this._preloadQueue=[],this.autoPlay=true,this._autoPlayOptions=t,new Promise((s,n)=>{this._preload((o,a,u)=>{this._preloadQueue.forEach(l=>l()),this._preloadQueue=null,o?n(o):(t.loaded&&t.loaded(o,a,u),s(u));});}));(this.singleInstance||t.singleInstance)&&this._removeInstances();let i=this._createInstance();return this._instances.push(i),this.isPlaying=true,i.once("end",()=>{t.complete&&t.complete(this),this._onComplete(i);}),i.once("stop",()=>{this._onComplete(i);}),i.play(t),i}refresh(){let r=this._instances.length;for(let e=0;e<r;e++)this._instances[e].refresh();}refreshPaused(){let r=this._instances.length;for(let e=0;e<r;e++)this._instances[e].refreshPaused();}get volume(){return this._volume}set volume(r){this._volume=r,this.refresh();}get muted(){return this._muted}set muted(r){this._muted=r,this.refresh();}get loop(){return this._loop}set loop(r){this._loop=r,this.refresh();}_preload(r){this.media.load(r);}get instances(){return this._instances}get sprites(){return this._sprites}get duration(){return this.media.duration}autoPlayStart(){let r;return this.autoPlay&&(r=this.play(this._autoPlayOptions)),r}_removeInstances(){for(let r=this._instances.length-1;r>=0;r--)this._poolInstance(this._instances[r]);this._instances.length=0;}_onComplete(r){if(this._instances){let e=this._instances.indexOf(r);e>-1&&this._instances.splice(e,1),this.isPlaying=this._instances.length>0;}this._poolInstance(r);}_createInstance(){if(uc._pool.length>0){let r=uc._pool.pop();return r.init(this.media),r}return this.media.create()}_poolInstance(r){r.destroy(),uc._pool.indexOf(r)<0&&uc._pool.push(r);}},Br=uc;Br._pool=[];De();var lc=class r extends Na{constructor(){let e=window,t=new r.AudioContext,i=t.createDynamicsCompressor(),s=t.createAnalyser();s.connect(i),i.connect(t.destination),super(s,i),this.autoPause=true,this._ctx=t,this._offlineCtx=new r.OfflineAudioContext(1,2,e.OfflineAudioContext?Math.max(8e3,Math.min(96e3,t.sampleRate)):44100),this.compressor=i,this.analyser=s,this.events=new _e,this.volume=1,this.speed=1,this.muted=false,this.paused=false,this._locked=t.state==="suspended"&&("ontouchstart"in globalThis||"onclick"in globalThis),this._locked&&(this._unlock(),this._unlock=this._unlock.bind(this),document.addEventListener("mousedown",this._unlock,true),document.addEventListener("touchstart",this._unlock,true),document.addEventListener("touchend",this._unlock,true)),this.onFocus=this.onFocus.bind(this),this.onBlur=this.onBlur.bind(this),globalThis.addEventListener("focus",this.onFocus),globalThis.addEventListener("blur",this.onBlur);}onFocus(){if(!this.autoPause)return;let e=this._ctx.state;(e==="suspended"||e==="interrupted"||!this._locked)&&(this.paused=this._pausedOnBlur,this.refreshPaused());}onBlur(){this.autoPause&&(this._locked||(this._pausedOnBlur=this._paused,this.paused=true,this.refreshPaused()));}_unlock(){this._locked&&(this.playEmptySound(),this._ctx.state==="running"&&(document.removeEventListener("mousedown",this._unlock,true),document.removeEventListener("touchend",this._unlock,true),document.removeEventListener("touchstart",this._unlock,true),this._locked=false));}playEmptySound(){let e=this._ctx.createBufferSource();e.buffer=this._ctx.createBuffer(1,1,22050),e.connect(this._ctx.destination),e.start(0,0,0),e.context.state==="suspended"&&e.context.resume();}static get AudioContext(){let e=window;return e.AudioContext||e.webkitAudioContext||null}static get OfflineAudioContext(){let e=window;return e.OfflineAudioContext||e.webkitOfflineAudioContext||null}destroy(){super.destroy();let e=this._ctx;typeof e.close<"u"&&e.close(),globalThis.removeEventListener("focus",this.onFocus),globalThis.removeEventListener("blur",this.onBlur),this.events.removeAllListeners(),this.analyser.disconnect(),this.compressor.disconnect(),this.analyser=null,this.compressor=null,this.events=null,this._offlineCtx=null,this._ctx=null;}get audioContext(){return this._ctx}get offlineContext(){return this._offlineCtx}set paused(e){e&&this._ctx.state==="running"?this._ctx.suspend():!e&&this._ctx.state==="suspended"&&this._ctx.resume(),this._paused=e;}get paused(){return this._paused}refresh(){this.events.emit("refresh");}refreshPaused(){this.events.emit("refreshPaused");}toggleMute(){return this.muted=!this.muted,this.refresh(),this.muted}togglePause(){return this.paused=!this.paused,this.refreshPaused(),this._paused}decode(e,t){let i=n=>{t(new Error(n?.message||"Unable to decode file"));},s=this._offlineCtx.decodeAudioData(e,n=>{t(null,n);},i);s&&s.catch(i);}};var cc=class{constructor(){this.init();}init(){return this.supported&&(this._webAudioContext=new lc),this._htmlAudioContext=new nf,this._sounds={},this.useLegacy=!this.supported,this}get context(){return this._context}get filtersAll(){return this.useLegacy?[]:this._context.filters}set filtersAll(e){this.useLegacy||(this._context.filters=e);}get supported(){return lc.AudioContext!==null}add(e,t){if(typeof e=="object"){let n={};for(let o in e){let a=this._getOptions(e[o],t);n[o]=this.add(o,a);}return n}if(console.assert(!this._sounds[e],`Sound with alias ${e} already exists.`),t instanceof Br)return this._sounds[e]=t,t;let i=this._getOptions(t),s=Br.from(i);return this._sounds[e]=s,s}_getOptions(e,t){let i;return typeof e=="string"?i={url:e}:Array.isArray(e)?i={url:e}:e instanceof ArrayBuffer||e instanceof AudioBuffer||e instanceof HTMLAudioElement?i={source:e}:i=e,i={...i,...t||{}},i}get useLegacy(){return this._useLegacy}set useLegacy(e){this._useLegacy=e,this._context=!e&&this.supported?this._webAudioContext:this._htmlAudioContext;}get disableAutoPause(){return !this._webAudioContext.autoPause}set disableAutoPause(e){this._webAudioContext.autoPause=!e;}remove(e){return this.exists(e,true),this._sounds[e].destroy(),delete this._sounds[e],this}get volumeAll(){return this._context.volume}set volumeAll(e){this._context.volume=e,this._context.refresh();}get speedAll(){return this._context.speed}set speedAll(e){this._context.speed=e,this._context.refresh();}togglePauseAll(){return this._context.togglePause()}pauseAll(){return this._context.paused=true,this._context.refreshPaused(),this}resumeAll(){return this._context.paused=false,this._context.refreshPaused(),this}toggleMuteAll(){return this._context.toggleMute()}muteAll(){return this._context.muted=true,this._context.refresh(),this}unmuteAll(){return this._context.muted=false,this._context.refresh(),this}removeAll(){for(let e in this._sounds)this._sounds[e].destroy(),delete this._sounds[e];return this}stopAll(){for(let e in this._sounds)this._sounds[e].stop();return this}exists(e,t=false){let i=!!this._sounds[e];return t&&console.assert(i,`No sound matching alias '${e}'.`),i}isPlaying(){for(let e in this._sounds)if(this._sounds[e].isPlaying)return true;return false}find(e){return this.exists(e,true),this._sounds[e]}play(e,t){return this.find(e).play(t)}stop(e){return this.find(e).stop()}pause(e){return this.find(e).pause()}resume(e){return this.find(e).resume()}volume(e,t){let i=this.find(e);return t!==void 0&&(i.volume=t),i.volume}speed(e,t){let i=this.find(e);return t!==void 0&&(i.speed=t),i.speed}duration(e){return this.find(e).duration}close(){return this.removeAll(),this._sounds=null,this._webAudioContext&&(this._webAudioContext.destroy(),this._webAudioContext=null),this._htmlAudioContext&&(this._htmlAudioContext.destroy(),this._htmlAudioContext=null),this._context=null,this}};De();De();var PM=r=>{let e=r.src,t=r?.alias?.[0];return (!t||r.src===t)&&(t=We.basename(e,We.extname(e))),t},wM={extension:x.Asset,detection:{test:async()=>true,add:async r=>[...r,...Ua.filter(e=>La[e])],remove:async r=>r.filter(e=>r.includes(e))},loader:{name:"sound",extension:{type:[x.LoadParser],priority:ze.High},test(r){let e=We.extname(r).slice(1);return !!La[e]||Q1.some(t=>r.startsWith(`data:${t}`))},async load(r,e){let t=await new Promise((i,s)=>Br.from({...e.data,url:r,preload:true,loaded(n,o){n?s(n):i(o),e.data?.loaded?.(n,o);}}));return ke().add(PM(e),t),t},async unload(r,e){ke().remove(PM(e));}}};V.add(wM);var we=EM(new cc);var lf="1.2.20";var Dn="repeat";function J1(r){return {type:"pause",duration:r}}var eC={DistortionFilter:Xe.DistortionFilter,EqualizerFilter:Xe.EqualizerFilter,MonoFilter:Xe.MonoFilter,ReverbFilter:Xe.ReverbFilter,StereoFilter:Xe.StereoFilter,StreamFilter:Xe.StreamFilter,TelephoneFilter:Xe.TelephoneFilter},BM=["webm","mp4","ogv","mov","avi","wmv","flv","mkv","3gp","mpg","mpeg","m4v","f4v","m2v","asf","vob","ts","m2ts","mts","divx","xvid","rm","rmvb","dat","swf","mpv","mxf","vcd","svcd","dvd","dv","3g2","m2p","m2ts","m2v","m4v","mpe","mpg","mpv2","ogm","qt","rm","ts","vob","wmv","xvid","flv","mkv","mov","mp4","webm","avi","ogv","m4v","f4v","m2v","asf","vob","ts","m2ts","mts","divx","xvid","rm","rmvb","dat","swf","mpv","mxf","vcd","svcd","dvd","dv","3g2","m2p","m2ts","m2v","m4v","mpe","mpg","mpv2","ogm","qt","rm","ts","vob","wmv","xvid","flv","mkv","mov","mp4","webm","avi","ogv","m4v","f4v","m2v","asf","vob"],br="__game_layer__",hc="Container",Gb="ImageContainer",tC="Image",dc="Sprite",fc="Text",rC="Video",le={CURRENT_DIALOGUE_MEMORY_KEY:"___current_dialogue_memory___",LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY:"___last_dialogue_added_in_step_memory___",CURRENT_MENU_OPTIONS_MEMORY_KEY:"___current_menu_options_memory___",LAST_MENU_OPTIONS_ADDED_IN_STEP_MEMORY_KEY:"___last_menu_options_added_in_step_memory___",CURRENT_INPUT_VALUE_MEMORY_KEY:"_input_value_",LAST_INPUT_ADDED_IN_STEP_MEMORY_KEY:"___last_input_added_in_step_memory___",CURRENT_INPUT_INFO_MEMORY_KEY:"___current_input_info_memory___",CHARACTER_CATEGORY_KEY:"___character___",ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY:"___glue___",OPENED_LABELS_COUNTER_KEY:"___opened_labels_counter___",ALL_CHOICES_MADE_KEY:"___all_choices_made___",CURRENT_STEP_TIMES_COUNTER_KEY:"___current_step_times_counter___",LAST_STEP_GLUED:"___last_step_glued___"};var w;(s=>(s.log=(n,...o)=>console.log(`[Pixi\u2019VN] ${n}`,...o),s.warn=(n,...o)=>console.warn(`[Pixi\u2019VN] ${n}`,...o),s.error=(n,...o)=>console.error(`[Pixi\u2019VN] ${n}`,...o),s.info=(n,...o)=>console.info(`[Pixi\u2019VN] ${n}`,...o)))(w||(w={}));function fe(r){try{if(typeof r>"u")return r;let e=JSON.stringify(r);return JSON.parse(e)}catch(e){throw w.error("Error creating exportable element",r,e),new Error("[Pixi\u2019VN] Error creating exportable element")}}async function RM(r){var e;let t={importPixi:false,...r};t.app&&(t.renderer=t.app.renderer,t.stage=t.app.stage),t.importPixi&&!t.pixi&&(t.pixi=await Promise.resolve().then(()=>(De(),TM))),window.__PIXI_DEVTOOLS__={...window.__PIXI_DEVTOOLS__||{},app:t.app,stage:t.stage,renderer:t.renderer,extensions:[...((e=window.__PIXI_DEVTOOLS__)==null?void 0:e.extensions)||[],...t.extensions||[]],plugins:{}};}var OM=tu(iC());De();var iG={extension:{type:"sceneProperties",name:"additional-positions"},testNode(r){return r instanceof Ue||r instanceof Jt||r instanceof Ze},testProp(r){switch(r){case "xAlign":case "yAlign":case "xPercentagePosition":case "yPercentagePosition":case "positionType":return true;default:return false}},setProperty(r,e,t){if(r instanceof Ue||r instanceof Jt||r instanceof Ze)switch(e){case "xAlign":r.xAlign=t/100;break;case "yAlign":r.yAlign=t/100;break;case "xPercentagePosition":r.xPercentagePosition=t/100;break;case "yPercentagePosition":r.yPercentagePosition=t/100;break}},getProperties(r){return [{value:r.positionType,prop:"positionType",entry:{section:"Transform",type:"text",label:"Position Type"}},{value:r.xAlign*100,prop:"xAlign",entry:{section:"Transform",type:"range",label:"X Align",tooltip:"0% is left, 100% is right",options:{min:0,max:100}}},{value:r.yAlign*100,prop:"yAlign",entry:{section:"Transform",type:"range",label:"Y Align",tooltip:"0% is top, 100% is bottom",options:{min:0,max:100}}},{value:r.xPercentagePosition*100,prop:"xPercentagePosition",entry:{section:"Transform",type:"range",label:"X Percentage Position",tooltip:"0% is left, 100% is right",options:{min:0,max:100}}},{value:r.yPercentagePosition*100,prop:"yPercentagePosition",entry:{section:"Transform",type:"range",label:"Y Percentage Position",tooltip:"0% is top, 100% is bottom",options:{min:0,max:100}}}]}},kM=iG;function sG(r,e){let t=0;return async(...i)=>{let s=Date.now();if(s-t>=e)return t=s,await r(...i)}}var $=class ${constructor(){}static get app(){if(!$._app)throw new Error("[Pixi\u2019VN] CanvasManagerStatic.app is undefined");return $._app}static get gameLayer(){let e=this.app.stage.getChildByLabel(br);return e||(e=new ue,e.label=br,this.app.stage.addChild(e)),e}static async init(e,t,i,s,n){return $.canvasWidth=t,$.canvasHeight=i,$._app=new _d,$.app.init({resolution:window.devicePixelRatio||1,autoDensity:true,width:t,height:i,...s}).then(()=>{let{app:o=$.app,extensions:a=[],...u}=n||{};RM({app:o,extensions:[kM,...a],...u}),$._isInitialized=true,$.addCanvasIntoHTMLElement(e),window.addEventListener("resize",$.resize),$.resize(),$.gameLayer;})}static addCanvasIntoHTMLElement(e){$._isInitialized?e.appendChild($.app.canvas):w.error("GameWindowManager is not initialized");}static addHtmlLayer(e,t,i={position:"absolute",pointerEvents:"none"}){let s=document.createElement("div");s.setAttribute("id",e),s.style.position=i.position,s.style.pointerEvents=i.pointerEvents;let n=t.appendChild(s);return $.htmlLayers.push(s),$.resize(),n}static removeHtmlLayer(e){let t=$.htmlLayers.find(i=>i.id===e);t&&(t.remove(),$.htmlLayers=$.htmlLayers.filter(i=>i.id!==e));}static getHtmlLayer(e){return $.htmlLayers.find(t=>t.id===e)}static get screenScale(){let e=Math.max(document.documentElement.clientWidth,window.innerWidth||0),t=Math.max(document.documentElement.clientHeight,window.innerHeight||0);return Math.min(e/$.canvasWidth,t/$.canvasHeight)}static get screenWidth(){return Math.floor($.screenScale*$.canvasWidth)}static get screenHeight(){return Math.floor($.screenScale*$.canvasHeight)}static get horizontalMargin(){return (Math.max(document.documentElement.clientWidth,window.innerWidth||0)-$.screenWidth)/2}static get verticalMargin(){return (Math.max(document.documentElement.clientHeight,window.innerHeight||0)-$.screenHeight)/2}static async resize(){await sG(async()=>{if($._isInitialized){let i=$.app.canvas.style;i.width=`${$.screenWidth}px`,i.height=`${$.screenHeight}px`,i.marginLeft=`${$.horizontalMargin}px`,i.marginRight=`${$.horizontalMargin}px`,i.marginTop=`${$.verticalMargin}px`,i.marginBottom=`${$.verticalMargin}px`;}let t=$.htmlLayers.map(i=>{i.style.width=`${$.screenWidth}px`,i.style.height=`${$.screenHeight}px`,i.style.marginLeft=`${$.horizontalMargin}px`,i.style.marginRight=`${$.horizontalMargin}px`,i.style.marginTop=`${$.verticalMargin}px`,i.style.marginBottom=`${$.verticalMargin}px`;});await Promise.all(t);},10)();}static get childrenAliasesOrder(){return $.gameLayer.children.filter(e=>e.label).sort((e,t)=>$.gameLayer.getChildIndex(e)-$.gameLayer.getChildIndex(t)).map(e=>e.label)}static get currentTickersWithoutCreatedBySteps(){return Object.fromEntries(Object.entries($._currentTickers).filter(([e,t])=>!t.createdByTicketSteps))}static generateTickerId(e){try{return (0,OM.default)(JSON.stringify(e)).toString()+"_"+Math.random().toString(36).substring(7)}catch(t){throw new Error(`[Pixi\u2019VN] Error to generate ticker id: ${t}`)}}static addTickerTimeoutInfo(e,t,i,s){typeof e=="string"&&(e=[e]),$._currentTickersTimeouts[i]={aliases:e,ticker:t,canBeDeletedBeforeEnd:s};}static removeTickerTimeoutInfo(e){typeof e!="string"&&(e=e.toString()),$._currentTickersTimeouts[e]&&delete $._currentTickersTimeouts[e];}static removeTickerTimeout(e){typeof e!="string"&&(e=e.toString()),clearTimeout(Number(e)),$.removeTickerTimeoutInfo(e);}static removeTickerTimeoutsByAlias(e,t){Object.entries($._currentTickersTimeouts).forEach(([i,s])=>{let n=s.aliases.filter(o=>o!==e);if(n.length===0){let o=s.canBeDeletedBeforeEnd;(!t||o)&&$.removeTickerTimeout(i);}else $._currentTickersTimeouts[i].aliases=n;});}};R($,"_app"),R($,"htmlLayers",[]),R($,"canvasWidth",300),R($,"canvasHeight",300),R($,"_isInitialized",false),R($,"_currentTickers",{}),R($,"_currentTickersSequence",{}),R($,"_currentTickersTimeouts",{}),R($,"_tickersToCompleteOnStepEnd",{tikersIds:[],stepAlias:[]}),R($,"_tickersOnPause",{});var O=$;De();var pc=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,LM=new Set,sC=typeof process=="object"&&process?process:{},NM=(r,e,t,i)=>{typeof sC.emitWarning=="function"?sC.emitWarning(r,e,t,i):console.error(`[${t}] ${e}: ${r}`);},Vb=globalThis.AbortController,FM=globalThis.AbortSignal;if(typeof Vb>"u"){FM=class{constructor(){R(this,"onabort");R(this,"_onabort",[]);R(this,"reason");R(this,"aborted",false);}addEventListener(i,s){this._onabort.push(s);}},Vb=class{constructor(){R(this,"signal",new FM);e();}abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=true;for(let s of this.signal._onabort)s(i);this.signal.onabort?.(i);}}};let r=sC.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{r&&(r=false,NM("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e));};}var nG=r=>!LM.has(r),kn=r=>r&&r===Math.floor(r)&&r>0&&isFinite(r),HM=r=>kn(r)?r<=Math.pow(2,8)?Uint8Array:r<=Math.pow(2,16)?Uint16Array:r<=Math.pow(2,32)?Uint32Array:r<=Number.MAX_SAFE_INTEGER?mc:null:null,mc=class extends Array{constructor(e){super(e),this.fill(0);}},gc,Va=class Va{constructor(e,t){R(this,"heap");R(this,"length");if(!v(Va,gc))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0;}static create(e){let t=HM(e);if(!t)return [];ee(Va,gc,true);let i=new Va(e,t);return ee(Va,gc,false),i}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}};gc=new WeakMap,Ce(Va,gc,false);var nC=Va,GM,UM,fi,Rr,pi,za,mi,xc,_c,wt,gi,vt,et,de,or,Mr,er,Ft,xi,Gt,_i,bi,Ir,yi,Un,ar,bc,z,oC,Wa,bs,hf,Dr,VM,Xa,yc,df,On,Fn,aC,Nb,Hb,Je,uC,cf,Gn,lC,cC=class cC{constructor(e){Ce(this,z);Ce(this,fi);Ce(this,Rr);Ce(this,pi);Ce(this,za);Ce(this,mi);Ce(this,xc);Ce(this,_c);R(this,"ttl");R(this,"ttlResolution");R(this,"ttlAutopurge");R(this,"updateAgeOnGet");R(this,"updateAgeOnHas");R(this,"allowStale");R(this,"noDisposeOnSet");R(this,"noUpdateTTL");R(this,"maxEntrySize");R(this,"sizeCalculation");R(this,"noDeleteOnFetchRejection");R(this,"noDeleteOnStaleGet");R(this,"allowStaleOnFetchAbort");R(this,"allowStaleOnFetchRejection");R(this,"ignoreFetchAbort");Ce(this,wt);Ce(this,gi);Ce(this,vt);Ce(this,et);Ce(this,de);Ce(this,or);Ce(this,Mr);Ce(this,er);Ce(this,Ft);Ce(this,xi);Ce(this,Gt);Ce(this,_i);Ce(this,bi);Ce(this,Ir);Ce(this,yi);Ce(this,Un);Ce(this,ar);Ce(this,bc);Ce(this,Wa,()=>{});Ce(this,bs,()=>{});Ce(this,hf,()=>{});Ce(this,Dr,()=>false);Ce(this,Xa,e=>{});Ce(this,yc,(e,t,i)=>{});Ce(this,df,(e,t,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});R(this,GM,"LRUCache");let{max:t=0,ttl:i,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:u,dispose:l,onInsert:c,disposeAfter:h,noDisposeOnSet:d,noUpdateTTL:p,maxSize:m=0,maxEntrySize:b=0,sizeCalculation:_,fetchMethod:g,memoMethod:y,noDeleteOnFetchRejection:S,noDeleteOnStaleGet:E,allowStaleOnFetchRejection:F,allowStaleOnFetchAbort:T,ignoreFetchAbort:C}=e;if(t!==0&&!kn(t))throw new TypeError("max option must be a nonnegative integer");let A=t?HM(t):Array;if(!A)throw new Error("invalid max value: "+t);if(ee(this,fi,t),ee(this,Rr,m),this.maxEntrySize=b||v(this,Rr),this.sizeCalculation=_,this.sizeCalculation){if(!v(this,Rr)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(y!==void 0&&typeof y!="function")throw new TypeError("memoMethod must be a function if defined");if(ee(this,_c,y),g!==void 0&&typeof g!="function")throw new TypeError("fetchMethod must be a function if specified");if(ee(this,xc,g),ee(this,Un,!!g),ee(this,vt,new Map),ee(this,et,new Array(t).fill(void 0)),ee(this,de,new Array(t).fill(void 0)),ee(this,or,new A(t)),ee(this,Mr,new A(t)),ee(this,er,0),ee(this,Ft,0),ee(this,xi,nC.create(t)),ee(this,wt,0),ee(this,gi,0),typeof l=="function"&&ee(this,pi,l),typeof c=="function"&&ee(this,za,c),typeof h=="function"?(ee(this,mi,h),ee(this,Gt,[])):(ee(this,mi,void 0),ee(this,Gt,void 0)),ee(this,yi,!!v(this,pi)),ee(this,bc,!!v(this,za)),ee(this,ar,!!v(this,mi)),this.noDisposeOnSet=!!d,this.noUpdateTTL=!!p,this.noDeleteOnFetchRejection=!!S,this.allowStaleOnFetchRejection=!!F,this.allowStaleOnFetchAbort=!!T,this.ignoreFetchAbort=!!C,this.maxEntrySize!==0){if(v(this,Rr)!==0&&!kn(v(this,Rr)))throw new TypeError("maxSize must be a positive integer if specified");if(!kn(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");q(this,z,VM).call(this);}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!E,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=kn(s)||s===0?s:1,this.ttlAutopurge=!!n,this.ttl=i||0,this.ttl){if(!kn(this.ttl))throw new TypeError("ttl must be a positive integer if specified");q(this,z,oC).call(this);}if(v(this,fi)===0&&this.ttl===0&&v(this,Rr)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!v(this,fi)&&!v(this,Rr)){let P="LRU_CACHE_UNBOUNDED";nG(P)&&(LM.add(P),NM("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",P,cC));}}static unsafeExposeInternals(e){return {starts:v(e,bi),ttls:v(e,Ir),sizes:v(e,_i),keyMap:v(e,vt),keyList:v(e,et),valList:v(e,de),next:v(e,or),prev:v(e,Mr),get head(){return v(e,er)},get tail(){return v(e,Ft)},free:v(e,xi),isBackgroundFetch:t=>{var i;return q(i=e,z,Je).call(i,t)},backgroundFetch:(t,i,s,n)=>{var o;return q(o=e,z,Hb).call(o,t,i,s,n)},moveToTail:t=>{var i;return q(i=e,z,cf).call(i,t)},indexes:t=>{var i;return q(i=e,z,On).call(i,t)},rindexes:t=>{var i;return q(i=e,z,Fn).call(i,t)},isStale:t=>{var i;return v(i=e,Dr).call(i,t)}}}get max(){return v(this,fi)}get maxSize(){return v(this,Rr)}get calculatedSize(){return v(this,gi)}get size(){return v(this,wt)}get fetchMethod(){return v(this,xc)}get memoMethod(){return v(this,_c)}get dispose(){return v(this,pi)}get onInsert(){return v(this,za)}get disposeAfter(){return v(this,mi)}getRemainingTTL(e){return v(this,vt).has(e)?1/0:0}*entries(){for(let e of q(this,z,On).call(this))v(this,de)[e]!==void 0&&v(this,et)[e]!==void 0&&!q(this,z,Je).call(this,v(this,de)[e])&&(yield [v(this,et)[e],v(this,de)[e]]);}*rentries(){for(let e of q(this,z,Fn).call(this))v(this,de)[e]!==void 0&&v(this,et)[e]!==void 0&&!q(this,z,Je).call(this,v(this,de)[e])&&(yield [v(this,et)[e],v(this,de)[e]]);}*keys(){for(let e of q(this,z,On).call(this)){let t=v(this,et)[e];t!==void 0&&!q(this,z,Je).call(this,v(this,de)[e])&&(yield t);}}*rkeys(){for(let e of q(this,z,Fn).call(this)){let t=v(this,et)[e];t!==void 0&&!q(this,z,Je).call(this,v(this,de)[e])&&(yield t);}}*values(){for(let e of q(this,z,On).call(this))v(this,de)[e]!==void 0&&!q(this,z,Je).call(this,v(this,de)[e])&&(yield v(this,de)[e]);}*rvalues(){for(let e of q(this,z,Fn).call(this))v(this,de)[e]!==void 0&&!q(this,z,Je).call(this,v(this,de)[e])&&(yield v(this,de)[e]);}[(UM=Symbol.iterator,GM=Symbol.toStringTag,UM)](){return this.entries()}find(e,t={}){for(let i of q(this,z,On).call(this)){let s=v(this,de)[i],n=q(this,z,Je).call(this,s)?s.__staleWhileFetching:s;if(n!==void 0&&e(n,v(this,et)[i],this))return this.get(v(this,et)[i],t)}}forEach(e,t=this){for(let i of q(this,z,On).call(this)){let s=v(this,de)[i],n=q(this,z,Je).call(this,s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,v(this,et)[i],this);}}rforEach(e,t=this){for(let i of q(this,z,Fn).call(this)){let s=v(this,de)[i],n=q(this,z,Je).call(this,s)?s.__staleWhileFetching:s;n!==void 0&&e.call(t,n,v(this,et)[i],this);}}purgeStale(){let e=false;for(let t of q(this,z,Fn).call(this,{allowStale:true}))v(this,Dr).call(this,t)&&(q(this,z,Gn).call(this,v(this,et)[t],"expire"),e=true);return e}info(e){let t=v(this,vt).get(e);if(t===void 0)return;let i=v(this,de)[t],s=q(this,z,Je).call(this,i)?i.__staleWhileFetching:i;if(s===void 0)return;let n={value:s};if(v(this,Ir)&&v(this,bi)){let o=v(this,Ir)[t],a=v(this,bi)[t];if(o&&a){let u=o-(pc.now()-a);n.ttl=u,n.start=Date.now();}}return v(this,_i)&&(n.size=v(this,_i)[t]),n}dump(){let e=[];for(let t of q(this,z,On).call(this,{allowStale:true})){let i=v(this,et)[t],s=v(this,de)[t],n=q(this,z,Je).call(this,s)?s.__staleWhileFetching:s;if(n===void 0||i===void 0)continue;let o={value:n};if(v(this,Ir)&&v(this,bi)){o.ttl=v(this,Ir)[t];let a=pc.now()-v(this,bi)[t];o.start=Math.floor(Date.now()-a);}v(this,_i)&&(o.size=v(this,_i)[t]),e.unshift([i,o]);}return e}load(e){this.clear();for(let[t,i]of e){if(i.start){let s=Date.now()-i.start;i.start=pc.now()-s;}this.set(t,i.value,i);}}set(e,t,i={}){var d,p,m,b;if(t===void 0)return this.delete(e),this;let{ttl:s=this.ttl,start:n,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:u}=i,{noUpdateTTL:l=this.noUpdateTTL}=i,c=v(this,df).call(this,e,t,i.size||0,a);if(this.maxEntrySize&&c>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=true),q(this,z,Gn).call(this,e,"set"),this;let h=v(this,wt)===0?void 0:v(this,vt).get(e);if(h===void 0)h=v(this,wt)===0?v(this,Ft):v(this,xi).length!==0?v(this,xi).pop():v(this,wt)===v(this,fi)?q(this,z,Nb).call(this,false):v(this,wt),v(this,et)[h]=e,v(this,de)[h]=t,v(this,vt).set(e,h),v(this,or)[v(this,Ft)]=h,v(this,Mr)[h]=v(this,Ft),ee(this,Ft,h),Gf(this,wt)._++,v(this,yc).call(this,h,c,u),u&&(u.set="add"),l=false,v(this,bc)&&((d=v(this,za))==null||d.call(this,t,e,"add"));else {q(this,z,cf).call(this,h);let _=v(this,de)[h];if(t!==_){if(v(this,Un)&&q(this,z,Je).call(this,_)){_.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:g}=_;g!==void 0&&!o&&(v(this,yi)&&((p=v(this,pi))==null||p.call(this,g,e,"set")),v(this,ar)&&v(this,Gt)?.push([g,e,"set"]));}else o||(v(this,yi)&&((m=v(this,pi))==null||m.call(this,_,e,"set")),v(this,ar)&&v(this,Gt)?.push([_,e,"set"]));if(v(this,Xa).call(this,h),v(this,yc).call(this,h,c,u),v(this,de)[h]=t,u){u.set="replace";let g=_&&q(this,z,Je).call(this,_)?_.__staleWhileFetching:_;g!==void 0&&(u.oldValue=g);}}else u&&(u.set="update");v(this,bc)&&this.onInsert?.(t,e,t===_?"update":"replace");}if(s!==0&&!v(this,Ir)&&q(this,z,oC).call(this),v(this,Ir)&&(l||v(this,hf).call(this,h,s,n),u&&v(this,bs).call(this,u,h)),!o&&v(this,ar)&&v(this,Gt)){let _=v(this,Gt),g;for(;g=_?.shift();)(b=v(this,mi))==null||b.call(this,...g);}return this}pop(){var e;try{for(;v(this,wt);){let t=v(this,de)[v(this,er)];if(q(this,z,Nb).call(this,!0),q(this,z,Je).call(this,t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(v(this,ar)&&v(this,Gt)){let t=v(this,Gt),i;for(;i=t?.shift();)(e=v(this,mi))==null||e.call(this,...i);}}}has(e,t={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=t,n=v(this,vt).get(e);if(n!==void 0){let o=v(this,de)[n];if(q(this,z,Je).call(this,o)&&o.__staleWhileFetching===void 0)return false;if(v(this,Dr).call(this,n))s&&(s.has="stale",v(this,bs).call(this,s,n));else return i&&v(this,Wa).call(this,n),s&&(s.has="hit",v(this,bs).call(this,s,n)),true}else s&&(s.has="miss");return false}peek(e,t={}){let{allowStale:i=this.allowStale}=t,s=v(this,vt).get(e);if(s===void 0||!i&&v(this,Dr).call(this,s))return;let n=v(this,de)[s];return q(this,z,Je).call(this,n)?n.__staleWhileFetching:n}async fetch(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:u=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:h=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:p=this.ignoreFetchAbort,allowStaleOnFetchAbort:m=this.allowStaleOnFetchAbort,context:b,forceRefresh:_=false,status:g,signal:y}=t;if(!v(this,Un))return g&&(g.fetch="get"),this.get(e,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:g});let S={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:o,noDisposeOnSet:a,size:u,sizeCalculation:l,noUpdateTTL:c,noDeleteOnFetchRejection:h,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:m,ignoreFetchAbort:p,status:g,signal:y},E=v(this,vt).get(e);if(E===void 0){g&&(g.fetch="miss");let F=q(this,z,Hb).call(this,e,E,S,b);return F.__returned=F}else {let F=v(this,de)[E];if(q(this,z,Je).call(this,F)){let M=i&&F.__staleWhileFetching!==void 0;return g&&(g.fetch="inflight",M&&(g.returnedStale=true)),M?F.__staleWhileFetching:F.__returned=F}let T=v(this,Dr).call(this,E);if(!_&&!T)return g&&(g.fetch="hit"),q(this,z,cf).call(this,E),s&&v(this,Wa).call(this,E),g&&v(this,bs).call(this,g,E),F;let C=q(this,z,Hb).call(this,e,E,S,b),P=C.__staleWhileFetching!==void 0&&i;return g&&(g.fetch=T?"stale":"refresh",P&&T&&(g.returnedStale=true)),P?C.__staleWhileFetching:C.__returned=C}}async forceFetch(e,t={}){let i=await this.fetch(e,t);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(e,t={}){let i=v(this,_c);if(!i)throw new Error("no memoMethod provided to constructor");let{context:s,forceRefresh:n,...o}=t,a=this.get(e,o);if(!n&&a!==void 0)return a;let u=i(e,a,{options:o,context:s});return this.set(e,u,o),u}get(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:o}=t,a=v(this,vt).get(e);if(a!==void 0){let u=v(this,de)[a],l=q(this,z,Je).call(this,u);return o&&v(this,bs).call(this,o,a),v(this,Dr).call(this,a)?(o&&(o.get="stale"),l?(o&&i&&u.__staleWhileFetching!==void 0&&(o.returnedStale=true),i?u.__staleWhileFetching:void 0):(n||q(this,z,Gn).call(this,e,"expire"),o&&i&&(o.returnedStale=true),i?u:void 0)):(o&&(o.get="hit"),l?u.__staleWhileFetching:(q(this,z,cf).call(this,a),s&&v(this,Wa).call(this,a),u))}else o&&(o.get="miss");}delete(e){return q(this,z,Gn).call(this,e,"delete")}clear(){return q(this,z,lC).call(this,"delete")}};fi=new WeakMap,Rr=new WeakMap,pi=new WeakMap,za=new WeakMap,mi=new WeakMap,xc=new WeakMap,_c=new WeakMap,wt=new WeakMap,gi=new WeakMap,vt=new WeakMap,et=new WeakMap,de=new WeakMap,or=new WeakMap,Mr=new WeakMap,er=new WeakMap,Ft=new WeakMap,xi=new WeakMap,Gt=new WeakMap,_i=new WeakMap,bi=new WeakMap,Ir=new WeakMap,yi=new WeakMap,Un=new WeakMap,ar=new WeakMap,bc=new WeakMap,z=new WeakSet,oC=function(){let e=new mc(v(this,fi)),t=new mc(v(this,fi));ee(this,Ir,e),ee(this,bi,t),ee(this,hf,(n,o,a=pc.now())=>{if(t[n]=o!==0?a:0,e[n]=o,o!==0&&this.ttlAutopurge){let u=setTimeout(()=>{v(this,Dr).call(this,n)&&q(this,z,Gn).call(this,v(this,et)[n],"expire");},o+1);u.unref&&u.unref();}}),ee(this,Wa,n=>{t[n]=e[n]!==0?pc.now():0;}),ee(this,bs,(n,o)=>{if(e[o]){let a=e[o],u=t[o];if(!a||!u)return;n.ttl=a,n.start=u,n.now=i||s();let l=n.now-u;n.remainingTTL=a-l;}});let i=0,s=()=>{let n=pc.now();if(this.ttlResolution>0){i=n;let o=setTimeout(()=>i=0,this.ttlResolution);o.unref&&o.unref();}return n};this.getRemainingTTL=n=>{let o=v(this,vt).get(n);if(o===void 0)return 0;let a=e[o],u=t[o];if(!a||!u)return 1/0;let l=(i||s())-u;return a-l},ee(this,Dr,n=>{let o=t[n],a=e[n];return !!a&&!!o&&(i||s())-o>a});},Wa=new WeakMap,bs=new WeakMap,hf=new WeakMap,Dr=new WeakMap,VM=function(){let e=new mc(v(this,fi));ee(this,gi,0),ee(this,_i,e),ee(this,Xa,t=>{ee(this,gi,v(this,gi)-e[t]),e[t]=0;}),ee(this,df,(t,i,s,n)=>{if(q(this,z,Je).call(this,i))return 0;if(!kn(s))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(s=n(i,t),!kn(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return s}),ee(this,yc,(t,i,s)=>{if(e[t]=i,v(this,Rr)){let n=v(this,Rr)-e[t];for(;v(this,gi)>n;)q(this,z,Nb).call(this,true);}ee(this,gi,v(this,gi)+e[t]),s&&(s.entrySize=i,s.totalCalculatedSize=v(this,gi));});},Xa=new WeakMap,yc=new WeakMap,df=new WeakMap,On=function*({allowStale:e=this.allowStale}={}){if(v(this,wt))for(let t=v(this,Ft);!(!q(this,z,aC).call(this,t)||((e||!v(this,Dr).call(this,t))&&(yield t),t===v(this,er)));)t=v(this,Mr)[t];},Fn=function*({allowStale:e=this.allowStale}={}){if(v(this,wt))for(let t=v(this,er);!(!q(this,z,aC).call(this,t)||((e||!v(this,Dr).call(this,t))&&(yield t),t===v(this,Ft)));)t=v(this,or)[t];},aC=function(e){return e!==void 0&&v(this,vt).get(v(this,et)[e])===e},Nb=function(e){var n;let t=v(this,er),i=v(this,et)[t],s=v(this,de)[t];return v(this,Un)&&q(this,z,Je).call(this,s)?s.__abortController.abort(new Error("evicted")):(v(this,yi)||v(this,ar))&&(v(this,yi)&&((n=v(this,pi))==null||n.call(this,s,i,"evict")),v(this,ar)&&v(this,Gt)?.push([s,i,"evict"])),v(this,Xa).call(this,t),e&&(v(this,et)[t]=void 0,v(this,de)[t]=void 0,v(this,xi).push(t)),v(this,wt)===1?(ee(this,er,ee(this,Ft,0)),v(this,xi).length=0):ee(this,er,v(this,or)[t]),v(this,vt).delete(i),Gf(this,wt)._--,t},Hb=function(e,t,i,s){let n=t===void 0?void 0:v(this,de)[t];if(q(this,z,Je).call(this,n))return n;let o=new Vb,{signal:a}=i;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let u={signal:o.signal,options:i,context:s},l=(b,_=false)=>{let{aborted:g}=o.signal,y=i.ignoreFetchAbort&&b!==void 0;if(i.status&&(g&&!_?(i.status.fetchAborted=true,i.status.fetchError=o.signal.reason,y&&(i.status.fetchAbortIgnored=true)):i.status.fetchResolved=true),g&&!y&&!_)return h(o.signal.reason);let S=p;return v(this,de)[t]===p&&(b===void 0?S.__staleWhileFetching?v(this,de)[t]=S.__staleWhileFetching:q(this,z,Gn).call(this,e,"fetch"):(i.status&&(i.status.fetchUpdated=true),this.set(e,b,u.options))),b},c=b=>(i.status&&(i.status.fetchRejected=true,i.status.fetchError=b),h(b)),h=b=>{let{aborted:_}=o.signal,g=_&&i.allowStaleOnFetchAbort,y=g||i.allowStaleOnFetchRejection,S=y||i.noDeleteOnFetchRejection,E=p;if(v(this,de)[t]===p&&(!S||E.__staleWhileFetching===void 0?q(this,z,Gn).call(this,e,"fetch"):g||(v(this,de)[t]=E.__staleWhileFetching)),y)return i.status&&E.__staleWhileFetching!==void 0&&(i.status.returnedStale=true),E.__staleWhileFetching;if(E.__returned===E)throw b},d=(b,_)=>{var y;let g=(y=v(this,xc))==null?void 0:y.call(this,e,n,u);g&&g instanceof Promise&&g.then(S=>b(S===void 0?void 0:S),_),o.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(b(void 0),i.allowStaleOnFetchAbort&&(b=S=>l(S,true)));});};i.status&&(i.status.fetchDispatched=true);let p=new Promise(d).then(l,c),m=Object.assign(p,{__abortController:o,__staleWhileFetching:n,__returned:void 0});return t===void 0?(this.set(e,m,{...u.options,status:void 0}),t=v(this,vt).get(e)):v(this,de)[t]=m,m},Je=function(e){if(!v(this,Un))return false;let t=e;return !!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof Vb},uC=function(e,t){v(this,Mr)[t]=e,v(this,or)[e]=t;},cf=function(e){e!==v(this,Ft)&&(e===v(this,er)?ee(this,er,v(this,or)[e]):q(this,z,uC).call(this,v(this,Mr)[e],v(this,or)[e]),q(this,z,uC).call(this,v(this,Ft),e),ee(this,Ft,e));},Gn=function(e,t){var s,n;let i=false;if(v(this,wt)!==0){let o=v(this,vt).get(e);if(o!==void 0)if(i=true,v(this,wt)===1)q(this,z,lC).call(this,t);else {v(this,Xa).call(this,o);let a=v(this,de)[o];if(q(this,z,Je).call(this,a)?a.__abortController.abort(new Error("deleted")):(v(this,yi)||v(this,ar))&&(v(this,yi)&&((s=v(this,pi))==null||s.call(this,a,e,t)),v(this,ar)&&v(this,Gt)?.push([a,e,t])),v(this,vt).delete(e),v(this,et)[o]=void 0,v(this,de)[o]=void 0,o===v(this,Ft))ee(this,Ft,v(this,Mr)[o]);else if(o===v(this,er))ee(this,er,v(this,or)[o]);else {let u=v(this,Mr)[o];v(this,or)[u]=v(this,or)[o];let l=v(this,or)[o];v(this,Mr)[l]=v(this,Mr)[o];}Gf(this,wt)._--,v(this,xi).push(o);}}if(v(this,ar)&&v(this,Gt)?.length){let o=v(this,Gt),a;for(;a=o?.shift();)(n=v(this,mi))==null||n.call(this,...a);}return i},lC=function(e){var t,i;for(let s of q(this,z,Fn).call(this,{allowStale:true})){let n=v(this,de)[s];if(q(this,z,Je).call(this,n))n.__abortController.abort(new Error("deleted"));else {let o=v(this,et)[s];v(this,yi)&&((t=v(this,pi))==null||t.call(this,n,o,e)),v(this,ar)&&v(this,Gt)?.push([n,o,e]);}}if(v(this,vt).clear(),v(this,de).fill(void 0),v(this,et).fill(void 0),v(this,Ir)&&v(this,bi)&&(v(this,Ir).fill(0),v(this,bi).fill(0)),v(this,_i)&&v(this,_i).fill(0),ee(this,er,0),ee(this,Ft,0),v(this,xi).length=0,ee(this,gi,0),ee(this,wt,0),v(this,ar)&&v(this,Gt)){let s=v(this,Gt),n;for(;n=s?.shift();)(i=v(this,mi))==null||i.call(this,...n);}};var zb=cC;var Tt=class{constructor(e){R(this,"cache");R(this,"map",new Map);this.cache=new zb({max:e.cacheSize}),this.map=new Map;}get[Symbol.iterator](){return this.map[Symbol.iterator]}get[Symbol.toStringTag](){return this.map[Symbol.toStringTag]}clear(){return this.cache.clear(),this.map.clear()}delete(e){let t=this.map.delete(e);return t&&this.cache.delete(e),t}get forEach(){return this.map.forEach}get(e){let t=this.cache.get(e);return t||this.map.get(e)}has(e){return this.map.has(e)}set(e,t){return this.map.set(e,t),this.cache.set(e,t),this}get size(){return this.map.size}entries(){return this.map.entries()}keys(){return this.map.keys()}values(){return this.map.values()}};var ff=new Tt({cacheSize:5});function zM(r){return function(e){Wb.add(e,r);}}var Wb;(s=>{function r(n,o){o||(o=n.name),ff.get(o)&&w.warn(`CanvasElement "${o}" already registered`),n.prototype.pixivnId=o,ff.set(o,n);}s.add=r;function e(n){try{let o=ff.get(n);if(!o){w.error(`CanvasElement "${n}" not found, did you forget to register it with the canvasComponentDecorator?`);return}return new o,o}catch(o){w.error(`Error while getting CanvasElement "${n}"`,o);return}}s.get=e;function t(){return Array.from(ff.values())}s.values=t;function i(n){return ff.has(n)}s.has=i;})(Wb||(Wb={}));var tr=Wb;var vc=new Tt({cacheSize:5});function WM(r){return function(e){Xb.add(e,r);}}var Xb;(n=>{function r(o,a){a||(a=o.name),vc.get(a)&&w.info(`Event "${a}" already exists, it will be overwritten`),o.prototype.id=a,vc.set(a,o);}n.add=r;function e(o){try{let a=vc.get(o);if(!a){w.error(`Event "${o}" not found, did you forget to register it with the eventDecorator?`);return}return new a,a}catch(a){w.error(`Error while getting Event "${o}"`,a);return}}n.get=e;function t(o){try{let a=vc.get(o);if(!a){w.error(`Event "${o}" not found, did you forget to register it with the eventDecorator?`);return}return new a}catch(a){w.error(`Error while getting Event "${o}"`,a);return}}n.getInstance=t;function i(){return Array.from(vc.values())}n.values=i;function s(o){return vc.has(o)}n.has=s;})(Xb||(Xb={}));var Hi=Xb;async function Yb(r){let e=oG(r.pixivnId);if(e)await e.setMemory(r);else throw new Error("[Pixi\u2019VN] The element "+r.pixivnId+" could not be created");return e}function oG(r){try{let e=tr.get(r);return e?new e:void 0}catch(e){w.error(`Error while getting CanvasElement ${r}`,e);return}}De();function hC(r){return "memory"in r?r.memory:r instanceof $r?dC(r):r instanceof Ge?pf(r):Ya(r)}function aG(r){return {width:r.width,height:r.height,isRenderGroup:r.isRenderGroup,blendMode:r.blendMode,tint:r.tint,alpha:r.alpha,angle:r.angle,renderable:r.renderable,rotation:r.rotation,scale:{x:r.scale.x,y:r.scale.y},pivot:{x:r.pivot.x,y:r.pivot.y},position:{x:r.position.x,y:r.position.y},skew:{x:r.skew.x,y:r.skew.y},visible:r.visible,x:r.x,y:r.y,boundsArea:r.boundsArea,cursor:r.cursor,eventMode:r.eventMode,interactive:r.interactive,interactiveChildren:r.interactiveChildren,hitArea:r.hitArea}}function XM(r,e){return {url:r.source.label,alias:e===r.source.label?void 0:e}}function Ya(r,e){let t=uG(r,hc),s=e?.childrenExport||false?r.children.sort((n,o)=>r.getChildIndex(n)-r.getChildIndex(o)).map(n=>hC(n)):[];return {pixivnId:t,elements:s,...aG(r)}}function pf(r){let e=Ya(r),t=e.pixivnId??dc,i=jM(r),s="textureAlias"in r?XM(r.texture,r.textureAlias):XM(r.texture);return {...e,pixivnId:t,textureData:s,anchor:{x:r.anchor.x,y:r.anchor.y},roundPixels:r.roundPixels,onEvents:i}}function dC(r){let e=Ya(r),t=e.pixivnId??fc,i=jM(r);return {...e,pixivnId:t,anchor:{x:r.anchor.x,y:r.anchor.y},text:r.text,resolution:r.resolution,style:lG(r.style),roundPixels:r.roundPixels,onEvents:i}}function uG(r,e){return Object.prototype.hasOwnProperty.call(r,"pixivnId")?r.pixivnId:e}function jM(r){return "onEvents"in r?r.onEvents:{}}function YM(r,e){if(typeof r!="object"||r===null)return r;w.warn(`Unsupported property type for Text.style.${e}: FillGradient or FillPattern.`,r);}function lG(r){return {align:r.align,breakWords:r.breakWords,dropShadow:r.dropShadow,fill:YM(r.stroke,"fill"),fontFamily:r.fontFamily,fontSize:r.fontSize,fontStyle:r.fontStyle,fontVariant:r.fontVariant,fontWeight:r.fontWeight,leading:r.leading,letterSpacing:r.letterSpacing,lineHeight:r.lineHeight,padding:r.padding,stroke:YM(r.stroke,"stroke"),textBaseline:r.textBaseline,trim:r.trim,whiteSpace:r.whiteSpace,wordWrap:r.wordWrap,wordWrapWidth:r.wordWrapWidth}}var Ln=class extends ue{constructor(t){super(t);R(this,"pixivnId",hc);R(this,"_onEvents",{});this.pixivnId=this.constructor.prototype.pixivnId||hc;}get memory(){return Ya(this,{childrenExport:true})}set memory(t){}async setMemory(t){return this.memory=t,await this.importChildren(t),await Vi(this,t)}async importChildren(t){for(let i=0;i<t.elements.length;i++){let s=t.elements[i],n=await Yb(s);this.addChild(n);}}get onEvents(){return this._onEvents}onEvent(t,i){let s=i.prototype.id,n=Hi.getInstance(s);return this._onEvents[t]=s,n?super.on(t,()=>{n.fn(t,this);}):w.error(`Event ${s} not found`),this}on(t,i,s){return super.on(t,i,s)}};tr.add(Ln,hc);async function Vi(r,e,t){let i=t?.ignoreScale||false,s=t?.end;"isRenderGroup"in e&&e.isRenderGroup!==void 0&&(r.isRenderGroup=e.isRenderGroup),"blendMode"in e&&e.blendMode!==void 0&&(r.blendMode=e.blendMode),"tint"in e&&e.tint!==void 0&&(r.tint=e.tint),"alpha"in e&&e.alpha!==void 0&&(r.alpha=e.alpha),"angle"in e&&e.angle!==void 0&&(r.angle=e.angle),"renderable"in e&&e.renderable!==void 0&&(r.renderable=e.renderable),"rotation"in e&&e.rotation!==void 0&&(r.rotation=e.rotation),!i&&"scale"in e&&e.scale!==void 0&&(typeof e.scale=="number"?r.scale.set(e.scale,e.scale):r.scale.set(e.scale.x,e.scale.y)),"pivot"in e&&e.pivot!==void 0&&(typeof e.pivot=="number"?r.pivot.set(e.pivot,e.pivot):r.pivot.set(e.pivot.x,e.pivot.y)),"position"in e&&e.position!==void 0&&r.position.set(e.position.x,e.position.y),"skew"in e&&e.skew!==void 0&&r.skew.set(e.skew.x,e.skew.y),"visible"in e&&e.visible!==void 0&&(r.visible=e.visible),"x"in e&&e.x!==void 0&&(r.x=e.x),"y"in e&&e.y!==void 0&&(r.y=e.y),"boundsArea"in e&&e.boundsArea!==void 0&&(r.boundsArea=e.boundsArea),"cursor"in e&&e.cursor!==void 0&&(r.cursor=e.cursor),"eventMode"in e&&e.eventMode!==void 0&&(r.eventMode=e.eventMode),"interactive"in e&&e.interactive!==void 0&&(r.interactive=e.interactive),"interactiveChildren"in e&&e.interactiveChildren!==void 0&&(r.interactiveChildren=e.interactiveChildren),"hitArea"in e&&e.hitArea!==void 0&&(r.hitArea=e.hitArea),s&&await s(),i||("width"in e&&e.width!==void 0&&(r.width=e.width),"height"in e&&e.height!==void 0&&(r.height=e.height));}De();var mf=class mf{static init(e){mf._getScreen=e.getScreen;}static get screen(){return mf._getScreen()}};R(mf,"_getScreen");var yr=mf;function ys(r,e,t,i,s,n=0){return i=i*(s?-1:1),r==="width"?e*(yr.screen.width-t)+i+n*t+(s?t:0):e*(yr.screen.height-t)+i+n*t+(s?t:0)}function zi(r,e,t,i,s,n=0){return i=i*(s?-1:1),r==="width"?(e-i-n*t-(s?t:0))/(yr.screen.width-t):(e-i-n*t-(s?t:0))/(yr.screen.height-t)}function vs(r,e){return r==="width"?e*yr.screen.width:e*yr.screen.height}function Wi(r,e){return r==="width"?e/yr.screen.width:e/yr.screen.height}function pt(r,e){if(e=e%360,e<0&&(e+=360),e===0)return {x:r.x,y:r.y};if(e===90)return {x:-r.y,y:r.x};if(e===180)return {x:-r.x,y:-r.y};if(e===270)return {x:r.y,y:-r.x};if(e>0&&e<90){let t=e*Math.PI/180,i=Math.cos(t),s=Math.sin(t),n=r.x*i-r.y*s,o=r.x*s+r.y*i;return r.x!==0&&Math.sign(n)!==Math.sign(r.x)&&(n=-n),r.y!==0&&Math.sign(o)!==Math.sign(r.y)&&(o=-o),{x:n,y:o}}else if(e>90&&e<180){let t=(e-90)*Math.PI/180,i=Math.cos(t),s=Math.sin(t),n=-r.y*s-r.x*i,o=r.y*i-r.x*s;return r.x!==0&&Math.sign(n)!==Math.sign(r.x)&&(n=-n),r.y!==0&&Math.sign(o)!==Math.sign(r.y)&&(o=-o),{x:n,y:o}}else if(e>180&&e<270){let t=(e-180)*Math.PI/180,i=Math.cos(t),s=Math.sin(t),n=-r.x*i+r.y*s,o=-r.x*s-r.y*i;return r.x!==0&&Math.sign(n)!==Math.sign(r.x)&&(n=-n),r.y!==0&&Math.sign(o)!==Math.sign(r.y)&&(o=-o),{x:n,y:o}}else if(e>270&&e<360){let t=(e-270)*Math.PI/180,i=Math.cos(t),s=Math.sin(t),n=r.y*s-r.x*i,o=-r.y*i-r.x*s;return r.x!==0&&Math.sign(n)!==Math.sign(r.x)&&(n=-n),r.y!==0&&Math.sign(o)!==Math.sign(r.y)&&(o=-o),{x:n,y:o}}return {x:0,y:0}}function fC(r,e){if(e=e%360,e<0&&(e+=360),e===0)return {x:r.x,y:r.y};if(e===90)return {x:r.y,y:-r.x};if(e===180)return {x:-r.x,y:-r.y};if(e===270)return {x:-r.y,y:r.x};if(e>0&&e<90){let t=e*Math.PI/180,i=Math.cos(t),s=Math.sin(t);return {x:r.x*i+r.y*s,y:-r.x*s+r.y*i}}else if(e>90&&e<180){let t=(e-90)*Math.PI/180,i=Math.cos(t),s=Math.sin(t);return {x:r.y*i-r.x*s,y:-r.y*s-r.x*i}}else if(e>180&&e<270){let t=(e-180)*Math.PI/180,i=Math.cos(t),s=Math.sin(t);return {x:-r.x*i-r.y*s,y:r.x*s-r.y*i}}else if(e>270&&e<360){let t=(e-270)*Math.PI/180,i=Math.cos(t),s=Math.sin(t);return {x:-r.y*i+r.x*s,y:r.y*s+r.x*i}}return {x:0,y:0}}function Xi(r){let e=r.width,t=r.height,i=r.angle%360;return i<0&&(i+=360),i===0||i===180?e:i===90||i===270?t:Math.abs(e*Math.cos(i*Math.PI/180))+Math.abs(t*Math.sin(i*Math.PI/180))}function Yi(r){let e=r.width,t=r.height,i=r.angle%360;return i<0&&(i+=360),i===0||i===180?t:i===90||i===270?e:Math.abs(t*Math.cos(i*Math.PI/180))+Math.abs(e*Math.sin(i*Math.PI/180))}De();var cG=new RegExp(`(${BM.join("|")})$`);function gf(r){let e=exports.Assets.cache.has(r)?exports.Assets.get(r):null;return e instanceof exports.Texture&&(r=e.source?.label||r),cG.test(r)}function ja(r){return r&&(typeof r.align!="number"&&(r.xAlign!=null&&(r.align===void 0?(r.align={x:r.xAlign},delete r.xAlign):(r.align.x=r.xAlign,delete r.xAlign)),r.yAlign!=null&&(r.align===void 0?(r.align={y:r.yAlign},delete r.yAlign):(r.align.y=r.yAlign,delete r.yAlign))),typeof r.percentagePosition!="number"&&(r.xPercentagePosition!=null&&(r.percentagePosition===void 0?(r.percentagePosition={x:r.xPercentagePosition},delete r.xPercentagePosition):(r.percentagePosition.x=r.xPercentagePosition,delete r.xPercentagePosition)),r.yPercentagePosition!=null&&(r.percentagePosition===void 0?(r.percentagePosition={y:r.yPercentagePosition},delete r.yPercentagePosition):(r.percentagePosition.y=r.yPercentagePosition,delete r.yPercentagePosition))),r)}De();De();async function vi(r){if(r!=="EMPTY"){if(!r){w.error("Texture not found",r);return}if(exports.Assets.cache.has(r)){let e=exports.Assets.get(r);if(e)return e}return exports.Assets.load(r).then(e=>{if(!e){w.error("Texture not found",r);return}if(!(e instanceof exports.Texture)){w.error("File not is a file",r);return}return e}).catch(e=>{w.error("Error loading file",e);})}}De();var ji=class r extends Ge{constructor(t){super(t);R(this,"pixivnId",dc);R(this,"_textureAlias");R(this,"_onEvents",{});this.pixivnId=this.constructor.prototype.pixivnId||dc;}get textureAlias(){return this._textureAlias?this._textureAlias:this.texture.source.label}set textureAlias(t){this._textureAlias=t;}get memory(){return pf(this)}set memory(t){}async setMemory(t){return this.memory=t,await xf(this,t)}get onEvents(){return this._onEvents}onEvent(t,i){let s=i.prototype.id,n=Hi.getInstance(s);return this._onEvents[t]=s,n?(super.on(t,()=>{n.fn(t,this);}),this.interactive||(this.interactive=true,this.eventMode="dynamic")):w.error(`Event ${s} not found`),this}on(t,i,s){return super.on(t,i,s)}static from(t,i){let s=Ge.from(t,i),n=new r;return n.texture=s.texture,n}};tr.add(ji,dc);async function xf(r,e,t){let i=t?.ignoreTexture||false;if(await Vi(r,e),!i){if("textureImage"in e&&e.textureImage&&e.textureImage.image){let n=await vi(e.textureImage.image);n&&(r.texture=n);}if("textureData"in e&&(e.textureData.alias&&(r.textureAlias=e.textureData.alias),e.textureData.url!=="EMPTY")){let n=e.textureData.url;e.textureData.alias&&exports.Assets.resolver.hasKey(e.textureData.alias)&&(n=e.textureData.alias);let o=await vi(n);o&&(r.texture=o);}}let s=t?.half;if(s&&await s(),"anchor"in e&&e.anchor!==void 0&&(typeof e.anchor=="number"?r.anchor.set(e.anchor,e.anchor):r.anchor.set(e.anchor.x,e.anchor.y)),"roundPixels"in e&&e.roundPixels!==void 0&&(r.roundPixels=e.roundPixels),"onEvents"in e)for(let n in e.onEvents){let o=e.onEvents[n],a=Hi.get(o);a&&r.onEvent(n,a);}}var Ue=class r extends ji{constructor(t,i){t=ja(t);let s,n;t&&"align"in t&&t?.align!==void 0&&(s=t.align,delete t.align),t&&"percentagePosition"in t&&t?.percentagePosition!==void 0&&(n=t.percentagePosition,delete t.percentagePosition);super(t);R(this,"pixivnId",tC);R(this,"_loadIsStarted",false);R(this,"_align");R(this,"_percentagePosition");i&&(this.textureAlias=i),s&&(this.align=s),n&&(this.percentagePosition=n);}get memory(){return {...pf(this),pixivnId:this.pixivnId,align:this._align,percentagePosition:this._percentagePosition,loadIsStarted:this._loadIsStarted}}set memory(t){}async setMemory(t){this.memory=t,await _f(this,t),this.reloadPosition();}static from(t,i){let s=Ge.from(t,i),n=new r;return n.texture=s.texture,n}get loadIsStarted(){return this._loadIsStarted}async load(){return this._loadIsStarted=true,vi(this.textureAlias).then(t=>{this._loadIsStarted=false,t&&(this.texture=t);}).catch(t=>{this._loadIsStarted=false,w.error("Error into ImageSprite.load()",t);})}set texture(t){super.texture=t,this.reloadPosition();}get texture(){return super.texture}get haveEmptyTexture(){return this.texture._source.label==="EMPTY"}set align(t){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),typeof t=="number"?(this._align.x=t,this._align.y=t):(t.x!==void 0&&(this._align.x=t.x),t.y!==void 0&&(this._align.y=t.y)),this.reloadPosition();}get align(){let t=pt(this.pivot,this.angle),i=pt(this.scale,this.angle);return {x:zi("width",this.x,Xi(this),t.x,i.x<0,this.anchor.x),y:zi("height",this.y,Yi(this),t.y,i.y<0,this.anchor.y)}}set xAlign(t){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),this._align.x=t,this.reloadPosition();}get xAlign(){let t=pt(this.pivot,this.angle),i=pt(this.scale,this.angle);return zi("width",this.x,Xi(this),t.x,i.x<0,this.anchor.x)}set yAlign(t){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),this._align.y=t,this.reloadPosition();}get yAlign(){let t=pt(this.pivot,this.angle),i=pt(this.scale,this.angle);return zi("height",this.y,Yi(this),t.y,i.y<0,this.anchor.y)}set percentagePosition(t){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),typeof t=="number"?(this._percentagePosition.x=t,this._percentagePosition.y=t):(t.x!==void 0&&(this._percentagePosition.x=t.x),t.y!==void 0&&(this._percentagePosition.y=t.y)),this.reloadPosition();}get percentagePosition(){return {x:Wi("width",this.x),y:Wi("height",this.y)}}get xPercentagePosition(){return Wi("width",this.x)}set xPercentagePosition(t){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.x=t,this.reloadPosition();}get yPercentagePosition(){return Wi("height",this.y)}set yPercentagePosition(t){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.y=t,this.reloadPosition();}get positionType(){return this._align?"align":this._percentagePosition?"percentage":"pixel"}get positionInfo(){return this._align?{x:this._align.x||0,y:this._align.y||0,type:"align"}:this._percentagePosition?{x:this._percentagePosition.x||0,y:this._percentagePosition.y||0,type:"percentage"}:{x:this.x,y:this.y,type:"pixel"}}set positionInfo(t){t.type==="align"?this.align={x:t.x,y:t.y}:t.type==="percentage"?this.percentagePosition={x:t.x,y:t.y}:this.position.set(t.x,t.y);}reloadPosition(){if(this._align){let t=pt(this.pivot,this.angle),i=pt(this.scale,this.angle);this._align.x!==void 0&&(super.x=ys("width",this._align.x,Xi(this),t.x,i.x<0,this.anchor.x)),this._align.y!==void 0&&(super.y=ys("height",this._align.y,Yi(this),t.y,i.y<0,this.anchor.y));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=vs("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=vs("height",this._percentagePosition.y)));}get position(){return super.position}set position(t){this._align=void 0,this._percentagePosition=void 0,super.position=t;}get x(){return super.x}set x(t){this._align=void 0,this._percentagePosition=void 0,super.x=t;}get y(){return super.y}set y(t){this._align=void 0,this._percentagePosition=void 0,super.y=t;}};tr.add(Ue,tC);async function _f(r,e,t){let i=t?.ignoreTexture||false;return e=ja(e),await xf(r,e,{half:async()=>{"align"in e&&e.align!==void 0&&(r.align=e.align),"percentagePosition"in e&&e.percentagePosition!==void 0&&(r.percentagePosition=e.percentagePosition),i||"imageLink"in e&&e.imageLink!==void 0&&(r.textureAlias=e.imageLink),"loadIsStarted"in e&&e.loadIsStarted&&await r.load();},ignoreTexture:t?.ignoreTexture})}De();var Jt=class r extends Ue{constructor(t,i){let s,n,o;t&&"loop"in t&&t?.loop!==void 0&&(s=t.loop,delete t.loop),t&&"paused"in t&&t?.paused!==void 0&&(n=t.paused,delete t.paused),t&&"currentTime"in t&&t?.currentTime!==void 0&&(o=t.currentTime,delete t.currentTime);super(t,i);R(this,"pixivnId",rC);R(this,"_looop",false);R(this,"_paused",false);R(this,"_currentTime",0);s&&(this.loop=s),n&&(this.paused=n),o&&(this.currentTime=o);}get memory(){return {...super.memory,pixivnId:this.pixivnId,loop:this.loop,paused:this._paused,currentTime:this.currentTime}}set memory(t){}async setMemory(t){return this.memory=t,await pC(this,t)}static from(t,i){let s=Ge.from(t,i),n=new r;return n.texture=s.texture,n}async load(){await super.load(),this.loop=this._looop,this.currentTime=this._currentTime,this.paused=this._paused;}get loop(){return this.texture?.source?.resource?.loop||false}set loop(t){this._looop=t,this.texture?.source?.resource&&(this.texture.source.resource.loop=t);}get paused(){return this.texture?.source?.resource?.paused||false}set paused(t){t?this.pause():this.play();}pause(){this._paused=true,this.texture?.source?.resource&&this.texture.source.resource.pause();}play(){this._paused=false,this.texture?.source?.resource&&this.texture.source.resource.play();}get currentTime(){return this.texture?.source?.resource?.currentTime||0}set currentTime(t){let i=this.duration;i&&t>=i&&(t=0),this._currentTime=t,this.texture?.source?.resource&&(this.texture.source.resource.currentTime=t);}restart(){this.currentTime=0;}get duration(){if(this.texture?.source?.resource)return this.texture.source.resource.duration||0}};tr.add(Jt,rC);async function pC(r,e,t){await _f(r,e,{ignoreTexture:t?.ignoreTexture}),"loop"in e&&e.loop!==void 0&&(r.loop=e.loop),"currentTime"in e&&e.currentTime!==void 0&&(r.currentTime=e.currentTime),"paused"in e&&e.paused!==void 0&&(r.paused=e.paused);}var Ze=class extends Ln{constructor(t,i=[]){t=ja(t);let s,n,o;t&&"anchor"in t&&t?.anchor!==void 0&&(o=t.anchor,delete t.anchor),t&&"align"in t&&t?.align!==void 0&&(s=t.align,delete t.align),t&&"percentagePosition"in t&&t?.percentagePosition!==void 0&&(n=t.percentagePosition,delete t.percentagePosition);super(t);R(this,"pixivnId",Gb);R(this,"_loadIsStarted",false);R(this,"_anchor");R(this,"_align");R(this,"_percentagePosition");t=ja(t),i&&i.forEach(a=>{let u;gf(a)?u=new Jt(void 0,a):u=new Ue(void 0,a),this.addChild(u);}),o&&(this.anchor=o),s&&(this.align=s),n&&(this.percentagePosition=n);}get memory(){return {...super.memory,pixivnId:Gb,anchor:this._anchor,align:this._align,percentagePosition:this._percentagePosition,loadIsStarted:this._loadIsStarted}}set memory(t){}async setMemory(t){this.memory=t,await this.importChildren(t),await mC(this,t),this.reloadAnchor(),this.reloadPosition();}get loadIsStarted(){return this._loadIsStarted}async load(){this._loadIsStarted=true;let t=Array(this.children.length);for(let i=0;i<this.children.length;i++)t[i]=this.children[i].load();return Promise.all(t).then(()=>{this._loadIsStarted=false,this.reloadAnchor(),this.reloadPosition();}).catch(i=>{this._loadIsStarted=false,w.error("Error into ImageContainer.load()",i);})}get texture(){return this.children.length>0?this.children[0].texture:new exports.Texture}get haveEmptyTexture(){return this.children.some(t=>t.texture._source.label==="EMPTY")}get anchor(){let t=super.pivot.x/this.width,i=super.pivot.y/this.height;return {x:t,y:i}}set anchor(t){typeof t=="number"?this._anchor={x:t,y:t}:this._anchor=t,this.reloadAnchor();}reloadAnchor(){this._anchor&&super.pivot.set(this._anchor.x*this.width,this._anchor.y*this.height);}get pivot(){return super.pivot}set pivot(t){this._anchor=void 0,super.pivot=t;}set align(t){this._percentagePosition=void 0,this._align===void 0&&(this._align={}),typeof t=="number"?(this._align.x=t,this._align.y=t):(t.x!==void 0&&(this._align.x=t.x),t.y!==void 0&&(this._align.y=t.y)),this.reloadPosition();}get align(){let t=pt(this.pivot,this.angle),i=pt(this.scale,this.angle);return {x:zi("width",this.x,Xi(this),t.x,i.x<0,this.anchor.x),y:zi("height",this.y,Yi(this),t.y,i.y<0,this.anchor.y)}}set xAlign(t){this._percentagePosition&&(this._percentagePosition=void 0),this._align===void 0&&(this._align={}),this._align.x=t,this.reloadPosition();}get xAlign(){let t=pt(this.pivot,this.angle),i=pt(this.scale,this.angle);return zi("width",this.x,Xi(this),t.x,i.x<0,this.anchor.x)}set yAlign(t){this._percentagePosition&&(this._percentagePosition=void 0),this._align===void 0&&(this._align={}),this._align.y=t,this.reloadPosition();}get yAlign(){let t=pt(this.pivot,this.angle),i=pt(this.scale,this.angle);return zi("height",this.y,Yi(this),t.y,i.y<0,this.anchor.y)}set percentagePosition(t){this._align=void 0,this._percentagePosition===void 0&&(this._percentagePosition={}),typeof t=="number"?(this._percentagePosition.x=t,this._percentagePosition.y=t):(t.x!==void 0&&(this._percentagePosition.x=t.x),t.y!==void 0&&(this._percentagePosition.y=t.y)),this.reloadPosition();}get percentagePosition(){return {x:Wi("width",this.x),y:Wi("height",this.y)}}set xPercentagePosition(t){this._align&&(this._align=void 0),this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.x=t,this.reloadPosition();}get xPercentagePosition(){return Wi("width",this.x)}set yPercentagePosition(t){this._align&&(this._align=void 0),this._percentagePosition===void 0&&(this._percentagePosition={}),this._percentagePosition.y=t,this.reloadPosition();}get yPercentagePosition(){return Wi("height",this.y)}get positionType(){return this._align?"align":this._percentagePosition?"percentage":"pixel"}get positionInfo(){return this._align?{x:this._align.x||0,y:this._align.y||0,type:"align"}:this._percentagePosition?{x:this._percentagePosition.x||0,y:this._percentagePosition.y||0,type:"percentage"}:{x:this.x,y:this.y,type:"pixel"}}set positionInfo(t){t.type==="align"?this.align={x:t.x,y:t.y}:t.type==="percentage"?this.percentagePosition={x:t.x,y:t.y}:this.position.set(t.x,t.y);}reloadPosition(){if(this._align){let t=pt(this.pivot,this.angle),i=pt(this.scale,this.angle);this._align.x!==void 0&&(super.x=ys("width",this._align.x,Xi(this),t.x,i.x<0)),this._align.y!==void 0&&(super.y=ys("height",this._align.y,Yi(this),t.y,i.y<0));}else this._percentagePosition&&(this._percentagePosition.x!==void 0&&(super.x=vs("width",this._percentagePosition.x)),this._percentagePosition.y!==void 0&&(super.y=vs("height",this._percentagePosition.y)));}get position(){return super.position}set position(t){this._align=void 0,this._percentagePosition=void 0,super.position=t;}get x(){return super.x}set x(t){this._align=void 0,this._percentagePosition=void 0,super.x=t;}get y(){return super.y}set y(t){this._align=void 0,this._percentagePosition=void 0,super.y=t;}};tr.add(Ze,Gb);async function mC(r,e,t){e=ja(e),Vi(r,e,{...t,end:async()=>{"anchor"in e&&e.anchor!==void 0&&(r.anchor=e.anchor),"align"in e&&e.align!==void 0&&(r.align=e.align),"percentagePosition"in e&&e.percentagePosition!==void 0&&(r.percentagePosition=e.percentagePosition),"loadIsStarted"in e&&e.loadIsStarted&&await r.load();}});}De();var Nn=class extends $r{constructor(t){super(t);R(this,"pixivnId",fc);R(this,"_onEvents",{});this.pixivnId=this.constructor.prototype.pixivnId||fc;}get memory(){return dC(this)}set memory(t){}async setMemory(t){return this.memory=t,await gC(this,t)}get onEvents(){return this._onEvents}onEvent(t,i){let s=i.prototype.id,n=Hi.getInstance(s);return this._onEvents[t]=s,n?(super.on(t,()=>{n.fn(t,this);}),this.interactive||(this.interactive=true,this.eventMode="dynamic")):w.error(`Event ${s} not found`),this}on(t,i,s){return super.on(t,i,s)}};tr.add(Nn,fc);async function gC(r,e){if(await Vi(r,e),"anchor"in e&&e.anchor!==void 0&&(typeof e.anchor=="number"?r.anchor.set(e.anchor,e.anchor):r.anchor.set(e.anchor.x,e.anchor.y)),"text"in e&&e.text!==void 0&&(r.text=e.text),"resolution"in e&&e.resolution!==void 0&&(r.resolution=e.resolution),"style"in e&&e.style!==void 0&&(r.style=e.style),"roundPixels"in e&&e.roundPixels!==void 0&&(r.roundPixels=e.roundPixels),"onEvents"in e)for(let t in e.onEvents){let i=e.onEvents[t],s=Hi.get(i);s&&r.onEvent(t,s);}}var ur=class{constructor(e,t,i){R(this,"id","ticker_id_not_set");R(this,"args");R(this,"duration");R(this,"priority");this.args=e,this.duration=t,this.priority=i,this.id=this.constructor.prototype.id;}fn(e,t,i,s){throw new Error("[Pixi\u2019VN] The method TickerBase.fn() must be overridden")}onEndOfTicker(e,t,i){let s="aliasToRemoveAfter"in i&&i.aliasToRemoveAfter||[];typeof s=="string"&&(s=[s]);let n="tickerAliasToResume"in i&&i.tickerAliasToResume||[];typeof n=="string"&&(n=[n]),I.onEndOfTicker(t,{aliasToRemoveAfter:s,tickerAliasToResume:n});}};var Tc=new Tt({cacheSize:5});function $M(r){return function(e){jb.add(e,r);}}var jb;(n=>{function r(o,a){a||(a=o.name),Tc.get(a)&&w.info(`Ticker "${a}" already exists, it will be overwritten`),o.prototype.id=a,Tc.set(a,o);}n.add=r;function e(o){try{let a=Tc.get(o);if(!a){w.error(`Event "${o}" not found, did you forget to register it with the tickerDecorator?`);return}return a}catch(a){w.error(`Error while getting Event "${o}"`,a);return}}n.get=e;function t(o,a,u,l){try{let c=Tc.get(o);if(!c){w.error(`Ticker "${o}" not found, did you forget to register it with the tickerDecorator?`);return}return new c(a,u,l)}catch(c){w.error(`Error while getting Ticker "${o}"`,c);return}}n.getInstance=t;function i(){return Array.from(Tc.values())}n.values=i;function s(o){return Tc.has(o)}n.has=s;})(jb||(jb={}));var lr=jb;var Sc="aliasToRemoveAfter";var bf=class{get app(){return O.app}get gameLayer(){return O.gameLayer}get isInitialized(){return O._isInitialized}get htmlLayout(){return O.htmlLayers[0]}set htmlLayout(e){this.addHtmlLayer("ui",e);}get canvasWidth(){return O.canvasWidth}get canvasHeight(){return O.canvasHeight}set canvasWidth(e){O.canvasWidth=e;}set canvasHeight(e){O.canvasHeight=e;}get screen(){return this.app.screen}async init(e,t,i,s,n){if(typeof t=="number"&&typeof i=="number")return await O.init(e,t,i,s,n);if(typeof t!="number"&&typeof i!="number")return await O.init(e,t.width,t.height,t,i);throw new Error("Invalid parameters")}initializeHTMLLayout(e){this.addHtmlLayer("ui",e);}get children(){return O.gameLayer.children}async copyCanvasElementProperty(e,t){if(typeof t=="string"){let i=this.find(t);if(i)t=i;else {w.error(`Canvas element ${t} not found`);return}}if(typeof e=="string"){let i=this.find(e);if(i)e=i;else {w.error(`Canvas element ${e} not found`);return}}e instanceof ue&&(e=e.memory),"isRenderGroup"in e&&delete e.isRenderGroup,"scale"in e&&delete e.scale,"visible"in e&&delete e.visible,"boundsArea"in e&&delete e.boundsArea,"text"in e&&delete e.text,"resolution"in e&&delete e.resolution,"style"in e&&delete e.style,"height"in e&&delete e.height,"width"in e&&delete e.width,t instanceof Jt?await pC(t,e,{ignoreTexture:true}):t instanceof Ue?await _f(t,e,{ignoreTexture:true}):t instanceof ji?await xf(t,e,{ignoreTexture:true}):t instanceof Nn?await gC(t,e):t instanceof Ze?await mC(t,e):t instanceof ue&&await Vi(t,e);}transferTickers(e,t,i="move"){O._currentTickersSequence[e]&&(i==="move"?O._currentTickersSequence[t]=fe(O._currentTickersSequence[e]):i==="duplicate"&&(O._currentTickersSequence[t]=fe(O._currentTickersSequence[e]))),Object.entries(O._currentTickers).forEach(([s,n])=>{if(n.createdByTicketSteps?.canvasElementAlias===e&&this.removeTicker(s),n.canvasElementAliases.includes(e)&&(i==="move"?n.canvasElementAliases=n.canvasElementAliases.map(o=>o===e?t:o):i==="duplicate"&&n.canvasElementAliases.find(o=>o===e)&&n.canvasElementAliases.push(t),n.args.hasOwnProperty(Sc))){let o=n.args.aliasToRemoveAfter;typeof o=="string"&&(o=[o]),Array.isArray(o)&&(i==="move"?n.args.aliasToRemoveAfter=o.map(a=>a===e?t:a):i==="duplicate"&&o.find(a=>a===e)&&(n.args.aliasToRemoveAfter=[...o,t]));}}),Object.values(O._currentTickersTimeouts).forEach(s=>{s.aliases.includes(e)&&(i==="move"?s.aliases=s.aliases.map(n=>n===e?t:n):i==="duplicate"&&s.aliases.find(n=>n===e)&&s.aliases.push(t));}),O._currentTickersSequence[t]&&Object.keys(O._currentTickersSequence[t]).forEach(s=>{this.runTickersSequence(t,s);}),i==="duplicate"&&O._currentTickersSequence[e]&&Object.keys(O._currentTickersSequence[e]).forEach(s=>{this.runTickersSequence(e,s);});}add(e,t,i={}){if(e===br){w.error(`The alias ${br} is reserved`);return}let s=this.find(e),n=i?.ignoreOldStyle;s&&!n&&this.copyCanvasElementProperty(s,t);let o=i.zIndex;s&&!this.gameLayer.children.includes(s)?w.error(`The canvas element ${e} exist in the memory but it is not on the canvas, so the zIndex is not set`):s&&(o===void 0&&(o=this.gameLayer.getChildIndex(s)),this.remove(e,{ignoreTickers:true})),o!==void 0?(t.label=e,this.gameLayer.addChildAt(t,o)):(t.label=e,this.gameLayer.addChild(t));}remove(e,t={}){if(e===br){w.error(`The alias ${br} is reserved`);return}let i=t.ignoreTickers;typeof e=="string"&&(e=[e]),e.forEach(s=>{this.gameLayer.getChildrenByLabel(s).forEach(n=>{this.gameLayer.removeChild(n),!i&&this.unlinkComponentFromTicker(s);});});}find(e){if(e===br)return this.gameLayer;let t=this.gameLayer.getChildByLabel(e);if(t)return t}canvasElementIsOnCanvas(e){return this.gameLayer.children.includes(e)}removeAll(){this.gameLayer.removeChildren(),this.removeAllTickers();}editAlias(e,t,i={}){let s=this.find(e);s&&(s.label=t),!i.ignoreTickers&&this.transferTickers(e,t,"move");}get currentTickers(){return O._currentTickers}get currentTickersSteps(){return O._currentTickersSequence}addTicker(e,t){let i=t.id;if(typeof e=="string"&&(e=[e]),!lr.getInstance(i,t.args,t.duration,t.priority)){w.error(`Ticker ${i} not found`);return}let s={fn:()=>{},id:i,args:fe(t.args),canvasElementAliases:e,priority:t.priority,duration:t.duration,onEndOfTicker:()=>{}},n=O.generateTickerId(s);if(this.pushTicker(n,s,t),this.pushEndOfTicker(n,s,t),t.duration){let o=setTimeout(()=>{O.removeTickerTimeoutInfo(o),O._currentTickersTimeouts[o.toString()]&&this.onEndOfTicker(n,{aliasToRemoveAfter:Sc in t.args?t.args.aliasToRemoveAfter||[]:[],tickerAliasToResume:"tickerAliasToResume"in t.args?t.args.tickerAliasToResume||[]:[],ignoreTickerSteps:true});},t.duration*1e3);O.addTickerTimeoutInfo(e,i,o.toString(),true);}return n}pushTicker(e,t,i){O._currentTickers[e]=t,t.fn=s=>{let n=O._currentTickers[e];if(n){let o=n.canvasElementAliases;if(t.createdByTicketSteps){if(this.isTickerPaused(t.createdByTicketSteps.canvasElementAlias,t.createdByTicketSteps.id))return}else o=o.filter(a=>!this.isTickerPaused(a,e));i?.fn(s,n.args,o,e);}},this.app.ticker.add(t.fn,void 0,t.priority);}pushEndOfTicker(e,t,i){t.onEndOfTicker=()=>{i.onEndOfTicker(t.canvasElementAliases,e,t.args);};}addTickersSequence(e,t,i=0){if(t.length==0){w.warn("The steps of the tickers is empty");return}e in O._currentTickersSequence||(O._currentTickersSequence[e]={});let s={currentStepNumber:i,steps:t.map(o=>o===Dn||o.hasOwnProperty("type")&&o.type==="pause"?o:{ticker:o.id,args:fe(o.args),duration:o.duration})},n=O.generateTickerId(s);return O._currentTickersSequence[e][n]=s,this.runTickersSequence(e,n),n}runTickersSequence(e,t){if(!O._currentTickersSequence[e]||!O._currentTickersSequence[e][t])return;let i=O._currentTickersSequence[e][t].steps[O._currentTickersSequence[e][t].currentStepNumber];if(i===Dn&&(i=O._currentTickersSequence[e][t].steps[0],O._currentTickersSequence[e][t].currentStepNumber=0,i===Dn)){w.error("TikersSteps has a RepeatType in the first step");return}if(i.hasOwnProperty("type")&&i.type==="pause"){let u=setTimeout(()=>{let l=O._currentTickersTimeouts[u.toString()];l&&l.aliases.forEach(c=>{this.nextTickerStep(c,t);}),O.removeTickerTimeoutInfo(u);},i.duration*1e3);O.addTickerTimeoutInfo(e,"steps",u.toString(),false);return}let s=lr.getInstance(i.ticker,i.args,i.duration,i.priority);if(!s){w.error(`Ticker ${i.ticker} not found`);return}let n=s.id,o={fn:()=>{},id:n,args:fe(s.args),canvasElementAliases:[e],priority:s.priority,duration:s.duration,createdByTicketSteps:{canvasElementAlias:e,id:t},onEndOfTicker:()=>{}},a=O.generateTickerId(o);if(this.pushTicker(a,o,s),s.duration){let u=setTimeout(()=>{let l=O._currentTickersTimeouts[u.toString()];l&&(this.onEndOfTicker(a,{aliasToRemoveAfter:Sc in s.args?s.args.aliasToRemoveAfter||[]:[],tickerAliasToResume:"tickerAliasToResume"in s.args?s.args.tickerAliasToResume||[]:[],ignoreTickerSteps:true}),l.aliases.forEach(c=>{this.nextTickerStep(c,t);})),O.removeTickerTimeoutInfo(u);},s.duration*1e3);O.addTickerTimeoutInfo(e,n,u.toString(),false);}}nextTickerStep(e,t){if(O._currentTickersSequence[e]&&O._currentTickersSequence[e][t]){let i=O._currentTickersSequence[e][t];i.currentStepNumber+1<i.steps.length?(i.currentStepNumber++,O._currentTickersSequence[e][t]=i,this.runTickersSequence(e,t)):t&&O._currentTickersSequence[e]&&O._currentTickersSequence[e][t]&&(delete O._currentTickersSequence[e][t],Object.entries(O._currentTickers).forEach(([s,n])=>{n.createdByTicketSteps?.canvasElementAlias===e&&n.createdByTicketSteps.id===t&&this.removeTicker(s);}));}}onEndOfTicker(e,t){let i=O._currentTickers[e],s=t.ignoreTickerSteps||false;this.remove(t.aliasToRemoveAfter),this.resumeTicker(t.tickerAliasToResume),i&&(this.removeTicker(e),!s&&i.duration==null&&i.createdByTicketSteps&&this.nextTickerStep(i.createdByTicketSteps.canvasElementAlias,i.createdByTicketSteps.id));}unlinkComponentFromTicker(e,t){if(typeof e=="string"&&(e=[e]),!t){e.forEach(s=>{Object.entries(O._currentTickers).forEach(([n,o])=>{o.canvasElementAliases.includes(s)&&(o.canvasElementAliases.length===1?this.removeTicker(n):o.canvasElementAliases=o.canvasElementAliases.filter(a=>a!==s));}),O._currentTickersSequence[s]&&delete O._currentTickersSequence[s],O.removeTickerTimeoutsByAlias(s,false);});return}let i;typeof t=="string"?i=t:t instanceof ur?i=t.id:i=t.prototype.id,e.forEach(s=>{O._currentTickersSequence[s]&&Object.entries(O._currentTickersSequence[s]).forEach(([n,o])=>{o.steps.find(a=>typeof a=="object"&&"ticker"in a&&a.ticker===i)&&delete O._currentTickersSequence[s][n];});}),Object.entries(O._currentTickers).forEach(([s,n])=>{n.id===i&&(O._currentTickers[s].canvasElementAliases=n.canvasElementAliases.filter(o=>!e.includes(o)));}),Object.entries(O._currentTickersTimeouts).forEach(([s,n])=>{n.ticker===i&&n.canBeDeletedBeforeEnd&&(O._currentTickersTimeouts[s].aliases=n.aliases.filter(o=>!e.includes(o)));}),this.removeTickersWithoutAssociatedCanvasElement();}removeTickersWithoutAssociatedCanvasElement(){Object.entries(O._currentTickers).forEach(([e,t])=>{t.canvasElementAliases=t.canvasElementAliases.filter(i=>this.find(i)),t.canvasElementAliases.length===0&&this.onEndOfTicker(e,{aliasToRemoveAfter:Sc in t.args?t.args.aliasToRemoveAfter:[],tickerAliasToResume:"tickerAliasToResume"in t.args?t.args.tickerAliasToResume:[],ignoreTickerSteps:true});}),Object.entries(O._currentTickersSequence).forEach(([e,t])=>{t===void 0&&delete O._currentTickersSequence[e];}),Object.entries(O._currentTickersTimeouts).forEach(([e,{aliases:t}])=>{t.length===0&&O.removeTickerTimeout(e);});}removeAllTickers(){O._currentTickersSequence={},Object.keys(O._currentTickers).forEach(e=>{this.removeTicker(e);}),O._currentTickers={};for(let e in O._currentTickersTimeouts)O.removeTickerTimeout(e);O._tickersToCompleteOnStepEnd={tikersIds:[],stepAlias:[]},O._tickersOnPause={};}removeTicker(e){typeof e=="string"&&(e=[e]),e.forEach(t=>{let i=O._currentTickers[t];if(i){if(i.args.hasOwnProperty(Sc)){let s=i.args.aliasToRemoveAfter;this.remove(s);}this.app.ticker.remove(i.fn),delete O._currentTickers[t];}});}pauseTicker(e,t={}){let i=O._tickersOnPause[e];if(!i){O._tickersOnPause[e]=t;return}t.tickerIdsExcluded&&(i.tickerIdsExcluded?O._tickersOnPause[e].tickerIdsExcluded=[...i.tickerIdsExcluded,...t.tickerIdsExcluded]:O._tickersOnPause[e].tickerIdsExcluded=t.tickerIdsExcluded),t.tickerIdsIncluded&&(i.tickerIdsIncluded?O._tickersOnPause[e].tickerIdsIncluded=[...i.tickerIdsIncluded,...t.tickerIdsIncluded]:O._tickersOnPause[e].tickerIdsIncluded=t.tickerIdsIncluded);}resumeTicker(e){typeof e=="string"&&(e=[e]),e.forEach(t=>{delete O._tickersOnPause[t];});}isTickerPaused(e,t){let i=O._tickersOnPause[e];if(i){if(t){if("tickerIdsIncluded"in i&&i.tickerIdsIncluded)return i.tickerIdsIncluded.includes(t);if("tickerIdsExcluded"in i&&i.tickerIdsExcluded)return !i.tickerIdsExcluded.includes(t)}return true}return false}completeTickerOnStepEnd(e){e.alias?O._tickersToCompleteOnStepEnd.stepAlias.push({id:e.id,alias:e.alias}):O._tickersToCompleteOnStepEnd.tikersIds.push({id:e.id});}forceCompletionOfTicker(e,t){if(t){let i=O._currentTickersSequence[t];i&&i[e]&&(i[e].steps.includes(Dn)?w.error(`The ticker alias: ${t} id: ${e} contains a RepeatType, so it can't be forced to complete`,i[e]):i[e].steps.forEach(s=>{if(typeof s=="object"&&"ticker"in s){let n=lr.getInstance(s.ticker,s.args,s.duration,s.priority);n&&n.onEndOfTicker([t],e,s.args);}}));}else {let i=O._currentTickers[e];i&&i.onEndOfTicker();}}addLayer(e,t){if(e===br){w.error(`The alias ${br} is reserved`);return}return t.label=e,O.app.stage.addChild(t)}getLayer(e){return O.app.stage.getChildByLabel(e)}removeLayer(e){O.app.stage.getChildrenByLabel(e);}addHtmlLayer(e,t,i){return O.addHtmlLayer(e,t,i)}removeHtmlLayer(e){return O.removeHtmlLayer(e)}getHtmlLayer(e){return O.getHtmlLayer(e)}async extractImage(){return (await this.app.renderer.extract.image(this.gameLayer)).src}clear(){this.removeAll();}export(){let e={};return this.children.forEach(t=>{t.label&&(e[t.label]=hC(t));}),{tickers:fe(O.currentTickersWithoutCreatedBySteps),tickersSteps:fe(O._currentTickersSequence),elements:fe(e),stage:fe(Ya(this.gameLayer)),elementAliasesOrder:fe(O.childrenAliasesOrder),tickersOnPause:fe(O._tickersOnPause),tickersToCompleteOnStepEnd:fe(O._tickersToCompleteOnStepEnd)}}async restore(e){try{let t={};if(e.hasOwnProperty("elementAliasesOrder")&&e.hasOwnProperty("elements")){let i=e.elements,s=e.elementAliasesOrder,n=s.filter(a=>i[a]).map(a=>Yb(i[a])),o=await Promise.all(n);this.clear(),o.forEach((a,u)=>{let l=s[u];this.add(l,a),O.childrenAliasesOrder.push(l);});}else {w.error("The data does not have the properties elementAliasesOrder and elements");return}if(e.hasOwnProperty("stage")&&e.hasOwnProperty("stage")?Vi(this.gameLayer,e.stage,{ignoreScale:!0}):w.error("The data does not have the properties stage"),e.hasOwnProperty("tickers")){let i=e.tickers;Object.entries(i).forEach(([s,n])=>{let o=n.canvasElementAliases,a=lr.getInstance(n.id,n.args,n.duration,n.priority);if(a){let u=this.addTicker(o,a);u&&(t[s]=u);}else w.error(`Ticker ${n.id} not found`);});}if(e.hasOwnProperty("tickersSteps")){let i=e.tickersSteps;Object.entries(i).forEach(([s,n])=>{O._currentTickersSequence[s]=n,Object.keys(n).forEach(o=>{this.runTickersSequence(s,o);});});}if(e.hasOwnProperty("tickersOnPause")){let i=e.tickersOnPause;Object.keys(i).forEach(s=>{let n=i[s];"tickerIdsExcluded"in n&&n.tickerIdsExcluded&&(i[s].tickerIdsExcluded=n.tickerIdsExcluded.map(o=>t[o]||o)),"tickerIdsIncluded"in n&&n.tickerIdsIncluded&&(i[s].tickerIdsIncluded=n.tickerIdsIncluded.map(o=>t[o]||o));}),O._tickersOnPause=i;}if(e.hasOwnProperty("tickersToCompleteOnStepEnd")){let i=e.tickersToCompleteOnStepEnd,s=i.tikersIds.map(o=>({id:t[o.id]||o.id})),n=i.stepAlias.map(o=>({id:o.id,alias:o.alias}));O._tickersToCompleteOnStepEnd={tikersIds:s,stepAlias:n};}}catch(t){w.error("Error importing data",t);}}};var yf=class{constructor(){R(this,"id","event_id_not_set");this.id=this.constructor.prototype.id;}fn(e,t){throw new Error("[Pixi\u2019VN] The method CanvasEvent.fn() must be overridden")}};var vf=class{constructor(){R(this,"pixivnId","canvas_element_id_not_set");}get memory(){throw new Error("[Pixi\u2019VN] The method CanvasBaseItem.memory must be overridden")}set memory(e){throw new Error("[Pixi\u2019VN] The method CanvasBaseItems.memory must be overridden")}setMemory(e){throw new Error("[Pixi\u2019VN] The method CanvasBaseItems.memory must be overridden")}};De();De();function Hn(r){return (r instanceof Ue||r instanceof Ze)&&r.haveEmptyTexture?false:!(r instanceof Ge&&r.texture?.label=="EMPTY")}function Vn(r,e,t){let{limit:i}=t;r[e]===void 0||!t||r[e]===i||(typeof r[e]=="number"?t.type==="linear"?r[e]=xC(r[e],t):t.type==="exponential"&&(r[e]=_C(r[e],t)):r[e]!==void 0&&typeof r[e]=="object"&&r[e].haveOwnProperty("x")&&r[e].haveOwnProperty("y")&&typeof r[e].x=="number"&&typeof r[e].y=="number"&&(t.type==="linear"?(r[e].x=xC(r[e].x,t),r[e].y=xC(r[e].y,t)):t.type==="exponential"&&(r[e].x=_C(r[e].x,t),r[e].y=_C(r[e].y,t))));}function xC(r,e){let{limit:t,amt:i}=e;if(t!==void 0){if(r>t&&i>0)return t;if(r<t&&i<0)return t}return r+i}function _C(r,e){let{limit:t}=e;if(t!==void 0){if(r>t&&e.percentage>0)return t;if(r<t&&e.percentage<0)return t}return r+r*e.percentage}var hG=5,$i=class extends ur{constructor(e={},t,i){super(e,t,i);}fn(e,t,i,s){t.speed===void 0&&(t.duration===void 0?t.speed=hG:t.speed=600/(t.duration*60));let{type:n="hide",startOnlyIfHaveTexture:o,speedProgression:a}=t,u=this.speedConvert(t.speed),l=this.getLimit(t);n==="hide"&&l<0&&(l=0),n==="show"&&l>1&&(l=1),i.filter(c=>{let h=I.find(c);return !(!h||o&&!Hn(h))}).forEach(c=>{let h=I.find(c);if(h&&h instanceof ue){if(n==="show"&&h.alpha<l?h.alpha+=u*e.deltaTime:n==="hide"&&h.alpha>l&&(h.alpha-=u*e.deltaTime),n==="show"&&h.alpha>=l){this.onEndOfTicker(c,s,t);return}else if(n==="hide"&&h.alpha<=l){this.onEndOfTicker(c,s,t);return}if(u<1e-5&&!(a&&a.type=="linear"&&a.amt!=0)){w.warn("The speed of the FadeAlphaTicker must be greater than 0."),this.onEndOfTicker(c,s,t,{editAlpha:false});return}}}),a&&Vn(t,"speed",a);}onEndOfTicker(e,t,i,s={editAlpha:true}){typeof e=="string"&&(e=[e]),e.forEach(n=>{let o=I.find(n);if(o&&s.editAlpha){let a=this.getLimit(i);o.alpha=a;}}),super.onEndOfTicker(e,t,i);}getLimit(e){let{type:t="hide",limit:i=t==="hide"?0:1}=e;return i}speedConvert(e){return e/600}};lr.add($i);De();var bC={};Zi(bC,{createExportableElement:()=>fe});var dG=10;function fG(r,e){let t=fe(r.destination);if(t.type==="align"){let i,s;e instanceof Ge&&(i=e.anchor.x,s=e.anchor.y);let n=pt(e.pivot,e.angle),o=pt(e.scale,e.angle);t.x=ys("width",t.x,Xi(e),n.x,o.x<0,i),t.y=ys("height",t.y,Yi(e),n.y,o.y<0,s);}return t.type==="percentage"&&(t.x=vs("width",t.x),t.y=vs("height",t.y)),t}var vr=class extends ur{fn(e,t,i,s){t.speed===void 0&&(t.speed=dG);let{speed:n,startOnlyIfHaveTexture:o,speedProgression:a}=t;i.filter(u=>{let l=I.find(u);return !(!l||o&&!Hn(l))}).forEach(u=>{let l=I.find(u);if(l&&l instanceof ue){let c=fG(t,l),h=c.x-l.x,d=c.y-l.y,p=h>0?1:-1,m=d>0?1:-1,b,_;if(typeof n=="number"){let g=this.speedConvert(n);h===0||d===0?b=_=g:(b=Math.abs(h/(h+d))*g,_=Math.abs(d/(h+d))*g);}else b=this.speedConvert(n.x),_=this.speedConvert(n.y);if(b>0){l.x+=p*b*e.deltaTime;let g=c.x-l.x;(p<0&&g>0||p>0&&g<0)&&(l.x=c.x);}if(_>0){l.y+=m*_*e.deltaTime;let g=c.y-l.y;(m<0&&g>0||m>0&&g<0)&&(l.y=c.y);}if(l.x==c.x&&l.y==c.y){this.onEndOfTicker(u,s,t);return}else if(b<1e-5&&_<1e-5&&!(a&&a.type=="linear"&&a.amt!=0)){w.warn("The speed of the MoveTicker must be greater than 0."),this.onEndOfTicker(u,s,t,{editPosition:false});return}}}),a&&Vn(t,"speed",a);}onEndOfTicker(e,t,i,s={editPosition:true}){typeof e=="string"&&(e=[e]),e.forEach(n=>{let o=I.find(n);if(o){let a=i.destination;s.editPosition&&(o instanceof Ue||o instanceof Ze?o.positionInfo=a:(o.x=a.x,o.y=a.y));}}),super.onEndOfTicker(e,t,i);}speedConvert(e){return e*(66/400)}};lr.add(vr);De();var pG=1,Ec=class extends ur{constructor(e={},t,i){super(e,t,i);}fn(e,t,i,s){t.speed===void 0&&(t.speed=pG);let{clockwise:n=true,speedProgression:o,limit:a}=t,u=this.speedConvert(t.speed);i.filter(l=>{let c=I.find(l);return !(!c||t.startOnlyIfHaveTexture&&!Hn(c))}).forEach(l=>{let c=I.find(l);if(c&&c instanceof ue&&(n?c.rotation+=u*e.deltaTime:c.rotation-=u*e.deltaTime,a!==void 0&&(n&&c.angle>=a?(c.angle=a,this.onEndOfTicker(l,s,t)):!n&&c.angle<=a&&(c.angle=a,this.onEndOfTicker(l,s,t))),u<1e-5&&!(o&&o.type=="linear"&&o.amt!=0))){w.warn("The speed of the RotateTicker must be greater than 0."),this.onEndOfTicker(l,s,t,{editRotation:false});return}}),o&&Vn(t,"speed",o);}onEndOfTicker(e,t,i,s={editRotation:true}){let{limit:n}=i;typeof e=="string"&&(e=[e]),e.forEach(o=>{let a=I.find(o);a&&s.editRotation&&n!==void 0&&(a.angle=n);}),super.onEndOfTicker(e,t,i);}speedConvert(e){return e/100}};lr.add(Ec);De();var mG=10,Ts=class extends ur{constructor(e={},t,i){super(e,t,i);}fn(e,t,i,s){t.speed===void 0&&(t.speed=mG);let{speed:n,type:o="zoom",startOnlyIfHaveTexture:a,speedProgression:u}=t,l,c;typeof n=="number"?(l=this.speedConvert(n),c=this.speedConvert(n)):(l=this.speedConvert(n.x),c=this.speedConvert(n.y));let h=this.getLimit(t);i.filter(d=>{let p=I.find(d);return !(!p||a&&!Hn(p))}).forEach(d=>{let p=I.find(d);if(p&&p instanceof ue){if(o==="zoom"&&(p.scale.x<h.x||p.scale.y<h.y)?(p.scale.x+=l*e.deltaTime,p.scale.y+=c*e.deltaTime):o==="unzoom"&&(p.scale.x>h.x||p.scale.y>h.y)&&(p.scale.x-=l*e.deltaTime,p.scale.y-=c*e.deltaTime),o==="zoom"){if(p.scale.x>h.x&&(p.scale.x=h.x),p.scale.y>h.y&&(p.scale.y=h.y),p.scale.x>=h.x&&p.scale.y>=h.y){this.onEndOfTicker(d,s,t);return}}else if(o==="unzoom"&&(p.scale.x<h.x&&(p.scale.x=h.x),p.scale.y<h.y&&(p.scale.y=h.y),p.scale.x<=h.x&&p.scale.y<=h.y)){this.onEndOfTicker(d,s,t);return}if((l<1e-5&&c<1e-5||l<1e-5&&p.scale.y==h.y||c<1e-5&&p.scale.x==h.x)&&!(u&&u.type=="linear"&&u.amt!=0)){w.warn("The speed of the ZoomTicker must be greater than 0."),this.onEndOfTicker(d,s,t,{editScale:false});return}}}),u&&Vn(t,"speed",u);}speedConvert(e){return e/600}onEndOfTicker(e,t,i,s={editScale:true}){let{isZoomInOut:n}=i;typeof e=="string"&&(e=[e]),e.forEach(o=>{let a=I.find(o);if(a){if(s.editScale){let u=this.getLimit(i);a.scale.x=u.x,a.scale.y=u.y;}if(n){let{pivot:u,position:l}=n;a.pivot=u.x,a.position=l;}}}),super.onEndOfTicker(e,t,i);}getLimit(e){let{type:t="zoom",limit:i}=e,s=t==="zoom"?1/0:0,n=t==="zoom"?1/0:0;return i&&(typeof i=="number"?(s=i,n=i):(s=i.x,n=i.y)),{x:s,y:n}}};lr.add(Ts);async function qM(r,e={},t){let i=I.find(r);if(!i){w.error(`The element with the alias ${r} does not exist. So the shake effect can't be applied.`);return}let s={x:i.position.x,y:i.position.y},n=e.speed||20,o=e.speedProgression||void 0,a=e.startOnlyIfHaveTexture||false,u=e.type||"horizontal",l=e.maximumShockSize||10,c=(e.shocksNumber||10)-1;if(c<2){w.error("The number of shocks must be at least 3.");return}let h=Math.floor(c/2),d=Math.ceil(c/2),p=[];for(let _=0;_<h;_++){let g={x:s.x,y:s.y},y=l*(_+1)/h;u==="horizontal"?_%2!==0?g.x=s.x+y:g.x=s.x-y:_%2!==0?g.y=s.y+y:g.y=s.y-y,p.push(new vr({destination:g,speed:n,speedProgression:o,startOnlyIfHaveTexture:a},void 0,t));}let m=h%2===0;for(let _=d;_>0;_--){let g={x:s.x,y:s.y},y=l*(_+1)/(d-1);u==="horizontal"?_%2===0&&!m||_%2!==0&&m?g.x=s.x-y:g.x=s.x+y:_%2===0&&!m||_%2!==0&&m?g.y=s.y-y:g.y=s.y+y,p.push(new vr({destination:g,speed:n,speedProgression:o,startOnlyIfHaveTexture:a},void 0,t));}p.push(new vr({destination:s,speed:n,speedProgression:o,startOnlyIfHaveTexture:a,tickerAliasToResume:r},void 0,t));let b=I.addTickersSequence(r,p);b&&(I.completeTickerOnStepEnd({id:b,alias:r}),I.pauseTicker(r,{tickerIdsExcluded:[b]}));}function Tf(r,e,t){let i=new Ze(t,e);return I.add(r,i),i}async function KM(r,e,t){let i=new Ze(t,e);return await i.load(),I.add(r,i),i}De();function Sf(r,e,t){if(!e)if(exports.Assets.resolver.hasKey(r))e=r;else throw new Error(`The image ${r} does not exist in the cache.`);let i=new Ue(t,e);return I.add(r,i),i}async function ZM(r){if(!Array.isArray(r))return [r];let e=Array(r.length);for(let t=0;t<r.length;t++)e[t]=vi(r[t].textureAlias);return Promise.all(e).then(t=>t.map((i,s)=>i?(r[s].texture=i,r[s]):(r[s].load(),r[s])))}async function QM(r,e,t){if(!e)if(exports.Assets.resolver.hasKey(r))e=r;else throw new Error(`The image ${r} does not exist in the cache.`);let i=new Ue(t,e);return await i.load(),I.add(r,i),i}De();function Ef(r,e,t){if(!e)if(exports.Assets.resolver.hasKey(r))e=r;else throw new Error(`The video ${r} does not exist in the cache.`);let i=new Jt(t,e);return I.add(r,i),i}async function JM(r){if(!Array.isArray(r))return [r];let e=Array(r.length);for(let t=0;t<r.length;t++)e[t]=vi(r[t].textureAlias);return Promise.all(e).then(t=>t.map((i,s)=>i?(r[s].texture=i,r[s]):(r[s].load(),r[s])))}async function eI(r,e,t){if(!e)if(exports.Assets.resolver.hasKey(r))e=r;else throw new Error(`The video ${r} does not exist in the cache.`);let i=new Jt(t,e);return await i.load(),I.add(r,i),i}function Cf(r,e){if(typeof e=="string")return gf(e)?Ef(r,e):Sf(r,e);if(Array.isArray(e))return Tf(r,e);if(typeof e=="object"&&"value"in e&&"options"in e){if(typeof e.value=="string")return gf(e.value)?Ef(r,e.value,e.options):Sf(r,e.value,e.options);if(Array.isArray(e.value))return Tf(r,e.value,e.options)}return I.add(r,e),e}async function yC(r,e,t={},i){let{mustBeCompletedBeforeNextStep:s=true,tickerAliasToResume:n=[]}=t,o=[];e||(e=r),typeof n=="string"&&(n=[n]);let a;if(I.find(r)&&(a=r+"_temp_disolve",I.editAlias(r,a)),e=Cf(r,e),a&&I.copyCanvasElementProperty(a,r),a&&I.transferTickers(a,r,"duplicate"),e.alpha=0,a){let c=Af(a,t,i);c&&(o.push(...c),I.pauseTicker(a,{tickerIdsIncluded:c}),n.push(a));}let u=new $i({...t,type:"show",tickerAliasToResume:n,startOnlyIfHaveTexture:true},void 0,i),l=I.addTicker(r,u);if(l&&(s&&I.completeTickerOnStepEnd({id:l}),o.push(l)),(e instanceof Ue||e instanceof Ze)&&e.haveEmptyTexture&&await e.load(),o.length>0)return o}function Af(r,e={},t){let{mustBeCompletedBeforeNextStep:i=true,aliasToRemoveAfter:s=[]}=e;typeof r=="string"&&(r=[r]),typeof s=="string"&&(s=[s]),s.push(...r);let n=new $i({...e,type:"hide",aliasToRemoveAfter:s,startOnlyIfHaveTexture:true},void 0,t),o=I.addTicker(r,n);if(o)return i&&I.completeTickerOnStepEnd({id:o}),[o]}async function tI(r,e,t={},i){let{mustBeCompletedBeforeNextStep:s=true,aliasToRemoveAfter:n=[]}=t,o=[];if(e||(e=r),typeof n=="string"&&(n=[n]),!I.find(r))return yC(r,e,t,i);let a=r+"_temp_fade";I.editAlias(r,a),n.push(a),e=Cf(r,e),a&&I.copyCanvasElementProperty(a,r),a&&I.transferTickers(a,r,"duplicate"),e.alpha=0;let u=Af(a,{...t,tickerAliasToResume:r},i);u&&o.push(...u);let l=new $i({...t,type:"show",startOnlyIfHaveTexture:true,aliasToRemoveAfter:n},void 0,i),c=I.addTicker(r,l);if(c&&(s&&I.completeTickerOnStepEnd({id:c}),o.push(c),I.pauseTicker(r,{tickerIdsIncluded:[c]})),(e instanceof Ue||e instanceof Ze)&&e.haveEmptyTexture&&await e.load(),o.length>0)return o}function rI(r,e={},t){return Af(r,e,t)}async function iI(r,e,t={},i){let{direction:s="right",mustBeCompletedBeforeNextStep:n=true,tickerAliasToResume:o=[],aliasToRemoveAfter:a=[],removeOldComponentWithMoveOut:u}=t,l=[];e||(e=r),typeof o=="string"&&(o=[o]),typeof a=="string"&&(a=[a]);let c;I.find(r)&&(c=r+"_temp_movein",I.editAlias(r,c)),e=Cf(r,e),c&&I.copyCanvasElementProperty(c,r),c&&I.transferTickers(c,r,"move");let h;e instanceof Ue||e instanceof Ze?h=e.positionInfo:h={x:e.x,y:e.y,type:"pixel"};let d;switch(c&&(u?(d=$b(c,t,i),d&&(l.push(...d),o.push(c))):a.push(c)),(e instanceof Ue||e instanceof Ze)&&e.haveEmptyTexture&&await e.load(),c&&I.pauseTicker(c,{tickerIdsIncluded:d}),s){case "up":e.y=I.canvasHeight+e.height;break;case "down":e.y=-e.height;break;case "left":e.x=I.canvasWidth+e.width;break;case "right":e.x=-e.width;break}o.push(r);let p=new vr({...t,tickerAliasToResume:o,aliasToRemoveAfter:a,destination:h,startOnlyIfHaveTexture:true},void 0,i),m=I.addTicker(r,p);if(m&&(I.pauseTicker(r,{tickerIdsExcluded:[m]}),n&&I.completeTickerOnStepEnd({id:m}),l.push(m)),l.length>0)return l}function $b(r,e={},t){let{direction:i="right",mustBeCompletedBeforeNextStep:s=true,aliasToRemoveAfter:n=[]}=e;typeof n=="string"&&(n=[n]),n.push(r);let o=I.find(r);if(!o){w.warn("The canvas component is not found.");return}let a={x:o.x,y:o.y};switch(i){case "up":a.y=-o.height;break;case "down":a.y=I.canvasHeight+o.height;break;case "left":a.x=-o.width;break;case "right":a.x=I.canvasWidth+o.width;break}let u=new vr({...e,destination:a,startOnlyIfHaveTexture:true,aliasToRemoveAfter:n},void 0,t),l=I.addTicker(r,u);if(l)return I.pauseTicker(r,{tickerIdsExcluded:[l]}),s&&I.completeTickerOnStepEnd({id:l}),[l]}async function sI(r,e,t={},i){let{direction:s="right",mustBeCompletedBeforeNextStep:n=true,tickerAliasToResume:o=[],aliasToRemoveAfter:a=[]}=t,u=[];e||(e=r),typeof o=="string"&&(o=[o]),typeof a=="string"&&(a=[a]);let l,c=I.find(r);c&&(l=r+"_temp_zoom",I.editAlias(r,l)),e=Cf(r,e),l&&I.copyCanvasElementProperty(l,r),l&&I.transferTickers(l,r,"move"),s=="up"?(e.pivot.y=I.canvasHeight-e.y,e.pivot.x=I.canvasWidth/2-e.x,e.y=I.canvasHeight,e.x=I.canvasWidth/2):s=="down"?(e.pivot.y=0-e.y,e.pivot.x=I.canvasWidth/2-e.x,e.y=0,e.x=I.canvasWidth/2):s=="left"?(e.pivot.x=I.canvasWidth-e.x,e.pivot.y=I.canvasHeight/2-e.y,e.x=I.canvasWidth,e.y=I.canvasHeight/2):s=="right"&&(e.pivot.x=0-e.x,e.pivot.y=I.canvasHeight/2-e.y,e.x=0,e.y=I.canvasHeight/2),e.pivot=fC(e.pivot,e.angle),e.scale.set(0);let h=c?{pivot:{x:c.pivot.x,y:c.pivot.y},position:{x:c.x,y:c.y}}:void 0;if(l){if(t.removeOldComponentWithZoomOut){let m=vC(l,t,i);m&&(u.push(...m),o.push(l));}else a.push(l);I.pauseTicker(l);}o.push(r);let d=new Ts({...t,tickerAliasToResume:o,aliasToRemoveAfter:a,startOnlyIfHaveTexture:true,type:"zoom",limit:1,isZoomInOut:h},void 0,i),p=I.addTicker(r,d);if(p&&(I.pauseTicker(r,{tickerIdsExcluded:[p]}),n&&I.completeTickerOnStepEnd({id:p}),u.push(p)),(e instanceof Ue||e instanceof Ze)&&e.haveEmptyTexture&&await e.load(),u.length>0)return u}function vC(r,e={},t){let{direction:i="right",mustBeCompletedBeforeNextStep:s=true,aliasToRemoveAfter:n=[]}=e;typeof n=="string"&&(n=[n]),n.push(r);let o=I.find(r);if(!o){w.warn("The canvas component is not found.");return}i=="up"?(o.pivot.y=I.canvasHeight-o.y,o.pivot.x=I.canvasWidth/2-o.x,o.y=I.canvasHeight,o.x=I.canvasWidth/2):i=="down"?(o.pivot.y=0-o.y,o.pivot.x=I.canvasWidth/2-o.x,o.y=0,o.x=I.canvasWidth/2):i=="left"?(o.pivot.x=I.canvasWidth-o.x,o.pivot.y=I.canvasHeight/2-o.y,o.x=I.canvasWidth,o.y=I.canvasHeight/2):i=="right"&&(o.pivot.x=0-o.x,o.pivot.y=I.canvasHeight/2-o.y,o.x=0,o.y=I.canvasHeight/2),o.pivot=fC(o.pivot,o.angle),o.scale.set(1);let a=new Ts({...e,startOnlyIfHaveTexture:true,type:"unzoom",limit:0,aliasToRemoveAfter:n},void 0,t),u=I.addTicker(r,a);if(u)return I.pauseTicker(r,{tickerIdsExcluded:[u]}),s&&I.completeTickerOnStepEnd({id:u}),[u]}async function nI(r,e,t={},i){let{direction:s="right",mustBeCompletedBeforeNextStep:n=true,tickerAliasToResume:o=[]}=t,a=[];e||(e=r),typeof o=="string"&&(o=[o]);let u;I.find(r)&&(u=r+"_temp_push",I.editAlias(r,u)),e=Cf(r,e),u&&I.copyCanvasElementProperty(u,r),u&&I.transferTickers(u,r,"move");let l;if((e instanceof Ue||e instanceof Ze)&&e.haveEmptyTexture?l=e.positionInfo:l={x:e.x,y:e.y,type:"pixel"},s=="up"?e.y=-I.canvasHeight+e.y:s=="down"?e.y=I.canvasHeight+e.y:s=="left"?e.x=-I.canvasWidth+e.x:s=="right"&&(e.x=I.canvasWidth+e.x),u){let d=TC(u,{...t,direction:s=="up"?"down":s=="down"?"up":s=="left"?"right":"left"},i);d&&a.push(...d);}o.push(r);let c=new vr({...t,tickerAliasToResume:o,startOnlyIfHaveTexture:true,destination:l},void 0,i),h=I.addTicker(r,c);if(h&&(I.pauseTicker(r,{tickerIdsExcluded:[h]}),n&&I.completeTickerOnStepEnd({id:h}),a.push(h)),(e instanceof Ue||e instanceof Ze)&&e.haveEmptyTexture&&await e.load(),a.length>0)return a}function TC(r,e={direction:"right"},t){return $b(r,e,t)}var I=new bf;yr.init({getScreen:()=>I.screen});var EC={};Zi(EC,{CharacterBaseModel:()=>wf,CharacterStoredClass:()=>$a,RegisteredCharacters:()=>lI,getAllCharacters:()=>uI,getCharacterById:()=>aI,saveCharacter:()=>oI});var ie=class ie{static init(e){ie._getStepCounter=e.getStepCounter,ie._setStepCounter=e.setStepCounter,ie._getCurrentGameStepState=e.getCurrentGameStepState,ie._restoreGameStepState=e.restoreGameStepState,ie._getOpenedLabels=e.getOpenedLabels,e.onGoNextEnd&&(ie._onGoNextEnd=e.onGoNextEnd),ie._getVariable=e.getVariable,ie._setVariable=e.setVariable,ie._removeVariable=e.removeVariable,ie._getFlag=e.getFlag,ie._setFlag=e.setFlag,e.onLabelClosing&&(ie._onLabelClosing=e.onLabelClosing),ie._addHistoryItem=e.addHistoryItem,ie._getCurrentStepsRunningNumber=e.getCurrentStepsRunningNumber,ie._getCharacter=e.getCharacter;}static get stepCounter(){return ie._getStepCounter()}static set stepCounter(e){ie._setStepCounter(e);}static get currentGameStepState(){return ie._getCurrentGameStepState()}static get restoreGameStepState(){return ie._restoreGameStepState}static get openedLabels(){return ie._getOpenedLabels()}static get onGoNextEnd(){return ie._onGoNextEnd}static get getVariable(){return ie._getVariable}static get setVariable(){return ie._setVariable}static get removeVariable(){return ie._removeVariable}static get getFlag(){return ie._getFlag}static get setFlag(){return ie._setFlag}static get onLabelClosing(){return ie._onLabelClosing}static get addHistoryItem(){return ie._addHistoryItem}static get currentStepsRunningNumber(){return ie._getCurrentStepsRunningNumber()}static get getCharacter(){return ie._getCharacter}};R(ie,"_getStepCounter",()=>{throw w.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),R(ie,"_setStepCounter",()=>{throw w.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),R(ie,"_getCurrentGameStepState",()=>{throw w.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),R(ie,"_restoreGameStepState",()=>{throw w.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),R(ie,"_getOpenedLabels",()=>{throw w.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),R(ie,"_onGoNextEnd",async()=>{}),R(ie,"_getVariable",()=>{throw w.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),R(ie,"_setVariable",()=>{throw w.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),R(ie,"_removeVariable",()=>{throw w.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),R(ie,"_getFlag",()=>{throw w.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),R(ie,"_setFlag",()=>{throw w.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),R(ie,"_onLabelClosing",()=>{}),R(ie,"_addHistoryItem",()=>{throw w.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),R(ie,"_getCurrentStepsRunningNumber",()=>{throw w.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented, you should initialize the Game: Game.init()")}),R(ie,"_getCharacter",()=>{throw w.error("Method not implemented, you should initialize the Game: Game.init()"),new Error("Method not implemented.")}),R(ie,"onEnd"),R(ie,"onError");var W=ie;var St=class St{constructor(){}static clearOldTempVariables(e){St.tempStorageDeadlines.forEach((t,i)=>{t>e&&(St.tempStorage.delete(i),St.tempStorageDeadlines.delete(i),St.storage.cache.delete(i));});}static setVariable(e,t){let i=St.tempStorage.has(e);t==null?(St.storage.map.delete(e),!i&&St.storage.cache.delete(e)):(St.storage.map.set(e,t),!i&&St.storage.cache.set(e,t));}static getVariable(e){let t=St.storage.cache.get(e);return t===void 0&&(t=St.tempStorage.get(e)),t===void 0&&(t=St.storage.map.get(e)),fe(t)}static removeVariable(e){St.storage.delete(e);}static setFlag(e,t){if(t)this.flags.includes(e)||this.flags.push(e);else {let i=this.flags.indexOf(e);i>-1&&this.flags.splice(i,1);}}static getFlag(e){return this.flags.includes(e)}};R(St,"storage",new Tt({cacheSize:20})),R(St,"startingStorage",[]),R(St,"flags",Array()),R(St,"tempStorage",new Map),R(St,"tempStorageDeadlines",new Map);var oe=St;var Pf=class{get storage(){return oe.storage.map}get cache(){return oe.storage.cache}get flags(){return oe.flags}get tempStorage(){return oe.tempStorage}get tempStorageDeadlines(){return oe.tempStorageDeadlines}set startingStorage(e){let t=[];Object.entries(e).forEach(([i,s])=>{t.push({key:i,value:s});}),oe.startingStorage=t;}setVariable(e,t){return oe.setVariable(e,t)}getVariable(e){return oe.getVariable(e)}removeVariable(e){return oe.removeVariable(e)}setTempVariable(e,t){if(t==null){this.removeTempVariable(e);return}else oe.tempStorage.set(e,t),oe.storage.cache.set(e,t),oe.tempStorageDeadlines.has(e)||oe.tempStorageDeadlines.set(e,W.openedLabels);}removeTempVariable(e){oe.tempStorage.has(e)&&(oe.tempStorage.delete(e),oe.tempStorageDeadlines.delete(e),oe.storage.cache.delete(e));}setFlag(e,t){return oe.setFlag(e,t)}getFlag(e){return oe.getFlag(e)}clear(){this.storage.clear(),this.cache.clear(),oe.flags=[],oe.tempStorage.clear(),oe.tempStorageDeadlines.clear(),oe.startingStorage.forEach(({key:e,value:t})=>{this.storage.set(e,t);});}export(){let e=[];[...this.storage.keys()].forEach(s=>{e.push({key:s,value:this.storage.get(s)});});let t=[];[...oe.tempStorage.keys()].forEach(s=>{t.push({key:s,value:oe.tempStorage.get(s)});});let i=[];return [...oe.tempStorageDeadlines.keys()].forEach(s=>{i.push({key:s,value:oe.tempStorageDeadlines.get(s)});}),fe({base:e,temp:t,tempDeadlines:i,flags:oe.flags})}restore(e){this.clear();try{e?(Array.isArray(e)&&e.forEach(t=>{if(t.key==="___temp_storage___"){let i=t.value;Object.entries(i).forEach(([s,n])=>{oe.tempStorage.set(s,n);});}else if(t.key==="___temp_storage_deadlines___"){let i=t.value;Object.entries(i).forEach(([s,n])=>{oe.tempStorageDeadlines.set(s,n);});}else t.key==="___flags___"?t.value.forEach(s=>{oe.flags.push(s);}):this.storage.set(t.key,t.value);}),"base"in e&&"temp"in e&&"tempDeadlines"in e?(e.base?.forEach(t=>{this.storage.set(t.key,t.value);}),e.temp?.forEach(t=>{oe.tempStorage.set(t.key,t.value);}),e.tempDeadlines?.forEach(t=>{oe.tempStorageDeadlines.set(t.key,t.value);})):Object.entries(e).forEach(([t,i])=>{t==="___temp_storage___"?Object.entries(i).forEach(([s,n])=>{oe.tempStorage.set(s,n);}):t==="___temp_storage_deadlines___"?Object.entries(i).forEach(([s,n])=>{oe.tempStorageDeadlines.set(s,n);}):t==="___flags___"?i.forEach(s=>{oe.flags.push(s);}):this.storage.set(t,i);})):w.warn("No storage data found");}catch(t){w.error("Error importing data",t);}}};var Cc=class{constructor(e,t){R(this,"_id");R(this,"categoryId");this.categoryId=e,this._id=t;}get id(){return this._id}setStorageProperty(e,t){let i=oe.getVariable(this.categoryId);i||(i={}),i.hasOwnProperty(this.id)||(i[this.id]={}),t==null?i[this.id].hasOwnProperty(e)&&delete i[this.id][e]:i[this.id]={...i[this.id],[e]:t},Object.keys(i[this.id]).length===0&&delete i[this.id],oe.setVariable(this.categoryId,i);}getStorageProperty(e,t=this.id){let i=oe.getVariable(this.categoryId);if(i&&i.hasOwnProperty(t)&&i[t].hasOwnProperty(e))return i[t][e]}};var Kr=new Pf;var xG="@",$a=class extends Cc{constructor(t,i=""){super(le.CHARACTER_CATEGORY_KEY,t+(i?xG+i:""));R(this,"sourceId");this.sourceId=t;}getStorageProperty(t){let i=super.getStorageProperty(t);return i===void 0&&(i=super.getStorageProperty(t,this.sourceId)),i}};var wf=class extends $a{constructor(t,i){super(typeof t=="string"?t:t.id,typeof t=="string"?"":t.emotion);R(this,"defaultName");R(this,"defaultSurname");R(this,"defaultAge");R(this,"_icon");R(this,"_color");this.defaultName=i.name,this.defaultSurname=i.surname,this.defaultAge=i.age,this._icon=i.icon,this._color=i.color;}get name(){return this.getStorageProperty("name")||this.defaultName||this.id}set name(t){this.setStorageProperty("name",t);}get surname(){return this.getStorageProperty("surname")||this.defaultSurname}set surname(t){this.setStorageProperty("surname",t);}get age(){return this.getStorageProperty("age")||this.defaultAge}set age(t){this.setStorageProperty("age",t);}get icon(){return this._icon}get color(){return this._color}};var qa=new Tt({cacheSize:10});function oI(r){return Ac.add(r)}function aI(r){return Ac.get(r)}function uI(){return Ac.values()}var Ac;(s=>{function r(n){try{let o=qa.get(n);if(!o){w.warn(`Character "${n}" not found, did you forget to register it with the RegisteredCharacters.add?`);return}return o}catch(o){w.error(`Error while getting Character "${n}"`,o);return}}s.get=r;function e(n){if(Array.isArray(n)){n.forEach(o=>e(o));return}qa.get(n.id)&&w.info(`Character id "${n.id}" already exists, it will be overwritten`),qa.set(n.id,n);}s.add=e;function t(){return Array.from(qa.values())}s.values=t;function i(n){return qa.has(n)}s.has=i;})(Ac||(Ac={}));var lI=Ac;var fI=tu(hI());function dI(r,e){let t=fe(r);return e.length>1&&"type"in e[0]&&(e=e.reverse()),e.forEach(i=>{"type"in i?_G(t,i):bG(t,i);}),t}function _G(r,e){let t=r;e.path&&e.path.length>0?e.path.forEach((i,s)=>{if(e.path&&s===e.path.length-1)switch(e.type){case "CHANGE":case "REMOVE":t[i]=e.oldValue;break;case "CREATE":Array.isArray(t)&&typeof i=="number"?t.splice(i,1):delete t[i];break}else t=t[i];}):w.warn("No path found, skipping diff",e);}function bG(r,e){let t=r;e.path&&e.path.length>0?e.path.forEach((i,s)=>{if(e.path&&s===e.path.length-1){if(e.kind==="E"||e.kind==="D")t[i]=e.lhs;else if(e.kind==="N")Number.isInteger(i)?Array.isArray(t)&&t.splice(i,1):typeof i=="string"&&delete t[i];else if(e.kind==="A"){let n=e.index;e.item.kind==="N"?t[i].splice(n,1):e.item.kind==="E"||e.item.kind==="D"?t[i][n]=e.item.lhs:e.item.kind==="A"?w.warn("Nested array found, skipping diff",e):w.warn("No array found, skipping diff",e);}}else t=t[i];}):w.warn("No path found, skipping diff",e);}var Ti=class Ti{static get originalStepData(){return Ti._originalStepData?fe(Ti._originalStepData):{path:"",storage:{},canvas:{elementAliasesOrder:[],elements:{},stage:{},tickers:{},tickersSteps:{},tickersOnPause:{},tickersToCompleteOnStepEnd:{tikersIds:[],stepAlias:[]}},sound:{soundAliasesOrder:[],soundsPlaying:{},playInStepIndex:{},filters:void 0},labelIndex:-1,openedLabels:[]}}static set originalStepData(e){Ti._originalStepData=fe(e);}};R(Ti,"_diffHistory",new Tt({cacheSize:5})),R(Ti,"_stepsInfoHistory",new Tt({cacheSize:5})),R(Ti,"_narrationHistory",new Tt({cacheSize:50})),R(Ti,"stepLimitSaved",20),R(Ti,"goBackRunning",false),R(Ti,"_originalStepData");var K=Ti;var Bf=class{get stepsInfoMap(){return K._stepsInfoHistory}get diffMap(){return K._diffHistory}get narrationMap(){return K._narrationHistory}get size(){return K._stepsInfoHistory.size}get lastKey(){return this.size===0?null:Math.max(...Array.from(this.keys()))}keys(){return K._stepsInfoHistory.keys()}get(e){let t=K._narrationHistory.get(e);if(!(t&&Object.keys(t).length===1&&t.stepIndex!==void 0))return t}delete(e){K._stepsInfoHistory.delete(e),K._diffHistory.delete(e),K._narrationHistory.delete(e);}internalRestoreOldGameState(e,t){if(e<=0||this.size==0)return t;let i=this.lastKey;if(typeof i!="number")return w.error("You can't go back, there is no step to go back"),t;let s=K._diffHistory.get(i);if(s)try{let n=dI(t,s);return W.stepCounter=i,this.delete(i),this.internalRestoreOldGameState(e-1,n)}catch(n){return w.error("Error applying diff",n),t}else return w.error("You can't go back, there is no step to go back"),t}async goBack(e,t=1){if(t<=0){w.warn("The parameter steps must be greater than 0");return}if(K._diffHistory.size<1){w.warn("You can't go back, there is no step to go back");return}if(K.goBackRunning){w.warn("Go back is already running");return}K.goBackRunning=true;try{let i=fe(this.internalRestoreOldGameState(t,K.originalStepData));if(i){await W.restoreGameStepState(i,e);let s=W.stepCounter-1,n=K._narrationHistory.get(s);if(n&&Object.keys(n).length===1&&n.stepIndex!==void 0){let o=K._stepsInfoHistory.get(s);if(o){let a=this.itemMapper({step:o});K._narrationHistory.set(o.index,a);}}}else w.error("Error going back");K.goBackRunning=!1;}catch(i){w.error("Error going back",i),K.goBackRunning=false;}}add(e,t={}){let i=K.originalStepData,{ignoreSameStep:s}=t,n=W.currentGameStepState;if(!s&&this.isSameStep(i,n))return;let o=this.lastKey;(async()=>{try{let u,l;if(typeof o=="number"&&(u=K._stepsInfoHistory.get(o),l=K._narrationHistory.get(o)),K._stepsInfoHistory.set(e.index,e),e.index!==0){let d=(0,fI.diff)(i,n);d?K._diffHistory.set(e.index,d):w.warn("It was not possible to create the difference between the two steps");}let c={},h=this.itemMapper({step:e},c);if(K._narrationHistory.set(e.index,h),u&&l&&typeof o=="number"){let d=this.itemMapper({...c,step:u},{});K._narrationHistory.set(o,d);}}catch(u){w.error("Error adding history step",u);}})(),K.originalStepData=n;}itemMapper(e,t){let{step:i,choiceIndexMade:s,inputValue:n,removeDialogue:o}=e,a=i.dialogue||i.dialoge;t&&i.isGlued&&(t.removeDialogue=true),o&&(a=void 0);let u=i.choices;if(t&&i.currentLabel&&i.choiceIndexMade!==void 0&&(t.choiceIndexMade=i.choiceIndexMade),i.inputValue&&t&&(t.inputValue=i.inputValue),a||u||n){let l=u?.map((c,h)=>{let d=false;return c.oneTime&&i.alreadyMadeChoices&&i.alreadyMadeChoices.includes(h)&&(d=true),{text:c.text,type:c.type,isResponse:false,hidden:d}});if(l){if(l.every(c=>c.hidden)){let c=l.find(h=>h.hidden===false);c&&(c.hidden=false);}s!==void 0&&(l[s].isResponse=true);}return {dialogue:a?{...a,character:a.character?W.getCharacter(a.character)||a.character:void 0}:void 0,playerMadeChoice:typeof s=="number",choices:l,stepIndex:i.index,inputValue:n}}return {stepIndex:i.index}}get narrativeHistory(){let e=[];return Array.from(this.keys()).sort((i,s)=>i-s).forEach(i=>{let s=this.get(i);s&&e.push(s);}),e}get currentLabelHistory(){let e=[],t=Array.from(this.keys()).sort((u,l)=>l-u);if(t.length===0)return e;let i=t[0];if(typeof i!="number")return e;let s=K._stepsInfoHistory.get(i);if(!s)return e;let n=s.openedLabels;if(!n||!Array.isArray(n)||n.length===0)return e;let o=n[0].currentStepIndex,a=n[0].label;return t.every((u,l)=>{let c=this.get(u);if(c){if(l===0)return e.push(c),true;let h=K._stepsInfoHistory.get(u);if(!h)return true;let d=h.openedLabels;if(!d||!Array.isArray(d)||d.length===0||d[0].label!==a||d[0].currentStepIndex>=o)return false;o=d[0].currentStepIndex,e.push(c);}return true}),e.reverse()}removeNarrativeHistory(e){if(e){let t=Array.from(this.keys()).sort((i,s)=>i-s);t=t.slice(0,e),t.forEach(i=>{K._narrationHistory.delete(i),K._stepsInfoHistory.delete(i),K._diffHistory.delete(i);});}else K._stepsInfoHistory.clear(),K._diffHistory.clear(),K._narrationHistory.clear();}get canGoBack(){let e=this.lastKey;return typeof e!="number"?false:K._diffHistory.has(e)}blockGoBack(){W.currentStepsRunningNumber===0&&K._diffHistory.clear();}isSameStep(e,t){if(e.openedLabels.length===t.openedLabels.length)try{let i=JSON.stringify(e.openedLabels),s=JSON.stringify(t.openedLabels);if(i===s&&e.path===t.path&&e.labelIndex===t.labelIndex)return !0}catch(i){return w.error("Error comparing opened labels",i),true}return false}clear(){K._stepsInfoHistory.clear(),K._diffHistory.clear(),K._narrationHistory.clear(),K._originalStepData=void 0;}get stepLimitSaved(){return K.stepLimitSaved}set stepLimitSaved(e){K.stepLimitSaved=e;}export(){let e=Array.from(this.keys()).sort((i,s)=>i-s);e.length>this.stepLimitSaved&&(e=e.slice(e.length-this.stepLimitSaved));let t=[];return e.forEach(i=>{let s=K._stepsInfoHistory.get(i);if(s){let n=K._diffHistory.get(i);t.push({...s,diff:n});}}),{stepsHistory:fe(t),originalStepData:fe(K._originalStepData)}}restoreNarrativeHistory(){let e=Array.from(this.keys()).sort((i,s)=>i-s),t={};e.forEach(i=>{let s=K._stepsInfoHistory.get(i);if(s){let n={...t};t={};let o=this.itemMapper({step:s,choiceIndexMade:n.choiceIndexMade,inputValue:n.inputValue,removeDialogue:n.removeDialogue},t);o&&K._narrationHistory.set(i,o);}});}async restore(e){this.clear();try{e.hasOwnProperty("stepsHistory")?(e.stepsHistory.forEach(i=>{i.diff&&K._diffHistory.set(i.index,i.diff);let s={...i,diff:void 0};K._stepsInfoHistory.set(i.index,s);}),this.restoreNarrativeHistory()):w.warn("Could not import stepsHistory data, so will be ignored"),e.hasOwnProperty("originalStepData")?K._originalStepData=e.originalStepData:w.warn("Could not import originalStepData data, so will be ignored");}catch(t){w.error("Error importing data",t);}}};var zn=new Bf;var pI={};var BC={};Zi(BC,{ChoiceMenuOption:()=>Za,ChoiceMenuOptionClose:()=>Ja,Close:()=>Qa,Label:()=>Ss,LabelAbstract:()=>Ka,NarrationManagerStatic:()=>H,RegisteredLabels:()=>Tr,narration:()=>Es,newChoiceOption:()=>gI,newCloseChoiceOption:()=>xI,newLabel:()=>wC});var Rf=new Tt({cacheSize:10}),AC;(s=>{function r(n){let o=Rf.get(n);if(!o){w.error(`Label "${n}" not found`);return}return o}s.get=r;function e(n){if(Array.isArray(n)){n.forEach(o=>e(o));return}Rf.has(n.id)&&w.info(`Label "${n.id}" already exists, it will be overwritten`),Rf.set(n.id,n);}s.add=e;function t(){return Array.from(Rf.values())}s.values=t;function i(n){return Rf.has(n)}s.has=i;})(AC||(AC={}));var Tr=AC;var mI=tu(iC());var Ka=class{constructor(e,t){R(this,"_id");R(this,"_onStepStart");R(this,"_onLoadingLabel");R(this,"_onStepEnd");this._id=e,this._onStepStart=t?.onStepStart,this._onLoadingLabel=t?.onLoadingLabel,this._onStepEnd=t?.onStepEnd;}get id(){return this._id}get onStepStart(){return async(e,t)=>{if(this._onLoadingLabel&&e===0&&await this._onLoadingLabel(e,t),this._onStepStart)return await this._onStepStart(e,t)}}get onLoadingLabel(){return this._onLoadingLabel}get onStepEnd(){return this._onStepEnd}};var Ss=class extends Ka{constructor(t,i,s){super(t,s);R(this,"_steps");this._steps=i;}get stepCount(){return this.steps.length}getStepById(t){return this.steps[t]}get steps(){return typeof this._steps=="function"?this._steps():this._steps}getStepSha(t){if(t<0||t>=this.steps.length)return w.warn("stepSha not found, setting to ERROR"),"error";try{let i=this.steps[t];return (0,mI.default)(i.toString().toLocaleLowerCase()).toString()}catch(i){return w.warn("stepSha not found, setting to ERROR",i),"error"}}};var TG="__close-label-id__";function PC(){return new Ss(TG,[],{})}var Za=class{constructor(e,t,i,s){R(this,"text");R(this,"_label");R(this,"type");R(this,"oneTime");R(this,"onlyHaveNoChoice");R(this,"autoSelect");R(this,"props",{});R(this,"devProps",{});let{type:n="call",oneTime:o=false,onlyHaveNoChoice:a=false,autoSelect:u=false,...l}=s||{};this.text=e,this._label=t,this.type=n,this.oneTime=o,this.onlyHaveNoChoice=a,this.autoSelect=u,this.devProps=l,this.props=i;}get label(){let e=this._label;if(typeof e=="string"){let t=Tr.get(e);t?e=t:(w.error(`Label ${e} not found, so it will be closed`),e=PC());}return e}};function gI(r,e,t,i){let s=typeof e=="string"?e:e.id;return {...i,label:s,props:t,text:r,type:i?.type||"call"}}var Qa="close";var Ja=class{constructor(e,t){R(this,"text");R(this,"closeCurrentLabel");R(this,"type",Qa);R(this,"oneTime");R(this,"onlyHaveNoChoice");R(this,"autoSelect");R(this,"props",{});R(this,"devProps",{});let{closeCurrentLabel:i=false,oneTime:s=false,onlyHaveNoChoice:n=false,autoSelect:o=false,...a}=t||{};this.text=e,this.closeCurrentLabel=i,this.oneTime=s,this.onlyHaveNoChoice=n,this.autoSelect=o,this.devProps=a;}};function xI(r,e){return {...e,type:Qa,text:r}}var Z=class Z{constructor(){}static get allOpenedLabels(){return W.getVariable(le.OPENED_LABELS_COUNTER_KEY)||{}}static set allOpenedLabels(e){W.setVariable(le.OPENED_LABELS_COUNTER_KEY,e);}static getCurrentStepTimesCounterData(e=""){let t=Z.currentLabelStepIndex;if(t===null)return w.error("currentLabelStepIndex is null"),null;let i=`${t}${e}`,s=Z.currentLabelId,n=Z._currentLabel;if(!s||t===null||!n)return w.error("currentLabelId or currentLabelStepIndex is null or currentLabel not found"),null;let o=n.getStepSha(t)||"error",a=W.getVariable(le.CURRENT_STEP_TIMES_COUNTER_KEY)||{};return a[s]||(a[s]={}),(!a[s][i]||a[s][i].stepSha1!=o)&&(a[s][i]={stepSha1:o}),a[s][i]}static setCurrentStepTimesCounterData(e="",t){let i=Z.currentLabelStepIndex,s=i+e,n=Z.currentLabelId;if(!n||i===null){w.error("currentLabelId or currentLabelStepIndex is null");return}let o=W.getVariable(le.CURRENT_STEP_TIMES_COUNTER_KEY)||{};o[n]||(o[n]={}),o[n][s]=t,W.setVariable(le.CURRENT_STEP_TIMES_COUNTER_KEY,o);}static getCurrentStepTimesCounter(e=""){let t=Z._stepCounter,i=Z.getCurrentStepTimesCounterData(e);if(!i)return w.error("getCurrentStepTimesCounter obj is null"),0;let s=i.stepCounters||i.lastStepIndexs||[];return s.find(o=>o===t)||(s.push(t),delete i.lastStepIndexs,i.stepCounters=s,Z.setCurrentStepTimesCounterData(e,i)),s.length}static getRandomNumber(e,t,i={}){let s=i.nestedId||"";if(i.onceOnly||false){let o=Z.getCurrentStepTimesCounterData(s);if(!o)return;let a=o.usedRandomNumbers||{},u=Array.from({length:t-e+1},(h,d)=>d+e).filter(h=>!a[`${e}-${t}`]?.includes(h));if(u.length===0)return;let l=Math.floor(Math.random()*u.length),c=u[l];return a[`${e}-${t}`]||(a[`${e}-${t}`]=[]),a[`${e}-${t}`].push(c),o.usedRandomNumbers=a,Z.setCurrentStepTimesCounterData(s,o),c}return Math.floor(Math.random()*(t-e+1))+e}static resetCurrentStepTimesCounter(e=""){let t=Z.currentLabelStepIndex,i=t+e,s=Z.currentLabelId;if(!s||t===null){w.error("currentLabelId or currentLabelStepIndex is null");return}let n=W.getVariable(le.CURRENT_STEP_TIMES_COUNTER_KEY)||{};n[s]||(n[s]={}),n[s][i]={stepCounters:[],stepSha1:""},W.setVariable(le.CURRENT_STEP_TIMES_COUNTER_KEY,n);}static get allChoicesMade(){return W.getVariable(le.ALL_CHOICES_MADE_KEY)||[]}static set allChoicesMade(e){W.setVariable(le.ALL_CHOICES_MADE_KEY,e);}static increaseStepCounter(){Z._stepCounter++;}static get openedLabels(){return fe(Z._openedLabels)}static set openedLabels(e){Z._openedLabels=fe(e);}static get originalOpenedLabels(){return fe(Z._originalOpenedLabels)}static set originalOpenedLabels(e){Z._originalOpenedLabels=fe(e);}static get _currentLabel(){if(Z.currentLabelId)return Tr.get(Z.currentLabelId)}static get currentLabelId(){if(Z._openedLabels.length>0)return Z._openedLabels[Z._openedLabels.length-1].label}static get currentLabelStepIndex(){return Z._openedLabels.length>0?Z._openedLabels[Z._openedLabels.length-1].currentStepIndex:null}static addLabelHistory(e,t){let i=Z.allOpenedLabels,s=Z.allOpenedLabels[e]?.biggestStep||0,n=Z.allOpenedLabels[e]?.openCount||0;(!s||s<t)&&(i[e]={biggestStep:t,openCount:n},Z.allOpenedLabels=i);}static addChoicesMade(e,t,i,s){let n=Z.allChoicesMade,o=n.findIndex(a=>a.labelId===e&&a.stepIndex===t&&a.choiceIndex===s&&a.stepSha1===i);o<0?n.push({labelId:e,stepIndex:t,choiceIndex:s,stepSha1:i,madeTimes:1}):n[o].madeTimes++,Z.allChoicesMade=n;}static pushNewLabel(e){if(!Tr.get(e))throw new Error(`[Pixi\u2019VN] Label ${e} not found`);Z._openedLabels.push({label:e,currentStepIndex:0});let i=Z.allOpenedLabels,s=Z.allOpenedLabels[e]?.biggestStep||0,n=Z.allOpenedLabels[e]?.openCount||0;i[e]={biggestStep:s,openCount:n+1},Z.allOpenedLabels=i;}static increaseCurrentStepIndex(){if(Z._openedLabels.length>0){let e=Z._openedLabels[Z._openedLabels.length-1];Z._openedLabels[Z._openedLabels.length-1]={...e,currentStepIndex:e.currentStepIndex+1};}}static set onStepStart(e){Z._onStepStart=e;}static get onStepStart(){return async(e,t)=>{let i=[];return Z.onLoadingLabel&&e===0&&i.push(Z.onLoadingLabel(e,t)),Z._onStepStart&&i.push(Z._onStepStart(e,t)),await Promise.all(i)}}};R(Z,"stepsRunning",0),R(Z,"goNextRequests",0),R(Z,"choiceMadeTemp"),R(Z,"lastHistoryStep",null),R(Z,"_stepCounter",0),R(Z,"_openedLabels",[]),R(Z,"_originalOpenedLabels",[]),R(Z,"_onStepStart"),R(Z,"onLoadingLabel"),R(Z,"onStepEnd");var H=Z;var Mf=class{get currentStepTimesCounter(){return H.getCurrentStepTimesCounter()}set currentStepTimesCounter(e){H.resetCurrentStepTimesCounter();}getRandomNumber(e,t,i={}){return H.getRandomNumber(e,t,i)}get stepCounter(){return H._stepCounter}get openedLabels(){return H.openedLabels}get currentLabel(){return H._currentLabel}addStepHistory(e,t={}){let{choiceMade:i,ignoreSameStep:s}=t,n,o,a,u=W.getVariable(le.LAST_STEP_GLUED)===this.stepCounter;W.getVariable(le.LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY)===this.stepCounter&&(n=W.getVariable(le.CURRENT_DIALOGUE_MEMORY_KEY)),W.getVariable(le.LAST_MENU_OPTIONS_ADDED_IN_STEP_MEMORY_KEY)===this.stepCounter&&(o=W.getVariable(le.CURRENT_MENU_OPTIONS_MEMORY_KEY)),W.getVariable(le.LAST_INPUT_ADDED_IN_STEP_MEMORY_KEY)===this.stepCounter&&(a=W.getVariable(le.CURRENT_INPUT_VALUE_MEMORY_KEY));let l=H.openedLabels,c={currentLabel:H.currentLabelId,dialogue:n,choices:o,stepSha1:e,index:this.stepCounter,labelStepIndex:H.currentLabelStepIndex,choiceIndexMade:i,inputValue:a,alreadyMadeChoices:this.alreadyCurrentStepMadeChoices,isGlued:u,openedLabels:l};H.originalOpenedLabels=l,W.addHistoryItem(c,{ignoreSameStep:s}),H.lastHistoryStep=c,H.increaseStepCounter();}closeCurrentLabel(){if(!H.currentLabelId){w.warn("No label to close");return}if(!this.currentLabel){w.error("currentLabel not found");return}let e=H.openedLabels;e.pop(),H.openedLabels=e,W.onLabelClosing(this.openedLabels.length);}closeAllLabels(){for(;H.openedLabels.length>0;)this.closeCurrentLabel(),W.onLabelClosing(this.openedLabels.length);}isLabelAlreadyCompleted(e){let t;typeof e=="string"?t=e:t=e.id;let s=H.allOpenedLabels[t]?.biggestStep||0;if(s){let n=Tr.get(t);if(n)return n.stepCount<=s}return false}get alreadyCurrentStepMadeChoicesObj(){let e=H.currentLabelStepIndex,t=this.currentLabel;if(e===null||!t)return;let i=t.getStepSha(e);return i||(w.warn("stepSha not found, setting to ERROR"),i="error"),H.allChoicesMade.filter(s=>s.labelId===t?.id&&s.stepIndex===e&&s.stepSha1===i)}get alreadyCurrentStepMadeChoices(){return this.alreadyCurrentStepMadeChoicesObj?.map(e=>e.choiceIndex)}get isCurrentStepAlreadyOpened(){let e=H.currentLabelId;if(e){let t=H.allOpenedLabels[e]?.openCount||0;if(H.currentLabelStepIndex&&t>=H.currentLabelStepIndex)return true}return false}getTimesLabelOpened(e){return H.allOpenedLabels[e]?.openCount||0}getTimesChoiceMade(e){return this.alreadyCurrentStepMadeChoicesObj?.find(t=>t.choiceIndex===e)?.madeTimes||0}addCurrentStepToHistory(){this.addStepHistory("dev",{ignoreSameStep:true});}getCanGoNext(e){let t=e?.showWarn||false,i=this.choiceMenuOptions;return i&&i.length>0?(t&&w.warn("The player must make a choice"),false):this.isRequiredInput?(t&&w.warn("The player must enter a value"),false):true}get canGoNext(){return H.stepsRunning!==0?false:this.getCanGoNext()}async onStepRun(e,t){let i=[];return e.onStepStart&&i.push(e.onStepStart(t,e)),H.onStepStart&&i.push(H.onStepStart(t,e)),await Promise.all(i)}async onStepEnd(e,t){let i=[];return e.onStepEnd&&i.push(e.onStepEnd(t,e)),H.onStepEnd&&i.push(H.onStepEnd(t,e)),await Promise.all(i)}async goNext(e,t={}){let{runNow:i=false}=t;if(!(!i&&!this.getCanGoNext({showWarn:true}))){if(!i&&H.stepsRunning!==0){H.goNextRequests++;return}try{this.currentLabel&&await this.onStepEnd(this.currentLabel,H.currentLabelStepIndex||0);}catch(s){w.error("Error running onStepEnd",s);}return H.stepsRunning===0&&await W.onGoNextEnd(),H.increaseCurrentStepIndex(),await this.runCurrentStep(e,t)}}async runCurrentStep(e,t={}){let{choiceMade:i}=t;if(H.currentLabelId){let s=H.currentLabelStepIndex;if(s===null){w.error("currentLabelStepIndex is null");return}let n=H._currentLabel;if(!n){w.error("currentLabel not found");return}if(n.stepCount>s){try{await this.onStepRun(n,s);}catch(u){w.error("Error running onStepStart",u),this.onStepError&&this.onStepError(u,e);return}let o=n.getStepById(s);if(!o){w.error("step not found");return}let a=n.getStepSha(s);a||(w.warn("stepSha not found, setting to ERROR"),a="error");try{H.stepsRunning++;let u=await o(e,{labelId:n.id}),l=this.choiceMenuOptions;if(l?.length===1&&l[0].autoSelect){let h=l[0];u=await this.selectChoice(h,e);}let c=H.lastHistoryStep;if(i!==void 0&&c){let h=c.stepSha1;h||(w.warn("stepSha not found, setting to ERROR"),h="error"),H.addChoicesMade(c.currentLabel||"error",typeof c.labelStepIndex=="number"?c.labelStepIndex:-1,c.stepSha1||"error",i),H.choiceMadeTemp=i;}return H.stepsRunning--,H.stepsRunning===0&&(H.addLabelHistory(n.id,s),this.addStepHistory(a,{...t,choiceMade:H.choiceMadeTemp}),H.choiceMadeTemp=void 0,H.goNextRequests>0)?(H.goNextRequests--,await this.goNext(e)):u}catch(u){H.stepsRunning>0&&H.stepsRunning--,w.error("Error running step",u),this.onStepError&&this.onStepError(u,e);return}}else {if(this.openedLabels.length>1)return this.closeCurrentLabel(),await this.goNext(e,t);if(this.openedLabels.length===1)return H.openedLabels=[],this.onGameEnd?await this.onGameEnd(e,{labelId:"end"}):void 0}}else if(this.openedLabels.length===0){if(H.openedLabels=H.originalOpenedLabels,this.onGameEnd)return await this.onGameEnd(e,{labelId:"end"});w.error("The end of the game is not managed, so the game is blocked. Read this documentation to know how to manage the end of the game: https://pixi-vn.web.app/start/other-narrative-features.html#how-manage-the-end-of-the-game");return}else w.error("currentLabelId not found");}async callLabel(e,t,i){let{choiceMade:s}=i||{},n;typeof e=="string"?n=e:n=e.id;try{let o=Tr.get(n);if(!o)throw new Error(`[Pixi\u2019VN] Label ${n} not found`);try{this.currentLabel&&await this.onStepEnd(this.currentLabel,H.currentLabelStepIndex||0);}catch(a){w.error("Error running onStepEnd",a);}H.pushNewLabel(o.id);}catch(o){w.error("Error calling label",o);return}return await this.runCurrentStep(t,{choiceMade:s})}async jumpLabel(e,t,i){this.openedLabels.length>0&&this.closeCurrentLabel();let{choiceMade:s}=i||{},n;typeof e=="string"?n=e:n=e.id;try{let o=Tr.get(n);if(!o)throw new Error(`[Pixi\u2019VN] Label ${n} not found`);try{this.currentLabel&&await this.onStepEnd(this.currentLabel,H.currentLabelStepIndex||0);}catch(a){w.error("Error running onStepEnd",a);}H.pushNewLabel(o.id);}catch(o){w.error("Error jumping label",o);return}return await this.runCurrentStep(t,{choiceMade:s})}async selectChoice(e,t){this.choiceMenuOptions=void 0;let i=e.type;switch(i){case "call":return await this.callLabel(e.label,{...e.props,...t},{choiceMade:e.choiceIndex});case "jump":return await this.jumpLabel(e.label,{...e.props,...t},{choiceMade:e.choiceIndex});case "close":return await this.closeChoiceMenu(e,{...e.props,...t});default:throw w.error(`Type ${i} not found`),new Error(`[Pixi\u2019VN] Type ${i} not found`)}}async closeChoiceMenu(e,t){if(e.type!=="close")throw w.error("For closeChoiceMenu, the type must be close"),new Error("[Pixi\u2019VN] For closeChoiceMenu, the type must be close");let i;return typeof e.choiceIndex=="number"&&(i=e.choiceIndex),e.closeCurrentLabel&&this.closeCurrentLabel(),this.goNext(t,{choiceMade:i})}get onGameEnd(){return W.onEnd}set onGameEnd(e){W.onEnd=e;}get onStepError(){let e=W.onError;return e?(t,i)=>e("step",t,i):void 0}set onStepError(e){W.onError=(t,i,s)=>e(i,s);}get dialogue(){let e=W.getVariable(le.CURRENT_DIALOGUE_MEMORY_KEY);if(e)return {...e,character:e.character?W.getCharacter(e.character)||e.character:void 0}}set dialogue(e){if(!e){W.setVariable(le.CURRENT_DIALOGUE_MEMORY_KEY,void 0);return}if((typeof e=="string"||Array.isArray(e))&&(e={text:e}),this.dialogGlue){let t=W.getVariable(le.CURRENT_DIALOGUE_MEMORY_KEY);if(t){let i=[];Array.isArray(t.text)?i=[...t.text]:i=[t.text],Array.isArray(e.text)?i=[...i,...e.text]:i=[...i,e.text],e.text=i,e.character=e.character||t.character;}W.setVariable(le.LAST_STEP_GLUED,this.stepCounter),this.dialogGlue=false;}try{W.setVariable(le.CURRENT_DIALOGUE_MEMORY_KEY,fe({...e,character:typeof e.character=="string"?e.character:e.character?.id})),W.setVariable(le.LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY,this.stepCounter);}catch(t){throw w.error("DialogueInterface cannot contain functions or classes"),t}}get choiceMenuOptions(){let e=W.getVariable(le.CURRENT_MENU_OPTIONS_MEMORY_KEY);if(e){let t=[],i=e.map((n,o)=>({...n,choiceIndex:o})),s=this.alreadyCurrentStepMadeChoices;if(i=i.filter((n,o)=>n.oneTime&&s&&s.includes(o)?false:n.onlyHaveNoChoice?(t.push(n),false):true),i.length>0)return i;if(t.length>0)return [t[0]]}}set choiceMenuOptions(e){if(!e||e.length===0){W.setVariable(le.CURRENT_MENU_OPTIONS_MEMORY_KEY,void 0);return}let t=e.map(i=>i instanceof Ja?{...i.devProps,text:i.text,type:Qa,closeCurrentLabel:i.closeCurrentLabel,oneTime:i.oneTime,onlyHaveNoChoice:i.onlyHaveNoChoice,autoSelect:i.autoSelect,props:i.props}:i instanceof Za?{...i.devProps,type:i.type,text:i.text,label:i.label.id,autoSelect:i.autoSelect,oneTime:i.oneTime,onlyHaveNoChoice:i.onlyHaveNoChoice,props:i.props}:i);try{W.setVariable(le.CURRENT_MENU_OPTIONS_MEMORY_KEY,fe(t)),W.setVariable(le.LAST_MENU_OPTIONS_ADDED_IN_STEP_MEMORY_KEY,this.stepCounter);}catch(i){throw w.error("ChoiceInterface cannot contain functions or classes"),i}}get dialogGlue(){return W.getFlag(le.ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY)}set dialogGlue(e){W.setFlag(le.ADD_NEXT_DIALOG_TEXT_INTO_THE_CURRENT_DIALOG_FLAG_KEY,e);}get inputValue(){return W.getVariable(le.CURRENT_INPUT_VALUE_MEMORY_KEY)}set inputValue(e){this.removeInputRequest(),W.setVariable(le.CURRENT_INPUT_VALUE_MEMORY_KEY,e),W.setVariable(le.LAST_INPUT_ADDED_IN_STEP_MEMORY_KEY,this.stepCounter);}get isRequiredInput(){return W.getVariable(le.CURRENT_INPUT_INFO_MEMORY_KEY)?.isRequired||false}get inputType(){return W.getVariable(le.CURRENT_INPUT_INFO_MEMORY_KEY)?.type}requestInput(e,t){e.isRequired=true,W.setVariable(le.CURRENT_INPUT_INFO_MEMORY_KEY,e),t!==void 0?W.setVariable(le.CURRENT_INPUT_VALUE_MEMORY_KEY,t):W.removeVariable(le.CURRENT_INPUT_VALUE_MEMORY_KEY);}removeInputRequest(){W.removeVariable(le.CURRENT_INPUT_INFO_MEMORY_KEY),W.removeVariable(le.CURRENT_INPUT_VALUE_MEMORY_KEY);}clear(){H.openedLabels=[],H._stepCounter=0;}export(){return {openedLabels:fe(H.openedLabels),stepCounter:this.stepCounter}}async onLoadingLabel(e){let t=this.openedLabels.map(async i=>{let s=[],n=Tr.get(i.label);return n&&(n.onLoadingLabel&&s.push(n.onLoadingLabel(e,n)),H.onLoadingLabel&&s.push(H.onLoadingLabel(e,n))),await Promise.all(s)});return await Promise.all(t)}async restore(e,t){this.clear();try{H.lastHistoryStep=t,e.hasOwnProperty("openedLabels")?(H.openedLabels=e.openedLabels,H.originalOpenedLabels=H.openedLabels):w.warn("Could not import openedLabels data, so will be ignored"),e.hasOwnProperty("stepCounter")?H._stepCounter=e.stepCounter:e.hasOwnProperty("lastStepIndex")?H._stepCounter=e.lastStepIndex:w.warn("Could not import stepCounter data, so will be ignored");try{await this.onLoadingLabel(H.currentLabelStepIndex||0);}catch(i){w.error("Error running onLoadingLabel",i);}}catch(i){w.error("Error importing data",i);}}};function wC(r,e,t){let i=new Ss(r,e,t);return Tr.add(i),i}var Es=new Mf;var MC={};Zi(MC,{Sound:()=>Wn,SoundManagerStatic:()=>se,sound:()=>Xn});var se=class{constructor(){}};R(se,"soundAliasesOrder",[]),R(se,"soundsPlaying",{}),R(se,"sounds",{});var Wn=class r extends Br{constructor(){super(...arguments);R(this,"alias");}pause(){if(!this.alias)throw new Error("[Pixi\u2019VN] The alias is not defined.");let t=se.soundsPlaying[this.alias];if(!t)throw new Error("[Pixi\u2019VN] The alias is not found in the playInStepIndex.");return se.soundsPlaying[this.alias]={...t,paused:true},super.pause()}resume(){if(!this.alias)throw new Error("[Pixi\u2019VN] The alias is not defined.");let t=se.soundsPlaying[this.alias];if(!t)throw new Error("[Pixi\u2019VN] The alias is not found in the playInStepIndex.");return se.soundsPlaying[this.alias]={options:t.options,stepIndex:W.stepCounter,paused:false},super.resume()}destroy(){return this.alias&&delete se.soundsPlaying[this.alias],super.destroy()}stop(){if(!this.alias)throw new Error("[Pixi\u2019VN] The alias is not defined.");return delete se.soundsPlaying[this.alias],super.stop()}play(t){if(typeof t=="string"&&(this.alias=t),!this.alias)throw new Error("[Pixi\u2019VN] The alias is not defined.");return se.soundsPlaying[this.alias]={stepIndex:W.stepCounter,options:t,paused:false},super.play(t)}static from(t){let i=Br.from(t);return new r(i.media,i.options)}};function If(r){let e=[];for(let t of r)t.type==="TelephoneFilter"?e.push(new Xe.TelephoneFilter):t.type==="StreamFilter"?e.push(new Xe.StreamFilter):t.type==="StereoFilter"?e.push(new Xe.StereoFilter(t.pan)):t.type==="ReverbFilter"?e.push(new Xe.ReverbFilter(t.seconds,t.decay,t.reverse)):t.type==="MonoFilter"?e.push(new Xe.MonoFilter):t.type==="EqualizerFilter"?e.push(new Xe.EqualizerFilter(t.f32,t.f64,t.f125,t.f250,t.f500,t.f1k,t.f2k,t.f4k,t.f8k,t.f16k)):t.type==="DistortionFilter"?e.push(new Xe.DistortionFilter(t.amount)):w.error("Unknown sound filter type");return e}function RC(r){if(!r)return;let e=[];for(let t of r)t instanceof Xe.TelephoneFilter?e.push({type:"TelephoneFilter"}):t instanceof Xe.StreamFilter?e.push({type:"StreamFilter"}):t instanceof Xe.StereoFilter?e.push({type:"StereoFilter",pan:t.pan}):t instanceof Xe.ReverbFilter?e.push({type:"ReverbFilter",seconds:t.seconds,decay:t.decay,reverse:t.reverse}):t instanceof Xe.MonoFilter?e.push({type:"MonoFilter"}):t instanceof Xe.EqualizerFilter?e.push({type:"EqualizerFilter",f32:t.f32,f64:t.f64,f125:t.f125,f250:t.f250,f500:t.f500,f1k:t.f1k,f2k:t.f2k,f4k:t.f4k,f8k:t.f8k,f16k:t.f16k}):t instanceof Xe.DistortionFilter?e.push({type:"DistortionFilter",amount:t.amount}):w.error("Unknown sound filter type");return e}var Df=class extends cc{constructor(){super();}get context(){return we.context}get filtersAll(){return we.filtersAll}set filtersAll(e){we.filtersAll=e.filter(t=>!(t instanceof Xe.Filter));}get supported(){return we.supported}getOptions(e,t){let i;return typeof e=="string"?i={url:e}:Array.isArray(e)?i={url:e}:e instanceof ArrayBuffer||e instanceof AudioBuffer||e instanceof HTMLAudioElement?i={source:e}:i=e,i={...i,...t||{}},i}add(e,t){if(typeof e=="object")throw new Error("[Pixi\u2019VN] The method add(map: SoundSourceMap, globalOptions?: Options) is deprecated. Use add(alias: string, options: Options | string | ArrayBuffer | AudioBuffer | HTMLAudioElement | Sound): Sound; instead.");this.exists(e)&&this.remove(e),t instanceof Br&&(t=t.options);let i;if(t instanceof Wn)i=t;else {let s=this.getOptions(t||{});i=Wn.from(s);}return i.alias=e,!se.soundAliasesOrder.includes(e)&&se.soundAliasesOrder.push(e),se.sounds[e]=i,we.add(e,i),i}get useLegacy(){return we.useLegacy}set useLegacy(e){we.useLegacy=e;}get disableAutoPause(){return we.disableAutoPause}set disableAutoPause(e){we.disableAutoPause=e;}remove(e){return se.soundAliasesOrder=se.soundAliasesOrder.filter(t=>t!==e),delete se.soundsPlaying[e],delete se.sounds[e],we.remove(e)}get volumeAll(){return we.volumeAll}set volumeAll(e){we.volumeAll=e;}get speedAll(){return we.speedAll}set speedAll(e){we.speedAll=e;}togglePauseAll(){return we.togglePauseAll()}pauseAll(){return we.pauseAll()}resumeAll(){return we.resumeAll()}toggleMuteAll(){return we.toggleMuteAll()}muteAll(){return we.muteAll()}unmuteAll(){return we.unmuteAll()}removeAll(){return se.soundAliasesOrder=[],se.soundsPlaying={},se.sounds={},we.removeAll()}stopAll(){for(let e in se.sounds)se.sounds[e].stop();return se.soundsPlaying={},we.stopAll()}exists(e,t){return we.exists(e,t)||e in se.sounds}isPlaying(){return we.isPlaying()}find(e){let t=se.sounds[e];return t||(t=we.find(e),t&&(se.sounds[e]=t),t)}play(e,t){if(!this.exists(e))throw new Error("[Pixi\u2019VN] The alias is not found in the sound library.");return se.soundsPlaying[e]={stepIndex:W.stepCounter,options:t,paused:false},we.play(e,t)}stop(e){return delete se.soundsPlaying[e],we.stop(e)}pause(e){let t=se.soundsPlaying[e];if(!t)throw new Error("[Pixi\u2019VN] The alias is not found in the playInStepIndex.");return se.soundsPlaying[e]={...t,paused:true},we.pause(e)}resume(e){let t=se.soundsPlaying[e];if(!t)throw new Error("[Pixi\u2019VN] The alias is not found in the playInStepIndex.");return se.soundsPlaying[e]={options:t.options,stepIndex:W.stepCounter,paused:false},we.resume(e)}volume(e,t){return we.volume(e,t)}speed(e,t){return we.speed(e,t)}duration(e){return we.duration(e)}close(){return we.close()}clear(){this.stopAll();}export(){let e={};for(let t in se.soundsPlaying){let i=se.soundsPlaying[t],s=this.find(t);s&&(e[t]={...i,sound:{options:{...s.options,autoPlay:s.autoPlay,loop:s.loop,preload:s.preload,singleInstance:s.singleInstance,url:s.options.url,volume:s.options.volume},filters:RC(s.media.filters)}});}return {soundsPlaying:fe(e),soundAliasesOrder:fe(se.soundAliasesOrder),filters:fe(RC(this.filtersAll))}}removeOldSoundAndExport(){return this.export()}restore(e){let t=W.stepCounter-1;this.clear();try{if(e.hasOwnProperty("soundAliasesOrder"))se.soundAliasesOrder=e.soundAliasesOrder;else {w.error("The data does not have the properties soundAliasesOrder");return}if(e.hasOwnProperty("filters")){let i=e.filters;i&&(this.filtersAll=If(i));}if(e.hasOwnProperty("playInStepIndex")){let i=e.playInStepIndex;i&&(se.soundsPlaying=i);}if(e.hasOwnProperty("sounds")){let i=e.sounds;for(let s in i){let n=i[s],o=!1,a=this.add(s,{...n.options,autoPlay:!1});if(s in se.soundsPlaying){let u=se.soundsPlaying[s];(n.options.loop||u.options&&typeof u.options=="object"&&u.options.loop||u.stepIndex===t)&&(o=!0),n.filters&&(a.filters=If(n.filters)),o&&a.play();}}}if(e.hasOwnProperty("soundsPlaying")){let i=e.soundsPlaying;for(let s in i){let n=i[s];se.soundsPlaying[s]={paused:n.paused,stepIndex:n.stepIndex,options:n.options};let o=i[s].sound,a=!1,u;if(this.exists(s)?(u=this.find(s),o.options.url=u.options.url,o.options.volume=u.options.volume,u.options=o.options,u.autoPlay=!1,u.filters=o.filters?If(o.filters):[]):u=this.add(s,{...o.options,autoPlay:!1}),s in se.soundsPlaying){let l=se.soundsPlaying[s];(o.options.loop||l.options&&typeof l.options=="object"&&l.options.loop||l.stepIndex===t)&&(a=!0),o.filters&&(u.filters=If(o.filters)),a&&u.play();}}}else {w.error("The data does not have the properties soundsPlaying");return}}catch(i){w.error("Error importing data",i);}}};var Xn=new Df;De();function _I(){console.info(`
3311
3311
  _______ _ _ _ ____ ____ ____ _____
3312
3312
  |_ __ \\ (_) (_) | | |_ _| |_ _||_ \\|_ _|
3313
3313
  | |__) |__ _ __ __ \\_| \\ \\ / / | \\ | |