vizor_2d 1.1.8 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/vizor_2d.min.js +1 -1
- package/package.json +1 -1
package/dist/vizor_2d.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see vizor_2d.min.js.LICENSE.txt */
|
|
2
|
-
var t,e,r={8133:t=>{t.exports=function(t){var i=[];return t.replace(r,(function(t,r,s){var o=r.toLowerCase();for(s=function(t){var e=t.match(n);return e?e.map(Number):[]}(s),"m"==o&&s.length>2&&(i.push([r].concat(s.splice(0,2))),o="l",r="m"==r?"l":"L");;){if(s.length==e[o])return s.unshift(r),i.push(s);if(s.length<e[o])throw new Error("malformed path data");i.push([r].concat(s.splice(0,e[o])))}})),i};var e={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},r=/([astvzqmhlc])([^astvzqmhlc]*)/gi;var n=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi},5585:t=>{var e=Object.prototype.hasOwnProperty,r="~";function n(){}function i(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function s(t,e,n,s,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new i(n,s||t,o),h=r?r+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],a]:t._events[h].push(a):(t._events[h]=a,t._eventsCount++),t}function o(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),a.prototype.eventNames=function(){var t,n,i=[];if(0===this._eventsCount)return i;for(n in t=this._events)e.call(t,n)&&i.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},a.prototype.listeners=function(t){var e=r?r+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,s=n.length,o=new Array(s);i<s;i++)o[i]=n[i].fn;return o},a.prototype.listenerCount=function(t){var e=r?r+t:t,n=this._events[e];return n?n.fn?1:n.length:0},a.prototype.emit=function(t,e,n,i,s,o){var a=r?r+t:t;if(!this._events[a])return!1;var h,l,u=this._events[a],c=arguments.length;if(u.fn){switch(u.once&&this.removeListener(t,u.fn,void 0,!0),c){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,e),!0;case 3:return u.fn.call(u.context,e,n),!0;case 4:return u.fn.call(u.context,e,n,i),!0;case 5:return u.fn.call(u.context,e,n,i,s),!0;case 6:return u.fn.call(u.context,e,n,i,s,o),!0}for(l=1,h=new Array(c-1);l<c;l++)h[l-1]=arguments[l];u.fn.apply(u.context,h)}else{var d,f=u.length;for(l=0;l<f;l++)switch(u[l].once&&this.removeListener(t,u[l].fn,void 0,!0),c){case 1:u[l].fn.call(u[l].context);break;case 2:u[l].fn.call(u[l].context,e);break;case 3:u[l].fn.call(u[l].context,e,n);break;case 4:u[l].fn.call(u[l].context,e,n,i);break;default:if(!h)for(d=1,h=new Array(c-1);d<c;d++)h[d-1]=arguments[d];u[l].fn.apply(u[l].context,h)}}return!0},a.prototype.on=function(t,e,r){return s(this,t,e,r,!1)},a.prototype.once=function(t,e,r){return s(this,t,e,r,!0)},a.prototype.removeListener=function(t,e,n,i){var s=r?r+t:t;if(!this._events[s])return this;if(!e)return o(this,s),this;var a=this._events[s];if(a.fn)a.fn!==e||i&&!a.once||n&&a.context!==n||o(this,s);else{for(var h=0,l=[],u=a.length;h<u;h++)(a[h].fn!==e||i&&!a[h].once||n&&a[h].context!==n)&&l.push(a[h]);l.length?this._events[s]=1===l.length?l[0]:l:o(this,s)}return this},a.prototype.removeAllListeners=function(t){var e;return t?(e=r?r+t:t,this._events[e]&&o(this,e)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=r,a.EventEmitter=a,t.exports=a},2406:(t,e,r)=>{r.d(e,{z:()=>n});const n=(t,e,r=!1)=>(Array.isArray(t)||(t=[t]),e?t.map((t=>"string"==typeof t||r?e(t):t)):t)},2577:(t,e,r)=>{r.d(e,{Q:()=>I});var n={grad:.9,turn:360,rad:360/(2*Math.PI)},i=function(t){return"string"==typeof t?t.length>0:"number"==typeof t},s=function(t,e,r){return void 0===e&&(e=0),void 0===r&&(r=Math.pow(10,e)),Math.round(r*t)/r+0},o=function(t,e,r){return void 0===e&&(e=0),void 0===r&&(r=1),t>r?r:t>e?t:e},a=function(t){return(t=isFinite(t)?t%360:0)>0?t:t+360},h=function(t){return{r:o(t.r,0,255),g:o(t.g,0,255),b:o(t.b,0,255),a:o(t.a)}},l=function(t){return{r:s(t.r),g:s(t.g),b:s(t.b),a:s(t.a,3)}},u=/^#([0-9a-f]{3,8})$/i,c=function(t){var e=t.toString(16);return e.length<2?"0"+e:e},d=function(t){var e=t.r,r=t.g,n=t.b,i=t.a,s=Math.max(e,r,n),o=s-Math.min(e,r,n),a=o?s===e?(r-n)/o:s===r?2+(n-e)/o:4+(e-r)/o:0;return{h:60*(a<0?a+6:a),s:s?o/s*100:0,v:s/255*100,a:i}},f=function(t){var e=t.h,r=t.s,n=t.v,i=t.a;e=e/360*6,r/=100,n/=100;var s=Math.floor(e),o=n*(1-r),a=n*(1-(e-s)*r),h=n*(1-(1-e+s)*r),l=s%6;return{r:255*[n,a,o,o,h,n][l],g:255*[h,n,n,a,o,o][l],b:255*[o,o,h,n,n,a][l],a:i}},p=function(t){return{h:a(t.h),s:o(t.s,0,100),l:o(t.l,0,100),a:o(t.a)}},y=function(t){return{h:s(t.h),s:s(t.s),l:s(t.l),a:s(t.a,3)}},m=function(t){return f((r=(e=t).s,{h:e.h,s:(r*=((n=e.l)<50?n:100-n)/100)>0?2*r/(n+r)*100:0,v:n+r,a:e.a}));var e,r,n},g=function(t){return{h:(e=d(t)).h,s:(i=(200-(r=e.s))*(n=e.v)/100)>0&&i<200?r*n/100/(i<=100?i:200-i)*100:0,l:i/2,a:e.a};var e,r,n,i},x=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,v=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,b=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,_=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,w={string:[[function(t){var e=u.exec(t);return e?(t=e[1]).length<=4?{r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16),a:4===t.length?s(parseInt(t[3]+t[3],16)/255,2):1}:6===t.length||8===t.length?{r:parseInt(t.substr(0,2),16),g:parseInt(t.substr(2,2),16),b:parseInt(t.substr(4,2),16),a:8===t.length?s(parseInt(t.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(t){var e=b.exec(t)||_.exec(t);return e?e[2]!==e[4]||e[4]!==e[6]?null:h({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:void 0===e[7]?1:Number(e[7])/(e[8]?100:1)}):null},"rgb"],[function(t){var e=x.exec(t)||v.exec(t);if(!e)return null;var r,i,s=p({h:(r=e[1],i=e[2],void 0===i&&(i="deg"),Number(r)*(n[i]||1)),s:Number(e[3]),l:Number(e[4]),a:void 0===e[5]?1:Number(e[5])/(e[6]?100:1)});return m(s)},"hsl"]],object:[[function(t){var e=t.r,r=t.g,n=t.b,s=t.a,o=void 0===s?1:s;return i(e)&&i(r)&&i(n)?h({r:Number(e),g:Number(r),b:Number(n),a:Number(o)}):null},"rgb"],[function(t){var e=t.h,r=t.s,n=t.l,s=t.a,o=void 0===s?1:s;if(!i(e)||!i(r)||!i(n))return null;var a=p({h:Number(e),s:Number(r),l:Number(n),a:Number(o)});return m(a)},"hsl"],[function(t){var e=t.h,r=t.s,n=t.v,s=t.a,h=void 0===s?1:s;if(!i(e)||!i(r)||!i(n))return null;var l=function(t){return{h:a(t.h),s:o(t.s,0,100),v:o(t.v,0,100),a:o(t.a)}}({h:Number(e),s:Number(r),v:Number(n),a:Number(h)});return f(l)},"hsv"]]},S=function(t,e){for(var r=0;r<e.length;r++){var n=e[r][0](t);if(n)return[n,e[r][1]]}return[null,void 0]},C=function(t){return"string"==typeof t?S(t.trim(),w.string):"object"==typeof t&&null!==t?S(t,w.object):[null,void 0]},M=function(t,e){var r=g(t);return{h:r.h,s:o(r.s+100*e,0,100),l:r.l,a:r.a}},T=function(t){return(299*t.r+587*t.g+114*t.b)/1e3/255},A=function(t,e){var r=g(t);return{h:r.h,s:r.s,l:o(r.l+100*e,0,100),a:r.a}},k=function(){function t(t){this.parsed=C(t)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return t.prototype.isValid=function(){return null!==this.parsed},t.prototype.brightness=function(){return s(T(this.rgba),2)},t.prototype.isDark=function(){return T(this.rgba)<.5},t.prototype.isLight=function(){return T(this.rgba)>=.5},t.prototype.toHex=function(){return e=(t=l(this.rgba)).r,r=t.g,n=t.b,o=(i=t.a)<1?c(s(255*i)):"","#"+c(e)+c(r)+c(n)+o;var t,e,r,n,i,o},t.prototype.toRgb=function(){return l(this.rgba)},t.prototype.toRgbString=function(){return e=(t=l(this.rgba)).r,r=t.g,n=t.b,(i=t.a)<1?"rgba("+e+", "+r+", "+n+", "+i+")":"rgb("+e+", "+r+", "+n+")";var t,e,r,n,i},t.prototype.toHsl=function(){return y(g(this.rgba))},t.prototype.toHslString=function(){return e=(t=y(g(this.rgba))).h,r=t.s,n=t.l,(i=t.a)<1?"hsla("+e+", "+r+"%, "+n+"%, "+i+")":"hsl("+e+", "+r+"%, "+n+"%)";var t,e,r,n,i},t.prototype.toHsv=function(){return t=d(this.rgba),{h:s(t.h),s:s(t.s),v:s(t.v),a:s(t.a,3)};var t},t.prototype.invert=function(){return P({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},t.prototype.saturate=function(t){return void 0===t&&(t=.1),P(M(this.rgba,t))},t.prototype.desaturate=function(t){return void 0===t&&(t=.1),P(M(this.rgba,-t))},t.prototype.grayscale=function(){return P(M(this.rgba,-1))},t.prototype.lighten=function(t){return void 0===t&&(t=.1),P(A(this.rgba,t))},t.prototype.darken=function(t){return void 0===t&&(t=.1),P(A(this.rgba,-t))},t.prototype.rotate=function(t){return void 0===t&&(t=15),this.hue(this.hue()+t)},t.prototype.alpha=function(t){return"number"==typeof t?P({r:(e=this.rgba).r,g:e.g,b:e.b,a:t}):s(this.rgba.a,3);var e},t.prototype.hue=function(t){var e=g(this.rgba);return"number"==typeof t?P({h:t,s:e.s,l:e.l,a:e.a}):s(e.h)},t.prototype.isEqual=function(t){return this.toHex()===P(t).toHex()},t}(),P=function(t){return t instanceof k?t:new k(t)},E=[];!function(t){t.forEach((function(t){E.indexOf(t)<0&&(t(k,w),E.push(t))}))}([function(t,e){var r={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"},n={};for(var i in r)n[r[i]]=i;var s={};t.prototype.toName=function(e){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var i,o,a=n[this.toHex()];if(a)return a;if(null==e?void 0:e.closest){var h=this.toRgb(),l=1/0,u="black";if(!s.length)for(var c in r)s[c]=new t(r[c]).toRgb();for(var d in r){var f=(i=h,o=s[d],Math.pow(i.r-o.r,2)+Math.pow(i.g-o.g,2)+Math.pow(i.b-o.b,2));f<l&&(l=f,u=d)}return u}},e.string.push([function(e){var n=e.toLowerCase(),i="transparent"===n?"#0000":r[n];return i?new t(i).toRgb():null},"name"])}]);const R=class t{constructor(t=16777215){this._value=null,this._components=new Float32Array(4),this._components.fill(1),this._int=16777215,this.value=t}get red(){return this._components[0]}get green(){return this._components[1]}get blue(){return this._components[2]}get alpha(){return this._components[3]}setValue(t){return this.value=t,this}set value(e){if(e instanceof t)this._value=this._cloneSource(e._value),this._int=e._int,this._components.set(e._components);else{if(null===e)throw new Error("Cannot set Color#value to null");null!==this._value&&this._isSourceEqual(this._value,e)||(this._value=this._cloneSource(e),this._normalize(this._value))}}get value(){return this._value}_cloneSource(t){return"string"==typeof t||"number"==typeof t||t instanceof Number||null===t?t:Array.isArray(t)||ArrayBuffer.isView(t)?t.slice(0):"object"==typeof t&&null!==t?{...t}:t}_isSourceEqual(t,e){const r=typeof t;if(r!==typeof e)return!1;if("number"===r||"string"===r||t instanceof Number)return t===e;if(Array.isArray(t)&&Array.isArray(e)||ArrayBuffer.isView(t)&&ArrayBuffer.isView(e))return t.length===e.length&&t.every(((t,r)=>t===e[r]));if(null!==t&&null!==e){const r=Object.keys(t),n=Object.keys(e);return r.length===n.length&&r.every((r=>t[r]===e[r]))}return t===e}toRgba(){const[t,e,r,n]=this._components;return{r:t,g:e,b:r,a:n}}toRgb(){const[t,e,r]=this._components;return{r:t,g:e,b:r}}toRgbaString(){const[t,e,r]=this.toUint8RgbArray();return`rgba(${t},${e},${r},${this.alpha})`}toUint8RgbArray(t){const[e,r,n]=this._components;return this._arrayRgb||(this._arrayRgb=[]),t||(t=this._arrayRgb),t[0]=Math.round(255*e),t[1]=Math.round(255*r),t[2]=Math.round(255*n),t}toArray(t){this._arrayRgba||(this._arrayRgba=[]),t||(t=this._arrayRgba);const[e,r,n,i]=this._components;return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}toRgbArray(t){this._arrayRgb||(this._arrayRgb=[]),t||(t=this._arrayRgb);const[e,r,n]=this._components;return t[0]=e,t[1]=r,t[2]=n,t}toNumber(){return this._int}toBgrNumber(){const[t,e,r]=this.toUint8RgbArray();return(r<<16)+(e<<8)+t}toLittleEndianNumber(){const t=this._int;return(t>>16)+(65280&t)+((255&t)<<16)}multiply(e){const[r,n,i,s]=t._temp.setValue(e)._components;return this._components[0]*=r,this._components[1]*=n,this._components[2]*=i,this._components[3]*=s,this._refreshInt(),this._value=null,this}premultiply(t,e=!0){return e&&(this._components[0]*=t,this._components[1]*=t,this._components[2]*=t),this._components[3]=t,this._refreshInt(),this._value=null,this}toPremultiplied(t,e=!0){if(1===t)return(255<<24)+this._int;if(0===t)return e?0:this._int;let r=this._int>>16&255,n=this._int>>8&255,i=255&this._int;return e&&(r=r*t+.5|0,n=n*t+.5|0,i=i*t+.5|0),(255*t<<24)+(r<<16)+(n<<8)+i}toHex(){const t=this._int.toString(16);return`#${"000000".substring(0,6-t.length)+t}`}toHexa(){const t=Math.round(255*this._components[3]).toString(16);return this.toHex()+"00".substring(0,2-t.length)+t}setAlpha(t){return this._components[3]=this._clamp(t),this._value=null,this}_normalize(e){let r,n,i,s;if(("number"==typeof e||e instanceof Number)&&e>=0&&e<=16777215){r=(e>>16&255)/255,n=(e>>8&255)/255,i=(255&e)/255,s=1}else if((Array.isArray(e)||e instanceof Float32Array)&&e.length>=3&&e.length<=4)e=this._clamp(e),[r,n,i,s=1]=e;else if((e instanceof Uint8Array||e instanceof Uint8ClampedArray)&&e.length>=3&&e.length<=4)e=this._clamp(e,0,255),[r,n,i,s=255]=e,r/=255,n/=255,i/=255,s/=255;else if("string"==typeof e||"object"==typeof e){if("string"==typeof e){const r=t.HEX_PATTERN.exec(e);r&&(e=`#${r[2]}`)}const o=P(e);o.isValid()&&(({r,g:n,b:i,a:s}=o.rgba),r/=255,n/=255,i/=255)}if(void 0===r)throw new Error(`Unable to convert color ${e}`);this._components[0]=r,this._components[1]=n,this._components[2]=i,this._components[3]=s,this._refreshInt()}_refreshInt(){this._clamp(this._components);const[t,e,r]=this._components;this._int=(255*t<<16)+(255*e<<8)+(255*r|0)}_clamp(t,e=0,r=1){return"number"==typeof t?Math.min(Math.max(t,e),r):(t.forEach(((n,i)=>{t[i]=Math.min(Math.max(n,e),r)})),t)}static isColorLike(e){return"number"==typeof e||"string"==typeof e||e instanceof Number||e instanceof t||Array.isArray(e)||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Float32Array||void 0!==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}};R.shared=new R,R._temp=new R,R.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;let I=R},1761:(t,e,r)=>{r.d(e,{e:()=>i});let n={createCanvas:(t,e)=>{const r=document.createElement("canvas");return r.width=t,r.height=e,r},createImage:()=>new Image,getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(t,e)=>fetch(t,e),parseXML:t=>(new DOMParser).parseFromString(t,"text/xml")};const i={get:()=>n,set(t){n=t}}},8507:(t,e,r)=>{r.d(e,{Ag:()=>n,XO:()=>o});var n=(t=>(t.Application="application",t.WebGLPipes="webgl-pipes",t.WebGLPipesAdaptor="webgl-pipes-adaptor",t.WebGLSystem="webgl-system",t.WebGPUPipes="webgpu-pipes",t.WebGPUPipesAdaptor="webgpu-pipes-adaptor",t.WebGPUSystem="webgpu-system",t.CanvasSystem="canvas-system",t.CanvasPipesAdaptor="canvas-pipes-adaptor",t.CanvasPipes="canvas-pipes",t.Asset="asset",t.LoadParser="load-parser",t.ResolveParser="resolve-parser",t.CacheParser="cache-parser",t.DetectionParser="detection-parser",t.MaskEffect="mask-effect",t.BlendMode="blend-mode",t.TextureSource="texture-source",t.Environment="environment",t.ShapeBuilder="shape-builder",t.Batcher="batcher",t))(n||{});const i=t=>{if("function"==typeof t||"object"==typeof t&&t.extension){if(!t.extension)throw new Error("Extension class must have an extension object");t={..."object"!=typeof t.extension?{type:t.extension}:t.extension,ref:t}}if("object"!=typeof t)throw new Error("Invalid extension type");return"string"==typeof(t={...t}).type&&(t.type=[t.type]),t},s=(t,e)=>i(t).priority??e,o={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...t){return t.map(i).forEach((t=>{t.type.forEach((e=>this._removeHandlers[e]?.(t)))})),this},add(...t){return t.map(i).forEach((t=>{t.type.forEach((e=>{const r=this._addHandlers,n=this._queue;r[e]?r[e]?.(t):(n[e]=n[e]||[],n[e]?.push(t))}))})),this},handle(t,e,r){const n=this._addHandlers,i=this._removeHandlers;if(n[t]||i[t])throw new Error(`Extension type ${t} already has a handler`);n[t]=e,i[t]=r;const s=this._queue;return s[t]&&(s[t]?.forEach((t=>e(t))),delete s[t]),this},handleByMap(t,e){return this.handle(t,(t=>{t.name&&(e[t.name]=t.ref)}),(t=>{t.name&&delete e[t.name]}))},handleByNamedList(t,e,r=-1){return this.handle(t,(t=>{e.findIndex((e=>e.name===t.name))>=0||(e.push({name:t.name,value:t.ref}),e.sort(((t,e)=>s(e.value,r)-s(t.value,r))))}),(t=>{const r=e.findIndex((e=>e.name===t.name));-1!==r&&e.splice(r,1)}))},handleByList(t,e,r=-1){return this.handle(t,(t=>{e.includes(t.ref)||(e.push(t.ref),e.sort(((t,e)=>s(e,r)-s(t,r))))}),(t=>{const r=e.indexOf(t.ref);-1!==r&&e.splice(r,1)}))},mixin(t,...e){for(const r of e)Object.defineProperties(t.prototype,Object.getOwnPropertyDescriptors(r))}}},9049:(t,e,r)=>{r.d(e,{a:()=>n});class n{constructor(){this.pipe="filter",this.priority=1}destroy(){for(let t=0;t<this.filters.length;t++)this.filters[t].destroy();this.filters=null,this.filterArea=null}}},9313:(t,e,r)=>{r.d(e,{u:()=>s});var n=r(1652),i=r(5101);class s{constructor(t=1,e=0,r=0,n=1,i=0,s=0){this.array=null,this.a=t,this.b=e,this.c=r,this.d=n,this.tx=i,this.ty=s}fromArray(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]}set(t,e,r,n,i,s){return this.a=t,this.b=e,this.c=r,this.d=n,this.tx=i,this.ty=s,this}toArray(t,e){this.array||(this.array=new Float32Array(9));const r=e||this.array;return t?(r[0]=this.a,r[1]=this.b,r[2]=0,r[3]=this.c,r[4]=this.d,r[5]=0,r[6]=this.tx,r[7]=this.ty,r[8]=1):(r[0]=this.a,r[1]=this.c,r[2]=this.tx,r[3]=this.b,r[4]=this.d,r[5]=this.ty,r[6]=0,r[7]=0,r[8]=1),r}apply(t,e){e=e||new i.b;const r=t.x,n=t.y;return e.x=this.a*r+this.c*n+this.tx,e.y=this.b*r+this.d*n+this.ty,e}applyInverse(t,e){e=e||new i.b;const r=this.a,n=this.b,s=this.c,o=this.d,a=this.tx,h=this.ty,l=1/(r*o+s*-n),u=t.x,c=t.y;return e.x=o*l*u+-s*l*c+(h*s-a*o)*l,e.y=r*l*c+-n*l*u+(-h*r+a*n)*l,e}translate(t,e){return this.tx+=t,this.ty+=e,this}scale(t,e){return this.a*=t,this.d*=e,this.c*=t,this.b*=e,this.tx*=t,this.ty*=e,this}rotate(t){const e=Math.cos(t),r=Math.sin(t),n=this.a,i=this.c,s=this.tx;return this.a=n*e-this.b*r,this.b=n*r+this.b*e,this.c=i*e-this.d*r,this.d=i*r+this.d*e,this.tx=s*e-this.ty*r,this.ty=s*r+this.ty*e,this}append(t){const e=this.a,r=this.b,n=this.c,i=this.d;return this.a=t.a*e+t.b*n,this.b=t.a*r+t.b*i,this.c=t.c*e+t.d*n,this.d=t.c*r+t.d*i,this.tx=t.tx*e+t.ty*n+this.tx,this.ty=t.tx*r+t.ty*i+this.ty,this}appendFrom(t,e){const r=t.a,n=t.b,i=t.c,s=t.d,o=t.tx,a=t.ty,h=e.a,l=e.b,u=e.c,c=e.d;return this.a=r*h+n*u,this.b=r*l+n*c,this.c=i*h+s*u,this.d=i*l+s*c,this.tx=o*h+a*u+e.tx,this.ty=o*l+a*c+e.ty,this}setTransform(t,e,r,n,i,s,o,a,h){return this.a=Math.cos(o+h)*i,this.b=Math.sin(o+h)*i,this.c=-Math.sin(o-a)*s,this.d=Math.cos(o-a)*s,this.tx=t-(r*this.a+n*this.c),this.ty=e-(r*this.b+n*this.d),this}prepend(t){const e=this.tx;if(1!==t.a||0!==t.b||0!==t.c||1!==t.d){const e=this.a,r=this.c;this.a=e*t.a+this.b*t.c,this.b=e*t.b+this.b*t.d,this.c=r*t.a+this.d*t.c,this.d=r*t.b+this.d*t.d}return this.tx=e*t.a+this.ty*t.c+t.tx,this.ty=e*t.b+this.ty*t.d+t.ty,this}decompose(t){const e=this.a,r=this.b,i=this.c,s=this.d,o=t.pivot,a=-Math.atan2(-i,s),h=Math.atan2(r,e),l=Math.abs(a+h);return l<1e-5||Math.abs(n.TO-l)<1e-5?(t.rotation=h,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=a,t.skew.y=h),t.scale.x=Math.sqrt(e*e+r*r),t.scale.y=Math.sqrt(i*i+s*s),t.position.x=this.tx+(o.x*e+o.y*i),t.position.y=this.ty+(o.x*r+o.y*s),t}invert(){const t=this.a,e=this.b,r=this.c,n=this.d,i=this.tx,s=t*n-e*r;return this.a=n/s,this.b=-e/s,this.c=-r/s,this.d=t/s,this.tx=(r*this.ty-n*i)/s,this.ty=-(t*this.ty-e*i)/s,this}isIdentity(){return 1===this.a&&0===this.b&&0===this.c&&1===this.d&&0===this.tx&&0===this.ty}identity(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this}clone(){const t=new s;return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t}copyTo(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t}copyFrom(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this}equals(t){return t.a===this.a&&t.b===this.b&&t.c===this.c&&t.d===this.d&&t.tx===this.tx&&t.ty===this.ty}toString(){return`[pixi.js:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`}static get IDENTITY(){return a.identity()}static get shared(){return o.identity()}}const o=new s,a=new s},2079:(t,e,r)=>{r.d(e,{E:()=>c});var n=r(9313);const i=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],s=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],o=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],a=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],h=[],l=[],u=Math.sign;!function(){for(let t=0;t<16;t++){const e=[];h.push(e);for(let r=0;r<16;r++){const n=u(i[t]*i[r]+o[t]*s[r]),h=u(s[t]*i[r]+a[t]*s[r]),l=u(i[t]*o[r]+o[t]*a[r]),c=u(s[t]*o[r]+a[t]*a[r]);for(let t=0;t<16;t++)if(i[t]===n&&s[t]===h&&o[t]===l&&a[t]===c){e.push(t);break}}}for(let t=0;t<16;t++){const e=new n.u;e.set(i[t],s[t],o[t],a[t],0,0),l.push(e)}}();const c={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:t=>i[t],uY:t=>s[t],vX:t=>o[t],vY:t=>a[t],inv:t=>8&t?15&t:7&-t,add:(t,e)=>h[t][e],sub:(t,e)=>h[t][c.inv(e)],rotate180:t=>4^t,isVertical:t=>2==(3&t),byDirection:(t,e)=>2*Math.abs(t)<=Math.abs(e)?e>=0?c.S:c.N:2*Math.abs(e)<=Math.abs(t)?t>0?c.E:c.W:e>0?t>0?c.SE:c.SW:t>0?c.NE:c.NW,matrixAppendRotationInv:(t,e,r=0,n=0,i=0,s=0)=>{const o=l[c.inv(e)],a=o.a,h=o.b,u=o.c,d=o.d,f=r-Math.min(0,a*i,u*s,a*i+u*s),p=n-Math.min(0,h*i,d*s,h*i+d*s),y=t.a,m=t.b,g=t.c,x=t.d;t.a=a*y+h*g,t.b=a*m+h*x,t.c=u*y+d*g,t.d=u*m+d*x,t.tx=f*y+p*g+t.tx,t.ty=f*m+p*x+t.ty},transformRectCoords:(t,e,r,n)=>{const{x:i,y:s,width:o,height:a}=t,{x:h,y:l,width:u,height:d}=e;return r===c.E?(n.set(i+h,s+l,o,a),n):r===c.S?n.set(u-s-a+h,i+l,a,o):r===c.W?n.set(u-i-o+h,d-s-a+l,o,a):r===c.N?n.set(s+h,d-i-o+l,a,o):n.set(i+h,s+l,o,a)}}},1652:(t,e,r)=>{r.d(e,{TO:()=>n,Td:()=>s,bO:()=>i});const n=2*Math.PI,i=180/Math.PI,s=Math.PI/180},9939:(t,e,r)=>{function n(t){return t+=0===t?1:0,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1}function i(t){return!(t&t-1||!t)}r.d(e,{U5:()=>n,f3:()=>i})},2812:(t,e,r)=>{r.d(e,{o:()=>n});class n{constructor(t,e,r){this._x=e||0,this._y=r||0,this._observer=t}clone(t){return new n(t??this._observer,this._x,this._y)}set(t=0,e=t){return this._x===t&&this._y===e||(this._x=t,this._y=e,this._observer._onUpdate(this)),this}copyFrom(t){return this._x===t.x&&this._y===t.y||(this._x=t.x,this._y=t.y,this._observer._onUpdate(this)),this}copyTo(t){return t.set(this._x,this._y),t}equals(t){return t.x===this._x&&t.y===this._y}toString(){return`[pixi.js/math:ObservablePoint x=${this._x} y=${this._y} scope=${this._observer}]`}get x(){return this._x}set x(t){this._x!==t&&(this._x=t,this._observer._onUpdate(this))}get y(){return this._y}set y(t){this._y!==t&&(this._y=t,this._observer._onUpdate(this))}}},5101:(t,e,r)=>{r.d(e,{b:()=>n});class n{constructor(t=0,e=0){this.x=0,this.y=0,this.x=t,this.y=e}clone(){return new n(this.x,this.y)}copyFrom(t){return this.set(t.x,t.y),this}copyTo(t){return t.set(this.x,this.y),t}equals(t){return t.x===this.x&&t.y===this.y}set(t=0,e=t){return this.x=t,this.y=e,this}toString(){return`[pixi.js/math:Point x=${this.x} y=${this.y}]`}static get shared(){return i.x=0,i.y=0,i}}const i=new n},9252:(t,e,r)=>{r.d(e,{M:()=>s});var n=r(5101);const i=[new n.b,new n.b,new n.b,new n.b];class s{constructor(t=0,e=0,r=0,n=0){this.type="rectangle",this.x=Number(t),this.y=Number(e),this.width=Number(r),this.height=Number(n)}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}isEmpty(){return this.left===this.right||this.top===this.bottom}static get EMPTY(){return new s(0,0,0,0)}clone(){return new s(this.x,this.y,this.width,this.height)}copyFromBounds(t){return this.x=t.minX,this.y=t.minY,this.width=t.maxX-t.minX,this.height=t.maxY-t.minY,this}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.copyFrom(this),t}contains(t,e){return!(this.width<=0||this.height<=0)&&(t>=this.x&&t<this.x+this.width&&e>=this.y&&e<this.y+this.height)}strokeContains(t,e,r,n=.5){const{width:i,height:s}=this;if(i<=0||s<=0)return!1;const o=this.x,a=this.y,h=r*(1-n),l=r-h;return t>=o-h&&t<=o+i+h&&e>=a-h&&e<=a+s+h&&!(t>o+l&&t<o+i-l&&e>a+l&&e<a+s-l)}intersects(t,e){if(!e){const e=this.x<t.x?t.x:this.x;if((this.right>t.right?t.right:this.right)<=e)return!1;const r=this.y<t.y?t.y:this.y;return(this.bottom>t.bottom?t.bottom:this.bottom)>r}const r=this.left,n=this.right,s=this.top,o=this.bottom;if(n<=r||o<=s)return!1;const a=i[0].set(t.left,t.top),h=i[1].set(t.left,t.bottom),l=i[2].set(t.right,t.top),u=i[3].set(t.right,t.bottom);if(l.x<=a.x||h.y<=a.y)return!1;const c=Math.sign(e.a*e.d-e.b*e.c);if(0===c)return!1;if(e.apply(a,a),e.apply(h,h),e.apply(l,l),e.apply(u,u),Math.max(a.x,h.x,l.x,u.x)<=r||Math.min(a.x,h.x,l.x,u.x)>=n||Math.max(a.y,h.y,l.y,u.y)<=s||Math.min(a.y,h.y,l.y,u.y)>=o)return!1;const d=c*(h.y-a.y),f=c*(a.x-h.x),p=d*r+f*s,y=d*n+f*s,m=d*r+f*o,g=d*n+f*o;if(Math.max(p,y,m,g)<=d*a.x+f*a.y||Math.min(p,y,m,g)>=d*u.x+f*u.y)return!1;const x=c*(a.y-l.y),v=c*(l.x-a.x),b=x*r+v*s,_=x*n+v*s,w=x*r+v*o,S=x*n+v*o;return!(Math.max(b,_,w,S)<=x*a.x+v*a.y||Math.min(b,_,w,S)>=x*u.x+v*u.y)}pad(t=0,e=t){return this.x-=t,this.y-=e,this.width+=2*t,this.height+=2*e,this}fit(t){const e=Math.max(this.x,t.x),r=Math.min(this.x+this.width,t.x+t.width),n=Math.max(this.y,t.y),i=Math.min(this.y+this.height,t.y+t.height);return this.x=e,this.width=Math.max(r-e,0),this.y=n,this.height=Math.max(i-n,0),this}ceil(t=1,e=.001){const r=Math.ceil((this.x+this.width-e)*t)/t,n=Math.ceil((this.y+this.height-e)*t)/t;return this.x=Math.floor((this.x+e)*t)/t,this.y=Math.floor((this.y+e)*t)/t,this.width=r-this.x,this.height=n-this.y,this}scale(t,e=t){return this.x*=t,this.y*=e,this.width*=t,this.height*=e,this}enlarge(t){const e=Math.min(this.x,t.x),r=Math.max(this.x+this.width,t.x+t.width),n=Math.min(this.y,t.y),i=Math.max(this.y+this.height,t.y+t.height);return this.x=e,this.width=r-e,this.y=n,this.height=i-n,this}getBounds(t){return t||(t=new s),t.copyFrom(this),t}containsRect(t){if(this.width<=0||this.height<=0)return!1;const e=t.x,r=t.y,n=t.x+t.width,i=t.y+t.height;return e>=this.x&&e<this.x+this.width&&r>=this.y&&r<this.y+this.height&&n>=this.x&&n<this.x+this.width&&i>=this.y&&i<this.y+this.height}set(t,e,r,n){return this.x=t,this.y=e,this.width=r,this.height=n,this}toString(){return`[pixi.js/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}}},6512:(t,e,r)=>{r.d(e,{u:()=>s});const n=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join("\n");function i(t){let e="";for(let r=0;r<t;++r)r>0&&(e+="\nelse "),r<t-1&&(e+=`if(test == ${r}.0){}`);return e}function s(t,e){if(0===t)throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");const r=e.createShader(e.FRAGMENT_SHADER);try{for(;;){const s=n.replace(/%forloop%/gi,i(t));if(e.shaderSource(r,s),e.compileShader(r),e.getShaderParameter(r,e.COMPILE_STATUS))break;t=t/2|0}}finally{e.deleteShader(r)}return t}},341:(t,e,r)=>{r.d(e,{w:()=>o});var n=r(3513),i=r(5589);const s={};function o(t,e,r){let o=2166136261;for(let r=0;r<e;r++)o^=t[r].uid,o=Math.imul(o,16777619),o>>>=0;return s[o]||function(t,e,r,o){const a={};let h=0;for(let r=0;r<o;r++){const n=r<e?t[r]:i.g.EMPTY.source;a[h++]=n.source,a[h++]=n.style}const l=new n.T(a);return s[r]=l,l}(t,e,o,r)}},2043:(t,e,r)=>{r.d(e,{J:()=>G});var n=r(8507),i=r(133);class s{constructor(t){"number"==typeof t?this.rawBinaryData=new ArrayBuffer(t):t instanceof Uint8Array?this.rawBinaryData=t.buffer:this.rawBinaryData=t,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData),this.size=this.rawBinaryData.byteLength}get int8View(){return this._int8View||(this._int8View=new Int8Array(this.rawBinaryData)),this._int8View}get uint8View(){return this._uint8View||(this._uint8View=new Uint8Array(this.rawBinaryData)),this._uint8View}get int16View(){return this._int16View||(this._int16View=new Int16Array(this.rawBinaryData)),this._int16View}get int32View(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View}get float64View(){return this._float64Array||(this._float64Array=new Float64Array(this.rawBinaryData)),this._float64Array}get bigUint64View(){return this._bigUint64Array||(this._bigUint64Array=new BigUint64Array(this.rawBinaryData)),this._bigUint64Array}view(t){return this[`${t}View`]}destroy(){this.rawBinaryData=null,this.uint32View=null,this.float32View=null,this.uint16View=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._int32View=null,this._float64Array=null,this._bigUint64Array=null}static sizeOf(t){switch(t){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(`${t} isn't a valid view type`)}}}var o=r(4670),a=r(6083),h=r(6736),l=r(1957);function u(t,e){return"no-premultiply-alpha"===e.alphaMode&&l.Q[t]||t}var c=r(3804),d=r(6512);let f=null;class p{constructor(){this.ids=Object.create(null),this.textures=[],this.count=0}clear(){for(let t=0;t<this.count;t++){const e=this.textures[t];this.textures[t]=null,this.ids[e.uid]=null}this.count=0}}class y{constructor(){this.renderPipeId="batch",this.action="startBatch",this.start=0,this.size=0,this.textures=new p,this.blendMode="normal",this.topology="triangle-strip",this.canBundle=!0}destroy(){this.textures=null,this.gpuBindGroup=null,this.bindGroup=null,this.batcher=null,this.elements=null}}const m=[];let g=0;function x(){return g>0?m[--g]:new y}function v(t){t.elements=null,m[g++]=t}a.L.register({clear:()=>{if(m.length>0)for(const t of m)t&&t.destroy();m.length=0,g=0}});let b=0;const _=class t{constructor(e){this.uid=(0,i.L)("batcher"),this.dirty=!0,this.batchIndex=0,this.batches=[],this._elements=[],(e={...t.defaultOptions,...e}).maxTextures||((0,o.t6)("v8.8.0","maxTextures is a required option for Batcher now, please pass it in the options"),e.maxTextures=function(){if(f)return f;const t=(0,c.W)();return f=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),f=(0,d.u)(f,t),t.getExtension("WEBGL_lose_context")?.loseContext(),f}());const{maxTextures:r,attributesInitialSize:n,indicesInitialSize:a}=e;this.attributeBuffer=new s(4*n),this.indexBuffer=new Uint16Array(a),this.maxTextures=r}begin(){this.elementSize=0,this.elementStart=0,this.indexSize=0,this.attributeSize=0;for(let t=0;t<this.batchIndex;t++)v(this.batches[t]);this.batchIndex=0,this._batchIndexStart=0,this._batchIndexSize=0,this.dirty=!0}add(t){this._elements[this.elementSize++]=t,t._indexStart=this.indexSize,t._attributeStart=this.attributeSize,t._batcher=this,this.indexSize+=t.indexSize,this.attributeSize+=t.attributeSize*this.vertexSize}checkAndUpdateTexture(t,e){const r=t._batch.textures.ids[e._source.uid];return!(!r&&0!==r)&&(t._textureId=r,t.texture=e,!0)}updateElement(t){this.dirty=!0;const e=this.attributeBuffer;t.packAsQuad?this.packQuadAttributes(t,e.float32View,e.uint32View,t._attributeStart,t._textureId):this.packAttributes(t,e.float32View,e.uint32View,t._attributeStart,t._textureId)}break(t){const e=this._elements;if(!e[this.elementStart])return;let r=x(),n=r.textures;n.clear();const i=e[this.elementStart];let s=u(i.blendMode,i.texture._source),o=i.topology;4*this.attributeSize>this.attributeBuffer.size&&this._resizeAttributeBuffer(4*this.attributeSize),this.indexSize>this.indexBuffer.length&&this._resizeIndexBuffer(this.indexSize);const a=this.attributeBuffer.float32View,h=this.attributeBuffer.uint32View,l=this.indexBuffer;let c=this._batchIndexSize,d=this._batchIndexStart,f="startBatch",p=[];const y=this.maxTextures;for(let i=this.elementStart;i<this.elementSize;++i){const m=e[i];e[i]=null;const g=m.texture._source,v=u(m.blendMode,g),_=s!==v||o!==m.topology;g._batchTick!==b||_?(g._batchTick=b,(n.count>=y||_)&&(this._finishBatch(r,d,c-d,n,s,o,t,f,p),f="renderBatch",d=c,s=v,o=m.topology,r=x(),n=r.textures,n.clear(),p=[],++b),m._textureId=g._textureBindLocation=n.count,n.ids[g.uid]=n.count,n.textures[n.count++]=g,m._batch=r,p.push(m),c+=m.indexSize,m.packAsQuad?(this.packQuadAttributes(m,a,h,m._attributeStart,m._textureId),this.packQuadIndex(l,m._indexStart,m._attributeStart/this.vertexSize)):(this.packAttributes(m,a,h,m._attributeStart,m._textureId),this.packIndex(m,l,m._indexStart,m._attributeStart/this.vertexSize))):(m._textureId=g._textureBindLocation,c+=m.indexSize,m.packAsQuad?(this.packQuadAttributes(m,a,h,m._attributeStart,m._textureId),this.packQuadIndex(l,m._indexStart,m._attributeStart/this.vertexSize)):(this.packAttributes(m,a,h,m._attributeStart,m._textureId),this.packIndex(m,l,m._indexStart,m._attributeStart/this.vertexSize)),m._batch=r,p.push(m))}n.count>0&&(this._finishBatch(r,d,c-d,n,s,o,t,f,p),d=c,++b),this.elementStart=this.elementSize,this._batchIndexStart=d,this._batchIndexSize=c}_finishBatch(t,e,r,n,i,s,o,a,h){t.gpuBindGroup=null,t.bindGroup=null,t.action=a,t.batcher=this,t.textures=n,t.blendMode=i,t.topology=s,t.start=e,t.size=r,t.elements=h,++b,this.batches[this.batchIndex++]=t,o.add(t)}finish(t){this.break(t)}ensureAttributeBuffer(t){4*t<=this.attributeBuffer.size||this._resizeAttributeBuffer(4*t)}ensureIndexBuffer(t){t<=this.indexBuffer.length||this._resizeIndexBuffer(t)}_resizeAttributeBuffer(t){const e=Math.max(t,2*this.attributeBuffer.size),r=new s(e);(0,h.W)(this.attributeBuffer.rawBinaryData,r.rawBinaryData),this.attributeBuffer=r}_resizeIndexBuffer(t){const e=this.indexBuffer;let r=Math.max(t,1.5*e.length);r+=r%2;const n=r>65535?new Uint32Array(r):new Uint16Array(r);if(n.BYTES_PER_ELEMENT!==e.BYTES_PER_ELEMENT)for(let t=0;t<e.length;t++)n[t]=e[t];else(0,h.W)(e.buffer,n.buffer);this.indexBuffer=n}packQuadIndex(t,e,r){t[e]=r+0,t[e+1]=r+1,t[e+2]=r+2,t[e+3]=r+0,t[e+4]=r+2,t[e+5]=r+3}packIndex(t,e,r,n){const i=t.indices,s=t.indexSize,o=t.indexOffset,a=t.attributeOffset;for(let t=0;t<s;t++)e[r++]=n+i[t+o]-a}destroy(t={}){if(null!==this.batches){for(let t=0;t<this.batchIndex;t++)v(this.batches[t]);this.batches=null,this.geometry.destroy(!0),this.geometry=null,t.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}}};_.defaultOptions={maxTextures:null,attributesInitialSize:4,indicesInitialSize:6};let w=_;var S=r(949),C=r(1132),M=r(6011);const T=new Float32Array(1),A=new Uint32Array(1);class k extends M.V{constructor(){const t=new S.h({data:T,label:"attribute-batch-buffer",usage:C.S.VERTEX|C.S.COPY_DST,shrinkToFit:!1});super({attributes:{aPosition:{buffer:t,format:"float32x2",stride:24,offset:0},aUV:{buffer:t,format:"float32x2",stride:24,offset:8},aColor:{buffer:t,format:"unorm8x4",stride:24,offset:16},aTextureIdAndRound:{buffer:t,format:"uint16x2",stride:24,offset:20}},indexBuffer:new S.h({data:A,label:"index-batch-buffer",usage:C.S.INDEX|C.S.COPY_DST,shrinkToFit:!1})})}}var P=r(5611),E=r(4459),R=r(4e3),I=r(6665),O=r(6040),L=r(8475);class B extends L.M{constructor(t){super({glProgram:(0,P.I)({name:"batch",bits:[E.a,(0,R.P)(t),I.m]}),gpuProgram:(0,P.v)({name:"batch",bits:[E.F,(0,R._)(t),I.b]}),resources:{batchSamplers:(0,O.n)(t)}}),this.maxTextures=t}}let D=null;const F=class t extends w{constructor(e){super(e),this.geometry=new k,this.name=t.extension.name,this.vertexSize=6,D??(D=new B(e.maxTextures)),this.shader=D}packAttributes(t,e,r,n,i){const s=i<<16|65535&t.roundPixels,o=t.transform,a=o.a,h=o.b,l=o.c,u=o.d,c=o.tx,d=o.ty,{positions:f,uvs:p}=t,y=t.color,m=t.attributeOffset,g=m+t.attributeSize;for(let t=m;t<g;t++){const i=2*t,o=f[i],m=f[i+1];e[n++]=a*o+l*m+c,e[n++]=u*m+h*o+d,e[n++]=p[i],e[n++]=p[i+1],r[n++]=y,r[n++]=s}}packQuadAttributes(t,e,r,n,i){const s=t.texture,o=t.transform,a=o.a,h=o.b,l=o.c,u=o.d,c=o.tx,d=o.ty,f=t.bounds,p=f.maxX,y=f.minX,m=f.maxY,g=f.minY,x=s.uvs,v=t.color,b=i<<16|65535&t.roundPixels;e[n+0]=a*y+l*g+c,e[n+1]=u*g+h*y+d,e[n+2]=x.x0,e[n+3]=x.y0,r[n+4]=v,r[n+5]=b,e[n+6]=a*p+l*g+c,e[n+7]=u*g+h*p+d,e[n+8]=x.x1,e[n+9]=x.y1,r[n+10]=v,r[n+11]=b,e[n+12]=a*p+l*m+c,e[n+13]=u*m+h*p+d,e[n+14]=x.x2,e[n+15]=x.y2,r[n+16]=v,r[n+17]=b,e[n+18]=a*y+l*m+c,e[n+19]=u*m+h*y+d,e[n+20]=x.x3,e[n+21]=x.y3,r[n+22]=v,r[n+23]=b}_updateMaxTextures(t){this.shader.maxTextures!==t&&(D=new B(t),this.shader=D)}destroy(){this.shader=null,super.destroy()}};F.extension={type:[n.Ag.Batcher],name:"default"};let G=F},5611:(t,e,r)=>{r.d(e,{I:()=>A,v:()=>T});var n=r(9113),i=r(3012),s=r(268);function o(t,e,r){if(t)for(const n in t){const i=e[n.toLocaleLowerCase()];if(i){let e=t[n];"header"===n&&(e=e.replace(/@in\s+[^;]+;\s*/g,"").replace(/@out\s+[^;]+;\s*/g,"")),r&&i.push(`//----${r}----//`),i.push(e)}else(0,s.R)(`${n} placement hook does not exist in shader`)}}const a=/\{\{(.*?)\}\}/g;function h(t){const e={};return(t.match(a)?.map((t=>t.replace(/[{()}]/g,"")))??[]).forEach((t=>{e[t]=[]})),e}function l(t,e){let r;const n=/@in\s+([^;]+);/g;for(;null!==(r=n.exec(t));)e.push(r[1])}function u(t,e,r=!1){const n=[];l(e,n),t.forEach((t=>{t.header&&l(t.header,n)}));const i=n;r&&i.sort();const s=i.map(((t,e)=>` @location(${e}) ${t},`)).join("\n");let o=e.replace(/@in\s+[^;]+;\s*/g,"");return o=o.replace("{{in}}",`\n${s}\n`),o}function c(t,e){let r;const n=/@out\s+([^;]+);/g;for(;null!==(r=n.exec(t));)e.push(r[1])}function d(t,e){let r=t;for(const t in e){const n=e[t];r=n.join("\n").length?r.replace(`{{${t}}}`,`//-----${t} START-----//\n${n.join("\n")}\n//----${t} FINISH----//`):r.replace(`{{${t}}}`,"")}return r}const f=Object.create(null),p=new Map;let y=0;function m({template:t,bits:e}){const r=x(t,e);if(f[r])return f[r];const{vertex:n,fragment:i}=function(t,e){const r=e.map((t=>t.vertex)).filter((t=>!!t)),n=e.map((t=>t.fragment)).filter((t=>!!t));let i=u(r,t.vertex,!0);i=function(t,e){const r=[];c(e,r),t.forEach((t=>{t.header&&c(t.header,r)}));let n=0;const i=r.sort().map((t=>t.indexOf("builtin")>-1?t:`@location(${n++}) ${t}`)).join(",\n"),s=r.sort().map((t=>{return` var ${e=t,e.replace(/@.*?\s+/g,"")};`;var e})).join("\n"),o=`return VSOutput(\n ${r.sort().map((t=>` ${function(t){const e=/\b(\w+)\s*:/g.exec(t);return e?e[1]:""}(t)}`)).join(",\n")});`;let a=e.replace(/@out\s+[^;]+;\s*/g,"");return a=a.replace("{{struct}}",`\n${i}\n`),a=a.replace("{{start}}",`\n${s}\n`),a=a.replace("{{return}}",`\n${o}\n`),a}(r,i);const s=u(n,t.fragment,!0);return{vertex:i,fragment:s}}(t,e);return f[r]=v(n,i,e),f[r]}function g({template:t,bits:e}){const r=x(t,e);return f[r]||(f[r]=v(t.vertex,t.fragment,e)),f[r]}function x(t,e){return e.map((t=>(p.has(t)||p.set(t,y++),p.get(t)))).sort(((t,e)=>t-e)).join("-")+t.vertex+t.fragment}function v(t,e,r){const n=h(t),i=h(e);return r.forEach((t=>{o(t.vertex,n,t.name),o(t.fragment,i,t.name)})),{vertex:d(t,n),fragment:d(e,i)}}const b="\n @in aPosition: vec2<f32>;\n @in aUV: vec2<f32>;\n\n @out @builtin(position) vPosition: vec4<f32>;\n @out vUV : vec2<f32>;\n @out vColor : vec4<f32>;\n\n {{header}}\n\n struct VSOutput {\n {{struct}}\n };\n\n @vertex\n fn main( {{in}} ) -> VSOutput {\n\n var worldTransformMatrix = globalUniforms.uWorldTransformMatrix;\n var modelMatrix = mat3x3<f32>(\n 1.0, 0.0, 0.0,\n 0.0, 1.0, 0.0,\n 0.0, 0.0, 1.0\n );\n var position = aPosition;\n var uv = aUV;\n\n {{start}}\n\n vColor = vec4<f32>(1., 1., 1., 1.);\n\n {{main}}\n\n vUV = uv;\n\n var modelViewProjectionMatrix = globalUniforms.uProjectionMatrix * worldTransformMatrix * modelMatrix;\n\n vPosition = vec4<f32>((modelViewProjectionMatrix * vec3<f32>(position, 1.0)).xy, 0.0, 1.0);\n\n vColor *= globalUniforms.uWorldColorAlpha;\n\n {{end}}\n\n {{return}}\n };\n",_="\n @in vUV : vec2<f32>;\n @in vColor : vec4<f32>;\n\n {{header}}\n\n @fragment\n fn main(\n {{in}}\n ) -> @location(0) vec4<f32> {\n\n {{start}}\n\n var outColor:vec4<f32>;\n\n {{main}}\n\n var finalColor:vec4<f32> = outColor * vColor;\n\n {{end}}\n\n return finalColor;\n };\n",w="\n in vec2 aPosition;\n in vec2 aUV;\n\n out vec4 vColor;\n out vec2 vUV;\n\n {{header}}\n\n void main(void){\n\n mat3 worldTransformMatrix = uWorldTransformMatrix;\n mat3 modelMatrix = mat3(\n 1.0, 0.0, 0.0,\n 0.0, 1.0, 0.0,\n 0.0, 0.0, 1.0\n );\n vec2 position = aPosition;\n vec2 uv = aUV;\n\n {{start}}\n\n vColor = vec4(1.);\n\n {{main}}\n\n vUV = uv;\n\n mat3 modelViewProjectionMatrix = uProjectionMatrix * worldTransformMatrix * modelMatrix;\n\n gl_Position = vec4((modelViewProjectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n\n vColor *= uWorldColorAlpha;\n\n {{end}}\n }\n",S="\n\n in vec4 vColor;\n in vec2 vUV;\n\n out vec4 finalColor;\n\n {{header}}\n\n void main(void) {\n\n {{start}}\n\n vec4 outColor;\n\n {{main}}\n\n finalColor = outColor * vColor;\n\n {{end}}\n }\n",C={name:"global-uniforms-bit",vertex:{header:"\n struct GlobalUniforms {\n uProjectionMatrix:mat3x3<f32>,\n uWorldTransformMatrix:mat3x3<f32>,\n uWorldColorAlpha: vec4<f32>,\n uResolution: vec2<f32>,\n }\n\n @group(0) @binding(0) var<uniform> globalUniforms : GlobalUniforms;\n "}},M={name:"global-uniforms-bit",vertex:{header:"\n uniform mat3 uProjectionMatrix;\n uniform mat3 uWorldTransformMatrix;\n uniform vec4 uWorldColorAlpha;\n uniform vec2 uResolution;\n "}};function T({bits:t,name:e}){const r=m({template:{fragment:_,vertex:b},bits:[C,...t]});return i.B.from({name:e,vertex:{source:r.vertex,entryPoint:"main"},fragment:{source:r.fragment,entryPoint:"main"}})}function A({bits:t,name:e}){return new n.M({name:e,...g({template:{vertex:w,fragment:S},bits:[M,...t]})})}},4459:(t,e,r)=>{r.d(e,{F:()=>n,a:()=>i});const n={name:"color-bit",vertex:{header:"\n @in aColor: vec4<f32>;\n ",main:"\n vColor *= vec4<f32>(aColor.rgb * aColor.a, aColor.a);\n "}},i={name:"color-bit",vertex:{header:"\n in vec4 aColor;\n ",main:"\n vColor *= vec4(aColor.rgb * aColor.a, aColor.a);\n "}}},4e3:(t,e,r)=>{r.d(e,{P:()=>l,_:()=>o});const n={};function i(t){const e=[];if(1===t)e.push("@group(1) @binding(0) var textureSource1: texture_2d<f32>;"),e.push("@group(1) @binding(1) var textureSampler1: sampler;");else{let r=0;for(let n=0;n<t;n++)e.push(`@group(1) @binding(${r++}) var textureSource${n+1}: texture_2d<f32>;`),e.push(`@group(1) @binding(${r++}) var textureSampler${n+1}: sampler;`)}return e.join("\n")}function s(t){const e=[];if(1===t)e.push("outColor = textureSampleGrad(textureSource1, textureSampler1, vUV, uvDx, uvDy);");else{e.push("switch vTextureId {");for(let r=0;r<t;r++)r===t-1?e.push(" default:{"):e.push(` case ${r}:{`),e.push(` outColor = textureSampleGrad(textureSource${r+1}, textureSampler${r+1}, vUV, uvDx, uvDy);`),e.push(" break;}");e.push("}")}return e.join("\n")}function o(t){return n[t]||(n[t]={name:"texture-batch-bit",vertex:{header:"\n @in aTextureIdAndRound: vec2<u32>;\n @out @interpolate(flat) vTextureId : u32;\n ",main:"\n vTextureId = aTextureIdAndRound.y;\n ",end:"\n if(aTextureIdAndRound.x == 1)\n {\n vPosition = vec4<f32>(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw);\n }\n "},fragment:{header:`\n @in @interpolate(flat) vTextureId: u32;\n\n ${i(t)}\n `,main:`\n var uvDx = dpdx(vUV);\n var uvDy = dpdy(vUV);\n\n ${s(t)}\n `}}),n[t]}const a={};function h(t){const e=[];for(let r=0;r<t;r++)r>0&&e.push("else"),r<t-1&&e.push(`if(vTextureId < ${r}.5)`),e.push("{"),e.push(`\toutColor = texture(uTextures[${r}], vUV);`),e.push("}");return e.join("\n")}function l(t){return a[t]||(a[t]={name:"texture-batch-bit",vertex:{header:"\n in vec2 aTextureIdAndRound;\n out float vTextureId;\n\n ",main:"\n vTextureId = aTextureIdAndRound.y;\n ",end:"\n if(aTextureIdAndRound.x == 1.)\n {\n gl_Position.xy = roundPixels(gl_Position.xy, uResolution);\n }\n "},fragment:{header:`\n in float vTextureId;\n\n uniform sampler2D uTextures[${t}];\n\n `,main:`\n\n ${h(t)}\n `}}),a[t]}},6665:(t,e,r)=>{r.d(e,{b:()=>n,m:()=>i});const n={name:"round-pixels-bit",vertex:{header:"\n fn roundPixels(position: vec2<f32>, targetSize: vec2<f32>) -> vec2<f32>\n {\n return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;\n }\n "}},i={name:"round-pixels-bit",vertex:{header:"\n vec2 roundPixels(vec2 position, vec2 targetSize)\n {\n return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;\n }\n "}}},5753:(t,e,r)=>{var n=r(8507),i=r(6844),s=r(9636),o=r(9443);const a=new s.c;function h(t,e,r){const n=a;t.measurable=!0,(0,o.f)(t,r,n),e.addBoundsMask(n),t.measurable=!1}var l=r(7269),u=r(2208),c=r(268);function d(t,e,r){const n=u.o.get();t.measurable=!0;const i=u.u.get().identity(),s=f(t,r,i);(0,l.n)(t,n,s),t.measurable=!1,e.addBoundsMask(n),u.u.return(i),u.o.return(n)}function f(t,e,r){return t?(t!==e&&(f(t.parent,e,r),t.updateLocalTransform(),r.append(t.localTransform)),r):((0,c.R)("Mask bounds, renderable is not inside the root container"),r)}class p{constructor(t){this.priority=0,this.inverse=!1,this.pipe="alphaMask",t?.mask&&this.init(t.mask)}init(t){this.mask=t,this.renderMaskToTexture=!(t instanceof i.k),this.mask.renderable=this.renderMaskToTexture,this.mask.includeInBuild=!this.renderMaskToTexture,this.mask.measurable=!1}reset(){null!==this.mask&&(this.mask.measurable=!0,this.mask=null)}addBounds(t,e){this.inverse||h(this.mask,t,e)}addLocalBounds(t,e){d(this.mask,t,e)}containsPoint(t,e){return e(this.mask,t)}destroy(){this.reset()}static test(t){return t instanceof i.k}}p.extension=n.Ag.MaskEffect;class y{constructor(t){this.priority=0,this.pipe="colorMask",t?.mask&&this.init(t.mask)}init(t){this.mask=t}destroy(){}static test(t){return"number"==typeof t}}y.extension=n.Ag.MaskEffect;var m=r(5559);class g{constructor(t){this.priority=0,this.pipe="stencilMask",t?.mask&&this.init(t.mask)}init(t){this.mask=t,this.mask.includeInBuild=!1,this.mask.measurable=!1}reset(){null!==this.mask&&(this.mask.measurable=!0,this.mask.includeInBuild=!0,this.mask=null)}addBounds(t,e){h(this.mask,t,e)}addLocalBounds(t,e){d(this.mask,t,e)}containsPoint(t,e){return e(this.mask,t)}destroy(){this.reset()}static test(t){return t instanceof m.mc}}g.extension=n.Ag.MaskEffect;var x=r(4195),v=r(4884),b=r(8293),_=r(7309),w=r(1761);let S;var C=r(583);const M=class t extends C.v{constructor(e){super(e),this.isReady=!1,this.uploadMethodId="video",e={...t.defaultOptions,...e},this._autoUpdate=!0,this._isConnectedToTicker=!1,this._updateFPS=e.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=!1!==e.autoPlay,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),!1!==e.autoLoad&&this.load()}updateFrame(){if(!this.destroyed){if(this._updateFPS){const t=_.R.shared.elapsedMS*this.resource.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-t)}(!this._updateFPS||this._msToNextUpdate<=0)&&(this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0),this.isValid&&this.update()}}_videoFrameRequestCallback(){this.updateFrame(),this.destroyed?this._videoFrameRequestCallbackHandle=null:this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback)}get isValid(){return!!this.resource.videoWidth&&!!this.resource.videoHeight}async load(){if(this._load)return this._load;const t=this.resource,e=this.options;return(t.readyState===t.HAVE_ENOUGH_DATA||t.readyState===t.HAVE_FUTURE_DATA)&&t.width&&t.height&&(t.complete=!0),t.addEventListener("play",this._onPlayStart),t.addEventListener("pause",this._onPlayStop),t.addEventListener("seeked",this._onSeeked),this._isSourceReady()?this._mediaReady():(e.preload||t.addEventListener("canplay",this._onCanPlay),t.addEventListener("canplaythrough",this._onCanPlayThrough),t.addEventListener("error",this._onError,!0)),this.alphaMode=await async function(){return S??(S=(async()=>{const t=w.e.get().createCanvas(1,1).getContext("webgl");if(!t)return"premultiply-alpha-on-upload";const e=await new Promise((t=>{const e=document.createElement("video");e.onloadeddata=()=>t(e),e.onerror=()=>t(null),e.autoplay=!1,e.crossOrigin="anonymous",e.preload="auto",e.src="data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=",e.load()}));if(!e)return"premultiply-alpha-on-upload";const r=t.createTexture();t.bindTexture(t.TEXTURE_2D,r);const n=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,n),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,r,0),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,t.NONE),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,e);const i=new Uint8Array(4);return t.readPixels(0,0,1,1,t.RGBA,t.UNSIGNED_BYTE,i),t.deleteFramebuffer(n),t.deleteTexture(r),t.getExtension("WEBGL_lose_context")?.loseContext(),i[0]<=i[3]?"premultiplied-alpha":"premultiply-alpha-on-upload"})()),S}(),this._load=new Promise(((r,n)=>{this.isValid?r(this):(this._resolve=r,this._reject=n,void 0!==e.preloadTimeoutMs&&(this._preloadTimeout=setTimeout((()=>{this._onError(new ErrorEvent(`Preload exceeded timeout of ${e.preloadTimeoutMs}ms`))}))),t.load())})),this._load}_onError(t){this.resource.removeEventListener("error",this._onError,!0),this.emit("error",t),this._reject&&(this._reject(t),this._reject=null,this._resolve=null)}_isSourcePlaying(){const t=this.resource;return!t.paused&&!t.ended}_isSourceReady(){return this.resource.readyState>2}_onPlayStart(){this.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(){const t=this.resource;this.isValid&&(this.isReady=!0,this.resize(t.videoWidth,t.videoHeight)),this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0,this._resolve&&(this._resolve(this),this._resolve=null,this._reject=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&this.resource.play()}destroy(){this._configureAutoUpdate();const t=this.resource;t&&(t.removeEventListener("play",this._onPlayStart),t.removeEventListener("pause",this._onPlayStop),t.removeEventListener("seeked",this._onSeeked),t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlayThrough),t.removeEventListener("error",this._onError,!0),t.pause(),t.src="",t.load()),super.destroy()}get autoUpdate(){return this._autoUpdate}set autoUpdate(t){t!==this._autoUpdate&&(this._autoUpdate=t,this._configureAutoUpdate())}get updateFPS(){return this._updateFPS}set updateFPS(t){t!==this._updateFPS&&(this._updateFPS=t,this._configureAutoUpdate())}_configureAutoUpdate(){this._autoUpdate&&this._isSourcePlaying()?!this._updateFPS&&this.resource.requestVideoFrameCallback?(this._isConnectedToTicker&&(_.R.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0),null===this._videoFrameRequestCallbackHandle&&(this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback))):(null!==this._videoFrameRequestCallbackHandle&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker||(_.R.shared.add(this.updateFrame,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(null!==this._videoFrameRequestCallbackHandle&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(_.R.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(t){return globalThis.HTMLVideoElement&&t instanceof HTMLVideoElement}};M.extension=n.Ag.TextureSource,M.defaultOptions={...C.v.defaultOptions,autoLoad:!0,autoPlay:!0,updateFPS:0,crossorigin:!0,loop:!1,muted:!0,playsinline:!0,preload:!1},M.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};let T=M;r(9726);n.XO.add(p,y,g,T,b.b,v.q,x.P)},1257:(t,e,r)=>{r.d(e,{u:()=>n});var n=(t=>(t[t.NONE=0]="NONE",t[t.COLOR=16384]="COLOR",t[t.STENCIL=1024]="STENCIL",t[t.DEPTH=256]="DEPTH",t[t.COLOR_DEPTH=16640]="COLOR_DEPTH",t[t.COLOR_STENCIL=17408]="COLOR_STENCIL",t[t.DEPTH_STENCIL=1280]="DEPTH_STENCIL",t[t.ALL=17664]="ALL",t))(n||{})},9113:(t,e,r)=>{r.d(e,{M:()=>d});var n=r(7952),i=r(3804);let s;function o(){if(!s){s="mediump";const t=(0,i.W)();if(t&&t.getShaderPrecisionFormat){const e=t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT);s=e.precision?"highp":"mediump"}}return s}const a={},h={};const l={stripVersion:function(t,e){return e?t.replace("#version 300 es",""):t},ensurePrecision:function(t,e,r){const n=r?e.maxSupportedFragmentPrecision:e.maxSupportedVertexPrecision;if("precision"!==t.substring(0,9)){let i=r?e.requestedFragmentPrecision:e.requestedVertexPrecision;return"highp"===i&&"highp"!==n&&(i="mediump"),`precision ${i} float;\n${t}`}return"highp"!==n&&"precision highp"===t.substring(0,15)?t.replace("precision highp","precision mediump"):t},addProgramDefines:function(t,e,r){return e?t:r?`\n\n #ifdef GL_ES // This checks if it is WebGL1\n #define in varying\n #define finalColor gl_FragColor\n #define texture texture2D\n #endif\n ${t=t.replace("out vec4 finalColor;","")}\n `:`\n\n #ifdef GL_ES // This checks if it is WebGL1\n #define in attribute\n #define out varying\n #endif\n ${t}\n `},setProgramName:function(t,{name:e="pixi-program"},r=!0){e=e.replace(/\s+/g,"-");const n=r?a:h;return n[e+=r?"-fragment":"-vertex"]?(n[e]++,e+=`-${n[e]}`):n[e]=1,-1!==t.indexOf("#define SHADER_NAME")?t:`${`#define SHADER_NAME ${e}`}\n${t}`},insertVersion:function(t,e){return e?`#version 300 es\n${t}`:t}},u=Object.create(null),c=class t{constructor(e){const r=-1!==(e={...t.defaultOptions,...e}).fragment.indexOf("#version 300 es"),i={stripVersion:r,ensurePrecision:{requestedFragmentPrecision:e.preferredFragmentPrecision,requestedVertexPrecision:e.preferredVertexPrecision,maxSupportedVertexPrecision:"highp",maxSupportedFragmentPrecision:o()},setProgramName:{name:e.name},addProgramDefines:r,insertVersion:r};let s=e.fragment,a=e.vertex;Object.keys(l).forEach((t=>{const e=i[t];s=l[t](s,e,!0),a=l[t](a,e,!1)})),this.fragment=s,this.vertex=a,this.transformFeedbackVaryings=e.transformFeedbackVaryings,this._key=(0,n.X)(`${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,u[this._cacheKey]=null}static from(e){const r=`${e.vertex}:${e.fragment}`;return u[r]||(u[r]=new t(e),u[r]._cacheKey=r),u[r]}};c.defaultOptions={preferredVertexPrecision:"highp",preferredFragmentPrecision:"mediump"};let d=c},6040:(t,e,r)=>{r.d(e,{n:()=>s});var n=r(5811);const i={};function s(t){let e=i[t];if(e)return e;const r=new Int32Array(t);for(let e=0;e<t;e++)r[e]=e;return e=i[t]=new n.k({uTextures:{value:r,type:"i32",size:t}},{isStatic:!0}),e}},3804:(t,e,r)=>{r.d(e,{W:()=>s});var n=r(1761);let i;function s(){if(!i||i?.isContextLost()){const t=n.e.get().createCanvas();i=t.getContext("webgl",{})}return i}},3513:(t,e,r)=>{r.d(e,{T:()=>n});class n{constructor(t){this.resources=Object.create(null),this._dirty=!0;let e=0;for(const r in t){const n=t[r];this.setResource(n,e++)}this._updateKey()}_updateKey(){if(!this._dirty)return;this._dirty=!1;const t=[];let e=0;for(const r in this.resources)t[e++]=this.resources[r]._resourceId;this._key=t.join("|")}setResource(t,e){const r=this.resources[e];t!==r&&(r?.off?.("change",this.onResourceChange,this),t.on?.("change",this.onResourceChange,this),this.resources[e]=t,this._dirty=!0)}getResource(t){return this.resources[t]}_touch(t,e){const r=this.resources;for(const n in r)r[n]._gcLastUsed=t,r[n]._touched=e}destroy(){const t=this.resources;for(const e in t){const r=t[e];r?.off?.("change",this.onResourceChange,this)}this.resources=null}onResourceChange(t){this._dirty=!0,t.destroyed?this.destroy():this._updateKey()}}},3012:(t,e,r)=>{r.d(e,{B:()=>c});var n=r(7952),i=r(8306);const s={f32:"float32","vec2<f32>":"float32x2","vec3<f32>":"float32x3","vec4<f32>":"float32x4",vec2f:"float32x2",vec3f:"float32x3",vec4f:"float32x4",i32:"sint32","vec2<i32>":"sint32x2","vec3<i32>":"sint32x3","vec4<i32>":"sint32x4",vec2i:"sint32x2",vec3i:"sint32x3",vec4i:"sint32x4",u32:"uint32","vec2<u32>":"uint32x2","vec3<u32>":"uint32x3","vec4<u32>":"uint32x4",vec2u:"uint32x2",vec3u:"uint32x3",vec4u:"uint32x4",bool:"uint32","vec2<bool>":"uint32x2","vec3<bool>":"uint32x3","vec4<bool>":"uint32x4"},o=/@location\((\d+)\)\s+([a-zA-Z0-9_]+)\s*:\s*([a-zA-Z0-9_<>]+)(?:,|\s|\)|$)/g;function a(t,e){let r;for(;null!==(r=o.exec(t));){const t=s[r[3]]??"float32";e[r[2]]={location:parseInt(r[1],10),format:t,stride:(0,i.m)(t).stride,offset:0,instance:!1,start:0}}o.lastIndex=0}function h(t){const e=/@group\((\d+)\)/,r=/@binding\((\d+)\)/,n=/var(<[^>]+>)? (\w+)/,i=/:\s*([\w<>]+)/,s=/(\w+)\s*:\s*([\w\<\>]+)/g,o=/struct\s+(\w+)/,a=t.match(/(^|[^/])@(group|binding)\(\d+\)[^;]+;/g)?.map((t=>({group:parseInt(t.match(e)[1],10),binding:parseInt(t.match(r)[1],10),name:t.match(n)[2],isUniform:"<uniform>"===t.match(n)[1],type:t.match(i)[1]})));if(!a)return{groups:[],structs:[]};const h=t.match(/struct\s+(\w+)\s*{([^}]+)}/g)?.map((t=>{const e=t.match(o)[1],r=t.match(s).reduce(((t,e)=>{const[r,n]=e.split(":");return t[r.trim()]=n.trim(),t}),{});return r?{name:e,members:r}:null})).filter((({name:t})=>a.some((e=>e.type===t||e.type.includes(`<${t}>`)))))??[];return{groups:a,structs:h}}var l=(t=>(t[t.VERTEX=1]="VERTEX",t[t.FRAGMENT=2]="FRAGMENT",t[t.COMPUTE=4]="COMPUTE",t))(l||{});const u=Object.create(null);class c{constructor(t){this._layoutKey=0,this._attributeLocationsKey=0;const{fragment:e,vertex:r,layout:n,gpuLayout:i,name:s}=t;if(this.name=s,this.fragment=e,this.vertex=r,e.source===r.source){const t=h(e.source);this.structsAndGroups=t}else{const t=h(r.source),n=h(e.source);this.structsAndGroups=function(t,e){const r=new Set,n=new Set;return{structs:[...t.structs,...e.structs].filter((t=>!r.has(t.name)&&(r.add(t.name),!0))),groups:[...t.groups,...e.groups].filter((t=>{const e=`${t.name}-${t.binding}`;return!n.has(e)&&(n.add(e),!0)}))}}(t,n)}this.layout=n??function({groups:t}){const e=[];for(let r=0;r<t.length;r++){const n=t[r];e[n.group]||(e[n.group]={}),e[n.group][n.name]=n.binding}return e}(this.structsAndGroups),this.gpuLayout=i??function({groups:t}){const e=[];for(let r=0;r<t.length;r++){const n=t[r];e[n.group]||(e[n.group]=[]),n.isUniform?e[n.group].push({binding:n.binding,visibility:l.VERTEX|l.FRAGMENT,buffer:{type:"uniform"}}):"sampler"===n.type?e[n.group].push({binding:n.binding,visibility:l.FRAGMENT,sampler:{type:"filtering"}}):"texture_2d"===n.type||n.type.startsWith("texture_2d<")?e[n.group].push({binding:n.binding,visibility:l.FRAGMENT,texture:{sampleType:"float",viewDimension:"2d",multisampled:!1}}):"texture_2d_array"===n.type||n.type.startsWith("texture_2d_array<")?e[n.group].push({binding:n.binding,visibility:l.FRAGMENT,texture:{sampleType:"float",viewDimension:"2d-array",multisampled:!1}}):("texture_cube"===n.type||n.type.startsWith("texture_cube<"))&&e[n.group].push({binding:n.binding,visibility:l.FRAGMENT,texture:{sampleType:"float",viewDimension:"cube",multisampled:!1}})}for(let t=0;t<e.length;t++)e[t]||(e[t]=[]);return e}(this.structsAndGroups),this.autoAssignGlobalUniforms=!(void 0===this.layout[0]?.globalUniforms),this.autoAssignLocalUniforms=!(void 0===this.layout[1]?.localUniforms),this._generateProgramKey()}_generateProgramKey(){const{vertex:t,fragment:e}=this,r=t.source+e.source+t.entryPoint+e.entryPoint;this._layoutKey=(0,n.X)(r,"program")}get attributeData(){return this._attributeData??(this._attributeData=function({source:t,entryPoint:e}){const r={},n=function(t){return t.replace(/\/\/.*$/gm,"").replace(/\/\*[\s\S]*?\*\//g,"")}(t),i=n.indexOf(`fn ${e}(`);if(-1===i)return r;const s=n.indexOf("->",i);if(-1===s)return r;const o=n.substring(i,s);if(a(o,r),0===Object.keys(r).length){const t=o.match(/\(\s*\w+\s*:\s*(\w+)/);if(t){const e=t[1],i=new RegExp(`struct\\s+${e}\\s*\\{([^}]+)\\}`,"s"),s=n.match(i);s&&a(s[1],r)}}return r}(this.vertex)),this._attributeData}destroy(){this.gpuLayout=null,this.layout=null,this.structsAndGroups=null,this.fragment=null,this.vertex=null,u[this._cacheKey]=null}static from(t){const e=`${t.vertex.source}:${t.fragment.source}:${t.fragment.entryPoint}:${t.vertex.entryPoint}`;return u[e]||(u[e]=new c(t),u[e]._cacheKey=e),u[e]}}},949:(t,e,r)=>{r.d(e,{h:()=>o});var n=r(8875),i=r(133),s=r(1132);class o extends n.A{constructor(t){let{data:e,size:r}=t;const{usage:n,label:s,shrinkToFit:o}=t;super(),this._gpuData=Object.create(null),this._gcLastUsed=-1,this.autoGarbageCollect=!0,this.uid=(0,i.L)("buffer"),this._resourceType="buffer",this._resourceId=(0,i.L)("resource"),this._touched=0,this._updateID=1,this._dataInt32=null,this.shrinkToFit=!0,this.destroyed=!1,e instanceof Array&&(e=new Float32Array(e)),this._data=e,r??(r=e?.byteLength);const a=!!e;this.descriptor={size:r,usage:n,mappedAtCreation:a,label:s},this.shrinkToFit=o??!0}get data(){return this._data}set data(t){this.setDataWithSize(t,t.length,!0)}get dataInt32(){return this._dataInt32||(this._dataInt32=new Int32Array(this.data.buffer)),this._dataInt32}get static(){return!!(this.descriptor.usage&s.S.STATIC)}set static(t){t?this.descriptor.usage|=s.S.STATIC:this.descriptor.usage&=~s.S.STATIC}setDataWithSize(t,e,r){if(this._updateID++,this._updateSize=e*t.BYTES_PER_ELEMENT,this._data===t)return void(r&&this.emit("update",this));const n=this._data;this._data=t,this._dataInt32=null,n&&n.length===t.length||!this.shrinkToFit&&n&&t.byteLength<n.byteLength?r&&this.emit("update",this):(this.descriptor.size=t.byteLength,this._resourceId=(0,i.L)("resource"),this.emit("change",this))}update(t){this._updateSize=t??this._updateSize,this._updateID++,this.emit("update",this)}unload(){this.emit("unload",this);for(const t in this._gpuData)this._gpuData[t]?.destroy();this._gpuData=Object.create(null)}destroy(){this.destroyed=!0,this.unload(),this.emit("destroy",this),this.emit("change",this),this._data=null,this.descriptor=null,this.removeAllListeners()}}},1132:(t,e,r)=>{r.d(e,{S:()=>n});var n=(t=>(t[t.MAP_READ=1]="MAP_READ",t[t.MAP_WRITE=2]="MAP_WRITE",t[t.COPY_SRC=4]="COPY_SRC",t[t.COPY_DST=8]="COPY_DST",t[t.INDEX=16]="INDEX",t[t.VERTEX=32]="VERTEX",t[t.UNIFORM=64]="UNIFORM",t[t.STORAGE=128]="STORAGE",t[t.INDIRECT=256]="INDIRECT",t[t.QUERY_RESOLVE=512]="QUERY_RESOLVE",t[t.STATIC=1024]="STATIC",t))(n||{})},6736:(t,e,r)=>{function n(t,e,r,n){if(r??(r=0),n??(n=Math.min(t.byteLength-r,e.byteLength)),7&r||7&n)if(3&r||3&n)new Uint8Array(e).set(new Uint8Array(t,r,n));else{const i=n/4;new Float32Array(e,0,i).set(new Float32Array(t,r,i))}else{const i=n/8;new Float64Array(e,0,i).set(new Float64Array(t,r,i))}}r.d(e,{W:()=>n})},6011:(t,e,r)=>{r.d(e,{V:()=>l});var n=r(8875),i=r(9636),s=r(133),o=r(949),a=r(1132);function h(t,e){if(!(t instanceof o.h)){let r=e?a.S.INDEX:a.S.VERTEX;t instanceof Array&&(e?(t=new Uint32Array(t),r=a.S.INDEX|a.S.COPY_DST):(t=new Float32Array(t),r=a.S.VERTEX|a.S.COPY_DST)),t=new o.h({data:t,label:e?"index-mesh-buffer":"vertex-mesh-buffer",usage:r})}return t}class l extends n.A{constructor(t={}){super(),this._gpuData=Object.create(null),this.autoGarbageCollect=!0,this._gcLastUsed=-1,this.uid=(0,s.L)("geometry"),this._layoutKey=0,this.instanceCount=1,this._bounds=new i.c,this._boundsDirty=!0;const{attributes:e,indexBuffer:r,topology:n}=t;if(this.buffers=[],this.attributes={},e)for(const t in e)this.addAttribute(t,e[t]);this.instanceCount=t.instanceCount??1,r&&this.addIndex(r),this.topology=n||"triangle-list"}onBufferUpdate(){this._boundsDirty=!0,this.emit("update",this)}getAttribute(t){return this.attributes[t]}getIndex(){return this.indexBuffer}getBuffer(t){return this.getAttribute(t).buffer}getSize(){for(const t in this.attributes){const e=this.attributes[t];return e.buffer.data.length/(e.stride/4||e.size)}return 0}addAttribute(t,e){const r=function(t){return(t instanceof o.h||Array.isArray(t)||t.BYTES_PER_ELEMENT)&&(t={buffer:t}),t.buffer=h(t.buffer,!1),t}(e);-1===this.buffers.indexOf(r.buffer)&&(this.buffers.push(r.buffer),r.buffer.on("update",this.onBufferUpdate,this),r.buffer.on("change",this.onBufferUpdate,this)),this.attributes[t]=r}addIndex(t){this.indexBuffer=h(t,!0),this.buffers.push(this.indexBuffer)}get bounds(){return this._boundsDirty?(this._boundsDirty=!1,function(t,e,r){const n=t.getAttribute(e);if(!n)return r.minX=0,r.minY=0,r.maxX=0,r.maxY=0,r;const i=n.buffer.data;let s=1/0,o=1/0,a=-1/0,h=-1/0;const l=i.BYTES_PER_ELEMENT,u=(n.offset||0)/l,c=(n.stride||8)/l;for(let t=u;t<i.length;t+=c){const e=i[t],r=i[t+1];e>a&&(a=e),r>h&&(h=r),e<s&&(s=e),r<o&&(o=r)}return r.minX=s,r.minY=o,r.maxX=a,r.maxY=h,r}(this,"aPosition",this._bounds)):this._bounds}unload(){this.emit("unload",this);for(const t in this._gpuData)this._gpuData[t]?.destroy();this._gpuData=Object.create(null)}destroy(t=!1){this.emit("destroy",this),this.removeAllListeners(),t&&this.buffers.forEach((t=>t.destroy())),this.unload(),this.indexBuffer?.destroy(),this.attributes=null,this.buffers=null,this.indexBuffer=null,this._bounds=null}}},8306:(t,e,r)=>{r.d(e,{m:()=>i});const n={uint8x2:{size:2,stride:2,normalised:!1},uint8x4:{size:4,stride:4,normalised:!1},sint8x2:{size:2,stride:2,normalised:!1},sint8x4:{size:4,stride:4,normalised:!1},unorm8x2:{size:2,stride:2,normalised:!0},unorm8x4:{size:4,stride:4,normalised:!0},snorm8x2:{size:2,stride:2,normalised:!0},snorm8x4:{size:4,stride:4,normalised:!0},uint16x2:{size:2,stride:4,normalised:!1},uint16x4:{size:4,stride:8,normalised:!1},sint16x2:{size:2,stride:4,normalised:!1},sint16x4:{size:4,stride:8,normalised:!1},unorm16x2:{size:2,stride:4,normalised:!0},unorm16x4:{size:4,stride:8,normalised:!0},snorm16x2:{size:2,stride:4,normalised:!0},snorm16x4:{size:4,stride:8,normalised:!0},float16x2:{size:2,stride:4,normalised:!1},float16x4:{size:4,stride:8,normalised:!1},float32:{size:1,stride:4,normalised:!1},float32x2:{size:2,stride:8,normalised:!1},float32x3:{size:3,stride:12,normalised:!1},float32x4:{size:4,stride:16,normalised:!1},uint32:{size:1,stride:4,normalised:!1},uint32x2:{size:2,stride:8,normalised:!1},uint32x3:{size:3,stride:12,normalised:!1},uint32x4:{size:4,stride:16,normalised:!1},sint32:{size:1,stride:4,normalised:!1},sint32x2:{size:2,stride:8,normalised:!1},sint32x3:{size:3,stride:12,normalised:!1},sint32x4:{size:4,stride:16,normalised:!1}};function i(t){return n[t]??n.float32}},848:(t,e,r)=>{r.d(e,{L:()=>i});var n=r(133);class i{constructor(){this.uid=(0,n.L)("instructionSet"),this.instructions=[],this.instructionSize=0,this.renderables=[],this.gcTick=0}reset(){this.instructionSize=0}destroy(){this.instructions.length=0,this.renderables.length=0,this.renderPipes=null,this.gcTick=0}add(t){this.instructions[this.instructionSize++]=t}log(){this.instructions.length=this.instructionSize,console.table(this.instructions,["type","action"])}}},8475:(t,e,r)=>{r.d(e,{M:()=>u});var n=r(8875),i=r(133),s=r(9113),o=r(3513),a=r(3012),h=r(5099),l=r(5811);class u extends n.A{constructor(t){super(),this.uid=(0,i.L)("shader"),this._uniformBindMap=Object.create(null),this._ownedBindGroups=[],this._destroyed=!1;let{gpuProgram:e,glProgram:r,groups:n,resources:s,compatibleRenderers:a,groupMap:u}=t;this.gpuProgram=e,this.glProgram=r,void 0===a&&(a=0,e&&(a|=h.W.WEBGPU),r&&(a|=h.W.WEBGL)),this.compatibleRenderers=a;const c={};if(s||n||(s={}),s&&n)throw new Error("[Shader] Cannot have both resources and groups");if(!e&&n&&!u)throw new Error("[Shader] No group map or WebGPU shader provided - consider using resources instead.");if(!e&&n&&u)for(const t in u)for(const e in u[t]){const r=u[t][e];c[r]={group:t,binding:e,name:r}}else if(e&&n&&!u){const t=e.structsAndGroups.groups;u={},t.forEach((t=>{u[t.group]=u[t.group]||{},u[t.group][t.binding]=t.name,c[t.name]=t}))}else if(s){if(n={},u={},e){e.structsAndGroups.groups.forEach((t=>{u[t.group]=u[t.group]||{},u[t.group][t.binding]=t.name,c[t.name]=t}))}let t=0;for(const e in s)c[e]||(n[99]||(n[99]=new o.T,this._ownedBindGroups.push(n[99])),c[e]={group:99,binding:t,name:e},u[99]=u[99]||{},u[99][t]=e,t++);for(const t in s){const e=t;let r=s[t];r.source||r._resourceType||(r=new l.k(r));const i=c[e];i&&(n[i.group]||(n[i.group]=new o.T,this._ownedBindGroups.push(n[i.group])),n[i.group].setResource(r,i.binding))}}this.groups=n,this._uniformBindMap=u,this.resources=this._buildResourceAccessor(n,c)}addResource(t,e,r){var n,i;(n=this._uniformBindMap)[e]||(n[e]={}),(i=this._uniformBindMap[e])[r]||(i[r]=t),this.groups[e]||(this.groups[e]=new o.T,this._ownedBindGroups.push(this.groups[e]))}_buildResourceAccessor(t,e){const r={};for(const n in e){const i=e[n];Object.defineProperty(r,i.name,{get:()=>t[i.group].getResource(i.binding),set(e){t[i.group].setResource(e,i.binding)}})}return r}destroy(t=!1){this._destroyed||(this._destroyed=!0,this.emit("destroy",this),t&&(this.gpuProgram?.destroy(),this.glProgram?.destroy()),this.gpuProgram=null,this.glProgram=null,this.removeAllListeners(),this._uniformBindMap=null,this._ownedBindGroups.forEach((t=>{t.destroy()})),this._ownedBindGroups=null,this.resources=null,this.groups=null)}static from(t){const{gpu:e,gl:r,...n}=t;let i,o;return e&&(i=a.B.from(e)),r&&(o=s.M.from(r)),new u({gpuProgram:i,glProgram:o,...n})}}},5811:(t,e,r)=>{r.d(e,{k:()=>l});var n=r(133),i=r(7952);const s=["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>"],o=s.reduce(((t,e)=>(t[e]=!0,t)),{});function a(t,e){switch(t){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}const h=class t{constructor(e,r){this._touched=0,this.uid=(0,n.L)("uniform"),this._resourceType="uniformGroup",this._resourceId=(0,n.L)("resource"),this.isUniformGroup=!0,this._dirtyId=0,this.destroyed=!1,r={...t.defaultOptions,...r},this.uniformStructures=e;const h={};for(const t in e){const r=e[t];if(r.name=t,r.size=r.size??1,!o[r.type]){const t=r.type.match(/^array<(\w+(?:<\w+>)?),\s*(\d+)>$/);if(t){const[,e,n]=t;throw new Error(`Uniform type ${r.type} is not supported. Use type: '${e}', size: ${n} instead.`)}throw new Error(`Uniform type ${r.type} is not supported. Supported uniform types are: ${s.join(", ")}`)}r.value??(r.value=a(r.type,r.size)),h[t]=r.value}this.uniforms=h,this._dirtyId=1,this.ubo=r.ubo,this.isStatic=r.isStatic,this._signature=(0,i.X)(Object.keys(h).map((t=>`${t}-${e[t].type}`)).join("-"),"uniform-group")}update(){this._dirtyId++}};h.defaultOptions={ubo:!1,isStatic:!1};let l=h},7547:(t,e,r)=>{r.d(e,{U:()=>s});const n={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},i=class t{constructor(){this.data=0,this.blendMode="normal",this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(1&this.data)}set blend(t){!!(1&this.data)!==t&&(this.data^=1)}get offsets(){return!!(2&this.data)}set offsets(t){!!(2&this.data)!==t&&(this.data^=2)}set cullMode(t){"none"!==t?(this.culling=!0,this.clockwiseFrontFace="front"===t):this.culling=!1}get cullMode(){return this.culling?this.clockwiseFrontFace?"front":"back":"none"}get culling(){return!!(4&this.data)}set culling(t){!!(4&this.data)!==t&&(this.data^=4)}get depthTest(){return!!(8&this.data)}set depthTest(t){!!(8&this.data)!==t&&(this.data^=8)}get depthMask(){return!!(32&this.data)}set depthMask(t){!!(32&this.data)!==t&&(this.data^=32)}get clockwiseFrontFace(){return!!(16&this.data)}set clockwiseFrontFace(t){!!(16&this.data)!==t&&(this.data^=16)}get blendMode(){return this._blendMode}set blendMode(t){this.blend="none"!==t,this._blendMode=t,this._blendModeId=n[t]||0}get polygonOffset(){return this._polygonOffset}set polygonOffset(t){this.offsets=!!t,this._polygonOffset=t}toString(){return`[pixi.js/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`}static for2d(){const e=new t;return e.depthTest=!1,e.blend=!0,e}};i.default2d=i.for2d();let s=i},1957:(t,e,r)=>{r.d(e,{K:()=>i,Q:()=>n});const n={normal:"normal-npm",add:"add-npm",screen:"screen-npm"};var i=(t=>(t[t.DISABLED=0]="DISABLED",t[t.RENDERING_MASK_ADD=1]="RENDERING_MASK_ADD",t[t.MASK_ACTIVE=2]="MASK_ACTIVE",t[t.INVERSE_MASK_ACTIVE=3]="INVERSE_MASK_ACTIVE",t[t.RENDERING_MASK_REMOVE=4]="RENDERING_MASK_REMOVE",t[t.NONE=5]="NONE",t))(i||{})},800:(t,e,r)=>{r.d(e,{k:()=>g});var n=r(2577),i=r(8507);const s=[];async function o(t){if(!t)for(let t=0;t<s.length;t++){const e=s[t];if(e.value.test())return void await e.value.load()}}i.XO.handleByNamedList(i.Ag.Environment,s);var a=r(5559),h=r(4577),l=r(133),u=r(4670),c=r(6083),d=r(1257),f=r(7729),p=r(8875);const y=["init","destroy","contextChange","resolutionChange","resetState","renderEnd","renderStart","render","update","postrender","prerender"],m=class t extends p.A{constructor(t){super(),this.tick=0,this.uid=(0,l.L)("renderer"),this.runners=Object.create(null),this.renderPipes=Object.create(null),this._initOptions={},this._systemsHash=Object.create(null),this.type=t.type,this.name=t.name,this.config=t;const e=[...y,...this.config.runners??[]];this._addRunners(...e),this._unsafeEvalCheck()}async init(e={}){const r=!0===e.skipExtensionImports||!1===e.manageImports;await o(r),this._addSystems(this.config.systems),this._addPipes(this.config.renderPipes,this.config.renderPipeAdaptors);for(const t in this._systemsHash){e={...this._systemsHash[t].constructor.defaultOptions,...e}}e={...t.defaultOptions,...e},this._roundPixels=e.roundPixels?1:0;for(let t=0;t<this.runners.init.items.length;t++)await this.runners.init.items[t].init(e);this._initOptions=e}render(t,e){this.tick++;let r=t;if(r instanceof a.mc&&(r={container:r},e&&((0,u.t6)(u.lj,"passing a second argument is deprecated, please use render options instead"),r.target=e.renderTexture)),r.target||(r.target=this.view.renderTarget),r.target===this.view.renderTarget&&(this._lastObjectRendered=r.container,r.clearColor??(r.clearColor=this.background.colorRgba),r.clear??(r.clear=this.background.clearBeforeRender)),r.clearColor){const t=Array.isArray(r.clearColor)&&4===r.clearColor.length;r.clearColor=t?r.clearColor:n.Q.shared.setValue(r.clearColor).toArray()}r.transform||(r.container.updateLocalTransform(),r.transform=r.container.localTransform),r.container.visible&&(r.container.enableRenderGroup(),this.runners.prerender.emit(r),this.runners.renderStart.emit(r),this.runners.render.emit(r),this.runners.renderEnd.emit(r),this.runners.postrender.emit(r))}resize(t,e,r){const n=this.view.resolution;this.view.resize(t,e,r),this.emit("resize",this.view.screen.width,this.view.screen.height,this.view.resolution),void 0!==r&&r!==n&&this.runners.resolutionChange.emit(r)}clear(t={}){t.target||(t.target=this.renderTarget.renderTarget),t.clearColor||(t.clearColor=this.background.colorRgba),t.clear??(t.clear=d.u.ALL);const{clear:e,clearColor:r,target:i,mipLevel:s,layer:o}=t;n.Q.shared.setValue(r??this.background.colorRgba),this.renderTarget.clear(i,e,n.Q.shared.toArray(),s??0,o??0)}get resolution(){return this.view.resolution}set resolution(t){this.view.resolution=t,this.runners.resolutionChange.emit(t)}get width(){return this.view.texture.frame.width}get height(){return this.view.texture.frame.height}get canvas(){return this.view.canvas}get lastObjectRendered(){return this._lastObjectRendered}get renderingToScreen(){return this.renderTarget.renderingToScreen}get screen(){return this.view.screen}_addRunners(...t){t.forEach((t=>{this.runners[t]=new f.C(t)}))}_addSystems(t){let e;for(e in t){const r=t[e];this._addSystem(r.value,r.name)}}_addSystem(t,e){const r=new t(this);if(this[e])throw new Error(`Whoops! The name "${e}" is already in use`);this[e]=r,this._systemsHash[e]=r;for(const t in this.runners)this.runners[t].add(r);return this}_addPipes(t,e){const r=e.reduce(((t,e)=>(t[e.name]=e.value,t)),{});t.forEach((t=>{const e=t.value,n=t.name,i=r[n];this.renderPipes[n]=new e(this,i?new i:null),this.runners.destroy.add(this.renderPipes[n])}))}destroy(t=!1){this.runners.destroy.items.reverse(),this.runners.destroy.emit(t),(!0===t||"object"==typeof t&&t.releaseGlobalResources)&&c.L.release(),Object.values(this.runners).forEach((t=>{t.destroy()})),this._systemsHash=null,this.renderPipes=null,this.removeAllListeners()}generateTexture(t){return this.textureGenerator.generateTexture(t)}get roundPixels(){return!!this._roundPixels}_unsafeEvalCheck(){if(!(0,h.f)())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()}};m.defaultOptions={resolution:1,failIfMajorPerformanceCaveat:!1,roundPixels:!1};let g=m},7729:(t,e,r)=>{r.d(e,{C:()=>n});class n{constructor(t){this.items=[],this._name=t}emit(t,e,r,n,i,s,o,a){const{name:h,items:l}=this;for(let u=0,c=l.length;u<c;u++)l[u][h](t,e,r,n,i,s,o,a);return this}add(t){return t[this._name]&&(this.remove(t),this.items.push(t)),this}remove(t){const e=this.items.indexOf(t);return-1!==e&&this.items.splice(e,1),this}contains(t){return-1!==this.items.indexOf(t)}removeAll(){return this.items.length=0,this}destroy(){this.removeAll(),this.items=null,this._name=null}get empty(){return 0===this.items.length}get name(){return this._name}}},7608:(t,e,r)=>{r.d(e,{N:()=>o});var n=r(1761),i=r(9939),s=r(6083);const o=new class{constructor(t){this._canvasPool=Object.create(null),this.canvasOptions=t||{},this.enableFullScreen=!1}_createCanvasAndContext(t,e){const r=n.e.get().createCanvas();r.width=t,r.height=e;const i=r.getContext("2d");return{canvas:r,context:i}}getOptimalCanvasAndContext(t,e,r=1){t=Math.ceil(t*r-1e-6),e=Math.ceil(e*r-1e-6);const n=((t=(0,i.U5)(t))<<17)+((e=(0,i.U5)(e))<<1);this._canvasPool[n]||(this._canvasPool[n]=[]);let s=this._canvasPool[n].pop();return s||(s=this._createCanvasAndContext(t,e)),s}returnCanvasAndContext(t){const e=t.canvas,{width:r,height:n}=e,i=(r<<17)+(n<<1);t.context.resetTransform(),t.context.clearRect(0,0,r,n),this._canvasPool[i].push(t)}clear(){this._canvasPool={}}};s.L.register(o)},5589:(t,e,r)=>{r.d(e,{g:()=>d});var n=r(8875),i=r(2079),s=r(9252),o=r(133),a=r(4670);const h=()=>{};var l=r(4195),u=r(583),c=r(1196);class d extends n.A{constructor({source:t,label:e,frame:r,orig:n,trim:i,defaultAnchor:a,defaultBorders:h,rotate:l,dynamic:c}={}){if(super(),this.uid=(0,o.L)("texture"),this.uvs={x0:0,y0:0,x1:0,y1:0,x2:0,y2:0,x3:0,y3:0},this.frame=new s.M,this.noFrame=!1,this.dynamic=!1,this.isTexture=!0,this.label=e,this.source=t?.source??new u.v,this.noFrame=!r,r)this.frame.copyFrom(r);else{const{width:t,height:e}=this._source;this.frame.width=t,this.frame.height=e}this.orig=n||this.frame,this.trim=i,this.rotate=l??0,this.defaultAnchor=a,this.defaultBorders=h,this.destroyed=!1,this.dynamic=c||!1,this.updateUvs()}set source(t){this._source&&this._source.off("resize",this.update,this),this._source=t,t.on("resize",this.update,this),this.emit("update",this)}get source(){return this._source}get textureMatrix(){return this._textureMatrix||(this._textureMatrix=new c.N(this)),this._textureMatrix}get width(){return this.orig.width}get height(){return this.orig.height}updateUvs(){const{uvs:t,frame:e}=this,{width:r,height:n}=this._source,s=e.x/r,o=e.y/n,a=e.width/r,h=e.height/n;let l=this.rotate;if(l){const e=a/2,r=h/2,n=s+e,u=o+r;l=i.E.add(l,i.E.NW),t.x0=n+e*i.E.uX(l),t.y0=u+r*i.E.uY(l),l=i.E.add(l,2),t.x1=n+e*i.E.uX(l),t.y1=u+r*i.E.uY(l),l=i.E.add(l,2),t.x2=n+e*i.E.uX(l),t.y2=u+r*i.E.uY(l),l=i.E.add(l,2),t.x3=n+e*i.E.uX(l),t.y3=u+r*i.E.uY(l)}else t.x0=s,t.y0=o,t.x1=s+a,t.y1=o,t.x2=s+a,t.y2=o+h,t.x3=s,t.y3=o+h}destroy(t=!1){this._source&&(this._source.off("resize",this.update,this),t&&(this._source.destroy(),this._source=null)),this._textureMatrix=null,this.destroyed=!0,this.emit("destroy",this),this.removeAllListeners()}update(){this.noFrame&&(this.frame.width=this._source.width,this.frame.height=this._source.height),this.updateUvs(),this.emit("update",this)}get baseTexture(){return(0,a.t6)(a.lj,"Texture.baseTexture is now Texture.source"),this._source}}d.EMPTY=new d({label:"EMPTY",source:new u.v({label:"EMPTY"})}),d.EMPTY.destroy=h,d.WHITE=new d({source:new l.P({resource:new Uint8Array([255,255,255,255]),width:1,height:1,alphaMode:"premultiply-alpha-on-upload",label:"WHITE"}),label:"WHITE"}),d.WHITE.destroy=h},1196:(t,e,r)=>{r.d(e,{N:()=>s});var n=r(9313);const i=new n.u;class s{constructor(t,e){this.mapCoord=new n.u,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,this.clampMargin=void 0===e?t.width<10?0:.5:e,this.isSimple=!1,this.texture=t}get texture(){return this._texture}set texture(t){this.texture!==t&&(this._texture?.removeListener("update",this.update,this),this._texture=t,this._texture.addListener("update",this.update,this),this.update())}multiplyUvs(t,e){void 0===e&&(e=t);const r=this.mapCoord;for(let n=0;n<t.length;n+=2){const i=t[n],s=t[n+1];e[n]=i*r.a+s*r.c+r.tx,e[n+1]=i*r.b+s*r.d+r.ty}return e}update(){const t=this._texture;this._updateID++;const e=t.uvs;this.mapCoord.set(e.x1-e.x0,e.y1-e.y0,e.x3-e.x0,e.y3-e.y0,e.x0,e.y0);const r=t.orig,n=t.trim;n&&(i.set(r.width/n.width,0,0,r.height/n.height,-n.x/n.width,-n.y/n.height),this.mapCoord.append(i));const s=t.source,o=this.uClampFrame,a=this.clampMargin/s._resolution,h=this.clampOffset/s._resolution;return o[0]=(t.frame.x+a+h)/s.width,o[1]=(t.frame.y+a+h)/s.height,o[2]=(t.frame.x+t.frame.width-a+h)/s.width,o[3]=(t.frame.y+t.frame.height-a+h)/s.height,this.uClampOffset[0]=this.clampOffset/s.pixelWidth,this.uClampOffset[1]=this.clampOffset/s.pixelHeight,this.isSimple=t.frame.width===s.width&&t.frame.height===s.height&&0===t.rotate,!0}}},2437:(t,e,r)=>{r.d(e,{W:()=>l});var n=r(9939),i=r(6083),s=r(583),o=r(5589),a=r(218);let h=0;const l=new class{constructor(t){this._poolKeyHash=Object.create(null),this._texturePool={},this.textureOptions=t||{},this.enableFullScreen=!1,this.textureStyle=new a.n(this.textureOptions)}createTexture(t,e,r,n){const i=new s.v({...this.textureOptions,width:t,height:e,resolution:1,antialias:r,autoGarbageCollect:!1,autoGenerateMipmaps:n});return new o.g({source:i,label:"texturePool_"+h++})}getOptimalTexture(t,e,r=1,i,s=!1){let o=Math.ceil(t*r-1e-6),a=Math.ceil(e*r-1e-6);o=(0,n.U5)(o),a=(0,n.U5)(a);const h=(o<<17)+(a<<2)+((s?1:0)<<1)+(i?1:0);this._texturePool[h]||(this._texturePool[h]=[]);let l=this._texturePool[h].pop();return l||(l=this.createTexture(o,a,i,s)),l.source._resolution=r,l.source.width=o/r,l.source.height=a/r,l.source.pixelWidth=o,l.source.pixelHeight=a,l.frame.x=0,l.frame.y=0,l.frame.width=t,l.frame.height=e,l.updateUvs(),this._poolKeyHash[l.uid]=h,l}getSameSizeTexture(t,e=!1){const r=t.source;return this.getOptimalTexture(t.width,t.height,r._resolution,e)}returnTexture(t,e=!1){const r=this._poolKeyHash[t.uid];e&&(t.source.style=this.textureStyle),this._texturePool[r].push(t)}clear(t){if(t=!1!==t)for(const t in this._texturePool){const e=this._texturePool[t];if(e)for(let t=0;t<e.length;t++)e[t].destroy(!0)}this._texturePool={}}};i.L.register(l)},218:(t,e,r)=>{r.d(e,{n:()=>h});var n=r(8875),i=r(133),s=r(4670);const o=Object.create(null);const a=class t extends n.A{constructor(e={}){super(),this._resourceType="textureSampler",this._touched=0,this._maxAnisotropy=1,this.destroyed=!1,e={...t.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(t){this.addressModeU=t,this.addressModeV=t,this.addressModeW=t}get addressMode(){return this.addressModeU}set wrapMode(t){(0,s.t6)(s.lj,"TextureStyle.wrapMode is now TextureStyle.addressMode"),this.addressMode=t}get wrapMode(){return this.addressMode}set scaleMode(t){this.magFilter=t,this.minFilter=t,this.mipmapFilter=t}get scaleMode(){return this.magFilter}set maxAnisotropy(t){this._maxAnisotropy=Math.min(t,16),this._maxAnisotropy>1&&(this.scaleMode="linear")}get maxAnisotropy(){return this._maxAnisotropy}get _resourceId(){return this._sharedResourceId||this._generateResourceId()}update(){this._sharedResourceId=null,this.emit("change",this)}_generateResourceId(){const t=`${this.addressModeU}-${this.addressModeV}-${this.addressModeW}-${this.magFilter}-${this.minFilter}-${this.mipmapFilter}-${this.lodMinClamp}-${this.lodMaxClamp}-${this.compare}-${this._maxAnisotropy}`;return this._sharedResourceId=function(t){const e=o[t];return void 0===e&&(o[t]=(0,i.L)("resource")),e}(t),this._resourceId}destroy(){this.destroyed=!0,this.emit("destroy",this),this.emit("change",this),this.removeAllListeners()}};a.defaultOptions={addressMode:"clamp-to-edge",scaleMode:"linear"};let h=a},4195:(t,e,r)=>{r.d(e,{P:()=>s});var n=r(8507),i=r(583);class s extends i.v{constructor(t){const e=t.resource||new Float32Array(t.width*t.height*4);let r=t.format;r||(r=e instanceof Float32Array?"rgba32float":e instanceof Int32Array||e instanceof Uint32Array?"rgba32uint":e instanceof Int16Array||e instanceof Uint16Array?"rgba16uint":(Int8Array,"bgra8unorm")),super({...t,resource:e,format:r}),this.uploadMethodId="buffer"}static test(t){return t instanceof Int8Array||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array}}s.extension=n.Ag.TextureSource},4884:(t,e,r)=>{r.d(e,{q:()=>o});var n=r(1761),i=r(8507),s=r(583);class o extends s.v{constructor(t){t.resource||(t.resource=n.e.get().createCanvas()),t.width||(t.width=t.resource.width,t.autoDensity||(t.width/=t.resolution)),t.height||(t.height=t.resource.height,t.autoDensity||(t.height/=t.resolution)),super(t),this.uploadMethodId="image",this.autoDensity=t.autoDensity,this.resizeCanvas(),this.transparent=!!t.transparent}resizeCanvas(){this.autoDensity&&"style"in this.resource&&(this.resource.style.width=`${this.width}px`,this.resource.style.height=`${this.height}px`),this.resource.width===this.pixelWidth&&this.resource.height===this.pixelHeight||(this.resource.width=this.pixelWidth,this.resource.height=this.pixelHeight)}resize(t=this.width,e=this.height,r=this._resolution){const n=super.resize(t,e,r);return n&&this.resizeCanvas(),n}static test(t){return globalThis.HTMLCanvasElement&&t instanceof HTMLCanvasElement||globalThis.OffscreenCanvas&&t instanceof OffscreenCanvas}get context2D(){return this._context2D||(this._context2D=this.resource.getContext("2d"))}}o.extension=i.Ag.TextureSource},8293:(t,e,r)=>{r.d(e,{b:()=>s});var n=r(8507),i=r(583);class s extends i.v{constructor(t){super(t),this.uploadMethodId="image",this.autoGarbageCollect=!0}static test(t){return globalThis.HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap||globalThis.VideoFrame&&t instanceof VideoFrame}}s.extension=n.Ag.TextureSource},583:(t,e,r)=>{r.d(e,{v:()=>l});var n=r(8875),i=r(9939),s=r(2698),o=r(133),a=r(218);const h=class t extends n.A{constructor(e={}){super(),this.options=e,this._gpuData=Object.create(null),this._gcLastUsed=-1,this.uid=(0,o.L)("textureSource"),this._resourceType="textureSource",this._resourceId=(0,o.L)("resource"),this.uploadMethodId="unknown",this._resolution=1,this.pixelWidth=1,this.pixelHeight=1,this.width=1,this.height=1,this.sampleCount=1,this.mipLevelCount=1,this.autoGenerateMipmaps=!1,this.format="rgba8unorm",this.dimension="2d",this.viewDimension="2d",this.arrayLayerCount=1,this.antialias=!1,this._touched=0,this._batchTick=-1,this._textureBindLocation=-1,e={...t.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.viewDimension=e.viewDimension??e.dimensions,this.arrayLayerCount=e.arrayLayerCount,this.mipLevelCount=e.mipLevelCount,this.autoGenerateMipmaps=e.autoGenerateMipmaps,this.sampleCount=e.sampleCount,this.antialias=e.antialias,this.alphaMode=e.alphaMode,this.style=new a.n((0,s.S)(e)),this.destroyed=!1,this._refreshPOT()}get source(){return this}get style(){return this._style}set style(t){this.style!==t&&(this._style?.off("change",this._onStyleChange,this),this._style=t,this._style?.on("change",this._onStyleChange,this),this._onStyleChange())}set maxAnisotropy(t){this._style.maxAnisotropy=t}get maxAnisotropy(){return this._style.maxAnisotropy}get addressMode(){return this._style.addressMode}set addressMode(t){this._style.addressMode=t}get repeatMode(){return this._style.addressMode}set repeatMode(t){this._style.addressMode=t}get magFilter(){return this._style.magFilter}set magFilter(t){this._style.magFilter=t}get minFilter(){return this._style.minFilter}set minFilter(t){this._style.minFilter=t}get mipmapFilter(){return this._style.mipmapFilter}set mipmapFilter(t){this._style.mipmapFilter=t}get lodMinClamp(){return this._style.lodMinClamp}set lodMinClamp(t){this._style.lodMinClamp=t}get lodMaxClamp(){return this._style.lodMaxClamp}set lodMaxClamp(t){this._style.lodMaxClamp=t}_onStyleChange(){this.emit("styleChange",this)}update(){if(this.resource){const t=this._resolution;if(this.resize(this.resourceWidth/t,this.resourceHeight/t))return}this.emit("update",this)}destroy(){this.destroyed=!0,this.unload(),this.emit("destroy",this),this._style&&(this._style.destroy(),this._style=null),this.uploadMethodId=null,this.resource=null,this.removeAllListeners()}unload(){this._resourceId=(0,o.L)("resource"),this.emit("change",this),this.emit("unload",this);for(const t in this._gpuData)this._gpuData[t]?.destroy?.();this._gpuData=Object.create(null)}get resourceWidth(){const{resource:t}=this;return t.naturalWidth||t.videoWidth||t.displayWidth||t.width}get resourceHeight(){const{resource:t}=this;return t.naturalHeight||t.videoHeight||t.displayHeight||t.height}get resolution(){return this._resolution}set resolution(t){this._resolution!==t&&(this._resolution=t,this.width=this.pixelWidth/t,this.height=this.pixelHeight/t)}resize(t,e,r){r||(r=this._resolution),t||(t=this.width),e||(e=this.height);const n=Math.round(t*r),i=Math.round(e*r);return this.width=n/r,this.height=i/r,this._resolution=r,(this.pixelWidth!==n||this.pixelHeight!==i)&&(this._refreshPOT(),this.pixelWidth=n,this.pixelHeight=i,this.emit("resize",this),this._resourceId=(0,o.L)("resource"),this.emit("change",this),!0)}updateMipmaps(){this.autoGenerateMipmaps&&this.mipLevelCount>1&&this.emit("updateMipmaps",this)}set wrapMode(t){this._style.wrapMode=t}get wrapMode(){return this._style.wrapMode}set scaleMode(t){this._style.scaleMode=t}get scaleMode(){return this._style.scaleMode}_refreshPOT(){this.isPowerOfTwo=(0,i.f3)(this.pixelWidth)&&(0,i.f3)(this.pixelHeight)}static test(t){throw new Error("Unimplemented")}};h.defaultOptions={resolution:1,format:"bgra8unorm",alphaMode:"premultiply-alpha-on-upload",dimensions:"2d",viewDimension:"2d",arrayLayerCount:1,mipLevelCount:1,autoGenerateMipmaps:!1,sampleCount:1,antialias:!1,autoGarbageCollect:!1};let l=h},9726:(t,e,r)=>{var n=r(268),i=r(2406);const s=new class{constructor(){this._parsers=[],this._cache=new Map,this._cacheMap=new Map}reset(){this._cacheMap.clear(),this._cache.clear()}has(t){return this._cache.has(t)}get(t){const e=this._cache.get(t);return e||(0,n.R)(`[Assets] Asset id ${t} was not found in the Cache`),e}set(t,e){const r=(0,i.z)(t);let s;for(let t=0;t<this.parsers.length;t++){const n=this.parsers[t];if(n.test(e)){s=n.getCacheableAssets(r,e);break}}const o=new Map(Object.entries(s||{}));s||r.forEach((t=>{o.set(t,e)}));const a=[...o.keys()],h={cacheKeys:a,keys:r};r.forEach((t=>{this._cacheMap.set(t,h)})),a.forEach((t=>{const r=s?s[t]:e;this._cache.has(t)&&this._cache.get(t)!==r&&(0,n.R)("[Cache] already has key:",t),this._cache.set(t,o.get(t))}))}remove(t){if(!this._cacheMap.has(t))return void(0,n.R)(`[Assets] Asset id ${t} was not found in the Cache`);const e=this._cacheMap.get(t);e.cacheKeys.forEach((t=>{this._cache.delete(t)})),e.keys.forEach((t=>{this._cacheMap.delete(t)}))}get parsers(){return this._parsers}};var o=r(8507),a=r(583),h=r(5589);const l=[];function u(t={}){const e=t&&t.resource,r=e?t.resource:t,n=e?t:{resource:t};for(let t=0;t<l.length;t++){const e=l[t];if(e.test(r))return new e(n)}throw new Error(`Could not find a source type for resource: ${n.resource}`)}o.XO.handleByList(o.Ag.TextureSource,l),h.g.from=function(t,e=!1){return"string"==typeof t?s.get(t):t instanceof a.v?new h.g({source:t}):function(t={},e=!1){const r=t&&t.resource,n=r?t.resource:t,i=r?t:{resource:t};if(!e&&s.has(n))return s.get(n);const o=new h.g({source:u(i)});return o.on("destroy",(()=>{s.has(n)&&s.remove(n)})),e||s.set(n,o),o}(t,e)},a.v.from=u},7952:(t,e,r)=>{r.d(e,{X:()=>s});const n=Object.create(null),i=Object.create(null);function s(t,e){let r=i[t];return void 0===r&&(void 0===n[e]&&(n[e]=1),i[t]=r=n[e]++),r}},5099:(t,e,r)=>{r.d(e,{W:()=>n});var n=(t=>(t[t.WEBGL=1]="WEBGL",t[t.WEBGPU=2]="WEBGPU",t[t.CANVAS=4]="CANVAS",t[t.BOTH=3]="BOTH",t))(n||{})},5559:(t,e,r)=>{r.d(e,{mc:()=>X,u:()=>W,ig:()=>N,fR:()=>U});var n=r(8875),i=r(2577);var s=r(8507),o=r(9313),a=r(1652),h=r(2812),l=r(133),u=r(4670),c=r(268),d=r(8655);const f={get isCachedAsTexture(){return!!this.renderGroup?.isCachedAsTexture},cacheAsTexture(t){"boolean"==typeof t&&!1===t?this.disableRenderGroup():(this.enableRenderGroup(),this.renderGroup.enableCacheAsTexture(!0===t?{}:t))},updateCacheTexture(){this.renderGroup?.updateCacheTexture()},get cacheAsBitmap(){return this.isCachedAsTexture},set cacheAsBitmap(t){(0,u.t6)("v8.6.0","cacheAsBitmap is deprecated, use cacheAsTexture instead."),this.cacheAsTexture(t)}};var p=r(9903);const y={allowChildren:!0,removeChildren(t=0,e){const r=e??this.children.length,n=r-t,i=[];if(n>0&&n<=r){for(let e=r-1;e>=t;e--){const t=this.children[e];t&&(i.push(t),t.parent=null)}(0,p.d)(this.children,t,r);const e=this.renderGroup||this.parentRenderGroup;e&&e.removeChildren(i);for(let t=0;t<i.length;++t){const e=i[t];e.parentRenderLayer?.detach(e),this.emit("childRemoved",e,this,t),i[t].emit("removed",this)}return i.length>0&&this._didViewChangeTick++,i}if(0===n&&0===this.children.length)return i;throw new RangeError("removeChildren: numeric values are outside the acceptable range.")},removeChildAt(t){const e=this.getChildAt(t);return this.removeChild(e)},getChildAt(t){if(t<0||t>=this.children.length)throw new Error(`getChildAt: Index (${t}) does not exist.`);return this.children[t]},setChildIndex(t,e){if(e<0||e>=this.children.length)throw new Error(`The index ${e} supplied is out of bounds ${this.children.length}`);this.getChildIndex(t),this.addChildAt(t,e)},getChildIndex(t){const e=this.children.indexOf(t);if(-1===e)throw new Error("The supplied Container must be a child of the caller");return e},addChildAt(t,e){this.allowChildren||(0,u.t6)(u.lj,"addChildAt: Only Containers will be allowed to add children in v8.0.0");const{children:r}=this;if(e<0||e>r.length)throw new Error(`${t}addChildAt: The index ${e} supplied is out of bounds ${r.length}`);const n=t.parent===this;if(t.parent){const r=t.parent.children.indexOf(t);if(n){if(r===e)return t;t.parent.children.splice(r,1)}else t.removeFromParent()}e===r.length?r.push(t):r.splice(e,0,t),t.parent=this,t.didChange=!0,t._updateFlags=15;const i=this.renderGroup||this.parentRenderGroup;return i&&i.addChild(t),this.sortableChildren&&(this.sortDirty=!0),n||(this.emit("childAdded",t,this,e),t.emit("added",this)),t},swapChildren(t,e){if(t===e)return;const r=this.getChildIndex(t),n=this.getChildIndex(e);this.children[r]=e,this.children[n]=t;const i=this.renderGroup||this.parentRenderGroup;i&&(i.structureDidChange=!0),this._didContainerChangeTick++},removeFromParent(){this.parent?.removeChild(this)},reparentChild(...t){return 1===t.length?this.reparentChildAt(t[0],this.children.length):(t.forEach((t=>this.reparentChildAt(t,this.children.length))),t[0])},reparentChildAt(t,e){if(t.parent===this)return this.setChildIndex(t,e),t;const r=t.worldTransform.clone();t.removeFromParent(),this.addChildAt(t,e);const n=this.worldTransform.clone();return n.invert(),r.prepend(n),t.setFromMatrix(r),t},replaceChild(t,e){t.updateLocalTransform(),this.addChildAt(e,this.getChildIndex(t)),e.setFromMatrix(t.localTransform),e.updateLocalTransform(),this.removeChild(t)}},m={collectRenderables(t,e,r){this.parentRenderLayer&&this.parentRenderLayer!==r||this.globalDisplayStatus<7||!this.includeInBuild||(this.sortableChildren&&this.sortChildren(),this.isSimple?this.collectRenderablesSimple(t,e,r):this.renderGroup?e.renderPipes.renderGroup.addRenderGroup(this.renderGroup,t):this.collectRenderablesWithEffects(t,e,r))},collectRenderablesSimple(t,e,r){const n=this.children,i=n.length;for(let s=0;s<i;s++)n[s].collectRenderables(t,e,r)},collectRenderablesWithEffects(t,e,r){const{renderPipes:n}=e;for(let e=0;e<this.effects.length;e++){const r=this.effects[e];n[r.pipe].push(r,this,t)}this.collectRenderablesSimple(t,e,r);for(let e=this.effects.length-1;e>=0;e--){const r=this.effects[e];n[r.pipe].pop(r,this,t)}}};var g=r(9049);const x=new class{constructor(){this._effectClasses=[],this._tests=[],this._initialized=!1}init(){this._initialized||(this._initialized=!0,this._effectClasses.forEach((t=>{this.add({test:t.test,maskClass:t})})))}add(t){this._tests.push(t)}getMaskEffect(t){this._initialized||this.init();for(let e=0;e<this._tests.length;e++){const r=this._tests[e];if(r.test(t))return d.Z.get(r.maskClass,t)}return t}returnMaskEffect(t){d.Z.return(t)}};s.XO.handleByList(s.Ag.MaskEffect,x._effectClasses);const v={_maskEffect:null,_maskOptions:{inverse:!1},_filterEffect:null,effects:[],_markStructureAsChanged(){const t=this.renderGroup||this.parentRenderGroup;t&&(t.structureDidChange=!0)},addEffect(t){-1===this.effects.indexOf(t)&&(this.effects.push(t),this.effects.sort(((t,e)=>t.priority-e.priority)),this._markStructureAsChanged(),this._updateIsSimple())},removeEffect(t){const e=this.effects.indexOf(t);-1!==e&&(this.effects.splice(e,1),this._markStructureAsChanged(),this._updateIsSimple())},set mask(t){const e=this._maskEffect;e?.mask!==t&&(e&&(this.removeEffect(e),x.returnMaskEffect(e),this._maskEffect=null),null!=t&&(this._maskEffect=x.getMaskEffect(t),this.addEffect(this._maskEffect)))},get mask(){return this._maskEffect?.mask},setMask(t){this._maskOptions={...this._maskOptions,...t},t.mask&&(this.mask=t.mask),this._markStructureAsChanged()},set filters(t){!Array.isArray(t)&&t&&(t=[t]);const e=this._filterEffect||(this._filterEffect=new g.a),r=t?.length>0,n=r!==e.filters?.length>0;t=Array.isArray(t)?t.slice(0):t,e.filters=Object.freeze(t),n&&(r?this.addEffect(e):(this.removeEffect(e),e.filters=t??null))},get filters(){return this._filterEffect?.filters},set filterArea(t){this._filterEffect||(this._filterEffect=new g.a),this._filterEffect.filterArea=t},get filterArea(){return this._filterEffect?.filterArea}},b={label:null,get name(){return(0,u.t6)(u.lj,"Container.name property has been removed, use Container.label instead"),this.label},set name(t){(0,u.t6)(u.lj,"Container.name property has been removed, use Container.label instead"),this.label=t},getChildByName(t,e=!1){return this.getChildByLabel(t,e)},getChildByLabel(t,e=!1){const r=this.children;for(let e=0;e<r.length;e++){const n=r[e];if(n.label===t||t instanceof RegExp&&t.test(n.label))return n}if(e)for(let e=0;e<r.length;e++){const n=r[e].getChildByLabel(t,!0);if(n)return n}return null},getChildrenByLabel(t,e=!1,r=[]){const n=this.children;for(let e=0;e<n.length;e++){const i=n[e];(i.label===t||t instanceof RegExp&&t.test(i.label))&&r.push(i)}if(e)for(let e=0;e<n.length;e++)n[e].getChildrenByLabel(t,!0,r);return r}};var _=r(9636),w=r(2208);const S=new o.u,C={getFastGlobalBounds(t,e){e||(e=new _.c),e.clear(),this._getGlobalBoundsRecursive(!!t,e,this.parentRenderLayer),e.isValid||e.set(0,0,0,0);const r=this.renderGroup||this.parentRenderGroup;return e.applyMatrix(r.worldTransform),e},_getGlobalBoundsRecursive(t,e,r){let n=e;if(t&&this.parentRenderLayer&&this.parentRenderLayer!==r)return;if(7!==this.localDisplayStatus||!this.measurable)return;const i=!!this.effects.length;if((this.renderGroup||i)&&(n=w.o.get().clear()),this.boundsArea)e.addRect(this.boundsArea,this.worldTransform);else{if(this.renderPipeId){const t=this.bounds;n.addFrame(t.minX,t.minY,t.maxX,t.maxY,this.groupTransform)}const e=this.children;for(let i=0;i<e.length;i++)e[i]._getGlobalBoundsRecursive(t,n,r)}if(i){let t=!1;const r=this.renderGroup||this.parentRenderGroup;for(let e=0;e<this.effects.length;e++)this.effects[e].addBounds&&(t||(t=!0,n.applyMatrix(r.worldTransform)),this.effects[e].addBounds(n,!0));t&&n.applyMatrix(r.worldTransform.copyTo(S).invert()),e.addBounds(n),w.o.return(n)}else this.renderGroup&&(e.addBounds(n,this.relativeGroupTransform),w.o.return(n))}};var M=r(198),T=r(9443),A=r(7269);function k(t,e){const r=t.children;for(let t=0;t<r.length;t++){const n=r[t],i=n.uid,s=(65535&n._didViewChangeTick)<<16|65535&n._didContainerChangeTick,o=e.index;e.data[o]===i&&e.data[o+1]===s||(e.data[e.index]=i,e.data[e.index+1]=s,e.didChange=!0),e.index=o+2,n.children.length&&k(n,e)}return e.didChange}const P=new o.u,E={_localBoundsCacheId:-1,_localBoundsCacheData:null,_setWidth(t,e){const r=Math.sign(this.scale.x)||1;this.scale.x=0!==e?t/e*r:r},_setHeight(t,e){const r=Math.sign(this.scale.y)||1;this.scale.y=0!==e?t/e*r:r},getLocalBounds(){this._localBoundsCacheData||(this._localBoundsCacheData={data:[],index:1,didChange:!1,localBounds:new _.c});const t=this._localBoundsCacheData;return t.index=1,t.didChange=!1,t.data[0]!==this._didViewChangeTick&&(t.didChange=!0,t.data[0]=this._didViewChangeTick),k(this,t),t.didChange&&(0,A.n)(this,t.localBounds,P),t.localBounds},getBounds(t,e){return(0,T.f)(this,t,e||new _.c)}},R={_onRender:null,set onRender(t){const e=this.renderGroup||this.parentRenderGroup;if(!t)return this._onRender&&e?.removeOnRender(this),void(this._onRender=null);this._onRender||e?.addOnRender(this),this._onRender=t},get onRender(){return this._onRender}},I={_zIndex:0,sortDirty:!1,sortableChildren:!1,get zIndex(){return this._zIndex},set zIndex(t){this._zIndex!==t&&(this._zIndex=t,this.depthOfChildModified())},depthOfChildModified(){this.parent&&(this.parent.sortableChildren=!0,this.parent.sortDirty=!0),this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0)},sortChildren(){this.sortDirty&&(this.sortDirty=!1,this.children.sort(O))}};function O(t,e){return t._zIndex-e._zIndex}var L=r(5101);const B={getGlobalPosition(t=new L.b,e=!1){return this.parent?this.parent.toGlobal(this._position,t,e):(t.x=this._position.x,t.y=this._position.y),t},toGlobal(t,e,r=!1){const n=this.getGlobalTransform(w.u.get(),r);return e=n.apply(t,e),w.u.return(n),e},toLocal(t,e,r,n){e&&(t=e.toGlobal(t,r,n));const i=this.getGlobalTransform(w.u.get(),n);return r=i.applyInverse(t,r),w.u.return(i),r}};var D=r(3284);const F=new h.o(null),G=new h.o(null),j=new h.o(null,1,1),z=new h.o(null),N=1,W=2,U=4;class X extends n.A{constructor(t={}){super(),this.uid=(0,l.L)("renderable"),this._updateFlags=15,this.renderGroup=null,this.parentRenderGroup=null,this.parentRenderGroupIndex=0,this.didChange=!1,this.didViewUpdate=!1,this.relativeRenderGroupDepth=0,this.children=[],this.parent=null,this.includeInBuild=!0,this.measurable=!0,this.isSimple=!0,this.parentRenderLayer=null,this.updateTick=-1,this.localTransform=new o.u,this.relativeGroupTransform=new o.u,this.groupTransform=this.relativeGroupTransform,this.destroyed=!1,this._position=new h.o(this,0,0),this._scale=j,this._pivot=G,this._origin=z,this._skew=F,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=[],function(t,e,r={}){for(const n in e)r[n]||void 0===e[n]||(t[n]=e[n])}(this,t,{children:!0,parent:!0,effects:!0}),t.children?.forEach((t=>this.addChild(t))),t.parent?.addChild(this)}static mixin(t){(0,u.t6)("8.8.0","Container.mixin is deprecated, please use extensions.mixin instead."),s.XO.mixin(X,t)}set _didChangeId(t){this._didViewChangeTick=t>>12&4095,this._didContainerChangeTick=4095&t}get _didChangeId(){return 4095&this._didContainerChangeTick|(4095&this._didViewChangeTick)<<12}addChild(...t){if(this.allowChildren||(0,u.t6)(u.lj,"addChild: Only Containers will be allowed to add children in v8.0.0"),t.length>1){for(let e=0;e<t.length;e++)this.addChild(t[e]);return t[0]}const e=t[0],r=this.renderGroup||this.parentRenderGroup;return e.parent===this?(this.children.splice(this.children.indexOf(e),1),this.children.push(e),r&&(r.structureDidChange=!0),e):(e.parent&&e.parent.removeChild(e),this.children.push(e),this.sortableChildren&&(this.sortDirty=!0),e.parent=this,e.didChange=!0,e._updateFlags=15,r&&r.addChild(e),this.emit("childAdded",e,this,this.children.length-1),e.emit("added",this),this._didViewChangeTick++,0!==e._zIndex&&e.depthOfChildModified(),e)}removeChild(...t){if(t.length>1){for(let e=0;e<t.length;e++)this.removeChild(t[e]);return t[0]}const e=t[0],r=this.children.indexOf(e);return r>-1&&(this._didViewChangeTick++,this.children.splice(r,1),this.renderGroup?this.renderGroup.removeChild(e):this.parentRenderGroup&&this.parentRenderGroup.removeChild(e),e.parentRenderLayer&&e.parentRenderLayer.detach(e),e.parent=null,this.emit("childRemoved",e,this,r),e.emit("removed",this)),e}_onUpdate(t){t&&t===this._skew&&this._updateSkew(),this._didContainerChangeTick++,this.didChange||(this.didChange=!0,this.parentRenderGroup&&this.parentRenderGroup.onChildUpdate(this))}set isRenderGroup(t){!!this.renderGroup!==t&&(t?this.enableRenderGroup():this.disableRenderGroup())}get isRenderGroup(){return!!this.renderGroup}enableRenderGroup(){if(this.renderGroup)return;const t=this.parentRenderGroup;t?.removeChild(this),this.renderGroup=d.Z.get(D.m,this),this.groupTransform=o.u.IDENTITY,t?.addChild(this),this._updateIsSimple()}disableRenderGroup(){if(!this.renderGroup)return;const t=this.parentRenderGroup;t?.removeChild(this),d.Z.return(this.renderGroup),this.renderGroup=null,this.groupTransform=this.relativeGroupTransform,t?.addChild(this),this._updateIsSimple()}_updateIsSimple(){this.isSimple=!this.renderGroup&&0===this.effects.length}get worldTransform(){return this._worldTransform||(this._worldTransform=new o.u),this.renderGroup?this._worldTransform.copyFrom(this.renderGroup.worldTransform):this.parentRenderGroup&&this._worldTransform.appendFrom(this.relativeGroupTransform,this.parentRenderGroup.worldTransform),this._worldTransform}get x(){return this._position.x}set x(t){this._position.x=t}get y(){return this._position.y}set y(t){this._position.y=t}get position(){return this._position}set position(t){this._position.copyFrom(t)}get rotation(){return this._rotation}set rotation(t){this._rotation!==t&&(this._rotation=t,this._onUpdate(this._skew))}get angle(){return this.rotation*a.bO}set angle(t){this.rotation=t*a.Td}get pivot(){return this._pivot===G&&(this._pivot=new h.o(this,0,0)),this._pivot}set pivot(t){this._pivot===G&&(this._pivot=new h.o(this,0,0),this._origin!==z&&(0,c.R)("Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.")),"number"==typeof t?this._pivot.set(t):this._pivot.copyFrom(t)}get skew(){return this._skew===F&&(this._skew=new h.o(this,0,0)),this._skew}set skew(t){this._skew===F&&(this._skew=new h.o(this,0,0)),this._skew.copyFrom(t)}get scale(){return this._scale===j&&(this._scale=new h.o(this,1,1)),this._scale}set scale(t){this._scale===j&&(this._scale=new h.o(this,0,0)),"string"==typeof t&&(t=parseFloat(t)),"number"==typeof t?this._scale.set(t):this._scale.copyFrom(t)}get origin(){return this._origin===z&&(this._origin=new h.o(this,0,0)),this._origin}set origin(t){this._origin===z&&(this._origin=new h.o(this,0,0),this._pivot!==G&&(0,c.R)("Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.")),"number"==typeof t?this._origin.set(t):this._origin.copyFrom(t)}get width(){return Math.abs(this.scale.x*this.getLocalBounds().width)}set width(t){const e=this.getLocalBounds().width;this._setWidth(t,e)}get height(){return Math.abs(this.scale.y*this.getLocalBounds().height)}set height(t){const e=this.getLocalBounds().height;this._setHeight(t,e)}getSize(t){t||(t={});const e=this.getLocalBounds();return t.width=Math.abs(this.scale.x*e.width),t.height=Math.abs(this.scale.y*e.height),t}setSize(t,e){const r=this.getLocalBounds();"object"==typeof t?(e=t.height??t.width,t=t.width):e??(e=t),void 0!==t&&this._setWidth(t,r.width),void 0!==e&&this._setHeight(e,r.height)}_updateSkew(){const t=this._rotation,e=this._skew;this._cx=Math.cos(t+e._y),this._sx=Math.sin(t+e._y),this._cy=-Math.sin(t-e._x),this._sy=Math.cos(t-e._x)}updateTransform(t){return this.position.set("number"==typeof t.x?t.x:this.position.x,"number"==typeof t.y?t.y:this.position.y),this.scale.set("number"==typeof t.scaleX?t.scaleX||1:this.scale.x,"number"==typeof t.scaleY?t.scaleY||1:this.scale.y),this.rotation="number"==typeof t.rotation?t.rotation:this.rotation,this.skew.set("number"==typeof t.skewX?t.skewX:this.skew.x,"number"==typeof t.skewY?t.skewY:this.skew.y),this.pivot.set("number"==typeof t.pivotX?t.pivotX:this.pivot.x,"number"==typeof t.pivotY?t.pivotY:this.pivot.y),this.origin.set("number"==typeof t.originX?t.originX:this.origin.x,"number"==typeof t.originY?t.originY:this.origin.y),this}setFromMatrix(t){t.decompose(this)}updateLocalTransform(){const t=this._didContainerChangeTick;if(this._didLocalTransformChangeId===t)return;this._didLocalTransformChangeId=t;const e=this.localTransform,r=this._scale,n=this._pivot,i=this._origin,s=this._position,o=r._x,a=r._y,h=n._x,l=n._y,u=-i._x,c=-i._y;e.a=this._cx*o,e.b=this._sx*o,e.c=this._cy*a,e.d=this._sy*a,e.tx=s._x-(h*e.a+l*e.c)+(u*e.a+c*e.c)-u,e.ty=s._y-(h*e.b+l*e.d)+(u*e.b+c*e.d)-c}set alpha(t){t!==this.localAlpha&&(this.localAlpha=t,this._updateFlags|=N,this._onUpdate())}get alpha(){return this.localAlpha}set tint(t){const e=i.Q.shared.setValue(t??16777215).toBgrNumber();e!==this.localColor&&(this.localColor=e,this._updateFlags|=N,this._onUpdate())}get tint(){return(0,M.D)(this.localColor)}set blendMode(t){this.localBlendMode!==t&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=W,this.localBlendMode=t,this._onUpdate())}get blendMode(){return this.localBlendMode}get visible(){return!!(2&this.localDisplayStatus)}set visible(t){const e=t?2:0;(2&this.localDisplayStatus)!==e&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=U,this.localDisplayStatus^=2,this._onUpdate(),this.emit("visibleChanged",t))}get culled(){return!(4&this.localDisplayStatus)}set culled(t){const e=t?0:4;(4&this.localDisplayStatus)!==e&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=U,this.localDisplayStatus^=4,this._onUpdate())}get renderable(){return!!(1&this.localDisplayStatus)}set renderable(t){const e=t?1:0;(1&this.localDisplayStatus)!==e&&(this._updateFlags|=U,this.localDisplayStatus^=1,this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._onUpdate())}get isRenderable(){return 7===this.localDisplayStatus&&this.groupAlpha>0}destroy(t=!1){if(this.destroyed)return;let e;this.destroyed=!0,this.children.length&&(e=this.removeChildren(0,this.children.length)),this.removeFromParent(),this.parent=null,this._maskEffect=null,this._filterEffect=null,this.effects=null,this._position=null,this._scale=null,this._pivot=null,this._origin=null,this._skew=null,this.emit("destroyed",this),this.removeAllListeners();if(("boolean"==typeof t?t:t?.children)&&e)for(let r=0;r<e.length;++r)e[r].destroy(t);this.renderGroup?.destroy(),this.renderGroup=null}}s.XO.mixin(X,y,C,B,R,E,v,b,I,{cullArea:null,cullable:!1,cullableChildren:!0},f,M.R,m)},3284:(t,e,r)=>{r.d(e,{m:()=>o});var n=r(9313),i=r(848),s=r(2437);class o{constructor(){this.renderPipeId="renderGroup",this.root=null,this.canBundle=!1,this.renderGroupParent=null,this.renderGroupChildren=[],this.worldTransform=new n.u,this.worldColorAlpha=4294967295,this.worldColor=16777215,this.worldAlpha=1,this.childrenToUpdate=Object.create(null),this.updateTick=0,this.gcTick=0,this.childrenRenderablesToUpdate={list:[],index:0},this.structureDidChange=!0,this.instructionSet=new i.L,this._onRenderContainers=[],this.textureNeedsUpdate=!0,this.isCachedAsTexture=!1,this._matrixDirty=7}init(t){this.root=t,t._onRender&&this.addOnRender(t),t.didChange=!0;const e=t.children;for(let t=0;t<e.length;t++){const r=e[t];r._updateFlags=15,this.addChild(r)}}enableCacheAsTexture(t={}){this.textureOptions=t,this.isCachedAsTexture=!0,this.textureNeedsUpdate=!0}disableCacheAsTexture(){this.isCachedAsTexture=!1,this.texture&&(s.W.returnTexture(this.texture,!0),this.texture=null)}updateCacheTexture(){this.textureNeedsUpdate=!0;const t=this._parentCacheAsTextureRenderGroup;t&&!t.textureNeedsUpdate&&t.updateCacheTexture()}reset(){this.renderGroupChildren.length=0;for(const t in this.childrenToUpdate){const e=this.childrenToUpdate[t];e.list.fill(null),e.index=0}this.childrenRenderablesToUpdate.index=0,this.childrenRenderablesToUpdate.list.fill(null),this.root=null,this.updateTick=0,this.structureDidChange=!0,this._onRenderContainers.length=0,this.renderGroupParent=null,this.disableCacheAsTexture()}get localTransform(){return this.root.localTransform}addRenderGroupChild(t){t.renderGroupParent&&t.renderGroupParent._removeRenderGroupChild(t),t.renderGroupParent=this,this.renderGroupChildren.push(t)}_removeRenderGroupChild(t){const e=this.renderGroupChildren.indexOf(t);e>-1&&this.renderGroupChildren.splice(e,1),t.renderGroupParent=null}addChild(t){if(this.structureDidChange=!0,t.parentRenderGroup=this,t.updateTick=-1,t.parent===this.root?t.relativeRenderGroupDepth=1:t.relativeRenderGroupDepth=t.parent.relativeRenderGroupDepth+1,t.didChange=!0,this.onChildUpdate(t),t.renderGroup)return void this.addRenderGroupChild(t.renderGroup);t._onRender&&this.addOnRender(t);const e=t.children;for(let t=0;t<e.length;t++)this.addChild(e[t])}removeChild(t){if(this.structureDidChange=!0,t._onRender&&(t.renderGroup||this.removeOnRender(t)),t.parentRenderGroup=null,t.renderGroup)return void this._removeRenderGroupChild(t.renderGroup);const e=t.children;for(let t=0;t<e.length;t++)this.removeChild(e[t])}removeChildren(t){for(let e=0;e<t.length;e++)this.removeChild(t[e])}onChildUpdate(t){let e=this.childrenToUpdate[t.relativeRenderGroupDepth];e||(e=this.childrenToUpdate[t.relativeRenderGroupDepth]={index:0,list:[]}),e.list[e.index++]=t}updateRenderable(t){t.globalDisplayStatus<7||(this.instructionSet.renderPipes[t.renderPipeId].updateRenderable(t),t.didViewUpdate=!1)}onChildViewUpdate(t){this.childrenRenderablesToUpdate.list[this.childrenRenderablesToUpdate.index++]=t}get isRenderable(){return 7===this.root.localDisplayStatus&&this.worldAlpha>0}addOnRender(t){this._onRenderContainers.push(t)}removeOnRender(t){this._onRenderContainers.splice(this._onRenderContainers.indexOf(t),1)}runOnRender(t){for(let e=0;e<this._onRenderContainers.length;e++)this._onRenderContainers[e]._onRender(t)}destroy(){this.disableCacheAsTexture(),this.renderGroupParent=null,this.root=null,this.childrenRenderablesToUpdate=null,this.childrenToUpdate=null,this.renderGroupChildren=null,this._onRenderContainers=null,this.instructionSet=null}getChildren(t=[]){const e=this.root.children;for(let r=0;r<e.length;r++)this._getChildren(e[r],t);return t}_getChildren(t,e=[]){if(e.push(t),t.renderGroup)return e;const r=t.children;for(let t=0;t<r.length;t++)this._getChildren(r[t],e);return e}invalidateMatrices(){this._matrixDirty=7}get inverseWorldTransform(){return 1&this._matrixDirty?(this._matrixDirty&=-2,this._inverseWorldTransform||(this._inverseWorldTransform=new n.u),this._inverseWorldTransform.copyFrom(this.worldTransform).invert()):this._inverseWorldTransform}get textureOffsetInverseTransform(){return 2&this._matrixDirty?(this._matrixDirty&=-3,this._textureOffsetInverseTransform||(this._textureOffsetInverseTransform=new n.u),this._textureOffsetInverseTransform.copyFrom(this.inverseWorldTransform).translate(-this._textureBounds.x,-this._textureBounds.y)):this._textureOffsetInverseTransform}get inverseParentTextureTransform(){if(!(4&this._matrixDirty))return this._inverseParentTextureTransform;this._matrixDirty&=-5;const t=this._parentCacheAsTextureRenderGroup;return t?(this._inverseParentTextureTransform||(this._inverseParentTextureTransform=new n.u),this._inverseParentTextureTransform.copyFrom(this.worldTransform).prepend(t.inverseWorldTransform).translate(-t._textureBounds.x,-t._textureBounds.y)):this.worldTransform}get cacheToLocalTransform(){return this.isCachedAsTexture?this.textureOffsetInverseTransform:this._parentCacheAsTextureRenderGroup?this._parentCacheAsTextureRenderGroup.textureOffsetInverseTransform:null}}},9636:(t,e,r)=>{r.d(e,{c:()=>o});var n=r(9313),i=r(9252);const s=new n.u;class o{constructor(t=1/0,e=1/0,r=-1/0,n=-1/0){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=s,this.minX=t,this.minY=e,this.maxX=r,this.maxY=n}isEmpty(){return this.minX>this.maxX||this.minY>this.maxY}get rectangle(){this._rectangle||(this._rectangle=new i.M);const t=this._rectangle;return this.minX>this.maxX||this.minY>this.maxY?(t.x=0,t.y=0,t.width=0,t.height=0):t.copyFromBounds(this),t}clear(){return this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=s,this}set(t,e,r,n){this.minX=t,this.minY=e,this.maxX=r,this.maxY=n}addFrame(t,e,r,n,i){i||(i=this.matrix);const s=i.a,o=i.b,a=i.c,h=i.d,l=i.tx,u=i.ty;let c=this.minX,d=this.minY,f=this.maxX,p=this.maxY,y=s*t+a*e+l,m=o*t+h*e+u;y<c&&(c=y),m<d&&(d=m),y>f&&(f=y),m>p&&(p=m),y=s*r+a*e+l,m=o*r+h*e+u,y<c&&(c=y),m<d&&(d=m),y>f&&(f=y),m>p&&(p=m),y=s*t+a*n+l,m=o*t+h*n+u,y<c&&(c=y),m<d&&(d=m),y>f&&(f=y),m>p&&(p=m),y=s*r+a*n+l,m=o*r+h*n+u,y<c&&(c=y),m<d&&(d=m),y>f&&(f=y),m>p&&(p=m),this.minX=c,this.minY=d,this.maxX=f,this.maxY=p}addRect(t,e){this.addFrame(t.x,t.y,t.x+t.width,t.y+t.height,e)}addBounds(t,e){this.addFrame(t.minX,t.minY,t.maxX,t.maxY,e)}addBoundsMask(t){this.minX=this.minX>t.minX?this.minX:t.minX,this.minY=this.minY>t.minY?this.minY:t.minY,this.maxX=this.maxX<t.maxX?this.maxX:t.maxX,this.maxY=this.maxY<t.maxY?this.maxY:t.maxY}applyMatrix(t){const e=this.minX,r=this.minY,n=this.maxX,i=this.maxY,{a:s,b:o,c:a,d:h,tx:l,ty:u}=t;let c=s*e+a*r+l,d=o*e+h*r+u;this.minX=c,this.minY=d,this.maxX=c,this.maxY=d,c=s*n+a*r+l,d=o*n+h*r+u,this.minX=c<this.minX?c:this.minX,this.minY=d<this.minY?d:this.minY,this.maxX=c>this.maxX?c:this.maxX,this.maxY=d>this.maxY?d:this.maxY,c=s*e+a*i+l,d=o*e+h*i+u,this.minX=c<this.minX?c:this.minX,this.minY=d<this.minY?d:this.minY,this.maxX=c>this.maxX?c:this.maxX,this.maxY=d>this.maxY?d:this.maxY,c=s*n+a*i+l,d=o*n+h*i+u,this.minX=c<this.minX?c:this.minX,this.minY=d<this.minY?d:this.minY,this.maxX=c>this.maxX?c:this.maxX,this.maxY=d>this.maxY?d:this.maxY}fit(t){return this.minX<t.left&&(this.minX=t.left),this.maxX>t.right&&(this.maxX=t.right),this.minY<t.top&&(this.minY=t.top),this.maxY>t.bottom&&(this.maxY=t.bottom),this}fitBounds(t,e,r,n){return this.minX<t&&(this.minX=t),this.maxX>e&&(this.maxX=e),this.minY<r&&(this.minY=r),this.maxY>n&&(this.maxY=n),this}pad(t,e=t){return this.minX-=t,this.maxX+=t,this.minY-=e,this.maxY+=e,this}ceil(){return this.minX=Math.floor(this.minX),this.minY=Math.floor(this.minY),this.maxX=Math.ceil(this.maxX),this.maxY=Math.ceil(this.maxY),this}clone(){return new o(this.minX,this.minY,this.maxX,this.maxY)}scale(t,e=t){return this.minX*=t,this.minY*=e,this.maxX*=t,this.maxY*=e,this}get x(){return this.minX}set x(t){const e=this.maxX-this.minX;this.minX=t,this.maxX=t+e}get y(){return this.minY}set y(t){const e=this.maxY-this.minY;this.minY=t,this.maxY=t+e}get width(){return this.maxX-this.minX}set width(t){this.maxX=this.minX+t}get height(){return this.maxY-this.minY}set height(t){this.maxY=this.minY+t}get left(){return this.minX}get right(){return this.maxX}get top(){return this.minY}get bottom(){return this.maxY}get isPositive(){return this.maxX-this.minX>0&&this.maxY-this.minY>0}get isValid(){return this.minX+this.minY!==1/0}addVertexData(t,e,r,n){let i=this.minX,s=this.minY,o=this.maxX,a=this.maxY;n||(n=this.matrix);const h=n.a,l=n.b,u=n.c,c=n.d,d=n.tx,f=n.ty;for(let n=e;n<r;n+=2){const e=t[n],r=t[n+1],p=h*e+u*r+d,y=l*e+c*r+f;i=p<i?p:i,s=y<s?y:s,o=p>o?p:o,a=y>a?y:a}this.minX=i,this.minY=s,this.maxX=o,this.maxY=a}containsPoint(t,e){return this.minX<=t&&this.minY<=e&&this.maxX>=t&&this.maxY>=e}toString(){return`[pixi.js:Bounds minX=${this.minX} minY=${this.minY} maxX=${this.maxX} maxY=${this.maxY} width=${this.width} height=${this.height}]`}copyFrom(t){return this.minX=t.minX,this.minY=t.minY,this.maxX=t.maxX,this.maxY=t.maxY,this}}},9443:(t,e,r)=>{r.d(e,{E:()=>a,f:()=>s});var n=r(9313),i=r(2208);function s(t,e,r){let s,h;return r.clear(),t.parent?e?s=t.parent.worldTransform:(h=i.u.get().identity(),s=a(t,h)):s=n.u.IDENTITY,o(t,r,s,e),h&&i.u.return(h),r.isValid||r.set(0,0,0,0),r}function o(t,e,r,s){if(!t.visible||!t.measurable)return;let a;s?a=t.worldTransform:(t.updateLocalTransform(),a=i.u.get(),a.appendFrom(t.localTransform,r));const h=e,l=!!t.effects.length;if(l&&(e=i.o.get().clear()),t.boundsArea)e.addRect(t.boundsArea,a);else{const r=t.bounds;r&&!r.isEmpty()&&(e.matrix=a,e.addBounds(r));for(let r=0;r<t.children.length;r++)o(t.children[r],e,a,s)}if(l){for(let r=0;r<t.effects.length;r++)t.effects[r].addBounds?.(e);h.addBounds(e,n.u.IDENTITY),i.o.return(e)}s||i.u.return(a)}function a(t,e){const r=t.parent;return r&&(a(r,e),r.updateLocalTransform(),e.append(r.localTransform)),e}},7269:(t,e,r)=>{r.d(e,{n:()=>s});var n=r(9313),i=r(2208);function s(t,e,r){return e.clear(),r||(r=n.u.IDENTITY),o(t,e,r,t,!0),e.isValid||e.set(0,0,0,0),e}function o(t,e,r,s,a){let h;if(a)h=i.u.get(),h=r.copyTo(h);else{if(!t.visible||!t.measurable)return;t.updateLocalTransform();const e=t.localTransform;h=i.u.get(),h.appendFrom(e,r)}const l=e,u=!!t.effects.length;if(u&&(e=i.o.get().clear()),t.boundsArea)e.addRect(t.boundsArea,h);else{t.renderPipeId&&(e.matrix=h,e.addBounds(t.bounds));const r=t.children;for(let t=0;t<r.length;t++)o(r[t],e,h,s,!1)}if(u){for(let r=0;r<t.effects.length;r++)t.effects[r].addLocalBounds?.(e,s);l.addBounds(e,n.u.IDENTITY),i.o.return(e)}i.u.return(h)}},2208:(t,e,r)=>{r.d(e,{o:()=>a,u:()=>o});var n=r(9313),i=r(8655),s=r(9636);const o=i.Z.getPool(n.u),a=i.Z.getPool(s.c)},198:(t,e,r)=>{r.d(e,{D:()=>a,R:()=>h});var n=r(9313),i=r(9443),s=r(2208),o=r(753);function a(t){return((255&t)<<16)+(65280&t)+(t>>16&255)}const h={getGlobalAlpha(t){if(t)return this.renderGroup?this.renderGroup.worldAlpha:this.parentRenderGroup?this.parentRenderGroup.worldAlpha*this.alpha:this.alpha;let e=this.alpha,r=this.parent;for(;r;)e*=r.alpha,r=r.parent;return e},getGlobalTransform(t=new n.u,e){if(e)return t.copyFrom(this.worldTransform);this.updateLocalTransform();const r=(0,i.E)(this,s.u.get().identity());return t.appendFrom(this.localTransform,r),s.u.return(r),t},getGlobalTint(t){if(t)return this.renderGroup?a(this.renderGroup.worldColor):this.parentRenderGroup?a((0,o.j)(this.localColor,this.parentRenderGroup.worldColor)):this.tint;let e=this.localColor,r=this.parent;for(;r;)e=(0,o.j)(e,r.localColor),r=r.parent;return a(e)}}},2698:(t,e,r)=>{function n(t){const e={};for(const r in t)void 0!==t[r]&&(e[r]=t[r]);return e}r.d(e,{S:()=>n})},753:(t,e,r)=>{r.d(e,{j:()=>s});var n=r(4676);const i=16777215;function s(t,e){return t===i?e:e===i?t:(0,n.u)(t,e)}},4676:(t,e,r)=>{function n(t,e){if(16777215===t||!e)return e;if(16777215===e||!t)return t;return(((t>>16&255)*(e>>16&255)/255|0)<<16)+(((t>>8&255)*(e>>8&255)/255|0)<<8)+((255&t)*(255&e)/255|0)}r.d(e,{u:()=>n})},2760:(t,e,r)=>{function n(t,e,r){const n=(t>>24&255)/255;e[r++]=(255&t)/255*n,e[r++]=(t>>8&255)/255*n,e[r++]=(t>>16&255)/255*n,e[r++]=n}r.d(e,{V:()=>n})},6954:(t,e,r)=>{r.d(e,{G:()=>o});var n=r(9313),i=r(4676);const s=new n.u;class o{constructor(){this.packAsQuad=!1,this.batcherName="default",this.topology="triangle-list",this.applyTransform=!0,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(){const t=this.baseColor,e=t>>16|65280&t|(255&t)<<16,r=this.renderable;return r?(0,i.u)(e,r.groupColor)+(this.alpha*r.groupAlpha*255<<24):e+(255*this.alpha<<24)}get transform(){return this.renderable?.groupTransform||s}copyTo(t){t.indexOffset=this.indexOffset,t.indexSize=this.indexSize,t.attributeOffset=this.attributeOffset,t.attributeSize=this.attributeSize,t.baseColor=this.baseColor,t.alpha=this.alpha,t.texture=this.texture,t.geometryData=this.geometryData,t.topology=this.topology}reset(){this.applyTransform=!0,this.renderable=null,this.topology="triangle-list"}destroy(){this.renderable=null,this.texture=null,this.geometryData=null,this._batcher=null,this._batch=null}}},4663:(t,e,r)=>{r.d(e,{A:()=>_});var n=r(4670),i=r(4985),s=r(51),o=r(8507),a=r(848),h=r(4334);class l{constructor(){this.isBatchable=!1}reset(){this.isBatchable=!1,this.context=null,this.graphicsData&&(this.graphicsData.destroy(),this.graphicsData=null)}destroy(){this.reset()}}class u{constructor(){this.instructions=new a.L}init(){this.instructions.reset()}destroy(){this.instructions.destroy(),this.instructions=null}}const c=class t{constructor(t){this._renderer=t,this._managedContexts=new h.s({renderer:t,type:"resource",name:"graphicsContext"})}init(e){t.defaultOptions.bezierSmoothness=e?.bezierSmoothness??t.defaultOptions.bezierSmoothness}getContextRenderData(t){return this.getGpuContext(t).graphicsData||this._initContextRenderData(t)}updateGpuContext(t){const e=t._gpuData,r=!!e[this._renderer.uid],n=e[this._renderer.uid]||this._initContext(t);return!t.dirty&&r||(r&&n.reset(),n.isBatchable=!1,t.dirty=!1),n}getGpuContext(t){return t._gpuData[this._renderer.uid]||this._initContext(t)}_initContextRenderData(t){const e=new u;return this.getGpuContext(t).graphicsData=e,e.init(),e}_initContext(t){const e=new l;return e.context=t,t._gpuData[this._renderer.uid]=e,this._managedContexts.add(t),e}destroy(){this._managedContexts.destroy(),this._renderer=null}};c.extension={type:[o.Ag.CanvasSystem],name:"graphicsContext"},c.defaultOptions={bezierSmoothness:.5};let d=c;var f=r(7547);class p{constructor(t,e){this.state=f.U.for2d(),this.renderer=t,this._adaptor=e,this.renderer.runners.contextChange.add(this),this._managedGraphics=new h.s({renderer:t,type:"renderable",priority:-1,name:"graphics"})}contextChange(){this._adaptor.contextChange(this.renderer)}validateRenderable(t){return!1}addRenderable(t,e){this._managedGraphics.add(t),this.renderer.renderPipes.batch.break(e),e.add(t)}updateRenderable(t){}execute(t){t.isRenderable&&this._adaptor.execute(this,t)}destroy(){this._managedGraphics.destroy(),this.renderer=null,this._adaptor.destroy(),this._adaptor=null}}p.extension={type:[o.Ag.CanvasPipes],name:"graphics"};var y=r(378),m=r(8655),g=r(2760),x=r(6954);class v{constructor(){this.batches=[],this.batched=!1}destroy(){this.batches.forEach((t=>{m.Z.return(t)})),this.batches.length=0}}class b{constructor(t,e){this.state=f.U.for2d(),this.renderer=t,this._adaptor=e,this.renderer.runners.contextChange.add(this),this._managedGraphics=new h.s({renderer:t,type:"renderable",priority:-1,name:"graphics"})}contextChange(){this._adaptor.contextChange(this.renderer)}validateRenderable(t){const e=t.context,r=!!t._gpuData,n=this.renderer.graphicsContext.updateGpuContext(e);return!(!n.isBatchable&&r===n.isBatchable)}addRenderable(t,e){const r=this.renderer.graphicsContext.updateGpuContext(t.context);t.didViewUpdate&&this._rebuild(t),r.isBatchable?this._addToBatcher(t,e):(this.renderer.renderPipes.batch.break(e),e.add(t))}updateRenderable(t){const e=this._getGpuDataForRenderable(t).batches;for(let t=0;t<e.length;t++){const r=e[t];r._batcher.updateElement(r)}}execute(t){if(!t.isRenderable)return;const e=this.renderer,r=t.context;if(!e.graphicsContext.getGpuContext(r).batches.length)return;const n=r.customShader||this._adaptor.shader;this.state.blendMode=t.groupBlendMode;const i=n.resources.localUniforms.uniforms;i.uTransformMatrix=t.groupTransform,i.uRound=e._roundPixels|t._roundPixels,(0,g.V)(t.groupColorAlpha,i.uColor,0),this._adaptor.execute(this,t)}_rebuild(t){const e=this._getGpuDataForRenderable(t),r=this.renderer.graphicsContext.updateGpuContext(t.context);e.destroy(),r.isBatchable&&this._updateBatchesForRenderable(t,e)}_addToBatcher(t,e){const r=this.renderer.renderPipes.batch,n=this._getGpuDataForRenderable(t).batches;for(let t=0;t<n.length;t++){const i=n[t];r.addToBatch(i,e)}}_getGpuDataForRenderable(t){return t._gpuData[this.renderer.uid]||this._initGpuDataForRenderable(t)}_initGpuDataForRenderable(t){const e=new v;return t._gpuData[this.renderer.uid]=e,this._managedGraphics.add(t),e}_updateBatchesForRenderable(t,e){const r=t.context,n=this.renderer.graphicsContext.getGpuContext(r),i=this.renderer._roundPixels|t._roundPixels;e.batches=n.batches.map((e=>{const r=m.Z.get(x.G);return e.copyTo(r),r.renderable=t,r.roundPixels=i,r}))}destroy(){this._managedGraphics.destroy(),this.renderer=null,this._adaptor.destroy(),this._adaptor=null,this.state=null}}b.extension={type:[o.Ag.WebGLPipes,o.Ag.WebGPUPipes],name:"graphics"},o.XO.add(p),o.XO.add(b),o.XO.add(d),o.XO.add(y.GH);class _ extends i.l{constructor(t){t instanceof s.T&&(t={context:t});const{context:e,roundPixels:r,...n}=t||{};super({label:"Graphics",...n}),this.renderPipeId="graphics",e?this.context=e:(this.context=this._ownedContext=new s.T,this.context.autoGarbageCollect=this.autoGarbageCollect),this.didViewUpdate=!0,this.allowChildren=!1,this.roundPixels=r??!1}set context(t){t!==this._context&&(this._context&&(this._context.off("update",this.onViewUpdate,this),this._context.off("unload",this.unload,this)),this._context=t,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(t){return this._context.containsPoint(t)}destroy(t){this._ownedContext&&!t?this._ownedContext.destroy(t):!0!==t&&!0!==t?.context||this._context.destroy(t),this._ownedContext=null,this._context=null,super.destroy(t)}_onTouch(t){this._gcLastUsed=t,this._context._gcLastUsed=t}_callContextMethod(t,e){return this.context[t](...e),this}setFillStyle(...t){return this._callContextMethod("setFillStyle",t)}setStrokeStyle(...t){return this._callContextMethod("setStrokeStyle",t)}fill(...t){return this._callContextMethod("fill",t)}stroke(...t){return this._callContextMethod("stroke",t)}texture(...t){return this._callContextMethod("texture",t)}beginPath(){return this._callContextMethod("beginPath",[])}cut(){return this._callContextMethod("cut",[])}arc(...t){return this._callContextMethod("arc",t)}arcTo(...t){return this._callContextMethod("arcTo",t)}arcToSvg(...t){return this._callContextMethod("arcToSvg",t)}bezierCurveTo(...t){return this._callContextMethod("bezierCurveTo",t)}closePath(){return this._callContextMethod("closePath",[])}ellipse(...t){return this._callContextMethod("ellipse",t)}circle(...t){return this._callContextMethod("circle",t)}path(...t){return this._callContextMethod("path",t)}lineTo(...t){return this._callContextMethod("lineTo",t)}moveTo(...t){return this._callContextMethod("moveTo",t)}quadraticCurveTo(...t){return this._callContextMethod("quadraticCurveTo",t)}rect(...t){return this._callContextMethod("rect",t)}roundRect(...t){return this._callContextMethod("roundRect",t)}poly(...t){return this._callContextMethod("poly",t)}regularPoly(...t){return this._callContextMethod("regularPoly",t)}roundPoly(...t){return this._callContextMethod("roundPoly",t)}roundShape(...t){return this._callContextMethod("roundShape",t)}filletRect(...t){return this._callContextMethod("filletRect",t)}chamferRect(...t){return this._callContextMethod("chamferRect",t)}star(...t){return this._callContextMethod("star",t)}svg(...t){return this._callContextMethod("svg",t)}restore(...t){return this._callContextMethod("restore",t)}save(){return this._callContextMethod("save",[])}getTransform(){return this.context.getTransform()}resetTransform(){return this._callContextMethod("resetTransform",[])}rotateTransform(...t){return this._callContextMethod("rotate",t)}scaleTransform(...t){return this._callContextMethod("scale",t)}setTransform(...t){return this._callContextMethod("setTransform",t)}transform(...t){return this._callContextMethod("transform",t)}translateTransform(...t){return this._callContextMethod("translate",t)}clear(){return this._callContextMethod("clear",[])}get fillStyle(){return this._context.fillStyle}set fillStyle(t){this._context.fillStyle=t}get strokeStyle(){return this._context.strokeStyle}set strokeStyle(t){this._context.strokeStyle=t}clone(t=!1){if(t)return new _(this._context.clone());this._ownedContext=null;return new _(this._context)}lineStyle(t,e,r){(0,n.t6)(n.lj,"Graphics#lineStyle is no longer needed. Use Graphics#setStrokeStyle to set the stroke style.");const i={};return t&&(i.width=t),e&&(i.color=e),r&&(i.alpha=r),this.context.strokeStyle=i,this}beginFill(t,e){(0,n.t6)(n.lj,"Graphics#beginFill is no longer needed. Use Graphics#fill to fill the shape with the desired style.");const r={};return void 0!==t&&(r.color=t),void 0!==e&&(r.alpha=e),this.context.fillStyle=r,this}endFill(){(0,n.t6)(n.lj,"Graphics#endFill is no longer needed. Use Graphics#fill to fill the shape with the desired style."),this.context.fill();const t=this.context.strokeStyle;return t.width===s.T.defaultStrokeStyle.width&&t.color===s.T.defaultStrokeStyle.color&&t.alpha===s.T.defaultStrokeStyle.alpha||this.context.stroke(),this}drawCircle(...t){return(0,n.t6)(n.lj,"Graphics#drawCircle has been renamed to Graphics#circle"),this._callContextMethod("circle",t)}drawEllipse(...t){return(0,n.t6)(n.lj,"Graphics#drawEllipse has been renamed to Graphics#ellipse"),this._callContextMethod("ellipse",t)}drawPolygon(...t){return(0,n.t6)(n.lj,"Graphics#drawPolygon has been renamed to Graphics#poly"),this._callContextMethod("poly",t)}drawRect(...t){return(0,n.t6)(n.lj,"Graphics#drawRect has been renamed to Graphics#rect"),this._callContextMethod("rect",t)}drawRoundedRect(...t){return(0,n.t6)(n.lj,"Graphics#drawRoundedRect has been renamed to Graphics#roundRect"),this._callContextMethod("roundRect",t)}drawStar(...t){return(0,n.t6)(n.lj,"Graphics#drawStar has been renamed to Graphics#star"),this._callContextMethod("star",t)}}},51:(t,e,r)=>{r.d(e,{T:()=>lt});var n=r(8875),i=r(2577),s=r(9313),o=r(5101),a=r(5589),h=r(133),l=r(4670),u=r(9636),c=r(268),d=r(8133);var f=r(9252);class p{constructor(t=0,e=0,r=0){this.type="circle",this.x=t,this.y=e,this.radius=r}clone(){return new p(this.x,this.y,this.radius)}contains(t,e){if(this.radius<=0)return!1;const r=this.radius*this.radius;let n=this.x-t,i=this.y-e;return n*=n,i*=i,n+i<=r}strokeContains(t,e,r,n=.5){if(0===this.radius)return!1;const i=this.x-t,s=this.y-e,o=this.radius,a=(1-n)*r,h=Math.sqrt(i*i+s*s);return h<=o+a&&h>o-(r-a)}getBounds(t){return t||(t=new f.M),t.x=this.x-this.radius,t.y=this.y-this.radius,t.width=2*this.radius,t.height=2*this.radius,t}copyFrom(t){return this.x=t.x,this.y=t.y,this.radius=t.radius,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`}}class y{constructor(t=0,e=0,r=0,n=0){this.type="ellipse",this.x=t,this.y=e,this.halfWidth=r,this.halfHeight=n}clone(){return new y(this.x,this.y,this.halfWidth,this.halfHeight)}contains(t,e){if(this.halfWidth<=0||this.halfHeight<=0)return!1;let r=(t-this.x)/this.halfWidth,n=(e-this.y)/this.halfHeight;return r*=r,n*=n,r+n<=1}strokeContains(t,e,r,n=.5){const{halfWidth:i,halfHeight:s}=this;if(i<=0||s<=0)return!1;const o=r*(1-n),a=r-o,h=i-a,l=s-a,u=i+o,c=s+o,d=t-this.x,f=e-this.y;return d*d/(h*h)+f*f/(l*l)>1&&d*d/(u*u)+f*f/(c*c)<=1}getBounds(t){return t||(t=new f.M),t.x=this.x-this.halfWidth,t.y=this.y-this.halfHeight,t.width=2*this.halfWidth,t.height=2*this.halfHeight,t}copyFrom(t){return this.x=t.x,this.y=t.y,this.halfWidth=t.halfWidth,this.halfHeight=t.halfHeight,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:Ellipse x=${this.x} y=${this.y} halfWidth=${this.halfWidth} halfHeight=${this.halfHeight}]`}}function m(t,e,r,n,i,s){const o=i-r,a=s-n,h=o*o+a*a;let l,u,c=-1;0!==h&&(c=((t-r)*o+(e-n)*a)/h),c<0?(l=r,u=n):c>1?(l=i,u=s):(l=r+c*o,u=n+c*a);const d=t-l,f=e-u;return d*d+f*f}class g{constructor(...t){this.type="polygon";let e=Array.isArray(t[0])?t[0]:t;if("number"!=typeof e[0]){const t=[];for(let r=0,n=e.length;r<n;r++)t.push(e[r].x,e[r].y);e=t}this.points=e,this.closePath=!0}isClockwise(){let t=0;const e=this.points,r=e.length;for(let n=0;n<r;n+=2){const i=e[n],s=e[n+1];t+=(e[(n+2)%r]-i)*(e[(n+3)%r]+s)}return t<0}containsPolygon(t){const e=this.getBounds(undefined),r=t.getBounds(undefined);if(!e.containsRect(r))return!1;const n=t.points;for(let t=0;t<n.length;t+=2){const e=n[t],r=n[t+1];if(!this.contains(e,r))return!1}return!0}clone(){const t=this.points.slice(),e=new g(t);return e.closePath=this.closePath,e}contains(t,e){let r=!1;const n=this.points.length/2;for(let i=0,s=n-1;i<n;s=i++){const n=this.points[2*i],o=this.points[2*i+1],a=this.points[2*s],h=this.points[2*s+1];o>e!=h>e&&t<(e-o)/(h-o)*(a-n)+n&&(r=!r)}return r}strokeContains(t,e,r,n=.5){const i=r*r,s=i*(1-n),o=i-s,{points:a}=this,h=a.length-(this.closePath?0:2);for(let r=0;r<h;r+=2){const n=a[r],i=a[r+1],h=a[(r+2)%a.length],l=a[(r+3)%a.length];if(m(t,e,n,i,h,l)<=(Math.sign((h-n)*(e-i)-(l-i)*(t-n))<0?o:s))return!0}return!1}getBounds(t){t||(t=new f.M);const e=this.points;let r=1/0,n=-1/0,i=1/0,s=-1/0;for(let t=0,o=e.length;t<o;t+=2){const o=e[t],a=e[t+1];r=o<r?o:r,n=o>n?o:n,i=a<i?a:i,s=a>s?a:s}return t.x=r,t.width=n-r,t.y=i,t.height=s-i,t}copyFrom(t){return this.points=t.points.slice(),this.closePath=t.closePath,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:PolygoncloseStroke=${this.closePath}points=${this.points.reduce(((t,e)=>`${t}, ${e}`),"")}]`}get lastX(){return this.points[this.points.length-2]}get lastY(){return this.points[this.points.length-1]}get x(){return(0,l.t6)("8.11.0","Polygon.lastX is deprecated, please use Polygon.lastX instead."),this.points[this.points.length-2]}get y(){return(0,l.t6)("8.11.0","Polygon.y is deprecated, please use Polygon.lastY instead."),this.points[this.points.length-1]}get startX(){return this.points[0]}get startY(){return this.points[1]}}const x=(t,e,r,n,i,s,o)=>{const a=t-r,h=e-n,l=Math.sqrt(a*a+h*h);return l>=i-s&&l<=i+o};class v{constructor(t=0,e=0,r=0,n=0,i=20){this.type="roundedRectangle",this.x=t,this.y=e,this.width=r,this.height=n,this.radius=i}getBounds(t){return t||(t=new f.M),t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t}clone(){return new v(this.x,this.y,this.width,this.height,this.radius)}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.copyFrom(this),t}contains(t,e){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){const r=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(e>=this.y+r&&e<=this.y+this.height-r||t>=this.x+r&&t<=this.x+this.width-r)return!0;let n=t-(this.x+r),i=e-(this.y+r);const s=r*r;if(n*n+i*i<=s)return!0;if(n=t-(this.x+this.width-r),n*n+i*i<=s)return!0;if(i=e-(this.y+this.height-r),n*n+i*i<=s)return!0;if(n=t-(this.x+r),n*n+i*i<=s)return!0}return!1}strokeContains(t,e,r,n=.5){const{x:i,y:s,width:o,height:a,radius:h}=this,l=r*(1-n),u=r-l,c=i+h,d=s+h,f=i+o,p=s+a;return(t>=i-l&&t<=i+u||t>=f-u&&t<=f+l)&&e>=d&&e<=d+(a-2*h)||((e>=s-l&&e<=s+u||e>=p-u&&e<=p+l)&&t>=c&&t<=c+(o-2*h)||(t<c&&e<d&&x(t,e,c,d,h,u,l)||t>f-h&&e<d&&x(t,e,f-h,d,h,u,l)||t>f-h&&e>p-h&&x(t,e,f-h,p-h,h,u,l)||t<c&&e>p-h&&x(t,e,c,p-h,h,u,l)))}toString(){return`[pixi.js/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`}}var b=r(378);const _=8,w=1.1920929e-7,S=1,C=.01,M=0,T=0;function A(t,e,r,n,i,s,o,a,h,l){const u=Math.min(.99,Math.max(0,l??b.GH.defaultOptions.bezierSmoothness));let c=(S-u)/1;return c*=c,function(t,e,r,n,i,s,o,a,h,l){k(t,e,r,n,i,s,o,a,h,l,0),h.push(o,a)}(e,r,n,i,s,o,a,h,t,c),t}function k(t,e,r,n,i,s,o,a,h,l,u){if(u>_)return;const c=Math.PI,d=(t+r)/2,f=(e+n)/2,p=(r+i)/2,y=(n+s)/2,m=(i+o)/2,g=(s+a)/2,x=(d+p)/2,v=(f+y)/2,b=(p+m)/2,S=(y+g)/2,A=(x+b)/2,P=(v+S)/2;if(u>0){let u=o-t,d=a-e;const f=Math.abs((r-o)*d-(n-a)*u),p=Math.abs((i-o)*d-(s-a)*u);let y,m;if(f>w&&p>w){if((f+p)*(f+p)<=l*(u*u+d*d)){if(M<C)return void h.push(A,P);const l=Math.atan2(s-n,i-r);if(y=Math.abs(l-Math.atan2(n-e,r-t)),m=Math.abs(Math.atan2(a-s,o-i)-l),y>=c&&(y=2*c-y),m>=c&&(m=2*c-m),y+m<M)return void h.push(A,P);if(0!==T){if(y>T)return void h.push(r,n);if(m>T)return void h.push(i,s)}}}else if(f>w){if(f*f<=l*(u*u+d*d)){if(M<C)return void h.push(A,P);if(y=Math.abs(Math.atan2(s-n,i-r)-Math.atan2(n-e,r-t)),y>=c&&(y=2*c-y),y<M)return h.push(r,n),void h.push(i,s);if(0!==T&&y>T)return void h.push(r,n)}}else if(p>w){if(p*p<=l*(u*u+d*d)){if(M<C)return void h.push(A,P);if(y=Math.abs(Math.atan2(a-s,o-i)-Math.atan2(s-n,i-r)),y>=c&&(y=2*c-y),y<M)return h.push(r,n),void h.push(i,s);if(0!==T&&y>T)return void h.push(i,s)}}else if(u=A-(t+o)/2,d=P-(e+a)/2,u*u+d*d<=l)return void h.push(A,P)}k(t,e,d,f,x,v,A,P,h,l,u+1),k(A,P,b,S,m,g,o,a,h,l,u+1)}const P=8,E=1.1920929e-7,R=.01,I=0;function O(t,e,r,n,i,s,o,a){let h=(1-Math.min(.99,Math.max(0,a??b.GH.defaultOptions.bezierSmoothness)))/1;return h*=h,function(t,e,r,n,i,s,o,a){L(o,t,e,r,n,i,s,a,0),o.push(i,s)}(e,r,n,i,s,o,t,h),t}function L(t,e,r,n,i,s,o,a,h){if(h>P)return;const l=Math.PI,u=(e+n)/2,c=(r+i)/2,d=(n+s)/2,f=(i+o)/2,p=(u+d)/2,y=(c+f)/2;let m=s-e,g=o-r;const x=Math.abs((n-s)*g-(i-o)*m);if(x>E){if(x*x<=a*(m*m+g*g)){if(I<R)return void t.push(p,y);let a=Math.abs(Math.atan2(o-i,s-n)-Math.atan2(i-r,n-e));if(a>=l&&(a=2*l-a),a<I)return void t.push(p,y)}}else if(m=p-(e+s)/2,g=y-(r+o)/2,m*m+g*g<=a)return void t.push(p,y);L(t,e,r,u,c,p,y,a,h+1),L(t,p,y,d,f,s,o,a,h+1)}function B(t,e,r,n,i,s,o,a){let h=Math.abs(i-s);(!o&&i>s||o&&s>i)&&(h=2*Math.PI-h),a||(a=Math.max(6,Math.floor(6*Math.pow(n,1/3)*(h/Math.PI))));let l=h/(a=Math.max(a,3)),u=i;l*=o?-1:1;for(let i=0;i<a+1;i++){const i=e+Math.cos(u)*n,s=r+Math.sin(u)*n;t.push(i,s),u+=l}}const D=2*Math.PI,F={centerX:0,centerY:0,ang1:0,ang2:0},G=({x:t,y:e},r,n,i,s,o,a,h)=>{const l=i*(t*=r)-s*(e*=n),u=s*t+i*e;return h.x=l+o,h.y=u+a,h};function j(t,e){const r=-1.5707963267948966===e?-.551915024494:4/3*Math.tan(e/4),n=1.5707963267948966===e?.551915024494:r,i=Math.cos(t),s=Math.sin(t),o=Math.cos(t+e),a=Math.sin(t+e);return[{x:i-s*n,y:s+i*n},{x:o+a*n,y:a-o*n},{x:o,y:a}]}const z=(t,e,r,n)=>{let i=t*r+e*n;return i>1&&(i=1),i<-1&&(i=-1),(t*n-e*r<0?-1:1)*Math.acos(i)};function N(t,e,r,n,i,s,o,a=0,h=0,l=0){if(0===s||0===o)return;const u=Math.sin(a*D/360),c=Math.cos(a*D/360),d=c*(e-n)/2+u*(r-i)/2,f=-u*(e-n)/2+c*(r-i)/2;if(0===d&&0===f)return;s=Math.abs(s),o=Math.abs(o);const p=Math.pow(d,2)/Math.pow(s,2)+Math.pow(f,2)/Math.pow(o,2);p>1&&(s*=Math.sqrt(p),o*=Math.sqrt(p)),((t,e,r,n,i,s,o,a,h,l,u,c,d)=>{const f=Math.pow(i,2),p=Math.pow(s,2),y=Math.pow(u,2),m=Math.pow(c,2);let g=f*p-f*m-p*y;g<0&&(g=0),g/=f*m+p*y,g=Math.sqrt(g)*(o===a?-1:1);const x=g*i/s*c,v=g*-s/i*u,b=l*x-h*v+(t+r)/2,_=h*x+l*v+(e+n)/2,w=(u-x)/i,S=(c-v)/s,C=(-u-x)/i,M=(-c-v)/s,T=z(1,0,w,S);let A=z(w,S,C,M);0===a&&A>0&&(A-=D),1===a&&A<0&&(A+=D),d.centerX=b,d.centerY=_,d.ang1=T,d.ang2=A})(e,r,n,i,s,o,h,l,u,c,d,f,F);let{ang1:y,ang2:m}=F;const{centerX:g,centerY:x}=F;let v=Math.abs(m)/(D/4);Math.abs(1-v)<1e-7&&(v=1);const b=Math.max(Math.ceil(v),1);m/=b;let _=t[t.length-2],w=t[t.length-1];const S={x:0,y:0};for(let e=0;e<b;e++){const e=j(y,m),{x:r,y:n}=G(e[0],s,o,c,u,g,x,S),{x:i,y:a}=G(e[1],s,o,c,u,g,x,S),{x:h,y:l}=G(e[2],s,o,c,u,g,x,S);A(t,_,w,r,n,i,a,h,l),_=h,w=l,y+=m}}const W=new f.M;class U{constructor(t){this.shapePrimitives=[],this._currentPoly=null,this._bounds=new u.c,this._graphicsPath2D=t,this.signed=t.checkForHoles}moveTo(t,e){return this.startPoly(t,e),this}lineTo(t,e){this._ensurePoly();const r=this._currentPoly.points,n=r[r.length-2],i=r[r.length-1];return n===t&&i===e||r.push(t,e),this}arc(t,e,r,n,i,s){this._ensurePoly(!1);return B(this._currentPoly.points,t,e,r,n,i,s),this}arcTo(t,e,r,n,i){this._ensurePoly();return function(t,e,r,n,i,s){const o=t[t.length-2],a=t[t.length-1]-r,h=o-e,l=i-r,u=n-e,c=Math.abs(a*u-h*l);if(c<1e-8||0===s)return void(t[t.length-2]===e&&t[t.length-1]===r||t.push(e,r));const d=a*a+h*h,f=l*l+u*u,p=a*l+h*u,y=s*Math.sqrt(d)/c,m=s*Math.sqrt(f)/c,g=y*p/d,x=m*p/f,v=y*u+m*h,b=y*l+m*a,_=h*(m+g),w=a*(m+g),S=u*(y+x),C=l*(y+x);B(t,v+e,b+r,s,Math.atan2(w-b,_-v),Math.atan2(C-b,S-v),h*l>u*a)}(this._currentPoly.points,t,e,r,n,i),this}arcToSvg(t,e,r,n,i,s,o){return N(this._currentPoly.points,this._currentPoly.lastX,this._currentPoly.lastY,s,o,t,e,r,n,i),this}bezierCurveTo(t,e,r,n,i,s,o){this._ensurePoly();const a=this._currentPoly;return A(this._currentPoly.points,a.lastX,a.lastY,t,e,r,n,i,s,o),this}quadraticCurveTo(t,e,r,n,i){this._ensurePoly();const s=this._currentPoly;return O(this._currentPoly.points,s.lastX,s.lastY,t,e,r,n,i),this}closePath(){return this.endPoly(!0),this}addPath(t,e){this.endPoly(),e&&!e.isIdentity()&&(t=t.clone(!0)).transform(e);const r=this.shapePrimitives,n=r.length;for(let e=0;e<t.instructions.length;e++){const r=t.instructions[e];this[r.action](...r.data)}if(t.checkForHoles&&r.length-n>1){let t=null;for(let e=n;e<r.length;e++){const n=r[e];if("polygon"===n.shape.type){const i=n.shape,s=t?.shape;s&&s.containsPolygon(i)?(t.holes||(t.holes=[]),t.holes.push(n),r.copyWithin(e,e+1),r.length--,e--):t=n}}}return this}finish(t=!1){this.endPoly(t)}rect(t,e,r,n,i){return this.drawShape(new f.M(t,e,r,n),i),this}circle(t,e,r,n){return this.drawShape(new p(t,e,r),n),this}poly(t,e,r){const n=new g(t);return n.closePath=e,this.drawShape(n,r),this}regularPoly(t,e,r,n,i=0,s){n=Math.max(0|n,3);const o=-1*Math.PI/2+i,a=2*Math.PI/n,h=[];for(let i=0;i<n;i++){const n=o-i*a;h.push(t+r*Math.cos(n),e+r*Math.sin(n))}return this.poly(h,!0,s),this}roundPoly(t,e,r,n,i,s=0,o){if(n=Math.max(0|n,3),i<=0)return this.regularPoly(t,e,r,n,s);const a=r*Math.sin(Math.PI/n)-.001;i=Math.min(i,a);const h=-1*Math.PI/2+s,l=2*Math.PI/n,u=(n-2)*Math.PI/n/2;for(let s=0;s<n;s++){const n=s*l+h,a=t+r*Math.cos(n),c=e+r*Math.sin(n),d=n+Math.PI+u,f=n-Math.PI-u,p=a+i*Math.cos(d),y=c+i*Math.sin(d),m=a+i*Math.cos(f),g=c+i*Math.sin(f);0===s?this.moveTo(p,y):this.lineTo(p,y),this.quadraticCurveTo(a,c,m,g,o)}return this.closePath()}roundShape(t,e,r=!1,n){return t.length<3?this:(r?function(t,e,r,n){const i=(t,e)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2),s=(t,e,r)=>({x:t.x+(e.x-t.x)*r,y:t.y+(e.y-t.y)*r}),o=e.length;for(let a=0;a<o;a++){const h=e[(a+1)%o],l=h.radius??r;if(l<=0){0===a?t.moveTo(h.x,h.y):t.lineTo(h.x,h.y);continue}const u=e[a],c=e[(a+2)%o],d=i(u,h);let f;f=d<1e-4?h:s(h,u,Math.min(d/2,l)/d);const p=i(c,h);let y;y=p<1e-4?h:s(h,c,Math.min(p/2,l)/p),0===a?t.moveTo(f.x,f.y):t.lineTo(f.x,f.y),t.quadraticCurveTo(h.x,h.y,y.x,y.y,n)}}(this,t,e,n):function(t,e,r){const n=(t,e)=>{const r=e.x-t.x,n=e.y-t.y,i=Math.sqrt(r*r+n*n);return{len:i,nx:r/i,ny:n/i}},i=(e,r)=>{0===e?t.moveTo(r.x,r.y):t.lineTo(r.x,r.y)};let s=e[e.length-1];for(let o=0;o<e.length;o++){const a=e[o%e.length],h=a.radius??r;if(h<=0){i(o,a),s=a;continue}const l=e[(o+1)%e.length],u=n(a,s),c=n(a,l);if(u.len<1e-4||c.len<1e-4){i(o,a),s=a;continue}let d=Math.asin(u.nx*c.ny-u.ny*c.nx),f=1,p=!1;u.nx*c.nx-u.ny*-c.ny<0?d<0?d=Math.PI+d:(d=Math.PI-d,f=-1,p=!0):d>0&&(f=-1,p=!0);const y=d/2;let m,g=Math.abs(Math.cos(y)*h/Math.sin(y));g>Math.min(u.len/2,c.len/2)?(g=Math.min(u.len/2,c.len/2),m=Math.abs(g*Math.sin(y)/Math.cos(y))):m=h;const x=a.x+c.nx*g+-c.ny*m*f,v=a.y+c.ny*g+c.nx*m*f,b=Math.atan2(u.ny,u.nx)+Math.PI/2*f,_=Math.atan2(c.ny,c.nx)-Math.PI/2*f;0===o&&t.moveTo(x+Math.cos(b)*m,v+Math.sin(b)*m),t.arc(x,v,m,b,_,p),s=a}}(this,t,e),this.closePath())}filletRect(t,e,r,n,i){if(0===i)return this.rect(t,e,r,n);const s=Math.min(r,n)/2,o=Math.min(s,Math.max(-s,i)),a=t+r,h=e+n,l=o<0?-o:0,u=Math.abs(o);return this.moveTo(t,e+u).arcTo(t+l,e+l,t+u,e,u).lineTo(a-u,e).arcTo(a-l,e+l,a,e+u,u).lineTo(a,h-u).arcTo(a-l,h-l,t+r-u,h,u).lineTo(t+u,h).arcTo(t+l,h-l,t,h-u,u).closePath()}chamferRect(t,e,r,n,i,s){if(i<=0)return this.rect(t,e,r,n);const o=Math.min(i,Math.min(r,n)/2),a=t+r,h=e+n,l=[t+o,e,a-o,e,a,e+o,a,h-o,a-o,h,t+o,h,t,h-o,t,e+o];for(let t=l.length-1;t>=2;t-=2)l[t]===l[t-2]&&l[t-1]===l[t-3]&&l.splice(t-1,2);return this.poly(l,!0,s)}ellipse(t,e,r,n,i){return this.drawShape(new y(t,e,r,n),i),this}roundRect(t,e,r,n,i,s){return this.drawShape(new v(t,e,r,n,i),s),this}drawShape(t,e){return this.endPoly(),this.shapePrimitives.push({shape:t,transform:e}),this}startPoly(t,e){let r=this._currentPoly;return r&&this.endPoly(),r=new g,r.points.push(t,e),this._currentPoly=r,this}endPoly(t=!1){const e=this._currentPoly;return e&&e.points.length>2&&(e.closePath=t,this.shapePrimitives.push({shape:e})),this._currentPoly=null,this}_ensurePoly(t=!0){if(!this._currentPoly&&(this._currentPoly=new g,t)){const t=this.shapePrimitives[this.shapePrimitives.length-1];if(t){let e=t.shape.x,r=t.shape.y;if(t.transform&&!t.transform.isIdentity()){const n=t.transform,i=e;e=n.a*e+n.c*r+n.tx,r=n.b*i+n.d*r+n.ty}this._currentPoly.points.push(e,r)}else this._currentPoly.points.push(0,0)}}buildPath(){const t=this._graphicsPath2D;this.shapePrimitives.length=0,this._currentPoly=null;for(let e=0;e<t.instructions.length;e++){const r=t.instructions[e];this[r.action](...r.data)}this.finish()}get bounds(){const t=this._bounds;t.clear();const e=this.shapePrimitives;for(let r=0;r<e.length;r++){const n=e[r],i=n.shape.getBounds(W);n.transform?t.addRect(i,n.transform):t.addRect(i)}return t}}class X{constructor(t,e=!1){this.instructions=[],this.uid=(0,h.L)("graphicsPath"),this._dirty=!0,this.checkForHoles=e,"string"==typeof t?function(t,e){const r=d(t),n=[];let i=null,s=0,o=0;for(let t=0;t<r.length;t++){const a=r[t],h=a[0],l=a;switch(h){case"M":s=l[1],o=l[2],e.moveTo(s,o);break;case"m":s+=l[1],o+=l[2],e.moveTo(s,o);break;case"H":s=l[1],e.lineTo(s,o);break;case"h":s+=l[1],e.lineTo(s,o);break;case"V":o=l[1],e.lineTo(s,o);break;case"v":o+=l[1],e.lineTo(s,o);break;case"L":s=l[1],o=l[2],e.lineTo(s,o);break;case"l":s+=l[1],o+=l[2],e.lineTo(s,o);break;case"C":s=l[5],o=l[6],e.bezierCurveTo(l[1],l[2],l[3],l[4],s,o);break;case"c":e.bezierCurveTo(s+l[1],o+l[2],s+l[3],o+l[4],s+l[5],o+l[6]),s+=l[5],o+=l[6];break;case"S":s=l[3],o=l[4],e.bezierCurveToShort(l[1],l[2],s,o);break;case"s":e.bezierCurveToShort(s+l[1],o+l[2],s+l[3],o+l[4]),s+=l[3],o+=l[4];break;case"Q":s=l[3],o=l[4],e.quadraticCurveTo(l[1],l[2],s,o);break;case"q":e.quadraticCurveTo(s+l[1],o+l[2],s+l[3],o+l[4]),s+=l[3],o+=l[4];break;case"T":s=l[1],o=l[2],e.quadraticCurveToShort(s,o);break;case"t":s+=l[1],o+=l[2],e.quadraticCurveToShort(s,o);break;case"A":s=l[6],o=l[7],e.arcToSvg(l[1],l[2],l[3],l[4],l[5],s,o);break;case"a":s+=l[6],o+=l[7],e.arcToSvg(l[1],l[2],l[3],l[4],l[5],s,o);break;case"Z":case"z":e.closePath(),n.length>0&&(i=n.pop(),i?(s=i.startX,o=i.startY):(s=0,o=0)),i=null;break;default:(0,c.R)(`Unknown SVG path command: ${h}`)}"Z"!==h&&"z"!==h&&null===i&&(i={startX:s,startY:o},n.push(i))}}(t,this):this.instructions=t?.slice()??[]}get shapePath(){return this._shapePath||(this._shapePath=new U(this)),this._dirty&&(this._dirty=!1,this._shapePath.buildPath()),this._shapePath}addPath(t,e){return t=t.clone(),this.instructions.push({action:"addPath",data:[t,e]}),this._dirty=!0,this}arc(...t){return this.instructions.push({action:"arc",data:t}),this._dirty=!0,this}arcTo(...t){return this.instructions.push({action:"arcTo",data:t}),this._dirty=!0,this}arcToSvg(...t){return this.instructions.push({action:"arcToSvg",data:t}),this._dirty=!0,this}bezierCurveTo(...t){return this.instructions.push({action:"bezierCurveTo",data:t}),this._dirty=!0,this}bezierCurveToShort(t,e,r,n,i){const s=this.instructions[this.instructions.length-1],a=this.getLastPoint(o.b.shared);let h=0,l=0;if(s&&"bezierCurveTo"===s.action){h=s.data[2],l=s.data[3];const t=a.x,e=a.y;h=t+(t-h),l=e+(e-l)}else h=a.x,l=a.y;return this.instructions.push({action:"bezierCurveTo",data:[h,l,t,e,r,n,i]}),this._dirty=!0,this}closePath(){return this.instructions.push({action:"closePath",data:[]}),this._dirty=!0,this}ellipse(...t){return this.instructions.push({action:"ellipse",data:t}),this._dirty=!0,this}lineTo(...t){return this.instructions.push({action:"lineTo",data:t}),this._dirty=!0,this}moveTo(...t){return this.instructions.push({action:"moveTo",data:t}),this}quadraticCurveTo(...t){return this.instructions.push({action:"quadraticCurveTo",data:t}),this._dirty=!0,this}quadraticCurveToShort(t,e,r){const n=this.instructions[this.instructions.length-1],i=this.getLastPoint(o.b.shared);let s=0,a=0;if(n&&"quadraticCurveTo"===n.action){s=n.data[0],a=n.data[1];const t=i.x,e=i.y;s=t+(t-s),a=e+(e-a)}else s=i.x,a=i.y;return this.instructions.push({action:"quadraticCurveTo",data:[s,a,t,e,r]}),this._dirty=!0,this}rect(t,e,r,n,i){return this.instructions.push({action:"rect",data:[t,e,r,n,i]}),this._dirty=!0,this}circle(t,e,r,n){return this.instructions.push({action:"circle",data:[t,e,r,n]}),this._dirty=!0,this}roundRect(...t){return this.instructions.push({action:"roundRect",data:t}),this._dirty=!0,this}poly(...t){return this.instructions.push({action:"poly",data:t}),this._dirty=!0,this}regularPoly(...t){return this.instructions.push({action:"regularPoly",data:t}),this._dirty=!0,this}roundPoly(...t){return this.instructions.push({action:"roundPoly",data:t}),this._dirty=!0,this}roundShape(...t){return this.instructions.push({action:"roundShape",data:t}),this._dirty=!0,this}filletRect(...t){return this.instructions.push({action:"filletRect",data:t}),this._dirty=!0,this}chamferRect(...t){return this.instructions.push({action:"chamferRect",data:t}),this._dirty=!0,this}star(t,e,r,n,i,s,o){i||(i=n/2);const a=-1*Math.PI/2+s,h=2*r,l=2*Math.PI/h,u=[];for(let r=0;r<h;r++){const s=r%2?i:n,o=r*l+a;u.push(t+s*Math.cos(o),e+s*Math.sin(o))}return this.poly(u,!0,o),this}clone(t=!1){const e=new X;if(e.checkForHoles=this.checkForHoles,t)for(let t=0;t<this.instructions.length;t++){const r=this.instructions[t];e.instructions.push({action:r.action,data:r.data.slice()})}else e.instructions=this.instructions.slice();return e}clear(){return this.instructions.length=0,this._dirty=!0,this}transform(t){if(t.isIdentity())return this;const e=t.a,r=t.b,n=t.c,i=t.d,s=t.tx,o=t.ty;let a=0,h=0,l=0,u=0,d=0,f=0,p=0,y=0;for(let m=0;m<this.instructions.length;m++){const g=this.instructions[m],x=g.data;switch(g.action){case"moveTo":case"lineTo":a=x[0],h=x[1],x[0]=e*a+n*h+s,x[1]=r*a+i*h+o;break;case"bezierCurveTo":l=x[0],u=x[1],d=x[2],f=x[3],a=x[4],h=x[5],x[0]=e*l+n*u+s,x[1]=r*l+i*u+o,x[2]=e*d+n*f+s,x[3]=r*d+i*f+o,x[4]=e*a+n*h+s,x[5]=r*a+i*h+o;break;case"quadraticCurveTo":l=x[0],u=x[1],a=x[2],h=x[3],x[0]=e*l+n*u+s,x[1]=r*l+i*u+o,x[2]=e*a+n*h+s,x[3]=r*a+i*h+o;break;case"arcToSvg":a=x[5],h=x[6],p=x[0],y=x[1],x[0]=e*p+n*y,x[1]=r*p+i*y,x[5]=e*a+n*h+s,x[6]=r*a+i*h+o;break;case"circle":x[4]=Y(x[3],t);break;case"rect":x[4]=Y(x[4],t);break;case"ellipse":x[8]=Y(x[8],t);break;case"roundRect":x[5]=Y(x[5],t);break;case"addPath":x[0].transform(t);break;case"poly":x[2]=Y(x[2],t);break;default:(0,c.R)("unknown transform action",g.action)}}return this._dirty=!0,this}get bounds(){return this.shapePath.bounds}getLastPoint(t){let e=this.instructions.length-1,r=this.instructions[e];if(!r)return t.x=0,t.y=0,t;for(;"closePath"===r.action;){if(e--,e<0)return t.x=0,t.y=0,t;r=this.instructions[e]}switch(r.action){case"moveTo":case"lineTo":t.x=r.data[0],t.y=r.data[1];break;case"quadraticCurveTo":t.x=r.data[2],t.y=r.data[3];break;case"bezierCurveTo":t.x=r.data[4],t.y=r.data[5];break;case"arc":case"arcToSvg":t.x=r.data[5],t.y=r.data[6];break;case"addPath":r.data[0].getLastPoint(t)}return t}}function Y(t,e){return t?t.prepend(e):e.clone()}var V=r(7276);function H(t,e,r){const n=t.getAttribute(e);return n?Number(n):r}function $(t){const e=H(t,"x1",0),r=H(t,"y1",0),n=H(t,"x2",1),s=H(t,"y2",0),o=t.getAttribute("gradientUnits")||"objectBoundingBox",a=new V._(e,r,n,s,"objectBoundingBox"===o?"local":"global");for(let e=0;e<t.children.length;e++){const r=t.children[e],n=H(r,"offset",0),s=i.Q.shared.setValue(r.getAttribute("stop-color")).toNumber();a.addColorStop(n,s)}return a}function q(t){return(0,c.R)("[SVG Parser] Radial gradients are not yet supported"),new V._(0,0,1,0)}function K(t){const e=t.match(/url\s*\(\s*['"]?\s*#([^'"\s)]+)\s*['"]?\s*\)/i);return e?e[1]:""}const Z={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 Q(t,e){const r=t.getAttribute("style"),n={},i={},s={strokeStyle:n,fillStyle:i,useFill:!1,useStroke:!1};for(const r in Z){const n=t.getAttribute(r);n&&J(e,s,r,n.trim())}if(r){const t=r.split(";");for(let r=0;r<t.length;r++){const n=t[r].trim(),[i,o]=n.split(":");Z[i]&&J(e,s,i,o.trim())}}return{strokeStyle:s.useStroke?n:null,fillStyle:s.useFill?i:null,useFill:s.useFill,useStroke:s.useStroke}}function J(t,e,r,n){switch(r){case"stroke":if("none"!==n){if(n.startsWith("url(")){const r=K(n);e.strokeStyle.fill=t.defs[r]}else e.strokeStyle.color=i.Q.shared.setValue(n).toNumber();e.useStroke=!0}break;case"stroke-width":e.strokeStyle.width=Number(n);break;case"fill":if("none"!==n){if(n.startsWith("url(")){const r=K(n);e.fillStyle.fill=t.defs[r]}else e.fillStyle.color=i.Q.shared.setValue(n).toNumber();e.useFill=!0}break;case"fill-opacity":e.fillStyle.alpha=Number(n);break;case"stroke-opacity":e.strokeStyle.alpha=Number(n);break;case"opacity":e.fillStyle.alpha=Number(n),e.strokeStyle.alpha=Number(n)}}function tt(t){const e=t.match(/[-+]?[0-9]*\.?[0-9]+/g);if(!e||e.length<4)return 0;const r=e.map(Number),n=[],i=[];for(let t=0;t<r.length;t+=2)t+1<r.length&&(n.push(r[t]),i.push(r[t+1]));if(0===n.length||0===i.length)return 0;const s=Math.min(...n),o=Math.max(...n),a=Math.min(...i);return(o-s)*(Math.max(...i)-a)}function et(t,e){const r=new X(t,!1);for(const t of r.instructions)e.instructions.push(t)}function rt(t,e){if("string"==typeof t){const e=document.createElement("div");e.innerHTML=t.trim(),t=e.querySelector("svg")}const r={context:e,defs:{},path:new X};!function(t,e){const r=t.querySelectorAll("defs");for(let t=0;t<r.length;t++){const n=r[t];for(let t=0;t<n.children.length;t++){const r=n.children[t];switch(r.nodeName.toLowerCase()){case"lineargradient":e.defs[r.id]=$(r);break;case"radialgradient":e.defs[r.id]=q()}}}}(t,r);const n=t.children,{fillStyle:i,strokeStyle:s}=Q(t,r);for(let t=0;t<n.length;t++){const e=n[t];"defs"!==e.nodeName.toLowerCase()&&nt(e,r,i,s)}return e}function nt(t,e,r,n){const i=t.children,{fillStyle:s,strokeStyle:o}=Q(t,e);s&&r?r={...r,...s}:s&&(r=s),o&&n?n={...n,...o}:o&&(n=o);const a=!r&&!n;let h,l,u,d,f,p,y,m,g,x,v,b,_,w,S,C,M;switch(a&&(r={color:0}),t.nodeName.toLowerCase()){case"path":{w=t.getAttribute("d");const i=t.getAttribute("fill-rule"),s=w.split(/(?=[Mm])/).filter((t=>t.trim().length>0)),o="evenodd"===i,a=s.length>1;if(o&&a){const t=s.map((t=>({path:t,area:tt(t)})));t.sort(((t,e)=>e.area-t.area));const i=s.length>3||!function(t){if(t.length<=2)return!0;const e=t.map((t=>t.area)).sort(((t,e)=>e-t)),[r,n]=e,i=e[e.length-1];return!(r/n>3&&n/i<2)}(t);if(i)for(let i=0;i<t.length;i++){const s=t[i],o=0===i;e.context.beginPath();const a=new X(void 0,!0);et(s.path,a),e.context.path(a),o?(r&&e.context.fill(r),n&&e.context.stroke(n)):e.context.cut()}else for(let i=0;i<t.length;i++){const s=t[i],o=i%2==1;e.context.beginPath();const a=new X(void 0,!0);et(s.path,a),e.context.path(a),o?e.context.cut():(r&&e.context.fill(r),n&&e.context.stroke(n))}}else{S=new X(w,!i||"evenodd"===i),e.context.path(S),r&&e.context.fill(r),n&&e.context.stroke(n)}break}case"circle":y=H(t,"cx",0),m=H(t,"cy",0),g=H(t,"r",0),e.context.ellipse(y,m,g,g),r&&e.context.fill(r),n&&e.context.stroke(n);break;case"rect":h=H(t,"x",0),l=H(t,"y",0),C=H(t,"width",0),M=H(t,"height",0),x=H(t,"rx",0),v=H(t,"ry",0),x||v?e.context.roundRect(h,l,C,M,x||v):e.context.rect(h,l,C,M),r&&e.context.fill(r),n&&e.context.stroke(n);break;case"ellipse":y=H(t,"cx",0),m=H(t,"cy",0),x=H(t,"rx",0),v=H(t,"ry",0),e.context.beginPath(),e.context.ellipse(y,m,x,v),r&&e.context.fill(r),n&&e.context.stroke(n);break;case"line":u=H(t,"x1",0),d=H(t,"y1",0),f=H(t,"x2",0),p=H(t,"y2",0),e.context.beginPath(),e.context.moveTo(u,d),e.context.lineTo(f,p),n&&e.context.stroke(n);break;case"polygon":_=t.getAttribute("points"),b=_.match(/-?\d+/g).map((t=>parseInt(t,10))),e.context.poly(b,!0),r&&e.context.fill(r),n&&e.context.stroke(n);break;case"polyline":_=t.getAttribute("points"),b=_.match(/-?\d+/g).map((t=>parseInt(t,10))),e.context.poly(b,!1),n&&e.context.stroke(n);break;case"g":case"svg":break;default:(0,c.R)(`[SVG parser] <${t.nodeName}> elements unsupported`)}a&&(r=null);for(let t=0;t<i.length;t++)nt(i[t],e,r,n)}var it=r(990);function st(t,e){let r=1;const n=t.shapePath.shapePrimitives;for(let t=0;t<n.length;t++){const i=n[t].shape;if("polygon"!==i.type)continue;const s=i.points,o=s.length;if(o<6)continue;const a=i.closePath;for(let t=0;t<o;t+=2){if(!a&&(0===t||t===o-2))continue;const n=(t-2+o)%o,i=(t+2)%o,h=s[n],l=s[n+1],u=s[t],c=s[t+1],d=h-u,f=l-c,p=s[i]-u,y=s[i+1]-c,m=d*d+f*f,g=p*p+y*y;if(m<1e-12||g<1e-12)continue;let x=(d*p+f*y)/Math.sqrt(m*g);x<-1?x=-1:x>1&&(x=1);const v=Math.sqrt(.5*(1-x));if(v<1e-6)continue;const b=Math.min(1/v,e);b>r&&(r=b)}}return r}const ot=new o.b,at=new s.u,ht=class t extends n.A{constructor(){super(...arguments),this._gpuData=Object.create(null),this.autoGarbageCollect=!0,this._gcLastUsed=-1,this.uid=(0,h.L)("graphicsContext"),this.dirty=!0,this.batchMode="auto",this.instructions=[],this.destroyed=!1,this._activePath=new X,this._transform=new s.u,this._fillStyle={...t.defaultFillStyle},this._strokeStyle={...t.defaultStrokeStyle},this._stateStack=[],this._tick=0,this._bounds=new u.c,this._boundsDirty=!0}clone(){const e=new t;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=!0,e}get fillStyle(){return this._fillStyle}set fillStyle(e){this._fillStyle=(0,it.w)(e,t.defaultFillStyle)}get strokeStyle(){return this._strokeStyle}set strokeStyle(e){this._strokeStyle=(0,it.T)(e,t.defaultStrokeStyle)}setFillStyle(e){return this._fillStyle=(0,it.w)(e,t.defaultFillStyle),this}setStrokeStyle(e){return this._strokeStyle=(0,it.w)(e,t.defaultStrokeStyle),this}texture(t,e,r,n,s,o){return this.instructions.push({action:"texture",data:{image:t,dx:r||0,dy:n||0,dw:s||t.frame.width,dh:o||t.frame.height,transform:this._transform.clone(),alpha:this._fillStyle.alpha,style:e||0===e?i.Q.shared.setValue(e).toNumber():16777215}}),this.onUpdate(),this}beginPath(){return this._activePath=new X,this}fill(e,r){let n;const i=this.instructions[this.instructions.length-1];return n=0===this._tick&&"stroke"===i?.action?i.data.path:this._activePath.clone(),n?(null!=e&&(void 0!==r&&"number"==typeof e&&((0,l.t6)(l.lj,"GraphicsContext.fill(color, alpha) is deprecated, use GraphicsContext.fill({ color, alpha }) instead"),e={color:e,alpha:r}),this._fillStyle=(0,it.w)(e,t.defaultFillStyle)),this.instructions.push({action:"fill",data:{style:this.fillStyle,path:n}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this}_initNextPathLocation(){const{x:t,y:e}=this._activePath.getLastPoint(o.b.shared);this._activePath.clear(),this._activePath.moveTo(t,e)}stroke(e){let r;const n=this.instructions[this.instructions.length-1];return r=0===this._tick&&"fill"===n?.action?n.data.path:this._activePath.clone(),r?(null!=e&&(this._strokeStyle=(0,it.T)(e,t.defaultStrokeStyle)),this.instructions.push({action:"stroke",data:{style:this.strokeStyle,path:r}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this}cut(){for(let t=0;t<2;t++){const e=this.instructions[this.instructions.length-1-t],r=this._activePath.clone();if(e&&("stroke"===e.action||"fill"===e.action)){if(!e.data.hole){e.data.hole=r;break}e.data.hole.addPath(r)}}return this._initNextPathLocation(),this}arc(t,e,r,n,i,s){this._tick++;const o=this._transform;return this._activePath.arc(o.a*t+o.c*e+o.tx,o.b*t+o.d*e+o.ty,r,n,i,s),this}arcTo(t,e,r,n,i){this._tick++;const s=this._transform;return this._activePath.arcTo(s.a*t+s.c*e+s.tx,s.b*t+s.d*e+s.ty,s.a*r+s.c*n+s.tx,s.b*r+s.d*n+s.ty,i),this}arcToSvg(t,e,r,n,i,s,o){this._tick++;const a=this._transform;return this._activePath.arcToSvg(t,e,r,n,i,a.a*s+a.c*o+a.tx,a.b*s+a.d*o+a.ty),this}bezierCurveTo(t,e,r,n,i,s,o){this._tick++;const a=this._transform;return this._activePath.bezierCurveTo(a.a*t+a.c*e+a.tx,a.b*t+a.d*e+a.ty,a.a*r+a.c*n+a.tx,a.b*r+a.d*n+a.ty,a.a*i+a.c*s+a.tx,a.b*i+a.d*s+a.ty,o),this}closePath(){return this._tick++,this._activePath?.closePath(),this}ellipse(t,e,r,n){return this._tick++,this._activePath.ellipse(t,e,r,n,this._transform.clone()),this}circle(t,e,r){return this._tick++,this._activePath.circle(t,e,r,this._transform.clone()),this}path(t){return this._tick++,this._activePath.addPath(t,this._transform.clone()),this}lineTo(t,e){this._tick++;const r=this._transform;return this._activePath.lineTo(r.a*t+r.c*e+r.tx,r.b*t+r.d*e+r.ty),this}moveTo(t,e){this._tick++;const r=this._transform,n=this._activePath.instructions,i=r.a*t+r.c*e+r.tx,s=r.b*t+r.d*e+r.ty;return 1===n.length&&"moveTo"===n[0].action?(n[0].data[0]=i,n[0].data[1]=s,this):(this._activePath.moveTo(i,s),this)}quadraticCurveTo(t,e,r,n,i){this._tick++;const s=this._transform;return this._activePath.quadraticCurveTo(s.a*t+s.c*e+s.tx,s.b*t+s.d*e+s.ty,s.a*r+s.c*n+s.tx,s.b*r+s.d*n+s.ty,i),this}rect(t,e,r,n){return this._tick++,this._activePath.rect(t,e,r,n,this._transform.clone()),this}roundRect(t,e,r,n,i){return this._tick++,this._activePath.roundRect(t,e,r,n,i,this._transform.clone()),this}poly(t,e){return this._tick++,this._activePath.poly(t,e,this._transform.clone()),this}regularPoly(t,e,r,n,i=0,s){return this._tick++,this._activePath.regularPoly(t,e,r,n,i,s),this}roundPoly(t,e,r,n,i,s){return this._tick++,this._activePath.roundPoly(t,e,r,n,i,s),this}roundShape(t,e,r,n){return this._tick++,this._activePath.roundShape(t,e,r,n),this}filletRect(t,e,r,n,i){return this._tick++,this._activePath.filletRect(t,e,r,n,i),this}chamferRect(t,e,r,n,i,s){return this._tick++,this._activePath.chamferRect(t,e,r,n,i,s),this}star(t,e,r,n,i=0,s=0){return this._tick++,this._activePath.star(t,e,r,n,i,s,this._transform.clone()),this}svg(t){return this._tick++,rt(t,this),this}restore(){const t=this._stateStack.pop();return t&&(this._transform=t.transform,this._fillStyle=t.fillStyle,this._strokeStyle=t.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(t){return this._transform.rotate(t),this}scale(t,e=t){return this._transform.scale(t,e),this}setTransform(t,e,r,n,i,o){return t instanceof s.u?(this._transform.set(t.a,t.b,t.c,t.d,t.tx,t.ty),this):(this._transform.set(t,e,r,n,i,o),this)}transform(t,e,r,n,i,o){return t instanceof s.u?(this._transform.append(t),this):(at.set(t,e,r,n,i,o),this._transform.append(at),this)}translate(t,e=t){return this._transform.translate(t,e),this}clear(){return this._activePath.clear(),this.instructions.length=0,this.resetTransform(),this.onUpdate(),this}onUpdate(){this._boundsDirty=!0,this.dirty=!0,this.emit("update",this,16)}get bounds(){if(!this._boundsDirty)return this._bounds;this._boundsDirty=!1;const t=this._bounds;t.clear();for(let e=0;e<this.instructions.length;e++){const r=this.instructions[e],n=r.action;if("fill"===n){const e=r.data;t.addBounds(e.path.bounds)}else if("texture"===n){const e=r.data;t.addFrame(e.dx,e.dy,e.dx+e.dw,e.dy+e.dh,e.transform)}if("stroke"===n){const e=r.data,n=e.style.alignment;let i=e.style.width*(1-n);"miter"===e.style.join&&(i*=st(e.path,e.style.miterLimit));const s=e.path.bounds;t.addFrame(s.minX-i,s.minY-i,s.maxX+i,s.maxY+i)}}return t.isValid||t.set(0,0,0,0),t}containsPoint(t){if(!this.bounds.containsPoint(t.x,t.y))return!1;const e=this.instructions;let r=!1;for(let n=0;n<e.length;n++){const i=e[n],s=i.data,o=s.path;if(!i.action||!o)continue;const a=s.style,h=o.shapePath.shapePrimitives;for(let e=0;e<h.length;e++){const n=h[e].shape;if(!a||!n)continue;const o=h[e].transform,l=o?o.applyInverse(t,ot):t;if("fill"===i.action)r=n.contains(l.x,l.y);else{const t=a;r=n.strokeContains(l.x,l.y,t.width,t.alignment)}const u=s.hole;if(u){const t=u.shapePath?.shapePrimitives;if(t)for(let e=0;e<t.length;e++)t[e].shape.contains(l.x,l.y)&&(r=!1)}if(r)return!0}}return r}unload(){this.emit("unload",this);for(const t in this._gpuData)this._gpuData[t]?.destroy();this._gpuData=Object.create(null)}destroy(t=!1){if(this.destroyed)return;this.destroyed=!0,this._stateStack.length=0,this._transform=null,this.unload(),this.emit("destroy",this),this.removeAllListeners();if("boolean"==typeof t?t:t?.texture){const e="boolean"==typeof t?t:t?.textureSource;this._fillStyle.texture&&(this._fillStyle.fill&&"uid"in this._fillStyle.fill?this._fillStyle.fill.destroy():this._fillStyle.texture.destroy(e)),this._strokeStyle.texture&&(this._strokeStyle.fill&&"uid"in this._strokeStyle.fill?this._strokeStyle.fill.destroy():this._strokeStyle.texture.destroy(e))}this._fillStyle=null,this._strokeStyle=null,this.instructions=null,this._activePath=null,this._bounds=null,this._stateStack=null,this.customShader=null,this._transform=null}};ht.defaultFillStyle={color:16777215,alpha:1,texture:a.g.WHITE,matrix:null,fill:null,textureSpace:"local"},ht.defaultStrokeStyle={width:1,color:16777215,alpha:1,alignment:.5,miterLimit:10,cap:"butt",join:"miter",texture:a.g.WHITE,matrix:null,fill:null,textureSpace:"local",pixelLine:!1};let lt=ht},378:(t,e,r)=>{r.d(e,{GH:()=>p});var n=r(8507),i=r(341),s=r(2043),o=r(848),a=r(4334),h=r(4670),l=r(8655),u=r(2801);class c{constructor(){this.batches=[],this.geometryData={vertices:[],uvs:[],indices:[]}}reset(){this.batches&&this.batches.forEach((t=>{l.Z.return(t)})),this.graphicsData&&l.Z.return(this.graphicsData),this.isBatchable=!1,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}}class d{constructor(){this.instructions=new o.L}init(t){const e=t.maxTextures;this.batcher?this.batcher._updateMaxTextures(e):this.batcher=new s.J({maxTextures:e}),this.instructions.reset()}get geometry(){return(0,h.t6)(h.Ek,"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}}const f=class t{constructor(t){this._renderer=t,this._managedContexts=new a.s({renderer:t,type:"resource",name:"graphicsContext"})}init(e){t.defaultOptions.bezierSmoothness=e?.bezierSmoothness??t.defaultOptions.bezierSmoothness}getContextRenderData(t){return t._gpuData[this._renderer.uid].graphicsData||this._initContextRenderData(t)}updateGpuContext(t){const e=!!t._gpuData[this._renderer.uid],r=t._gpuData[this._renderer.uid]||this._initContext(t);if(t.dirty||!e){e&&r.reset(),(0,u.M)(t,r);const n=t.batchMode;t.customShader||"no-batch"===n?r.isBatchable=!1:r.isBatchable="auto"!==n||r.geometryData.vertices.length<400,t.dirty=!1}return r}getGpuContext(t){return t._gpuData[this._renderer.uid]||this._initContext(t)}_initContextRenderData(t){const e=l.Z.get(d,{maxTextures:this._renderer.limits.maxBatchableTextures}),r=t._gpuData[this._renderer.uid],{batches:n,geometryData:s}=r;r.graphicsData=e;const o=s.vertices.length,a=s.indices.length;for(let t=0;t<n.length;t++)n[t].applyTransform=!1;const h=e.batcher;h.ensureAttributeBuffer(o),h.ensureIndexBuffer(a),h.begin();for(let t=0;t<n.length;t++){const e=n[t];h.add(e)}h.finish(e.instructions);const u=h.geometry;u.indexBuffer.setDataWithSize(h.indexBuffer,h.indexSize,!0),u.buffers[0].setDataWithSize(h.attributeBuffer.float32View,h.attributeSize,!0);const c=h.batches;for(let t=0;t<c.length;t++){const e=c[t];e.bindGroup=(0,i.w)(e.textures.textures,e.textures.count,this._renderer.limits.maxBatchableTextures)}return e}_initContext(t){const e=new c;return e.context=t,t._gpuData[this._renderer.uid]=e,this._managedContexts.add(t),e}destroy(){this._managedContexts.destroy(),this._renderer=null}};f.extension={type:[n.Ag.WebGLSystem,n.Ag.WebGPUSystem],name:"graphicsContext"},f.defaultOptions={bezierSmoothness:.5};let p=f},115:(t,e,r)=>{r.d(e,{h:()=>a});var n=r(5101),i=r(4928);function s(t,e,r,n,i,s,o,a){let h,l;o?(h=n,l=-r):(h=-n,l=r);const u=t-r*i+h,c=e-n*i+l,d=t+r*s+h,f=e+n*s+l;return a.push(u,c),a.push(d,f),2}function o(t,e,r,n,i,s,o,a){const h=r-t,l=n-e;let u=Math.atan2(h,l),c=Math.atan2(i-t,s-e);a&&u<c?u+=2*Math.PI:!a&&u>c&&(c+=2*Math.PI);let d=u;const f=c-u,p=Math.abs(f),y=Math.sqrt(h*h+l*l),m=1+(15*p*Math.sqrt(y)/Math.PI|0),g=f/m;if(d+=g,a){o.push(t,e),o.push(r,n);for(let r=1,n=d;r<m;r++,n+=g)o.push(t,e),o.push(t+Math.sin(n)*y,e+Math.cos(n)*y);o.push(t,e),o.push(i,s)}else{o.push(r,n),o.push(t,e);for(let r=1,n=d;r<m;r++,n+=g)o.push(t+Math.sin(n)*y,e+Math.cos(n)*y),o.push(t,e);o.push(i,s),o.push(t,e)}return 2*m}function a(t,e,r,a,h,l){const u=i.B;if(0===t.length)return;const c=e;let d=c.alignment;if(.5!==e.alignment){let e=function(t){const e=t.length;if(e<6)return 1;let r=0;for(let n=0,i=t[e-2],s=t[e-1];n<e;n+=2){const e=t[n],o=t[n+1];r+=(e-i)*(o+s),i=e,s=o}return r<0?-1:1}(t);r&&(e*=-1),d=(d-.5)*e+.5}const f=new n.b(t[0],t[1]),p=new n.b(t[t.length-2],t[t.length-1]),y=a,m=Math.abs(f.x-p.x)<u&&Math.abs(f.y-p.y)<u;if(y){t=t.slice(),m&&(t.pop(),t.pop(),p.set(t[t.length-2],t[t.length-1]));const e=.5*(f.x+p.x),r=.5*(p.y+f.y);t.unshift(e,r),t.push(e,r)}const g=h,x=t.length/2;let v=t.length;const b=g.length/2,_=c.width/2,w=_*_,S=c.miterLimit*c.miterLimit;let C=t[0],M=t[1],T=t[2],A=t[3],k=0,P=0,E=-(M-A),R=C-T,I=0,O=0,L=Math.sqrt(E*E+R*R);E/=L,R/=L,E*=_,R*=_;const B=2*(1-d),D=2*d;y||("round"===c.cap?v+=o(C-E*(B-D)*.5,M-R*(B-D)*.5,C-E*B,M-R*B,C+E*D,M+R*D,g,!0)+2:"square"===c.cap&&(v+=s(C,M,E,R,B,D,!0,g))),g.push(C-E*B,M-R*B),g.push(C+E*D,M+R*D);for(let e=1;e<x-1;++e){C=t[2*(e-1)],M=t[2*(e-1)+1],T=t[2*e],A=t[2*e+1],k=t[2*(e+1)],P=t[2*(e+1)+1],E=-(M-A),R=C-T,L=Math.sqrt(E*E+R*R),E/=L,R/=L,E*=_,R*=_,I=-(A-P),O=T-k,L=Math.sqrt(I*I+O*O),I/=L,O/=L,I*=_,O*=_;const r=T-C,n=M-A,i=T-k,s=P-A,a=r*i+n*s,h=n*i-s*r,l=h<0;if(Math.abs(h)<.001*Math.abs(a)){g.push(T-E*B,A-R*B),g.push(T+E*D,A+R*D),a>=0&&("round"===c.join?v+=o(T,A,T-E*B,A-R*B,T-I*B,A-O*B,g,!1)+4:v+=2,g.push(T-I*D,A-O*D),g.push(T+I*B,A+O*B));continue}const u=(-E+C)*(-R+A)-(-E+T)*(-R+M),d=(-I+k)*(-O+A)-(-I+T)*(-O+P),f=(r*d-i*u)/h,p=(s*u-n*d)/h,y=(f-T)*(f-T)+(p-A)*(p-A),m=T+(f-T)*B,x=A+(p-A)*B,b=T-(f-T)*D,F=A-(p-A)*D,G=l?B:D;y<=Math.min(r*r+n*n,i*i+s*s)+G*G*w?"bevel"===c.join||y/w>S?(l?(g.push(m,x),g.push(T+E*D,A+R*D),g.push(m,x),g.push(T+I*D,A+O*D)):(g.push(T-E*B,A-R*B),g.push(b,F),g.push(T-I*B,A-O*B),g.push(b,F)),v+=2):"round"===c.join?l?(g.push(m,x),g.push(T+E*D,A+R*D),v+=o(T,A,T+E*D,A+R*D,T+I*D,A+O*D,g,!0)+4,g.push(m,x),g.push(T+I*D,A+O*D)):(g.push(T-E*B,A-R*B),g.push(b,F),v+=o(T,A,T-E*B,A-R*B,T-I*B,A-O*B,g,!1)+4,g.push(T-I*B,A-O*B),g.push(b,F)):(g.push(m,x),g.push(b,F)):(g.push(T-E*B,A-R*B),g.push(T+E*D,A+R*D),"round"===c.join?v+=l?o(T,A,T+E*D,A+R*D,T+I*D,A+O*D,g,!0)+2:o(T,A,T-E*B,A-R*B,T-I*B,A-O*B,g,!1)+2:"miter"===c.join&&y/w<=S&&(l?(g.push(b,F),g.push(b,F)):(g.push(m,x),g.push(m,x)),v+=2),g.push(T-I*B,A-O*B),g.push(T+I*D,A+O*D),v+=2)}C=t[2*(x-2)],M=t[2*(x-2)+1],T=t[2*(x-1)],A=t[2*(x-1)+1],E=-(M-A),R=C-T,L=Math.sqrt(E*E+R*R),E/=L,R/=L,E*=_,R*=_,g.push(T-E*B,A-R*B),g.push(T+E*D,A+R*D),y||("round"===c.cap?v+=o(T-E*(B-D)*.5,A-R*(B-D)*.5,T-E*B,A-R*B,T+E*D,A+R*D,g,!1)+2:"square"===c.cap&&(v+=s(T,A,E,R,B,D,!1,g)));const F=i.I*i.I;for(let t=b;t<v+b-2;++t)C=g[2*t],M=g[2*t+1],T=g[2*(t+1)],A=g[2*(t+1)+1],k=g[2*(t+2)],P=g[2*(t+2)+1],Math.abs(C*(A-P)+T*(P-M)+k*(M-A))<F||l.push(t,t+1,t+2)}},4928:(t,e,r)=>{r.d(e,{B:()=>n,I:()=>i});const n=1e-4,i=1e-4},7276:(t,e,r)=>{r.d(e,{_:()=>f});var n=r(2577),i=r(1761),s=r(9313),o=r(8293),a=r(5589),h=r(133),l=r(4670),u=r(2698);const c=[{offset:0,color:"white"},{offset:1,color:"black"}],d=class t{constructor(...e){this.uid=(0,h.L)("fillGradient"),this._tick=0,this.type="linear",this.colorStops=[];let r=function(t){let e=t[0]??{};("number"==typeof e||t[1])&&((0,l.t6)("8.5.2","use options object instead"),e={type:"linear",start:{x:t[0],y:t[1]},end:{x:t[2],y:t[3]},textureSpace:t[4],textureSize:t[5]??f.defaultLinearOptions.textureSize});return e}(e);r={..."radial"===r.type?t.defaultRadialOptions:t.defaultLinearOptions,...(0,u.S)(r)},this._textureSize=r.textureSize,this._wrapMode=r.wrapMode,"radial"===r.type?(this.center=r.center,this.outerCenter=r.outerCenter??this.center,this.innerRadius=r.innerRadius,this.outerRadius=r.outerRadius,this.scale=r.scale,this.rotation=r.rotation):(this.start=r.start,this.end=r.end),this.textureSpace=r.textureSpace,this.type=r.type,r.colorStops.forEach((t=>{this.addColorStop(t.offset,t.color)}))}addColorStop(t,e){return this.colorStops.push({offset:t,color:n.Q.shared.setValue(e).toHexa()}),this}buildLinearGradient(){if(this.texture)return;let{x:t,y:e}=this.start,{x:r,y:n}=this.end,i=r-t,h=n-e;const l=i<0||h<0;if("clamp-to-edge"===this._wrapMode){if(i<0){const e=t;t=r,r=e,i*=-1}if(h<0){const t=e;e=n,n=t,h*=-1}}const u=this.colorStops.length?this.colorStops:c,d=this._textureSize,{canvas:f,context:m}=y(d,1),g=l?m.createLinearGradient(this._textureSize,0,0,0):m.createLinearGradient(0,0,this._textureSize,0);p(g,u),m.fillStyle=g,m.fillRect(0,0,d,1),this.texture=new a.g({source:new o.b({resource:f,addressMode:this._wrapMode})});const x=Math.sqrt(i*i+h*h),v=Math.atan2(h,i),b=new s.u;b.scale(x/d,1),b.rotate(v),b.translate(t,e),"local"===this.textureSpace&&b.scale(d,d),this.transform=b}buildGradient(){this.texture||this._tick++,"linear"===this.type?this.buildLinearGradient():this.buildRadialGradient()}buildRadialGradient(){if(this.texture)return;const t=this.colorStops.length?this.colorStops:c,e=this._textureSize,{canvas:r,context:n}=y(e,e),{x:i,y:h}=this.center,{x:l,y:u}=this.outerCenter,d=this.innerRadius,f=this.outerRadius,m=l-f,g=u-f,x=e/(2*f),v=(i-m)*x,b=(h-g)*x,_=n.createRadialGradient(v,b,d*x,(l-m)*x,(u-g)*x,f*x);p(_,t),n.fillStyle=t[t.length-1].color,n.fillRect(0,0,e,e),n.fillStyle=_,n.translate(v,b),n.rotate(this.rotation),n.scale(1,this.scale),n.translate(-v,-b),n.fillRect(0,0,e,e),this.texture=new a.g({source:new o.b({resource:r,addressMode:this._wrapMode})});const w=new s.u;w.scale(1/x,1/x),w.translate(m,g),"local"===this.textureSpace&&w.scale(e,e),this.transform=w}destroy(){this.texture?.destroy(!0),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}`}};d.defaultLinearOptions={start:{x:0,y:0},end:{x:0,y:1},colorStops:[],textureSpace:"local",type:"linear",textureSize:256,wrapMode:"clamp-to-edge"},d.defaultRadialOptions={center:{x:.5,y:.5},innerRadius:0,outerRadius:.5,colorStops:[],scale:1,textureSpace:"local",type:"radial",textureSize:256,wrapMode:"clamp-to-edge"};let f=d;function p(t,e){for(let r=0;r<e.length;r++){const n=e[r];t.addColorStop(n.offset,n.color)}}function y(t,e){const r=i.e.get().createCanvas(t,e),n=r.getContext("2d");return{canvas:r,context:n}}},2806:(t,e,r)=>{r.d(e,{m:()=>o});var n=r(9313),i=r(133);const s={repeat:{addressModeU:"repeat",addressModeV:"repeat"},"repeat-x":{addressModeU:"repeat",addressModeV:"clamp-to-edge"},"repeat-y":{addressModeU:"clamp-to-edge",addressModeV:"repeat"},"no-repeat":{addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"}};class o{constructor(t,e){this.uid=(0,i.L)("fillPattern"),this._tick=0,this.transform=new n.u,this.texture=t,this.transform.scale(1/t.frame.width,1/t.frame.height),e&&(t.source.style.addressModeU=s[e].addressModeU,t.source.style.addressModeV=s[e].addressModeV)}setTransform(t){const e=this.texture;this.transform.copyFrom(t),this.transform.invert(),this.transform.scale(1/e.frame.width,1/e.frame.height),this._tick++}get texture(){return this._texture}set texture(t){this._texture!==t&&(this._texture=t,this._tick++)}get styleKey(){return`fill-pattern-${this.uid}-${this._tick}`}destroy(){this.texture.destroy(!0),this.texture=null}}},2801:(t,e,r)=>{r.d(e,{M:()=>Q,y:()=>q});var n=r(8507),i=r(9313),s=r(9252);function o(t,e,r,n,i){const s=e.a,o=e.b,a=e.c,h=e.d,l=e.tx,u=e.ty;r||(r=0),n||(n=2),i||(i=t.length/n-r);let c=r*n;for(let e=0;e<i;e++){const e=t[c],r=t[c+1];t[c]=s*e+a*r+l,t[c+1]=o*e+h*r+u,c+=n}}var a=r(5589),h=r(8655),l=r(6954);const u={extension:{type:n.Ag.ShapeBuilder,name:"circle"},build(t,e){let r,n,i,s,o,a;if("circle"===t.type){const e=t;if(o=a=e.radius,o<=0)return!1;r=e.x,n=e.y,i=s=0}else if("ellipse"===t.type){const e=t;if(o=e.halfWidth,a=e.halfHeight,o<=0||a<=0)return!1;r=e.x,n=e.y,i=s=0}else{const e=t,h=e.width/2,l=e.height/2;r=e.x+h,n=e.y+l,o=a=Math.max(0,Math.min(e.radius,Math.min(h,l))),i=h-o,s=l-a}if(i<0||s<0)return!1;const h=Math.ceil(2.3*Math.sqrt(o+a)),l=8*h+(i?4:0)+(s?4:0);if(0===l)return!1;if(0===h)return e[0]=e[6]=r+i,e[1]=e[3]=n+s,e[2]=e[4]=r-i,e[5]=e[7]=n-s,!0;let u=0,c=4*h+(i?2:0)+2,d=c,f=l,p=i+o,y=s,m=r+p,g=r-p,x=n+y;if(e[u++]=m,e[u++]=x,e[--c]=x,e[--c]=g,s){const t=n-y;e[d++]=g,e[d++]=t,e[--f]=t,e[--f]=m}for(let t=1;t<h;t++){const l=Math.PI/2*(t/h),p=i+Math.cos(l)*o,y=s+Math.sin(l)*a,m=r+p,g=r-p,x=n+y,v=n-y;e[u++]=m,e[u++]=x,e[--c]=x,e[--c]=g,e[d++]=g,e[d++]=v,e[--f]=v,e[--f]=m}p=i,y=s+a,m=r+p,g=r-p,x=n+y;const v=n-y;return e[u++]=m,e[u++]=x,e[--f]=v,e[--f]=m,i&&(e[u++]=g,e[u++]=x,e[--f]=v,e[--f]=g),!0},triangulate(t,e,r,n,i,s){if(0===t.length)return;let o=0,a=0;for(let e=0;e<t.length;e+=2)o+=t[e],a+=t[e+1];o/=t.length/2,a/=t.length/2;let h=n;e[h*r]=o,e[h*r+1]=a;const l=h++;for(let n=0;n<t.length;n+=2)e[h*r]=t[n],e[h*r+1]=t[n+1],n>0&&(i[s++]=h,i[s++]=l,i[s++]=h-1),h++;i[s++]=l+1,i[s++]=l,i[s++]=h-1}},c={...u,extension:{...u.extension,name:"ellipse"}},d={...u,extension:{...u.extension,name:"roundedRectangle"}};var f=r(115),p=r(4928);function y(t,e,r=2){const n=e&&e.length,i=n?e[0]*r:t.length;let s=m(t,0,i,r,!0);const o=[];if(!s||s.next===s.prev)return o;let a,h,l;if(n&&(s=function(t,e,r,n){const i=[];for(let r=0,s=e.length;r<s;r++){const o=m(t,e[r]*n,r<s-1?e[r+1]*n:t.length,n,!1);o===o.next&&(o.steiner=!0),i.push(A(o))}i.sort(S);for(let t=0;t<i.length;t++)r=C(i[t],r);return r}(t,e,s,r)),t.length>80*r){a=t[0],h=t[1];let e=a,n=h;for(let s=r;s<i;s+=r){const r=t[s],i=t[s+1];r<a&&(a=r),i<h&&(h=i),r>e&&(e=r),i>n&&(n=i)}l=Math.max(e-a,n-h),l=0!==l?32767/l:0}return x(s,o,r,a,h,l,0),o}function m(t,e,r,n,i){let s;if(i===N(t,e,r,n)>0)for(let i=e;i<r;i+=n)s=G(i/n|0,t[i],t[i+1],s);else for(let i=r-n;i>=e;i-=n)s=G(i/n|0,t[i],t[i+1],s);return s&&I(s,s.next)&&(j(s),s=s.next),s}function g(t,e){if(!t)return t;e||(e=t);let r,n=t;do{if(r=!1,n.steiner||!I(n,n.next)&&0!==R(n.prev,n,n.next))n=n.next;else{if(j(n),n=e=n.prev,n===n.next)break;r=!0}}while(r||n!==e);return e}function x(t,e,r,n,i,s,o){if(!t)return;!o&&s&&function(t,e,r,n){let i=t;do{0===i.z&&(i.z=T(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){let e,r=1;do{let n,i=t;t=null;let s=null;for(e=0;i;){e++;let o=i,a=0;for(let t=0;t<r&&(a++,o=o.nextZ,o);t++);let h=r;for(;a>0||h>0&&o;)0!==a&&(0===h||!o||i.z<=o.z)?(n=i,i=i.nextZ,a--):(n=o,o=o.nextZ,h--),s?s.nextZ=n:t=n,n.prevZ=s,s=n;i=o}s.nextZ=null,r*=2}while(e>1)}(i)}(t,n,i,s);let a=t;for(;t.prev!==t.next;){const h=t.prev,l=t.next;if(s?b(t,n,i,s):v(t))e.push(h.i,t.i,l.i),j(t),t=l.next,a=l.next;else if((t=l)===a){o?1===o?x(t=_(g(t),e),e,r,n,i,s,2):2===o&&w(t,e,r,n,i,s):x(g(t),e,r,n,i,s,1);break}}}function v(t){const e=t.prev,r=t,n=t.next;if(R(e,r,n)>=0)return!1;const i=e.x,s=r.x,o=n.x,a=e.y,h=r.y,l=n.y,u=Math.min(i,s,o),c=Math.min(a,h,l),d=Math.max(i,s,o),f=Math.max(a,h,l);let p=n.next;for(;p!==e;){if(p.x>=u&&p.x<=d&&p.y>=c&&p.y<=f&&P(i,a,s,h,o,l,p.x,p.y)&&R(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function b(t,e,r,n){const i=t.prev,s=t,o=t.next;if(R(i,s,o)>=0)return!1;const a=i.x,h=s.x,l=o.x,u=i.y,c=s.y,d=o.y,f=Math.min(a,h,l),p=Math.min(u,c,d),y=Math.max(a,h,l),m=Math.max(u,c,d),g=T(f,p,e,r,n),x=T(y,m,e,r,n);let v=t.prevZ,b=t.nextZ;for(;v&&v.z>=g&&b&&b.z<=x;){if(v.x>=f&&v.x<=y&&v.y>=p&&v.y<=m&&v!==i&&v!==o&&P(a,u,h,c,l,d,v.x,v.y)&&R(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,b.x>=f&&b.x<=y&&b.y>=p&&b.y<=m&&b!==i&&b!==o&&P(a,u,h,c,l,d,b.x,b.y)&&R(b.prev,b,b.next)>=0)return!1;b=b.nextZ}for(;v&&v.z>=g;){if(v.x>=f&&v.x<=y&&v.y>=p&&v.y<=m&&v!==i&&v!==o&&P(a,u,h,c,l,d,v.x,v.y)&&R(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;b&&b.z<=x;){if(b.x>=f&&b.x<=y&&b.y>=p&&b.y<=m&&b!==i&&b!==o&&P(a,u,h,c,l,d,b.x,b.y)&&R(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function _(t,e){let r=t;do{const n=r.prev,i=r.next.next;!I(n,i)&&O(n,r,r.next,i)&&D(n,i)&&D(i,n)&&(e.push(n.i,r.i,i.i),j(r),j(r.next),r=t=i),r=r.next}while(r!==t);return g(r)}function w(t,e,r,n,i,s){let o=t;do{let t=o.next.next;for(;t!==o.prev;){if(o.i!==t.i&&E(o,t)){let a=F(o,t);return o=g(o,o.next),a=g(a,a.next),x(o,e,r,n,i,s,0),void x(a,e,r,n,i,s,0)}t=t.next}o=o.next}while(o!==t)}function S(t,e){let r=t.x-e.x;if(0===r&&(r=t.y-e.y,0===r)){r=(t.next.y-t.y)/(t.next.x-t.x)-(e.next.y-e.y)/(e.next.x-e.x)}return r}function C(t,e){const r=function(t,e){let r=e;const n=t.x,i=t.y;let s,o=-1/0;if(I(t,r))return r;do{if(I(t,r.next))return r.next;if(i<=r.y&&i>=r.next.y&&r.next.y!==r.y){const t=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(t<=n&&t>o&&(o=t,s=r.x<r.next.x?r:r.next,t===n))return s}r=r.next}while(r!==e);if(!s)return null;const a=s,h=s.x,l=s.y;let u=1/0;r=s;do{if(n>=r.x&&r.x>=h&&n!==r.x&&k(i<l?n:o,i,h,l,i<l?o:n,i,r.x,r.y)){const e=Math.abs(i-r.y)/(n-r.x);D(r,t)&&(e<u||e===u&&(r.x>s.x||r.x===s.x&&M(s,r)))&&(s=r,u=e)}r=r.next}while(r!==a);return s}(t,e);if(!r)return e;const n=F(r,t);return g(n,n.next),g(r,r.next)}function M(t,e){return R(t.prev,t,e.prev)<0&&R(e.next,t,t.next)<0}function T(t,e,r,n,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function A(t){let e=t,r=t;do{(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next}while(e!==t);return r}function k(t,e,r,n,i,s,o,a){return(i-o)*(e-a)>=(t-o)*(s-a)&&(t-o)*(n-a)>=(r-o)*(e-a)&&(r-o)*(s-a)>=(i-o)*(n-a)}function P(t,e,r,n,i,s,o,a){return!(t===o&&e===a)&&k(t,e,r,n,i,s,o,a)}function E(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){let r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&O(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(D(t,e)&&D(e,t)&&function(t,e){let r=t,n=!1;const i=(t.x+e.x)/2,s=(t.y+e.y)/2;do{r.y>s!=r.next.y>s&&r.next.y!==r.y&&i<(r.next.x-r.x)*(s-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)&&(R(t.prev,t,e.prev)||R(t,e.prev,e))||I(t,e)&&R(t.prev,t,t.next)>0&&R(e.prev,e,e.next)>0)}function R(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function I(t,e){return t.x===e.x&&t.y===e.y}function O(t,e,r,n){const i=B(R(t,e,r)),s=B(R(t,e,n)),o=B(R(r,n,t)),a=B(R(r,n,e));return i!==s&&o!==a||(!(0!==i||!L(t,r,e))||(!(0!==s||!L(t,n,e))||(!(0!==o||!L(r,t,n))||!(0!==a||!L(r,e,n)))))}function L(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function B(t){return t>0?1:t<0?-1:0}function D(t,e){return R(t.prev,t,t.next)<0?R(t,e,t.next)>=0&&R(t,t.prev,e)>=0:R(t,e,t.prev)<0||R(t,t.next,e)<0}function F(t,e){const r=z(t.i,t.x,t.y),n=z(e.i,e.x,e.y),i=t.next,s=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,s.next=n,n.prev=s,n}function G(t,e,r,n){const i=z(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function j(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function z(t,e,r){return{i:t,x:e,y:r,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function N(t,e,r,n){let i=0;for(let s=e,o=r-n;s<r;s+=n)i+=(t[o]-t[s])*(t[s+1]+t[o+1]),o=s;return i}r(8875);const W=y.default||y;function U(t,e,r,n,i,s,o){const a=W(t,e,2);if(!a)return;for(let t=0;t<a.length;t+=3)s[o++]=a[t]+i,s[o++]=a[t+1]+i,s[o++]=a[t+2]+i;let h=i*n;for(let e=0;e<t.length;e+=2)r[h]=t[e],r[h+1]=t[e+1],h+=n}const X=[],Y={extension:{type:n.Ag.ShapeBuilder,name:"polygon"},build(t,e){for(let r=0;r<t.points.length;r++)e[r]=t.points[r];return!0},triangulate(t,e,r,n,i,s){U(t,X,e,r,n,i,s)}},V={extension:{type:n.Ag.ShapeBuilder,name:"rectangle"},build(t,e){const r=t,n=r.x,i=r.y,s=r.width,o=r.height;return s>0&&o>0&&(e[0]=n,e[1]=i,e[2]=n+s,e[3]=i,e[4]=n+s,e[5]=i+o,e[6]=n,e[7]=i+o,!0)},triangulate(t,e,r,n,i,s){let o=0;e[(n*=r)+o]=t[0],e[n+o+1]=t[1],o+=r,e[n+o]=t[2],e[n+o+1]=t[3],o+=r,e[n+o]=t[6],e[n+o+1]=t[7],o+=r,e[n+o]=t[4],e[n+o+1]=t[5],o+=r;const a=n/r;i[s++]=a,i[s++]=a+1,i[s++]=a+2,i[s++]=a+1,i[s++]=a+3,i[s++]=a+2}},H={extension:{type:n.Ag.ShapeBuilder,name:"triangle"},build:(t,e)=>(e[0]=t.x,e[1]=t.y,e[2]=t.x2,e[3]=t.y2,e[4]=t.x3,e[5]=t.y3,!0),triangulate(t,e,r,n,i,s){let o=0;e[(n*=r)+o]=t[0],e[n+o+1]=t[1],o+=r,e[n+o]=t[2],e[n+o+1]=t[3],o+=r,e[n+o]=t[4],e[n+o+1]=t[5];const a=n/r;i[s++]=a,i[s++]=a+1,i[s++]=a+2}};var $=r(2413);const q={};n.XO.handleByMap(n.Ag.ShapeBuilder,q),n.XO.add(V,Y,H,u,c,d);const K=new s.M,Z=new i.u;function Q(t,e){const{geometryData:r,batches:n}=e;n.length=0,r.indices.length=0,r.vertices.length=0,r.uvs.length=0;for(let e=0;e<t.instructions.length;e++){const i=t.instructions[e];if("texture"===i.action)J(i.data,n,r);else if("fill"===i.action||"stroke"===i.action){const t="stroke"===i.action,e=i.data.path.shapePath,s=i.data.style,o=i.data.hole;t&&o&&tt(o.shapePath,s,!0,n,r),o&&(e.shapePrimitives[e.shapePrimitives.length-1].holes=o.shapePath.shapePrimitives),tt(e,s,t,n,r)}}}function J(t,e,r){const n=[],i=q.rectangle,s=K;s.x=t.dx,s.y=t.dy,s.width=t.dw,s.height=t.dh;const a=t.transform;if(!i.build(s,n))return;const{vertices:u,uvs:c,indices:d}=r,f=d.length,p=u.length/2;a&&o(n,a),i.triangulate(n,u,2,p,d,f);const y=t.image,m=y.uvs;c.push(m.x0,m.y0,m.x1,m.y1,m.x3,m.y3,m.x2,m.y2);const g=h.Z.get(l.G);g.indexOffset=f,g.indexSize=d.length-f,g.attributeOffset=p,g.attributeSize=u.length/2-p,g.baseColor=t.style,g.alpha=t.alpha,g.texture=y,g.geometryData=r,e.push(g)}function tt(t,e,r,n,i){const{vertices:s,uvs:u,indices:c}=i;t.shapePrimitives.forEach((({shape:t,transform:d,holes:y})=>{const m=[],g=q[t.type];if(!g.build(t,m))return;const x=c.length,v=s.length/2;let b="triangle-list";if(d&&o(m,d),r){const r=t.closePath??!0,n=e;n.pixelLine?(!function(t,e,r,n){const i=p.B;if(0===t.length)return;const s=t[0],o=t[1],a=t[t.length-2],h=t[t.length-1],l=e||Math.abs(s-a)<i&&Math.abs(o-h)<i,u=r,c=t.length/2,d=u.length/2;for(let e=0;e<c;e++)u.push(t[2*e]),u.push(t[2*e+1]);for(let t=0;t<c-1;t++)n.push(d+t,d+t+1);l&&n.push(d+c-1,d)}(m,r,s,c),b="line-list"):(0,f.h)(m,n,!1,r,s,c)}else if(y){const t=[],e=m.slice();(function(t){const e=[];for(let r=0;r<t.length;r++){const n=t[r].shape,i=[];q[n.type].build(n,i)&&e.push(i)}return e})(y).forEach((r=>{t.push(e.length/2),e.push(...r)})),U(e,t,s,2,v,c,x)}else g.triangulate(m,s,2,v,c,x);const _=u.length/2,w=e.texture;if(w!==a.g.WHITE){const r=(0,$.Y)(Z,e,t,d);!function(t,e,r,n,i,s,o,a=null){let h=0;r*=e,i*=s;const l=a.a,u=a.b,c=a.c,d=a.d,f=a.tx,p=a.ty;for(;h<o;){const o=t[r],a=t[r+1];n[i]=l*o+c*a+f,n[i+1]=u*o+d*a+p,i+=s,r+=e,h++}}(s,2,v,u,_,2,s.length/2-v,r)}else!function(t,e,r,n){let i=0;for(e*=r;i<n;)t[e]=0,t[e+1]=0,e+=r,i++}(u,_,2,s.length/2-v);const S=h.Z.get(l.G);S.indexOffset=x,S.indexSize=c.length-x,S.attributeOffset=v,S.attributeSize=s.length/2-v,S.baseColor=e.color,S.alpha=e.alpha,S.texture=w,S.geometryData=i,S.topology=b,n.push(S)}))}},990:(t,e,r)=>{r.d(e,{T:()=>d,w:()=>c});var n=r(2577),i=r(5589),s=r(7276),o=r(2806);function a(t){return t instanceof o.m}function h(t){return t instanceof s._}function l(t,e,r){return t.fill=e,t.color=16777215,t.texture=e.texture,t.matrix=e.transform,{...r,...t}}function u(t,e,r){return e.buildGradient(),t.fill=e,t.color=16777215,t.texture=e.texture,t.matrix=e.transform,t.textureSpace=e.textureSpace,{...r,...t}}function c(t,e){if(null==t)return null;const r={},s=t;return function(t){return n.Q.isColorLike(t)}(t)?function(t,e,r){const s=n.Q.shared.setValue(e??0);return t.color=s.toNumber(),t.alpha=1===s.alpha?r.alpha:s.alpha,t.texture=i.g.WHITE,{...r,...t}}(r,t,e):function(t){return t instanceof i.g}(t)?function(t,e,r){return t.texture=e,{...r,...t}}(r,t,e):a(t)?l(r,t,e):h(t)?u(r,t,e):s.fill&&a(s.fill)?l(s,s.fill,e):s.fill&&h(s.fill)?u(s,s.fill,e):function(t,e){const r={...e,...t},i=n.Q.shared.setValue(r.color);return r.alpha*=i.alpha,r.color=i.toNumber(),r}(s,e)}function d(t,e){const{width:r,alignment:n,miterLimit:i,cap:s,join:o,pixelLine:a,...h}=e,l=c(t,h);return l?{width:r,alignment:n,miterLimit:i,cap:s,join:o,pixelLine:a,...l}:null}},2413:(t,e,r)=>{r.d(e,{Y:()=>h});var n=r(9313),i=r(9252),s=r(7276);const o=new n.u,a=new i.M;function h(t,e,r,n){const i=e.matrix?t.copyFrom(e.matrix).invert():t.identity();if("local"===e.textureSpace){const t=r.getBounds(a);e.width&&t.pad(e.width);const{x:n,y:s}=t,o=1/t.width,h=1/t.height,l=-n*o,u=-s*h,c=i.a,d=i.b,f=i.c,p=i.d;i.a*=o,i.b*=o,i.c*=h,i.d*=h,i.tx=l*c+u*f+i.tx,i.ty=l*d+u*p+i.ty}else i.translate(e.texture.frame.x,e.texture.frame.y),i.scale(1/e.texture.source.width,1/e.texture.source.height);const h=e.texture.source.style;return e.fill instanceof s._||"clamp-to-edge"!==h.addressMode||(h.addressMode="repeat",h.update()),n&&i.append(o.copyFrom(n).invert()),i}},8422:(t,e,r)=>{r.d(e,{K:()=>n});class n{constructor(){this.batcherName="default",this.topology="triangle-list",this.attributeSize=4,this.indexSize=6,this.packAsQuad=!0,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()}}},6844:(t,e,r)=>{r.d(e,{k:()=>h});var n=r(2812),i=r(5589),s=r(2048),o=r(4670),a=r(4985);class h extends a.l{constructor(t=i.g.EMPTY){t instanceof i.g&&(t={texture:t});const{texture:e=i.g.EMPTY,anchor:r,roundPixels:s,width:o,height:a,...h}=t;super({label:"Sprite",...h}),this.renderPipeId="sprite",this.batched=!0,this._visualBounds={minX:0,maxX:1,minY:0,maxY:0},this._anchor=new n.o({_onUpdate:()=>{this.onViewUpdate()}}),r?this.anchor=r:e.defaultAnchor&&(this.anchor=e.defaultAnchor),this.texture=e,this.allowChildren=!1,this.roundPixels=s??!1,void 0!==o&&(this.width=o),void 0!==a&&(this.height=a)}static from(t,e=!1){return t instanceof i.g?new h(t):new h(i.g.from(t,e))}set texture(t){t||(t=i.g.EMPTY);const e=this._texture;e!==t&&(e&&e.dynamic&&e.off("update",this.onViewUpdate,this),t.dynamic&&t.on("update",this.onViewUpdate,this),this._texture=t,this._width&&this._setWidth(this._width,this._texture.orig.width),this._height&&this._setHeight(this._height,this._texture.orig.height),this.onViewUpdate())}get texture(){return this._texture}get visualBounds(){return(0,s.y)(this._visualBounds,this._anchor,this._texture),this._visualBounds}get sourceBounds(){return(0,o.t6)("8.6.1","Sprite.sourceBounds is deprecated, use visualBounds instead."),this.visualBounds}updateBounds(){const t=this._anchor,e=this._texture,r=this._bounds,{width:n,height:i}=e.orig;r.minX=-t._x*n,r.maxX=r.minX+n,r.minY=-t._y*i,r.maxY=r.minY+i}destroy(t=!1){super.destroy(t);if("boolean"==typeof t?t:t?.texture){const e="boolean"==typeof t?t:t?.textureSource;this._texture.destroy(e)}this._texture=null,this._visualBounds=null,this._bounds=null,this._anchor=null}get anchor(){return this._anchor}set anchor(t){"number"==typeof t?this._anchor.set(t):this._anchor.copyFrom(t)}get width(){return Math.abs(this.scale.x)*this._texture.orig.width}set width(t){this._setWidth(t,this._texture.orig.width),this._width=t}get height(){return Math.abs(this.scale.y)*this._texture.orig.height}set height(t){this._setHeight(t,this._texture.orig.height),this._height=t}getSize(t){return t||(t={}),t.width=Math.abs(this.scale.x)*this._texture.orig.width,t.height=Math.abs(this.scale.y)*this._texture.orig.height,t}setSize(t,e){"object"==typeof t?(e=t.height??t.width,t=t.width):e??(e=t),void 0!==t&&this._setWidth(t,this._texture.orig.width),void 0!==e&&this._setHeight(e,this._texture.orig.height)}}},4985:(t,e,r)=>{r.d(e,{l:()=>s});var n=r(9636),i=r(5559);class s extends i.mc{constructor(t){super(t),this.canBundle=!0,this.allowChildren=!1,this._roundPixels=0,this._lastUsed=-1,this._gpuData=Object.create(null),this.autoGarbageCollect=!0,this._gcLastUsed=-1,this._bounds=new n.c(0,1,0,0),this._boundsDirty=!0,this.autoGarbageCollect=t.autoGarbageCollect??!0}get bounds(){return this._boundsDirty?(this.updateBounds(),this._boundsDirty=!1,this._bounds):this._bounds}get roundPixels(){return!!this._roundPixels}set roundPixels(t){this._roundPixels=t?1:0}containsPoint(t){const e=this.bounds,{x:r,y:n}=t;return r>=e.minX&&r<=e.maxX&&n>=e.minY&&n<=e.maxY}onViewUpdate(){if(this._didViewChangeTick++,this._boundsDirty=!0,this.didViewUpdate)return;this.didViewUpdate=!0;const t=this.renderGroup||this.parentRenderGroup;t&&t.onChildViewUpdate(this)}unload(){this.emit("unload",this);for(const t in this._gpuData)this._gpuData[t]?.destroy();this._gpuData=Object.create(null),this.onViewUpdate()}destroy(t){this.unload(),super.destroy(t),this._bounds=null}collectRenderablesSimple(t,e,r){const{renderPipes:n}=e;n.blendMode.pushBlendMode(this,this.groupBlendMode,t);const i=n[this.renderPipeId];i?.addRenderable&&i.addRenderable(this,t),this.didViewUpdate=!1;const s=this.children,o=s.length;for(let n=0;n<o;n++)s[n].collectRenderables(t,e,r);n.blendMode.popBlendMode(t)}}},6312:(t,e,r)=>{var n=r(8507),i=(t=>(t[t.Low=0]="Low",t[t.Normal=1]="Normal",t[t.High=2]="High",t))(i||{}),s=r(268),o=r(1761);function a(t){if("string"!=typeof t)throw new TypeError(`Path must be a string. Received ${JSON.stringify(t)}`)}function h(t){return t.split("?")[0].split("#")[0]}const l={toPosix(t){return e="\\",r="/",t.replace(new RegExp(e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),r);var e,r},isUrl(t){return/^https?:/.test(this.toPosix(t))},isDataUrl:t=>/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(t),isBlobUrl:t=>t.startsWith("blob:"),hasProtocol(t){return/^[^/:]+:/.test(this.toPosix(t))},getProtocol(t){a(t),t=this.toPosix(t);const e=/^file:\/\/\//.exec(t);if(e)return e[0];const r=/^[^/:]+:\/{0,2}/.exec(t);return r?r[0]:""},toAbsolute(t,e,r){if(a(t),this.isDataUrl(t)||this.isBlobUrl(t))return t;const n=h(this.toPosix(e??o.e.get().getBaseUrl())),i=h(this.toPosix(r??this.rootname(n)));if((t=this.toPosix(t)).startsWith("/"))return l.join(i,t.slice(1));return this.isAbsolute(t)?t:this.join(n,t)},normalize(t){if(a(t),0===t.length)return".";if(this.isDataUrl(t)||this.isBlobUrl(t))return t;let e="";const r=(t=this.toPosix(t)).startsWith("/");this.hasProtocol(t)&&(e=this.rootname(t),t=t.slice(e.length));const n=t.endsWith("/");return(t=function(t,e){let r="",n=0,i=-1,s=0,o=-1;for(let a=0;a<=t.length;++a){if(a<t.length)o=t.charCodeAt(a);else{if(47===o)break;o=47}if(47===o){if(i===a-1||1===s);else if(i!==a-1&&2===s){if(r.length<2||2!==n||46!==r.charCodeAt(r.length-1)||46!==r.charCodeAt(r.length-2))if(r.length>2){const t=r.lastIndexOf("/");if(t!==r.length-1){-1===t?(r="",n=0):(r=r.slice(0,t),n=r.length-1-r.lastIndexOf("/")),i=a,s=0;continue}}else if(2===r.length||1===r.length){r="",n=0,i=a,s=0;continue}e&&(r.length>0?r+="/..":r="..",n=2)}else r.length>0?r+=`/${t.slice(i+1,a)}`:r=t.slice(i+1,a),n=a-i-1;i=a,s=0}else 46===o&&-1!==s?++s:s=-1}return r}(t,!1)).length>0&&n&&(t+="/"),r?`/${t}`:e+t},isAbsolute(t){return a(t),t=this.toPosix(t),!!this.hasProtocol(t)||t.startsWith("/")},join(...t){if(0===t.length)return".";let e;for(let r=0;r<t.length;++r){const n=t[r];if(a(n),n.length>0)if(void 0===e)e=n;else{const i=t[r-1]??"";this.joinExtensions.includes(this.extname(i).toLowerCase())?e+=`/../${n}`:e+=`/${n}`}}return void 0===e?".":this.normalize(e)},dirname(t){if(a(t),0===t.length)return".";let e=(t=this.toPosix(t)).charCodeAt(0);const r=47===e;let n=-1,i=!0;const s=this.getProtocol(t),o=t;for(let r=(t=t.slice(s.length)).length-1;r>=1;--r)if(e=t.charCodeAt(r),47===e){if(!i){n=r;break}}else i=!1;return-1===n?r?"/":this.isUrl(o)?s+t:s:r&&1===n?"//":s+t.slice(0,n)},rootname(t){a(t);let e="";if(e=(t=this.toPosix(t)).startsWith("/")?"/":this.getProtocol(t),this.isUrl(t)){const r=t.indexOf("/",e.length);e=-1!==r?t.slice(0,r):t,e.endsWith("/")||(e+="/")}return e},basename(t,e){a(t),e&&a(e),t=h(this.toPosix(t));let r,n=0,i=-1,s=!0;if(void 0!==e&&e.length>0&&e.length<=t.length){if(e.length===t.length&&e===t)return"";let o=e.length-1,a=-1;for(r=t.length-1;r>=0;--r){const h=t.charCodeAt(r);if(47===h){if(!s){n=r+1;break}}else-1===a&&(s=!1,a=r+1),o>=0&&(h===e.charCodeAt(o)?-1==--o&&(i=r):(o=-1,i=a))}return n===i?i=a:-1===i&&(i=t.length),t.slice(n,i)}for(r=t.length-1;r>=0;--r)if(47===t.charCodeAt(r)){if(!s){n=r+1;break}}else-1===i&&(s=!1,i=r+1);return-1===i?"":t.slice(n,i)},extname(t){a(t);let e=-1,r=0,n=-1,i=!0,s=0;for(let o=(t=h(this.toPosix(t))).length-1;o>=0;--o){const a=t.charCodeAt(o);if(47!==a)-1===n&&(i=!1,n=o+1),46===a?-1===e?e=o:1!==s&&(s=1):-1!==e&&(s=-1);else if(!i){r=o+1;break}}return-1===e||-1===n||0===s||1===s&&e===n-1&&e===r+1?"":t.slice(e,n)},parse(t){a(t);const e={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return e;let r=(t=h(this.toPosix(t))).charCodeAt(0);const n=this.isAbsolute(t);let i;e.root=this.rootname(t),i=n||this.hasProtocol(t)?1:0;let s=-1,o=0,l=-1,u=!0,c=t.length-1,d=0;for(;c>=i;--c)if(r=t.charCodeAt(c),47!==r)-1===l&&(u=!1,l=c+1),46===r?-1===s?s=c:1!==d&&(d=1):-1!==s&&(d=-1);else if(!u){o=c+1;break}return-1===s||-1===l||0===d||1===d&&s===l-1&&s===o+1?-1!==l&&(e.base=e.name=0===o&&n?t.slice(1,l):t.slice(o,l)):(0===o&&n?(e.name=t.slice(1,s),e.base=t.slice(1,l)):(e.name=t.slice(o,s),e.base=t.slice(o,l)),e.ext=t.slice(s,l)),e.dir=this.dirname(t),e},sep:"/",delimiter:":",joinExtensions:[".html"]};var u=r(2406);function c(t,e,r,n,i){const s=e[r];for(let o=0;o<s.length;o++){const a=s[o];r<e.length-1?c(t.replace(n[r],a),e,r+1,n,i):i.push(t.replace(n[r],a))}}function d(t){const e=t.match(/\{(.*?)\}/g),r=[];if(e){const n=[];e.forEach((t=>{const e=t.substring(1,t.length-1).split(",");n.push(e)})),c(t,n,0,e,r)}else r.push(t);return r}const f=t=>!Array.isArray(t);class p{constructor(){this._defaultBundleIdentifierOptions={connector:"-",createBundleAssetId:(t,e)=>`${t}${this._bundleIdConnector}${e}`,extractAssetIdFromBundle:(t,e)=>e.replace(`${t}${this._bundleIdConnector}`,"")},this._bundleIdConnector=this._defaultBundleIdentifierOptions.connector,this._createBundleAssetId=this._defaultBundleIdentifierOptions.createBundleAssetId,this._extractAssetIdFromBundle=this._defaultBundleIdentifierOptions.extractAssetIdFromBundle,this._assetMap={},this._preferredOrder=[],this._parsers=[],this._resolverHash={},this._bundles={}}setBundleIdentifier(t){if(this._bundleIdConnector=t.connector??this._bundleIdConnector,this._createBundleAssetId=t.createBundleAssetId??this._createBundleAssetId,this._extractAssetIdFromBundle=t.extractAssetIdFromBundle??this._extractAssetIdFromBundle,"bar"!==this._extractAssetIdFromBundle("foo",this._createBundleAssetId("foo","bar")))throw new Error("[Resolver] GenerateBundleAssetId are not working correctly")}prefer(...t){t.forEach((t=>{this._preferredOrder.push(t),t.priority||(t.priority=Object.keys(t.params))})),this._resolverHash={}}set basePath(t){this._basePath=t}get basePath(){return this._basePath}set rootPath(t){this._rootPath=t}get rootPath(){return this._rootPath}get parsers(){return this._parsers}reset(){this.setBundleIdentifier(this._defaultBundleIdentifierOptions),this._assetMap={},this._preferredOrder=[],this._resolverHash={},this._rootPath=null,this._basePath=null,this._manifest=null,this._bundles={},this._defaultSearchParams=null}setDefaultSearchParams(t){if("string"==typeof t)this._defaultSearchParams=t;else{const e=t;this._defaultSearchParams=Object.keys(e).map((t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`)).join("&")}}getAlias(t){const{alias:e,src:r}=t;return(0,u.z)(e||r,(t=>"string"==typeof t?t:Array.isArray(t)?t.map((t=>t?.src??t)):t?.src?t.src:t),!0)}removeAlias(t,e){this._assetMap[t]&&(e&&e!==this._resolverHash[t]||(delete this._resolverHash[t],delete this._assetMap[t]))}addManifest(t){this._manifest&&(0,s.R)("[Resolver] Manifest already exists, this will be overwritten"),this._manifest=t,t.bundles.forEach((t=>{this.addBundle(t.name,t.assets)}))}addBundle(t,e){const r=[];let n=e;Array.isArray(e)||(n=Object.entries(e).map((([t,e])=>"string"==typeof e||Array.isArray(e)?{alias:t,src:e}:{alias:t,...e}))),n.forEach((e=>{const n=e.src,i=e.alias;let s;if("string"==typeof i){const e=this._createBundleAssetId(t,i);r.push(e),s=[i,e]}else{const e=i.map((e=>this._createBundleAssetId(t,e)));r.push(...e),s=[...i,...e]}this.add({...e,alias:s,src:n})})),this._bundles[t]=r}add(t){const e=[];let r;Array.isArray(t)?e.push(...t):e.push(t),r=t=>{this.hasKey(t)&&(0,s.R)(`[Resolver] already has key: ${t} overwriting`)};(0,u.z)(e).forEach((t=>{const{src:e}=t;let{data:n,format:i,loadParser:s,parser:o}=t;const a=(0,u.z)(e).map((t=>"string"==typeof t?d(t):Array.isArray(t)?t:[t])),h=this.getAlias(t);Array.isArray(h)?h.forEach(r):r(h);const l=[],c=t=>{const e=this._parsers.find((e=>e.test(t)));return{src:t,...e?.parse(t)}};a.forEach((e=>{e.forEach((e=>{let r={};if("object"!=typeof e?r=c(e):(n=e.data??n,i=e.format??i,(e.loadParser||e.parser)&&(s=e.loadParser??s,o=e.parser??o),r={...c(e.src),...e}),!h)throw new Error(`[Resolver] alias is undefined for this asset: ${r.src}`);r=this._buildResolvedAsset(r,{aliases:h,data:n,format:i,loadParser:s,parser:o,progressSize:t.progressSize}),l.push(r)}))})),h.forEach((t=>{this._assetMap[t]=l}))}))}resolveBundle(t){const e=f(t);t=(0,u.z)(t);const r={};return t.forEach((t=>{const e=this._bundles[t];if(e){const n=this.resolve(e),i={};for(const e in n){const r=n[e];i[this._extractAssetIdFromBundle(t,e)]=r}r[t]=i}})),e?r[t[0]]:r}resolveUrl(t){const e=this.resolve(t);if("string"!=typeof t){const t={};for(const r in e)t[r]=e[r].src;return t}return e.src}resolve(t){const e=f(t);t=(0,u.z)(t);const r={};return t.forEach((t=>{if(!this._resolverHash[t])if(this._assetMap[t]){let e=this._assetMap[t];const r=this._getPreferredOrder(e);r?.priority.forEach((t=>{r.params[t].forEach((r=>{const n=e.filter((e=>!!e[t]&&e[t]===r));n.length&&(e=n)}))})),this._resolverHash[t]=e[0]}else this._resolverHash[t]=this._buildResolvedAsset({alias:[t],src:t},{});r[t]=this._resolverHash[t]})),e?r[t[0]]:r}hasKey(t){return!!this._assetMap[t]}hasBundle(t){return!!this._bundles[t]}_getPreferredOrder(t){for(let e=0;e<t.length;e++){const r=t[e],n=this._preferredOrder.find((t=>t.params.format.includes(r.format)));if(n)return n}return this._preferredOrder[0]}_appendDefaultSearchParams(t){if(!this._defaultSearchParams)return t;return`${t}${/\?/.test(t)?"&":"?"}${this._defaultSearchParams}`}_buildResolvedAsset(t,e){const{aliases:r,data:n,loadParser:i,parser:s,format:o,progressSize:a}=e;return(this._basePath||this._rootPath)&&(t.src=l.toAbsolute(t.src,this._basePath,this._rootPath)),t.alias=r??t.alias??[t.src],t.src=this._appendDefaultSearchParams(t.src),t.data={...n||{},...t.data},t.loadParser=i??t.loadParser,t.parser=s??t.parser,t.format=o??t.format??t.src.split(".").pop().split("?").shift().split("#").shift(),void 0!==a&&(t.progressSize=a),t}}p.RETINA_PREFIX=/@([0-9\.]+)x/;const y=(t,e)=>{const r=e.split("?")[1];return r&&(t+=`?${r}`),t};var m=r(5589),g=r(9252),x=r(583);const v=class t{constructor(t,e){this.linkedSheets=[];let r=t;t?.source instanceof x.v&&(r={texture:t,data:e});const{texture:n,data:i,cachePrefix:s=""}=r;this.cachePrefix=s,this._texture=n instanceof m.g?n:null,this.textureSource=n.source,this.textures={},this.animations={},this.data=i;const o=parseFloat(i.meta.scale);o?(this.resolution=o,n.source.resolution=this.resolution):this.resolution=n.source._resolution,this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}parse(){return new Promise((e=>{this._callback=e,this._batchIndex=0,this._frameKeys.length<=t.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()}))}parseSync(){return this._processFrames(0,!0),this._processAnimations(),this.textures}_processFrames(e,r=!1){let n=e;const i=r?1/0:t.BATCH_SIZE;for(;n-e<i&&n<this._frameKeys.length;){const t=this._frameKeys[n],e=this._frames[t],r=e.frame;if(r){let n=null,i=null;const s=!1!==e.trimmed&&e.sourceSize?e.sourceSize:e.frame,o=new g.M(0,0,Math.floor(s.w)/this.resolution,Math.floor(s.h)/this.resolution);n=e.rotated?new g.M(Math.floor(r.x)/this.resolution,Math.floor(r.y)/this.resolution,Math.floor(r.h)/this.resolution,Math.floor(r.w)/this.resolution):new g.M(Math.floor(r.x)/this.resolution,Math.floor(r.y)/this.resolution,Math.floor(r.w)/this.resolution,Math.floor(r.h)/this.resolution),!1!==e.trimmed&&e.spriteSourceSize&&(i=new g.M(Math.floor(e.spriteSourceSize.x)/this.resolution,Math.floor(e.spriteSourceSize.y)/this.resolution,Math.floor(r.w)/this.resolution,Math.floor(r.h)/this.resolution)),this.textures[t]=new m.g({source:this.textureSource,frame:n,orig:o,trim:i,rotate:e.rotated?2:0,defaultAnchor:e.anchor,defaultBorders:e.borders,label:t.toString()})}n++}}_processAnimations(){const t=this.data.animations||{};for(const e in t){this.animations[e]=[];for(let r=0;r<t[e].length;r++){const n=t[e][r];this.animations[e].push(this.textures[n])}}}_parseComplete(){const t=this._callback;this._callback=null,this._batchIndex=0,t.call(this,this.textures)}_nextBatch(){this._processFrames(this._batchIndex*t.BATCH_SIZE),this._batchIndex++,setTimeout((()=>{this._batchIndex*t.BATCH_SIZE<this._frameKeys.length?this._nextBatch():(this._processAnimations(),this._parseComplete())}),0)}destroy(t=!1){for(const t in this.textures)this.textures[t].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,t&&(this._texture?.destroy(),this.textureSource.destroy()),this._texture=null,this.textureSource=null,this.linkedSheets=[]}};v.BATCH_SIZE=1e3;let b=v;const _=["jpg","png","jpeg","avif","webp","basis","etc2","bc7","bc6h","bc5","bc4","bc3","bc2","bc1","eac","astc"];function w(t,e,r){const n={};if(t.forEach((t=>{n[t]=e})),Object.keys(e.textures).forEach((t=>{n[`${e.cachePrefix}${t}`]=e.textures[t]})),!r){const r=l.dirname(t[0]);e.linkedSheets.forEach(((t,i)=>{const s=w([`${r}/${e.data.meta.related_multi_packs[i]}`],t,!0);Object.assign(n,s)}))}return n}const S={extension:n.Ag.Asset,cache:{test:t=>t instanceof b,getCacheableAssets:(t,e)=>w(t,e,!1)},resolver:{extension:{type:n.Ag.ResolveParser,name:"resolveSpritesheet"},test:t=>{const e=t.split("?")[0].split("."),r=e.pop(),n=e.pop();return"json"===r&&_.includes(n)},parse:t=>{const e=t.split(".");return{resolution:parseFloat(p.RETINA_PREFIX.exec(t)?.[1]??"1"),format:e[e.length-2],src:t}}},loader:{name:"spritesheetLoader",id:"spritesheet",extension:{type:n.Ag.LoadParser,priority:i.Normal,name:"spritesheetLoader"},testParse:async(t,e)=>".json"===l.extname(e.src).toLowerCase()&&!!t.frames,async parse(t,e,r){const{texture:n,imageFilename:i,textureOptions:s,cachePrefix:o}=e?.data??{};let a,h=l.dirname(e.src);if(h&&h.lastIndexOf("/")!==h.length-1&&(h+="/"),n instanceof m.g)a=n;else{const n=y(h+(i??t.meta.image),e.src);a=(await r.load([{src:n,data:s}]))[n]}const u=new b({texture:a.source,data:t,cachePrefix:o});await u.parse();const c=t?.meta?.related_multi_packs;if(Array.isArray(c)){const t=[];for(const n of c){if("string"!=typeof n)continue;let i=h+n;e.data?.ignoreMultiPack||(i=y(i,e.src),t.push(r.load({src:i,data:{textureOptions:s,ignoreMultiPack:!0}})))}const n=await Promise.all(t);u.linkedSheets=n,n.forEach((t=>{t.linkedSheets=[u].concat(u.linkedSheets.filter((e=>e!==t)))}))}return u},async unload(t,e,r){await r.unload(t.textureSource._sourceOrigin),t.destroy(!1)}}};n.XO.add(S)},7309:(t,e,r)=>{r.d(e,{R:()=>o});var n=r(4458);class i{constructor(t,e=null,r=0,n=!1){this.next=null,this.previous=null,this._destroyed=!1,this._fn=t,this._context=e,this.priority=r,this._once=n}match(t,e=null){return this._fn===t&&this._context===e}emit(t){this._fn&&(this._context?this._fn.call(this._context,t):this._fn(t));const e=this.next;return this._once&&this.destroy(!0),this._destroyed&&(this.next=null),e}connect(t){this.previous=t,t.next&&(t.next.previous=this),this.next=t.next,t.next=this}destroy(t=!1){this._destroyed=!0,this._fn=null,this._context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);const e=this.next;return this.next=t?null:e,this.previous=null,e}}const s=class t{constructor(){this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new i(null,null,1/0),this.deltaMS=1/t.targetFPMS,this.elapsedMS=1/t.targetFPMS,this._tick=t=>{this._requestId=null,this.started&&(this.update(t),this.started&&null===this._requestId&&this._head.next&&(this._requestId=requestAnimationFrame(this._tick)))}}_requestIfNeeded(){null===this._requestId&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))}_cancelIfNeeded(){null!==this._requestId&&(cancelAnimationFrame(this._requestId),this._requestId=null)}_startIfPossible(){this.started?this._requestIfNeeded():this.autoStart&&this.start()}add(t,e,r=n.d.NORMAL){return this._addListener(new i(t,e,r))}addOnce(t,e,r=n.d.NORMAL){return this._addListener(new i(t,e,r,!0))}_addListener(t){let e=this._head.next,r=this._head;if(e){for(;e;){if(t.priority>e.priority){t.connect(r);break}r=e,e=e.next}t.previous||t.connect(r)}else t.connect(r);return this._startIfPossible(),this}remove(t,e){let r=this._head.next;for(;r;)r=r.match(t,e)?r.destroy():r.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let t=0,e=this._head;for(;e=e.next;)t++;return t}start(){this.started||(this.started=!0,this._requestIfNeeded())}stop(){this.started&&(this.started=!1,this._cancelIfNeeded())}destroy(){if(!this._protected){this.stop();let t=this._head.next;for(;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}}update(e=performance.now()){let r;if(e>this.lastTime){if(r=this.elapsedMS=e-this.lastTime,r>this._maxElapsedMS&&(r=this._maxElapsedMS),r*=this.speed,this._minElapsedMS){const t=e-this._lastFrame|0;if(t<this._minElapsedMS)return;this._lastFrame=e-t%this._minElapsedMS}this.deltaMS=r,this.deltaTime=this.deltaMS*t.targetFPMS;const n=this._head;let i=n.next;for(;i;)i=i.emit(this);n.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){const r=Math.min(Math.max(0,e)/1e3,t.targetFPMS);this._maxElapsedMS=1/r,this._minElapsedMS&&e>this.maxFPS&&(this.maxFPS=e)}get maxFPS(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0}set maxFPS(t){0===t?this._minElapsedMS=0:(t<this.minFPS&&(this.minFPS=t),this._minElapsedMS=1/(t/1e3))}static get shared(){if(!t._shared){const e=t._shared=new t;e.autoStart=!0,e._protected=!0}return t._shared}static get system(){if(!t._system){const e=t._system=new t;e.autoStart=!0,e._protected=!0}return t._system}};s.targetFPMS=.06;let o=s},4458:(t,e,r)=>{r.d(e,{d:()=>n});var n=(t=>(t[t.INTERACTION=50]="INTERACTION",t[t.HIGH=25]="HIGH",t[t.NORMAL=0]="NORMAL",t[t.LOW=-25]="LOW",t[t.UTILITY=-50]="UTILITY",t))(n||{})},4577:(t,e,r)=>{let n;function i(){if("boolean"==typeof n)return n;try{const t=new Function("param1","param2","param3","return param1[param2] === param3;");n=!0===t({a:"b"},"a","b")}catch(t){n=!1}return n}r.d(e,{f:()=>i})},2571:(t,e,r)=>{r.d(e,{xv:()=>n});r(8875);const n="8.17.1"},4334:(t,e,r)=>{r.d(e,{s:()=>n});class n{constructor(t){this.items=Object.create(null);const{renderer:e,type:r,onUnload:n,priority:i,name:s}=t;this._renderer=e,e.gc.addResourceHash(this,"items",r,i??0),this._onUnload=n,this.name=s}add(t){return!this.items[t.uid]&&(this.items[t.uid]=t,t.once("unload",this.remove,this),t._gcLastUsed=this._renderer.gc.now,!0)}remove(t,...e){if(!this.items[t.uid])return;const r=t._gpuData[this._renderer.uid];r&&(this._onUnload?.(t,...e),r.destroy(),t._gpuData[this._renderer.uid]=null,this.items[t.uid]=null)}removeAll(...t){Object.values(this.items).forEach((e=>e&&this.remove(e,...t)))}destroy(...t){this.removeAll(...t),this.items=Object.create(null),this._renderer=null,this._onUnload=null}}},9903:(t,e,r)=>{function n(t,e,r){const n=t.length;let i;if(e>=n||0===r)return;const s=n-(r=e+r>n?n-e:r);for(i=e;i<s;++i)t[i]=t[i+r];t.length=s}r.d(e,{d:()=>n})},133:(t,e,r)=>{r.d(e,{L:()=>i});const n={default:-1};function i(t="default"){return void 0===n[t]&&(n[t]=-1),++n[t]}},2048:(t,e,r)=>{function n(t,e,r){const{width:n,height:i}=r.orig,s=r.trim;if(s){const r=s.width,o=s.height;t.minX=s.x-e._x*n,t.maxX=t.minX+r,t.minY=s.y-e._y*i,t.maxY=t.minY+o}else t.minX=-e._x*n,t.maxX=t.minX+n,t.minY=-e._y*i,t.maxY=t.minY+i}r.d(e,{y:()=>n})},7073:(t,e,r)=>{r.d(e,{M:()=>s,d:()=>o});var n=r(8507),i=r(2571);class s{static init(){globalThis.__PIXI_APP_INIT__?.(this,i.xv)}static destroy(){}}s.extension=n.Ag.Application;class o{constructor(t){this._renderer=t}init(){globalThis.__PIXI_RENDERER_INIT__?.(this._renderer,i.xv)}destroy(){this._renderer=null}}o.extension={type:[n.Ag.WebGLSystem,n.Ag.WebGPUSystem],name:"initHook",priority:-10}},4670:(t,e,r)=>{r.d(e,{Ek:()=>s,lj:()=>i,t6:()=>a});const n=new Set,i="8.0.0",s="8.3.4",o={quiet:!1,noColor:!1},a=(t,e,r=3)=>{if(o.quiet||n.has(e))return;let i=(new Error).stack;const s=`${e}\nDeprecated since v${t}`,a="function"==typeof console.groupCollapsed&&!o.noColor;void 0===i?console.warn("PixiJS Deprecation Warning: ",s):(i=i.split("\n").splice(r).join("\n"),a?(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))),n.add(e)};Object.defineProperties(a,{quiet:{get:()=>o.quiet,set:t=>{o.quiet=t},enumerable:!0,configurable:!1},noColor:{get:()=>o.noColor,set:t=>{o.noColor=t},enumerable:!0,configurable:!1}})},268:(t,e,r)=>{r.d(e,{R:()=>s});let n=0;const i=500;function s(...t){n!==i&&(n++,n===i?console.warn("PixiJS Warning: too many warnings, no more warnings will be reported to the console by PixiJS."):console.warn("PixiJS Warning: ",...t))}},6083:(t,e,r)=>{r.d(e,{L:()=>n});const n={_registeredResources:new Set,register(t){this._registeredResources.add(t)},unregister(t){this._registeredResources.delete(t)},release(){this._registeredResources.forEach((t=>t.clear()))},get registeredCount(){return this._registeredResources.size},isRegistered(t){return this._registeredResources.has(t)},reset(){this._registeredResources.clear()}}},8655:(t,e,r)=>{r.d(e,{Z:()=>s});var n=r(6083);class i{constructor(t,e){this._pool=[],this._count=0,this._index=0,this._classType=t,e&&this.prepopulate(e)}prepopulate(t){for(let e=0;e<t;e++)this._pool[this._index++]=new this._classType;this._count+=t}get(t){let e;return this._index>0?e=this._pool[--this._index]:(e=new this._classType,this._count++),e.init?.(t),e}return(t){t.reset?.(),this._pool[this._index++]=t}get totalSize(){return this._count}get totalFree(){return this._index}get totalUsed(){return this._count-this._index}clear(){if(this._pool.length>0&&this._pool[0].destroy)for(let t=0;t<this._index;t++)this._pool[t].destroy();this._pool.length=0,this._count=0,this._index=0}}const s=new class{constructor(){this._poolsByClass=new Map}prepopulate(t,e){this.getPool(t).prepopulate(e)}get(t,e){return this.getPool(t).get(e)}return(t){this.getPool(t.constructor).return(t)}getPool(t){return this._poolsByClass.has(t)||this._poolsByClass.set(t,new i(t)),this._poolsByClass.get(t)}stats(){const t={};return this._poolsByClass.forEach((e=>{const r=t[e._classType.name]?e._classType.name+e._classType.ID:e._classType.name;t[r]={free:e.totalFree,used:e.totalUsed,size:e.totalSize}})),t}clear(){this._poolsByClass.forEach((t=>t.clear())),this._poolsByClass.clear()}};n.L.register(s)},8875:(t,e,r)=>{r.d(e,{A:()=>n});const n=r(5585)}},n={};function i(t){var e=n[t];if(void 0!==e)return e.exports;var s=n[t]={exports:{}};return r[t](s,s.exports,i),s.exports}i.m=r,i.d=(t,e)=>{for(var r in e)i.o(e,r)&&!i.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},i.f={},i.e=t=>Promise.all(Object.keys(i.f).reduce(((e,r)=>(i.f[r](t,e),e)),[])),i.u=t=>t+".vizor_2d.min.js",i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),t={},e="vizor_2d:",i.l=(r,n,s,o)=>{if(t[r])t[r].push(n);else{var a,h;if(void 0!==s)for(var l=document.getElementsByTagName("script"),u=0;u<l.length;u++){var c=l[u];if(c.getAttribute("src")==r||c.getAttribute("data-webpack")==e+s){a=c;break}}a||(h=!0,(a=document.createElement("script")).type="module",a.charset="utf-8",a.timeout=120,i.nc&&a.setAttribute("nonce",i.nc),a.setAttribute("data-webpack",e+s),a.src=r),t[r]=[n];var d=(e,n)=>{a.onerror=a.onload=null,clearTimeout(f);var i=t[r];if(delete t[r],a.parentNode&&a.parentNode.removeChild(a),i&&i.forEach((t=>t(n))),e)return e(n)},f=setTimeout(d.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=d.bind(null,a.onerror),a.onload=d.bind(null,a.onload),h&&document.head.appendChild(a)}},i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t;if("string"==typeof import.meta.url&&(t=import.meta.url),!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),i.p=t})(),(()=>{var t={792:0};i.f.j=(e,r)=>{var n=i.o(t,e)?t[e]:void 0;if(0!==n)if(n)r.push(n[2]);else{var s=new Promise(((r,i)=>n=t[e]=[r,i]));r.push(n[2]=s);var o=i.p+i.u(e),a=new Error;i.l(o,(r=>{if(i.o(t,e)&&(0!==(n=t[e])&&(t[e]=void 0),n)){var s=r&&("load"===r.type?"missing":r.type),o=r&&r.target&&r.target.src;a.message="Loading chunk "+e+" failed.\n("+s+": "+o+")",a.name="ChunkLoadError",a.type=s,a.request=o,n[1](a)}}),"chunk-"+e,e)}};var e=(e,r)=>{var n,s,[o,a,h]=r,l=0;if(o.some((e=>0!==t[e]))){for(n in a)i.o(a,n)&&(i.m[n]=a[n]);if(h)h(i)}for(e&&e(r);l<o.length;l++)s=o[l],i.o(t,s)&&t[s]&&t[s][0](),t[s]=0},r=self.webpackChunkvizor_2d=self.webpackChunkvizor_2d||[];r.forEach(e.bind(null,0)),r.push=e.bind(null,r.push.bind(r))})();var s={};function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function a(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,h(n.key),n)}}function h(t){var e=function(t,e){if("object"!=o(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==o(e)?e:e+""}i.d(s,{A5:()=>Lr,oY:()=>yr,vY:()=>lr,TI:()=>Er,sV:()=>Tr});var l=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return e=t,n=[{key:"build",value:function(e){if(!e)return function(){return!0};switch(e.op){case"and":var r=e.rules.map((function(e){return t.build(e)}));return function(t){return r.every((function(e){return e(t)}))};case"or":var n=e.rules.map((function(e){return t.build(e)}));return function(t){return n.some((function(e){return e(t)}))};case"not":var i=t.build(e.rule);return function(t){return!i(t)};case"eq":return function(t){var r;return(null===(r=t.data)||void 0===r?void 0:r[e.field])===e.value};case"neq":return function(t){var r;return(null===(r=t.data)||void 0===r?void 0:r[e.field])!==e.value};case"gt":return function(t){var r;return(null===(r=t.data)||void 0===r?void 0:r[e.field])>e.value};case"lt":return function(t){var r;return(null===(r=t.data)||void 0===r?void 0:r[e.field])<e.value};case"gte":return function(t){var r;return(null===(r=t.data)||void 0===r?void 0:r[e.field])>=e.value};case"lte":return function(t){var r;return(null===(r=t.data)||void 0===r?void 0:r[e.field])<=e.value};case"regex":var s=new RegExp(e.value);return function(t){var r,n=null===(r=t.data)||void 0===r?void 0:r[e.field];return s.test(String(null!=n?n:""))};case"in":return function(t){var r;return e.value.includes(null===(r=t.data)||void 0===r?void 0:r[e.field])};case"exists":return function(t){return e.field in(t.data||{})};default:return console.warn("Unknown rule:",e),function(){return!0}}}}],(r=null)&&a(e.prototype,r),n&&a(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n}();function u(t){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u(t)}function c(t){return function(t){if(Array.isArray(t))return p(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||f(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=f(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,o=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return o=t.done,t},e:function(t){a=!0,s=t},f:function(){try{o||null==r.return||r.return()}finally{if(a)throw s}}}}function f(t,e){if(t){if("string"==typeof t)return p(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?p(t,e):void 0}}function p(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function y(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,m(n.key),n)}}function m(t){var e=function(t,e){if("object"!=u(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=u(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==u(e)?e:e+""}var g=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.attractionStrength=.15,this.repulsionStrength=200,this.damping=.98,this.minDist=20,this.planetRadius=60,this.planetRepulsion=2,this.orbitStrength=0,this.collisionPadding=2,this.collisionIterations=2,this.velocityEpsilon=.01,this.energyThreshold=.1,this.cooling=.999,this.minStrength=.001},e=[{key:"setModel",value:function(t){this.model=t}},{key:"resolveMoonCollisions",value:function(t){for(var e=0;e<this.collisionIterations;e++)for(var r=0;r<t.length;r++)for(var n=r+1;n<t.length;n++){var i=t[r],s=t[n],o=i.radius||10,a=s.radius||10,h=s.x-i.x,l=s.y-i.y,u=Math.sqrt(h*h+l*l)||1e-4,c=o+a+this.collisionPadding;if(u<c){var d=h/u,f=l/u,p=.5*(c-u);i.fixed||(i.x-=d*p,i.y-=f*p),s.fixed||(s.x+=d*p,s.y+=f*p)}}}},{key:"step",value:function(){var t,e=this,r=this.model.getNodes(),n=r.filter((function(t){return"moon"===t.type})),i=r.filter((function(t){return"planet"===t.type})),s=d(n);try{for(s.s();!(t=s.n()).done;){var o=t.value;o.vx*=this.damping,o.vy*=this.damping}}catch(t){s.e(t)}finally{s.f()}for(var a=0;a<n.length;a++)for(var h=a+1;h<n.length;h++){var l=n[a],u=n[h],f=l.x-u.x,p=l.y-u.y,y=Math.sqrt(f*f+p*p)||.01;y=Math.max(y,this.minDist);var m=this.repulsionStrength/(y*y),g=f/y*m,x=p/y*m;l.fixed||(l.vx+=g,l.vy+=x),u.fixed||(u.vx-=g,u.vy-=x)}var v,b=d(i);try{var _=function(){var t=v.value,r=n.filter((function(e){return t.rule(e)}));if(0===r.length)return 1;if(t.vector){var i,s={x:t.x,y:t.y},o=t.direction,a=t.length,h=t.scalarField,l=r.map((function(t){return t.data[h]})).filter((function(t){return null!=t})),u=Math.min.apply(Math,c(l)),f=Math.max.apply(Math,c(l)),p=d(r);try{for(p.s();!(i=p.n()).done;){var y=i.value,m=y.data[h];null==m&&(m=u);var g=f>u?(m-u)/(f-u):.5;y.x=s.x+o.x*a*g,y.y=s.y+o.y*a*g}}catch(t){p.e(t)}finally{p.f()}}else{var x,b=d(r);try{for(b.s();!(x=b.n()).done;){var _=x.value,w=t.x-_.x,S=t.y-_.y,C=Math.sqrt(w*w+S*S)||.01;C=Math.max(C,e.minDist);var M=100,T=w/C,A=S/C,k=e.attractionStrength*(C-M)*.5+.05*C;_.fixed||(_.vx+=T*k,_.vy+=A*k,_.vx+=.5*T,_.vy+=.5*A);var P=.85+.15*Math.min(1,C/M);_.vx*=P,_.vy*=P,_.vx*T+_.vy*A<0&&(_.vx*=.7,_.vy*=.7),C<3&&(_.x=t.x+T*M,_.y=t.y+A*M,_.vx=0,_.vy=0),C<102&&Math.abs(_.vx)<.05&&Math.abs(_.vy)<.05&&(_.vx=0,_.vy=0),0!==e.orbitStrength&&(_.vx+=-S/C*e.orbitStrength,_.vy+=w/C*e.orbitStrength)}}catch(t){b.e(t)}finally{b.f()}}};for(b.s();!(v=b.n()).done;)_()}catch(t){b.e(t)}finally{b.f()}var w,S=d(i);try{for(S.s();!(w=S.n()).done;){var C,M=w.value,T=d(n);try{for(T.s();!(C=T.n()).done;){var A=C.value,k=A.x-M.x,P=A.y-M.y,E=Math.sqrt(k*k+P*P)||.01;if(E<this.planetRadius){var R=this.planetRadius-E,I=k/E*R*this.planetRepulsion,O=P/E*R*this.planetRepulsion;A.fixed||(A.vx+=I,A.vy+=O)}}}catch(t){T.e(t)}finally{T.f()}}}catch(t){S.e(t)}finally{S.f()}var L,B=this.bounds||{minX:-1/0,maxX:1/0,minY:-1/0,maxY:1/0},D=0,F=d(n);try{for(F.s();!(L=F.n()).done;){var G=L.value;G.fixed||(G.x+=G.vx,G.y+=G.vy,G.x=Math.max(B.minX,Math.min(B.maxX,G.x)),G.y=Math.max(B.minY,Math.min(B.maxY,G.y)),G.vx*=.9,G.vy*=.9,Math.abs(G.vx)<this.velocityEpsilon&&(G.vx=0),Math.abs(G.vy)<this.velocityEpsilon&&(G.vy=0),D+=Math.abs(G.vx)+Math.abs(G.vy))}}catch(t){F.e(t)}finally{F.f()}if(this.resolveMoonCollisions(n),D<this.energyThreshold){var j,z=d(n);try{for(z.s();!(j=z.n()).done;){var N=j.value;N.vx=0,N.vy=0}}catch(t){z.e(t)}finally{z.f()}}D<5&&(this.attractionStrength=Math.max(this.minStrength,.95*this.attractionStrength),this.repulsionStrength=Math.max(this.minStrength,.95*this.repulsionStrength))}}],e&&y(t.prototype,e),r&&y(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function x(t){return x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},x(t)}function v(t){return function(t){if(Array.isArray(t))return w(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||_(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=_(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,o=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return o=t.done,t},e:function(t){a=!0,s=t},f:function(){try{o||null==r.return||r.return()}finally{if(a)throw s}}}}function _(t,e){if(t){if("string"==typeof t)return w(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?w(t,e):void 0}}function w(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function S(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,C(n.key),n)}}function C(t){var e=function(t,e){if("object"!=x(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=x(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==x(e)?e:e+""}var M=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.attractionStrength=.05,this.repulsionStrength=200,this.damping=.9,this.minDist=20,this.minDistSq=this.minDist*this.minDist,this.planetRadius=60,this.planetRepulsion=2,this.orbitStrength=0,this.cellSize=80,this.maxNeighbors=15},e=[{key:"setModel",value:function(t){this.model=t}},{key:"_buildGrid",value:function(t){var e,r=new Map,n=b(t);try{for(n.s();!(e=n.n()).done;){var i=e.value,s=Math.floor(i.x/this.cellSize),o=Math.floor(i.y/this.cellSize),a=s+","+o;r.has(a)||r.set(a,[]),r.get(a).push(i),i._cellX=s,i._cellY=o}}catch(t){n.e(t)}finally{n.f()}return r}},{key:"_getNeighbors",value:function(t,e){for(var r=[],n=-1;n<=1;n++)for(var i=-1;i<=1;i++){var s=e._cellX+n+","+(e._cellY+i),o=t.get(s);if(o){var a,h=b(o);try{for(h.s();!(a=h.n()).done;){var l=a.value;if(l!==e&&(r.push(l),r.length>=this.maxNeighbors))return r}}catch(t){h.e(t)}finally{h.f()}}}return r}},{key:"step",value:function(){var t=this,e=this.model.getNodes(),r=e.filter((function(t){return"moon"===t.type})),n=e.filter((function(t){return"planet"===t.type})),i=this.bounds;if(i){var s,o=b(r);try{for(o.s();!(s=o.n()).done;){var a=s.value;a.vx*=this.damping,a.vy*=this.damping}}catch(t){o.e(t)}finally{o.f()}var h,l=this._buildGrid(r),u=b(r);try{for(u.s();!(h=u.n()).done;){var c,d=h.value,f=b(this._getNeighbors(l,d));try{for(f.s();!(c=f.n()).done;){var p=c.value,y=d.x-p.x,m=d.y-p.y,g=y*y+m*m;g<this.minDistSq&&(g=this.minDistSq);var x=this.repulsionStrength/g,_=Math.sqrt(g),w=y/_*x,S=m/_*x;d.fixed||(d.vx+=w,d.vy+=S)}}catch(t){f.e(t)}finally{f.f()}}}catch(t){u.e(t)}finally{u.f()}var C,M=b(n);try{var T=function(){var e=C.value,n=r.filter((function(t){return e.rule(t)}));if(0===n.length)return 1;if(e.vector){var i,s={x:e.x,y:e.y},o=e.direction,a=e.length,h=e.scalarField,l=n.map((function(t){return t.data[h]})).filter((function(t){return null!=t})),u=Math.min.apply(Math,v(l)),c=Math.max.apply(Math,v(l)),d=b(n);try{for(d.s();!(i=d.n()).done;){var f=i.value,p=f.data[h];null==p&&(p=u);var y=c>u?(p-u)/(c-u):.5;f.x=s.x+o.x*a*y,f.y=s.y+o.y*a*y}}catch(t){d.e(t)}finally{d.f()}}else{var m,g=b(n);try{for(g.s();!(m=g.n()).done;){var x=m.value,_=e.x-x.x,w=e.y-x.y,S=_*_+w*w;S<t.minDistSq&&(S=t.minDistSq);var M=Math.sqrt(S),T=t.attractionStrength*M;x.fixed||(x.vx+=_/M*T,x.vy+=w/M*T),0!==t.orbitStrength&&(x.vx+=-w/M*t.orbitStrength,x.vy+=_/M*t.orbitStrength)}}catch(t){g.e(t)}finally{g.f()}}};for(M.s();!(C=M.n()).done;)T()}catch(t){M.e(t)}finally{M.f()}var A,k=b(n);try{for(k.s();!(A=k.n()).done;){var P,E=A.value,R=b(r);try{for(R.s();!(P=R.n()).done;){var I=P.value,O=I.x-E.x,L=I.y-E.y,B=Math.sqrt(O*O+L*L)||.01;if(B<this.planetRadius){var D=this.planetRadius-B,F=O/B*D*this.planetRepulsion,G=L/B*D*this.planetRepulsion;I.fixed||(I.vx+=F,I.vy+=G)}}}catch(t){R.e(t)}finally{R.f()}}}catch(t){k.e(t)}finally{k.f()}var j,z=b(r);try{for(z.s();!(j=z.n()).done;){var N=j.value;N.fixed||(N.x+=N.vx,N.y+=N.vy,N.x=Math.max(i.minX,Math.min(i.maxX,N.x)),N.y=Math.max(i.minY,Math.min(i.maxY,N.y)))}}catch(t){z.e(t)}finally{z.f()}}}}],e&&S(t.prototype,e),r&&S(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function T(t){return T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},T(t)}function A(t){return function(t){if(Array.isArray(t))return E(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||P(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function k(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=P(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,o=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return o=t.done,t},e:function(t){a=!0,s=t},f:function(){try{o||null==r.return||r.return()}finally{if(a)throw s}}}}function P(t,e){if(t){if("string"==typeof t)return E(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?E(t,e):void 0}}function E(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function R(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,I(n.key),n)}}function I(t){var e=function(t,e){if("object"!=T(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=T(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==T(e)?e:e+""}var O=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.innerRadius=20,this.outerRadius=300,this.turns=4,this.spread=1,this.smoothing=.15,this.angleOffset=0,this.arcStep=12,this.wobbleStrength=2,this.wobbleFrequency=2,this.wobbleSpeed=.02,this.wobbleThreshold=3e3},e=[{key:"setModel",value:function(t){this.model=t}},{key:"step",value:function(){var t,e=this,r=this.model.getNodes(),n=r.filter((function(t){return"moon"===t.type})),i=k(r.filter((function(t){return"planet"===t.type})));try{var s=function(){var r=t.value,i=r.scalarField;if(!i)return 0;var s=n.filter((function(t){return r.rule(t)}));if(0===s.length)return 0;var o,a=1/0,h=-1/0,l=k(s);try{for(l.s();!(o=l.n()).done;){var u=o.value.data[i];null!=u&&(u<a&&(a=u),u>h&&(h=u))}}catch(t){l.e(t)}finally{l.f()}if(a===1/0||h===-1/0)return 0;r._sorted&&!r._dirty||(r._sorted=A(s).sort((function(t,e){var r,n;return(null!==(r=t.data[i])&&void 0!==r?r:a)-(null!==(n=e.data[i])&&void 0!==n?n:a)})),r._sorted.forEach((function(t,e){t._spiralIndex=e})),r._dirty=!1);var c,d=r._sorted,f=d.length<e.wobbleThreshold,p=k(d);try{for(p.s();!(c=p.n()).done;){var y=c.value,m=y.data[i];null==m&&(m=a);var g=h>a?(m-a)/(h-a):.5,x=e.angleOffset+g*e.turns*Math.PI*2,v=e.innerRadius+g*(e.outerRadius-e.innerRadius)*e.spread,b=y._spiralIndex||0,_=x+b*(e.arcStep/(v+1)),w=v+.5*b,S=0;f&&(void 0===y._spiralPhase&&(y._spiralPhase=Math.random()*Math.PI*2),y._spiralPhase+=e.wobbleSpeed,S=Math.sin(y._spiralPhase*e.wobbleFrequency)*e.wobbleStrength);var C=r.x+Math.cos(_)*(w+S),M=r.y+Math.sin(_)*(w+S);y.x+=(C-y.x)*e.smoothing,y.y+=(M-y.y)*e.smoothing}}catch(t){p.e(t)}finally{p.f()}};for(i.s();!(t=i.n()).done;)s()}catch(t){i.e(t)}finally{i.f()}}}],e&&R(t.prototype,e),r&&R(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function L(t){return L="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},L(t)}function B(t){return function(t){if(Array.isArray(t))return F(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||D(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function D(t,e){if(t){if("string"==typeof t)return F(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?F(t,e):void 0}}function F(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function G(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,j(n.key),n)}}function j(t){var e=function(t,e){if("object"!=L(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=L(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==L(e)?e:e+""}var z=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.smoothing=.2,this.padding=40,this.jitter=10},e=[{key:"setModel",value:function(t){this.model=t}},{key:"_mapCategorical",value:function(t){var e=B(new Set(t)),r=new Map;return e.forEach((function(t,e){r.set(t,e)})),r}},{key:"step",value:function(){var t=this,e=this.model.getNodes(),r=e.filter((function(t){return"moon"===t.type})),n=e.filter((function(t){return"vector"===t.type})),i=this.bounds;if(i){var s,o=i.minY+this.padding,a=i.maxY-this.padding-o,h=i.minX+this.padding,l=i.maxX-this.padding-h,u=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=D(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,o=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return o=t.done,t},e:function(t){a=!0,s=t},f:function(){try{o||null==r.return||r.return()}finally{if(a)throw s}}}}(n);try{var c=function(){var e=s.value,n=e.scalarField;if(!n)return 0;var i=r.filter((function(t){return e.rule(t)}));if(0===i.length)return 0;var u=i.map((function(t){return t.data[n]})).filter((function(t){return null!=t}));if(0===u.length)return 0;var c,d,f,p="number"==typeof u[0];p?(c=Math.min.apply(Math,B(u)),d=Math.max.apply(Math,B(u))):(f=t._mapCategorical(u),c=0,d=f.size-1),i.sort((function(t,e){var r,i,s=t.data[n],o=e.data[n];return p||(s=f.get(s),o=f.get(o)),(null!==(r=s)&&void 0!==r?r:0)-(null!==(i=o)&&void 0!==i?i:0)})),i.forEach((function(r,i){var s=r.data[n];null==s&&(s=c),p||(s=f.get(s));var u=r.x,y=r.y;if(p){var m,g,x=d>c?(s-c)/(d-c):.5;0!==(null===(m=e.direction)||void 0===m?void 0:m.x)&&(u=h+x*l),0!==(null===(g=e.direction)||void 0===g?void 0:g.y)&&(y=o+x*a)}else{var v,b,_=d+1;if(0!==(null===(v=e.direction)||void 0===v?void 0:v.y)){var w=a/_;y=o+s*w+w/2,u=r.x+(Math.random()-.5)*t.jitter}if(0!==(null===(b=e.direction)||void 0===b?void 0:b.x)){var S=l/_;u=h+s*S+S/2,y=r.y+(Math.random()-.5)*t.jitter}}r.x+=(u-r.x)*t.smoothing,r.y+=(y-r.y)*t.smoothing}))};for(u.s();!(s=u.n()).done;)c()}catch(t){u.e(t)}finally{u.f()}}}}],e&&G(t.prototype,e),r&&G(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function N(t){return N="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},N(t)}function W(t){return function(t){if(Array.isArray(t))return X(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||U(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function U(t,e){if(t){if("string"==typeof t)return X(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?X(t,e):void 0}}function X(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Y(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,V(n.key),n)}}function V(t){var e=function(t,e){if("object"!=N(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=N(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==N(e)?e:e+""}var H=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.innerRadius=20,this.outerRadius=300,this.turns=4,this.spread=1,this.smoothing=.15,this.angleOffset=0,this.jitter=.002,this.wobbleStrength=2,this.wobbleFrequency=2},e=[{key:"setModel",value:function(t){this.model=t}},{key:"step",value:function(){var t,e=this,r=this.model.getNodes(),n=r.filter((function(t){return"moon"===t.type})),i=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=U(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,o=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return o=t.done,t},e:function(t){a=!0,s=t},f:function(){try{o||null==r.return||r.return()}finally{if(a)throw s}}}}(r.filter((function(t){return"planet"===t.type})));try{var s=function(){var r=t.value,i=r.scalarField;if(!i)return 0;var s=n.filter((function(t){return r.rule(t)}));if(0===s.length)return 0;s.sort((function(t,e){var r,n;return(null!==(r=t.data[i])&&void 0!==r?r:0)-(null!==(n=e.data[i])&&void 0!==n?n:0)}));var o=s.map((function(t){return t.data[i]})).filter((function(t){return null!=t}));if(0===o.length)return 0;var a=Math.min.apply(Math,W(o)),h=Math.max.apply(Math,W(o));s.forEach((function(t,n){var s=t.data[i];null==s&&(s=a);var o=h>a?(s-a)/(h-a):.5,l=e.angleOffset+o*e.turns*Math.PI*2,u=e.innerRadius+o*(e.outerRadius-e.innerRadius)*e.spread;void 0===t._spiralPhase&&(t._spiralPhase=Math.random()*Math.PI*2),t._spiralPhase+=.02;var c=Math.sin(t._spiralPhase*e.wobbleFrequency)*e.wobbleStrength,d=r.x+Math.cos(l)*(u+c),f=r.y+Math.sin(l)*(u+c);Math.random(),e.jitter,t.x+=(d-t.x)*e.smoothing,t.y+=(f-t.y)*e.smoothing}))};for(i.s();!(t=i.n()).done;)s()}catch(t){i.e(t)}finally{i.f()}}}],e&&Y(t.prototype,e),r&&Y(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function $(t){return $="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$(t)}function q(t){return function(t){if(Array.isArray(t))return Z(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||K(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function K(t,e){if(t){if("string"==typeof t)return Z(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Z(t,e):void 0}}function Z(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Q(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,J(n.key),n)}}function J(t){var e=function(t,e){if("object"!=$(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=$(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==$(e)?e:e+""}var tt=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.innerRadius=50,this.outerRadius=240,this.rings=6,this.angularSpeed=.002,this.smoothing=.15,this.wobbleStrength=2,this.wobbleFrequency=2,this.angleJitter=.002},e=[{key:"setModel",value:function(t){this.model=t}},{key:"step",value:function(){var t,e=this,r=this.model.getNodes(),n=r.filter((function(t){return"moon"===t.type})),i=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=K(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,o=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return o=t.done,t},e:function(t){a=!0,s=t},f:function(){try{o||null==r.return||r.return()}finally{if(a)throw s}}}}(r.filter((function(t){return"planet"===t.type})));try{var s=function(){var r=t.value,i=r.scalarField;if(!i)return 0;var s=n.filter((function(t){return r.rule(t)}));if(0===s.length)return 0;var o=s.map((function(t){return t.data[i]})).filter((function(t){return null!=t}));if(0===o.length)return 0;var a=Math.min.apply(Math,q(o)),h=Math.max.apply(Math,q(o));s.forEach((function(t){var n=t.data[i];null==n&&(n=a);var s=h>a?(n-a)/(h-a):.5,o=Math.floor(s*e.rings),l=Math.min(e.rings-1,o),u=Math.pow(l/(e.rings-1||1),1.5),c=e.innerRadius+u*(e.outerRadius-e.innerRadius);void 0===t._orbitAngle&&(t._orbitAngle=Math.random()*Math.PI*2);var d=e.angularSpeed/(1+.5*l);t._orbitAngle+=d;var f=Math.sin(t._orbitAngle*e.wobbleFrequency)*e.wobbleStrength,p=r.x+Math.cos(t._orbitAngle)*(c+f),y=r.y+Math.sin(t._orbitAngle)*(c+f);t._orbitAngle+=(Math.random()-.5)*e.angleJitter,t.x+=(p-t.x)*e.smoothing,t.y+=(y-t.y)*e.smoothing}))};for(i.s();!(t=i.n()).done;)s()}catch(t){i.e(t)}finally{i.f()}}}],e&&Q(t.prototype,e),r&&Q(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function et(t){return et="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},et(t)}function rt(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return nt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?nt(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,o=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return o=t.done,t},e:function(t){a=!0,s=t},f:function(){try{o||null==r.return||r.return()}finally{if(a)throw s}}}}function nt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function it(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,st(n.key),n)}}function st(t){var e=function(t,e){if("object"!=et(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=et(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==et(e)?e:e+""}var ot=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.gravity=.005,this.damping=.999,this.restitution=.7,this.friction=.98,this.radius=10},(e=[{key:"setModel",value:function(t){this.model=t}},{key:"step",value:function(){var t,e=this.model.getNodes().filter((function(t){return"moon"===t.type})),r=this.bounds,n=r.maxY,i=rt(e);try{for(i.s();!(t=i.n()).done;){var s=t.value;s.fixed||(s.vy+=this.gravity,s.x+=s.vx,s.y+=s.vy,s.y+this.radius>n&&(s.y=n-this.radius,s.vy*=-this.restitution,s.vx*=this.friction),s.x-this.radius<r.minX&&(s.x=r.minX+this.radius,s.vx*=-this.restitution),s.x+this.radius>r.maxX&&(s.x=r.maxX-this.radius,s.vx*=-this.restitution),s.vx*=this.damping,s.vy*=this.damping)}}catch(t){i.e(t)}finally{i.f()}}}])&&it(t.prototype,e),r&&it(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function at(t){return at="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},at(t)}function ht(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,lt(n.key),n)}}function lt(t){var e=function(t,e){if("object"!=at(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=at(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==at(e)?e:e+""}var ut=function(){return t=function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.view=e,this.model=r,this.main=null,this.selected=new Set,this._bindViewEvents()},(e=[{key:"_bindViewEvents",value:function(){var t=this;this.view.onNodeClick=function(e){t._inspectNode(e)},this.view.onNodeRightClick=function(e){var r=e.node,n=e.global,i=t.view.app.canvas.getBoundingClientRect(),s=i.left+n.x,o=i.top+n.y;t.view.selectedNodes.size>1?t._showGroupContextMenu(s,o,r):t._showContextMenu(s,o,r)},this.view.onNodeDragStart=function(t){t.vx=0,t.vy=0,t.fixed=!0},this.view.onNodeDragMove=function(t,e){t.x=e.x,t.y=e.y},this.view.onNodeDragEnd=function(t){t.fixed=!1},this.view.onBackgroundPointerDown=function(){t._hideContextMenu()},this.view.onNodeClick=function(t,e){console.log("Selected:",t)},this.view.onSelectionChange=function(t){console.log("Selected nodes:",t)}}},{key:"_inspectNode",value:function(t){var e=document.getElementById("inspector");e||((e=document.createElement("div")).id="inspector",document.body.appendChild(e)),e.innerHTML="\n <pre>".concat(JSON.stringify(t.data,null,2),"</pre>\n ")}},{key:"_showContextMenu",value:function(t,e,r){var n=this;this._hideContextMenu();var i=document.createElement("div");i.className="context-menu";var s=this.view.app.canvas.parentElement,o=s.getBoundingClientRect();i.style.position="absolute",i.style.left="".concat(t-o.left,"px"),i.style.top="".concat(e-o.top,"px"),i.style.background="#2b2b2b",i.style.color="#fff",i.style.padding="6px",i.style.borderRadius="8px",i.style.zIndex=1e3,i.style.minWidth="140px",i.style.boxShadow="0 4px 12px rgba(0,0,0,0.4)",i.style.fontSize="13px",i.style.userSelect="none";var a=function(t,e){var r=document.createElement("div");return r.textContent=t,r.style.padding="8px 12px",r.style.borderRadius="6px",r.style.cursor="pointer",r.style.transition="background 0.15s",r.addEventListener("mouseenter",(function(){r.style.background="#3a3a3a"})),r.addEventListener("mouseleave",(function(){r.style.background="transparent"})),r.addEventListener("click",e),r};i.appendChild(a("🗑 Delete Node",(function(){n._deleteNode(r),n._hideContextMenu()})));var h=document.createElement("div");h.style.height="1px",h.style.background="#444",h.style.margin="4px 0",i.appendChild(h),i.appendChild(a("🔍 Inspect",(function(){var t,e;null===(t=(e=n.main).onNodeInspect)||void 0===t||t.call(e,r),n._hideContextMenu()}))),s.appendChild(i),this._contextMenu=i}},{key:"_hideContextMenu",value:function(){this._contextMenu&&(this._contextMenu.remove(),this._contextMenu=null),this._hideGroupContextMenu()}},{key:"_showGroupContextMenu",value:function(t,e,r){var n=this;this._hideGroupContextMenu();var i=document.createElement("div");i.className="context-menu";var s=this.view.app.canvas.parentElement,o=s.getBoundingClientRect();i.style.position="absolute",i.style.left="".concat(t-o.left,"px"),i.style.top="".concat(e-o.top,"px"),i.style.background="#2b2b2b",i.style.color="#fff",i.style.padding="6px",i.style.borderRadius="8px",i.style.zIndex=1e3,i.style.minWidth="140px",i.style.boxShadow="0 4px 12px rgba(0,0,0,0.4)",i.style.fontSize="13px",i.style.userSelect="none";var a=function(t,e){var r=document.createElement("div");return r.textContent=t,r.style.padding="8px 12px",r.style.borderRadius="6px",r.style.cursor="pointer",r.style.transition="background 0.15s",r.addEventListener("mouseenter",(function(){r.style.background="#3a3a3a"})),r.addEventListener("mouseleave",(function(){r.style.background="transparent"})),r.addEventListener("click",e),r};i.appendChild(a("🗑 Delete Selected Nodes",(function(){})));var h=document.createElement("div");h.style.height="1px",h.style.background="#444",h.style.margin="4px 0",i.appendChild(h),i.appendChild(a("🔍 Inspect Selection",(function(){var t,e;null===(t=(e=n.main).onGroupInspect)||void 0===t||t.call(e,n.view.selectedNodes),n._hideGroupContextMenu()}))),s.appendChild(i),this._groupContextMenu=i}},{key:"_hideGroupContextMenu",value:function(){this._groupContextMenu&&(this._groupContextMenu.remove(),this._groupContextMenu=null)}},{key:"_deleteNode",value:function(t){this.model.deleteNode(t.id);var e=this.view.graphicsMap.get(t.id);e&&(e.destroy(),this.view.graphicsMap.delete(t.id));var r=this.view.graphicsMap.get(t.id+"_axis");r&&(r.destroy(),this.view.graphicsMap.delete(t.id+"_axis")),this.selected.delete(t.id)}},{key:"_highlight",value:function(t){var e=this.view.graphicsMap.get(t);e&&(e.tint=16711680)}}])&&ht(t.prototype,e),r&&ht(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}(),ct=i(8507);const dt={extension:{type:ct.Ag.Environment,name:"browser",priority:-1},test:()=>!0,load:async()=>{await Promise.all([i.e(859),i.e(397)]).then(i.bind(i,8397))}},ft={extension:{type:ct.Ag.Environment,name:"webworker",priority:0},test:()=>"undefined"!=typeof self&&void 0!==self.WorkerGlobalScope,load:async()=>{await Promise.all([i.e(859),i.e(162)]).then(i.bind(i,2162))}};i(5753),i(6312);var pt=i(1761),yt=i(800);let mt,gt;async function xt(t={}){return void 0!==gt||(gt=await(async()=>{const e=pt.e.get().getNavigator().gpu;if(!e)return!1;try{const r=await e.requestAdapter(t);return await r.requestDevice(),!0}catch(t){return!1}})()),gt}const vt=["webgl","webgpu","canvas"];var bt=i(5559),_t=i(7073),wt=i(4670);class St{static init(t){Object.defineProperty(this,"resizeTo",{configurable:!0,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;let t,e;if(this._cancelResize(),this._resizeTo===globalThis.window)t=globalThis.innerWidth,e=globalThis.innerHeight;else{const{clientWidth:r,clientHeight:n}=this._resizeTo;t=r,e=n}this.renderer.resize(t,e),this.render()},this._resizeId=null,this._resizeTo=null,this.resizeTo=t.resizeTo||null}static destroy(){globalThis.removeEventListener("resize",this.queueResize),this._cancelResize(),this._cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null}}St.extension=ct.Ag.Application;var Ct=i(4458),Mt=i(7309);class Tt{static init(t){t=Object.assign({autoStart:!0,sharedTicker:!1},t),Object.defineProperty(this,"ticker",{configurable:!0,set(t){this._ticker&&this._ticker.remove(this.render,this),this._ticker=t,t&&t.add(this.render,this,Ct.d.LOW)},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?Mt.R.shared:new Mt.R,t.autoStart&&this.start()}static destroy(){if(this._ticker){const t=this._ticker;this.ticker=null,t.destroy()}}}Tt.extension=ct.Ag.Application,ct.XO.add(St),ct.XO.add(Tt);const At=class t{constructor(...t){this.stage=new bt.mc,void 0!==t[0]&&(0,wt.t6)(wt.lj,"Application constructor options are deprecated, please use Application.init() instead.")}async init(e){e={...e},this.stage||(this.stage=new bt.mc),this.renderer=await async function(t){let e,r=[];t.preference?(r.push(t.preference),vt.forEach((e=>{e!==t.preference&&r.push(e)}))):r=vt.slice();let n={};for(let o=0;o<r.length;o++){const a=r[o];if("webgpu"===a&&await xt()){const{WebGPURenderer:r}=await Promise.all([i.e(468),i.e(866)]).then(i.bind(i,9866));e=r,n={...t,...t.webgpu};break}if("webgl"===a&&(s=t.failIfMajorPerformanceCaveat??yt.k.defaultOptions.failIfMajorPerformanceCaveat,void 0!==mt||(mt=(()=>{const t={stencil:!0,failIfMajorPerformanceCaveat:s??yt.k.defaultOptions.failIfMajorPerformanceCaveat};try{if(!pt.e.get().getWebGLRenderingContext())return!1;let e=pt.e.get().createCanvas().getContext("webgl",t);const r=!!e?.getContextAttributes()?.stencil;if(e){const t=e.getExtension("WEBGL_lose_context");t&&t.loseContext()}return e=null,r}catch(t){return!1}})()),mt)){const{WebGLRenderer:r}=await Promise.all([i.e(468),i.e(132)]).then(i.bind(i,4132));e=r,n={...t,...t.webgl};break}if("canvas"===a){const{CanvasRenderer:r}=await Promise.all([i.e(468),i.e(851)]).then(i.bind(i,6851));e=r,n={...t,...t.canvasOptions};break}}var s;if(delete n.webgpu,delete n.webgl,delete n.canvasOptions,!e)throw new Error("No available renderer for the current environment");const o=new e;return await o.init(n),o}(e),t._plugins.forEach((t=>{t.init.call(this,e)}))}render(){this.renderer.render({container:this.stage})}get canvas(){return this.renderer.canvas}get view(){return(0,wt.t6)(wt.lj,"Application.view is deprecated, please use Application.canvas instead."),this.renderer.canvas}get screen(){return this.renderer.screen}destroy(e=!1,r=!1){const n=t._plugins.slice(0);n.reverse(),n.forEach((t=>{t.destroy.call(this)})),this.stage.destroy(r),this.stage=null,this.renderer.destroy(e),this.renderer=null}};At._plugins=[];let kt=At;ct.XO.handleByList(ct.Ag.Application,kt._plugins),ct.XO.add(_t.M);i(9726);var Pt=i(4663),Et=i(583),Rt=i(218),It=i(2812),Ot=i(4985);class Lt extends Ot.l{constructor(t,e){const{text:r,resolution:n,style:i,anchor:s,width:o,height:a,roundPixels:h,...l}=t;super({...l}),this.batched=!0,this._resolution=null,this._autoResolution=!0,this._didTextUpdate=!0,this._styleClass=e,this.text=r??"",this.style=i,this.resolution=n??null,this.allowChildren=!1,this._anchor=new It.o({_onUpdate:()=>{this.onViewUpdate()}}),s&&(this.anchor=s),this.roundPixels=h??!1,void 0!==o&&(this.width=o),void 0!==a&&(this.height=a)}get anchor(){return this._anchor}set anchor(t){"number"==typeof t?this._anchor.set(t):this._anchor.copyFrom(t)}set text(t){t=t.toString(),this._text!==t&&(this._text=t,this.onViewUpdate())}get text(){return this._text}set resolution(t){this._autoResolution=null===t,this._resolution=t,this.onViewUpdate()}get resolution(){return this._resolution}get style(){return this._style}set style(t){t||(t={}),this._style?.off("update",this.onViewUpdate,this),t instanceof this._styleClass?this._style=t:this._style=new this._styleClass(t),this._style.on("update",this.onViewUpdate,this),this.onViewUpdate()}get width(){return Math.abs(this.scale.x)*this.bounds.width}set width(t){this._setWidth(t,this.bounds.width)}get height(){return Math.abs(this.scale.y)*this.bounds.height}set height(t){this._setHeight(t,this.bounds.height)}getSize(t){return t||(t={}),t.width=Math.abs(this.scale.x)*this.bounds.width,t.height=Math.abs(this.scale.y)*this.bounds.height,t}setSize(t,e){"object"==typeof t?(e=t.height??t.width,t=t.width):e??(e=t),void 0!==t&&this._setWidth(t,this.bounds.width),void 0!==e&&this._setHeight(e,this.bounds.height)}containsPoint(t){const e=this.bounds.width,r=this.bounds.height,n=-e*this.anchor.x;let i=0;return t.x>=n&&t.x<=n+e&&(i=-r*this.anchor.y,t.y>=i&&t.y<=i+r)}onViewUpdate(){this.didViewUpdate||(this._didTextUpdate=!0),super.onViewUpdate()}destroy(t=!1){super.destroy(t),this.owner=null,this._bounds=null,this._anchor=null,("boolean"==typeof t?t:t?.style)&&this._style.destroy(t),this._style=null,this._text=null}get styleKey(){return`${this._text}:${this._style.styleKey}:${this._resolution}`}}var Bt=i(2577),Dt=i(9252),Ft=i(7608),Gt=i(9939);let jt=null,zt=null;function Nt(t,e,r){for(let n=0,i=4*r*e;n<e;++n,i+=4)if(0!==t[i+3])return!1;return!0}function Wt(t,e,r,n,i){const s=4*e;for(let e=n,o=n*s+4*r;e<=i;++e,o+=s)if(0!==t[o+3])return!1;return!0}function Ut(...t){let e=t[0];e.canvas||(e={canvas:t[0],resolution:t[1]});const{canvas:r}=e,n=Math.min(e.resolution??1,1),i=e.width??r.width,s=e.height??r.height;let o=e.output;if(function(t,e){jt||(jt=pt.e.get().createCanvas(256,128),zt=jt.getContext("2d",{willReadFrequently:!0}),zt.globalCompositeOperation="copy",zt.globalAlpha=1),(jt.width<t||jt.height<e)&&(jt.width=(0,Gt.U5)(t),jt.height=(0,Gt.U5)(e))}(i,s),!zt)throw new TypeError("Failed to get canvas 2D context");zt.drawImage(r,0,0,i,s,0,0,i*n,s*n);const a=zt.getImageData(0,0,i,s).data;let h=0,l=0,u=i-1,c=s-1;for(;l<s&&Nt(a,i,l);)++l;if(l===s)return Dt.M.EMPTY;for(;Nt(a,i,c);)--c;for(;Wt(a,i,h,l,c);)++h;for(;Wt(a,i,u,l,c);)--u;return++u,++c,zt.globalCompositeOperation="source-over",zt.strokeRect(h,l,u-h,c-l),zt.globalCompositeOperation="copy",o??(o=new Dt.M),o.set(h/n,l/n,(u-h)/n,(c-l)/n),o}class Xt{constructor(t=0,e=0,r=!1){this.first=null,this.items=Object.create(null),this.last=null,this.max=t,this.resetTtl=r,this.size=0,this.ttl=e}clear(){return this.first=null,this.items=Object.create(null),this.last=null,this.size=0,this}delete(t){if(this.has(t)){const e=this.items[t];delete this.items[t],this.size--,null!==e.prev&&(e.prev.next=e.next),null!==e.next&&(e.next.prev=e.prev),this.first===e&&(this.first=e.next),this.last===e&&(this.last=e.prev)}return this}entries(t=this.keys()){const e=new Array(t.length);for(let r=0;r<t.length;r++){const n=t[r];e[r]=[n,this.get(n)]}return e}evict(t=!1){if(t||this.size>0){const t=this.first;delete this.items[t.key],0==--this.size?(this.first=null,this.last=null):(this.first=t.next,this.first.prev=null)}return this}expiresAt(t){let e;return this.has(t)&&(e=this.items[t].expiry),e}get(t){const e=this.items[t];if(void 0!==e)return this.ttl>0&&e.expiry<=Date.now()?void this.delete(t):(this.moveToEnd(e),e.value)}has(t){return t in this.items}moveToEnd(t){this.last!==t&&(null!==t.prev&&(t.prev.next=t.next),null!==t.next&&(t.next.prev=t.prev),this.first===t&&(this.first=t.next),t.prev=this.last,t.next=null,null!==this.last&&(this.last.next=t),this.last=t,null===this.first&&(this.first=t))}keys(){const t=new Array(this.size);let e=this.first,r=0;for(;null!==e;)t[r++]=e.key,e=e.next;return t}setWithEvicted(t,e,r=this.resetTtl){let n=null;if(this.has(t))this.set(t,e,!0,r);else{this.max>0&&this.size===this.max&&(n={...this.first},this.evict(!0));let r=this.items[t]={expiry:this.ttl>0?Date.now()+this.ttl:this.ttl,key:t,prev:this.last,next:null,value:e};1==++this.size?this.first=r:this.last.next=r,this.last=r}return n}set(t,e,r=!1,n=this.resetTtl){let i=this.items[t];return r||void 0!==i?(i.value=e,!1===r&&n&&(i.expiry=this.ttl>0?Date.now()+this.ttl:this.ttl),this.moveToEnd(i)):(this.max>0&&this.size===this.max&&this.evict(!0),i=this.items[t]={expiry:this.ttl>0?Date.now()+this.ttl:this.ttl,key:t,prev:this.last,next:null,value:e},1==++this.size?this.first=i:this.last.next=i,this.last=i),this}values(t=this.keys()){const e=new Array(t.length);for(let r=0;r<t.length;r++)e[r]=this.get(t[r]);return e}}function Yt(t){return!!t.tagStyles&&Object.keys(t.tagStyles).length>0}function Vt(t){return t.includes("<")}function Ht(t,e){const r=[],n=e.tagStyles;if(!Yt(e)||!Vt(t))return r.push({text:t,style:e}),r;const i=[e],s=[];let o="",a=0;for(;a<t.length;){const e=t[a];if("<"===e){const u=t.indexOf(">",a);if(-1===u){o+=e,a++;continue}const c=t.slice(a+1,u);if(c.startsWith("/")){const e=c.slice(1).trim();if(s.length>0&&s[s.length-1]===e){o.length>0&&(r.push({text:o,style:i[i.length-1]}),o=""),i.pop(),s.pop(),a=u+1;continue}o+=t.slice(a,u+1),a=u+1;continue}{const e=c.trim();if(n[e]){o.length>0&&(r.push({text:o,style:i[i.length-1]}),o="");const t=i[i.length-1],c=(h=t,l=n[e],h.clone().assign(l));i.push(c),s.push(e),a=u+1;continue}o+=t.slice(a,u+1),a=u+1;continue}}o+=e,a++}var h,l;return o.length>0&&r.push({text:o,style:i[i.length-1]}),r}const $t=new Set([10,13]),qt=new Set([9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288]),Kt=(new Set([9,32]),new Set([45,8208,8211,8212,173])),Zt=/(\r\n|\r|\n)/,Qt=/(?:\r\n|\r|\n)/;function Jt(t){return"string"==typeof t&&$t.has(t.charCodeAt(0))}function te(t,e){return"string"==typeof t&&qt.has(t.charCodeAt(0))}function ee(t){return"string"==typeof t&&Kt.has(t.charCodeAt(0))}function re(t){return"normal"===t||"pre-line"===t}function ne(t){return"normal"===t}function ie(t){if("string"!=typeof t)return"";let e=t.length-1;for(;e>=0&&te(t[e]);)e--;return e<t.length-1?t.slice(0,e+1):t}function se(t){const e=[],r=[];if("string"!=typeof t)return e;for(let n=0;n<t.length;n++){const i=t[n],s=t[n+1];te(i)||Jt(i)?(r.length>0&&(e.push(r.join("")),r.length=0),"\r"===i&&"\n"===s?(e.push("\r\n"),n++):e.push(i)):(r.push(i),ee(i)&&s&&!te(s)&&!Jt(s)&&(e.push(r.join("")),r.length=0))}return r.length>0&&e.push(r.join("")),e}function oe(t,e,r,n){const i=r(t),s=[];for(let r=0;r<i.length;r++){let o=i[r],a=o,h=1;for(;i[r+h];){const s=i[r+h];if(n(a,s,t,r,e))break;o+=s,a=s,h++}r+=h-1,s.push(o)}return s}const ae=/\r\n|\r|\n/g;function he(t,e,r,n,i,s,o,a){const h=Ht(t,e);if(ne(e.whiteSpace))for(let t=0;t<h.length;t++){const e=h[t];h[t]={text:e.text.replace(ae," "),style:e.style}}const l=[];let u=[];for(const t of h){const e=t.text.split(Zt);for(let r=0;r<e.length;r++){const n=e[r];"\r\n"===n||"\r"===n||"\n"===n?(l.push(u),u=[]):n.length>0&&u.push({text:n,style:t.style})}}(u.length>0||0===l.length)&&l.push(u);const c=r?function(t,e,r,n,i,s){const{letterSpacing:o,whiteSpace:a,wordWrapWidth:h,breakWords:l}=e,u=re(a),c=h+o,d={};let f="";const p=(t,e)=>{const i=`${t}|${e.styleKey}`;let s=d[i];if(void 0===s){const o=e._fontString;o!==f&&(r.font=o,f=o),s=n(t,e.letterSpacing,r)+e.letterSpacing,d[i]=s}return s},y=[];for(const e of t){const t=le(e),r=y.length,n=e=>{let r=0,n=e;do{const{token:e,style:i}=t[n];r+=p(e,i),n++}while(n<t.length&&t[n].continuesFromPrevious);return r},o=e=>{const r=[];let n=e;do{r.push({token:t[n].token,style:t[n].style}),n++}while(n<t.length&&t[n].continuesFromPrevious);return r};let a=[],h=0,d=!u,f=null;const m=()=>{f&&f.text.length>0&&a.push(f),f=null},g=()=>{if(m(),a.length>0){const t=a[a.length-1];t.text=ie(t.text),0===t.text.length&&a.pop()}y.push(a),a=[],h=0,d=!1};for(let e=0;e<t.length;e++){const{token:r,style:x,continuesFromPrevious:v}=t[e],b=p(r,x);if(u){const t=te(r),e=f?.text[f.text.length-1]??a[a.length-1]?.text.slice(-1)??"",n=!!e&&te(e);if(t&&n)continue}const _=!v,w=_?n(e):b;if(w>c&&_)if(h>0&&g(),l){const t=o(e);for(let e=0;e<t.length;e++){const r=t[e].token,n=t[e].style,o=oe(r,l,s,i);for(const t of o){const e=p(t,n);e+h>c&&g(),f&&f.style===n?f.text+=t:(m(),f={text:t,style:n}),h+=e}}e+=t.length-1}else{const t=o(e);m(),y.push(t.map((t=>({text:t.token,style:t.style})))),d=!1,e+=t.length-1}else if(w+h>c&&_){if(te(r)){d=!1;continue}g(),f={text:r,style:x},h=b}else if(v&&!l)f&&f.style===x?f.text+=r:(m(),f={text:r,style:x}),h+=b;else{const t=te(r);if(0===h&&t&&!d)continue;f&&f.style===x?f.text+=r:(m(),f={text:r,style:x}),h+=b}}if(m(),a.length>0){const t=a[a.length-1];t.text=ie(t.text),0===t.text.length&&a.pop()}(a.length>0||y.length===r)&&y.push(a)}return y}(l,e,n,i,o,a):l,d=[],f=[],p=[],y=[],m=[];let g=0;const x=s(e._fontString);0===x.fontSize&&(x.fontSize=e.fontSize,x.ascent=e.fontSize);let v="",b=!!e.dropShadow,_=e._stroke?.width||0;for(const t of c){let r=0,o=x.ascent,a=x.descent,h="";for(const e of t){const t=e.style._fontString,l=s(t);t!==v&&(n.font=t,v=t);r+=i(e.text,e.style.letterSpacing,n),o=Math.max(o,l.ascent),a=Math.max(a,l.descent),h+=e.text;const u=e.style._stroke?.width||0;u>_&&(_=u),!b&&e.style.dropShadow&&(b=!0)}0===t.length&&(o=x.ascent,a=x.descent),d.push(r),f.push(o),p.push(a),m.push(h);const l=e.lineHeight||o+a;y.push(l+e.leading),g=Math.max(g,r)}const w=_,S=(r&&"left"!==e.align?Math.max(g,e.wordWrapWidth):g)+w+(e.dropShadow?e.dropShadow.distance:0);let C=0;for(let t=0;t<y.length;t++)C+=y[t];C=Math.max(C,y[0]+w);return{width:S,height:C+(e.dropShadow?e.dropShadow.distance:0),lines:m,lineWidths:d,lineHeight:(e.lineHeight||x.fontSize)+e.leading,maxLineWidth:g,fontProperties:x,runsByLine:c,lineAscents:f,lineDescents:p,lineHeights:y,hasDropShadow:b}}function le(t){const e=[];let r=!1;for(const n of t){const t=se(n.text);let i=!0;for(const s of t){const t=te(s)||Jt(s),o=i&&r&&!t;e.push({token:s,style:n.style,continuesFromPrevious:o}),r=!t,i=!1}}return e}const ue={willReadFrequently:!0};function ce(t,e,r,n,i){let s=r[t];return"number"!=typeof s&&(s=i(t,e,n)+e,r[t]=s),s}const de={willReadFrequently:!0},fe=class t{static get experimentalLetterSpacingSupported(){let e=t._experimentalLetterSpacingSupported;if(void 0===e){const r=pt.e.get().getCanvasRenderingContext2D().prototype;e=t._experimentalLetterSpacingSupported="letterSpacing"in r||"textLetterSpacing"in r}return e}constructor(t,e,r,n,i,s,o,a,h,l){this.text=t,this.style=e,this.width=r,this.height=n,this.lines=i,this.lineWidths=s,this.lineHeight=o,this.maxLineWidth=a,this.fontProperties=h,l&&(this.runsByLine=l.runsByLine,this.lineAscents=l.lineAscents,this.lineDescents=l.lineDescents,this.lineHeights=l.lineHeights,this.hasDropShadow=l.hasDropShadow)}static measureText(e=" ",r,n=t._canvas,i=r.wordWrap){const s=`${e}-${r.styleKey}-wordWrap-${i}`;if(t._measurementCache.has(s))return t._measurementCache.get(s);if(Yt(r)&&Vt(e)){const n=he(e,r,i,t._context,t._measureText,t.measureFont,t.canBreakChars,t.wordWrapSplit),o=new t(e,r,n.width,n.height,n.lines,n.lineWidths,n.lineHeight,n.maxLineWidth,n.fontProperties,{runsByLine:n.runsByLine,lineAscents:n.lineAscents,lineDescents:n.lineDescents,lineHeights:n.lineHeights,hasDropShadow:n.hasDropShadow});return t._measurementCache.set(s,o),o}const o=r._fontString,a=t.measureFont(o);0===a.fontSize&&(a.fontSize=r.fontSize,a.ascent=r.fontSize,a.descent=0);const h=t._context;h.font=o;const l=(i?t._wordWrap(e,r,n):e).split(Qt),u=new Array(l.length);let c=0;for(let e=0;e<l.length;e++){const n=t._measureText(l[e],r.letterSpacing,h);u[e]=n,c=Math.max(c,n)}const d=r._stroke?.width??0,f=r.lineHeight||a.fontSize,p=t._getAlignWidth(c,r,i),y=t._adjustWidthForStyle(p,r),m=Math.max(f,a.fontSize+d)+(l.length-1)*(f+r.leading),g=t._adjustHeightForStyle(m,r),x=new t(e,r,y,g,l,u,f+r.leading,c,a);return t._measurementCache.set(s,x),x}static _adjustWidthForStyle(t,e){let r=t+(e._stroke?.width||0);return e.dropShadow&&(r+=e.dropShadow.distance),r}static _adjustHeightForStyle(t,e){let r=t;return e.dropShadow&&(r+=e.dropShadow.distance),r}static _getAlignWidth(t,e,r){return r&&"left"!==e.align?Math.max(t,e.wordWrapWidth):t}static _measureText(e,r,n){let i=!1;t.experimentalLetterSpacingSupported&&(t.experimentalLetterSpacing?(n.letterSpacing=`${r}px`,n.textLetterSpacing=`${r}px`,i=!0):(n.letterSpacing="0px",n.textLetterSpacing="0px"));const s=n.measureText(e);let o=s.width;const a=-(s.actualBoundingBoxLeft??0);let h=(s.actualBoundingBoxRight??0)-a;if(o>0)if(i)o-=r,h-=r;else{const n=(t.graphemeSegmenter(e).length-1)*r;o+=n,h+=n}return Math.max(o,h)}static _wordWrap(e,r,n=t._canvas){return function(t,e,r,n,i,s,o){const a=r.getContext("2d",ue);a.font=e._fontString;let h=0,l="";const u=[],c=Object.create(null),{letterSpacing:d,whiteSpace:f}=e,p=re(f),y=ne(f);let m=!p;const g=e.wordWrapWidth+d,x=se(t);for(let t=0;t<x.length;t++){let r=x[t];if(Jt(r)){if(!y){u.push(ie(l)),m=!p,l="",h=0;continue}r=" "}if(p){const t=te(r),e=te(l[l.length-1]);if(t&&e)continue}const f=ce(r,d,c,a,n);if(f>g)if(""!==l&&(u.push(ie(l)),l="",h=0),i(r,e.breakWords)){const t=oe(r,e.breakWords,o,s);for(const e of t){const t=ce(e,d,c,a,n);t+h>g&&(u.push(ie(l)),m=!1,l="",h=0),l+=e,h+=t}}else l.length>0&&(u.push(ie(l)),l="",h=0),u.push(ie(r)),m=!1,l="",h=0;else f+h>g&&(m=!1,u.push(ie(l)),l="",h=0),(l.length>0||!te(r)||m)&&(l+=r,h+=f)}const v=ie(l);return v.length>0&&u.push(v),u.join("\n")}(e,r,n,t._measureText,t.canBreakWords,t.canBreakChars,t.wordWrapSplit)}static isBreakingSpace(t,e){return te(t)}static canBreakWords(t,e){return e}static canBreakChars(t,e,r,n,i){return!0}static wordWrapSplit(e){return t.graphemeSegmenter(e)}static measureFont(e){if(t._fonts[e])return t._fonts[e];const r=t._context;r.font=e;const n=r.measureText(t.METRICS_STRING+t.BASELINE_SYMBOL),i=n.actualBoundingBoxAscent??0,s=n.actualBoundingBoxDescent??0,o={ascent:i,descent:s,fontSize:i+s};return t._fonts[e]=o,o}static clearMetrics(e=""){e?delete t._fonts[e]:t._fonts={}}static get _canvas(){if(!t.__canvas){let e;try{const r=new OffscreenCanvas(0,0),n=r.getContext("2d",de);if(n?.measureText)return t.__canvas=r,r;e=pt.e.get().createCanvas()}catch(t){e=pt.e.get().createCanvas()}e.width=e.height=10,t.__canvas=e}return t.__canvas}static get _context(){return t.__context||(t.__context=t._canvas.getContext("2d",de)),t.__context}};fe.METRICS_STRING="|ÉqÅ",fe.BASELINE_SYMBOL="M",fe.BASELINE_MULTIPLIER=1.4,fe.HEIGHT_MULTIPLIER=2,fe.graphemeSegmenter=(()=>{if("function"==typeof Intl?.Segmenter){const t=new Intl.Segmenter;return e=>{const r=t.segment(e),n=[];let i=0;for(const t of r)n[i++]=t.segment;return n}}return t=>[...t]})(),fe.experimentalLetterSpacing=!1,fe._fonts={},fe._measurementCache=function(t=1e3,e=0,r=!1){if(isNaN(t)||t<0)throw new TypeError("Invalid max value");if(isNaN(e)||e<0)throw new TypeError("Invalid ttl value");if("boolean"!=typeof r)throw new TypeError("Invalid resetTtl value");return new Xt(t,e,r)}(1e3);let pe=fe;const ye=["serif","sans-serif","monospace","cursive","fantasy","system-ui"];function me(t){const e="number"==typeof t.fontSize?`${t.fontSize}px`:t.fontSize;let r=t.fontFamily;Array.isArray(t.fontFamily)||(r=t.fontFamily.split(","));for(let t=r.length-1;t>=0;t--){let e=r[t].trim();/([\"\'])[^\'\"]+\1/.test(e)||ye.includes(e)||(e=`"${e}"`),r[t]=e}return`${t.fontStyle} ${t.fontVariant} ${t.fontWeight} ${e} ${r.join(",")}`}var ge=i(9313),xe=i(5589),ve=i(268),be=i(7276),_e=i(2806);const we=1e5;function Se(t,e,r,n=0,i=0,s=0){if(t.texture===xe.g.WHITE&&!t.fill)return Bt.Q.shared.setValue(t.color).setAlpha(t.alpha??1).toHexa();if(!t.fill){const r=e.createPattern(t.texture.source.resource,"repeat"),n=t.matrix.copyTo(ge.u.shared);return n.scale(t.texture.source.pixelWidth,t.texture.source.pixelHeight),r.setTransform(n),r}if(t.fill instanceof _e.m){const r=t.fill,n=e.createPattern(r.texture.source.resource,"repeat"),i=r.transform.copyTo(ge.u.shared);return i.scale(r.texture.source.pixelWidth,r.texture.source.pixelHeight),n.setTransform(i),n}if(t.fill instanceof be._){const o=t.fill,a="linear"===o.type,h="local"===o.textureSpace;let l,u=1,c=1;h&&r&&(u=r.width+n,c=r.height+n);let d=!1;if(a){const{start:t,end:r}=o;l=e.createLinearGradient(t.x*u+i,t.y*c+s,r.x*u+i,r.y*c+s),d=Math.abs(r.x-t.x)<Math.abs(.1*(r.y-t.y))}else{const{center:t,innerRadius:r,outerCenter:n,outerRadius:a}=o;l=e.createRadialGradient(t.x*u+i,t.y*c+s,r*u,n.x*u+i,n.y*c+s,a*u)}if(d&&h&&r){const t=r.lineHeight/c;for(let e=0;e<r.lines.length;e++){const i=(e*r.lineHeight+n/2)/c;o.colorStops.forEach((e=>{let r=i+e.offset*t;r=Math.max(0,Math.min(1,r)),l.addColorStop(Math.floor(r*we)/we,Bt.Q.shared.setValue(e.color).toHex())}))}}else o.colorStops.forEach((t=>{l.addColorStop(t.offset,Bt.Q.shared.setValue(t.color).toHex())}));return l}return(0,ve.R)("FillStyle not recognised",t),"red"}const Ce=new Dt.M;function Me(t){let e=0;for(let r=0;r<t.length;r++)32===t.charCodeAt(r)&&e++;return e}const Te=new class{getCanvasAndContext(t){const{text:e,style:r,resolution:n=1}=t,i=r._getFinalPadding(),s=pe.measureText(e||" ",r),o=Math.ceil(Math.ceil(Math.max(1,s.width)+2*i)*n),a=Math.ceil(Math.ceil(Math.max(1,s.height)+2*i)*n),h=Ft.N.getOptimalCanvasAndContext(o,a);this._renderTextToCanvas(r,i,n,h,s);return{canvasAndContext:h,frame:r.trim?Ut({canvas:h.canvas,width:o,height:a,resolution:1,output:Ce}):Ce.set(0,0,o,a)}}returnCanvasAndContext(t){Ft.N.returnCanvasAndContext(t)}_renderTextToCanvas(t,e,r,n,i){if(i.runsByLine&&i.runsByLine.length>0)return void this._renderTaggedTextToCanvas(i,t,e,r,n);const{canvas:s,context:o}=n,a=me(t),h=i.lines,l=i.lineHeight,u=i.lineWidths,c=i.maxLineWidth,d=i.fontProperties,f=s.height;if(o.resetTransform(),o.scale(r,r),o.textBaseline=t.textBaseline,t._stroke?.width){const e=t._stroke;o.lineWidth=e.width,o.miterLimit=e.miterLimit,o.lineJoin=e.join,o.lineCap=e.cap}let p,y;o.font=a;const m=t.dropShadow?2:1,g=t.wordWrap?Math.max(t.wordWrapWidth,c):c,x=(t._stroke?.width??0)/2;let v=(l-d.fontSize)/2;l-d.fontSize<0&&(v=0);for(let s=0;s<m;++s){const a=t.dropShadow&&0===s,c=a?Math.ceil(Math.max(1,f)+2*e):0,m=c*r;if(a)this._setupDropShadow(o,t,r,m);else{const r=t._gradientBounds,n=t._gradientOffset;if(r){const s={width:r.width,height:r.height,lineHeight:r.height,lines:i.lines};this._setFillAndStrokeStyles(o,t,s,e,x,n?.x??0,n?.y??0)}else n?this._setFillAndStrokeStyles(o,t,i,e,x,n.x,n.y):this._setFillAndStrokeStyles(o,t,i,e,x);o.shadowColor="rgba(0,0,0,0)"}for(let r=0;r<h.length;r++){p=x,y=x+r*l+d.ascent+v,p+=this._getAlignmentOffset(u[r],g,t.align);let i=0;if("justify"===t.align&&t.wordWrap&&r<h.length-1){const t=Me(h[r]);t>0&&(i=(g-u[r])/t)}t._stroke?.width&&this._drawLetterSpacing(h[r],t,n,p+e,y+e-c,!0,i),void 0!==t._fill&&this._drawLetterSpacing(h[r],t,n,p+e,y+e-c,!1,i)}}}_renderTaggedTextToCanvas(t,e,r,n,i){const{canvas:s,context:o}=i,{runsByLine:a,lineWidths:h,maxLineWidth:l,lineAscents:u,lineHeights:c,hasDropShadow:d}=t,f=s.height;o.resetTransform(),o.scale(n,n),o.textBaseline=e.textBaseline;const p=d?2:1,y=e.wordWrap?Math.max(e.wordWrapWidth,l):l;let m=e._stroke?.width??0;for(const t of a)for(const e of t){const t=e.style._stroke?.width??0;t>m&&(m=t)}const g=m/2,x=[];for(let t=0;t<a.length;t++){const e=a[t],r=[];for(const t of e){const e=me(t.style);o.font=e,r.push({width:pe._measureText(t.text,t.style.letterSpacing,o),font:e})}x.push(r)}for(let t=0;t<p;++t){const s=d&&0===t,l=s?Math.ceil(Math.max(1,f)+2*r):0,p=l*n;s||(o.shadowColor="rgba(0,0,0,0)");let m=g;for(let t=0;t<a.length;t++){const d=a[t],f=h[t],v=u[t],b=c[t],_=x[t];let w=g;w+=this._getAlignmentOffset(f,y,e.align);let S=0;if("justify"===e.align&&e.wordWrap&&t<a.length-1){let t=0;for(const e of d)t+=Me(e.text);t>0&&(S=(y-f)/t)}const C=m+v;let M=w+r;for(let t=0;t<d.length;t++){const e=d[t],{width:a,font:h}=_[t];if(o.font=h,o.textBaseline=e.style.textBaseline,e.style._stroke?.width){const t=e.style._stroke;if(o.lineWidth=t.width,o.miterLimit=t.miterLimit,o.lineJoin=t.join,o.lineCap=t.cap,s){if(!e.style.dropShadow){M+=a+Me(e.text)*S;continue}this._setupDropShadow(o,e.style,n,p)}else{const n=pe.measureFont(h),i=e.style.lineHeight||n.fontSize,s={width:a,height:i,lineHeight:i,lines:[e.text]};o.strokeStyle=Se(t,o,s,2*r,M-r,m)}this._drawLetterSpacing(e.text,e.style,i,M,C+r-l,!0,S)}M+=a+Me(e.text)*S}M=w+r;for(let t=0;t<d.length;t++){const e=d[t],{width:a,font:h}=_[t];if(o.font=h,o.textBaseline=e.style.textBaseline,void 0!==e.style._fill){if(s){if(!e.style.dropShadow){M+=a+Me(e.text)*S;continue}this._setupDropShadow(o,e.style,n,p)}else{const t=pe.measureFont(h),n=e.style.lineHeight||t.fontSize,i={width:a,height:n,lineHeight:n,lines:[e.text]};o.fillStyle=Se(e.style._fill,o,i,2*r,M-r,m)}this._drawLetterSpacing(e.text,e.style,i,M,C+r-l,!1,S)}M+=a+Me(e.text)*S}m+=b}}}_setFillAndStrokeStyles(t,e,r,n,i,s=0,o=0){if(t.fillStyle=e._fill?Se(e._fill,t,r,2*n,s,o):null,e._stroke?.width){const a=i+2*n;t.strokeStyle=Se(e._stroke,t,r,a,s,o)}}_setupDropShadow(t,e,r,n){t.fillStyle="black",t.strokeStyle="black";const i=e.dropShadow,s=i.color,o=i.alpha;t.shadowColor=Bt.Q.shared.setValue(s).setAlpha(o).toRgbaString();const a=i.blur*r,h=i.distance*r;t.shadowBlur=a,t.shadowOffsetX=Math.cos(i.angle)*h,t.shadowOffsetY=Math.sin(i.angle)*h+n}_getAlignmentOffset(t,e,r){return"right"===r?e-t:"center"===r?(e-t)/2:0}_drawLetterSpacing(t,e,r,n,i,s=!1,o=0){const{context:a}=r,h=e.letterSpacing;let l=!1;if(pe.experimentalLetterSpacingSupported&&(pe.experimentalLetterSpacing?(a.letterSpacing=`${h}px`,a.textLetterSpacing=`${h}px`,l=!0):(a.letterSpacing="0px",a.textLetterSpacing="0px")),(0===h||l)&&0===o)return void(s?a.strokeText(t,n,i):a.fillText(t,n,i));if(0!==o&&(0===h||l)){const e=t.split(" ");let r=n;const h=a.measureText(" ").width;for(let t=0;t<e.length;t++)s?a.strokeText(e[t],r,i):a.fillText(e[t],r,i),r+=a.measureText(e[t]).width+h+o;return}let u=n;const c=pe.graphemeSegmenter(t);let d=a.measureText(t).width,f=0;for(let t=0;t<c.length;++t){const e=c[t];s?a.strokeText(e,u,i):a.fillText(e,u,i);let r="";for(let e=t+1;e<c.length;++e)r+=c[e];f=a.measureText(r).width,u+=d-f+h," "===e&&(u+=o),d=f}}};var Ae=i(8875),ke=i(133),Pe=i(51),Ee=i(990);const Re=class t extends Ae.A{constructor(e={}){super(),this.uid=(0,ke.L)("textStyle"),this._tick=0,this._cachedFontString=null,function(t){const e=t;if("boolean"==typeof e.dropShadow&&e.dropShadow){const r=Ie.defaultDropShadow;t.dropShadow={alpha:e.dropShadowAlpha??r.alpha,angle:e.dropShadowAngle??r.angle,blur:e.dropShadowBlur??r.blur,color:e.dropShadowColor??r.color,distance:e.dropShadowDistance??r.distance}}if(void 0!==e.strokeThickness){(0,wt.t6)(wt.lj,"strokeThickness is now a part of stroke");const r=e.stroke;let n={};if(Bt.Q.isColorLike(r))n.color=r;else if(r instanceof be._||r instanceof _e.m)n.fill=r;else{if(!Object.hasOwnProperty.call(r,"color")&&!Object.hasOwnProperty.call(r,"fill"))throw new Error("Invalid stroke value.");n=r}t.stroke={...n,width:e.strokeThickness}}if(Array.isArray(e.fillGradientStops)){if((0,wt.t6)(wt.lj,"gradient fill is now a fill pattern: `new FillGradient(...)`"),!Array.isArray(e.fill)||0===e.fill.length)throw new Error("Invalid fill value. Expected an array of colors for gradient fill.");e.fill.length!==e.fillGradientStops.length&&(0,ve.R)("The number of fill colors must match the number of fill gradient stops.");const r=new be._({start:{x:0,y:0},end:{x:0,y:1},textureSpace:"local"}),n=e.fillGradientStops.slice(),i=e.fill.map((t=>Bt.Q.shared.setValue(t).toNumber()));n.forEach(((t,e)=>{r.addColorStop(t,i[e])})),t.fill={fill:r}}}(e);e instanceof t&&(e=e._toObject());const r={...t.defaultTextStyle,...e};for(const t in r){this[t]=r[t]}this._tagStyles=e.tagStyles??void 0,this.update(),this._tick=0}get align(){return this._align}set align(t){this._align!==t&&(this._align=t,this.update())}get breakWords(){return this._breakWords}set breakWords(t){this._breakWords!==t&&(this._breakWords=t,this.update())}get dropShadow(){return this._dropShadow}set dropShadow(e){this._dropShadow!==e&&(this._dropShadow=null!==e&&"object"==typeof e?this._createProxy({...t.defaultDropShadow,...e}):e?this._createProxy({...t.defaultDropShadow}):null,this.update())}get fontFamily(){return this._fontFamily}set fontFamily(t){this._fontFamily!==t&&(this._fontFamily=t,this.update())}get fontSize(){return this._fontSize}set fontSize(t){this._fontSize!==t&&(this._fontSize="string"==typeof t?parseInt(t,10):t,this.update())}get fontStyle(){return this._fontStyle}set fontStyle(t){this._fontStyle!==t&&(this._fontStyle=t.toLowerCase(),this.update())}get fontVariant(){return this._fontVariant}set fontVariant(t){this._fontVariant!==t&&(this._fontVariant=t,this.update())}get fontWeight(){return this._fontWeight}set fontWeight(t){this._fontWeight!==t&&(this._fontWeight=t,this.update())}get leading(){return this._leading}set leading(t){this._leading!==t&&(this._leading=t,this.update())}get letterSpacing(){return this._letterSpacing}set letterSpacing(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.update())}get lineHeight(){return this._lineHeight}set lineHeight(t){this._lineHeight!==t&&(this._lineHeight=t,this.update())}get padding(){return this._padding}set padding(t){this._padding!==t&&(this._padding=t,this.update())}get filters(){return this._filters}set filters(t){this._filters!==t&&(this._filters=Object.freeze(t),this.update())}get trim(){return this._trim}set trim(t){this._trim!==t&&(this._trim=t,this.update())}get textBaseline(){return this._textBaseline}set textBaseline(t){this._textBaseline!==t&&(this._textBaseline=t,this.update())}get whiteSpace(){return this._whiteSpace}set whiteSpace(t){this._whiteSpace!==t&&(this._whiteSpace=t,this.update())}get wordWrap(){return this._wordWrap}set wordWrap(t){this._wordWrap!==t&&(this._wordWrap=t,this.update())}get wordWrapWidth(){return this._wordWrapWidth}set wordWrapWidth(t){this._wordWrapWidth!==t&&(this._wordWrapWidth=t,this.update())}get fill(){return this._originalFill}set fill(t){t!==this._originalFill&&(this._originalFill=t,this._isFillStyle(t)&&(this._originalFill=this._createProxy({...Pe.T.defaultFillStyle,...t},(()=>{this._fill=(0,Ee.w)({...this._originalFill},Pe.T.defaultFillStyle)}))),this._fill=(0,Ee.w)(0===t?"black":t,Pe.T.defaultFillStyle),this.update())}get stroke(){return this._originalStroke}set stroke(t){t!==this._originalStroke&&(this._originalStroke=t,this._isFillStyle(t)&&(this._originalStroke=this._createProxy({...Pe.T.defaultStrokeStyle,...t},(()=>{this._stroke=(0,Ee.T)({...this._originalStroke},Pe.T.defaultStrokeStyle)}))),this._stroke=(0,Ee.T)(t,Pe.T.defaultStrokeStyle),this.update())}get tagStyles(){return this._tagStyles}set tagStyles(t){this._tagStyles!==t&&(this._tagStyles=t??void 0,this.update())}update(){this._tick++,this._cachedFontString=null,this.emit("update",this)}reset(){const e=t.defaultTextStyle;for(const t in e)this[t]=e[t]}assign(t){for(const e in t){this[e]=t[e]}return this}get styleKey(){return`${this.uid}-${this._tick}`}get _fontString(){return null===this._cachedFontString&&(this._cachedFontString=me(this)),this._cachedFontString}_toObject(){return{align:this.align,breakWords:this.breakWords,dropShadow:this._dropShadow?{...this._dropShadow}:null,fill:this._fill?{...this._fill}:void 0,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?{...this._stroke}:void 0,textBaseline:this.textBaseline,trim:this.trim,whiteSpace:this.whiteSpace,wordWrap:this.wordWrap,wordWrapWidth:this.wordWrapWidth,filters:this._filters?[...this._filters]:void 0,tagStyles:this._tagStyles?{...this._tagStyles}:void 0}}clone(){return new t(this._toObject())}_getFinalPadding(){let t=0;if(this._filters)for(let e=0;e<this._filters.length;e++)t+=this._filters[e].padding;return Math.max(this._padding,t)}destroy(t=!1){this.removeAllListeners();if("boolean"==typeof t?t:t?.texture){const e="boolean"==typeof t?t:t?.textureSource;this._fill?.texture&&this._fill.texture.destroy(e),this._originalFill?.texture&&this._originalFill.texture.destroy(e),this._stroke?.texture&&this._stroke.texture.destroy(e),this._originalStroke?.texture&&this._originalStroke.texture.destroy(e)}this._fill=null,this._stroke=null,this.dropShadow=null,this._originalStroke=null,this._originalFill=null}_createProxy(t,e){return new Proxy(t,{set:(t,r,n)=>(t[r]===n||(t[r]=n,e?.(r,n),this.update()),!0)})}_isFillStyle(t){return null!==(t??null)&&!(Bt.Q.isColorLike(t)||t instanceof be._||t instanceof _e.m)}};Re.defaultDropShadow={alpha:1,angle:Math.PI/6,blur:0,color:"black",distance:5},Re.defaultTextStyle={align:"left",breakWords:!1,dropShadow:null,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",leading:0,letterSpacing:0,lineHeight:0,padding:0,stroke:null,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100};let Ie=Re;var Oe=i(4334),Le=i(2048);var Be=i(8422);class De extends Be.K{}class Fe{constructor(t){this._renderer=t,t.runners.resolutionChange.add(this),this._managedTexts=new Oe.s({renderer:t,type:"renderable",onUnload:this.onTextUnload.bind(this),name:"canvasText"})}resolutionChange(){for(const t in this._managedTexts.items){const e=this._managedTexts.items[t];e?._autoResolution&&e.onViewUpdate()}}validateRenderable(t){const e=this._getGpuText(t),r=t.styleKey;return e.currentKey!==r||t._didTextUpdate}addRenderable(t,e){const r=this._getGpuText(t);if(t._didTextUpdate){const e=t._autoResolution?this._renderer.resolution:t.resolution;r.currentKey===t.styleKey&&t._resolution===e||this._updateGpuText(t),t._didTextUpdate=!1,function(t,e){const{texture:r,bounds:n}=t,i=e._style._getFinalPadding();(0,Le.y)(n,e._anchor,r);const s=e._anchor._x*i*2,o=e._anchor._y*i*2;n.minX-=i-s,n.minY-=i-o,n.maxX-=i-s,n.maxY-=i-o}(r,t)}this._renderer.renderPipes.batch.addToBatch(r,e)}updateRenderable(t){const e=this._getGpuText(t);e._batcher.updateElement(e)}_updateGpuText(t){const e=this._getGpuText(t);e.texture&&this._renderer.canvasText.decreaseReferenceCount(e.currentKey),t._resolution=t._autoResolution?this._renderer.resolution:t.resolution,e.texture=this._renderer.canvasText.getManagedTexture(t),e.currentKey=t.styleKey}_getGpuText(t){return t._gpuData[this._renderer.uid]||this.initGpuText(t)}initGpuText(t){const e=new De;return e.currentKey="--",e.renderable=t,e.transform=t.groupTransform,e.bounds={minX:0,maxX:1,minY:0,maxY:0},e.roundPixels=this._renderer._roundPixels|t._roundPixels,t._gpuData[this._renderer.uid]=e,this._managedTexts.add(t),e}onTextUnload(t){const e=t._gpuData[this._renderer.uid];if(!e)return;const{canvasText:r}=this._renderer;r.getReferenceCount(e.currentKey)>0?r.decreaseReferenceCount(e.currentKey):e.texture&&r.returnTexture(e.texture)}destroy(){this._managedTexts.destroy(),this._renderer=null}}Fe.extension={type:[ct.Ag.WebGLPipes,ct.Ag.WebGPUPipes,ct.Ag.CanvasPipes],name:"text"};var Ge=i(2437);const je=new(i(9636).c);class ze{constructor(t,e){this._activeTextures={},this._renderer=t,this._retainCanvasContext=e}getTexture(t,e,r,n){"string"==typeof t&&((0,wt.t6)("8.0.0","CanvasTextSystem.getTexture: Use object TextOptions instead of separate arguments"),t={text:t,style:r,resolution:e}),t.style instanceof Ie||(t.style=new Ie(t.style)),t.textureStyle instanceof Rt.n||(t.textureStyle=new Rt.n(t.textureStyle)),"string"!=typeof t.text&&(t.text=t.text.toString());const{text:i,style:s,textureStyle:o,autoGenerateMipmaps:a}=t,h=t.resolution??this._renderer.resolution,{frame:l,canvasAndContext:u}=Te.getCanvasAndContext({text:i,style:s,resolution:h}),c=function(t,e,r,n,i=!1){const s=je;s.minX=0,s.minY=0,s.maxX=t.width/n|0,s.maxY=t.height/n|0;const o=Ge.W.getOptimalTexture(s.width,s.height,n,!1,i);return o.source.uploadMethodId="image",o.source.resource=t,o.source.alphaMode="premultiply-alpha-on-upload",o.frame.width=e/n,o.frame.height=r/n,o.source.emit("update",o.source),o.updateUvs(),o}(u.canvas,l.width,l.height,h,a);if(o&&(c.source.style=o),s.trim&&(l.pad(s.padding),c.frame.copyFrom(l),c.frame.scale(1/h),c.updateUvs()),s.filters){const t=this._applyFilters(c,s.filters);return this.returnTexture(c),Te.returnCanvasAndContext(u),t}return this._renderer.texture.initSource(c._source),this._retainCanvasContext||Te.returnCanvasAndContext(u),c}returnTexture(t){const e=t.source,r=e.resource;if(this._retainCanvasContext&&r?.getContext){const t=r.getContext("2d");t&&Te.returnCanvasAndContext({canvas:r,context:t})}e.resource=null,e.uploadMethodId="unknown",e.alphaMode="no-premultiply-alpha",Ge.W.returnTexture(t,!0)}renderTextToCanvas(){(0,wt.t6)("8.10.0","CanvasTextSystem.renderTextToCanvas: no longer supported, use CanvasTextSystem.getTexture instead")}getManagedTexture(t){t._resolution=t._autoResolution?this._renderer.resolution:t.resolution;const e=t.styleKey;if(this._activeTextures[e])return this._increaseReferenceCount(e),this._activeTextures[e].texture;const r=this.getTexture({text:t.text,style:t.style,resolution:t._resolution,textureStyle:t.textureStyle,autoGenerateMipmaps:t.autoGenerateMipmaps});return this._activeTextures[e]={texture:r,usageCount:1},r}decreaseReferenceCount(t){const e=this._activeTextures[t];e&&(e.usageCount--,0===e.usageCount&&(this.returnTexture(e.texture),this._activeTextures[t]=null))}getReferenceCount(t){return this._activeTextures[t]?.usageCount??0}_increaseReferenceCount(t){this._activeTextures[t].usageCount++}_applyFilters(t,e){const r=this._renderer.renderTarget.renderTarget,n=this._renderer.filter.generateFilteredTexture({texture:t,filters:e});return this._renderer.renderTarget.bind(r,!1),n}destroy(){this._renderer=null;for(const t in this._activeTextures)this._activeTextures[t]&&this.returnTexture(this._activeTextures[t].texture);this._activeTextures=null}}class Ne extends ze{constructor(t){super(t,!0)}}Ne.extension={type:[ct.Ag.CanvasSystem],name:"canvasText"};class We extends ze{constructor(t){super(t,!1)}}We.extension={type:[ct.Ag.WebGLSystem,ct.Ag.WebGPUSystem],name:"canvasText"},ct.XO.add(Ne),ct.XO.add(We),ct.XO.add(Fe);class Ue extends Lt{constructor(...t){const e=function(t,e){let r=t[0]??{};return("string"==typeof r||t[1])&&((0,wt.t6)(wt.lj,`use new ${e}({ text: "hi!", style }) instead`),r={text:r,style:t[1]}),r}(t,"Text");super(e,Ie),this.renderPipeId="text",e.textureStyle&&(this.textureStyle=e.textureStyle instanceof Rt.n?e.textureStyle:new Rt.n(e.textureStyle)),this.autoGenerateMipmaps=e.autoGenerateMipmaps??Et.v.defaultOptions.autoGenerateMipmaps}updateBounds(){const t=this._bounds,e=this._anchor;let r=0,n=0;if(this._style.trim){const{frame:t,canvasAndContext:e}=Te.getCanvasAndContext({text:this.text,style:this._style,resolution:1});Te.returnCanvasAndContext(e),r=t.width,n=t.height}else{const t=pe.measureText(this._text,this._style);r=t.width,n=t.height}t.minX=-e._x*r,t.maxX=t.minX+r,t.minY=-e._y*n,t.maxY=t.minY+n}}function Xe(t){return Xe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xe(t)}function Ye(){Ye=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},s="function"==typeof Symbol?Symbol:{},o=s.iterator||"@@iterator",a=s.asyncIterator||"@@asyncIterator",h=s.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var s=e&&e.prototype instanceof g?e:g,o=Object.create(s.prototype),a=new E(n||[]);return i(o,"_invoke",{value:T(t,r,a)}),o}function c(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var d="suspendedStart",f="suspendedYield",p="executing",y="completed",m={};function g(){}function x(){}function v(){}var b={};l(b,o,(function(){return this}));var _=Object.getPrototypeOf,w=_&&_(_(R([])));w&&w!==r&&n.call(w,o)&&(b=w);var S=v.prototype=g.prototype=Object.create(b);function C(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function M(t,e){function r(i,s,o,a){var h=c(t[i],t,s);if("throw"!==h.type){var l=h.arg,u=l.value;return u&&"object"==Xe(u)&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,o,a)}),(function(t){r("throw",t,o,a)})):e.resolve(u).then((function(t){l.value=t,o(l)}),(function(t){return r("throw",t,o,a)}))}a(h.arg)}var s;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return s=s?s.then(i,i):i()}})}function T(e,r,n){var i=d;return function(s,o){if(i===p)throw Error("Generator is already running");if(i===y){if("throw"===s)throw o;return{value:t,done:!0}}for(n.method=s,n.arg=o;;){var a=n.delegate;if(a){var h=A(a,n);if(h){if(h===m)continue;return h}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===d)throw i=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=p;var l=c(e,r,n);if("normal"===l.type){if(i=n.done?y:f,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=y,n.method="throw",n.arg=l.arg)}}}function A(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,A(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var s=c(i,e.iterator,r.arg);if("throw"===s.type)return r.method="throw",r.arg=s.arg,r.delegate=null,m;var o=s.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function R(e){if(e||""===e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,s=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return s.next=s}}throw new TypeError(Xe(e)+" is not iterable")}return x.prototype=v,i(S,"constructor",{value:v,configurable:!0}),i(v,"constructor",{value:x,configurable:!0}),x.displayName=l(v,h,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===x||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,l(t,h,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},C(M.prototype),l(M.prototype,a,(function(){return this})),e.AsyncIterator=M,e.async=function(t,r,n,i,s){void 0===s&&(s=Promise);var o=new M(u(t,r,n,i),s);return e.isGeneratorFunction(r)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},C(S),l(S,h,"Generator"),l(S,o,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=R,E.prototype={constructor:E,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return a.type="throw",a.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var s=this.tryEntries.length-1;s>=0;--s){var o=this.tryEntries[s],a=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var h=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(h&&l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(h){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var s=i;break}}s&&("break"===t||"continue"===t)&&s.tryLoc<=e&&e<=s.finallyLoc&&(s=null);var o=s?s.completion:{};return o.type=t,o.arg=e,s?(this.method="next",this.next=s.finallyLoc,m):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;P(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:R(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function Ve(t,e,r,n,i,s,o){try{var a=t[s](o),h=a.value}catch(t){return void r(t)}a.done?e(h):Promise.resolve(h).then(n,i)}function He(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var s=t.apply(e,r);function o(t){Ve(s,n,i,o,a,"next",t)}function a(t){Ve(s,n,i,o,a,"throw",t)}o(void 0)}))}}function $e(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,qe(n.key),n)}}function qe(t){var e=function(t,e){if("object"!=Xe(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Xe(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Xe(e)?e:e+""}ct.XO.add(dt,ft);var Ke=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.container=e,this.selectedNodes=new Set,this.isSelecting=!1,this.selectionStart=null,this.selectionBox=null,this.isCtrlPressed=!1,this.mode=null,this.graphicsMap=new Map,this.dragging=!1,this.lastPos=null,this.pointers=new Map,this.lastDist=null,this.minScale=.1,this.maxScale=10,this.onBackgroundPointerDown=null,this.activeDrag=null,this._initKeyboard()}return e=t,r=[{key:"_initPixi",value:(s=He(Ye().mark((function t(){var e=this;return Ye().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.app=new kt,this.app.stage.eventMode="static",t.next=4,this.app.init({resizeTo:this.container,background:1973790});case 4:this.container.appendChild(this.app.canvas),this._initInfoWindow(),this.world=new bt.mc,this.app.stage.addChild(this.world),this._initResizeObserver(),this._initPointers(),this._initWheelZoom(),this._initPinchZoom(),this._onGlobalMove=function(t){var r=e.activeDrag;if(r&&r.dragData){var n=r.nodeRef,i=e.app.canvas.getBoundingClientRect(),s=t.clientX-i.left,o=t.clientY-i.top,a=e.screenToWorld(s,o);n.x=a.x,n.y=a.y}},this._onGlobalUp=function(t){var r=e.activeDrag;if(r){var n,i=r.nodeRef;r._dragging||(r._ctrlOnDown?e.selectedNodes.has(i)?e.selectedNodes.delete(i):e.selectedNodes.add(i):(e.selectedNodes.clear(),e.selectedNodes.add(i)),null===(n=e.onSelectionChange)||void 0===n||n.call(e,Array.from(e.selectedNodes))),r.dragData=null,r._ctrlOnDown=!1,r._dragging=!1,e.lockPan=!1,e.activeDrag=null}},window.addEventListener("pointermove",this._onGlobalMove),window.addEventListener("pointerup",this._onGlobalUp);case 16:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"_initKeyboard",value:function(){var t=this;window.addEventListener("keydown",(function(e){(e.ctrlKey||e.metaKey)&&(t.isCtrlPressed=!0)})),window.addEventListener("keyup",(function(e){e.ctrlKey||e.metaKey||(t.isCtrlPressed=!1)}))}},{key:"_initResizeObserver",value:function(){var t=this;this.resizeObserver=new ResizeObserver((function(){t.width=t.container.clientWidth,t.height=t.container.clientHeight;var e=t.screenToWorld(t.width/2,t.height/2);t.app.renderer.resize(t.width,t.height),t.center(e.x,e.y)})),this.resizeObserver.observe(this.container)}},{key:"_createOrUpdateLabel",value:function(t,e){var r=t.id+"_label",n=this.graphicsMap.get(r),i=t.label||"attractor";if(!n){var s=new Ie({fill:"#ffffff",fontSize:12,align:"center",wordWrap:!0,wordWrapWidth:1.6*e});(n=new Ue({text:i,style:s})).anchor.set(.5),n.eventMode="none",this.world.addChild(n),this.graphicsMap.set(r,n)}return n.text!==i&&(n.text=i),n.x=t.x,n.y=t.y,n}},{key:"_createSelectionBox",value:function(){var t=new Pt.A;return this.world.addChild(t),t}},{key:"getWorldBounds",value:function(){var t=this.app.canvas,e=this.screenToWorld(0,0),r=this.screenToWorld(t.width,t.height);return{minX:e.x,minY:e.y,maxX:r.x,maxY:r.y}}},{key:"add",value:function(t){this.world.addChild(t)}},{key:"screenToWorld",value:function(t,e){return{x:(t-this.world.x)/this.world.scale.x,y:(e-this.world.y)/this.world.scale.y}}},{key:"center",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=this.app.screen.width,n=this.app.screen.height;this.world.x=r/2-t*this.world.scale.x,this.world.y=n/2-e*this.world.scale.y}},{key:"_initPointers",value:function(){var t=this,e=this.app.canvas,r=function(e){t.pointers.delete(e.pointerId),t.pointers.size<2&&(t.lastDist=null),0===t.pointers.size&&(t.dragging=!1,t.mode=null)};e.addEventListener("pointerdown",(function(r){var n;if(t.pointers.set(r.pointerId,r),r.target===e){null===(n=t.onBackgroundPointerDown)||void 0===n||n.call(t);var i=t.screenToWorld(r.offsetX,r.offsetY);t.isCtrlPressed?(t.mode="select",t.isSelecting=!0,t.selectionStart=i,t.selectionBox=t._createSelectionBox()):(t.mode="pan",t.dragging=!0,t.lastPos={x:r.clientX,y:r.clientY})}})),e.addEventListener("pointermove",(function(e){if("select"===t.mode&&t.isSelecting){var r=t.screenToWorld(e.offsetX,e.offsetY),n=Math.min(t.selectionStart.x,r.x),i=Math.min(t.selectionStart.y,r.y),s=Math.abs(r.x-t.selectionStart.x),o=Math.abs(r.y-t.selectionStart.y);t.selectionBox.clear().rect(n,i,s,o).stroke({width:1,color:16777215}).fill({color:16777215,alpha:.1})}else if("pan"===t.mode&&t.dragging&&1===t.pointers.size&&!t.lockPan){var a=e.clientX-t.lastPos.x,h=e.clientY-t.lastPos.y;t.world.x+=a,t.world.y+=h,t.lastPos={x:e.clientX,y:e.clientY}}})),e.addEventListener("pointerup",(function(e){if("select"===t.mode&&t.isSelecting){var n,i=t.screenToWorld(e.offsetX,e.offsetY),s=Math.min(t.selectionStart.x,i.x),o=Math.max(t.selectionStart.x,i.x),a=Math.min(t.selectionStart.y,i.y),h=Math.max(t.selectionStart.y,i.y);t.isCtrlPressed||t.selectedNodes.clear(),t.graphicsMap.forEach((function(e){var r=e.nodeRef;if(r){var n=r.radius||20;r.x+n>=s&&r.x-n<=o&&r.y+n>=a&&r.y-n<=h&&t.selectedNodes.add(r)}})),null===(n=t.onSelectionChange)||void 0===n||n.call(t,Array.from(t.selectedNodes)),t.world.removeChild(t.selectionBox),t.selectionBox.destroy(),t.selectionBox=null,t.isSelecting=!1}"pan"===t.mode&&(t.dragging=!1),t.mode=null,r(e)})),e.addEventListener("pointerupoutside",r),e.addEventListener("pointercancel",r),e.addEventListener("pointerleave",r)}},{key:"_initWheelZoom",value:function(){var t=this,e=this.app.canvas;e.addEventListener("wheel",(function(r){r.preventDefault();var n=e.getBoundingClientRect(),i=r.clientX-n.left,s=r.clientY-n.top,o=r.deltaY>0?1/1.1:1.1,a=t.screenToWorld(i,s);t.world.scale.x*=o,t.world.scale.y*=o,t.world.scale.x=Math.max(t.minScale,Math.min(t.maxScale,t.world.scale.x)),t.world.scale.y=Math.max(t.minScale,Math.min(t.maxScale,t.world.scale.y)),t.world.x=i-a.x*t.world.scale.x,t.world.y=s-a.y*t.world.scale.y}),{passive:!1})}},{key:"_initPinchZoom",value:function(){var t=this;this.app.canvas.addEventListener("pointermove",(function(e){if(t.pointers.has(e.pointerId)&&(t.pointers.set(e.pointerId,e),2===t.pointers.size)){var r=Array.from(t.pointers.values()),n=r[0],i=r[1],s=(n.clientX+i.clientX)/2,o=(n.clientY+i.clientY)/2,a=n.clientX-i.clientX,h=n.clientY-i.clientY,l=Math.sqrt(a*a+h*h);if(!t.lastDist)return void(t.lastDist=l);var u=l/t.lastDist,c=t.screenToWorld(s,o);t.world.scale.x*=u,t.world.scale.y*=u,t.world.scale.x=Math.max(t.minScale,Math.min(t.maxScale,t.world.scale.x)),t.world.scale.y=Math.max(t.minScale,Math.min(t.maxScale,t.world.scale.y)),t.world.x=s-c.x*t.world.scale.x,t.world.y=o-c.y*t.world.scale.y,t.lastDist=l}}))}},{key:"createCircle",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.x,r=void 0===e?0:e,n=t.y,i=void 0===n?0:n,s=t.radius,o=void 0===s?50:s,a=t.color,h=void 0===a?16711680:a,l=t.node,u=void 0===l?null:l,c=(new Pt.A).circle(0,0,o).fill(h);return c.eventMode="static",c.cursor="pointer",c.nodeRef=u,c.x=r,c.y=i,this.world.addChild(c),c}},{key:"renderGraph",value:function(t){var e=this,r=new Set(t.getNodes().map((function(t){return t.id})));this.graphicsMap.forEach((function(t,n){var i=n.replace("_label","").replace("_axis","");r.has(i)||(t.parent&&t.parent.removeChild(t),t.destroy(),e.graphicsMap.delete(n))})),t.getNodes().forEach((function(t){var r=e.graphicsMap.get(t.id);if("vector"===t.type){var n=t.id+"_axis",i=e.graphicsMap.get(n),s=t.direction.x*t.length,o=t.direction.y*t.length,a=Math.atan2(o,s),h=Math.sqrt(s*s+o*o);return i||(i=new Pt.A,e.world.addChild(i),e.graphicsMap.set(n,i),i.eventMode="static",i.cursor="pointer",i.nodeRef=t,e._bindNodeEvents(i)),i.clear().rect(-h/2,-5,h,10).fill(16755200),i.x=t.x,i.y=t.y,void(i.rotation=a)}var l="planet"===t.type?40:10;r||(r=e.createCircle({x:t.x,y:t.y,radius:l,color:"planet"===t.type?16763904:52479,node:t}),e._bindNodeEvents(r),e.graphicsMap.set(t.id,r)),r.x=t.x,r.y=t.y,"planet"===t.type&&e._createOrUpdateLabel(t,l);var u=e.selectedNodes.has(t);r.tint=u?16729156:"planet"===t.type?16763904:52479}))}},{key:"toWorld",value:function(t,e){return this.screenToWorld(t,e)}},{key:"_bindNodeEvents",value:function(t){var e=this,r=!1,n=null;t.on("rightclick",(function(r){var n;console.log("click derecho");var i=t.nodeRef,s=(e.app.canvas.getBoundingClientRect(),r.global.x),o=r.global.y,a=e.screenToWorld(s,o);null===(n=e.onNodeRightClick)||void 0===n||n.call(e,{node:i,global:{x:s,y:o},world:a})})),t.on("pointerdown",(function(r){var i=2===r.data.button;i||r.stopPropagation(),i||(n={x:r.global.x,y:r.global.y},t.dragData=r.data,e.activeDrag=t,t._ctrlOnDown=e.isCtrlPressed,t._dragging=!1)})),t.on("pointermove",(function(i){if(n){i.stopPropagation();var s=i.global.x-n.x,o=i.global.y-n.y,a=Math.sqrt(s*s+o*o);if(!r&&a>5&&(r=!0,e.lockPan=!0),r){var h=t.nodeRef,l=t.dragData.getLocalPosition(e.world);h.x=l.x,h.y=l.y}}}));var i=function(i){var s;if(n){i.stopPropagation();var o=t.nodeRef;if(null!==(s=t._captureTarget)&&void 0!==s&&s.releasePointerCapture)try{t._captureTarget.releasePointerCapture(t._pointerId)}catch(t){}if(t._captureTarget=null,t._pointerId=null,!r){var a,h,l=t._ctrlOnDown;null===(a=e.onNodeClick)||void 0===a||a.call(e,{node:o,global:{x:i.global.x,y:i.global.y},world:e.screenToWorld(i.global.x,i.global.y)}),l?e.selectedNodes.has(o)?e.selectedNodes.delete(o):e.selectedNodes.add(o):(e.selectedNodes.clear(),e.selectedNodes.add(o)),null===(h=e.onSelectionChange)||void 0===h||h.call(e,Array.from(e.selectedNodes))}r=!1,n=null,e.lockPan=!1,t.dragData=null,t._ctrlOnDown=!1,e.activeDrag===t&&(e.activeDrag=null)}};t.on("pointerup",i),t.on("pointerupoutside",i)}},{key:"_initInfoWindow",value:function(){var t=this,e=this.container,r=document.createElement("div");r.className="info-window",r.style.position="absolute",r.style.top="0",r.style.right="0",r.style.width="250px",r.style.height="100%",r.style.background="rgba(30, 30, 30, 0.85)",r.style.color="#fff",r.style.padding="12px",r.style.boxSizing="border-box",r.style.backdropFilter="blur(6px)",r.style.borderLeft="1px solid rgba(255,255,255,0.1)",r.style.display="none",r.style.zIndex=999,r.style.position="absolute";var n=document.createElement("div");n.textContent="✕",n.style.position="absolute",n.style.top="8px",n.style.right="10px",n.style.cursor="pointer",n.style.fontSize="14px",n.style.opacity="0.7",n.style.padding="2px 6px",n.style.borderRadius="4px",n.style.transition="all 0.15s",n.addEventListener("mouseenter",(function(){n.style.background="#444",n.style.opacity="1"})),n.addEventListener("mouseleave",(function(){n.style.background="transparent",n.style.opacity="0.7"})),n.addEventListener("click",(function(){t.hideInfoWindow()})),r.appendChild(n);var i=document.createElement("div");i.style.marginTop="24px",r.appendChild(i),this._infoWindow=r,this._infoContent=i,"static"===window.getComputedStyle(e).position&&(e.style.position="relative"),e.appendChild(r)}},{key:"showInfoWindow",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this._infoWindow&&(this._infoWindow.style.display="block",t&&(this._infoContent.innerHTML=t))}},{key:"showInfoWindowWithDrag",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if(this._infoWindow){this._infoWindow.style.display="block",this._infoContent.innerHTML="";var r=document.createElement("div");r.textContent="⠿ Drag selection",r.draggable=!0,r.style.cursor="grab",r.style.padding="6px 8px",r.style.marginBottom="8px",r.style.background="#3a3a3a",r.style.borderRadius="6px",r.style.fontSize="12px",r.style.textAlign="center",r.addEventListener("dragstart",(function(e){var n={type:"graph-nodes",data:Array.from(t.selectedNodes).map((function(t){return t.data}))},i=JSON.stringify(n);e.dataTransfer.setData("application/json",i),e.dataTransfer.setData("text/plain",i),r.style.opacity="0.5"})),r.addEventListener("dragend",(function(){r.style.opacity="1"})),this._infoContent.appendChild(r);var n=document.createElement("div");n.innerHTML=e,this._infoContent.appendChild(n)}}},{key:"hideInfoWindow",value:function(){this._infoWindow&&(this._infoWindow.style.display="none")}},{key:"getInfoWindow",value:function(){return this._infoWindow}},{key:"clearInfoWindow",value:function(){this._infoContent&&(this._infoContent.innerHTML="")}}],n=[{key:"create",value:(i=He(Ye().mark((function e(r){var n;return Ye().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=new t(r),e.next=3,n._initPixi();case 3:return e.abrupt("return",n);case 4:case"end":return e.stop()}}),e)}))),function(t){return i.apply(this,arguments)})}],r&&$e(e.prototype,r),n&&$e(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n,i,s}();function Ze(t){return Ze="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ze(t)}function Qe(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Je(n.key),n)}}function Je(t){var e=function(t,e){if("object"!=Ze(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Ze(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Ze(e)?e:e+""}var tr=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.nodes=new Map,this.edges=[]},(e=[{key:"addNode",value:function(t){this.nodes.set(t.id,{id:t.id,type:t.type||"moon",x:t.x||0,y:t.y||0,vx:0,vy:0,data:t.data||{},rule:t.rule||null})}},{key:"addMoon",value:function(t){var e=t.id,r=t.x,n=t.y,i=t.data;this.nodes.set(e,{id:e,type:"moon",x:r,y:n,vx:0,vy:0,data:i})}},{key:"addPlanet",value:function(t){var e=t.id,r=t.x,n=t.y,i=t.rule,s=t.scalarField,o=t.label;this.nodes.set(e,{id:e,type:"planet",x:r,y:n,vx:0,vy:0,rule:i,scalarField:s,label:o})}},{key:"addVector",value:function(t){var e=t.id,r=t.x,n=t.y,i=t.direction,s=t.length,o=t.scalarField,a=t.rule,h=Math.sqrt(Math.pow(i.x,2)+Math.pow(i.y,2))||1,l={x:i.x/h,y:i.y/h};this.nodes.set(e,{id:e,type:"vector",vector:!0,x:r,y:n,direction:l,length:s||200,scalarField:o,rule:a,vx:0,vy:0})}},{key:"addEdge",value:function(t,e){this.edges.push({source:t,target:e})}},{key:"getNode",value:function(t){return this.nodes.get(t)}},{key:"getNodes",value:function(){return Array.from(this.nodes.values())}},{key:"deleteNode",value:function(t){this.nodes.delete(t),this.edges=this.edges.filter((function(e){return e.source!==t&&e.target!==t}))}}])&&Qe(t.prototype,e),r&&Qe(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function er(t){return er="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},er(t)}function rr(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,s,o,a=[],h=!0,l=!1;try{if(s=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;h=!1}else for(;!(h=(n=s.call(r)).done)&&(a.push(n.value),a.length!==e);h=!0);}catch(t){l=!0,i=t}finally{try{if(!h&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(l)throw i}}return a}}(t,e)||function(t,e){if(t){if("string"==typeof t)return nr(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?nr(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function nr(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function ir(){ir=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},s="function"==typeof Symbol?Symbol:{},o=s.iterator||"@@iterator",a=s.asyncIterator||"@@asyncIterator",h=s.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var s=e&&e.prototype instanceof g?e:g,o=Object.create(s.prototype),a=new E(n||[]);return i(o,"_invoke",{value:T(t,r,a)}),o}function c(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var d="suspendedStart",f="suspendedYield",p="executing",y="completed",m={};function g(){}function x(){}function v(){}var b={};l(b,o,(function(){return this}));var _=Object.getPrototypeOf,w=_&&_(_(R([])));w&&w!==r&&n.call(w,o)&&(b=w);var S=v.prototype=g.prototype=Object.create(b);function C(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function M(t,e){function r(i,s,o,a){var h=c(t[i],t,s);if("throw"!==h.type){var l=h.arg,u=l.value;return u&&"object"==er(u)&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,o,a)}),(function(t){r("throw",t,o,a)})):e.resolve(u).then((function(t){l.value=t,o(l)}),(function(t){return r("throw",t,o,a)}))}a(h.arg)}var s;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return s=s?s.then(i,i):i()}})}function T(e,r,n){var i=d;return function(s,o){if(i===p)throw Error("Generator is already running");if(i===y){if("throw"===s)throw o;return{value:t,done:!0}}for(n.method=s,n.arg=o;;){var a=n.delegate;if(a){var h=A(a,n);if(h){if(h===m)continue;return h}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===d)throw i=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=p;var l=c(e,r,n);if("normal"===l.type){if(i=n.done?y:f,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=y,n.method="throw",n.arg=l.arg)}}}function A(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,A(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var s=c(i,e.iterator,r.arg);if("throw"===s.type)return r.method="throw",r.arg=s.arg,r.delegate=null,m;var o=s.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function R(e){if(e||""===e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,s=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return s.next=s}}throw new TypeError(er(e)+" is not iterable")}return x.prototype=v,i(S,"constructor",{value:v,configurable:!0}),i(v,"constructor",{value:x,configurable:!0}),x.displayName=l(v,h,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===x||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,l(t,h,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},C(M.prototype),l(M.prototype,a,(function(){return this})),e.AsyncIterator=M,e.async=function(t,r,n,i,s){void 0===s&&(s=Promise);var o=new M(u(t,r,n,i),s);return e.isGeneratorFunction(r)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},C(S),l(S,h,"Generator"),l(S,o,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=R,E.prototype={constructor:E,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return a.type="throw",a.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var s=this.tryEntries.length-1;s>=0;--s){var o=this.tryEntries[s],a=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var h=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(h&&l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(h){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var s=i;break}}s&&("break"===t||"continue"===t)&&s.tryLoc<=e&&e<=s.finallyLoc&&(s=null);var o=s?s.completion:{};return o.type=t,o.arg=e,s?(this.method="next",this.next=s.finallyLoc,m):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;P(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:R(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function sr(t,e,r,n,i,s,o){try{var a=t[s](o),h=a.value}catch(t){return void r(t)}a.done?e(h):Promise.resolve(h).then(n,i)}function or(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var s=t.apply(e,r);function o(t){sr(s,n,i,o,a,"next",t)}function a(t){sr(s,n,i,o,a,"throw",t)}o(void 0)}))}}function ar(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,hr(n.key),n)}}function hr(t){var e=function(t,e){if("object"!=er(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=er(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==er(e)?e:e+""}var lr=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.container=e.contentContainer,this.algorithms={rule:g,rule_fast:M,gravity:ot,orbits:tt,spiral:H,spiral_no:O,vertical:z}}return e=t,r=[{key:"_init",value:(s=or(ir().mark((function t(){var e=this;return ir().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Ke.create(this.container);case 2:this.view=t.sent,this.view.app.renderer.events.cursorStyles.default="default",this.view.app.renderer.events.domElement.addEventListener("contextmenu",(function(t){t.preventDefault()})),this.model=new tr,this.controller=new ut(this.view,this.model),this.controller.main=this,this._enableDrop(),this.algo=new ot,this.algo.setModel(this.model),this.view.app.ticker.add((function(){e.algo.bounds=e.view.getWorldBounds(),e.algo.model.viewportWidth=e.view.width,e.algo.model.viewportHeight=e.view.height,e.algo.step(),e.view.renderGraph(e.model)}));case 12:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"setAlgorithm",value:function(t){this.algo=t}},{key:"addMoonData",value:function(t){var e=t.id,r=t.x,n=t.y,i=t.data,s=void 0===i?{}:i,o=t.fixed,a=void 0!==o&&o;if(this.model&&this.view){var h=this.view.app.screen.width,l=this.view.app.screen.height,u=void 0!==r?r:Math.random()*h,c=void 0!==n?n:Math.random()*l;this.model.addMoon({id:e,x:u,y:c,data:s,fixed:a}),this.view.renderGraph(this.model)}}},{key:"addRandomMoons",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,e=["male","female"],r=["a","b","c"],n=0;n<t;n++){var i=crypto.randomUUID(),s=e[Math.floor(Math.random()*e.length)],o=Math.floor(80*Math.random())+1,a=r[Math.floor(Math.random()*r.length)];this.addMoonData({id:i,data:{sex:s,age:o,class:a}})}}},{key:"_dropDataset",value:function(t,e){var r=this;t.forEach((function(t,n){var i=t.id||"moon_".concat(Date.now(),"_").concat(n),s=Math.random()*Math.PI*2,o=200*Math.random(),a=e.x+Math.cos(s)*o,h=e.y+Math.sin(s)*o;r.model.addMoon({id:i,x:a,y:h,data:t})}))}},{key:"_setAlgorithmByName",value:function(t){var e=this.algorithms[t];if(e){var r=new e;r.setModel(this.model),this.setAlgorithm(r)}else console.warn("Unknown algorithm:",t)}},{key:"_enableDrop",value:function(){var t=this,e=this.view.app.view;e.addEventListener("dragover",(function(t){return t.preventDefault()})),e.addEventListener("drop",(function(r){r.preventDefault();var n=e.getBoundingClientRect(),i=r.clientX-n.left,s=r.clientY-n.top,o=t.view.toWorld(i,s),a=r.dataTransfer.getData("application/json");if(a){var h=JSON.parse(a);if("table"!==h.type)if("algorithm"!==h.type){if("planet"===h.type){var u=l.build(h.rule);t.model.addPlanet({id:"p_"+Date.now(),x:o.x,y:o.y,rule:u,label:h.label,scalarField:h.scalarField})}if("vector"===h.type){console.log("vector a aplicar: ",h);var c=l.build(h.rule);t.model.addVector({id:"p_"+Date.now(),x:o.x,y:o.y,direction:h.direction,length:h.length,scalarField:h.scalarField,rule:c})}}else t._setAlgorithmByName(h.name);else t._dropDataset(h.data,o)}}))}},{key:"getFormatedNode",value:function(t){var e=Object.entries(t);return'\n <h3 style="margin-top:0">'.concat(t.nombre||t.name||t.label||"Node",'</h3>\n <div style="font-size:12px; line-height:1.4">\n ').concat(e.map((function(t){var e,r=rr(t,2),n=r[0],i=r[1];return'\n <div style="display:flex; justify-content:space-between; margin-bottom:4px;">\n <span style="opacity:0.7">'.concat(n,'</span>\n <span style="text-align:right; margin-left:10px;">').concat(null==(e=i)||""===e||"NULL"===e?"<span style='opacity:0.5'>—</span>":e,"</span>\n </div>\n ")})).join(""),"\n </div>\n ")}}],n=[{key:"create",value:(i=or(ir().mark((function e(r){var n;return ir().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=new t(r),e.next=3,n._init();case 3:return e.abrupt("return",n);case 4:case"end":return e.stop()}}),e)}))),function(t){return i.apply(this,arguments)})}],r&&ar(e.prototype,r),n&&ar(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n,i,s}();function ur(t){return ur="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ur(t)}function cr(t){return function(t){if(Array.isArray(t))return dr(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return dr(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?dr(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function dr(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function fr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,pr(n.key),n)}}function pr(t){var e=function(t,e){if("object"!=ur(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=ur(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==ur(e)?e:e+""}var yr=function(){return t=function t(e){if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),!e)throw new Error("Container is required");this.container=e,this.placeholderText="DROP JSON HERE",this._initDrop(),this._renderBase()},e=[{key:"_renderBase",value:function(){this.container.innerHTML="",this._createToolbox(),this._createPlaceholder(),this._showPlaceholder(),Object.assign(this.container.style,{position:"relative",border:"2px dashed #ccc",minHeight:"120px"})}},{key:"_createToolbox",value:function(){var t=this;this.toolbox=document.createElement("div"),Object.assign(this.toolbox.style,{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"8px",borderBottom:"1px solid #ddd",background:"#f9f9f9"}),this.counter=document.createElement("div"),this.counter.textContent="Records: 0",Object.assign(this.counter.style,{fontFamily:"sans-serif",fontSize:"13px",color:"#555"});var e=document.createElement("div");this.clearBtn=document.createElement("button"),this.clearBtn.textContent="Clear",this.clearBtn.disabled=!0,this.clearBtn.addEventListener("click",(function(){t._renderBase()})),e.appendChild(this.clearBtn),this.toolbox.appendChild(this.counter),this.toolbox.appendChild(e),this.container.appendChild(this.toolbox)}},{key:"_createPlaceholder",value:function(){this.placeholder=document.createElement("div"),this.placeholder.textContent=this.placeholderText,Object.assign(this.placeholder.style,{position:"absolute",top:"60%",left:"50%",transform:"translate(-50%, -50%)",color:"#888",fontFamily:"sans-serif",pointerEvents:"none",userSelect:"none"}),this.container.appendChild(this.placeholder)}},{key:"_showPlaceholder",value:function(){this.placeholder&&(this.placeholder.style.display="block")}},{key:"_hidePlaceholder",value:function(){this.placeholder&&(this.placeholder.style.display="none")}},{key:"_initDrop",value:function(){var t=this;this.container.addEventListener("dragover",(function(e){e.preventDefault(),t.container.style.background="#f0f8ff"})),this.container.addEventListener("dragleave",(function(){t.container.style.background=""})),this.container.addEventListener("drop",(function(e){e.preventDefault(),t.container.style.background="";var r=e.dataTransfer.getData("application/json")||e.dataTransfer.getData("text/plain");if(r)try{var n=JSON.parse(r).data;Array.isArray(n)?t.render(n):t._showPlaceholder()}catch(e){console.error("Invalid JSON dropped",e),t._showPlaceholder()}else t._showPlaceholder()}))}},{key:"render",value:function(t){var e=this;if(Array.isArray(t)&&0!==t.length){this.data=t,this.container.innerHTML="",this._createToolbox(),this._createPlaceholder(),this._hidePlaceholder(),this.clearBtn.disabled=!1,this.counter.textContent="Records: ".concat(t.length);var r=document.createElement("table");Object.assign(r.style,{borderCollapse:"separate",borderSpacing:"0 4px",width:"100%",fontFamily:"sans-serif",fontSize:"14px"});var n=document.createElement("thead"),i=document.createElement("tr");["Field","# Variants","Values","Attractor","Split UP","Split Right","Histogram"].forEach((function(t){var e=document.createElement("th");e.textContent=t,Object.assign(e.style,{border:"none",padding:"6px",background:"#eaeaea",textAlign:"left"}),i.appendChild(e)})),n.appendChild(i),r.appendChild(n);var s=document.createElement("tbody");Object.keys(t[0]).forEach((function(r,n){var i=t.map((function(t){return t[r]})).filter((function(t){return null!=t}));if(i.length){var o=e._detectType(i),a=cr(new Set(i)),h=document.createElement("tr"),l=document.createElement("td");l.textContent=r,Object.assign(l.style,{border:"none",padding:"6px",fontWeight:"bold"});var u=document.createElement("td");u.textContent=a.length,Object.assign(u.style,{border:"none",padding:"6px",textAlign:"center"});var c=document.createElement("td");Object.assign(c.style,{border:"none",padding:"6px"});var d=null;if("categorical"===o){var f=document.createElement("select");a.forEach((function(t){var e=document.createElement("option");e.value=t,e.textContent=t,f.appendChild(e)})),d=a[0],f.addEventListener("change",(function(t){d=t.target.value})),c.appendChild(f)}else{var p=i.map((function(t){return Number(t)})).filter((function(t){return!isNaN(t)}));c.textContent=p.length?"min: ".concat(Math.min.apply(Math,cr(p))," | max: ").concat(Math.max.apply(Math,cr(p))):"No numeric data"}var y=function(t,e){var r=document.createElement("td"),n=document.createElement("div");n.setAttribute("draggable","true"),Object.assign(n.style,{display:"flex",alignItems:"center",justifyContent:"center",width:"28px",height:"28px",border:"none",borderRadius:"6px",cursor:"grab"});var i=document.createElement("i");return i.className=t,i.style.pointerEvents="none",n.appendChild(i),n.addEventListener("dragstart",(function(t){var r=e(),n=JSON.stringify(r,null,2);t.dataTransfer.setData("application/json",n),t.dataTransfer.setData("text/plain",n)})),r.appendChild(n),r},m=y("fa-solid fa-magnet",(function(){return e._buildAttractorPayload(r,d)})),g=y("fa-solid fa-arrow-up",(function(){return e._buildSplitterPayload(r,"up")})),x=y("fa-solid fa-arrow-right",(function(){return e._buildSplitterPayload(r,"right")})),v=y("fa-solid fa-chart-column",(function(){return e._buildHistogramPayload(r)}));h.appendChild(l),h.appendChild(u),h.appendChild(c),h.appendChild(m),h.appendChild(g),h.appendChild(x),h.appendChild(v);var b=h.querySelectorAll("td"),_=n%2==0?"#dbeafe":"#ffffff";b.forEach((function(t){t.style.background=_})),s.appendChild(h)}})),r.appendChild(s);var o=document.createElement("div");Object.assign(o.style,{position:"absolute",top:"42px",left:"0",right:"0",bottom:"0",overflow:"auto",padding:"10px",boxSizing:"border-box"}),o.appendChild(r),this.container.appendChild(o)}else this._showPlaceholder()}},{key:"_buildAttractorPayload",value:function(t,e){return{type:"planet",label:e,rule:{op:"and",rules:[{field:t,op:"eq",value:e}]}}}},{key:"_buildSplitterPayload",value:function(t,e){var r={type:"vector",vector:!0,scalarField:t,direction:"up"==e?{x:0,y:1}:{x:1,y:0},length:1200,rule:{op:"and",rules:[]}};return console.log("vector",r),r}},{key:"_buildHistogramPayload",value:function(t){var e={};return this.data.forEach((function(r){var n=r[t];n||(n="EMPTY"),e[n]=(e[n]||0)+1})),{type:"histogram",field:t,data:Object.keys(e).map((function(t){return{value:t,count:e[t]}}))}}},{key:"_detectType",value:function(t){var e=t.filter((function(t){return""!==t&&null!=t}));return e.length&&e.map(Number).filter((function(t){return!isNaN(t)})).length===e.length?"scalar":"categorical"}}],e&&fr(t.prototype,e),r&&fr(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function mr(t){return mr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mr(t)}function gr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function xr(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?gr(Object(r),!0).forEach((function(e){vr(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):gr(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function vr(t,e,r){return(e=Mr(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function br(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,s,o,a=[],h=!0,l=!1;try{if(s=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;h=!1}else for(;!(h=(n=s.call(r)).done)&&(a.push(n.value),a.length!==e);h=!0);}catch(t){l=!0,i=t}finally{try{if(!h&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(l)throw i}}return a}}(t,e)||wr(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _r(t){return function(t){if(Array.isArray(t))return Sr(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||wr(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function wr(t,e){if(t){if("string"==typeof t)return Sr(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Sr(t,e):void 0}}function Sr(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Cr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Mr(n.key),n)}}function Mr(t){var e=function(t,e){if("object"!=mr(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=mr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==mr(e)?e:e+""}var Tr=function(){return t=function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),!e)throw new Error("Container element is required");this.container=e,this.placeholderText=r.placeholder||"PASTE DATA HERE",this.data=[],this.sortState={field:null,direction:"asc"},this.filters={},this.handlePaste=this.handlePaste.bind(this),this._initStyles(),this.init()},e=[{key:"init",value:function(){var t=this;this.container.setAttribute("contenteditable","true"),this.container.style.display="flex",this.container.style.flexDirection="column",this.container.style.height="100%",this.container.style.position="relative",this.container.style.overflow="hidden",this.container.style.background="#fff",this.container.style.border="1px solid #e5e7eb",this.container.style.borderRadius="8px",this.createPlaceholder(),this.showPlaceholder(),this.container.addEventListener("paste",this.handlePaste),this.container.addEventListener("dragover",(function(e){e.preventDefault(),t.container.style.background="#f0f8ff"})),this.container.addEventListener("dragleave",(function(){t.container.style.background="#fff"})),this.container.addEventListener("drop",(function(e){e.preventDefault(),t.container.style.background="#fff",t.handleDrop(e)})),this.container.addEventListener("mousedown",(function(t){t.target.closest("[draggable='true']")&&t.stopPropagation()}))}},{key:"_initStyles",value:function(){this.styles={table:{width:"max-content",minwidth:"100%",height:"90%",borderCollapse:"separate",borderSpacing:"0",fontFamily:"system-ui, sans-serif",fontSize:"13px"},th:{padding:"10px 8px",background:"#f9fafb",borderBottom:"1px solid #e5e7eb",textAlign:"left",fontWeight:"600",color:"#374151",position:"sticky",top:"0",zIndex:"5"},td:{padding:"8px",borderBottom:"1px solid #f1f5f9",color:"#111827"},trHover:{background:"#f9fafb"},trAlt:{background:"#fcfcfd"},input:{width:"100%",border:"1px solid #d1d5db",borderRadius:"4px",padding:"4px",fontSize:"13px"},select:{marginTop:"4px",border:"1px solid #d1d5db",borderRadius:"4px",fontSize:"11px",padding:"2px"}}}},{key:"_setStyle",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object.assign(t.style,e)}},{key:"handlePaste",value:function(t){t.preventDefault();var e=(t.clipboardData||window.clipboardData).getData("text");if(e){var r=this.parseTSV(e),n=this.toJSON(r);this.data=this.mergeData(this.data,n),this.render()}}},{key:"handleDrop",value:function(t){var e=t.dataTransfer.getData("application/json")||t.dataTransfer.getData("text/plain");if(e){var r;try{r=JSON.parse(e)}catch(t){return void console.error("Invalid JSON dropped",t)}("table"===r.type&&Array.isArray(r.data)||"graph-nodes"===r.type&&Array.isArray(r.data))&&this._dropTableData(r.data)}}},{key:"_dropTableData",value:function(t){this.data=this.mergeData(this.data,t),this.render()}},{key:"render",value:function(){this.container.innerHTML="",this.container.style.display="grid",this.container.style.gridTemplateRows="auto 1fr",this.container.style.height="100%",this.container.style.minWidth="0",this.container.style.overflow="hidden";var t=this.createToolbox();t.style.gridRow="1";var e=document.createElement("div");e.style.gridRow="2",e.style.width="100%",e.style.height="90%",e.style.overflowX="auto",e.style.overflowY="auto",e.style.minWidth="0",e.style.minHeight="0";var r=this.createTableFromJSON(this.getProcessedData());r.style.width="max-content",e.appendChild(r),this.container.appendChild(t),this.container.appendChild(e),this.hidePlaceholder()}},{key:"getProcessedData",value:function(){var t=_r(this.data);return Object.entries(this.filters).forEach((function(e){var r=br(e,2),n=r[0],i=r[1];i&&(t=t.filter((function(t){return(t[n]||"")===i})))})),this.sortState.field&&(t=this._sortData(t,this.sortState.field,this.sortState.direction)),t}},{key:"_sortData",value:function(t,e,r){var n="asc"===r?1:-1;return _r(t).map((function(t,e){return{item:t,index:e}})).sort((function(t,r){var i,s,o=null!==(i=t.item[e])&&void 0!==i?i:"",a=null!==(s=r.item[e])&&void 0!==s?s:"",h=parseFloat(o),l=parseFloat(a);return isNaN(h)||isNaN(l)?o.toString().localeCompare(a.toString())*n:(h-l)*n})).map((function(t){return t.item}))}},{key:"createTableFromJSON",value:function(t){var e=this,r=document.createElement("table");this._setStyle(r,this.styles.table);var n=document.createElement("thead"),i=document.createElement("tbody"),s=Array.from(this.data.reduce((function(t,e){return Object.keys(e).forEach((function(e){return t.add(e)})),t}),new Set)),o=document.createElement("tr");return s.forEach((function(t){var r=document.createElement("th"),n=e.sortState.field===t?"asc"===e.sortState.direction?" ▲":" ▼":"",i=document.createElement("div");i.textContent=t+n;var s=document.createElement("select"),a=_r(new Set(e.data.map((function(e){return e[t]})).filter((function(t){return""!==t})))),h=document.createElement("option");h.value="",h.textContent="All",s.appendChild(h),a.forEach((function(t){var e=document.createElement("option");e.value=t,e.textContent=t,s.appendChild(e)})),s.value=e.filters[t]||"";var l=Math.min(120,Math.max(60,8*t.length));s.style.width=l+"px",e._setStyle(s,e.styles.select),s.onchange=function(r){e.filters[t]=r.target.value,e.render()},i.onclick=function(){e.sortState.field===t?e.sortState.direction="asc"===e.sortState.direction?"desc":"asc":(e.sortState.field=t,e.sortState.direction="asc"),e.render()},r.appendChild(i),r.appendChild(s),e._setStyle(r,e.styles.th),o.appendChild(r)})),n.appendChild(o),t.forEach((function(t,r){var n=document.createElement("tr");r%2==0&&e._setStyle(n,e.styles.trAlt),n.onmouseenter=function(){return e._setStyle(n,e.styles.trHover)},n.onmouseleave=function(){return n.style.background=r%2==0?"#fcfcfd":""},s.forEach((function(r){var i=document.createElement("td");e._setStyle(i,e.styles.td),i.textContent=t[r]||"",i.onclick=function(){var n=document.createElement("input");e._setStyle(n,e.styles.input),n.value=t[r]||"",i.innerHTML="",i.appendChild(n),n.focus();var s=function(){t[r]=n.value,e.render()};n.onblur=s,n.onkeydown=function(t){"Enter"===t.key&&s()}},n.appendChild(i)})),i.appendChild(n)})),r.appendChild(n),r.appendChild(i),r}},{key:"createToolbox",value:function(){var t=this,e=document.createElement("div");Object.assign(e.style,{display:"flex",gap:"10px",padding:"8px",borderBottom:"1px solid #e5e7eb",background:"#fafafa",alignItems:"center"});var r=document.createElement("button");r.textContent="Clear",Object.assign(r.style,{padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",background:"#fff",cursor:"pointer"}),r.onclick=function(){return t.clear()};var n=document.createElement("div");n.setAttribute("draggable","true"),n.title="Drag JSON",Object.assign(n.style,{display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",border:"1px solid #d1d5db",borderRadius:"6px",background:"#fff",cursor:"grab",userSelect:"none"});var i=document.createElement("span");return i.textContent="⤴",i.style.pointerEvents="none",n.appendChild(i),n.addEventListener("mousedown",(function(){n.style.cursor="grabbing"})),n.addEventListener("mouseup",(function(){n.style.cursor="grab"})),n.addEventListener("dragstart",(function(e){var r={type:"table",data:t.getProcessedData()},i=JSON.stringify(r);e.dataTransfer.effectAllowed="copy",e.dataTransfer.setData("application/json",i),e.dataTransfer.setData("text/plain",i);var s=n.cloneNode(!0);s.style.position="absolute",s.style.top="-1000px",document.body.appendChild(s),e.dataTransfer.setDragImage(s,16,16),setTimeout((function(){return document.body.removeChild(s)}),0)})),e.appendChild(r),e.appendChild(n),e}},{key:"parseTSV",value:function(t){return t.trim().split("\n").map((function(t){return t.split("\t")}))}},{key:"toJSON",value:function(t){var e=t[0];return t.slice(1).map((function(t){var r={};return e.forEach((function(e,n){return r[e]=t[n]||""})),r}))}},{key:"mergeData",value:function(t,e){if(!t.length)return e;var r=new Map;return t.forEach((function(t){return t.id&&r.set(t.id,xr({},t))})),e.forEach((function(t){t.id&&(r.has(t.id)?Object.assign(r.get(t.id),t):r.set(t.id,xr({},t)))})),Array.from(r.values())}},{key:"createPlaceholder",value:function(){this.placeholder=document.createElement("div"),this.placeholder.textContent=this.placeholderText,Object.assign(this.placeholder.style,{position:"absolute",top:"10px",left:"10px",color:"#9ca3af"}),this.container.appendChild(this.placeholder)}},{key:"showPlaceholder",value:function(){this.placeholder&&(this.placeholder.style.display="block")}},{key:"hidePlaceholder",value:function(){this.placeholder&&(this.placeholder.style.display="none")}},{key:"clear",value:function(){this.data=[],this.filters={},this.sortState={field:null,direction:"asc"},this.container.innerHTML="",this.createPlaceholder(),this.showPlaceholder()}}],e&&Cr(t.prototype,e),r&&Cr(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function Ar(t){return Ar="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ar(t)}function kr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Pr(n.key),n)}}function Pr(t){var e=function(t,e){if("object"!=Ar(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Ar(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Ar(e)?e:e+""}var Er=function(){return t=function t(e){if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),!e)throw new Error("Container is required");this.container=e,this.placeholderText="DROP HISTOGRAM HERE",this.currentPayload=null,this._initDrop(),this._initResize(),this._renderBase()},e=[{key:"_renderBase",value:function(){this.container.innerHTML="",this._createToolbox(),this._createPlaceholder(),this._createTooltip(),this._showPlaceholder(),Object.assign(this.container.style,{position:"relative",border:"2px dashed #ccc",minHeight:"200px"})}},{key:"_createToolbox",value:function(){var t=this,e=document.createElement("div");Object.assign(e.style,{display:"flex",justifyContent:"flex-end",padding:"8px",borderBottom:"1px solid #ddd",background:"#f9f9f9"});var r=document.createElement("button");r.textContent="Clear",r.addEventListener("click",(function(){t.currentPayload=null,t._renderBase()})),e.appendChild(r),this.container.appendChild(e)}},{key:"_createPlaceholder",value:function(){this.placeholder=document.createElement("div"),this.placeholder.textContent=this.placeholderText,Object.assign(this.placeholder.style,{position:"absolute",top:"60%",left:"50%",transform:"translate(-50%, -50%)",color:"#888",fontFamily:"sans-serif",pointerEvents:"none"}),this.container.appendChild(this.placeholder)}},{key:"_showPlaceholder",value:function(){this.placeholder&&(this.placeholder.style.display="block")}},{key:"_hidePlaceholder",value:function(){this.placeholder&&(this.placeholder.style.display="none")}},{key:"_createTooltip",value:function(){this.tooltip=document.createElement("div"),Object.assign(this.tooltip.style,{position:"absolute",pointerEvents:"none",background:"rgba(0,0,0,0.75)",color:"#fff",padding:"6px 8px",borderRadius:"4px",fontSize:"12px",fontFamily:"sans-serif",opacity:"0",transition:"opacity 0.2s"}),this.container.appendChild(this.tooltip)}},{key:"_showTooltip",value:function(t,e,r){this.tooltip.innerHTML=r,this.tooltip.style.left=t+10+"px",this.tooltip.style.top=e+10+"px",this.tooltip.style.opacity="1"}},{key:"_hideTooltip",value:function(){this.tooltip.style.opacity="0"}},{key:"_initResize",value:function(){var t=this;this._handleResize=function(e){var r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:150;return function(){for(var i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];clearTimeout(r),r=setTimeout((function(){return e.apply(t,s)}),n)}}((function(){t.currentPayload&&t._drawChart(t.currentPayload)})),this.resizeObserver=new ResizeObserver(this._handleResize),this.resizeObserver.observe(this.container)}},{key:"_initDrop",value:function(){var t=this;this.container.addEventListener("dragover",(function(e){e.preventDefault(),t.container.style.background="#f0f8ff"})),this.container.addEventListener("dragleave",(function(){t.container.style.background=""})),this.container.addEventListener("drop",(function(e){e.preventDefault(),t.container.style.background="";var r=e.dataTransfer.getData("application/json")||e.dataTransfer.getData("text/plain");if(r)try{var n=JSON.parse(r);"histogram"===n.type&&Array.isArray(n.data)&&t.render(n)}catch(t){console.error("Invalid histogram JSON",t)}}))}},{key:"render",value:function(t){this.currentPayload=t,this.container.innerHTML="",this._createToolbox(),this._createTooltip(),this._hidePlaceholder(),this.chartWrapper=document.createElement("div"),this.chartWrapper.style.width="100%",this.chartWrapper.style.height="100%",this.chartWrapper.style.padding="10px",this.container.appendChild(this.chartWrapper),this._drawChart(t)}},{key:"_drawChart",value:function(t){var e=this;if(this.chartWrapper){this.chartWrapper.innerHTML="";var r=this.container.getBoundingClientRect(),n=r.width-20,i=Math.max(200,r.height-60),s=30,o=20,a=80,h=50,l=d3.select(this.chartWrapper).append("svg").attr("width",n).attr("height",i),u=n-h-o,c=i-s-a,d=l.append("g").attr("transform","translate(".concat(h,",").concat(s,")")),f=t.data,p=d3.scaleBand().domain(f.map((function(t){return t.value}))).range([0,u]).padding(.1),y=d3.scaleLinear().domain([0,d3.max(f,(function(t){return t.count}))]).nice().range([c,0]);d.selectAll(".bar").data(f,(function(t){return t.value})).enter().append("rect").attr("class","bar").attr("x",(function(t){return p(t.value)})).attr("width",p.bandwidth()).attr("y",c).attr("height",0).attr("fill","#69b3a2").on("mousemove",(function(t,r){e._showTooltip(t.offsetX,t.offsetY,"<b>".concat(r.value,"</b><br/>Count: ").concat(r.count))})).on("mouseleave",(function(){return e._hideTooltip()})).transition().duration(600).attr("y",(function(t){return y(t.count)})).attr("height",(function(t){return c-y(t.count)})),d.append("g").attr("transform","translate(0, ".concat(c,")")).call(d3.axisBottom(p).tickFormat((function(t){var e,r=f.find((function(e){return e.value===t}));return"".concat(t," (").concat(null!==(e=null==r?void 0:r.count)&&void 0!==e?e:0,")")}))).selectAll("text").attr("transform","rotate(-30)").style("text-anchor","end"),d.append("g").call(d3.axisLeft(y)),l.append("text").attr("x",n/2).attr("y",20).attr("text-anchor","middle").style("font-family","sans-serif").style("font-size","14px").text("Histogram: ".concat(t.field))}}}],e&&kr(t.prototype,e),r&&kr(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function Rr(t){return Rr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rr(t)}function Ir(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Or(n.key),n)}}function Or(t){var e=function(t,e){if("object"!=Rr(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Rr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Rr(e)?e:e+""}var Lr=function(){return t=function t(e){if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),!e)throw new Error("Container required");this.container=e,this.days=["Lun","Mar","Mie","Jue","Vie","Sab","Dom"],this.hours=["09:00","10:00","11:00","12:00","13:00","14:00","15:00","16:00","17:00","18:00","19:00","20:00","21:00"],this.selected={},this._injectStyles(),this._render(),this._buildGrid(),this._bindEvents()},(e=[{key:"_injectStyles",value:function(){if(!document.getElementById("availability-survey-styles")){var t=document.createElement("style");t.id="availability-survey-styles",t.textContent="\n .as-card {\n max-width: 900px;\n margin: auto;\n background: white;\n padding: 20px;\n border-radius: 16px;\n box-shadow: 0 8px 24px rgba(0,0,0,0.08);\n font-family: sans-serif;\n\n display: flex;\n flex-direction: column;\n height: 100%; /* 🔥 important */\n }\n\n .as-title {\n margin-bottom: 6px;\n }\n\n .as-subtitle {\n color: #666;\n margin-bottom: 16px;\n font-size: 14px;\n }\n\n .as-input-group {\n margin-bottom: 16px;\n }\n\n .as-card input {\n padding: 8px 10px;\n border: 1px solid #ddd;\n border-radius: 8px;\n width: 220px;\n font-size: 14px;\n }\n\n .as-grid-wrapper {\n overflow: auto;\n border-radius: 12px;\n -webkit-overflow-scrolling: touch;\n\n flex: 1; /* 🔥 fills space */\n min-height: 0; /* 🔥 required for iOS */\n }\n\n .as-grid {\n display: grid;\n grid-template-columns: 80px repeat(7, minmax(70px, 1fr));\n min-width: 600px;\n border: 1px solid #e5e7eb;\n }\n\n .as-cell {\n border: 1px solid #eef0f4;\n height: 42px;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n font-size: 13px;\n transition: all 0.12s ease;\n user-select: none;\n }\n\n .as-header {\n font-weight: 600;\n background: #f1f5f9;\n cursor: default;\n }\n\n .as-time {\n background: #f9fafb;\n color: #555;\n font-size: 12px;\n cursor: default;\n }\n\n /* hover only when NOT clicking */\n body:not(.as-clicking) .as-cell:not(.as-active):hover {\n background: #eef4ff;\n }\n\n .as-active {\n background: #1e40af;\n color: white;\n font-weight: bold;\n }\n\n .as-cell:active {\n transform: scale(0.96);\n }\n\n .as-card button {\n margin-top: 16px;\n padding: 10px 16px;\n border: none;\n border-radius: 10px;\n background: #3b82f6;\n color: white;\n font-size: 14px;\n cursor: pointer;\n box-shadow: 0 4px 12px rgba(59,130,246,0.3);\n margin-top: 12px;\n flex-shrink: 0; \n }\n\n .as-card button:hover {\n background: #2563eb;\n }\n\n .as-header {\n position: sticky;\n top: 0;\n z-index: 2;\n }\n\n\n .as-time {\n position: sticky;\n left: 0;\n z-index: 1;\n background: #f9fafb;\n }\n\n ",document.head.appendChild(t)}}},{key:"_render",value:function(){this.container.innerHTML="",this.card=document.createElement("div"),this.card.className="as-card",this.title=document.createElement("h1"),this.title.className="as-title",this.title.textContent="Encuesta de Disponibilidad 🎶",this.subtitle=document.createElement("div"),this.subtitle.className="as-subtitle",this.subtitle.textContent="Pon tu nombre y da click en los horarios que te acomoden para el ensayo",this.inputGroup=document.createElement("div"),this.inputGroup.className="as-input-group",this.input=document.createElement("input"),this.input.placeholder="Pon tu Nombre",this.gridWrapper=document.createElement("div"),this.gridWrapper.className="as-grid-wrapper",this.grid=document.createElement("div"),this.grid.className="as-grid",this.gridWrapper.appendChild(this.grid),this.button=document.createElement("button"),this.button.textContent="Enviar",this.inputGroup.appendChild(this.input),this.card.appendChild(this.title),this.card.appendChild(this.subtitle),this.card.appendChild(this.inputGroup),this.card.appendChild(this.gridWrapper),this.card.appendChild(this.button),this.container.appendChild(this.card)}},{key:"_buildGrid",value:function(){var t=this;this.grid.appendChild(document.createElement("div")),this.days.forEach((function(e){var r=document.createElement("div");r.textContent=e,r.className="as-cell as-header",t.grid.appendChild(r)})),this.hours.forEach((function(e){var r=document.createElement("div");r.textContent=e,r.className="as-cell as-time",t.grid.appendChild(r),t.days.forEach((function(r){var n="".concat(r,"-").concat(e),i=document.createElement("div");i.className="as-cell",i.addEventListener("click",(function(){var e=!t.selected[n];t.selected[n]=e,i.classList.toggle("as-active",e),i.textContent=e?"✓":""})),t.grid.appendChild(i)}))}))}},{key:"_bindEvents",value:function(){var t=this;document.addEventListener("mousedown",(function(){document.body.classList.add("as-clicking")})),document.addEventListener("mouseup",(function(){document.body.classList.remove("as-clicking")})),this.button.addEventListener("click",(function(){var e=t.input.value||"Anonymous";if(0!==Object.values(t.selected).filter(Boolean).length){var r={name:e,availability:t.selected};alert("Gracias !!!"),t.onSubmit&&t.onSubmit(r)}else alert("Please select at least one time slot")}))}}])&&Ir(t.prototype,e),r&&Ir(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}(),Br=s.A5,Dr=s.oY,Fr=s.vY,Gr=s.TI,jr=s.sV;export{Br as AvailabilitySurvey,Dr as DataInspector,Fr as vi_2dGRAP,Gr as vi_HistogramViewer,jr as vi_PasteTable};
|
|
2
|
+
var t,e,r={8133:t=>{t.exports=function(t){var i=[];return t.replace(r,(function(t,r,s){var o=r.toLowerCase();for(s=function(t){var e=t.match(n);return e?e.map(Number):[]}(s),"m"==o&&s.length>2&&(i.push([r].concat(s.splice(0,2))),o="l",r="m"==r?"l":"L");;){if(s.length==e[o])return s.unshift(r),i.push(s);if(s.length<e[o])throw new Error("malformed path data");i.push([r].concat(s.splice(0,e[o])))}})),i};var e={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},r=/([astvzqmhlc])([^astvzqmhlc]*)/gi;var n=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi},5585:t=>{var e=Object.prototype.hasOwnProperty,r="~";function n(){}function i(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function s(t,e,n,s,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new i(n,s||t,o),l=r?r+e:e;return t._events[l]?t._events[l].fn?t._events[l]=[t._events[l],a]:t._events[l].push(a):(t._events[l]=a,t._eventsCount++),t}function o(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),a.prototype.eventNames=function(){var t,n,i=[];if(0===this._eventsCount)return i;for(n in t=this._events)e.call(t,n)&&i.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},a.prototype.listeners=function(t){var e=r?r+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,s=n.length,o=new Array(s);i<s;i++)o[i]=n[i].fn;return o},a.prototype.listenerCount=function(t){var e=r?r+t:t,n=this._events[e];return n?n.fn?1:n.length:0},a.prototype.emit=function(t,e,n,i,s,o){var a=r?r+t:t;if(!this._events[a])return!1;var l,h,u=this._events[a],c=arguments.length;if(u.fn){switch(u.once&&this.removeListener(t,u.fn,void 0,!0),c){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,e),!0;case 3:return u.fn.call(u.context,e,n),!0;case 4:return u.fn.call(u.context,e,n,i),!0;case 5:return u.fn.call(u.context,e,n,i,s),!0;case 6:return u.fn.call(u.context,e,n,i,s,o),!0}for(h=1,l=new Array(c-1);h<c;h++)l[h-1]=arguments[h];u.fn.apply(u.context,l)}else{var d,f=u.length;for(h=0;h<f;h++)switch(u[h].once&&this.removeListener(t,u[h].fn,void 0,!0),c){case 1:u[h].fn.call(u[h].context);break;case 2:u[h].fn.call(u[h].context,e);break;case 3:u[h].fn.call(u[h].context,e,n);break;case 4:u[h].fn.call(u[h].context,e,n,i);break;default:if(!l)for(d=1,l=new Array(c-1);d<c;d++)l[d-1]=arguments[d];u[h].fn.apply(u[h].context,l)}}return!0},a.prototype.on=function(t,e,r){return s(this,t,e,r,!1)},a.prototype.once=function(t,e,r){return s(this,t,e,r,!0)},a.prototype.removeListener=function(t,e,n,i){var s=r?r+t:t;if(!this._events[s])return this;if(!e)return o(this,s),this;var a=this._events[s];if(a.fn)a.fn!==e||i&&!a.once||n&&a.context!==n||o(this,s);else{for(var l=0,h=[],u=a.length;l<u;l++)(a[l].fn!==e||i&&!a[l].once||n&&a[l].context!==n)&&h.push(a[l]);h.length?this._events[s]=1===h.length?h[0]:h:o(this,s)}return this},a.prototype.removeAllListeners=function(t){var e;return t?(e=r?r+t:t,this._events[e]&&o(this,e)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=r,a.EventEmitter=a,t.exports=a},2406:(t,e,r)=>{r.d(e,{z:()=>n});const n=(t,e,r=!1)=>(Array.isArray(t)||(t=[t]),e?t.map((t=>"string"==typeof t||r?e(t):t)):t)},2577:(t,e,r)=>{r.d(e,{Q:()=>I});var n={grad:.9,turn:360,rad:360/(2*Math.PI)},i=function(t){return"string"==typeof t?t.length>0:"number"==typeof t},s=function(t,e,r){return void 0===e&&(e=0),void 0===r&&(r=Math.pow(10,e)),Math.round(r*t)/r+0},o=function(t,e,r){return void 0===e&&(e=0),void 0===r&&(r=1),t>r?r:t>e?t:e},a=function(t){return(t=isFinite(t)?t%360:0)>0?t:t+360},l=function(t){return{r:o(t.r,0,255),g:o(t.g,0,255),b:o(t.b,0,255),a:o(t.a)}},h=function(t){return{r:s(t.r),g:s(t.g),b:s(t.b),a:s(t.a,3)}},u=/^#([0-9a-f]{3,8})$/i,c=function(t){var e=t.toString(16);return e.length<2?"0"+e:e},d=function(t){var e=t.r,r=t.g,n=t.b,i=t.a,s=Math.max(e,r,n),o=s-Math.min(e,r,n),a=o?s===e?(r-n)/o:s===r?2+(n-e)/o:4+(e-r)/o:0;return{h:60*(a<0?a+6:a),s:s?o/s*100:0,v:s/255*100,a:i}},f=function(t){var e=t.h,r=t.s,n=t.v,i=t.a;e=e/360*6,r/=100,n/=100;var s=Math.floor(e),o=n*(1-r),a=n*(1-(e-s)*r),l=n*(1-(1-e+s)*r),h=s%6;return{r:255*[n,a,o,o,l,n][h],g:255*[l,n,n,a,o,o][h],b:255*[o,o,l,n,n,a][h],a:i}},p=function(t){return{h:a(t.h),s:o(t.s,0,100),l:o(t.l,0,100),a:o(t.a)}},y=function(t){return{h:s(t.h),s:s(t.s),l:s(t.l),a:s(t.a,3)}},m=function(t){return f((r=(e=t).s,{h:e.h,s:(r*=((n=e.l)<50?n:100-n)/100)>0?2*r/(n+r)*100:0,v:n+r,a:e.a}));var e,r,n},g=function(t){return{h:(e=d(t)).h,s:(i=(200-(r=e.s))*(n=e.v)/100)>0&&i<200?r*n/100/(i<=100?i:200-i)*100:0,l:i/2,a:e.a};var e,r,n,i},x=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,v=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,b=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,_=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,w={string:[[function(t){var e=u.exec(t);return e?(t=e[1]).length<=4?{r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16),a:4===t.length?s(parseInt(t[3]+t[3],16)/255,2):1}:6===t.length||8===t.length?{r:parseInt(t.substr(0,2),16),g:parseInt(t.substr(2,2),16),b:parseInt(t.substr(4,2),16),a:8===t.length?s(parseInt(t.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(t){var e=b.exec(t)||_.exec(t);return e?e[2]!==e[4]||e[4]!==e[6]?null:l({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:void 0===e[7]?1:Number(e[7])/(e[8]?100:1)}):null},"rgb"],[function(t){var e=x.exec(t)||v.exec(t);if(!e)return null;var r,i,s=p({h:(r=e[1],i=e[2],void 0===i&&(i="deg"),Number(r)*(n[i]||1)),s:Number(e[3]),l:Number(e[4]),a:void 0===e[5]?1:Number(e[5])/(e[6]?100:1)});return m(s)},"hsl"]],object:[[function(t){var e=t.r,r=t.g,n=t.b,s=t.a,o=void 0===s?1:s;return i(e)&&i(r)&&i(n)?l({r:Number(e),g:Number(r),b:Number(n),a:Number(o)}):null},"rgb"],[function(t){var e=t.h,r=t.s,n=t.l,s=t.a,o=void 0===s?1:s;if(!i(e)||!i(r)||!i(n))return null;var a=p({h:Number(e),s:Number(r),l:Number(n),a:Number(o)});return m(a)},"hsl"],[function(t){var e=t.h,r=t.s,n=t.v,s=t.a,l=void 0===s?1:s;if(!i(e)||!i(r)||!i(n))return null;var h=function(t){return{h:a(t.h),s:o(t.s,0,100),v:o(t.v,0,100),a:o(t.a)}}({h:Number(e),s:Number(r),v:Number(n),a:Number(l)});return f(h)},"hsv"]]},S=function(t,e){for(var r=0;r<e.length;r++){var n=e[r][0](t);if(n)return[n,e[r][1]]}return[null,void 0]},C=function(t){return"string"==typeof t?S(t.trim(),w.string):"object"==typeof t&&null!==t?S(t,w.object):[null,void 0]},M=function(t,e){var r=g(t);return{h:r.h,s:o(r.s+100*e,0,100),l:r.l,a:r.a}},T=function(t){return(299*t.r+587*t.g+114*t.b)/1e3/255},A=function(t,e){var r=g(t);return{h:r.h,s:r.s,l:o(r.l+100*e,0,100),a:r.a}},k=function(){function t(t){this.parsed=C(t)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return t.prototype.isValid=function(){return null!==this.parsed},t.prototype.brightness=function(){return s(T(this.rgba),2)},t.prototype.isDark=function(){return T(this.rgba)<.5},t.prototype.isLight=function(){return T(this.rgba)>=.5},t.prototype.toHex=function(){return e=(t=h(this.rgba)).r,r=t.g,n=t.b,o=(i=t.a)<1?c(s(255*i)):"","#"+c(e)+c(r)+c(n)+o;var t,e,r,n,i,o},t.prototype.toRgb=function(){return h(this.rgba)},t.prototype.toRgbString=function(){return e=(t=h(this.rgba)).r,r=t.g,n=t.b,(i=t.a)<1?"rgba("+e+", "+r+", "+n+", "+i+")":"rgb("+e+", "+r+", "+n+")";var t,e,r,n,i},t.prototype.toHsl=function(){return y(g(this.rgba))},t.prototype.toHslString=function(){return e=(t=y(g(this.rgba))).h,r=t.s,n=t.l,(i=t.a)<1?"hsla("+e+", "+r+"%, "+n+"%, "+i+")":"hsl("+e+", "+r+"%, "+n+"%)";var t,e,r,n,i},t.prototype.toHsv=function(){return t=d(this.rgba),{h:s(t.h),s:s(t.s),v:s(t.v),a:s(t.a,3)};var t},t.prototype.invert=function(){return P({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},t.prototype.saturate=function(t){return void 0===t&&(t=.1),P(M(this.rgba,t))},t.prototype.desaturate=function(t){return void 0===t&&(t=.1),P(M(this.rgba,-t))},t.prototype.grayscale=function(){return P(M(this.rgba,-1))},t.prototype.lighten=function(t){return void 0===t&&(t=.1),P(A(this.rgba,t))},t.prototype.darken=function(t){return void 0===t&&(t=.1),P(A(this.rgba,-t))},t.prototype.rotate=function(t){return void 0===t&&(t=15),this.hue(this.hue()+t)},t.prototype.alpha=function(t){return"number"==typeof t?P({r:(e=this.rgba).r,g:e.g,b:e.b,a:t}):s(this.rgba.a,3);var e},t.prototype.hue=function(t){var e=g(this.rgba);return"number"==typeof t?P({h:t,s:e.s,l:e.l,a:e.a}):s(e.h)},t.prototype.isEqual=function(t){return this.toHex()===P(t).toHex()},t}(),P=function(t){return t instanceof k?t:new k(t)},E=[];!function(t){t.forEach((function(t){E.indexOf(t)<0&&(t(k,w),E.push(t))}))}([function(t,e){var r={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"},n={};for(var i in r)n[r[i]]=i;var s={};t.prototype.toName=function(e){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var i,o,a=n[this.toHex()];if(a)return a;if(null==e?void 0:e.closest){var l=this.toRgb(),h=1/0,u="black";if(!s.length)for(var c in r)s[c]=new t(r[c]).toRgb();for(var d in r){var f=(i=l,o=s[d],Math.pow(i.r-o.r,2)+Math.pow(i.g-o.g,2)+Math.pow(i.b-o.b,2));f<h&&(h=f,u=d)}return u}},e.string.push([function(e){var n=e.toLowerCase(),i="transparent"===n?"#0000":r[n];return i?new t(i).toRgb():null},"name"])}]);const R=class t{constructor(t=16777215){this._value=null,this._components=new Float32Array(4),this._components.fill(1),this._int=16777215,this.value=t}get red(){return this._components[0]}get green(){return this._components[1]}get blue(){return this._components[2]}get alpha(){return this._components[3]}setValue(t){return this.value=t,this}set value(e){if(e instanceof t)this._value=this._cloneSource(e._value),this._int=e._int,this._components.set(e._components);else{if(null===e)throw new Error("Cannot set Color#value to null");null!==this._value&&this._isSourceEqual(this._value,e)||(this._value=this._cloneSource(e),this._normalize(this._value))}}get value(){return this._value}_cloneSource(t){return"string"==typeof t||"number"==typeof t||t instanceof Number||null===t?t:Array.isArray(t)||ArrayBuffer.isView(t)?t.slice(0):"object"==typeof t&&null!==t?{...t}:t}_isSourceEqual(t,e){const r=typeof t;if(r!==typeof e)return!1;if("number"===r||"string"===r||t instanceof Number)return t===e;if(Array.isArray(t)&&Array.isArray(e)||ArrayBuffer.isView(t)&&ArrayBuffer.isView(e))return t.length===e.length&&t.every(((t,r)=>t===e[r]));if(null!==t&&null!==e){const r=Object.keys(t),n=Object.keys(e);return r.length===n.length&&r.every((r=>t[r]===e[r]))}return t===e}toRgba(){const[t,e,r,n]=this._components;return{r:t,g:e,b:r,a:n}}toRgb(){const[t,e,r]=this._components;return{r:t,g:e,b:r}}toRgbaString(){const[t,e,r]=this.toUint8RgbArray();return`rgba(${t},${e},${r},${this.alpha})`}toUint8RgbArray(t){const[e,r,n]=this._components;return this._arrayRgb||(this._arrayRgb=[]),t||(t=this._arrayRgb),t[0]=Math.round(255*e),t[1]=Math.round(255*r),t[2]=Math.round(255*n),t}toArray(t){this._arrayRgba||(this._arrayRgba=[]),t||(t=this._arrayRgba);const[e,r,n,i]=this._components;return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}toRgbArray(t){this._arrayRgb||(this._arrayRgb=[]),t||(t=this._arrayRgb);const[e,r,n]=this._components;return t[0]=e,t[1]=r,t[2]=n,t}toNumber(){return this._int}toBgrNumber(){const[t,e,r]=this.toUint8RgbArray();return(r<<16)+(e<<8)+t}toLittleEndianNumber(){const t=this._int;return(t>>16)+(65280&t)+((255&t)<<16)}multiply(e){const[r,n,i,s]=t._temp.setValue(e)._components;return this._components[0]*=r,this._components[1]*=n,this._components[2]*=i,this._components[3]*=s,this._refreshInt(),this._value=null,this}premultiply(t,e=!0){return e&&(this._components[0]*=t,this._components[1]*=t,this._components[2]*=t),this._components[3]=t,this._refreshInt(),this._value=null,this}toPremultiplied(t,e=!0){if(1===t)return(255<<24)+this._int;if(0===t)return e?0:this._int;let r=this._int>>16&255,n=this._int>>8&255,i=255&this._int;return e&&(r=r*t+.5|0,n=n*t+.5|0,i=i*t+.5|0),(255*t<<24)+(r<<16)+(n<<8)+i}toHex(){const t=this._int.toString(16);return`#${"000000".substring(0,6-t.length)+t}`}toHexa(){const t=Math.round(255*this._components[3]).toString(16);return this.toHex()+"00".substring(0,2-t.length)+t}setAlpha(t){return this._components[3]=this._clamp(t),this._value=null,this}_normalize(e){let r,n,i,s;if(("number"==typeof e||e instanceof Number)&&e>=0&&e<=16777215){r=(e>>16&255)/255,n=(e>>8&255)/255,i=(255&e)/255,s=1}else if((Array.isArray(e)||e instanceof Float32Array)&&e.length>=3&&e.length<=4)e=this._clamp(e),[r,n,i,s=1]=e;else if((e instanceof Uint8Array||e instanceof Uint8ClampedArray)&&e.length>=3&&e.length<=4)e=this._clamp(e,0,255),[r,n,i,s=255]=e,r/=255,n/=255,i/=255,s/=255;else if("string"==typeof e||"object"==typeof e){if("string"==typeof e){const r=t.HEX_PATTERN.exec(e);r&&(e=`#${r[2]}`)}const o=P(e);o.isValid()&&(({r,g:n,b:i,a:s}=o.rgba),r/=255,n/=255,i/=255)}if(void 0===r)throw new Error(`Unable to convert color ${e}`);this._components[0]=r,this._components[1]=n,this._components[2]=i,this._components[3]=s,this._refreshInt()}_refreshInt(){this._clamp(this._components);const[t,e,r]=this._components;this._int=(255*t<<16)+(255*e<<8)+(255*r|0)}_clamp(t,e=0,r=1){return"number"==typeof t?Math.min(Math.max(t,e),r):(t.forEach(((n,i)=>{t[i]=Math.min(Math.max(n,e),r)})),t)}static isColorLike(e){return"number"==typeof e||"string"==typeof e||e instanceof Number||e instanceof t||Array.isArray(e)||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Float32Array||void 0!==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}};R.shared=new R,R._temp=new R,R.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;let I=R},1761:(t,e,r)=>{r.d(e,{e:()=>i});let n={createCanvas:(t,e)=>{const r=document.createElement("canvas");return r.width=t,r.height=e,r},createImage:()=>new Image,getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(t,e)=>fetch(t,e),parseXML:t=>(new DOMParser).parseFromString(t,"text/xml")};const i={get:()=>n,set(t){n=t}}},8507:(t,e,r)=>{r.d(e,{Ag:()=>n,XO:()=>o});var n=(t=>(t.Application="application",t.WebGLPipes="webgl-pipes",t.WebGLPipesAdaptor="webgl-pipes-adaptor",t.WebGLSystem="webgl-system",t.WebGPUPipes="webgpu-pipes",t.WebGPUPipesAdaptor="webgpu-pipes-adaptor",t.WebGPUSystem="webgpu-system",t.CanvasSystem="canvas-system",t.CanvasPipesAdaptor="canvas-pipes-adaptor",t.CanvasPipes="canvas-pipes",t.Asset="asset",t.LoadParser="load-parser",t.ResolveParser="resolve-parser",t.CacheParser="cache-parser",t.DetectionParser="detection-parser",t.MaskEffect="mask-effect",t.BlendMode="blend-mode",t.TextureSource="texture-source",t.Environment="environment",t.ShapeBuilder="shape-builder",t.Batcher="batcher",t))(n||{});const i=t=>{if("function"==typeof t||"object"==typeof t&&t.extension){if(!t.extension)throw new Error("Extension class must have an extension object");t={..."object"!=typeof t.extension?{type:t.extension}:t.extension,ref:t}}if("object"!=typeof t)throw new Error("Invalid extension type");return"string"==typeof(t={...t}).type&&(t.type=[t.type]),t},s=(t,e)=>i(t).priority??e,o={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...t){return t.map(i).forEach((t=>{t.type.forEach((e=>this._removeHandlers[e]?.(t)))})),this},add(...t){return t.map(i).forEach((t=>{t.type.forEach((e=>{const r=this._addHandlers,n=this._queue;r[e]?r[e]?.(t):(n[e]=n[e]||[],n[e]?.push(t))}))})),this},handle(t,e,r){const n=this._addHandlers,i=this._removeHandlers;if(n[t]||i[t])throw new Error(`Extension type ${t} already has a handler`);n[t]=e,i[t]=r;const s=this._queue;return s[t]&&(s[t]?.forEach((t=>e(t))),delete s[t]),this},handleByMap(t,e){return this.handle(t,(t=>{t.name&&(e[t.name]=t.ref)}),(t=>{t.name&&delete e[t.name]}))},handleByNamedList(t,e,r=-1){return this.handle(t,(t=>{e.findIndex((e=>e.name===t.name))>=0||(e.push({name:t.name,value:t.ref}),e.sort(((t,e)=>s(e.value,r)-s(t.value,r))))}),(t=>{const r=e.findIndex((e=>e.name===t.name));-1!==r&&e.splice(r,1)}))},handleByList(t,e,r=-1){return this.handle(t,(t=>{e.includes(t.ref)||(e.push(t.ref),e.sort(((t,e)=>s(e,r)-s(t,r))))}),(t=>{const r=e.indexOf(t.ref);-1!==r&&e.splice(r,1)}))},mixin(t,...e){for(const r of e)Object.defineProperties(t.prototype,Object.getOwnPropertyDescriptors(r))}}},9049:(t,e,r)=>{r.d(e,{a:()=>n});class n{constructor(){this.pipe="filter",this.priority=1}destroy(){for(let t=0;t<this.filters.length;t++)this.filters[t].destroy();this.filters=null,this.filterArea=null}}},9313:(t,e,r)=>{r.d(e,{u:()=>s});var n=r(1652),i=r(5101);class s{constructor(t=1,e=0,r=0,n=1,i=0,s=0){this.array=null,this.a=t,this.b=e,this.c=r,this.d=n,this.tx=i,this.ty=s}fromArray(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]}set(t,e,r,n,i,s){return this.a=t,this.b=e,this.c=r,this.d=n,this.tx=i,this.ty=s,this}toArray(t,e){this.array||(this.array=new Float32Array(9));const r=e||this.array;return t?(r[0]=this.a,r[1]=this.b,r[2]=0,r[3]=this.c,r[4]=this.d,r[5]=0,r[6]=this.tx,r[7]=this.ty,r[8]=1):(r[0]=this.a,r[1]=this.c,r[2]=this.tx,r[3]=this.b,r[4]=this.d,r[5]=this.ty,r[6]=0,r[7]=0,r[8]=1),r}apply(t,e){e=e||new i.b;const r=t.x,n=t.y;return e.x=this.a*r+this.c*n+this.tx,e.y=this.b*r+this.d*n+this.ty,e}applyInverse(t,e){e=e||new i.b;const r=this.a,n=this.b,s=this.c,o=this.d,a=this.tx,l=this.ty,h=1/(r*o+s*-n),u=t.x,c=t.y;return e.x=o*h*u+-s*h*c+(l*s-a*o)*h,e.y=r*h*c+-n*h*u+(-l*r+a*n)*h,e}translate(t,e){return this.tx+=t,this.ty+=e,this}scale(t,e){return this.a*=t,this.d*=e,this.c*=t,this.b*=e,this.tx*=t,this.ty*=e,this}rotate(t){const e=Math.cos(t),r=Math.sin(t),n=this.a,i=this.c,s=this.tx;return this.a=n*e-this.b*r,this.b=n*r+this.b*e,this.c=i*e-this.d*r,this.d=i*r+this.d*e,this.tx=s*e-this.ty*r,this.ty=s*r+this.ty*e,this}append(t){const e=this.a,r=this.b,n=this.c,i=this.d;return this.a=t.a*e+t.b*n,this.b=t.a*r+t.b*i,this.c=t.c*e+t.d*n,this.d=t.c*r+t.d*i,this.tx=t.tx*e+t.ty*n+this.tx,this.ty=t.tx*r+t.ty*i+this.ty,this}appendFrom(t,e){const r=t.a,n=t.b,i=t.c,s=t.d,o=t.tx,a=t.ty,l=e.a,h=e.b,u=e.c,c=e.d;return this.a=r*l+n*u,this.b=r*h+n*c,this.c=i*l+s*u,this.d=i*h+s*c,this.tx=o*l+a*u+e.tx,this.ty=o*h+a*c+e.ty,this}setTransform(t,e,r,n,i,s,o,a,l){return this.a=Math.cos(o+l)*i,this.b=Math.sin(o+l)*i,this.c=-Math.sin(o-a)*s,this.d=Math.cos(o-a)*s,this.tx=t-(r*this.a+n*this.c),this.ty=e-(r*this.b+n*this.d),this}prepend(t){const e=this.tx;if(1!==t.a||0!==t.b||0!==t.c||1!==t.d){const e=this.a,r=this.c;this.a=e*t.a+this.b*t.c,this.b=e*t.b+this.b*t.d,this.c=r*t.a+this.d*t.c,this.d=r*t.b+this.d*t.d}return this.tx=e*t.a+this.ty*t.c+t.tx,this.ty=e*t.b+this.ty*t.d+t.ty,this}decompose(t){const e=this.a,r=this.b,i=this.c,s=this.d,o=t.pivot,a=-Math.atan2(-i,s),l=Math.atan2(r,e),h=Math.abs(a+l);return h<1e-5||Math.abs(n.TO-h)<1e-5?(t.rotation=l,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=a,t.skew.y=l),t.scale.x=Math.sqrt(e*e+r*r),t.scale.y=Math.sqrt(i*i+s*s),t.position.x=this.tx+(o.x*e+o.y*i),t.position.y=this.ty+(o.x*r+o.y*s),t}invert(){const t=this.a,e=this.b,r=this.c,n=this.d,i=this.tx,s=t*n-e*r;return this.a=n/s,this.b=-e/s,this.c=-r/s,this.d=t/s,this.tx=(r*this.ty-n*i)/s,this.ty=-(t*this.ty-e*i)/s,this}isIdentity(){return 1===this.a&&0===this.b&&0===this.c&&1===this.d&&0===this.tx&&0===this.ty}identity(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this}clone(){const t=new s;return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t}copyTo(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t}copyFrom(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this}equals(t){return t.a===this.a&&t.b===this.b&&t.c===this.c&&t.d===this.d&&t.tx===this.tx&&t.ty===this.ty}toString(){return`[pixi.js:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`}static get IDENTITY(){return a.identity()}static get shared(){return o.identity()}}const o=new s,a=new s},2079:(t,e,r)=>{r.d(e,{E:()=>c});var n=r(9313);const i=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],s=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],o=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],a=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],l=[],h=[],u=Math.sign;!function(){for(let t=0;t<16;t++){const e=[];l.push(e);for(let r=0;r<16;r++){const n=u(i[t]*i[r]+o[t]*s[r]),l=u(s[t]*i[r]+a[t]*s[r]),h=u(i[t]*o[r]+o[t]*a[r]),c=u(s[t]*o[r]+a[t]*a[r]);for(let t=0;t<16;t++)if(i[t]===n&&s[t]===l&&o[t]===h&&a[t]===c){e.push(t);break}}}for(let t=0;t<16;t++){const e=new n.u;e.set(i[t],s[t],o[t],a[t],0,0),h.push(e)}}();const c={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:t=>i[t],uY:t=>s[t],vX:t=>o[t],vY:t=>a[t],inv:t=>8&t?15&t:7&-t,add:(t,e)=>l[t][e],sub:(t,e)=>l[t][c.inv(e)],rotate180:t=>4^t,isVertical:t=>2==(3&t),byDirection:(t,e)=>2*Math.abs(t)<=Math.abs(e)?e>=0?c.S:c.N:2*Math.abs(e)<=Math.abs(t)?t>0?c.E:c.W:e>0?t>0?c.SE:c.SW:t>0?c.NE:c.NW,matrixAppendRotationInv:(t,e,r=0,n=0,i=0,s=0)=>{const o=h[c.inv(e)],a=o.a,l=o.b,u=o.c,d=o.d,f=r-Math.min(0,a*i,u*s,a*i+u*s),p=n-Math.min(0,l*i,d*s,l*i+d*s),y=t.a,m=t.b,g=t.c,x=t.d;t.a=a*y+l*g,t.b=a*m+l*x,t.c=u*y+d*g,t.d=u*m+d*x,t.tx=f*y+p*g+t.tx,t.ty=f*m+p*x+t.ty},transformRectCoords:(t,e,r,n)=>{const{x:i,y:s,width:o,height:a}=t,{x:l,y:h,width:u,height:d}=e;return r===c.E?(n.set(i+l,s+h,o,a),n):r===c.S?n.set(u-s-a+l,i+h,a,o):r===c.W?n.set(u-i-o+l,d-s-a+h,o,a):r===c.N?n.set(s+l,d-i-o+h,a,o):n.set(i+l,s+h,o,a)}}},1652:(t,e,r)=>{r.d(e,{TO:()=>n,Td:()=>s,bO:()=>i});const n=2*Math.PI,i=180/Math.PI,s=Math.PI/180},9939:(t,e,r)=>{function n(t){return t+=0===t?1:0,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1}function i(t){return!(t&t-1||!t)}r.d(e,{U5:()=>n,f3:()=>i})},2812:(t,e,r)=>{r.d(e,{o:()=>n});class n{constructor(t,e,r){this._x=e||0,this._y=r||0,this._observer=t}clone(t){return new n(t??this._observer,this._x,this._y)}set(t=0,e=t){return this._x===t&&this._y===e||(this._x=t,this._y=e,this._observer._onUpdate(this)),this}copyFrom(t){return this._x===t.x&&this._y===t.y||(this._x=t.x,this._y=t.y,this._observer._onUpdate(this)),this}copyTo(t){return t.set(this._x,this._y),t}equals(t){return t.x===this._x&&t.y===this._y}toString(){return`[pixi.js/math:ObservablePoint x=${this._x} y=${this._y} scope=${this._observer}]`}get x(){return this._x}set x(t){this._x!==t&&(this._x=t,this._observer._onUpdate(this))}get y(){return this._y}set y(t){this._y!==t&&(this._y=t,this._observer._onUpdate(this))}}},5101:(t,e,r)=>{r.d(e,{b:()=>n});class n{constructor(t=0,e=0){this.x=0,this.y=0,this.x=t,this.y=e}clone(){return new n(this.x,this.y)}copyFrom(t){return this.set(t.x,t.y),this}copyTo(t){return t.set(this.x,this.y),t}equals(t){return t.x===this.x&&t.y===this.y}set(t=0,e=t){return this.x=t,this.y=e,this}toString(){return`[pixi.js/math:Point x=${this.x} y=${this.y}]`}static get shared(){return i.x=0,i.y=0,i}}const i=new n},9252:(t,e,r)=>{r.d(e,{M:()=>s});var n=r(5101);const i=[new n.b,new n.b,new n.b,new n.b];class s{constructor(t=0,e=0,r=0,n=0){this.type="rectangle",this.x=Number(t),this.y=Number(e),this.width=Number(r),this.height=Number(n)}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}isEmpty(){return this.left===this.right||this.top===this.bottom}static get EMPTY(){return new s(0,0,0,0)}clone(){return new s(this.x,this.y,this.width,this.height)}copyFromBounds(t){return this.x=t.minX,this.y=t.minY,this.width=t.maxX-t.minX,this.height=t.maxY-t.minY,this}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.copyFrom(this),t}contains(t,e){return!(this.width<=0||this.height<=0)&&(t>=this.x&&t<this.x+this.width&&e>=this.y&&e<this.y+this.height)}strokeContains(t,e,r,n=.5){const{width:i,height:s}=this;if(i<=0||s<=0)return!1;const o=this.x,a=this.y,l=r*(1-n),h=r-l;return t>=o-l&&t<=o+i+l&&e>=a-l&&e<=a+s+l&&!(t>o+h&&t<o+i-h&&e>a+h&&e<a+s-h)}intersects(t,e){if(!e){const e=this.x<t.x?t.x:this.x;if((this.right>t.right?t.right:this.right)<=e)return!1;const r=this.y<t.y?t.y:this.y;return(this.bottom>t.bottom?t.bottom:this.bottom)>r}const r=this.left,n=this.right,s=this.top,o=this.bottom;if(n<=r||o<=s)return!1;const a=i[0].set(t.left,t.top),l=i[1].set(t.left,t.bottom),h=i[2].set(t.right,t.top),u=i[3].set(t.right,t.bottom);if(h.x<=a.x||l.y<=a.y)return!1;const c=Math.sign(e.a*e.d-e.b*e.c);if(0===c)return!1;if(e.apply(a,a),e.apply(l,l),e.apply(h,h),e.apply(u,u),Math.max(a.x,l.x,h.x,u.x)<=r||Math.min(a.x,l.x,h.x,u.x)>=n||Math.max(a.y,l.y,h.y,u.y)<=s||Math.min(a.y,l.y,h.y,u.y)>=o)return!1;const d=c*(l.y-a.y),f=c*(a.x-l.x),p=d*r+f*s,y=d*n+f*s,m=d*r+f*o,g=d*n+f*o;if(Math.max(p,y,m,g)<=d*a.x+f*a.y||Math.min(p,y,m,g)>=d*u.x+f*u.y)return!1;const x=c*(a.y-h.y),v=c*(h.x-a.x),b=x*r+v*s,_=x*n+v*s,w=x*r+v*o,S=x*n+v*o;return!(Math.max(b,_,w,S)<=x*a.x+v*a.y||Math.min(b,_,w,S)>=x*u.x+v*u.y)}pad(t=0,e=t){return this.x-=t,this.y-=e,this.width+=2*t,this.height+=2*e,this}fit(t){const e=Math.max(this.x,t.x),r=Math.min(this.x+this.width,t.x+t.width),n=Math.max(this.y,t.y),i=Math.min(this.y+this.height,t.y+t.height);return this.x=e,this.width=Math.max(r-e,0),this.y=n,this.height=Math.max(i-n,0),this}ceil(t=1,e=.001){const r=Math.ceil((this.x+this.width-e)*t)/t,n=Math.ceil((this.y+this.height-e)*t)/t;return this.x=Math.floor((this.x+e)*t)/t,this.y=Math.floor((this.y+e)*t)/t,this.width=r-this.x,this.height=n-this.y,this}scale(t,e=t){return this.x*=t,this.y*=e,this.width*=t,this.height*=e,this}enlarge(t){const e=Math.min(this.x,t.x),r=Math.max(this.x+this.width,t.x+t.width),n=Math.min(this.y,t.y),i=Math.max(this.y+this.height,t.y+t.height);return this.x=e,this.width=r-e,this.y=n,this.height=i-n,this}getBounds(t){return t||(t=new s),t.copyFrom(this),t}containsRect(t){if(this.width<=0||this.height<=0)return!1;const e=t.x,r=t.y,n=t.x+t.width,i=t.y+t.height;return e>=this.x&&e<this.x+this.width&&r>=this.y&&r<this.y+this.height&&n>=this.x&&n<this.x+this.width&&i>=this.y&&i<this.y+this.height}set(t,e,r,n){return this.x=t,this.y=e,this.width=r,this.height=n,this}toString(){return`[pixi.js/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}}},6512:(t,e,r)=>{r.d(e,{u:()=>s});const n=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join("\n");function i(t){let e="";for(let r=0;r<t;++r)r>0&&(e+="\nelse "),r<t-1&&(e+=`if(test == ${r}.0){}`);return e}function s(t,e){if(0===t)throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");const r=e.createShader(e.FRAGMENT_SHADER);try{for(;;){const s=n.replace(/%forloop%/gi,i(t));if(e.shaderSource(r,s),e.compileShader(r),e.getShaderParameter(r,e.COMPILE_STATUS))break;t=t/2|0}}finally{e.deleteShader(r)}return t}},341:(t,e,r)=>{r.d(e,{w:()=>o});var n=r(3513),i=r(5589);const s={};function o(t,e,r){let o=2166136261;for(let r=0;r<e;r++)o^=t[r].uid,o=Math.imul(o,16777619),o>>>=0;return s[o]||function(t,e,r,o){const a={};let l=0;for(let r=0;r<o;r++){const n=r<e?t[r]:i.g.EMPTY.source;a[l++]=n.source,a[l++]=n.style}const h=new n.T(a);return s[r]=h,h}(t,e,o,r)}},2043:(t,e,r)=>{r.d(e,{J:()=>j});var n=r(8507),i=r(133);class s{constructor(t){"number"==typeof t?this.rawBinaryData=new ArrayBuffer(t):t instanceof Uint8Array?this.rawBinaryData=t.buffer:this.rawBinaryData=t,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData),this.size=this.rawBinaryData.byteLength}get int8View(){return this._int8View||(this._int8View=new Int8Array(this.rawBinaryData)),this._int8View}get uint8View(){return this._uint8View||(this._uint8View=new Uint8Array(this.rawBinaryData)),this._uint8View}get int16View(){return this._int16View||(this._int16View=new Int16Array(this.rawBinaryData)),this._int16View}get int32View(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View}get float64View(){return this._float64Array||(this._float64Array=new Float64Array(this.rawBinaryData)),this._float64Array}get bigUint64View(){return this._bigUint64Array||(this._bigUint64Array=new BigUint64Array(this.rawBinaryData)),this._bigUint64Array}view(t){return this[`${t}View`]}destroy(){this.rawBinaryData=null,this.uint32View=null,this.float32View=null,this.uint16View=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._int32View=null,this._float64Array=null,this._bigUint64Array=null}static sizeOf(t){switch(t){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(`${t} isn't a valid view type`)}}}var o=r(4670),a=r(6083),l=r(6736),h=r(1957);function u(t,e){return"no-premultiply-alpha"===e.alphaMode&&h.Q[t]||t}var c=r(3804),d=r(6512);let f=null;class p{constructor(){this.ids=Object.create(null),this.textures=[],this.count=0}clear(){for(let t=0;t<this.count;t++){const e=this.textures[t];this.textures[t]=null,this.ids[e.uid]=null}this.count=0}}class y{constructor(){this.renderPipeId="batch",this.action="startBatch",this.start=0,this.size=0,this.textures=new p,this.blendMode="normal",this.topology="triangle-strip",this.canBundle=!0}destroy(){this.textures=null,this.gpuBindGroup=null,this.bindGroup=null,this.batcher=null,this.elements=null}}const m=[];let g=0;function x(){return g>0?m[--g]:new y}function v(t){t.elements=null,m[g++]=t}a.L.register({clear:()=>{if(m.length>0)for(const t of m)t&&t.destroy();m.length=0,g=0}});let b=0;const _=class t{constructor(e){this.uid=(0,i.L)("batcher"),this.dirty=!0,this.batchIndex=0,this.batches=[],this._elements=[],(e={...t.defaultOptions,...e}).maxTextures||((0,o.t6)("v8.8.0","maxTextures is a required option for Batcher now, please pass it in the options"),e.maxTextures=function(){if(f)return f;const t=(0,c.W)();return f=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),f=(0,d.u)(f,t),t.getExtension("WEBGL_lose_context")?.loseContext(),f}());const{maxTextures:r,attributesInitialSize:n,indicesInitialSize:a}=e;this.attributeBuffer=new s(4*n),this.indexBuffer=new Uint16Array(a),this.maxTextures=r}begin(){this.elementSize=0,this.elementStart=0,this.indexSize=0,this.attributeSize=0;for(let t=0;t<this.batchIndex;t++)v(this.batches[t]);this.batchIndex=0,this._batchIndexStart=0,this._batchIndexSize=0,this.dirty=!0}add(t){this._elements[this.elementSize++]=t,t._indexStart=this.indexSize,t._attributeStart=this.attributeSize,t._batcher=this,this.indexSize+=t.indexSize,this.attributeSize+=t.attributeSize*this.vertexSize}checkAndUpdateTexture(t,e){const r=t._batch.textures.ids[e._source.uid];return!(!r&&0!==r)&&(t._textureId=r,t.texture=e,!0)}updateElement(t){this.dirty=!0;const e=this.attributeBuffer;t.packAsQuad?this.packQuadAttributes(t,e.float32View,e.uint32View,t._attributeStart,t._textureId):this.packAttributes(t,e.float32View,e.uint32View,t._attributeStart,t._textureId)}break(t){const e=this._elements;if(!e[this.elementStart])return;let r=x(),n=r.textures;n.clear();const i=e[this.elementStart];let s=u(i.blendMode,i.texture._source),o=i.topology;4*this.attributeSize>this.attributeBuffer.size&&this._resizeAttributeBuffer(4*this.attributeSize),this.indexSize>this.indexBuffer.length&&this._resizeIndexBuffer(this.indexSize);const a=this.attributeBuffer.float32View,l=this.attributeBuffer.uint32View,h=this.indexBuffer;let c=this._batchIndexSize,d=this._batchIndexStart,f="startBatch",p=[];const y=this.maxTextures;for(let i=this.elementStart;i<this.elementSize;++i){const m=e[i];e[i]=null;const g=m.texture._source,v=u(m.blendMode,g),_=s!==v||o!==m.topology;g._batchTick!==b||_?(g._batchTick=b,(n.count>=y||_)&&(this._finishBatch(r,d,c-d,n,s,o,t,f,p),f="renderBatch",d=c,s=v,o=m.topology,r=x(),n=r.textures,n.clear(),p=[],++b),m._textureId=g._textureBindLocation=n.count,n.ids[g.uid]=n.count,n.textures[n.count++]=g,m._batch=r,p.push(m),c+=m.indexSize,m.packAsQuad?(this.packQuadAttributes(m,a,l,m._attributeStart,m._textureId),this.packQuadIndex(h,m._indexStart,m._attributeStart/this.vertexSize)):(this.packAttributes(m,a,l,m._attributeStart,m._textureId),this.packIndex(m,h,m._indexStart,m._attributeStart/this.vertexSize))):(m._textureId=g._textureBindLocation,c+=m.indexSize,m.packAsQuad?(this.packQuadAttributes(m,a,l,m._attributeStart,m._textureId),this.packQuadIndex(h,m._indexStart,m._attributeStart/this.vertexSize)):(this.packAttributes(m,a,l,m._attributeStart,m._textureId),this.packIndex(m,h,m._indexStart,m._attributeStart/this.vertexSize)),m._batch=r,p.push(m))}n.count>0&&(this._finishBatch(r,d,c-d,n,s,o,t,f,p),d=c,++b),this.elementStart=this.elementSize,this._batchIndexStart=d,this._batchIndexSize=c}_finishBatch(t,e,r,n,i,s,o,a,l){t.gpuBindGroup=null,t.bindGroup=null,t.action=a,t.batcher=this,t.textures=n,t.blendMode=i,t.topology=s,t.start=e,t.size=r,t.elements=l,++b,this.batches[this.batchIndex++]=t,o.add(t)}finish(t){this.break(t)}ensureAttributeBuffer(t){4*t<=this.attributeBuffer.size||this._resizeAttributeBuffer(4*t)}ensureIndexBuffer(t){t<=this.indexBuffer.length||this._resizeIndexBuffer(t)}_resizeAttributeBuffer(t){const e=Math.max(t,2*this.attributeBuffer.size),r=new s(e);(0,l.W)(this.attributeBuffer.rawBinaryData,r.rawBinaryData),this.attributeBuffer=r}_resizeIndexBuffer(t){const e=this.indexBuffer;let r=Math.max(t,1.5*e.length);r+=r%2;const n=r>65535?new Uint32Array(r):new Uint16Array(r);if(n.BYTES_PER_ELEMENT!==e.BYTES_PER_ELEMENT)for(let t=0;t<e.length;t++)n[t]=e[t];else(0,l.W)(e.buffer,n.buffer);this.indexBuffer=n}packQuadIndex(t,e,r){t[e]=r+0,t[e+1]=r+1,t[e+2]=r+2,t[e+3]=r+0,t[e+4]=r+2,t[e+5]=r+3}packIndex(t,e,r,n){const i=t.indices,s=t.indexSize,o=t.indexOffset,a=t.attributeOffset;for(let t=0;t<s;t++)e[r++]=n+i[t+o]-a}destroy(t={}){if(null!==this.batches){for(let t=0;t<this.batchIndex;t++)v(this.batches[t]);this.batches=null,this.geometry.destroy(!0),this.geometry=null,t.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}}};_.defaultOptions={maxTextures:null,attributesInitialSize:4,indicesInitialSize:6};let w=_;var S=r(949),C=r(1132),M=r(6011);const T=new Float32Array(1),A=new Uint32Array(1);class k extends M.V{constructor(){const t=new S.h({data:T,label:"attribute-batch-buffer",usage:C.S.VERTEX|C.S.COPY_DST,shrinkToFit:!1});super({attributes:{aPosition:{buffer:t,format:"float32x2",stride:24,offset:0},aUV:{buffer:t,format:"float32x2",stride:24,offset:8},aColor:{buffer:t,format:"unorm8x4",stride:24,offset:16},aTextureIdAndRound:{buffer:t,format:"uint16x2",stride:24,offset:20}},indexBuffer:new S.h({data:A,label:"index-batch-buffer",usage:C.S.INDEX|C.S.COPY_DST,shrinkToFit:!1})})}}var P=r(5611),E=r(4459),R=r(4e3),I=r(6665),O=r(6040),L=r(8475);class B extends L.M{constructor(t){super({glProgram:(0,P.I)({name:"batch",bits:[E.a,(0,R.P)(t),I.m]}),gpuProgram:(0,P.v)({name:"batch",bits:[E.F,(0,R._)(t),I.b]}),resources:{batchSamplers:(0,O.n)(t)}}),this.maxTextures=t}}let D=null;const F=class t extends w{constructor(e){super(e),this.geometry=new k,this.name=t.extension.name,this.vertexSize=6,D??(D=new B(e.maxTextures)),this.shader=D}packAttributes(t,e,r,n,i){const s=i<<16|65535&t.roundPixels,o=t.transform,a=o.a,l=o.b,h=o.c,u=o.d,c=o.tx,d=o.ty,{positions:f,uvs:p}=t,y=t.color,m=t.attributeOffset,g=m+t.attributeSize;for(let t=m;t<g;t++){const i=2*t,o=f[i],m=f[i+1];e[n++]=a*o+h*m+c,e[n++]=u*m+l*o+d,e[n++]=p[i],e[n++]=p[i+1],r[n++]=y,r[n++]=s}}packQuadAttributes(t,e,r,n,i){const s=t.texture,o=t.transform,a=o.a,l=o.b,h=o.c,u=o.d,c=o.tx,d=o.ty,f=t.bounds,p=f.maxX,y=f.minX,m=f.maxY,g=f.minY,x=s.uvs,v=t.color,b=i<<16|65535&t.roundPixels;e[n+0]=a*y+h*g+c,e[n+1]=u*g+l*y+d,e[n+2]=x.x0,e[n+3]=x.y0,r[n+4]=v,r[n+5]=b,e[n+6]=a*p+h*g+c,e[n+7]=u*g+l*p+d,e[n+8]=x.x1,e[n+9]=x.y1,r[n+10]=v,r[n+11]=b,e[n+12]=a*p+h*m+c,e[n+13]=u*m+l*p+d,e[n+14]=x.x2,e[n+15]=x.y2,r[n+16]=v,r[n+17]=b,e[n+18]=a*y+h*m+c,e[n+19]=u*m+l*y+d,e[n+20]=x.x3,e[n+21]=x.y3,r[n+22]=v,r[n+23]=b}_updateMaxTextures(t){this.shader.maxTextures!==t&&(D=new B(t),this.shader=D)}destroy(){this.shader=null,super.destroy()}};F.extension={type:[n.Ag.Batcher],name:"default"};let j=F},5611:(t,e,r)=>{r.d(e,{I:()=>A,v:()=>T});var n=r(9113),i=r(3012),s=r(268);function o(t,e,r){if(t)for(const n in t){const i=e[n.toLocaleLowerCase()];if(i){let e=t[n];"header"===n&&(e=e.replace(/@in\s+[^;]+;\s*/g,"").replace(/@out\s+[^;]+;\s*/g,"")),r&&i.push(`//----${r}----//`),i.push(e)}else(0,s.R)(`${n} placement hook does not exist in shader`)}}const a=/\{\{(.*?)\}\}/g;function l(t){const e={};return(t.match(a)?.map((t=>t.replace(/[{()}]/g,"")))??[]).forEach((t=>{e[t]=[]})),e}function h(t,e){let r;const n=/@in\s+([^;]+);/g;for(;null!==(r=n.exec(t));)e.push(r[1])}function u(t,e,r=!1){const n=[];h(e,n),t.forEach((t=>{t.header&&h(t.header,n)}));const i=n;r&&i.sort();const s=i.map(((t,e)=>` @location(${e}) ${t},`)).join("\n");let o=e.replace(/@in\s+[^;]+;\s*/g,"");return o=o.replace("{{in}}",`\n${s}\n`),o}function c(t,e){let r;const n=/@out\s+([^;]+);/g;for(;null!==(r=n.exec(t));)e.push(r[1])}function d(t,e){let r=t;for(const t in e){const n=e[t];r=n.join("\n").length?r.replace(`{{${t}}}`,`//-----${t} START-----//\n${n.join("\n")}\n//----${t} FINISH----//`):r.replace(`{{${t}}}`,"")}return r}const f=Object.create(null),p=new Map;let y=0;function m({template:t,bits:e}){const r=x(t,e);if(f[r])return f[r];const{vertex:n,fragment:i}=function(t,e){const r=e.map((t=>t.vertex)).filter((t=>!!t)),n=e.map((t=>t.fragment)).filter((t=>!!t));let i=u(r,t.vertex,!0);i=function(t,e){const r=[];c(e,r),t.forEach((t=>{t.header&&c(t.header,r)}));let n=0;const i=r.sort().map((t=>t.indexOf("builtin")>-1?t:`@location(${n++}) ${t}`)).join(",\n"),s=r.sort().map((t=>{return` var ${e=t,e.replace(/@.*?\s+/g,"")};`;var e})).join("\n"),o=`return VSOutput(\n ${r.sort().map((t=>` ${function(t){const e=/\b(\w+)\s*:/g.exec(t);return e?e[1]:""}(t)}`)).join(",\n")});`;let a=e.replace(/@out\s+[^;]+;\s*/g,"");return a=a.replace("{{struct}}",`\n${i}\n`),a=a.replace("{{start}}",`\n${s}\n`),a=a.replace("{{return}}",`\n${o}\n`),a}(r,i);const s=u(n,t.fragment,!0);return{vertex:i,fragment:s}}(t,e);return f[r]=v(n,i,e),f[r]}function g({template:t,bits:e}){const r=x(t,e);return f[r]||(f[r]=v(t.vertex,t.fragment,e)),f[r]}function x(t,e){return e.map((t=>(p.has(t)||p.set(t,y++),p.get(t)))).sort(((t,e)=>t-e)).join("-")+t.vertex+t.fragment}function v(t,e,r){const n=l(t),i=l(e);return r.forEach((t=>{o(t.vertex,n,t.name),o(t.fragment,i,t.name)})),{vertex:d(t,n),fragment:d(e,i)}}const b="\n @in aPosition: vec2<f32>;\n @in aUV: vec2<f32>;\n\n @out @builtin(position) vPosition: vec4<f32>;\n @out vUV : vec2<f32>;\n @out vColor : vec4<f32>;\n\n {{header}}\n\n struct VSOutput {\n {{struct}}\n };\n\n @vertex\n fn main( {{in}} ) -> VSOutput {\n\n var worldTransformMatrix = globalUniforms.uWorldTransformMatrix;\n var modelMatrix = mat3x3<f32>(\n 1.0, 0.0, 0.0,\n 0.0, 1.0, 0.0,\n 0.0, 0.0, 1.0\n );\n var position = aPosition;\n var uv = aUV;\n\n {{start}}\n\n vColor = vec4<f32>(1., 1., 1., 1.);\n\n {{main}}\n\n vUV = uv;\n\n var modelViewProjectionMatrix = globalUniforms.uProjectionMatrix * worldTransformMatrix * modelMatrix;\n\n vPosition = vec4<f32>((modelViewProjectionMatrix * vec3<f32>(position, 1.0)).xy, 0.0, 1.0);\n\n vColor *= globalUniforms.uWorldColorAlpha;\n\n {{end}}\n\n {{return}}\n };\n",_="\n @in vUV : vec2<f32>;\n @in vColor : vec4<f32>;\n\n {{header}}\n\n @fragment\n fn main(\n {{in}}\n ) -> @location(0) vec4<f32> {\n\n {{start}}\n\n var outColor:vec4<f32>;\n\n {{main}}\n\n var finalColor:vec4<f32> = outColor * vColor;\n\n {{end}}\n\n return finalColor;\n };\n",w="\n in vec2 aPosition;\n in vec2 aUV;\n\n out vec4 vColor;\n out vec2 vUV;\n\n {{header}}\n\n void main(void){\n\n mat3 worldTransformMatrix = uWorldTransformMatrix;\n mat3 modelMatrix = mat3(\n 1.0, 0.0, 0.0,\n 0.0, 1.0, 0.0,\n 0.0, 0.0, 1.0\n );\n vec2 position = aPosition;\n vec2 uv = aUV;\n\n {{start}}\n\n vColor = vec4(1.);\n\n {{main}}\n\n vUV = uv;\n\n mat3 modelViewProjectionMatrix = uProjectionMatrix * worldTransformMatrix * modelMatrix;\n\n gl_Position = vec4((modelViewProjectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n\n vColor *= uWorldColorAlpha;\n\n {{end}}\n }\n",S="\n\n in vec4 vColor;\n in vec2 vUV;\n\n out vec4 finalColor;\n\n {{header}}\n\n void main(void) {\n\n {{start}}\n\n vec4 outColor;\n\n {{main}}\n\n finalColor = outColor * vColor;\n\n {{end}}\n }\n",C={name:"global-uniforms-bit",vertex:{header:"\n struct GlobalUniforms {\n uProjectionMatrix:mat3x3<f32>,\n uWorldTransformMatrix:mat3x3<f32>,\n uWorldColorAlpha: vec4<f32>,\n uResolution: vec2<f32>,\n }\n\n @group(0) @binding(0) var<uniform> globalUniforms : GlobalUniforms;\n "}},M={name:"global-uniforms-bit",vertex:{header:"\n uniform mat3 uProjectionMatrix;\n uniform mat3 uWorldTransformMatrix;\n uniform vec4 uWorldColorAlpha;\n uniform vec2 uResolution;\n "}};function T({bits:t,name:e}){const r=m({template:{fragment:_,vertex:b},bits:[C,...t]});return i.B.from({name:e,vertex:{source:r.vertex,entryPoint:"main"},fragment:{source:r.fragment,entryPoint:"main"}})}function A({bits:t,name:e}){return new n.M({name:e,...g({template:{vertex:w,fragment:S},bits:[M,...t]})})}},4459:(t,e,r)=>{r.d(e,{F:()=>n,a:()=>i});const n={name:"color-bit",vertex:{header:"\n @in aColor: vec4<f32>;\n ",main:"\n vColor *= vec4<f32>(aColor.rgb * aColor.a, aColor.a);\n "}},i={name:"color-bit",vertex:{header:"\n in vec4 aColor;\n ",main:"\n vColor *= vec4(aColor.rgb * aColor.a, aColor.a);\n "}}},4e3:(t,e,r)=>{r.d(e,{P:()=>h,_:()=>o});const n={};function i(t){const e=[];if(1===t)e.push("@group(1) @binding(0) var textureSource1: texture_2d<f32>;"),e.push("@group(1) @binding(1) var textureSampler1: sampler;");else{let r=0;for(let n=0;n<t;n++)e.push(`@group(1) @binding(${r++}) var textureSource${n+1}: texture_2d<f32>;`),e.push(`@group(1) @binding(${r++}) var textureSampler${n+1}: sampler;`)}return e.join("\n")}function s(t){const e=[];if(1===t)e.push("outColor = textureSampleGrad(textureSource1, textureSampler1, vUV, uvDx, uvDy);");else{e.push("switch vTextureId {");for(let r=0;r<t;r++)r===t-1?e.push(" default:{"):e.push(` case ${r}:{`),e.push(` outColor = textureSampleGrad(textureSource${r+1}, textureSampler${r+1}, vUV, uvDx, uvDy);`),e.push(" break;}");e.push("}")}return e.join("\n")}function o(t){return n[t]||(n[t]={name:"texture-batch-bit",vertex:{header:"\n @in aTextureIdAndRound: vec2<u32>;\n @out @interpolate(flat) vTextureId : u32;\n ",main:"\n vTextureId = aTextureIdAndRound.y;\n ",end:"\n if(aTextureIdAndRound.x == 1)\n {\n vPosition = vec4<f32>(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw);\n }\n "},fragment:{header:`\n @in @interpolate(flat) vTextureId: u32;\n\n ${i(t)}\n `,main:`\n var uvDx = dpdx(vUV);\n var uvDy = dpdy(vUV);\n\n ${s(t)}\n `}}),n[t]}const a={};function l(t){const e=[];for(let r=0;r<t;r++)r>0&&e.push("else"),r<t-1&&e.push(`if(vTextureId < ${r}.5)`),e.push("{"),e.push(`\toutColor = texture(uTextures[${r}], vUV);`),e.push("}");return e.join("\n")}function h(t){return a[t]||(a[t]={name:"texture-batch-bit",vertex:{header:"\n in vec2 aTextureIdAndRound;\n out float vTextureId;\n\n ",main:"\n vTextureId = aTextureIdAndRound.y;\n ",end:"\n if(aTextureIdAndRound.x == 1.)\n {\n gl_Position.xy = roundPixels(gl_Position.xy, uResolution);\n }\n "},fragment:{header:`\n in float vTextureId;\n\n uniform sampler2D uTextures[${t}];\n\n `,main:`\n\n ${l(t)}\n `}}),a[t]}},6665:(t,e,r)=>{r.d(e,{b:()=>n,m:()=>i});const n={name:"round-pixels-bit",vertex:{header:"\n fn roundPixels(position: vec2<f32>, targetSize: vec2<f32>) -> vec2<f32>\n {\n return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;\n }\n "}},i={name:"round-pixels-bit",vertex:{header:"\n vec2 roundPixels(vec2 position, vec2 targetSize)\n {\n return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;\n }\n "}}},5753:(t,e,r)=>{var n=r(8507),i=r(6844),s=r(9636),o=r(9443);const a=new s.c;function l(t,e,r){const n=a;t.measurable=!0,(0,o.f)(t,r,n),e.addBoundsMask(n),t.measurable=!1}var h=r(7269),u=r(2208),c=r(268);function d(t,e,r){const n=u.o.get();t.measurable=!0;const i=u.u.get().identity(),s=f(t,r,i);(0,h.n)(t,n,s),t.measurable=!1,e.addBoundsMask(n),u.u.return(i),u.o.return(n)}function f(t,e,r){return t?(t!==e&&(f(t.parent,e,r),t.updateLocalTransform(),r.append(t.localTransform)),r):((0,c.R)("Mask bounds, renderable is not inside the root container"),r)}class p{constructor(t){this.priority=0,this.inverse=!1,this.pipe="alphaMask",t?.mask&&this.init(t.mask)}init(t){this.mask=t,this.renderMaskToTexture=!(t instanceof i.k),this.mask.renderable=this.renderMaskToTexture,this.mask.includeInBuild=!this.renderMaskToTexture,this.mask.measurable=!1}reset(){null!==this.mask&&(this.mask.measurable=!0,this.mask=null)}addBounds(t,e){this.inverse||l(this.mask,t,e)}addLocalBounds(t,e){d(this.mask,t,e)}containsPoint(t,e){return e(this.mask,t)}destroy(){this.reset()}static test(t){return t instanceof i.k}}p.extension=n.Ag.MaskEffect;class y{constructor(t){this.priority=0,this.pipe="colorMask",t?.mask&&this.init(t.mask)}init(t){this.mask=t}destroy(){}static test(t){return"number"==typeof t}}y.extension=n.Ag.MaskEffect;var m=r(5559);class g{constructor(t){this.priority=0,this.pipe="stencilMask",t?.mask&&this.init(t.mask)}init(t){this.mask=t,this.mask.includeInBuild=!1,this.mask.measurable=!1}reset(){null!==this.mask&&(this.mask.measurable=!0,this.mask.includeInBuild=!0,this.mask=null)}addBounds(t,e){l(this.mask,t,e)}addLocalBounds(t,e){d(this.mask,t,e)}containsPoint(t,e){return e(this.mask,t)}destroy(){this.reset()}static test(t){return t instanceof m.mc}}g.extension=n.Ag.MaskEffect;var x=r(4195),v=r(4884),b=r(8293),_=r(7309),w=r(1761);let S;var C=r(583);const M=class t extends C.v{constructor(e){super(e),this.isReady=!1,this.uploadMethodId="video",e={...t.defaultOptions,...e},this._autoUpdate=!0,this._isConnectedToTicker=!1,this._updateFPS=e.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=!1!==e.autoPlay,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),!1!==e.autoLoad&&this.load()}updateFrame(){if(!this.destroyed){if(this._updateFPS){const t=_.R.shared.elapsedMS*this.resource.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-t)}(!this._updateFPS||this._msToNextUpdate<=0)&&(this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0),this.isValid&&this.update()}}_videoFrameRequestCallback(){this.updateFrame(),this.destroyed?this._videoFrameRequestCallbackHandle=null:this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback)}get isValid(){return!!this.resource.videoWidth&&!!this.resource.videoHeight}async load(){if(this._load)return this._load;const t=this.resource,e=this.options;return(t.readyState===t.HAVE_ENOUGH_DATA||t.readyState===t.HAVE_FUTURE_DATA)&&t.width&&t.height&&(t.complete=!0),t.addEventListener("play",this._onPlayStart),t.addEventListener("pause",this._onPlayStop),t.addEventListener("seeked",this._onSeeked),this._isSourceReady()?this._mediaReady():(e.preload||t.addEventListener("canplay",this._onCanPlay),t.addEventListener("canplaythrough",this._onCanPlayThrough),t.addEventListener("error",this._onError,!0)),this.alphaMode=await async function(){return S??(S=(async()=>{const t=w.e.get().createCanvas(1,1).getContext("webgl");if(!t)return"premultiply-alpha-on-upload";const e=await new Promise((t=>{const e=document.createElement("video");e.onloadeddata=()=>t(e),e.onerror=()=>t(null),e.autoplay=!1,e.crossOrigin="anonymous",e.preload="auto",e.src="data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=",e.load()}));if(!e)return"premultiply-alpha-on-upload";const r=t.createTexture();t.bindTexture(t.TEXTURE_2D,r);const n=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,n),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,r,0),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,t.NONE),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,e);const i=new Uint8Array(4);return t.readPixels(0,0,1,1,t.RGBA,t.UNSIGNED_BYTE,i),t.deleteFramebuffer(n),t.deleteTexture(r),t.getExtension("WEBGL_lose_context")?.loseContext(),i[0]<=i[3]?"premultiplied-alpha":"premultiply-alpha-on-upload"})()),S}(),this._load=new Promise(((r,n)=>{this.isValid?r(this):(this._resolve=r,this._reject=n,void 0!==e.preloadTimeoutMs&&(this._preloadTimeout=setTimeout((()=>{this._onError(new ErrorEvent(`Preload exceeded timeout of ${e.preloadTimeoutMs}ms`))}))),t.load())})),this._load}_onError(t){this.resource.removeEventListener("error",this._onError,!0),this.emit("error",t),this._reject&&(this._reject(t),this._reject=null,this._resolve=null)}_isSourcePlaying(){const t=this.resource;return!t.paused&&!t.ended}_isSourceReady(){return this.resource.readyState>2}_onPlayStart(){this.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(){const t=this.resource;this.isValid&&(this.isReady=!0,this.resize(t.videoWidth,t.videoHeight)),this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0,this._resolve&&(this._resolve(this),this._resolve=null,this._reject=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&this.resource.play()}destroy(){this._configureAutoUpdate();const t=this.resource;t&&(t.removeEventListener("play",this._onPlayStart),t.removeEventListener("pause",this._onPlayStop),t.removeEventListener("seeked",this._onSeeked),t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlayThrough),t.removeEventListener("error",this._onError,!0),t.pause(),t.src="",t.load()),super.destroy()}get autoUpdate(){return this._autoUpdate}set autoUpdate(t){t!==this._autoUpdate&&(this._autoUpdate=t,this._configureAutoUpdate())}get updateFPS(){return this._updateFPS}set updateFPS(t){t!==this._updateFPS&&(this._updateFPS=t,this._configureAutoUpdate())}_configureAutoUpdate(){this._autoUpdate&&this._isSourcePlaying()?!this._updateFPS&&this.resource.requestVideoFrameCallback?(this._isConnectedToTicker&&(_.R.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0),null===this._videoFrameRequestCallbackHandle&&(this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback))):(null!==this._videoFrameRequestCallbackHandle&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker||(_.R.shared.add(this.updateFrame,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(null!==this._videoFrameRequestCallbackHandle&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(_.R.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(t){return globalThis.HTMLVideoElement&&t instanceof HTMLVideoElement}};M.extension=n.Ag.TextureSource,M.defaultOptions={...C.v.defaultOptions,autoLoad:!0,autoPlay:!0,updateFPS:0,crossorigin:!0,loop:!1,muted:!0,playsinline:!0,preload:!1},M.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};let T=M;r(9726);n.XO.add(p,y,g,T,b.b,v.q,x.P)},1257:(t,e,r)=>{r.d(e,{u:()=>n});var n=(t=>(t[t.NONE=0]="NONE",t[t.COLOR=16384]="COLOR",t[t.STENCIL=1024]="STENCIL",t[t.DEPTH=256]="DEPTH",t[t.COLOR_DEPTH=16640]="COLOR_DEPTH",t[t.COLOR_STENCIL=17408]="COLOR_STENCIL",t[t.DEPTH_STENCIL=1280]="DEPTH_STENCIL",t[t.ALL=17664]="ALL",t))(n||{})},9113:(t,e,r)=>{r.d(e,{M:()=>d});var n=r(7952),i=r(3804);let s;function o(){if(!s){s="mediump";const t=(0,i.W)();if(t&&t.getShaderPrecisionFormat){const e=t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT);s=e.precision?"highp":"mediump"}}return s}const a={},l={};const h={stripVersion:function(t,e){return e?t.replace("#version 300 es",""):t},ensurePrecision:function(t,e,r){const n=r?e.maxSupportedFragmentPrecision:e.maxSupportedVertexPrecision;if("precision"!==t.substring(0,9)){let i=r?e.requestedFragmentPrecision:e.requestedVertexPrecision;return"highp"===i&&"highp"!==n&&(i="mediump"),`precision ${i} float;\n${t}`}return"highp"!==n&&"precision highp"===t.substring(0,15)?t.replace("precision highp","precision mediump"):t},addProgramDefines:function(t,e,r){return e?t:r?`\n\n #ifdef GL_ES // This checks if it is WebGL1\n #define in varying\n #define finalColor gl_FragColor\n #define texture texture2D\n #endif\n ${t=t.replace("out vec4 finalColor;","")}\n `:`\n\n #ifdef GL_ES // This checks if it is WebGL1\n #define in attribute\n #define out varying\n #endif\n ${t}\n `},setProgramName:function(t,{name:e="pixi-program"},r=!0){e=e.replace(/\s+/g,"-");const n=r?a:l;return n[e+=r?"-fragment":"-vertex"]?(n[e]++,e+=`-${n[e]}`):n[e]=1,-1!==t.indexOf("#define SHADER_NAME")?t:`${`#define SHADER_NAME ${e}`}\n${t}`},insertVersion:function(t,e){return e?`#version 300 es\n${t}`:t}},u=Object.create(null),c=class t{constructor(e){const r=-1!==(e={...t.defaultOptions,...e}).fragment.indexOf("#version 300 es"),i={stripVersion:r,ensurePrecision:{requestedFragmentPrecision:e.preferredFragmentPrecision,requestedVertexPrecision:e.preferredVertexPrecision,maxSupportedVertexPrecision:"highp",maxSupportedFragmentPrecision:o()},setProgramName:{name:e.name},addProgramDefines:r,insertVersion:r};let s=e.fragment,a=e.vertex;Object.keys(h).forEach((t=>{const e=i[t];s=h[t](s,e,!0),a=h[t](a,e,!1)})),this.fragment=s,this.vertex=a,this.transformFeedbackVaryings=e.transformFeedbackVaryings,this._key=(0,n.X)(`${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,u[this._cacheKey]=null}static from(e){const r=`${e.vertex}:${e.fragment}`;return u[r]||(u[r]=new t(e),u[r]._cacheKey=r),u[r]}};c.defaultOptions={preferredVertexPrecision:"highp",preferredFragmentPrecision:"mediump"};let d=c},6040:(t,e,r)=>{r.d(e,{n:()=>s});var n=r(5811);const i={};function s(t){let e=i[t];if(e)return e;const r=new Int32Array(t);for(let e=0;e<t;e++)r[e]=e;return e=i[t]=new n.k({uTextures:{value:r,type:"i32",size:t}},{isStatic:!0}),e}},3804:(t,e,r)=>{r.d(e,{W:()=>s});var n=r(1761);let i;function s(){if(!i||i?.isContextLost()){const t=n.e.get().createCanvas();i=t.getContext("webgl",{})}return i}},3513:(t,e,r)=>{r.d(e,{T:()=>n});class n{constructor(t){this.resources=Object.create(null),this._dirty=!0;let e=0;for(const r in t){const n=t[r];this.setResource(n,e++)}this._updateKey()}_updateKey(){if(!this._dirty)return;this._dirty=!1;const t=[];let e=0;for(const r in this.resources)t[e++]=this.resources[r]._resourceId;this._key=t.join("|")}setResource(t,e){const r=this.resources[e];t!==r&&(r?.off?.("change",this.onResourceChange,this),t.on?.("change",this.onResourceChange,this),this.resources[e]=t,this._dirty=!0)}getResource(t){return this.resources[t]}_touch(t,e){const r=this.resources;for(const n in r)r[n]._gcLastUsed=t,r[n]._touched=e}destroy(){const t=this.resources;for(const e in t){const r=t[e];r?.off?.("change",this.onResourceChange,this)}this.resources=null}onResourceChange(t){this._dirty=!0,t.destroyed?this.destroy():this._updateKey()}}},3012:(t,e,r)=>{r.d(e,{B:()=>c});var n=r(7952),i=r(8306);const s={f32:"float32","vec2<f32>":"float32x2","vec3<f32>":"float32x3","vec4<f32>":"float32x4",vec2f:"float32x2",vec3f:"float32x3",vec4f:"float32x4",i32:"sint32","vec2<i32>":"sint32x2","vec3<i32>":"sint32x3","vec4<i32>":"sint32x4",vec2i:"sint32x2",vec3i:"sint32x3",vec4i:"sint32x4",u32:"uint32","vec2<u32>":"uint32x2","vec3<u32>":"uint32x3","vec4<u32>":"uint32x4",vec2u:"uint32x2",vec3u:"uint32x3",vec4u:"uint32x4",bool:"uint32","vec2<bool>":"uint32x2","vec3<bool>":"uint32x3","vec4<bool>":"uint32x4"},o=/@location\((\d+)\)\s+([a-zA-Z0-9_]+)\s*:\s*([a-zA-Z0-9_<>]+)(?:,|\s|\)|$)/g;function a(t,e){let r;for(;null!==(r=o.exec(t));){const t=s[r[3]]??"float32";e[r[2]]={location:parseInt(r[1],10),format:t,stride:(0,i.m)(t).stride,offset:0,instance:!1,start:0}}o.lastIndex=0}function l(t){const e=/@group\((\d+)\)/,r=/@binding\((\d+)\)/,n=/var(<[^>]+>)? (\w+)/,i=/:\s*([\w<>]+)/,s=/(\w+)\s*:\s*([\w\<\>]+)/g,o=/struct\s+(\w+)/,a=t.match(/(^|[^/])@(group|binding)\(\d+\)[^;]+;/g)?.map((t=>({group:parseInt(t.match(e)[1],10),binding:parseInt(t.match(r)[1],10),name:t.match(n)[2],isUniform:"<uniform>"===t.match(n)[1],type:t.match(i)[1]})));if(!a)return{groups:[],structs:[]};const l=t.match(/struct\s+(\w+)\s*{([^}]+)}/g)?.map((t=>{const e=t.match(o)[1],r=t.match(s).reduce(((t,e)=>{const[r,n]=e.split(":");return t[r.trim()]=n.trim(),t}),{});return r?{name:e,members:r}:null})).filter((({name:t})=>a.some((e=>e.type===t||e.type.includes(`<${t}>`)))))??[];return{groups:a,structs:l}}var h=(t=>(t[t.VERTEX=1]="VERTEX",t[t.FRAGMENT=2]="FRAGMENT",t[t.COMPUTE=4]="COMPUTE",t))(h||{});const u=Object.create(null);class c{constructor(t){this._layoutKey=0,this._attributeLocationsKey=0;const{fragment:e,vertex:r,layout:n,gpuLayout:i,name:s}=t;if(this.name=s,this.fragment=e,this.vertex=r,e.source===r.source){const t=l(e.source);this.structsAndGroups=t}else{const t=l(r.source),n=l(e.source);this.structsAndGroups=function(t,e){const r=new Set,n=new Set;return{structs:[...t.structs,...e.structs].filter((t=>!r.has(t.name)&&(r.add(t.name),!0))),groups:[...t.groups,...e.groups].filter((t=>{const e=`${t.name}-${t.binding}`;return!n.has(e)&&(n.add(e),!0)}))}}(t,n)}this.layout=n??function({groups:t}){const e=[];for(let r=0;r<t.length;r++){const n=t[r];e[n.group]||(e[n.group]={}),e[n.group][n.name]=n.binding}return e}(this.structsAndGroups),this.gpuLayout=i??function({groups:t}){const e=[];for(let r=0;r<t.length;r++){const n=t[r];e[n.group]||(e[n.group]=[]),n.isUniform?e[n.group].push({binding:n.binding,visibility:h.VERTEX|h.FRAGMENT,buffer:{type:"uniform"}}):"sampler"===n.type?e[n.group].push({binding:n.binding,visibility:h.FRAGMENT,sampler:{type:"filtering"}}):"texture_2d"===n.type||n.type.startsWith("texture_2d<")?e[n.group].push({binding:n.binding,visibility:h.FRAGMENT,texture:{sampleType:"float",viewDimension:"2d",multisampled:!1}}):"texture_2d_array"===n.type||n.type.startsWith("texture_2d_array<")?e[n.group].push({binding:n.binding,visibility:h.FRAGMENT,texture:{sampleType:"float",viewDimension:"2d-array",multisampled:!1}}):("texture_cube"===n.type||n.type.startsWith("texture_cube<"))&&e[n.group].push({binding:n.binding,visibility:h.FRAGMENT,texture:{sampleType:"float",viewDimension:"cube",multisampled:!1}})}for(let t=0;t<e.length;t++)e[t]||(e[t]=[]);return e}(this.structsAndGroups),this.autoAssignGlobalUniforms=!(void 0===this.layout[0]?.globalUniforms),this.autoAssignLocalUniforms=!(void 0===this.layout[1]?.localUniforms),this._generateProgramKey()}_generateProgramKey(){const{vertex:t,fragment:e}=this,r=t.source+e.source+t.entryPoint+e.entryPoint;this._layoutKey=(0,n.X)(r,"program")}get attributeData(){return this._attributeData??(this._attributeData=function({source:t,entryPoint:e}){const r={},n=function(t){return t.replace(/\/\/.*$/gm,"").replace(/\/\*[\s\S]*?\*\//g,"")}(t),i=n.indexOf(`fn ${e}(`);if(-1===i)return r;const s=n.indexOf("->",i);if(-1===s)return r;const o=n.substring(i,s);if(a(o,r),0===Object.keys(r).length){const t=o.match(/\(\s*\w+\s*:\s*(\w+)/);if(t){const e=t[1],i=new RegExp(`struct\\s+${e}\\s*\\{([^}]+)\\}`,"s"),s=n.match(i);s&&a(s[1],r)}}return r}(this.vertex)),this._attributeData}destroy(){this.gpuLayout=null,this.layout=null,this.structsAndGroups=null,this.fragment=null,this.vertex=null,u[this._cacheKey]=null}static from(t){const e=`${t.vertex.source}:${t.fragment.source}:${t.fragment.entryPoint}:${t.vertex.entryPoint}`;return u[e]||(u[e]=new c(t),u[e]._cacheKey=e),u[e]}}},949:(t,e,r)=>{r.d(e,{h:()=>o});var n=r(8875),i=r(133),s=r(1132);class o extends n.A{constructor(t){let{data:e,size:r}=t;const{usage:n,label:s,shrinkToFit:o}=t;super(),this._gpuData=Object.create(null),this._gcLastUsed=-1,this.autoGarbageCollect=!0,this.uid=(0,i.L)("buffer"),this._resourceType="buffer",this._resourceId=(0,i.L)("resource"),this._touched=0,this._updateID=1,this._dataInt32=null,this.shrinkToFit=!0,this.destroyed=!1,e instanceof Array&&(e=new Float32Array(e)),this._data=e,r??(r=e?.byteLength);const a=!!e;this.descriptor={size:r,usage:n,mappedAtCreation:a,label:s},this.shrinkToFit=o??!0}get data(){return this._data}set data(t){this.setDataWithSize(t,t.length,!0)}get dataInt32(){return this._dataInt32||(this._dataInt32=new Int32Array(this.data.buffer)),this._dataInt32}get static(){return!!(this.descriptor.usage&s.S.STATIC)}set static(t){t?this.descriptor.usage|=s.S.STATIC:this.descriptor.usage&=~s.S.STATIC}setDataWithSize(t,e,r){if(this._updateID++,this._updateSize=e*t.BYTES_PER_ELEMENT,this._data===t)return void(r&&this.emit("update",this));const n=this._data;this._data=t,this._dataInt32=null,n&&n.length===t.length||!this.shrinkToFit&&n&&t.byteLength<n.byteLength?r&&this.emit("update",this):(this.descriptor.size=t.byteLength,this._resourceId=(0,i.L)("resource"),this.emit("change",this))}update(t){this._updateSize=t??this._updateSize,this._updateID++,this.emit("update",this)}unload(){this.emit("unload",this);for(const t in this._gpuData)this._gpuData[t]?.destroy();this._gpuData=Object.create(null)}destroy(){this.destroyed=!0,this.unload(),this.emit("destroy",this),this.emit("change",this),this._data=null,this.descriptor=null,this.removeAllListeners()}}},1132:(t,e,r)=>{r.d(e,{S:()=>n});var n=(t=>(t[t.MAP_READ=1]="MAP_READ",t[t.MAP_WRITE=2]="MAP_WRITE",t[t.COPY_SRC=4]="COPY_SRC",t[t.COPY_DST=8]="COPY_DST",t[t.INDEX=16]="INDEX",t[t.VERTEX=32]="VERTEX",t[t.UNIFORM=64]="UNIFORM",t[t.STORAGE=128]="STORAGE",t[t.INDIRECT=256]="INDIRECT",t[t.QUERY_RESOLVE=512]="QUERY_RESOLVE",t[t.STATIC=1024]="STATIC",t))(n||{})},6736:(t,e,r)=>{function n(t,e,r,n){if(r??(r=0),n??(n=Math.min(t.byteLength-r,e.byteLength)),7&r||7&n)if(3&r||3&n)new Uint8Array(e).set(new Uint8Array(t,r,n));else{const i=n/4;new Float32Array(e,0,i).set(new Float32Array(t,r,i))}else{const i=n/8;new Float64Array(e,0,i).set(new Float64Array(t,r,i))}}r.d(e,{W:()=>n})},6011:(t,e,r)=>{r.d(e,{V:()=>h});var n=r(8875),i=r(9636),s=r(133),o=r(949),a=r(1132);function l(t,e){if(!(t instanceof o.h)){let r=e?a.S.INDEX:a.S.VERTEX;t instanceof Array&&(e?(t=new Uint32Array(t),r=a.S.INDEX|a.S.COPY_DST):(t=new Float32Array(t),r=a.S.VERTEX|a.S.COPY_DST)),t=new o.h({data:t,label:e?"index-mesh-buffer":"vertex-mesh-buffer",usage:r})}return t}class h extends n.A{constructor(t={}){super(),this._gpuData=Object.create(null),this.autoGarbageCollect=!0,this._gcLastUsed=-1,this.uid=(0,s.L)("geometry"),this._layoutKey=0,this.instanceCount=1,this._bounds=new i.c,this._boundsDirty=!0;const{attributes:e,indexBuffer:r,topology:n}=t;if(this.buffers=[],this.attributes={},e)for(const t in e)this.addAttribute(t,e[t]);this.instanceCount=t.instanceCount??1,r&&this.addIndex(r),this.topology=n||"triangle-list"}onBufferUpdate(){this._boundsDirty=!0,this.emit("update",this)}getAttribute(t){return this.attributes[t]}getIndex(){return this.indexBuffer}getBuffer(t){return this.getAttribute(t).buffer}getSize(){for(const t in this.attributes){const e=this.attributes[t];return e.buffer.data.length/(e.stride/4||e.size)}return 0}addAttribute(t,e){const r=function(t){return(t instanceof o.h||Array.isArray(t)||t.BYTES_PER_ELEMENT)&&(t={buffer:t}),t.buffer=l(t.buffer,!1),t}(e);-1===this.buffers.indexOf(r.buffer)&&(this.buffers.push(r.buffer),r.buffer.on("update",this.onBufferUpdate,this),r.buffer.on("change",this.onBufferUpdate,this)),this.attributes[t]=r}addIndex(t){this.indexBuffer=l(t,!0),this.buffers.push(this.indexBuffer)}get bounds(){return this._boundsDirty?(this._boundsDirty=!1,function(t,e,r){const n=t.getAttribute(e);if(!n)return r.minX=0,r.minY=0,r.maxX=0,r.maxY=0,r;const i=n.buffer.data;let s=1/0,o=1/0,a=-1/0,l=-1/0;const h=i.BYTES_PER_ELEMENT,u=(n.offset||0)/h,c=(n.stride||8)/h;for(let t=u;t<i.length;t+=c){const e=i[t],r=i[t+1];e>a&&(a=e),r>l&&(l=r),e<s&&(s=e),r<o&&(o=r)}return r.minX=s,r.minY=o,r.maxX=a,r.maxY=l,r}(this,"aPosition",this._bounds)):this._bounds}unload(){this.emit("unload",this);for(const t in this._gpuData)this._gpuData[t]?.destroy();this._gpuData=Object.create(null)}destroy(t=!1){this.emit("destroy",this),this.removeAllListeners(),t&&this.buffers.forEach((t=>t.destroy())),this.unload(),this.indexBuffer?.destroy(),this.attributes=null,this.buffers=null,this.indexBuffer=null,this._bounds=null}}},8306:(t,e,r)=>{r.d(e,{m:()=>i});const n={uint8x2:{size:2,stride:2,normalised:!1},uint8x4:{size:4,stride:4,normalised:!1},sint8x2:{size:2,stride:2,normalised:!1},sint8x4:{size:4,stride:4,normalised:!1},unorm8x2:{size:2,stride:2,normalised:!0},unorm8x4:{size:4,stride:4,normalised:!0},snorm8x2:{size:2,stride:2,normalised:!0},snorm8x4:{size:4,stride:4,normalised:!0},uint16x2:{size:2,stride:4,normalised:!1},uint16x4:{size:4,stride:8,normalised:!1},sint16x2:{size:2,stride:4,normalised:!1},sint16x4:{size:4,stride:8,normalised:!1},unorm16x2:{size:2,stride:4,normalised:!0},unorm16x4:{size:4,stride:8,normalised:!0},snorm16x2:{size:2,stride:4,normalised:!0},snorm16x4:{size:4,stride:8,normalised:!0},float16x2:{size:2,stride:4,normalised:!1},float16x4:{size:4,stride:8,normalised:!1},float32:{size:1,stride:4,normalised:!1},float32x2:{size:2,stride:8,normalised:!1},float32x3:{size:3,stride:12,normalised:!1},float32x4:{size:4,stride:16,normalised:!1},uint32:{size:1,stride:4,normalised:!1},uint32x2:{size:2,stride:8,normalised:!1},uint32x3:{size:3,stride:12,normalised:!1},uint32x4:{size:4,stride:16,normalised:!1},sint32:{size:1,stride:4,normalised:!1},sint32x2:{size:2,stride:8,normalised:!1},sint32x3:{size:3,stride:12,normalised:!1},sint32x4:{size:4,stride:16,normalised:!1}};function i(t){return n[t]??n.float32}},848:(t,e,r)=>{r.d(e,{L:()=>i});var n=r(133);class i{constructor(){this.uid=(0,n.L)("instructionSet"),this.instructions=[],this.instructionSize=0,this.renderables=[],this.gcTick=0}reset(){this.instructionSize=0}destroy(){this.instructions.length=0,this.renderables.length=0,this.renderPipes=null,this.gcTick=0}add(t){this.instructions[this.instructionSize++]=t}log(){this.instructions.length=this.instructionSize,console.table(this.instructions,["type","action"])}}},8475:(t,e,r)=>{r.d(e,{M:()=>u});var n=r(8875),i=r(133),s=r(9113),o=r(3513),a=r(3012),l=r(5099),h=r(5811);class u extends n.A{constructor(t){super(),this.uid=(0,i.L)("shader"),this._uniformBindMap=Object.create(null),this._ownedBindGroups=[],this._destroyed=!1;let{gpuProgram:e,glProgram:r,groups:n,resources:s,compatibleRenderers:a,groupMap:u}=t;this.gpuProgram=e,this.glProgram=r,void 0===a&&(a=0,e&&(a|=l.W.WEBGPU),r&&(a|=l.W.WEBGL)),this.compatibleRenderers=a;const c={};if(s||n||(s={}),s&&n)throw new Error("[Shader] Cannot have both resources and groups");if(!e&&n&&!u)throw new Error("[Shader] No group map or WebGPU shader provided - consider using resources instead.");if(!e&&n&&u)for(const t in u)for(const e in u[t]){const r=u[t][e];c[r]={group:t,binding:e,name:r}}else if(e&&n&&!u){const t=e.structsAndGroups.groups;u={},t.forEach((t=>{u[t.group]=u[t.group]||{},u[t.group][t.binding]=t.name,c[t.name]=t}))}else if(s){if(n={},u={},e){e.structsAndGroups.groups.forEach((t=>{u[t.group]=u[t.group]||{},u[t.group][t.binding]=t.name,c[t.name]=t}))}let t=0;for(const e in s)c[e]||(n[99]||(n[99]=new o.T,this._ownedBindGroups.push(n[99])),c[e]={group:99,binding:t,name:e},u[99]=u[99]||{},u[99][t]=e,t++);for(const t in s){const e=t;let r=s[t];r.source||r._resourceType||(r=new h.k(r));const i=c[e];i&&(n[i.group]||(n[i.group]=new o.T,this._ownedBindGroups.push(n[i.group])),n[i.group].setResource(r,i.binding))}}this.groups=n,this._uniformBindMap=u,this.resources=this._buildResourceAccessor(n,c)}addResource(t,e,r){var n,i;(n=this._uniformBindMap)[e]||(n[e]={}),(i=this._uniformBindMap[e])[r]||(i[r]=t),this.groups[e]||(this.groups[e]=new o.T,this._ownedBindGroups.push(this.groups[e]))}_buildResourceAccessor(t,e){const r={};for(const n in e){const i=e[n];Object.defineProperty(r,i.name,{get:()=>t[i.group].getResource(i.binding),set(e){t[i.group].setResource(e,i.binding)}})}return r}destroy(t=!1){this._destroyed||(this._destroyed=!0,this.emit("destroy",this),t&&(this.gpuProgram?.destroy(),this.glProgram?.destroy()),this.gpuProgram=null,this.glProgram=null,this.removeAllListeners(),this._uniformBindMap=null,this._ownedBindGroups.forEach((t=>{t.destroy()})),this._ownedBindGroups=null,this.resources=null,this.groups=null)}static from(t){const{gpu:e,gl:r,...n}=t;let i,o;return e&&(i=a.B.from(e)),r&&(o=s.M.from(r)),new u({gpuProgram:i,glProgram:o,...n})}}},5811:(t,e,r)=>{r.d(e,{k:()=>h});var n=r(133),i=r(7952);const s=["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>"],o=s.reduce(((t,e)=>(t[e]=!0,t)),{});function a(t,e){switch(t){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}const l=class t{constructor(e,r){this._touched=0,this.uid=(0,n.L)("uniform"),this._resourceType="uniformGroup",this._resourceId=(0,n.L)("resource"),this.isUniformGroup=!0,this._dirtyId=0,this.destroyed=!1,r={...t.defaultOptions,...r},this.uniformStructures=e;const l={};for(const t in e){const r=e[t];if(r.name=t,r.size=r.size??1,!o[r.type]){const t=r.type.match(/^array<(\w+(?:<\w+>)?),\s*(\d+)>$/);if(t){const[,e,n]=t;throw new Error(`Uniform type ${r.type} is not supported. Use type: '${e}', size: ${n} instead.`)}throw new Error(`Uniform type ${r.type} is not supported. Supported uniform types are: ${s.join(", ")}`)}r.value??(r.value=a(r.type,r.size)),l[t]=r.value}this.uniforms=l,this._dirtyId=1,this.ubo=r.ubo,this.isStatic=r.isStatic,this._signature=(0,i.X)(Object.keys(l).map((t=>`${t}-${e[t].type}`)).join("-"),"uniform-group")}update(){this._dirtyId++}};l.defaultOptions={ubo:!1,isStatic:!1};let h=l},7547:(t,e,r)=>{r.d(e,{U:()=>s});const n={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},i=class t{constructor(){this.data=0,this.blendMode="normal",this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(1&this.data)}set blend(t){!!(1&this.data)!==t&&(this.data^=1)}get offsets(){return!!(2&this.data)}set offsets(t){!!(2&this.data)!==t&&(this.data^=2)}set cullMode(t){"none"!==t?(this.culling=!0,this.clockwiseFrontFace="front"===t):this.culling=!1}get cullMode(){return this.culling?this.clockwiseFrontFace?"front":"back":"none"}get culling(){return!!(4&this.data)}set culling(t){!!(4&this.data)!==t&&(this.data^=4)}get depthTest(){return!!(8&this.data)}set depthTest(t){!!(8&this.data)!==t&&(this.data^=8)}get depthMask(){return!!(32&this.data)}set depthMask(t){!!(32&this.data)!==t&&(this.data^=32)}get clockwiseFrontFace(){return!!(16&this.data)}set clockwiseFrontFace(t){!!(16&this.data)!==t&&(this.data^=16)}get blendMode(){return this._blendMode}set blendMode(t){this.blend="none"!==t,this._blendMode=t,this._blendModeId=n[t]||0}get polygonOffset(){return this._polygonOffset}set polygonOffset(t){this.offsets=!!t,this._polygonOffset=t}toString(){return`[pixi.js/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`}static for2d(){const e=new t;return e.depthTest=!1,e.blend=!0,e}};i.default2d=i.for2d();let s=i},1957:(t,e,r)=>{r.d(e,{K:()=>i,Q:()=>n});const n={normal:"normal-npm",add:"add-npm",screen:"screen-npm"};var i=(t=>(t[t.DISABLED=0]="DISABLED",t[t.RENDERING_MASK_ADD=1]="RENDERING_MASK_ADD",t[t.MASK_ACTIVE=2]="MASK_ACTIVE",t[t.INVERSE_MASK_ACTIVE=3]="INVERSE_MASK_ACTIVE",t[t.RENDERING_MASK_REMOVE=4]="RENDERING_MASK_REMOVE",t[t.NONE=5]="NONE",t))(i||{})},800:(t,e,r)=>{r.d(e,{k:()=>g});var n=r(2577),i=r(8507);const s=[];async function o(t){if(!t)for(let t=0;t<s.length;t++){const e=s[t];if(e.value.test())return void await e.value.load()}}i.XO.handleByNamedList(i.Ag.Environment,s);var a=r(5559),l=r(4577),h=r(133),u=r(4670),c=r(6083),d=r(1257),f=r(7729),p=r(8875);const y=["init","destroy","contextChange","resolutionChange","resetState","renderEnd","renderStart","render","update","postrender","prerender"],m=class t extends p.A{constructor(t){super(),this.tick=0,this.uid=(0,h.L)("renderer"),this.runners=Object.create(null),this.renderPipes=Object.create(null),this._initOptions={},this._systemsHash=Object.create(null),this.type=t.type,this.name=t.name,this.config=t;const e=[...y,...this.config.runners??[]];this._addRunners(...e),this._unsafeEvalCheck()}async init(e={}){const r=!0===e.skipExtensionImports||!1===e.manageImports;await o(r),this._addSystems(this.config.systems),this._addPipes(this.config.renderPipes,this.config.renderPipeAdaptors);for(const t in this._systemsHash){e={...this._systemsHash[t].constructor.defaultOptions,...e}}e={...t.defaultOptions,...e},this._roundPixels=e.roundPixels?1:0;for(let t=0;t<this.runners.init.items.length;t++)await this.runners.init.items[t].init(e);this._initOptions=e}render(t,e){this.tick++;let r=t;if(r instanceof a.mc&&(r={container:r},e&&((0,u.t6)(u.lj,"passing a second argument is deprecated, please use render options instead"),r.target=e.renderTexture)),r.target||(r.target=this.view.renderTarget),r.target===this.view.renderTarget&&(this._lastObjectRendered=r.container,r.clearColor??(r.clearColor=this.background.colorRgba),r.clear??(r.clear=this.background.clearBeforeRender)),r.clearColor){const t=Array.isArray(r.clearColor)&&4===r.clearColor.length;r.clearColor=t?r.clearColor:n.Q.shared.setValue(r.clearColor).toArray()}r.transform||(r.container.updateLocalTransform(),r.transform=r.container.localTransform),r.container.visible&&(r.container.enableRenderGroup(),this.runners.prerender.emit(r),this.runners.renderStart.emit(r),this.runners.render.emit(r),this.runners.renderEnd.emit(r),this.runners.postrender.emit(r))}resize(t,e,r){const n=this.view.resolution;this.view.resize(t,e,r),this.emit("resize",this.view.screen.width,this.view.screen.height,this.view.resolution),void 0!==r&&r!==n&&this.runners.resolutionChange.emit(r)}clear(t={}){t.target||(t.target=this.renderTarget.renderTarget),t.clearColor||(t.clearColor=this.background.colorRgba),t.clear??(t.clear=d.u.ALL);const{clear:e,clearColor:r,target:i,mipLevel:s,layer:o}=t;n.Q.shared.setValue(r??this.background.colorRgba),this.renderTarget.clear(i,e,n.Q.shared.toArray(),s??0,o??0)}get resolution(){return this.view.resolution}set resolution(t){this.view.resolution=t,this.runners.resolutionChange.emit(t)}get width(){return this.view.texture.frame.width}get height(){return this.view.texture.frame.height}get canvas(){return this.view.canvas}get lastObjectRendered(){return this._lastObjectRendered}get renderingToScreen(){return this.renderTarget.renderingToScreen}get screen(){return this.view.screen}_addRunners(...t){t.forEach((t=>{this.runners[t]=new f.C(t)}))}_addSystems(t){let e;for(e in t){const r=t[e];this._addSystem(r.value,r.name)}}_addSystem(t,e){const r=new t(this);if(this[e])throw new Error(`Whoops! The name "${e}" is already in use`);this[e]=r,this._systemsHash[e]=r;for(const t in this.runners)this.runners[t].add(r);return this}_addPipes(t,e){const r=e.reduce(((t,e)=>(t[e.name]=e.value,t)),{});t.forEach((t=>{const e=t.value,n=t.name,i=r[n];this.renderPipes[n]=new e(this,i?new i:null),this.runners.destroy.add(this.renderPipes[n])}))}destroy(t=!1){this.runners.destroy.items.reverse(),this.runners.destroy.emit(t),(!0===t||"object"==typeof t&&t.releaseGlobalResources)&&c.L.release(),Object.values(this.runners).forEach((t=>{t.destroy()})),this._systemsHash=null,this.renderPipes=null,this.removeAllListeners()}generateTexture(t){return this.textureGenerator.generateTexture(t)}get roundPixels(){return!!this._roundPixels}_unsafeEvalCheck(){if(!(0,l.f)())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()}};m.defaultOptions={resolution:1,failIfMajorPerformanceCaveat:!1,roundPixels:!1};let g=m},7729:(t,e,r)=>{r.d(e,{C:()=>n});class n{constructor(t){this.items=[],this._name=t}emit(t,e,r,n,i,s,o,a){const{name:l,items:h}=this;for(let u=0,c=h.length;u<c;u++)h[u][l](t,e,r,n,i,s,o,a);return this}add(t){return t[this._name]&&(this.remove(t),this.items.push(t)),this}remove(t){const e=this.items.indexOf(t);return-1!==e&&this.items.splice(e,1),this}contains(t){return-1!==this.items.indexOf(t)}removeAll(){return this.items.length=0,this}destroy(){this.removeAll(),this.items=null,this._name=null}get empty(){return 0===this.items.length}get name(){return this._name}}},7608:(t,e,r)=>{r.d(e,{N:()=>o});var n=r(1761),i=r(9939),s=r(6083);const o=new class{constructor(t){this._canvasPool=Object.create(null),this.canvasOptions=t||{},this.enableFullScreen=!1}_createCanvasAndContext(t,e){const r=n.e.get().createCanvas();r.width=t,r.height=e;const i=r.getContext("2d");return{canvas:r,context:i}}getOptimalCanvasAndContext(t,e,r=1){t=Math.ceil(t*r-1e-6),e=Math.ceil(e*r-1e-6);const n=((t=(0,i.U5)(t))<<17)+((e=(0,i.U5)(e))<<1);this._canvasPool[n]||(this._canvasPool[n]=[]);let s=this._canvasPool[n].pop();return s||(s=this._createCanvasAndContext(t,e)),s}returnCanvasAndContext(t){const e=t.canvas,{width:r,height:n}=e,i=(r<<17)+(n<<1);t.context.resetTransform(),t.context.clearRect(0,0,r,n),this._canvasPool[i].push(t)}clear(){this._canvasPool={}}};s.L.register(o)},5589:(t,e,r)=>{r.d(e,{g:()=>d});var n=r(8875),i=r(2079),s=r(9252),o=r(133),a=r(4670);const l=()=>{};var h=r(4195),u=r(583),c=r(1196);class d extends n.A{constructor({source:t,label:e,frame:r,orig:n,trim:i,defaultAnchor:a,defaultBorders:l,rotate:h,dynamic:c}={}){if(super(),this.uid=(0,o.L)("texture"),this.uvs={x0:0,y0:0,x1:0,y1:0,x2:0,y2:0,x3:0,y3:0},this.frame=new s.M,this.noFrame=!1,this.dynamic=!1,this.isTexture=!0,this.label=e,this.source=t?.source??new u.v,this.noFrame=!r,r)this.frame.copyFrom(r);else{const{width:t,height:e}=this._source;this.frame.width=t,this.frame.height=e}this.orig=n||this.frame,this.trim=i,this.rotate=h??0,this.defaultAnchor=a,this.defaultBorders=l,this.destroyed=!1,this.dynamic=c||!1,this.updateUvs()}set source(t){this._source&&this._source.off("resize",this.update,this),this._source=t,t.on("resize",this.update,this),this.emit("update",this)}get source(){return this._source}get textureMatrix(){return this._textureMatrix||(this._textureMatrix=new c.N(this)),this._textureMatrix}get width(){return this.orig.width}get height(){return this.orig.height}updateUvs(){const{uvs:t,frame:e}=this,{width:r,height:n}=this._source,s=e.x/r,o=e.y/n,a=e.width/r,l=e.height/n;let h=this.rotate;if(h){const e=a/2,r=l/2,n=s+e,u=o+r;h=i.E.add(h,i.E.NW),t.x0=n+e*i.E.uX(h),t.y0=u+r*i.E.uY(h),h=i.E.add(h,2),t.x1=n+e*i.E.uX(h),t.y1=u+r*i.E.uY(h),h=i.E.add(h,2),t.x2=n+e*i.E.uX(h),t.y2=u+r*i.E.uY(h),h=i.E.add(h,2),t.x3=n+e*i.E.uX(h),t.y3=u+r*i.E.uY(h)}else t.x0=s,t.y0=o,t.x1=s+a,t.y1=o,t.x2=s+a,t.y2=o+l,t.x3=s,t.y3=o+l}destroy(t=!1){this._source&&(this._source.off("resize",this.update,this),t&&(this._source.destroy(),this._source=null)),this._textureMatrix=null,this.destroyed=!0,this.emit("destroy",this),this.removeAllListeners()}update(){this.noFrame&&(this.frame.width=this._source.width,this.frame.height=this._source.height),this.updateUvs(),this.emit("update",this)}get baseTexture(){return(0,a.t6)(a.lj,"Texture.baseTexture is now Texture.source"),this._source}}d.EMPTY=new d({label:"EMPTY",source:new u.v({label:"EMPTY"})}),d.EMPTY.destroy=l,d.WHITE=new d({source:new h.P({resource:new Uint8Array([255,255,255,255]),width:1,height:1,alphaMode:"premultiply-alpha-on-upload",label:"WHITE"}),label:"WHITE"}),d.WHITE.destroy=l},1196:(t,e,r)=>{r.d(e,{N:()=>s});var n=r(9313);const i=new n.u;class s{constructor(t,e){this.mapCoord=new n.u,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,this.clampMargin=void 0===e?t.width<10?0:.5:e,this.isSimple=!1,this.texture=t}get texture(){return this._texture}set texture(t){this.texture!==t&&(this._texture?.removeListener("update",this.update,this),this._texture=t,this._texture.addListener("update",this.update,this),this.update())}multiplyUvs(t,e){void 0===e&&(e=t);const r=this.mapCoord;for(let n=0;n<t.length;n+=2){const i=t[n],s=t[n+1];e[n]=i*r.a+s*r.c+r.tx,e[n+1]=i*r.b+s*r.d+r.ty}return e}update(){const t=this._texture;this._updateID++;const e=t.uvs;this.mapCoord.set(e.x1-e.x0,e.y1-e.y0,e.x3-e.x0,e.y3-e.y0,e.x0,e.y0);const r=t.orig,n=t.trim;n&&(i.set(r.width/n.width,0,0,r.height/n.height,-n.x/n.width,-n.y/n.height),this.mapCoord.append(i));const s=t.source,o=this.uClampFrame,a=this.clampMargin/s._resolution,l=this.clampOffset/s._resolution;return o[0]=(t.frame.x+a+l)/s.width,o[1]=(t.frame.y+a+l)/s.height,o[2]=(t.frame.x+t.frame.width-a+l)/s.width,o[3]=(t.frame.y+t.frame.height-a+l)/s.height,this.uClampOffset[0]=this.clampOffset/s.pixelWidth,this.uClampOffset[1]=this.clampOffset/s.pixelHeight,this.isSimple=t.frame.width===s.width&&t.frame.height===s.height&&0===t.rotate,!0}}},2437:(t,e,r)=>{r.d(e,{W:()=>h});var n=r(9939),i=r(6083),s=r(583),o=r(5589),a=r(218);let l=0;const h=new class{constructor(t){this._poolKeyHash=Object.create(null),this._texturePool={},this.textureOptions=t||{},this.enableFullScreen=!1,this.textureStyle=new a.n(this.textureOptions)}createTexture(t,e,r,n){const i=new s.v({...this.textureOptions,width:t,height:e,resolution:1,antialias:r,autoGarbageCollect:!1,autoGenerateMipmaps:n});return new o.g({source:i,label:"texturePool_"+l++})}getOptimalTexture(t,e,r=1,i,s=!1){let o=Math.ceil(t*r-1e-6),a=Math.ceil(e*r-1e-6);o=(0,n.U5)(o),a=(0,n.U5)(a);const l=(o<<17)+(a<<2)+((s?1:0)<<1)+(i?1:0);this._texturePool[l]||(this._texturePool[l]=[]);let h=this._texturePool[l].pop();return h||(h=this.createTexture(o,a,i,s)),h.source._resolution=r,h.source.width=o/r,h.source.height=a/r,h.source.pixelWidth=o,h.source.pixelHeight=a,h.frame.x=0,h.frame.y=0,h.frame.width=t,h.frame.height=e,h.updateUvs(),this._poolKeyHash[h.uid]=l,h}getSameSizeTexture(t,e=!1){const r=t.source;return this.getOptimalTexture(t.width,t.height,r._resolution,e)}returnTexture(t,e=!1){const r=this._poolKeyHash[t.uid];e&&(t.source.style=this.textureStyle),this._texturePool[r].push(t)}clear(t){if(t=!1!==t)for(const t in this._texturePool){const e=this._texturePool[t];if(e)for(let t=0;t<e.length;t++)e[t].destroy(!0)}this._texturePool={}}};i.L.register(h)},218:(t,e,r)=>{r.d(e,{n:()=>l});var n=r(8875),i=r(133),s=r(4670);const o=Object.create(null);const a=class t extends n.A{constructor(e={}){super(),this._resourceType="textureSampler",this._touched=0,this._maxAnisotropy=1,this.destroyed=!1,e={...t.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(t){this.addressModeU=t,this.addressModeV=t,this.addressModeW=t}get addressMode(){return this.addressModeU}set wrapMode(t){(0,s.t6)(s.lj,"TextureStyle.wrapMode is now TextureStyle.addressMode"),this.addressMode=t}get wrapMode(){return this.addressMode}set scaleMode(t){this.magFilter=t,this.minFilter=t,this.mipmapFilter=t}get scaleMode(){return this.magFilter}set maxAnisotropy(t){this._maxAnisotropy=Math.min(t,16),this._maxAnisotropy>1&&(this.scaleMode="linear")}get maxAnisotropy(){return this._maxAnisotropy}get _resourceId(){return this._sharedResourceId||this._generateResourceId()}update(){this._sharedResourceId=null,this.emit("change",this)}_generateResourceId(){const t=`${this.addressModeU}-${this.addressModeV}-${this.addressModeW}-${this.magFilter}-${this.minFilter}-${this.mipmapFilter}-${this.lodMinClamp}-${this.lodMaxClamp}-${this.compare}-${this._maxAnisotropy}`;return this._sharedResourceId=function(t){const e=o[t];return void 0===e&&(o[t]=(0,i.L)("resource")),e}(t),this._resourceId}destroy(){this.destroyed=!0,this.emit("destroy",this),this.emit("change",this),this.removeAllListeners()}};a.defaultOptions={addressMode:"clamp-to-edge",scaleMode:"linear"};let l=a},4195:(t,e,r)=>{r.d(e,{P:()=>s});var n=r(8507),i=r(583);class s extends i.v{constructor(t){const e=t.resource||new Float32Array(t.width*t.height*4);let r=t.format;r||(r=e instanceof Float32Array?"rgba32float":e instanceof Int32Array||e instanceof Uint32Array?"rgba32uint":e instanceof Int16Array||e instanceof Uint16Array?"rgba16uint":(Int8Array,"bgra8unorm")),super({...t,resource:e,format:r}),this.uploadMethodId="buffer"}static test(t){return t instanceof Int8Array||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array}}s.extension=n.Ag.TextureSource},4884:(t,e,r)=>{r.d(e,{q:()=>o});var n=r(1761),i=r(8507),s=r(583);class o extends s.v{constructor(t){t.resource||(t.resource=n.e.get().createCanvas()),t.width||(t.width=t.resource.width,t.autoDensity||(t.width/=t.resolution)),t.height||(t.height=t.resource.height,t.autoDensity||(t.height/=t.resolution)),super(t),this.uploadMethodId="image",this.autoDensity=t.autoDensity,this.resizeCanvas(),this.transparent=!!t.transparent}resizeCanvas(){this.autoDensity&&"style"in this.resource&&(this.resource.style.width=`${this.width}px`,this.resource.style.height=`${this.height}px`),this.resource.width===this.pixelWidth&&this.resource.height===this.pixelHeight||(this.resource.width=this.pixelWidth,this.resource.height=this.pixelHeight)}resize(t=this.width,e=this.height,r=this._resolution){const n=super.resize(t,e,r);return n&&this.resizeCanvas(),n}static test(t){return globalThis.HTMLCanvasElement&&t instanceof HTMLCanvasElement||globalThis.OffscreenCanvas&&t instanceof OffscreenCanvas}get context2D(){return this._context2D||(this._context2D=this.resource.getContext("2d"))}}o.extension=i.Ag.TextureSource},8293:(t,e,r)=>{r.d(e,{b:()=>s});var n=r(8507),i=r(583);class s extends i.v{constructor(t){super(t),this.uploadMethodId="image",this.autoGarbageCollect=!0}static test(t){return globalThis.HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap||globalThis.VideoFrame&&t instanceof VideoFrame}}s.extension=n.Ag.TextureSource},583:(t,e,r)=>{r.d(e,{v:()=>h});var n=r(8875),i=r(9939),s=r(2698),o=r(133),a=r(218);const l=class t extends n.A{constructor(e={}){super(),this.options=e,this._gpuData=Object.create(null),this._gcLastUsed=-1,this.uid=(0,o.L)("textureSource"),this._resourceType="textureSource",this._resourceId=(0,o.L)("resource"),this.uploadMethodId="unknown",this._resolution=1,this.pixelWidth=1,this.pixelHeight=1,this.width=1,this.height=1,this.sampleCount=1,this.mipLevelCount=1,this.autoGenerateMipmaps=!1,this.format="rgba8unorm",this.dimension="2d",this.viewDimension="2d",this.arrayLayerCount=1,this.antialias=!1,this._touched=0,this._batchTick=-1,this._textureBindLocation=-1,e={...t.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.viewDimension=e.viewDimension??e.dimensions,this.arrayLayerCount=e.arrayLayerCount,this.mipLevelCount=e.mipLevelCount,this.autoGenerateMipmaps=e.autoGenerateMipmaps,this.sampleCount=e.sampleCount,this.antialias=e.antialias,this.alphaMode=e.alphaMode,this.style=new a.n((0,s.S)(e)),this.destroyed=!1,this._refreshPOT()}get source(){return this}get style(){return this._style}set style(t){this.style!==t&&(this._style?.off("change",this._onStyleChange,this),this._style=t,this._style?.on("change",this._onStyleChange,this),this._onStyleChange())}set maxAnisotropy(t){this._style.maxAnisotropy=t}get maxAnisotropy(){return this._style.maxAnisotropy}get addressMode(){return this._style.addressMode}set addressMode(t){this._style.addressMode=t}get repeatMode(){return this._style.addressMode}set repeatMode(t){this._style.addressMode=t}get magFilter(){return this._style.magFilter}set magFilter(t){this._style.magFilter=t}get minFilter(){return this._style.minFilter}set minFilter(t){this._style.minFilter=t}get mipmapFilter(){return this._style.mipmapFilter}set mipmapFilter(t){this._style.mipmapFilter=t}get lodMinClamp(){return this._style.lodMinClamp}set lodMinClamp(t){this._style.lodMinClamp=t}get lodMaxClamp(){return this._style.lodMaxClamp}set lodMaxClamp(t){this._style.lodMaxClamp=t}_onStyleChange(){this.emit("styleChange",this)}update(){if(this.resource){const t=this._resolution;if(this.resize(this.resourceWidth/t,this.resourceHeight/t))return}this.emit("update",this)}destroy(){this.destroyed=!0,this.unload(),this.emit("destroy",this),this._style&&(this._style.destroy(),this._style=null),this.uploadMethodId=null,this.resource=null,this.removeAllListeners()}unload(){this._resourceId=(0,o.L)("resource"),this.emit("change",this),this.emit("unload",this);for(const t in this._gpuData)this._gpuData[t]?.destroy?.();this._gpuData=Object.create(null)}get resourceWidth(){const{resource:t}=this;return t.naturalWidth||t.videoWidth||t.displayWidth||t.width}get resourceHeight(){const{resource:t}=this;return t.naturalHeight||t.videoHeight||t.displayHeight||t.height}get resolution(){return this._resolution}set resolution(t){this._resolution!==t&&(this._resolution=t,this.width=this.pixelWidth/t,this.height=this.pixelHeight/t)}resize(t,e,r){r||(r=this._resolution),t||(t=this.width),e||(e=this.height);const n=Math.round(t*r),i=Math.round(e*r);return this.width=n/r,this.height=i/r,this._resolution=r,(this.pixelWidth!==n||this.pixelHeight!==i)&&(this._refreshPOT(),this.pixelWidth=n,this.pixelHeight=i,this.emit("resize",this),this._resourceId=(0,o.L)("resource"),this.emit("change",this),!0)}updateMipmaps(){this.autoGenerateMipmaps&&this.mipLevelCount>1&&this.emit("updateMipmaps",this)}set wrapMode(t){this._style.wrapMode=t}get wrapMode(){return this._style.wrapMode}set scaleMode(t){this._style.scaleMode=t}get scaleMode(){return this._style.scaleMode}_refreshPOT(){this.isPowerOfTwo=(0,i.f3)(this.pixelWidth)&&(0,i.f3)(this.pixelHeight)}static test(t){throw new Error("Unimplemented")}};l.defaultOptions={resolution:1,format:"bgra8unorm",alphaMode:"premultiply-alpha-on-upload",dimensions:"2d",viewDimension:"2d",arrayLayerCount:1,mipLevelCount:1,autoGenerateMipmaps:!1,sampleCount:1,antialias:!1,autoGarbageCollect:!1};let h=l},9726:(t,e,r)=>{var n=r(268),i=r(2406);const s=new class{constructor(){this._parsers=[],this._cache=new Map,this._cacheMap=new Map}reset(){this._cacheMap.clear(),this._cache.clear()}has(t){return this._cache.has(t)}get(t){const e=this._cache.get(t);return e||(0,n.R)(`[Assets] Asset id ${t} was not found in the Cache`),e}set(t,e){const r=(0,i.z)(t);let s;for(let t=0;t<this.parsers.length;t++){const n=this.parsers[t];if(n.test(e)){s=n.getCacheableAssets(r,e);break}}const o=new Map(Object.entries(s||{}));s||r.forEach((t=>{o.set(t,e)}));const a=[...o.keys()],l={cacheKeys:a,keys:r};r.forEach((t=>{this._cacheMap.set(t,l)})),a.forEach((t=>{const r=s?s[t]:e;this._cache.has(t)&&this._cache.get(t)!==r&&(0,n.R)("[Cache] already has key:",t),this._cache.set(t,o.get(t))}))}remove(t){if(!this._cacheMap.has(t))return void(0,n.R)(`[Assets] Asset id ${t} was not found in the Cache`);const e=this._cacheMap.get(t);e.cacheKeys.forEach((t=>{this._cache.delete(t)})),e.keys.forEach((t=>{this._cacheMap.delete(t)}))}get parsers(){return this._parsers}};var o=r(8507),a=r(583),l=r(5589);const h=[];function u(t={}){const e=t&&t.resource,r=e?t.resource:t,n=e?t:{resource:t};for(let t=0;t<h.length;t++){const e=h[t];if(e.test(r))return new e(n)}throw new Error(`Could not find a source type for resource: ${n.resource}`)}o.XO.handleByList(o.Ag.TextureSource,h),l.g.from=function(t,e=!1){return"string"==typeof t?s.get(t):t instanceof a.v?new l.g({source:t}):function(t={},e=!1){const r=t&&t.resource,n=r?t.resource:t,i=r?t:{resource:t};if(!e&&s.has(n))return s.get(n);const o=new l.g({source:u(i)});return o.on("destroy",(()=>{s.has(n)&&s.remove(n)})),e||s.set(n,o),o}(t,e)},a.v.from=u},7952:(t,e,r)=>{r.d(e,{X:()=>s});const n=Object.create(null),i=Object.create(null);function s(t,e){let r=i[t];return void 0===r&&(void 0===n[e]&&(n[e]=1),i[t]=r=n[e]++),r}},5099:(t,e,r)=>{r.d(e,{W:()=>n});var n=(t=>(t[t.WEBGL=1]="WEBGL",t[t.WEBGPU=2]="WEBGPU",t[t.CANVAS=4]="CANVAS",t[t.BOTH=3]="BOTH",t))(n||{})},5559:(t,e,r)=>{r.d(e,{mc:()=>X,u:()=>W,ig:()=>N,fR:()=>U});var n=r(8875),i=r(2577);var s=r(8507),o=r(9313),a=r(1652),l=r(2812),h=r(133),u=r(4670),c=r(268),d=r(8655);const f={get isCachedAsTexture(){return!!this.renderGroup?.isCachedAsTexture},cacheAsTexture(t){"boolean"==typeof t&&!1===t?this.disableRenderGroup():(this.enableRenderGroup(),this.renderGroup.enableCacheAsTexture(!0===t?{}:t))},updateCacheTexture(){this.renderGroup?.updateCacheTexture()},get cacheAsBitmap(){return this.isCachedAsTexture},set cacheAsBitmap(t){(0,u.t6)("v8.6.0","cacheAsBitmap is deprecated, use cacheAsTexture instead."),this.cacheAsTexture(t)}};var p=r(9903);const y={allowChildren:!0,removeChildren(t=0,e){const r=e??this.children.length,n=r-t,i=[];if(n>0&&n<=r){for(let e=r-1;e>=t;e--){const t=this.children[e];t&&(i.push(t),t.parent=null)}(0,p.d)(this.children,t,r);const e=this.renderGroup||this.parentRenderGroup;e&&e.removeChildren(i);for(let t=0;t<i.length;++t){const e=i[t];e.parentRenderLayer?.detach(e),this.emit("childRemoved",e,this,t),i[t].emit("removed",this)}return i.length>0&&this._didViewChangeTick++,i}if(0===n&&0===this.children.length)return i;throw new RangeError("removeChildren: numeric values are outside the acceptable range.")},removeChildAt(t){const e=this.getChildAt(t);return this.removeChild(e)},getChildAt(t){if(t<0||t>=this.children.length)throw new Error(`getChildAt: Index (${t}) does not exist.`);return this.children[t]},setChildIndex(t,e){if(e<0||e>=this.children.length)throw new Error(`The index ${e} supplied is out of bounds ${this.children.length}`);this.getChildIndex(t),this.addChildAt(t,e)},getChildIndex(t){const e=this.children.indexOf(t);if(-1===e)throw new Error("The supplied Container must be a child of the caller");return e},addChildAt(t,e){this.allowChildren||(0,u.t6)(u.lj,"addChildAt: Only Containers will be allowed to add children in v8.0.0");const{children:r}=this;if(e<0||e>r.length)throw new Error(`${t}addChildAt: The index ${e} supplied is out of bounds ${r.length}`);const n=t.parent===this;if(t.parent){const r=t.parent.children.indexOf(t);if(n){if(r===e)return t;t.parent.children.splice(r,1)}else t.removeFromParent()}e===r.length?r.push(t):r.splice(e,0,t),t.parent=this,t.didChange=!0,t._updateFlags=15;const i=this.renderGroup||this.parentRenderGroup;return i&&i.addChild(t),this.sortableChildren&&(this.sortDirty=!0),n||(this.emit("childAdded",t,this,e),t.emit("added",this)),t},swapChildren(t,e){if(t===e)return;const r=this.getChildIndex(t),n=this.getChildIndex(e);this.children[r]=e,this.children[n]=t;const i=this.renderGroup||this.parentRenderGroup;i&&(i.structureDidChange=!0),this._didContainerChangeTick++},removeFromParent(){this.parent?.removeChild(this)},reparentChild(...t){return 1===t.length?this.reparentChildAt(t[0],this.children.length):(t.forEach((t=>this.reparentChildAt(t,this.children.length))),t[0])},reparentChildAt(t,e){if(t.parent===this)return this.setChildIndex(t,e),t;const r=t.worldTransform.clone();t.removeFromParent(),this.addChildAt(t,e);const n=this.worldTransform.clone();return n.invert(),r.prepend(n),t.setFromMatrix(r),t},replaceChild(t,e){t.updateLocalTransform(),this.addChildAt(e,this.getChildIndex(t)),e.setFromMatrix(t.localTransform),e.updateLocalTransform(),this.removeChild(t)}},m={collectRenderables(t,e,r){this.parentRenderLayer&&this.parentRenderLayer!==r||this.globalDisplayStatus<7||!this.includeInBuild||(this.sortableChildren&&this.sortChildren(),this.isSimple?this.collectRenderablesSimple(t,e,r):this.renderGroup?e.renderPipes.renderGroup.addRenderGroup(this.renderGroup,t):this.collectRenderablesWithEffects(t,e,r))},collectRenderablesSimple(t,e,r){const n=this.children,i=n.length;for(let s=0;s<i;s++)n[s].collectRenderables(t,e,r)},collectRenderablesWithEffects(t,e,r){const{renderPipes:n}=e;for(let e=0;e<this.effects.length;e++){const r=this.effects[e];n[r.pipe].push(r,this,t)}this.collectRenderablesSimple(t,e,r);for(let e=this.effects.length-1;e>=0;e--){const r=this.effects[e];n[r.pipe].pop(r,this,t)}}};var g=r(9049);const x=new class{constructor(){this._effectClasses=[],this._tests=[],this._initialized=!1}init(){this._initialized||(this._initialized=!0,this._effectClasses.forEach((t=>{this.add({test:t.test,maskClass:t})})))}add(t){this._tests.push(t)}getMaskEffect(t){this._initialized||this.init();for(let e=0;e<this._tests.length;e++){const r=this._tests[e];if(r.test(t))return d.Z.get(r.maskClass,t)}return t}returnMaskEffect(t){d.Z.return(t)}};s.XO.handleByList(s.Ag.MaskEffect,x._effectClasses);const v={_maskEffect:null,_maskOptions:{inverse:!1},_filterEffect:null,effects:[],_markStructureAsChanged(){const t=this.renderGroup||this.parentRenderGroup;t&&(t.structureDidChange=!0)},addEffect(t){-1===this.effects.indexOf(t)&&(this.effects.push(t),this.effects.sort(((t,e)=>t.priority-e.priority)),this._markStructureAsChanged(),this._updateIsSimple())},removeEffect(t){const e=this.effects.indexOf(t);-1!==e&&(this.effects.splice(e,1),this._markStructureAsChanged(),this._updateIsSimple())},set mask(t){const e=this._maskEffect;e?.mask!==t&&(e&&(this.removeEffect(e),x.returnMaskEffect(e),this._maskEffect=null),null!=t&&(this._maskEffect=x.getMaskEffect(t),this.addEffect(this._maskEffect)))},get mask(){return this._maskEffect?.mask},setMask(t){this._maskOptions={...this._maskOptions,...t},t.mask&&(this.mask=t.mask),this._markStructureAsChanged()},set filters(t){!Array.isArray(t)&&t&&(t=[t]);const e=this._filterEffect||(this._filterEffect=new g.a),r=t?.length>0,n=r!==e.filters?.length>0;t=Array.isArray(t)?t.slice(0):t,e.filters=Object.freeze(t),n&&(r?this.addEffect(e):(this.removeEffect(e),e.filters=t??null))},get filters(){return this._filterEffect?.filters},set filterArea(t){this._filterEffect||(this._filterEffect=new g.a),this._filterEffect.filterArea=t},get filterArea(){return this._filterEffect?.filterArea}},b={label:null,get name(){return(0,u.t6)(u.lj,"Container.name property has been removed, use Container.label instead"),this.label},set name(t){(0,u.t6)(u.lj,"Container.name property has been removed, use Container.label instead"),this.label=t},getChildByName(t,e=!1){return this.getChildByLabel(t,e)},getChildByLabel(t,e=!1){const r=this.children;for(let e=0;e<r.length;e++){const n=r[e];if(n.label===t||t instanceof RegExp&&t.test(n.label))return n}if(e)for(let e=0;e<r.length;e++){const n=r[e].getChildByLabel(t,!0);if(n)return n}return null},getChildrenByLabel(t,e=!1,r=[]){const n=this.children;for(let e=0;e<n.length;e++){const i=n[e];(i.label===t||t instanceof RegExp&&t.test(i.label))&&r.push(i)}if(e)for(let e=0;e<n.length;e++)n[e].getChildrenByLabel(t,!0,r);return r}};var _=r(9636),w=r(2208);const S=new o.u,C={getFastGlobalBounds(t,e){e||(e=new _.c),e.clear(),this._getGlobalBoundsRecursive(!!t,e,this.parentRenderLayer),e.isValid||e.set(0,0,0,0);const r=this.renderGroup||this.parentRenderGroup;return e.applyMatrix(r.worldTransform),e},_getGlobalBoundsRecursive(t,e,r){let n=e;if(t&&this.parentRenderLayer&&this.parentRenderLayer!==r)return;if(7!==this.localDisplayStatus||!this.measurable)return;const i=!!this.effects.length;if((this.renderGroup||i)&&(n=w.o.get().clear()),this.boundsArea)e.addRect(this.boundsArea,this.worldTransform);else{if(this.renderPipeId){const t=this.bounds;n.addFrame(t.minX,t.minY,t.maxX,t.maxY,this.groupTransform)}const e=this.children;for(let i=0;i<e.length;i++)e[i]._getGlobalBoundsRecursive(t,n,r)}if(i){let t=!1;const r=this.renderGroup||this.parentRenderGroup;for(let e=0;e<this.effects.length;e++)this.effects[e].addBounds&&(t||(t=!0,n.applyMatrix(r.worldTransform)),this.effects[e].addBounds(n,!0));t&&n.applyMatrix(r.worldTransform.copyTo(S).invert()),e.addBounds(n),w.o.return(n)}else this.renderGroup&&(e.addBounds(n,this.relativeGroupTransform),w.o.return(n))}};var M=r(198),T=r(9443),A=r(7269);function k(t,e){const r=t.children;for(let t=0;t<r.length;t++){const n=r[t],i=n.uid,s=(65535&n._didViewChangeTick)<<16|65535&n._didContainerChangeTick,o=e.index;e.data[o]===i&&e.data[o+1]===s||(e.data[e.index]=i,e.data[e.index+1]=s,e.didChange=!0),e.index=o+2,n.children.length&&k(n,e)}return e.didChange}const P=new o.u,E={_localBoundsCacheId:-1,_localBoundsCacheData:null,_setWidth(t,e){const r=Math.sign(this.scale.x)||1;this.scale.x=0!==e?t/e*r:r},_setHeight(t,e){const r=Math.sign(this.scale.y)||1;this.scale.y=0!==e?t/e*r:r},getLocalBounds(){this._localBoundsCacheData||(this._localBoundsCacheData={data:[],index:1,didChange:!1,localBounds:new _.c});const t=this._localBoundsCacheData;return t.index=1,t.didChange=!1,t.data[0]!==this._didViewChangeTick&&(t.didChange=!0,t.data[0]=this._didViewChangeTick),k(this,t),t.didChange&&(0,A.n)(this,t.localBounds,P),t.localBounds},getBounds(t,e){return(0,T.f)(this,t,e||new _.c)}},R={_onRender:null,set onRender(t){const e=this.renderGroup||this.parentRenderGroup;if(!t)return this._onRender&&e?.removeOnRender(this),void(this._onRender=null);this._onRender||e?.addOnRender(this),this._onRender=t},get onRender(){return this._onRender}},I={_zIndex:0,sortDirty:!1,sortableChildren:!1,get zIndex(){return this._zIndex},set zIndex(t){this._zIndex!==t&&(this._zIndex=t,this.depthOfChildModified())},depthOfChildModified(){this.parent&&(this.parent.sortableChildren=!0,this.parent.sortDirty=!0),this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0)},sortChildren(){this.sortDirty&&(this.sortDirty=!1,this.children.sort(O))}};function O(t,e){return t._zIndex-e._zIndex}var L=r(5101);const B={getGlobalPosition(t=new L.b,e=!1){return this.parent?this.parent.toGlobal(this._position,t,e):(t.x=this._position.x,t.y=this._position.y),t},toGlobal(t,e,r=!1){const n=this.getGlobalTransform(w.u.get(),r);return e=n.apply(t,e),w.u.return(n),e},toLocal(t,e,r,n){e&&(t=e.toGlobal(t,r,n));const i=this.getGlobalTransform(w.u.get(),n);return r=i.applyInverse(t,r),w.u.return(i),r}};var D=r(3284);const F=new l.o(null),j=new l.o(null),G=new l.o(null,1,1),z=new l.o(null),N=1,W=2,U=4;class X extends n.A{constructor(t={}){super(),this.uid=(0,h.L)("renderable"),this._updateFlags=15,this.renderGroup=null,this.parentRenderGroup=null,this.parentRenderGroupIndex=0,this.didChange=!1,this.didViewUpdate=!1,this.relativeRenderGroupDepth=0,this.children=[],this.parent=null,this.includeInBuild=!0,this.measurable=!0,this.isSimple=!0,this.parentRenderLayer=null,this.updateTick=-1,this.localTransform=new o.u,this.relativeGroupTransform=new o.u,this.groupTransform=this.relativeGroupTransform,this.destroyed=!1,this._position=new l.o(this,0,0),this._scale=G,this._pivot=j,this._origin=z,this._skew=F,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=[],function(t,e,r={}){for(const n in e)r[n]||void 0===e[n]||(t[n]=e[n])}(this,t,{children:!0,parent:!0,effects:!0}),t.children?.forEach((t=>this.addChild(t))),t.parent?.addChild(this)}static mixin(t){(0,u.t6)("8.8.0","Container.mixin is deprecated, please use extensions.mixin instead."),s.XO.mixin(X,t)}set _didChangeId(t){this._didViewChangeTick=t>>12&4095,this._didContainerChangeTick=4095&t}get _didChangeId(){return 4095&this._didContainerChangeTick|(4095&this._didViewChangeTick)<<12}addChild(...t){if(this.allowChildren||(0,u.t6)(u.lj,"addChild: Only Containers will be allowed to add children in v8.0.0"),t.length>1){for(let e=0;e<t.length;e++)this.addChild(t[e]);return t[0]}const e=t[0],r=this.renderGroup||this.parentRenderGroup;return e.parent===this?(this.children.splice(this.children.indexOf(e),1),this.children.push(e),r&&(r.structureDidChange=!0),e):(e.parent&&e.parent.removeChild(e),this.children.push(e),this.sortableChildren&&(this.sortDirty=!0),e.parent=this,e.didChange=!0,e._updateFlags=15,r&&r.addChild(e),this.emit("childAdded",e,this,this.children.length-1),e.emit("added",this),this._didViewChangeTick++,0!==e._zIndex&&e.depthOfChildModified(),e)}removeChild(...t){if(t.length>1){for(let e=0;e<t.length;e++)this.removeChild(t[e]);return t[0]}const e=t[0],r=this.children.indexOf(e);return r>-1&&(this._didViewChangeTick++,this.children.splice(r,1),this.renderGroup?this.renderGroup.removeChild(e):this.parentRenderGroup&&this.parentRenderGroup.removeChild(e),e.parentRenderLayer&&e.parentRenderLayer.detach(e),e.parent=null,this.emit("childRemoved",e,this,r),e.emit("removed",this)),e}_onUpdate(t){t&&t===this._skew&&this._updateSkew(),this._didContainerChangeTick++,this.didChange||(this.didChange=!0,this.parentRenderGroup&&this.parentRenderGroup.onChildUpdate(this))}set isRenderGroup(t){!!this.renderGroup!==t&&(t?this.enableRenderGroup():this.disableRenderGroup())}get isRenderGroup(){return!!this.renderGroup}enableRenderGroup(){if(this.renderGroup)return;const t=this.parentRenderGroup;t?.removeChild(this),this.renderGroup=d.Z.get(D.m,this),this.groupTransform=o.u.IDENTITY,t?.addChild(this),this._updateIsSimple()}disableRenderGroup(){if(!this.renderGroup)return;const t=this.parentRenderGroup;t?.removeChild(this),d.Z.return(this.renderGroup),this.renderGroup=null,this.groupTransform=this.relativeGroupTransform,t?.addChild(this),this._updateIsSimple()}_updateIsSimple(){this.isSimple=!this.renderGroup&&0===this.effects.length}get worldTransform(){return this._worldTransform||(this._worldTransform=new o.u),this.renderGroup?this._worldTransform.copyFrom(this.renderGroup.worldTransform):this.parentRenderGroup&&this._worldTransform.appendFrom(this.relativeGroupTransform,this.parentRenderGroup.worldTransform),this._worldTransform}get x(){return this._position.x}set x(t){this._position.x=t}get y(){return this._position.y}set y(t){this._position.y=t}get position(){return this._position}set position(t){this._position.copyFrom(t)}get rotation(){return this._rotation}set rotation(t){this._rotation!==t&&(this._rotation=t,this._onUpdate(this._skew))}get angle(){return this.rotation*a.bO}set angle(t){this.rotation=t*a.Td}get pivot(){return this._pivot===j&&(this._pivot=new l.o(this,0,0)),this._pivot}set pivot(t){this._pivot===j&&(this._pivot=new l.o(this,0,0),this._origin!==z&&(0,c.R)("Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.")),"number"==typeof t?this._pivot.set(t):this._pivot.copyFrom(t)}get skew(){return this._skew===F&&(this._skew=new l.o(this,0,0)),this._skew}set skew(t){this._skew===F&&(this._skew=new l.o(this,0,0)),this._skew.copyFrom(t)}get scale(){return this._scale===G&&(this._scale=new l.o(this,1,1)),this._scale}set scale(t){this._scale===G&&(this._scale=new l.o(this,0,0)),"string"==typeof t&&(t=parseFloat(t)),"number"==typeof t?this._scale.set(t):this._scale.copyFrom(t)}get origin(){return this._origin===z&&(this._origin=new l.o(this,0,0)),this._origin}set origin(t){this._origin===z&&(this._origin=new l.o(this,0,0),this._pivot!==j&&(0,c.R)("Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.")),"number"==typeof t?this._origin.set(t):this._origin.copyFrom(t)}get width(){return Math.abs(this.scale.x*this.getLocalBounds().width)}set width(t){const e=this.getLocalBounds().width;this._setWidth(t,e)}get height(){return Math.abs(this.scale.y*this.getLocalBounds().height)}set height(t){const e=this.getLocalBounds().height;this._setHeight(t,e)}getSize(t){t||(t={});const e=this.getLocalBounds();return t.width=Math.abs(this.scale.x*e.width),t.height=Math.abs(this.scale.y*e.height),t}setSize(t,e){const r=this.getLocalBounds();"object"==typeof t?(e=t.height??t.width,t=t.width):e??(e=t),void 0!==t&&this._setWidth(t,r.width),void 0!==e&&this._setHeight(e,r.height)}_updateSkew(){const t=this._rotation,e=this._skew;this._cx=Math.cos(t+e._y),this._sx=Math.sin(t+e._y),this._cy=-Math.sin(t-e._x),this._sy=Math.cos(t-e._x)}updateTransform(t){return this.position.set("number"==typeof t.x?t.x:this.position.x,"number"==typeof t.y?t.y:this.position.y),this.scale.set("number"==typeof t.scaleX?t.scaleX||1:this.scale.x,"number"==typeof t.scaleY?t.scaleY||1:this.scale.y),this.rotation="number"==typeof t.rotation?t.rotation:this.rotation,this.skew.set("number"==typeof t.skewX?t.skewX:this.skew.x,"number"==typeof t.skewY?t.skewY:this.skew.y),this.pivot.set("number"==typeof t.pivotX?t.pivotX:this.pivot.x,"number"==typeof t.pivotY?t.pivotY:this.pivot.y),this.origin.set("number"==typeof t.originX?t.originX:this.origin.x,"number"==typeof t.originY?t.originY:this.origin.y),this}setFromMatrix(t){t.decompose(this)}updateLocalTransform(){const t=this._didContainerChangeTick;if(this._didLocalTransformChangeId===t)return;this._didLocalTransformChangeId=t;const e=this.localTransform,r=this._scale,n=this._pivot,i=this._origin,s=this._position,o=r._x,a=r._y,l=n._x,h=n._y,u=-i._x,c=-i._y;e.a=this._cx*o,e.b=this._sx*o,e.c=this._cy*a,e.d=this._sy*a,e.tx=s._x-(l*e.a+h*e.c)+(u*e.a+c*e.c)-u,e.ty=s._y-(l*e.b+h*e.d)+(u*e.b+c*e.d)-c}set alpha(t){t!==this.localAlpha&&(this.localAlpha=t,this._updateFlags|=N,this._onUpdate())}get alpha(){return this.localAlpha}set tint(t){const e=i.Q.shared.setValue(t??16777215).toBgrNumber();e!==this.localColor&&(this.localColor=e,this._updateFlags|=N,this._onUpdate())}get tint(){return(0,M.D)(this.localColor)}set blendMode(t){this.localBlendMode!==t&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=W,this.localBlendMode=t,this._onUpdate())}get blendMode(){return this.localBlendMode}get visible(){return!!(2&this.localDisplayStatus)}set visible(t){const e=t?2:0;(2&this.localDisplayStatus)!==e&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=U,this.localDisplayStatus^=2,this._onUpdate(),this.emit("visibleChanged",t))}get culled(){return!(4&this.localDisplayStatus)}set culled(t){const e=t?0:4;(4&this.localDisplayStatus)!==e&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=U,this.localDisplayStatus^=4,this._onUpdate())}get renderable(){return!!(1&this.localDisplayStatus)}set renderable(t){const e=t?1:0;(1&this.localDisplayStatus)!==e&&(this._updateFlags|=U,this.localDisplayStatus^=1,this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._onUpdate())}get isRenderable(){return 7===this.localDisplayStatus&&this.groupAlpha>0}destroy(t=!1){if(this.destroyed)return;let e;this.destroyed=!0,this.children.length&&(e=this.removeChildren(0,this.children.length)),this.removeFromParent(),this.parent=null,this._maskEffect=null,this._filterEffect=null,this.effects=null,this._position=null,this._scale=null,this._pivot=null,this._origin=null,this._skew=null,this.emit("destroyed",this),this.removeAllListeners();if(("boolean"==typeof t?t:t?.children)&&e)for(let r=0;r<e.length;++r)e[r].destroy(t);this.renderGroup?.destroy(),this.renderGroup=null}}s.XO.mixin(X,y,C,B,R,E,v,b,I,{cullArea:null,cullable:!1,cullableChildren:!0},f,M.R,m)},3284:(t,e,r)=>{r.d(e,{m:()=>o});var n=r(9313),i=r(848),s=r(2437);class o{constructor(){this.renderPipeId="renderGroup",this.root=null,this.canBundle=!1,this.renderGroupParent=null,this.renderGroupChildren=[],this.worldTransform=new n.u,this.worldColorAlpha=4294967295,this.worldColor=16777215,this.worldAlpha=1,this.childrenToUpdate=Object.create(null),this.updateTick=0,this.gcTick=0,this.childrenRenderablesToUpdate={list:[],index:0},this.structureDidChange=!0,this.instructionSet=new i.L,this._onRenderContainers=[],this.textureNeedsUpdate=!0,this.isCachedAsTexture=!1,this._matrixDirty=7}init(t){this.root=t,t._onRender&&this.addOnRender(t),t.didChange=!0;const e=t.children;for(let t=0;t<e.length;t++){const r=e[t];r._updateFlags=15,this.addChild(r)}}enableCacheAsTexture(t={}){this.textureOptions=t,this.isCachedAsTexture=!0,this.textureNeedsUpdate=!0}disableCacheAsTexture(){this.isCachedAsTexture=!1,this.texture&&(s.W.returnTexture(this.texture,!0),this.texture=null)}updateCacheTexture(){this.textureNeedsUpdate=!0;const t=this._parentCacheAsTextureRenderGroup;t&&!t.textureNeedsUpdate&&t.updateCacheTexture()}reset(){this.renderGroupChildren.length=0;for(const t in this.childrenToUpdate){const e=this.childrenToUpdate[t];e.list.fill(null),e.index=0}this.childrenRenderablesToUpdate.index=0,this.childrenRenderablesToUpdate.list.fill(null),this.root=null,this.updateTick=0,this.structureDidChange=!0,this._onRenderContainers.length=0,this.renderGroupParent=null,this.disableCacheAsTexture()}get localTransform(){return this.root.localTransform}addRenderGroupChild(t){t.renderGroupParent&&t.renderGroupParent._removeRenderGroupChild(t),t.renderGroupParent=this,this.renderGroupChildren.push(t)}_removeRenderGroupChild(t){const e=this.renderGroupChildren.indexOf(t);e>-1&&this.renderGroupChildren.splice(e,1),t.renderGroupParent=null}addChild(t){if(this.structureDidChange=!0,t.parentRenderGroup=this,t.updateTick=-1,t.parent===this.root?t.relativeRenderGroupDepth=1:t.relativeRenderGroupDepth=t.parent.relativeRenderGroupDepth+1,t.didChange=!0,this.onChildUpdate(t),t.renderGroup)return void this.addRenderGroupChild(t.renderGroup);t._onRender&&this.addOnRender(t);const e=t.children;for(let t=0;t<e.length;t++)this.addChild(e[t])}removeChild(t){if(this.structureDidChange=!0,t._onRender&&(t.renderGroup||this.removeOnRender(t)),t.parentRenderGroup=null,t.renderGroup)return void this._removeRenderGroupChild(t.renderGroup);const e=t.children;for(let t=0;t<e.length;t++)this.removeChild(e[t])}removeChildren(t){for(let e=0;e<t.length;e++)this.removeChild(t[e])}onChildUpdate(t){let e=this.childrenToUpdate[t.relativeRenderGroupDepth];e||(e=this.childrenToUpdate[t.relativeRenderGroupDepth]={index:0,list:[]}),e.list[e.index++]=t}updateRenderable(t){t.globalDisplayStatus<7||(this.instructionSet.renderPipes[t.renderPipeId].updateRenderable(t),t.didViewUpdate=!1)}onChildViewUpdate(t){this.childrenRenderablesToUpdate.list[this.childrenRenderablesToUpdate.index++]=t}get isRenderable(){return 7===this.root.localDisplayStatus&&this.worldAlpha>0}addOnRender(t){this._onRenderContainers.push(t)}removeOnRender(t){this._onRenderContainers.splice(this._onRenderContainers.indexOf(t),1)}runOnRender(t){for(let e=0;e<this._onRenderContainers.length;e++)this._onRenderContainers[e]._onRender(t)}destroy(){this.disableCacheAsTexture(),this.renderGroupParent=null,this.root=null,this.childrenRenderablesToUpdate=null,this.childrenToUpdate=null,this.renderGroupChildren=null,this._onRenderContainers=null,this.instructionSet=null}getChildren(t=[]){const e=this.root.children;for(let r=0;r<e.length;r++)this._getChildren(e[r],t);return t}_getChildren(t,e=[]){if(e.push(t),t.renderGroup)return e;const r=t.children;for(let t=0;t<r.length;t++)this._getChildren(r[t],e);return e}invalidateMatrices(){this._matrixDirty=7}get inverseWorldTransform(){return 1&this._matrixDirty?(this._matrixDirty&=-2,this._inverseWorldTransform||(this._inverseWorldTransform=new n.u),this._inverseWorldTransform.copyFrom(this.worldTransform).invert()):this._inverseWorldTransform}get textureOffsetInverseTransform(){return 2&this._matrixDirty?(this._matrixDirty&=-3,this._textureOffsetInverseTransform||(this._textureOffsetInverseTransform=new n.u),this._textureOffsetInverseTransform.copyFrom(this.inverseWorldTransform).translate(-this._textureBounds.x,-this._textureBounds.y)):this._textureOffsetInverseTransform}get inverseParentTextureTransform(){if(!(4&this._matrixDirty))return this._inverseParentTextureTransform;this._matrixDirty&=-5;const t=this._parentCacheAsTextureRenderGroup;return t?(this._inverseParentTextureTransform||(this._inverseParentTextureTransform=new n.u),this._inverseParentTextureTransform.copyFrom(this.worldTransform).prepend(t.inverseWorldTransform).translate(-t._textureBounds.x,-t._textureBounds.y)):this.worldTransform}get cacheToLocalTransform(){return this.isCachedAsTexture?this.textureOffsetInverseTransform:this._parentCacheAsTextureRenderGroup?this._parentCacheAsTextureRenderGroup.textureOffsetInverseTransform:null}}},9636:(t,e,r)=>{r.d(e,{c:()=>o});var n=r(9313),i=r(9252);const s=new n.u;class o{constructor(t=1/0,e=1/0,r=-1/0,n=-1/0){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=s,this.minX=t,this.minY=e,this.maxX=r,this.maxY=n}isEmpty(){return this.minX>this.maxX||this.minY>this.maxY}get rectangle(){this._rectangle||(this._rectangle=new i.M);const t=this._rectangle;return this.minX>this.maxX||this.minY>this.maxY?(t.x=0,t.y=0,t.width=0,t.height=0):t.copyFromBounds(this),t}clear(){return this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=s,this}set(t,e,r,n){this.minX=t,this.minY=e,this.maxX=r,this.maxY=n}addFrame(t,e,r,n,i){i||(i=this.matrix);const s=i.a,o=i.b,a=i.c,l=i.d,h=i.tx,u=i.ty;let c=this.minX,d=this.minY,f=this.maxX,p=this.maxY,y=s*t+a*e+h,m=o*t+l*e+u;y<c&&(c=y),m<d&&(d=m),y>f&&(f=y),m>p&&(p=m),y=s*r+a*e+h,m=o*r+l*e+u,y<c&&(c=y),m<d&&(d=m),y>f&&(f=y),m>p&&(p=m),y=s*t+a*n+h,m=o*t+l*n+u,y<c&&(c=y),m<d&&(d=m),y>f&&(f=y),m>p&&(p=m),y=s*r+a*n+h,m=o*r+l*n+u,y<c&&(c=y),m<d&&(d=m),y>f&&(f=y),m>p&&(p=m),this.minX=c,this.minY=d,this.maxX=f,this.maxY=p}addRect(t,e){this.addFrame(t.x,t.y,t.x+t.width,t.y+t.height,e)}addBounds(t,e){this.addFrame(t.minX,t.minY,t.maxX,t.maxY,e)}addBoundsMask(t){this.minX=this.minX>t.minX?this.minX:t.minX,this.minY=this.minY>t.minY?this.minY:t.minY,this.maxX=this.maxX<t.maxX?this.maxX:t.maxX,this.maxY=this.maxY<t.maxY?this.maxY:t.maxY}applyMatrix(t){const e=this.minX,r=this.minY,n=this.maxX,i=this.maxY,{a:s,b:o,c:a,d:l,tx:h,ty:u}=t;let c=s*e+a*r+h,d=o*e+l*r+u;this.minX=c,this.minY=d,this.maxX=c,this.maxY=d,c=s*n+a*r+h,d=o*n+l*r+u,this.minX=c<this.minX?c:this.minX,this.minY=d<this.minY?d:this.minY,this.maxX=c>this.maxX?c:this.maxX,this.maxY=d>this.maxY?d:this.maxY,c=s*e+a*i+h,d=o*e+l*i+u,this.minX=c<this.minX?c:this.minX,this.minY=d<this.minY?d:this.minY,this.maxX=c>this.maxX?c:this.maxX,this.maxY=d>this.maxY?d:this.maxY,c=s*n+a*i+h,d=o*n+l*i+u,this.minX=c<this.minX?c:this.minX,this.minY=d<this.minY?d:this.minY,this.maxX=c>this.maxX?c:this.maxX,this.maxY=d>this.maxY?d:this.maxY}fit(t){return this.minX<t.left&&(this.minX=t.left),this.maxX>t.right&&(this.maxX=t.right),this.minY<t.top&&(this.minY=t.top),this.maxY>t.bottom&&(this.maxY=t.bottom),this}fitBounds(t,e,r,n){return this.minX<t&&(this.minX=t),this.maxX>e&&(this.maxX=e),this.minY<r&&(this.minY=r),this.maxY>n&&(this.maxY=n),this}pad(t,e=t){return this.minX-=t,this.maxX+=t,this.minY-=e,this.maxY+=e,this}ceil(){return this.minX=Math.floor(this.minX),this.minY=Math.floor(this.minY),this.maxX=Math.ceil(this.maxX),this.maxY=Math.ceil(this.maxY),this}clone(){return new o(this.minX,this.minY,this.maxX,this.maxY)}scale(t,e=t){return this.minX*=t,this.minY*=e,this.maxX*=t,this.maxY*=e,this}get x(){return this.minX}set x(t){const e=this.maxX-this.minX;this.minX=t,this.maxX=t+e}get y(){return this.minY}set y(t){const e=this.maxY-this.minY;this.minY=t,this.maxY=t+e}get width(){return this.maxX-this.minX}set width(t){this.maxX=this.minX+t}get height(){return this.maxY-this.minY}set height(t){this.maxY=this.minY+t}get left(){return this.minX}get right(){return this.maxX}get top(){return this.minY}get bottom(){return this.maxY}get isPositive(){return this.maxX-this.minX>0&&this.maxY-this.minY>0}get isValid(){return this.minX+this.minY!==1/0}addVertexData(t,e,r,n){let i=this.minX,s=this.minY,o=this.maxX,a=this.maxY;n||(n=this.matrix);const l=n.a,h=n.b,u=n.c,c=n.d,d=n.tx,f=n.ty;for(let n=e;n<r;n+=2){const e=t[n],r=t[n+1],p=l*e+u*r+d,y=h*e+c*r+f;i=p<i?p:i,s=y<s?y:s,o=p>o?p:o,a=y>a?y:a}this.minX=i,this.minY=s,this.maxX=o,this.maxY=a}containsPoint(t,e){return this.minX<=t&&this.minY<=e&&this.maxX>=t&&this.maxY>=e}toString(){return`[pixi.js:Bounds minX=${this.minX} minY=${this.minY} maxX=${this.maxX} maxY=${this.maxY} width=${this.width} height=${this.height}]`}copyFrom(t){return this.minX=t.minX,this.minY=t.minY,this.maxX=t.maxX,this.maxY=t.maxY,this}}},9443:(t,e,r)=>{r.d(e,{E:()=>a,f:()=>s});var n=r(9313),i=r(2208);function s(t,e,r){let s,l;return r.clear(),t.parent?e?s=t.parent.worldTransform:(l=i.u.get().identity(),s=a(t,l)):s=n.u.IDENTITY,o(t,r,s,e),l&&i.u.return(l),r.isValid||r.set(0,0,0,0),r}function o(t,e,r,s){if(!t.visible||!t.measurable)return;let a;s?a=t.worldTransform:(t.updateLocalTransform(),a=i.u.get(),a.appendFrom(t.localTransform,r));const l=e,h=!!t.effects.length;if(h&&(e=i.o.get().clear()),t.boundsArea)e.addRect(t.boundsArea,a);else{const r=t.bounds;r&&!r.isEmpty()&&(e.matrix=a,e.addBounds(r));for(let r=0;r<t.children.length;r++)o(t.children[r],e,a,s)}if(h){for(let r=0;r<t.effects.length;r++)t.effects[r].addBounds?.(e);l.addBounds(e,n.u.IDENTITY),i.o.return(e)}s||i.u.return(a)}function a(t,e){const r=t.parent;return r&&(a(r,e),r.updateLocalTransform(),e.append(r.localTransform)),e}},7269:(t,e,r)=>{r.d(e,{n:()=>s});var n=r(9313),i=r(2208);function s(t,e,r){return e.clear(),r||(r=n.u.IDENTITY),o(t,e,r,t,!0),e.isValid||e.set(0,0,0,0),e}function o(t,e,r,s,a){let l;if(a)l=i.u.get(),l=r.copyTo(l);else{if(!t.visible||!t.measurable)return;t.updateLocalTransform();const e=t.localTransform;l=i.u.get(),l.appendFrom(e,r)}const h=e,u=!!t.effects.length;if(u&&(e=i.o.get().clear()),t.boundsArea)e.addRect(t.boundsArea,l);else{t.renderPipeId&&(e.matrix=l,e.addBounds(t.bounds));const r=t.children;for(let t=0;t<r.length;t++)o(r[t],e,l,s,!1)}if(u){for(let r=0;r<t.effects.length;r++)t.effects[r].addLocalBounds?.(e,s);h.addBounds(e,n.u.IDENTITY),i.o.return(e)}i.u.return(l)}},2208:(t,e,r)=>{r.d(e,{o:()=>a,u:()=>o});var n=r(9313),i=r(8655),s=r(9636);const o=i.Z.getPool(n.u),a=i.Z.getPool(s.c)},198:(t,e,r)=>{r.d(e,{D:()=>a,R:()=>l});var n=r(9313),i=r(9443),s=r(2208),o=r(753);function a(t){return((255&t)<<16)+(65280&t)+(t>>16&255)}const l={getGlobalAlpha(t){if(t)return this.renderGroup?this.renderGroup.worldAlpha:this.parentRenderGroup?this.parentRenderGroup.worldAlpha*this.alpha:this.alpha;let e=this.alpha,r=this.parent;for(;r;)e*=r.alpha,r=r.parent;return e},getGlobalTransform(t=new n.u,e){if(e)return t.copyFrom(this.worldTransform);this.updateLocalTransform();const r=(0,i.E)(this,s.u.get().identity());return t.appendFrom(this.localTransform,r),s.u.return(r),t},getGlobalTint(t){if(t)return this.renderGroup?a(this.renderGroup.worldColor):this.parentRenderGroup?a((0,o.j)(this.localColor,this.parentRenderGroup.worldColor)):this.tint;let e=this.localColor,r=this.parent;for(;r;)e=(0,o.j)(e,r.localColor),r=r.parent;return a(e)}}},2698:(t,e,r)=>{function n(t){const e={};for(const r in t)void 0!==t[r]&&(e[r]=t[r]);return e}r.d(e,{S:()=>n})},753:(t,e,r)=>{r.d(e,{j:()=>s});var n=r(4676);const i=16777215;function s(t,e){return t===i?e:e===i?t:(0,n.u)(t,e)}},4676:(t,e,r)=>{function n(t,e){if(16777215===t||!e)return e;if(16777215===e||!t)return t;return(((t>>16&255)*(e>>16&255)/255|0)<<16)+(((t>>8&255)*(e>>8&255)/255|0)<<8)+((255&t)*(255&e)/255|0)}r.d(e,{u:()=>n})},2760:(t,e,r)=>{function n(t,e,r){const n=(t>>24&255)/255;e[r++]=(255&t)/255*n,e[r++]=(t>>8&255)/255*n,e[r++]=(t>>16&255)/255*n,e[r++]=n}r.d(e,{V:()=>n})},6954:(t,e,r)=>{r.d(e,{G:()=>o});var n=r(9313),i=r(4676);const s=new n.u;class o{constructor(){this.packAsQuad=!1,this.batcherName="default",this.topology="triangle-list",this.applyTransform=!0,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(){const t=this.baseColor,e=t>>16|65280&t|(255&t)<<16,r=this.renderable;return r?(0,i.u)(e,r.groupColor)+(this.alpha*r.groupAlpha*255<<24):e+(255*this.alpha<<24)}get transform(){return this.renderable?.groupTransform||s}copyTo(t){t.indexOffset=this.indexOffset,t.indexSize=this.indexSize,t.attributeOffset=this.attributeOffset,t.attributeSize=this.attributeSize,t.baseColor=this.baseColor,t.alpha=this.alpha,t.texture=this.texture,t.geometryData=this.geometryData,t.topology=this.topology}reset(){this.applyTransform=!0,this.renderable=null,this.topology="triangle-list"}destroy(){this.renderable=null,this.texture=null,this.geometryData=null,this._batcher=null,this._batch=null}}},4663:(t,e,r)=>{r.d(e,{A:()=>_});var n=r(4670),i=r(4985),s=r(51),o=r(8507),a=r(848),l=r(4334);class h{constructor(){this.isBatchable=!1}reset(){this.isBatchable=!1,this.context=null,this.graphicsData&&(this.graphicsData.destroy(),this.graphicsData=null)}destroy(){this.reset()}}class u{constructor(){this.instructions=new a.L}init(){this.instructions.reset()}destroy(){this.instructions.destroy(),this.instructions=null}}const c=class t{constructor(t){this._renderer=t,this._managedContexts=new l.s({renderer:t,type:"resource",name:"graphicsContext"})}init(e){t.defaultOptions.bezierSmoothness=e?.bezierSmoothness??t.defaultOptions.bezierSmoothness}getContextRenderData(t){return this.getGpuContext(t).graphicsData||this._initContextRenderData(t)}updateGpuContext(t){const e=t._gpuData,r=!!e[this._renderer.uid],n=e[this._renderer.uid]||this._initContext(t);return!t.dirty&&r||(r&&n.reset(),n.isBatchable=!1,t.dirty=!1),n}getGpuContext(t){return t._gpuData[this._renderer.uid]||this._initContext(t)}_initContextRenderData(t){const e=new u;return this.getGpuContext(t).graphicsData=e,e.init(),e}_initContext(t){const e=new h;return e.context=t,t._gpuData[this._renderer.uid]=e,this._managedContexts.add(t),e}destroy(){this._managedContexts.destroy(),this._renderer=null}};c.extension={type:[o.Ag.CanvasSystem],name:"graphicsContext"},c.defaultOptions={bezierSmoothness:.5};let d=c;var f=r(7547);class p{constructor(t,e){this.state=f.U.for2d(),this.renderer=t,this._adaptor=e,this.renderer.runners.contextChange.add(this),this._managedGraphics=new l.s({renderer:t,type:"renderable",priority:-1,name:"graphics"})}contextChange(){this._adaptor.contextChange(this.renderer)}validateRenderable(t){return!1}addRenderable(t,e){this._managedGraphics.add(t),this.renderer.renderPipes.batch.break(e),e.add(t)}updateRenderable(t){}execute(t){t.isRenderable&&this._adaptor.execute(this,t)}destroy(){this._managedGraphics.destroy(),this.renderer=null,this._adaptor.destroy(),this._adaptor=null}}p.extension={type:[o.Ag.CanvasPipes],name:"graphics"};var y=r(378),m=r(8655),g=r(2760),x=r(6954);class v{constructor(){this.batches=[],this.batched=!1}destroy(){this.batches.forEach((t=>{m.Z.return(t)})),this.batches.length=0}}class b{constructor(t,e){this.state=f.U.for2d(),this.renderer=t,this._adaptor=e,this.renderer.runners.contextChange.add(this),this._managedGraphics=new l.s({renderer:t,type:"renderable",priority:-1,name:"graphics"})}contextChange(){this._adaptor.contextChange(this.renderer)}validateRenderable(t){const e=t.context,r=!!t._gpuData,n=this.renderer.graphicsContext.updateGpuContext(e);return!(!n.isBatchable&&r===n.isBatchable)}addRenderable(t,e){const r=this.renderer.graphicsContext.updateGpuContext(t.context);t.didViewUpdate&&this._rebuild(t),r.isBatchable?this._addToBatcher(t,e):(this.renderer.renderPipes.batch.break(e),e.add(t))}updateRenderable(t){const e=this._getGpuDataForRenderable(t).batches;for(let t=0;t<e.length;t++){const r=e[t];r._batcher.updateElement(r)}}execute(t){if(!t.isRenderable)return;const e=this.renderer,r=t.context;if(!e.graphicsContext.getGpuContext(r).batches.length)return;const n=r.customShader||this._adaptor.shader;this.state.blendMode=t.groupBlendMode;const i=n.resources.localUniforms.uniforms;i.uTransformMatrix=t.groupTransform,i.uRound=e._roundPixels|t._roundPixels,(0,g.V)(t.groupColorAlpha,i.uColor,0),this._adaptor.execute(this,t)}_rebuild(t){const e=this._getGpuDataForRenderable(t),r=this.renderer.graphicsContext.updateGpuContext(t.context);e.destroy(),r.isBatchable&&this._updateBatchesForRenderable(t,e)}_addToBatcher(t,e){const r=this.renderer.renderPipes.batch,n=this._getGpuDataForRenderable(t).batches;for(let t=0;t<n.length;t++){const i=n[t];r.addToBatch(i,e)}}_getGpuDataForRenderable(t){return t._gpuData[this.renderer.uid]||this._initGpuDataForRenderable(t)}_initGpuDataForRenderable(t){const e=new v;return t._gpuData[this.renderer.uid]=e,this._managedGraphics.add(t),e}_updateBatchesForRenderable(t,e){const r=t.context,n=this.renderer.graphicsContext.getGpuContext(r),i=this.renderer._roundPixels|t._roundPixels;e.batches=n.batches.map((e=>{const r=m.Z.get(x.G);return e.copyTo(r),r.renderable=t,r.roundPixels=i,r}))}destroy(){this._managedGraphics.destroy(),this.renderer=null,this._adaptor.destroy(),this._adaptor=null,this.state=null}}b.extension={type:[o.Ag.WebGLPipes,o.Ag.WebGPUPipes],name:"graphics"},o.XO.add(p),o.XO.add(b),o.XO.add(d),o.XO.add(y.GH);class _ extends i.l{constructor(t){t instanceof s.T&&(t={context:t});const{context:e,roundPixels:r,...n}=t||{};super({label:"Graphics",...n}),this.renderPipeId="graphics",e?this.context=e:(this.context=this._ownedContext=new s.T,this.context.autoGarbageCollect=this.autoGarbageCollect),this.didViewUpdate=!0,this.allowChildren=!1,this.roundPixels=r??!1}set context(t){t!==this._context&&(this._context&&(this._context.off("update",this.onViewUpdate,this),this._context.off("unload",this.unload,this)),this._context=t,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(t){return this._context.containsPoint(t)}destroy(t){this._ownedContext&&!t?this._ownedContext.destroy(t):!0!==t&&!0!==t?.context||this._context.destroy(t),this._ownedContext=null,this._context=null,super.destroy(t)}_onTouch(t){this._gcLastUsed=t,this._context._gcLastUsed=t}_callContextMethod(t,e){return this.context[t](...e),this}setFillStyle(...t){return this._callContextMethod("setFillStyle",t)}setStrokeStyle(...t){return this._callContextMethod("setStrokeStyle",t)}fill(...t){return this._callContextMethod("fill",t)}stroke(...t){return this._callContextMethod("stroke",t)}texture(...t){return this._callContextMethod("texture",t)}beginPath(){return this._callContextMethod("beginPath",[])}cut(){return this._callContextMethod("cut",[])}arc(...t){return this._callContextMethod("arc",t)}arcTo(...t){return this._callContextMethod("arcTo",t)}arcToSvg(...t){return this._callContextMethod("arcToSvg",t)}bezierCurveTo(...t){return this._callContextMethod("bezierCurveTo",t)}closePath(){return this._callContextMethod("closePath",[])}ellipse(...t){return this._callContextMethod("ellipse",t)}circle(...t){return this._callContextMethod("circle",t)}path(...t){return this._callContextMethod("path",t)}lineTo(...t){return this._callContextMethod("lineTo",t)}moveTo(...t){return this._callContextMethod("moveTo",t)}quadraticCurveTo(...t){return this._callContextMethod("quadraticCurveTo",t)}rect(...t){return this._callContextMethod("rect",t)}roundRect(...t){return this._callContextMethod("roundRect",t)}poly(...t){return this._callContextMethod("poly",t)}regularPoly(...t){return this._callContextMethod("regularPoly",t)}roundPoly(...t){return this._callContextMethod("roundPoly",t)}roundShape(...t){return this._callContextMethod("roundShape",t)}filletRect(...t){return this._callContextMethod("filletRect",t)}chamferRect(...t){return this._callContextMethod("chamferRect",t)}star(...t){return this._callContextMethod("star",t)}svg(...t){return this._callContextMethod("svg",t)}restore(...t){return this._callContextMethod("restore",t)}save(){return this._callContextMethod("save",[])}getTransform(){return this.context.getTransform()}resetTransform(){return this._callContextMethod("resetTransform",[])}rotateTransform(...t){return this._callContextMethod("rotate",t)}scaleTransform(...t){return this._callContextMethod("scale",t)}setTransform(...t){return this._callContextMethod("setTransform",t)}transform(...t){return this._callContextMethod("transform",t)}translateTransform(...t){return this._callContextMethod("translate",t)}clear(){return this._callContextMethod("clear",[])}get fillStyle(){return this._context.fillStyle}set fillStyle(t){this._context.fillStyle=t}get strokeStyle(){return this._context.strokeStyle}set strokeStyle(t){this._context.strokeStyle=t}clone(t=!1){if(t)return new _(this._context.clone());this._ownedContext=null;return new _(this._context)}lineStyle(t,e,r){(0,n.t6)(n.lj,"Graphics#lineStyle is no longer needed. Use Graphics#setStrokeStyle to set the stroke style.");const i={};return t&&(i.width=t),e&&(i.color=e),r&&(i.alpha=r),this.context.strokeStyle=i,this}beginFill(t,e){(0,n.t6)(n.lj,"Graphics#beginFill is no longer needed. Use Graphics#fill to fill the shape with the desired style.");const r={};return void 0!==t&&(r.color=t),void 0!==e&&(r.alpha=e),this.context.fillStyle=r,this}endFill(){(0,n.t6)(n.lj,"Graphics#endFill is no longer needed. Use Graphics#fill to fill the shape with the desired style."),this.context.fill();const t=this.context.strokeStyle;return t.width===s.T.defaultStrokeStyle.width&&t.color===s.T.defaultStrokeStyle.color&&t.alpha===s.T.defaultStrokeStyle.alpha||this.context.stroke(),this}drawCircle(...t){return(0,n.t6)(n.lj,"Graphics#drawCircle has been renamed to Graphics#circle"),this._callContextMethod("circle",t)}drawEllipse(...t){return(0,n.t6)(n.lj,"Graphics#drawEllipse has been renamed to Graphics#ellipse"),this._callContextMethod("ellipse",t)}drawPolygon(...t){return(0,n.t6)(n.lj,"Graphics#drawPolygon has been renamed to Graphics#poly"),this._callContextMethod("poly",t)}drawRect(...t){return(0,n.t6)(n.lj,"Graphics#drawRect has been renamed to Graphics#rect"),this._callContextMethod("rect",t)}drawRoundedRect(...t){return(0,n.t6)(n.lj,"Graphics#drawRoundedRect has been renamed to Graphics#roundRect"),this._callContextMethod("roundRect",t)}drawStar(...t){return(0,n.t6)(n.lj,"Graphics#drawStar has been renamed to Graphics#star"),this._callContextMethod("star",t)}}},51:(t,e,r)=>{r.d(e,{T:()=>ht});var n=r(8875),i=r(2577),s=r(9313),o=r(5101),a=r(5589),l=r(133),h=r(4670),u=r(9636),c=r(268),d=r(8133);var f=r(9252);class p{constructor(t=0,e=0,r=0){this.type="circle",this.x=t,this.y=e,this.radius=r}clone(){return new p(this.x,this.y,this.radius)}contains(t,e){if(this.radius<=0)return!1;const r=this.radius*this.radius;let n=this.x-t,i=this.y-e;return n*=n,i*=i,n+i<=r}strokeContains(t,e,r,n=.5){if(0===this.radius)return!1;const i=this.x-t,s=this.y-e,o=this.radius,a=(1-n)*r,l=Math.sqrt(i*i+s*s);return l<=o+a&&l>o-(r-a)}getBounds(t){return t||(t=new f.M),t.x=this.x-this.radius,t.y=this.y-this.radius,t.width=2*this.radius,t.height=2*this.radius,t}copyFrom(t){return this.x=t.x,this.y=t.y,this.radius=t.radius,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`}}class y{constructor(t=0,e=0,r=0,n=0){this.type="ellipse",this.x=t,this.y=e,this.halfWidth=r,this.halfHeight=n}clone(){return new y(this.x,this.y,this.halfWidth,this.halfHeight)}contains(t,e){if(this.halfWidth<=0||this.halfHeight<=0)return!1;let r=(t-this.x)/this.halfWidth,n=(e-this.y)/this.halfHeight;return r*=r,n*=n,r+n<=1}strokeContains(t,e,r,n=.5){const{halfWidth:i,halfHeight:s}=this;if(i<=0||s<=0)return!1;const o=r*(1-n),a=r-o,l=i-a,h=s-a,u=i+o,c=s+o,d=t-this.x,f=e-this.y;return d*d/(l*l)+f*f/(h*h)>1&&d*d/(u*u)+f*f/(c*c)<=1}getBounds(t){return t||(t=new f.M),t.x=this.x-this.halfWidth,t.y=this.y-this.halfHeight,t.width=2*this.halfWidth,t.height=2*this.halfHeight,t}copyFrom(t){return this.x=t.x,this.y=t.y,this.halfWidth=t.halfWidth,this.halfHeight=t.halfHeight,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:Ellipse x=${this.x} y=${this.y} halfWidth=${this.halfWidth} halfHeight=${this.halfHeight}]`}}function m(t,e,r,n,i,s){const o=i-r,a=s-n,l=o*o+a*a;let h,u,c=-1;0!==l&&(c=((t-r)*o+(e-n)*a)/l),c<0?(h=r,u=n):c>1?(h=i,u=s):(h=r+c*o,u=n+c*a);const d=t-h,f=e-u;return d*d+f*f}class g{constructor(...t){this.type="polygon";let e=Array.isArray(t[0])?t[0]:t;if("number"!=typeof e[0]){const t=[];for(let r=0,n=e.length;r<n;r++)t.push(e[r].x,e[r].y);e=t}this.points=e,this.closePath=!0}isClockwise(){let t=0;const e=this.points,r=e.length;for(let n=0;n<r;n+=2){const i=e[n],s=e[n+1];t+=(e[(n+2)%r]-i)*(e[(n+3)%r]+s)}return t<0}containsPolygon(t){const e=this.getBounds(undefined),r=t.getBounds(undefined);if(!e.containsRect(r))return!1;const n=t.points;for(let t=0;t<n.length;t+=2){const e=n[t],r=n[t+1];if(!this.contains(e,r))return!1}return!0}clone(){const t=this.points.slice(),e=new g(t);return e.closePath=this.closePath,e}contains(t,e){let r=!1;const n=this.points.length/2;for(let i=0,s=n-1;i<n;s=i++){const n=this.points[2*i],o=this.points[2*i+1],a=this.points[2*s],l=this.points[2*s+1];o>e!=l>e&&t<(e-o)/(l-o)*(a-n)+n&&(r=!r)}return r}strokeContains(t,e,r,n=.5){const i=r*r,s=i*(1-n),o=i-s,{points:a}=this,l=a.length-(this.closePath?0:2);for(let r=0;r<l;r+=2){const n=a[r],i=a[r+1],l=a[(r+2)%a.length],h=a[(r+3)%a.length];if(m(t,e,n,i,l,h)<=(Math.sign((l-n)*(e-i)-(h-i)*(t-n))<0?o:s))return!0}return!1}getBounds(t){t||(t=new f.M);const e=this.points;let r=1/0,n=-1/0,i=1/0,s=-1/0;for(let t=0,o=e.length;t<o;t+=2){const o=e[t],a=e[t+1];r=o<r?o:r,n=o>n?o:n,i=a<i?a:i,s=a>s?a:s}return t.x=r,t.width=n-r,t.y=i,t.height=s-i,t}copyFrom(t){return this.points=t.points.slice(),this.closePath=t.closePath,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:PolygoncloseStroke=${this.closePath}points=${this.points.reduce(((t,e)=>`${t}, ${e}`),"")}]`}get lastX(){return this.points[this.points.length-2]}get lastY(){return this.points[this.points.length-1]}get x(){return(0,h.t6)("8.11.0","Polygon.lastX is deprecated, please use Polygon.lastX instead."),this.points[this.points.length-2]}get y(){return(0,h.t6)("8.11.0","Polygon.y is deprecated, please use Polygon.lastY instead."),this.points[this.points.length-1]}get startX(){return this.points[0]}get startY(){return this.points[1]}}const x=(t,e,r,n,i,s,o)=>{const a=t-r,l=e-n,h=Math.sqrt(a*a+l*l);return h>=i-s&&h<=i+o};class v{constructor(t=0,e=0,r=0,n=0,i=20){this.type="roundedRectangle",this.x=t,this.y=e,this.width=r,this.height=n,this.radius=i}getBounds(t){return t||(t=new f.M),t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t}clone(){return new v(this.x,this.y,this.width,this.height,this.radius)}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.copyFrom(this),t}contains(t,e){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){const r=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(e>=this.y+r&&e<=this.y+this.height-r||t>=this.x+r&&t<=this.x+this.width-r)return!0;let n=t-(this.x+r),i=e-(this.y+r);const s=r*r;if(n*n+i*i<=s)return!0;if(n=t-(this.x+this.width-r),n*n+i*i<=s)return!0;if(i=e-(this.y+this.height-r),n*n+i*i<=s)return!0;if(n=t-(this.x+r),n*n+i*i<=s)return!0}return!1}strokeContains(t,e,r,n=.5){const{x:i,y:s,width:o,height:a,radius:l}=this,h=r*(1-n),u=r-h,c=i+l,d=s+l,f=i+o,p=s+a;return(t>=i-h&&t<=i+u||t>=f-u&&t<=f+h)&&e>=d&&e<=d+(a-2*l)||((e>=s-h&&e<=s+u||e>=p-u&&e<=p+h)&&t>=c&&t<=c+(o-2*l)||(t<c&&e<d&&x(t,e,c,d,l,u,h)||t>f-l&&e<d&&x(t,e,f-l,d,l,u,h)||t>f-l&&e>p-l&&x(t,e,f-l,p-l,l,u,h)||t<c&&e>p-l&&x(t,e,c,p-l,l,u,h)))}toString(){return`[pixi.js/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`}}var b=r(378);const _=8,w=1.1920929e-7,S=1,C=.01,M=0,T=0;function A(t,e,r,n,i,s,o,a,l,h){const u=Math.min(.99,Math.max(0,h??b.GH.defaultOptions.bezierSmoothness));let c=(S-u)/1;return c*=c,function(t,e,r,n,i,s,o,a,l,h){k(t,e,r,n,i,s,o,a,l,h,0),l.push(o,a)}(e,r,n,i,s,o,a,l,t,c),t}function k(t,e,r,n,i,s,o,a,l,h,u){if(u>_)return;const c=Math.PI,d=(t+r)/2,f=(e+n)/2,p=(r+i)/2,y=(n+s)/2,m=(i+o)/2,g=(s+a)/2,x=(d+p)/2,v=(f+y)/2,b=(p+m)/2,S=(y+g)/2,A=(x+b)/2,P=(v+S)/2;if(u>0){let u=o-t,d=a-e;const f=Math.abs((r-o)*d-(n-a)*u),p=Math.abs((i-o)*d-(s-a)*u);let y,m;if(f>w&&p>w){if((f+p)*(f+p)<=h*(u*u+d*d)){if(M<C)return void l.push(A,P);const h=Math.atan2(s-n,i-r);if(y=Math.abs(h-Math.atan2(n-e,r-t)),m=Math.abs(Math.atan2(a-s,o-i)-h),y>=c&&(y=2*c-y),m>=c&&(m=2*c-m),y+m<M)return void l.push(A,P);if(0!==T){if(y>T)return void l.push(r,n);if(m>T)return void l.push(i,s)}}}else if(f>w){if(f*f<=h*(u*u+d*d)){if(M<C)return void l.push(A,P);if(y=Math.abs(Math.atan2(s-n,i-r)-Math.atan2(n-e,r-t)),y>=c&&(y=2*c-y),y<M)return l.push(r,n),void l.push(i,s);if(0!==T&&y>T)return void l.push(r,n)}}else if(p>w){if(p*p<=h*(u*u+d*d)){if(M<C)return void l.push(A,P);if(y=Math.abs(Math.atan2(a-s,o-i)-Math.atan2(s-n,i-r)),y>=c&&(y=2*c-y),y<M)return l.push(r,n),void l.push(i,s);if(0!==T&&y>T)return void l.push(i,s)}}else if(u=A-(t+o)/2,d=P-(e+a)/2,u*u+d*d<=h)return void l.push(A,P)}k(t,e,d,f,x,v,A,P,l,h,u+1),k(A,P,b,S,m,g,o,a,l,h,u+1)}const P=8,E=1.1920929e-7,R=.01,I=0;function O(t,e,r,n,i,s,o,a){let l=(1-Math.min(.99,Math.max(0,a??b.GH.defaultOptions.bezierSmoothness)))/1;return l*=l,function(t,e,r,n,i,s,o,a){L(o,t,e,r,n,i,s,a,0),o.push(i,s)}(e,r,n,i,s,o,t,l),t}function L(t,e,r,n,i,s,o,a,l){if(l>P)return;const h=Math.PI,u=(e+n)/2,c=(r+i)/2,d=(n+s)/2,f=(i+o)/2,p=(u+d)/2,y=(c+f)/2;let m=s-e,g=o-r;const x=Math.abs((n-s)*g-(i-o)*m);if(x>E){if(x*x<=a*(m*m+g*g)){if(I<R)return void t.push(p,y);let a=Math.abs(Math.atan2(o-i,s-n)-Math.atan2(i-r,n-e));if(a>=h&&(a=2*h-a),a<I)return void t.push(p,y)}}else if(m=p-(e+s)/2,g=y-(r+o)/2,m*m+g*g<=a)return void t.push(p,y);L(t,e,r,u,c,p,y,a,l+1),L(t,p,y,d,f,s,o,a,l+1)}function B(t,e,r,n,i,s,o,a){let l=Math.abs(i-s);(!o&&i>s||o&&s>i)&&(l=2*Math.PI-l),a||(a=Math.max(6,Math.floor(6*Math.pow(n,1/3)*(l/Math.PI))));let h=l/(a=Math.max(a,3)),u=i;h*=o?-1:1;for(let i=0;i<a+1;i++){const i=e+Math.cos(u)*n,s=r+Math.sin(u)*n;t.push(i,s),u+=h}}const D=2*Math.PI,F={centerX:0,centerY:0,ang1:0,ang2:0},j=({x:t,y:e},r,n,i,s,o,a,l)=>{const h=i*(t*=r)-s*(e*=n),u=s*t+i*e;return l.x=h+o,l.y=u+a,l};function G(t,e){const r=-1.5707963267948966===e?-.551915024494:4/3*Math.tan(e/4),n=1.5707963267948966===e?.551915024494:r,i=Math.cos(t),s=Math.sin(t),o=Math.cos(t+e),a=Math.sin(t+e);return[{x:i-s*n,y:s+i*n},{x:o+a*n,y:a-o*n},{x:o,y:a}]}const z=(t,e,r,n)=>{let i=t*r+e*n;return i>1&&(i=1),i<-1&&(i=-1),(t*n-e*r<0?-1:1)*Math.acos(i)};function N(t,e,r,n,i,s,o,a=0,l=0,h=0){if(0===s||0===o)return;const u=Math.sin(a*D/360),c=Math.cos(a*D/360),d=c*(e-n)/2+u*(r-i)/2,f=-u*(e-n)/2+c*(r-i)/2;if(0===d&&0===f)return;s=Math.abs(s),o=Math.abs(o);const p=Math.pow(d,2)/Math.pow(s,2)+Math.pow(f,2)/Math.pow(o,2);p>1&&(s*=Math.sqrt(p),o*=Math.sqrt(p)),((t,e,r,n,i,s,o,a,l,h,u,c,d)=>{const f=Math.pow(i,2),p=Math.pow(s,2),y=Math.pow(u,2),m=Math.pow(c,2);let g=f*p-f*m-p*y;g<0&&(g=0),g/=f*m+p*y,g=Math.sqrt(g)*(o===a?-1:1);const x=g*i/s*c,v=g*-s/i*u,b=h*x-l*v+(t+r)/2,_=l*x+h*v+(e+n)/2,w=(u-x)/i,S=(c-v)/s,C=(-u-x)/i,M=(-c-v)/s,T=z(1,0,w,S);let A=z(w,S,C,M);0===a&&A>0&&(A-=D),1===a&&A<0&&(A+=D),d.centerX=b,d.centerY=_,d.ang1=T,d.ang2=A})(e,r,n,i,s,o,l,h,u,c,d,f,F);let{ang1:y,ang2:m}=F;const{centerX:g,centerY:x}=F;let v=Math.abs(m)/(D/4);Math.abs(1-v)<1e-7&&(v=1);const b=Math.max(Math.ceil(v),1);m/=b;let _=t[t.length-2],w=t[t.length-1];const S={x:0,y:0};for(let e=0;e<b;e++){const e=G(y,m),{x:r,y:n}=j(e[0],s,o,c,u,g,x,S),{x:i,y:a}=j(e[1],s,o,c,u,g,x,S),{x:l,y:h}=j(e[2],s,o,c,u,g,x,S);A(t,_,w,r,n,i,a,l,h),_=l,w=h,y+=m}}const W=new f.M;class U{constructor(t){this.shapePrimitives=[],this._currentPoly=null,this._bounds=new u.c,this._graphicsPath2D=t,this.signed=t.checkForHoles}moveTo(t,e){return this.startPoly(t,e),this}lineTo(t,e){this._ensurePoly();const r=this._currentPoly.points,n=r[r.length-2],i=r[r.length-1];return n===t&&i===e||r.push(t,e),this}arc(t,e,r,n,i,s){this._ensurePoly(!1);return B(this._currentPoly.points,t,e,r,n,i,s),this}arcTo(t,e,r,n,i){this._ensurePoly();return function(t,e,r,n,i,s){const o=t[t.length-2],a=t[t.length-1]-r,l=o-e,h=i-r,u=n-e,c=Math.abs(a*u-l*h);if(c<1e-8||0===s)return void(t[t.length-2]===e&&t[t.length-1]===r||t.push(e,r));const d=a*a+l*l,f=h*h+u*u,p=a*h+l*u,y=s*Math.sqrt(d)/c,m=s*Math.sqrt(f)/c,g=y*p/d,x=m*p/f,v=y*u+m*l,b=y*h+m*a,_=l*(m+g),w=a*(m+g),S=u*(y+x),C=h*(y+x);B(t,v+e,b+r,s,Math.atan2(w-b,_-v),Math.atan2(C-b,S-v),l*h>u*a)}(this._currentPoly.points,t,e,r,n,i),this}arcToSvg(t,e,r,n,i,s,o){return N(this._currentPoly.points,this._currentPoly.lastX,this._currentPoly.lastY,s,o,t,e,r,n,i),this}bezierCurveTo(t,e,r,n,i,s,o){this._ensurePoly();const a=this._currentPoly;return A(this._currentPoly.points,a.lastX,a.lastY,t,e,r,n,i,s,o),this}quadraticCurveTo(t,e,r,n,i){this._ensurePoly();const s=this._currentPoly;return O(this._currentPoly.points,s.lastX,s.lastY,t,e,r,n,i),this}closePath(){return this.endPoly(!0),this}addPath(t,e){this.endPoly(),e&&!e.isIdentity()&&(t=t.clone(!0)).transform(e);const r=this.shapePrimitives,n=r.length;for(let e=0;e<t.instructions.length;e++){const r=t.instructions[e];this[r.action](...r.data)}if(t.checkForHoles&&r.length-n>1){let t=null;for(let e=n;e<r.length;e++){const n=r[e];if("polygon"===n.shape.type){const i=n.shape,s=t?.shape;s&&s.containsPolygon(i)?(t.holes||(t.holes=[]),t.holes.push(n),r.copyWithin(e,e+1),r.length--,e--):t=n}}}return this}finish(t=!1){this.endPoly(t)}rect(t,e,r,n,i){return this.drawShape(new f.M(t,e,r,n),i),this}circle(t,e,r,n){return this.drawShape(new p(t,e,r),n),this}poly(t,e,r){const n=new g(t);return n.closePath=e,this.drawShape(n,r),this}regularPoly(t,e,r,n,i=0,s){n=Math.max(0|n,3);const o=-1*Math.PI/2+i,a=2*Math.PI/n,l=[];for(let i=0;i<n;i++){const n=o-i*a;l.push(t+r*Math.cos(n),e+r*Math.sin(n))}return this.poly(l,!0,s),this}roundPoly(t,e,r,n,i,s=0,o){if(n=Math.max(0|n,3),i<=0)return this.regularPoly(t,e,r,n,s);const a=r*Math.sin(Math.PI/n)-.001;i=Math.min(i,a);const l=-1*Math.PI/2+s,h=2*Math.PI/n,u=(n-2)*Math.PI/n/2;for(let s=0;s<n;s++){const n=s*h+l,a=t+r*Math.cos(n),c=e+r*Math.sin(n),d=n+Math.PI+u,f=n-Math.PI-u,p=a+i*Math.cos(d),y=c+i*Math.sin(d),m=a+i*Math.cos(f),g=c+i*Math.sin(f);0===s?this.moveTo(p,y):this.lineTo(p,y),this.quadraticCurveTo(a,c,m,g,o)}return this.closePath()}roundShape(t,e,r=!1,n){return t.length<3?this:(r?function(t,e,r,n){const i=(t,e)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2),s=(t,e,r)=>({x:t.x+(e.x-t.x)*r,y:t.y+(e.y-t.y)*r}),o=e.length;for(let a=0;a<o;a++){const l=e[(a+1)%o],h=l.radius??r;if(h<=0){0===a?t.moveTo(l.x,l.y):t.lineTo(l.x,l.y);continue}const u=e[a],c=e[(a+2)%o],d=i(u,l);let f;f=d<1e-4?l:s(l,u,Math.min(d/2,h)/d);const p=i(c,l);let y;y=p<1e-4?l:s(l,c,Math.min(p/2,h)/p),0===a?t.moveTo(f.x,f.y):t.lineTo(f.x,f.y),t.quadraticCurveTo(l.x,l.y,y.x,y.y,n)}}(this,t,e,n):function(t,e,r){const n=(t,e)=>{const r=e.x-t.x,n=e.y-t.y,i=Math.sqrt(r*r+n*n);return{len:i,nx:r/i,ny:n/i}},i=(e,r)=>{0===e?t.moveTo(r.x,r.y):t.lineTo(r.x,r.y)};let s=e[e.length-1];for(let o=0;o<e.length;o++){const a=e[o%e.length],l=a.radius??r;if(l<=0){i(o,a),s=a;continue}const h=e[(o+1)%e.length],u=n(a,s),c=n(a,h);if(u.len<1e-4||c.len<1e-4){i(o,a),s=a;continue}let d=Math.asin(u.nx*c.ny-u.ny*c.nx),f=1,p=!1;u.nx*c.nx-u.ny*-c.ny<0?d<0?d=Math.PI+d:(d=Math.PI-d,f=-1,p=!0):d>0&&(f=-1,p=!0);const y=d/2;let m,g=Math.abs(Math.cos(y)*l/Math.sin(y));g>Math.min(u.len/2,c.len/2)?(g=Math.min(u.len/2,c.len/2),m=Math.abs(g*Math.sin(y)/Math.cos(y))):m=l;const x=a.x+c.nx*g+-c.ny*m*f,v=a.y+c.ny*g+c.nx*m*f,b=Math.atan2(u.ny,u.nx)+Math.PI/2*f,_=Math.atan2(c.ny,c.nx)-Math.PI/2*f;0===o&&t.moveTo(x+Math.cos(b)*m,v+Math.sin(b)*m),t.arc(x,v,m,b,_,p),s=a}}(this,t,e),this.closePath())}filletRect(t,e,r,n,i){if(0===i)return this.rect(t,e,r,n);const s=Math.min(r,n)/2,o=Math.min(s,Math.max(-s,i)),a=t+r,l=e+n,h=o<0?-o:0,u=Math.abs(o);return this.moveTo(t,e+u).arcTo(t+h,e+h,t+u,e,u).lineTo(a-u,e).arcTo(a-h,e+h,a,e+u,u).lineTo(a,l-u).arcTo(a-h,l-h,t+r-u,l,u).lineTo(t+u,l).arcTo(t+h,l-h,t,l-u,u).closePath()}chamferRect(t,e,r,n,i,s){if(i<=0)return this.rect(t,e,r,n);const o=Math.min(i,Math.min(r,n)/2),a=t+r,l=e+n,h=[t+o,e,a-o,e,a,e+o,a,l-o,a-o,l,t+o,l,t,l-o,t,e+o];for(let t=h.length-1;t>=2;t-=2)h[t]===h[t-2]&&h[t-1]===h[t-3]&&h.splice(t-1,2);return this.poly(h,!0,s)}ellipse(t,e,r,n,i){return this.drawShape(new y(t,e,r,n),i),this}roundRect(t,e,r,n,i,s){return this.drawShape(new v(t,e,r,n,i),s),this}drawShape(t,e){return this.endPoly(),this.shapePrimitives.push({shape:t,transform:e}),this}startPoly(t,e){let r=this._currentPoly;return r&&this.endPoly(),r=new g,r.points.push(t,e),this._currentPoly=r,this}endPoly(t=!1){const e=this._currentPoly;return e&&e.points.length>2&&(e.closePath=t,this.shapePrimitives.push({shape:e})),this._currentPoly=null,this}_ensurePoly(t=!0){if(!this._currentPoly&&(this._currentPoly=new g,t)){const t=this.shapePrimitives[this.shapePrimitives.length-1];if(t){let e=t.shape.x,r=t.shape.y;if(t.transform&&!t.transform.isIdentity()){const n=t.transform,i=e;e=n.a*e+n.c*r+n.tx,r=n.b*i+n.d*r+n.ty}this._currentPoly.points.push(e,r)}else this._currentPoly.points.push(0,0)}}buildPath(){const t=this._graphicsPath2D;this.shapePrimitives.length=0,this._currentPoly=null;for(let e=0;e<t.instructions.length;e++){const r=t.instructions[e];this[r.action](...r.data)}this.finish()}get bounds(){const t=this._bounds;t.clear();const e=this.shapePrimitives;for(let r=0;r<e.length;r++){const n=e[r],i=n.shape.getBounds(W);n.transform?t.addRect(i,n.transform):t.addRect(i)}return t}}class X{constructor(t,e=!1){this.instructions=[],this.uid=(0,l.L)("graphicsPath"),this._dirty=!0,this.checkForHoles=e,"string"==typeof t?function(t,e){const r=d(t),n=[];let i=null,s=0,o=0;for(let t=0;t<r.length;t++){const a=r[t],l=a[0],h=a;switch(l){case"M":s=h[1],o=h[2],e.moveTo(s,o);break;case"m":s+=h[1],o+=h[2],e.moveTo(s,o);break;case"H":s=h[1],e.lineTo(s,o);break;case"h":s+=h[1],e.lineTo(s,o);break;case"V":o=h[1],e.lineTo(s,o);break;case"v":o+=h[1],e.lineTo(s,o);break;case"L":s=h[1],o=h[2],e.lineTo(s,o);break;case"l":s+=h[1],o+=h[2],e.lineTo(s,o);break;case"C":s=h[5],o=h[6],e.bezierCurveTo(h[1],h[2],h[3],h[4],s,o);break;case"c":e.bezierCurveTo(s+h[1],o+h[2],s+h[3],o+h[4],s+h[5],o+h[6]),s+=h[5],o+=h[6];break;case"S":s=h[3],o=h[4],e.bezierCurveToShort(h[1],h[2],s,o);break;case"s":e.bezierCurveToShort(s+h[1],o+h[2],s+h[3],o+h[4]),s+=h[3],o+=h[4];break;case"Q":s=h[3],o=h[4],e.quadraticCurveTo(h[1],h[2],s,o);break;case"q":e.quadraticCurveTo(s+h[1],o+h[2],s+h[3],o+h[4]),s+=h[3],o+=h[4];break;case"T":s=h[1],o=h[2],e.quadraticCurveToShort(s,o);break;case"t":s+=h[1],o+=h[2],e.quadraticCurveToShort(s,o);break;case"A":s=h[6],o=h[7],e.arcToSvg(h[1],h[2],h[3],h[4],h[5],s,o);break;case"a":s+=h[6],o+=h[7],e.arcToSvg(h[1],h[2],h[3],h[4],h[5],s,o);break;case"Z":case"z":e.closePath(),n.length>0&&(i=n.pop(),i?(s=i.startX,o=i.startY):(s=0,o=0)),i=null;break;default:(0,c.R)(`Unknown SVG path command: ${l}`)}"Z"!==l&&"z"!==l&&null===i&&(i={startX:s,startY:o},n.push(i))}}(t,this):this.instructions=t?.slice()??[]}get shapePath(){return this._shapePath||(this._shapePath=new U(this)),this._dirty&&(this._dirty=!1,this._shapePath.buildPath()),this._shapePath}addPath(t,e){return t=t.clone(),this.instructions.push({action:"addPath",data:[t,e]}),this._dirty=!0,this}arc(...t){return this.instructions.push({action:"arc",data:t}),this._dirty=!0,this}arcTo(...t){return this.instructions.push({action:"arcTo",data:t}),this._dirty=!0,this}arcToSvg(...t){return this.instructions.push({action:"arcToSvg",data:t}),this._dirty=!0,this}bezierCurveTo(...t){return this.instructions.push({action:"bezierCurveTo",data:t}),this._dirty=!0,this}bezierCurveToShort(t,e,r,n,i){const s=this.instructions[this.instructions.length-1],a=this.getLastPoint(o.b.shared);let l=0,h=0;if(s&&"bezierCurveTo"===s.action){l=s.data[2],h=s.data[3];const t=a.x,e=a.y;l=t+(t-l),h=e+(e-h)}else l=a.x,h=a.y;return this.instructions.push({action:"bezierCurveTo",data:[l,h,t,e,r,n,i]}),this._dirty=!0,this}closePath(){return this.instructions.push({action:"closePath",data:[]}),this._dirty=!0,this}ellipse(...t){return this.instructions.push({action:"ellipse",data:t}),this._dirty=!0,this}lineTo(...t){return this.instructions.push({action:"lineTo",data:t}),this._dirty=!0,this}moveTo(...t){return this.instructions.push({action:"moveTo",data:t}),this}quadraticCurveTo(...t){return this.instructions.push({action:"quadraticCurveTo",data:t}),this._dirty=!0,this}quadraticCurveToShort(t,e,r){const n=this.instructions[this.instructions.length-1],i=this.getLastPoint(o.b.shared);let s=0,a=0;if(n&&"quadraticCurveTo"===n.action){s=n.data[0],a=n.data[1];const t=i.x,e=i.y;s=t+(t-s),a=e+(e-a)}else s=i.x,a=i.y;return this.instructions.push({action:"quadraticCurveTo",data:[s,a,t,e,r]}),this._dirty=!0,this}rect(t,e,r,n,i){return this.instructions.push({action:"rect",data:[t,e,r,n,i]}),this._dirty=!0,this}circle(t,e,r,n){return this.instructions.push({action:"circle",data:[t,e,r,n]}),this._dirty=!0,this}roundRect(...t){return this.instructions.push({action:"roundRect",data:t}),this._dirty=!0,this}poly(...t){return this.instructions.push({action:"poly",data:t}),this._dirty=!0,this}regularPoly(...t){return this.instructions.push({action:"regularPoly",data:t}),this._dirty=!0,this}roundPoly(...t){return this.instructions.push({action:"roundPoly",data:t}),this._dirty=!0,this}roundShape(...t){return this.instructions.push({action:"roundShape",data:t}),this._dirty=!0,this}filletRect(...t){return this.instructions.push({action:"filletRect",data:t}),this._dirty=!0,this}chamferRect(...t){return this.instructions.push({action:"chamferRect",data:t}),this._dirty=!0,this}star(t,e,r,n,i,s,o){i||(i=n/2);const a=-1*Math.PI/2+s,l=2*r,h=2*Math.PI/l,u=[];for(let r=0;r<l;r++){const s=r%2?i:n,o=r*h+a;u.push(t+s*Math.cos(o),e+s*Math.sin(o))}return this.poly(u,!0,o),this}clone(t=!1){const e=new X;if(e.checkForHoles=this.checkForHoles,t)for(let t=0;t<this.instructions.length;t++){const r=this.instructions[t];e.instructions.push({action:r.action,data:r.data.slice()})}else e.instructions=this.instructions.slice();return e}clear(){return this.instructions.length=0,this._dirty=!0,this}transform(t){if(t.isIdentity())return this;const e=t.a,r=t.b,n=t.c,i=t.d,s=t.tx,o=t.ty;let a=0,l=0,h=0,u=0,d=0,f=0,p=0,y=0;for(let m=0;m<this.instructions.length;m++){const g=this.instructions[m],x=g.data;switch(g.action){case"moveTo":case"lineTo":a=x[0],l=x[1],x[0]=e*a+n*l+s,x[1]=r*a+i*l+o;break;case"bezierCurveTo":h=x[0],u=x[1],d=x[2],f=x[3],a=x[4],l=x[5],x[0]=e*h+n*u+s,x[1]=r*h+i*u+o,x[2]=e*d+n*f+s,x[3]=r*d+i*f+o,x[4]=e*a+n*l+s,x[5]=r*a+i*l+o;break;case"quadraticCurveTo":h=x[0],u=x[1],a=x[2],l=x[3],x[0]=e*h+n*u+s,x[1]=r*h+i*u+o,x[2]=e*a+n*l+s,x[3]=r*a+i*l+o;break;case"arcToSvg":a=x[5],l=x[6],p=x[0],y=x[1],x[0]=e*p+n*y,x[1]=r*p+i*y,x[5]=e*a+n*l+s,x[6]=r*a+i*l+o;break;case"circle":x[4]=Y(x[3],t);break;case"rect":x[4]=Y(x[4],t);break;case"ellipse":x[8]=Y(x[8],t);break;case"roundRect":x[5]=Y(x[5],t);break;case"addPath":x[0].transform(t);break;case"poly":x[2]=Y(x[2],t);break;default:(0,c.R)("unknown transform action",g.action)}}return this._dirty=!0,this}get bounds(){return this.shapePath.bounds}getLastPoint(t){let e=this.instructions.length-1,r=this.instructions[e];if(!r)return t.x=0,t.y=0,t;for(;"closePath"===r.action;){if(e--,e<0)return t.x=0,t.y=0,t;r=this.instructions[e]}switch(r.action){case"moveTo":case"lineTo":t.x=r.data[0],t.y=r.data[1];break;case"quadraticCurveTo":t.x=r.data[2],t.y=r.data[3];break;case"bezierCurveTo":t.x=r.data[4],t.y=r.data[5];break;case"arc":case"arcToSvg":t.x=r.data[5],t.y=r.data[6];break;case"addPath":r.data[0].getLastPoint(t)}return t}}function Y(t,e){return t?t.prepend(e):e.clone()}var V=r(7276);function H(t,e,r){const n=t.getAttribute(e);return n?Number(n):r}function $(t){const e=H(t,"x1",0),r=H(t,"y1",0),n=H(t,"x2",1),s=H(t,"y2",0),o=t.getAttribute("gradientUnits")||"objectBoundingBox",a=new V._(e,r,n,s,"objectBoundingBox"===o?"local":"global");for(let e=0;e<t.children.length;e++){const r=t.children[e],n=H(r,"offset",0),s=i.Q.shared.setValue(r.getAttribute("stop-color")).toNumber();a.addColorStop(n,s)}return a}function q(t){return(0,c.R)("[SVG Parser] Radial gradients are not yet supported"),new V._(0,0,1,0)}function K(t){const e=t.match(/url\s*\(\s*['"]?\s*#([^'"\s)]+)\s*['"]?\s*\)/i);return e?e[1]:""}const Z={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 Q(t,e){const r=t.getAttribute("style"),n={},i={},s={strokeStyle:n,fillStyle:i,useFill:!1,useStroke:!1};for(const r in Z){const n=t.getAttribute(r);n&&J(e,s,r,n.trim())}if(r){const t=r.split(";");for(let r=0;r<t.length;r++){const n=t[r].trim(),[i,o]=n.split(":");Z[i]&&J(e,s,i,o.trim())}}return{strokeStyle:s.useStroke?n:null,fillStyle:s.useFill?i:null,useFill:s.useFill,useStroke:s.useStroke}}function J(t,e,r,n){switch(r){case"stroke":if("none"!==n){if(n.startsWith("url(")){const r=K(n);e.strokeStyle.fill=t.defs[r]}else e.strokeStyle.color=i.Q.shared.setValue(n).toNumber();e.useStroke=!0}break;case"stroke-width":e.strokeStyle.width=Number(n);break;case"fill":if("none"!==n){if(n.startsWith("url(")){const r=K(n);e.fillStyle.fill=t.defs[r]}else e.fillStyle.color=i.Q.shared.setValue(n).toNumber();e.useFill=!0}break;case"fill-opacity":e.fillStyle.alpha=Number(n);break;case"stroke-opacity":e.strokeStyle.alpha=Number(n);break;case"opacity":e.fillStyle.alpha=Number(n),e.strokeStyle.alpha=Number(n)}}function tt(t){const e=t.match(/[-+]?[0-9]*\.?[0-9]+/g);if(!e||e.length<4)return 0;const r=e.map(Number),n=[],i=[];for(let t=0;t<r.length;t+=2)t+1<r.length&&(n.push(r[t]),i.push(r[t+1]));if(0===n.length||0===i.length)return 0;const s=Math.min(...n),o=Math.max(...n),a=Math.min(...i);return(o-s)*(Math.max(...i)-a)}function et(t,e){const r=new X(t,!1);for(const t of r.instructions)e.instructions.push(t)}function rt(t,e){if("string"==typeof t){const e=document.createElement("div");e.innerHTML=t.trim(),t=e.querySelector("svg")}const r={context:e,defs:{},path:new X};!function(t,e){const r=t.querySelectorAll("defs");for(let t=0;t<r.length;t++){const n=r[t];for(let t=0;t<n.children.length;t++){const r=n.children[t];switch(r.nodeName.toLowerCase()){case"lineargradient":e.defs[r.id]=$(r);break;case"radialgradient":e.defs[r.id]=q()}}}}(t,r);const n=t.children,{fillStyle:i,strokeStyle:s}=Q(t,r);for(let t=0;t<n.length;t++){const e=n[t];"defs"!==e.nodeName.toLowerCase()&&nt(e,r,i,s)}return e}function nt(t,e,r,n){const i=t.children,{fillStyle:s,strokeStyle:o}=Q(t,e);s&&r?r={...r,...s}:s&&(r=s),o&&n?n={...n,...o}:o&&(n=o);const a=!r&&!n;let l,h,u,d,f,p,y,m,g,x,v,b,_,w,S,C,M;switch(a&&(r={color:0}),t.nodeName.toLowerCase()){case"path":{w=t.getAttribute("d");const i=t.getAttribute("fill-rule"),s=w.split(/(?=[Mm])/).filter((t=>t.trim().length>0)),o="evenodd"===i,a=s.length>1;if(o&&a){const t=s.map((t=>({path:t,area:tt(t)})));t.sort(((t,e)=>e.area-t.area));const i=s.length>3||!function(t){if(t.length<=2)return!0;const e=t.map((t=>t.area)).sort(((t,e)=>e-t)),[r,n]=e,i=e[e.length-1];return!(r/n>3&&n/i<2)}(t);if(i)for(let i=0;i<t.length;i++){const s=t[i],o=0===i;e.context.beginPath();const a=new X(void 0,!0);et(s.path,a),e.context.path(a),o?(r&&e.context.fill(r),n&&e.context.stroke(n)):e.context.cut()}else for(let i=0;i<t.length;i++){const s=t[i],o=i%2==1;e.context.beginPath();const a=new X(void 0,!0);et(s.path,a),e.context.path(a),o?e.context.cut():(r&&e.context.fill(r),n&&e.context.stroke(n))}}else{S=new X(w,!i||"evenodd"===i),e.context.path(S),r&&e.context.fill(r),n&&e.context.stroke(n)}break}case"circle":y=H(t,"cx",0),m=H(t,"cy",0),g=H(t,"r",0),e.context.ellipse(y,m,g,g),r&&e.context.fill(r),n&&e.context.stroke(n);break;case"rect":l=H(t,"x",0),h=H(t,"y",0),C=H(t,"width",0),M=H(t,"height",0),x=H(t,"rx",0),v=H(t,"ry",0),x||v?e.context.roundRect(l,h,C,M,x||v):e.context.rect(l,h,C,M),r&&e.context.fill(r),n&&e.context.stroke(n);break;case"ellipse":y=H(t,"cx",0),m=H(t,"cy",0),x=H(t,"rx",0),v=H(t,"ry",0),e.context.beginPath(),e.context.ellipse(y,m,x,v),r&&e.context.fill(r),n&&e.context.stroke(n);break;case"line":u=H(t,"x1",0),d=H(t,"y1",0),f=H(t,"x2",0),p=H(t,"y2",0),e.context.beginPath(),e.context.moveTo(u,d),e.context.lineTo(f,p),n&&e.context.stroke(n);break;case"polygon":_=t.getAttribute("points"),b=_.match(/-?\d+/g).map((t=>parseInt(t,10))),e.context.poly(b,!0),r&&e.context.fill(r),n&&e.context.stroke(n);break;case"polyline":_=t.getAttribute("points"),b=_.match(/-?\d+/g).map((t=>parseInt(t,10))),e.context.poly(b,!1),n&&e.context.stroke(n);break;case"g":case"svg":break;default:(0,c.R)(`[SVG parser] <${t.nodeName}> elements unsupported`)}a&&(r=null);for(let t=0;t<i.length;t++)nt(i[t],e,r,n)}var it=r(990);function st(t,e){let r=1;const n=t.shapePath.shapePrimitives;for(let t=0;t<n.length;t++){const i=n[t].shape;if("polygon"!==i.type)continue;const s=i.points,o=s.length;if(o<6)continue;const a=i.closePath;for(let t=0;t<o;t+=2){if(!a&&(0===t||t===o-2))continue;const n=(t-2+o)%o,i=(t+2)%o,l=s[n],h=s[n+1],u=s[t],c=s[t+1],d=l-u,f=h-c,p=s[i]-u,y=s[i+1]-c,m=d*d+f*f,g=p*p+y*y;if(m<1e-12||g<1e-12)continue;let x=(d*p+f*y)/Math.sqrt(m*g);x<-1?x=-1:x>1&&(x=1);const v=Math.sqrt(.5*(1-x));if(v<1e-6)continue;const b=Math.min(1/v,e);b>r&&(r=b)}}return r}const ot=new o.b,at=new s.u,lt=class t extends n.A{constructor(){super(...arguments),this._gpuData=Object.create(null),this.autoGarbageCollect=!0,this._gcLastUsed=-1,this.uid=(0,l.L)("graphicsContext"),this.dirty=!0,this.batchMode="auto",this.instructions=[],this.destroyed=!1,this._activePath=new X,this._transform=new s.u,this._fillStyle={...t.defaultFillStyle},this._strokeStyle={...t.defaultStrokeStyle},this._stateStack=[],this._tick=0,this._bounds=new u.c,this._boundsDirty=!0}clone(){const e=new t;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=!0,e}get fillStyle(){return this._fillStyle}set fillStyle(e){this._fillStyle=(0,it.w)(e,t.defaultFillStyle)}get strokeStyle(){return this._strokeStyle}set strokeStyle(e){this._strokeStyle=(0,it.T)(e,t.defaultStrokeStyle)}setFillStyle(e){return this._fillStyle=(0,it.w)(e,t.defaultFillStyle),this}setStrokeStyle(e){return this._strokeStyle=(0,it.w)(e,t.defaultStrokeStyle),this}texture(t,e,r,n,s,o){return this.instructions.push({action:"texture",data:{image:t,dx:r||0,dy:n||0,dw:s||t.frame.width,dh:o||t.frame.height,transform:this._transform.clone(),alpha:this._fillStyle.alpha,style:e||0===e?i.Q.shared.setValue(e).toNumber():16777215}}),this.onUpdate(),this}beginPath(){return this._activePath=new X,this}fill(e,r){let n;const i=this.instructions[this.instructions.length-1];return n=0===this._tick&&"stroke"===i?.action?i.data.path:this._activePath.clone(),n?(null!=e&&(void 0!==r&&"number"==typeof e&&((0,h.t6)(h.lj,"GraphicsContext.fill(color, alpha) is deprecated, use GraphicsContext.fill({ color, alpha }) instead"),e={color:e,alpha:r}),this._fillStyle=(0,it.w)(e,t.defaultFillStyle)),this.instructions.push({action:"fill",data:{style:this.fillStyle,path:n}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this}_initNextPathLocation(){const{x:t,y:e}=this._activePath.getLastPoint(o.b.shared);this._activePath.clear(),this._activePath.moveTo(t,e)}stroke(e){let r;const n=this.instructions[this.instructions.length-1];return r=0===this._tick&&"fill"===n?.action?n.data.path:this._activePath.clone(),r?(null!=e&&(this._strokeStyle=(0,it.T)(e,t.defaultStrokeStyle)),this.instructions.push({action:"stroke",data:{style:this.strokeStyle,path:r}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this}cut(){for(let t=0;t<2;t++){const e=this.instructions[this.instructions.length-1-t],r=this._activePath.clone();if(e&&("stroke"===e.action||"fill"===e.action)){if(!e.data.hole){e.data.hole=r;break}e.data.hole.addPath(r)}}return this._initNextPathLocation(),this}arc(t,e,r,n,i,s){this._tick++;const o=this._transform;return this._activePath.arc(o.a*t+o.c*e+o.tx,o.b*t+o.d*e+o.ty,r,n,i,s),this}arcTo(t,e,r,n,i){this._tick++;const s=this._transform;return this._activePath.arcTo(s.a*t+s.c*e+s.tx,s.b*t+s.d*e+s.ty,s.a*r+s.c*n+s.tx,s.b*r+s.d*n+s.ty,i),this}arcToSvg(t,e,r,n,i,s,o){this._tick++;const a=this._transform;return this._activePath.arcToSvg(t,e,r,n,i,a.a*s+a.c*o+a.tx,a.b*s+a.d*o+a.ty),this}bezierCurveTo(t,e,r,n,i,s,o){this._tick++;const a=this._transform;return this._activePath.bezierCurveTo(a.a*t+a.c*e+a.tx,a.b*t+a.d*e+a.ty,a.a*r+a.c*n+a.tx,a.b*r+a.d*n+a.ty,a.a*i+a.c*s+a.tx,a.b*i+a.d*s+a.ty,o),this}closePath(){return this._tick++,this._activePath?.closePath(),this}ellipse(t,e,r,n){return this._tick++,this._activePath.ellipse(t,e,r,n,this._transform.clone()),this}circle(t,e,r){return this._tick++,this._activePath.circle(t,e,r,this._transform.clone()),this}path(t){return this._tick++,this._activePath.addPath(t,this._transform.clone()),this}lineTo(t,e){this._tick++;const r=this._transform;return this._activePath.lineTo(r.a*t+r.c*e+r.tx,r.b*t+r.d*e+r.ty),this}moveTo(t,e){this._tick++;const r=this._transform,n=this._activePath.instructions,i=r.a*t+r.c*e+r.tx,s=r.b*t+r.d*e+r.ty;return 1===n.length&&"moveTo"===n[0].action?(n[0].data[0]=i,n[0].data[1]=s,this):(this._activePath.moveTo(i,s),this)}quadraticCurveTo(t,e,r,n,i){this._tick++;const s=this._transform;return this._activePath.quadraticCurveTo(s.a*t+s.c*e+s.tx,s.b*t+s.d*e+s.ty,s.a*r+s.c*n+s.tx,s.b*r+s.d*n+s.ty,i),this}rect(t,e,r,n){return this._tick++,this._activePath.rect(t,e,r,n,this._transform.clone()),this}roundRect(t,e,r,n,i){return this._tick++,this._activePath.roundRect(t,e,r,n,i,this._transform.clone()),this}poly(t,e){return this._tick++,this._activePath.poly(t,e,this._transform.clone()),this}regularPoly(t,e,r,n,i=0,s){return this._tick++,this._activePath.regularPoly(t,e,r,n,i,s),this}roundPoly(t,e,r,n,i,s){return this._tick++,this._activePath.roundPoly(t,e,r,n,i,s),this}roundShape(t,e,r,n){return this._tick++,this._activePath.roundShape(t,e,r,n),this}filletRect(t,e,r,n,i){return this._tick++,this._activePath.filletRect(t,e,r,n,i),this}chamferRect(t,e,r,n,i,s){return this._tick++,this._activePath.chamferRect(t,e,r,n,i,s),this}star(t,e,r,n,i=0,s=0){return this._tick++,this._activePath.star(t,e,r,n,i,s,this._transform.clone()),this}svg(t){return this._tick++,rt(t,this),this}restore(){const t=this._stateStack.pop();return t&&(this._transform=t.transform,this._fillStyle=t.fillStyle,this._strokeStyle=t.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(t){return this._transform.rotate(t),this}scale(t,e=t){return this._transform.scale(t,e),this}setTransform(t,e,r,n,i,o){return t instanceof s.u?(this._transform.set(t.a,t.b,t.c,t.d,t.tx,t.ty),this):(this._transform.set(t,e,r,n,i,o),this)}transform(t,e,r,n,i,o){return t instanceof s.u?(this._transform.append(t),this):(at.set(t,e,r,n,i,o),this._transform.append(at),this)}translate(t,e=t){return this._transform.translate(t,e),this}clear(){return this._activePath.clear(),this.instructions.length=0,this.resetTransform(),this.onUpdate(),this}onUpdate(){this._boundsDirty=!0,this.dirty=!0,this.emit("update",this,16)}get bounds(){if(!this._boundsDirty)return this._bounds;this._boundsDirty=!1;const t=this._bounds;t.clear();for(let e=0;e<this.instructions.length;e++){const r=this.instructions[e],n=r.action;if("fill"===n){const e=r.data;t.addBounds(e.path.bounds)}else if("texture"===n){const e=r.data;t.addFrame(e.dx,e.dy,e.dx+e.dw,e.dy+e.dh,e.transform)}if("stroke"===n){const e=r.data,n=e.style.alignment;let i=e.style.width*(1-n);"miter"===e.style.join&&(i*=st(e.path,e.style.miterLimit));const s=e.path.bounds;t.addFrame(s.minX-i,s.minY-i,s.maxX+i,s.maxY+i)}}return t.isValid||t.set(0,0,0,0),t}containsPoint(t){if(!this.bounds.containsPoint(t.x,t.y))return!1;const e=this.instructions;let r=!1;for(let n=0;n<e.length;n++){const i=e[n],s=i.data,o=s.path;if(!i.action||!o)continue;const a=s.style,l=o.shapePath.shapePrimitives;for(let e=0;e<l.length;e++){const n=l[e].shape;if(!a||!n)continue;const o=l[e].transform,h=o?o.applyInverse(t,ot):t;if("fill"===i.action)r=n.contains(h.x,h.y);else{const t=a;r=n.strokeContains(h.x,h.y,t.width,t.alignment)}const u=s.hole;if(u){const t=u.shapePath?.shapePrimitives;if(t)for(let e=0;e<t.length;e++)t[e].shape.contains(h.x,h.y)&&(r=!1)}if(r)return!0}}return r}unload(){this.emit("unload",this);for(const t in this._gpuData)this._gpuData[t]?.destroy();this._gpuData=Object.create(null)}destroy(t=!1){if(this.destroyed)return;this.destroyed=!0,this._stateStack.length=0,this._transform=null,this.unload(),this.emit("destroy",this),this.removeAllListeners();if("boolean"==typeof t?t:t?.texture){const e="boolean"==typeof t?t:t?.textureSource;this._fillStyle.texture&&(this._fillStyle.fill&&"uid"in this._fillStyle.fill?this._fillStyle.fill.destroy():this._fillStyle.texture.destroy(e)),this._strokeStyle.texture&&(this._strokeStyle.fill&&"uid"in this._strokeStyle.fill?this._strokeStyle.fill.destroy():this._strokeStyle.texture.destroy(e))}this._fillStyle=null,this._strokeStyle=null,this.instructions=null,this._activePath=null,this._bounds=null,this._stateStack=null,this.customShader=null,this._transform=null}};lt.defaultFillStyle={color:16777215,alpha:1,texture:a.g.WHITE,matrix:null,fill:null,textureSpace:"local"},lt.defaultStrokeStyle={width:1,color:16777215,alpha:1,alignment:.5,miterLimit:10,cap:"butt",join:"miter",texture:a.g.WHITE,matrix:null,fill:null,textureSpace:"local",pixelLine:!1};let ht=lt},378:(t,e,r)=>{r.d(e,{GH:()=>p});var n=r(8507),i=r(341),s=r(2043),o=r(848),a=r(4334),l=r(4670),h=r(8655),u=r(2801);class c{constructor(){this.batches=[],this.geometryData={vertices:[],uvs:[],indices:[]}}reset(){this.batches&&this.batches.forEach((t=>{h.Z.return(t)})),this.graphicsData&&h.Z.return(this.graphicsData),this.isBatchable=!1,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}}class d{constructor(){this.instructions=new o.L}init(t){const e=t.maxTextures;this.batcher?this.batcher._updateMaxTextures(e):this.batcher=new s.J({maxTextures:e}),this.instructions.reset()}get geometry(){return(0,l.t6)(l.Ek,"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}}const f=class t{constructor(t){this._renderer=t,this._managedContexts=new a.s({renderer:t,type:"resource",name:"graphicsContext"})}init(e){t.defaultOptions.bezierSmoothness=e?.bezierSmoothness??t.defaultOptions.bezierSmoothness}getContextRenderData(t){return t._gpuData[this._renderer.uid].graphicsData||this._initContextRenderData(t)}updateGpuContext(t){const e=!!t._gpuData[this._renderer.uid],r=t._gpuData[this._renderer.uid]||this._initContext(t);if(t.dirty||!e){e&&r.reset(),(0,u.M)(t,r);const n=t.batchMode;t.customShader||"no-batch"===n?r.isBatchable=!1:r.isBatchable="auto"!==n||r.geometryData.vertices.length<400,t.dirty=!1}return r}getGpuContext(t){return t._gpuData[this._renderer.uid]||this._initContext(t)}_initContextRenderData(t){const e=h.Z.get(d,{maxTextures:this._renderer.limits.maxBatchableTextures}),r=t._gpuData[this._renderer.uid],{batches:n,geometryData:s}=r;r.graphicsData=e;const o=s.vertices.length,a=s.indices.length;for(let t=0;t<n.length;t++)n[t].applyTransform=!1;const l=e.batcher;l.ensureAttributeBuffer(o),l.ensureIndexBuffer(a),l.begin();for(let t=0;t<n.length;t++){const e=n[t];l.add(e)}l.finish(e.instructions);const u=l.geometry;u.indexBuffer.setDataWithSize(l.indexBuffer,l.indexSize,!0),u.buffers[0].setDataWithSize(l.attributeBuffer.float32View,l.attributeSize,!0);const c=l.batches;for(let t=0;t<c.length;t++){const e=c[t];e.bindGroup=(0,i.w)(e.textures.textures,e.textures.count,this._renderer.limits.maxBatchableTextures)}return e}_initContext(t){const e=new c;return e.context=t,t._gpuData[this._renderer.uid]=e,this._managedContexts.add(t),e}destroy(){this._managedContexts.destroy(),this._renderer=null}};f.extension={type:[n.Ag.WebGLSystem,n.Ag.WebGPUSystem],name:"graphicsContext"},f.defaultOptions={bezierSmoothness:.5};let p=f},115:(t,e,r)=>{r.d(e,{h:()=>a});var n=r(5101),i=r(4928);function s(t,e,r,n,i,s,o,a){let l,h;o?(l=n,h=-r):(l=-n,h=r);const u=t-r*i+l,c=e-n*i+h,d=t+r*s+l,f=e+n*s+h;return a.push(u,c),a.push(d,f),2}function o(t,e,r,n,i,s,o,a){const l=r-t,h=n-e;let u=Math.atan2(l,h),c=Math.atan2(i-t,s-e);a&&u<c?u+=2*Math.PI:!a&&u>c&&(c+=2*Math.PI);let d=u;const f=c-u,p=Math.abs(f),y=Math.sqrt(l*l+h*h),m=1+(15*p*Math.sqrt(y)/Math.PI|0),g=f/m;if(d+=g,a){o.push(t,e),o.push(r,n);for(let r=1,n=d;r<m;r++,n+=g)o.push(t,e),o.push(t+Math.sin(n)*y,e+Math.cos(n)*y);o.push(t,e),o.push(i,s)}else{o.push(r,n),o.push(t,e);for(let r=1,n=d;r<m;r++,n+=g)o.push(t+Math.sin(n)*y,e+Math.cos(n)*y),o.push(t,e);o.push(i,s),o.push(t,e)}return 2*m}function a(t,e,r,a,l,h){const u=i.B;if(0===t.length)return;const c=e;let d=c.alignment;if(.5!==e.alignment){let e=function(t){const e=t.length;if(e<6)return 1;let r=0;for(let n=0,i=t[e-2],s=t[e-1];n<e;n+=2){const e=t[n],o=t[n+1];r+=(e-i)*(o+s),i=e,s=o}return r<0?-1:1}(t);r&&(e*=-1),d=(d-.5)*e+.5}const f=new n.b(t[0],t[1]),p=new n.b(t[t.length-2],t[t.length-1]),y=a,m=Math.abs(f.x-p.x)<u&&Math.abs(f.y-p.y)<u;if(y){t=t.slice(),m&&(t.pop(),t.pop(),p.set(t[t.length-2],t[t.length-1]));const e=.5*(f.x+p.x),r=.5*(p.y+f.y);t.unshift(e,r),t.push(e,r)}const g=l,x=t.length/2;let v=t.length;const b=g.length/2,_=c.width/2,w=_*_,S=c.miterLimit*c.miterLimit;let C=t[0],M=t[1],T=t[2],A=t[3],k=0,P=0,E=-(M-A),R=C-T,I=0,O=0,L=Math.sqrt(E*E+R*R);E/=L,R/=L,E*=_,R*=_;const B=2*(1-d),D=2*d;y||("round"===c.cap?v+=o(C-E*(B-D)*.5,M-R*(B-D)*.5,C-E*B,M-R*B,C+E*D,M+R*D,g,!0)+2:"square"===c.cap&&(v+=s(C,M,E,R,B,D,!0,g))),g.push(C-E*B,M-R*B),g.push(C+E*D,M+R*D);for(let e=1;e<x-1;++e){C=t[2*(e-1)],M=t[2*(e-1)+1],T=t[2*e],A=t[2*e+1],k=t[2*(e+1)],P=t[2*(e+1)+1],E=-(M-A),R=C-T,L=Math.sqrt(E*E+R*R),E/=L,R/=L,E*=_,R*=_,I=-(A-P),O=T-k,L=Math.sqrt(I*I+O*O),I/=L,O/=L,I*=_,O*=_;const r=T-C,n=M-A,i=T-k,s=P-A,a=r*i+n*s,l=n*i-s*r,h=l<0;if(Math.abs(l)<.001*Math.abs(a)){g.push(T-E*B,A-R*B),g.push(T+E*D,A+R*D),a>=0&&("round"===c.join?v+=o(T,A,T-E*B,A-R*B,T-I*B,A-O*B,g,!1)+4:v+=2,g.push(T-I*D,A-O*D),g.push(T+I*B,A+O*B));continue}const u=(-E+C)*(-R+A)-(-E+T)*(-R+M),d=(-I+k)*(-O+A)-(-I+T)*(-O+P),f=(r*d-i*u)/l,p=(s*u-n*d)/l,y=(f-T)*(f-T)+(p-A)*(p-A),m=T+(f-T)*B,x=A+(p-A)*B,b=T-(f-T)*D,F=A-(p-A)*D,j=h?B:D;y<=Math.min(r*r+n*n,i*i+s*s)+j*j*w?"bevel"===c.join||y/w>S?(h?(g.push(m,x),g.push(T+E*D,A+R*D),g.push(m,x),g.push(T+I*D,A+O*D)):(g.push(T-E*B,A-R*B),g.push(b,F),g.push(T-I*B,A-O*B),g.push(b,F)),v+=2):"round"===c.join?h?(g.push(m,x),g.push(T+E*D,A+R*D),v+=o(T,A,T+E*D,A+R*D,T+I*D,A+O*D,g,!0)+4,g.push(m,x),g.push(T+I*D,A+O*D)):(g.push(T-E*B,A-R*B),g.push(b,F),v+=o(T,A,T-E*B,A-R*B,T-I*B,A-O*B,g,!1)+4,g.push(T-I*B,A-O*B),g.push(b,F)):(g.push(m,x),g.push(b,F)):(g.push(T-E*B,A-R*B),g.push(T+E*D,A+R*D),"round"===c.join?v+=h?o(T,A,T+E*D,A+R*D,T+I*D,A+O*D,g,!0)+2:o(T,A,T-E*B,A-R*B,T-I*B,A-O*B,g,!1)+2:"miter"===c.join&&y/w<=S&&(h?(g.push(b,F),g.push(b,F)):(g.push(m,x),g.push(m,x)),v+=2),g.push(T-I*B,A-O*B),g.push(T+I*D,A+O*D),v+=2)}C=t[2*(x-2)],M=t[2*(x-2)+1],T=t[2*(x-1)],A=t[2*(x-1)+1],E=-(M-A),R=C-T,L=Math.sqrt(E*E+R*R),E/=L,R/=L,E*=_,R*=_,g.push(T-E*B,A-R*B),g.push(T+E*D,A+R*D),y||("round"===c.cap?v+=o(T-E*(B-D)*.5,A-R*(B-D)*.5,T-E*B,A-R*B,T+E*D,A+R*D,g,!1)+2:"square"===c.cap&&(v+=s(T,A,E,R,B,D,!1,g)));const F=i.I*i.I;for(let t=b;t<v+b-2;++t)C=g[2*t],M=g[2*t+1],T=g[2*(t+1)],A=g[2*(t+1)+1],k=g[2*(t+2)],P=g[2*(t+2)+1],Math.abs(C*(A-P)+T*(P-M)+k*(M-A))<F||h.push(t,t+1,t+2)}},4928:(t,e,r)=>{r.d(e,{B:()=>n,I:()=>i});const n=1e-4,i=1e-4},7276:(t,e,r)=>{r.d(e,{_:()=>f});var n=r(2577),i=r(1761),s=r(9313),o=r(8293),a=r(5589),l=r(133),h=r(4670),u=r(2698);const c=[{offset:0,color:"white"},{offset:1,color:"black"}],d=class t{constructor(...e){this.uid=(0,l.L)("fillGradient"),this._tick=0,this.type="linear",this.colorStops=[];let r=function(t){let e=t[0]??{};("number"==typeof e||t[1])&&((0,h.t6)("8.5.2","use options object instead"),e={type:"linear",start:{x:t[0],y:t[1]},end:{x:t[2],y:t[3]},textureSpace:t[4],textureSize:t[5]??f.defaultLinearOptions.textureSize});return e}(e);r={..."radial"===r.type?t.defaultRadialOptions:t.defaultLinearOptions,...(0,u.S)(r)},this._textureSize=r.textureSize,this._wrapMode=r.wrapMode,"radial"===r.type?(this.center=r.center,this.outerCenter=r.outerCenter??this.center,this.innerRadius=r.innerRadius,this.outerRadius=r.outerRadius,this.scale=r.scale,this.rotation=r.rotation):(this.start=r.start,this.end=r.end),this.textureSpace=r.textureSpace,this.type=r.type,r.colorStops.forEach((t=>{this.addColorStop(t.offset,t.color)}))}addColorStop(t,e){return this.colorStops.push({offset:t,color:n.Q.shared.setValue(e).toHexa()}),this}buildLinearGradient(){if(this.texture)return;let{x:t,y:e}=this.start,{x:r,y:n}=this.end,i=r-t,l=n-e;const h=i<0||l<0;if("clamp-to-edge"===this._wrapMode){if(i<0){const e=t;t=r,r=e,i*=-1}if(l<0){const t=e;e=n,n=t,l*=-1}}const u=this.colorStops.length?this.colorStops:c,d=this._textureSize,{canvas:f,context:m}=y(d,1),g=h?m.createLinearGradient(this._textureSize,0,0,0):m.createLinearGradient(0,0,this._textureSize,0);p(g,u),m.fillStyle=g,m.fillRect(0,0,d,1),this.texture=new a.g({source:new o.b({resource:f,addressMode:this._wrapMode})});const x=Math.sqrt(i*i+l*l),v=Math.atan2(l,i),b=new s.u;b.scale(x/d,1),b.rotate(v),b.translate(t,e),"local"===this.textureSpace&&b.scale(d,d),this.transform=b}buildGradient(){this.texture||this._tick++,"linear"===this.type?this.buildLinearGradient():this.buildRadialGradient()}buildRadialGradient(){if(this.texture)return;const t=this.colorStops.length?this.colorStops:c,e=this._textureSize,{canvas:r,context:n}=y(e,e),{x:i,y:l}=this.center,{x:h,y:u}=this.outerCenter,d=this.innerRadius,f=this.outerRadius,m=h-f,g=u-f,x=e/(2*f),v=(i-m)*x,b=(l-g)*x,_=n.createRadialGradient(v,b,d*x,(h-m)*x,(u-g)*x,f*x);p(_,t),n.fillStyle=t[t.length-1].color,n.fillRect(0,0,e,e),n.fillStyle=_,n.translate(v,b),n.rotate(this.rotation),n.scale(1,this.scale),n.translate(-v,-b),n.fillRect(0,0,e,e),this.texture=new a.g({source:new o.b({resource:r,addressMode:this._wrapMode})});const w=new s.u;w.scale(1/x,1/x),w.translate(m,g),"local"===this.textureSpace&&w.scale(e,e),this.transform=w}destroy(){this.texture?.destroy(!0),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}`}};d.defaultLinearOptions={start:{x:0,y:0},end:{x:0,y:1},colorStops:[],textureSpace:"local",type:"linear",textureSize:256,wrapMode:"clamp-to-edge"},d.defaultRadialOptions={center:{x:.5,y:.5},innerRadius:0,outerRadius:.5,colorStops:[],scale:1,textureSpace:"local",type:"radial",textureSize:256,wrapMode:"clamp-to-edge"};let f=d;function p(t,e){for(let r=0;r<e.length;r++){const n=e[r];t.addColorStop(n.offset,n.color)}}function y(t,e){const r=i.e.get().createCanvas(t,e),n=r.getContext("2d");return{canvas:r,context:n}}},2806:(t,e,r)=>{r.d(e,{m:()=>o});var n=r(9313),i=r(133);const s={repeat:{addressModeU:"repeat",addressModeV:"repeat"},"repeat-x":{addressModeU:"repeat",addressModeV:"clamp-to-edge"},"repeat-y":{addressModeU:"clamp-to-edge",addressModeV:"repeat"},"no-repeat":{addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"}};class o{constructor(t,e){this.uid=(0,i.L)("fillPattern"),this._tick=0,this.transform=new n.u,this.texture=t,this.transform.scale(1/t.frame.width,1/t.frame.height),e&&(t.source.style.addressModeU=s[e].addressModeU,t.source.style.addressModeV=s[e].addressModeV)}setTransform(t){const e=this.texture;this.transform.copyFrom(t),this.transform.invert(),this.transform.scale(1/e.frame.width,1/e.frame.height),this._tick++}get texture(){return this._texture}set texture(t){this._texture!==t&&(this._texture=t,this._tick++)}get styleKey(){return`fill-pattern-${this.uid}-${this._tick}`}destroy(){this.texture.destroy(!0),this.texture=null}}},2801:(t,e,r)=>{r.d(e,{M:()=>Q,y:()=>q});var n=r(8507),i=r(9313),s=r(9252);function o(t,e,r,n,i){const s=e.a,o=e.b,a=e.c,l=e.d,h=e.tx,u=e.ty;r||(r=0),n||(n=2),i||(i=t.length/n-r);let c=r*n;for(let e=0;e<i;e++){const e=t[c],r=t[c+1];t[c]=s*e+a*r+h,t[c+1]=o*e+l*r+u,c+=n}}var a=r(5589),l=r(8655),h=r(6954);const u={extension:{type:n.Ag.ShapeBuilder,name:"circle"},build(t,e){let r,n,i,s,o,a;if("circle"===t.type){const e=t;if(o=a=e.radius,o<=0)return!1;r=e.x,n=e.y,i=s=0}else if("ellipse"===t.type){const e=t;if(o=e.halfWidth,a=e.halfHeight,o<=0||a<=0)return!1;r=e.x,n=e.y,i=s=0}else{const e=t,l=e.width/2,h=e.height/2;r=e.x+l,n=e.y+h,o=a=Math.max(0,Math.min(e.radius,Math.min(l,h))),i=l-o,s=h-a}if(i<0||s<0)return!1;const l=Math.ceil(2.3*Math.sqrt(o+a)),h=8*l+(i?4:0)+(s?4:0);if(0===h)return!1;if(0===l)return e[0]=e[6]=r+i,e[1]=e[3]=n+s,e[2]=e[4]=r-i,e[5]=e[7]=n-s,!0;let u=0,c=4*l+(i?2:0)+2,d=c,f=h,p=i+o,y=s,m=r+p,g=r-p,x=n+y;if(e[u++]=m,e[u++]=x,e[--c]=x,e[--c]=g,s){const t=n-y;e[d++]=g,e[d++]=t,e[--f]=t,e[--f]=m}for(let t=1;t<l;t++){const h=Math.PI/2*(t/l),p=i+Math.cos(h)*o,y=s+Math.sin(h)*a,m=r+p,g=r-p,x=n+y,v=n-y;e[u++]=m,e[u++]=x,e[--c]=x,e[--c]=g,e[d++]=g,e[d++]=v,e[--f]=v,e[--f]=m}p=i,y=s+a,m=r+p,g=r-p,x=n+y;const v=n-y;return e[u++]=m,e[u++]=x,e[--f]=v,e[--f]=m,i&&(e[u++]=g,e[u++]=x,e[--f]=v,e[--f]=g),!0},triangulate(t,e,r,n,i,s){if(0===t.length)return;let o=0,a=0;for(let e=0;e<t.length;e+=2)o+=t[e],a+=t[e+1];o/=t.length/2,a/=t.length/2;let l=n;e[l*r]=o,e[l*r+1]=a;const h=l++;for(let n=0;n<t.length;n+=2)e[l*r]=t[n],e[l*r+1]=t[n+1],n>0&&(i[s++]=l,i[s++]=h,i[s++]=l-1),l++;i[s++]=h+1,i[s++]=h,i[s++]=l-1}},c={...u,extension:{...u.extension,name:"ellipse"}},d={...u,extension:{...u.extension,name:"roundedRectangle"}};var f=r(115),p=r(4928);function y(t,e,r=2){const n=e&&e.length,i=n?e[0]*r:t.length;let s=m(t,0,i,r,!0);const o=[];if(!s||s.next===s.prev)return o;let a,l,h;if(n&&(s=function(t,e,r,n){const i=[];for(let r=0,s=e.length;r<s;r++){const o=m(t,e[r]*n,r<s-1?e[r+1]*n:t.length,n,!1);o===o.next&&(o.steiner=!0),i.push(A(o))}i.sort(S);for(let t=0;t<i.length;t++)r=C(i[t],r);return r}(t,e,s,r)),t.length>80*r){a=t[0],l=t[1];let e=a,n=l;for(let s=r;s<i;s+=r){const r=t[s],i=t[s+1];r<a&&(a=r),i<l&&(l=i),r>e&&(e=r),i>n&&(n=i)}h=Math.max(e-a,n-l),h=0!==h?32767/h:0}return x(s,o,r,a,l,h,0),o}function m(t,e,r,n,i){let s;if(i===N(t,e,r,n)>0)for(let i=e;i<r;i+=n)s=j(i/n|0,t[i],t[i+1],s);else for(let i=r-n;i>=e;i-=n)s=j(i/n|0,t[i],t[i+1],s);return s&&I(s,s.next)&&(G(s),s=s.next),s}function g(t,e){if(!t)return t;e||(e=t);let r,n=t;do{if(r=!1,n.steiner||!I(n,n.next)&&0!==R(n.prev,n,n.next))n=n.next;else{if(G(n),n=e=n.prev,n===n.next)break;r=!0}}while(r||n!==e);return e}function x(t,e,r,n,i,s,o){if(!t)return;!o&&s&&function(t,e,r,n){let i=t;do{0===i.z&&(i.z=T(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){let e,r=1;do{let n,i=t;t=null;let s=null;for(e=0;i;){e++;let o=i,a=0;for(let t=0;t<r&&(a++,o=o.nextZ,o);t++);let l=r;for(;a>0||l>0&&o;)0!==a&&(0===l||!o||i.z<=o.z)?(n=i,i=i.nextZ,a--):(n=o,o=o.nextZ,l--),s?s.nextZ=n:t=n,n.prevZ=s,s=n;i=o}s.nextZ=null,r*=2}while(e>1)}(i)}(t,n,i,s);let a=t;for(;t.prev!==t.next;){const l=t.prev,h=t.next;if(s?b(t,n,i,s):v(t))e.push(l.i,t.i,h.i),G(t),t=h.next,a=h.next;else if((t=h)===a){o?1===o?x(t=_(g(t),e),e,r,n,i,s,2):2===o&&w(t,e,r,n,i,s):x(g(t),e,r,n,i,s,1);break}}}function v(t){const e=t.prev,r=t,n=t.next;if(R(e,r,n)>=0)return!1;const i=e.x,s=r.x,o=n.x,a=e.y,l=r.y,h=n.y,u=Math.min(i,s,o),c=Math.min(a,l,h),d=Math.max(i,s,o),f=Math.max(a,l,h);let p=n.next;for(;p!==e;){if(p.x>=u&&p.x<=d&&p.y>=c&&p.y<=f&&P(i,a,s,l,o,h,p.x,p.y)&&R(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function b(t,e,r,n){const i=t.prev,s=t,o=t.next;if(R(i,s,o)>=0)return!1;const a=i.x,l=s.x,h=o.x,u=i.y,c=s.y,d=o.y,f=Math.min(a,l,h),p=Math.min(u,c,d),y=Math.max(a,l,h),m=Math.max(u,c,d),g=T(f,p,e,r,n),x=T(y,m,e,r,n);let v=t.prevZ,b=t.nextZ;for(;v&&v.z>=g&&b&&b.z<=x;){if(v.x>=f&&v.x<=y&&v.y>=p&&v.y<=m&&v!==i&&v!==o&&P(a,u,l,c,h,d,v.x,v.y)&&R(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,b.x>=f&&b.x<=y&&b.y>=p&&b.y<=m&&b!==i&&b!==o&&P(a,u,l,c,h,d,b.x,b.y)&&R(b.prev,b,b.next)>=0)return!1;b=b.nextZ}for(;v&&v.z>=g;){if(v.x>=f&&v.x<=y&&v.y>=p&&v.y<=m&&v!==i&&v!==o&&P(a,u,l,c,h,d,v.x,v.y)&&R(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;b&&b.z<=x;){if(b.x>=f&&b.x<=y&&b.y>=p&&b.y<=m&&b!==i&&b!==o&&P(a,u,l,c,h,d,b.x,b.y)&&R(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function _(t,e){let r=t;do{const n=r.prev,i=r.next.next;!I(n,i)&&O(n,r,r.next,i)&&D(n,i)&&D(i,n)&&(e.push(n.i,r.i,i.i),G(r),G(r.next),r=t=i),r=r.next}while(r!==t);return g(r)}function w(t,e,r,n,i,s){let o=t;do{let t=o.next.next;for(;t!==o.prev;){if(o.i!==t.i&&E(o,t)){let a=F(o,t);return o=g(o,o.next),a=g(a,a.next),x(o,e,r,n,i,s,0),void x(a,e,r,n,i,s,0)}t=t.next}o=o.next}while(o!==t)}function S(t,e){let r=t.x-e.x;if(0===r&&(r=t.y-e.y,0===r)){r=(t.next.y-t.y)/(t.next.x-t.x)-(e.next.y-e.y)/(e.next.x-e.x)}return r}function C(t,e){const r=function(t,e){let r=e;const n=t.x,i=t.y;let s,o=-1/0;if(I(t,r))return r;do{if(I(t,r.next))return r.next;if(i<=r.y&&i>=r.next.y&&r.next.y!==r.y){const t=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(t<=n&&t>o&&(o=t,s=r.x<r.next.x?r:r.next,t===n))return s}r=r.next}while(r!==e);if(!s)return null;const a=s,l=s.x,h=s.y;let u=1/0;r=s;do{if(n>=r.x&&r.x>=l&&n!==r.x&&k(i<h?n:o,i,l,h,i<h?o:n,i,r.x,r.y)){const e=Math.abs(i-r.y)/(n-r.x);D(r,t)&&(e<u||e===u&&(r.x>s.x||r.x===s.x&&M(s,r)))&&(s=r,u=e)}r=r.next}while(r!==a);return s}(t,e);if(!r)return e;const n=F(r,t);return g(n,n.next),g(r,r.next)}function M(t,e){return R(t.prev,t,e.prev)<0&&R(e.next,t,t.next)<0}function T(t,e,r,n,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function A(t){let e=t,r=t;do{(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next}while(e!==t);return r}function k(t,e,r,n,i,s,o,a){return(i-o)*(e-a)>=(t-o)*(s-a)&&(t-o)*(n-a)>=(r-o)*(e-a)&&(r-o)*(s-a)>=(i-o)*(n-a)}function P(t,e,r,n,i,s,o,a){return!(t===o&&e===a)&&k(t,e,r,n,i,s,o,a)}function E(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){let r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&O(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&(D(t,e)&&D(e,t)&&function(t,e){let r=t,n=!1;const i=(t.x+e.x)/2,s=(t.y+e.y)/2;do{r.y>s!=r.next.y>s&&r.next.y!==r.y&&i<(r.next.x-r.x)*(s-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)&&(R(t.prev,t,e.prev)||R(t,e.prev,e))||I(t,e)&&R(t.prev,t,t.next)>0&&R(e.prev,e,e.next)>0)}function R(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function I(t,e){return t.x===e.x&&t.y===e.y}function O(t,e,r,n){const i=B(R(t,e,r)),s=B(R(t,e,n)),o=B(R(r,n,t)),a=B(R(r,n,e));return i!==s&&o!==a||(!(0!==i||!L(t,r,e))||(!(0!==s||!L(t,n,e))||(!(0!==o||!L(r,t,n))||!(0!==a||!L(r,e,n)))))}function L(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function B(t){return t>0?1:t<0?-1:0}function D(t,e){return R(t.prev,t,t.next)<0?R(t,e,t.next)>=0&&R(t,t.prev,e)>=0:R(t,e,t.prev)<0||R(t,t.next,e)<0}function F(t,e){const r=z(t.i,t.x,t.y),n=z(e.i,e.x,e.y),i=t.next,s=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,s.next=n,n.prev=s,n}function j(t,e,r,n){const i=z(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function G(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function z(t,e,r){return{i:t,x:e,y:r,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function N(t,e,r,n){let i=0;for(let s=e,o=r-n;s<r;s+=n)i+=(t[o]-t[s])*(t[s+1]+t[o+1]),o=s;return i}r(8875);const W=y.default||y;function U(t,e,r,n,i,s,o){const a=W(t,e,2);if(!a)return;for(let t=0;t<a.length;t+=3)s[o++]=a[t]+i,s[o++]=a[t+1]+i,s[o++]=a[t+2]+i;let l=i*n;for(let e=0;e<t.length;e+=2)r[l]=t[e],r[l+1]=t[e+1],l+=n}const X=[],Y={extension:{type:n.Ag.ShapeBuilder,name:"polygon"},build(t,e){for(let r=0;r<t.points.length;r++)e[r]=t.points[r];return!0},triangulate(t,e,r,n,i,s){U(t,X,e,r,n,i,s)}},V={extension:{type:n.Ag.ShapeBuilder,name:"rectangle"},build(t,e){const r=t,n=r.x,i=r.y,s=r.width,o=r.height;return s>0&&o>0&&(e[0]=n,e[1]=i,e[2]=n+s,e[3]=i,e[4]=n+s,e[5]=i+o,e[6]=n,e[7]=i+o,!0)},triangulate(t,e,r,n,i,s){let o=0;e[(n*=r)+o]=t[0],e[n+o+1]=t[1],o+=r,e[n+o]=t[2],e[n+o+1]=t[3],o+=r,e[n+o]=t[6],e[n+o+1]=t[7],o+=r,e[n+o]=t[4],e[n+o+1]=t[5],o+=r;const a=n/r;i[s++]=a,i[s++]=a+1,i[s++]=a+2,i[s++]=a+1,i[s++]=a+3,i[s++]=a+2}},H={extension:{type:n.Ag.ShapeBuilder,name:"triangle"},build:(t,e)=>(e[0]=t.x,e[1]=t.y,e[2]=t.x2,e[3]=t.y2,e[4]=t.x3,e[5]=t.y3,!0),triangulate(t,e,r,n,i,s){let o=0;e[(n*=r)+o]=t[0],e[n+o+1]=t[1],o+=r,e[n+o]=t[2],e[n+o+1]=t[3],o+=r,e[n+o]=t[4],e[n+o+1]=t[5];const a=n/r;i[s++]=a,i[s++]=a+1,i[s++]=a+2}};var $=r(2413);const q={};n.XO.handleByMap(n.Ag.ShapeBuilder,q),n.XO.add(V,Y,H,u,c,d);const K=new s.M,Z=new i.u;function Q(t,e){const{geometryData:r,batches:n}=e;n.length=0,r.indices.length=0,r.vertices.length=0,r.uvs.length=0;for(let e=0;e<t.instructions.length;e++){const i=t.instructions[e];if("texture"===i.action)J(i.data,n,r);else if("fill"===i.action||"stroke"===i.action){const t="stroke"===i.action,e=i.data.path.shapePath,s=i.data.style,o=i.data.hole;t&&o&&tt(o.shapePath,s,!0,n,r),o&&(e.shapePrimitives[e.shapePrimitives.length-1].holes=o.shapePath.shapePrimitives),tt(e,s,t,n,r)}}}function J(t,e,r){const n=[],i=q.rectangle,s=K;s.x=t.dx,s.y=t.dy,s.width=t.dw,s.height=t.dh;const a=t.transform;if(!i.build(s,n))return;const{vertices:u,uvs:c,indices:d}=r,f=d.length,p=u.length/2;a&&o(n,a),i.triangulate(n,u,2,p,d,f);const y=t.image,m=y.uvs;c.push(m.x0,m.y0,m.x1,m.y1,m.x3,m.y3,m.x2,m.y2);const g=l.Z.get(h.G);g.indexOffset=f,g.indexSize=d.length-f,g.attributeOffset=p,g.attributeSize=u.length/2-p,g.baseColor=t.style,g.alpha=t.alpha,g.texture=y,g.geometryData=r,e.push(g)}function tt(t,e,r,n,i){const{vertices:s,uvs:u,indices:c}=i;t.shapePrimitives.forEach((({shape:t,transform:d,holes:y})=>{const m=[],g=q[t.type];if(!g.build(t,m))return;const x=c.length,v=s.length/2;let b="triangle-list";if(d&&o(m,d),r){const r=t.closePath??!0,n=e;n.pixelLine?(!function(t,e,r,n){const i=p.B;if(0===t.length)return;const s=t[0],o=t[1],a=t[t.length-2],l=t[t.length-1],h=e||Math.abs(s-a)<i&&Math.abs(o-l)<i,u=r,c=t.length/2,d=u.length/2;for(let e=0;e<c;e++)u.push(t[2*e]),u.push(t[2*e+1]);for(let t=0;t<c-1;t++)n.push(d+t,d+t+1);h&&n.push(d+c-1,d)}(m,r,s,c),b="line-list"):(0,f.h)(m,n,!1,r,s,c)}else if(y){const t=[],e=m.slice();(function(t){const e=[];for(let r=0;r<t.length;r++){const n=t[r].shape,i=[];q[n.type].build(n,i)&&e.push(i)}return e})(y).forEach((r=>{t.push(e.length/2),e.push(...r)})),U(e,t,s,2,v,c,x)}else g.triangulate(m,s,2,v,c,x);const _=u.length/2,w=e.texture;if(w!==a.g.WHITE){const r=(0,$.Y)(Z,e,t,d);!function(t,e,r,n,i,s,o,a=null){let l=0;r*=e,i*=s;const h=a.a,u=a.b,c=a.c,d=a.d,f=a.tx,p=a.ty;for(;l<o;){const o=t[r],a=t[r+1];n[i]=h*o+c*a+f,n[i+1]=u*o+d*a+p,i+=s,r+=e,l++}}(s,2,v,u,_,2,s.length/2-v,r)}else!function(t,e,r,n){let i=0;for(e*=r;i<n;)t[e]=0,t[e+1]=0,e+=r,i++}(u,_,2,s.length/2-v);const S=l.Z.get(h.G);S.indexOffset=x,S.indexSize=c.length-x,S.attributeOffset=v,S.attributeSize=s.length/2-v,S.baseColor=e.color,S.alpha=e.alpha,S.texture=w,S.geometryData=i,S.topology=b,n.push(S)}))}},990:(t,e,r)=>{r.d(e,{T:()=>d,w:()=>c});var n=r(2577),i=r(5589),s=r(7276),o=r(2806);function a(t){return t instanceof o.m}function l(t){return t instanceof s._}function h(t,e,r){return t.fill=e,t.color=16777215,t.texture=e.texture,t.matrix=e.transform,{...r,...t}}function u(t,e,r){return e.buildGradient(),t.fill=e,t.color=16777215,t.texture=e.texture,t.matrix=e.transform,t.textureSpace=e.textureSpace,{...r,...t}}function c(t,e){if(null==t)return null;const r={},s=t;return function(t){return n.Q.isColorLike(t)}(t)?function(t,e,r){const s=n.Q.shared.setValue(e??0);return t.color=s.toNumber(),t.alpha=1===s.alpha?r.alpha:s.alpha,t.texture=i.g.WHITE,{...r,...t}}(r,t,e):function(t){return t instanceof i.g}(t)?function(t,e,r){return t.texture=e,{...r,...t}}(r,t,e):a(t)?h(r,t,e):l(t)?u(r,t,e):s.fill&&a(s.fill)?h(s,s.fill,e):s.fill&&l(s.fill)?u(s,s.fill,e):function(t,e){const r={...e,...t},i=n.Q.shared.setValue(r.color);return r.alpha*=i.alpha,r.color=i.toNumber(),r}(s,e)}function d(t,e){const{width:r,alignment:n,miterLimit:i,cap:s,join:o,pixelLine:a,...l}=e,h=c(t,l);return h?{width:r,alignment:n,miterLimit:i,cap:s,join:o,pixelLine:a,...h}:null}},2413:(t,e,r)=>{r.d(e,{Y:()=>l});var n=r(9313),i=r(9252),s=r(7276);const o=new n.u,a=new i.M;function l(t,e,r,n){const i=e.matrix?t.copyFrom(e.matrix).invert():t.identity();if("local"===e.textureSpace){const t=r.getBounds(a);e.width&&t.pad(e.width);const{x:n,y:s}=t,o=1/t.width,l=1/t.height,h=-n*o,u=-s*l,c=i.a,d=i.b,f=i.c,p=i.d;i.a*=o,i.b*=o,i.c*=l,i.d*=l,i.tx=h*c+u*f+i.tx,i.ty=h*d+u*p+i.ty}else i.translate(e.texture.frame.x,e.texture.frame.y),i.scale(1/e.texture.source.width,1/e.texture.source.height);const l=e.texture.source.style;return e.fill instanceof s._||"clamp-to-edge"!==l.addressMode||(l.addressMode="repeat",l.update()),n&&i.append(o.copyFrom(n).invert()),i}},8422:(t,e,r)=>{r.d(e,{K:()=>n});class n{constructor(){this.batcherName="default",this.topology="triangle-list",this.attributeSize=4,this.indexSize=6,this.packAsQuad=!0,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()}}},6844:(t,e,r)=>{r.d(e,{k:()=>l});var n=r(2812),i=r(5589),s=r(2048),o=r(4670),a=r(4985);class l extends a.l{constructor(t=i.g.EMPTY){t instanceof i.g&&(t={texture:t});const{texture:e=i.g.EMPTY,anchor:r,roundPixels:s,width:o,height:a,...l}=t;super({label:"Sprite",...l}),this.renderPipeId="sprite",this.batched=!0,this._visualBounds={minX:0,maxX:1,minY:0,maxY:0},this._anchor=new n.o({_onUpdate:()=>{this.onViewUpdate()}}),r?this.anchor=r:e.defaultAnchor&&(this.anchor=e.defaultAnchor),this.texture=e,this.allowChildren=!1,this.roundPixels=s??!1,void 0!==o&&(this.width=o),void 0!==a&&(this.height=a)}static from(t,e=!1){return t instanceof i.g?new l(t):new l(i.g.from(t,e))}set texture(t){t||(t=i.g.EMPTY);const e=this._texture;e!==t&&(e&&e.dynamic&&e.off("update",this.onViewUpdate,this),t.dynamic&&t.on("update",this.onViewUpdate,this),this._texture=t,this._width&&this._setWidth(this._width,this._texture.orig.width),this._height&&this._setHeight(this._height,this._texture.orig.height),this.onViewUpdate())}get texture(){return this._texture}get visualBounds(){return(0,s.y)(this._visualBounds,this._anchor,this._texture),this._visualBounds}get sourceBounds(){return(0,o.t6)("8.6.1","Sprite.sourceBounds is deprecated, use visualBounds instead."),this.visualBounds}updateBounds(){const t=this._anchor,e=this._texture,r=this._bounds,{width:n,height:i}=e.orig;r.minX=-t._x*n,r.maxX=r.minX+n,r.minY=-t._y*i,r.maxY=r.minY+i}destroy(t=!1){super.destroy(t);if("boolean"==typeof t?t:t?.texture){const e="boolean"==typeof t?t:t?.textureSource;this._texture.destroy(e)}this._texture=null,this._visualBounds=null,this._bounds=null,this._anchor=null}get anchor(){return this._anchor}set anchor(t){"number"==typeof t?this._anchor.set(t):this._anchor.copyFrom(t)}get width(){return Math.abs(this.scale.x)*this._texture.orig.width}set width(t){this._setWidth(t,this._texture.orig.width),this._width=t}get height(){return Math.abs(this.scale.y)*this._texture.orig.height}set height(t){this._setHeight(t,this._texture.orig.height),this._height=t}getSize(t){return t||(t={}),t.width=Math.abs(this.scale.x)*this._texture.orig.width,t.height=Math.abs(this.scale.y)*this._texture.orig.height,t}setSize(t,e){"object"==typeof t?(e=t.height??t.width,t=t.width):e??(e=t),void 0!==t&&this._setWidth(t,this._texture.orig.width),void 0!==e&&this._setHeight(e,this._texture.orig.height)}}},4985:(t,e,r)=>{r.d(e,{l:()=>s});var n=r(9636),i=r(5559);class s extends i.mc{constructor(t){super(t),this.canBundle=!0,this.allowChildren=!1,this._roundPixels=0,this._lastUsed=-1,this._gpuData=Object.create(null),this.autoGarbageCollect=!0,this._gcLastUsed=-1,this._bounds=new n.c(0,1,0,0),this._boundsDirty=!0,this.autoGarbageCollect=t.autoGarbageCollect??!0}get bounds(){return this._boundsDirty?(this.updateBounds(),this._boundsDirty=!1,this._bounds):this._bounds}get roundPixels(){return!!this._roundPixels}set roundPixels(t){this._roundPixels=t?1:0}containsPoint(t){const e=this.bounds,{x:r,y:n}=t;return r>=e.minX&&r<=e.maxX&&n>=e.minY&&n<=e.maxY}onViewUpdate(){if(this._didViewChangeTick++,this._boundsDirty=!0,this.didViewUpdate)return;this.didViewUpdate=!0;const t=this.renderGroup||this.parentRenderGroup;t&&t.onChildViewUpdate(this)}unload(){this.emit("unload",this);for(const t in this._gpuData)this._gpuData[t]?.destroy();this._gpuData=Object.create(null),this.onViewUpdate()}destroy(t){this.unload(),super.destroy(t),this._bounds=null}collectRenderablesSimple(t,e,r){const{renderPipes:n}=e;n.blendMode.pushBlendMode(this,this.groupBlendMode,t);const i=n[this.renderPipeId];i?.addRenderable&&i.addRenderable(this,t),this.didViewUpdate=!1;const s=this.children,o=s.length;for(let n=0;n<o;n++)s[n].collectRenderables(t,e,r);n.blendMode.popBlendMode(t)}}},6312:(t,e,r)=>{var n=r(8507),i=(t=>(t[t.Low=0]="Low",t[t.Normal=1]="Normal",t[t.High=2]="High",t))(i||{}),s=r(268),o=r(1761);function a(t){if("string"!=typeof t)throw new TypeError(`Path must be a string. Received ${JSON.stringify(t)}`)}function l(t){return t.split("?")[0].split("#")[0]}const h={toPosix(t){return e="\\",r="/",t.replace(new RegExp(e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),r);var e,r},isUrl(t){return/^https?:/.test(this.toPosix(t))},isDataUrl:t=>/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(t),isBlobUrl:t=>t.startsWith("blob:"),hasProtocol(t){return/^[^/:]+:/.test(this.toPosix(t))},getProtocol(t){a(t),t=this.toPosix(t);const e=/^file:\/\/\//.exec(t);if(e)return e[0];const r=/^[^/:]+:\/{0,2}/.exec(t);return r?r[0]:""},toAbsolute(t,e,r){if(a(t),this.isDataUrl(t)||this.isBlobUrl(t))return t;const n=l(this.toPosix(e??o.e.get().getBaseUrl())),i=l(this.toPosix(r??this.rootname(n)));if((t=this.toPosix(t)).startsWith("/"))return h.join(i,t.slice(1));return this.isAbsolute(t)?t:this.join(n,t)},normalize(t){if(a(t),0===t.length)return".";if(this.isDataUrl(t)||this.isBlobUrl(t))return t;let e="";const r=(t=this.toPosix(t)).startsWith("/");this.hasProtocol(t)&&(e=this.rootname(t),t=t.slice(e.length));const n=t.endsWith("/");return(t=function(t,e){let r="",n=0,i=-1,s=0,o=-1;for(let a=0;a<=t.length;++a){if(a<t.length)o=t.charCodeAt(a);else{if(47===o)break;o=47}if(47===o){if(i===a-1||1===s);else if(i!==a-1&&2===s){if(r.length<2||2!==n||46!==r.charCodeAt(r.length-1)||46!==r.charCodeAt(r.length-2))if(r.length>2){const t=r.lastIndexOf("/");if(t!==r.length-1){-1===t?(r="",n=0):(r=r.slice(0,t),n=r.length-1-r.lastIndexOf("/")),i=a,s=0;continue}}else if(2===r.length||1===r.length){r="",n=0,i=a,s=0;continue}e&&(r.length>0?r+="/..":r="..",n=2)}else r.length>0?r+=`/${t.slice(i+1,a)}`:r=t.slice(i+1,a),n=a-i-1;i=a,s=0}else 46===o&&-1!==s?++s:s=-1}return r}(t,!1)).length>0&&n&&(t+="/"),r?`/${t}`:e+t},isAbsolute(t){return a(t),t=this.toPosix(t),!!this.hasProtocol(t)||t.startsWith("/")},join(...t){if(0===t.length)return".";let e;for(let r=0;r<t.length;++r){const n=t[r];if(a(n),n.length>0)if(void 0===e)e=n;else{const i=t[r-1]??"";this.joinExtensions.includes(this.extname(i).toLowerCase())?e+=`/../${n}`:e+=`/${n}`}}return void 0===e?".":this.normalize(e)},dirname(t){if(a(t),0===t.length)return".";let e=(t=this.toPosix(t)).charCodeAt(0);const r=47===e;let n=-1,i=!0;const s=this.getProtocol(t),o=t;for(let r=(t=t.slice(s.length)).length-1;r>=1;--r)if(e=t.charCodeAt(r),47===e){if(!i){n=r;break}}else i=!1;return-1===n?r?"/":this.isUrl(o)?s+t:s:r&&1===n?"//":s+t.slice(0,n)},rootname(t){a(t);let e="";if(e=(t=this.toPosix(t)).startsWith("/")?"/":this.getProtocol(t),this.isUrl(t)){const r=t.indexOf("/",e.length);e=-1!==r?t.slice(0,r):t,e.endsWith("/")||(e+="/")}return e},basename(t,e){a(t),e&&a(e),t=l(this.toPosix(t));let r,n=0,i=-1,s=!0;if(void 0!==e&&e.length>0&&e.length<=t.length){if(e.length===t.length&&e===t)return"";let o=e.length-1,a=-1;for(r=t.length-1;r>=0;--r){const l=t.charCodeAt(r);if(47===l){if(!s){n=r+1;break}}else-1===a&&(s=!1,a=r+1),o>=0&&(l===e.charCodeAt(o)?-1==--o&&(i=r):(o=-1,i=a))}return n===i?i=a:-1===i&&(i=t.length),t.slice(n,i)}for(r=t.length-1;r>=0;--r)if(47===t.charCodeAt(r)){if(!s){n=r+1;break}}else-1===i&&(s=!1,i=r+1);return-1===i?"":t.slice(n,i)},extname(t){a(t);let e=-1,r=0,n=-1,i=!0,s=0;for(let o=(t=l(this.toPosix(t))).length-1;o>=0;--o){const a=t.charCodeAt(o);if(47!==a)-1===n&&(i=!1,n=o+1),46===a?-1===e?e=o:1!==s&&(s=1):-1!==e&&(s=-1);else if(!i){r=o+1;break}}return-1===e||-1===n||0===s||1===s&&e===n-1&&e===r+1?"":t.slice(e,n)},parse(t){a(t);const e={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return e;let r=(t=l(this.toPosix(t))).charCodeAt(0);const n=this.isAbsolute(t);let i;e.root=this.rootname(t),i=n||this.hasProtocol(t)?1:0;let s=-1,o=0,h=-1,u=!0,c=t.length-1,d=0;for(;c>=i;--c)if(r=t.charCodeAt(c),47!==r)-1===h&&(u=!1,h=c+1),46===r?-1===s?s=c:1!==d&&(d=1):-1!==s&&(d=-1);else if(!u){o=c+1;break}return-1===s||-1===h||0===d||1===d&&s===h-1&&s===o+1?-1!==h&&(e.base=e.name=0===o&&n?t.slice(1,h):t.slice(o,h)):(0===o&&n?(e.name=t.slice(1,s),e.base=t.slice(1,h)):(e.name=t.slice(o,s),e.base=t.slice(o,h)),e.ext=t.slice(s,h)),e.dir=this.dirname(t),e},sep:"/",delimiter:":",joinExtensions:[".html"]};var u=r(2406);function c(t,e,r,n,i){const s=e[r];for(let o=0;o<s.length;o++){const a=s[o];r<e.length-1?c(t.replace(n[r],a),e,r+1,n,i):i.push(t.replace(n[r],a))}}function d(t){const e=t.match(/\{(.*?)\}/g),r=[];if(e){const n=[];e.forEach((t=>{const e=t.substring(1,t.length-1).split(",");n.push(e)})),c(t,n,0,e,r)}else r.push(t);return r}const f=t=>!Array.isArray(t);class p{constructor(){this._defaultBundleIdentifierOptions={connector:"-",createBundleAssetId:(t,e)=>`${t}${this._bundleIdConnector}${e}`,extractAssetIdFromBundle:(t,e)=>e.replace(`${t}${this._bundleIdConnector}`,"")},this._bundleIdConnector=this._defaultBundleIdentifierOptions.connector,this._createBundleAssetId=this._defaultBundleIdentifierOptions.createBundleAssetId,this._extractAssetIdFromBundle=this._defaultBundleIdentifierOptions.extractAssetIdFromBundle,this._assetMap={},this._preferredOrder=[],this._parsers=[],this._resolverHash={},this._bundles={}}setBundleIdentifier(t){if(this._bundleIdConnector=t.connector??this._bundleIdConnector,this._createBundleAssetId=t.createBundleAssetId??this._createBundleAssetId,this._extractAssetIdFromBundle=t.extractAssetIdFromBundle??this._extractAssetIdFromBundle,"bar"!==this._extractAssetIdFromBundle("foo",this._createBundleAssetId("foo","bar")))throw new Error("[Resolver] GenerateBundleAssetId are not working correctly")}prefer(...t){t.forEach((t=>{this._preferredOrder.push(t),t.priority||(t.priority=Object.keys(t.params))})),this._resolverHash={}}set basePath(t){this._basePath=t}get basePath(){return this._basePath}set rootPath(t){this._rootPath=t}get rootPath(){return this._rootPath}get parsers(){return this._parsers}reset(){this.setBundleIdentifier(this._defaultBundleIdentifierOptions),this._assetMap={},this._preferredOrder=[],this._resolverHash={},this._rootPath=null,this._basePath=null,this._manifest=null,this._bundles={},this._defaultSearchParams=null}setDefaultSearchParams(t){if("string"==typeof t)this._defaultSearchParams=t;else{const e=t;this._defaultSearchParams=Object.keys(e).map((t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`)).join("&")}}getAlias(t){const{alias:e,src:r}=t;return(0,u.z)(e||r,(t=>"string"==typeof t?t:Array.isArray(t)?t.map((t=>t?.src??t)):t?.src?t.src:t),!0)}removeAlias(t,e){this._assetMap[t]&&(e&&e!==this._resolverHash[t]||(delete this._resolverHash[t],delete this._assetMap[t]))}addManifest(t){this._manifest&&(0,s.R)("[Resolver] Manifest already exists, this will be overwritten"),this._manifest=t,t.bundles.forEach((t=>{this.addBundle(t.name,t.assets)}))}addBundle(t,e){const r=[];let n=e;Array.isArray(e)||(n=Object.entries(e).map((([t,e])=>"string"==typeof e||Array.isArray(e)?{alias:t,src:e}:{alias:t,...e}))),n.forEach((e=>{const n=e.src,i=e.alias;let s;if("string"==typeof i){const e=this._createBundleAssetId(t,i);r.push(e),s=[i,e]}else{const e=i.map((e=>this._createBundleAssetId(t,e)));r.push(...e),s=[...i,...e]}this.add({...e,alias:s,src:n})})),this._bundles[t]=r}add(t){const e=[];let r;Array.isArray(t)?e.push(...t):e.push(t),r=t=>{this.hasKey(t)&&(0,s.R)(`[Resolver] already has key: ${t} overwriting`)};(0,u.z)(e).forEach((t=>{const{src:e}=t;let{data:n,format:i,loadParser:s,parser:o}=t;const a=(0,u.z)(e).map((t=>"string"==typeof t?d(t):Array.isArray(t)?t:[t])),l=this.getAlias(t);Array.isArray(l)?l.forEach(r):r(l);const h=[],c=t=>{const e=this._parsers.find((e=>e.test(t)));return{src:t,...e?.parse(t)}};a.forEach((e=>{e.forEach((e=>{let r={};if("object"!=typeof e?r=c(e):(n=e.data??n,i=e.format??i,(e.loadParser||e.parser)&&(s=e.loadParser??s,o=e.parser??o),r={...c(e.src),...e}),!l)throw new Error(`[Resolver] alias is undefined for this asset: ${r.src}`);r=this._buildResolvedAsset(r,{aliases:l,data:n,format:i,loadParser:s,parser:o,progressSize:t.progressSize}),h.push(r)}))})),l.forEach((t=>{this._assetMap[t]=h}))}))}resolveBundle(t){const e=f(t);t=(0,u.z)(t);const r={};return t.forEach((t=>{const e=this._bundles[t];if(e){const n=this.resolve(e),i={};for(const e in n){const r=n[e];i[this._extractAssetIdFromBundle(t,e)]=r}r[t]=i}})),e?r[t[0]]:r}resolveUrl(t){const e=this.resolve(t);if("string"!=typeof t){const t={};for(const r in e)t[r]=e[r].src;return t}return e.src}resolve(t){const e=f(t);t=(0,u.z)(t);const r={};return t.forEach((t=>{if(!this._resolverHash[t])if(this._assetMap[t]){let e=this._assetMap[t];const r=this._getPreferredOrder(e);r?.priority.forEach((t=>{r.params[t].forEach((r=>{const n=e.filter((e=>!!e[t]&&e[t]===r));n.length&&(e=n)}))})),this._resolverHash[t]=e[0]}else this._resolverHash[t]=this._buildResolvedAsset({alias:[t],src:t},{});r[t]=this._resolverHash[t]})),e?r[t[0]]:r}hasKey(t){return!!this._assetMap[t]}hasBundle(t){return!!this._bundles[t]}_getPreferredOrder(t){for(let e=0;e<t.length;e++){const r=t[e],n=this._preferredOrder.find((t=>t.params.format.includes(r.format)));if(n)return n}return this._preferredOrder[0]}_appendDefaultSearchParams(t){if(!this._defaultSearchParams)return t;return`${t}${/\?/.test(t)?"&":"?"}${this._defaultSearchParams}`}_buildResolvedAsset(t,e){const{aliases:r,data:n,loadParser:i,parser:s,format:o,progressSize:a}=e;return(this._basePath||this._rootPath)&&(t.src=h.toAbsolute(t.src,this._basePath,this._rootPath)),t.alias=r??t.alias??[t.src],t.src=this._appendDefaultSearchParams(t.src),t.data={...n||{},...t.data},t.loadParser=i??t.loadParser,t.parser=s??t.parser,t.format=o??t.format??t.src.split(".").pop().split("?").shift().split("#").shift(),void 0!==a&&(t.progressSize=a),t}}p.RETINA_PREFIX=/@([0-9\.]+)x/;const y=(t,e)=>{const r=e.split("?")[1];return r&&(t+=`?${r}`),t};var m=r(5589),g=r(9252),x=r(583);const v=class t{constructor(t,e){this.linkedSheets=[];let r=t;t?.source instanceof x.v&&(r={texture:t,data:e});const{texture:n,data:i,cachePrefix:s=""}=r;this.cachePrefix=s,this._texture=n instanceof m.g?n:null,this.textureSource=n.source,this.textures={},this.animations={},this.data=i;const o=parseFloat(i.meta.scale);o?(this.resolution=o,n.source.resolution=this.resolution):this.resolution=n.source._resolution,this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}parse(){return new Promise((e=>{this._callback=e,this._batchIndex=0,this._frameKeys.length<=t.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()}))}parseSync(){return this._processFrames(0,!0),this._processAnimations(),this.textures}_processFrames(e,r=!1){let n=e;const i=r?1/0:t.BATCH_SIZE;for(;n-e<i&&n<this._frameKeys.length;){const t=this._frameKeys[n],e=this._frames[t],r=e.frame;if(r){let n=null,i=null;const s=!1!==e.trimmed&&e.sourceSize?e.sourceSize:e.frame,o=new g.M(0,0,Math.floor(s.w)/this.resolution,Math.floor(s.h)/this.resolution);n=e.rotated?new g.M(Math.floor(r.x)/this.resolution,Math.floor(r.y)/this.resolution,Math.floor(r.h)/this.resolution,Math.floor(r.w)/this.resolution):new g.M(Math.floor(r.x)/this.resolution,Math.floor(r.y)/this.resolution,Math.floor(r.w)/this.resolution,Math.floor(r.h)/this.resolution),!1!==e.trimmed&&e.spriteSourceSize&&(i=new g.M(Math.floor(e.spriteSourceSize.x)/this.resolution,Math.floor(e.spriteSourceSize.y)/this.resolution,Math.floor(r.w)/this.resolution,Math.floor(r.h)/this.resolution)),this.textures[t]=new m.g({source:this.textureSource,frame:n,orig:o,trim:i,rotate:e.rotated?2:0,defaultAnchor:e.anchor,defaultBorders:e.borders,label:t.toString()})}n++}}_processAnimations(){const t=this.data.animations||{};for(const e in t){this.animations[e]=[];for(let r=0;r<t[e].length;r++){const n=t[e][r];this.animations[e].push(this.textures[n])}}}_parseComplete(){const t=this._callback;this._callback=null,this._batchIndex=0,t.call(this,this.textures)}_nextBatch(){this._processFrames(this._batchIndex*t.BATCH_SIZE),this._batchIndex++,setTimeout((()=>{this._batchIndex*t.BATCH_SIZE<this._frameKeys.length?this._nextBatch():(this._processAnimations(),this._parseComplete())}),0)}destroy(t=!1){for(const t in this.textures)this.textures[t].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,t&&(this._texture?.destroy(),this.textureSource.destroy()),this._texture=null,this.textureSource=null,this.linkedSheets=[]}};v.BATCH_SIZE=1e3;let b=v;const _=["jpg","png","jpeg","avif","webp","basis","etc2","bc7","bc6h","bc5","bc4","bc3","bc2","bc1","eac","astc"];function w(t,e,r){const n={};if(t.forEach((t=>{n[t]=e})),Object.keys(e.textures).forEach((t=>{n[`${e.cachePrefix}${t}`]=e.textures[t]})),!r){const r=h.dirname(t[0]);e.linkedSheets.forEach(((t,i)=>{const s=w([`${r}/${e.data.meta.related_multi_packs[i]}`],t,!0);Object.assign(n,s)}))}return n}const S={extension:n.Ag.Asset,cache:{test:t=>t instanceof b,getCacheableAssets:(t,e)=>w(t,e,!1)},resolver:{extension:{type:n.Ag.ResolveParser,name:"resolveSpritesheet"},test:t=>{const e=t.split("?")[0].split("."),r=e.pop(),n=e.pop();return"json"===r&&_.includes(n)},parse:t=>{const e=t.split(".");return{resolution:parseFloat(p.RETINA_PREFIX.exec(t)?.[1]??"1"),format:e[e.length-2],src:t}}},loader:{name:"spritesheetLoader",id:"spritesheet",extension:{type:n.Ag.LoadParser,priority:i.Normal,name:"spritesheetLoader"},testParse:async(t,e)=>".json"===h.extname(e.src).toLowerCase()&&!!t.frames,async parse(t,e,r){const{texture:n,imageFilename:i,textureOptions:s,cachePrefix:o}=e?.data??{};let a,l=h.dirname(e.src);if(l&&l.lastIndexOf("/")!==l.length-1&&(l+="/"),n instanceof m.g)a=n;else{const n=y(l+(i??t.meta.image),e.src);a=(await r.load([{src:n,data:s}]))[n]}const u=new b({texture:a.source,data:t,cachePrefix:o});await u.parse();const c=t?.meta?.related_multi_packs;if(Array.isArray(c)){const t=[];for(const n of c){if("string"!=typeof n)continue;let i=l+n;e.data?.ignoreMultiPack||(i=y(i,e.src),t.push(r.load({src:i,data:{textureOptions:s,ignoreMultiPack:!0}})))}const n=await Promise.all(t);u.linkedSheets=n,n.forEach((t=>{t.linkedSheets=[u].concat(u.linkedSheets.filter((e=>e!==t)))}))}return u},async unload(t,e,r){await r.unload(t.textureSource._sourceOrigin),t.destroy(!1)}}};n.XO.add(S)},7309:(t,e,r)=>{r.d(e,{R:()=>o});var n=r(4458);class i{constructor(t,e=null,r=0,n=!1){this.next=null,this.previous=null,this._destroyed=!1,this._fn=t,this._context=e,this.priority=r,this._once=n}match(t,e=null){return this._fn===t&&this._context===e}emit(t){this._fn&&(this._context?this._fn.call(this._context,t):this._fn(t));const e=this.next;return this._once&&this.destroy(!0),this._destroyed&&(this.next=null),e}connect(t){this.previous=t,t.next&&(t.next.previous=this),this.next=t.next,t.next=this}destroy(t=!1){this._destroyed=!0,this._fn=null,this._context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);const e=this.next;return this.next=t?null:e,this.previous=null,e}}const s=class t{constructor(){this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new i(null,null,1/0),this.deltaMS=1/t.targetFPMS,this.elapsedMS=1/t.targetFPMS,this._tick=t=>{this._requestId=null,this.started&&(this.update(t),this.started&&null===this._requestId&&this._head.next&&(this._requestId=requestAnimationFrame(this._tick)))}}_requestIfNeeded(){null===this._requestId&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))}_cancelIfNeeded(){null!==this._requestId&&(cancelAnimationFrame(this._requestId),this._requestId=null)}_startIfPossible(){this.started?this._requestIfNeeded():this.autoStart&&this.start()}add(t,e,r=n.d.NORMAL){return this._addListener(new i(t,e,r))}addOnce(t,e,r=n.d.NORMAL){return this._addListener(new i(t,e,r,!0))}_addListener(t){let e=this._head.next,r=this._head;if(e){for(;e;){if(t.priority>e.priority){t.connect(r);break}r=e,e=e.next}t.previous||t.connect(r)}else t.connect(r);return this._startIfPossible(),this}remove(t,e){let r=this._head.next;for(;r;)r=r.match(t,e)?r.destroy():r.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let t=0,e=this._head;for(;e=e.next;)t++;return t}start(){this.started||(this.started=!0,this._requestIfNeeded())}stop(){this.started&&(this.started=!1,this._cancelIfNeeded())}destroy(){if(!this._protected){this.stop();let t=this._head.next;for(;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}}update(e=performance.now()){let r;if(e>this.lastTime){if(r=this.elapsedMS=e-this.lastTime,r>this._maxElapsedMS&&(r=this._maxElapsedMS),r*=this.speed,this._minElapsedMS){const t=e-this._lastFrame|0;if(t<this._minElapsedMS)return;this._lastFrame=e-t%this._minElapsedMS}this.deltaMS=r,this.deltaTime=this.deltaMS*t.targetFPMS;const n=this._head;let i=n.next;for(;i;)i=i.emit(this);n.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){const r=Math.min(Math.max(0,e)/1e3,t.targetFPMS);this._maxElapsedMS=1/r,this._minElapsedMS&&e>this.maxFPS&&(this.maxFPS=e)}get maxFPS(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0}set maxFPS(t){0===t?this._minElapsedMS=0:(t<this.minFPS&&(this.minFPS=t),this._minElapsedMS=1/(t/1e3))}static get shared(){if(!t._shared){const e=t._shared=new t;e.autoStart=!0,e._protected=!0}return t._shared}static get system(){if(!t._system){const e=t._system=new t;e.autoStart=!0,e._protected=!0}return t._system}};s.targetFPMS=.06;let o=s},4458:(t,e,r)=>{r.d(e,{d:()=>n});var n=(t=>(t[t.INTERACTION=50]="INTERACTION",t[t.HIGH=25]="HIGH",t[t.NORMAL=0]="NORMAL",t[t.LOW=-25]="LOW",t[t.UTILITY=-50]="UTILITY",t))(n||{})},4577:(t,e,r)=>{let n;function i(){if("boolean"==typeof n)return n;try{const t=new Function("param1","param2","param3","return param1[param2] === param3;");n=!0===t({a:"b"},"a","b")}catch(t){n=!1}return n}r.d(e,{f:()=>i})},2571:(t,e,r)=>{r.d(e,{xv:()=>n});r(8875);const n="8.17.1"},4334:(t,e,r)=>{r.d(e,{s:()=>n});class n{constructor(t){this.items=Object.create(null);const{renderer:e,type:r,onUnload:n,priority:i,name:s}=t;this._renderer=e,e.gc.addResourceHash(this,"items",r,i??0),this._onUnload=n,this.name=s}add(t){return!this.items[t.uid]&&(this.items[t.uid]=t,t.once("unload",this.remove,this),t._gcLastUsed=this._renderer.gc.now,!0)}remove(t,...e){if(!this.items[t.uid])return;const r=t._gpuData[this._renderer.uid];r&&(this._onUnload?.(t,...e),r.destroy(),t._gpuData[this._renderer.uid]=null,this.items[t.uid]=null)}removeAll(...t){Object.values(this.items).forEach((e=>e&&this.remove(e,...t)))}destroy(...t){this.removeAll(...t),this.items=Object.create(null),this._renderer=null,this._onUnload=null}}},9903:(t,e,r)=>{function n(t,e,r){const n=t.length;let i;if(e>=n||0===r)return;const s=n-(r=e+r>n?n-e:r);for(i=e;i<s;++i)t[i]=t[i+r];t.length=s}r.d(e,{d:()=>n})},133:(t,e,r)=>{r.d(e,{L:()=>i});const n={default:-1};function i(t="default"){return void 0===n[t]&&(n[t]=-1),++n[t]}},2048:(t,e,r)=>{function n(t,e,r){const{width:n,height:i}=r.orig,s=r.trim;if(s){const r=s.width,o=s.height;t.minX=s.x-e._x*n,t.maxX=t.minX+r,t.minY=s.y-e._y*i,t.maxY=t.minY+o}else t.minX=-e._x*n,t.maxX=t.minX+n,t.minY=-e._y*i,t.maxY=t.minY+i}r.d(e,{y:()=>n})},7073:(t,e,r)=>{r.d(e,{M:()=>s,d:()=>o});var n=r(8507),i=r(2571);class s{static init(){globalThis.__PIXI_APP_INIT__?.(this,i.xv)}static destroy(){}}s.extension=n.Ag.Application;class o{constructor(t){this._renderer=t}init(){globalThis.__PIXI_RENDERER_INIT__?.(this._renderer,i.xv)}destroy(){this._renderer=null}}o.extension={type:[n.Ag.WebGLSystem,n.Ag.WebGPUSystem],name:"initHook",priority:-10}},4670:(t,e,r)=>{r.d(e,{Ek:()=>s,lj:()=>i,t6:()=>a});const n=new Set,i="8.0.0",s="8.3.4",o={quiet:!1,noColor:!1},a=(t,e,r=3)=>{if(o.quiet||n.has(e))return;let i=(new Error).stack;const s=`${e}\nDeprecated since v${t}`,a="function"==typeof console.groupCollapsed&&!o.noColor;void 0===i?console.warn("PixiJS Deprecation Warning: ",s):(i=i.split("\n").splice(r).join("\n"),a?(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))),n.add(e)};Object.defineProperties(a,{quiet:{get:()=>o.quiet,set:t=>{o.quiet=t},enumerable:!0,configurable:!1},noColor:{get:()=>o.noColor,set:t=>{o.noColor=t},enumerable:!0,configurable:!1}})},268:(t,e,r)=>{r.d(e,{R:()=>s});let n=0;const i=500;function s(...t){n!==i&&(n++,n===i?console.warn("PixiJS Warning: too many warnings, no more warnings will be reported to the console by PixiJS."):console.warn("PixiJS Warning: ",...t))}},6083:(t,e,r)=>{r.d(e,{L:()=>n});const n={_registeredResources:new Set,register(t){this._registeredResources.add(t)},unregister(t){this._registeredResources.delete(t)},release(){this._registeredResources.forEach((t=>t.clear()))},get registeredCount(){return this._registeredResources.size},isRegistered(t){return this._registeredResources.has(t)},reset(){this._registeredResources.clear()}}},8655:(t,e,r)=>{r.d(e,{Z:()=>s});var n=r(6083);class i{constructor(t,e){this._pool=[],this._count=0,this._index=0,this._classType=t,e&&this.prepopulate(e)}prepopulate(t){for(let e=0;e<t;e++)this._pool[this._index++]=new this._classType;this._count+=t}get(t){let e;return this._index>0?e=this._pool[--this._index]:(e=new this._classType,this._count++),e.init?.(t),e}return(t){t.reset?.(),this._pool[this._index++]=t}get totalSize(){return this._count}get totalFree(){return this._index}get totalUsed(){return this._count-this._index}clear(){if(this._pool.length>0&&this._pool[0].destroy)for(let t=0;t<this._index;t++)this._pool[t].destroy();this._pool.length=0,this._count=0,this._index=0}}const s=new class{constructor(){this._poolsByClass=new Map}prepopulate(t,e){this.getPool(t).prepopulate(e)}get(t,e){return this.getPool(t).get(e)}return(t){this.getPool(t.constructor).return(t)}getPool(t){return this._poolsByClass.has(t)||this._poolsByClass.set(t,new i(t)),this._poolsByClass.get(t)}stats(){const t={};return this._poolsByClass.forEach((e=>{const r=t[e._classType.name]?e._classType.name+e._classType.ID:e._classType.name;t[r]={free:e.totalFree,used:e.totalUsed,size:e.totalSize}})),t}clear(){this._poolsByClass.forEach((t=>t.clear())),this._poolsByClass.clear()}};n.L.register(s)},8875:(t,e,r)=>{r.d(e,{A:()=>n});const n=r(5585)}},n={};function i(t){var e=n[t];if(void 0!==e)return e.exports;var s=n[t]={exports:{}};return r[t](s,s.exports,i),s.exports}i.m=r,i.d=(t,e)=>{for(var r in e)i.o(e,r)&&!i.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},i.f={},i.e=t=>Promise.all(Object.keys(i.f).reduce(((e,r)=>(i.f[r](t,e),e)),[])),i.u=t=>t+".vizor_2d.min.js",i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),t={},e="vizor_2d:",i.l=(r,n,s,o)=>{if(t[r])t[r].push(n);else{var a,l;if(void 0!==s)for(var h=document.getElementsByTagName("script"),u=0;u<h.length;u++){var c=h[u];if(c.getAttribute("src")==r||c.getAttribute("data-webpack")==e+s){a=c;break}}a||(l=!0,(a=document.createElement("script")).type="module",a.charset="utf-8",a.timeout=120,i.nc&&a.setAttribute("nonce",i.nc),a.setAttribute("data-webpack",e+s),a.src=r),t[r]=[n];var d=(e,n)=>{a.onerror=a.onload=null,clearTimeout(f);var i=t[r];if(delete t[r],a.parentNode&&a.parentNode.removeChild(a),i&&i.forEach((t=>t(n))),e)return e(n)},f=setTimeout(d.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=d.bind(null,a.onerror),a.onload=d.bind(null,a.onload),l&&document.head.appendChild(a)}},i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t;if("string"==typeof import.meta.url&&(t=import.meta.url),!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),i.p=t})(),(()=>{var t={792:0};i.f.j=(e,r)=>{var n=i.o(t,e)?t[e]:void 0;if(0!==n)if(n)r.push(n[2]);else{var s=new Promise(((r,i)=>n=t[e]=[r,i]));r.push(n[2]=s);var o=i.p+i.u(e),a=new Error;i.l(o,(r=>{if(i.o(t,e)&&(0!==(n=t[e])&&(t[e]=void 0),n)){var s=r&&("load"===r.type?"missing":r.type),o=r&&r.target&&r.target.src;a.message="Loading chunk "+e+" failed.\n("+s+": "+o+")",a.name="ChunkLoadError",a.type=s,a.request=o,n[1](a)}}),"chunk-"+e,e)}};var e=(e,r)=>{var n,s,[o,a,l]=r,h=0;if(o.some((e=>0!==t[e]))){for(n in a)i.o(a,n)&&(i.m[n]=a[n]);if(l)l(i)}for(e&&e(r);h<o.length;h++)s=o[h],i.o(t,s)&&t[s]&&t[s][0](),t[s]=0},r=self.webpackChunkvizor_2d=self.webpackChunkvizor_2d||[];r.forEach(e.bind(null,0)),r.push=e.bind(null,r.push.bind(r))})();var s={};function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function a(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,l(n.key),n)}}function l(t){var e=function(t,e){if("object"!=o(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==o(e)?e:e+""}i.d(s,{A5:()=>Dr,oY:()=>gr,vY:()=>cr,TI:()=>Ir,sV:()=>kr});var h=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return e=t,n=[{key:"build",value:function(e){if(!e)return function(){return!0};switch(e.op){case"and":var r=e.rules.map((function(e){return t.build(e)}));return function(t){return r.every((function(e){return e(t)}))};case"or":var n=e.rules.map((function(e){return t.build(e)}));return function(t){return n.some((function(e){return e(t)}))};case"not":var i=t.build(e.rule);return function(t){return!i(t)};case"eq":return function(t){var r;return(null===(r=t.data)||void 0===r?void 0:r[e.field])===e.value};case"neq":return function(t){var r;return(null===(r=t.data)||void 0===r?void 0:r[e.field])!==e.value};case"gt":return function(t){var r;return(null===(r=t.data)||void 0===r?void 0:r[e.field])>e.value};case"lt":return function(t){var r;return(null===(r=t.data)||void 0===r?void 0:r[e.field])<e.value};case"gte":return function(t){var r;return(null===(r=t.data)||void 0===r?void 0:r[e.field])>=e.value};case"lte":return function(t){var r;return(null===(r=t.data)||void 0===r?void 0:r[e.field])<=e.value};case"regex":var s=new RegExp(e.value);return function(t){var r,n=null===(r=t.data)||void 0===r?void 0:r[e.field];return s.test(String(null!=n?n:""))};case"in":return function(t){var r;return e.value.includes(null===(r=t.data)||void 0===r?void 0:r[e.field])};case"exists":return function(t){return e.field in(t.data||{})};default:return console.warn("Unknown rule:",e),function(){return!0}}}}],(r=null)&&a(e.prototype,r),n&&a(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n}();function u(t){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u(t)}function c(t){return function(t){if(Array.isArray(t))return p(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||f(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=f(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,o=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return o=t.done,t},e:function(t){a=!0,s=t},f:function(){try{o||null==r.return||r.return()}finally{if(a)throw s}}}}function f(t,e){if(t){if("string"==typeof t)return p(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?p(t,e):void 0}}function p(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function y(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,m(n.key),n)}}function m(t){var e=function(t,e){if("object"!=u(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=u(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==u(e)?e:e+""}var g=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.attractionStrength=.15,this.repulsionStrength=200,this.damping=.98,this.minDist=20,this.planetRadius=60,this.planetRepulsion=2,this.orbitStrength=0,this.collisionPadding=2,this.collisionIterations=2,this.velocityEpsilon=.01,this.energyThreshold=.1,this.cooling=.999,this.minStrength=.001},e=[{key:"setModel",value:function(t){this.model=t}},{key:"resolveMoonCollisions",value:function(t){for(var e=0;e<this.collisionIterations;e++)for(var r=0;r<t.length;r++)for(var n=r+1;n<t.length;n++){var i=t[r],s=t[n],o=i.radius||10,a=s.radius||10,l=s.x-i.x,h=s.y-i.y,u=Math.sqrt(l*l+h*h)||1e-4,c=o+a+this.collisionPadding;if(u<c){var d=l/u,f=h/u,p=.5*(c-u);i.fixed||(i.x-=d*p,i.y-=f*p),s.fixed||(s.x+=d*p,s.y+=f*p)}}}},{key:"step",value:function(){var t,e=this,r=this.model.getNodes(),n=r.filter((function(t){return"moon"===t.type})),i=r.filter((function(t){return"planet"===t.type})),s=d(n);try{for(s.s();!(t=s.n()).done;){var o=t.value;o.vx*=this.damping,o.vy*=this.damping}}catch(t){s.e(t)}finally{s.f()}for(var a=0;a<n.length;a++)for(var l=a+1;l<n.length;l++){var h=n[a],u=n[l],f=h.x-u.x,p=h.y-u.y,y=Math.sqrt(f*f+p*p)||.01;y=Math.max(y,this.minDist);var m=this.repulsionStrength/(y*y),g=f/y*m,x=p/y*m;h.fixed||(h.vx+=g,h.vy+=x),u.fixed||(u.vx-=g,u.vy-=x)}var v,b=d(i);try{var _=function(){var t=v.value,r=n.filter((function(e){return t.rule(e)}));if(0===r.length)return 1;if(t.vector){var i,s={x:t.x,y:t.y},o=t.direction,a=t.length,l=t.scalarField,h=r.map((function(t){return t.data[l]})).filter((function(t){return null!=t})),u=Math.min.apply(Math,c(h)),f=Math.max.apply(Math,c(h)),p=d(r);try{for(p.s();!(i=p.n()).done;){var y=i.value,m=y.data[l];null==m&&(m=u);var g=f>u?(m-u)/(f-u):.5;y.x=s.x+o.x*a*g,y.y=s.y+o.y*a*g}}catch(t){p.e(t)}finally{p.f()}}else{var x,b=d(r);try{for(b.s();!(x=b.n()).done;){var _=x.value,w=t.x-_.x,S=t.y-_.y,C=Math.sqrt(w*w+S*S)||.01;C=Math.max(C,e.minDist);var M=100,T=w/C,A=S/C,k=e.attractionStrength*(C-M)*.5+.05*C;_.fixed||(_.vx+=T*k,_.vy+=A*k,_.vx+=.5*T,_.vy+=.5*A);var P=.85+.15*Math.min(1,C/M);_.vx*=P,_.vy*=P,_.vx*T+_.vy*A<0&&(_.vx*=.7,_.vy*=.7),C<3&&(_.x=t.x+T*M,_.y=t.y+A*M,_.vx=0,_.vy=0),C<102&&Math.abs(_.vx)<.05&&Math.abs(_.vy)<.05&&(_.vx=0,_.vy=0),0!==e.orbitStrength&&(_.vx+=-S/C*e.orbitStrength,_.vy+=w/C*e.orbitStrength)}}catch(t){b.e(t)}finally{b.f()}}};for(b.s();!(v=b.n()).done;)_()}catch(t){b.e(t)}finally{b.f()}var w,S=d(i);try{for(S.s();!(w=S.n()).done;){var C,M=w.value,T=d(n);try{for(T.s();!(C=T.n()).done;){var A=C.value,k=A.x-M.x,P=A.y-M.y,E=Math.sqrt(k*k+P*P)||.01;if(E<this.planetRadius){var R=this.planetRadius-E,I=k/E*R*this.planetRepulsion,O=P/E*R*this.planetRepulsion;A.fixed||(A.vx+=I,A.vy+=O)}}}catch(t){T.e(t)}finally{T.f()}}}catch(t){S.e(t)}finally{S.f()}var L,B=this.bounds||{minX:-1/0,maxX:1/0,minY:-1/0,maxY:1/0},D=0,F=d(n);try{for(F.s();!(L=F.n()).done;){var j=L.value;j.fixed||(j.x+=j.vx,j.y+=j.vy,j.x=Math.max(B.minX,Math.min(B.maxX,j.x)),j.y=Math.max(B.minY,Math.min(B.maxY,j.y)),j.vx*=.9,j.vy*=.9,Math.abs(j.vx)<this.velocityEpsilon&&(j.vx=0),Math.abs(j.vy)<this.velocityEpsilon&&(j.vy=0),D+=Math.abs(j.vx)+Math.abs(j.vy))}}catch(t){F.e(t)}finally{F.f()}if(this.resolveMoonCollisions(n),D<this.energyThreshold){var G,z=d(n);try{for(z.s();!(G=z.n()).done;){var N=G.value;N.vx=0,N.vy=0}}catch(t){z.e(t)}finally{z.f()}}D<5&&(this.attractionStrength=Math.max(this.minStrength,.95*this.attractionStrength),this.repulsionStrength=Math.max(this.minStrength,.95*this.repulsionStrength))}}],e&&y(t.prototype,e),r&&y(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function x(t){return x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},x(t)}function v(t){return function(t){if(Array.isArray(t))return w(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||_(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=_(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,o=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return o=t.done,t},e:function(t){a=!0,s=t},f:function(){try{o||null==r.return||r.return()}finally{if(a)throw s}}}}function _(t,e){if(t){if("string"==typeof t)return w(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?w(t,e):void 0}}function w(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function S(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,C(n.key),n)}}function C(t){var e=function(t,e){if("object"!=x(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=x(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==x(e)?e:e+""}var M=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.attractionStrength=.05,this.repulsionStrength=200,this.damping=.9,this.minDist=20,this.minDistSq=this.minDist*this.minDist,this.planetRadius=60,this.planetRepulsion=2,this.orbitStrength=0,this.cellSize=80,this.maxNeighbors=15},e=[{key:"setModel",value:function(t){this.model=t}},{key:"_buildGrid",value:function(t){var e,r=new Map,n=b(t);try{for(n.s();!(e=n.n()).done;){var i=e.value,s=Math.floor(i.x/this.cellSize),o=Math.floor(i.y/this.cellSize),a=s+","+o;r.has(a)||r.set(a,[]),r.get(a).push(i),i._cellX=s,i._cellY=o}}catch(t){n.e(t)}finally{n.f()}return r}},{key:"_getNeighbors",value:function(t,e){for(var r=[],n=-1;n<=1;n++)for(var i=-1;i<=1;i++){var s=e._cellX+n+","+(e._cellY+i),o=t.get(s);if(o){var a,l=b(o);try{for(l.s();!(a=l.n()).done;){var h=a.value;if(h!==e&&(r.push(h),r.length>=this.maxNeighbors))return r}}catch(t){l.e(t)}finally{l.f()}}}return r}},{key:"step",value:function(){var t=this,e=this.model.getNodes(),r=e.filter((function(t){return"moon"===t.type})),n=e.filter((function(t){return"planet"===t.type})),i=this.bounds;if(i){var s,o=b(r);try{for(o.s();!(s=o.n()).done;){var a=s.value;a.vx*=this.damping,a.vy*=this.damping}}catch(t){o.e(t)}finally{o.f()}var l,h=this._buildGrid(r),u=b(r);try{for(u.s();!(l=u.n()).done;){var c,d=l.value,f=b(this._getNeighbors(h,d));try{for(f.s();!(c=f.n()).done;){var p=c.value,y=d.x-p.x,m=d.y-p.y,g=y*y+m*m;g<this.minDistSq&&(g=this.minDistSq);var x=this.repulsionStrength/g,_=Math.sqrt(g),w=y/_*x,S=m/_*x;d.fixed||(d.vx+=w,d.vy+=S)}}catch(t){f.e(t)}finally{f.f()}}}catch(t){u.e(t)}finally{u.f()}var C,M=b(n);try{var T=function(){var e=C.value,n=r.filter((function(t){return e.rule(t)}));if(0===n.length)return 1;if(e.vector){var i,s={x:e.x,y:e.y},o=e.direction,a=e.length,l=e.scalarField,h=n.map((function(t){return t.data[l]})).filter((function(t){return null!=t})),u=Math.min.apply(Math,v(h)),c=Math.max.apply(Math,v(h)),d=b(n);try{for(d.s();!(i=d.n()).done;){var f=i.value,p=f.data[l];null==p&&(p=u);var y=c>u?(p-u)/(c-u):.5;f.x=s.x+o.x*a*y,f.y=s.y+o.y*a*y}}catch(t){d.e(t)}finally{d.f()}}else{var m,g=b(n);try{for(g.s();!(m=g.n()).done;){var x=m.value,_=e.x-x.x,w=e.y-x.y,S=_*_+w*w;S<t.minDistSq&&(S=t.minDistSq);var M=Math.sqrt(S),T=t.attractionStrength*M;x.fixed||(x.vx+=_/M*T,x.vy+=w/M*T),0!==t.orbitStrength&&(x.vx+=-w/M*t.orbitStrength,x.vy+=_/M*t.orbitStrength)}}catch(t){g.e(t)}finally{g.f()}}};for(M.s();!(C=M.n()).done;)T()}catch(t){M.e(t)}finally{M.f()}var A,k=b(n);try{for(k.s();!(A=k.n()).done;){var P,E=A.value,R=b(r);try{for(R.s();!(P=R.n()).done;){var I=P.value,O=I.x-E.x,L=I.y-E.y,B=Math.sqrt(O*O+L*L)||.01;if(B<this.planetRadius){var D=this.planetRadius-B,F=O/B*D*this.planetRepulsion,j=L/B*D*this.planetRepulsion;I.fixed||(I.vx+=F,I.vy+=j)}}}catch(t){R.e(t)}finally{R.f()}}}catch(t){k.e(t)}finally{k.f()}var G,z=b(r);try{for(z.s();!(G=z.n()).done;){var N=G.value;N.fixed||(N.x+=N.vx,N.y+=N.vy,N.x=Math.max(i.minX,Math.min(i.maxX,N.x)),N.y=Math.max(i.minY,Math.min(i.maxY,N.y)))}}catch(t){z.e(t)}finally{z.f()}}}}],e&&S(t.prototype,e),r&&S(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function T(t){return T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},T(t)}function A(t){return function(t){if(Array.isArray(t))return E(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||P(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function k(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=P(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,o=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return o=t.done,t},e:function(t){a=!0,s=t},f:function(){try{o||null==r.return||r.return()}finally{if(a)throw s}}}}function P(t,e){if(t){if("string"==typeof t)return E(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?E(t,e):void 0}}function E(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function R(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,I(n.key),n)}}function I(t){var e=function(t,e){if("object"!=T(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=T(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==T(e)?e:e+""}var O=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.innerRadius=20,this.outerRadius=300,this.turns=4,this.spread=1,this.smoothing=.15,this.angleOffset=0,this.arcStep=12,this.wobbleStrength=2,this.wobbleFrequency=2,this.wobbleSpeed=.02,this.wobbleThreshold=3e3},e=[{key:"setModel",value:function(t){this.model=t}},{key:"step",value:function(){var t,e=this,r=this.model.getNodes(),n=r.filter((function(t){return"moon"===t.type})),i=k(r.filter((function(t){return"planet"===t.type})));try{var s=function(){var r=t.value,i=r.scalarField;if(!i)return 0;var s=n.filter((function(t){return r.rule(t)}));if(0===s.length)return 0;var o,a=1/0,l=-1/0,h=k(s);try{for(h.s();!(o=h.n()).done;){var u=o.value.data[i];null!=u&&(u<a&&(a=u),u>l&&(l=u))}}catch(t){h.e(t)}finally{h.f()}if(a===1/0||l===-1/0)return 0;r._sorted&&!r._dirty||(r._sorted=A(s).sort((function(t,e){var r,n;return(null!==(r=t.data[i])&&void 0!==r?r:a)-(null!==(n=e.data[i])&&void 0!==n?n:a)})),r._sorted.forEach((function(t,e){t._spiralIndex=e})),r._dirty=!1);var c,d=r._sorted,f=d.length<e.wobbleThreshold,p=k(d);try{for(p.s();!(c=p.n()).done;){var y=c.value,m=y.data[i];null==m&&(m=a);var g=l>a?(m-a)/(l-a):.5,x=e.angleOffset+g*e.turns*Math.PI*2,v=e.innerRadius+g*(e.outerRadius-e.innerRadius)*e.spread,b=y._spiralIndex||0,_=x+b*(e.arcStep/(v+1)),w=v+.5*b,S=0;f&&(void 0===y._spiralPhase&&(y._spiralPhase=Math.random()*Math.PI*2),y._spiralPhase+=e.wobbleSpeed,S=Math.sin(y._spiralPhase*e.wobbleFrequency)*e.wobbleStrength);var C=r.x+Math.cos(_)*(w+S),M=r.y+Math.sin(_)*(w+S);y.x+=(C-y.x)*e.smoothing,y.y+=(M-y.y)*e.smoothing}}catch(t){p.e(t)}finally{p.f()}};for(i.s();!(t=i.n()).done;)s()}catch(t){i.e(t)}finally{i.f()}}}],e&&R(t.prototype,e),r&&R(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function L(t){return L="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},L(t)}function B(t){return function(t){if(Array.isArray(t))return F(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||D(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function D(t,e){if(t){if("string"==typeof t)return F(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?F(t,e):void 0}}function F(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function j(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,G(n.key),n)}}function G(t){var e=function(t,e){if("object"!=L(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=L(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==L(e)?e:e+""}var z=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.smoothing=.2,this.padding=40,this.jitter=10},e=[{key:"setModel",value:function(t){this.model=t}},{key:"_mapCategorical",value:function(t){var e=B(new Set(t)),r=new Map;return e.forEach((function(t,e){r.set(t,e)})),r}},{key:"step",value:function(){var t=this,e=this.model.getNodes(),r=e.filter((function(t){return"moon"===t.type})),n=e.filter((function(t){return"vector"===t.type})),i=this.bounds;if(i){var s,o=i.minY+this.padding,a=i.maxY-this.padding-o,l=i.minX+this.padding,h=i.maxX-this.padding-l,u=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=D(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,o=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return o=t.done,t},e:function(t){a=!0,s=t},f:function(){try{o||null==r.return||r.return()}finally{if(a)throw s}}}}(n);try{var c=function(){var e=s.value,n=e.scalarField;if(!n)return 0;var i=r.filter((function(t){return e.rule(t)}));if(0===i.length)return 0;var u=i.map((function(t){return t.data[n]})).filter((function(t){return null!=t}));if(0===u.length)return 0;var c,d,f,p="number"==typeof u[0];p?(c=Math.min.apply(Math,B(u)),d=Math.max.apply(Math,B(u))):(f=t._mapCategorical(u),c=0,d=f.size-1),i.sort((function(t,e){var r,i,s=t.data[n],o=e.data[n];return p||(s=f.get(s),o=f.get(o)),(null!==(r=s)&&void 0!==r?r:0)-(null!==(i=o)&&void 0!==i?i:0)})),i.forEach((function(r,i){var s=r.data[n];null==s&&(s=c),p||(s=f.get(s));var u=r.x,y=r.y;if(p){var m,g,x=d>c?(s-c)/(d-c):.5;0!==(null===(m=e.direction)||void 0===m?void 0:m.x)&&(u=l+x*h),0!==(null===(g=e.direction)||void 0===g?void 0:g.y)&&(y=o+x*a)}else{var v,b,_=d+1;if(0!==(null===(v=e.direction)||void 0===v?void 0:v.y)){var w=a/_;y=o+s*w+w/2,u=r.x+(Math.random()-.5)*t.jitter}if(0!==(null===(b=e.direction)||void 0===b?void 0:b.x)){var S=h/_;u=l+s*S+S/2,y=r.y+(Math.random()-.5)*t.jitter}}r.x+=(u-r.x)*t.smoothing,r.y+=(y-r.y)*t.smoothing}))};for(u.s();!(s=u.n()).done;)c()}catch(t){u.e(t)}finally{u.f()}}}}],e&&j(t.prototype,e),r&&j(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function N(t){return N="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},N(t)}function W(t){return function(t){if(Array.isArray(t))return X(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||U(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function U(t,e){if(t){if("string"==typeof t)return X(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?X(t,e):void 0}}function X(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Y(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,V(n.key),n)}}function V(t){var e=function(t,e){if("object"!=N(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=N(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==N(e)?e:e+""}var H=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.innerRadius=20,this.outerRadius=300,this.turns=4,this.spread=1,this.smoothing=.15,this.angleOffset=0,this.jitter=.002,this.wobbleStrength=2,this.wobbleFrequency=2},e=[{key:"setModel",value:function(t){this.model=t}},{key:"step",value:function(){var t,e=this,r=this.model.getNodes(),n=r.filter((function(t){return"moon"===t.type})),i=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=U(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,o=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return o=t.done,t},e:function(t){a=!0,s=t},f:function(){try{o||null==r.return||r.return()}finally{if(a)throw s}}}}(r.filter((function(t){return"planet"===t.type})));try{var s=function(){var r=t.value,i=r.scalarField;if(!i)return 0;var s=n.filter((function(t){return r.rule(t)}));if(0===s.length)return 0;s.sort((function(t,e){var r,n;return(null!==(r=t.data[i])&&void 0!==r?r:0)-(null!==(n=e.data[i])&&void 0!==n?n:0)}));var o=s.map((function(t){return t.data[i]})).filter((function(t){return null!=t}));if(0===o.length)return 0;var a=Math.min.apply(Math,W(o)),l=Math.max.apply(Math,W(o));s.forEach((function(t,n){var s=t.data[i];null==s&&(s=a);var o=l>a?(s-a)/(l-a):.5,h=e.angleOffset+o*e.turns*Math.PI*2,u=e.innerRadius+o*(e.outerRadius-e.innerRadius)*e.spread;void 0===t._spiralPhase&&(t._spiralPhase=Math.random()*Math.PI*2),t._spiralPhase+=.02;var c=Math.sin(t._spiralPhase*e.wobbleFrequency)*e.wobbleStrength,d=r.x+Math.cos(h)*(u+c),f=r.y+Math.sin(h)*(u+c);Math.random(),e.jitter,t.x+=(d-t.x)*e.smoothing,t.y+=(f-t.y)*e.smoothing}))};for(i.s();!(t=i.n()).done;)s()}catch(t){i.e(t)}finally{i.f()}}}],e&&Y(t.prototype,e),r&&Y(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function $(t){return $="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$(t)}function q(t){return function(t){if(Array.isArray(t))return Z(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||K(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function K(t,e){if(t){if("string"==typeof t)return Z(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Z(t,e):void 0}}function Z(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Q(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,J(n.key),n)}}function J(t){var e=function(t,e){if("object"!=$(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=$(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==$(e)?e:e+""}var tt=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.innerRadius=50,this.outerRadius=240,this.rings=6,this.angularSpeed=.002,this.smoothing=.15,this.wobbleStrength=2,this.wobbleFrequency=2,this.angleJitter=.002},e=[{key:"setModel",value:function(t){this.model=t}},{key:"step",value:function(){var t,e=this,r=this.model.getNodes(),n=r.filter((function(t){return"moon"===t.type})),i=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=K(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,o=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return o=t.done,t},e:function(t){a=!0,s=t},f:function(){try{o||null==r.return||r.return()}finally{if(a)throw s}}}}(r.filter((function(t){return"planet"===t.type})));try{var s=function(){var r=t.value,i=r.scalarField;if(!i)return 0;var s=n.filter((function(t){return r.rule(t)}));if(0===s.length)return 0;var o=s.map((function(t){return t.data[i]})).filter((function(t){return null!=t}));if(0===o.length)return 0;var a=Math.min.apply(Math,q(o)),l=Math.max.apply(Math,q(o));s.forEach((function(t){var n=t.data[i];null==n&&(n=a);var s=l>a?(n-a)/(l-a):.5,o=Math.floor(s*e.rings),h=Math.min(e.rings-1,o),u=Math.pow(h/(e.rings-1||1),1.5),c=e.innerRadius+u*(e.outerRadius-e.innerRadius);void 0===t._orbitAngle&&(t._orbitAngle=Math.random()*Math.PI*2);var d=e.angularSpeed/(1+.5*h);t._orbitAngle+=d;var f=Math.sin(t._orbitAngle*e.wobbleFrequency)*e.wobbleStrength,p=r.x+Math.cos(t._orbitAngle)*(c+f),y=r.y+Math.sin(t._orbitAngle)*(c+f);t._orbitAngle+=(Math.random()-.5)*e.angleJitter,t.x+=(p-t.x)*e.smoothing,t.y+=(y-t.y)*e.smoothing}))};for(i.s();!(t=i.n()).done;)s()}catch(t){i.e(t)}finally{i.f()}}}],e&&Q(t.prototype,e),r&&Q(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function et(t){return et="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},et(t)}function rt(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return nt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?nt(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,o=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return o=t.done,t},e:function(t){a=!0,s=t},f:function(){try{o||null==r.return||r.return()}finally{if(a)throw s}}}}function nt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function it(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,st(n.key),n)}}function st(t){var e=function(t,e){if("object"!=et(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=et(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==et(e)?e:e+""}var ot=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.gravity=.005,this.damping=.999,this.restitution=.7,this.friction=.98,this.radius=10},(e=[{key:"setModel",value:function(t){this.model=t}},{key:"step",value:function(){var t,e=this.model.getNodes().filter((function(t){return"moon"===t.type})),r=this.bounds,n=r.maxY,i=rt(e);try{for(i.s();!(t=i.n()).done;){var s=t.value;s.fixed||(s.vy+=this.gravity,s.x+=s.vx,s.y+=s.vy,s.y+this.radius>n&&(s.y=n-this.radius,s.vy*=-this.restitution,s.vx*=this.friction),s.x-this.radius<r.minX&&(s.x=r.minX+this.radius,s.vx*=-this.restitution),s.x+this.radius>r.maxX&&(s.x=r.maxX-this.radius,s.vx*=-this.restitution),s.vx*=this.damping,s.vy*=this.damping)}}catch(t){i.e(t)}finally{i.f()}}}])&&it(t.prototype,e),r&&it(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function at(t){return at="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},at(t)}function lt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,ht(n.key),n)}}function ht(t){var e=function(t,e){if("object"!=at(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=at(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==at(e)?e:e+""}var ut=function(){return t=function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.view=e,this.model=r,this.main=null,this.selected=new Set,this._bindViewEvents()},(e=[{key:"_bindViewEvents",value:function(){var t=this;this.view.onNodeClick=function(e){t._inspectNode(e)},this.view.onNodeRightClick=function(e){var r=e.node,n=e.global,i=t.view.app.canvas.getBoundingClientRect(),s=i.left+n.x,o=i.top+n.y;t.view.selectedNodes.size>1?t._showGroupContextMenu(s,o,r):t._showContextMenu(s,o,r)},this.view.onNodeDragStart=function(t){t.vx=0,t.vy=0,t.fixed=!0},this.view.onNodeDragMove=function(t,e){t.x=e.x,t.y=e.y},this.view.onNodeDragEnd=function(t){t.fixed=!1},this.view.onBackgroundPointerDown=function(){t._hideContextMenu()},this.view.onNodeClick=function(t,e){console.log("Selected:",t)},this.view.onSelectionChange=function(t){console.log("Selected nodes:",t)}}},{key:"_inspectNode",value:function(t){var e=document.getElementById("inspector");e||((e=document.createElement("div")).id="inspector",document.body.appendChild(e)),e.innerHTML="\n <pre>".concat(JSON.stringify(t.data,null,2),"</pre>\n ")}},{key:"_showContextMenu",value:function(t,e,r){var n=this;this._hideContextMenu();var i=document.createElement("div");i.className="context-menu";var s=this.view.app.canvas.parentElement,o=s.getBoundingClientRect();i.style.position="absolute",i.style.left="".concat(t-o.left,"px"),i.style.top="".concat(e-o.top,"px"),i.style.background="#2b2b2b",i.style.color="#fff",i.style.padding="6px",i.style.borderRadius="8px",i.style.zIndex=1e3,i.style.minWidth="140px",i.style.boxShadow="0 4px 12px rgba(0,0,0,0.4)",i.style.fontSize="13px",i.style.userSelect="none";var a=function(t,e){var r=document.createElement("div");return r.textContent=t,r.style.padding="8px 12px",r.style.borderRadius="6px",r.style.cursor="pointer",r.style.transition="background 0.15s",r.addEventListener("mouseenter",(function(){r.style.background="#3a3a3a"})),r.addEventListener("mouseleave",(function(){r.style.background="transparent"})),r.addEventListener("click",e),r};i.appendChild(a("🗑 Delete Node",(function(){n._deleteNode(r),n._hideContextMenu()})));var l=document.createElement("div");l.style.height="1px",l.style.background="#444",l.style.margin="4px 0",i.appendChild(l),i.appendChild(a("🔍 Inspect",(function(){var t,e;null===(t=(e=n.main).onNodeInspect)||void 0===t||t.call(e,r),n._hideContextMenu()}))),s.appendChild(i),this._contextMenu=i}},{key:"_hideContextMenu",value:function(){this._contextMenu&&(this._contextMenu.remove(),this._contextMenu=null),this._hideGroupContextMenu()}},{key:"_showGroupContextMenu",value:function(t,e,r){var n=this;this._hideGroupContextMenu();var i=document.createElement("div");i.className="context-menu";var s=this.view.app.canvas.parentElement,o=s.getBoundingClientRect();i.style.position="absolute",i.style.left="".concat(t-o.left,"px"),i.style.top="".concat(e-o.top,"px"),i.style.background="#2b2b2b",i.style.color="#fff",i.style.padding="6px",i.style.borderRadius="8px",i.style.zIndex=1e3,i.style.minWidth="140px",i.style.boxShadow="0 4px 12px rgba(0,0,0,0.4)",i.style.fontSize="13px",i.style.userSelect="none";var a=function(t,e){var r=document.createElement("div");return r.textContent=t,r.style.padding="8px 12px",r.style.borderRadius="6px",r.style.cursor="pointer",r.style.transition="background 0.15s",r.addEventListener("mouseenter",(function(){r.style.background="#3a3a3a"})),r.addEventListener("mouseleave",(function(){r.style.background="transparent"})),r.addEventListener("click",e),r};i.appendChild(a("🗑 Delete Selected Nodes",(function(){})));var l=document.createElement("div");l.style.height="1px",l.style.background="#444",l.style.margin="4px 0",i.appendChild(l),i.appendChild(a("🔍 Inspect Selection",(function(){var t,e;null===(t=(e=n.main).onGroupInspect)||void 0===t||t.call(e,n.view.getSelectedMoons()),n._hideGroupContextMenu()}))),s.appendChild(i),this._groupContextMenu=i}},{key:"_hideGroupContextMenu",value:function(){this._groupContextMenu&&(this._groupContextMenu.remove(),this._groupContextMenu=null)}},{key:"_deleteNode",value:function(t){this.model.deleteNode(t.id);var e=this.view.graphicsMap.get(t.id);e&&(e.destroy(),this.view.graphicsMap.delete(t.id));var r=this.view.graphicsMap.get(t.id+"_axis");r&&(r.destroy(),this.view.graphicsMap.delete(t.id+"_axis")),this.selected.delete(t.id)}},{key:"_highlight",value:function(t){var e=this.view.graphicsMap.get(t);e&&(e.tint=16711680)}}])&<(t.prototype,e),r&<(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}(),ct=i(8507);const dt={extension:{type:ct.Ag.Environment,name:"browser",priority:-1},test:()=>!0,load:async()=>{await Promise.all([i.e(859),i.e(397)]).then(i.bind(i,8397))}},ft={extension:{type:ct.Ag.Environment,name:"webworker",priority:0},test:()=>"undefined"!=typeof self&&void 0!==self.WorkerGlobalScope,load:async()=>{await Promise.all([i.e(859),i.e(162)]).then(i.bind(i,2162))}};i(5753),i(6312);var pt=i(1761),yt=i(800);let mt,gt;async function xt(t={}){return void 0!==gt||(gt=await(async()=>{const e=pt.e.get().getNavigator().gpu;if(!e)return!1;try{const r=await e.requestAdapter(t);return await r.requestDevice(),!0}catch(t){return!1}})()),gt}const vt=["webgl","webgpu","canvas"];var bt=i(5559),_t=i(7073),wt=i(4670);class St{static init(t){Object.defineProperty(this,"resizeTo",{configurable:!0,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;let t,e;if(this._cancelResize(),this._resizeTo===globalThis.window)t=globalThis.innerWidth,e=globalThis.innerHeight;else{const{clientWidth:r,clientHeight:n}=this._resizeTo;t=r,e=n}this.renderer.resize(t,e),this.render()},this._resizeId=null,this._resizeTo=null,this.resizeTo=t.resizeTo||null}static destroy(){globalThis.removeEventListener("resize",this.queueResize),this._cancelResize(),this._cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null}}St.extension=ct.Ag.Application;var Ct=i(4458),Mt=i(7309);class Tt{static init(t){t=Object.assign({autoStart:!0,sharedTicker:!1},t),Object.defineProperty(this,"ticker",{configurable:!0,set(t){this._ticker&&this._ticker.remove(this.render,this),this._ticker=t,t&&t.add(this.render,this,Ct.d.LOW)},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?Mt.R.shared:new Mt.R,t.autoStart&&this.start()}static destroy(){if(this._ticker){const t=this._ticker;this.ticker=null,t.destroy()}}}Tt.extension=ct.Ag.Application,ct.XO.add(St),ct.XO.add(Tt);const At=class t{constructor(...t){this.stage=new bt.mc,void 0!==t[0]&&(0,wt.t6)(wt.lj,"Application constructor options are deprecated, please use Application.init() instead.")}async init(e){e={...e},this.stage||(this.stage=new bt.mc),this.renderer=await async function(t){let e,r=[];t.preference?(r.push(t.preference),vt.forEach((e=>{e!==t.preference&&r.push(e)}))):r=vt.slice();let n={};for(let o=0;o<r.length;o++){const a=r[o];if("webgpu"===a&&await xt()){const{WebGPURenderer:r}=await Promise.all([i.e(468),i.e(866)]).then(i.bind(i,9866));e=r,n={...t,...t.webgpu};break}if("webgl"===a&&(s=t.failIfMajorPerformanceCaveat??yt.k.defaultOptions.failIfMajorPerformanceCaveat,void 0!==mt||(mt=(()=>{const t={stencil:!0,failIfMajorPerformanceCaveat:s??yt.k.defaultOptions.failIfMajorPerformanceCaveat};try{if(!pt.e.get().getWebGLRenderingContext())return!1;let e=pt.e.get().createCanvas().getContext("webgl",t);const r=!!e?.getContextAttributes()?.stencil;if(e){const t=e.getExtension("WEBGL_lose_context");t&&t.loseContext()}return e=null,r}catch(t){return!1}})()),mt)){const{WebGLRenderer:r}=await Promise.all([i.e(468),i.e(132)]).then(i.bind(i,4132));e=r,n={...t,...t.webgl};break}if("canvas"===a){const{CanvasRenderer:r}=await Promise.all([i.e(468),i.e(851)]).then(i.bind(i,6851));e=r,n={...t,...t.canvasOptions};break}}var s;if(delete n.webgpu,delete n.webgl,delete n.canvasOptions,!e)throw new Error("No available renderer for the current environment");const o=new e;return await o.init(n),o}(e),t._plugins.forEach((t=>{t.init.call(this,e)}))}render(){this.renderer.render({container:this.stage})}get canvas(){return this.renderer.canvas}get view(){return(0,wt.t6)(wt.lj,"Application.view is deprecated, please use Application.canvas instead."),this.renderer.canvas}get screen(){return this.renderer.screen}destroy(e=!1,r=!1){const n=t._plugins.slice(0);n.reverse(),n.forEach((t=>{t.destroy.call(this)})),this.stage.destroy(r),this.stage=null,this.renderer.destroy(e),this.renderer=null}};At._plugins=[];let kt=At;ct.XO.handleByList(ct.Ag.Application,kt._plugins),ct.XO.add(_t.M);i(9726);var Pt=i(4663),Et=i(583),Rt=i(218),It=i(2812),Ot=i(4985);class Lt extends Ot.l{constructor(t,e){const{text:r,resolution:n,style:i,anchor:s,width:o,height:a,roundPixels:l,...h}=t;super({...h}),this.batched=!0,this._resolution=null,this._autoResolution=!0,this._didTextUpdate=!0,this._styleClass=e,this.text=r??"",this.style=i,this.resolution=n??null,this.allowChildren=!1,this._anchor=new It.o({_onUpdate:()=>{this.onViewUpdate()}}),s&&(this.anchor=s),this.roundPixels=l??!1,void 0!==o&&(this.width=o),void 0!==a&&(this.height=a)}get anchor(){return this._anchor}set anchor(t){"number"==typeof t?this._anchor.set(t):this._anchor.copyFrom(t)}set text(t){t=t.toString(),this._text!==t&&(this._text=t,this.onViewUpdate())}get text(){return this._text}set resolution(t){this._autoResolution=null===t,this._resolution=t,this.onViewUpdate()}get resolution(){return this._resolution}get style(){return this._style}set style(t){t||(t={}),this._style?.off("update",this.onViewUpdate,this),t instanceof this._styleClass?this._style=t:this._style=new this._styleClass(t),this._style.on("update",this.onViewUpdate,this),this.onViewUpdate()}get width(){return Math.abs(this.scale.x)*this.bounds.width}set width(t){this._setWidth(t,this.bounds.width)}get height(){return Math.abs(this.scale.y)*this.bounds.height}set height(t){this._setHeight(t,this.bounds.height)}getSize(t){return t||(t={}),t.width=Math.abs(this.scale.x)*this.bounds.width,t.height=Math.abs(this.scale.y)*this.bounds.height,t}setSize(t,e){"object"==typeof t?(e=t.height??t.width,t=t.width):e??(e=t),void 0!==t&&this._setWidth(t,this.bounds.width),void 0!==e&&this._setHeight(e,this.bounds.height)}containsPoint(t){const e=this.bounds.width,r=this.bounds.height,n=-e*this.anchor.x;let i=0;return t.x>=n&&t.x<=n+e&&(i=-r*this.anchor.y,t.y>=i&&t.y<=i+r)}onViewUpdate(){this.didViewUpdate||(this._didTextUpdate=!0),super.onViewUpdate()}destroy(t=!1){super.destroy(t),this.owner=null,this._bounds=null,this._anchor=null,("boolean"==typeof t?t:t?.style)&&this._style.destroy(t),this._style=null,this._text=null}get styleKey(){return`${this._text}:${this._style.styleKey}:${this._resolution}`}}var Bt=i(2577),Dt=i(9252),Ft=i(7608),jt=i(9939);let Gt=null,zt=null;function Nt(t,e,r){for(let n=0,i=4*r*e;n<e;++n,i+=4)if(0!==t[i+3])return!1;return!0}function Wt(t,e,r,n,i){const s=4*e;for(let e=n,o=n*s+4*r;e<=i;++e,o+=s)if(0!==t[o+3])return!1;return!0}function Ut(...t){let e=t[0];e.canvas||(e={canvas:t[0],resolution:t[1]});const{canvas:r}=e,n=Math.min(e.resolution??1,1),i=e.width??r.width,s=e.height??r.height;let o=e.output;if(function(t,e){Gt||(Gt=pt.e.get().createCanvas(256,128),zt=Gt.getContext("2d",{willReadFrequently:!0}),zt.globalCompositeOperation="copy",zt.globalAlpha=1),(Gt.width<t||Gt.height<e)&&(Gt.width=(0,jt.U5)(t),Gt.height=(0,jt.U5)(e))}(i,s),!zt)throw new TypeError("Failed to get canvas 2D context");zt.drawImage(r,0,0,i,s,0,0,i*n,s*n);const a=zt.getImageData(0,0,i,s).data;let l=0,h=0,u=i-1,c=s-1;for(;h<s&&Nt(a,i,h);)++h;if(h===s)return Dt.M.EMPTY;for(;Nt(a,i,c);)--c;for(;Wt(a,i,l,h,c);)++l;for(;Wt(a,i,u,h,c);)--u;return++u,++c,zt.globalCompositeOperation="source-over",zt.strokeRect(l,h,u-l,c-h),zt.globalCompositeOperation="copy",o??(o=new Dt.M),o.set(l/n,h/n,(u-l)/n,(c-h)/n),o}class Xt{constructor(t=0,e=0,r=!1){this.first=null,this.items=Object.create(null),this.last=null,this.max=t,this.resetTtl=r,this.size=0,this.ttl=e}clear(){return this.first=null,this.items=Object.create(null),this.last=null,this.size=0,this}delete(t){if(this.has(t)){const e=this.items[t];delete this.items[t],this.size--,null!==e.prev&&(e.prev.next=e.next),null!==e.next&&(e.next.prev=e.prev),this.first===e&&(this.first=e.next),this.last===e&&(this.last=e.prev)}return this}entries(t=this.keys()){const e=new Array(t.length);for(let r=0;r<t.length;r++){const n=t[r];e[r]=[n,this.get(n)]}return e}evict(t=!1){if(t||this.size>0){const t=this.first;delete this.items[t.key],0==--this.size?(this.first=null,this.last=null):(this.first=t.next,this.first.prev=null)}return this}expiresAt(t){let e;return this.has(t)&&(e=this.items[t].expiry),e}get(t){const e=this.items[t];if(void 0!==e)return this.ttl>0&&e.expiry<=Date.now()?void this.delete(t):(this.moveToEnd(e),e.value)}has(t){return t in this.items}moveToEnd(t){this.last!==t&&(null!==t.prev&&(t.prev.next=t.next),null!==t.next&&(t.next.prev=t.prev),this.first===t&&(this.first=t.next),t.prev=this.last,t.next=null,null!==this.last&&(this.last.next=t),this.last=t,null===this.first&&(this.first=t))}keys(){const t=new Array(this.size);let e=this.first,r=0;for(;null!==e;)t[r++]=e.key,e=e.next;return t}setWithEvicted(t,e,r=this.resetTtl){let n=null;if(this.has(t))this.set(t,e,!0,r);else{this.max>0&&this.size===this.max&&(n={...this.first},this.evict(!0));let r=this.items[t]={expiry:this.ttl>0?Date.now()+this.ttl:this.ttl,key:t,prev:this.last,next:null,value:e};1==++this.size?this.first=r:this.last.next=r,this.last=r}return n}set(t,e,r=!1,n=this.resetTtl){let i=this.items[t];return r||void 0!==i?(i.value=e,!1===r&&n&&(i.expiry=this.ttl>0?Date.now()+this.ttl:this.ttl),this.moveToEnd(i)):(this.max>0&&this.size===this.max&&this.evict(!0),i=this.items[t]={expiry:this.ttl>0?Date.now()+this.ttl:this.ttl,key:t,prev:this.last,next:null,value:e},1==++this.size?this.first=i:this.last.next=i,this.last=i),this}values(t=this.keys()){const e=new Array(t.length);for(let r=0;r<t.length;r++)e[r]=this.get(t[r]);return e}}function Yt(t){return!!t.tagStyles&&Object.keys(t.tagStyles).length>0}function Vt(t){return t.includes("<")}function Ht(t,e){const r=[],n=e.tagStyles;if(!Yt(e)||!Vt(t))return r.push({text:t,style:e}),r;const i=[e],s=[];let o="",a=0;for(;a<t.length;){const e=t[a];if("<"===e){const u=t.indexOf(">",a);if(-1===u){o+=e,a++;continue}const c=t.slice(a+1,u);if(c.startsWith("/")){const e=c.slice(1).trim();if(s.length>0&&s[s.length-1]===e){o.length>0&&(r.push({text:o,style:i[i.length-1]}),o=""),i.pop(),s.pop(),a=u+1;continue}o+=t.slice(a,u+1),a=u+1;continue}{const e=c.trim();if(n[e]){o.length>0&&(r.push({text:o,style:i[i.length-1]}),o="");const t=i[i.length-1],c=(l=t,h=n[e],l.clone().assign(h));i.push(c),s.push(e),a=u+1;continue}o+=t.slice(a,u+1),a=u+1;continue}}o+=e,a++}var l,h;return o.length>0&&r.push({text:o,style:i[i.length-1]}),r}const $t=new Set([10,13]),qt=new Set([9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288]),Kt=(new Set([9,32]),new Set([45,8208,8211,8212,173])),Zt=/(\r\n|\r|\n)/,Qt=/(?:\r\n|\r|\n)/;function Jt(t){return"string"==typeof t&&$t.has(t.charCodeAt(0))}function te(t,e){return"string"==typeof t&&qt.has(t.charCodeAt(0))}function ee(t){return"string"==typeof t&&Kt.has(t.charCodeAt(0))}function re(t){return"normal"===t||"pre-line"===t}function ne(t){return"normal"===t}function ie(t){if("string"!=typeof t)return"";let e=t.length-1;for(;e>=0&&te(t[e]);)e--;return e<t.length-1?t.slice(0,e+1):t}function se(t){const e=[],r=[];if("string"!=typeof t)return e;for(let n=0;n<t.length;n++){const i=t[n],s=t[n+1];te(i)||Jt(i)?(r.length>0&&(e.push(r.join("")),r.length=0),"\r"===i&&"\n"===s?(e.push("\r\n"),n++):e.push(i)):(r.push(i),ee(i)&&s&&!te(s)&&!Jt(s)&&(e.push(r.join("")),r.length=0))}return r.length>0&&e.push(r.join("")),e}function oe(t,e,r,n){const i=r(t),s=[];for(let r=0;r<i.length;r++){let o=i[r],a=o,l=1;for(;i[r+l];){const s=i[r+l];if(n(a,s,t,r,e))break;o+=s,a=s,l++}r+=l-1,s.push(o)}return s}const ae=/\r\n|\r|\n/g;function le(t,e,r,n,i,s,o,a){const l=Ht(t,e);if(ne(e.whiteSpace))for(let t=0;t<l.length;t++){const e=l[t];l[t]={text:e.text.replace(ae," "),style:e.style}}const h=[];let u=[];for(const t of l){const e=t.text.split(Zt);for(let r=0;r<e.length;r++){const n=e[r];"\r\n"===n||"\r"===n||"\n"===n?(h.push(u),u=[]):n.length>0&&u.push({text:n,style:t.style})}}(u.length>0||0===h.length)&&h.push(u);const c=r?function(t,e,r,n,i,s){const{letterSpacing:o,whiteSpace:a,wordWrapWidth:l,breakWords:h}=e,u=re(a),c=l+o,d={};let f="";const p=(t,e)=>{const i=`${t}|${e.styleKey}`;let s=d[i];if(void 0===s){const o=e._fontString;o!==f&&(r.font=o,f=o),s=n(t,e.letterSpacing,r)+e.letterSpacing,d[i]=s}return s},y=[];for(const e of t){const t=he(e),r=y.length,n=e=>{let r=0,n=e;do{const{token:e,style:i}=t[n];r+=p(e,i),n++}while(n<t.length&&t[n].continuesFromPrevious);return r},o=e=>{const r=[];let n=e;do{r.push({token:t[n].token,style:t[n].style}),n++}while(n<t.length&&t[n].continuesFromPrevious);return r};let a=[],l=0,d=!u,f=null;const m=()=>{f&&f.text.length>0&&a.push(f),f=null},g=()=>{if(m(),a.length>0){const t=a[a.length-1];t.text=ie(t.text),0===t.text.length&&a.pop()}y.push(a),a=[],l=0,d=!1};for(let e=0;e<t.length;e++){const{token:r,style:x,continuesFromPrevious:v}=t[e],b=p(r,x);if(u){const t=te(r),e=f?.text[f.text.length-1]??a[a.length-1]?.text.slice(-1)??"",n=!!e&&te(e);if(t&&n)continue}const _=!v,w=_?n(e):b;if(w>c&&_)if(l>0&&g(),h){const t=o(e);for(let e=0;e<t.length;e++){const r=t[e].token,n=t[e].style,o=oe(r,h,s,i);for(const t of o){const e=p(t,n);e+l>c&&g(),f&&f.style===n?f.text+=t:(m(),f={text:t,style:n}),l+=e}}e+=t.length-1}else{const t=o(e);m(),y.push(t.map((t=>({text:t.token,style:t.style})))),d=!1,e+=t.length-1}else if(w+l>c&&_){if(te(r)){d=!1;continue}g(),f={text:r,style:x},l=b}else if(v&&!h)f&&f.style===x?f.text+=r:(m(),f={text:r,style:x}),l+=b;else{const t=te(r);if(0===l&&t&&!d)continue;f&&f.style===x?f.text+=r:(m(),f={text:r,style:x}),l+=b}}if(m(),a.length>0){const t=a[a.length-1];t.text=ie(t.text),0===t.text.length&&a.pop()}(a.length>0||y.length===r)&&y.push(a)}return y}(h,e,n,i,o,a):h,d=[],f=[],p=[],y=[],m=[];let g=0;const x=s(e._fontString);0===x.fontSize&&(x.fontSize=e.fontSize,x.ascent=e.fontSize);let v="",b=!!e.dropShadow,_=e._stroke?.width||0;for(const t of c){let r=0,o=x.ascent,a=x.descent,l="";for(const e of t){const t=e.style._fontString,h=s(t);t!==v&&(n.font=t,v=t);r+=i(e.text,e.style.letterSpacing,n),o=Math.max(o,h.ascent),a=Math.max(a,h.descent),l+=e.text;const u=e.style._stroke?.width||0;u>_&&(_=u),!b&&e.style.dropShadow&&(b=!0)}0===t.length&&(o=x.ascent,a=x.descent),d.push(r),f.push(o),p.push(a),m.push(l);const h=e.lineHeight||o+a;y.push(h+e.leading),g=Math.max(g,r)}const w=_,S=(r&&"left"!==e.align?Math.max(g,e.wordWrapWidth):g)+w+(e.dropShadow?e.dropShadow.distance:0);let C=0;for(let t=0;t<y.length;t++)C+=y[t];C=Math.max(C,y[0]+w);return{width:S,height:C+(e.dropShadow?e.dropShadow.distance:0),lines:m,lineWidths:d,lineHeight:(e.lineHeight||x.fontSize)+e.leading,maxLineWidth:g,fontProperties:x,runsByLine:c,lineAscents:f,lineDescents:p,lineHeights:y,hasDropShadow:b}}function he(t){const e=[];let r=!1;for(const n of t){const t=se(n.text);let i=!0;for(const s of t){const t=te(s)||Jt(s),o=i&&r&&!t;e.push({token:s,style:n.style,continuesFromPrevious:o}),r=!t,i=!1}}return e}const ue={willReadFrequently:!0};function ce(t,e,r,n,i){let s=r[t];return"number"!=typeof s&&(s=i(t,e,n)+e,r[t]=s),s}const de={willReadFrequently:!0},fe=class t{static get experimentalLetterSpacingSupported(){let e=t._experimentalLetterSpacingSupported;if(void 0===e){const r=pt.e.get().getCanvasRenderingContext2D().prototype;e=t._experimentalLetterSpacingSupported="letterSpacing"in r||"textLetterSpacing"in r}return e}constructor(t,e,r,n,i,s,o,a,l,h){this.text=t,this.style=e,this.width=r,this.height=n,this.lines=i,this.lineWidths=s,this.lineHeight=o,this.maxLineWidth=a,this.fontProperties=l,h&&(this.runsByLine=h.runsByLine,this.lineAscents=h.lineAscents,this.lineDescents=h.lineDescents,this.lineHeights=h.lineHeights,this.hasDropShadow=h.hasDropShadow)}static measureText(e=" ",r,n=t._canvas,i=r.wordWrap){const s=`${e}-${r.styleKey}-wordWrap-${i}`;if(t._measurementCache.has(s))return t._measurementCache.get(s);if(Yt(r)&&Vt(e)){const n=le(e,r,i,t._context,t._measureText,t.measureFont,t.canBreakChars,t.wordWrapSplit),o=new t(e,r,n.width,n.height,n.lines,n.lineWidths,n.lineHeight,n.maxLineWidth,n.fontProperties,{runsByLine:n.runsByLine,lineAscents:n.lineAscents,lineDescents:n.lineDescents,lineHeights:n.lineHeights,hasDropShadow:n.hasDropShadow});return t._measurementCache.set(s,o),o}const o=r._fontString,a=t.measureFont(o);0===a.fontSize&&(a.fontSize=r.fontSize,a.ascent=r.fontSize,a.descent=0);const l=t._context;l.font=o;const h=(i?t._wordWrap(e,r,n):e).split(Qt),u=new Array(h.length);let c=0;for(let e=0;e<h.length;e++){const n=t._measureText(h[e],r.letterSpacing,l);u[e]=n,c=Math.max(c,n)}const d=r._stroke?.width??0,f=r.lineHeight||a.fontSize,p=t._getAlignWidth(c,r,i),y=t._adjustWidthForStyle(p,r),m=Math.max(f,a.fontSize+d)+(h.length-1)*(f+r.leading),g=t._adjustHeightForStyle(m,r),x=new t(e,r,y,g,h,u,f+r.leading,c,a);return t._measurementCache.set(s,x),x}static _adjustWidthForStyle(t,e){let r=t+(e._stroke?.width||0);return e.dropShadow&&(r+=e.dropShadow.distance),r}static _adjustHeightForStyle(t,e){let r=t;return e.dropShadow&&(r+=e.dropShadow.distance),r}static _getAlignWidth(t,e,r){return r&&"left"!==e.align?Math.max(t,e.wordWrapWidth):t}static _measureText(e,r,n){let i=!1;t.experimentalLetterSpacingSupported&&(t.experimentalLetterSpacing?(n.letterSpacing=`${r}px`,n.textLetterSpacing=`${r}px`,i=!0):(n.letterSpacing="0px",n.textLetterSpacing="0px"));const s=n.measureText(e);let o=s.width;const a=-(s.actualBoundingBoxLeft??0);let l=(s.actualBoundingBoxRight??0)-a;if(o>0)if(i)o-=r,l-=r;else{const n=(t.graphemeSegmenter(e).length-1)*r;o+=n,l+=n}return Math.max(o,l)}static _wordWrap(e,r,n=t._canvas){return function(t,e,r,n,i,s,o){const a=r.getContext("2d",ue);a.font=e._fontString;let l=0,h="";const u=[],c=Object.create(null),{letterSpacing:d,whiteSpace:f}=e,p=re(f),y=ne(f);let m=!p;const g=e.wordWrapWidth+d,x=se(t);for(let t=0;t<x.length;t++){let r=x[t];if(Jt(r)){if(!y){u.push(ie(h)),m=!p,h="",l=0;continue}r=" "}if(p){const t=te(r),e=te(h[h.length-1]);if(t&&e)continue}const f=ce(r,d,c,a,n);if(f>g)if(""!==h&&(u.push(ie(h)),h="",l=0),i(r,e.breakWords)){const t=oe(r,e.breakWords,o,s);for(const e of t){const t=ce(e,d,c,a,n);t+l>g&&(u.push(ie(h)),m=!1,h="",l=0),h+=e,l+=t}}else h.length>0&&(u.push(ie(h)),h="",l=0),u.push(ie(r)),m=!1,h="",l=0;else f+l>g&&(m=!1,u.push(ie(h)),h="",l=0),(h.length>0||!te(r)||m)&&(h+=r,l+=f)}const v=ie(h);return v.length>0&&u.push(v),u.join("\n")}(e,r,n,t._measureText,t.canBreakWords,t.canBreakChars,t.wordWrapSplit)}static isBreakingSpace(t,e){return te(t)}static canBreakWords(t,e){return e}static canBreakChars(t,e,r,n,i){return!0}static wordWrapSplit(e){return t.graphemeSegmenter(e)}static measureFont(e){if(t._fonts[e])return t._fonts[e];const r=t._context;r.font=e;const n=r.measureText(t.METRICS_STRING+t.BASELINE_SYMBOL),i=n.actualBoundingBoxAscent??0,s=n.actualBoundingBoxDescent??0,o={ascent:i,descent:s,fontSize:i+s};return t._fonts[e]=o,o}static clearMetrics(e=""){e?delete t._fonts[e]:t._fonts={}}static get _canvas(){if(!t.__canvas){let e;try{const r=new OffscreenCanvas(0,0),n=r.getContext("2d",de);if(n?.measureText)return t.__canvas=r,r;e=pt.e.get().createCanvas()}catch(t){e=pt.e.get().createCanvas()}e.width=e.height=10,t.__canvas=e}return t.__canvas}static get _context(){return t.__context||(t.__context=t._canvas.getContext("2d",de)),t.__context}};fe.METRICS_STRING="|ÉqÅ",fe.BASELINE_SYMBOL="M",fe.BASELINE_MULTIPLIER=1.4,fe.HEIGHT_MULTIPLIER=2,fe.graphemeSegmenter=(()=>{if("function"==typeof Intl?.Segmenter){const t=new Intl.Segmenter;return e=>{const r=t.segment(e),n=[];let i=0;for(const t of r)n[i++]=t.segment;return n}}return t=>[...t]})(),fe.experimentalLetterSpacing=!1,fe._fonts={},fe._measurementCache=function(t=1e3,e=0,r=!1){if(isNaN(t)||t<0)throw new TypeError("Invalid max value");if(isNaN(e)||e<0)throw new TypeError("Invalid ttl value");if("boolean"!=typeof r)throw new TypeError("Invalid resetTtl value");return new Xt(t,e,r)}(1e3);let pe=fe;const ye=["serif","sans-serif","monospace","cursive","fantasy","system-ui"];function me(t){const e="number"==typeof t.fontSize?`${t.fontSize}px`:t.fontSize;let r=t.fontFamily;Array.isArray(t.fontFamily)||(r=t.fontFamily.split(","));for(let t=r.length-1;t>=0;t--){let e=r[t].trim();/([\"\'])[^\'\"]+\1/.test(e)||ye.includes(e)||(e=`"${e}"`),r[t]=e}return`${t.fontStyle} ${t.fontVariant} ${t.fontWeight} ${e} ${r.join(",")}`}var ge=i(9313),xe=i(5589),ve=i(268),be=i(7276),_e=i(2806);const we=1e5;function Se(t,e,r,n=0,i=0,s=0){if(t.texture===xe.g.WHITE&&!t.fill)return Bt.Q.shared.setValue(t.color).setAlpha(t.alpha??1).toHexa();if(!t.fill){const r=e.createPattern(t.texture.source.resource,"repeat"),n=t.matrix.copyTo(ge.u.shared);return n.scale(t.texture.source.pixelWidth,t.texture.source.pixelHeight),r.setTransform(n),r}if(t.fill instanceof _e.m){const r=t.fill,n=e.createPattern(r.texture.source.resource,"repeat"),i=r.transform.copyTo(ge.u.shared);return i.scale(r.texture.source.pixelWidth,r.texture.source.pixelHeight),n.setTransform(i),n}if(t.fill instanceof be._){const o=t.fill,a="linear"===o.type,l="local"===o.textureSpace;let h,u=1,c=1;l&&r&&(u=r.width+n,c=r.height+n);let d=!1;if(a){const{start:t,end:r}=o;h=e.createLinearGradient(t.x*u+i,t.y*c+s,r.x*u+i,r.y*c+s),d=Math.abs(r.x-t.x)<Math.abs(.1*(r.y-t.y))}else{const{center:t,innerRadius:r,outerCenter:n,outerRadius:a}=o;h=e.createRadialGradient(t.x*u+i,t.y*c+s,r*u,n.x*u+i,n.y*c+s,a*u)}if(d&&l&&r){const t=r.lineHeight/c;for(let e=0;e<r.lines.length;e++){const i=(e*r.lineHeight+n/2)/c;o.colorStops.forEach((e=>{let r=i+e.offset*t;r=Math.max(0,Math.min(1,r)),h.addColorStop(Math.floor(r*we)/we,Bt.Q.shared.setValue(e.color).toHex())}))}}else o.colorStops.forEach((t=>{h.addColorStop(t.offset,Bt.Q.shared.setValue(t.color).toHex())}));return h}return(0,ve.R)("FillStyle not recognised",t),"red"}const Ce=new Dt.M;function Me(t){let e=0;for(let r=0;r<t.length;r++)32===t.charCodeAt(r)&&e++;return e}const Te=new class{getCanvasAndContext(t){const{text:e,style:r,resolution:n=1}=t,i=r._getFinalPadding(),s=pe.measureText(e||" ",r),o=Math.ceil(Math.ceil(Math.max(1,s.width)+2*i)*n),a=Math.ceil(Math.ceil(Math.max(1,s.height)+2*i)*n),l=Ft.N.getOptimalCanvasAndContext(o,a);this._renderTextToCanvas(r,i,n,l,s);return{canvasAndContext:l,frame:r.trim?Ut({canvas:l.canvas,width:o,height:a,resolution:1,output:Ce}):Ce.set(0,0,o,a)}}returnCanvasAndContext(t){Ft.N.returnCanvasAndContext(t)}_renderTextToCanvas(t,e,r,n,i){if(i.runsByLine&&i.runsByLine.length>0)return void this._renderTaggedTextToCanvas(i,t,e,r,n);const{canvas:s,context:o}=n,a=me(t),l=i.lines,h=i.lineHeight,u=i.lineWidths,c=i.maxLineWidth,d=i.fontProperties,f=s.height;if(o.resetTransform(),o.scale(r,r),o.textBaseline=t.textBaseline,t._stroke?.width){const e=t._stroke;o.lineWidth=e.width,o.miterLimit=e.miterLimit,o.lineJoin=e.join,o.lineCap=e.cap}let p,y;o.font=a;const m=t.dropShadow?2:1,g=t.wordWrap?Math.max(t.wordWrapWidth,c):c,x=(t._stroke?.width??0)/2;let v=(h-d.fontSize)/2;h-d.fontSize<0&&(v=0);for(let s=0;s<m;++s){const a=t.dropShadow&&0===s,c=a?Math.ceil(Math.max(1,f)+2*e):0,m=c*r;if(a)this._setupDropShadow(o,t,r,m);else{const r=t._gradientBounds,n=t._gradientOffset;if(r){const s={width:r.width,height:r.height,lineHeight:r.height,lines:i.lines};this._setFillAndStrokeStyles(o,t,s,e,x,n?.x??0,n?.y??0)}else n?this._setFillAndStrokeStyles(o,t,i,e,x,n.x,n.y):this._setFillAndStrokeStyles(o,t,i,e,x);o.shadowColor="rgba(0,0,0,0)"}for(let r=0;r<l.length;r++){p=x,y=x+r*h+d.ascent+v,p+=this._getAlignmentOffset(u[r],g,t.align);let i=0;if("justify"===t.align&&t.wordWrap&&r<l.length-1){const t=Me(l[r]);t>0&&(i=(g-u[r])/t)}t._stroke?.width&&this._drawLetterSpacing(l[r],t,n,p+e,y+e-c,!0,i),void 0!==t._fill&&this._drawLetterSpacing(l[r],t,n,p+e,y+e-c,!1,i)}}}_renderTaggedTextToCanvas(t,e,r,n,i){const{canvas:s,context:o}=i,{runsByLine:a,lineWidths:l,maxLineWidth:h,lineAscents:u,lineHeights:c,hasDropShadow:d}=t,f=s.height;o.resetTransform(),o.scale(n,n),o.textBaseline=e.textBaseline;const p=d?2:1,y=e.wordWrap?Math.max(e.wordWrapWidth,h):h;let m=e._stroke?.width??0;for(const t of a)for(const e of t){const t=e.style._stroke?.width??0;t>m&&(m=t)}const g=m/2,x=[];for(let t=0;t<a.length;t++){const e=a[t],r=[];for(const t of e){const e=me(t.style);o.font=e,r.push({width:pe._measureText(t.text,t.style.letterSpacing,o),font:e})}x.push(r)}for(let t=0;t<p;++t){const s=d&&0===t,h=s?Math.ceil(Math.max(1,f)+2*r):0,p=h*n;s||(o.shadowColor="rgba(0,0,0,0)");let m=g;for(let t=0;t<a.length;t++){const d=a[t],f=l[t],v=u[t],b=c[t],_=x[t];let w=g;w+=this._getAlignmentOffset(f,y,e.align);let S=0;if("justify"===e.align&&e.wordWrap&&t<a.length-1){let t=0;for(const e of d)t+=Me(e.text);t>0&&(S=(y-f)/t)}const C=m+v;let M=w+r;for(let t=0;t<d.length;t++){const e=d[t],{width:a,font:l}=_[t];if(o.font=l,o.textBaseline=e.style.textBaseline,e.style._stroke?.width){const t=e.style._stroke;if(o.lineWidth=t.width,o.miterLimit=t.miterLimit,o.lineJoin=t.join,o.lineCap=t.cap,s){if(!e.style.dropShadow){M+=a+Me(e.text)*S;continue}this._setupDropShadow(o,e.style,n,p)}else{const n=pe.measureFont(l),i=e.style.lineHeight||n.fontSize,s={width:a,height:i,lineHeight:i,lines:[e.text]};o.strokeStyle=Se(t,o,s,2*r,M-r,m)}this._drawLetterSpacing(e.text,e.style,i,M,C+r-h,!0,S)}M+=a+Me(e.text)*S}M=w+r;for(let t=0;t<d.length;t++){const e=d[t],{width:a,font:l}=_[t];if(o.font=l,o.textBaseline=e.style.textBaseline,void 0!==e.style._fill){if(s){if(!e.style.dropShadow){M+=a+Me(e.text)*S;continue}this._setupDropShadow(o,e.style,n,p)}else{const t=pe.measureFont(l),n=e.style.lineHeight||t.fontSize,i={width:a,height:n,lineHeight:n,lines:[e.text]};o.fillStyle=Se(e.style._fill,o,i,2*r,M-r,m)}this._drawLetterSpacing(e.text,e.style,i,M,C+r-h,!1,S)}M+=a+Me(e.text)*S}m+=b}}}_setFillAndStrokeStyles(t,e,r,n,i,s=0,o=0){if(t.fillStyle=e._fill?Se(e._fill,t,r,2*n,s,o):null,e._stroke?.width){const a=i+2*n;t.strokeStyle=Se(e._stroke,t,r,a,s,o)}}_setupDropShadow(t,e,r,n){t.fillStyle="black",t.strokeStyle="black";const i=e.dropShadow,s=i.color,o=i.alpha;t.shadowColor=Bt.Q.shared.setValue(s).setAlpha(o).toRgbaString();const a=i.blur*r,l=i.distance*r;t.shadowBlur=a,t.shadowOffsetX=Math.cos(i.angle)*l,t.shadowOffsetY=Math.sin(i.angle)*l+n}_getAlignmentOffset(t,e,r){return"right"===r?e-t:"center"===r?(e-t)/2:0}_drawLetterSpacing(t,e,r,n,i,s=!1,o=0){const{context:a}=r,l=e.letterSpacing;let h=!1;if(pe.experimentalLetterSpacingSupported&&(pe.experimentalLetterSpacing?(a.letterSpacing=`${l}px`,a.textLetterSpacing=`${l}px`,h=!0):(a.letterSpacing="0px",a.textLetterSpacing="0px")),(0===l||h)&&0===o)return void(s?a.strokeText(t,n,i):a.fillText(t,n,i));if(0!==o&&(0===l||h)){const e=t.split(" ");let r=n;const l=a.measureText(" ").width;for(let t=0;t<e.length;t++)s?a.strokeText(e[t],r,i):a.fillText(e[t],r,i),r+=a.measureText(e[t]).width+l+o;return}let u=n;const c=pe.graphemeSegmenter(t);let d=a.measureText(t).width,f=0;for(let t=0;t<c.length;++t){const e=c[t];s?a.strokeText(e,u,i):a.fillText(e,u,i);let r="";for(let e=t+1;e<c.length;++e)r+=c[e];f=a.measureText(r).width,u+=d-f+l," "===e&&(u+=o),d=f}}};var Ae=i(8875),ke=i(133),Pe=i(51),Ee=i(990);const Re=class t extends Ae.A{constructor(e={}){super(),this.uid=(0,ke.L)("textStyle"),this._tick=0,this._cachedFontString=null,function(t){const e=t;if("boolean"==typeof e.dropShadow&&e.dropShadow){const r=Ie.defaultDropShadow;t.dropShadow={alpha:e.dropShadowAlpha??r.alpha,angle:e.dropShadowAngle??r.angle,blur:e.dropShadowBlur??r.blur,color:e.dropShadowColor??r.color,distance:e.dropShadowDistance??r.distance}}if(void 0!==e.strokeThickness){(0,wt.t6)(wt.lj,"strokeThickness is now a part of stroke");const r=e.stroke;let n={};if(Bt.Q.isColorLike(r))n.color=r;else if(r instanceof be._||r instanceof _e.m)n.fill=r;else{if(!Object.hasOwnProperty.call(r,"color")&&!Object.hasOwnProperty.call(r,"fill"))throw new Error("Invalid stroke value.");n=r}t.stroke={...n,width:e.strokeThickness}}if(Array.isArray(e.fillGradientStops)){if((0,wt.t6)(wt.lj,"gradient fill is now a fill pattern: `new FillGradient(...)`"),!Array.isArray(e.fill)||0===e.fill.length)throw new Error("Invalid fill value. Expected an array of colors for gradient fill.");e.fill.length!==e.fillGradientStops.length&&(0,ve.R)("The number of fill colors must match the number of fill gradient stops.");const r=new be._({start:{x:0,y:0},end:{x:0,y:1},textureSpace:"local"}),n=e.fillGradientStops.slice(),i=e.fill.map((t=>Bt.Q.shared.setValue(t).toNumber()));n.forEach(((t,e)=>{r.addColorStop(t,i[e])})),t.fill={fill:r}}}(e);e instanceof t&&(e=e._toObject());const r={...t.defaultTextStyle,...e};for(const t in r){this[t]=r[t]}this._tagStyles=e.tagStyles??void 0,this.update(),this._tick=0}get align(){return this._align}set align(t){this._align!==t&&(this._align=t,this.update())}get breakWords(){return this._breakWords}set breakWords(t){this._breakWords!==t&&(this._breakWords=t,this.update())}get dropShadow(){return this._dropShadow}set dropShadow(e){this._dropShadow!==e&&(this._dropShadow=null!==e&&"object"==typeof e?this._createProxy({...t.defaultDropShadow,...e}):e?this._createProxy({...t.defaultDropShadow}):null,this.update())}get fontFamily(){return this._fontFamily}set fontFamily(t){this._fontFamily!==t&&(this._fontFamily=t,this.update())}get fontSize(){return this._fontSize}set fontSize(t){this._fontSize!==t&&(this._fontSize="string"==typeof t?parseInt(t,10):t,this.update())}get fontStyle(){return this._fontStyle}set fontStyle(t){this._fontStyle!==t&&(this._fontStyle=t.toLowerCase(),this.update())}get fontVariant(){return this._fontVariant}set fontVariant(t){this._fontVariant!==t&&(this._fontVariant=t,this.update())}get fontWeight(){return this._fontWeight}set fontWeight(t){this._fontWeight!==t&&(this._fontWeight=t,this.update())}get leading(){return this._leading}set leading(t){this._leading!==t&&(this._leading=t,this.update())}get letterSpacing(){return this._letterSpacing}set letterSpacing(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.update())}get lineHeight(){return this._lineHeight}set lineHeight(t){this._lineHeight!==t&&(this._lineHeight=t,this.update())}get padding(){return this._padding}set padding(t){this._padding!==t&&(this._padding=t,this.update())}get filters(){return this._filters}set filters(t){this._filters!==t&&(this._filters=Object.freeze(t),this.update())}get trim(){return this._trim}set trim(t){this._trim!==t&&(this._trim=t,this.update())}get textBaseline(){return this._textBaseline}set textBaseline(t){this._textBaseline!==t&&(this._textBaseline=t,this.update())}get whiteSpace(){return this._whiteSpace}set whiteSpace(t){this._whiteSpace!==t&&(this._whiteSpace=t,this.update())}get wordWrap(){return this._wordWrap}set wordWrap(t){this._wordWrap!==t&&(this._wordWrap=t,this.update())}get wordWrapWidth(){return this._wordWrapWidth}set wordWrapWidth(t){this._wordWrapWidth!==t&&(this._wordWrapWidth=t,this.update())}get fill(){return this._originalFill}set fill(t){t!==this._originalFill&&(this._originalFill=t,this._isFillStyle(t)&&(this._originalFill=this._createProxy({...Pe.T.defaultFillStyle,...t},(()=>{this._fill=(0,Ee.w)({...this._originalFill},Pe.T.defaultFillStyle)}))),this._fill=(0,Ee.w)(0===t?"black":t,Pe.T.defaultFillStyle),this.update())}get stroke(){return this._originalStroke}set stroke(t){t!==this._originalStroke&&(this._originalStroke=t,this._isFillStyle(t)&&(this._originalStroke=this._createProxy({...Pe.T.defaultStrokeStyle,...t},(()=>{this._stroke=(0,Ee.T)({...this._originalStroke},Pe.T.defaultStrokeStyle)}))),this._stroke=(0,Ee.T)(t,Pe.T.defaultStrokeStyle),this.update())}get tagStyles(){return this._tagStyles}set tagStyles(t){this._tagStyles!==t&&(this._tagStyles=t??void 0,this.update())}update(){this._tick++,this._cachedFontString=null,this.emit("update",this)}reset(){const e=t.defaultTextStyle;for(const t in e)this[t]=e[t]}assign(t){for(const e in t){this[e]=t[e]}return this}get styleKey(){return`${this.uid}-${this._tick}`}get _fontString(){return null===this._cachedFontString&&(this._cachedFontString=me(this)),this._cachedFontString}_toObject(){return{align:this.align,breakWords:this.breakWords,dropShadow:this._dropShadow?{...this._dropShadow}:null,fill:this._fill?{...this._fill}:void 0,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?{...this._stroke}:void 0,textBaseline:this.textBaseline,trim:this.trim,whiteSpace:this.whiteSpace,wordWrap:this.wordWrap,wordWrapWidth:this.wordWrapWidth,filters:this._filters?[...this._filters]:void 0,tagStyles:this._tagStyles?{...this._tagStyles}:void 0}}clone(){return new t(this._toObject())}_getFinalPadding(){let t=0;if(this._filters)for(let e=0;e<this._filters.length;e++)t+=this._filters[e].padding;return Math.max(this._padding,t)}destroy(t=!1){this.removeAllListeners();if("boolean"==typeof t?t:t?.texture){const e="boolean"==typeof t?t:t?.textureSource;this._fill?.texture&&this._fill.texture.destroy(e),this._originalFill?.texture&&this._originalFill.texture.destroy(e),this._stroke?.texture&&this._stroke.texture.destroy(e),this._originalStroke?.texture&&this._originalStroke.texture.destroy(e)}this._fill=null,this._stroke=null,this.dropShadow=null,this._originalStroke=null,this._originalFill=null}_createProxy(t,e){return new Proxy(t,{set:(t,r,n)=>(t[r]===n||(t[r]=n,e?.(r,n),this.update()),!0)})}_isFillStyle(t){return null!==(t??null)&&!(Bt.Q.isColorLike(t)||t instanceof be._||t instanceof _e.m)}};Re.defaultDropShadow={alpha:1,angle:Math.PI/6,blur:0,color:"black",distance:5},Re.defaultTextStyle={align:"left",breakWords:!1,dropShadow:null,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",leading:0,letterSpacing:0,lineHeight:0,padding:0,stroke:null,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100};let Ie=Re;var Oe=i(4334),Le=i(2048);var Be=i(8422);class De extends Be.K{}class Fe{constructor(t){this._renderer=t,t.runners.resolutionChange.add(this),this._managedTexts=new Oe.s({renderer:t,type:"renderable",onUnload:this.onTextUnload.bind(this),name:"canvasText"})}resolutionChange(){for(const t in this._managedTexts.items){const e=this._managedTexts.items[t];e?._autoResolution&&e.onViewUpdate()}}validateRenderable(t){const e=this._getGpuText(t),r=t.styleKey;return e.currentKey!==r||t._didTextUpdate}addRenderable(t,e){const r=this._getGpuText(t);if(t._didTextUpdate){const e=t._autoResolution?this._renderer.resolution:t.resolution;r.currentKey===t.styleKey&&t._resolution===e||this._updateGpuText(t),t._didTextUpdate=!1,function(t,e){const{texture:r,bounds:n}=t,i=e._style._getFinalPadding();(0,Le.y)(n,e._anchor,r);const s=e._anchor._x*i*2,o=e._anchor._y*i*2;n.minX-=i-s,n.minY-=i-o,n.maxX-=i-s,n.maxY-=i-o}(r,t)}this._renderer.renderPipes.batch.addToBatch(r,e)}updateRenderable(t){const e=this._getGpuText(t);e._batcher.updateElement(e)}_updateGpuText(t){const e=this._getGpuText(t);e.texture&&this._renderer.canvasText.decreaseReferenceCount(e.currentKey),t._resolution=t._autoResolution?this._renderer.resolution:t.resolution,e.texture=this._renderer.canvasText.getManagedTexture(t),e.currentKey=t.styleKey}_getGpuText(t){return t._gpuData[this._renderer.uid]||this.initGpuText(t)}initGpuText(t){const e=new De;return e.currentKey="--",e.renderable=t,e.transform=t.groupTransform,e.bounds={minX:0,maxX:1,minY:0,maxY:0},e.roundPixels=this._renderer._roundPixels|t._roundPixels,t._gpuData[this._renderer.uid]=e,this._managedTexts.add(t),e}onTextUnload(t){const e=t._gpuData[this._renderer.uid];if(!e)return;const{canvasText:r}=this._renderer;r.getReferenceCount(e.currentKey)>0?r.decreaseReferenceCount(e.currentKey):e.texture&&r.returnTexture(e.texture)}destroy(){this._managedTexts.destroy(),this._renderer=null}}Fe.extension={type:[ct.Ag.WebGLPipes,ct.Ag.WebGPUPipes,ct.Ag.CanvasPipes],name:"text"};var je=i(2437);const Ge=new(i(9636).c);class ze{constructor(t,e){this._activeTextures={},this._renderer=t,this._retainCanvasContext=e}getTexture(t,e,r,n){"string"==typeof t&&((0,wt.t6)("8.0.0","CanvasTextSystem.getTexture: Use object TextOptions instead of separate arguments"),t={text:t,style:r,resolution:e}),t.style instanceof Ie||(t.style=new Ie(t.style)),t.textureStyle instanceof Rt.n||(t.textureStyle=new Rt.n(t.textureStyle)),"string"!=typeof t.text&&(t.text=t.text.toString());const{text:i,style:s,textureStyle:o,autoGenerateMipmaps:a}=t,l=t.resolution??this._renderer.resolution,{frame:h,canvasAndContext:u}=Te.getCanvasAndContext({text:i,style:s,resolution:l}),c=function(t,e,r,n,i=!1){const s=Ge;s.minX=0,s.minY=0,s.maxX=t.width/n|0,s.maxY=t.height/n|0;const o=je.W.getOptimalTexture(s.width,s.height,n,!1,i);return o.source.uploadMethodId="image",o.source.resource=t,o.source.alphaMode="premultiply-alpha-on-upload",o.frame.width=e/n,o.frame.height=r/n,o.source.emit("update",o.source),o.updateUvs(),o}(u.canvas,h.width,h.height,l,a);if(o&&(c.source.style=o),s.trim&&(h.pad(s.padding),c.frame.copyFrom(h),c.frame.scale(1/l),c.updateUvs()),s.filters){const t=this._applyFilters(c,s.filters);return this.returnTexture(c),Te.returnCanvasAndContext(u),t}return this._renderer.texture.initSource(c._source),this._retainCanvasContext||Te.returnCanvasAndContext(u),c}returnTexture(t){const e=t.source,r=e.resource;if(this._retainCanvasContext&&r?.getContext){const t=r.getContext("2d");t&&Te.returnCanvasAndContext({canvas:r,context:t})}e.resource=null,e.uploadMethodId="unknown",e.alphaMode="no-premultiply-alpha",je.W.returnTexture(t,!0)}renderTextToCanvas(){(0,wt.t6)("8.10.0","CanvasTextSystem.renderTextToCanvas: no longer supported, use CanvasTextSystem.getTexture instead")}getManagedTexture(t){t._resolution=t._autoResolution?this._renderer.resolution:t.resolution;const e=t.styleKey;if(this._activeTextures[e])return this._increaseReferenceCount(e),this._activeTextures[e].texture;const r=this.getTexture({text:t.text,style:t.style,resolution:t._resolution,textureStyle:t.textureStyle,autoGenerateMipmaps:t.autoGenerateMipmaps});return this._activeTextures[e]={texture:r,usageCount:1},r}decreaseReferenceCount(t){const e=this._activeTextures[t];e&&(e.usageCount--,0===e.usageCount&&(this.returnTexture(e.texture),this._activeTextures[t]=null))}getReferenceCount(t){return this._activeTextures[t]?.usageCount??0}_increaseReferenceCount(t){this._activeTextures[t].usageCount++}_applyFilters(t,e){const r=this._renderer.renderTarget.renderTarget,n=this._renderer.filter.generateFilteredTexture({texture:t,filters:e});return this._renderer.renderTarget.bind(r,!1),n}destroy(){this._renderer=null;for(const t in this._activeTextures)this._activeTextures[t]&&this.returnTexture(this._activeTextures[t].texture);this._activeTextures=null}}class Ne extends ze{constructor(t){super(t,!0)}}Ne.extension={type:[ct.Ag.CanvasSystem],name:"canvasText"};class We extends ze{constructor(t){super(t,!1)}}We.extension={type:[ct.Ag.WebGLSystem,ct.Ag.WebGPUSystem],name:"canvasText"},ct.XO.add(Ne),ct.XO.add(We),ct.XO.add(Fe);class Ue extends Lt{constructor(...t){const e=function(t,e){let r=t[0]??{};return("string"==typeof r||t[1])&&((0,wt.t6)(wt.lj,`use new ${e}({ text: "hi!", style }) instead`),r={text:r,style:t[1]}),r}(t,"Text");super(e,Ie),this.renderPipeId="text",e.textureStyle&&(this.textureStyle=e.textureStyle instanceof Rt.n?e.textureStyle:new Rt.n(e.textureStyle)),this.autoGenerateMipmaps=e.autoGenerateMipmaps??Et.v.defaultOptions.autoGenerateMipmaps}updateBounds(){const t=this._bounds,e=this._anchor;let r=0,n=0;if(this._style.trim){const{frame:t,canvasAndContext:e}=Te.getCanvasAndContext({text:this.text,style:this._style,resolution:1});Te.returnCanvasAndContext(e),r=t.width,n=t.height}else{const t=pe.measureText(this._text,this._style);r=t.width,n=t.height}t.minX=-e._x*r,t.maxX=t.minX+r,t.minY=-e._y*n,t.maxY=t.minY+n}}function Xe(t){return Xe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xe(t)}function Ye(t){return function(t){if(Array.isArray(t))return Ve(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return Ve(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ve(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ve(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function He(){He=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},s="function"==typeof Symbol?Symbol:{},o=s.iterator||"@@iterator",a=s.asyncIterator||"@@asyncIterator",l=s.toStringTag||"@@toStringTag";function h(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(t){h=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var s=e&&e.prototype instanceof g?e:g,o=Object.create(s.prototype),a=new E(n||[]);return i(o,"_invoke",{value:T(t,r,a)}),o}function c(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var d="suspendedStart",f="suspendedYield",p="executing",y="completed",m={};function g(){}function x(){}function v(){}var b={};h(b,o,(function(){return this}));var _=Object.getPrototypeOf,w=_&&_(_(R([])));w&&w!==r&&n.call(w,o)&&(b=w);var S=v.prototype=g.prototype=Object.create(b);function C(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function M(t,e){function r(i,s,o,a){var l=c(t[i],t,s);if("throw"!==l.type){var h=l.arg,u=h.value;return u&&"object"==Xe(u)&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,o,a)}),(function(t){r("throw",t,o,a)})):e.resolve(u).then((function(t){h.value=t,o(h)}),(function(t){return r("throw",t,o,a)}))}a(l.arg)}var s;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return s=s?s.then(i,i):i()}})}function T(e,r,n){var i=d;return function(s,o){if(i===p)throw Error("Generator is already running");if(i===y){if("throw"===s)throw o;return{value:t,done:!0}}for(n.method=s,n.arg=o;;){var a=n.delegate;if(a){var l=A(a,n);if(l){if(l===m)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===d)throw i=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=p;var h=c(e,r,n);if("normal"===h.type){if(i=n.done?y:f,h.arg===m)continue;return{value:h.arg,done:n.done}}"throw"===h.type&&(i=y,n.method="throw",n.arg=h.arg)}}}function A(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,A(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var s=c(i,e.iterator,r.arg);if("throw"===s.type)return r.method="throw",r.arg=s.arg,r.delegate=null,m;var o=s.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function R(e){if(e||""===e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,s=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return s.next=s}}throw new TypeError(Xe(e)+" is not iterable")}return x.prototype=v,i(S,"constructor",{value:v,configurable:!0}),i(v,"constructor",{value:x,configurable:!0}),x.displayName=h(v,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===x||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,h(t,l,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},C(M.prototype),h(M.prototype,a,(function(){return this})),e.AsyncIterator=M,e.async=function(t,r,n,i,s){void 0===s&&(s=Promise);var o=new M(u(t,r,n,i),s);return e.isGeneratorFunction(r)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},C(S),h(S,l,"Generator"),h(S,o,(function(){return this})),h(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=R,E.prototype={constructor:E,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return a.type="throw",a.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var s=this.tryEntries.length-1;s>=0;--s){var o=this.tryEntries[s],a=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var l=n.call(o,"catchLoc"),h=n.call(o,"finallyLoc");if(l&&h){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!h)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var s=i;break}}s&&("break"===t||"continue"===t)&&s.tryLoc<=e&&e<=s.finallyLoc&&(s=null);var o=s?s.completion:{};return o.type=t,o.arg=e,s?(this.method="next",this.next=s.finallyLoc,m):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;P(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:R(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function $e(t,e,r,n,i,s,o){try{var a=t[s](o),l=a.value}catch(t){return void r(t)}a.done?e(l):Promise.resolve(l).then(n,i)}function qe(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var s=t.apply(e,r);function o(t){$e(s,n,i,o,a,"next",t)}function a(t){$e(s,n,i,o,a,"throw",t)}o(void 0)}))}}function Ke(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Ze(n.key),n)}}function Ze(t){var e=function(t,e){if("object"!=Xe(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Xe(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Xe(e)?e:e+""}ct.XO.add(dt,ft);var Qe=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.container=e,this.selectedNodes=new Set,this.isSelecting=!1,this.selectionStart=null,this.selectionBox=null,this.isCtrlPressed=!1,this.mode=null,this.graphicsMap=new Map,this.dragging=!1,this.lastPos=null,this.pointers=new Map,this.lastDist=null,this.minScale=.1,this.maxScale=10,this.onBackgroundPointerDown=null,this.activeDrag=null,this._initKeyboard()}return e=t,r=[{key:"_initPixi",value:(s=qe(He().mark((function t(){var e=this;return He().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.app=new kt,this.app.stage.eventMode="static",t.next=4,this.app.init({resizeTo:this.container,background:1973790});case 4:this.container.appendChild(this.app.canvas),this._initInfoWindow(),this.world=new bt.mc,this.app.stage.addChild(this.world),this._initResizeObserver(),this._initPointers(),this._initWheelZoom(),this._initPinchZoom(),this._onGlobalMove=function(t){var r=e.activeDrag;if(r&&r.dragData){var n=r.nodeRef,i=e.app.canvas.getBoundingClientRect(),s=t.clientX-i.left,o=t.clientY-i.top,a=e.screenToWorld(s,o);n.x=a.x,n.y=a.y}},this._onGlobalUp=function(t){var r=e.activeDrag;if(r){var n,i=r.nodeRef;r._dragging||(r._ctrlOnDown?e.selectedNodes.has(i)?e.selectedNodes.delete(i):e.selectedNodes.add(i):(e.selectedNodes.clear(),e.selectedNodes.add(i)),null===(n=e.onSelectionChange)||void 0===n||n.call(e,Array.from(e.selectedNodes))),r.dragData=null,r._ctrlOnDown=!1,r._dragging=!1,e.lockPan=!1,e.activeDrag=null}},window.addEventListener("pointermove",this._onGlobalMove),window.addEventListener("pointerup",this._onGlobalUp);case 16:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"_initKeyboard",value:function(){var t=this;window.addEventListener("keydown",(function(e){(e.ctrlKey||e.metaKey)&&(t.isCtrlPressed=!0)})),window.addEventListener("keyup",(function(e){e.ctrlKey||e.metaKey||(t.isCtrlPressed=!1)}))}},{key:"_initResizeObserver",value:function(){var t=this;this.resizeObserver=new ResizeObserver((function(){t.width=t.container.clientWidth,t.height=t.container.clientHeight;var e=t.screenToWorld(t.width/2,t.height/2);t.app.renderer.resize(t.width,t.height),t.center(e.x,e.y)})),this.resizeObserver.observe(this.container)}},{key:"_createOrUpdateLabel",value:function(t,e){var r=t.id+"_label",n=this.graphicsMap.get(r),i=t.label||"attractor";if(!n){var s=new Ie({fill:"#ffffff",fontSize:12,align:"center",wordWrap:!0,wordWrapWidth:1.6*e});(n=new Ue({text:i,style:s})).anchor.set(.5),n.eventMode="none",this.world.addChild(n),this.graphicsMap.set(r,n)}return n.text!==i&&(n.text=i),n.x=t.x,n.y=t.y,n}},{key:"_createSelectionBox",value:function(){var t=new Pt.A;return this.world.addChild(t),t}},{key:"getWorldBounds",value:function(){var t=this.app.canvas,e=this.screenToWorld(0,0),r=this.screenToWorld(t.width,t.height);return{minX:e.x,minY:e.y,maxX:r.x,maxY:r.y}}},{key:"add",value:function(t){this.world.addChild(t)}},{key:"screenToWorld",value:function(t,e){return{x:(t-this.world.x)/this.world.scale.x,y:(e-this.world.y)/this.world.scale.y}}},{key:"center",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=this.app.screen.width,n=this.app.screen.height;this.world.x=r/2-t*this.world.scale.x,this.world.y=n/2-e*this.world.scale.y}},{key:"_initPointers",value:function(){var t=this,e=this.app.canvas,r=function(e){t.pointers.delete(e.pointerId),t.pointers.size<2&&(t.lastDist=null),0===t.pointers.size&&(t.dragging=!1,t.mode=null)};e.addEventListener("pointerdown",(function(r){var n;if(t.pointers.set(r.pointerId,r),r.target===e){null===(n=t.onBackgroundPointerDown)||void 0===n||n.call(t);var i=t.screenToWorld(r.offsetX,r.offsetY);t.isCtrlPressed?(t.mode="select",t.isSelecting=!0,t.selectionStart=i,t.selectionBox=t._createSelectionBox()):(t.mode="pan",t.dragging=!0,t.lastPos={x:r.clientX,y:r.clientY})}})),e.addEventListener("pointermove",(function(e){if("select"===t.mode&&t.isSelecting){var r=t.screenToWorld(e.offsetX,e.offsetY),n=Math.min(t.selectionStart.x,r.x),i=Math.min(t.selectionStart.y,r.y),s=Math.abs(r.x-t.selectionStart.x),o=Math.abs(r.y-t.selectionStart.y);t.selectionBox.clear().rect(n,i,s,o).stroke({width:1,color:16777215}).fill({color:16777215,alpha:.1})}else if("pan"===t.mode&&t.dragging&&1===t.pointers.size&&!t.lockPan){var a=e.clientX-t.lastPos.x,l=e.clientY-t.lastPos.y;t.world.x+=a,t.world.y+=l,t.lastPos={x:e.clientX,y:e.clientY}}})),e.addEventListener("pointerup",(function(e){if("select"===t.mode&&t.isSelecting){var n,i=t.screenToWorld(e.offsetX,e.offsetY),s=Math.min(t.selectionStart.x,i.x),o=Math.max(t.selectionStart.x,i.x),a=Math.min(t.selectionStart.y,i.y),l=Math.max(t.selectionStart.y,i.y);t.isCtrlPressed||t.selectedNodes.clear(),t.graphicsMap.forEach((function(e){var r=e.nodeRef;if(r){var n=r.radius||20;r.x+n>=s&&r.x-n<=o&&r.y+n>=a&&r.y-n<=l&&t.selectedNodes.add(r)}})),null===(n=t.onSelectionChange)||void 0===n||n.call(t,Array.from(t.selectedNodes)),t.world.removeChild(t.selectionBox),t.selectionBox.destroy(),t.selectionBox=null,t.isSelecting=!1}"pan"===t.mode&&(t.dragging=!1),t.mode=null,r(e)})),e.addEventListener("pointerupoutside",r),e.addEventListener("pointercancel",r),e.addEventListener("pointerleave",r)}},{key:"_initWheelZoom",value:function(){var t=this,e=this.app.canvas;e.addEventListener("wheel",(function(r){r.preventDefault();var n=e.getBoundingClientRect(),i=r.clientX-n.left,s=r.clientY-n.top,o=r.deltaY>0?1/1.1:1.1,a=t.screenToWorld(i,s);t.world.scale.x*=o,t.world.scale.y*=o,t.world.scale.x=Math.max(t.minScale,Math.min(t.maxScale,t.world.scale.x)),t.world.scale.y=Math.max(t.minScale,Math.min(t.maxScale,t.world.scale.y)),t.world.x=i-a.x*t.world.scale.x,t.world.y=s-a.y*t.world.scale.y}),{passive:!1})}},{key:"_initPinchZoom",value:function(){var t=this;this.app.canvas.addEventListener("pointermove",(function(e){if(t.pointers.has(e.pointerId)&&(t.pointers.set(e.pointerId,e),2===t.pointers.size)){var r=Array.from(t.pointers.values()),n=r[0],i=r[1],s=(n.clientX+i.clientX)/2,o=(n.clientY+i.clientY)/2,a=n.clientX-i.clientX,l=n.clientY-i.clientY,h=Math.sqrt(a*a+l*l);if(!t.lastDist)return void(t.lastDist=h);var u=h/t.lastDist,c=t.screenToWorld(s,o);t.world.scale.x*=u,t.world.scale.y*=u,t.world.scale.x=Math.max(t.minScale,Math.min(t.maxScale,t.world.scale.x)),t.world.scale.y=Math.max(t.minScale,Math.min(t.maxScale,t.world.scale.y)),t.world.x=s-c.x*t.world.scale.x,t.world.y=o-c.y*t.world.scale.y,t.lastDist=h}}))}},{key:"createCircle",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.x,r=void 0===e?0:e,n=t.y,i=void 0===n?0:n,s=t.radius,o=void 0===s?50:s,a=t.color,l=void 0===a?16711680:a,h=t.node,u=void 0===h?null:h,c=(new Pt.A).circle(0,0,o).fill(l);return c.eventMode="static",c.cursor="pointer",c.nodeRef=u,c.x=r,c.y=i,this.world.addChild(c),c}},{key:"renderGraph",value:function(t){var e=this,r=new Set(t.getNodes().map((function(t){return t.id})));this.graphicsMap.forEach((function(t,n){var i=n.replace("_label","").replace("_axis","");r.has(i)||(t.parent&&t.parent.removeChild(t),t.destroy(),e.graphicsMap.delete(n))})),t.getNodes().forEach((function(t){var r=e.graphicsMap.get(t.id);if("vector"===t.type){var n=t.id+"_axis",i=e.graphicsMap.get(n),s=t.direction.x*t.length,o=t.direction.y*t.length,a=Math.atan2(o,s),l=Math.sqrt(s*s+o*o);return i||(i=new Pt.A,e.world.addChild(i),e.graphicsMap.set(n,i),i.eventMode="static",i.cursor="pointer",i.nodeRef=t,e._bindNodeEvents(i)),i.clear().rect(-l/2,-5,l,10).fill(16755200),i.x=t.x,i.y=t.y,void(i.rotation=a)}var h="planet"===t.type?40:10;r||(r=e.createCircle({x:t.x,y:t.y,radius:h,color:"planet"===t.type?16763904:52479,node:t}),e._bindNodeEvents(r),e.graphicsMap.set(t.id,r)),r.x=t.x,r.y=t.y,"planet"===t.type&&e._createOrUpdateLabel(t,h);var u=e.selectedNodes.has(t);r.tint=u?16729156:"planet"===t.type?16763904:52479}))}},{key:"toWorld",value:function(t,e){return this.screenToWorld(t,e)}},{key:"_bindNodeEvents",value:function(t){var e=this,r=!1,n=null;t.on("rightclick",(function(r){var n;console.log("click derecho");var i=t.nodeRef,s=(e.app.canvas.getBoundingClientRect(),r.global.x),o=r.global.y,a=e.screenToWorld(s,o);null===(n=e.onNodeRightClick)||void 0===n||n.call(e,{node:i,global:{x:s,y:o},world:a})})),t.on("pointerdown",(function(r){var i=2===r.data.button;i||r.stopPropagation(),i||(n={x:r.global.x,y:r.global.y},t.dragData=r.data,e.activeDrag=t,t._ctrlOnDown=e.isCtrlPressed,t._dragging=!1)})),t.on("pointermove",(function(i){if(n){i.stopPropagation();var s=i.global.x-n.x,o=i.global.y-n.y,a=Math.sqrt(s*s+o*o);if(!r&&a>5&&(r=!0,e.lockPan=!0),r){var l=t.nodeRef,h=t.dragData.getLocalPosition(e.world);l.x=h.x,l.y=h.y}}}));var i=function(i){var s;if(n){i.stopPropagation();var o=t.nodeRef;if(null!==(s=t._captureTarget)&&void 0!==s&&s.releasePointerCapture)try{t._captureTarget.releasePointerCapture(t._pointerId)}catch(t){}if(t._captureTarget=null,t._pointerId=null,!r){var a,l,h=t._ctrlOnDown;null===(a=e.onNodeClick)||void 0===a||a.call(e,{node:o,global:{x:i.global.x,y:i.global.y},world:e.screenToWorld(i.global.x,i.global.y)}),h?e.selectedNodes.has(o)?e.selectedNodes.delete(o):e.selectedNodes.add(o):(e.selectedNodes.clear(),e.selectedNodes.add(o)),null===(l=e.onSelectionChange)||void 0===l||l.call(e,Array.from(e.selectedNodes))}r=!1,n=null,e.lockPan=!1,t.dragData=null,t._ctrlOnDown=!1,e.activeDrag===t&&(e.activeDrag=null)}};t.on("pointerup",i),t.on("pointerupoutside",i)}},{key:"_initInfoWindow",value:function(){var t=this,e=this.container,r=document.createElement("div");r.className="info-window",r.style.position="absolute",r.style.top="0",r.style.right="0",r.style.width="250px",r.style.height="100%",r.style.background="rgba(30, 30, 30, 0.85)",r.style.color="#fff",r.style.padding="12px",r.style.boxSizing="border-box",r.style.backdropFilter="blur(6px)",r.style.borderLeft="1px solid rgba(255,255,255,0.1)",r.style.display="none",r.style.zIndex=999,r.style.position="absolute";var n=document.createElement("div");n.textContent="✕",n.style.position="absolute",n.style.top="8px",n.style.right="10px",n.style.cursor="pointer",n.style.fontSize="14px",n.style.opacity="0.7",n.style.padding="2px 6px",n.style.borderRadius="4px",n.style.transition="all 0.15s",n.addEventListener("mouseenter",(function(){n.style.background="#444",n.style.opacity="1"})),n.addEventListener("mouseleave",(function(){n.style.background="transparent",n.style.opacity="0.7"})),n.addEventListener("click",(function(){t.hideInfoWindow()})),r.appendChild(n);var i=document.createElement("div");i.style.marginTop="24px",r.appendChild(i),this._infoWindow=r,this._infoContent=i,"static"===window.getComputedStyle(e).position&&(e.style.position="relative"),e.appendChild(r)}},{key:"showInfoWindow",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this._infoWindow&&(this._infoWindow.style.display="block",t&&(this._infoContent.innerHTML=t))}},{key:"showInfoWindowWithDrag",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if(this._infoWindow){this._infoWindow.style.display="block",this._infoContent.innerHTML="";var r=document.createElement("div");r.textContent="⠿ Drag selection",r.draggable=!0,r.style.cursor="grab",r.style.padding="6px 8px",r.style.marginBottom="8px",r.style.background="#3a3a3a",r.style.borderRadius="6px",r.style.fontSize="12px",r.style.textAlign="center",r.addEventListener("dragstart",(function(e){var n={type:"graph-nodes",data:Array.from(t.getSelectedMoons()).map((function(t){return t.data}))},i=JSON.stringify(n);e.dataTransfer.setData("application/json",i),e.dataTransfer.setData("text/plain",i),r.style.opacity="0.5"})),r.addEventListener("dragend",(function(){r.style.opacity="1"})),this._infoContent.appendChild(r);var n=document.createElement("div");n.innerHTML=e,this._infoContent.appendChild(n)}}},{key:"hideInfoWindow",value:function(){this._infoWindow&&(this._infoWindow.style.display="none")}},{key:"getInfoWindow",value:function(){return this._infoWindow}},{key:"clearInfoWindow",value:function(){this._infoContent&&(this._infoContent.innerHTML="")}},{key:"getSelectedMoons",value:function(){return console.log("nodos seleccionados ",this.selectedNodes),new Set(Ye(this.selectedNodes).filter((function(t){return"moon"===t.type})))}}],n=[{key:"create",value:(i=qe(He().mark((function e(r){var n;return He().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=new t(r),e.next=3,n._initPixi();case 3:return e.abrupt("return",n);case 4:case"end":return e.stop()}}),e)}))),function(t){return i.apply(this,arguments)})}],r&&Ke(e.prototype,r),n&&Ke(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n,i,s}();function Je(t){return Je="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Je(t)}function tr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,er(n.key),n)}}function er(t){var e=function(t,e){if("object"!=Je(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Je(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Je(e)?e:e+""}var rr=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.nodes=new Map,this.edges=[]},(e=[{key:"addNode",value:function(t){this.nodes.set(t.id,{id:t.id,type:t.type||"moon",x:t.x||0,y:t.y||0,vx:0,vy:0,data:t.data||{},rule:t.rule||null})}},{key:"addMoon",value:function(t){var e=t.id,r=t.x,n=t.y,i=t.data;this.nodes.set(e,{id:e,type:"moon",x:r,y:n,vx:0,vy:0,data:i})}},{key:"addPlanet",value:function(t){var e=t.id,r=t.x,n=t.y,i=t.rule,s=t.scalarField,o=t.label;this.nodes.set(e,{id:e,type:"planet",x:r,y:n,vx:0,vy:0,rule:i,scalarField:s,label:o})}},{key:"addVector",value:function(t){var e=t.id,r=t.x,n=t.y,i=t.direction,s=t.length,o=t.scalarField,a=t.rule,l=Math.sqrt(Math.pow(i.x,2)+Math.pow(i.y,2))||1,h={x:i.x/l,y:i.y/l};this.nodes.set(e,{id:e,type:"vector",vector:!0,x:r,y:n,direction:h,length:s||200,scalarField:o,rule:a,vx:0,vy:0})}},{key:"addEdge",value:function(t,e){this.edges.push({source:t,target:e})}},{key:"getNode",value:function(t){return this.nodes.get(t)}},{key:"getNodes",value:function(){return Array.from(this.nodes.values())}},{key:"deleteNode",value:function(t){this.nodes.delete(t),this.edges=this.edges.filter((function(e){return e.source!==t&&e.target!==t}))}}])&&tr(t.prototype,e),r&&tr(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function nr(t){return nr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nr(t)}function ir(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,s,o,a=[],l=!0,h=!1;try{if(s=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=s.call(r)).done)&&(a.push(n.value),a.length!==e);l=!0);}catch(t){h=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(h)throw i}}return a}}(t,e)||function(t,e){if(t){if("string"==typeof t)return sr(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?sr(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function sr(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function or(){or=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},s="function"==typeof Symbol?Symbol:{},o=s.iterator||"@@iterator",a=s.asyncIterator||"@@asyncIterator",l=s.toStringTag||"@@toStringTag";function h(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(t){h=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var s=e&&e.prototype instanceof g?e:g,o=Object.create(s.prototype),a=new E(n||[]);return i(o,"_invoke",{value:T(t,r,a)}),o}function c(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var d="suspendedStart",f="suspendedYield",p="executing",y="completed",m={};function g(){}function x(){}function v(){}var b={};h(b,o,(function(){return this}));var _=Object.getPrototypeOf,w=_&&_(_(R([])));w&&w!==r&&n.call(w,o)&&(b=w);var S=v.prototype=g.prototype=Object.create(b);function C(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function M(t,e){function r(i,s,o,a){var l=c(t[i],t,s);if("throw"!==l.type){var h=l.arg,u=h.value;return u&&"object"==nr(u)&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,o,a)}),(function(t){r("throw",t,o,a)})):e.resolve(u).then((function(t){h.value=t,o(h)}),(function(t){return r("throw",t,o,a)}))}a(l.arg)}var s;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return s=s?s.then(i,i):i()}})}function T(e,r,n){var i=d;return function(s,o){if(i===p)throw Error("Generator is already running");if(i===y){if("throw"===s)throw o;return{value:t,done:!0}}for(n.method=s,n.arg=o;;){var a=n.delegate;if(a){var l=A(a,n);if(l){if(l===m)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===d)throw i=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=p;var h=c(e,r,n);if("normal"===h.type){if(i=n.done?y:f,h.arg===m)continue;return{value:h.arg,done:n.done}}"throw"===h.type&&(i=y,n.method="throw",n.arg=h.arg)}}}function A(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,A(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var s=c(i,e.iterator,r.arg);if("throw"===s.type)return r.method="throw",r.arg=s.arg,r.delegate=null,m;var o=s.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function R(e){if(e||""===e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,s=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return s.next=s}}throw new TypeError(nr(e)+" is not iterable")}return x.prototype=v,i(S,"constructor",{value:v,configurable:!0}),i(v,"constructor",{value:x,configurable:!0}),x.displayName=h(v,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===x||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,h(t,l,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},C(M.prototype),h(M.prototype,a,(function(){return this})),e.AsyncIterator=M,e.async=function(t,r,n,i,s){void 0===s&&(s=Promise);var o=new M(u(t,r,n,i),s);return e.isGeneratorFunction(r)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},C(S),h(S,l,"Generator"),h(S,o,(function(){return this})),h(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=R,E.prototype={constructor:E,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return a.type="throw",a.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var s=this.tryEntries.length-1;s>=0;--s){var o=this.tryEntries[s],a=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var l=n.call(o,"catchLoc"),h=n.call(o,"finallyLoc");if(l&&h){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!h)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var s=i;break}}s&&("break"===t||"continue"===t)&&s.tryLoc<=e&&e<=s.finallyLoc&&(s=null);var o=s?s.completion:{};return o.type=t,o.arg=e,s?(this.method="next",this.next=s.finallyLoc,m):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;P(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:R(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function ar(t,e,r,n,i,s,o){try{var a=t[s](o),l=a.value}catch(t){return void r(t)}a.done?e(l):Promise.resolve(l).then(n,i)}function lr(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var s=t.apply(e,r);function o(t){ar(s,n,i,o,a,"next",t)}function a(t){ar(s,n,i,o,a,"throw",t)}o(void 0)}))}}function hr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,ur(n.key),n)}}function ur(t){var e=function(t,e){if("object"!=nr(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=nr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==nr(e)?e:e+""}var cr=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.container=e.contentContainer,this.algorithms={rule:g,rule_fast:M,gravity:ot,orbits:tt,spiral:H,spiral_no:O,vertical:z}}return e=t,r=[{key:"_init",value:(s=lr(or().mark((function t(){var e=this;return or().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Qe.create(this.container);case 2:this.view=t.sent,this.view.app.renderer.events.cursorStyles.default="default",this.view.app.renderer.events.domElement.addEventListener("contextmenu",(function(t){t.preventDefault()})),this.model=new rr,this.controller=new ut(this.view,this.model),this.controller.main=this,this._enableDrop(),this.algo=new ot,this.algo.setModel(this.model),this.view.app.ticker.add((function(){e.algo.bounds=e.view.getWorldBounds(),e.algo.model.viewportWidth=e.view.width,e.algo.model.viewportHeight=e.view.height,e.algo.step(),e.view.renderGraph(e.model)}));case 12:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"setAlgorithm",value:function(t){this.algo=t}},{key:"addMoonData",value:function(t){var e=t.id,r=t.x,n=t.y,i=t.data,s=void 0===i?{}:i,o=t.fixed,a=void 0!==o&&o;if(this.model&&this.view){var l=this.view.app.screen.width,h=this.view.app.screen.height,u=void 0!==r?r:Math.random()*l,c=void 0!==n?n:Math.random()*h;this.model.addMoon({id:e,x:u,y:c,data:s,fixed:a}),this.view.renderGraph(this.model)}}},{key:"addRandomMoons",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,e=["male","female"],r=["a","b","c"],n=0;n<t;n++){var i=crypto.randomUUID(),s=e[Math.floor(Math.random()*e.length)],o=Math.floor(80*Math.random())+1,a=r[Math.floor(Math.random()*r.length)];this.addMoonData({id:i,data:{sex:s,age:o,class:a}})}}},{key:"_dropDataset",value:function(t,e){var r=this;t.forEach((function(t,n){var i=t.id||"moon_".concat(Date.now(),"_").concat(n),s=Math.random()*Math.PI*2,o=200*Math.random(),a=e.x+Math.cos(s)*o,l=e.y+Math.sin(s)*o;r.model.addMoon({id:i,x:a,y:l,data:t})}))}},{key:"_setAlgorithmByName",value:function(t){var e=this.algorithms[t];if(e){var r=new e;r.setModel(this.model),this.setAlgorithm(r)}else console.warn("Unknown algorithm:",t)}},{key:"_enableDrop",value:function(){var t=this,e=this.view.app.view;e.addEventListener("dragover",(function(t){return t.preventDefault()})),e.addEventListener("drop",(function(r){r.preventDefault();var n=e.getBoundingClientRect(),i=r.clientX-n.left,s=r.clientY-n.top,o=t.view.toWorld(i,s),a=r.dataTransfer.getData("application/json");if(a){var l=JSON.parse(a);if("table"!==l.type&&"graph-nodes"!==l.type)if("algorithm"!==l.type){if("planet"===l.type){var u=h.build(l.rule);t.model.addPlanet({id:"p_"+Date.now(),x:o.x,y:o.y,rule:u,label:l.label,scalarField:l.scalarField})}if("vector"===l.type){console.log("vector a aplicar: ",l);var c=h.build(l.rule);t.model.addVector({id:"p_"+Date.now(),x:o.x,y:o.y,direction:l.direction,length:l.length,scalarField:l.scalarField,rule:c})}}else t._setAlgorithmByName(l.name);else t._dropDataset(l.data,o)}}))}},{key:"getFormatedNode",value:function(t){var e=Object.entries(t);return'\n <h3 style="margin-top:0">'.concat(t.nombre||t.name||t.label||"Node",'</h3>\n <div style="font-size:12px; line-height:1.4">\n ').concat(e.map((function(t){var e,r=ir(t,2),n=r[0],i=r[1];return'\n <div style="display:flex; justify-content:space-between; margin-bottom:4px;">\n <span style="opacity:0.7">'.concat(n,'</span>\n <span style="text-align:right; margin-left:10px;">').concat(null==(e=i)||""===e||"NULL"===e?"<span style='opacity:0.5'>—</span>":e,"</span>\n </div>\n ")})).join(""),"\n </div>\n ")}}],n=[{key:"create",value:(i=lr(or().mark((function e(r){var n;return or().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=new t(r),e.next=3,n._init();case 3:return e.abrupt("return",n);case 4:case"end":return e.stop()}}),e)}))),function(t){return i.apply(this,arguments)})}],r&&hr(e.prototype,r),n&&hr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n,i,s}();function dr(t){return dr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dr(t)}function fr(t){return function(t){if(Array.isArray(t))return pr(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return pr(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?pr(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pr(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function yr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,mr(n.key),n)}}function mr(t){var e=function(t,e){if("object"!=dr(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=dr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==dr(e)?e:e+""}var gr=function(){return t=function t(e){if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),!e)throw new Error("Container is required");this.container=e,this.placeholderText="DROP JSON HERE",this._initDrop(),this._renderBase()},e=[{key:"_renderBase",value:function(){this.container.innerHTML="",this._createToolbox(),this._createPlaceholder(),this._showPlaceholder(),Object.assign(this.container.style,{position:"relative",border:"2px dashed #ccc",minHeight:"120px"})}},{key:"_createToolbox",value:function(){var t=this;this.toolbox=document.createElement("div"),Object.assign(this.toolbox.style,{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"8px",borderBottom:"1px solid #ddd",background:"#f9f9f9"}),this.counter=document.createElement("div"),this.counter.textContent="Records: 0",Object.assign(this.counter.style,{fontFamily:"sans-serif",fontSize:"13px",color:"#555"});var e=document.createElement("div");this.clearBtn=document.createElement("button"),this.clearBtn.textContent="Clear",this.clearBtn.disabled=!0,this.clearBtn.addEventListener("click",(function(){t._renderBase()})),e.appendChild(this.clearBtn),this.toolbox.appendChild(this.counter),this.toolbox.appendChild(e),this.container.appendChild(this.toolbox)}},{key:"_createPlaceholder",value:function(){this.placeholder=document.createElement("div"),this.placeholder.textContent=this.placeholderText,Object.assign(this.placeholder.style,{position:"absolute",top:"60%",left:"50%",transform:"translate(-50%, -50%)",color:"#888",fontFamily:"sans-serif",pointerEvents:"none",userSelect:"none"}),this.container.appendChild(this.placeholder)}},{key:"_showPlaceholder",value:function(){this.placeholder&&(this.placeholder.style.display="block")}},{key:"_hidePlaceholder",value:function(){this.placeholder&&(this.placeholder.style.display="none")}},{key:"_initDrop",value:function(){var t=this;this.container.addEventListener("dragover",(function(e){e.preventDefault(),t.container.style.background="#f0f8ff"})),this.container.addEventListener("dragleave",(function(){t.container.style.background=""})),this.container.addEventListener("drop",(function(e){e.preventDefault(),t.container.style.background="";var r=e.dataTransfer.getData("application/json")||e.dataTransfer.getData("text/plain");if(r)try{var n=JSON.parse(r).data;Array.isArray(n)?t.render(n):t._showPlaceholder()}catch(e){console.error("Invalid JSON dropped",e),t._showPlaceholder()}else t._showPlaceholder()}))}},{key:"render",value:function(t){var e=this;if(Array.isArray(t)&&0!==t.length){this.data=t,this.container.innerHTML="",this._createToolbox(),this._createPlaceholder(),this._hidePlaceholder(),this.clearBtn.disabled=!1,this.counter.textContent="Records: ".concat(t.length);var r=document.createElement("table");Object.assign(r.style,{borderCollapse:"separate",borderSpacing:"0 4px",width:"100%",fontFamily:"sans-serif",fontSize:"14px"});var n=document.createElement("thead"),i=document.createElement("tr");["Field","# Variants","Values","Attractor","Split UP","Split Right","Histogram"].forEach((function(t){var e=document.createElement("th");e.textContent=t,Object.assign(e.style,{border:"none",padding:"6px",background:"#eaeaea",textAlign:"left"}),i.appendChild(e)})),n.appendChild(i),r.appendChild(n);var s=document.createElement("tbody");Object.keys(t[0]).forEach((function(r,n){var i=t.map((function(t){return t[r]})).filter((function(t){return null!=t}));if(i.length){var o=e._detectType(i),a=fr(new Set(i)),l=document.createElement("tr"),h=document.createElement("td");h.textContent=r,Object.assign(h.style,{border:"none",padding:"6px",fontWeight:"bold"});var u=document.createElement("td");u.textContent=a.length,Object.assign(u.style,{border:"none",padding:"6px",textAlign:"center"});var c=document.createElement("td");Object.assign(c.style,{border:"none",padding:"6px"});var d=null;if("categorical"===o){var f=document.createElement("select");a.forEach((function(t){var e=document.createElement("option");e.value=t,e.textContent=t,f.appendChild(e)})),d=a[0],f.addEventListener("change",(function(t){d=t.target.value})),c.appendChild(f)}else{var p=i.map((function(t){return Number(t)})).filter((function(t){return!isNaN(t)}));c.textContent=p.length?"min: ".concat(Math.min.apply(Math,fr(p))," | max: ").concat(Math.max.apply(Math,fr(p))):"No numeric data"}var y=function(t,e){var r=document.createElement("td"),n=document.createElement("div");n.setAttribute("draggable","true"),Object.assign(n.style,{display:"flex",alignItems:"center",justifyContent:"center",width:"28px",height:"28px",border:"none",borderRadius:"6px",cursor:"grab"});var i=document.createElement("i");return i.className=t,i.style.pointerEvents="none",n.appendChild(i),n.addEventListener("dragstart",(function(t){var r=e(),n=JSON.stringify(r,null,2);t.dataTransfer.setData("application/json",n),t.dataTransfer.setData("text/plain",n)})),r.appendChild(n),r},m=y("fa-solid fa-magnet",(function(){return e._buildAttractorPayload(r,d)})),g=y("fa-solid fa-arrow-up",(function(){return e._buildSplitterPayload(r,"up")})),x=y("fa-solid fa-arrow-right",(function(){return e._buildSplitterPayload(r,"right")})),v=y("fa-solid fa-chart-column",(function(){return e._buildHistogramPayload(r)}));l.appendChild(h),l.appendChild(u),l.appendChild(c),l.appendChild(m),l.appendChild(g),l.appendChild(x),l.appendChild(v);var b=l.querySelectorAll("td"),_=n%2==0?"#dbeafe":"#ffffff";b.forEach((function(t){t.style.background=_})),s.appendChild(l)}})),r.appendChild(s);var o=document.createElement("div");Object.assign(o.style,{position:"absolute",top:"42px",left:"0",right:"0",bottom:"0",overflow:"auto",padding:"10px",boxSizing:"border-box"}),o.appendChild(r),this.container.appendChild(o)}else this._showPlaceholder()}},{key:"_buildAttractorPayload",value:function(t,e){return{type:"planet",label:e,rule:{op:"and",rules:[{field:t,op:"eq",value:e}]}}}},{key:"_buildSplitterPayload",value:function(t,e){var r={type:"vector",vector:!0,scalarField:t,direction:"up"==e?{x:0,y:1}:{x:1,y:0},length:1200,rule:{op:"and",rules:[]}};return console.log("vector",r),r}},{key:"_buildHistogramPayload",value:function(t){var e={};return this.data.forEach((function(r){var n=r[t];n||(n="EMPTY"),e[n]=(e[n]||0)+1})),{type:"histogram",field:t,data:Object.keys(e).map((function(t){return{value:t,count:e[t]}}))}}},{key:"_detectType",value:function(t){var e=t.filter((function(t){return""!==t&&null!=t}));return e.length&&e.map(Number).filter((function(t){return!isNaN(t)})).length===e.length?"scalar":"categorical"}}],e&&yr(t.prototype,e),r&&yr(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function xr(t){return xr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xr(t)}function vr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function br(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?vr(Object(r),!0).forEach((function(e){_r(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):vr(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function _r(t,e,r){return(e=Ar(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function wr(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,s,o,a=[],l=!0,h=!1;try{if(s=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=s.call(r)).done)&&(a.push(n.value),a.length!==e);l=!0);}catch(t){h=!0,i=t}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(h)throw i}}return a}}(t,e)||Cr(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Sr(t){return function(t){if(Array.isArray(t))return Mr(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Cr(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Cr(t,e){if(t){if("string"==typeof t)return Mr(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Mr(t,e):void 0}}function Mr(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Tr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Ar(n.key),n)}}function Ar(t){var e=function(t,e){if("object"!=xr(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=xr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==xr(e)?e:e+""}var kr=function(){return t=function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),!e)throw new Error("Container element is required");this.container=e,this.placeholderText=r.placeholder||"PASTE DATA HERE",this.data=[],this.sortState={field:null,direction:"asc"},this.filters={},this.handlePaste=this.handlePaste.bind(this),this._initStyles(),this.init()},e=[{key:"init",value:function(){var t=this;this.container.setAttribute("contenteditable","true"),this.container.style.display="flex",this.container.style.flexDirection="column",this.container.style.height="100%",this.container.style.position="relative",this.container.style.overflow="hidden",this.container.style.background="#fff",this.container.style.border="1px solid #e5e7eb",this.container.style.borderRadius="8px",this.createPlaceholder(),this.showPlaceholder(),this.container.addEventListener("paste",this.handlePaste),this.container.addEventListener("dragover",(function(e){e.preventDefault(),t.container.style.background="#f0f8ff"})),this.container.addEventListener("dragleave",(function(){t.container.style.background="#fff"})),this.container.addEventListener("drop",(function(e){e.preventDefault(),t.container.style.background="#fff",t.handleDrop(e)})),this.container.addEventListener("mousedown",(function(t){t.target.closest("[draggable='true']")&&t.stopPropagation()}))}},{key:"_initStyles",value:function(){this.styles={table:{width:"max-content",minwidth:"100%",height:"90%",borderCollapse:"separate",borderSpacing:"0",fontFamily:"system-ui, sans-serif",fontSize:"13px"},th:{padding:"10px 8px",background:"#f9fafb",borderBottom:"1px solid #e5e7eb",textAlign:"left",fontWeight:"600",color:"#374151",position:"sticky",top:"0",zIndex:"5"},td:{padding:"8px",borderBottom:"1px solid #f1f5f9",color:"#111827"},trHover:{background:"#f9fafb"},trAlt:{background:"#fcfcfd"},input:{width:"100%",border:"1px solid #d1d5db",borderRadius:"4px",padding:"4px",fontSize:"13px"},select:{marginTop:"4px",border:"1px solid #d1d5db",borderRadius:"4px",fontSize:"11px",padding:"2px"}}}},{key:"_setStyle",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object.assign(t.style,e)}},{key:"handlePaste",value:function(t){t.preventDefault();var e=(t.clipboardData||window.clipboardData).getData("text");if(e){var r=this.parseTSV(e),n=this.toJSON(r);this.data=this.mergeData(this.data,n),this.render()}}},{key:"handleDrop",value:function(t){var e=t.dataTransfer.getData("application/json")||t.dataTransfer.getData("text/plain");if(e){var r;try{r=JSON.parse(e)}catch(t){return void console.error("Invalid JSON dropped",t)}("table"===r.type&&Array.isArray(r.data)||"graph-nodes"===r.type&&Array.isArray(r.data))&&this._dropTableData(r.data)}}},{key:"_dropTableData",value:function(t){this.data=this.mergeData(this.data,t),this.render()}},{key:"render",value:function(){this.container.innerHTML="",this.container.style.display="grid",this.container.style.gridTemplateRows="auto 1fr",this.container.style.height="100%",this.container.style.minWidth="0",this.container.style.overflow="hidden";var t=this.createToolbox();t.style.gridRow="1";var e=document.createElement("div");e.style.gridRow="2",e.style.width="100%",e.style.height="90%",e.style.overflowX="auto",e.style.overflowY="auto",e.style.minWidth="0",e.style.minHeight="0";var r=this.createTableFromJSON(this.getProcessedData());r.style.width="max-content",e.appendChild(r),this.container.appendChild(t),this.container.appendChild(e),this.hidePlaceholder()}},{key:"getProcessedData",value:function(){var t=Sr(this.data);return Object.entries(this.filters).forEach((function(e){var r=wr(e,2),n=r[0],i=r[1];i&&(t=t.filter((function(t){return(t[n]||"")===i})))})),this.sortState.field&&(t=this._sortData(t,this.sortState.field,this.sortState.direction)),t}},{key:"_sortData",value:function(t,e,r){var n="asc"===r?1:-1;return Sr(t).map((function(t,e){return{item:t,index:e}})).sort((function(t,r){var i,s,o=null!==(i=t.item[e])&&void 0!==i?i:"",a=null!==(s=r.item[e])&&void 0!==s?s:"",l=parseFloat(o),h=parseFloat(a);return isNaN(l)||isNaN(h)?o.toString().localeCompare(a.toString())*n:(l-h)*n})).map((function(t){return t.item}))}},{key:"createTableFromJSON",value:function(t){var e=this,r=document.createElement("table");this._setStyle(r,this.styles.table);var n=document.createElement("thead"),i=document.createElement("tbody"),s=Array.from(this.data.reduce((function(t,e){return Object.keys(e).forEach((function(e){return t.add(e)})),t}),new Set)),o=document.createElement("tr");return s.forEach((function(t){var r=document.createElement("th"),n=e.sortState.field===t?"asc"===e.sortState.direction?" ▲":" ▼":"",i=document.createElement("div");i.textContent=t+n;var s=document.createElement("select"),a=Sr(new Set(e.data.map((function(e){return e[t]})).filter((function(t){return""!==t})))),l=document.createElement("option");l.value="",l.textContent="All",s.appendChild(l),a.forEach((function(t){var e=document.createElement("option");e.value=t,e.textContent=t,s.appendChild(e)})),s.value=e.filters[t]||"";var h=Math.min(120,Math.max(60,8*t.length));s.style.width=h+"px",e._setStyle(s,e.styles.select),s.onchange=function(r){e.filters[t]=r.target.value,e.render()},i.onclick=function(){e.sortState.field===t?e.sortState.direction="asc"===e.sortState.direction?"desc":"asc":(e.sortState.field=t,e.sortState.direction="asc"),e.render()},r.appendChild(i),r.appendChild(s),e._setStyle(r,e.styles.th),o.appendChild(r)})),n.appendChild(o),t.forEach((function(t,r){var n=document.createElement("tr");r%2==0&&e._setStyle(n,e.styles.trAlt),n.onmouseenter=function(){return e._setStyle(n,e.styles.trHover)},n.onmouseleave=function(){return n.style.background=r%2==0?"#fcfcfd":""},s.forEach((function(r){var i=document.createElement("td");e._setStyle(i,e.styles.td),i.textContent=t[r]||"",i.onclick=function(){var n=document.createElement("input");e._setStyle(n,e.styles.input),n.value=t[r]||"",i.innerHTML="",i.appendChild(n),n.focus();var s=function(){t[r]=n.value,e.render()};n.onblur=s,n.onkeydown=function(t){"Enter"===t.key&&s()}},n.appendChild(i)})),i.appendChild(n)})),r.appendChild(n),r.appendChild(i),r}},{key:"createToolbox",value:function(){var t=this,e=document.createElement("div");Object.assign(e.style,{display:"flex",gap:"10px",padding:"8px",borderBottom:"1px solid #e5e7eb",background:"#fafafa",alignItems:"center"});var r=document.createElement("button");r.textContent="Clear",Object.assign(r.style,{padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",background:"#fff",cursor:"pointer"}),r.onclick=function(){return t.clear()};var n=document.createElement("div");n.setAttribute("draggable","true"),n.title="Drag JSON",Object.assign(n.style,{display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",border:"1px solid #d1d5db",borderRadius:"6px",background:"#fff",cursor:"grab",userSelect:"none"});var i=document.createElement("span");i.textContent="⤴",i.style.pointerEvents="none",n.appendChild(i),n.addEventListener("mousedown",(function(){n.style.cursor="grabbing"})),n.addEventListener("mouseup",(function(){n.style.cursor="grab"})),n.addEventListener("dragstart",(function(e){var r={type:"table",data:t.getProcessedData()},i=JSON.stringify(r);e.dataTransfer.effectAllowed="copy",e.dataTransfer.setData("application/json",i),e.dataTransfer.setData("text/plain",i);var s=n.cloneNode(!0);s.style.position="absolute",s.style.top="-1000px",document.body.appendChild(s),e.dataTransfer.setDragImage(s,16,16),setTimeout((function(){return document.body.removeChild(s)}),0)}));var s=document.createElement("button");return s.textContent="Copy",Object.assign(s.style,{padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",background:"#fff",cursor:"pointer"}),s.onclick=function(){return t.copyToClipboard()},e.appendChild(r),e.appendChild(s),e.appendChild(n),e}},{key:"parseTSV",value:function(t){return t.trim().split("\n").map((function(t){return t.split("\t")}))}},{key:"toJSON",value:function(t){var e=t[0];return t.slice(1).map((function(t){var r={};return e.forEach((function(e,n){return r[e]=t[n]||""})),r}))}},{key:"mergeData",value:function(t,e){if(!t.length)return e;var r=new Map;return t.forEach((function(t){return t.id&&r.set(t.id,br({},t))})),e.forEach((function(t){t.id&&(r.has(t.id)?Object.assign(r.get(t.id),t):r.set(t.id,br({},t)))})),Array.from(r.values())}},{key:"createPlaceholder",value:function(){this.placeholder=document.createElement("div"),this.placeholder.textContent=this.placeholderText,Object.assign(this.placeholder.style,{position:"absolute",top:"10px",left:"10px",color:"#9ca3af"}),this.container.appendChild(this.placeholder)}},{key:"showPlaceholder",value:function(){this.placeholder&&(this.placeholder.style.display="block")}},{key:"hidePlaceholder",value:function(){this.placeholder&&(this.placeholder.style.display="none")}},{key:"clear",value:function(){this.data=[],this.filters={},this.sortState={field:null,direction:"asc"},this.container.innerHTML="",this.createPlaceholder(),this.showPlaceholder()}},{key:"copyToClipboard",value:function(){var t=this.getProcessedData();if(t.length){var e=Array.from(t.reduce((function(t,e){return Object.keys(e).forEach((function(e){return t.add(e)})),t}),new Set)),r=[e.join("\t")].concat(Sr(t.map((function(t){return e.map((function(e){var r;return null!==(r=t[e])&&void 0!==r?r:""})).join("\t")})))).join("\n");navigator.clipboard.writeText(r).then((function(){console.log("Copied to clipboard")})).catch((function(t){console.error("Clipboard copy failed",t)}))}}}],e&&Tr(t.prototype,e),r&&Tr(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function Pr(t){return Pr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pr(t)}function Er(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Rr(n.key),n)}}function Rr(t){var e=function(t,e){if("object"!=Pr(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Pr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Pr(e)?e:e+""}var Ir=function(){return t=function t(e){if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),!e)throw new Error("Container is required");this.container=e,this.placeholderText="DROP HISTOGRAM HERE",this.currentPayload=null,this._initDrop(),this._initResize(),this._renderBase()},e=[{key:"_renderBase",value:function(){this.container.innerHTML="",this._createToolbox(),this._createPlaceholder(),this._createTooltip(),this._showPlaceholder(),Object.assign(this.container.style,{position:"relative",border:"2px dashed #ccc",minHeight:"200px"})}},{key:"_createToolbox",value:function(){var t=this,e=document.createElement("div");Object.assign(e.style,{display:"flex",justifyContent:"flex-end",padding:"8px",borderBottom:"1px solid #ddd",background:"#f9f9f9"});var r=document.createElement("button");r.textContent="Clear",r.addEventListener("click",(function(){t.currentPayload=null,t._renderBase()})),e.appendChild(r),this.container.appendChild(e)}},{key:"_createPlaceholder",value:function(){this.placeholder=document.createElement("div"),this.placeholder.textContent=this.placeholderText,Object.assign(this.placeholder.style,{position:"absolute",top:"60%",left:"50%",transform:"translate(-50%, -50%)",color:"#888",fontFamily:"sans-serif",pointerEvents:"none"}),this.container.appendChild(this.placeholder)}},{key:"_showPlaceholder",value:function(){this.placeholder&&(this.placeholder.style.display="block")}},{key:"_hidePlaceholder",value:function(){this.placeholder&&(this.placeholder.style.display="none")}},{key:"_createTooltip",value:function(){this.tooltip=document.createElement("div"),Object.assign(this.tooltip.style,{position:"absolute",pointerEvents:"none",background:"rgba(0,0,0,0.75)",color:"#fff",padding:"6px 8px",borderRadius:"4px",fontSize:"12px",fontFamily:"sans-serif",opacity:"0",transition:"opacity 0.2s"}),this.container.appendChild(this.tooltip)}},{key:"_showTooltip",value:function(t,e,r){this.tooltip.innerHTML=r,this.tooltip.style.left=t+10+"px",this.tooltip.style.top=e+10+"px",this.tooltip.style.opacity="1"}},{key:"_hideTooltip",value:function(){this.tooltip.style.opacity="0"}},{key:"_initResize",value:function(){var t=this;this._handleResize=function(e){var r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:150;return function(){for(var i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];clearTimeout(r),r=setTimeout((function(){return e.apply(t,s)}),n)}}((function(){t.currentPayload&&t._drawChart(t.currentPayload)})),this.resizeObserver=new ResizeObserver(this._handleResize),this.resizeObserver.observe(this.container)}},{key:"_initDrop",value:function(){var t=this;this.container.addEventListener("dragover",(function(e){e.preventDefault(),t.container.style.background="#f0f8ff"})),this.container.addEventListener("dragleave",(function(){t.container.style.background=""})),this.container.addEventListener("drop",(function(e){e.preventDefault(),t.container.style.background="";var r=e.dataTransfer.getData("application/json")||e.dataTransfer.getData("text/plain");if(r)try{var n=JSON.parse(r);"histogram"===n.type&&Array.isArray(n.data)&&t.render(n)}catch(t){console.error("Invalid histogram JSON",t)}}))}},{key:"render",value:function(t){this.currentPayload=t,this.container.innerHTML="",this._createToolbox(),this._createTooltip(),this._hidePlaceholder(),this.chartWrapper=document.createElement("div"),this.chartWrapper.style.width="100%",this.chartWrapper.style.height="100%",this.chartWrapper.style.padding="10px",this.container.appendChild(this.chartWrapper),this._drawChart(t)}},{key:"_drawChart",value:function(t){var e=this;if(this.chartWrapper){this.chartWrapper.innerHTML="";var r=this.container.getBoundingClientRect(),n=r.width-20,i=Math.max(200,r.height-60),s=30,o=20,a=80,l=50,h=d3.select(this.chartWrapper).append("svg").attr("width",n).attr("height",i),u=n-l-o,c=i-s-a,d=h.append("g").attr("transform","translate(".concat(l,",").concat(s,")")),f=t.data,p=d3.scaleBand().domain(f.map((function(t){return t.value}))).range([0,u]).padding(.1),y=d3.scaleLinear().domain([0,d3.max(f,(function(t){return t.count}))]).nice().range([c,0]);d.selectAll(".bar").data(f,(function(t){return t.value})).enter().append("rect").attr("class","bar").attr("x",(function(t){return p(t.value)})).attr("width",p.bandwidth()).attr("y",c).attr("height",0).attr("fill","#69b3a2").on("mousemove",(function(t,r){e._showTooltip(t.offsetX,t.offsetY,"<b>".concat(r.value,"</b><br/>Count: ").concat(r.count))})).on("mouseleave",(function(){return e._hideTooltip()})).transition().duration(600).attr("y",(function(t){return y(t.count)})).attr("height",(function(t){return c-y(t.count)})),d.append("g").attr("transform","translate(0, ".concat(c,")")).call(d3.axisBottom(p).tickFormat((function(t){var e,r=f.find((function(e){return e.value===t}));return"".concat(t," (").concat(null!==(e=null==r?void 0:r.count)&&void 0!==e?e:0,")")}))).selectAll("text").attr("transform","rotate(-30)").style("text-anchor","end"),d.append("g").call(d3.axisLeft(y)),h.append("text").attr("x",n/2).attr("y",20).attr("text-anchor","middle").style("font-family","sans-serif").style("font-size","14px").text("Histogram: ".concat(t.field))}}}],e&&Er(t.prototype,e),r&&Er(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function Or(t){return Or="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Or(t)}function Lr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Br(n.key),n)}}function Br(t){var e=function(t,e){if("object"!=Or(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Or(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Or(e)?e:e+""}var Dr=function(){return t=function t(e){if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),!e)throw new Error("Container required");this.container=e,this.days=["Lun","Mar","Mie","Jue","Vie","Sab","Dom"],this.hours=["09:00","10:00","11:00","12:00","13:00","14:00","15:00","16:00","17:00","18:00","19:00","20:00","21:00"],this.selected={},this._injectStyles(),this._render(),this._buildGrid(),this._bindEvents()},(e=[{key:"_injectStyles",value:function(){if(!document.getElementById("availability-survey-styles")){var t=document.createElement("style");t.id="availability-survey-styles",t.textContent="\n .as-card {\n max-width: 900px;\n margin: auto;\n background: white;\n padding: 20px;\n border-radius: 16px;\n box-shadow: 0 8px 24px rgba(0,0,0,0.08);\n font-family: sans-serif;\n\n display: flex;\n flex-direction: column;\n height: 100%; /* 🔥 important */\n }\n\n .as-title {\n margin-bottom: 6px;\n }\n\n .as-subtitle {\n color: #666;\n margin-bottom: 16px;\n font-size: 14px;\n }\n\n .as-input-group {\n margin-bottom: 16px;\n }\n\n .as-card input {\n padding: 8px 10px;\n border: 1px solid #ddd;\n border-radius: 8px;\n width: 220px;\n font-size: 14px;\n }\n\n .as-grid-wrapper {\n overflow: auto;\n border-radius: 12px;\n -webkit-overflow-scrolling: touch;\n\n flex: 1; /* 🔥 fills space */\n min-height: 0; /* 🔥 required for iOS */\n }\n\n .as-grid {\n display: grid;\n grid-template-columns: 80px repeat(7, minmax(70px, 1fr));\n min-width: 600px;\n border: 1px solid #e5e7eb;\n }\n\n .as-cell {\n border: 1px solid #eef0f4;\n height: 42px;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n font-size: 13px;\n transition: all 0.12s ease;\n user-select: none;\n }\n\n .as-header {\n font-weight: 600;\n background: #f1f5f9;\n cursor: default;\n }\n\n .as-time {\n background: #f9fafb;\n color: #555;\n font-size: 12px;\n cursor: default;\n }\n\n /* hover only when NOT clicking */\n body:not(.as-clicking) .as-cell:not(.as-active):hover {\n background: #eef4ff;\n }\n\n .as-active {\n background: #1e40af;\n color: white;\n font-weight: bold;\n }\n\n .as-cell:active {\n transform: scale(0.96);\n }\n\n .as-card button {\n margin-top: 16px;\n padding: 10px 16px;\n border: none;\n border-radius: 10px;\n background: #3b82f6;\n color: white;\n font-size: 14px;\n cursor: pointer;\n box-shadow: 0 4px 12px rgba(59,130,246,0.3);\n margin-top: 12px;\n flex-shrink: 0; \n }\n\n .as-card button:hover {\n background: #2563eb;\n }\n\n .as-header {\n position: sticky;\n top: 0;\n z-index: 2;\n }\n\n\n .as-time {\n position: sticky;\n left: 0;\n z-index: 1;\n background: #f9fafb;\n }\n\n ",document.head.appendChild(t)}}},{key:"_render",value:function(){this.container.innerHTML="",this.card=document.createElement("div"),this.card.className="as-card",this.title=document.createElement("h1"),this.title.className="as-title",this.title.textContent="Encuesta de Disponibilidad 🎶",this.subtitle=document.createElement("div"),this.subtitle.className="as-subtitle",this.subtitle.textContent="Pon tu nombre y da click en los horarios que te acomoden para el ensayo",this.inputGroup=document.createElement("div"),this.inputGroup.className="as-input-group",this.input=document.createElement("input"),this.input.placeholder="Pon tu Nombre",this.gridWrapper=document.createElement("div"),this.gridWrapper.className="as-grid-wrapper",this.grid=document.createElement("div"),this.grid.className="as-grid",this.gridWrapper.appendChild(this.grid),this.button=document.createElement("button"),this.button.textContent="Enviar",this.inputGroup.appendChild(this.input),this.card.appendChild(this.title),this.card.appendChild(this.subtitle),this.card.appendChild(this.inputGroup),this.card.appendChild(this.gridWrapper),this.card.appendChild(this.button),this.container.appendChild(this.card)}},{key:"_buildGrid",value:function(){var t=this;this.grid.appendChild(document.createElement("div")),this.days.forEach((function(e){var r=document.createElement("div");r.textContent=e,r.className="as-cell as-header",t.grid.appendChild(r)})),this.hours.forEach((function(e){var r=document.createElement("div");r.textContent=e,r.className="as-cell as-time",t.grid.appendChild(r),t.days.forEach((function(r){var n="".concat(r,"-").concat(e),i=document.createElement("div");i.className="as-cell",i.addEventListener("click",(function(){var e=!t.selected[n];t.selected[n]=e,i.classList.toggle("as-active",e),i.textContent=e?"✓":""})),t.grid.appendChild(i)}))}))}},{key:"_bindEvents",value:function(){var t=this;document.addEventListener("mousedown",(function(){document.body.classList.add("as-clicking")})),document.addEventListener("mouseup",(function(){document.body.classList.remove("as-clicking")})),this.button.addEventListener("click",(function(){var e=t.input.value||"Anonymous";if(0!==Object.values(t.selected).filter(Boolean).length){var r={name:e,availability:t.selected};alert("Gracias !!!"),t.onSubmit&&t.onSubmit(r)}else alert("Please select at least one time slot")}))}}])&&Lr(t.prototype,e),r&&Lr(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}(),Fr=s.A5,jr=s.oY,Gr=s.vY,zr=s.TI,Nr=s.sV;export{Fr as AvailabilitySurvey,jr as DataInspector,Gr as vi_2dGRAP,zr as vi_HistogramViewer,Nr as vi_PasteTable};
|