@drincs/pixi-vn 1.4.2 → 1.4.4
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/canvas.cjs +2 -2
- package/dist/canvas.mjs +1 -1
- package/dist/characters.cjs +1 -1
- package/dist/characters.mjs +1 -1
- package/dist/chunk-GFG3MDHE.mjs +1 -0
- package/dist/{chunk-IKZP57DP.mjs → chunk-TIA4D2N7.mjs} +1 -1
- package/dist/history.cjs +1 -1
- package/dist/history.d.cts +1 -1
- package/dist/history.d.ts +1 -1
- package/dist/history.mjs +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +2 -2
- package/dist/narration.cjs +1 -1
- package/dist/narration.mjs +1 -1
- package/dist/pixi.d.ts +3 -0
- package/dist/{pixi.js.mjs → pixi.js} +143 -143
- package/dist/storage.cjs +1 -1
- package/dist/storage.mjs +1 -1
- package/package.json +6 -6
- package/dist/chunk-YDXQLPAR.mjs +0 -1
- package/dist/pixi.js.cjs +0 -3395
- package/dist/pixi.js.d.cts +0 -1
- package/dist/pixi.js.d.ts +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var dA=Object.create;var qd=Object.defineProperty;var fA=Object.getOwnPropertyDescriptor;var pA=Object.getOwnPropertyNames;var mA=Object.getPrototypeOf,gA=Object.prototype.hasOwnProperty;var p=(r,e)=>()=>(r&&(e=r(r=0)),e);var Wr=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),xv=(r,e)=>{for(var t in e)qd(r,t,{get:e[t],enumerable:true});},xA=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of pA(e))!gA.call(r,s)&&s!==t&&qd(r,s,{get:()=>e[s],enumerable:!(i=fA(e,s))||i.enumerable});return r};var Kd=(r,e,t)=>(t=r!=null?dA(mA(r)):{},xA(qd(t,"default",{value:r,enumerable:true}),r));var m,Zd,Go,G,S=p(()=>{m=(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))(m||{}),Zd=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},Go=(r,e)=>Zd(r).priority??e,G={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...r){return r.map(Zd).forEach(e=>{e.type.forEach(t=>this._removeHandlers[t]?.(e));}),this},add(...r){return r.map(Zd).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)=>Go(o.value,t)-Go(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)=>Go(n,t)-Go(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 bv=Wr((YB,Qd)=>{var _A=Object.prototype.hasOwnProperty,at="~";function Uo(){}Object.create&&(Uo.prototype=Object.create(null),new Uo().__proto__||(at=false));function bA(r,e,t){this.fn=r,this.context=e,this.once=t||false;}function _v(r,e,t,i,s){if(typeof t!="function")throw new TypeError("The listener must be a function");var n=new bA(t,i||r,s),o=at?at+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 cl(r,e){--r._eventsCount===0?r._events=new Uo:delete r._events[e];}function Je(){this._events=new Uo,this._eventsCount=0;}Je.prototype.eventNames=function(){var e=[],t,i;if(this._eventsCount===0)return e;for(i in t=this._events)_A.call(t,i)&&e.push(at?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e};Je.prototype.listeners=function(e){var t=at?at+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};Je.prototype.listenerCount=function(e){var t=at?at+e:e,i=this._events[t];return i?i.fn?1:i.length:0};Je.prototype.emit=function(e,t,i,s,n,o){var a=at?at+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,f;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(f=1,c=new Array(l-1);f<l;f++)c[f-1]=arguments[f];u[h].fn.apply(u[h].context,c);}}return true};Je.prototype.on=function(e,t,i){return _v(this,e,t,i,false)};Je.prototype.once=function(e,t,i){return _v(this,e,t,i,true)};Je.prototype.removeListener=function(e,t,i,s){var n=at?at+e:e;if(!this._events[n])return this;if(!t)return cl(this,n),this;var o=this._events[n];if(o.fn)o.fn===t&&(!s||o.once)&&(!i||o.context===i)&&cl(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:cl(this,n);}return this};Je.prototype.removeAllListeners=function(e){var t;return e?(t=at?at+e:e,this._events[t]&&cl(this,t)):(this._events=new Uo,this._eventsCount=0),this};Je.prototype.off=Je.prototype.removeListener;Je.prototype.addListener=Je.prototype.on;Je.prefixed=at;Je.EventEmitter=Je;typeof Qd<"u"&&(Qd.exports=Je);});var yv,fe,je=p(()=>{yv=Kd(bv()),fe=yv.default;});var yA,_r,Xe,Ft,Pv,vv,Jd,vA,hl,Bv,Rv,Tv,Sv,Ev,Io,TA,SA,EA,AA,rf,Av,CA,ef,tf,Cv,sf,Ot,wv,Mv,Dv=p(()=>{yA={grad:.9,turn:360,rad:360/(2*Math.PI)},_r=function(r){return typeof r=="string"?r.length>0:typeof r=="number"},Xe=function(r,e,t){return e===void 0&&(e=0),t===void 0&&(t=Math.pow(10,e)),Math.round(t*r)/t+0},Ft=function(r,e,t){return e===void 0&&(e=0),t===void 0&&(t=1),r>t?t:r>e?r:e},Pv=function(r){return (r=isFinite(r)?r%360:0)>0?r:r+360},vv=function(r){return {r:Ft(r.r,0,255),g:Ft(r.g,0,255),b:Ft(r.b,0,255),a:Ft(r.a)}},Jd=function(r){return {r:Xe(r.r),g:Xe(r.g),b:Xe(r.b),a:Xe(r.a,3)}},vA=/^#([0-9a-f]{3,8})$/i,hl=function(r){var e=r.toString(16);return e.length<2?"0"+e:e},Bv=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}},Rv=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}},Tv=function(r){return {h:Pv(r.h),s:Ft(r.s,0,100),l:Ft(r.l,0,100),a:Ft(r.a)}},Sv=function(r){return {h:Xe(r.h),s:Xe(r.s),l:Xe(r.l),a:Xe(r.a,3)}},Ev=function(r){return Rv((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;},Io=function(r){return {h:(e=Bv(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;},TA=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,SA=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,EA=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,AA=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,rf={string:[[function(r){var e=vA.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?Xe(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?Xe(parseInt(r.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(r){var e=EA.exec(r)||AA.exec(r);return e?e[2]!==e[4]||e[4]!==e[6]?null:vv({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=TA.exec(r)||SA.exec(r);if(!e)return null;var t,i,s=Tv({h:(t=e[1],i=e[2],i===void 0&&(i="deg"),Number(t)*(yA[i]||1)),s:Number(e[3]),l:Number(e[4]),a:e[5]===void 0?1:Number(e[5])/(e[6]?100:1)});return Ev(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 _r(e)&&_r(t)&&_r(i)?vv({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(!_r(e)||!_r(t)||!_r(i))return null;var o=Tv({h:Number(e),s:Number(t),l:Number(i),a:Number(n)});return Ev(o)},"hsl"],[function(r){var e=r.h,t=r.s,i=r.v,s=r.a,n=s===void 0?1:s;if(!_r(e)||!_r(t)||!_r(i))return null;var o=(function(a){return {h:Pv(a.h),s:Ft(a.s,0,100),v:Ft(a.v,0,100),a:Ft(a.a)}})({h:Number(e),s:Number(t),v:Number(i),a:Number(n)});return Rv(o)},"hsv"]]},Av=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]},CA=function(r){return typeof r=="string"?Av(r.trim(),rf.string):typeof r=="object"&&r!==null?Av(r,rf.object):[null,void 0]},ef=function(r,e){var t=Io(r);return {h:t.h,s:Ft(t.s+100*e,0,100),l:t.l,a:t.a}},tf=function(r){return (299*r.r+587*r.g+114*r.b)/1e3/255},Cv=function(r,e){var t=Io(r);return {h:t.h,s:t.s,l:Ft(t.l+100*e,0,100),a:t.a}},sf=(function(){function r(e){this.parsed=CA(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 Xe(tf(this.rgba),2)},r.prototype.isDark=function(){return tf(this.rgba)<.5},r.prototype.isLight=function(){return tf(this.rgba)>=.5},r.prototype.toHex=function(){return e=Jd(this.rgba),t=e.r,i=e.g,s=e.b,o=(n=e.a)<1?hl(Xe(255*n)):"","#"+hl(t)+hl(i)+hl(s)+o;var e,t,i,s,n,o;},r.prototype.toRgb=function(){return Jd(this.rgba)},r.prototype.toRgbString=function(){return e=Jd(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 Sv(Io(this.rgba))},r.prototype.toHslString=function(){return e=Sv(Io(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=Bv(this.rgba),{h:Xe(e.h),s:Xe(e.s),v:Xe(e.v),a:Xe(e.a,3)};var e;},r.prototype.invert=function(){return Ot({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),Ot(ef(this.rgba,e))},r.prototype.desaturate=function(e){return e===void 0&&(e=.1),Ot(ef(this.rgba,-e))},r.prototype.grayscale=function(){return Ot(ef(this.rgba,-1))},r.prototype.lighten=function(e){return e===void 0&&(e=.1),Ot(Cv(this.rgba,e))},r.prototype.darken=function(e){return e===void 0&&(e=.1),Ot(Cv(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"?Ot({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):Xe(this.rgba.a,3);var t;},r.prototype.hue=function(e){var t=Io(this.rgba);return typeof e=="number"?Ot({h:e,s:t.s,l:t.l,a:t.a}):Xe(t.h)},r.prototype.isEqual=function(e){return this.toHex()===Ot(e).toHex()},r})(),Ot=function(r){return r instanceof sf?r:new sf(r)},wv=[],Mv=function(r){r.forEach(function(e){wv.indexOf(e)<0&&(e(sf,rf),wv.push(e));});};});function Fv(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 f in t)n[f]=new r(t[f]).toRgb();for(var g in t){var _=(a=c,u=n[g],Math.pow(a.r-u.r,2)+Math.pow(a.g-u.g,2)+Math.pow(a.b-u.b,2));_<h&&(h=_,d=g);}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 Gv=p(()=>{});var ws,H,ke=p(()=>{Dv();Gv();Mv([Fv]);ws=class Oo{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 Oo)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]=Oo._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=Oo.HEX_PATTERN.exec(e);a&&(e=`#${a[2]}`);}let o=Ot(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 Oo||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}};ws.shared=new ws;ws._temp=new ws;ws.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;H=ws;});var nf,of=p(()=>{nf={cullArea:null,cullable:false,cullableChildren:true};});var af,uf,lf,dl=p(()=>{af=Math.PI*2,uf=180/Math.PI,lf=Math.PI/180;});var q,cf,bt=p(()=>{q=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 cf.x=0,cf.y=0,cf}},cf=new q;});var P,wA,PA,K=p(()=>{dl();bt();P=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 q;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 q;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(af-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 PA.identity()}static get shared(){return wA.identity()}},wA=new P,PA=new P;});var he,Xr=p(()=>{he=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 W(r="default"){return ko[r]===void 0&&(ko[r]=-1),++ko[r]}function BA(){for(let r in ko)delete ko[r];}var ko,Me=p(()=>{ko={default:-1};});var Uv,O,hf,Ps,w,re=p(()=>{Uv=new Set,O="8.0.0",hf="8.3.4",Ps={quiet:false,noColor:false},w=(r,e,t=3)=>{if(Ps.quiet||Uv.has(e))return;let i=new Error().stack,s=`${e}
|
|
2
|
-
Deprecated since v${r}`,n=typeof console.groupCollapsed=="function"&&!
|
|
1
|
+
var f3=Object.create;var Vg=Object.defineProperty;var p3=Object.getOwnPropertyDescriptor;var m3=Object.getOwnPropertyNames;var g3=Object.getPrototypeOf,x3=Object.prototype.hasOwnProperty;var p=(r,e)=>()=>(r&&(e=r(r=0)),e);var Jr=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),zg=(r,e)=>{for(var t in e)Vg(r,t,{get:e[t],enumerable:true});},_3=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of m3(e))!x3.call(r,s)&&s!==t&&Vg(r,s,{get:()=>e[s],enumerable:!(i=p3(e,s))||i.enumerable});return r};var Wg=(r,e,t)=>(t=r!=null?f3(g3(r)):{},_3(Vg(t,"default",{value:r,enumerable:true}),r));var m,Xg,Kn,G,S=p(()=>{m=(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))(m||{}),Xg=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},Kn=(r,e)=>Xg(r).priority??e,G={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...r){return r.map(Xg).forEach(e=>{e.type.forEach(t=>this._removeHandlers[t]?.(e));}),this},add(...r){return r.map(Xg).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)=>Kn(o.value,t)-Kn(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)=>Kn(n,t)-Kn(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 kv=Jr(($B,Yg)=>{var b3=Object.prototype.hasOwnProperty,gt="~";function nu(){}Object.create&&(nu.prototype=Object.create(null),new nu().__proto__||(gt=false));function y3(r,e,t){this.fn=r,this.context=e,this.once=t||false;}function Ov(r,e,t,i,s){if(typeof t!="function")throw new TypeError("The listener must be a function");var n=new y3(t,i||r,s),o=gt?gt+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 Hc(r,e){--r._eventsCount===0?r._events=new nu:delete r._events[e];}function nt(){this._events=new nu,this._eventsCount=0;}nt.prototype.eventNames=function(){var e=[],t,i;if(this._eventsCount===0)return e;for(i in t=this._events)b3.call(t,i)&&e.push(gt?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e};nt.prototype.listeners=function(e){var t=gt?gt+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};nt.prototype.listenerCount=function(e){var t=gt?gt+e:e,i=this._events[t];return i?i.fn?1:i.length:0};nt.prototype.emit=function(e,t,i,s,n,o){var a=gt?gt+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,f;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(f=1,c=new Array(l-1);f<l;f++)c[f-1]=arguments[f];u[h].fn.apply(u[h].context,c);}}return true};nt.prototype.on=function(e,t,i){return Ov(this,e,t,i,false)};nt.prototype.once=function(e,t,i){return Ov(this,e,t,i,true)};nt.prototype.removeListener=function(e,t,i,s){var n=gt?gt+e:e;if(!this._events[n])return this;if(!t)return Hc(this,n),this;var o=this._events[n];if(o.fn)o.fn===t&&(!s||o.once)&&(!i||o.context===i)&&Hc(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:Hc(this,n);}return this};nt.prototype.removeAllListeners=function(e){var t;return e?(t=gt?gt+e:e,this._events[t]&&Hc(this,t)):(this._events=new nu,this._eventsCount=0),this};nt.prototype.off=nt.prototype.removeListener;nt.prototype.addListener=nt.prototype.on;nt.prefixed=gt;nt.EventEmitter=nt;typeof Yg<"u"&&(Yg.exports=nt);});var Lv,fe,Ke=p(()=>{Lv=Wg(kv()),fe=Lv.default;});var v3,Rr,Xe,Gt,$v,Nv,$g,T3,Vc,jv,qv,Hv,Vv,zv,ou,S3,E3,A3,C3,Kg,Wv,w3,jg,qg,Xv,Zg,$t,Yv,Kv,Zv=p(()=>{v3={grad:.9,turn:360,rad:360/(2*Math.PI)},Rr=function(r){return typeof r=="string"?r.length>0:typeof r=="number"},Xe=function(r,e,t){return e===void 0&&(e=0),t===void 0&&(t=Math.pow(10,e)),Math.round(t*r)/t+0},Gt=function(r,e,t){return e===void 0&&(e=0),t===void 0&&(t=1),r>t?t:r>e?r:e},$v=function(r){return (r=isFinite(r)?r%360:0)>0?r:r+360},Nv=function(r){return {r:Gt(r.r,0,255),g:Gt(r.g,0,255),b:Gt(r.b,0,255),a:Gt(r.a)}},$g=function(r){return {r:Xe(r.r),g:Xe(r.g),b:Xe(r.b),a:Xe(r.a,3)}},T3=/^#([0-9a-f]{3,8})$/i,Vc=function(r){var e=r.toString(16);return e.length<2?"0"+e:e},jv=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}},qv=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}},Hv=function(r){return {h:$v(r.h),s:Gt(r.s,0,100),l:Gt(r.l,0,100),a:Gt(r.a)}},Vv=function(r){return {h:Xe(r.h),s:Xe(r.s),l:Xe(r.l),a:Xe(r.a,3)}},zv=function(r){return qv((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;},ou=function(r){return {h:(e=jv(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;},S3=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,E3=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,A3=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,C3=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Kg={string:[[function(r){var e=T3.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?Xe(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?Xe(parseInt(r.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(r){var e=A3.exec(r)||C3.exec(r);return e?e[2]!==e[4]||e[4]!==e[6]?null:Nv({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=S3.exec(r)||E3.exec(r);if(!e)return null;var t,i,s=Hv({h:(t=e[1],i=e[2],i===void 0&&(i="deg"),Number(t)*(v3[i]||1)),s:Number(e[3]),l:Number(e[4]),a:e[5]===void 0?1:Number(e[5])/(e[6]?100:1)});return zv(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 Rr(e)&&Rr(t)&&Rr(i)?Nv({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(!Rr(e)||!Rr(t)||!Rr(i))return null;var o=Hv({h:Number(e),s:Number(t),l:Number(i),a:Number(n)});return zv(o)},"hsl"],[function(r){var e=r.h,t=r.s,i=r.v,s=r.a,n=s===void 0?1:s;if(!Rr(e)||!Rr(t)||!Rr(i))return null;var o=(function(a){return {h:$v(a.h),s:Gt(a.s,0,100),v:Gt(a.v,0,100),a:Gt(a.a)}})({h:Number(e),s:Number(t),v:Number(i),a:Number(n)});return qv(o)},"hsv"]]},Wv=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]},w3=function(r){return typeof r=="string"?Wv(r.trim(),Kg.string):typeof r=="object"&&r!==null?Wv(r,Kg.object):[null,void 0]},jg=function(r,e){var t=ou(r);return {h:t.h,s:Gt(t.s+100*e,0,100),l:t.l,a:t.a}},qg=function(r){return (299*r.r+587*r.g+114*r.b)/1e3/255},Xv=function(r,e){var t=ou(r);return {h:t.h,s:t.s,l:Gt(t.l+100*e,0,100),a:t.a}},Zg=(function(){function r(e){this.parsed=w3(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 Xe(qg(this.rgba),2)},r.prototype.isDark=function(){return qg(this.rgba)<.5},r.prototype.isLight=function(){return qg(this.rgba)>=.5},r.prototype.toHex=function(){return e=$g(this.rgba),t=e.r,i=e.g,s=e.b,o=(n=e.a)<1?Vc(Xe(255*n)):"","#"+Vc(t)+Vc(i)+Vc(s)+o;var e,t,i,s,n,o;},r.prototype.toRgb=function(){return $g(this.rgba)},r.prototype.toRgbString=function(){return e=$g(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 Vv(ou(this.rgba))},r.prototype.toHslString=function(){return e=Vv(ou(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=jv(this.rgba),{h:Xe(e.h),s:Xe(e.s),v:Xe(e.v),a:Xe(e.a,3)};var e;},r.prototype.invert=function(){return $t({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),$t(jg(this.rgba,e))},r.prototype.desaturate=function(e){return e===void 0&&(e=.1),$t(jg(this.rgba,-e))},r.prototype.grayscale=function(){return $t(jg(this.rgba,-1))},r.prototype.lighten=function(e){return e===void 0&&(e=.1),$t(Xv(this.rgba,e))},r.prototype.darken=function(e){return e===void 0&&(e=.1),$t(Xv(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"?$t({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):Xe(this.rgba.a,3);var t;},r.prototype.hue=function(e){var t=ou(this.rgba);return typeof e=="number"?$t({h:e,s:t.s,l:t.l,a:t.a}):Xe(t.h)},r.prototype.isEqual=function(e){return this.toHex()===$t(e).toHex()},r})(),$t=function(r){return r instanceof Zg?r:new Zg(r)},Yv=[],Kv=function(r){r.forEach(function(e){Yv.indexOf(e)<0&&(e(Zg,Kg),Yv.push(e));});};});function Qv(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 f in t)n[f]=new r(t[f]).toRgb();for(var g in t){var _=(a=c,u=n[g],Math.pow(a.r-u.r,2)+Math.pow(a.g-u.g,2)+Math.pow(a.b-u.b,2));_<h&&(h=_,d=g);}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 Jv=p(()=>{});var Zn,H,Ne=p(()=>{Zv();Jv();Kv([Qv]);Zn=class au{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 au)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]=au._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=au.HEX_PATTERN.exec(e);a&&(e=`#${a[2]}`);}let o=$t(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 au||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}};Zn.shared=new Zn;Zn._temp=new Zn;Zn.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;H=Zn;});var zc,Qg=p(()=>{zc={cullArea:null,cullable:false,cullableChildren:true};});var Wc,Xc,Yc,$c=p(()=>{Wc=Math.PI*2,Xc=180/Math.PI,Yc=Math.PI/180;});var q,Jg,vt=p(()=>{q=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 Jg.x=0,Jg.y=0,Jg}},Jg=new q;});var P,P3,B3,K=p(()=>{$c();vt();P=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 q;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 q;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(Wc-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 B3.identity()}static get shared(){return P3.identity()}},P3=new P,B3=new P;});var ce,ei=p(()=>{ce=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 W(r="default"){return uu[r]===void 0&&(uu[r]=-1),++uu[r]}function e1(){for(let r in uu)delete uu[r];}var uu,Ge=p(()=>{uu={default:-1};});var t1,O,jc,Qn,w,re=p(()=>{t1=new Set,O="8.0.0",jc="8.3.4",Qn={quiet:false,noColor:false},w=(r,e,t=3)=>{if(Qn.quiet||t1.has(e))return;let i=new Error().stack,s=`${e}
|
|
2
|
+
Deprecated since v${r}`,n=typeof console.groupCollapsed=="function"&&!Qn.noColor;typeof i>"u"?console.warn("PixiJS Deprecation Warning: ",s):(i=i.split(`
|
|
3
3
|
`).splice(t).join(`
|
|
4
|
-
`),n?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",s),console.warn(i),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",s),console.warn(i))),Uv.add(e);};Object.defineProperties(w,{quiet:{get:()=>Ps.quiet,set:r=>{Ps.quiet=r;},enumerable:true,configurable:false},noColor:{get:()=>Ps.noColor,set:r=>{Ps.noColor=r;},enumerable:true,configurable:false}});});function M(...r){df!==Iv&&(df++,df===Iv?console.warn("PixiJS Warning: too many warnings, no more warnings will be reported to the console by PixiJS."):console.warn("PixiJS Warning: ",...r));}var df,Iv,se=p(()=>{df=0,Iv=500;});var Ct,Yr=p(()=>{Ct={_registeredResources:new Set,register(r){this._registeredResources.add(r);},unregister(r){this._registeredResources.delete(r);},release(){this._registeredResources.forEach(r=>r.clear());},get registeredCount(){return this._registeredResources.size},isRegistered(r){return this._registeredResources.has(r)},reset(){this._registeredResources.clear();}};});var Lo,ff=p(()=>{Lo=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,this._count++),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(){if(this._pool.length>0&&this._pool[0].destroy)for(let e=0;e<this._index;e++)this._pool[e].destroy();this._pool.length=0,this._count=0,this._index=0;}};});var fl,de,kt=p(()=>{Yr();ff();fl=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 Lo(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}clear(){this._poolsByClass.forEach(e=>e.clear()),this._poolsByClass.clear();}},de=new fl;Ct.register(de);});var pf,mf=p(()=>{re();pf={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){w("v8.6.0","cacheAsBitmap is deprecated, use cacheAsTexture instead."),this.cacheAsTexture(r);}};});function No(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 pl=p(()=>{});var gf,xf=p(()=>{pl();re();gf={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);}No(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||w(O,"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},replaceChild(r,e){r.updateLocalTransform(),this.addChildAt(e,this.getChildIndex(r)),e.setFromMatrix(r.localTransform),e.updateLocalTransform(),this.removeChild(r);}};});var _f,bf=p(()=>{_f={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 tr,Ho=p(()=>{tr=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 ml,Vo,yf=p(()=>{S();kt();ml=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 de.get(i.maskClass,e)}return e}returnMaskEffect(e){de.return(e);}},Vo=new ml;G.handleByList(m.MaskEffect,Vo._effectClasses);});var vf,Tf=p(()=>{Ho();yf();vf={_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),Vo.returnMaskEffect(e),this._maskEffect=null),r!=null&&(this._maskEffect=Vo.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 tr);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 tr),this._filterEffect.filterArea=r;},get filterArea(){return this._filterEffect?.filterArea}};});var Sf,Ef=p(()=>{re();Sf={label:null,get name(){return w(O,"Container.name property has been removed, use Container.label instead"),this.label},set name(r){w(O,"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 gl,V,De=p(()=>{bt();gl=[new q,new q,new q,new q],V=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,f=u-l,g=u+o+l,_=a+c,x=a+n-c,b=u+c,y=u+o-c;return e>=h&&e<=d&&t>=f&&t<=g&&!(e>_&&e<x&&t>b&&t<y)}intersects(e,t){if(!t){let k=this.x<e.x?e.x:this.x;if((this.right>e.right?e.right:this.right)<=k)return false;let I=this.y<e.y?e.y:this.y;return (this.bottom>e.bottom?e.bottom:this.bottom)>I}let i=this.left,s=this.right,n=this.top,o=this.bottom;if(s<=i||o<=n)return false;let a=gl[0].set(e.left,e.top),u=gl[1].set(e.left,e.bottom),l=gl[2].set(e.right,e.top),c=gl[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),f=h*(a.x-u.x),g=d*i+f*n,_=d*s+f*n,x=d*i+f*o,b=d*s+f*o;if(Math.max(g,_,x,b)<=d*a.x+f*a.y||Math.min(g,_,x,b)>=d*c.x+f*c.y)return false;let y=h*(a.y-l.y),v=h*(l.x-a.x),T=y*i+v*n,B=y*s+v*n,E=y*i+v*o,A=y*s+v*o;return !(Math.max(T,B,E,A)<=y*a.x+v*a.y||Math.min(T,B,E,A)>=y*c.x+v*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}scale(e,t=e){return this.x*=e,this.y*=t,this.width*=e,this.height*=t,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 Ov,oe,qe=p(()=>{K();De();Ov=new P,oe=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=Ov,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 V);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=Ov,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,f=this.minY,g=this.maxX,_=this.maxY,x=o*e+u*t+c,b=a*e+l*t+h;x<d&&(d=x),b<f&&(f=b),x>g&&(g=x),b>_&&(_=b),x=o*i+u*t+c,b=a*i+l*t+h,x<d&&(d=x),b<f&&(f=b),x>g&&(g=x),b>_&&(_=b),x=o*e+u*s+c,b=a*e+l*s+h,x<d&&(d=x),b<f&&(f=b),x>g&&(g=x),b>_&&(_=b),x=o*i+u*s+c,b=a*i+l*s+h,x<d&&(d=x),b<f&&(f=b),x>g&&(g=x),b>_&&(_=b),this.minX=d,this.minY=f,this.maxX=g,this.maxY=_;}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,f=a*t+l*i+h;this.minX=d,this.minY=f,this.maxX=d,this.maxY=f,d=o*s+u*i+c,f=a*s+l*i+h,this.minX=d<this.minX?d:this.minX,this.minY=f<this.minY?f:this.minY,this.maxX=d>this.maxX?d:this.maxX,this.maxY=f>this.maxY?f:this.maxY,d=o*t+u*n+c,f=a*t+l*n+h,this.minX=d<this.minX?d:this.minX,this.minY=f<this.minY?f:this.minY,this.maxX=d>this.maxX?d:this.maxX,this.maxY=f>this.maxY?f:this.maxY,d=o*s+u*n+c,f=a*s+l*n+h,this.minX=d<this.minX?d:this.minX,this.minY=f<this.minY?f:this.minY,this.maxX=d>this.maxX?d:this.maxX,this.maxY=f>this.maxY?f: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,f=s.tx,g=s.ty;for(let _=t;_<i;_+=2){let x=e[_],b=e[_+1],y=l*x+h*b+f,v=c*x+d*b+g;n=y<n?y:n,o=v<o?v:o,a=y>a?y:a,u=v>u?v: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 Fe,yt,$r=p(()=>{K();kt();qe();Fe=de.getPool(P),yt=de.getPool(oe);});var RA,Af,Cf=p(()=>{K();qe();$r();RA=new P,Af={getFastGlobalBounds(r,e){e||(e=new oe),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=yt.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(RA).invert()),e.addBounds(i),yt.return(i);}else this.renderGroup&&(e.addBounds(i,this.relativeGroupTransform),yt.return(i));}};});function br(r,e,t){t.clear();let i,s;return r.parent?e?i=r.parent.worldTransform:(s=Fe.get().identity(),i=zo(r,s)):i=P.IDENTITY,kv(r,t,i,e),s&&Fe.return(s),t.isValid||t.set(0,0,0,0),t}function kv(r,e,t,i){if(!r.visible||!r.measurable)return;let s;i?s=r.worldTransform:(r.updateLocalTransform(),s=Fe.get(),s.appendFrom(r.localTransform,t));let n=e,o=!!r.effects.length;if(o&&(e=yt.get().clear()),r.boundsArea)e.addRect(r.boundsArea,s);else {let a=r.bounds;a&&!a.isEmpty()&&(e.matrix=s,e.addBounds(a));for(let u=0;u<r.children.length;u++)kv(r.children[u],e,s,i);}if(o){for(let a=0;a<r.effects.length;a++)r.effects[a].addBounds?.(e);n.addBounds(e,P.IDENTITY),yt.return(e);}i||Fe.return(s);}function zo(r,e){let t=r.parent;return t&&(zo(t,e),t.updateLocalTransform(),e.append(t.localTransform)),e}var yi=p(()=>{K();$r();});function Wo(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 xl=p(()=>{});function vi(r,e){return r===Lv?e:e===Lv?r:Wo(r,e)}var Lv,_l=p(()=>{xl();Lv=16777215;});function jr(r){return ((r&255)<<16)+(r&65280)+(r>>16&255)}var wf,bl=p(()=>{K();yi();$r();_l();wf={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=new P,e){if(e)return r.copyFrom(this.worldTransform);this.updateLocalTransform();let t=zo(this,Fe.get().identity());return r.appendFrom(this.localTransform,t),Fe.return(t),r},getGlobalTint(r){if(r)return this.renderGroup?jr(this.renderGroup.worldColor):this.parentRenderGroup?jr(vi(this.localColor,this.parentRenderGroup.worldColor)):this.tint;let e=this.localColor,t=this.parent;for(;t;)e=vi(e,t.localColor),t=t.parent;return jr(e)}};});function Ti(r,e,t){return e.clear(),t||(t=P.IDENTITY),Nv(r,e,t,r,true),e.isValid||e.set(0,0,0,0),e}function Nv(r,e,t,i,s){let n;if(s)n=Fe.get(),n=t.copyTo(n);else {if(!r.visible||!r.measurable)return;r.updateLocalTransform();let u=r.localTransform;n=Fe.get(),n.appendFrom(u,t);}let o=e,a=!!r.effects.length;if(a&&(e=yt.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++)Nv(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,P.IDENTITY),yt.return(e);}Fe.return(n);}var Xo=p(()=>{K();$r();});function yl(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&&yl(s,e);}return e.didChange}var Pf=p(()=>{});var MA,Bf,Rf=p(()=>{K();qe();yi();Xo();Pf();MA=new P,Bf={_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 oe});let r=this._localBoundsCacheData;return r.index=1,r.didChange=false,r.data[0]!==this._didViewChangeTick&&(r.didChange=true,r.data[0]=this._didViewChangeTick),yl(this,r),r.didChange&&Ti(this,r.localBounds,MA),r.localBounds},getBounds(r,e){return br(this,r,e||new oe)}};});var Mf,Df=p(()=>{Mf={_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 DA(r,e){return r._zIndex-e._zIndex}var Ff,Gf=p(()=>{Ff={_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(DA));}};});var Uf,If=p(()=>{bt();$r();Uf={getGlobalPosition(r=new q,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(Fe.get(),t);return e=i.apply(r,e),Fe.return(i),e},toLocal(r,e,t,i){e&&(r=e.toGlobal(r,t,i));let s=this.getGlobalTransform(Fe.get(),i);return t=s.applyInverse(r,t),Fe.return(s),t}};});var Si,vl=p(()=>{Me();Si=class{constructor(){this.uid=W("instructionSet"),this.instructions=[],this.instructionSize=0,this.renderables=[],this.gcTick=0;}reset(){this.instructionSize=0;}destroy(){this.instructions.length=0,this.renderables.length=0,this.renderPipes=null,this.gcTick=0;}add(e){this.instructions[this.instructionSize++]=e;}log(){this.instructions.length=this.instructionSize,console.table(this.instructions,["type","action"]);}};});function rr(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 Tl(r){return !(r&r-1)&&!!r}function FA(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 Bs=p(()=>{});function Ke(r){let e={};for(let t in r)r[t]!==void 0&&(e[t]=r[t]);return e}var qr=p(()=>{});function GA(r){let e=Hv[r];return e===void 0&&(Hv[r]=W("resource")),e}var Hv,Vv,Ge,ir=p(()=>{je();Me();re();Hv=Object.create(null);Vv=class zv extends fe{constructor(e={}){super(),this._resourceType="textureSampler",this._touched=0,this._maxAnisotropy=1,this.destroyed=false,e={...zv.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){w(O,"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._sharedResourceId=null,this.emit("change",this);}_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=GA(e),this._resourceId}destroy(){this.destroyed=true,this.emit("destroy",this),this.emit("change",this),this.removeAllListeners();}};Vv.defaultOptions={addressMode:"clamp-to-edge",scaleMode:"linear"};Ge=Vv;});var Wv,Z,He=p(()=>{je();Bs();qr();Me();ir();Wv=class Xv extends fe{constructor(e={}){super(),this.options=e,this._gpuData=Object.create(null),this._gcLastUsed=-1,this.uid=W("textureSource"),this._resourceType="textureSource",this._resourceId=W("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={...Xv.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 Ge(Ke(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());}set maxAnisotropy(e){this._style.maxAnisotropy=e;}get maxAnisotropy(){return this._style.maxAnisotropy}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.unload(),this.emit("destroy",this),this._style&&(this._style.destroy(),this._style=null),this.uploadMethodId=null,this.resource=null,this.removeAllListeners();}unload(){this._resourceId=W("resource"),this.emit("change",this),this.emit("unload",this);for(let e in this._gpuData)this._gpuData[e]?.destroy?.();this._gpuData=Object.create(null);}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=W("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=Tl(this.pixelWidth)&&Tl(this.pixelHeight);}static test(e){throw new Error("Unimplemented")}};Wv.defaultOptions={resolution:1,format:"bgra8unorm",alphaMode:"premultiply-alpha-on-upload",dimensions:"2d",mipLevelCount:1,autoGenerateMipmaps:false,sampleCount:1,antialias:false,autoGarbageCollect:false};Z=Wv;});function UA(){for(let r=0;r<16;r++){let e=[];Of.push(e);for(let t=0;t<16;t++){let i=Sl(Ei[r]*Ei[t]+Ci[r]*Ai[t]),s=Sl(Ai[r]*Ei[t]+wi[r]*Ai[t]),n=Sl(Ei[r]*Ci[t]+Ci[r]*wi[t]),o=Sl(Ai[r]*Ci[t]+wi[r]*wi[t]);for(let a=0;a<16;a++)if(Ei[a]===i&&Ai[a]===s&&Ci[a]===n&&wi[a]===o){e.push(a);break}}}for(let r=0;r<16;r++){let e=new P;e.set(Ei[r],Ai[r],Ci[r],wi[r],0,0),Yv.push(e);}}var Ei,Ai,Ci,wi,Of,Yv,Sl,Y,Yo=p(()=>{K();Ei=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],Ai=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],Ci=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],wi=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],Of=[],Yv=[],Sl=Math.sign;UA();Y={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:r=>Ei[r],uY:r=>Ai[r],vX:r=>Ci[r],vY:r=>wi[r],inv:r=>r&8?r&15:-r&7,add:(r,e)=>Of[r][e],sub:(r,e)=>Of[r][Y.inv(e)],rotate180:r=>r^4,isVertical:r=>(r&3)===2,byDirection:(r,e)=>Math.abs(r)*2<=Math.abs(e)?e>=0?Y.S:Y.N:Math.abs(e)*2<=Math.abs(r)?r>0?Y.E:Y.W:e>0?r>0?Y.SE:Y.SW:r>0?Y.NE:Y.NW,matrixAppendRotationInv:(r,e,t=0,i=0)=>{let s=Yv[Y.inv(e)];s.tx=t,s.ty=i,r.append(s);},transformRectCoords:(r,e,t,i)=>{let{x:s,y:n,width:o,height:a}=r,{x:u,y:l,width:c,height:h}=e;return t===Y.E?(i.set(s+u,n+l,o,a),i):t===Y.S?i.set(c-n-a+u,s+l,a,o):t===Y.W?i.set(c-s-o+u,h-n-a+l,o,a):t===Y.N?i.set(n+u,h-s-o+l,a,o):i.set(s+u,n+l,o,a)}};});var El,kf=p(()=>{El=()=>{};});var Kr,Al=p(()=>{S();He();Kr=class extends Z{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}};Kr.extension=m.TextureSource;});var $v,Pi,Cl=p(()=>{K();$v=new P,Pi=class{constructor(e,t){this.mapCoord=new P,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&&($v.set(i.width/s.width,0,0,i.height/s.height,-s.x/s.width,-s.y/s.height),this.mapCoord.append($v));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}};});var C,ee=p(()=>{je();Yo();De();Me();re();kf();Al();He();Cl();C=class extends fe{constructor({source:e,label:t,frame:i,orig:s,trim:n,defaultAnchor:o,defaultBorders:a,rotate:u,dynamic:l}={}){if(super(),this.uid=W("texture"),this.uvs={x0:0,y0:0,x1:0,y1:0,x2:0,y2:0,x3:0,y3:0},this.frame=new V,this.noFrame=false,this.dynamic=false,this.isTexture=true,this.label=t,this.source=e?.source??new Z,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 Pi(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,f=o+h;l=Y.add(l,Y.NW),e.x0=d+c*Y.uX(l),e.y0=f+h*Y.uY(l),l=Y.add(l,2),e.x1=d+c*Y.uX(l),e.y1=f+h*Y.uY(l),l=Y.add(l,2),e.x2=d+c*Y.uX(l),e.y2=f+h*Y.uY(l),l=Y.add(l,2),e.x3=d+c*Y.uX(l),e.y3=f+h*Y.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&&(this._source.off("resize",this.update,this),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 w(O,"Texture.baseTexture is now Texture.source"),this._source}};C.EMPTY=new C({label:"EMPTY",source:new Z({label:"EMPTY"})});C.EMPTY.destroy=El;C.WHITE=new C({source:new Kr({resource:new Uint8Array([255,255,255,255]),width:1,height:1,alphaMode:"premultiply-alpha-on-upload",label:"WHITE"}),label:"WHITE"});C.WHITE.destroy=El;});var IA,wl,le,Lt=p(()=>{Bs();Yr();He();ee();ir();IA=0,wl=class{constructor(e){this._poolKeyHash=Object.create(null),this._texturePool={},this.textureOptions=e||{},this.enableFullScreen=false,this.textureStyle=new Ge(this.textureOptions);}createTexture(e,t,i){let s=new Z({...this.textureOptions,width:e,height:t,resolution:1,antialias:i,autoGarbageCollect:false});return new C({source:s,label:`texturePool_${IA++}`})}getOptimalTexture(e,t,i=1,s){let n=Math.ceil(e*i-1e-6),o=Math.ceil(t*i-1e-6);n=rr(n),o=rr(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={};}},le=new wl;Ct.register(le);});var Zr,Pl=p(()=>{K();vl();Lt();Zr=class{constructor(){this.renderPipeId="renderGroup",this.root=null,this.canBundle=false,this.renderGroupParent=null,this.renderGroupChildren=[],this.worldTransform=new P,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 Si,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&&(le.returnTexture(this.texture,true),this.texture=null);}updateCacheTexture(){this.textureNeedsUpdate=true;let e=this._parentCacheAsTextureRenderGroup;e&&!e.textureNeedsUpdate&&e.updateCacheTexture();}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 P),this._inverseWorldTransform.copyFrom(this.worldTransform).invert())}get textureOffsetInverseTransform(){return (this._matrixDirty&2)===0?this._textureOffsetInverseTransform:(this._matrixDirty&=-3,this._textureOffsetInverseTransform||(this._textureOffsetInverseTransform=new P),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 P),this._inverseParentTextureTransform.copyFrom(this.worldTransform).prepend(e.inverseWorldTransform).translate(-e._textureBounds.x,-e._textureBounds.y)):this.worldTransform}get cacheToLocalTransform(){return this.isCachedAsTexture?this.textureOffsetInverseTransform:this._parentCacheAsTextureRenderGroup?this._parentCacheAsTextureRenderGroup.textureOffsetInverseTransform:null}};});function Rs(r,e,t={}){for(let i in e)!t[i]&&e[i]!==void 0&&(r[i]=e[i]);}var Bl=p(()=>{});var Lf,Rl,Nf,Ml,Ms,$o,Bi,OA,Q,Ze=p(()=>{je();ke();of();S();K();dl();Xr();Me();re();se();kt();mf();xf();bf();Tf();Ef();Cf();bl();Rf();Df();Gf();If();Pl();Bl();Lf=new he(null),Rl=new he(null),Nf=new he(null,1,1),Ml=new he(null),Ms=1,$o=2,Bi=4,OA=8,Q=class r extends fe{constructor(e={}){super(),this.uid=W("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.parentRenderLayer=null,this.updateTick=-1,this.localTransform=new P,this.relativeGroupTransform=new P,this.groupTransform=this.relativeGroupTransform,this.destroyed=false,this._position=new he(this,0,0),this._scale=Nf,this._pivot=Rl,this._origin=Ml,this._skew=Lf,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=[],Rs(this,e,{children:true,parent:true,effects:true}),e.children?.forEach(t=>this.addChild(t)),e.parent?.addChild(this);}static mixin(e){w("8.8.0","Container.mixin is deprecated, please use extensions.mixin instead."),G.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||w(O,"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=de.get(Zr,this),this.groupTransform=P.IDENTITY,e?.addChild(this),this._updateIsSimple();}disableRenderGroup(){if(!this.renderGroup)return;let e=this.parentRenderGroup;e?.removeChild(this),de.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 P),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*uf}set angle(e){this.rotation=e*lf;}get pivot(){return this._pivot===Rl&&(this._pivot=new he(this,0,0)),this._pivot}set pivot(e){this._pivot===Rl&&(this._pivot=new he(this,0,0),this._origin!==Ml&&M("Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.")),typeof e=="number"?this._pivot.set(e):this._pivot.copyFrom(e);}get skew(){return this._skew===Lf&&(this._skew=new he(this,0,0)),this._skew}set skew(e){this._skew===Lf&&(this._skew=new he(this,0,0)),this._skew.copyFrom(e);}get scale(){return this._scale===Nf&&(this._scale=new he(this,1,1)),this._scale}set scale(e){this._scale===Nf&&(this._scale=new he(this,0,0)),typeof e=="string"&&(e=parseFloat(e)),typeof e=="number"?this._scale.set(e):this._scale.copyFrom(e);}get origin(){return this._origin===Ml&&(this._origin=new he(this,0,0)),this._origin}set origin(e){this._origin===Ml&&(this._origin=new he(this,0,0),this._pivot!==Rl&&M("Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.")),typeof e=="number"?this._origin.set(e):this._origin.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.origin.set(typeof e.originX=="number"?e.originX:this.origin.x,typeof e.originY=="number"?e.originY:this.origin.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._origin,o=this._position,a=i._x,u=i._y,l=s._x,c=s._y,h=-n._x,d=-n._y;t.a=this._cx*a,t.b=this._sx*a,t.c=this._cy*u,t.d=this._sy*u,t.tx=o._x-(l*t.a+c*t.c)+(h*t.a+d*t.c)-h,t.ty=o._y-(l*t.b+c*t.d)+(h*t.b+d*t.d)-d;}set alpha(e){e!==this.localAlpha&&(this.localAlpha=e,this._updateFlags|=Ms,this._onUpdate());}get alpha(){return this.localAlpha}set tint(e){let i=H.shared.setValue(e??16777215).toBgrNumber();i!==this.localColor&&(this.localColor=i,this._updateFlags|=Ms,this._onUpdate());}get tint(){return jr(this.localColor)}set blendMode(e){this.localBlendMode!==e&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=true),this._updateFlags|=$o,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|=Bi,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|=Bi,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|=Bi,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._origin=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;}};G.mixin(Q,gf,Af,Uf,Mf,Bf,vf,Sf,Ff,nf,pf,wf,_f);});var et,Qr=p(()=>{et=(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))(et||{});});var Ri,Hf=p(()=>{Ri=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 jv,be,yr=p(()=>{Qr();Hf();jv=class wt{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 Ri(null,null,1/0),this.deltaMS=1/wt.targetFPMS,this.elapsedMS=1/wt.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=et.NORMAL){return this._addListener(new Ri(e,t,i))}addOnce(e,t,i=et.NORMAL){return this._addListener(new Ri(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*wt.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,wt.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(!wt._shared){let e=wt._shared=new wt;e.autoStart=true,e._protected=true;}return wt._shared}static get system(){if(!wt._system){let e=wt._system=new wt;e.autoStart=true,e._protected=true;}return wt._system}};jv.targetFPMS=.06;be=jv;});var Mi,Dl=p(()=>{Qr();yr();Mi=class{constructor(e){this._lastTransform="",this._observer=null,this._tickerAttached=false,this.updateTranslation=()=>{if(!this._canvas)return;let t=this._canvas.getBoundingClientRect(),i=this._canvas.width,s=this._canvas.height,n=t.width/i*this._renderer.resolution,o=t.height/s*this._renderer.resolution,a=t.left,u=t.top,l=`translate(${a}px, ${u}px) scale(${n}, ${o})`;l!==this._lastTransform&&(this._domElement.style.transform=l,this._lastTransform=l);},this._domElement=e.domElement,this._renderer=e.renderer,!(globalThis.OffscreenCanvas&&this._renderer.canvas instanceof OffscreenCanvas)&&(this._canvas=this._renderer.canvas,this._attachObserver());}get canvas(){return this._canvas}ensureAttached(){!this._domElement.parentNode&&this._canvas.parentNode&&(this._canvas.parentNode.appendChild(this._domElement),this.updateTranslation());}_attachObserver(){"ResizeObserver"in globalThis?(this._observer&&(this._observer.disconnect(),this._observer=null),this._observer=new ResizeObserver(e=>{for(let t of e){if(t.target!==this._canvas)continue;let i=this.canvas.width,s=this.canvas.height,n=t.contentRect.width/i*this._renderer.resolution,o=t.contentRect.height/s*this._renderer.resolution;(this._lastScaleX!==n||this._lastScaleY!==o)&&(this.updateTranslation(),this._lastScaleX=n,this._lastScaleY=o);}}),this._observer.observe(this._canvas)):this._tickerAttached||be.shared.add(this.updateTranslation,this,et.HIGH);}destroy(){this._observer?(this._observer.disconnect(),this._observer=null):this._tickerAttached&&be.shared.remove(this.updateTranslation),this._domElement=null,this._renderer=null,this._canvas=null,this._tickerAttached=false,this._lastTransform="",this._lastScaleX=null,this._lastScaleY=null;}};});var vr,jo=p(()=>{bt();vr=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 q,this.page=new q,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 kA(r){return function(e){return e.test(r)}}function qo(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=kA(t),n={apple:{phone:s(Vf)&&!s(Tr),ipod:s(qv),tablet:!s(Vf)&&(s(Kv)||n1(e))&&!s(Tr),universal:s(Zv),device:(s(Vf)||s(qv)||s(Kv)||s(Zv)||n1(e))&&!s(Tr)},amazon:{phone:s(Ds),tablet:!s(Ds)&&s(Fl),device:s(Ds)||s(Fl)},android:{phone:!s(Tr)&&s(Ds)||!s(Tr)&&s(zf),tablet:!s(Tr)&&!s(Ds)&&!s(zf)&&(s(Fl)||s(Qv)),device:!s(Tr)&&(s(Ds)||s(Fl)||s(zf)||s(Qv))||s(/\bokhttp\b/i)},windows:{phone:s(Tr),tablet:s(Jv),device:s(Tr)||s(Jv)},other:{blackberry:s(e1),blackberry10:s(t1),opera:s(r1),firefox:s(s1),chrome:s(i1),device:s(e1)||s(t1)||s(r1)||s(s1)||s(i1)},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 Vf,qv,Kv,Zv,zf,Qv,Ds,Fl,Tr,Jv,e1,t1,r1,i1,s1,n1,Wf=p(()=>{Vf=/iPhone/i,qv=/iPod/i,Kv=/iPad/i,Zv=/\biOS-universal(?:.+)Mac\b/i,zf=/\bAndroid(?:.+)Mobile\b/i,Qv=/Android/i,Ds=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,Fl=/Silk/i,Tr=/Windows Phone/i,Jv=/\bWindows(?:.+)ARM\b/i,e1=/BlackBerry/i,t1=/BB10/i,r1=/Opera Mini/i,i1=/\b(CriOS|Chrome)(?:.+)Mobile/i,s1=/Mobile(?:.+)Firefox\b/i,n1=function(r){return typeof r<"u"&&r.platform==="MacIntel"&&typeof r.maxTouchPoints=="number"&&r.maxTouchPoints>1&&typeof MSStream>"u"};});var o1=p(()=>{Wf();Wf();});var LA,Xf,Yf=p(()=>{o1();LA=qo.default??qo,Xf=LA(globalThis.navigator);});var NA,a1,HA,VA,u1,l1,zA,WA,XA,$f,jf,qf=p(()=>{Dl();jo();S();Yf();pl();NA=9,a1=100,HA=0,VA=0,u1=2,l1=1,zA=-1e3,WA=-1e3,XA=2,$f=class c1{constructor(e,t=Xf){this._mobileInfo=t,this.debug=false,this._activateOnTab=true,this._deactivateOnMouseMove=true,this._isActive=false,this._isMobileAccessibility=false,this._div=null,this._pools={},this._renderId=0,this._children=[],this._androidUpdateCount=0,this._androidUpdateFrequency=500,this._isRunningTests=false,this._boundOnKeyDown=this._onKeyDown.bind(this),this._boundOnMouseMove=this._onMouseMove.bind(this),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}get div(){return this._div}_createTouchHook(){let e=document.createElement("button");e.style.width=`${l1}px`,e.style.height=`${l1}px`,e.style.position="absolute",e.style.top=`${zA}px`,e.style.left=`${WA}px`,e.style.zIndex=XA.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.position="absolute",this._div.style.top=`${HA}px`,this._div.style.left=`${VA}px`,this._div.style.pointerEvents="none",this._div.style.zIndex=u1.toString(),this._canvasObserver=new Mi({domElement:this._div,renderer:this._renderer})),this._activateOnTab&&globalThis.addEventListener("keydown",this._boundOnKeyDown,false),this._deactivateOnMouseMove&&globalThis.document.addEventListener("mousemove",this._boundOnMouseMove,true);let e=this._renderer.view.canvas;if(e.parentNode)this._canvasObserver.ensureAttached(),this._initAccessibilitySetup();else {let t=new MutationObserver(()=>{e.parentNode&&(t.disconnect(),this._canvasObserver.ensureAttached(),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._boundOnMouseMove,true),this._activateOnTab&&globalThis.addEventListener("keydown",this._boundOnKeyDown,false),this._renderer.runners.postrender.remove(this);for(let e of this._children)e._accessibleDiv?.parentNode&&(e._accessibleDiv.parentNode.removeChild(e._accessibleDiv),e._accessibleDiv=null),e._accessibleActive=false;for(let e in this._pools)this._pools[e].forEach(i=>{i.parentNode&&i.parentNode.removeChild(i);}),delete this._pools[e];this._div?.parentNode&&this._div.parentNode.removeChild(this._div),this._pools={},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:{...c1.defaultOptions,...e?.accessibilityOptions||{}}};this.debug=i.accessibilityOptions.debug,this._activateOnTab=i.accessibilityOptions.activateOnTab,this._deactivateOnMouseMove=i.accessibilityOptions.deactivateOnMouseMove,i.accessibilityOptions.enabledByDefault&&this._activate(),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)&&!this._isRunningTests))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._getPool(s.accessibleType).push(s._accessibleDiv),s._accessibleDiv=null),s._accessibleActive=false,No(this._children,i,1));}this._renderer.renderingToScreen&&this._canvasObserver.ensureAttached();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;n.style.left=`${a.tx+o.x*a.a}px`,n.style.top=`${a.ty+o.y*a.d}px`,n.style.width=`${o.width*a.a}px`,n.style.height=`${o.height*a.d}px`;}else this._capHitArea(o),n.style.left=`${o.x}px`,n.style.top=`${o.y}px`,n.style.width=`${o.width}px`,n.style.height=`${o.height}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 i=this._getPool(e.accessibleType).pop();i?(i.innerHTML="",i.removeAttribute("title"),i.removeAttribute("aria-label"),i.tabIndex=0):(e.accessibleType==="button"?i=document.createElement("button"):(i=document.createElement(e.accessibleType),i.style.cssText=`
|
|
4
|
+
`),n?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",s),console.warn(i),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",s),console.warn(i))),t1.add(e);};Object.defineProperties(w,{quiet:{get:()=>Qn.quiet,set:r=>{Qn.quiet=r;},enumerable:true,configurable:false},noColor:{get:()=>Qn.noColor,set:r=>{Qn.noColor=r;},enumerable:true,configurable:false}});});function R(...r){ex!==r1&&(ex++,ex===r1?console.warn("PixiJS Warning: too many warnings, no more warnings will be reported to the console by PixiJS."):console.warn("PixiJS Warning: ",...r));}var ex,r1,ne=p(()=>{ex=0,r1=500;});var Tt,ti=p(()=>{Tt={_registeredResources:new Set,register(r){this._registeredResources.add(r);},unregister(r){this._registeredResources.delete(r);},release(){this._registeredResources.forEach(r=>r.clear());},get registeredCount(){return this._registeredResources.size},isRegistered(r){return this._registeredResources.has(r)},reset(){this._registeredResources.clear();}};});var Jn,tx=p(()=>{Jn=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,this._count++),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(){if(this._pool.length>0&&this._pool[0].destroy)for(let e=0;e<this._index;e++)this._pool[e].destroy();this._pool.length=0,this._count=0,this._index=0;}};});var lu,he,jt=p(()=>{ti();tx();lu=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 Jn(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}clear(){this._poolsByClass.forEach(e=>e.clear()),this._poolsByClass.clear();}},he=new lu;Tt.register(he);});var qc,rx=p(()=>{re();qc={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){w("v8.6.0","cacheAsBitmap is deprecated, use cacheAsTexture instead."),this.cacheAsTexture(r);}};});function eo(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 Kc=p(()=>{});var Zc,ix=p(()=>{Kc();re();Zc={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);}eo(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||w(O,"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},replaceChild(r,e){r.updateLocalTransform(),this.addChildAt(e,this.getChildIndex(r)),e.setFromMatrix(r.localTransform),e.updateLocalTransform(),this.removeChild(r);}};});var Qc,sx=p(()=>{Qc={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 qt,cu=p(()=>{qt=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 hu,to,nx=p(()=>{S();jt();hu=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 he.get(i.maskClass,e)}return e}returnMaskEffect(e){he.return(e);}},to=new hu;G.handleByList(m.MaskEffect,to._effectClasses);});var Jc,ox=p(()=>{cu();nx();Jc={_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),to.returnMaskEffect(e),this._maskEffect=null),r!=null&&(this._maskEffect=to.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 qt);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 qt),this._filterEffect.filterArea=r;},get filterArea(){return this._filterEffect?.filterArea}};});var eh,ax=p(()=>{re();eh={label:null,get name(){return w(O,"Container.name property has been removed, use Container.label instead"),this.label},set name(r){w(O,"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 th,V,Ue=p(()=>{vt();th=[new q,new q,new q,new q],V=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,f=u-l,g=u+o+l,_=a+c,x=a+n-c,b=u+c,y=u+o-c;return e>=h&&e<=d&&t>=f&&t<=g&&!(e>_&&e<x&&t>b&&t<y)}intersects(e,t){if(!t){let k=this.x<e.x?e.x:this.x;if((this.right>e.right?e.right:this.right)<=k)return false;let I=this.y<e.y?e.y:this.y;return (this.bottom>e.bottom?e.bottom:this.bottom)>I}let i=this.left,s=this.right,n=this.top,o=this.bottom;if(s<=i||o<=n)return false;let a=th[0].set(e.left,e.top),u=th[1].set(e.left,e.bottom),l=th[2].set(e.right,e.top),c=th[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),f=h*(a.x-u.x),g=d*i+f*n,_=d*s+f*n,x=d*i+f*o,b=d*s+f*o;if(Math.max(g,_,x,b)<=d*a.x+f*a.y||Math.min(g,_,x,b)>=d*c.x+f*c.y)return false;let y=h*(a.y-l.y),v=h*(l.x-a.x),T=y*i+v*n,B=y*s+v*n,E=y*i+v*o,C=y*s+v*o;return !(Math.max(T,B,E,C)<=y*a.x+v*a.y||Math.min(T,B,E,C)>=y*c.x+v*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}scale(e,t=e){return this.x*=e,this.y*=t,this.width*=e,this.height*=t,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 i1,oe,Ze=p(()=>{K();Ue();i1=new P,oe=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=i1,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 V);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=i1,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,f=this.minY,g=this.maxX,_=this.maxY,x=o*e+u*t+c,b=a*e+l*t+h;x<d&&(d=x),b<f&&(f=b),x>g&&(g=x),b>_&&(_=b),x=o*i+u*t+c,b=a*i+l*t+h,x<d&&(d=x),b<f&&(f=b),x>g&&(g=x),b>_&&(_=b),x=o*e+u*s+c,b=a*e+l*s+h,x<d&&(d=x),b<f&&(f=b),x>g&&(g=x),b>_&&(_=b),x=o*i+u*s+c,b=a*i+l*s+h,x<d&&(d=x),b<f&&(f=b),x>g&&(g=x),b>_&&(_=b),this.minX=d,this.minY=f,this.maxX=g,this.maxY=_;}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,f=a*t+l*i+h;this.minX=d,this.minY=f,this.maxX=d,this.maxY=f,d=o*s+u*i+c,f=a*s+l*i+h,this.minX=d<this.minX?d:this.minX,this.minY=f<this.minY?f:this.minY,this.maxX=d>this.maxX?d:this.maxX,this.maxY=f>this.maxY?f:this.maxY,d=o*t+u*n+c,f=a*t+l*n+h,this.minX=d<this.minX?d:this.minX,this.minY=f<this.minY?f:this.minY,this.maxX=d>this.maxX?d:this.maxX,this.maxY=f>this.maxY?f:this.maxY,d=o*s+u*n+c,f=a*s+l*n+h,this.minX=d<this.minX?d:this.minX,this.minY=f<this.minY?f:this.minY,this.maxX=d>this.maxX?d:this.maxX,this.maxY=f>this.maxY?f: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,f=s.tx,g=s.ty;for(let _=t;_<i;_+=2){let x=e[_],b=e[_+1],y=l*x+h*b+f,v=c*x+d*b+g;n=y<n?y:n,o=v<o?v:o,a=y>a?y:a,u=v>u?v: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 Me,xt,ri=p(()=>{K();jt();Ze();Me=he.getPool(P),xt=he.getPool(oe);});var R3,rh,ux=p(()=>{K();Ze();ri();R3=new P,rh={getFastGlobalBounds(r,e){e||(e=new oe),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=xt.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(R3).invert()),e.addBounds(i),xt.return(i);}else this.renderGroup&&(e.addBounds(i,this.relativeGroupTransform),xt.return(i));}};});function hr(r,e,t){t.clear();let i,s;return r.parent?e?i=r.parent.worldTransform:(s=Me.get().identity(),i=ro(r,s)):i=P.IDENTITY,s1(r,t,i,e),s&&Me.return(s),t.isValid||t.set(0,0,0,0),t}function s1(r,e,t,i){if(!r.visible||!r.measurable)return;let s;i?s=r.worldTransform:(r.updateLocalTransform(),s=Me.get(),s.appendFrom(r.localTransform,t));let n=e,o=!!r.effects.length;if(o&&(e=xt.get().clear()),r.boundsArea)e.addRect(r.boundsArea,s);else {let a=r.bounds;a&&!a.isEmpty()&&(e.matrix=s,e.addBounds(a));for(let u=0;u<r.children.length;u++)s1(r.children[u],e,s,i);}if(o){for(let a=0;a<r.effects.length;a++)r.effects[a].addBounds?.(e);n.addBounds(e,P.IDENTITY),xt.return(e);}i||Me.return(s);}function ro(r,e){let t=r.parent;return t&&(ro(t,e),t.updateLocalTransform(),e.append(t.localTransform)),e}var us=p(()=>{K();ri();});function io(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 ih=p(()=>{});function ii(r,e){return r===n1?e:e===n1?r:io(r,e)}var n1,sh=p(()=>{ih();n1=16777215;});function Mr(r){return ((r&255)<<16)+(r&65280)+(r>>16&255)}var nh,oh=p(()=>{K();us();ri();sh();nh={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=new P,e){if(e)return r.copyFrom(this.worldTransform);this.updateLocalTransform();let t=ro(this,Me.get().identity());return r.appendFrom(this.localTransform,t),Me.return(t),r},getGlobalTint(r){if(r)return this.renderGroup?Mr(this.renderGroup.worldColor):this.parentRenderGroup?Mr(ii(this.localColor,this.parentRenderGroup.worldColor)):this.tint;let e=this.localColor,t=this.parent;for(;t;)e=ii(e,t.localColor),t=t.parent;return Mr(e)}};});function si(r,e,t){return e.clear(),t||(t=P.IDENTITY),o1(r,e,t,r,true),e.isValid||e.set(0,0,0,0),e}function o1(r,e,t,i,s){let n;if(s)n=Me.get(),n=t.copyTo(n);else {if(!r.visible||!r.measurable)return;r.updateLocalTransform();let u=r.localTransform;n=Me.get(),n.appendFrom(u,t);}let o=e,a=!!r.effects.length;if(a&&(e=xt.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++)o1(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,P.IDENTITY),xt.return(e);}Me.return(n);}var du=p(()=>{K();ri();});function fu(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&&fu(s,e);}return e.didChange}var lx=p(()=>{});var M3,ah,cx=p(()=>{K();Ze();us();du();lx();M3=new P,ah={_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 oe});let r=this._localBoundsCacheData;return r.index=1,r.didChange=false,r.data[0]!==this._didViewChangeTick&&(r.didChange=true,r.data[0]=this._didViewChangeTick),fu(this,r),r.didChange&&si(this,r.localBounds,M3),r.localBounds},getBounds(r,e){return hr(this,r,e||new oe)}};});var uh,hx=p(()=>{uh={_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 D3(r,e){return r._zIndex-e._zIndex}var lh,dx=p(()=>{lh={_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(D3));}};});var ch,fx=p(()=>{vt();ri();ch={getGlobalPosition(r=new q,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(Me.get(),t);return e=i.apply(r,e),Me.return(i),e},toLocal(r,e,t,i){e&&(r=e.toGlobal(r,t,i));let s=this.getGlobalTransform(Me.get(),i);return t=s.applyInverse(r,t),Me.return(s),t}};});var ni,hh=p(()=>{Ge();ni=class{constructor(){this.uid=W("instructionSet"),this.instructions=[],this.instructionSize=0,this.renderables=[],this.gcTick=0;}reset(){this.instructionSize=0;}destroy(){this.instructions.length=0,this.renderables.length=0,this.renderPipes=null,this.gcTick=0;}add(e){this.instructions[this.instructionSize++]=e;}log(){this.instructions.length=this.instructionSize,console.table(this.instructions,["type","action"]);}};});function Kt(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 pu(r){return !(r&r-1)&&!!r}function a1(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 so=p(()=>{});function Ye(r){let e={};for(let t in r)r[t]!==void 0&&(e[t]=r[t]);return e}var oi=p(()=>{});function F3(r){let e=u1[r];return e===void 0&&(u1[r]=W("resource")),e}var u1,l1,De,dr=p(()=>{Ke();Ge();re();u1=Object.create(null);l1=class c1 extends fe{constructor(e={}){super(),this._resourceType="textureSampler",this._touched=0,this._maxAnisotropy=1,this.destroyed=false,e={...c1.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){w(O,"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._sharedResourceId=null,this.emit("change",this);}_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=F3(e),this._resourceId}destroy(){this.destroyed=true,this.emit("destroy",this),this.emit("change",this),this.removeAllListeners();}};l1.defaultOptions={addressMode:"clamp-to-edge",scaleMode:"linear"};De=l1;});var h1,Z,We=p(()=>{Ke();so();oi();Ge();dr();h1=class d1 extends fe{constructor(e={}){super(),this.options=e,this._gpuData=Object.create(null),this._gcLastUsed=-1,this.uid=W("textureSource"),this._resourceType="textureSource",this._resourceId=W("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={...d1.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 De(Ye(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());}set maxAnisotropy(e){this._style.maxAnisotropy=e;}get maxAnisotropy(){return this._style.maxAnisotropy}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.unload(),this.emit("destroy",this),this._style&&(this._style.destroy(),this._style=null),this.uploadMethodId=null,this.resource=null,this.removeAllListeners();}unload(){this._resourceId=W("resource"),this.emit("change",this),this.emit("unload",this);for(let e in this._gpuData)this._gpuData[e]?.destroy?.();this._gpuData=Object.create(null);}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=W("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=pu(this.pixelWidth)&&pu(this.pixelHeight);}static test(e){throw new Error("Unimplemented")}};h1.defaultOptions={resolution:1,format:"bgra8unorm",alphaMode:"premultiply-alpha-on-upload",dimensions:"2d",mipLevelCount:1,autoGenerateMipmaps:false,sampleCount:1,antialias:false,autoGarbageCollect:false};Z=h1;});function G3(){for(let r=0;r<16;r++){let e=[];px.push(e);for(let t=0;t<16;t++){let i=dh(ls[r]*ls[t]+hs[r]*cs[t]),s=dh(cs[r]*ls[t]+ds[r]*cs[t]),n=dh(ls[r]*hs[t]+hs[r]*ds[t]),o=dh(cs[r]*hs[t]+ds[r]*ds[t]);for(let a=0;a<16;a++)if(ls[a]===i&&cs[a]===s&&hs[a]===n&&ds[a]===o){e.push(a);break}}}for(let r=0;r<16;r++){let e=new P;e.set(ls[r],cs[r],hs[r],ds[r],0,0),f1.push(e);}}var ls,cs,hs,ds,px,f1,dh,Y,mu=p(()=>{K();ls=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],cs=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],hs=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],ds=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],px=[],f1=[],dh=Math.sign;G3();Y={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:r=>ls[r],uY:r=>cs[r],vX:r=>hs[r],vY:r=>ds[r],inv:r=>r&8?r&15:-r&7,add:(r,e)=>px[r][e],sub:(r,e)=>px[r][Y.inv(e)],rotate180:r=>r^4,isVertical:r=>(r&3)===2,byDirection:(r,e)=>Math.abs(r)*2<=Math.abs(e)?e>=0?Y.S:Y.N:Math.abs(e)*2<=Math.abs(r)?r>0?Y.E:Y.W:e>0?r>0?Y.SE:Y.SW:r>0?Y.NE:Y.NW,matrixAppendRotationInv:(r,e,t=0,i=0)=>{let s=f1[Y.inv(e)];s.tx=t,s.ty=i,r.append(s);},transformRectCoords:(r,e,t,i)=>{let{x:s,y:n,width:o,height:a}=r,{x:u,y:l,width:c,height:h}=e;return t===Y.E?(i.set(s+u,n+l,o,a),i):t===Y.S?i.set(c-n-a+u,s+l,a,o):t===Y.W?i.set(c-s-o+u,h-n-a+l,o,a):t===Y.N?i.set(n+u,h-s-o+l,a,o):i.set(s+u,n+l,o,a)}};});var gu,mx=p(()=>{gu=()=>{};});var Dr,fh=p(()=>{S();We();Dr=class extends Z{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}};Dr.extension=m.TextureSource;});var p1,ai,ph=p(()=>{K();p1=new P,ai=class{constructor(e,t){this.mapCoord=new P,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&&(p1.set(i.width/s.width,0,0,i.height/s.height,-s.x/s.width,-s.y/s.height),this.mapCoord.append(p1));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}};});var A,ee=p(()=>{Ke();mu();Ue();Ge();re();mx();fh();We();ph();A=class extends fe{constructor({source:e,label:t,frame:i,orig:s,trim:n,defaultAnchor:o,defaultBorders:a,rotate:u,dynamic:l}={}){if(super(),this.uid=W("texture"),this.uvs={x0:0,y0:0,x1:0,y1:0,x2:0,y2:0,x3:0,y3:0},this.frame=new V,this.noFrame=false,this.dynamic=false,this.isTexture=true,this.label=t,this.source=e?.source??new Z,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 ai(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,f=o+h;l=Y.add(l,Y.NW),e.x0=d+c*Y.uX(l),e.y0=f+h*Y.uY(l),l=Y.add(l,2),e.x1=d+c*Y.uX(l),e.y1=f+h*Y.uY(l),l=Y.add(l,2),e.x2=d+c*Y.uX(l),e.y2=f+h*Y.uY(l),l=Y.add(l,2),e.x3=d+c*Y.uX(l),e.y3=f+h*Y.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&&(this._source.off("resize",this.update,this),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 w(O,"Texture.baseTexture is now Texture.source"),this._source}};A.EMPTY=new A({label:"EMPTY",source:new Z({label:"EMPTY"})});A.EMPTY.destroy=gu;A.WHITE=new A({source:new Dr({resource:new Uint8Array([255,255,255,255]),width:1,height:1,alphaMode:"premultiply-alpha-on-upload",label:"WHITE"}),label:"WHITE"});A.WHITE.destroy=gu;});var U3,xu,le,Zt=p(()=>{so();ti();We();ee();dr();U3=0,xu=class{constructor(e){this._poolKeyHash=Object.create(null),this._texturePool={},this.textureOptions=e||{},this.enableFullScreen=false,this.textureStyle=new De(this.textureOptions);}createTexture(e,t,i){let s=new Z({...this.textureOptions,width:e,height:t,resolution:1,antialias:i,autoGarbageCollect:false});return new A({source:s,label:`texturePool_${U3++}`})}getOptimalTexture(e,t,i=1,s){let n=Math.ceil(e*i-1e-6),o=Math.ceil(t*i-1e-6);n=Kt(n),o=Kt(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={};}},le=new xu;Tt.register(le);});var Fr,mh=p(()=>{K();hh();Zt();Fr=class{constructor(){this.renderPipeId="renderGroup",this.root=null,this.canBundle=false,this.renderGroupParent=null,this.renderGroupChildren=[],this.worldTransform=new P,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 ni,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&&(le.returnTexture(this.texture,true),this.texture=null);}updateCacheTexture(){this.textureNeedsUpdate=true;let e=this._parentCacheAsTextureRenderGroup;e&&!e.textureNeedsUpdate&&e.updateCacheTexture();}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 P),this._inverseWorldTransform.copyFrom(this.worldTransform).invert())}get textureOffsetInverseTransform(){return (this._matrixDirty&2)===0?this._textureOffsetInverseTransform:(this._matrixDirty&=-3,this._textureOffsetInverseTransform||(this._textureOffsetInverseTransform=new P),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 P),this._inverseParentTextureTransform.copyFrom(this.worldTransform).prepend(e.inverseWorldTransform).translate(-e._textureBounds.x,-e._textureBounds.y)):this.worldTransform}get cacheToLocalTransform(){return this.isCachedAsTexture?this.textureOffsetInverseTransform:this._parentCacheAsTextureRenderGroup?this._parentCacheAsTextureRenderGroup.textureOffsetInverseTransform:null}};});function fs(r,e,t={}){for(let i in e)!t[i]&&e[i]!==void 0&&(r[i]=e[i]);}var gh=p(()=>{});var gx,xh,xx,_h,ps,no,ui,m1,Q,Qe=p(()=>{Ke();Ne();Qg();S();K();$c();ei();Ge();re();ne();jt();rx();ix();sx();ox();ax();ux();oh();cx();hx();dx();fx();mh();gh();gx=new ce(null),xh=new ce(null),xx=new ce(null,1,1),_h=new ce(null),ps=1,no=2,ui=4,m1=8,Q=class r extends fe{constructor(e={}){super(),this.uid=W("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.parentRenderLayer=null,this.updateTick=-1,this.localTransform=new P,this.relativeGroupTransform=new P,this.groupTransform=this.relativeGroupTransform,this.destroyed=false,this._position=new ce(this,0,0),this._scale=xx,this._pivot=xh,this._origin=_h,this._skew=gx,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=[],fs(this,e,{children:true,parent:true,effects:true}),e.children?.forEach(t=>this.addChild(t)),e.parent?.addChild(this);}static mixin(e){w("8.8.0","Container.mixin is deprecated, please use extensions.mixin instead."),G.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||w(O,"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=he.get(Fr,this),this.groupTransform=P.IDENTITY,e?.addChild(this),this._updateIsSimple();}disableRenderGroup(){if(!this.renderGroup)return;let e=this.parentRenderGroup;e?.removeChild(this),he.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 P),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*Xc}set angle(e){this.rotation=e*Yc;}get pivot(){return this._pivot===xh&&(this._pivot=new ce(this,0,0)),this._pivot}set pivot(e){this._pivot===xh&&(this._pivot=new ce(this,0,0),this._origin!==_h&&R("Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.")),typeof e=="number"?this._pivot.set(e):this._pivot.copyFrom(e);}get skew(){return this._skew===gx&&(this._skew=new ce(this,0,0)),this._skew}set skew(e){this._skew===gx&&(this._skew=new ce(this,0,0)),this._skew.copyFrom(e);}get scale(){return this._scale===xx&&(this._scale=new ce(this,1,1)),this._scale}set scale(e){this._scale===xx&&(this._scale=new ce(this,0,0)),typeof e=="string"&&(e=parseFloat(e)),typeof e=="number"?this._scale.set(e):this._scale.copyFrom(e);}get origin(){return this._origin===_h&&(this._origin=new ce(this,0,0)),this._origin}set origin(e){this._origin===_h&&(this._origin=new ce(this,0,0),this._pivot!==xh&&R("Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.")),typeof e=="number"?this._origin.set(e):this._origin.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.origin.set(typeof e.originX=="number"?e.originX:this.origin.x,typeof e.originY=="number"?e.originY:this.origin.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._origin,o=this._position,a=i._x,u=i._y,l=s._x,c=s._y,h=-n._x,d=-n._y;t.a=this._cx*a,t.b=this._sx*a,t.c=this._cy*u,t.d=this._sy*u,t.tx=o._x-(l*t.a+c*t.c)+(h*t.a+d*t.c)-h,t.ty=o._y-(l*t.b+c*t.d)+(h*t.b+d*t.d)-d;}set alpha(e){e!==this.localAlpha&&(this.localAlpha=e,this._updateFlags|=ps,this._onUpdate());}get alpha(){return this.localAlpha}set tint(e){let i=H.shared.setValue(e??16777215).toBgrNumber();i!==this.localColor&&(this.localColor=i,this._updateFlags|=ps,this._onUpdate());}get tint(){return Mr(this.localColor)}set blendMode(e){this.localBlendMode!==e&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=true),this._updateFlags|=no,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|=ui,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|=ui,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|=ui,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._origin=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;}};G.mixin(Q,Zc,rh,ch,uh,ah,Jc,eh,lh,zc,qc,nh,Qc);});var Je,li=p(()=>{Je=(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))(Je||{});});var ci,_x=p(()=>{ci=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 g1,be,Gr=p(()=>{li();_x();g1=class Bt{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 ci(null,null,1/0),this.deltaMS=1/Bt.targetFPMS,this.elapsedMS=1/Bt.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=Je.NORMAL){return this._addListener(new ci(e,t,i))}addOnce(e,t,i=Je.NORMAL){return this._addListener(new ci(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*Bt.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,Bt.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(!Bt._shared){let e=Bt._shared=new Bt;e.autoStart=true,e._protected=true;}return Bt._shared}static get system(){if(!Bt._system){let e=Bt._system=new Bt;e.autoStart=true,e._protected=true;}return Bt._system}};g1.targetFPMS=.06;be=g1;});var hi,bh=p(()=>{li();Gr();hi=class{constructor(e){this._lastTransform="",this._observer=null,this._tickerAttached=false,this.updateTranslation=()=>{if(!this._canvas)return;let t=this._canvas.getBoundingClientRect(),i=this._canvas.width,s=this._canvas.height,n=t.width/i*this._renderer.resolution,o=t.height/s*this._renderer.resolution,a=t.left,u=t.top,l=`translate(${a}px, ${u}px) scale(${n}, ${o})`;l!==this._lastTransform&&(this._domElement.style.transform=l,this._lastTransform=l);},this._domElement=e.domElement,this._renderer=e.renderer,!(globalThis.OffscreenCanvas&&this._renderer.canvas instanceof OffscreenCanvas)&&(this._canvas=this._renderer.canvas,this._attachObserver());}get canvas(){return this._canvas}ensureAttached(){!this._domElement.parentNode&&this._canvas.parentNode&&(this._canvas.parentNode.appendChild(this._domElement),this.updateTranslation());}_attachObserver(){"ResizeObserver"in globalThis?(this._observer&&(this._observer.disconnect(),this._observer=null),this._observer=new ResizeObserver(e=>{for(let t of e){if(t.target!==this._canvas)continue;let i=this.canvas.width,s=this.canvas.height,n=t.contentRect.width/i*this._renderer.resolution,o=t.contentRect.height/s*this._renderer.resolution;(this._lastScaleX!==n||this._lastScaleY!==o)&&(this.updateTranslation(),this._lastScaleX=n,this._lastScaleY=o);}}),this._observer.observe(this._canvas)):this._tickerAttached||be.shared.add(this.updateTranslation,this,Je.HIGH);}destroy(){this._observer?(this._observer.disconnect(),this._observer=null):this._tickerAttached&&be.shared.remove(this.updateTranslation),this._domElement=null,this._renderer=null,this._canvas=null,this._tickerAttached=false,this._lastTransform="",this._lastScaleX=null,this._lastScaleY=null;}};});var fr,_u=p(()=>{vt();fr=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 q,this.page=new q,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 I3(r){return function(e){return e.test(r)}}function bu(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=I3(t),n={apple:{phone:s(bx)&&!s(Ur),ipod:s(x1),tablet:!s(bx)&&(s(_1)||w1(e))&&!s(Ur),universal:s(b1),device:(s(bx)||s(x1)||s(_1)||s(b1)||w1(e))&&!s(Ur)},amazon:{phone:s(oo),tablet:!s(oo)&&s(yh),device:s(oo)||s(yh)},android:{phone:!s(Ur)&&s(oo)||!s(Ur)&&s(yx),tablet:!s(Ur)&&!s(oo)&&!s(yx)&&(s(yh)||s(y1)),device:!s(Ur)&&(s(oo)||s(yh)||s(yx)||s(y1))||s(/\bokhttp\b/i)},windows:{phone:s(Ur),tablet:s(v1),device:s(Ur)||s(v1)},other:{blackberry:s(T1),blackberry10:s(S1),opera:s(E1),firefox:s(C1),chrome:s(A1),device:s(T1)||s(S1)||s(E1)||s(C1)||s(A1)},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 bx,x1,_1,b1,yx,y1,oo,yh,Ur,v1,T1,S1,E1,A1,C1,w1,vx=p(()=>{bx=/iPhone/i,x1=/iPod/i,_1=/iPad/i,b1=/\biOS-universal(?:.+)Mac\b/i,yx=/\bAndroid(?:.+)Mobile\b/i,y1=/Android/i,oo=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,yh=/Silk/i,Ur=/Windows Phone/i,v1=/\bWindows(?:.+)ARM\b/i,T1=/BlackBerry/i,S1=/BB10/i,E1=/Opera Mini/i,A1=/\b(CriOS|Chrome)(?:.+)Mobile/i,C1=/Mobile(?:.+)Firefox\b/i,w1=function(r){return typeof r<"u"&&r.platform==="MacIntel"&&typeof r.maxTouchPoints=="number"&&r.maxTouchPoints>1&&typeof MSStream>"u"};});var P1=p(()=>{vx();vx();});var O3,vh,Tx=p(()=>{P1();O3=bu.default??bu,vh=O3(globalThis.navigator);});var k3,B1,L3,N3,R1,M1,H3,V3,z3,Sx,Th,Ex=p(()=>{bh();_u();S();Tx();Kc();k3=9,B1=100,L3=0,N3=0,R1=2,M1=1,H3=-1e3,V3=-1e3,z3=2,Sx=class D1{constructor(e,t=vh){this._mobileInfo=t,this.debug=false,this._activateOnTab=true,this._deactivateOnMouseMove=true,this._isActive=false,this._isMobileAccessibility=false,this._div=null,this._pools={},this._renderId=0,this._children=[],this._androidUpdateCount=0,this._androidUpdateFrequency=500,this._isRunningTests=false,this._boundOnKeyDown=this._onKeyDown.bind(this),this._boundOnMouseMove=this._onMouseMove.bind(this),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}get div(){return this._div}_createTouchHook(){let e=document.createElement("button");e.style.width=`${M1}px`,e.style.height=`${M1}px`,e.style.position="absolute",e.style.top=`${H3}px`,e.style.left=`${V3}px`,e.style.zIndex=z3.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.position="absolute",this._div.style.top=`${L3}px`,this._div.style.left=`${N3}px`,this._div.style.pointerEvents="none",this._div.style.zIndex=R1.toString(),this._canvasObserver=new hi({domElement:this._div,renderer:this._renderer})),this._activateOnTab&&globalThis.addEventListener("keydown",this._boundOnKeyDown,false),this._deactivateOnMouseMove&&globalThis.document.addEventListener("mousemove",this._boundOnMouseMove,true);let e=this._renderer.view.canvas;if(e.parentNode)this._canvasObserver.ensureAttached(),this._initAccessibilitySetup();else {let t=new MutationObserver(()=>{e.parentNode&&(t.disconnect(),this._canvasObserver.ensureAttached(),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._boundOnMouseMove,true),this._activateOnTab&&globalThis.addEventListener("keydown",this._boundOnKeyDown,false),this._renderer.runners.postrender.remove(this);for(let e of this._children)e._accessibleDiv?.parentNode&&(e._accessibleDiv.parentNode.removeChild(e._accessibleDiv),e._accessibleDiv=null),e._accessibleActive=false;for(let e in this._pools)this._pools[e].forEach(i=>{i.parentNode&&i.parentNode.removeChild(i);}),delete this._pools[e];this._div?.parentNode&&this._div.parentNode.removeChild(this._div),this._pools={},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:{...D1.defaultOptions,...e?.accessibilityOptions||{}}};this.debug=i.accessibilityOptions.debug,this._activateOnTab=i.accessibilityOptions.activateOnTab,this._deactivateOnMouseMove=i.accessibilityOptions.deactivateOnMouseMove,i.accessibilityOptions.enabledByDefault&&this._activate(),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)&&!this._isRunningTests))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._getPool(s.accessibleType).push(s._accessibleDiv),s._accessibleDiv=null),s._accessibleActive=false,eo(this._children,i,1));}this._renderer.renderingToScreen&&this._canvasObserver.ensureAttached();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;n.style.left=`${a.tx+o.x*a.a}px`,n.style.top=`${a.ty+o.y*a.d}px`,n.style.width=`${o.width*a.a}px`,n.style.height=`${o.height*a.d}px`;}else this._capHitArea(o),n.style.left=`${o.x}px`,n.style.top=`${o.y}px`,n.style.width=`${o.width}px`,n.style.height=`${o.height}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 i=this._getPool(e.accessibleType).pop();i?(i.innerHTML="",i.removeAttribute("title"),i.removeAttribute("aria-label"),i.tabIndex=0):(e.accessibleType==="button"?i=document.createElement("button"):(i=document.createElement(e.accessibleType),i.style.cssText=`
|
|
5
5
|
color: transparent;
|
|
6
6
|
pointer-events: none;
|
|
7
7
|
padding: 0;
|
|
@@ -14,9 +14,9 @@ Deprecated since v${r}`,n=typeof console.groupCollapsed=="function"&&!Ps.noColor
|
|
|
14
14
|
-webkit-user-select: none;
|
|
15
15
|
-moz-user-select: none;
|
|
16
16
|
-ms-user-select: none;
|
|
17
|
-
`,e.accessibleText&&(i.innerText=e.accessibleText)),i.style.width=`${a1}px`,i.style.height=`${a1}px`,i.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",i.style.position="absolute",i.style.zIndex=u1.toString(),i.style.borderStyle="none",navigator.userAgent.toLowerCase().includes("chrome")?i.setAttribute("aria-live","off"):i.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?i.setAttribute("aria-relevant","additions"):i.setAttribute("aria-relevant","text"),i.addEventListener("click",this._onClick.bind(this)),i.addEventListener("focus",this._onFocus.bind(this)),i.addEventListener("focusout",this._onFocusOut.bind(this))),i.style.pointerEvents=e.accessiblePointerEvents,i.type=e.accessibleType,e.accessibleTitle&&e.accessibleTitle!==null?i.title=e.accessibleTitle:(!e.accessibleHint||e.accessibleHint===null)&&(i.title=`container ${e.tabIndex}`),e.accessibleHint&&e.accessibleHint!==null&&i.setAttribute("aria-label",e.accessibleHint),e.interactive?i.tabIndex=e.tabIndex:i.tabIndex=0,this.debug&&this._updateDebugHTML(i),e._accessibleActive=true,e._accessibleDiv=i,i.container=e,this._children.push(e),this._div.appendChild(e._accessibleDiv);}_dispatchEvent(e,t){let{container:i}=e.target,s=this._renderer.events.rootBoundary,n=Object.assign(new vr(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!==NA||!this._activateOnTab||this._activate();}_onMouseMove(e){e.movementX===0&&e.movementY===0||this._deactivate();}destroy(){this._deactivate(),this._destroyTouchHook(),this._canvasObserver?.destroy(),this._canvasObserver=null,this._div=null,this._pools=null,this._children=null,this._renderer=null,this._hookDiv=null,globalThis.removeEventListener("keydown",this._boundOnKeyDown),this._boundOnKeyDown=null,globalThis.document.removeEventListener("mousemove",this._boundOnMouseMove,true),this._boundOnMouseMove=null;}setAccessibilityEnabled(e){e?this._activate():this._deactivate();}_getPool(e){return this._pools[e]||(this._pools[e]=[]),this._pools[e]}};$f.extension={type:[m.WebGLSystem,m.WebGPUSystem],name:"accessibility"};$f.defaultOptions={enabledByDefault:false,debug:false,activateOnTab:true,deactivateOnMouseMove:true};jf=$f;});var Kf,Zf=p(()=>{Kf={accessible:false,accessibleTitle:null,accessibleHint:null,tabIndex:0,accessibleType:"button",accessibleText:null,accessiblePointerEvents:"auto",accessibleChildren:true,_accessibleActive:false,_accessibleDiv:null,_renderId:-1};});var h1=p(()=>{S();Ze();qf();Zf();G.add(jf);G.mixin(Q,Kf);});var Fs,Qf=p(()=>{S();Fs=class{static init(e){Object.defineProperty(this,"resizeTo",{configurable:true,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;}};Fs.extension=m.Application;});var Gs,Jf=p(()=>{S();Qr();yr();Gs=class{static init(e){e=Object.assign({autoStart:true,sharedTicker:false},e),Object.defineProperty(this,"ticker",{configurable:true,set(t){this._ticker&&this._ticker.remove(this.render,this),this._ticker=t,t&&t.add(this.render,this,et.LOW);},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop();},this.start=()=>{this._ticker.start();},this._ticker=null,this.ticker=e.sharedTicker?be.shared:new be,e.autoStart&&this.start();}static destroy(){if(this._ticker){let e=this._ticker;this.ticker=null,e.destroy();}}};Gs.extension=m.Application;});var ep=p(()=>{S();Qf();Jf();G.add(Fs);G.add(Gs);});var tp,Gt,Gl=p(()=>{Qr();yr();tp=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||(be.system.add(this._tickerUpdate,this,et.INTERACTION),this._tickerAdded=true);}removeTickerListener(){this._tickerAdded&&(be.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());}destroy(){this.removeTickerListener(),this.events=null,this.domElement=null,this._deltaTime=0,this._didMove=false,this._tickerAdded=false,this._pauseUpdate=true;}},Gt=new tp;});var sr,Ko=p(()=>{bt();jo();sr=class extends vr{constructor(){super(...arguments),this.client=new q,this.movement=new q,this.offset=new q,this.global=new q,this.screen=new q;}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,f,g,_){throw new Error("Method not implemented.")}};});var tt,Ul=p(()=>{Ko();tt=class extends sr{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 Nt,Il=p(()=>{Ko();Nt=class extends sr{constructor(){super(...arguments),this.DOM_DELTA_PIXEL=0,this.DOM_DELTA_LINE=1,this.DOM_DELTA_PAGE=2;}};Nt.DOM_DELTA_PIXEL=0;Nt.DOM_DELTA_LINE=1;Nt.DOM_DELTA_PAGE=2;});var YA,$A,Zo,Qo,rp=p(()=>{je();bt();se();Gl();Ko();Ul();Il();YA=2048,$A=new q,Zo=new q,Qo=class{constructor(e){this.dispatch=new fe,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 M(`[EventBoundary]: Event mapping not defined for ${e.type}`);}hitTest(e,t){Gt.pauseUpdate=true;let s=this._isPointerMoveEvent&&this.enableGlobalMoveEvents?"hitTestMoveRecursive":"hitTestRecursive",n=this[s](this.rootTarget,this.rootTarget.eventMode,$A.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<YA&&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")&&(Gt.pauseUpdate=false),e.interactiveChildren&&e.children){let c=e.children;for(let h=c.length-1;h>=0;h--){let d=c[h],f=this.hitTestMoveRecursive(d,this._isInteractive(t)?t:d.eventMode,i,s,n,o||n(e,i));if(f){if(f.length>0&&!f[f.length-1].parent)continue;let g=e.isInteractive();(f.length>0||g)&&(g&&this._allInteractiveElements.push(e),f.push(e)),this._hitElements.length===0&&(this._hitElements=f),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")&&(Gt.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 f=e.isInteractive();return (d.length>0||f)&&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,Zo),!e.hitArea.contains(Zo.x,Zo.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,Zo),e.containsPoint(Zo)):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 tt)){M("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 tt)){M("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 tt)){M("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 tt)){M("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 tt)){M("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 tt)){M("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 Nt)){M("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(tt);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(Nt);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(tt);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 tt&&t instanceof tt&&(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 sr&&t instanceof sr&&(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 jA,qA,sp,Jo,Ol=p(()=>{S();rp();Gl();Ul();Il();jA=1,qA={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},sp=class ip{constructor(e){this.supportsTouchEvents="ontouchstart"in globalThis,this.supportsPointerEvents=!!globalThis.PointerEvent,this.domElement=null,this.resolution=1,this.renderer=e,this.rootBoundary=new Qo(null),Gt.init(this),this.autoPreventDefault=true,this._eventsAdded=false,this._rootPointerEvent=new tt(null),this._rootWheelEvent=new Nt(null),this.cursorStyles={default:"inherit",pointer:"pointer"},this.features=new Proxy({...ip.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,ip._defaultEventMode=e.eventMode??"passive",Object.assign(this.features,e.eventFeatures??{}),this.rootBoundary.enableGlobalMoveEvents=this.features.globalMove;}resolutionChange(e){this.resolution=e;}destroy(){Gt.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,Gt.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,Gt.domElement=e,this._addEvents();}_addEvents(){if(this._eventsAdded||!this.domElement)return;Gt.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;Gt.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=jA),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=qA[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;}};sp.extension={name:"events",type:[m.WebGLSystem,m.CanvasSystem,m.WebGPUSystem],priority:-1};sp.defaultEventFeatures={move:true,globalMove:true,click:true,wheel:true};Jo=sp;});var np,op=p(()=>{Ol();jo();np={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??Jo.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 vr))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 d1=p(()=>{S();Ze();Ol();op();G.add(Jo);G.mixin(Q,np);});var Us,ap=p(()=>{S();Dl();Us=class{constructor(e){this._attachedDomElements=[],this._renderer=e,this._renderer.runners.postrender.add(this),this._renderer.runners.init.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";}init(){this._canvasObserver=new Mi({domElement:this._domElement,renderer:this._renderer});}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}this._canvasObserver.ensureAttached();for(let t=0;t<e.length;t++){let i=e[t],s=i.element;if(!i.parent||i.globalDisplayStatus<7)s?.remove(),e.splice(t,1),t--;else {this._domElement.contains(s)||(s.style.position="absolute",s.style.pointerEvents="auto",this._domElement.appendChild(s));let n=i.worldTransform,o=i._anchor,a=i.width*o.x,u=i.height*o.y;s.style.transformOrigin=`${a}px ${u}px`,s.style.transform=`matrix(${n.a}, ${n.b}, ${n.c}, ${n.d}, ${n.tx-a}, ${n.ty-u})`,s.style.opacity=i.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._canvasObserver.destroy(),this._renderer=null;}};Us.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"dom"};});var Ue,Ht=p(()=>{qe();Ze();Ue=class extends Q{constructor(e){super(e),this.canBundle=true,this.allowChildren=false,this._roundPixels=0,this._lastUsed=-1,this._gpuData=Object.create(null),this.autoGarbageCollect=true,this._gcLastUsed=-1,this._bounds=new oe(0,1,0,0),this._boundsDirty=true,this.autoGarbageCollect=e.autoGarbageCollect??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);}unload(){this.emit("unload",this);for(let e in this._gpuData)this._gpuData[e]?.destroy();this._gpuData=Object.create(null),this.onViewUpdate();}destroy(e){this.unload(),super.destroy(e),this._bounds=null;}collectRenderablesSimple(e,t,i){let{renderPipes:s}=t;s.blendMode.pushBlendMode(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);s.blendMode.popBlendMode(e);}};});var up,f1=p(()=>{bt();Ht();up=class extends Ue{constructor(e={}){let{element:t,anchor:i,...s}=e;super({label:"DOMContainer",...s}),this.renderPipeId="dom",this.batched=false,this._anchor=new q(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 p1=p(()=>{S();ap();G.add(Us);});var Te,Pt=p(()=>{Te=(r=>(r[r.Low=0]="Low",r[r.Normal=1]="Normal",r[r.High=2]="High",r))(Te||{});});var lp,cp=p(()=>{lp={createCanvas:(r,e)=>{let t=document.createElement("canvas");return t.width=r,t.height=e,t},createImage:()=>new Image,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 m1,U,ae=p(()=>{cp();m1=lp,U={get(){return m1},set(r){m1=r;}};});function Vt(r){if(typeof r!="string")throw new TypeError(`Path must be a string. Received ${JSON.stringify(r)}`)}function ea(r){return r.split("?")[0].split("#")[0]}function KA(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ZA(r,e,t){return r.replace(new RegExp(KA(e),"g"),t)}function QA(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 Le,Jr=p(()=>{ae();Le={toPosix(r){return ZA(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){Vt(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(Vt(r),this.isDataUrl(r)||this.isBlobUrl(r))return r;let i=ea(this.toPosix(e??U.get().getBaseUrl())),s=ea(this.toPosix(t??this.rootname(i)));return r=this.toPosix(r),r.startsWith("/")?Le.join(s,r.slice(1)):this.isAbsolute(r)?r:this.join(i,r)},normalize(r){if(Vt(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=QA(r),r.length>0&&i&&(r+="/"),t?`/${r}`:e+r},isAbsolute(r){return Vt(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(Vt(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(Vt(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){Vt(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){Vt(r),e&&Vt(e),r=ea(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){Vt(r),r=ea(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){Vt(r);let e={root:"",dir:"",base:"",ext:"",name:""};if(r.length===0)return e;r=ea(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 rt,Is=p(()=>{rt=(r,e,t=false)=>(Array.isArray(r)||(r=[r]),e?r.map(i=>typeof i=="string"||t?e(i):i):r);});function g1(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?g1(r.replace(i[t],a),e,t+1,i,s):s.push(r.replace(i[t],a));}}function hp(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);}),g1(r,s,0,t,i);}else i.push(r);return i}var dp=p(()=>{});var ei,ta=p(()=>{ei=r=>!Array.isArray(r);});function x1(r){return r.split(".").pop().split("?").shift().split("#").shift()}var it,ti=p(()=>{se();Jr();Is();dp();ta();it=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 rt(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&&M("[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)&&M(`[Resolver] already has key: ${n} overwriting`);},rt(t).forEach(n=>{let{src:o}=n,{data:a,format:u,loadParser:l,parser:c}=n,h=rt(o).map(_=>typeof _=="string"?hp(_):Array.isArray(_)?_:[_]),d=this.getAlias(n);Array.isArray(d)?d.forEach(i):i(d);let f=[],g=_=>({...this._parsers.find(b=>b.test(_))?.parse(_),src:_});h.forEach(_=>{_.forEach(x=>{let b={};if(typeof x!="object"?b=g(x):(a=x.data??a,u=x.format??u,(x.loadParser||x.parser)&&(l=x.loadParser??l,c=x.parser??c),b={...g(x.src),...x}),!d)throw new Error(`[Resolver] alias is undefined for this asset: ${b.src}`);b=this._buildResolvedAsset(b,{aliases:d,data:a,format:u,loadParser:l,parser:c,progressSize:n.progressSize}),f.push(b);});}),d.forEach(_=>{this._assetMap[_]=f;});});}resolveBundle(e){let t=ei(e);e=rt(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=ei(e);e=rt(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,parser:o,format:a,progressSize:u}=t;return (this._basePath||this._rootPath)&&(e.src=Le.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.parser=o??e.parser,e.format=a??e.format??x1(e.src),u!==void 0&&(e.progressSize=u),e}};it.RETINA_PREFIX=/@([0-9\.]+)x/;});var Os,kl=p(()=>{Os=(r,e)=>{let t=e.split("?")[1];return t&&(r+=`?${t}`),r};});var _1,Ll,fp=p(()=>{De();He();ee();_1=class ra{constructor(e,t){this.linkedSheets=[];let i=e;e?.source instanceof Z&&(i={texture:e,data:t});let{texture:s,data:n,cachePrefix:o=""}=i;this.cachePrefix=o,this._texture=s instanceof C?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<=ra.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch();})}_processFrames(e){let t=e,i=ra.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 V(0,0,Math.floor(l.w)/this.resolution,Math.floor(l.h)/this.resolution);n.rotated?a=new V(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 V(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 V(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 C({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*ra.BATCH_SIZE),this._batchIndex++,setTimeout(()=>{this._batchIndex*ra.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=[];}};_1.BATCH_SIZE=1e3;Ll=_1;});function b1(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=Le.dirname(r[0]);e.linkedSheets.forEach((n,o)=>{let a=b1([`${s}/${e.data.meta.related_multi_packs[o]}`],n,true);Object.assign(i,a);});}return i}var JA,pp,mp=p(()=>{Pt();ti();kl();S();ee();Jr();fp();JA=["jpg","png","jpeg","avif","webp","basis","etc2","bc7","bc6h","bc5","bc4","bc3","bc2","bc1","eac","astc"];pp={extension:m.Asset,cache:{test:r=>r instanceof Ll,getCacheableAssets:(r,e)=>b1(r,e,false)},resolver:{extension:{type:m.ResolveParser,name:"resolveSpritesheet"},test:r=>{let t=r.split("?")[0].split("."),i=t.pop(),s=t.pop();return i==="json"&&JA.includes(s)},parse:r=>{let e=r.split(".");return {resolution:parseFloat(it.RETINA_PREFIX.exec(r)?.[1]??"1"),format:e[e.length-2],src:r}}},loader:{name:"spritesheetLoader",id:"spritesheet",extension:{type:m.LoadParser,priority:Te.Normal,name:"spritesheetLoader"},async testParse(r,e){return Le.extname(e.src).toLowerCase()===".json"&&!!r.frames},async parse(r,e,t){let{texture:i,imageFilename:s,textureOptions:n,cachePrefix:o}=e?.data??{},a=Le.dirname(e.src);a&&a.lastIndexOf("/")!==a.length-1&&(a+="/");let u;if(i instanceof C)u=i;else {let h=Os(a+(s??r.meta.image),e.src);u=(await t.load([{src:h,data:n}]))[h];}let l=new Ll({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 f of c){if(typeof f!="string")continue;let g=a+f;e.data?.ignoreMultiPack||(g=Os(g,e.src),h.push(t.load({src:g,data:{textureOptions:n,ignoreMultiPack:true}})));}let d=await Promise.all(h);l.linkedSheets=d,d.forEach(f=>{f.linkedSheets=[l].concat(l.linkedSheets.filter(g=>g!==f));});}return l},async unload(r,e,t){await t.unload(r.textureSource._sourceOrigin),r.destroy(false);}}};});var Nl=p(()=>{S();mp();G.add(pp);});function ia(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 Hl=p(()=>{});var st,ri=p(()=>{Xr();ee();Hl();re();Ht();st=class r extends Ue{constructor(e=C.EMPTY){e instanceof C&&(e={texture:e});let{texture:t=C.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 he({_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 C?new r(e):new r(C.from(e,t))}set texture(e){e||(e=C.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 ia(this._visualBounds,this._anchor,this._texture),this._visualBounds}get sourceBounds(){return w("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;}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 Di(r,e,t){let i=e3;r.measurable=true,br(r,t,i),e.addBoundsMask(i),r.measurable=false;}var e3,sa=p(()=>{qe();yi();e3=new oe;});function Fi(r,e,t){let i=yt.get();r.measurable=true;let s=Fe.get().identity(),n=y1(r,t,s);Ti(r,i,n),r.measurable=false,e.addBoundsMask(i),Fe.return(s),yt.return(i);}function y1(r,e,t){return r?(r!==e&&(y1(r.parent,e,t),r.updateLocalTransform(),t.append(r.localTransform)),t):(M("Mask bounds, renderable is not inside the root container"),t)}var na=p(()=>{Xo();$r();se();});var ks,gp=p(()=>{S();ri();sa();na();ks=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 st),this.mask.renderable=this.renderMaskToTexture,this.mask.includeInBuild=!this.renderMaskToTexture,this.mask.measurable=false;}reset(){this.mask!==null&&(this.mask.measurable=true,this.mask=null);}addBounds(e,t){this.inverse||Di(this.mask,e,t);}addLocalBounds(e,t){Fi(this.mask,e,t);}containsPoint(e,t){let i=this.mask;return t(i,e)}destroy(){this.reset();}static test(e){return e instanceof st}};ks.extension=m.MaskEffect;});var Ls,xp=p(()=>{S();Ls=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"}};Ls.extension=m.MaskEffect;});var Ns,_p=p(()=>{S();Ze();sa();na();Ns=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!==null&&(this.mask.measurable=true,this.mask.includeInBuild=true,this.mask=null);}addBounds(e,t){Di(this.mask,e,t);}addLocalBounds(e,t){Fi(this.mask,e,t);}containsPoint(e,t){let i=this.mask;return t(i,e)}destroy(){this.reset();}static test(e){return e instanceof Q}};Ns.extension=m.MaskEffect;});var Qe,Gi=p(()=>{ae();S();He();Qe=class extends Z{constructor(e){e.resource||(e.resource=U.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"))}};Qe.extension=m.TextureSource;});var ut,Ui=p(()=>{S();He();ut=class extends Z{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}};ut.extension=m.TextureSource;});async function oa(){return bp??(bp=(async()=>{let e=U.get().createCanvas(1,1).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"})()),bp}var bp,Vl=p(()=>{ae();});var zl,ii,Wl=p(()=>{S();yr();Vl();He();zl=class v1 extends Z{constructor(e){super(e),this.isReady=false,this.uploadMethodId="video",e={...v1.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=be.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 oa(),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&&(be.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||(be.shared.add(this.updateFrame,this),this._isConnectedToTicker=true,this._msToNextUpdate=0)):(this._videoFrameRequestCallbackHandle!==null&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(be.shared.remove(this.updateFrame,this),this._isConnectedToTicker=false,this._msToNextUpdate=0));}static test(e){return globalThis.HTMLVideoElement&&e instanceof HTMLVideoElement}};zl.extension=m.TextureSource;zl.defaultOptions={...Z.defaultOptions,autoLoad:true,autoPlay:true,updateFPS:0,crossorigin:true,loop:false,muted:true,playsinline:true,preload:false};zl.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};ii=zl;});var yp,te,nr=p(()=>{se();Is();yp=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||M(`[Assets] Asset id ${e} was not found in the Cache`),t}set(e,t){let i=rt(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&&M("[Cache] already has key:",u),this._cache.set(u,n.get(u));});}remove(e){if(!this._cacheMap.has(e)){M(`[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}},te=new yp;});function t3(r={}){return Tp(r)}function Tp(r={}){let e=r&&r.resource,t=e?r.resource:r,i=e?r:{resource:r};for(let s=0;s<vp.length;s++){let n=vp[s];if(n.test(t))return new n(i)}throw new Error(`Could not find a source type for resource: ${i.resource}`)}function T1(r={},e=false){let t=r&&r.resource,i=t?r.resource:r,s=t?r:{resource:r};if(!e&&te.has(i))return te.get(i);let n=new C({source:Tp(s)});return n.on("destroy",()=>{te.has(i)&&te.remove(i);}),e||te.set(i,n),n}function S1(r,e=false){return typeof r=="string"?te.get(r):r instanceof Z?new C({source:r}):T1(r,e)}var vp,Sp=p(()=>{nr();S();He();ee();vp=[];G.handleByList(m.TextureSource,vp);C.from=S1;Z.from=Tp;});var Xl=p(()=>{S();gp();xp();_p();Al();Gi();Ui();Wl();Sp();G.add(ks,Ls,Ns,ii,ut,Qe,Kr);});var Ve,Sr=p(()=>{Ve=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,t){let i=this.resources;for(let s in i)i[s]._gcLastUsed=e,i[s]._touched=t;}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 Ii(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 E1[i]||r3(r,e,i,t)}function r3(r,e,t,i){let s={},n=0;for(let a=0;a<i;a++){let u=a<e?r[a]:C.EMPTY.source;s[n++]=u.source,s[n++]=u.style;}let o=new Ve(s);return E1[t]=o,o}var E1,aa=p(()=>{Sr();ee();E1={};});var zt,Yl=p(()=>{zt=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.uint32View=null,this.float32View=null,this.uint16View=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._int32View=null,this._float64Array=null,this._bigUint64Array=null;}static sizeOf(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 Hs(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 $l=p(()=>{});var Ep,ge,si=p(()=>{Ep={normal:"normal-npm",add:"add-npm",screen:"screen-npm"},ge=(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))(ge||{});});function or(r,e){return e.alphaMode==="no-premultiply-alpha"&&Ep[r]||r}var Vs=p(()=>{si();});function ua(){return (!jl||jl?.isContextLost())&&(jl=U.get().createCanvas().getContext("webgl",{})),jl}var jl,ql=p(()=>{ae();});function s3(r){let e="";for(let t=0;t<r;++t)t>0&&(e+=`
|
|
18
|
-
else `),t<r-1&&(e+=`if(test == ${t}.0){}`);return e}function
|
|
19
|
-
`);});function Ap(){if(zs)return zs;let r=ua();return zs=r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS),zs=la(zs,r),r.getExtension("WEBGL_lose_context")?.loseContext(),zs}var zs,Cp=p(()=>{ql();Kl();zs=null;});var ca,wp=p(()=>{ca=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 A1(){return Ql>0?da[--Ql]:new Zl}function C1(r){da[Ql++]=r;}var Zl,da,Ql,ha,w1,Pp,Bp=p(()=>{Me();Yl();re();Yr();$l();Vs();Cp();wp();Zl=class{constructor(){this.renderPipeId="batch",this.action="startBatch",this.start=0,this.size=0,this.textures=new ca,this.blendMode="normal",this.topology="triangle-strip",this.canBundle=true;}destroy(){this.textures=null,this.gpuBindGroup=null,this.bindGroup=null,this.batcher=null;}},da=[],Ql=0;Ct.register({clear:()=>{if(da.length>0)for(let r of da)r&&r.destroy();da.length=0,Ql=0;}});ha=0,w1=class P1{constructor(e){this.uid=W("batcher"),this.dirty=true,this.batchIndex=0,this.batches=[],this._elements=[],e={...P1.defaultOptions,...e},e.maxTextures||(w("v8.8.0","maxTextures is a required option for Batcher now, please pass it in the options"),e.maxTextures=Ap());let{maxTextures:t,attributesInitialSize:i,indicesInitialSize:s}=e;this.attributeBuffer=new zt(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++)C1(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=A1(),s=i.textures;s.clear();let n=t[this.elementStart],o=or(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,f="startBatch",g=this.maxTextures;for(let _=this.elementStart;_<this.elementSize;++_){let x=t[_];t[_]=null;let y=x.texture._source,v=or(x.blendMode,y),T=o!==v||a!==x.topology;if(y._batchTick===ha&&!T){x._textureId=y._textureBindLocation,h+=x.indexSize,x.packAsQuad?(this.packQuadAttributes(x,u,l,x._attributeStart,x._textureId),this.packQuadIndex(c,x._indexStart,x._attributeStart/this.vertexSize)):(this.packAttributes(x,u,l,x._attributeStart,x._textureId),this.packIndex(x,c,x._indexStart,x._attributeStart/this.vertexSize)),x._batch=i;continue}y._batchTick=ha,(s.count>=g||T)&&(this._finishBatch(i,d,h-d,s,o,a,e,f),f="renderBatch",d=h,o=v,a=x.topology,i=A1(),s=i.textures,s.clear(),++ha),x._textureId=y._textureBindLocation=s.count,s.ids[y.uid]=s.count,s.textures[s.count++]=y,x._batch=i,h+=x.indexSize,x.packAsQuad?(this.packQuadAttributes(x,u,l,x._attributeStart,x._textureId),this.packQuadIndex(c,x._indexStart,x._attributeStart/this.vertexSize)):(this.packAttributes(x,u,l,x._attributeStart,x._textureId),this.packIndex(x,c,x._indexStart,x._attributeStart/this.vertexSize));}s.count>0&&(this._finishBatch(i,d,h-d,s,o,a,e,f),d=h,++ha),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,++ha,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 zt(t);Hs(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 Hs(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(e={}){if(this.batches!==null){for(let t=0;t<this.batchIndex;t++)C1(this.batches[t]);this.batches=null,this.geometry.destroy(true),this.geometry=null,e.shader&&(this.shader?.destroy(),this.shader=null);for(let t=0;t<this._elements.length;t++)this._elements[t]&&(this._elements[t]._batch=null);this._elements=null,this.indexBuffer=null,this.attributeBuffer.destroy(),this.attributeBuffer=null;}}};w1.defaultOptions={maxTextures:null,attributesInitialSize:4,indicesInitialSize:6};Pp=w1;});var j,ar=p(()=>{j=(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))(j||{});});var Ee,Er=p(()=>{je();Me();ar();Ee=class extends fe{constructor(e){let{data:t,size:i}=e,{usage:s,label:n,shrinkToFit:o}=e;super(),this._gpuData=Object.create(null),this._gcLastUsed=-1,this.autoGarbageCollect=true,this.uid=W("buffer"),this._resourceType="buffer",this._resourceId=W("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&j.STATIC)}set static(e){e?this.descriptor.usage|=j.STATIC:this.descriptor.usage&=~j.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=W("resource"),this.emit("change",this));return}i&&this.emit("update",this);}update(e){this._updateSize=e??this._updateSize,this._updateID++,this.emit("update",this);}unload(){this.emit("unload",this);for(let e in this._gpuData)this._gpuData[e]?.destroy();this._gpuData=Object.create(null);}destroy(){this.destroyed=true,this.unload(),this.emit("destroy",this),this.emit("change",this),this._data=null,this.descriptor=null,this.removeAllListeners();}};});function Jl(r,e){if(!(r instanceof Ee)){let t=e?j.INDEX:j.VERTEX;r instanceof Array&&(e?(r=new Uint32Array(r),t=j.INDEX|j.COPY_DST):(r=new Float32Array(r),t=j.VERTEX|j.COPY_DST)),r=new Ee({data:r,label:e?"index-mesh-buffer":"vertex-mesh-buffer",usage:t});}return r}var Rp=p(()=>{Er();ar();});function Mp(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||8)/l;for(let d=c;d<s.length;d+=h){let f=s[d],g=s[d+1];f>a&&(a=f),g>u&&(u=g),f<n&&(n=f),g<o&&(o=g);}return t.minX=n,t.minY=o,t.maxX=a,t.maxY=u,t}var Dp=p(()=>{});function n3(r){return (r instanceof Ee||Array.isArray(r)||r.BYTES_PER_ELEMENT)&&(r={buffer:r}),r.buffer=Jl(r.buffer,false),r}var lt,ni=p(()=>{je();qe();Me();Er();Rp();Dp();lt=class extends fe{constructor(e={}){super(),this._gpuData=Object.create(null),this.autoGarbageCollect=true,this._gcLastUsed=-1,this.uid=W("geometry"),this._layoutKey=0,this.instanceCount=1,this._bounds=new oe,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=n3(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=Jl(e,true),this.buffers.push(this.indexBuffer);}get bounds(){return this._boundsDirty?(this._boundsDirty=false,Mp(this,"aPosition",this._bounds)):this._bounds}unload(){this.emit("unload",this);for(let e in this._gpuData)this._gpuData[e]?.destroy();this._gpuData=Object.create(null);}destroy(e=false){this.emit("destroy",this),this.removeAllListeners(),e&&this.buffers.forEach(t=>t.destroy()),this.unload(),this.indexBuffer?.destroy(),this.attributes=null,this.buffers=null,this.indexBuffer=null,this._bounds=null;}};});var o3,a3,fa,Fp=p(()=>{Er();ar();ni();o3=new Float32Array(1),a3=new Uint32Array(1),fa=class extends lt{constructor(){let t=new Ee({data:o3,label:"attribute-batch-buffer",usage:j.VERTEX|j.COPY_DST,shrinkToFit:false}),i=new Ee({data:a3,label:"index-batch-buffer",usage:j.INDEX|j.COPY_DST,shrinkToFit:false}),s=24;super({attributes:{aPosition:{buffer:t,format:"float32x2",stride:s,offset:0},aUV:{buffer:t,format:"float32x2",stride:s,offset:8},aColor:{buffer:t,format:"unorm8x4",stride:s,offset:16},aTextureIdAndRound:{buffer:t,format:"uint16x2",stride:s,offset:20}},indexBuffer:i});}};});function ur(r,e){let t=B1[r];return t===void 0&&(Gp[e]===void 0&&(Gp[e]=1),B1[r]=t=Gp[e]++),t}var Gp,B1,Ws=p(()=>{Gp=Object.create(null),B1=Object.create(null);});function Up(){if(!ec){ec="mediump";let r=ua();r&&r.getShaderPrecisionFormat&&(ec=r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).precision?"highp":"mediump");}return ec}var ec,Ip=p(()=>{ql();});function Op(r,e,t){return e?r:t?(r=r.replace("out vec4 finalColor;",""),`
|
|
17
|
+
`,e.accessibleText&&(i.innerText=e.accessibleText)),i.style.width=`${B1}px`,i.style.height=`${B1}px`,i.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",i.style.position="absolute",i.style.zIndex=R1.toString(),i.style.borderStyle="none",navigator.userAgent.toLowerCase().includes("chrome")?i.setAttribute("aria-live","off"):i.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?i.setAttribute("aria-relevant","additions"):i.setAttribute("aria-relevant","text"),i.addEventListener("click",this._onClick.bind(this)),i.addEventListener("focus",this._onFocus.bind(this)),i.addEventListener("focusout",this._onFocusOut.bind(this))),i.style.pointerEvents=e.accessiblePointerEvents,i.type=e.accessibleType,e.accessibleTitle&&e.accessibleTitle!==null?i.title=e.accessibleTitle:(!e.accessibleHint||e.accessibleHint===null)&&(i.title=`container ${e.tabIndex}`),e.accessibleHint&&e.accessibleHint!==null&&i.setAttribute("aria-label",e.accessibleHint),e.interactive?i.tabIndex=e.tabIndex:i.tabIndex=0,this.debug&&this._updateDebugHTML(i),e._accessibleActive=true,e._accessibleDiv=i,i.container=e,this._children.push(e),this._div.appendChild(e._accessibleDiv);}_dispatchEvent(e,t){let{container:i}=e.target,s=this._renderer.events.rootBoundary,n=Object.assign(new fr(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!==k3||!this._activateOnTab||this._activate();}_onMouseMove(e){e.movementX===0&&e.movementY===0||this._deactivate();}destroy(){this._deactivate(),this._destroyTouchHook(),this._canvasObserver?.destroy(),this._canvasObserver=null,this._div=null,this._pools=null,this._children=null,this._renderer=null,this._hookDiv=null,globalThis.removeEventListener("keydown",this._boundOnKeyDown),this._boundOnKeyDown=null,globalThis.document.removeEventListener("mousemove",this._boundOnMouseMove,true),this._boundOnMouseMove=null;}setAccessibilityEnabled(e){e?this._activate():this._deactivate();}_getPool(e){return this._pools[e]||(this._pools[e]=[]),this._pools[e]}};Sx.extension={type:[m.WebGLSystem,m.WebGPUSystem],name:"accessibility"};Sx.defaultOptions={enabledByDefault:false,debug:false,activateOnTab:true,deactivateOnMouseMove:true};Th=Sx;});var Sh,Ax=p(()=>{Sh={accessible:false,accessibleTitle:null,accessibleHint:null,tabIndex:0,accessibleType:"button",accessibleText:null,accessiblePointerEvents:"auto",accessibleChildren:true,_accessibleActive:false,_accessibleDiv:null,_renderId:-1};});var F1=p(()=>{S();Qe();Ex();Ax();G.add(Th);G.mixin(Q,Sh);});var ms,Cx=p(()=>{S();ms=class{static init(e){Object.defineProperty(this,"resizeTo",{configurable:true,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;}};ms.extension=m.Application;});var gs,wx=p(()=>{S();li();Gr();gs=class{static init(e){e=Object.assign({autoStart:true,sharedTicker:false},e),Object.defineProperty(this,"ticker",{configurable:true,set(t){this._ticker&&this._ticker.remove(this.render,this),this._ticker=t,t&&t.add(this.render,this,Je.LOW);},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop();},this.start=()=>{this._ticker.start();},this._ticker=null,this.ticker=e.sharedTicker?be.shared:new be,e.autoStart&&this.start();}static destroy(){if(this._ticker){let e=this._ticker;this.ticker=null,e.destroy();}}};gs.extension=m.Application;});var Px=p(()=>{S();Cx();wx();G.add(ms);G.add(gs);});var Bx,Rt,Eh=p(()=>{li();Gr();Bx=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||(be.system.add(this._tickerUpdate,this,Je.INTERACTION),this._tickerAdded=true);}removeTickerListener(){this._tickerAdded&&(be.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());}destroy(){this.removeTickerListener(),this.events=null,this.domElement=null,this._deltaTime=0,this._didMove=false,this._tickerAdded=false,this._pauseUpdate=true;}},Rt=new Bx;});var Qt,yu=p(()=>{vt();_u();Qt=class extends fr{constructor(){super(...arguments),this.client=new q,this.movement=new q,this.offset=new q,this.global=new q,this.screen=new q;}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,f,g,_){throw new Error("Method not implemented.")}};});var et,Ah=p(()=>{yu();et=class extends Qt{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 Ut,Ch=p(()=>{yu();Ut=class extends Qt{constructor(){super(...arguments),this.DOM_DELTA_PIXEL=0,this.DOM_DELTA_LINE=1,this.DOM_DELTA_PAGE=2;}};Ut.DOM_DELTA_PIXEL=0;Ut.DOM_DELTA_LINE=1;Ut.DOM_DELTA_PAGE=2;});var W3,X3,vu,ao,Rx=p(()=>{Ke();vt();ne();Eh();yu();Ah();Ch();W3=2048,X3=new q,vu=new q,ao=class{constructor(e){this.dispatch=new fe,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 R(`[EventBoundary]: Event mapping not defined for ${e.type}`);}hitTest(e,t){Rt.pauseUpdate=true;let s=this._isPointerMoveEvent&&this.enableGlobalMoveEvents?"hitTestMoveRecursive":"hitTestRecursive",n=this[s](this.rootTarget,this.rootTarget.eventMode,X3.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<W3&&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")&&(Rt.pauseUpdate=false),e.interactiveChildren&&e.children){let c=e.children;for(let h=c.length-1;h>=0;h--){let d=c[h],f=this.hitTestMoveRecursive(d,this._isInteractive(t)?t:d.eventMode,i,s,n,o||n(e,i));if(f){if(f.length>0&&!f[f.length-1].parent)continue;let g=e.isInteractive();(f.length>0||g)&&(g&&this._allInteractiveElements.push(e),f.push(e)),this._hitElements.length===0&&(this._hitElements=f),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")&&(Rt.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 f=e.isInteractive();return (d.length>0||f)&&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,vu),!e.hitArea.contains(vu.x,vu.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,vu),e.containsPoint(vu)):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 et)){R("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 et)){R("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 et)){R("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 et)){R("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 et)){R("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 et)){R("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 Ut)){R("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(et);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(Ut);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(et);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 et&&t instanceof et&&(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 Qt&&t instanceof Qt&&(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 Y3,$3,Dx,uo,wh=p(()=>{S();Rx();Eh();Ah();Ch();Y3=1,$3={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},Dx=class Mx{constructor(e){this.supportsTouchEvents="ontouchstart"in globalThis,this.supportsPointerEvents=!!globalThis.PointerEvent,this.domElement=null,this.resolution=1,this.renderer=e,this.rootBoundary=new ao(null),Rt.init(this),this.autoPreventDefault=true,this._eventsAdded=false,this._rootPointerEvent=new et(null),this._rootWheelEvent=new Ut(null),this.cursorStyles={default:"inherit",pointer:"pointer"},this.features=new Proxy({...Mx.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,Mx._defaultEventMode=e.eventMode??"passive",Object.assign(this.features,e.eventFeatures??{}),this.rootBoundary.enableGlobalMoveEvents=this.features.globalMove;}resolutionChange(e){this.resolution=e;}destroy(){Rt.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,Rt.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,Rt.domElement=e,this._addEvents();}_addEvents(){if(this._eventsAdded||!this.domElement)return;Rt.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;Rt.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=Y3),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=$3[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;}};Dx.extension={name:"events",type:[m.WebGLSystem,m.CanvasSystem,m.WebGPUSystem],priority:-1};Dx.defaultEventFeatures={move:true,globalMove:true,click:true,wheel:true};uo=Dx;});var Ph,Fx=p(()=>{wh();_u();Ph={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??uo.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 fr))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 G1=p(()=>{S();Qe();wh();Fx();G.add(uo);G.mixin(Q,Ph);});var xs,Gx=p(()=>{S();bh();xs=class{constructor(e){this._attachedDomElements=[],this._renderer=e,this._renderer.runners.postrender.add(this),this._renderer.runners.init.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";}init(){this._canvasObserver=new hi({domElement:this._domElement,renderer:this._renderer});}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}this._canvasObserver.ensureAttached();for(let t=0;t<e.length;t++){let i=e[t],s=i.element;if(!i.parent||i.globalDisplayStatus<7)s?.remove(),e.splice(t,1),t--;else {this._domElement.contains(s)||(s.style.position="absolute",s.style.pointerEvents="auto",this._domElement.appendChild(s));let n=i.worldTransform,o=i._anchor,a=i.width*o.x,u=i.height*o.y;s.style.transformOrigin=`${a}px ${u}px`,s.style.transform=`matrix(${n.a}, ${n.b}, ${n.c}, ${n.d}, ${n.tx-a}, ${n.ty-u})`,s.style.opacity=i.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._canvasObserver.destroy(),this._renderer=null;}};xs.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"dom"};});var Fe,Jt=p(()=>{Ze();Qe();Fe=class extends Q{constructor(e){super(e),this.canBundle=true,this.allowChildren=false,this._roundPixels=0,this._lastUsed=-1,this._gpuData=Object.create(null),this.autoGarbageCollect=true,this._gcLastUsed=-1,this._bounds=new oe(0,1,0,0),this._boundsDirty=true,this.autoGarbageCollect=e.autoGarbageCollect??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);}unload(){this.emit("unload",this);for(let e in this._gpuData)this._gpuData[e]?.destroy();this._gpuData=Object.create(null),this.onViewUpdate();}destroy(e){this.unload(),super.destroy(e),this._bounds=null;}collectRenderablesSimple(e,t,i){let{renderPipes:s}=t;s.blendMode.pushBlendMode(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);s.blendMode.popBlendMode(e);}};});var Bh,U1=p(()=>{vt();Jt();Bh=class extends Fe{constructor(e={}){let{element:t,anchor:i,...s}=e;super({label:"DOMContainer",...s}),this.renderPipeId="dom",this.batched=false,this._anchor=new q(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 I1=p(()=>{S();Gx();G.add(xs);});var Te,Mt=p(()=>{Te=(r=>(r[r.Low=0]="Low",r[r.Normal=1]="Normal",r[r.High=2]="High",r))(Te||{});});var Rh,Ux=p(()=>{Rh={createCanvas:(r,e)=>{let t=document.createElement("canvas");return t.width=r,t.height=e,t},createImage:()=>new Image,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 O1,U,ae=p(()=>{Ux();O1=Rh,U={get(){return O1},set(r){O1=r;}};});function er(r){if(typeof r!="string")throw new TypeError(`Path must be a string. Received ${JSON.stringify(r)}`)}function Tu(r){return r.split("?")[0].split("#")[0]}function j3(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function q3(r,e,t){return r.replace(new RegExp(j3(e),"g"),t)}function K3(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 Ie,di=p(()=>{ae();Ie={toPosix(r){return q3(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){er(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(er(r),this.isDataUrl(r)||this.isBlobUrl(r))return r;let i=Tu(this.toPosix(e??U.get().getBaseUrl())),s=Tu(this.toPosix(t??this.rootname(i)));return r=this.toPosix(r),r.startsWith("/")?Ie.join(s,r.slice(1)):this.isAbsolute(r)?r:this.join(i,r)},normalize(r){if(er(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=K3(r),r.length>0&&i&&(r+="/"),t?`/${r}`:e+r},isAbsolute(r){return er(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(er(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(er(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){er(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){er(r),e&&er(e),r=Tu(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){er(r),r=Tu(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){er(r);let e={root:"",dir:"",base:"",ext:"",name:""};if(r.length===0)return e;r=Tu(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 tt,lo=p(()=>{tt=(r,e,t=false)=>(Array.isArray(r)||(r=[r]),e?r.map(i=>typeof i=="string"||t?e(i):i):r);});function k1(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?k1(r.replace(i[t],a),e,t+1,i,s):s.push(r.replace(i[t],a));}}function Mh(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);}),k1(r,s,0,t,i);}else i.push(r);return i}var Ix=p(()=>{});var Ir,Su=p(()=>{Ir=r=>!Array.isArray(r);});function Ox(r){return r.split(".").pop().split("?").shift().split("#").shift()}var rt,fi=p(()=>{ne();di();lo();Ix();Su();rt=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 tt(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&&R("[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)&&R(`[Resolver] already has key: ${n} overwriting`);},tt(t).forEach(n=>{let{src:o}=n,{data:a,format:u,loadParser:l,parser:c}=n,h=tt(o).map(_=>typeof _=="string"?Mh(_):Array.isArray(_)?_:[_]),d=this.getAlias(n);Array.isArray(d)?d.forEach(i):i(d);let f=[],g=_=>({...this._parsers.find(b=>b.test(_))?.parse(_),src:_});h.forEach(_=>{_.forEach(x=>{let b={};if(typeof x!="object"?b=g(x):(a=x.data??a,u=x.format??u,(x.loadParser||x.parser)&&(l=x.loadParser??l,c=x.parser??c),b={...g(x.src),...x}),!d)throw new Error(`[Resolver] alias is undefined for this asset: ${b.src}`);b=this._buildResolvedAsset(b,{aliases:d,data:a,format:u,loadParser:l,parser:c,progressSize:n.progressSize}),f.push(b);});}),d.forEach(_=>{this._assetMap[_]=f;});});}resolveBundle(e){let t=Ir(e);e=tt(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=Ir(e);e=tt(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,parser:o,format:a,progressSize:u}=t;return (this._basePath||this._rootPath)&&(e.src=Ie.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.parser=o??e.parser,e.format=a??e.format??Ox(e.src),u!==void 0&&(e.progressSize=u),e}};rt.RETINA_PREFIX=/@([0-9\.]+)x/;});var _s,Dh=p(()=>{_s=(r,e)=>{let t=e.split("?")[1];return t&&(r+=`?${t}`),r};});var L1,Au,kx=p(()=>{Ue();We();ee();L1=class Eu{constructor(e,t){this.linkedSheets=[];let i=e;e?.source instanceof Z&&(i={texture:e,data:t});let{texture:s,data:n,cachePrefix:o=""}=i;this.cachePrefix=o,this._texture=s instanceof A?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<=Eu.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch();})}_processFrames(e){let t=e,i=Eu.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 V(0,0,Math.floor(l.w)/this.resolution,Math.floor(l.h)/this.resolution);n.rotated?a=new V(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 V(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 V(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 A({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*Eu.BATCH_SIZE),this._batchIndex++,setTimeout(()=>{this._batchIndex*Eu.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=[];}};L1.BATCH_SIZE=1e3;Au=L1;});function N1(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=Ie.dirname(r[0]);e.linkedSheets.forEach((n,o)=>{let a=N1([`${s}/${e.data.meta.related_multi_packs[o]}`],n,true);Object.assign(i,a);});}return i}var Z3,Fh,Lx=p(()=>{Mt();fi();Dh();S();ee();di();kx();Z3=["jpg","png","jpeg","avif","webp","basis","etc2","bc7","bc6h","bc5","bc4","bc3","bc2","bc1","eac","astc"];Fh={extension:m.Asset,cache:{test:r=>r instanceof Au,getCacheableAssets:(r,e)=>N1(r,e,false)},resolver:{extension:{type:m.ResolveParser,name:"resolveSpritesheet"},test:r=>{let t=r.split("?")[0].split("."),i=t.pop(),s=t.pop();return i==="json"&&Z3.includes(s)},parse:r=>{let e=r.split(".");return {resolution:parseFloat(rt.RETINA_PREFIX.exec(r)?.[1]??"1"),format:e[e.length-2],src:r}}},loader:{name:"spritesheetLoader",id:"spritesheet",extension:{type:m.LoadParser,priority:Te.Normal,name:"spritesheetLoader"},async testParse(r,e){return Ie.extname(e.src).toLowerCase()===".json"&&!!r.frames},async parse(r,e,t){let{texture:i,imageFilename:s,textureOptions:n,cachePrefix:o}=e?.data??{},a=Ie.dirname(e.src);a&&a.lastIndexOf("/")!==a.length-1&&(a+="/");let u;if(i instanceof A)u=i;else {let h=_s(a+(s??r.meta.image),e.src);u=(await t.load([{src:h,data:n}]))[h];}let l=new Au({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 f of c){if(typeof f!="string")continue;let g=a+f;e.data?.ignoreMultiPack||(g=_s(g,e.src),h.push(t.load({src:g,data:{textureOptions:n,ignoreMultiPack:true}})));}let d=await Promise.all(h);l.linkedSheets=d,d.forEach(f=>{f.linkedSheets=[l].concat(l.linkedSheets.filter(g=>g!==f));});}return l},async unload(r,e,t){await t.unload(r.textureSource._sourceOrigin),r.destroy(false);}}};});var Gh=p(()=>{S();Lx();G.add(Fh);});function co(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 Uh=p(()=>{});var it,pi=p(()=>{ei();ee();Uh();re();Jt();it=class r extends Fe{constructor(e=A.EMPTY){e instanceof A&&(e={texture:e});let{texture:t=A.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 ce({_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 A?new r(e):new r(A.from(e,t))}set texture(e){e||(e=A.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 co(this._visualBounds,this._anchor,this._texture),this._visualBounds}get sourceBounds(){return w("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;}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 mi(r,e,t){let i=Q3;r.measurable=true,hr(r,t,i),e.addBoundsMask(i),r.measurable=false;}var Q3,Cu=p(()=>{Ze();us();Q3=new oe;});function gi(r,e,t){let i=xt.get();r.measurable=true;let s=Me.get().identity(),n=H1(r,t,s);si(r,i,n),r.measurable=false,e.addBoundsMask(i),Me.return(s),xt.return(i);}function H1(r,e,t){return r?(r!==e&&(H1(r.parent,e,t),r.updateLocalTransform(),t.append(r.localTransform)),t):(R("Mask bounds, renderable is not inside the root container"),t)}var wu=p(()=>{du();ri();ne();});var bs,Nx=p(()=>{S();pi();Cu();wu();bs=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 it),this.mask.renderable=this.renderMaskToTexture,this.mask.includeInBuild=!this.renderMaskToTexture,this.mask.measurable=false;}reset(){this.mask!==null&&(this.mask.measurable=true,this.mask=null);}addBounds(e,t){this.inverse||mi(this.mask,e,t);}addLocalBounds(e,t){gi(this.mask,e,t);}containsPoint(e,t){let i=this.mask;return t(i,e)}destroy(){this.reset();}static test(e){return e instanceof it}};bs.extension=m.MaskEffect;});var ys,Hx=p(()=>{S();ys=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"}};ys.extension=m.MaskEffect;});var vs,Vx=p(()=>{S();Qe();Cu();wu();vs=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!==null&&(this.mask.measurable=true,this.mask.includeInBuild=true,this.mask=null);}addBounds(e,t){mi(this.mask,e,t);}addLocalBounds(e,t){gi(this.mask,e,t);}containsPoint(e,t){let i=this.mask;return t(i,e)}destroy(){this.reset();}static test(e){return e instanceof Q}};vs.extension=m.MaskEffect;});var $e,Ts=p(()=>{ae();S();We();$e=class extends Z{constructor(e){e.resource||(e.resource=U.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"))}};$e.extension=m.TextureSource;});var ot,Ss=p(()=>{S();We();ot=class extends Z{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}};ot.extension=m.TextureSource;});async function ho(){return zx??(zx=(async()=>{let e=U.get().createCanvas(1,1).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"})()),zx}var zx,Ih=p(()=>{ae();});var Oh,Or,kh=p(()=>{S();Gr();Ih();We();Oh=class V1 extends Z{constructor(e){super(e),this.isReady=false,this.uploadMethodId="video",e={...V1.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=be.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 ho(),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&&(be.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||(be.shared.add(this.updateFrame,this),this._isConnectedToTicker=true,this._msToNextUpdate=0)):(this._videoFrameRequestCallbackHandle!==null&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(be.shared.remove(this.updateFrame,this),this._isConnectedToTicker=false,this._msToNextUpdate=0));}static test(e){return globalThis.HTMLVideoElement&&e instanceof HTMLVideoElement}};Oh.extension=m.TextureSource;Oh.defaultOptions={...Z.defaultOptions,autoLoad:true,autoPlay:true,updateFPS:0,crossorigin:true,loop:false,muted:true,playsinline:true,preload:false};Oh.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};Or=Oh;});var Wx,te,pr=p(()=>{ne();lo();Wx=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||R(`[Assets] Asset id ${e} was not found in the Cache`),t}set(e,t){let i=tt(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&&R("[Cache] already has key:",u),this._cache.set(u,n.get(u));});}remove(e){if(!this._cacheMap.has(e)){R(`[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}},te=new Wx;});function z1(r={}){return Yx(r)}function Yx(r={}){let e=r&&r.resource,t=e?r.resource:r,i=e?r:{resource:r};for(let s=0;s<Xx.length;s++){let n=Xx[s];if(n.test(t))return new n(i)}throw new Error(`Could not find a source type for resource: ${i.resource}`)}function $x(r={},e=false){let t=r&&r.resource,i=t?r.resource:r,s=t?r:{resource:r};if(!e&&te.has(i))return te.get(i);let n=new A({source:Yx(s)});return n.on("destroy",()=>{te.has(i)&&te.remove(i);}),e||te.set(i,n),n}function jx(r,e=false){return typeof r=="string"?te.get(r):r instanceof Z?new A({source:r}):$x(r,e)}var Xx,qx=p(()=>{pr();S();We();ee();Xx=[];G.handleByList(m.TextureSource,Xx);A.from=jx;Z.from=Yx;});var Lh=p(()=>{S();Nx();Hx();Vx();fh();Ts();Ss();kh();qx();G.add(bs,ys,vs,Or,ot,$e,Dr);});var He,kr=p(()=>{He=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,t){let i=this.resources;for(let s in i)i[s]._gcLastUsed=e,i[s]._touched=t;}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 xi(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 W1[i]||J3(r,e,i,t)}function J3(r,e,t,i){let s={},n=0;for(let a=0;a<i;a++){let u=a<e?r[a]:A.EMPTY.source;s[n++]=u.source,s[n++]=u.style;}let o=new He(s);return W1[t]=o,o}var W1,Pu=p(()=>{kr();ee();W1={};});var It,Nh=p(()=>{It=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.uint32View=null,this.float32View=null,this.uint16View=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._int32View=null,this._float64Array=null,this._bigUint64Array=null;}static sizeOf(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 Es(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 Hh=p(()=>{});var Vh,ge,_i=p(()=>{Vh={normal:"normal-npm",add:"add-npm",screen:"screen-npm"},ge=(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))(ge||{});});function tr(r,e){return e.alphaMode==="no-premultiply-alpha"&&Vh[r]||r}var fo=p(()=>{_i();});function po(){return (!zh||zh?.isContextLost())&&(zh=U.get().createCanvas().getContext("webgl",{})),zh}var zh,Wh=p(()=>{ae();});function tC(r){let e="";for(let t=0;t<r;++t)t>0&&(e+=`
|
|
18
|
+
else `),t<r-1&&(e+=`if(test == ${t}.0){}`);return e}function mo(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=eC.replace(/%forloop%/gi,tC(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 eC,Xh=p(()=>{eC=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(`
|
|
19
|
+
`);});function Yh(){if(go)return go;let r=po();return go=r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS),go=mo(go,r),r.getExtension("WEBGL_lose_context")?.loseContext(),go}var go,Kx=p(()=>{Wh();Xh();go=null;});var xo,Zx=p(()=>{xo=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 X1(){return $h>0?Ru[--$h]:new Mu}function Y1(r){Ru[$h++]=r;}var Mu,Ru,$h,Bu,$1,jh,Qx=p(()=>{Ge();Nh();re();ti();Hh();fo();Kx();Zx();Mu=class{constructor(){this.renderPipeId="batch",this.action="startBatch",this.start=0,this.size=0,this.textures=new xo,this.blendMode="normal",this.topology="triangle-strip",this.canBundle=true;}destroy(){this.textures=null,this.gpuBindGroup=null,this.bindGroup=null,this.batcher=null;}},Ru=[],$h=0;Tt.register({clear:()=>{if(Ru.length>0)for(let r of Ru)r&&r.destroy();Ru.length=0,$h=0;}});Bu=0,$1=class j1{constructor(e){this.uid=W("batcher"),this.dirty=true,this.batchIndex=0,this.batches=[],this._elements=[],e={...j1.defaultOptions,...e},e.maxTextures||(w("v8.8.0","maxTextures is a required option for Batcher now, please pass it in the options"),e.maxTextures=Yh());let{maxTextures:t,attributesInitialSize:i,indicesInitialSize:s}=e;this.attributeBuffer=new It(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++)Y1(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=X1(),s=i.textures;s.clear();let n=t[this.elementStart],o=tr(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,f="startBatch",g=this.maxTextures;for(let _=this.elementStart;_<this.elementSize;++_){let x=t[_];t[_]=null;let y=x.texture._source,v=tr(x.blendMode,y),T=o!==v||a!==x.topology;if(y._batchTick===Bu&&!T){x._textureId=y._textureBindLocation,h+=x.indexSize,x.packAsQuad?(this.packQuadAttributes(x,u,l,x._attributeStart,x._textureId),this.packQuadIndex(c,x._indexStart,x._attributeStart/this.vertexSize)):(this.packAttributes(x,u,l,x._attributeStart,x._textureId),this.packIndex(x,c,x._indexStart,x._attributeStart/this.vertexSize)),x._batch=i;continue}y._batchTick=Bu,(s.count>=g||T)&&(this._finishBatch(i,d,h-d,s,o,a,e,f),f="renderBatch",d=h,o=v,a=x.topology,i=X1(),s=i.textures,s.clear(),++Bu),x._textureId=y._textureBindLocation=s.count,s.ids[y.uid]=s.count,s.textures[s.count++]=y,x._batch=i,h+=x.indexSize,x.packAsQuad?(this.packQuadAttributes(x,u,l,x._attributeStart,x._textureId),this.packQuadIndex(c,x._indexStart,x._attributeStart/this.vertexSize)):(this.packAttributes(x,u,l,x._attributeStart,x._textureId),this.packIndex(x,c,x._indexStart,x._attributeStart/this.vertexSize));}s.count>0&&(this._finishBatch(i,d,h-d,s,o,a,e,f),d=h,++Bu),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,++Bu,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 It(t);Es(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 Es(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(e={}){if(this.batches!==null){for(let t=0;t<this.batchIndex;t++)Y1(this.batches[t]);this.batches=null,this.geometry.destroy(true),this.geometry=null,e.shader&&(this.shader?.destroy(),this.shader=null);for(let t=0;t<this._elements.length;t++)this._elements[t]&&(this._elements[t]._batch=null);this._elements=null,this.indexBuffer=null,this.attributeBuffer.destroy(),this.attributeBuffer=null;}}};$1.defaultOptions={maxTextures:null,attributesInitialSize:4,indicesInitialSize:6};jh=$1;});var j,mr=p(()=>{j=(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))(j||{});});var Ee,Lr=p(()=>{Ke();Ge();mr();Ee=class extends fe{constructor(e){let{data:t,size:i}=e,{usage:s,label:n,shrinkToFit:o}=e;super(),this._gpuData=Object.create(null),this._gcLastUsed=-1,this.autoGarbageCollect=true,this.uid=W("buffer"),this._resourceType="buffer",this._resourceId=W("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&j.STATIC)}set static(e){e?this.descriptor.usage|=j.STATIC:this.descriptor.usage&=~j.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=W("resource"),this.emit("change",this));return}i&&this.emit("update",this);}update(e){this._updateSize=e??this._updateSize,this._updateID++,this.emit("update",this);}unload(){this.emit("unload",this);for(let e in this._gpuData)this._gpuData[e]?.destroy();this._gpuData=Object.create(null);}destroy(){this.destroyed=true,this.unload(),this.emit("destroy",this),this.emit("change",this),this._data=null,this.descriptor=null,this.removeAllListeners();}};});function Du(r,e){if(!(r instanceof Ee)){let t=e?j.INDEX:j.VERTEX;r instanceof Array&&(e?(r=new Uint32Array(r),t=j.INDEX|j.COPY_DST):(r=new Float32Array(r),t=j.VERTEX|j.COPY_DST)),r=new Ee({data:r,label:e?"index-mesh-buffer":"vertex-mesh-buffer",usage:t});}return r}var Jx=p(()=>{Lr();mr();});function qh(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||8)/l;for(let d=c;d<s.length;d+=h){let f=s[d],g=s[d+1];f>a&&(a=f),g>u&&(u=g),f<n&&(n=f),g<o&&(o=g);}return t.minX=n,t.minY=o,t.maxX=a,t.maxY=u,t}var e_=p(()=>{});function rC(r){return (r instanceof Ee||Array.isArray(r)||r.BYTES_PER_ELEMENT)&&(r={buffer:r}),r.buffer=Du(r.buffer,false),r}var at,bi=p(()=>{Ke();Ze();Ge();Lr();Jx();e_();at=class extends fe{constructor(e={}){super(),this._gpuData=Object.create(null),this.autoGarbageCollect=true,this._gcLastUsed=-1,this.uid=W("geometry"),this._layoutKey=0,this.instanceCount=1,this._bounds=new oe,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=rC(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=Du(e,true),this.buffers.push(this.indexBuffer);}get bounds(){return this._boundsDirty?(this._boundsDirty=false,qh(this,"aPosition",this._bounds)):this._bounds}unload(){this.emit("unload",this);for(let e in this._gpuData)this._gpuData[e]?.destroy();this._gpuData=Object.create(null);}destroy(e=false){this.emit("destroy",this),this.removeAllListeners(),e&&this.buffers.forEach(t=>t.destroy()),this.unload(),this.indexBuffer?.destroy(),this.attributes=null,this.buffers=null,this.indexBuffer=null,this._bounds=null;}};});var iC,sC,_o,t_=p(()=>{Lr();mr();bi();iC=new Float32Array(1),sC=new Uint32Array(1),_o=class extends at{constructor(){let t=new Ee({data:iC,label:"attribute-batch-buffer",usage:j.VERTEX|j.COPY_DST,shrinkToFit:false}),i=new Ee({data:sC,label:"index-batch-buffer",usage:j.INDEX|j.COPY_DST,shrinkToFit:false}),s=24;super({attributes:{aPosition:{buffer:t,format:"float32x2",stride:s,offset:0},aUV:{buffer:t,format:"float32x2",stride:s,offset:8},aColor:{buffer:t,format:"unorm8x4",stride:s,offset:16},aTextureIdAndRound:{buffer:t,format:"uint16x2",stride:s,offset:20}},indexBuffer:i});}};});function rr(r,e){let t=q1[r];return t===void 0&&(r_[e]===void 0&&(r_[e]=1),q1[r]=t=r_[e]++),t}var r_,q1,bo=p(()=>{r_=Object.create(null),q1=Object.create(null);});function Zh(){if(!Kh){Kh="mediump";let r=po();r&&r.getShaderPrecisionFormat&&(Kh=r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).precision?"highp":"mediump");}return Kh}var Kh,i_=p(()=>{Wh();});function Qh(r,e,t){return e?r:t?(r=r.replace("out vec4 finalColor;",""),`
|
|
20
20
|
|
|
21
21
|
#ifdef GL_ES // This checks if it is WebGL1
|
|
22
22
|
#define in varying
|
|
@@ -31,27 +31,27 @@ else `),t<r-1&&(e+=`if(test == ${t}.0){}`);return e}function la(r,e){if(r===0)th
|
|
|
31
31
|
#define out varying
|
|
32
32
|
#endif
|
|
33
33
|
${r}
|
|
34
|
-
`}var
|
|
35
|
-
${r}`}else if(i!=="highp"&&r.substring(0,15)==="precision highp")return r.replace("precision highp","precision mediump");return r}var
|
|
36
|
-
${r}`:r}var
|
|
37
|
-
${r}`}var
|
|
34
|
+
`}var s_=p(()=>{});function Jh(r,e,t){let i=t?e.maxSupportedFragmentPrecision:e.maxSupportedVertexPrecision;if(r.substring(0,9)!=="precision"){let s=t?e.requestedFragmentPrecision:e.requestedVertexPrecision;return s==="highp"&&i!=="highp"&&(s="mediump"),`precision ${s} float;
|
|
35
|
+
${r}`}else if(i!=="highp"&&r.substring(0,15)==="precision highp")return r.replace("precision highp","precision mediump");return r}var n_=p(()=>{});function ed(r,e){return e?`#version 300 es
|
|
36
|
+
${r}`:r}var o_=p(()=>{});function td(r,{name:e="pixi-program"},t=true){e=e.replace(/\s+/g,"-"),e+=t?"-fragment":"-vertex";let i=t?nC:oC;return i[e]?(i[e]++,e+=`-${i[e]}`):i[e]=1,r.indexOf("#define SHADER_NAME")!==-1?r:`${`#define SHADER_NAME ${e}`}
|
|
37
|
+
${r}`}var nC,oC,a_=p(()=>{nC={},oC={};});function rd(r,e){return e?r.replace("#version 300 es",""):r}var u_=p(()=>{});var l_,Fu,K1,xe,_t=p(()=>{bo();i_();s_();n_();o_();a_();u_();l_={stripVersion:rd,ensurePrecision:Jh,addProgramDefines:Qh,setProgramName:td,insertVersion:ed},Fu=Object.create(null),K1=class c_{constructor(e){e={...c_.defaultOptions,...e};let t=e.fragment.indexOf("#version 300 es")!==-1,i={stripVersion:t,ensurePrecision:{requestedFragmentPrecision:e.preferredFragmentPrecision,requestedVertexPrecision:e.preferredVertexPrecision,maxSupportedVertexPrecision:"highp",maxSupportedFragmentPrecision:Zh()},setProgramName:{name:e.name},addProgramDefines:t,insertVersion:t},s=e.fragment,n=e.vertex;Object.keys(l_).forEach(o=>{let a=i[o];s=l_[o](s,a,true),n=l_[o](n,a,false);}),this.fragment=s,this.vertex=n,this.transformFeedbackVaryings=e.transformFeedbackVaryings,this._key=rr(`${this.vertex}:${this.fragment}`,"gl-program");}destroy(){this.fragment=null,this.vertex=null,this._attributeData=null,this._uniformData=null,this._uniformBlockData=null,this.transformFeedbackVaryings=null,Fu[this._cacheKey]=null;}static from(e){let t=`${e.vertex}:${e.fragment}`;return Fu[t]||(Fu[t]=new c_(e),Fu[t]._cacheKey=t),Fu[t]}};K1.defaultOptions={preferredVertexPrecision:"highp",preferredFragmentPrecision:"mediump"};xe=K1;});function ut(r){return Z1[r]??Z1.float32}var Z1,yi=p(()=>{Z1={uint8x2:{size:2,stride:2,normalised:false},uint8x4:{size:4,stride:4,normalised:false},sint8x2:{size:2,stride:2,normalised:false},sint8x4:{size:4,stride:4,normalised:false},unorm8x2:{size:2,stride:2,normalised:true},unorm8x4:{size:4,stride:4,normalised:true},snorm8x2:{size:2,stride:2,normalised:true},snorm8x4:{size:4,stride:4,normalised:true},uint16x2:{size:2,stride:4,normalised:false},uint16x4:{size:4,stride:8,normalised:false},sint16x2:{size:2,stride:4,normalised:false},sint16x4:{size:4,stride:8,normalised:false},unorm16x2:{size:2,stride:4,normalised:true},unorm16x4:{size:4,stride:8,normalised:true},snorm16x2:{size:2,stride:4,normalised:true},snorm16x4:{size:4,stride:8,normalised:true},float16x2:{size:2,stride:4,normalised:false},float16x4:{size:4,stride:8,normalised:false},float32:{size:1,stride:4,normalised:false},float32x2:{size:2,stride:8,normalised:false},float32x3:{size:3,stride:12,normalised:false},float32x4:{size:4,stride:16,normalised:false},uint32:{size:1,stride:4,normalised:false},uint32x2:{size:2,stride:8,normalised:false},uint32x3:{size:3,stride:12,normalised:false},uint32x4:{size:4,stride:16,normalised:false},sint32:{size:1,stride:4,normalised:false},sint32x2:{size:2,stride:8,normalised:false},sint32x3:{size:3,stride:12,normalised:false},sint32x4:{size:4,stride:16,normalised:false}};});function id({source:r,entryPoint:e}){let t={},i=r.indexOf(`fn ${e}`);if(i!==-1){let s=r.indexOf("->",i);if(s!==-1){let n=r.substring(i,s),o=/@location\((\d+)\)\s+([a-zA-Z0-9_]+)\s*:\s*([a-zA-Z0-9_<>]+)(?:,|\s|$)/g,a;for(;(a=o.exec(n))!==null;){let u=aC[a[3]]??"float32";t[a[2]]={location:parseInt(a[1],10),format:u,stride:ut(u).stride,offset:0,instance:false,start:0};}}}return t}var aC,h_=p(()=>{yi();aC={f32:"float32","vec2<f32>":"float32x2","vec3<f32>":"float32x3","vec4<f32>":"float32x4",vec2f:"float32x2",vec3f:"float32x3",vec4f:"float32x4",i32:"sint32","vec2<i32>":"sint32x2","vec3<i32>":"sint32x3","vec4<i32>":"sint32x4",u32:"uint32","vec2<u32>":"uint32x2","vec3<u32>":"uint32x3","vec4<u32>":"uint32x4",bool:"uint32","vec2<bool>":"uint32x2","vec3<bool>":"uint32x3","vec4<bool>":"uint32x4"};});function yo(r){let e=/(^|[^/])@(group|binding)\(\d+\)[^;]+;/g,t=/@group\((\d+)\)/,i=/@binding\((\d+)\)/,s=/var(<[^>]+>)? (\w+)/,n=/:\s*(\w+)/,o=/struct\s+(\w+)\s*{([^}]+)}/g,a=/(\w+)\s*:\s*([\w\<\>]+)/g,u=/struct\s+(\w+)/,l=r.match(e)?.map(h=>({group:parseInt(h.match(t)[1],10),binding:parseInt(h.match(i)[1],10),name:h.match(s)[2],isUniform:h.match(s)[1]==="<uniform>",type:h.match(n)[1]}));if(!l)return {groups:[],structs:[]};let c=r.match(o)?.map(h=>{let d=h.match(u)[1],f=h.match(a).reduce((g,_)=>{let[x,b]=_.split(":");return g[x.trim()]=b.trim(),g},{});return f?{name:d,members:f}:null}).filter(({name:h})=>l.some(d=>d.type===h))??[];return {groups:l,structs:c}}var d_=p(()=>{});var vi,f_=p(()=>{vi=(r=>(r[r.VERTEX=1]="VERTEX",r[r.FRAGMENT=2]="FRAGMENT",r[r.COMPUTE=4]="COMPUTE",r))(vi||{});});function sd({groups:r}){let e=[];for(let t=0;t<r.length;t++){let i=r[t];e[i.group]||(e[i.group]=[]),i.isUniform?e[i.group].push({binding:i.binding,visibility:vi.VERTEX|vi.FRAGMENT,buffer:{type:"uniform"}}):i.type==="sampler"?e[i.group].push({binding:i.binding,visibility:vi.FRAGMENT,sampler:{type:"filtering"}}):i.type==="texture_2d"&&e[i.group].push({binding:i.binding,visibility:vi.FRAGMENT,texture:{sampleType:"float",viewDimension:"2d",multisampled:false}});}return e}var p_=p(()=>{f_();});function nd({groups:r}){let e=[];for(let t=0;t<r.length;t++){let i=r[t];e[i.group]||(e[i.group]={}),e[i.group][i.name]=i.binding;}return e}var m_=p(()=>{});function od(r,e){let t=new Set,i=new Set,s=[...r.structs,...e.structs].filter(o=>t.has(o.name)?false:(t.add(o.name),true)),n=[...r.groups,...e.groups].filter(o=>{let a=`${o.name}-${o.binding}`;return i.has(a)?false:(i.add(a),true)});return {structs:s,groups:n}}var g_=p(()=>{});var Gu,_e,St=p(()=>{bo();h_();d_();p_();m_();g_();Gu=Object.create(null),_e=class r{constructor(e){this._layoutKey=0,this._attributeLocationsKey=0;let{fragment:t,vertex:i,layout:s,gpuLayout:n,name:o}=e;if(this.name=o,this.fragment=t,this.vertex=i,t.source===i.source){let a=yo(t.source);this.structsAndGroups=a;}else {let a=yo(i.source),u=yo(t.source);this.structsAndGroups=od(a,u);}this.layout=s??nd(this.structsAndGroups),this.gpuLayout=n??sd(this.structsAndGroups),this.autoAssignGlobalUniforms=this.layout[0]?.globalUniforms!==void 0,this.autoAssignLocalUniforms=this.layout[1]?.localUniforms!==void 0,this._generateProgramKey();}_generateProgramKey(){let{vertex:e,fragment:t}=this,i=e.source+t.source+e.entryPoint+t.entryPoint;this._layoutKey=rr(i,"program");}get attributeData(){return this._attributeData??(this._attributeData=id(this.vertex)),this._attributeData}destroy(){this.gpuLayout=null,this.layout=null,this.structsAndGroups=null,this.fragment=null,this.vertex=null,Gu[this._cacheKey]=null;}static from(e){let t=`${e.vertex.source}:${e.fragment.source}:${e.fragment.entryPoint}:${e.vertex.entryPoint}`;return Gu[t]||(Gu[t]=new r(e),Gu[t]._cacheKey=t),Gu[t]}};});function Uu(r,e,t){if(r)for(let i in r){let s=i.toLocaleLowerCase(),n=e[s];if(n){let o=r[i];i==="header"&&(o=o.replace(/@in\s+[^;]+;\s*/g,"").replace(/@out\s+[^;]+;\s*/g,"")),t&&n.push(`//----${t}----//`),n.push(o);}else R(`${i} placement hook does not exist in shader`);}}var x_=p(()=>{ne();});function Iu(r){let e={};return (r.match(uC)?.map(i=>i.replace(/[{()}]/g,""))??[]).forEach(i=>{e[i]=[];}),e}var uC,__=p(()=>{uC=/\{\{(.*?)\}\}/g;});function Q1(r,e){let t,i=/@in\s+([^;]+);/g;for(;(t=i.exec(r))!==null;)e.push(t[1]);}function Ou(r,e,t=false){let i=[];Q1(e,i),r.forEach(a=>{a.header&&Q1(a.header,i);});let s=i;t&&s.sort();let n=s.map((a,u)=>` @location(${u}) ${a},`).join(`
|
|
38
38
|
`),o=e.replace(/@in\s+[^;]+;\s*/g,"");return o=o.replace("{{in}}",`
|
|
39
39
|
${n}
|
|
40
|
-
`),o}var
|
|
41
|
-
`),n=t.sort().map(u=>` var ${
|
|
40
|
+
`),o}var b_=p(()=>{});function J1(r,e){let t,i=/@out\s+([^;]+);/g;for(;(t=i.exec(r))!==null;)e.push(t[1]);}function lC(r){let t=/\b(\w+)\s*:/g.exec(r);return t?t[1]:""}function cC(r){let e=/@.*?\s+/g;return r.replace(e,"")}function ad(r,e){let t=[];J1(e,t),r.forEach(u=>{u.header&&J1(u.header,t);});let i=0,s=t.sort().map(u=>u.indexOf("builtin")>-1?u:`@location(${i++}) ${u}`).join(`,
|
|
41
|
+
`),n=t.sort().map(u=>` var ${cC(u)};`).join(`
|
|
42
42
|
`),o=`return VSOutput(
|
|
43
|
-
${t.sort().map(u=>` ${
|
|
43
|
+
${t.sort().map(u=>` ${lC(u)}`).join(`,
|
|
44
44
|
`)});`,a=e.replace(/@out\s+[^;]+;\s*/g,"");return a=a.replace("{{struct}}",`
|
|
45
45
|
${s}
|
|
46
46
|
`),a=a.replace("{{start}}",`
|
|
47
47
|
${n}
|
|
48
48
|
`),a=a.replace("{{return}}",`
|
|
49
49
|
${o}
|
|
50
|
-
`),a}var
|
|
50
|
+
`),a}var y_=p(()=>{});function ku(r,e){let t=r;for(let i in e){let s=e[i];s.join(`
|
|
51
51
|
`).length?t=t.replace(`{{${i}}}`,`//-----${i} START-----//
|
|
52
52
|
${s.join(`
|
|
53
53
|
`)}
|
|
54
|
-
//----${i} FINISH----//`):t=t.replace(`{{${i}}}`,"");}return t}var
|
|
54
|
+
//----${i} FINISH----//`):t=t.replace(`{{${i}}}`,"");}return t}var v_=p(()=>{});function ud({template:r,bits:e}){let t=eT(r,e);if(Ti[t])return Ti[t];let{vertex:i,fragment:s}=dC(r,e);return Ti[t]=tT(i,s,e),Ti[t]}function ld({template:r,bits:e}){let t=eT(r,e);return Ti[t]||(Ti[t]=tT(r.vertex,r.fragment,e)),Ti[t]}function dC(r,e){let t=e.map(o=>o.vertex).filter(o=>!!o),i=e.map(o=>o.fragment).filter(o=>!!o),s=Ou(t,r.vertex,true);s=ad(t,s);let n=Ou(i,r.fragment,true);return {vertex:s,fragment:n}}function eT(r,e){return e.map(t=>(T_.has(t)||T_.set(t,hC++),T_.get(t))).sort((t,i)=>t-i).join("-")+r.vertex+r.fragment}function tT(r,e,t){let i=Iu(r),s=Iu(e);return t.forEach(n=>{Uu(n.vertex,i,n.name),Uu(n.fragment,s,n.name);}),{vertex:ku(r,i),fragment:ku(e,s)}}var Ti,T_,hC,S_=p(()=>{x_();__();b_();y_();v_();Ti=Object.create(null),T_=new Map,hC=0;});var cd,hd,dd,fd,E_=p(()=>{cd=`
|
|
55
55
|
@in aPosition: vec2<f32>;
|
|
56
56
|
@in aUV: vec2<f32>;
|
|
57
57
|
|
|
@@ -95,7 +95,7 @@ ${s.join(`
|
|
|
95
95
|
|
|
96
96
|
{{return}}
|
|
97
97
|
};
|
|
98
|
-
`,
|
|
98
|
+
`,hd=`
|
|
99
99
|
@in vUV : vec2<f32>;
|
|
100
100
|
@in vColor : vec4<f32>;
|
|
101
101
|
|
|
@@ -118,7 +118,7 @@ ${s.join(`
|
|
|
118
118
|
|
|
119
119
|
return finalColor;
|
|
120
120
|
};
|
|
121
|
-
`,
|
|
121
|
+
`,dd=`
|
|
122
122
|
in vec2 aPosition;
|
|
123
123
|
in vec2 aUV;
|
|
124
124
|
|
|
@@ -154,7 +154,7 @@ ${s.join(`
|
|
|
154
154
|
|
|
155
155
|
{{end}}
|
|
156
156
|
}
|
|
157
|
-
`,
|
|
157
|
+
`,fd=`
|
|
158
158
|
|
|
159
159
|
in vec4 vColor;
|
|
160
160
|
in vec2 vUV;
|
|
@@ -175,7 +175,7 @@ ${s.join(`
|
|
|
175
175
|
|
|
176
176
|
{{end}}
|
|
177
177
|
}
|
|
178
|
-
`;});var
|
|
178
|
+
`;});var pd,rT,md,A_=p(()=>{pd={name:"global-uniforms-bit",vertex:{header:`
|
|
179
179
|
struct GlobalUniforms {
|
|
180
180
|
uProjectionMatrix:mat3x3<f32>,
|
|
181
181
|
uWorldTransformMatrix:mat3x3<f32>,
|
|
@@ -184,29 +184,29 @@ ${s.join(`
|
|
|
184
184
|
}
|
|
185
185
|
|
|
186
186
|
@group(0) @binding(0) var<uniform> globalUniforms : GlobalUniforms;
|
|
187
|
-
`}},
|
|
187
|
+
`}},rT={name:"global-uniforms-ubo-bit",vertex:{header:`
|
|
188
188
|
uniform globalUniforms {
|
|
189
189
|
mat3 uProjectionMatrix;
|
|
190
190
|
mat3 uWorldTransformMatrix;
|
|
191
191
|
vec4 uWorldColorAlpha;
|
|
192
192
|
vec2 uResolution;
|
|
193
193
|
};
|
|
194
|
-
`}},
|
|
194
|
+
`}},md={name:"global-uniforms-bit",vertex:{header:`
|
|
195
195
|
uniform mat3 uProjectionMatrix;
|
|
196
196
|
uniform mat3 uWorldTransformMatrix;
|
|
197
197
|
uniform vec4 uWorldColorAlpha;
|
|
198
198
|
uniform vec2 uResolution;
|
|
199
|
-
`}};});function
|
|
199
|
+
`}};});function Ot({bits:r,name:e}){let t=ud({template:{fragment:hd,vertex:cd},bits:[pd,...r]});return _e.from({name:e,vertex:{source:t.vertex,entryPoint:"main"},fragment:{source:t.fragment,entryPoint:"main"}})}function kt({bits:r,name:e}){return new xe({name:e,...ld({template:{vertex:dd,fragment:fd},bits:[md,...r]})})}var Nr=p(()=>{_t();St();S_();E_();A_();});var Si,Ei,vo=p(()=>{Si={name:"color-bit",vertex:{header:`
|
|
200
200
|
@in aColor: vec4<f32>;
|
|
201
201
|
`,main:`
|
|
202
202
|
vColor *= vec4<f32>(aColor.rgb * aColor.a, aColor.a);
|
|
203
|
-
`}},
|
|
203
|
+
`}},Ei={name:"color-bit",vertex:{header:`
|
|
204
204
|
in vec4 aColor;
|
|
205
205
|
`,main:`
|
|
206
206
|
vColor *= vec4(aColor.rgb * aColor.a, aColor.a);
|
|
207
|
-
`}};});function
|
|
208
|
-
`)}function
|
|
209
|
-
`)}function
|
|
207
|
+
`}};});function fC(r){let e=[];if(r===1)e.push("@group(1) @binding(0) var textureSource1: texture_2d<f32>;"),e.push("@group(1) @binding(1) var textureSampler1: sampler;");else {let t=0;for(let i=0;i<r;i++)e.push(`@group(1) @binding(${t++}) var textureSource${i+1}: texture_2d<f32>;`),e.push(`@group(1) @binding(${t++}) var textureSampler${i+1}: sampler;`);}return e.join(`
|
|
208
|
+
`)}function pC(r){let e=[];if(r===1)e.push("outColor = textureSampleGrad(textureSource1, textureSampler1, vUV, uvDx, uvDy);");else {e.push("switch vTextureId {");for(let t=0;t<r;t++)t===r-1?e.push(" default:{"):e.push(` case ${t}:{`),e.push(` outColor = textureSampleGrad(textureSource${t+1}, textureSampler${t+1}, vUV, uvDx, uvDy);`),e.push(" break;}");e.push("}");}return e.join(`
|
|
209
|
+
`)}function Ai(r){return C_[r]||(C_[r]={name:"texture-batch-bit",vertex:{header:`
|
|
210
210
|
@in aTextureIdAndRound: vec2<u32>;
|
|
211
211
|
@out @interpolate(flat) vTextureId : u32;
|
|
212
212
|
`,main:`
|
|
@@ -219,14 +219,14 @@ ${s.join(`
|
|
|
219
219
|
`},fragment:{header:`
|
|
220
220
|
@in @interpolate(flat) vTextureId: u32;
|
|
221
221
|
|
|
222
|
-
${
|
|
222
|
+
${fC(r)}
|
|
223
223
|
`,main:`
|
|
224
224
|
var uvDx = dpdx(vUV);
|
|
225
225
|
var uvDy = dpdy(vUV);
|
|
226
226
|
|
|
227
|
-
${
|
|
228
|
-
`}}),
|
|
229
|
-
`)}function
|
|
227
|
+
${pC(r)}
|
|
228
|
+
`}}),C_[r]}function mC(r){let e=[];for(let t=0;t<r;t++)t>0&&e.push("else"),t<r-1&&e.push(`if(vTextureId < ${t}.5)`),e.push("{"),e.push(` outColor = texture(uTextures[${t}], vUV);`),e.push("}");return e.join(`
|
|
229
|
+
`)}function Ci(r){return w_[r]||(w_[r]={name:"texture-batch-bit",vertex:{header:`
|
|
230
230
|
in vec2 aTextureIdAndRound;
|
|
231
231
|
out float vTextureId;
|
|
232
232
|
|
|
@@ -244,18 +244,18 @@ ${s.join(`
|
|
|
244
244
|
|
|
245
245
|
`,main:`
|
|
246
246
|
|
|
247
|
-
${
|
|
248
|
-
`}}),
|
|
247
|
+
${mC(r)}
|
|
248
|
+
`}}),w_[r]}var C_,w_,To=p(()=>{C_={};w_={};});var Lt,Nt,Hr=p(()=>{Lt={name:"round-pixels-bit",vertex:{header:`
|
|
249
249
|
fn roundPixels(position: vec2<f32>, targetSize: vec2<f32>) -> vec2<f32>
|
|
250
250
|
{
|
|
251
251
|
return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;
|
|
252
252
|
}
|
|
253
|
-
`}}
|
|
253
|
+
`}},Nt={name:"round-pixels-bit",vertex:{header:`
|
|
254
254
|
vec2 roundPixels(vec2 position, vec2 targetSize)
|
|
255
255
|
{
|
|
256
256
|
return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;
|
|
257
257
|
}
|
|
258
|
-
`}};});var nc,Am,Cm=p(()=>{nc=["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>"],Am=nc.reduce((r,e)=>(r[e]=true,r),{});});function wm(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 Pm=p(()=>{});var I1,J,Ie=p(()=>{Me();Ws();Cm();Pm();I1=class O1{constructor(e,t){this._touched=0,this.uid=W("uniform"),this._resourceType="uniformGroup",this._resourceId=W("resource"),this.isUniformGroup=true,this._dirtyId=0,this.destroyed=false,t={...O1.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,!Am[n.type]){let o=n.type.match(/^array<(\w+(?:<\w+>)?),\s*(\d+)>$/);if(o){let[,a,u]=o;throw new Error(`Uniform type ${n.type} is not supported. Use type: '${a}', size: ${u} instead.`)}throw new Error(`Uniform type ${n.type} is not supported. Supported uniform types are: ${nc.join(", ")}`)}n.value??(n.value=wm(n.type,n.size)),i[s]=n.value;}this.uniforms=i,this._dirtyId=1,this.ubo=t.ubo,this.isStatic=t.isStatic,this._signature=ur(Object.keys(i).map(s=>`${s}-${e[s].type}`).join("-"),"uniform-group");}update(){this._dirtyId++;}};I1.defaultOptions={ubo:false,isStatic:false};J=I1;});function Vi(r){let e=k1[r];if(e)return e;let t=new Int32Array(r);for(let i=0;i<r;i++)t[i]=i;return e=k1[r]=new J({uTextures:{value:t,type:"i32",size:r}},{isStatic:true}),e}var k1,xa=p(()=>{Ie();k1={};});var ye,Bt=p(()=>{ye=(r=>(r[r.WEBGL=1]="WEBGL",r[r.WEBGPU=2]="WEBGPU",r[r.BOTH=3]="BOTH",r))(ye||{});});var Ae,Ut=p(()=>{je();Me();ct();Sr();vt();Bt();Ie();Ae=class r extends fe{constructor(e){super(),this.uid=W("shader"),this._uniformBindMap=Object.create(null),this._ownedBindGroups=[],this._destroyed=false;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|=ye.WEBGPU),i&&(o|=ye.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 Ve,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 J(d));let f=u[h];f&&(s[f.group]||(s[f.group]=new Ve,this._ownedBindGroups.push(s[f.group])),s[f.group].setResource(d,f.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 Ve,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._destroyed||(this._destroyed=true,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=xe.from(i)),new r({gpuProgram:n,glProgram:o,...s})}};});var $s,Bm=p(()=>{Ar();Xs();Ys();Cr();xa();Ut();$s=class extends Ae{constructor(e){let t=Xt({name:"batch",bits:[Li,Hi(e),$t]}),i=Wt({name:"batch",bits:[ki,Ni(e),Yt]});super({glProgram:t,gpuProgram:i,resources:{batchSamplers:Vi(e)}}),this.maxTextures=e;}};});var _a,L1,js,oc=p(()=>{S();Bp();Fp();Bm();_a=null,L1=class N1 extends Pp{constructor(e){super(e),this.geometry=new fa,this.name=N1.extension.name,this.vertexSize=6,_a??(_a=new $s(e.maxTextures)),this.shader=_a;}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,f=a.ty,{positions:g,uvs:_}=e,x=e.color,b=e.attributeOffset,y=b+e.attributeSize;for(let v=b;v<y;v++){let T=v*2,B=g[T],E=g[T+1];t[s++]=u*B+c*E+d,t[s++]=h*E+l*B+f,t[s++]=_[T],t[s++]=_[T+1],i[s++]=x,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,f=a.ty,g=e.bounds,_=g.maxX,x=g.minX,b=g.maxY,y=g.minY,v=o.uvs,T=e.color,B=n<<16|e.roundPixels&65535;t[s+0]=u*x+c*y+d,t[s+1]=h*y+l*x+f,t[s+2]=v.x0,t[s+3]=v.y0,i[s+4]=T,i[s+5]=B,t[s+6]=u*_+c*y+d,t[s+7]=h*y+l*_+f,t[s+8]=v.x1,t[s+9]=v.y1,i[s+10]=T,i[s+11]=B,t[s+12]=u*_+c*b+d,t[s+13]=h*b+l*_+f,t[s+14]=v.x2,t[s+15]=v.y2,i[s+16]=T,i[s+17]=B,t[s+18]=u*x+c*b+d,t[s+19]=h*b+l*x+f,t[s+20]=v.x3,t[s+21]=v.y3,i[s+22]=T,i[s+23]=B;}_updateMaxTextures(e){this.shader.maxTextures!==e&&(_a=new $s(e),this.shader=_a);}destroy(){this.shader=null,super.destroy();}};L1.extension={type:[m.Batcher],name:"default"};js=L1;});var pe,dt=p(()=>{pe=class{constructor(e){this.items=Object.create(null);let{renderer:t,type:i,onUnload:s,priority:n,name:o}=e;this._renderer=t,t.gc.addResourceHash(this,"items",i,n??0),this._onUnload=s,this.name=o;}add(e){return this.items[e.uid]?false:(this.items[e.uid]=e,e.once("unload",this.remove,this),e._gcLastUsed=this._renderer.gc.now,true)}remove(e,...t){if(!this.items[e.uid])return;let i=e._gpuData[this._renderer.uid];i&&(this._onUnload?.(e,...t),i.destroy(),e._gpuData[this._renderer.uid]=null,this.items[e.uid]=null);}removeAll(...e){Object.values(this.items).forEach(t=>t&&this.remove(t,...e));}destroy(...e){this.removeAll(...e),this.items=Object.create(null),this._renderer=null,this._onUnload=null;}};});function ba(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,f=a.tx,g=a.ty;for(;u<o;){let _=r[t],x=r[t+1];i[s]=l*_+h*x+f,i[s+1]=c*_+d*x+g,s+=n,t+=e,u++;}}function ya(r,e,t,i){let s=0;for(e*=t;s<i;)r[e]=0,r[e+1]=0,e+=t,s++;}var ac=p(()=>{});function qs(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 f=r[h],g=r[h+1];r[h]=n*f+a*g+l,r[h+1]=o*f+u*g+c,h+=i;}}var uc=p(()=>{});var y3,ui,lc=p(()=>{K();xl();y3=new P,ui=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?Wo(t,i.groupColor)+(this.alpha*i.groupAlpha*255<<24):t+(this.alpha*255<<24)}get transform(){return this.renderable?.groupTransform||y3}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";}destroy(){this.renderable=null,this.texture=null,this.geometryData=null,this._batcher=null,this._batch=null;}};});var zi,Rm,Mm,Dm=p(()=>{S();zi={extension:{type:m.ShapeBuilder,name:"circle"},build(r,e){let t,i,s,n,o,a;if(r.type==="circle"){let T=r;if(o=a=T.radius,o<=0)return false;t=T.x,i=T.y,s=n=0;}else if(r.type==="ellipse"){let T=r;if(o=T.halfWidth,a=T.halfHeight,o<=0||a<=0)return false;t=T.x,i=T.y,s=n=0;}else {let T=r,B=T.width/2,E=T.height/2;t=T.x+B,i=T.y+E,o=a=Math.max(0,Math.min(T.radius,Math.min(B,E))),s=B-o,n=E-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,f=l,g=s+o,_=n,x=t+g,b=t-g,y=i+_;if(e[c++]=x,e[c++]=y,e[--h]=y,e[--h]=b,n){let T=i-_;e[d++]=b,e[d++]=T,e[--f]=T,e[--f]=x;}for(let T=1;T<u;T++){let B=Math.PI/2*(T/u),E=s+Math.cos(B)*o,A=n+Math.sin(B)*a,k=t+E,R=t-E,I=i+A,D=i-A;e[c++]=k,e[c++]=I,e[--h]=I,e[--h]=R,e[d++]=R,e[d++]=D,e[--f]=D,e[--f]=k;}g=s,_=n+a,x=t+g,b=t-g,y=i+_;let v=i-_;return e[c++]=x,e[c++]=y,e[--f]=v,e[--f]=x,s&&(e[c++]=b,e[c++]=y,e[--f]=v,e[--f]=b),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;}},Rm={...zi,extension:{...zi.extension,name:"ellipse"}},Mm={...zi,extension:{...zi.extension,name:"roundedRectangle"}};});var Fm,Gm,H1=p(()=>{Fm=1e-4,Gm=1e-4;});function Um(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 Im=p(()=>{});function V1(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,f;o?(d=i,f=-t):(d=-i,f=t);let g=u+d,_=l+f,x=c+d,b=h+f;return a.push(g,_),a.push(x,b),2}function Wi(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,f=h-c,g=Math.abs(f),_=Math.sqrt(u*u+l*l),x=(15*g*Math.sqrt(_)/Math.PI>>0)+1,b=f/x;if(d+=b,a){o.push(r,e),o.push(t,i);for(let y=1,v=d;y<x;y++,v+=b)o.push(r,e),o.push(r+Math.sin(v)*_,e+Math.cos(v)*_);o.push(r,e),o.push(s,n);}else {o.push(t,i),o.push(r,e);for(let y=1,v=d;y<x;y++,v+=b)o.push(r+Math.sin(v)*_,e+Math.cos(v)*_),o.push(r,e);o.push(s,n),o.push(r,e);}return x*2}function Om(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 ue=Um(r);t&&(ue*=-1),u=(u-.5)*ue+.5;}let l=new q(r[0],r[1]),c=new q(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 ue=(l.x+c.x)*.5,zr=(c.y+l.y)*.5;r.unshift(ue,zr),r.push(ue,zr);}let f=s,g=r.length/2,_=r.length,x=f.length/2,b=a.width/2,y=b*b,v=a.miterLimit*a.miterLimit,T=r[0],B=r[1],E=r[2],A=r[3],k=0,R=0,I=-(B-A),D=T-E,z=0,ie=0,ce=Math.sqrt(I*I+D*D);I/=ce,D/=ce,I*=b,D*=b;let xr=u,F=(1-xr)*2,L=xr*2;h||(a.cap==="round"?_+=Wi(T-I*(F-L)*.5,B-D*(F-L)*.5,T-I*F,B-D*F,T+I*L,B+D*L,f,true)+2:a.cap==="square"&&(_+=V1(T,B,I,D,F,L,true,f))),f.push(T-I*F,B-D*F),f.push(T+I*L,B+D*L);for(let ue=1;ue<g-1;++ue){T=r[(ue-1)*2],B=r[(ue-1)*2+1],E=r[ue*2],A=r[ue*2+1],k=r[(ue+1)*2],R=r[(ue+1)*2+1],I=-(B-A),D=T-E,ce=Math.sqrt(I*I+D*D),I/=ce,D/=ce,I*=b,D*=b,z=-(A-R),ie=E-k,ce=Math.sqrt(z*z+ie*ie),z/=ce,ie/=ce,z*=b,ie*=b;let zr=E-T,Ro=B-A,Mo=E-k,Do=R-A,fv=zr*Mo+Ro*Do,al=Ro*Mo-Do*zr,Fo=al<0;if(Math.abs(al)<.001*Math.abs(fv)){f.push(E-I*F,A-D*F),f.push(E+I*L,A+D*L),fv>=0&&(a.join==="round"?_+=Wi(E,A,E-I*F,A-D*F,E-z*F,A-ie*F,f,false)+4:_+=2,f.push(E-z*L,A-ie*L),f.push(E+z*F,A+ie*F));continue}let pv=(-I+T)*(-D+A)-(-I+E)*(-D+B),mv=(-z+k)*(-ie+A)-(-z+E)*(-ie+R),ul=(zr*mv-Mo*pv)/al,ll=(Do*pv-Ro*mv)/al,jd=(ul-E)*(ul-E)+(ll-A)*(ll-A),gi=E+(ul-E)*F,xi=A+(ll-A)*F,_i=E-(ul-E)*L,bi=A-(ll-A)*L,cA=Math.min(zr*zr+Ro*Ro,Mo*Mo+Do*Do),gv=Fo?F:L,hA=cA+gv*gv*y;jd<=hA?a.join==="bevel"||jd/y>v?(Fo?(f.push(gi,xi),f.push(E+I*L,A+D*L),f.push(gi,xi),f.push(E+z*L,A+ie*L)):(f.push(E-I*F,A-D*F),f.push(_i,bi),f.push(E-z*F,A-ie*F),f.push(_i,bi)),_+=2):a.join==="round"?Fo?(f.push(gi,xi),f.push(E+I*L,A+D*L),_+=Wi(E,A,E+I*L,A+D*L,E+z*L,A+ie*L,f,true)+4,f.push(gi,xi),f.push(E+z*L,A+ie*L)):(f.push(E-I*F,A-D*F),f.push(_i,bi),_+=Wi(E,A,E-I*F,A-D*F,E-z*F,A-ie*F,f,false)+4,f.push(E-z*F,A-ie*F),f.push(_i,bi)):(f.push(gi,xi),f.push(_i,bi)):(f.push(E-I*F,A-D*F),f.push(E+I*L,A+D*L),a.join==="round"?Fo?_+=Wi(E,A,E+I*L,A+D*L,E+z*L,A+ie*L,f,true)+2:_+=Wi(E,A,E-I*F,A-D*F,E-z*F,A-ie*F,f,false)+2:a.join==="miter"&&jd/y<=v&&(Fo?(f.push(_i,bi),f.push(_i,bi)):(f.push(gi,xi),f.push(gi,xi)),_+=2),f.push(E-z*F,A-ie*F),f.push(E+z*L,A+ie*L),_+=2);}T=r[(g-2)*2],B=r[(g-2)*2+1],E=r[(g-1)*2],A=r[(g-1)*2+1],I=-(B-A),D=T-E,ce=Math.sqrt(I*I+D*D),I/=ce,D/=ce,I*=b,D*=b,f.push(E-I*F,A-D*F),f.push(E+I*L,A+D*L),h||(a.cap==="round"?_+=Wi(E-I*(F-L)*.5,A-D*(F-L)*.5,E-I*F,A-D*F,E+I*L,A+D*L,f,false)+2:a.cap==="square"&&(_+=V1(E,A,I,D,F,L,false,f)));let mi=1e-4*1e-4;for(let ue=x;ue<_+x-2;++ue)T=f[ue*2],B=f[ue*2+1],E=f[(ue+1)*2],A=f[(ue+1)*2+1],k=f[(ue+2)*2],R=f[(ue+2)*2+1],!(Math.abs(T*(A-R)+E*(R-B)+k*(B-A))<mi)&&n.push(ue,ue+1,ue+2);}var km=p(()=>{bt();Im();});function Lm(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 f=0;f<h;f++)c.push(r[f*2]),c.push(r[f*2+1]);for(let f=0;f<h-1;f++)i.push(d+f,d+f+1);l&&i.push(d+h-1,d);}var Nm=p(()=>{});function dc(r,e,t=2){let i=e&&e.length,s=i?e[0]*t:r.length,n=W1(r,0,s,t,true),o=[];if(!n||n.next===n.prev)return o;let a,u,l;if(i&&(n=A3(r,e,n,t)),r.length>80*t){a=r[0],u=r[1];let c=a,h=u;for(let d=t;d<s;d+=t){let f=r[d],g=r[d+1];f<a&&(a=f),g<u&&(u=g),f>c&&(c=f),g>h&&(h=g);}l=Math.max(c-a,h-u),l=l!==0?32767/l:0;}return Ta(n,o,t,a,u,l,0),o}function W1(r,e,t,i,s){let n;if(s===I3(r,e,t,i)>0)for(let o=e;o<t;o+=i)n=z1(o/i|0,r[o],r[o+1],n);else for(let o=t-i;o>=e;o-=i)n=z1(o/i|0,r[o],r[o+1],n);return n&&Ks(n,n.next)&&(Ea(n),n=n.next),n}function Xi(r,e){if(!r)return r;e||(e=r);let t=r,i;do if(i=false,!t.steiner&&(Ks(t,t.next)||Ce(t.prev,t,t.next)===0)){if(Ea(t),t=e=t.prev,t===t.next)break;i=true;}else t=t.next;while(i||t!==e);return e}function Ta(r,e,t,i,s,n,o){if(!r)return;!o&&n&&R3(r,i,s,n);let a=r;for(;r.prev!==r.next;){let u=r.prev,l=r.next;if(n?T3(r,i,s,n):v3(r)){e.push(u.i,r.i,l.i),Ea(r),r=l.next,a=l.next;continue}if(r=l,r===a){o?o===1?(r=S3(Xi(r),e),Ta(r,e,t,i,s,n,2)):o===2&&E3(r,e,t,i,s,n):Ta(Xi(r),e,t,i,s,n,1);break}}}function v3(r){let e=r.prev,t=r,i=r.next;if(Ce(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),f=Math.max(a,u,l),g=i.next;for(;g!==e;){if(g.x>=c&&g.x<=d&&g.y>=h&&g.y<=f&&va(s,a,n,u,o,l,g.x,g.y)&&Ce(g.prev,g,g.next)>=0)return false;g=g.next;}return true}function T3(r,e,t,i){let s=r.prev,n=r,o=r.next;if(Ce(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,f=Math.min(a,u,l),g=Math.min(c,h,d),_=Math.max(a,u,l),x=Math.max(c,h,d),b=Hm(f,g,e,t,i),y=Hm(_,x,e,t,i),v=r.prevZ,T=r.nextZ;for(;v&&v.z>=b&&T&&T.z<=y;){if(v.x>=f&&v.x<=_&&v.y>=g&&v.y<=x&&v!==s&&v!==o&&va(a,c,u,h,l,d,v.x,v.y)&&Ce(v.prev,v,v.next)>=0||(v=v.prevZ,T.x>=f&&T.x<=_&&T.y>=g&&T.y<=x&&T!==s&&T!==o&&va(a,c,u,h,l,d,T.x,T.y)&&Ce(T.prev,T,T.next)>=0))return false;T=T.nextZ;}for(;v&&v.z>=b;){if(v.x>=f&&v.x<=_&&v.y>=g&&v.y<=x&&v!==s&&v!==o&&va(a,c,u,h,l,d,v.x,v.y)&&Ce(v.prev,v,v.next)>=0)return false;v=v.prevZ;}for(;T&&T.z<=y;){if(T.x>=f&&T.x<=_&&T.y>=g&&T.y<=x&&T!==s&&T!==o&&va(a,c,u,h,l,d,T.x,T.y)&&Ce(T.prev,T,T.next)>=0)return false;T=T.nextZ;}return true}function S3(r,e){let t=r;do{let i=t.prev,s=t.next.next;!Ks(i,s)&&Y1(i,t,t.next,s)&&Sa(i,s)&&Sa(s,i)&&(e.push(i.i,t.i,s.i),Ea(t),Ea(t.next),t=r=s),t=t.next;}while(t!==r);return Xi(t)}function E3(r,e,t,i,s,n){let o=r;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&F3(o,a)){let u=$1(o,a);o=Xi(o,o.next),u=Xi(u,u.next),Ta(o,e,t,i,s,n,0),Ta(u,e,t,i,s,n,0);return}a=a.next;}o=o.next;}while(o!==r)}function A3(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=W1(r,a,u,i,false);l===l.next&&(l.steiner=true),s.push(D3(l));}s.sort(C3);for(let n=0;n<s.length;n++)t=w3(s[n],t);return t}function C3(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 w3(r,e){let t=P3(r,e);if(!t)return e;let i=$1(t,r);return Xi(i,i.next),Xi(t,t.next)}function P3(r,e){let t=e,i=r.x,s=r.y,n=-1/0,o;if(Ks(r,t))return t;do{if(Ks(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&&X1(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);Sa(t,r)&&(h<c||h===c&&(t.x>o.x||t.x===o.x&&B3(o,t)))&&(o=t,c=h);}t=t.next;}while(t!==a);return o}function B3(r,e){return Ce(r.prev,r,e.prev)<0&&Ce(e.next,r,r.next)<0}function R3(r,e,t,i){let s=r;do s.z===0&&(s.z=Hm(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,M3(s);}function M3(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 Hm(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 D3(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 X1(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 va(r,e,t,i,s,n,o,a){return !(r===o&&e===a)&&X1(r,e,t,i,s,n,o,a)}function F3(r,e){return r.next.i!==e.i&&r.prev.i!==e.i&&!G3(r,e)&&(Sa(r,e)&&Sa(e,r)&&U3(r,e)&&(Ce(r.prev,r,e.prev)||Ce(r,e.prev,e))||Ks(r,e)&&Ce(r.prev,r,r.next)>0&&Ce(e.prev,e,e.next)>0)}function Ce(r,e,t){return (e.y-r.y)*(t.x-e.x)-(e.x-r.x)*(t.y-e.y)}function Ks(r,e){return r.x===e.x&&r.y===e.y}function Y1(r,e,t,i){let s=hc(Ce(r,e,t)),n=hc(Ce(r,e,i)),o=hc(Ce(t,i,r)),a=hc(Ce(t,i,e));return !!(s!==n&&o!==a||s===0&&cc(r,t,e)||n===0&&cc(r,i,e)||o===0&&cc(t,r,i)||a===0&&cc(t,e,i))}function cc(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 hc(r){return r>0?1:r<0?-1:0}function G3(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&&Y1(t,t.next,r,e))return true;t=t.next;}while(t!==r);return false}function Sa(r,e){return Ce(r.prev,r,r.next)<0?Ce(r,e,r.next)>=0&&Ce(r,r.prev,e)>=0:Ce(r,e,r.prev)<0||Ce(r,r.next,e)<0}function U3(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 $1(r,e){let t=Vm(r.i,r.x,r.y),i=Vm(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 z1(r,e,t,i){let s=Vm(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 Ea(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 Vm(r,e,t){return {i:r,x:e,y:t,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:false}}function I3(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 j1=p(()=>{});var zm,Wm=p(()=>{j1();je();zm=dc.default||dc;});function Aa(r,e,t,i,s,n,o){let a=zm(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 fc=p(()=>{Wm();});var O3,Xm,Ym=p(()=>{S();fc();O3=[],Xm={extension:{type:m.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){Aa(r,O3,e,t,i,s,n);}};});var $m,jm=p(()=>{S();$m={extension:{type:m.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 qm,Km=p(()=>{S();qm={extension:{type:m.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 K1(r,e){for(let t=0;t<e.length;t++){let i=e[t];r.addColorStop(i.offset,i.color);}}function Z1(r,e){let t=U.get().createCanvas(r,e),i=t.getContext("2d");return {canvas:t,context:i}}function k3(r){let e=r[0]??{};return (typeof e=="number"||r[1])&&(w("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]??ft.defaultLinearOptions.textureSize}),e}var q1,Qm,ft,Yi=p(()=>{ke();ae();K();Ui();ee();Me();re();qr();q1=[{offset:0,color:"white"},{offset:1,color:"black"}],Qm=class Zm{constructor(...e){this.uid=W("fillGradient"),this._tick=0,this.type="linear",this.colorStops=[];let t=k3(e);t={...t.type==="radial"?Zm.defaultRadialOptions:Zm.defaultLinearOptions,...Ke(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:H.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 x=e;e=i,i=x,n*=-1;}if(o<0){let x=t;t=s,s=x,o*=-1;}}let u=this.colorStops.length?this.colorStops:q1,l=this._textureSize,{canvas:c,context:h}=Z1(l,1),d=a?h.createLinearGradient(this._textureSize,0,0,0):h.createLinearGradient(0,0,this._textureSize,0);K1(d,u),h.fillStyle=d,h.fillRect(0,0,l,1),this.texture=new C({source:new ut({resource:c,addressMode:this._wrapMode})});let f=Math.sqrt(n*n+o*o),g=Math.atan2(o,n),_=new P;_.scale(f/l,1),_.rotate(g),_.translate(e,t),this.textureSpace==="local"&&_.scale(l,l),this.transform=_;}buildGradient(){this.texture||this._tick++,this.type==="linear"?this.buildLinearGradient():this.buildRadialGradient();}buildRadialGradient(){if(this.texture)return;let e=this.colorStops.length?this.colorStops:q1,t=this._textureSize,{canvas:i,context:s}=Z1(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,f=t/(c*2),g=(n-h)*f,_=(o-d)*f,x=s.createRadialGradient(g,_,l*f,(a-h)*f,(u-d)*f,c*f);K1(x,e),s.fillStyle=e[e.length-1].color,s.fillRect(0,0,t,t),s.fillStyle=x,s.translate(g,_),s.rotate(this.rotation),s.scale(1,this.scale),s.translate(-g,-_),s.fillRect(0,0,t,t),this.texture=new C({source:new ut({resource:i,addressMode:this._wrapMode})});let b=new P;b.scale(1/f,1/f),b.translate(h,d),this.textureSpace==="local"&&b.scale(t,t),this.transform=b;}destroy(){this.texture?.destroy(true),this.texture=null,this.transform=null,this.colorStops=[],this.start=null,this.end=null,this.center=null,this.outerCenter=null;}get styleKey(){return `fill-gradient-${this.uid}-${this._tick}`}};Qm.defaultLinearOptions={start:{x:0,y:0},end:{x:0,y:1},colorStops:[],textureSpace:"local",type:"linear",textureSize:256,wrapMode:"clamp-to-edge"};Qm.defaultRadialOptions={center:{x:.5,y:.5},innerRadius:0,outerRadius:.5,colorStops:[],scale:1,textureSpace:"local",type:"radial",textureSize:256,wrapMode:"clamp-to-edge"};ft=Qm;});function Jm(r,e,t,i){let s=e.matrix?r.copyFrom(e.matrix).invert():r.identity();if(e.textureSpace==="local"){let o=t.getBounds(N3);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,f=s.a,g=s.b,_=s.c,x=s.d;s.a*=l,s.b*=l,s.c*=c,s.d*=c,s.tx=h*f+d*_+s.tx,s.ty=h*g+d*x+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 ft)&&n.addressMode==="clamp-to-edge"&&(n.addressMode="repeat",n.update()),i&&s.append(L3.copyFrom(i).invert()),s}var L3,N3,eg=p(()=>{K();De();Yi();L3=new P,N3=new V;});function tg(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")z3(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&&Q1(l.shapePath,u,true,i,t),l&&(a.shapePrimitives[a.shapePrimitives.length-1].holes=l.shapePath.shapePrimitives),Q1(a,u,o,i,t);}}}function z3(r,e,t){let i=[],s=$i.rectangle,n=H3;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&&qs(i,o),s.triangulate(i,a,2,h,l,c);let d=r.image,f=d.uvs;u.push(f.x0,f.y0,f.x1,f.y1,f.x3,f.y3,f.x2,f.y2);let g=de.get(ui);g.indexOffset=c,g.indexSize=l.length-c,g.attributeOffset=h,g.attributeSize=a.length/2-h,g.baseColor=r.style,g.alpha=r.alpha,g.texture=d,g.geometryData=t,e.push(g);}function Q1(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=$i[u.type];if(!d.build(u,h))return;let f=a.length,g=n.length/2,_="triangle-list";if(l&&qs(h,l),t){let v=u.closePath??true,T=e;T.pixelLine?(Lm(h,v,n,a),_="line-list"):Om(h,T,false,v,n,a);}else if(c){let v=[],T=h.slice();W3(c).forEach(E=>{v.push(T.length/2),T.push(...E);}),Aa(T,v,n,2,g,a,f);}else d.triangulate(h,n,2,g,a,f);let x=o.length/2,b=e.texture;if(b!==C.WHITE){let v=Jm(V3,e,u,l);ba(n,2,g,o,x,2,n.length/2-g,v);}else ya(o,x,2,n.length/2-g);let y=de.get(ui);y.indexOffset=f,y.indexSize=a.length-f,y.attributeOffset=g,y.attributeSize=n.length/2-g,y.baseColor=e.color,y.alpha=e.alpha,y.texture=b,y.geometryData=s,y.topology=_,i.push(y);});}function W3(r){let e=[];for(let t=0;t<r.length;t++){let i=r[t].shape,s=[];$i[i.type].build(i,s)&&e.push(s);}return e}var $i,H3,V3,pc=p(()=>{S();K();De();ac();uc();ee();kt();lc();Dm();km();Nm();Ym();jm();Km();eg();fc();$i={};G.handleByMap(m.ShapeBuilder,$i);G.add($m,Xm,qm,zi,Rm,Mm);H3=new V,V3=new P;});var mc,gc,ig,ji,Ca=p(()=>{S();aa();oc();vl();dt();re();kt();pc();mc=class{constructor(){this.batches=[],this.geometryData={vertices:[],uvs:[],indices:[]};}reset(){this.batches&&this.batches.forEach(e=>{de.return(e);}),this.graphicsData&&de.return(this.graphicsData),this.isBatchable=false,this.context=null,this.batches.length=0,this.geometryData.indices.length=0,this.geometryData.vertices.length=0,this.geometryData.uvs.length=0,this.graphicsData=null;}destroy(){this.reset(),this.batches=null,this.geometryData=null;}},gc=class{constructor(){this.instructions=new Si;}init(e){let t=e.maxTextures;this.batcher?this.batcher._updateMaxTextures(t):this.batcher=new js({maxTextures:t}),this.instructions.reset();}get geometry(){return w(hf,"GraphicsContextRenderData#geometry is deprecated, please use batcher.geometry instead."),this.batcher.geometry}destroy(){this.batcher.destroy(),this.instructions.destroy(),this.batcher=null,this.instructions=null;}},ig=class rg{constructor(e){this._renderer=e,this._managedContexts=new pe({renderer:e,type:"resource",name:"graphicsContext"});}init(e){rg.defaultOptions.bezierSmoothness=e?.bezierSmoothness??rg.defaultOptions.bezierSmoothness;}getContextRenderData(e){return e._gpuData[this._renderer.uid].graphicsData||this._initContextRenderData(e)}updateGpuContext(e){let t=!!e._gpuData[this._renderer.uid],i=e._gpuData[this._renderer.uid]||this._initContext(e);if(e.dirty||!t){t&&i.reset(),tg(e,i);let s=e.batchMode;e.customShader||s==="no-batch"?i.isBatchable=false:s==="auto"?i.isBatchable=i.geometryData.vertices.length<400:i.isBatchable=true,e.dirty=false;}return i}getGpuContext(e){return e._gpuData[this._renderer.uid]||this._initContext(e)}_initContextRenderData(e){let t=de.get(gc,{maxTextures:this._renderer.limits.maxBatchableTextures}),i=e._gpuData[this._renderer.uid],{batches:s,geometryData:n}=i;i.graphicsData=t;let o=n.vertices.length,a=n.indices.length;for(let h=0;h<s.length;h++)s[h].applyTransform=false;let u=t.batcher;u.ensureAttributeBuffer(o),u.ensureIndexBuffer(a),u.begin();for(let h=0;h<s.length;h++){let d=s[h];u.add(d);}u.finish(t.instructions);let l=u.geometry;l.indexBuffer.setDataWithSize(u.indexBuffer,u.indexSize,true),l.buffers[0].setDataWithSize(u.attributeBuffer.float32View,u.attributeSize,true);let c=u.batches;for(let h=0;h<c.length;h++){let d=c[h];d.bindGroup=Ii(d.textures.textures,d.textures.count,this._renderer.limits.maxBatchableTextures);}return t}_initContext(e){let t=new mc;return t.context=e,e._gpuData[this._renderer.uid]=t,this._managedContexts.add(e),t}destroy(){this._managedContexts.destroy(),this._renderer=null;}};ig.extension={type:[m.WebGLSystem,m.WebGPUSystem,m.CanvasSystem],name:"graphicsContext"};ig.defaultOptions={bezierSmoothness:.5};ji=ig;});var X3,sg,ng,og,ag,ug,lg,cg,Se,Rt=p(()=>{X3={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},sg=0,ng=1,og=2,ag=3,ug=4,lg=5,cg=class J1{constructor(){this.data=0,this.blendMode="normal",this.polygonOffset=0,this.blend=true,this.depthMask=true;}get blend(){return !!(this.data&1<<sg)}set blend(e){!!(this.data&1<<sg)!==e&&(this.data^=1<<sg);}get offsets(){return !!(this.data&1<<ng)}set offsets(e){!!(this.data&1<<ng)!==e&&(this.data^=1<<ng);}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<<og)}set culling(e){!!(this.data&1<<og)!==e&&(this.data^=1<<og);}get depthTest(){return !!(this.data&1<<ag)}set depthTest(e){!!(this.data&1<<ag)!==e&&(this.data^=1<<ag);}get depthMask(){return !!(this.data&1<<lg)}set depthMask(e){!!(this.data&1<<lg)!==e&&(this.data^=1<<lg);}get clockwiseFrontFace(){return !!(this.data&1<<ug)}set clockwiseFrontFace(e){!!(this.data&1<<ug)!==e&&(this.data^=1<<ug);}get blendMode(){return this._blendMode}set blendMode(e){this.blend=e!=="none",this._blendMode=e,this._blendModeId=X3[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 J1;return e.depthTest=false,e.blend=true,e}};cg.default2d=cg.for2d();Se=cg;});function Y3(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 jt(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 qi=p(()=>{});var xc,Zs,hg=p(()=>{S();Rt();dt();kt();qi();lc();xc=class{constructor(){this.batches=[],this.batched=false;}destroy(){this.batches.forEach(e=>{de.return(e);}),this.batches.length=0;}},Zs=class{constructor(e,t){this.state=Se.for2d(),this.renderer=e,this._adaptor=t,this.renderer.runners.contextChange.add(this),this._managedGraphics=new pe({renderer:e,type:"renderable",priority:-1,name:"graphics"});}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,jt(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 xc;return e._gpuData[this.renderer.uid]=t,this._managedGraphics.add(e),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=de.get(ui);return o.copyTo(a),a.renderable=e,a.roundPixels=n,a});}destroy(){this._managedGraphics.destroy(),this.renderer=null,this._adaptor.destroy(),this._adaptor=null,this.state=null;}};Zs.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"graphics"};});var dg=p(()=>{S();Ca();hg();G.add(Zs);G.add(ji);});var wr,wa=p(()=>{wr=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 Pa,Qs,fg=p(()=>{S();K();Sr();Ie();Vs();qi();wa();Pa=class{destroy(){}},Qs=class{constructor(e,t){this.localUniforms=new J({uTransformMatrix:{value:new P,type:"mat3x3<f32>"},uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uRound:{value:0,type:"f32"}}),this.localUniformsBindGroup=new Ve({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,s=this._getMeshData(e);if(e.didViewUpdate&&(s.indexSize=e._geometry.indices?.length,s.vertexSize=e._geometry.positions?.length),s.batched){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=or(e.groupBlendMode,e.texture._source);let t=this.localUniforms;t.uniforms.uTransformMatrix=e.groupTransform,t.uniforms.uRound=this.renderer._roundPixels|e._roundPixels,t.update(),jt(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 Pa),e._gpuData[this.renderer.uid].meshData||this._initMeshData(e)}_initMeshData(e){return e._gpuData[this.renderer.uid].meshData={batched:e.batched,indexSize:0,vertexSize:0},e._gpuData[this.renderer.uid].meshData}_getBatchableMesh(e){var t,i;return (t=e._gpuData)[i=this.renderer.uid]||(t[i]=new Pa),e._gpuData[this.renderer.uid].batchableMesh||this._initBatchableMesh(e)}_initBatchableMesh(e){let t=new wr;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;}};Qs.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"mesh"};});var pg=p(()=>{S();fg();G.add(Qs);});var Ba,mg=p(()=>{Ba=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 _c(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 gg=p(()=>{});function xg(r){return {dynamicUpdate:eT(r,true),staticUpdate:eT(r,false)}}function eT(r,e){let t=[];t.push(`
|
|
258
|
+
`}};});var Lu,gd,P_=p(()=>{Lu=["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>"],gd=Lu.reduce((r,e)=>(r[e]=true,r),{});});function xd(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 B_=p(()=>{});var iT,J,Oe=p(()=>{Ge();bo();P_();B_();iT=class sT{constructor(e,t){this._touched=0,this.uid=W("uniform"),this._resourceType="uniformGroup",this._resourceId=W("resource"),this.isUniformGroup=true,this._dirtyId=0,this.destroyed=false,t={...sT.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,!gd[n.type]){let o=n.type.match(/^array<(\w+(?:<\w+>)?),\s*(\d+)>$/);if(o){let[,a,u]=o;throw new Error(`Uniform type ${n.type} is not supported. Use type: '${a}', size: ${u} instead.`)}throw new Error(`Uniform type ${n.type} is not supported. Supported uniform types are: ${Lu.join(", ")}`)}n.value??(n.value=xd(n.type,n.size)),i[s]=n.value;}this.uniforms=i,this._dirtyId=1,this.ubo=t.ubo,this.isStatic=t.isStatic,this._signature=rr(Object.keys(i).map(s=>`${s}-${e[s].type}`).join("-"),"uniform-group");}update(){this._dirtyId++;}};iT.defaultOptions={ubo:false,isStatic:false};J=iT;});function wi(r){let e=nT[r];if(e)return e;let t=new Int32Array(r);for(let i=0;i<r;i++)t[i]=i;return e=nT[r]=new J({uTextures:{value:t,type:"i32",size:r}},{isStatic:true}),e}var nT,Nu=p(()=>{Oe();nT={};});var ye,Dt=p(()=>{ye=(r=>(r[r.WEBGL=1]="WEBGL",r[r.WEBGPU=2]="WEBGPU",r[r.BOTH=3]="BOTH",r))(ye||{});});var Ae,Ht=p(()=>{Ke();Ge();_t();kr();St();Dt();Oe();Ae=class r extends fe{constructor(e){super(),this.uid=W("shader"),this._uniformBindMap=Object.create(null),this._ownedBindGroups=[],this._destroyed=false;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|=ye.WEBGPU),i&&(o|=ye.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 He,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 J(d));let f=u[h];f&&(s[f.group]||(s[f.group]=new He,this._ownedBindGroups.push(s[f.group])),s[f.group].setResource(d,f.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 He,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._destroyed||(this._destroyed=true,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=xe.from(i)),new r({gpuProgram:n,glProgram:o,...s})}};});var As,R_=p(()=>{Nr();vo();To();Hr();Nu();Ht();As=class extends Ae{constructor(e){let t=kt({name:"batch",bits:[Ei,Ci(e),Nt]}),i=Ot({name:"batch",bits:[Si,Ai(e),Lt]});super({glProgram:t,gpuProgram:i,resources:{batchSamplers:wi(e)}}),this.maxTextures=e;}};});var Hu,oT,Cs,_d=p(()=>{S();Qx();t_();R_();Hu=null,oT=class aT extends jh{constructor(e){super(e),this.geometry=new _o,this.name=aT.extension.name,this.vertexSize=6,Hu??(Hu=new As(e.maxTextures)),this.shader=Hu;}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,f=a.ty,{positions:g,uvs:_}=e,x=e.color,b=e.attributeOffset,y=b+e.attributeSize;for(let v=b;v<y;v++){let T=v*2,B=g[T],E=g[T+1];t[s++]=u*B+c*E+d,t[s++]=h*E+l*B+f,t[s++]=_[T],t[s++]=_[T+1],i[s++]=x,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,f=a.ty,g=e.bounds,_=g.maxX,x=g.minX,b=g.maxY,y=g.minY,v=o.uvs,T=e.color,B=n<<16|e.roundPixels&65535;t[s+0]=u*x+c*y+d,t[s+1]=h*y+l*x+f,t[s+2]=v.x0,t[s+3]=v.y0,i[s+4]=T,i[s+5]=B,t[s+6]=u*_+c*y+d,t[s+7]=h*y+l*_+f,t[s+8]=v.x1,t[s+9]=v.y1,i[s+10]=T,i[s+11]=B,t[s+12]=u*_+c*b+d,t[s+13]=h*b+l*_+f,t[s+14]=v.x2,t[s+15]=v.y2,i[s+16]=T,i[s+17]=B,t[s+18]=u*x+c*b+d,t[s+19]=h*b+l*x+f,t[s+20]=v.x3,t[s+21]=v.y3,i[s+22]=T,i[s+23]=B;}_updateMaxTextures(e){this.shader.maxTextures!==e&&(Hu=new As(e),this.shader=Hu);}destroy(){this.shader=null,super.destroy();}};oT.extension={type:[m.Batcher],name:"default"};Cs=oT;});var pe,bt=p(()=>{pe=class{constructor(e){this.items=Object.create(null);let{renderer:t,type:i,onUnload:s,priority:n,name:o}=e;this._renderer=t,t.gc.addResourceHash(this,"items",i,n??0),this._onUnload=s,this.name=o;}add(e){return this.items[e.uid]?false:(this.items[e.uid]=e,e.once("unload",this.remove,this),e._gcLastUsed=this._renderer.gc.now,true)}remove(e,...t){if(!this.items[e.uid])return;let i=e._gpuData[this._renderer.uid];i&&(this._onUnload?.(e,...t),i.destroy(),e._gpuData[this._renderer.uid]=null,this.items[e.uid]=null);}removeAll(...e){Object.values(this.items).forEach(t=>t&&this.remove(t,...e));}destroy(...e){this.removeAll(...e),this.items=Object.create(null),this._renderer=null,this._onUnload=null;}};});function So(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,f=a.tx,g=a.ty;for(;u<o;){let _=r[t],x=r[t+1];i[s]=l*_+h*x+f,i[s+1]=c*_+d*x+g,s+=n,t+=e,u++;}}function Eo(r,e,t,i){let s=0;for(e*=t;s<i;)r[e]=0,r[e+1]=0,e+=t,s++;}var bd=p(()=>{});function ws(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 f=r[h],g=r[h+1];r[h]=n*f+a*g+l,r[h+1]=o*f+u*g+c,h+=i;}}var yd=p(()=>{});var gC,Vr,vd=p(()=>{K();ih();gC=new P,Vr=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?io(t,i.groupColor)+(this.alpha*i.groupAlpha*255<<24):t+(this.alpha*255<<24)}get transform(){return this.renderable?.groupTransform||gC}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";}destroy(){this.renderable=null,this.texture=null,this.geometryData=null,this._batcher=null,this._batch=null;}};});var Pi,Td,Sd,M_=p(()=>{S();Pi={extension:{type:m.ShapeBuilder,name:"circle"},build(r,e){let t,i,s,n,o,a;if(r.type==="circle"){let T=r;if(o=a=T.radius,o<=0)return false;t=T.x,i=T.y,s=n=0;}else if(r.type==="ellipse"){let T=r;if(o=T.halfWidth,a=T.halfHeight,o<=0||a<=0)return false;t=T.x,i=T.y,s=n=0;}else {let T=r,B=T.width/2,E=T.height/2;t=T.x+B,i=T.y+E,o=a=Math.max(0,Math.min(T.radius,Math.min(B,E))),s=B-o,n=E-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,f=l,g=s+o,_=n,x=t+g,b=t-g,y=i+_;if(e[c++]=x,e[c++]=y,e[--h]=y,e[--h]=b,n){let T=i-_;e[d++]=b,e[d++]=T,e[--f]=T,e[--f]=x;}for(let T=1;T<u;T++){let B=Math.PI/2*(T/u),E=s+Math.cos(B)*o,C=n+Math.sin(B)*a,k=t+E,M=t-E,I=i+C,D=i-C;e[c++]=k,e[c++]=I,e[--h]=I,e[--h]=M,e[d++]=M,e[d++]=D,e[--f]=D,e[--f]=k;}g=s,_=n+a,x=t+g,b=t-g,y=i+_;let v=i-_;return e[c++]=x,e[c++]=y,e[--f]=v,e[--f]=x,s&&(e[c++]=b,e[c++]=y,e[--f]=v,e[--f]=b),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;}},Td={...Pi,extension:{...Pi.extension,name:"ellipse"}},Sd={...Pi,extension:{...Pi.extension,name:"roundedRectangle"}};});var Ed,Ad,uT=p(()=>{Ed=1e-4,Ad=1e-4;});function Cd(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 D_=p(()=>{});function lT(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,f;o?(d=i,f=-t):(d=-i,f=t);let g=u+d,_=l+f,x=c+d,b=h+f;return a.push(g,_),a.push(x,b),2}function Ps(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,f=h-c,g=Math.abs(f),_=Math.sqrt(u*u+l*l),x=(15*g*Math.sqrt(_)/Math.PI>>0)+1,b=f/x;if(d+=b,a){o.push(r,e),o.push(t,i);for(let y=1,v=d;y<x;y++,v+=b)o.push(r,e),o.push(r+Math.sin(v)*_,e+Math.cos(v)*_);o.push(r,e),o.push(s,n);}else {o.push(t,i),o.push(r,e);for(let y=1,v=d;y<x;y++,v+=b)o.push(r+Math.sin(v)*_,e+Math.cos(v)*_),o.push(r,e);o.push(s,n),o.push(r,e);}return x*2}function wd(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 ue=Cd(r);t&&(ue*=-1),u=(u-.5)*ue+.5;}let l=new q(r[0],r[1]),c=new q(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 ue=(l.x+c.x)*.5,Qr=(c.y+l.y)*.5;r.unshift(ue,Qr),r.push(ue,Qr);}let f=s,g=r.length/2,_=r.length,x=f.length/2,b=a.width/2,y=b*b,v=a.miterLimit*a.miterLimit,T=r[0],B=r[1],E=r[2],C=r[3],k=0,M=0,I=-(B-C),D=T-E,z=0,se=0,de=Math.sqrt(I*I+D*D);I/=de,D/=de,I*=b,D*=b;let Br=u,F=(1-Br)*2,L=Br*2;h||(a.cap==="round"?_+=Ps(T-I*(F-L)*.5,B-D*(F-L)*.5,T-I*F,B-D*F,T+I*L,B+D*L,f,true)+2:a.cap==="square"&&(_+=lT(T,B,I,D,F,L,true,f))),f.push(T-I*F,B-D*F),f.push(T+I*L,B+D*L);for(let ue=1;ue<g-1;++ue){T=r[(ue-1)*2],B=r[(ue-1)*2+1],E=r[ue*2],C=r[ue*2+1],k=r[(ue+1)*2],M=r[(ue+1)*2+1],I=-(B-C),D=T-E,de=Math.sqrt(I*I+D*D),I/=de,D/=de,I*=b,D*=b,z=-(C-M),se=E-k,de=Math.sqrt(z*z+se*se),z/=de,se/=de,z*=b,se*=b;let Qr=E-T,tu=B-C,ru=E-k,iu=M-C,Fv=Qr*ru+tu*iu,kc=tu*ru-iu*Qr,su=kc<0;if(Math.abs(kc)<.001*Math.abs(Fv)){f.push(E-I*F,C-D*F),f.push(E+I*L,C+D*L),Fv>=0&&(a.join==="round"?_+=Ps(E,C,E-I*F,C-D*F,E-z*F,C-se*F,f,false)+4:_+=2,f.push(E-z*L,C-se*L),f.push(E+z*F,C+se*F));continue}let Gv=(-I+T)*(-D+C)-(-I+E)*(-D+B),Uv=(-z+k)*(-se+C)-(-z+E)*(-se+M),Lc=(Qr*Uv-ru*Gv)/kc,Nc=(iu*Gv-tu*Uv)/kc,Hg=(Lc-E)*(Lc-E)+(Nc-C)*(Nc-C),ss=E+(Lc-E)*F,ns=C+(Nc-C)*F,os=E-(Lc-E)*L,as=C-(Nc-C)*L,h3=Math.min(Qr*Qr+tu*tu,ru*ru+iu*iu),Iv=su?F:L,d3=h3+Iv*Iv*y;Hg<=d3?a.join==="bevel"||Hg/y>v?(su?(f.push(ss,ns),f.push(E+I*L,C+D*L),f.push(ss,ns),f.push(E+z*L,C+se*L)):(f.push(E-I*F,C-D*F),f.push(os,as),f.push(E-z*F,C-se*F),f.push(os,as)),_+=2):a.join==="round"?su?(f.push(ss,ns),f.push(E+I*L,C+D*L),_+=Ps(E,C,E+I*L,C+D*L,E+z*L,C+se*L,f,true)+4,f.push(ss,ns),f.push(E+z*L,C+se*L)):(f.push(E-I*F,C-D*F),f.push(os,as),_+=Ps(E,C,E-I*F,C-D*F,E-z*F,C-se*F,f,false)+4,f.push(E-z*F,C-se*F),f.push(os,as)):(f.push(ss,ns),f.push(os,as)):(f.push(E-I*F,C-D*F),f.push(E+I*L,C+D*L),a.join==="round"?su?_+=Ps(E,C,E+I*L,C+D*L,E+z*L,C+se*L,f,true)+2:_+=Ps(E,C,E-I*F,C-D*F,E-z*F,C-se*F,f,false)+2:a.join==="miter"&&Hg/y<=v&&(su?(f.push(os,as),f.push(os,as)):(f.push(ss,ns),f.push(ss,ns)),_+=2),f.push(E-z*F,C-se*F),f.push(E+z*L,C+se*L),_+=2);}T=r[(g-2)*2],B=r[(g-2)*2+1],E=r[(g-1)*2],C=r[(g-1)*2+1],I=-(B-C),D=T-E,de=Math.sqrt(I*I+D*D),I/=de,D/=de,I*=b,D*=b,f.push(E-I*F,C-D*F),f.push(E+I*L,C+D*L),h||(a.cap==="round"?_+=Ps(E-I*(F-L)*.5,C-D*(F-L)*.5,E-I*F,C-D*F,E+I*L,C+D*L,f,false)+2:a.cap==="square"&&(_+=lT(E,C,I,D,F,L,false,f)));let is=1e-4*1e-4;for(let ue=x;ue<_+x-2;++ue)T=f[ue*2],B=f[ue*2+1],E=f[(ue+1)*2],C=f[(ue+1)*2+1],k=f[(ue+2)*2],M=f[(ue+2)*2+1],!(Math.abs(T*(C-M)+E*(M-B)+k*(B-C))<is)&&n.push(ue,ue+1,ue+2);}var F_=p(()=>{vt();D_();});function Pd(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 f=0;f<h;f++)c.push(r[f*2]),c.push(r[f*2+1]);for(let f=0;f<h-1;f++)i.push(d+f,d+f+1);l&&i.push(d+h-1,d);}var G_=p(()=>{});function Md(r,e,t=2){let i=e&&e.length,s=i?e[0]*t:r.length,n=hT(r,0,s,t,true),o=[];if(!n||n.next===n.prev)return o;let a,u,l;if(i&&(n=vC(r,e,n,t)),r.length>80*t){a=r[0],u=r[1];let c=a,h=u;for(let d=t;d<s;d+=t){let f=r[d],g=r[d+1];f<a&&(a=f),g<u&&(u=g),f>c&&(c=f),g>h&&(h=g);}l=Math.max(c-a,h-u),l=l!==0?32767/l:0;}return zu(n,o,t,a,u,l,0),o}function hT(r,e,t,i,s){let n;if(s===DC(r,e,t,i)>0)for(let o=e;o<t;o+=i)n=cT(o/i|0,r[o],r[o+1],n);else for(let o=t-i;o>=e;o-=i)n=cT(o/i|0,r[o],r[o+1],n);return n&&Ao(n,n.next)&&(Xu(n),n=n.next),n}function Bs(r,e){if(!r)return r;e||(e=r);let t=r,i;do if(i=false,!t.steiner&&(Ao(t,t.next)||Be(t.prev,t,t.next)===0)){if(Xu(t),t=e=t.prev,t===t.next)break;i=true;}else t=t.next;while(i||t!==e);return e}function zu(r,e,t,i,s,n,o){if(!r)return;!o&&n&&CC(r,i,s,n);let a=r;for(;r.prev!==r.next;){let u=r.prev,l=r.next;if(n?_C(r,i,s,n):xC(r)){e.push(u.i,r.i,l.i),Xu(r),r=l.next,a=l.next;continue}if(r=l,r===a){o?o===1?(r=bC(Bs(r),e),zu(r,e,t,i,s,n,2)):o===2&&yC(r,e,t,i,s,n):zu(Bs(r),e,t,i,s,n,1);break}}}function xC(r){let e=r.prev,t=r,i=r.next;if(Be(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),f=Math.max(a,u,l),g=i.next;for(;g!==e;){if(g.x>=c&&g.x<=d&&g.y>=h&&g.y<=f&&Vu(s,a,n,u,o,l,g.x,g.y)&&Be(g.prev,g,g.next)>=0)return false;g=g.next;}return true}function _C(r,e,t,i){let s=r.prev,n=r,o=r.next;if(Be(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,f=Math.min(a,u,l),g=Math.min(c,h,d),_=Math.max(a,u,l),x=Math.max(c,h,d),b=U_(f,g,e,t,i),y=U_(_,x,e,t,i),v=r.prevZ,T=r.nextZ;for(;v&&v.z>=b&&T&&T.z<=y;){if(v.x>=f&&v.x<=_&&v.y>=g&&v.y<=x&&v!==s&&v!==o&&Vu(a,c,u,h,l,d,v.x,v.y)&&Be(v.prev,v,v.next)>=0||(v=v.prevZ,T.x>=f&&T.x<=_&&T.y>=g&&T.y<=x&&T!==s&&T!==o&&Vu(a,c,u,h,l,d,T.x,T.y)&&Be(T.prev,T,T.next)>=0))return false;T=T.nextZ;}for(;v&&v.z>=b;){if(v.x>=f&&v.x<=_&&v.y>=g&&v.y<=x&&v!==s&&v!==o&&Vu(a,c,u,h,l,d,v.x,v.y)&&Be(v.prev,v,v.next)>=0)return false;v=v.prevZ;}for(;T&&T.z<=y;){if(T.x>=f&&T.x<=_&&T.y>=g&&T.y<=x&&T!==s&&T!==o&&Vu(a,c,u,h,l,d,T.x,T.y)&&Be(T.prev,T,T.next)>=0)return false;T=T.nextZ;}return true}function bC(r,e){let t=r;do{let i=t.prev,s=t.next.next;!Ao(i,s)&&fT(i,t,t.next,s)&&Wu(i,s)&&Wu(s,i)&&(e.push(i.i,t.i,s.i),Xu(t),Xu(t.next),t=r=s),t=t.next;}while(t!==r);return Bs(t)}function yC(r,e,t,i,s,n){let o=r;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&BC(o,a)){let u=pT(o,a);o=Bs(o,o.next),u=Bs(u,u.next),zu(o,e,t,i,s,n,0),zu(u,e,t,i,s,n,0);return}a=a.next;}o=o.next;}while(o!==r)}function vC(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=hT(r,a,u,i,false);l===l.next&&(l.steiner=true),s.push(PC(l));}s.sort(TC);for(let n=0;n<s.length;n++)t=SC(s[n],t);return t}function TC(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 SC(r,e){let t=EC(r,e);if(!t)return e;let i=pT(t,r);return Bs(i,i.next),Bs(t,t.next)}function EC(r,e){let t=e,i=r.x,s=r.y,n=-1/0,o;if(Ao(r,t))return t;do{if(Ao(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&&dT(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);Wu(t,r)&&(h<c||h===c&&(t.x>o.x||t.x===o.x&&AC(o,t)))&&(o=t,c=h);}t=t.next;}while(t!==a);return o}function AC(r,e){return Be(r.prev,r,e.prev)<0&&Be(e.next,r,r.next)<0}function CC(r,e,t,i){let s=r;do s.z===0&&(s.z=U_(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,wC(s);}function wC(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 U_(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 PC(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 dT(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 Vu(r,e,t,i,s,n,o,a){return !(r===o&&e===a)&&dT(r,e,t,i,s,n,o,a)}function BC(r,e){return r.next.i!==e.i&&r.prev.i!==e.i&&!RC(r,e)&&(Wu(r,e)&&Wu(e,r)&&MC(r,e)&&(Be(r.prev,r,e.prev)||Be(r,e.prev,e))||Ao(r,e)&&Be(r.prev,r,r.next)>0&&Be(e.prev,e,e.next)>0)}function Be(r,e,t){return (e.y-r.y)*(t.x-e.x)-(e.x-r.x)*(t.y-e.y)}function Ao(r,e){return r.x===e.x&&r.y===e.y}function fT(r,e,t,i){let s=Rd(Be(r,e,t)),n=Rd(Be(r,e,i)),o=Rd(Be(t,i,r)),a=Rd(Be(t,i,e));return !!(s!==n&&o!==a||s===0&&Bd(r,t,e)||n===0&&Bd(r,i,e)||o===0&&Bd(t,r,i)||a===0&&Bd(t,e,i))}function Bd(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 Rd(r){return r>0?1:r<0?-1:0}function RC(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&&fT(t,t.next,r,e))return true;t=t.next;}while(t!==r);return false}function Wu(r,e){return Be(r.prev,r,r.next)<0?Be(r,e,r.next)>=0&&Be(r,r.prev,e)>=0:Be(r,e,r.prev)<0||Be(r,r.next,e)<0}function MC(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 pT(r,e){let t=I_(r.i,r.x,r.y),i=I_(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 cT(r,e,t,i){let s=I_(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 Xu(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 I_(r,e,t){return {i:r,x:e,y:t,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:false}}function DC(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 mT=p(()=>{});var Dd,O_=p(()=>{mT();Ke();Dd=Md.default||Md;});function Co(r,e,t,i,s,n,o){let a=Dd(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 Fd=p(()=>{O_();});var FC,Gd,k_=p(()=>{S();Fd();FC=[],Gd={extension:{type:m.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){Co(r,FC,e,t,i,s,n);}};});var Ud,L_=p(()=>{S();Ud={extension:{type:m.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 Id,N_=p(()=>{S();Id={extension:{type:m.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 xT(r,e){for(let t=0;t<e.length;t++){let i=e[t];r.addColorStop(i.offset,i.color);}}function _T(r,e){let t=U.get().createCanvas(r,e),i=t.getContext("2d");return {canvas:t,context:i}}function GC(r){let e=r[0]??{};return (typeof e=="number"||r[1])&&(w("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]??lt.defaultLinearOptions.textureSize}),e}var gT,V_,lt,Rs=p(()=>{Ne();ae();K();Ss();ee();Ge();re();oi();gT=[{offset:0,color:"white"},{offset:1,color:"black"}],V_=class H_{constructor(...e){this.uid=W("fillGradient"),this._tick=0,this.type="linear",this.colorStops=[];let t=GC(e);t={...t.type==="radial"?H_.defaultRadialOptions:H_.defaultLinearOptions,...Ye(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:H.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 x=e;e=i,i=x,n*=-1;}if(o<0){let x=t;t=s,s=x,o*=-1;}}let u=this.colorStops.length?this.colorStops:gT,l=this._textureSize,{canvas:c,context:h}=_T(l,1),d=a?h.createLinearGradient(this._textureSize,0,0,0):h.createLinearGradient(0,0,this._textureSize,0);xT(d,u),h.fillStyle=d,h.fillRect(0,0,l,1),this.texture=new A({source:new ot({resource:c,addressMode:this._wrapMode})});let f=Math.sqrt(n*n+o*o),g=Math.atan2(o,n),_=new P;_.scale(f/l,1),_.rotate(g),_.translate(e,t),this.textureSpace==="local"&&_.scale(l,l),this.transform=_;}buildGradient(){this.texture||this._tick++,this.type==="linear"?this.buildLinearGradient():this.buildRadialGradient();}buildRadialGradient(){if(this.texture)return;let e=this.colorStops.length?this.colorStops:gT,t=this._textureSize,{canvas:i,context:s}=_T(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,f=t/(c*2),g=(n-h)*f,_=(o-d)*f,x=s.createRadialGradient(g,_,l*f,(a-h)*f,(u-d)*f,c*f);xT(x,e),s.fillStyle=e[e.length-1].color,s.fillRect(0,0,t,t),s.fillStyle=x,s.translate(g,_),s.rotate(this.rotation),s.scale(1,this.scale),s.translate(-g,-_),s.fillRect(0,0,t,t),this.texture=new A({source:new ot({resource:i,addressMode:this._wrapMode})});let b=new P;b.scale(1/f,1/f),b.translate(h,d),this.textureSpace==="local"&&b.scale(t,t),this.transform=b;}destroy(){this.texture?.destroy(true),this.texture=null,this.transform=null,this.colorStops=[],this.start=null,this.end=null,this.center=null,this.outerCenter=null;}get styleKey(){return `fill-gradient-${this.uid}-${this._tick}`}};V_.defaultLinearOptions={start:{x:0,y:0},end:{x:0,y:1},colorStops:[],textureSpace:"local",type:"linear",textureSize:256,wrapMode:"clamp-to-edge"};V_.defaultRadialOptions={center:{x:.5,y:.5},innerRadius:0,outerRadius:.5,colorStops:[],scale:1,textureSpace:"local",type:"radial",textureSize:256,wrapMode:"clamp-to-edge"};lt=V_;});function Od(r,e,t,i){let s=e.matrix?r.copyFrom(e.matrix).invert():r.identity();if(e.textureSpace==="local"){let o=t.getBounds(IC);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,f=s.a,g=s.b,_=s.c,x=s.d;s.a*=l,s.b*=l,s.c*=c,s.d*=c,s.tx=h*f+d*_+s.tx,s.ty=h*g+d*x+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 lt)&&n.addressMode==="clamp-to-edge"&&(n.addressMode="repeat",n.update()),i&&s.append(UC.copyFrom(i).invert()),s}var UC,IC,z_=p(()=>{K();Ue();Rs();UC=new P,IC=new V;});function kd(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")LC(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&&bT(l.shapePath,u,true,i,t),l&&(a.shapePrimitives[a.shapePrimitives.length-1].holes=l.shapePath.shapePrimitives),bT(a,u,o,i,t);}}}function LC(r,e,t){let i=[],s=Bi.rectangle,n=OC;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&&ws(i,o),s.triangulate(i,a,2,h,l,c);let d=r.image,f=d.uvs;u.push(f.x0,f.y0,f.x1,f.y1,f.x3,f.y3,f.x2,f.y2);let g=he.get(Vr);g.indexOffset=c,g.indexSize=l.length-c,g.attributeOffset=h,g.attributeSize=a.length/2-h,g.baseColor=r.style,g.alpha=r.alpha,g.texture=d,g.geometryData=t,e.push(g);}function bT(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=Bi[u.type];if(!d.build(u,h))return;let f=a.length,g=n.length/2,_="triangle-list";if(l&&ws(h,l),t){let v=u.closePath??true,T=e;T.pixelLine?(Pd(h,v,n,a),_="line-list"):wd(h,T,false,v,n,a);}else if(c){let v=[],T=h.slice();NC(c).forEach(E=>{v.push(T.length/2),T.push(...E);}),Co(T,v,n,2,g,a,f);}else d.triangulate(h,n,2,g,a,f);let x=o.length/2,b=e.texture;if(b!==A.WHITE){let v=Od(kC,e,u,l);So(n,2,g,o,x,2,n.length/2-g,v);}else Eo(o,x,2,n.length/2-g);let y=he.get(Vr);y.indexOffset=f,y.indexSize=a.length-f,y.attributeOffset=g,y.attributeSize=n.length/2-g,y.baseColor=e.color,y.alpha=e.alpha,y.texture=b,y.geometryData=s,y.topology=_,i.push(y);});}function NC(r){let e=[];for(let t=0;t<r.length;t++){let i=r[t].shape,s=[];Bi[i.type].build(i,s)&&e.push(s);}return e}var Bi,OC,kC,Ld=p(()=>{S();K();Ue();bd();yd();ee();jt();vd();M_();F_();G_();k_();L_();N_();z_();Fd();Bi={};G.handleByMap(m.ShapeBuilder,Bi);G.add(Ud,Gd,Id,Pi,Td,Sd);OC=new V,kC=new P;});var Yu,$u,X_,Ri,ju=p(()=>{S();Pu();_d();hh();bt();re();jt();Ld();Yu=class{constructor(){this.batches=[],this.geometryData={vertices:[],uvs:[],indices:[]};}reset(){this.batches&&this.batches.forEach(e=>{he.return(e);}),this.graphicsData&&he.return(this.graphicsData),this.isBatchable=false,this.context=null,this.batches.length=0,this.geometryData.indices.length=0,this.geometryData.vertices.length=0,this.geometryData.uvs.length=0,this.graphicsData=null;}destroy(){this.reset(),this.batches=null,this.geometryData=null;}},$u=class{constructor(){this.instructions=new ni;}init(e){let t=e.maxTextures;this.batcher?this.batcher._updateMaxTextures(t):this.batcher=new Cs({maxTextures:t}),this.instructions.reset();}get geometry(){return w(jc,"GraphicsContextRenderData#geometry is deprecated, please use batcher.geometry instead."),this.batcher.geometry}destroy(){this.batcher.destroy(),this.instructions.destroy(),this.batcher=null,this.instructions=null;}},X_=class W_{constructor(e){this._renderer=e,this._managedContexts=new pe({renderer:e,type:"resource",name:"graphicsContext"});}init(e){W_.defaultOptions.bezierSmoothness=e?.bezierSmoothness??W_.defaultOptions.bezierSmoothness;}getContextRenderData(e){return e._gpuData[this._renderer.uid].graphicsData||this._initContextRenderData(e)}updateGpuContext(e){let t=!!e._gpuData[this._renderer.uid],i=e._gpuData[this._renderer.uid]||this._initContext(e);if(e.dirty||!t){t&&i.reset(),kd(e,i);let s=e.batchMode;e.customShader||s==="no-batch"?i.isBatchable=false:s==="auto"?i.isBatchable=i.geometryData.vertices.length<400:i.isBatchable=true,e.dirty=false;}return i}getGpuContext(e){return e._gpuData[this._renderer.uid]||this._initContext(e)}_initContextRenderData(e){let t=he.get($u,{maxTextures:this._renderer.limits.maxBatchableTextures}),i=e._gpuData[this._renderer.uid],{batches:s,geometryData:n}=i;i.graphicsData=t;let o=n.vertices.length,a=n.indices.length;for(let h=0;h<s.length;h++)s[h].applyTransform=false;let u=t.batcher;u.ensureAttributeBuffer(o),u.ensureIndexBuffer(a),u.begin();for(let h=0;h<s.length;h++){let d=s[h];u.add(d);}u.finish(t.instructions);let l=u.geometry;l.indexBuffer.setDataWithSize(u.indexBuffer,u.indexSize,true),l.buffers[0].setDataWithSize(u.attributeBuffer.float32View,u.attributeSize,true);let c=u.batches;for(let h=0;h<c.length;h++){let d=c[h];d.bindGroup=xi(d.textures.textures,d.textures.count,this._renderer.limits.maxBatchableTextures);}return t}_initContext(e){let t=new Yu;return t.context=e,e._gpuData[this._renderer.uid]=t,this._managedContexts.add(e),t}destroy(){this._managedContexts.destroy(),this._renderer=null;}};X_.extension={type:[m.WebGLSystem,m.WebGPUSystem,m.CanvasSystem],name:"graphicsContext"};X_.defaultOptions={bezierSmoothness:.5};Ri=X_;});var HC,Y_,$_,j_,q_,K_,Z_,Q_,Se,Ft=p(()=>{HC={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},Y_=0,$_=1,j_=2,q_=3,K_=4,Z_=5,Q_=class yT{constructor(){this.data=0,this.blendMode="normal",this.polygonOffset=0,this.blend=true,this.depthMask=true;}get blend(){return !!(this.data&1<<Y_)}set blend(e){!!(this.data&1<<Y_)!==e&&(this.data^=1<<Y_);}get offsets(){return !!(this.data&1<<$_)}set offsets(e){!!(this.data&1<<$_)!==e&&(this.data^=1<<$_);}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<<j_)}set culling(e){!!(this.data&1<<j_)!==e&&(this.data^=1<<j_);}get depthTest(){return !!(this.data&1<<q_)}set depthTest(e){!!(this.data&1<<q_)!==e&&(this.data^=1<<q_);}get depthMask(){return !!(this.data&1<<Z_)}set depthMask(e){!!(this.data&1<<Z_)!==e&&(this.data^=1<<Z_);}get clockwiseFrontFace(){return !!(this.data&1<<K_)}set clockwiseFrontFace(e){!!(this.data&1<<K_)!==e&&(this.data^=1<<K_);}get blendMode(){return this._blendMode}set blendMode(e){this.blend=e!=="none",this._blendMode=e,this._blendModeId=HC[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 yT;return e.depthTest=false,e.blend=true,e}};Q_.default2d=Q_.for2d();Se=Q_;});function vT(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 Vt(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 Ms=p(()=>{});var qu,Ds,J_=p(()=>{S();Ft();bt();jt();Ms();vd();qu=class{constructor(){this.batches=[],this.batched=false;}destroy(){this.batches.forEach(e=>{he.return(e);}),this.batches.length=0;}},Ds=class{constructor(e,t){this.state=Se.for2d(),this.renderer=e,this._adaptor=t,this.renderer.runners.contextChange.add(this),this._managedGraphics=new pe({renderer:e,type:"renderable",priority:-1,name:"graphics"});}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,Vt(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 qu;return e._gpuData[this.renderer.uid]=t,this._managedGraphics.add(e),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=he.get(Vr);return o.copyTo(a),a.renderable=e,a.roundPixels=n,a});}destroy(){this._managedGraphics.destroy(),this.renderer=null,this._adaptor.destroy(),this._adaptor=null,this.state=null;}};Ds.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"graphics"};});var eb=p(()=>{S();ju();J_();G.add(Ds);G.add(Ri);});var gr,Ku=p(()=>{gr=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 wo,Fs,tb=p(()=>{S();K();kr();Oe();fo();Ms();Ku();wo=class{destroy(){}},Fs=class{constructor(e,t){this.localUniforms=new J({uTransformMatrix:{value:new P,type:"mat3x3<f32>"},uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uRound:{value:0,type:"f32"}}),this.localUniformsBindGroup=new He({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,s=this._getMeshData(e);if(e.didViewUpdate&&(s.indexSize=e._geometry.indices?.length,s.vertexSize=e._geometry.positions?.length),s.batched){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=tr(e.groupBlendMode,e.texture._source);let t=this.localUniforms;t.uniforms.uTransformMatrix=e.groupTransform,t.uniforms.uRound=this.renderer._roundPixels|e._roundPixels,t.update(),Vt(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 wo),e._gpuData[this.renderer.uid].meshData||this._initMeshData(e)}_initMeshData(e){return e._gpuData[this.renderer.uid].meshData={batched:e.batched,indexSize:0,vertexSize:0},e._gpuData[this.renderer.uid].meshData}_getBatchableMesh(e){var t,i;return (t=e._gpuData)[i=this.renderer.uid]||(t[i]=new wo),e._gpuData[this.renderer.uid].batchableMesh||this._initBatchableMesh(e)}_initBatchableMesh(e){let t=new gr;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;}};Fs.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"mesh"};});var rb=p(()=>{S();tb();G.add(Fs);});var Po,ib=p(()=>{Po=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 Zu(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 sb=p(()=>{});function Nd(r){return {dynamicUpdate:TT(r,true),staticUpdate:TT(r,false)}}function TT(r,e){let t=[];t.push(`
|
|
259
259
|
|
|
260
260
|
var index = 0;
|
|
261
261
|
|
|
@@ -263,13 +263,13 @@ ${s.join(`
|
|
|
263
263
|
{
|
|
264
264
|
const p = ps[i];
|
|
265
265
|
|
|
266
|
-
`);let i=0;for(let n in r){let o=r[n];if(e!==o.dynamic)continue;t.push(`offset = index + ${i}`),t.push(o.code);let a=
|
|
266
|
+
`);let i=0;for(let n in r){let o=r[n];if(e!==o.dynamic)continue;t.push(`offset = index + ${i}`),t.push(o.code);let a=ut(o.format);i+=a.stride/4;}t.push(`
|
|
267
267
|
index += stride * 4;
|
|
268
268
|
}
|
|
269
269
|
`),t.unshift(`
|
|
270
270
|
var stride = ${i};
|
|
271
271
|
`);let s=t.join(`
|
|
272
|
-
`);return new Function("ps","f32v","u32v",s)}var
|
|
272
|
+
`);return new Function("ps","f32v","u32v",s)}var nb=p(()=>{yi();});function VC(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 Bo,ob=p(()=>{Lr();mr();bi();yi();Nh();sb();nb();Bo=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=ut(h.format);h.dynamic?n+=d.stride:s+=d.stride;}this._dynamicStride=n/4,this._staticStride=s/4,this.staticAttributeBuffer=new It(t*4*s),this.dynamicAttributeBuffer=new It(t*4*n),this.indexBuffer=Zu(t);let o=new at,a=0,u=0;this._staticBuffer=new Ee({data:new Float32Array(1),label:"static-particle-buffer",shrinkToFit:false,usage:j.VERTEX|j.COPY_DST}),this._dynamicBuffer=new Ee({data:new Float32Array(1),label:"dynamic-particle-buffer",shrinkToFit:false,usage:j.VERTEX|j.COPY_DST});for(let c in i){let h=i[c],d=ut(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=VC(e);return this._generateParticleUpdateCache[t]?this._generateParticleUpdateCache[t]:(this._generateParticleUpdateCache[t]=this.generateParticleUpdate(e),this._generateParticleUpdateCache[t])}generateParticleUpdate(e){return Nd(e)}update(e,t){e.length>this._size&&(t=true,this._size=Math.max(e.length,this._size*1.5|0),this.staticAttributeBuffer=new It(this._size*this._staticStride*4*4),this.dynamicAttributeBuffer=new It(this._size*this._dynamicStride*4*4),this.indexBuffer=Zu(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 Hd,ab=p(()=>{Hd=`varying vec2 vUV;
|
|
273
273
|
varying vec4 vColor;
|
|
274
274
|
|
|
275
275
|
uniform sampler2D uTexture;
|
|
@@ -277,7 +277,7 @@ uniform sampler2D uTexture;
|
|
|
277
277
|
void main(void){
|
|
278
278
|
vec4 color = texture2D(uTexture, vUV) * vColor;
|
|
279
279
|
gl_FragColor = color;
|
|
280
|
-
}`;});var
|
|
280
|
+
}`;});var Vd,ub=p(()=>{Vd=`attribute vec2 aVertex;
|
|
281
281
|
attribute vec2 aUV;
|
|
282
282
|
attribute vec4 aColor;
|
|
283
283
|
|
|
@@ -316,7 +316,7 @@ void main(void){
|
|
|
316
316
|
vUV = aUV;
|
|
317
317
|
vColor = vec4(aColor.rgb * aColor.a, aColor.a) * uColor;
|
|
318
318
|
}
|
|
319
|
-
`;});var
|
|
319
|
+
`;});var Qu,lb=p(()=>{Qu=`
|
|
320
320
|
struct ParticleUniforms {
|
|
321
321
|
uTranslationMatrix:mat3x3<f32>,
|
|
322
322
|
uColor:vec4<f32>,
|
|
@@ -378,10 +378,10 @@ fn mainFragment(
|
|
|
378
378
|
var sample = textureSample(uTexture, uSampler, uv) * color;
|
|
379
379
|
|
|
380
380
|
return sample;
|
|
381
|
-
}`;});var Ma,Ag=p(()=>{ke();K();ct();vt();Ut();ee();ir();vg();Sg();Eg();Ma=class extends Ae{constructor(){let e=xe.from({vertex:Tg,fragment:yg}),t=_e.from({fragment:{source:bc,entryPoint:"mainFragment"},vertex:{source:bc,entryPoint:"mainVertex"}});super({glProgram:e,gpuProgram:t,resources:{uTexture:C.WHITE.source,uSampler:new Ge({}),uniforms:{uTranslationMatrix:{value:new P,type:"mat3x3<f32>"},uColor:{value:new H(16777215),type:"vec4<f32>"},uRound:{value:1,type:"f32"},uResolution:{value:[0,0],type:"vec2<f32>"}}}});}};});var Ki,yc=p(()=>{K();Ie();Vs();Rt();dt();qi();bg();Ag();Ki=class{constructor(e,t){this.state=Se.for2d(),this.localUniforms=new J({uTranslationMatrix:{value:new P,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 Ma,this.state=Se.for2d(),this._managedContainers=new pe({renderer:e,type:"renderable",name:"particleContainer"});}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 Ra({size:e.particleChildren.length,properties:e._properties}),this._managedContainers.add(e),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=or(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,jt(e.groupColorAlpha,o.uColor,0),this.adaptor.execute(this,e);}destroy(){this._managedContainers.destroy(),this.renderer=null,this.defaultShader&&(this.defaultShader.destroy(),this.defaultShader=null);}};});var Js,Cg=p(()=>{S();mg();yc();Js=class extends Ki{constructor(e){super(e,new Ba);}};Js.extension={type:[m.WebGLPipes],name:"particle"};});var Da,wg=p(()=>{Da=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 en,Pg=p(()=>{S();wg();yc();en=class extends Ki{constructor(e){super(e,new Da);}};en.extension={type:[m.WebGPUPipes],name:"particle"};});var Bg=p(()=>{S();Cg();Pg();G.add(Js);G.add(en);});function tn(r,e){let{texture:t,bounds:i}=r,s=e._style._getFinalPadding();ia(i,e._anchor,t);let n=e._anchor._x*s*2,o=e._anchor._y*s*2;i.minX-=s-n,i.minY-=s-o,i.maxX-=s-n,i.maxY-=s-o;}var vc=p(()=>{Hl();});var qt,rn=p(()=>{qt=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(){this.reset();}};});var Fa,Rg=p(()=>{rn();Fa=class extends qt{};});var sn,Mg=p(()=>{S();dt();vc();Rg();sn=class{constructor(e){this._renderer=e,e.runners.resolutionChange.add(this),this._managedTexts=new pe({renderer:e,type:"renderable",onUnload:this.onTextUnload.bind(this),name:"canvasText"});}resolutionChange(){for(let e in this._managedTexts.items){let t=this._managedTexts.items[e];t?._autoResolution&&t.onViewUpdate();}}validateRenderable(e){let t=this._getGpuText(e),i=e.styleKey;return t.currentKey!==i?true:e._didTextUpdate}addRenderable(e,t){let i=this._getGpuText(e);if(e._didTextUpdate){let s=e._autoResolution?this._renderer.resolution:e.resolution;(i.currentKey!==e.styleKey||e.resolution!==s)&&this._updateGpuText(e),e._didTextUpdate=false,tn(i,e);}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.decreaseReferenceCount(t.currentKey),e._resolution=e._autoResolution?this._renderer.resolution:e.resolution,t.texture=this._renderer.canvasText.getManagedTexture(e),t.currentKey=e.styleKey;}_getGpuText(e){return e._gpuData[this._renderer.uid]||this.initGpuText(e)}initGpuText(e){let t=new Fa;return t.currentKey="--",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,this._managedTexts.add(e),t}onTextUnload(e){let t=e._gpuData[this._renderer.uid];if(!t)return;let{canvasText:i}=this._renderer;i.getReferenceCount(t.currentKey)>0?i.decreaseReferenceCount(t.currentKey):t.texture&&i.returnTexture(t.texture);}destroy(){this._managedTexts.destroy(),this._renderer=null;}};sn.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"text"};});var tT,lr,Ga=p(()=>{K();Me();tT={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"}},lr=class{constructor(e,t){this.uid=W("fillPattern"),this._tick=0,this.transform=new P,this.texture=e,this.transform.scale(1/e.frame.width,1/e.frame.height),t&&(e.source.style.addressModeU=tT[t].addressModeU,e.source.style.addressModeV=tT[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._tick++;}get texture(){return this._texture}set texture(e){this._texture!==e&&(this._texture=e,this._tick++);}get styleKey(){return `fill-pattern-${this.uid}-${this._tick}`}destroy(){this.texture.destroy(true),this.texture=null;}};});var iT=Wr((Vk,rT)=>{rT.exports=q3;var Dg={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},j3=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function q3(r){var e=[];return r.replace(j3,function(t,i,s){var n=i.toLowerCase();for(s=Z3(s),n=="m"&&s.length>2&&(e.push([i].concat(s.splice(0,2))),n="l",i=i=="m"?"l":"L");;){if(s.length==Dg[n])return s.unshift(i),e.push(s);if(s.length<Dg[n])throw new Error("malformed path data");e.push([i].concat(s.splice(0,Dg[n])));}}),e}var K3=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function Z3(r){var e=r.match(K3);return e?e.map(Number):[]}});function Fg(r,e){let t=(0, sT.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:M(`Unknown SVG path command: ${l}`);}l!=="Z"&&l!=="z"&&s===null&&(s={startX:n,startY:o},i.push(s));}return e}var sT,Gg=p(()=>{sT=Kd(iT());se();});var Ua,Ug=p(()=>{De();Ua=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 V),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 Ia,Ig=p(()=>{De();Ia=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,f=e-this.x,g=t-this.y,_=f*f/(l*l)+g*g/(c*c),x=f*f/(h*h)+g*g/(d*d);return _>1&&x<=1}getBounds(e){return e||(e=new V),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 Zi(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 f,g;d<0?(f=t,g=i):d>1?(f=s,g=n):(f=t+d*u,g=i+d*l);let _=r-f,x=e-g;return _*_+x*x}var Tc=p(()=>{});var Q3,J3,Qi,Og=p(()=>{re();Tc();De();Qi=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(Q3),i=e.getBounds(J3);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],f=u[(c+2)%u.length],g=u[(c+3)%u.length],_=Zi(e,t,h,d,f,g),x=Math.sign((f-h)*(t-d)-(g-d)*(e-h));if(_<=(x<0?a:o))return true}return false}getBounds(e){e||(e=new V);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 w("8.11.0","Polygon.lastX is deprecated, please use Polygon.lastX instead."),this.points[this.points.length-2]}get y(){return w("8.11.0","Polygon.y is deprecated, please use Polygon.lastY instead."),this.points[this.points.length-1]}get startX(){return this.points[0]}get startY(){return this.points[1]}};});var Sc,Oa,kg=p(()=>{De();Sc=(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},Oa=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 V),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,f=o+l,g=a-l*2,_=u-l*2,x=n+a,b=o+u;return (e>=n-c&&e<=n+h||e>=x-h&&e<=x+c)&&t>=f&&t<=f+_||(t>=o-c&&t<=o+h||t>=b-h&&t<=b+c)&&e>=d&&e<=d+g?true:e<d&&t<f&&Sc(e,t,d,f,l,h,c)||e>x-l&&t<f&&Sc(e,t,x-l,f,l,h,c)||e>x-l&&t>b-l&&Sc(e,t,x-l,b-l,l,h,c)||e<d&&t>b-l&&Sc(e,t,d,b-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 ka(r,e,t,i,s,n,o,a,u,l){let h=Math.min(.99,Math.max(0,l??ji.defaultOptions.bezierSmoothness)),d=(tC-h)/1;return d*=d,rC(e,t,i,s,n,o,a,u,r,d),r}function rC(r,e,t,i,s,n,o,a,u,l){Ng(r,e,t,i,s,n,o,a,u,l,0),u.push(o,a);}function Ng(r,e,t,i,s,n,o,a,u,l,c){if(c>eC)return;let h=Math.PI,d=(r+t)/2,f=(e+i)/2,g=(t+s)/2,_=(i+n)/2,x=(s+o)/2,b=(n+a)/2,y=(d+g)/2,v=(f+_)/2,T=(g+x)/2,B=(_+b)/2,E=(y+T)/2,A=(v+B)/2;if(c>0){let k=o-r,R=a-e,I=Math.abs((t-o)*R-(i-a)*k),D=Math.abs((s-o)*R-(n-a)*k),z,ie;if(I>Ec&&D>Ec){if((I+D)*(I+D)<=l*(k*k+R*R)){if(nn<Lg){u.push(E,A);return}let ce=Math.atan2(n-i,s-t);if(z=Math.abs(ce-Math.atan2(i-e,t-r)),ie=Math.abs(Math.atan2(a-n,o-s)-ce),z>=h&&(z=2*h-z),ie>=h&&(ie=2*h-ie),z+ie<nn){u.push(E,A);return}if(Ji!==0){if(z>Ji){u.push(t,i);return}if(ie>Ji){u.push(s,n);return}}}}else if(I>Ec){if(I*I<=l*(k*k+R*R)){if(nn<Lg){u.push(E,A);return}if(z=Math.abs(Math.atan2(n-i,s-t)-Math.atan2(i-e,t-r)),z>=h&&(z=2*h-z),z<nn){u.push(t,i),u.push(s,n);return}if(Ji!==0&&z>Ji){u.push(t,i);return}}}else if(D>Ec){if(D*D<=l*(k*k+R*R)){if(nn<Lg){u.push(E,A);return}if(z=Math.abs(Math.atan2(a-n,o-s)-Math.atan2(n-i,s-t)),z>=h&&(z=2*h-z),z<nn){u.push(t,i),u.push(s,n);return}if(Ji!==0&&z>Ji){u.push(s,n);return}}}else if(k=E-(r+o)/2,R=A-(e+a)/2,k*k+R*R<=l){u.push(E,A);return}}Ng(r,e,d,f,y,v,E,A,u,l,c+1),Ng(E,A,T,B,x,b,o,a,u,l,c+1);}var eC,Ec,tC,Lg,nn,Ji,Ac=p(()=>{Ca();eC=8,Ec=11920929e-14,tC=1,Lg=.01,nn=0,Ji=0;});function Vg(r,e,t,i,s,n,o,a){let l=Math.min(.99,Math.max(0,a??ji.defaultOptions.bezierSmoothness)),c=(nC-l)/1;return c*=c,aC(e,t,i,s,n,o,r,c),r}function aC(r,e,t,i,s,n,o,a){Hg(o,r,e,t,i,s,n,a,0),o.push(s,n);}function Hg(r,e,t,i,s,n,o,a,u){if(u>iC)return;let l=Math.PI,c=(e+i)/2,h=(t+s)/2,d=(i+n)/2,f=(s+o)/2,g=(c+d)/2,_=(h+f)/2,x=n-e,b=o-t,y=Math.abs((i-n)*b-(s-o)*x);if(y>sC){if(y*y<=a*(x*x+b*b)){if(nT<oC){r.push(g,_);return}let v=Math.abs(Math.atan2(o-s,n-i)-Math.atan2(s-t,i-e));if(v>=l&&(v=2*l-v),v<nT){r.push(g,_);return}}}else if(x=g-(e+n)/2,b=_-(t+o)/2,x*x+b*b<=a){r.push(g,_);return}Hg(r,e,t,c,h,g,_,a,u+1),Hg(r,g,_,d,f,n,o,a,u+1);}var iC,sC,nC,oC,nT,zg=p(()=>{Ca();iC=8,sC=11920929e-14,nC=1,oC=.01,nT=0;});function La(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),f=Math.sin(c),g=e+d*i,_=t+f*i;r.push(g,_),c+=l;}}var Cc=p(()=>{});function Wg(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 f=u*u+l*l,g=c*c+h*h,_=u*c+l*h,x=n*Math.sqrt(f)/d,b=n*Math.sqrt(g)/d,y=x*_/f,v=b*_/g,T=x*h+b*l,B=x*c+b*u,E=l*(b+y),A=u*(b+y),k=h*(x+v),R=c*(x+v),I=Math.atan2(A-B,E-T),D=Math.atan2(R-B,k-T);La(r,T+e,B+t,n,I,D,l*c>h*u);}var Xg=p(()=>{Cc();});function uC(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 jg(r,e,t,i,s,n,o,a=0,u=0,l=0){if(n===0||o===0)return;let c=Math.sin(a*Na/360),h=Math.cos(a*Na/360),d=h*(e-i)/2+c*(t-s)/2,f=-c*(e-i)/2+h*(t-s)/2;if(d===0&&f===0)return;n=Math.abs(n),o=Math.abs(o);let g=Math.pow(d,2)/Math.pow(n,2)+Math.pow(f,2)/Math.pow(o,2);g>1&&(n*=Math.sqrt(g),o*=Math.sqrt(g)),lC(e,t,i,s,n,o,u,l,c,h,d,f,Yg);let{ang1:_,ang2:x}=Yg,{centerX:b,centerY:y}=Yg,v=Math.abs(x)/(Na/4);Math.abs(1-v)<1e-7&&(v=1);let T=Math.max(Math.ceil(v),1);x/=T;let B=r[r.length-2],E=r[r.length-1],A={x:0,y:0};for(let k=0;k<T;k++){let R=uC(_,x),{x:I,y:D}=$g(R[0],n,o,h,c,b,y,A),{x:z,y:ie}=$g(R[1],n,o,h,c,b,y,A),{x:ce,y:xr}=$g(R[2],n,o,h,c,b,y,A);ka(r,B,E,I,D,z,ie,ce,xr),B=ce,E=xr,_+=x;}}var Na,Yg,$g,oT,lC,qg=p(()=>{Ac();Na=Math.PI*2,Yg={centerX:0,centerY:0,ang1:0,ang2:0},$g=({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};oT=(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)},lC=(r,e,t,i,s,n,o,a,u,l,c,h,d)=>{let f=Math.pow(s,2),g=Math.pow(n,2),_=Math.pow(c,2),x=Math.pow(h,2),b=f*g-f*x-g*_;b<0&&(b=0),b/=f*x+g*_,b=Math.sqrt(b)*(o===a?-1:1);let y=b*s/n*h,v=b*-n/s*c,T=l*y-u*v+(r+t)/2,B=u*y+l*v+(e+i)/2,E=(c-y)/s,A=(h-v)/n,k=(-c-y)/s,R=(-h-v)/n,I=oT(1,0,E,A),D=oT(E,A,k,R);a===0&&D>0&&(D-=Na),a===1&&D<0&&(D+=Na),d.centerX=T,d.centerY=B,d.ang1=I,d.ang2=D;};});function Kg(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),f=1,g=false;c.nx*h.nx-c.ny*-h.ny<0?d<0?d=Math.PI+d:(d=Math.PI-d,f=-1,g=true):d>0&&(f=-1,g=true);let _=d/2,x,b=Math.abs(Math.cos(_)*u/Math.sin(_));b>Math.min(c.len/2,h.len/2)?(b=Math.min(c.len/2,h.len/2),x=Math.abs(b*Math.sin(_)/Math.cos(_))):x=u;let y=a.x+h.nx*b+-h.ny*x*f,v=a.y+h.ny*b+h.nx*x*f,T=Math.atan2(c.ny,c.nx)+Math.PI/2*f,B=Math.atan2(h.ny,h.nx)-Math.PI/2*f;o===0&&r.moveTo(y+Math.cos(T)*x,v+Math.sin(T)*x),r.arc(y,v,x,T,B,g),n=a;}}function Zg(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),f;if(d<1e-4)f=u;else {let x=Math.min(d/2,l);f=n(u,c,x/d);}let g=s(h,u),_;if(g<1e-4)_=u;else {let x=Math.min(g/2,l);_=n(u,h,x/g);}a===0?r.moveTo(f.x,f.y):r.lineTo(f.x,f.y),r.quadraticCurveTo(u.x,u.y,_.x,_.y,i);}}var Qg=p(()=>{});var cC,Ha,Jg=p(()=>{Ug();Ig();Og();De();kg();qe();Ac();zg();Cc();Xg();qg();Qg();cC=new V,Ha=class{constructor(e){this.shapePrimitives=[],this._currentPoly=null,this._bounds=new oe,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 La(a,e,t,i,s,n,o),this}arcTo(e,t,i,s,n){this._ensurePoly();let o=this._currentPoly.points;return Wg(o,e,t,i,s,n),this}arcToSvg(e,t,i,s,n,o,a){let u=this._currentPoly.points;return jg(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 ka(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 Vg(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 V(e,t,i,s),n),this}circle(e,t,i,s){return this.drawShape(new Ua(e,t,i),s),this}poly(e,t,i){let s=new Qi(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 f=d*c+l,g=e+i*Math.cos(f),_=t+i*Math.sin(f),x=f+Math.PI+h,b=f-Math.PI-h,y=g+n*Math.cos(x),v=_+n*Math.sin(x),T=g+n*Math.cos(b),B=_+n*Math.sin(b);d===0?this.moveTo(y,v):this.lineTo(y,v),this.quadraticCurveTo(g,_,T,B,a);}return this.closePath()}roundShape(e,t,i=false,s){return e.length<3?this:(i?Zg(this,e,t,s):Kg(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 Ia(e,t,i,s),n),this}roundRect(e,t,i,s,n,o){return this.drawShape(new Oa(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 Qi,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 Qi,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(cC);s.transform?e.addRect(n,s.transform):e.addRect(n);}return e}};});function Va(r,e){return r?r.prepend(e):e.clone()}var pt,on=p(()=>{bt();Me();se();Gg();Jg();pt=class r{constructor(e,t=false){this.instructions=[],this.uid=W("graphicsPath"),this._dirty=true,this.checkForHoles=t,typeof e=="string"?Fg(e,this):this.instructions=e?.slice()??[];}get shapePath(){return this._shapePath||(this._shapePath=new Ha(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(q.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(q.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 f=d%2?n:s,g=d*c+u;h.push(e+f*Math.cos(g),t+f*Math.sin(g));}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,f=0,g=0,_=0;for(let x=0;x<this.instructions.length;x++){let b=this.instructions[x],y=b.data;switch(b.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],f=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*f+o,y[3]=i*d+n*f+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],g=y[0],_=y[1],y[0]=t*g+s*_,y[1]=i*g+n*_,y[5]=t*u+s*l+o,y[6]=i*u+n*l+a;break;case "circle":y[4]=Va(y[3],e);break;case "rect":y[4]=Va(y[4],e);break;case "ellipse":y[8]=Va(y[8],e);break;case "roundRect":y[5]=Va(y[5],e);break;case "addPath":y[0].transform(e);break;case "poly":y[2]=Va(y[2],e);break;default:M("unknown transform action",b.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 ve(r,e,t){let i=r.getAttribute(e);return i?Number(i):t}var wc=p(()=>{});function ex(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]=hC(o);break;case "radialgradient":e.defs[o.id]=dC();break;}}}}function hC(r){let e=ve(r,"x1",0),t=ve(r,"y1",0),i=ve(r,"x2",1),s=ve(r,"y2",0),n=r.getAttribute("gradientUnits")||"objectBoundingBox",o=new ft(e,t,i,s,n==="objectBoundingBox"?"local":"global");for(let a=0;a<r.children.length;a++){let u=r.children[a],l=ve(u,"offset",0),c=H.shared.setValue(u.getAttribute("stop-color")).toNumber();o.addColorStop(l,c);}return o}function dC(r){return M("[SVG Parser] Radial gradients are not yet supported"),new ft(0,0,1,0)}var tx=p(()=>{ke();se();Yi();wc();});function Pc(r){let e=r.match(/url\s*\(\s*['"]?\s*#([^'"\s)]+)\s*['"]?\s*\)/i);return e?e[1]:""}var rx=p(()=>{});function Bc(r,e){let t=r.getAttribute("style"),i={},s={},n={strokeStyle:i,fillStyle:s,useFill:false,useStroke:false};for(let o in ix){let a=r.getAttribute(o);a&&aT(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(":");ix[l]&&aT(e,n,l,c.trim());}}return {strokeStyle:n.useStroke?i:null,fillStyle:n.useFill?s:null,useFill:n.useFill,useStroke:n.useStroke}}function aT(r,e,t,i){switch(t){case "stroke":if(i!=="none"){if(i.startsWith("url(")){let s=Pc(i);e.strokeStyle.fill=r.defs[s];}else e.strokeStyle.color=H.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=Pc(i);e.fillStyle.fill=r.defs[s];}else e.fillStyle.color=H.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 ix,sx=p(()=>{ke();rx();ix={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 nx(r){if(r.length<=2)return true;let e=r.map(a=>a.area).sort((a,u)=>u-a),[t,i]=e,s=e[e.length-1],n=t/i,o=i/s;return !(n>3&&o<2)}function fC(r,e=0){let t=r.instructions[e];if(!t||t.action!=="fill")throw new Error(`Expected fill instruction at index ${e}, got ${t?.action||"undefined"}`);return t.data}var ox=p(()=>{});function ax(r){return r.split(/(?=[Mm])/).filter(i=>i.trim().length>0)}function ux(r){let e=r.match(/[-+]?[0-9]*\.?[0-9]+/g);if(!e||e.length<4)return 0;let t=e.map(Number),i=[],s=[];for(let c=0;c<t.length;c+=2)c+1<t.length&&(i.push(t[c]),s.push(t[c+1]));if(i.length===0||s.length===0)return 0;let n=Math.min(...i),o=Math.max(...i),a=Math.min(...s),u=Math.max(...s);return (o-n)*(u-a)}function Rc(r,e){let t=new pt(r,false);for(let i of t.instructions)e.instructions.push(i);}var lx=p(()=>{on();});function cx(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 pt};ex(r,t);let i=r.children,{fillStyle:s,strokeStyle:n}=Bc(r,t);for(let o=0;o<i.length;o++){let a=i[o];a.nodeName.toLowerCase()!=="defs"&&uT(a,t,s,n);}return e}function uT(r,e,t,i){let s=r.children,{fillStyle:n,strokeStyle:o}=Bc(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,f,g,_,x,b,y,v,T,B,E,A,k;switch(r.nodeName.toLowerCase()){case "path":{B=r.getAttribute("d");let R=r.getAttribute("fill-rule"),I=ax(B),D=R==="evenodd",z=I.length>1;if(D&&z){let ce=I.map(F=>({path:F,area:ux(F)}));if(ce.sort((F,L)=>L.area-F.area),I.length>3||!nx(ce))for(let F=0;F<ce.length;F++){let L=ce[F],mi=F===0;e.context.beginPath();let ue=new pt(void 0,true);Rc(L.path,ue),e.context.path(ue),mi?(t&&e.context.fill(t),i&&e.context.stroke(i)):e.context.cut();}else for(let F=0;F<ce.length;F++){let L=ce[F],mi=F%2===1;e.context.beginPath();let ue=new pt(void 0,true);Rc(L.path,ue),e.context.path(ue),mi?e.context.cut():(t&&e.context.fill(t),i&&e.context.stroke(i));}}else {let ce=R?R==="evenodd":true;E=new pt(B,ce),e.context.path(E),t&&e.context.fill(t),i&&e.context.stroke(i);}break}case "circle":g=ve(r,"cx",0),_=ve(r,"cy",0),x=ve(r,"r",0),e.context.ellipse(g,_,x,x),t&&e.context.fill(t),i&&e.context.stroke(i);break;case "rect":u=ve(r,"x",0),l=ve(r,"y",0),A=ve(r,"width",0),k=ve(r,"height",0),b=ve(r,"rx",0),y=ve(r,"ry",0),b||y?e.context.roundRect(u,l,A,k,b||y):e.context.rect(u,l,A,k),t&&e.context.fill(t),i&&e.context.stroke(i);break;case "ellipse":g=ve(r,"cx",0),_=ve(r,"cy",0),b=ve(r,"rx",0),y=ve(r,"ry",0),e.context.beginPath(),e.context.ellipse(g,_,b,y),t&&e.context.fill(t),i&&e.context.stroke(i);break;case "line":c=ve(r,"x1",0),h=ve(r,"y1",0),d=ve(r,"x2",0),f=ve(r,"y2",0),e.context.beginPath(),e.context.moveTo(c,h),e.context.lineTo(d,f),i&&e.context.stroke(i);break;case "polygon":T=r.getAttribute("points"),v=T.match(/-?\d+/g).map(R=>parseInt(R,10)),e.context.poly(v,true),t&&e.context.fill(t),i&&e.context.stroke(i);break;case "polyline":T=r.getAttribute("points"),v=T.match(/-?\d+/g).map(R=>parseInt(R,10)),e.context.poly(v,false),i&&e.context.stroke(i);break;case "g":case "svg":break;default:{M(`[SVG parser] <${r.nodeName}> elements unsupported`);break}}a&&(t=null);for(let R=0;R<s.length;R++)uT(s[R],e,t,i);}var hx=p(()=>{se();on();tx();wc();sx();ox();lx();});function pC(r){return H.isColorLike(r)}function lT(r){return r instanceof lr}function cT(r){return r instanceof ft}function mC(r){return r instanceof C}function gC(r,e,t){let i=H.shared.setValue(e??0);return r.color=i.toNumber(),r.alpha=i.alpha===1?t.alpha:i.alpha,r.texture=C.WHITE,{...t,...r}}function xC(r,e,t){return r.texture=e,{...t,...r}}function hT(r,e,t){return r.fill=e,r.color=16777215,r.texture=e.texture,r.matrix=e.transform,{...t,...r}}function dT(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 _C(r,e){let t={...e,...r},i=H.shared.setValue(t.color);return t.alpha*=i.alpha,t.color=i.toNumber(),t}function cr(r,e){if(r==null)return null;let t={},i=r;return pC(r)?gC(t,r,e):mC(r)?xC(t,r,e):lT(r)?hT(t,r,e):cT(r)?dT(t,r,e):i.fill&&lT(i.fill)?hT(i,i.fill,e):i.fill&&cT(i.fill)?dT(i,i.fill,e):_C(i,e)}function es(r,e){let{width:t,alignment:i,miterLimit:s,cap:n,join:o,pixelLine:a,...u}=e,l=cr(r,u);return l?{width:t,alignment:i,miterLimit:s,cap:n,join:o,pixelLine:a,...l}:null}var Mc=p(()=>{ke();ee();Yi();Ga();});var bC,fT,dx,Ne,ts=p(()=>{je();ke();K();bt();ee();Me();re();qe();on();hx();Mc();bC=new q,fT=new P,dx=class hr extends fe{constructor(){super(...arguments),this._gpuData=Object.create(null),this.autoGarbageCollect=true,this._gcLastUsed=-1,this.uid=W("graphicsContext"),this.dirty=true,this.batchMode="auto",this.instructions=[],this.destroyed=false,this._activePath=new pt,this._transform=new P,this._fillStyle={...hr.defaultFillStyle},this._strokeStyle={...hr.defaultStrokeStyle},this._stateStack=[],this._tick=0,this._bounds=new oe,this._boundsDirty=true;}clone(){let e=new hr;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=cr(e,hr.defaultFillStyle);}get strokeStyle(){return this._strokeStyle}set strokeStyle(e){this._strokeStyle=es(e,hr.defaultStrokeStyle);}setFillStyle(e){return this._fillStyle=cr(e,hr.defaultFillStyle),this}setStrokeStyle(e){return this._strokeStyle=cr(e,hr.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?H.shared.setValue(t).toNumber():16777215}}),this.onUpdate(),this}beginPath(){return this._activePath=new pt,this}fill(e,t){let i,s=this.instructions[this.instructions.length-1];return this._tick===0&&s?.action==="stroke"?i=s.data.path:i=this._activePath.clone(),i?(e!=null&&(t!==void 0&&typeof e=="number"&&(w(O,"GraphicsContext.fill(color, alpha) is deprecated, use GraphicsContext.fill({ color, alpha }) instead"),e={color:e,alpha:t}),this._fillStyle=cr(e,hr.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(q.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?.action==="fill"?t=i.data.path:t=this._activePath.clone(),t?(e!=null&&(this._strokeStyle=es(e,hr.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++,cx(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 P?(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 P?(this._transform.append(e),this):(fT.set(e,t,i,s,n,o),this._transform.append(fT),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._boundsDirty=true,!this.dirty&&(this.emit("update",this,16),this.dirty=true);}get bounds(){if(!this._boundsDirty)return this._bounds;this._boundsDirty=false;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,f=d?d.applyInverse(e,bC):e;if(n.action==="fill")i=h.contains(f.x,f.y);else {let _=u;i=h.strokeContains(f.x,f.y,_.width,_.alignment);}let g=o.hole;if(g){let _=g.shapePath?.shapePrimitives;if(_)for(let x=0;x<_.length;x++)_[x].shape.contains(f.x,f.y)&&(i=false);}if(i)return true}}return i}unload(){this.emit("unload",this);for(let e in this._gpuData)this._gpuData[e]?.destroy();this._gpuData=Object.create(null);}destroy(e=false){if(this.destroyed)return;if(this.destroyed=true,this._stateStack.length=0,this._transform=null,this.unload(),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.fill&&"uid"in this._fillStyle.fill?this._fillStyle.fill.destroy():this._fillStyle.texture.destroy(i)),this._strokeStyle.texture&&(this._strokeStyle.fill&&"uid"in this._strokeStyle.fill?this._strokeStyle.fill.destroy():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;}};dx.defaultFillStyle={color:16777215,alpha:1,texture:C.WHITE,matrix:null,fill:null,textureSpace:"local"};dx.defaultStrokeStyle={width:1,color:16777215,alpha:1,alignment:.5,miterLimit:10,cap:"butt",join:"miter",texture:C.WHITE,matrix:null,fill:null,textureSpace:"local",pixelLine:false};Ne=dx;});function yC(r){let e=r;if(typeof e.dropShadow=="boolean"&&e.dropShadow){let t=Re.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){w(O,"strokeThickness is now a part of stroke");let t=e.stroke,i={};if(H.isColorLike(t))i.color=t;else if(t instanceof ft||t instanceof lr)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)){if(w(O,"gradient fill is now a fill pattern: `new FillGradient(...)`"),!Array.isArray(e.fill)||e.fill.length===0)throw new Error("Invalid fill value. Expected an array of colors for gradient fill.");e.fill.length!==e.fillGradientStops.length&&M("The number of fill colors must match the number of fill gradient stops.");let t=new ft({start:{x:0,y:0},end:{x:0,y:1},textureSpace:"local"}),i=e.fillGradientStops.slice(),s=e.fill.map(n=>H.shared.setValue(n).toNumber());i.forEach((n,o)=>{t.addColorStop(n,s[o]);}),r.fill={fill:t};}}var fx,Re,Kt=p(()=>{je();ke();Me();re();se();Yi();Ga();ts();Mc();fx=class an extends fe{constructor(e={}){super(),this.uid=W("textStyle"),this._tick=0,yC(e);let t={...an.defaultTextStyle,...e};for(let i in t){let s=i;this[s]=t[i];}this.update(),this._tick=0;}get align(){return this._align}set align(e){this._align!==e&&(this._align=e,this.update());}get breakWords(){return this._breakWords}set breakWords(e){this._breakWords!==e&&(this._breakWords=e,this.update());}get dropShadow(){return this._dropShadow}set dropShadow(e){this._dropShadow!==e&&(e!==null&&typeof e=="object"?this._dropShadow=this._createProxy({...an.defaultDropShadow,...e}):this._dropShadow=e?this._createProxy({...an.defaultDropShadow}):null,this.update());}get fontFamily(){return this._fontFamily}set fontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.update());}get fontSize(){return this._fontSize}set fontSize(e){this._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&&(this._fontStyle=e.toLowerCase(),this.update());}get fontVariant(){return this._fontVariant}set fontVariant(e){this._fontVariant!==e&&(this._fontVariant=e,this.update());}get fontWeight(){return this._fontWeight}set fontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.update());}get leading(){return this._leading}set leading(e){this._leading!==e&&(this._leading=e,this.update());}get letterSpacing(){return this._letterSpacing}set letterSpacing(e){this._letterSpacing!==e&&(this._letterSpacing=e,this.update());}get lineHeight(){return this._lineHeight}set lineHeight(e){this._lineHeight!==e&&(this._lineHeight=e,this.update());}get padding(){return this._padding}set padding(e){this._padding!==e&&(this._padding=e,this.update());}get filters(){return this._filters}set filters(e){this._filters!==e&&(this._filters=Object.freeze(e),this.update());}get trim(){return this._trim}set trim(e){this._trim!==e&&(this._trim=e,this.update());}get textBaseline(){return this._textBaseline}set textBaseline(e){this._textBaseline!==e&&(this._textBaseline=e,this.update());}get whiteSpace(){return this._whiteSpace}set whiteSpace(e){this._whiteSpace!==e&&(this._whiteSpace=e,this.update());}get wordWrap(){return this._wordWrap}set wordWrap(e){this._wordWrap!==e&&(this._wordWrap=e,this.update());}get wordWrapWidth(){return this._wordWrapWidth}set wordWrapWidth(e){this._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({...Ne.defaultFillStyle,...e},()=>{this._fill=cr({...this._originalFill},Ne.defaultFillStyle);})),this._fill=cr(e===0?"black":e,Ne.defaultFillStyle),this.update());}get stroke(){return this._originalStroke}set stroke(e){e!==this._originalStroke&&(this._originalStroke=e,this._isFillStyle(e)&&(this._originalStroke=this._createProxy({...Ne.defaultStrokeStyle,...e},()=>{this._stroke=es({...this._originalStroke},Ne.defaultStrokeStyle);})),this._stroke=es(e,Ne.defaultStrokeStyle),this.update());}update(){this._tick++,this.emit("update",this);}reset(){let e=an.defaultTextStyle;for(let t in e)this[t]=e[t];}get styleKey(){return `${this.uid}-${this._tick}`}clone(){return new an({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||(i[s]=n,t?.(s,n),this.update()),true)})}_isFillStyle(e){return (e??null)!==null&&!(H.isColorLike(e)||e instanceof ft||e instanceof lr)}};fx.defaultDropShadow={alpha:1,angle:Math.PI/6,blur:0,color:"black",distance:5};fx.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};Re=fx;});function za(r,e,t,i){let s=vC;s.minX=0,s.minY=0,s.maxX=r.width/i|0,s.maxY=r.height/i|0;let n=le.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 vC,Dc=p(()=>{Lt();qe();vC=new oe;});var Fc,mt,rs=p(()=>{ae();Bs();Yr();Fc=class{constructor(e){this._canvasPool=Object.create(null),this.canvasOptions=e||{},this.enableFullScreen=false;}_createCanvasAndContext(e,t){let i=U.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=rr(e),t=rr(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.resetTransform(),e.context.clearRect(0,0,i,s),this._canvasPool[n].push(e);}clear(){this._canvasPool={};}},mt=new Fc;Ct.register(mt);});function TC(r,e){is||(is=U.get().createCanvas(256,128),Pr=is.getContext("2d",{willReadFrequently:true}),Pr.globalCompositeOperation="copy",Pr.globalAlpha=1),(is.width<r||is.height<e)&&(is.width=rr(r),is.height=rr(e));}function pT(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 mT(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 px(...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(TC(s,n),!Pr)throw new TypeError("Failed to get canvas 2D context");Pr.drawImage(t,0,0,s,n,0,0,s*i,n*i);let u=Pr.getImageData(0,0,s,n).data,l=0,c=0,h=s-1,d=n-1;for(;c<n&&pT(u,s,c);)++c;if(c===n)return V.EMPTY;for(;pT(u,s,d);)--d;for(;mT(u,s,l,c,d);)++l;for(;mT(u,s,h,c,d);)--h;return ++h,++d,Pr.globalCompositeOperation="source-over",Pr.strokeRect(l,c,h-l,d-c),Pr.globalCompositeOperation="copy",o??(o=new V),o.set(l/i,c/i,(h-l)/i,(d-c)/i),o}var is,Pr,mx=p(()=>{ae();Bs();De();is=null,Pr=null;});function Gc(r=1e3,e=0,t=false){if(isNaN(r)||r<0)throw new TypeError("Invalid max value");if(isNaN(e)||e<0)throw new TypeError("Invalid ttl value");if(typeof t!="boolean")throw new TypeError("Invalid resetTtl value");return new gx(r,e,t)}var gx,xx=p(()=>{gx=class{constructor(e=0,t=0,i=false){this.first=null,this.items=Object.create(null),this.last=null,this.max=e,this.resetTtl=i,this.size=0,this.ttl=t;}clear(){return this.first=null,this.items=Object.create(null),this.last=null,this.size=0,this}delete(e){if(this.has(e)){let t=this.items[e];delete this.items[e],this.size--,t.prev!==null&&(t.prev.next=t.next),t.next!==null&&(t.next.prev=t.prev),this.first===t&&(this.first=t.next),this.last===t&&(this.last=t.prev);}return this}entries(e=this.keys()){return e.map(t=>[t,this.get(t)])}evict(e=false){if(e||this.size>0){let t=this.first;delete this.items[t.key],--this.size===0?(this.first=null,this.last=null):(this.first=t.next,this.first.prev=null);}return this}expiresAt(e){let t;return this.has(e)&&(t=this.items[e].expiry),t}get(e){let t=this.items[e];if(t!==void 0){if(this.ttl>0&&t.expiry<=Date.now()){this.delete(e);return}return this.moveToEnd(t),t.value}}has(e){return e in this.items}moveToEnd(e){this.last!==e&&(e.prev!==null&&(e.prev.next=e.next),e.next!==null&&(e.next.prev=e.prev),this.first===e&&(this.first=e.next),e.prev=this.last,e.next=null,this.last!==null&&(this.last.next=e),this.last=e,this.first===null&&(this.first=e));}keys(){let e=[],t=this.first;for(;t!==null;)e.push(t.key),t=t.next;return e}setWithEvicted(e,t,i=this.resetTtl){let s=null;if(this.has(e))this.set(e,t,true,i);else {this.max>0&&this.size===this.max&&(s={...this.first},this.evict(true));let n=this.items[e]={expiry:this.ttl>0?Date.now()+this.ttl:this.ttl,key:e,prev:this.last,next:null,value:t};++this.size===1?this.first=n:this.last.next=n,this.last=n;}return s}set(e,t,i=false,s=this.resetTtl){let n=this.items[e];return i||n!==void 0?(n.value=t,i===false&&s&&(n.expiry=this.ttl>0?Date.now()+this.ttl:this.ttl),this.moveToEnd(n)):(this.max>0&&this.size===this.max&&this.evict(true),n=this.items[e]={expiry:this.ttl>0?Date.now()+this.ttl:this.ttl,key:e,prev:this.last,next:null,value:t},++this.size===1?this.first=n:this.last.next=n,this.last=n),this}values(e=this.keys()){return e.map(t=>this.get(t))}};});function li(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)&&!SC.includes(s)&&(s=`"${s}"`),t[i]=s;}return `${r.fontStyle} ${r.fontVariant} ${r.fontWeight} ${e} ${t.join(",")}`}var SC,Wa=p(()=>{SC=["serif","sans-serif","monospace","cursive","fantasy","system-ui"];});var _x,Zt,we,Br=p(()=>{xx();ae();Wa();_x={willReadFrequently:true},Zt=class N{static get experimentalLetterSpacingSupported(){let e=N._experimentalLetterSpacingSupported;if(e===void 0){let t=U.get().getCanvasRenderingContext2D().prototype;e=N._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=N._canvas,s=t.wordWrap){let n=`${e}-${t.styleKey}-wordWrap-${s}`;if(N._measurementCache.has(n))return N._measurementCache.get(n);let o=li(t),a=N.measureFont(o);a.fontSize===0&&(a.fontSize=t.fontSize,a.ascent=t.fontSize);let u=N.__context;u.font=o;let c=(s?N._wordWrap(e,t,i):e).split(/(?:\r\n|\r|\n)/),h=new Array(c.length),d=0;for(let y=0;y<c.length;y++){let v=N._measureText(c[y],t.letterSpacing,u);h[y]=v,d=Math.max(d,v);}let f=t._stroke?.width||0,g=d+f;t.dropShadow&&(g+=t.dropShadow.distance);let _=t.lineHeight||a.fontSize,x=Math.max(_,a.fontSize+f)+(c.length-1)*(_+t.leading);t.dropShadow&&(x+=t.dropShadow.distance);let b=new N(e,t,g,x,c,h,_+t.leading,d,a);return N._measurementCache.set(n,b),b}static _measureText(e,t,i){let s=false;N.experimentalLetterSpacingSupported&&(N.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=(N.graphemeSegmenter(e).length-1)*t;o+=c,l+=c;}return Math.max(o,l)}static _wordWrap(e,t,i=N._canvas){let s=i.getContext("2d",_x),n=0,o="",a="",u=Object.create(null),{letterSpacing:l,whiteSpace:c}=t,h=N._collapseSpaces(c),d=N._collapseNewlines(c),f=!h,g=t.wordWrapWidth+l,_=N._tokenize(e);for(let x=0;x<_.length;x++){let b=_[x];if(N._isNewline(b)){if(!d){a+=N._addLine(o),f=!h,o="",n=0;continue}b=" ";}if(h){let v=N.isBreakingSpace(b),T=N.isBreakingSpace(o[o.length-1]);if(v&&T)continue}let y=N._getFromCache(b,l,u,s);if(y>g)if(o!==""&&(a+=N._addLine(o),o="",n=0),N.canBreakWords(b,t.breakWords)){let v=N.wordWrapSplit(b);for(let T=0;T<v.length;T++){let B=v[T],E=B,A=1;for(;v[T+A];){let R=v[T+A];if(!N.canBreakChars(E,R,b,T,t.breakWords))B+=R;else break;E=R,A++;}T+=A-1;let k=N._getFromCache(B,l,u,s);k+n>g&&(a+=N._addLine(o),f=false,o="",n=0),o+=B,n+=k;}}else {o.length>0&&(a+=N._addLine(o),o="",n=0);let v=x===_.length-1;a+=N._addLine(b,!v),f=false,o="",n=0;}else y+n>g&&(f=false,a+=N._addLine(o),o="",n=0),(o.length>0||!N.isBreakingSpace(b)||f)&&(o+=b,n+=y);}return a+=N._addLine(o,false),a}static _addLine(e,t=true){return e=N._trimRight(e),e=t?`${e}
|
|
381
|
+
}`;});var Ro,cb=p(()=>{Ne();K();_t();St();Ht();ee();dr();ab();ub();lb();Ro=class extends Ae{constructor(){let e=xe.from({vertex:Vd,fragment:Hd}),t=_e.from({fragment:{source:Qu,entryPoint:"mainFragment"},vertex:{source:Qu,entryPoint:"mainVertex"}});super({glProgram:e,gpuProgram:t,resources:{uTexture:A.WHITE.source,uSampler:new De({}),uniforms:{uTranslationMatrix:{value:new P,type:"mat3x3<f32>"},uColor:{value:new H(16777215),type:"vec4<f32>"},uRound:{value:1,type:"f32"},uResolution:{value:[0,0],type:"vec2<f32>"}}}});}};});var Mi,zd=p(()=>{K();Oe();fo();Ft();bt();Ms();ob();cb();Mi=class{constructor(e,t){this.state=Se.for2d(),this.localUniforms=new J({uTranslationMatrix:{value:new P,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 Ro,this.state=Se.for2d(),this._managedContainers=new pe({renderer:e,type:"renderable",name:"particleContainer"});}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 Bo({size:e.particleChildren.length,properties:e._properties}),this._managedContainers.add(e),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=tr(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,Vt(e.groupColorAlpha,o.uColor,0),this.adaptor.execute(this,e);}destroy(){this._managedContainers.destroy(),this.renderer=null,this.defaultShader&&(this.defaultShader.destroy(),this.defaultShader=null);}};});var Gs,hb=p(()=>{S();ib();zd();Gs=class extends Mi{constructor(e){super(e,new Po);}};Gs.extension={type:[m.WebGLPipes],name:"particle"};});var Mo,db=p(()=>{Mo=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 Us,fb=p(()=>{S();db();zd();Us=class extends Mi{constructor(e){super(e,new Mo);}};Us.extension={type:[m.WebGPUPipes],name:"particle"};});var pb=p(()=>{S();hb();fb();G.add(Gs);G.add(Us);});function Is(r,e){let{texture:t,bounds:i}=r,s=e._style._getFinalPadding();co(i,e._anchor,t);let n=e._anchor._x*s*2,o=e._anchor._y*s*2;i.minX-=s-n,i.minY-=s-o,i.maxX-=s-n,i.maxY-=s-o;}var Wd=p(()=>{Uh();});var zt,Do=p(()=>{zt=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(){this.reset();}};});var Fo,mb=p(()=>{Do();Fo=class extends zt{};});var Os,gb=p(()=>{S();bt();Wd();mb();Os=class{constructor(e){this._renderer=e,e.runners.resolutionChange.add(this),this._managedTexts=new pe({renderer:e,type:"renderable",onUnload:this.onTextUnload.bind(this),name:"canvasText"});}resolutionChange(){for(let e in this._managedTexts.items){let t=this._managedTexts.items[e];t?._autoResolution&&t.onViewUpdate();}}validateRenderable(e){let t=this._getGpuText(e),i=e.styleKey;return t.currentKey!==i?true:e._didTextUpdate}addRenderable(e,t){let i=this._getGpuText(e);if(e._didTextUpdate){let s=e._autoResolution?this._renderer.resolution:e.resolution;(i.currentKey!==e.styleKey||e.resolution!==s)&&this._updateGpuText(e),e._didTextUpdate=false,Is(i,e);}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.decreaseReferenceCount(t.currentKey),e._resolution=e._autoResolution?this._renderer.resolution:e.resolution,t.texture=this._renderer.canvasText.getManagedTexture(e),t.currentKey=e.styleKey;}_getGpuText(e){return e._gpuData[this._renderer.uid]||this.initGpuText(e)}initGpuText(e){let t=new Fo;return t.currentKey="--",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,this._managedTexts.add(e),t}onTextUnload(e){let t=e._gpuData[this._renderer.uid];if(!t)return;let{canvasText:i}=this._renderer;i.getReferenceCount(t.currentKey)>0?i.decreaseReferenceCount(t.currentKey):t.texture&&i.returnTexture(t.texture);}destroy(){this._managedTexts.destroy(),this._renderer=null;}};Os.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"text"};});var ST,ir,Ju=p(()=>{K();Ge();ST={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"}},ir=class{constructor(e,t){this.uid=W("fillPattern"),this._tick=0,this.transform=new P,this.texture=e,this.transform.scale(1/e.frame.width,1/e.frame.height),t&&(e.source.style.addressModeU=ST[t].addressModeU,e.source.style.addressModeV=ST[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._tick++;}get texture(){return this._texture}set texture(e){this._texture!==e&&(this._texture=e,this._tick++);}get styleKey(){return `fill-pattern-${this.uid}-${this._tick}`}destroy(){this.texture.destroy(true),this.texture=null;}};});var AT=Jr((zk,ET)=>{ET.exports=WC;var xb={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},zC=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function WC(r){var e=[];return r.replace(zC,function(t,i,s){var n=i.toLowerCase();for(s=YC(s),n=="m"&&s.length>2&&(e.push([i].concat(s.splice(0,2))),n="l",i=i=="m"?"l":"L");;){if(s.length==xb[n])return s.unshift(i),e.push(s);if(s.length<xb[n])throw new Error("malformed path data");e.push([i].concat(s.splice(0,xb[n])));}}),e}var XC=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function YC(r){var e=r.match(XC);return e?e.map(Number):[]}});function Xd(r,e){let t=(0, CT.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:R(`Unknown SVG path command: ${l}`);}l!=="Z"&&l!=="z"&&s===null&&(s={startX:n,startY:o},i.push(s));}return e}var CT,_b=p(()=>{CT=Wg(AT());ne();});var Go,bb=p(()=>{Ue();Go=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 V),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 Uo,yb=p(()=>{Ue();Uo=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,f=e-this.x,g=t-this.y,_=f*f/(l*l)+g*g/(c*c),x=f*f/(h*h)+g*g/(d*d);return _>1&&x<=1}getBounds(e){return e||(e=new V),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 Di(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 f,g;d<0?(f=t,g=i):d>1?(f=s,g=n):(f=t+d*u,g=i+d*l);let _=r-f,x=e-g;return _*_+x*x}var Yd=p(()=>{});var $C,jC,Fi,vb=p(()=>{re();Yd();Ue();Fi=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($C),i=e.getBounds(jC);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],f=u[(c+2)%u.length],g=u[(c+3)%u.length],_=Di(e,t,h,d,f,g),x=Math.sign((f-h)*(t-d)-(g-d)*(e-h));if(_<=(x<0?a:o))return true}return false}getBounds(e){e||(e=new V);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 w("8.11.0","Polygon.lastX is deprecated, please use Polygon.lastX instead."),this.points[this.points.length-2]}get y(){return w("8.11.0","Polygon.y is deprecated, please use Polygon.lastY instead."),this.points[this.points.length-1]}get startX(){return this.points[0]}get startY(){return this.points[1]}};});var $d,Io,Tb=p(()=>{Ue();$d=(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},Io=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 V),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,f=o+l,g=a-l*2,_=u-l*2,x=n+a,b=o+u;return (e>=n-c&&e<=n+h||e>=x-h&&e<=x+c)&&t>=f&&t<=f+_||(t>=o-c&&t<=o+h||t>=b-h&&t<=b+c)&&e>=d&&e<=d+g?true:e<d&&t<f&&$d(e,t,d,f,l,h,c)||e>x-l&&t<f&&$d(e,t,x-l,f,l,h,c)||e>x-l&&t>b-l&&$d(e,t,x-l,b-l,l,h,c)||e<d&&t>b-l&&$d(e,t,d,b-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 ko(r,e,t,i,s,n,o,a,u,l){let h=Math.min(.99,Math.max(0,l??Ri.defaultOptions.bezierSmoothness)),d=(KC-h)/1;return d*=d,ZC(e,t,i,s,n,o,a,u,r,d),r}function ZC(r,e,t,i,s,n,o,a,u,l){Eb(r,e,t,i,s,n,o,a,u,l,0),u.push(o,a);}function Eb(r,e,t,i,s,n,o,a,u,l,c){if(c>qC)return;let h=Math.PI,d=(r+t)/2,f=(e+i)/2,g=(t+s)/2,_=(i+n)/2,x=(s+o)/2,b=(n+a)/2,y=(d+g)/2,v=(f+_)/2,T=(g+x)/2,B=(_+b)/2,E=(y+T)/2,C=(v+B)/2;if(c>0){let k=o-r,M=a-e,I=Math.abs((t-o)*M-(i-a)*k),D=Math.abs((s-o)*M-(n-a)*k),z,se;if(I>jd&&D>jd){if((I+D)*(I+D)<=l*(k*k+M*M)){if(Oo<Sb){u.push(E,C);return}let de=Math.atan2(n-i,s-t);if(z=Math.abs(de-Math.atan2(i-e,t-r)),se=Math.abs(Math.atan2(a-n,o-s)-de),z>=h&&(z=2*h-z),se>=h&&(se=2*h-se),z+se<Oo){u.push(E,C);return}if(ks!==0){if(z>ks){u.push(t,i);return}if(se>ks){u.push(s,n);return}}}}else if(I>jd){if(I*I<=l*(k*k+M*M)){if(Oo<Sb){u.push(E,C);return}if(z=Math.abs(Math.atan2(n-i,s-t)-Math.atan2(i-e,t-r)),z>=h&&(z=2*h-z),z<Oo){u.push(t,i),u.push(s,n);return}if(ks!==0&&z>ks){u.push(t,i);return}}}else if(D>jd){if(D*D<=l*(k*k+M*M)){if(Oo<Sb){u.push(E,C);return}if(z=Math.abs(Math.atan2(a-n,o-s)-Math.atan2(n-i,s-t)),z>=h&&(z=2*h-z),z<Oo){u.push(t,i),u.push(s,n);return}if(ks!==0&&z>ks){u.push(s,n);return}}}else if(k=E-(r+o)/2,M=C-(e+a)/2,k*k+M*M<=l){u.push(E,C);return}}Eb(r,e,d,f,y,v,E,C,u,l,c+1),Eb(E,C,T,B,x,b,o,a,u,l,c+1);}var qC,jd,KC,Sb,Oo,ks,qd=p(()=>{ju();qC=8,jd=11920929e-14,KC=1,Sb=.01,Oo=0,ks=0;});function Kd(r,e,t,i,s,n,o,a){let l=Math.min(.99,Math.max(0,a??Ri.defaultOptions.bezierSmoothness)),c=(ew-l)/1;return c*=c,rw(e,t,i,s,n,o,r,c),r}function rw(r,e,t,i,s,n,o,a){Ab(o,r,e,t,i,s,n,a,0),o.push(s,n);}function Ab(r,e,t,i,s,n,o,a,u){if(u>QC)return;let l=Math.PI,c=(e+i)/2,h=(t+s)/2,d=(i+n)/2,f=(s+o)/2,g=(c+d)/2,_=(h+f)/2,x=n-e,b=o-t,y=Math.abs((i-n)*b-(s-o)*x);if(y>JC){if(y*y<=a*(x*x+b*b)){if(wT<tw){r.push(g,_);return}let v=Math.abs(Math.atan2(o-s,n-i)-Math.atan2(s-t,i-e));if(v>=l&&(v=2*l-v),v<wT){r.push(g,_);return}}}else if(x=g-(e+n)/2,b=_-(t+o)/2,x*x+b*b<=a){r.push(g,_);return}Ab(r,e,t,c,h,g,_,a,u+1),Ab(r,g,_,d,f,n,o,a,u+1);}var QC,JC,ew,tw,wT,Cb=p(()=>{ju();QC=8,JC=11920929e-14,ew=1,tw=.01,wT=0;});function Lo(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),f=Math.sin(c),g=e+d*i,_=t+f*i;r.push(g,_),c+=l;}}var Zd=p(()=>{});function Qd(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 f=u*u+l*l,g=c*c+h*h,_=u*c+l*h,x=n*Math.sqrt(f)/d,b=n*Math.sqrt(g)/d,y=x*_/f,v=b*_/g,T=x*h+b*l,B=x*c+b*u,E=l*(b+y),C=u*(b+y),k=h*(x+v),M=c*(x+v),I=Math.atan2(C-B,E-T),D=Math.atan2(M-B,k-T);Lo(r,T+e,B+t,n,I,D,l*c>h*u);}var wb=p(()=>{Zd();});function iw(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 Jd(r,e,t,i,s,n,o,a=0,u=0,l=0){if(n===0||o===0)return;let c=Math.sin(a*el/360),h=Math.cos(a*el/360),d=h*(e-i)/2+c*(t-s)/2,f=-c*(e-i)/2+h*(t-s)/2;if(d===0&&f===0)return;n=Math.abs(n),o=Math.abs(o);let g=Math.pow(d,2)/Math.pow(n,2)+Math.pow(f,2)/Math.pow(o,2);g>1&&(n*=Math.sqrt(g),o*=Math.sqrt(g)),sw(e,t,i,s,n,o,u,l,c,h,d,f,Pb);let{ang1:_,ang2:x}=Pb,{centerX:b,centerY:y}=Pb,v=Math.abs(x)/(el/4);Math.abs(1-v)<1e-7&&(v=1);let T=Math.max(Math.ceil(v),1);x/=T;let B=r[r.length-2],E=r[r.length-1],C={x:0,y:0};for(let k=0;k<T;k++){let M=iw(_,x),{x:I,y:D}=Bb(M[0],n,o,h,c,b,y,C),{x:z,y:se}=Bb(M[1],n,o,h,c,b,y,C),{x:de,y:Br}=Bb(M[2],n,o,h,c,b,y,C);ko(r,B,E,I,D,z,se,de,Br),B=de,E=Br,_+=x;}}var el,Pb,Bb,PT,sw,Rb=p(()=>{qd();el=Math.PI*2,Pb={centerX:0,centerY:0,ang1:0,ang2:0},Bb=({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};PT=(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)},sw=(r,e,t,i,s,n,o,a,u,l,c,h,d)=>{let f=Math.pow(s,2),g=Math.pow(n,2),_=Math.pow(c,2),x=Math.pow(h,2),b=f*g-f*x-g*_;b<0&&(b=0),b/=f*x+g*_,b=Math.sqrt(b)*(o===a?-1:1);let y=b*s/n*h,v=b*-n/s*c,T=l*y-u*v+(r+t)/2,B=u*y+l*v+(e+i)/2,E=(c-y)/s,C=(h-v)/n,k=(-c-y)/s,M=(-h-v)/n,I=PT(1,0,E,C),D=PT(E,C,k,M);a===0&&D>0&&(D-=el),a===1&&D<0&&(D+=el),d.centerX=T,d.centerY=B,d.ang1=I,d.ang2=D;};});function ef(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),f=1,g=false;c.nx*h.nx-c.ny*-h.ny<0?d<0?d=Math.PI+d:(d=Math.PI-d,f=-1,g=true):d>0&&(f=-1,g=true);let _=d/2,x,b=Math.abs(Math.cos(_)*u/Math.sin(_));b>Math.min(c.len/2,h.len/2)?(b=Math.min(c.len/2,h.len/2),x=Math.abs(b*Math.sin(_)/Math.cos(_))):x=u;let y=a.x+h.nx*b+-h.ny*x*f,v=a.y+h.ny*b+h.nx*x*f,T=Math.atan2(c.ny,c.nx)+Math.PI/2*f,B=Math.atan2(h.ny,h.nx)-Math.PI/2*f;o===0&&r.moveTo(y+Math.cos(T)*x,v+Math.sin(T)*x),r.arc(y,v,x,T,B,g),n=a;}}function tf(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),f;if(d<1e-4)f=u;else {let x=Math.min(d/2,l);f=n(u,c,x/d);}let g=s(h,u),_;if(g<1e-4)_=u;else {let x=Math.min(g/2,l);_=n(u,h,x/g);}a===0?r.moveTo(f.x,f.y):r.lineTo(f.x,f.y),r.quadraticCurveTo(u.x,u.y,_.x,_.y,i);}}var Mb=p(()=>{});var nw,No,Db=p(()=>{bb();yb();vb();Ue();Tb();Ze();qd();Cb();Zd();wb();Rb();Mb();nw=new V,No=class{constructor(e){this.shapePrimitives=[],this._currentPoly=null,this._bounds=new oe,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 Lo(a,e,t,i,s,n,o),this}arcTo(e,t,i,s,n){this._ensurePoly();let o=this._currentPoly.points;return Qd(o,e,t,i,s,n),this}arcToSvg(e,t,i,s,n,o,a){let u=this._currentPoly.points;return Jd(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 ko(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 Kd(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 V(e,t,i,s),n),this}circle(e,t,i,s){return this.drawShape(new Go(e,t,i),s),this}poly(e,t,i){let s=new Fi(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 f=d*c+l,g=e+i*Math.cos(f),_=t+i*Math.sin(f),x=f+Math.PI+h,b=f-Math.PI-h,y=g+n*Math.cos(x),v=_+n*Math.sin(x),T=g+n*Math.cos(b),B=_+n*Math.sin(b);d===0?this.moveTo(y,v):this.lineTo(y,v),this.quadraticCurveTo(g,_,T,B,a);}return this.closePath()}roundShape(e,t,i=false,s){return e.length<3?this:(i?tf(this,e,t,s):ef(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 Uo(e,t,i,s),n),this}roundRect(e,t,i,s,n,o){return this.drawShape(new Io(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 Fi,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 Fi,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(nw);s.transform?e.addRect(n,s.transform):e.addRect(n);}return e}};});function tl(r,e){return r?r.prepend(e):e.clone()}var ct,Ho=p(()=>{vt();Ge();ne();_b();Db();ct=class r{constructor(e,t=false){this.instructions=[],this.uid=W("graphicsPath"),this._dirty=true,this.checkForHoles=t,typeof e=="string"?Xd(e,this):this.instructions=e?.slice()??[];}get shapePath(){return this._shapePath||(this._shapePath=new No(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(q.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(q.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 f=d%2?n:s,g=d*c+u;h.push(e+f*Math.cos(g),t+f*Math.sin(g));}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,f=0,g=0,_=0;for(let x=0;x<this.instructions.length;x++){let b=this.instructions[x],y=b.data;switch(b.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],f=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*f+o,y[3]=i*d+n*f+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],g=y[0],_=y[1],y[0]=t*g+s*_,y[1]=i*g+n*_,y[5]=t*u+s*l+o,y[6]=i*u+n*l+a;break;case "circle":y[4]=tl(y[3],e);break;case "rect":y[4]=tl(y[4],e);break;case "ellipse":y[8]=tl(y[8],e);break;case "roundRect":y[5]=tl(y[5],e);break;case "addPath":y[0].transform(e);break;case "poly":y[2]=tl(y[2],e);break;default:R("unknown transform action",b.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 ve(r,e,t){let i=r.getAttribute(e);return i?Number(i):t}var rf=p(()=>{});function sf(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]=ow(o);break;case "radialgradient":e.defs[o.id]=aw();break;}}}}function ow(r){let e=ve(r,"x1",0),t=ve(r,"y1",0),i=ve(r,"x2",1),s=ve(r,"y2",0),n=r.getAttribute("gradientUnits")||"objectBoundingBox",o=new lt(e,t,i,s,n==="objectBoundingBox"?"local":"global");for(let a=0;a<r.children.length;a++){let u=r.children[a],l=ve(u,"offset",0),c=H.shared.setValue(u.getAttribute("stop-color")).toNumber();o.addColorStop(l,c);}return o}function aw(r){return R("[SVG Parser] Radial gradients are not yet supported"),new lt(0,0,1,0)}var Fb=p(()=>{Ne();ne();Rs();rf();});function rl(r){let e=r.match(/url\s*\(\s*['"]?\s*#([^'"\s)]+)\s*['"]?\s*\)/i);return e?e[1]:""}var Gb=p(()=>{});function il(r,e){let t=r.getAttribute("style"),i={},s={},n={strokeStyle:i,fillStyle:s,useFill:false,useStroke:false};for(let o in nf){let a=r.getAttribute(o);a&&BT(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(":");nf[l]&&BT(e,n,l,c.trim());}}return {strokeStyle:n.useStroke?i:null,fillStyle:n.useFill?s:null,useFill:n.useFill,useStroke:n.useStroke}}function BT(r,e,t,i){switch(t){case "stroke":if(i!=="none"){if(i.startsWith("url(")){let s=rl(i);e.strokeStyle.fill=r.defs[s];}else e.strokeStyle.color=H.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=rl(i);e.fillStyle.fill=r.defs[s];}else e.fillStyle.color=H.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 nf,Ub=p(()=>{Ne();Gb();nf={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 of(r){if(r.length<=2)return true;let e=r.map(a=>a.area).sort((a,u)=>u-a),[t,i]=e,s=e[e.length-1],n=t/i,o=i/s;return !(n>3&&o<2)}function RT(r,e=0){let t=r.instructions[e];if(!t||t.action!=="fill")throw new Error(`Expected fill instruction at index ${e}, got ${t?.action||"undefined"}`);return t.data}var Ib=p(()=>{});function af(r){return r.split(/(?=[Mm])/).filter(i=>i.trim().length>0)}function uf(r){let e=r.match(/[-+]?[0-9]*\.?[0-9]+/g);if(!e||e.length<4)return 0;let t=e.map(Number),i=[],s=[];for(let c=0;c<t.length;c+=2)c+1<t.length&&(i.push(t[c]),s.push(t[c+1]));if(i.length===0||s.length===0)return 0;let n=Math.min(...i),o=Math.max(...i),a=Math.min(...s),u=Math.max(...s);return (o-n)*(u-a)}function sl(r,e){let t=new ct(r,false);for(let i of t.instructions)e.instructions.push(i);}var Ob=p(()=>{Ho();});function lf(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 ct};sf(r,t);let i=r.children,{fillStyle:s,strokeStyle:n}=il(r,t);for(let o=0;o<i.length;o++){let a=i[o];a.nodeName.toLowerCase()!=="defs"&&MT(a,t,s,n);}return e}function MT(r,e,t,i){let s=r.children,{fillStyle:n,strokeStyle:o}=il(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,f,g,_,x,b,y,v,T,B,E,C,k;switch(r.nodeName.toLowerCase()){case "path":{B=r.getAttribute("d");let M=r.getAttribute("fill-rule"),I=af(B),D=M==="evenodd",z=I.length>1;if(D&&z){let de=I.map(F=>({path:F,area:uf(F)}));if(de.sort((F,L)=>L.area-F.area),I.length>3||!of(de))for(let F=0;F<de.length;F++){let L=de[F],is=F===0;e.context.beginPath();let ue=new ct(void 0,true);sl(L.path,ue),e.context.path(ue),is?(t&&e.context.fill(t),i&&e.context.stroke(i)):e.context.cut();}else for(let F=0;F<de.length;F++){let L=de[F],is=F%2===1;e.context.beginPath();let ue=new ct(void 0,true);sl(L.path,ue),e.context.path(ue),is?e.context.cut():(t&&e.context.fill(t),i&&e.context.stroke(i));}}else {let de=M?M==="evenodd":true;E=new ct(B,de),e.context.path(E),t&&e.context.fill(t),i&&e.context.stroke(i);}break}case "circle":g=ve(r,"cx",0),_=ve(r,"cy",0),x=ve(r,"r",0),e.context.ellipse(g,_,x,x),t&&e.context.fill(t),i&&e.context.stroke(i);break;case "rect":u=ve(r,"x",0),l=ve(r,"y",0),C=ve(r,"width",0),k=ve(r,"height",0),b=ve(r,"rx",0),y=ve(r,"ry",0),b||y?e.context.roundRect(u,l,C,k,b||y):e.context.rect(u,l,C,k),t&&e.context.fill(t),i&&e.context.stroke(i);break;case "ellipse":g=ve(r,"cx",0),_=ve(r,"cy",0),b=ve(r,"rx",0),y=ve(r,"ry",0),e.context.beginPath(),e.context.ellipse(g,_,b,y),t&&e.context.fill(t),i&&e.context.stroke(i);break;case "line":c=ve(r,"x1",0),h=ve(r,"y1",0),d=ve(r,"x2",0),f=ve(r,"y2",0),e.context.beginPath(),e.context.moveTo(c,h),e.context.lineTo(d,f),i&&e.context.stroke(i);break;case "polygon":T=r.getAttribute("points"),v=T.match(/-?\d+/g).map(M=>parseInt(M,10)),e.context.poly(v,true),t&&e.context.fill(t),i&&e.context.stroke(i);break;case "polyline":T=r.getAttribute("points"),v=T.match(/-?\d+/g).map(M=>parseInt(M,10)),e.context.poly(v,false),i&&e.context.stroke(i);break;case "g":case "svg":break;default:{R(`[SVG parser] <${r.nodeName}> elements unsupported`);break}}a&&(t=null);for(let M=0;M<s.length;M++)MT(s[M],e,t,i);}var kb=p(()=>{ne();Ho();Fb();rf();Ub();Ib();Ob();});function uw(r){return H.isColorLike(r)}function DT(r){return r instanceof ir}function FT(r){return r instanceof lt}function lw(r){return r instanceof A}function cw(r,e,t){let i=H.shared.setValue(e??0);return r.color=i.toNumber(),r.alpha=i.alpha===1?t.alpha:i.alpha,r.texture=A.WHITE,{...t,...r}}function hw(r,e,t){return r.texture=e,{...t,...r}}function GT(r,e,t){return r.fill=e,r.color=16777215,r.texture=e.texture,r.matrix=e.transform,{...t,...r}}function UT(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 dw(r,e){let t={...e,...r},i=H.shared.setValue(t.color);return t.alpha*=i.alpha,t.color=i.toNumber(),t}function sr(r,e){if(r==null)return null;let t={},i=r;return uw(r)?cw(t,r,e):lw(r)?hw(t,r,e):DT(r)?GT(t,r,e):FT(r)?UT(t,r,e):i.fill&&DT(i.fill)?GT(i,i.fill,e):i.fill&&FT(i.fill)?UT(i,i.fill,e):dw(i,e)}function Gi(r,e){let{width:t,alignment:i,miterLimit:s,cap:n,join:o,pixelLine:a,...u}=e,l=sr(r,u);return l?{width:t,alignment:i,miterLimit:s,cap:n,join:o,pixelLine:a,...l}:null}var cf=p(()=>{Ne();ee();Rs();Ju();});var fw,IT,Lb,ke,Ls=p(()=>{Ke();Ne();K();vt();ee();Ge();re();Ze();Ho();kb();cf();fw=new q,IT=new P,Lb=class xr extends fe{constructor(){super(...arguments),this._gpuData=Object.create(null),this.autoGarbageCollect=true,this._gcLastUsed=-1,this.uid=W("graphicsContext"),this.dirty=true,this.batchMode="auto",this.instructions=[],this.destroyed=false,this._activePath=new ct,this._transform=new P,this._fillStyle={...xr.defaultFillStyle},this._strokeStyle={...xr.defaultStrokeStyle},this._stateStack=[],this._tick=0,this._bounds=new oe,this._boundsDirty=true;}clone(){let e=new xr;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=sr(e,xr.defaultFillStyle);}get strokeStyle(){return this._strokeStyle}set strokeStyle(e){this._strokeStyle=Gi(e,xr.defaultStrokeStyle);}setFillStyle(e){return this._fillStyle=sr(e,xr.defaultFillStyle),this}setStrokeStyle(e){return this._strokeStyle=sr(e,xr.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?H.shared.setValue(t).toNumber():16777215}}),this.onUpdate(),this}beginPath(){return this._activePath=new ct,this}fill(e,t){let i,s=this.instructions[this.instructions.length-1];return this._tick===0&&s?.action==="stroke"?i=s.data.path:i=this._activePath.clone(),i?(e!=null&&(t!==void 0&&typeof e=="number"&&(w(O,"GraphicsContext.fill(color, alpha) is deprecated, use GraphicsContext.fill({ color, alpha }) instead"),e={color:e,alpha:t}),this._fillStyle=sr(e,xr.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(q.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?.action==="fill"?t=i.data.path:t=this._activePath.clone(),t?(e!=null&&(this._strokeStyle=Gi(e,xr.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++,lf(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 P?(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 P?(this._transform.append(e),this):(IT.set(e,t,i,s,n,o),this._transform.append(IT),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._boundsDirty=true,!this.dirty&&(this.emit("update",this,16),this.dirty=true);}get bounds(){if(!this._boundsDirty)return this._bounds;this._boundsDirty=false;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,f=d?d.applyInverse(e,fw):e;if(n.action==="fill")i=h.contains(f.x,f.y);else {let _=u;i=h.strokeContains(f.x,f.y,_.width,_.alignment);}let g=o.hole;if(g){let _=g.shapePath?.shapePrimitives;if(_)for(let x=0;x<_.length;x++)_[x].shape.contains(f.x,f.y)&&(i=false);}if(i)return true}}return i}unload(){this.emit("unload",this);for(let e in this._gpuData)this._gpuData[e]?.destroy();this._gpuData=Object.create(null);}destroy(e=false){if(this.destroyed)return;if(this.destroyed=true,this._stateStack.length=0,this._transform=null,this.unload(),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.fill&&"uid"in this._fillStyle.fill?this._fillStyle.fill.destroy():this._fillStyle.texture.destroy(i)),this._strokeStyle.texture&&(this._strokeStyle.fill&&"uid"in this._strokeStyle.fill?this._strokeStyle.fill.destroy():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;}};Lb.defaultFillStyle={color:16777215,alpha:1,texture:A.WHITE,matrix:null,fill:null,textureSpace:"local"};Lb.defaultStrokeStyle={width:1,color:16777215,alpha:1,alignment:.5,miterLimit:10,cap:"butt",join:"miter",texture:A.WHITE,matrix:null,fill:null,textureSpace:"local",pixelLine:false};ke=Lb;});function pw(r){let e=r;if(typeof e.dropShadow=="boolean"&&e.dropShadow){let t=Re.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){w(O,"strokeThickness is now a part of stroke");let t=e.stroke,i={};if(H.isColorLike(t))i.color=t;else if(t instanceof lt||t instanceof ir)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)){if(w(O,"gradient fill is now a fill pattern: `new FillGradient(...)`"),!Array.isArray(e.fill)||e.fill.length===0)throw new Error("Invalid fill value. Expected an array of colors for gradient fill.");e.fill.length!==e.fillGradientStops.length&&R("The number of fill colors must match the number of fill gradient stops.");let t=new lt({start:{x:0,y:0},end:{x:0,y:1},textureSpace:"local"}),i=e.fillGradientStops.slice(),s=e.fill.map(n=>H.shared.setValue(n).toNumber());i.forEach((n,o)=>{t.addColorStop(n,s[o]);}),r.fill={fill:t};}}var Nb,Re,nr=p(()=>{Ke();Ne();Ge();re();ne();Rs();Ju();Ls();cf();Nb=class Vo extends fe{constructor(e={}){super(),this.uid=W("textStyle"),this._tick=0,pw(e);let t={...Vo.defaultTextStyle,...e};for(let i in t){let s=i;this[s]=t[i];}this.update(),this._tick=0;}get align(){return this._align}set align(e){this._align!==e&&(this._align=e,this.update());}get breakWords(){return this._breakWords}set breakWords(e){this._breakWords!==e&&(this._breakWords=e,this.update());}get dropShadow(){return this._dropShadow}set dropShadow(e){this._dropShadow!==e&&(e!==null&&typeof e=="object"?this._dropShadow=this._createProxy({...Vo.defaultDropShadow,...e}):this._dropShadow=e?this._createProxy({...Vo.defaultDropShadow}):null,this.update());}get fontFamily(){return this._fontFamily}set fontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.update());}get fontSize(){return this._fontSize}set fontSize(e){this._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&&(this._fontStyle=e.toLowerCase(),this.update());}get fontVariant(){return this._fontVariant}set fontVariant(e){this._fontVariant!==e&&(this._fontVariant=e,this.update());}get fontWeight(){return this._fontWeight}set fontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.update());}get leading(){return this._leading}set leading(e){this._leading!==e&&(this._leading=e,this.update());}get letterSpacing(){return this._letterSpacing}set letterSpacing(e){this._letterSpacing!==e&&(this._letterSpacing=e,this.update());}get lineHeight(){return this._lineHeight}set lineHeight(e){this._lineHeight!==e&&(this._lineHeight=e,this.update());}get padding(){return this._padding}set padding(e){this._padding!==e&&(this._padding=e,this.update());}get filters(){return this._filters}set filters(e){this._filters!==e&&(this._filters=Object.freeze(e),this.update());}get trim(){return this._trim}set trim(e){this._trim!==e&&(this._trim=e,this.update());}get textBaseline(){return this._textBaseline}set textBaseline(e){this._textBaseline!==e&&(this._textBaseline=e,this.update());}get whiteSpace(){return this._whiteSpace}set whiteSpace(e){this._whiteSpace!==e&&(this._whiteSpace=e,this.update());}get wordWrap(){return this._wordWrap}set wordWrap(e){this._wordWrap!==e&&(this._wordWrap=e,this.update());}get wordWrapWidth(){return this._wordWrapWidth}set wordWrapWidth(e){this._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({...ke.defaultFillStyle,...e},()=>{this._fill=sr({...this._originalFill},ke.defaultFillStyle);})),this._fill=sr(e===0?"black":e,ke.defaultFillStyle),this.update());}get stroke(){return this._originalStroke}set stroke(e){e!==this._originalStroke&&(this._originalStroke=e,this._isFillStyle(e)&&(this._originalStroke=this._createProxy({...ke.defaultStrokeStyle,...e},()=>{this._stroke=Gi({...this._originalStroke},ke.defaultStrokeStyle);})),this._stroke=Gi(e,ke.defaultStrokeStyle),this.update());}update(){this._tick++,this.emit("update",this);}reset(){let e=Vo.defaultTextStyle;for(let t in e)this[t]=e[t];}get styleKey(){return `${this.uid}-${this._tick}`}clone(){return new Vo({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||(i[s]=n,t?.(s,n),this.update()),true)})}_isFillStyle(e){return (e??null)!==null&&!(H.isColorLike(e)||e instanceof lt||e instanceof ir)}};Nb.defaultDropShadow={alpha:1,angle:Math.PI/6,blur:0,color:"black",distance:5};Nb.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};Re=Nb;});function zo(r,e,t,i){let s=mw;s.minX=0,s.minY=0,s.maxX=r.width/i|0,s.maxY=r.height/i|0;let n=le.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 mw,hf=p(()=>{Zt();Ze();mw=new oe;});var nl,ht,Ns=p(()=>{ae();so();ti();nl=class{constructor(e){this._canvasPool=Object.create(null),this.canvasOptions=e||{},this.enableFullScreen=false;}_createCanvasAndContext(e,t){let i=U.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=Kt(e),t=Kt(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.resetTransform(),e.context.clearRect(0,0,i,s),this._canvasPool[n].push(e);}clear(){this._canvasPool={};}},ht=new nl;Tt.register(ht);});function gw(r,e){Hs||(Hs=U.get().createCanvas(256,128),zr=Hs.getContext("2d",{willReadFrequently:true}),zr.globalCompositeOperation="copy",zr.globalAlpha=1),(Hs.width<r||Hs.height<e)&&(Hs.width=Kt(r),Hs.height=Kt(e));}function OT(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 kT(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 df(...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(gw(s,n),!zr)throw new TypeError("Failed to get canvas 2D context");zr.drawImage(t,0,0,s,n,0,0,s*i,n*i);let u=zr.getImageData(0,0,s,n).data,l=0,c=0,h=s-1,d=n-1;for(;c<n&&OT(u,s,c);)++c;if(c===n)return V.EMPTY;for(;OT(u,s,d);)--d;for(;kT(u,s,l,c,d);)++l;for(;kT(u,s,h,c,d);)--h;return ++h,++d,zr.globalCompositeOperation="source-over",zr.strokeRect(l,c,h-l,d-c),zr.globalCompositeOperation="copy",o??(o=new V),o.set(l/i,c/i,(h-l)/i,(d-c)/i),o}var Hs,zr,Hb=p(()=>{ae();so();Ue();Hs=null,zr=null;});function ff(r=1e3,e=0,t=false){if(isNaN(r)||r<0)throw new TypeError("Invalid max value");if(isNaN(e)||e<0)throw new TypeError("Invalid ttl value");if(typeof t!="boolean")throw new TypeError("Invalid resetTtl value");return new Vb(r,e,t)}var Vb,zb=p(()=>{Vb=class{constructor(e=0,t=0,i=false){this.first=null,this.items=Object.create(null),this.last=null,this.max=e,this.resetTtl=i,this.size=0,this.ttl=t;}clear(){return this.first=null,this.items=Object.create(null),this.last=null,this.size=0,this}delete(e){if(this.has(e)){let t=this.items[e];delete this.items[e],this.size--,t.prev!==null&&(t.prev.next=t.next),t.next!==null&&(t.next.prev=t.prev),this.first===t&&(this.first=t.next),this.last===t&&(this.last=t.prev);}return this}entries(e=this.keys()){let t=new Array(e.length);for(let i=0;i<e.length;i++){let s=e[i];t[i]=[s,this.get(s)];}return t}evict(e=false){if(e||this.size>0){let t=this.first;delete this.items[t.key],--this.size===0?(this.first=null,this.last=null):(this.first=t.next,this.first.prev=null);}return this}expiresAt(e){let t;return this.has(e)&&(t=this.items[e].expiry),t}get(e){let t=this.items[e];if(t!==void 0){if(this.ttl>0&&t.expiry<=Date.now()){this.delete(e);return}return this.moveToEnd(t),t.value}}has(e){return e in this.items}moveToEnd(e){this.last!==e&&(e.prev!==null&&(e.prev.next=e.next),e.next!==null&&(e.next.prev=e.prev),this.first===e&&(this.first=e.next),e.prev=this.last,e.next=null,this.last!==null&&(this.last.next=e),this.last=e,this.first===null&&(this.first=e));}keys(){let e=new Array(this.size),t=this.first,i=0;for(;t!==null;)e[i++]=t.key,t=t.next;return e}setWithEvicted(e,t,i=this.resetTtl){let s=null;if(this.has(e))this.set(e,t,true,i);else {this.max>0&&this.size===this.max&&(s={...this.first},this.evict(true));let n=this.items[e]={expiry:this.ttl>0?Date.now()+this.ttl:this.ttl,key:e,prev:this.last,next:null,value:t};++this.size===1?this.first=n:this.last.next=n,this.last=n;}return s}set(e,t,i=false,s=this.resetTtl){let n=this.items[e];return i||n!==void 0?(n.value=t,i===false&&s&&(n.expiry=this.ttl>0?Date.now()+this.ttl:this.ttl),this.moveToEnd(n)):(this.max>0&&this.size===this.max&&this.evict(true),n=this.items[e]={expiry:this.ttl>0?Date.now()+this.ttl:this.ttl,key:e,prev:this.last,next:null,value:t},++this.size===1?this.first=n:this.last.next=n,this.last=n),this}values(e=this.keys()){let t=new Array(e.length);for(let i=0;i<e.length;i++)t[i]=this.get(e[i]);return t}};});function Wr(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)&&!xw.includes(s)&&(s=`"${s}"`),t[i]=s;}return `${r.fontStyle} ${r.fontVariant} ${r.fontWeight} ${e} ${t.join(",")}`}var xw,ol=p(()=>{xw=["serif","sans-serif","monospace","cursive","fantasy","system-ui"];});var Wb,or,Ce,Xr=p(()=>{zb();ae();ol();Wb={willReadFrequently:true},or=class N{static get experimentalLetterSpacingSupported(){let e=N._experimentalLetterSpacingSupported;if(e===void 0){let t=U.get().getCanvasRenderingContext2D().prototype;e=N._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=N._canvas,s=t.wordWrap){let n=`${e}-${t.styleKey}-wordWrap-${s}`;if(N._measurementCache.has(n))return N._measurementCache.get(n);let o=Wr(t),a=N.measureFont(o);a.fontSize===0&&(a.fontSize=t.fontSize,a.ascent=t.fontSize);let u=N.__context;u.font=o;let c=(s?N._wordWrap(e,t,i):e).split(/(?:\r\n|\r|\n)/),h=new Array(c.length),d=0;for(let y=0;y<c.length;y++){let v=N._measureText(c[y],t.letterSpacing,u);h[y]=v,d=Math.max(d,v);}let f=t._stroke?.width||0,g=d+f;t.dropShadow&&(g+=t.dropShadow.distance);let _=t.lineHeight||a.fontSize,x=Math.max(_,a.fontSize+f)+(c.length-1)*(_+t.leading);t.dropShadow&&(x+=t.dropShadow.distance);let b=new N(e,t,g,x,c,h,_+t.leading,d,a);return N._measurementCache.set(n,b),b}static _measureText(e,t,i){let s=false;N.experimentalLetterSpacingSupported&&(N.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=(N.graphemeSegmenter(e).length-1)*t;o+=c,l+=c;}return Math.max(o,l)}static _wordWrap(e,t,i=N._canvas){let s=i.getContext("2d",Wb),n=0,o="",a="",u=Object.create(null),{letterSpacing:l,whiteSpace:c}=t,h=N._collapseSpaces(c),d=N._collapseNewlines(c),f=!h,g=t.wordWrapWidth+l,_=N._tokenize(e);for(let x=0;x<_.length;x++){let b=_[x];if(N._isNewline(b)){if(!d){a+=N._addLine(o),f=!h,o="",n=0;continue}b=" ";}if(h){let v=N.isBreakingSpace(b),T=N.isBreakingSpace(o[o.length-1]);if(v&&T)continue}let y=N._getFromCache(b,l,u,s);if(y>g)if(o!==""&&(a+=N._addLine(o),o="",n=0),N.canBreakWords(b,t.breakWords)){let v=N.wordWrapSplit(b);for(let T=0;T<v.length;T++){let B=v[T],E=B,C=1;for(;v[T+C];){let M=v[T+C];if(!N.canBreakChars(E,M,b,T,t.breakWords))B+=M;else break;E=M,C++;}T+=C-1;let k=N._getFromCache(B,l,u,s);k+n>g&&(a+=N._addLine(o),f=false,o="",n=0),o+=B,n+=k;}}else {o.length>0&&(a+=N._addLine(o),o="",n=0);let v=x===_.length-1;a+=N._addLine(b,!v),f=false,o="",n=0;}else y+n>g&&(f=false,a+=N._addLine(o),o="",n=0),(o.length>0||!N.isBreakingSpace(b)||f)&&(o+=b,n+=y);}return a+=N._addLine(o,false),a}static _addLine(e,t=true){return e=N._trimRight(e),e=t?`${e}
|
|
382
382
|
`:e,e}static _getFromCache(e,t,i,s){let n=i[e];return typeof n!="number"&&(n=N._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(!N.isBreakingSpace(i))break;e=e.slice(0,-1);}return e}static _isNewline(e){return typeof e!="string"?false:N._newlines.includes(e.charCodeAt(0))}static isBreakingSpace(e,t){return typeof e!="string"?false:N._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(N.isBreakingSpace(n,o)||N._isNewline(n)){i!==""&&(t.push(i),i=""),n==="\r"&&o===`
|
|
383
383
|
`?(t.push(`\r
|
|
384
|
-
`),s++):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 N.graphemeSegmenter(e)}static measureFont(e){if(N._fonts[e])return N._fonts[e];let t=N._context;t.font=e;let i=t.measureText(N.METRICS_STRING+N.BASELINE_SYMBOL),s={ascent:i.actualBoundingBoxAscent,descent:i.actualBoundingBoxDescent,fontSize:i.actualBoundingBoxAscent+i.actualBoundingBoxDescent};return N._fonts[e]=s,s}static clearMetrics(e=""){e?delete N._fonts[e]:N._fonts={};}static get _canvas(){if(!N.__canvas){let e;try{let t=new OffscreenCanvas(0,0);if(t.getContext("2d",_x)?.measureText)return N.__canvas=t,t;e=U.get().createCanvas();}catch{e=U.get().createCanvas();}e.width=e.height=10,N.__canvas=e;}return N.__canvas}static get _context(){return N.__context||(N.__context=N._canvas.getContext("2d",_x)),N.__context}};Zt.METRICS_STRING="|\xC9q\xC5";Zt.BASELINE_SYMBOL="M";Zt.BASELINE_MULTIPLIER=1.4;Zt.HEIGHT_MULTIPLIER=2;Zt.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]})();Zt.experimentalLetterSpacing=false;Zt._fonts={};Zt._newlines=[10,13];Zt._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];Zt._measurementCache=Gc(1e3);we=Zt;});function ss(r,e,t,i=0){if(r.texture===C.WHITE&&!r.fill)return H.shared.setValue(r.color).setAlpha(r.alpha??1).toHexa();if(r.fill){if(r.fill instanceof lr){let s=r.fill,n=e.createPattern(s.texture.source.resource,"repeat"),o=s.transform.copyTo(P.shared);return o.scale(s.texture.frame.width,s.texture.frame.height),n.setTransform(o),n}else if(r.fill instanceof ft){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:f,outerRadius:g}=s;l=e.createRadialGradient(h.x*a,h.y*u,d*a,f.x*a,f.y*u,g*a);}if(c&&o&&t){let h=t.lineHeight/u;for(let d=0;d<t.lines.length;d++){let f=(d*t.lineHeight+i/2)/u;s.colorStops.forEach(g=>{let _=f+g.offset*h;l.addColorStop(Math.floor(_*gT)/gT,H.shared.setValue(g.color).toHex());});}}else s.colorStops.forEach(h=>{l.addColorStop(h.offset,H.shared.setValue(h.color).toHex());});return l}}else {let s=e.createPattern(r.texture.source.resource,"repeat"),n=r.matrix.copyTo(P.shared);return n.scale(r.texture.frame.width,r.texture.frame.height),s.setTransform(n),s}return M("FillStyle not recognised",r),"red"}var gT,Uc=p(()=>{ke();K();ee();se();Yi();Ga();gT=1e5;});var xT,bx,ci,Ic=p(()=>{ke();De();rs();mx();Br();Wa();Uc();xT=new V,bx=class{getCanvasAndContext(e){let{text:t,style:i,resolution:s=1}=e,n=i._getFinalPadding(),o=we.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=mt.getOptimalCanvasAndContext(a,u);this._renderTextToCanvas(t,i,n,s,l);let c=i.trim?px({canvas:l.canvas,width:a,height:u,resolution:1,output:xT}):xT.set(0,0,a,u);return {canvasAndContext:l,frame:c}}returnCanvasAndContext(e){mt.returnCanvasAndContext(e);}_renderTextToCanvas(e,t,i,s,n){let{canvas:o,context:a}=n,u=li(t),l=we.measureText(e||" ",t),c=l.lines,h=l.lineHeight,d=l.lineWidths,f=l.maxLineWidth,g=l.fontProperties,_=o.height;if(a.resetTransform(),a.scale(s,s),a.textBaseline=t.textBaseline,t._stroke?.width){let v=t._stroke;a.lineWidth=v.width,a.miterLimit=v.miterLimit,a.lineJoin=v.join,a.lineCap=v.cap;}a.font=u;let x,b,y=t.dropShadow?2:1;for(let v=0;v<y;++v){let T=t.dropShadow&&v===0,B=T?Math.ceil(Math.max(1,_)+i*2):0,E=B*s;if(T){a.fillStyle="black",a.strokeStyle="black";let R=t.dropShadow,I=R.color,D=R.alpha;a.shadowColor=H.shared.setValue(I).setAlpha(D).toRgbaString();let z=R.blur*s,ie=R.distance*s;a.shadowBlur=z,a.shadowOffsetX=Math.cos(R.angle)*ie,a.shadowOffsetY=Math.sin(R.angle)*ie+E;}else {if(a.fillStyle=t._fill?ss(t._fill,a,l,i*2):null,t._stroke?.width){let R=t._stroke.width*.5+i*2;a.strokeStyle=ss(t._stroke,a,l,R);}a.shadowColor="black";}let A=(h-g.fontSize)/2;h-g.fontSize<0&&(A=0);let k=t._stroke?.width??0;for(let R=0;R<c.length;R++)x=k/2,b=k/2+R*h+g.ascent+A,t.align==="right"?x+=f-d[R]:t.align==="center"&&(x+=(f-d[R])/2),t._stroke?.width&&this._drawLetterSpacing(c[R],t,n,x+i,b+i-B,true),t._fill!==void 0&&this._drawLetterSpacing(c[R],t,n,x+i,b+i-B);}}_drawLetterSpacing(e,t,i,s,n,o=false){let{context:a}=i,u=t.letterSpacing,l=false;if(we.experimentalLetterSpacingSupported&&(we.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=we.graphemeSegmenter(e),d=a.measureText(e).width,f=0;for(let g=0;g<h.length;++g){let _=h[g];o?a.strokeText(_,c,n):a.fillText(_,c,n);let x="";for(let b=g+1;b<h.length;++b)x+=h[b];f=a.measureText(x).width,c+=d-f+u,d=f;}}},ci=new bx;});var un,yx=p(()=>{S();Lt();ir();re();Kt();Dc();Ic();un=class{constructor(e){this._activeTextures={},this._renderer=e;}getTexture(e,t,i,s){typeof e=="string"&&(w("8.0.0","CanvasTextSystem.getTexture: Use object TextOptions instead of separate arguments"),e={text:e,style:i,resolution:t}),e.style instanceof Re||(e.style=new Re(e.style)),e.textureStyle instanceof Ge||(e.textureStyle=new Ge(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}=ci.getCanvasAndContext({text:n,style:o,resolution:u}),h=za(c.canvas,l.width,l.height,u);if(a&&(h.source.style=a),o.trim&&(l.pad(o.padding),h.frame.copyFrom(l),h.frame.scale(1/u),h.updateUvs()),o.filters){let d=this._applyFilters(h,o.filters);return this.returnTexture(h),ci.returnCanvasAndContext(c),d}return this._renderer.texture.initSource(h._source),ci.returnCanvasAndContext(c),h}returnTexture(e){let t=e.source;t.resource=null,t.uploadMethodId="unknown",t.alphaMode="no-premultiply-alpha",le.returnTexture(e,true);}renderTextToCanvas(){w("8.10.0","CanvasTextSystem.renderTextToCanvas: no longer supported, use CanvasTextSystem.getTexture instead");}getManagedTexture(e){e._resolution=e._autoResolution?this._renderer.resolution:e.resolution;let t=e.styleKey;if(this._activeTextures[t])return this._increaseReferenceCount(t),this._activeTextures[t].texture;let i=this.getTexture({text:e.text,style:e.style,resolution:e._resolution,textureStyle:e.textureStyle});return this._activeTextures[t]={texture:i,usageCount:1},i}decreaseReferenceCount(e){let t=this._activeTextures[e];t.usageCount--,t.usageCount===0&&(this.returnTexture(t.texture),this._activeTextures[e]=null);}getReferenceCount(e){return this._activeTextures[e]?.usageCount??0}_increaseReferenceCount(e){this._activeTextures[e].usageCount++;}_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;for(let e in this._activeTextures)this._activeTextures[e]&&this.returnTexture(this._activeTextures[e].texture);this._activeTextures=null;}};un.extension={type:[m.WebGLSystem,m.WebGPUSystem,m.CanvasSystem],name:"canvasText"};});var vx=p(()=>{S();Mg();yx();G.add(un);G.add(sn);});var ns,Oc=p(()=>{re();Ht();ts();ns=class r extends Ue{constructor(e){e instanceof Ne&&(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 Ne,this.context.autoGarbageCollect=this.autoGarbageCollect),this.didViewUpdate=true,this.allowChildren=false,this.roundPixels=i??false;}set context(e){e!==this._context&&(this._context&&(this._context.off("update",this.onViewUpdate,this),this._context.off("unload",this.unload,this)),this._context=e,this._context.on("update",this.onViewUpdate,this),this._context.on("unload",this.unload,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);}_onTouch(e){this._gcLastUsed=e,this._context._gcLastUsed=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){w(O,"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){w(O,"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(){w(O,"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!==Ne.defaultStrokeStyle.width||e.color!==Ne.defaultStrokeStyle.color||e.alpha!==Ne.defaultStrokeStyle.alpha)&&this.context.stroke(),this}drawCircle(...e){return w(O,"Graphics#drawCircle has been renamed to Graphics#circle"),this._callContextMethod("circle",e)}drawEllipse(...e){return w(O,"Graphics#drawEllipse has been renamed to Graphics#ellipse"),this._callContextMethod("ellipse",e)}drawPolygon(...e){return w(O,"Graphics#drawPolygon has been renamed to Graphics#poly"),this._callContextMethod("poly",e)}drawRect(...e){return w(O,"Graphics#drawRect has been renamed to Graphics#rect"),this._callContextMethod("rect",e)}drawRoundedRect(...e){return w(O,"Graphics#drawRoundedRect has been renamed to Graphics#roundRect"),this._callContextMethod("roundRect",e)}drawStar(...e){return w(O,"Graphics#drawStar has been renamed to Graphics#star"),this._callContextMethod("star",e)}};});var Tx,Sx,Ex=p(()=>{Tx={name:"local-uniform-msdf-bit",vertex:{header:`
|
|
384
|
+
`),s++):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 N.graphemeSegmenter(e)}static measureFont(e){if(N._fonts[e])return N._fonts[e];let t=N._context;t.font=e;let i=t.measureText(N.METRICS_STRING+N.BASELINE_SYMBOL),s={ascent:i.actualBoundingBoxAscent,descent:i.actualBoundingBoxDescent,fontSize:i.actualBoundingBoxAscent+i.actualBoundingBoxDescent};return N._fonts[e]=s,s}static clearMetrics(e=""){e?delete N._fonts[e]:N._fonts={};}static get _canvas(){if(!N.__canvas){let e;try{let t=new OffscreenCanvas(0,0);if(t.getContext("2d",Wb)?.measureText)return N.__canvas=t,t;e=U.get().createCanvas();}catch{e=U.get().createCanvas();}e.width=e.height=10,N.__canvas=e;}return N.__canvas}static get _context(){return N.__context||(N.__context=N._canvas.getContext("2d",Wb)),N.__context}};or.METRICS_STRING="|\xC9q\xC5";or.BASELINE_SYMBOL="M";or.BASELINE_MULTIPLIER=1.4;or.HEIGHT_MULTIPLIER=2;or.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]})();or.experimentalLetterSpacing=false;or._fonts={};or._newlines=[10,13];or._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];or._measurementCache=ff(1e3);Ce=or;});function Ui(r,e,t,i=0){if(r.texture===A.WHITE&&!r.fill)return H.shared.setValue(r.color).setAlpha(r.alpha??1).toHexa();if(r.fill){if(r.fill instanceof ir){let s=r.fill,n=e.createPattern(s.texture.source.resource,"repeat"),o=s.transform.copyTo(P.shared);return o.scale(s.texture.frame.width,s.texture.frame.height),n.setTransform(o),n}else if(r.fill instanceof lt){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:f,outerRadius:g}=s;l=e.createRadialGradient(h.x*a,h.y*u,d*a,f.x*a,f.y*u,g*a);}if(c&&o&&t){let h=t.lineHeight/u;for(let d=0;d<t.lines.length;d++){let f=(d*t.lineHeight+i/2)/u;s.colorStops.forEach(g=>{let _=f+g.offset*h;l.addColorStop(Math.floor(_*LT)/LT,H.shared.setValue(g.color).toHex());});}}else s.colorStops.forEach(h=>{l.addColorStop(h.offset,H.shared.setValue(h.color).toHex());});return l}}else {let s=e.createPattern(r.texture.source.resource,"repeat"),n=r.matrix.copyTo(P.shared);return n.scale(r.texture.frame.width,r.texture.frame.height),s.setTransform(n),s}return R("FillStyle not recognised",r),"red"}var LT,pf=p(()=>{Ne();K();ee();ne();Rs();Ju();LT=1e5;});var NT,Xb,Yr,mf=p(()=>{Ne();Ue();Ns();Hb();Xr();ol();pf();NT=new V,Xb=class{getCanvasAndContext(e){let{text:t,style:i,resolution:s=1}=e,n=i._getFinalPadding(),o=Ce.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=ht.getOptimalCanvasAndContext(a,u);this._renderTextToCanvas(t,i,n,s,l);let c=i.trim?df({canvas:l.canvas,width:a,height:u,resolution:1,output:NT}):NT.set(0,0,a,u);return {canvasAndContext:l,frame:c}}returnCanvasAndContext(e){ht.returnCanvasAndContext(e);}_renderTextToCanvas(e,t,i,s,n){let{canvas:o,context:a}=n,u=Wr(t),l=Ce.measureText(e||" ",t),c=l.lines,h=l.lineHeight,d=l.lineWidths,f=l.maxLineWidth,g=l.fontProperties,_=o.height;if(a.resetTransform(),a.scale(s,s),a.textBaseline=t.textBaseline,t._stroke?.width){let v=t._stroke;a.lineWidth=v.width,a.miterLimit=v.miterLimit,a.lineJoin=v.join,a.lineCap=v.cap;}a.font=u;let x,b,y=t.dropShadow?2:1;for(let v=0;v<y;++v){let T=t.dropShadow&&v===0,B=T?Math.ceil(Math.max(1,_)+i*2):0,E=B*s;if(T){a.fillStyle="black",a.strokeStyle="black";let M=t.dropShadow,I=M.color,D=M.alpha;a.shadowColor=H.shared.setValue(I).setAlpha(D).toRgbaString();let z=M.blur*s,se=M.distance*s;a.shadowBlur=z,a.shadowOffsetX=Math.cos(M.angle)*se,a.shadowOffsetY=Math.sin(M.angle)*se+E;}else {if(a.fillStyle=t._fill?Ui(t._fill,a,l,i*2):null,t._stroke?.width){let M=t._stroke.width*.5+i*2;a.strokeStyle=Ui(t._stroke,a,l,M);}a.shadowColor="black";}let C=(h-g.fontSize)/2;h-g.fontSize<0&&(C=0);let k=t._stroke?.width??0;for(let M=0;M<c.length;M++)x=k/2,b=k/2+M*h+g.ascent+C,t.align==="right"?x+=f-d[M]:t.align==="center"&&(x+=(f-d[M])/2),t._stroke?.width&&this._drawLetterSpacing(c[M],t,n,x+i,b+i-B,true),t._fill!==void 0&&this._drawLetterSpacing(c[M],t,n,x+i,b+i-B);}}_drawLetterSpacing(e,t,i,s,n,o=false){let{context:a}=i,u=t.letterSpacing,l=false;if(Ce.experimentalLetterSpacingSupported&&(Ce.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=Ce.graphemeSegmenter(e),d=a.measureText(e).width,f=0;for(let g=0;g<h.length;++g){let _=h[g];o?a.strokeText(_,c,n):a.fillText(_,c,n);let x="";for(let b=g+1;b<h.length;++b)x+=h[b];f=a.measureText(x).width,c+=d-f+u,d=f;}}},Yr=new Xb;});var Vs,Yb=p(()=>{S();Zt();dr();re();nr();hf();mf();Vs=class{constructor(e){this._activeTextures={},this._renderer=e;}getTexture(e,t,i,s){typeof e=="string"&&(w("8.0.0","CanvasTextSystem.getTexture: Use object TextOptions instead of separate arguments"),e={text:e,style:i,resolution:t}),e.style instanceof Re||(e.style=new Re(e.style)),e.textureStyle instanceof De||(e.textureStyle=new De(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}=Yr.getCanvasAndContext({text:n,style:o,resolution:u}),h=zo(c.canvas,l.width,l.height,u);if(a&&(h.source.style=a),o.trim&&(l.pad(o.padding),h.frame.copyFrom(l),h.frame.scale(1/u),h.updateUvs()),o.filters){let d=this._applyFilters(h,o.filters);return this.returnTexture(h),Yr.returnCanvasAndContext(c),d}return this._renderer.texture.initSource(h._source),Yr.returnCanvasAndContext(c),h}returnTexture(e){let t=e.source;t.resource=null,t.uploadMethodId="unknown",t.alphaMode="no-premultiply-alpha",le.returnTexture(e,true);}renderTextToCanvas(){w("8.10.0","CanvasTextSystem.renderTextToCanvas: no longer supported, use CanvasTextSystem.getTexture instead");}getManagedTexture(e){e._resolution=e._autoResolution?this._renderer.resolution:e.resolution;let t=e.styleKey;if(this._activeTextures[t])return this._increaseReferenceCount(t),this._activeTextures[t].texture;let i=this.getTexture({text:e.text,style:e.style,resolution:e._resolution,textureStyle:e.textureStyle});return this._activeTextures[t]={texture:i,usageCount:1},i}decreaseReferenceCount(e){let t=this._activeTextures[e];t.usageCount--,t.usageCount===0&&(this.returnTexture(t.texture),this._activeTextures[e]=null);}getReferenceCount(e){return this._activeTextures[e]?.usageCount??0}_increaseReferenceCount(e){this._activeTextures[e].usageCount++;}_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;for(let e in this._activeTextures)this._activeTextures[e]&&this.returnTexture(this._activeTextures[e].texture);this._activeTextures=null;}};Vs.extension={type:[m.WebGLSystem,m.WebGPUSystem,m.CanvasSystem],name:"canvasText"};});var $b=p(()=>{S();gb();Yb();G.add(Vs);G.add(Os);});var Ii,gf=p(()=>{re();Jt();Ls();Ii=class r extends Fe{constructor(e){e instanceof ke&&(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 ke,this.context.autoGarbageCollect=this.autoGarbageCollect),this.didViewUpdate=true,this.allowChildren=false,this.roundPixels=i??false;}set context(e){e!==this._context&&(this._context&&(this._context.off("update",this.onViewUpdate,this),this._context.off("unload",this.unload,this)),this._context=e,this._context.on("update",this.onViewUpdate,this),this._context.on("unload",this.unload,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);}_onTouch(e){this._gcLastUsed=e,this._context._gcLastUsed=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){w(O,"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){w(O,"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(){w(O,"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!==ke.defaultStrokeStyle.width||e.color!==ke.defaultStrokeStyle.color||e.alpha!==ke.defaultStrokeStyle.alpha)&&this.context.stroke(),this}drawCircle(...e){return w(O,"Graphics#drawCircle has been renamed to Graphics#circle"),this._callContextMethod("circle",e)}drawEllipse(...e){return w(O,"Graphics#drawEllipse has been renamed to Graphics#ellipse"),this._callContextMethod("ellipse",e)}drawPolygon(...e){return w(O,"Graphics#drawPolygon has been renamed to Graphics#poly"),this._callContextMethod("poly",e)}drawRect(...e){return w(O,"Graphics#drawRect has been renamed to Graphics#rect"),this._callContextMethod("rect",e)}drawRoundedRect(...e){return w(O,"Graphics#drawRoundedRect has been renamed to Graphics#roundRect"),this._callContextMethod("roundRect",e)}drawStar(...e){return w(O,"Graphics#drawStar has been renamed to Graphics#star"),this._callContextMethod("star",e)}};});var xf,_f,jb=p(()=>{xf={name:"local-uniform-msdf-bit",vertex:{header:`
|
|
385
385
|
struct LocalUniforms {
|
|
386
386
|
uColor:vec4<f32>,
|
|
387
387
|
uTransformMatrix:mat3x3<f32>,
|
|
@@ -408,7 +408,7 @@ fn mainFragment(
|
|
|
408
408
|
@group(2) @binding(0) var<uniform> localUniforms : LocalUniforms;
|
|
409
409
|
`,main:`
|
|
410
410
|
outColor = vec4<f32>(calculateMSDFAlpha(outColor, localUniforms.uColor, localUniforms.uDistance));
|
|
411
|
-
`}},
|
|
411
|
+
`}},_f={name:"local-uniform-msdf-bit",vertex:{header:`
|
|
412
412
|
uniform mat3 uTransformMatrix;
|
|
413
413
|
uniform vec4 uColor;
|
|
414
414
|
uniform float uRound;
|
|
@@ -424,7 +424,7 @@ fn mainFragment(
|
|
|
424
424
|
uniform float uDistance;
|
|
425
425
|
`,main:`
|
|
426
426
|
outColor = vec4(calculateMSDFAlpha(outColor, vColor, uDistance));
|
|
427
|
-
`}};});var
|
|
427
|
+
`}};});var bf,yf,qb=p(()=>{bf={name:"msdf-bit",fragment:{header:`
|
|
428
428
|
fn calculateMSDFAlpha(msdfColor:vec4<f32>, shapeColor:vec4<f32>, distance:f32) -> f32 {
|
|
429
429
|
|
|
430
430
|
// MSDF
|
|
@@ -451,7 +451,7 @@ fn mainFragment(
|
|
|
451
451
|
return coverage;
|
|
452
452
|
|
|
453
453
|
}
|
|
454
|
-
`}},
|
|
454
|
+
`}},yf={name:"msdf-bit",fragment:{header:`
|
|
455
455
|
float calculateMSDFAlpha(vec4 msdfColor, vec4 shapeColor, float distance) {
|
|
456
456
|
|
|
457
457
|
// MSDF
|
|
@@ -478,17 +478,17 @@ fn mainFragment(
|
|
|
478
478
|
|
|
479
479
|
return coverage;
|
|
480
480
|
}
|
|
481
|
-
`}};});var
|
|
482
|
-
`&&b!=="\r"&&b!==" "&&b!==" "&&(f=true,c=Math.ceil(Math.max(
|
|
481
|
+
`}};});var Kb,Zb,Wo,Qb=p(()=>{K();Nr();vo();To();Hr();Nu();Ht();Oe();jb();qb();Wo=class extends Ae{constructor(e){let t=new J({uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uTransformMatrix:{value:new P,type:"mat3x3<f32>"},uDistance:{value:4,type:"f32"},uRound:{value:0,type:"f32"}});Kb??(Kb=Ot({name:"sdf-shader",bits:[Si,Ai(e),xf,bf,Lt]})),Zb??(Zb=kt({name:"sdf-shader",bits:[Ei,Ci(e),_f,yf,Nt]})),super({glProgram:Zb,gpuProgram:Kb,resources:{localUniforms:t,batchSamplers:wi(e)}});}};});var Oi,vf=p(()=>{Ke();re();Oi=class extends fe{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 w(O,"BitmapFont.font is deprecated, please use BitmapFont.fontFamily instead."),this.fontFamily}get pageTextures(){return w(O,"BitmapFont.pageTextures is deprecated, please use BitmapFont.pages instead."),this.pages}get size(){return w(O,"BitmapFont.size is deprecated, please use BitmapFont.fontMetrics.fontSize instead."),this.fontMetrics.fontSize}get distanceFieldRange(){return w(O,"BitmapFont.distanceFieldRange is deprecated, please use BitmapFont.distanceField.range instead."),this.distanceField.range}get distanceFieldType(){return w(O,"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 HT,al,Jb=p(()=>{Ne();Ue();Ns();Ss();ee();dr();re();Xr();ol();pf();nr();vf();HT=class VT extends Oi{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={...VT.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=A.WHITE,i._fill.fill=null),this.applyFillAsTint=t.overrideFill;let s=i.fontSize;i.fontSize=this.baseMeasurementFontSize;let n=Wr(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 De?t.textureStyle:new De(t.textureStyle)),this.fontMetrics=Ce.measureFont(n),this.lineHeight=i.lineHeight||this.fontMetrics.fontSize||i.fontSize;}ensureCharacters(e){let t=Ce.graphemeSegmenter(e).filter(x=>!this._currentChars.includes(x)).filter((x,b,y)=>y.indexOf(x)===b);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,f=false,g=s.width/this.resolution,_=s.height/this.resolution;for(let x=0;x<t.length;x++){let b=t[x],y=Ce.measureText(b,a,s,false);y.lineHeight=y.height;let v=y.width*h,T=Math.ceil((a.fontStyle==="italic"?2:1)*v),B=y.height*h,E=T+d*2,C=B+d*2;if(f=false,b!==`
|
|
482
|
+
`&&b!=="\r"&&b!==" "&&b!==" "&&(f=true,c=Math.ceil(Math.max(C,c))),u+E>g&&(l+=c,c=C,u=0,l+c>_)){o.update();let M=this._nextPage();s=M.canvasAndContext.canvas,n=M.canvasAndContext.context,o=M.texture.source,u=0,l=0,c=0;}let k=v/h-(a.dropShadow?.distance??0)-(a._stroke?.width??0);if(this.chars[b]={id:b.codePointAt(0),xOffset:-this._padding,yOffset:-this._padding,xAdvance:k,kerning:{}},f){this._drawGlyph(n,y,u+d,l+d,h,a);let M=o.width*h,I=o.height*h,D=new V(u/M*o.width,l/I*o.height,E/M*o.width,C/I*o.height);this.chars[b].texture=new A({source:o,frame:D}),u+=Math.ceil(E);}}o.update(),this._currentX=u,this._currentY=l,this._currentMaxCharHeight=c,this._skipKerning&&this._applyKerning(t,n);}get pageTextures(){return w(O,"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=ht.getOptimalCanvasAndContext(this._textureSize,this._textureSize,e);this._setupContext(t.context,this._style,e);let i=e*(this.baseRenderedFontSize/this.baseMeasurementFontSize),s=new A({source:new ot({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=Wr(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=Ui(s,e)),t._fill&&(e.fillStyle=Ui(t._fill,e)),t.dropShadow){let o=t.dropShadow,a=H.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,f=u.descent*n,g=t.lineHeight*n,_=false;o.stroke&&c&&(_=true,e.strokeText(a,h,d+g-f));let{shadowBlur:x,shadowOffsetX:b,shadowOffsetY:y}=e;o._fill&&(_&&(e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0),e.fillText(a,h,d+g-f)),_&&(e.shadowBlur=x,e.shadowOffsetX=b,e.shadowOffsetY=y);}destroy(){super.destroy();for(let e=0;e<this.pages.length;e++){let{canvasAndContext:t,texture:i}=this.pages[e];ht.returnCanvasAndContext(t),i.destroy(true);}this.pages=null;}};HT.defaultOptions={textureSize:512,style:new Re,mipmap:true};al=HT;});function ki(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=t.baseMeasurementFontSize/e.fontSize,c=e.letterSpacing*l,h=e.wordWrapWidth*l,d=e.lineHeight?e.lineHeight*l:t.lineHeight,f=e.wordWrap&&e.breakWords,g=b=>{let y=n.width;for(let v=0;v<u.index;v++){let T=b.positions[v];n.chars.push(b.chars[v]),n.charPositions.push(T+y);}n.width+=b.width,a=false,u.width=0,u.index=0,u.chars.length=0;},_=()=>{let b=n.chars.length-1;if(i){let y=n.chars[b];for(;y===" ";)n.width-=t.chars[y].xAdvance,y=n.chars[--b];}s.width=Math.max(s.width,n.width),n={width:0,charPositions:[],chars:[],spaceWidth:0,spacesIndex:[]},a=true,s.lines.push(n),s.height+=d;},x=b=>b-c>h;for(let b=0;b<r.length+1;b++){let y,v=b===r.length;v||(y=r[b]);let T=t.chars[y]||t.chars[" "];if(/(?:\s)/.test(y)||y==="\r"||y===`
|
|
483
483
|
`||v){if(!a&&e.wordWrap&&x(n.width+u.width)?(_(),g(u),v||n.charPositions.push(0)):(u.start=n.width,g(u),v||n.charPositions.push(0)),y==="\r"||y===`
|
|
484
|
-
`)_();else if(!v){let k=T.xAdvance+(T.kerning[o]||0)+c;n.width+=k,n.spaceWidth=k,n.spacesIndex.push(n.charPositions.length),n.chars.push(y);}}else {let A=T.kerning[o]||0,k=T.xAdvance+A+c;f&&x(n.width+u.width+k)&&(g(u),_()),u.positions[u.index++]=u.width+A,u.chars.push(y),u.width+=k;}o=y;}return _(),e.align==="center"?EC(s):e.align==="right"?AC(s):e.align==="justify"&&CC(s),s}function EC(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 AC(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 CC(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 Ya=p(()=>{});function Dx(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 Fx=p(()=>{});var Nc,Gx,dr,ln=p(()=>{xx();nr();re();se();Br();Kt();Mx();Ya();Fx();Nc=0,Gx=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},this.measureCache=Gc(1e3);}getFont(e,t){let i=`${t.fontFamily}-bitmap`,s=true;if(t._fill.fill&&!t._stroke?(i+=t._fill.fill.styleKey,s=false):(t._stroke||t.dropShadow)&&(i=`${t.styleKey}-bitmap`,s=false),!te.has(i)){let o=Object.create(t);o.lineHeight=0;let a=new Lc({style:o,overrideFill:s,overrideSize:true,...this.defaultOptions});Nc++,Nc>50&&M("BitmapText",`You have dynamically created ${Nc} bitmap fonts, this can be inefficient. Try pre installing your font styles using \`BitmapFont.install({name:"style1", style})\``),a.once("destroy",()=>{Nc--,te.remove(i);}),te.set(i,a);}let n=te.get(i);return n.ensureCharacters?.(e),n}getLayout(e,t,i=true){let s=this.getFont(e,t),n=`${e}-${t.styleKey}-${i}`;if(this.measureCache.has(n))return this.measureCache.get(n);let o=we.graphemeSegmenter(e),a=as(o,t,s,i);return this.measureCache.set(n,a),a}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},w(O,"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 Re?s:new Re(s),o=t.dynamicFill??this._canUseTintForStyle(n),a=new Lc({style:n,overrideFill:o,skipKerning:t.skipKerning,padding:t.padding,resolution:t.resolution,overrideSize:false,textureStyle:t.textureStyle}),u=Dx(t.chars);return a.ensureCharacters(u.join("")),te.set(`${i}-bitmap`,a),a.once("destroy",()=>te.remove(`${i}-bitmap`)),a}uninstall(e){let t=`${e}-bitmap`,i=te.get(t);i&&i.destroy();}_canUseTintForStyle(e){return !e._stroke&&(!e.dropShadow||e.dropShadow.color===0)&&!e._fill.fill&&e._fill.color===16777215}},dr=new Gx;});function yT(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 Hc,cn,Ux=p(()=>{nr();S();dt();Oc();Br();Rx();ln();Ya();Hc=class extends ns{destroy(){this.context.customShader&&this.context.customShader.destroy(),super.destroy();}},cn=class{constructor(e){this._renderer=e,this._managedBitmapTexts=new pe({renderer:e,type:"renderable",priority:-2,name:"bitmapText"});}validateRenderable(e){let t=this._getGpuBitmapText(e);return this._renderer.renderPipes.graphics.validateRenderable(t)}addRenderable(e,t){let i=this._getGpuBitmapText(e);yT(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);yT(e,t),this._renderer.renderPipes.graphics.updateRenderable(t),t.context.customShader&&this._updateDistanceField(e);}_updateContext(e,t){let{context:i}=t,s=dr.getFont(e.text,e._style);i.clear(),s.distanceField.type!=="none"&&(i.customShader||(i.customShader=new Xa(this._renderer.limits.maxBatchableTextures)));let n=we.graphemeSegmenter(e.text),o=e._style,a=s.baseLineOffset,u=as(n,o,s,true),l=o.padding,c=u.scale,h=u.width,d=u.height+u.offsetY;o._stroke&&(h+=o._stroke.width/c,d+=o._stroke.width/c),i.translate(-e._anchor._x*h-l,-e._anchor._y*d-l).scale(c,c);let f=s.applyFillAsTint?o._fill.color:16777215,g=s.fontMetrics.fontSize,_=s.lineHeight;o.lineHeight&&(g=o.fontSize/c,_=o.lineHeight/c);let x=(_-g)/2;x-s.baseLineOffset<0&&(x=0);for(let b=0;b<u.lines.length;b++){let y=u.lines[b];for(let v=0;v<y.charPositions.length;v++){let T=y.chars[v],B=s.chars[T];if(B?.texture){let E=B.texture;i.texture(E,f||"black",Math.round(y.charPositions[v]+B.xOffset),Math.round(a+B.yOffset+x),E.orig.width,E.orig.height);}}a+=_;}}_getGpuBitmapText(e){return e._gpuData[this._renderer.uid]||this.initGpuText(e)}initGpuText(e){let t=new Hc;return e._gpuData[this._renderer.uid]=t,this._updateContext(e,t),this._managedBitmapTexts.add(e),t}_updateDistanceField(e){let t=this._getGpuBitmapText(e).context,i=e._style.fontFamily,s=te.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,f=h*s.distanceField.range*(1/d);t.customShader.resources.localUniforms.uniforms.uDistance=f;}destroy(){this._managedBitmapTexts.destroy(),this._renderer=null,this._managedBitmapTexts=null;}};cn.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"bitmapText"};});var Ix=p(()=>{S();Ux();G.add(cn);});var $a,Ox=p(()=>{rn();$a=class extends qt{constructor(){super(...arguments),this.generatingTexture=false,this.currentKey="--";}destroy(){this.texturePromise=null,this.generatingTexture=false,this.currentKey="--",super.destroy();}};});var hn,kx=p(()=>{S();ee();dt();vc();Ox();hn=class{constructor(e){this._renderer=e,e.runners.resolutionChange.add(this),this._managedTexts=new pe({renderer:e,type:"renderable",onUnload:this.onTextUnload.bind(this),name:"htmlText"});}resolutionChange(){for(let e in this._managedTexts.items){let t=this._managedTexts.items[e];t?._autoResolution&&t.onViewUpdate();}}validateRenderable(e){let t=this._getGpuText(e),i=e.styleKey;return t.currentKey!==i}addRenderable(e,t){let i=this._getGpuText(e);if(e._didTextUpdate){let s=e._autoResolution?this._renderer.resolution:e.resolution;(i.currentKey!==e.styleKey||e.resolution!==s)&&this._updateGpuText(e).catch(n=>{console.error(n);}),e._didTextUpdate=false,tn(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;let i=t.texturePromise;t.texturePromise=null,t.generatingTexture=true,e._resolution=e._autoResolution?this._renderer.resolution:e.resolution;let s=this._renderer.htmlText.getTexturePromise(e);i&&(s=s.finally(()=>{this._renderer.htmlText.decreaseReferenceCount(t.currentKey),this._renderer.htmlText.returnTexturePromise(i);})),t.texturePromise=s,t.currentKey=e.styleKey,t.texture=await s;let n=e.renderGroup||e.parentRenderGroup;n&&(n.structureDidChange=true),t.generatingTexture=false,tn(t,e);}_getGpuText(e){return e._gpuData[this._renderer.uid]||this.initGpuText(e)}initGpuText(e){let t=new $a;return t.renderable=e,t.transform=e.groupTransform,t.texture=C.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,this._managedTexts.add(e),t}onTextUnload(e){let t=e._gpuData[this._renderer.uid];if(!t)return;let{htmlText:i}=this._renderer;i.getReferenceCount(t.currentKey)===null?i.returnTexturePromise(t.texturePromise):i.decreaseReferenceCount(t.currentKey);}destroy(){this._managedTexts.destroy(),this._renderer=null;}};hn.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"htmlText"};});function Lx(){let{userAgent:r}=U.get().getNavigator();return /^((?!chrome|android).)*safari/i.test(r)}var Nx=p(()=>{ae();});var vT,TT,us,Vc=p(()=>{ae();vT="http://www.w3.org/2000/svg",TT="http://www.w3.org/1999/xhtml",us=class{constructor(){this.svgRoot=document.createElementNS(vT,"svg"),this.foreignObject=document.createElementNS(vT,"foreignObject"),this.domElement=document.createElementNS(TT,"div"),this.styleElement=document.createElementNS(TT,"style");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),this.image=U.get().createImage();}destroy(){this.svgRoot.remove(),this.foreignObject.remove(),this.styleElement.remove(),this.domElement.remove(),this.image.src="",this.image.remove(),this.svgRoot=null,this.foreignObject=null,this.styleElement=null,this.domElement=null,this.image=null,this.canvasAndContext=null;}};});function Hx(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 Vx=p(()=>{});async function zx(r){let t=await(await U.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 Wx=p(()=>{ae();});async function Xx(r,e){let t=await zx(e);return `@font-face {
|
|
484
|
+
`)_();else if(!v){let k=T.xAdvance+(T.kerning[o]||0)+c;n.width+=k,n.spaceWidth=k,n.spacesIndex.push(n.charPositions.length),n.chars.push(y);}}else {let C=T.kerning[o]||0,k=T.xAdvance+C+c;f&&x(n.width+u.width+k)&&(g(u),_()),u.positions[u.index++]=u.width+C,u.chars.push(y),u.width+=k;}o=y;}return _(),e.align==="center"?_w(s):e.align==="right"?bw(s):e.align==="justify"&&yw(s),s}function _w(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 bw(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 yw(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 ul=p(()=>{});function Tf(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 e0=p(()=>{});var Sf,t0,ar,Xo=p(()=>{zb();pr();re();ne();Xr();nr();Jb();ul();e0();Sf=0,t0=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},this.measureCache=ff(1e3);}getFont(e,t){let i=`${t.fontFamily}-bitmap`,s=true;if(t._fill.fill&&!t._stroke?(i+=t._fill.fill.styleKey,s=false):(t._stroke||t.dropShadow)&&(i=`${t.styleKey}-bitmap`,s=false),!te.has(i)){let o=Object.create(t);o.lineHeight=0;let a=new al({style:o,overrideFill:s,overrideSize:true,...this.defaultOptions});Sf++,Sf>50&&R("BitmapText",`You have dynamically created ${Sf} bitmap fonts, this can be inefficient. Try pre installing your font styles using \`BitmapFont.install({name:"style1", style})\``),a.once("destroy",()=>{Sf--,te.remove(i);}),te.set(i,a);}let n=te.get(i);return n.ensureCharacters?.(e),n}getLayout(e,t,i=true){let s=this.getFont(e,t),n=`${e}-${t.styleKey}-${i}`;if(this.measureCache.has(n))return this.measureCache.get(n);let o=Ce.graphemeSegmenter(e),a=ki(o,t,s,i);return this.measureCache.set(n,a),a}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},w(O,"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 Re?s:new Re(s),o=t.dynamicFill??this._canUseTintForStyle(n),a=new al({style:n,overrideFill:o,skipKerning:t.skipKerning,padding:t.padding,resolution:t.resolution,overrideSize:false,textureStyle:t.textureStyle}),u=Tf(t.chars);return a.ensureCharacters(u.join("")),te.set(`${i}-bitmap`,a),a.once("destroy",()=>te.remove(`${i}-bitmap`)),a}uninstall(e){let t=`${e}-bitmap`,i=te.get(t);i&&i.destroy();}_canUseTintForStyle(e){return !e._stroke&&(!e.dropShadow||e.dropShadow.color===0)&&!e._fill.fill&&e._fill.color===16777215}},ar=new t0;});function zT(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 ll,zs,r0=p(()=>{pr();S();bt();gf();Xr();Qb();Xo();ul();ll=class extends Ii{destroy(){this.context.customShader&&this.context.customShader.destroy(),super.destroy();}},zs=class{constructor(e){this._renderer=e,this._managedBitmapTexts=new pe({renderer:e,type:"renderable",priority:-2,name:"bitmapText"});}validateRenderable(e){let t=this._getGpuBitmapText(e);return this._renderer.renderPipes.graphics.validateRenderable(t)}addRenderable(e,t){let i=this._getGpuBitmapText(e);zT(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);zT(e,t),this._renderer.renderPipes.graphics.updateRenderable(t),t.context.customShader&&this._updateDistanceField(e);}_updateContext(e,t){let{context:i}=t,s=ar.getFont(e.text,e._style);i.clear(),s.distanceField.type!=="none"&&(i.customShader||(i.customShader=new Wo(this._renderer.limits.maxBatchableTextures)));let n=Ce.graphemeSegmenter(e.text),o=e._style,a=s.baseLineOffset,u=ki(n,o,s,true),l=o.padding,c=u.scale,h=u.width,d=u.height+u.offsetY;o._stroke&&(h+=o._stroke.width/c,d+=o._stroke.width/c),i.translate(-e._anchor._x*h-l,-e._anchor._y*d-l).scale(c,c);let f=s.applyFillAsTint?o._fill.color:16777215,g=s.fontMetrics.fontSize,_=s.lineHeight;o.lineHeight&&(g=o.fontSize/c,_=o.lineHeight/c);let x=(_-g)/2;x-s.baseLineOffset<0&&(x=0);for(let b=0;b<u.lines.length;b++){let y=u.lines[b];for(let v=0;v<y.charPositions.length;v++){let T=y.chars[v],B=s.chars[T];if(B?.texture){let E=B.texture;i.texture(E,f||"black",Math.round(y.charPositions[v]+B.xOffset),Math.round(a+B.yOffset+x),E.orig.width,E.orig.height);}}a+=_;}}_getGpuBitmapText(e){return e._gpuData[this._renderer.uid]||this.initGpuText(e)}initGpuText(e){let t=new ll;return e._gpuData[this._renderer.uid]=t,this._updateContext(e,t),this._managedBitmapTexts.add(e),t}_updateDistanceField(e){let t=this._getGpuBitmapText(e).context,i=e._style.fontFamily,s=te.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,f=h*s.distanceField.range*(1/d);t.customShader.resources.localUniforms.uniforms.uDistance=f;}destroy(){this._managedBitmapTexts.destroy(),this._renderer=null,this._managedBitmapTexts=null;}};zs.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"bitmapText"};});var i0=p(()=>{S();r0();G.add(zs);});var Yo,s0=p(()=>{Do();Yo=class extends zt{constructor(){super(...arguments),this.generatingTexture=false,this.currentKey="--";}destroy(){this.texturePromise=null,this.generatingTexture=false,this.currentKey="--",super.destroy();}};});var Ws,n0=p(()=>{S();ee();bt();Wd();s0();Ws=class{constructor(e){this._renderer=e,e.runners.resolutionChange.add(this),this._managedTexts=new pe({renderer:e,type:"renderable",onUnload:this.onTextUnload.bind(this),name:"htmlText"});}resolutionChange(){for(let e in this._managedTexts.items){let t=this._managedTexts.items[e];t?._autoResolution&&t.onViewUpdate();}}validateRenderable(e){let t=this._getGpuText(e),i=e.styleKey;return t.currentKey!==i}addRenderable(e,t){let i=this._getGpuText(e);if(e._didTextUpdate){let s=e._autoResolution?this._renderer.resolution:e.resolution;(i.currentKey!==e.styleKey||e.resolution!==s)&&this._updateGpuText(e).catch(n=>{console.error(n);}),e._didTextUpdate=false,Is(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;let i=t.texturePromise;t.texturePromise=null,t.generatingTexture=true,e._resolution=e._autoResolution?this._renderer.resolution:e.resolution;let s=this._renderer.htmlText.getTexturePromise(e);i&&(s=s.finally(()=>{this._renderer.htmlText.decreaseReferenceCount(t.currentKey),this._renderer.htmlText.returnTexturePromise(i);})),t.texturePromise=s,t.currentKey=e.styleKey,t.texture=await s;let n=e.renderGroup||e.parentRenderGroup;n&&(n.structureDidChange=true),t.generatingTexture=false,Is(t,e);}_getGpuText(e){return e._gpuData[this._renderer.uid]||this.initGpuText(e)}initGpuText(e){let t=new Yo;return t.renderable=e,t.transform=e.groupTransform,t.texture=A.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,this._managedTexts.add(e),t}onTextUnload(e){let t=e._gpuData[this._renderer.uid];if(!t)return;let{htmlText:i}=this._renderer;i.getReferenceCount(t.currentKey)===null?i.returnTexturePromise(t.texturePromise):i.decreaseReferenceCount(t.currentKey);}destroy(){this._managedTexts.destroy(),this._renderer=null;}};Ws.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"htmlText"};});function Ef(){let{userAgent:r}=U.get().getNavigator();return /^((?!chrome|android).)*safari/i.test(r)}var o0=p(()=>{ae();});var WT,XT,Li,Af=p(()=>{ae();WT="http://www.w3.org/2000/svg",XT="http://www.w3.org/1999/xhtml",Li=class{constructor(){this.svgRoot=document.createElementNS(WT,"svg"),this.foreignObject=document.createElementNS(WT,"foreignObject"),this.domElement=document.createElementNS(XT,"div"),this.styleElement=document.createElementNS(XT,"style");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),this.image=U.get().createImage();}destroy(){this.svgRoot.remove(),this.foreignObject.remove(),this.styleElement.remove(),this.domElement.remove(),this.image.src="",this.image.remove(),this.svgRoot=null,this.foreignObject=null,this.styleElement=null,this.domElement=null,this.image=null,this.canvasAndContext=null;}};});function Cf(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 a0=p(()=>{});async function wf(r){let t=await(await U.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 u0=p(()=>{ae();});async function Pf(r,e){let t=await wf(e);return `@font-face {
|
|
485
485
|
font-family: "${r.fontFamily}";
|
|
486
486
|
font-weight: ${r.fontWeight};
|
|
487
487
|
font-style: ${r.fontStyle};
|
|
488
488
|
src: url('${t}');
|
|
489
|
-
}`}var
|
|
490
|
-
`)));}return
|
|
491
|
-
`)}var
|
|
489
|
+
}`}var l0=p(()=>{u0();});async function Bf(r){let e=r.filter(t=>te.has(`${t}-and-url`)).map(t=>{if(!cl.has(t)){let{entries:i}=te.get(`${t}-and-url`),s=[];i.forEach(n=>{let o=n.url,u=n.faces.map(l=>({weight:l.weight,style:l.style}));s.push(...u.map(l=>Pf({fontWeight:l.weight,fontStyle:l.style,fontFamily:t},o)));}),cl.set(t,Promise.all(s).then(n=>n.join(`
|
|
490
|
+
`)));}return cl.get(t)});return (await Promise.all(e)).join(`
|
|
491
|
+
`)}var cl,c0=p(()=>{pr();l0();cl=new Map;});function Rf(r,e,t,i,s){let{domElement:n,styleElement:o,svgRoot:a}=s;n.innerHTML=`<style>${e.cssStyle}</style><div style='padding:0;'>${r}</div>`,n.setAttribute("style",`transform: scale(${t});transform-origin: top left; display: inline-block`),o.textContent=i;let{width:u,height:l}=s.image;return a.setAttribute("width",u.toString()),a.setAttribute("height",l.toString()),new XMLSerializer().serializeToString(a)}var h0=p(()=>{});function Mf(r,e){let t=ht.getOptimalCanvasAndContext(r.width,r.height,e),{context:i}=t;return i.clearRect(0,0,r.width,r.height),i.drawImage(r,0,0),t}var d0=p(()=>{Ns();});function Df(r,e,t){return new Promise(async i=>{t&&await new Promise(s=>setTimeout(s,100)),r.onload=()=>{i();},r.src=`data:image/svg+xml;charset=utf8,${encodeURIComponent(e)}`,r.crossOrigin="anonymous";})}var f0=p(()=>{});function $o(r,e,t,i){i||(i=YT||(YT=new Li));let{domElement:s,styleElement:n,svgRoot:o}=i;s.innerHTML=`<style>${e.cssStyle};</style><div style='padding:0'>${r}</div>`,s.setAttribute("style","transform-origin: top left; display: inline-block"),t&&(n.textContent=t),document.body.appendChild(o);let a=s.getBoundingClientRect();o.remove();let u=e.padding*2;return {width:a.width-u,height:a.height-u}}var YT,Ff=p(()=>{Af();});var Xs,p0=p(()=>{S();Ns();Zt();Dt();o0();ne();jt();hf();Af();a0();c0();h0();d0();f0();Ff();Xs=class{constructor(e){this._activeTextures={},this._renderer=e,this._createCanvas=e.type===ye.WEBGPU;}getTexture(e){return this.getTexturePromise(e)}getManagedTexture(e){let t=e.styleKey;if(this._activeTextures[t])return this._increaseReferenceCount(t),this._activeTextures[t].promise;let i=this._buildTexturePromise(e).then(s=>(this._activeTextures[t].texture=s,s));return this._activeTextures[t]={texture:null,promise:i,usageCount:1},i}getReferenceCount(e){return this._activeTextures[e]?.usageCount??null}_increaseReferenceCount(e){this._activeTextures[e].usageCount++;}decreaseReferenceCount(e){let t=this._activeTextures[e];t&&(t.usageCount--,t.usageCount===0&&(t.texture?this._cleanUp(t.texture):t.promise.then(i=>{t.texture=i,this._cleanUp(t.texture);}).catch(()=>{R("HTMLTextSystem: Failed to clean texture");}),this._activeTextures[e]=null));}getTexturePromise(e){return this._buildTexturePromise(e)}async _buildTexturePromise(e){let{text:t,style:i,resolution:s,textureStyle:n}=e,o=he.get(Li),a=Cf(t,i),u=await Bf(a),l=$o(t,i,u,o),c=Math.ceil(Math.ceil(Math.max(1,l.width)+i.padding*2)*s),h=Math.ceil(Math.ceil(Math.max(1,l.height)+i.padding*2)*s),d=o.image,f=2;d.width=(c|0)+f,d.height=(h|0)+f;let g=Rf(t,i,s,u,o);await Df(d,g,Ef()&&a.length>0);let _=d,x;this._createCanvas&&(x=Mf(d,s));let b=zo(x?x.canvas:_,d.width-f,d.height-f,s);return n&&(b.source.style=n),this._createCanvas&&(this._renderer.texture.initSource(b.source),ht.returnCanvasAndContext(x)),he.return(o),b}returnTexturePromise(e){e.then(t=>{this._cleanUp(t);}).catch(()=>{R("HTMLTextSystem: Failed to clean texture");});}_cleanUp(e){le.returnTexture(e,true),e.source.resource=null,e.source.uploadMethodId="unknown";}destroy(){this._renderer=null;for(let e in this._activeTextures)this._activeTextures[e]&&this.returnTexturePromise(this._activeTextures[e].promise);this._activeTextures=null;}};Xs.extension={type:[m.WebGLSystem,m.WebGPUSystem,m.CanvasSystem],name:"htmlText"};});var m0=p(()=>{S();n0();p0();G.add(Xs);G.add(Ws);});var $T,dt,$r=p(()=>{Lr();mr();bi();re();$T=class jT extends at{constructor(...e){let t=e[0]??{};t instanceof Float32Array&&(w(O,"use new MeshGeometry({ positions, uvs, indices }) instead"),t={positions:t,uvs:e[1],indices:e[2]}),t={...jT.defaultOptions,...t};let i=t.positions||new Float32Array([0,0,1,0,1,1,0,1]),s=t.uvs;s||(t.positions?s=new Float32Array(i.length):s=new Float32Array([0,0,1,0,1,1,0,1]));let n=t.indices||new Uint32Array([0,1,2,0,2,3]),o=t.shrinkBuffersToFit,a=new Ee({data:i,label:"attribute-mesh-positions",shrinkToFit:o,usage:j.VERTEX|j.COPY_DST}),u=new Ee({data:s,label:"attribute-mesh-uvs",shrinkToFit:o,usage:j.VERTEX|j.COPY_DST}),l=new Ee({data:n,label:"index-mesh-buffer",shrinkToFit:o,usage:j.INDEX|j.COPY_DST});super({attributes:{aPosition:{buffer:a,format:"float32x2",stride:8,offset:0},aUV:{buffer:u,format:"float32x2",stride:8,offset:0}},indexBuffer:l,topology:t.topology}),this.batchMode="auto";}get positions(){return this.attributes.aPosition.buffer.data}set positions(e){this.attributes.aPosition.buffer.data=e;}get uvs(){return this.attributes.aUV.buffer.data}set uvs(e){this.attributes.aUV.buffer.data=e;}get indices(){return this.indexBuffer.data}set indices(e){this.indexBuffer.data=e;}};$T.defaultOptions={topology:"triangle-list",shrinkBuffersToFit:false};dt=$T;});var jr,Gf,Ni,Ys=p(()=>{jr={name:"local-uniform-bit",vertex:{header:`
|
|
492
492
|
|
|
493
493
|
struct LocalUniforms {
|
|
494
494
|
uTransformMatrix:mat3x3<f32>,
|
|
@@ -505,7 +505,7 @@ fn mainFragment(
|
|
|
505
505
|
{
|
|
506
506
|
vPosition = vec4(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw);
|
|
507
507
|
}
|
|
508
|
-
`}},
|
|
508
|
+
`}},Gf={...jr,vertex:{...jr.vertex,header:jr.vertex.header.replace("group(1)","group(2)")}},Ni={name:"local-uniform-bit",vertex:{header:`
|
|
509
509
|
|
|
510
510
|
uniform mat3 uTransformMatrix;
|
|
511
511
|
uniform vec4 uColor;
|
|
@@ -518,7 +518,7 @@ fn mainFragment(
|
|
|
518
518
|
{
|
|
519
519
|
gl_Position.xy = roundPixels(gl_Position.xy, uResolution);
|
|
520
520
|
}
|
|
521
|
-
`}};});var
|
|
521
|
+
`}};});var Uf,If,g0=p(()=>{Uf={name:"tiling-bit",vertex:{header:`
|
|
522
522
|
struct TilingUniforms {
|
|
523
523
|
uMapCoord:mat3x3<f32>,
|
|
524
524
|
uClampFrame:vec4<f32>,
|
|
@@ -561,7 +561,7 @@ fn mainFragment(
|
|
|
561
561
|
}
|
|
562
562
|
|
|
563
563
|
outColor = textureSampleBias(uTexture, uSampler, coord, bias);
|
|
564
|
-
`}},
|
|
564
|
+
`}},If={name:"tiling-bit",vertex:{header:`
|
|
565
565
|
uniform mat3 uTextureTransform;
|
|
566
566
|
uniform vec4 uSizeAnchor;
|
|
567
567
|
|
|
@@ -583,7 +583,7 @@ fn mainFragment(
|
|
|
583
583
|
|
|
584
584
|
outColor = texture(uTexture, coord, unclamped == coord ? 0.0 : -32.0);// lod-bias very negative to force lod 0
|
|
585
585
|
|
|
586
|
-
`}};});var a_,u_,qa,l_=p(()=>{K();Ar();cs();Cr();Ut();Ie();ee();o_();qa=class extends Ae{constructor(){a_??(a_=Wt({name:"tiling-sprite-shader",bits:[hi,s_,Yt]})),u_??(u_=Xt({name:"tiling-sprite-shader",bits:[ls,n_,$t]}));let e=new J({uMapCoord:{value:new P,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 P,type:"mat3x3<f32>"},uSizeAnchor:{value:new Float32Array([100,100,.5,.5]),type:"vec4<f32>"}});super({glProgram:u_,gpuProgram:a_,resources:{localUniforms:new J({uTransformMatrix:{value:new P,type:"mat3x3<f32>"},uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uRound:{value:0,type:"f32"}}),tilingUniforms:e,uTexture:C.EMPTY.source,uSampler:C.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 Ka,c_=p(()=>{Rr();Ka=class extends gt{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 h_(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 d_=p(()=>{});function f_(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],f=r[t+1];r[t]=o*d+u*f+c,r[t+1]=a*d+l*f+h,t+=e,s++;}}var p_=p(()=>{});function m_(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=P.shared;a.copyFrom(r._tileTransform.matrix),a.tx/=r.width,a.ty/=r.height,a.invert(),a.scale(r.width/i,r.height/s),f_(e,2,0,a);}var g_=p(()=>{K();p_();});var Xc,Yc,fn,x_=p(()=>{S();Vs();Rt();Bt();dt();qi();wa();Rr();l_();c_();d_();g_();Xc=new Ka,Yc=class{constructor(){this.canBatch=true,this.geometry=new gt({indices:Xc.indices.slice(),positions:Xc.positions.slice(),uvs:Xc.uvs.slice()});}destroy(){this.geometry.destroy(),this.shader?.destroy();}},fn=class{constructor(e){this._state=Se.default2d,this._renderer=e,this._managedTilingSprites=new pe({renderer:e,type:"renderable",name:"tilingSprite"});}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 wr);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 qa),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,jt(e.groupColorAlpha,i.uColor,0),this._state.blendMode=or(e.groupBlendMode,e.texture._source),this._renderer.encoder.draw({geometry:Xc,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 Yc;return t.renderable=e,e._gpuData[this._renderer.uid]=t,this._managedTilingSprites.add(e),t}_updateBatchableMesh(e){let t=this._getTilingSpriteData(e),{geometry:i}=t,s=e.texture.source.style;s.addressMode!=="repeat"&&(s.addressMode="repeat",s.update()),m_(e,i.uvs),h_(e,i.positions);}destroy(){this._managedTilingSprites.destroy(),this._renderer=null;}_updateCanBatch(e){let t=this._getTilingSpriteData(e),i=e.texture,s=true;return this._renderer.type===ye.WEBGL&&(s=this._renderer.context.supports.nonPowOf2wrapping),t.canBatch=i.textureMatrix.isSimple&&(s||i.source.isPowerOfTwo),t.canBatch}};fn.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"tilingSprite"};});var __=p(()=>{S();x_();G.add(fn);});var CT,hs,Za=p(()=>{re();Rr();CT=class wT extends gt{constructor(...e){super({});let t=e[0]??{};typeof t=="number"&&(w(O,"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={...wT.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,f=h/this.verticesX|0;i.push(d*u,f*l),s.push(d/o,f/a);}let c=o*a;for(let h=0;h<c;h++){let d=h%o,f=h/o|0,g=f*this.verticesX+d,_=f*this.verticesX+d+1,x=(f+1)*this.verticesX+d,b=(f+1)*this.verticesX+d+1;n.push(g,_,x,_,b,x);}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();}};CT.defaultOptions={width:100,height:100,verticesX:10,verticesY:10};hs=CT;});var PT,fr,$c=p(()=>{Za();PT=class BT extends hs{constructor(e={}){e={...BT.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,f=i>d?1:i/d,g=Math.min(h,f),_=u*t,x=l*i;e[0]=e[8]=e[16]=e[24]=-_,e[2]=e[10]=e[18]=e[26]=s*g-_,e[4]=e[12]=e[20]=e[28]=t-n*g-_,e[6]=e[14]=e[22]=e[30]=t-_,e[1]=e[3]=e[5]=e[7]=-x,e[9]=e[11]=e[13]=e[15]=o*g-x,e[17]=e[19]=e[21]=e[23]=i-a*g-x,e[25]=e[27]=e[29]=e[31]=i-x,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();}};PT.defaultOptions={width:100,height:100,leftWidth:10,topHeight:10,rightWidth:10,bottomHeight:10,originalWidth:100,originalHeight:100};fr=PT;});var jc,pn,b_=p(()=>{S();dt();wa();$c();jc=class extends wr{constructor(){super(),this.geometry=new fr;}destroy(){this.geometry.destroy();}},pn=class{constructor(e){this._renderer=e,this._managedSprites=new pe({renderer:e,type:"renderable",name:"nineSliceSprite"});}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 jc,i=t;return i.renderable=e,i.transform=e.groupTransform,i.texture=e._texture,i.roundPixels=this._renderer._roundPixels|e._roundPixels,this._managedSprites.add(e),e.didViewUpdate||this._updateBatchableSprite(e,i),t}destroy(){this._managedSprites.destroy(),this._renderer=null;}};pn.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"nineSliceSprite"};});var y_=p(()=>{S();b_();G.add(pn);});var mn,v_=p(()=>{S();mn=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;}};mn.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"filter"};});var RT,ze,Qt=p(()=>{ct();vt();Ut();Rt();RT=class T_ extends Ae{constructor(e){e={...T_.defaultOptions,...e},super(e),this.enabled=true,this._state=Se.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),e.blendRequired&&this.addResource("uBackTexture",0,3);}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=xe.from(i)),new T_({gpuProgram:n,glProgram:o,...s})}};RT.defaultOptions={blendMode:"normal",resolution:1,padding:0,antialias:"off",blendRequired:false,clipToViewport:true};ze=RT;});var Mr,gn=p(()=>{Mr=`in vec2 aPosition;
|
|
586
|
+
`}};});var x0,_0,jo,b0=p(()=>{K();Nr();Ys();Hr();Ht();Oe();ee();g0();jo=class extends Ae{constructor(){x0??(x0=Ot({name:"tiling-sprite-shader",bits:[jr,Uf,Lt]})),_0??(_0=kt({name:"tiling-sprite-shader",bits:[Ni,If,Nt]}));let e=new J({uMapCoord:{value:new P,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 P,type:"mat3x3<f32>"},uSizeAnchor:{value:new Float32Array([100,100,.5,.5]),type:"vec4<f32>"}});super({glProgram:_0,gpuProgram:x0,resources:{localUniforms:new J({uTransformMatrix:{value:new P,type:"mat3x3<f32>"},uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uRound:{value:0,type:"f32"}}),tilingUniforms:e,uTexture:A.EMPTY.source,uSampler:A.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 qo,y0=p(()=>{$r();qo=class extends dt{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 Of(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 v0=p(()=>{});function kf(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],f=r[t+1];r[t]=o*d+u*f+c,r[t+1]=a*d+l*f+h,t+=e,s++;}}var T0=p(()=>{});function Lf(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=P.shared;a.copyFrom(r._tileTransform.matrix),a.tx/=r.width,a.ty/=r.height,a.invert(),a.scale(r.width/i,r.height/s),kf(e,2,0,a);}var S0=p(()=>{K();T0();});var Nf,hl,$s,E0=p(()=>{S();fo();Ft();Dt();bt();Ms();Ku();$r();b0();y0();v0();S0();Nf=new qo,hl=class{constructor(){this.canBatch=true,this.geometry=new dt({indices:Nf.indices.slice(),positions:Nf.positions.slice(),uvs:Nf.uvs.slice()});}destroy(){this.geometry.destroy(),this.shader?.destroy();}},$s=class{constructor(e){this._state=Se.default2d,this._renderer=e,this._managedTilingSprites=new pe({renderer:e,type:"renderable",name:"tilingSprite"});}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 gr);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 jo),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,Vt(e.groupColorAlpha,i.uColor,0),this._state.blendMode=tr(e.groupBlendMode,e.texture._source),this._renderer.encoder.draw({geometry:Nf,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 hl;return t.renderable=e,e._gpuData[this._renderer.uid]=t,this._managedTilingSprites.add(e),t}_updateBatchableMesh(e){let t=this._getTilingSpriteData(e),{geometry:i}=t,s=e.texture.source.style;s.addressMode!=="repeat"&&(s.addressMode="repeat",s.update()),Lf(e,i.uvs),Of(e,i.positions);}destroy(){this._managedTilingSprites.destroy(),this._renderer=null;}_updateCanBatch(e){let t=this._getTilingSpriteData(e),i=e.texture,s=true;return this._renderer.type===ye.WEBGL&&(s=this._renderer.context.supports.nonPowOf2wrapping),t.canBatch=i.textureMatrix.isSimple&&(s||i.source.isPowerOfTwo),t.canBatch}};$s.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"tilingSprite"};});var A0=p(()=>{S();E0();G.add($s);});var qT,Hi,dl=p(()=>{re();$r();qT=class KT extends dt{constructor(...e){super({});let t=e[0]??{};typeof t=="number"&&(w(O,"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={...KT.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,f=h/this.verticesX|0;i.push(d*u,f*l),s.push(d/o,f/a);}let c=o*a;for(let h=0;h<c;h++){let d=h%o,f=h/o|0,g=f*this.verticesX+d,_=f*this.verticesX+d+1,x=(f+1)*this.verticesX+d,b=(f+1)*this.verticesX+d+1;n.push(g,_,x,_,b,x);}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();}};qT.defaultOptions={width:100,height:100,verticesX:10,verticesY:10};Hi=qT;});var ZT,ur,Hf=p(()=>{dl();ZT=class QT extends Hi{constructor(e={}){e={...QT.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,f=i>d?1:i/d,g=Math.min(h,f),_=u*t,x=l*i;e[0]=e[8]=e[16]=e[24]=-_,e[2]=e[10]=e[18]=e[26]=s*g-_,e[4]=e[12]=e[20]=e[28]=t-n*g-_,e[6]=e[14]=e[22]=e[30]=t-_,e[1]=e[3]=e[5]=e[7]=-x,e[9]=e[11]=e[13]=e[15]=o*g-x,e[17]=e[19]=e[21]=e[23]=i-a*g-x,e[25]=e[27]=e[29]=e[31]=i-x,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();}};ZT.defaultOptions={width:100,height:100,leftWidth:10,topHeight:10,rightWidth:10,bottomHeight:10,originalWidth:100,originalHeight:100};ur=ZT;});var fl,js,C0=p(()=>{S();bt();Ku();Hf();fl=class extends gr{constructor(){super(),this.geometry=new ur;}destroy(){this.geometry.destroy();}},js=class{constructor(e){this._renderer=e,this._managedSprites=new pe({renderer:e,type:"renderable",name:"nineSliceSprite"});}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 fl,i=t;return i.renderable=e,i.transform=e.groupTransform,i.texture=e._texture,i.roundPixels=this._renderer._roundPixels|e._roundPixels,this._managedSprites.add(e),e.didViewUpdate||this._updateBatchableSprite(e,i),t}destroy(){this._managedSprites.destroy(),this._renderer=null;}};js.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"nineSliceSprite"};});var w0=p(()=>{S();C0();G.add(js);});var qs,P0=p(()=>{S();qs=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;}};qs.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"filter"};});var JT,Ve,lr=p(()=>{_t();St();Ht();Ft();JT=class B0 extends Ae{constructor(e){e={...B0.defaultOptions,...e},super(e),this.enabled=true,this._state=Se.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),e.blendRequired&&this.addResource("uBackTexture",0,3);}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=xe.from(i)),new B0({gpuProgram:n,glProgram:o,...s})}};JT.defaultOptions={blendMode:"normal",resolution:1,padding:0,antialias:"off",blendRequired:false,clipToViewport:true};Ve=JT;});var _r,Ko=p(()=>{_r=`in vec2 aPosition;
|
|
587
587
|
out vec2 vTextureCoord;
|
|
588
588
|
|
|
589
589
|
uniform vec4 uInputSize;
|
|
@@ -610,13 +610,13 @@ void main(void)
|
|
|
610
610
|
gl_Position = filterVertexPosition();
|
|
611
611
|
vTextureCoord = filterTextureCoord();
|
|
612
612
|
}
|
|
613
|
-
`;});var
|
|
613
|
+
`;});var Vf,R0=p(()=>{Vf=`in vec2 vTextureCoord;
|
|
614
614
|
out vec4 finalColor;
|
|
615
615
|
uniform sampler2D uTexture;
|
|
616
616
|
void main() {
|
|
617
617
|
finalColor = texture(uTexture, vTextureCoord);
|
|
618
618
|
}
|
|
619
|
-
`;});var
|
|
619
|
+
`;});var pl,M0=p(()=>{pl=`struct GlobalFilterUniforms {
|
|
620
620
|
uInputSize: vec4<f32>,
|
|
621
621
|
uInputPixel: vec4<f32>,
|
|
622
622
|
uInputClamp: vec4<f32>,
|
|
@@ -665,7 +665,7 @@ fn mainFragment(
|
|
|
665
665
|
) -> @location(0) vec4<f32> {
|
|
666
666
|
return textureSample(uTexture, uSampler, uv);
|
|
667
667
|
}
|
|
668
|
-
`;});var Qa,C_=p(()=>{ct();vt();Qt();gn();E_();A_();Qa=class extends ze{constructor(){let e=_e.from({vertex:{source:qc,entryPoint:"mainVertex"},fragment:{source:qc,entryPoint:"mainFragment"},name:"passthrough-filter"}),t=xe.from({vertex:Mr,fragment:S_,name:"passthrough-filter"});super({gpuProgram:e,glProgram:t});}};});function Kc(r,e,t,i,s,n,o,a){let u=o-t,l=a-i,c=s-t,h=n-i,d=r-t,f=e-i,g=u*u+l*l,_=u*c+l*h,x=u*d+l*f,b=c*c+h*h,y=c*d+h*f,v=1/(g*b-_*_),T=(b*x-_*y)*v,B=(g*y-_*x)*v;return T>=0&&B>=0&&T+B<1}var w_=p(()=>{});var P_,MT=p(()=>{Tc();De();P_=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 Zi(e,t,a,c,u,d)<=o||Zi(e,t,u,h,l,d)<=o||Zi(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 V);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}};});function B_(r,e){e.clear();let t=e.matrix;for(let i=0;i<r.length;i++){let s=r[i];if(s.globalDisplayStatus<7)continue;let n=s.renderGroup??s.parentRenderGroup;n?.isCachedAsTexture?e.matrix=DT.copyFrom(n.textureOffsetInverseTransform).append(s.worldTransform):n?._parentCacheAsTextureRenderGroup?e.matrix=DT.copyFrom(n._parentCacheAsTextureRenderGroup.inverseWorldTransform).append(s.groupTransform):e.matrix=s.worldTransform,e.addBounds(s.bounds);}return e.matrix=t,e}var DT,R_=p(()=>{K();DT=new P;});var wC,M_,xn,D_=p(()=>{S();C_();K();Sr();ni();Ie();ee();Lt();Bt();qe();R_();se();wC=new lt({attributes:{aPosition:{buffer:new Float32Array([0,0,1,0,1,1,0,1]),format:"float32x2",stride:8,offset:0}},indexBuffer:new Uint32Array([0,1,2,0,2,3])}),M_=class{constructor(){this.skip=false,this.inputTexture=null,this.backTexture=null,this.filters=null,this.bounds=new oe,this.container=null,this.blendRequired=false,this.outputRenderSurface=null,this.globalFrame={x:0,y:0,width:0,height:0},this.firstEnabledIndex=-1,this.lastEnabledIndex=-1;}},xn=class{constructor(e){this._filterStackIndex=0,this._filterStack=[],this._filterGlobalUniforms=new J({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 Ve({}),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.every(f=>!f.enabled)){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.every(f=>!f.enabled))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=le.getOptimalTexture(a.width,a.height,i.resolution,i.antialias),i.backTexture=C.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&&le.returnTexture(t.backTexture),le.returnTexture(t.inputTexture));}getBackTexture(e,t,i){let s=e.colorTexture.source._resolution,n=le.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 g=this._findPreviousFilterOffset();h=g.x,d=g.y;}this._updateFilterUniforms(t,i,o,h,d,c,u,s);let f=e.enabled?e:this._getPassthroughFilter();this._setupBindGroupsAndRender(f,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(P.shared),o=t.renderGroup||t.parentRenderGroup;return o&&o.cacheToLocalTransform&&n.prepend(o.cacheToLocalTransform),n.invert(),s.prepend(n),s.scale(1/t.texture.orig.width,1/t.texture.orig.height),s.translate(t.anchor.x,t.anchor.y),s}destroy(){this._passthroughFilter?.destroy(true),this._passthroughFilter=null;}_getPassthroughFilter(){return this._passthroughFilter??(this._passthroughFilter=new Qa),this._passthroughFilter}_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:wC,shader:e,state:e._state,topology:"triangle-list"}),i.type===ye.WEBGL&&i.renderTarget.finishRenderPass();}_setupFilterTextures(e,t,i,s){if(e.backTexture=C.EMPTY,e.inputTexture=le.getOptimalTexture(t.width,t.height,e.resolution,e.antialias),e.blendRequired){i.renderTarget.finishRenderPass();let n=i.renderTarget.getRenderTarget(e.outputRenderSurface);e.backTexture=this.getBackTexture(n,t,s?.bounds);}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,f=l.uInputClamp,g=l.uGlobalFrame,_=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],f[0]=.5*d[2],f[1]=.5*d[3],f[2]=e.frame.width*h[2]-.5*d[2],f[3]=e.frame.height*h[3]-.5*d[3];let x=this.renderer.renderTarget.rootRenderTarget.colorTexture;g[0]=s*o,g[1]=n*o,g[2]=x.source.width*o,g[3]=x.source.height*o,t instanceof C&&(t.source.resource=null);let b=this.renderer.renderTarget.getRenderTarget(t);this.renderer.renderTarget.bind(t,!!u),t instanceof C?(_[0]=t.frame.width,_[1]=t.frame.height):(_[0]=b.width,_[1]=b.height),_[2]=b.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?B_(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,o=e.firstEnabledIndex,a=e.lastEnabledIndex;if(this._globalFilterBindGroup.setResource(i.source.style,2),this._globalFilterBindGroup.setResource(e.backTexture.source,3),o===a)n[o].apply(this,i,e.outputRenderSurface,t);else {let u=e.inputTexture,l=le.getOptimalTexture(s.width,s.height,u.source._resolution,false),c=l;for(let h=o;h<a;h++){let d=n[h];if(!d.enabled)continue;d.apply(this,u,c,true);let f=u;u=c,c=f;}n[a].apply(this,u,e.outputRenderSurface,t),le.returnTexture(l);}}_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,f=false,g=true,_=-1,x=-1;for(let b=0;b<u.length;b++){let y=u[b];if(!y.enabled)continue;if(_===-1&&(_=b),x=b,l=Math.min(l,y.resolution==="inherit"?s:y.resolution),c+=y.padding,y.antialias==="off"?h=false:y.antialias==="inherit"&&h&&(h=i),y.clipToViewport||(g=false),!!!(y.compatibleRenderers&o.type)){f=false;break}if(y.blendRequired&&!(o.backBuffer?.useBackBuffer??true)){M("Blend filter requires backBuffer on WebGL renderer to be enabled. Set `useBackBuffer: true` in the renderer options."),f=false;break}f=true,d||(d=y.blendRequired);}if(!f){e.skip=true;return}if(g&&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,e.firstEnabledIndex=_,e.lastEnabledIndex=x;}_popFilterData(){return this._filterStackIndex--,this._filterStack[this._filterStackIndex]}_getPreviousFilterData(){let e,t=this._filterStackIndex-1;for(;t>0&&(t--,e=this._filterStack[t],!!e.skip););return e}_pushFilterData(){let e=this._filterStack[this._filterStackIndex];return e||(e=this._filterStack[this._filterStackIndex]=new M_),this._filterStackIndex++,e}};xn.extension={type:[m.WebGLSystem,m.WebGPUSystem],name:"filter"};});var F_=p(()=>{S();v_();D_();G.add(xn);G.add(mn);});var PC={};var FT=p(()=>{h1();ep();d1();p1();Nl();Xl();dg();pg();Bg();vx();Ix();r_();__();y_();F_();});var BC={};var UT=p(()=>{ep();Nl();Xl();dg();pg();Bg();vx();Ix();r_();__();y_();F_();});async function _h(r){if(!r)for(let e=0;e<O_.length;e++){let t=O_[e];if(t.value.test()){await t.value.load();return}}}async function RC(r){return _h(!r)}var O_,k_=p(()=>{S();O_=[];G.handleByNamedList(m.Environment,O_);});function eu(){if(typeof Ja=="boolean")return Ja;try{Ja=new Function("param1","param2","param3","return param1[param2] === param3;")({a:"b"},"a","b")===!0;}catch{Ja=false;}return Ja}var Ja,bh=p(()=>{});var We,ps=p(()=>{We=(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))(We||{});});var ms,yh=p(()=>{ms=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 MC,kT,Dr,_n=p(()=>{ke();k_();Ze();bh();Me();re();Yr();ps();yh();je();MC=["init","destroy","contextChange","resolutionChange","resetState","renderEnd","renderStart","render","update","postrender","prerender"],kT=class LT extends fe{constructor(e){super(),this.tick=0,this.uid=W("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=[...MC,...this.config.runners??[]];this._addRunners(...t),this._unsafeEvalCheck();}async init(e={}){let t=e.skipExtensionImports===true?true:e.manageImports===false;await _h(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={...LT.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){this.tick++;let i=e;if(i instanceof Q&&(i={container:i},t&&(w(O,"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:H.shared.setValue(i.clearColor).toArray();}i.transform||(i.container.updateLocalTransform(),i.transform=i.container.localTransform),i.container.visible&&(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=We.ALL);let{clear:i,clearColor:s,target:n}=e;H.shared.setValue(s??this.background.colorRgba),t.renderTarget.clear(n,i,H.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 ms(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),this.runners.destroy.add(this.renderPipes[o]);});}destroy(e=false){this.runners.destroy.items.reverse(),this.runners.destroy.emit(e),(e===true||typeof e=="object"&&e.releaseGlobalResources)&&Ct.release(),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(!eu())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();}};kT.defaultOptions={resolution:1,failIfMajorPerformanceCaveat:false,roundPixels:false};Dr=kT;});var bn,L_=p(()=>{S();K();aa();Ar();Xs();Ys();cs();Cr();Ut();Ie();bn=class{constructor(){this._maxTextures=0;}contextChange(e){let t=new J({uTransformMatrix:{value:new P,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=Wt({name:"graphics",bits:[ki,Ni(this._maxTextures),i_,Yt]});this.shader=new Ae({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,f=null;for(let g=0;g<u.instructionSize;g++){let _=d[g];if(_.topology!==f&&(f=_.topology,l.setPipelineFromGeometryProgramAndState(a.geometry,s.gpuProgram,e.state,_.topology)),s.groups[1]=_.bindGroup,!_.gpuBindGroup){let x=_.textures;_.bindGroup=Ii(x.textures,x.count,this._maxTextures),_.gpuBindGroup=n.bindGroup.getBindGroup(_.bindGroup,s.gpuProgram,1);}l.setBindGroup(1,_.bindGroup,s.gpuProgram),l.renderPassEncoder.drawIndexed(_.size,1,_.start);}}destroy(){this.shader.destroy(true),this.shader=null;}};bn.extension={type:[m.WebGPUPipesAdaptor],name:"graphics"};});var N_,H_,Sh=p(()=>{N_={name:"texture-bit",vertex:{header:`
|
|
668
|
+
`;});var Zo,D0=p(()=>{_t();St();lr();Ko();R0();M0();Zo=class extends Ve{constructor(){let e=_e.from({vertex:{source:pl,entryPoint:"mainVertex"},fragment:{source:pl,entryPoint:"mainFragment"},name:"passthrough-filter"}),t=xe.from({vertex:_r,fragment:Vf,name:"passthrough-filter"});super({gpuProgram:e,glProgram:t});}};});function ml(r,e,t,i,s,n,o,a){let u=o-t,l=a-i,c=s-t,h=n-i,d=r-t,f=e-i,g=u*u+l*l,_=u*c+l*h,x=u*d+l*f,b=c*c+h*h,y=c*d+h*f,v=1/(g*b-_*_),T=(b*x-_*y)*v,B=(g*y-_*x)*v;return T>=0&&B>=0&&T+B<1}var F0=p(()=>{});var zf,eS=p(()=>{Yd();Ue();zf=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 Di(e,t,a,c,u,d)<=o||Di(e,t,u,h,l,d)<=o||Di(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 V);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}};});function Wf(r,e){e.clear();let t=e.matrix;for(let i=0;i<r.length;i++){let s=r[i];if(s.globalDisplayStatus<7)continue;let n=s.renderGroup??s.parentRenderGroup;n?.isCachedAsTexture?e.matrix=tS.copyFrom(n.textureOffsetInverseTransform).append(s.worldTransform):n?._parentCacheAsTextureRenderGroup?e.matrix=tS.copyFrom(n._parentCacheAsTextureRenderGroup.inverseWorldTransform).append(s.groupTransform):e.matrix=s.worldTransform,e.addBounds(s.bounds);}return e.matrix=t,e}var tS,G0=p(()=>{K();tS=new P;});var vw,U0,Ks,I0=p(()=>{S();D0();K();kr();bi();Oe();ee();Zt();Dt();Ze();G0();ne();vw=new at({attributes:{aPosition:{buffer:new Float32Array([0,0,1,0,1,1,0,1]),format:"float32x2",stride:8,offset:0}},indexBuffer:new Uint32Array([0,1,2,0,2,3])}),U0=class{constructor(){this.skip=false,this.inputTexture=null,this.backTexture=null,this.filters=null,this.bounds=new oe,this.container=null,this.blendRequired=false,this.outputRenderSurface=null,this.globalFrame={x:0,y:0,width:0,height:0},this.firstEnabledIndex=-1,this.lastEnabledIndex=-1;}},Ks=class{constructor(e){this._filterStackIndex=0,this._filterStack=[],this._filterGlobalUniforms=new J({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 He({}),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.every(f=>!f.enabled)){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.every(f=>!f.enabled))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=le.getOptimalTexture(a.width,a.height,i.resolution,i.antialias),i.backTexture=A.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&&le.returnTexture(t.backTexture),le.returnTexture(t.inputTexture));}getBackTexture(e,t,i){let s=e.colorTexture.source._resolution,n=le.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 g=this._findPreviousFilterOffset();h=g.x,d=g.y;}this._updateFilterUniforms(t,i,o,h,d,c,u,s);let f=e.enabled?e:this._getPassthroughFilter();this._setupBindGroupsAndRender(f,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(P.shared),o=t.renderGroup||t.parentRenderGroup;return o&&o.cacheToLocalTransform&&n.prepend(o.cacheToLocalTransform),n.invert(),s.prepend(n),s.scale(1/t.texture.orig.width,1/t.texture.orig.height),s.translate(t.anchor.x,t.anchor.y),s}destroy(){this._passthroughFilter?.destroy(true),this._passthroughFilter=null;}_getPassthroughFilter(){return this._passthroughFilter??(this._passthroughFilter=new Zo),this._passthroughFilter}_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:vw,shader:e,state:e._state,topology:"triangle-list"}),i.type===ye.WEBGL&&i.renderTarget.finishRenderPass();}_setupFilterTextures(e,t,i,s){if(e.backTexture=A.EMPTY,e.inputTexture=le.getOptimalTexture(t.width,t.height,e.resolution,e.antialias),e.blendRequired){i.renderTarget.finishRenderPass();let n=i.renderTarget.getRenderTarget(e.outputRenderSurface);e.backTexture=this.getBackTexture(n,t,s?.bounds);}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,f=l.uInputClamp,g=l.uGlobalFrame,_=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],f[0]=.5*d[2],f[1]=.5*d[3],f[2]=e.frame.width*h[2]-.5*d[2],f[3]=e.frame.height*h[3]-.5*d[3];let x=this.renderer.renderTarget.rootRenderTarget.colorTexture;g[0]=s*o,g[1]=n*o,g[2]=x.source.width*o,g[3]=x.source.height*o,t instanceof A&&(t.source.resource=null);let b=this.renderer.renderTarget.getRenderTarget(t);this.renderer.renderTarget.bind(t,!!u),t instanceof A?(_[0]=t.frame.width,_[1]=t.frame.height):(_[0]=b.width,_[1]=b.height),_[2]=b.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?Wf(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,o=e.firstEnabledIndex,a=e.lastEnabledIndex;if(this._globalFilterBindGroup.setResource(i.source.style,2),this._globalFilterBindGroup.setResource(e.backTexture.source,3),o===a)n[o].apply(this,i,e.outputRenderSurface,t);else {let u=e.inputTexture,l=le.getOptimalTexture(s.width,s.height,u.source._resolution,false),c=l;for(let h=o;h<a;h++){let d=n[h];if(!d.enabled)continue;d.apply(this,u,c,true);let f=u;u=c,c=f;}n[a].apply(this,u,e.outputRenderSurface,t),le.returnTexture(l);}}_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,f=false,g=true,_=-1,x=-1;for(let b=0;b<u.length;b++){let y=u[b];if(!y.enabled)continue;if(_===-1&&(_=b),x=b,l=Math.min(l,y.resolution==="inherit"?s:y.resolution),c+=y.padding,y.antialias==="off"?h=false:y.antialias==="inherit"&&h&&(h=i),y.clipToViewport||(g=false),!!!(y.compatibleRenderers&o.type)){f=false;break}if(y.blendRequired&&!(o.backBuffer?.useBackBuffer??true)){R("Blend filter requires backBuffer on WebGL renderer to be enabled. Set `useBackBuffer: true` in the renderer options."),f=false;break}f=true,d||(d=y.blendRequired);}if(!f){e.skip=true;return}if(g&&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,e.firstEnabledIndex=_,e.lastEnabledIndex=x;}_popFilterData(){return this._filterStackIndex--,this._filterStack[this._filterStackIndex]}_getPreviousFilterData(){let e,t=this._filterStackIndex-1;for(;t>0&&(t--,e=this._filterStack[t],!!e.skip););return e}_pushFilterData(){let e=this._filterStack[this._filterStackIndex];return e||(e=this._filterStack[this._filterStackIndex]=new U0),this._filterStackIndex++,e}};Ks.extension={type:[m.WebGLSystem,m.WebGPUSystem],name:"filter"};});var O0=p(()=>{S();P0();I0();G.add(Ks);G.add(qs);});var Tw={};var rS=p(()=>{F1();Px();G1();I1();Gh();Lh();eb();rb();pb();$b();i0();m0();A0();w0();O0();});var Sw={};var iS=p(()=>{Px();Gh();Lh();eb();rb();pb();$b();i0();m0();A0();w0();O0();});async function Ol(r){if(!r)for(let e=0;e<N0.length;e++){let t=N0[e];if(t.value.test()){await t.value.load();return}}}async function nS(r){return Ol(!r)}var N0,H0=p(()=>{S();N0=[];G.handleByNamedList(m.Environment,N0);});function Qo(){if(typeof kl=="boolean")return kl;try{kl=new Function("param1","param2","param3","return param1[param2] === param3;")({a:"b"},"a","b")===!0;}catch{kl=false;}return kl}var kl,jf=p(()=>{});var ze,Zs=p(()=>{ze=(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))(ze||{});});var Wi,qf=p(()=>{Wi=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 Ew,oS,br,Jo=p(()=>{Ne();H0();Qe();jf();Ge();re();ti();Zs();qf();Ke();Ew=["init","destroy","contextChange","resolutionChange","resetState","renderEnd","renderStart","render","update","postrender","prerender"],oS=class aS extends fe{constructor(e){super(),this.tick=0,this.uid=W("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=[...Ew,...this.config.runners??[]];this._addRunners(...t),this._unsafeEvalCheck();}async init(e={}){let t=e.skipExtensionImports===true?true:e.manageImports===false;await Ol(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={...aS.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){this.tick++;let i=e;if(i instanceof Q&&(i={container:i},t&&(w(O,"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:H.shared.setValue(i.clearColor).toArray();}i.transform||(i.container.updateLocalTransform(),i.transform=i.container.localTransform),i.container.visible&&(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=ze.ALL);let{clear:i,clearColor:s,target:n}=e;H.shared.setValue(s??this.background.colorRgba),t.renderTarget.clear(n,i,H.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 Wi(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),this.runners.destroy.add(this.renderPipes[o]);});}destroy(e=false){this.runners.destroy.items.reverse(),this.runners.destroy.emit(e),(e===true||typeof e=="object"&&e.releaseGlobalResources)&&Tt.release(),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(!Qo())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();}};oS.defaultOptions={resolution:1,failIfMajorPerformanceCaveat:false,roundPixels:false};br=oS;});var Qs,V0=p(()=>{S();K();Pu();Nr();vo();To();Ys();Hr();Ht();Oe();Qs=class{constructor(){this._maxTextures=0;}contextChange(e){let t=new J({uTransformMatrix:{value:new P,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=Ot({name:"graphics",bits:[Si,Ai(this._maxTextures),Gf,Lt]});this.shader=new Ae({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,f=null;for(let g=0;g<u.instructionSize;g++){let _=d[g];if(_.topology!==f&&(f=_.topology,l.setPipelineFromGeometryProgramAndState(a.geometry,s.gpuProgram,e.state,_.topology)),s.groups[1]=_.bindGroup,!_.gpuBindGroup){let x=_.textures;_.bindGroup=xi(x.textures,x.count,this._maxTextures),_.gpuBindGroup=n.bindGroup.getBindGroup(_.bindGroup,s.gpuProgram,1);}l.setBindGroup(1,_.bindGroup,s.gpuProgram),l.renderPassEncoder.drawIndexed(_.size,1,_.start);}}destroy(){this.shader.destroy(true),this.shader=null;}};Qs.extension={type:[m.WebGPUPipesAdaptor],name:"graphics"};});var Qf,Jf,ep=p(()=>{Qf={name:"texture-bit",vertex:{header:`
|
|
669
669
|
|
|
670
670
|
struct TextureUniforms {
|
|
671
671
|
uTextureMatrix:mat3x3<f32>,
|
|
@@ -681,7 +681,7 @@ fn mainFragment(
|
|
|
681
681
|
|
|
682
682
|
`,main:`
|
|
683
683
|
outColor = textureSample(uTexture, uSampler, vUV);
|
|
684
|
-
`}},
|
|
684
|
+
`}},Jf={name:"texture-bit",vertex:{header:`
|
|
685
685
|
uniform mat3 uTextureMatrix;
|
|
686
686
|
`,main:`
|
|
687
687
|
uv = (uTextureMatrix * vec3(uv, 1.0)).xy;
|
|
@@ -691,7 +691,7 @@ fn mainFragment(
|
|
|
691
691
|
|
|
692
692
|
`,main:`
|
|
693
693
|
outColor = texture(uTexture, vUV);
|
|
694
|
-
`}};});var yn,V_=p(()=>{S();K();Ar();cs();Cr();Sh();Ut();ee();se();yn=class{init(){let e=Wt({name:"mesh",bits:[hi,N_,Yt]});this._shader=new Ae({gpuProgram:e,resources:{uTexture:C.EMPTY._source,uSampler:C.EMPTY._source.style,textureUniforms:{uTextureMatrix:{type:"mat3x3<f32>",value:new P}}}});}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){M("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;}};yn.extension={type:[m.WebGPUPipesAdaptor],name:"mesh"};});var Eh,vn,z_=p(()=>{S();Rt();aa();Eh=Se.for2d(),vn=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),Eh.blendMode="normal",s.pipeline.getPipeline(t,o,Eh);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=Ii(u.textures,u.count,s.limits.maxBatchableTextures);}Eh.blendMode=t.blendMode;let o=s.bindGroup.getBindGroup(t.bindGroup,i,1),a=s.pipeline.getPipeline(this._geometry,i,Eh,t.topology);t.bindGroup._touch(s.gc.now,s.tick),n.setPipeline(a),n.renderPassEncoder.setBindGroup(1,o),n.renderPassEncoder.drawIndexed(t.size,1,t.start);}};vn.extension={type:[m.WebGPUPipesAdaptor],name:"batch"};});var Tn,W_=p(()=>{S();Tn=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;}};Tn.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"customRender"};});function Sn(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 Ah=p(()=>{});var DC,En,X_=p(()=>{S();K();kt();rn();Ah();DC=new P,En=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&&(de.return(e._batchableRenderGroup),e._batchableRenderGroup=null),t.add(e);}_addRenderableCacheAsTexture(e,t){let i=e._batchableRenderGroup??(e._batchableRenderGroup=de.get(qt));i.renderable=e.root,i.transform=e.root.relativeGroupTransform,i.texture=e.texture,i.bounds=e._textureBounds,t.add(e),this._renderer.renderPipes.blendMode.pushBlendMode(e,e.root.groupBlendMode,t),this._renderer.renderPipes.batch.addToBatch(i,t),this._renderer.renderPipes.blendMode.popBlendMode(t);}_executeCacheAsTexture(e){if(e.textureNeedsUpdate){e.textureNeedsUpdate=false;let t=DC.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,offset:{x:0,y:0}}),Sn(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}),Sn(e,this._renderer.renderPipes),this._renderer.globalUniforms.pop();}};En.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"renderGroup"};});function An(r,e){e||(e=0);for(let t=e;t<r.length&&r[t];t++)r[t]=null;}var Ch=p(()=>{});function wh(r,e=false){VT(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&&Y_(c,i,0);}An(a,u),o.index=0;}if(e)for(let s=0;s<r.renderGroupChildren.length;s++)wh(r.renderGroupChildren[s],e);}function VT(r){let e=r.root,t;if(r.renderGroupParent){let i=r.renderGroupParent;r.worldTransform.appendFrom(e.relativeGroupTransform,i.worldTransform),r.worldColor=vi(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 Y_(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&NT&&HT(r,s,t)):(t=r._updateFlags,r.relativeGroupTransform.copyFrom(i),t&NT&&HT(r,FC,t)),!r.renderGroup){let n=r.children,o=n.length;for(let l=0;l<o;l++)Y_(n[l],e,t);let a=r.parentRenderGroup,u=r;u.renderPipeId&&!a.structureDidChange&&a.updateRenderable(u);}}function HT(r,e,t){if(t&Ms){r.groupColor=vi(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&$o&&(r.groupBlendMode=r.localBlendMode==="inherit"?e.groupBlendMode:r.localBlendMode),t&Bi&&(r.globalDisplayStatus=r.localDisplayStatus&e.globalDisplayStatus),r._updateFlags=0;}var FC,NT,$_=p(()=>{Ze();Ch();_l();FC=new Q,NT=Bi|Ms|$o;});function j_(r,e){let{list:t}=r.childrenRenderablesToUpdate,i=false;for(let s=0;s<r.childrenRenderablesToUpdate.index;s++){let n=t[s];if(i=e[n.renderPipeId].validateRenderable(n),i)break}return r.structureDidChange=i,i}var q_=p(()=>{});var GC,Cn,K_=p(()=>{S();K();Lt();ir();qe();Ch();Ah();$_();q_();GC=new P,Cn=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=GC;t&&(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}),Sn(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._parentCacheAsTextureRenderGroup=t,e.isCachedAsTexture){if(!e.textureNeedsUpdate)return;t=e;}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&&le.returnTexture(e.texture,true);let n=this._renderer,o=e.textureOptions.resolution||n.view.resolution,a=e.textureOptions.antialias??n.view.antialias,u=e.textureOptions.scaleMode??"linear",l=le.getOptimalTexture(i.width,i.height,o,a);l._source.style=new Ge({scaleMode:u}),e.texture=l,e._textureBounds||(e._textureBounds=new oe),e._textureBounds.copyFrom(i),s!==e.texture&&e.renderGroupParent&&(e.renderGroupParent.structureDidChange=true);}}else e.texture&&(le.returnTexture(e.texture,true),e.texture=null);}_updateRenderGroups(e){let t=this._renderer,i=t.renderPipes;if(e.runOnRender(t),e.instructionSet.renderPipes=i,e.structureDidChange?An(e.childrenRenderablesToUpdate.list,0):j_(e,i),wh(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);}An(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);}};Cn.extension={type:[m.WebGLSystem,m.WebGPUSystem,m.CanvasSystem],name:"renderGroup"};});var wn,Z_=p(()=>{S();rn();wn=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 qt;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;}};wn.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"sprite"};});var UC,gs,Ph=p(()=>{je();UC=/^\s*data:(?:([\w-]+)\/([\w+.-]+))?(?:;charset=([\w-]+))?(?:;(base64))?,(.*)/i,gs="8.15.0";});var Pn,Bn,Bh=p(()=>{S();Ph();Pn=class{static init(){globalThis.__PIXI_APP_INIT__?.(this,gs);}static destroy(){}};Pn.extension=m.Application;Bn=class{constructor(e){this._renderer=e;}init(){globalThis.__PIXI_RENDERER_INIT__?.(this._renderer,gs);}destroy(){this._renderer=null;}};Bn.extension={type:[m.WebGLSystem,m.WebGPUSystem],name:"initHook",priority:-10};});var Q_,Rh,J_=p(()=>{S();Rt();oc();Q_=class zT{constructor(e,t){this.state=Se.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 js({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]=zT.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;}};Q_.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"batch"};Q_._availableBatchers=Object.create(null);Rh=Q_;G.handleByMap(m.Batcher,Rh._availableBatchers);G.add(js);});var eb,tb=p(()=>{eb=`in vec2 vMaskCoord;
|
|
694
|
+
`}};});var Js,z0=p(()=>{S();K();Nr();Ys();Hr();ep();Ht();ee();ne();Js=class{init(){let e=Ot({name:"mesh",bits:[jr,Qf,Lt]});this._shader=new Ae({gpuProgram:e,resources:{uTexture:A.EMPTY._source,uSampler:A.EMPTY._source.style,textureUniforms:{uTextureMatrix:{type:"mat3x3<f32>",value:new P}}}});}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){R("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;}};Js.extension={type:[m.WebGPUPipesAdaptor],name:"mesh"};});var tp,en,W0=p(()=>{S();Ft();Pu();tp=Se.for2d(),en=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),tp.blendMode="normal",s.pipeline.getPipeline(t,o,tp);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=xi(u.textures,u.count,s.limits.maxBatchableTextures);}tp.blendMode=t.blendMode;let o=s.bindGroup.getBindGroup(t.bindGroup,i,1),a=s.pipeline.getPipeline(this._geometry,i,tp,t.topology);t.bindGroup._touch(s.gc.now,s.tick),n.setPipeline(a),n.renderPassEncoder.setBindGroup(1,o),n.renderPassEncoder.drawIndexed(t.size,1,t.start);}};en.extension={type:[m.WebGPUPipesAdaptor],name:"batch"};});var tn,X0=p(()=>{S();tn=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;}};tn.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"customRender"};});function rn(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 rp=p(()=>{});var Aw,sn,Y0=p(()=>{S();K();jt();Do();rp();Aw=new P,sn=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&&(he.return(e._batchableRenderGroup),e._batchableRenderGroup=null),t.add(e);}_addRenderableCacheAsTexture(e,t){let i=e._batchableRenderGroup??(e._batchableRenderGroup=he.get(zt));i.renderable=e.root,i.transform=e.root.relativeGroupTransform,i.texture=e.texture,i.bounds=e._textureBounds,t.add(e),this._renderer.renderPipes.blendMode.pushBlendMode(e,e.root.groupBlendMode,t),this._renderer.renderPipes.batch.addToBatch(i,t),this._renderer.renderPipes.blendMode.popBlendMode(t);}_executeCacheAsTexture(e){if(e.textureNeedsUpdate){e.textureNeedsUpdate=false;let t=Aw.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,offset:{x:0,y:0}}),rn(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}),rn(e,this._renderer.renderPipes),this._renderer.globalUniforms.pop();}};sn.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"renderGroup"};});function nn(r,e){e||(e=0);for(let t=e;t<r.length&&r[t];t++)r[t]=null;}var ip=p(()=>{});function Ll(r,e=false){$0(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&&sp(c,i,0);}nn(a,u),o.index=0;}if(e)for(let s=0;s<r.renderGroupChildren.length;s++)Ll(r.renderGroupChildren[s],e);}function $0(r){let e=r.root,t;if(r.renderGroupParent){let i=r.renderGroupParent;r.worldTransform.appendFrom(e.relativeGroupTransform,i.worldTransform),r.worldColor=ii(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 sp(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&uS&&lS(r,s,t)):(t=r._updateFlags,r.relativeGroupTransform.copyFrom(i),t&uS&&lS(r,Cw,t)),!r.renderGroup){let n=r.children,o=n.length;for(let l=0;l<o;l++)sp(n[l],e,t);let a=r.parentRenderGroup,u=r;u.renderPipeId&&!a.structureDidChange&&a.updateRenderable(u);}}function lS(r,e,t){if(t&ps){r.groupColor=ii(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&no&&(r.groupBlendMode=r.localBlendMode==="inherit"?e.groupBlendMode:r.localBlendMode),t&ui&&(r.globalDisplayStatus=r.localDisplayStatus&e.globalDisplayStatus),r._updateFlags=0;}var Cw,uS,j0=p(()=>{Qe();ip();sh();Cw=new Q,uS=ui|ps|no;});function np(r,e){let{list:t}=r.childrenRenderablesToUpdate,i=false;for(let s=0;s<r.childrenRenderablesToUpdate.index;s++){let n=t[s];if(i=e[n.renderPipeId].validateRenderable(n),i)break}return r.structureDidChange=i,i}var q0=p(()=>{});var ww,on,K0=p(()=>{S();K();Zt();dr();Ze();ip();rp();j0();q0();ww=new P,on=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=ww;t&&(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}),rn(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._parentCacheAsTextureRenderGroup=t,e.isCachedAsTexture){if(!e.textureNeedsUpdate)return;t=e;}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&&le.returnTexture(e.texture,true);let n=this._renderer,o=e.textureOptions.resolution||n.view.resolution,a=e.textureOptions.antialias??n.view.antialias,u=e.textureOptions.scaleMode??"linear",l=le.getOptimalTexture(i.width,i.height,o,a);l._source.style=new De({scaleMode:u}),e.texture=l,e._textureBounds||(e._textureBounds=new oe),e._textureBounds.copyFrom(i),s!==e.texture&&e.renderGroupParent&&(e.renderGroupParent.structureDidChange=true);}}else e.texture&&(le.returnTexture(e.texture,true),e.texture=null);}_updateRenderGroups(e){let t=this._renderer,i=t.renderPipes;if(e.runOnRender(t),e.instructionSet.renderPipes=i,e.structureDidChange?nn(e.childrenRenderablesToUpdate.list,0):np(e,i),Ll(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);}nn(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);}};on.extension={type:[m.WebGLSystem,m.WebGPUSystem,m.CanvasSystem],name:"renderGroup"};});var an,Z0=p(()=>{S();Do();an=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 zt;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;}};an.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"sprite"};});var cS,Xi,op=p(()=>{Ke();cS=/^\s*data:(?:([\w-]+)\/([\w+.-]+))?(?:;charset=([\w-]+))?(?:;(base64))?,(.*)/i,Xi="8.15.0";});var un,ln,ap=p(()=>{S();op();un=class{static init(){globalThis.__PIXI_APP_INIT__?.(this,Xi);}static destroy(){}};un.extension=m.Application;ln=class{constructor(e){this._renderer=e;}init(){globalThis.__PIXI_RENDERER_INIT__?.(this._renderer,Xi);}destroy(){this._renderer=null;}};ln.extension={type:[m.WebGLSystem,m.WebGPUSystem],name:"initHook",priority:-10};});var Q0,Nl,J0=p(()=>{S();Ft();_d();Q0=class hS{constructor(e,t){this.state=Se.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 Cs({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]=hS.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;}};Q0.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"batch"};Q0._availableBatchers=Object.create(null);Nl=Q0;G.handleByMap(m.Batcher,Nl._availableBatchers);G.add(Cs);});var up,ey=p(()=>{up=`in vec2 vMaskCoord;
|
|
695
695
|
in vec2 vTextureCoord;
|
|
696
696
|
|
|
697
697
|
uniform sampler2D uTexture;
|
|
@@ -725,7 +725,7 @@ void main(void)
|
|
|
725
725
|
|
|
726
726
|
finalColor = original * a;
|
|
727
727
|
}
|
|
728
|
-
`;});var
|
|
728
|
+
`;});var lp,ty=p(()=>{lp=`in vec2 aPosition;
|
|
729
729
|
|
|
730
730
|
out vec2 vTextureCoord;
|
|
731
731
|
out vec2 vMaskCoord;
|
|
@@ -762,7 +762,7 @@ void main(void)
|
|
|
762
762
|
vTextureCoord = filterTextureCoord(aPosition);
|
|
763
763
|
vMaskCoord = getFilterCoord(aPosition);
|
|
764
764
|
}
|
|
765
|
-
`;});var
|
|
765
|
+
`;});var Hl,ry=p(()=>{Hl=`struct GlobalFilterUniforms {
|
|
766
766
|
uInputSize:vec4<f32>,
|
|
767
767
|
uInputPixel:vec4<f32>,
|
|
768
768
|
uInputClamp:vec4<f32>,
|
|
@@ -860,9 +860,9 @@ fn mainFragment(
|
|
|
860
860
|
|
|
861
861
|
return source * a;
|
|
862
862
|
}
|
|
863
|
-
`;});var tu,nb=p(()=>{K();ct();vt();Ie();Cl();Qt();tb();ib();sb();tu=class extends ze{constructor(e){let{sprite:t,...i}=e,s=new Pi(t.texture),n=new J({uFilterMatrix:{value:new P,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:Mh,entryPoint:"mainVertex"},fragment:{source:Mh,entryPoint:"mainFragment"}}),a=xe.from({vertex:rb,fragment:eb,name:"mask-filter"});super({...i,gpuProgram:o,glProgram:a,clipToViewport:false,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 IC,ob,Rn,ab=p(()=>{S();Ho();nb();qe();yi();ri();kt();ee();Lt();Bt();IC=new oe,ob=class extends tr{constructor(){super(),this.filters=[new tu({sprite:new st(C.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;}},Rn=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=de.get(ob);if(s.inverse=e.inverse,i){e.mask.mask.measurable=true;let n=br(e.mask.mask,true,IC);e.mask.mask.measurable=false,n.ceil();let o=t.renderTarget.renderTarget.colorTexture.source,a=le.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===ye.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&&le.returnTexture(s.filterTexture),de.return(s.filterEffect);}}destroy(){this._renderer=null,this._activeMaskStage=null;}};Rn.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"alphaMask"};});var Mn,ub=p(()=>{S();Mn=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._renderer=null,this._colorStack=null;}};Mn.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"colorMask"};});var Dn,lb=p(()=>{S();ps();si();Dn=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(ge.RENDERING_MASK_ADD,n),n++,i.colorMask.setMask(0)):e.action==="pushMaskEnd"?(e.inverse?i.stencil.setStencilMode(ge.INVERSE_MASK_ACTIVE,n):i.stencil.setStencilMode(ge.MASK_ACTIVE,n),i.colorMask.setMask(15)):e.action==="popMaskBegin"?(i.colorMask.setMask(0),n!==0?i.stencil.setStencilMode(ge.RENDERING_MASK_REMOVE,n):(i.renderTarget.clear(null,We.STENCIL),i.stencil.setStencilMode(ge.DISABLED,n)),n--):e.action==="popMaskEnd"&&(e.inverse?i.stencil.setStencilMode(ge.INVERSE_MASK_ACTIVE,n):i.stencil.setStencilMode(ge.MASK_ACTIVE,n),i.colorMask.setMask(15)),this._maskStackHash[s]=n;}destroy(){this._renderer=null,this._maskStackHash=null,this._maskHash=null;}};Dn.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"stencilMask"};});var cb,hb,db=p(()=>{ke();S();se();cb=class WT{constructor(){this.clearBeforeRender=true,this._backgroundColor=new H(0),this.color=this._backgroundColor,this.alpha=1;}init(e){e={...WT.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){H.shared.setValue(e).alpha<1&&this._backgroundColor.alpha===1&&M("Cannot set a transparent background on an opaque canvas. To enable transparency, set backgroundAlpha < 1 when initializing your Application."),this._backgroundColor.setValue(e);}get alpha(){return this._backgroundColor.alpha}set alpha(e){this._backgroundColor.setAlpha(e);}get colorRgba(){return this._backgroundColor.toArray()}destroy(){}};cb.extension={type:[m.WebGLSystem,m.WebGPUSystem,m.CanvasSystem],name:"background",priority:0};cb.defaultOptions={backgroundAlpha:1,backgroundColor:0,clearBeforeRender:true};hb=cb;});var ru,Fn,fb=p(()=>{S();Ho();Pl();se();ru={};G.handle(m.BlendMode,r=>{if(!r.name)throw new Error("BlendMode extension must have a name property");ru[r.name]=r.ref;},r=>{delete ru[r.name];});Fn=class{constructor(e){this._blendModeStack=[],this._isAdvanced=false,this._filterHash=Object.create(null),this._renderer=e,this._renderer.runners.prerender.add(this);}prerender(){this._activeBlendMode="normal",this._isAdvanced=false;}pushBlendMode(e,t,i){this._blendModeStack.push(t),this.setBlendMode(e,t,i);}popBlendMode(e){this._blendModeStack.pop();let t=this._blendModeStack[this._activeBlendMode.length-1]??"normal";this.setBlendMode(null,t,e);}setBlendMode(e,t,i){let s=e instanceof Zr;if(this._activeBlendMode===t){this._isAdvanced&&e&&!s&&this._renderableList?.push(e);return}this._isAdvanced&&this._endAdvancedBlendMode(i),this._activeBlendMode=t,e&&(this._isAdvanced=!!ru[t],this._isAdvanced&&this._beginAdvancedBlendMode(e,i));}_beginAdvancedBlendMode(e,t){this._renderer.renderPipes.batch.break(t);let i=this._activeBlendMode;if(!ru[i]){M(`Unable to assign BlendMode: '${i}'. You may want to include: import 'pixi.js/advanced-blend-modes'`);return}let s=this._ensureFilterEffect(i),n=e instanceof Zr,o={renderPipeId:"filter",action:"pushFilter",filterEffect:s,renderables:n?null:[e],container:n?e.root:null,canBundle:false};this._renderableList=o.renderables,t.add(o);}_ensureFilterEffect(e){let t=this._filterHash[e];return t||(t=this._filterHash[e]=new tr,t.filters=[new ru[e]]),t}_endAdvancedBlendMode(e){this._isAdvanced=false,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;}};Fn.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"blendMode"};});var pb,mb,gb,xb=p(()=>{ae();S();Ze();ee();pb={png:"image/png",jpg:"image/jpeg",webp:"image/webp"},mb=class XT{constructor(e){this._renderer=e;}_normalizeOptions(e,t={}){return e instanceof Q||e instanceof C?{target:e,...t}:{...t,...e}}async image(e){let t=U.get().createImage();return t.src=await this.base64(e),t}async base64(e){e=this._normalizeOptions(e,XT.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);},pb[t],i);});if(s.toDataURL!==void 0)return s.toDataURL(pb[t],i);if(s.convertToBlob!==void 0){let n=await s.convertToBlob({type:pb[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 C)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 C?t:i.textureGenerator.generateTexture(e),n=i.texture.getPixels(s);return t instanceof Q&&s.destroy(true),n}texture(e){return e=this._normalizeOptions(e),e.target instanceof C?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;}};mb.extension={type:[m.WebGLSystem,m.WebGPUSystem],name:"extract"};mb.defaultImageOptions={format:"png",quality:1};gb=mb;});var iu,_b=p(()=>{He();ee();iu=class r extends C{static create(e){let{dynamic:t,...i}=e;return new r({source:new Z(i),dynamic:t??false})}resize(e,t,i){return this.source.resize(e,t,i),this}};});var OC,kC,LC,Gn,bb=p(()=>{ke();S();K();De();qe();Xo();Ze();_b();OC=new V,kC=new oe,LC=[0,0,0,0],Gn=class{constructor(e){this._renderer=e;}generateTexture(e){e instanceof Q&&(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:H.shared.setValue(n).toArray():n=LC;let o=e.frame?.copyTo(OC)||Ti(s,kC).rectangle;o.width=Math.max(o.width,1/t)|0,o.height=Math.max(o.height,1/t)|0;let a=iu.create({...e.textureSourceOptions,width:o.width,height:o.height,resolution:t,antialias:i}),u=P.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;}};Gn.extension={type:[m.WebGLSystem,m.WebGPUSystem],name:"textureGenerator"};});var yb,vb,Tb=p(()=>{S();yb=class YT{constructor(e){this._managedResources=[],this._managedResourceHashes=[],this._ready=false,this._renderer=e;}init(e){e={...YT.defaultOptions,...e},this.maxUnusedTime=e.gcMaxUnusedTime,this._frequency=e.gcFrequency,this.enabled=e.gcActive,this.now=performance.now();}get enabled(){return !!this._handler}set enabled(e){this.enabled!==e&&(e?this._handler=this._renderer.scheduler.repeat(()=>{this._ready=true;},this._frequency,false):(this._renderer.scheduler.cancel(this._handler),this._handler=0));}prerender({container:e}){this.now=performance.now(),e.renderGroup.gcTick=this._renderer.tick++,this._updateInstructionGCTick(e.renderGroup,e.renderGroup.gcTick);}postrender(){!this._ready||!this.enabled||(this.run(),this._ready=false);}_updateInstructionGCTick(e,t){e.instructionSet.gcTick=t;for(let i of e.renderGroupChildren)this._updateInstructionGCTick(i,t);}addResource(e,t){if(e._gcLastUsed!==-1){e._gcLastUsed=this.now,e._onTouch?.(this.now);return}let i=this._managedResources.length;e._gcData={index:i,type:t},e._gcLastUsed=this.now,e._onTouch?.(this.now),e.once("unload",this.removeResource,this),this._managedResources.push(e);}removeResource(e){let t=e._gcData;if(!t)return;let i=t.index,s=this._managedResources.length-1;if(i!==s){let n=this._managedResources[s];this._managedResources[i]=n,n._gcData.index=i;}this._managedResources.length--,e._gcData=null,e._gcLastUsed=-1;}addResourceHash(e,t,i,s=0){this._managedResourceHashes.push({context:e,hash:t,type:i,priority:s}),this._managedResourceHashes.sort((n,o)=>n.priority-o.priority);}run(){let e=performance.now(),t=this._managedResourceHashes;for(let s of t)this.runOnHash(s,e);let i=0;for(let s=0;s<this._managedResources.length;s++){let n=this._managedResources[s];i=this.runOnResource(n,e,i);}this._managedResources.length=i;}updateRenderableGCTick(e,t){let i=e.renderGroup??e.parentRenderGroup,s=i?.instructionSet?.gcTick??-1;(i?.gcTick??0)===s&&(e._gcLastUsed=t,e._onTouch?.(t));}runOnResource(e,t,i){let s=e._gcData;return s.type==="renderable"&&this.updateRenderableGCTick(e,t),t-e._gcLastUsed<this.maxUnusedTime||!e.autoGarbageCollect?(this._managedResources[i]=e,s.index=i,i++):(e.unload(),e._gcData=null,e._gcLastUsed=-1,e.off("unload",this.removeResource,this)),i}_createHashClone(e,t){let i=Object.create(null);for(let s in e){if(s===t)break;e[s]!==null&&(i[s]=e[s]);}return i}runOnHash(e,t){let{context:i,hash:s,type:n}=e,o=i[s],a=null,u=0;for(let l in o){let c=o[l];if(c===null){u++,u===1e4&&!a&&(a=this._createHashClone(o,l));continue}if(c._gcLastUsed===-1){c._gcLastUsed=t,c._onTouch?.(t),a&&(a[l]=c);continue}n==="renderable"&&this.updateRenderableGCTick(c,t),!(t-c._gcLastUsed<this.maxUnusedTime)&&c.autoGarbageCollect?(a||(u+1!==1e4?(o[l]=null,u++):a=this._createHashClone(o,l)),c.unload(),c._gcData=null,c._gcLastUsed=-1):a&&(a[l]=c);}a&&(i[s]=a);}destroy(){this.enabled=false,this._managedResources.forEach(e=>{e.off("unload",this.removeResource,this);}),this._managedResources.length=0,this._managedResourceHashes.length=0,this._renderer=null;}};yb.extension={type:[m.WebGLSystem,m.WebGPUSystem],name:"gc",priority:0};yb.defaultOptions={gcActive:true,gcMaxUnusedTime:6e4,gcFrequency:3e4};vb=yb;});var Un,Sb=p(()=>{S();K();bt();qi();Sr();Bt();Ie();Un=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 P,worldColor:4294967295,offset:new q},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,jt(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 Ve,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===ye.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 J({uProjectionMatrix:{value:new P,type:"mat3x3<f32>"},uWorldTransformMatrix:{value:new P,type:"mat3x3<f32>"},uWorldColorAlpha:{value:new Float32Array(4),type:"vec4<f32>"},uResolution:{value:[0,0],type:"vec2<f32>"}},{isStatic:true})}destroy(){this._renderer=null,this._globalUniformDataStack.length=0,this._uniformsPool.length=0,this._activeUniforms.length=0,this._bindGroupPool.length=0,this._activeBindGroups.length=0,this._currentGlobalUniformData=null;}};Un.extension={type:[m.WebGLSystem,m.WebGPUSystem,m.CanvasSystem],name:"globalUniforms"};});var NC,In,Eb=p(()=>{S();yr();NC=1,In=class{constructor(){this._tasks=[],this._offset=0;}init(){be.system.add(this._update,this);}repeat(e,t,i=true){let s=NC++,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(){be.system.remove(this._update,this),this._tasks.length=0;}};In.extension={type:[m.WebGLSystem,m.WebGPUSystem,m.CanvasSystem],name:"scheduler",priority:0};});function Ab(r){if(!$T){if(U.get().getNavigator().userAgent.toLowerCase().indexOf("chrome")>-1){let e=[`%c %c %c %c %c PixiJS %c v${gs} (${r}) http://www.pixijs.com/
|
|
863
|
+
`;});var ea,iy=p(()=>{K();_t();St();Oe();ph();lr();ey();ty();ry();ea=class extends Ve{constructor(e){let{sprite:t,...i}=e,s=new ai(t.texture),n=new J({uFilterMatrix:{value:new P,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:Hl,entryPoint:"mainVertex"},fragment:{source:Hl,entryPoint:"mainFragment"}}),a=xe.from({vertex:lp,fragment:up,name:"mask-filter"});super({...i,gpuProgram:o,glProgram:a,clipToViewport:false,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 Pw,sy,cn,ny=p(()=>{S();cu();iy();Ze();us();pi();jt();ee();Zt();Dt();Pw=new oe,sy=class extends qt{constructor(){super(),this.filters=[new ea({sprite:new it(A.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;}},cn=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=he.get(sy);if(s.inverse=e.inverse,i){e.mask.mask.measurable=true;let n=hr(e.mask.mask,true,Pw);e.mask.mask.measurable=false,n.ceil();let o=t.renderTarget.renderTarget.colorTexture.source,a=le.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===ye.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&&le.returnTexture(s.filterTexture),he.return(s.filterEffect);}}destroy(){this._renderer=null,this._activeMaskStage=null;}};cn.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"alphaMask"};});var hn,oy=p(()=>{S();hn=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._renderer=null,this._colorStack=null;}};hn.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"colorMask"};});var dn,ay=p(()=>{S();Zs();_i();dn=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(ge.RENDERING_MASK_ADD,n),n++,i.colorMask.setMask(0)):e.action==="pushMaskEnd"?(e.inverse?i.stencil.setStencilMode(ge.INVERSE_MASK_ACTIVE,n):i.stencil.setStencilMode(ge.MASK_ACTIVE,n),i.colorMask.setMask(15)):e.action==="popMaskBegin"?(i.colorMask.setMask(0),n!==0?i.stencil.setStencilMode(ge.RENDERING_MASK_REMOVE,n):(i.renderTarget.clear(null,ze.STENCIL),i.stencil.setStencilMode(ge.DISABLED,n)),n--):e.action==="popMaskEnd"&&(e.inverse?i.stencil.setStencilMode(ge.INVERSE_MASK_ACTIVE,n):i.stencil.setStencilMode(ge.MASK_ACTIVE,n),i.colorMask.setMask(15)),this._maskStackHash[s]=n;}destroy(){this._renderer=null,this._maskStackHash=null,this._maskHash=null;}};dn.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"stencilMask"};});var uy,cp,ly=p(()=>{Ne();S();ne();uy=class dS{constructor(){this.clearBeforeRender=true,this._backgroundColor=new H(0),this.color=this._backgroundColor,this.alpha=1;}init(e){e={...dS.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){H.shared.setValue(e).alpha<1&&this._backgroundColor.alpha===1&&R("Cannot set a transparent background on an opaque canvas. To enable transparency, set backgroundAlpha < 1 when initializing your Application."),this._backgroundColor.setValue(e);}get alpha(){return this._backgroundColor.alpha}set alpha(e){this._backgroundColor.setAlpha(e);}get colorRgba(){return this._backgroundColor.toArray()}destroy(){}};uy.extension={type:[m.WebGLSystem,m.WebGPUSystem,m.CanvasSystem],name:"background",priority:0};uy.defaultOptions={backgroundAlpha:1,backgroundColor:0,clearBeforeRender:true};cp=uy;});var Vl,fn,cy=p(()=>{S();cu();mh();ne();Vl={};G.handle(m.BlendMode,r=>{if(!r.name)throw new Error("BlendMode extension must have a name property");Vl[r.name]=r.ref;},r=>{delete Vl[r.name];});fn=class{constructor(e){this._blendModeStack=[],this._isAdvanced=false,this._filterHash=Object.create(null),this._renderer=e,this._renderer.runners.prerender.add(this);}prerender(){this._activeBlendMode="normal",this._isAdvanced=false;}pushBlendMode(e,t,i){this._blendModeStack.push(t),this.setBlendMode(e,t,i);}popBlendMode(e){this._blendModeStack.pop();let t=this._blendModeStack[this._activeBlendMode.length-1]??"normal";this.setBlendMode(null,t,e);}setBlendMode(e,t,i){let s=e instanceof Fr;if(this._activeBlendMode===t){this._isAdvanced&&e&&!s&&this._renderableList?.push(e);return}this._isAdvanced&&this._endAdvancedBlendMode(i),this._activeBlendMode=t,e&&(this._isAdvanced=!!Vl[t],this._isAdvanced&&this._beginAdvancedBlendMode(e,i));}_beginAdvancedBlendMode(e,t){this._renderer.renderPipes.batch.break(t);let i=this._activeBlendMode;if(!Vl[i]){R(`Unable to assign BlendMode: '${i}'. You may want to include: import 'pixi.js/advanced-blend-modes'`);return}let s=this._ensureFilterEffect(i),n=e instanceof Fr,o={renderPipeId:"filter",action:"pushFilter",filterEffect:s,renderables:n?null:[e],container:n?e.root:null,canBundle:false};this._renderableList=o.renderables,t.add(o);}_ensureFilterEffect(e){let t=this._filterHash[e];return t||(t=this._filterHash[e]=new qt,t.filters=[new Vl[e]]),t}_endAdvancedBlendMode(e){this._isAdvanced=false,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;}};fn.extension={type:[m.WebGLPipes,m.WebGPUPipes,m.CanvasPipes],name:"blendMode"};});var hy,dy,hp,fy=p(()=>{ae();S();Qe();ee();hy={png:"image/png",jpg:"image/jpeg",webp:"image/webp"},dy=class fS{constructor(e){this._renderer=e;}_normalizeOptions(e,t={}){return e instanceof Q||e instanceof A?{target:e,...t}:{...t,...e}}async image(e){let t=U.get().createImage();return t.src=await this.base64(e),t}async base64(e){e=this._normalizeOptions(e,fS.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);},hy[t],i);});if(s.toDataURL!==void 0)return s.toDataURL(hy[t],i);if(s.convertToBlob!==void 0){let n=await s.convertToBlob({type:hy[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 A)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 A?t:i.textureGenerator.generateTexture(e),n=i.texture.getPixels(s);return t instanceof Q&&s.destroy(true),n}texture(e){return e=this._normalizeOptions(e),e.target instanceof A?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;}};dy.extension={type:[m.WebGLSystem,m.WebGPUSystem],name:"extract"};dy.defaultImageOptions={format:"png",quality:1};hp=dy;});var ta,py=p(()=>{We();ee();ta=class r extends A{static create(e){let{dynamic:t,...i}=e;return new r({source:new Z(i),dynamic:t??false})}resize(e,t,i){return this.source.resize(e,t,i),this}};});var Bw,Rw,Mw,pn,my=p(()=>{Ne();S();K();Ue();Ze();du();Qe();py();Bw=new V,Rw=new oe,Mw=[0,0,0,0],pn=class{constructor(e){this._renderer=e;}generateTexture(e){e instanceof Q&&(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:H.shared.setValue(n).toArray():n=Mw;let o=e.frame?.copyTo(Bw)||si(s,Rw).rectangle;o.width=Math.max(o.width,1/t)|0,o.height=Math.max(o.height,1/t)|0;let a=ta.create({...e.textureSourceOptions,width:o.width,height:o.height,resolution:t,antialias:i}),u=P.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;}};pn.extension={type:[m.WebGLSystem,m.WebGPUSystem],name:"textureGenerator"};});var gy,dp,xy=p(()=>{S();gy=class pS{constructor(e){this._managedResources=[],this._managedResourceHashes=[],this._ready=false,this._renderer=e;}init(e){e={...pS.defaultOptions,...e},this.maxUnusedTime=e.gcMaxUnusedTime,this._frequency=e.gcFrequency,this.enabled=e.gcActive,this.now=performance.now();}get enabled(){return !!this._handler}set enabled(e){this.enabled!==e&&(e?this._handler=this._renderer.scheduler.repeat(()=>{this._ready=true;},this._frequency,false):(this._renderer.scheduler.cancel(this._handler),this._handler=0));}prerender({container:e}){this.now=performance.now(),e.renderGroup.gcTick=this._renderer.tick++,this._updateInstructionGCTick(e.renderGroup,e.renderGroup.gcTick);}postrender(){!this._ready||!this.enabled||(this.run(),this._ready=false);}_updateInstructionGCTick(e,t){e.instructionSet.gcTick=t;for(let i of e.renderGroupChildren)this._updateInstructionGCTick(i,t);}addResource(e,t){if(e._gcLastUsed!==-1){e._gcLastUsed=this.now,e._onTouch?.(this.now);return}let i=this._managedResources.length;e._gcData={index:i,type:t},e._gcLastUsed=this.now,e._onTouch?.(this.now),e.once("unload",this.removeResource,this),this._managedResources.push(e);}removeResource(e){let t=e._gcData;if(!t)return;let i=t.index,s=this._managedResources.length-1;if(i!==s){let n=this._managedResources[s];this._managedResources[i]=n,n._gcData.index=i;}this._managedResources.length--,e._gcData=null,e._gcLastUsed=-1;}addResourceHash(e,t,i,s=0){this._managedResourceHashes.push({context:e,hash:t,type:i,priority:s}),this._managedResourceHashes.sort((n,o)=>n.priority-o.priority);}run(){let e=performance.now(),t=this._managedResourceHashes;for(let s of t)this.runOnHash(s,e);let i=0;for(let s=0;s<this._managedResources.length;s++){let n=this._managedResources[s];i=this.runOnResource(n,e,i);}this._managedResources.length=i;}updateRenderableGCTick(e,t){let i=e.renderGroup??e.parentRenderGroup,s=i?.instructionSet?.gcTick??-1;(i?.gcTick??0)===s&&(e._gcLastUsed=t,e._onTouch?.(t));}runOnResource(e,t,i){let s=e._gcData;return s.type==="renderable"&&this.updateRenderableGCTick(e,t),t-e._gcLastUsed<this.maxUnusedTime||!e.autoGarbageCollect?(this._managedResources[i]=e,s.index=i,i++):(e.unload(),e._gcData=null,e._gcLastUsed=-1,e.off("unload",this.removeResource,this)),i}_createHashClone(e,t){let i=Object.create(null);for(let s in e){if(s===t)break;e[s]!==null&&(i[s]=e[s]);}return i}runOnHash(e,t){let{context:i,hash:s,type:n}=e,o=i[s],a=null,u=0;for(let l in o){let c=o[l];if(c===null){u++,u===1e4&&!a&&(a=this._createHashClone(o,l));continue}if(c._gcLastUsed===-1){c._gcLastUsed=t,c._onTouch?.(t),a&&(a[l]=c);continue}n==="renderable"&&this.updateRenderableGCTick(c,t),!(t-c._gcLastUsed<this.maxUnusedTime)&&c.autoGarbageCollect?(a||(u+1!==1e4?(o[l]=null,u++):a=this._createHashClone(o,l)),c.unload(),c._gcData=null,c._gcLastUsed=-1):a&&(a[l]=c);}a&&(i[s]=a);}destroy(){this.enabled=false,this._managedResources.forEach(e=>{e.off("unload",this.removeResource,this);}),this._managedResources.length=0,this._managedResourceHashes.length=0,this._renderer=null;}};gy.extension={type:[m.WebGLSystem,m.WebGPUSystem],name:"gc",priority:0};gy.defaultOptions={gcActive:true,gcMaxUnusedTime:6e4,gcFrequency:3e4};dp=gy;});var mn,_y=p(()=>{S();K();vt();Ms();kr();Dt();Oe();mn=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 P,worldColor:4294967295,offset:new q},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,Vt(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 He,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===ye.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 J({uProjectionMatrix:{value:new P,type:"mat3x3<f32>"},uWorldTransformMatrix:{value:new P,type:"mat3x3<f32>"},uWorldColorAlpha:{value:new Float32Array(4),type:"vec4<f32>"},uResolution:{value:[0,0],type:"vec2<f32>"}},{isStatic:true})}destroy(){this._renderer=null,this._globalUniformDataStack.length=0,this._uniformsPool.length=0,this._activeUniforms.length=0,this._bindGroupPool.length=0,this._activeBindGroups.length=0,this._currentGlobalUniformData=null;}};mn.extension={type:[m.WebGLSystem,m.WebGPUSystem,m.CanvasSystem],name:"globalUniforms"};});var Dw,gn,by=p(()=>{S();Gr();Dw=1,gn=class{constructor(){this._tasks=[],this._offset=0;}init(){be.system.add(this._update,this);}repeat(e,t,i=true){let s=Dw++,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(){be.system.remove(this._update,this),this._tasks.length=0;}};gn.extension={type:[m.WebGLSystem,m.WebGPUSystem,m.CanvasSystem],name:"scheduler",priority:0};});function fp(r){if(!mS){if(U.get().getNavigator().userAgent.toLowerCase().indexOf("chrome")>-1){let e=[`%c %c %c %c %c PixiJS %c v${Xi} (${r}) http://www.pixijs.com/
|
|
864
864
|
|
|
865
|
-
`,"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 ${gs} - ${r} - http://www.pixijs.com/`);$T=true;}}var $T,Cb=p(()=>{ae();Ph();$T=false;});var xs,wb=p(()=>{S();Cb();Bt();xs=class{constructor(e){this._renderer=e;}init(e){if(e.hello){let t=this._renderer.name;this._renderer.type===ye.WEBGL&&(t+=` ${this._renderer.context.webGLVersion}`),Ab(t);}}};xs.extension={type:[m.WebGLSystem,m.WebGPUSystem,m.CanvasSystem],name:"hello",priority:-2};xs.defaultOptions={hello:false};});function Pb(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 Bb(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 Rb=p(()=>{});var HC,Mb,Db,Fb=p(()=>{S();Rb();HC=0,Mb=class jT{constructor(e){this._managedRenderables=[],this._managedHashes=[],this._managedArrays=[],this._renderer=e;}init(e){e={...jT.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]=Pb(t.context[t.hash]);},this._frequency),this._arrayHandler=this._renderer.scheduler.repeat(()=>{for(let t of this._managedArrays)Bb(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=HC++,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);}};Mb.extension={type:[m.WebGLSystem,m.WebGPUSystem],name:"renderableGC",priority:0};Mb.defaultOptions={renderableGCActive:true,renderableGCMaxUnusedTime:6e4,renderableGCFrequency:3e4};Db=Mb;});var Gb,Ub,Ib=p(()=>{S();re();Gb=class Dh{get count(){return this._renderer.tick}get checkCount(){return this._checkCount}set checkCount(e){w("8.15.0","TextureGCSystem.run is deprecated, please use the GCSystem instead."),this._checkCount=e;}get maxIdle(){return this._renderer.gc.maxUnusedTime/1e3*60}set maxIdle(e){w("8.15.0","TextureGCSystem.run is deprecated, please use the GCSystem instead."),this._renderer.gc.maxUnusedTime=e/60*1e3;}get checkCountMax(){return Math.floor(this._renderer.gc._frequency/1e3)}set checkCountMax(e){w("8.15.0","TextureGCSystem.run is deprecated, please use the GCSystem instead.");}get active(){return this._renderer.gc.enabled}set active(e){w("8.15.0","TextureGCSystem.run is deprecated, please use the GCSystem instead."),this._renderer.gc.enabled=e;}constructor(e){this._renderer=e,this._checkCount=0;}init(e){e.textureGCActive!==Dh.defaultOptions.textureGCActive&&(this.active=e.textureGCActive),e.textureGCMaxIdle!==Dh.defaultOptions.textureGCMaxIdle&&(this.maxIdle=e.textureGCMaxIdle),e.textureGCCheckCountMax!==Dh.defaultOptions.textureGCCheckCountMax&&(this.checkCountMax=e.textureGCCheckCountMax);}run(){w("8.15.0","TextureGCSystem.run is deprecated, please use the GCSystem instead."),this._renderer.gc.run();}destroy(){this._renderer=null;}};Gb.extension={type:[m.WebGLSystem,m.WebGPUSystem],name:"textureGC"};Gb.defaultOptions={textureGCActive:true,textureGCAMaxIdle:null,textureGCMaxIdle:3600,textureGCCheckCountMax:600};Ub=Gb;});var qT,On,Fh=p(()=>{Me();He();ee();qT=class KT{constructor(e={}){if(this.uid=W("renderTarget"),this.colorTextures=[],this.dirtyId=0,this.isRoot=false,this._size=new Float32Array(2),this._managedColorTextures=false,e={...KT.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 Z({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 C||e.depthStencilTexture instanceof Z?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 Z({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);}};qT.defaultOptions={width:0,height:0,resolution:1,colorTextures:1,stencil:false,depth:false,antialias:false,isRoot:false};On=qT;});function su(r,e){if(!_s.has(r)){let t=new C({source:new Qe({resource:r,...e})}),i=()=>{_s.get(r)===t&&_s.delete(r);};t.once("destroy",i),t.source.once("destroy",i),_s.set(r,t);}return _s.get(r)}function VC(r){return _s.has(r)}var _s,Gh=p(()=>{Yr();Gi();ee();_s=new Map;Ct.register(_s);});var Ob,kb,Lb=p(()=>{ae();S();De();re();Fh();Gh();Ob=class ZT{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={...ZT.defaultOptions,...e},e.view&&(w(O,"ViewSystem.view has been renamed to ViewSystem.canvas"),e.canvas=e.view),this.screen=new V(0,0,e.width,e.height),this.canvas=e.canvas||U.get().createCanvas(),this.antialias=!!e.antialias,this.texture=su(this.canvas,e),this.renderTarget=new On({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),this.texture.destroy();}};Ob.extension={type:[m.WebGLSystem,m.WebGPUSystem,m.CanvasSystem],name:"view",priority:0};Ob.defaultOptions={width:800,height:600,autoDensity:false,antialias:false};kb=Ob;});var nu,ou,Uh=p(()=>{W_();X_();K_();Z_();Bh();J_();ab();ub();lb();db();fb();xb();bb();Tb();Sb();Eb();wb();Fb();Ib();Lb();nu=[hb,Un,xs,kb,Cn,vb,Ub,Gn,gb,Bn,Db,In],ou=[Fn,Rh,wn,En,Rn,Dn,Mn,Tn];});var kn,Nb=p(()=>{S();kn=class{constructor(e){this._hash=Object.create(null),this._renderer=e;}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 f=h;a.ubo.updateUniformGroup(f);let g=f.buffer;d={buffer:a.buffer.getGPUBuffer(g),offset:0,size:g.descriptor.size};}else if(h._resourceType==="buffer"){let f=h;d={buffer:a.buffer.getGPUBuffer(f),offset:0,size:f.descriptor.size};}else if(h._resourceType==="bufferResource"){let f=h;d={buffer:a.buffer.getGPUBuffer(f.buffer),offset:f.offset,size:f.size};}else if(h._resourceType==="textureSampler"){let f=h;d=a.texture.getGpuSampler(f);}else if(h._resourceType==="textureSource"){let f=h;d=a.texture.getGpuSource(f).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(){this._hash=null,this._renderer=null;}};kn.extension={type:[m.WebGPUSystem],name:"bindGroup"};});var Ih,Ln,Hb=p(()=>{S();dt();Me();$l();Ih=class{constructor(e){this.gpuBuffer=e;}destroy(){this.gpuBuffer.destroy(),this.gpuBuffer=null;}},Ln=class{constructor(e){this._renderer=e,this._managedBuffers=new pe({renderer:e,type:"resource",onUnload:this.onBufferUnload.bind(this),name:"gpuBuffer"});}contextChange(e){this._gpu=e;}getGPUBuffer(e){return e._gcLastUsed=this._renderer.gc.now,e._gpuData[this._renderer.uid]?.gpuBuffer||this.createGPUBuffer(e)}updateBuffer(e){let t=this.getGPUBuffer(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(){this._managedBuffers.removeAll();}onBufferUnload(e){e.off("update",this.updateBuffer,this),e.off("change",this.onBufferChange,this);}createGPUBuffer(e){let t=this._gpu.device.createBuffer(e.descriptor);return e._updateID=0,e._resourceId=W("resource"),e.data&&(Hs(e.data.buffer,t.getMappedRange()),t.unmap()),e._gpuData[this._renderer.uid]=new Ih(t),this._managedBuffers.add(e)&&(e.on("update",this.updateBuffer,this),e.on("change",this.onBufferChange,this)),t}onBufferChange(e){this._managedBuffers.remove(e),e._updateID=0,this.createGPUBuffer(e);}destroy(){this._managedBuffers.destroy(),this._renderer=null,this._gpu=null;}};Ln.extension={type:[m.WebGPUSystem],name:"buffer"};});var Nn,Vb=p(()=>{S();Nn=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;}};Nn.extension={type:[m.WebGPUSystem],name:"colorMask"};});var bs,zb=p(()=>{ae();S();bs=class{constructor(e){this._renderer=e;}async init(e){return this._initPromise?this._initPromise:(this._initPromise=(e.gpu?Promise.resolve(e.gpu):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 U.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;}};bs.extension={type:[m.WebGPUSystem],name:"device"};bs.defaultOptions={powerPreference:void 0,forceFallbackAdapter:false};});var Hn,Wb=p(()=>{S();Hn=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.gc.now,this._renderer.tick);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(parseInt(s,10),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;}};Hn.extension={type:[m.WebGPUSystem],name:"encoder",priority:1};});var Vn,Xb=p(()=>{S();Vn=class{constructor(e){this._renderer=e;}contextChange(){this.maxTextures=this._renderer.device.gpu.device.limits.maxSampledTexturesPerShaderStage,this.maxBatchableTextures=this.maxTextures;}destroy(){}};Vn.extension={type:[m.WebGPUSystem],name:"limits"};});var zn,Yb=p(()=>{S();si();zn=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:ge.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;}};zn.extension={type:[m.WebGPUSystem],name:"stencil"};});var ys,Oh=p(()=>{bh();Er();ar();ys=class{constructor(e){this._syncFunctionHash=Object.create(null),this._adaptor=e,this._systemCheck();}_systemCheck(){if(!eu())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 Ee({data:new Float32Array(t.layout.size/4),usage:j.UNIFORM|j.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 Ee({data:new Float32Array(s.layout.size/4),usage:j.UNIFORM|j.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 $b(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=Wn[s.data.type].size,o=Wn[s.data.type].align;if(!Wn[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 Wn,kh=p(()=>{Wn={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 pr,Lh=p(()=>{pr=[{type:"mat3x3<f32>",test:r=>r.value.a!==void 0,ubo:`
|
|
865
|
+
`,"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 ${Xi} - ${r} - http://www.pixijs.com/`);mS=true;}}var mS,yy=p(()=>{ae();op();mS=false;});var Yi,vy=p(()=>{S();yy();Dt();Yi=class{constructor(e){this._renderer=e;}init(e){if(e.hello){let t=this._renderer.name;this._renderer.type===ye.WEBGL&&(t+=` ${this._renderer.context.webGLVersion}`),fp(t);}}};Yi.extension={type:[m.WebGLSystem,m.WebGPUSystem,m.CanvasSystem],name:"hello",priority:-2};Yi.defaultOptions={hello:false};});function pp(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 mp(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 Ty=p(()=>{});var Fw,Sy,gp,Ey=p(()=>{S();Ty();Fw=0,Sy=class gS{constructor(e){this._managedRenderables=[],this._managedHashes=[],this._managedArrays=[],this._renderer=e;}init(e){e={...gS.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]=pp(t.context[t.hash]);},this._frequency),this._arrayHandler=this._renderer.scheduler.repeat(()=>{for(let t of this._managedArrays)mp(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=Fw++,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);}};Sy.extension={type:[m.WebGLSystem,m.WebGPUSystem],name:"renderableGC",priority:0};Sy.defaultOptions={renderableGCActive:true,renderableGCMaxUnusedTime:6e4,renderableGCFrequency:3e4};gp=Sy;});var Ay,_p,Cy=p(()=>{S();re();Ay=class xp{get count(){return this._renderer.tick}get checkCount(){return this._checkCount}set checkCount(e){w("8.15.0","TextureGCSystem.run is deprecated, please use the GCSystem instead."),this._checkCount=e;}get maxIdle(){return this._renderer.gc.maxUnusedTime/1e3*60}set maxIdle(e){w("8.15.0","TextureGCSystem.run is deprecated, please use the GCSystem instead."),this._renderer.gc.maxUnusedTime=e/60*1e3;}get checkCountMax(){return Math.floor(this._renderer.gc._frequency/1e3)}set checkCountMax(e){w("8.15.0","TextureGCSystem.run is deprecated, please use the GCSystem instead.");}get active(){return this._renderer.gc.enabled}set active(e){w("8.15.0","TextureGCSystem.run is deprecated, please use the GCSystem instead."),this._renderer.gc.enabled=e;}constructor(e){this._renderer=e,this._checkCount=0;}init(e){e.textureGCActive!==xp.defaultOptions.textureGCActive&&(this.active=e.textureGCActive),e.textureGCMaxIdle!==xp.defaultOptions.textureGCMaxIdle&&(this.maxIdle=e.textureGCMaxIdle),e.textureGCCheckCountMax!==xp.defaultOptions.textureGCCheckCountMax&&(this.checkCountMax=e.textureGCCheckCountMax);}run(){w("8.15.0","TextureGCSystem.run is deprecated, please use the GCSystem instead."),this._renderer.gc.run();}destroy(){this._renderer=null;}};Ay.extension={type:[m.WebGLSystem,m.WebGPUSystem],name:"textureGC"};Ay.defaultOptions={textureGCActive:true,textureGCAMaxIdle:null,textureGCMaxIdle:3600,textureGCCheckCountMax:600};_p=Ay;});var xS,xn,bp=p(()=>{Ge();We();ee();xS=class _S{constructor(e={}){if(this.uid=W("renderTarget"),this.colorTextures=[],this.dirtyId=0,this.isRoot=false,this._size=new Float32Array(2),this._managedColorTextures=false,e={..._S.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 Z({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 A||e.depthStencilTexture instanceof Z?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 Z({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);}};xS.defaultOptions={width:0,height:0,resolution:1,colorTextures:1,stencil:false,depth:false,antialias:false,isRoot:false};xn=xS;});function ra(r,e){if(!_n.has(r)){let t=new A({source:new $e({resource:r,...e})}),i=()=>{_n.get(r)===t&&_n.delete(r);};t.once("destroy",i),t.source.once("destroy",i),_n.set(r,t);}return _n.get(r)}function bS(r){return _n.has(r)}var _n,yp=p(()=>{ti();Ts();ee();_n=new Map;Tt.register(_n);});var wy,vp,Py=p(()=>{ae();S();Ue();re();bp();yp();wy=class yS{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={...yS.defaultOptions,...e},e.view&&(w(O,"ViewSystem.view has been renamed to ViewSystem.canvas"),e.canvas=e.view),this.screen=new V(0,0,e.width,e.height),this.canvas=e.canvas||U.get().createCanvas(),this.antialias=!!e.antialias,this.texture=ra(this.canvas,e),this.renderTarget=new xn({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),this.texture.destroy();}};wy.extension={type:[m.WebGLSystem,m.WebGPUSystem,m.CanvasSystem],name:"view",priority:0};wy.defaultOptions={width:800,height:600,autoDensity:false,antialias:false};vp=wy;});var ia,sa,Tp=p(()=>{X0();Y0();K0();Z0();ap();J0();ny();oy();ay();ly();cy();fy();my();xy();_y();by();vy();Ey();Cy();Py();ia=[cp,mn,Yi,vp,on,dp,_p,pn,hp,ln,gp,gn],sa=[fn,Nl,an,sn,cn,dn,hn,tn];});var bn,By=p(()=>{S();bn=class{constructor(e){this._hash=Object.create(null),this._renderer=e;}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 f=h;a.ubo.updateUniformGroup(f);let g=f.buffer;d={buffer:a.buffer.getGPUBuffer(g),offset:0,size:g.descriptor.size};}else if(h._resourceType==="buffer"){let f=h;d={buffer:a.buffer.getGPUBuffer(f),offset:0,size:f.descriptor.size};}else if(h._resourceType==="bufferResource"){let f=h;d={buffer:a.buffer.getGPUBuffer(f.buffer),offset:f.offset,size:f.size};}else if(h._resourceType==="textureSampler"){let f=h;d=a.texture.getGpuSampler(f);}else if(h._resourceType==="textureSource"){let f=h;d=a.texture.getGpuSource(f).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(){this._hash=null,this._renderer=null;}};bn.extension={type:[m.WebGPUSystem],name:"bindGroup"};});var zl,yn,Ry=p(()=>{S();bt();Ge();Hh();zl=class{constructor(e){this.gpuBuffer=e;}destroy(){this.gpuBuffer.destroy(),this.gpuBuffer=null;}},yn=class{constructor(e){this._renderer=e,this._managedBuffers=new pe({renderer:e,type:"resource",onUnload:this.onBufferUnload.bind(this),name:"gpuBuffer"});}contextChange(e){this._gpu=e;}getGPUBuffer(e){return e._gcLastUsed=this._renderer.gc.now,e._gpuData[this._renderer.uid]?.gpuBuffer||this.createGPUBuffer(e)}updateBuffer(e){let t=this.getGPUBuffer(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(){this._managedBuffers.removeAll();}onBufferUnload(e){e.off("update",this.updateBuffer,this),e.off("change",this.onBufferChange,this);}createGPUBuffer(e){let t=this._gpu.device.createBuffer(e.descriptor);return e._updateID=0,e._resourceId=W("resource"),e.data&&(Es(e.data.buffer,t.getMappedRange()),t.unmap()),e._gpuData[this._renderer.uid]=new zl(t),this._managedBuffers.add(e)&&(e.on("update",this.updateBuffer,this),e.on("change",this.onBufferChange,this)),t}onBufferChange(e){this._managedBuffers.remove(e),e._updateID=0,this.createGPUBuffer(e);}destroy(){this._managedBuffers.destroy(),this._renderer=null,this._gpu=null;}};yn.extension={type:[m.WebGPUSystem],name:"buffer"};});var vn,My=p(()=>{S();vn=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;}};vn.extension={type:[m.WebGPUSystem],name:"colorMask"};});var $i,Dy=p(()=>{ae();S();$i=class{constructor(e){this._renderer=e;}async init(e){return this._initPromise?this._initPromise:(this._initPromise=(e.gpu?Promise.resolve(e.gpu):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 U.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;}};$i.extension={type:[m.WebGPUSystem],name:"device"};$i.defaultOptions={powerPreference:void 0,forceFallbackAdapter:false};});var Tn,Fy=p(()=>{S();Tn=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.gc.now,this._renderer.tick);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(parseInt(s,10),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;}};Tn.extension={type:[m.WebGPUSystem],name:"encoder",priority:1};});var Sn,Gy=p(()=>{S();Sn=class{constructor(e){this._renderer=e;}contextChange(){this.maxTextures=this._renderer.device.gpu.device.limits.maxSampledTexturesPerShaderStage,this.maxBatchableTextures=this.maxTextures;}destroy(){}};Sn.extension={type:[m.WebGPUSystem],name:"limits"};});var En,Uy=p(()=>{S();_i();En=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:ge.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;}};En.extension={type:[m.WebGPUSystem],name:"stencil"};});var ji,Sp=p(()=>{jf();Lr();mr();ji=class{constructor(e){this._syncFunctionHash=Object.create(null),this._adaptor=e,this._systemCheck();}_systemCheck(){if(!Qo())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 Ee({data:new Float32Array(t.layout.size/4),usage:j.UNIFORM|j.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 Ee({data:new Float32Array(s.layout.size/4),usage:j.UNIFORM|j.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 Ep(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=An[s.data.type].size,o=An[s.data.type].align;if(!An[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 An,Ap=p(()=>{An={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 cr,Cp=p(()=>{cr=[{type:"mat3x3<f32>",test:r=>r.value.a!==void 0,ubo:`
|
|
866
866
|
var matrix = uv[name].toArray(true);
|
|
867
867
|
data[offset] = matrix[0];
|
|
868
868
|
data[offset + 1] = matrix[1];
|
|
@@ -933,23 +933,23 @@ fn mainFragment(
|
|
|
933
933
|
cv[2] = v.blue;
|
|
934
934
|
gl.uniform3f(ud[name].location, v.red, v.green, v.blue);
|
|
935
935
|
}
|
|
936
|
-
`}];});function
|
|
936
|
+
`}];});function na(r,e,t,i){let s=[`
|
|
937
937
|
var v = null;
|
|
938
938
|
var v2 = null;
|
|
939
939
|
var t = 0;
|
|
940
940
|
var index = 0;
|
|
941
941
|
var name = null;
|
|
942
942
|
var arrayOffset = null;
|
|
943
|
-
`],n=0;for(let a=0;a<r.length;a++){let u=r[a],l=u.data.name,c=false,h=0;for(let d=0;d<
|
|
943
|
+
`],n=0;for(let a=0;a<r.length;a++){let u=r[a],l=u.data.name,c=false,h=0;for(let d=0;d<cr.length;d++)if(cr[d].test(u.data)){h=u.offset/4,s.push(`name = "${l}";`,`offset += ${h-n};`,cr[d][e]||cr[d].ubo),c=true;break}if(!c)if(u.data.size>1)h=u.offset/4,s.push(t(u,h-n));else {let d=i[u.data.type];h=u.offset/4,s.push(`
|
|
944
944
|
v = uv.${l};
|
|
945
945
|
offset += ${h-n};
|
|
946
946
|
${d};
|
|
947
947
|
`);}n=h;}let o=s.join(`
|
|
948
|
-
`);return new Function("uv","data","dataInt32","offset",o)}var
|
|
948
|
+
`);return new Function("uv","data","dataInt32","offset",o)}var wp=p(()=>{Cp();});function oa(r,e){return `
|
|
949
949
|
for (let i = 0; i < ${r*e}; i++) {
|
|
950
950
|
data[offset + (((i / ${r})|0) * 4) + (i % ${r})] = v[i];
|
|
951
951
|
}
|
|
952
|
-
`}var
|
|
952
|
+
`}var Wl,Pp,Bp=p(()=>{Wl={f32:`
|
|
953
953
|
data[offset] = v;`,i32:`
|
|
954
954
|
dataInt32[offset] = v;`,"vec2<f32>":`
|
|
955
955
|
data[offset] = v[0];
|
|
@@ -985,12 +985,12 @@ fn mainFragment(
|
|
|
985
985
|
data[offset + 10] = v[8];`,"mat4x4<f32>":`
|
|
986
986
|
for (let i = 0; i < 16; i++) {
|
|
987
987
|
data[offset + i] = v[i];
|
|
988
|
-
}`,"mat3x2<f32>":
|
|
988
|
+
}`,"mat3x2<f32>":oa(3,2),"mat4x2<f32>":oa(4,2),"mat2x3<f32>":oa(2,3),"mat4x3<f32>":oa(4,3),"mat2x4<f32>":oa(2,4),"mat3x4<f32>":oa(3,4)},Pp={...Wl,"mat2x2<f32>":`
|
|
989
989
|
data[offset] = v[0];
|
|
990
990
|
data[offset + 1] = v[1];
|
|
991
991
|
data[offset + 2] = v[2];
|
|
992
992
|
data[offset + 3] = v[3];
|
|
993
|
-
`};});function
|
|
993
|
+
`};});function Rp(r,e){let{size:t,align:i}=An[r.data.type],s=(i-t)/4,n=r.data.type.indexOf("i32")>=0?"dataInt32":"data";return `
|
|
994
994
|
v = uv.${r.data.name};
|
|
995
995
|
${e!==0?`offset += ${e};`:""}
|
|
996
996
|
|
|
@@ -1006,7 +1006,7 @@ fn mainFragment(
|
|
|
1006
1006
|
}
|
|
1007
1007
|
${s!==0?`arrayOffset += ${s};`:""}
|
|
1008
1008
|
}
|
|
1009
|
-
`}var Kb=p(()=>{kh();});function Zb(r){return au(r,"uboWgsl",qb,jb)}var Qb=p(()=>{Nh();Vh();Kb();});var Yn,Jb=p(()=>{S();Oh();kh();Qb();Yn=class extends ys{constructor(){super({createUboElements:$b,generateUboSync:Zb});}};Yn.extension={type:[m.WebGPUSystem],name:"ubo"};});var Ur,uu=p(()=>{je();Me();Ur=class extends fe{constructor({buffer:e,offset:t,size:i}){super(),this.uid=W("buffer"),this._resourceType="bufferResource",this._touched=0,this._resourceId=W("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=W("resource"),this.emit("change",this);}destroy(e=false){this.destroyed=true,e&&this.buffer.destroy(),this.emit("change",this),this.buffer=null,this.removeAllListeners();}};});var lu,e0=p(()=>{lu=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 di,$n,t0=p(()=>{S();Er();uu();ar();e0();Sr();di=128,$n=class{constructor(e){this._bindGroupHash=Object.create(null),this._buffers=[],this._bindGroups=[],this._bufferResources=[],this._renderer=e,this._batchBuffer=new lu({minUniformOffsetAlignment:di});let t=256/di;for(let i=0;i<t;i++){let s=j.UNIFORM|j.COPY_DST;i===0&&(s|=j.COPY_SRC),this._buffers.push(new Ee({data:this._batchBuffer.data,usage:s}));}}renderEnd(){this._uploadBindGroups(),this._resetBindGroups();}_resetBindGroups(){this._bindGroupHash=Object.create(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/di),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/di)}getArrayBindGroup(e){let t=this._batchBuffer.addGroup(e);return this._getBindGroup(t/di)}getArrayBufferResource(e){let i=this._batchBuffer.addGroup(e)/di;return this._getBufferResource(i)}_getBufferResource(e){if(!this._bufferResources[e]){let t=this._buffers[e%2];this._bufferResources[e]=new Ur({buffer:t,offset:(e/2|0)*256,size:di});}return this._bufferResources[e]}_getBindGroup(e){if(!this._bindGroups[e]){let t=new Ve({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),di,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._renderer=null;}};$n.extension={type:[m.WebGPUPipes],name:"uniformBatch"};});function cu(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)):M(`Attribute ${t} is not present in the shader, but is present in the geometry. Unable to infer attribute details.`);}zC(r);}function zC(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]+=ht(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]+=ht(o.format).stride;}}var zh=p(()=>{se();oi();});var Jt,Wh=p(()=>{si();Jt=[];Jt[ge.NONE]=void 0;Jt[ge.DISABLED]={stencilWriteMask:0,stencilReadMask:0};Jt[ge.RENDERING_MASK_ADD]={stencilFront:{compare:"equal",passOp:"increment-clamp"},stencilBack:{compare:"equal",passOp:"increment-clamp"}};Jt[ge.RENDERING_MASK_REMOVE]={stencilFront:{compare:"equal",passOp:"decrement-clamp"},stencilBack:{compare:"equal",passOp:"decrement-clamp"}};Jt[ge.MASK_ACTIVE]={stencilWriteMask:0,stencilFront:{compare:"equal",passOp:"keep"},stencilBack:{compare:"equal",passOp:"keep"}};Jt[ge.INVERSE_MASK_ACTIVE]={stencilWriteMask:0,stencilFront:{compare:"not-equal",passOp:"keep"},stencilBack:{compare:"not-equal",passOp:"keep"}};});function XC(r,e,t,i,s){return r<<24|e<<16|t<<10|i<<5|s}function YC(r,e,t,i,s){return t<<8|r<<5|i<<3|s<<1|e}var WC,jn,r0=p(()=>{S();se();zh();si();Ws();Wh();WC={"point-list":0,"line-list":1,"line-strip":2,"triangle-list":3,"triangle-strip":4};jn=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._colorTargetCount=1,this._renderer=e;}contextChange(e){this._gpu=e,this.setStencilMode(ge.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._colorTargetCount=e.colorTargetCount,this._updatePipeHash();}setColorMask(e){this._colorMask!==e&&(this._colorMask=e,this._updatePipeHash());}setStencilMode(e){this._stencilMode!==e&&(this._stencilMode=e,this._stencilState=Jt[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||(cu(e,t.attributeData),this._generateBufferKey(e)),s||(s=e.topology);let n=XC(e._layoutKey,t._layoutKey,i.data,i._blendModeId,WC[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,this._colorTargetCount),u=this._stencilMode===ge.RENDERING_MASK_ADD?0:this._colorMask;for(let d=0;d<a.length;d++)a[d].writeMask=u;let l=this._renderer.shader.getProgramData(t).pipeline,c={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:l,multisample:{count:this._multisampleCount},label:"PIXI Pipeline"};return this._depthStencilAttachment&&(c.depthStencil={...this._stencilState,format:"depth24plus-stencil8",depthWriteEnabled:i.depthTest,depthCompare:i.depthTest?"less":"always"}),n.createRenderPipeline(c)}_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=ur(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=ur(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&&M(`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=YC(this._stencilMode,this._multisampleCount,this._colorMask,this._depthStencilAttachment,this._colorTargetCount);this._pipeStateCaches[e]||(this._pipeStateCaches[e]=Object.create(null)),this._pipeCache=this._pipeStateCaches[e];}destroy(){this._renderer=null,this._bufferLayoutsCache=null;}};jn.extension={type:[m.WebGPUSystem],name:"pipeline"};});function i0(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 s0=p(()=>{});function n0(r){let e=r.colorTexture.source.resource;return globalThis.HTMLCanvasElement&&e instanceof HTMLCanvasElement&&document.body.contains(e)}var o0=p(()=>{});var vs,Xh=p(()=>{K();De();ps();s0();yh();Gi();He();ee();Gh();o0();Fh();vs=class{constructor(e){this.rootViewPort=new V,this.viewport=new V,this.onRenderTargetChange=new ms("onRenderTargetChange"),this.projectionMatrix=new P,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=n0(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 C&&(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 i0(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=We.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=We.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 Qe.test(e)&&(e=su(e).source),e instanceof On?t=e:e instanceof Z&&(t=new On({colorTextures:[e]}),e.source instanceof Qe&&(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 hu,a0=p(()=>{hu=class{constructor(){this.contexts=[],this.msaaTextures=[],this.msaaSamples=1;}};});var du,u0=p(()=>{ps();Gi();He();a0();du=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?We.ALL:We.NONE);let s=this._renderTargetSystem,n=s.getGpuRenderTarget(e),o=e.colorTextures.map((l,c)=>{let h=n.contexts[c],d,f;h?d=h.getCurrentTexture().createView():d=this._renderer.texture.getGpuSource(l).createView({mipLevelCount:1}),n.msaaTextures[c]&&(f=d,d=this._renderer.texture.getTextureView(n.msaaTextures[c]));let g=t&We.COLOR?"clear":"load";return i??(i=s.defaultClearColor),{view:d,resolveTarget:f,clearValue:i,storeOp:"store",loadOp:g}}),a;if((e.stencil||e.depth)&&!e.depthStencilTexture&&(e.ensureDepthStencilTexture(),e.depthStencilTexture.source.sampleCount=n.msaa?4:1),e.depthStencilTexture){let l=t&We.STENCIL?"clear":"load",c=t&We.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 hu;return t.colorTargetCount=e.colorTextures.length,e.colorTextures.forEach((i,s)=>{if(i instanceof Qe){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 Z({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 qn,l0=p(()=>{S();Xh();u0();qn=class extends vs{constructor(e){super(e),this.adaptor=new du,this.adaptor.init(e,this);}};qn.extension={type:[m.WebGPUSystem],name:"renderTarget"};});var Kn,c0=p(()=>{S();Kn=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;}};Kn.extension={type:[m.WebGPUSystem],name:"shader"};});var nt,h0=p(()=>{nt={};nt.normal={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"}};nt.add={alpha:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one",operation:"add"}};nt.multiply={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"dst",dstFactor:"one-minus-src-alpha",operation:"add"}};nt.screen={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one-minus-src",operation:"add"}};nt.overlay={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one-minus-src",operation:"add"}};nt.none={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"zero",dstFactor:"zero",operation:"add"}};nt["normal-npm"]={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha",operation:"add"}};nt["add-npm"]={alpha:{srcFactor:"one",dstFactor:"one",operation:"add"},color:{srcFactor:"src-alpha",dstFactor:"one",operation:"add"}};nt["screen-npm"]={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"src-alpha",dstFactor:"one-minus-src",operation:"add"}};nt.erase={alpha:{srcFactor:"zero",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"zero",dstFactor:"one-minus-src",operation:"add"}};nt.min={alpha:{srcFactor:"one",dstFactor:"one",operation:"min"},color:{srcFactor:"one",dstFactor:"one",operation:"min"}};nt.max={alpha:{srcFactor:"one",dstFactor:"one",operation:"max"},color:{srcFactor:"one",dstFactor:"one",operation:"max"}};});var Zn,d0=p(()=>{S();Rt();h0();Zn=class{constructor(){this.defaultState=new Se,this.defaultState.blend=true;}contextChange(e){this.gpu=e;}getColorTargets(e,t){let i=nt[e.blendMode]||nt.normal,s=[],n={format:"bgra8unorm",writeMask:0,blend:i};for(let o=0;o<t;o++)s[o]=n;return s}destroy(){this.gpu=null;}};Zn.extension={type:[m.WebGPUSystem],name:"state"};});var f0,p0=p(()=>{f0={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.pixelWidth*n},{width:r.pixelWidth,height:r.pixelHeight,depthOrArrayLayers:1});}};});var Yh,$C,m0,g0=p(()=>{Yh={"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}},$C={blockBytes:4,blockWidth:1,blockHeight:1},m0={type:"compressed",upload(r,e,t){let i=r.pixelWidth,s=r.pixelHeight,n=Yh[r.format]||$C;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 fu,$h=p(()=>{ae();se();fu={type:"image",upload(r,e,t){let i=r.resource;if(!i)return;if(globalThis.HTMLImageElement&&i instanceof HTMLImageElement){let a=U.get().createCanvas(i.width,i.height);a.getContext("2d").drawImage(i,0,0,i.width,i.height),r.resource=a,M("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 x0,_0=p(()=>{$h();x0={type:"video",upload(r,e,t){fu.upload(r,e,t);}};});var pu,b0=p(()=>{pu=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:`
|
|
1009
|
+
`}var Iy=p(()=>{Ap();});function Mp(r){return na(r,"uboWgsl",Rp,Pp)}var Oy=p(()=>{wp();Bp();Iy();});var Cn,ky=p(()=>{S();Sp();Ap();Oy();Cn=class extends ji{constructor(){super({createUboElements:Ep,generateUboSync:Mp});}};Cn.extension={type:[m.WebGPUSystem],name:"ubo"};});var Tr,Xl=p(()=>{Ke();Ge();Tr=class extends fe{constructor({buffer:e,offset:t,size:i}){super(),this.uid=W("buffer"),this._resourceType="bufferResource",this._touched=0,this._resourceId=W("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=W("resource"),this.emit("change",this);}destroy(e=false){this.destroyed=true,e&&this.buffer.destroy(),this.emit("change",this),this.buffer=null,this.removeAllListeners();}};});var aa,Ly=p(()=>{aa=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 qi,wn,Ny=p(()=>{S();Lr();Xl();mr();Ly();kr();qi=128,wn=class{constructor(e){this._bindGroupHash=Object.create(null),this._buffers=[],this._bindGroups=[],this._bufferResources=[],this._renderer=e,this._batchBuffer=new aa({minUniformOffsetAlignment:qi});let t=256/qi;for(let i=0;i<t;i++){let s=j.UNIFORM|j.COPY_DST;i===0&&(s|=j.COPY_SRC),this._buffers.push(new Ee({data:this._batchBuffer.data,usage:s}));}}renderEnd(){this._uploadBindGroups(),this._resetBindGroups();}_resetBindGroups(){this._bindGroupHash=Object.create(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/qi),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/qi)}getArrayBindGroup(e){let t=this._batchBuffer.addGroup(e);return this._getBindGroup(t/qi)}getArrayBufferResource(e){let i=this._batchBuffer.addGroup(e)/qi;return this._getBufferResource(i)}_getBufferResource(e){if(!this._bufferResources[e]){let t=this._buffers[e%2];this._bufferResources[e]=new Tr({buffer:t,offset:(e/2|0)*256,size:qi});}return this._bufferResources[e]}_getBindGroup(e){if(!this._bindGroups[e]){let t=new He({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),qi,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._renderer=null;}};wn.extension={type:[m.WebGPUPipes],name:"uniformBatch"};});function ua(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)):R(`Attribute ${t} is not present in the shader, but is present in the geometry. Unable to infer attribute details.`);}Gw(r);}function Gw(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]+=ut(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]+=ut(o.format).stride;}}var Dp=p(()=>{ne();yi();});var Wt,Fp=p(()=>{_i();Wt=[];Wt[ge.NONE]=void 0;Wt[ge.DISABLED]={stencilWriteMask:0,stencilReadMask:0};Wt[ge.RENDERING_MASK_ADD]={stencilFront:{compare:"equal",passOp:"increment-clamp"},stencilBack:{compare:"equal",passOp:"increment-clamp"}};Wt[ge.RENDERING_MASK_REMOVE]={stencilFront:{compare:"equal",passOp:"decrement-clamp"},stencilBack:{compare:"equal",passOp:"decrement-clamp"}};Wt[ge.MASK_ACTIVE]={stencilWriteMask:0,stencilFront:{compare:"equal",passOp:"keep"},stencilBack:{compare:"equal",passOp:"keep"}};Wt[ge.INVERSE_MASK_ACTIVE]={stencilWriteMask:0,stencilFront:{compare:"not-equal",passOp:"keep"},stencilBack:{compare:"not-equal",passOp:"keep"}};});function Iw(r,e,t,i,s){return r<<24|e<<16|t<<10|i<<5|s}function Ow(r,e,t,i,s){return t<<8|r<<5|i<<3|s<<1|e}var Uw,Pn,Hy=p(()=>{S();ne();Dp();_i();bo();Fp();Uw={"point-list":0,"line-list":1,"line-strip":2,"triangle-list":3,"triangle-strip":4};Pn=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._colorTargetCount=1,this._renderer=e;}contextChange(e){this._gpu=e,this.setStencilMode(ge.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._colorTargetCount=e.colorTargetCount,this._updatePipeHash();}setColorMask(e){this._colorMask!==e&&(this._colorMask=e,this._updatePipeHash());}setStencilMode(e){this._stencilMode!==e&&(this._stencilMode=e,this._stencilState=Wt[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||(ua(e,t.attributeData),this._generateBufferKey(e)),s||(s=e.topology);let n=Iw(e._layoutKey,t._layoutKey,i.data,i._blendModeId,Uw[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,this._colorTargetCount),u=this._stencilMode===ge.RENDERING_MASK_ADD?0:this._colorMask;for(let d=0;d<a.length;d++)a[d].writeMask=u;let l=this._renderer.shader.getProgramData(t).pipeline,c={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:l,multisample:{count:this._multisampleCount},label:"PIXI Pipeline"};return this._depthStencilAttachment&&(c.depthStencil={...this._stencilState,format:"depth24plus-stencil8",depthWriteEnabled:i.depthTest,depthCompare:i.depthTest?"less":"always"}),n.createRenderPipeline(c)}_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=rr(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=rr(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&&R(`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=Ow(this._stencilMode,this._multisampleCount,this._colorMask,this._depthStencilAttachment,this._colorTargetCount);this._pipeStateCaches[e]||(this._pipeStateCaches[e]=Object.create(null)),this._pipeCache=this._pipeStateCaches[e];}destroy(){this._renderer=null,this._bufferLayoutsCache=null;}};Pn.extension={type:[m.WebGPUSystem],name:"pipeline"};});function Gp(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 Vy=p(()=>{});function Up(r){let e=r.colorTexture.source.resource;return globalThis.HTMLCanvasElement&&e instanceof HTMLCanvasElement&&document.body.contains(e)}var zy=p(()=>{});var Ki,Ip=p(()=>{K();Ue();Zs();Vy();qf();Ts();We();ee();yp();zy();bp();Ki=class{constructor(e){this.rootViewPort=new V,this.viewport=new V,this.onRenderTargetChange=new Wi("onRenderTargetChange"),this.projectionMatrix=new P,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=Up(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 A&&(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 Gp(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=ze.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=ze.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 $e.test(e)&&(e=ra(e).source),e instanceof xn?t=e:e instanceof Z&&(t=new xn({colorTextures:[e]}),e.source instanceof $e&&(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 la,Wy=p(()=>{la=class{constructor(){this.contexts=[],this.msaaTextures=[],this.msaaSamples=1;}};});var ca,Xy=p(()=>{Zs();Ts();We();Wy();ca=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?ze.ALL:ze.NONE);let s=this._renderTargetSystem,n=s.getGpuRenderTarget(e),o=e.colorTextures.map((l,c)=>{let h=n.contexts[c],d,f;h?d=h.getCurrentTexture().createView():d=this._renderer.texture.getGpuSource(l).createView({mipLevelCount:1}),n.msaaTextures[c]&&(f=d,d=this._renderer.texture.getTextureView(n.msaaTextures[c]));let g=t&ze.COLOR?"clear":"load";return i??(i=s.defaultClearColor),{view:d,resolveTarget:f,clearValue:i,storeOp:"store",loadOp:g}}),a;if((e.stencil||e.depth)&&!e.depthStencilTexture&&(e.ensureDepthStencilTexture(),e.depthStencilTexture.source.sampleCount=n.msaa?4:1),e.depthStencilTexture){let l=t&ze.STENCIL?"clear":"load",c=t&ze.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 la;return t.colorTargetCount=e.colorTextures.length,e.colorTextures.forEach((i,s)=>{if(i instanceof $e){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 Z({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 Bn,Yy=p(()=>{S();Ip();Xy();Bn=class extends Ki{constructor(e){super(e),this.adaptor=new ca,this.adaptor.init(e,this);}};Bn.extension={type:[m.WebGPUSystem],name:"renderTarget"};});var Rn,$y=p(()=>{S();Rn=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;}};Rn.extension={type:[m.WebGPUSystem],name:"shader"};});var st,jy=p(()=>{st={};st.normal={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"}};st.add={alpha:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one",operation:"add"}};st.multiply={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"dst",dstFactor:"one-minus-src-alpha",operation:"add"}};st.screen={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one-minus-src",operation:"add"}};st.overlay={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one-minus-src",operation:"add"}};st.none={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"zero",dstFactor:"zero",operation:"add"}};st["normal-npm"]={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha",operation:"add"}};st["add-npm"]={alpha:{srcFactor:"one",dstFactor:"one",operation:"add"},color:{srcFactor:"src-alpha",dstFactor:"one",operation:"add"}};st["screen-npm"]={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"src-alpha",dstFactor:"one-minus-src",operation:"add"}};st.erase={alpha:{srcFactor:"zero",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"zero",dstFactor:"one-minus-src",operation:"add"}};st.min={alpha:{srcFactor:"one",dstFactor:"one",operation:"min"},color:{srcFactor:"one",dstFactor:"one",operation:"min"}};st.max={alpha:{srcFactor:"one",dstFactor:"one",operation:"max"},color:{srcFactor:"one",dstFactor:"one",operation:"max"}};});var Mn,qy=p(()=>{S();Ft();jy();Mn=class{constructor(){this.defaultState=new Se,this.defaultState.blend=true;}contextChange(e){this.gpu=e;}getColorTargets(e,t){let i=st[e.blendMode]||st.normal,s=[],n={format:"bgra8unorm",writeMask:0,blend:i};for(let o=0;o<t;o++)s[o]=n;return s}destroy(){this.gpu=null;}};Mn.extension={type:[m.WebGPUSystem],name:"state"};});var Op,Ky=p(()=>{Op={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.pixelWidth*n},{width:r.pixelWidth,height:r.pixelHeight,depthOrArrayLayers:1});}};});var Yl,kw,kp,Zy=p(()=>{Yl={"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}},kw={blockBytes:4,blockWidth:1,blockHeight:1},kp={type:"compressed",upload(r,e,t){let i=r.pixelWidth,s=r.pixelHeight,n=Yl[r.format]||kw;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 ha,Lp=p(()=>{ae();ne();ha={type:"image",upload(r,e,t){let i=r.resource;if(!i)return;if(globalThis.HTMLImageElement&&i instanceof HTMLImageElement){let a=U.get().createCanvas(i.width,i.height);a.getContext("2d").drawImage(i,0,0,i.width,i.height),r.resource=a,R("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 Np,Qy=p(()=>{Lp();Np={type:"video",upload(r,e,t){ha.upload(r,e,t);}};});var da,Jy=p(()=>{da=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:`
|
|
1010
1010
|
var<private> pos : array<vec2<f32>, 3> = array<vec2<f32>, 3>(
|
|
1011
1011
|
vec2<f32>(-1.0, -1.0), vec2<f32>(-1.0, 3.0), vec2<f32>(3.0, -1.0));
|
|
1012
1012
|
|
|
@@ -1030,7 +1030,7 @@ fn mainFragment(
|
|
|
1030
1030
|
fn fragmentMain(@location(0) texCoord : vec2<f32>) -> @location(0) vec4<f32> {
|
|
1031
1031
|
return textureSample(img, imgSampler, texCoord);
|
|
1032
1032
|
}
|
|
1033
|
-
`})),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}),f=o.beginRenderPass({colorAttachments:[{view:d,storeOp:"store",loadOp:"clear",clearValue:{r:0,g:0,b:0,a:0}}]}),g=this.device.createBindGroup({layout:a,entries:[{binding:0,resource:this.sampler},{binding:1,resource:l}]});f.setPipeline(t),f.setBindGroup(0,g),f.draw(3,1,0,0),f.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 jh,Qn,y0=p(()=>{ae();S();dt();Ie();rs();Sr();p0();g0();$h();_0();b0();jh=class{constructor(e){this.textureView=null,this.gpuTexture=e;}destroy(){this.gpuTexture.destroy(),this.textureView=null,this.gpuTexture=null;}},Qn=class{constructor(e){this._gpuSamplers=Object.create(null),this._bindGroupHash=Object.create(null),this._uploads={image:fu,buffer:f0,video:x0,compressed:m0},this._renderer=e,e.renderableGC.addManagedHash(this,"_bindGroupHash"),this._managedTextures=new pe({renderer:e,type:"resource",onUnload:this.onSourceUnload.bind(this),name:"gpuTextureSource"});}get managedTextures(){return Object.values(this._managedTextures.items)}contextChange(e){this._gpu=e;}initSource(e){return e._gpuData[this._renderer.uid]?.gpuTexture||this._initSource(e)}_initSource(e){if(e.autoGenerateMipmaps){let l=Math.max(e.pixelWidth,e.pixelHeight);e.mipLevelCount=Math.floor(Math.log2(l))+1;}let t=GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST;e.uploadMethodId!=="compressed"&&(t|=GPUTextureUsage.RENDER_ATTACHMENT,t|=GPUTextureUsage.COPY_SRC);let i=Yh[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 e._gpuData[this._renderer.uid]=new jh(a),this._managedTextures.add(e)&&(e.on("update",this.onSourceUpdate,this),e.on("resize",this.onSourceResize,this),e.on("updateMipmaps",this.onUpdateMipmaps,this)),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));}onUpdateMipmaps(e){this._mipmapGenerator||(this._mipmapGenerator=new pu(this._gpu.device));let t=this.getGpuSource(e);this._mipmapGenerator.generateMipmap(t);}onSourceUnload(e){e.off("update",this.onSourceUpdate,this),e.off("resize",this.onSourceResize,this),e.off("updateMipmaps",this.onUpdateMipmaps,this);}onSourceResize(e){e._gcLastUsed=this._renderer.gc.now;let t=e._gpuData[this._renderer.uid],i=t?.gpuTexture;i?(i.width!==e.pixelWidth||i.height!==e.pixelHeight)&&(t.destroy(),this._bindGroupHash[e.uid]=null,e._gpuData[this._renderer.uid]=null,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 e._gcLastUsed=this._renderer.gc.now,e._gpuData[this._renderer.uid]?.gpuTexture||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 Ve({0:t,1:t.style,2:new J({uTextureMatrix:{type:"mat3x3<f32>",value:e.textureMatrix.mapCoord}})}),this._bindGroupHash[e.uid]}getTextureView(e){let t=e.source;t._gcLastUsed=this._renderer.gc.now;let i=t._gpuData[this._renderer.uid],s=null;return i||(this.initSource(t),i=t._gpuData[this._renderer.uid]),s=i.textureView||i.gpuTexture.createView(),s}generateCanvas(e){let t=this._renderer,i=t.gpu.device.createCommandEncoder(),s=U.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:U.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=mt.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 mt.returnCanvasAndContext(i),{pixels:u,width:n,height:o}}destroy(){this._managedTextures.destroy();for(let e of Object.keys(this._bindGroupHash)){let t=Number(e);this._bindGroupHash[t]?.destroy();}this._renderer=null,this._gpu=null,this._mipmapGenerator=null,this._gpuSamplers=null,this._bindGroupHash=null;}};Qn.extension={type:[m.WebGPUSystem],name:"texture"};});var tS={};xv(tS,{WebGPURenderer:()=>qh});var jC,qC,KC,QT,JT,eS,qh,v0=p(()=>{S();L_();V_();z_();_n();Uh();Bt();Nb();Hb();Vb();zb();Wb();Xb();Yb();Jb();t0();r0();l0();c0();d0();y0();jC=[...nu,Yn,Hn,bs,Vn,Ln,Qn,qn,Kn,Zn,jn,Nn,zn,kn],qC=[...ou,$n],KC=[vn,yn,bn],QT=[],JT=[],eS=[];G.handleByNamedList(m.WebGPUSystem,QT);G.handleByNamedList(m.WebGPUPipes,JT);G.handleByNamedList(m.WebGPUPipesAdaptor,eS);G.add(...jC,...qC,...KC);qh=class extends Dr{constructor(){let e={name:"webgpu",type:ye.WEBGPU,systems:QT,renderPipes:JT,renderPipeAdaptors:eS};super(e);}};});var Jn,T0=p(()=>{S();K();Ar();Xs();Ys();cs();Cr();xa();Ut();Ie();Jn=class{contextChange(e){let t=new J({uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uTransformMatrix:{value:new P,type:"mat3x3<f32>"},uRound:{value:0,type:"f32"}}),i=e.limits.maxBatchableTextures,s=Xt({name:"graphics",bits:[Li,Hi(i),ls,$t]});this.shader=new Ae({glProgram:s,resources:{localUniforms:t,batchSamplers:Vi(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;}};Jn.extension={type:[m.WebGLPipesAdaptor],name:"graphics"};});var eo,S0=p(()=>{S();K();Ar();cs();Cr();Sh();Ut();ee();se();eo=class{init(){let e=Xt({name:"mesh",bits:[ls,H_,$t]});this._shader=new Ae({glProgram:e,resources:{uTexture:C.EMPTY.source,textureUniforms:{uTextureMatrix:{type:"mat3x3<f32>",value:new P}}}});}execute(e,t){let i=e.renderer,s=t._shader;if(s){if(!s.glProgram){M("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;}};eo.extension={type:[m.WebGLPipesAdaptor],name:"mesh"};});var to,E0=p(()=>{S();Rt();to=class{constructor(){this._tempState=Se.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);}};to.extension={type:[m.WebGLPipesAdaptor],name:"batch"};});var ro,A0=p(()=>{ro=(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))(ro||{});});var mu,C0=p(()=>{mu=class{constructor(e,t){this._lastBindBaseLocation=-1,this._lastBindCallId=-1,this.buffer=e||null,this.updateID=-1,this.byteLength=-1,this.type=t;}destroy(){this.buffer=null,this.updateID=-1,this.byteLength=-1,this.type=-1,this._lastBindBaseLocation=-1,this._lastBindCallId=-1;}};});var io,w0=p(()=>{S();dt();ar();A0();C0();io=class{constructor(e){this._boundBufferBases=Object.create(null),this._minBaseLocation=0,this._nextBindBaseIndex=this._minBaseLocation,this._bindCallId=0,this._renderer=e,this._managedBuffers=new pe({renderer:e,type:"resource",onUnload:this.onBufferUnload.bind(this),name:"glBuffer"});}destroy(){this._managedBuffers.destroy(),this._renderer=null,this._gl=null,this._boundBufferBases={};}contextChange(){this._gl=this._renderer.gl,this.destroyAll(true),this._maxBindings=this._renderer.limits.maxUniformBindings;}getGlBuffer(e){return e._gcLastUsed=this._renderer.gc.now,e._gpuData[this._renderer.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&j.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(e=false){this._managedBuffers.removeAll(e);}onBufferUnload(e,t=false){let i=e._gpuData[this._renderer.uid];i&&(t||this._gl.deleteBuffer(i.buffer));}createGLBuffer(e){let{_gl:t}=this,i=ro.ARRAY_BUFFER;e.descriptor.usage&j.INDEX?i=ro.ELEMENT_ARRAY_BUFFER:e.descriptor.usage&j.UNIFORM&&(i=ro.UNIFORM_BUFFER);let s=new mu(t.createBuffer(),i);return e._gpuData[this._renderer.uid]=s,this._managedBuffers.add(e),s}resetState(){this._boundBufferBases=Object.create(null);}};io.extension={type:[m.WebGLSystem],name:"buffer"};});var P0,B0,R0=p(()=>{ae();S();se();P0=class rS{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={...rS.defaultOptions,...e};let t=this.multiView=e.multiView;if(e.context&&t&&(M("Renderer created with both a context and multiview enabled. Disabling multiView as both cannot work together."),t=false),t?this.canvas=U.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&&M("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 U.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&&M("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||M("Provided WebGL context does not support 32 index buffer, large scenes may not render correctly");}};P0.extension={type:[m.WebGLSystem],name:"context"};P0.defaultOptions={context:null,premultipliedAlpha:true,preserveDrawingBuffer:false,powerPreference:void 0,preferWebGLVersion:2,multiView:false};B0=P0;});var gu,Kh,iS,ne,Zh=p(()=>{gu=(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))(gu||{}),Kh=(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))(Kh||{}),iS=(r=>(r[r.CLAMP=33071]="CLAMP",r[r.REPEAT=10497]="REPEAT",r[r.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",r))(iS||{}),ne=(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))(ne||{});});function M0(r){return sS[r]??sS.float32}var sS,D0=p(()=>{Zh();sS={uint8x2:ne.UNSIGNED_BYTE,uint8x4:ne.UNSIGNED_BYTE,sint8x2:ne.BYTE,sint8x4:ne.BYTE,unorm8x2:ne.UNSIGNED_BYTE,unorm8x4:ne.UNSIGNED_BYTE,snorm8x2:ne.BYTE,snorm8x4:ne.BYTE,uint16x2:ne.UNSIGNED_SHORT,uint16x4:ne.UNSIGNED_SHORT,sint16x2:ne.SHORT,sint16x4:ne.SHORT,unorm16x2:ne.UNSIGNED_SHORT,unorm16x4:ne.UNSIGNED_SHORT,snorm16x2:ne.SHORT,snorm16x4:ne.SHORT,float16x2:ne.HALF_FLOAT,float16x4:ne.HALF_FLOAT,float32:ne.FLOAT,float32x2:ne.FLOAT,float32x3:ne.FLOAT,float32x4:ne.FLOAT,uint32:ne.UNSIGNED_INT,uint32x2:ne.UNSIGNED_INT,uint32x3:ne.UNSIGNED_INT,uint32x4:ne.UNSIGNED_INT,sint32:ne.INT,sint32x2:ne.INT,sint32x3:ne.INT,sint32x4:ne.INT};});var ZC,Qh,so,F0=p(()=>{S();dt();oi();zh();D0();ZC={"point-list":0,"line-list":1,"line-strip":3,"triangle-list":4,"triangle-strip":5},Qh=class{constructor(){this.vaoCache=Object.create(null);}destroy(){this.vaoCache=Object.create(null);}},so=class{constructor(e){this._renderer=e,this._activeGeometry=null,this._activeVao=null,this.hasVao=true,this.hasInstance=true,this._managedGeometries=new pe({renderer:e,type:"resource",onUnload:this.onGeometryUnload.bind(this),name:"glGeometry"});}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");this.destroyAll(true);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;}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);}e._gcLastUsed=this._renderer.gc.now;}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 e._gpuData[this._renderer.uid]?.vaoCache[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),a=new Qh;e._gpuData[this._renderer.uid]=a,this._managedGeometries.add(e);let u=a.vaoCache,l=u[o];if(l)return u[t._key]=l,l;cu(e,t._attributeData);let c=e.buffers;l=s.createVertexArray(),s.bindVertexArray(l);for(let h=0;h<c.length;h++){let d=c[h];n.bind(d);}return this.activateVao(e,t),u[t._key]=l,u[o]=l,s.bindVertexArray(null),l}onGeometryUnload(e,t=false){let i=e._gpuData[this._renderer.uid];if(!i)return;let s=i.vaoCache;if(!t)for(let n in s)this._activeVao!==s[n]&&this.resetState(),this.gl.deleteVertexArray(s[n]);}destroyAll(e=false){this._managedGeometries.removeAll(e);}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 f=ht(u.format),g=M0(u.format);if(h.format?.substring(1,4)==="int"?i.vertexAttribIPointer(d,f.size,g,u.stride,u.offset):i.vertexAttribPointer(d,f.size,g,f.normalised,u.stride,u.offset),u.instance)if(this.hasInstance){let _=u.divisor??1;i.vertexAttribDivisor(d,_);}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=ZC[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._managedGeometries.destroy(),this._renderer=null,this.gl=null,this._activeVao=null,this._activeGeometry=null;}};so.extension={type:[m.WebGLSystem],name:"geometry"};});var QC,G0,U0,I0=p(()=>{S();se();ni();Ut();Rt();He();ee();ct();QC=new lt({attributes:{aPosition:[-1,-1,3,-1,-1,3]}}),G0=class nS{constructor(e){this.useBackBuffer=false,this._useBackBufferThisRender=false,this._renderer=e;}init(e={}){let{useBackBuffer:t,antialias:i}={...nS.defaultOptions,...e};this.useBackBuffer=t,this._antialias=i,this._renderer.context.supports.msaa||(M("antialiasing, is not supported on when using the back buffer"),this._antialias=false),this._state=Se.for2d();let s=new xe({vertex:`
|
|
1033
|
+
`})),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}),f=o.beginRenderPass({colorAttachments:[{view:d,storeOp:"store",loadOp:"clear",clearValue:{r:0,g:0,b:0,a:0}}]}),g=this.device.createBindGroup({layout:a,entries:[{binding:0,resource:this.sampler},{binding:1,resource:l}]});f.setPipeline(t),f.setBindGroup(0,g),f.draw(3,1,0,0),f.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 $l,Dn,e2=p(()=>{ae();S();bt();Oe();Ns();kr();Ky();Zy();Lp();Qy();Jy();$l=class{constructor(e){this.textureView=null,this.gpuTexture=e;}destroy(){this.gpuTexture.destroy(),this.textureView=null,this.gpuTexture=null;}},Dn=class{constructor(e){this._gpuSamplers=Object.create(null),this._bindGroupHash=Object.create(null),this._uploads={image:ha,buffer:Op,video:Np,compressed:kp},this._renderer=e,e.renderableGC.addManagedHash(this,"_bindGroupHash"),this._managedTextures=new pe({renderer:e,type:"resource",onUnload:this.onSourceUnload.bind(this),name:"gpuTextureSource"});}get managedTextures(){return Object.values(this._managedTextures.items)}contextChange(e){this._gpu=e;}initSource(e){return e._gpuData[this._renderer.uid]?.gpuTexture||this._initSource(e)}_initSource(e){if(e.autoGenerateMipmaps){let l=Math.max(e.pixelWidth,e.pixelHeight);e.mipLevelCount=Math.floor(Math.log2(l))+1;}let t=GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST;e.uploadMethodId!=="compressed"&&(t|=GPUTextureUsage.RENDER_ATTACHMENT,t|=GPUTextureUsage.COPY_SRC);let i=Yl[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 e._gpuData[this._renderer.uid]=new $l(a),this._managedTextures.add(e)&&(e.on("update",this.onSourceUpdate,this),e.on("resize",this.onSourceResize,this),e.on("updateMipmaps",this.onUpdateMipmaps,this)),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));}onUpdateMipmaps(e){this._mipmapGenerator||(this._mipmapGenerator=new da(this._gpu.device));let t=this.getGpuSource(e);this._mipmapGenerator.generateMipmap(t);}onSourceUnload(e){e.off("update",this.onSourceUpdate,this),e.off("resize",this.onSourceResize,this),e.off("updateMipmaps",this.onUpdateMipmaps,this);}onSourceResize(e){e._gcLastUsed=this._renderer.gc.now;let t=e._gpuData[this._renderer.uid],i=t?.gpuTexture;i?(i.width!==e.pixelWidth||i.height!==e.pixelHeight)&&(t.destroy(),this._bindGroupHash[e.uid]=null,e._gpuData[this._renderer.uid]=null,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 e._gcLastUsed=this._renderer.gc.now,e._gpuData[this._renderer.uid]?.gpuTexture||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 He({0:t,1:t.style,2:new J({uTextureMatrix:{type:"mat3x3<f32>",value:e.textureMatrix.mapCoord}})}),this._bindGroupHash[e.uid]}getTextureView(e){let t=e.source;t._gcLastUsed=this._renderer.gc.now;let i=t._gpuData[this._renderer.uid],s=null;return i||(this.initSource(t),i=t._gpuData[this._renderer.uid]),s=i.textureView||i.gpuTexture.createView(),s}generateCanvas(e){let t=this._renderer,i=t.gpu.device.createCommandEncoder(),s=U.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:U.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=ht.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 ht.returnCanvasAndContext(i),{pixels:u,width:n,height:o}}destroy(){this._managedTextures.destroy();for(let e of Object.keys(this._bindGroupHash)){let t=Number(e);this._bindGroupHash[t]?.destroy();}this._renderer=null,this._gpu=null,this._mipmapGenerator=null,this._gpuSamplers=null,this._bindGroupHash=null;}};Dn.extension={type:[m.WebGPUSystem],name:"texture"};});var ES={};zg(ES,{WebGPURenderer:()=>jl});var Lw,Nw,Hw,vS,TS,SS,jl,t2=p(()=>{S();V0();z0();W0();Jo();Tp();Dt();By();Ry();My();Dy();Fy();Gy();Uy();ky();Ny();Hy();Yy();$y();qy();e2();Lw=[...ia,Cn,Tn,$i,Sn,yn,Dn,Bn,Rn,Mn,Pn,vn,En,bn],Nw=[...sa,wn],Hw=[en,Js,Qs],vS=[],TS=[],SS=[];G.handleByNamedList(m.WebGPUSystem,vS);G.handleByNamedList(m.WebGPUPipes,TS);G.handleByNamedList(m.WebGPUPipesAdaptor,SS);G.add(...Lw,...Nw,...Hw);jl=class extends br{constructor(){let e={name:"webgpu",type:ye.WEBGPU,systems:vS,renderPipes:TS,renderPipeAdaptors:SS};super(e);}};});var Fn,r2=p(()=>{S();K();Nr();vo();To();Ys();Hr();Nu();Ht();Oe();Fn=class{contextChange(e){let t=new J({uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uTransformMatrix:{value:new P,type:"mat3x3<f32>"},uRound:{value:0,type:"f32"}}),i=e.limits.maxBatchableTextures,s=kt({name:"graphics",bits:[Ei,Ci(i),Ni,Nt]});this.shader=new Ae({glProgram:s,resources:{localUniforms:t,batchSamplers:wi(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;}};Fn.extension={type:[m.WebGLPipesAdaptor],name:"graphics"};});var Gn,i2=p(()=>{S();K();Nr();Ys();Hr();ep();Ht();ee();ne();Gn=class{init(){let e=kt({name:"mesh",bits:[Ni,Jf,Nt]});this._shader=new Ae({glProgram:e,resources:{uTexture:A.EMPTY.source,textureUniforms:{uTextureMatrix:{type:"mat3x3<f32>",value:new P}}}});}execute(e,t){let i=e.renderer,s=t._shader;if(s){if(!s.glProgram){R("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;}};Gn.extension={type:[m.WebGLPipesAdaptor],name:"mesh"};});var Un,s2=p(()=>{S();Ft();Un=class{constructor(){this._tempState=Se.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);}};Un.extension={type:[m.WebGLPipesAdaptor],name:"batch"};});var In,n2=p(()=>{In=(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))(In||{});});var fa,o2=p(()=>{fa=class{constructor(e,t){this._lastBindBaseLocation=-1,this._lastBindCallId=-1,this.buffer=e||null,this.updateID=-1,this.byteLength=-1,this.type=t;}destroy(){this.buffer=null,this.updateID=-1,this.byteLength=-1,this.type=-1,this._lastBindBaseLocation=-1,this._lastBindCallId=-1;}};});var On,a2=p(()=>{S();bt();mr();n2();o2();On=class{constructor(e){this._boundBufferBases=Object.create(null),this._minBaseLocation=0,this._nextBindBaseIndex=this._minBaseLocation,this._bindCallId=0,this._renderer=e,this._managedBuffers=new pe({renderer:e,type:"resource",onUnload:this.onBufferUnload.bind(this),name:"glBuffer"});}destroy(){this._managedBuffers.destroy(),this._renderer=null,this._gl=null,this._boundBufferBases={};}contextChange(){this._gl=this._renderer.gl,this.destroyAll(true),this._maxBindings=this._renderer.limits.maxUniformBindings;}getGlBuffer(e){return e._gcLastUsed=this._renderer.gc.now,e._gpuData[this._renderer.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&j.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(e=false){this._managedBuffers.removeAll(e);}onBufferUnload(e,t=false){let i=e._gpuData[this._renderer.uid];i&&(t||this._gl.deleteBuffer(i.buffer));}createGLBuffer(e){let{_gl:t}=this,i=In.ARRAY_BUFFER;e.descriptor.usage&j.INDEX?i=In.ELEMENT_ARRAY_BUFFER:e.descriptor.usage&j.UNIFORM&&(i=In.UNIFORM_BUFFER);let s=new fa(t.createBuffer(),i);return e._gpuData[this._renderer.uid]=s,this._managedBuffers.add(e),s}resetState(){this._boundBufferBases=Object.create(null);}};On.extension={type:[m.WebGLSystem],name:"buffer"};});var u2,Hp,l2=p(()=>{ae();S();ne();u2=class AS{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={...AS.defaultOptions,...e};let t=this.multiView=e.multiView;if(e.context&&t&&(R("Renderer created with both a context and multiview enabled. Disabling multiView as both cannot work together."),t=false),t?this.canvas=U.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&&R("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 U.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&&R("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||R("Provided WebGL context does not support 32 index buffer, large scenes may not render correctly");}};u2.extension={type:[m.WebGLSystem],name:"context"};u2.defaultOptions={context:null,premultipliedAlpha:true,preserveDrawingBuffer:false,powerPreference:void 0,preferWebGLVersion:2,multiView:false};Hp=u2;});var pa,ql,c2,ie,Vp=p(()=>{pa=(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))(pa||{}),ql=(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))(ql||{}),c2=(r=>(r[r.CLAMP=33071]="CLAMP",r[r.REPEAT=10497]="REPEAT",r[r.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",r))(c2||{}),ie=(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))(ie||{});});function zp(r){return CS[r]??CS.float32}var CS,h2=p(()=>{Vp();CS={uint8x2:ie.UNSIGNED_BYTE,uint8x4:ie.UNSIGNED_BYTE,sint8x2:ie.BYTE,sint8x4:ie.BYTE,unorm8x2:ie.UNSIGNED_BYTE,unorm8x4:ie.UNSIGNED_BYTE,snorm8x2:ie.BYTE,snorm8x4:ie.BYTE,uint16x2:ie.UNSIGNED_SHORT,uint16x4:ie.UNSIGNED_SHORT,sint16x2:ie.SHORT,sint16x4:ie.SHORT,unorm16x2:ie.UNSIGNED_SHORT,unorm16x4:ie.UNSIGNED_SHORT,snorm16x2:ie.SHORT,snorm16x4:ie.SHORT,float16x2:ie.HALF_FLOAT,float16x4:ie.HALF_FLOAT,float32:ie.FLOAT,float32x2:ie.FLOAT,float32x3:ie.FLOAT,float32x4:ie.FLOAT,uint32:ie.UNSIGNED_INT,uint32x2:ie.UNSIGNED_INT,uint32x3:ie.UNSIGNED_INT,uint32x4:ie.UNSIGNED_INT,sint32:ie.INT,sint32x2:ie.INT,sint32x3:ie.INT,sint32x4:ie.INT};});var Vw,Kl,kn,d2=p(()=>{S();bt();yi();Dp();h2();Vw={"point-list":0,"line-list":1,"line-strip":3,"triangle-list":4,"triangle-strip":5},Kl=class{constructor(){this.vaoCache=Object.create(null);}destroy(){this.vaoCache=Object.create(null);}},kn=class{constructor(e){this._renderer=e,this._activeGeometry=null,this._activeVao=null,this.hasVao=true,this.hasInstance=true,this._managedGeometries=new pe({renderer:e,type:"resource",onUnload:this.onGeometryUnload.bind(this),name:"glGeometry"});}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");this.destroyAll(true);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;}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);}e._gcLastUsed=this._renderer.gc.now;}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 e._gpuData[this._renderer.uid]?.vaoCache[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),a=new Kl;e._gpuData[this._renderer.uid]=a,this._managedGeometries.add(e);let u=a.vaoCache,l=u[o];if(l)return u[t._key]=l,l;ua(e,t._attributeData);let c=e.buffers;l=s.createVertexArray(),s.bindVertexArray(l);for(let h=0;h<c.length;h++){let d=c[h];n.bind(d);}return this.activateVao(e,t),u[t._key]=l,u[o]=l,s.bindVertexArray(null),l}onGeometryUnload(e,t=false){let i=e._gpuData[this._renderer.uid];if(!i)return;let s=i.vaoCache;if(!t)for(let n in s)this._activeVao!==s[n]&&this.resetState(),this.gl.deleteVertexArray(s[n]);}destroyAll(e=false){this._managedGeometries.removeAll(e);}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 f=ut(u.format),g=zp(u.format);if(h.format?.substring(1,4)==="int"?i.vertexAttribIPointer(d,f.size,g,u.stride,u.offset):i.vertexAttribPointer(d,f.size,g,f.normalised,u.stride,u.offset),u.instance)if(this.hasInstance){let _=u.divisor??1;i.vertexAttribDivisor(d,_);}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=Vw[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._managedGeometries.destroy(),this._renderer=null,this.gl=null,this._activeVao=null,this._activeGeometry=null;}};kn.extension={type:[m.WebGLSystem],name:"geometry"};});var zw,f2,Wp,p2=p(()=>{S();ne();bi();Ht();Ft();We();ee();_t();zw=new at({attributes:{aPosition:[-1,-1,3,-1,-1,3]}}),f2=class wS{constructor(e){this.useBackBuffer=false,this._useBackBufferThisRender=false,this._renderer=e;}init(e={}){let{useBackBuffer:t,antialias:i}={...wS.defaultOptions,...e};this.useBackBuffer=t,this._antialias=i,this._renderer.context.supports.msaa||(R("antialiasing, is not supported on when using the back buffer"),this._antialias=false),this._state=Se.for2d();let s=new xe({vertex:`
|
|
1034
1034
|
attribute vec2 aPosition;
|
|
1035
1035
|
out vec2 vUv;
|
|
1036
1036
|
|
|
@@ -1049,7 +1049,7 @@ fn mainFragment(
|
|
|
1049
1049
|
|
|
1050
1050
|
void main() {
|
|
1051
1051
|
finalColor = texture(uTexture, vUv);
|
|
1052
|
-
}`,name:"big-triangle"});this._bigTriangleShader=new Ae({glProgram:s,resources:{uTexture:
|
|
1052
|
+
}`,name:"big-triangle"});this._bigTriangleShader=new Ae({glProgram:s,resources:{uTexture:A.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:zw,shader:this._bigTriangleShader,state:this._state}));}_getBackBufferTexture(e){return this._backBufferTexture=this._backBufferTexture||new A({source:new Z({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);}};f2.extension={type:[m.WebGLSystem],name:"backBuffer",priority:1};f2.defaultOptions={useBackBuffer:false};Wp=f2;});var Ln,m2=p(()=>{S();Ln=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)));}};Ln.extension={type:[m.WebGLSystem],name:"colorMask"};});var Nn,g2=p(()=>{S();Nn=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;}};Nn.extension={type:[m.WebGLSystem],name:"encoder"};});var Hn,x2=p(()=>{S();Xh();Hn=class{constructor(e){this._renderer=e;}contextChange(){let e=this._renderer.gl;this.maxTextures=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),this.maxBatchableTextures=mo(this.maxTextures,e);let t=this._renderer.context.webGLVersion===2;this.maxUniformBindings=t?e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS):0;}destroy(){}};Hn.extension={type:[m.WebGLSystem],name:"limits"};});var Vn,_2=p(()=>{S();Fp();_i();Vn=class{constructor(e){this._stencilCache={enabled:false,stencilReference:0,stencilMode:ge.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:ge.DISABLED,stencilReference:0}),this.setStencilMode(t.stencilMode,t.stencilReference);}resetState(){this._stencilCache.enabled=false,this._stencilCache.stencilMode=ge.NONE,this._stencilCache.stencilReference=0;}setStencilMode(e,t){let i=this._renderTargetStencilState[this._activeRenderTarget.uid],s=this._gl,n=Wt[e],o=this._stencilCache;if(i.stencilMode=e,i.stencilReference=t,e===ge.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]));}};Vn.extension={type:[m.WebGLSystem],name:"stencil"};});function Xp(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=Zl[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 Zl,Yp=p(()=>{Zl={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 $p(r,e){let t=Math.max(Zl[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 `
|
|
1053
1053
|
v = uv.${r.data.name};
|
|
1054
1054
|
offset += ${e};
|
|
1055
1055
|
|
|
@@ -1065,7 +1065,7 @@ fn mainFragment(
|
|
|
1065
1065
|
}
|
|
1066
1066
|
${s!==0?`arrayOffset += ${s};`:""}
|
|
1067
1067
|
}
|
|
1068
|
-
`}var
|
|
1068
|
+
`}var b2=p(()=>{Yp();});function jp(r){return na(r,"uboStd40",$p,Wl)}var y2=p(()=>{wp();Bp();b2();});var zn,v2=p(()=>{S();Sp();Yp();y2();zn=class extends ji{constructor(){super({createUboElements:Xp,generateUboSync:jp});}};zn.extension={type:[m.WebGLSystem],name:"ubo"};});var ma,T2=p(()=>{ma=class{constructor(){this.width=-1,this.height=-1,this.msaa=false,this.msaaRenderBuffer=[];}};});var ga,S2=p(()=>{Ue();ne();Ts();Zs();T2();ga=class{constructor(){this._clearColorCache=[0,0,0,0],this._viewPortCache=new V;}init(e,t){this._renderer=e,this._renderTargetSystem=t,e.runners.contextChange.add(this);}contextChange(){this._clearColorCache=[0,0,0,0],this._viewPortCache=new V;let e=this._renderer.gl;this._drawBuffersCache=[];for(let t=1;t<=16;t++)this._drawBuffersCache[t]=Array.from({length:t},(i,s)=>e.COLOR_ATTACHMENT0+s);}copyToTexture(e,t,i,s,n){let o=this._renderTargetSystem,a=this._renderer,u=o.getGpuRenderTarget(e),l=a.gl;return this.finishRenderPass(e),l.bindFramebuffer(l.FRAMEBUFFER,u.resolveTargetFramebuffer),a.texture.bind(t,0),l.copyTexSubImage2D(l.TEXTURE_2D,0,n.x,n.y,i.x,i.y,s.width,s.height),t}startRenderPass(e,t=true,i,s){let n=this._renderTargetSystem,o=e.colorTexture,a=n.getGpuRenderTarget(e),u=s.y;e.isRoot&&(u=o.pixelHeight-s.height-s.y),e.colorTextures.forEach(h=>{this._renderer.texture.unbind(h);});let l=this._renderer.gl;l.bindFramebuffer(l.FRAMEBUFFER,a.framebuffer),e.colorTextures.length>1&&this._setDrawBuffers(e,l);let c=this._viewPortCache;(c.x!==s.x||c.y!==u||c.width!==s.width||c.height!==s.height)&&(c.x=s.x,c.y=u,c.width=s.width,c.height=s.height,l.viewport(s.x,u,s.width,s.height)),!a.depthStencilRenderBuffer&&(e.stencil||e.depth)&&this._initStencil(a),this.clear(e,t,i);}finishRenderPass(e){let i=this._renderTargetSystem.getGpuRenderTarget(e);if(!i.msaa)return;let s=this._renderer.gl;s.bindFramebuffer(s.FRAMEBUFFER,i.resolveTargetFramebuffer),s.bindFramebuffer(s.READ_FRAMEBUFFER,i.framebuffer),s.blitFramebuffer(0,0,i.width,i.height,0,0,i.width,i.height,s.COLOR_BUFFER_BIT,s.NEAREST),s.bindFramebuffer(s.FRAMEBUFFER,i.framebuffer);}initGpuRenderTarget(e){let i=this._renderer.gl,s=new ma;return e.colorTexture instanceof $e?(this._renderer.context.ensureCanvasSize(e.colorTexture.resource),s.framebuffer=null,s):(this._initColor(e,s),i.bindFramebuffer(i.FRAMEBUFFER,null),s)}destroyGpuRenderTarget(e){let t=this._renderer.gl;e.framebuffer&&(t.deleteFramebuffer(e.framebuffer),e.framebuffer=null),e.resolveTargetFramebuffer&&(t.deleteFramebuffer(e.resolveTargetFramebuffer),e.resolveTargetFramebuffer=null),e.depthStencilRenderBuffer&&(t.deleteRenderbuffer(e.depthStencilRenderBuffer),e.depthStencilRenderBuffer=null),e.msaaRenderBuffer.forEach(i=>{t.deleteRenderbuffer(i);}),e.msaaRenderBuffer=null;}clear(e,t,i){if(!t)return;let s=this._renderTargetSystem;typeof t=="boolean"&&(t=t?ze.ALL:ze.NONE);let n=this._renderer.gl;if(t&ze.COLOR){i??(i=s.defaultClearColor);let o=this._clearColorCache,a=i;(o[0]!==a[0]||o[1]!==a[1]||o[2]!==a[2]||o[3]!==a[3])&&(o[0]=a[0],o[1]=a[1],o[2]=a[2],o[3]=a[3],n.clearColor(a[0],a[1],a[2],a[3]));}n.clear(t);}resizeGpuRenderTarget(e){if(e.isRoot)return;let i=this._renderTargetSystem.getGpuRenderTarget(e);this._resizeColor(e,i),(e.stencil||e.depth)&&this._resizeStencil(i);}_initColor(e,t){let i=this._renderer,s=i.gl,n=s.createFramebuffer();if(t.resolveTargetFramebuffer=n,s.bindFramebuffer(s.FRAMEBUFFER,n),t.width=e.colorTexture.source.pixelWidth,t.height=e.colorTexture.source.pixelHeight,e.colorTextures.forEach((a,u)=>{let l=a.source;l.antialias&&(i.context.supports.msaa?t.msaa=true:R("[RenderTexture] Antialiasing on textures is not supported in WebGL1")),i.texture.bindSource(l,0);let h=i.texture.getGlSource(l).texture;s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0+u,3553,h,0);}),t.msaa){let a=s.createFramebuffer();t.framebuffer=a,s.bindFramebuffer(s.FRAMEBUFFER,a),e.colorTextures.forEach((u,l)=>{let c=s.createRenderbuffer();t.msaaRenderBuffer[l]=c;});}else t.framebuffer=n;this._resizeColor(e,t);}_resizeColor(e,t){let i=e.colorTexture.source;if(t.width=i.pixelWidth,t.height=i.pixelHeight,e.colorTextures.forEach((s,n)=>{n!==0&&s.source.resize(i.width,i.height,i._resolution);}),t.msaa){let s=this._renderer,n=s.gl,o=t.framebuffer;n.bindFramebuffer(n.FRAMEBUFFER,o),e.colorTextures.forEach((a,u)=>{let l=a.source;s.texture.bindSource(l,0);let h=s.texture.getGlSource(l).internalFormat,d=t.msaaRenderBuffer[u];n.bindRenderbuffer(n.RENDERBUFFER,d),n.renderbufferStorageMultisample(n.RENDERBUFFER,4,h,l.pixelWidth,l.pixelHeight),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0+u,n.RENDERBUFFER,d);});}}_initStencil(e){if(e.framebuffer===null)return;let t=this._renderer.gl,i=t.createRenderbuffer();e.depthStencilRenderBuffer=i,t.bindRenderbuffer(t.RENDERBUFFER,i),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,i),this._resizeStencil(e);}_resizeStencil(e){let t=this._renderer.gl;t.bindRenderbuffer(t.RENDERBUFFER,e.depthStencilRenderBuffer),e.msaa?t.renderbufferStorageMultisample(t.RENDERBUFFER,4,t.DEPTH24_STENCIL8,e.width,e.height):t.renderbufferStorage(t.RENDERBUFFER,this._renderer.context.webGLVersion===2?t.DEPTH24_STENCIL8:t.DEPTH_STENCIL,e.width,e.height);}prerender(e){let t=e.colorTexture.resource;this._renderer.context.multiView&&$e.test(t)&&this._renderer.context.ensureCanvasSize(t);}postrender(e){if(this._renderer.context.multiView&&$e.test(e.colorTexture.resource)){let t=this._renderer.context.canvas,i=e.colorTexture;i.context2D.drawImage(t,0,i.pixelHeight-t.height);}}_setDrawBuffers(e,t){let i=e.colorTextures.length,s=this._drawBuffersCache[i];if(this._renderer.context.webGLVersion===1){let n=this._renderer.context.extensions.drawBuffers;n?n.drawBuffersWEBGL(s):R("[RenderTexture] This WebGL1 context does not support rendering to multiple targets");}else t.drawBuffers(s);}};});var Wn,E2=p(()=>{S();Ip();S2();Wn=class extends Ki{constructor(e){super(e),this.adaptor=new ga,this.adaptor.init(e,this);}};Wn.extension={type:[m.WebGLSystem],name:"renderTarget"};});function qp(r,e){let t=[],i=[`
|
|
1069
1069
|
var g = s.groups;
|
|
1070
1070
|
var sS = r.shader;
|
|
1071
1071
|
var p = s.glProgram;
|
|
@@ -1081,7 +1081,7 @@ fn mainFragment(
|
|
|
1081
1081
|
);
|
|
1082
1082
|
`);}else t.push(`
|
|
1083
1083
|
ugS.updateUniformGroup(resources[${c}], p, sD);
|
|
1084
|
-
`);else if(h instanceof
|
|
1084
|
+
`);else if(h instanceof Tr){let d=r._uniformBindMap[u][Number(c)];t.push(`
|
|
1085
1085
|
sS.bindUniformBlock(
|
|
1086
1086
|
resources[${c}],
|
|
1087
1087
|
'${d}',
|
|
@@ -1092,10 +1092,10 @@ fn mainFragment(
|
|
|
1092
1092
|
`)),e._gl.uniform1i(f.location,n),t.push(`
|
|
1093
1093
|
tS.bind(resources[${c}], ${n});
|
|
1094
1094
|
`),n++);}}}let a=[...i,...t].join(`
|
|
1095
|
-
`);return new Function("r","s","sD",a)}var
|
|
1095
|
+
`);return new Function("r","s","sD",a)}var A2=p(()=>{Xl();Oe();We();});var Kp,xa,C2=p(()=>{Kp=class{},xa=class{constructor(e,t){this.program=e,this.uniformData=t,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBlockBindings={};}destroy(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBlockBindings=null,this.program=null;}};});function Ql(r,e,t){let i=r.createShader(e);return r.shaderSource(i,t),r.compileShader(i),i}var w2=p(()=>{});function P2(r){let e=new Array(r);for(let t=0;t<e.length;t++)e[t]=false;return e}function _a(r,e){switch(r){case "float":return 0;case "vec2":return new Float32Array(2*e);case "vec3":return new Float32Array(3*e);case "vec4":return new Float32Array(4*e);case "int":case "uint":case "sampler2D":case "sampler2DArray":return 0;case "ivec2":return new Int32Array(2*e);case "ivec3":return new Int32Array(3*e);case "ivec4":return new Int32Array(4*e);case "uvec2":return new Uint32Array(2*e);case "uvec3":return new Uint32Array(3*e);case "uvec4":return new Uint32Array(4*e);case "bool":return false;case "bvec2":return P2(2*e);case "bvec3":return P2(3*e);case "bvec4":return P2(4*e);case "mat2":return new Float32Array([1,0,0,1]);case "mat3":return new Float32Array([1,0,0,0,1,0,0,0,1]);case "mat4":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}var Zp=p(()=>{});function Jl(r,e){if(!Qp){let t=Object.keys(PS);Qp={};for(let i=0;i<t.length;++i){let s=t[i];Qp[r[s]]=PS[s];}}return Qp[e]}function Jp(r,e){let t=Jl(r,e);return Ww[t]||"float32"}var Qp,PS,Ww,em=p(()=>{Qp=null,PS={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",UNSIGNED_INT:"uint",UNSIGNED_INT_VEC2:"uvec2",UNSIGNED_INT_VEC3:"uvec3",UNSIGNED_INT_VEC4:"uvec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",INT_SAMPLER_2D:"sampler2D",UNSIGNED_INT_SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",INT_SAMPLER_CUBE:"samplerCube",UNSIGNED_INT_SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray",INT_SAMPLER_2D_ARRAY:"sampler2DArray",UNSIGNED_INT_SAMPLER_2D_ARRAY:"sampler2DArray"},Ww={float:"float32",vec2:"float32x2",vec3:"float32x3",vec4:"float32x4",int:"sint32",ivec2:"sint32x2",ivec3:"sint32x3",ivec4:"sint32x4",uint:"uint32",uvec2:"uint32x2",uvec3:"uint32x3",uvec4:"uint32x4",bool:"uint32",bvec2:"uint32x2",bvec3:"uint32x3",bvec4:"uint32x4"};});function tm(r,e,t=false){let i={},s=e.getProgramParameter(r,e.ACTIVE_ATTRIBUTES);for(let o=0;o<s;o++){let a=e.getActiveAttrib(r,o);if(a.name.startsWith("gl_"))continue;let u=Jp(e,a.type);i[a.name]={location:0,format:u,stride:ut(u).stride,offset:0,instance:false,start:0};}let n=Object.keys(i);if(t){n.sort((o,a)=>o>a?1:-1);for(let o=0;o<n.length;o++)i[n[o]].location=o,e.bindAttribLocation(r,o,n[o]);e.linkProgram(r);}else for(let o=0;o<n.length;o++)i[n[o]].location=e.getAttribLocation(r,n[o]);return i}var B2=p(()=>{yi();em();});function rm(r,e){if(!e.ACTIVE_UNIFORM_BLOCKS)return {};let t={},i=e.getProgramParameter(r,e.ACTIVE_UNIFORM_BLOCKS);for(let s=0;s<i;s++){let n=e.getActiveUniformBlockName(r,s),o=e.getUniformBlockIndex(r,n),a=e.getActiveUniformBlockParameter(r,s,e.UNIFORM_BLOCK_DATA_SIZE);t[n]={name:n,index:o,size:a};}return t}var R2=p(()=>{});function im(r,e){let t={},i=e.getProgramParameter(r,e.ACTIVE_UNIFORMS);for(let s=0;s<i;s++){let n=e.getActiveUniform(r,s),o=n.name.replace(/\[.*?\]$/,""),a=!!n.name.match(/\[.*?\]$/),u=Jl(e,n.type);t[o]={name:o,index:s,type:u,size:n.size,isArray:a,value:_a(u,n.size)};}return t}var M2=p(()=>{Zp();em();});function BS(r,e){let t=r.getShaderSource(e).split(`
|
|
1096
1096
|
`).map((l,c)=>`${c}: ${l}`),i=r.getShaderInfoLog(e),s=i.split(`
|
|
1097
1097
|
`),n={},o=s.map(l=>parseFloat(l.replace(/^ERROR\: 0\:([\d]+)\:.*$/,"$1"))).filter(l=>l&&!n[l]?(n[l]=true,true):false),a=[""];o.forEach(l=>{t[l-1]=`%c${t[l-1]}%c`,a.push("background: #FF0000; color:#FFFFFF; font-size: 10px","font-size: 10px");});let u=t.join(`
|
|
1098
|
-
`);a[0]=u,console.error(i),console.groupCollapsed("click to view full shader code"),console.warn(...a),console.groupEnd();}function
|
|
1098
|
+
`);a[0]=u,console.error(i),console.groupCollapsed("click to view full shader code"),console.warn(...a),console.groupEnd();}function sm(r,e,t,i){r.getProgramParameter(e,r.LINK_STATUS)||(r.getShaderParameter(t,r.COMPILE_STATUS)||BS(r,t),r.getShaderParameter(i,r.COMPILE_STATUS)||BS(r,i),console.error("PixiJS Error: Could not initialize shader."),r.getProgramInfoLog(e)!==""&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",r.getProgramInfoLog(e)));}var D2=p(()=>{});function nm(r,e){let t=Ql(r,r.VERTEX_SHADER,e.vertex),i=Ql(r,r.FRAGMENT_SHADER,e.fragment),s=r.createProgram();r.attachShader(s,t),r.attachShader(s,i);let n=e.transformFeedbackVaryings;n&&(typeof r.transformFeedbackVaryings!="function"?R("TransformFeedback is not supported but TransformFeedbackVaryings are given."):r.transformFeedbackVaryings(s,n.names,n.bufferMode==="separate"?r.SEPARATE_ATTRIBS:r.INTERLEAVED_ATTRIBS)),r.linkProgram(s),r.getProgramParameter(s,r.LINK_STATUS)||sm(r,s,t,i),e._attributeData=tm(s,r,!/^[ \t]*#[ \t]*version[ \t]+300[ \t]+es[ \t]*$/m.test(e.vertex)),e._uniformData=im(s,r),e._uniformBlockData=rm(s,r),r.deleteShader(t),r.deleteShader(i);let o={};for(let u in e._uniformData){let l=e._uniformData[u];o[u]={location:r.getUniformLocation(s,u),value:_a(l.type,l.size)};}return new xa(s,o)}var F2=p(()=>{ne();C2();w2();Zp();B2();R2();M2();D2();});var om,Xn,G2=p(()=>{S();A2();F2();om={textureCount:0,blockIndex:0},Xn=class{constructor(e){this._activeProgram=null,this._programDataHash=Object.create(null),this._shaderSyncFunctions=Object.create(null),this._renderer=e;}contextChange(e){this._gl=e,this._programDataHash=Object.create(null),this._shaderSyncFunctions=Object.create(null),this._activeProgram=null;}bind(e,t){if(this._setProgram(e.glProgram),t)return;om.textureCount=0,om.blockIndex=0;let i=this._shaderSyncFunctions[e.glProgram._key];i||(i=this._shaderSyncFunctions[e.glProgram._key]=this._generateShaderSync(e,this)),this._renderer.buffer.nextBindBase(!!e.glProgram.transformFeedbackVaryings),i(this._renderer,e,om);}updateUniformGroup(e){this._renderer.uniformGroup.updateUniformGroup(e,this._activeProgram,om);}bindUniformBlock(e,t,i=0){let s=this._renderer.buffer,n=this._getProgramData(this._activeProgram),o=e._bufferResource;o||this._renderer.ubo.updateUniformGroup(e);let a=e.buffer,u=s.updateBuffer(a),l=s.freeLocationForBufferBase(u);if(o){let{offset:h,size:d}=e;h===0&&d===a.data.byteLength?s.bindBufferBase(u,l):s.bindBufferRange(u,l,h);}else s.getLastBindBaseLocation(u)!==l&&s.bindBufferBase(u,l);let c=this._activeProgram._uniformBlockData[t].index;n.uniformBlockBindings[i]!==l&&(n.uniformBlockBindings[i]=l,this._renderer.gl.uniformBlockBinding(n.program,c,l));}_setProgram(e){if(this._activeProgram===e)return;this._activeProgram=e;let t=this._getProgramData(e);this._gl.useProgram(t.program);}_getProgramData(e){return this._programDataHash[e._key]||this._createProgramData(e)}_createProgramData(e){let t=e._key;return this._programDataHash[t]=nm(this._gl,e),this._programDataHash[t]}destroy(){for(let e of Object.keys(this._programDataHash))this._programDataHash[e].destroy();this._programDataHash=null,this._shaderSyncFunctions=null,this._activeProgram=null,this._renderer=null,this._gl=null;}_generateShaderSync(e,t){return qp(e,t)}resetState(){this._activeProgram=null;}};Xn.extension={type:[m.WebGLSystem],name:"shader"};});var am,um,U2=p(()=>{am={f32:`if (cv !== v) {
|
|
1099
1099
|
cu.value = v;
|
|
1100
1100
|
gl.uniform1f(location, v);
|
|
1101
1101
|
}`,"vec2<f32>":`if (cv[0] !== v[0] || cv[1] !== v[1]) {
|
|
@@ -1167,7 +1167,7 @@ fn mainFragment(
|
|
|
1167
1167
|
cv[2] = v[2];
|
|
1168
1168
|
cv[3] = v[3];
|
|
1169
1169
|
gl.uniform4i(location, v[0], v[1], v[2], v[3]);
|
|
1170
|
-
}`,"mat2x2<f32>":"gl.uniformMatrix2fv(location, false, v);","mat3x3<f32>":"gl.uniformMatrix3fv(location, false, v);","mat4x4<f32>":"gl.uniformMatrix4fv(location, false, v);"},
|
|
1170
|
+
}`,"mat2x2<f32>":"gl.uniformMatrix2fv(location, false, v);","mat3x3<f32>":"gl.uniformMatrix3fv(location, false, v);","mat4x4<f32>":"gl.uniformMatrix4fv(location, false, v);"},um={f32:"gl.uniform1fv(location, v);","vec2<f32>":"gl.uniform2fv(location, v);","vec3<f32>":"gl.uniform3fv(location, v);","vec4<f32>":"gl.uniform4fv(location, v);","mat2x2<f32>":"gl.uniformMatrix2fv(location, false, v);","mat3x3<f32>":"gl.uniformMatrix3fv(location, false, v);","mat4x4<f32>":"gl.uniformMatrix4fv(location, false, v);",i32:"gl.uniform1iv(location, v);","vec2<i32>":"gl.uniform2iv(location, v);","vec3<i32>":"gl.uniform3iv(location, v);","vec4<i32>":"gl.uniform4iv(location, v);",u32:"gl.uniform1iv(location, v);","vec2<u32>":"gl.uniform2iv(location, v);","vec3<u32>":"gl.uniform3iv(location, v);","vec4<u32>":"gl.uniform4iv(location, v);",bool:"gl.uniform1iv(location, v);","vec2<bool>":"gl.uniform2iv(location, v);","vec3<bool>":"gl.uniform3iv(location, v);","vec4<bool>":"gl.uniform4iv(location, v);"};});function lm(r,e){let t=[`
|
|
1171
1171
|
var v = null;
|
|
1172
1172
|
var cv = null;
|
|
1173
1173
|
var cu = null;
|
|
@@ -1178,18 +1178,18 @@ fn mainFragment(
|
|
|
1178
1178
|
renderer.shader.bindUniformBlock(uv.${i}, "${i}");
|
|
1179
1179
|
`):t.push(`
|
|
1180
1180
|
renderer.shader.updateUniformGroup(uv.${i});
|
|
1181
|
-
`):r.uniforms[i]instanceof
|
|
1181
|
+
`):r.uniforms[i]instanceof Tr&&t.push(`
|
|
1182
1182
|
renderer.shader.bindBufferResource(uv.${i}, "${i}");
|
|
1183
|
-
`);continue}let s=r.uniformStructures[i],n=false;for(let o=0;o<
|
|
1183
|
+
`);continue}let s=r.uniformStructures[i],n=false;for(let o=0;o<cr.length;o++){let a=cr[o];if(s.type===a.type&&a.test(s)){t.push(`name = "${i}";`,cr[o].uniform),n=true;break}}if(!n){let a=(s.size===1?am:um)[s.type].replace("location",`ud["${i}"].location`);t.push(`
|
|
1184
1184
|
cu = ud["${i}"];
|
|
1185
1185
|
cv = cu.value;
|
|
1186
1186
|
v = uv["${i}"];
|
|
1187
1187
|
${a};`);}}return new Function("ud","uv","renderer","syncData",t.join(`
|
|
1188
|
-
`))}var _y=p(()=>{uu();Ie();Lh();gy();});var fo,by=p(()=>{S();_y();fo=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 xy(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;}};fo.extension={type:[m.WebGLSystem],name:"uniformGroup"};});function yy(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 U.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 vy=p(()=>{ae();});var ew,tw,rw,iw,sw,nw,uS,Sy,Ey=p(()=>{S();Rt();vy();ew=0,tw=1,rw=2,iw=3,sw=4,nw=5,uS=class Ty{constructor(e){this._invertFrontFace=false,this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode="none",this._blendEq=false,this.map=[],this.map[ew]=this.setBlend,this.map[tw]=this.setOffset,this.map[rw]=this.setCullFace,this.map[iw]=this.setDepthTest,this.map[sw]=this.setFrontFace,this.map[nw]=this.setDepthMask,this.checks=[],this.defaultState=Se.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=yy(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(Ty._checkBlendMode,e),this.gl[e?"enable":"disable"](this.gl.BLEND);}setOffset(e){this._updateCheck(Ty._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;}};uS.extension={type:[m.WebGLSystem],name:"state"};Sy=uS;});var vu,Ay=p(()=>{Zh();vu=class{constructor(e){this.target=Kh.TEXTURE_2D,this.texture=e,this.width=-1,this.height=-1,this.type=ne.UNSIGNED_BYTE,this.internalFormat=gu.RGBA,this.format=gu.RGBA,this.samplerType=0;}destroy(){}};});var Cy,wy=p(()=>{Cy={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 ow,Py,By=p(()=>{ow={"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},Py={id:"compressed",upload(r,e,t){t.pixelStorei(t.UNPACK_ALIGNMENT,4);let i=r.pixelWidth,s=r.pixelHeight,n=!!ow[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 Tu,ad=p(()=>{Tu={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 Ry,My=p(()=>{ad();Ry={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}Tu.upload(r,e,t,i);}};});var ud,Dy,Su,Fy,Gy=p(()=>{ud={linear:9729,nearest:9728},Dy={linear:{linear:9987,nearest:9985},nearest:{linear:9986,nearest:9984}},Su={"clamp-to-edge":33071,repeat:10497,"mirror-repeat":33648},Fy={never:512,less:513,equal:514,"less-equal":515,greater:516,"not-equal":517,"greater-equal":518,always:519};});function ld(r,e,t,i,s,n,o,a){let u=n;if(!a||r.addressModeU!=="repeat"||r.addressModeV!=="repeat"||r.addressModeW!=="repeat"){let l=Su[o?"clamp-to-edge":r.addressModeU],c=Su[o?"clamp-to-edge":r.addressModeV],h=Su[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,ud[r.magFilter]),t){if(!a||r.mipmapFilter!=="linear"){let l=Dy[r.minFilter][r.mipmapFilter];e[s](u,e.TEXTURE_MIN_FILTER,l);}}else e[s](u,e.TEXTURE_MIN_FILTER,ud[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,Fy[r.compare]);}var Uy=p(()=>{Gy();});function Iy(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 Oy=p(()=>{});function ky(r,e){let t={},i=r.RGBA;return r instanceof U.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 Ly=p(()=>{ae();});function Ny(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 Hy=p(()=>{});function aw(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 lS=p(()=>{});var uw,po,Vy=p(()=>{ae();S();dt();ee();Ay();wy();By();ad();My();Uy();Oy();Ly();Hy();uw=4,po=class{constructor(e){this._glSamplers=Object.create(null),this._boundTextures=[],this._activeTextureLocation=-1,this._boundSamplers=Object.create(null),this._uploads={image:Tu,buffer:Cy,video:Ry,compressed:Py},this._premultiplyAlpha=false,this._useSeparateSamplers=false,this._renderer=e,this._managedTextures=new pe({renderer:e,type:"resource",onUnload:this.onSourceUnload.bind(this),name:"glTexture"});}get managedTextures(){return Object.values(this._managedTextures.items)}contextChange(e){this._gl=e,this._mapFormatToInternalFormat||(this._mapFormatToInternalFormat=ky(e,this._renderer.context.extensions),this._mapFormatToType=Ny(e),this._mapFormatToFormat=Iy(e)),this._managedTextures.removeAll(true),this._glSamplers=Object.create(null),this._boundSamplers=Object.create(null),this._premultiplyAlpha=false;for(let t=0;t<16;t++)this.bind(C.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._gcLastUsed=this._renderer.gc.now,this._boundTextures[t]!==e){this._boundTextures[t]=e,this._activateLocation(t),e||(e=C.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 vu(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 n=Math.max(e.width,e.height);e.mipLevelCount=Math.floor(Math.log2(n))+1;}return e._gpuData[this._renderer.uid]=i,this._managedTextures.add(e)&&(e.on("update",this.onSourceUpdate,this),e.on("resize",this.onSourceUpdate,this),e.on("styleChange",this.onStyleChange,this),e.on("updateMipmaps",this.onUpdateMipmaps,this)),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,ld(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,t=false){let i=e._gpuData[this._renderer.uid];i&&(t||(this.unbind(e),this._gl.deleteTexture(i.texture)),e.off("update",this.onSourceUpdate,this),e.off("resize",this.onSourceUpdate,this),e.off("styleChange",this.onStyleChange,this),e.off("updateMipmaps",this.onUpdateMipmaps,this));}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,i.internalFormat,e.pixelWidth,e.pixelHeight,0,i.format,i.type,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);}_initSampler(e){let t=this._gl,i=this._gl.createSampler();return this._glSamplers[e._resourceId]=i,ld(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 e._gcLastUsed=this._renderer.gc.now,e._gpuData[this._renderer.uid]||this._initSource(e)}generateCanvas(e){let{pixels:t,width:i,height:s}=this.getPixels(e),n=U.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(uw*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.destroy(),this._glSamplers=null,this._boundTextures=null,this._boundSamplers=null,this._mapFormatToInternalFormat=null,this._mapFormatToType=null,this._mapFormatToFormat=null,this._uploads=null,this._renderer=null;}resetState(){this._activeTextureLocation=-1,this._boundTextures.fill(C.EMPTY.source),this._boundSamplers=Object.create(null);let e=this._gl;this._premultiplyAlpha=false,e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this._premultiplyAlpha);}};po.extension={type:[m.WebGLSystem],name:"texture"};});var fS={};xv(fS,{WebGLRenderer:()=>cd});var lw,cw,hw,cS,hS,dS,cd,zy=p(()=>{S();T0();S0();E0();_n();Uh();Bt();w0();R0();F0();I0();O0();k0();L0();N0();Y0();q0();fy();by();Ey();Vy();lw=[...nu,lo,U0,B0,ao,io,po,co,so,fo,ho,oo,Sy,uo,no],cw=[...ou],hw=[to,eo,Jn],cS=[],hS=[],dS=[];G.handleByNamedList(m.WebGLSystem,cS);G.handleByNamedList(m.WebGLPipes,hS);G.handleByNamedList(m.WebGLPipesAdaptor,dS);G.add(...lw,...cw,...hw);cd=class extends Dr{constructor(){let e={name:"webgl",type:ye.WEBGL,systems:cS,renderPipes:hS,renderPipeAdaptors:dS};super(e);}};});var Lu=Wr(vo=>{function EP(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 E2(r,e){return e===void 0&&(e=Object),e&&typeof e.freeze=="function"?e.freeze(r):r}function AP(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 DS=E2({HTML:"text/html",isHTML:function(r){return r===DS.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),FS=E2({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(r){return r===FS.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});vo.assign=AP;vo.find=EP;vo.freeze=E2;vo.MIME_TYPE=DS;vo.NAMESPACE=FS;});var U2=Wr(fi=>{var HS=Lu(),mr=HS.find,Nu=HS.NAMESPACE;function CP(r){return r!==""}function wP(r){return r?r.split(/[\t\n\f\r ]+/).filter(CP):[]}function PP(r,e){return r.hasOwnProperty(e)||(r[e]=true),r}function GS(r){if(!r)return [];var e=wP(r);return Object.keys(e.reduce(PP,{}))}function BP(r){return function(e){return r&&r.indexOf(e)!==-1}}function zu(r,e){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t]);}function Et(r,e){var t=r.prototype;if(!(t instanceof e)){let s=function(){};s.prototype=e.prototype,s=new s,zu(t,s),r.prototype=t=s;}t.constructor!=r&&(typeof r!="function"&&console.error("unknown Class:"+r),t.constructor=r);}var At={},It=At.ELEMENT_NODE=1,So=At.ATTRIBUTE_NODE=2,Ad=At.TEXT_NODE=3,VS=At.CDATA_SECTION_NODE=4,zS=At.ENTITY_REFERENCE_NODE=5,RP=At.ENTITY_NODE=6,WS=At.PROCESSING_INSTRUCTION_NODE=7,XS=At.COMMENT_NODE=8,YS=At.DOCUMENT_NODE=9,$S=At.DOCUMENT_TYPE_NODE=10,Lr=At.DOCUMENT_FRAGMENT_NODE=11,MP=At.NOTATION_NODE=12,ot={},$e={};ot.INDEX_SIZE_ERR=($e[1]="Index size error",1);ot.DOMSTRING_SIZE_ERR=($e[2]="DOMString size error",2);var St=ot.HIERARCHY_REQUEST_ERR=($e[3]="Hierarchy request error",3);ot.WRONG_DOCUMENT_ERR=($e[4]="Wrong document",4);ot.INVALID_CHARACTER_ERR=($e[5]="Invalid character",5);ot.NO_DATA_ALLOWED_ERR=($e[6]="No data allowed",6);ot.NO_MODIFICATION_ALLOWED_ERR=($e[7]="No modification allowed",7);var jS=ot.NOT_FOUND_ERR=($e[8]="Not found",8);ot.NOT_SUPPORTED_ERR=($e[9]="Not supported",9);var US=ot.INUSE_ATTRIBUTE_ERR=($e[10]="Attribute in use",10);ot.INVALID_STATE_ERR=($e[11]="Invalid state",11);ot.SYNTAX_ERR=($e[12]="Syntax error",12);ot.INVALID_MODIFICATION_ERR=($e[13]="Invalid modification",13);ot.NAMESPACE_ERR=($e[14]="Invalid namespace",14);ot.INVALID_ACCESS_ERR=($e[15]="Invalid access",15);function Oe(r,e){if(e instanceof Error)var t=e;else t=this,Error.call(this,$e[r]),this.message=$e[r],Error.captureStackTrace&&Error.captureStackTrace(this,Oe);return t.code=r,e&&(this.message=this.message+": "+e),t}Oe.prototype=Error.prototype;zu(ot,Oe);function kr(){}kr.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++)To(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 Eo(r,e){this._node=r,this._refresh=e,w2(this);}function w2(r){var e=r._node._inc||r._node.ownerDocument._inc;if(r._inc!==e){var t=r._refresh(r._node);if(oE(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];zu(t,r),r._inc=e;}}Eo.prototype.item=function(r){return w2(this),this[r]||null};Et(Eo,kr);function Cd(){}function qS(r,e){for(var t=r.length;t--;)if(r[t]===e)return t}function IS(r,e,t,i){if(i?e[qS(e,i)]=t:e[e.length++]=t,r){t.ownerElement=r;var s=r.ownerDocument;s&&(i&&QS(s,r,i),DP(s,r,t));}}function OS(r,e,t){var i=qS(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&&(QS(n,r,t),t.ownerElement=null);}}else throw new Oe(jS,new Error(r.tagName+"@"+t))}Cd.prototype={length:0,item:kr.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 Oe(US);var t=this.getNamedItem(r.nodeName);return IS(this._ownerElement,this,r,t),t},setNamedItemNS:function(r){var e=r.ownerElement,t;if(e&&e!=this._ownerElement)throw new Oe(US);return t=this.getNamedItemNS(r.namespaceURI,r.localName),IS(this._ownerElement,this,r,t),t},removeNamedItem:function(r){var e=this.getNamedItem(r);return OS(this._ownerElement,this,e),e},removeNamedItemNS:function(r,e){var t=this.getNamedItemNS(r,e);return OS(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 KS(){}KS.prototype={hasFeature:function(r,e){return true},createDocument:function(r,e,t){var i=new Wu;if(i.implementation=this,i.childNodes=new kr,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 Bd;return i.name=r,i.nodeName=r,i.publicId=e||"",i.systemId=t||"",i}};function me(){}me.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 wd(this,r,e)},replaceChild:function(r,e){wd(this,r,e,eE),e&&this.removeChild(e);},removeChild:function(r){return JS(this,r)},appendChild:function(r){return this.insertBefore(r,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(r){return C2(this.ownerDocument||this,this,r)},normalize:function(){for(var r=this.firstChild;r;){var e=r.nextSibling;e&&e.nodeType==Ad&&r.nodeType==Ad?(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==So?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==So?e.ownerDocument:e.parentNode;}return null},isDefaultNamespace:function(r){var e=this.lookupPrefix(r);return e==null}};function ZS(r){return r=="<"&&"<"||r==">"&&">"||r=="&"&&"&"||r=='"'&&"""||"&#"+r.charCodeAt()+";"}zu(At,me);zu(At,me.prototype);function Hu(r,e){if(e(r))return true;if(r=r.firstChild)do if(Hu(r,e))return true;while(r=r.nextSibling)}function Wu(){this.ownerDocument=this;}function DP(r,e,t){r&&r._inc++;var i=t.namespaceURI;i===Nu.XMLNS&&(e._nsMap[t.prefix?t.localName:""]=t.value);}function QS(r,e,t,i){r&&r._inc++;var s=t.namespaceURI;s===Nu.XMLNS&&delete e._nsMap[t.prefix?t.localName:""];}function P2(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 JS(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,P2(r.ownerDocument,r),e}function FP(r){return r&&(r.nodeType===me.DOCUMENT_NODE||r.nodeType===me.DOCUMENT_FRAGMENT_NODE||r.nodeType===me.ELEMENT_NODE)}function GP(r){return r&&(gr(r)||B2(r)||Nr(r)||r.nodeType===me.DOCUMENT_FRAGMENT_NODE||r.nodeType===me.COMMENT_NODE||r.nodeType===me.PROCESSING_INSTRUCTION_NODE)}function Nr(r){return r&&r.nodeType===me.DOCUMENT_TYPE_NODE}function gr(r){return r&&r.nodeType===me.ELEMENT_NODE}function B2(r){return r&&r.nodeType===me.TEXT_NODE}function kS(r,e){var t=r.childNodes||[];if(mr(t,gr)||Nr(e))return false;var i=mr(t,Nr);return !(e&&i&&t.indexOf(i)>t.indexOf(e))}function LS(r,e){var t=r.childNodes||[];function i(n){return gr(n)&&n!==e}if(mr(t,i))return false;var s=mr(t,Nr);return !(e&&s&&t.indexOf(s)>t.indexOf(e))}function UP(r,e,t){if(!FP(r))throw new Oe(St,"Unexpected parent node type "+r.nodeType);if(t&&t.parentNode!==r)throw new Oe(jS,"child not in parent");if(!GP(e)||Nr(e)&&r.nodeType!==me.DOCUMENT_NODE)throw new Oe(St,"Unexpected node type "+e.nodeType+" for parent node type "+r.nodeType)}function IP(r,e,t){var i=r.childNodes||[],s=e.childNodes||[];if(e.nodeType===me.DOCUMENT_FRAGMENT_NODE){var n=s.filter(gr);if(n.length>1||mr(s,B2))throw new Oe(St,"More than one element or text in fragment");if(n.length===1&&!kS(r,t))throw new Oe(St,"Element in fragment can not be inserted before doctype")}if(gr(e)&&!kS(r,t))throw new Oe(St,"Only one element can be added and only after doctype");if(Nr(e)){if(mr(i,Nr))throw new Oe(St,"Only one doctype is allowed");var o=mr(i,gr);if(t&&i.indexOf(o)<i.indexOf(t))throw new Oe(St,"Doctype can only be inserted before an element");if(!t&&o)throw new Oe(St,"Doctype can not be appended since element is present")}}function eE(r,e,t){var i=r.childNodes||[],s=e.childNodes||[];if(e.nodeType===me.DOCUMENT_FRAGMENT_NODE){var n=s.filter(gr);if(n.length>1||mr(s,B2))throw new Oe(St,"More than one element or text in fragment");if(n.length===1&&!LS(r,t))throw new Oe(St,"Element in fragment can not be inserted before doctype")}if(gr(e)&&!LS(r,t))throw new Oe(St,"Only one element can be added and only after doctype");if(Nr(e)){let u=function(l){return Nr(l)&&l!==t};if(mr(i,u))throw new Oe(St,"Only one doctype is allowed");var o=mr(i,gr);if(t&&i.indexOf(o)<i.indexOf(t))throw new Oe(St,"Doctype can only be inserted before an element")}}function wd(r,e,t,i){UP(r,e,t),r.nodeType===me.DOCUMENT_NODE&&(i||IP)(r,e,t);var s=e.parentNode;if(s&&s.removeChild(e),e.nodeType===Lr){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;var u=r.ownerDocument||r;Vu(n,u);}while(n!==o&&(n=n.nextSibling));return P2(r.ownerDocument||r,r),e.nodeType==Lr&&(e.firstChild=e.lastChild=null),e}function Vu(r,e){if(r.ownerDocument!==e){if(r.ownerDocument=e,r.nodeType===It&&r.attributes)for(var t=0;t<r.attributes.length;t++){var i=r.attributes.item(t);i&&(i.ownerDocument=e);}for(var s=r.firstChild;s;)Vu(s,e),s=s.nextSibling;}}function OP(r,e){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,P2(r.ownerDocument,r,e);var t=r.ownerDocument||r;return Vu(e,t),e}Wu.prototype={nodeName:"#document",nodeType:YS,doctype:null,documentElement:null,_inc:1,insertBefore:function(r,e){if(r.nodeType==Lr){for(var t=r.firstChild;t;){var i=t.nextSibling;this.insertBefore(t,e),t=i;}return r}return wd(this,r,e),Vu(r,this),this.documentElement===null&&r.nodeType===It&&(this.documentElement=r),r},removeChild:function(r){return this.documentElement==r&&(this.documentElement=null),JS(this,r)},replaceChild:function(r,e){wd(this,r,e,eE),Vu(r,this),e&&this.removeChild(e),gr(r)&&(this.documentElement=r);},importNode:function(r,e){return nE(this,r,e)},getElementById:function(r){var e=null;return Hu(this.documentElement,function(t){if(t.nodeType==It&&t.getAttribute("id")==r)return e=t,true}),e},getElementsByClassName:function(r){var e=GS(r);return new Eo(this,function(t){var i=[];return e.length>0&&Hu(t.documentElement,function(s){if(s!==t&&s.nodeType===It){var n=s.getAttribute("class");if(n){var o=r===n;if(!o){var a=GS(n);o=e.every(BP(a));}o&&i.push(s);}}}),i})},createElement:function(r){var e=new Ss;e.ownerDocument=this,e.nodeName=r,e.tagName=r,e.localName=r,e.childNodes=new kr;var t=e.attributes=new Cd;return t._ownerElement=e,e},createDocumentFragment:function(){var r=new Rd;return r.ownerDocument=this,r.childNodes=new kr,r},createTextNode:function(r){var e=new R2;return e.ownerDocument=this,e.appendData(r),e},createComment:function(r){var e=new M2;return e.ownerDocument=this,e.appendData(r),e},createCDATASection:function(r){var e=new D2;return e.ownerDocument=this,e.appendData(r),e},createProcessingInstruction:function(r,e){var t=new G2;return t.ownerDocument=this,t.tagName=t.nodeName=t.target=r,t.nodeValue=t.data=e,t},createAttribute:function(r){var e=new Pd;return e.ownerDocument=this,e.name=r,e.nodeName=r,e.localName=r,e.specified=true,e},createEntityReference:function(r){var e=new F2;return e.ownerDocument=this,e.nodeName=r,e},createElementNS:function(r,e){var t=new Ss,i=e.split(":"),s=t.attributes=new Cd;return t.childNodes=new kr,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 Pd,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}};Et(Wu,me);function Ss(){this._nsMap={};}Ss.prototype={nodeType:It,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===Lr?this.insertBefore(r,null):OP(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 Eo(this,function(e){var t=[];return Hu(e,function(i){i!==e&&i.nodeType==It&&(r==="*"||i.tagName==r)&&t.push(i);}),t})},getElementsByTagNameNS:function(r,e){return new Eo(this,function(t){var i=[];return Hu(t,function(s){s!==t&&s.nodeType===It&&(r==="*"||s.namespaceURI===r)&&(e==="*"||s.localName==e)&&i.push(s);}),i})}};Wu.prototype.getElementsByTagName=Ss.prototype.getElementsByTagName;Wu.prototype.getElementsByTagNameNS=Ss.prototype.getElementsByTagNameNS;Et(Ss,me);function Pd(){}Pd.prototype.nodeType=So;Et(Pd,me);function Xu(){}Xu.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($e[St])},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;}};Et(Xu,me);function R2(){}R2.prototype={nodeName:"#text",nodeType:Ad,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}};Et(R2,Xu);function M2(){}M2.prototype={nodeName:"#comment",nodeType:XS};Et(M2,Xu);function D2(){}D2.prototype={nodeName:"#cdata-section",nodeType:VS};Et(D2,Xu);function Bd(){}Bd.prototype.nodeType=$S;Et(Bd,me);function tE(){}tE.prototype.nodeType=MP;Et(tE,me);function rE(){}rE.prototype.nodeType=RP;Et(rE,me);function F2(){}F2.prototype.nodeType=zS;Et(F2,me);function Rd(){}Rd.prototype.nodeName="#document-fragment";Rd.prototype.nodeType=Lr;Et(Rd,me);function G2(){}G2.prototype.nodeType=WS;Et(G2,me);function iE(){}iE.prototype.serializeToString=function(r,e,t){return sE.call(r,e,t)};me.prototype.toString=sE;function sE(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 To(this,t,r,e,o),t.join("")}function NS(r,e,t){var i=r.prefix||"",s=r.namespaceURI;if(!s||i==="xml"&&s===Nu.XML||s===Nu.XMLNS)return false;for(var n=t.length;n--;){var o=t[n];if(o.prefix===i)return o.namespace!==s}return true}function A2(r,e,t){r.push(" ",e,'="',t.replace(/[<>&"\t\n\r]/g,ZS),'"');}function To(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 It:var n=r.attributes,o=n.length,b=r.firstChild,a=r.tagName;t=Nu.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 f=0;f<o;f++){var g=n.item(f);g.prefix=="xmlns"?s.push({prefix:g.localName,namespace:g.value}):g.nodeName=="xmlns"&&s.push({prefix:"",namespace:g.value});}for(var f=0;f<o;f++){var g=n.item(f);if(NS(g,t,s)){var _=g.prefix||"",x=g.namespaceURI;A2(e,_?"xmlns:"+_:"xmlns",x),s.push({prefix:_,namespace:x});}To(g,e,t,i,s);}if(a===u&&NS(r,t,s)){var _=r.prefix||"",x=r.namespaceURI;A2(e,_?"xmlns:"+_:"xmlns",x),s.push({prefix:_,namespace:x});}if(b||t&&!/^(?:meta|link|img|br|hr|input)$/i.test(a)){if(e.push(">"),t&&/^script$/i.test(a))for(;b;)b.data?e.push(b.data):To(b,e,t,i,s.slice()),b=b.nextSibling;else for(;b;)To(b,e,t,i,s.slice()),b=b.nextSibling;e.push("</",u,">");}else e.push("/>");return;case YS:case Lr:for(var b=r.firstChild;b;)To(b,e,t,i,s.slice()),b=b.nextSibling;return;case So:return A2(e,r.name,r.value);case Ad:return e.push(r.data.replace(/[<&>]/g,ZS));case VS:return e.push("<![CDATA[",r.data,"]]>");case XS:return e.push("<!--",r.data,"-->");case $S:var y=r.publicId,v=r.systemId;if(e.push("<!DOCTYPE ",r.name),y)e.push(" PUBLIC ",y),v&&v!="."&&e.push(" ",v),e.push(">");else if(v&&v!=".")e.push(" SYSTEM ",v,">");else {var T=r.internalSubset;T&&e.push(" [",T,"]"),e.push(">");}return;case WS:return e.push("<?",r.target," ",r.data,"?>");case zS:return e.push("&",r.nodeName,";");default:e.push("??",r.nodeName);}}function nE(r,e,t){var i;switch(e.nodeType){case It:i=e.cloneNode(false),i.ownerDocument=r;case Lr:break;case So:t=true;break}if(i||(i=e.cloneNode(false)),i.ownerDocument=r,i.parentNode=null,t)for(var s=e.firstChild;s;)i.appendChild(nE(r,s,t)),s=s.nextSibling;return i}function C2(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 kr),i.ownerDocument=r,i.nodeType){case It:var o=e.attributes,a=i.attributes=new Cd,u=o.length;a._ownerElement=i;for(var l=0;l<u;l++)i.setAttributeNode(C2(r,o.item(l),true));break;case So:t=true;}if(t)for(var c=e.firstChild;c;)i.appendChild(C2(r,c,t)),c=c.nextSibling;return i}function oE(r,e,t){r[e]=t;}try{if(Object.defineProperty){let r=function(e){switch(e.nodeType){case It:case Lr: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}};kP=r,Object.defineProperty(Eo.prototype,"length",{get:function(){return w2(this),this.$$length}}),Object.defineProperty(me.prototype,"textContent",{get:function(){return r(this)},set:function(e){switch(this.nodeType){case It:case Lr: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;}}}),oE=function(e,t,i){e["$$"+t]=i;};}}catch{}var kP;fi.DocumentType=Bd;fi.DOMException=Oe;fi.DOMImplementation=KS;fi.Element=Ss;fi.Node=me;fi.NodeList=kr;fi.XMLSerializer=iE;});var uE=Wr(Yu=>{var aE=Lu().freeze;Yu.XML_ENTITIES=aE({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'});Yu.HTML_ENTITIES=aE({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:`
|
|
1189
|
-
`,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"});Yu.entityMap=Yu.HTML_ENTITIES;});var gE=Wr(O2=>{var Ku=Lu().NAMESPACE,I2=/[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]/,lE=new RegExp("[\\-\\.0-9"+I2.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),cE=new RegExp("^"+I2.source+lE.source+"*(?::"+I2.source+lE.source+"*)?$"),$u=0,pi=1,Ao=2,ju=3,Co=4,wo=5,qu=6,Md=7;function Po(r,e){this.message=r,this.locator=e,Error.captureStackTrace&&Error.captureStackTrace(this,Po);}Po.prototype=new Error;Po.prototype.name=Po.name;function fE(){}fE.prototype={parse:function(r,e,t){var i=this.domBuilder;i.startDocument(),pE(e,e={}),LP(r,e,t,i,this.errorHandler),i.endDocument();}};function LP(r,e,t,i,s){function n(F){if(F>65535){F-=65536;var L=55296+(F>>10),mi=56320+(F&1023);return String.fromCharCode(L,mi)}else return String.fromCharCode(F)}function o(F){var L=F.slice(1,-1);return Object.hasOwnProperty.call(t,L)?t[L]:L.charAt(0)==="#"?n(parseInt(L.substr(1).replace("x","0x"))):(s.error("entity not found:"+F),F)}function a(F){if(F>_){var L=r.substring(_,F).replace(/&#?\w+;/g,o);d&&u(_),i.characters(L,0,F-_),_=F;}}function u(F,L){for(;F>=c&&(L=h.exec(r));)l=L.index,c=l+L[0].length,d.lineNumber++;d.columnNumber=F-l+1;}for(var l=0,c=0,h=/.*(?:\r\n?|\n)|.*$/g,d=i.locator,f=[{currentNSMap:e}],g={},_=0;;){try{var x=r.indexOf("<",_);if(x<0){if(!r.substr(_).match(/^\s*$/)){var b=i.doc,y=b.createTextNode(r.substr(_));b.appendChild(y),i.currentElement=y;}return}switch(x>_&&a(x),r.charAt(x+1)){case "/":var D=r.indexOf(">",x+3),v=r.substring(x+2,D).replace(/[ \t\n\r]+$/g,""),T=f.pop();D<0?(v=r.substring(x+2).replace(/[\s<].*/,""),s.error("end tag name: "+v+" is not complete:"+T.tagName),D=x+1+v.length):v.match(/\s</)&&(v=v.replace(/[\s<].*/,""),s.error("end tag name: "+v+" maybe not complete"),D=x+1+v.length);var B=T.localNSMap,E=T.tagName==v,A=E||T.tagName&&T.tagName.toLowerCase()==v.toLowerCase();if(A){if(i.endElement(T.uri,T.localName,v),B)for(var k in B)Object.prototype.hasOwnProperty.call(B,k)&&i.endPrefixMapping(k);E||s.fatalError("end tag name: "+v+" is not match the current start tagName:"+T.tagName);}else f.push(T);D++;break;case "?":d&&u(x),D=WP(r,x,i);break;case "!":d&&u(x),D=zP(r,x,i,s);break;default:d&&u(x);var R=new mE,I=f[f.length-1].currentNSMap,D=NP(r,x,R,I,o,s),z=R.length;if(!R.closed&&VP(r,D,R.tagName,g)&&(R.closed=!0,t.nbsp||s.warning("unclosed xml attribute")),d&&z){for(var ie=hE(d,{}),ce=0;ce<z;ce++){var xr=R[ce];u(xr.offset),xr.locator=hE(d,{});}i.locator=ie,dE(R,i,I)&&f.push(R),i.locator=d;}else dE(R,i,I)&&f.push(R);Ku.isHTML(R.uri)&&!R.closed?D=HP(r,D,R.tagName,o,i):D++;}}catch(F){if(F instanceof Po)throw F;s.error("element parse error: "+F),D=-1;}D>_?_=D:a(Math.max(x,_)+1);}}function hE(r,e){return e.lineNumber=r.lineNumber,e.columnNumber=r.columnNumber,e}function NP(r,e,t,i,s,n){function o(f,g,_){t.attributeNames.hasOwnProperty(f)&&n.fatalError("Attribute "+f+" redefined"),t.addValue(f,g.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,s),_);}for(var a,u,l=++e,c=$u;;){var h=r.charAt(l);switch(h){case "=":if(c===pi)a=r.slice(e,l),c=ju;else if(c===Ao)c=ju;else throw new Error("attribute equal must after attrName");break;case "'":case '"':if(c===ju||c===pi)if(c===pi&&(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=wo;else throw new Error("attribute value no end '"+h+"' match");else if(c==Co)u=r.slice(e,l),o(a,u,e),n.warning('attribute "'+a+'" missed start quot('+h+")!!"),e=l+1,c=wo;else throw new Error('attribute value must after "="');break;case "/":switch(c){case $u:t.setTagName(r.slice(e,l));case wo:case qu:case Md:c=Md,t.closed=true;case Co:case pi:break;case Ao:t.closed=true;break;default:throw new Error("attribute invalid close char('/')")}break;case "":return n.error("unexpected end of input"),c==$u&&t.setTagName(r.slice(e,l)),l;case ">":switch(c){case $u:t.setTagName(r.slice(e,l));case wo:case qu:case Md:break;case Co:case pi:u=r.slice(e,l),u.slice(-1)==="/"&&(t.closed=true,u=u.slice(0,-1));case Ao:c===Ao&&(u=a),c==Co?(n.warning('attribute "'+u+'" missed quot(")!'),o(a,u,e)):((!Ku.isHTML(i[""])||!u.match(/^(?:disabled|checked|selected)$/i))&&n.warning('attribute "'+u+'" missed value!! "'+u+'" instead!!'),o(u,u,e));break;case ju:throw new Error("attribute value missed!!")}return l;case "\x80":h=" ";default:if(h<=" ")switch(c){case $u:t.setTagName(r.slice(e,l)),c=qu;break;case pi:a=r.slice(e,l),c=Ao;break;case Co:var u=r.slice(e,l);n.warning('attribute "'+u+'" missed quot(")!!'),o(a,u,e);case wo:c=qu;break}else switch(c){case Ao:t.tagName;(!Ku.isHTML(i[""])||!a.match(/^(?:disabled|checked|selected)$/i))&&n.warning('attribute "'+a+'" missed value!! "'+a+'" instead2!!'),o(a,a,e),e=l,c=pi;break;case wo:n.warning('attribute space is required"'+a+'"!!');case qu:c=pi,e=l;break;case ju:c=Co,e=l;break;case Md:throw new Error("elements closed character '/' and '>' must be connected to")}}l++;}}function dE(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={},pE(t,t={})),t[c]=s[c]=a,n.uri=Ku.XMLNS,e.startPrefixMapping(c,a));}for(var h=r.length;h--;){n=r[h];var u=n.prefix;u&&(u==="xml"&&(n.uri=Ku.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 f=r.uri=t[u||""];if(e.startElement(f,l,i,r),r.closed){if(e.endElement(f,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 HP(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 VP(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 pE(r,e){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t]);}function zP(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=XP(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 WP(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 mE(){this.attributeNames={};}mE.prototype={setTagName:function(r){if(!cE.test(r))throw new Error("invalid tagName:"+r);this.tagName=r;},addValue:function(r,e,t){if(!cE.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 XP(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}O2.XMLReader=fE;O2.ParseError=Po;});var SE=Wr(Fd=>{var YP=Lu(),$P=U2(),xE=uE(),yE=gE(),jP=$P.DOMImplementation,_E=YP.NAMESPACE,qP=yE.ParseError,KP=yE.XMLReader;function vE(r){return r.replace(/\r[\n\u0085]/g,`
|
|
1188
|
+
`))}var I2=p(()=>{Xl();Oe();Cp();U2();});var Yn,O2=p(()=>{S();I2();Yn=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 lm(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;}};Yn.extension={type:[m.WebGLSystem],name:"uniformGroup"};});function cm(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 U.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 k2=p(()=>{ae();});var Xw,Yw,$w,jw,qw,Kw,RS,hm,N2=p(()=>{S();Ft();k2();Xw=0,Yw=1,$w=2,jw=3,qw=4,Kw=5,RS=class L2{constructor(e){this._invertFrontFace=false,this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode="none",this._blendEq=false,this.map=[],this.map[Xw]=this.setBlend,this.map[Yw]=this.setOffset,this.map[$w]=this.setCullFace,this.map[jw]=this.setDepthTest,this.map[qw]=this.setFrontFace,this.map[Kw]=this.setDepthMask,this.checks=[],this.defaultState=Se.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=cm(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(L2._checkBlendMode,e),this.gl[e?"enable":"disable"](this.gl.BLEND);}setOffset(e){this._updateCheck(L2._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;}};RS.extension={type:[m.WebGLSystem],name:"state"};hm=RS;});var ba,H2=p(()=>{Vp();ba=class{constructor(e){this.target=ql.TEXTURE_2D,this.texture=e,this.width=-1,this.height=-1,this.type=ie.UNSIGNED_BYTE,this.internalFormat=pa.RGBA,this.format=pa.RGBA,this.samplerType=0;}destroy(){}};});var dm,V2=p(()=>{dm={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 Zw,fm,z2=p(()=>{Zw={"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},fm={id:"compressed",upload(r,e,t){t.pixelStorei(t.UNPACK_ALIGNMENT,4);let i=r.pixelWidth,s=r.pixelHeight,n=!!Zw[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 ya,pm=p(()=>{ya={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 mm,W2=p(()=>{pm();mm={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}ya.upload(r,e,t,i);}};});var ec,gm,va,xm,X2=p(()=>{ec={linear:9729,nearest:9728},gm={linear:{linear:9987,nearest:9985},nearest:{linear:9986,nearest:9984}},va={"clamp-to-edge":33071,repeat:10497,"mirror-repeat":33648},xm={never:512,less:513,equal:514,"less-equal":515,greater:516,"not-equal":517,"greater-equal":518,always:519};});function tc(r,e,t,i,s,n,o,a){let u=n;if(!a||r.addressModeU!=="repeat"||r.addressModeV!=="repeat"||r.addressModeW!=="repeat"){let l=va[o?"clamp-to-edge":r.addressModeU],c=va[o?"clamp-to-edge":r.addressModeV],h=va[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,ec[r.magFilter]),t){if(!a||r.mipmapFilter!=="linear"){let l=gm[r.minFilter][r.mipmapFilter];e[s](u,e.TEXTURE_MIN_FILTER,l);}}else e[s](u,e.TEXTURE_MIN_FILTER,ec[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,xm[r.compare]);}var Y2=p(()=>{X2();});function _m(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 $2=p(()=>{});function bm(r,e){let t={},i=r.RGBA;return r instanceof U.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 j2=p(()=>{ae();});function ym(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 q2=p(()=>{});function MS(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 DS=p(()=>{});var Qw,$n,K2=p(()=>{ae();S();bt();ee();H2();V2();z2();pm();W2();Y2();$2();j2();q2();Qw=4,$n=class{constructor(e){this._glSamplers=Object.create(null),this._boundTextures=[],this._activeTextureLocation=-1,this._boundSamplers=Object.create(null),this._uploads={image:ya,buffer:dm,video:mm,compressed:fm},this._premultiplyAlpha=false,this._useSeparateSamplers=false,this._renderer=e,this._managedTextures=new pe({renderer:e,type:"resource",onUnload:this.onSourceUnload.bind(this),name:"glTexture"});}get managedTextures(){return Object.values(this._managedTextures.items)}contextChange(e){this._gl=e,this._mapFormatToInternalFormat||(this._mapFormatToInternalFormat=bm(e,this._renderer.context.extensions),this._mapFormatToType=ym(e),this._mapFormatToFormat=_m(e)),this._managedTextures.removeAll(true),this._glSamplers=Object.create(null),this._boundSamplers=Object.create(null),this._premultiplyAlpha=false;for(let t=0;t<16;t++)this.bind(A.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._gcLastUsed=this._renderer.gc.now,this._boundTextures[t]!==e){this._boundTextures[t]=e,this._activateLocation(t),e||(e=A.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 ba(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 n=Math.max(e.width,e.height);e.mipLevelCount=Math.floor(Math.log2(n))+1;}return e._gpuData[this._renderer.uid]=i,this._managedTextures.add(e)&&(e.on("update",this.onSourceUpdate,this),e.on("resize",this.onSourceUpdate,this),e.on("styleChange",this.onStyleChange,this),e.on("updateMipmaps",this.onUpdateMipmaps,this)),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,tc(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,t=false){let i=e._gpuData[this._renderer.uid];i&&(t||(this.unbind(e),this._gl.deleteTexture(i.texture)),e.off("update",this.onSourceUpdate,this),e.off("resize",this.onSourceUpdate,this),e.off("styleChange",this.onStyleChange,this),e.off("updateMipmaps",this.onUpdateMipmaps,this));}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,i.internalFormat,e.pixelWidth,e.pixelHeight,0,i.format,i.type,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);}_initSampler(e){let t=this._gl,i=this._gl.createSampler();return this._glSamplers[e._resourceId]=i,tc(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 e._gcLastUsed=this._renderer.gc.now,e._gpuData[this._renderer.uid]||this._initSource(e)}generateCanvas(e){let{pixels:t,width:i,height:s}=this.getPixels(e),n=U.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(Qw*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.destroy(),this._glSamplers=null,this._boundTextures=null,this._boundSamplers=null,this._mapFormatToInternalFormat=null,this._mapFormatToType=null,this._mapFormatToFormat=null,this._uploads=null,this._renderer=null;}resetState(){this._activeTextureLocation=-1,this._boundTextures.fill(A.EMPTY.source),this._boundSamplers=Object.create(null);let e=this._gl;this._premultiplyAlpha=false,e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this._premultiplyAlpha);}};$n.extension={type:[m.WebGLSystem],name:"texture"};});var IS={};zg(IS,{WebGLRenderer:()=>rc});var Jw,eP,tP,FS,GS,US,rc,Z2=p(()=>{S();r2();i2();s2();Jo();Tp();Dt();a2();l2();d2();p2();m2();g2();x2();_2();v2();E2();G2();O2();N2();K2();Jw=[...ia,zn,Wp,Hp,Hn,On,$n,Wn,kn,Yn,Xn,Nn,hm,Vn,Ln],eP=[...sa],tP=[Un,Gn,Fn],FS=[],GS=[],US=[];G.handleByNamedList(m.WebGLSystem,FS);G.handleByNamedList(m.WebGLPipes,GS);G.handleByNamedList(m.WebGLPipesAdaptor,US);G.add(...Jw,...eP,...tP);rc=class extends br{constructor(){let e={name:"webgl",type:ye.WEBGL,systems:FS,renderPipes:GS,renderPipeAdaptors:US};super(e);}};});var gc=Jr(Oa=>{function JP(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 fv(r,e){return e===void 0&&(e=Object),e&&typeof e.freeze=="function"?e.freeze(r):r}function eB(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 uE=fv({HTML:"text/html",isHTML:function(r){return r===uE.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),lE=fv({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(r){return r===lE.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});Oa.assign=eB;Oa.find=JP;Oa.freeze=fv;Oa.MIME_TYPE=uE;Oa.NAMESPACE=lE;});var Ev=Jr(Qi=>{var xE=gc(),Ar=xE.find,xc=xE.NAMESPACE;function tB(r){return r!==""}function rB(r){return r?r.split(/[\t\n\f\r ]+/).filter(tB):[]}function iB(r,e){return r.hasOwnProperty(e)||(r[e]=true),r}function cE(r){if(!r)return [];var e=rB(r);return Object.keys(e.reduce(iB,{}))}function sB(r){return function(e){return r&&r.indexOf(e)!==-1}}function yc(r,e){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t]);}function Ct(r,e){var t=r.prototype;if(!(t instanceof e)){let s=function(){};s.prototype=e.prototype,s=new s,yc(t,s),r.prototype=t=s;}t.constructor!=r&&(typeof r!="function"&&console.error("unknown Class:"+r),t.constructor=r);}var wt={},Yt=wt.ELEMENT_NODE=1,La=wt.ATTRIBUTE_NODE=2,eg=wt.TEXT_NODE=3,_E=wt.CDATA_SECTION_NODE=4,bE=wt.ENTITY_REFERENCE_NODE=5,nB=wt.ENTITY_NODE=6,yE=wt.PROCESSING_INSTRUCTION_NODE=7,vE=wt.COMMENT_NODE=8,TE=wt.DOCUMENT_NODE=9,SE=wt.DOCUMENT_TYPE_NODE=10,Kr=wt.DOCUMENT_FRAGMENT_NODE=11,oB=wt.NOTATION_NODE=12,mt={},qe={};mt.INDEX_SIZE_ERR=(qe[1]="Index size error",1);mt.DOMSTRING_SIZE_ERR=(qe[2]="DOMString size error",2);var At=mt.HIERARCHY_REQUEST_ERR=(qe[3]="Hierarchy request error",3);mt.WRONG_DOCUMENT_ERR=(qe[4]="Wrong document",4);mt.INVALID_CHARACTER_ERR=(qe[5]="Invalid character",5);mt.NO_DATA_ALLOWED_ERR=(qe[6]="No data allowed",6);mt.NO_MODIFICATION_ALLOWED_ERR=(qe[7]="No modification allowed",7);var EE=mt.NOT_FOUND_ERR=(qe[8]="Not found",8);mt.NOT_SUPPORTED_ERR=(qe[9]="Not supported",9);var hE=mt.INUSE_ATTRIBUTE_ERR=(qe[10]="Attribute in use",10);mt.INVALID_STATE_ERR=(qe[11]="Invalid state",11);mt.SYNTAX_ERR=(qe[12]="Syntax error",12);mt.INVALID_MODIFICATION_ERR=(qe[13]="Invalid modification",13);mt.NAMESPACE_ERR=(qe[14]="Invalid namespace",14);mt.INVALID_ACCESS_ERR=(qe[15]="Invalid access",15);function Le(r,e){if(e instanceof Error)var t=e;else t=this,Error.call(this,qe[r]),this.message=qe[r],Error.captureStackTrace&&Error.captureStackTrace(this,Le);return t.code=r,e&&(this.message=this.message+": "+e),t}Le.prototype=Error.prototype;yc(mt,Le);function qr(){}qr.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++)ka(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 Na(r,e){this._node=r,this._refresh=e,gv(this);}function gv(r){var e=r._node._inc||r._node.ownerDocument._inc;if(r._inc!==e){var t=r._refresh(r._node);if(IE(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];yc(t,r),r._inc=e;}}Na.prototype.item=function(r){return gv(this),this[r]||null};Ct(Na,qr);function tg(){}function AE(r,e){for(var t=r.length;t--;)if(r[t]===e)return t}function dE(r,e,t,i){if(i?e[AE(e,i)]=t:e[e.length++]=t,r){t.ownerElement=r;var s=r.ownerDocument;s&&(i&&PE(s,r,i),aB(s,r,t));}}function fE(r,e,t){var i=AE(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&&(PE(n,r,t),t.ownerElement=null);}}else throw new Le(EE,new Error(r.tagName+"@"+t))}tg.prototype={length:0,item:qr.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 Le(hE);var t=this.getNamedItem(r.nodeName);return dE(this._ownerElement,this,r,t),t},setNamedItemNS:function(r){var e=r.ownerElement,t;if(e&&e!=this._ownerElement)throw new Le(hE);return t=this.getNamedItemNS(r.namespaceURI,r.localName),dE(this._ownerElement,this,r,t),t},removeNamedItem:function(r){var e=this.getNamedItem(r);return fE(this._ownerElement,this,e),e},removeNamedItemNS:function(r,e){var t=this.getNamedItemNS(r,e);return fE(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 CE(){}CE.prototype={hasFeature:function(r,e){return true},createDocument:function(r,e,t){var i=new vc;if(i.implementation=this,i.childNodes=new qr,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 sg;return i.name=r,i.nodeName=r,i.publicId=e||"",i.systemId=t||"",i}};function me(){}me.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 rg(this,r,e)},replaceChild:function(r,e){rg(this,r,e,RE),e&&this.removeChild(e);},removeChild:function(r){return BE(this,r)},appendChild:function(r){return this.insertBefore(r,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(r){return mv(this.ownerDocument||this,this,r)},normalize:function(){for(var r=this.firstChild;r;){var e=r.nextSibling;e&&e.nodeType==eg&&r.nodeType==eg?(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==La?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==La?e.ownerDocument:e.parentNode;}return null},isDefaultNamespace:function(r){var e=this.lookupPrefix(r);return e==null}};function wE(r){return r=="<"&&"<"||r==">"&&">"||r=="&"&&"&"||r=='"'&&"""||"&#"+r.charCodeAt()+";"}yc(wt,me);yc(wt,me.prototype);function _c(r,e){if(e(r))return true;if(r=r.firstChild)do if(_c(r,e))return true;while(r=r.nextSibling)}function vc(){this.ownerDocument=this;}function aB(r,e,t){r&&r._inc++;var i=t.namespaceURI;i===xc.XMLNS&&(e._nsMap[t.prefix?t.localName:""]=t.value);}function PE(r,e,t,i){r&&r._inc++;var s=t.namespaceURI;s===xc.XMLNS&&delete e._nsMap[t.prefix?t.localName:""];}function xv(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 BE(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,xv(r.ownerDocument,r),e}function uB(r){return r&&(r.nodeType===me.DOCUMENT_NODE||r.nodeType===me.DOCUMENT_FRAGMENT_NODE||r.nodeType===me.ELEMENT_NODE)}function lB(r){return r&&(Cr(r)||_v(r)||Zr(r)||r.nodeType===me.DOCUMENT_FRAGMENT_NODE||r.nodeType===me.COMMENT_NODE||r.nodeType===me.PROCESSING_INSTRUCTION_NODE)}function Zr(r){return r&&r.nodeType===me.DOCUMENT_TYPE_NODE}function Cr(r){return r&&r.nodeType===me.ELEMENT_NODE}function _v(r){return r&&r.nodeType===me.TEXT_NODE}function pE(r,e){var t=r.childNodes||[];if(Ar(t,Cr)||Zr(e))return false;var i=Ar(t,Zr);return !(e&&i&&t.indexOf(i)>t.indexOf(e))}function mE(r,e){var t=r.childNodes||[];function i(n){return Cr(n)&&n!==e}if(Ar(t,i))return false;var s=Ar(t,Zr);return !(e&&s&&t.indexOf(s)>t.indexOf(e))}function cB(r,e,t){if(!uB(r))throw new Le(At,"Unexpected parent node type "+r.nodeType);if(t&&t.parentNode!==r)throw new Le(EE,"child not in parent");if(!lB(e)||Zr(e)&&r.nodeType!==me.DOCUMENT_NODE)throw new Le(At,"Unexpected node type "+e.nodeType+" for parent node type "+r.nodeType)}function hB(r,e,t){var i=r.childNodes||[],s=e.childNodes||[];if(e.nodeType===me.DOCUMENT_FRAGMENT_NODE){var n=s.filter(Cr);if(n.length>1||Ar(s,_v))throw new Le(At,"More than one element or text in fragment");if(n.length===1&&!pE(r,t))throw new Le(At,"Element in fragment can not be inserted before doctype")}if(Cr(e)&&!pE(r,t))throw new Le(At,"Only one element can be added and only after doctype");if(Zr(e)){if(Ar(i,Zr))throw new Le(At,"Only one doctype is allowed");var o=Ar(i,Cr);if(t&&i.indexOf(o)<i.indexOf(t))throw new Le(At,"Doctype can only be inserted before an element");if(!t&&o)throw new Le(At,"Doctype can not be appended since element is present")}}function RE(r,e,t){var i=r.childNodes||[],s=e.childNodes||[];if(e.nodeType===me.DOCUMENT_FRAGMENT_NODE){var n=s.filter(Cr);if(n.length>1||Ar(s,_v))throw new Le(At,"More than one element or text in fragment");if(n.length===1&&!mE(r,t))throw new Le(At,"Element in fragment can not be inserted before doctype")}if(Cr(e)&&!mE(r,t))throw new Le(At,"Only one element can be added and only after doctype");if(Zr(e)){let u=function(l){return Zr(l)&&l!==t};if(Ar(i,u))throw new Le(At,"Only one doctype is allowed");var o=Ar(i,Cr);if(t&&i.indexOf(o)<i.indexOf(t))throw new Le(At,"Doctype can only be inserted before an element")}}function rg(r,e,t,i){cB(r,e,t),r.nodeType===me.DOCUMENT_NODE&&(i||hB)(r,e,t);var s=e.parentNode;if(s&&s.removeChild(e),e.nodeType===Kr){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;var u=r.ownerDocument||r;bc(n,u);}while(n!==o&&(n=n.nextSibling));return xv(r.ownerDocument||r,r),e.nodeType==Kr&&(e.firstChild=e.lastChild=null),e}function bc(r,e){if(r.ownerDocument!==e){if(r.ownerDocument=e,r.nodeType===Yt&&r.attributes)for(var t=0;t<r.attributes.length;t++){var i=r.attributes.item(t);i&&(i.ownerDocument=e);}for(var s=r.firstChild;s;)bc(s,e),s=s.nextSibling;}}function dB(r,e){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,xv(r.ownerDocument,r,e);var t=r.ownerDocument||r;return bc(e,t),e}vc.prototype={nodeName:"#document",nodeType:TE,doctype:null,documentElement:null,_inc:1,insertBefore:function(r,e){if(r.nodeType==Kr){for(var t=r.firstChild;t;){var i=t.nextSibling;this.insertBefore(t,e),t=i;}return r}return rg(this,r,e),bc(r,this),this.documentElement===null&&r.nodeType===Yt&&(this.documentElement=r),r},removeChild:function(r){return this.documentElement==r&&(this.documentElement=null),BE(this,r)},replaceChild:function(r,e){rg(this,r,e,RE),bc(r,this),e&&this.removeChild(e),Cr(r)&&(this.documentElement=r);},importNode:function(r,e){return UE(this,r,e)},getElementById:function(r){var e=null;return _c(this.documentElement,function(t){if(t.nodeType==Yt&&t.getAttribute("id")==r)return e=t,true}),e},getElementsByClassName:function(r){var e=cE(r);return new Na(this,function(t){var i=[];return e.length>0&&_c(t.documentElement,function(s){if(s!==t&&s.nodeType===Yt){var n=s.getAttribute("class");if(n){var o=r===n;if(!o){var a=cE(n);o=e.every(sB(a));}o&&i.push(s);}}}),i})},createElement:function(r){var e=new qn;e.ownerDocument=this,e.nodeName=r,e.tagName=r,e.localName=r,e.childNodes=new qr;var t=e.attributes=new tg;return t._ownerElement=e,e},createDocumentFragment:function(){var r=new ng;return r.ownerDocument=this,r.childNodes=new qr,r},createTextNode:function(r){var e=new bv;return e.ownerDocument=this,e.appendData(r),e},createComment:function(r){var e=new yv;return e.ownerDocument=this,e.appendData(r),e},createCDATASection:function(r){var e=new vv;return e.ownerDocument=this,e.appendData(r),e},createProcessingInstruction:function(r,e){var t=new Sv;return t.ownerDocument=this,t.tagName=t.nodeName=t.target=r,t.nodeValue=t.data=e,t},createAttribute:function(r){var e=new ig;return e.ownerDocument=this,e.name=r,e.nodeName=r,e.localName=r,e.specified=true,e},createEntityReference:function(r){var e=new Tv;return e.ownerDocument=this,e.nodeName=r,e},createElementNS:function(r,e){var t=new qn,i=e.split(":"),s=t.attributes=new tg;return t.childNodes=new qr,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 ig,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}};Ct(vc,me);function qn(){this._nsMap={};}qn.prototype={nodeType:Yt,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===Kr?this.insertBefore(r,null):dB(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 Na(this,function(e){var t=[];return _c(e,function(i){i!==e&&i.nodeType==Yt&&(r==="*"||i.tagName==r)&&t.push(i);}),t})},getElementsByTagNameNS:function(r,e){return new Na(this,function(t){var i=[];return _c(t,function(s){s!==t&&s.nodeType===Yt&&(r==="*"||s.namespaceURI===r)&&(e==="*"||s.localName==e)&&i.push(s);}),i})}};vc.prototype.getElementsByTagName=qn.prototype.getElementsByTagName;vc.prototype.getElementsByTagNameNS=qn.prototype.getElementsByTagNameNS;Ct(qn,me);function ig(){}ig.prototype.nodeType=La;Ct(ig,me);function Tc(){}Tc.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(qe[At])},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;}};Ct(Tc,me);function bv(){}bv.prototype={nodeName:"#text",nodeType:eg,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}};Ct(bv,Tc);function yv(){}yv.prototype={nodeName:"#comment",nodeType:vE};Ct(yv,Tc);function vv(){}vv.prototype={nodeName:"#cdata-section",nodeType:_E};Ct(vv,Tc);function sg(){}sg.prototype.nodeType=SE;Ct(sg,me);function ME(){}ME.prototype.nodeType=oB;Ct(ME,me);function DE(){}DE.prototype.nodeType=nB;Ct(DE,me);function Tv(){}Tv.prototype.nodeType=bE;Ct(Tv,me);function ng(){}ng.prototype.nodeName="#document-fragment";ng.prototype.nodeType=Kr;Ct(ng,me);function Sv(){}Sv.prototype.nodeType=yE;Ct(Sv,me);function FE(){}FE.prototype.serializeToString=function(r,e,t){return GE.call(r,e,t)};me.prototype.toString=GE;function GE(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 ka(this,t,r,e,o),t.join("")}function gE(r,e,t){var i=r.prefix||"",s=r.namespaceURI;if(!s||i==="xml"&&s===xc.XML||s===xc.XMLNS)return false;for(var n=t.length;n--;){var o=t[n];if(o.prefix===i)return o.namespace!==s}return true}function pv(r,e,t){r.push(" ",e,'="',t.replace(/[<>&"\t\n\r]/g,wE),'"');}function ka(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 Yt:var n=r.attributes,o=n.length,b=r.firstChild,a=r.tagName;t=xc.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 f=0;f<o;f++){var g=n.item(f);g.prefix=="xmlns"?s.push({prefix:g.localName,namespace:g.value}):g.nodeName=="xmlns"&&s.push({prefix:"",namespace:g.value});}for(var f=0;f<o;f++){var g=n.item(f);if(gE(g,t,s)){var _=g.prefix||"",x=g.namespaceURI;pv(e,_?"xmlns:"+_:"xmlns",x),s.push({prefix:_,namespace:x});}ka(g,e,t,i,s);}if(a===u&&gE(r,t,s)){var _=r.prefix||"",x=r.namespaceURI;pv(e,_?"xmlns:"+_:"xmlns",x),s.push({prefix:_,namespace:x});}if(b||t&&!/^(?:meta|link|img|br|hr|input)$/i.test(a)){if(e.push(">"),t&&/^script$/i.test(a))for(;b;)b.data?e.push(b.data):ka(b,e,t,i,s.slice()),b=b.nextSibling;else for(;b;)ka(b,e,t,i,s.slice()),b=b.nextSibling;e.push("</",u,">");}else e.push("/>");return;case TE:case Kr:for(var b=r.firstChild;b;)ka(b,e,t,i,s.slice()),b=b.nextSibling;return;case La:return pv(e,r.name,r.value);case eg:return e.push(r.data.replace(/[<&>]/g,wE));case _E:return e.push("<![CDATA[",r.data,"]]>");case vE:return e.push("<!--",r.data,"-->");case SE:var y=r.publicId,v=r.systemId;if(e.push("<!DOCTYPE ",r.name),y)e.push(" PUBLIC ",y),v&&v!="."&&e.push(" ",v),e.push(">");else if(v&&v!=".")e.push(" SYSTEM ",v,">");else {var T=r.internalSubset;T&&e.push(" [",T,"]"),e.push(">");}return;case yE:return e.push("<?",r.target," ",r.data,"?>");case bE:return e.push("&",r.nodeName,";");default:e.push("??",r.nodeName);}}function UE(r,e,t){var i;switch(e.nodeType){case Yt:i=e.cloneNode(false),i.ownerDocument=r;case Kr:break;case La:t=true;break}if(i||(i=e.cloneNode(false)),i.ownerDocument=r,i.parentNode=null,t)for(var s=e.firstChild;s;)i.appendChild(UE(r,s,t)),s=s.nextSibling;return i}function mv(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 qr),i.ownerDocument=r,i.nodeType){case Yt:var o=e.attributes,a=i.attributes=new tg,u=o.length;a._ownerElement=i;for(var l=0;l<u;l++)i.setAttributeNode(mv(r,o.item(l),true));break;case La:t=true;}if(t)for(var c=e.firstChild;c;)i.appendChild(mv(r,c,t)),c=c.nextSibling;return i}function IE(r,e,t){r[e]=t;}try{if(Object.defineProperty){let r=function(e){switch(e.nodeType){case Yt:case Kr: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}};fB=r,Object.defineProperty(Na.prototype,"length",{get:function(){return gv(this),this.$$length}}),Object.defineProperty(me.prototype,"textContent",{get:function(){return r(this)},set:function(e){switch(this.nodeType){case Yt:case Kr: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;}}}),IE=function(e,t,i){e["$$"+t]=i;};}}catch{}var fB;Qi.DocumentType=sg;Qi.DOMException=Le;Qi.DOMImplementation=CE;Qi.Element=qn;Qi.Node=me;Qi.NodeList=qr;Qi.XMLSerializer=FE;});var kE=Jr(Sc=>{var OE=gc().freeze;Sc.XML_ENTITIES=OE({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'});Sc.HTML_ENTITIES=OE({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:`
|
|
1189
|
+
`,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"});Sc.entityMap=Sc.HTML_ENTITIES;});var YE=Jr(Cv=>{var wc=gc().NAMESPACE,Av=/[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]/,LE=new RegExp("[\\-\\.0-9"+Av.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),NE=new RegExp("^"+Av.source+LE.source+"*(?::"+Av.source+LE.source+"*)?$"),Ec=0,Ji=1,Ha=2,Ac=3,Va=4,za=5,Cc=6,og=7;function Wa(r,e){this.message=r,this.locator=e,Error.captureStackTrace&&Error.captureStackTrace(this,Wa);}Wa.prototype=new Error;Wa.prototype.name=Wa.name;function zE(){}zE.prototype={parse:function(r,e,t){var i=this.domBuilder;i.startDocument(),WE(e,e={}),pB(r,e,t,i,this.errorHandler),i.endDocument();}};function pB(r,e,t,i,s){function n(F){if(F>65535){F-=65536;var L=55296+(F>>10),is=56320+(F&1023);return String.fromCharCode(L,is)}else return String.fromCharCode(F)}function o(F){var L=F.slice(1,-1);return Object.hasOwnProperty.call(t,L)?t[L]:L.charAt(0)==="#"?n(parseInt(L.substr(1).replace("x","0x"))):(s.error("entity not found:"+F),F)}function a(F){if(F>_){var L=r.substring(_,F).replace(/&#?\w+;/g,o);d&&u(_),i.characters(L,0,F-_),_=F;}}function u(F,L){for(;F>=c&&(L=h.exec(r));)l=L.index,c=l+L[0].length,d.lineNumber++;d.columnNumber=F-l+1;}for(var l=0,c=0,h=/.*(?:\r\n?|\n)|.*$/g,d=i.locator,f=[{currentNSMap:e}],g={},_=0;;){try{var x=r.indexOf("<",_);if(x<0){if(!r.substr(_).match(/^\s*$/)){var b=i.doc,y=b.createTextNode(r.substr(_));b.appendChild(y),i.currentElement=y;}return}switch(x>_&&a(x),r.charAt(x+1)){case "/":var D=r.indexOf(">",x+3),v=r.substring(x+2,D).replace(/[ \t\n\r]+$/g,""),T=f.pop();D<0?(v=r.substring(x+2).replace(/[\s<].*/,""),s.error("end tag name: "+v+" is not complete:"+T.tagName),D=x+1+v.length):v.match(/\s</)&&(v=v.replace(/[\s<].*/,""),s.error("end tag name: "+v+" maybe not complete"),D=x+1+v.length);var B=T.localNSMap,E=T.tagName==v,C=E||T.tagName&&T.tagName.toLowerCase()==v.toLowerCase();if(C){if(i.endElement(T.uri,T.localName,v),B)for(var k in B)Object.prototype.hasOwnProperty.call(B,k)&&i.endPrefixMapping(k);E||s.fatalError("end tag name: "+v+" is not match the current start tagName:"+T.tagName);}else f.push(T);D++;break;case "?":d&&u(x),D=bB(r,x,i);break;case "!":d&&u(x),D=_B(r,x,i,s);break;default:d&&u(x);var M=new XE,I=f[f.length-1].currentNSMap,D=mB(r,x,M,I,o,s),z=M.length;if(!M.closed&&xB(r,D,M.tagName,g)&&(M.closed=!0,t.nbsp||s.warning("unclosed xml attribute")),d&&z){for(var se=HE(d,{}),de=0;de<z;de++){var Br=M[de];u(Br.offset),Br.locator=HE(d,{});}i.locator=se,VE(M,i,I)&&f.push(M),i.locator=d;}else VE(M,i,I)&&f.push(M);wc.isHTML(M.uri)&&!M.closed?D=gB(r,D,M.tagName,o,i):D++;}}catch(F){if(F instanceof Wa)throw F;s.error("element parse error: "+F),D=-1;}D>_?_=D:a(Math.max(x,_)+1);}}function HE(r,e){return e.lineNumber=r.lineNumber,e.columnNumber=r.columnNumber,e}function mB(r,e,t,i,s,n){function o(f,g,_){t.attributeNames.hasOwnProperty(f)&&n.fatalError("Attribute "+f+" redefined"),t.addValue(f,g.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,s),_);}for(var a,u,l=++e,c=Ec;;){var h=r.charAt(l);switch(h){case "=":if(c===Ji)a=r.slice(e,l),c=Ac;else if(c===Ha)c=Ac;else throw new Error("attribute equal must after attrName");break;case "'":case '"':if(c===Ac||c===Ji)if(c===Ji&&(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=za;else throw new Error("attribute value no end '"+h+"' match");else if(c==Va)u=r.slice(e,l),o(a,u,e),n.warning('attribute "'+a+'" missed start quot('+h+")!!"),e=l+1,c=za;else throw new Error('attribute value must after "="');break;case "/":switch(c){case Ec:t.setTagName(r.slice(e,l));case za:case Cc:case og:c=og,t.closed=true;case Va:case Ji:break;case Ha:t.closed=true;break;default:throw new Error("attribute invalid close char('/')")}break;case "":return n.error("unexpected end of input"),c==Ec&&t.setTagName(r.slice(e,l)),l;case ">":switch(c){case Ec:t.setTagName(r.slice(e,l));case za:case Cc:case og:break;case Va:case Ji:u=r.slice(e,l),u.slice(-1)==="/"&&(t.closed=true,u=u.slice(0,-1));case Ha:c===Ha&&(u=a),c==Va?(n.warning('attribute "'+u+'" missed quot(")!'),o(a,u,e)):((!wc.isHTML(i[""])||!u.match(/^(?:disabled|checked|selected)$/i))&&n.warning('attribute "'+u+'" missed value!! "'+u+'" instead!!'),o(u,u,e));break;case Ac:throw new Error("attribute value missed!!")}return l;case "\x80":h=" ";default:if(h<=" ")switch(c){case Ec:t.setTagName(r.slice(e,l)),c=Cc;break;case Ji:a=r.slice(e,l),c=Ha;break;case Va:var u=r.slice(e,l);n.warning('attribute "'+u+'" missed quot(")!!'),o(a,u,e);case za:c=Cc;break}else switch(c){case Ha:t.tagName;(!wc.isHTML(i[""])||!a.match(/^(?:disabled|checked|selected)$/i))&&n.warning('attribute "'+a+'" missed value!! "'+a+'" instead2!!'),o(a,a,e),e=l,c=Ji;break;case za:n.warning('attribute space is required"'+a+'"!!');case Cc:c=Ji,e=l;break;case Ac:c=Va,e=l;break;case og:throw new Error("elements closed character '/' and '>' must be connected to")}}l++;}}function VE(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={},WE(t,t={})),t[c]=s[c]=a,n.uri=wc.XMLNS,e.startPrefixMapping(c,a));}for(var h=r.length;h--;){n=r[h];var u=n.prefix;u&&(u==="xml"&&(n.uri=wc.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 f=r.uri=t[u||""];if(e.startElement(f,l,i,r),r.closed){if(e.endElement(f,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 gB(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 xB(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 WE(r,e){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t]);}function _B(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=yB(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 bB(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 XE(){this.attributeNames={};}XE.prototype={setTagName:function(r){if(!NE.test(r))throw new Error("invalid tagName:"+r);this.tagName=r;},addValue:function(r,e,t){if(!NE.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 yB(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}Cv.XMLReader=zE;Cv.ParseError=Wa;});var JE=Jr(ug=>{var vB=gc(),TB=Ev(),$E=kE(),KE=YE(),SB=TB.DOMImplementation,jE=vB.NAMESPACE,EB=KE.ParseError,AB=KE.XMLReader;function ZE(r){return r.replace(/\r[\n\u0085]/g,`
|
|
1190
1190
|
`).replace(/[\r\u0085\u2028]/g,`
|
|
1191
|
-
`)}function
|
|
1192
|
-
@`+(r.systemId||"")+"#[line:"+r.lineNumber+",col:"+r.columnNumber+"]"}function bE(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){Zu.prototype[r]=function(){return null};});function Dd(r,e){r.currentElement?r.currentElement.appendChild(e):r.doc.appendChild(e);}Fd.__DOMHandler=Zu;Fd.normalizeLineEndings=vE;Fd.DOMParser=TE;});var AE=Wr(Gd=>{var EE=U2();Gd.DOMImplementation=EE.DOMImplementation;Gd.XMLSerializer=EE.XMLSerializer;Gd.DOMParser=SE().DOMParser;});S();var GT={extension:{type:m.Environment,name:"browser",priority:-1},test:()=>true,load:async()=>{await Promise.resolve().then(()=>(FT(),PC));}};S();var IT={extension:{type:m.Environment,name:"webworker",priority:0},test:()=>typeof self<"u"&&self.WorkerGlobalScope!==void 0,load:async()=>{await Promise.resolve().then(()=>(UT(),BC));}};S();S();Xl();Nl();S();ct();vt();Ie();ee();Qt();var G_=`
|
|
1191
|
+
`)}function QE(r){this.options=r||{locator:{}};}QE.prototype.parseFromString=function(r,e){var t=this.options,i=new AB,s=t.domBuilder||new Pc,n=t.errorHandler,o=t.locator,a=t.xmlns||{},u=/\/x?html?$/.test(e),l=u?$E.HTML_ENTITIES:$E.XML_ENTITIES;o&&s.setDocumentLocator(o),i.errorHandler=CB(n,s,o),i.domBuilder=t.domBuilder||s,u&&(a[""]=jE.HTML),a.xml=a.xml||jE.XML;var c=t.normalizeLineEndings||ZE;return r&&typeof r=="string"?i.parse(c(r),a,l):i.errorHandler.error("invalid doc source"),s.doc};function CB(r,e,t){if(!r){if(e instanceof Pc)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+wv(t));}||function(){};}return n("warning"),n("error"),n("fatalError"),i}function Pc(){this.cdata=false;}function Xa(r,e){e.lineNumber=r.lineNumber,e.columnNumber=r.columnNumber;}Pc.prototype={startDocument:function(){this.doc=new SB().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;ag(this,n),this.currentElement=n,this.locator&&Xa(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&&Xa(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&&Xa(this.locator,t),ag(this,t);},ignorableWhitespace:function(r,e,t){},characters:function(r,e,t){if(r=qE.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&&Xa(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=qE.apply(this,arguments);var i=this.doc.createComment(r);this.locator&&Xa(this.locator,i),ag(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&&Xa(this.locator,s),ag(this,s),this.doc.doctype=s;}},warning:function(r){console.warn("[xmldom warning] "+r,wv(this.locator));},error:function(r){console.error("[xmldom error] "+r,wv(this.locator));},fatalError:function(r){throw new EB(r,this.locator)}};function wv(r){if(r)return `
|
|
1192
|
+
@`+(r.systemId||"")+"#[line:"+r.lineNumber+",col:"+r.columnNumber+"]"}function qE(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){Pc.prototype[r]=function(){return null};});function ag(r,e){r.currentElement?r.currentElement.appendChild(e):r.doc.appendChild(e);}ug.__DOMHandler=Pc;ug.normalizeLineEndings=ZE;ug.DOMParser=QE;});var tA=Jr(lg=>{var eA=Ev();lg.DOMImplementation=eA.DOMImplementation;lg.XMLSerializer=eA.XMLSerializer;lg.DOMParser=JE().DOMParser;});var Ng={};zg(Ng,{AbstractBitmapFont:()=>Oi,AbstractRenderer:()=>br,AbstractSplitText:()=>rs,AbstractText:()=>wr,AccessibilitySystem:()=>Th,AlphaFilter:()=>oA,AlphaMask:()=>bs,AlphaMaskPipe:()=>cn,AnimatedSprite:()=>ja,Application:()=>J2,ApplicationInitHook:()=>un,Assets:()=>Ra,AssetsClass:()=>ac,BLEND_TO_NPM:()=>Vh,BUFFER_TYPE:()=>In,BackgroundLoader:()=>Sa,BackgroundSystem:()=>cp,Batch:()=>Mu,BatchGeometry:()=>_o,BatchTextureArray:()=>xo,BatchableGraphics:()=>Vr,BatchableHTMLText:()=>Yo,BatchableMesh:()=>gr,BatchableSprite:()=>zt,BatchableText:()=>Fo,Batcher:()=>jh,BatcherPipe:()=>Nl,BigPool:()=>he,BindGroup:()=>He,BindGroupSystem:()=>bn,BitmapFont:()=>jn,BitmapFontManager:()=>ar,BitmapText:()=>ts,BitmapTextGraphics:()=>ll,BitmapTextPipe:()=>zs,BlendModeFilter:()=>$,BlendModePipe:()=>fn,BlurFilter:()=>Rc,BlurFilterPass:()=>$a,Bounds:()=>oe,BrowserAdapter:()=>Rh,Buffer:()=>Ee,BufferImageSource:()=>Dr,BufferResource:()=>Tr,BufferUsage:()=>j,CLEAR:()=>ze,Cache:()=>te,CanvasObserver:()=>hi,CanvasPool:()=>ht,CanvasPoolClass:()=>nl,CanvasSource:()=>$e,CanvasTextGenerator:()=>Yr,CanvasTextMetrics:()=>Ce,CanvasTextPipe:()=>Os,CanvasTextSystem:()=>Vs,Circle:()=>Go,Color:()=>H,ColorBlend:()=>gl,ColorBurnBlend:()=>xl,ColorDodgeBlend:()=>_l,ColorMask:()=>ys,ColorMaskPipe:()=>hn,ColorMatrixFilter:()=>xg,CompressedSource:()=>Xt,Container:()=>Q,Culler:()=>Jm,CullerPlugin:()=>mc,CustomRenderPipe:()=>tn,D3D10_RESOURCE_DIMENSION:()=>Xm,D3DFMT:()=>yt,DATA_URI:()=>cS,DDS:()=>X,DEG_TO_RAD:()=>Yc,DEPRECATED_SCALE_MODES:()=>Ic,DEPRECATED_WRAP_MODES:()=>Uc,DOMAdapter:()=>U,DOMContainer:()=>Bh,DOMPipe:()=>xs,DRAW_MODES:()=>CA,DXGI_FORMAT:()=>Wm,DXGI_TO_TEXTURE_FORMAT:()=>pt,DarkenBlend:()=>bl,DefaultBatcher:()=>Cs,DefaultShader:()=>As,DifferenceBlend:()=>yl,DisplacementFilter:()=>yg,DivideBlend:()=>vl,DynamicBitmapFont:()=>al,Ellipse:()=>Uo,EventBoundary:()=>ao,EventEmitter:()=>fe,EventSystem:()=>uo,EventsTicker:()=>Rt,ExclusionBlend:()=>Tl,ExtensionType:()=>m,ExtractSystem:()=>hp,FOURCC_TO_TEXTURE_FORMAT:()=>dc,FederatedContainer:()=>Ph,FederatedEvent:()=>fr,FederatedMouseEvent:()=>Qt,FederatedPointerEvent:()=>et,FederatedWheelEvent:()=>Ut,FillGradient:()=>lt,FillPattern:()=>ir,Filter:()=>Ve,FilterEffect:()=>qt,FilterPipe:()=>qs,FilterSystem:()=>Ks,FontStylePromiseCache:()=>cl,GAUSSIAN_VALUES:()=>Ya,GCManagedHash:()=>pe,GCSystem:()=>dp,GL_FORMATS:()=>pa,GL_INTERNAL_FORMAT:()=>cv,GL_TARGETS:()=>ql,GL_TYPES:()=>ie,GL_WRAP_MODES:()=>c2,GPUTextureGpuData:()=>$l,GenerateTextureSystem:()=>pn,Geometry:()=>at,GlBackBufferSystem:()=>Wp,GlBatchAdaptor:()=>Un,GlBuffer:()=>fa,GlBufferSystem:()=>On,GlColorMaskSystem:()=>Ln,GlContextSystem:()=>Hp,GlEncoderSystem:()=>Nn,GlGeometryGpuData:()=>Kl,GlGeometrySystem:()=>kn,GlGraphicsAdaptor:()=>Fn,GlLimitsSystem:()=>Hn,GlMeshAdaptor:()=>Gn,GlParticleContainerAdaptor:()=>Po,GlParticleContainerPipe:()=>Gs,GlProgram:()=>xe,GlProgramData:()=>xa,GlRenderTarget:()=>ma,GlRenderTargetAdaptor:()=>ga,GlRenderTargetSystem:()=>Wn,GlShaderSystem:()=>Xn,GlStateSystem:()=>hm,GlStencilSystem:()=>Vn,GlTexture:()=>ba,GlTextureSystem:()=>$n,GlUboSystem:()=>zn,GlUniformGroupSystem:()=>Yn,GlobalResourceRegistry:()=>Tt,GlobalUniformSystem:()=>mn,GpuBatchAdaptor:()=>en,GpuBlendModesToPixi:()=>st,GpuBufferData:()=>zl,GpuBufferSystem:()=>yn,GpuColorMaskSystem:()=>vn,GpuDeviceSystem:()=>$i,GpuEncoderSystem:()=>Tn,GpuGraphicsAdaptor:()=>Qs,GpuGraphicsContext:()=>Yu,GpuLimitsSystem:()=>Sn,GpuMeshAdapter:()=>Js,GpuMipmapGenerator:()=>da,GpuParticleContainerAdaptor:()=>Mo,GpuParticleContainerPipe:()=>Us,GpuProgram:()=>_e,GpuRenderTarget:()=>la,GpuRenderTargetAdaptor:()=>ca,GpuRenderTargetSystem:()=>Bn,GpuShaderSystem:()=>Rn,GpuStateSystem:()=>Mn,GpuStencilModesToPixi:()=>Wt,GpuStencilSystem:()=>En,GpuTextureSystem:()=>Dn,GpuUboSystem:()=>Cn,GpuUniformBatchPipe:()=>wn,Graphics:()=>Ii,GraphicsContext:()=>ke,GraphicsContextRenderData:()=>$u,GraphicsContextSystem:()=>Ri,GraphicsGpuData:()=>qu,GraphicsPath:()=>ct,GraphicsPipe:()=>Ds,HTMLText:()=>Qa,HTMLTextPipe:()=>Ws,HTMLTextRenderData:()=>Li,HTMLTextStyle:()=>Za,HTMLTextSystem:()=>Xs,HardLightBlend:()=>Sl,HardMixBlend:()=>El,HelloSystem:()=>Yi,IGLUniformData:()=>Kp,ImageSource:()=>ot,InstructionSet:()=>ni,KTX:()=>Pe,LightenBlend:()=>Al,LinearBurnBlend:()=>Cl,LinearDodgeBlend:()=>wl,LinearLightBlend:()=>Pl,Loader:()=>Dm,LoaderParserPriority:()=>Te,LuminosityBlend:()=>Bl,MaskEffectManager:()=>to,MaskEffectManagerClass:()=>hu,MaskFilter:()=>ea,Matrix:()=>P,Mesh:()=>Pt,MeshGeometry:()=>dt,MeshGpuData:()=>wo,MeshPipe:()=>Fs,MeshPlane:()=>Dg,MeshRope:()=>jA,MeshSimple:()=>Gg,NOOP:()=>gu,NegationBlend:()=>Rl,NineSliceGeometry:()=>ur,NineSlicePlane:()=>Ug,NineSliceSprite:()=>Rv,NineSliceSpriteGpuData:()=>fl,NineSliceSpritePipe:()=>js,NoiseFilter:()=>hA,ObservablePoint:()=>ce,OverlayBlend:()=>Ml,PI_2:()=>Wc,Particle:()=>ZA,ParticleBuffer:()=>Bo,ParticleContainer:()=>JA,ParticleContainerPipe:()=>Mi,ParticleShader:()=>Ro,PassthroughFilter:()=>Zo,PerspectiveMesh:()=>zA,PerspectivePlaneGeometry:()=>eu,PinLightBlend:()=>Dl,PipelineSystem:()=>Pn,PlaneGeometry:()=>Hi,Point:()=>q,Polygon:()=>Fi,Pool:()=>Jn,PoolGroupClass:()=>lu,PrepareBase:()=>Tg,PrepareQueue:()=>Ka,PrepareSystem:()=>Gc,PrepareUpload:()=>Ja,QuadGeometry:()=>qo,RAD_TO_DEG:()=>Xc,Rectangle:()=>V,RenderContainer:()=>Pg,RenderGroup:()=>Fr,RenderGroupPipe:()=>sn,RenderGroupSystem:()=>on,RenderLayer:()=>OA,RenderTarget:()=>xn,RenderTargetSystem:()=>Ki,RenderTexture:()=>ta,RenderableGCSystem:()=>gp,RendererInitHook:()=>ln,RendererType:()=>ye,ResizePlugin:()=>ms,Resolver:()=>rt,RopeGeometry:()=>Fg,RoundedRectangle:()=>Io,SCALE_MODES:()=>PA,STENCIL_MODES:()=>ge,SVGParser:()=>lf,SaturationBlend:()=>Fl,SchedulerSystem:()=>gn,ScissorMask:()=>Cg,SdfShader:()=>Wo,Shader:()=>Ae,ShaderStage:()=>vi,ShapePath:()=>No,SharedRenderPipes:()=>sa,SharedSystems:()=>ia,SoftLightBlend:()=>Gl,SplitBitmapText:()=>i3,SplitText:()=>o3,Sprite:()=>it,SpritePipe:()=>an,Spritesheet:()=>Au,State:()=>Se,StencilMask:()=>vs,StencilMaskPipe:()=>dn,SubtractBlend:()=>Ul,SystemRunner:()=>Wi,TEXTURE_FORMAT_BLOCK_SIZE:()=>Ym,Text:()=>Pr,TextStyle:()=>Re,Texture:()=>A,TextureGCSystem:()=>_p,TextureMatrix:()=>ai,TexturePool:()=>le,TexturePoolClass:()=>xu,TextureSource:()=>Z,TextureStyle:()=>De,TextureUvs:()=>wg,Ticker:()=>be,TickerListener:()=>ci,TickerPlugin:()=>gs,TilingSprite:()=>Eg,TilingSpriteGpuData:()=>hl,TilingSpritePipe:()=>$s,TilingSpriteShader:()=>jo,Transform:()=>qa,Triangle:()=>zf,UNIFORM_TO_ARRAY_SETTERS:()=>um,UNIFORM_TO_SINGLE_SETTERS:()=>am,UNIFORM_TYPES_MAP:()=>gd,UNIFORM_TYPES_VALUES:()=>Lu,UPDATE_BLEND:()=>no,UPDATE_COLOR:()=>ps,UPDATE_PRIORITY:()=>Je,UPDATE_TRANSFORM:()=>m1,UPDATE_VISIBLE:()=>ui,UboBatch:()=>aa,UboSystem:()=>ji,UniformGroup:()=>J,VERSION:()=>Xi,VideoSource:()=>Or,ViewContainer:()=>Fe,ViewSystem:()=>vp,ViewableBuffer:()=>It,VividLightBlend:()=>Il,WGSL_ALIGN_SIZE_DATA:()=>An,WGSL_TO_STD40_SIZE:()=>Zl,WRAP_MODES:()=>wA,WebGLRenderer:()=>rc,WebGPURenderer:()=>jl,WebWorkerAdapter:()=>iA,WorkerManager:()=>oc,accessibilityTarget:()=>Sh,addBits:()=>Uu,addMaskBounds:()=>mi,addMaskLocalBounds:()=>gi,addProgramDefines:()=>Qh,alphaFrag:()=>cg,alphaWgsl:()=>Bc,appendSVGPath:()=>sl,applyMatrix:()=>kf,applyProjectiveTransformationToPlane:()=>Bg,applyStyleParams:()=>tc,assignWithIgnore:()=>fs,autoDetectEnvironment:()=>nS,autoDetectRenderer:()=>vm,autoDetectSource:()=>z1,basisTranscoderUrls:()=>Fa,bgr2rgb:()=>Mr,bitmapFontCachePlugin:()=>Tm,bitmapFontTextParser:()=>Ta,bitmapFontXMLParser:()=>ic,bitmapFontXMLStringParser:()=>sc,bitmapTextSplit:()=>Ig,blendTemplateFrag:()=>Xf,blendTemplateVert:()=>Yf,blendTemplateWgsl:()=>$f,blockDataMap:()=>Yl,blurTemplateWgsl:()=>pg,boundsPool:()=>xt,browserExt:()=>k0,buildAdaptiveBezier:()=>ko,buildAdaptiveQuadratic:()=>Kd,buildArc:()=>Lo,buildArcTo:()=>Qd,buildArcToSvg:()=>Jd,buildCircle:()=>Pi,buildContextBatches:()=>kd,buildEllipse:()=>Td,buildGeometryFromPath:()=>GA,buildLine:()=>wd,buildPixelLine:()=>Pd,buildPolygon:()=>Gd,buildRectangle:()=>Ud,buildRoundedRectangle:()=>Sd,buildSimpleUvs:()=>Eo,buildTriangle:()=>Id,buildUvs:()=>So,cacheAsTextureMixin:()=>qc,cacheTextureArray:()=>Em,calculatePathArea:()=>uf,calculateProjection:()=>Gp,canvasTextSplit:()=>kg,checkChildrenDidChange:()=>fu,checkDataUrl:()=>Et,checkExtension:()=>we,checkForNestedPattern:()=>of,checkMaxIfStatementsInShader:()=>mo,childrenHelperMixin:()=>Zc,cleanArray:()=>mp,cleanHash:()=>pp,clearList:()=>nn,closePointEps:()=>Ed,collectAllRenderables:()=>MA,collectRenderablesMixin:()=>Qc,color32BitToUniform:()=>Vt,colorBit:()=>Si,colorBitGl:()=>Ei,colorMatrixFilterFrag:()=>gg,colorMatrixFilterWgsl:()=>Mc,colorToUniform:()=>vT,compareModeToGlCompare:()=>xm,compileHighShader:()=>ud,compileHighShaderGl:()=>ld,compileHighShaderGlProgram:()=>kt,compileHighShaderGpuProgram:()=>Ot,compileHooks:()=>Iu,compileInputs:()=>Ou,compileOutputs:()=>ad,compileShader:()=>Ql,compute2DProjection:()=>Mg,convertFormatIfRequired:()=>rE,convertToList:()=>tt,copySearchParams:()=>_s,createIdFromString:()=>rr,createIndicesForQuads:()=>Zu,createLevelBuffers:()=>$S,createLevelBuffersFromKTX:()=>iE,createStringVariations:()=>Mh,createTexture:()=>ft,createUboElementsSTD40:()=>Xp,createUboElementsWGSL:()=>Ep,createUboSyncFunction:()=>na,createUboSyncFunctionSTD40:()=>jp,createUboSyncFunctionWGSL:()=>Mp,crossOrigin:()=>ov,cullingMixin:()=>zc,curveEps:()=>Ad,defaultFilterVert:()=>_r,defaultValue:()=>_a,definedProps:()=>Ye,deprecation:()=>w,detectAvif:()=>Am,detectBasis:()=>zS,detectCompressed:()=>aE,detectDefaults:()=>Cm,detectMp4:()=>wm,detectOgv:()=>Pm,detectVideoAlphaMode:()=>ho,detectWebm:()=>Bm,detectWebp:()=>Rm,determineCrossOrigin:()=>uv,displacementFrag:()=>_g,displacementVert:()=>bg,displacementWgsl:()=>Dc,earcut:()=>Dd,effectsMixin:()=>Jc,ensureAttributes:()=>ua,ensureIsBuffer:()=>Du,ensurePrecision:()=>Jh,ensureTextOptions:()=>es,executeInstructions:()=>rn,extensions:()=>G,extractAttributesFromGlProgram:()=>tm,extractAttributesFromGpuProgram:()=>id,extractFontFamilies:()=>Cf,extractStructAndGroups:()=>yo,extractSubpaths:()=>af,extractSvgUrlId:()=>rl,fastCopy:()=>Es,findMixin:()=>eh,fontStringFromTextStyle:()=>Wr,formatShader:()=>TA,fragmentGPUTemplate:()=>hd,fragmentGlTemplate:()=>fd,generateArraySyncSTD40:()=>$p,generateArraySyncWGSL:()=>Rp,generateBlurFragSource:()=>hg,generateBlurGlProgram:()=>fg,generateBlurProgram:()=>mg,generateBlurVertSource:()=>dg,generateGPULayout:()=>yA,generateGpuLayoutGroups:()=>sd,generateLayout:()=>vA,generateLayoutHash:()=>nd,generateParticleUpdateFunction:()=>Nd,generateProgram:()=>nm,generateShaderSyncCode:()=>qp,generateTextStyleKey:()=>u3,generateTextureBatchBit:()=>Ai,generateTextureBatchBitGl:()=>Ci,generateTextureMatrix:()=>Od,generateUniformsSync:()=>lm,getAdjustedBlendModeBlend:()=>tr,getAttributeInfoFromFormat:()=>ut,getBatchSamplersUniformGroup:()=>wi,getBitmapTextLayout:()=>ki,getCanvasBoundingBox:()=>df,getCanvasFillStyle:()=>Ui,getCanvasTexture:()=>ra,getDefaultUniformValue:()=>xd,getFastGlobalBounds:()=>RA,getFastGlobalBoundsMixin:()=>rh,getFillInstructionData:()=>RT,getFontCss:()=>Bf,getFontFamilyName:()=>ev,getGeometryBounds:()=>qh,getGlTypeFromFormat:()=>zp,getGlobalBounds:()=>hr,getGlobalMixin:()=>nh,getGlobalRenderableBounds:()=>Wf,getLocalBounds:()=>si,getMaxFragmentPrecision:()=>Zh,getMaxTexturesPerBatch:()=>Yh,getOrientationOfPoints:()=>Cd,getPo2TextureFromSource:()=>zo,getResolutionOfUrl:()=>Zi,getSVGUrl:()=>Rf,getSupportedCompressedTextureFormats:()=>Ma,getSupportedGPUCompressedTextureFormats:()=>lc,getSupportedGlCompressedTextureFormats:()=>uc,getSupportedTextureFormats:()=>Er,getTemporaryCanvasFromImage:()=>Mf,getTestContext:()=>po,getTextureBatchBindGroup:()=>xi,getTextureDefaultMatrix:()=>qA,getTextureFormatFromKTXTexture:()=>sE,getUboData:()=>rm,getUniformData:()=>im,getUrlExtension:()=>Ox,glFormatToGPUFormat:()=>Km,glUploadBufferImageResource:()=>dm,glUploadCompressedTextureResource:()=>fm,glUploadImageResource:()=>ya,glUploadVideoResource:()=>mm,globalUniformsBit:()=>pd,globalUniformsBitGl:()=>md,globalUniformsUBOBitGl:()=>rT,gpuFormatToBasisTranscoderFormat:()=>jS,gpuFormatToKTXBasisTranscoderFormat:()=>nE,gpuUploadBufferImageResource:()=>Op,gpuUploadCompressedTextureResource:()=>kp,gpuUploadImageResource:()=>ha,gpuUploadVideoResource:()=>Np,groupD8:()=>Y,hasCachedCanvasTexture:()=>bS,hslWgsl:()=>dA,hslgl:()=>Vi,hslgpu:()=>zi,injectBits:()=>ku,insertVersion:()=>ed,isMobile:()=>vh,isPow2:()=>pu,isRenderingToScreen:()=>Up,isSafari:()=>Ef,isSingleItem:()=>Ir,isWebGLSupported:()=>yr,isWebGPUSupported:()=>vr,ktxTranscoderUrls:()=>Ua,loadBasis:()=>YS,loadBasisOnWorker:()=>zm,loadBitmapFont:()=>Sm,loadDDS:()=>qS,loadEnvironmentExtensions:()=>Ol,loadFontAsBase64:()=>wf,loadFontCSS:()=>Pf,loadImageBitmap:()=>iv,loadJson:()=>Fm,loadKTX:()=>KS,loadKTX2:()=>eE,loadKTX2onWorker:()=>qm,loadSVGImage:()=>Df,loadSvg:()=>Im,loadTextures:()=>Pa,loadTxt:()=>Gm,loadVideoTextures:()=>Om,loadWebFont:()=>Um,localUniformBit:()=>jr,localUniformBitGl:()=>Ni,localUniformBitGroup2:()=>Gf,localUniformMSDFBit:()=>xf,localUniformMSDFBitGl:()=>_f,log2:()=>a1,logDebugTexture:()=>c3,logProgramError:()=>sm,logRenderGroupScene:()=>Dv,logScene:()=>Mv,mSDFBit:()=>bf,mSDFBitGl:()=>yf,mapFormatToGlFormat:()=>_m,mapFormatToGlInternalFormat:()=>bm,mapFormatToGlType:()=>ym,mapGlToVertexFormat:()=>Jp,mapSize:()=>EA,mapType:()=>Jl,mapWebGLBlendModesToPixi:()=>cm,maskFrag:()=>up,maskVert:()=>lp,maskWgsl:()=>Hl,matrixPool:()=>Me,measureHtmlText:()=>$o,measureMixin:()=>ah,migrateFragmentFromV7toV8:()=>SA,mipmapScaleModeToGlFilter:()=>gm,multiplyColors:()=>ii,multiplyHexColors:()=>io,nextPow2:()=>Kt,noiseFrag:()=>vg,noiseWgsl:()=>Fc,nonCompressedFormats:()=>lv,normalizeExtensionPriority:()=>Kn,onRenderMixin:()=>uh,parseDDS:()=>$m,parseFunctionBody:()=>BA,parseKTX:()=>jm,parseSVGDefinitions:()=>sf,parseSVGFloatAttribute:()=>ve,parseSVGPath:()=>Xd,parseSVGStyle:()=>il,particleData:()=>Oc,particlesFrag:()=>Hd,particlesVert:()=>Vd,particlesWgsl:()=>Qu,passthroughFrag:()=>Vf,passthroughWgsl:()=>pl,path:()=>Ie,pointInTriangle:()=>ml,preloadVideo:()=>av,removeItems:()=>eo,removeStructAndGroupDuplicates:()=>od,resetUids:()=>e1,resolveCharacters:()=>Tf,resolveCompressedTextureUrl:()=>oE,resolveJsonUrl:()=>km,resolveTextureUrl:()=>Ba,resourceToTexture:()=>$x,roundPixelsBit:()=>Lt,roundPixelsBitGl:()=>Nt,roundedShapeArc:()=>ef,roundedShapeQuadraticCurve:()=>tf,sayHello:()=>fp,scaleModeToGlFilter:()=>ec,setBasisTranscoderPath:()=>WS,setKTXTranscoderPath:()=>ZS,setPositions:()=>Of,setProgramName:()=>td,setUvs:()=>Lf,shapeBuilders:()=>Bi,sortMixin:()=>lh,spritesheetAsset:()=>Fh,squaredDistanceToLineSegment:()=>Di,stripVersion:()=>rd,styleAttributes:()=>nf,testImageFormat:()=>Ea,testVideoFormat:()=>Sr,textStyleToCSS:()=>Ag,textureBit:()=>Qf,textureBitGl:()=>Jf,textureFrom:()=>jx,tilingBit:()=>Uf,tilingBitGl:()=>If,toFillStyle:()=>sr,toLocalGlobalMixin:()=>ch,toStrokeStyle:()=>Gi,transformVertices:()=>ws,triangulateWithHoles:()=>Co,uboSyncFunctionsSTD40:()=>Wl,uboSyncFunctionsWGSL:()=>Pp,uid:()=>W,uniformParsers:()=>cr,unpremultiplyAlpha:()=>MS,unsafeEvalSupported:()=>Qo,updateLocalTransform:()=>DA,updateQuadBounds:()=>co,updateRenderGroupTransform:()=>$0,updateRenderGroupTransforms:()=>Ll,updateTextBounds:()=>Is,updateTransformAndChildren:()=>sp,updateTransformBackwards:()=>ro,updateWorldTransform:()=>FA,v8_0_0:()=>O,v8_3_4:()=>jc,validFormats:()=>Ia,validateRenderables:()=>np,vertexGPUTemplate:()=>cd,vertexGlTemplate:()=>dd,vkFormatToGPUFormat:()=>Zm,warn:()=>R,webworkerExt:()=>L0,wrapModeToGlAddress:()=>va});S();var k0={extension:{type:m.Environment,name:"browser",priority:-1},test:()=>true,load:async()=>{await Promise.resolve().then(()=>(rS(),Tw));}};S();var L0={extension:{type:m.Environment,name:"webworker",priority:0},test:()=>typeof self<"u"&&self.WorkerGlobalScope!==void 0,load:async()=>{await Promise.resolve().then(()=>(iS(),Sw));}};S();S();Lh();Gh();S();_t();St();Oe();ee();lr();var Xf=`
|
|
1193
1193
|
in vec2 vTextureCoord;
|
|
1194
1194
|
in vec4 vColor;
|
|
1195
1195
|
|
|
@@ -1210,7 +1210,7 @@ void main()
|
|
|
1210
1210
|
|
|
1211
1211
|
{MAIN}
|
|
1212
1212
|
}
|
|
1213
|
-
`;var
|
|
1213
|
+
`;var Yf=`in vec2 aPosition;
|
|
1214
1214
|
out vec2 vTextureCoord;
|
|
1215
1215
|
out vec2 backgroundUv;
|
|
1216
1216
|
|
|
@@ -1238,7 +1238,7 @@ void main(void)
|
|
|
1238
1238
|
gl_Position = filterVertexPosition();
|
|
1239
1239
|
vTextureCoord = filterTextureCoord();
|
|
1240
1240
|
}
|
|
1241
|
-
`;var
|
|
1241
|
+
`;var $f=`
|
|
1242
1242
|
struct GlobalFilterUniforms {
|
|
1243
1243
|
uInputSize:vec4<f32>,
|
|
1244
1244
|
uInputPixel:vec4<f32>,
|
|
@@ -1312,7 +1312,7 @@ fn mainFragment(
|
|
|
1312
1312
|
{MAIN}
|
|
1313
1313
|
|
|
1314
1314
|
return out;
|
|
1315
|
-
}`;var $=class extends
|
|
1315
|
+
}`;var $=class extends Ve{constructor(e){let t=e.gpu,i=sS({source:$f,...t}),s=_e.from({vertex:{source:i,entryPoint:"mainVertex"},fragment:{source:i,entryPoint:"mainFragment"}}),n=e.gl,o=sS({source:Xf,...n}),a=xe.from({vertex:Yf,fragment:o}),u=new J({uBlend:{value:1,type:"f32"}});super({gpuProgram:s,glProgram:a,blendRequired:true,resources:{blendUniforms:u,uBackTexture:A.EMPTY}});}};function sS(r){let{source:e,functions:t,main:i}=r;return e.replace("{FUNCTIONS}",t).replace("{MAIN}",i)}var Vi=`
|
|
1316
1316
|
float getLuminosity(vec3 c) {
|
|
1317
1317
|
return 0.3 * c.r + 0.59 * c.g + 0.11 * c.b;
|
|
1318
1318
|
}
|
|
@@ -1391,7 +1391,7 @@ fn mainFragment(
|
|
|
1391
1391
|
|
|
1392
1392
|
return color;
|
|
1393
1393
|
}
|
|
1394
|
-
`;var
|
|
1394
|
+
`;var zi=`
|
|
1395
1395
|
fn getLuminosity(c: vec3<f32>) -> f32
|
|
1396
1396
|
{
|
|
1397
1397
|
return 0.3*c.r + 0.59*c.g + 0.11*c.b;
|
|
@@ -1488,8 +1488,8 @@ fn mainFragment(
|
|
|
1488
1488
|
|
|
1489
1489
|
return color;
|
|
1490
1490
|
}
|
|
1491
|
-
`;var
|
|
1492
|
-
${
|
|
1491
|
+
`;var gl=class extends ${constructor(){super({gl:{functions:`
|
|
1492
|
+
${Vi}
|
|
1493
1493
|
|
|
1494
1494
|
vec3 blendColor(vec3 base, vec3 blend, float opacity)
|
|
1495
1495
|
{
|
|
@@ -1498,7 +1498,7 @@ fn mainFragment(
|
|
|
1498
1498
|
`,main:`
|
|
1499
1499
|
finalColor = vec4(blendColor(back.rgb, front.rgb,front.a), blendedAlpha) * uBlend;
|
|
1500
1500
|
`},gpu:{functions:`
|
|
1501
|
-
${
|
|
1501
|
+
${zi}
|
|
1502
1502
|
|
|
1503
1503
|
fn blendColorOpacity(base:vec3<f32>, blend:vec3<f32>, opacity:f32) -> vec3<f32>
|
|
1504
1504
|
{
|
|
@@ -1506,7 +1506,7 @@ fn mainFragment(
|
|
|
1506
1506
|
}
|
|
1507
1507
|
`,main:`
|
|
1508
1508
|
out = vec4<f32>(blendColorOpacity(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
1509
|
-
`}});}};
|
|
1509
|
+
`}});}};gl.extension={name:"color",type:m.BlendMode};S();var xl=class extends ${constructor(){super({gl:{functions:`
|
|
1510
1510
|
float colorBurn(float base, float blend)
|
|
1511
1511
|
{
|
|
1512
1512
|
return max((1.0 - ((1.0 - base) / blend)), 0.0);
|
|
@@ -1542,7 +1542,7 @@ fn mainFragment(
|
|
|
1542
1542
|
}
|
|
1543
1543
|
`,main:`
|
|
1544
1544
|
out = vec4<f32>(blendColorBurn(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
1545
|
-
`}});}};
|
|
1545
|
+
`}});}};xl.extension={name:"color-burn",type:m.BlendMode};S();var _l=class extends ${constructor(){super({gl:{functions:`
|
|
1546
1546
|
float colorDodge(float base, float blend)
|
|
1547
1547
|
{
|
|
1548
1548
|
return base / (1.0 - blend);
|
|
@@ -1578,7 +1578,7 @@ fn mainFragment(
|
|
|
1578
1578
|
}
|
|
1579
1579
|
`,main:`
|
|
1580
1580
|
out = vec4<f32>(blendColorDodge(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
1581
|
-
`}});}};
|
|
1581
|
+
`}});}};_l.extension={name:"color-dodge",type:m.BlendMode};S();var bl=class extends ${constructor(){super({gl:{functions:`
|
|
1582
1582
|
vec3 blendDarken(vec3 base, vec3 blend, float opacity)
|
|
1583
1583
|
{
|
|
1584
1584
|
return (min(base, blend) * opacity + base * (1.0 - opacity));
|
|
@@ -1592,7 +1592,7 @@ fn mainFragment(
|
|
|
1592
1592
|
}
|
|
1593
1593
|
`,main:`
|
|
1594
1594
|
out = vec4<f32>(blendDarken(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
1595
|
-
`}});}};
|
|
1595
|
+
`}});}};bl.extension={name:"darken",type:m.BlendMode};S();var yl=class extends ${constructor(){super({gl:{functions:`
|
|
1596
1596
|
vec3 blendDifference(vec3 base, vec3 blend, float opacity)
|
|
1597
1597
|
{
|
|
1598
1598
|
return (abs(blend - base) * opacity + base * (1.0 - opacity));
|
|
@@ -1606,7 +1606,7 @@ fn mainFragment(
|
|
|
1606
1606
|
}
|
|
1607
1607
|
`,main:`
|
|
1608
1608
|
out = vec4<f32>(blendDifference(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
1609
|
-
`}});}};
|
|
1609
|
+
`}});}};yl.extension={name:"difference",type:m.BlendMode};S();var vl=class extends ${constructor(){super({gl:{functions:`
|
|
1610
1610
|
float divide(float base, float blend)
|
|
1611
1611
|
{
|
|
1612
1612
|
return (blend > 0.0) ? clamp(base / blend, 0.0, 1.0) : 1.0;
|
|
@@ -1641,7 +1641,7 @@ fn mainFragment(
|
|
|
1641
1641
|
}
|
|
1642
1642
|
`,main:`
|
|
1643
1643
|
out = vec4<f32>(blendDivide(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
1644
|
-
`}});}};
|
|
1644
|
+
`}});}};vl.extension={name:"divide",type:m.BlendMode};S();var Tl=class extends ${constructor(){super({gl:{functions:`
|
|
1645
1645
|
vec3 exclusion(vec3 base, vec3 blend)
|
|
1646
1646
|
{
|
|
1647
1647
|
return base + blend - 2.0 * base * blend;
|
|
@@ -1665,7 +1665,7 @@ fn mainFragment(
|
|
|
1665
1665
|
}
|
|
1666
1666
|
`,main:`
|
|
1667
1667
|
out = vec4<f32>(blendExclusion(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
1668
|
-
`}});}};
|
|
1668
|
+
`}});}};Tl.extension={name:"exclusion",type:m.BlendMode};S();var Sl=class extends ${constructor(){super({gl:{functions:`
|
|
1669
1669
|
float hardLight(float base, float blend)
|
|
1670
1670
|
{
|
|
1671
1671
|
return (blend < 0.5) ? 2.0 * base * blend : 1.0 - 2.0 * (1.0 - base) * (1.0 - blend);
|
|
@@ -1700,7 +1700,7 @@ fn mainFragment(
|
|
|
1700
1700
|
}
|
|
1701
1701
|
`,main:`
|
|
1702
1702
|
out = vec4<f32>(blendHardLight(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
1703
|
-
`}});}};
|
|
1703
|
+
`}});}};Sl.extension={name:"hard-light",type:m.BlendMode};S();var El=class extends ${constructor(){super({gl:{functions:`
|
|
1704
1704
|
float hardMix(float base, float blend)
|
|
1705
1705
|
{
|
|
1706
1706
|
return (base + blend >= 1.0) ? 1.0 : 0.0;
|
|
@@ -1734,7 +1734,7 @@ fn mainFragment(
|
|
|
1734
1734
|
}
|
|
1735
1735
|
`,main:`
|
|
1736
1736
|
out = vec4<f32>(blendHardMix(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
1737
|
-
`}});}};
|
|
1737
|
+
`}});}};El.extension={name:"hard-mix",type:m.BlendMode};S();var Al=class extends ${constructor(){super({gl:{functions:`
|
|
1738
1738
|
vec3 blendLighten(vec3 base, vec3 blend, float opacity)
|
|
1739
1739
|
{
|
|
1740
1740
|
return (max(base, blend) * opacity + base * (1.0 - opacity));
|
|
@@ -1748,7 +1748,7 @@ fn mainFragment(
|
|
|
1748
1748
|
}
|
|
1749
1749
|
`,main:`
|
|
1750
1750
|
out = vec4<f32>(blendLighten(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
1751
|
-
`}});}};
|
|
1751
|
+
`}});}};Al.extension={name:"lighten",type:m.BlendMode};S();var Cl=class extends ${constructor(){super({gl:{functions:`
|
|
1752
1752
|
float linearBurn(float base, float blend)
|
|
1753
1753
|
{
|
|
1754
1754
|
return max(0.0, base + blend - 1.0);
|
|
@@ -1784,7 +1784,7 @@ fn mainFragment(
|
|
|
1784
1784
|
}
|
|
1785
1785
|
`,main:`
|
|
1786
1786
|
out = vec4<f32>(blendLinearBurn(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
1787
|
-
`}});}};
|
|
1787
|
+
`}});}};Cl.extension={name:"linear-burn",type:m.BlendMode};S();var wl=class extends ${constructor(){super({gl:{functions:`
|
|
1788
1788
|
float linearDodge(float base, float blend) {
|
|
1789
1789
|
return min(1.0, base + blend);
|
|
1790
1790
|
}
|
|
@@ -1817,7 +1817,7 @@ fn mainFragment(
|
|
|
1817
1817
|
}
|
|
1818
1818
|
`,main:`
|
|
1819
1819
|
out = vec4<f32>(blendLinearDodge(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
1820
|
-
`}});}};
|
|
1820
|
+
`}});}};wl.extension={name:"linear-dodge",type:m.BlendMode};S();var Pl=class extends ${constructor(){super({gl:{functions:`
|
|
1821
1821
|
float linearBurn(float base, float blend) {
|
|
1822
1822
|
return max(0.0, base + blend - 1.0);
|
|
1823
1823
|
}
|
|
@@ -1869,8 +1869,8 @@ fn mainFragment(
|
|
|
1869
1869
|
}
|
|
1870
1870
|
`,main:`
|
|
1871
1871
|
out = vec4<f32>(blendLinearLightOpacity(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
1872
|
-
`}});}};
|
|
1873
|
-
${
|
|
1872
|
+
`}});}};Pl.extension={name:"linear-light",type:m.BlendMode};S();var Bl=class extends ${constructor(){super({gl:{functions:`
|
|
1873
|
+
${Vi}
|
|
1874
1874
|
|
|
1875
1875
|
vec3 blendLuminosity(vec3 base, vec3 blend, float opacity)
|
|
1876
1876
|
{
|
|
@@ -1880,7 +1880,7 @@ fn mainFragment(
|
|
|
1880
1880
|
`,main:`
|
|
1881
1881
|
finalColor = vec4(blendLuminosity(back.rgb, front.rgb,front.a), blendedAlpha) * uBlend;
|
|
1882
1882
|
`},gpu:{functions:`
|
|
1883
|
-
${
|
|
1883
|
+
${zi}
|
|
1884
1884
|
|
|
1885
1885
|
fn blendLuminosity(base:vec3<f32>, blend:vec3<f32>, opacity:f32) -> vec3<f32>
|
|
1886
1886
|
{
|
|
@@ -1889,7 +1889,7 @@ fn mainFragment(
|
|
|
1889
1889
|
}
|
|
1890
1890
|
`,main:`
|
|
1891
1891
|
out = vec4<f32>(blendLuminosity(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
1892
|
-
`}});}};
|
|
1892
|
+
`}});}};Bl.extension={name:"luminosity",type:m.BlendMode};S();var Rl=class extends ${constructor(){super({gl:{functions:`
|
|
1893
1893
|
vec3 negation(vec3 base, vec3 blend)
|
|
1894
1894
|
{
|
|
1895
1895
|
return 1.0-abs(1.0-base-blend);
|
|
@@ -1913,7 +1913,7 @@ fn mainFragment(
|
|
|
1913
1913
|
}
|
|
1914
1914
|
`,main:`
|
|
1915
1915
|
out = vec4<f32>(blendNegationOpacity(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
1916
|
-
`}});}};
|
|
1916
|
+
`}});}};Rl.extension={name:"negation",type:m.BlendMode};S();var Ml=class extends ${constructor(){super({gl:{functions:`
|
|
1917
1917
|
float overlay(float base, float blend)
|
|
1918
1918
|
{
|
|
1919
1919
|
return (base < 0.5) ? (2.0*base*blend) : (1.0-2.0*(1.0-base)*(1.0-blend));
|
|
@@ -1949,7 +1949,7 @@ fn mainFragment(
|
|
|
1949
1949
|
}
|
|
1950
1950
|
`,main:`
|
|
1951
1951
|
out = vec4<f32>(blendOverlay(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
1952
|
-
`}});}};
|
|
1952
|
+
`}});}};Ml.extension={name:"overlay",type:m.BlendMode};S();var Dl=class extends ${constructor(){super({gl:{functions:`
|
|
1953
1953
|
float pinLight(float base, float blend)
|
|
1954
1954
|
{
|
|
1955
1955
|
return (blend <= 0.5) ? min(base, 2.0 * blend) : max(base, 2.0 * (blend - 0.5));
|
|
@@ -1985,8 +1985,8 @@ fn mainFragment(
|
|
|
1985
1985
|
}
|
|
1986
1986
|
`,main:`
|
|
1987
1987
|
out = vec4<f32>(blendPinLight(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
1988
|
-
`}});}};
|
|
1989
|
-
${
|
|
1988
|
+
`}});}};Dl.extension={name:"pin-light",type:m.BlendMode};S();var Fl=class extends ${constructor(){super({gl:{functions:`
|
|
1989
|
+
${Vi}
|
|
1990
1990
|
|
|
1991
1991
|
vec3 blendSaturation(vec3 base, vec3 blend, float opacity)
|
|
1992
1992
|
{
|
|
@@ -1996,7 +1996,7 @@ fn mainFragment(
|
|
|
1996
1996
|
`,main:`
|
|
1997
1997
|
finalColor = vec4(blendSaturation(back.rgb, front.rgb, front.a), blendedAlpha) * uBlend;
|
|
1998
1998
|
`},gpu:{functions:`
|
|
1999
|
-
${
|
|
1999
|
+
${zi}
|
|
2000
2000
|
|
|
2001
2001
|
fn blendSaturation(base:vec3<f32>, blend:vec3<f32>, opacity:f32) -> vec3<f32>
|
|
2002
2002
|
{
|
|
@@ -2005,7 +2005,7 @@ fn mainFragment(
|
|
|
2005
2005
|
}
|
|
2006
2006
|
`,main:`
|
|
2007
2007
|
out = vec4<f32>(blendSaturation(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
2008
|
-
`}});}};
|
|
2008
|
+
`}});}};Fl.extension={name:"saturation",type:m.BlendMode};S();var Gl=class extends ${constructor(){super({gl:{functions:`
|
|
2009
2009
|
float softLight(float base, float blend)
|
|
2010
2010
|
{
|
|
2011
2011
|
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));
|
|
@@ -2041,7 +2041,7 @@ fn mainFragment(
|
|
|
2041
2041
|
}
|
|
2042
2042
|
`,main:`
|
|
2043
2043
|
out = vec4<f32>(blendSoftLight(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
2044
|
-
`}});}};
|
|
2044
|
+
`}});}};Gl.extension={name:"soft-light",type:m.BlendMode};S();var Ul=class extends ${constructor(){super({gl:{functions:`
|
|
2045
2045
|
float subtract(float base, float blend)
|
|
2046
2046
|
{
|
|
2047
2047
|
return max(0.0, base - blend);
|
|
@@ -2077,7 +2077,7 @@ fn mainFragment(
|
|
|
2077
2077
|
}
|
|
2078
2078
|
`,main:`
|
|
2079
2079
|
out = vec4<f32>(blendSubtract(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
2080
|
-
`}});}};
|
|
2080
|
+
`}});}};Ul.extension={name:"subtract",type:m.BlendMode};S();var Il=class extends ${constructor(){super({gl:{functions:`
|
|
2081
2081
|
float colorBurn(float base, float blend)
|
|
2082
2082
|
{
|
|
2083
2083
|
return max((1.0-((1.0-base)/blend)),0.0);
|
|
@@ -2133,8 +2133,8 @@ fn mainFragment(
|
|
|
2133
2133
|
}
|
|
2134
2134
|
`,main:`
|
|
2135
2135
|
out = vec4<f32>(blendVividLight(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
|
2136
|
-
`}});}};xh.extension={name:"vivid-light",type:m.BlendMode};S();ae();_n();var vh;function Fr(r){return vh!==void 0||(vh=(()=>{let e={stencil:true,failIfMajorPerformanceCaveat:r??Dr.defaultOptions.failIfMajorPerformanceCaveat};try{if(!U.get().getWebGLRenderingContext())return !1;let i=U.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}})()),vh}ae();var Th;async function Gr(r={}){return Th!==void 0||(Th=await(async()=>{let e=U.get().getNavigator().gpu;if(!e)return false;try{return await(await e.requestAdapter(r)).requestDevice(),!0}catch{return false}})()),Th}_n();var pS=["webgl","webgpu","canvas"];async function Wy(r){let e=[];r.preference?(e.push(r.preference),pS.forEach(n=>{n!==r.preference&&e.push(n);})):e=pS.slice();let t,i={};for(let n=0;n<e.length;n++){let o=e[n];if(o==="webgpu"&&await Gr()){let{WebGPURenderer:a}=await Promise.resolve().then(()=>(v0(),tS));t=a,i={...r,...r.webgpu};break}else if(o==="webgl"&&Fr(r.failIfMajorPerformanceCaveat??Dr.defaultOptions.failIfMajorPerformanceCaveat)){let{WebGLRenderer:a}=await Promise.resolve().then(()=>(zy(),fS));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}Ze();Bh();re();var mS=class Xy{constructor(...e){this.stage=new Q,e[0]!==void 0&&w(O,"Application constructor options are deprecated, please use Application.init() instead.");}async init(e){e={...e},this.stage||(this.stage=new Q),this.renderer=await Wy(e),Xy._plugins.forEach(t=>{t.init.call(this,e);});}render(){this.renderer.render({container:this.stage});}get canvas(){return this.renderer.canvas}get view(){return w(O,"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=Xy._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;}};mS._plugins=[];var gS=mS;G.handleByList(m.Application,gS._plugins);G.add(Pn);S();Pt();kl();ae();S();Jr();Yo();De();ee();kc();ln();var mo=class extends os{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,rotate:l}=i[o.page],c=Y.transformRectCoords(o,a,l,new V),h=new C({frame:c,orig:new V(0,0,o.width,o.height),source:u,rotate:l});this.chars[n]={id:n.codePointAt(0),xOffset:o.xOffset,yOffset:o.yOffset,xAdvance:o.xAdvance,kerning:o.kerning??{},texture:h};}),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){dr.install(e);}static uninstall(e){dr.uninstall(e);}};var Eu={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],f=e[h].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),g={};for(let _ in f){let x=f[_].split("="),b=x[0],y=x[1].replace(/"/gm,""),v=parseFloat(y),T=isNaN(v)?y:v;g[b]=T;}t[d].push(g);}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],f=parseInt(d.id,10),g=d.letter??d.char??String.fromCharCode(f);g==="space"&&(g=" "),u[f]=g,i.chars[g]={id:f,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),f=parseInt(c[h].second,10),g=parseInt(c[h].amount,10);i.chars[u[f]].kerning[u[d]]=g;}return i}};ae();var hd={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 dd={test(r){return typeof r=="string"&&r.match(/<font(\s|>)/)?hd.test(U.get().parseXML(r)):false},parse(r){return hd.parse(U.get().parseXML(r))}};var dw=[".xml",".fnt"],Yy={extension:{type:m.CacheParser,name:"cacheBitmapFont"},test:r=>r instanceof mo,getCacheableAssets(r,e){let t={};return r.forEach(i=>{t[i]=e,t[`${i}-bitmap`]=e;}),t[`${e.fontFamily}-bitmap`]=e,t}},$y={extension:{type:m.LoadParser,priority:Te.Normal},name:"loadBitmapFont",id:"bitmap-font",test(r){return dw.includes(Le.extname(r).toLowerCase())},async testParse(r){return Eu.test(r)||dd.test(r)},async parse(r,e,t){let i=Eu.test(r)?Eu.parse(r):dd.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,f=Le.join(Le.dirname(s),d);f=Os(f,s),o.push({src:f,data:a});}let u=await t.load(o),l=o.map(h=>u[h.src]);return new mo({data:i,textures:l},s)},async load(r,e){return await(await U.get().fetch(r)).text()},async unload(r,e,t){await Promise.all(r.pages.map(i=>t.unload(i.texture.source._sourceOrigin))),r.destroy();}};se();var Au=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());}};nr();S();ee();var jy={extension:{type:m.CacheParser,name:"cacheTextureArray"},test:r=>Array.isArray(r)&&r.every(e=>e instanceof C),getCacheableAssets:(r,e)=>{let t={};return r.forEach(i=>{e.forEach((s,n)=>{t[i+(n===0?"":n+1)]=s;});}),t}};S();async function Cu(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 qy={extension:{type:m.DetectionParser,priority:1},test:async()=>Cu("data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A="),add:async r=>[...r,"avif"],remove:async r=>r.filter(e=>e!=="avif")};S();var xS=["png","jpg","jpeg"],Ky={extension:{type:m.DetectionParser,priority:-1},test:()=>Promise.resolve(true),add:async r=>[...r,...xS],remove:async r=>r.filter(e=>!xS.includes(e))};S();var fw="WorkerGlobalScope"in globalThis&&globalThis instanceof globalThis.WorkerGlobalScope;function Ir(r){return fw?false:document.createElement("video").canPlayType(r)!==""}var Zy={extension:{type:m.DetectionParser,priority:0},test:async()=>Ir("video/mp4"),add:async r=>[...r,"mp4","m4v"],remove:async r=>r.filter(e=>e!=="mp4"&&e!=="m4v")};S();var Qy={extension:{type:m.DetectionParser,priority:0},test:async()=>Ir("video/ogg"),add:async r=>[...r,"ogv"],remove:async r=>r.filter(e=>e!=="ogv")};S();var Jy={extension:{type:m.DetectionParser,priority:0},test:async()=>Ir("video/webm"),add:async r=>[...r,"webm"],remove:async r=>r.filter(e=>e!=="webm")};S();var e2={extension:{type:m.DetectionParser,priority:0},test:async()=>Cu("data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA="),add:async r=>[...r,"webp"],remove:async r=>r.filter(e=>e!=="webp")};se();Jr();Is();ta();var _S=class fd{constructor(){this.loadOptions={...fd.defaultOptions},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.parser||t.loadParser)&&(n=this._parserHash[t.parser||t.loadParser],t.loadParser&&M(`[Assets] "loadParser" is deprecated, use "parser" instead for ${e}`),n||M(`[Assets] specified load parser "${t.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 M(`[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=typeof t=="function"?{...fd.defaultOptions,...this.loadOptions,onProgress:t}:{...fd.defaultOptions,...this.loadOptions,...t||{}},{onProgress:s,onError:n,strategy:o,retryCount:a,retryDelay:u}=i,l=0,c={},h=ei(e),d=rt(e,_=>({alias:[_],src:_,data:{}})),f=d.reduce((_,x)=>_+(x.progressSize||1),0),g=d.map(async _=>{let x=Le.toAbsolute(_.src);c[_.src]||(await this._loadAssetWithRetry(x,_,{onProgress:s,onError:n,strategy:o,retryCount:a,retryDelay:u},c),l+=_.progressSize||1,s&&s(l/f));});return await Promise.all(g),h?c[d[0].src]:c}async unload(e){let i=rt(e,s=>({alias:[s],src:s})).map(async s=>{let n=Le.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||e.id).reduce((e,t)=>(!t.name&&!t.id?M("[Assets] parser should have an id"):(e[t.name]||e[t.id])&&M(`[Assets] parser id conflict "${t.id}"`),e[t.name]=t,t.id&&(e[t.id]=t),e),{});}async _loadAssetWithRetry(e,t,i,s){let n=0,{onError:o,strategy:a,retryCount:u,retryDelay:l}=i,c=h=>new Promise(d=>setTimeout(d,h));for(;;)try{this.promiseCache[e]||(this.promiseCache[e]=this._getLoadPromiseAndParser(e,t)),s[t.src]=await this.promiseCache[e].promise;return}catch(h){delete this.promiseCache[e],delete s[t.src],n++;let d=a!=="retry"||n>u;if(a==="retry"&&!d){o&&o(h,t),await c(l);continue}if(a==="skip"){o&&o(h,t);return}o&&o(h,t);let f=new Error(`[Loader.load] Failed to load ${e}.
|
|
2137
|
-
${h}`);throw h instanceof Error&&h.stack&&(f.stack=h.stack),f}}};
|
|
2136
|
+
`}});}};Il.extension={name:"vivid-light",type:m.BlendMode};S();ae();Jo();var Kf;function yr(r){return Kf!==void 0||(Kf=(()=>{let e={stencil:true,failIfMajorPerformanceCaveat:r??br.defaultOptions.failIfMajorPerformanceCaveat};try{if(!U.get().getWebGLRenderingContext())return !1;let i=U.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}})()),Kf}ae();var Zf;async function vr(r={}){return Zf!==void 0||(Zf=await(async()=>{let e=U.get().getNavigator().gpu;if(!e)return false;try{return await(await e.requestAdapter(r)).requestDevice(),!0}catch{return false}})()),Zf}Jo();var OS=["webgl","webgpu","canvas"];async function vm(r){let e=[];r.preference?(e.push(r.preference),OS.forEach(n=>{n!==r.preference&&e.push(n);})):e=OS.slice();let t,i={};for(let n=0;n<e.length;n++){let o=e[n];if(o==="webgpu"&&await vr()){let{WebGPURenderer:a}=await Promise.resolve().then(()=>(t2(),ES));t=a,i={...r,...r.webgpu};break}else if(o==="webgl"&&yr(r.failIfMajorPerformanceCaveat??br.defaultOptions.failIfMajorPerformanceCaveat)){let{WebGLRenderer:a}=await Promise.resolve().then(()=>(Z2(),IS));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}Qe();ap();re();var kS=class Q2{constructor(...e){this.stage=new Q,e[0]!==void 0&&w(O,"Application constructor options are deprecated, please use Application.init() instead.");}async init(e){e={...e},this.stage||(this.stage=new Q),this.renderer=await vm(e),Q2._plugins.forEach(t=>{t.init.call(this,e);});}render(){this.renderer.render({container:this.stage});}get canvas(){return this.renderer.canvas}get view(){return w(O,"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=Q2._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;}};kS._plugins=[];var J2=kS;G.handleByList(m.Application,J2._plugins);G.add(un);S();Mt();Dh();ae();S();di();mu();Ue();ee();vf();Xo();var jn=class extends Oi{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,rotate:l}=i[o.page],c=Y.transformRectCoords(o,a,l,new V),h=new A({frame:c,orig:new V(0,0,o.width,o.height),source:u,rotate:l});this.chars[n]={id:n.codePointAt(0),xOffset:o.xOffset,yOffset:o.yOffset,xAdvance:o.xAdvance,kerning:o.kerning??{},texture:h};}),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){ar.install(e);}static uninstall(e){ar.uninstall(e);}};var Ta={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],f=e[h].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),g={};for(let _ in f){let x=f[_].split("="),b=x[0],y=x[1].replace(/"/gm,""),v=parseFloat(y),T=isNaN(v)?y:v;g[b]=T;}t[d].push(g);}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],f=parseInt(d.id,10),g=d.letter??d.char??String.fromCharCode(f);g==="space"&&(g=" "),u[f]=g,i.chars[g]={id:f,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),f=parseInt(c[h].second,10),g=parseInt(c[h].amount,10);i.chars[u[f]].kerning[u[d]]=g;}return i}};ae();var ic={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 sc={test(r){return typeof r=="string"&&r.match(/<font(\s|>)/)?ic.test(U.get().parseXML(r)):false},parse(r){return ic.parse(U.get().parseXML(r))}};var rP=[".xml",".fnt"],Tm={extension:{type:m.CacheParser,name:"cacheBitmapFont"},test:r=>r instanceof jn,getCacheableAssets(r,e){let t={};return r.forEach(i=>{t[i]=e,t[`${i}-bitmap`]=e;}),t[`${e.fontFamily}-bitmap`]=e,t}},Sm={extension:{type:m.LoadParser,priority:Te.Normal},name:"loadBitmapFont",id:"bitmap-font",test(r){return rP.includes(Ie.extname(r).toLowerCase())},async testParse(r){return Ta.test(r)||sc.test(r)},async parse(r,e,t){let i=Ta.test(r)?Ta.parse(r):sc.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,f=Ie.join(Ie.dirname(s),d);f=_s(f,s),o.push({src:f,data:a});}let u=await t.load(o),l=o.map(h=>u[h.src]);return new jn({data:i,textures:l},s)},async load(r,e){return await(await U.get().fetch(r)).text()},async unload(r,e,t){await Promise.all(r.pages.map(i=>t.unload(i.texture.source._sourceOrigin))),r.destroy();}};ne();var Sa=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());}};pr();S();ee();var Em={extension:{type:m.CacheParser,name:"cacheTextureArray"},test:r=>Array.isArray(r)&&r.every(e=>e instanceof A),getCacheableAssets:(r,e)=>{let t={};return r.forEach(i=>{e.forEach((s,n)=>{t[i+(n===0?"":n+1)]=s;});}),t}};S();async function Ea(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 Am={extension:{type:m.DetectionParser,priority:1},test:async()=>Ea("data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A="),add:async r=>[...r,"avif"],remove:async r=>r.filter(e=>e!=="avif")};S();var LS=["png","jpg","jpeg"],Cm={extension:{type:m.DetectionParser,priority:-1},test:()=>Promise.resolve(true),add:async r=>[...r,...LS],remove:async r=>r.filter(e=>!LS.includes(e))};S();var iP="WorkerGlobalScope"in globalThis&&globalThis instanceof globalThis.WorkerGlobalScope;function Sr(r){return iP?false:document.createElement("video").canPlayType(r)!==""}var wm={extension:{type:m.DetectionParser,priority:0},test:async()=>Sr("video/mp4"),add:async r=>[...r,"mp4","m4v"],remove:async r=>r.filter(e=>e!=="mp4"&&e!=="m4v")};S();var Pm={extension:{type:m.DetectionParser,priority:0},test:async()=>Sr("video/ogg"),add:async r=>[...r,"ogv"],remove:async r=>r.filter(e=>e!=="ogv")};S();var Bm={extension:{type:m.DetectionParser,priority:0},test:async()=>Sr("video/webm"),add:async r=>[...r,"webm"],remove:async r=>r.filter(e=>e!=="webm")};S();var Rm={extension:{type:m.DetectionParser,priority:0},test:async()=>Ea("data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA="),add:async r=>[...r,"webp"],remove:async r=>r.filter(e=>e!=="webp")};ne();di();lo();Su();var NS=class Mm{constructor(){this.loadOptions={...Mm.defaultOptions},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.parser||t.loadParser)&&(n=this._parserHash[t.parser||t.loadParser],t.loadParser&&R(`[Assets] "loadParser" is deprecated, use "parser" instead for ${e}`),n||R(`[Assets] specified load parser "${t.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 R(`[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=typeof t=="function"?{...Mm.defaultOptions,...this.loadOptions,onProgress:t}:{...Mm.defaultOptions,...this.loadOptions,...t||{}},{onProgress:s,onError:n,strategy:o,retryCount:a,retryDelay:u}=i,l=0,c={},h=Ir(e),d=tt(e,_=>({alias:[_],src:_,data:{}})),f=d.reduce((_,x)=>_+(x.progressSize||1),0),g=d.map(async _=>{let x=Ie.toAbsolute(_.src);c[_.src]||(await this._loadAssetWithRetry(x,_,{onProgress:s,onError:n,strategy:o,retryCount:a,retryDelay:u},c),l+=_.progressSize||1,s&&s(l/f));});return await Promise.all(g),h?c[d[0].src]:c}async unload(e){let i=tt(e,s=>({alias:[s],src:s})).map(async s=>{let n=Ie.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||e.id).reduce((e,t)=>(!t.name&&!t.id?R("[Assets] parser should have an id"):(e[t.name]||e[t.id])&&R(`[Assets] parser id conflict "${t.id}"`),e[t.name]=t,t.id&&(e[t.id]=t),e),{});}async _loadAssetWithRetry(e,t,i,s){let n=0,{onError:o,strategy:a,retryCount:u,retryDelay:l}=i,c=h=>new Promise(d=>setTimeout(d,h));for(;;)try{this.promiseCache[e]||(this.promiseCache[e]=this._getLoadPromiseAndParser(e,t)),s[t.src]=await this.promiseCache[e].promise;return}catch(h){delete this.promiseCache[e],delete s[t.src],n++;let d=a!=="retry"||n>u;if(a==="retry"&&!d){o&&o(h,t),await c(l);continue}if(a==="skip"){o&&o(h,t);return}o&&o(h,t);let f=new Error(`[Loader.load] Failed to load ${e}.
|
|
2137
|
+
${h}`);throw h instanceof Error&&h.stack&&(f.stack=h.stack),f}}};NS.defaultOptions={onProgress:void 0,onError:void 0,strategy:"throw",retryCount:3,retryDelay:250};var Dm=NS;ae();S();function Et(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}`)}di();function we(r,e){let t=r.split("?")[0],i=Ie.extname(t).toLowerCase();return Array.isArray(e)?e.includes(i):i===e}Mt();var sP=".json",nP="application/json",Fm={extension:{type:m.LoadParser,priority:Te.Low},name:"loadJson",id:"json",test(r){return Et(r,nP)||we(r,sP)},async load(r){return await(await U.get().fetch(r)).json()}};ae();S();Mt();var oP=".txt",aP="text/plain",Gm={name:"loadTxt",id:"text",extension:{type:m.LoadParser,priority:Te.Low,name:"loadTxt"},test(r){return Et(r,aP)||we(r,oP)},async load(r){return await(await U.get().fetch(r)).text()}};ae();S();ne();di();pr();Mt();var uP=["normal","bold","100","200","300","400","500","600","700","800","900"],lP=[".ttf",".otf",".woff",".woff2"],cP=["font/ttf","font/otf","font/woff","font/woff2"],hP=/^(--|-?[A-Z_])[0-9A-Z_-]*$/i;function ev(r){let e=Ie.extname(r),s=Ie.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(hP)){n=false;break}let o=s.join(" ");return n||(o=`"${o.replace(/[\\"]/g,"\\$&")}"`),o}var dP=/^[0-9A-Za-z%:/?#\[\]@!\$&'()\*\+,;=\-._~]*$/;function fP(r){return dP.test(r)?r:encodeURI(r)}var Um={extension:{type:m.LoadParser,priority:Te.Low},name:"loadWebFont",id:"web-font",test(r){return Et(r,cP)||we(r,lP)},async load(r,e){let t=U.get().getFontFaceSet();if(t){let i=[],s=e.data?.family??ev(r),n=e.data?.weights?.filter(a=>uP.includes(a))??["normal"],o=e.data??{};for(let a=0;a<n.length;a++){let u=n[a],l=new FontFace(s,`url(${fP(r)})`,{...o,weight:u});await l.load(),t.add(l),i.push(l);}return te.has(`${s}-and-url`)?te.get(`${s}-and-url`).entries.push({url:r,faces:i}):te.set(`${s}-and-url`,{entries:[{url:r,faces:i}]}),i.length===1?i[0]:i}return R("[loadWebFont] FontFace API is not supported. Skipping loading font"),null},unload(r){let e=Array.isArray(r)?r:[r],t=e[0].family,i=te.get(`${t}-and-url`),s=i.entries.find(n=>n.faces.some(o=>e.indexOf(o)!==-1));s.faces=s.faces.filter(n=>e.indexOf(n)===-1),s.faces.length===0&&(i.entries=i.entries.filter(n=>n!==s)),e.forEach(n=>{U.get().getFontFaceSet().delete(n);}),i.entries.length===0&&te.remove(`${t}-and-url`);}};ae();S();Ss();Ls();fi();function Zi(r,e=1){let t=rt.RETINA_PREFIX?.exec(r);return t?parseFloat(t[1]):e}Mt();ee();ne();pr();function ft(r,e,t){r.label=t,r._sourceOrigin=t;let i=new A({source:r,label:t}),s=()=>{delete e.promiseCache[t],te.has(t)&&te.remove(t);};return i.source.once("destroy",()=>{e.promiseCache[t]&&(R("[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||(R("[Assets] A Texture managed by Assets was destroyed instead of unloaded! Use Assets.unload() instead of destroying the Texture."),s());}),i}var pP=".svg",mP="image/svg+xml",Im={extension:{type:m.LoadParser,priority:Te.Low,name:"loadSVG"},name:"loadSVG",id:"svg",config:{crossOrigin:"anonymous",parseAsGraphicsContext:false},test(r){return Et(r,mP)||we(r,pP)},async load(r,e,t){return e.data?.parseAsGraphicsContext??this.config.parseAsGraphicsContext?xP(r):gP(r,e,t,this.config.crossOrigin)},unload(r){r.destroy(true);}};async function gP(r,e,t,i){let s=await U.get().fetch(r),n=U.get().createImage();n.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(await s.text())}`,n.crossOrigin=i,await n.decode();let o=e.data?.width??n.width,a=e.data?.height??n.height,u=e.data?.resolution||Zi(r),l=Math.ceil(o*u),c=Math.ceil(a*u),h=U.get().createCanvas(l,c),d=h.getContext("2d");d.imageSmoothingEnabled=true,d.imageSmoothingQuality="high",d.drawImage(n,0,0,o*u,a*u);let{parseAsGraphicsContext:f,...g}=e.data??{},_=new ot({resource:h,alphaMode:"premultiply-alpha-on-upload",resolution:u,...g});return ft(_,t,r)}async function xP(r){let t=await(await U.get().fetch(r)).text(),i=new ke;return i.svg(t),i}ae();S();Ss();var _P=`(function () {
|
|
2138
2138
|
'use strict';
|
|
2139
2139
|
|
|
2140
2140
|
const WHITE_PNG = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+ip1sAAAAASUVORK5CYII=";
|
|
@@ -2155,7 +2155,7 @@ ${h}`);throw h instanceof Error&&h.stack&&(f.stack=h.stack),f}}};_S.defaultOptio
|
|
|
2155
2155
|
});
|
|
2156
2156
|
|
|
2157
2157
|
})();
|
|
2158
|
-
`,
|
|
2158
|
+
`,Aa=null,Ca=class{constructor(){Aa||(Aa=URL.createObjectURL(new Blob([_P],{type:"application/javascript"}))),this.worker=new Worker(Aa);}};Ca.revokeObjectURL=function(){Aa&&(URL.revokeObjectURL(Aa),Aa=null);};var bP=`(function () {
|
|
2159
2159
|
'use strict';
|
|
2160
2160
|
|
|
2161
2161
|
async function loadImageBitmap(url, alphaMode) {
|
|
@@ -2184,7 +2184,7 @@ ${h}`);throw h instanceof Error&&h.stack&&(f.stack=h.stack),f}}};_S.defaultOptio
|
|
|
2184
2184
|
};
|
|
2185
2185
|
|
|
2186
2186
|
})();
|
|
2187
|
-
`,_o=null,wu=class{constructor(){_o||(_o=URL.createObjectURL(new Blob([Bw],{type:"application/javascript"}))),this.worker=new Worker(_o);}};wu.revokeObjectURL=function(){_o&&(URL.revokeObjectURL(_o),_o=null);};var yS=0,o2,a2=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 xo;t.addEventListener("message",i=>{t.terminate(),xo.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(){o2===void 0&&(o2=navigator.hardwareConcurrency||4);let e=this._workerPool.pop();return !e&&this._createdWorkers<o2&&(this._createdWorkers++,e=new wu().worker,e.addEventListener("message",t=>{this._complete(t.data),this._returnWorker(t.target),this._next();})),e}_returnWorker(e){this._workerPool.push(e);}_complete(e){this._resolveHash[e.uuid]&&(e.error!==void 0?this._resolveHash[e.uuid].reject(e.error):this._resolveHash[e.uuid].resolve(e.data),delete this._resolveHash[e.uuid]);}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[yS]={resolve:t.resolve,reject:t.reject},e.postMessage({data:t.arguments,uuid:yS++,id:i});}reset(){this._workerPool.forEach(e=>e.terminate()),this._workerPool.length=0,Object.values(this._resolveHash).forEach(({reject:e})=>{e?.(new Error("WorkerManager has been reset before completion"));}),this._resolveHash={},this._queue.length=0,this._initialized=false,this._createdWorkers=0;}},pd=new a2;Pt();var Rw=[".jpeg",".jpg",".png",".webp",".avif"],Mw=["image/jpeg","image/png","image/webp","image/avif"];async function vS(r,e){let t=await U.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 Pu={name:"loadTextures",id:"texture",extension:{type:m.LoadParser,priority:Te.High,name:"loadTextures"},config:{preferWorkers:true,preferCreateImageBitmap:true,crossOrigin:"anonymous"},test(r){return Mt(r,Mw)||Pe(r,Rw)},async load(r,e,t){let i=null;globalThis.createImageBitmap&&this.config.preferCreateImageBitmap?this.config.preferWorkers&&await pd.isImageBitmapSupported()?i=await pd.loadImageBitmap(r,e):i=await vS(r,e):i=await new Promise((n,o)=>{i=U.get().createImage(),i.crossOrigin=this.config.crossOrigin,i.src=r,i.complete?n(i):(i.onload=()=>{n(i);},i.onerror=o);});let s=new ut({resource:i,alphaMode:"premultiply-alpha-on-upload",resolution:e.data?.resolution||Ts(r),...e.data});return xt(s,t,r)},unload(r){r.destroy(true);}};S();Wl();Vl();var Dw=[".mp4",".m4v",".webm",".ogg",".ogv",".h264",".avi",".mov"],u2,l2;function TS(r,e,t){t===void 0&&!e.startsWith("data:")?r.crossOrigin=ES(e):t!==false&&(r.crossOrigin=typeof t=="string"?t:"anonymous");}function SS(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 ES(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":""}function Fw(){let r=[],e=[];for(let t of Dw){let i=ii.MIME_TYPES[t.substring(1)]||`video/${t.substring(1)}`;Ir(i)&&(r.push(t),e.includes(i)||e.push(i));}return {validVideoExtensions:r,validVideoMime:e}}var c2={name:"loadVideo",id:"video",extension:{type:m.LoadParser,name:"loadVideo"},test(r){if(!u2||!l2){let{validVideoExtensions:i,validVideoMime:s}=Fw();u2=i,l2=s;}let e=Mt(r,l2),t=Pe(r,u2);return e||t},async load(r,e,t){let i={...ii.defaultOptions,resolution:e.data?.resolution||Ts(r),alphaMode:e.data?.alphaMode||await oa(),...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),TS(s,r,i.crossorigin);let o=document.createElement("source"),a;if(i.mime)a=i.mime;else 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=ii.MIME_TYPES[u]||`video/${u}`;}return o.src=r,a&&(o.type=a),new Promise(u=>{let l=async()=>{let c=new ii({...i,resource:s});s.removeEventListener("canplay",l),e.data.preload&&await SS(s),u(xt(c,t,r));};i.preload&&!i.autoPlay&&s.load(),s.addEventListener("canplay",l),s.appendChild(o);})},unload(r){r.destroy(true);}};S();ti();S();ti();var Bu={extension:{type:m.ResolveParser,name:"resolveTexture"},test:Pu.test,parse:r=>({resolution:parseFloat(it.RETINA_PREFIX.exec(r)?.[1]??"1"),format:r.split(".").pop(),src:r})};var h2={extension:{type:m.ResolveParser,priority:-2,name:"resolveJson"},test:r=>it.RETINA_PREFIX.test(r)&&r.endsWith(".json"),parse:Bu.parse};ti();Is();ta();var md=class{constructor(){this._detections=[],this._initialized=false,this.resolver=new it,this.loader=new t2,this.cache=te,this._backgroundLoader=new Au(this.loader),this._backgroundLoader.active=true,this.reset();}async init(e={}){if(this._initialized){M("[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),e.loadOptions&&(this.loader.loadOptions={...this.loader.loadOptions,...e.loadOptions});}add(e){this.resolver.add(e);}async load(e,t){this._initialized||await this.init();let i=ei(e),s=rt(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=[],l=()=>{t?.(u.reduce((h,d)=>h+d,0)/a);},c=o.map((h,d)=>{let f=s[h],g=Object.values(f),x=[...new Set(g.flat())].reduce((b,y)=>b+(y.progressSize||1),0);return u.push(0),a+=x,this._mapLoadToResolve(f,b=>{u[d]=b*x,l();}).then(b=>{n[h]=b;})});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 te.get(e);let t={};for(let i=0;i<e.length;i++)t[i]=te.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;}),te.set(u,a);}),n}async unload(e){this._initialized||await this.init();let t=rt(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=rt(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=>{te.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];});});}},Ru=new md;G.handleByList(m.LoadParser,Ru.loader.parsers).handleByList(m.ResolveParser,Ru.resolver.parsers).handleByList(m.CacheParser,Ru.cache.parsers).handleByList(m.DetectionParser,Ru.detections);G.add(jy,Ky,qy,e2,Zy,Qy,Jy,r2,i2,s2,n2,Pu,c2,$y,Yy,Bu,h2);var AS={loader:m.LoadParser,resolver:m.ResolveParser,cache:m.CacheParser,detection:m.DetectionParser};G.handle(m.Asset,r=>{let e=r.ref;Object.entries(AS).filter(([t])=>!!e[t]).forEach(([t,i])=>G.add(Object.assign(e[t],{extension:e[t].extension??i})));},r=>{let e=r.ref;Object.keys(AS).filter(t=>!!e[t]).forEach(t=>G.remove(e[t]));});S();var Gw={extension:{type:m.DetectionParser,priority:3},test:async()=>!!(await Gr()||Fr()),add:async r=>[...r,"basis"],remove:async r=>r.filter(e=>e!=="basis")};Pt();S();He();var er=class extends Z{constructor(e){super(e),this.uploadMethodId="compressed",this.resource=e.resource,this.mipLevelCount=this.resource.length;}};ae();var gd;function xd(){if(gd)return gd;let e=U.get().createCanvas(1,1).getContext("webgl");return e?(gd=[...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"]:[]],gd):[]}ae();var _d;async function bd(){if(_d)return _d;let r=await U.get().getNavigator().gpu.requestAdapter();return _d=[...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"]:[]],_d}var yd;async function Mu(){return yd!==void 0||(yd=await(async()=>{let r=await Gr(),e=Fr();if(r&&e){let t=await bd(),i=xd();return t.filter(s=>i.includes(s))}else {if(r)return await bd();if(e)return xd()}return []})()),yd}var CS=["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"],vd;async function Or(){if(vd!==void 0)return vd;let r=await Mu();return vd=[...CS,...r],vd}var Uw=`(function () {
|
|
2187
|
+
`,wa=null,nc=class{constructor(){wa||(wa=URL.createObjectURL(new Blob([bP],{type:"application/javascript"}))),this.worker=new Worker(wa);}};nc.revokeObjectURL=function(){wa&&(URL.revokeObjectURL(wa),wa=null);};var HS=0,tv,rv=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 Ca;t.addEventListener("message",i=>{t.terminate(),Ca.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(){tv===void 0&&(tv=navigator.hardwareConcurrency||4);let e=this._workerPool.pop();return !e&&this._createdWorkers<tv&&(this._createdWorkers++,e=new nc().worker,e.addEventListener("message",t=>{this._complete(t.data),this._returnWorker(t.target),this._next();})),e}_returnWorker(e){this._workerPool.push(e);}_complete(e){this._resolveHash[e.uuid]&&(e.error!==void 0?this._resolveHash[e.uuid].reject(e.error):this._resolveHash[e.uuid].resolve(e.data),delete this._resolveHash[e.uuid]);}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[HS]={resolve:t.resolve,reject:t.reject},e.postMessage({data:t.arguments,uuid:HS++,id:i});}reset(){this._workerPool.forEach(e=>e.terminate()),this._workerPool.length=0,Object.values(this._resolveHash).forEach(({reject:e})=>{e?.(new Error("WorkerManager has been reset before completion"));}),this._resolveHash={},this._queue.length=0,this._initialized=false,this._createdWorkers=0;}},oc=new rv;Mt();var yP=[".jpeg",".jpg",".png",".webp",".avif"],vP=["image/jpeg","image/png","image/webp","image/avif"];async function iv(r,e){let t=await U.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 Pa={name:"loadTextures",id:"texture",extension:{type:m.LoadParser,priority:Te.High,name:"loadTextures"},config:{preferWorkers:true,preferCreateImageBitmap:true,crossOrigin:"anonymous"},test(r){return Et(r,vP)||we(r,yP)},async load(r,e,t){let i=null;globalThis.createImageBitmap&&this.config.preferCreateImageBitmap?this.config.preferWorkers&&await oc.isImageBitmapSupported()?i=await oc.loadImageBitmap(r,e):i=await iv(r,e):i=await new Promise((n,o)=>{i=U.get().createImage(),i.crossOrigin=this.config.crossOrigin,i.src=r,i.complete?n(i):(i.onload=()=>{n(i);},i.onerror=o);});let s=new ot({resource:i,alphaMode:"premultiply-alpha-on-upload",resolution:e.data?.resolution||Zi(r),...e.data});return ft(s,t,r)},unload(r){r.destroy(true);}};S();kh();Ih();var TP=[".mp4",".m4v",".webm",".ogg",".ogv",".h264",".avi",".mov"],sv,nv;function ov(r,e,t){t===void 0&&!e.startsWith("data:")?r.crossOrigin=uv(e):t!==false&&(r.crossOrigin=typeof t=="string"?t:"anonymous");}function av(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 uv(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":""}function SP(){let r=[],e=[];for(let t of TP){let i=Or.MIME_TYPES[t.substring(1)]||`video/${t.substring(1)}`;Sr(i)&&(r.push(t),e.includes(i)||e.push(i));}return {validVideoExtensions:r,validVideoMime:e}}var Om={name:"loadVideo",id:"video",extension:{type:m.LoadParser,name:"loadVideo"},test(r){if(!sv||!nv){let{validVideoExtensions:i,validVideoMime:s}=SP();sv=i,nv=s;}let e=Et(r,nv),t=we(r,sv);return e||t},async load(r,e,t){let i={...Or.defaultOptions,resolution:e.data?.resolution||Zi(r),alphaMode:e.data?.alphaMode||await ho(),...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),ov(s,r,i.crossorigin);let o=document.createElement("source"),a;if(i.mime)a=i.mime;else 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=Or.MIME_TYPES[u]||`video/${u}`;}return o.src=r,a&&(o.type=a),new Promise(u=>{let l=async()=>{let c=new Or({...i,resource:s});s.removeEventListener("canplay",l),e.data.preload&&await av(s),u(ft(c,t,r));};i.preload&&!i.autoPlay&&s.load(),s.addEventListener("canplay",l),s.appendChild(o);})},unload(r){r.destroy(true);}};S();fi();S();fi();var Ba={extension:{type:m.ResolveParser,name:"resolveTexture"},test:Pa.test,parse:r=>({resolution:parseFloat(rt.RETINA_PREFIX.exec(r)?.[1]??"1"),format:r.split(".").pop(),src:r})};var km={extension:{type:m.ResolveParser,priority:-2,name:"resolveJson"},test:r=>rt.RETINA_PREFIX.test(r)&&r.endsWith(".json"),parse:Ba.parse};fi();lo();Su();var ac=class{constructor(){this._detections=[],this._initialized=false,this.resolver=new rt,this.loader=new Dm,this.cache=te,this._backgroundLoader=new Sa(this.loader),this._backgroundLoader.active=true,this.reset();}async init(e={}){if(this._initialized){R("[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),e.loadOptions&&(this.loader.loadOptions={...this.loader.loadOptions,...e.loadOptions});}add(e){this.resolver.add(e);}async load(e,t){this._initialized||await this.init();let i=Ir(e),s=tt(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=[],l=()=>{t?.(u.reduce((h,d)=>h+d,0)/a);},c=o.map((h,d)=>{let f=s[h],g=Object.values(f),x=[...new Set(g.flat())].reduce((b,y)=>b+(y.progressSize||1),0);return u.push(0),a+=x,this._mapLoadToResolve(f,b=>{u[d]=b*x,l();}).then(b=>{n[h]=b;})});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 te.get(e);let t={};for(let i=0;i<e.length;i++)t[i]=te.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;}),te.set(u,a);}),n}async unload(e){this._initialized||await this.init();let t=tt(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=tt(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=>{te.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];});});}},Ra=new ac;G.handleByList(m.LoadParser,Ra.loader.parsers).handleByList(m.ResolveParser,Ra.resolver.parsers).handleByList(m.CacheParser,Ra.cache.parsers).handleByList(m.DetectionParser,Ra.detections);G.add(Em,Cm,Am,Rm,wm,Pm,Bm,Fm,Gm,Um,Im,Pa,Om,Sm,Tm,Ba,km);var VS={loader:m.LoadParser,resolver:m.ResolveParser,cache:m.CacheParser,detection:m.DetectionParser};G.handle(m.Asset,r=>{let e=r.ref;Object.entries(VS).filter(([t])=>!!e[t]).forEach(([t,i])=>G.add(Object.assign(e[t],{extension:e[t].extension??i})));},r=>{let e=r.ref;Object.keys(VS).filter(t=>!!e[t]).forEach(t=>G.remove(e[t]));});S();var zS={extension:{type:m.DetectionParser,priority:3},test:async()=>!!(await vr()||yr()),add:async r=>[...r,"basis"],remove:async r=>r.filter(e=>e!=="basis")};Mt();S();We();var Xt=class extends Z{constructor(e){super(e),this.uploadMethodId="compressed",this.resource=e.resource,this.mipLevelCount=this.resource.length;}};ae();var Lm;function uc(){if(Lm)return Lm;let e=U.get().createCanvas(1,1).getContext("webgl");return e?(Lm=[...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"]:[]],Lm):[]}ae();var Nm;async function lc(){if(Nm)return Nm;let r=await U.get().getNavigator().gpu.requestAdapter();return Nm=[...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"]:[]],Nm}var Hm;async function Ma(){return Hm!==void 0||(Hm=await(async()=>{let r=await vr(),e=yr();if(r&&e){let t=await lc(),i=uc();return t.filter(s=>i.includes(s))}else {if(r)return await lc();if(e)return uc()}return []})()),Hm}var lv=["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"],Vm;async function Er(){if(Vm!==void 0)return Vm;let r=await Ma();return Vm=[...lv,...r],Vm}var EP=`(function () {
|
|
2188
2188
|
'use strict';
|
|
2189
2189
|
|
|
2190
2190
|
function createLevelBuffers(basisTexture, basisTranscoderFormat) {
|
|
@@ -2320,8 +2320,8 @@ ${h}`);throw h instanceof Error&&h.stack&&(f.stack=h.stack),f}}};_S.defaultOptio
|
|
|
2320
2320
|
};
|
|
2321
2321
|
|
|
2322
2322
|
})();
|
|
2323
|
-
`,bo=null,Du=class{constructor(){bo||(bo=URL.createObjectURL(new Blob([Uw],{type:"application/javascript"}))),this.worker=new Worker(bo);}};Du.revokeObjectURL=function(){bo&&(URL.revokeObjectURL(bo),bo=null);};var Fu={jsUrl:"https://cdn.jsdelivr.net/npm/pixi.js/transcoders/basis/basis_transcoder.js",wasmUrl:"https://cdn.jsdelivr.net/npm/pixi.js/transcoders/basis/basis_transcoder.wasm"};function Iw(r){Object.assign(Fu,r);}var Gu,wS={};function Ow(r){return Gu||(Gu=new Du().worker,Gu.onmessage=e=>{let{success:t,url:i,textureOptions:s}=e.data;t||console.warn("Failed to load Basis texture",i),wS[i](s);},Gu.postMessage({type:"init",jsUrl:Fu.jsUrl,wasmUrl:Fu.wasmUrl,supportedTextures:r})),Gu}function d2(r,e){let t=Ow(e);return new Promise(i=>{wS[r]=i,t.postMessage({type:"load",url:r});})}var kw={extension:{type:m.LoadParser,priority:Te.High,name:"loadBasis"},name:"loadBasis",id:"basis",test(r){return Pe(r,[".basis"])},async load(r,e,t){let i=await Or(),s=await d2(r,i),n=new er(s);return xt(n,t,r)},unload(r){Array.isArray(r)?r.forEach(e=>e.destroy(true)):r.destroy(true);}};function Lw(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 Nw={"bc3-rgba-unorm":3,"bc7-rgba-unorm":6,"etc2-rgba8unorm":1,"astc-4x4-unorm":10,rgba8unorm:13,rgba4unorm:16};function Hw(r){let e=Nw[r];if(e)return e;throw new Error(`Unsupported transcoderFormat: ${r}`)}var Vw={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},zw={DXGI_FORMAT:0,RESOURCE_DIMENSION:1,MISC_FLAG:2,ARRAY_SIZE:3,MISC_FLAGS2:4},f2=(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))(f2||{}),p2=(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))(p2||{});function Ye(r){return r.charCodeAt(0)+(r.charCodeAt(1)<<8)+(r.charCodeAt(2)<<16)+(r.charCodeAt(3)<<24)}var Tt=(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=Ye("UYVY")]="UYVY",r[r.R8G8_B8G8=Ye("RGBG")]="R8G8_B8G8",r[r.YUY2=Ye("YUY2")]="YUY2",r[r.D3DFMT_G8R8_G8B8=Ye("GRGB")]="D3DFMT_G8R8_G8B8",r[r.DXT1=Ye("DXT1")]="DXT1",r[r.DXT2=Ye("DXT2")]="DXT2",r[r.DXT3=Ye("DXT3")]="DXT3",r[r.DXT4=Ye("DXT4")]="DXT4",r[r.DXT5=Ye("DXT5")]="DXT5",r[r.ATI1=Ye("ATI1")]="ATI1",r[r.AT1N=Ye("AT1N")]="AT1N",r[r.ATI2=Ye("ATI2")]="ATI2",r[r.AT2N=Ye("AT2N")]="AT2N",r[r.BC4U=Ye("BC4U")]="BC4U",r[r.BC4S=Ye("BC4S")]="BC4S",r[r.BC5U=Ye("BC5U")]="BC5U",r[r.BC5S=Ye("BC5S")]="BC5S",r[r.DX10=Ye("DX10")]="DX10",r))(Tt||{}),Td={[Tt.DXT1]:"bc1-rgba-unorm",[Tt.DXT2]:"bc2-rgba-unorm",[Tt.DXT3]:"bc2-rgba-unorm",[Tt.DXT4]:"bc3-rgba-unorm",[Tt.DXT5]:"bc3-rgba-unorm",[Tt.ATI1]:"bc4-r-unorm",[Tt.BC4U]:"bc4-r-unorm",[Tt.BC4S]:"bc4-r-snorm",[Tt.ATI2]:"bc5-rg-unorm",[Tt.BC5U]:"bc5-rg-unorm",[Tt.BC5S]:"bc5-rg-snorm",36:"rgba16uint",110:"rgba16sint",111:"r16float",112:"rg16float",113:"rgba16float",114:"r32float",115:"rg32float",116:"rgba32float"},_t={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"},X={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:Vw,HEADER_DX10_FIELDS:zw,DXGI_FORMAT:f2,D3D10_RESOURCE_DIMENSION:p2,D3DFMT:Tt},m2={"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};Pt();S();function g2(r,e){let{format:t,fourCC:i,width:s,height:n,dataOffset:o,mipmapCount:a}=Xw(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=Ww(t,s,n,o,a,r);return {format:t,width:s,height:n,resource:u,alphaMode:"no-premultiply-alpha"}}function Ww(r,e,t,i,s,n){let o=[],a=m2[r],u=e,l=t,c=i;for(let h=0;h<s;++h){let d=Math.ceil(Math.max(4,u)/4)*4,f=Math.ceil(Math.max(4,l)/4)*4,g=a?d/4*f/4*a:u*l*4,_=new Uint8Array(n,c,g);o.push(_),c+=g,u=Math.max(u>>1,1),l=Math.max(l>>1,1);}return o}function Xw(r){let e=new Uint32Array(r,0,X.HEADER_SIZE/Uint32Array.BYTES_PER_ELEMENT);if(e[X.HEADER_FIELDS.MAGIC]!==X.MAGIC_VALUE)throw new Error("Invalid magic number in DDS header");let t=e[X.HEADER_FIELDS.HEIGHT],i=e[X.HEADER_FIELDS.WIDTH],s=Math.max(1,e[X.HEADER_FIELDS.MIPMAP_COUNT]),n=e[X.HEADER_FIELDS.PF_FLAGS],o=e[X.HEADER_FIELDS.FOURCC],a=Yw(e,n,o,r),u=X.MAGIC_SIZE+X.HEADER_SIZE+(o===X.D3DFMT.DX10?X.HEADER_DX10_SIZE:0);return {format:a,fourCC:o,width:i,height:t,dataOffset:u,mipmapCount:s}}function Yw(r,e,t,i){if(e&X.PIXEL_FORMAT_FLAGS.FOURCC){if(t===X.D3DFMT.DX10){let s=new Uint32Array(i,X.MAGIC_SIZE+X.HEADER_SIZE,X.HEADER_DX10_SIZE/Uint32Array.BYTES_PER_ELEMENT);if(s[X.HEADER_DX10_FIELDS.MISC_FLAG]===X.RESOURCE_MISC_TEXTURECUBE)throw new Error("DDSParser does not support cubemap textures");if(s[X.HEADER_DX10_FIELDS.RESOURCE_DIMENSION]===X.D3D10_RESOURCE_DIMENSION.DDS_DIMENSION_TEXTURE3D)throw new Error("DDSParser does not supported 3D texture data");let a=s[X.HEADER_DX10_FIELDS.DXGI_FORMAT];if(a in _t)return _t[a];throw new Error(`DDSParser cannot parse texture data with DXGI format ${a}`)}if(t in Td)return Td[t];throw new Error(`DDSParser cannot parse texture data with fourCC format ${t}`)}if(e&X.PIXEL_FORMAT_FLAGS.RGB||e&X.PIXEL_FORMAT_FLAGS.RGBA)return $w(r);throw e&X.PIXEL_FORMAT_FLAGS.YUV?new Error("DDSParser does not supported YUV uncompressed texture data."):e&X.PIXEL_FORMAT_FLAGS.LUMINANCE||e&X.PIXEL_FORMAT_FLAGS.LUMINANCEA?new Error("DDSParser does not support single-channel (lumninance) texture data!"):e&X.PIXEL_FORMAT_FLAGS.ALPHA||e&X.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 $w(r){let e=r[X.HEADER_FIELDS.RGB_BITCOUNT],t=r[X.HEADER_FIELDS.R_BIT_MASK],i=r[X.HEADER_FIELDS.G_BIT_MASK],s=r[X.HEADER_FIELDS.B_BIT_MASK],n=r[X.HEADER_FIELDS.A_BIT_MASK];switch(e){case 32:if(t===255&&i===65280&&s===16711680&&n===4278190080)return _t[X.DXGI_FORMAT.DXGI_FORMAT_R8G8B8A8_UNORM];if(t===16711680&&i===65280&&s===255&&n===4278190080)return _t[X.DXGI_FORMAT.DXGI_FORMAT_B8G8R8A8_UNORM];if(t===1072693248&&i===1047552&&s===1023&&n===3221225472)return _t[X.DXGI_FORMAT.DXGI_FORMAT_R10G10B10A2_UNORM];if(t===65535&&i===4294901760&&s===0&&n===0)return _t[X.DXGI_FORMAT.DXGI_FORMAT_R16G16_UNORM];if(t===4294967295&&i===0&&s===0&&n===0)return _t[X.DXGI_FORMAT.DXGI_FORMAT_R32_FLOAT];break;case 24:break;case 16:if(t===31744&&i===992&&s===31&&n===32768)return _t[X.DXGI_FORMAT.DXGI_FORMAT_B5G5R5A1_UNORM];if(t===63488&&i===2016&&s===31&&n===0)return _t[X.DXGI_FORMAT.DXGI_FORMAT_B5G6R5_UNORM];if(t===3840&&i===240&&s===15&&n===61440)return _t[X.DXGI_FORMAT.DXGI_FORMAT_B4G4R4A4_UNORM];if(t===255&&i===0&&s===0&&n===65280)return _t[X.DXGI_FORMAT.DXGI_FORMAT_R8G8_UNORM];if(t===65535&&i===0&&s===0&&n===0)return _t[X.DXGI_FORMAT.DXGI_FORMAT_R16_UNORM];break;case 8:if(t===255&&i===0&&s===0&&n===0)return _t[X.DXGI_FORMAT.DXGI_FORMAT_R8_UNORM];break}throw new Error(`DDSParser does not support uncompressed texture with configuration:
|
|
2324
|
-
bitCount = ${e}, rBitMask = ${t}, gBitMask = ${i}, aBitMask = ${n}`)}var
|
|
2323
|
+
`,Da=null,cc=class{constructor(){Da||(Da=URL.createObjectURL(new Blob([EP],{type:"application/javascript"}))),this.worker=new Worker(Da);}};cc.revokeObjectURL=function(){Da&&(URL.revokeObjectURL(Da),Da=null);};var Fa={jsUrl:"https://cdn.jsdelivr.net/npm/pixi.js/transcoders/basis/basis_transcoder.js",wasmUrl:"https://cdn.jsdelivr.net/npm/pixi.js/transcoders/basis/basis_transcoder.wasm"};function WS(r){Object.assign(Fa,r);}var hc,XS={};function AP(r){return hc||(hc=new cc().worker,hc.onmessage=e=>{let{success:t,url:i,textureOptions:s}=e.data;t||console.warn("Failed to load Basis texture",i),XS[i](s);},hc.postMessage({type:"init",jsUrl:Fa.jsUrl,wasmUrl:Fa.wasmUrl,supportedTextures:r})),hc}function zm(r,e){let t=AP(e);return new Promise(i=>{XS[r]=i,t.postMessage({type:"load",url:r});})}var YS={extension:{type:m.LoadParser,priority:Te.High,name:"loadBasis"},name:"loadBasis",id:"basis",test(r){return we(r,[".basis"])},async load(r,e,t){let i=await Er(),s=await zm(r,i),n=new Xt(s);return ft(n,t,r)},unload(r){Array.isArray(r)?r.forEach(e=>e.destroy(true)):r.destroy(true);}};function $S(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 CP={"bc3-rgba-unorm":3,"bc7-rgba-unorm":6,"etc2-rgba8unorm":1,"astc-4x4-unorm":10,rgba8unorm:13,rgba4unorm:16};function jS(r){let e=CP[r];if(e)return e;throw new Error(`Unsupported transcoderFormat: ${r}`)}var wP={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},PP={DXGI_FORMAT:0,RESOURCE_DIMENSION:1,MISC_FLAG:2,ARRAY_SIZE:3,MISC_FLAGS2:4},Wm=(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))(Wm||{}),Xm=(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))(Xm||{});function je(r){return r.charCodeAt(0)+(r.charCodeAt(1)<<8)+(r.charCodeAt(2)<<16)+(r.charCodeAt(3)<<24)}var yt=(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=je("UYVY")]="UYVY",r[r.R8G8_B8G8=je("RGBG")]="R8G8_B8G8",r[r.YUY2=je("YUY2")]="YUY2",r[r.D3DFMT_G8R8_G8B8=je("GRGB")]="D3DFMT_G8R8_G8B8",r[r.DXT1=je("DXT1")]="DXT1",r[r.DXT2=je("DXT2")]="DXT2",r[r.DXT3=je("DXT3")]="DXT3",r[r.DXT4=je("DXT4")]="DXT4",r[r.DXT5=je("DXT5")]="DXT5",r[r.ATI1=je("ATI1")]="ATI1",r[r.AT1N=je("AT1N")]="AT1N",r[r.ATI2=je("ATI2")]="ATI2",r[r.AT2N=je("AT2N")]="AT2N",r[r.BC4U=je("BC4U")]="BC4U",r[r.BC4S=je("BC4S")]="BC4S",r[r.BC5U=je("BC5U")]="BC5U",r[r.BC5S=je("BC5S")]="BC5S",r[r.DX10=je("DX10")]="DX10",r))(yt||{}),dc={[yt.DXT1]:"bc1-rgba-unorm",[yt.DXT2]:"bc2-rgba-unorm",[yt.DXT3]:"bc2-rgba-unorm",[yt.DXT4]:"bc3-rgba-unorm",[yt.DXT5]:"bc3-rgba-unorm",[yt.ATI1]:"bc4-r-unorm",[yt.BC4U]:"bc4-r-unorm",[yt.BC4S]:"bc4-r-snorm",[yt.ATI2]:"bc5-rg-unorm",[yt.BC5U]:"bc5-rg-unorm",[yt.BC5S]:"bc5-rg-snorm",36:"rgba16uint",110:"rgba16sint",111:"r16float",112:"rg16float",113:"rgba16float",114:"r32float",115:"rg32float",116:"rgba32float"},pt={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"},X={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:wP,HEADER_DX10_FIELDS:PP,DXGI_FORMAT:Wm,D3D10_RESOURCE_DIMENSION:Xm,D3DFMT:yt},Ym={"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};Mt();S();function $m(r,e){let{format:t,fourCC:i,width:s,height:n,dataOffset:o,mipmapCount:a}=RP(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=BP(t,s,n,o,a,r);return {format:t,width:s,height:n,resource:u,alphaMode:"no-premultiply-alpha"}}function BP(r,e,t,i,s,n){let o=[],a=Ym[r],u=e,l=t,c=i;for(let h=0;h<s;++h){let d=Math.ceil(Math.max(4,u)/4)*4,f=Math.ceil(Math.max(4,l)/4)*4,g=a?d/4*f/4*a:u*l*4,_=new Uint8Array(n,c,g);o.push(_),c+=g,u=Math.max(u>>1,1),l=Math.max(l>>1,1);}return o}function RP(r){let e=new Uint32Array(r,0,X.HEADER_SIZE/Uint32Array.BYTES_PER_ELEMENT);if(e[X.HEADER_FIELDS.MAGIC]!==X.MAGIC_VALUE)throw new Error("Invalid magic number in DDS header");let t=e[X.HEADER_FIELDS.HEIGHT],i=e[X.HEADER_FIELDS.WIDTH],s=Math.max(1,e[X.HEADER_FIELDS.MIPMAP_COUNT]),n=e[X.HEADER_FIELDS.PF_FLAGS],o=e[X.HEADER_FIELDS.FOURCC],a=MP(e,n,o,r),u=X.MAGIC_SIZE+X.HEADER_SIZE+(o===X.D3DFMT.DX10?X.HEADER_DX10_SIZE:0);return {format:a,fourCC:o,width:i,height:t,dataOffset:u,mipmapCount:s}}function MP(r,e,t,i){if(e&X.PIXEL_FORMAT_FLAGS.FOURCC){if(t===X.D3DFMT.DX10){let s=new Uint32Array(i,X.MAGIC_SIZE+X.HEADER_SIZE,X.HEADER_DX10_SIZE/Uint32Array.BYTES_PER_ELEMENT);if(s[X.HEADER_DX10_FIELDS.MISC_FLAG]===X.RESOURCE_MISC_TEXTURECUBE)throw new Error("DDSParser does not support cubemap textures");if(s[X.HEADER_DX10_FIELDS.RESOURCE_DIMENSION]===X.D3D10_RESOURCE_DIMENSION.DDS_DIMENSION_TEXTURE3D)throw new Error("DDSParser does not supported 3D texture data");let a=s[X.HEADER_DX10_FIELDS.DXGI_FORMAT];if(a in pt)return pt[a];throw new Error(`DDSParser cannot parse texture data with DXGI format ${a}`)}if(t in dc)return dc[t];throw new Error(`DDSParser cannot parse texture data with fourCC format ${t}`)}if(e&X.PIXEL_FORMAT_FLAGS.RGB||e&X.PIXEL_FORMAT_FLAGS.RGBA)return DP(r);throw e&X.PIXEL_FORMAT_FLAGS.YUV?new Error("DDSParser does not supported YUV uncompressed texture data."):e&X.PIXEL_FORMAT_FLAGS.LUMINANCE||e&X.PIXEL_FORMAT_FLAGS.LUMINANCEA?new Error("DDSParser does not support single-channel (lumninance) texture data!"):e&X.PIXEL_FORMAT_FLAGS.ALPHA||e&X.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 DP(r){let e=r[X.HEADER_FIELDS.RGB_BITCOUNT],t=r[X.HEADER_FIELDS.R_BIT_MASK],i=r[X.HEADER_FIELDS.G_BIT_MASK],s=r[X.HEADER_FIELDS.B_BIT_MASK],n=r[X.HEADER_FIELDS.A_BIT_MASK];switch(e){case 32:if(t===255&&i===65280&&s===16711680&&n===4278190080)return pt[X.DXGI_FORMAT.DXGI_FORMAT_R8G8B8A8_UNORM];if(t===16711680&&i===65280&&s===255&&n===4278190080)return pt[X.DXGI_FORMAT.DXGI_FORMAT_B8G8R8A8_UNORM];if(t===1072693248&&i===1047552&&s===1023&&n===3221225472)return pt[X.DXGI_FORMAT.DXGI_FORMAT_R10G10B10A2_UNORM];if(t===65535&&i===4294901760&&s===0&&n===0)return pt[X.DXGI_FORMAT.DXGI_FORMAT_R16G16_UNORM];if(t===4294967295&&i===0&&s===0&&n===0)return pt[X.DXGI_FORMAT.DXGI_FORMAT_R32_FLOAT];break;case 24:break;case 16:if(t===31744&&i===992&&s===31&&n===32768)return pt[X.DXGI_FORMAT.DXGI_FORMAT_B5G5R5A1_UNORM];if(t===63488&&i===2016&&s===31&&n===0)return pt[X.DXGI_FORMAT.DXGI_FORMAT_B5G6R5_UNORM];if(t===3840&&i===240&&s===15&&n===61440)return pt[X.DXGI_FORMAT.DXGI_FORMAT_B4G4R4A4_UNORM];if(t===255&&i===0&&s===0&&n===65280)return pt[X.DXGI_FORMAT.DXGI_FORMAT_R8G8_UNORM];if(t===65535&&i===0&&s===0&&n===0)return pt[X.DXGI_FORMAT.DXGI_FORMAT_R16_UNORM];break;case 8:if(t===255&&i===0&&s===0&&n===0)return pt[X.DXGI_FORMAT.DXGI_FORMAT_R8_UNORM];break}throw new Error(`DDSParser does not support uncompressed texture with configuration:
|
|
2324
|
+
bitCount = ${e}, rBitMask = ${t}, gBitMask = ${i}, aBitMask = ${n}`)}var qS={extension:{type:m.LoadParser,priority:Te.High,name:"loadDDS"},name:"loadDDS",id:"dds",test(r){return we(r,[".dds"])},async load(r,e,t){let i=await Er(),n=await(await fetch(r)).arrayBuffer(),o=$m(n,i),a=new Xt(o);return ft(a,t,r)},unload(r){Array.isArray(r)?r.forEach(e=>e.destroy(true)):r.destroy(true);}};Mt();S();var cv=(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))(cv||{});var FP={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"},GP=[171,75,84,88,32,49,49,187,13,10,26,10],UP={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},IP=64,OP=67305985,kP={5121:1,5123:2,5124:4,5125:4,5126:4,36193:8},LP={6408:4,6407:3,33319:2,6403:1,6409:1,6410:2,6406:1},NP={32819:2,32820:2,33635:2},HP={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},Pe={FILE_HEADER_SIZE:IP,FILE_IDENTIFIER:GP,FORMATS_TO_COMPONENTS:LP,INTERNAL_FORMAT_TO_BYTES_PER_PIXEL:HP,INTERNAL_FORMAT_TO_TEXTURE_FORMATS:FP,FIELDS:UP,TYPES_TO_BYTES_PER_COMPONENT:kP,TYPES_TO_BYTES_PER_PIXEL:NP,ENDIANNESS:OP};function jm(r,e){let t=new DataView(r);if(!XP(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}=WP(t),h=Pe.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=zP(s,n,o),f=VP(t,s,d,a,u,c,l,i);return {format:h,width:a,height:u,resource:f,alphaMode:"no-premultiply-alpha"}}function VP(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,f=s,g=u,_=l,x=n,b=new Array(o);for(let y=0;y<o;y++){let v=r.getUint32(x,a),T=x+4;b[y]=new Uint8Array(r.buffer,T,h),T+=h,x+=v+4,x=x%4!==0?x+4-x%4:x,d=d>>1||1,f=f>>1||1,g=d+4-1&-4,_=f+4-1&-4,h=g*_*t;}return b}function zP(r,e,t){let i=Pe.INTERNAL_FORMAT_TO_BYTES_PER_PIXEL[t];if(r!==0&&(Pe.TYPES_TO_BYTES_PER_COMPONENT[r]?i=Pe.TYPES_TO_BYTES_PER_COMPONENT[r]*Pe.FORMATS_TO_COMPONENTS[e]:i=Pe.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 WP(r){let e=r.getUint32(Pe.FIELDS.ENDIANNESS,true)===Pe.ENDIANNESS,t=r.getUint32(Pe.FIELDS.GL_TYPE,e),i=r.getUint32(Pe.FIELDS.GL_FORMAT,e),s=r.getUint32(Pe.FIELDS.GL_INTERNAL_FORMAT,e),n=r.getUint32(Pe.FIELDS.PIXEL_WIDTH,e),o=r.getUint32(Pe.FIELDS.PIXEL_HEIGHT,e)||1,a=r.getUint32(Pe.FIELDS.PIXEL_DEPTH,e)||1,u=r.getUint32(Pe.FIELDS.NUMBER_OF_ARRAY_ELEMENTS,e)||1,l=r.getUint32(Pe.FIELDS.NUMBER_OF_FACES,e),c=r.getUint32(Pe.FIELDS.NUMBER_OF_MIPMAP_LEVELS,e),h=r.getUint32(Pe.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:Pe.FILE_HEADER_SIZE+h}}function XP(r){for(let e=0;e<Pe.FILE_IDENTIFIER.length;e++)if(r.getUint8(e)!==Pe.FILE_IDENTIFIER[e])return false;return true}var KS={extension:{type:m.LoadParser,priority:Te.High,name:"loadKTX"},name:"loadKTX",id:"ktx",test(r){return we(r,".ktx")},async load(r,e,t){let i=await Er(),n=await(await fetch(r)).arrayBuffer(),o=jm(n,i),a=new Xt(o);return ft(a,t,r)},unload(r){Array.isArray(r)?r.forEach(e=>e.destroy(true)):r.destroy(true);}};Mt();S();var YP=`(function () {
|
|
2325
2325
|
'use strict';
|
|
2326
2326
|
|
|
2327
2327
|
const converters = {
|
|
@@ -2573,7 +2573,7 @@ ${h}`);throw h instanceof Error&&h.stack&&(f.stack=h.stack),f}}};_S.defaultOptio
|
|
|
2573
2573
|
};
|
|
2574
2574
|
|
|
2575
2575
|
})();
|
|
2576
|
-
`,
|
|
2576
|
+
`,Ga=null,fc=class{constructor(){Ga||(Ga=URL.createObjectURL(new Blob([YP],{type:"application/javascript"}))),this.worker=new Worker(Ga);}};fc.revokeObjectURL=function(){Ga&&(URL.revokeObjectURL(Ga),Ga=null);};var Ua={jsUrl:"https://cdn.jsdelivr.net/npm/pixi.js/transcoders/ktx/libktx.js",wasmUrl:"https://cdn.jsdelivr.net/npm/pixi.js/transcoders/ktx/libktx.wasm"};function ZS(r){Object.assign(Ua,r);}var pc,QS={},JS={};function $P(r){return pc||(pc=new fc().worker,pc.onmessage=e=>{let{err:t,success:i,url:s,textureOptions:n}=e.data;if(t){JS[s](t);return}i||console.warn("Failed to load KTX texture",s),QS[s](n);},pc.postMessage({type:"init",jsUrl:Ua.jsUrl,wasmUrl:Ua.wasmUrl,supportedTextures:r})),pc}function qm(r,e){let t=$P(e);return new Promise((i,s)=>{QS[r]=i,JS[r]=s,t.postMessage({type:"load",url:r});})}var eE={extension:{type:m.LoadParser,priority:Te.High,name:"loadKTX2"},name:"loadKTX2",id:"ktx2",test(r){return we(r,".ktx2")},async load(r,e,t){let i=await Er(),s=await qm(r,i),n=new Xt(s);return ft(n,t,r)},async unload(r){Array.isArray(r)?r.forEach(e=>e.destroy(true)):r.destroy(true);}};var hv={rgb8unorm:{convertedFormat:"rgba8unorm",convertFunction:tE},"rgb8unorm-srgb":{convertedFormat:"rgba8unorm-srgb",convertFunction:tE}};function rE(r){let e=r.format;if(hv[e]){let t=hv[e].convertFunction,i=r.resource;for(let s=0;s<i.length;s++)i[s]=t(i[s]);r.format=hv[e].convertedFormat;}}function tE(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)}function iE(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 jP={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 Km(r){let e=jP[r];if(e)return e;throw new Error(`Unsupported glInternalFormat: ${r}`)}var qP={23:"rgb8unorm",37:"rgba8unorm",43:"rgba8unorm-srgb"};function Zm(r){let e=qP[r];if(e)return e;throw new Error(`Unsupported VkFormat: ${r}`)}function sE(r){return r.classId===2?Zm(r.vkFormat):Km(r.glInternalformat)}var KP={"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"};function nE(r){let e=KP[r];if(e)return e;throw new Error(`Unsupported transcoderFormat: ${r}`)}S();fi();S();var Ia=["basis","bc7","bc6h","astc","etc2","bc5","bc4","bc3","bc2","bc1","eac"],oE={extension:m.ResolveParser,test:r=>we(r,[".ktx",".ktx2",".dds"]),parse:r=>{let e,t=r.split(".");if(t.length>2){let i=t[t.length-2];Ia.includes(i)&&(e=i);}else e=t[t.length-1];return {resolution:parseFloat(rt.RETINA_PREFIX.exec(r)?.[1]??"1"),format:e,src:r}}};var Qm,aE={extension:{type:m.DetectionParser,priority:2},test:async()=>!!(await vr()||yr()),add:async r=>{let e=await Ma();return Qm=ZP(e),[...Qm,...r]},remove:async r=>Qm?r.filter(e=>!(e in Qm)):r};function ZP(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=Ia.indexOf(i),o=Ia.indexOf(s);return n===-1?1:o===-1?-1:n-o}),e}Ze();us();var QP=new oe,dv=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??hr(e,i,QP);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);}};dv.shared=new dv;var Jm=dv;S();var mc=class{static init(e){this._renderRef=this.render.bind(this),this.render=()=>{let t=e?.culler?.updateTransform!==true;Jm.shared.cull(this.stage,this.renderer.screen,t),this.renderer.render({container:this.stage});};}static destroy(){this.render=this._renderRef;}};mc.extension={priority:10,type:m.Application,name:"culler"};var rA=Wg(tA()),iA={createCanvas:(r,e)=>new OffscreenCanvas(r??0,e??0),createImage:()=>new Image,getCanvasRenderingContext2D:()=>OffscreenCanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>globalThis.location.href,getFontFaceSet:()=>globalThis.fonts,fetch:(r,e)=>fetch(r,e),parseXML:r=>new rA.DOMParser().parseFromString(r,"text/xml")};_t();St();Oe();lr();Ko();var cg=`
|
|
2577
2577
|
in vec2 vTextureCoord;
|
|
2578
2578
|
|
|
2579
2579
|
out vec4 finalColor;
|
|
@@ -2585,7 +2585,7 @@ void main()
|
|
|
2585
2585
|
{
|
|
2586
2586
|
finalColor = texture(uTexture, vTextureCoord) * uAlpha;
|
|
2587
2587
|
}
|
|
2588
|
-
`;var
|
|
2588
|
+
`;var Bc=`struct GlobalFilterUniforms {
|
|
2589
2589
|
uInputSize:vec4<f32>,
|
|
2590
2590
|
uInputPixel:vec4<f32>,
|
|
2591
2591
|
uInputClamp:vec4<f32>,
|
|
@@ -2653,9 +2653,9 @@ fn mainFragment(
|
|
|
2653
2653
|
var sample = textureSample(uTexture, uSampler, uv);
|
|
2654
2654
|
|
|
2655
2655
|
return sample * alphaUniforms.uAlpha;
|
|
2656
|
-
}`;var
|
|
2657
|
-
`);function
|
|
2658
|
-
`;}return i=i.replace("%blur%",s),i=i.replace("%size%",r.toString()),i}var
|
|
2656
|
+
}`;var sA=class nA extends Ve{constructor(e){e={...nA.defaultOptions,...e};let t=_e.from({vertex:{source:Bc,entryPoint:"mainVertex"},fragment:{source:Bc,entryPoint:"mainFragment"}}),i=xe.from({vertex:_r,fragment:cg,name:"alpha-filter"}),{alpha:s,...n}=e,o=new J({uAlpha:{value:s,type:"f32"}});super({...n,gpuProgram:t,glProgram:i,resources:{alphaUniforms:o}});}get alpha(){return this.resources.alphaUniforms.uniforms.uAlpha}set alpha(e){this.resources.alphaUniforms.uniforms.uAlpha=e;}};sA.defaultOptions={alpha:1};var oA=sA;Zt();Dt();re();lr();Zt();Dt();lr();_t();var Ya={5:[.153388,.221461,.250301],7:[.071303,.131514,.189879,.214607],9:[.028532,.067234,.124009,.179044,.20236],11:[.0093,.028002,.065984,.121703,.175713,.198596],13:[.002406,.009255,.027867,.065666,.121117,.174868,.197641],15:[489e-6,.002403,.009246,.02784,.065602,.120999,.174697,.197448]};var wB=["in vec2 vBlurTexCoords[%size%];","uniform sampler2D uTexture;","out vec4 finalColor;","void main(void)","{"," finalColor = vec4(0.0);"," %blur%","}"].join(`
|
|
2657
|
+
`);function hg(r){let e=Ya[r],t=e.length,i=wB,s="",n="finalColor += texture(uTexture, vBlurTexCoords[%index%]) * %value%;",o;for(let a=0;a<r;a++){let u=n.replace("%index%",a.toString());o=a,a>=t&&(o=r-a-1),u=u.replace("%value%",e[o].toString()),s+=u,s+=`
|
|
2658
|
+
`;}return i=i.replace("%blur%",s),i=i.replace("%size%",r.toString()),i}var PB=`
|
|
2659
2659
|
in vec2 aPosition;
|
|
2660
2660
|
|
|
2661
2661
|
uniform float uStrength;
|
|
@@ -2689,8 +2689,8 @@ fn mainFragment(
|
|
|
2689
2689
|
|
|
2690
2690
|
vec2 textureCoord = filterTextureCoord();
|
|
2691
2691
|
%blur%
|
|
2692
|
-
}`;function
|
|
2693
|
-
`;}return i=i.replace("%blur%",s),i=i.replace("%size%",r.toString()),i=i.replace("%dimension%",e?"z":"w"),i}function
|
|
2692
|
+
}`;function dg(r,e){let t=Math.ceil(r/2),i=PB,s="",n;e?n="vBlurTexCoords[%index%] = textureCoord + vec2(%sampleIndex% * pixelStrength, 0.0);":n="vBlurTexCoords[%index%] = textureCoord + vec2(0.0, %sampleIndex% * pixelStrength);";for(let o=0;o<r;o++){let a=n.replace("%index%",o.toString());a=a.replace("%sampleIndex%",`${o-(t-1)}.0`),s+=a,s+=`
|
|
2693
|
+
`;}return i=i.replace("%blur%",s),i=i.replace("%size%",r.toString()),i=i.replace("%dimension%",e?"z":"w"),i}function fg(r,e){let t=dg(e,r),i=hg(e);return xe.from({vertex:t,fragment:i,name:`blur-${r?"horizontal":"vertical"}-pass-filter`})}St();var pg=`
|
|
2694
2694
|
|
|
2695
2695
|
struct GlobalFilterUniforms {
|
|
2696
2696
|
uInputSize:vec4<f32>,
|
|
@@ -2769,10 +2769,10 @@ fn mainFragment(
|
|
|
2769
2769
|
%blur-sampling%
|
|
2770
2770
|
|
|
2771
2771
|
return finalColor;
|
|
2772
|
-
}`;function
|
|
2772
|
+
}`;function mg(r,e){let t=Ya[e],i=t.length,s=[],n=[],o=[];for(let h=0;h<e;h++){s[h]=`@location(${h}) offset${h}: vec2<f32>,`,r?n[h]=`filteredCord + vec2(${h-i+1} * pixelStrength, 0.0),`:n[h]=`filteredCord + vec2(0.0, ${h-i+1} * pixelStrength),`;let d=h<i?h:e-h-1,f=t[d].toString();o[h]=`finalColor += textureSample(uTexture, uSampler, offset${h}) * ${f};`;}let a=s.join(`
|
|
2773
2773
|
`),u=n.join(`
|
|
2774
2774
|
`),l=o.join(`
|
|
2775
|
-
`),c=
|
|
2775
|
+
`),c=pg.replace("%blur-struct%",a).replace("%blur-vertex-out%",u).replace("%blur-fragment-in%",a).replace("%blur-sampling%",l).replace("%dimension%",r?"z":"w");return _e.from({vertex:{source:c,entryPoint:"mainVertex"},fragment:{source:c,entryPoint:"mainFragment"}})}var aA=class uA extends Ve{constructor(e){e={...uA.defaultOptions,...e};let t=fg(e.horizontal,e.kernelSize),i=mg(e.horizontal,e.kernelSize);super({glProgram:t,gpuProgram:i,resources:{blurUniforms:{uStrength:{value:0,type:"f32"}}},...e}),this.horizontal=e.horizontal,this._quality=0,this.quality=e.quality,this.blur=e.strength,this._uniforms=this.resources.blurUniforms.uniforms;}apply(e,t,i,s){if(this._uniforms.uStrength=this.strength/this.passes,this.passes===1)e.applyFilter(this,t,i,s);else {let n=le.getSameSizeTexture(t),o=t,a=n;this._state.blend=false;let u=e.renderer.type===ye.WEBGPU;for(let l=0;l<this.passes-1;l++){e.applyFilter(this,o,a,l===0?true:u);let c=a;a=o,o=c;}this._state.blend=true,e.applyFilter(this,o,i,s),le.returnTexture(n);}}get blur(){return this.strength}set blur(e){this.padding=1+Math.abs(e)*2,this.strength=e;}get quality(){return this._quality}set quality(e){this._quality=e,this.passes=e;}};aA.defaultOptions={strength:8,quality:4,kernelSize:5};var $a=aA;var Rc=class extends Ve{constructor(...e){let t=e[0]??{};typeof t=="number"&&(w(O,"BlurFilter constructor params are now options object. See params: { strength, quality, resolution, kernelSize }"),t={strength:t},e[1]!==void 0&&(t.quality=e[1]),e[2]!==void 0&&(t.resolution=e[2]||"inherit"),e[3]!==void 0&&(t.kernelSize=e[3])),t={...$a.defaultOptions,...t};let{strength:i,strengthX:s,strengthY:n,quality:o,...a}=t;super({...a,compatibleRenderers:ye.BOTH,resources:{}}),this._repeatEdgePixels=false,this.blurXFilter=new $a({horizontal:true,...t}),this.blurYFilter=new $a({horizontal:false,...t}),this.quality=o,this.strengthX=s??i,this.strengthY=n??i,this.repeatEdgePixels=false;}apply(e,t,i,s){let n=Math.abs(this.blurXFilter.strength),o=Math.abs(this.blurYFilter.strength);if(n&&o){let a=le.getSameSizeTexture(t);this.blurXFilter.blendMode="normal",this.blurXFilter.apply(e,t,a,true),this.blurYFilter.blendMode=this.blendMode,this.blurYFilter.apply(e,a,i,s),le.returnTexture(a);}else o?(this.blurYFilter.blendMode=this.blendMode,this.blurYFilter.apply(e,t,i,s)):(this.blurXFilter.blendMode=this.blendMode,this.blurXFilter.apply(e,t,i,s));}updatePadding(){this._repeatEdgePixels?this.padding=0:this.padding=Math.max(Math.abs(this.blurXFilter.blur),Math.abs(this.blurYFilter.blur))*2;}get strength(){if(this.strengthX!==this.strengthY)throw new Error("BlurFilter's strengthX and strengthY are different");return this.strengthX}set strength(e){this.blurXFilter.blur=this.blurYFilter.blur=e,this.updatePadding();}get quality(){return this.blurXFilter.quality}set quality(e){this.blurXFilter.quality=this.blurYFilter.quality=e;}get strengthX(){return this.blurXFilter.blur}set strengthX(e){this.blurXFilter.blur=e,this.updatePadding();}get strengthY(){return this.blurYFilter.blur}set strengthY(e){this.blurYFilter.blur=e,this.updatePadding();}get blur(){return w("8.3.0","BlurFilter.blur is deprecated, please use BlurFilter.strength instead."),this.strength}set blur(e){w("8.3.0","BlurFilter.blur is deprecated, please use BlurFilter.strength instead."),this.strength=e;}get blurX(){return w("8.3.0","BlurFilter.blurX is deprecated, please use BlurFilter.strengthX instead."),this.strengthX}set blurX(e){w("8.3.0","BlurFilter.blurX is deprecated, please use BlurFilter.strengthX instead."),this.strengthX=e;}get blurY(){return w("8.3.0","BlurFilter.blurY is deprecated, please use BlurFilter.strengthY instead."),this.strengthY}set blurY(e){w("8.3.0","BlurFilter.blurY is deprecated, please use BlurFilter.strengthY instead."),this.strengthY=e;}get repeatEdgePixels(){return this._repeatEdgePixels}set repeatEdgePixels(e){this._repeatEdgePixels=e,this.updatePadding();}};Rc.defaultOptions={strength:8,quality:4,kernelSize:5};Ne();_t();St();Oe();lr();Ko();var gg=`
|
|
2776
2776
|
in vec2 vTextureCoord;
|
|
2777
2777
|
in vec4 vColor;
|
|
2778
2778
|
|
|
@@ -2836,7 +2836,7 @@ void main()
|
|
|
2836
2836
|
|
|
2837
2837
|
finalColor = vec4(rgb, result.a);
|
|
2838
2838
|
}
|
|
2839
|
-
`;var
|
|
2839
|
+
`;var Mc=`struct GlobalFilterUniforms {
|
|
2840
2840
|
uInputSize:vec4<f32>,
|
|
2841
2841
|
uInputPixel:vec4<f32>,
|
|
2842
2842
|
uInputClamp:vec4<f32>,
|
|
@@ -2944,7 +2944,7 @@ fn mainFragment(
|
|
|
2944
2944
|
rgb.b *= result.a;
|
|
2945
2945
|
|
|
2946
2946
|
return vec4(rgb, result.a);
|
|
2947
|
-
}`;var
|
|
2947
|
+
}`;var xg=class extends Ve{constructor(e={}){let t=new J({uColorMatrix:{value:[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],type:"f32",size:20},uAlpha:{value:1,type:"f32"}}),i=_e.from({vertex:{source:Mc,entryPoint:"mainVertex"},fragment:{source:Mc,entryPoint:"mainFragment"}}),s=xe.from({vertex:_r,fragment:gg,name:"color-matrix-filter"});super({...e,gpuProgram:i,glProgram:s,resources:{colorMatrixUniforms:t}}),this.alpha=1;}_loadMatrix(e,t=false){let i=e;t&&(this._multiply(i,this.matrix,e),i=this._colorMatrix(i)),this.resources.colorMatrixUniforms.uniforms.uColorMatrix=i,this.resources.colorMatrixUniforms.update();}_multiply(e,t,i){return e[0]=t[0]*i[0]+t[1]*i[5]+t[2]*i[10]+t[3]*i[15],e[1]=t[0]*i[1]+t[1]*i[6]+t[2]*i[11]+t[3]*i[16],e[2]=t[0]*i[2]+t[1]*i[7]+t[2]*i[12]+t[3]*i[17],e[3]=t[0]*i[3]+t[1]*i[8]+t[2]*i[13]+t[3]*i[18],e[4]=t[0]*i[4]+t[1]*i[9]+t[2]*i[14]+t[3]*i[19]+t[4],e[5]=t[5]*i[0]+t[6]*i[5]+t[7]*i[10]+t[8]*i[15],e[6]=t[5]*i[1]+t[6]*i[6]+t[7]*i[11]+t[8]*i[16],e[7]=t[5]*i[2]+t[6]*i[7]+t[7]*i[12]+t[8]*i[17],e[8]=t[5]*i[3]+t[6]*i[8]+t[7]*i[13]+t[8]*i[18],e[9]=t[5]*i[4]+t[6]*i[9]+t[7]*i[14]+t[8]*i[19]+t[9],e[10]=t[10]*i[0]+t[11]*i[5]+t[12]*i[10]+t[13]*i[15],e[11]=t[10]*i[1]+t[11]*i[6]+t[12]*i[11]+t[13]*i[16],e[12]=t[10]*i[2]+t[11]*i[7]+t[12]*i[12]+t[13]*i[17],e[13]=t[10]*i[3]+t[11]*i[8]+t[12]*i[13]+t[13]*i[18],e[14]=t[10]*i[4]+t[11]*i[9]+t[12]*i[14]+t[13]*i[19]+t[14],e[15]=t[15]*i[0]+t[16]*i[5]+t[17]*i[10]+t[18]*i[15],e[16]=t[15]*i[1]+t[16]*i[6]+t[17]*i[11]+t[18]*i[16],e[17]=t[15]*i[2]+t[16]*i[7]+t[17]*i[12]+t[18]*i[17],e[18]=t[15]*i[3]+t[16]*i[8]+t[17]*i[13]+t[18]*i[18],e[19]=t[15]*i[4]+t[16]*i[9]+t[17]*i[14]+t[18]*i[19]+t[19],e}_colorMatrix(e){let t=new Float32Array(e);return t[4]/=255,t[9]/=255,t[14]/=255,t[19]/=255,t}brightness(e,t){let i=[e,0,0,0,0,0,e,0,0,0,0,0,e,0,0,0,0,0,1,0];this._loadMatrix(i,t);}tint(e,t){let[i,s,n]=H.shared.setValue(e).toArray(),o=[i,0,0,0,0,0,s,0,0,0,0,0,n,0,0,0,0,0,1,0];this._loadMatrix(o,t);}greyscale(e,t){let i=[e,e,e,0,0,e,e,e,0,0,e,e,e,0,0,0,0,0,1,0];this._loadMatrix(i,t);}grayscale(e,t){this.greyscale(e,t);}blackAndWhite(e){let t=[.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0];this._loadMatrix(t,e);}hue(e,t){e=(e||0)/180*Math.PI;let i=Math.cos(e),s=Math.sin(e),n=Math.sqrt,o=1/3,a=n(o),u=i+(1-i)*o,l=o*(1-i)-a*s,c=o*(1-i)+a*s,h=o*(1-i)+a*s,d=i+o*(1-i),f=o*(1-i)-a*s,g=o*(1-i)-a*s,_=o*(1-i)+a*s,x=i+o*(1-i),b=[u,l,c,0,0,h,d,f,0,0,g,_,x,0,0,0,0,0,1,0];this._loadMatrix(b,t);}contrast(e,t){let i=(e||0)+1,s=-0.5*(i-1),n=[i,0,0,0,s,0,i,0,0,s,0,0,i,0,s,0,0,0,1,0];this._loadMatrix(n,t);}saturate(e=0,t){let i=e*2/3+1,s=(i-1)*-0.5,n=[i,s,s,0,0,s,i,s,0,0,s,s,i,0,0,0,0,0,1,0];this._loadMatrix(n,t);}desaturate(){this.saturate(-1);}negative(e){let t=[-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0];this._loadMatrix(t,e);}sepia(e){let t=[.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0];this._loadMatrix(t,e);}technicolor(e){let t=[1.9125277891456083,-0.8545344976951645,-0.09155508482755585,0,11.793603434377337,-0.3087833385928097,1.7658908555458428,-0.10601743074722245,0,-70.35205161461398,-0.231103377548616,-0.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0];this._loadMatrix(t,e);}polaroid(e){let t=[1.438,-0.062,-0.062,0,0,-0.122,1.378,-0.122,0,0,-0.016,-0.016,1.483,0,0,0,0,0,1,0];this._loadMatrix(t,e);}toBGR(e){let t=[0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0];this._loadMatrix(t,e);}kodachrome(e){let t=[1.1285582396593525,-0.3967382283601348,-0.03992559172921793,0,63.72958762196502,-0.16404339962244616,1.0835251566291304,-0.05498805115633132,0,24.732407896706203,-0.16786010706155763,-0.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0];this._loadMatrix(t,e);}browni(e){let t=[.5997023498159715,.34553243048391263,-0.2708298674538042,0,47.43192855600873,-0.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-0.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0];this._loadMatrix(t,e);}vintage(e){let t=[.6279345635605994,.3202183420819367,-0.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-0.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0];this._loadMatrix(t,e);}colorTone(e,t,i,s,n){e||(e=.2),t||(t=.15),i||(i=16770432),s||(s=3375104);let o=H.shared,[a,u,l]=o.setValue(i).toArray(),[c,h,d]=o.setValue(s).toArray(),f=[.3,.59,.11,0,0,a,u,l,e,0,c,h,d,t,0,a-c,u-h,l-d,0,0];this._loadMatrix(f,n);}night(e,t){e||(e=.1);let i=[e*-2,-e,0,0,0,-e,0,e,0,0,0,e,e*2,0,0,0,0,0,1,0];this._loadMatrix(i,t);}predator(e,t){let i=[11.224130630493164*e,-4.794486999511719*e,-2.8746118545532227*e,0*e,.40342438220977783*e,-3.6330697536468506*e,9.193157196044922*e,-2.951810836791992*e,0*e,-1.316135048866272*e,-3.2184197902679443*e,-4.2375030517578125*e,7.476448059082031*e,0*e,.8044459223747253*e,0,0,0,1,0];this._loadMatrix(i,t);}lsd(e){let t=[2,-0.4,.5,0,0,-0.5,2,-0.4,0,0,-0.4,-0.5,3,0,0,0,0,0,1,0];this._loadMatrix(t,e);}reset(){let e=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0];this._loadMatrix(e,false);}get matrix(){return this.resources.colorMatrixUniforms.uniforms.uColorMatrix}set matrix(e){this.resources.colorMatrixUniforms.uniforms.uColorMatrix=e;}get alpha(){return this.resources.colorMatrixUniforms.uniforms.uAlpha}set alpha(e){this.resources.colorMatrixUniforms.uniforms.uAlpha=e;}};K();vt();_t();St();Oe();pi();re();lr();var _g=`
|
|
2948
2948
|
in vec2 vTextureCoord;
|
|
2949
2949
|
in vec2 vFilterUv;
|
|
2950
2950
|
|
|
@@ -2966,7 +2966,7 @@ void main()
|
|
|
2966
2966
|
|
|
2967
2967
|
finalColor = texture(uTexture, clamp(vTextureCoord + offset, uInputClamp.xy, uInputClamp.zw));
|
|
2968
2968
|
}
|
|
2969
|
-
`;var
|
|
2969
|
+
`;var bg=`in vec2 aPosition;
|
|
2970
2970
|
out vec2 vTextureCoord;
|
|
2971
2971
|
out vec2 vFilterUv;
|
|
2972
2972
|
|
|
@@ -3004,7 +3004,7 @@ void main(void)
|
|
|
3004
3004
|
vTextureCoord = filterTextureCoord();
|
|
3005
3005
|
vFilterUv = getFilterCoord();
|
|
3006
3006
|
}
|
|
3007
|
-
`;var
|
|
3007
|
+
`;var Dc=`
|
|
3008
3008
|
struct GlobalFilterUniforms {
|
|
3009
3009
|
uInputSize:vec4<f32>,
|
|
3010
3010
|
uInputPixel:vec4<f32>,
|
|
@@ -3091,7 +3091,7 @@ fn mainFragment(
|
|
|
3091
3091
|
var offset = gfu.uInputSize.zw * (filterUniforms.uRotation * (map.xy - 0.5)) * filterUniforms.uScale;
|
|
3092
3092
|
|
|
3093
3093
|
return textureSample(uTexture, uSampler, clamp(uv + offset, gfu.uInputClamp.xy, gfu.uInputClamp.zw));
|
|
3094
|
-
}`;var
|
|
3094
|
+
}`;var yg=class extends Ve{constructor(...e){let t=e[0];t instanceof it&&(e[1]&&w(O,"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 q(o,o));let a=new J({uFilterMatrix:{value:new P,type:"mat3x3<f32>"},uScale:{value:o,type:"vec2<f32>"},uRotation:{value:new Float32Array([0,0,0,0]),type:"mat2x2<f32>"}}),u=xe.from({vertex:bg,fragment:_g,name:"displacement-filter"}),l=_e.from({vertex:{source:Dc,entryPoint:"mainVertex"},fragment:{source:Dc,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}};_t();St();Oe();lr();Ko();var vg=`
|
|
3095
3095
|
in vec2 vTextureCoord;
|
|
3096
3096
|
in vec4 vColor;
|
|
3097
3097
|
|
|
@@ -3126,7 +3126,7 @@ void main()
|
|
|
3126
3126
|
|
|
3127
3127
|
finalColor = color;
|
|
3128
3128
|
}
|
|
3129
|
-
`;var
|
|
3129
|
+
`;var Fc=`
|
|
3130
3130
|
|
|
3131
3131
|
struct GlobalFilterUniforms {
|
|
3132
3132
|
uInputSize:vec4<f32>,
|
|
@@ -3225,7 +3225,7 @@ fn mainFragment(
|
|
|
3225
3225
|
sample.b *= sample.a;
|
|
3226
3226
|
|
|
3227
3227
|
return sample;
|
|
3228
|
-
}`;var
|
|
3228
|
+
}`;var lA=class cA extends Ve{constructor(e={}){e={...cA.defaultOptions,...e};let t=_e.from({vertex:{source:Fc,entryPoint:"mainVertex"},fragment:{source:Fc,entryPoint:"mainFragment"}}),i=xe.from({vertex:_r,fragment:vg,name:"noise-filter"}),{noise:s,seed:n,...o}=e;super({...o,gpuProgram:t,glProgram:i,resources:{noiseUniforms:new J({uNoise:{value:1,type:"f32"},uSeed:{value:1,type:"f32"}})}}),this.noise=s,this.seed=n??Math.random();}get noise(){return this.resources.noiseUniforms.uniforms.uNoise}set noise(e){this.resources.noiseUniforms.uniforms.uNoise=e;}get seed(){return this.resources.noiseUniforms.uniforms.uSeed}set seed(e){this.resources.noiseUniforms.uniforms.uSeed=e;}};lA.defaultOptions={noise:.5};var hA=lA;var dA=`fn getLuminosity(c: vec3<f32>) -> f32 {
|
|
3229
3229
|
return 0.3 * c.r + 0.59 * c.g + 0.11 * c.b;
|
|
3230
3230
|
}
|
|
3231
3231
|
|
|
@@ -3296,11 +3296,11 @@ fn setSaturation(c: vec3<f32>, s: f32) -> vec3<f32> {
|
|
|
3296
3296
|
}
|
|
3297
3297
|
|
|
3298
3298
|
return result;
|
|
3299
|
-
}`;Ze();Qr();yr();var FE=class GE{constructor(e){this._tick=()=>{this._destroyed||(this.timeout=setTimeout(this._processQueue,0));},this._processQueue=()=>{if(this._destroyed)return;let{queue:t}=this,i=0;for(;t.length&&i<GE.uploadsPerFrame;){let s=t.shift();this.uploadQueueItem(s),i++;}t.length?be.system.addOnce(this._tick,this,et.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 Q?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(),be.system.addOnce(this._tick,this,et.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;}destroy(){this._destroyed=true,clearTimeout(this.timeout);}_resolve(){let{resolves:e}=this,t=e.slice(0);e.length=0;for(let i of t)i();}};FE.uploadsPerFrame=4;var Z2=FE;He();ee();Ze();Oc();ts();w_();ni();Rt();ee();re();Ht();Rr();var Dt=class extends Ue{constructor(...e){let t=e[0];t instanceof lt&&(w(O,"Mesh: use new Mesh({ geometry, shader }) instead"),t={geometry:t,shader:e[1]},e[3]&&(w(O,"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??C.WHITE,this.state=a??Se.for2d(),this._geometry=i,this._geometry.on("update",this.onViewUpdate,this),this.roundPixels=o??false;}get material(){return w(O,"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=C.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 gt?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(Kc(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(Kc(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;}};ri();ee();Qr();yr();ri();var el=class r extends st{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,[f]=c;super({...d,texture:f instanceof C?f:f.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&&(be.shared.remove(this.update,this),this._isConnectedToTicker=false));}play(){this._playing||(this._playing=true,this._autoUpdate&&!this._isConnectedToTicker&&(be.shared.add(this.update,this,et.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(e=false){if(typeof e=="boolean"?e:e?.texture){let i=typeof e=="boolean"?e:e?.textureSource;this._textures.forEach(s=>{this.texture!==s&&s.destroy(i);});}this._textures=[],this._durations=null,this.stop(),super.destroy(e),this.onComplete=null,this.onFrameChange=null,this.onLoop=null;}static fromFrames(e){let t=[];for(let i=0;i<e.length;++i)t.push(C.from(e[i]));return new r(t)}static fromImages(e){let t=[];for(let i=0;i<e.length;++i)t.push(C.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 C)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?(be.shared.remove(this.update,this),this._isConnectedToTicker=false):this._autoUpdate&&!this._isConnectedToTicker&&this._playing&&(be.shared.add(this.update,this),this._isConnectedToTicker=true));}};nr();Xr();ee();re();K();Xr();var tl=class{constructor({matrix:e,observer:t}={}){this.dirty=true,this._matrix=e??new P,this.observer=t,this.position=new he(this,0,0),this.scale=new he(this,1,1),this.pivot=new he(this,0,0),this.skew=new he(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));}};Ht();var UE=class Nd extends Ue{constructor(...e){let t=e[0]||{};t instanceof C&&(t={texture:t}),e.length>1&&(w(O,"use new TilingSprite({ texture, width:100, height:100 }) instead"),t.width=e[1],t.height=e[2]),t={...Nd.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 he({_onUpdate:()=>{this.onViewUpdate();}}),this.applyAnchorToTexture=c,this.texture=i,this._width=u??i.width,this._height=l??i.height,this._tileTransform=new tl({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 Nd({texture:te.get(e),...t}):new Nd({texture:e,...t})}get uvRespectAnchor(){return w(O,"uvRespectAnchor is deprecated, please use applyAnchorToTexture instead"),this.applyAnchorToTexture}set uvRespectAnchor(e){w(O,"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=C.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;}};UE.defaultOptions={texture:C.EMPTY,anchor:{x:0,y:0},tilePosition:{x:0,y:0},tileScale:{x:1,y:1},tileRotation:0,applyAnchorToTexture:false};var Q2=UE;ir();Xr();re();Ht();var Hr=class extends Ue{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 he({_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;}get styleKey(){return `${this._text}:${this._style.styleKey}:${this._resolution}`}};function Es(r,e){let t=r[0]??{};return (typeof t=="string"||r[1])&&(w(O,`use new ${e}({ text: "hi!", style }) instead`),t={text:t,style:r[1]}),t}Ic();Br();Kt();var Vr=class extends Hr{constructor(...e){let t=Es(e,"Text");super(t,Re),this.renderPipeId="text",t.textureStyle&&(this.textureStyle=t.textureStyle instanceof Ge?t.textureStyle:new Ge(t.textureStyle));}updateBounds(){let e=this._bounds,t=this._anchor,i=0,s=0;if(this._style.trim){let{frame:n,canvasAndContext:o}=ci.getCanvasAndContext({text:this.text,style:this._style,resolution:1});ci.returnCanvasAndContext(o),i=n.width,s=n.height;}else {let n=we.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 rl=class extends Z2{resolveQueueItem(e,t){return e instanceof Q?this.resolveContainerQueueItem(e,t):e instanceof Z||e instanceof C?t.push(e.source):e instanceof Ne&&t.push(e),null}resolveContainerQueueItem(e,t){e instanceof st||e instanceof Q2||e instanceof Dt?t.push(e.texture.source):e instanceof Vr?t.push(e):e instanceof ns?t.push(e.context):e instanceof el&&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}};S();He();ts();se();Kt();ln();var As=class extends Hr{constructor(...e){var t;let i=Es(e,"BitmapText");i.style??(i.style=i.style||{}),(t=i.style).fill??(t.fill=16777215),super(i,Re),this.renderPipeId="bitmapText";}_onTouch(e){this._gcLastUsed=e;for(let t in this._gpuData)this._gpuData[t]?._onTouch(e);}updateBounds(){let e=this._bounds,t=this._anchor,i=dr.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&&M("[BitmapText] dynamically updating the resolution is not supported. Resolution should be managed by the BitmapFont.");}get resolution(){return this._resolution}};ir();se();Kt();ke();function J2(r){let e=r._stroke,t=r._fill,s=[`div { ${[`color: ${H.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?[LE(e)]:[],...r.dropShadow?[kE(r.dropShadow)]:[],...r.cssOverrides].join(";")} }`];return sB(r.tagStyles,s),s.join(" ")}function kE(r){let e=H.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 LE(r){return [`-webkit-text-stroke-width: ${r.width}px`,`-webkit-text-stroke-color: ${H.shared.setValue(r.color).toHex()}`,`text-stroke-width: ${r.width}px`,`text-stroke-color: ${H.shared.setValue(r.color).toHex()}`,"paint-order: stroke"].join(";")}var IE={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"},OE={fill:r=>`color: ${H.shared.setValue(r).toHex()}`,breakWords:r=>`word-wrap: ${r?"break-all":"break-word"}`,stroke:LE,dropShadow:kE};function sB(r,e){for(let t in r){let i=r[t],s=[];for(let n in i)OE[n]?s.push(OE[n](i[n])):IE[n]&&s.push(IE[n].replace("{{VALUE}}",i[n]));e.push(`${t} { ${s.join(";")} }`);}}var il=class r extends Re{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=J2(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"&&M("[HTMLTextStyle] only color fill is not supported by HTMLText"),super.fill=e;}set stroke(e){e&&typeof e!="string"&&typeof e!="number"&&M("[HTMLTextStyle] only color stroke is not supported by HTMLText"),super.stroke=e;}};Wc();var sl=class extends Hr{constructor(...e){let t=Es(e,"HtmlText");super(t,il),this.renderPipeId="htmlText",t.textureStyle&&(this.textureStyle=t.textureStyle instanceof Ge?t.textureStyle:new Ge(t.textureStyle));}updateBounds(){let e=this._bounds,t=this._anchor,i=ja(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;}get text(){return this._text}set text(e){let t=this._sanitiseText(e.toString());super.text=t;}_sanitiseText(e){return this._removeInvalidHtmlTags(e.replace(/<br>/gi,"<br/>").replace(/<hr>/gi,"<hr/>").replace(/ /gi," "))}_removeInvalidHtmlTags(e){let t=/<[^>]*?(?=<|$)/g;return e.replace(t,"")}};var nl=class extends rl{uploadQueueItem(e){e instanceof Z?this.uploadTextureSource(e):e instanceof Vr?this.uploadText(e):e instanceof sl?this.uploadHTMLText(e):e instanceof As?this.uploadBitmapText(e):e instanceof Ne&&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 Hd=class extends nl{destroy(){super.destroy(),clearTimeout(this.timeout),this.renderer=null,this.queue=null,this.resolves=null;}};Hd.extension={type:[m.WebGLSystem,m.WebGPUSystem],name:"prepare"};function nB(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}function oB(r){let e={},t=0;for(let i=0;i<r;i++)e[`textureSource${i+1}`]=t++,e[`textureSampler${i+1}`]=t++;return e}function aB(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(`
|
|
3300
|
-
`)}
|
|
3299
|
+
}`;Qe();li();Gr();var fA=class pA{constructor(e){this._tick=()=>{this._destroyed||(this.timeout=setTimeout(this._processQueue,0));},this._processQueue=()=>{if(this._destroyed)return;let{queue:t}=this,i=0;for(;t.length&&i<pA.uploadsPerFrame;){let s=t.shift();this.uploadQueueItem(s),i++;}t.length?be.system.addOnce(this._tick,this,Je.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 Q?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(),be.system.addOnce(this._tick,this,Je.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;}destroy(){this._destroyed=true,clearTimeout(this.timeout);}_resolve(){let{resolves:e}=this,t=e.slice(0);e.length=0;for(let i of t)i();}};fA.uploadsPerFrame=4;var Tg=fA;We();ee();Qe();gf();Ls();F0();bi();Ft();ee();re();Jt();$r();var Pt=class extends Fe{constructor(...e){let t=e[0];t instanceof at&&(w(O,"Mesh: use new Mesh({ geometry, shader }) instead"),t={geometry:t,shader:e[1]},e[3]&&(w(O,"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??A.WHITE,this.state=a??Se.for2d(),this._geometry=i,this._geometry.on("update",this.onViewUpdate,this),this.roundPixels=o??false;}get material(){return w(O,"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=A.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 dt?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(ml(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(ml(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;}};pi();ee();li();Gr();pi();var ja=class r extends it{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,[f]=c;super({...d,texture:f instanceof A?f:f.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&&(be.shared.remove(this.update,this),this._isConnectedToTicker=false));}play(){this._playing||(this._playing=true,this._autoUpdate&&!this._isConnectedToTicker&&(be.shared.add(this.update,this,Je.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(e=false){if(typeof e=="boolean"?e:e?.texture){let i=typeof e=="boolean"?e:e?.textureSource;this._textures.forEach(s=>{this.texture!==s&&s.destroy(i);});}this._textures=[],this._durations=null,this.stop(),super.destroy(e),this.onComplete=null,this.onFrameChange=null,this.onLoop=null;}static fromFrames(e){let t=[];for(let i=0;i<e.length;++i)t.push(A.from(e[i]));return new r(t)}static fromImages(e){let t=[];for(let i=0;i<e.length;++i)t.push(A.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 A)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?(be.shared.remove(this.update,this),this._isConnectedToTicker=false):this._autoUpdate&&!this._isConnectedToTicker&&this._playing&&(be.shared.add(this.update,this),this._isConnectedToTicker=true));}};pr();ei();ee();re();K();ei();var qa=class{constructor({matrix:e,observer:t}={}){this.dirty=true,this._matrix=e??new P,this.observer=t,this.position=new ce(this,0,0),this.scale=new ce(this,1,1),this.pivot=new ce(this,0,0),this.skew=new ce(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));}};Jt();var mA=class Sg extends Fe{constructor(...e){let t=e[0]||{};t instanceof A&&(t={texture:t}),e.length>1&&(w(O,"use new TilingSprite({ texture, width:100, height:100 }) instead"),t.width=e[1],t.height=e[2]),t={...Sg.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 ce({_onUpdate:()=>{this.onViewUpdate();}}),this.applyAnchorToTexture=c,this.texture=i,this._width=u??i.width,this._height=l??i.height,this._tileTransform=new qa({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 Sg({texture:te.get(e),...t}):new Sg({texture:e,...t})}get uvRespectAnchor(){return w(O,"uvRespectAnchor is deprecated, please use applyAnchorToTexture instead"),this.applyAnchorToTexture}set uvRespectAnchor(e){w(O,"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=A.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;}};mA.defaultOptions={texture:A.EMPTY,anchor:{x:0,y:0},tilePosition:{x:0,y:0},tileScale:{x:1,y:1},tileRotation:0,applyAnchorToTexture:false};var Eg=mA;dr();ei();re();Jt();var wr=class extends Fe{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 ce({_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;}get styleKey(){return `${this._text}:${this._style.styleKey}:${this._resolution}`}};function es(r,e){let t=r[0]??{};return (typeof t=="string"||r[1])&&(w(O,`use new ${e}({ text: "hi!", style }) instead`),t={text:t,style:r[1]}),t}mf();Xr();nr();var Pr=class extends wr{constructor(...e){let t=es(e,"Text");super(t,Re),this.renderPipeId="text",t.textureStyle&&(this.textureStyle=t.textureStyle instanceof De?t.textureStyle:new De(t.textureStyle));}updateBounds(){let e=this._bounds,t=this._anchor,i=0,s=0;if(this._style.trim){let{frame:n,canvasAndContext:o}=Yr.getCanvasAndContext({text:this.text,style:this._style,resolution:1});Yr.returnCanvasAndContext(o),i=n.width,s=n.height;}else {let n=Ce.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 Ka=class extends Tg{resolveQueueItem(e,t){return e instanceof Q?this.resolveContainerQueueItem(e,t):e instanceof Z||e instanceof A?t.push(e.source):e instanceof ke&&t.push(e),null}resolveContainerQueueItem(e,t){e instanceof it||e instanceof Eg||e instanceof Pt?t.push(e.texture.source):e instanceof Pr?t.push(e):e instanceof Ii?t.push(e.context):e instanceof ja&&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}};S();We();Ls();ne();nr();Xo();var ts=class extends wr{constructor(...e){var t;let i=es(e,"BitmapText");i.style??(i.style=i.style||{}),(t=i.style).fill??(t.fill=16777215),super(i,Re),this.renderPipeId="bitmapText";}_onTouch(e){this._gcLastUsed=e;for(let t in this._gpuData)this._gpuData[t]?._onTouch(e);}updateBounds(){let e=this._bounds,t=this._anchor,i=ar.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&&R("[BitmapText] dynamically updating the resolution is not supported. Resolution should be managed by the BitmapFont.");}get resolution(){return this._resolution}};dr();ne();nr();Ne();function Ag(r){let e=r._stroke,t=r._fill,s=[`div { ${[`color: ${H.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?[bA(e)]:[],...r.dropShadow?[_A(r.dropShadow)]:[],...r.cssOverrides].join(";")} }`];return BB(r.tagStyles,s),s.join(" ")}function _A(r){let e=H.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 bA(r){return [`-webkit-text-stroke-width: ${r.width}px`,`-webkit-text-stroke-color: ${H.shared.setValue(r.color).toHex()}`,`text-stroke-width: ${r.width}px`,`text-stroke-color: ${H.shared.setValue(r.color).toHex()}`,"paint-order: stroke"].join(";")}var gA={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"},xA={fill:r=>`color: ${H.shared.setValue(r).toHex()}`,breakWords:r=>`word-wrap: ${r?"break-all":"break-word"}`,stroke:bA,dropShadow:_A};function BB(r,e){for(let t in r){let i=r[t],s=[];for(let n in i)xA[n]?s.push(xA[n](i[n])):gA[n]&&s.push(gA[n].replace("{{VALUE}}",i[n]));e.push(`${t} { ${s.join(";")} }`);}}var Za=class r extends Re{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=Ag(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"&&R("[HTMLTextStyle] only color fill is not supported by HTMLText"),super.fill=e;}set stroke(e){e&&typeof e!="string"&&typeof e!="number"&&R("[HTMLTextStyle] only color stroke is not supported by HTMLText"),super.stroke=e;}};Ff();var Qa=class extends wr{constructor(...e){let t=es(e,"HtmlText");super(t,Za),this.renderPipeId="htmlText",t.textureStyle&&(this.textureStyle=t.textureStyle instanceof De?t.textureStyle:new De(t.textureStyle));}updateBounds(){let e=this._bounds,t=this._anchor,i=$o(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;}get text(){return this._text}set text(e){let t=this._sanitiseText(e.toString());super.text=t;}_sanitiseText(e){return this._removeInvalidHtmlTags(e.replace(/<br>/gi,"<br/>").replace(/<hr>/gi,"<hr/>").replace(/ /gi," "))}_removeInvalidHtmlTags(e){let t=/<[^>]*?(?=<|$)/g;return e.replace(t,"")}};var Ja=class extends Ka{uploadQueueItem(e){e instanceof Z?this.uploadTextureSource(e):e instanceof Pr?this.uploadText(e):e instanceof Qa?this.uploadHTMLText(e):e instanceof ts?this.uploadBitmapText(e):e instanceof ke&&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 Gc=class extends Ja{destroy(){super.destroy(),clearTimeout(this.timeout),this.renderer=null,this.queue=null,this.resolves=null;}};Gc.extension={type:[m.WebGLSystem,m.WebGPUSystem],name:"prepare"};function yA(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}function vA(r){let e={},t=0;for(let i=0;i<r;i++)e[`textureSource${i+1}`]=t++,e[`textureSampler${i+1}`]=t++;return e}function TA(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(`
|
|
3300
|
+
`)}Cu();wu();var Cg=class{constructor(e){this.priority=0,this.pipe="scissorMask",this.mask=e,this.mask.renderable=false,this.mask.measurable=false;}addBounds(e,t){mi(this.mask,e,t);}addLocalBounds(e,t){gi(this.mask,e,t);}containsPoint(e,t){let i=this.mask;return t(i,e)}reset(){this.mask!==null&&(this.mask.measurable=true,this.mask=null);}destroy(){this.reset();}};function SA(r){return r=r.replaceAll("texture2D","texture").replaceAll("gl_FragColor","finalColor").replaceAll("varying","in"),r=`
|
|
3301
3301
|
out vec4 finalColor;
|
|
3302
3302
|
${r}
|
|
3303
|
-
`,r}var lB={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,uint:1,uvec2:2,uvec3:3,uvec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function cB(r){return lB[r]}re();var NE={POINTS:"point-list",LINES:"line-list",LINE_STRIP:"line-strip",TRIANGLES:"triangle-list",TRIANGLE_STRIP:"triangle-strip"},hB=new Proxy(NE,{get(r,e){return w(O,`DRAW_MODES.${e} is deprecated, use '${NE[e]}' instead`),r[e]}});re();var Vd=(r=>(r.CLAMP="clamp-to-edge",r.REPEAT="repeat",r.MIRRORED_REPEAT="mirror-repeat",r))(Vd||{}),dB=new Proxy(Vd,{get(r,e){return w(O,`DRAW_MODES.${e} is deprecated, use '${Vd[e]}' instead`),r[e]}}),zd=(r=>(r.NEAREST="nearest",r.LINEAR="linear",r))(zd||{}),fB=new Proxy(zd,{get(r,e){return w(O,`DRAW_MODES.${e} is deprecated, use '${zd[e]}' instead`),r[e]}});Yo();var tv=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=Y.add(i,Y.NW),this.x0=u+o*Y.uX(i),this.y0=l+a*Y.uY(i),i=Y.add(i,2),this.x1=u+o*Y.uX(i),this.y1=l+a*Y.uY(i),i=Y.add(i,2),this.x2=u+o*Y.uX(i),this.y2=l+a*Y.uY(i),i=Y.add(i,2),this.x3=u+o*Y.uX(i),this.y3=l+a*Y.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 pB(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()}re();function mB(r,e){return w("8.7.0","Use container.getFastGlobalBounds() instead"),r.getFastGlobalBounds(true,e)}Ht();var rv=class extends Ue{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){}};re();function gB(r,e,t){w("8.7.0","Please use container.collectRenderables instead.");let i=t.renderPipes?t:t.batch.renderer;return r.collectRenderables(e,i,null)}function xB(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);}function _B(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;}ac();uc();Rr();on();pc();function bB(r){r instanceof pt&&(r={path:r,textureMatrix:null,out:null});let e=[],t=[],i=[],s=r.path.shapePath,n=r.textureMatrix;s.shapePrimitives.forEach(({shape:u,transform:l})=>{let c=i.length,h=e.length/2,d=[],f=$i[u.type];f.build(u,d),l&&qs(d,l),f.triangulate(d,e,2,h,i,c);let g=t.length/2;n?(l&&n.append(l.clone().invert()),ba(e,2,h,t,g,2,e.length/2-h,n)):ya(t,g,2,e.length/2-h);});let o=r.out;return o?(o.positions=new Float32Array(e),o.uvs=new Float32Array(t),o.indices=new Uint32Array(i),o):new gt({positions:new Float32Array(e),uvs:new Float32Array(t),indices:new Uint32Array(i)})}se();Ze();var HE=class VE extends Q{constructor(e={}){e={...VE.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||M("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);}getFastGlobalBounds(e,t){return super.getFastGlobalBounds(e,t)}addChild(...e){throw new Error("RenderLayer.addChild() is not available. Please use RenderLayer.attach()")}removeChild(...e){throw new Error("RenderLayer.removeChild() is not available. Please use RenderLayer.detach()")}removeChildren(e,t){throw new Error("RenderLayer.removeChildren() is not available. Please use RenderLayer.detach()")}removeChildAt(e){throw new Error("RenderLayer.removeChildAt() is not available")}getChildAt(e){throw new Error("RenderLayer.getChildAt() is not available")}setChildIndex(e,t){throw new Error("RenderLayer.setChildIndex() is not available")}getChildIndex(e){throw new Error("RenderLayer.getChildIndex() is not available")}addChildAt(e,t){throw new Error("RenderLayer.addChildAt() is not available")}swapChildren(e,t){throw new Error("RenderLayer.swapChildren() is not available")}reparentChild(...e){throw new Error("RenderLayer.reparentChild() is not available with the render layer")}reparentChildAt(e,t){throw new Error("RenderLayer.reparentChildAt() is not available with the render layer")}};HE.defaultOptions={sortableChildren:false,sortFunction:(r,e)=>r.zIndex-e.zIndex};var yB=HE;ee();qr();Za();function iv(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],f=i[2],g=i[3],_=i[4],x=i[5],b=i[6],y=i[7],v=i[8];for(let T=0;T<n.length;T+=2){let B=c%o*u,E=(c/o|0)*l,A=h*B+d*E+f,k=g*B+_*E+x,R=b*B+y*E+v;n[T]=A/R,n[T+1]=k/R,c++;}s.update();}function WE(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 XE(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],f=t[1],g=t[2],_=t[3],x=t[4],b=t[5],y=t[6],v=t[7],T=t[8];return r[0]=d*i+f*o+g*l,r[1]=d*s+f*a+g*c,r[2]=d*n+f*u+g*h,r[3]=_*i+x*o+b*l,r[4]=_*s+x*a+b*c,r[5]=_*n+x*u+b*h,r[6]=y*i+v*o+T*l,r[7]=y*s+v*a+T*c,r[8]=y*n+v*u+T*h,r}function vB(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}var TB=[0,0,0,0,0,0,0,0,0],SB=[0,0,0],Wd=[0,0,0];function zE(r,e,t,i,s,n,o,a,u){let l=TB;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=WE(r,l);Wd[0]=a,Wd[1]=u,Wd[2]=1;let h=vB(SB,c,Wd),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],XE(r,d,l)}var EB=[0,0,0,0,0,0,0,0,0],AB=[0,0,0,0,0,0,0,0,0];function sv(r,e,t,i,s,n,o,a,u,l,c,h,d,f,g,_,x){let b=zE(EB,e,t,n,o,l,c,f,g),y=zE(AB,i,s,a,u,h,d,_,x);return XE(r,WE(b,b),y)}var ol=class extends hs{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=sv(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]);iv(e,t,this,s);}};var YE=class $E extends Dt{constructor(e){e={...$E.defaultOptions,...e};let{texture:t,verticesX:i,verticesY:s,...n}=e,o=new ol(Ke({width:t.width,height:t.height,verticesX:i,verticesY:s}));super(Ke({...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);}};YE.defaultOptions={texture:C.WHITE,verticesX:10,verticesY:10,x0:0,y0:0,x1:100,y1:0,x2:100,y2:100,x3:0,y3:100};var CB=YE;qr();Za();var nv=class extends Dt{constructor(e){let{texture:t,verticesX:i,verticesY:s,...n}=e,o=new hs(Ke({width:t.width,height:t.height,verticesX:i,verticesY:s}));super(Ke({...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);}};qr();Rr();var jE=class qE extends gt{constructor(e){let{width:t,points:i,textureScale:s}={...qE.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 f=d*4;if(this.textureScale>0){let g=u.x-e[d].x,_=u.y-e[d].y,x=Math.sqrt(g*g+_*_);u=e[d],a+=x/l;}else a=d/(c-1);n[f]=a,n[f+1]=0,n[f+2]=a,n[f+3]=1;}let h=0;for(let d=0;d<c-1;d++){let f=d*2;o[h++]=f,o[h++]=f+1,o[h++]=f+2,o[h++]=f+2,o[h++]=f+1,o[h++]=f+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 f=Math.sqrt(s*s+n*n);f<1e-6?(s=0,n=0):(s/=f,n/=f,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();}};jE.defaultOptions={width:200,points:[],textureScale:0};var ov=jE;var KE=class ZE extends Dt{constructor(e){let{texture:t,points:i,textureScale:s,...n}={...ZE.defaultOptions,...e},o=new ov(Ke({width:t.height,points:i,textureScale:s}));s>0&&(t.source.style.addressMode="repeat"),super(Ke({...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());}};KE.defaultOptions={textureScale:0};var wB=KE;qr();Rr();var av=class extends Dt{constructor(e){let{texture:t,vertices:i,uvs:s,indices:n,topology:o,...a}=e,u=new gt(Ke({positions:i,uvs:s,indices:n,topology:o}));super(Ke({...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 PB(r,e){let{width:t,height:i}=r.frame;return e.scale(1/t,1/i),e}ke();ee();bl();Bl();var QE=class uv{constructor(e){if(e instanceof C)this.texture=e,Rs(this,uv.defaultOptions,{});else {let t={...uv.defaultOptions,...e};Rs(this,t,{});}}get alpha(){return this._alpha}set alpha(e){this._alpha=Math.min(Math.max(e,0),1),this._updateColor();}get tint(){return jr(this._tint)}set tint(e){this._tint=H.shared.setValue(e??16777215).toBgrNumber(),this._updateColor();}_updateColor(){this.color=this._tint+((this._alpha*255|0)<<24);}};QE.defaultOptions={anchorX:0,anchorY:0,x:0,y:0,scaleX:1,scaleY:1,rotation:0,tint:16777215,alpha:1};var BB=QE;qe();Ht();var Xd={vertex:{attributeName:"aVertex",format:"float32x2",code:`
|
|
3303
|
+
`,r}var RB={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,uint:1,uvec2:2,uvec3:3,uvec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function EA(r){return RB[r]}re();var AA={POINTS:"point-list",LINES:"line-list",LINE_STRIP:"line-strip",TRIANGLES:"triangle-list",TRIANGLE_STRIP:"triangle-strip"},CA=new Proxy(AA,{get(r,e){return w(O,`DRAW_MODES.${e} is deprecated, use '${AA[e]}' instead`),r[e]}});re();var Uc=(r=>(r.CLAMP="clamp-to-edge",r.REPEAT="repeat",r.MIRRORED_REPEAT="mirror-repeat",r))(Uc||{}),wA=new Proxy(Uc,{get(r,e){return w(O,`DRAW_MODES.${e} is deprecated, use '${Uc[e]}' instead`),r[e]}}),Ic=(r=>(r.NEAREST="nearest",r.LINEAR="linear",r))(Ic||{}),PA=new Proxy(Ic,{get(r,e){return w(O,`DRAW_MODES.${e} is deprecated, use '${Ic[e]}' instead`),r[e]}});mu();var wg=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=Y.add(i,Y.NW),this.x0=u+o*Y.uX(i),this.y0=l+a*Y.uY(i),i=Y.add(i,2),this.x1=u+o*Y.uX(i),this.y1=l+a*Y.uY(i),i=Y.add(i,2),this.x2=u+o*Y.uX(i),this.y2=l+a*Y.uY(i),i=Y.add(i,2),this.x3=u+o*Y.uX(i),this.y3=l+a*Y.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 BA(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()}re();function RA(r,e){return w("8.7.0","Use container.getFastGlobalBounds() instead"),r.getFastGlobalBounds(true,e)}Jt();var Pg=class extends Fe{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){}};re();function MA(r,e,t){w("8.7.0","Please use container.collectRenderables instead.");let i=t.renderPipes?t:t.batch.renderer;return r.collectRenderables(e,i,null)}function DA(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);}function FA(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;}bd();yd();$r();Ho();Ld();function GA(r){r instanceof ct&&(r={path:r,textureMatrix:null,out:null});let e=[],t=[],i=[],s=r.path.shapePath,n=r.textureMatrix;s.shapePrimitives.forEach(({shape:u,transform:l})=>{let c=i.length,h=e.length/2,d=[],f=Bi[u.type];f.build(u,d),l&&ws(d,l),f.triangulate(d,e,2,h,i,c);let g=t.length/2;n?(l&&n.append(l.clone().invert()),So(e,2,h,t,g,2,e.length/2-h,n)):Eo(t,g,2,e.length/2-h);});let o=r.out;return o?(o.positions=new Float32Array(e),o.uvs=new Float32Array(t),o.indices=new Uint32Array(i),o):new dt({positions:new Float32Array(e),uvs:new Float32Array(t),indices:new Uint32Array(i)})}ne();Qe();var UA=class IA extends Q{constructor(e={}){e={...IA.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||R("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);}getFastGlobalBounds(e,t){return super.getFastGlobalBounds(e,t)}addChild(...e){throw new Error("RenderLayer.addChild() is not available. Please use RenderLayer.attach()")}removeChild(...e){throw new Error("RenderLayer.removeChild() is not available. Please use RenderLayer.detach()")}removeChildren(e,t){throw new Error("RenderLayer.removeChildren() is not available. Please use RenderLayer.detach()")}removeChildAt(e){throw new Error("RenderLayer.removeChildAt() is not available")}getChildAt(e){throw new Error("RenderLayer.getChildAt() is not available")}setChildIndex(e,t){throw new Error("RenderLayer.setChildIndex() is not available")}getChildIndex(e){throw new Error("RenderLayer.getChildIndex() is not available")}addChildAt(e,t){throw new Error("RenderLayer.addChildAt() is not available")}swapChildren(e,t){throw new Error("RenderLayer.swapChildren() is not available")}reparentChild(...e){throw new Error("RenderLayer.reparentChild() is not available with the render layer")}reparentChildAt(e,t){throw new Error("RenderLayer.reparentChildAt() is not available with the render layer")}};UA.defaultOptions={sortableChildren:false,sortFunction:(r,e)=>r.zIndex-e.zIndex};var OA=UA;ee();oi();dl();function Bg(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],f=i[2],g=i[3],_=i[4],x=i[5],b=i[6],y=i[7],v=i[8];for(let T=0;T<n.length;T+=2){let B=c%o*u,E=(c/o|0)*l,C=h*B+d*E+f,k=g*B+_*E+x,M=b*B+y*E+v;n[T]=C/M,n[T+1]=k/M,c++;}s.update();}function LA(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 NA(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],f=t[1],g=t[2],_=t[3],x=t[4],b=t[5],y=t[6],v=t[7],T=t[8];return r[0]=d*i+f*o+g*l,r[1]=d*s+f*a+g*c,r[2]=d*n+f*u+g*h,r[3]=_*i+x*o+b*l,r[4]=_*s+x*a+b*c,r[5]=_*n+x*u+b*h,r[6]=y*i+v*o+T*l,r[7]=y*s+v*a+T*c,r[8]=y*n+v*u+T*h,r}function MB(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}var DB=[0,0,0,0,0,0,0,0,0],FB=[0,0,0],Rg=[0,0,0];function kA(r,e,t,i,s,n,o,a,u){let l=DB;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=LA(r,l);Rg[0]=a,Rg[1]=u,Rg[2]=1;let h=MB(FB,c,Rg),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],NA(r,d,l)}var GB=[0,0,0,0,0,0,0,0,0],UB=[0,0,0,0,0,0,0,0,0];function Mg(r,e,t,i,s,n,o,a,u,l,c,h,d,f,g,_,x){let b=kA(GB,e,t,n,o,l,c,f,g),y=kA(UB,i,s,a,u,h,d,_,x);return NA(r,LA(b,b),y)}var eu=class extends Hi{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=Mg(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]);Bg(e,t,this,s);}};var HA=class VA extends Pt{constructor(e){e={...VA.defaultOptions,...e};let{texture:t,verticesX:i,verticesY:s,...n}=e,o=new eu(Ye({width:t.width,height:t.height,verticesX:i,verticesY:s}));super(Ye({...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);}};HA.defaultOptions={texture:A.WHITE,verticesX:10,verticesY:10,x0:0,y0:0,x1:100,y1:0,x2:100,y2:100,x3:0,y3:100};var zA=HA;oi();dl();var Dg=class extends Pt{constructor(e){let{texture:t,verticesX:i,verticesY:s,...n}=e,o=new Hi(Ye({width:t.width,height:t.height,verticesX:i,verticesY:s}));super(Ye({...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);}};oi();$r();var WA=class XA extends dt{constructor(e){let{width:t,points:i,textureScale:s}={...XA.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 f=d*4;if(this.textureScale>0){let g=u.x-e[d].x,_=u.y-e[d].y,x=Math.sqrt(g*g+_*_);u=e[d],a+=x/l;}else a=d/(c-1);n[f]=a,n[f+1]=0,n[f+2]=a,n[f+3]=1;}let h=0;for(let d=0;d<c-1;d++){let f=d*2;o[h++]=f,o[h++]=f+1,o[h++]=f+2,o[h++]=f+2,o[h++]=f+1,o[h++]=f+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 f=Math.sqrt(s*s+n*n);f<1e-6?(s=0,n=0):(s/=f,n/=f,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();}};WA.defaultOptions={width:200,points:[],textureScale:0};var Fg=WA;var YA=class $A extends Pt{constructor(e){let{texture:t,points:i,textureScale:s,...n}={...$A.defaultOptions,...e},o=new Fg(Ye({width:t.height,points:i,textureScale:s}));s>0&&(t.source.style.addressMode="repeat"),super(Ye({...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());}};YA.defaultOptions={textureScale:0};var jA=YA;oi();$r();var Gg=class extends Pt{constructor(e){let{texture:t,vertices:i,uvs:s,indices:n,topology:o,...a}=e,u=new dt(Ye({positions:i,uvs:s,indices:n,topology:o}));super(Ye({...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 qA(r,e){let{width:t,height:i}=r.frame;return e.scale(1/t,1/i),e}Ne();ee();oh();gh();var KA=class Pv{constructor(e){if(e instanceof A)this.texture=e,fs(this,Pv.defaultOptions,{});else {let t={...Pv.defaultOptions,...e};fs(this,t,{});}}get alpha(){return this._alpha}set alpha(e){this._alpha=Math.min(Math.max(e,0),1),this._updateColor();}get tint(){return Mr(this._tint)}set tint(e){this._tint=H.shared.setValue(e??16777215).toBgrNumber(),this._updateColor();}_updateColor(){this.color=this._tint+((this._alpha*255|0)<<24);}};KA.defaultOptions={anchorX:0,anchorY:0,x:0,y:0,scaleX:1,scaleY:1,rotation:0,tint:16777215,alpha:1};var ZA=KA;Ze();Jt();var Oc={vertex:{attributeName:"aVertex",format:"float32x2",code:`
|
|
3304
3304
|
const texture = p.texture;
|
|
3305
3305
|
const sx = p.scaleX;
|
|
3306
3306
|
const sy = p.scaleY;
|
|
@@ -3380,16 +3380,16 @@ fn setSaturation(c: vec3<f32>, s: f32) -> vec3<f32> {
|
|
|
3380
3380
|
u32v[offset + stride] = c;
|
|
3381
3381
|
u32v[offset + (stride * 2)] = c;
|
|
3382
3382
|
u32v[offset + (stride * 3)] = c;
|
|
3383
|
-
`,dynamic:false}};var
|
|
3383
|
+
`,dynamic:false}};var IB=new oe(0,0,0,0),QA=class Bv extends Fe{constructor(e={}){e={...Bv.defaultOptions,...e,dynamicProperties:{...Bv.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 Oc){let l=Oc[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 IB}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")}};QA.defaultOptions={dynamicProperties:{vertex:false,position:true,rotation:false,uvs:false,color:false},roundPixels:false};var JA=QA;ei();ee();re();Jt();Hf();var e3=class t3 extends Fe{constructor(e){e instanceof A&&(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??ur.defaultOptions.leftWidth,this._topHeight=a??l?.defaultBorders?.top??ur.defaultOptions.topHeight,this._rightWidth=o??l?.defaultBorders?.right??ur.defaultOptions.rightWidth,this._bottomHeight=u??l?.defaultBorders?.bottom??ur.defaultOptions.bottomHeight,this._width=t??l.width??ur.defaultOptions.width,this._height=i??l.height??ur.defaultOptions.height,this.allowChildren=false,this.texture=l??t3.defaultOptions.texture,this.roundPixels=c??false,this._anchor=new ce({_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=A.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;}};e3.defaultOptions={texture:A.EMPTY};var Rv=e3,Ug=class extends Rv{constructor(...e){let t=e[0];t instanceof A&&(w(O,"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]}),w(O,"NineSlicePlane is deprecated. Use NineSliceSprite instead."),super(t);}};Qe();Xr();Xo();ul();function Ig(r){let{text:e,style:t,chars:i}=r,s=t,n=ar.getFont(e,s),o=Ce.graphemeSegmenter(e),a=ki(o,s,n,true),u=a.scale,l=[],c=[],h=[],d=t.lineHeight?t.lineHeight:n.lineHeight*u,f=0;for(let g of a.lines){if(g.chars.length===0)continue;let _=new Q({label:"line"});_.y=f,h.push(_);let x=new Q({label:"word"}),b=0;for(let y=0;y<g.chars.length;y++){let v=g.chars[y];if(!v||!n.chars[v])continue;let B=v===" ",E=y===g.chars.length-1,C;i.length>0?(C=i.shift(),C.text=v,C.style=s,C.label=`char-${v}`,C.x=g.charPositions[y]*u-g.charPositions[b]*u):C=new ts({text:v,style:s,label:`char-${v}`,x:g.charPositions[y]*u-g.charPositions[b]*u}),B||(l.push(C),x.addChild(C)),(B||E)&&x.children.length>0&&(x.x=g.charPositions[b]*u,c.push(x),_.addChild(x),x=new Q({label:"word"}),b=y+1);}f+=d;}return {chars:l,lines:h,words:c}}Qe();nr();var rs=class extends Q{constructor(e){let{text:t,style:i,autoSplit:s,lineAnchor:n,wordAnchor:o,charAnchor:a,...u}=e;super(u),this._dirty=false,this._canReuseChars=false,this.chars=[],this.words=[],this.lines=[],this._originalText=t,this._autoSplit=s,this._lineAnchor=n,this._wordAnchor=o,this._charAnchor=a,this.style=i;}split(){let e=this.splitFn();this.chars=e.chars,this.words=e.words,this.lines=e.lines,this.addChild(...this.lines),this.charAnchor=this._charAnchor,this.wordAnchor=this._wordAnchor,this.lineAnchor=this._lineAnchor,this._dirty=false,this._canReuseChars=true;}get text(){return this._originalText}set text(e){this._originalText=e,this.lines.forEach(t=>t.destroy({children:true})),this.lines.length=0,this.words.length=0,this.chars.length=0,this._canReuseChars=false,this.onTextUpdate();}_setOrigin(e,t,i){let s;typeof e=="number"?s={x:e,y:e}:s={x:e.x,y:e.y},t.forEach(n=>{let o=n.getLocalBounds(),a=o.minX+o.width*s.x,u=o.minY+o.height*s.y;n.origin.set(a,u);}),this[i]=e;}get lineAnchor(){return this._lineAnchor}set lineAnchor(e){this._setOrigin(e,this.lines,"_lineAnchor");}get wordAnchor(){return this._wordAnchor}set wordAnchor(e){this._setOrigin(e,this.words,"_wordAnchor");}get charAnchor(){return this._charAnchor}set charAnchor(e){this._setOrigin(e,this.chars,"_charAnchor");}get style(){return this._style}set style(e){e||(e={}),this._style=new Re(e),this.words.forEach(t=>t.destroy()),this.words.length=0,this.lines.forEach(t=>t.destroy()),this.lines.length=0,this._canReuseChars=true,this.onTextUpdate();}onTextUpdate(){this._dirty=true,this._autoSplit&&this.split();}destroy(e){super.destroy(e),this.chars=[],this.words=[],this.lines=[],(typeof e=="boolean"?e:e?.style)&&this._style.destroy(e),this._style=null,this._originalText="";}};nr();var r3=class Og extends rs{constructor(e){let t={...Og.defaultOptions,...e};super(t);}static from(e,t){let i={...Og.defaultOptions,...t,text:e.text,style:new Re(e.style)};return new Og({...i})}splitFn(){return Ig({text:this._originalText,style:this._style,chars:this._canReuseChars?this.chars:[]})}};r3.defaultOptions={autoSplit:true,lineAnchor:0,wordAnchor:0,charAnchor:0};var i3=r3;nr();K();Qe();Xr();function OB(r,e,t){switch(r){case "center":return (t-e)/2;case "right":return t-e;default:return 0}}function s3(r){return r==="\r"||r===`
|
|
3384
3384
|
`||r===`\r
|
|
3385
|
-
`}function
|
|
3385
|
+
`}function kB(r,e,t){let i=[],s=e.lines[0],n="",o=[],a=0;return t.wordWrap=false,r.forEach(u=>{let l=/^\s*$/.test(u),c=s3(u),h=n.length===0&&l;if(l&&!c&&h)return;c||(n+=u);let d=Ce.measureText(u,t);o.push({char:u,metric:d}),n.length>=s.length&&(i.push({line:n,chars:o,width:o.reduce((f,g)=>f+g.metric.width,0)}),o=[],n="",a++,s=e.lines[a]);}),i}function kg(r){let{text:e,style:t,chars:i}=r,s=t,n=Ce.measureText(e,s),o=Ce.graphemeSegmenter(e),a=kB(o,n,s.clone()),u=s.align,l=n.lineWidths.reduce((x,b)=>Math.max(x,b),0),c=[],h=[],d=[],f=0,g=s.stroke?.width||0,_=s.dropShadow?.distance||0;return a.forEach((x,b)=>{let y=new Q({label:`line-${b}`});y.y=f,h.push(y);let v=n.lineWidths[b],T=OB(u,v,l),B=new Q({label:"word"});B.x=T,x.chars.forEach((E,C)=>{if(E.metric.width!==0){if(s3(E.char)){T+=E.metric.width-g;return}if(E.char===" ")B.children.length>0&&(d.push(B),y.addChild(B)),T+=E.metric.width+s.letterSpacing-g,B=new Q({label:"word"}),B.x=T;else {let k;i.length>0?(k=i.shift(),k.text=E.char,k.style=s,k.setFromMatrix(P.IDENTITY),k.x=T-B.x-_*C):k=new Pr({text:E.char,style:s,x:T-B.x-_*C}),c.push(k),B.addChild(k),T+=E.metric.width+s.letterSpacing-g;}}}),B.children.length>0&&(d.push(B),y.addChild(B)),f+=n.lineHeight;}),{chars:c,lines:h,words:d}}var n3=class Lg extends rs{constructor(e){let t={...Lg.defaultOptions,...e};super(t);}static from(e,t){let i={...Lg.defaultOptions,...t,text:e.text,style:new Re(e.style)};return new Lg({...i})}splitFn(){return kg({text:this._originalText,style:this._style,chars:this._canReuseChars?this.chars:[]})}};n3.defaultOptions={autoSplit:true,lineAnchor:0,wordAnchor:0,charAnchor:0};var o3=n3;Ne();var a3=["align","breakWords","cssOverrides","fontVariant","fontWeight","leading","letterSpacing","lineHeight","padding","textBaseline","trim","whiteSpace","wordWrap","wordWrapWidth","fontFamily","fontStyle","fontSize"];function u3(r){let e=[],t=0;for(let i=0;i<a3.length;i++){let s=`_${a3[i]}`;e[t++]=r[s];}return t=l3(r._fill,e,t),t=NB(r._stroke,e,t),t=HB(r.dropShadow,e,t),t=LB(r.filters,e,t),e.join("-")}function LB(r,e,t){if(!r)return t;for(let i of r)e[t++]=i.uid;return t}function l3(r,e,t){return r&&(e[t++]=r.color,e[t++]=r.alpha,e[t++]=r.fill?.styleKey),t}function NB(r,e,t){return r&&(t=l3(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 HB(r,e,t){return r&&(e[t++]=r.alpha,e[t++]=r.angle,e[t++]=r.blur,e[t++]=r.distance,e[t++]=H.shared.setValue(r.color).toNumber()),t}async function c3(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);}pi();var VB=["#000080","#228B22","#8B0000","#4169E1","#008080","#800000","#9400D3","#FF8C00","#556B2F","#8B008B"],zB=0;function Mv(r,e=0,t={color:"#000000"}){r.renderGroup&&(t.color=VB[zB++]);let i="";for(let o=0;o<e;o++)i+=" ";let s=r.label;!s&&r instanceof it&&(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];Mv(a,e,{...t});}}function Dv(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];Dv(o,e,{...t,index:n});}}Ex();Ax();Cx();wx();pr();Mt();fi();lo();Dh();Ix();Su();Ne();Qg();bh();U1();Gx();ae();H0();Ux();Rx();wh();Eh();_u();Fx();yu();Ah();Ch();Ko();R0();M0();ey();ty();ry();D0();lr();cu();P0();I0();iy();mu();K();$c();so();Yd();ei();vt();F0();bb();yb();vb();Ue();Tb();eS();s2();Xh();Kx();Pu();W0();Qx();J0();t_();Zx();_d();R_();Nr();S_();x_();__();b_();y_();v_();E_();vo();To();A_();Ys();Hr();ep();Nx();ny();Hx();oy();nx();Vx();ay();Cu();wu();n2();o2();a2();Zs();l2();d2();h2();p2();m2();g2();x2();T2();_2();v2();S2();E2();A2();Nu();_t();C2();G2();O2();w2();Zp();Dp();B2();F2();i_();Wh();R2();M2();D2();em();s_();n_();o_();a_();u_();Yp();y2();b2();I2();U2();N2();k2();Vp();H2();K2();V2();z2();pm();W2();Y2();$2();j2();q2();X2();DS();Z2();By();Ry();Ly();My();Dy();Fy();Gy();Uy();ky();Ny();Hy();Vy();Wy();Xy();Yy();kr();St();$y();Ap();Oy();h_();d_();Iy();p_();m_();g_();jy();qy();Fp();e2();Ky();Zy();Lp();Qy();Jy();t2();ly();cy();Lr();Xl();mr();Hh();fy();my();xy();bi();bd();Jx();yi();e_();yd();hh();_y();zy();bp();Ip();by();f_();Ht();P_();Sp();Oe();wp();B_();Bp();Cp();vy();_i();fo();Ft();Jo();Tp();qf();Ns();Ey();py();fh();Ts();Ss();We();kh();ee();Cy();ph();Zt();dr();yp();qx();bo();Py();Dt();ab();ub();lb();Ze();us();du();G0();ri();rx();ix();sx();ox();ax();ux();oh();cx();hx();dx();fx();Qe();X0();mh();Y0();K0();gh();lx();ip();oi();rp();sh();ih();j0();q0();r2();Ms();V0();vd();qd();Cb();Zd();wb();Rb();M_();F_();G_();k_();L_();N_();uT();Rs();Ju();gf();Ls();ju();J_();Ho();Mb();Db();Fb();rf();_b();Ub();kb();Gb();Ib();Ob();Ld();cf();z_();D_();Fd();dl();i2();z0();Ku();$r();tb();ib();db();hb();fb();ob();zd();cb();sb();nb();Hf();C0();g0();b0();E0();T0();y0();v0();S0();Do();pi();Z0();vf();Xo();r0();Jb();ul();e0();s0();n0();Af();p0();a0();c0();h0();d0();u0();l0();f0();Ff();mb();mf();Xr();gb();Yb();ol();pf();Qb();jb();qb();nr();hf();Wd();Jt();kx();Lx();li();Gr();_x();Ih();Tx();o0();jf();Hb();op();Ke();Ty();bt();Kc();Ge();Uh();Nh();ap();re();ne();mx();di();ti();tx();jt();yy();O_();G.add(k0,L0);typeof window<"u"&&(window.PIXI=Ng);var B_e=Ng;/*! Bundled license information:
|
|
3386
3386
|
|
|
3387
3387
|
tiny-lru/dist/tiny-lru.js:
|
|
3388
3388
|
(**
|
|
3389
3389
|
* tiny-lru
|
|
3390
3390
|
*
|
|
3391
|
-
* @copyright
|
|
3391
|
+
* @copyright 2026 Jason Mulligan <jason.mulligan@avoidwork.com>
|
|
3392
3392
|
* @license BSD-3-Clause
|
|
3393
|
-
* @version 11.4.
|
|
3393
|
+
* @version 11.4.7
|
|
3394
3394
|
*)
|
|
3395
|
-
*/export{os as AbstractBitmapFont,Dr as AbstractRenderer,Cs as AbstractSplitText,Hr as AbstractText,jf as AccessibilitySystem,JP as AlphaFilter,ks as AlphaMask,Rn as AlphaMaskPipe,el as AnimatedSprite,gS as Application,Pn as ApplicationInitHook,Ru as Assets,md as AssetsClass,Ep as BLEND_TO_NPM,ro as BUFFER_TYPE,Au as BackgroundLoader,hb as BackgroundSystem,Zl as Batch,fa as BatchGeometry,ca as BatchTextureArray,ui as BatchableGraphics,$a as BatchableHTMLText,wr as BatchableMesh,qt as BatchableSprite,Fa as BatchableText,Pp as Batcher,Rh as BatcherPipe,de as BigPool,Ve as BindGroup,kn as BindGroupSystem,mo as BitmapFont,dr as BitmapFontManager,As as BitmapText,Hc as BitmapTextGraphics,cn as BitmapTextPipe,$ as BlendModeFilter,Fn as BlendModePipe,Id as BlurFilter,Ju as BlurFilterPass,oe as Bounds,lp as BrowserAdapter,Ee as Buffer,Kr as BufferImageSource,Ur as BufferResource,j as BufferUsage,We as CLEAR,te as Cache,Mi as CanvasObserver,mt as CanvasPool,Fc as CanvasPoolClass,Qe as CanvasSource,ci as CanvasTextGenerator,we as CanvasTextMetrics,sn as CanvasTextPipe,un as CanvasTextSystem,Ua as Circle,H as Color,Zc as ColorBlend,Qc as ColorBurnBlend,Jc as ColorDodgeBlend,Ls as ColorMask,Mn as ColorMaskPipe,Y2 as ColorMatrixFilter,er as CompressedSource,Q as Container,S2 as Culler,Ed as CullerPlugin,Tn as CustomRenderPipe,p2 as D3D10_RESOURCE_DIMENSION,Tt as D3DFMT,UC as DATA_URI,X as DDS,lf as DEG_TO_RAD,zd as DEPRECATED_SCALE_MODES,Vd as DEPRECATED_WRAP_MODES,U as DOMAdapter,up as DOMContainer,Us as DOMPipe,hB as DRAW_MODES,f2 as DXGI_FORMAT,_t as DXGI_TO_TEXTURE_FORMAT,eh as DarkenBlend,js as DefaultBatcher,$s as DefaultShader,th as DifferenceBlend,q2 as DisplacementFilter,rh as DivideBlend,Lc as DynamicBitmapFont,Ia as Ellipse,Qo as EventBoundary,fe as EventEmitter,Jo as EventSystem,Gt as EventsTicker,ih as ExclusionBlend,m as ExtensionType,gb as ExtractSystem,Td as FOURCC_TO_TEXTURE_FORMAT,np as FederatedContainer,vr as FederatedEvent,sr as FederatedMouseEvent,tt as FederatedPointerEvent,Nt as FederatedWheelEvent,ft as FillGradient,lr as FillPattern,ze as Filter,tr as FilterEffect,mn as FilterPipe,xn as FilterSystem,zc as FontStylePromiseCache,Qu as GAUSSIAN_VALUES,pe as GCManagedHash,vb as GCSystem,gu as GL_FORMATS,PS as GL_INTERNAL_FORMAT,Kh as GL_TARGETS,ne as GL_TYPES,iS as GL_WRAP_MODES,jh as GPUTextureGpuData,Gn as GenerateTextureSystem,lt as Geometry,U0 as GlBackBufferSystem,to as GlBatchAdaptor,mu as GlBuffer,io as GlBufferSystem,no as GlColorMaskSystem,B0 as GlContextSystem,oo as GlEncoderSystem,Qh as GlGeometryGpuData,so as GlGeometrySystem,Jn as GlGraphicsAdaptor,ao as GlLimitsSystem,eo as GlMeshAdaptor,Ba as GlParticleContainerAdaptor,Js as GlParticleContainerPipe,xe as GlProgram,bu as GlProgramData,xu as GlRenderTarget,_u as GlRenderTargetAdaptor,co as GlRenderTargetSystem,ho as GlShaderSystem,Sy as GlStateSystem,uo as GlStencilSystem,vu as GlTexture,po as GlTextureSystem,lo as GlUboSystem,fo as GlUniformGroupSystem,Ct as GlobalResourceRegistry,Un as GlobalUniformSystem,vn as GpuBatchAdaptor,nt as GpuBlendModesToPixi,Ih as GpuBufferData,Ln as GpuBufferSystem,Nn as GpuColorMaskSystem,bs as GpuDeviceSystem,Hn as GpuEncoderSystem,bn as GpuGraphicsAdaptor,mc as GpuGraphicsContext,Vn as GpuLimitsSystem,yn as GpuMeshAdapter,pu as GpuMipmapGenerator,Da as GpuParticleContainerAdaptor,en as GpuParticleContainerPipe,_e as GpuProgram,hu as GpuRenderTarget,du as GpuRenderTargetAdaptor,qn as GpuRenderTargetSystem,Kn as GpuShaderSystem,Zn as GpuStateSystem,Jt as GpuStencilModesToPixi,zn as GpuStencilSystem,Qn as GpuTextureSystem,Yn as GpuUboSystem,$n as GpuUniformBatchPipe,ns as Graphics,Ne as GraphicsContext,gc as GraphicsContextRenderData,ji as GraphicsContextSystem,xc as GraphicsGpuData,pt as GraphicsPath,Zs as GraphicsPipe,sl as HTMLText,hn as HTMLTextPipe,us as HTMLTextRenderData,il as HTMLTextStyle,dn as HTMLTextSystem,sh as HardLightBlend,nh as HardMixBlend,xs as HelloSystem,Q0 as IGLUniformData,ut as ImageSource,Si as InstructionSet,Be as KTX,oh as LightenBlend,ah as LinearBurnBlend,uh as LinearDodgeBlend,lh as LinearLightBlend,t2 as Loader,Te as LoaderParserPriority,ch as LuminosityBlend,Vo as MaskEffectManager,ml as MaskEffectManagerClass,tu as MaskFilter,P as Matrix,Dt as Mesh,gt as MeshGeometry,Pa as MeshGpuData,Qs as MeshPipe,nv as MeshPlane,wB as MeshRope,av as MeshSimple,El as NOOP,hh as NegationBlend,fr as NineSliceGeometry,cv as NineSlicePlane,rA as NineSliceSprite,jc as NineSliceSpriteGpuData,pn as NineSliceSpritePipe,rB as NoiseFilter,he as ObservablePoint,dh as OverlayBlend,af as PI_2,BB as Particle,Ra as ParticleBuffer,MB as ParticleContainer,Ki as ParticleContainerPipe,Ma as ParticleShader,Qa as PassthroughFilter,CB as PerspectiveMesh,ol as PerspectivePlaneGeometry,fh as PinLightBlend,jn as PipelineSystem,hs as PlaneGeometry,q as Point,Qi as Polygon,Lo as Pool,fl as PoolGroupClass,Z2 as PrepareBase,rl as PrepareQueue,Hd as PrepareSystem,nl as PrepareUpload,Ka as QuadGeometry,uf as RAD_TO_DEG,V as Rectangle,rv as RenderContainer,Zr as RenderGroup,En as RenderGroupPipe,Cn as RenderGroupSystem,yB as RenderLayer,On as RenderTarget,vs as RenderTargetSystem,iu as RenderTexture,Db as RenderableGCSystem,Bn as RendererInitHook,ye as RendererType,Fs as ResizePlugin,it as Resolver,ov as RopeGeometry,Oa as RoundedRectangle,fB as SCALE_MODES,ge as STENCIL_MODES,cx as SVGParser,ph as SaturationBlend,In as SchedulerSystem,ev as ScissorMask,Xa as SdfShader,Ae as Shader,Oi as ShaderStage,Ha as ShapePath,ou as SharedRenderPipes,nu as SharedSystems,mh as SoftLightBlend,DB as SplitBitmapText,UB as SplitText,st as Sprite,wn as SpritePipe,Ll as Spritesheet,Se as State,Ns as StencilMask,Dn as StencilMaskPipe,gh as SubtractBlend,ms as SystemRunner,m2 as TEXTURE_FORMAT_BLOCK_SIZE,Vr as Text,Re as TextStyle,C as Texture,Ub as TextureGCSystem,Pi as TextureMatrix,le as TexturePool,wl as TexturePoolClass,Z as TextureSource,Ge as TextureStyle,tv as TextureUvs,be as Ticker,Ri as TickerListener,Gs as TickerPlugin,Q2 as TilingSprite,Yc as TilingSpriteGpuData,fn as TilingSpritePipe,qa as TilingSpriteShader,tl as Transform,P_ as Triangle,my as UNIFORM_TO_ARRAY_SETTERS,py as UNIFORM_TO_SINGLE_SETTERS,Am as UNIFORM_TYPES_MAP,nc as UNIFORM_TYPES_VALUES,$o as UPDATE_BLEND,Ms as UPDATE_COLOR,et as UPDATE_PRIORITY,OA as UPDATE_TRANSFORM,Bi as UPDATE_VISIBLE,lu as UboBatch,ys as UboSystem,J as UniformGroup,gs as VERSION,ii as VideoSource,Ue as ViewContainer,kb as ViewSystem,zt as ViewableBuffer,xh as VividLightBlend,Wn as WGSL_ALIGN_SIZE_DATA,Jh as WGSL_TO_STD40_SIZE,dB as WRAP_MODES,cd as WebGLRenderer,qh as WebGPURenderer,QP as WebWorkerAdapter,pd as WorkerManager,Kf as accessibilityTarget,tc as addBits,Di as addMaskBounds,Fi as addMaskLocalBounds,Op as addProgramDefines,L2 as alphaFrag,Ud as alphaWgsl,Rc as appendSVGPath,f_ as applyMatrix,iv as applyProjectiveTransformationToPlane,ld as applyStyleParams,Rs as assignWithIgnore,RC as autoDetectEnvironment,Wy as autoDetectRenderer,t3 as autoDetectSource,Fu as basisTranscoderUrls,jr as bgr2rgb,Yy as bitmapFontCachePlugin,Eu as bitmapFontTextParser,hd as bitmapFontXMLParser,dd as bitmapFontXMLStringParser,hv as bitmapTextSplit,G_ as blendTemplateFrag,U_ as blendTemplateVert,I_ as blendTemplateWgsl,Yh as blockDataMap,z2 as blurTemplateWgsl,yt as boundsPool,GT as browserExt,ka as buildAdaptiveBezier,Vg as buildAdaptiveQuadratic,La as buildArc,Wg as buildArcTo,jg as buildArcToSvg,zi as buildCircle,tg as buildContextBatches,Rm as buildEllipse,bB as buildGeometryFromPath,Om as buildLine,Lm as buildPixelLine,Xm as buildPolygon,$m as buildRectangle,Mm as buildRoundedRectangle,ya as buildSimpleUvs,qm as buildTriangle,ba as buildUvs,pf as cacheAsTextureMixin,jy as cacheTextureArray,ux as calculatePathArea,i0 as calculateProjection,dv as canvasTextSplit,yl as checkChildrenDidChange,Mt as checkDataUrl,Pe as checkExtension,nx as checkForNestedPattern,la as checkMaxIfStatementsInShader,gf as childrenHelperMixin,Bb as cleanArray,Pb as cleanHash,An as clearList,Fm as closePointEps,gB as collectAllRenderables,_f as collectRenderablesMixin,jt as color32BitToUniform,ki as colorBit,Li as colorBitGl,X2 as colorMatrixFilterFrag,Od as colorMatrixFilterWgsl,Y3 as colorToUniform,Fy as compareModeToGlCompare,dm as compileHighShader,fm as compileHighShaderGl,Xt as compileHighShaderGlProgram,Wt as compileHighShaderGpuProgram,rc as compileHooks,ic as compileInputs,um as compileOutputs,td as compileShader,sv as compute2DProjection,fP as convertFormatIfRequired,rt as convertToList,Os as copySearchParams,ur as createIdFromString,_c as createIndicesForQuads,Lw as createLevelBuffers,pP as createLevelBuffersFromKTX,hp as createStringVariations,xt as createTexture,H0 as createUboElementsSTD40,$b as createUboElementsWGSL,au as createUboSyncFunction,W0 as createUboSyncFunctionSTD40,Zb as createUboSyncFunctionWGSL,TS as crossOrigin,nf as cullingMixin,Gm as curveEps,Mr as defaultFilterVert,yu as defaultValue,Ke as definedProps,w as deprecation,qy as detectAvif,Gw as detectBasis,vP as detectCompressed,Ky as detectDefaults,Zy as detectMp4,Qy as detectOgv,oa as detectVideoAlphaMode,Jy as detectWebm,e2 as detectWebp,ES as determineCrossOrigin,$2 as displacementFrag,j2 as displacementVert,kd as displacementWgsl,zm as earcut,vf as effectsMixin,cu as ensureAttributes,Jl as ensureIsBuffer,Lp as ensurePrecision,Es as ensureTextOptions,Sn as executeInstructions,G as extensions,iy as extractAttributesFromGlProgram,qp as extractAttributesFromGpuProgram,Hx as extractFontFamilies,ma as extractStructAndGroups,ax as extractSubpaths,Pc as extractSvgUrlId,Hs as fastCopy,Sf as findMixin,li as fontStringFromTextStyle,aB as formatShader,gm as fragmentGPUTemplate,_m as fragmentGlTemplate,V0 as generateArraySyncSTD40,qb as generateArraySyncWGSL,N2 as generateBlurFragSource,V2 as generateBlurGlProgram,W2 as generateBlurProgram,H2 as generateBlurVertSource,nB as generateGPULayout,Jp as generateGpuLayoutGroups,oB as generateLayout,tm as generateLayoutHash,xg as generateParticleUpdateFunction,hy as generateProgram,K0 as generateShaderSyncCode,IB as generateTextStyleKey,Ni as generateTextureBatchBit,Hi as generateTextureBatchBitGl,Jm as generateTextureMatrix,xy as generateUniformsSync,or as getAdjustedBlendModeBlend,ht as getAttributeInfoFromFormat,Vi as getBatchSamplersUniformGroup,as as getBitmapTextLayout,px as getCanvasBoundingBox,ss as getCanvasFillStyle,su as getCanvasTexture,wm as getDefaultUniformValue,mB as getFastGlobalBounds,Af as getFastGlobalBoundsMixin,fC as getFillInstructionData,$x as getFontCss,bS as getFontFamilyName,Mp as getGeometryBounds,M0 as getGlTypeFromFormat,br as getGlobalBounds,wf as getGlobalMixin,B_ as getGlobalRenderableBounds,Ti as getLocalBounds,Up as getMaxFragmentPrecision,Ap as getMaxTexturesPerBatch,Um as getOrientationOfPoints,za as getPo2TextureFromSource,Ts as getResolutionOfUrl,qx as getSVGUrl,Mu as getSupportedCompressedTextureFormats,bd as getSupportedGPUCompressedTextureFormats,xd as getSupportedGlCompressedTextureFormats,Or as getSupportedTextureFormats,Zx as getTemporaryCanvasFromImage,ua as getTestContext,Ii as getTextureBatchBindGroup,PB as getTextureDefaultMatrix,xP as getTextureFormatFromKTXTexture,ny as getUboData,ay as getUniformData,x1 as getUrlExtension,y2 as glFormatToGPUFormat,Cy as glUploadBufferImageResource,Py as glUploadCompressedTextureResource,Tu as glUploadImageResource,Ry as glUploadVideoResource,ym as globalUniformsBit,vm as globalUniformsBitGl,g3 as globalUniformsUBOBitGl,Hw as gpuFormatToBasisTranscoderFormat,bP as gpuFormatToKTXBasisTranscoderFormat,f0 as gpuUploadBufferImageResource,m0 as gpuUploadCompressedTextureResource,fu as gpuUploadImageResource,x0 as gpuUploadVideoResource,Y as groupD8,VC as hasCachedCanvasTexture,iB as hslWgsl,ds as hslgl,fs as hslgpu,sc as injectBits,Hp as insertVersion,Xf as isMobile,Tl as isPow2,n0 as isRenderingToScreen,Lx as isSafari,ei as isSingleItem,Fr as isWebGLSupported,Gr as isWebGPUSupported,Iu as ktxTranscoderUrls,kw as loadBasis,d2 as loadBasisOnWorker,$y as loadBitmapFont,jw as loadDDS,_h as loadEnvironmentExtensions,zx as loadFontAsBase64,Xx as loadFontCSS,vS as loadImageBitmap,r2 as loadJson,uP as loadKTX,dP as loadKTX2,_2 as loadKTX2onWorker,Jx as loadSVGImage,n2 as loadSvg,Pu as loadTextures,i2 as loadTxt,c2 as loadVideoTextures,s2 as loadWebFont,hi as localUniformBit,ls as localUniformBitGl,i_ as localUniformBitGroup2,Tx as localUniformMSDFBit,Sx as localUniformMSDFBitGl,FA as log2,NB as logDebugTexture,ly as logProgramError,lA as logRenderGroupScene,uA as logScene,Ax as mSDFBit,Cx as mSDFBitGl,Iy as mapFormatToGlFormat,ky as mapFormatToGlInternalFormat,Ny as mapFormatToGlType,ry as mapGlToVertexFormat,cB as mapSize,sd as mapType,yy as mapWebGLBlendModesToPixi,eb as maskFrag,rb as maskVert,Mh as maskWgsl,Fe as matrixPool,ja as measureHtmlText,Bf as measureMixin,uB as migrateFragmentFromV7toV8,Dy as mipmapScaleModeToGlFilter,vi as multiplyColors,Wo as multiplyHexColors,rr as nextPow2,K2 as noiseFrag,Ld as noiseWgsl,CS as nonCompressedFormats,Go as normalizeExtensionPriority,Mf as onRenderMixin,g2 as parseDDS,pB as parseFunctionBody,x2 as parseKTX,ex as parseSVGDefinitions,ve as parseSVGFloatAttribute,Fg as parseSVGPath,Bc as parseSVGStyle,Xd as particleData,yg as particlesFrag,Tg as particlesVert,bc as particlesWgsl,S_ as passthroughFrag,qc as passthroughWgsl,Le as path,Kc as pointInTriangle,SS as preloadVideo,No as removeItems,im as removeStructAndGroupDuplicates,BA as resetUids,Dx as resolveCharacters,yP as resolveCompressedTextureUrl,h2 as resolveJsonUrl,Bu as resolveTextureUrl,T1 as resourceToTexture,Yt as roundPixelsBit,$t as roundPixelsBitGl,Kg as roundedShapeArc,Zg as roundedShapeQuadraticCurve,Ab as sayHello,ud as scaleModeToGlFilter,Iw as setBasisTranscoderPath,cP as setKTXTranscoderPath,h_ as setPositions,zp as setProgramName,m_ as setUvs,$i as shapeBuilders,Ff as sortMixin,pp as spritesheetAsset,Zi as squaredDistanceToLineSegment,Xp as stripVersion,ix as styleAttributes,Cu as testImageFormat,Ir as testVideoFormat,J2 as textStyleToCSS,N_ as textureBit,H_ as textureBitGl,S1 as textureFrom,s_ as tilingBit,n_ as tilingBitGl,cr as toFillStyle,Uf as toLocalGlobalMixin,es as toStrokeStyle,qs as transformVertices,Aa as triangulateWithHoles,Hh as uboSyncFunctionsSTD40,jb as uboSyncFunctionsWGSL,W as uid,pr as uniformParsers,aw as unpremultiplyAlpha,eu as unsafeEvalSupported,xB as updateLocalTransform,ia as updateQuadBounds,VT as updateRenderGroupTransform,wh as updateRenderGroupTransforms,tn as updateTextBounds,Y_ as updateTransformAndChildren,zo as updateTransformBackwards,_B as updateWorldTransform,O as v8_0_0,hf as v8_3_4,ku as validFormats,j_ as validateRenderables,mm as vertexGPUTemplate,xm as vertexGlTemplate,v2 as vkFormatToGPUFormat,M as warn,IT as webworkerExt,Su as wrapModeToGlAddress};
|
|
3395
|
+
*/export{Oi as AbstractBitmapFont,br as AbstractRenderer,rs as AbstractSplitText,wr as AbstractText,Th as AccessibilitySystem,oA as AlphaFilter,bs as AlphaMask,cn as AlphaMaskPipe,ja as AnimatedSprite,J2 as Application,un as ApplicationInitHook,Ra as Assets,ac as AssetsClass,Vh as BLEND_TO_NPM,In as BUFFER_TYPE,Sa as BackgroundLoader,cp as BackgroundSystem,Mu as Batch,_o as BatchGeometry,xo as BatchTextureArray,Vr as BatchableGraphics,Yo as BatchableHTMLText,gr as BatchableMesh,zt as BatchableSprite,Fo as BatchableText,jh as Batcher,Nl as BatcherPipe,he as BigPool,He as BindGroup,bn as BindGroupSystem,jn as BitmapFont,ar as BitmapFontManager,ts as BitmapText,ll as BitmapTextGraphics,zs as BitmapTextPipe,$ as BlendModeFilter,fn as BlendModePipe,Rc as BlurFilter,$a as BlurFilterPass,oe as Bounds,Rh as BrowserAdapter,Ee as Buffer,Dr as BufferImageSource,Tr as BufferResource,j as BufferUsage,ze as CLEAR,te as Cache,hi as CanvasObserver,ht as CanvasPool,nl as CanvasPoolClass,$e as CanvasSource,Yr as CanvasTextGenerator,Ce as CanvasTextMetrics,Os as CanvasTextPipe,Vs as CanvasTextSystem,Go as Circle,H as Color,gl as ColorBlend,xl as ColorBurnBlend,_l as ColorDodgeBlend,ys as ColorMask,hn as ColorMaskPipe,xg as ColorMatrixFilter,Xt as CompressedSource,Q as Container,Jm as Culler,mc as CullerPlugin,tn as CustomRenderPipe,Xm as D3D10_RESOURCE_DIMENSION,yt as D3DFMT,cS as DATA_URI,X as DDS,Yc as DEG_TO_RAD,Ic as DEPRECATED_SCALE_MODES,Uc as DEPRECATED_WRAP_MODES,U as DOMAdapter,Bh as DOMContainer,xs as DOMPipe,CA as DRAW_MODES,Wm as DXGI_FORMAT,pt as DXGI_TO_TEXTURE_FORMAT,bl as DarkenBlend,Cs as DefaultBatcher,As as DefaultShader,yl as DifferenceBlend,yg as DisplacementFilter,vl as DivideBlend,al as DynamicBitmapFont,Uo as Ellipse,ao as EventBoundary,fe as EventEmitter,uo as EventSystem,Rt as EventsTicker,Tl as ExclusionBlend,m as ExtensionType,hp as ExtractSystem,dc as FOURCC_TO_TEXTURE_FORMAT,Ph as FederatedContainer,fr as FederatedEvent,Qt as FederatedMouseEvent,et as FederatedPointerEvent,Ut as FederatedWheelEvent,lt as FillGradient,ir as FillPattern,Ve as Filter,qt as FilterEffect,qs as FilterPipe,Ks as FilterSystem,cl as FontStylePromiseCache,Ya as GAUSSIAN_VALUES,pe as GCManagedHash,dp as GCSystem,pa as GL_FORMATS,cv as GL_INTERNAL_FORMAT,ql as GL_TARGETS,ie as GL_TYPES,c2 as GL_WRAP_MODES,$l as GPUTextureGpuData,pn as GenerateTextureSystem,at as Geometry,Wp as GlBackBufferSystem,Un as GlBatchAdaptor,fa as GlBuffer,On as GlBufferSystem,Ln as GlColorMaskSystem,Hp as GlContextSystem,Nn as GlEncoderSystem,Kl as GlGeometryGpuData,kn as GlGeometrySystem,Fn as GlGraphicsAdaptor,Hn as GlLimitsSystem,Gn as GlMeshAdaptor,Po as GlParticleContainerAdaptor,Gs as GlParticleContainerPipe,xe as GlProgram,xa as GlProgramData,ma as GlRenderTarget,ga as GlRenderTargetAdaptor,Wn as GlRenderTargetSystem,Xn as GlShaderSystem,hm as GlStateSystem,Vn as GlStencilSystem,ba as GlTexture,$n as GlTextureSystem,zn as GlUboSystem,Yn as GlUniformGroupSystem,Tt as GlobalResourceRegistry,mn as GlobalUniformSystem,en as GpuBatchAdaptor,st as GpuBlendModesToPixi,zl as GpuBufferData,yn as GpuBufferSystem,vn as GpuColorMaskSystem,$i as GpuDeviceSystem,Tn as GpuEncoderSystem,Qs as GpuGraphicsAdaptor,Yu as GpuGraphicsContext,Sn as GpuLimitsSystem,Js as GpuMeshAdapter,da as GpuMipmapGenerator,Mo as GpuParticleContainerAdaptor,Us as GpuParticleContainerPipe,_e as GpuProgram,la as GpuRenderTarget,ca as GpuRenderTargetAdaptor,Bn as GpuRenderTargetSystem,Rn as GpuShaderSystem,Mn as GpuStateSystem,Wt as GpuStencilModesToPixi,En as GpuStencilSystem,Dn as GpuTextureSystem,Cn as GpuUboSystem,wn as GpuUniformBatchPipe,Ii as Graphics,ke as GraphicsContext,$u as GraphicsContextRenderData,Ri as GraphicsContextSystem,qu as GraphicsGpuData,ct as GraphicsPath,Ds as GraphicsPipe,Qa as HTMLText,Ws as HTMLTextPipe,Li as HTMLTextRenderData,Za as HTMLTextStyle,Xs as HTMLTextSystem,Sl as HardLightBlend,El as HardMixBlend,Yi as HelloSystem,Kp as IGLUniformData,ot as ImageSource,ni as InstructionSet,Pe as KTX,Al as LightenBlend,Cl as LinearBurnBlend,wl as LinearDodgeBlend,Pl as LinearLightBlend,Dm as Loader,Te as LoaderParserPriority,Bl as LuminosityBlend,to as MaskEffectManager,hu as MaskEffectManagerClass,ea as MaskFilter,P as Matrix,Pt as Mesh,dt as MeshGeometry,wo as MeshGpuData,Fs as MeshPipe,Dg as MeshPlane,jA as MeshRope,Gg as MeshSimple,gu as NOOP,Rl as NegationBlend,ur as NineSliceGeometry,Ug as NineSlicePlane,Rv as NineSliceSprite,fl as NineSliceSpriteGpuData,js as NineSliceSpritePipe,hA as NoiseFilter,ce as ObservablePoint,Ml as OverlayBlend,Wc as PI_2,ZA as Particle,Bo as ParticleBuffer,JA as ParticleContainer,Mi as ParticleContainerPipe,Ro as ParticleShader,Zo as PassthroughFilter,zA as PerspectiveMesh,eu as PerspectivePlaneGeometry,Dl as PinLightBlend,Pn as PipelineSystem,Hi as PlaneGeometry,q as Point,Fi as Polygon,Jn as Pool,lu as PoolGroupClass,Tg as PrepareBase,Ka as PrepareQueue,Gc as PrepareSystem,Ja as PrepareUpload,qo as QuadGeometry,Xc as RAD_TO_DEG,V as Rectangle,Pg as RenderContainer,Fr as RenderGroup,sn as RenderGroupPipe,on as RenderGroupSystem,OA as RenderLayer,xn as RenderTarget,Ki as RenderTargetSystem,ta as RenderTexture,gp as RenderableGCSystem,ln as RendererInitHook,ye as RendererType,ms as ResizePlugin,rt as Resolver,Fg as RopeGeometry,Io as RoundedRectangle,PA as SCALE_MODES,ge as STENCIL_MODES,lf as SVGParser,Fl as SaturationBlend,gn as SchedulerSystem,Cg as ScissorMask,Wo as SdfShader,Ae as Shader,vi as ShaderStage,No as ShapePath,sa as SharedRenderPipes,ia as SharedSystems,Gl as SoftLightBlend,i3 as SplitBitmapText,o3 as SplitText,it as Sprite,an as SpritePipe,Au as Spritesheet,Se as State,vs as StencilMask,dn as StencilMaskPipe,Ul as SubtractBlend,Wi as SystemRunner,Ym as TEXTURE_FORMAT_BLOCK_SIZE,Pr as Text,Re as TextStyle,A as Texture,_p as TextureGCSystem,ai as TextureMatrix,le as TexturePool,xu as TexturePoolClass,Z as TextureSource,De as TextureStyle,wg as TextureUvs,be as Ticker,ci as TickerListener,gs as TickerPlugin,Eg as TilingSprite,hl as TilingSpriteGpuData,$s as TilingSpritePipe,jo as TilingSpriteShader,qa as Transform,zf as Triangle,um as UNIFORM_TO_ARRAY_SETTERS,am as UNIFORM_TO_SINGLE_SETTERS,gd as UNIFORM_TYPES_MAP,Lu as UNIFORM_TYPES_VALUES,no as UPDATE_BLEND,ps as UPDATE_COLOR,Je as UPDATE_PRIORITY,m1 as UPDATE_TRANSFORM,ui as UPDATE_VISIBLE,aa as UboBatch,ji as UboSystem,J as UniformGroup,Xi as VERSION,Or as VideoSource,Fe as ViewContainer,vp as ViewSystem,It as ViewableBuffer,Il as VividLightBlend,An as WGSL_ALIGN_SIZE_DATA,Zl as WGSL_TO_STD40_SIZE,wA as WRAP_MODES,rc as WebGLRenderer,jl as WebGPURenderer,iA as WebWorkerAdapter,oc as WorkerManager,Sh as accessibilityTarget,Uu as addBits,mi as addMaskBounds,gi as addMaskLocalBounds,Qh as addProgramDefines,cg as alphaFrag,Bc as alphaWgsl,sl as appendSVGPath,kf as applyMatrix,Bg as applyProjectiveTransformationToPlane,tc as applyStyleParams,fs as assignWithIgnore,nS as autoDetectEnvironment,vm as autoDetectRenderer,z1 as autoDetectSource,Fa as basisTranscoderUrls,Mr as bgr2rgb,Tm as bitmapFontCachePlugin,Ta as bitmapFontTextParser,ic as bitmapFontXMLParser,sc as bitmapFontXMLStringParser,Ig as bitmapTextSplit,Xf as blendTemplateFrag,Yf as blendTemplateVert,$f as blendTemplateWgsl,Yl as blockDataMap,pg as blurTemplateWgsl,xt as boundsPool,k0 as browserExt,ko as buildAdaptiveBezier,Kd as buildAdaptiveQuadratic,Lo as buildArc,Qd as buildArcTo,Jd as buildArcToSvg,Pi as buildCircle,kd as buildContextBatches,Td as buildEllipse,GA as buildGeometryFromPath,wd as buildLine,Pd as buildPixelLine,Gd as buildPolygon,Ud as buildRectangle,Sd as buildRoundedRectangle,Eo as buildSimpleUvs,Id as buildTriangle,So as buildUvs,qc as cacheAsTextureMixin,Em as cacheTextureArray,uf as calculatePathArea,Gp as calculateProjection,kg as canvasTextSplit,fu as checkChildrenDidChange,Et as checkDataUrl,we as checkExtension,of as checkForNestedPattern,mo as checkMaxIfStatementsInShader,Zc as childrenHelperMixin,mp as cleanArray,pp as cleanHash,nn as clearList,Ed as closePointEps,MA as collectAllRenderables,Qc as collectRenderablesMixin,Vt as color32BitToUniform,Si as colorBit,Ei as colorBitGl,gg as colorMatrixFilterFrag,Mc as colorMatrixFilterWgsl,vT as colorToUniform,xm as compareModeToGlCompare,ud as compileHighShader,ld as compileHighShaderGl,kt as compileHighShaderGlProgram,Ot as compileHighShaderGpuProgram,Iu as compileHooks,Ou as compileInputs,ad as compileOutputs,Ql as compileShader,Mg as compute2DProjection,rE as convertFormatIfRequired,tt as convertToList,_s as copySearchParams,rr as createIdFromString,Zu as createIndicesForQuads,$S as createLevelBuffers,iE as createLevelBuffersFromKTX,Mh as createStringVariations,ft as createTexture,Xp as createUboElementsSTD40,Ep as createUboElementsWGSL,na as createUboSyncFunction,jp as createUboSyncFunctionSTD40,Mp as createUboSyncFunctionWGSL,ov as crossOrigin,zc as cullingMixin,Ad as curveEps,B_e as default,_r as defaultFilterVert,_a as defaultValue,Ye as definedProps,w as deprecation,Am as detectAvif,zS as detectBasis,aE as detectCompressed,Cm as detectDefaults,wm as detectMp4,Pm as detectOgv,ho as detectVideoAlphaMode,Bm as detectWebm,Rm as detectWebp,uv as determineCrossOrigin,_g as displacementFrag,bg as displacementVert,Dc as displacementWgsl,Dd as earcut,Jc as effectsMixin,ua as ensureAttributes,Du as ensureIsBuffer,Jh as ensurePrecision,es as ensureTextOptions,rn as executeInstructions,G as extensions,tm as extractAttributesFromGlProgram,id as extractAttributesFromGpuProgram,Cf as extractFontFamilies,yo as extractStructAndGroups,af as extractSubpaths,rl as extractSvgUrlId,Es as fastCopy,eh as findMixin,Wr as fontStringFromTextStyle,TA as formatShader,hd as fragmentGPUTemplate,fd as fragmentGlTemplate,$p as generateArraySyncSTD40,Rp as generateArraySyncWGSL,hg as generateBlurFragSource,fg as generateBlurGlProgram,mg as generateBlurProgram,dg as generateBlurVertSource,yA as generateGPULayout,sd as generateGpuLayoutGroups,vA as generateLayout,nd as generateLayoutHash,Nd as generateParticleUpdateFunction,nm as generateProgram,qp as generateShaderSyncCode,u3 as generateTextStyleKey,Ai as generateTextureBatchBit,Ci as generateTextureBatchBitGl,Od as generateTextureMatrix,lm as generateUniformsSync,tr as getAdjustedBlendModeBlend,ut as getAttributeInfoFromFormat,wi as getBatchSamplersUniformGroup,ki as getBitmapTextLayout,df as getCanvasBoundingBox,Ui as getCanvasFillStyle,ra as getCanvasTexture,xd as getDefaultUniformValue,RA as getFastGlobalBounds,rh as getFastGlobalBoundsMixin,RT as getFillInstructionData,Bf as getFontCss,ev as getFontFamilyName,qh as getGeometryBounds,zp as getGlTypeFromFormat,hr as getGlobalBounds,nh as getGlobalMixin,Wf as getGlobalRenderableBounds,si as getLocalBounds,Zh as getMaxFragmentPrecision,Yh as getMaxTexturesPerBatch,Cd as getOrientationOfPoints,zo as getPo2TextureFromSource,Zi as getResolutionOfUrl,Rf as getSVGUrl,Ma as getSupportedCompressedTextureFormats,lc as getSupportedGPUCompressedTextureFormats,uc as getSupportedGlCompressedTextureFormats,Er as getSupportedTextureFormats,Mf as getTemporaryCanvasFromImage,po as getTestContext,xi as getTextureBatchBindGroup,qA as getTextureDefaultMatrix,sE as getTextureFormatFromKTXTexture,rm as getUboData,im as getUniformData,Ox as getUrlExtension,Km as glFormatToGPUFormat,dm as glUploadBufferImageResource,fm as glUploadCompressedTextureResource,ya as glUploadImageResource,mm as glUploadVideoResource,pd as globalUniformsBit,md as globalUniformsBitGl,rT as globalUniformsUBOBitGl,jS as gpuFormatToBasisTranscoderFormat,nE as gpuFormatToKTXBasisTranscoderFormat,Op as gpuUploadBufferImageResource,kp as gpuUploadCompressedTextureResource,ha as gpuUploadImageResource,Np as gpuUploadVideoResource,Y as groupD8,bS as hasCachedCanvasTexture,dA as hslWgsl,Vi as hslgl,zi as hslgpu,ku as injectBits,ed as insertVersion,vh as isMobile,pu as isPow2,Up as isRenderingToScreen,Ef as isSafari,Ir as isSingleItem,yr as isWebGLSupported,vr as isWebGPUSupported,Ua as ktxTranscoderUrls,YS as loadBasis,zm as loadBasisOnWorker,Sm as loadBitmapFont,qS as loadDDS,Ol as loadEnvironmentExtensions,wf as loadFontAsBase64,Pf as loadFontCSS,iv as loadImageBitmap,Fm as loadJson,KS as loadKTX,eE as loadKTX2,qm as loadKTX2onWorker,Df as loadSVGImage,Im as loadSvg,Pa as loadTextures,Gm as loadTxt,Om as loadVideoTextures,Um as loadWebFont,jr as localUniformBit,Ni as localUniformBitGl,Gf as localUniformBitGroup2,xf as localUniformMSDFBit,_f as localUniformMSDFBitGl,a1 as log2,c3 as logDebugTexture,sm as logProgramError,Dv as logRenderGroupScene,Mv as logScene,bf as mSDFBit,yf as mSDFBitGl,_m as mapFormatToGlFormat,bm as mapFormatToGlInternalFormat,ym as mapFormatToGlType,Jp as mapGlToVertexFormat,EA as mapSize,Jl as mapType,cm as mapWebGLBlendModesToPixi,up as maskFrag,lp as maskVert,Hl as maskWgsl,Me as matrixPool,$o as measureHtmlText,ah as measureMixin,SA as migrateFragmentFromV7toV8,gm as mipmapScaleModeToGlFilter,ii as multiplyColors,io as multiplyHexColors,Kt as nextPow2,vg as noiseFrag,Fc as noiseWgsl,lv as nonCompressedFormats,Kn as normalizeExtensionPriority,uh as onRenderMixin,$m as parseDDS,BA as parseFunctionBody,jm as parseKTX,sf as parseSVGDefinitions,ve as parseSVGFloatAttribute,Xd as parseSVGPath,il as parseSVGStyle,Oc as particleData,Hd as particlesFrag,Vd as particlesVert,Qu as particlesWgsl,Vf as passthroughFrag,pl as passthroughWgsl,Ie as path,ml as pointInTriangle,av as preloadVideo,eo as removeItems,od as removeStructAndGroupDuplicates,e1 as resetUids,Tf as resolveCharacters,oE as resolveCompressedTextureUrl,km as resolveJsonUrl,Ba as resolveTextureUrl,$x as resourceToTexture,Lt as roundPixelsBit,Nt as roundPixelsBitGl,ef as roundedShapeArc,tf as roundedShapeQuadraticCurve,fp as sayHello,ec as scaleModeToGlFilter,WS as setBasisTranscoderPath,ZS as setKTXTranscoderPath,Of as setPositions,td as setProgramName,Lf as setUvs,Bi as shapeBuilders,lh as sortMixin,Fh as spritesheetAsset,Di as squaredDistanceToLineSegment,rd as stripVersion,nf as styleAttributes,Ea as testImageFormat,Sr as testVideoFormat,Ag as textStyleToCSS,Qf as textureBit,Jf as textureBitGl,jx as textureFrom,Uf as tilingBit,If as tilingBitGl,sr as toFillStyle,ch as toLocalGlobalMixin,Gi as toStrokeStyle,ws as transformVertices,Co as triangulateWithHoles,Wl as uboSyncFunctionsSTD40,Pp as uboSyncFunctionsWGSL,W as uid,cr as uniformParsers,MS as unpremultiplyAlpha,Qo as unsafeEvalSupported,DA as updateLocalTransform,co as updateQuadBounds,$0 as updateRenderGroupTransform,Ll as updateRenderGroupTransforms,Is as updateTextBounds,sp as updateTransformAndChildren,ro as updateTransformBackwards,FA as updateWorldTransform,O as v8_0_0,jc as v8_3_4,Ia as validFormats,np as validateRenderables,cd as vertexGPUTemplate,dd as vertexGlTemplate,Zm as vkFormatToGPUFormat,R as warn,L0 as webworkerExt,va as wrapModeToGlAddress};
|