1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./CxwizIMx.js","./cojhOBf_.js","./C2GHuDhf.js","./DiPyXvl1.js","./BemU8_1z.js","./S2szyneb.js","./BuXnT0K0.js","./BoaoE8l7.js","./DSHkd2Dv.js"])))=>i.map(i=>d[i]); 2import{d as Fi,r as Nt,c7 as Jr,H as Di,s as tn,c as Li,g as en,u as It,b as zi,c1 as sn,z as rn,C as Ui,aS as nn,j as on,h as xe,au as an,Y as Ps,t as Ts,_ as we,bE as ps,x as ks,c8 as hn,c9 as ln,G as cn,y as un,w as dn,ca as fn,cb as pn,o as mn,cc as Es}from"./BemU8_1z.js";import{u as gn}from"./S2szyneb.js";const xn={class:"text-xs"},Zh=Fi({__name:"BreakpointsHelper",props:{dark:{type:Boolean}},setup(s){const t=Nt(null),e=!1,i=Nt(!0),{x:r,y:n}=Jr(t,{initialValue:{x:0,y:0}});Di(()=>{t.value&&(r.value=16,n.value=window.innerHeight-t.value.clientHeight-16)});const{width:o,height:a}=tn(),h=Nt(null);function c(){h.value?i.value=!1:h.value=setTimeout(()=>{h.value=null},300)}return(l,u)=>{const p=an;return It(e)?(zi(),Li("div",{key:0,ref_key:"el",ref:t,class:Ui(["group fixed left-0 top-0 z-50 translate-x-0 transform-gpu cursor-move select-none rounded-2xl border px-2.5 py-2.5 text-center text-sm shadow-lg backdrop-blur transition duration-300 after:absolute after:bottom-1 after:left-1/2 after:block after:w-3 after:-translate-x-1/2 after:rounded-sm after:border after:border-white/70 hover:rounded-tr-lg",{"pointer-events-none opacity-0":!It(i),"border-black/20 bg-black/40 text-white":l.dark,"border-white/20 bg-white/40 text-black":!l.dark}]),style:rn(` 3 touch-action: none; 4 transition-property: border-radius; 5 --tw-translate-x: ${It(r)}px; 6 --tw-translate-y: ${It(n)}px 7 `),onTouchstart:sn(c,["prevent"])},[u[2]||(u[2]=nn('<div class="flex gap-0.5 font-medium"><span>xs</span><span class="opacity-40">â¢</span><span class="opacity-60 sm:opacity-100">sm</span><span class="opacity-40">â¢</span><span class="opacity-60 md:opacity-100">md</span><span class="opacity-40">â¢</span><span class="opacity-60 lg:opacity-100">lg</span><span class="opacity-40">â¢</span><span class="opacity-60 xl:opacity-100">xl</span><span class="opacity-40">â¢</span><span class="opacity-60 2xl:opacity-100">2xl</span></div>',1)),on(p,null,{fallback:Ps(()=>u[1]||(u[1]=[xe("span",{class:"text-xs"},"0x0",-1)])),default:Ps(()=>[xe("span",xn,Ts(It(o))+"x"+Ts(It(a)),1)]),_:1}),xe("button",{class:"absolute right-1 top-0.5 cursor-pointer text-[10px] leading-none opacity-0 transition-opacity duration-300 group-hover:opacity-100",title:"Hide mq helper",onClick:u[0]||(u[0]=d=>i.value=!1)}," x ")],38)):en("",!0)}}});var W=(s=>(s.Application="application",s.WebGLPipes="webgl-pipes",s.WebGLPipesAdaptor="webgl-pipes-adaptor",s.WebGLSystem="webgl-system",s.WebGPUPipes="webgpu-pipes",s.WebGPUPipesAdaptor="webgpu-pipes-adaptor",s.WebGPUSystem="webgpu-system",s.CanvasSystem="canvas-system",s.CanvasPipesAdaptor="canvas-pipes-adaptor",s.CanvasPipes="canvas-pipes",s.Asset="asset",s.LoadParser="load-parser",s.ResolveParser="resolve-parser",s.CacheParser="cache-parser",s.DetectionParser="detection-parser",s.MaskEffect="mask-effect",s.BlendMode="blend-mode",s.TextureSource="texture-source",s.Environment="environment",s.ShapeBuilder="shape-builder",s.Batcher="batcher",s))(W||{});const Qe=s=>{if(typeof s=="function"||typeof s=="object"&&s.extension){if(!s.extension)throw new Error("Extension class must have an extension object");s={...typeof s.extension!="object"?{type:s.extension}:s.extension,ref:s}}if(typeof s=="object")s={...s};else throw new Error("Invalid extension type");return typeof s.type=="string"&&(s.type=[s.type]),s},oe=(s,t)=>Qe(s).priority??t,pt={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...s){return s.map(Qe).forEach(t=>{t.type.forEach(e=>{var i,r;return(r=(i=this._removeHandlers)[e])==null?void 0:r.call(i,t)})}),this},add(...s){return s.map(Qe).forEach(t=>{t.type.forEach(e=>{var n,o;const i=this._addHandlers,r=this._queue;i[e]?(o=i[e])==null||o.call(i,t):(r[e]=r[e]||[],(n=r[e])==null||n.push(t))})}),this},handle(s,t,e){var o;const i=this._addHandlers,r=this._removeHandlers;if(i[s]||r[s])throw new Error(`Extension type ${s} already has a handler`);i[s]=t,r[s]=e;const n=this._queue;return n[s]&&((o=n[s])==null||o.forEach(a=>t(a)),delete n[s]),this},handleByMap(s,t){return this.handle(s,e=>{e.name&&(t[e.name]=e.ref)},e=>{e.name&&delete t[e.name]})},handleByNamedList(s,t,e=-1){return this.handle(s,i=>
vendor: 37,519 bytes, lines 7-12
7{t.findIndex(n=>n.name===i.name)>=0||(t.push({name:i.name,value:i.ref}),t.sort((n,o)=>oe(o.value,e)-oe(n.value,e)))},i=>{const r=t.findIndex(n=>n.name===i.name);r!==-1&&t.splice(r,1)})},handleByList(s,t,e=-1){return this.handle(s,i=>{t.includes(i.ref)||(t.push(i.ref),t.sort((r,n)=>oe(n,e)-oe(r,e)))},i=>{const r=t.indexOf(i.ref);r!==-1&&t.splice(r,1)})},mixin(s,...t){for(const e of t)Object.defineProperties(s.prototype,Object.getOwnPropertyDescriptors(e))}},yn={extension:{type:W.Environment,name:"browser",priority:-1},test:()=>!0,load:async()=>{await we(()=>import("./CxwizIMx.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)}},_n={extension:{type:W.Environment,name:"webworker",priority:0},test:()=>typeof self<"u"&&self.WorkerGlobalScope!==void 0,load:async()=>{await we(()=>import("./cojhOBf_.js"),__vite__mapDeps([1,2,3,4,5]),import.meta.url)}};class lt{constructor(t,e,i){this._x=e||0,this._y=i||0,this._observer=t}clone(t){return new lt(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=0 y=0 scope=${this._observer}]`}get x(){return this._x}set x(t){this._x!==t&&(this._x=t,this._observer._onUpdate(this))}get y(){return this._y}set y(t){this._y!==t&&(this._y=t,this._observer._onUpdate(this))}}var Pe={exports:{}},Is;function bn(){return Is||(Is=1,function(s){var t=Object.prototype.hasOwnProperty,e="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(e=!1));function r(h,c,l){this.fn=h,this.context=c,this.once=l||!1}function n(h,c,l,u,p){if(typeof l!="function")throw new TypeError("The listener must be a function");var d=new r(l,u||h,p),x=e?e+c:c;return h._events[x]?h._events[x].fn?h._events[x]=[h._events[x],d]:h._events[x].push(d):(h._events[x]=d,h._eventsCount++),h}function o(h,c){--h._eventsCount===0?h._events=new i:delete h._events[c]}function a(){this._events=new i,this._eventsCount=0}a.prototype.eventNames=function(){var c=[],l,u;if(this._eventsCount===0)return c;for(u in l=this._events)t.call(l,u)&&c.push(e?u.slice(1):u);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(l)):c},a.prototype.listeners=function(c){var l=e?e+c:c,u=this._events[l];if(!u)return[];if(u.fn)return[u.fn];for(var p=0,d=u.length,x=new Array(d);p<d;p++)x[p]=u[p].fn;return x},a.prototype.listenerCount=function(c){var l=e?e+c:c,u=this._events[l];return u?u.fn?1:u.length:0},a.prototype.emit=function(c,l,u,p,d,x){var _=e?e+c:c;if(!this._events[_])return!1;var m=this._events[_],b=arguments.length,w,A;if(m.fn){switch(m.once&&this.removeListener(c,m.fn,void 0,!0),b){case 1:return m.fn.call(m.context),!0;case 2:return m.fn.call(m.context,l),!0;case 3:return m.fn.call(m.context,l,u),!0;case 4:return m.fn.call(m.context,l,u,p),!0;case 5:return m.fn.call(m.context,l,u,p,d),!0;case 6:return m.fn.call(m.context,l,u,p,d,x),!0}for(A=1,w=new Array(b-1);A<b;A++)w[A-1]=arguments[A];m.fn.apply(m.context,w)}else{var C=m.length,E;for(A=0;A<C;A++)switch(m[A].once&&this.removeListener(c,m[A].fn,void 0,!0),b){case 1:m[A].fn.call(m[A].context);break;case 2:m[A].fn.call(m[A].context,l);break;case 3:m[A].fn.call(m[A].context,l,u);break;case 4:m[A].fn.call(m[A].context,l,u,p);break;default:if(!w)for(E=1,w=new Array(b-1);E<b;E++)w[E-1]=arguments[E];m[A].fn.apply(m[A].context,w)}}return!0},a.prototype.on=function(c,l,u){return n(this,c,l,u,!1)},a.prototype.once=function(c,l,u){return n(this,c,l,u,!0)},a.prototype.removeListener=function(c,l,u,p){var d=e?e+c:c;if(!this._events[d])return this;if(!l)return o(this,d),this;var x=this._events[d];if(x.fn)x.fn===l&&(!p||x.once)&&(!u||x.context===u)&&o(this,d);else{for(var _=0,m=[],b=x.length;_<b;_++)(x[_].fn!==l||p&&!x[_].once||u&&x[_].context!==u)&&m.push(x[_]);m.length?this._events[d]=m.length===1?m[0]:m:o(this,d)}return this},a.prototype.removeAllListeners=function(c){var l;return c?(l=e?e+c:c,this._events[l]&&o(this,l)):(this._events=new i,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=e,a.EventEmitter=a,s.exports=a}(Pe)),Pe.exports}var wn=bn();const Mt=ps(wn),vn=Math.PI*2,Cn=180/Math.PI,An=Math.PI/180;class rt{constructor(t=0,e=0){this.x=0,this.y=0,this.x=t,this.y=e}clone(){return new rt(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 Te.x=0,Te.y=0,Te}}const Te=new rt;class N{constructor(t=1,e=0,i=0,r=1,n=0,o=0){this.array=null,this.a=t,this.b=e,this.c=i,this.d=r,this.tx=n,this.ty=o}fromArray(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]}set(t,e,i,r,n,o){return this.a=t,this.b=e,this.c=i,this.d=r,this.tx=n,this.ty=o,this}toArray(t,e){this.array||(this.array=new Float32Array(9));const i=e||this.array;return t?(i[0]=this.a,i[1]=this.b,i[2]=0,i[3]=this.c,i[4]=this.d,i[5]=0,i[6]=this.tx,i[7]=this.ty,i[8]=1):(i[0]=this.a,i[1]=this.c,i[2]=this.tx,i[3]=this.b,i[4]=this.d,i[5]=this.ty,i[6]=0,i[7]=0,i[8]=1),i}apply(t,e){e=e||new rt;const i=t.x,r=t.y;return e.x=this.a*i+this.c*r+this.tx,e.y=this.b*i+this.d*r+this.ty,e}applyInverse(t,e){e=e||new rt;const i=this.a,r=this.b,n=this.c,o=this.d,a=this.tx,h=this.ty,c=1/(i*o+n*-r),l=t.x,u=t.y;return e.x=o*c*l+-n*c*u+(h*n-a*o)*c,e.y=i*c*u+-r*c*l+(-h*i+a*r)*c,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),i=Math.sin(t),r=this.a,n=this.c,o=this.tx;return this.a=r*e-this.b*i,this.b=r*i+this.b*e,this.c=n*e-this.d*i,this.d=n*i+this.d*e,this.tx=o*e-this.ty*i,this.ty=o*i+this.ty*e,this}append(t){const e=this.a,i=this.b,r=this.c,n=this.d;return this.a=t.a*e+t.b*r,this.b=t.a*i+t.b*n,this.c=t.c*e+t.d*r,this.d=t.c*i+t.d*n,this.tx=t.tx*e+t.ty*r+this.tx,this.ty=t.tx*i+t.ty*n+this.ty,this}appendFrom(t,e){const i=t.a,r=t.b,n=t.c,o=t.d,a=t.tx,h=t.ty,c=e.a,l=e.b,u=e.c,p=e.d;return this.a=i*c+r*u,this.b=i*l+r*p,this.c=n*c+o*u,this.d=n*l+o*p,this.tx=a*c+h*u+e.tx,this.ty=a*l+h*p+e.ty,this}setTransform(t,e,i,r,n,o,a,h,c){return this.a=Math.cos(a+c)*n,this.b=Math.sin(a+c)*n,this.c=-Math.sin(a-h)*o,this.d=Math.cos(a-h)*o,this.tx=t-(i*this.a+r*this.c),this.ty=e-(i*this.b+r*this.d),this}prepend(t){const e=this.tx;if(t.a!==1||t.b!==0||t.c!==0||t.d!==1){const i=this.a,r=this.c;this.a=i*t.a+this.b*t.c,this.b=i*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,i=this.b,r=this.c,n=this.d,o=t.pivot,a=-Math.atan2(-r,n),h=Math.atan2(i,e),c=Math.abs(a+h);return c<1e-5||Math.abs(vn-c)<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+i*i),t.scale.y=Math.sqrt(r*r+n*n),t.position.x=this.tx+(o.x*e+o.y*r),t.position.y=this.ty+(o.x*i+o.y*n),t}invert(){const t=this.a,e=this.b,i=this.c,r=this.d,n=this.tx,o=t*r-e*i;return this.a=r/o,this.b=-e/o,this.c=-i/o,this.d=t/o,this.tx=(i*this.ty-r*n)/o,this.ty=-(t*this.ty-e*n)/o,this}isIdentity(){return this.a===1&&this.b===0&&this.c===0&&this.d===1&&this.tx===0&&this.ty===0}identity(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this}clone(){const t=new N;return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t}copyTo(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t}copyFrom(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this}equals(t){return t.a===this.a&&t.b===this.b&&t.c===this.c&&t.d===this.d&&t.tx===this.tx&&t.ty===this.ty}toString(){return`[pixi.js:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`}static get IDENTITY(){return Mn.identity()}static get shared(){return Sn.identity()}}const Sn=new N,Mn=new N,Rt=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],Bt=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],Gt=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],Ft=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],Je=[],Ni=[],ae=Math.sign;function Pn(){for(let s=0;s<16;s++){const t=[];Je.push(t);for(let e=0;e<16;e++){const i=ae(Rt[s]*Rt[e]+Gt[s]*Bt[e]),r=ae(Bt[s]*Rt[e]+Ft[s]*Bt[e]),n=ae(Rt[s]*Gt[e]+Gt[s]*Ft[e]),o=ae(Bt[s]*Gt[e]+Ft[s]*Ft[e]);for(let a=0;a<16;a++)if(Rt[a]===i&&Bt[a]===r&&Gt[a]===n&&Ft[a]===o){t.push(a);break}}}for(let s=0;s<16;s++){const t=new N;t.set(Rt[s],Bt[s],Gt[s],Ft[s],0,0),Ni.push(t)}}Pn();const K={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:s=>Rt[s],uY:s=>Bt[s],vX:s=>Gt[s],vY:s=>Ft[s],inv:s=>s&8?s&15:-s&7,add:(s,t)=>Je[s][t],sub:(s,t)=>Je[s][K.inv(t)],rotate180:s=>s^4,isVertical:s=>(s&3)===2,byDirection:(s,t)=>Math.abs(s)*2<=Math.abs(t)?t>=0?K.S:K.N:Math.abs(t)*2<=Math.abs(s)?s>0?K.E:K.W:t>0?s>0?K.SE:K.SW:s>0?K.NE:K.NW,matrixAppendRotationInv:(s,t,e=0,i=0)=>{const r=Ni[K.inv(t)];r.tx=e,r.ty=i,s.append(r)}},he=[new rt,new rt,new rt,new rt];class it{constructor(t=0,e=0,i=0,r=0){this.type="rectangle",this.x=Number(t),this.y=Number(e),this.width=Number(i),this.height=Number(r)}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 it(0,0,0,0)}clone(){return new it(this.x,this.y,this.width,this.height)}copyFromBounds(t){return this.x=t.minX,this.y=t.minY,this.width=t.maxX-t.minX,this.height=t.maxY-t.minY,this}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.copyFrom(this),t}contains(t,e){return this.width<=0||this.height<=0?!1:t>=this.x&&t<this.x+this.width&&e>=this.y&&e<this.y+this.height}strokeContains(t,e,i,r=.5){const{width:n,height:o}=this;if(n<=0||o<=0)return!1;const a=this.x,h=this.y,c=i*(1-r),l=i-c,u=a-c,p=a+n+c,d=h-c,x=h+o+c,_=a+l,m=a+n-l,b=h+l,w=h+o-l;return t>=u&&t<=p&&e>=d&&e<=x&&!(t>_&&t<m&&e>b&&e<w)}intersects(t,e){if(!e){const D=this.x<t.x?t.x:this.x;if((this.right>t.right?t.right:this.right)<=D)return!1;const R=this.y<t.y?t.y:this.y;return(this.bottom>t.bottom?t.bottom:this.bottom)>R}const i=this.left,r=this.right,n=this.top,o=this.bottom;if(r<=i||o<=n)return!1;const a=he[0].set(t.left,t.top),h=he[1].set(t.left,t.bottom),c=he[2].set(t.right,t.top),l=he[3].set(t.right,t.bottom);if(c.x<=a.x||h.y<=a.y)return!1;const u=Math.sign(e.a*e.d-e.b*e.c);if(u===0||(e.apply(a,a),e.apply(h,h),e.apply(c,c),e.apply(l,l),Math.max(a.x,h.x,c.x,l.x)<=i||Math.min(a.x,h.x,c.x,l.x)>=r||Math.max(a.y,h.y,c.y,l.y)<=n||Math.min(a.y,h.y,c.y,l.y)>=o))return!1;const p=u*(h.y-a.y),d=u*(a.x-h.x),x=p*i+d*n,_=p*r+d*n,m=p*i+d*o,b=p*r+d*o;if(Math.max(x,_,m,b)<=p*a.x+d*a.y||Math.min(x,_,m,b)>=p*l.x+d*l.y)return!1;const w=u*(a.y-c.y),A=u*(c.x-a.x),C=w*i+A*n,E=w*r+A*n,S=w*i+A*o,P=w*r+A*o;return!(Math.max(C,E,S,P)<=w*a.x+A*a.y||Math.min(C,E,S,P)>=w*l.x+A*l.y)}pad(t=0,e=t){return this.x-=t,this.y-=e,this.width+=t*2,this.height+=e*2,this}fit(t){const e=Math.max(this.x,t.x),i=Math.min(this.x+this.width,t.x+t.width),r=Math.max(this.y,t.y),n=Math.min(this.y+this.height,t.y+t.height);return this.x=e,this.width=Math.max(i-e,0),this.y=r,this.height=Math.max(n-r,0),this}ceil(t=1,e=.001){const i=Math.ceil((this.x+this.width-e)*t)/t,r=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=i-this.x,this.height=r-this.y,this}enlarge(t){const e=Math.min(this.x,t.x),i=Math.max(this.x+this.width,t.x+t.width),r=Math.min(this.y,t.y),n=Math.max(this.y+this.height,t.y+t.height);return this.x=e,this.width=i-e,this.y=r,this.height=n-r,this}getBounds(t){return t||(t=new it),t.copyFrom(this),t}containsRect(t){if(this.width<=0||this.height<=0)return!1;const e=t.x,i=t.y,r=t.x+t.width,n=t.y+t.height;return e>=this.x&&e<this.x+this.width&&i>=this.y&&i<this.y+this.height&&r>=this.x&&r<this.x+this.width&&n>=this.y&&n<this.y+this.height}toString(){return`[pixi.js/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}}const ke={default:-1};function tt(s="default"){return ke[s]===void 0&&(ke[s]=-1),++ke[s]}const Rs={},et="8.0.0",Tn="8.3.4";function q(s,t,e=3){if(Rs[t])return;let i=new Error().stack;typeof i>"u"?console.warn("PixiJS Deprecation Warning: ",`${t} 8Deprecated since v${s}`):(i=i.split(` 9`).splice(e).join(` 10`),console.groupCollapsed?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",`${t} 11Deprecated since v${s}`),console.warn(i),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",`${t} 12Deprecated since v${s}`),console.warn(i))),Rs[t]=!0}const Hi=()=>{};function Bs(s){return s+=s===0?1:0,--s,s|=s>>>1,s|=s>>>2,s|=s>>>4,s|=s>>>8,s|=s>>>16,s+1}function Gs(s){return!(s&s-1)&&!!s}function Oi(s){const t={};for(const e in s)s[e]!==void 0&&(t[e]=s[e]);return t}const Fs=Object.create(null);function kn(s){const t=Fs[s];return t===void 0&&(Fs[s]=tt("resource")),t}const Vi=class Yi extends Mt{constructor(t={}){super(),this._resourceType="textureSampler",this._touched=0,this._maxAnisotropy=1,this.destroyed=!1,t={...Yi.defaultOptions,...t},this.addressMode=t.addressMode,this.addressModeU=t.addressModeU??this.addressModeU,this.addressModeV=t.addressModeV??this.addressModeV,this.addressModeW=t.addressModeW??this.addressModeW,this.scaleMode=t.scaleMode,this.magFilter=t.magFilter??this.magFilter,this.minFilter=t.minFilter??this.minFilter,this.mipmapFilter=t.mipmapFilter??this.mipmapFilter,this.lodMinClamp=t.lodMinClamp,this.lodMaxClamp=t.lodMaxClamp,this.compare=t.compare,this.maxAnisotropy=t.maxAnisotropy??1}set addressMode(t){this.addressModeU=t,this.addressModeV=t,this.addressModeW=t}get addressMode(){return this.addressModeU}set wrapMode(t){q(et,"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.emit("change",this),this._sharedResourceId=null}_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=kn(t),this._resourceId}destroy(){this.destroyed=!0,this.emit("destroy",this),this.emit("change",this),this.removeAllListeners()}};Vi.defaultOptions={addressMode:"clamp-to-edge",scaleMode:"linear"};let En=Vi;const $i=class Xi extends Mt{constructor(t={}){super(),this.options=t,this.uid=tt("textureSource"),this._resourceType="textureSource",this._resourceId=tt("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.antialias=!1,this._touched=0,this._batchTick=-1,this._textureBindLocation=-1,t={...Xi.defaultOptions,...t},this.label=t.label??"",this.resource=t.resource,this.autoGarbageCollect=t.autoGarbageCollect,this._resolution=t.resolution,t.width?this.pixelWidth=t.width*this._resolution:this.pixelWidth=this.resource?this.resourceWidth??1:1,t.height?this.pixelHeight=t.height*this._resolution:this.pixelHeight=this.resource?this.resourceHeight??1:1,this.width=this.pixelWidth/this._resolution,this.height=this.pixelHeight/this._resolution,this.format=t.format,this.dimension=t.dimensions,this.mipLevelCount=t.mipLevelCount,this.autoGenerateMipmaps=t.autoGenerateMipmaps,this.sampleCount=t.sampleCount,this.antialias=t.antialias,this.alphaMode=t.alphaMode,this.style=new En(Oi(t)),this.destroyed=!1,this._refreshPOT()}get source(){return this}get style(){return this._style}set style(t){var e,i;this.style!==t&&((e=this._style)==null||e.off("change",this._onStyleChange,this),this._style=t,(i=this._style)==null||i.on("change",this._onStyleChange,this),this._onStyleChange())}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.emit("destroy",this),this.emit("change",this),this._style&&(this._style.destroy(),this._style=null),this.uploadMethodId=null,this.resource=null,this.removeAllListeners()}unload(){this._resourceId=tt("resource"),this.emit("change",this),this.emit("unload",this)}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,i){i||(i=this._resolution),t||(t=this.width),e||(e=this.height);const r=Math.round(t*i),n=Math.round(e*i);return this.width=r/i,this.height=n/i,this._resolution=i,this.pixelWidth===r&&this.pixelHeight===n?!1:(this._refreshPOT(),this.pixelWidth=r,this.pixelHeight=n,this.emit("resize",this),this._resourceId=tt("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=Gs(this.pixelWidth)&&Gs(this.pixelHeight)}static test(t){throw new Error("Unimplemented")}};$i.defaultOptions={resolution:1,format:"bgra8unorm",alphaMode:"premultiply-alpha-on-upload",dimensions:"2d",mipLevelCount:1,autoGenerateMipmaps:!1,sampleCount:1,antialias:!1,autoGarbageCollect:!1};let wt=$i;class ms extends wt{constructor(t){const e=t.resource||new Float32Array(t.width*t.height*4);let i=t.format;i||(e instanceof Float32Array?i="rgba32float":e instanceof Int32Array||e instanceof Uint32Array?i="rgba32uint":e instanceof Int16Array||e instanceof Uint16Array?i="rgba16uint":(e instanceof Int8Array,i="bgra8unorm")),super({...t,resource:e,format:i}),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}}ms.extension=W.TextureSource;const Ds=new N;class In{constructor(t,e){this.mapCoord=new N,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,typeof e>"u"?this.clampMargin=t.width<10?0:.5:this.clampMargin=e,this.isSimple=!1,this.texture=t}get texture(){return this._texture}set texture(t){var e;this.texture!==t&&((e=this._texture)==null||e.removeListener("update",this.update,this),this._texture=t,this._texture.addListener("update",this.update,this),this.update())}multiplyUvs(t,e){e===void 0&&(e=t);const i=this.mapCoord;for(let r=0;r<t.length;r+=2){const n=t[r],o=t[r+1];e[r]=n*i.a+o*i.c+i.tx,e[r+1]=n*i.b+o*i.d+i.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 i=t.orig,r=t.trim;r&&(Ds.set(i.width/r.width,0,0,i.height/r.height,-r.x/r.width,-r.y/r.height),this.mapCoord.append(Ds));const n=t.source,o=this.uClampFrame,a=this.clampMargin/n._resolution,h=this.clampOffset/n._resolution;return o[0]=(t.frame.x+a+h)/n.width,o[1]=(t.frame.y+a+h)/n.height,o[2]=(t.frame.x+t.frame.width-a+h)/n.width,o[3]=(t.frame.y+t.frame.height-a+h)/n.height,this.uClampOffset[0]=this.clampOffset/n.pixelWidth,this.uClampOffset[1]=this.clampOffset/n.pixelHeight,this.isSimple=t.frame.width===n.width&&t.frame.height===n.height&&t.rotate===0,!0}}class j extends Mt{constructor({source:t,label:e,frame:i,orig:r,trim:n,defaultAnchor:o,defaultBorders:a,rotate:h,dynamic:c}={}){if(super(),this.uid=tt("texture"),this.uvs={x0:0,y0:0,x1:0,y1:0,x2:0,y2:0,x3:0,y3:0},this.frame=new it,this.noFrame=!1,this.dynamic=!1,this.isTexture=!0,this.label=e,this.source=(t==null?void 0:t.source)??new wt,this.noFrame=!i,i)this.frame.copyFrom(i);else{const{width:l,height:u}=this._source;this.frame.width=l,this.frame.height=u}this.orig=r||this.frame,this.trim=n,this.rotate=h??0,this.defaultAnchor=o,this.defaultBorders=a,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 In(this)),this._textureMatrix}get width(){return this.orig.width}get height(){return this.orig.height}updateUvs(){const{uvs:t,frame:e}=this,{width:i,height:r}=this._source,n=e.x/i,o=e.y/r,a=e.width/i,h=e.height/r;let c=this.rotate;if(c){const l=a/2,u=h/2,p=n+l,d=o+u;c=K.add(c,K.NW),t.x0=p+l*K.uX(c),t.y0=d+u*K.uY(c),c=K.add(c,2),t.x1=p+l*K.uX(c),t.y1=d+u*K.uY(c),c=K.add(c,2),t.x2=p+l*K.uX(c),t.y2=d+u*K.uY(c),c=K.add(c,2),t.x3=p+l*K.uX(c),t.y3=d+u*K.uY(c)}else t.x0=n,t.y0=o,t.x1=n+a,t.y1=o,t.x2=n+a,t.y2=o+h,t.x3=n,t.y3=o+h}destroy(t=!1){this._source&&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 q(et,"Texture.baseTexture is now Texture.source"),this._source}}j.EMPTY=new j({label:"EMPTY",source:new wt({label:"EMPTY"})});j.EMPTY.destroy=Hi;j.WHITE=new j({source:new ms({resource:new Uint8Array([255,255,255,255]),width:1,height:1,alphaMode:"premultiply-alpha-on-upload",label:"WHITE"}),label:"WHITE"});j.WHITE.destroy=Hi;function Rn(s,t,e){const{width:i,height:r}=e.orig,n=e.trim;if(n){const o=n.width,a=n.height;s.minX=n.x-t._x*i,s.maxX=s.minX+o,s.minY=n.y-t._y*r,s.maxY=s.minY+a}else s.minX=-t._x*i,s.maxX=s.minX+i,s.minY=-t._y*r,s.maxY=s.minY+r}const Ls=new N;class gt{constructor(t=1/0,e=1/0,i=-1/0,r=-1/0){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=Ls,this.minX=t,this.minY=e,this.maxX=i,this.maxY=r}isEmpty(){return this.minX>this.maxX||this.minY>this.maxY}get rectangle(){this._rectangle||(this._rectangle=new it);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=Ls,this}set(t,e,i,r){this.minX=t,this.minY=e,this.maxX=i,this.maxY=r}addFrame(t,e,i,r,n){n||(n=this.matrix);const o=n.a,a=n.b,h=n.c,c=n.d,l=n.tx,u=n.ty;let p=this.minX,d=this.minY,x=this.maxX,_=this.maxY,m=o*t+h*e+l,b=a*t+c*e+u;m<p&&(p=m),b<d&&(d=b),m>x&&(x=m),b>_&&(_=b),m=o*i+h*e+l,b=a*i+c*e+u,m<p&&(p=m),b<d&&(d=b),m>x&&(x=m),b>_&&(_=b),m=o*t+h*r+l,b=a*t+c*r+u,m<p&&(p=m),b<d&&(d=b),m>x&&(x=m),b>_&&(_=b),m=o*i+h*r+l,b=a*i+c*r+u,m<p&&(p=m),b<d&&(d=b),m>x&&(x=m),b>_&&(_=b),this.minX=p,this.minY=d,this.maxX=x,this.maxY=_}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,i=this.minY,r=this.maxX,n=this.maxY,{a:o,b:a,c:h,d:c,tx:l,ty:u}=t;let p=o*e+h*i+l,d=a*e+c*i+u;this.minX=p,this.minY=d,this.maxX=p,this.maxY=d,p=o*r+h*i+l,d=a*r+c*i+u,this.minX=p<this.minX?p:this.minX,this.minY=d<this.minY?d:this.minY,this.maxX=p>this.maxX?p:this.maxX,this.maxY=d>this.maxY?d:this.maxY,p=o*e+h*n+l,d=a*e+c*n+u,this.minX=p<this.minX?p:this.minX,this.minY=d<this.minY?d:this.minY,this.maxX=p>this.maxX?p:this.maxX,this.maxY=d>this.maxY?d:this.maxY,p=o*r+h*n+l,d=a*r+c*n+u,this.minX=p<this.minX?p:this.minX,this.minY=d<this.minY?d:this.minY,this.maxX=p>this.maxX?p: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,i,r){return this.minX<t&&(this.minX=t),this.maxX>e&&(this.maxX=e),this.minY<i&&(this.minY=i),this.maxY>r&&(this.maxY=r),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 gt(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,i,r){let n=this.minX,o=this.minY,a=this.maxX,h=this.maxY;r||(r=this.matrix);const c=r.a,l=r.b,u=r.c,p=r.d,d=r.tx,x=r.ty;for(let _=e;_<i;_+=2){const m=t[_],b=t[_+1],w=c*m+u*b+d,A=l*m+p*b+x;n=w<n?w:n,o=A<o?A:o,a=w>a?w:a,h=A>h?A:h}this.minX=n,this.minY=o,this.maxX=a,this.maxY=h}containsPoint(t,e){return this.minX<=t&&this.minY<=e&&this.maxX>=t&&this.maxY>=e}toString(){return`[pixi.js:Bounds minX=${this.minX} minY=${this.minY} maxX=${this.maxX} maxY=${this.maxY} width=${this.width} height=${this.height}]`}copyFrom(t){return this.minX=t.minX,this.minY=t.minY,this.maxX=t.maxX,this.maxY=t.maxY,this}}var Bn={grad:.9,turn:360,rad:360/(2*Math.PI)},Ct=function(s){return typeof s=="string"?s.length>0:typeof s=="number"},st=function(s,t,e){return t===void 0&&(t=0),e===void 0&&(e=Math.pow(10,t)),Math.round(e*s)/e+0},dt=function(s,t,e){return t===void 0&&(t=0),e===void 0&&(e=1),s>e?e:s>t?s:t},Wi=function(s){return(s=isFinite(s)?s%360:0)>0?s:s+360},zs=function(s){return{r:dt(s.r,0,255),g:dt(s.g,0,255),b:dt(s.b,0,255),a:dt(s.a)}},Ee=function(s){return{r:st(s.r),g:st(s.g),b:st(s.b),a:st(s.a,3)}},Gn=/^#([0-9a-f]{3,8})$/i,le=function(s){var t=s.toString(16);return t.length<2?"0"+t:t},ji=function(s){var t=s.r,e=s.g,i=s.b,r=s.a,n=Math.max(t,e,i),o=n-Math.min(t,e,i),a=o?n===t?(e-i)/o:n===e?2+(i-t)/o:4+(t-e)/o:0;return{h:60*(a<0?a+6:a),s:n?o/n*100:0,v:n/255*100,a:r}},qi=function(s){var t=s.h,e=s.s,i=s.v,r=s.a;t=t/360*6,e/=100,i/=100;var n=Math.floor(t),o=i*(1-e),a=i*(1-(t-n)*e),h=i*(1-(1-t+n)*e),c=n%6;return{r:255*[i,a,o,o,h,i][c],g:255*[h,i,i,a,o,o][c],b:255*[o,o,h,i,i,a][c],a:r}},Us=function(s){return{h:Wi(s.h),s:dt(s.s,0,100),l:dt(s.l,0,100),a:dt(s.a)}},Ns=function(s){return{h:st(s.h),s:st(s.s),l:st(s.l),a:st(s.a,3)}},Hs=function(s){return qi((e=(t=s).s,{h:t.h,s:(e*=((i=t.l)<50?i:100-i)/100)>0?2*e/(i+e)*100:0,v:i+e,a:t.a}));var t,e,i},Qt=function(s){return{h:(t=ji(s)).h,s:(r=(200-(e=t.s))*(i=t.v)/100)>0&&r<200?e*i/100/(r<=100?r:200-r)*100:0,l:r/2,a:t.a};var t,e,i,r},Fn=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Dn=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Ln=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,zn=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ts={string:[[function(s){var t=Gn.exec(s);return t?(s=t[1]).length<=4?{r:parseInt(s[0]+s[0],16),g:parseInt(s[1]+s[1],16),b:parseInt(s[2]+s[2],16),a:s.length===4?st(parseInt(s[3]+s[3],16)/255,2):1}:s.length===6||s.length===8?{r:parseInt(s.substr(0,2),16),g:parseInt(s.substr(2,2),16),b:parseInt(s.substr(4,2),16),a:s.length===8?st(parseInt(s.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(s){var t=Ln.exec(s)||zn.exec(s);return t?t[2]!==t[4]||t[4]!==t[6]?null:zs({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(s){var t=Fn.exec(s)||Dn.exec(s);if(!t)return null;var e,i,r=Us({h:(e=t[1],i=t[2],i===void 0&&(i="deg"),Number(e)*(Bn[i]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return Hs(r)},"hsl"]],object:[[function(s){var t=s.r,e=s.g,i=s.b,r=s.a,n=r===void 0?1:r;return Ct(t)&&Ct(e)&&Ct(i)?zs({r:Number(t),g:Number(e),b:Number(i),a:Number(n)}):null},"rgb"],[function(s){var t=s.h,e=s.s,i=s.l,r=s.a,n=r===void 0?1:r;if(!Ct(t)||!Ct(e)||!Ct(i))return null;var o=Us({h:Number(t),s:Number(e),l:Number(i),a:Number(n)});return Hs(o)},"hsl"],[function(s){var t=s.h,e=s.s,i=s.v,r=s.a,n=r===void 0?1:r;if(!Ct(t)||!Ct(e)||!Ct(i))return null;var o=function(a){return{h:Wi(a.h),s:dt(a.s,0,100),v:dt(a.v,0,100),a:dt(a.a)}}({h:Number(t),s:Number(e),v:Number(i),a:Number(n)});return qi(o)},"hsv"]]},Os=function(s,t){for(var e=0;e<t.length;e++){var i=t[e][0](s);if(i)return[i,t[e][1]]}return[null,void 0]},Un=function(s){return typeof s=="string"?Os(s.trim(),ts.string):typeof s=="object"&&s!==null?Os(s,ts.object):[null,void 0]},Ie=function(s,t){var e=Qt(s);return{h:e.h,s:dt(e.s+100*t,0,100),l:e.l,a:e.a}},Re=function(s){return(299*s.r+587*s.g+114*s.b)/1e3/255},Vs=function(s,t){var e=Qt(s);return{h:e.h,s:e.s,l:dt(e.l+100*t,0,100),a:e.a}},es=function(){function s(t){this.parsed=Un(t)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return s.prototype.isValid=function(){return this.parsed!==null},s.prototype.brightness=function(){return st(Re(this.rgba),2)},s.prototype.isDark=function(){return Re(this.rgba)<.5},s.prototype.isLight=function(){return Re(this.rgba)>=.5},s.prototype.toHex=function(){return t=Ee(this.rgba),e=t.r,i=t.g,r=t.b,o=(n=t.a)<1?le(st(255*n)):"","#"+le(e)+le(i)+le(r)+o;var t,e,i,r,n,o},s.prototype.toRgb=function(){return Ee(this.rgba)},s.prototype.toRgbString=function(){return t=Ee(this.rgba),e=t.r,i=t.g,r=t.b,(n=t.a)<1?"rgba("+e+", "+i+", "+r+", "+n+")":"rgb("+e+", "+i+", "+r+")";var t,e,i,r,n},s.prototype.toHsl=function(){return Ns(Qt(this.rgba))},s.prototype.toHslString=function(){return t=Ns(Qt(this.rgba)),e=t.h,i=t.s,r=t.l,(n=t.a)<1?"hsla("+e+", "+i+"%, "+r+"%, "+n+")":"hsl("+e+", "+i+"%, "+r+"%)";var t,e,i,r,n},s.prototype.toHsv=function(){return t=ji(this.rgba),{h:st(t.h),s:st(t.s),v:st(t.v),a:st(t.a,3)};var t},s.prototype.invert=function(){return _t({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},s.prototype.saturate=function(t){return t===void 0&&(t=.1),_t(Ie(this.rgba,t))},s.prototype.desaturate=function(t){return t===void 0&&(t=.1),_t(Ie(this.rgba,-t))},s.prototype.grayscale=function(){return _t(Ie(this.rgba,-1))},s.prototype.lighten=function(t){return t===void 0&&(t=.1),_t(Vs(this.rgba,t))},s.prototype.darken=function(t){return t===void 0&&(t=.1),_t(Vs(this.rgba,-t))},s.prototype.rotate=function(t){return t===void 0&&(t=15),this.hue(this.hue()+t)},s.prototype.alpha=function(t){return typeof t=="number"?_t({r:(e=this.rgba).r,g:e.g,b:e.b,a:t}):st(this.rgba.a,3);var e},s.prototype.hue=function(t){var e=Qt(this.rgba);return typeof t=="number"?_t({h:t,s:e.s,l:e.l,a:e.a}):st(e.h)},s.prototype.isEqual=function(t){return this.toHex()===_t(t).toHex()},s}(),_t=function(s){return s instanceof es?s:new es(s)},Ys=[],Nn=function(s){s.forEach(function(t){Ys.indexOf(t)<0&&(t(es,ts),Ys.push(t))})};function Hn(s,t){var e={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},i={};for(var r in e)i[e[r]]=r;var n={};s.prototype.toName=function(o){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var a,h,c=i[this.toHex()];if(c)return c;if(o!=null&&o.closest){var l=this.toRgb(),u=1/0,p="black";if(!n.length)for(var d in e)n[d]=new s(e[d]).toRgb();for(var x in e){var _=(a=l,h=n[x],Math.pow(a.r-h.r,2)+Math.pow(a.g-h.g,2)+Math.pow(a.b-h.b,2));_<u&&(u=_,p=x)}return p}},t.string.push([function(o){var a=o.toLowerCase(),h=a==="transparent"?"#0000":e[a];return h?new s(h).toRgb():null},"name"])}Nn([Hn]);const Ht=class jt{constructor(t=16777215){this._value=null,this._components=new Float32Array(4),this._components.fill(1),this._int=16777215,this.value=t}get red(){return this._components[0]}get green(){return this._components[1]}get blue(){return this._components[2]}get alpha(){return this._components[3]}setValue(t){return this.value=t,this}set value(t){if(t instanceof jt)this._value=this._cloneSource(t._value),this._int=t._int,this._components.set(t._components);else{if(t===null)throw new Error("Cannot set Color#value to null");(this._value===null||!this._isSourceEqual(this._value,t))&&(this._value=this._cloneSource(t),this._normalize(this._value))}}get value(){return this._value}_cloneSource(t){return typeof t=="string"||typeof t=="number"||t instanceof Number||t===null?t:Array.isArray(t)||ArrayBuffer.isView(t)?t.slice(0):typeof t=="object"&&t!==null?{...t}:t}_isSourceEqual(t,e){const i=typeof t;if(i!==typeof e)return!1;
vendor: 4,608 bytes, line 12
12if(i==="number"||i==="string"||t instanceof Number)return t===e;if(Array.isArray(t)&&Array.isArray(e)||ArrayBuffer.isView(t)&&ArrayBuffer.isView(e))return t.length!==e.length?!1:t.every((n,o)=>n===e[o]);if(t!==null&&e!==null){const n=Object.keys(t),o=Object.keys(e);return n.length!==o.length?!1:n.every(a=>t[a]===e[a])}return t===e}toRgba(){const[t,e,i,r]=this._components;return{r:t,g:e,b:i,a:r}}toRgb(){const[t,e,i]=this._components;return{r:t,g:e,b:i}}toRgbaString(){const[t,e,i]=this.toUint8RgbArray();return`rgba(${t},${e},${i},${this.alpha})`}toUint8RgbArray(t){const[e,i,r]=this._components;return this._arrayRgb||(this._arrayRgb=[]),t||(t=this._arrayRgb),t[0]=Math.round(e*255),t[1]=Math.round(i*255),t[2]=Math.round(r*255),t}toArray(t){this._arrayRgba||(this._arrayRgba=[]),t||(t=this._arrayRgba);const[e,i,r,n]=this._components;return t[0]=e,t[1]=i,t[2]=r,t[3]=n,t}toRgbArray(t){this._arrayRgb||(this._arrayRgb=[]),t||(t=this._arrayRgb);const[e,i,r]=this._components;return t[0]=e,t[1]=i,t[2]=r,t}toNumber(){return this._int}toBgrNumber(){const[t,e,i]=this.toUint8RgbArray();return(i<<16)+(e<<8)+t}toLittleEndianNumber(){const t=this._int;return(t>>16)+(t&65280)+((t&255)<<16)}multiply(t){const[e,i,r,n]=jt._temp.setValue(t)._components;return this._components[0]*=e,this._components[1]*=i,this._components[2]*=r,this._components[3]*=n,this._refreshInt(),this._value=null,this}premultiply(t,e=!0){return e&&(this._components[0]*=t,this._components[1]*=t,this._components[2]*=t),this._components[3]=t,this._refreshInt(),this._value=null,this}toPremultiplied(t,e=!0){if(t===1)return(255<<24)+this._int;if(t===0)return e?0:this._int;let i=this._int>>16&255,r=this._int>>8&255,n=this._int&255;return e&&(i=i*t+.5|0,r=r*t+.5|0,n=n*t+.5|0),(t*255<<24)+(i<<16)+(r<<8)+n}toHex(){const t=this._int.toString(16);return`#${"000000".substring(0,6-t.length)+t}`}toHexa(){const e=Math.round(this._components[3]*255).toString(16);return this.toHex()+"00".substring(0,2-e.length)+e}setAlpha(t){return this._components[3]=this._clamp(t),this}_normalize(t){let e,i,r,n;if((typeof t=="number"||t instanceof Number)&&t>=0&&t<=16777215){const o=t;e=(o>>16&255)/255,i=(o>>8&255)/255,r=(o&255)/255,n=1}else if((Array.isArray(t)||t instanceof Float32Array)&&t.length>=3&&t.length<=4)t=this._clamp(t),[e,i,r,n=1]=t;else if((t instanceof Uint8Array||t instanceof Uint8ClampedArray)&&t.length>=3&&t.length<=4)t=this._clamp(t,0,255),[e,i,r,n=255]=t,e/=255,i/=255,r/=255,n/=255;else if(typeof t=="string"||typeof t=="object"){if(typeof t=="string"){const a=jt.HEX_PATTERN.exec(t);a&&(t=`#${a[2]}`)}const o=_t(t);o.isValid()&&({r:e,g:i,b:r,a:n}=o.rgba,e/=255,i/=255,r/=255)}if(e!==void 0)this._components[0]=e,this._components[1]=i,this._components[2]=r,this._components[3]=n,this._refreshInt();else throw new Error(`Unable to convert color ${t}`)}_refreshInt(){this._clamp(this._components);const[t,e,i]=this._components;this._int=(t*255<<16)+(e*255<<8)+(i*255|0)}_clamp(t,e=0,i=1){return typeof t=="number"?Math.min(Math.max(t,e),i):(t.forEach((r,n)=>{t[n]=Math.min(Math.max(r,e),i)}),t)}static isColorLike(t){return typeof t=="number"||typeof t=="string"||t instanceof Number||t instanceof jt||Array.isArray(t)||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Float32Array||t.r!==void 0&&t.g!==void 0&&t.b!==void 0||t.r!==void 0&&t.g!==void 0&&t.b!==void 0&&t.a!==void 0||t.h!==void 0&&t.s!==void 0&&t.l!==void 0||t.h!==void 0&&t.s!==void 0&&t.l!==void 0&&t.a!==void 0||t.h!==void 0&&t.s!==void 0&&t.v!==void 0||t.h!==void 0&&t.s!==void 0&&t.v!==void 0&&t.a!==void 0}};Ht.shared=new Ht;Ht._temp=new Ht;Ht.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;let ft=Ht;const On={cullArea:null,cullable:!1,cullableChildren:!0};class gs{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){var i;let e;return this._index>0?e=this._pool[--this._index]:e=new this._classType,(i=e.init)==null||i.call(e,t),e}return(t){var e;(e=t.reset)==null||e.call(t),this._pool[this._index++]=t}get totalSize(){return this._count}get totalFree(){return this._index}get totalUsed(){return this._count-this._index}clear(){this._pool.length=0,this._index=0}}class Vn{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 gs(t)),this._poolsByClass.get(t)}stats(){const t={};
12return this._poolsByClass.forEach(e=>{const i=t[e._classType.name]?e._classType.name+e._classType.ID:e._classType.name;t[i]={free:e.totalFree,used:e.totalUsed,size:e.totalSize}}),t}}const At=new Vn,Yn={get isCachedAsTexture(){var s;return!!((s=this.renderGroup)!=null&&s.isCachedAsTexture)},cacheAsTexture(s){typeof s=="boolean"&&s===!1?this.disableRenderGroup():(this.enableRenderGroup(),this.renderGroup.enableCacheAsTexture(s===!0?{}:s))},updateCacheTexture(){var s;(s=this.renderGroup)==null||s.updateCacheTexture()},get cacheAsBitmap(){return this.isCachedAsTexture},set cacheAsBitmap(s){q("v8.6.0","cacheAsBitmap is deprecated, use cacheAsTexture instead."),this.cacheAsTexture(s)}};function $n(s,t,e){const i=s.length;let r;if(t>=i||e===0)return;e=t+e>i?i-t:e;const n=i-e;for(r=t;r<n;++r)s[r]=s[r+e];s.length=n}const Xn={allowChildren:!0,removeChildren(s=0,t){var n;const e=t??this.children.length,i=e-s,r=[];if(i>0&&i<=e){for(let a=e-1;a>=s;a--){const h=this.children[a];h&&(r.push(h),h.parent=null)}$n(this.children,s,e);const o=this.renderGroup||this.parentRenderGroup;o&&o.removeChildren(r);for(let a=0;a<r.length;++a){const h=r[a];(n=h.parentRenderLayer)==null||n.detach(h),this.emit("childRemoved",h,this,a),r[a].emit("removed",this)}return r.length>0&&this._didViewChangeTick++,r}else if(i===0&&this.children.length===0)return r;throw new RangeError("removeChildren: numeric values are outside the acceptable range.")},removeChildAt(s){const t=this.getChildAt(s);return this.removeChild(t)},getChildAt(s){if(s<0||s>=this.children.length)throw new Error(`getChildAt: Index (${s}) does not exist.`);return this.children[s]},setChildIndex(s,t){if(t<0||t>=this.children.length)throw new Error(`The index ${t} supplied is out of bounds ${this.children.length}`);this.getChildIndex(s),this.addChildAt(s,t)},getChildIndex(s){const t=this.children.indexOf(s);if(t===-1)throw new Error("The supplied Container must be a child of the caller");return t},addChildAt(s,t){this.allowChildren||q(et,"addChildAt: Only Containers will be allowed to add children in v8.0.0");const{children:e}=this;if(t<0||t>e.length)throw new Error(`${s}addChildAt: The index ${t} supplied is out of bounds ${e.length}`);if(s.parent){const r=s.parent.children.indexOf(s);if(s.parent===this&&r===t)return s;r!==-1&&s.parent.children.splice(r,1)}t===e.length?e.push(s):e.splice(t,0,s),s.parent=this,s.didChange=!0,s._updateFlags=15;const i=this.renderGroup||this.parentRenderGroup;return i&&i.addChild(s),this.sortableChildren&&(this.sortDirty=!0),this.emit("childAdded",s,this,t),s.emit("added",this),s},swapChildren(s,t){if(s===t)return;const e=this.getChildIndex(s),i=this.getChildIndex(t);this.children[e]=t,this.children[i]=s;const r=this.renderGroup||this.parentRenderGroup;r&&(r.structureDidChange=!0),this._didContainerChangeTick++},removeFromParent(){var s;(s=this.parent)==null||s.removeChild(this)},reparentChild(...s){return s.length===1?this.reparentChildAt(s[0],this.children.length):(s.forEach(t=>this.reparentChildAt(t,this.children.length)),s[0])},reparentChildAt(s,t){if(s.parent===this)return this.setChildIndex(s,t),s;const e=s.worldTransform.clone();s.removeFromParent(),this.addChildAt(s,t);const i=this.worldTransform.clone();return i.invert(),e.prepend(i),s.setFromMatrix(e),s}},Wn={collectRenderables(s,t,e){this.parentRenderLayer&&this.parentRenderLayer!==e||this.globalDisplayStatus<7||!this.includeInBuild||(this.sortableChildren&&this.sortChildren(),this.isSimple?this.collectRenderablesSimple(s,t,e):this.renderGroup?t.renderPipes.renderGroup.addRenderGroup(this.renderGroup,s):this.collectRenderablesWithEffects(s,t,e))},collectRenderablesSimple(s,t,e){const i=this.children,r=i.length;for(let n=0;n<r;n++)i[n].collectRenderables(s,t,e)},collectRenderablesWithEffects(s,t,e){const{renderPipes:i}=t;for(let r=0;r<this.effects.length;r++){const n=this.effects[r];i[n.pipe].push(n,this,s)}this.collectRenderablesSimple(s,t,e);for(let r=this.effects.length-1;r>=0;r--){const n=this.effects[r];i[n.pipe].pop(n,this,s)}}};class $s{constructor(){this.pipe="filter",this.priority=1}destroy(){for(let t=0;t<this.filters.length;t++)this.filters[t].destroy();this.filters=null,this.filterArea=null}}class jn{constructor(){this._effectClasses=[],this._tests=[],this._initialized=!1}init(){this._initialized||(this._initialized=!0,this._effectClasses.forEac
12h(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 i=this._tests[e];if(i.test(t))return At.get(i.maskClass,t)}return t}returnMaskEffect(t){At.return(t)}}const ss=new jn;pt.handleByList(W.MaskEffect,ss._effectClasses);const qn={_maskEffect:null,_maskOptions:{inverse:!1},_filterEffect:null,effects:[],_markStructureAsChanged(){const s=this.renderGroup||this.parentRenderGroup;s&&(s.structureDidChange=!0)},addEffect(s){this.effects.indexOf(s)===-1&&(this.effects.push(s),this.effects.sort((e,i)=>e.priority-i.priority),this._markStructureAsChanged(),this._updateIsSimple())},removeEffect(s){const t=this.effects.indexOf(s);t!==-1&&(this.effects.splice(t,1),this._markStructureAsChanged(),this._updateIsSimple())},set mask(s){const t=this._maskEffect;(t==null?void 0:t.mask)!==s&&(t&&(this.removeEffect(t),ss.returnMaskEffect(t),this._maskEffect=null),s!=null&&(this._maskEffect=ss.getMaskEffect(s),this.addEffect(this._maskEffect)))},setMask(s){this._maskOptions={...this._maskOptions,...s},s.mask&&(this.mask=s.mask),this._markStructureAsChanged()},get mask(){var s;return(s=this._maskEffect)==null?void 0:s.mask},set filters(s){var n;!Array.isArray(s)&&s&&(s=[s]);const t=this._filterEffect||(this._filterEffect=new $s);s=s;const e=(s==null?void 0:s.length)>0,i=((n=t.filters)==null?void 0:n.length)>0,r=e!==i;s=Array.isArray(s)?s.slice(0):s,t.filters=Object.freeze(s),r&&(e?this.addEffect(t):(this.removeEffect(t),t.filters=s??null))},get filters(){var s;return(s=this._filterEffect)==null?void 0:s.filters},set filterArea(s){this._filterEffect||(this._filterEffect=new $s),this._filterEffect.filterArea=s},get filterArea(){var s;return(s=this._filterEffect)==null?void 0:s.filterArea}},Zn={label:null,get name(){return q(et,"Container.name property has been removed, use Container.label instead"),this.label},set name(s){q(et,"Container.name property has been removed, use Container.label instead"),this.label=s},getChildByName(s,t=!1){return this.getChildByLabel(s,t)},getChildByLabel(s,t=!1){const e=this.children;for(let i=0;i<e.length;i++){const r=e[i];if(r.label===s||s instanceof RegExp&&s.test(r.label))return r}if(t)for(let i=0;i<e.length;i++){const n=e[i].getChildByLabel(s,!0);if(n)return n}return null},getChildrenByLabel(s,t=!1,e=[]){const i=this.children;for(let r=0;r<i.length;r++){const n=i[r];(n.label===s||s instanceof RegExp&&s.test(n.label))&&e.push(n)}if(t)for(let r=0;r<i.length;r++)i[r].getChildrenByLabel(s,!0,e);return e}},nt=new gs(N),St=new gs(gt),Kn=new N,Qn={getFastGlobalBounds(s,t){t||(t=new gt),t.clear(),this._getGlobalBoundsRecursive(!!s,t,this.parentRenderLayer),t.isValid||t.set(0,0,0,0);const e=this.renderGroup||this.parentRenderGroup;return t.applyMatrix(e.worldTransform),t},_getGlobalBoundsRecursive(s,t,e){let i=t;if(s&&this.parentRenderLayer&&this.parentRenderLayer!==e||this.localDisplayStatus!==7||!this.measurable)return;const r=!!this.effects.length;if((this.renderGroup||r)&&(i=St.get().clear()),this.boundsArea)t.addRect(this.boundsArea,this.worldTransform);else{if(this.renderPipeId){const o=this.bounds;i.addFrame(o.minX,o.minY,o.maxX,o.maxY,this.groupTransform)}const n=this.children;for(let o=0;o<n.length;o++)n[o]._getGlobalBoundsRecursive(s,i,e)}if(r){let n=!1;const o=this.renderGroup||this.parentRenderGroup;for(let a=0;a<this.effects.length;a++)this.effects[a].addBounds&&(n||(n=!0,i.applyMatrix(o.worldTransform)),this.effects[a].addBounds(i,!0));n&&(i.applyMatrix(o.worldTransform.copyTo(Kn).invert()),t.addBounds(i,this.relativeGroupTransform)),t.addBounds(i),St.return(i)}else this.renderGroup&&(t.addBounds(i,this.relativeGroupTransform),St.return(i))}};function Zi(s,t,e){e.clear();let i,r;return s.parent?t?i=s.parent.worldTransform:(r=nt.get().identity(),i=xs(s,r)):i=N.IDENTITY,Ki(s,e,i,t),r&&nt.return(r),e.isValid||e.set(0,0,0,0),e}function Ki(s,t,e,i){var a,h;if(!s.visible||!s.measurable)return;let r;i?r=s.worldTransform:(s.updateLocalTransform(),r=nt.get(),r.appendFrom(s.localTransform,e));const n=t,o=!!s.effects.length;if(o&&(t=St.get().clear()),s.boundsArea)t.addRect(s.boundsArea,r);else{s.bounds&&(t.matrix=r,t.addBounds(s.bounds));for(let c=0;c<s.children.length;c++)Ki(s.children[c],t,r,i)}if(o){for(let c=0;c<s.effects.length;c++)(h=(a=s.effects[c]).addBounds)==null||h.call(a,t);n.addBounds(t,N.IDENTITY),St.return(t)}i||nt.return(r)}function xs(s,t){const e=s.parent;return e&&(xs(e,t),e.updateLocalTransform(),t.append(e.localTransform)),t}function Qi(s,t){if(s===16777215||!t)return t;if(t===16777215||!s)return s;const e=s>>16&255,i=s>>8&255,r=s&255,n=t>>16&255,o=t>>8&255,a=t&255,h=e*n/255|0,c=i*o/255|0,l=r*a/255|0;
vendor: 10,916 bytes, line 12
12return(h<<16)+(c<<8)+l}const Xs=16777215;function Ws(s,t){return s===Xs?t:t===Xs?s:Qi(s,t)}function ye(s){return((s&255)<<16)+(s&65280)+(s>>16&255)}const Jn={getGlobalAlpha(s){if(s)return this.renderGroup?this.renderGroup.worldAlpha:this.parentRenderGroup?this.parentRenderGroup.worldAlpha*this.alpha:this.alpha;let t=this.alpha,e=this.parent;for(;e;)t*=e.alpha,e=e.parent;return t},getGlobalTransform(s,t){if(t)return s.copyFrom(this.worldTransform);this.updateLocalTransform();const e=xs(this,nt.get().identity());return s.appendFrom(this.localTransform,e),nt.return(e),s},getGlobalTint(s){if(s)return this.renderGroup?ye(this.renderGroup.worldColor):this.parentRenderGroup?ye(Ws(this.localColor,this.parentRenderGroup.worldColor)):this.tint;let t=this.localColor,e=this.parent;for(;e;)t=Ws(t,e.localColor),e=e.parent;return ye(t)}};let Be=0;const js=500;function ct(...s){Be!==js&&(Be++,Be===js?console.warn("PixiJS Warning: too many warnings, no more warnings will be reported to the console by PixiJS."):console.warn("PixiJS Warning: ",...s))}function Ji(s,t,e){return t.clear(),e||(e=N.IDENTITY),tr(s,t,e,s,!0),t.isValid||t.set(0,0,0,0),t}function tr(s,t,e,i,r){var h,c;let n;if(r)n=nt.get(),n=e.copyTo(n);else{if(!s.visible||!s.measurable)return;s.updateLocalTransform();const l=s.localTransform;n=nt.get(),n.appendFrom(l,e)}const o=t,a=!!s.effects.length;if(a&&(t=St.get().clear()),s.boundsArea)t.addRect(s.boundsArea,n);else{s.renderPipeId&&(t.matrix=n,t.addBounds(s.bounds));const l=s.children;for(let u=0;u<l.length;u++)tr(l[u],t,n,i,!1)}if(a){for(let l=0;l<s.effects.length;l++)(c=(h=s.effects[l]).addLocalBounds)==null||c.call(h,t,i);o.addBounds(t,N.IDENTITY),St.return(t)}nt.return(n)}function er(s,t){const e=s.children;for(let i=0;i<e.length;i++){const r=e[i],n=r.uid,o=(r._didViewChangeTick&65535)<<16|r._didContainerChangeTick&65535,a=t.index;(t.data[a]!==n||t.data[a+1]!==o)&&(t.data[t.index]=n,t.data[t.index+1]=o,t.didChange=!0),t.index=a+2,r.children.length&&er(r,t)}return t.didChange}const to=new N,eo={_localBoundsCacheId:-1,_localBoundsCacheData:null,_setWidth(s,t){const e=Math.sign(this.scale.x)||1;t!==0?this.scale.x=s/t*e:this.scale.x=e},_setHeight(s,t){const e=Math.sign(this.scale.y)||1;t!==0?this.scale.y=s/t*e:this.scale.y=e},getLocalBounds(){this._localBoundsCacheData||(this._localBoundsCacheData={data:[],index:1,didChange:!1,localBounds:new gt});const s=this._localBoundsCacheData;return s.index=1,s.didChange=!1,s.data[0]!==this._didViewChangeTick&&(s.didChange=!0,s.data[0]=this._didViewChangeTick),er(this,s),s.didChange&&Ji(this,s.localBounds,to),s.localBounds},getBounds(s,t){return Zi(this,s,t||new gt)}},so={_onRender:null,set onRender(s){const t=this.renderGroup||this.parentRenderGroup;if(!s){this._onRender&&(t==null||t.removeOnRender(this)),this._onRender=null;return}this._onRender||t==null||t.addOnRender(this),this._onRender=s},get onRender(){return this._onRender}},io={_zIndex:0,sortDirty:!1,sortableChildren:!1,get zIndex(){return this._zIndex},set zIndex(s){this._zIndex!==s&&(this._zIndex=s,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(ro))}};function ro(s,t){return s._zIndex-t._zIndex}const no={getGlobalPosition(s=new rt,t=!1){return this.parent?this.parent.toGlobal(this._position,s,t):(s.x=this._position.x,s.y=this._position.y),s},toGlobal(s,t,e=!1){const i=this.getGlobalTransform(nt.get(),e);return t=i.apply(s,t),nt.return(i),t},toLocal(s,t,e,i){t&&(s=t.toGlobal(s,e,i));const r=this.getGlobalTransform(nt.get(),i);return e=r.applyInverse(s,e),nt.return(r),e}};class sr{constructor(){this.uid=tt("instructionSet"),this.instructions=[],this.instructionSize=0,this.renderables=[],this.gcTick=0}reset(){this.instructionSize=0}add(t){this.instructions[this.instructionSize++]=t}log(){this.instructions.length=this.instructionSize,console.table(this.instructions,["type","action"])}}let oo=0;class ao{constructor(t){this._poolKeyHash=Object.create(null),this._texturePool={},this.textureOptions=t||{},this.enableFullScreen=!1}createTexture(t,e,i){const r=new wt({...this.textureOptions,width:t,height:e,resolution:1,antialias:i,autoGarbageCollect:!1});return new j({source:r,label:`texturePool_${oo++}`})}getOptimalTexture(t,e,i=1,r){let n=Math.ceil(t*i-1e-6),o=Math.ceil(e*i-1e-6);n=Bs(n),o=Bs(o);const a=(n<<17)+(o<<1)+(r?1:0);this._texturePool[a]||(this._texturePool[a]=[]);let h=this._texturePool[a].pop();return h||(h=this.createTexture(n,o,r)),h.source._resolution=i,h.source.width=n/i,h.source.height=o/i,h.source.pixelWidth=n,h.source.pixelHeight=o,h.frame.x=0,h.frame.y=0,h.frame.width=t,h.frame.height=e,h.updateUvs(),this._poolKeyHash[h.uid]=a,h}getSameSizeTexture(t,e=!1){const i=t.source;return this.getOptimalTexture(t.width,t.height,i._resolution,e)}returnTexture(t){const e=this._poolKeyHash[t.uid];this._texturePool[e].push(t)}clear(t){if(t=t!==!1,t)for(const e in this._texturePool){const i=this._texturePool[e];if(i)for(let r=0;r<i.length;r++)i[r].destroy(!0)}this._texturePool={}}}const ho=new ao;class lo{constructor(){this.renderPipeId="renderGroup",this.root=null,this.canBundle=!1,this.renderGroupParent=null,this.renderGroupChildren=[],this.worldTransform=new N,this.worldColorAlpha=4294967295,this.worldColor=16777215,this.worldAlpha=1,this.childrenToUpdate=Object.create(null),this.updateTick=0,this.gcTick=0,this.childrenRenderablesToUpdate={list:[],index:0},this.structureDidChange=!0,this.instructionSet=new sr,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 i=0;i<e.length;i++){const r=e[i];r._updateFlags=15,this.addChild(r)}}enableCacheAsTexture(t={}){this.textureOptions=t,this.isCachedAsTexture=!0,this.textureNeedsUpdate=!0}disableCacheAsTexture(){this.isCachedAsTexture=!1,this.texture&&(ho.returnTexture(this.texture),this.texture=null)}updateCacheTexture(){this.textureNeedsUpdate=!0}reset(){this.renderGroupChildren.length=0;for(const t in this.childrenToUpdate){const e=this.childrenToUpdate[t];e.list.fill(null),e.index=0}this.childrenRenderablesToUpdate.index=0,this.childrenRenderablesToUpdate.list.fill(null),this.root=null,this.updateTick=0,this.structureDidChange=!0,this._onRenderContainers.length=0,this.renderGroupParent=null,this.disableCacheAsTexture()}get localTransform(){return this.root.localTransform}addRenderGroupChild(t){t.renderGroupParent&&t.renderGroupParent._removeRenderGroupChild(t),t.renderGroupParent=this,this.renderGroupChildren.push(t)}_removeRenderGroupChild(t){const e=this.renderGroupChildren.indexOf(t);e>-1&&this.renderGroupChildren.splice(e,1),t.renderGroupParent=null}addChild(t){if(this.structureDidChange=!0,t.parentRenderGroup=this,t.updateTick=-1,t.parent===this.root?t.relativeRenderGroupDepth=1:t.relativeRenderGroupDepth=t.parent.relativeRenderGroupDepth+1,t.didChange=!0,this.onChildUpdate(t),t.renderGroup){this.addRenderGroupChild(t.renderGroup);return}t._onRender&&this.addOnRender(t);const e=t.children;for(let i=0;i<e.length;i++)this.addChild(e[i])}removeChild(t){if(this.structureDidChange=!0,t._onRender&&(t.renderGroup||this.removeOnRender(t)),t.parentRenderGroup=null,t.renderGroup){this._removeRenderGroupChild(t.renderGroup);return}const e=t.children;for(let i=0;i<e.length;i++)this.removeChild(e[i])}removeChildren(t){for(let e=0;e<t.length;e++)this.removeChild(t[e])}onChildUpdate(t){let e=this.childrenToUpdate[t.relativeRenderGroupDepth];e||(e=this.childrenToUpdate[t.relativeRenderGroupDepth]={index:0,list:[]}),e.list[e.index++]=t}updateRenderable(t){t.globalDisplayStatus<7||(this.instructionSet.renderPipes[t.renderPipeId].updateRenderable(t),t.didViewUpdate=!1)}onChildViewUpdate(t){this.childrenRenderablesToUpdate.list[this.childrenRenderablesToUpdate.index++]=t}get isRenderable(){return this.root.localDisplayStatus===7&&this.worldAlpha>0}addOnRender(t){this._onRenderContainers.push(t)}removeOnRender(t){this._onRenderContainers.splice(this._onRenderContainers.indexOf(t),1)}runOnRender(t){for(let e=0;e<this._onRenderContainers.length;e++)this._onRenderContainers[e]._onRender(t)}destroy(){this.disableCacheAsTexture(),this.renderGroupParent=null,this.root=null,this.childrenRenderablesToUpdate=null,this.childrenToUpdate=null,this.renderGroupChildren=null,this._onRenderContainers=null,this.instructionSet=null}getChildren(t=[]){const e=this.root.children;for(let i=0;i<e.length;i++)this._getChildren(e[i],t);return t}_getChildren(t,e=[]){if(e.push(t),t.renderGroup)return e;const i=t.children;for(let r=0;r<i.length;r++)this._getChildren(i[r],e);return e}invalidateMatrices(){this._matrixDirty=7}get inverseWorldTransform(){return(this._matrixDirty&1)===0?this._inverseWorldTransform:(this._matrixDirty&=-2,this._inverseWorldTransform||(this._inverseWorldTransform=new N),this._inverseWorldTransform.copyFrom(this.worldTransform).invert())}get textureOffsetInverseTransform(){return(this._matrixDirty&2)===0?this._textureOffsetInverseTransform:(this._matrixDirty&=-3,this._textureOffsetInverseTransform||(this._textureOffsetInverseTransform=new N),this._textureOffsetInverseTransform.copyFrom(this.inverseWorldTransform).translate(-this._textureBounds.x,-this._textureBounds.y))}get inverseParentTextureTransform(){if((this._matrixDirty&4)===0)return this._inverseParentTextureTransform;this._matrixDirty&=-5;const t=this._parentCacheAsTextureRenderGroup;return t?(this._inverseParentTextureTransform||(this._inverseParentTextureTransform=new N),this._inverseParentTextureTransform.copyFrom(this.worldTransform).prepend(t.inverseWorldTransform).translate(-t._textureBounds.x,-t._textureBounds.y)):this.worldTransform}get cacheToLocalTransform(){return this._parentCacheAsTextureRenderGroup?this._parentCacheAsTextureRenderGroup.textureOffsetInverseTransform:null}}function co(s,t,e={}){for(const i in t)!e[i]&&t[i]!==void 0&&(s[i]=t[i])}const Ge=new lt(null),Fe=new lt(null),De=new lt(null,1,1),qs=1,uo=2,Le=4;class kt extends Mt{constructor(t={}){var e,i;super(),this.uid=tt("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.updateTick=-1,this.localTransform=new N,this.relativeGroupTransform=new N,this.groupTransform=this.relativeGroupTransform,this.destroyed=!1,this._position=new lt(this,0,0),this._scale=De,this._pivot=Fe,this._skew=Ge,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.localBlendM
vendor: 4,439 bytes, line 12
12ode="inherit",this.groupBlendMode="normal",this.localDisplayStatus=7,this.globalDisplayStatus=7,this._didContainerChangeTick=0,this._didViewChangeTick=0,this._didLocalTransformChangeId=-1,this.effects=[],co(this,t,{children:!0,parent:!0,effects:!0}),(e=t.children)==null||e.forEach(r=>this.addChild(r)),(i=t.parent)==null||i.addChild(this)}static mixin(t){q("8.8.0","Container.mixin is deprecated, please use extensions.mixin instead."),pt.mixin(kt,t)}set _didChangeId(t){this._didViewChangeTick=t>>12&4095,this._didContainerChangeTick=t&4095}get _didChangeId(){return this._didContainerChangeTick&4095|(this._didViewChangeTick&4095)<<12}addChild(...t){if(this.allowChildren||q(et,"addChild: Only Containers will be allowed to add children in v8.0.0"),t.length>1){for(let r=0;r<t.length;r++)this.addChild(t[r]);return t[0]}const e=t[0],i=this.renderGroup||this.parentRenderGroup;return e.parent===this?(this.children.splice(this.children.indexOf(e),1),this.children.push(e),i&&(i.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,i&&i.addChild(e),this.emit("childAdded",e,this,this.children.length-1),e.emit("added",this),this._didViewChangeTick++,e._zIndex!==0&&e.depthOfChildModified(),e)}removeChild(...t){if(t.length>1){for(let r=0;r<t.length;r++)this.removeChild(t[r]);return t[0]}const e=t[0],i=this.children.indexOf(e);return i>-1&&(this._didViewChangeTick++,this.children.splice(i,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,i),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==null||t.removeChild(this),this.renderGroup=At.get(lo,this),this.groupTransform=N.IDENTITY,t==null||t.addChild(this),this._updateIsSimple()}disableRenderGroup(){if(!this.renderGroup)return;const t=this.parentRenderGroup;t==null||t.removeChild(this),At.return(this.renderGroup),this.renderGroup=null,this.groupTransform=this.relativeGroupTransform,t==null||t.addChild(this),this._updateIsSimple()}_updateIsSimple(){this.isSimple=!this.renderGroup&&this.effects.length===0}get worldTransform(){return this._worldTransform||(this._worldTransform=new N),this.renderGroup?this._worldTransform.copyFrom(this.renderGroup.worldTransform):this.parentRenderGroup&&this._worldTransform.appendFrom(this.relativeGroupTransform,this.parentRenderGroup.worldTransform),this._worldTransform}get x(){return this._position.x}set x(t){this._position.x=t}get y(){return this._position.y}set y(t){this._position.y=t}get position(){return this._position}set position(t){this._position.copyFrom(t)}get rotation(){return this._rotation}set rotation(t){this._rotation!==t&&(this._rotation=t,this._onUpdate(this._skew))}get angle(){return this.rotation*Cn}set angle(t){this.rotation=t*An}get pivot(){return this._pivot===Fe&&(this._pivot=new lt(this,0,0)),this._pivot}set pivot(t){this._pivot===Fe&&(this._pivot=new lt(this,0,0)),typeof t=="number"?this._pivot.set(t):this._pivot.copyFrom(t)}get skew(){return this._skew===Ge&&(this._skew=new lt(this,0,0)),this._skew}set skew(t){this._skew===Ge&&(this._skew=new lt(this,0,0)),this._skew.copyFrom(t)}get scale(){return this._scale===De&&(this._scale=new lt(this,1,1)),this._scale}set scale(t){this._scale===De&&(this._scale=new lt(this,0,0)),typeof t=="number"?this._scale.set(t):this._scale.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 i=this.getLocalBounds();typeof t=="object"?(e=t.height??t.width,t=t.width):e??(e=t),t!==void 0&&this._setWi
vendor: 34,859 bytes, line 12
12dth(t,i.width),e!==void 0&&this._setHeight(e,i.height)}_updateSkew(){const t=this._rotation,e=this._skew;this._cx=Math.cos(t+e._y),this._sx=Math.sin(t+e._y),this._cy=-Math.sin(t-e._x),this._sy=Math.cos(t-e._x)}updateTransform(t){return this.position.set(typeof t.x=="number"?t.x:this.position.x,typeof t.y=="number"?t.y:this.position.y),this.scale.set(typeof t.scaleX=="number"?t.scaleX||1:this.scale.x,typeof t.scaleY=="number"?t.scaleY||1:this.scale.y),this.rotation=typeof t.rotation=="number"?t.rotation:this.rotation,this.skew.set(typeof t.skewX=="number"?t.skewX:this.skew.x,typeof t.skewY=="number"?t.skewY:this.skew.y),this.pivot.set(typeof t.pivotX=="number"?t.pivotX:this.pivot.x,typeof t.pivotY=="number"?t.pivotY:this.pivot.y),this}setFromMatrix(t){t.decompose(this)}updateLocalTransform(){const t=this._didContainerChangeTick;if(this._didLocalTransformChangeId===t)return;this._didLocalTransformChangeId=t;const e=this.localTransform,i=this._scale,r=this._pivot,n=this._position,o=i._x,a=i._y,h=r._x,c=r._y;e.a=this._cx*o,e.b=this._sx*o,e.c=this._cy*a,e.d=this._sy*a,e.tx=n._x-(h*e.a+c*e.c),e.ty=n._y-(h*e.b+c*e.d)}set alpha(t){t!==this.localAlpha&&(this.localAlpha=t,this._updateFlags|=qs,this._onUpdate())}get alpha(){return this.localAlpha}set tint(t){const i=ft.shared.setValue(t??16777215).toBgrNumber();i!==this.localColor&&(this.localColor=i,this._updateFlags|=qs,this._onUpdate())}get tint(){return ye(this.localColor)}set blendMode(t){this.localBlendMode!==t&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=uo,this.localBlendMode=t,this._onUpdate())}get blendMode(){return this.localBlendMode}get visible(){return!!(this.localDisplayStatus&2)}set visible(t){const e=t?2:0;(this.localDisplayStatus&2)!==e&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=Le,this.localDisplayStatus^=2,this._onUpdate())}get culled(){return!(this.localDisplayStatus&4)}set culled(t){const e=t?0:4;(this.localDisplayStatus&4)!==e&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=Le,this.localDisplayStatus^=4,this._onUpdate())}get renderable(){return!!(this.localDisplayStatus&1)}set renderable(t){const e=t?1:0;(this.localDisplayStatus&1)!==e&&(this._updateFlags|=Le,this.localDisplayStatus^=1,this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._onUpdate())}get isRenderable(){return this.localDisplayStatus===7&&this.groupAlpha>0}destroy(t=!1){var r;if(this.destroyed)return;this.destroyed=!0;let e;if(this.children.length&&(e=this.removeChildren(0,this.children.length)),this.removeFromParent(),this.parent=null,this._maskEffect=null,this._filterEffect=null,this.effects=null,this._position=null,this._scale=null,this._pivot=null,this._skew=null,this.emit("destroyed",this),this.removeAllListeners(),(typeof t=="boolean"?t:t==null?void 0:t.children)&&e)for(let n=0;n<e.length;++n)e[n].destroy(t);(r=this.renderGroup)==null||r.destroy(),this.renderGroup=null}}pt.mixin(kt,Xn,Qn,no,so,eo,qn,Zn,io,On,Yn,Jn,Wn);class ir extends kt{constructor(t){super(t),this.canBundle=!0,this.allowChildren=!1,this._roundPixels=0,this._lastUsed=-1,this._bounds=new gt(0,1,0,0),this._boundsDirty=!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:i,y:r}=t;return i>=e.minX&&i<=e.maxX&&r>=e.minY&&r<=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)}destroy(t){super.destroy(t),this._bounds=null}collectRenderablesSimple(t,e,i){const{renderPipes:r,renderableGC:n}=e;r.blendMode.setBlendMode(this,this.groupBlendMode,t),r[this.renderPipeId].addRenderable(this,t),n.addRenderable(this),this.didViewUpdate=!1;const a=this.children,h=a.length;for(let c=0;c<h;c++)a[c].collectRenderables(t,e,i)}}class ee extends ir{constructor(t=j.EMPTY){t instanceof j&&(t={texture:t});const{texture:e=j.EMPTY,anchor:i,roundPixels:r,width:n,height:o,...a}=t;super({label:"Sprite",...a}),this.renderPipeId="sprite",this.batched=!0,this._visualBounds={minX:0,maxX:1,minY:0,maxY:0},this._anchor=new lt({_onUpdate:()=>{this.onViewUpdate()}}),i?this.anchor=i:e.defaultAnchor&&(this.anchor=e.defaultAnchor),this.texture=e,this.allowChildren=!1,this.roundPixels=r??!1,n!==void 0&&(this.width=n),o!==void 0&&(this.height=o)}static from(t,e=!1){return t instanceof j?new ee(t):new ee(j.from(t,e))}set texture(t){t||(t=j.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 Rn(this._visualBounds,this._anchor,this._texture),this._visualBounds}get sourceBounds(){return q("8.6.1","Sprite.sourceBounds is deprecated, use visualBounds instead."),this.visualBounds}updateBounds(){const t=this._anchor,e=this._texture,i=this._bounds,{width:r,height:n}=e.orig;i.minX=-t._x*r,i.maxX=i.minX+r,i.minY=-t._y*n,i.maxY=i.minY+n}destroy(t=!1){if(super.destroy(t),typeof t=="boolean"?t:t==null?void 0:t.texture){const i=typeof t=="boolean"?t:t==null?void 0:t.textureSource;this._texture.destroy(i)}this._texture=null,this._visualBounds=null,this._bounds=null,this._anchor=null}get anchor(){return this._anchor}set anchor(t){typeof t=="number"?this._anchor.set(t):this._anchor.copyFrom(t)}get width(){return Math.abs(this.scale.x)*this._texture.orig.width}set width(t){this._setWidth(t,this._texture.orig.width),this._width=t}get height(){return Math.abs(this.scale.y)*this._texture.orig.height}set height(t){this._setHeight(t,this._texture.orig.height),this._height=t}getSize(t){return t||(t={}),t.width=Math.abs(this.scale.x)*this._texture.orig.width,t.height=Math.abs(this.scale.y)*this._texture.orig.height,t}setSize(t,e){typeof t=="object"?(e=t.height??t.width,t=t.width):e??(e=t),t!==void 0&&this._setWidth(t,this._texture.orig.width),e!==void 0&&this._setHeight(e,this._texture.orig.height)}}const fo=new gt;function rr(s,t,e){const i=fo;s.measurable=!0,Zi(s,e,i),t.addBoundsMask(i),s.measurable=!1}function nr(s,t,e){const i=St.get();s.measurable=!0;const r=nt.get().identity(),n=or(s,e,r);Ji(s,i,n),s.measurable=!1,t.addBoundsMask(i),nt.return(r),St.return(i)}function or(s,t,e){return s?(s!==t&&(or(s.parent,t,e),s.updateLocalTransform(),e.append(s.localTransform)),e):(ct("Mask bounds, renderable is not inside the root container"),e)}class ar{constructor(t){this.priority=0,this.inverse=!1,this.pipe="alphaMask",t!=null&&t.mask&&this.init(t.mask)}init(t){this.mask=t,this.renderMaskToTexture=!(t instanceof ee),this.mask.renderable=this.renderMaskToTexture,this.mask.includeInBuild=!this.renderMaskToTexture,this.mask.measurable=!1}reset(){this.mask.measurable=!0,this.mask=null}addBounds(t,e){this.inverse||rr(this.mask,t,e)}addLocalBounds(t,e){nr(this.mask,t,e)}containsPoint(t,e){const i=this.mask;return e(i,t)}destroy(){this.reset()}static test(t){return t instanceof ee}}ar.extension=W.MaskEffect;class hr{constructor(t){this.priority=0,this.pipe="colorMask",t!=null&&t.mask&&this.init(t.mask)}init(t){this.mask=t}destroy(){}static test(t){return typeof t=="number"}}hr.extension=W.MaskEffect;class lr{constructor(t){this.priority=0,this.pipe="stencilMask",t!=null&&t.mask&&this.init(t.mask)}init(t){this.mask=t,this.mask.includeInBuild=!1,this.mask.measurable=!1}reset(){this.mask.measurable=!0,this.mask.includeInBuild=!0,this.mask=null}addBounds(t,e){rr(this.mask,t,e)}addLocalBounds(t,e){nr(this.mask,t,e)}containsPoint(t,e){const i=this.mask;return e(i,t)}destroy(){this.reset()}static test(t){return t instanceof kt}}lr.extension=W.MaskEffect;const po={createCanvas:(s,t)=>{const e=document.createElement("canvas");return e.width=s,e.height=t,e},getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(s,t)=>fetch(s,t),parseXML:s=>new DOMParser().parseFromString(s,"text/xml")};let Zs=po;const Tt={get(){return Zs},set(s){Zs=s}};class cr extends wt{constructor(t){t.resource||(t.resource=Tt.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,i=this._resolution){const r=super.resize(t,e,i);return r&&this.resizeCanvas(),r}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"))}}cr.extension=W.TextureSource;class ve extends wt{constructor(t){if(t.resource&&globalThis.HTMLImageElement&&t.resource instanceof HTMLImageElement){const e=Tt.get().createCanvas(t.resource.width,t.resource.height);e.getContext("2d").drawImage(t.resource,0,0,t.resource.width,t.resource.height),t.resource=e,ct("ImageSource: Image element passed, converting to canvas. Use CanvasSource instead.")}super(t),this.uploadMethodId="image",this.autoGarbageCollect=!0}static test(t){return globalThis.HTMLImageElement&&t instanceof HTMLImageElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap||globalThis.VideoFrame&&t instanceof VideoFrame}}ve.extension=W.TextureSource;var is=(s=>(s[s.INTERACTION=50]="INTERACTION",s[s.HIGH=25]="HIGH",s[s.NORMAL=0]="NORMAL",s[s.LOW=-25]="LOW",s[s.UTILITY=-50]="UTILITY",s))(is||{});class ze{constructor(t,e=null,i=0,r=!1){this.next=null,this.previous=null,this._destroyed=!1,this._fn=t,this._context=e,this.priority=i,this._once=r}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 ur=class ht{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 ze(null,null,1/0),this.deltaMS=1/ht.targetFPMS,this.elapsedMS=1/ht.targetFPMS,this._tick=t=>{this._requestId=null,this.started&&(this.update(t),this.started&&this._requestId===null&&this._head.next&&(this._requestId=requestAnimationFrame(this._tick)))}}_requestIfNeeded(){this._requestId===null&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))}_cancelIfNeeded(){this._requestId!==null&&(cancelAnimationFrame(this._requestId),this._requestId=null)}_startIfPossible(){this.started?this._requestIfNeeded():this.autoStart&&this.start()}add(t,e,i=is.NORMAL){return this._addListener(new ze(t,e,i))}addOnce(t,e,i=is.NORMAL){return this._addListener(new ze(t,e,i,!0))}_addListener(t){let e=this._head.next,i=this._head;if(!e)t.connect(i);else{for(;e;){if(t.priority>e.priority){t.connect(i);break}i=e,e=e.next}t.previous||t.connect(i)}return this._startIfPossible(),this}remove(t,e){let i=this._head.next;for(;i;)i.match(t,e)?i=i.destroy():i=i.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let t=0,e=this._head;for(;e=e.next;)t++;return t}start(){this.started||(this.started=!0,this._requestIfNeeded())}stop(){this.started&&(this.started=!1,this._cancelIfNeeded())}destroy(){if(!this._protected){this.stop();let t=this._head.next;for(;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}}update(t=performance.now()){let e;if(t>this.lastTime){if(e=this.elapsedMS=t-this.lastTime,e>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS){const n=t-this._lastFrame|0;if(n<this._minElapsedMS)return;this._lastFrame=t-n%this._minElapsedMS}this.deltaMS=e,this.deltaTime=this.deltaMS*ht.targetFPMS;const i=this._head;let r=i.next;for(;r;)r=r.emit(this);i.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=t}get FPS(){return 1e3/this.elapsedMS}get minFPS(){return 1e3/this._maxElapsedMS}set minFPS(t){const e=Math.min(this.maxFPS,t),i=Math.min(Math.max(0,e)/1e3,ht.targetFPMS);this._maxElapsedMS=1/i}get maxFPS(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0}set maxFPS(t){if(t===0)this._minElapsedMS=0;else{const e=Math.max(this.minFPS,t);this._minElapsedMS=1/(e/1e3)}}static get shared(){if(!ht._shared){const t=ht._shared=new ht;t.autoStart=!0,t._protected=!0}return ht._shared}static get system(){if(!ht._system){const t=ht._system=new ht;t.autoStart=!0,t._protected=!0}return ht._system}};ur.targetFPMS=.06;let ce=ur,Ue;async function mo(){return Ue??(Ue=(async()=>{var o;const t=document.createElement("canvas").getContext("webgl");if(!t)return"premultiply-alpha-on-upload";const e=await new Promise(a=>{const h=document.createElement("video");h.onloadeddata=()=>a(h),h.onerror=()=>a(null),h.autoplay=!1,h.crossOrigin="anonymous",h.preload="auto",h.src="data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=",h.load()});if(!e)return"premultiply-alpha-on-upload";const i=t.createTexture();t.bindTexture(t.TEXTURE_2D,i);const r=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,r),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,i,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 n=new Uint8Array(4);return t.readPixels(0,0,1,1,t.RGBA,t.UNSIGNED_BYTE,n),t.deleteFramebuffer(r),t.deleteTexture(i),(o=t.getExtension("WEBGL_lose_context"))==null||o.loseContext(),n[0]<=n[3]?"premultiplied-alpha":"premultiply-alpha-on-upload"})()),Ue}const Ae=class dr extends wt{constructor(t){super(t),this.isReady=!1,this.uploadMethodId="video",t={...dr.defaultOptions,...t},this._autoUpdate=!0,this._isConnectedToTicker=!1,this._updateFPS=t.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=t.autoPlay!==!1,this.alphaMode=t.alphaMode??"premultiply-alpha-on-upload",this._videoFrameRequestCallback=this._videoFrameRequestCallback.bind(this),this._videoFrameRequestCallbackHandle=null,this._load=null,this._resolve=null,this._reject=null,this._onCanPlay=this._onCanPlay.bind(this),this._onCanPlayThrough=this._onCanPlayThrough.bind(this),this._onError=this._onError.bind(this),this._onPlayStart=this._onPlayStart.bind(this),this._onPlayStop=this._onPlayStop.bind(this),this._onSeeked=this._onSeeked.bind(this),t.autoLoad!==!1&&this.load()}updateFrame(){if(!this.destroyed){if(this._updateFPS){const t=ce.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 mo(),this._load=new Promise((i,r)=>{this.isValid?i(this):(this._resolve=i,this._reject=r,e.preloadTimeoutMs!==void 0&&(this._preloadTimeout=setTimeout(()=>{this._onError(new ErrorEvent(`Preload exceeded timeout of ${e.preloadTimeoutMs}ms`))})),t.load())}),this._load}_onError(t){this.resource.removeEventListener("error",this._onError,!0),this.emit("error",t),this._reject&&(this._reject(t),this._reject=null,this._resolve=null)}_isSourcePlaying(){const t=this.resource;return!t.paused&&!t.ended}_isSourceReady(){return this.resource.readyState>2}_onPlayStart(){this.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&&(ce.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0),this._videoFrameRequestCallbackHandle===null&&(this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback))):(this._videoFrameRequestCallbackHandle!==null&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker||(ce.shared.add(this.updateFrame,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(this._videoFrameRequestCallbackHandle!==null&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(ce.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(t){return globalThis.HTMLVideoElement&&t instanceof HTMLVideoElement}};Ae.extension=W.TextureSource;Ae.defaultOptions={...wt.defaultOptions,autoLoad:!0,autoPlay:!0,updateFPS:0,crossorigin:!0,loop:!1,muted:!0,playsinline:!0,preload:!1};Ae.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};let go=Ae;const zt=(s,t,e=!1)=>(Array.isArray(s)||(s=[s]),t?s.map(i=>typeof i=="string"||e?t(i):i):s);class xo{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||ct(`[Assets] Asset id ${t} was not found in the Cache`),e}set(t,e){const i=zt(t);let r;for(let h=0;h<this.parsers.length;h++){const c=this.parsers[h];if(c.test(e)){r=c.getCacheableAssets(i,e);break}}const n=new Map(Object.entries(r||{}));r||i.forEach(h=>{n.set(h,e)});const o=[...n.keys()],a={cacheKeys:o,keys:i};i.forEach(h=>{this._cacheMap.set(h,a)}),o.forEach(h=>{const c=r?r[h]:e;this._cache.has(h)&&this._cache.get(h)!==c&&ct("[Cache] already has key:",h),this._cache.set(h,n.get(h))})}remove(t){if(!this._cacheMap.has(t)){ct(`[Assets] Asset id ${t} was not found in the Cache`);return}const e=this._cacheMap.get(t);e.cacheKeys.forEach(r=>{this._cache.delete(r)}),e.keys.forEach(r=>{this._cacheMap.delete(r)})}get parsers(){return this._parsers}}const Ut=new xo,rs=[];pt.handleByList(W.TextureSource,rs);function fr(s={}){const t=s&&s.resource,e=t?s.resource:s,i=t?s:{resource:s};for(let r=0;r<rs.length;r++){const n=rs[r];if(n.test(e))return new n(i)}throw new Error(`Could not find a source type for resource: ${i.resource}`)}function yo(s={},t=!1){const e=s&&s.resource,i=e?s.resource:s,r=e?s:{resource:s};if(!t&&Ut.has(i))return Ut.get(i);const n=new j({source:fr(r)});return n.on("destroy",()=>{Ut.has(i)&&Ut.remove(i)}),t||Ut.set(i,n),n}function _o(s,t=!1){return typeof s=="string"?Ut.get(s):s instanceof wt?new j({source:s}):yo(s,t)}j.from=_o;wt.from=fr;pt.add(ar,hr,lr,go,ve,cr,ms);var pr=(s=>(s[s.Low=0]="Low",s[s.Normal=1]="Normal",s[s.High=2]="High",s))(pr||{});function mt(s){if(typeof s!="string")throw new TypeError(`Path must be a string. Received ${JSON.stringify(s)}`)}function Vt(s){return s.split("?")[0].split("#")[0]}function bo(s){return s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function wo(s,t,e){return s.replace(new RegExp(bo(t),"g"),e)}function vo(s,t){let e="",i=0,r=-1,n=0,o=-1;for(let a=0;a<=s.length;++a){if(a<s.length)o=s.charCodeAt(a);else{if(o===47)break;o=47}if(o===47){if(!(r===a-1||n===1))if(r!==a-1&&n===2){if(e.length<2||i!==2||e.charCodeAt(e.length-1)!==46||e.charCodeAt(e.length-2)!==46){if(e.length>2){const h=e.lastIndexOf("/");if(h!==e.length-1){h===-1?(e="",i=0):(e=e.slice(0,h),i=e.length-1-e.lastIndexOf("/")),r=a,n=0;continue}}else if(e.length===2||e.length===1){e="",i=0,r=a,n=0;continue}}}else e.length>0?e+=`/${s.slice(r+1,a)}`:e=s.slice(r+1,a),i=a-r-1;r=a,n=0}else o===46&&n!==-1?++n:n=-1}return e}const se={toPosix(s){return wo(s,"\\","/")},isUrl(s){return/^https?:/.test(this.toPosix(s))},isDataUrl(s){return/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(s)},isBlobUrl(s){return s.startsWith("blob:")},hasProtocol(s){return/^[^/:]+:/.test(this.toPosix(s))},getProtocol(s){mt(s),s=this.toPosix(s);const t=/^file:\/\/\//.exec(s);if(t)return t[0];const e=/^[^/:]+:\/{0,2}/.exec(s);return e?e[0]:""},toAbsolute(s,t,e){if(mt(s),this.isDataUrl(s)||this.isBlobUrl(s))return s;const i=Vt(this.toPosix(t??Tt.get().getBaseUrl())),r=Vt(this.toPosix(e??this.rootname(i)));return s=this.toPosix(s),s.startsWith("/")?se.join(r,s.slice(1)):this.isAbsolute(s)?s:this.join(i,s)},normalize(s){if(mt(s),s.length===0)return".";if(this.isDataUrl(s)||this.isBlobUrl(s))return s;s=this.toPosix(s);let t="";const e=s.startsWith("/");this.hasProtocol(s)&&(t=this.rootname(s),s=s.slice(t.length));const i=s.endsWith("/");return s=vo(s),s.length>0&&i&&(s+="/"),e?`/${s}`:t+s},isAbsolute(s){return mt(s),s=this.toPosix(s),this.hasProtocol(s)?!0:s.startsWith("/")},join(...s){if(s.length===0)return".";let t;for(let e=0;e<s.length;++e){const i=s[e];if(mt(i),i.length>0)if(t===void 0)t=i;else{const r=s[e-1]??"";this.joinExtensions.includes(this.extname(r).toLowerCase())?t+=`/../${i}`:t+=`/${i}`}}return t===void 0?".":this.normalize(t)},dirname(s){if(mt(s),s.length===0)return".";s=this.toPosix(s);let t=s.charCodeAt(0);const e=t===47;let i=-1,r=!0;const n=this.getProtocol(s),o=s;s=s.slice(n.length);for(let a=s.length-1;a>=1;--a)if(t=s.charCodeAt(a),t===47){if(!r){i=a;break}}else r=!1;return i===-1?e?"/":this.isUrl(o)?n+s:n:e&&i===1?"//":n+s.slice(0,i)},rootname(s){mt(s),s=this.toPosix(s);let t="";if(s.startsWith("/")?t="/":t=this.getProtocol(s),this.isUrl(s)){const e=s.indexOf("/",t.length);e!==-1?t=s.slice(0,e):t=s,t.endsWith("/")||(t+="/")}return t},basename(s,t){mt(s),t&&mt(t),s=Vt(this.toPosix(s));let e=0,i=-1,r=!0,n;if(t!==void 0&&t.length>0&&t.length<=s.length){if(t.length===s.length&&t===s)return"";let o=t.length-1,a=-1;for(n=s.length-1;n>=0;--n){const h=s.charCodeAt(n);if(h===47){if(!r){e=n+1;break}}else a===-1&&(r=!1,a=n+1),o>=0&&(h===t.charCodeAt(o)?--o===-1&&(i=n):(o=-1,i=a))}return e===i?i=a:i===-1&&(i=s.length),s.slice(e,i)}for(n=s.length-1;n>=0;--n)if(s.charCodeAt(n)===47){if(!r){e=n+1;break}}else i===-1&&(r=!1,i=n+1);return i===-1?"":s.slice(e,i)},extname(s){mt(s),s=Vt(this.toPosix(s));let t=-1,e=0,i=-1,r=!0,n=0;for(let o=s.length-1;o>=0;--o){const a=s.charCodeAt(o);if(a===47){if(!r){e=o+1;break}continue}i===-1&&(r=!1,i=o+1),a===46?t===-1?t=o:n!==1&&(n=1):t!==-1&&(n=-1)}return t===-1||i===-1||n===0||n===1&&t===i-1&&t===e+1?"":s.slice(t,i)},parse(s){mt(s);const t={root:"",dir:"",base:"",ext:"",name:""};if(s.length===0)return t;s=Vt(this.toPosix(s));let e=s.charCodeAt(0);const i=this.isAbsolute(s);let r;t.root=this.rootname(s),i||this.hasProtocol(s)?r=1:r=0;let n=-1,o=0,a=-1,h=!0,c=s.length-1,l=0;for(;c>=r;--c){if(e=s.charCodeAt(c),e===47){if(!h){o=c+1;break}continue}a===-1&&(h=!1,a=c+1),e===46?n===-1?n=c:l!==1&&(l=1):n!==-1&&(l=-1)}return n===-1||a===-1||l===0||l===1&&n===a-1&&n===o+1?a!==-1&&(o===0&&i?t.base=t.name=s.slice(1,a):t.base=t.name=s.slice(o,a)):(o===0&&i?(t.name=s.slice(1,n),t.base=s.slice(1,a)):(t.name=s.slice(o,n),t.base=s.slice(o,a)),t.ext=s.slice(n,a)),t.dir=this.dirname(s),t},sep:"/",delimiter:":",joinExtensions:[".html"]};function mr(s,t,e,i,r){const n=t[e];for(let o=0;o<n.length;o++){const a=n[o];e<t.length-1?mr(s.replace(i[e],a),t,e+1,i,r):r.push(s.replace(i[e],a))}}function Co(s){const t=/\{(.*?)\}/g,e=s.match(t),i=[];if(e){const r=[];e.forEach(n=>{const o=n.substring(1,n.length-1).split(",");r.push(o)}),mr(s,r,0,e,i)}else i.push(s);return i}const Ks=s=>!Array.isArray(s);class gr{constructor(){this._defaultBundleIdentifierOptions={connector:"-",createBundleAssetId:(t,e)=>`${t}${this._bundleIdConnector}${e}`,extractAssetIdFromBundle:(t,e)=>e.replace(`${t}${this._bundleIdConnector}`,"")},this._bundleIdConnector=this._defaultBundleIdentifierOptions.connector,this._createBundleAssetId=this._defaultBundleIdentifierOptions.createBundleAssetId,this._extractAssetIdFromBundle=this._defaultBundleIdentifierOptions.extractAssetIdFromBundle,this._assetMap={},this._preferredOrder=[],this._parsers=[],this._resolverHash={},this._bundles={}}setBundleIdentifier(t){if(this._bundleIdConnector=t.connector??this._bundleIdConnector,this._createBundleAssetId=t.createBundleAssetId??this._createBundleAssetId,this._extractAssetIdFromBundle=t.extractAssetIdFromBundle??this._extractAssetIdFromBundle,this._extractAssetIdFromBundle("foo",this._createBundleAssetId("foo","bar"))!=="bar")throw new Error("[Resolver] GenerateBundleAssetId are not working correctly")}prefer(...t){t.forEach(e=>{this._preferredOrder.push(e),e.priority||(e.priority=Object.keys(e.params))}),this._resolverHash={}}set basePath(t){this._basePath=t}get basePath(){return this._basePath}set rootPath(t){this._rootPath=t}get rootPath(){return this._rootPath}get parsers(){return this._parsers}reset(){this.setBundleIdentifier(this._defaultBundleIdentifierOptions),this._assetMap={},this._preferredOrder=[],this._resolverHash={},this._rootPath=null,this._basePath=null,this._manifest=null,this._bundles={},this._defaultSearchParams=null}setDefaultSearchParams(t){if(typeof t=="string")this._defaultSearchParams=t;else{const e=t;this._defaultSearchParams=Object.keys(e).map(i=>`${encodeURIComponent(i)}=${encodeURIComponent(e[i])}`).join("&")}}getAlias(t){const{alias:e,src:i}=t;return zt(e||i,n=>typeof n=="string"?n:Array.isArray(n)?n.map(o=>(o==null?void 0:o.src)??o):n!=null&&n.src?n.src:n,!0)}addManifest(t){this._manifest&&ct("[Resolver] Manifest already exists, this will be overwritten"),this._manifest=t,t.bundles.forEach(e=>{this.addBundle(e.name,e.assets)})}addBundle(t,e){const i=[];let r=e;Array.isArray(e)||(r=Object.entries(e).map(([n,o])=>typeof o=="string"||Array.isArray(o)?{alias:n,src:o}:{alias:n,...o})),r.forEach(n=>{const o=n.src,a=n.alias;let h;if(typeof a=="string"){const c=this._createBundleAssetId(t,a);i.push(c),h=[a,c]}else{const c=a.map(l=>this._createBundleAssetId(t,l));i.push(...c),h=[...a,...c]}this.add({...n,alias:h,src:o})}),this._bundles[t]=i}add(t){const e=[];Array.isArray(t)?e.push(...t):e.push(t);let i;i=n=>{this.hasKey(n)&&ct(`[Resolver] already has key: ${n} overwriting`)},zt(e).forEach(n=>{const{src:o}=n;let{data:a,format:h,loadParser:c}=n;const l=zt(o).map(d=>typeof d=="string"?Co(d):Array.isArray(d)?d:[d]),u=this.getAlias(n);Array.isArray(u)?u.forEach(i):i(u);const p=[];l.forEach(d=>{d.forEach(x=>{let _={};if(typeof x!="object"){_.src=x;for(let m=0;m<this._parsers.length;m++){const b=this._parsers[m];if(b.test(x)){_=b.parse(x);break}}}else a=x.data??a,h=x.format??h,c=x.loadParser??c,_={..._,...x};if(!u)throw new Error(`[Resolver] alias is undefined for this asset: ${_.src}`);_=this._buildResolvedAsset(_,{aliases:u,data:a,format:h,loadParser:c}),p.push(_)})}),u.forEach(d=>{this._assetMap[d]=p})})}resolveBundle(t){const e=Ks(t);t=zt(t);const i={};return t.forEach(r=>{const n=this._bundles[r];if(n){const o=this.resolve(n),a={};for(const h in o){const c=o[h];a[this._extractAssetIdFromBundle(r,h)]=c}i[r]=a}}),e?i[t[0]]:i}resolveUrl(t){const e=this.resolve(t);if(typeof t!="string"){const i={};for(const r in e)i[r]=e[r].src;return i}return e.src}resolve(t){const e=Ks(t);t=zt(t);const i={};return t.forEach(r=>{if(!this._resolverHash[r])if(this._assetMap[r]){let n=this._assetMap[r];const o=this._getPreferredOrder(n);o==null||o.priority.forEach(a=>{o.params[a].forEach(h=>{const c=n.filter(l=>l[a]?l[a]===h:!1);c.length&&(n=c)})}),this._resolverHash[r]=n[0]}else this._resolverHash[r]=this._buildResolvedAsset({alias:[r],src:r},{});i[r]=this._resolverHash[r]}),e?i[t[0]]:i}hasKey(t){return!!this._assetMap[t]}hasBundle(t){return!!this._bundles[t]}_getPreferredOrder(t){for(let e=0;e<t.length;e++){const i=t[e],r=this._preferredOrder.find(n=>n.params.format.includes(i.format));if(r)return r}return this._preferredOrder[0]}_appendDefaultSearchParams(t){if(!this._defaultSearchParams)return t;const e=/\?/.test(t)?"&":"?";return`${t}${e}${this._defaultSearchParams}`}_buildResolvedAsset(t,e){const{aliases:i,data:r,loadParser:n,format:o}=e;return(this._basePath||this._rootPath)&&(t.src=se.toAbsolute(t.src,this._basePath,this._rootPath)),t.alias=i??t.alias??[t.src],t.src=this._appendDefaultSearchParams(t.src),t.data={...r||{},...t.data},t.loadParser=n??t.loadParser,t.format=o??t.format??Ao(t.src),t}}gr.RETINA_PREFIX=/@([0-9\.]+)x/;function Ao(s){return s.split(".").pop().split("?").shift().split("#").shift()}const Qs=(s,t)=>{const e=t.split("?")[1];return e&&(s+=`?${e}`),s},xr=class qt{constructor(t,e){this.linkedSheets=[],this._texture=t instanceof j?t:null,this.textureSource=t.source,this.textures={},this.animations={},this.data=e;const i=parseFloat(e.meta.scale);i?(this.resolution=i,t.source.resolution=this.resolution):this.resolution=t.source._resolution,this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}parse(){return new Promise(t=>{this._callback=t,this._batchIndex=0,this._frameKeys.length<=qt.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()})}_processFrames(t){let e=t;const i=qt.BATCH_SIZE;for(;e-t<i&&e<this._frameKeys.length;){const r=this._frameKeys[e],n=this._frames[r],o=n.frame;if(o){let a=null,h=null;const c=n.trimmed!==!1&&n.sourceSize?n.sourceSize:n.frame,l=new it(0,0,Math.floor(c.w)/this.resolution,Math.floor(c.h)/this.resolution);n.rotated?a=new it(Math.floor(o.x)/this.resolution,Math.floor(o.y)/this.resolution,Math.floor(o.h)/this.resolution,Math.floor(o.w)/this.resolution):a=new it(Math.floor(o.x)/this.resolution,Math.floor(o.y)/this.resolution,Math.floor(o.w)/this.resolution,Math.floor(o.h)/this.resolution),n.trimmed!==!1&&n.spriteSourceSize&&(h=new it(Math.floor(n.spriteSourceSize.x)/this.resolution,Math.floor(n.spriteSourceSize.y)/this.resolution,Math.floor(o.w)/this.resolution,Math.floor(o.h)/this.resolution)),this.textures[r]=new j({source:this.textureSource,frame:a,orig:l,trim:h,rotate:n.rotated?2:0,defaultAnchor:n.anchor,defaultBorders:n.borders,label:r.toString()})}e++}}_processAnimations(){const t=this.data.animations||{};for(const e in t){this.animations[e]=[];for(let i=0;i<t[e].length;i++){const r=t[e][i];this.animations[e].push(this.textures[r])}}}_parseComplete(){const t=this._callback;this._callback=null,this._batchIndex=0,t.call(this,this.textures)}_nextBatch(){this._processFrames(this._batchIndex*qt.BATCH_SIZE),this._batchIndex++,setTimeout(()=>{this._batchIndex*qt.BATCH_SIZE<this._frameKeys.length?this._nextBatch():(this._processAnimations(),this._parseComplete())},0)}destroy(t=!1){var e;for(const i in this.textures)this.textures[i].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,t&&((e=this._texture)==null||e.destroy(),this.textureSource.destroy()),this._texture=null,this.textureSource=null,this.linkedSheets=[]}};xr.BATCH_SIZE=1e3;let Js=xr;const So=["jpg","png","jpeg","avif","webp","basis","etc2","bc7","bc6h","bc5","bc4","bc3","bc2","bc1","eac","astc"];function yr(s,t,e){const i={};if(s.forEach(r=>{i[r]=t}),Object.keys(t.textures).forEach(r=>{i[r]=t.textures[r]}),!e){const r=se.dirname(s[0]);
12t.linkedSheets.forEach((n,o)=>{const a=yr([`${r}/${t.data.meta.related_multi_packs[o]}`],n,!0);Object.assign(i,a)})}return i}const Mo={extension:W.Asset,cache:{test:s=>s instanceof Js,getCacheableAssets:(s,t)=>yr(s,t,!1)},resolver:{extension:{type:W.ResolveParser,name:"resolveSpritesheet"},test:s=>{const e=s.split("?")[0].split("."),i=e.pop(),r=e.pop();return i==="json"&&So.includes(r)},parse:s=>{var e;const t=s.split(".");return{resolution:parseFloat(((e=gr.RETINA_PREFIX.exec(s))==null?void 0:e[1])??"1"),format:t[t.length-2],src:s}}},loader:{name:"spritesheetLoader",extension:{type:W.LoadParser,priority:pr.Normal,name:"spritesheetLoader"},async testParse(s,t){return se.extname(t.src).toLowerCase()===".json"&&!!s.frames},async parse(s,t,e){var l,u;const{texture:i,imageFilename:r,textureOptions:n}=(t==null?void 0:t.data)??{};let o=se.dirname(t.src);o&&o.lastIndexOf("/")!==o.length-1&&(o+="/");let a;if(i instanceof j)a=i;else{const p=Qs(o+(r??s.meta.image),t.src);a=(await e.load([{src:p,data:n}]))[p]}const h=new Js(a.source,s);await h.parse();const c=(l=s==null?void 0:s.meta)==null?void 0:l.related_multi_packs;if(Array.isArray(c)){const p=[];for(const x of c){if(typeof x!="string")continue;let _=o+x;(u=t.data)!=null&&u.ignoreMultiPack||(_=Qs(_,t.src),p.push(e.load({src:_,data:{textureOptions:n,ignoreMultiPack:!0}})))}const d=await Promise.all(p);h.linkedSheets=d,d.forEach(x=>{x.linkedSheets=[h].concat(h.linkedSheets.filter(_=>_!==x))})}return h},async unload(s,t,e){await e.unload(s.textureSource._sourceOrigin),s.destroy(!1)}}};pt.add(Mo);const Ne=Object.create(null),ti=Object.create(null);function ys(s,t){let e=ti[s];return e===void 0&&(Ne[t]===void 0&&(Ne[t]=1),ti[s]=e=Ne[t]++),e}let Dt;function _r(){return(!Dt||Dt!=null&&Dt.isContextLost())&&(Dt=Tt.get().createCanvas().getContext("webgl",{})),Dt}let ue;function Po(){if(!ue){ue="mediump";const s=_r();s&&s.getShaderPrecisionFormat&&(ue=s.getShaderPrecisionFormat(s.FRAGMENT_SHADER,s.HIGH_FLOAT).precision?"highp":"mediump")}return ue}function To(s,t,e){return t?s:e?(s=s.replace("out vec4 finalColor;",""),` 13 14 #ifdef GL_ES // This checks if it is WebGL1 15 #define in varying 16 #define finalColor gl_FragColor 17 #define texture texture2D 18 #endif 19 ${s} 20 `):` 21 22 #ifdef GL_ES // This checks if it is WebGL1 23 #define in attribute 24 #define out varying 25 #endif 26 ${s} 27 `}function ko(s,t,e){const i=e?t.maxSupportedFragmentPrecision:t.maxSupportedVertexPrecision;if(s.substring(0,9)!=="precision"){let r=e?t.requestedFragmentPrecision:t.requestedVertexPrecision;return r==="highp"&&i!=="highp"&&(r="mediump"),`precision ${r} float; 28${s}`}else if(i!=="highp"&&s.substring(0,15)==="precision highp")return s.replace("precision highp","precision mediump");return s}function Eo(s,t){return t?`#version 300 es 29${s}`:s}const Io={},Ro={};function Bo(s,{name:t="pixi-program"},e=!0){t=t.replace(/\s+/g,"-"),t+=e?"-fragment":"-vertex";const i=e?Io:Ro;return i[t]?(i[t]++,t+=`-${i[t]}`):i[t]=1,s.indexOf("#define SHADER_NAME")!==-1?s:`${`#define SHADER_NAME ${t}`} 30${s}`}function Go(s,t){return t?s.replace("#version 300 es",""):s}const He={stripVersion:Go,ensurePrecision:ko,addProgramDefines:To,setProgramName:Bo,insertVersion:Eo},Oe=Object.create(null),br=class ns{constructor(t){t={...ns.defaultOptions,...t};const e=t.fragment.indexOf("#version 300 es")!==-1,i={stripVersion:e,ensurePrecision:{requestedFragmentPrecision:t.preferredFragmentPrecision,requestedVertexPrecision:t.preferredVertexPrecision,maxSupportedVertexPrecision:"highp",maxSupportedFragmentPrecision:Po()},setProgramName:{name:t.name},addProgramDefines:e,insertVersion:e};let r=t.fragment,n=t.vertex;Object.keys(He).forEach(o=>{const a=i[o];r=He[o](r,a,!0),n=He[o](n,a,!1)}),this.fragment=r,this.vertex=n,this.transformFeedbackVaryings=t.transformFeedbackVaryings,this._key=ys(`${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}static from(t){const e=`${t.vertex}:${t.fragment}`;return Oe[e]||(Oe[e]=new ns(t)),Oe[e]}};br.defaultOptions={preferredVertexPrecision:"highp",preferredFragmentPrecision:"mediump"};let wr=br;const ei={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 Fo(s){return ei[s]??ei.float32}const Do={f32:"float32","vec2<f32>":"float32x2","vec3<f32>":"float32x3","vec4<f32>":"float32x4",vec2f:"float32x2",vec3f:"float32x3",vec4f:"float32x4",i32:"sint32","vec2<i32>":"sint32x2","vec3<i32>":"sint32x3","vec4<i32>":"sint32x4",u32:"uint32","vec2<u32>":"uint32x2","vec3<u32>":"uint32x3","vec4<u32>":"uint32x4",bool:"uint32","vec2<bool>":"uint32x2","vec3<bool>":"uint32x3","vec4<bool>":"uint32x4"};function Lo({source:s,entryPoint:t}){const e={},i=s.indexOf(`fn ${t}`);if(i!==-1){const r=s.indexOf("->",i);if(r!==-1){const n=s.substring(i,r),o=/@location\((\d+)\)\s+([a-zA-Z0-9_]+)\s*:\s*([a-zA-Z0-9_<>]+)(?:,|\s|$)/g;let a;for(;(a=o.exec(n))!==null;){const h=Do[a[3]]??"float32";e[a[2]]={location:parseInt(a[1],10),format:h,stride:Fo(h).stride,offset:0,instance:!1,start:0}}}}return e}function Ve(s){var u,p;const t=/(^|[^/])@(group|binding)\(\d+\)[^;]+;/g,e=/@group\((\d+)\)/,i=/@binding\((\d+)\)/,r=/var(<[^>]+>)? (\w+)/,n=/:\s*(\w+)/,o=/struct\s+(\w+)\s*{([^}]+)}/g,a=/(\w+)\s*:\s*([\w\<\>]+)/g,h=/struct\s+(\w+)/,c=(u=s.match(t))==null?void 0:u.map(d=>({group:parseInt(d.match(e)[1],10),binding:parseInt(d.match(i)[1],10),name:d.match(r)[2],isUniform:d.match(r)[1]==="<uniform>",type:d.match(n)[1]}));if(!c)return{groups:[],structs:[]};
30const l=((p=s.match(o))==null?void 0:p.map(d=>{const x=d.match(h)[1],_=d.match(a).reduce((m,b)=>{const[w,A]=b.split(":");return m[w.trim()]=A.trim(),m},{});return _?{name:x,members:_}:null}).filter(({name:d})=>c.some(x=>x.type===d)))??[];return{groups:c,structs:l}}var Zt=(s=>(s[s.VERTEX=1]="VERTEX",s[s.FRAGMENT=2]="FRAGMENT",s[s.COMPUTE=4]="COMPUTE",s))(Zt||{});function zo({groups:s}){const t=[];for(let e=0;e<s.length;e++){const i=s[e];t[i.group]||(t[i.group]=[]),i.isUniform?t[i.group].push({binding:i.binding,visibility:Zt.VERTEX|Zt.FRAGMENT,buffer:{type:"uniform"}}):i.type==="sampler"?t[i.group].push({binding:i.binding,visibility:Zt.FRAGMENT,sampler:{type:"filtering"}}):i.type==="texture_2d"&&t[i.group].push({binding:i.binding,visibility:Zt.FRAGMENT,texture:{sampleType:"float",viewDimension:"2d",multisampled:!1}})}return t}function Uo({groups:s}){const t=[];for(let e=0;e<s.length;e++){const i=s[e];t[i.group]||(t[i.group]={}),t[i.group][i.name]=i.binding}return t}function No(s,t){const e=new Set,i=new Set,r=[...s.structs,...t.structs].filter(o=>e.has(o.name)?!1:(e.add(o.name),!0)),n=[...s.groups,...t.groups].filter(o=>{const a=`${o.name}-${o.binding}`;return i.has(a)?!1:(i.add(a),!0)});return{structs:r,groups:n}}const Ye=Object.create(null);class Se{constructor(t){var a,h;this._layoutKey=0,this._attributeLocationsKey=0;const{fragment:e,vertex:i,layout:r,gpuLayout:n,name:o}=t;if(this.name=o,this.fragment=e,this.vertex=i,e.source===i.source){const c=Ve(e.source);this.structsAndGroups=c}else{const c=Ve(i.source),l=Ve(e.source);this.structsAndGroups=No(c,l)}this.layout=r??Uo(this.structsAndGroups),this.gpuLayout=n??zo(this.structsAndGroups),this.autoAssignGlobalUniforms=((a=this.layout[0])==null?void 0:a.globalUniforms)!==void 0,this.autoAssignLocalUniforms=((h=this.layout[1])==null?void 0:h.localUniforms)!==void 0,this._generateProgramKey()}_generateProgramKey(){const{vertex:t,fragment:e}=this,i=t.source+e.source+t.entryPoint+e.entryPoint;this._layoutKey=ys(i,"program")}get attributeData(){return this._attributeData??(this._attributeData=Lo(this.vertex)),this._attributeData}destroy(){this.gpuLayout=null,this.layout=null,this.structsAndGroups=null,this.fragment=null,this.vertex=null}static from(t){const e=`${t.vertex.source}:${t.fragment.source}:${t.fragment.entryPoint}:${t.vertex.entryPoint}`;return Ye[e]||(Ye[e]=new Se(t)),Ye[e]}}const vr=["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>"],Ho=vr.reduce((s,t)=>(s[t]=!0,s),{});function Oo(s,t){switch(s){case"f32":return 0;case"vec2<f32>":return new Float32Array(2*t);case"vec3<f32>":return new Float32Array(3*t);case"vec4<f32>":return new Float32Array(4*t);case"mat2x2<f32>":return new Float32Array([1,0,0,1]);case"mat3x3<f32>":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4x4<f32>":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}const Cr=class Ar{constructor(t,e){this._touched=0,this.uid=tt("uniform"),this._resourceType="uniformGroup",this._resourceId=tt("resource"),this.isUniformGroup=!0,this._dirtyId=0,this.destroyed=!1,e={...Ar.defaultOptions,...e},this.uniformStructures=t;const i={};for(const r in t){const n=t[r];if(n.name=r,n.size=n.size??1,!Ho[n.type])throw new Error(`Uniform type ${n.type} is not supported. Supported uniform types are: ${vr.join(", ")}`);n.value??(n.value=Oo(n.type,n.size)),i[r]=n.value}this.uniforms=i,this._dirtyId=1,this.ubo=e.ubo,this.isStatic=e.isStatic,this._signature=ys(Object.keys(i).map(r=>`${r}-${t[r].type}`).join("-"),"uniform-group")}update(){this._dirtyId++}};Cr.defaultOptions={ubo:!1,isStatic:!1};let Sr=Cr;class _e{constructor(t){this.resources=Object.create(null),this._dirty=!0;let e=0;for(const i in t){const r=t[i];this.setResource(r,e++)}this._updateKey()}_updateKey(){if(!this._dirty)return;this._dirty=!1;const t=[];let e=0;for(const i in this.resources)t[e++]=this.resources[i]._resourceId;this._key=t.join("|")}setResource(t,e){var r,n;const i=this.resources[e];t!==i&&(i&&((r=t.off)==null||r.call(t,"change",this.onResourceChange,this)),(n=t.on)==null||n.call(t,"change",this.onResourceChange,this),this.resources[e]=t,this._dirty=!0)}getResource(t){return this.resources[t]}_touch(t){const e=this.resources;for(const i in e)e[i]._touched=t}destroy(){var e;const t=this.resources;for(const i in t){const r=t[i];(e=r.off)==null||e.call(r,"change",this.onResourceChange,this)}this.resources=null}onResourceChange(t){if(this._dirty=!0,t.destroyed){const e=this.resources;for(const i in e)e[i]===t&&(e[i]=null)}else this._updateKey()}}var os=(s=>(s[s.WEBGL=1]="WEBGL",s[s.WEBGPU=2]="WEBGPU",s[s.BOTH=3]="BOTH",s))(os||{});class _s extends Mt{constructor(t){super(),this.uid=tt("shader"),this._uniformBindMap=Object.create(null),this._ownedBindGroups=[];let{gpuProgram:e,glProgram:i,groups:r,resources:n,compatibleRenderers:o,groupMap:a}=t;this.gpuProgram=e,this.glProgram=i,o===void 0&&(o=0,e&&(o|=os.WEBGPU),i&&(o|=os.WEBGL)),this.compatibleRenderers=o;const h={};if(!n&&!r&&(n={}),n&&r)throw new Error("[Shader] Cannot have both resources and groups");
vendor: 15,949 bytes, line 30
30if(!e&&r&&!a)throw new Error("[Shader] No group map or WebGPU shader provided - consider using resources instead.");if(!e&&r&&a)for(const c in a)for(const l in a[c]){const u=a[c][l];h[u]={group:c,binding:l,name:u}}else if(e&&r&&!a){const c=e.structsAndGroups.groups;a={},c.forEach(l=>{a[l.group]=a[l.group]||{},a[l.group][l.binding]=l.name,h[l.name]=l})}else if(n){r={},a={},e&&e.structsAndGroups.groups.forEach(u=>{a[u.group]=a[u.group]||{},a[u.group][u.binding]=u.name,h[u.name]=u});let c=0;for(const l in n)h[l]||(r[99]||(r[99]=new _e,this._ownedBindGroups.push(r[99])),h[l]={group:99,binding:c,name:l},a[99]=a[99]||{},a[99][c]=l,c++);for(const l in n){const u=l;let p=n[l];!p.source&&!p._resourceType&&(p=new Sr(p));const d=h[u];d&&(r[d.group]||(r[d.group]=new _e,this._ownedBindGroups.push(r[d.group])),r[d.group].setResource(p,d.binding))}}this.groups=r,this._uniformBindMap=a,this.resources=this._buildResourceAccessor(r,h)}addResource(t,e,i){var r,n;(r=this._uniformBindMap)[e]||(r[e]={}),(n=this._uniformBindMap[e])[i]||(n[i]=t),this.groups[e]||(this.groups[e]=new _e,this._ownedBindGroups.push(this.groups[e]))}_buildResourceAccessor(t,e){const i={};for(const r in e){const n=e[r];Object.defineProperty(i,n.name,{get(){return t[n.group].getResource(n.binding)},set(o){t[n.group].setResource(o,n.binding)}})}return i}destroy(t=!1){var e,i;this.emit("destroy",this),t&&((e=this.gpuProgram)==null||e.destroy(),(i=this.glProgram)==null||i.destroy()),this.gpuProgram=null,this.glProgram=null,this.removeAllListeners(),this._uniformBindMap=null,this._ownedBindGroups.forEach(r=>{r.destroy()}),this._ownedBindGroups=null,this.resources=null,this.groups=null}static from(t){const{gpu:e,gl:i,...r}=t;let n,o;return e&&(n=Se.from(e)),i&&(o=wr.from(i)),new _s({gpuProgram:n,glProgram:o,...r})}}const as=[];pt.handleByNamedList(W.Environment,as);async function Vo(s){if(!s)for(let t=0;t<as.length;t++){const e=as[t];if(e.value.test()){await e.value.load();return}}}let Yt;function Yo(){if(typeof Yt=="boolean")return Yt;try{Yt=new Function("param1","param2","param3","return param1[param2] === param3;")({a:"b"},"a","b")===!0}catch{Yt=!1}return Yt}var de={exports:{}},si;function $o(){if(si)return de.exports;si=1,de.exports=s,de.exports.default=s;function s(f,g,y){y=y||2;var v=g&&g.length,M=v?g[0]*y:f.length,T=t(f,0,M,y,!0),k=[];if(!T||T.next===T.prev)return k;var I,L,F,$,X,U,J;if(v&&(T=h(f,g,T,y)),f.length>80*y){I=F=f[0],L=$=f[1];for(var V=y;V<M;V+=y)X=f[V],U=f[V+1],X<I&&(I=X),U<L&&(L=U),X>F&&(F=X),U>$&&($=U);J=Math.max(F-I,$-L),J=J!==0?32767/J:0}return i(T,k,y,I,L,J,0),k}function t(f,g,y,v,M){var T,k;if(M===ut(f,g,y,v)>0)for(T=g;T<y;T+=v)k=Y(T,f[T],f[T+1],k);else for(T=y-v;T>=g;T-=v)k=Y(T,f[T],f[T+1],k);return k&&C(k,k.next)&&(H(k),k=k.next),k}function e(f,g){if(!f)return f;g||(g=f);var y=f,v;do if(v=!1,!y.steiner&&(C(y,y.next)||A(y.prev,y,y.next)===0)){if(H(y),y=g=y.prev,y===y.next)break;v=!0}else y=y.next;while(v||y!==g);return g}function i(f,g,y,v,M,T,k){if(f){!k&&T&&d(f,v,M,T);for(var I=f,L,F;f.prev!==f.next;){if(L=f.prev,F=f.next,T?n(f,v,M,T):r(f)){g.push(L.i/y|0),g.push(f.i/y|0),g.push(F.i/y|0),H(f),f=F.next,I=F.next;continue}if(f=F,f===I){k?k===1?(f=o(e(f),g,y),i(f,g,y,v,M,T,2)):k===2&&a(f,g,y,v,M,T):i(e(f),g,y,v,M,T,1);break}}}}function r(f){var g=f.prev,y=f,v=f.next;if(A(g,y,v)>=0)return!1;for(var M=g.x,T=y.x,k=v.x,I=g.y,L=y.y,F=v.y,$=M<T?M<k?M:k:T<k?T:k,X=I<L?I<F?I:F:L<F?L:F,U=M>T?M>k?M:k:T>k?T:k,J=I>L?I>F?I:F:L>F?L:F,V=v.next;V!==g;){if(V.x>=$&&V.x<=U&&V.y>=X&&V.y<=J&&b(M,I,T,L,k,F,V.x,V.y)&&A(V.prev,V,V.next)>=0)return!1;V=V.next}return!0}function n(f,g,y,v){var M=f.prev,T=f,k=f.next;if(A(M,T,k)>=0)return!1;for(var I=M.x,L=T.x,F=k.x,$=M.y,X=T.y,U=k.y,J=I<L?I<F?I:F:L<F?L:F,V=$<X?$<U?$:U:X<U?X:U,vt=I>L?I>F?I:F:L>F?L:F,at=$>X?$>U?$:U:X>U?X:U,xt=_(J,V,g,y,v),yt=_(vt,at,g,y,v),z=f.prevZ,O=f.nextZ;z&&z.z>=xt&&O&&O.z<=yt;){if(z.x>=J&&z.x<=vt&&z.y>=V&&z.y<=at&&z!==M&&z!==k&&b(I,$,L,X,F,U,z.x,z.y)&&A(z.prev,z,z.next)>=0||(z=z.prevZ,O.x>=J&&O.x<=vt&&O.y>=V&&O.y<=at&&O!==M&&O!==k&&b(I,$,L,X,F,U,O.x,O.y)&&A(O.prev,O,O.next)>=0))return!1;O=O.nextZ}for(;z&&z.z>=xt;){if(z.x>=J&&z.x<=vt&&z.y>=V&&z.y<=at&&z!==M&&z!==k&&b(I,$,L,X,F,U,z.x,z.y)&&A(z.prev,z,z.next)>=0)return!1;z=z.prevZ}for(;O&&O.z<=yt;){if(O.x>=J&&O.x<=vt&&O.y>=V&&O.y<=at&&O!==M&&O!==k&&b(I,$,L,X,F,U,O.x,O.y)&&A(O.prev,O,O.next)>=0)return!1;O=O.nextZ}return!0}function o(f,g,y){var v=f;do{var M=v.prev,T=v.next.next;!C(M,T)&&E(M,v,v.next,T)&&G(M,T)&&G(T,M)&&(g.push(M.i/y|0),g.push(v.i/y|0),g.push(T.i/y|0),H(v),H(v.next),v=f=T),v=v.next}while(v!==f);return e(v)}function a(f,g,y,v,M,T){var k=f;do{for(var I=k.next.next;I!==k.prev;){if(k.i!==I.i&&w(k,I)){var L=B(k,I);k=e(k,k.next),L=e(L,L.next),i(k,g,y,v,M,T,0),i(L,g,y,v,M,T,0);return}I=I.next}k=k.next}while(k!==f)}function h(f,g,y,v){var M=[],T,k,I,L,F;for(T=0,k=g.length;T<k;T++)I=g[T]*v,L=T<k-1?g[T+1]*v:f.length,F=t(f,I,L,v,!1),F===F.next&&(F.steiner=!0),M.push(m(F));for(M.sort(c),T=0;T<M.length;T++)y=l(M[T],y);return y}function c(f,g){return f.x-g.x}function l(f,g){var y=u(f,g);if(!y)return g;var v=B(y,f);return e(v,v.next),e(y,y.next)}function u(f,g){var y=g,v=f.x,M=f.y,T=-1/0,k;do{if(M<=y.y&&M>=y.next.y&&y.next.y!==y.y){var I=y.x+(M-y.y)*(y.next.x-y.x)/(y.next.y-y.y);if(I<=v&&I>T&&(T=I,k=y.x<y.next.x?y:y.next,I===v))return k}y=y.next}while(y!==g);if(!k)return null;var L=k,F=k.x,$=k.y,X=1/0,U;y=k;do v>=y.x&&y.x>=F&&v!==y.x&&b(M<$?v:T,M,F,$,M<$?T:v,M,y.x,y.y)&&(U=Math.abs(M-y.y)/(v-y.x),G(y,f)&&(U<X||U===X&&(y.x>k.x||y.x===k.x&&p(k,y)))&&(k=y,X=U)),y=y.next;while(y!==L);return k}function p(f,g){return A(f.prev,f,g.prev)<0&&A(g.next,f,f.next)<0}function d(f,g,y,v){var M=f;do M.z===0&&(M.z=_(M.x,M.y,g,y,v)),M.prevZ=M.prev,M.nextZ=M.next,M=M.next;while(M!==f);M.prevZ.nextZ=null,M.prevZ=null,x(M)}function x(f){var g,y,v,M,T,k,I,L,F=1;do{for(y=f,f=null,T=null,k=0;y;){for(k++,v=y,I=0,g=0;g<F&&(I++,v=v.nextZ,!!v);g++);for(L=F;I>0||L>0&&v;)I!==0&&(L===0||!v||y.z<=v.z)?(M=y,y=y.nextZ,I--):(M=v,v=v.nextZ,L--),T?T.nextZ=M:f=M,M.prevZ=T,T=M;y=v}T.nextZ=null,F*=2}while(k>1);return f}function _(f,g,y,v,M){return f=(f-y)*M|0,g=(g-v)*M|0,f=(f|f<<8)&16711935,f=(f|f<<4)&252645135,f=(f|f<<2)&858993459,f=(f|f<<1)&1431655765,g=(g|g<<8)&16711935,g=(g|g<<4)&252645135,g=(g|g<<2)&858993459,g=(g|g<<1)&1431655765,f|g<<1}function m(f){var g=f,y=f;do(g.x<y.x||g.x===y.x&&g.y<y.y)&&(y=g),g=g.next;while(g!==f);return y}function b(f,g,y,v,M,T,k,I){return(M-k)*(g-I)>=(f-k)*(T-I)&&(f-k)*(v-I)>=(y-k)*(g-I)&&(y-k)*(T-I)>=(M-k)*(v-I)}function w(f,g){return f.next.i!==g.i&&f.prev.i!==g.i&&!D(f,g)&&(G(f,g)&&G(g,f)&&R(f,g)&&(A(f.prev,f,g.prev)||A(f,g.prev,g))||C(f,g)&&A(f.prev,f,f.next)>0&&A(g.prev,g,g.next)>0)}function A(f,g,y){return(g.y-f.y)*(y.x-g.x)-(g.x-f.x)*(y.y-g.y)}function C(f,g){return f.x===g.x&&f.y===g.y}function E(f,g,y,v){var M=P(A(f,g,y)),T=P(A(f,g,v)),k=P(A(y,v,f)),I=P(A(y,v,g));return!!(M!==T&&k!==I||M===0&&S(f,y,g)||T===0&&S(f,v,g)||k===0&&S(y,f,v)||I===0&&S(y,g,v))}function S(f,g,y){return g.x<=Math.max(f.x,y.x)&&g.x>=Math.min(f.x,y.x)&&g.y<=Math.max(f.y,y.y)&&g.y>=Math.min(f.y,y.y)}function P(f){return f>0?1:f<0?-1:0}function D(f,g){var y=f;do{if(y.i!==f.i&&y.next.i!==f.i&&y.i!==g.i&&y.next.i!==g.i&&E(y,y.next,f,g))return!0;y=y.next}while(y!==f);return!1}function G(f,g){return A(f.prev,f,f.next)<0?A(f,g,f.next)>=0&&A(f,f.prev,g)>=0:A(f,g,f.prev)<0||A(f,f.next,g)<0}function R(f,g){var y=f,v=!1,M=(f.x+g.x)/2,T=(f.y+g.y)/2;do y.y>T!=y.next.y>T&&y.next.y!==y.y&&M<(y.next.x-y.x)*(T-y.y)/(y.next.y-y.y)+y.x&&(v=!v),y=y.next;while(y!==f);return v}function B(f,g){var y=new Z(f.i,f.x,f.y),v=new Z(g.i,g.x,g.y),M=f.next,T=g.prev;return f.next=g,g.prev=f,y.next=M,M.prev=y,v.next=y,y.prev=v,T.next=v,v.prev=T,v}function Y(f,g,y,v){var M=new Z(f,g,y);return v?(M.next=v.next,M.prev=v,v.next.prev=M,v.next=M):(M.prev=M,M.next=M),M}function H(f){f.next.prev=f.prev,f.prev.next=f.next,f.prevZ&&(f.prevZ.nextZ=f.nextZ),f.nextZ&&(f.nextZ.prevZ=f.prevZ)}function Z(f,g,y){this.i=f,this.x=g,this.y=y,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}s.deviation=function(f,g,y,v){var M=g&&g.length,T=M?g[0]*y:f.length,k=Math.abs(ut(f,0,T,y));if(M)for(var I=0,L=g.length;I<L;I++){var F=g[I]*y,$=I<L-1?g[I+1]*y:f.length;k-=Math.abs(ut(f,F,$,y))}var X=0;for(I=0;I<v.length;I+=3){var U=v[I]*y,J=v[I+1]*y,V=v[I+2]*y;X+=Math.abs((f[U]-f[V])*(f[J+1]-f[U+1])-(f[U]-f[J])*(f[V+1]-f[U+1]))}return k===0&&X===0?0:Math.abs((X-k)/k)};function ut(f,g,y,v){for(var M=0,T=g,k=y-v;T<y;T+=v)M+=(f[k]-f[T])*(f[T+1]+f[k+1]),k=T;return M}return s.flatten=function(f){for(var g=f[0][0].length,y={vertices:[],holes:[],dimensions:g},v=0,M=0;M<f.length;M++){for(var T=0;T<f[M].length;T++)for(var k=0;k<g;k++)y.vertices.push(f[M][T][k]);M>0&&(v+=f[M-1].length,y.holes.push(v))}return y},de.exports}var Xo=$o();const Wo=ps(Xo);var Mr=(s=>(s[s.NONE=0]="NONE",s[s.COLOR=16384]="COLOR",s[s.STENCIL=1024]="STENCIL",s[s.DEPTH=256]="DEPTH",s[s.COLOR_DEPTH=16640]="COLOR_DEPTH",s[s.COLOR_STENCIL=17408]="COLOR_STENCIL",s[s.DEPTH_STENCIL=1280]="DEPTH_STENCIL",s[s.ALL=17664]="ALL",s))(Mr||{});class jo{constructor(t){this.items=[],this._name=t}emit(t,e,i,r,n,o,a,h){const{name:c,items:l}=this;for(let u=0,p=l.length;u<p;u++)l[u][c](t,e,i,r,n,o,a,h);return this}add(t){return t[this._name]&&(this.remove(t),this.items.push(t)),this}remove(t){const e=this.items.indexOf(t);return e!==-1&&this.items.splice(e,1),this}contains(t){return this.items.indexOf(t)!==-1}removeAll(){return this.items.length=0,this}destroy(){this.removeAll(),this.items=null,this._name=null}get empty(){return this.items.length===0}get name(){return this._name}}const qo=["init","destroy","contextChange","resolutionChange","resetState","renderEnd","renderStart","render","update","postrender","prerender"],Pr=class Tr extends Mt{constructor(t){super(),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=[...qo,...this.config.runners??[]];this._addRunners(...e),this._unsafeEvalCheck()}async init(t={}){const e=t.skipExtensionImports===!0?!0:t.manageImports===!1;await Vo(e),this._addSystems(this.config.systems),this._addPipes(this.config.renderPipes,this.config.renderPipeAdaptors);for(const i in this._systemsHash)t={...this._systemsHash[i].constructor.defaultOptions,...t};t={...Tr.defaultOptions,...t},this._roundPixels=t.roundPixels?1:0;for(let i=0;i<this.runners.init.items.length;i++)await this.runners.init.items[i].init(t);this._initOptions=t}render(t,e){let i=t;if(i instanceof kt&&(i={container:i},e&&(q(et,"passing a second argument is deprecated, please use render options instead"),i.target=e.renderTexture)),i.target||(i.target=this.view.renderTarget),i.target===this.view.renderTarget&&(this._lastObjectRendered=i.container,i.clearColor??(i.clearColor=this.background.colorRgba),i.clear??(i.clear=this.background.clearBeforeRender)),i.clearColor){const r=Array.isArray(i.clearColor)&&i.clearColor.length===4;i.clearColor=r?i.clearColor:ft.shared.setValue(i.clearColor).toArray()}i.transform||(i.container.updateLocalTransform(),i.transform=i.container.localTransform),i.container.enableRenderGroup(),this.runners.prerender.emit(i),this.runners.renderStart.emit(i),this.runners.render.emit(i),this.runners.renderEnd.emit(i),this.runners.postrender.emit(i)}resize(t,e,i){const r=this.view.resolution;this.view.resize(t,e,i),this.emit("resize",this.view.screen.width,this.view.screen.height,this.view.resolution),i!==void 0&&i!==r&&this.runners.resolutionChange.emit(i)}clear(t={}){const e=this;t.target||(t.target=e.renderTarget.renderTarget),t.clearColor||(t.clearColor=this.background.colorRgba),t.clear??(t.clear=Mr.ALL);const{clear:i,clearColor:r,target:n}=t;ft.shared.setValue(r??this.background.colorRgba),e.renderTarget.clear(n,i,ft.shared.toArray())}get resolution(){return this.view.resolution}set resolution(t){this.view.resolution=t,this.runners.resolutionChange.emit(t)}get width(){return this.view.texture.frame.width}get height(){return this.view.texture.frame.height}get canvas(){return this.view.canvas}get lastObjectRendered(){return this._lastObjectRendered}get renderingToScreen(){return this.renderTarget.renderingToScreen}get screen(){return this.view.screen}_addRunners(...t){t.forEach(e=>{this.runners[e]=new jo(e)})}_addSystems(t){let e;for(e in t){const i=t[e];this._addSystem(i.value,i.name)}}_addSystem(t,e){const i=new t(this);if(this[e])throw new Error(`Whoops! The name "${e}" is already in use`);this[e]=i,this._systemsHash[e]=i;for(const r in this.runners)this.runners[r].add(i);return this}_addPipes(t,e){const i=e.reduce((r,n)=>(r[n.name]=n.value,r),{});t.forEach(r=>{const n=r.value,o=r.name,a=i[o];this.renderPipes[o]=new n(this,a?new a:null)})}destroy(t=!1){this.runners.destroy.items.reverse(),this.runners.destroy.emit(t),Object.values(this.runners).forEach(e=>{e.destroy()}),this._systemsHash=null,this.renderPipes=null}generateTexture(t){return this.textureGenerator.generateTexture(t)}get roundPixels(){return!!this._roundPixels}_unsafeEvalCheck(){if(!Yo())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()}};Pr.defaultOptions={resolution:1,failIfMajorPerformanceCaveat:!1,roundPixels:!1};let kr=Pr,fe;function Zo(s){return fe!==void 0||(fe=(()=>{var e;const t={stencil:!0,failIfMajorPerformanceCaveat:s??kr.defaultOptions.failIfMajorPerformanceCaveat};try{if(!Tt.get().getWebGLRenderingContext())return!1;let r=Tt.get().createCanvas().getContext("webgl",t);const n=!!((e=r==null?void 0:r.getContextAttributes())!=null&&e.stencil);if(r){const o=r.getExtension("WEBGL_lose_context");o&&o.loseContext()}return r=null,n}catch{return!1}})()),fe}let pe;async function Ko(s={}){return pe!==void 0||(pe=await(async()=>{const t=Tt.get().getNavigator().gpu;if(!t)return!1;try{return await(await t.requestAdapter(s)).requestDevice(),!0}catch{return!1}})()),pe}const ii=["webgl","webgpu","canvas"];async function Qo(s){let t=[];s.preference?(t.push(s.preference),ii.forEach(n=>{n!==s.preference&&t.push(n)})):t=ii.slice();let e,i={};for(let n=0;n<t.length;n++){const o=t[n];if(o==="webgpu"&&await Ko()){const{WebGPURenderer:a}=await we(async()=>{const{WebGPURenderer:h}=await import("./BuXnT0K0.js");return{WebGPURenderer:h}},__vite__mapDeps([6,2,7,3,4,5]),import.meta.url);e=a,i={...s,...s.webgpu};break}else if(o==="webgl"&&Zo(s.failIfMajorPerformanceCaveat??kr.defaultOptions.failIfMajorPerformanceCaveat)){const{WebGLRenderer:a}=await we(async()=>{const{WebGLRenderer:h}=await import("./DSHkd2Dv.js");return{WebGLRenderer:h}},__vite__mapDeps([8,2,7,4,5]),import.meta.url);e=a,i={...s,...s.webgl};break}else if(o==="canvas")throw i={...s},new Error("CanvasRenderer is not yet implemented")}if(delete i.webgpu,delete i.webgl,!e)throw new Error("No available renderer for the current environment");const r=new e;return await r.init(i),r}const Er="8.9.2";class Ir{static init(){var t;(t=globalThis.__PIXI_APP_INIT__)==null||t.call(globalThis,this,Er)}static destroy(){}}Ir.extension=W.Application;class Jo{constructor(t){this._renderer=t}init(){var t;(t=globalThis.__PIXI_RENDERER_INIT__)==null||t.call(globalThis,this._renderer,Er)}destroy(){this._renderer=null}}Jo.extension={type:[W.WebGLSystem,W.WebGPUSystem],name:"initHook",priority:-10};const Rr=class hs{constructor(...t){this.stage=new kt,t[0]!==void 0&&q(et,"Application constructor options are deprecated, please use Application.init() instead.")}async init(t){t={...t},this.renderer=await Qo(t),hs._plugins.forEach(e=>{e.init.call(this,t)})}render(){this.renderer.render({container:this.stage})}get canvas(){return this.renderer.canvas}get view(){return q(et,"Application.view is deprecated, please use Application.canvas instead."),this.renderer.canvas}get screen(){return this.renderer.screen}destroy(t=!1,e=!1){const i=hs._plugins.slice(0);
30i.reverse(),i.forEach(r=>{r.destroy.call(this)}),this.stage.destroy(e),this.stage=null,this.renderer.destroy(t),this.renderer=null}};Rr._plugins=[];let Br=Rr;pt.handleByList(W.Application,Br._plugins);pt.add(Ir);const ri=[{offset:0,color:"white"},{offset:1,color:"black"}],bs=class ls{constructor(...t){this.uid=tt("fillGradient"),this.type="linear",this.colorStops=[];let e=ta(t);e={...e.type==="radial"?ls.defaultRadialOptions:ls.defaultLinearOptions,...Oi(e)},this._textureSize=e.textureSize,this._wrapMode=e.wrapMode,e.type==="radial"?(this.center=e.center,this.outerCenter=e.outerCenter??this.center,this.innerRadius=e.innerRadius,this.outerRadius=e.outerRadius,this.scale=e.scale,this.rotation=e.rotation):(this.start=e.start,this.end=e.end),this.textureSpace=e.textureSpace,this.type=e.type,e.colorStops.forEach(r=>{this.addColorStop(r.offset,r.color)})}addColorStop(t,e){return this.colorStops.push({offset:t,color:ft.shared.setValue(e).toHexa()}),this}buildLinearGradient(){if(this.texture)return;let{x:t,y:e}=this.start,{x:i,y:r}=this.end,n=i-t,o=r-e;const a=n<0||o<0;if(this._wrapMode==="clamp-to-edge"){if(n<0){const m=t;t=i,i=m,n*=-1}if(o<0){const m=e;e=r,r=m,o*=-1}}const h=this.colorStops.length?this.colorStops:ri,c=this._textureSize,{canvas:l,context:u}=oi(c,1),p=a?u.createLinearGradient(this._textureSize,0,0,0):u.createLinearGradient(0,0,this._textureSize,0);ni(p,h),u.fillStyle=p,u.fillRect(0,0,c,1),this.texture=new j({source:new ve({resource:l,addressMode:this._wrapMode})});const d=Math.sqrt(n*n+o*o),x=Math.atan2(o,n),_=new N;_.scale(d/c,1),_.rotate(x),_.translate(t,e),this.textureSpace==="local"&&_.scale(c,c),this.transform=_}buildGradient(){this.type==="linear"?this.buildLinearGradient():this.buildRadialGradient()}buildRadialGradient(){if(this.texture)return;const t=this.colorStops.length?this.colorStops:ri,e=this._textureSize,{canvas:i,context:r}=oi(e,e),{x:n,y:o}=this.center,{x:a,y:h}=this.outerCenter,c=this.innerRadius,l=this.outerRadius,u=a-l,p=h-l,d=e/(l*2),x=(n-u)*d,_=(o-p)*d,m=r.createRadialGradient(x,_,c*d,(a-u)*d,(h-p)*d,l*d);ni(m,t),r.fillStyle=t[t.length-1].color,r.fillRect(0,0,e,e),r.fillStyle=m,r.translate(x,_),r.rotate(this.rotation),r.scale(1,this.scale),r.translate(-x,-_),r.fillRect(0,0,e,e),this.texture=new j({source:new ve({resource:i,addressMode:this._wrapMode})});const b=new N;b.scale(1/d,1/d),b.translate(u,p),this.textureSpace==="local"&&b.scale(e,e),this.transform=b}get styleKey(){return this.uid}destroy(){var t;(t=this.texture)==null||t.destroy(!0),this.texture=null}};bs.defaultLinearOptions={start:{x:0,y:0},end:{x:0,y:1},colorStops:[],textureSpace:"local",type:"linear",textureSize:256,wrapMode:"clamp-to-edge"};bs.defaultRadialOptions={center:{x:.5,y:.5},innerRadius:0,outerRadius:.5,colorStops:[],scale:1,textureSpace:"local",type:"radial",textureSize:256,wrapMode:"clamp-to-edge"};let ne=bs;function ni(s,t){for(let e=0;e<t.length;e++){const i=t[e];s.addColorStop(i.offset,i.color)}}function oi(s,t){const e=Tt.get().createCanvas(s,t),i=e.getContext("2d");return{canvas:e,context:i}}function ta(s){let t=s[0]??{};return(typeof t=="number"||s[1])&&(q("8.5.2","use options object instead"),t={type:"linear",start:{x:s[0],y:s[1]},end:{x:s[2],y:s[3]},textureSpace:s[4],textureSize:s[5]??ne.defaultLinearOptions.textureSize}),t}const ai={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 ea{constructor(t,e){this.uid=tt("fillPattern"),this.transform=new N,this._styleKey=null,this.texture=t,this.transform.scale(1/t.frame.width,1/t.frame.height),e&&(t.source.style.addressModeU=ai[e].addressModeU,t.source.style.addressModeV=ai[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._styleKey=null}get styleKey(){return this._styleKey?this._styleKey:(this._styleKey=`fill-pattern-${this.uid}-${this.texture.uid}-${this.transform.toArray().join("-")}`,this._styleKey)}}var $e,hi;function sa(){if(hi)return $e;hi=1,$e=e;var s={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},t=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function e(n){var o=[];return n.replace(t,function(a,h,c){var l=h.toLowerCase();for(c=r(c),l=="m"&&c.length>2&&(o.push([h].concat(c.splice(0,2))),l="l",h=h=="m"?"l":"L");;){if(c.length==s[l])return c.unshift(h),o.push(c);if(c.length<s[l])throw new Error("malformed path data");o.push([h].concat(c.splice(0,s[l])))}}),o}var i=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function r(n){var o=n.match(i);return o?o.map(Number):[]}return $e}var ia=sa();const ra=ps(ia);function na(s,t){const e=ra(s),i=[];let r=null,n=0,o=0;for(let a=0;a<e.length;a++){const h=e[a],c=h[0],l=h;switch(c){case"M":n=l[1],o=l[2],t.moveTo(n,o);break;case"m":n+=l[1],o+=l[2],t.moveTo(n,o);break;case"H":n=l[1],t.lineTo(n,o);break;case"h":n+=l[1],t.lineTo(n,o);break;case"V":o=l[1],t.lineTo(n,o);break;case"v":o+=l[1],t.lineTo(n,o);break;case"L":n=l[1],o=l[2],t.lineTo(n,o);break;case"l":n+=l[1],o+=l[2],t.lineTo(n,o);break;case"C":n=l[5],o=l[6],t.bezierCurveTo(l[1],l[2],l[3],l[4],n,o);break;case"c":t.bezierCurveTo(n+l[1],o+l[2],n+l[3],o+l[4],n+l[5],o+l[6]),n+=l[5],o+=l[6];break;case"S":n=l[3],o=l[4],t.bezierCurveToShort(l[1],l[2],n,o);break;case"s":t.bezierCurveToShort(n+l[1],o+l[2],n+l[3],o+l[4]),n+=l[3],o+=l[4];break;case"Q":n=l[3],o=l[4],t.quadraticCurveTo(l[1],l[2],n,o);break;case"q":t.quadraticCurveTo(n+l[1],o+l[2],n+l[3],o+l[4]),n+=l[3],o+=l[4];break;case"T":n=l[1],o=l[2],t.quadraticCurveToShort(n,o);break;case"t":n+=l[1],o+=l[2],t.quadraticCurveToShort(n,o);break;case"A":n=l[6],o=l[7],t.arcToSvg(l[1],l[2],l[3],l[4],l[5],n,o);break;case"a":n+=l[6],o+=l[7],t.arcToSvg(l[1],l[2],l[3],l[4],l[5],n,o);break;case"Z":case"z":t.closePath(),i.length>0&&(r=i.pop(),r?(n=r.startX,o=r.startY):(n=0,o=0)),r=null;break;default:ct(`Unknown SVG path command: ${c}`)}c!=="Z"&&c!=="z"&&r===null&&(r={startX:n,startY:o},i.push(r))}return t}class ws{constructor(t=0,e=0,i=0){this.type="circle",this.x=t,this.y=e,this.radius=i}clone(){return new ws(this.x,this.y,this.radius)}contains(t,e){if(this.radius<=0)return!1;const i=this.radius*this.radius;let r=this.x-t,n=this.y-e;return r*=r,n*=n,r+n<=i}strokeContains(t,e,i,r=.5){if(this.radius===0)return!1;const n=this.x-t,o=this.y-e,a=this.radius,h=(1-r)*i,c=Math.sqrt(n*n+o*o);return c<=a+h&&c>a-(i-h)}getBounds(t){return t||(t=new it),t.x=this.x-this.radius,t.y=this.y-this.radius,t.width=this.radius*2,t.he
vendor: 24,459 bytes, lines 30-216
30ight=this.radius*2,t}copyFrom(t){return this.x=t.x,this.y=t.y,this.radius=t.radius,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`}}class vs{constructor(t=0,e=0,i=0,r=0){this.type="ellipse",this.x=t,this.y=e,this.halfWidth=i,this.halfHeight=r}clone(){return new vs(this.x,this.y,this.halfWidth,this.halfHeight)}contains(t,e){if(this.halfWidth<=0||this.halfHeight<=0)return!1;let i=(t-this.x)/this.halfWidth,r=(e-this.y)/this.halfHeight;return i*=i,r*=r,i+r<=1}strokeContains(t,e,i,r=.5){const{halfWidth:n,halfHeight:o}=this;if(n<=0||o<=0)return!1;const a=i*(1-r),h=i-a,c=n-h,l=o-h,u=n+a,p=o+a,d=t-this.x,x=e-this.y,_=d*d/(c*c)+x*x/(l*l),m=d*d/(u*u)+x*x/(p*p);return _>1&&m<=1}getBounds(t){return t||(t=new it),t.x=this.x-this.halfWidth,t.y=this.y-this.halfHeight,t.width=this.halfWidth*2,t.height=this.halfHeight*2,t}copyFrom(t){return this.x=t.x,this.y=t.y,this.halfWidth=t.halfWidth,this.halfHeight=t.halfHeight,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:Ellipse x=${this.x} y=${this.y} halfWidth=${this.halfWidth} halfHeight=${this.halfHeight}]`}}function oa(s,t,e,i,r,n){const o=s-e,a=t-i,h=r-e,c=n-i,l=o*h+a*c,u=h*h+c*c;let p=-1;u!==0&&(p=l/u);let d,x;p<0?(d=e,x=i):p>1?(d=r,x=n):(d=e+p*h,x=i+p*c);const _=s-d,m=t-x;return _*_+m*m}let aa,ha;class Jt{constructor(...t){this.type="polygon";let e=Array.isArray(t[0])?t[0]:t;if(typeof e[0]!="number"){const i=[];for(let r=0,n=e.length;r<n;r++)i.push(e[r].x,e[r].y);e=i}this.points=e,this.closePath=!0}isClockwise(){let t=0;const e=this.points,i=e.length;for(let r=0;r<i;r+=2){const n=e[r],o=e[r+1],a=e[(r+2)%i],h=e[(r+3)%i];t+=(a-n)*(h+o)}return t<0}containsPolygon(t){const e=this.getBounds(aa),i=t.getBounds(ha);if(!e.containsRect(i))return!1;const r=t.points;for(let n=0;n<r.length;n+=2){const o=r[n],a=r[n+1];if(!this.contains(o,a))return!1}return!0}clone(){const t=this.points.slice(),e=new Jt(t);return e.closePath=this.closePath,e}contains(t,e){let i=!1;const r=this.points.length/2;for(let n=0,o=r-1;n<r;o=n++){const a=this.points[n*2],h=this.points[n*2+1],c=this.points[o*2],l=this.points[o*2+1];h>e!=l>e&&t<(c-a)*((e-h)/(l-h))+a&&(i=!i)}return i}strokeContains(t,e,i,r=.5){const n=i*i,o=n*(1-r),a=n-o,{points:h}=this,c=h.length-(this.closePath?0:2);for(let l=0;l<c;l+=2){const u=h[l],p=h[l+1],d=h[(l+2)%h.length],x=h[(l+3)%h.length],_=oa(t,e,u,p,d,x),m=Math.sign((d-u)*(e-p)-(x-p)*(t-u));if(_<=(m<0?a:o))return!0}return!1}getBounds(t){t||(t=new it);const e=this.points;let i=1/0,r=-1/0,n=1/0,o=-1/0;for(let a=0,h=e.length;a<h;a+=2){const c=e[a],l=e[a+1];i=c<i?c:i,r=c>r?c:r,n=l<n?l:n,o=l>o?l:o}return t.x=i,t.width=r-i,t.y=n,t.height=o-n,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 this.points[this.points.length-2]}get y(){return this.points[this.points.length-1]}}const me=(s,t,e,i,r,n,o)=>{const a=s-e,h=t-i,c=Math.sqrt(a*a+h*h);return c>=r-n&&c<=r+o};class Cs{constructor(t=0,e=0,i=0,r=0,n=20){this.type="roundedRectangle",this.x=t,this.y=e,this.width=i,this.height=r,this.radius=n}getBounds(t){return t||(t=new it),t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t}clone(){return new Cs(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 i=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(e>=this.y+i&&e<=this.y+this.height-i||t>=this.x+i&&t<=this.x+this.width-i)return!0;let r=t-(this.x+i),n=e-(this.y+i);const o=i*i;if(r*r+n*n<=o||(r=t-(this.x+this.width-i),r*r+n*n<=o)||(n=e-(this.y+this.height-i),r*r+n*n<=o)||(r=t-(this.x+i),r*r+n*n<=o))return!0}return!1}strokeContains(t,e,i,r=.5){const{x:n,y:o,width:a,height:h,radius:c}=this,l=i*(1-r),u=i-l,p=n+c,d=o+c,x=a-c*2,_=h-c*2,m=n+a,b=o+h;return(t>=n-l&&t<=n+u||t>=m-u&&t<=m+l)&&e>=d&&e<=d+_||(e>=o-l&&e<=o+u||e>=b-u&&e<=b+l)&&t>=p&&t<=p+x?!0:t<p&&e<d&&me(t,e,p,d,c,u,l)||t>m-c&&e<d&&me(t,e,m-c,d,c,u,l)||t>m-c&&e>b-c&&me(t,e,m-c,b-c,c,u,l)||t<p&&e>b-c&&me(t,e,p,b-c,c,u,l)}toString(){return`[pixi.js/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`}}const la=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(` 31`);function ca(s){let t="";for(let e=0;e<s;++e)e>0&&(t+=` 32else `),e<s-1&&(t+=`if(test == ${e}.0){}`);return t}function ua(s,t){if(s===0)throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");const e=t.createShader(t.FRAGMENT_SHADER);try{for(;;){const i=la.replace(/%forloop%/gi,ca(s));if(t.shaderSource(e,i),t.compileShader(e),!t.getShaderParameter(e,t.COMPILE_STATUS))s=s/2|0;else break}}finally{t.deleteShader(e)}return s}let Lt=null;function Gr(){var t;if(Lt)return Lt;const s=_r();return Lt=s.getParameter(s.MAX_TEXTURE_IMAGE_UNITS),Lt=ua(Lt,s),(t=s.getExtension("WEBGL_lose_context"))==null||t.loseContext(),Lt}const Fr={};function da(s,t){let e=2166136261;for(let i=0;i<t;i++)e^=s[i].uid,e=Math.imul(e,16777619),e>>>=0;return Fr[e]||fa(s,t,e)}let Xe=0;function fa(s,t,e){const i={};let r=0;Xe||(Xe=Gr());for(let o=0;o<Xe;o++){const a=o<t?s[o]:j.EMPTY.source;i[r++]=a.source,i[r++]=a.style}const n=new _e(i);return Fr[e]=n,n}class li{constructor(t){typeof t=="number"?this.rawBinaryData=new ArrayBuffer(t):t instanceof Uint8Array?this.rawBinaryData=t.buffer:this.rawBinaryData=t,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData),this.size=this.rawBinaryData.byteLength}get int8View(){return this._int8View||(this._int8View=new Int8Array(this.rawBinaryData)),this._int8View}get uint8View(){return this._uint8View||(this._uint8View=new Uint8Array(this.rawBinaryData)),this._uint8View}get int16View(){return this._int16View||(this._int16View=new Int16Array(this.rawBinaryData)),this._int16View}get int32View(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View}get float64View(){return this._float64Array||(this._float64Array=new Float64Array(this.rawBinaryData)),this._float64Array}get bigUint64View(){return this._bigUint64Array||(this._bigUint64Array=new BigUint64Array(this.rawBinaryData)),this._bigUint64Array}view(t){return this[`${t}View`]}destroy(){this.rawBinaryData=null,this._int8View=null,this._uint8View=null,this._int16View=null,this.uint16View=null,this._int32View=null,this.uint32View=null,this.float32View=null}static sizeOf(t){switch(t){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(`${t} isn't a valid view type`)}}}function ci(s,t){const e=s.byteLength/8|0,i=new Float64Array(s,0,e);new Float64Array(t,0,e).set(i);const n=s.byteLength-e*8;if(n>0){const o=new Uint8Array(s,e*8,n);new Uint8Array(t,e*8,n).set(o)}}const pa={normal:"normal-npm",add:"add-npm",screen:"screen-npm"};var ma=(s=>(s[s.DISABLED=0]="DISABLED",s[s.RENDERING_MASK_ADD=1]="RENDERING_MASK_ADD",s[s.MASK_ACTIVE=2]="MASK_ACTIVE",s[s.INVERSE_MASK_ACTIVE=3]="INVERSE_MASK_ACTIVE",s[s.RENDERING_MASK_REMOVE=4]="RENDERING_MASK_REMOVE",s[s.NONE=5]="NONE",s))(ma||{});function ui(s,t){return t.alphaMode==="no-premultiply-alpha"&&pa[s]||s}class ga{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 xa{constructor(){this.renderPipeId="batch",this.action="startBatch",this.start=0,this.size=0,this.textures=new ga,this.blendMode="normal",this.topology="triangle-strip",this.canBundle=!0}destroy(){this.textures=null,this.gpuBindGroup=null,this.bindGroup=null,this.batcher=null}}const Dr=[];let cs=0;function di(){return cs>0?Dr[--cs]:new xa}function fi(s){Dr[cs++]=s}let $t=0;const Lr=class be{constructor(t={}){this.uid=tt("batcher"),this.dirty=!0,this.batchIndex=0,this.batches=[],this._elements=[],be.defaultOptions.maxTextures=be.defaultOptions.maxTextures??Gr(),t={...be.defaultOptions,...t};const{maxTextures:e,attributesInitialSize:i,indicesInitialSize:r}=t;this.attributeBuffer=new li(i*4),this.indexBuffer=new Uint16Array(r),this.maxTextures=e}begin(){this.elementSize=0,this.elementStart=0,this.indexSize=0,this.attributeSize=0;for(let t=0;t<this.batchIndex;t++)fi(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 i=t._batch.textures.ids[e._source.uid];return!i&&i!==0?!1:(t._textureId=i,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 i=di(),r=i.textures;r.clear();const n=e[this.elementStart];let o=ui(n.blendMode,n.texture._source),a=n.topology;this.attributeSize*4>this.attributeBuffer.size&&this._resizeAttributeBuffer(this.attributeSize*4),this.indexSize>this.indexBuffer.length&&this._resizeIndexBuffer(this.indexSize);const h=this.attributeBuffer.float32View,c=this.attributeBuffer.uint32View,l=this.indexBuffer;let u=this._batchIndexSize,p=this._batchIndexStart,d="startBatch";const x=this.maxTextures;for(let _=this.elementStart;_<this.elementSize;++_){const m=e[_];e[_]=null;const w=m.texture._source,A=ui(m.blendMode,w),C=o!==A||a!==m.topology;if(w._batchTick===$t&&!C){m._textureId=w._textureBindLocation,u+=m.indexSize,m.packAsQuad?(this.packQuadAttributes(m,h,c,m._attributeStart,m._textureId),this.packQuadIndex(l,m._indexStart,m._attributeStart/this.vertexSize)):(this.packAttributes(m,h,c,m._attributeStart,m._textureId),this.packIndex(m,l,m._indexStart,m._attributeStart/this.vertexSize)),m._batch=i;continue}w._batchTick=$t,(r.count>=x||C)&&(this._finishBatch(i,p,u-p,r,o,a,t,d),d="renderBatch",p=u,o=A,a=m.topology,i=di(),r=i.textures,r.clear(),++$t),m._textureId=w._textureBindLocation=r.count,r.ids[w.uid]=r.count,r.textures[r.count++]=w,m._batch=i,u+=m.indexSize,m.packAsQuad?(this.packQuadAttributes(m,h,c,m._attributeStart,m._textureId),this.packQuadIndex(l,m._indexStart,m._attributeStart/this.vertexSize)):(this.packAttributes(m,h,c,m._attributeStart,m._textureId),this.packIndex(m,l,m._indexStart,m._attributeStart/this.vertexSize))}r.count>0&&(this._finishBatch(i,p,u-p,r,o,a,t,d),p=u,++$t),this.elementStart=this.elementSize,this._batchIndexStart=p,this._batchIndexSize=u}_finishBatch(t,e,i,r,n,o,a,h){t.gpuBindGroup=null,t.bindGroup=null,t.action=h,t.batcher=this,t.textures=r,t.blendMode=n,t.topology=o,t.start=e,t.size=i,++$t,this.batches[this.batchIndex++]=t,a.add(t)}finish(t){this.break(t)}ensureAttributeBuffer(t){t*4<=this.attributeBuffer.size||this._resizeAttributeBuffer(t*4)}ensureIndexBuffer(t){t<=this.indexBuffer.length||this._resizeIndexBuffer(t)}_resizeAttributeBuffer(t){const e=Math.max(t,this.attributeBuffer.size*2),i=new li(e);ci(this.attributeBuffer.rawBinaryData,i.rawBinaryData),this.attributeBuffer=i}_resizeIndexBuffer(t){const e=this.indexBuffer;let i=Math.max(t,e.length*1.5);i+=i%2;const r=i>65535?new Uint32Array(i):new Uint16Array(i);if(r.BYTES_PER_ELEMENT!==e.BYTES_PER_ELEMENT)for(let n=0;n<e.length;n++)r[n]=e[n];else ci(e.buffer,r.buffer);this.indexBuffer=r}packQuadIndex(t,e,i){t[e]=i+0,t[e+1]=i+1,t[e+2]=i+2,t[e+3]=i+0,t[e+4]=i+2,t[e+5]=i+3}packIndex(t,e,i,r){const n=t.indices,o=t.indexSize,a=t.indexOffset,h=t.attributeOffset;for(let c=0;c<o;c++)e[i++]=r+n[c+a]-h}destroy(){for(let t=0;t<this.batches.length;t++)fi(this.batches[t]);this.batches=null;for(let t=0;t<this._elements.length;t++)this._elements[t]._batch=null;this._elements=null,this.indexBuffer=null,this.attributeBuffer.destroy(),this.attributeBuffer=null}};Lr.defaultOptions={maxTextures:null,attributesInitialSize:4,indicesInitialSize:6};let ya=Lr;var ot=(s=>(s[s.MAP_READ=1]="MAP_READ",s[s.MAP_WRITE=2]="MAP_WRITE",s[s.COPY_SRC=4]="COPY_SRC",s[s.COPY_DST=8]="COPY_DST",s[s.INDEX=16]="INDEX",s[s.VERTEX=32]="VERTEX",s[s.UNIFORM=64]="UNIFORM",s[s.STORAGE=128]="STORAGE",s[s.INDIRECT=256]="INDIRECT",s[s.QUERY_RESOLVE=512]="QUERY_RESOLVE",s[s.STATIC=1024]="STATIC",s))(ot||{});class ie extends Mt{constructor(t){let{data:e,size:i}=t;const{usage:r,label:n,shrinkToFit:o}=t;super(),this.uid=tt("buffer"),this._resourceType="buffer",this._resourceId=tt("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,i??(i=e==null?void 0:e.byteLength);const a=!!e;this.descriptor={size:i,usage:r,mappedAtCreation:a,label:n},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&ot.STATIC)}set static(t){t?this.descriptor.usage|=ot.STATIC:this.descriptor.usage&=~ot.STATIC}setDataWithSize(t,e,i){if(this._updateID++,this._updateSize=e*t.BYTES_PER_ELEMENT,this._data===t){i&&this.emit("update",this);return}const r=this._data;if(this._data=t,this._dataInt32=null,!r||r.length!==t.length){!this.shrinkToFit&&r&&t.byteLength<r.byteLength?i&&this.emit("update",this):(this.descriptor.size=t.byteLength,this._resourceId=tt("resource"),this.emit("change",this));return}i&&this.emit("update",this)}update(t){this._updateSize=t??this._updateSize,this._updateID++,this.emit("update",this)}destroy(){this.destroyed=!0,this.emit("destroy",this),this.emit("change",this),this._data=null,this.descriptor=null,this.removeAllListeners()}}function zr(s,t){if(!(s instanceof ie)){let e=t?ot.INDEX:ot.VERTEX;s instanceof Array&&(t?(s=new Uint32Array(s),e=ot.INDEX|ot.COPY_DST):(s=new Float32Array(s),e=ot.VERTEX|ot.COPY_DST)),s=new ie({data:s,label:t?"index-mesh-buffer":"vertex-mesh-buffer",usage:e})}return s}function _a(s,t,e){const i=s.getAttribute(t);if(!i)return e.minX=0,e.minY=0,e.maxX=0,e.maxY=0,e;const r=i.buffer.data;let n=1/0,o=1/0,a=-1/0,h=-1/0;const c=r.BYTES_PER_ELEMENT,l=(i.offset||0)/c,u=(i.stride||2*4)/c;for(let p=l;p<r.length;p+=u){const d=r[p],x=r[p+1];d>a&&(a=d),x>h&&(h=x),d<n&&(n=d),x<o&&(o=x)}return e.minX=n,e.minY=o,e.maxX=a,e.maxY=h,e}function ba(s){return(s instanceof ie||Array.isArray(s)||s.BYTES_PER_ELEMENT)&&(s={buffer:s}),s.buffer=zr(s.buffer,!1),s}class wa extends Mt{constructor(t={}){super(),this.uid=tt("geometry"),this._layoutKey=0,this.instanceCount=1,this._bounds=new gt,this._boundsDirty=!0;const{attributes:e,indexBuffer:i,topology:r}=t;if(this.buffers=[],this.attributes={},e)for(const n in e)this.addAttribute(n,e[n]);this.instanceCount=t.instanceCount??1,i&&this.addIndex(i),this.topology=r||"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 i=ba(e);this.buffers.indexOf(i.buffer)===-1&&(this.buffers.push(i.buffer),i.buffer.on("update",this.onBufferUpdate,this),i.buffer.on("change",this.onBufferUpdate,this)),this.attributes[t]=i}addIndex(t){this.indexBuffer=zr(t,!0),this.buffers.push(this.indexBuffer)}get bounds(){return this._boundsDirty?(this._boundsDirty=!1,_a(this,"aPosition",this._bounds)):this._bounds}destroy(t=!1){this.emit("destroy",this),this.removeAllListeners(),t&&this.buffers.forEach(e=>e.destroy()),this.attributes=null,this.buffers=null,this.indexBuffer=null,this._bounds=null}}const va=new Float32Array(1),Ca=new Uint32Array(1);class Aa extends wa{constructor(){const e=new ie({data:va,label:"attribute-batch-buffer",usage:ot.VERTEX|ot.COPY_DST,shrinkToFit:!1}),i=new ie({data:Ca,label:"index-batch-buffer",usage:ot.INDEX|ot.COPY_DST,shrinkToFit:!1}),r=6*4;super({attributes:{aPosition:{buffer:e,format:"float32x2",stride:r,offset:0},aUV:{buffer:e,format:"float32x2",stride:r,offset:2*4},aColor:{buffer:e,format:"unorm8x4",stride:r,offset:4*4},aTextureIdAndRound:{buffer:e,format:"uint16x2",stride:r,offset:5*4}},indexBuffer:i})}}function pi(s,t,e){if(s)for(const i in s){const r=i.toLocaleLowerCase(),n=t[r];if(n){let o=s[i];i==="header"&&(o=o.replace(/@in\s+[^;]+;\s*/g,"").replace(/@out\s+[^;]+;\s*/g,"")),e&&n.push(`//----${e}----//`),n.push(o)}else ct(`${i} placement hook does not exist in shader`)}}const Sa=/\{\{(.*?)\}\}/g;function mi(s){var i;const t={};return(((i=s.match(Sa))==null?void 0:i.map(r=>r.replace(/[{()}]/g,"")))??[]).forEach(r=>{t[r]=[]}),t}function gi(s,t){let e;const i=/@in\s+([^;]+);/g;for(;(e=i.exec(s))!==null;)t.push(e[1])}function xi(s,t,e=!1){const i=[];gi(t,i),s.forEach(a=>{a.header&&gi(a.header,i)});const r=i;e&&r.sort();const n=r.map((a,h)=>` @location(${h}) ${a},`).join(` 33`);let o=t.replace(/@in\s+[^;]+;\s*/g,"");return o=o.replace("{{in}}",` 34${n} 35`),o}function yi(s,t){let e;const i=/@out\s+([^;]+);/g;for(;(e=i.exec(s))!==null;)t.push(e[1])}function Ma(s){const e=/\b(\w+)\s*:/g.exec(s);return e?e[1]:""}function Pa(s){const t=/@.*?\s+/g;return s.replace(t,"")}function Ta(s,t){const e=[];yi(t,e),s.forEach(h=>{h.header&&yi(h.header,e)});let i=0;const r=e.sort().map(h=>h.indexOf("builtin")>-1?h:`@location(${i++}) ${h}`).join(`, 36`),n=e.sort().map(h=>` var ${Pa(h)};`).join(` 37`),o=`return VSOutput( 38 ${e.sort().map(h=>` ${Ma(h)}`).join(`, 39`)});`;let a=t.replace(/@out\s+[^;]+;\s*/g,"");return a=a.replace("{{struct}}",` 40${r} 41`),a=a.replace("{{start}}",` 42${n} 43`),a=a.replace("{{return}}",` 44${o} 45`),a}function _i(s,t){let e=s;for(const i in t){const r=t[i];r.join(` 46`).length?e=e.replace(`{{${i}}}`,`//-----${i} START-----// 47${r.join(` 48`)} 49//----${i} FINISH----//`):e=e.replace(`{{${i}}}`,"")}return e}const Pt=Object.create(null),We=new Map;let ka=0;function Ea({template:s,bits:t}){const e=Ur(s,t);if(Pt[e])return Pt[e];const{vertex:i,fragment:r}=Ra(s,t);return Pt[e]=Nr(i,r,t),Pt[e]}function Ia({template:s,bits:t}){const e=Ur(s,t);return Pt[e]||(Pt[e]=Nr(s.vertex,s.fragment,t)),Pt[e]}function Ra(s,t){const e=t.map(o=>o.vertex).filter(o=>!!o),i=t.map(o=>o.fragment).filter(o=>!!o);let r=xi(e,s.vertex,!0);r=Ta(e,r);const n=xi(i,s.fragment,!0);return{vertex:r,fragment:n}}function Ur(s,t){return t.map(e=>(We.has(e)||We.set(e,ka++),We.get(e))).sort((e,i)=>e-i).join("-")+s.vertex+s.fragment}function Nr(s,t,e){const i=mi(s),r=mi(t);return e.forEach(n=>{pi(n.vertex,i,n.name),pi(n.fragment,r,n.name)}),{vertex:_i(s,i),fragment:_i(t,r)}}const Ba=` 50 @in aPosition: vec2<f32>; 51 @in aUV: vec2<f32>; 52 53 @out @builtin(position) vPosition: vec4<f32>; 54 @out vUV : vec2<f32>; 55 @out vColor : vec4<f32>; 56 57 {{header}} 58 59 struct VSOutput { 60 {{struct}} 61 }; 62 63 @vertex 64 fn main( {{in}} ) -> VSOutput { 65 66 var worldTransformMatrix = globalUniforms.uWorldTransformMatrix; 67 var modelMatrix = mat3x3<f32>( 68 1.0, 0.0, 0.0, 69 0.0, 1.0, 0.0, 70 0.0, 0.0, 1.0 71 ); 72 var position = aPosition; 73 var uv = aUV; 74 75 {{start}} 76 77 vColor = vec4<f32>(1., 1., 1., 1.); 78 79 {{main}} 80 81 vUV = uv; 82 83 var modelViewProjectionMatrix = globalUniforms.uProjectionMatrix * worldTransformMatrix * modelMatrix; 84 85 vPosition = vec4<f32>((modelViewProjectionMatrix * vec3<f32>(position, 1.0)).xy, 0.0, 1.0); 86 87 vColor *= globalUniforms.uWorldColorAlpha; 88 89 {{end}} 90 91 {{return}} 92 }; 93`,Ga=` 94 @in vUV : vec2<f32>; 95 @in vColor : vec4<f32>; 96 97 {{header}} 98 99 @fragment 100 fn main( 101 {{in}} 102 ) -> @location(0) vec4<f32> { 103 104 {{start}} 105 106 var outColor:vec4<f32>; 107 108 {{main}} 109 110 var finalColor:vec4<f32> = outColor * vColor; 111 112 {{end}} 113 114 return finalColor; 115 }; 116`,Fa=` 117 in vec2 aPosition; 118 in vec2 aUV; 119 120 out vec4 vColor; 121 out vec2 vUV; 122 123 {{header}} 124 125 void main(void){ 126 127 mat3 worldTransformMatrix = uWorldTransformMatrix; 128 mat3 modelMatrix = mat3( 129 1.0, 0.0, 0.0, 130 0.0, 1.0, 0.0, 131 0.0, 0.0, 1.0 132 ); 133 vec2 position = aPosition; 134 vec2 uv = aUV; 135 136 {{start}} 137 138 vColor = vec4(1.); 139 140 {{main}} 141 142 vUV = uv; 143 144 mat3 modelViewProjectionMatrix = uProjectionMatrix * worldTransformMatrix * modelMatrix; 145 146 gl_Position = vec4((modelViewProjectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0); 147 148 vColor *= uWorldColorAlpha; 149 150 {{end}} 151 } 152`,Da=` 153 154 in vec4 vColor; 155 in vec2 vUV; 156 157 out vec4 finalColor; 158 159 {{header}} 160 161 void main(void) { 162 163 {{start}} 164 165 vec4 outColor; 166 167 {{main}} 168 169 finalColor = outColor * vColor; 170 171 {{end}} 172 } 173`,La={name:"global-uniforms-bit",vertex:{header:` 174 struct GlobalUniforms { 175 uProjectionMatrix:mat3x3<f32>, 176 uWorldTransformMatrix:mat3x3<f32>, 177 uWorldColorAlpha: vec4<f32>, 178 uResolution: vec2<f32>, 179 } 180 181 @group(0) @binding(0) var<uniform> globalUniforms : GlobalUniforms; 182 `}},za={name:"global-uniforms-bit",vertex:{header:` 183 uniform mat3 uProjectionMatrix; 184 uniform mat3 uWorldTransformMatrix; 185 uniform vec4 uWorldColorAlpha; 186 uniform vec2 uResolution; 187 `}};function Ua({bits:s,name:t}){const e=Ea({template:{fragment:Ga,vertex:Ba},bits:[La,...s]});return Se.from({name:t,vertex:{source:e.vertex,entryPoint:"main"},fragment:{source:e.fragment,entryPoint:"main"}})}function Na({bits:s,name:t}){return new wr({name:t,...Ia({template:{vertex:Fa,fragment:Da},bits:[za,...s]})})}const Ha={name:"color-bit",vertex:{header:` 188 @in aColor: vec4<f32>; 189 `,main:` 190 vColor *= vec4<f32>(aColor.rgb * aColor.a, aColor.a); 191 `}},Oa={name:"color-bit",vertex:{header:` 192 in vec4 aColor; 193 `,main:` 194 vColor *= vec4(aColor.rgb * aColor.a, aColor.a); 195 `}},je={};function Va(s){const t=[];if(s===1)t.push("@group(1) @binding(0) var textureSource1: texture_2d<f32>;"),t.push("@group(1) @binding(1) var textureSampler1: sampler;");else{let e=0;for(let i=0;i<s;i++)t.push(`@group(1) @binding(${e++}) var textureSource${i+1}: texture_2d<f32>;`),t.push(`@group(1) @binding(${e++}) var textureSampler${i+1}: sampler;`)}return t.join(` 196`)}function Ya(s){const t=[];if(s===1)t.push("outColor = textureSampleGrad(textureSource1, textureSampler1, vUV, uvDx, uvDy);");else{t.push("switch vTextureId {");for(let e=0;e<s;e++)e===s-1?t.push(" default:{"):t.push(` case ${e}:{`),t.push(` outColor = textureSampleGrad(textureSource${e+1}, textureSampler${e+1}, vUV, uvDx, uvDy);`),t.push(" break;}");t.push("}")}return t.join(` 197`)}function $a(s){return je[s]||(je[s]={name:"texture-batch-bit",vertex:{header:` 198 @in aTextureIdAndRound: vec2<u32>; 199 @out @interpolate(flat) vTextureId : u32; 200 `,main:` 201 vTextureId = aTextureIdAndRound.y; 202 `,end:` 203 if(aTextureIdAndRound.x == 1) 204 { 205 vPosition = vec4<f32>(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw); 206 } 207 `},fragment:{header:` 208 @in @interpolate(flat) vTextureId: u32; 209 210 ${Va(s)} 211 `,main:` 212 var uvDx = dpdx(vUV); 213 var uvDy = dpdy(vUV); 214 215 ${Ya(s)} 216 `}}),je[s]}const qe={};function Xa(s){const t=[];for(let e=0;e<s;e++)e>0&&t.push("else"),e<s-1&&t.push(`if(vTextureId < ${e}
216.5)`),t.push("{"),t.push(` outColor = texture(uTextures[${e}], vUV);`),t.push("}");return t.join(` 217`)}function Wa(s){return qe[s]||(qe[s]={name:"texture-batch-bit",vertex:{header:` 218 in vec2 aTextureIdAndRound; 219 out float vTextureId; 220 221 `,main:` 222 vTextureId = aTextureIdAndRound.y; 223 `,end:` 224 if(aTextureIdAndRound.x == 1.) 225 { 226 gl_Position.xy = roundPixels(gl_Position.xy, uResolution); 227 } 228 `},fragment:{header:` 229 in float vTextureId; 230 231 uniform sampler2D uTextures[${s}]; 232 233 `,main:` 234 235 ${Xa(s)} 236 `}}),qe[s]}const ja={name:"round-pixels-bit",vertex:{header:` 237 fn roundPixels(position: vec2<f32>, targetSize: vec2<f32>) -> vec2<f32> 238 { 239 return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0; 240 } 241 `}},qa={name:"round-pixels-bit",vertex:{header:` 242 vec2 roundPixels(vec2 position, vec2 targetSize) 243 { 244 return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0; 245 } 246 `}},bi={};function Za(s){let t=bi[s];if(t)return t;const e=new Int32Array(s);for(let i=0;i<s;i++)e[i]=i;return t=bi[s]=new Sr({uTextures:{value:e,type:"i32",size:s}},{isStatic:!0}),t}class Ka extends _s{constructor(t){const e=Na({name:"batch",bits:[Oa,Wa(t),qa]}),i=Ua({name:"batch",bits:[Ha,$a(t),ja]});super({glProgram:e,gpuProgram:i,resources:{batchSamplers:Za(t)}})}}let wi=null;const Hr=class Or extends ya{constructor(){super(...arguments),this.geometry=new Aa,this.shader=wi||(wi=new Ka(this.maxTextures)),this.name=Or.extension.name,this.vertexSize=6}packAttributes(t,e,i,r,n){const o=n<<16|t.roundPixels&65535,a=t.transform,h=a.a,c=a.b,l=a.c,u=a.d,p=a.tx,d=a.ty,{positions:x,uvs:_}=t,m=t.color,b=t.attributeOffset,w=b+t.attributeSize;for(let A=b;A<w;A++){const C=A*2,E=x[C],S=x[C+1];e[r++]=h*E+l*S+p,e[r++]=u*S+c*E+d,e[r++]=_[C],e[r++]=_[C+1],i[r++]=m,i[r++]=o}}packQuadAttributes(t,e,i,r,n){const o=t.texture,a=t.transform,h=a.a,c=a.b,l=a.c,u=a.d,p=a.tx,d=a.ty,x=t.bounds,_=x.maxX,m=x.minX,b=x.maxY,w=x.minY,A=o.uvs,C=t.color,E=n<<16|t.roundPixels&65535;e[r+0]=h*m+l*w+p,e[r+1]=u*w+c*m+d,e[r+2]=A.x0,e[r+3]=A.y0,i[r+4]=C,i[r+5]=E,e[r+6]=h*_+l*w+p,e[r+7]=u*w+c*_+d,e[r+8]=A.x1,e[r+9]=A.y1,i[r+10]=C,i[r+11]=E,e[r+12]=h*_+l*b+p,e[r+13]=u*b+c*_+d,e[r+14]=A.x2,e[r+15]=A.y2,i[r+16]=C,i[r+17]=E,e[r+18]=h*m+l*b+p,e[r+19]=u*b+c*m+d,e[r+20]=A.x3,e[r+21]=A.y3,i[r+22]=C,i[r+23]=E}};Hr.extension={type:[W.Batcher],name:"default"};let Qa=Hr;function Ja(s,t,e,i,r,n,o,a=null){let h=0;e*=t,r*=n;const c=a.a,l=a.b,u=a.c,p=a.d,d=a.tx,x=a.ty;for(;h<o;){const _=s[e],m=s[e+1];i[r]=c*_+u*m+d,i[r+1]=l*_+p*m+x,r+=n,e+=t,h++}}function th(s,t,e,i){let r=0;for(t*=e;r<i;)s[t]=0,s[t+1]=0,t+=e,r++}function Vr(s,t,e,i,r){const n=t.a,o=t.b,a=t.c,h=t.d,c=t.tx,l=t.ty;e||(e=0),i||(i=2),r||(r=s.length/i-e);let u=e*i;for(let p=0;p<r;p++){const d=s[u],x=s[u+1];s[u]=n*d+a*x+c,s[u+1]=o*d+h*x+l,u+=i}}const eh=new N;class Yr{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.applyTransform?this.renderable.groupBlendMode:"normal"}get color(){const t=this.baseColor,e=t>>16|t&65280|(t&255)<<16,i=this.renderable;return i?Qi(e,i.groupColor)+(this.alpha*i.groupAlpha*255<<24):e+(this.alpha*255<<24)}get transform(){var t;return((t=this.renderable)==null?void 0:t.groupTransform)||eh}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"}}const re={extension:{type:W.ShapeBuilder,name:"circle"},build(s,t){let e,i,r,n,o,a;if(s.type==="circle"){const C=s;e=C.x,i=C.y,o=a=C.radius,r=n=0}else if(s.type==="ellipse"){const C=s;e=C.x,i=C.y,o=C.halfWidth,a=C.halfHeight,r=n=0}else{const C=s,E=C.width/2,S=C.height/2;e=C.x+E,i=C.y+S,o=a=Math.max(0,Math.min(C.radius,Math.min(E,S))),r=E-o,n=S-a}if(!(o>=0&&a>=0&&r>=0&&n>=0))return t;const h=Math.ceil(2.3*Math.sqrt(o+a)),c=h*8+(r?4:0)+(n?4:0);if(c===0)return t;if(h===0)return t[0]=t[6]=e+r,t[1]=t[3]=i+n,t[2]=t[4]=e-r,t[5]=t[7]=i-n,t;let l=0,u=h*4+(r?2:0)+2,p=u,d=c,x=r+o,_=n,m=e+x,b=e-x,w=i+_;
vendor: 5,824 bytes, line 246
246if(t[l++]=m,t[l++]=w,t[--u]=w,t[--u]=b,n){const C=i-_;t[p++]=b,t[p++]=C,t[--d]=C,t[--d]=m}for(let C=1;C<h;C++){const E=Math.PI/2*(C/h),S=r+Math.cos(E)*o,P=n+Math.sin(E)*a,D=e+S,G=e-S,R=i+P,B=i-P;t[l++]=D,t[l++]=R,t[--u]=R,t[--u]=G,t[p++]=G,t[p++]=B,t[--d]=B,t[--d]=D}x=r,_=n+a,m=e+x,b=e-x,w=i+_;const A=i-_;return t[l++]=m,t[l++]=w,t[--d]=A,t[--d]=m,r&&(t[l++]=b,t[l++]=w,t[--d]=A,t[--d]=b),t},triangulate(s,t,e,i,r,n){if(s.length===0)return;let o=0,a=0;for(let l=0;l<s.length;l+=2)o+=s[l],a+=s[l+1];o/=s.length/2,a/=s.length/2;let h=i;t[h*e]=o,t[h*e+1]=a;const c=h++;for(let l=0;l<s.length;l+=2)t[h*e]=s[l],t[h*e+1]=s[l+1],l>0&&(r[n++]=h,r[n++]=c,r[n++]=h-1),h++;r[n++]=c+1,r[n++]=c,r[n++]=h-1}},sh={...re,extension:{...re.extension,name:"ellipse"}},ih={...re,extension:{...re.extension,name:"roundedRectangle"}},$r=1e-4,vi=1e-4;function rh(s){const t=s.length;if(t<6)return 1;let e=0;for(let i=0,r=s[t-2],n=s[t-1];i<t;i+=2){const o=s[i],a=s[i+1];e+=(o-r)*(a+n),r=o,n=a}return e<0?-1:1}function Ci(s,t,e,i,r,n,o,a){const h=s-e*r,c=t-i*r,l=s+e*n,u=t+i*n;let p,d;o?(p=i,d=-e):(p=-i,d=e);const x=h+p,_=c+d,m=l+p,b=u+d;return a.push(x,_),a.push(m,b),2}function Et(s,t,e,i,r,n,o,a){const h=e-s,c=i-t;let l=Math.atan2(h,c),u=Math.atan2(r-s,n-t);a&&l<u?l+=Math.PI*2:!a&&l>u&&(u+=Math.PI*2);let p=l;const d=u-l,x=Math.abs(d),_=Math.sqrt(h*h+c*c),m=(15*x*Math.sqrt(_)/Math.PI>>0)+1,b=d/m;if(p+=b,a){o.push(s,t),o.push(e,i);for(let w=1,A=p;w<m;w++,A+=b)o.push(s,t),o.push(s+Math.sin(A)*_,t+Math.cos(A)*_);o.push(s,t),o.push(r,n)}else{o.push(e,i),o.push(s,t);for(let w=1,A=p;w<m;w++,A+=b)o.push(s+Math.sin(A)*_,t+Math.cos(A)*_),o.push(s,t);o.push(r,n),o.push(s,t)}return m*2}function nh(s,t,e,i,r,n){const o=$r;if(s.length===0)return;const a=t;let h=a.alignment;if(t.alignment!==.5){let v=rh(s);h=(h-.5)*v+.5}const c=new rt(s[0],s[1]),l=new rt(s[s.length-2],s[s.length-1]),u=i,p=Math.abs(c.x-l.x)<o&&Math.abs(c.y-l.y)<o;if(u){s=s.slice(),p&&(s.pop(),s.pop(),l.set(s[s.length-2],s[s.length-1]));const v=(c.x+l.x)*.5,M=(l.y+c.y)*.5;s.unshift(v,M),s.push(v,M)}const d=r,x=s.length/2;let _=s.length;const m=d.length/2,b=a.width/2,w=b*b,A=a.miterLimit*a.miterLimit;let C=s[0],E=s[1],S=s[2],P=s[3],D=0,G=0,R=-(E-P),B=C-S,Y=0,H=0,Z=Math.sqrt(R*R+B*B);R/=Z,B/=Z,R*=b,B*=b;const ut=h,f=(1-ut)*2,g=ut*2;u||(a.cap==="round"?_+=Et(C-R*(f-g)*.5,E-B*(f-g)*.5,C-R*f,E-B*f,C+R*g,E+B*g,d,!0)+2:a.cap==="square"&&(_+=Ci(C,E,R,B,f,g,!0,d))),d.push(C-R*f,E-B*f),d.push(C+R*g,E+B*g);for(let v=1;v<x-1;++v){C=s[(v-1)*2],E=s[(v-1)*2+1],S=s[v*2],P=s[v*2+1],D=s[(v+1)*2],G=s[(v+1)*2+1],R=-(E-P),B=C-S,Z=Math.sqrt(R*R+B*B),R/=Z,B/=Z,R*=b,B*=b,Y=-(P-G),H=S-D,Z=Math.sqrt(Y*Y+H*H),Y/=Z,H/=Z,Y*=b,H*=b;const M=S-C,T=E-P,k=S-D,I=G-P,L=M*k+T*I,F=T*k-I*M,$=F<0;if(Math.abs(F)<.001*Math.abs(L)){d.push(S-R*f,P-B*f),d.push(S+R*g,P+B*g),L>=0&&(a.join==="round"?_+=Et(S,P,S-R*f,P-B*f,S-Y*f,P-H*f,d,!1)+4:_+=2,d.push(S-Y*g,P-H*g),d.push(S+Y*f,P+H*f));continue}const X=(-R+C)*(-B+P)-(-R+S)*(-B+E),U=(-Y+D)*(-H+P)-(-Y+S)*(-H+G),J=(M*U-k*X)/F,V=(I*X-T*U)/F,vt=(J-S)*(J-S)+(V-P)*(V-P),at=S+(J-S)*f,xt=P+(V-P)*f,yt=S-(J-S)*g,z=P-(V-P)*g,O=Math.min(M*M+T*T,k*k+I*I),Ms=$?f:g,Qr=O+Ms*Ms*w;vt<=Qr?a.join==="bevel"||vt/w>A?($?(d.push(at,xt),d.push(S+R*g,P+B*g),d.push(at,xt),d.push(S+Y*g,P+H*g)):(d.push(S-R*f,P-B*f),d.push(yt,z),d.push(S-Y*f,P-H*f),d.push(yt,z)),_+=2):a.join==="round"?$?(d.push(at,xt),d.push(S+R*g,P+B*g),_+=Et(S,P,S+R*g,P+B*g,S+Y*g,P+H*g,d,!0)+4,d.push(at,xt),d.push(S+Y*g,P+H*g)):(d.push(S-R*f,P-B*f),d.push(yt,z),_+=Et(S,P,S-R*f,P-B*f,S-Y*f,P-H*f,d,!1)+4,d.push(S-Y*f,P-H*f),d.push(yt,z)):(d.push(at,xt),d.push(yt,z)):(d.push(S-R*f,P-B*f),d.push(S+R*g,P+B*g),a.join==="round"?$?_+=Et(S,P,S+R*g,P+B*g,S+Y*g,P+H*g,d,!0)+2:_+=Et(S,P,S-R*f,P-B*f,S-Y*f,P-H*f,d,!1)+2:a.join==="miter"&&vt/w<=A&&($?(d.push(yt,z),d.push(yt,z)):(d.push(at,xt),d.push(at,xt)),_+=2),d.push(S-Y*f,P-H*f),d.push(S+Y*g,P+H*g),_+=2)}C=s[(x-2)*2],E=s[(x-2)*2+1],S=s[(x-1)*2],P=s[(x-1)*2+1],R=-(E-P),B=C-S,Z=Math.sqrt(R*R+B*B),R/=Z,B/=Z,R*=b,B*=b,d.push(S-R*f,P-B*f),d.push(S+R*g,P+B*g),u||(a.cap==="round"?_+=Et(S-R*(f-g)*.5,P-B*(f-g)*.5,S-R*f,P-B*f,S+R*g,P+B*g,d,!1)+2:a.cap==="square"&&(_+=Ci(S,P,R,B,f,g,!1,d)));const y=vi*vi;for(let v=m;v<_+m-2;++v)C=d[v*2],E=d[v*2+1],S=d[(v+1)*2],P=d[(v+1)*2+1],D=d[(v+2)*2],G=d[(v+2)*2+1],!(Math.abs(C*(P-G)+S*(G-E)+D*(E-P))<y)&&n.push(v,v+1,v+2)}function oh(s,t,e,i){const r=$r;if(s.length===0)return;const n=s[0],o=s[1],a=s[s.length-2],h=s[s.length-1],c=t||Math.abs(n-a)<r&&Math.abs(o-h)<r,l=e,u=s.length/2,p=l.length/2;for(let d=0;d<u;d++)l.push(s[d*2]),l.push(s[d*2+1]);for(let d=0;d<u-1;d++)i.push(p+d,p+d+1);c&&i.push(p+u-1,p)}function Xr(s,t,e,i,r,n,o){const a=Wo(s,t,2);if(!a)return;for(let c=0;c<a.length;c+=3)n[o++]=a[c]+r,n[o++]=a[c+1]+r,n[o++]=a[c+2]+r;let h=r*i;for(let c=0;c<s.length;c+=2)e[h]=s[c],e[h+1]=s[c+1],h+=i}const ah=[],hh={extension:{type:W.ShapeBuilder,name:"polygon"},build(s,t){for(let e=0;e<s.points.length;e++)t[e]=s.points[e];return t},triangulate(s,t,e,i,r,n){Xr(s,ah,t,e,i,r,n)}},lh={extension:{type:W.ShapeBuilder,name:"rectangle"},build(s,t){const e=s,i=e.x,r=e.y,n=e.width,o=e.height;return n>=0&&o>=0&&(t[0]=i,t[1]=r,t[2]=i+n,t[3]=r,t[4]=i+n,t[5]=r+o,t[6]=i,t[7]=r+o),t},triangulate(s,t,e,i,r,n){let o=0;i*=e,t[i+o]=s[0],t[i+o+1]=s[1],o+=e,t[i+o]=s[2],t[i+o+1]=s[3],o+=e,t[i+o]=s[6],t[i+o+1]=s[7],o+=e,t[i+o]=s[4],t[i+o+1]=s[5],o+=e;const a=i/e;r[n++]=a,r[n++]=a+1,r[n++]=a+2,r[n++]=a+1,r[n++]=a+3,r[n++]=a+2}},ch={extension:{type:W.ShapeBuilder,name:"triangle"},build(s,t){return t[0]=s.x,t[1]=s.y,t[2]=s.x2,t[3]=s.y2,t[4]=s.x3,t[5]=s.y3,t},triangulate(s,t,e,i,r,n){let o=0;i*=e,t[i+o]=s[0],t[i+o+1]=s[1],o+=e,t[i+o]=s[2],t[i+o+1]=s[3],o+=e,t[i+o]=s[4],t[i+o+1]=s[5];const a=i/e;r[n++]=a,r[n++]=a+1,r[n++]=a+2}},uh=new N,dh=new it;function fh(s,t,e,i){const r=t.matrix?s.copyFrom(t.matrix).invert():s.identity();
246if(t.textureSpace==="local"){const o=e.getBounds(dh);t.width&&o.pad(t.width);const{x:a,y:h}=o,c=1/o.width,l=1/o.height,u=-a*c,p=-h*l,d=r.a,x=r.b,_=r.c,m=r.d;r.a*=c,r.b*=c,r.c*=l,r.d*=l,r.tx=u*d+p*_+r.tx,r.ty=u*x+p*m+r.ty}else r.translate(t.texture.frame.x,t.texture.frame.y),r.scale(1/t.texture.source.width,1/t.texture.source.height);const n=t.texture.source.style;return!(t.fill instanceof ne)&&n.addressMode==="clamp-to-edge"&&(n.addressMode="repeat",n.update()),i&&r.append(uh.copyFrom(i).invert()),r}const Me={};pt.handleByMap(W.ShapeBuilder,Me);pt.add(lh,hh,ch,re,sh,ih);const ph=new it,mh=new N;function gh(s,t){const{geometryData:e,batches:i}=t;i.length=0,e.indices.length=0,e.vertices.length=0,e.uvs.length=0;for(let r=0;r<s.instructions.length;r++){const n=s.instructions[r];if(n.action==="texture")xh(n.data,i,e);else if(n.action==="fill"||n.action==="stroke"){const o=n.action==="stroke",a=n.data.path.shapePath,h=n.data.style,c=n.data.hole;o&&c&&Ai(c.shapePath,h,!0,i,e),c&&(a.shapePrimitives[a.shapePrimitives.length-1].holes=c.shapePath.shapePrimitives),Ai(a,h,o,i,e)}}}function xh(s,t,e){const{vertices:i,uvs:r,indices:n}=e,o=n.length,a=i.length/2,h=[],c=Me.rectangle,l=ph,u=s.image;l.x=s.dx,l.y=s.dy,l.width=s.dw,l.height=s.dh;const p=s.transform;c.build(l,h),p&&Vr(h,p),c.triangulate(h,i,2,a,n,o);const d=u.uvs;r.push(d.x0,d.y0,d.x1,d.y1,d.x3,d.y3,d.x2,d.y2);const x=At.get(Yr);x.indexOffset=o,x.indexSize=n.length-o,x.attributeOffset=a,x.attributeSize=i.length/2-a,x.baseColor=s.style,x.alpha=s.alpha,x.texture=u,x.geometryData=e,t.push(x)}function Ai(s,t,e,i,r){const{vertices:n,uvs:o,indices:a}=r;s.shapePrimitives.forEach(({shape:h,transform:c,holes:l})=>{const u=a.length,p=n.length/2,d=[],x=Me[h.type];let _="triangle-list";if(x.build(h,d),c&&Vr(d,c),e){const A=h.closePath??!0,C=t;C.pixelLine?(oh(d,A,n,a),_="line-list"):nh(d,C,!1,A,n,a)}else if(l){const A=[],C=d.slice();yh(l).forEach(S=>{A.push(C.length/2),C.push(...S)}),Xr(C,A,n,2,p,a,u)}else x.triangulate(d,n,2,p,a,u);const m=o.length/2,b=t.texture;if(b!==j.WHITE){const A=fh(mh,t,h,c);Ja(n,2,p,o,m,2,n.length/2-p,A)}else th(o,m,2,n.length/2-p);const w=At.get(Yr);w.indexOffset=u,w.indexSize=a.length-u,w.attributeOffset=p,w.attributeSize=n.length/2-p,w.baseColor=t.color,w.alpha=t.alpha,w.texture=b,w.geometryData=r,w.topology=_,i.push(w)})}function yh(s){const t=[];for(let e=0;e<s.length;e++){const i=s[e].shape,r=[];Me[i.type].build(i,r),t.push(r)}return t}class _h{constructor(){this.batches=[],this.geometryData={vertices:[],uvs:[],indices:[]}}}class bh{constructor(){this.batcher=new Qa,this.instructions=new sr}init(){this.instructions.reset()}get geometry(){return q(Tn,"GraphicsContextRenderData#geometry is deprecated, please use batcher.geometry instead."),this.batcher.geometry}}const As=class us{constructor(t){this._gpuContextHash={},this._graphicsDataContextHash=Object.create(null),t.renderableGC.addManagedHash(this,"_gpuContextHash"),t.renderableGC.addManagedHash(this,"_graphicsDataContextHash")}init(t){us.defaultOptions.bezierSmoothness=(t==null?void 0:t.bezierSmoothness)??us.defaultOptions.bezierSmoothness}getContextRenderData(t){return this._graphicsDataContextHash[t.uid]||this._initContextRenderData(t)}updateGpuContext(t){let e=this._gpuContextHash[t.uid]||this._initContext(t);if(t.dirty){e?this._cleanGraphicsContextData(t):e=this._initContext(t),gh(t,e);const i=t.batchMode;t.customShader||i==="no-batch"?e.isBatchable=!1:i==="auto"&&(e.isBatchable=e.geometryData.vertices.length<400),t.dirty=!1}return e}getGpuContext(t){return this._gpuContextHash[t.uid]||this._initContext(t)}_initContextRenderData(t){const e=At.get(bh),{batches:i,geometryData:r}=this._gpuContextHash[t.uid],n=r.vertices.length,o=r.indices.length;for(let l=0;l<i.length;l++)i[l].applyTransform=!1;const a=e.batcher;a.ensureAttributeBuffer(n),a.ensureIndexBuffer(o),a.begin();for(let l=0;l<i.length;l++){const u=i[l];a.add(u)}a.finish(e.instructions);const h=a.geometry;h.indexBuffer.setDataWithSize(a.indexBuffer,a.indexSize,!0),h.buffers[0].setDataWithSize(a.attributeBuffer.float32View,a.attributeSize,!0);const c=a.batches;for(let l=0;l<c.length;l++){const u=c[l];u.bindGroup=da(u.textures.textures,u.textures.count)}
vendor: 12,333 bytes, line 246
246return this._graphicsDataContextHash[t.uid]=e,e}_initContext(t){const e=new _h;return e.context=t,this._gpuContextHash[t.uid]=e,t.on("destroy",this.onGraphicsContextDestroy,this),this._gpuContextHash[t.uid]}onGraphicsContextDestroy(t){this._cleanGraphicsContextData(t),t.off("destroy",this.onGraphicsContextDestroy,this),this._gpuContextHash[t.uid]=null}_cleanGraphicsContextData(t){const e=this._gpuContextHash[t.uid];e.isBatchable||this._graphicsDataContextHash[t.uid]&&(At.return(this.getContextRenderData(t)),this._graphicsDataContextHash[t.uid]=null),e.batches&&e.batches.forEach(i=>{At.return(i)})}destroy(){for(const t in this._gpuContextHash)this._gpuContextHash[t]&&this.onGraphicsContextDestroy(this._gpuContextHash[t].context)}};As.extension={type:[W.WebGLSystem,W.WebGPUSystem,W.CanvasSystem],name:"graphicsContext"};As.defaultOptions={bezierSmoothness:.5};let Wr=As;const wh=8,ge=11920929e-14,vh=1;function jr(s,t,e,i,r,n,o,a,h,c){const u=Math.min(.99,Math.max(0,c??Wr.defaultOptions.bezierSmoothness));let p=(vh-u)/1;return p*=p,Ch(t,e,i,r,n,o,a,h,s,p),s}function Ch(s,t,e,i,r,n,o,a,h,c){ds(s,t,e,i,r,n,o,a,h,c,0),h.push(o,a)}function ds(s,t,e,i,r,n,o,a,h,c,l){if(l>wh)return;const u=(s+e)/2,p=(t+i)/2,d=(e+r)/2,x=(i+n)/2,_=(r+o)/2,m=(n+a)/2,b=(u+d)/2,w=(p+x)/2,A=(d+_)/2,C=(x+m)/2,E=(b+A)/2,S=(w+C)/2;if(l>0){let P=o-s,D=a-t;const G=Math.abs((e-o)*D-(i-a)*P),R=Math.abs((r-o)*D-(n-a)*P);if(G>ge&&R>ge){if((G+R)*(G+R)<=c*(P*P+D*D)){h.push(E,S);return}}else if(G>ge){if(G*G<=c*(P*P+D*D)){h.push(E,S);return}}else if(R>ge){if(R*R<=c*(P*P+D*D)){h.push(E,S);return}}else if(P=E-(s+o)/2,D=S-(t+a)/2,P*P+D*D<=c){h.push(E,S);return}}ds(s,t,u,p,b,w,E,S,h,c,l+1),ds(E,S,A,C,_,m,o,a,h,c,l+1)}const Ah=8,Sh=11920929e-14,Mh=1;function Ph(s,t,e,i,r,n,o,a){const c=Math.min(.99,Math.max(0,a??Wr.defaultOptions.bezierSmoothness));let l=(Mh-c)/1;return l*=l,Th(t,e,i,r,n,o,s,l),s}function Th(s,t,e,i,r,n,o,a){fs(o,s,t,e,i,r,n,a,0),o.push(r,n)}function fs(s,t,e,i,r,n,o,a,h){if(h>Ah)return;const c=(t+i)/2,l=(e+r)/2,u=(i+n)/2,p=(r+o)/2,d=(c+u)/2,x=(l+p)/2;let _=n-t,m=o-e;const b=Math.abs((i-n)*m-(r-o)*_);if(b>Sh){if(b*b<=a*(_*_+m*m)){s.push(d,x);return}}else if(_=d-(t+n)/2,m=x-(e+o)/2,_*_+m*m<=a){s.push(d,x);return}fs(s,t,e,c,l,d,x,a,h+1),fs(s,d,x,u,p,n,o,a,h+1)}function qr(s,t,e,i,r,n,o,a){let h=Math.abs(r-n);(!o&&r>n||o&&n>r)&&(h=2*Math.PI-h),a||(a=Math.max(6,Math.floor(6*Math.pow(i,1/3)*(h/Math.PI)))),a=Math.max(a,3);let c=h/a,l=r;c*=o?-1:1;for(let u=0;u<a+1;u++){const p=Math.cos(l),d=Math.sin(l),x=t+p*i,_=e+d*i;s.push(x,_),l+=c}}function kh(s,t,e,i,r,n){const o=s[s.length-2],h=s[s.length-1]-e,c=o-t,l=r-e,u=i-t,p=Math.abs(h*u-c*l);if(p<1e-8||n===0){(s[s.length-2]!==t||s[s.length-1]!==e)&&s.push(t,e);return}const d=h*h+c*c,x=l*l+u*u,_=h*l+c*u,m=n*Math.sqrt(d)/p,b=n*Math.sqrt(x)/p,w=m*_/d,A=b*_/x,C=m*u+b*c,E=m*l+b*h,S=c*(b+w),P=h*(b+w),D=u*(m+A),G=l*(m+A),R=Math.atan2(P-E,S-C),B=Math.atan2(G-E,D-C);qr(s,C+t,E+e,n,R,B,c*l>u*h)}const te=Math.PI*2,Ze={centerX:0,centerY:0,ang1:0,ang2:0},Ke=({x:s,y:t},e,i,r,n,o,a,h)=>{s*=e,t*=i;const c=r*s-n*t,l=n*s+r*t;return h.x=c+o,h.y=l+a,h};function Eh(s,t){const e=t===-1.5707963267948966?-.551915024494:1.3333333333333333*Math.tan(t/4),i=t===1.5707963267948966?.551915024494:e,r=Math.cos(s),n=Math.sin(s),o=Math.cos(s+t),a=Math.sin(s+t);return[{x:r-n*i,y:n+r*i},{x:o+a*i,y:a-o*i},{x:o,y:a}]}const Si=(s,t,e,i)=>{const r=s*i-t*e<0?-1:1;let n=s*e+t*i;return n>1&&(n=1),n<-1&&(n=-1),r*Math.acos(n)},Ih=(s,t,e,i,r,n,o,a,h,c,l,u,p)=>{const d=Math.pow(r,2),x=Math.pow(n,2),_=Math.pow(l,2),m=Math.pow(u,2);let b=d*x-d*m-x*_;b<0&&(b=0),b/=d*m+x*_,b=Math.sqrt(b)*(o===a?-1:1);const w=b*r/n*u,A=b*-n/r*l,C=c*w-h*A+(s+e)/2,E=h*w+c*A+(t+i)/2,S=(l-w)/r,P=(u-A)/n,D=(-l-w)/r,G=(-u-A)/n,R=Si(1,0,S,P);let B=Si(S,P,D,G);a===0&&B>0&&(B-=te),a===1&&B<0&&(B+=te),p.centerX=C,p.centerY=E,p.ang1=R,p.ang2=B};function Rh(s,t,e,i,r,n,o,a=0,h=0,c=0){if(n===0||o===0)return;const l=Math.sin(a*te/360),u=Math.cos(a*te/360),p=u*(t-i)/2+l*(e-r)/2,d=-l*(t-i)/2+u*(e-r)/2;if(p===0&&d===0)return;n=Math.abs(n),o=Math.abs(o);const x=Math.pow(p,2)/Math.pow(n,2)+Math.pow(d,2)/Math.pow(o,2);x>1&&(n*=Math.sqrt(x),o*=Math.sqrt(x)),Ih(t,e,i,r,n,o,h,c,l,u,p,d,Ze);let{ang1:_,ang2:m}=Ze;const{centerX:b,centerY:w}=Ze;let A=Math.abs(m)/(te/4);Math.abs(1-A)<1e-7&&(A=1);const C=Math.max(Math.ceil(A),1);m/=C;let E=s[s.length-2],S=s[s.length-1];const P={x:0,y:0};for(let D=0;D<C;D++){const G=Eh(_,m),{x:R,y:B}=Ke(G[0],n,o,u,l,b,w,P),{x:Y,y:H}=Ke(G[1],n,o,u,l,b,w,P),{x:Z,y:ut}=Ke(G[2],n,o,u,l,b,w,P);jr(s,E,S,R,B,Y,H,Z,ut),E=Z,S=ut,_+=m}}function Bh(s,t,e){const i=(o,a)=>{const h=a.x-o.x,c=a.y-o.y,l=Math.sqrt(h*h+c*c),u=h/l,p=c/l;return{len:l,nx:u,ny:p}},r=(o,a)=>{o===0?s.moveTo(a.x,a.y):s.lineTo(a.x,a.y)};let n=t[t.length-1];for(let o=0;o<t.length;o++){const a=t[o%t.length],h=a.radius??e;if(h<=0){r(o,a),n=a;continue}const c=t[(o+1)%t.length],l=i(a,n),u=i(a,c);if(l.len<1e-4||u.len<1e-4){r(o,a),n=a;continue}let p=Math.asin(l.nx*u.ny-l.ny*u.nx),d=1,x=!1;l.nx*u.nx-l.ny*-u.ny<0?p<0?p=Math.PI+p:(p=Math.PI-p,d=-1,x=!0):p>0&&(d=-1,x=!0);const _=p/2;let m,b=Math.abs(Math.cos(_)*h/Math.sin(_));b>Math.min(l.len/2,u.len/2)?(b=Math.min(l.len/2,u.len/2),m=Math.abs(b*Math.sin(_)/Math.cos(_))):m=h;const w=a.x+u.nx*b+-u.ny*m*d,A=a.y+u.ny*b+u.nx*m*d,C=Math.atan2(l.ny,l.nx)+Math.PI/2*d,E=Math.atan2(u.ny,u.nx)-Math.PI/2*d;o===0&&s.moveTo(w+Math.cos(C)*m,A+Math.sin(C)*m),s.arc(w,A,m,C,E,x),n=a}}function Gh(s,t,e,i){const r=(a,h)=>Math.sqrt((a.x-h.x)**2+(a.y-h.y)**2),n=(a,h,c)=>({x:a.x+(h.x-a.x)*c,y:a.y+(h.y-a.y)*c}),o=t.length;for(let a=0;a<o;a++){const h=t[(a+1)%o],c=h.radius??e;if(c<=0){a===0?s.moveTo(h.x,h.y):s.lineTo(h.x,h.y);continue}const l=t[a],u=t[(a+2)%o],p=r(l,h);let d;if(p<1e-4)d=h;else{const m=Math.min(p/2,c);d=n(h,l,m/p)}const x=r(u,h);let _;if(x<1e-4)_=h;else{const m=Math.min(x/2,c);_=n(h,u,m/x)}a===0?s.moveTo(d.x,d.y):s.lineTo(d.x,d.y),s.quadraticCurveTo(h.x,h.y,_.x,_.y,i)}}const Fh=new it;class Dh{constructor(t){this.shapePrimitives=[],this._currentPoly=null,this._bounds=new gt,this._graphicsPath2D=t,this.signed=t.checkForHoles}moveTo(t,e){return this.startPoly(t,e),this}lineTo(t,e){this._ensurePoly();const i=this._currentPoly.points,r=i[i.length-2],n=i[i.length-1];return(r!==t||n!==e)&&i.push(t,e),this}arc(t,e,i,r,n,o){this._ensurePoly(!1);const a=this._currentPoly.points;return qr(a,t,e,i,r,n,o),this}arcTo(t,e,i,r,n){this._ensurePoly();const o=this._currentPoly.points;return kh(o,t,e,i,r,n),this}arcToSvg(t,e,i,r,n,o,a){const h=this._currentPoly.points;return Rh(h,this._currentPoly.lastX,this._currentPoly.lastY,o,a,t,e,i,r,n),this}bezierCurveTo(t,e,i,r,n,o,a){this._ensurePoly();const h=this._currentPoly;return jr(this._currentPoly.points,h.lastX,h.lastY,t,e,i,r,n,o,a),this}quadraticCurveTo(t,e,i,r,n){this._ensurePoly();const o=this._currentPoly;return Ph(this._currentPoly.points,o.lastX,o.lastY,t,e,i,r,n),this}closePath(){return this.endPoly(!0),this}addPath(t,e){this.endPoly(),e&&!e.isIdentity()&&(t=t.clone(!0),t.transform(e));const i=this.shapePrimitives,r=i.length;for(let n=0;n<t.instructions.length;n++){const o=t.instructions[n];this[o.action](...o.data)}if(t.checkForHoles&&i.length-r>1){let n=null;for(let o=r;o<i.length;o++){const a=i[o];if(a.shape.type==="polygon"){const h=a.shape,c=n==null?void 0:n.shape;c&&c.containsPolygon(h)?(n.holes||(n.holes=[]),n.holes.push(a),i.copyWithin(o,o+1),i.length--,o--):n=a}}}return this}finish(t=!1){this.endPoly(t)}rect(t,e,i,r,n){return this.drawShape(new it(t,e,i,r),n),this}circle(t,e,i,r){return this.drawShape(new ws(t,e,i),r),this}poly(t,e,i){const r=new Jt(t);return r.closePath=e,this.drawShape(r,i),this}regularPoly(t,e,i,r,n=0,o){r=Math.max(r|0,3);const a=-1*Math.PI/2+n,h=Math.PI*2/r,c=[];for(let l=0;l<r;l++){const u=a-l*h;c.push(t+i*Math.cos(u),e+i*Math.sin(u))}return this.poly(c,!0,o),this}roundPoly(t,e,i,r,n,o=0,a){if(r=Math.max(r|0,3),n<=0)return this.regularPoly(t,e,i,r,o);const h=i*Math.sin(Math.PI/r)-.001;n=Math.min(n,h);const c=-1*Math.PI/2+o,l=Math.PI*2/r,u=(r-2)*Math.PI/r/2;for(let p=0;p<r;p++){const d=p*l+c,x=t+i*Math.cos(d),_=e+i*Math.sin(d),m=d+Math.PI+u,b=d-Math.PI-u,w=x+n*Math.cos(m),A=_+n*Math.sin(m),C=x+n*Math.cos(b),E=_+n*Math.sin(b);p===0?this.moveTo(w,A):this.lineTo(w,A),this.quadraticCurveTo(x,_,C,E,a)}return this.closePath()}roundShape(t,e,i=!1,r){return t.length<3?this:(i?Gh(this,t,e,r):Bh(this,t,e),this.closePath())}filletRect(t,e,i,r,n){if(n===0)return this.rect(t,e,i,r);const o=Math.min(i,r)/2,a=Math.min(o,Math.max(-o,n)),h=t+i,c=e+r,l=a<0?-a:0,u=Math.abs(a);return this.moveTo(t,e+u).arcTo(t+l,e+l,t+u,e,u).lineTo(h-u,e).arcTo(h-l,e+l,h,e+u,u).lineTo(h,c-u).arcTo(h-l,c-l,t+i-u,c,u).lineTo(t+u,c).arcTo(t+l,c-l,t,c-u,u).closePath()}chamferRect(t,e,i,r,n,o){if(n<=0)return this.rect(t,e,i,r);const a=Math.min(n,Math.min(i,r)/2),h=t+i,c=e+r,l=[t+a,e,h-a,e,h,e+a,h,c-a,h-a,c,t+a,c,t,c-a,t,e+a];for(let u=l.length-1;u>=2;u-=2)l[u]===l[u-2]&&l[u-1]===l[u-3]&&l.splice(u-1,2);return this.poly(l,!0,o)}ellipse(t,e,i,r,n){return this.drawShape(new vs(t,e,i,r),n),this}roundRect(t,e,i,r,n,o){return this.drawShape(new Cs(t,e,i,r,n),o),this}drawShape(t,e){return this.endPoly(),this.shapePrimitives.push({shape:t,transform:e}),this}startPoly(t,e){let i=this._currentPoly;return i&&this.endPoly(),i=new Jt,i.points.push(t,e),this._currentPoly=i,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 Jt,t)){const e=this.shapePrimitives[this.shapePrimitives.length-1];if(e){let i=e.shape.x,r=e.shape.y;if(e.transform&&!e.transform.isIdentity()){const n=e.transform,o=i;i=n.a*i+n.c*r+n.tx,r=n.b*o+n.d*r+n.ty}this._currentPoly.points.push(i,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 i=t.instructions[e];this[i.action](...i.data)}this.finish()}get bounds(){const t=this._bounds;t.clear();const e=this.shapePrimitives;for(let i=0;i<e.length;i++){const r=e[i],n=r.shape.getBounds(Fh);r.transform?t.addRect(n,r.transform):t.addRect(n)}return t}}class Ot{constructor(t,e=!1){this.instructions=[],this.uid=tt("graphicsPath"),this._dirty=!0,this.checkForHoles=e,typeof t=="string"?na(t,this):this.instructions=(t==null?void 0:t.slice())??[]}get shapePath(){return this._shapePath||(this._shapePath=new Dh(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,i,r,n){const o=this.instructions[this.instructions.length-1],a=this.getLastPoint(rt.shared);let h=0,c=0;if(!o||o.action!=="bezierCurveTo")h=a.x,c=a.y;else{h=o.data[2],c=o.data[3];const l=a.x,u=a.y;h=l+(l-h),c=u+(u-c)}return this.instructions.push({action:"bezierCurveTo",data:[h,c,t,e,i,r,n]}),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,i){const r=this.instructions[this.instructions.length-1],n=this.getLastPoint(rt.shared);let o=0,a=0;if(!r||r.action!=="quadraticCurveTo")o=n.x,a=n.y;else{o=r.data[0],a=r.data[1];const h=n.x,c=n.y;o=h+(h-o),a=c+(c-a)}return this.instructions.push({action:"quadraticCurveTo",data:[o,a,t,e,i]}),this._dirty=!0,this}rect(t,e,i,r,n){return this.instructions.push({action:"rect",data:[t,e,i,r,n]}),this._dirty=!0,this}circle(t,e,i,r){return this.instructions.push({action:"circle",data:[t,e,i,r]}),this._dirty=!0,this}
246roundRect(...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,i,r,n,o,a){n||(n=r/2);const h=-1*Math.PI/2+o,c=i*2,l=Math.PI*2/c,u=[];for(let p=0;p<c;p++){const d=p%2?n:r,x=p*l+h;u.push(t+d*Math.cos(x),e+d*Math.sin(x))}return this.poly(u,!0,a),this}clone(t=!1){const e=new Ot;if(e.checkForHoles=this.checkForHoles,!t)e.instructions=this.instructions.slice();else for(let i=0;i<this.instructions.length;i++){const r=this.instructions[i];e.instructions.push({action:r.action,data:r.data.slice()})}return e}clear(){return this.instructions.length=0,this._dirty=!0,this}transform(t){if(t.isIdentity())return this;const e=t.a,i=t.b,r=t.c,n=t.d,o=t.tx,a=t.ty;let h=0,c=0,l=0,u=0,p=0,d=0,x=0,_=0;for(let m=0;m<this.instructions.length;m++){const b=this.instructions[m],w=b.data;switch(b.action){case"moveTo":case"lineTo":h=w[0],c=w[1],w[0]=e*h+r*c+o,w[1]=i*h+n*c+a;break;case"bezierCurveTo":l=w[0],u=w[1],p=w[2],d=w[3],h=w[4],c=w[5],w[0]=e*l+r*u+o,w[1]=i*l+n*u+a,w[2]=e*p+r*d+o,w[3]=i*p+n*d+a,w[4]=e*h+r*c+o,w[5]=i*h+n*c+a;break;case"quadraticCurveTo":l=w[0],u=w[1],h=w[2],c=w[3],w[0]=e*l+r*u+o,w[1]=i*l+n*u+a,w[2]=e*h+r*c+o,w[3]=i*h+n*c+a;break;case"arcToSvg":h=w[5],c=w[6],x=w[0],_=w[1],w[0]=e*x+r*_,w[1]=i*x+n*_,w[5]=e*h+r*c+o,w[6]=i*h+n*c+a;break;case"circle":w[4]=Xt(w[3],t);break;case"rect":w[4]=Xt(w[4],t);break;case"ellipse":w[8]=Xt(w[8],t);break;case"roundRect":w[5]=Xt(w[5],t);break;case"addPath":w[0].transform(t);break;case"poly":w[2]=Xt(w[2],t);break;default:ct("unknown transform action",b.action);break}}return this._dirty=!0,this}get bounds(){return this.shapePath.bounds}getLastPoint(t){let e=this.instructions.length-1,i=this.instructions[e];if(!i)return t.x=0,t.y=0,t;for(;i.action==="closePath";){if(e--,e<0)return t.x=0,t.y=0,t;i=this.instructions[e]}switch(i.action){case"moveTo":case"lineTo":t.x=i.data[0],t.y=i.data[1];break;case"quadraticCurveTo":t.x=i.data[2],t.y=i.data[3];break;case"bezierCurveTo":t.x=i.data[4],t.y=i.data[5];break;case"arc":case"arcToSvg":t.x=i.data[5],t.y=i.data[6];break;case"addPath":i.data[0].getLastPoint(t);break}return t}}function Xt(s,t){return s?s.prepend(t):t.clone()}function Q(s,t,e){const i=s.getAttribute(t);return i?Number(i):e}function Lh(s,t){const e=s.querySelectorAll("defs");for(let i=0;i<e.length;i++){const r=e[i];for(let n=0;n<r.children.length;n++){const o=r.children[n];switch(o.nodeName.toLowerCase()){case"lineargradient":t.defs[o.id]=zh(o);break;case"radialgradient":t.defs[o.id]=Uh();break}}}}function zh(s){const t=Q(s,"x1",0),e=Q(s,"y1",0),i=Q(s,"x2",1),r=Q(s,"y2",0),n=s.getAttribute("gradientUnits")||"objectBoundingBox",o=new ne(t,e,i,r,n==="objectBoundingBox"?"local":"global");for(let a=0;a<s.children.length;a++){const h=s.children[a],c=Q(h,"offset",0),l=ft.shared.setValue(h.getAttribute("stop-color")).toNumber();o.addColorStop(c,l)}return o}function Uh(s){return ct("[SVG Parser] Radial gradients are not yet supported"),new ne(0,0,1,0)}function Mi(s){const t=s.match(/url\s*\(\s*['"]?\s*#([^'"\s)]+)\s*['"]?\s*\)/i);return t?t[1]:""}const Pi={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 Zr(s,t){const e=s.getAttribute("style"),i={},r={},n={strokeStyle:i,fillStyle:r,useFill:!1,useStroke:!1};for(const o in Pi){const a=s.getAttribute(o);a&&Ti(t,n,o,a.trim())}if(e){const o=e.split(";");for(let a=0;a<o.length;a++){const h=o[a].trim(),[c,l]=h.split(":");
246Pi[c]&&Ti(t,n,c,l.trim())}}return{strokeStyle:n.useStroke?i:null,fillStyle:n.useFill?r:null,useFill:n.useFill,useStroke:n.useStroke}}function Ti(s,t,e,i){switch(e){case"stroke":if(i!=="none"){if(i.startsWith("url(")){const r=Mi(i);t.strokeStyle.fill=s.defs[r]}else t.strokeStyle.color=ft.shared.setValue(i).toNumber();t.useStroke=!0}break;case"stroke-width":t.strokeStyle.width=Number(i);break;case"fill":if(i!=="none"){if(i.startsWith("url(")){const r=Mi(i);t.fillStyle.fill=s.defs[r]}else t.fillStyle.color=ft.shared.setValue(i).toNumber();t.useFill=!0}break;case"fill-opacity":t.fillStyle.alpha=Number(i);break;case"stroke-opacity":t.strokeStyle.alpha=Number(i);break;case"opacity":t.fillStyle.alpha=Number(i),t.strokeStyle.alpha=Number(i);break}}function Nh(s,t){if(typeof s=="string"){const o=document.createElement("div");o.innerHTML=s.trim(),s=o.querySelector("svg")}const e={context:t,defs:{},path:new Ot};Lh(s,e);const i=s.children,{fillStyle:r,strokeStyle:n}=Zr(s,e);for(let o=0;o<i.length;o++){const a=i[o];a.nodeName.toLowerCase()!=="defs"&&Kr(a,e,r,n)}return t}function Kr(s,t,e,i){const r=s.children,{fillStyle:n,strokeStyle:o}=Zr(s,t);n&&e?e={...e,...n}:n&&(e=n),o&&i?i={...i,...o}:o&&(i=o);const a=!e&&!i;a&&(e={color:0});let h,c,l,u,p,d,x,_,m,b,w,A,C,E,S,P,D;switch(s.nodeName.toLowerCase()){case"path":E=s.getAttribute("d"),s.getAttribute("fill-rule")==="evenodd"&&ct("SVG Evenodd fill rule not supported, your svg may render incorrectly"),S=new Ot(E,!0),t.context.path(S),e&&t.context.fill(e),i&&t.context.stroke(i);break;case"circle":x=Q(s,"cx",0),_=Q(s,"cy",0),m=Q(s,"r",0),t.context.ellipse(x,_,m,m),e&&t.context.fill(e),i&&t.context.stroke(i);break;case"rect":h=Q(s,"x",0),c=Q(s,"y",0),P=Q(s,"width",0),D=Q(s,"height",0),b=Q(s,"rx",0),w=Q(s,"ry",0),b||w?t.context.roundRect(h,c,P,D,b||w):t.context.rect(h,c,P,D),e&&t.context.fill(e),i&&t.context.stroke(i);break;case"ellipse":x=Q(s,"cx",0),_=Q(s,"cy",0),b=Q(s,"rx",0),w=Q(s,"ry",0),t.context.beginPath(),t.context.ellipse(x,_,b,w),e&&t.context.fill(e),i&&t.context.stroke(i);break;case"line":l=Q(s,"x1",0),u=Q(s,"y1",0),p=Q(s,"x2",0),d=Q(s,"y2",0),t.context.beginPath(),t.context.moveTo(l,u),t.context.lineTo(p,d),i&&t.context.stroke(i);break;case"polygon":C=s.getAttribute("points"),A=C.match(/\d+/g).map(G=>parseInt(G,10)),t.context.poly(A,!0),e&&t.context.fill(e),i&&t.context.stroke(i);break;case"polyline":C=s.getAttribute("points"),A=C.match(/\d+/g).map(G=>parseInt(G,10)),t.context.poly(A,!1),i&&t.context.stroke(i);break;case"g":case"svg":break;default:{ct(`[SVG parser] <${s.nodeName}> elements unsupported`);break}}a&&(e=null);for(let G=0;G<r.length;G++)Kr(r[G],t,e,i)}function Hh(s){return ft.isColorLike(s)}function ki(s){return s instanceof ea}function Ei(s){return s instanceof ne}function Oh(s){return s instanceof j}function Vh(s,t,e){const i=ft.shared.setValue(t??0);return s.color=i.toNumber(),s.alpha=i.alpha===1?e.alpha:i.alpha,s.texture=j.WHITE,{...e,...s}}function Yh(s,t,e){return s.texture=t,{...e,...s}}function Ii(s,t,e){return s.fill=t,s.color=16777215,s.texture=t.texture,s.matrix=t.transform,{...e,...s}}function Ri(s,t,e){return t.buildGradient(),s.fill=t,s.color=16777215,s.texture=t.texture,s.matrix=t.transform,s.textureSpace=t.textureSpace,{...e,...s}}function $h(s,t){const e={...t,...s},i=ft.shared.setValue(e.color);return e.alpha*=i.alpha,e.color=i.toNumber(),e}function Kt(s,t){if(s==null)return null;const e={},i=s;return Hh(s)?Vh(e,s,t):Oh(s)?Yh(e,s,t):ki(s)?Ii(e,s,t):Ei(s)?Ri(e,s,t):i.fill&&ki(i.fill)?Ii(i,i.fill,t):i.fill&&Ei(i.fill)?Ri(i,i.fill,t):$h(i,t)}function Bi(s,t){const{width:e,alignment:i,miterLimit:r,cap:n,join:o,pixelLine:a,...h}=t,c=Kt(s,h);return c?{width:e,alignment:i,miterLimit:r,cap:n,join:o,pixelLine:a,...c}:null}const Xh=new rt,Gi=new N,Ss=class bt extends Mt{constructor(){super(...arguments),this.uid=tt("graphicsContext"),this.dirty=!0,this.batchMode="auto",this.instructions=[],this._activePath=new Ot,this._transform=new N,this._fillStyle={...bt.defaultFillStyle},this._strokeStyle={...bt.defaultStrokeStyle},this._stateStack=[],this._tick=0,this._bounds=new gt,this._boundsDirty=!0}clone(){const t=new bt;return t.batchMode=this.batchMode,t.instructions=this.instructions.slice(),t._activePath=this._activePath.clone(),t._transform=this._transform.clone(),t._fillStyle={...this._fillStyle},t._strokeStyle={...this._strokeStyle},t._stateStack=this._stateStack.slice(),t._bounds=this._bounds.clone(),t._boundsDirty=!0,t}get fillStyle(){return this._fillStyle}set fillStyle(t){this._fillStyle=Kt(t,bt.defaultFillStyle)}get strokeStyle(){return this._strokeStyle}set strokeStyle(t){this._strokeStyle=Bi(t,bt.defaultStrokeStyle)}
vendor: 3,681 bytes, line 246
246setFillStyle(t){return this._fillStyle=Kt(t,bt.defaultFillStyle),this}setStrokeStyle(t){return this._strokeStyle=Kt(t,bt.defaultStrokeStyle),this}texture(t,e,i,r,n,o){return this.instructions.push({action:"texture",data:{image:t,dx:i||0,dy:r||0,dw:n||t.frame.width,dh:o||t.frame.height,transform:this._transform.clone(),alpha:this._fillStyle.alpha,style:e?ft.shared.setValue(e).toNumber():16777215}}),this.onUpdate(),this}beginPath(){return this._activePath=new Ot,this}fill(t,e){let i;const r=this.instructions[this.instructions.length-1];return this._tick===0&&r&&r.action==="stroke"?i=r.data.path:i=this._activePath.clone(),i?(t!=null&&(e!==void 0&&typeof t=="number"&&(q(et,"GraphicsContext.fill(color, alpha) is deprecated, use GraphicsContext.fill({ color, alpha }) instead"),t={color:t,alpha:e}),this._fillStyle=Kt(t,bt.defaultFillStyle)),this.instructions.push({action:"fill",data:{style:this.fillStyle,path:i}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this}_initNextPathLocation(){const{x:t,y:e}=this._activePath.getLastPoint(rt.shared);this._activePath.clear(),this._activePath.moveTo(t,e)}stroke(t){let e;const i=this.instructions[this.instructions.length-1];return this._tick===0&&i&&i.action==="fill"?e=i.data.path:e=this._activePath.clone(),e?(t!=null&&(this._strokeStyle=Bi(t,bt.defaultStrokeStyle)),this.instructions.push({action:"stroke",data:{style:this.strokeStyle,path:e}}),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],i=this._activePath.clone();if(e&&(e.action==="stroke"||e.action==="fill"))if(e.data.hole)e.data.hole.addPath(i);else{e.data.hole=i;break}}return this._initNextPathLocation(),this}arc(t,e,i,r,n,o){this._tick++;const a=this._transform;return this._activePath.arc(a.a*t+a.c*e+a.tx,a.b*t+a.d*e+a.ty,i,r,n,o),this}arcTo(t,e,i,r,n){this._tick++;const o=this._transform;return this._activePath.arcTo(o.a*t+o.c*e+o.tx,o.b*t+o.d*e+o.ty,o.a*i+o.c*r+o.tx,o.b*i+o.d*r+o.ty,n),this}arcToSvg(t,e,i,r,n,o,a){this._tick++;const h=this._transform;return this._activePath.arcToSvg(t,e,i,r,n,h.a*o+h.c*a+h.tx,h.b*o+h.d*a+h.ty),this}bezierCurveTo(t,e,i,r,n,o,a){this._tick++;const h=this._transform;return this._activePath.bezierCurveTo(h.a*t+h.c*e+h.tx,h.b*t+h.d*e+h.ty,h.a*i+h.c*r+h.tx,h.b*i+h.d*r+h.ty,h.a*n+h.c*o+h.tx,h.b*n+h.d*o+h.ty,a),this}closePath(){var t;return this._tick++,(t=this._activePath)==null||t.closePath(),this}ellipse(t,e,i,r){return this._tick++,this._activePath.ellipse(t,e,i,r,this._transform.clone()),this}circle(t,e,i){return this._tick++,this._activePath.circle(t,e,i,this._transform.clone()),this}path(t){return this._tick++,this._activePath.addPath(t,this._transform.clone()),this}lineTo(t,e){this._tick++;const i=this._transform;return this._activePath.lineTo(i.a*t+i.c*e+i.tx,i.b*t+i.d*e+i.ty),this}moveTo(t,e){this._tick++;const i=this._transform,r=this._activePath.instructions,n=i.a*t+i.c*e+i.tx,o=i.b*t+i.d*e+i.ty;return r.length===1&&r[0].action==="moveTo"?(r[0].data[0]=n,r[0].data[1]=o,this):(this._activePath.moveTo(n,o),this)}quadraticCurveTo(t,e,i,r,n){this._tick++;const o=this._transform;return this._activePath.quadraticCurveTo(o.a*t+o.c*e+o.tx,o.b*t+o.d*e+o.ty,o.a*i+o.c*r+o.tx,o.b*i+o.d*r+o.ty,n),this}rect(t,e,i,r){return this._tick++,this._activePath.rect(t,e,i,r,this._transform.clone()),this}roundRect(t,e,i,r,n){return this._tick++,this._activePath.roundRect(t,e,i,r,n,this._transform.clone()),this}poly(t,e){return this._tick++,this._activePath.poly(t,e,this._transform.clone()),this}regularPoly(t,e,i,r,n=0,o){return this._tick++,this._activePath.regularPoly(t,e,i,r,n,o),this}
246roundPoly(t,e,i,r,n,o){return this._tick++,this._activePath.roundPoly(t,e,i,r,n,o),this}roundShape(t,e,i,r){return this._tick++,this._activePath.roundShape(t,e,i,r),this}filletRect(t,e,i,r,n){return this._tick++,this._activePath.filletRect(t,e,i,r,n),this}chamferRect(t,e,i,r,n,o){return this._tick++,this._activePath.chamferRect(t,e,i,r,n,o),this}star(t,e,i,r,n=0,o=0){return this._tick++,this._activePath.star(t,e,i,r,n,o,this._transform.clone()),this}svg(t){return this._tick++,Nh(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,i,r,n,o){return t instanceof N?(this._transform.set(t.a,t.b,t.c,t.d,t.tx,t.ty),this):(this._transform.set(t,e,i,r,n,o),this)}transform(t,e,i,r,n,o){return t instanceof N?(this._transform.append(t),this):(Gi.set(t,e,i,r,n,o),this._transform.append(Gi),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.dirty||(this.emit("update",this,16),this.dirty=!0,this._boundsDirty=!0)}get bounds(){if(!this._boundsDirty)return this._bounds;const t=this._bounds;t.clear();for(let e=0;e<this.instructions.length;e++){const i=this.instructions[e],r=i.action;if(r==="fill"){const n=i.data;t.addBounds(n.path.bounds)}else if(r==="texture"){const n=i.data;t.addFrame(n.dx,n.dy,n.dx+n.dw,n.dy+n.dh,n.transform)}if(r==="stroke"){const n=i.data,o=n.style.alignment,a=n.style.width*(1-o),h=n.path.bounds;t.addFrame(h.minX-a,h.minY-a,h.maxX+a,h.maxY+a)}}return t}containsPoint(t){var r;if(!this.bounds.containsPoint(t.x,t.y))return!1;const e=this.instructions;let i=!1;for(let n=0;n<e.length;n++){const o=e[n],a=o.data,h=a.path;if(!o.action||!h)continue;const c=a.style,l=h.shapePath.shapePrimitives;for(let u=0;u<l.length;u++){const p=l[u].shape;if(!c||!p)continue;const d=l[u].transform,x=d?d.applyInverse(t,Xh):t;if(o.action==="fill")i=p.contains(x.x,x.y);else{const m=c;i=p.strokeContains(x.x,x.y,m.width,m.alignment)}const _=a.hole;if(_){const m=(r=_.shapePath)==null?void 0:r.shapePrimitives;if(m)for(let b=0;b<m.length;b++)m[b].shape.contains(x.x,x.y)&&(i=!1)}if(i)return!0}}return i}destroy(t=!1){if(this._stateStack.length=0,this._transform=null,this.emit("destroy",this),this.removeAllListeners(),typeof t=="boolean"?t:t==null?void 0:t.texture){const i=typeof t=="boolean"?t:t==null?void 0:t.textureSource;this._fillStyle.texture&&this._fillStyle.texture.destroy(i),this._strokeStyle.texture&&this._strokeStyle.texture.destroy(i)}this._fillStyle=null,this._strokeStyle=null,this.instructions=null,this._activePath=null,this._bounds=null,this._stateStack=null,this.customShader=null,this._transform=null}};Ss.defaultFillStyle={color:16777215,alpha:1,texture:j.WHITE,matrix:null,fill:null,textureSpace:"local"};Ss.defaultStrokeStyle={width:1,color:16777215,alpha:1,alignment:.5,miterLimit:10,cap:"butt",join:"miter",texture:j.WHITE,matrix:null,fill:null,textureSpace:"local",pixelLine:!1};let Wt=Ss;class Ce extends ir{constructor(t){t instanceof Wt&&(t={context:t});const{context:e,roundPixels:i,...r}=t||{};super({label:"Graphics",...r}),this.renderPipeId="graphics",e?this._context=e:this._context=this._ownedContext=new Wt,this._context.on("update",this.onViewUpdate,this),this.allowChildren=!1,this.roundPixels=i??!1}set context(t){t!==this._context&&(this._context.off("update",this.onViewUpdate,this),this._context=t,this._context.on("update",this.onViewUpdate,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):(t===!0||(t==null?void 0:t.context)===!0)&&this._context.destroy(t),this._ownedContext=null,this._context=null,super.destroy(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)}
246roundRect(...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){return t?new Ce(this._context.clone()):(this._ownedContext=null,new Ce(this._context))}lineStyle(t,e,i){q(et,"Graphics#lineStyle is no longer needed. Use Graphics#setStrokeStyle to set the stroke style.");const r={};return t&&(r.width=t),e&&(r.color=e),i&&(r.alpha=i),this.context.strokeStyle=r,this}beginFill(t,e){q(et,"Graphics#beginFill is no longer needed. Use Graphics#fill to fill the shape with the desired style.");const i={};return t!==void 0&&(i.color=t),e!==void 0&&(i.alpha=e),this.context.fillStyle=i,this}endFill(){q(et,"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!==Wt.defaultStrokeStyle.width||t.color!==Wt.defaultStrokeStyle.color||t.alpha!==Wt.defaultStrokeStyle.alpha)&&this.context.stroke(),this}drawCircle(...t){return q(et,"Graphics#drawCircle has been renamed to Graphics#circle"),this._callContextMethod("circle",t)}drawEllipse(...t){return q(et,"Graphics#drawEllipse has been renamed to Graphics#ellipse"),this._callContextMethod("ellipse",t)}drawPolygon(...t){return q(et,"Graphics#drawPolygon has been renamed to Graphics#poly"),this._callContextMethod("poly",t)}drawRect(...t){return q(et,"Graphics#drawRect has been renamed to Graphics#rect"),this._callContextMethod("rect",t)}drawRoundedRect(...t){return q(et,"Graphics#drawRoundedRect has been renamed to Graphics#roundRect"),this._callContextMethod("roundRect",t)}drawStar(...t){return q(et,"Graphics#drawStar has been renamed to Graphics#star"),this._callContextMethod("star",t)}}pt.add(yn,_n);const Kh=Fi({__name:"SiteCanvas",setup(s,{expose:t}){const e=ks("root"),i=ks("canvas"),r=Nt(void 0),n=Nt([]),o=gn();function a(C,E){return typeof C=="string"?C.endsWith("%")&&E?parseFloat(C)/100*E:C.endsWith("rem")?parseFloat(C)*o.value:parseFloat(C):C}function h(C,E,S){return E*S+a(C,S)}function c(C,E,S,P,D=1){const{top:G,height:R}=P,B=E*R.value,Y=S/2,Z=B+G.value+a(C,R.value)-Y;return Y+Z*D}function l(C){return C*Math.PI/180}function u(C,E){const S=new Ce,{x:P=0,anchorX:D=0,y:G=0,anchorY:R=0,alpha:B=1,rotation:Y=0,fill:H,stroke:Z,strokeWidth:ut="0.25rem"}=E;B<1&&(S.alpha=B),S.rotation=l(Y);const f=()=>{const g=a(E.radiusX,C.width.value),y=a(E.radiusY,C.height.value);S.clear(),S.position.x=h(P,D,C.width.value),S.position.y=c(G,R,window.innerHeight,C,E.speedY),S.ellipse(0,0,g,y),H&&S.fill(Es(H)),Z&&S.stroke({color:Es(Z),width:a(ut)})};return f(),{graphics:S,update:()=>{S.position.y=c(G,R,window.innerHeight,C,E.speedY)},resize:f}}function p(C,E,S){if(!r.value)throw new Error("Application is not initialized");const P=new kt,D=S.map(G=>{const R=u(E,G);return P.addChild(R.graphics),R});return r.value.stage.addChild(P),{id:C,container:P,elements:D,update:()=>{D.forEach(G=>
246G.update())},remove:()=>{var G;P.destroy({children:!0}),(G=r.value)==null||G.stage.removeChild(P)},resize:()=>{D.forEach(G=>G.resize())}}}function d(C,E,S){const P=p(C,E,S);n.value.push(P),b()}const x=hn();x.$onAction(({name:C,after:E,args:S})=>{var P;if(C==="addLayer")E(D=>{const[G,R]=S;m.value?d(D,G,R):ln(()=>m.value,()=>d(D,G,R))});else if(C==="removeLayer"){const D=n.value.find(G=>G.id===S[0]);D&&(D.remove(),n.value=n.value.filter(G=>G.id!==S[0]),m.value&&((P=r.value)==null||P.render()))}});const{$lenis:_}=cn(),m=Nt(!1);function b(){var C;m.value&&(n.value.forEach(E=>E.update()),(C=r.value)==null||C.render())}function w(){var C;m.value&&(n.value.forEach(E=>E.resize()),(C=r.value)==null||C.render())}t({updateAndRender:()=>requestAnimationFrame(()=>{b()})});let A;return Di(async()=>{r.value=new Br,await r.value.init({canvas:i.value,resizeTo:e.value,backgroundAlpha:0,autoStart:!1}),r.value.ticker.stop(),m.value=!0,x.visible=!0,b(),_.on("scroll",b);const{height:C}=un(e.value.parentElement);A=dn(C,()=>{requestAnimationFrame(()=>{b()})})}),fn(i,pn(w)),mn(()=>{var C;_.off("scroll",b),(C=r.value)==null||C.destroy(),A==null||A()}),(C,E)=>(zi(),Li("div",{ref_key:"root",ref:e,class:Ui(["pointer-events-none fixed inset-[-40px] blur-[200px] transition-opacity duration-500",{"opacity-0":!It(x).visible}])},[xe("canvas",{ref_key:"canvas",ref:i},null,512)],2))}});export{ft as $,kr as A,ot as B,kt as C,Tt as D,W as E,Zi as F,Se as G,gt as H,ho as I,$s as J,ee as K,Fo as L,N as M,Yo as N,tt as O,rt as P,it as Q,os as R,ma as S,ce as T,is as U,jo as V,Ws as W,Le as X,qs as Y,uo as Z,Kh as _,Zh as a,Ji as a0,Er as a1,q as a2,et as a3,Jo as a4,wa as a5,Na as a6,Oa as a7,Wa as a8,qa as a9,Za as aa,Wt as ab,Kt as ac,Bi as ad,ne as ae,ea as af,ve as ag,Ut as ah,Yr as ai,ui as aj,li as ak,En as al,Ce as am,Rn as an,Wr as ao,Mt as b,ie as c,_e as d,pt as e,ci as f,da as g,ys as h,Mr as i,cr as j,wt as k,Sr as l,Ua as m,Bs as n,Ha as o,$a as p,ja as q,$n as r,Gr as s,_s as t,j as u,wr as v,ct as w,In as x,Qa as y,At as z};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.