@prefecthq/graphs 0.1.16 → 0.1.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,21 +1,21 @@
1
- (function(Wt,J){typeof exports=="object"&&typeof module<"u"?J(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],J):(Wt=typeof globalThis<"u"?globalThis:Wt||self,J(Wt["prefect-graphs"]={},Wt.Vue))})(this,function(Wt,J){"use strict";var Dx=Object.defineProperty;var Fx=(Wt,J,Se)=>J in Wt?Dx(Wt,J,{enumerable:!0,configurable:!0,writable:!0,value:Se}):Wt[J]=Se;var B=(Wt,J,Se)=>(Fx(Wt,typeof J!="symbol"?J+"":J,Se),Se);var Se=Math.PI*2,Tf=180/Math.PI,wf=Math.PI/180,Mt;(function(r){r[r.POLY=0]="POLY",r[r.RECT=1]="RECT",r[r.CIRC=2]="CIRC",r[r.ELIP=3]="ELIP",r[r.RREC=4]="RREC"})(Mt||(Mt={}));var j=function(){function r(e,t){e===void 0&&(e=0),t===void 0&&(t=0),this.x=0,this.y=0,this.x=e,this.y=t}return r.prototype.clone=function(){return new r(this.x,this.y)},r.prototype.copyFrom=function(e){return this.set(e.x,e.y),this},r.prototype.copyTo=function(e){return e.set(this.x,this.y),e},r.prototype.equals=function(e){return e.x===this.x&&e.y===this.y},r.prototype.set=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=e),this.x=e,this.y=t,this},r.prototype.toString=function(){return"[@pixi/math:Point x="+this.x+" y="+this.y+"]"},r}(),$r=[new j,new j,new j,new j],Z=function(){function r(e,t,i,n){e===void 0&&(e=0),t===void 0&&(t=0),i===void 0&&(i=0),n===void 0&&(n=0),this.x=Number(e),this.y=Number(t),this.width=Number(i),this.height=Number(n),this.type=Mt.RECT}return Object.defineProperty(r.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(r,"EMPTY",{get:function(){return new r(0,0,0,0)},enumerable:!1,configurable:!0}),r.prototype.clone=function(){return new r(this.x,this.y,this.width,this.height)},r.prototype.copyFrom=function(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this},r.prototype.copyTo=function(e){return e.x=this.x,e.y=this.y,e.width=this.width,e.height=this.height,e},r.prototype.contains=function(e,t){return this.width<=0||this.height<=0?!1:e>=this.x&&e<this.x+this.width&&t>=this.y&&t<this.y+this.height},r.prototype.intersects=function(e,t){if(!t){var i=this.x<e.x?e.x:this.x,n=this.right>e.right?e.right:this.right;if(n<=i)return!1;var s=this.y<e.y?e.y:this.y,a=this.bottom>e.bottom?e.bottom:this.bottom;return a>s}var o=this.left,h=this.right,u=this.top,l=this.bottom;if(h<=o||l<=u)return!1;var f=$r[0].set(e.left,e.top),c=$r[1].set(e.left,e.bottom),d=$r[2].set(e.right,e.top),v=$r[3].set(e.right,e.bottom);if(d.x<=f.x||c.y<=f.y)return!1;var p=Math.sign(t.a*t.d-t.b*t.c);if(p===0||(t.apply(f,f),t.apply(c,c),t.apply(d,d),t.apply(v,v),Math.max(f.x,c.x,d.x,v.x)<=o||Math.min(f.x,c.x,d.x,v.x)>=h||Math.max(f.y,c.y,d.y,v.y)<=u||Math.min(f.y,c.y,d.y,v.y)>=l))return!1;var _=p*(c.y-f.y),m=p*(f.x-c.x),g=_*o+m*u,y=_*h+m*u,b=_*o+m*l,x=_*h+m*l;if(Math.max(g,y,b,x)<=_*f.x+m*f.y||Math.min(g,y,b,x)>=_*v.x+m*v.y)return!1;var T=p*(f.y-d.y),w=p*(d.x-f.x),S=T*o+w*u,E=T*h+w*u,P=T*o+w*l,O=T*h+w*l;return!(Math.max(S,E,P,O)<=T*f.x+w*f.y||Math.min(S,E,P,O)>=T*v.x+w*v.y)},r.prototype.pad=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=e),this.x-=e,this.y-=t,this.width+=e*2,this.height+=t*2,this},r.prototype.fit=function(e){var t=Math.max(this.x,e.x),i=Math.min(this.x+this.width,e.x+e.width),n=Math.max(this.y,e.y),s=Math.min(this.y+this.height,e.y+e.height);return this.x=t,this.width=Math.max(i-t,0),this.y=n,this.height=Math.max(s-n,0),this},r.prototype.ceil=function(e,t){e===void 0&&(e=1),t===void 0&&(t=.001);var i=Math.ceil((this.x+this.width-t)*e)/e,n=Math.ceil((this.y+this.height-t)*e)/e;return this.x=Math.floor((this.x+t)*e)/e,this.y=Math.floor((this.y+t)*e)/e,this.width=i-this.x,this.height=n-this.y,this},r.prototype.enlarge=function(e){var t=Math.min(this.x,e.x),i=Math.max(this.x+this.width,e.x+e.width),n=Math.min(this.y,e.y),s=Math.max(this.y+this.height,e.y+e.height);return this.x=t,this.width=i-t,this.y=n,this.height=s-n,this},r.prototype.toString=function(){return"[@pixi/math:Rectangle x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+"]"},r}(),Ef=function(){function r(e,t,i){e===void 0&&(e=0),t===void 0&&(t=0),i===void 0&&(i=0),this.x=e,this.y=t,this.radius=i,this.type=Mt.CIRC}return r.prototype.clone=function(){return new r(this.x,this.y,this.radius)},r.prototype.contains=function(e,t){if(this.radius<=0)return!1;var i=this.radius*this.radius,n=this.x-e,s=this.y-t;return n*=n,s*=s,n+s<=i},r.prototype.getBounds=function(){return new Z(this.x-this.radius,this.y-this.radius,this.radius*2,this.radius*2)},r.prototype.toString=function(){return"[@pixi/math:Circle x="+this.x+" y="+this.y+" radius="+this.radius+"]"},r}(),Sf=function(){function r(e,t,i,n){e===void 0&&(e=0),t===void 0&&(t=0),i===void 0&&(i=0),n===void 0&&(n=0),this.x=e,this.y=t,this.width=i,this.height=n,this.type=Mt.ELIP}return r.prototype.clone=function(){return new r(this.x,this.y,this.width,this.height)},r.prototype.contains=function(e,t){if(this.width<=0||this.height<=0)return!1;var i=(e-this.x)/this.width,n=(t-this.y)/this.height;return i*=i,n*=n,i+n<=1},r.prototype.getBounds=function(){return new Z(this.x-this.width,this.y-this.height,this.width,this.height)},r.prototype.toString=function(){return"[@pixi/math:Ellipse x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+"]"},r}(),Jr=function(){function r(){for(var e=arguments,t=[],i=0;i<arguments.length;i++)t[i]=e[i];var n=Array.isArray(t[0])?t[0]:t;if(typeof n[0]!="number"){for(var s=[],a=0,o=n.length;a<o;a++)s.push(n[a].x,n[a].y);n=s}this.points=n,this.type=Mt.POLY,this.closeStroke=!0}return r.prototype.clone=function(){var e=this.points.slice(),t=new r(e);return t.closeStroke=this.closeStroke,t},r.prototype.contains=function(e,t){for(var i=!1,n=this.points.length/2,s=0,a=n-1;s<n;a=s++){var o=this.points[s*2],h=this.points[s*2+1],u=this.points[a*2],l=this.points[a*2+1],f=h>t!=l>t&&e<(u-o)*((t-h)/(l-h))+o;f&&(i=!i)}return i},r.prototype.toString=function(){return"[@pixi/math:Polygon"+("closeStroke="+this.closeStroke)+("points="+this.points.reduce(function(e,t){return e+", "+t},"")+"]")},r}(),Pf=function(){function r(e,t,i,n,s){e===void 0&&(e=0),t===void 0&&(t=0),i===void 0&&(i=0),n===void 0&&(n=0),s===void 0&&(s=20),this.x=e,this.y=t,this.width=i,this.height=n,this.radius=s,this.type=Mt.RREC}return r.prototype.clone=function(){return new r(this.x,this.y,this.width,this.height,this.radius)},r.prototype.contains=function(e,t){if(this.width<=0||this.height<=0)return!1;if(e>=this.x&&e<=this.x+this.width&&t>=this.y&&t<=this.y+this.height){var i=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(t>=this.y+i&&t<=this.y+this.height-i||e>=this.x+i&&e<=this.x+this.width-i)return!0;var n=e-(this.x+i),s=t-(this.y+i),a=i*i;if(n*n+s*s<=a||(n=e-(this.x+this.width-i),n*n+s*s<=a)||(s=t-(this.y+this.height-i),n*n+s*s<=a)||(n=e-(this.x+i),n*n+s*s<=a))return!0}return!1},r.prototype.toString=function(){return"[@pixi/math:RoundedRectangle x="+this.x+" y="+this.y+("width="+this.width+" height="+this.height+" radius="+this.radius+"]")},r}(),Gi=function(){function r(e,t,i,n){i===void 0&&(i=0),n===void 0&&(n=0),this._x=i,this._y=n,this.cb=e,this.scope=t}return r.prototype.clone=function(e,t){return e===void 0&&(e=this.cb),t===void 0&&(t=this.scope),new r(e,t,this._x,this._y)},r.prototype.set=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=e),(this._x!==e||this._y!==t)&&(this._x=e,this._y=t,this.cb.call(this.scope)),this},r.prototype.copyFrom=function(e){return(this._x!==e.x||this._y!==e.y)&&(this._x=e.x,this._y=e.y,this.cb.call(this.scope)),this},r.prototype.copyTo=function(e){return e.set(this._x,this._y),e},r.prototype.equals=function(e){return e.x===this._x&&e.y===this._y},r.prototype.toString=function(){return"[@pixi/math:ObservablePoint x="+0+" y="+0+" scope="+this.scope+"]"},Object.defineProperty(r.prototype,"x",{get:function(){return this._x},set:function(e){this._x!==e&&(this._x=e,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"y",{get:function(){return this._y},set:function(e){this._y!==e&&(this._y=e,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),r}(),Ct=function(){function r(e,t,i,n,s,a){e===void 0&&(e=1),t===void 0&&(t=0),i===void 0&&(i=0),n===void 0&&(n=1),s===void 0&&(s=0),a===void 0&&(a=0),this.array=null,this.a=e,this.b=t,this.c=i,this.d=n,this.tx=s,this.ty=a}return r.prototype.fromArray=function(e){this.a=e[0],this.b=e[1],this.c=e[3],this.d=e[4],this.tx=e[2],this.ty=e[5]},r.prototype.set=function(e,t,i,n,s,a){return this.a=e,this.b=t,this.c=i,this.d=n,this.tx=s,this.ty=a,this},r.prototype.toArray=function(e,t){this.array||(this.array=new Float32Array(9));var i=t||this.array;return e?(i[0]=this.a,i[1]=this.b,i[2]=0,i[3]=this.c,i[4]=this.d,i[5]=0,i[6]=this.tx,i[7]=this.ty,i[8]=1):(i[0]=this.a,i[1]=this.c,i[2]=this.tx,i[3]=this.b,i[4]=this.d,i[5]=this.ty,i[6]=0,i[7]=0,i[8]=1),i},r.prototype.apply=function(e,t){t=t||new j;var i=e.x,n=e.y;return t.x=this.a*i+this.c*n+this.tx,t.y=this.b*i+this.d*n+this.ty,t},r.prototype.applyInverse=function(e,t){t=t||new j;var i=1/(this.a*this.d+this.c*-this.b),n=e.x,s=e.y;return t.x=this.d*i*n+-this.c*i*s+(this.ty*this.c-this.tx*this.d)*i,t.y=this.a*i*s+-this.b*i*n+(-this.ty*this.a+this.tx*this.b)*i,t},r.prototype.translate=function(e,t){return this.tx+=e,this.ty+=t,this},r.prototype.scale=function(e,t){return this.a*=e,this.d*=t,this.c*=e,this.b*=t,this.tx*=e,this.ty*=t,this},r.prototype.rotate=function(e){var t=Math.cos(e),i=Math.sin(e),n=this.a,s=this.c,a=this.tx;return this.a=n*t-this.b*i,this.b=n*i+this.b*t,this.c=s*t-this.d*i,this.d=s*i+this.d*t,this.tx=a*t-this.ty*i,this.ty=a*i+this.ty*t,this},r.prototype.append=function(e){var t=this.a,i=this.b,n=this.c,s=this.d;return this.a=e.a*t+e.b*n,this.b=e.a*i+e.b*s,this.c=e.c*t+e.d*n,this.d=e.c*i+e.d*s,this.tx=e.tx*t+e.ty*n+this.tx,this.ty=e.tx*i+e.ty*s+this.ty,this},r.prototype.setTransform=function(e,t,i,n,s,a,o,h,u){return this.a=Math.cos(o+u)*s,this.b=Math.sin(o+u)*s,this.c=-Math.sin(o-h)*a,this.d=Math.cos(o-h)*a,this.tx=e-(i*this.a+n*this.c),this.ty=t-(i*this.b+n*this.d),this},r.prototype.prepend=function(e){var t=this.tx;if(e.a!==1||e.b!==0||e.c!==0||e.d!==1){var i=this.a,n=this.c;this.a=i*e.a+this.b*e.c,this.b=i*e.b+this.b*e.d,this.c=n*e.a+this.d*e.c,this.d=n*e.b+this.d*e.d}return this.tx=t*e.a+this.ty*e.c+e.tx,this.ty=t*e.b+this.ty*e.d+e.ty,this},r.prototype.decompose=function(e){var t=this.a,i=this.b,n=this.c,s=this.d,a=e.pivot,o=-Math.atan2(-n,s),h=Math.atan2(i,t),u=Math.abs(o+h);return u<1e-5||Math.abs(Se-u)<1e-5?(e.rotation=h,e.skew.x=e.skew.y=0):(e.rotation=0,e.skew.x=o,e.skew.y=h),e.scale.x=Math.sqrt(t*t+i*i),e.scale.y=Math.sqrt(n*n+s*s),e.position.x=this.tx+(a.x*t+a.y*n),e.position.y=this.ty+(a.x*i+a.y*s),e},r.prototype.invert=function(){var e=this.a,t=this.b,i=this.c,n=this.d,s=this.tx,a=e*n-t*i;return this.a=n/a,this.b=-t/a,this.c=-i/a,this.d=e/a,this.tx=(i*this.ty-n*s)/a,this.ty=-(e*this.ty-t*s)/a,this},r.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},r.prototype.clone=function(){var e=new r;return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e},r.prototype.copyTo=function(e){return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e},r.prototype.copyFrom=function(e){return this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.ty,this},r.prototype.toString=function(){return"[@pixi/math:Matrix a="+this.a+" b="+this.b+" c="+this.c+" d="+this.d+" tx="+this.tx+" ty="+this.ty+"]"},Object.defineProperty(r,"IDENTITY",{get:function(){return new r},enumerable:!1,configurable:!0}),Object.defineProperty(r,"TEMP_MATRIX",{get:function(){return new r},enumerable:!1,configurable:!0}),r}(),ci=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],di=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],pi=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],vi=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],fs=[],So=[],Qr=Math.sign;function Rf(){for(var r=0;r<16;r++){var e=[];fs.push(e);for(var t=0;t<16;t++)for(var i=Qr(ci[r]*ci[t]+pi[r]*di[t]),n=Qr(di[r]*ci[t]+vi[r]*di[t]),s=Qr(ci[r]*pi[t]+pi[r]*vi[t]),a=Qr(di[r]*pi[t]+vi[r]*vi[t]),o=0;o<16;o++)if(ci[o]===i&&di[o]===n&&pi[o]===s&&vi[o]===a){e.push(o);break}}for(var r=0;r<16;r++){var h=new Ct;h.set(ci[r],di[r],pi[r],vi[r],0,0),So.push(h)}}Rf();var dt={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:function(r){return ci[r]},uY:function(r){return di[r]},vX:function(r){return pi[r]},vY:function(r){return vi[r]},inv:function(r){return r&8?r&15:-r&7},add:function(r,e){return fs[r][e]},sub:function(r,e){return fs[r][dt.inv(e)]},rotate180:function(r){return r^4},isVertical:function(r){return(r&3)===2},byDirection:function(r,e){return Math.abs(r)*2<=Math.abs(e)?e>=0?dt.S:dt.N:Math.abs(e)*2<=Math.abs(r)?r>0?dt.E:dt.W:e>0?r>0?dt.SE:dt.SW:r>0?dt.NE:dt.NW},matrixAppendRotationInv:function(r,e,t,i){t===void 0&&(t=0),i===void 0&&(i=0);var n=So[dt.inv(e)];n.tx=t,n.ty=i,r.append(n)}},Po=function(){function r(){this.worldTransform=new Ct,this.localTransform=new Ct,this.position=new Gi(this.onChange,this,0,0),this.scale=new Gi(this.onChange,this,1,1),this.pivot=new Gi(this.onChange,this,0,0),this.skew=new Gi(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}return r.prototype.onChange=function(){this._localID++},r.prototype.updateSkew=function(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++},r.prototype.toString=function(){return"[@pixi/math:Transform "+("position=("+this.position.x+", "+this.position.y+") ")+("rotation="+this.rotation+" ")+("scale=("+this.scale.x+", "+this.scale.y+") ")+("skew=("+this.skew.x+", "+this.skew.y+") ")+"]"},r.prototype.updateLocalTransform=function(){var e=this.localTransform;this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale.x,e.b=this._sx*this.scale.x,e.c=this._cy*this.scale.y,e.d=this._sy*this.scale.y,e.tx=this.position.x-(this.pivot.x*e.a+this.pivot.y*e.c),e.ty=this.position.y-(this.pivot.x*e.b+this.pivot.y*e.d),this._currentLocalID=this._localID,this._parentID=-1)},r.prototype.updateTransform=function(e){var t=this.localTransform;if(this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==e._worldID){var i=e.worldTransform,n=this.worldTransform;n.a=t.a*i.a+t.b*i.c,n.b=t.a*i.b+t.b*i.d,n.c=t.c*i.a+t.d*i.c,n.d=t.c*i.b+t.d*i.d,n.tx=t.tx*i.a+t.ty*i.c+i.tx,n.ty=t.tx*i.b+t.ty*i.d+i.ty,this._parentID=e._worldID,this._worldID++}},r.prototype.setFromMatrix=function(e){e.decompose(this),this._localID++},Object.defineProperty(r.prototype,"rotation",{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,this.updateSkew())},enumerable:!1,configurable:!0}),r.IDENTITY=new r,r}();const _i=new Z;class Cf{constructor(e={}){this._recursive=typeof e.recursive=="boolean"?e.recursive:!0,this._toggle=e.toggle||"visible",this._targetList=new Set}add(e){return this._targetList.add(e),this}addAll(e){for(let t=0,i=e.length;t<i;t++)this._targetList.add(e[t]);return this}remove(e){return this._targetList.delete(e),this}removeAll(e){for(let t=0,i=e.length;t<i;t++)this._targetList.delete(e[t]);return this}clear(){return this._targetList.clear(),this}cull(e,t=!1){return t||this.uncull(),this._targetList.forEach(i=>{t||i.getBounds(!1,_i),this._recursive?this.cullRecursive(e,i,t):(t&&i._bounds.getRectangle(e),i[this._toggle]=_i.right>e.left&&_i.left<e.right&&_i.bottom>e.top&&_i.top<e.bottom)}),this}uncull(){return this._targetList.forEach(e=>{this._recursive?this.uncullRecursive(e):e[this._toggle]=!1}),this}cullRecursive(e,t,i){const n=i?t._bounds.getRectangle(_i):t.getBounds(!0,_i);if(t[this._toggle]=n.right>e.left&&n.left<e.right&&n.bottom>e.top&&n.top<e.bottom,!(n.left>=e.left&&n.top>=e.top&&n.right<=e.right&&n.bottom<=e.bottom)&&t[this._toggle]&&t.children&&t.children.length){const a=t.children;for(let o=0,h=a.length;o<h;o++)this.cullRecursive(e,a[o])}}uncullRecursive(e){if(e[this._toggle]=!0,e.children&&e.children.length){const t=e.children;for(let i=0,n=t.length;i<n;i++)this.uncullRecursive(t[i])}}}const{abs:Nx,atan2:Lx,cos:Bx,max:Of,min:Ro,sin:Gx,tan:Ux,sqrt:kx,pow:Xx,floor:Hx,ceil:Wx,random:zx,round:Af}=Math;function If(r){return r.toLocaleTimeString()}function Mf(r){const e=navigator.language;return new Intl.DateTimeFormat(e,{timeStyle:"short"}).format(r)}function Df(r){const e=navigator.language;return new Intl.DateTimeFormat(e,{dateStyle:"short"}).format(r)}function Ff(r,e){let t,i;r.forEach(s=>{(t===void 0||t>s.start||isNaN(s.start.getDate()))&&(t=s.start),s.end!==null&&(i===void 0||i<s.end||isNaN(s.end.getDate()))&&(i=s.end)}),t=t??new Date,i=i??new Date(t.getTime()+(e??0));const n=i.getTime()-t.getTime();return{min:t,max:i,span:e&&n<e?e:n}}function Nf(r){return new Date(r.getFullYear(),r.getMonth(),r.getDate())}function Lf(r){return new Date(r.getFullYear(),r.getMonth(),r.getDate(),Math.floor(r.getHours()/2)*2)}const q={second:1e3,minute:1e3*60,hour:1e3*60*60,day:1e3*60*60*24,week:1e3*60*60*24*7},Ot={seconds:"seconds",minutes:"minutes",date:"date"},Co=[{ceiling:q.second*4,span:q.second,labelFormat:Ot.seconds},{ceiling:q.second*8,span:q.second*5,labelFormat:Ot.seconds},{ceiling:q.second*13,span:q.second*10,labelFormat:Ot.seconds},{ceiling:q.second*20,span:q.second*15,labelFormat:Ot.seconds},{ceiling:q.second*45,span:q.second*30,labelFormat:Ot.seconds},{ceiling:q.minute*4,span:q.minute,labelFormat:Ot.minutes},{ceiling:q.minute*8,span:q.minute*5,labelFormat:Ot.minutes},{ceiling:q.minute*13,span:q.minute*10,labelFormat:Ot.minutes},{ceiling:q.minute*28,span:q.minute*15,labelFormat:Ot.minutes},{ceiling:q.hour*1.24,span:q.minute*30,labelFormat:Ot.minutes},{ceiling:q.hour*3,span:q.hour,labelFormat:Ot.minutes},{ceiling:q.hour*8,span:q.hour*2,labelFormat:Ot.minutes},{ceiling:q.hour*13,span:q.hour*6,labelFormat:Ot.minutes},{ceiling:q.hour*22,span:q.hour*12,labelFormat:Ot.minutes},{ceiling:q.day*4,span:q.day,labelFormat:Ot.date},{ceiling:q.week*2,span:q.week,labelFormat:Ot.date},{ceiling:1/0,span:q.week*4,labelFormat:Ot.date}];function Bf(r){return{colorTextDefault:qe((r==null?void 0:r.colorTextDefault)??"#374151"),colorTextInverse:qe((r==null?void 0:r.colorTextInverse)??"#f8fafc"),colorTextSubdued:qe((r==null?void 0:r.colorTextSubdued)??"#6b7280"),colorEdge:qe((r==null?void 0:r.colorEdge)??"#374151"),colorNodeSelection:qe((r==null?void 0:r.colorNodeSelection)??"#024DFD"),colorGuideLine:qe((r==null?void 0:r.colorGuideLine)??"#cbd5e1"),colorPlayheadBg:qe((r==null?void 0:r.colorPlayheadBg)??"#4e82fe"),textFontFamilyDefault:(r==null?void 0:r.textFontFamilyDefault)??"InterVariable",textSizeDefault:Dt((r==null?void 0:r.textSizeDefault)??"14px"),textSizeSmall:Dt((r==null?void 0:r.textSizeSmall)??"12px"),textLineHeightDefault:Dt((r==null?void 0:r.textLineHeightDefault)??"20px"),textLineHeightSmall:Dt((r==null?void 0:r.textLineHeightSmall)??"16px"),spacingViewportPaddingDefault:Dt((r==null?void 0:r.spacingViewportPaddingDefault)??"40px"),spacingNodeXPadding:Dt((r==null?void 0:r.spacingNodeXPadding)??"8px"),spacingNodeYPadding:Dt((r==null?void 0:r.spacingNodeYPadding)??"8px"),spacingNodeMargin:Dt((r==null?void 0:r.spacingNodeMargin)??"24px"),spacingNodeLabelMargin:Dt((r==null?void 0:r.spacingNodeLabelMargin)??"20px"),spacingMinimumNodeEdgeGap:Dt((r==null?void 0:r.spacingMinimumNodeEdgeGap)??"16px"),spacingNodeEdgeLength:Dt((r==null?void 0:r.spacingNodeEdgeLength)??"8px"),spacingNodeSelectionMargin:Dt((r==null?void 0:r.spacingNodeSelectionMargin)??"2px"),spacingNodeSelectionWidth:Dt((r==null?void 0:r.spacingNodeSelectionWidth)??"4px"),spacingEdgeWidth:Dt((r==null?void 0:r.spacingEdgeWidth)??"2px"),spacingGuideLabelPadding:Dt((r==null?void 0:r.spacingGuideLabelPadding)??"4px"),spacingPlayheadGlowPadding:Dt((r==null?void 0:r.spacingPlayheadGlowPadding)??"8px"),spacingPlayheadWidth:Dt((r==null?void 0:r.spacingPlayheadWidth)??"2px"),borderRadiusNode:Dt((r==null?void 0:r.borderRadiusNode)??"8px"),alphaNodeDimmed:(r==null?void 0:r.alphaNodeDimmed)??.2}}function qe(r){const e=r.trim();if(e.startsWith("rgb")){const[t,i,n]=e.replace(/[^\d,]/g,"").split(",").map(s=>parseInt(s,10));return Gf([t,i,n])}if(e.startsWith("hsl")){const[t,i,n]=e.replace(/[^\d,.%]/g,"").split(",").map(a=>parseInt(a,10));return Oo(Uf(t,i,n))}return Oo(e)}function Gf(r){return parseInt((1<<24|r[0]<<16|r[1]<<8|r[2]).toString(16).slice(1),16)}function Uf(r,e,t){t/=100;const i=e*Ro(t,1-t)/100,n=s=>{const a=(s+r/30)%12,o=t-i*Of(Ro(a-3,9-a,1),-1);return Af(255*o).toString(16).padStart(2,"0")};return`#${n(0)}${n(8)}${n(4)}`}function Oo(r){if(typeof r=="string"&&(r.startsWith("#")&&(r=r.slice(1)),r.length===3)){const[e,t,i]=r;r=e+e+t+t+i+i}return parseInt(r,16)}function Dt(r){return typeof r!="string"?(Ao(r),0):r.endsWith("em")||r.endsWith("rem")?kf(r):r.endsWith("px")?parseFloat(r):(Ao(r),0)}function Ao(r){console.error(`
1
+ (function(Wt,Q){typeof exports=="object"&&typeof module<"u"?Q(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],Q):(Wt=typeof globalThis<"u"?globalThis:Wt||self,Q(Wt["prefect-graphs"]={},Wt.Vue))})(this,function(Wt,Q){"use strict";var Fx=Object.defineProperty;var Nx=(Wt,Q,Se)=>Q in Wt?Fx(Wt,Q,{enumerable:!0,configurable:!0,writable:!0,value:Se}):Wt[Q]=Se;var U=(Wt,Q,Se)=>(Nx(Wt,typeof Q!="symbol"?Q+"":Q,Se),Se);var Se=Math.PI*2,wf=180/Math.PI,Ef=Math.PI/180,Mt;(function(r){r[r.POLY=0]="POLY",r[r.RECT=1]="RECT",r[r.CIRC=2]="CIRC",r[r.ELIP=3]="ELIP",r[r.RREC=4]="RREC"})(Mt||(Mt={}));var j=function(){function r(e,t){e===void 0&&(e=0),t===void 0&&(t=0),this.x=0,this.y=0,this.x=e,this.y=t}return r.prototype.clone=function(){return new r(this.x,this.y)},r.prototype.copyFrom=function(e){return this.set(e.x,e.y),this},r.prototype.copyTo=function(e){return e.set(this.x,this.y),e},r.prototype.equals=function(e){return e.x===this.x&&e.y===this.y},r.prototype.set=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=e),this.x=e,this.y=t,this},r.prototype.toString=function(){return"[@pixi/math:Point x="+this.x+" y="+this.y+"]"},r}(),$r=[new j,new j,new j,new j],q=function(){function r(e,t,i,n){e===void 0&&(e=0),t===void 0&&(t=0),i===void 0&&(i=0),n===void 0&&(n=0),this.x=Number(e),this.y=Number(t),this.width=Number(i),this.height=Number(n),this.type=Mt.RECT}return Object.defineProperty(r.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(r,"EMPTY",{get:function(){return new r(0,0,0,0)},enumerable:!1,configurable:!0}),r.prototype.clone=function(){return new r(this.x,this.y,this.width,this.height)},r.prototype.copyFrom=function(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this},r.prototype.copyTo=function(e){return e.x=this.x,e.y=this.y,e.width=this.width,e.height=this.height,e},r.prototype.contains=function(e,t){return this.width<=0||this.height<=0?!1:e>=this.x&&e<this.x+this.width&&t>=this.y&&t<this.y+this.height},r.prototype.intersects=function(e,t){if(!t){var i=this.x<e.x?e.x:this.x,n=this.right>e.right?e.right:this.right;if(n<=i)return!1;var s=this.y<e.y?e.y:this.y,a=this.bottom>e.bottom?e.bottom:this.bottom;return a>s}var o=this.left,h=this.right,u=this.top,l=this.bottom;if(h<=o||l<=u)return!1;var f=$r[0].set(e.left,e.top),c=$r[1].set(e.left,e.bottom),d=$r[2].set(e.right,e.top),v=$r[3].set(e.right,e.bottom);if(d.x<=f.x||c.y<=f.y)return!1;var p=Math.sign(t.a*t.d-t.b*t.c);if(p===0||(t.apply(f,f),t.apply(c,c),t.apply(d,d),t.apply(v,v),Math.max(f.x,c.x,d.x,v.x)<=o||Math.min(f.x,c.x,d.x,v.x)>=h||Math.max(f.y,c.y,d.y,v.y)<=u||Math.min(f.y,c.y,d.y,v.y)>=l))return!1;var _=p*(c.y-f.y),m=p*(f.x-c.x),g=_*o+m*u,y=_*h+m*u,b=_*o+m*l,x=_*h+m*l;if(Math.max(g,y,b,x)<=_*f.x+m*f.y||Math.min(g,y,b,x)>=_*v.x+m*v.y)return!1;var T=p*(f.y-d.y),w=p*(d.x-f.x),S=T*o+w*u,E=T*h+w*u,P=T*o+w*l,O=T*h+w*l;return!(Math.max(S,E,P,O)<=T*f.x+w*f.y||Math.min(S,E,P,O)>=T*v.x+w*v.y)},r.prototype.pad=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=e),this.x-=e,this.y-=t,this.width+=e*2,this.height+=t*2,this},r.prototype.fit=function(e){var t=Math.max(this.x,e.x),i=Math.min(this.x+this.width,e.x+e.width),n=Math.max(this.y,e.y),s=Math.min(this.y+this.height,e.y+e.height);return this.x=t,this.width=Math.max(i-t,0),this.y=n,this.height=Math.max(s-n,0),this},r.prototype.ceil=function(e,t){e===void 0&&(e=1),t===void 0&&(t=.001);var i=Math.ceil((this.x+this.width-t)*e)/e,n=Math.ceil((this.y+this.height-t)*e)/e;return this.x=Math.floor((this.x+t)*e)/e,this.y=Math.floor((this.y+t)*e)/e,this.width=i-this.x,this.height=n-this.y,this},r.prototype.enlarge=function(e){var t=Math.min(this.x,e.x),i=Math.max(this.x+this.width,e.x+e.width),n=Math.min(this.y,e.y),s=Math.max(this.y+this.height,e.y+e.height);return this.x=t,this.width=i-t,this.y=n,this.height=s-n,this},r.prototype.toString=function(){return"[@pixi/math:Rectangle x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+"]"},r}(),Sf=function(){function r(e,t,i){e===void 0&&(e=0),t===void 0&&(t=0),i===void 0&&(i=0),this.x=e,this.y=t,this.radius=i,this.type=Mt.CIRC}return r.prototype.clone=function(){return new r(this.x,this.y,this.radius)},r.prototype.contains=function(e,t){if(this.radius<=0)return!1;var i=this.radius*this.radius,n=this.x-e,s=this.y-t;return n*=n,s*=s,n+s<=i},r.prototype.getBounds=function(){return new q(this.x-this.radius,this.y-this.radius,this.radius*2,this.radius*2)},r.prototype.toString=function(){return"[@pixi/math:Circle x="+this.x+" y="+this.y+" radius="+this.radius+"]"},r}(),Pf=function(){function r(e,t,i,n){e===void 0&&(e=0),t===void 0&&(t=0),i===void 0&&(i=0),n===void 0&&(n=0),this.x=e,this.y=t,this.width=i,this.height=n,this.type=Mt.ELIP}return r.prototype.clone=function(){return new r(this.x,this.y,this.width,this.height)},r.prototype.contains=function(e,t){if(this.width<=0||this.height<=0)return!1;var i=(e-this.x)/this.width,n=(t-this.y)/this.height;return i*=i,n*=n,i+n<=1},r.prototype.getBounds=function(){return new q(this.x-this.width,this.y-this.height,this.width,this.height)},r.prototype.toString=function(){return"[@pixi/math:Ellipse x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+"]"},r}(),Jr=function(){function r(){for(var e=arguments,t=[],i=0;i<arguments.length;i++)t[i]=e[i];var n=Array.isArray(t[0])?t[0]:t;if(typeof n[0]!="number"){for(var s=[],a=0,o=n.length;a<o;a++)s.push(n[a].x,n[a].y);n=s}this.points=n,this.type=Mt.POLY,this.closeStroke=!0}return r.prototype.clone=function(){var e=this.points.slice(),t=new r(e);return t.closeStroke=this.closeStroke,t},r.prototype.contains=function(e,t){for(var i=!1,n=this.points.length/2,s=0,a=n-1;s<n;a=s++){var o=this.points[s*2],h=this.points[s*2+1],u=this.points[a*2],l=this.points[a*2+1],f=h>t!=l>t&&e<(u-o)*((t-h)/(l-h))+o;f&&(i=!i)}return i},r.prototype.toString=function(){return"[@pixi/math:Polygon"+("closeStroke="+this.closeStroke)+("points="+this.points.reduce(function(e,t){return e+", "+t},"")+"]")},r}(),Rf=function(){function r(e,t,i,n,s){e===void 0&&(e=0),t===void 0&&(t=0),i===void 0&&(i=0),n===void 0&&(n=0),s===void 0&&(s=20),this.x=e,this.y=t,this.width=i,this.height=n,this.radius=s,this.type=Mt.RREC}return r.prototype.clone=function(){return new r(this.x,this.y,this.width,this.height,this.radius)},r.prototype.contains=function(e,t){if(this.width<=0||this.height<=0)return!1;if(e>=this.x&&e<=this.x+this.width&&t>=this.y&&t<=this.y+this.height){var i=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(t>=this.y+i&&t<=this.y+this.height-i||e>=this.x+i&&e<=this.x+this.width-i)return!0;var n=e-(this.x+i),s=t-(this.y+i),a=i*i;if(n*n+s*s<=a||(n=e-(this.x+this.width-i),n*n+s*s<=a)||(s=t-(this.y+this.height-i),n*n+s*s<=a)||(n=e-(this.x+i),n*n+s*s<=a))return!0}return!1},r.prototype.toString=function(){return"[@pixi/math:RoundedRectangle x="+this.x+" y="+this.y+("width="+this.width+" height="+this.height+" radius="+this.radius+"]")},r}(),Ui=function(){function r(e,t,i,n){i===void 0&&(i=0),n===void 0&&(n=0),this._x=i,this._y=n,this.cb=e,this.scope=t}return r.prototype.clone=function(e,t){return e===void 0&&(e=this.cb),t===void 0&&(t=this.scope),new r(e,t,this._x,this._y)},r.prototype.set=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=e),(this._x!==e||this._y!==t)&&(this._x=e,this._y=t,this.cb.call(this.scope)),this},r.prototype.copyFrom=function(e){return(this._x!==e.x||this._y!==e.y)&&(this._x=e.x,this._y=e.y,this.cb.call(this.scope)),this},r.prototype.copyTo=function(e){return e.set(this._x,this._y),e},r.prototype.equals=function(e){return e.x===this._x&&e.y===this._y},r.prototype.toString=function(){return"[@pixi/math:ObservablePoint x="+0+" y="+0+" scope="+this.scope+"]"},Object.defineProperty(r.prototype,"x",{get:function(){return this._x},set:function(e){this._x!==e&&(this._x=e,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"y",{get:function(){return this._y},set:function(e){this._y!==e&&(this._y=e,this.cb.call(this.scope))},enumerable:!1,configurable:!0}),r}(),Ct=function(){function r(e,t,i,n,s,a){e===void 0&&(e=1),t===void 0&&(t=0),i===void 0&&(i=0),n===void 0&&(n=1),s===void 0&&(s=0),a===void 0&&(a=0),this.array=null,this.a=e,this.b=t,this.c=i,this.d=n,this.tx=s,this.ty=a}return r.prototype.fromArray=function(e){this.a=e[0],this.b=e[1],this.c=e[3],this.d=e[4],this.tx=e[2],this.ty=e[5]},r.prototype.set=function(e,t,i,n,s,a){return this.a=e,this.b=t,this.c=i,this.d=n,this.tx=s,this.ty=a,this},r.prototype.toArray=function(e,t){this.array||(this.array=new Float32Array(9));var i=t||this.array;return e?(i[0]=this.a,i[1]=this.b,i[2]=0,i[3]=this.c,i[4]=this.d,i[5]=0,i[6]=this.tx,i[7]=this.ty,i[8]=1):(i[0]=this.a,i[1]=this.c,i[2]=this.tx,i[3]=this.b,i[4]=this.d,i[5]=this.ty,i[6]=0,i[7]=0,i[8]=1),i},r.prototype.apply=function(e,t){t=t||new j;var i=e.x,n=e.y;return t.x=this.a*i+this.c*n+this.tx,t.y=this.b*i+this.d*n+this.ty,t},r.prototype.applyInverse=function(e,t){t=t||new j;var i=1/(this.a*this.d+this.c*-this.b),n=e.x,s=e.y;return t.x=this.d*i*n+-this.c*i*s+(this.ty*this.c-this.tx*this.d)*i,t.y=this.a*i*s+-this.b*i*n+(-this.ty*this.a+this.tx*this.b)*i,t},r.prototype.translate=function(e,t){return this.tx+=e,this.ty+=t,this},r.prototype.scale=function(e,t){return this.a*=e,this.d*=t,this.c*=e,this.b*=t,this.tx*=e,this.ty*=t,this},r.prototype.rotate=function(e){var t=Math.cos(e),i=Math.sin(e),n=this.a,s=this.c,a=this.tx;return this.a=n*t-this.b*i,this.b=n*i+this.b*t,this.c=s*t-this.d*i,this.d=s*i+this.d*t,this.tx=a*t-this.ty*i,this.ty=a*i+this.ty*t,this},r.prototype.append=function(e){var t=this.a,i=this.b,n=this.c,s=this.d;return this.a=e.a*t+e.b*n,this.b=e.a*i+e.b*s,this.c=e.c*t+e.d*n,this.d=e.c*i+e.d*s,this.tx=e.tx*t+e.ty*n+this.tx,this.ty=e.tx*i+e.ty*s+this.ty,this},r.prototype.setTransform=function(e,t,i,n,s,a,o,h,u){return this.a=Math.cos(o+u)*s,this.b=Math.sin(o+u)*s,this.c=-Math.sin(o-h)*a,this.d=Math.cos(o-h)*a,this.tx=e-(i*this.a+n*this.c),this.ty=t-(i*this.b+n*this.d),this},r.prototype.prepend=function(e){var t=this.tx;if(e.a!==1||e.b!==0||e.c!==0||e.d!==1){var i=this.a,n=this.c;this.a=i*e.a+this.b*e.c,this.b=i*e.b+this.b*e.d,this.c=n*e.a+this.d*e.c,this.d=n*e.b+this.d*e.d}return this.tx=t*e.a+this.ty*e.c+e.tx,this.ty=t*e.b+this.ty*e.d+e.ty,this},r.prototype.decompose=function(e){var t=this.a,i=this.b,n=this.c,s=this.d,a=e.pivot,o=-Math.atan2(-n,s),h=Math.atan2(i,t),u=Math.abs(o+h);return u<1e-5||Math.abs(Se-u)<1e-5?(e.rotation=h,e.skew.x=e.skew.y=0):(e.rotation=0,e.skew.x=o,e.skew.y=h),e.scale.x=Math.sqrt(t*t+i*i),e.scale.y=Math.sqrt(n*n+s*s),e.position.x=this.tx+(a.x*t+a.y*n),e.position.y=this.ty+(a.x*i+a.y*s),e},r.prototype.invert=function(){var e=this.a,t=this.b,i=this.c,n=this.d,s=this.tx,a=e*n-t*i;return this.a=n/a,this.b=-t/a,this.c=-i/a,this.d=e/a,this.tx=(i*this.ty-n*s)/a,this.ty=-(e*this.ty-t*s)/a,this},r.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},r.prototype.clone=function(){var e=new r;return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e},r.prototype.copyTo=function(e){return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e},r.prototype.copyFrom=function(e){return this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.ty,this},r.prototype.toString=function(){return"[@pixi/math:Matrix a="+this.a+" b="+this.b+" c="+this.c+" d="+this.d+" tx="+this.tx+" ty="+this.ty+"]"},Object.defineProperty(r,"IDENTITY",{get:function(){return new r},enumerable:!1,configurable:!0}),Object.defineProperty(r,"TEMP_MATRIX",{get:function(){return new r},enumerable:!1,configurable:!0}),r}(),ci=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],di=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],pi=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],vi=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],fs=[],Po=[],Qr=Math.sign;function Cf(){for(var r=0;r<16;r++){var e=[];fs.push(e);for(var t=0;t<16;t++)for(var i=Qr(ci[r]*ci[t]+pi[r]*di[t]),n=Qr(di[r]*ci[t]+vi[r]*di[t]),s=Qr(ci[r]*pi[t]+pi[r]*vi[t]),a=Qr(di[r]*pi[t]+vi[r]*vi[t]),o=0;o<16;o++)if(ci[o]===i&&di[o]===n&&pi[o]===s&&vi[o]===a){e.push(o);break}}for(var r=0;r<16;r++){var h=new Ct;h.set(ci[r],di[r],pi[r],vi[r],0,0),Po.push(h)}}Cf();var dt={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:function(r){return ci[r]},uY:function(r){return di[r]},vX:function(r){return pi[r]},vY:function(r){return vi[r]},inv:function(r){return r&8?r&15:-r&7},add:function(r,e){return fs[r][e]},sub:function(r,e){return fs[r][dt.inv(e)]},rotate180:function(r){return r^4},isVertical:function(r){return(r&3)===2},byDirection:function(r,e){return Math.abs(r)*2<=Math.abs(e)?e>=0?dt.S:dt.N:Math.abs(e)*2<=Math.abs(r)?r>0?dt.E:dt.W:e>0?r>0?dt.SE:dt.SW:r>0?dt.NE:dt.NW},matrixAppendRotationInv:function(r,e,t,i){t===void 0&&(t=0),i===void 0&&(i=0);var n=Po[dt.inv(e)];n.tx=t,n.ty=i,r.append(n)}},Ro=function(){function r(){this.worldTransform=new Ct,this.localTransform=new Ct,this.position=new Ui(this.onChange,this,0,0),this.scale=new Ui(this.onChange,this,1,1),this.pivot=new Ui(this.onChange,this,0,0),this.skew=new Ui(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}return r.prototype.onChange=function(){this._localID++},r.prototype.updateSkew=function(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++},r.prototype.toString=function(){return"[@pixi/math:Transform "+("position=("+this.position.x+", "+this.position.y+") ")+("rotation="+this.rotation+" ")+("scale=("+this.scale.x+", "+this.scale.y+") ")+("skew=("+this.skew.x+", "+this.skew.y+") ")+"]"},r.prototype.updateLocalTransform=function(){var e=this.localTransform;this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale.x,e.b=this._sx*this.scale.x,e.c=this._cy*this.scale.y,e.d=this._sy*this.scale.y,e.tx=this.position.x-(this.pivot.x*e.a+this.pivot.y*e.c),e.ty=this.position.y-(this.pivot.x*e.b+this.pivot.y*e.d),this._currentLocalID=this._localID,this._parentID=-1)},r.prototype.updateTransform=function(e){var t=this.localTransform;if(this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==e._worldID){var i=e.worldTransform,n=this.worldTransform;n.a=t.a*i.a+t.b*i.c,n.b=t.a*i.b+t.b*i.d,n.c=t.c*i.a+t.d*i.c,n.d=t.c*i.b+t.d*i.d,n.tx=t.tx*i.a+t.ty*i.c+i.tx,n.ty=t.tx*i.b+t.ty*i.d+i.ty,this._parentID=e._worldID,this._worldID++}},r.prototype.setFromMatrix=function(e){e.decompose(this),this._localID++},Object.defineProperty(r.prototype,"rotation",{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,this.updateSkew())},enumerable:!1,configurable:!0}),r.IDENTITY=new r,r}();const _i=new q;class Of{constructor(e={}){this._recursive=typeof e.recursive=="boolean"?e.recursive:!0,this._toggle=e.toggle||"visible",this._targetList=new Set}add(e){return this._targetList.add(e),this}addAll(e){for(let t=0,i=e.length;t<i;t++)this._targetList.add(e[t]);return this}remove(e){return this._targetList.delete(e),this}removeAll(e){for(let t=0,i=e.length;t<i;t++)this._targetList.delete(e[t]);return this}clear(){return this._targetList.clear(),this}cull(e,t=!1){return t||this.uncull(),this._targetList.forEach(i=>{t||i.getBounds(!1,_i),this._recursive?this.cullRecursive(e,i,t):(t&&i._bounds.getRectangle(e),i[this._toggle]=_i.right>e.left&&_i.left<e.right&&_i.bottom>e.top&&_i.top<e.bottom)}),this}uncull(){return this._targetList.forEach(e=>{this._recursive?this.uncullRecursive(e):e[this._toggle]=!1}),this}cullRecursive(e,t,i){const n=i?t._bounds.getRectangle(_i):t.getBounds(!0,_i);if(t[this._toggle]=n.right>e.left&&n.left<e.right&&n.bottom>e.top&&n.top<e.bottom,!(n.left>=e.left&&n.top>=e.top&&n.right<=e.right&&n.bottom<=e.bottom)&&t[this._toggle]&&t.children&&t.children.length){const a=t.children;for(let o=0,h=a.length;o<h;o++)this.cullRecursive(e,a[o])}}uncullRecursive(e){if(e[this._toggle]=!0,e.children&&e.children.length){const t=e.children;for(let i=0,n=t.length;i<n;i++)this.uncullRecursive(t[i])}}}const{abs:Lx,atan2:Bx,cos:Ux,max:Af,min:Co,sin:Gx,tan:kx,sqrt:Xx,pow:Hx,floor:Wx,ceil:Vx,random:zx,round:If}=Math;function Mf(r){return r.toLocaleTimeString()}function Df(r){const e=navigator.language;return new Intl.DateTimeFormat(e,{timeStyle:"short"}).format(r)}function Ff(r){const e=navigator.language;return new Intl.DateTimeFormat(e,{dateStyle:"short"}).format(r)}function Nf(r,e){let t,i;r.forEach(s=>{(t===void 0||t>s.start||isNaN(s.start.getDate()))&&(t=s.start),s.end!==null&&(i===void 0||i<s.end||isNaN(s.end.getDate()))&&(i=s.end)}),t=t??new Date,i=i??new Date(t.getTime()+(e??0));const n=i.getTime()-t.getTime();return{min:t,max:i,span:e&&n<e?e:n}}function Lf(r){return new Date(r.getFullYear(),r.getMonth(),r.getDate())}function Bf(r){return new Date(r.getFullYear(),r.getMonth(),r.getDate(),Math.floor(r.getHours()/2)*2)}const K={second:1e3,minute:1e3*60,hour:1e3*60*60,day:1e3*60*60*24,week:1e3*60*60*24*7},Ot={seconds:"seconds",minutes:"minutes",date:"date"},Oo=[{ceiling:K.second*4,span:K.second,labelFormat:Ot.seconds},{ceiling:K.second*8,span:K.second*5,labelFormat:Ot.seconds},{ceiling:K.second*13,span:K.second*10,labelFormat:Ot.seconds},{ceiling:K.second*20,span:K.second*15,labelFormat:Ot.seconds},{ceiling:K.second*45,span:K.second*30,labelFormat:Ot.seconds},{ceiling:K.minute*4,span:K.minute,labelFormat:Ot.minutes},{ceiling:K.minute*8,span:K.minute*5,labelFormat:Ot.minutes},{ceiling:K.minute*13,span:K.minute*10,labelFormat:Ot.minutes},{ceiling:K.minute*28,span:K.minute*15,labelFormat:Ot.minutes},{ceiling:K.hour*1.24,span:K.minute*30,labelFormat:Ot.minutes},{ceiling:K.hour*3,span:K.hour,labelFormat:Ot.minutes},{ceiling:K.hour*8,span:K.hour*2,labelFormat:Ot.minutes},{ceiling:K.hour*13,span:K.hour*6,labelFormat:Ot.minutes},{ceiling:K.hour*22,span:K.hour*12,labelFormat:Ot.minutes},{ceiling:K.day*4,span:K.day,labelFormat:Ot.date},{ceiling:K.week*2,span:K.week,labelFormat:Ot.date},{ceiling:1/0,span:K.week*4,labelFormat:Ot.date}];function Uf(r){return{colorTextDefault:qe((r==null?void 0:r.colorTextDefault)??"#374151"),colorTextInverse:qe((r==null?void 0:r.colorTextInverse)??"#f8fafc"),colorTextSubdued:qe((r==null?void 0:r.colorTextSubdued)??"#6b7280"),colorEdge:qe((r==null?void 0:r.colorEdge)??"#374151"),colorNodeSelection:qe((r==null?void 0:r.colorNodeSelection)??"#024DFD"),colorGuideLine:qe((r==null?void 0:r.colorGuideLine)??"#cbd5e1"),colorPlayheadBg:qe((r==null?void 0:r.colorPlayheadBg)??"#4e82fe"),textFontFamilyDefault:(r==null?void 0:r.textFontFamilyDefault)??"InterVariable",textSizeDefault:Dt((r==null?void 0:r.textSizeDefault)??"14px"),textSizeSmall:Dt((r==null?void 0:r.textSizeSmall)??"12px"),textLineHeightDefault:Dt((r==null?void 0:r.textLineHeightDefault)??"20px"),textLineHeightSmall:Dt((r==null?void 0:r.textLineHeightSmall)??"16px"),spacingViewportPaddingDefault:Dt((r==null?void 0:r.spacingViewportPaddingDefault)??"40px"),spacingNodeXPadding:Dt((r==null?void 0:r.spacingNodeXPadding)??"8px"),spacingNodeYPadding:Dt((r==null?void 0:r.spacingNodeYPadding)??"8px"),spacingNodeMargin:Dt((r==null?void 0:r.spacingNodeMargin)??"24px"),spacingNodeLabelMargin:Dt((r==null?void 0:r.spacingNodeLabelMargin)??"20px"),spacingMinimumNodeEdgeGap:Dt((r==null?void 0:r.spacingMinimumNodeEdgeGap)??"16px"),spacingNodeEdgeLength:Dt((r==null?void 0:r.spacingNodeEdgeLength)??"8px"),spacingNodeSelectionMargin:Dt((r==null?void 0:r.spacingNodeSelectionMargin)??"2px"),spacingNodeSelectionWidth:Dt((r==null?void 0:r.spacingNodeSelectionWidth)??"4px"),spacingEdgeWidth:Dt((r==null?void 0:r.spacingEdgeWidth)??"2px"),spacingGuideLabelPadding:Dt((r==null?void 0:r.spacingGuideLabelPadding)??"4px"),spacingPlayheadGlowPadding:Dt((r==null?void 0:r.spacingPlayheadGlowPadding)??"8px"),spacingPlayheadWidth:Dt((r==null?void 0:r.spacingPlayheadWidth)??"2px"),borderRadiusNode:Dt((r==null?void 0:r.borderRadiusNode)??"8px"),alphaNodeDimmed:(r==null?void 0:r.alphaNodeDimmed)??.2}}function qe(r){const e=r.trim();if(e.startsWith("rgb")){const[t,i,n]=e.replace(/[^\d,]/g,"").split(",").map(s=>parseInt(s,10));return Gf([t,i,n])}if(e.startsWith("hsl")){const[t,i,n]=e.replace(/[^\d,.%]/g,"").split(",").map(a=>parseInt(a,10));return Ao(kf(t,i,n))}return Ao(e)}function Gf(r){return parseInt((1<<24|r[0]<<16|r[1]<<8|r[2]).toString(16).slice(1),16)}function kf(r,e,t){t/=100;const i=e*Co(t,1-t)/100,n=s=>{const a=(s+r/30)%12,o=t-i*Af(Co(a-3,9-a,1),-1);return If(255*o).toString(16).padStart(2,"0")};return`#${n(0)}${n(8)}${n(4)}`}function Ao(r){if(typeof r=="string"&&(r.startsWith("#")&&(r=r.slice(1)),r.length===3)){const[e,t,i]=r;r=e+e+t+t+i+i}return parseInt(r,16)}function Dt(r){return typeof r!="string"?(Io(r),0):r.endsWith("em")||r.endsWith("rem")?Xf(r):r.endsWith("px")?parseFloat(r):(Io(r),0)}function Io(r){console.error(`
2
2
  FlowRunTimeline failed to parse spacing style: ${r}.
3
3
  Make sure to use 'rem', 'em', or 'px' values.
4
4
  Defaulting to zero.
5
- `)}function kf(r){const e=getComputedStyle(document.documentElement).fontSize;return parseFloat(r)*parseFloat(e)}const Io={timeBySeconds:If,timeByMinutes:Mf,date:Df},Mo=()=>({fill:"black",inverseTextOnFill:!0});var cs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Do={exports:{}};(function(r){(function(){function e(p,_){document.addEventListener?p.addEventListener("scroll",_,!1):p.attachEvent("scroll",_)}function t(p){document.body?p():document.addEventListener?document.addEventListener("DOMContentLoaded",function _(){document.removeEventListener("DOMContentLoaded",_),p()}):document.attachEvent("onreadystatechange",function _(){(document.readyState=="interactive"||document.readyState=="complete")&&(document.detachEvent("onreadystatechange",_),p())})}function i(p){this.g=document.createElement("div"),this.g.setAttribute("aria-hidden","true"),this.g.appendChild(document.createTextNode(p)),this.h=document.createElement("span"),this.i=document.createElement("span"),this.m=document.createElement("span"),this.j=document.createElement("span"),this.l=-1,this.h.style.cssText="max-width:none;display:inline-block;position:absolute;height:100%;width:100%;overflow:scroll;font-size:16px;",this.i.style.cssText="max-width:none;display:inline-block;position:absolute;height:100%;width:100%;overflow:scroll;font-size:16px;",this.j.style.cssText="max-width:none;display:inline-block;position:absolute;height:100%;width:100%;overflow:scroll;font-size:16px;",this.m.style.cssText="display:inline-block;width:200%;height:200%;font-size:16px;max-width:none;",this.h.appendChild(this.m),this.i.appendChild(this.j),this.g.appendChild(this.h),this.g.appendChild(this.i)}function n(p,_){p.g.style.cssText="max-width:none;min-width:20px;min-height:20px;display:inline-block;overflow:hidden;position:absolute;width:auto;margin:0;padding:0;top:-999px;white-space:nowrap;font-synthesis:none;font:"+_+";"}function s(p){var _=p.g.offsetWidth,m=_+100;return p.j.style.width=m+"px",p.i.scrollLeft=m,p.h.scrollLeft=p.h.scrollWidth+100,p.l!==_?(p.l=_,!0):!1}function a(p,_){function m(){var y=g;s(y)&&y.g.parentNode!==null&&_(y.l)}var g=p;e(p.h,m),e(p.i,m),s(p)}function o(p,_,m){_=_||{},m=m||window,this.family=p,this.style=_.style||"normal",this.weight=_.weight||"normal",this.stretch=_.stretch||"normal",this.context=m}var h=null,u=null,l=null,f=null;function c(p){return u===null&&(d(p)&&/Apple/.test(window.navigator.vendor)?(p=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))(?:\.([0-9]+))/.exec(window.navigator.userAgent),u=!!p&&603>parseInt(p[1],10)):u=!1),u}function d(p){return f===null&&(f=!!p.document.fonts),f}function v(p,_){var m=p.style,g=p.weight;if(l===null){var y=document.createElement("div");try{y.style.font="condensed 100px sans-serif"}catch{}l=y.style.font!==""}return[m,g,l?p.stretch:"","100px",_].join(" ")}o.prototype.load=function(p,_){var m=this,g=p||"BESbswy",y=0,b=_||3e3,x=new Date().getTime();return new Promise(function(T,w){if(d(m.context)&&!c(m.context)){var S=new Promise(function(P,O){function D(){new Date().getTime()-x>=b?O(Error(""+b+"ms timeout exceeded")):m.context.document.fonts.load(v(m,'"'+m.family+'"'),g).then(function(N){1<=N.length?P():setTimeout(D,25)},O)}D()}),E=new Promise(function(P,O){y=setTimeout(function(){O(Error(""+b+"ms timeout exceeded"))},b)});Promise.race([E,S]).then(function(){clearTimeout(y),T(m)},w)}else t(function(){function P(){var G;(G=A!=-1&&R!=-1||A!=-1&&F!=-1||R!=-1&&F!=-1)&&((G=A!=R&&A!=F&&R!=F)||(h===null&&(G=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))/.exec(window.navigator.userAgent),h=!!G&&(536>parseInt(G[1],10)||parseInt(G[1],10)===536&&11>=parseInt(G[2],10))),G=h&&(A==V&&R==V&&F==V||A==H&&R==H&&F==H||A==I&&R==I&&F==I)),G=!G),G&&(C.parentNode!==null&&C.parentNode.removeChild(C),clearTimeout(y),T(m))}function O(){if(new Date().getTime()-x>=b)C.parentNode!==null&&C.parentNode.removeChild(C),w(Error(""+b+"ms timeout exceeded"));else{var G=m.context.document.hidden;(G===!0||G===void 0)&&(A=D.g.offsetWidth,R=N.g.offsetWidth,F=U.g.offsetWidth,P()),y=setTimeout(O,50)}}var D=new i(g),N=new i(g),U=new i(g),A=-1,R=-1,F=-1,V=-1,H=-1,I=-1,C=document.createElement("div");C.dir="ltr",n(D,v(m,"sans-serif")),n(N,v(m,"serif")),n(U,v(m,"monospace")),C.appendChild(D.g),C.appendChild(N.g),C.appendChild(U.g),m.context.document.body.appendChild(C),V=D.g.offsetWidth,H=N.g.offsetWidth,I=U.g.offsetWidth,O(),a(D,function(G){A=G,P()}),n(D,v(m,'"'+m.family+'",sans-serif')),a(N,function(G){R=G,P()}),n(N,v(m,'"'+m.family+'",serif')),a(U,function(G){F=G,P()}),n(U,v(m,'"'+m.family+'",monospace'))})})},r.exports=o})()})(Do);const Xf=Do.exports;function Hf(r){var e=this.constructor;return this.then(function(t){return e.resolve(r()).then(function(){return t})},function(t){return e.resolve(r()).then(function(){return e.reject(t)})})}function Wf(r){var e=this;return new e(function(t,i){if(!(r&&typeof r.length<"u"))return i(new TypeError(typeof r+" "+r+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var n=Array.prototype.slice.call(r);if(n.length===0)return t([]);var s=n.length;function a(h,u){if(u&&(typeof u=="object"||typeof u=="function")){var l=u.then;if(typeof l=="function"){l.call(u,function(f){a(h,f)},function(f){n[h]={status:"rejected",reason:f},--s===0&&t(n)});return}}n[h]={status:"fulfilled",value:u},--s===0&&t(n)}for(var o=0;o<n.length;o++)a(o,n[o])})}var zf=setTimeout;function Fo(r){return Boolean(r&&typeof r.length<"u")}function Vf(){}function Yf(r,e){return function(){r.apply(e,arguments)}}function mt(r){if(!(this instanceof mt))throw new TypeError("Promises must be constructed via new");if(typeof r!="function")throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],Lo(r,this)}function No(r,e){for(;r._state===3;)r=r._value;if(r._state===0){r._deferreds.push(e);return}r._handled=!0,mt._immediateFn(function(){var t=r._state===1?e.onFulfilled:e.onRejected;if(t===null){(r._state===1?ds:cr)(e.promise,r._value);return}var i;try{i=t(r._value)}catch(n){cr(e.promise,n);return}ds(e.promise,i)})}function ds(r,e){try{if(e===r)throw new TypeError("A promise cannot be resolved with itself.");if(e&&(typeof e=="object"||typeof e=="function")){var t=e.then;if(e instanceof mt){r._state=3,r._value=e,ps(r);return}else if(typeof t=="function"){Lo(Yf(t,e),r);return}}r._state=1,r._value=e,ps(r)}catch(i){cr(r,i)}}function cr(r,e){r._state=2,r._value=e,ps(r)}function ps(r){r._state===2&&r._deferreds.length===0&&mt._immediateFn(function(){r._handled||mt._unhandledRejectionFn(r._value)});for(var e=0,t=r._deferreds.length;e<t;e++)No(r,r._deferreds[e]);r._deferreds=null}function jf(r,e,t){this.onFulfilled=typeof r=="function"?r:null,this.onRejected=typeof e=="function"?e:null,this.promise=t}function Lo(r,e){var t=!1;try{r(function(i){t||(t=!0,ds(e,i))},function(i){t||(t=!0,cr(e,i))})}catch(i){if(t)return;t=!0,cr(e,i)}}mt.prototype.catch=function(r){return this.then(null,r)},mt.prototype.then=function(r,e){var t=new this.constructor(Vf);return No(this,new jf(r,e,t)),t},mt.prototype.finally=Hf,mt.all=function(r){return new mt(function(e,t){if(!Fo(r))return t(new TypeError("Promise.all accepts an array"));var i=Array.prototype.slice.call(r);if(i.length===0)return e([]);var n=i.length;function s(o,h){try{if(h&&(typeof h=="object"||typeof h=="function")){var u=h.then;if(typeof u=="function"){u.call(h,function(l){s(o,l)},t);return}}i[o]=h,--n===0&&e(i)}catch(l){t(l)}}for(var a=0;a<i.length;a++)s(a,i[a])})},mt.allSettled=Wf,mt.resolve=function(r){return r&&typeof r=="object"&&r.constructor===mt?r:new mt(function(e){e(r)})},mt.reject=function(r){return new mt(function(e,t){t(r)})},mt.race=function(r){return new mt(function(e,t){if(!Fo(r))return t(new TypeError("Promise.race accepts an array"));for(var i=0,n=r.length;i<n;i++)mt.resolve(r[i]).then(e,t)})},mt._immediateFn=typeof setImmediate=="function"&&function(r){setImmediate(r)}||function(r){zf(r,0)},mt._unhandledRejectionFn=function(e){typeof console<"u"&&console&&console.warn("Possible Unhandled Promise Rejection:",e)};var Bo=Object.getOwnPropertySymbols,Zf=Object.prototype.hasOwnProperty,qf=Object.prototype.propertyIsEnumerable;function Kf(r){if(r==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(r)}function $f(){try{if(!Object.assign)return!1;var r=new String("abc");if(r[5]="de",Object.getOwnPropertyNames(r)[0]==="5")return!1;for(var e={},t=0;t<10;t++)e["_"+String.fromCharCode(t)]=t;var i=Object.getOwnPropertyNames(e).map(function(s){return e[s]});if(i.join("")!=="0123456789")return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(s){n[s]=s}),Object.keys(Object.assign({},n)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}var Jf=$f()?Object.assign:function(r,e){for(var t,i=Kf(r),n,s=1;s<arguments.length;s++){t=Object(arguments[s]);for(var a in t)Zf.call(t,a)&&(i[a]=t[a]);if(Bo){n=Bo(t);for(var o=0;o<n.length;o++)qf.call(t,n[o])&&(i[n[o]]=t[n[o]])}}return i};typeof globalThis>"u"&&(typeof self<"u"?self.globalThis=self:typeof global<"u"&&(global.globalThis=global)),globalThis.Promise||(globalThis.Promise=mt),Object.assign||(Object.assign=Jf);var Qf=16;if(Date.now&&Date.prototype.getTime||(Date.now=function(){return new Date().getTime()}),!(globalThis.performance&&globalThis.performance.now)){var tc=Date.now();globalThis.performance||(globalThis.performance={}),globalThis.performance.now=function(){return Date.now()-tc}}for(var vs=Date.now(),Go=["ms","moz","webkit","o"],_s=0;_s<Go.length&&!globalThis.requestAnimationFrame;++_s){var ms=Go[_s];globalThis.requestAnimationFrame=globalThis[ms+"RequestAnimationFrame"],globalThis.cancelAnimationFrame=globalThis[ms+"CancelAnimationFrame"]||globalThis[ms+"CancelRequestAnimationFrame"]}globalThis.requestAnimationFrame||(globalThis.requestAnimationFrame=function(r){if(typeof r!="function")throw new TypeError(r+"is not a function");var e=Date.now(),t=Qf+vs-e;return t<0&&(t=0),vs=e,globalThis.self.setTimeout(function(){vs=Date.now(),r(performance.now())},t)}),globalThis.cancelAnimationFrame||(globalThis.cancelAnimationFrame=function(r){return clearTimeout(r)}),Math.sign||(Math.sign=function(e){return e=Number(e),e===0||isNaN(e)?e:e>0?1:-1}),Number.isInteger||(Number.isInteger=function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e}),globalThis.ArrayBuffer||(globalThis.ArrayBuffer=Array),globalThis.Float32Array||(globalThis.Float32Array=Array),globalThis.Uint32Array||(globalThis.Uint32Array=Array),globalThis.Uint16Array||(globalThis.Uint16Array=Array),globalThis.Uint8Array||(globalThis.Uint8Array=Array),globalThis.Int32Array||(globalThis.Int32Array=Array);var Le;(function(r){r[r.WEBGL_LEGACY=0]="WEBGL_LEGACY",r[r.WEBGL=1]="WEBGL",r[r.WEBGL2=2]="WEBGL2"})(Le||(Le={}));var dr;(function(r){r[r.UNKNOWN=0]="UNKNOWN",r[r.WEBGL=1]="WEBGL",r[r.CANVAS=2]="CANVAS"})(dr||(dr={}));var tn;(function(r){r[r.COLOR=16384]="COLOR",r[r.DEPTH=256]="DEPTH",r[r.STENCIL=1024]="STENCIL"})(tn||(tn={}));var X;(function(r){r[r.NORMAL=0]="NORMAL",r[r.ADD=1]="ADD",r[r.MULTIPLY=2]="MULTIPLY",r[r.SCREEN=3]="SCREEN",r[r.OVERLAY=4]="OVERLAY",r[r.DARKEN=5]="DARKEN",r[r.LIGHTEN=6]="LIGHTEN",r[r.COLOR_DODGE=7]="COLOR_DODGE",r[r.COLOR_BURN=8]="COLOR_BURN",r[r.HARD_LIGHT=9]="HARD_LIGHT",r[r.SOFT_LIGHT=10]="SOFT_LIGHT",r[r.DIFFERENCE=11]="DIFFERENCE",r[r.EXCLUSION=12]="EXCLUSION",r[r.HUE=13]="HUE",r[r.SATURATION=14]="SATURATION",r[r.COLOR=15]="COLOR",r[r.LUMINOSITY=16]="LUMINOSITY",r[r.NORMAL_NPM=17]="NORMAL_NPM",r[r.ADD_NPM=18]="ADD_NPM",r[r.SCREEN_NPM=19]="SCREEN_NPM",r[r.NONE=20]="NONE",r[r.SRC_OVER=0]="SRC_OVER",r[r.SRC_IN=21]="SRC_IN",r[r.SRC_OUT=22]="SRC_OUT",r[r.SRC_ATOP=23]="SRC_ATOP",r[r.DST_OVER=24]="DST_OVER",r[r.DST_IN=25]="DST_IN",r[r.DST_OUT=26]="DST_OUT",r[r.DST_ATOP=27]="DST_ATOP",r[r.ERASE=26]="ERASE",r[r.SUBTRACT=28]="SUBTRACT",r[r.XOR=29]="XOR"})(X||(X={}));var de;(function(r){r[r.POINTS=0]="POINTS",r[r.LINES=1]="LINES",r[r.LINE_LOOP=2]="LINE_LOOP",r[r.LINE_STRIP=3]="LINE_STRIP",r[r.TRIANGLES=4]="TRIANGLES",r[r.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",r[r.TRIANGLE_FAN=6]="TRIANGLE_FAN"})(de||(de={}));var M;(function(r){r[r.RGBA=6408]="RGBA",r[r.RGB=6407]="RGB",r[r.RG=33319]="RG",r[r.RED=6403]="RED",r[r.RGBA_INTEGER=36249]="RGBA_INTEGER",r[r.RGB_INTEGER=36248]="RGB_INTEGER",r[r.RG_INTEGER=33320]="RG_INTEGER",r[r.RED_INTEGER=36244]="RED_INTEGER",r[r.ALPHA=6406]="ALPHA",r[r.LUMINANCE=6409]="LUMINANCE",r[r.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",r[r.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",r[r.DEPTH_STENCIL=34041]="DEPTH_STENCIL"})(M||(M={}));var mi;(function(r){r[r.TEXTURE_2D=3553]="TEXTURE_2D",r[r.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",r[r.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",r[r.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",r[r.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",r[r.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",r[r.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",r[r.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",r[r.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z"})(mi||(mi={}));var k;(function(r){r[r.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",r[r.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",r[r.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",r[r.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",r[r.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",r[r.UNSIGNED_INT=5125]="UNSIGNED_INT",r[r.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",r[r.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",r[r.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",r[r.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",r[r.BYTE=5120]="BYTE",r[r.SHORT=5122]="SHORT",r[r.INT=5124]="INT",r[r.FLOAT=5126]="FLOAT",r[r.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",r[r.HALF_FLOAT=36193]="HALF_FLOAT"})(k||(k={}));var en;(function(r){r[r.FLOAT=0]="FLOAT",r[r.INT=1]="INT",r[r.UINT=2]="UINT"})(en||(en={}));var Pe;(function(r){r[r.NEAREST=0]="NEAREST",r[r.LINEAR=1]="LINEAR"})(Pe||(Pe={}));var Re;(function(r){r[r.CLAMP=33071]="CLAMP",r[r.REPEAT=10497]="REPEAT",r[r.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"})(Re||(Re={}));var pe;(function(r){r[r.OFF=0]="OFF",r[r.POW2=1]="POW2",r[r.ON=2]="ON",r[r.ON_MANUAL=3]="ON_MANUAL"})(pe||(pe={}));var ve;(function(r){r[r.NPM=0]="NPM",r[r.UNPACK=1]="UNPACK",r[r.PMA=2]="PMA",r[r.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",r[r.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",r[r.PREMULTIPLY_ALPHA=2]="PREMULTIPLY_ALPHA",r[r.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA"})(ve||(ve={}));var _e;(function(r){r[r.NO=0]="NO",r[r.YES=1]="YES",r[r.AUTO=2]="AUTO",r[r.BLEND=0]="BLEND",r[r.CLEAR=1]="CLEAR",r[r.BLIT=2]="BLIT"})(_e||(_e={}));var rn;(function(r){r[r.AUTO=0]="AUTO",r[r.MANUAL=1]="MANUAL"})(rn||(rn={}));var Kt;(function(r){r.LOW="lowp",r.MEDIUM="mediump",r.HIGH="highp"})(Kt||(Kt={}));var Pt;(function(r){r[r.NONE=0]="NONE",r[r.SCISSOR=1]="SCISSOR",r[r.STENCIL=2]="STENCIL",r[r.SPRITE=3]="SPRITE",r[r.COLOR=4]="COLOR"})(Pt||(Pt={}));var Uo;(function(r){r[r.RED=1]="RED",r[r.GREEN=2]="GREEN",r[r.BLUE=4]="BLUE",r[r.ALPHA=8]="ALPHA"})(Uo||(Uo={}));var gt;(function(r){r[r.NONE=0]="NONE",r[r.LOW=2]="LOW",r[r.MEDIUM=4]="MEDIUM",r[r.HIGH=8]="HIGH"})(gt||(gt={}));var Ce;(function(r){r[r.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",r[r.ARRAY_BUFFER=34962]="ARRAY_BUFFER",r[r.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER"})(Ce||(Ce={}));var ec={createCanvas:function(r,e){var t=document.createElement("canvas");return t.width=r,t.height=e,t},getWebGLRenderingContext:function(){return WebGLRenderingContext},getNavigator:function(){return navigator},getBaseUrl:function(){var r;return(r=document.baseURI)!==null&&r!==void 0?r:window.location.href},fetch:function(r,e){return fetch(r,e)}},gs=/iPhone/i,ko=/iPod/i,Xo=/iPad/i,Ho=/\biOS-universal(?:.+)Mac\b/i,ys=/\bAndroid(?:.+)Mobile\b/i,Wo=/Android/i,Ui=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,nn=/Silk/i,Be=/Windows Phone/i,zo=/\bWindows(?:.+)ARM\b/i,Vo=/BlackBerry/i,Yo=/BB10/i,jo=/Opera Mini/i,Zo=/\b(CriOS|Chrome)(?:.+)Mobile/i,qo=/Mobile(?:.+)Firefox\b/i,Ko=function(r){return typeof r<"u"&&r.platform==="MacIntel"&&typeof r.maxTouchPoints=="number"&&r.maxTouchPoints>1&&typeof MSStream>"u"};function ic(r){return function(e){return e.test(r)}}function rc(r){var e={userAgent:"",platform:"",maxTouchPoints:0};!r&&typeof navigator<"u"?e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof r=="string"?e.userAgent=r:r&&r.userAgent&&(e={userAgent:r.userAgent,platform:r.platform,maxTouchPoints:r.maxTouchPoints||0});var t=e.userAgent,i=t.split("[FBAN");typeof i[1]<"u"&&(t=i[0]),i=t.split("Twitter"),typeof i[1]<"u"&&(t=i[0]);var n=ic(t),s={apple:{phone:n(gs)&&!n(Be),ipod:n(ko),tablet:!n(gs)&&(n(Xo)||Ko(e))&&!n(Be),universal:n(Ho),device:(n(gs)||n(ko)||n(Xo)||n(Ho)||Ko(e))&&!n(Be)},amazon:{phone:n(Ui),tablet:!n(Ui)&&n(nn),device:n(Ui)||n(nn)},android:{phone:!n(Be)&&n(Ui)||!n(Be)&&n(ys),tablet:!n(Be)&&!n(Ui)&&!n(ys)&&(n(nn)||n(Wo)),device:!n(Be)&&(n(Ui)||n(nn)||n(ys)||n(Wo))||n(/\bokhttp\b/i)},windows:{phone:n(Be),tablet:n(zo),device:n(Be)||n(zo)},other:{blackberry:n(Vo),blackberry10:n(Yo),opera:n(jo),firefox:n(qo),chrome:n(Zo),device:n(Vo)||n(Yo)||n(jo)||n(qo)||n(Zo)},any:!1,phone:!1,tablet:!1};return s.any=s.apple.device||s.android.device||s.windows.device||s.other.device,s.phone=s.apple.phone||s.android.phone||s.windows.phone,s.tablet=s.apple.tablet||s.android.tablet||s.windows.tablet,s}var Oe=rc(globalThis.navigator);function nc(){return!Oe.apple.device}function sc(r){var e=!0;if(Oe.tablet||Oe.phone){if(Oe.apple.device){var t=navigator.userAgent.match(/OS (\d+)_(\d+)?/);if(t){var i=parseInt(t[1],10);i<11&&(e=!1)}}if(Oe.android.device){var t=navigator.userAgent.match(/Android\s([0-9.]*)/);if(t){var i=parseInt(t[1],10);i<7&&(e=!1)}}}return e?r:4}var L={ADAPTER:ec,MIPMAP_TEXTURES:pe.POW2,ANISOTROPIC_LEVEL:0,RESOLUTION:1,FILTER_RESOLUTION:1,FILTER_MULTISAMPLE:gt.NONE,SPRITE_MAX_TEXTURES:sc(32),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,antialias:!1,autoDensity:!1,backgroundColor:0,backgroundAlpha:1,useContextAlpha:!0,clearBeforeRender:!0,preserveDrawingBuffer:!1,width:800,height:600,legacy:!1},GC_MODE:rn.AUTO,GC_MAX_IDLE:60*60,GC_MAX_CHECK_COUNT:60*10,WRAP_MODE:Re.CLAMP,SCALE_MODE:Pe.LINEAR,PRECISION_VERTEX:Kt.HIGH,PRECISION_FRAGMENT:Oe.apple.device?Kt.HIGH:Kt.MEDIUM,CAN_UPLOAD_SAME_BUFFER:nc(),CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1},$o={exports:{}};(function(r){var e=Object.prototype.hasOwnProperty,t="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(t=!1));function n(h,u,l){this.fn=h,this.context=u,this.once=l||!1}function s(h,u,l,f,c){if(typeof l!="function")throw new TypeError("The listener must be a function");var d=new n(l,f||h,c),v=t?t+u:u;return h._events[v]?h._events[v].fn?h._events[v]=[h._events[v],d]:h._events[v].push(d):(h._events[v]=d,h._eventsCount++),h}function a(h,u){--h._eventsCount===0?h._events=new i:delete h._events[u]}function o(){this._events=new i,this._eventsCount=0}o.prototype.eventNames=function(){var u=[],l,f;if(this._eventsCount===0)return u;for(f in l=this._events)e.call(l,f)&&u.push(t?f.slice(1):f);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(l)):u},o.prototype.listeners=function(u){var l=t?t+u:u,f=this._events[l];if(!f)return[];if(f.fn)return[f.fn];for(var c=0,d=f.length,v=new Array(d);c<d;c++)v[c]=f[c].fn;return v},o.prototype.listenerCount=function(u){var l=t?t+u:u,f=this._events[l];return f?f.fn?1:f.length:0},o.prototype.emit=function(u,l,f,c,d,v){var p=t?t+u:u;if(!this._events[p])return!1;var _=this._events[p],m=arguments.length,g,y;if(_.fn){switch(_.once&&this.removeListener(u,_.fn,void 0,!0),m){case 1:return _.fn.call(_.context),!0;case 2:return _.fn.call(_.context,l),!0;case 3:return _.fn.call(_.context,l,f),!0;case 4:return _.fn.call(_.context,l,f,c),!0;case 5:return _.fn.call(_.context,l,f,c,d),!0;case 6:return _.fn.call(_.context,l,f,c,d,v),!0}for(y=1,g=new Array(m-1);y<m;y++)g[y-1]=arguments[y];_.fn.apply(_.context,g)}else{var b=_.length,x;for(y=0;y<b;y++)switch(_[y].once&&this.removeListener(u,_[y].fn,void 0,!0),m){case 1:_[y].fn.call(_[y].context);break;case 2:_[y].fn.call(_[y].context,l);break;case 3:_[y].fn.call(_[y].context,l,f);break;case 4:_[y].fn.call(_[y].context,l,f,c);break;default:if(!g)for(x=1,g=new Array(m-1);x<m;x++)g[x-1]=arguments[x];_[y].fn.apply(_[y].context,g)}}return!0},o.prototype.on=function(u,l,f){return s(this,u,l,f,!1)},o.prototype.once=function(u,l,f){return s(this,u,l,f,!0)},o.prototype.removeListener=function(u,l,f,c){var d=t?t+u:u;if(!this._events[d])return this;if(!l)return a(this,d),this;var v=this._events[d];if(v.fn)v.fn===l&&(!c||v.once)&&(!f||v.context===f)&&a(this,d);else{for(var p=0,_=[],m=v.length;p<m;p++)(v[p].fn!==l||c&&!v[p].once||f&&v[p].context!==f)&&_.push(v[p]);_.length?this._events[d]=_.length===1?_[0]:_:a(this,d)}return this},o.prototype.removeAllListeners=function(u){var l;return u?(l=t?t+u:u,this._events[l]&&a(this,l)):(this._events=new i,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=t,o.EventEmitter=o,r.exports=o})($o);const pr=$o.exports;var sn={exports:{}};sn.exports=an,sn.exports.default=an;function an(r,e,t){t=t||2;var i=e&&e.length,n=i?e[0]*t:r.length,s=Jo(r,0,n,t,!0),a=[];if(!s||s.next===s.prev)return a;var o,h,u,l,f,c,d;if(i&&(s=lc(r,e,s,t)),r.length>80*t){o=u=r[0],h=l=r[1];for(var v=t;v<n;v+=t)f=r[v],c=r[v+1],f<o&&(o=f),c<h&&(h=c),f>u&&(u=f),c>l&&(l=c);d=Math.max(u-o,l-h),d=d!==0?32767/d:0}return vr(s,a,t,o,h,d,0),a}function Jo(r,e,t,i,n){var s,a;if(n===Ts(r,e,t,i)>0)for(s=e;s<t;s+=i)a=eh(s,r[s],r[s+1],a);else for(s=t-i;s>=e;s-=i)a=eh(s,r[s],r[s+1],a);return a&&on(a,a.next)&&(mr(a),a=a.next),a}function gi(r,e){if(!r)return r;e||(e=r);var t=r,i;do if(i=!1,!t.steiner&&(on(t,t.next)||pt(t.prev,t,t.next)===0)){if(mr(t),t=e=t.prev,t===t.next)break;i=!0}else t=t.next;while(i||t!==e);return e}function vr(r,e,t,i,n,s,a){if(r){!a&&s&&vc(r,i,n,s);for(var o=r,h,u;r.prev!==r.next;){if(h=r.prev,u=r.next,s?oc(r,i,n,s):ac(r)){e.push(h.i/t|0),e.push(r.i/t|0),e.push(u.i/t|0),mr(r),r=u.next,o=u.next;continue}if(r=u,r===o){a?a===1?(r=hc(gi(r),e,t),vr(r,e,t,i,n,s,2)):a===2&&uc(r,e,t,i,n,s):vr(gi(r),e,t,i,n,s,1);break}}}}function ac(r){var e=r.prev,t=r,i=r.next;if(pt(e,t,i)>=0)return!1;for(var n=e.x,s=t.x,a=i.x,o=e.y,h=t.y,u=i.y,l=n<s?n<a?n:a:s<a?s:a,f=o<h?o<u?o:u:h<u?h:u,c=n>s?n>a?n:a:s>a?s:a,d=o>h?o>u?o:u:h>u?h:u,v=i.next;v!==e;){if(v.x>=l&&v.x<=c&&v.y>=f&&v.y<=d&&ki(n,o,s,h,a,u,v.x,v.y)&&pt(v.prev,v,v.next)>=0)return!1;v=v.next}return!0}function oc(r,e,t,i){var n=r.prev,s=r,a=r.next;if(pt(n,s,a)>=0)return!1;for(var o=n.x,h=s.x,u=a.x,l=n.y,f=s.y,c=a.y,d=o<h?o<u?o:u:h<u?h:u,v=l<f?l<c?l:c:f<c?f:c,p=o>h?o>u?o:u:h>u?h:u,_=l>f?l>c?l:c:f>c?f:c,m=xs(d,v,e,t,i),g=xs(p,_,e,t,i),y=r.prevZ,b=r.nextZ;y&&y.z>=m&&b&&b.z<=g;){if(y.x>=d&&y.x<=p&&y.y>=v&&y.y<=_&&y!==n&&y!==a&&ki(o,l,h,f,u,c,y.x,y.y)&&pt(y.prev,y,y.next)>=0||(y=y.prevZ,b.x>=d&&b.x<=p&&b.y>=v&&b.y<=_&&b!==n&&b!==a&&ki(o,l,h,f,u,c,b.x,b.y)&&pt(b.prev,b,b.next)>=0))return!1;b=b.nextZ}for(;y&&y.z>=m;){if(y.x>=d&&y.x<=p&&y.y>=v&&y.y<=_&&y!==n&&y!==a&&ki(o,l,h,f,u,c,y.x,y.y)&&pt(y.prev,y,y.next)>=0)return!1;y=y.prevZ}for(;b&&b.z<=g;){if(b.x>=d&&b.x<=p&&b.y>=v&&b.y<=_&&b!==n&&b!==a&&ki(o,l,h,f,u,c,b.x,b.y)&&pt(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function hc(r,e,t){var i=r;do{var n=i.prev,s=i.next.next;!on(n,s)&&Qo(n,i,i.next,s)&&_r(n,s)&&_r(s,n)&&(e.push(n.i/t|0),e.push(i.i/t|0),e.push(s.i/t|0),mr(i),mr(i.next),i=r=s),i=i.next}while(i!==r);return gi(i)}function uc(r,e,t,i,n,s){var a=r;do{for(var o=a.next.next;o!==a.prev;){if(a.i!==o.i&&gc(a,o)){var h=th(a,o);a=gi(a,a.next),h=gi(h,h.next),vr(a,e,t,i,n,s,0),vr(h,e,t,i,n,s,0);return}o=o.next}a=a.next}while(a!==r)}function lc(r,e,t,i){var n=[],s,a,o,h,u;for(s=0,a=e.length;s<a;s++)o=e[s]*i,h=s<a-1?e[s+1]*i:r.length,u=Jo(r,o,h,i,!1),u===u.next&&(u.steiner=!0),n.push(mc(u));for(n.sort(fc),s=0;s<n.length;s++)t=cc(n[s],t);return t}function fc(r,e){return r.x-e.x}function cc(r,e){var t=dc(r,e);if(!t)return e;var i=th(t,r);return gi(i,i.next),gi(t,t.next)}function dc(r,e){var t=e,i=r.x,n=r.y,s=-1/0,a;do{if(n<=t.y&&n>=t.next.y&&t.next.y!==t.y){var o=t.x+(n-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(o<=i&&o>s&&(s=o,a=t.x<t.next.x?t:t.next,o===i))return a}t=t.next}while(t!==e);if(!a)return null;var h=a,u=a.x,l=a.y,f=1/0,c;t=a;do i>=t.x&&t.x>=u&&i!==t.x&&ki(n<l?i:s,n,u,l,n<l?s:i,n,t.x,t.y)&&(c=Math.abs(n-t.y)/(i-t.x),_r(t,r)&&(c<f||c===f&&(t.x>a.x||t.x===a.x&&pc(a,t)))&&(a=t,f=c)),t=t.next;while(t!==h);return a}function pc(r,e){return pt(r.prev,r,e.prev)<0&&pt(e.next,r,r.next)<0}function vc(r,e,t,i){var n=r;do n.z===0&&(n.z=xs(n.x,n.y,e,t,i)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next;while(n!==r);n.prevZ.nextZ=null,n.prevZ=null,_c(n)}function _c(r){var e,t,i,n,s,a,o,h,u=1;do{for(t=r,r=null,s=null,a=0;t;){for(a++,i=t,o=0,e=0;e<u&&(o++,i=i.nextZ,!!i);e++);for(h=u;o>0||h>0&&i;)o!==0&&(h===0||!i||t.z<=i.z)?(n=t,t=t.nextZ,o--):(n=i,i=i.nextZ,h--),s?s.nextZ=n:r=n,n.prevZ=s,s=n;t=i}s.nextZ=null,u*=2}while(a>1);return r}function xs(r,e,t,i,n){return r=(r-t)*n|0,e=(e-i)*n|0,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,r|e<<1}function mc(r){var e=r,t=r;do(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next;while(e!==r);return t}function ki(r,e,t,i,n,s,a,o){return(n-a)*(e-o)>=(r-a)*(s-o)&&(r-a)*(i-o)>=(t-a)*(e-o)&&(t-a)*(s-o)>=(n-a)*(i-o)}function gc(r,e){return r.next.i!==e.i&&r.prev.i!==e.i&&!yc(r,e)&&(_r(r,e)&&_r(e,r)&&xc(r,e)&&(pt(r.prev,r,e.prev)||pt(r,e.prev,e))||on(r,e)&&pt(r.prev,r,r.next)>0&&pt(e.prev,e,e.next)>0)}function pt(r,e,t){return(e.y-r.y)*(t.x-e.x)-(e.x-r.x)*(t.y-e.y)}function on(r,e){return r.x===e.x&&r.y===e.y}function Qo(r,e,t,i){var n=un(pt(r,e,t)),s=un(pt(r,e,i)),a=un(pt(t,i,r)),o=un(pt(t,i,e));return!!(n!==s&&a!==o||n===0&&hn(r,t,e)||s===0&&hn(r,i,e)||a===0&&hn(t,r,i)||o===0&&hn(t,e,i))}function hn(r,e,t){return e.x<=Math.max(r.x,t.x)&&e.x>=Math.min(r.x,t.x)&&e.y<=Math.max(r.y,t.y)&&e.y>=Math.min(r.y,t.y)}function un(r){return r>0?1:r<0?-1:0}function yc(r,e){var t=r;do{if(t.i!==r.i&&t.next.i!==r.i&&t.i!==e.i&&t.next.i!==e.i&&Qo(t,t.next,r,e))return!0;t=t.next}while(t!==r);return!1}function _r(r,e){return pt(r.prev,r,r.next)<0?pt(r,e,r.next)>=0&&pt(r,r.prev,e)>=0:pt(r,e,r.prev)<0||pt(r,r.next,e)<0}function xc(r,e){var t=r,i=!1,n=(r.x+e.x)/2,s=(r.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&n<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(i=!i),t=t.next;while(t!==r);return i}function th(r,e){var t=new bs(r.i,r.x,r.y),i=new bs(e.i,e.x,e.y),n=r.next,s=e.prev;return r.next=e,e.prev=r,t.next=n,n.prev=t,i.next=t,t.prev=i,s.next=i,i.prev=s,i}function eh(r,e,t,i){var n=new bs(r,e,t);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function mr(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function bs(r,e,t){this.i=r,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}an.deviation=function(r,e,t,i){var n=e&&e.length,s=n?e[0]*t:r.length,a=Math.abs(Ts(r,0,s,t));if(n)for(var o=0,h=e.length;o<h;o++){var u=e[o]*t,l=o<h-1?e[o+1]*t:r.length;a-=Math.abs(Ts(r,u,l,t))}var f=0;for(o=0;o<i.length;o+=3){var c=i[o]*t,d=i[o+1]*t,v=i[o+2]*t;f+=Math.abs((r[c]-r[v])*(r[d+1]-r[c+1])-(r[c]-r[d])*(r[v+1]-r[c+1]))}return a===0&&f===0?0:Math.abs((f-a)/a)};function Ts(r,e,t,i){for(var n=0,s=e,a=t-i;s<t;s+=i)n+=(r[a]-r[s])*(r[s+1]+r[a+1]),a=s;return n}an.flatten=function(r){for(var e=r[0][0].length,t={vertices:[],holes:[],dimensions:e},i=0,n=0;n<r.length;n++){for(var s=0;s<r[n].length;s++)for(var a=0;a<e;a++)t.vertices.push(r[n][s][a]);n>0&&(i+=r[n-1].length,t.holes.push(i))}return t};var ws={exports:{}};(function(r,e){(function(t){var i=e&&!e.nodeType&&e,n=r&&!r.nodeType&&r,s=typeof cs=="object"&&cs;(s.global===s||s.window===s||s.self===s)&&(t=s);var a,o=2147483647,h=36,u=1,l=26,f=38,c=700,d=72,v=128,p="-",_=/^xn--/,m=/[^\x20-\x7E]/,g=/[\x2E\u3002\uFF0E\uFF61]/g,y={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},b=h-u,x=Math.floor,T=String.fromCharCode,w;function S(I){throw RangeError(y[I])}function E(I,C){for(var G=I.length,$=[];G--;)$[G]=C(I[G]);return $}function P(I,C){var G=I.split("@"),$="";G.length>1&&($=G[0]+"@",I=G[1]),I=I.replace(g,".");var Y=I.split("."),rt=E(Y,C).join(".");return $+rt}function O(I){for(var C=[],G=0,$=I.length,Y,rt;G<$;)Y=I.charCodeAt(G++),Y>=55296&&Y<=56319&&G<$?(rt=I.charCodeAt(G++),(rt&64512)==56320?C.push(((Y&1023)<<10)+(rt&1023)+65536):(C.push(Y),G--)):C.push(Y);return C}function D(I){return E(I,function(C){var G="";return C>65535&&(C-=65536,G+=T(C>>>10&1023|55296),C=56320|C&1023),G+=T(C),G}).join("")}function N(I){return I-48<10?I-22:I-65<26?I-65:I-97<26?I-97:h}function U(I,C){return I+22+75*(I<26)-((C!=0)<<5)}function A(I,C,G){var $=0;for(I=G?x(I/c):I>>1,I+=x(I/C);I>b*l>>1;$+=h)I=x(I/b);return x($+(b+1)*I/(I+f))}function R(I){var C=[],G=I.length,$,Y=0,rt=v,lt=d,ft,Lt,Ut,St,st,ut,ct,tt,zt;for(ft=I.lastIndexOf(p),ft<0&&(ft=0),Lt=0;Lt<ft;++Lt)I.charCodeAt(Lt)>=128&&S("not-basic"),C.push(I.charCodeAt(Lt));for(Ut=ft>0?ft+1:0;Ut<G;){for(St=Y,st=1,ut=h;Ut>=G&&S("invalid-input"),ct=N(I.charCodeAt(Ut++)),(ct>=h||ct>x((o-Y)/st))&&S("overflow"),Y+=ct*st,tt=ut<=lt?u:ut>=lt+l?l:ut-lt,!(ct<tt);ut+=h)zt=h-tt,st>x(o/zt)&&S("overflow"),st*=zt;$=C.length+1,lt=A(Y-St,$,St==0),x(Y/$)>o-rt&&S("overflow"),rt+=x(Y/$),Y%=$,C.splice(Y++,0,rt)}return D(C)}function F(I){var C,G,$,Y,rt,lt,ft,Lt,Ut,St,st,ut=[],ct,tt,zt,qt;for(I=O(I),ct=I.length,C=v,G=0,rt=d,lt=0;lt<ct;++lt)st=I[lt],st<128&&ut.push(T(st));for($=Y=ut.length,Y&&ut.push(p);$<ct;){for(ft=o,lt=0;lt<ct;++lt)st=I[lt],st>=C&&st<ft&&(ft=st);for(tt=$+1,ft-C>x((o-G)/tt)&&S("overflow"),G+=(ft-C)*tt,C=ft,lt=0;lt<ct;++lt)if(st=I[lt],st<C&&++G>o&&S("overflow"),st==C){for(Lt=G,Ut=h;St=Ut<=rt?u:Ut>=rt+l?l:Ut-rt,!(Lt<St);Ut+=h)qt=Lt-St,zt=h-St,ut.push(T(U(St+qt%zt,0))),Lt=x(qt/zt);ut.push(T(U(Lt,0))),rt=A(G,tt,$==Y),G=0,++$}++G,++C}return ut.join("")}function V(I){return P(I,function(C){return _.test(C)?R(C.slice(4).toLowerCase()):C})}function H(I){return P(I,function(C){return m.test(C)?"xn--"+F(C):C})}if(a={version:"1.3.2",ucs2:{decode:O,encode:D},decode:R,encode:F,toASCII:H,toUnicode:V},i&&n)if(r.exports==i)n.exports=a;else for(w in a)a.hasOwnProperty(w)&&(i[w]=a[w]);else t.punycode=a})(cs)})(ws,ws.exports);var bc={isString:function(r){return typeof r=="string"},isObject:function(r){return typeof r=="object"&&r!==null},isNull:function(r){return r===null},isNullOrUndefined:function(r){return r==null}},gr={};function Tc(r,e){return Object.prototype.hasOwnProperty.call(r,e)}var wc=function(r,e,t,i){e=e||"&",t=t||"=";var n={};if(typeof r!="string"||r.length===0)return n;var s=/\+/g;r=r.split(e);var a=1e3;i&&typeof i.maxKeys=="number"&&(a=i.maxKeys);var o=r.length;a>0&&o>a&&(o=a);for(var h=0;h<o;++h){var u=r[h].replace(s,"%20"),l=u.indexOf(t),f,c,d,v;l>=0?(f=u.substr(0,l),c=u.substr(l+1)):(f=u,c=""),d=decodeURIComponent(f),v=decodeURIComponent(c),Tc(n,d)?Array.isArray(n[d])?n[d].push(v):n[d]=[n[d],v]:n[d]=v}return n},yr=function(r){switch(typeof r){case"string":return r;case"boolean":return r?"true":"false";case"number":return isFinite(r)?r:"";default:return""}},Ec=function(r,e,t,i){return e=e||"&",t=t||"=",r===null&&(r=void 0),typeof r=="object"?Object.keys(r).map(function(n){var s=encodeURIComponent(yr(n))+t;return Array.isArray(r[n])?r[n].map(function(a){return s+encodeURIComponent(yr(a))}).join(e):s+encodeURIComponent(yr(r[n]))}).join(e):i?encodeURIComponent(yr(i))+t+encodeURIComponent(yr(r)):""};gr.decode=gr.parse=wc,gr.encode=gr.stringify=Ec;var Sc=ws.exports,Ae=bc,Pc=ln,Rc=Gc,Cc=Bc;function me(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var Oc=/^([a-z0-9.+-]+:)/i,Ac=/:[0-9]*$/,Ic=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Mc=["<",">",'"',"`"," ","\r",`
6
- `," "],Dc=["{","}","|","\\","^","`"].concat(Mc),Es=["'"].concat(Dc),ih=["%","/","?",";","#"].concat(Es),rh=["/","?","#"],Fc=255,nh=/^[+a-z0-9A-Z_-]{0,63}$/,Nc=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Lc={javascript:!0,"javascript:":!0},Ss={javascript:!0,"javascript:":!0},Xi={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},Ps=gr;function ln(r,e,t){if(r&&Ae.isObject(r)&&r instanceof me)return r;var i=new me;return i.parse(r,e,t),i}me.prototype.parse=function(r,e,t){if(!Ae.isString(r))throw new TypeError("Parameter 'url' must be a string, not "+typeof r);var i=r.indexOf("?"),n=i!==-1&&i<r.indexOf("#")?"?":"#",s=r.split(n),a=/\\/g;s[0]=s[0].replace(a,"/"),r=s.join(n);var o=r;if(o=o.trim(),!t&&r.split("#").length===1){var h=Ic.exec(o);if(h)return this.path=o,this.href=o,this.pathname=h[1],h[2]?(this.search=h[2],e?this.query=Ps.parse(this.search.substr(1)):this.query=this.search.substr(1)):e&&(this.search="",this.query={}),this}var u=Oc.exec(o);if(u){u=u[0];var l=u.toLowerCase();this.protocol=l,o=o.substr(u.length)}if(t||u||o.match(/^\/\/[^@\/]+@[^@\/]+/)){var f=o.substr(0,2)==="//";f&&!(u&&Ss[u])&&(o=o.substr(2),this.slashes=!0)}if(!Ss[u]&&(f||u&&!Xi[u])){for(var c=-1,d=0;d<rh.length;d++){var v=o.indexOf(rh[d]);v!==-1&&(c===-1||v<c)&&(c=v)}var p,_;c===-1?_=o.lastIndexOf("@"):_=o.lastIndexOf("@",c),_!==-1&&(p=o.slice(0,_),o=o.slice(_+1),this.auth=decodeURIComponent(p)),c=-1;for(var d=0;d<ih.length;d++){var v=o.indexOf(ih[d]);v!==-1&&(c===-1||v<c)&&(c=v)}c===-1&&(c=o.length),this.host=o.slice(0,c),o=o.slice(c),this.parseHost(),this.hostname=this.hostname||"";var m=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!m)for(var g=this.hostname.split(/\./),d=0,y=g.length;d<y;d++){var b=g[d];if(b&&!b.match(nh)){for(var x="",T=0,w=b.length;T<w;T++)b.charCodeAt(T)>127?x+="x":x+=b[T];if(!x.match(nh)){var S=g.slice(0,d),E=g.slice(d+1),P=b.match(Nc);P&&(S.push(P[1]),E.unshift(P[2])),E.length&&(o="/"+E.join(".")+o),this.hostname=S.join(".");break}}}this.hostname.length>Fc?this.hostname="":this.hostname=this.hostname.toLowerCase(),m||(this.hostname=Sc.toASCII(this.hostname));var O=this.port?":"+this.port:"",D=this.hostname||"";this.host=D+O,this.href+=this.host,m&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),o[0]!=="/"&&(o="/"+o))}if(!Lc[l])for(var d=0,y=Es.length;d<y;d++){var N=Es[d];if(o.indexOf(N)!==-1){var U=encodeURIComponent(N);U===N&&(U=escape(N)),o=o.split(N).join(U)}}var A=o.indexOf("#");A!==-1&&(this.hash=o.substr(A),o=o.slice(0,A));var R=o.indexOf("?");if(R!==-1?(this.search=o.substr(R),this.query=o.substr(R+1),e&&(this.query=Ps.parse(this.query)),o=o.slice(0,R)):e&&(this.search="",this.query={}),o&&(this.pathname=o),Xi[l]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var O=this.pathname||"",F=this.search||"";this.path=O+F}return this.href=this.format(),this};function Bc(r){return Ae.isString(r)&&(r=ln(r)),r instanceof me?r.format():me.prototype.format.call(r)}me.prototype.format=function(){var r=this.auth||"";r&&(r=encodeURIComponent(r),r=r.replace(/%3A/i,":"),r+="@");var e=this.protocol||"",t=this.pathname||"",i=this.hash||"",n=!1,s="";this.host?n=r+this.host:this.hostname&&(n=r+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(n+=":"+this.port)),this.query&&Ae.isObject(this.query)&&Object.keys(this.query).length&&(s=Ps.stringify(this.query));var a=this.search||s&&"?"+s||"";return e&&e.substr(-1)!==":"&&(e+=":"),this.slashes||(!e||Xi[e])&&n!==!1?(n="//"+(n||""),t&&t.charAt(0)!=="/"&&(t="/"+t)):n||(n=""),i&&i.charAt(0)!=="#"&&(i="#"+i),a&&a.charAt(0)!=="?"&&(a="?"+a),t=t.replace(/[?#]/g,function(o){return encodeURIComponent(o)}),a=a.replace("#","%23"),e+n+t+a+i};function Gc(r,e){return ln(r,!1,!0).resolve(e)}me.prototype.resolve=function(r){return this.resolveObject(ln(r,!1,!0)).format()},me.prototype.resolveObject=function(r){if(Ae.isString(r)){var e=new me;e.parse(r,!1,!0),r=e}for(var t=new me,i=Object.keys(this),n=0;n<i.length;n++){var s=i[n];t[s]=this[s]}if(t.hash=r.hash,r.href==="")return t.href=t.format(),t;if(r.slashes&&!r.protocol){for(var a=Object.keys(r),o=0;o<a.length;o++){var h=a[o];h!=="protocol"&&(t[h]=r[h])}return Xi[t.protocol]&&t.hostname&&!t.pathname&&(t.path=t.pathname="/"),t.href=t.format(),t}if(r.protocol&&r.protocol!==t.protocol){if(!Xi[r.protocol]){for(var u=Object.keys(r),l=0;l<u.length;l++){var f=u[l];t[f]=r[f]}return t.href=t.format(),t}if(t.protocol=r.protocol,!r.host&&!Ss[r.protocol]){for(var y=(r.pathname||"").split("/");y.length&&!(r.host=y.shift()););r.host||(r.host=""),r.hostname||(r.hostname=""),y[0]!==""&&y.unshift(""),y.length<2&&y.unshift(""),t.pathname=y.join("/")}else t.pathname=r.pathname;if(t.search=r.search,t.query=r.query,t.host=r.host||"",t.auth=r.auth,t.hostname=r.hostname||r.host,t.port=r.port,t.pathname||t.search){var c=t.pathname||"",d=t.search||"";t.path=c+d}return t.slashes=t.slashes||r.slashes,t.href=t.format(),t}var v=t.pathname&&t.pathname.charAt(0)==="/",p=r.host||r.pathname&&r.pathname.charAt(0)==="/",_=p||v||t.host&&r.pathname,m=_,g=t.pathname&&t.pathname.split("/")||[],y=r.pathname&&r.pathname.split("/")||[],b=t.protocol&&!Xi[t.protocol];if(b&&(t.hostname="",t.port=null,t.host&&(g[0]===""?g[0]=t.host:g.unshift(t.host)),t.host="",r.protocol&&(r.hostname=null,r.port=null,r.host&&(y[0]===""?y[0]=r.host:y.unshift(r.host)),r.host=null),_=_&&(y[0]===""||g[0]==="")),p)t.host=r.host||r.host===""?r.host:t.host,t.hostname=r.hostname||r.hostname===""?r.hostname:t.hostname,t.search=r.search,t.query=r.query,g=y;else if(y.length)g||(g=[]),g.pop(),g=g.concat(y),t.search=r.search,t.query=r.query;else if(!Ae.isNullOrUndefined(r.search)){if(b){t.hostname=t.host=g.shift();var x=t.host&&t.host.indexOf("@")>0?t.host.split("@"):!1;x&&(t.auth=x.shift(),t.host=t.hostname=x.shift())}return t.search=r.search,t.query=r.query,(!Ae.isNull(t.pathname)||!Ae.isNull(t.search))&&(t.path=(t.pathname?t.pathname:"")+(t.search?t.search:"")),t.href=t.format(),t}if(!g.length)return t.pathname=null,t.search?t.path="/"+t.search:t.path=null,t.href=t.format(),t;for(var T=g.slice(-1)[0],w=(t.host||r.host||g.length>1)&&(T==="."||T==="..")||T==="",S=0,E=g.length;E>=0;E--)T=g[E],T==="."?g.splice(E,1):T===".."?(g.splice(E,1),S++):S&&(g.splice(E,1),S--);if(!_&&!m)for(;S--;S)g.unshift("..");_&&g[0]!==""&&(!g[0]||g[0].charAt(0)!=="/")&&g.unshift(""),w&&g.join("/").substr(-1)!=="/"&&g.push("");var P=g[0]===""||g[0]&&g[0].charAt(0)==="/";if(b){t.hostname=t.host=P?"":g.length?g.shift():"";var x=t.host&&t.host.indexOf("@")>0?t.host.split("@"):!1;x&&(t.auth=x.shift(),t.host=t.hostname=x.shift())}return _=_||t.host&&g.length,_&&!P&&g.unshift(""),g.length?t.pathname=g.join("/"):(t.pathname=null,t.path=null),(!Ae.isNull(t.pathname)||!Ae.isNull(t.search))&&(t.path=(t.pathname?t.pathname:"")+(t.search?t.search:"")),t.auth=r.auth||t.auth,t.slashes=t.slashes||r.slashes,t.href=t.format(),t},me.prototype.parseHost=function(){var r=this.host,e=Ac.exec(r);e&&(e=e[0],e!==":"&&(this.port=e.substr(1)),r=r.substr(0,r.length-e.length)),r&&(this.hostname=r)};var Hi={parse:Pc,format:Cc,resolve:Rc};L.RETINA_PREFIX=/@([0-9\.]+)x/,L.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var Rs=!1,sh="6.5.8";function Uc(){Rs=!0}function kc(r){var e;if(!Rs){if(L.ADAPTER.getNavigator().userAgent.toLowerCase().indexOf("chrome")>-1){var t=[`
7
- %c %c %c PixiJS `+sh+" - ✰ "+r+` ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥
5
+ `)}function Xf(r){const e=getComputedStyle(document.documentElement).fontSize;return parseFloat(r)*parseFloat(e)}const Mo={timeBySeconds:Mf,timeByMinutes:Df,date:Ff},Do=()=>({fill:"black",inverseTextOnFill:!0});var cs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Fo={exports:{}};(function(r){(function(){function e(p,_){document.addEventListener?p.addEventListener("scroll",_,!1):p.attachEvent("scroll",_)}function t(p){document.body?p():document.addEventListener?document.addEventListener("DOMContentLoaded",function _(){document.removeEventListener("DOMContentLoaded",_),p()}):document.attachEvent("onreadystatechange",function _(){(document.readyState=="interactive"||document.readyState=="complete")&&(document.detachEvent("onreadystatechange",_),p())})}function i(p){this.g=document.createElement("div"),this.g.setAttribute("aria-hidden","true"),this.g.appendChild(document.createTextNode(p)),this.h=document.createElement("span"),this.i=document.createElement("span"),this.m=document.createElement("span"),this.j=document.createElement("span"),this.l=-1,this.h.style.cssText="max-width:none;display:inline-block;position:absolute;height:100%;width:100%;overflow:scroll;font-size:16px;",this.i.style.cssText="max-width:none;display:inline-block;position:absolute;height:100%;width:100%;overflow:scroll;font-size:16px;",this.j.style.cssText="max-width:none;display:inline-block;position:absolute;height:100%;width:100%;overflow:scroll;font-size:16px;",this.m.style.cssText="display:inline-block;width:200%;height:200%;font-size:16px;max-width:none;",this.h.appendChild(this.m),this.i.appendChild(this.j),this.g.appendChild(this.h),this.g.appendChild(this.i)}function n(p,_){p.g.style.cssText="max-width:none;min-width:20px;min-height:20px;display:inline-block;overflow:hidden;position:absolute;width:auto;margin:0;padding:0;top:-999px;white-space:nowrap;font-synthesis:none;font:"+_+";"}function s(p){var _=p.g.offsetWidth,m=_+100;return p.j.style.width=m+"px",p.i.scrollLeft=m,p.h.scrollLeft=p.h.scrollWidth+100,p.l!==_?(p.l=_,!0):!1}function a(p,_){function m(){var y=g;s(y)&&y.g.parentNode!==null&&_(y.l)}var g=p;e(p.h,m),e(p.i,m),s(p)}function o(p,_,m){_=_||{},m=m||window,this.family=p,this.style=_.style||"normal",this.weight=_.weight||"normal",this.stretch=_.stretch||"normal",this.context=m}var h=null,u=null,l=null,f=null;function c(p){return u===null&&(d(p)&&/Apple/.test(window.navigator.vendor)?(p=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))(?:\.([0-9]+))/.exec(window.navigator.userAgent),u=!!p&&603>parseInt(p[1],10)):u=!1),u}function d(p){return f===null&&(f=!!p.document.fonts),f}function v(p,_){var m=p.style,g=p.weight;if(l===null){var y=document.createElement("div");try{y.style.font="condensed 100px sans-serif"}catch{}l=y.style.font!==""}return[m,g,l?p.stretch:"","100px",_].join(" ")}o.prototype.load=function(p,_){var m=this,g=p||"BESbswy",y=0,b=_||3e3,x=new Date().getTime();return new Promise(function(T,w){if(d(m.context)&&!c(m.context)){var S=new Promise(function(P,O){function M(){new Date().getTime()-x>=b?O(Error(""+b+"ms timeout exceeded")):m.context.document.fonts.load(v(m,'"'+m.family+'"'),g).then(function(F){1<=F.length?P():setTimeout(M,25)},O)}M()}),E=new Promise(function(P,O){y=setTimeout(function(){O(Error(""+b+"ms timeout exceeded"))},b)});Promise.race([E,S]).then(function(){clearTimeout(y),T(m)},w)}else t(function(){function P(){var B;(B=A!=-1&&I!=-1||A!=-1&&N!=-1||I!=-1&&N!=-1)&&((B=A!=I&&A!=N&&I!=N)||(h===null&&(B=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))/.exec(window.navigator.userAgent),h=!!B&&(536>parseInt(B[1],10)||parseInt(B[1],10)===536&&11>=parseInt(B[2],10))),B=h&&(A==Y&&I==Y&&N==Y||A==H&&I==H&&N==H||A==R&&I==R&&N==R)),B=!B),B&&(C.parentNode!==null&&C.parentNode.removeChild(C),clearTimeout(y),T(m))}function O(){if(new Date().getTime()-x>=b)C.parentNode!==null&&C.parentNode.removeChild(C),w(Error(""+b+"ms timeout exceeded"));else{var B=m.context.document.hidden;(B===!0||B===void 0)&&(A=M.g.offsetWidth,I=F.g.offsetWidth,N=G.g.offsetWidth,P()),y=setTimeout(O,50)}}var M=new i(g),F=new i(g),G=new i(g),A=-1,I=-1,N=-1,Y=-1,H=-1,R=-1,C=document.createElement("div");C.dir="ltr",n(M,v(m,"sans-serif")),n(F,v(m,"serif")),n(G,v(m,"monospace")),C.appendChild(M.g),C.appendChild(F.g),C.appendChild(G.g),m.context.document.body.appendChild(C),Y=M.g.offsetWidth,H=F.g.offsetWidth,R=G.g.offsetWidth,O(),a(M,function(B){A=B,P()}),n(M,v(m,'"'+m.family+'",sans-serif')),a(F,function(B){I=B,P()}),n(F,v(m,'"'+m.family+'",serif')),a(G,function(B){N=B,P()}),n(G,v(m,'"'+m.family+'",monospace'))})})},r.exports=o})()})(Fo);const Hf=Fo.exports;function Wf(r){var e=this.constructor;return this.then(function(t){return e.resolve(r()).then(function(){return t})},function(t){return e.resolve(r()).then(function(){return e.reject(t)})})}function Vf(r){var e=this;return new e(function(t,i){if(!(r&&typeof r.length<"u"))return i(new TypeError(typeof r+" "+r+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var n=Array.prototype.slice.call(r);if(n.length===0)return t([]);var s=n.length;function a(h,u){if(u&&(typeof u=="object"||typeof u=="function")){var l=u.then;if(typeof l=="function"){l.call(u,function(f){a(h,f)},function(f){n[h]={status:"rejected",reason:f},--s===0&&t(n)});return}}n[h]={status:"fulfilled",value:u},--s===0&&t(n)}for(var o=0;o<n.length;o++)a(o,n[o])})}var zf=setTimeout;function No(r){return Boolean(r&&typeof r.length<"u")}function Yf(){}function jf(r,e){return function(){r.apply(e,arguments)}}function mt(r){if(!(this instanceof mt))throw new TypeError("Promises must be constructed via new");if(typeof r!="function")throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],Bo(r,this)}function Lo(r,e){for(;r._state===3;)r=r._value;if(r._state===0){r._deferreds.push(e);return}r._handled=!0,mt._immediateFn(function(){var t=r._state===1?e.onFulfilled:e.onRejected;if(t===null){(r._state===1?ds:cr)(e.promise,r._value);return}var i;try{i=t(r._value)}catch(n){cr(e.promise,n);return}ds(e.promise,i)})}function ds(r,e){try{if(e===r)throw new TypeError("A promise cannot be resolved with itself.");if(e&&(typeof e=="object"||typeof e=="function")){var t=e.then;if(e instanceof mt){r._state=3,r._value=e,ps(r);return}else if(typeof t=="function"){Bo(jf(t,e),r);return}}r._state=1,r._value=e,ps(r)}catch(i){cr(r,i)}}function cr(r,e){r._state=2,r._value=e,ps(r)}function ps(r){r._state===2&&r._deferreds.length===0&&mt._immediateFn(function(){r._handled||mt._unhandledRejectionFn(r._value)});for(var e=0,t=r._deferreds.length;e<t;e++)Lo(r,r._deferreds[e]);r._deferreds=null}function Zf(r,e,t){this.onFulfilled=typeof r=="function"?r:null,this.onRejected=typeof e=="function"?e:null,this.promise=t}function Bo(r,e){var t=!1;try{r(function(i){t||(t=!0,ds(e,i))},function(i){t||(t=!0,cr(e,i))})}catch(i){if(t)return;t=!0,cr(e,i)}}mt.prototype.catch=function(r){return this.then(null,r)},mt.prototype.then=function(r,e){var t=new this.constructor(Yf);return Lo(this,new Zf(r,e,t)),t},mt.prototype.finally=Wf,mt.all=function(r){return new mt(function(e,t){if(!No(r))return t(new TypeError("Promise.all accepts an array"));var i=Array.prototype.slice.call(r);if(i.length===0)return e([]);var n=i.length;function s(o,h){try{if(h&&(typeof h=="object"||typeof h=="function")){var u=h.then;if(typeof u=="function"){u.call(h,function(l){s(o,l)},t);return}}i[o]=h,--n===0&&e(i)}catch(l){t(l)}}for(var a=0;a<i.length;a++)s(a,i[a])})},mt.allSettled=Vf,mt.resolve=function(r){return r&&typeof r=="object"&&r.constructor===mt?r:new mt(function(e){e(r)})},mt.reject=function(r){return new mt(function(e,t){t(r)})},mt.race=function(r){return new mt(function(e,t){if(!No(r))return t(new TypeError("Promise.race accepts an array"));for(var i=0,n=r.length;i<n;i++)mt.resolve(r[i]).then(e,t)})},mt._immediateFn=typeof setImmediate=="function"&&function(r){setImmediate(r)}||function(r){zf(r,0)},mt._unhandledRejectionFn=function(e){typeof console<"u"&&console&&console.warn("Possible Unhandled Promise Rejection:",e)};var Uo=Object.getOwnPropertySymbols,qf=Object.prototype.hasOwnProperty,Kf=Object.prototype.propertyIsEnumerable;function $f(r){if(r==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(r)}function Jf(){try{if(!Object.assign)return!1;var r=new String("abc");if(r[5]="de",Object.getOwnPropertyNames(r)[0]==="5")return!1;for(var e={},t=0;t<10;t++)e["_"+String.fromCharCode(t)]=t;var i=Object.getOwnPropertyNames(e).map(function(s){return e[s]});if(i.join("")!=="0123456789")return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(s){n[s]=s}),Object.keys(Object.assign({},n)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}var Qf=Jf()?Object.assign:function(r,e){for(var t,i=$f(r),n,s=1;s<arguments.length;s++){t=Object(arguments[s]);for(var a in t)qf.call(t,a)&&(i[a]=t[a]);if(Uo){n=Uo(t);for(var o=0;o<n.length;o++)Kf.call(t,n[o])&&(i[n[o]]=t[n[o]])}}return i};typeof globalThis>"u"&&(typeof self<"u"?self.globalThis=self:typeof global<"u"&&(global.globalThis=global)),globalThis.Promise||(globalThis.Promise=mt),Object.assign||(Object.assign=Qf);var tc=16;if(Date.now&&Date.prototype.getTime||(Date.now=function(){return new Date().getTime()}),!(globalThis.performance&&globalThis.performance.now)){var ec=Date.now();globalThis.performance||(globalThis.performance={}),globalThis.performance.now=function(){return Date.now()-ec}}for(var vs=Date.now(),Go=["ms","moz","webkit","o"],_s=0;_s<Go.length&&!globalThis.requestAnimationFrame;++_s){var ms=Go[_s];globalThis.requestAnimationFrame=globalThis[ms+"RequestAnimationFrame"],globalThis.cancelAnimationFrame=globalThis[ms+"CancelAnimationFrame"]||globalThis[ms+"CancelRequestAnimationFrame"]}globalThis.requestAnimationFrame||(globalThis.requestAnimationFrame=function(r){if(typeof r!="function")throw new TypeError(r+"is not a function");var e=Date.now(),t=tc+vs-e;return t<0&&(t=0),vs=e,globalThis.self.setTimeout(function(){vs=Date.now(),r(performance.now())},t)}),globalThis.cancelAnimationFrame||(globalThis.cancelAnimationFrame=function(r){return clearTimeout(r)}),Math.sign||(Math.sign=function(e){return e=Number(e),e===0||isNaN(e)?e:e>0?1:-1}),Number.isInteger||(Number.isInteger=function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e}),globalThis.ArrayBuffer||(globalThis.ArrayBuffer=Array),globalThis.Float32Array||(globalThis.Float32Array=Array),globalThis.Uint32Array||(globalThis.Uint32Array=Array),globalThis.Uint16Array||(globalThis.Uint16Array=Array),globalThis.Uint8Array||(globalThis.Uint8Array=Array),globalThis.Int32Array||(globalThis.Int32Array=Array);var Le;(function(r){r[r.WEBGL_LEGACY=0]="WEBGL_LEGACY",r[r.WEBGL=1]="WEBGL",r[r.WEBGL2=2]="WEBGL2"})(Le||(Le={}));var dr;(function(r){r[r.UNKNOWN=0]="UNKNOWN",r[r.WEBGL=1]="WEBGL",r[r.CANVAS=2]="CANVAS"})(dr||(dr={}));var tn;(function(r){r[r.COLOR=16384]="COLOR",r[r.DEPTH=256]="DEPTH",r[r.STENCIL=1024]="STENCIL"})(tn||(tn={}));var X;(function(r){r[r.NORMAL=0]="NORMAL",r[r.ADD=1]="ADD",r[r.MULTIPLY=2]="MULTIPLY",r[r.SCREEN=3]="SCREEN",r[r.OVERLAY=4]="OVERLAY",r[r.DARKEN=5]="DARKEN",r[r.LIGHTEN=6]="LIGHTEN",r[r.COLOR_DODGE=7]="COLOR_DODGE",r[r.COLOR_BURN=8]="COLOR_BURN",r[r.HARD_LIGHT=9]="HARD_LIGHT",r[r.SOFT_LIGHT=10]="SOFT_LIGHT",r[r.DIFFERENCE=11]="DIFFERENCE",r[r.EXCLUSION=12]="EXCLUSION",r[r.HUE=13]="HUE",r[r.SATURATION=14]="SATURATION",r[r.COLOR=15]="COLOR",r[r.LUMINOSITY=16]="LUMINOSITY",r[r.NORMAL_NPM=17]="NORMAL_NPM",r[r.ADD_NPM=18]="ADD_NPM",r[r.SCREEN_NPM=19]="SCREEN_NPM",r[r.NONE=20]="NONE",r[r.SRC_OVER=0]="SRC_OVER",r[r.SRC_IN=21]="SRC_IN",r[r.SRC_OUT=22]="SRC_OUT",r[r.SRC_ATOP=23]="SRC_ATOP",r[r.DST_OVER=24]="DST_OVER",r[r.DST_IN=25]="DST_IN",r[r.DST_OUT=26]="DST_OUT",r[r.DST_ATOP=27]="DST_ATOP",r[r.ERASE=26]="ERASE",r[r.SUBTRACT=28]="SUBTRACT",r[r.XOR=29]="XOR"})(X||(X={}));var de;(function(r){r[r.POINTS=0]="POINTS",r[r.LINES=1]="LINES",r[r.LINE_LOOP=2]="LINE_LOOP",r[r.LINE_STRIP=3]="LINE_STRIP",r[r.TRIANGLES=4]="TRIANGLES",r[r.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",r[r.TRIANGLE_FAN=6]="TRIANGLE_FAN"})(de||(de={}));var D;(function(r){r[r.RGBA=6408]="RGBA",r[r.RGB=6407]="RGB",r[r.RG=33319]="RG",r[r.RED=6403]="RED",r[r.RGBA_INTEGER=36249]="RGBA_INTEGER",r[r.RGB_INTEGER=36248]="RGB_INTEGER",r[r.RG_INTEGER=33320]="RG_INTEGER",r[r.RED_INTEGER=36244]="RED_INTEGER",r[r.ALPHA=6406]="ALPHA",r[r.LUMINANCE=6409]="LUMINANCE",r[r.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",r[r.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",r[r.DEPTH_STENCIL=34041]="DEPTH_STENCIL"})(D||(D={}));var mi;(function(r){r[r.TEXTURE_2D=3553]="TEXTURE_2D",r[r.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",r[r.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",r[r.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",r[r.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",r[r.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",r[r.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",r[r.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",r[r.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z"})(mi||(mi={}));var k;(function(r){r[r.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",r[r.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",r[r.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",r[r.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",r[r.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",r[r.UNSIGNED_INT=5125]="UNSIGNED_INT",r[r.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",r[r.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",r[r.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",r[r.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",r[r.BYTE=5120]="BYTE",r[r.SHORT=5122]="SHORT",r[r.INT=5124]="INT",r[r.FLOAT=5126]="FLOAT",r[r.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",r[r.HALF_FLOAT=36193]="HALF_FLOAT"})(k||(k={}));var en;(function(r){r[r.FLOAT=0]="FLOAT",r[r.INT=1]="INT",r[r.UINT=2]="UINT"})(en||(en={}));var Pe;(function(r){r[r.NEAREST=0]="NEAREST",r[r.LINEAR=1]="LINEAR"})(Pe||(Pe={}));var Re;(function(r){r[r.CLAMP=33071]="CLAMP",r[r.REPEAT=10497]="REPEAT",r[r.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"})(Re||(Re={}));var pe;(function(r){r[r.OFF=0]="OFF",r[r.POW2=1]="POW2",r[r.ON=2]="ON",r[r.ON_MANUAL=3]="ON_MANUAL"})(pe||(pe={}));var ve;(function(r){r[r.NPM=0]="NPM",r[r.UNPACK=1]="UNPACK",r[r.PMA=2]="PMA",r[r.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",r[r.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",r[r.PREMULTIPLY_ALPHA=2]="PREMULTIPLY_ALPHA",r[r.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA"})(ve||(ve={}));var _e;(function(r){r[r.NO=0]="NO",r[r.YES=1]="YES",r[r.AUTO=2]="AUTO",r[r.BLEND=0]="BLEND",r[r.CLEAR=1]="CLEAR",r[r.BLIT=2]="BLIT"})(_e||(_e={}));var rn;(function(r){r[r.AUTO=0]="AUTO",r[r.MANUAL=1]="MANUAL"})(rn||(rn={}));var Kt;(function(r){r.LOW="lowp",r.MEDIUM="mediump",r.HIGH="highp"})(Kt||(Kt={}));var Pt;(function(r){r[r.NONE=0]="NONE",r[r.SCISSOR=1]="SCISSOR",r[r.STENCIL=2]="STENCIL",r[r.SPRITE=3]="SPRITE",r[r.COLOR=4]="COLOR"})(Pt||(Pt={}));var ko;(function(r){r[r.RED=1]="RED",r[r.GREEN=2]="GREEN",r[r.BLUE=4]="BLUE",r[r.ALPHA=8]="ALPHA"})(ko||(ko={}));var gt;(function(r){r[r.NONE=0]="NONE",r[r.LOW=2]="LOW",r[r.MEDIUM=4]="MEDIUM",r[r.HIGH=8]="HIGH"})(gt||(gt={}));var Ce;(function(r){r[r.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",r[r.ARRAY_BUFFER=34962]="ARRAY_BUFFER",r[r.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER"})(Ce||(Ce={}));var ic={createCanvas:function(r,e){var t=document.createElement("canvas");return t.width=r,t.height=e,t},getWebGLRenderingContext:function(){return WebGLRenderingContext},getNavigator:function(){return navigator},getBaseUrl:function(){var r;return(r=document.baseURI)!==null&&r!==void 0?r:window.location.href},fetch:function(r,e){return fetch(r,e)}},gs=/iPhone/i,Xo=/iPod/i,Ho=/iPad/i,Wo=/\biOS-universal(?:.+)Mac\b/i,ys=/\bAndroid(?:.+)Mobile\b/i,Vo=/Android/i,Gi=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,nn=/Silk/i,Be=/Windows Phone/i,zo=/\bWindows(?:.+)ARM\b/i,Yo=/BlackBerry/i,jo=/BB10/i,Zo=/Opera Mini/i,qo=/\b(CriOS|Chrome)(?:.+)Mobile/i,Ko=/Mobile(?:.+)Firefox\b/i,$o=function(r){return typeof r<"u"&&r.platform==="MacIntel"&&typeof r.maxTouchPoints=="number"&&r.maxTouchPoints>1&&typeof MSStream>"u"};function rc(r){return function(e){return e.test(r)}}function nc(r){var e={userAgent:"",platform:"",maxTouchPoints:0};!r&&typeof navigator<"u"?e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof r=="string"?e.userAgent=r:r&&r.userAgent&&(e={userAgent:r.userAgent,platform:r.platform,maxTouchPoints:r.maxTouchPoints||0});var t=e.userAgent,i=t.split("[FBAN");typeof i[1]<"u"&&(t=i[0]),i=t.split("Twitter"),typeof i[1]<"u"&&(t=i[0]);var n=rc(t),s={apple:{phone:n(gs)&&!n(Be),ipod:n(Xo),tablet:!n(gs)&&(n(Ho)||$o(e))&&!n(Be),universal:n(Wo),device:(n(gs)||n(Xo)||n(Ho)||n(Wo)||$o(e))&&!n(Be)},amazon:{phone:n(Gi),tablet:!n(Gi)&&n(nn),device:n(Gi)||n(nn)},android:{phone:!n(Be)&&n(Gi)||!n(Be)&&n(ys),tablet:!n(Be)&&!n(Gi)&&!n(ys)&&(n(nn)||n(Vo)),device:!n(Be)&&(n(Gi)||n(nn)||n(ys)||n(Vo))||n(/\bokhttp\b/i)},windows:{phone:n(Be),tablet:n(zo),device:n(Be)||n(zo)},other:{blackberry:n(Yo),blackberry10:n(jo),opera:n(Zo),firefox:n(Ko),chrome:n(qo),device:n(Yo)||n(jo)||n(Zo)||n(Ko)||n(qo)},any:!1,phone:!1,tablet:!1};return s.any=s.apple.device||s.android.device||s.windows.device||s.other.device,s.phone=s.apple.phone||s.android.phone||s.windows.phone,s.tablet=s.apple.tablet||s.android.tablet||s.windows.tablet,s}var Oe=nc(globalThis.navigator);function sc(){return!Oe.apple.device}function ac(r){var e=!0;if(Oe.tablet||Oe.phone){if(Oe.apple.device){var t=navigator.userAgent.match(/OS (\d+)_(\d+)?/);if(t){var i=parseInt(t[1],10);i<11&&(e=!1)}}if(Oe.android.device){var t=navigator.userAgent.match(/Android\s([0-9.]*)/);if(t){var i=parseInt(t[1],10);i<7&&(e=!1)}}}return e?r:4}var L={ADAPTER:ic,MIPMAP_TEXTURES:pe.POW2,ANISOTROPIC_LEVEL:0,RESOLUTION:1,FILTER_RESOLUTION:1,FILTER_MULTISAMPLE:gt.NONE,SPRITE_MAX_TEXTURES:ac(32),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,antialias:!1,autoDensity:!1,backgroundColor:0,backgroundAlpha:1,useContextAlpha:!0,clearBeforeRender:!0,preserveDrawingBuffer:!1,width:800,height:600,legacy:!1},GC_MODE:rn.AUTO,GC_MAX_IDLE:60*60,GC_MAX_CHECK_COUNT:60*10,WRAP_MODE:Re.CLAMP,SCALE_MODE:Pe.LINEAR,PRECISION_VERTEX:Kt.HIGH,PRECISION_FRAGMENT:Oe.apple.device?Kt.HIGH:Kt.MEDIUM,CAN_UPLOAD_SAME_BUFFER:sc(),CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1},Jo={exports:{}};(function(r){var e=Object.prototype.hasOwnProperty,t="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(t=!1));function n(h,u,l){this.fn=h,this.context=u,this.once=l||!1}function s(h,u,l,f,c){if(typeof l!="function")throw new TypeError("The listener must be a function");var d=new n(l,f||h,c),v=t?t+u:u;return h._events[v]?h._events[v].fn?h._events[v]=[h._events[v],d]:h._events[v].push(d):(h._events[v]=d,h._eventsCount++),h}function a(h,u){--h._eventsCount===0?h._events=new i:delete h._events[u]}function o(){this._events=new i,this._eventsCount=0}o.prototype.eventNames=function(){var u=[],l,f;if(this._eventsCount===0)return u;for(f in l=this._events)e.call(l,f)&&u.push(t?f.slice(1):f);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(l)):u},o.prototype.listeners=function(u){var l=t?t+u:u,f=this._events[l];if(!f)return[];if(f.fn)return[f.fn];for(var c=0,d=f.length,v=new Array(d);c<d;c++)v[c]=f[c].fn;return v},o.prototype.listenerCount=function(u){var l=t?t+u:u,f=this._events[l];return f?f.fn?1:f.length:0},o.prototype.emit=function(u,l,f,c,d,v){var p=t?t+u:u;if(!this._events[p])return!1;var _=this._events[p],m=arguments.length,g,y;if(_.fn){switch(_.once&&this.removeListener(u,_.fn,void 0,!0),m){case 1:return _.fn.call(_.context),!0;case 2:return _.fn.call(_.context,l),!0;case 3:return _.fn.call(_.context,l,f),!0;case 4:return _.fn.call(_.context,l,f,c),!0;case 5:return _.fn.call(_.context,l,f,c,d),!0;case 6:return _.fn.call(_.context,l,f,c,d,v),!0}for(y=1,g=new Array(m-1);y<m;y++)g[y-1]=arguments[y];_.fn.apply(_.context,g)}else{var b=_.length,x;for(y=0;y<b;y++)switch(_[y].once&&this.removeListener(u,_[y].fn,void 0,!0),m){case 1:_[y].fn.call(_[y].context);break;case 2:_[y].fn.call(_[y].context,l);break;case 3:_[y].fn.call(_[y].context,l,f);break;case 4:_[y].fn.call(_[y].context,l,f,c);break;default:if(!g)for(x=1,g=new Array(m-1);x<m;x++)g[x-1]=arguments[x];_[y].fn.apply(_[y].context,g)}}return!0},o.prototype.on=function(u,l,f){return s(this,u,l,f,!1)},o.prototype.once=function(u,l,f){return s(this,u,l,f,!0)},o.prototype.removeListener=function(u,l,f,c){var d=t?t+u:u;if(!this._events[d])return this;if(!l)return a(this,d),this;var v=this._events[d];if(v.fn)v.fn===l&&(!c||v.once)&&(!f||v.context===f)&&a(this,d);else{for(var p=0,_=[],m=v.length;p<m;p++)(v[p].fn!==l||c&&!v[p].once||f&&v[p].context!==f)&&_.push(v[p]);_.length?this._events[d]=_.length===1?_[0]:_:a(this,d)}return this},o.prototype.removeAllListeners=function(u){var l;return u?(l=t?t+u:u,this._events[l]&&a(this,l)):(this._events=new i,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=t,o.EventEmitter=o,r.exports=o})(Jo);const pr=Jo.exports;var sn={exports:{}};sn.exports=an,sn.exports.default=an;function an(r,e,t){t=t||2;var i=e&&e.length,n=i?e[0]*t:r.length,s=Qo(r,0,n,t,!0),a=[];if(!s||s.next===s.prev)return a;var o,h,u,l,f,c,d;if(i&&(s=fc(r,e,s,t)),r.length>80*t){o=u=r[0],h=l=r[1];for(var v=t;v<n;v+=t)f=r[v],c=r[v+1],f<o&&(o=f),c<h&&(h=c),f>u&&(u=f),c>l&&(l=c);d=Math.max(u-o,l-h),d=d!==0?32767/d:0}return vr(s,a,t,o,h,d,0),a}function Qo(r,e,t,i,n){var s,a;if(n===Ts(r,e,t,i)>0)for(s=e;s<t;s+=i)a=ih(s,r[s],r[s+1],a);else for(s=t-i;s>=e;s-=i)a=ih(s,r[s],r[s+1],a);return a&&on(a,a.next)&&(mr(a),a=a.next),a}function gi(r,e){if(!r)return r;e||(e=r);var t=r,i;do if(i=!1,!t.steiner&&(on(t,t.next)||pt(t.prev,t,t.next)===0)){if(mr(t),t=e=t.prev,t===t.next)break;i=!0}else t=t.next;while(i||t!==e);return e}function vr(r,e,t,i,n,s,a){if(r){!a&&s&&_c(r,i,n,s);for(var o=r,h,u;r.prev!==r.next;){if(h=r.prev,u=r.next,s?hc(r,i,n,s):oc(r)){e.push(h.i/t|0),e.push(r.i/t|0),e.push(u.i/t|0),mr(r),r=u.next,o=u.next;continue}if(r=u,r===o){a?a===1?(r=uc(gi(r),e,t),vr(r,e,t,i,n,s,2)):a===2&&lc(r,e,t,i,n,s):vr(gi(r),e,t,i,n,s,1);break}}}}function oc(r){var e=r.prev,t=r,i=r.next;if(pt(e,t,i)>=0)return!1;for(var n=e.x,s=t.x,a=i.x,o=e.y,h=t.y,u=i.y,l=n<s?n<a?n:a:s<a?s:a,f=o<h?o<u?o:u:h<u?h:u,c=n>s?n>a?n:a:s>a?s:a,d=o>h?o>u?o:u:h>u?h:u,v=i.next;v!==e;){if(v.x>=l&&v.x<=c&&v.y>=f&&v.y<=d&&ki(n,o,s,h,a,u,v.x,v.y)&&pt(v.prev,v,v.next)>=0)return!1;v=v.next}return!0}function hc(r,e,t,i){var n=r.prev,s=r,a=r.next;if(pt(n,s,a)>=0)return!1;for(var o=n.x,h=s.x,u=a.x,l=n.y,f=s.y,c=a.y,d=o<h?o<u?o:u:h<u?h:u,v=l<f?l<c?l:c:f<c?f:c,p=o>h?o>u?o:u:h>u?h:u,_=l>f?l>c?l:c:f>c?f:c,m=xs(d,v,e,t,i),g=xs(p,_,e,t,i),y=r.prevZ,b=r.nextZ;y&&y.z>=m&&b&&b.z<=g;){if(y.x>=d&&y.x<=p&&y.y>=v&&y.y<=_&&y!==n&&y!==a&&ki(o,l,h,f,u,c,y.x,y.y)&&pt(y.prev,y,y.next)>=0||(y=y.prevZ,b.x>=d&&b.x<=p&&b.y>=v&&b.y<=_&&b!==n&&b!==a&&ki(o,l,h,f,u,c,b.x,b.y)&&pt(b.prev,b,b.next)>=0))return!1;b=b.nextZ}for(;y&&y.z>=m;){if(y.x>=d&&y.x<=p&&y.y>=v&&y.y<=_&&y!==n&&y!==a&&ki(o,l,h,f,u,c,y.x,y.y)&&pt(y.prev,y,y.next)>=0)return!1;y=y.prevZ}for(;b&&b.z<=g;){if(b.x>=d&&b.x<=p&&b.y>=v&&b.y<=_&&b!==n&&b!==a&&ki(o,l,h,f,u,c,b.x,b.y)&&pt(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function uc(r,e,t){var i=r;do{var n=i.prev,s=i.next.next;!on(n,s)&&th(n,i,i.next,s)&&_r(n,s)&&_r(s,n)&&(e.push(n.i/t|0),e.push(i.i/t|0),e.push(s.i/t|0),mr(i),mr(i.next),i=r=s),i=i.next}while(i!==r);return gi(i)}function lc(r,e,t,i,n,s){var a=r;do{for(var o=a.next.next;o!==a.prev;){if(a.i!==o.i&&yc(a,o)){var h=eh(a,o);a=gi(a,a.next),h=gi(h,h.next),vr(a,e,t,i,n,s,0),vr(h,e,t,i,n,s,0);return}o=o.next}a=a.next}while(a!==r)}function fc(r,e,t,i){var n=[],s,a,o,h,u;for(s=0,a=e.length;s<a;s++)o=e[s]*i,h=s<a-1?e[s+1]*i:r.length,u=Qo(r,o,h,i,!1),u===u.next&&(u.steiner=!0),n.push(gc(u));for(n.sort(cc),s=0;s<n.length;s++)t=dc(n[s],t);return t}function cc(r,e){return r.x-e.x}function dc(r,e){var t=pc(r,e);if(!t)return e;var i=eh(t,r);return gi(i,i.next),gi(t,t.next)}function pc(r,e){var t=e,i=r.x,n=r.y,s=-1/0,a;do{if(n<=t.y&&n>=t.next.y&&t.next.y!==t.y){var o=t.x+(n-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(o<=i&&o>s&&(s=o,a=t.x<t.next.x?t:t.next,o===i))return a}t=t.next}while(t!==e);if(!a)return null;var h=a,u=a.x,l=a.y,f=1/0,c;t=a;do i>=t.x&&t.x>=u&&i!==t.x&&ki(n<l?i:s,n,u,l,n<l?s:i,n,t.x,t.y)&&(c=Math.abs(n-t.y)/(i-t.x),_r(t,r)&&(c<f||c===f&&(t.x>a.x||t.x===a.x&&vc(a,t)))&&(a=t,f=c)),t=t.next;while(t!==h);return a}function vc(r,e){return pt(r.prev,r,e.prev)<0&&pt(e.next,r,r.next)<0}function _c(r,e,t,i){var n=r;do n.z===0&&(n.z=xs(n.x,n.y,e,t,i)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next;while(n!==r);n.prevZ.nextZ=null,n.prevZ=null,mc(n)}function mc(r){var e,t,i,n,s,a,o,h,u=1;do{for(t=r,r=null,s=null,a=0;t;){for(a++,i=t,o=0,e=0;e<u&&(o++,i=i.nextZ,!!i);e++);for(h=u;o>0||h>0&&i;)o!==0&&(h===0||!i||t.z<=i.z)?(n=t,t=t.nextZ,o--):(n=i,i=i.nextZ,h--),s?s.nextZ=n:r=n,n.prevZ=s,s=n;t=i}s.nextZ=null,u*=2}while(a>1);return r}function xs(r,e,t,i,n){return r=(r-t)*n|0,e=(e-i)*n|0,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,r|e<<1}function gc(r){var e=r,t=r;do(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next;while(e!==r);return t}function ki(r,e,t,i,n,s,a,o){return(n-a)*(e-o)>=(r-a)*(s-o)&&(r-a)*(i-o)>=(t-a)*(e-o)&&(t-a)*(s-o)>=(n-a)*(i-o)}function yc(r,e){return r.next.i!==e.i&&r.prev.i!==e.i&&!xc(r,e)&&(_r(r,e)&&_r(e,r)&&bc(r,e)&&(pt(r.prev,r,e.prev)||pt(r,e.prev,e))||on(r,e)&&pt(r.prev,r,r.next)>0&&pt(e.prev,e,e.next)>0)}function pt(r,e,t){return(e.y-r.y)*(t.x-e.x)-(e.x-r.x)*(t.y-e.y)}function on(r,e){return r.x===e.x&&r.y===e.y}function th(r,e,t,i){var n=un(pt(r,e,t)),s=un(pt(r,e,i)),a=un(pt(t,i,r)),o=un(pt(t,i,e));return!!(n!==s&&a!==o||n===0&&hn(r,t,e)||s===0&&hn(r,i,e)||a===0&&hn(t,r,i)||o===0&&hn(t,e,i))}function hn(r,e,t){return e.x<=Math.max(r.x,t.x)&&e.x>=Math.min(r.x,t.x)&&e.y<=Math.max(r.y,t.y)&&e.y>=Math.min(r.y,t.y)}function un(r){return r>0?1:r<0?-1:0}function xc(r,e){var t=r;do{if(t.i!==r.i&&t.next.i!==r.i&&t.i!==e.i&&t.next.i!==e.i&&th(t,t.next,r,e))return!0;t=t.next}while(t!==r);return!1}function _r(r,e){return pt(r.prev,r,r.next)<0?pt(r,e,r.next)>=0&&pt(r,r.prev,e)>=0:pt(r,e,r.prev)<0||pt(r,r.next,e)<0}function bc(r,e){var t=r,i=!1,n=(r.x+e.x)/2,s=(r.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&n<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(i=!i),t=t.next;while(t!==r);return i}function eh(r,e){var t=new bs(r.i,r.x,r.y),i=new bs(e.i,e.x,e.y),n=r.next,s=e.prev;return r.next=e,e.prev=r,t.next=n,n.prev=t,i.next=t,t.prev=i,s.next=i,i.prev=s,i}function ih(r,e,t,i){var n=new bs(r,e,t);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function mr(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function bs(r,e,t){this.i=r,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}an.deviation=function(r,e,t,i){var n=e&&e.length,s=n?e[0]*t:r.length,a=Math.abs(Ts(r,0,s,t));if(n)for(var o=0,h=e.length;o<h;o++){var u=e[o]*t,l=o<h-1?e[o+1]*t:r.length;a-=Math.abs(Ts(r,u,l,t))}var f=0;for(o=0;o<i.length;o+=3){var c=i[o]*t,d=i[o+1]*t,v=i[o+2]*t;f+=Math.abs((r[c]-r[v])*(r[d+1]-r[c+1])-(r[c]-r[d])*(r[v+1]-r[c+1]))}return a===0&&f===0?0:Math.abs((f-a)/a)};function Ts(r,e,t,i){for(var n=0,s=e,a=t-i;s<t;s+=i)n+=(r[a]-r[s])*(r[s+1]+r[a+1]),a=s;return n}an.flatten=function(r){for(var e=r[0][0].length,t={vertices:[],holes:[],dimensions:e},i=0,n=0;n<r.length;n++){for(var s=0;s<r[n].length;s++)for(var a=0;a<e;a++)t.vertices.push(r[n][s][a]);n>0&&(i+=r[n-1].length,t.holes.push(i))}return t};var ws={exports:{}};(function(r,e){(function(t){var i=e&&!e.nodeType&&e,n=r&&!r.nodeType&&r,s=typeof cs=="object"&&cs;(s.global===s||s.window===s||s.self===s)&&(t=s);var a,o=2147483647,h=36,u=1,l=26,f=38,c=700,d=72,v=128,p="-",_=/^xn--/,m=/[^\x20-\x7E]/,g=/[\x2E\u3002\uFF0E\uFF61]/g,y={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},b=h-u,x=Math.floor,T=String.fromCharCode,w;function S(R){throw RangeError(y[R])}function E(R,C){for(var B=R.length,Z=[];B--;)Z[B]=C(R[B]);return Z}function P(R,C){var B=R.split("@"),Z="";B.length>1&&(Z=B[0]+"@",R=B[1]),R=R.replace(g,".");var W=R.split("."),J=E(W,C).join(".");return Z+J}function O(R){for(var C=[],B=0,Z=R.length,W,J;B<Z;)W=R.charCodeAt(B++),W>=55296&&W<=56319&&B<Z?(J=R.charCodeAt(B++),(J&64512)==56320?C.push(((W&1023)<<10)+(J&1023)+65536):(C.push(W),B--)):C.push(W);return C}function M(R){return E(R,function(C){var B="";return C>65535&&(C-=65536,B+=T(C>>>10&1023|55296),C=56320|C&1023),B+=T(C),B}).join("")}function F(R){return R-48<10?R-22:R-65<26?R-65:R-97<26?R-97:h}function G(R,C){return R+22+75*(R<26)-((C!=0)<<5)}function A(R,C,B){var Z=0;for(R=B?x(R/c):R>>1,R+=x(R/C);R>b*l>>1;Z+=h)R=x(R/b);return x(Z+(b+1)*R/(R+f))}function I(R){var C=[],B=R.length,Z,W=0,J=v,ut=d,ft,Lt,Gt,St,st,lt,ct,et,Vt;for(ft=R.lastIndexOf(p),ft<0&&(ft=0),Lt=0;Lt<ft;++Lt)R.charCodeAt(Lt)>=128&&S("not-basic"),C.push(R.charCodeAt(Lt));for(Gt=ft>0?ft+1:0;Gt<B;){for(St=W,st=1,lt=h;Gt>=B&&S("invalid-input"),ct=F(R.charCodeAt(Gt++)),(ct>=h||ct>x((o-W)/st))&&S("overflow"),W+=ct*st,et=lt<=ut?u:lt>=ut+l?l:lt-ut,!(ct<et);lt+=h)Vt=h-et,st>x(o/Vt)&&S("overflow"),st*=Vt;Z=C.length+1,ut=A(W-St,Z,St==0),x(W/Z)>o-J&&S("overflow"),J+=x(W/Z),W%=Z,C.splice(W++,0,J)}return M(C)}function N(R){var C,B,Z,W,J,ut,ft,Lt,Gt,St,st,lt=[],ct,et,Vt,qt;for(R=O(R),ct=R.length,C=v,B=0,J=d,ut=0;ut<ct;++ut)st=R[ut],st<128&&lt.push(T(st));for(Z=W=lt.length,W&&lt.push(p);Z<ct;){for(ft=o,ut=0;ut<ct;++ut)st=R[ut],st>=C&&st<ft&&(ft=st);for(et=Z+1,ft-C>x((o-B)/et)&&S("overflow"),B+=(ft-C)*et,C=ft,ut=0;ut<ct;++ut)if(st=R[ut],st<C&&++B>o&&S("overflow"),st==C){for(Lt=B,Gt=h;St=Gt<=J?u:Gt>=J+l?l:Gt-J,!(Lt<St);Gt+=h)qt=Lt-St,Vt=h-St,lt.push(T(G(St+qt%Vt,0))),Lt=x(qt/Vt);lt.push(T(G(Lt,0))),J=A(B,et,Z==W),B=0,++Z}++B,++C}return lt.join("")}function Y(R){return P(R,function(C){return _.test(C)?I(C.slice(4).toLowerCase()):C})}function H(R){return P(R,function(C){return m.test(C)?"xn--"+N(C):C})}if(a={version:"1.3.2",ucs2:{decode:O,encode:M},decode:I,encode:N,toASCII:H,toUnicode:Y},i&&n)if(r.exports==i)n.exports=a;else for(w in a)a.hasOwnProperty(w)&&(i[w]=a[w]);else t.punycode=a})(cs)})(ws,ws.exports);var Tc={isString:function(r){return typeof r=="string"},isObject:function(r){return typeof r=="object"&&r!==null},isNull:function(r){return r===null},isNullOrUndefined:function(r){return r==null}},gr={};function wc(r,e){return Object.prototype.hasOwnProperty.call(r,e)}var Ec=function(r,e,t,i){e=e||"&",t=t||"=";var n={};if(typeof r!="string"||r.length===0)return n;var s=/\+/g;r=r.split(e);var a=1e3;i&&typeof i.maxKeys=="number"&&(a=i.maxKeys);var o=r.length;a>0&&o>a&&(o=a);for(var h=0;h<o;++h){var u=r[h].replace(s,"%20"),l=u.indexOf(t),f,c,d,v;l>=0?(f=u.substr(0,l),c=u.substr(l+1)):(f=u,c=""),d=decodeURIComponent(f),v=decodeURIComponent(c),wc(n,d)?Array.isArray(n[d])?n[d].push(v):n[d]=[n[d],v]:n[d]=v}return n},yr=function(r){switch(typeof r){case"string":return r;case"boolean":return r?"true":"false";case"number":return isFinite(r)?r:"";default:return""}},Sc=function(r,e,t,i){return e=e||"&",t=t||"=",r===null&&(r=void 0),typeof r=="object"?Object.keys(r).map(function(n){var s=encodeURIComponent(yr(n))+t;return Array.isArray(r[n])?r[n].map(function(a){return s+encodeURIComponent(yr(a))}).join(e):s+encodeURIComponent(yr(r[n]))}).join(e):i?encodeURIComponent(yr(i))+t+encodeURIComponent(yr(r)):""};gr.decode=gr.parse=Ec,gr.encode=gr.stringify=Sc;var Pc=ws.exports,Ae=Tc,Rc=ln,Cc=Gc,Oc=Uc;function me(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var Ac=/^([a-z0-9.+-]+:)/i,Ic=/:[0-9]*$/,Mc=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Dc=["<",">",'"',"`"," ","\r",`
6
+ `," "],Fc=["{","}","|","\\","^","`"].concat(Dc),Es=["'"].concat(Fc),rh=["%","/","?",";","#"].concat(Es),nh=["/","?","#"],Nc=255,sh=/^[+a-z0-9A-Z_-]{0,63}$/,Lc=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Bc={javascript:!0,"javascript:":!0},Ss={javascript:!0,"javascript:":!0},Xi={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},Ps=gr;function ln(r,e,t){if(r&&Ae.isObject(r)&&r instanceof me)return r;var i=new me;return i.parse(r,e,t),i}me.prototype.parse=function(r,e,t){if(!Ae.isString(r))throw new TypeError("Parameter 'url' must be a string, not "+typeof r);var i=r.indexOf("?"),n=i!==-1&&i<r.indexOf("#")?"?":"#",s=r.split(n),a=/\\/g;s[0]=s[0].replace(a,"/"),r=s.join(n);var o=r;if(o=o.trim(),!t&&r.split("#").length===1){var h=Mc.exec(o);if(h)return this.path=o,this.href=o,this.pathname=h[1],h[2]?(this.search=h[2],e?this.query=Ps.parse(this.search.substr(1)):this.query=this.search.substr(1)):e&&(this.search="",this.query={}),this}var u=Ac.exec(o);if(u){u=u[0];var l=u.toLowerCase();this.protocol=l,o=o.substr(u.length)}if(t||u||o.match(/^\/\/[^@\/]+@[^@\/]+/)){var f=o.substr(0,2)==="//";f&&!(u&&Ss[u])&&(o=o.substr(2),this.slashes=!0)}if(!Ss[u]&&(f||u&&!Xi[u])){for(var c=-1,d=0;d<nh.length;d++){var v=o.indexOf(nh[d]);v!==-1&&(c===-1||v<c)&&(c=v)}var p,_;c===-1?_=o.lastIndexOf("@"):_=o.lastIndexOf("@",c),_!==-1&&(p=o.slice(0,_),o=o.slice(_+1),this.auth=decodeURIComponent(p)),c=-1;for(var d=0;d<rh.length;d++){var v=o.indexOf(rh[d]);v!==-1&&(c===-1||v<c)&&(c=v)}c===-1&&(c=o.length),this.host=o.slice(0,c),o=o.slice(c),this.parseHost(),this.hostname=this.hostname||"";var m=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!m)for(var g=this.hostname.split(/\./),d=0,y=g.length;d<y;d++){var b=g[d];if(b&&!b.match(sh)){for(var x="",T=0,w=b.length;T<w;T++)b.charCodeAt(T)>127?x+="x":x+=b[T];if(!x.match(sh)){var S=g.slice(0,d),E=g.slice(d+1),P=b.match(Lc);P&&(S.push(P[1]),E.unshift(P[2])),E.length&&(o="/"+E.join(".")+o),this.hostname=S.join(".");break}}}this.hostname.length>Nc?this.hostname="":this.hostname=this.hostname.toLowerCase(),m||(this.hostname=Pc.toASCII(this.hostname));var O=this.port?":"+this.port:"",M=this.hostname||"";this.host=M+O,this.href+=this.host,m&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),o[0]!=="/"&&(o="/"+o))}if(!Bc[l])for(var d=0,y=Es.length;d<y;d++){var F=Es[d];if(o.indexOf(F)!==-1){var G=encodeURIComponent(F);G===F&&(G=escape(F)),o=o.split(F).join(G)}}var A=o.indexOf("#");A!==-1&&(this.hash=o.substr(A),o=o.slice(0,A));var I=o.indexOf("?");if(I!==-1?(this.search=o.substr(I),this.query=o.substr(I+1),e&&(this.query=Ps.parse(this.query)),o=o.slice(0,I)):e&&(this.search="",this.query={}),o&&(this.pathname=o),Xi[l]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var O=this.pathname||"",N=this.search||"";this.path=O+N}return this.href=this.format(),this};function Uc(r){return Ae.isString(r)&&(r=ln(r)),r instanceof me?r.format():me.prototype.format.call(r)}me.prototype.format=function(){var r=this.auth||"";r&&(r=encodeURIComponent(r),r=r.replace(/%3A/i,":"),r+="@");var e=this.protocol||"",t=this.pathname||"",i=this.hash||"",n=!1,s="";this.host?n=r+this.host:this.hostname&&(n=r+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(n+=":"+this.port)),this.query&&Ae.isObject(this.query)&&Object.keys(this.query).length&&(s=Ps.stringify(this.query));var a=this.search||s&&"?"+s||"";return e&&e.substr(-1)!==":"&&(e+=":"),this.slashes||(!e||Xi[e])&&n!==!1?(n="//"+(n||""),t&&t.charAt(0)!=="/"&&(t="/"+t)):n||(n=""),i&&i.charAt(0)!=="#"&&(i="#"+i),a&&a.charAt(0)!=="?"&&(a="?"+a),t=t.replace(/[?#]/g,function(o){return encodeURIComponent(o)}),a=a.replace("#","%23"),e+n+t+a+i};function Gc(r,e){return ln(r,!1,!0).resolve(e)}me.prototype.resolve=function(r){return this.resolveObject(ln(r,!1,!0)).format()},me.prototype.resolveObject=function(r){if(Ae.isString(r)){var e=new me;e.parse(r,!1,!0),r=e}for(var t=new me,i=Object.keys(this),n=0;n<i.length;n++){var s=i[n];t[s]=this[s]}if(t.hash=r.hash,r.href==="")return t.href=t.format(),t;if(r.slashes&&!r.protocol){for(var a=Object.keys(r),o=0;o<a.length;o++){var h=a[o];h!=="protocol"&&(t[h]=r[h])}return Xi[t.protocol]&&t.hostname&&!t.pathname&&(t.path=t.pathname="/"),t.href=t.format(),t}if(r.protocol&&r.protocol!==t.protocol){if(!Xi[r.protocol]){for(var u=Object.keys(r),l=0;l<u.length;l++){var f=u[l];t[f]=r[f]}return t.href=t.format(),t}if(t.protocol=r.protocol,!r.host&&!Ss[r.protocol]){for(var y=(r.pathname||"").split("/");y.length&&!(r.host=y.shift()););r.host||(r.host=""),r.hostname||(r.hostname=""),y[0]!==""&&y.unshift(""),y.length<2&&y.unshift(""),t.pathname=y.join("/")}else t.pathname=r.pathname;if(t.search=r.search,t.query=r.query,t.host=r.host||"",t.auth=r.auth,t.hostname=r.hostname||r.host,t.port=r.port,t.pathname||t.search){var c=t.pathname||"",d=t.search||"";t.path=c+d}return t.slashes=t.slashes||r.slashes,t.href=t.format(),t}var v=t.pathname&&t.pathname.charAt(0)==="/",p=r.host||r.pathname&&r.pathname.charAt(0)==="/",_=p||v||t.host&&r.pathname,m=_,g=t.pathname&&t.pathname.split("/")||[],y=r.pathname&&r.pathname.split("/")||[],b=t.protocol&&!Xi[t.protocol];if(b&&(t.hostname="",t.port=null,t.host&&(g[0]===""?g[0]=t.host:g.unshift(t.host)),t.host="",r.protocol&&(r.hostname=null,r.port=null,r.host&&(y[0]===""?y[0]=r.host:y.unshift(r.host)),r.host=null),_=_&&(y[0]===""||g[0]==="")),p)t.host=r.host||r.host===""?r.host:t.host,t.hostname=r.hostname||r.hostname===""?r.hostname:t.hostname,t.search=r.search,t.query=r.query,g=y;else if(y.length)g||(g=[]),g.pop(),g=g.concat(y),t.search=r.search,t.query=r.query;else if(!Ae.isNullOrUndefined(r.search)){if(b){t.hostname=t.host=g.shift();var x=t.host&&t.host.indexOf("@")>0?t.host.split("@"):!1;x&&(t.auth=x.shift(),t.host=t.hostname=x.shift())}return t.search=r.search,t.query=r.query,(!Ae.isNull(t.pathname)||!Ae.isNull(t.search))&&(t.path=(t.pathname?t.pathname:"")+(t.search?t.search:"")),t.href=t.format(),t}if(!g.length)return t.pathname=null,t.search?t.path="/"+t.search:t.path=null,t.href=t.format(),t;for(var T=g.slice(-1)[0],w=(t.host||r.host||g.length>1)&&(T==="."||T==="..")||T==="",S=0,E=g.length;E>=0;E--)T=g[E],T==="."?g.splice(E,1):T===".."?(g.splice(E,1),S++):S&&(g.splice(E,1),S--);if(!_&&!m)for(;S--;S)g.unshift("..");_&&g[0]!==""&&(!g[0]||g[0].charAt(0)!=="/")&&g.unshift(""),w&&g.join("/").substr(-1)!=="/"&&g.push("");var P=g[0]===""||g[0]&&g[0].charAt(0)==="/";if(b){t.hostname=t.host=P?"":g.length?g.shift():"";var x=t.host&&t.host.indexOf("@")>0?t.host.split("@"):!1;x&&(t.auth=x.shift(),t.host=t.hostname=x.shift())}return _=_||t.host&&g.length,_&&!P&&g.unshift(""),g.length?t.pathname=g.join("/"):(t.pathname=null,t.path=null),(!Ae.isNull(t.pathname)||!Ae.isNull(t.search))&&(t.path=(t.pathname?t.pathname:"")+(t.search?t.search:"")),t.auth=r.auth||t.auth,t.slashes=t.slashes||r.slashes,t.href=t.format(),t},me.prototype.parseHost=function(){var r=this.host,e=Ic.exec(r);e&&(e=e[0],e!==":"&&(this.port=e.substr(1)),r=r.substr(0,r.length-e.length)),r&&(this.hostname=r)};var Hi={parse:Rc,format:Oc,resolve:Cc};L.RETINA_PREFIX=/@([0-9\.]+)x/,L.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var Rs=!1,ah="6.5.8";function kc(){Rs=!0}function Xc(r){var e;if(!Rs){if(L.ADAPTER.getNavigator().userAgent.toLowerCase().indexOf("chrome")>-1){var t=[`
7
+ %c %c %c PixiJS `+ah+" - ✰ "+r+` ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥
8
8
 
9
- `,"background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];(e=globalThis.console).log.apply(e,t)}else globalThis.console&&globalThis.console.log("PixiJS "+sh+" - "+r+" - http://www.pixijs.com/");Rs=!0}}var Cs;function Xc(){return typeof Cs>"u"&&(Cs=function(){var e={stencil:!0,failIfMajorPerformanceCaveat:L.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!L.ADAPTER.getWebGLRenderingContext())return!1;var t=L.ADAPTER.createCanvas(),i=t.getContext("webgl",e)||t.getContext("experimental-webgl",e),n=!!(i&&i.getContextAttributes().stencil);if(i){var s=i.getExtension("WEBGL_lose_context");s&&s.loseContext()}return i=null,n}catch{return!1}}()),Cs}var Hc="#f0f8ff",Wc="#faebd7",zc="#00ffff",Vc="#7fffd4",Yc="#f0ffff",jc="#f5f5dc",Zc="#ffe4c4",qc="#000000",Kc="#ffebcd",$c="#0000ff",Jc="#8a2be2",Qc="#a52a2a",td="#deb887",ed="#5f9ea0",id="#7fff00",rd="#d2691e",nd="#ff7f50",sd="#6495ed",ad="#fff8dc",od="#dc143c",hd="#00ffff",ud="#00008b",ld="#008b8b",fd="#b8860b",cd="#a9a9a9",dd="#006400",pd="#a9a9a9",vd="#bdb76b",_d="#8b008b",md="#556b2f",gd="#ff8c00",yd="#9932cc",xd="#8b0000",bd="#e9967a",Td="#8fbc8f",wd="#483d8b",Ed="#2f4f4f",Sd="#2f4f4f",Pd="#00ced1",Rd="#9400d3",Cd="#ff1493",Od="#00bfff",Ad="#696969",Id="#696969",Md="#1e90ff",Dd="#b22222",Fd="#fffaf0",Nd="#228b22",Ld="#ff00ff",Bd="#dcdcdc",Gd="#f8f8ff",Ud="#daa520",kd="#ffd700",Xd="#808080",Hd="#008000",Wd="#adff2f",zd="#808080",Vd="#f0fff0",Yd="#ff69b4",jd="#cd5c5c",Zd="#4b0082",qd="#fffff0",Kd="#f0e68c",$d="#fff0f5",Jd="#e6e6fa",Qd="#7cfc00",tp="#fffacd",ep="#add8e6",ip="#f08080",rp="#e0ffff",np="#fafad2",sp="#d3d3d3",ap="#90ee90",op="#d3d3d3",hp="#ffb6c1",up="#ffa07a",lp="#20b2aa",fp="#87cefa",cp="#778899",dp="#778899",pp="#b0c4de",vp="#ffffe0",_p="#00ff00",mp="#32cd32",gp="#faf0e6",yp="#ff00ff",xp="#800000",bp="#66cdaa",Tp="#0000cd",wp="#ba55d3",Ep="#9370db",Sp="#3cb371",Pp="#7b68ee",Rp="#00fa9a",Cp="#48d1cc",Op="#c71585",Ap="#191970",Ip="#f5fffa",Mp="#ffe4e1",Dp="#ffe4b5",Fp="#ffdead",Np="#000080",Lp="#fdf5e6",Bp="#808000",Gp="#6b8e23",Up="#ffa500",kp="#ff4500",Xp="#da70d6",Hp="#eee8aa",Wp="#98fb98",zp="#afeeee",Vp="#db7093",Yp="#ffefd5",jp="#ffdab9",Zp="#cd853f",qp="#ffc0cb",Kp="#dda0dd",$p="#b0e0e6",Jp="#800080",Qp="#663399",tv="#ff0000",ev="#bc8f8f",iv="#4169e1",rv="#8b4513",nv="#fa8072",sv="#f4a460",av="#2e8b57",ov="#fff5ee",hv="#a0522d",uv="#c0c0c0",lv="#87ceeb",fv="#6a5acd",cv="#708090",dv="#708090",pv="#fffafa",vv="#00ff7f",_v="#4682b4",mv="#d2b48c",gv="#008080",yv="#d8bfd8",xv="#ff6347",bv="#40e0d0",Tv="#ee82ee",wv="#f5deb3",Ev="#ffffff",Sv="#f5f5f5",Pv="#ffff00",Rv="#9acd32",Cv={aliceblue:Hc,antiquewhite:Wc,aqua:zc,aquamarine:Vc,azure:Yc,beige:jc,bisque:Zc,black:qc,blanchedalmond:Kc,blue:$c,blueviolet:Jc,brown:Qc,burlywood:td,cadetblue:ed,chartreuse:id,chocolate:rd,coral:nd,cornflowerblue:sd,cornsilk:ad,crimson:od,cyan:hd,darkblue:ud,darkcyan:ld,darkgoldenrod:fd,darkgray:cd,darkgreen:dd,darkgrey:pd,darkkhaki:vd,darkmagenta:_d,darkolivegreen:md,darkorange:gd,darkorchid:yd,darkred:xd,darksalmon:bd,darkseagreen:Td,darkslateblue:wd,darkslategray:Ed,darkslategrey:Sd,darkturquoise:Pd,darkviolet:Rd,deeppink:Cd,deepskyblue:Od,dimgray:Ad,dimgrey:Id,dodgerblue:Md,firebrick:Dd,floralwhite:Fd,forestgreen:Nd,fuchsia:Ld,gainsboro:Bd,ghostwhite:Gd,goldenrod:Ud,gold:kd,gray:Xd,green:Hd,greenyellow:Wd,grey:zd,honeydew:Vd,hotpink:Yd,indianred:jd,indigo:Zd,ivory:qd,khaki:Kd,lavenderblush:$d,lavender:Jd,lawngreen:Qd,lemonchiffon:tp,lightblue:ep,lightcoral:ip,lightcyan:rp,lightgoldenrodyellow:np,lightgray:sp,lightgreen:ap,lightgrey:op,lightpink:hp,lightsalmon:up,lightseagreen:lp,lightskyblue:fp,lightslategray:cp,lightslategrey:dp,lightsteelblue:pp,lightyellow:vp,lime:_p,limegreen:mp,linen:gp,magenta:yp,maroon:xp,mediumaquamarine:bp,mediumblue:Tp,mediumorchid:wp,mediumpurple:Ep,mediumseagreen:Sp,mediumslateblue:Pp,mediumspringgreen:Rp,mediumturquoise:Cp,mediumvioletred:Op,midnightblue:Ap,mintcream:Ip,mistyrose:Mp,moccasin:Dp,navajowhite:Fp,navy:Np,oldlace:Lp,olive:Bp,olivedrab:Gp,orange:Up,orangered:kp,orchid:Xp,palegoldenrod:Hp,palegreen:Wp,paleturquoise:zp,palevioletred:Vp,papayawhip:Yp,peachpuff:jp,peru:Zp,pink:qp,plum:Kp,powderblue:$p,purple:Jp,rebeccapurple:Qp,red:tv,rosybrown:ev,royalblue:iv,saddlebrown:rv,salmon:nv,sandybrown:sv,seagreen:av,seashell:ov,sienna:hv,silver:uv,skyblue:lv,slateblue:fv,slategray:cv,slategrey:dv,snow:pv,springgreen:vv,steelblue:_v,tan:mv,teal:gv,thistle:yv,tomato:xv,turquoise:bv,violet:Tv,wheat:wv,white:Ev,whitesmoke:Sv,yellow:Pv,yellowgreen:Rv};function Wi(r,e){return e===void 0&&(e=[]),e[0]=(r>>16&255)/255,e[1]=(r>>8&255)/255,e[2]=(r&255)/255,e}function ah(r){var e=r.toString(16);return e="000000".substring(0,6-e.length)+e,"#"+e}function oh(r){return typeof r=="string"&&(r=Cv[r.toLowerCase()]||r,r[0]==="#"&&(r=r.slice(1))),parseInt(r,16)}function Ov(){for(var r=[],e=[],t=0;t<32;t++)r[t]=t,e[t]=t;r[X.NORMAL_NPM]=X.NORMAL,r[X.ADD_NPM]=X.ADD,r[X.SCREEN_NPM]=X.SCREEN,e[X.NORMAL]=X.NORMAL_NPM,e[X.ADD]=X.ADD_NPM,e[X.SCREEN]=X.SCREEN_NPM;var i=[];return i.push(e),i.push(r),i}var hh=Ov();function uh(r,e){return hh[e?1:0][r]}function Av(r,e,t,i){return t=t||new Float32Array(4),i||i===void 0?(t[0]=r[0]*e,t[1]=r[1]*e,t[2]=r[2]*e):(t[0]=r[0],t[1]=r[1],t[2]=r[2]),t[3]=e,t}function Os(r,e){if(e===1)return(e*255<<24)+r;if(e===0)return 0;var t=r>>16&255,i=r>>8&255,n=r&255;return t=t*e+.5|0,i=i*e+.5|0,n=n*e+.5|0,(e*255<<24)+(t<<16)+(i<<8)+n}function lh(r,e,t,i){return t=t||new Float32Array(4),t[0]=(r>>16&255)/255,t[1]=(r>>8&255)/255,t[2]=(r&255)/255,(i||i===void 0)&&(t[0]*=e,t[1]*=e,t[2]*=e),t[3]=e,t}function Iv(r,e){e===void 0&&(e=null);var t=r*6;if(e=e||new Uint16Array(t),e.length!==t)throw new Error("Out buffer length is incorrect, got "+e.length+" and expected "+t);for(var i=0,n=0;i<t;i+=6,n+=4)e[i+0]=n+0,e[i+1]=n+1,e[i+2]=n+2,e[i+3]=n+0,e[i+4]=n+2,e[i+5]=n+3;return e}function fh(r){if(r.BYTES_PER_ELEMENT===4)return r instanceof Float32Array?"Float32Array":r instanceof Uint32Array?"Uint32Array":"Int32Array";if(r.BYTES_PER_ELEMENT===2){if(r instanceof Uint16Array)return"Uint16Array"}else if(r.BYTES_PER_ELEMENT===1&&r instanceof Uint8Array)return"Uint8Array";return null}function fn(r){return r+=r===0?1:0,--r,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r+1}function ch(r){return!(r&r-1)&&!!r}function dh(r){var e=(r>65535?1:0)<<4;r>>>=e;var t=(r>255?1:0)<<3;return r>>>=t,e|=t,t=(r>15?1:0)<<2,r>>>=t,e|=t,t=(r>3?1:0)<<1,r>>>=t,e|=t,e|r>>1}function zi(r,e,t){var i=r.length,n;if(!(e>=i||t===0)){t=e+t>i?i-e:t;var s=i-t;for(n=e;n<s;++n)r[n]=r[n+t];r.length=s}}function Vi(r){return r===0?0:r<0?-1:1}var Mv=0;function yi(){return++Mv}var ph={};function ge(r,e,t){if(t===void 0&&(t=3),!ph[e]){var i=new Error().stack;typeof i>"u"?console.warn("PixiJS Deprecation Warning: ",e+`
9
+ `,"background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];(e=globalThis.console).log.apply(e,t)}else globalThis.console&&globalThis.console.log("PixiJS "+ah+" - "+r+" - http://www.pixijs.com/");Rs=!0}}var Cs;function Hc(){return typeof Cs>"u"&&(Cs=function(){var e={stencil:!0,failIfMajorPerformanceCaveat:L.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!L.ADAPTER.getWebGLRenderingContext())return!1;var t=L.ADAPTER.createCanvas(),i=t.getContext("webgl",e)||t.getContext("experimental-webgl",e),n=!!(i&&i.getContextAttributes().stencil);if(i){var s=i.getExtension("WEBGL_lose_context");s&&s.loseContext()}return i=null,n}catch{return!1}}()),Cs}var Wc="#f0f8ff",Vc="#faebd7",zc="#00ffff",Yc="#7fffd4",jc="#f0ffff",Zc="#f5f5dc",qc="#ffe4c4",Kc="#000000",$c="#ffebcd",Jc="#0000ff",Qc="#8a2be2",td="#a52a2a",ed="#deb887",id="#5f9ea0",rd="#7fff00",nd="#d2691e",sd="#ff7f50",ad="#6495ed",od="#fff8dc",hd="#dc143c",ud="#00ffff",ld="#00008b",fd="#008b8b",cd="#b8860b",dd="#a9a9a9",pd="#006400",vd="#a9a9a9",_d="#bdb76b",md="#8b008b",gd="#556b2f",yd="#ff8c00",xd="#9932cc",bd="#8b0000",Td="#e9967a",wd="#8fbc8f",Ed="#483d8b",Sd="#2f4f4f",Pd="#2f4f4f",Rd="#00ced1",Cd="#9400d3",Od="#ff1493",Ad="#00bfff",Id="#696969",Md="#696969",Dd="#1e90ff",Fd="#b22222",Nd="#fffaf0",Ld="#228b22",Bd="#ff00ff",Ud="#dcdcdc",Gd="#f8f8ff",kd="#daa520",Xd="#ffd700",Hd="#808080",Wd="#008000",Vd="#adff2f",zd="#808080",Yd="#f0fff0",jd="#ff69b4",Zd="#cd5c5c",qd="#4b0082",Kd="#fffff0",$d="#f0e68c",Jd="#fff0f5",Qd="#e6e6fa",tp="#7cfc00",ep="#fffacd",ip="#add8e6",rp="#f08080",np="#e0ffff",sp="#fafad2",ap="#d3d3d3",op="#90ee90",hp="#d3d3d3",up="#ffb6c1",lp="#ffa07a",fp="#20b2aa",cp="#87cefa",dp="#778899",pp="#778899",vp="#b0c4de",_p="#ffffe0",mp="#00ff00",gp="#32cd32",yp="#faf0e6",xp="#ff00ff",bp="#800000",Tp="#66cdaa",wp="#0000cd",Ep="#ba55d3",Sp="#9370db",Pp="#3cb371",Rp="#7b68ee",Cp="#00fa9a",Op="#48d1cc",Ap="#c71585",Ip="#191970",Mp="#f5fffa",Dp="#ffe4e1",Fp="#ffe4b5",Np="#ffdead",Lp="#000080",Bp="#fdf5e6",Up="#808000",Gp="#6b8e23",kp="#ffa500",Xp="#ff4500",Hp="#da70d6",Wp="#eee8aa",Vp="#98fb98",zp="#afeeee",Yp="#db7093",jp="#ffefd5",Zp="#ffdab9",qp="#cd853f",Kp="#ffc0cb",$p="#dda0dd",Jp="#b0e0e6",Qp="#800080",tv="#663399",ev="#ff0000",iv="#bc8f8f",rv="#4169e1",nv="#8b4513",sv="#fa8072",av="#f4a460",ov="#2e8b57",hv="#fff5ee",uv="#a0522d",lv="#c0c0c0",fv="#87ceeb",cv="#6a5acd",dv="#708090",pv="#708090",vv="#fffafa",_v="#00ff7f",mv="#4682b4",gv="#d2b48c",yv="#008080",xv="#d8bfd8",bv="#ff6347",Tv="#40e0d0",wv="#ee82ee",Ev="#f5deb3",Sv="#ffffff",Pv="#f5f5f5",Rv="#ffff00",Cv="#9acd32",Ov={aliceblue:Wc,antiquewhite:Vc,aqua:zc,aquamarine:Yc,azure:jc,beige:Zc,bisque:qc,black:Kc,blanchedalmond:$c,blue:Jc,blueviolet:Qc,brown:td,burlywood:ed,cadetblue:id,chartreuse:rd,chocolate:nd,coral:sd,cornflowerblue:ad,cornsilk:od,crimson:hd,cyan:ud,darkblue:ld,darkcyan:fd,darkgoldenrod:cd,darkgray:dd,darkgreen:pd,darkgrey:vd,darkkhaki:_d,darkmagenta:md,darkolivegreen:gd,darkorange:yd,darkorchid:xd,darkred:bd,darksalmon:Td,darkseagreen:wd,darkslateblue:Ed,darkslategray:Sd,darkslategrey:Pd,darkturquoise:Rd,darkviolet:Cd,deeppink:Od,deepskyblue:Ad,dimgray:Id,dimgrey:Md,dodgerblue:Dd,firebrick:Fd,floralwhite:Nd,forestgreen:Ld,fuchsia:Bd,gainsboro:Ud,ghostwhite:Gd,goldenrod:kd,gold:Xd,gray:Hd,green:Wd,greenyellow:Vd,grey:zd,honeydew:Yd,hotpink:jd,indianred:Zd,indigo:qd,ivory:Kd,khaki:$d,lavenderblush:Jd,lavender:Qd,lawngreen:tp,lemonchiffon:ep,lightblue:ip,lightcoral:rp,lightcyan:np,lightgoldenrodyellow:sp,lightgray:ap,lightgreen:op,lightgrey:hp,lightpink:up,lightsalmon:lp,lightseagreen:fp,lightskyblue:cp,lightslategray:dp,lightslategrey:pp,lightsteelblue:vp,lightyellow:_p,lime:mp,limegreen:gp,linen:yp,magenta:xp,maroon:bp,mediumaquamarine:Tp,mediumblue:wp,mediumorchid:Ep,mediumpurple:Sp,mediumseagreen:Pp,mediumslateblue:Rp,mediumspringgreen:Cp,mediumturquoise:Op,mediumvioletred:Ap,midnightblue:Ip,mintcream:Mp,mistyrose:Dp,moccasin:Fp,navajowhite:Np,navy:Lp,oldlace:Bp,olive:Up,olivedrab:Gp,orange:kp,orangered:Xp,orchid:Hp,palegoldenrod:Wp,palegreen:Vp,paleturquoise:zp,palevioletred:Yp,papayawhip:jp,peachpuff:Zp,peru:qp,pink:Kp,plum:$p,powderblue:Jp,purple:Qp,rebeccapurple:tv,red:ev,rosybrown:iv,royalblue:rv,saddlebrown:nv,salmon:sv,sandybrown:av,seagreen:ov,seashell:hv,sienna:uv,silver:lv,skyblue:fv,slateblue:cv,slategray:dv,slategrey:pv,snow:vv,springgreen:_v,steelblue:mv,tan:gv,teal:yv,thistle:xv,tomato:bv,turquoise:Tv,violet:wv,wheat:Ev,white:Sv,whitesmoke:Pv,yellow:Rv,yellowgreen:Cv};function Wi(r,e){return e===void 0&&(e=[]),e[0]=(r>>16&255)/255,e[1]=(r>>8&255)/255,e[2]=(r&255)/255,e}function oh(r){var e=r.toString(16);return e="000000".substring(0,6-e.length)+e,"#"+e}function hh(r){return typeof r=="string"&&(r=Ov[r.toLowerCase()]||r,r[0]==="#"&&(r=r.slice(1))),parseInt(r,16)}function Av(){for(var r=[],e=[],t=0;t<32;t++)r[t]=t,e[t]=t;r[X.NORMAL_NPM]=X.NORMAL,r[X.ADD_NPM]=X.ADD,r[X.SCREEN_NPM]=X.SCREEN,e[X.NORMAL]=X.NORMAL_NPM,e[X.ADD]=X.ADD_NPM,e[X.SCREEN]=X.SCREEN_NPM;var i=[];return i.push(e),i.push(r),i}var uh=Av();function lh(r,e){return uh[e?1:0][r]}function Iv(r,e,t,i){return t=t||new Float32Array(4),i||i===void 0?(t[0]=r[0]*e,t[1]=r[1]*e,t[2]=r[2]*e):(t[0]=r[0],t[1]=r[1],t[2]=r[2]),t[3]=e,t}function Os(r,e){if(e===1)return(e*255<<24)+r;if(e===0)return 0;var t=r>>16&255,i=r>>8&255,n=r&255;return t=t*e+.5|0,i=i*e+.5|0,n=n*e+.5|0,(e*255<<24)+(t<<16)+(i<<8)+n}function fh(r,e,t,i){return t=t||new Float32Array(4),t[0]=(r>>16&255)/255,t[1]=(r>>8&255)/255,t[2]=(r&255)/255,(i||i===void 0)&&(t[0]*=e,t[1]*=e,t[2]*=e),t[3]=e,t}function Mv(r,e){e===void 0&&(e=null);var t=r*6;if(e=e||new Uint16Array(t),e.length!==t)throw new Error("Out buffer length is incorrect, got "+e.length+" and expected "+t);for(var i=0,n=0;i<t;i+=6,n+=4)e[i+0]=n+0,e[i+1]=n+1,e[i+2]=n+2,e[i+3]=n+0,e[i+4]=n+2,e[i+5]=n+3;return e}function ch(r){if(r.BYTES_PER_ELEMENT===4)return r instanceof Float32Array?"Float32Array":r instanceof Uint32Array?"Uint32Array":"Int32Array";if(r.BYTES_PER_ELEMENT===2){if(r instanceof Uint16Array)return"Uint16Array"}else if(r.BYTES_PER_ELEMENT===1&&r instanceof Uint8Array)return"Uint8Array";return null}function fn(r){return r+=r===0?1:0,--r,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r+1}function dh(r){return!(r&r-1)&&!!r}function ph(r){var e=(r>65535?1:0)<<4;r>>>=e;var t=(r>255?1:0)<<3;return r>>>=t,e|=t,t=(r>15?1:0)<<2,r>>>=t,e|=t,t=(r>3?1:0)<<1,r>>>=t,e|=t,e|r>>1}function Vi(r,e,t){var i=r.length,n;if(!(e>=i||t===0)){t=e+t>i?i-e:t;var s=i-t;for(n=e;n<s;++n)r[n]=r[n+t];r.length=s}}function zi(r){return r===0?0:r<0?-1:1}var Dv=0;function yi(){return++Dv}var vh={};function ge(r,e,t){if(t===void 0&&(t=3),!vh[e]){var i=new Error().stack;typeof i>"u"?console.warn("PixiJS Deprecation Warning: ",e+`
10
10
  Deprecated since v`+r):(i=i.split(`
11
11
  `).splice(t).join(`
12
12
  `),console.groupCollapsed?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",e+`
13
13
  Deprecated since v`+r),console.warn(i),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",e+`
14
- Deprecated since v`+r),console.warn(i))),ph[e]=!0}}var vh={},Ge=Object.create(null),xi=Object.create(null),_h=function(){function r(e,t,i){this.canvas=L.ADAPTER.createCanvas(),this.context=this.canvas.getContext("2d"),this.resolution=i||L.RESOLUTION,this.resize(e,t)}return r.prototype.clear=function(){this.context.setTransform(1,0,0,1,0,0),this.context.clearRect(0,0,this.canvas.width,this.canvas.height)},r.prototype.resize=function(e,t){this.canvas.width=Math.round(e*this.resolution),this.canvas.height=Math.round(t*this.resolution)},r.prototype.destroy=function(){this.context=null,this.canvas=null},Object.defineProperty(r.prototype,"width",{get:function(){return this.canvas.width},set:function(e){this.canvas.width=Math.round(e)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"height",{get:function(){return this.canvas.height},set:function(e){this.canvas.height=Math.round(e)},enumerable:!1,configurable:!0}),r}();function Dv(r){var e=r.width,t=r.height,i=r.getContext("2d",{willReadFrequently:!0}),n=i.getImageData(0,0,e,t),s=n.data,a=s.length,o={top:null,left:null,right:null,bottom:null},h=null,u,l,f;for(u=0;u<a;u+=4)s[u+3]!==0&&(l=u/4%e,f=~~(u/4/e),o.top===null&&(o.top=f),(o.left===null||l<o.left)&&(o.left=l),(o.right===null||o.right<l)&&(o.right=l+1),(o.bottom===null||o.bottom<f)&&(o.bottom=f));return o.top!==null&&(e=o.right-o.left,t=o.bottom-o.top+1,h=i.getImageData(o.left,o.top,e,t)),{height:t,width:e,data:h}}var cn;function Fv(r,e){if(e===void 0&&(e=globalThis.location),r.indexOf("data:")===0)return"";e=e||globalThis.location,cn||(cn=document.createElement("a")),cn.href=r;var t=Hi.parse(cn.href),i=!t.port&&e.port===""||t.port===e.port;return t.hostname!==e.hostname||!i||t.protocol!==e.protocol?"anonymous":""}function dn(r,e){var t=L.RETINA_PREFIX.exec(r);return t?parseFloat(t[1]):e!==void 0?e:1}L.SORTABLE_CHILDREN=!1;var pn=function(){function r(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null,this.updateID=-1}return r.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},r.prototype.clear=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},r.prototype.getRectangle=function(e){return this.minX>this.maxX||this.minY>this.maxY?Z.EMPTY:(e=e||new Z(0,0,1,1),e.x=this.minX,e.y=this.minY,e.width=this.maxX-this.minX,e.height=this.maxY-this.minY,e)},r.prototype.addPoint=function(e){this.minX=Math.min(this.minX,e.x),this.maxX=Math.max(this.maxX,e.x),this.minY=Math.min(this.minY,e.y),this.maxY=Math.max(this.maxY,e.y)},r.prototype.addPointMatrix=function(e,t){var i=e.a,n=e.b,s=e.c,a=e.d,o=e.tx,h=e.ty,u=i*t.x+s*t.y+o,l=n*t.x+a*t.y+h;this.minX=Math.min(this.minX,u),this.maxX=Math.max(this.maxX,u),this.minY=Math.min(this.minY,l),this.maxY=Math.max(this.maxY,l)},r.prototype.addQuad=function(e){var t=this.minX,i=this.minY,n=this.maxX,s=this.maxY,a=e[0],o=e[1];t=a<t?a:t,i=o<i?o:i,n=a>n?a:n,s=o>s?o:s,a=e[2],o=e[3],t=a<t?a:t,i=o<i?o:i,n=a>n?a:n,s=o>s?o:s,a=e[4],o=e[5],t=a<t?a:t,i=o<i?o:i,n=a>n?a:n,s=o>s?o:s,a=e[6],o=e[7],t=a<t?a:t,i=o<i?o:i,n=a>n?a:n,s=o>s?o:s,this.minX=t,this.minY=i,this.maxX=n,this.maxY=s},r.prototype.addFrame=function(e,t,i,n,s){this.addFrameMatrix(e.worldTransform,t,i,n,s)},r.prototype.addFrameMatrix=function(e,t,i,n,s){var a=e.a,o=e.b,h=e.c,u=e.d,l=e.tx,f=e.ty,c=this.minX,d=this.minY,v=this.maxX,p=this.maxY,_=a*t+h*i+l,m=o*t+u*i+f;c=_<c?_:c,d=m<d?m:d,v=_>v?_:v,p=m>p?m:p,_=a*n+h*i+l,m=o*n+u*i+f,c=_<c?_:c,d=m<d?m:d,v=_>v?_:v,p=m>p?m:p,_=a*t+h*s+l,m=o*t+u*s+f,c=_<c?_:c,d=m<d?m:d,v=_>v?_:v,p=m>p?m:p,_=a*n+h*s+l,m=o*n+u*s+f,c=_<c?_:c,d=m<d?m:d,v=_>v?_:v,p=m>p?m:p,this.minX=c,this.minY=d,this.maxX=v,this.maxY=p},r.prototype.addVertexData=function(e,t,i){for(var n=this.minX,s=this.minY,a=this.maxX,o=this.maxY,h=t;h<i;h+=2){var u=e[h],l=e[h+1];n=u<n?u:n,s=l<s?l:s,a=u>a?u:a,o=l>o?l:o}this.minX=n,this.minY=s,this.maxX=a,this.maxY=o},r.prototype.addVertices=function(e,t,i,n){this.addVerticesMatrix(e.worldTransform,t,i,n)},r.prototype.addVerticesMatrix=function(e,t,i,n,s,a){s===void 0&&(s=0),a===void 0&&(a=s);for(var o=e.a,h=e.b,u=e.c,l=e.d,f=e.tx,c=e.ty,d=this.minX,v=this.minY,p=this.maxX,_=this.maxY,m=i;m<n;m+=2){var g=t[m],y=t[m+1],b=o*g+u*y+f,x=l*y+h*g+c;d=Math.min(d,b-s),p=Math.max(p,b+s),v=Math.min(v,x-a),_=Math.max(_,x+a)}this.minX=d,this.minY=v,this.maxX=p,this.maxY=_},r.prototype.addBounds=function(e){var t=this.minX,i=this.minY,n=this.maxX,s=this.maxY;this.minX=e.minX<t?e.minX:t,this.minY=e.minY<i?e.minY:i,this.maxX=e.maxX>n?e.maxX:n,this.maxY=e.maxY>s?e.maxY:s},r.prototype.addBoundsMask=function(e,t){var i=e.minX>t.minX?e.minX:t.minX,n=e.minY>t.minY?e.minY:t.minY,s=e.maxX<t.maxX?e.maxX:t.maxX,a=e.maxY<t.maxY?e.maxY:t.maxY;if(i<=s&&n<=a){var o=this.minX,h=this.minY,u=this.maxX,l=this.maxY;this.minX=i<o?i:o,this.minY=n<h?n:h,this.maxX=s>u?s:u,this.maxY=a>l?a:l}},r.prototype.addBoundsMatrix=function(e,t){this.addFrameMatrix(t,e.minX,e.minY,e.maxX,e.maxY)},r.prototype.addBoundsArea=function(e,t){var i=e.minX>t.x?e.minX:t.x,n=e.minY>t.y?e.minY:t.y,s=e.maxX<t.x+t.width?e.maxX:t.x+t.width,a=e.maxY<t.y+t.height?e.maxY:t.y+t.height;if(i<=s&&n<=a){var o=this.minX,h=this.minY,u=this.maxX,l=this.maxY;this.minX=i<o?i:o,this.minY=n<h?n:h,this.maxX=s>u?s:u,this.maxY=a>l?a:l}},r.prototype.pad=function(e,t){e===void 0&&(e=0),t===void 0&&(t=e),this.isEmpty()||(this.minX-=e,this.maxX+=e,this.minY-=t,this.maxY+=t)},r.prototype.addFramePad=function(e,t,i,n,s,a){e-=s,t-=a,i+=s,n+=a,this.minX=this.minX<e?this.minX:e,this.maxX=this.maxX>i?this.maxX:i,this.minY=this.minY<t?this.minY:t,this.maxY=this.maxY>n?this.maxY:n},r}();var As=function(r,e){return As=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},As(r,e)};function Is(r,e){As(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Tt=function(r){Is(e,r);function e(){var t=r.call(this)||this;return t.tempDisplayObjectParent=null,t.transform=new Po,t.alpha=1,t.visible=!0,t.renderable=!0,t.cullable=!1,t.cullArea=null,t.parent=null,t.worldAlpha=1,t._lastSortedIndex=0,t._zIndex=0,t.filterArea=null,t.filters=null,t._enabledFilters=null,t._bounds=new pn,t._localBounds=null,t._boundsID=0,t._boundsRect=null,t._localBoundsRect=null,t._mask=null,t._maskRefCount=0,t._destroyed=!1,t.isSprite=!1,t.isMask=!1,t}return e.mixin=function(t){for(var i=Object.keys(t),n=0;n<i.length;++n){var s=i[n];Object.defineProperty(e.prototype,s,Object.getOwnPropertyDescriptor(t,s))}},Object.defineProperty(e.prototype,"destroyed",{get:function(){return this._destroyed},enumerable:!1,configurable:!0}),e.prototype._recursivePostUpdateTransform=function(){this.parent?(this.parent._recursivePostUpdateTransform(),this.transform.updateTransform(this.parent.transform)):this.transform.updateTransform(this._tempDisplayObjectParent.transform)},e.prototype.updateTransform=function(){this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha},e.prototype.getBounds=function(t,i){return t||(this.parent?(this._recursivePostUpdateTransform(),this.updateTransform()):(this.parent=this._tempDisplayObjectParent,this.updateTransform(),this.parent=null)),this._bounds.updateID!==this._boundsID&&(this.calculateBounds(),this._bounds.updateID=this._boundsID),i||(this._boundsRect||(this._boundsRect=new Z),i=this._boundsRect),this._bounds.getRectangle(i)},e.prototype.getLocalBounds=function(t){t||(this._localBoundsRect||(this._localBoundsRect=new Z),t=this._localBoundsRect),this._localBounds||(this._localBounds=new pn);var i=this.transform,n=this.parent;this.parent=null,this.transform=this._tempDisplayObjectParent.transform;var s=this._bounds,a=this._boundsID;this._bounds=this._localBounds;var o=this.getBounds(!1,t);return this.parent=n,this.transform=i,this._bounds=s,this._bounds.updateID+=this._boundsID-a,o},e.prototype.toGlobal=function(t,i,n){return n===void 0&&(n=!1),n||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.apply(t,i)},e.prototype.toLocal=function(t,i,n,s){return i&&(t=i.toGlobal(t,n,s)),s||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.applyInverse(t,n)},e.prototype.setParent=function(t){if(!t||!t.addChild)throw new Error("setParent: Argument must be a Container");return t.addChild(this),t},e.prototype.setTransform=function(t,i,n,s,a,o,h,u,l){return t===void 0&&(t=0),i===void 0&&(i=0),n===void 0&&(n=1),s===void 0&&(s=1),a===void 0&&(a=0),o===void 0&&(o=0),h===void 0&&(h=0),u===void 0&&(u=0),l===void 0&&(l=0),this.position.x=t,this.position.y=i,this.scale.x=n||1,this.scale.y=s||1,this.rotation=a,this.skew.x=o,this.skew.y=h,this.pivot.x=u,this.pivot.y=l,this},e.prototype.destroy=function(t){this.parent&&this.parent.removeChild(this),this._destroyed=!0,this.transform=null,this.parent=null,this._bounds=null,this.mask=null,this.cullArea=null,this.filters=null,this.filterArea=null,this.hitArea=null,this.interactive=!1,this.interactiveChildren=!1,this.emit("destroyed"),this.removeAllListeners()},Object.defineProperty(e.prototype,"_tempDisplayObjectParent",{get:function(){return this.tempDisplayObjectParent===null&&(this.tempDisplayObjectParent=new mh),this.tempDisplayObjectParent},enumerable:!1,configurable:!0}),e.prototype.enableTempParent=function(){var t=this.parent;return this.parent=this._tempDisplayObjectParent,t},e.prototype.disableTempParent=function(t){this.parent=t},Object.defineProperty(e.prototype,"x",{get:function(){return this.position.x},set:function(t){this.transform.position.x=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return this.position.y},set:function(t){this.transform.position.y=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"worldTransform",{get:function(){return this.transform.worldTransform},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"localTransform",{get:function(){return this.transform.localTransform},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"position",{get:function(){return this.transform.position},set:function(t){this.transform.position.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scale",{get:function(){return this.transform.scale},set:function(t){this.transform.scale.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pivot",{get:function(){return this.transform.pivot},set:function(t){this.transform.pivot.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"skew",{get:function(){return this.transform.skew},set:function(t){this.transform.skew.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rotation",{get:function(){return this.transform.rotation},set:function(t){this.transform.rotation=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"angle",{get:function(){return this.transform.rotation*Tf},set:function(t){this.transform.rotation=t*wf},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"zIndex",{get:function(){return this._zIndex},set:function(t){this._zIndex=t,this.parent&&(this.parent.sortDirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"worldVisible",{get:function(){var t=this;do{if(!t.visible)return!1;t=t.parent}while(t);return!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mask",{get:function(){return this._mask},set:function(t){if(this._mask!==t){if(this._mask){var i=this._mask.isMaskData?this._mask.maskObject:this._mask;i&&(i._maskRefCount--,i._maskRefCount===0&&(i.renderable=!0,i.isMask=!1))}if(this._mask=t,this._mask){var i=this._mask.isMaskData?this._mask.maskObject:this._mask;i&&(i._maskRefCount===0&&(i.renderable=!1,i.isMask=!0),i._maskRefCount++)}}},enumerable:!1,configurable:!0}),e}(pr),mh=function(r){Is(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.sortDirty=null,t}return e}(Tt);Tt.prototype.displayObjectUpdateTransform=Tt.prototype.updateTransform;function Nv(r,e){return r.zIndex===e.zIndex?r._lastSortedIndex-e._lastSortedIndex:r.zIndex-e.zIndex}var yt=function(r){Is(e,r);function e(){var t=r.call(this)||this;return t.children=[],t.sortableChildren=L.SORTABLE_CHILDREN,t.sortDirty=!1,t}return e.prototype.onChildrenChange=function(t){},e.prototype.addChild=function(){for(var t=arguments,i=[],n=0;n<arguments.length;n++)i[n]=t[n];if(i.length>1)for(var s=0;s<i.length;s++)this.addChild(i[s]);else{var a=i[0];a.parent&&a.parent.removeChild(a),a.parent=this,this.sortDirty=!0,a.transform._parentID=-1,this.children.push(a),this._boundsID++,this.onChildrenChange(this.children.length-1),this.emit("childAdded",a,this,this.children.length-1),a.emit("added",this)}return i[0]},e.prototype.addChildAt=function(t,i){if(i<0||i>this.children.length)throw new Error(t+"addChildAt: The index "+i+" supplied is out of bounds "+this.children.length);return t.parent&&t.parent.removeChild(t),t.parent=this,this.sortDirty=!0,t.transform._parentID=-1,this.children.splice(i,0,t),this._boundsID++,this.onChildrenChange(i),t.emit("added",this),this.emit("childAdded",t,this,i),t},e.prototype.swapChildren=function(t,i){if(t!==i){var n=this.getChildIndex(t),s=this.getChildIndex(i);this.children[n]=i,this.children[s]=t,this.onChildrenChange(n<s?n:s)}},e.prototype.getChildIndex=function(t){var i=this.children.indexOf(t);if(i===-1)throw new Error("The supplied DisplayObject must be a child of the caller");return i},e.prototype.setChildIndex=function(t,i){if(i<0||i>=this.children.length)throw new Error("The index "+i+" supplied is out of bounds "+this.children.length);var n=this.getChildIndex(t);zi(this.children,n,1),this.children.splice(i,0,t),this.onChildrenChange(i)},e.prototype.getChildAt=function(t){if(t<0||t>=this.children.length)throw new Error("getChildAt: Index ("+t+") does not exist.");return this.children[t]},e.prototype.removeChild=function(){for(var t=arguments,i=[],n=0;n<arguments.length;n++)i[n]=t[n];if(i.length>1)for(var s=0;s<i.length;s++)this.removeChild(i[s]);else{var a=i[0],o=this.children.indexOf(a);if(o===-1)return null;a.parent=null,a.transform._parentID=-1,zi(this.children,o,1),this._boundsID++,this.onChildrenChange(o),a.emit("removed",this),this.emit("childRemoved",a,this,o)}return i[0]},e.prototype.removeChildAt=function(t){var i=this.getChildAt(t);return i.parent=null,i.transform._parentID=-1,zi(this.children,t,1),this._boundsID++,this.onChildrenChange(t),i.emit("removed",this),this.emit("childRemoved",i,this,t),i},e.prototype.removeChildren=function(t,i){t===void 0&&(t=0),i===void 0&&(i=this.children.length);var n=t,s=i,a=s-n,o;if(a>0&&a<=s){o=this.children.splice(n,a);for(var h=0;h<o.length;++h)o[h].parent=null,o[h].transform&&(o[h].transform._parentID=-1);this._boundsID++,this.onChildrenChange(t);for(var h=0;h<o.length;++h)o[h].emit("removed",this),this.emit("childRemoved",o[h],this,h);return o}else if(a===0&&this.children.length===0)return[];throw new RangeError("removeChildren: numeric values are outside the acceptable range.")},e.prototype.sortChildren=function(){for(var t=!1,i=0,n=this.children.length;i<n;++i){var s=this.children[i];s._lastSortedIndex=i,!t&&s.zIndex!==0&&(t=!0)}t&&this.children.length>1&&this.children.sort(Nv),this.sortDirty=!1},e.prototype.updateTransform=function(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(var t=0,i=this.children.length;t<i;++t){var n=this.children[t];n.visible&&n.updateTransform()}},e.prototype.calculateBounds=function(){this._bounds.clear(),this._calculateBounds();for(var t=0;t<this.children.length;t++){var i=this.children[t];if(!(!i.visible||!i.renderable))if(i.calculateBounds(),i._mask){var n=i._mask.isMaskData?i._mask.maskObject:i._mask;n?(n.calculateBounds(),this._bounds.addBoundsMask(i._bounds,n._bounds)):this._bounds.addBounds(i._bounds)}else i.filterArea?this._bounds.addBoundsArea(i._bounds,i.filterArea):this._bounds.addBounds(i._bounds)}this._bounds.updateID=this._boundsID},e.prototype.getLocalBounds=function(t,i){i===void 0&&(i=!1);var n=r.prototype.getLocalBounds.call(this,t);if(!i)for(var s=0,a=this.children.length;s<a;++s){var o=this.children[s];o.visible&&o.updateTransform()}return n},e.prototype._calculateBounds=function(){},e.prototype._renderWithCulling=function(t){var i=t.renderTexture.sourceFrame;if(i.width>0&&i.height>0){var n,s;if(this.cullArea?(n=this.cullArea,s=this.worldTransform):this._render!==e.prototype._render&&(n=this.getBounds(!0)),n&&i.intersects(n,s))this._render(t);else if(this.cullArea)return;for(var a=0,o=this.children.length;a<o;++a){var h=this.children[a],u=h.cullable;h.cullable=u||!this.cullArea,h.render(t),h.cullable=u}}},e.prototype.render=function(t){if(!(!this.visible||this.worldAlpha<=0||!this.renderable))if(this._mask||this.filters&&this.filters.length)this.renderAdvanced(t);else if(this.cullable)this._renderWithCulling(t);else{this._render(t);for(var i=0,n=this.children.length;i<n;++i)this.children[i].render(t)}},e.prototype.renderAdvanced=function(t){var i=this.filters,n=this._mask;if(i){this._enabledFilters||(this._enabledFilters=[]),this._enabledFilters.length=0;for(var s=0;s<i.length;s++)i[s].enabled&&this._enabledFilters.push(i[s])}var a=i&&this._enabledFilters&&this._enabledFilters.length||n&&(!n.isMaskData||n.enabled&&(n.autoDetect||n.type!==Pt.NONE));if(a&&t.batch.flush(),i&&this._enabledFilters&&this._enabledFilters.length&&t.filter.push(this,this._enabledFilters),n&&t.mask.push(this,this._mask),this.cullable)this._renderWithCulling(t);else{this._render(t);for(var s=0,o=this.children.length;s<o;++s)this.children[s].render(t)}a&&t.batch.flush(),n&&t.mask.pop(this),i&&this._enabledFilters&&this._enabledFilters.length&&t.filter.pop()},e.prototype._render=function(t){},e.prototype.destroy=function(t){r.prototype.destroy.call(this),this.sortDirty=!1;var i=typeof t=="boolean"?t:t&&t.children,n=this.removeChildren(0,this.children.length);if(i)for(var s=0;s<n.length;++s)n[s].destroy(t)},Object.defineProperty(e.prototype,"width",{get:function(){return this.scale.x*this.getLocalBounds().width},set:function(t){var i=this.getLocalBounds().width;i!==0?this.scale.x=t/i:this.scale.x=1,this._width=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.scale.y*this.getLocalBounds().height},set:function(t){var i=this.getLocalBounds().height;i!==0?this.scale.y=t/i:this.scale.y=1,this._height=t},enumerable:!1,configurable:!0}),e}(Tt);yt.prototype.containerUpdateTransform=yt.prototype.updateTransform;var xr=function(){return xr=Object.assign||function(e){for(var t=arguments,i,n=1,s=arguments.length;n<s;n++){i=t[n];for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(e[a]=i[a])}return e},xr.apply(this,arguments)},nt;(function(r){r.Application="application",r.RendererPlugin="renderer-webgl-plugin",r.CanvasRendererPlugin="renderer-canvas-plugin",r.Loader="loader",r.LoadParser="load-parser",r.ResolveParser="resolve-parser",r.CacheParser="cache-parser",r.DetectionParser="detection-parser"})(nt||(nt={}));var gh=function(r){if(typeof r=="function"||typeof r=="object"&&r.extension){if(!r.extension)throw new Error("Extension class must have an extension object");var e=typeof r.extension!="object"?{type:r.extension}:r.extension;r=xr(xr({},e),{ref:r})}if(typeof r=="object")r=xr({},r);else throw new Error("Invalid extension type");return typeof r.type=="string"&&(r.type=[r.type]),r},Ue={_addHandlers:null,_removeHandlers:null,_queue:{},remove:function(){for(var r=arguments,e=this,t=[],i=0;i<arguments.length;i++)t[i]=r[i];return t.map(gh).forEach(function(n){n.type.forEach(function(s){var a,o;return(o=(a=e._removeHandlers)[s])===null||o===void 0?void 0:o.call(a,n)})}),this},add:function(){for(var r=arguments,e=this,t=[],i=0;i<arguments.length;i++)t[i]=r[i];return t.map(gh).forEach(function(n){n.type.forEach(function(s){var a=e._addHandlers,o=e._queue;a[s]?a[s](n):(o[s]=o[s]||[],o[s].push(n))})}),this},handle:function(r,e,t){var i=this._addHandlers=this._addHandlers||{},n=this._removeHandlers=this._removeHandlers||{};if(i[r]||n[r])throw new Error("Extension type "+r+" already has a handler");i[r]=e,n[r]=t;var s=this._queue;return s[r]&&(s[r].forEach(function(a){return e(a)}),delete s[r]),this},handleByMap:function(r,e){return this.handle(r,function(t){e[t.name]=t.ref},function(t){delete e[t.name]})},handleByList:function(r,e){return this.handle(r,function(t){var i,n;e.push(t.ref),r===nt.Loader&&((n=(i=t.ref).add)===null||n===void 0||n.call(i))},function(t){var i=e.indexOf(t.ref);i!==-1&&e.splice(i,1)})}};var Bt=function(){function r(e){this.items=[],this._name=e,this._aliasCount=0}return r.prototype.emit=function(e,t,i,n,s,a,o,h){if(arguments.length>8)throw new Error("max arguments reached");var u=this,l=u.name,f=u.items;this._aliasCount++;for(var c=0,d=f.length;c<d;c++)f[c][l](e,t,i,n,s,a,o,h);return f===this.items&&this._aliasCount--,this},r.prototype.ensureNonAliasedItems=function(){this._aliasCount>0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))},r.prototype.add=function(e){return e[this._name]&&(this.ensureNonAliasedItems(),this.remove(e),this.items.push(e)),this},r.prototype.remove=function(e){var t=this.items.indexOf(e);return t!==-1&&(this.ensureNonAliasedItems(),this.items.splice(t,1)),this},r.prototype.contains=function(e){return this.items.indexOf(e)!==-1},r.prototype.removeAll=function(){return this.ensureNonAliasedItems(),this.items.length=0,this},r.prototype.destroy=function(){this.removeAll(),this.items=null,this._name=null},Object.defineProperty(r.prototype,"empty",{get:function(){return this.items.length===0},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"name",{get:function(){return this._name},enumerable:!1,configurable:!0}),r}();Object.defineProperties(Bt.prototype,{dispatch:{value:Bt.prototype.emit},run:{value:Bt.prototype.emit}});L.TARGET_FPMS=.06;var re;(function(r){r[r.INTERACTION=50]="INTERACTION",r[r.HIGH=25]="HIGH",r[r.NORMAL=0]="NORMAL",r[r.LOW=-25]="LOW",r[r.UTILITY=-50]="UTILITY"})(re||(re={}));var Ms=function(){function r(e,t,i,n){t===void 0&&(t=null),i===void 0&&(i=0),n===void 0&&(n=!1),this.next=null,this.previous=null,this._destroyed=!1,this.fn=e,this.context=t,this.priority=i,this.once=n}return r.prototype.match=function(e,t){return t===void 0&&(t=null),this.fn===e&&this.context===t},r.prototype.emit=function(e){this.fn&&(this.context?this.fn.call(this.context,e):this.fn(e));var t=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),t},r.prototype.connect=function(e){this.previous=e,e.next&&(e.next.previous=this),this.next=e.next,e.next=this},r.prototype.destroy=function(e){e===void 0&&(e=!1),this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);var t=this.next;return this.next=e?null:t,this.previous=null,t},r}(),Ft=function(){function r(){var e=this;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 Ms(null,null,1/0),this.deltaMS=1/L.TARGET_FPMS,this.elapsedMS=1/L.TARGET_FPMS,this._tick=function(t){e._requestId=null,e.started&&(e.update(t),e.started&&e._requestId===null&&e._head.next&&(e._requestId=requestAnimationFrame(e._tick)))}}return r.prototype._requestIfNeeded=function(){this._requestId===null&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))},r.prototype._cancelIfNeeded=function(){this._requestId!==null&&(cancelAnimationFrame(this._requestId),this._requestId=null)},r.prototype._startIfPossible=function(){this.started?this._requestIfNeeded():this.autoStart&&this.start()},r.prototype.add=function(e,t,i){return i===void 0&&(i=re.NORMAL),this._addListener(new Ms(e,t,i))},r.prototype.addOnce=function(e,t,i){return i===void 0&&(i=re.NORMAL),this._addListener(new Ms(e,t,i,!0))},r.prototype._addListener=function(e){var t=this._head.next,i=this._head;if(!t)e.connect(i);else{for(;t;){if(e.priority>t.priority){e.connect(i);break}i=t,t=t.next}e.previous||e.connect(i)}return this._startIfPossible(),this},r.prototype.remove=function(e,t){for(var i=this._head.next;i;)i.match(e,t)?i=i.destroy():i=i.next;return this._head.next||this._cancelIfNeeded(),this},Object.defineProperty(r.prototype,"count",{get:function(){if(!this._head)return 0;for(var e=0,t=this._head;t=t.next;)e++;return e},enumerable:!1,configurable:!0}),r.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},r.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},r.prototype.destroy=function(){if(!this._protected){this.stop();for(var e=this._head.next;e;)e=e.destroy(!0);this._head.destroy(),this._head=null}},r.prototype.update=function(e){e===void 0&&(e=performance.now());var t;if(e>this.lastTime){if(t=this.elapsedMS=e-this.lastTime,t>this._maxElapsedMS&&(t=this._maxElapsedMS),t*=this.speed,this._minElapsedMS){var i=e-this._lastFrame|0;if(i<this._minElapsedMS)return;this._lastFrame=e-i%this._minElapsedMS}this.deltaMS=t,this.deltaTime=this.deltaMS*L.TARGET_FPMS;for(var n=this._head,s=n.next;s;)s=s.emit(this.deltaTime);n.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=e},Object.defineProperty(r.prototype,"FPS",{get:function(){return 1e3/this.elapsedMS},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"minFPS",{get:function(){return 1e3/this._maxElapsedMS},set:function(e){var t=Math.min(this.maxFPS,e),i=Math.min(Math.max(0,t)/1e3,L.TARGET_FPMS);this._maxElapsedMS=1/i},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"maxFPS",{get:function(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0},set:function(e){if(e===0)this._minElapsedMS=0;else{var t=Math.max(this.minFPS,e);this._minElapsedMS=1/(t/1e3)}},enumerable:!1,configurable:!0}),Object.defineProperty(r,"shared",{get:function(){if(!r._shared){var e=r._shared=new r;e.autoStart=!0,e._protected=!0}return r._shared},enumerable:!1,configurable:!0}),Object.defineProperty(r,"system",{get:function(){if(!r._system){var e=r._system=new r;e.autoStart=!0,e._protected=!0}return r._system},enumerable:!1,configurable:!0}),r}(),Lv=function(){function r(){}return r.init=function(e){var t=this;e=Object.assign({autoStart:!0,sharedTicker:!1},e),Object.defineProperty(this,"ticker",{set:function(i){this._ticker&&this._ticker.remove(this.render,this),this._ticker=i,i&&i.add(this.render,this,re.LOW)},get:function(){return this._ticker}}),this.stop=function(){t._ticker.stop()},this.start=function(){t._ticker.start()},this._ticker=null,this.ticker=e.sharedTicker?Ft.shared:new Ft,e.autoStart&&this.start()},r.destroy=function(){if(this._ticker){var e=this._ticker;this.ticker=null,e.destroy()}},r.extension=nt.Application,r}();L.PREFER_ENV=Oe.any?Le.WEBGL:Le.WEBGL2,L.STRICT_TEXTURE_CACHE=!1;var Ds=[];function yh(r,e){if(!r)return null;var t="";if(typeof r=="string"){var i=/\.(\w{3,4})(?:$|\?|#)/i.exec(r);i&&(t=i[1].toLowerCase())}for(var n=Ds.length-1;n>=0;--n){var s=Ds[n];if(s.test&&s.test(r,t))return new s(r,e)}throw new Error("Unrecognized source type to auto-detect Resource")}var Fs=function(r,e){return Fs=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},Fs(r,e)};function ht(r,e){Fs(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Ns=function(){return Ns=Object.assign||function(e){for(var t=arguments,i,n=1,s=arguments.length;n<s;n++){i=t[n];for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(e[a]=i[a])}return e},Ns.apply(this,arguments)};function Bv(r,e){var t={};for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&e.indexOf(i)<0&&(t[i]=r[i]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(r);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(r,i[n])&&(t[i[n]]=r[i[n]]);return t}var br=function(){function r(e,t){e===void 0&&(e=0),t===void 0&&(t=0),this._width=e,this._height=t,this.destroyed=!1,this.internal=!1,this.onResize=new Bt("setRealSize"),this.onUpdate=new Bt("update"),this.onError=new Bt("onError")}return r.prototype.bind=function(e){this.onResize.add(e),this.onUpdate.add(e),this.onError.add(e),(this._width||this._height)&&this.onResize.emit(this._width,this._height)},r.prototype.unbind=function(e){this.onResize.remove(e),this.onUpdate.remove(e),this.onError.remove(e)},r.prototype.resize=function(e,t){(e!==this._width||t!==this._height)&&(this._width=e,this._height=t,this.onResize.emit(e,t))},Object.defineProperty(r.prototype,"valid",{get:function(){return!!this._width&&!!this._height},enumerable:!1,configurable:!0}),r.prototype.update=function(){this.destroyed||this.onUpdate.emit()},r.prototype.load=function(){return Promise.resolve(this)},Object.defineProperty(r.prototype,"width",{get:function(){return this._width},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"height",{get:function(){return this._height},enumerable:!1,configurable:!0}),r.prototype.style=function(e,t,i){return!1},r.prototype.dispose=function(){},r.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.dispose(),this.onError.removeAll(),this.onError=null,this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null)},r.test=function(e,t){return!1},r}(),Tr=function(r){ht(e,r);function e(t,i){var n=this,s=i||{},a=s.width,o=s.height;if(!a||!o)throw new Error("BufferResource width or height invalid");return n=r.call(this,a,o)||this,n.data=t,n}return e.prototype.upload=function(t,i,n){var s=t.gl;s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i.alphaMode===ve.UNPACK);var a=i.realWidth,o=i.realHeight;return n.width===a&&n.height===o?s.texSubImage2D(i.target,0,0,0,a,o,i.format,n.type,this.data):(n.width=a,n.height=o,s.texImage2D(i.target,0,n.internalFormat,a,o,0,i.format,n.type,this.data)),!0},e.prototype.dispose=function(){this.data=null},e.test=function(t){return t instanceof Float32Array||t instanceof Uint8Array||t instanceof Uint32Array},e}(br),Gv={scaleMode:Pe.NEAREST,format:M.RGBA,alphaMode:ve.NPM},Q=function(r){ht(e,r);function e(t,i){t===void 0&&(t=null),i===void 0&&(i=null);var n=r.call(this)||this;i=i||{};var s=i.alphaMode,a=i.mipmap,o=i.anisotropicLevel,h=i.scaleMode,u=i.width,l=i.height,f=i.wrapMode,c=i.format,d=i.type,v=i.target,p=i.resolution,_=i.resourceOptions;return t&&!(t instanceof br)&&(t=yh(t,_),t.internal=!0),n.resolution=p||L.RESOLUTION,n.width=Math.round((u||0)*n.resolution)/n.resolution,n.height=Math.round((l||0)*n.resolution)/n.resolution,n._mipmap=a!==void 0?a:L.MIPMAP_TEXTURES,n.anisotropicLevel=o!==void 0?o:L.ANISOTROPIC_LEVEL,n._wrapMode=f||L.WRAP_MODE,n._scaleMode=h!==void 0?h:L.SCALE_MODE,n.format=c||M.RGBA,n.type=d||k.UNSIGNED_BYTE,n.target=v||mi.TEXTURE_2D,n.alphaMode=s!==void 0?s:ve.UNPACK,n.uid=yi(),n.touched=0,n.isPowerOfTwo=!1,n._refreshPOT(),n._glTextures={},n.dirtyId=0,n.dirtyStyleId=0,n.cacheId=null,n.valid=u>0&&l>0,n.textureCacheIds=[],n.destroyed=!1,n.resource=null,n._batchEnabled=0,n._batchLocation=0,n.parentTextureArray=null,n.setResource(t),n}return Object.defineProperty(e.prototype,"realWidth",{get:function(){return Math.round(this.width*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"realHeight",{get:function(){return Math.round(this.height*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mipmap",{get:function(){return this._mipmap},set:function(t){this._mipmap!==t&&(this._mipmap=t,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scaleMode",{get:function(){return this._scaleMode},set:function(t){this._scaleMode!==t&&(this._scaleMode=t,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"wrapMode",{get:function(){return this._wrapMode},set:function(t){this._wrapMode!==t&&(this._wrapMode=t,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),e.prototype.setStyle=function(t,i){var n;return t!==void 0&&t!==this.scaleMode&&(this.scaleMode=t,n=!0),i!==void 0&&i!==this.mipmap&&(this.mipmap=i,n=!0),n&&this.dirtyStyleId++,this},e.prototype.setSize=function(t,i,n){return n=n||this.resolution,this.setRealSize(t*n,i*n,n)},e.prototype.setRealSize=function(t,i,n){return this.resolution=n||this.resolution,this.width=Math.round(t)/this.resolution,this.height=Math.round(i)/this.resolution,this._refreshPOT(),this.update(),this},e.prototype._refreshPOT=function(){this.isPowerOfTwo=ch(this.realWidth)&&ch(this.realHeight)},e.prototype.setResolution=function(t){var i=this.resolution;return i===t?this:(this.resolution=t,this.valid&&(this.width=Math.round(this.width*i)/t,this.height=Math.round(this.height*i)/t,this.emit("update",this)),this._refreshPOT(),this)},e.prototype.setResource=function(t){if(this.resource===t)return this;if(this.resource)throw new Error("Resource can be set only once");return t.bind(this),this.resource=t,this},e.prototype.update=function(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))},e.prototype.onError=function(t){this.emit("error",this,t)},e.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete xi[this.cacheId],delete Ge[this.cacheId],this.cacheId=null),this.dispose(),e.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},e.prototype.dispose=function(){this.emit("dispose",this)},e.prototype.castToBaseTexture=function(){return this},e.from=function(t,i,n){n===void 0&&(n=L.STRICT_TEXTURE_CACHE);var s=typeof t=="string",a=null;if(s)a=t;else{if(!t._pixiId){var o=i&&i.pixiIdPrefix||"pixiid";t._pixiId=o+"_"+yi()}a=t._pixiId}var h=xi[a];if(s&&n&&!h)throw new Error('The cacheId "'+a+'" does not exist in BaseTextureCache.');return h||(h=new e(t,i),h.cacheId=a,e.addToCache(h,a)),h},e.fromBuffer=function(t,i,n,s){t=t||new Float32Array(i*n*4);var a=new Tr(t,{width:i,height:n}),o=t instanceof Float32Array?k.FLOAT:k.UNSIGNED_BYTE;return new e(a,Object.assign({},Gv,s||{width:i,height:n,type:o}))},e.addToCache=function(t,i){i&&(t.textureCacheIds.indexOf(i)===-1&&t.textureCacheIds.push(i),xi[i]&&console.warn("BaseTexture added to the cache with an id ["+i+"] that already had an entry"),xi[i]=t)},e.removeFromCache=function(t){if(typeof t=="string"){var i=xi[t];if(i){var n=i.textureCacheIds.indexOf(t);return n>-1&&i.textureCacheIds.splice(n,1),delete xi[t],i}}else if(t&&t.textureCacheIds){for(var s=0;s<t.textureCacheIds.length;++s)delete xi[t.textureCacheIds[s]];return t.textureCacheIds.length=0,t}return null},e._globalBatch=0,e}(pr),xh=function(r){ht(e,r);function e(t,i){var n=this,s=i||{},a=s.width,o=s.height;n=r.call(this,a,o)||this,n.items=[],n.itemDirtyIds=[];for(var h=0;h<t;h++){var u=new Q;n.items.push(u),n.itemDirtyIds.push(-2)}return n.length=t,n._load=null,n.baseTexture=null,n}return e.prototype.initFromArray=function(t,i){for(var n=0;n<this.length;n++)t[n]&&(t[n].castToBaseTexture?this.addBaseTextureAt(t[n].castToBaseTexture(),n):t[n]instanceof br?this.addResourceAt(t[n],n):this.addResourceAt(yh(t[n],i),n))},e.prototype.dispose=function(){for(var t=0,i=this.length;t<i;t++)this.items[t].destroy();this.items=null,this.itemDirtyIds=null,this._load=null},e.prototype.addResourceAt=function(t,i){if(!this.items[i])throw new Error("Index "+i+" is out of bounds");return t.valid&&!this.valid&&this.resize(t.width,t.height),this.items[i].setResource(t),this},e.prototype.bind=function(t){if(this.baseTexture!==null)throw new Error("Only one base texture per TextureArray is allowed");r.prototype.bind.call(this,t);for(var i=0;i<this.length;i++)this.items[i].parentTextureArray=t,this.items[i].on("update",t.update,t)},e.prototype.unbind=function(t){r.prototype.unbind.call(this,t);for(var i=0;i<this.length;i++)this.items[i].parentTextureArray=null,this.items[i].off("update",t.update,t)},e.prototype.load=function(){var t=this;if(this._load)return this._load;var i=this.items.map(function(s){return s.resource}).filter(function(s){return s}),n=i.map(function(s){return s.load()});return this._load=Promise.all(n).then(function(){var s=t.items[0],a=s.realWidth,o=s.realHeight;return t.resize(a,o),Promise.resolve(t)}),this._load},e}(br),Uv=function(r){ht(e,r);function e(t,i){var n=this,s=i||{},a=s.width,o=s.height,h,u;return Array.isArray(t)?(h=t,u=t.length):u=t,n=r.call(this,u,{width:a,height:o})||this,h&&n.initFromArray(h,i),n}return e.prototype.addBaseTextureAt=function(t,i){if(t.resource)this.addResourceAt(t.resource,i);else throw new Error("ArrayResource does not support RenderTexture");return this},e.prototype.bind=function(t){r.prototype.bind.call(this,t),t.target=mi.TEXTURE_2D_ARRAY},e.prototype.upload=function(t,i,n){var s=this,a=s.length,o=s.itemDirtyIds,h=s.items,u=t.gl;n.dirtyId<0&&u.texImage3D(u.TEXTURE_2D_ARRAY,0,n.internalFormat,this._width,this._height,a,0,i.format,n.type,null);for(var l=0;l<a;l++){var f=h[l];o[l]<f.dirtyId&&(o[l]=f.dirtyId,f.valid&&u.texSubImage3D(u.TEXTURE_2D_ARRAY,0,0,0,l,f.resource.width,f.resource.height,1,i.format,n.type,f.resource.source))}return!0},e}(xh),Ke=function(r){ht(e,r);function e(t){var i=this,n=t,s=n.naturalWidth||n.videoWidth||n.width,a=n.naturalHeight||n.videoHeight||n.height;return i=r.call(this,s,a)||this,i.source=t,i.noSubImage=!1,i}return e.crossOrigin=function(t,i,n){n===void 0&&i.indexOf("data:")!==0?t.crossOrigin=Fv(i):n!==!1&&(t.crossOrigin=typeof n=="string"?n:"anonymous")},e.prototype.upload=function(t,i,n,s){var a=t.gl,o=i.realWidth,h=i.realHeight;if(s=s||this.source,s instanceof HTMLImageElement){if(!s.complete||s.naturalWidth===0)return!1}else if(s instanceof HTMLVideoElement&&s.readyState<=1)return!1;return a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i.alphaMode===ve.UNPACK),!this.noSubImage&&i.target===a.TEXTURE_2D&&n.width===o&&n.height===h?a.texSubImage2D(a.TEXTURE_2D,0,0,0,i.format,n.type,s):(n.width=o,n.height=h,a.texImage2D(i.target,0,n.internalFormat,i.format,n.type,s)),!0},e.prototype.update=function(){if(!this.destroyed){var t=this.source,i=t.naturalWidth||t.videoWidth||t.width,n=t.naturalHeight||t.videoHeight||t.height;this.resize(i,n),r.prototype.update.call(this)}},e.prototype.dispose=function(){this.source=null},e}(br),kv=function(r){ht(e,r);function e(t){return r.call(this,t)||this}return e.test=function(t){var i=globalThis.OffscreenCanvas;return i&&t instanceof i?!0:globalThis.HTMLCanvasElement&&t instanceof HTMLCanvasElement},e}(Ke),Xv=function(r){ht(e,r);function e(t,i){var n=this,s=i||{},a=s.width,o=s.height,h=s.autoLoad,u=s.linkBaseTexture;if(t&&t.length!==e.SIDES)throw new Error("Invalid length. Got "+t.length+", expected 6");n=r.call(this,6,{width:a,height:o})||this;for(var l=0;l<e.SIDES;l++)n.items[l].target=mi.TEXTURE_CUBE_MAP_POSITIVE_X+l;return n.linkBaseTexture=u!==!1,t&&n.initFromArray(t,i),h!==!1&&n.load(),n}return e.prototype.bind=function(t){r.prototype.bind.call(this,t),t.target=mi.TEXTURE_CUBE_MAP},e.prototype.addBaseTextureAt=function(t,i,n){if(!this.items[i])throw new Error("Index "+i+" is out of bounds");if(!this.linkBaseTexture||t.parentTextureArray||Object.keys(t._glTextures).length>0)if(t.resource)this.addResourceAt(t.resource,i);else throw new Error("CubeResource does not support copying of renderTexture.");else t.target=mi.TEXTURE_CUBE_MAP_POSITIVE_X+i,t.parentTextureArray=this.baseTexture,this.items[i]=t;return t.valid&&!this.valid&&this.resize(t.realWidth,t.realHeight),this.items[i]=t,this},e.prototype.upload=function(t,i,n){for(var s=this.itemDirtyIds,a=0;a<e.SIDES;a++){var o=this.items[a];(s[a]<o.dirtyId||n.dirtyId<i.dirtyId)&&(o.valid&&o.resource?(o.resource.upload(t,o,n),s[a]=o.dirtyId):s[a]<-1&&(t.gl.texImage2D(o.target,0,n.internalFormat,i.realWidth,i.realHeight,0,i.format,n.type,null),s[a]=-1))}return!0},e.test=function(t){return Array.isArray(t)&&t.length===e.SIDES},e.SIDES=6,e}(xh),bh=function(r){ht(e,r);function e(t,i){var n=this;if(i=i||{},!(t instanceof HTMLImageElement)){var s=new Image;Ke.crossOrigin(s,t,i.crossorigin),s.src=t,t=s}return n=r.call(this,t)||this,!t.complete&&n._width&&n._height&&(n._width=0,n._height=0),n.url=t.src,n._process=null,n.preserveBitmap=!1,n.createBitmap=(i.createBitmap!==void 0?i.createBitmap:L.CREATE_IMAGE_BITMAP)&&!!globalThis.createImageBitmap,n.alphaMode=typeof i.alphaMode=="number"?i.alphaMode:null,n.bitmap=null,n._load=null,i.autoLoad!==!1&&n.load(),n}return e.prototype.load=function(t){var i=this;return this._load?this._load:(t!==void 0&&(this.createBitmap=t),this._load=new Promise(function(n,s){var a=i.source;i.url=a.src;var o=function(){i.destroyed||(a.onload=null,a.onerror=null,i.resize(a.width,a.height),i._load=null,i.createBitmap?n(i.process()):n(i))};a.complete&&a.src?o():(a.onload=o,a.onerror=function(h){s(h),i.onError.emit(h)})}),this._load)},e.prototype.process=function(){var t=this,i=this.source;if(this._process!==null)return this._process;if(this.bitmap!==null||!globalThis.createImageBitmap)return Promise.resolve(this);var n=globalThis.createImageBitmap,s=!i.crossOrigin||i.crossOrigin==="anonymous";return this._process=fetch(i.src,{mode:s?"cors":"no-cors"}).then(function(a){return a.blob()}).then(function(a){return n(a,0,0,i.width,i.height,{premultiplyAlpha:t.alphaMode===null||t.alphaMode===ve.UNPACK?"premultiply":"none"})}).then(function(a){return t.destroyed?Promise.reject():(t.bitmap=a,t.update(),t._process=null,Promise.resolve(t))}),this._process},e.prototype.upload=function(t,i,n){if(typeof this.alphaMode=="number"&&(i.alphaMode=this.alphaMode),!this.createBitmap)return r.prototype.upload.call(this,t,i,n);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(r.prototype.upload.call(this,t,i,n,this.bitmap),!this.preserveBitmap){var s=!0,a=i._glTextures;for(var o in a){var h=a[o];if(h!==n&&h.dirtyId!==i.dirtyId){s=!1;break}}s&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0},e.prototype.dispose=function(){this.source.onload=null,this.source.onerror=null,r.prototype.dispose.call(this),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null},e.test=function(t){return typeof t=="string"||t instanceof HTMLImageElement},e}(Ke),Hv=function(r){ht(e,r);function e(t,i){var n=this;return i=i||{},n=r.call(this,L.ADAPTER.createCanvas())||this,n._width=0,n._height=0,n.svg=t,n.scale=i.scale||1,n._overrideWidth=i.width,n._overrideHeight=i.height,n._resolve=null,n._crossorigin=i.crossorigin,n._load=null,i.autoLoad!==!1&&n.load(),n}return e.prototype.load=function(){var t=this;return this._load?this._load:(this._load=new Promise(function(i){if(t._resolve=function(){t.resize(t.source.width,t.source.height),i(t)},e.SVG_XML.test(t.svg.trim())){if(!btoa)throw new Error("Your browser doesn't support base64 conversions.");t.svg="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(t.svg)))}t._loadSvg()}),this._load)},e.prototype._loadSvg=function(){var t=this,i=new Image;Ke.crossOrigin(i,this.svg,this._crossorigin),i.src=this.svg,i.onerror=function(n){t._resolve&&(i.onerror=null,t.onError.emit(n))},i.onload=function(){if(t._resolve){var n=i.width,s=i.height;if(!n||!s)throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");var a=n*t.scale,o=s*t.scale;(t._overrideWidth||t._overrideHeight)&&(a=t._overrideWidth||t._overrideHeight/s*n,o=t._overrideHeight||t._overrideWidth/n*s),a=Math.round(a),o=Math.round(o);var h=t.source;h.width=a,h.height=o,h._pixiId="canvas_"+yi(),h.getContext("2d").drawImage(i,0,0,n,s,0,0,a,o),t._resolve(),t._resolve=null}}},e.getSize=function(t){var i=e.SVG_SIZE.exec(t),n={};return i&&(n[i[1]]=Math.round(parseFloat(i[3])),n[i[5]]=Math.round(parseFloat(i[7]))),n},e.prototype.dispose=function(){r.prototype.dispose.call(this),this._resolve=null,this._crossorigin=null},e.test=function(t,i){return i==="svg"||typeof t=="string"&&t.startsWith("data:image/svg+xml")||typeof t=="string"&&e.SVG_XML.test(t)},e.SVG_XML=/^(<\?xml[^?]+\?>)?\s*(<!--[^(-->)]*-->)?\s*\<svg/m,e.SVG_SIZE=/<svg[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i,e}(Ke),Wv=function(r){ht(e,r);function e(t,i){var n=this;if(i=i||{},!(t instanceof HTMLVideoElement)){var s=document.createElement("video");s.setAttribute("preload","auto"),s.setAttribute("webkit-playsinline",""),s.setAttribute("playsinline",""),typeof t=="string"&&(t=[t]);var a=t[0].src||t[0];Ke.crossOrigin(s,a,i.crossorigin);for(var o=0;o<t.length;++o){var h=document.createElement("source"),u=t[o],l=u.src,f=u.mime;l=l||t[o];var c=l.split("?").shift().toLowerCase(),d=c.slice(c.lastIndexOf(".")+1);f=f||e.MIME_TYPES[d]||"video/"+d,h.src=l,h.type=f,s.appendChild(h)}t=s}return n=r.call(this,t)||this,n.noSubImage=!0,n._autoUpdate=!0,n._isConnectedToTicker=!1,n._updateFPS=i.updateFPS||0,n._msToNextUpdate=0,n.autoPlay=i.autoPlay!==!1,n._load=null,n._resolve=null,n._onCanPlay=n._onCanPlay.bind(n),n._onError=n._onError.bind(n),i.autoLoad!==!1&&n.load(),n}return e.prototype.update=function(t){if(!this.destroyed){var i=Ft.shared.elapsedMS*this.source.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-i),(!this._updateFPS||this._msToNextUpdate<=0)&&(r.prototype.update.call(this),this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0)}},e.prototype.load=function(){var t=this;if(this._load)return this._load;var i=this.source;return(i.readyState===i.HAVE_ENOUGH_DATA||i.readyState===i.HAVE_FUTURE_DATA)&&i.width&&i.height&&(i.complete=!0),i.addEventListener("play",this._onPlayStart.bind(this)),i.addEventListener("pause",this._onPlayStop.bind(this)),this._isSourceReady()?this._onCanPlay():(i.addEventListener("canplay",this._onCanPlay),i.addEventListener("canplaythrough",this._onCanPlay),i.addEventListener("error",this._onError,!0)),this._load=new Promise(function(n){t.valid?n(t):(t._resolve=n,i.load())}),this._load},e.prototype._onError=function(t){this.source.removeEventListener("error",this._onError,!0),this.onError.emit(t)},e.prototype._isSourcePlaying=function(){var t=this.source;return!t.paused&&!t.ended&&this._isSourceReady()},e.prototype._isSourceReady=function(){var t=this.source;return t.readyState>2},e.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),this.autoUpdate&&!this._isConnectedToTicker&&(Ft.shared.add(this.update,this),this._isConnectedToTicker=!0)},e.prototype._onPlayStop=function(){this._isConnectedToTicker&&(Ft.shared.remove(this.update,this),this._isConnectedToTicker=!1)},e.prototype._onCanPlay=function(){var t=this.source;t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay);var i=this.valid;this.resize(t.videoWidth,t.videoHeight),!i&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&t.play()},e.prototype.dispose=function(){this._isConnectedToTicker&&(Ft.shared.remove(this.update,this),this._isConnectedToTicker=!1);var t=this.source;t&&(t.removeEventListener("error",this._onError,!0),t.pause(),t.src="",t.load()),r.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"autoUpdate",{get:function(){return this._autoUpdate},set:function(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isConnectedToTicker?(Ft.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._isSourcePlaying()&&(Ft.shared.add(this.update,this),this._isConnectedToTicker=!0))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"updateFPS",{get:function(){return this._updateFPS},set:function(t){t!==this._updateFPS&&(this._updateFPS=t)},enumerable:!1,configurable:!0}),e.test=function(t,i){return globalThis.HTMLVideoElement&&t instanceof HTMLVideoElement||e.TYPES.indexOf(i)>-1},e.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],e.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"},e}(Ke),zv=function(r){ht(e,r);function e(t){return r.call(this,t)||this}return e.test=function(t){return!!globalThis.createImageBitmap&&typeof ImageBitmap<"u"&&t instanceof ImageBitmap},e}(Ke);Ds.push(bh,zv,kv,Wv,Hv,Tr,Xv,Uv);var Vv=function(r){ht(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.upload=function(t,i,n){var s=t.gl;s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i.alphaMode===ve.UNPACK);var a=i.realWidth,o=i.realHeight;return n.width===a&&n.height===o?s.texSubImage2D(i.target,0,0,0,a,o,i.format,n.type,this.data):(n.width=a,n.height=o,s.texImage2D(i.target,0,n.internalFormat,a,o,0,i.format,n.type,this.data)),!0},e}(Tr),Ls=function(){function r(e,t){this.width=Math.round(e||100),this.height=Math.round(t||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new Bt("disposeFramebuffer"),this.multisample=gt.NONE}return Object.defineProperty(r.prototype,"colorTexture",{get:function(){return this.colorTextures[0]},enumerable:!1,configurable:!0}),r.prototype.addColorTexture=function(e,t){return e===void 0&&(e=0),this.colorTextures[e]=t||new Q(null,{scaleMode:Pe.NEAREST,resolution:1,mipmap:pe.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},r.prototype.addDepthTexture=function(e){return this.depthTexture=e||new Q(new Vv(null,{width:this.width,height:this.height}),{scaleMode:Pe.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:pe.OFF,format:M.DEPTH_COMPONENT,type:k.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},r.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},r.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},r.prototype.resize=function(e,t){if(e=Math.round(e),t=Math.round(t),!(e===this.width&&t===this.height)){this.width=e,this.height=t,this.dirtyId++,this.dirtySize++;for(var i=0;i<this.colorTextures.length;i++){var n=this.colorTextures[i],s=n.resolution;n.setSize(e/s,t/s)}if(this.depthTexture){var s=this.depthTexture.resolution;this.depthTexture.setSize(e/s,t/s)}}},r.prototype.dispose=function(){this.disposeRunner.emit(this,!1)},r.prototype.destroyDepthTexture=function(){this.depthTexture&&(this.depthTexture.destroy(),this.depthTexture=null,++this.dirtyId,++this.dirtyFormat)},r}(),Th=function(r){ht(e,r);function e(t){t===void 0&&(t={});var i=this;if(typeof t=="number"){var n=arguments[0],s=arguments[1],a=arguments[2],o=arguments[3];t={width:n,height:s,scaleMode:a,resolution:o}}return t.width=t.width||100,t.height=t.height||100,t.multisample=t.multisample!==void 0?t.multisample:gt.NONE,i=r.call(this,null,t)||this,i.mipmap=pe.OFF,i.valid=!0,i.clearColor=[0,0,0,0],i.framebuffer=new Ls(i.realWidth,i.realHeight).addColorTexture(0,i),i.framebuffer.multisample=t.multisample,i.maskStack=[],i.filterStack=[{}],i}return e.prototype.resize=function(t,i){this.framebuffer.resize(t*this.resolution,i*this.resolution),this.setRealSize(this.framebuffer.width,this.framebuffer.height)},e.prototype.dispose=function(){this.framebuffer.dispose(),r.prototype.dispose.call(this)},e.prototype.destroy=function(){r.prototype.destroy.call(this),this.framebuffer.destroyDepthTexture(),this.framebuffer=null},e}(Q),wh=function(){function r(){this.x0=0,this.y0=0,this.x1=1,this.y1=0,this.x2=1,this.y2=1,this.x3=0,this.y3=1,this.uvsFloat32=new Float32Array(8)}return r.prototype.set=function(e,t,i){var n=t.width,s=t.height;if(i){var a=e.width/2/n,o=e.height/2/s,h=e.x/n+a,u=e.y/s+o;i=dt.add(i,dt.NW),this.x0=h+a*dt.uX(i),this.y0=u+o*dt.uY(i),i=dt.add(i,2),this.x1=h+a*dt.uX(i),this.y1=u+o*dt.uY(i),i=dt.add(i,2),this.x2=h+a*dt.uX(i),this.y2=u+o*dt.uY(i),i=dt.add(i,2),this.x3=h+a*dt.uX(i),this.y3=u+o*dt.uY(i)}else this.x0=e.x/n,this.y0=e.y/s,this.x1=(e.x+e.width)/n,this.y1=e.y/s,this.x2=(e.x+e.width)/n,this.y2=(e.y+e.height)/s,this.x3=e.x/n,this.y3=(e.y+e.height)/s;this.uvsFloat32[0]=this.x0,this.uvsFloat32[1]=this.y0,this.uvsFloat32[2]=this.x1,this.uvsFloat32[3]=this.y1,this.uvsFloat32[4]=this.x2,this.uvsFloat32[5]=this.y2,this.uvsFloat32[6]=this.x3,this.uvsFloat32[7]=this.y3},r.prototype.toString=function(){return"[@pixi/core:TextureUvs "+("x0="+this.x0+" y0="+this.y0+" ")+("x1="+this.x1+" y1="+this.y1+" x2="+this.x2+" ")+("y2="+this.y2+" x3="+this.x3+" y3="+this.y3)+"]"},r}(),Eh=new wh;function vn(r){r.destroy=function(){},r.on=function(){},r.once=function(){},r.emit=function(){}}var W=function(r){ht(e,r);function e(t,i,n,s,a,o){var h=r.call(this)||this;if(h.noFrame=!1,i||(h.noFrame=!0,i=new Z(0,0,1,1)),t instanceof e&&(t=t.baseTexture),h.baseTexture=t,h._frame=i,h.trim=s,h.valid=!1,h._uvs=Eh,h.uvMatrix=null,h.orig=n||i,h._rotate=Number(a||0),a===!0)h._rotate=2;else if(h._rotate%2!==0)throw new Error("attempt to use diamond-shaped UVs. If you are sure, set rotation manually");return h.defaultAnchor=o?new j(o.x,o.y):new j(0,0),h._updateID=0,h.textureCacheIds=[],t.valid?h.noFrame?t.valid&&h.onBaseTextureUpdated(t):h.frame=i:t.once("loaded",h.onBaseTextureUpdated,h),h.noFrame&&t.on("update",h.onBaseTextureUpdated,h),h}return e.prototype.update=function(){this.baseTexture.resource&&this.baseTexture.resource.update()},e.prototype.onBaseTextureUpdated=function(t){if(this.noFrame){if(!this.baseTexture.valid)return;this._frame.width=t.width,this._frame.height=t.height,this.valid=!0,this.updateUvs()}else this.frame=this._frame;this.emit("update",this)},e.prototype.destroy=function(t){if(this.baseTexture){if(t){var i=this.baseTexture.resource;i&&i.url&&Ge[i.url]&&e.removeFromCache(i.url),this.baseTexture.destroy()}this.baseTexture.off("loaded",this.onBaseTextureUpdated,this),this.baseTexture.off("update",this.onBaseTextureUpdated,this),this.baseTexture=null}this._frame=null,this._uvs=null,this.trim=null,this.orig=null,this.valid=!1,e.removeFromCache(this),this.textureCacheIds=null},e.prototype.clone=function(){var t=this._frame.clone(),i=this._frame===this.orig?t:this.orig.clone(),n=new e(this.baseTexture,!this.noFrame&&t,i,this.trim&&this.trim.clone(),this.rotate,this.defaultAnchor);return this.noFrame&&(n._frame=t),n},e.prototype.updateUvs=function(){this._uvs===Eh&&(this._uvs=new wh),this._uvs.set(this._frame,this.baseTexture,this.rotate),this._updateID++},e.from=function(t,i,n){i===void 0&&(i={}),n===void 0&&(n=L.STRICT_TEXTURE_CACHE);var s=typeof t=="string",a=null;if(s)a=t;else if(t instanceof Q){if(!t.cacheId){var o=i&&i.pixiIdPrefix||"pixiid";t.cacheId=o+"-"+yi(),Q.addToCache(t,t.cacheId)}a=t.cacheId}else{if(!t._pixiId){var o=i&&i.pixiIdPrefix||"pixiid";t._pixiId=o+"_"+yi()}a=t._pixiId}var h=Ge[a];if(s&&n&&!h)throw new Error('The cacheId "'+a+'" does not exist in TextureCache.');return!h&&!(t instanceof Q)?(i.resolution||(i.resolution=dn(t)),h=new e(new Q(t,i)),h.baseTexture.cacheId=a,Q.addToCache(h.baseTexture,a),e.addToCache(h,a)):!h&&t instanceof Q&&(h=new e(t),e.addToCache(h,a)),h},e.fromURL=function(t,i){var n=Object.assign({autoLoad:!1},i==null?void 0:i.resourceOptions),s=e.from(t,Object.assign({resourceOptions:n},i),!1),a=s.baseTexture.resource;return s.baseTexture.valid?Promise.resolve(s):a.load().then(function(){return Promise.resolve(s)})},e.fromBuffer=function(t,i,n,s){return new e(Q.fromBuffer(t,i,n,s))},e.fromLoader=function(t,i,n,s){var a=new Q(t,Object.assign({scaleMode:L.SCALE_MODE,resolution:dn(i)},s)),o=a.resource;o instanceof bh&&(o.url=i);var h=new e(a);return n||(n=i),Q.addToCache(h.baseTexture,n),e.addToCache(h,n),n!==i&&(Q.addToCache(h.baseTexture,i),e.addToCache(h,i)),h.baseTexture.valid?Promise.resolve(h):new Promise(function(u){h.baseTexture.once("loaded",function(){return u(h)})})},e.addToCache=function(t,i){i&&(t.textureCacheIds.indexOf(i)===-1&&t.textureCacheIds.push(i),Ge[i]&&console.warn("Texture added to the cache with an id ["+i+"] that already had an entry"),Ge[i]=t)},e.removeFromCache=function(t){if(typeof t=="string"){var i=Ge[t];if(i){var n=i.textureCacheIds.indexOf(t);return n>-1&&i.textureCacheIds.splice(n,1),delete Ge[t],i}}else if(t&&t.textureCacheIds){for(var s=0;s<t.textureCacheIds.length;++s)Ge[t.textureCacheIds[s]]===t&&delete Ge[t.textureCacheIds[s]];return t.textureCacheIds.length=0,t}return null},Object.defineProperty(e.prototype,"resolution",{get:function(){return this.baseTexture.resolution},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"frame",{get:function(){return this._frame},set:function(t){this._frame=t,this.noFrame=!1;var i=t.x,n=t.y,s=t.width,a=t.height,o=i+s>this.baseTexture.width,h=n+a>this.baseTexture.height;if(o||h){var u=o&&h?"and":"or",l="X: "+i+" + "+s+" = "+(i+s)+" > "+this.baseTexture.width,f="Y: "+n+" + "+a+" = "+(n+a)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+(l+" "+u+" "+f))}this.valid=s&&a&&this.baseTexture.valid,!this.trim&&!this.rotate&&(this.orig=t),this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rotate",{get:function(){return this._rotate},set:function(t){this._rotate=t,this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.orig.width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.orig.height},enumerable:!1,configurable:!0}),e.prototype.castToBaseTexture=function(){return this.baseTexture},Object.defineProperty(e,"EMPTY",{get:function(){return e._EMPTY||(e._EMPTY=new e(new Q),vn(e._EMPTY),vn(e._EMPTY.baseTexture)),e._EMPTY},enumerable:!1,configurable:!0}),Object.defineProperty(e,"WHITE",{get:function(){if(!e._WHITE){var t=L.ADAPTER.createCanvas(16,16),i=t.getContext("2d");t.width=16,t.height=16,i.fillStyle="white",i.fillRect(0,0,16,16),e._WHITE=new e(Q.from(t)),vn(e._WHITE),vn(e._WHITE.baseTexture)}return e._WHITE},enumerable:!1,configurable:!0}),e}(pr),bi=function(r){ht(e,r);function e(t,i){var n=r.call(this,t,i)||this;return n.valid=!0,n.filterFrame=null,n.filterPoolKey=null,n.updateUvs(),n}return Object.defineProperty(e.prototype,"framebuffer",{get:function(){return this.baseTexture.framebuffer},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"multisample",{get:function(){return this.framebuffer.multisample},set:function(t){this.framebuffer.multisample=t},enumerable:!1,configurable:!0}),e.prototype.resize=function(t,i,n){n===void 0&&(n=!0);var s=this.baseTexture.resolution,a=Math.round(t*s)/s,o=Math.round(i*s)/s;this.valid=a>0&&o>0,this._frame.width=this.orig.width=a,this._frame.height=this.orig.height=o,n&&this.baseTexture.resize(a,o),this.updateUvs()},e.prototype.setResolution=function(t){var i=this.baseTexture;i.resolution!==t&&(i.setResolution(t),this.resize(i.width,i.height,!1))},e.create=function(t){for(var i=arguments,n=[],s=1;s<arguments.length;s++)n[s-1]=i[s];return typeof t=="number"&&(ge("6.0.0","Arguments (width, height, scaleMode, resolution) have been deprecated."),t={width:t,height:n[0],scaleMode:n[1],resolution:n[2]}),new e(new Th(t))},e}(W),Yv=function(){function r(e){this.texturePool={},this.textureOptions=e||{},this.enableFullScreen=!1,this._pixelsWidth=0,this._pixelsHeight=0}return r.prototype.createTexture=function(e,t,i){i===void 0&&(i=gt.NONE);var n=new Th(Object.assign({width:e,height:t,resolution:1,multisample:i},this.textureOptions));return new bi(n)},r.prototype.getOptimalTexture=function(e,t,i,n){i===void 0&&(i=1),n===void 0&&(n=gt.NONE);var s;e=Math.ceil(e*i-1e-6),t=Math.ceil(t*i-1e-6),!this.enableFullScreen||e!==this._pixelsWidth||t!==this._pixelsHeight?(e=fn(e),t=fn(t),s=((e&65535)<<16|t&65535)>>>0,n>1&&(s+=n*4294967296)):s=n>1?-n:-1,this.texturePool[s]||(this.texturePool[s]=[]);var a=this.texturePool[s].pop();return a||(a=this.createTexture(e,t,n)),a.filterPoolKey=s,a.setResolution(i),a},r.prototype.getFilterTexture=function(e,t,i){var n=this.getOptimalTexture(e.width,e.height,t||e.resolution,i||gt.NONE);return n.filterFrame=e.filterFrame,n},r.prototype.returnTexture=function(e){var t=e.filterPoolKey;e.filterFrame=null,this.texturePool[t].push(e)},r.prototype.returnFilterTexture=function(e){this.returnTexture(e)},r.prototype.clear=function(e){if(e=e!==!1,e)for(var t in this.texturePool){var i=this.texturePool[t];if(i)for(var n=0;n<i.length;n++)i[n].destroy(!0)}this.texturePool={}},r.prototype.setScreenSize=function(e){if(!(e.width===this._pixelsWidth&&e.height===this._pixelsHeight)){this.enableFullScreen=e.width>0&&e.height>0;for(var t in this.texturePool)if(Number(t)<0){var i=this.texturePool[t];if(i)for(var n=0;n<i.length;n++)i[n].destroy(!0);this.texturePool[t]=[]}this._pixelsWidth=e.width,this._pixelsHeight=e.height}},r.SCREEN_KEY=-1,r}(),Sh=function(){function r(e,t,i,n,s,a,o){t===void 0&&(t=0),i===void 0&&(i=!1),n===void 0&&(n=k.FLOAT),this.buffer=e,this.size=t,this.normalized=i,this.type=n,this.stride=s,this.start=a,this.instance=o}return r.prototype.destroy=function(){this.buffer=null},r.from=function(e,t,i,n,s){return new r(e,t,i,n,s)},r}(),jv=0,At=function(){function r(e,t,i){t===void 0&&(t=!0),i===void 0&&(i=!1),this.data=e||new Float32Array(1),this._glBuffers={},this._updateID=0,this.index=i,this.static=t,this.id=jv++,this.disposeRunner=new Bt("disposeBuffer")}return r.prototype.update=function(e){e instanceof Array&&(e=new Float32Array(e)),this.data=e||this.data,this._updateID++},r.prototype.dispose=function(){this.disposeRunner.emit(this,!1)},r.prototype.destroy=function(){this.dispose(),this.data=null},Object.defineProperty(r.prototype,"index",{get:function(){return this.type===Ce.ELEMENT_ARRAY_BUFFER},set:function(e){this.type=e?Ce.ELEMENT_ARRAY_BUFFER:Ce.ARRAY_BUFFER},enumerable:!1,configurable:!0}),r.from=function(e){return e instanceof Array&&(e=new Float32Array(e)),new r(e)},r}(),Zv={Float32Array,Uint32Array,Int32Array,Uint8Array};function qv(r,e){for(var t=0,i=0,n={},s=0;s<r.length;s++)i+=e[s],t+=r[s].length;for(var a=new ArrayBuffer(t*4),o=null,h=0,s=0;s<r.length;s++){var u=e[s],l=r[s],f=fh(l);n[f]||(n[f]=new Zv[f](a)),o=n[f];for(var c=0;c<l.length;c++){var d=(c/u|0)*i+h,v=c%u;o[d+v]=l[c]}h+=u}return new Float32Array(a)}var Ph={5126:4,5123:2,5121:1},Kv=0,$v={Float32Array,Uint32Array,Int32Array,Uint8Array,Uint16Array},wr=function(){function r(e,t){e===void 0&&(e=[]),t===void 0&&(t={}),this.buffers=e,this.indexBuffer=null,this.attributes=t,this.glVertexArrayObjects={},this.id=Kv++,this.instanced=!1,this.instanceCount=1,this.disposeRunner=new Bt("disposeGeometry"),this.refCount=0}return r.prototype.addAttribute=function(e,t,i,n,s,a,o,h){if(i===void 0&&(i=0),n===void 0&&(n=!1),h===void 0&&(h=!1),!t)throw new Error("You must pass a buffer when creating an attribute");t instanceof At||(t instanceof Array&&(t=new Float32Array(t)),t=new At(t));var u=e.split("|");if(u.length>1){for(var l=0;l<u.length;l++)this.addAttribute(u[l],t,i,n,s);return this}var f=this.buffers.indexOf(t);return f===-1&&(this.buffers.push(t),f=this.buffers.length-1),this.attributes[e]=new Sh(f,i,n,s,a,o,h),this.instanced=this.instanced||h,this},r.prototype.getAttribute=function(e){return this.attributes[e]},r.prototype.getBuffer=function(e){return this.buffers[this.getAttribute(e).buffer]},r.prototype.addIndex=function(e){return e instanceof At||(e instanceof Array&&(e=new Uint16Array(e)),e=new At(e)),e.type=Ce.ELEMENT_ARRAY_BUFFER,this.indexBuffer=e,this.buffers.indexOf(e)===-1&&this.buffers.push(e),this},r.prototype.getIndex=function(){return this.indexBuffer},r.prototype.interleave=function(){if(this.buffers.length===1||this.buffers.length===2&&this.indexBuffer)return this;var e=[],t=[],i=new At,n;for(n in this.attributes){var s=this.attributes[n],a=this.buffers[s.buffer];e.push(a.data),t.push(s.size*Ph[s.type]/4),s.buffer=0}for(i.data=qv(e,t),n=0;n<this.buffers.length;n++)this.buffers[n]!==this.indexBuffer&&this.buffers[n].destroy();return this.buffers=[i],this.indexBuffer&&this.buffers.push(this.indexBuffer),this},r.prototype.getSize=function(){for(var e in this.attributes){var t=this.attributes[e],i=this.buffers[t.buffer];return i.data.length/(t.stride/4||t.size)}return 0},r.prototype.dispose=function(){this.disposeRunner.emit(this,!1)},r.prototype.destroy=function(){this.dispose(),this.buffers=null,this.indexBuffer=null,this.attributes=null},r.prototype.clone=function(){for(var e=new r,t=0;t<this.buffers.length;t++)e.buffers[t]=new At(this.buffers[t].data.slice(0));for(var t in this.attributes){var i=this.attributes[t];e.attributes[t]=new Sh(i.buffer,i.size,i.normalized,i.type,i.stride,i.start,i.instance)}return this.indexBuffer&&(e.indexBuffer=e.buffers[this.buffers.indexOf(this.indexBuffer)],e.indexBuffer.type=Ce.ELEMENT_ARRAY_BUFFER),e},r.merge=function(e){for(var t=new r,i=[],n=[],s=[],a,o=0;o<e.length;o++){a=e[o];for(var h=0;h<a.buffers.length;h++)n[h]=n[h]||0,n[h]+=a.buffers[h].data.length,s[h]=0}for(var o=0;o<a.buffers.length;o++)i[o]=new $v[fh(a.buffers[o].data)](n[o]),t.buffers[o]=new At(i[o]);for(var o=0;o<e.length;o++){a=e[o];for(var h=0;h<a.buffers.length;h++)i[h].set(a.buffers[h].data,s[h]),s[h]+=a.buffers[h].data.length}if(t.attributes=a.attributes,a.indexBuffer){t.indexBuffer=t.buffers[a.buffers.indexOf(a.indexBuffer)],t.indexBuffer.type=Ce.ELEMENT_ARRAY_BUFFER;for(var u=0,l=0,f=0,c=0,o=0;o<a.buffers.length;o++)if(a.buffers[o]!==a.indexBuffer){c=o;break}for(var o in a.attributes){var d=a.attributes[o];(d.buffer|0)===c&&(l+=d.size*Ph[d.type]/4)}for(var o=0;o<e.length;o++){for(var v=e[o].indexBuffer.data,h=0;h<v.length;h++)t.indexBuffer.data[h+f]+=u;u+=e[o].buffers[c].data.length/l,f+=v.length}}return t},r}(),Jv=function(r){ht(e,r);function e(){var t=r.call(this)||this;return t.addAttribute("aVertexPosition",new Float32Array([0,0,1,0,1,1,0,1])).addIndex([0,1,3,2]),t}return e}(wr),Rh=function(r){ht(e,r);function e(){var t=r.call(this)||this;return t.vertices=new Float32Array([-1,-1,1,-1,1,1,-1,1]),t.uvs=new Float32Array([0,0,1,0,1,1,0,1]),t.vertexBuffer=new At(t.vertices),t.uvBuffer=new At(t.uvs),t.addAttribute("aVertexPosition",t.vertexBuffer).addAttribute("aTextureCoord",t.uvBuffer).addIndex([0,1,2,0,2,3]),t}return e.prototype.map=function(t,i){var n=0,s=0;return this.uvs[0]=n,this.uvs[1]=s,this.uvs[2]=n+i.width/t.width,this.uvs[3]=s,this.uvs[4]=n+i.width/t.width,this.uvs[5]=s+i.height/t.height,this.uvs[6]=n,this.uvs[7]=s+i.height/t.height,n=i.x,s=i.y,this.vertices[0]=n,this.vertices[1]=s,this.vertices[2]=n+i.width,this.vertices[3]=s,this.vertices[4]=n+i.width,this.vertices[5]=s+i.height,this.vertices[6]=n,this.vertices[7]=s+i.height,this.invalidate(),this},e.prototype.invalidate=function(){return this.vertexBuffer._updateID++,this.uvBuffer._updateID++,this},e}(wr),Qv=0,Ti=function(){function r(e,t,i){this.group=!0,this.syncUniforms={},this.dirtyId=0,this.id=Qv++,this.static=!!t,this.ubo=!!i,e instanceof At?(this.buffer=e,this.buffer.type=Ce.UNIFORM_BUFFER,this.autoManage=!1,this.ubo=!0):(this.uniforms=e,this.ubo&&(this.buffer=new At(new Float32Array(1)),this.buffer.type=Ce.UNIFORM_BUFFER,this.autoManage=!0))}return r.prototype.update=function(){this.dirtyId++,!this.autoManage&&this.buffer&&this.buffer.update()},r.prototype.add=function(e,t,i){if(!this.ubo)this.uniforms[e]=new r(t,i);else throw new Error("[UniformGroup] uniform groups in ubo mode cannot be modified, or have uniform groups nested in them")},r.from=function(e,t,i){return new r(e,t,i)},r.uboFrom=function(e,t){return new r(e,t??!0,!0)},r}(),t_=function(){function r(){this.renderTexture=null,this.target=null,this.legacy=!1,this.resolution=1,this.multisample=gt.NONE,this.sourceFrame=new Z,this.destinationFrame=new Z,this.bindingSourceFrame=new Z,this.bindingDestinationFrame=new Z,this.filters=[],this.transform=null}return r.prototype.clear=function(){this.target=null,this.filters=null,this.renderTexture=null},r}(),_n=[new j,new j,new j,new j],Bs=new Ct,e_=function(){function r(e){this.renderer=e,this.defaultFilterStack=[{}],this.texturePool=new Yv,this.texturePool.setScreenSize(e.view),this.statePool=[],this.quad=new Jv,this.quadUv=new Rh,this.tempRect=new Z,this.activeState={},this.globalUniforms=new Ti({outputFrame:new Z,inputSize:new Float32Array(4),inputPixel:new Float32Array(4),inputClamp:new Float32Array(4),resolution:1,filterArea:new Float32Array(4),filterClamp:new Float32Array(4)},!0),this.forceClear=!1,this.useMaxPadding=!1}return r.prototype.push=function(e,t){for(var i,n,s=this.renderer,a=this.defaultFilterStack,o=this.statePool.pop()||new t_,h=this.renderer.renderTexture,u=t[0].resolution,l=t[0].multisample,f=t[0].padding,c=t[0].autoFit,d=(i=t[0].legacy)!==null&&i!==void 0?i:!0,v=1;v<t.length;v++){var p=t[v];u=Math.min(u,p.resolution),l=Math.min(l,p.multisample),f=this.useMaxPadding?Math.max(f,p.padding):f+p.padding,c=c&&p.autoFit,d=d||((n=p.legacy)!==null&&n!==void 0?n:!0)}a.length===1&&(this.defaultFilterStack[0].renderTexture=h.current),a.push(o),o.resolution=u,o.multisample=l,o.legacy=d,o.target=e,o.sourceFrame.copyFrom(e.filterArea||e.getBounds(!0)),o.sourceFrame.pad(f);var _=this.tempRect.copyFrom(h.sourceFrame);s.projection.transform&&this.transformAABB(Bs.copyFrom(s.projection.transform).invert(),_),c?(o.sourceFrame.fit(_),(o.sourceFrame.width<=0||o.sourceFrame.height<=0)&&(o.sourceFrame.width=0,o.sourceFrame.height=0)):o.sourceFrame.intersects(_)||(o.sourceFrame.width=0,o.sourceFrame.height=0),this.roundFrame(o.sourceFrame,h.current?h.current.resolution:s.resolution,h.sourceFrame,h.destinationFrame,s.projection.transform),o.renderTexture=this.getOptimalFilterTexture(o.sourceFrame.width,o.sourceFrame.height,u,l),o.filters=t,o.destinationFrame.width=o.renderTexture.width,o.destinationFrame.height=o.renderTexture.height;var m=this.tempRect;m.x=0,m.y=0,m.width=o.sourceFrame.width,m.height=o.sourceFrame.height,o.renderTexture.filterFrame=o.sourceFrame,o.bindingSourceFrame.copyFrom(h.sourceFrame),o.bindingDestinationFrame.copyFrom(h.destinationFrame),o.transform=s.projection.transform,s.projection.transform=null,h.bind(o.renderTexture,o.sourceFrame,m),s.framebuffer.clear(0,0,0,0)},r.prototype.pop=function(){var e=this.defaultFilterStack,t=e.pop(),i=t.filters;this.activeState=t;var n=this.globalUniforms.uniforms;n.outputFrame=t.sourceFrame,n.resolution=t.resolution;var s=n.inputSize,a=n.inputPixel,o=n.inputClamp;if(s[0]=t.destinationFrame.width,s[1]=t.destinationFrame.height,s[2]=1/s[0],s[3]=1/s[1],a[0]=Math.round(s[0]*t.resolution),a[1]=Math.round(s[1]*t.resolution),a[2]=1/a[0],a[3]=1/a[1],o[0]=.5*a[2],o[1]=.5*a[3],o[2]=t.sourceFrame.width*s[2]-.5*a[2],o[3]=t.sourceFrame.height*s[3]-.5*a[3],t.legacy){var h=n.filterArea;h[0]=t.destinationFrame.width,h[1]=t.destinationFrame.height,h[2]=t.sourceFrame.x,h[3]=t.sourceFrame.y,n.filterClamp=n.inputClamp}this.globalUniforms.update();var u=e[e.length-1];if(this.renderer.framebuffer.blit(),i.length===1)i[0].apply(this,t.renderTexture,u.renderTexture,_e.BLEND,t),this.returnFilterTexture(t.renderTexture);else{var l=t.renderTexture,f=this.getOptimalFilterTexture(l.width,l.height,t.resolution);f.filterFrame=l.filterFrame;var c=0;for(c=0;c<i.length-1;++c){c===1&&t.multisample>1&&(f=this.getOptimalFilterTexture(l.width,l.height,t.resolution),f.filterFrame=l.filterFrame),i[c].apply(this,l,f,_e.CLEAR,t);var d=l;l=f,f=d}i[c].apply(this,l,u.renderTexture,_e.BLEND,t),c>1&&t.multisample>1&&this.returnFilterTexture(t.renderTexture),this.returnFilterTexture(l),this.returnFilterTexture(f)}t.clear(),this.statePool.push(t)},r.prototype.bindAndClear=function(e,t){t===void 0&&(t=_e.CLEAR);var i=this.renderer,n=i.renderTexture,s=i.state;if(e===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,e&&e.filterFrame){var a=this.tempRect;a.x=0,a.y=0,a.width=e.filterFrame.width,a.height=e.filterFrame.height,n.bind(e,e.filterFrame,a)}else e!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?n.bind(e):this.renderer.renderTexture.bind(e,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);var o=s.stateId&1||this.forceClear;(t===_e.CLEAR||t===_e.BLIT&&o)&&this.renderer.framebuffer.clear(0,0,0,0)},r.prototype.applyFilter=function(e,t,i,n){var s=this.renderer;s.state.set(e.state),this.bindAndClear(i,n),e.uniforms.uSampler=t,e.uniforms.filterGlobals=this.globalUniforms,s.shader.bind(e),e.legacy=!!e.program.attributeData.aTextureCoord,e.legacy?(this.quadUv.map(t._frame,t.filterFrame),s.geometry.bind(this.quadUv),s.geometry.draw(de.TRIANGLES)):(s.geometry.bind(this.quad),s.geometry.draw(de.TRIANGLE_STRIP))},r.prototype.calculateSpriteMatrix=function(e,t){var i=this.activeState,n=i.sourceFrame,s=i.destinationFrame,a=t._texture.orig,o=e.set(s.width,0,0,s.height,n.x,n.y),h=t.worldTransform.copyTo(Ct.TEMP_MATRIX);return h.invert(),o.prepend(h),o.scale(1/a.width,1/a.height),o.translate(t.anchor.x,t.anchor.y),o},r.prototype.destroy=function(){this.renderer=null,this.texturePool.clear(!1)},r.prototype.getOptimalFilterTexture=function(e,t,i,n){return i===void 0&&(i=1),n===void 0&&(n=gt.NONE),this.texturePool.getOptimalTexture(e,t,i,n)},r.prototype.getFilterTexture=function(e,t,i){if(typeof e=="number"){var n=e;e=t,t=n}e=e||this.activeState.renderTexture;var s=this.texturePool.getOptimalTexture(e.width,e.height,t||e.resolution,i||gt.NONE);return s.filterFrame=e.filterFrame,s},r.prototype.returnFilterTexture=function(e){this.texturePool.returnTexture(e)},r.prototype.emptyPool=function(){this.texturePool.clear(!0)},r.prototype.resize=function(){this.texturePool.setScreenSize(this.renderer.view)},r.prototype.transformAABB=function(e,t){var i=_n[0],n=_n[1],s=_n[2],a=_n[3];i.set(t.left,t.top),n.set(t.left,t.bottom),s.set(t.right,t.top),a.set(t.right,t.bottom),e.apply(i,i),e.apply(n,n),e.apply(s,s),e.apply(a,a);var o=Math.min(i.x,n.x,s.x,a.x),h=Math.min(i.y,n.y,s.y,a.y),u=Math.max(i.x,n.x,s.x,a.x),l=Math.max(i.y,n.y,s.y,a.y);t.x=o,t.y=h,t.width=u-o,t.height=l-h},r.prototype.roundFrame=function(e,t,i,n,s){if(!(e.width<=0||e.height<=0||i.width<=0||i.height<=0)){if(s){var a=s.a,o=s.b,h=s.c,u=s.d;if((Math.abs(o)>1e-4||Math.abs(h)>1e-4)&&(Math.abs(a)>1e-4||Math.abs(u)>1e-4))return}s=s?Bs.copyFrom(s):Bs.identity(),s.translate(-i.x,-i.y).scale(n.width/i.width,n.height/i.height).translate(n.x,n.y),this.transformAABB(s,e),e.ceil(t),this.transformAABB(s.invert(),e)}},r}(),mn=function(){function r(e){this.renderer=e}return r.prototype.flush=function(){},r.prototype.destroy=function(){this.renderer=null},r.prototype.start=function(){},r.prototype.stop=function(){this.flush()},r.prototype.render=function(e){},r}(),i_=function(){function r(e){this.renderer=e,this.emptyRenderer=new mn(e),this.currentRenderer=this.emptyRenderer}return r.prototype.setObjectRenderer=function(e){this.currentRenderer!==e&&(this.currentRenderer.stop(),this.currentRenderer=e,this.currentRenderer.start())},r.prototype.flush=function(){this.setObjectRenderer(this.emptyRenderer)},r.prototype.reset=function(){this.setObjectRenderer(this.emptyRenderer)},r.prototype.copyBoundTextures=function(e,t){for(var i=this.renderer.texture.boundTextures,n=t-1;n>=0;--n)e[n]=i[n]||null,e[n]&&(e[n]._batchLocation=n)},r.prototype.boundArray=function(e,t,i,n){for(var s=e.elements,a=e.ids,o=e.count,h=0,u=0;u<o;u++){var l=s[u],f=l._batchLocation;if(f>=0&&f<n&&t[f]===l){a[u]=f;continue}for(;h<n;){var c=t[h];if(c&&c._batchEnabled===i&&c._batchLocation===h){h++;continue}a[u]=h,l._batchLocation=h,t[h]=l;break}}},r.prototype.destroy=function(){this.renderer=null},r}(),Ch=0,r_=function(){function r(e){this.renderer=e,this.webGLVersion=1,this.extensions={},this.supports={uint32Indices:!1},this.handleContextLost=this.handleContextLost.bind(this),this.handleContextRestored=this.handleContextRestored.bind(this),e.view.addEventListener("webglcontextlost",this.handleContextLost,!1),e.view.addEventListener("webglcontextrestored",this.handleContextRestored,!1)}return Object.defineProperty(r.prototype,"isLost",{get:function(){return!this.gl||this.gl.isContextLost()},enumerable:!1,configurable:!0}),r.prototype.contextChange=function(e){this.gl=e,this.renderer.gl=e,this.renderer.CONTEXT_UID=Ch++,e.isContextLost()&&e.getExtension("WEBGL_lose_context")&&e.getExtension("WEBGL_lose_context").restoreContext()},r.prototype.initFromContext=function(e){this.gl=e,this.validateContext(e),this.renderer.gl=e,this.renderer.CONTEXT_UID=Ch++,this.renderer.runners.contextChange.emit(e)},r.prototype.initFromOptions=function(e){var t=this.createContext(this.renderer.view,e);this.initFromContext(t)},r.prototype.createContext=function(e,t){var i;if(L.PREFER_ENV>=Le.WEBGL2&&(i=e.getContext("webgl2",t)),i)this.webGLVersion=2;else if(this.webGLVersion=1,i=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),!i)throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=i,this.getExtensions(),this.gl},r.prototype.getExtensions=function(){var e=this.gl,t={anisotropicFiltering:e.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),s3tc:e.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:e.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:e.getExtension("WEBGL_compressed_texture_etc"),etc1:e.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:e.getExtension("WEBGL_compressed_texture_atc"),astc:e.getExtension("WEBGL_compressed_texture_astc")};this.webGLVersion===1?Object.assign(this.extensions,t,{drawBuffers:e.getExtension("WEBGL_draw_buffers"),depthTexture:e.getExtension("WEBGL_depth_texture"),loseContext:e.getExtension("WEBGL_lose_context"),vertexArrayObject:e.getExtension("OES_vertex_array_object")||e.getExtension("MOZ_OES_vertex_array_object")||e.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:e.getExtension("OES_element_index_uint"),floatTexture:e.getExtension("OES_texture_float"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),textureHalfFloat:e.getExtension("OES_texture_half_float"),textureHalfFloatLinear:e.getExtension("OES_texture_half_float_linear")}):this.webGLVersion===2&&Object.assign(this.extensions,t,{colorBufferFloat:e.getExtension("EXT_color_buffer_float")})},r.prototype.handleContextLost=function(e){e.preventDefault()},r.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.emit(this.gl)},r.prototype.destroy=function(){var e=this.renderer.view;this.renderer=null,e.removeEventListener("webglcontextlost",this.handleContextLost),e.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},r.prototype.postrender=function(){this.renderer.renderingToScreen&&this.gl.flush()},r.prototype.validateContext=function(e){var t=e.getContextAttributes(),i="WebGL2RenderingContext"in globalThis&&e instanceof globalThis.WebGL2RenderingContext;i&&(this.webGLVersion=2),t&&!t.stencil&&console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");var n=i||!!e.getExtension("OES_element_index_uint");this.supports.uint32Indices=n,n||console.warn("Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly")},r}(),n_=function(){function r(e){this.framebuffer=e,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=gt.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0}return r}(),s_=new Z,a_=function(){function r(e){this.renderer=e,this.managedFramebuffers=[],this.unknownFramebuffer=new Ls(10,10),this.msaaSamples=null}return r.prototype.contextChange=function(){var e=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new Z,this.hasMRT=!0,this.writeDepthTexture=!0,this.disposeAll(!0),this.renderer.context.webGLVersion===1){var t=this.renderer.context.extensions.drawBuffers,i=this.renderer.context.extensions.depthTexture;L.PREFER_ENV===Le.WEBGL_LEGACY&&(t=null,i=null),t?e.drawBuffers=function(n){return t.drawBuffersWEBGL(n)}:(this.hasMRT=!1,e.drawBuffers=function(){}),i||(this.writeDepthTexture=!1)}else this.msaaSamples=e.getInternalformatParameter(e.RENDERBUFFER,e.RGBA8,e.SAMPLES)},r.prototype.bind=function(e,t,i){i===void 0&&(i=0);var n=this.gl;if(e){var s=e.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(e);this.current!==e&&(this.current=e,n.bindFramebuffer(n.FRAMEBUFFER,s.framebuffer)),s.mipLevel!==i&&(e.dirtyId++,e.dirtyFormat++,s.mipLevel=i),s.dirtyId!==e.dirtyId&&(s.dirtyId=e.dirtyId,s.dirtyFormat!==e.dirtyFormat?(s.dirtyFormat=e.dirtyFormat,s.dirtySize=e.dirtySize,this.updateFramebuffer(e,i)):s.dirtySize!==e.dirtySize&&(s.dirtySize=e.dirtySize,this.resizeFramebuffer(e)));for(var a=0;a<e.colorTextures.length;a++){var o=e.colorTextures[a];this.renderer.texture.unbind(o.parentTextureArray||o)}if(e.depthTexture&&this.renderer.texture.unbind(e.depthTexture),t){var h=t.width>>i,u=t.height>>i,l=h/t.width;this.setViewport(t.x*l,t.y*l,h,u)}else{var h=e.width>>i,u=e.height>>i;this.setViewport(0,0,h,u)}}else this.current&&(this.current=null,n.bindFramebuffer(n.FRAMEBUFFER,null)),t?this.setViewport(t.x,t.y,t.width,t.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)},r.prototype.setViewport=function(e,t,i,n){var s=this.viewport;e=Math.round(e),t=Math.round(t),i=Math.round(i),n=Math.round(n),(s.width!==i||s.height!==n||s.x!==e||s.y!==t)&&(s.x=e,s.y=t,s.width=i,s.height=n,this.gl.viewport(e,t,i,n))},Object.defineProperty(r.prototype,"size",{get:function(){return this.current?{x:0,y:0,width:this.current.width,height:this.current.height}:{x:0,y:0,width:this.renderer.width,height:this.renderer.height}},enumerable:!1,configurable:!0}),r.prototype.clear=function(e,t,i,n,s){s===void 0&&(s=tn.COLOR|tn.DEPTH);var a=this.gl;a.clearColor(e,t,i,n),a.clear(s)},r.prototype.initFramebuffer=function(e){var t=this.gl,i=new n_(t.createFramebuffer());return i.multisample=this.detectSamples(e.multisample),e.glFramebuffers[this.CONTEXT_UID]=i,this.managedFramebuffers.push(e),e.disposeRunner.add(this),i},r.prototype.resizeFramebuffer=function(e){var t=this.gl,i=e.glFramebuffers[this.CONTEXT_UID];i.msaaBuffer&&(t.bindRenderbuffer(t.RENDERBUFFER,i.msaaBuffer),t.renderbufferStorageMultisample(t.RENDERBUFFER,i.multisample,t.RGBA8,e.width,e.height)),i.stencil&&(t.bindRenderbuffer(t.RENDERBUFFER,i.stencil),i.msaaBuffer?t.renderbufferStorageMultisample(t.RENDERBUFFER,i.multisample,t.DEPTH24_STENCIL8,e.width,e.height):t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,e.width,e.height));var n=e.colorTextures,s=n.length;t.drawBuffers||(s=Math.min(s,1));for(var a=0;a<s;a++){var o=n[a],h=o.parentTextureArray||o;this.renderer.texture.bind(h,0)}e.depthTexture&&this.writeDepthTexture&&this.renderer.texture.bind(e.depthTexture,0)},r.prototype.updateFramebuffer=function(e,t){var i=this.gl,n=e.glFramebuffers[this.CONTEXT_UID],s=e.colorTextures,a=s.length;i.drawBuffers||(a=Math.min(a,1)),n.multisample>1&&this.canMultisampleFramebuffer(e)?(n.msaaBuffer=n.msaaBuffer||i.createRenderbuffer(),i.bindRenderbuffer(i.RENDERBUFFER,n.msaaBuffer),i.renderbufferStorageMultisample(i.RENDERBUFFER,n.multisample,i.RGBA8,e.width,e.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.RENDERBUFFER,n.msaaBuffer)):n.msaaBuffer&&(i.deleteRenderbuffer(n.msaaBuffer),n.msaaBuffer=null,n.blitFramebuffer&&(n.blitFramebuffer.dispose(),n.blitFramebuffer=null));for(var o=[],h=0;h<a;h++){var u=s[h],l=u.parentTextureArray||u;this.renderer.texture.bind(l,0),!(h===0&&n.msaaBuffer)&&(i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+h,u.target,l._glTextures[this.CONTEXT_UID].texture,t),o.push(i.COLOR_ATTACHMENT0+h))}if(o.length>1&&i.drawBuffers(o),e.depthTexture){var f=this.writeDepthTexture;if(f){var c=e.depthTexture;this.renderer.texture.bind(c,0),i.framebufferTexture2D(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.TEXTURE_2D,c._glTextures[this.CONTEXT_UID].texture,t)}}(e.stencil||e.depth)&&!(e.depthTexture&&this.writeDepthTexture)?(n.stencil=n.stencil||i.createRenderbuffer(),i.bindRenderbuffer(i.RENDERBUFFER,n.stencil),n.msaaBuffer?i.renderbufferStorageMultisample(i.RENDERBUFFER,n.multisample,i.DEPTH24_STENCIL8,e.width,e.height):i.renderbufferStorage(i.RENDERBUFFER,i.DEPTH_STENCIL,e.width,e.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.DEPTH_STENCIL_ATTACHMENT,i.RENDERBUFFER,n.stencil)):n.stencil&&(i.deleteRenderbuffer(n.stencil),n.stencil=null)},r.prototype.canMultisampleFramebuffer=function(e){return this.renderer.context.webGLVersion!==1&&e.colorTextures.length<=1&&!e.depthTexture},r.prototype.detectSamples=function(e){var t=this.msaaSamples,i=gt.NONE;if(e<=1||t===null)return i;for(var n=0;n<t.length;n++)if(t[n]<=e){i=t[n];break}return i===1&&(i=gt.NONE),i},r.prototype.blit=function(e,t,i){var n=this,s=n.current,a=n.renderer,o=n.gl,h=n.CONTEXT_UID;if(a.context.webGLVersion===2&&s){var u=s.glFramebuffers[h];if(u){if(!e){if(!u.msaaBuffer)return;var l=s.colorTextures[0];if(!l)return;u.blitFramebuffer||(u.blitFramebuffer=new Ls(s.width,s.height),u.blitFramebuffer.addColorTexture(0,l)),e=u.blitFramebuffer,e.colorTextures[0]!==l&&(e.colorTextures[0]=l,e.dirtyId++,e.dirtyFormat++),(e.width!==s.width||e.height!==s.height)&&(e.width=s.width,e.height=s.height,e.dirtyId++,e.dirtySize++)}t||(t=s_,t.width=s.width,t.height=s.height),i||(i=t);var f=t.width===i.width&&t.height===i.height;this.bind(e),o.bindFramebuffer(o.READ_FRAMEBUFFER,u.framebuffer),o.blitFramebuffer(t.left,t.top,t.right,t.bottom,i.left,i.top,i.right,i.bottom,o.COLOR_BUFFER_BIT,f?o.NEAREST:o.LINEAR)}}},r.prototype.disposeFramebuffer=function(e,t){var i=e.glFramebuffers[this.CONTEXT_UID],n=this.gl;if(i){delete e.glFramebuffers[this.CONTEXT_UID];var s=this.managedFramebuffers.indexOf(e);s>=0&&this.managedFramebuffers.splice(s,1),e.disposeRunner.remove(this),t||(n.deleteFramebuffer(i.framebuffer),i.msaaBuffer&&n.deleteRenderbuffer(i.msaaBuffer),i.stencil&&n.deleteRenderbuffer(i.stencil)),i.blitFramebuffer&&i.blitFramebuffer.dispose()}},r.prototype.disposeAll=function(e){var t=this.managedFramebuffers;this.managedFramebuffers=[];for(var i=0;i<t.length;i++)this.disposeFramebuffer(t[i],e)},r.prototype.forceStencil=function(){var e=this.current;if(e){var t=e.glFramebuffers[this.CONTEXT_UID];if(!(!t||t.stencil)){e.stencil=!0;var i=e.width,n=e.height,s=this.gl,a=s.createRenderbuffer();s.bindRenderbuffer(s.RENDERBUFFER,a),t.msaaBuffer?s.renderbufferStorageMultisample(s.RENDERBUFFER,t.multisample,s.DEPTH24_STENCIL8,i,n):s.renderbufferStorage(s.RENDERBUFFER,s.DEPTH_STENCIL,i,n),t.stencil=a,s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_STENCIL_ATTACHMENT,s.RENDERBUFFER,a)}}},r.prototype.reset=function(){this.current=this.unknownFramebuffer,this.viewport=new Z},r.prototype.destroy=function(){this.renderer=null},r}(),Gs={5126:4,5123:2,5121:1},o_=function(){function r(e){this.renderer=e,this._activeGeometry=null,this._activeVao=null,this.hasVao=!0,this.hasInstance=!0,this.canUseUInt32ElementIndex=!1,this.managedGeometries={}}return r.prototype.contextChange=function(){this.disposeAll(!0);var e=this.gl=this.renderer.gl,t=this.renderer.context;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,t.webGLVersion!==2){var i=this.renderer.context.extensions.vertexArrayObject;L.PREFER_ENV===Le.WEBGL_LEGACY&&(i=null),i?(e.createVertexArray=function(){return i.createVertexArrayOES()},e.bindVertexArray=function(s){return i.bindVertexArrayOES(s)},e.deleteVertexArray=function(s){return i.deleteVertexArrayOES(s)}):(this.hasVao=!1,e.createVertexArray=function(){return null},e.bindVertexArray=function(){return null},e.deleteVertexArray=function(){return null})}if(t.webGLVersion!==2){var n=e.getExtension("ANGLE_instanced_arrays");n?(e.vertexAttribDivisor=function(s,a){return n.vertexAttribDivisorANGLE(s,a)},e.drawElementsInstanced=function(s,a,o,h,u){return n.drawElementsInstancedANGLE(s,a,o,h,u)},e.drawArraysInstanced=function(s,a,o,h){return n.drawArraysInstancedANGLE(s,a,o,h)}):this.hasInstance=!1}this.canUseUInt32ElementIndex=t.webGLVersion===2||!!t.extensions.uint32ElementIndex},r.prototype.bind=function(e,t){t=t||this.renderer.shader.shader;var i=this.gl,n=e.glVertexArrayObjects[this.CONTEXT_UID],s=!1;n||(this.managedGeometries[e.id]=e,e.disposeRunner.add(this),e.glVertexArrayObjects[this.CONTEXT_UID]=n={},s=!0);var a=n[t.program.id]||this.initGeometryVao(e,t,s);this._activeGeometry=e,this._activeVao!==a&&(this._activeVao=a,this.hasVao?i.bindVertexArray(a):this.activateVao(e,t.program)),this.updateBuffers()},r.prototype.reset=function(){this.unbind()},r.prototype.updateBuffers=function(){for(var e=this._activeGeometry,t=this.renderer.buffer,i=0;i<e.buffers.length;i++){var n=e.buffers[i];t.update(n)}},r.prototype.checkCompatibility=function(e,t){var i=e.attributes,n=t.attributeData;for(var s in n)if(!i[s])throw new Error('shader and geometry incompatible, geometry missing the "'+s+'" attribute')},r.prototype.getSignature=function(e,t){var i=e.attributes,n=t.attributeData,s=["g",e.id];for(var a in i)n[a]&&s.push(a,n[a].location);return s.join("-")},r.prototype.initGeometryVao=function(e,t,i){i===void 0&&(i=!0);var n=this.gl,s=this.CONTEXT_UID,a=this.renderer.buffer,o=t.program;o.glPrograms[s]||this.renderer.shader.generateProgram(t),this.checkCompatibility(e,o);var h=this.getSignature(e,o),u=e.glVertexArrayObjects[this.CONTEXT_UID],l=u[h];if(l)return u[o.id]=l,l;var f=e.buffers,c=e.attributes,d={},v={};for(var p in f)d[p]=0,v[p]=0;for(var p in c)!c[p].size&&o.attributeData[p]?c[p].size=o.attributeData[p].size:c[p].size||console.warn("PIXI Geometry attribute '"+p+"' size cannot be determined (likely the bound shader does not have the attribute)"),d[c[p].buffer]+=c[p].size*Gs[c[p].type];for(var p in c){var _=c[p],m=_.size;_.stride===void 0&&(d[_.buffer]===m*Gs[_.type]?_.stride=0:_.stride=d[_.buffer]),_.start===void 0&&(_.start=v[_.buffer],v[_.buffer]+=m*Gs[_.type])}l=n.createVertexArray(),n.bindVertexArray(l);for(var g=0;g<f.length;g++){var y=f[g];a.bind(y),i&&y._glBuffers[s].refCount++}return this.activateVao(e,o),this._activeVao=l,u[o.id]=l,u[h]=l,l},r.prototype.disposeGeometry=function(e,t){var i;if(this.managedGeometries[e.id]){delete this.managedGeometries[e.id];var n=e.glVertexArrayObjects[this.CONTEXT_UID],s=this.gl,a=e.buffers,o=(i=this.renderer)===null||i===void 0?void 0:i.buffer;if(e.disposeRunner.remove(this),!!n){if(o)for(var h=0;h<a.length;h++){var u=a[h]._glBuffers[this.CONTEXT_UID];u&&(u.refCount--,u.refCount===0&&!t&&o.dispose(a[h],t))}if(!t){for(var l in n)if(l[0]==="g"){var f=n[l];this._activeVao===f&&this.unbind(),s.deleteVertexArray(f)}}delete e.glVertexArrayObjects[this.CONTEXT_UID]}}},r.prototype.disposeAll=function(e){for(var t=Object.keys(this.managedGeometries),i=0;i<t.length;i++)this.disposeGeometry(this.managedGeometries[t[i]],e)},r.prototype.activateVao=function(e,t){var i=this.gl,n=this.CONTEXT_UID,s=this.renderer.buffer,a=e.buffers,o=e.attributes;e.indexBuffer&&s.bind(e.indexBuffer);var h=null;for(var u in o){var l=o[u],f=a[l.buffer],c=f._glBuffers[n];if(t.attributeData[u]){h!==c&&(s.bind(f),h=c);var d=t.attributeData[u].location;if(i.enableVertexAttribArray(d),i.vertexAttribPointer(d,l.size,l.type||i.FLOAT,l.normalized,l.stride,l.start),l.instance)if(this.hasInstance)i.vertexAttribDivisor(d,1);else throw new Error("geometry error, GPU Instancing is not supported on this device")}}},r.prototype.draw=function(e,t,i,n){var s=this.gl,a=this._activeGeometry;if(a.indexBuffer){var o=a.indexBuffer.data.BYTES_PER_ELEMENT,h=o===2?s.UNSIGNED_SHORT:s.UNSIGNED_INT;o===2||o===4&&this.canUseUInt32ElementIndex?a.instanced?s.drawElementsInstanced(e,t||a.indexBuffer.data.length,h,(i||0)*o,n||1):s.drawElements(e,t||a.indexBuffer.data.length,h,(i||0)*o):console.warn("unsupported index buffer type: uint32")}else a.instanced?s.drawArraysInstanced(e,i,t||a.getSize(),n||1):s.drawArrays(e,i,t||a.getSize());return this},r.prototype.unbind=function(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null},r.prototype.destroy=function(){this.renderer=null},r}(),h_=function(){function r(e){e===void 0&&(e=null),this.type=Pt.NONE,this.autoDetect=!0,this.maskObject=e||null,this.pooled=!1,this.isMaskData=!0,this.resolution=null,this.multisample=L.FILTER_MULTISAMPLE,this.enabled=!0,this.colorMask=15,this._filters=null,this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null,this._scissorRectLocal=null,this._colorMask=15,this._target=null}return Object.defineProperty(r.prototype,"filter",{get:function(){return this._filters?this._filters[0]:null},set:function(e){e?this._filters?this._filters[0]=e:this._filters=[e]:this._filters=null},enumerable:!1,configurable:!0}),r.prototype.reset=function(){this.pooled&&(this.maskObject=null,this.type=Pt.NONE,this.autoDetect=!0),this._target=null,this._scissorRectLocal=null},r.prototype.copyCountersOrReset=function(e){e?(this._stencilCounter=e._stencilCounter,this._scissorCounter=e._scissorCounter,this._scissorRect=e._scissorRect):(this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null)},r}();function Oh(r,e,t){var i=r.createShader(e);return r.shaderSource(i,t),r.compileShader(i),i}function Ah(r,e){var t=r.getShaderSource(e).split(`
14
+ Deprecated since v`+r),console.warn(i))),vh[e]=!0}}var _h={},Ue=Object.create(null),xi=Object.create(null),mh=function(){function r(e,t,i){this.canvas=L.ADAPTER.createCanvas(),this.context=this.canvas.getContext("2d"),this.resolution=i||L.RESOLUTION,this.resize(e,t)}return r.prototype.clear=function(){this.context.setTransform(1,0,0,1,0,0),this.context.clearRect(0,0,this.canvas.width,this.canvas.height)},r.prototype.resize=function(e,t){this.canvas.width=Math.round(e*this.resolution),this.canvas.height=Math.round(t*this.resolution)},r.prototype.destroy=function(){this.context=null,this.canvas=null},Object.defineProperty(r.prototype,"width",{get:function(){return this.canvas.width},set:function(e){this.canvas.width=Math.round(e)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"height",{get:function(){return this.canvas.height},set:function(e){this.canvas.height=Math.round(e)},enumerable:!1,configurable:!0}),r}();function Fv(r){var e=r.width,t=r.height,i=r.getContext("2d",{willReadFrequently:!0}),n=i.getImageData(0,0,e,t),s=n.data,a=s.length,o={top:null,left:null,right:null,bottom:null},h=null,u,l,f;for(u=0;u<a;u+=4)s[u+3]!==0&&(l=u/4%e,f=~~(u/4/e),o.top===null&&(o.top=f),(o.left===null||l<o.left)&&(o.left=l),(o.right===null||o.right<l)&&(o.right=l+1),(o.bottom===null||o.bottom<f)&&(o.bottom=f));return o.top!==null&&(e=o.right-o.left,t=o.bottom-o.top+1,h=i.getImageData(o.left,o.top,e,t)),{height:t,width:e,data:h}}var cn;function Nv(r,e){if(e===void 0&&(e=globalThis.location),r.indexOf("data:")===0)return"";e=e||globalThis.location,cn||(cn=document.createElement("a")),cn.href=r;var t=Hi.parse(cn.href),i=!t.port&&e.port===""||t.port===e.port;return t.hostname!==e.hostname||!i||t.protocol!==e.protocol?"anonymous":""}function dn(r,e){var t=L.RETINA_PREFIX.exec(r);return t?parseFloat(t[1]):e!==void 0?e:1}L.SORTABLE_CHILDREN=!1;var pn=function(){function r(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null,this.updateID=-1}return r.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},r.prototype.clear=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},r.prototype.getRectangle=function(e){return this.minX>this.maxX||this.minY>this.maxY?q.EMPTY:(e=e||new q(0,0,1,1),e.x=this.minX,e.y=this.minY,e.width=this.maxX-this.minX,e.height=this.maxY-this.minY,e)},r.prototype.addPoint=function(e){this.minX=Math.min(this.minX,e.x),this.maxX=Math.max(this.maxX,e.x),this.minY=Math.min(this.minY,e.y),this.maxY=Math.max(this.maxY,e.y)},r.prototype.addPointMatrix=function(e,t){var i=e.a,n=e.b,s=e.c,a=e.d,o=e.tx,h=e.ty,u=i*t.x+s*t.y+o,l=n*t.x+a*t.y+h;this.minX=Math.min(this.minX,u),this.maxX=Math.max(this.maxX,u),this.minY=Math.min(this.minY,l),this.maxY=Math.max(this.maxY,l)},r.prototype.addQuad=function(e){var t=this.minX,i=this.minY,n=this.maxX,s=this.maxY,a=e[0],o=e[1];t=a<t?a:t,i=o<i?o:i,n=a>n?a:n,s=o>s?o:s,a=e[2],o=e[3],t=a<t?a:t,i=o<i?o:i,n=a>n?a:n,s=o>s?o:s,a=e[4],o=e[5],t=a<t?a:t,i=o<i?o:i,n=a>n?a:n,s=o>s?o:s,a=e[6],o=e[7],t=a<t?a:t,i=o<i?o:i,n=a>n?a:n,s=o>s?o:s,this.minX=t,this.minY=i,this.maxX=n,this.maxY=s},r.prototype.addFrame=function(e,t,i,n,s){this.addFrameMatrix(e.worldTransform,t,i,n,s)},r.prototype.addFrameMatrix=function(e,t,i,n,s){var a=e.a,o=e.b,h=e.c,u=e.d,l=e.tx,f=e.ty,c=this.minX,d=this.minY,v=this.maxX,p=this.maxY,_=a*t+h*i+l,m=o*t+u*i+f;c=_<c?_:c,d=m<d?m:d,v=_>v?_:v,p=m>p?m:p,_=a*n+h*i+l,m=o*n+u*i+f,c=_<c?_:c,d=m<d?m:d,v=_>v?_:v,p=m>p?m:p,_=a*t+h*s+l,m=o*t+u*s+f,c=_<c?_:c,d=m<d?m:d,v=_>v?_:v,p=m>p?m:p,_=a*n+h*s+l,m=o*n+u*s+f,c=_<c?_:c,d=m<d?m:d,v=_>v?_:v,p=m>p?m:p,this.minX=c,this.minY=d,this.maxX=v,this.maxY=p},r.prototype.addVertexData=function(e,t,i){for(var n=this.minX,s=this.minY,a=this.maxX,o=this.maxY,h=t;h<i;h+=2){var u=e[h],l=e[h+1];n=u<n?u:n,s=l<s?l:s,a=u>a?u:a,o=l>o?l:o}this.minX=n,this.minY=s,this.maxX=a,this.maxY=o},r.prototype.addVertices=function(e,t,i,n){this.addVerticesMatrix(e.worldTransform,t,i,n)},r.prototype.addVerticesMatrix=function(e,t,i,n,s,a){s===void 0&&(s=0),a===void 0&&(a=s);for(var o=e.a,h=e.b,u=e.c,l=e.d,f=e.tx,c=e.ty,d=this.minX,v=this.minY,p=this.maxX,_=this.maxY,m=i;m<n;m+=2){var g=t[m],y=t[m+1],b=o*g+u*y+f,x=l*y+h*g+c;d=Math.min(d,b-s),p=Math.max(p,b+s),v=Math.min(v,x-a),_=Math.max(_,x+a)}this.minX=d,this.minY=v,this.maxX=p,this.maxY=_},r.prototype.addBounds=function(e){var t=this.minX,i=this.minY,n=this.maxX,s=this.maxY;this.minX=e.minX<t?e.minX:t,this.minY=e.minY<i?e.minY:i,this.maxX=e.maxX>n?e.maxX:n,this.maxY=e.maxY>s?e.maxY:s},r.prototype.addBoundsMask=function(e,t){var i=e.minX>t.minX?e.minX:t.minX,n=e.minY>t.minY?e.minY:t.minY,s=e.maxX<t.maxX?e.maxX:t.maxX,a=e.maxY<t.maxY?e.maxY:t.maxY;if(i<=s&&n<=a){var o=this.minX,h=this.minY,u=this.maxX,l=this.maxY;this.minX=i<o?i:o,this.minY=n<h?n:h,this.maxX=s>u?s:u,this.maxY=a>l?a:l}},r.prototype.addBoundsMatrix=function(e,t){this.addFrameMatrix(t,e.minX,e.minY,e.maxX,e.maxY)},r.prototype.addBoundsArea=function(e,t){var i=e.minX>t.x?e.minX:t.x,n=e.minY>t.y?e.minY:t.y,s=e.maxX<t.x+t.width?e.maxX:t.x+t.width,a=e.maxY<t.y+t.height?e.maxY:t.y+t.height;if(i<=s&&n<=a){var o=this.minX,h=this.minY,u=this.maxX,l=this.maxY;this.minX=i<o?i:o,this.minY=n<h?n:h,this.maxX=s>u?s:u,this.maxY=a>l?a:l}},r.prototype.pad=function(e,t){e===void 0&&(e=0),t===void 0&&(t=e),this.isEmpty()||(this.minX-=e,this.maxX+=e,this.minY-=t,this.maxY+=t)},r.prototype.addFramePad=function(e,t,i,n,s,a){e-=s,t-=a,i+=s,n+=a,this.minX=this.minX<e?this.minX:e,this.maxX=this.maxX>i?this.maxX:i,this.minY=this.minY<t?this.minY:t,this.maxY=this.maxY>n?this.maxY:n},r}();var As=function(r,e){return As=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},As(r,e)};function Is(r,e){As(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Tt=function(r){Is(e,r);function e(){var t=r.call(this)||this;return t.tempDisplayObjectParent=null,t.transform=new Ro,t.alpha=1,t.visible=!0,t.renderable=!0,t.cullable=!1,t.cullArea=null,t.parent=null,t.worldAlpha=1,t._lastSortedIndex=0,t._zIndex=0,t.filterArea=null,t.filters=null,t._enabledFilters=null,t._bounds=new pn,t._localBounds=null,t._boundsID=0,t._boundsRect=null,t._localBoundsRect=null,t._mask=null,t._maskRefCount=0,t._destroyed=!1,t.isSprite=!1,t.isMask=!1,t}return e.mixin=function(t){for(var i=Object.keys(t),n=0;n<i.length;++n){var s=i[n];Object.defineProperty(e.prototype,s,Object.getOwnPropertyDescriptor(t,s))}},Object.defineProperty(e.prototype,"destroyed",{get:function(){return this._destroyed},enumerable:!1,configurable:!0}),e.prototype._recursivePostUpdateTransform=function(){this.parent?(this.parent._recursivePostUpdateTransform(),this.transform.updateTransform(this.parent.transform)):this.transform.updateTransform(this._tempDisplayObjectParent.transform)},e.prototype.updateTransform=function(){this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha},e.prototype.getBounds=function(t,i){return t||(this.parent?(this._recursivePostUpdateTransform(),this.updateTransform()):(this.parent=this._tempDisplayObjectParent,this.updateTransform(),this.parent=null)),this._bounds.updateID!==this._boundsID&&(this.calculateBounds(),this._bounds.updateID=this._boundsID),i||(this._boundsRect||(this._boundsRect=new q),i=this._boundsRect),this._bounds.getRectangle(i)},e.prototype.getLocalBounds=function(t){t||(this._localBoundsRect||(this._localBoundsRect=new q),t=this._localBoundsRect),this._localBounds||(this._localBounds=new pn);var i=this.transform,n=this.parent;this.parent=null,this.transform=this._tempDisplayObjectParent.transform;var s=this._bounds,a=this._boundsID;this._bounds=this._localBounds;var o=this.getBounds(!1,t);return this.parent=n,this.transform=i,this._bounds=s,this._bounds.updateID+=this._boundsID-a,o},e.prototype.toGlobal=function(t,i,n){return n===void 0&&(n=!1),n||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.apply(t,i)},e.prototype.toLocal=function(t,i,n,s){return i&&(t=i.toGlobal(t,n,s)),s||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.applyInverse(t,n)},e.prototype.setParent=function(t){if(!t||!t.addChild)throw new Error("setParent: Argument must be a Container");return t.addChild(this),t},e.prototype.setTransform=function(t,i,n,s,a,o,h,u,l){return t===void 0&&(t=0),i===void 0&&(i=0),n===void 0&&(n=1),s===void 0&&(s=1),a===void 0&&(a=0),o===void 0&&(o=0),h===void 0&&(h=0),u===void 0&&(u=0),l===void 0&&(l=0),this.position.x=t,this.position.y=i,this.scale.x=n||1,this.scale.y=s||1,this.rotation=a,this.skew.x=o,this.skew.y=h,this.pivot.x=u,this.pivot.y=l,this},e.prototype.destroy=function(t){this.parent&&this.parent.removeChild(this),this._destroyed=!0,this.transform=null,this.parent=null,this._bounds=null,this.mask=null,this.cullArea=null,this.filters=null,this.filterArea=null,this.hitArea=null,this.interactive=!1,this.interactiveChildren=!1,this.emit("destroyed"),this.removeAllListeners()},Object.defineProperty(e.prototype,"_tempDisplayObjectParent",{get:function(){return this.tempDisplayObjectParent===null&&(this.tempDisplayObjectParent=new gh),this.tempDisplayObjectParent},enumerable:!1,configurable:!0}),e.prototype.enableTempParent=function(){var t=this.parent;return this.parent=this._tempDisplayObjectParent,t},e.prototype.disableTempParent=function(t){this.parent=t},Object.defineProperty(e.prototype,"x",{get:function(){return this.position.x},set:function(t){this.transform.position.x=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return this.position.y},set:function(t){this.transform.position.y=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"worldTransform",{get:function(){return this.transform.worldTransform},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"localTransform",{get:function(){return this.transform.localTransform},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"position",{get:function(){return this.transform.position},set:function(t){this.transform.position.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scale",{get:function(){return this.transform.scale},set:function(t){this.transform.scale.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pivot",{get:function(){return this.transform.pivot},set:function(t){this.transform.pivot.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"skew",{get:function(){return this.transform.skew},set:function(t){this.transform.skew.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rotation",{get:function(){return this.transform.rotation},set:function(t){this.transform.rotation=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"angle",{get:function(){return this.transform.rotation*wf},set:function(t){this.transform.rotation=t*Ef},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"zIndex",{get:function(){return this._zIndex},set:function(t){this._zIndex=t,this.parent&&(this.parent.sortDirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"worldVisible",{get:function(){var t=this;do{if(!t.visible)return!1;t=t.parent}while(t);return!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mask",{get:function(){return this._mask},set:function(t){if(this._mask!==t){if(this._mask){var i=this._mask.isMaskData?this._mask.maskObject:this._mask;i&&(i._maskRefCount--,i._maskRefCount===0&&(i.renderable=!0,i.isMask=!1))}if(this._mask=t,this._mask){var i=this._mask.isMaskData?this._mask.maskObject:this._mask;i&&(i._maskRefCount===0&&(i.renderable=!1,i.isMask=!0),i._maskRefCount++)}}},enumerable:!1,configurable:!0}),e}(pr),gh=function(r){Is(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.sortDirty=null,t}return e}(Tt);Tt.prototype.displayObjectUpdateTransform=Tt.prototype.updateTransform;function Lv(r,e){return r.zIndex===e.zIndex?r._lastSortedIndex-e._lastSortedIndex:r.zIndex-e.zIndex}var yt=function(r){Is(e,r);function e(){var t=r.call(this)||this;return t.children=[],t.sortableChildren=L.SORTABLE_CHILDREN,t.sortDirty=!1,t}return e.prototype.onChildrenChange=function(t){},e.prototype.addChild=function(){for(var t=arguments,i=[],n=0;n<arguments.length;n++)i[n]=t[n];if(i.length>1)for(var s=0;s<i.length;s++)this.addChild(i[s]);else{var a=i[0];a.parent&&a.parent.removeChild(a),a.parent=this,this.sortDirty=!0,a.transform._parentID=-1,this.children.push(a),this._boundsID++,this.onChildrenChange(this.children.length-1),this.emit("childAdded",a,this,this.children.length-1),a.emit("added",this)}return i[0]},e.prototype.addChildAt=function(t,i){if(i<0||i>this.children.length)throw new Error(t+"addChildAt: The index "+i+" supplied is out of bounds "+this.children.length);return t.parent&&t.parent.removeChild(t),t.parent=this,this.sortDirty=!0,t.transform._parentID=-1,this.children.splice(i,0,t),this._boundsID++,this.onChildrenChange(i),t.emit("added",this),this.emit("childAdded",t,this,i),t},e.prototype.swapChildren=function(t,i){if(t!==i){var n=this.getChildIndex(t),s=this.getChildIndex(i);this.children[n]=i,this.children[s]=t,this.onChildrenChange(n<s?n:s)}},e.prototype.getChildIndex=function(t){var i=this.children.indexOf(t);if(i===-1)throw new Error("The supplied DisplayObject must be a child of the caller");return i},e.prototype.setChildIndex=function(t,i){if(i<0||i>=this.children.length)throw new Error("The index "+i+" supplied is out of bounds "+this.children.length);var n=this.getChildIndex(t);Vi(this.children,n,1),this.children.splice(i,0,t),this.onChildrenChange(i)},e.prototype.getChildAt=function(t){if(t<0||t>=this.children.length)throw new Error("getChildAt: Index ("+t+") does not exist.");return this.children[t]},e.prototype.removeChild=function(){for(var t=arguments,i=[],n=0;n<arguments.length;n++)i[n]=t[n];if(i.length>1)for(var s=0;s<i.length;s++)this.removeChild(i[s]);else{var a=i[0],o=this.children.indexOf(a);if(o===-1)return null;a.parent=null,a.transform._parentID=-1,Vi(this.children,o,1),this._boundsID++,this.onChildrenChange(o),a.emit("removed",this),this.emit("childRemoved",a,this,o)}return i[0]},e.prototype.removeChildAt=function(t){var i=this.getChildAt(t);return i.parent=null,i.transform._parentID=-1,Vi(this.children,t,1),this._boundsID++,this.onChildrenChange(t),i.emit("removed",this),this.emit("childRemoved",i,this,t),i},e.prototype.removeChildren=function(t,i){t===void 0&&(t=0),i===void 0&&(i=this.children.length);var n=t,s=i,a=s-n,o;if(a>0&&a<=s){o=this.children.splice(n,a);for(var h=0;h<o.length;++h)o[h].parent=null,o[h].transform&&(o[h].transform._parentID=-1);this._boundsID++,this.onChildrenChange(t);for(var h=0;h<o.length;++h)o[h].emit("removed",this),this.emit("childRemoved",o[h],this,h);return o}else if(a===0&&this.children.length===0)return[];throw new RangeError("removeChildren: numeric values are outside the acceptable range.")},e.prototype.sortChildren=function(){for(var t=!1,i=0,n=this.children.length;i<n;++i){var s=this.children[i];s._lastSortedIndex=i,!t&&s.zIndex!==0&&(t=!0)}t&&this.children.length>1&&this.children.sort(Lv),this.sortDirty=!1},e.prototype.updateTransform=function(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(var t=0,i=this.children.length;t<i;++t){var n=this.children[t];n.visible&&n.updateTransform()}},e.prototype.calculateBounds=function(){this._bounds.clear(),this._calculateBounds();for(var t=0;t<this.children.length;t++){var i=this.children[t];if(!(!i.visible||!i.renderable))if(i.calculateBounds(),i._mask){var n=i._mask.isMaskData?i._mask.maskObject:i._mask;n?(n.calculateBounds(),this._bounds.addBoundsMask(i._bounds,n._bounds)):this._bounds.addBounds(i._bounds)}else i.filterArea?this._bounds.addBoundsArea(i._bounds,i.filterArea):this._bounds.addBounds(i._bounds)}this._bounds.updateID=this._boundsID},e.prototype.getLocalBounds=function(t,i){i===void 0&&(i=!1);var n=r.prototype.getLocalBounds.call(this,t);if(!i)for(var s=0,a=this.children.length;s<a;++s){var o=this.children[s];o.visible&&o.updateTransform()}return n},e.prototype._calculateBounds=function(){},e.prototype._renderWithCulling=function(t){var i=t.renderTexture.sourceFrame;if(i.width>0&&i.height>0){var n,s;if(this.cullArea?(n=this.cullArea,s=this.worldTransform):this._render!==e.prototype._render&&(n=this.getBounds(!0)),n&&i.intersects(n,s))this._render(t);else if(this.cullArea)return;for(var a=0,o=this.children.length;a<o;++a){var h=this.children[a],u=h.cullable;h.cullable=u||!this.cullArea,h.render(t),h.cullable=u}}},e.prototype.render=function(t){if(!(!this.visible||this.worldAlpha<=0||!this.renderable))if(this._mask||this.filters&&this.filters.length)this.renderAdvanced(t);else if(this.cullable)this._renderWithCulling(t);else{this._render(t);for(var i=0,n=this.children.length;i<n;++i)this.children[i].render(t)}},e.prototype.renderAdvanced=function(t){var i=this.filters,n=this._mask;if(i){this._enabledFilters||(this._enabledFilters=[]),this._enabledFilters.length=0;for(var s=0;s<i.length;s++)i[s].enabled&&this._enabledFilters.push(i[s])}var a=i&&this._enabledFilters&&this._enabledFilters.length||n&&(!n.isMaskData||n.enabled&&(n.autoDetect||n.type!==Pt.NONE));if(a&&t.batch.flush(),i&&this._enabledFilters&&this._enabledFilters.length&&t.filter.push(this,this._enabledFilters),n&&t.mask.push(this,this._mask),this.cullable)this._renderWithCulling(t);else{this._render(t);for(var s=0,o=this.children.length;s<o;++s)this.children[s].render(t)}a&&t.batch.flush(),n&&t.mask.pop(this),i&&this._enabledFilters&&this._enabledFilters.length&&t.filter.pop()},e.prototype._render=function(t){},e.prototype.destroy=function(t){r.prototype.destroy.call(this),this.sortDirty=!1;var i=typeof t=="boolean"?t:t&&t.children,n=this.removeChildren(0,this.children.length);if(i)for(var s=0;s<n.length;++s)n[s].destroy(t)},Object.defineProperty(e.prototype,"width",{get:function(){return this.scale.x*this.getLocalBounds().width},set:function(t){var i=this.getLocalBounds().width;i!==0?this.scale.x=t/i:this.scale.x=1,this._width=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.scale.y*this.getLocalBounds().height},set:function(t){var i=this.getLocalBounds().height;i!==0?this.scale.y=t/i:this.scale.y=1,this._height=t},enumerable:!1,configurable:!0}),e}(Tt);yt.prototype.containerUpdateTransform=yt.prototype.updateTransform;var xr=function(){return xr=Object.assign||function(e){for(var t=arguments,i,n=1,s=arguments.length;n<s;n++){i=t[n];for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(e[a]=i[a])}return e},xr.apply(this,arguments)},nt;(function(r){r.Application="application",r.RendererPlugin="renderer-webgl-plugin",r.CanvasRendererPlugin="renderer-canvas-plugin",r.Loader="loader",r.LoadParser="load-parser",r.ResolveParser="resolve-parser",r.CacheParser="cache-parser",r.DetectionParser="detection-parser"})(nt||(nt={}));var yh=function(r){if(typeof r=="function"||typeof r=="object"&&r.extension){if(!r.extension)throw new Error("Extension class must have an extension object");var e=typeof r.extension!="object"?{type:r.extension}:r.extension;r=xr(xr({},e),{ref:r})}if(typeof r=="object")r=xr({},r);else throw new Error("Invalid extension type");return typeof r.type=="string"&&(r.type=[r.type]),r},Ge={_addHandlers:null,_removeHandlers:null,_queue:{},remove:function(){for(var r=arguments,e=this,t=[],i=0;i<arguments.length;i++)t[i]=r[i];return t.map(yh).forEach(function(n){n.type.forEach(function(s){var a,o;return(o=(a=e._removeHandlers)[s])===null||o===void 0?void 0:o.call(a,n)})}),this},add:function(){for(var r=arguments,e=this,t=[],i=0;i<arguments.length;i++)t[i]=r[i];return t.map(yh).forEach(function(n){n.type.forEach(function(s){var a=e._addHandlers,o=e._queue;a[s]?a[s](n):(o[s]=o[s]||[],o[s].push(n))})}),this},handle:function(r,e,t){var i=this._addHandlers=this._addHandlers||{},n=this._removeHandlers=this._removeHandlers||{};if(i[r]||n[r])throw new Error("Extension type "+r+" already has a handler");i[r]=e,n[r]=t;var s=this._queue;return s[r]&&(s[r].forEach(function(a){return e(a)}),delete s[r]),this},handleByMap:function(r,e){return this.handle(r,function(t){e[t.name]=t.ref},function(t){delete e[t.name]})},handleByList:function(r,e){return this.handle(r,function(t){var i,n;e.push(t.ref),r===nt.Loader&&((n=(i=t.ref).add)===null||n===void 0||n.call(i))},function(t){var i=e.indexOf(t.ref);i!==-1&&e.splice(i,1)})}};var Bt=function(){function r(e){this.items=[],this._name=e,this._aliasCount=0}return r.prototype.emit=function(e,t,i,n,s,a,o,h){if(arguments.length>8)throw new Error("max arguments reached");var u=this,l=u.name,f=u.items;this._aliasCount++;for(var c=0,d=f.length;c<d;c++)f[c][l](e,t,i,n,s,a,o,h);return f===this.items&&this._aliasCount--,this},r.prototype.ensureNonAliasedItems=function(){this._aliasCount>0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))},r.prototype.add=function(e){return e[this._name]&&(this.ensureNonAliasedItems(),this.remove(e),this.items.push(e)),this},r.prototype.remove=function(e){var t=this.items.indexOf(e);return t!==-1&&(this.ensureNonAliasedItems(),this.items.splice(t,1)),this},r.prototype.contains=function(e){return this.items.indexOf(e)!==-1},r.prototype.removeAll=function(){return this.ensureNonAliasedItems(),this.items.length=0,this},r.prototype.destroy=function(){this.removeAll(),this.items=null,this._name=null},Object.defineProperty(r.prototype,"empty",{get:function(){return this.items.length===0},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"name",{get:function(){return this._name},enumerable:!1,configurable:!0}),r}();Object.defineProperties(Bt.prototype,{dispatch:{value:Bt.prototype.emit},run:{value:Bt.prototype.emit}});L.TARGET_FPMS=.06;var re;(function(r){r[r.INTERACTION=50]="INTERACTION",r[r.HIGH=25]="HIGH",r[r.NORMAL=0]="NORMAL",r[r.LOW=-25]="LOW",r[r.UTILITY=-50]="UTILITY"})(re||(re={}));var Ms=function(){function r(e,t,i,n){t===void 0&&(t=null),i===void 0&&(i=0),n===void 0&&(n=!1),this.next=null,this.previous=null,this._destroyed=!1,this.fn=e,this.context=t,this.priority=i,this.once=n}return r.prototype.match=function(e,t){return t===void 0&&(t=null),this.fn===e&&this.context===t},r.prototype.emit=function(e){this.fn&&(this.context?this.fn.call(this.context,e):this.fn(e));var t=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),t},r.prototype.connect=function(e){this.previous=e,e.next&&(e.next.previous=this),this.next=e.next,e.next=this},r.prototype.destroy=function(e){e===void 0&&(e=!1),this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);var t=this.next;return this.next=e?null:t,this.previous=null,t},r}(),Ft=function(){function r(){var e=this;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 Ms(null,null,1/0),this.deltaMS=1/L.TARGET_FPMS,this.elapsedMS=1/L.TARGET_FPMS,this._tick=function(t){e._requestId=null,e.started&&(e.update(t),e.started&&e._requestId===null&&e._head.next&&(e._requestId=requestAnimationFrame(e._tick)))}}return r.prototype._requestIfNeeded=function(){this._requestId===null&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))},r.prototype._cancelIfNeeded=function(){this._requestId!==null&&(cancelAnimationFrame(this._requestId),this._requestId=null)},r.prototype._startIfPossible=function(){this.started?this._requestIfNeeded():this.autoStart&&this.start()},r.prototype.add=function(e,t,i){return i===void 0&&(i=re.NORMAL),this._addListener(new Ms(e,t,i))},r.prototype.addOnce=function(e,t,i){return i===void 0&&(i=re.NORMAL),this._addListener(new Ms(e,t,i,!0))},r.prototype._addListener=function(e){var t=this._head.next,i=this._head;if(!t)e.connect(i);else{for(;t;){if(e.priority>t.priority){e.connect(i);break}i=t,t=t.next}e.previous||e.connect(i)}return this._startIfPossible(),this},r.prototype.remove=function(e,t){for(var i=this._head.next;i;)i.match(e,t)?i=i.destroy():i=i.next;return this._head.next||this._cancelIfNeeded(),this},Object.defineProperty(r.prototype,"count",{get:function(){if(!this._head)return 0;for(var e=0,t=this._head;t=t.next;)e++;return e},enumerable:!1,configurable:!0}),r.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},r.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},r.prototype.destroy=function(){if(!this._protected){this.stop();for(var e=this._head.next;e;)e=e.destroy(!0);this._head.destroy(),this._head=null}},r.prototype.update=function(e){e===void 0&&(e=performance.now());var t;if(e>this.lastTime){if(t=this.elapsedMS=e-this.lastTime,t>this._maxElapsedMS&&(t=this._maxElapsedMS),t*=this.speed,this._minElapsedMS){var i=e-this._lastFrame|0;if(i<this._minElapsedMS)return;this._lastFrame=e-i%this._minElapsedMS}this.deltaMS=t,this.deltaTime=this.deltaMS*L.TARGET_FPMS;for(var n=this._head,s=n.next;s;)s=s.emit(this.deltaTime);n.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=e},Object.defineProperty(r.prototype,"FPS",{get:function(){return 1e3/this.elapsedMS},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"minFPS",{get:function(){return 1e3/this._maxElapsedMS},set:function(e){var t=Math.min(this.maxFPS,e),i=Math.min(Math.max(0,t)/1e3,L.TARGET_FPMS);this._maxElapsedMS=1/i},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"maxFPS",{get:function(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0},set:function(e){if(e===0)this._minElapsedMS=0;else{var t=Math.max(this.minFPS,e);this._minElapsedMS=1/(t/1e3)}},enumerable:!1,configurable:!0}),Object.defineProperty(r,"shared",{get:function(){if(!r._shared){var e=r._shared=new r;e.autoStart=!0,e._protected=!0}return r._shared},enumerable:!1,configurable:!0}),Object.defineProperty(r,"system",{get:function(){if(!r._system){var e=r._system=new r;e.autoStart=!0,e._protected=!0}return r._system},enumerable:!1,configurable:!0}),r}(),Bv=function(){function r(){}return r.init=function(e){var t=this;e=Object.assign({autoStart:!0,sharedTicker:!1},e),Object.defineProperty(this,"ticker",{set:function(i){this._ticker&&this._ticker.remove(this.render,this),this._ticker=i,i&&i.add(this.render,this,re.LOW)},get:function(){return this._ticker}}),this.stop=function(){t._ticker.stop()},this.start=function(){t._ticker.start()},this._ticker=null,this.ticker=e.sharedTicker?Ft.shared:new Ft,e.autoStart&&this.start()},r.destroy=function(){if(this._ticker){var e=this._ticker;this.ticker=null,e.destroy()}},r.extension=nt.Application,r}();L.PREFER_ENV=Oe.any?Le.WEBGL:Le.WEBGL2,L.STRICT_TEXTURE_CACHE=!1;var Ds=[];function xh(r,e){if(!r)return null;var t="";if(typeof r=="string"){var i=/\.(\w{3,4})(?:$|\?|#)/i.exec(r);i&&(t=i[1].toLowerCase())}for(var n=Ds.length-1;n>=0;--n){var s=Ds[n];if(s.test&&s.test(r,t))return new s(r,e)}throw new Error("Unrecognized source type to auto-detect Resource")}var Fs=function(r,e){return Fs=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},Fs(r,e)};function ht(r,e){Fs(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Ns=function(){return Ns=Object.assign||function(e){for(var t=arguments,i,n=1,s=arguments.length;n<s;n++){i=t[n];for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(e[a]=i[a])}return e},Ns.apply(this,arguments)};function Uv(r,e){var t={};for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&e.indexOf(i)<0&&(t[i]=r[i]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(r);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(r,i[n])&&(t[i[n]]=r[i[n]]);return t}var br=function(){function r(e,t){e===void 0&&(e=0),t===void 0&&(t=0),this._width=e,this._height=t,this.destroyed=!1,this.internal=!1,this.onResize=new Bt("setRealSize"),this.onUpdate=new Bt("update"),this.onError=new Bt("onError")}return r.prototype.bind=function(e){this.onResize.add(e),this.onUpdate.add(e),this.onError.add(e),(this._width||this._height)&&this.onResize.emit(this._width,this._height)},r.prototype.unbind=function(e){this.onResize.remove(e),this.onUpdate.remove(e),this.onError.remove(e)},r.prototype.resize=function(e,t){(e!==this._width||t!==this._height)&&(this._width=e,this._height=t,this.onResize.emit(e,t))},Object.defineProperty(r.prototype,"valid",{get:function(){return!!this._width&&!!this._height},enumerable:!1,configurable:!0}),r.prototype.update=function(){this.destroyed||this.onUpdate.emit()},r.prototype.load=function(){return Promise.resolve(this)},Object.defineProperty(r.prototype,"width",{get:function(){return this._width},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"height",{get:function(){return this._height},enumerable:!1,configurable:!0}),r.prototype.style=function(e,t,i){return!1},r.prototype.dispose=function(){},r.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.dispose(),this.onError.removeAll(),this.onError=null,this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null)},r.test=function(e,t){return!1},r}(),Tr=function(r){ht(e,r);function e(t,i){var n=this,s=i||{},a=s.width,o=s.height;if(!a||!o)throw new Error("BufferResource width or height invalid");return n=r.call(this,a,o)||this,n.data=t,n}return e.prototype.upload=function(t,i,n){var s=t.gl;s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i.alphaMode===ve.UNPACK);var a=i.realWidth,o=i.realHeight;return n.width===a&&n.height===o?s.texSubImage2D(i.target,0,0,0,a,o,i.format,n.type,this.data):(n.width=a,n.height=o,s.texImage2D(i.target,0,n.internalFormat,a,o,0,i.format,n.type,this.data)),!0},e.prototype.dispose=function(){this.data=null},e.test=function(t){return t instanceof Float32Array||t instanceof Uint8Array||t instanceof Uint32Array},e}(br),Gv={scaleMode:Pe.NEAREST,format:D.RGBA,alphaMode:ve.NPM},tt=function(r){ht(e,r);function e(t,i){t===void 0&&(t=null),i===void 0&&(i=null);var n=r.call(this)||this;i=i||{};var s=i.alphaMode,a=i.mipmap,o=i.anisotropicLevel,h=i.scaleMode,u=i.width,l=i.height,f=i.wrapMode,c=i.format,d=i.type,v=i.target,p=i.resolution,_=i.resourceOptions;return t&&!(t instanceof br)&&(t=xh(t,_),t.internal=!0),n.resolution=p||L.RESOLUTION,n.width=Math.round((u||0)*n.resolution)/n.resolution,n.height=Math.round((l||0)*n.resolution)/n.resolution,n._mipmap=a!==void 0?a:L.MIPMAP_TEXTURES,n.anisotropicLevel=o!==void 0?o:L.ANISOTROPIC_LEVEL,n._wrapMode=f||L.WRAP_MODE,n._scaleMode=h!==void 0?h:L.SCALE_MODE,n.format=c||D.RGBA,n.type=d||k.UNSIGNED_BYTE,n.target=v||mi.TEXTURE_2D,n.alphaMode=s!==void 0?s:ve.UNPACK,n.uid=yi(),n.touched=0,n.isPowerOfTwo=!1,n._refreshPOT(),n._glTextures={},n.dirtyId=0,n.dirtyStyleId=0,n.cacheId=null,n.valid=u>0&&l>0,n.textureCacheIds=[],n.destroyed=!1,n.resource=null,n._batchEnabled=0,n._batchLocation=0,n.parentTextureArray=null,n.setResource(t),n}return Object.defineProperty(e.prototype,"realWidth",{get:function(){return Math.round(this.width*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"realHeight",{get:function(){return Math.round(this.height*this.resolution)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mipmap",{get:function(){return this._mipmap},set:function(t){this._mipmap!==t&&(this._mipmap=t,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scaleMode",{get:function(){return this._scaleMode},set:function(t){this._scaleMode!==t&&(this._scaleMode=t,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"wrapMode",{get:function(){return this._wrapMode},set:function(t){this._wrapMode!==t&&(this._wrapMode=t,this.dirtyStyleId++)},enumerable:!1,configurable:!0}),e.prototype.setStyle=function(t,i){var n;return t!==void 0&&t!==this.scaleMode&&(this.scaleMode=t,n=!0),i!==void 0&&i!==this.mipmap&&(this.mipmap=i,n=!0),n&&this.dirtyStyleId++,this},e.prototype.setSize=function(t,i,n){return n=n||this.resolution,this.setRealSize(t*n,i*n,n)},e.prototype.setRealSize=function(t,i,n){return this.resolution=n||this.resolution,this.width=Math.round(t)/this.resolution,this.height=Math.round(i)/this.resolution,this._refreshPOT(),this.update(),this},e.prototype._refreshPOT=function(){this.isPowerOfTwo=dh(this.realWidth)&&dh(this.realHeight)},e.prototype.setResolution=function(t){var i=this.resolution;return i===t?this:(this.resolution=t,this.valid&&(this.width=Math.round(this.width*i)/t,this.height=Math.round(this.height*i)/t,this.emit("update",this)),this._refreshPOT(),this)},e.prototype.setResource=function(t){if(this.resource===t)return this;if(this.resource)throw new Error("Resource can be set only once");return t.bind(this),this.resource=t,this},e.prototype.update=function(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))},e.prototype.onError=function(t){this.emit("error",this,t)},e.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete xi[this.cacheId],delete Ue[this.cacheId],this.cacheId=null),this.dispose(),e.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},e.prototype.dispose=function(){this.emit("dispose",this)},e.prototype.castToBaseTexture=function(){return this},e.from=function(t,i,n){n===void 0&&(n=L.STRICT_TEXTURE_CACHE);var s=typeof t=="string",a=null;if(s)a=t;else{if(!t._pixiId){var o=i&&i.pixiIdPrefix||"pixiid";t._pixiId=o+"_"+yi()}a=t._pixiId}var h=xi[a];if(s&&n&&!h)throw new Error('The cacheId "'+a+'" does not exist in BaseTextureCache.');return h||(h=new e(t,i),h.cacheId=a,e.addToCache(h,a)),h},e.fromBuffer=function(t,i,n,s){t=t||new Float32Array(i*n*4);var a=new Tr(t,{width:i,height:n}),o=t instanceof Float32Array?k.FLOAT:k.UNSIGNED_BYTE;return new e(a,Object.assign({},Gv,s||{width:i,height:n,type:o}))},e.addToCache=function(t,i){i&&(t.textureCacheIds.indexOf(i)===-1&&t.textureCacheIds.push(i),xi[i]&&console.warn("BaseTexture added to the cache with an id ["+i+"] that already had an entry"),xi[i]=t)},e.removeFromCache=function(t){if(typeof t=="string"){var i=xi[t];if(i){var n=i.textureCacheIds.indexOf(t);return n>-1&&i.textureCacheIds.splice(n,1),delete xi[t],i}}else if(t&&t.textureCacheIds){for(var s=0;s<t.textureCacheIds.length;++s)delete xi[t.textureCacheIds[s]];return t.textureCacheIds.length=0,t}return null},e._globalBatch=0,e}(pr),bh=function(r){ht(e,r);function e(t,i){var n=this,s=i||{},a=s.width,o=s.height;n=r.call(this,a,o)||this,n.items=[],n.itemDirtyIds=[];for(var h=0;h<t;h++){var u=new tt;n.items.push(u),n.itemDirtyIds.push(-2)}return n.length=t,n._load=null,n.baseTexture=null,n}return e.prototype.initFromArray=function(t,i){for(var n=0;n<this.length;n++)t[n]&&(t[n].castToBaseTexture?this.addBaseTextureAt(t[n].castToBaseTexture(),n):t[n]instanceof br?this.addResourceAt(t[n],n):this.addResourceAt(xh(t[n],i),n))},e.prototype.dispose=function(){for(var t=0,i=this.length;t<i;t++)this.items[t].destroy();this.items=null,this.itemDirtyIds=null,this._load=null},e.prototype.addResourceAt=function(t,i){if(!this.items[i])throw new Error("Index "+i+" is out of bounds");return t.valid&&!this.valid&&this.resize(t.width,t.height),this.items[i].setResource(t),this},e.prototype.bind=function(t){if(this.baseTexture!==null)throw new Error("Only one base texture per TextureArray is allowed");r.prototype.bind.call(this,t);for(var i=0;i<this.length;i++)this.items[i].parentTextureArray=t,this.items[i].on("update",t.update,t)},e.prototype.unbind=function(t){r.prototype.unbind.call(this,t);for(var i=0;i<this.length;i++)this.items[i].parentTextureArray=null,this.items[i].off("update",t.update,t)},e.prototype.load=function(){var t=this;if(this._load)return this._load;var i=this.items.map(function(s){return s.resource}).filter(function(s){return s}),n=i.map(function(s){return s.load()});return this._load=Promise.all(n).then(function(){var s=t.items[0],a=s.realWidth,o=s.realHeight;return t.resize(a,o),Promise.resolve(t)}),this._load},e}(br),kv=function(r){ht(e,r);function e(t,i){var n=this,s=i||{},a=s.width,o=s.height,h,u;return Array.isArray(t)?(h=t,u=t.length):u=t,n=r.call(this,u,{width:a,height:o})||this,h&&n.initFromArray(h,i),n}return e.prototype.addBaseTextureAt=function(t,i){if(t.resource)this.addResourceAt(t.resource,i);else throw new Error("ArrayResource does not support RenderTexture");return this},e.prototype.bind=function(t){r.prototype.bind.call(this,t),t.target=mi.TEXTURE_2D_ARRAY},e.prototype.upload=function(t,i,n){var s=this,a=s.length,o=s.itemDirtyIds,h=s.items,u=t.gl;n.dirtyId<0&&u.texImage3D(u.TEXTURE_2D_ARRAY,0,n.internalFormat,this._width,this._height,a,0,i.format,n.type,null);for(var l=0;l<a;l++){var f=h[l];o[l]<f.dirtyId&&(o[l]=f.dirtyId,f.valid&&u.texSubImage3D(u.TEXTURE_2D_ARRAY,0,0,0,l,f.resource.width,f.resource.height,1,i.format,n.type,f.resource.source))}return!0},e}(bh),Ke=function(r){ht(e,r);function e(t){var i=this,n=t,s=n.naturalWidth||n.videoWidth||n.width,a=n.naturalHeight||n.videoHeight||n.height;return i=r.call(this,s,a)||this,i.source=t,i.noSubImage=!1,i}return e.crossOrigin=function(t,i,n){n===void 0&&i.indexOf("data:")!==0?t.crossOrigin=Nv(i):n!==!1&&(t.crossOrigin=typeof n=="string"?n:"anonymous")},e.prototype.upload=function(t,i,n,s){var a=t.gl,o=i.realWidth,h=i.realHeight;if(s=s||this.source,s instanceof HTMLImageElement){if(!s.complete||s.naturalWidth===0)return!1}else if(s instanceof HTMLVideoElement&&s.readyState<=1)return!1;return a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i.alphaMode===ve.UNPACK),!this.noSubImage&&i.target===a.TEXTURE_2D&&n.width===o&&n.height===h?a.texSubImage2D(a.TEXTURE_2D,0,0,0,i.format,n.type,s):(n.width=o,n.height=h,a.texImage2D(i.target,0,n.internalFormat,i.format,n.type,s)),!0},e.prototype.update=function(){if(!this.destroyed){var t=this.source,i=t.naturalWidth||t.videoWidth||t.width,n=t.naturalHeight||t.videoHeight||t.height;this.resize(i,n),r.prototype.update.call(this)}},e.prototype.dispose=function(){this.source=null},e}(br),Xv=function(r){ht(e,r);function e(t){return r.call(this,t)||this}return e.test=function(t){var i=globalThis.OffscreenCanvas;return i&&t instanceof i?!0:globalThis.HTMLCanvasElement&&t instanceof HTMLCanvasElement},e}(Ke),Hv=function(r){ht(e,r);function e(t,i){var n=this,s=i||{},a=s.width,o=s.height,h=s.autoLoad,u=s.linkBaseTexture;if(t&&t.length!==e.SIDES)throw new Error("Invalid length. Got "+t.length+", expected 6");n=r.call(this,6,{width:a,height:o})||this;for(var l=0;l<e.SIDES;l++)n.items[l].target=mi.TEXTURE_CUBE_MAP_POSITIVE_X+l;return n.linkBaseTexture=u!==!1,t&&n.initFromArray(t,i),h!==!1&&n.load(),n}return e.prototype.bind=function(t){r.prototype.bind.call(this,t),t.target=mi.TEXTURE_CUBE_MAP},e.prototype.addBaseTextureAt=function(t,i,n){if(!this.items[i])throw new Error("Index "+i+" is out of bounds");if(!this.linkBaseTexture||t.parentTextureArray||Object.keys(t._glTextures).length>0)if(t.resource)this.addResourceAt(t.resource,i);else throw new Error("CubeResource does not support copying of renderTexture.");else t.target=mi.TEXTURE_CUBE_MAP_POSITIVE_X+i,t.parentTextureArray=this.baseTexture,this.items[i]=t;return t.valid&&!this.valid&&this.resize(t.realWidth,t.realHeight),this.items[i]=t,this},e.prototype.upload=function(t,i,n){for(var s=this.itemDirtyIds,a=0;a<e.SIDES;a++){var o=this.items[a];(s[a]<o.dirtyId||n.dirtyId<i.dirtyId)&&(o.valid&&o.resource?(o.resource.upload(t,o,n),s[a]=o.dirtyId):s[a]<-1&&(t.gl.texImage2D(o.target,0,n.internalFormat,i.realWidth,i.realHeight,0,i.format,n.type,null),s[a]=-1))}return!0},e.test=function(t){return Array.isArray(t)&&t.length===e.SIDES},e.SIDES=6,e}(bh),Th=function(r){ht(e,r);function e(t,i){var n=this;if(i=i||{},!(t instanceof HTMLImageElement)){var s=new Image;Ke.crossOrigin(s,t,i.crossorigin),s.src=t,t=s}return n=r.call(this,t)||this,!t.complete&&n._width&&n._height&&(n._width=0,n._height=0),n.url=t.src,n._process=null,n.preserveBitmap=!1,n.createBitmap=(i.createBitmap!==void 0?i.createBitmap:L.CREATE_IMAGE_BITMAP)&&!!globalThis.createImageBitmap,n.alphaMode=typeof i.alphaMode=="number"?i.alphaMode:null,n.bitmap=null,n._load=null,i.autoLoad!==!1&&n.load(),n}return e.prototype.load=function(t){var i=this;return this._load?this._load:(t!==void 0&&(this.createBitmap=t),this._load=new Promise(function(n,s){var a=i.source;i.url=a.src;var o=function(){i.destroyed||(a.onload=null,a.onerror=null,i.resize(a.width,a.height),i._load=null,i.createBitmap?n(i.process()):n(i))};a.complete&&a.src?o():(a.onload=o,a.onerror=function(h){s(h),i.onError.emit(h)})}),this._load)},e.prototype.process=function(){var t=this,i=this.source;if(this._process!==null)return this._process;if(this.bitmap!==null||!globalThis.createImageBitmap)return Promise.resolve(this);var n=globalThis.createImageBitmap,s=!i.crossOrigin||i.crossOrigin==="anonymous";return this._process=fetch(i.src,{mode:s?"cors":"no-cors"}).then(function(a){return a.blob()}).then(function(a){return n(a,0,0,i.width,i.height,{premultiplyAlpha:t.alphaMode===null||t.alphaMode===ve.UNPACK?"premultiply":"none"})}).then(function(a){return t.destroyed?Promise.reject():(t.bitmap=a,t.update(),t._process=null,Promise.resolve(t))}),this._process},e.prototype.upload=function(t,i,n){if(typeof this.alphaMode=="number"&&(i.alphaMode=this.alphaMode),!this.createBitmap)return r.prototype.upload.call(this,t,i,n);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(r.prototype.upload.call(this,t,i,n,this.bitmap),!this.preserveBitmap){var s=!0,a=i._glTextures;for(var o in a){var h=a[o];if(h!==n&&h.dirtyId!==i.dirtyId){s=!1;break}}s&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0},e.prototype.dispose=function(){this.source.onload=null,this.source.onerror=null,r.prototype.dispose.call(this),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null},e.test=function(t){return typeof t=="string"||t instanceof HTMLImageElement},e}(Ke),Wv=function(r){ht(e,r);function e(t,i){var n=this;return i=i||{},n=r.call(this,L.ADAPTER.createCanvas())||this,n._width=0,n._height=0,n.svg=t,n.scale=i.scale||1,n._overrideWidth=i.width,n._overrideHeight=i.height,n._resolve=null,n._crossorigin=i.crossorigin,n._load=null,i.autoLoad!==!1&&n.load(),n}return e.prototype.load=function(){var t=this;return this._load?this._load:(this._load=new Promise(function(i){if(t._resolve=function(){t.resize(t.source.width,t.source.height),i(t)},e.SVG_XML.test(t.svg.trim())){if(!btoa)throw new Error("Your browser doesn't support base64 conversions.");t.svg="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(t.svg)))}t._loadSvg()}),this._load)},e.prototype._loadSvg=function(){var t=this,i=new Image;Ke.crossOrigin(i,this.svg,this._crossorigin),i.src=this.svg,i.onerror=function(n){t._resolve&&(i.onerror=null,t.onError.emit(n))},i.onload=function(){if(t._resolve){var n=i.width,s=i.height;if(!n||!s)throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");var a=n*t.scale,o=s*t.scale;(t._overrideWidth||t._overrideHeight)&&(a=t._overrideWidth||t._overrideHeight/s*n,o=t._overrideHeight||t._overrideWidth/n*s),a=Math.round(a),o=Math.round(o);var h=t.source;h.width=a,h.height=o,h._pixiId="canvas_"+yi(),h.getContext("2d").drawImage(i,0,0,n,s,0,0,a,o),t._resolve(),t._resolve=null}}},e.getSize=function(t){var i=e.SVG_SIZE.exec(t),n={};return i&&(n[i[1]]=Math.round(parseFloat(i[3])),n[i[5]]=Math.round(parseFloat(i[7]))),n},e.prototype.dispose=function(){r.prototype.dispose.call(this),this._resolve=null,this._crossorigin=null},e.test=function(t,i){return i==="svg"||typeof t=="string"&&t.startsWith("data:image/svg+xml")||typeof t=="string"&&e.SVG_XML.test(t)},e.SVG_XML=/^(<\?xml[^?]+\?>)?\s*(<!--[^(-->)]*-->)?\s*\<svg/m,e.SVG_SIZE=/<svg[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i,e}(Ke),Vv=function(r){ht(e,r);function e(t,i){var n=this;if(i=i||{},!(t instanceof HTMLVideoElement)){var s=document.createElement("video");s.setAttribute("preload","auto"),s.setAttribute("webkit-playsinline",""),s.setAttribute("playsinline",""),typeof t=="string"&&(t=[t]);var a=t[0].src||t[0];Ke.crossOrigin(s,a,i.crossorigin);for(var o=0;o<t.length;++o){var h=document.createElement("source"),u=t[o],l=u.src,f=u.mime;l=l||t[o];var c=l.split("?").shift().toLowerCase(),d=c.slice(c.lastIndexOf(".")+1);f=f||e.MIME_TYPES[d]||"video/"+d,h.src=l,h.type=f,s.appendChild(h)}t=s}return n=r.call(this,t)||this,n.noSubImage=!0,n._autoUpdate=!0,n._isConnectedToTicker=!1,n._updateFPS=i.updateFPS||0,n._msToNextUpdate=0,n.autoPlay=i.autoPlay!==!1,n._load=null,n._resolve=null,n._onCanPlay=n._onCanPlay.bind(n),n._onError=n._onError.bind(n),i.autoLoad!==!1&&n.load(),n}return e.prototype.update=function(t){if(!this.destroyed){var i=Ft.shared.elapsedMS*this.source.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-i),(!this._updateFPS||this._msToNextUpdate<=0)&&(r.prototype.update.call(this),this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0)}},e.prototype.load=function(){var t=this;if(this._load)return this._load;var i=this.source;return(i.readyState===i.HAVE_ENOUGH_DATA||i.readyState===i.HAVE_FUTURE_DATA)&&i.width&&i.height&&(i.complete=!0),i.addEventListener("play",this._onPlayStart.bind(this)),i.addEventListener("pause",this._onPlayStop.bind(this)),this._isSourceReady()?this._onCanPlay():(i.addEventListener("canplay",this._onCanPlay),i.addEventListener("canplaythrough",this._onCanPlay),i.addEventListener("error",this._onError,!0)),this._load=new Promise(function(n){t.valid?n(t):(t._resolve=n,i.load())}),this._load},e.prototype._onError=function(t){this.source.removeEventListener("error",this._onError,!0),this.onError.emit(t)},e.prototype._isSourcePlaying=function(){var t=this.source;return!t.paused&&!t.ended&&this._isSourceReady()},e.prototype._isSourceReady=function(){var t=this.source;return t.readyState>2},e.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),this.autoUpdate&&!this._isConnectedToTicker&&(Ft.shared.add(this.update,this),this._isConnectedToTicker=!0)},e.prototype._onPlayStop=function(){this._isConnectedToTicker&&(Ft.shared.remove(this.update,this),this._isConnectedToTicker=!1)},e.prototype._onCanPlay=function(){var t=this.source;t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay);var i=this.valid;this.resize(t.videoWidth,t.videoHeight),!i&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&t.play()},e.prototype.dispose=function(){this._isConnectedToTicker&&(Ft.shared.remove(this.update,this),this._isConnectedToTicker=!1);var t=this.source;t&&(t.removeEventListener("error",this._onError,!0),t.pause(),t.src="",t.load()),r.prototype.dispose.call(this)},Object.defineProperty(e.prototype,"autoUpdate",{get:function(){return this._autoUpdate},set:function(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isConnectedToTicker?(Ft.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._isSourcePlaying()&&(Ft.shared.add(this.update,this),this._isConnectedToTicker=!0))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"updateFPS",{get:function(){return this._updateFPS},set:function(t){t!==this._updateFPS&&(this._updateFPS=t)},enumerable:!1,configurable:!0}),e.test=function(t,i){return globalThis.HTMLVideoElement&&t instanceof HTMLVideoElement||e.TYPES.indexOf(i)>-1},e.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],e.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"},e}(Ke),zv=function(r){ht(e,r);function e(t){return r.call(this,t)||this}return e.test=function(t){return!!globalThis.createImageBitmap&&typeof ImageBitmap<"u"&&t instanceof ImageBitmap},e}(Ke);Ds.push(Th,zv,Xv,Vv,Wv,Tr,Hv,kv);var Yv=function(r){ht(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.upload=function(t,i,n){var s=t.gl;s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i.alphaMode===ve.UNPACK);var a=i.realWidth,o=i.realHeight;return n.width===a&&n.height===o?s.texSubImage2D(i.target,0,0,0,a,o,i.format,n.type,this.data):(n.width=a,n.height=o,s.texImage2D(i.target,0,n.internalFormat,a,o,0,i.format,n.type,this.data)),!0},e}(Tr),Ls=function(){function r(e,t){this.width=Math.round(e||100),this.height=Math.round(t||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new Bt("disposeFramebuffer"),this.multisample=gt.NONE}return Object.defineProperty(r.prototype,"colorTexture",{get:function(){return this.colorTextures[0]},enumerable:!1,configurable:!0}),r.prototype.addColorTexture=function(e,t){return e===void 0&&(e=0),this.colorTextures[e]=t||new tt(null,{scaleMode:Pe.NEAREST,resolution:1,mipmap:pe.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},r.prototype.addDepthTexture=function(e){return this.depthTexture=e||new tt(new Yv(null,{width:this.width,height:this.height}),{scaleMode:Pe.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:pe.OFF,format:D.DEPTH_COMPONENT,type:k.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},r.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},r.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},r.prototype.resize=function(e,t){if(e=Math.round(e),t=Math.round(t),!(e===this.width&&t===this.height)){this.width=e,this.height=t,this.dirtyId++,this.dirtySize++;for(var i=0;i<this.colorTextures.length;i++){var n=this.colorTextures[i],s=n.resolution;n.setSize(e/s,t/s)}if(this.depthTexture){var s=this.depthTexture.resolution;this.depthTexture.setSize(e/s,t/s)}}},r.prototype.dispose=function(){this.disposeRunner.emit(this,!1)},r.prototype.destroyDepthTexture=function(){this.depthTexture&&(this.depthTexture.destroy(),this.depthTexture=null,++this.dirtyId,++this.dirtyFormat)},r}(),wh=function(r){ht(e,r);function e(t){t===void 0&&(t={});var i=this;if(typeof t=="number"){var n=arguments[0],s=arguments[1],a=arguments[2],o=arguments[3];t={width:n,height:s,scaleMode:a,resolution:o}}return t.width=t.width||100,t.height=t.height||100,t.multisample=t.multisample!==void 0?t.multisample:gt.NONE,i=r.call(this,null,t)||this,i.mipmap=pe.OFF,i.valid=!0,i.clearColor=[0,0,0,0],i.framebuffer=new Ls(i.realWidth,i.realHeight).addColorTexture(0,i),i.framebuffer.multisample=t.multisample,i.maskStack=[],i.filterStack=[{}],i}return e.prototype.resize=function(t,i){this.framebuffer.resize(t*this.resolution,i*this.resolution),this.setRealSize(this.framebuffer.width,this.framebuffer.height)},e.prototype.dispose=function(){this.framebuffer.dispose(),r.prototype.dispose.call(this)},e.prototype.destroy=function(){r.prototype.destroy.call(this),this.framebuffer.destroyDepthTexture(),this.framebuffer=null},e}(tt),Eh=function(){function r(){this.x0=0,this.y0=0,this.x1=1,this.y1=0,this.x2=1,this.y2=1,this.x3=0,this.y3=1,this.uvsFloat32=new Float32Array(8)}return r.prototype.set=function(e,t,i){var n=t.width,s=t.height;if(i){var a=e.width/2/n,o=e.height/2/s,h=e.x/n+a,u=e.y/s+o;i=dt.add(i,dt.NW),this.x0=h+a*dt.uX(i),this.y0=u+o*dt.uY(i),i=dt.add(i,2),this.x1=h+a*dt.uX(i),this.y1=u+o*dt.uY(i),i=dt.add(i,2),this.x2=h+a*dt.uX(i),this.y2=u+o*dt.uY(i),i=dt.add(i,2),this.x3=h+a*dt.uX(i),this.y3=u+o*dt.uY(i)}else this.x0=e.x/n,this.y0=e.y/s,this.x1=(e.x+e.width)/n,this.y1=e.y/s,this.x2=(e.x+e.width)/n,this.y2=(e.y+e.height)/s,this.x3=e.x/n,this.y3=(e.y+e.height)/s;this.uvsFloat32[0]=this.x0,this.uvsFloat32[1]=this.y0,this.uvsFloat32[2]=this.x1,this.uvsFloat32[3]=this.y1,this.uvsFloat32[4]=this.x2,this.uvsFloat32[5]=this.y2,this.uvsFloat32[6]=this.x3,this.uvsFloat32[7]=this.y3},r.prototype.toString=function(){return"[@pixi/core:TextureUvs "+("x0="+this.x0+" y0="+this.y0+" ")+("x1="+this.x1+" y1="+this.y1+" x2="+this.x2+" ")+("y2="+this.y2+" x3="+this.x3+" y3="+this.y3)+"]"},r}(),Sh=new Eh;function vn(r){r.destroy=function(){},r.on=function(){},r.once=function(){},r.emit=function(){}}var V=function(r){ht(e,r);function e(t,i,n,s,a,o){var h=r.call(this)||this;if(h.noFrame=!1,i||(h.noFrame=!0,i=new q(0,0,1,1)),t instanceof e&&(t=t.baseTexture),h.baseTexture=t,h._frame=i,h.trim=s,h.valid=!1,h._uvs=Sh,h.uvMatrix=null,h.orig=n||i,h._rotate=Number(a||0),a===!0)h._rotate=2;else if(h._rotate%2!==0)throw new Error("attempt to use diamond-shaped UVs. If you are sure, set rotation manually");return h.defaultAnchor=o?new j(o.x,o.y):new j(0,0),h._updateID=0,h.textureCacheIds=[],t.valid?h.noFrame?t.valid&&h.onBaseTextureUpdated(t):h.frame=i:t.once("loaded",h.onBaseTextureUpdated,h),h.noFrame&&t.on("update",h.onBaseTextureUpdated,h),h}return e.prototype.update=function(){this.baseTexture.resource&&this.baseTexture.resource.update()},e.prototype.onBaseTextureUpdated=function(t){if(this.noFrame){if(!this.baseTexture.valid)return;this._frame.width=t.width,this._frame.height=t.height,this.valid=!0,this.updateUvs()}else this.frame=this._frame;this.emit("update",this)},e.prototype.destroy=function(t){if(this.baseTexture){if(t){var i=this.baseTexture.resource;i&&i.url&&Ue[i.url]&&e.removeFromCache(i.url),this.baseTexture.destroy()}this.baseTexture.off("loaded",this.onBaseTextureUpdated,this),this.baseTexture.off("update",this.onBaseTextureUpdated,this),this.baseTexture=null}this._frame=null,this._uvs=null,this.trim=null,this.orig=null,this.valid=!1,e.removeFromCache(this),this.textureCacheIds=null},e.prototype.clone=function(){var t=this._frame.clone(),i=this._frame===this.orig?t:this.orig.clone(),n=new e(this.baseTexture,!this.noFrame&&t,i,this.trim&&this.trim.clone(),this.rotate,this.defaultAnchor);return this.noFrame&&(n._frame=t),n},e.prototype.updateUvs=function(){this._uvs===Sh&&(this._uvs=new Eh),this._uvs.set(this._frame,this.baseTexture,this.rotate),this._updateID++},e.from=function(t,i,n){i===void 0&&(i={}),n===void 0&&(n=L.STRICT_TEXTURE_CACHE);var s=typeof t=="string",a=null;if(s)a=t;else if(t instanceof tt){if(!t.cacheId){var o=i&&i.pixiIdPrefix||"pixiid";t.cacheId=o+"-"+yi(),tt.addToCache(t,t.cacheId)}a=t.cacheId}else{if(!t._pixiId){var o=i&&i.pixiIdPrefix||"pixiid";t._pixiId=o+"_"+yi()}a=t._pixiId}var h=Ue[a];if(s&&n&&!h)throw new Error('The cacheId "'+a+'" does not exist in TextureCache.');return!h&&!(t instanceof tt)?(i.resolution||(i.resolution=dn(t)),h=new e(new tt(t,i)),h.baseTexture.cacheId=a,tt.addToCache(h.baseTexture,a),e.addToCache(h,a)):!h&&t instanceof tt&&(h=new e(t),e.addToCache(h,a)),h},e.fromURL=function(t,i){var n=Object.assign({autoLoad:!1},i==null?void 0:i.resourceOptions),s=e.from(t,Object.assign({resourceOptions:n},i),!1),a=s.baseTexture.resource;return s.baseTexture.valid?Promise.resolve(s):a.load().then(function(){return Promise.resolve(s)})},e.fromBuffer=function(t,i,n,s){return new e(tt.fromBuffer(t,i,n,s))},e.fromLoader=function(t,i,n,s){var a=new tt(t,Object.assign({scaleMode:L.SCALE_MODE,resolution:dn(i)},s)),o=a.resource;o instanceof Th&&(o.url=i);var h=new e(a);return n||(n=i),tt.addToCache(h.baseTexture,n),e.addToCache(h,n),n!==i&&(tt.addToCache(h.baseTexture,i),e.addToCache(h,i)),h.baseTexture.valid?Promise.resolve(h):new Promise(function(u){h.baseTexture.once("loaded",function(){return u(h)})})},e.addToCache=function(t,i){i&&(t.textureCacheIds.indexOf(i)===-1&&t.textureCacheIds.push(i),Ue[i]&&console.warn("Texture added to the cache with an id ["+i+"] that already had an entry"),Ue[i]=t)},e.removeFromCache=function(t){if(typeof t=="string"){var i=Ue[t];if(i){var n=i.textureCacheIds.indexOf(t);return n>-1&&i.textureCacheIds.splice(n,1),delete Ue[t],i}}else if(t&&t.textureCacheIds){for(var s=0;s<t.textureCacheIds.length;++s)Ue[t.textureCacheIds[s]]===t&&delete Ue[t.textureCacheIds[s]];return t.textureCacheIds.length=0,t}return null},Object.defineProperty(e.prototype,"resolution",{get:function(){return this.baseTexture.resolution},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"frame",{get:function(){return this._frame},set:function(t){this._frame=t,this.noFrame=!1;var i=t.x,n=t.y,s=t.width,a=t.height,o=i+s>this.baseTexture.width,h=n+a>this.baseTexture.height;if(o||h){var u=o&&h?"and":"or",l="X: "+i+" + "+s+" = "+(i+s)+" > "+this.baseTexture.width,f="Y: "+n+" + "+a+" = "+(n+a)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+(l+" "+u+" "+f))}this.valid=s&&a&&this.baseTexture.valid,!this.trim&&!this.rotate&&(this.orig=t),this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rotate",{get:function(){return this._rotate},set:function(t){this._rotate=t,this.valid&&this.updateUvs()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.orig.width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.orig.height},enumerable:!1,configurable:!0}),e.prototype.castToBaseTexture=function(){return this.baseTexture},Object.defineProperty(e,"EMPTY",{get:function(){return e._EMPTY||(e._EMPTY=new e(new tt),vn(e._EMPTY),vn(e._EMPTY.baseTexture)),e._EMPTY},enumerable:!1,configurable:!0}),Object.defineProperty(e,"WHITE",{get:function(){if(!e._WHITE){var t=L.ADAPTER.createCanvas(16,16),i=t.getContext("2d");t.width=16,t.height=16,i.fillStyle="white",i.fillRect(0,0,16,16),e._WHITE=new e(tt.from(t)),vn(e._WHITE),vn(e._WHITE.baseTexture)}return e._WHITE},enumerable:!1,configurable:!0}),e}(pr),bi=function(r){ht(e,r);function e(t,i){var n=r.call(this,t,i)||this;return n.valid=!0,n.filterFrame=null,n.filterPoolKey=null,n.updateUvs(),n}return Object.defineProperty(e.prototype,"framebuffer",{get:function(){return this.baseTexture.framebuffer},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"multisample",{get:function(){return this.framebuffer.multisample},set:function(t){this.framebuffer.multisample=t},enumerable:!1,configurable:!0}),e.prototype.resize=function(t,i,n){n===void 0&&(n=!0);var s=this.baseTexture.resolution,a=Math.round(t*s)/s,o=Math.round(i*s)/s;this.valid=a>0&&o>0,this._frame.width=this.orig.width=a,this._frame.height=this.orig.height=o,n&&this.baseTexture.resize(a,o),this.updateUvs()},e.prototype.setResolution=function(t){var i=this.baseTexture;i.resolution!==t&&(i.setResolution(t),this.resize(i.width,i.height,!1))},e.create=function(t){for(var i=arguments,n=[],s=1;s<arguments.length;s++)n[s-1]=i[s];return typeof t=="number"&&(ge("6.0.0","Arguments (width, height, scaleMode, resolution) have been deprecated."),t={width:t,height:n[0],scaleMode:n[1],resolution:n[2]}),new e(new wh(t))},e}(V),jv=function(){function r(e){this.texturePool={},this.textureOptions=e||{},this.enableFullScreen=!1,this._pixelsWidth=0,this._pixelsHeight=0}return r.prototype.createTexture=function(e,t,i){i===void 0&&(i=gt.NONE);var n=new wh(Object.assign({width:e,height:t,resolution:1,multisample:i},this.textureOptions));return new bi(n)},r.prototype.getOptimalTexture=function(e,t,i,n){i===void 0&&(i=1),n===void 0&&(n=gt.NONE);var s;e=Math.ceil(e*i-1e-6),t=Math.ceil(t*i-1e-6),!this.enableFullScreen||e!==this._pixelsWidth||t!==this._pixelsHeight?(e=fn(e),t=fn(t),s=((e&65535)<<16|t&65535)>>>0,n>1&&(s+=n*4294967296)):s=n>1?-n:-1,this.texturePool[s]||(this.texturePool[s]=[]);var a=this.texturePool[s].pop();return a||(a=this.createTexture(e,t,n)),a.filterPoolKey=s,a.setResolution(i),a},r.prototype.getFilterTexture=function(e,t,i){var n=this.getOptimalTexture(e.width,e.height,t||e.resolution,i||gt.NONE);return n.filterFrame=e.filterFrame,n},r.prototype.returnTexture=function(e){var t=e.filterPoolKey;e.filterFrame=null,this.texturePool[t].push(e)},r.prototype.returnFilterTexture=function(e){this.returnTexture(e)},r.prototype.clear=function(e){if(e=e!==!1,e)for(var t in this.texturePool){var i=this.texturePool[t];if(i)for(var n=0;n<i.length;n++)i[n].destroy(!0)}this.texturePool={}},r.prototype.setScreenSize=function(e){if(!(e.width===this._pixelsWidth&&e.height===this._pixelsHeight)){this.enableFullScreen=e.width>0&&e.height>0;for(var t in this.texturePool)if(Number(t)<0){var i=this.texturePool[t];if(i)for(var n=0;n<i.length;n++)i[n].destroy(!0);this.texturePool[t]=[]}this._pixelsWidth=e.width,this._pixelsHeight=e.height}},r.SCREEN_KEY=-1,r}(),Ph=function(){function r(e,t,i,n,s,a,o){t===void 0&&(t=0),i===void 0&&(i=!1),n===void 0&&(n=k.FLOAT),this.buffer=e,this.size=t,this.normalized=i,this.type=n,this.stride=s,this.start=a,this.instance=o}return r.prototype.destroy=function(){this.buffer=null},r.from=function(e,t,i,n,s){return new r(e,t,i,n,s)},r}(),Zv=0,At=function(){function r(e,t,i){t===void 0&&(t=!0),i===void 0&&(i=!1),this.data=e||new Float32Array(1),this._glBuffers={},this._updateID=0,this.index=i,this.static=t,this.id=Zv++,this.disposeRunner=new Bt("disposeBuffer")}return r.prototype.update=function(e){e instanceof Array&&(e=new Float32Array(e)),this.data=e||this.data,this._updateID++},r.prototype.dispose=function(){this.disposeRunner.emit(this,!1)},r.prototype.destroy=function(){this.dispose(),this.data=null},Object.defineProperty(r.prototype,"index",{get:function(){return this.type===Ce.ELEMENT_ARRAY_BUFFER},set:function(e){this.type=e?Ce.ELEMENT_ARRAY_BUFFER:Ce.ARRAY_BUFFER},enumerable:!1,configurable:!0}),r.from=function(e){return e instanceof Array&&(e=new Float32Array(e)),new r(e)},r}(),qv={Float32Array,Uint32Array,Int32Array,Uint8Array};function Kv(r,e){for(var t=0,i=0,n={},s=0;s<r.length;s++)i+=e[s],t+=r[s].length;for(var a=new ArrayBuffer(t*4),o=null,h=0,s=0;s<r.length;s++){var u=e[s],l=r[s],f=ch(l);n[f]||(n[f]=new qv[f](a)),o=n[f];for(var c=0;c<l.length;c++){var d=(c/u|0)*i+h,v=c%u;o[d+v]=l[c]}h+=u}return new Float32Array(a)}var Rh={5126:4,5123:2,5121:1},$v=0,Jv={Float32Array,Uint32Array,Int32Array,Uint8Array,Uint16Array},wr=function(){function r(e,t){e===void 0&&(e=[]),t===void 0&&(t={}),this.buffers=e,this.indexBuffer=null,this.attributes=t,this.glVertexArrayObjects={},this.id=$v++,this.instanced=!1,this.instanceCount=1,this.disposeRunner=new Bt("disposeGeometry"),this.refCount=0}return r.prototype.addAttribute=function(e,t,i,n,s,a,o,h){if(i===void 0&&(i=0),n===void 0&&(n=!1),h===void 0&&(h=!1),!t)throw new Error("You must pass a buffer when creating an attribute");t instanceof At||(t instanceof Array&&(t=new Float32Array(t)),t=new At(t));var u=e.split("|");if(u.length>1){for(var l=0;l<u.length;l++)this.addAttribute(u[l],t,i,n,s);return this}var f=this.buffers.indexOf(t);return f===-1&&(this.buffers.push(t),f=this.buffers.length-1),this.attributes[e]=new Ph(f,i,n,s,a,o,h),this.instanced=this.instanced||h,this},r.prototype.getAttribute=function(e){return this.attributes[e]},r.prototype.getBuffer=function(e){return this.buffers[this.getAttribute(e).buffer]},r.prototype.addIndex=function(e){return e instanceof At||(e instanceof Array&&(e=new Uint16Array(e)),e=new At(e)),e.type=Ce.ELEMENT_ARRAY_BUFFER,this.indexBuffer=e,this.buffers.indexOf(e)===-1&&this.buffers.push(e),this},r.prototype.getIndex=function(){return this.indexBuffer},r.prototype.interleave=function(){if(this.buffers.length===1||this.buffers.length===2&&this.indexBuffer)return this;var e=[],t=[],i=new At,n;for(n in this.attributes){var s=this.attributes[n],a=this.buffers[s.buffer];e.push(a.data),t.push(s.size*Rh[s.type]/4),s.buffer=0}for(i.data=Kv(e,t),n=0;n<this.buffers.length;n++)this.buffers[n]!==this.indexBuffer&&this.buffers[n].destroy();return this.buffers=[i],this.indexBuffer&&this.buffers.push(this.indexBuffer),this},r.prototype.getSize=function(){for(var e in this.attributes){var t=this.attributes[e],i=this.buffers[t.buffer];return i.data.length/(t.stride/4||t.size)}return 0},r.prototype.dispose=function(){this.disposeRunner.emit(this,!1)},r.prototype.destroy=function(){this.dispose(),this.buffers=null,this.indexBuffer=null,this.attributes=null},r.prototype.clone=function(){for(var e=new r,t=0;t<this.buffers.length;t++)e.buffers[t]=new At(this.buffers[t].data.slice(0));for(var t in this.attributes){var i=this.attributes[t];e.attributes[t]=new Ph(i.buffer,i.size,i.normalized,i.type,i.stride,i.start,i.instance)}return this.indexBuffer&&(e.indexBuffer=e.buffers[this.buffers.indexOf(this.indexBuffer)],e.indexBuffer.type=Ce.ELEMENT_ARRAY_BUFFER),e},r.merge=function(e){for(var t=new r,i=[],n=[],s=[],a,o=0;o<e.length;o++){a=e[o];for(var h=0;h<a.buffers.length;h++)n[h]=n[h]||0,n[h]+=a.buffers[h].data.length,s[h]=0}for(var o=0;o<a.buffers.length;o++)i[o]=new Jv[ch(a.buffers[o].data)](n[o]),t.buffers[o]=new At(i[o]);for(var o=0;o<e.length;o++){a=e[o];for(var h=0;h<a.buffers.length;h++)i[h].set(a.buffers[h].data,s[h]),s[h]+=a.buffers[h].data.length}if(t.attributes=a.attributes,a.indexBuffer){t.indexBuffer=t.buffers[a.buffers.indexOf(a.indexBuffer)],t.indexBuffer.type=Ce.ELEMENT_ARRAY_BUFFER;for(var u=0,l=0,f=0,c=0,o=0;o<a.buffers.length;o++)if(a.buffers[o]!==a.indexBuffer){c=o;break}for(var o in a.attributes){var d=a.attributes[o];(d.buffer|0)===c&&(l+=d.size*Rh[d.type]/4)}for(var o=0;o<e.length;o++){for(var v=e[o].indexBuffer.data,h=0;h<v.length;h++)t.indexBuffer.data[h+f]+=u;u+=e[o].buffers[c].data.length/l,f+=v.length}}return t},r}(),Qv=function(r){ht(e,r);function e(){var t=r.call(this)||this;return t.addAttribute("aVertexPosition",new Float32Array([0,0,1,0,1,1,0,1])).addIndex([0,1,3,2]),t}return e}(wr),Ch=function(r){ht(e,r);function e(){var t=r.call(this)||this;return t.vertices=new Float32Array([-1,-1,1,-1,1,1,-1,1]),t.uvs=new Float32Array([0,0,1,0,1,1,0,1]),t.vertexBuffer=new At(t.vertices),t.uvBuffer=new At(t.uvs),t.addAttribute("aVertexPosition",t.vertexBuffer).addAttribute("aTextureCoord",t.uvBuffer).addIndex([0,1,2,0,2,3]),t}return e.prototype.map=function(t,i){var n=0,s=0;return this.uvs[0]=n,this.uvs[1]=s,this.uvs[2]=n+i.width/t.width,this.uvs[3]=s,this.uvs[4]=n+i.width/t.width,this.uvs[5]=s+i.height/t.height,this.uvs[6]=n,this.uvs[7]=s+i.height/t.height,n=i.x,s=i.y,this.vertices[0]=n,this.vertices[1]=s,this.vertices[2]=n+i.width,this.vertices[3]=s,this.vertices[4]=n+i.width,this.vertices[5]=s+i.height,this.vertices[6]=n,this.vertices[7]=s+i.height,this.invalidate(),this},e.prototype.invalidate=function(){return this.vertexBuffer._updateID++,this.uvBuffer._updateID++,this},e}(wr),t_=0,Ti=function(){function r(e,t,i){this.group=!0,this.syncUniforms={},this.dirtyId=0,this.id=t_++,this.static=!!t,this.ubo=!!i,e instanceof At?(this.buffer=e,this.buffer.type=Ce.UNIFORM_BUFFER,this.autoManage=!1,this.ubo=!0):(this.uniforms=e,this.ubo&&(this.buffer=new At(new Float32Array(1)),this.buffer.type=Ce.UNIFORM_BUFFER,this.autoManage=!0))}return r.prototype.update=function(){this.dirtyId++,!this.autoManage&&this.buffer&&this.buffer.update()},r.prototype.add=function(e,t,i){if(!this.ubo)this.uniforms[e]=new r(t,i);else throw new Error("[UniformGroup] uniform groups in ubo mode cannot be modified, or have uniform groups nested in them")},r.from=function(e,t,i){return new r(e,t,i)},r.uboFrom=function(e,t){return new r(e,t??!0,!0)},r}(),e_=function(){function r(){this.renderTexture=null,this.target=null,this.legacy=!1,this.resolution=1,this.multisample=gt.NONE,this.sourceFrame=new q,this.destinationFrame=new q,this.bindingSourceFrame=new q,this.bindingDestinationFrame=new q,this.filters=[],this.transform=null}return r.prototype.clear=function(){this.target=null,this.filters=null,this.renderTexture=null},r}(),_n=[new j,new j,new j,new j],Bs=new Ct,i_=function(){function r(e){this.renderer=e,this.defaultFilterStack=[{}],this.texturePool=new jv,this.texturePool.setScreenSize(e.view),this.statePool=[],this.quad=new Qv,this.quadUv=new Ch,this.tempRect=new q,this.activeState={},this.globalUniforms=new Ti({outputFrame:new q,inputSize:new Float32Array(4),inputPixel:new Float32Array(4),inputClamp:new Float32Array(4),resolution:1,filterArea:new Float32Array(4),filterClamp:new Float32Array(4)},!0),this.forceClear=!1,this.useMaxPadding=!1}return r.prototype.push=function(e,t){for(var i,n,s=this.renderer,a=this.defaultFilterStack,o=this.statePool.pop()||new e_,h=this.renderer.renderTexture,u=t[0].resolution,l=t[0].multisample,f=t[0].padding,c=t[0].autoFit,d=(i=t[0].legacy)!==null&&i!==void 0?i:!0,v=1;v<t.length;v++){var p=t[v];u=Math.min(u,p.resolution),l=Math.min(l,p.multisample),f=this.useMaxPadding?Math.max(f,p.padding):f+p.padding,c=c&&p.autoFit,d=d||((n=p.legacy)!==null&&n!==void 0?n:!0)}a.length===1&&(this.defaultFilterStack[0].renderTexture=h.current),a.push(o),o.resolution=u,o.multisample=l,o.legacy=d,o.target=e,o.sourceFrame.copyFrom(e.filterArea||e.getBounds(!0)),o.sourceFrame.pad(f);var _=this.tempRect.copyFrom(h.sourceFrame);s.projection.transform&&this.transformAABB(Bs.copyFrom(s.projection.transform).invert(),_),c?(o.sourceFrame.fit(_),(o.sourceFrame.width<=0||o.sourceFrame.height<=0)&&(o.sourceFrame.width=0,o.sourceFrame.height=0)):o.sourceFrame.intersects(_)||(o.sourceFrame.width=0,o.sourceFrame.height=0),this.roundFrame(o.sourceFrame,h.current?h.current.resolution:s.resolution,h.sourceFrame,h.destinationFrame,s.projection.transform),o.renderTexture=this.getOptimalFilterTexture(o.sourceFrame.width,o.sourceFrame.height,u,l),o.filters=t,o.destinationFrame.width=o.renderTexture.width,o.destinationFrame.height=o.renderTexture.height;var m=this.tempRect;m.x=0,m.y=0,m.width=o.sourceFrame.width,m.height=o.sourceFrame.height,o.renderTexture.filterFrame=o.sourceFrame,o.bindingSourceFrame.copyFrom(h.sourceFrame),o.bindingDestinationFrame.copyFrom(h.destinationFrame),o.transform=s.projection.transform,s.projection.transform=null,h.bind(o.renderTexture,o.sourceFrame,m),s.framebuffer.clear(0,0,0,0)},r.prototype.pop=function(){var e=this.defaultFilterStack,t=e.pop(),i=t.filters;this.activeState=t;var n=this.globalUniforms.uniforms;n.outputFrame=t.sourceFrame,n.resolution=t.resolution;var s=n.inputSize,a=n.inputPixel,o=n.inputClamp;if(s[0]=t.destinationFrame.width,s[1]=t.destinationFrame.height,s[2]=1/s[0],s[3]=1/s[1],a[0]=Math.round(s[0]*t.resolution),a[1]=Math.round(s[1]*t.resolution),a[2]=1/a[0],a[3]=1/a[1],o[0]=.5*a[2],o[1]=.5*a[3],o[2]=t.sourceFrame.width*s[2]-.5*a[2],o[3]=t.sourceFrame.height*s[3]-.5*a[3],t.legacy){var h=n.filterArea;h[0]=t.destinationFrame.width,h[1]=t.destinationFrame.height,h[2]=t.sourceFrame.x,h[3]=t.sourceFrame.y,n.filterClamp=n.inputClamp}this.globalUniforms.update();var u=e[e.length-1];if(this.renderer.framebuffer.blit(),i.length===1)i[0].apply(this,t.renderTexture,u.renderTexture,_e.BLEND,t),this.returnFilterTexture(t.renderTexture);else{var l=t.renderTexture,f=this.getOptimalFilterTexture(l.width,l.height,t.resolution);f.filterFrame=l.filterFrame;var c=0;for(c=0;c<i.length-1;++c){c===1&&t.multisample>1&&(f=this.getOptimalFilterTexture(l.width,l.height,t.resolution),f.filterFrame=l.filterFrame),i[c].apply(this,l,f,_e.CLEAR,t);var d=l;l=f,f=d}i[c].apply(this,l,u.renderTexture,_e.BLEND,t),c>1&&t.multisample>1&&this.returnFilterTexture(t.renderTexture),this.returnFilterTexture(l),this.returnFilterTexture(f)}t.clear(),this.statePool.push(t)},r.prototype.bindAndClear=function(e,t){t===void 0&&(t=_e.CLEAR);var i=this.renderer,n=i.renderTexture,s=i.state;if(e===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,e&&e.filterFrame){var a=this.tempRect;a.x=0,a.y=0,a.width=e.filterFrame.width,a.height=e.filterFrame.height,n.bind(e,e.filterFrame,a)}else e!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?n.bind(e):this.renderer.renderTexture.bind(e,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);var o=s.stateId&1||this.forceClear;(t===_e.CLEAR||t===_e.BLIT&&o)&&this.renderer.framebuffer.clear(0,0,0,0)},r.prototype.applyFilter=function(e,t,i,n){var s=this.renderer;s.state.set(e.state),this.bindAndClear(i,n),e.uniforms.uSampler=t,e.uniforms.filterGlobals=this.globalUniforms,s.shader.bind(e),e.legacy=!!e.program.attributeData.aTextureCoord,e.legacy?(this.quadUv.map(t._frame,t.filterFrame),s.geometry.bind(this.quadUv),s.geometry.draw(de.TRIANGLES)):(s.geometry.bind(this.quad),s.geometry.draw(de.TRIANGLE_STRIP))},r.prototype.calculateSpriteMatrix=function(e,t){var i=this.activeState,n=i.sourceFrame,s=i.destinationFrame,a=t._texture.orig,o=e.set(s.width,0,0,s.height,n.x,n.y),h=t.worldTransform.copyTo(Ct.TEMP_MATRIX);return h.invert(),o.prepend(h),o.scale(1/a.width,1/a.height),o.translate(t.anchor.x,t.anchor.y),o},r.prototype.destroy=function(){this.renderer=null,this.texturePool.clear(!1)},r.prototype.getOptimalFilterTexture=function(e,t,i,n){return i===void 0&&(i=1),n===void 0&&(n=gt.NONE),this.texturePool.getOptimalTexture(e,t,i,n)},r.prototype.getFilterTexture=function(e,t,i){if(typeof e=="number"){var n=e;e=t,t=n}e=e||this.activeState.renderTexture;var s=this.texturePool.getOptimalTexture(e.width,e.height,t||e.resolution,i||gt.NONE);return s.filterFrame=e.filterFrame,s},r.prototype.returnFilterTexture=function(e){this.texturePool.returnTexture(e)},r.prototype.emptyPool=function(){this.texturePool.clear(!0)},r.prototype.resize=function(){this.texturePool.setScreenSize(this.renderer.view)},r.prototype.transformAABB=function(e,t){var i=_n[0],n=_n[1],s=_n[2],a=_n[3];i.set(t.left,t.top),n.set(t.left,t.bottom),s.set(t.right,t.top),a.set(t.right,t.bottom),e.apply(i,i),e.apply(n,n),e.apply(s,s),e.apply(a,a);var o=Math.min(i.x,n.x,s.x,a.x),h=Math.min(i.y,n.y,s.y,a.y),u=Math.max(i.x,n.x,s.x,a.x),l=Math.max(i.y,n.y,s.y,a.y);t.x=o,t.y=h,t.width=u-o,t.height=l-h},r.prototype.roundFrame=function(e,t,i,n,s){if(!(e.width<=0||e.height<=0||i.width<=0||i.height<=0)){if(s){var a=s.a,o=s.b,h=s.c,u=s.d;if((Math.abs(o)>1e-4||Math.abs(h)>1e-4)&&(Math.abs(a)>1e-4||Math.abs(u)>1e-4))return}s=s?Bs.copyFrom(s):Bs.identity(),s.translate(-i.x,-i.y).scale(n.width/i.width,n.height/i.height).translate(n.x,n.y),this.transformAABB(s,e),e.ceil(t),this.transformAABB(s.invert(),e)}},r}(),mn=function(){function r(e){this.renderer=e}return r.prototype.flush=function(){},r.prototype.destroy=function(){this.renderer=null},r.prototype.start=function(){},r.prototype.stop=function(){this.flush()},r.prototype.render=function(e){},r}(),r_=function(){function r(e){this.renderer=e,this.emptyRenderer=new mn(e),this.currentRenderer=this.emptyRenderer}return r.prototype.setObjectRenderer=function(e){this.currentRenderer!==e&&(this.currentRenderer.stop(),this.currentRenderer=e,this.currentRenderer.start())},r.prototype.flush=function(){this.setObjectRenderer(this.emptyRenderer)},r.prototype.reset=function(){this.setObjectRenderer(this.emptyRenderer)},r.prototype.copyBoundTextures=function(e,t){for(var i=this.renderer.texture.boundTextures,n=t-1;n>=0;--n)e[n]=i[n]||null,e[n]&&(e[n]._batchLocation=n)},r.prototype.boundArray=function(e,t,i,n){for(var s=e.elements,a=e.ids,o=e.count,h=0,u=0;u<o;u++){var l=s[u],f=l._batchLocation;if(f>=0&&f<n&&t[f]===l){a[u]=f;continue}for(;h<n;){var c=t[h];if(c&&c._batchEnabled===i&&c._batchLocation===h){h++;continue}a[u]=h,l._batchLocation=h,t[h]=l;break}}},r.prototype.destroy=function(){this.renderer=null},r}(),Oh=0,n_=function(){function r(e){this.renderer=e,this.webGLVersion=1,this.extensions={},this.supports={uint32Indices:!1},this.handleContextLost=this.handleContextLost.bind(this),this.handleContextRestored=this.handleContextRestored.bind(this),e.view.addEventListener("webglcontextlost",this.handleContextLost,!1),e.view.addEventListener("webglcontextrestored",this.handleContextRestored,!1)}return Object.defineProperty(r.prototype,"isLost",{get:function(){return!this.gl||this.gl.isContextLost()},enumerable:!1,configurable:!0}),r.prototype.contextChange=function(e){this.gl=e,this.renderer.gl=e,this.renderer.CONTEXT_UID=Oh++,e.isContextLost()&&e.getExtension("WEBGL_lose_context")&&e.getExtension("WEBGL_lose_context").restoreContext()},r.prototype.initFromContext=function(e){this.gl=e,this.validateContext(e),this.renderer.gl=e,this.renderer.CONTEXT_UID=Oh++,this.renderer.runners.contextChange.emit(e)},r.prototype.initFromOptions=function(e){var t=this.createContext(this.renderer.view,e);this.initFromContext(t)},r.prototype.createContext=function(e,t){var i;if(L.PREFER_ENV>=Le.WEBGL2&&(i=e.getContext("webgl2",t)),i)this.webGLVersion=2;else if(this.webGLVersion=1,i=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),!i)throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=i,this.getExtensions(),this.gl},r.prototype.getExtensions=function(){var e=this.gl,t={anisotropicFiltering:e.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),s3tc:e.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:e.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:e.getExtension("WEBGL_compressed_texture_etc"),etc1:e.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:e.getExtension("WEBGL_compressed_texture_atc"),astc:e.getExtension("WEBGL_compressed_texture_astc")};this.webGLVersion===1?Object.assign(this.extensions,t,{drawBuffers:e.getExtension("WEBGL_draw_buffers"),depthTexture:e.getExtension("WEBGL_depth_texture"),loseContext:e.getExtension("WEBGL_lose_context"),vertexArrayObject:e.getExtension("OES_vertex_array_object")||e.getExtension("MOZ_OES_vertex_array_object")||e.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:e.getExtension("OES_element_index_uint"),floatTexture:e.getExtension("OES_texture_float"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),textureHalfFloat:e.getExtension("OES_texture_half_float"),textureHalfFloatLinear:e.getExtension("OES_texture_half_float_linear")}):this.webGLVersion===2&&Object.assign(this.extensions,t,{colorBufferFloat:e.getExtension("EXT_color_buffer_float")})},r.prototype.handleContextLost=function(e){e.preventDefault()},r.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.emit(this.gl)},r.prototype.destroy=function(){var e=this.renderer.view;this.renderer=null,e.removeEventListener("webglcontextlost",this.handleContextLost),e.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},r.prototype.postrender=function(){this.renderer.renderingToScreen&&this.gl.flush()},r.prototype.validateContext=function(e){var t=e.getContextAttributes(),i="WebGL2RenderingContext"in globalThis&&e instanceof globalThis.WebGL2RenderingContext;i&&(this.webGLVersion=2),t&&!t.stencil&&console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");var n=i||!!e.getExtension("OES_element_index_uint");this.supports.uint32Indices=n,n||console.warn("Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly")},r}(),s_=function(){function r(e){this.framebuffer=e,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=gt.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0}return r}(),a_=new q,o_=function(){function r(e){this.renderer=e,this.managedFramebuffers=[],this.unknownFramebuffer=new Ls(10,10),this.msaaSamples=null}return r.prototype.contextChange=function(){var e=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new q,this.hasMRT=!0,this.writeDepthTexture=!0,this.disposeAll(!0),this.renderer.context.webGLVersion===1){var t=this.renderer.context.extensions.drawBuffers,i=this.renderer.context.extensions.depthTexture;L.PREFER_ENV===Le.WEBGL_LEGACY&&(t=null,i=null),t?e.drawBuffers=function(n){return t.drawBuffersWEBGL(n)}:(this.hasMRT=!1,e.drawBuffers=function(){}),i||(this.writeDepthTexture=!1)}else this.msaaSamples=e.getInternalformatParameter(e.RENDERBUFFER,e.RGBA8,e.SAMPLES)},r.prototype.bind=function(e,t,i){i===void 0&&(i=0);var n=this.gl;if(e){var s=e.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(e);this.current!==e&&(this.current=e,n.bindFramebuffer(n.FRAMEBUFFER,s.framebuffer)),s.mipLevel!==i&&(e.dirtyId++,e.dirtyFormat++,s.mipLevel=i),s.dirtyId!==e.dirtyId&&(s.dirtyId=e.dirtyId,s.dirtyFormat!==e.dirtyFormat?(s.dirtyFormat=e.dirtyFormat,s.dirtySize=e.dirtySize,this.updateFramebuffer(e,i)):s.dirtySize!==e.dirtySize&&(s.dirtySize=e.dirtySize,this.resizeFramebuffer(e)));for(var a=0;a<e.colorTextures.length;a++){var o=e.colorTextures[a];this.renderer.texture.unbind(o.parentTextureArray||o)}if(e.depthTexture&&this.renderer.texture.unbind(e.depthTexture),t){var h=t.width>>i,u=t.height>>i,l=h/t.width;this.setViewport(t.x*l,t.y*l,h,u)}else{var h=e.width>>i,u=e.height>>i;this.setViewport(0,0,h,u)}}else this.current&&(this.current=null,n.bindFramebuffer(n.FRAMEBUFFER,null)),t?this.setViewport(t.x,t.y,t.width,t.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)},r.prototype.setViewport=function(e,t,i,n){var s=this.viewport;e=Math.round(e),t=Math.round(t),i=Math.round(i),n=Math.round(n),(s.width!==i||s.height!==n||s.x!==e||s.y!==t)&&(s.x=e,s.y=t,s.width=i,s.height=n,this.gl.viewport(e,t,i,n))},Object.defineProperty(r.prototype,"size",{get:function(){return this.current?{x:0,y:0,width:this.current.width,height:this.current.height}:{x:0,y:0,width:this.renderer.width,height:this.renderer.height}},enumerable:!1,configurable:!0}),r.prototype.clear=function(e,t,i,n,s){s===void 0&&(s=tn.COLOR|tn.DEPTH);var a=this.gl;a.clearColor(e,t,i,n),a.clear(s)},r.prototype.initFramebuffer=function(e){var t=this.gl,i=new s_(t.createFramebuffer());return i.multisample=this.detectSamples(e.multisample),e.glFramebuffers[this.CONTEXT_UID]=i,this.managedFramebuffers.push(e),e.disposeRunner.add(this),i},r.prototype.resizeFramebuffer=function(e){var t=this.gl,i=e.glFramebuffers[this.CONTEXT_UID];i.msaaBuffer&&(t.bindRenderbuffer(t.RENDERBUFFER,i.msaaBuffer),t.renderbufferStorageMultisample(t.RENDERBUFFER,i.multisample,t.RGBA8,e.width,e.height)),i.stencil&&(t.bindRenderbuffer(t.RENDERBUFFER,i.stencil),i.msaaBuffer?t.renderbufferStorageMultisample(t.RENDERBUFFER,i.multisample,t.DEPTH24_STENCIL8,e.width,e.height):t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,e.width,e.height));var n=e.colorTextures,s=n.length;t.drawBuffers||(s=Math.min(s,1));for(var a=0;a<s;a++){var o=n[a],h=o.parentTextureArray||o;this.renderer.texture.bind(h,0)}e.depthTexture&&this.writeDepthTexture&&this.renderer.texture.bind(e.depthTexture,0)},r.prototype.updateFramebuffer=function(e,t){var i=this.gl,n=e.glFramebuffers[this.CONTEXT_UID],s=e.colorTextures,a=s.length;i.drawBuffers||(a=Math.min(a,1)),n.multisample>1&&this.canMultisampleFramebuffer(e)?(n.msaaBuffer=n.msaaBuffer||i.createRenderbuffer(),i.bindRenderbuffer(i.RENDERBUFFER,n.msaaBuffer),i.renderbufferStorageMultisample(i.RENDERBUFFER,n.multisample,i.RGBA8,e.width,e.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.RENDERBUFFER,n.msaaBuffer)):n.msaaBuffer&&(i.deleteRenderbuffer(n.msaaBuffer),n.msaaBuffer=null,n.blitFramebuffer&&(n.blitFramebuffer.dispose(),n.blitFramebuffer=null));for(var o=[],h=0;h<a;h++){var u=s[h],l=u.parentTextureArray||u;this.renderer.texture.bind(l,0),!(h===0&&n.msaaBuffer)&&(i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+h,u.target,l._glTextures[this.CONTEXT_UID].texture,t),o.push(i.COLOR_ATTACHMENT0+h))}if(o.length>1&&i.drawBuffers(o),e.depthTexture){var f=this.writeDepthTexture;if(f){var c=e.depthTexture;this.renderer.texture.bind(c,0),i.framebufferTexture2D(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.TEXTURE_2D,c._glTextures[this.CONTEXT_UID].texture,t)}}(e.stencil||e.depth)&&!(e.depthTexture&&this.writeDepthTexture)?(n.stencil=n.stencil||i.createRenderbuffer(),i.bindRenderbuffer(i.RENDERBUFFER,n.stencil),n.msaaBuffer?i.renderbufferStorageMultisample(i.RENDERBUFFER,n.multisample,i.DEPTH24_STENCIL8,e.width,e.height):i.renderbufferStorage(i.RENDERBUFFER,i.DEPTH_STENCIL,e.width,e.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.DEPTH_STENCIL_ATTACHMENT,i.RENDERBUFFER,n.stencil)):n.stencil&&(i.deleteRenderbuffer(n.stencil),n.stencil=null)},r.prototype.canMultisampleFramebuffer=function(e){return this.renderer.context.webGLVersion!==1&&e.colorTextures.length<=1&&!e.depthTexture},r.prototype.detectSamples=function(e){var t=this.msaaSamples,i=gt.NONE;if(e<=1||t===null)return i;for(var n=0;n<t.length;n++)if(t[n]<=e){i=t[n];break}return i===1&&(i=gt.NONE),i},r.prototype.blit=function(e,t,i){var n=this,s=n.current,a=n.renderer,o=n.gl,h=n.CONTEXT_UID;if(a.context.webGLVersion===2&&s){var u=s.glFramebuffers[h];if(u){if(!e){if(!u.msaaBuffer)return;var l=s.colorTextures[0];if(!l)return;u.blitFramebuffer||(u.blitFramebuffer=new Ls(s.width,s.height),u.blitFramebuffer.addColorTexture(0,l)),e=u.blitFramebuffer,e.colorTextures[0]!==l&&(e.colorTextures[0]=l,e.dirtyId++,e.dirtyFormat++),(e.width!==s.width||e.height!==s.height)&&(e.width=s.width,e.height=s.height,e.dirtyId++,e.dirtySize++)}t||(t=a_,t.width=s.width,t.height=s.height),i||(i=t);var f=t.width===i.width&&t.height===i.height;this.bind(e),o.bindFramebuffer(o.READ_FRAMEBUFFER,u.framebuffer),o.blitFramebuffer(t.left,t.top,t.right,t.bottom,i.left,i.top,i.right,i.bottom,o.COLOR_BUFFER_BIT,f?o.NEAREST:o.LINEAR)}}},r.prototype.disposeFramebuffer=function(e,t){var i=e.glFramebuffers[this.CONTEXT_UID],n=this.gl;if(i){delete e.glFramebuffers[this.CONTEXT_UID];var s=this.managedFramebuffers.indexOf(e);s>=0&&this.managedFramebuffers.splice(s,1),e.disposeRunner.remove(this),t||(n.deleteFramebuffer(i.framebuffer),i.msaaBuffer&&n.deleteRenderbuffer(i.msaaBuffer),i.stencil&&n.deleteRenderbuffer(i.stencil)),i.blitFramebuffer&&i.blitFramebuffer.dispose()}},r.prototype.disposeAll=function(e){var t=this.managedFramebuffers;this.managedFramebuffers=[];for(var i=0;i<t.length;i++)this.disposeFramebuffer(t[i],e)},r.prototype.forceStencil=function(){var e=this.current;if(e){var t=e.glFramebuffers[this.CONTEXT_UID];if(!(!t||t.stencil)){e.stencil=!0;var i=e.width,n=e.height,s=this.gl,a=s.createRenderbuffer();s.bindRenderbuffer(s.RENDERBUFFER,a),t.msaaBuffer?s.renderbufferStorageMultisample(s.RENDERBUFFER,t.multisample,s.DEPTH24_STENCIL8,i,n):s.renderbufferStorage(s.RENDERBUFFER,s.DEPTH_STENCIL,i,n),t.stencil=a,s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_STENCIL_ATTACHMENT,s.RENDERBUFFER,a)}}},r.prototype.reset=function(){this.current=this.unknownFramebuffer,this.viewport=new q},r.prototype.destroy=function(){this.renderer=null},r}(),Us={5126:4,5123:2,5121:1},h_=function(){function r(e){this.renderer=e,this._activeGeometry=null,this._activeVao=null,this.hasVao=!0,this.hasInstance=!0,this.canUseUInt32ElementIndex=!1,this.managedGeometries={}}return r.prototype.contextChange=function(){this.disposeAll(!0);var e=this.gl=this.renderer.gl,t=this.renderer.context;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,t.webGLVersion!==2){var i=this.renderer.context.extensions.vertexArrayObject;L.PREFER_ENV===Le.WEBGL_LEGACY&&(i=null),i?(e.createVertexArray=function(){return i.createVertexArrayOES()},e.bindVertexArray=function(s){return i.bindVertexArrayOES(s)},e.deleteVertexArray=function(s){return i.deleteVertexArrayOES(s)}):(this.hasVao=!1,e.createVertexArray=function(){return null},e.bindVertexArray=function(){return null},e.deleteVertexArray=function(){return null})}if(t.webGLVersion!==2){var n=e.getExtension("ANGLE_instanced_arrays");n?(e.vertexAttribDivisor=function(s,a){return n.vertexAttribDivisorANGLE(s,a)},e.drawElementsInstanced=function(s,a,o,h,u){return n.drawElementsInstancedANGLE(s,a,o,h,u)},e.drawArraysInstanced=function(s,a,o,h){return n.drawArraysInstancedANGLE(s,a,o,h)}):this.hasInstance=!1}this.canUseUInt32ElementIndex=t.webGLVersion===2||!!t.extensions.uint32ElementIndex},r.prototype.bind=function(e,t){t=t||this.renderer.shader.shader;var i=this.gl,n=e.glVertexArrayObjects[this.CONTEXT_UID],s=!1;n||(this.managedGeometries[e.id]=e,e.disposeRunner.add(this),e.glVertexArrayObjects[this.CONTEXT_UID]=n={},s=!0);var a=n[t.program.id]||this.initGeometryVao(e,t,s);this._activeGeometry=e,this._activeVao!==a&&(this._activeVao=a,this.hasVao?i.bindVertexArray(a):this.activateVao(e,t.program)),this.updateBuffers()},r.prototype.reset=function(){this.unbind()},r.prototype.updateBuffers=function(){for(var e=this._activeGeometry,t=this.renderer.buffer,i=0;i<e.buffers.length;i++){var n=e.buffers[i];t.update(n)}},r.prototype.checkCompatibility=function(e,t){var i=e.attributes,n=t.attributeData;for(var s in n)if(!i[s])throw new Error('shader and geometry incompatible, geometry missing the "'+s+'" attribute')},r.prototype.getSignature=function(e,t){var i=e.attributes,n=t.attributeData,s=["g",e.id];for(var a in i)n[a]&&s.push(a,n[a].location);return s.join("-")},r.prototype.initGeometryVao=function(e,t,i){i===void 0&&(i=!0);var n=this.gl,s=this.CONTEXT_UID,a=this.renderer.buffer,o=t.program;o.glPrograms[s]||this.renderer.shader.generateProgram(t),this.checkCompatibility(e,o);var h=this.getSignature(e,o),u=e.glVertexArrayObjects[this.CONTEXT_UID],l=u[h];if(l)return u[o.id]=l,l;var f=e.buffers,c=e.attributes,d={},v={};for(var p in f)d[p]=0,v[p]=0;for(var p in c)!c[p].size&&o.attributeData[p]?c[p].size=o.attributeData[p].size:c[p].size||console.warn("PIXI Geometry attribute '"+p+"' size cannot be determined (likely the bound shader does not have the attribute)"),d[c[p].buffer]+=c[p].size*Us[c[p].type];for(var p in c){var _=c[p],m=_.size;_.stride===void 0&&(d[_.buffer]===m*Us[_.type]?_.stride=0:_.stride=d[_.buffer]),_.start===void 0&&(_.start=v[_.buffer],v[_.buffer]+=m*Us[_.type])}l=n.createVertexArray(),n.bindVertexArray(l);for(var g=0;g<f.length;g++){var y=f[g];a.bind(y),i&&y._glBuffers[s].refCount++}return this.activateVao(e,o),this._activeVao=l,u[o.id]=l,u[h]=l,l},r.prototype.disposeGeometry=function(e,t){var i;if(this.managedGeometries[e.id]){delete this.managedGeometries[e.id];var n=e.glVertexArrayObjects[this.CONTEXT_UID],s=this.gl,a=e.buffers,o=(i=this.renderer)===null||i===void 0?void 0:i.buffer;if(e.disposeRunner.remove(this),!!n){if(o)for(var h=0;h<a.length;h++){var u=a[h]._glBuffers[this.CONTEXT_UID];u&&(u.refCount--,u.refCount===0&&!t&&o.dispose(a[h],t))}if(!t){for(var l in n)if(l[0]==="g"){var f=n[l];this._activeVao===f&&this.unbind(),s.deleteVertexArray(f)}}delete e.glVertexArrayObjects[this.CONTEXT_UID]}}},r.prototype.disposeAll=function(e){for(var t=Object.keys(this.managedGeometries),i=0;i<t.length;i++)this.disposeGeometry(this.managedGeometries[t[i]],e)},r.prototype.activateVao=function(e,t){var i=this.gl,n=this.CONTEXT_UID,s=this.renderer.buffer,a=e.buffers,o=e.attributes;e.indexBuffer&&s.bind(e.indexBuffer);var h=null;for(var u in o){var l=o[u],f=a[l.buffer],c=f._glBuffers[n];if(t.attributeData[u]){h!==c&&(s.bind(f),h=c);var d=t.attributeData[u].location;if(i.enableVertexAttribArray(d),i.vertexAttribPointer(d,l.size,l.type||i.FLOAT,l.normalized,l.stride,l.start),l.instance)if(this.hasInstance)i.vertexAttribDivisor(d,1);else throw new Error("geometry error, GPU Instancing is not supported on this device")}}},r.prototype.draw=function(e,t,i,n){var s=this.gl,a=this._activeGeometry;if(a.indexBuffer){var o=a.indexBuffer.data.BYTES_PER_ELEMENT,h=o===2?s.UNSIGNED_SHORT:s.UNSIGNED_INT;o===2||o===4&&this.canUseUInt32ElementIndex?a.instanced?s.drawElementsInstanced(e,t||a.indexBuffer.data.length,h,(i||0)*o,n||1):s.drawElements(e,t||a.indexBuffer.data.length,h,(i||0)*o):console.warn("unsupported index buffer type: uint32")}else a.instanced?s.drawArraysInstanced(e,i,t||a.getSize(),n||1):s.drawArrays(e,i,t||a.getSize());return this},r.prototype.unbind=function(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null},r.prototype.destroy=function(){this.renderer=null},r}(),u_=function(){function r(e){e===void 0&&(e=null),this.type=Pt.NONE,this.autoDetect=!0,this.maskObject=e||null,this.pooled=!1,this.isMaskData=!0,this.resolution=null,this.multisample=L.FILTER_MULTISAMPLE,this.enabled=!0,this.colorMask=15,this._filters=null,this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null,this._scissorRectLocal=null,this._colorMask=15,this._target=null}return Object.defineProperty(r.prototype,"filter",{get:function(){return this._filters?this._filters[0]:null},set:function(e){e?this._filters?this._filters[0]=e:this._filters=[e]:this._filters=null},enumerable:!1,configurable:!0}),r.prototype.reset=function(){this.pooled&&(this.maskObject=null,this.type=Pt.NONE,this.autoDetect=!0),this._target=null,this._scissorRectLocal=null},r.prototype.copyCountersOrReset=function(e){e?(this._stencilCounter=e._stencilCounter,this._scissorCounter=e._scissorCounter,this._scissorRect=e._scissorRect):(this._stencilCounter=0,this._scissorCounter=0,this._scissorRect=null)},r}();function Ah(r,e,t){var i=r.createShader(e);return r.shaderSource(i,t),r.compileShader(i),i}function Ih(r,e){var t=r.getShaderSource(e).split(`
15
15
  `).map(function(u,l){return l+": "+u}),i=r.getShaderInfoLog(e),n=i.split(`
16
16
  `),s={},a=n.map(function(u){return parseFloat(u.replace(/^ERROR\: 0\:([\d]+)\:.*$/,"$1"))}).filter(function(u){return u&&!s[u]?(s[u]=!0,!0):!1}),o=[""];a.forEach(function(u){t[u-1]="%c"+t[u-1]+"%c",o.push("background: #FF0000; color:#FFFFFF; font-size: 10px","font-size: 10px")});var h=t.join(`
17
- `);o[0]=h,console.error(i),console.groupCollapsed("click to view full shader code"),console.warn.apply(console,o),console.groupEnd()}function u_(r,e,t,i){r.getProgramParameter(e,r.LINK_STATUS)||(r.getShaderParameter(t,r.COMPILE_STATUS)||Ah(r,t),r.getShaderParameter(i,r.COMPILE_STATUS)||Ah(r,i),console.error("PixiJS Error: Could not initialize shader."),r.getProgramInfoLog(e)!==""&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",r.getProgramInfoLog(e)))}function Us(r){for(var e=new Array(r),t=0;t<e.length;t++)e[t]=!1;return e}function Ih(r,e){switch(r){case"float":return 0;case"vec2":return new Float32Array(2*e);case"vec3":return new Float32Array(3*e);case"vec4":return new Float32Array(4*e);case"int":case"uint":case"sampler2D":case"sampler2DArray":return 0;case"ivec2":return new Int32Array(2*e);case"ivec3":return new Int32Array(3*e);case"ivec4":return new Int32Array(4*e);case"uvec2":return new Uint32Array(2*e);case"uvec3":return new Uint32Array(3*e);case"uvec4":return new Uint32Array(4*e);case"bool":return!1;case"bvec2":return Us(2*e);case"bvec3":return Us(3*e);case"bvec4":return Us(4*e);case"mat2":return new Float32Array([1,0,0,1]);case"mat3":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}var Mh={},Er=Mh;function l_(){if(Er===Mh||Er&&Er.isContextLost()){var r=L.ADAPTER.createCanvas(),e=void 0;L.PREFER_ENV>=Le.WEBGL2&&(e=r.getContext("webgl2",{})),e||(e=r.getContext("webgl",{})||r.getContext("experimental-webgl",{}),e?e.getExtension("WEBGL_draw_buffers"):e=null),Er=e}return Er}var gn;function f_(){if(!gn){gn=Kt.MEDIUM;var r=l_();if(r&&r.getShaderPrecisionFormat){var e=r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT);gn=e.precision?Kt.HIGH:Kt.MEDIUM}}return gn}function Dh(r,e,t){if(r.substring(0,9)!=="precision"){var i=e;return e===Kt.HIGH&&t!==Kt.HIGH&&(i=Kt.MEDIUM),"precision "+i+` float;
18
- `+r}else if(t!==Kt.HIGH&&r.substring(0,15)==="precision highp")return r.replace("precision highp","precision mediump");return r}var c_={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,uint:1,uvec2:2,uvec3:3,uvec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function Fh(r){return c_[r]}var yn=null,Nh={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",UNSIGNED_INT:"uint",UNSIGNED_INT_VEC2:"uvec2",UNSIGNED_INT_VEC3:"uvec3",UNSIGNED_INT_VEC4:"uvec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",INT_SAMPLER_2D:"sampler2D",UNSIGNED_INT_SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",INT_SAMPLER_CUBE:"samplerCube",UNSIGNED_INT_SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray",INT_SAMPLER_2D_ARRAY:"sampler2DArray",UNSIGNED_INT_SAMPLER_2D_ARRAY:"sampler2DArray"};function Lh(r,e){if(!yn){var t=Object.keys(Nh);yn={};for(var i=0;i<t.length;++i){var n=t[i];yn[r[n]]=Nh[n]}}return yn[e]}var Yi=[{test:function(r){return r.type==="float"&&r.size===1&&!r.isArray},code:function(r){return`
17
+ `);o[0]=h,console.error(i),console.groupCollapsed("click to view full shader code"),console.warn.apply(console,o),console.groupEnd()}function l_(r,e,t,i){r.getProgramParameter(e,r.LINK_STATUS)||(r.getShaderParameter(t,r.COMPILE_STATUS)||Ih(r,t),r.getShaderParameter(i,r.COMPILE_STATUS)||Ih(r,i),console.error("PixiJS Error: Could not initialize shader."),r.getProgramInfoLog(e)!==""&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",r.getProgramInfoLog(e)))}function Gs(r){for(var e=new Array(r),t=0;t<e.length;t++)e[t]=!1;return e}function Mh(r,e){switch(r){case"float":return 0;case"vec2":return new Float32Array(2*e);case"vec3":return new Float32Array(3*e);case"vec4":return new Float32Array(4*e);case"int":case"uint":case"sampler2D":case"sampler2DArray":return 0;case"ivec2":return new Int32Array(2*e);case"ivec3":return new Int32Array(3*e);case"ivec4":return new Int32Array(4*e);case"uvec2":return new Uint32Array(2*e);case"uvec3":return new Uint32Array(3*e);case"uvec4":return new Uint32Array(4*e);case"bool":return!1;case"bvec2":return Gs(2*e);case"bvec3":return Gs(3*e);case"bvec4":return Gs(4*e);case"mat2":return new Float32Array([1,0,0,1]);case"mat3":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}var Dh={},Er=Dh;function f_(){if(Er===Dh||Er&&Er.isContextLost()){var r=L.ADAPTER.createCanvas(),e=void 0;L.PREFER_ENV>=Le.WEBGL2&&(e=r.getContext("webgl2",{})),e||(e=r.getContext("webgl",{})||r.getContext("experimental-webgl",{}),e?e.getExtension("WEBGL_draw_buffers"):e=null),Er=e}return Er}var gn;function c_(){if(!gn){gn=Kt.MEDIUM;var r=f_();if(r&&r.getShaderPrecisionFormat){var e=r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT);gn=e.precision?Kt.HIGH:Kt.MEDIUM}}return gn}function Fh(r,e,t){if(r.substring(0,9)!=="precision"){var i=e;return e===Kt.HIGH&&t!==Kt.HIGH&&(i=Kt.MEDIUM),"precision "+i+` float;
18
+ `+r}else if(t!==Kt.HIGH&&r.substring(0,15)==="precision highp")return r.replace("precision highp","precision mediump");return r}var d_={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,uint:1,uvec2:2,uvec3:3,uvec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function Nh(r){return d_[r]}var yn=null,Lh={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",UNSIGNED_INT:"uint",UNSIGNED_INT_VEC2:"uvec2",UNSIGNED_INT_VEC3:"uvec3",UNSIGNED_INT_VEC4:"uvec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",INT_SAMPLER_2D:"sampler2D",UNSIGNED_INT_SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",INT_SAMPLER_CUBE:"samplerCube",UNSIGNED_INT_SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray",INT_SAMPLER_2D_ARRAY:"sampler2DArray",UNSIGNED_INT_SAMPLER_2D_ARRAY:"sampler2DArray"};function Bh(r,e){if(!yn){var t=Object.keys(Lh);yn={};for(var i=0;i<t.length;++i){var n=t[i];yn[r[n]]=Lh[n]}}return yn[e]}var Yi=[{test:function(r){return r.type==="float"&&r.size===1&&!r.isArray},code:function(r){return`
19
19
  if(uv["`+r+'"] !== ud["'+r+`"].value)
20
20
  {
21
21
  ud["`+r+'"].value = uv["'+r+`"]
@@ -100,7 +100,7 @@ Deprecated since v`+r),console.warn(i))),ph[e]=!0}}var vh={},Ge=Object.create(nu
100
100
  cv[3] = v[3];
101
101
 
102
102
  gl.uniform4f(ud["`+r+`"].location, v[0], v[1], v[2], v[3])
103
- }`}}],d_={float:`
103
+ }`}}],p_={float:`
104
104
  if (cv !== v)
105
105
  {
106
106
  cu.value = v;
@@ -236,7 +236,7 @@ Deprecated since v`+r),console.warn(i))),ph[e]=!0}}var vh={},Ge=Object.create(nu
236
236
  cu.value = v;
237
237
 
238
238
  gl.uniform1i(location, v);
239
- }`},p_={float:"gl.uniform1fv(location, v)",vec2:"gl.uniform2fv(location, v)",vec3:"gl.uniform3fv(location, v)",vec4:"gl.uniform4fv(location, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat2:"gl.uniformMatrix2fv(location, false, v)",int:"gl.uniform1iv(location, v)",ivec2:"gl.uniform2iv(location, v)",ivec3:"gl.uniform3iv(location, v)",ivec4:"gl.uniform4iv(location, v)",uint:"gl.uniform1uiv(location, v)",uvec2:"gl.uniform2uiv(location, v)",uvec3:"gl.uniform3uiv(location, v)",uvec4:"gl.uniform4uiv(location, v)",bool:"gl.uniform1iv(location, v)",bvec2:"gl.uniform2iv(location, v)",bvec3:"gl.uniform3iv(location, v)",bvec4:"gl.uniform4iv(location, v)",sampler2D:"gl.uniform1iv(location, v)",samplerCube:"gl.uniform1iv(location, v)",sampler2DArray:"gl.uniform1iv(location, v)"};function v_(r,e){var t,i=[`
239
+ }`},v_={float:"gl.uniform1fv(location, v)",vec2:"gl.uniform2fv(location, v)",vec3:"gl.uniform3fv(location, v)",vec4:"gl.uniform4fv(location, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat2:"gl.uniformMatrix2fv(location, false, v)",int:"gl.uniform1iv(location, v)",ivec2:"gl.uniform2iv(location, v)",ivec3:"gl.uniform3iv(location, v)",ivec4:"gl.uniform4iv(location, v)",uint:"gl.uniform1uiv(location, v)",uvec2:"gl.uniform2uiv(location, v)",uvec3:"gl.uniform3uiv(location, v)",uvec4:"gl.uniform4uiv(location, v)",bool:"gl.uniform1iv(location, v)",bvec2:"gl.uniform2iv(location, v)",bvec3:"gl.uniform3iv(location, v)",bvec4:"gl.uniform4iv(location, v)",sampler2D:"gl.uniform1iv(location, v)",samplerCube:"gl.uniform1iv(location, v)",sampler2DArray:"gl.uniform1iv(location, v)"};function __(r,e){var t,i=[`
240
240
  var v = null;
241
241
  var cv = null;
242
242
  var cu = null;
@@ -246,20 +246,20 @@ Deprecated since v`+r),console.warn(i))),ph[e]=!0}}var vh={},Ge=Object.create(nu
246
246
  renderer.shader.syncUniformBufferGroup(uv.`+n+", '"+n+`');
247
247
  `):i.push(`
248
248
  renderer.shader.syncUniformGroup(uv.`+n+`, syncData);
249
- `));continue}for(var a=r.uniforms[n],o=!1,h=0;h<Yi.length;h++)if(Yi[h].test(s,a)){i.push(Yi[h].code(n,a)),o=!0;break}if(!o){var u=s.size===1&&!s.isArray?d_:p_,l=u[s.type].replace("location",'ud["'+n+'"].location');i.push(`
249
+ `));continue}for(var a=r.uniforms[n],o=!1,h=0;h<Yi.length;h++)if(Yi[h].test(s,a)){i.push(Yi[h].code(n,a)),o=!0;break}if(!o){var u=s.size===1&&!s.isArray?p_:v_,l=u[s.type].replace("location",'ud["'+n+'"].location');i.push(`
250
250
  cu = ud["`+n+`"];
251
251
  cv = cu.value;
252
252
  v = uv["`+n+`"];
253
253
  `+l+";")}}return new Function("ud","uv","renderer","syncData",i.join(`
254
- `))}var __=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(`
255
- `);function m_(r){for(var e="",t=0;t<r;++t)t>0&&(e+=`
256
- else `),t<r-1&&(e+="if(test == "+t+".0){}");return e}function g_(r,e){if(r===0)throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");for(var t=e.createShader(e.FRAGMENT_SHADER);;){var i=__.replace(/%forloop%/gi,m_(r));if(e.shaderSource(t,i),e.compileShader(t),!e.getShaderParameter(t,e.COMPILE_STATUS))r=r/2|0;else break}return r}var Sr;function y_(){if(typeof Sr=="boolean")return Sr;try{var r=new Function("param1","param2","param3","return param1[param2] === param3;");Sr=r({a:"b"},"a","b")===!0}catch{Sr=!1}return Sr}var x_=`varying vec2 vTextureCoord;
254
+ `))}var m_=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(`
255
+ `);function g_(r){for(var e="",t=0;t<r;++t)t>0&&(e+=`
256
+ else `),t<r-1&&(e+="if(test == "+t+".0){}");return e}function y_(r,e){if(r===0)throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");for(var t=e.createShader(e.FRAGMENT_SHADER);;){var i=m_.replace(/%forloop%/gi,g_(r));if(e.shaderSource(t,i),e.compileShader(t),!e.getShaderParameter(t,e.COMPILE_STATUS))r=r/2|0;else break}return r}var Sr;function x_(){if(typeof Sr=="boolean")return Sr;try{var r=new Function("param1","param2","param3","return param1[param2] === param3;");Sr=r({a:"b"},"a","b")===!0}catch{Sr=!1}return Sr}var b_=`varying vec2 vTextureCoord;
257
257
 
258
258
  uniform sampler2D uSampler;
259
259
 
260
260
  void main(void){
261
261
  gl_FragColor *= texture2D(uSampler, vTextureCoord);
262
- }`,b_=`attribute vec2 aVertexPosition;
262
+ }`,T_=`attribute vec2 aVertexPosition;
263
263
  attribute vec2 aTextureCoord;
264
264
 
265
265
  uniform mat3 projectionMatrix;
@@ -270,16 +270,16 @@ void main(void){
270
270
  gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
271
271
  vTextureCoord = aTextureCoord;
272
272
  }
273
- `,T_=0,xn={},Pr=function(){function r(e,t,i){i===void 0&&(i="pixi-shader"),this.id=T_++,this.vertexSrc=e||r.defaultVertexSrc,this.fragmentSrc=t||r.defaultFragmentSrc,this.vertexSrc=this.vertexSrc.trim(),this.fragmentSrc=this.fragmentSrc.trim(),this.vertexSrc.substring(0,8)!=="#version"&&(i=i.replace(/\s+/g,"-"),xn[i]?(xn[i]++,i+="-"+xn[i]):xn[i]=1,this.vertexSrc="#define SHADER_NAME "+i+`
273
+ `,w_=0,xn={},Pr=function(){function r(e,t,i){i===void 0&&(i="pixi-shader"),this.id=w_++,this.vertexSrc=e||r.defaultVertexSrc,this.fragmentSrc=t||r.defaultFragmentSrc,this.vertexSrc=this.vertexSrc.trim(),this.fragmentSrc=this.fragmentSrc.trim(),this.vertexSrc.substring(0,8)!=="#version"&&(i=i.replace(/\s+/g,"-"),xn[i]?(xn[i]++,i+="-"+xn[i]):xn[i]=1,this.vertexSrc="#define SHADER_NAME "+i+`
274
274
  `+this.vertexSrc,this.fragmentSrc="#define SHADER_NAME "+i+`
275
- `+this.fragmentSrc,this.vertexSrc=Dh(this.vertexSrc,L.PRECISION_VERTEX,Kt.HIGH),this.fragmentSrc=Dh(this.fragmentSrc,L.PRECISION_FRAGMENT,f_())),this.glPrograms={},this.syncUniforms=null}return Object.defineProperty(r,"defaultVertexSrc",{get:function(){return b_},enumerable:!1,configurable:!0}),Object.defineProperty(r,"defaultFragmentSrc",{get:function(){return x_},enumerable:!1,configurable:!0}),r.from=function(e,t,i){var n=e+t,s=vh[n];return s||(vh[n]=s=new r(e,t,i)),s},r}(),$e=function(){function r(e,t){this.uniformBindCount=0,this.program=e,t?t instanceof Ti?this.uniformGroup=t:this.uniformGroup=new Ti(t):this.uniformGroup=new Ti({}),this.disposeRunner=new Bt("disposeShader")}return r.prototype.checkUniformExists=function(e,t){if(t.uniforms[e])return!0;for(var i in t.uniforms){var n=t.uniforms[i];if(n.group&&this.checkUniformExists(e,n))return!0}return!1},r.prototype.destroy=function(){this.uniformGroup=null,this.disposeRunner.emit(this),this.disposeRunner.destroy()},Object.defineProperty(r.prototype,"uniforms",{get:function(){return this.uniformGroup.uniforms},enumerable:!1,configurable:!0}),r.from=function(e,t,i){var n=Pr.from(e,t);return new r(n,i)},r}(),ks=0,Xs=1,Hs=2,Ws=3,zs=4,Vs=5,wi=function(){function r(){this.data=0,this.blendMode=X.NORMAL,this.polygonOffset=0,this.blend=!0,this.depthMask=!0}return Object.defineProperty(r.prototype,"blend",{get:function(){return!!(this.data&1<<ks)},set:function(e){!!(this.data&1<<ks)!==e&&(this.data^=1<<ks)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"offsets",{get:function(){return!!(this.data&1<<Xs)},set:function(e){!!(this.data&1<<Xs)!==e&&(this.data^=1<<Xs)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"culling",{get:function(){return!!(this.data&1<<Hs)},set:function(e){!!(this.data&1<<Hs)!==e&&(this.data^=1<<Hs)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"depthTest",{get:function(){return!!(this.data&1<<Ws)},set:function(e){!!(this.data&1<<Ws)!==e&&(this.data^=1<<Ws)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"depthMask",{get:function(){return!!(this.data&1<<Vs)},set:function(e){!!(this.data&1<<Vs)!==e&&(this.data^=1<<Vs)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"clockwiseFrontFace",{get:function(){return!!(this.data&1<<zs)},set:function(e){!!(this.data&1<<zs)!==e&&(this.data^=1<<zs)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"blendMode",{get:function(){return this._blendMode},set:function(e){this.blend=e!==X.NONE,this._blendMode=e},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"polygonOffset",{get:function(){return this._polygonOffset},set:function(e){this.offsets=!!e,this._polygonOffset=e},enumerable:!1,configurable:!0}),r.prototype.toString=function(){return"[@pixi/core:State "+("blendMode="+this.blendMode+" ")+("clockwiseFrontFace="+this.clockwiseFrontFace+" ")+("culling="+this.culling+" ")+("depthMask="+this.depthMask+" ")+("polygonOffset="+this.polygonOffset)+"]"},r.for2d=function(){var e=new r;return e.depthTest=!1,e.blend=!0,e},r}(),w_=`varying vec2 vTextureCoord;
275
+ `+this.fragmentSrc,this.vertexSrc=Fh(this.vertexSrc,L.PRECISION_VERTEX,Kt.HIGH),this.fragmentSrc=Fh(this.fragmentSrc,L.PRECISION_FRAGMENT,c_())),this.glPrograms={},this.syncUniforms=null}return Object.defineProperty(r,"defaultVertexSrc",{get:function(){return T_},enumerable:!1,configurable:!0}),Object.defineProperty(r,"defaultFragmentSrc",{get:function(){return b_},enumerable:!1,configurable:!0}),r.from=function(e,t,i){var n=e+t,s=_h[n];return s||(_h[n]=s=new r(e,t,i)),s},r}(),$e=function(){function r(e,t){this.uniformBindCount=0,this.program=e,t?t instanceof Ti?this.uniformGroup=t:this.uniformGroup=new Ti(t):this.uniformGroup=new Ti({}),this.disposeRunner=new Bt("disposeShader")}return r.prototype.checkUniformExists=function(e,t){if(t.uniforms[e])return!0;for(var i in t.uniforms){var n=t.uniforms[i];if(n.group&&this.checkUniformExists(e,n))return!0}return!1},r.prototype.destroy=function(){this.uniformGroup=null,this.disposeRunner.emit(this),this.disposeRunner.destroy()},Object.defineProperty(r.prototype,"uniforms",{get:function(){return this.uniformGroup.uniforms},enumerable:!1,configurable:!0}),r.from=function(e,t,i){var n=Pr.from(e,t);return new r(n,i)},r}(),ks=0,Xs=1,Hs=2,Ws=3,Vs=4,zs=5,wi=function(){function r(){this.data=0,this.blendMode=X.NORMAL,this.polygonOffset=0,this.blend=!0,this.depthMask=!0}return Object.defineProperty(r.prototype,"blend",{get:function(){return!!(this.data&1<<ks)},set:function(e){!!(this.data&1<<ks)!==e&&(this.data^=1<<ks)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"offsets",{get:function(){return!!(this.data&1<<Xs)},set:function(e){!!(this.data&1<<Xs)!==e&&(this.data^=1<<Xs)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"culling",{get:function(){return!!(this.data&1<<Hs)},set:function(e){!!(this.data&1<<Hs)!==e&&(this.data^=1<<Hs)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"depthTest",{get:function(){return!!(this.data&1<<Ws)},set:function(e){!!(this.data&1<<Ws)!==e&&(this.data^=1<<Ws)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"depthMask",{get:function(){return!!(this.data&1<<zs)},set:function(e){!!(this.data&1<<zs)!==e&&(this.data^=1<<zs)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"clockwiseFrontFace",{get:function(){return!!(this.data&1<<Vs)},set:function(e){!!(this.data&1<<Vs)!==e&&(this.data^=1<<Vs)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"blendMode",{get:function(){return this._blendMode},set:function(e){this.blend=e!==X.NONE,this._blendMode=e},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"polygonOffset",{get:function(){return this._polygonOffset},set:function(e){this.offsets=!!e,this._polygonOffset=e},enumerable:!1,configurable:!0}),r.prototype.toString=function(){return"[@pixi/core:State "+("blendMode="+this.blendMode+" ")+("clockwiseFrontFace="+this.clockwiseFrontFace+" ")+("culling="+this.culling+" ")+("depthMask="+this.depthMask+" ")+("polygonOffset="+this.polygonOffset)+"]"},r.for2d=function(){var e=new r;return e.depthTest=!1,e.blend=!0,e},r}(),E_=`varying vec2 vTextureCoord;
276
276
 
277
277
  uniform sampler2D uSampler;
278
278
 
279
279
  void main(void){
280
280
  gl_FragColor = texture2D(uSampler, vTextureCoord);
281
281
  }
282
- `,E_=`attribute vec2 aVertexPosition;
282
+ `,S_=`attribute vec2 aVertexPosition;
283
283
 
284
284
  uniform mat3 projectionMatrix;
285
285
 
@@ -305,7 +305,7 @@ void main(void)
305
305
  gl_Position = filterVertexPosition();
306
306
  vTextureCoord = filterTextureCoord();
307
307
  }
308
- `,Je=function(r){ht(e,r);function e(t,i,n){var s=this,a=Pr.from(t||e.defaultVertexSrc,i||e.defaultFragmentSrc);return s=r.call(this,a,n)||this,s.padding=0,s.resolution=L.FILTER_RESOLUTION,s.multisample=L.FILTER_MULTISAMPLE,s.enabled=!0,s.autoFit=!0,s.state=new wi,s}return e.prototype.apply=function(t,i,n,s,a){t.applyFilter(this,i,n,s)},Object.defineProperty(e.prototype,"blendMode",{get:function(){return this.state.blendMode},set:function(t){this.state.blendMode=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"resolution",{get:function(){return this._resolution},set:function(t){this._resolution=t},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultVertexSrc",{get:function(){return E_},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultFragmentSrc",{get:function(){return w_},enumerable:!1,configurable:!0}),e}($e),S_=`attribute vec2 aVertexPosition;
308
+ `,Je=function(r){ht(e,r);function e(t,i,n){var s=this,a=Pr.from(t||e.defaultVertexSrc,i||e.defaultFragmentSrc);return s=r.call(this,a,n)||this,s.padding=0,s.resolution=L.FILTER_RESOLUTION,s.multisample=L.FILTER_MULTISAMPLE,s.enabled=!0,s.autoFit=!0,s.state=new wi,s}return e.prototype.apply=function(t,i,n,s,a){t.applyFilter(this,i,n,s)},Object.defineProperty(e.prototype,"blendMode",{get:function(){return this.state.blendMode},set:function(t){this.state.blendMode=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"resolution",{get:function(){return this._resolution},set:function(t){this._resolution=t},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultVertexSrc",{get:function(){return S_},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultFragmentSrc",{get:function(){return E_},enumerable:!1,configurable:!0}),e}($e),P_=`attribute vec2 aVertexPosition;
309
309
  attribute vec2 aTextureCoord;
310
310
 
311
311
  uniform mat3 projectionMatrix;
@@ -321,7 +321,7 @@ void main(void)
321
321
  vTextureCoord = aTextureCoord;
322
322
  vMaskCoord = ( otherMatrix * vec3( aTextureCoord, 1.0) ).xy;
323
323
  }
324
- `,P_=`varying vec2 vMaskCoord;
324
+ `,R_=`varying vec2 vMaskCoord;
325
325
  varying vec2 vTextureCoord;
326
326
 
327
327
  uniform sampler2D uSampler;
@@ -346,7 +346,7 @@ void main(void)
346
346
 
347
347
  gl_FragColor = original;
348
348
  }
349
- `,Bh=new Ct,Ys=function(){function r(e,t){this._texture=e,this.mapCoord=new Ct,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,this.clampMargin=typeof t>"u"?.5:t,this.isSimple=!1}return Object.defineProperty(r.prototype,"texture",{get:function(){return this._texture},set:function(e){this._texture=e,this._textureID=-1},enumerable:!1,configurable:!0}),r.prototype.multiplyUvs=function(e,t){t===void 0&&(t=e);for(var i=this.mapCoord,n=0;n<e.length;n+=2){var s=e[n],a=e[n+1];t[n]=s*i.a+a*i.c+i.tx,t[n+1]=s*i.b+a*i.d+i.ty}return t},r.prototype.update=function(e){var t=this._texture;if(!t||!t.valid||!e&&this._textureID===t._updateID)return!1;this._textureID=t._updateID,this._updateID++;var i=t._uvs;this.mapCoord.set(i.x1-i.x0,i.y1-i.y0,i.x3-i.x0,i.y3-i.y0,i.x0,i.y0);var n=t.orig,s=t.trim;s&&(Bh.set(n.width/s.width,0,0,n.height/s.height,-s.x/s.width,-s.y/s.height),this.mapCoord.append(Bh));var a=t.baseTexture,o=this.uClampFrame,h=this.clampMargin/a.resolution,u=this.clampOffset;return o[0]=(t._frame.x+h+u)/a.width,o[1]=(t._frame.y+h+u)/a.height,o[2]=(t._frame.x+t._frame.width-h+u)/a.width,o[3]=(t._frame.y+t._frame.height-h+u)/a.height,this.uClampOffset[0]=u/a.realWidth,this.uClampOffset[1]=u/a.realHeight,this.isSimple=t._frame.width===a.width&&t._frame.height===a.height&&t.rotate===0,!0},r}(),R_=function(r){ht(e,r);function e(t,i,n){var s=this,a=null;return typeof t!="string"&&i===void 0&&n===void 0&&(a=t,t=void 0,i=void 0,n=void 0),s=r.call(this,t||S_,i||P_,n)||this,s.maskSprite=a,s.maskMatrix=new Ct,s}return Object.defineProperty(e.prototype,"maskSprite",{get:function(){return this._maskSprite},set:function(t){this._maskSprite=t,this._maskSprite&&(this._maskSprite.renderable=!1)},enumerable:!1,configurable:!0}),e.prototype.apply=function(t,i,n,s){var a=this._maskSprite,o=a._texture;o.valid&&(o.uvMatrix||(o.uvMatrix=new Ys(o,0)),o.uvMatrix.update(),this.uniforms.npmAlpha=o.baseTexture.alphaMode?0:1,this.uniforms.mask=o,this.uniforms.otherMatrix=t.calculateSpriteMatrix(this.maskMatrix,a).prepend(o.uvMatrix.mapCoord),this.uniforms.alpha=a.worldAlpha,this.uniforms.maskClamp=o.uvMatrix.uClampFrame,t.applyFilter(this,i,n,s))},e}(Je),C_=function(){function r(e){this.renderer=e,this.enableScissor=!0,this.alphaMaskPool=[],this.maskDataPool=[],this.maskStack=[],this.alphaMaskIndex=0}return r.prototype.setMaskStack=function(e){this.maskStack=e,this.renderer.scissor.setMaskStack(e),this.renderer.stencil.setMaskStack(e)},r.prototype.push=function(e,t){var i=t;if(!i.isMaskData){var n=this.maskDataPool.pop()||new h_;n.pooled=!0,n.maskObject=t,i=n}var s=this.maskStack.length!==0?this.maskStack[this.maskStack.length-1]:null;if(i.copyCountersOrReset(s),i._colorMask=s?s._colorMask:15,i.autoDetect&&this.detect(i),i._target=e,i.type!==Pt.SPRITE&&this.maskStack.push(i),i.enabled)switch(i.type){case Pt.SCISSOR:this.renderer.scissor.push(i);break;case Pt.STENCIL:this.renderer.stencil.push(i);break;case Pt.SPRITE:i.copyCountersOrReset(null),this.pushSpriteMask(i);break;case Pt.COLOR:this.pushColorMask(i);break}i.type===Pt.SPRITE&&this.maskStack.push(i)},r.prototype.pop=function(e){var t=this.maskStack.pop();if(!(!t||t._target!==e)){if(t.enabled)switch(t.type){case Pt.SCISSOR:this.renderer.scissor.pop(t);break;case Pt.STENCIL:this.renderer.stencil.pop(t.maskObject);break;case Pt.SPRITE:this.popSpriteMask(t);break;case Pt.COLOR:this.popColorMask(t);break}if(t.reset(),t.pooled&&this.maskDataPool.push(t),this.maskStack.length!==0){var i=this.maskStack[this.maskStack.length-1];i.type===Pt.SPRITE&&i._filters&&(i._filters[0].maskSprite=i.maskObject)}}},r.prototype.detect=function(e){var t=e.maskObject;t?t.isSprite?e.type=Pt.SPRITE:this.enableScissor&&this.renderer.scissor.testScissor(e)?e.type=Pt.SCISSOR:e.type=Pt.STENCIL:e.type=Pt.COLOR},r.prototype.pushSpriteMask=function(e){var t,i,n=e.maskObject,s=e._target,a=e._filters;a||(a=this.alphaMaskPool[this.alphaMaskIndex],a||(a=this.alphaMaskPool[this.alphaMaskIndex]=[new R_]));var o=this.renderer,h=o.renderTexture,u,l;if(h.current){var f=h.current;u=e.resolution||f.resolution,l=(t=e.multisample)!==null&&t!==void 0?t:f.multisample}else u=e.resolution||o.resolution,l=(i=e.multisample)!==null&&i!==void 0?i:o.multisample;a[0].resolution=u,a[0].multisample=l,a[0].maskSprite=n;var c=s.filterArea;s.filterArea=n.getBounds(!0),o.filter.push(s,a),s.filterArea=c,e._filters||this.alphaMaskIndex++},r.prototype.popSpriteMask=function(e){this.renderer.filter.pop(),e._filters?e._filters[0].maskSprite=null:(this.alphaMaskIndex--,this.alphaMaskPool[this.alphaMaskIndex][0].maskSprite=null)},r.prototype.pushColorMask=function(e){var t=e._colorMask,i=e._colorMask=t&e.colorMask;i!==t&&this.renderer.gl.colorMask((i&1)!==0,(i&2)!==0,(i&4)!==0,(i&8)!==0)},r.prototype.popColorMask=function(e){var t=e._colorMask,i=this.maskStack.length>0?this.maskStack[this.maskStack.length-1]._colorMask:15;i!==t&&this.renderer.gl.colorMask((i&1)!==0,(i&2)!==0,(i&4)!==0,(i&8)!==0)},r.prototype.destroy=function(){this.renderer=null},r}(),Gh=function(){function r(e){this.renderer=e,this.maskStack=[],this.glConst=0}return r.prototype.getStackLength=function(){return this.maskStack.length},r.prototype.setMaskStack=function(e){var t=this.renderer.gl,i=this.getStackLength();this.maskStack=e;var n=this.getStackLength();n!==i&&(n===0?t.disable(this.glConst):(t.enable(this.glConst),this._useCurrent()))},r.prototype._useCurrent=function(){},r.prototype.destroy=function(){this.renderer=null,this.maskStack=null},r}(),Uh=new Ct,kh=[],O_=function(r){ht(e,r);function e(t){var i=r.call(this,t)||this;return i.glConst=L.ADAPTER.getWebGLRenderingContext().SCISSOR_TEST,i}return e.prototype.getStackLength=function(){var t=this.maskStack[this.maskStack.length-1];return t?t._scissorCounter:0},e.prototype.calcScissorRect=function(t){var i;if(!t._scissorRectLocal){var n=t._scissorRect,s=t.maskObject,a=this.renderer,o=a.renderTexture,h=s.getBounds(!0,(i=kh.pop())!==null&&i!==void 0?i:new Z);this.roundFrameToPixels(h,o.current?o.current.resolution:a.resolution,o.sourceFrame,o.destinationFrame,a.projection.transform),n&&h.fit(n),t._scissorRectLocal=h}},e.isMatrixRotated=function(t){if(!t)return!1;var i=t.a,n=t.b,s=t.c,a=t.d;return(Math.abs(n)>1e-4||Math.abs(s)>1e-4)&&(Math.abs(i)>1e-4||Math.abs(a)>1e-4)},e.prototype.testScissor=function(t){var i=t.maskObject;if(!i.isFastRect||!i.isFastRect()||e.isMatrixRotated(i.worldTransform)||e.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(t);var n=t._scissorRectLocal;return n.width>0&&n.height>0},e.prototype.roundFrameToPixels=function(t,i,n,s,a){e.isMatrixRotated(a)||(a=a?Uh.copyFrom(a):Uh.identity(),a.translate(-n.x,-n.y).scale(s.width/n.width,s.height/n.height).translate(s.x,s.y),this.renderer.filter.transformAABB(a,t),t.fit(s),t.x=Math.round(t.x*i),t.y=Math.round(t.y*i),t.width=Math.round(t.width*i),t.height=Math.round(t.height*i))},e.prototype.push=function(t){t._scissorRectLocal||this.calcScissorRect(t);var i=this.renderer.gl;t._scissorRect||i.enable(i.SCISSOR_TEST),t._scissorCounter++,t._scissorRect=t._scissorRectLocal,this._useCurrent()},e.prototype.pop=function(t){var i=this.renderer.gl;t&&kh.push(t._scissorRectLocal),this.getStackLength()>0?this._useCurrent():i.disable(i.SCISSOR_TEST)},e.prototype._useCurrent=function(){var t=this.maskStack[this.maskStack.length-1]._scissorRect,i;this.renderer.renderTexture.current?i=t.y:i=this.renderer.height-t.height-t.y,this.renderer.gl.scissor(t.x,i,t.width,t.height)},e}(Gh),A_=function(r){ht(e,r);function e(t){var i=r.call(this,t)||this;return i.glConst=L.ADAPTER.getWebGLRenderingContext().STENCIL_TEST,i}return e.prototype.getStackLength=function(){var t=this.maskStack[this.maskStack.length-1];return t?t._stencilCounter:0},e.prototype.push=function(t){var i=t.maskObject,n=this.renderer.gl,s=t._stencilCounter;s===0&&(this.renderer.framebuffer.forceStencil(),n.clearStencil(0),n.clear(n.STENCIL_BUFFER_BIT),n.enable(n.STENCIL_TEST)),t._stencilCounter++;var a=t._colorMask;a!==0&&(t._colorMask=0,n.colorMask(!1,!1,!1,!1)),n.stencilFunc(n.EQUAL,s,4294967295),n.stencilOp(n.KEEP,n.KEEP,n.INCR),i.renderable=!0,i.render(this.renderer),this.renderer.batch.flush(),i.renderable=!1,a!==0&&(t._colorMask=a,n.colorMask((a&1)!==0,(a&2)!==0,(a&4)!==0,(a&8)!==0)),this._useCurrent()},e.prototype.pop=function(t){var i=this.renderer.gl;if(this.getStackLength()===0)i.disable(i.STENCIL_TEST);else{var n=this.maskStack.length!==0?this.maskStack[this.maskStack.length-1]:null,s=n?n._colorMask:15;s!==0&&(n._colorMask=0,i.colorMask(!1,!1,!1,!1)),i.stencilOp(i.KEEP,i.KEEP,i.DECR),t.renderable=!0,t.render(this.renderer),this.renderer.batch.flush(),t.renderable=!1,s!==0&&(n._colorMask=s,i.colorMask((s&1)!==0,(s&2)!==0,(s&4)!==0,(s&8)!==0)),this._useCurrent()}},e.prototype._useCurrent=function(){var t=this.renderer.gl;t.stencilFunc(t.EQUAL,this.getStackLength(),4294967295),t.stencilOp(t.KEEP,t.KEEP,t.KEEP)},e}(Gh),I_=function(){function r(e){this.renderer=e,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new Ct,this.transform=null}return r.prototype.update=function(e,t,i,n){this.destinationFrame=e||this.destinationFrame||this.defaultFrame,this.sourceFrame=t||this.sourceFrame||e,this.calculateProjection(this.destinationFrame,this.sourceFrame,i,n),this.transform&&this.projectionMatrix.append(this.transform);var s=this.renderer;s.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,s.globalUniforms.update(),s.shader.shader&&s.shader.syncUniformGroup(s.shader.shader.uniforms.globals)},r.prototype.calculateProjection=function(e,t,i,n){var s=this.projectionMatrix,a=n?-1:1;s.identity(),s.a=1/t.width*2,s.d=a*(1/t.height*2),s.tx=-1-t.x*s.a,s.ty=-a-t.y*s.d},r.prototype.setTransform=function(e){},r.prototype.destroy=function(){this.renderer=null},r}(),Ei=new Z,Rr=new Z,M_=function(){function r(e){this.renderer=e,this.clearColor=e._backgroundColorRgba,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new Z,this.destinationFrame=new Z,this.viewportFrame=new Z}return r.prototype.bind=function(e,t,i){e===void 0&&(e=null);var n=this.renderer;this.current=e;var s,a,o;e?(s=e.baseTexture,o=s.resolution,t||(Ei.width=e.frame.width,Ei.height=e.frame.height,t=Ei),i||(Rr.x=e.frame.x,Rr.y=e.frame.y,Rr.width=t.width,Rr.height=t.height,i=Rr),a=s.framebuffer):(o=n.resolution,t||(Ei.width=n.screen.width,Ei.height=n.screen.height,t=Ei),i||(i=Ei,i.width=t.width,i.height=t.height));var h=this.viewportFrame;h.x=i.x*o,h.y=i.y*o,h.width=i.width*o,h.height=i.height*o,e||(h.y=n.view.height-(h.y+h.height)),h.ceil(),this.renderer.framebuffer.bind(a,h),this.renderer.projection.update(i,t,o,!a),e?this.renderer.mask.setMaskStack(s.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(t),this.destinationFrame.copyFrom(i)},r.prototype.clear=function(e,t){this.current?e=e||this.current.baseTexture.clearColor:e=e||this.clearColor;var i=this.destinationFrame,n=this.current?this.current.baseTexture:this.renderer.screen,s=i.width!==n.width||i.height!==n.height;if(s){var a=this.viewportFrame,o=a.x,h=a.y,u=a.width,l=a.height;o=Math.round(o),h=Math.round(h),u=Math.round(u),l=Math.round(l),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(o,h,u,l)}this.renderer.framebuffer.clear(e[0],e[1],e[2],e[3],t),s&&this.renderer.scissor.pop()},r.prototype.resize=function(){this.bind(null)},r.prototype.reset=function(){this.bind(null)},r.prototype.destroy=function(){this.renderer=null},r}();function D_(r,e,t,i,n){t.buffer.update(n)}var F_={float:`
349
+ `,Uh=new Ct,Ys=function(){function r(e,t){this._texture=e,this.mapCoord=new Ct,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,this.clampMargin=typeof t>"u"?.5:t,this.isSimple=!1}return Object.defineProperty(r.prototype,"texture",{get:function(){return this._texture},set:function(e){this._texture=e,this._textureID=-1},enumerable:!1,configurable:!0}),r.prototype.multiplyUvs=function(e,t){t===void 0&&(t=e);for(var i=this.mapCoord,n=0;n<e.length;n+=2){var s=e[n],a=e[n+1];t[n]=s*i.a+a*i.c+i.tx,t[n+1]=s*i.b+a*i.d+i.ty}return t},r.prototype.update=function(e){var t=this._texture;if(!t||!t.valid||!e&&this._textureID===t._updateID)return!1;this._textureID=t._updateID,this._updateID++;var i=t._uvs;this.mapCoord.set(i.x1-i.x0,i.y1-i.y0,i.x3-i.x0,i.y3-i.y0,i.x0,i.y0);var n=t.orig,s=t.trim;s&&(Uh.set(n.width/s.width,0,0,n.height/s.height,-s.x/s.width,-s.y/s.height),this.mapCoord.append(Uh));var a=t.baseTexture,o=this.uClampFrame,h=this.clampMargin/a.resolution,u=this.clampOffset;return o[0]=(t._frame.x+h+u)/a.width,o[1]=(t._frame.y+h+u)/a.height,o[2]=(t._frame.x+t._frame.width-h+u)/a.width,o[3]=(t._frame.y+t._frame.height-h+u)/a.height,this.uClampOffset[0]=u/a.realWidth,this.uClampOffset[1]=u/a.realHeight,this.isSimple=t._frame.width===a.width&&t._frame.height===a.height&&t.rotate===0,!0},r}(),C_=function(r){ht(e,r);function e(t,i,n){var s=this,a=null;return typeof t!="string"&&i===void 0&&n===void 0&&(a=t,t=void 0,i=void 0,n=void 0),s=r.call(this,t||P_,i||R_,n)||this,s.maskSprite=a,s.maskMatrix=new Ct,s}return Object.defineProperty(e.prototype,"maskSprite",{get:function(){return this._maskSprite},set:function(t){this._maskSprite=t,this._maskSprite&&(this._maskSprite.renderable=!1)},enumerable:!1,configurable:!0}),e.prototype.apply=function(t,i,n,s){var a=this._maskSprite,o=a._texture;o.valid&&(o.uvMatrix||(o.uvMatrix=new Ys(o,0)),o.uvMatrix.update(),this.uniforms.npmAlpha=o.baseTexture.alphaMode?0:1,this.uniforms.mask=o,this.uniforms.otherMatrix=t.calculateSpriteMatrix(this.maskMatrix,a).prepend(o.uvMatrix.mapCoord),this.uniforms.alpha=a.worldAlpha,this.uniforms.maskClamp=o.uvMatrix.uClampFrame,t.applyFilter(this,i,n,s))},e}(Je),O_=function(){function r(e){this.renderer=e,this.enableScissor=!0,this.alphaMaskPool=[],this.maskDataPool=[],this.maskStack=[],this.alphaMaskIndex=0}return r.prototype.setMaskStack=function(e){this.maskStack=e,this.renderer.scissor.setMaskStack(e),this.renderer.stencil.setMaskStack(e)},r.prototype.push=function(e,t){var i=t;if(!i.isMaskData){var n=this.maskDataPool.pop()||new u_;n.pooled=!0,n.maskObject=t,i=n}var s=this.maskStack.length!==0?this.maskStack[this.maskStack.length-1]:null;if(i.copyCountersOrReset(s),i._colorMask=s?s._colorMask:15,i.autoDetect&&this.detect(i),i._target=e,i.type!==Pt.SPRITE&&this.maskStack.push(i),i.enabled)switch(i.type){case Pt.SCISSOR:this.renderer.scissor.push(i);break;case Pt.STENCIL:this.renderer.stencil.push(i);break;case Pt.SPRITE:i.copyCountersOrReset(null),this.pushSpriteMask(i);break;case Pt.COLOR:this.pushColorMask(i);break}i.type===Pt.SPRITE&&this.maskStack.push(i)},r.prototype.pop=function(e){var t=this.maskStack.pop();if(!(!t||t._target!==e)){if(t.enabled)switch(t.type){case Pt.SCISSOR:this.renderer.scissor.pop(t);break;case Pt.STENCIL:this.renderer.stencil.pop(t.maskObject);break;case Pt.SPRITE:this.popSpriteMask(t);break;case Pt.COLOR:this.popColorMask(t);break}if(t.reset(),t.pooled&&this.maskDataPool.push(t),this.maskStack.length!==0){var i=this.maskStack[this.maskStack.length-1];i.type===Pt.SPRITE&&i._filters&&(i._filters[0].maskSprite=i.maskObject)}}},r.prototype.detect=function(e){var t=e.maskObject;t?t.isSprite?e.type=Pt.SPRITE:this.enableScissor&&this.renderer.scissor.testScissor(e)?e.type=Pt.SCISSOR:e.type=Pt.STENCIL:e.type=Pt.COLOR},r.prototype.pushSpriteMask=function(e){var t,i,n=e.maskObject,s=e._target,a=e._filters;a||(a=this.alphaMaskPool[this.alphaMaskIndex],a||(a=this.alphaMaskPool[this.alphaMaskIndex]=[new C_]));var o=this.renderer,h=o.renderTexture,u,l;if(h.current){var f=h.current;u=e.resolution||f.resolution,l=(t=e.multisample)!==null&&t!==void 0?t:f.multisample}else u=e.resolution||o.resolution,l=(i=e.multisample)!==null&&i!==void 0?i:o.multisample;a[0].resolution=u,a[0].multisample=l,a[0].maskSprite=n;var c=s.filterArea;s.filterArea=n.getBounds(!0),o.filter.push(s,a),s.filterArea=c,e._filters||this.alphaMaskIndex++},r.prototype.popSpriteMask=function(e){this.renderer.filter.pop(),e._filters?e._filters[0].maskSprite=null:(this.alphaMaskIndex--,this.alphaMaskPool[this.alphaMaskIndex][0].maskSprite=null)},r.prototype.pushColorMask=function(e){var t=e._colorMask,i=e._colorMask=t&e.colorMask;i!==t&&this.renderer.gl.colorMask((i&1)!==0,(i&2)!==0,(i&4)!==0,(i&8)!==0)},r.prototype.popColorMask=function(e){var t=e._colorMask,i=this.maskStack.length>0?this.maskStack[this.maskStack.length-1]._colorMask:15;i!==t&&this.renderer.gl.colorMask((i&1)!==0,(i&2)!==0,(i&4)!==0,(i&8)!==0)},r.prototype.destroy=function(){this.renderer=null},r}(),Gh=function(){function r(e){this.renderer=e,this.maskStack=[],this.glConst=0}return r.prototype.getStackLength=function(){return this.maskStack.length},r.prototype.setMaskStack=function(e){var t=this.renderer.gl,i=this.getStackLength();this.maskStack=e;var n=this.getStackLength();n!==i&&(n===0?t.disable(this.glConst):(t.enable(this.glConst),this._useCurrent()))},r.prototype._useCurrent=function(){},r.prototype.destroy=function(){this.renderer=null,this.maskStack=null},r}(),kh=new Ct,Xh=[],A_=function(r){ht(e,r);function e(t){var i=r.call(this,t)||this;return i.glConst=L.ADAPTER.getWebGLRenderingContext().SCISSOR_TEST,i}return e.prototype.getStackLength=function(){var t=this.maskStack[this.maskStack.length-1];return t?t._scissorCounter:0},e.prototype.calcScissorRect=function(t){var i;if(!t._scissorRectLocal){var n=t._scissorRect,s=t.maskObject,a=this.renderer,o=a.renderTexture,h=s.getBounds(!0,(i=Xh.pop())!==null&&i!==void 0?i:new q);this.roundFrameToPixels(h,o.current?o.current.resolution:a.resolution,o.sourceFrame,o.destinationFrame,a.projection.transform),n&&h.fit(n),t._scissorRectLocal=h}},e.isMatrixRotated=function(t){if(!t)return!1;var i=t.a,n=t.b,s=t.c,a=t.d;return(Math.abs(n)>1e-4||Math.abs(s)>1e-4)&&(Math.abs(i)>1e-4||Math.abs(a)>1e-4)},e.prototype.testScissor=function(t){var i=t.maskObject;if(!i.isFastRect||!i.isFastRect()||e.isMatrixRotated(i.worldTransform)||e.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(t);var n=t._scissorRectLocal;return n.width>0&&n.height>0},e.prototype.roundFrameToPixels=function(t,i,n,s,a){e.isMatrixRotated(a)||(a=a?kh.copyFrom(a):kh.identity(),a.translate(-n.x,-n.y).scale(s.width/n.width,s.height/n.height).translate(s.x,s.y),this.renderer.filter.transformAABB(a,t),t.fit(s),t.x=Math.round(t.x*i),t.y=Math.round(t.y*i),t.width=Math.round(t.width*i),t.height=Math.round(t.height*i))},e.prototype.push=function(t){t._scissorRectLocal||this.calcScissorRect(t);var i=this.renderer.gl;t._scissorRect||i.enable(i.SCISSOR_TEST),t._scissorCounter++,t._scissorRect=t._scissorRectLocal,this._useCurrent()},e.prototype.pop=function(t){var i=this.renderer.gl;t&&Xh.push(t._scissorRectLocal),this.getStackLength()>0?this._useCurrent():i.disable(i.SCISSOR_TEST)},e.prototype._useCurrent=function(){var t=this.maskStack[this.maskStack.length-1]._scissorRect,i;this.renderer.renderTexture.current?i=t.y:i=this.renderer.height-t.height-t.y,this.renderer.gl.scissor(t.x,i,t.width,t.height)},e}(Gh),I_=function(r){ht(e,r);function e(t){var i=r.call(this,t)||this;return i.glConst=L.ADAPTER.getWebGLRenderingContext().STENCIL_TEST,i}return e.prototype.getStackLength=function(){var t=this.maskStack[this.maskStack.length-1];return t?t._stencilCounter:0},e.prototype.push=function(t){var i=t.maskObject,n=this.renderer.gl,s=t._stencilCounter;s===0&&(this.renderer.framebuffer.forceStencil(),n.clearStencil(0),n.clear(n.STENCIL_BUFFER_BIT),n.enable(n.STENCIL_TEST)),t._stencilCounter++;var a=t._colorMask;a!==0&&(t._colorMask=0,n.colorMask(!1,!1,!1,!1)),n.stencilFunc(n.EQUAL,s,4294967295),n.stencilOp(n.KEEP,n.KEEP,n.INCR),i.renderable=!0,i.render(this.renderer),this.renderer.batch.flush(),i.renderable=!1,a!==0&&(t._colorMask=a,n.colorMask((a&1)!==0,(a&2)!==0,(a&4)!==0,(a&8)!==0)),this._useCurrent()},e.prototype.pop=function(t){var i=this.renderer.gl;if(this.getStackLength()===0)i.disable(i.STENCIL_TEST);else{var n=this.maskStack.length!==0?this.maskStack[this.maskStack.length-1]:null,s=n?n._colorMask:15;s!==0&&(n._colorMask=0,i.colorMask(!1,!1,!1,!1)),i.stencilOp(i.KEEP,i.KEEP,i.DECR),t.renderable=!0,t.render(this.renderer),this.renderer.batch.flush(),t.renderable=!1,s!==0&&(n._colorMask=s,i.colorMask((s&1)!==0,(s&2)!==0,(s&4)!==0,(s&8)!==0)),this._useCurrent()}},e.prototype._useCurrent=function(){var t=this.renderer.gl;t.stencilFunc(t.EQUAL,this.getStackLength(),4294967295),t.stencilOp(t.KEEP,t.KEEP,t.KEEP)},e}(Gh),M_=function(){function r(e){this.renderer=e,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new Ct,this.transform=null}return r.prototype.update=function(e,t,i,n){this.destinationFrame=e||this.destinationFrame||this.defaultFrame,this.sourceFrame=t||this.sourceFrame||e,this.calculateProjection(this.destinationFrame,this.sourceFrame,i,n),this.transform&&this.projectionMatrix.append(this.transform);var s=this.renderer;s.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,s.globalUniforms.update(),s.shader.shader&&s.shader.syncUniformGroup(s.shader.shader.uniforms.globals)},r.prototype.calculateProjection=function(e,t,i,n){var s=this.projectionMatrix,a=n?-1:1;s.identity(),s.a=1/t.width*2,s.d=a*(1/t.height*2),s.tx=-1-t.x*s.a,s.ty=-a-t.y*s.d},r.prototype.setTransform=function(e){},r.prototype.destroy=function(){this.renderer=null},r}(),Ei=new q,Rr=new q,D_=function(){function r(e){this.renderer=e,this.clearColor=e._backgroundColorRgba,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new q,this.destinationFrame=new q,this.viewportFrame=new q}return r.prototype.bind=function(e,t,i){e===void 0&&(e=null);var n=this.renderer;this.current=e;var s,a,o;e?(s=e.baseTexture,o=s.resolution,t||(Ei.width=e.frame.width,Ei.height=e.frame.height,t=Ei),i||(Rr.x=e.frame.x,Rr.y=e.frame.y,Rr.width=t.width,Rr.height=t.height,i=Rr),a=s.framebuffer):(o=n.resolution,t||(Ei.width=n.screen.width,Ei.height=n.screen.height,t=Ei),i||(i=Ei,i.width=t.width,i.height=t.height));var h=this.viewportFrame;h.x=i.x*o,h.y=i.y*o,h.width=i.width*o,h.height=i.height*o,e||(h.y=n.view.height-(h.y+h.height)),h.ceil(),this.renderer.framebuffer.bind(a,h),this.renderer.projection.update(i,t,o,!a),e?this.renderer.mask.setMaskStack(s.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(t),this.destinationFrame.copyFrom(i)},r.prototype.clear=function(e,t){this.current?e=e||this.current.baseTexture.clearColor:e=e||this.clearColor;var i=this.destinationFrame,n=this.current?this.current.baseTexture:this.renderer.screen,s=i.width!==n.width||i.height!==n.height;if(s){var a=this.viewportFrame,o=a.x,h=a.y,u=a.width,l=a.height;o=Math.round(o),h=Math.round(h),u=Math.round(u),l=Math.round(l),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(o,h,u,l)}this.renderer.framebuffer.clear(e[0],e[1],e[2],e[3],t),s&&this.renderer.scissor.pop()},r.prototype.resize=function(){this.bind(null)},r.prototype.reset=function(){this.bind(null)},r.prototype.destroy=function(){this.renderer=null},r}();function F_(r,e,t,i,n){t.buffer.update(n)}var N_={float:`
350
350
  data[offset] = v;
351
351
  `,vec2:`
352
352
  data[offset] = v[0];
@@ -384,7 +384,7 @@ void main(void)
384
384
  {
385
385
  data[offset + i] = v[i];
386
386
  }
387
- `},Xh={float:4,vec2:8,vec3:12,vec4:16,int:4,ivec2:8,ivec3:12,ivec4:16,uint:4,uvec2:8,uvec3:12,uvec4:16,bool:4,bvec2:8,bvec3:12,bvec4:16,mat2:16*2,mat3:16*3,mat4:16*4};function N_(r){for(var e=r.map(function(h){return{data:h,offset:0,dataLen:0,dirty:0}}),t=0,i=0,n=0,s=0;s<e.length;s++){var a=e[s];if(t=Xh[a.data.type],a.data.size>1&&(t=Math.max(t,16)*a.data.size),a.dataLen=t,i%t!==0&&i<16){var o=i%t%16;i+=o,n+=o}i+t>16?(n=Math.ceil(n/16)*16,a.offset=n,n+=t,i=t):(a.offset=n,i+=t,n+=t)}return n=Math.ceil(n/16)*16,{uboElements:e,size:n}}function L_(r,e){var t=[];for(var i in r)e[i]&&t.push(e[i]);return t.sort(function(n,s){return n.index-s.index}),t}function B_(r,e){if(!r.autoManage)return{size:0,syncFunc:D_};for(var t=L_(r.uniforms,e),i=N_(t),n=i.uboElements,s=i.size,a=[`
387
+ `},Hh={float:4,vec2:8,vec3:12,vec4:16,int:4,ivec2:8,ivec3:12,ivec4:16,uint:4,uvec2:8,uvec3:12,uvec4:16,bool:4,bvec2:8,bvec3:12,bvec4:16,mat2:16*2,mat3:16*3,mat4:16*4};function L_(r){for(var e=r.map(function(h){return{data:h,offset:0,dataLen:0,dirty:0}}),t=0,i=0,n=0,s=0;s<e.length;s++){var a=e[s];if(t=Hh[a.data.type],a.data.size>1&&(t=Math.max(t,16)*a.data.size),a.dataLen=t,i%t!==0&&i<16){var o=i%t%16;i+=o,n+=o}i+t>16?(n=Math.ceil(n/16)*16,a.offset=n,n+=t,i=t):(a.offset=n,i+=t,n+=t)}return n=Math.ceil(n/16)*16,{uboElements:e,size:n}}function B_(r,e){var t=[];for(var i in r)e[i]&&t.push(e[i]);return t.sort(function(n,s){return n.index-s.index}),t}function U_(r,e){if(!r.autoManage)return{size:0,syncFunc:F_};for(var t=B_(r.uniforms,e),i=L_(t),n=i.uboElements,s=i.size,a=[`
388
388
  var v = null;
389
389
  var v2 = null;
390
390
  var cv = null;
@@ -392,7 +392,7 @@ void main(void)
392
392
  var gl = renderer.gl
393
393
  var index = 0;
394
394
  var data = buffer.data;
395
- `],o=0;o<n.length;o++){for(var h=n[o],u=r.uniforms[h.data.name],l=h.data.name,f=!1,c=0;c<Yi.length;c++){var d=Yi[c];if(d.codeUbo&&d.test(h.data,u)){a.push("offset = "+h.offset/4+";",Yi[c].codeUbo(h.data.name,u)),f=!0;break}}if(!f)if(h.data.size>1){var v=Fh(h.data.type),p=Math.max(Xh[h.data.type]/16,1),_=v/p,m=(4-_%4)%4;a.push(`
395
+ `],o=0;o<n.length;o++){for(var h=n[o],u=r.uniforms[h.data.name],l=h.data.name,f=!1,c=0;c<Yi.length;c++){var d=Yi[c];if(d.codeUbo&&d.test(h.data,u)){a.push("offset = "+h.offset/4+";",Yi[c].codeUbo(h.data.name,u)),f=!0;break}}if(!f)if(h.data.size>1){var v=Nh(h.data.type),p=Math.max(Hh[h.data.type]/16,1),_=v/p,m=(4-_%4)%4;a.push(`
396
396
  cv = ud.`+l+`.value;
397
397
  v = uv.`+l+`;
398
398
  offset = `+h.offset/4+`;
@@ -408,7 +408,7 @@ void main(void)
408
408
  offset += `+m+`;
409
409
  }
410
410
 
411
- `)}else{var g=F_[h.data.type];a.push(`
411
+ `)}else{var g=N_[h.data.type];a.push(`
412
412
  cv = ud.`+l+`.value;
413
413
  v = uv.`+l+`;
414
414
  offset = `+h.offset/4+`;
@@ -416,7 +416,7 @@ void main(void)
416
416
  `)}}return a.push(`
417
417
  renderer.buffer.update(buffer);
418
418
  `),{size:s,syncFunc:new Function("ud","uv","renderer","syncData","buffer",a.join(`
419
- `))}}var G_=function(){function r(e,t){this.program=e,this.uniformData=t,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBufferBindings={}}return r.prototype.destroy=function(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBufferBindings=null,this.program=null},r}();function U_(r,e){for(var t={},i=e.getProgramParameter(r,e.ACTIVE_ATTRIBUTES),n=0;n<i;n++){var s=e.getActiveAttrib(r,n);if(s.name.indexOf("gl_")!==0){var a=Lh(e,s.type),o={type:a,name:s.name,size:Fh(a),location:e.getAttribLocation(r,s.name)};t[s.name]=o}}return t}function k_(r,e){for(var t={},i=e.getProgramParameter(r,e.ACTIVE_UNIFORMS),n=0;n<i;n++){var s=e.getActiveUniform(r,n),a=s.name.replace(/\[.*?\]$/,""),o=!!s.name.match(/\[.*?\]$/),h=Lh(e,s.type);t[a]={name:a,index:n,type:h,size:s.size,isArray:o,value:Ih(h,s.size)}}return t}function X_(r,e){var t=Oh(r,r.VERTEX_SHADER,e.vertexSrc),i=Oh(r,r.FRAGMENT_SHADER,e.fragmentSrc),n=r.createProgram();if(r.attachShader(n,t),r.attachShader(n,i),r.linkProgram(n),r.getProgramParameter(n,r.LINK_STATUS)||u_(r,n,t,i),e.attributeData=U_(n,r),e.uniformData=k_(n,r),!/^[ \t]*#[ \t]*version[ \t]+300[ \t]+es[ \t]*$/m.test(e.vertexSrc)){var s=Object.keys(e.attributeData);s.sort(function(l,f){return l>f?1:-1});for(var a=0;a<s.length;a++)e.attributeData[s[a]].location=a,r.bindAttribLocation(n,a,s[a]);r.linkProgram(n)}r.deleteShader(t),r.deleteShader(i);var o={};for(var a in e.uniformData){var h=e.uniformData[a];o[a]={location:r.getUniformLocation(n,a),value:Ih(h.type,h.size)}}var u=new G_(n,o);return u}var H_=0,bn={textureCount:0,uboCount:0},W_=function(){function r(e){this.destroyed=!1,this.renderer=e,this.systemCheck(),this.gl=null,this.shader=null,this.program=null,this.cache={},this._uboCache={},this.id=H_++}return r.prototype.systemCheck=function(){if(!y_())throw new Error("Current environment does not allow unsafe-eval, please use @pixi/unsafe-eval module to enable support.")},r.prototype.contextChange=function(e){this.gl=e,this.reset()},r.prototype.bind=function(e,t){e.disposeRunner.add(this),e.uniforms.globals=this.renderer.globalUniforms;var i=e.program,n=i.glPrograms[this.renderer.CONTEXT_UID]||this.generateProgram(e);return this.shader=e,this.program!==i&&(this.program=i,this.gl.useProgram(n.program)),t||(bn.textureCount=0,bn.uboCount=0,this.syncUniformGroup(e.uniformGroup,bn)),n},r.prototype.setUniforms=function(e){var t=this.shader.program,i=t.glPrograms[this.renderer.CONTEXT_UID];t.syncUniforms(i.uniformData,e,this.renderer)},r.prototype.syncUniformGroup=function(e,t){var i=this.getGlProgram();(!e.static||e.dirtyId!==i.uniformDirtyGroups[e.id])&&(i.uniformDirtyGroups[e.id]=e.dirtyId,this.syncUniforms(e,i,t))},r.prototype.syncUniforms=function(e,t,i){var n=e.syncUniforms[this.shader.program.id]||this.createSyncGroups(e);n(t.uniformData,e.uniforms,this.renderer,i)},r.prototype.createSyncGroups=function(e){var t=this.getSignature(e,this.shader.program.uniformData,"u");return this.cache[t]||(this.cache[t]=v_(e,this.shader.program.uniformData)),e.syncUniforms[this.shader.program.id]=this.cache[t],e.syncUniforms[this.shader.program.id]},r.prototype.syncUniformBufferGroup=function(e,t){var i=this.getGlProgram();if(!e.static||e.dirtyId!==0||!i.uniformGroups[e.id]){e.dirtyId=0;var n=i.uniformGroups[e.id]||this.createSyncBufferGroup(e,i,t);e.buffer.update(),n(i.uniformData,e.uniforms,this.renderer,bn,e.buffer)}this.renderer.buffer.bindBufferBase(e.buffer,i.uniformBufferBindings[t])},r.prototype.createSyncBufferGroup=function(e,t,i){var n=this.renderer.gl;this.renderer.buffer.bind(e.buffer);var s=this.gl.getUniformBlockIndex(t.program,i);t.uniformBufferBindings[i]=this.shader.uniformBindCount,n.uniformBlockBinding(t.program,s,this.shader.uniformBindCount),this.shader.uniformBindCount++;var a=this.getSignature(e,this.shader.program.uniformData,"ubo"),o=this._uboCache[a];if(o||(o=this._uboCache[a]=B_(e,this.shader.program.uniformData)),e.autoManage){var h=new Float32Array(o.size/4);e.buffer.update(h)}return t.uniformGroups[e.id]=o.syncFunc,t.uniformGroups[e.id]},r.prototype.getSignature=function(e,t,i){var n=e.uniforms,s=[i+"-"];for(var a in n)s.push(a),t[a]&&s.push(t[a].type);return s.join("-")},r.prototype.getGlProgram=function(){return this.shader?this.shader.program.glPrograms[this.renderer.CONTEXT_UID]:null},r.prototype.generateProgram=function(e){var t=this.gl,i=e.program,n=X_(t,i);return i.glPrograms[this.renderer.CONTEXT_UID]=n,n},r.prototype.reset=function(){this.program=null,this.shader=null},r.prototype.disposeShader=function(e){this.shader===e&&(this.shader=null)},r.prototype.destroy=function(){this.renderer=null,this.destroyed=!0},r}();function z_(r,e){return e===void 0&&(e=[]),e[X.NORMAL]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[X.ADD]=[r.ONE,r.ONE],e[X.MULTIPLY]=[r.DST_COLOR,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA],e[X.SCREEN]=[r.ONE,r.ONE_MINUS_SRC_COLOR,r.ONE,r.ONE_MINUS_SRC_ALPHA],e[X.OVERLAY]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[X.DARKEN]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[X.LIGHTEN]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[X.COLOR_DODGE]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[X.COLOR_BURN]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[X.HARD_LIGHT]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[X.SOFT_LIGHT]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[X.DIFFERENCE]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[X.EXCLUSION]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[X.HUE]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[X.SATURATION]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[X.COLOR]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[X.LUMINOSITY]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[X.NONE]=[0,0],e[X.NORMAL_NPM]=[r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA],e[X.ADD_NPM]=[r.SRC_ALPHA,r.ONE,r.ONE,r.ONE],e[X.SCREEN_NPM]=[r.SRC_ALPHA,r.ONE_MINUS_SRC_COLOR,r.ONE,r.ONE_MINUS_SRC_ALPHA],e[X.SRC_IN]=[r.DST_ALPHA,r.ZERO],e[X.SRC_OUT]=[r.ONE_MINUS_DST_ALPHA,r.ZERO],e[X.SRC_ATOP]=[r.DST_ALPHA,r.ONE_MINUS_SRC_ALPHA],e[X.DST_OVER]=[r.ONE_MINUS_DST_ALPHA,r.ONE],e[X.DST_IN]=[r.ZERO,r.SRC_ALPHA],e[X.DST_OUT]=[r.ZERO,r.ONE_MINUS_SRC_ALPHA],e[X.DST_ATOP]=[r.ONE_MINUS_DST_ALPHA,r.SRC_ALPHA],e[X.XOR]=[r.ONE_MINUS_DST_ALPHA,r.ONE_MINUS_SRC_ALPHA],e[X.SUBTRACT]=[r.ONE,r.ONE,r.ONE,r.ONE,r.FUNC_REVERSE_SUBTRACT,r.FUNC_ADD],e}var V_=0,Y_=1,j_=2,Z_=3,q_=4,K_=5,$_=function(){function r(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode=X.NONE,this._blendEq=!1,this.map=[],this.map[V_]=this.setBlend,this.map[Y_]=this.setOffset,this.map[j_]=this.setCullFace,this.map[Z_]=this.setDepthTest,this.map[q_]=this.setFrontFace,this.map[K_]=this.setDepthMask,this.checks=[],this.defaultState=new wi,this.defaultState.blend=!0}return r.prototype.contextChange=function(e){this.gl=e,this.blendModes=z_(e),this.set(this.defaultState),this.reset()},r.prototype.set=function(e){if(e=e||this.defaultState,this.stateId!==e.data){for(var t=this.stateId^e.data,i=0;t;)t&1&&this.map[i].call(this,!!(e.data&1<<i)),t=t>>1,i++;this.stateId=e.data}for(var i=0;i<this.checks.length;i++)this.checks[i](this,e)},r.prototype.forceState=function(e){e=e||this.defaultState;for(var t=0;t<this.map.length;t++)this.map[t].call(this,!!(e.data&1<<t));for(var t=0;t<this.checks.length;t++)this.checks[t](this,e);this.stateId=e.data},r.prototype.setBlend=function(e){this.updateCheck(r.checkBlendMode,e),this.gl[e?"enable":"disable"](this.gl.BLEND)},r.prototype.setOffset=function(e){this.updateCheck(r.checkPolygonOffset,e),this.gl[e?"enable":"disable"](this.gl.POLYGON_OFFSET_FILL)},r.prototype.setDepthTest=function(e){this.gl[e?"enable":"disable"](this.gl.DEPTH_TEST)},r.prototype.setDepthMask=function(e){this.gl.depthMask(e)},r.prototype.setCullFace=function(e){this.gl[e?"enable":"disable"](this.gl.CULL_FACE)},r.prototype.setFrontFace=function(e){this.gl.frontFace(this.gl[e?"CW":"CCW"])},r.prototype.setBlendMode=function(e){if(e!==this.blendMode){this.blendMode=e;var t=this.blendModes[e],i=this.gl;t.length===2?i.blendFunc(t[0],t[1]):i.blendFuncSeparate(t[0],t[1],t[2],t[3]),t.length===6?(this._blendEq=!0,i.blendEquationSeparate(t[4],t[5])):this._blendEq&&(this._blendEq=!1,i.blendEquationSeparate(i.FUNC_ADD,i.FUNC_ADD))}},r.prototype.setPolygonOffset=function(e,t){this.gl.polygonOffset(e,t)},r.prototype.reset=function(){this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,!1),this.forceState(this.defaultState),this._blendEq=!0,this.blendMode=-1,this.setBlendMode(0)},r.prototype.updateCheck=function(e,t){var i=this.checks.indexOf(e);t&&i===-1?this.checks.push(e):!t&&i!==-1&&this.checks.splice(i,1)},r.checkBlendMode=function(e,t){e.setBlendMode(t.blendMode)},r.checkPolygonOffset=function(e,t){e.setPolygonOffset(1,t.polygonOffset)},r.prototype.destroy=function(){this.gl=null},r}(),J_=function(){function r(e){this.renderer=e,this.count=0,this.checkCount=0,this.maxIdle=L.GC_MAX_IDLE,this.checkCountMax=L.GC_MAX_CHECK_COUNT,this.mode=L.GC_MODE}return r.prototype.postrender=function(){this.renderer.renderingToScreen&&(this.count++,this.mode!==rn.MANUAL&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))},r.prototype.run=function(){for(var e=this.renderer.texture,t=e.managedTextures,i=!1,n=0;n<t.length;n++){var s=t[n];!s.framebuffer&&this.count-s.touched>this.maxIdle&&(e.destroyTexture(s,!0),t[n]=null,i=!0)}if(i){for(var a=0,n=0;n<t.length;n++)t[n]!==null&&(t[a++]=t[n]);t.length=a}},r.prototype.unload=function(e){var t=this.renderer.texture,i=e._texture;i&&!i.framebuffer&&t.destroyTexture(i);for(var n=e.children.length-1;n>=0;n--)this.unload(e.children[n])},r.prototype.destroy=function(){this.renderer=null},r}();function Q_(r){var e,t,i,n,s,a,o,h,u,l,f,c,d,v,p,_,m,g,y,b,x,T,w;return"WebGL2RenderingContext"in globalThis&&r instanceof globalThis.WebGL2RenderingContext?w=(e={},e[k.UNSIGNED_BYTE]=(t={},t[M.RGBA]=r.RGBA8,t[M.RGB]=r.RGB8,t[M.RG]=r.RG8,t[M.RED]=r.R8,t[M.RGBA_INTEGER]=r.RGBA8UI,t[M.RGB_INTEGER]=r.RGB8UI,t[M.RG_INTEGER]=r.RG8UI,t[M.RED_INTEGER]=r.R8UI,t[M.ALPHA]=r.ALPHA,t[M.LUMINANCE]=r.LUMINANCE,t[M.LUMINANCE_ALPHA]=r.LUMINANCE_ALPHA,t),e[k.BYTE]=(i={},i[M.RGBA]=r.RGBA8_SNORM,i[M.RGB]=r.RGB8_SNORM,i[M.RG]=r.RG8_SNORM,i[M.RED]=r.R8_SNORM,i[M.RGBA_INTEGER]=r.RGBA8I,i[M.RGB_INTEGER]=r.RGB8I,i[M.RG_INTEGER]=r.RG8I,i[M.RED_INTEGER]=r.R8I,i),e[k.UNSIGNED_SHORT]=(n={},n[M.RGBA_INTEGER]=r.RGBA16UI,n[M.RGB_INTEGER]=r.RGB16UI,n[M.RG_INTEGER]=r.RG16UI,n[M.RED_INTEGER]=r.R16UI,n[M.DEPTH_COMPONENT]=r.DEPTH_COMPONENT16,n),e[k.SHORT]=(s={},s[M.RGBA_INTEGER]=r.RGBA16I,s[M.RGB_INTEGER]=r.RGB16I,s[M.RG_INTEGER]=r.RG16I,s[M.RED_INTEGER]=r.R16I,s),e[k.UNSIGNED_INT]=(a={},a[M.RGBA_INTEGER]=r.RGBA32UI,a[M.RGB_INTEGER]=r.RGB32UI,a[M.RG_INTEGER]=r.RG32UI,a[M.RED_INTEGER]=r.R32UI,a[M.DEPTH_COMPONENT]=r.DEPTH_COMPONENT24,a),e[k.INT]=(o={},o[M.RGBA_INTEGER]=r.RGBA32I,o[M.RGB_INTEGER]=r.RGB32I,o[M.RG_INTEGER]=r.RG32I,o[M.RED_INTEGER]=r.R32I,o),e[k.FLOAT]=(h={},h[M.RGBA]=r.RGBA32F,h[M.RGB]=r.RGB32F,h[M.RG]=r.RG32F,h[M.RED]=r.R32F,h[M.DEPTH_COMPONENT]=r.DEPTH_COMPONENT32F,h),e[k.HALF_FLOAT]=(u={},u[M.RGBA]=r.RGBA16F,u[M.RGB]=r.RGB16F,u[M.RG]=r.RG16F,u[M.RED]=r.R16F,u),e[k.UNSIGNED_SHORT_5_6_5]=(l={},l[M.RGB]=r.RGB565,l),e[k.UNSIGNED_SHORT_4_4_4_4]=(f={},f[M.RGBA]=r.RGBA4,f),e[k.UNSIGNED_SHORT_5_5_5_1]=(c={},c[M.RGBA]=r.RGB5_A1,c),e[k.UNSIGNED_INT_2_10_10_10_REV]=(d={},d[M.RGBA]=r.RGB10_A2,d[M.RGBA_INTEGER]=r.RGB10_A2UI,d),e[k.UNSIGNED_INT_10F_11F_11F_REV]=(v={},v[M.RGB]=r.R11F_G11F_B10F,v),e[k.UNSIGNED_INT_5_9_9_9_REV]=(p={},p[M.RGB]=r.RGB9_E5,p),e[k.UNSIGNED_INT_24_8]=(_={},_[M.DEPTH_STENCIL]=r.DEPTH24_STENCIL8,_),e[k.FLOAT_32_UNSIGNED_INT_24_8_REV]=(m={},m[M.DEPTH_STENCIL]=r.DEPTH32F_STENCIL8,m),e):w=(g={},g[k.UNSIGNED_BYTE]=(y={},y[M.RGBA]=r.RGBA,y[M.RGB]=r.RGB,y[M.ALPHA]=r.ALPHA,y[M.LUMINANCE]=r.LUMINANCE,y[M.LUMINANCE_ALPHA]=r.LUMINANCE_ALPHA,y),g[k.UNSIGNED_SHORT_5_6_5]=(b={},b[M.RGB]=r.RGB,b),g[k.UNSIGNED_SHORT_4_4_4_4]=(x={},x[M.RGBA]=r.RGBA,x),g[k.UNSIGNED_SHORT_5_5_5_1]=(T={},T[M.RGBA]=r.RGBA,T),g),w}var js=function(){function r(e){this.texture=e,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=k.UNSIGNED_BYTE,this.internalFormat=M.RGBA,this.samplerType=0}return r}(),tm=function(){function r(e){this.renderer=e,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new Q,this.hasIntegerTextures=!1}return r.prototype.contextChange=function(){var e=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=Q_(e);var t=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=t;for(var i=0;i<t;i++)this.boundTextures[i]=null;this.emptyTextures={};var n=new js(e.createTexture());e.bindTexture(e.TEXTURE_2D,n.texture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,new Uint8Array(4)),this.emptyTextures[e.TEXTURE_2D]=n,this.emptyTextures[e.TEXTURE_CUBE_MAP]=new js(e.createTexture()),e.bindTexture(e.TEXTURE_CUBE_MAP,this.emptyTextures[e.TEXTURE_CUBE_MAP].texture);for(var i=0;i<6;i++)e.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+i,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,null);e.texParameteri(e.TEXTURE_CUBE_MAP,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_CUBE_MAP,e.TEXTURE_MIN_FILTER,e.LINEAR);for(var i=0;i<this.boundTextures.length;i++)this.bind(null,i)},r.prototype.bind=function(e,t){t===void 0&&(t=0);var i=this.gl;if(e=e==null?void 0:e.castToBaseTexture(),e&&e.valid&&!e.parentTextureArray){e.touched=this.renderer.textureGC.count;var n=e._glTextures[this.CONTEXT_UID]||this.initTexture(e);this.boundTextures[t]!==e&&(this.currentLocation!==t&&(this.currentLocation=t,i.activeTexture(i.TEXTURE0+t)),i.bindTexture(e.target,n.texture)),n.dirtyId!==e.dirtyId?(this.currentLocation!==t&&(this.currentLocation=t,i.activeTexture(i.TEXTURE0+t)),this.updateTexture(e)):n.dirtyStyleId!==e.dirtyStyleId&&this.updateTextureStyle(e),this.boundTextures[t]=e}else this.currentLocation!==t&&(this.currentLocation=t,i.activeTexture(i.TEXTURE0+t)),i.bindTexture(i.TEXTURE_2D,this.emptyTextures[i.TEXTURE_2D].texture),this.boundTextures[t]=null},r.prototype.reset=function(){this._unknownBoundTextures=!0,this.hasIntegerTextures=!1,this.currentLocation=-1;for(var e=0;e<this.boundTextures.length;e++)this.boundTextures[e]=this.unknownTexture},r.prototype.unbind=function(e){var t=this,i=t.gl,n=t.boundTextures;if(this._unknownBoundTextures){this._unknownBoundTextures=!1;for(var s=0;s<n.length;s++)n[s]===this.unknownTexture&&this.bind(null,s)}for(var s=0;s<n.length;s++)n[s]===e&&(this.currentLocation!==s&&(i.activeTexture(i.TEXTURE0+s),this.currentLocation=s),i.bindTexture(e.target,this.emptyTextures[e.target].texture),n[s]=null)},r.prototype.ensureSamplerType=function(e){var t=this,i=t.boundTextures,n=t.hasIntegerTextures,s=t.CONTEXT_UID;if(n)for(var a=e-1;a>=0;--a){var o=i[a];if(o){var h=o._glTextures[s];h.samplerType!==en.FLOAT&&this.renderer.texture.unbind(o)}}},r.prototype.initTexture=function(e){var t=new js(this.gl.createTexture());return t.dirtyId=-1,e._glTextures[this.CONTEXT_UID]=t,this.managedTextures.push(e),e.on("dispose",this.destroyTexture,this),t},r.prototype.initTextureType=function(e,t){var i,n;t.internalFormat=(n=(i=this.internalFormats[e.type])===null||i===void 0?void 0:i[e.format])!==null&&n!==void 0?n:e.format,this.webGLVersion===2&&e.type===k.HALF_FLOAT?t.type=this.gl.HALF_FLOAT:t.type=e.type},r.prototype.updateTexture=function(e){var t=e._glTextures[this.CONTEXT_UID];if(t){var i=this.renderer;if(this.initTextureType(e,t),e.resource&&e.resource.upload(i,e,t))t.samplerType!==en.FLOAT&&(this.hasIntegerTextures=!0);else{var n=e.realWidth,s=e.realHeight,a=i.gl;(t.width!==n||t.height!==s||t.dirtyId<0)&&(t.width=n,t.height=s,a.texImage2D(e.target,0,t.internalFormat,n,s,0,e.format,t.type,null))}e.dirtyStyleId!==t.dirtyStyleId&&this.updateTextureStyle(e),t.dirtyId=e.dirtyId}},r.prototype.destroyTexture=function(e,t){var i=this.gl;if(e=e.castToBaseTexture(),e._glTextures[this.CONTEXT_UID]&&(this.unbind(e),i.deleteTexture(e._glTextures[this.CONTEXT_UID].texture),e.off("dispose",this.destroyTexture,this),delete e._glTextures[this.CONTEXT_UID],!t)){var n=this.managedTextures.indexOf(e);n!==-1&&zi(this.managedTextures,n,1)}},r.prototype.updateTextureStyle=function(e){var t=e._glTextures[this.CONTEXT_UID];t&&((e.mipmap===pe.POW2||this.webGLVersion!==2)&&!e.isPowerOfTwo?t.mipmap=!1:t.mipmap=e.mipmap>=1,this.webGLVersion!==2&&!e.isPowerOfTwo?t.wrapMode=Re.CLAMP:t.wrapMode=e.wrapMode,e.resource&&e.resource.style(this.renderer,e,t)||this.setStyle(e,t),t.dirtyStyleId=e.dirtyStyleId)},r.prototype.setStyle=function(e,t){var i=this.gl;if(t.mipmap&&e.mipmap!==pe.ON_MANUAL&&i.generateMipmap(e.target),i.texParameteri(e.target,i.TEXTURE_WRAP_S,t.wrapMode),i.texParameteri(e.target,i.TEXTURE_WRAP_T,t.wrapMode),t.mipmap){i.texParameteri(e.target,i.TEXTURE_MIN_FILTER,e.scaleMode===Pe.LINEAR?i.LINEAR_MIPMAP_LINEAR:i.NEAREST_MIPMAP_NEAREST);var n=this.renderer.context.extensions.anisotropicFiltering;if(n&&e.anisotropicLevel>0&&e.scaleMode===Pe.LINEAR){var s=Math.min(e.anisotropicLevel,i.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT));i.texParameterf(e.target,n.TEXTURE_MAX_ANISOTROPY_EXT,s)}}else i.texParameteri(e.target,i.TEXTURE_MIN_FILTER,e.scaleMode===Pe.LINEAR?i.LINEAR:i.NEAREST);i.texParameteri(e.target,i.TEXTURE_MAG_FILTER,e.scaleMode===Pe.LINEAR?i.LINEAR:i.NEAREST)},r.prototype.destroy=function(){this.renderer=null},r}(),Zs=new Ct,em=function(r){ht(e,r);function e(t,i){t===void 0&&(t=dr.UNKNOWN);var n=r.call(this)||this;return i=Object.assign({},L.RENDER_OPTIONS,i),n.options=i,n.type=t,n.screen=new Z(0,0,i.width,i.height),n.view=i.view||L.ADAPTER.createCanvas(),n.resolution=i.resolution||L.RESOLUTION,n.useContextAlpha=i.useContextAlpha,n.autoDensity=!!i.autoDensity,n.preserveDrawingBuffer=i.preserveDrawingBuffer,n.clearBeforeRender=i.clearBeforeRender,n._backgroundColor=0,n._backgroundColorRgba=[0,0,0,1],n._backgroundColorString="#000000",n.backgroundColor=i.backgroundColor||n._backgroundColor,n.backgroundAlpha=i.backgroundAlpha,i.transparent!==void 0&&(ge("6.0.0","Option transparent is deprecated, please use backgroundAlpha instead."),n.useContextAlpha=i.transparent,n.backgroundAlpha=i.transparent?0:1),n._lastObjectRendered=null,n.plugins={},n}return e.prototype.initPlugins=function(t){for(var i in t)this.plugins[i]=new t[i](this)},Object.defineProperty(e.prototype,"width",{get:function(){return this.view.width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.view.height},enumerable:!1,configurable:!0}),e.prototype.resize=function(t,i){this.view.width=Math.round(t*this.resolution),this.view.height=Math.round(i*this.resolution);var n=this.view.width/this.resolution,s=this.view.height/this.resolution;this.screen.width=n,this.screen.height=s,this.autoDensity&&(this.view.style.width=n+"px",this.view.style.height=s+"px"),this.emit("resize",n,s)},e.prototype.generateTexture=function(t,i,n,s){i===void 0&&(i={}),typeof i=="number"&&(ge("6.1.0","generateTexture options (scaleMode, resolution, region) are now object options."),i={scaleMode:i,resolution:n,region:s});var a=i.region,o=Bv(i,["region"]);s=a||t.getLocalBounds(null,!0),s.width===0&&(s.width=1),s.height===0&&(s.height=1);var h=bi.create(Ns({width:s.width,height:s.height},o));return Zs.tx=-s.x,Zs.ty=-s.y,this.render(t,{renderTexture:h,clear:!1,transform:Zs,skipUpdateTransform:!!t.parent}),h},e.prototype.destroy=function(t){for(var i in this.plugins)this.plugins[i].destroy(),this.plugins[i]=null;t&&this.view.parentNode&&this.view.parentNode.removeChild(this.view);var n=this;n.plugins=null,n.type=dr.UNKNOWN,n.view=null,n.screen=null,n._tempDisplayObjectParent=null,n.options=null,this._backgroundColorRgba=null,this._backgroundColorString=null,this._lastObjectRendered=null},Object.defineProperty(e.prototype,"backgroundColor",{get:function(){return this._backgroundColor},set:function(t){this._backgroundColor=t,this._backgroundColorString=ah(t),Wi(t,this._backgroundColorRgba)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"backgroundAlpha",{get:function(){return this._backgroundColorRgba[3]},set:function(t){this._backgroundColorRgba[3]=t},enumerable:!1,configurable:!0}),e}(pr),im=function(){function r(e){this.buffer=e||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}return r}(),rm=function(){function r(e){this.renderer=e,this.managedBuffers={},this.boundBufferBases={}}return r.prototype.destroy=function(){this.renderer=null},r.prototype.contextChange=function(){this.disposeAll(!0),this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID},r.prototype.bind=function(e){var t=this,i=t.gl,n=t.CONTEXT_UID,s=e._glBuffers[n]||this.createGLBuffer(e);i.bindBuffer(e.type,s.buffer)},r.prototype.bindBufferBase=function(e,t){var i=this,n=i.gl,s=i.CONTEXT_UID;if(this.boundBufferBases[t]!==e){var a=e._glBuffers[s]||this.createGLBuffer(e);this.boundBufferBases[t]=e,n.bindBufferBase(n.UNIFORM_BUFFER,t,a.buffer)}},r.prototype.bindBufferRange=function(e,t,i){var n=this,s=n.gl,a=n.CONTEXT_UID;i=i||0;var o=e._glBuffers[a]||this.createGLBuffer(e);s.bindBufferRange(s.UNIFORM_BUFFER,t||0,o.buffer,i*256,256)},r.prototype.update=function(e){var t=this,i=t.gl,n=t.CONTEXT_UID,s=e._glBuffers[n];if(e._updateID!==s.updateID)if(s.updateID=e._updateID,i.bindBuffer(e.type,s.buffer),s.byteLength>=e.data.byteLength)i.bufferSubData(e.type,0,e.data);else{var a=e.static?i.STATIC_DRAW:i.DYNAMIC_DRAW;s.byteLength=e.data.byteLength,i.bufferData(e.type,e.data,a)}},r.prototype.dispose=function(e,t){if(this.managedBuffers[e.id]){delete this.managedBuffers[e.id];var i=e._glBuffers[this.CONTEXT_UID],n=this.gl;e.disposeRunner.remove(this),i&&(t||n.deleteBuffer(i.buffer),delete e._glBuffers[this.CONTEXT_UID])}},r.prototype.disposeAll=function(e){for(var t=Object.keys(this.managedBuffers),i=0;i<t.length;i++)this.dispose(this.managedBuffers[t[i]],e)},r.prototype.createGLBuffer=function(e){var t=this,i=t.CONTEXT_UID,n=t.gl;return e._glBuffers[i]=new im(n.createBuffer()),this.managedBuffers[e.id]=e,e.disposeRunner.add(this),e._glBuffers[i]},r}(),Hh=function(r){ht(e,r);function e(t){var i=r.call(this,dr.WEBGL,t)||this;return t=i.options,i.gl=null,i.CONTEXT_UID=0,i.runners={destroy:new Bt("destroy"),contextChange:new Bt("contextChange"),reset:new Bt("reset"),update:new Bt("update"),postrender:new Bt("postrender"),prerender:new Bt("prerender"),resize:new Bt("resize")},i.runners.contextChange.add(i),i.globalUniforms=new Ti({projectionMatrix:new Ct},!0),i.addSystem(C_,"mask").addSystem(r_,"context").addSystem($_,"state").addSystem(W_,"shader").addSystem(tm,"texture").addSystem(rm,"buffer").addSystem(o_,"geometry").addSystem(a_,"framebuffer").addSystem(O_,"scissor").addSystem(A_,"stencil").addSystem(I_,"projection").addSystem(J_,"textureGC").addSystem(e_,"filter").addSystem(M_,"renderTexture").addSystem(i_,"batch"),i.initPlugins(e.__plugins),i.multisample=void 0,t.context?i.context.initFromContext(t.context):i.context.initFromOptions({alpha:!!i.useContextAlpha,antialias:t.antialias,premultipliedAlpha:i.useContextAlpha&&i.useContextAlpha!=="notMultiplied",stencil:!0,preserveDrawingBuffer:t.preserveDrawingBuffer,powerPreference:i.options.powerPreference}),i.renderingToScreen=!0,kc(i.context.webGLVersion===2?"WebGL 2":"WebGL 1"),i.resize(i.options.width,i.options.height),i}return e.create=function(t){if(Xc())return new e(t);throw new Error('WebGL unsupported in this browser, use "pixi.js-legacy" for fallback canvas2d support.')},e.prototype.contextChange=function(){var t=this.gl,i;if(this.context.webGLVersion===1){var n=t.getParameter(t.FRAMEBUFFER_BINDING);t.bindFramebuffer(t.FRAMEBUFFER,null),i=t.getParameter(t.SAMPLES),t.bindFramebuffer(t.FRAMEBUFFER,n)}else{var n=t.getParameter(t.DRAW_FRAMEBUFFER_BINDING);t.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),i=t.getParameter(t.SAMPLES),t.bindFramebuffer(t.DRAW_FRAMEBUFFER,n)}i>=gt.HIGH?this.multisample=gt.HIGH:i>=gt.MEDIUM?this.multisample=gt.MEDIUM:i>=gt.LOW?this.multisample=gt.LOW:this.multisample=gt.NONE},e.prototype.addSystem=function(t,i){var n=new t(this);if(this[i])throw new Error('Whoops! The name "'+i+'" is already in use');this[i]=n;for(var s in this.runners)this.runners[s].add(n);return this},e.prototype.render=function(t,i){var n,s,a,o;if(i&&(i instanceof bi?(ge("6.0.0","Renderer#render arguments changed, use options instead."),n=i,s=arguments[2],a=arguments[3],o=arguments[4]):(n=i.renderTexture,s=i.clear,a=i.transform,o=i.skipUpdateTransform)),this.renderingToScreen=!n,this.runners.prerender.emit(),this.emit("prerender"),this.projection.transform=a,!this.context.isLost){if(n||(this._lastObjectRendered=t),!o){var h=t.enableTempParent();t.updateTransform(),t.disableTempParent(h)}this.renderTexture.bind(n),this.batch.currentRenderer.start(),(s!==void 0?s:this.clearBeforeRender)&&this.renderTexture.clear(),t.render(this),this.batch.currentRenderer.flush(),n&&n.baseTexture.update(),this.runners.postrender.emit(),this.projection.transform=null,this.emit("postrender")}},e.prototype.generateTexture=function(t,i,n,s){i===void 0&&(i={});var a=r.prototype.generateTexture.call(this,t,i,n,s);return this.framebuffer.blit(),a},e.prototype.resize=function(t,i){r.prototype.resize.call(this,t,i),this.runners.resize.emit(this.screen.height,this.screen.width)},e.prototype.reset=function(){return this.runners.reset.emit(),this},e.prototype.clear=function(){this.renderTexture.bind(),this.renderTexture.clear()},e.prototype.destroy=function(t){this.runners.destroy.emit();for(var i in this.runners)this.runners[i].destroy();r.prototype.destroy.call(this,t),this.gl=null},Object.defineProperty(e.prototype,"extract",{get:function(){return ge("6.0.0","Renderer#extract has been deprecated, please use Renderer#plugins.extract instead."),this.plugins.extract},enumerable:!1,configurable:!0}),e.registerPlugin=function(t,i){ge("6.5.0","Renderer.registerPlugin() has been deprecated, please use extensions.add() instead."),Ue.add({name:t,type:nt.RendererPlugin,ref:i})},e.__plugins={},e}(em);Ue.handleByMap(nt.RendererPlugin,Hh.__plugins);function nm(r){return Hh.create(r)}var sm=`attribute vec2 aVertexPosition;
419
+ `))}}var G_=function(){function r(e,t){this.program=e,this.uniformData=t,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBufferBindings={}}return r.prototype.destroy=function(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBufferBindings=null,this.program=null},r}();function k_(r,e){for(var t={},i=e.getProgramParameter(r,e.ACTIVE_ATTRIBUTES),n=0;n<i;n++){var s=e.getActiveAttrib(r,n);if(s.name.indexOf("gl_")!==0){var a=Bh(e,s.type),o={type:a,name:s.name,size:Nh(a),location:e.getAttribLocation(r,s.name)};t[s.name]=o}}return t}function X_(r,e){for(var t={},i=e.getProgramParameter(r,e.ACTIVE_UNIFORMS),n=0;n<i;n++){var s=e.getActiveUniform(r,n),a=s.name.replace(/\[.*?\]$/,""),o=!!s.name.match(/\[.*?\]$/),h=Bh(e,s.type);t[a]={name:a,index:n,type:h,size:s.size,isArray:o,value:Mh(h,s.size)}}return t}function H_(r,e){var t=Ah(r,r.VERTEX_SHADER,e.vertexSrc),i=Ah(r,r.FRAGMENT_SHADER,e.fragmentSrc),n=r.createProgram();if(r.attachShader(n,t),r.attachShader(n,i),r.linkProgram(n),r.getProgramParameter(n,r.LINK_STATUS)||l_(r,n,t,i),e.attributeData=k_(n,r),e.uniformData=X_(n,r),!/^[ \t]*#[ \t]*version[ \t]+300[ \t]+es[ \t]*$/m.test(e.vertexSrc)){var s=Object.keys(e.attributeData);s.sort(function(l,f){return l>f?1:-1});for(var a=0;a<s.length;a++)e.attributeData[s[a]].location=a,r.bindAttribLocation(n,a,s[a]);r.linkProgram(n)}r.deleteShader(t),r.deleteShader(i);var o={};for(var a in e.uniformData){var h=e.uniformData[a];o[a]={location:r.getUniformLocation(n,a),value:Mh(h.type,h.size)}}var u=new G_(n,o);return u}var W_=0,bn={textureCount:0,uboCount:0},V_=function(){function r(e){this.destroyed=!1,this.renderer=e,this.systemCheck(),this.gl=null,this.shader=null,this.program=null,this.cache={},this._uboCache={},this.id=W_++}return r.prototype.systemCheck=function(){if(!x_())throw new Error("Current environment does not allow unsafe-eval, please use @pixi/unsafe-eval module to enable support.")},r.prototype.contextChange=function(e){this.gl=e,this.reset()},r.prototype.bind=function(e,t){e.disposeRunner.add(this),e.uniforms.globals=this.renderer.globalUniforms;var i=e.program,n=i.glPrograms[this.renderer.CONTEXT_UID]||this.generateProgram(e);return this.shader=e,this.program!==i&&(this.program=i,this.gl.useProgram(n.program)),t||(bn.textureCount=0,bn.uboCount=0,this.syncUniformGroup(e.uniformGroup,bn)),n},r.prototype.setUniforms=function(e){var t=this.shader.program,i=t.glPrograms[this.renderer.CONTEXT_UID];t.syncUniforms(i.uniformData,e,this.renderer)},r.prototype.syncUniformGroup=function(e,t){var i=this.getGlProgram();(!e.static||e.dirtyId!==i.uniformDirtyGroups[e.id])&&(i.uniformDirtyGroups[e.id]=e.dirtyId,this.syncUniforms(e,i,t))},r.prototype.syncUniforms=function(e,t,i){var n=e.syncUniforms[this.shader.program.id]||this.createSyncGroups(e);n(t.uniformData,e.uniforms,this.renderer,i)},r.prototype.createSyncGroups=function(e){var t=this.getSignature(e,this.shader.program.uniformData,"u");return this.cache[t]||(this.cache[t]=__(e,this.shader.program.uniformData)),e.syncUniforms[this.shader.program.id]=this.cache[t],e.syncUniforms[this.shader.program.id]},r.prototype.syncUniformBufferGroup=function(e,t){var i=this.getGlProgram();if(!e.static||e.dirtyId!==0||!i.uniformGroups[e.id]){e.dirtyId=0;var n=i.uniformGroups[e.id]||this.createSyncBufferGroup(e,i,t);e.buffer.update(),n(i.uniformData,e.uniforms,this.renderer,bn,e.buffer)}this.renderer.buffer.bindBufferBase(e.buffer,i.uniformBufferBindings[t])},r.prototype.createSyncBufferGroup=function(e,t,i){var n=this.renderer.gl;this.renderer.buffer.bind(e.buffer);var s=this.gl.getUniformBlockIndex(t.program,i);t.uniformBufferBindings[i]=this.shader.uniformBindCount,n.uniformBlockBinding(t.program,s,this.shader.uniformBindCount),this.shader.uniformBindCount++;var a=this.getSignature(e,this.shader.program.uniformData,"ubo"),o=this._uboCache[a];if(o||(o=this._uboCache[a]=U_(e,this.shader.program.uniformData)),e.autoManage){var h=new Float32Array(o.size/4);e.buffer.update(h)}return t.uniformGroups[e.id]=o.syncFunc,t.uniformGroups[e.id]},r.prototype.getSignature=function(e,t,i){var n=e.uniforms,s=[i+"-"];for(var a in n)s.push(a),t[a]&&s.push(t[a].type);return s.join("-")},r.prototype.getGlProgram=function(){return this.shader?this.shader.program.glPrograms[this.renderer.CONTEXT_UID]:null},r.prototype.generateProgram=function(e){var t=this.gl,i=e.program,n=H_(t,i);return i.glPrograms[this.renderer.CONTEXT_UID]=n,n},r.prototype.reset=function(){this.program=null,this.shader=null},r.prototype.disposeShader=function(e){this.shader===e&&(this.shader=null)},r.prototype.destroy=function(){this.renderer=null,this.destroyed=!0},r}();function z_(r,e){return e===void 0&&(e=[]),e[X.NORMAL]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[X.ADD]=[r.ONE,r.ONE],e[X.MULTIPLY]=[r.DST_COLOR,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA],e[X.SCREEN]=[r.ONE,r.ONE_MINUS_SRC_COLOR,r.ONE,r.ONE_MINUS_SRC_ALPHA],e[X.OVERLAY]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[X.DARKEN]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[X.LIGHTEN]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[X.COLOR_DODGE]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[X.COLOR_BURN]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[X.HARD_LIGHT]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[X.SOFT_LIGHT]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[X.DIFFERENCE]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[X.EXCLUSION]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[X.HUE]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[X.SATURATION]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[X.COLOR]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[X.LUMINOSITY]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[X.NONE]=[0,0],e[X.NORMAL_NPM]=[r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA],e[X.ADD_NPM]=[r.SRC_ALPHA,r.ONE,r.ONE,r.ONE],e[X.SCREEN_NPM]=[r.SRC_ALPHA,r.ONE_MINUS_SRC_COLOR,r.ONE,r.ONE_MINUS_SRC_ALPHA],e[X.SRC_IN]=[r.DST_ALPHA,r.ZERO],e[X.SRC_OUT]=[r.ONE_MINUS_DST_ALPHA,r.ZERO],e[X.SRC_ATOP]=[r.DST_ALPHA,r.ONE_MINUS_SRC_ALPHA],e[X.DST_OVER]=[r.ONE_MINUS_DST_ALPHA,r.ONE],e[X.DST_IN]=[r.ZERO,r.SRC_ALPHA],e[X.DST_OUT]=[r.ZERO,r.ONE_MINUS_SRC_ALPHA],e[X.DST_ATOP]=[r.ONE_MINUS_DST_ALPHA,r.SRC_ALPHA],e[X.XOR]=[r.ONE_MINUS_DST_ALPHA,r.ONE_MINUS_SRC_ALPHA],e[X.SUBTRACT]=[r.ONE,r.ONE,r.ONE,r.ONE,r.FUNC_REVERSE_SUBTRACT,r.FUNC_ADD],e}var Y_=0,j_=1,Z_=2,q_=3,K_=4,$_=5,J_=function(){function r(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode=X.NONE,this._blendEq=!1,this.map=[],this.map[Y_]=this.setBlend,this.map[j_]=this.setOffset,this.map[Z_]=this.setCullFace,this.map[q_]=this.setDepthTest,this.map[K_]=this.setFrontFace,this.map[$_]=this.setDepthMask,this.checks=[],this.defaultState=new wi,this.defaultState.blend=!0}return r.prototype.contextChange=function(e){this.gl=e,this.blendModes=z_(e),this.set(this.defaultState),this.reset()},r.prototype.set=function(e){if(e=e||this.defaultState,this.stateId!==e.data){for(var t=this.stateId^e.data,i=0;t;)t&1&&this.map[i].call(this,!!(e.data&1<<i)),t=t>>1,i++;this.stateId=e.data}for(var i=0;i<this.checks.length;i++)this.checks[i](this,e)},r.prototype.forceState=function(e){e=e||this.defaultState;for(var t=0;t<this.map.length;t++)this.map[t].call(this,!!(e.data&1<<t));for(var t=0;t<this.checks.length;t++)this.checks[t](this,e);this.stateId=e.data},r.prototype.setBlend=function(e){this.updateCheck(r.checkBlendMode,e),this.gl[e?"enable":"disable"](this.gl.BLEND)},r.prototype.setOffset=function(e){this.updateCheck(r.checkPolygonOffset,e),this.gl[e?"enable":"disable"](this.gl.POLYGON_OFFSET_FILL)},r.prototype.setDepthTest=function(e){this.gl[e?"enable":"disable"](this.gl.DEPTH_TEST)},r.prototype.setDepthMask=function(e){this.gl.depthMask(e)},r.prototype.setCullFace=function(e){this.gl[e?"enable":"disable"](this.gl.CULL_FACE)},r.prototype.setFrontFace=function(e){this.gl.frontFace(this.gl[e?"CW":"CCW"])},r.prototype.setBlendMode=function(e){if(e!==this.blendMode){this.blendMode=e;var t=this.blendModes[e],i=this.gl;t.length===2?i.blendFunc(t[0],t[1]):i.blendFuncSeparate(t[0],t[1],t[2],t[3]),t.length===6?(this._blendEq=!0,i.blendEquationSeparate(t[4],t[5])):this._blendEq&&(this._blendEq=!1,i.blendEquationSeparate(i.FUNC_ADD,i.FUNC_ADD))}},r.prototype.setPolygonOffset=function(e,t){this.gl.polygonOffset(e,t)},r.prototype.reset=function(){this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,!1),this.forceState(this.defaultState),this._blendEq=!0,this.blendMode=-1,this.setBlendMode(0)},r.prototype.updateCheck=function(e,t){var i=this.checks.indexOf(e);t&&i===-1?this.checks.push(e):!t&&i!==-1&&this.checks.splice(i,1)},r.checkBlendMode=function(e,t){e.setBlendMode(t.blendMode)},r.checkPolygonOffset=function(e,t){e.setPolygonOffset(1,t.polygonOffset)},r.prototype.destroy=function(){this.gl=null},r}(),Q_=function(){function r(e){this.renderer=e,this.count=0,this.checkCount=0,this.maxIdle=L.GC_MAX_IDLE,this.checkCountMax=L.GC_MAX_CHECK_COUNT,this.mode=L.GC_MODE}return r.prototype.postrender=function(){this.renderer.renderingToScreen&&(this.count++,this.mode!==rn.MANUAL&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))},r.prototype.run=function(){for(var e=this.renderer.texture,t=e.managedTextures,i=!1,n=0;n<t.length;n++){var s=t[n];!s.framebuffer&&this.count-s.touched>this.maxIdle&&(e.destroyTexture(s,!0),t[n]=null,i=!0)}if(i){for(var a=0,n=0;n<t.length;n++)t[n]!==null&&(t[a++]=t[n]);t.length=a}},r.prototype.unload=function(e){var t=this.renderer.texture,i=e._texture;i&&!i.framebuffer&&t.destroyTexture(i);for(var n=e.children.length-1;n>=0;n--)this.unload(e.children[n])},r.prototype.destroy=function(){this.renderer=null},r}();function tm(r){var e,t,i,n,s,a,o,h,u,l,f,c,d,v,p,_,m,g,y,b,x,T,w;return"WebGL2RenderingContext"in globalThis&&r instanceof globalThis.WebGL2RenderingContext?w=(e={},e[k.UNSIGNED_BYTE]=(t={},t[D.RGBA]=r.RGBA8,t[D.RGB]=r.RGB8,t[D.RG]=r.RG8,t[D.RED]=r.R8,t[D.RGBA_INTEGER]=r.RGBA8UI,t[D.RGB_INTEGER]=r.RGB8UI,t[D.RG_INTEGER]=r.RG8UI,t[D.RED_INTEGER]=r.R8UI,t[D.ALPHA]=r.ALPHA,t[D.LUMINANCE]=r.LUMINANCE,t[D.LUMINANCE_ALPHA]=r.LUMINANCE_ALPHA,t),e[k.BYTE]=(i={},i[D.RGBA]=r.RGBA8_SNORM,i[D.RGB]=r.RGB8_SNORM,i[D.RG]=r.RG8_SNORM,i[D.RED]=r.R8_SNORM,i[D.RGBA_INTEGER]=r.RGBA8I,i[D.RGB_INTEGER]=r.RGB8I,i[D.RG_INTEGER]=r.RG8I,i[D.RED_INTEGER]=r.R8I,i),e[k.UNSIGNED_SHORT]=(n={},n[D.RGBA_INTEGER]=r.RGBA16UI,n[D.RGB_INTEGER]=r.RGB16UI,n[D.RG_INTEGER]=r.RG16UI,n[D.RED_INTEGER]=r.R16UI,n[D.DEPTH_COMPONENT]=r.DEPTH_COMPONENT16,n),e[k.SHORT]=(s={},s[D.RGBA_INTEGER]=r.RGBA16I,s[D.RGB_INTEGER]=r.RGB16I,s[D.RG_INTEGER]=r.RG16I,s[D.RED_INTEGER]=r.R16I,s),e[k.UNSIGNED_INT]=(a={},a[D.RGBA_INTEGER]=r.RGBA32UI,a[D.RGB_INTEGER]=r.RGB32UI,a[D.RG_INTEGER]=r.RG32UI,a[D.RED_INTEGER]=r.R32UI,a[D.DEPTH_COMPONENT]=r.DEPTH_COMPONENT24,a),e[k.INT]=(o={},o[D.RGBA_INTEGER]=r.RGBA32I,o[D.RGB_INTEGER]=r.RGB32I,o[D.RG_INTEGER]=r.RG32I,o[D.RED_INTEGER]=r.R32I,o),e[k.FLOAT]=(h={},h[D.RGBA]=r.RGBA32F,h[D.RGB]=r.RGB32F,h[D.RG]=r.RG32F,h[D.RED]=r.R32F,h[D.DEPTH_COMPONENT]=r.DEPTH_COMPONENT32F,h),e[k.HALF_FLOAT]=(u={},u[D.RGBA]=r.RGBA16F,u[D.RGB]=r.RGB16F,u[D.RG]=r.RG16F,u[D.RED]=r.R16F,u),e[k.UNSIGNED_SHORT_5_6_5]=(l={},l[D.RGB]=r.RGB565,l),e[k.UNSIGNED_SHORT_4_4_4_4]=(f={},f[D.RGBA]=r.RGBA4,f),e[k.UNSIGNED_SHORT_5_5_5_1]=(c={},c[D.RGBA]=r.RGB5_A1,c),e[k.UNSIGNED_INT_2_10_10_10_REV]=(d={},d[D.RGBA]=r.RGB10_A2,d[D.RGBA_INTEGER]=r.RGB10_A2UI,d),e[k.UNSIGNED_INT_10F_11F_11F_REV]=(v={},v[D.RGB]=r.R11F_G11F_B10F,v),e[k.UNSIGNED_INT_5_9_9_9_REV]=(p={},p[D.RGB]=r.RGB9_E5,p),e[k.UNSIGNED_INT_24_8]=(_={},_[D.DEPTH_STENCIL]=r.DEPTH24_STENCIL8,_),e[k.FLOAT_32_UNSIGNED_INT_24_8_REV]=(m={},m[D.DEPTH_STENCIL]=r.DEPTH32F_STENCIL8,m),e):w=(g={},g[k.UNSIGNED_BYTE]=(y={},y[D.RGBA]=r.RGBA,y[D.RGB]=r.RGB,y[D.ALPHA]=r.ALPHA,y[D.LUMINANCE]=r.LUMINANCE,y[D.LUMINANCE_ALPHA]=r.LUMINANCE_ALPHA,y),g[k.UNSIGNED_SHORT_5_6_5]=(b={},b[D.RGB]=r.RGB,b),g[k.UNSIGNED_SHORT_4_4_4_4]=(x={},x[D.RGBA]=r.RGBA,x),g[k.UNSIGNED_SHORT_5_5_5_1]=(T={},T[D.RGBA]=r.RGBA,T),g),w}var js=function(){function r(e){this.texture=e,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=k.UNSIGNED_BYTE,this.internalFormat=D.RGBA,this.samplerType=0}return r}(),em=function(){function r(e){this.renderer=e,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new tt,this.hasIntegerTextures=!1}return r.prototype.contextChange=function(){var e=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=tm(e);var t=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=t;for(var i=0;i<t;i++)this.boundTextures[i]=null;this.emptyTextures={};var n=new js(e.createTexture());e.bindTexture(e.TEXTURE_2D,n.texture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,new Uint8Array(4)),this.emptyTextures[e.TEXTURE_2D]=n,this.emptyTextures[e.TEXTURE_CUBE_MAP]=new js(e.createTexture()),e.bindTexture(e.TEXTURE_CUBE_MAP,this.emptyTextures[e.TEXTURE_CUBE_MAP].texture);for(var i=0;i<6;i++)e.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+i,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,null);e.texParameteri(e.TEXTURE_CUBE_MAP,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_CUBE_MAP,e.TEXTURE_MIN_FILTER,e.LINEAR);for(var i=0;i<this.boundTextures.length;i++)this.bind(null,i)},r.prototype.bind=function(e,t){t===void 0&&(t=0);var i=this.gl;if(e=e==null?void 0:e.castToBaseTexture(),e&&e.valid&&!e.parentTextureArray){e.touched=this.renderer.textureGC.count;var n=e._glTextures[this.CONTEXT_UID]||this.initTexture(e);this.boundTextures[t]!==e&&(this.currentLocation!==t&&(this.currentLocation=t,i.activeTexture(i.TEXTURE0+t)),i.bindTexture(e.target,n.texture)),n.dirtyId!==e.dirtyId?(this.currentLocation!==t&&(this.currentLocation=t,i.activeTexture(i.TEXTURE0+t)),this.updateTexture(e)):n.dirtyStyleId!==e.dirtyStyleId&&this.updateTextureStyle(e),this.boundTextures[t]=e}else this.currentLocation!==t&&(this.currentLocation=t,i.activeTexture(i.TEXTURE0+t)),i.bindTexture(i.TEXTURE_2D,this.emptyTextures[i.TEXTURE_2D].texture),this.boundTextures[t]=null},r.prototype.reset=function(){this._unknownBoundTextures=!0,this.hasIntegerTextures=!1,this.currentLocation=-1;for(var e=0;e<this.boundTextures.length;e++)this.boundTextures[e]=this.unknownTexture},r.prototype.unbind=function(e){var t=this,i=t.gl,n=t.boundTextures;if(this._unknownBoundTextures){this._unknownBoundTextures=!1;for(var s=0;s<n.length;s++)n[s]===this.unknownTexture&&this.bind(null,s)}for(var s=0;s<n.length;s++)n[s]===e&&(this.currentLocation!==s&&(i.activeTexture(i.TEXTURE0+s),this.currentLocation=s),i.bindTexture(e.target,this.emptyTextures[e.target].texture),n[s]=null)},r.prototype.ensureSamplerType=function(e){var t=this,i=t.boundTextures,n=t.hasIntegerTextures,s=t.CONTEXT_UID;if(n)for(var a=e-1;a>=0;--a){var o=i[a];if(o){var h=o._glTextures[s];h.samplerType!==en.FLOAT&&this.renderer.texture.unbind(o)}}},r.prototype.initTexture=function(e){var t=new js(this.gl.createTexture());return t.dirtyId=-1,e._glTextures[this.CONTEXT_UID]=t,this.managedTextures.push(e),e.on("dispose",this.destroyTexture,this),t},r.prototype.initTextureType=function(e,t){var i,n;t.internalFormat=(n=(i=this.internalFormats[e.type])===null||i===void 0?void 0:i[e.format])!==null&&n!==void 0?n:e.format,this.webGLVersion===2&&e.type===k.HALF_FLOAT?t.type=this.gl.HALF_FLOAT:t.type=e.type},r.prototype.updateTexture=function(e){var t=e._glTextures[this.CONTEXT_UID];if(t){var i=this.renderer;if(this.initTextureType(e,t),e.resource&&e.resource.upload(i,e,t))t.samplerType!==en.FLOAT&&(this.hasIntegerTextures=!0);else{var n=e.realWidth,s=e.realHeight,a=i.gl;(t.width!==n||t.height!==s||t.dirtyId<0)&&(t.width=n,t.height=s,a.texImage2D(e.target,0,t.internalFormat,n,s,0,e.format,t.type,null))}e.dirtyStyleId!==t.dirtyStyleId&&this.updateTextureStyle(e),t.dirtyId=e.dirtyId}},r.prototype.destroyTexture=function(e,t){var i=this.gl;if(e=e.castToBaseTexture(),e._glTextures[this.CONTEXT_UID]&&(this.unbind(e),i.deleteTexture(e._glTextures[this.CONTEXT_UID].texture),e.off("dispose",this.destroyTexture,this),delete e._glTextures[this.CONTEXT_UID],!t)){var n=this.managedTextures.indexOf(e);n!==-1&&Vi(this.managedTextures,n,1)}},r.prototype.updateTextureStyle=function(e){var t=e._glTextures[this.CONTEXT_UID];t&&((e.mipmap===pe.POW2||this.webGLVersion!==2)&&!e.isPowerOfTwo?t.mipmap=!1:t.mipmap=e.mipmap>=1,this.webGLVersion!==2&&!e.isPowerOfTwo?t.wrapMode=Re.CLAMP:t.wrapMode=e.wrapMode,e.resource&&e.resource.style(this.renderer,e,t)||this.setStyle(e,t),t.dirtyStyleId=e.dirtyStyleId)},r.prototype.setStyle=function(e,t){var i=this.gl;if(t.mipmap&&e.mipmap!==pe.ON_MANUAL&&i.generateMipmap(e.target),i.texParameteri(e.target,i.TEXTURE_WRAP_S,t.wrapMode),i.texParameteri(e.target,i.TEXTURE_WRAP_T,t.wrapMode),t.mipmap){i.texParameteri(e.target,i.TEXTURE_MIN_FILTER,e.scaleMode===Pe.LINEAR?i.LINEAR_MIPMAP_LINEAR:i.NEAREST_MIPMAP_NEAREST);var n=this.renderer.context.extensions.anisotropicFiltering;if(n&&e.anisotropicLevel>0&&e.scaleMode===Pe.LINEAR){var s=Math.min(e.anisotropicLevel,i.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT));i.texParameterf(e.target,n.TEXTURE_MAX_ANISOTROPY_EXT,s)}}else i.texParameteri(e.target,i.TEXTURE_MIN_FILTER,e.scaleMode===Pe.LINEAR?i.LINEAR:i.NEAREST);i.texParameteri(e.target,i.TEXTURE_MAG_FILTER,e.scaleMode===Pe.LINEAR?i.LINEAR:i.NEAREST)},r.prototype.destroy=function(){this.renderer=null},r}(),Zs=new Ct,im=function(r){ht(e,r);function e(t,i){t===void 0&&(t=dr.UNKNOWN);var n=r.call(this)||this;return i=Object.assign({},L.RENDER_OPTIONS,i),n.options=i,n.type=t,n.screen=new q(0,0,i.width,i.height),n.view=i.view||L.ADAPTER.createCanvas(),n.resolution=i.resolution||L.RESOLUTION,n.useContextAlpha=i.useContextAlpha,n.autoDensity=!!i.autoDensity,n.preserveDrawingBuffer=i.preserveDrawingBuffer,n.clearBeforeRender=i.clearBeforeRender,n._backgroundColor=0,n._backgroundColorRgba=[0,0,0,1],n._backgroundColorString="#000000",n.backgroundColor=i.backgroundColor||n._backgroundColor,n.backgroundAlpha=i.backgroundAlpha,i.transparent!==void 0&&(ge("6.0.0","Option transparent is deprecated, please use backgroundAlpha instead."),n.useContextAlpha=i.transparent,n.backgroundAlpha=i.transparent?0:1),n._lastObjectRendered=null,n.plugins={},n}return e.prototype.initPlugins=function(t){for(var i in t)this.plugins[i]=new t[i](this)},Object.defineProperty(e.prototype,"width",{get:function(){return this.view.width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.view.height},enumerable:!1,configurable:!0}),e.prototype.resize=function(t,i){this.view.width=Math.round(t*this.resolution),this.view.height=Math.round(i*this.resolution);var n=this.view.width/this.resolution,s=this.view.height/this.resolution;this.screen.width=n,this.screen.height=s,this.autoDensity&&(this.view.style.width=n+"px",this.view.style.height=s+"px"),this.emit("resize",n,s)},e.prototype.generateTexture=function(t,i,n,s){i===void 0&&(i={}),typeof i=="number"&&(ge("6.1.0","generateTexture options (scaleMode, resolution, region) are now object options."),i={scaleMode:i,resolution:n,region:s});var a=i.region,o=Uv(i,["region"]);s=a||t.getLocalBounds(null,!0),s.width===0&&(s.width=1),s.height===0&&(s.height=1);var h=bi.create(Ns({width:s.width,height:s.height},o));return Zs.tx=-s.x,Zs.ty=-s.y,this.render(t,{renderTexture:h,clear:!1,transform:Zs,skipUpdateTransform:!!t.parent}),h},e.prototype.destroy=function(t){for(var i in this.plugins)this.plugins[i].destroy(),this.plugins[i]=null;t&&this.view.parentNode&&this.view.parentNode.removeChild(this.view);var n=this;n.plugins=null,n.type=dr.UNKNOWN,n.view=null,n.screen=null,n._tempDisplayObjectParent=null,n.options=null,this._backgroundColorRgba=null,this._backgroundColorString=null,this._lastObjectRendered=null},Object.defineProperty(e.prototype,"backgroundColor",{get:function(){return this._backgroundColor},set:function(t){this._backgroundColor=t,this._backgroundColorString=oh(t),Wi(t,this._backgroundColorRgba)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"backgroundAlpha",{get:function(){return this._backgroundColorRgba[3]},set:function(t){this._backgroundColorRgba[3]=t},enumerable:!1,configurable:!0}),e}(pr),rm=function(){function r(e){this.buffer=e||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}return r}(),nm=function(){function r(e){this.renderer=e,this.managedBuffers={},this.boundBufferBases={}}return r.prototype.destroy=function(){this.renderer=null},r.prototype.contextChange=function(){this.disposeAll(!0),this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID},r.prototype.bind=function(e){var t=this,i=t.gl,n=t.CONTEXT_UID,s=e._glBuffers[n]||this.createGLBuffer(e);i.bindBuffer(e.type,s.buffer)},r.prototype.bindBufferBase=function(e,t){var i=this,n=i.gl,s=i.CONTEXT_UID;if(this.boundBufferBases[t]!==e){var a=e._glBuffers[s]||this.createGLBuffer(e);this.boundBufferBases[t]=e,n.bindBufferBase(n.UNIFORM_BUFFER,t,a.buffer)}},r.prototype.bindBufferRange=function(e,t,i){var n=this,s=n.gl,a=n.CONTEXT_UID;i=i||0;var o=e._glBuffers[a]||this.createGLBuffer(e);s.bindBufferRange(s.UNIFORM_BUFFER,t||0,o.buffer,i*256,256)},r.prototype.update=function(e){var t=this,i=t.gl,n=t.CONTEXT_UID,s=e._glBuffers[n];if(e._updateID!==s.updateID)if(s.updateID=e._updateID,i.bindBuffer(e.type,s.buffer),s.byteLength>=e.data.byteLength)i.bufferSubData(e.type,0,e.data);else{var a=e.static?i.STATIC_DRAW:i.DYNAMIC_DRAW;s.byteLength=e.data.byteLength,i.bufferData(e.type,e.data,a)}},r.prototype.dispose=function(e,t){if(this.managedBuffers[e.id]){delete this.managedBuffers[e.id];var i=e._glBuffers[this.CONTEXT_UID],n=this.gl;e.disposeRunner.remove(this),i&&(t||n.deleteBuffer(i.buffer),delete e._glBuffers[this.CONTEXT_UID])}},r.prototype.disposeAll=function(e){for(var t=Object.keys(this.managedBuffers),i=0;i<t.length;i++)this.dispose(this.managedBuffers[t[i]],e)},r.prototype.createGLBuffer=function(e){var t=this,i=t.CONTEXT_UID,n=t.gl;return e._glBuffers[i]=new rm(n.createBuffer()),this.managedBuffers[e.id]=e,e.disposeRunner.add(this),e._glBuffers[i]},r}(),Wh=function(r){ht(e,r);function e(t){var i=r.call(this,dr.WEBGL,t)||this;return t=i.options,i.gl=null,i.CONTEXT_UID=0,i.runners={destroy:new Bt("destroy"),contextChange:new Bt("contextChange"),reset:new Bt("reset"),update:new Bt("update"),postrender:new Bt("postrender"),prerender:new Bt("prerender"),resize:new Bt("resize")},i.runners.contextChange.add(i),i.globalUniforms=new Ti({projectionMatrix:new Ct},!0),i.addSystem(O_,"mask").addSystem(n_,"context").addSystem(J_,"state").addSystem(V_,"shader").addSystem(em,"texture").addSystem(nm,"buffer").addSystem(h_,"geometry").addSystem(o_,"framebuffer").addSystem(A_,"scissor").addSystem(I_,"stencil").addSystem(M_,"projection").addSystem(Q_,"textureGC").addSystem(i_,"filter").addSystem(D_,"renderTexture").addSystem(r_,"batch"),i.initPlugins(e.__plugins),i.multisample=void 0,t.context?i.context.initFromContext(t.context):i.context.initFromOptions({alpha:!!i.useContextAlpha,antialias:t.antialias,premultipliedAlpha:i.useContextAlpha&&i.useContextAlpha!=="notMultiplied",stencil:!0,preserveDrawingBuffer:t.preserveDrawingBuffer,powerPreference:i.options.powerPreference}),i.renderingToScreen=!0,Xc(i.context.webGLVersion===2?"WebGL 2":"WebGL 1"),i.resize(i.options.width,i.options.height),i}return e.create=function(t){if(Hc())return new e(t);throw new Error('WebGL unsupported in this browser, use "pixi.js-legacy" for fallback canvas2d support.')},e.prototype.contextChange=function(){var t=this.gl,i;if(this.context.webGLVersion===1){var n=t.getParameter(t.FRAMEBUFFER_BINDING);t.bindFramebuffer(t.FRAMEBUFFER,null),i=t.getParameter(t.SAMPLES),t.bindFramebuffer(t.FRAMEBUFFER,n)}else{var n=t.getParameter(t.DRAW_FRAMEBUFFER_BINDING);t.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),i=t.getParameter(t.SAMPLES),t.bindFramebuffer(t.DRAW_FRAMEBUFFER,n)}i>=gt.HIGH?this.multisample=gt.HIGH:i>=gt.MEDIUM?this.multisample=gt.MEDIUM:i>=gt.LOW?this.multisample=gt.LOW:this.multisample=gt.NONE},e.prototype.addSystem=function(t,i){var n=new t(this);if(this[i])throw new Error('Whoops! The name "'+i+'" is already in use');this[i]=n;for(var s in this.runners)this.runners[s].add(n);return this},e.prototype.render=function(t,i){var n,s,a,o;if(i&&(i instanceof bi?(ge("6.0.0","Renderer#render arguments changed, use options instead."),n=i,s=arguments[2],a=arguments[3],o=arguments[4]):(n=i.renderTexture,s=i.clear,a=i.transform,o=i.skipUpdateTransform)),this.renderingToScreen=!n,this.runners.prerender.emit(),this.emit("prerender"),this.projection.transform=a,!this.context.isLost){if(n||(this._lastObjectRendered=t),!o){var h=t.enableTempParent();t.updateTransform(),t.disableTempParent(h)}this.renderTexture.bind(n),this.batch.currentRenderer.start(),(s!==void 0?s:this.clearBeforeRender)&&this.renderTexture.clear(),t.render(this),this.batch.currentRenderer.flush(),n&&n.baseTexture.update(),this.runners.postrender.emit(),this.projection.transform=null,this.emit("postrender")}},e.prototype.generateTexture=function(t,i,n,s){i===void 0&&(i={});var a=r.prototype.generateTexture.call(this,t,i,n,s);return this.framebuffer.blit(),a},e.prototype.resize=function(t,i){r.prototype.resize.call(this,t,i),this.runners.resize.emit(this.screen.height,this.screen.width)},e.prototype.reset=function(){return this.runners.reset.emit(),this},e.prototype.clear=function(){this.renderTexture.bind(),this.renderTexture.clear()},e.prototype.destroy=function(t){this.runners.destroy.emit();for(var i in this.runners)this.runners[i].destroy();r.prototype.destroy.call(this,t),this.gl=null},Object.defineProperty(e.prototype,"extract",{get:function(){return ge("6.0.0","Renderer#extract has been deprecated, please use Renderer#plugins.extract instead."),this.plugins.extract},enumerable:!1,configurable:!0}),e.registerPlugin=function(t,i){ge("6.5.0","Renderer.registerPlugin() has been deprecated, please use extensions.add() instead."),Ge.add({name:t,type:nt.RendererPlugin,ref:i})},e.__plugins={},e}(im);Ge.handleByMap(nt.RendererPlugin,Wh.__plugins);function sm(r){return Wh.create(r)}var am=`attribute vec2 aVertexPosition;
420
420
  attribute vec2 aTextureCoord;
421
421
 
422
422
  uniform mat3 projectionMatrix;
@@ -427,7 +427,7 @@ void main(void)
427
427
  {
428
428
  gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);
429
429
  vTextureCoord = aTextureCoord;
430
- }`,am=`attribute vec2 aVertexPosition;
430
+ }`,om=`attribute vec2 aVertexPosition;
431
431
 
432
432
  uniform mat3 projectionMatrix;
433
433
 
@@ -453,7 +453,7 @@ void main(void)
453
453
  gl_Position = filterVertexPosition();
454
454
  vTextureCoord = filterTextureCoord();
455
455
  }
456
- `,om=sm,Wh=am,qs=function(){function r(){this.texArray=null,this.blend=0,this.type=de.TRIANGLES,this.start=0,this.size=0,this.data=null}return r}(),Ks=function(){function r(){this.elements=[],this.ids=[],this.count=0}return r.prototype.clear=function(){for(var e=0;e<this.count;e++)this.elements[e]=null;this.count=0},r}(),$s=function(){function r(e){typeof e=="number"?this.rawBinaryData=new ArrayBuffer(e):e instanceof Uint8Array?this.rawBinaryData=e.buffer:this.rawBinaryData=e,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData)}return Object.defineProperty(r.prototype,"int8View",{get:function(){return this._int8View||(this._int8View=new Int8Array(this.rawBinaryData)),this._int8View},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"uint8View",{get:function(){return this._uint8View||(this._uint8View=new Uint8Array(this.rawBinaryData)),this._uint8View},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"int16View",{get:function(){return this._int16View||(this._int16View=new Int16Array(this.rawBinaryData)),this._int16View},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"uint16View",{get:function(){return this._uint16View||(this._uint16View=new Uint16Array(this.rawBinaryData)),this._uint16View},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"int32View",{get:function(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View},enumerable:!1,configurable:!0}),r.prototype.view=function(e){return this[e+"View"]},r.prototype.destroy=function(){this.rawBinaryData=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._uint16View=null,this._int32View=null,this.uint32View=null,this.float32View=null},r.sizeOf=function(e){switch(e){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(e+" isn't a valid view type")}},r}(),hm=function(r){ht(e,r);function e(t){var i=r.call(this,t)||this;return i.shaderGenerator=null,i.geometryClass=null,i.vertexSize=null,i.state=wi.for2d(),i.size=L.SPRITE_BATCH_SIZE*4,i._vertexCount=0,i._indexCount=0,i._bufferedElements=[],i._bufferedTextures=[],i._bufferSize=0,i._shader=null,i._packedGeometries=[],i._packedGeometryPoolSize=2,i._flushId=0,i._aBuffers={},i._iBuffers={},i.MAX_TEXTURES=1,i.renderer.on("prerender",i.onPrerender,i),t.runners.contextChange.add(i),i._dcIndex=0,i._aIndex=0,i._iIndex=0,i._attributeBuffer=null,i._indexBuffer=null,i._tempBoundTextures=[],i}return e.prototype.contextChange=function(){var t=this.renderer.gl;L.PREFER_ENV===Le.WEBGL_LEGACY?this.MAX_TEXTURES=1:(this.MAX_TEXTURES=Math.min(t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),L.SPRITE_MAX_TEXTURES),this.MAX_TEXTURES=g_(this.MAX_TEXTURES,t)),this._shader=this.shaderGenerator.generateShader(this.MAX_TEXTURES);for(var i=0;i<this._packedGeometryPoolSize;i++)this._packedGeometries[i]=new this.geometryClass;this.initFlushBuffers()},e.prototype.initFlushBuffers=function(){for(var t=e._drawCallPool,i=e._textureArrayPool,n=this.size/4,s=Math.floor(n/this.MAX_TEXTURES)+1;t.length<n;)t.push(new qs);for(;i.length<s;)i.push(new Ks);for(var a=0;a<this.MAX_TEXTURES;a++)this._tempBoundTextures[a]=null},e.prototype.onPrerender=function(){this._flushId=0},e.prototype.render=function(t){t._texture.valid&&(this._vertexCount+t.vertexData.length/2>this.size&&this.flush(),this._vertexCount+=t.vertexData.length/2,this._indexCount+=t.indices.length,this._bufferedTextures[this._bufferSize]=t._texture.baseTexture,this._bufferedElements[this._bufferSize++]=t)},e.prototype.buildTexturesAndDrawCalls=function(){var t=this,i=t._bufferedTextures,n=t.MAX_TEXTURES,s=e._textureArrayPool,a=this.renderer.batch,o=this._tempBoundTextures,h=this.renderer.textureGC.count,u=++Q._globalBatch,l=0,f=s[0],c=0;a.copyBoundTextures(o,n);for(var d=0;d<this._bufferSize;++d){var v=i[d];i[d]=null,v._batchEnabled!==u&&(f.count>=n&&(a.boundArray(f,o,u,n),this.buildDrawCalls(f,c,d),c=d,f=s[++l],++u),v._batchEnabled=u,v.touched=h,f.elements[f.count++]=v)}f.count>0&&(a.boundArray(f,o,u,n),this.buildDrawCalls(f,c,this._bufferSize),++l,++u);for(var d=0;d<o.length;d++)o[d]=null;Q._globalBatch=u},e.prototype.buildDrawCalls=function(t,i,n){var s=this,a=s._bufferedElements,o=s._attributeBuffer,h=s._indexBuffer,u=s.vertexSize,l=e._drawCallPool,f=this._dcIndex,c=this._aIndex,d=this._iIndex,v=l[f];v.start=this._iIndex,v.texArray=t;for(var p=i;p<n;++p){var _=a[p],m=_._texture.baseTexture,g=hh[m.alphaMode?1:0][_.blendMode];a[p]=null,i<p&&v.blend!==g&&(v.size=d-v.start,i=p,v=l[++f],v.texArray=t,v.start=d),this.packInterleavedGeometry(_,o,h,c,d),c+=_.vertexData.length/2*u,d+=_.indices.length,v.blend=g}i<n&&(v.size=d-v.start,++f),this._dcIndex=f,this._aIndex=c,this._iIndex=d},e.prototype.bindAndClearTexArray=function(t){for(var i=this.renderer.texture,n=0;n<t.count;n++)i.bind(t.elements[n],t.ids[n]),t.elements[n]=null;t.count=0},e.prototype.updateGeometry=function(){var t=this,i=t._packedGeometries,n=t._attributeBuffer,s=t._indexBuffer;L.CAN_UPLOAD_SAME_BUFFER?(i[this._flushId]._buffer.update(n.rawBinaryData),i[this._flushId]._indexBuffer.update(s),this.renderer.geometry.updateBuffers()):(this._packedGeometryPoolSize<=this._flushId&&(this._packedGeometryPoolSize++,i[this._flushId]=new this.geometryClass),i[this._flushId]._buffer.update(n.rawBinaryData),i[this._flushId]._indexBuffer.update(s),this.renderer.geometry.bind(i[this._flushId]),this.renderer.geometry.updateBuffers(),this._flushId++)},e.prototype.drawBatches=function(){for(var t=this._dcIndex,i=this.renderer,n=i.gl,s=i.state,a=e._drawCallPool,o=null,h=0;h<t;h++){var u=a[h],l=u.texArray,f=u.type,c=u.size,d=u.start,v=u.blend;o!==l&&(o=l,this.bindAndClearTexArray(l)),this.state.blendMode=v,s.set(this.state),n.drawElements(f,c,n.UNSIGNED_SHORT,d*2)}},e.prototype.flush=function(){this._vertexCount!==0&&(this._attributeBuffer=this.getAttributeBuffer(this._vertexCount),this._indexBuffer=this.getIndexBuffer(this._indexCount),this._aIndex=0,this._iIndex=0,this._dcIndex=0,this.buildTexturesAndDrawCalls(),this.updateGeometry(),this.drawBatches(),this._bufferSize=0,this._vertexCount=0,this._indexCount=0)},e.prototype.start=function(){this.renderer.state.set(this.state),this.renderer.texture.ensureSamplerType(this.MAX_TEXTURES),this.renderer.shader.bind(this._shader),L.CAN_UPLOAD_SAME_BUFFER&&this.renderer.geometry.bind(this._packedGeometries[this._flushId])},e.prototype.stop=function(){this.flush()},e.prototype.destroy=function(){for(var t=0;t<this._packedGeometryPoolSize;t++)this._packedGeometries[t]&&this._packedGeometries[t].destroy();this.renderer.off("prerender",this.onPrerender,this),this._aBuffers=null,this._iBuffers=null,this._packedGeometries=null,this._attributeBuffer=null,this._indexBuffer=null,this._shader&&(this._shader.destroy(),this._shader=null),r.prototype.destroy.call(this)},e.prototype.getAttributeBuffer=function(t){var i=fn(Math.ceil(t/8)),n=dh(i),s=i*8;this._aBuffers.length<=n&&(this._iBuffers.length=n+1);var a=this._aBuffers[s];return a||(this._aBuffers[s]=a=new $s(s*this.vertexSize*4)),a},e.prototype.getIndexBuffer=function(t){var i=fn(Math.ceil(t/12)),n=dh(i),s=i*12;this._iBuffers.length<=n&&(this._iBuffers.length=n+1);var a=this._iBuffers[n];return a||(this._iBuffers[n]=a=new Uint16Array(s)),a},e.prototype.packInterleavedGeometry=function(t,i,n,s,a){for(var o=i.uint32View,h=i.float32View,u=s/this.vertexSize,l=t.uvs,f=t.indices,c=t.vertexData,d=t._texture.baseTexture._batchLocation,v=Math.min(t.worldAlpha,1),p=v<1&&t._texture.baseTexture.alphaMode?Os(t._tintRGB,v):t._tintRGB+(v*255<<24),_=0;_<c.length;_+=2)h[s++]=c[_],h[s++]=c[_+1],h[s++]=l[_],h[s++]=l[_+1],o[s++]=p,h[s++]=d;for(var _=0;_<f.length;_++)n[a++]=u+f[_]},e._drawCallPool=[],e._textureArrayPool=[],e}(mn),um=function(){function r(e,t){if(this.vertexSrc=e,this.fragTemplate=t,this.programCache={},this.defaultGroupCache={},t.indexOf("%count%")<0)throw new Error('Fragment template must contain "%count%".');if(t.indexOf("%forloop%")<0)throw new Error('Fragment template must contain "%forloop%".')}return r.prototype.generateShader=function(e){if(!this.programCache[e]){for(var t=new Int32Array(e),i=0;i<e;i++)t[i]=i;this.defaultGroupCache[e]=Ti.from({uSamplers:t},!0);var n=this.fragTemplate;n=n.replace(/%count%/gi,""+e),n=n.replace(/%forloop%/gi,this.generateSampleSrc(e)),this.programCache[e]=new Pr(this.vertexSrc,n)}var s={tint:new Float32Array([1,1,1,1]),translationMatrix:new Ct,default:this.defaultGroupCache[e]};return new $e(this.programCache[e],s)},r.prototype.generateSampleSrc=function(e){var t="";t+=`
456
+ `,hm=am,Vh=om,qs=function(){function r(){this.texArray=null,this.blend=0,this.type=de.TRIANGLES,this.start=0,this.size=0,this.data=null}return r}(),Ks=function(){function r(){this.elements=[],this.ids=[],this.count=0}return r.prototype.clear=function(){for(var e=0;e<this.count;e++)this.elements[e]=null;this.count=0},r}(),$s=function(){function r(e){typeof e=="number"?this.rawBinaryData=new ArrayBuffer(e):e instanceof Uint8Array?this.rawBinaryData=e.buffer:this.rawBinaryData=e,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData)}return Object.defineProperty(r.prototype,"int8View",{get:function(){return this._int8View||(this._int8View=new Int8Array(this.rawBinaryData)),this._int8View},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"uint8View",{get:function(){return this._uint8View||(this._uint8View=new Uint8Array(this.rawBinaryData)),this._uint8View},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"int16View",{get:function(){return this._int16View||(this._int16View=new Int16Array(this.rawBinaryData)),this._int16View},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"uint16View",{get:function(){return this._uint16View||(this._uint16View=new Uint16Array(this.rawBinaryData)),this._uint16View},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"int32View",{get:function(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View},enumerable:!1,configurable:!0}),r.prototype.view=function(e){return this[e+"View"]},r.prototype.destroy=function(){this.rawBinaryData=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._uint16View=null,this._int32View=null,this.uint32View=null,this.float32View=null},r.sizeOf=function(e){switch(e){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(e+" isn't a valid view type")}},r}(),um=function(r){ht(e,r);function e(t){var i=r.call(this,t)||this;return i.shaderGenerator=null,i.geometryClass=null,i.vertexSize=null,i.state=wi.for2d(),i.size=L.SPRITE_BATCH_SIZE*4,i._vertexCount=0,i._indexCount=0,i._bufferedElements=[],i._bufferedTextures=[],i._bufferSize=0,i._shader=null,i._packedGeometries=[],i._packedGeometryPoolSize=2,i._flushId=0,i._aBuffers={},i._iBuffers={},i.MAX_TEXTURES=1,i.renderer.on("prerender",i.onPrerender,i),t.runners.contextChange.add(i),i._dcIndex=0,i._aIndex=0,i._iIndex=0,i._attributeBuffer=null,i._indexBuffer=null,i._tempBoundTextures=[],i}return e.prototype.contextChange=function(){var t=this.renderer.gl;L.PREFER_ENV===Le.WEBGL_LEGACY?this.MAX_TEXTURES=1:(this.MAX_TEXTURES=Math.min(t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),L.SPRITE_MAX_TEXTURES),this.MAX_TEXTURES=y_(this.MAX_TEXTURES,t)),this._shader=this.shaderGenerator.generateShader(this.MAX_TEXTURES);for(var i=0;i<this._packedGeometryPoolSize;i++)this._packedGeometries[i]=new this.geometryClass;this.initFlushBuffers()},e.prototype.initFlushBuffers=function(){for(var t=e._drawCallPool,i=e._textureArrayPool,n=this.size/4,s=Math.floor(n/this.MAX_TEXTURES)+1;t.length<n;)t.push(new qs);for(;i.length<s;)i.push(new Ks);for(var a=0;a<this.MAX_TEXTURES;a++)this._tempBoundTextures[a]=null},e.prototype.onPrerender=function(){this._flushId=0},e.prototype.render=function(t){t._texture.valid&&(this._vertexCount+t.vertexData.length/2>this.size&&this.flush(),this._vertexCount+=t.vertexData.length/2,this._indexCount+=t.indices.length,this._bufferedTextures[this._bufferSize]=t._texture.baseTexture,this._bufferedElements[this._bufferSize++]=t)},e.prototype.buildTexturesAndDrawCalls=function(){var t=this,i=t._bufferedTextures,n=t.MAX_TEXTURES,s=e._textureArrayPool,a=this.renderer.batch,o=this._tempBoundTextures,h=this.renderer.textureGC.count,u=++tt._globalBatch,l=0,f=s[0],c=0;a.copyBoundTextures(o,n);for(var d=0;d<this._bufferSize;++d){var v=i[d];i[d]=null,v._batchEnabled!==u&&(f.count>=n&&(a.boundArray(f,o,u,n),this.buildDrawCalls(f,c,d),c=d,f=s[++l],++u),v._batchEnabled=u,v.touched=h,f.elements[f.count++]=v)}f.count>0&&(a.boundArray(f,o,u,n),this.buildDrawCalls(f,c,this._bufferSize),++l,++u);for(var d=0;d<o.length;d++)o[d]=null;tt._globalBatch=u},e.prototype.buildDrawCalls=function(t,i,n){var s=this,a=s._bufferedElements,o=s._attributeBuffer,h=s._indexBuffer,u=s.vertexSize,l=e._drawCallPool,f=this._dcIndex,c=this._aIndex,d=this._iIndex,v=l[f];v.start=this._iIndex,v.texArray=t;for(var p=i;p<n;++p){var _=a[p],m=_._texture.baseTexture,g=uh[m.alphaMode?1:0][_.blendMode];a[p]=null,i<p&&v.blend!==g&&(v.size=d-v.start,i=p,v=l[++f],v.texArray=t,v.start=d),this.packInterleavedGeometry(_,o,h,c,d),c+=_.vertexData.length/2*u,d+=_.indices.length,v.blend=g}i<n&&(v.size=d-v.start,++f),this._dcIndex=f,this._aIndex=c,this._iIndex=d},e.prototype.bindAndClearTexArray=function(t){for(var i=this.renderer.texture,n=0;n<t.count;n++)i.bind(t.elements[n],t.ids[n]),t.elements[n]=null;t.count=0},e.prototype.updateGeometry=function(){var t=this,i=t._packedGeometries,n=t._attributeBuffer,s=t._indexBuffer;L.CAN_UPLOAD_SAME_BUFFER?(i[this._flushId]._buffer.update(n.rawBinaryData),i[this._flushId]._indexBuffer.update(s),this.renderer.geometry.updateBuffers()):(this._packedGeometryPoolSize<=this._flushId&&(this._packedGeometryPoolSize++,i[this._flushId]=new this.geometryClass),i[this._flushId]._buffer.update(n.rawBinaryData),i[this._flushId]._indexBuffer.update(s),this.renderer.geometry.bind(i[this._flushId]),this.renderer.geometry.updateBuffers(),this._flushId++)},e.prototype.drawBatches=function(){for(var t=this._dcIndex,i=this.renderer,n=i.gl,s=i.state,a=e._drawCallPool,o=null,h=0;h<t;h++){var u=a[h],l=u.texArray,f=u.type,c=u.size,d=u.start,v=u.blend;o!==l&&(o=l,this.bindAndClearTexArray(l)),this.state.blendMode=v,s.set(this.state),n.drawElements(f,c,n.UNSIGNED_SHORT,d*2)}},e.prototype.flush=function(){this._vertexCount!==0&&(this._attributeBuffer=this.getAttributeBuffer(this._vertexCount),this._indexBuffer=this.getIndexBuffer(this._indexCount),this._aIndex=0,this._iIndex=0,this._dcIndex=0,this.buildTexturesAndDrawCalls(),this.updateGeometry(),this.drawBatches(),this._bufferSize=0,this._vertexCount=0,this._indexCount=0)},e.prototype.start=function(){this.renderer.state.set(this.state),this.renderer.texture.ensureSamplerType(this.MAX_TEXTURES),this.renderer.shader.bind(this._shader),L.CAN_UPLOAD_SAME_BUFFER&&this.renderer.geometry.bind(this._packedGeometries[this._flushId])},e.prototype.stop=function(){this.flush()},e.prototype.destroy=function(){for(var t=0;t<this._packedGeometryPoolSize;t++)this._packedGeometries[t]&&this._packedGeometries[t].destroy();this.renderer.off("prerender",this.onPrerender,this),this._aBuffers=null,this._iBuffers=null,this._packedGeometries=null,this._attributeBuffer=null,this._indexBuffer=null,this._shader&&(this._shader.destroy(),this._shader=null),r.prototype.destroy.call(this)},e.prototype.getAttributeBuffer=function(t){var i=fn(Math.ceil(t/8)),n=ph(i),s=i*8;this._aBuffers.length<=n&&(this._iBuffers.length=n+1);var a=this._aBuffers[s];return a||(this._aBuffers[s]=a=new $s(s*this.vertexSize*4)),a},e.prototype.getIndexBuffer=function(t){var i=fn(Math.ceil(t/12)),n=ph(i),s=i*12;this._iBuffers.length<=n&&(this._iBuffers.length=n+1);var a=this._iBuffers[n];return a||(this._iBuffers[n]=a=new Uint16Array(s)),a},e.prototype.packInterleavedGeometry=function(t,i,n,s,a){for(var o=i.uint32View,h=i.float32View,u=s/this.vertexSize,l=t.uvs,f=t.indices,c=t.vertexData,d=t._texture.baseTexture._batchLocation,v=Math.min(t.worldAlpha,1),p=v<1&&t._texture.baseTexture.alphaMode?Os(t._tintRGB,v):t._tintRGB+(v*255<<24),_=0;_<c.length;_+=2)h[s++]=c[_],h[s++]=c[_+1],h[s++]=l[_],h[s++]=l[_+1],o[s++]=p,h[s++]=d;for(var _=0;_<f.length;_++)n[a++]=u+f[_]},e._drawCallPool=[],e._textureArrayPool=[],e}(mn),lm=function(){function r(e,t){if(this.vertexSrc=e,this.fragTemplate=t,this.programCache={},this.defaultGroupCache={},t.indexOf("%count%")<0)throw new Error('Fragment template must contain "%count%".');if(t.indexOf("%forloop%")<0)throw new Error('Fragment template must contain "%forloop%".')}return r.prototype.generateShader=function(e){if(!this.programCache[e]){for(var t=new Int32Array(e),i=0;i<e;i++)t[i]=i;this.defaultGroupCache[e]=Ti.from({uSamplers:t},!0);var n=this.fragTemplate;n=n.replace(/%count%/gi,""+e),n=n.replace(/%forloop%/gi,this.generateSampleSrc(e)),this.programCache[e]=new Pr(this.vertexSrc,n)}var s={tint:new Float32Array([1,1,1,1]),translationMatrix:new Ct,default:this.defaultGroupCache[e]};return new $e(this.programCache[e],s)},r.prototype.generateSampleSrc=function(e){var t="";t+=`
457
457
  `,t+=`
458
458
  `;for(var i=0;i<e;i++)i>0&&(t+=`
459
459
  else `),i<e-1&&(t+="if(vTextureId < "+i+".5)"),t+=`
@@ -461,7 +461,7 @@ else `),i<e-1&&(t+="if(vTextureId < "+i+".5)"),t+=`
461
461
  color = texture2D(uSamplers[`+i+"], vTextureCoord);",t+=`
462
462
  }`;return t+=`
463
463
  `,t+=`
464
- `,t},r}(),zh=function(r){ht(e,r);function e(t){t===void 0&&(t=!1);var i=r.call(this)||this;return i._buffer=new At(null,t,!1),i._indexBuffer=new At(null,t,!0),i.addAttribute("aVertexPosition",i._buffer,2,!1,k.FLOAT).addAttribute("aTextureCoord",i._buffer,2,!1,k.FLOAT).addAttribute("aColor",i._buffer,4,!0,k.UNSIGNED_BYTE).addAttribute("aTextureId",i._buffer,1,!0,k.FLOAT).addIndex(i._indexBuffer),i}return e}(wr),Vh=`precision highp float;
464
+ `,t},r}(),zh=function(r){ht(e,r);function e(t){t===void 0&&(t=!1);var i=r.call(this)||this;return i._buffer=new At(null,t,!1),i._indexBuffer=new At(null,t,!0),i.addAttribute("aVertexPosition",i._buffer,2,!1,k.FLOAT).addAttribute("aTextureCoord",i._buffer,2,!1,k.FLOAT).addAttribute("aColor",i._buffer,4,!0,k.UNSIGNED_BYTE).addAttribute("aTextureId",i._buffer,1,!0,k.FLOAT).addIndex(i._indexBuffer),i}return e}(wr),Yh=`precision highp float;
465
465
  attribute vec2 aVertexPosition;
466
466
  attribute vec2 aTextureCoord;
467
467
  attribute vec4 aColor;
@@ -482,7 +482,7 @@ void main(void){
482
482
  vTextureId = aTextureId;
483
483
  vColor = aColor * tint;
484
484
  }
485
- `,Yh=`varying vec2 vTextureCoord;
485
+ `,jh=`varying vec2 vTextureCoord;
486
486
  varying vec4 vColor;
487
487
  varying float vTextureId;
488
488
  uniform sampler2D uSamplers[%count%];
@@ -492,7 +492,7 @@ void main(void){
492
492
  %forloop%
493
493
  gl_FragColor = color * vColor;
494
494
  }
495
- `,lm=function(){function r(){}return r.create=function(e){var t=Object.assign({vertex:Vh,fragment:Yh,geometryClass:zh,vertexSize:6},e),i=t.vertex,n=t.fragment,s=t.vertexSize,a=t.geometryClass;return function(o){ht(h,o);function h(u){var l=o.call(this,u)||this;return l.shaderGenerator=new um(i,n),l.geometryClass=a,l.vertexSize=s,l}return h}(hm)},Object.defineProperty(r,"defaultVertexSrc",{get:function(){return Vh},enumerable:!1,configurable:!0}),Object.defineProperty(r,"defaultFragmentTemplate",{get:function(){return Yh},enumerable:!1,configurable:!0}),r}(),jh=lm.create();Object.assign(jh,{extension:{name:"batch",type:nt.RendererPlugin}});var fm={accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:null,accessibleType:"button",accessiblePointerEvents:"auto",accessibleChildren:!0,renderId:-1};Tt.mixin(fm);var cm=9,Tn=100,dm=0,pm=0,Zh=2,qh=1,vm=-1e3,_m=-1e3,mm=2,gm=function(){function r(e){this.debug=!1,this._isActive=!1,this._isMobileAccessibility=!1,this.pool=[],this.renderId=0,this.children=[],this.androidUpdateCount=0,this.androidUpdateFrequency=500,this._hookDiv=null,(Oe.tablet||Oe.phone)&&this.createTouchHook();var t=document.createElement("div");t.style.width=Tn+"px",t.style.height=Tn+"px",t.style.position="absolute",t.style.top=dm+"px",t.style.left=pm+"px",t.style.zIndex=Zh.toString(),this.div=t,this.renderer=e,this._onKeyDown=this._onKeyDown.bind(this),this._onMouseMove=this._onMouseMove.bind(this),globalThis.addEventListener("keydown",this._onKeyDown,!1)}return Object.defineProperty(r.prototype,"isActive",{get:function(){return this._isActive},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"isMobileAccessibility",{get:function(){return this._isMobileAccessibility},enumerable:!1,configurable:!0}),r.prototype.createTouchHook=function(){var e=this,t=document.createElement("button");t.style.width=qh+"px",t.style.height=qh+"px",t.style.position="absolute",t.style.top=vm+"px",t.style.left=_m+"px",t.style.zIndex=mm.toString(),t.style.backgroundColor="#FF0000",t.title="select to enable accessibility for this content",t.addEventListener("focus",function(){e._isMobileAccessibility=!0,e.activate(),e.destroyTouchHook()}),document.body.appendChild(t),this._hookDiv=t},r.prototype.destroyTouchHook=function(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)},r.prototype.activate=function(){var e;this._isActive||(this._isActive=!0,globalThis.document.addEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown,!1),this.renderer.on("postrender",this.update,this),(e=this.renderer.view.parentNode)===null||e===void 0||e.appendChild(this.div))},r.prototype.deactivate=function(){var e;!this._isActive||this._isMobileAccessibility||(this._isActive=!1,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.addEventListener("keydown",this._onKeyDown,!1),this.renderer.off("postrender",this.update),(e=this.div.parentNode)===null||e===void 0||e.removeChild(this.div))},r.prototype.updateAccessibleObjects=function(e){if(!(!e.visible||!e.accessibleChildren)){e.accessible&&e.interactive&&(e._accessibleActive||this.addChild(e),e.renderId=this.renderId);var t=e.children;if(t)for(var i=0;i<t.length;i++)this.updateAccessibleObjects(t[i])}},r.prototype.update=function(){var e=performance.now();if(!(Oe.android.device&&e<this.androidUpdateCount)&&(this.androidUpdateCount=e+this.androidUpdateFrequency,!!this.renderer.renderingToScreen)){this.renderer._lastObjectRendered&&this.updateAccessibleObjects(this.renderer._lastObjectRendered);var t=this.renderer.view.getBoundingClientRect(),i=t.left,n=t.top,s=t.width,a=t.height,o=this.renderer,h=o.width,u=o.height,l=o.resolution,f=s/h*l,c=a/u*l,d=this.div;d.style.left=i+"px",d.style.top=n+"px",d.style.width=h+"px",d.style.height=u+"px";for(var v=0;v<this.children.length;v++){var p=this.children[v];if(p.renderId!==this.renderId)p._accessibleActive=!1,zi(this.children,v,1),this.div.removeChild(p._accessibleDiv),this.pool.push(p._accessibleDiv),p._accessibleDiv=null,v--;else{d=p._accessibleDiv;var _=p.hitArea,m=p.worldTransform;p.hitArea?(d.style.left=(m.tx+_.x*m.a)*f+"px",d.style.top=(m.ty+_.y*m.d)*c+"px",d.style.width=_.width*m.a*f+"px",d.style.height=_.height*m.d*c+"px"):(_=p.getBounds(),this.capHitArea(_),d.style.left=_.x*f+"px",d.style.top=_.y*c+"px",d.style.width=_.width*f+"px",d.style.height=_.height*c+"px",d.title!==p.accessibleTitle&&p.accessibleTitle!==null&&(d.title=p.accessibleTitle),d.getAttribute("aria-label")!==p.accessibleHint&&p.accessibleHint!==null&&d.setAttribute("aria-label",p.accessibleHint)),(p.accessibleTitle!==d.title||p.tabIndex!==d.tabIndex)&&(d.title=p.accessibleTitle,d.tabIndex=p.tabIndex,this.debug&&this.updateDebugHTML(d))}}this.renderId++}},r.prototype.updateDebugHTML=function(e){e.innerHTML="type: "+e.type+"</br> title : "+e.title+"</br> tabIndex: "+e.tabIndex},r.prototype.capHitArea=function(e){e.x<0&&(e.width+=e.x,e.x=0),e.y<0&&(e.height+=e.y,e.y=0);var t=this.renderer,i=t.width,n=t.height;e.x+e.width>i&&(e.width=i-e.x),e.y+e.height>n&&(e.height=n-e.y)},r.prototype.addChild=function(e){var t=this.pool.pop();t||(t=document.createElement("button"),t.style.width=Tn+"px",t.style.height=Tn+"px",t.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",t.style.position="absolute",t.style.zIndex=Zh.toString(),t.style.borderStyle="none",navigator.userAgent.toLowerCase().indexOf("chrome")>-1?t.setAttribute("aria-live","off"):t.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?t.setAttribute("aria-relevant","additions"):t.setAttribute("aria-relevant","text"),t.addEventListener("click",this._onClick.bind(this)),t.addEventListener("focus",this._onFocus.bind(this)),t.addEventListener("focusout",this._onFocusOut.bind(this))),t.style.pointerEvents=e.accessiblePointerEvents,t.type=e.accessibleType,e.accessibleTitle&&e.accessibleTitle!==null?t.title=e.accessibleTitle:(!e.accessibleHint||e.accessibleHint===null)&&(t.title="displayObject "+e.tabIndex),e.accessibleHint&&e.accessibleHint!==null&&t.setAttribute("aria-label",e.accessibleHint),this.debug&&this.updateDebugHTML(t),e._accessibleActive=!0,e._accessibleDiv=t,t.displayObject=e,this.children.push(e),this.div.appendChild(e._accessibleDiv),e._accessibleDiv.tabIndex=e.tabIndex},r.prototype._onClick=function(e){var t=this.renderer.plugins.interaction,i=e.target.displayObject,n=t.eventData;t.dispatchEvent(i,"click",n),t.dispatchEvent(i,"pointertap",n),t.dispatchEvent(i,"tap",n)},r.prototype._onFocus=function(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","assertive");var t=this.renderer.plugins.interaction,i=e.target.displayObject,n=t.eventData;t.dispatchEvent(i,"mouseover",n)},r.prototype._onFocusOut=function(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","polite");var t=this.renderer.plugins.interaction,i=e.target.displayObject,n=t.eventData;t.dispatchEvent(i,"mouseout",n)},r.prototype._onKeyDown=function(e){e.keyCode===cm&&this.activate()},r.prototype._onMouseMove=function(e){e.movementX===0&&e.movementY===0||this.deactivate()},r.prototype.destroy=function(){this.destroyTouchHook(),this.div=null,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown),this.pool=null,this.children=null,this.renderer=null},r.extension={name:"accessibility",type:[nt.RendererPlugin,nt.CanvasRendererPlugin]},r}();var Kh=function(){function r(){this.pressure=0,this.rotationAngle=0,this.twist=0,this.tangentialPressure=0,this.global=new j,this.target=null,this.originalEvent=null,this.identifier=null,this.isPrimary=!1,this.button=0,this.buttons=0,this.width=0,this.height=0,this.tiltX=0,this.tiltY=0,this.pointerType=null,this.pressure=0,this.rotationAngle=0,this.twist=0,this.tangentialPressure=0}return Object.defineProperty(r.prototype,"pointerId",{get:function(){return this.identifier},enumerable:!1,configurable:!0}),r.prototype.getLocalPosition=function(e,t,i){return e.worldTransform.applyInverse(i||this.global,t)},r.prototype.copyEvent=function(e){"isPrimary"in e&&e.isPrimary&&(this.isPrimary=!0),this.button="button"in e&&e.button;var t="buttons"in e&&e.buttons;this.buttons=Number.isInteger(t)?t:"which"in e&&e.which,this.width="width"in e&&e.width,this.height="height"in e&&e.height,this.tiltX="tiltX"in e&&e.tiltX,this.tiltY="tiltY"in e&&e.tiltY,this.pointerType="pointerType"in e&&e.pointerType,this.pressure="pressure"in e&&e.pressure,this.rotationAngle="rotationAngle"in e&&e.rotationAngle,this.twist="twist"in e&&e.twist||0,this.tangentialPressure="tangentialPressure"in e&&e.tangentialPressure||0},r.prototype.reset=function(){this.isPrimary=!1},r}();var Js=function(r,e){return Js=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},Js(r,e)};function ym(r,e){Js(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var xm=function(){function r(){this.stopped=!1,this.stopsPropagatingAt=null,this.stopPropagationHint=!1,this.target=null,this.currentTarget=null,this.type=null,this.data=null}return r.prototype.stopPropagation=function(){this.stopped=!0,this.stopPropagationHint=!0,this.stopsPropagatingAt=this.currentTarget},r.prototype.reset=function(){this.stopped=!1,this.stopsPropagatingAt=null,this.stopPropagationHint=!1,this.currentTarget=null,this.target=null},r}(),Qs=function(){function r(e){this._pointerId=e,this._flags=r.FLAGS.NONE}return r.prototype._doSet=function(e,t){t?this._flags=this._flags|e:this._flags=this._flags&~e},Object.defineProperty(r.prototype,"pointerId",{get:function(){return this._pointerId},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"flags",{get:function(){return this._flags},set:function(e){this._flags=e},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"none",{get:function(){return this._flags===r.FLAGS.NONE},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"over",{get:function(){return(this._flags&r.FLAGS.OVER)!==0},set:function(e){this._doSet(r.FLAGS.OVER,e)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"rightDown",{get:function(){return(this._flags&r.FLAGS.RIGHT_DOWN)!==0},set:function(e){this._doSet(r.FLAGS.RIGHT_DOWN,e)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"leftDown",{get:function(){return(this._flags&r.FLAGS.LEFT_DOWN)!==0},set:function(e){this._doSet(r.FLAGS.LEFT_DOWN,e)},enumerable:!1,configurable:!0}),r.FLAGS=Object.freeze({NONE:0,OVER:1<<0,LEFT_DOWN:1<<1,RIGHT_DOWN:1<<2}),r}(),bm=function(){function r(){this._tempPoint=new j}return r.prototype.recursiveFindHit=function(e,t,i,n,s){var a;if(!t||!t.visible)return!1;var o=e.data.global;s=t.interactive||s;var h=!1,u=s,l=!0;if(t.hitArea)n&&(t.worldTransform.applyInverse(o,this._tempPoint),t.hitArea.contains(this._tempPoint.x,this._tempPoint.y)?h=!0:(n=!1,l=!1)),u=!1;else if(t._mask&&n){var f=t._mask.isMaskData?t._mask.maskObject:t._mask;f&&!(!((a=f.containsPoint)===null||a===void 0)&&a.call(f,o))&&(n=!1)}if(l&&t.interactiveChildren&&t.children)for(var c=t.children,d=c.length-1;d>=0;d--){var v=c[d],p=this.recursiveFindHit(e,v,i,n,u);if(p){if(!v.parent)continue;u=!1,p&&(e.target&&(n=!1),h=!0)}}return s&&(n&&!e.target&&!t.hitArea&&t.containsPoint&&t.containsPoint(o)&&(h=!0),t.interactive&&(h&&!e.target&&(e.target=t),i&&i(e,t,!!h))),h},r.prototype.findHit=function(e,t,i,n){this.recursiveFindHit(e,t,i,n,!1)},r}(),Tm={interactive:!1,interactiveChildren:!0,hitArea:null,get buttonMode(){return this.cursor==="pointer"},set buttonMode(r){r?this.cursor="pointer":this.cursor==="pointer"&&(this.cursor=null)},cursor:null,get trackedPointers(){return this._trackedPointers===void 0&&(this._trackedPointers={}),this._trackedPointers},_trackedPointers:void 0};Tt.mixin(Tm);var wn=1,En={target:null,data:{global:null}},wm=function(r){ym(e,r);function e(t,i){var n=r.call(this)||this;return i=i||{},n.renderer=t,n.autoPreventDefault=i.autoPreventDefault!==void 0?i.autoPreventDefault:!0,n.interactionFrequency=i.interactionFrequency||10,n.mouse=new Kh,n.mouse.identifier=wn,n.mouse.global.set(-999999),n.activeInteractionData={},n.activeInteractionData[wn]=n.mouse,n.interactionDataPool=[],n.eventData=new xm,n.interactionDOMElement=null,n.moveWhenInside=!1,n.eventsAdded=!1,n.tickerAdded=!1,n.mouseOverRenderer=!("PointerEvent"in globalThis),n.supportsTouchEvents="ontouchstart"in globalThis,n.supportsPointerEvents=!!globalThis.PointerEvent,n.onPointerUp=n.onPointerUp.bind(n),n.processPointerUp=n.processPointerUp.bind(n),n.onPointerCancel=n.onPointerCancel.bind(n),n.processPointerCancel=n.processPointerCancel.bind(n),n.onPointerDown=n.onPointerDown.bind(n),n.processPointerDown=n.processPointerDown.bind(n),n.onPointerMove=n.onPointerMove.bind(n),n.processPointerMove=n.processPointerMove.bind(n),n.onPointerOut=n.onPointerOut.bind(n),n.processPointerOverOut=n.processPointerOverOut.bind(n),n.onPointerOver=n.onPointerOver.bind(n),n.cursorStyles={default:"inherit",pointer:"pointer"},n.currentCursorMode=null,n.cursor=null,n.resolution=1,n.delayedEvents=[],n.search=new bm,n._tempDisplayObject=new mh,n._eventListenerOptions={capture:!0,passive:!1},n._useSystemTicker=i.useSystemTicker!==void 0?i.useSystemTicker:!0,n.setTargetElement(n.renderer.view,n.renderer.resolution),n}return Object.defineProperty(e.prototype,"useSystemTicker",{get:function(){return this._useSystemTicker},set:function(t){this._useSystemTicker=t,t?this.addTickerListener():this.removeTickerListener()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastObjectRendered",{get:function(){return this.renderer._lastObjectRendered||this._tempDisplayObject},enumerable:!1,configurable:!0}),e.prototype.hitTest=function(t,i){return En.target=null,En.data.global=t,i||(i=this.lastObjectRendered),this.processInteractive(En,i,null,!0),En.target},e.prototype.setTargetElement=function(t,i){i===void 0&&(i=1),this.removeTickerListener(),this.removeEvents(),this.interactionDOMElement=t,this.resolution=i,this.addEvents(),this.addTickerListener()},e.prototype.addTickerListener=function(){this.tickerAdded||!this.interactionDOMElement||!this._useSystemTicker||(Ft.system.add(this.tickerUpdate,this,re.INTERACTION),this.tickerAdded=!0)},e.prototype.removeTickerListener=function(){this.tickerAdded&&(Ft.system.remove(this.tickerUpdate,this),this.tickerAdded=!1)},e.prototype.addEvents=function(){if(!(this.eventsAdded||!this.interactionDOMElement)){var t=this.interactionDOMElement.style;globalThis.navigator.msPointerEnabled?(t.msContentZooming="none",t.msTouchAction="none"):this.supportsPointerEvents&&(t.touchAction="none"),this.supportsPointerEvents?(globalThis.document.addEventListener("pointermove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerdown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerleave",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerover",this.onPointerOver,this._eventListenerOptions),globalThis.addEventListener("pointercancel",this.onPointerCancel,this._eventListenerOptions),globalThis.addEventListener("pointerup",this.onPointerUp,this._eventListenerOptions)):(globalThis.document.addEventListener("mousemove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mousedown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mouseout",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mouseover",this.onPointerOver,this._eventListenerOptions),globalThis.addEventListener("mouseup",this.onPointerUp,this._eventListenerOptions)),this.supportsTouchEvents&&(this.interactionDOMElement.addEventListener("touchstart",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchcancel",this.onPointerCancel,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchend",this.onPointerUp,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchmove",this.onPointerMove,this._eventListenerOptions)),this.eventsAdded=!0}},e.prototype.removeEvents=function(){if(!(!this.eventsAdded||!this.interactionDOMElement)){var t=this.interactionDOMElement.style;globalThis.navigator.msPointerEnabled?(t.msContentZooming="",t.msTouchAction=""):this.supportsPointerEvents&&(t.touchAction=""),this.supportsPointerEvents?(globalThis.document.removeEventListener("pointermove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerdown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerleave",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerover",this.onPointerOver,this._eventListenerOptions),globalThis.removeEventListener("pointercancel",this.onPointerCancel,this._eventListenerOptions),globalThis.removeEventListener("pointerup",this.onPointerUp,this._eventListenerOptions)):(globalThis.document.removeEventListener("mousemove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mousedown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mouseout",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mouseover",this.onPointerOver,this._eventListenerOptions),globalThis.removeEventListener("mouseup",this.onPointerUp,this._eventListenerOptions)),this.supportsTouchEvents&&(this.interactionDOMElement.removeEventListener("touchstart",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchcancel",this.onPointerCancel,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchend",this.onPointerUp,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchmove",this.onPointerMove,this._eventListenerOptions)),this.interactionDOMElement=null,this.eventsAdded=!1}},e.prototype.tickerUpdate=function(t){this._deltaTime+=t,!(this._deltaTime<this.interactionFrequency)&&(this._deltaTime=0,this.update())},e.prototype.update=function(){if(this.interactionDOMElement){if(this._didMove){this._didMove=!1;return}this.cursor=null;for(var t in this.activeInteractionData)if(this.activeInteractionData.hasOwnProperty(t)){var i=this.activeInteractionData[t];if(i.originalEvent&&i.pointerType!=="touch"){var n=this.configureInteractionEventForDOMEvent(this.eventData,i.originalEvent,i);this.processInteractive(n,this.lastObjectRendered,this.processPointerOverOut,!0)}}this.setCursorMode(this.cursor)}},e.prototype.setCursorMode=function(t){t=t||"default";var i=!0;if(globalThis.OffscreenCanvas&&this.interactionDOMElement instanceof OffscreenCanvas&&(i=!1),this.currentCursorMode!==t){this.currentCursorMode=t;var n=this.cursorStyles[t];if(n)switch(typeof n){case"string":i&&(this.interactionDOMElement.style.cursor=n);break;case"function":n(t);break;case"object":i&&Object.assign(this.interactionDOMElement.style,n);break}else i&&typeof t=="string"&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,t)&&(this.interactionDOMElement.style.cursor=t)}},e.prototype.dispatchEvent=function(t,i,n){(!n.stopPropagationHint||t===n.stopsPropagatingAt)&&(n.currentTarget=t,n.type=i,t.emit(i,n),t[i]&&t[i](n))},e.prototype.delayDispatchEvent=function(t,i,n){this.delayedEvents.push({displayObject:t,eventString:i,eventData:n})},e.prototype.mapPositionToPoint=function(t,i,n){var s;this.interactionDOMElement.parentElement?s=this.interactionDOMElement.getBoundingClientRect():s={x:0,y:0,width:this.interactionDOMElement.width,height:this.interactionDOMElement.height,left:0,top:0};var a=1/this.resolution;t.x=(i-s.left)*(this.interactionDOMElement.width/s.width)*a,t.y=(n-s.top)*(this.interactionDOMElement.height/s.height)*a},e.prototype.processInteractive=function(t,i,n,s){var a=this.search.findHit(t,i,n,s),o=this.delayedEvents;if(!o.length)return a;t.stopPropagationHint=!1;var h=o.length;this.delayedEvents=[];for(var u=0;u<h;u++){var l=o[u],f=l.displayObject,c=l.eventString,d=l.eventData;d.stopsPropagatingAt===f&&(d.stopPropagationHint=!0),this.dispatchEvent(f,c,d)}return a},e.prototype.onPointerDown=function(t){if(!(this.supportsTouchEvents&&t.pointerType==="touch")){var i=this.normalizeToPointerData(t);if(this.autoPreventDefault&&i[0].isNormalized){var n=t.cancelable||!("cancelable"in t);n&&t.preventDefault()}for(var s=i.length,a=0;a<s;a++){var o=i[a],h=this.getInteractionDataForPointerId(o),u=this.configureInteractionEventForDOMEvent(this.eventData,o,h);if(u.data.originalEvent=t,this.processInteractive(u,this.lastObjectRendered,this.processPointerDown,!0),this.emit("pointerdown",u),o.pointerType==="touch")this.emit("touchstart",u);else if(o.pointerType==="mouse"||o.pointerType==="pen"){var l=o.button===2;this.emit(l?"rightdown":"mousedown",this.eventData)}}}},e.prototype.processPointerDown=function(t,i,n){var s=t.data,a=t.data.identifier;if(n){if(i.trackedPointers[a]||(i.trackedPointers[a]=new Qs(a)),this.dispatchEvent(i,"pointerdown",t),s.pointerType==="touch")this.dispatchEvent(i,"touchstart",t);else if(s.pointerType==="mouse"||s.pointerType==="pen"){var o=s.button===2;o?i.trackedPointers[a].rightDown=!0:i.trackedPointers[a].leftDown=!0,this.dispatchEvent(i,o?"rightdown":"mousedown",t)}}},e.prototype.onPointerComplete=function(t,i,n){var s=this.normalizeToPointerData(t),a=s.length,o=t.target;t.composedPath&&t.composedPath().length>0&&(o=t.composedPath()[0]);for(var h=o!==this.interactionDOMElement?"outside":"",u=0;u<a;u++){var l=s[u],f=this.getInteractionDataForPointerId(l),c=this.configureInteractionEventForDOMEvent(this.eventData,l,f);if(c.data.originalEvent=t,this.processInteractive(c,this.lastObjectRendered,n,i||!h),this.emit(i?"pointercancel":"pointerup"+h,c),l.pointerType==="mouse"||l.pointerType==="pen"){var d=l.button===2;this.emit(d?"rightup"+h:"mouseup"+h,c)}else l.pointerType==="touch"&&(this.emit(i?"touchcancel":"touchend"+h,c),this.releaseInteractionDataForPointerId(l.pointerId))}},e.prototype.onPointerCancel=function(t){this.supportsTouchEvents&&t.pointerType==="touch"||this.onPointerComplete(t,!0,this.processPointerCancel)},e.prototype.processPointerCancel=function(t,i){var n=t.data,s=t.data.identifier;i.trackedPointers[s]!==void 0&&(delete i.trackedPointers[s],this.dispatchEvent(i,"pointercancel",t),n.pointerType==="touch"&&this.dispatchEvent(i,"touchcancel",t))},e.prototype.onPointerUp=function(t){this.supportsTouchEvents&&t.pointerType==="touch"||this.onPointerComplete(t,!1,this.processPointerUp)},e.prototype.processPointerUp=function(t,i,n){var s=t.data,a=t.data.identifier,o=i.trackedPointers[a],h=s.pointerType==="touch",u=s.pointerType==="mouse"||s.pointerType==="pen",l=!1;if(u){var f=s.button===2,c=Qs.FLAGS,d=f?c.RIGHT_DOWN:c.LEFT_DOWN,v=o!==void 0&&o.flags&d;n?(this.dispatchEvent(i,f?"rightup":"mouseup",t),v&&(this.dispatchEvent(i,f?"rightclick":"click",t),l=!0)):v&&this.dispatchEvent(i,f?"rightupoutside":"mouseupoutside",t),o&&(f?o.rightDown=!1:o.leftDown=!1)}n?(this.dispatchEvent(i,"pointerup",t),h&&this.dispatchEvent(i,"touchend",t),o&&((!u||l)&&this.dispatchEvent(i,"pointertap",t),h&&(this.dispatchEvent(i,"tap",t),o.over=!1))):o&&(this.dispatchEvent(i,"pointerupoutside",t),h&&this.dispatchEvent(i,"touchendoutside",t)),o&&o.none&&delete i.trackedPointers[a]},e.prototype.onPointerMove=function(t){if(!(this.supportsTouchEvents&&t.pointerType==="touch")){var i=this.normalizeToPointerData(t);(i[0].pointerType==="mouse"||i[0].pointerType==="pen")&&(this._didMove=!0,this.cursor=null);for(var n=i.length,s=0;s<n;s++){var a=i[s],o=this.getInteractionDataForPointerId(a),h=this.configureInteractionEventForDOMEvent(this.eventData,a,o);h.data.originalEvent=t,this.processInteractive(h,this.lastObjectRendered,this.processPointerMove,!0),this.emit("pointermove",h),a.pointerType==="touch"&&this.emit("touchmove",h),(a.pointerType==="mouse"||a.pointerType==="pen")&&this.emit("mousemove",h)}i[0].pointerType==="mouse"&&this.setCursorMode(this.cursor)}},e.prototype.processPointerMove=function(t,i,n){var s=t.data,a=s.pointerType==="touch",o=s.pointerType==="mouse"||s.pointerType==="pen";o&&this.processPointerOverOut(t,i,n),(!this.moveWhenInside||n)&&(this.dispatchEvent(i,"pointermove",t),a&&this.dispatchEvent(i,"touchmove",t),o&&this.dispatchEvent(i,"mousemove",t))},e.prototype.onPointerOut=function(t){if(!(this.supportsTouchEvents&&t.pointerType==="touch")){var i=this.normalizeToPointerData(t),n=i[0];n.pointerType==="mouse"&&(this.mouseOverRenderer=!1,this.setCursorMode(null));var s=this.getInteractionDataForPointerId(n),a=this.configureInteractionEventForDOMEvent(this.eventData,n,s);a.data.originalEvent=n,this.processInteractive(a,this.lastObjectRendered,this.processPointerOverOut,!1),this.emit("pointerout",a),n.pointerType==="mouse"||n.pointerType==="pen"?this.emit("mouseout",a):this.releaseInteractionDataForPointerId(s.identifier)}},e.prototype.processPointerOverOut=function(t,i,n){var s=t.data,a=t.data.identifier,o=s.pointerType==="mouse"||s.pointerType==="pen",h=i.trackedPointers[a];n&&!h&&(h=i.trackedPointers[a]=new Qs(a)),h!==void 0&&(n&&this.mouseOverRenderer?(h.over||(h.over=!0,this.delayDispatchEvent(i,"pointerover",t),o&&this.delayDispatchEvent(i,"mouseover",t)),o&&this.cursor===null&&(this.cursor=i.cursor)):h.over&&(h.over=!1,this.dispatchEvent(i,"pointerout",this.eventData),o&&this.dispatchEvent(i,"mouseout",t),h.none&&delete i.trackedPointers[a]))},e.prototype.onPointerOver=function(t){if(!(this.supportsTouchEvents&&t.pointerType==="touch")){var i=this.normalizeToPointerData(t),n=i[0],s=this.getInteractionDataForPointerId(n),a=this.configureInteractionEventForDOMEvent(this.eventData,n,s);a.data.originalEvent=n,n.pointerType==="mouse"&&(this.mouseOverRenderer=!0),this.emit("pointerover",a),(n.pointerType==="mouse"||n.pointerType==="pen")&&this.emit("mouseover",a)}},e.prototype.getInteractionDataForPointerId=function(t){var i=t.pointerId,n;return i===wn||t.pointerType==="mouse"?n=this.mouse:this.activeInteractionData[i]?n=this.activeInteractionData[i]:(n=this.interactionDataPool.pop()||new Kh,n.identifier=i,this.activeInteractionData[i]=n),n.copyEvent(t),n},e.prototype.releaseInteractionDataForPointerId=function(t){var i=this.activeInteractionData[t];i&&(delete this.activeInteractionData[t],i.reset(),this.interactionDataPool.push(i))},e.prototype.configureInteractionEventForDOMEvent=function(t,i,n){return t.data=n,this.mapPositionToPoint(n.global,i.clientX,i.clientY),i.pointerType==="touch"&&(i.globalX=n.global.x,i.globalY=n.global.y),n.originalEvent=i,t.reset(),t},e.prototype.normalizeToPointerData=function(t){var i=[];if(this.supportsTouchEvents&&t instanceof TouchEvent)for(var n=0,s=t.changedTouches.length;n<s;n++){var a=t.changedTouches[n];typeof a.button>"u"&&(a.button=t.touches.length?1:0),typeof a.buttons>"u"&&(a.buttons=t.touches.length?1:0),typeof a.isPrimary>"u"&&(a.isPrimary=t.touches.length===1&&t.type==="touchstart"),typeof a.width>"u"&&(a.width=a.radiusX||1),typeof a.height>"u"&&(a.height=a.radiusY||1),typeof a.tiltX>"u"&&(a.tiltX=0),typeof a.tiltY>"u"&&(a.tiltY=0),typeof a.pointerType>"u"&&(a.pointerType="touch"),typeof a.pointerId>"u"&&(a.pointerId=a.identifier||0),typeof a.pressure>"u"&&(a.pressure=a.force||.5),typeof a.twist>"u"&&(a.twist=0),typeof a.tangentialPressure>"u"&&(a.tangentialPressure=0),typeof a.layerX>"u"&&(a.layerX=a.offsetX=a.clientX),typeof a.layerY>"u"&&(a.layerY=a.offsetY=a.clientY),a.isNormalized=!0,i.push(a)}else if(!globalThis.MouseEvent||t instanceof MouseEvent&&(!this.supportsPointerEvents||!(t instanceof globalThis.PointerEvent))){var o=t;typeof o.isPrimary>"u"&&(o.isPrimary=!0),typeof o.width>"u"&&(o.width=1),typeof o.height>"u"&&(o.height=1),typeof o.tiltX>"u"&&(o.tiltX=0),typeof o.tiltY>"u"&&(o.tiltY=0),typeof o.pointerType>"u"&&(o.pointerType="mouse"),typeof o.pointerId>"u"&&(o.pointerId=wn),typeof o.pressure>"u"&&(o.pressure=.5),typeof o.twist>"u"&&(o.twist=0),typeof o.tangentialPressure>"u"&&(o.tangentialPressure=0),o.isNormalized=!0,i.push(o)}else i.push(t);return i},e.prototype.destroy=function(){this.removeEvents(),this.removeTickerListener(),this.removeAllListeners(),this.renderer=null,this.mouse=null,this.eventData=null,this.interactionDOMElement=null,this.onPointerDown=null,this.processPointerDown=null,this.onPointerUp=null,this.processPointerUp=null,this.onPointerCancel=null,this.processPointerCancel=null,this.onPointerMove=null,this.processPointerMove=null,this.onPointerOut=null,this.processPointerOverOut=null,this.onPointerOver=null,this.search=null},e.extension={name:"interaction",type:[nt.RendererPlugin,nt.CanvasRendererPlugin]},e}(pr);var $h=new Z,Jh=4,Em=function(){function r(e){this.renderer=e}return r.prototype.image=function(e,t,i){var n=new Image;return n.src=this.base64(e,t,i),n},r.prototype.base64=function(e,t,i){return this.canvas(e).toDataURL(t,i)},r.prototype.canvas=function(e,t){var i=this.renderer,n,s=!1,a,o=!1;e&&(e instanceof bi?a=e:(a=this.renderer.generateTexture(e),o=!0)),a?(n=a.baseTexture.resolution,t=t??a.frame,s=!1,i.renderTexture.bind(a)):(n=i.resolution,t||(t=$h,t.width=i.width,t.height=i.height),s=!0,i.renderTexture.bind(null));var h=Math.round(t.width*n),u=Math.round(t.height*n),l=new _h(h,u,1),f=new Uint8Array(Jh*h*u),c=i.gl;c.readPixels(Math.round(t.x*n),Math.round(t.y*n),h,u,c.RGBA,c.UNSIGNED_BYTE,f);var d=l.context.getImageData(0,0,h,u);if(r.arrayPostDivide(f,d.data),l.context.putImageData(d,0,0),s){var v=new _h(l.width,l.height,1);v.context.scale(1,-1),v.context.drawImage(l.canvas,0,-u),l.destroy(),l=v}return o&&a.destroy(!0),l.canvas},r.prototype.pixels=function(e,t){var i=this.renderer,n,s,a=!1;e&&(e instanceof bi?s=e:(s=this.renderer.generateTexture(e),a=!0)),s?(n=s.baseTexture.resolution,t=t??s.frame,i.renderTexture.bind(s)):(n=i.resolution,t||(t=$h,t.width=i.width,t.height=i.height),i.renderTexture.bind(null));var o=Math.round(t.width*n),h=Math.round(t.height*n),u=new Uint8Array(Jh*o*h),l=i.gl;return l.readPixels(Math.round(t.x*n),Math.round(t.y*n),o,h,l.RGBA,l.UNSIGNED_BYTE,u),a&&s.destroy(!0),r.arrayPostDivide(u,u),u},r.prototype.destroy=function(){this.renderer=null},r.arrayPostDivide=function(e,t){for(var i=0;i<e.length;i+=4){var n=t[i+3]=e[i+3];n!==0?(t[i]=Math.round(Math.min(e[i]*255/n,255)),t[i+1]=Math.round(Math.min(e[i+1]*255/n,255)),t[i+2]=Math.round(Math.min(e[i+2]*255/n,255))):(t[i]=e[i],t[i+1]=e[i+1],t[i+2]=e[i+2])}},r.extension={name:"extract",type:nt.RendererPlugin},r}();var Sn=function(){function r(e,t,i){t===void 0&&(t=!1),this._fn=e,this._once=t,this._thisArg=i,this._next=this._prev=this._owner=null}return r.prototype.detach=function(){return this._owner===null?!1:(this._owner.detach(this),!0)},r}();function Qh(r,e){return r._head?(r._tail._next=e,e._prev=r._tail,r._tail=e):(r._head=e,r._tail=e),e._owner=r,e}var ke=function(){function r(){this._head=this._tail=void 0}return r.prototype.handlers=function(e){e===void 0&&(e=!1);var t=this._head;if(e)return!!t;for(var i=[];t;)i.push(t),t=t._next;return i},r.prototype.has=function(e){if(!(e instanceof Sn))throw new Error("MiniSignal#has(): First arg must be a SignalBinding object.");return e._owner===this},r.prototype.dispatch=function(){for(var e=arguments,t=[],i=0;i<arguments.length;i++)t[i]=e[i];var n=this._head;if(!n)return!1;for(;n;)n._once&&this.detach(n),n._fn.apply(n._thisArg,t),n=n._next;return!0},r.prototype.add=function(e,t){if(t===void 0&&(t=null),typeof e!="function")throw new Error("MiniSignal#add(): First arg must be a Function.");return Qh(this,new Sn(e,!1,t))},r.prototype.once=function(e,t){if(t===void 0&&(t=null),typeof e!="function")throw new Error("MiniSignal#once(): First arg must be a Function.");return Qh(this,new Sn(e,!0,t))},r.prototype.detach=function(e){if(!(e instanceof Sn))throw new Error("MiniSignal#detach(): First arg must be a SignalBinding object.");return e._owner!==this?this:(e._prev&&(e._prev._next=e._next),e._next&&(e._next._prev=e._prev),e===this._head?(this._head=e._next,e._next===null&&(this._tail=null)):e===this._tail&&(this._tail=e._prev,this._tail._next=null),e._owner=null,this)},r.prototype.detachAll=function(){var e=this._head;if(!e)return this;for(this._head=this._tail=null;e;)e._owner=null,e=e._next;return this},r}();function tu(r,e){e=e||{};for(var t={key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}},i=t.parser[e.strictMode?"strict":"loose"].exec(r),n={},s=14;s--;)n[t.key[s]]=i[s]||"";return n[t.q.name]={},n[t.key[12]].replace(t.q.parser,function(a,o,h){o&&(n[t.q.name][o]=h)}),n}var ta,Pn=null,Sm=0,eu=200,Pm=204,Rm=1223,Cm=2;function iu(){}function ru(r,e,t){e&&e.indexOf(".")===0&&(e=e.substring(1)),e&&(r[e]=t)}function ea(r){return r.toString().replace("object ","")}var xt=function(){function r(e,t,i){if(this._dequeue=iu,this._onLoadBinding=null,this._elementTimer=0,this._boundComplete=null,this._boundOnError=null,this._boundOnProgress=null,this._boundOnTimeout=null,this._boundXhrOnError=null,this._boundXhrOnTimeout=null,this._boundXhrOnAbort=null,this._boundXhrOnLoad=null,typeof e!="string"||typeof t!="string")throw new Error("Both name and url are required for constructing a resource.");i=i||{},this._flags=0,this._setFlag(r.STATUS_FLAGS.DATA_URL,t.indexOf("data:")===0),this.name=e,this.url=t,this.extension=this._getExtension(),this.data=null,this.crossOrigin=i.crossOrigin===!0?"anonymous":i.crossOrigin,this.timeout=i.timeout||0,this.loadType=i.loadType||this._determineLoadType(),this.xhrType=i.xhrType,this.metadata=i.metadata||{},this.error=null,this.xhr=null,this.children=[],this.type=r.TYPE.UNKNOWN,this.progressChunk=0,this._dequeue=iu,this._onLoadBinding=null,this._elementTimer=0,this._boundComplete=this.complete.bind(this),this._boundOnError=this._onError.bind(this),this._boundOnProgress=this._onProgress.bind(this),this._boundOnTimeout=this._onTimeout.bind(this),this._boundXhrOnError=this._xhrOnError.bind(this),this._boundXhrOnTimeout=this._xhrOnTimeout.bind(this),this._boundXhrOnAbort=this._xhrOnAbort.bind(this),this._boundXhrOnLoad=this._xhrOnLoad.bind(this),this.onStart=new ke,this.onProgress=new ke,this.onComplete=new ke,this.onAfterMiddleware=new ke}return r.setExtensionLoadType=function(e,t){ru(r._loadTypeMap,e,t)},r.setExtensionXhrType=function(e,t){ru(r._xhrTypeMap,e,t)},Object.defineProperty(r.prototype,"isDataUrl",{get:function(){return this._hasFlag(r.STATUS_FLAGS.DATA_URL)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"isComplete",{get:function(){return this._hasFlag(r.STATUS_FLAGS.COMPLETE)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"isLoading",{get:function(){return this._hasFlag(r.STATUS_FLAGS.LOADING)},enumerable:!1,configurable:!0}),r.prototype.complete=function(){this._clearEvents(),this._finish()},r.prototype.abort=function(e){if(!this.error){if(this.error=new Error(e),this._clearEvents(),this.xhr)this.xhr.abort();else if(this.xdr)this.xdr.abort();else if(this.data)if(this.data.src)this.data.src=r.EMPTY_GIF;else for(;this.data.firstChild;)this.data.removeChild(this.data.firstChild);this._finish()}},r.prototype.load=function(e){var t=this;if(!this.isLoading){if(this.isComplete){e&&setTimeout(function(){return e(t)},1);return}else e&&this.onComplete.once(e);switch(this._setFlag(r.STATUS_FLAGS.LOADING,!0),this.onStart.dispatch(this),(this.crossOrigin===!1||typeof this.crossOrigin!="string")&&(this.crossOrigin=this._determineCrossOrigin(this.url)),this.loadType){case r.LOAD_TYPE.IMAGE:this.type=r.TYPE.IMAGE,this._loadElement("image");break;case r.LOAD_TYPE.AUDIO:this.type=r.TYPE.AUDIO,this._loadSourceElement("audio");break;case r.LOAD_TYPE.VIDEO:this.type=r.TYPE.VIDEO,this._loadSourceElement("video");break;case r.LOAD_TYPE.XHR:default:typeof ta>"u"&&(ta=!!(globalThis.XDomainRequest&&!("withCredentials"in new XMLHttpRequest))),ta&&this.crossOrigin?this._loadXdr():this._loadXhr();break}}},r.prototype._hasFlag=function(e){return(this._flags&e)!==0},r.prototype._setFlag=function(e,t){this._flags=t?this._flags|e:this._flags&~e},r.prototype._clearEvents=function(){clearTimeout(this._elementTimer),this.data&&this.data.removeEventListener&&(this.data.removeEventListener("error",this._boundOnError,!1),this.data.removeEventListener("load",this._boundComplete,!1),this.data.removeEventListener("progress",this._boundOnProgress,!1),this.data.removeEventListener("canplaythrough",this._boundComplete,!1)),this.xhr&&(this.xhr.removeEventListener?(this.xhr.removeEventListener("error",this._boundXhrOnError,!1),this.xhr.removeEventListener("timeout",this._boundXhrOnTimeout,!1),this.xhr.removeEventListener("abort",this._boundXhrOnAbort,!1),this.xhr.removeEventListener("progress",this._boundOnProgress,!1),this.xhr.removeEventListener("load",this._boundXhrOnLoad,!1)):(this.xhr.onerror=null,this.xhr.ontimeout=null,this.xhr.onprogress=null,this.xhr.onload=null))},r.prototype._finish=function(){if(this.isComplete)throw new Error("Complete called again for an already completed resource.");this._setFlag(r.STATUS_FLAGS.COMPLETE,!0),this._setFlag(r.STATUS_FLAGS.LOADING,!1),this.onComplete.dispatch(this)},r.prototype._loadElement=function(e){this.metadata.loadElement?this.data=this.metadata.loadElement:e==="image"&&typeof globalThis.Image<"u"?this.data=new Image:this.data=document.createElement(e),this.crossOrigin&&(this.data.crossOrigin=this.crossOrigin),this.metadata.skipSource||(this.data.src=this.url),this.data.addEventListener("error",this._boundOnError,!1),this.data.addEventListener("load",this._boundComplete,!1),this.data.addEventListener("progress",this._boundOnProgress,!1),this.timeout&&(this._elementTimer=setTimeout(this._boundOnTimeout,this.timeout))},r.prototype._loadSourceElement=function(e){if(this.metadata.loadElement?this.data=this.metadata.loadElement:e==="audio"&&typeof globalThis.Audio<"u"?this.data=new Audio:this.data=document.createElement(e),this.data===null){this.abort("Unsupported element: "+e);return}if(this.crossOrigin&&(this.data.crossOrigin=this.crossOrigin),!this.metadata.skipSource)if(navigator.isCocoonJS)this.data.src=Array.isArray(this.url)?this.url[0]:this.url;else if(Array.isArray(this.url))for(var t=this.metadata.mimeType,i=0;i<this.url.length;++i)this.data.appendChild(this._createSource(e,this.url[i],Array.isArray(t)?t[i]:t));else{var t=this.metadata.mimeType;this.data.appendChild(this._createSource(e,this.url,Array.isArray(t)?t[0]:t))}this.data.addEventListener("error",this._boundOnError,!1),this.data.addEventListener("load",this._boundComplete,!1),this.data.addEventListener("progress",this._boundOnProgress,!1),this.data.addEventListener("canplaythrough",this._boundComplete,!1),this.data.load(),this.timeout&&(this._elementTimer=setTimeout(this._boundOnTimeout,this.timeout))},r.prototype._loadXhr=function(){typeof this.xhrType!="string"&&(this.xhrType=this._determineXhrType());var e=this.xhr=new XMLHttpRequest;this.crossOrigin==="use-credentials"&&(e.withCredentials=!0),e.open("GET",this.url,!0),e.timeout=this.timeout,this.xhrType===r.XHR_RESPONSE_TYPE.JSON||this.xhrType===r.XHR_RESPONSE_TYPE.DOCUMENT?e.responseType=r.XHR_RESPONSE_TYPE.TEXT:e.responseType=this.xhrType,e.addEventListener("error",this._boundXhrOnError,!1),e.addEventListener("timeout",this._boundXhrOnTimeout,!1),e.addEventListener("abort",this._boundXhrOnAbort,!1),e.addEventListener("progress",this._boundOnProgress,!1),e.addEventListener("load",this._boundXhrOnLoad,!1),e.send()},r.prototype._loadXdr=function(){typeof this.xhrType!="string"&&(this.xhrType=this._determineXhrType());var e=this.xhr=new globalThis.XDomainRequest;e.timeout=this.timeout||5e3,e.onerror=this._boundXhrOnError,e.ontimeout=this._boundXhrOnTimeout,e.onprogress=this._boundOnProgress,e.onload=this._boundXhrOnLoad,e.open("GET",this.url,!0),setTimeout(function(){return e.send()},1)},r.prototype._createSource=function(e,t,i){i||(i=e+"/"+this._getExtension(t));var n=document.createElement("source");return n.src=t,n.type=i,n},r.prototype._onError=function(e){this.abort("Failed to load element using: "+e.target.nodeName)},r.prototype._onProgress=function(e){e&&e.lengthComputable&&this.onProgress.dispatch(this,e.loaded/e.total)},r.prototype._onTimeout=function(){this.abort("Load timed out.")},r.prototype._xhrOnError=function(){var e=this.xhr;this.abort(ea(e)+" Request failed. Status: "+e.status+', text: "'+e.statusText+'"')},r.prototype._xhrOnTimeout=function(){var e=this.xhr;this.abort(ea(e)+" Request timed out.")},r.prototype._xhrOnAbort=function(){var e=this.xhr;this.abort(ea(e)+" Request was aborted by the user.")},r.prototype._xhrOnLoad=function(){var e=this.xhr,t="",i=typeof e.status>"u"?eu:e.status;(e.responseType===""||e.responseType==="text"||typeof e.responseType>"u")&&(t=e.responseText),i===Sm&&(t.length>0||e.responseType===r.XHR_RESPONSE_TYPE.BUFFER)?i=eu:i===Rm&&(i=Pm);var n=i/100|0;if(n===Cm)if(this.xhrType===r.XHR_RESPONSE_TYPE.TEXT)this.data=t,this.type=r.TYPE.TEXT;else if(this.xhrType===r.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(t),this.type=r.TYPE.JSON}catch(o){this.abort("Error trying to parse loaded json: "+o);return}else if(this.xhrType===r.XHR_RESPONSE_TYPE.DOCUMENT)try{if(globalThis.DOMParser){var s=new DOMParser;this.data=s.parseFromString(t,"text/xml")}else{var a=document.createElement("div");a.innerHTML=t,this.data=a}this.type=r.TYPE.XML}catch(o){this.abort("Error trying to parse loaded xml: "+o);return}else this.data=e.response||t;else{this.abort("["+e.status+"] "+e.statusText+": "+e.responseURL);return}this.complete()},r.prototype._determineCrossOrigin=function(e,t){if(e.indexOf("data:")===0)return"";if(globalThis.origin!==globalThis.location.origin)return"anonymous";t=t||globalThis.location,Pn||(Pn=document.createElement("a")),Pn.href=e;var i=tu(Pn.href,{strictMode:!0}),n=!i.port&&t.port===""||i.port===t.port,s=i.protocol?i.protocol+":":"";return i.host!==t.hostname||!n||s!==t.protocol?"anonymous":""},r.prototype._determineXhrType=function(){return r._xhrTypeMap[this.extension]||r.XHR_RESPONSE_TYPE.TEXT},r.prototype._determineLoadType=function(){return r._loadTypeMap[this.extension]||r.LOAD_TYPE.XHR},r.prototype._getExtension=function(e){e===void 0&&(e=this.url);var t="";if(this.isDataUrl){var i=e.indexOf("/");t=e.substring(i+1,e.indexOf(";",i))}else{var n=e.indexOf("?"),s=e.indexOf("#"),a=Math.min(n>-1?n:e.length,s>-1?s:e.length);e=e.substring(0,a),t=e.substring(e.lastIndexOf(".")+1)}return t.toLowerCase()},r.prototype._getMimeFromXhrType=function(e){switch(e){case r.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case r.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case r.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case r.XHR_RESPONSE_TYPE.JSON:return"application/json";case r.XHR_RESPONSE_TYPE.DEFAULT:case r.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},r}();(function(r){(function(e){e[e.NONE=0]="NONE",e[e.DATA_URL=1]="DATA_URL",e[e.COMPLETE=2]="COMPLETE",e[e.LOADING=4]="LOADING"})(r.STATUS_FLAGS||(r.STATUS_FLAGS={})),function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.JSON=1]="JSON",e[e.XML=2]="XML",e[e.IMAGE=3]="IMAGE",e[e.AUDIO=4]="AUDIO",e[e.VIDEO=5]="VIDEO",e[e.TEXT=6]="TEXT"}(r.TYPE||(r.TYPE={})),function(e){e[e.XHR=1]="XHR",e[e.IMAGE=2]="IMAGE",e[e.AUDIO=3]="AUDIO",e[e.VIDEO=4]="VIDEO"}(r.LOAD_TYPE||(r.LOAD_TYPE={})),function(e){e.DEFAULT="text",e.BUFFER="arraybuffer",e.BLOB="blob",e.DOCUMENT="document",e.JSON="json",e.TEXT="text"}(r.XHR_RESPONSE_TYPE||(r.XHR_RESPONSE_TYPE={})),r._loadTypeMap={gif:r.LOAD_TYPE.IMAGE,png:r.LOAD_TYPE.IMAGE,bmp:r.LOAD_TYPE.IMAGE,jpg:r.LOAD_TYPE.IMAGE,jpeg:r.LOAD_TYPE.IMAGE,tif:r.LOAD_TYPE.IMAGE,tiff:r.LOAD_TYPE.IMAGE,webp:r.LOAD_TYPE.IMAGE,tga:r.LOAD_TYPE.IMAGE,avif:r.LOAD_TYPE.IMAGE,svg:r.LOAD_TYPE.IMAGE,"svg+xml":r.LOAD_TYPE.IMAGE,mp3:r.LOAD_TYPE.AUDIO,ogg:r.LOAD_TYPE.AUDIO,wav:r.LOAD_TYPE.AUDIO,mp4:r.LOAD_TYPE.VIDEO,webm:r.LOAD_TYPE.VIDEO},r._xhrTypeMap={xhtml:r.XHR_RESPONSE_TYPE.DOCUMENT,html:r.XHR_RESPONSE_TYPE.DOCUMENT,htm:r.XHR_RESPONSE_TYPE.DOCUMENT,xml:r.XHR_RESPONSE_TYPE.DOCUMENT,tmx:r.XHR_RESPONSE_TYPE.DOCUMENT,svg:r.XHR_RESPONSE_TYPE.DOCUMENT,tsx:r.XHR_RESPONSE_TYPE.DOCUMENT,gif:r.XHR_RESPONSE_TYPE.BLOB,png:r.XHR_RESPONSE_TYPE.BLOB,bmp:r.XHR_RESPONSE_TYPE.BLOB,jpg:r.XHR_RESPONSE_TYPE.BLOB,jpeg:r.XHR_RESPONSE_TYPE.BLOB,tif:r.XHR_RESPONSE_TYPE.BLOB,tiff:r.XHR_RESPONSE_TYPE.BLOB,webp:r.XHR_RESPONSE_TYPE.BLOB,tga:r.XHR_RESPONSE_TYPE.BLOB,avif:r.XHR_RESPONSE_TYPE.BLOB,json:r.XHR_RESPONSE_TYPE.JSON,text:r.XHR_RESPONSE_TYPE.TEXT,txt:r.XHR_RESPONSE_TYPE.TEXT,ttf:r.XHR_RESPONSE_TYPE.BUFFER,otf:r.XHR_RESPONSE_TYPE.BUFFER},r.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=="})(xt||(xt={}));function Si(){}function Om(r){return function(){for(var t=arguments,i=[],n=0;n<arguments.length;n++)i[n]=t[n];if(r===null)throw new Error("Callback was already called.");var s=r;r=null,s.apply(this,i)}}var Am=function(){function r(e,t){this.data=e,this.callback=t}return r}(),ia=function(){function r(e,t){var i=this;if(t===void 0&&(t=1),this.workers=0,this.saturated=Si,this.unsaturated=Si,this.empty=Si,this.drain=Si,this.error=Si,this.started=!1,this.paused=!1,this._tasks=[],this._insert=function(n,s,a){if(a&&typeof a!="function")throw new Error("task callback must be a function");if(i.started=!0,n==null&&i.idle()){setTimeout(function(){return i.drain()},1);return}var o=new Am(n,typeof a=="function"?a:Si);s?i._tasks.unshift(o):i._tasks.push(o),setTimeout(i.process,1)},this.process=function(){for(;!i.paused&&i.workers<i.concurrency&&i._tasks.length;){var n=i._tasks.shift();i._tasks.length===0&&i.empty(),i.workers+=1,i.workers===i.concurrency&&i.saturated(),i._worker(n.data,Om(i._next(n)))}},this._worker=e,t===0)throw new Error("Concurrency must not be zero");this.concurrency=t,this.buffer=t/4}return r.prototype._next=function(e){var t=this;return function(){for(var i=arguments,n=[],s=0;s<arguments.length;s++)n[s]=i[s];t.workers-=1,e.callback.apply(e,n),n[0]!=null&&t.error(n[0],e.data),t.workers<=t.concurrency-t.buffer&&t.unsaturated(),t.idle()&&t.drain(),t.process()}},r.prototype.push=function(e,t){this._insert(e,!1,t)},r.prototype.kill=function(){this.workers=0,this.drain=Si,this.started=!1,this._tasks=[]},r.prototype.unshift=function(e,t){this._insert(e,!0,t)},r.prototype.length=function(){return this._tasks.length},r.prototype.running=function(){return this.workers},r.prototype.idle=function(){return this._tasks.length+this.workers===0},r.prototype.pause=function(){this.paused!==!0&&(this.paused=!0)},r.prototype.resume=function(){if(this.paused!==!1){this.paused=!1;for(var e=1;e<=this.concurrency;e++)this.process()}},r.eachSeries=function(e,t,i,n){var s=0,a=e.length;function o(h){if(h||s===a){i&&i(h);return}n?setTimeout(function(){t(e[s++],o)},1):t(e[s++],o)}o()},r.queue=function(e,t){return new r(e,t)},r}(),ra=100,Im=/(#[\w-]+)?$/,Rn=function(){function r(e,t){var i=this;e===void 0&&(e=""),t===void 0&&(t=10),this.progress=0,this.loading=!1,this.defaultQueryString="",this._beforeMiddleware=[],this._afterMiddleware=[],this._resourcesParsing=[],this._boundLoadResource=function(h,u){return i._loadResource(h,u)},this.resources={},this.baseUrl=e,this._beforeMiddleware=[],this._afterMiddleware=[],this._resourcesParsing=[],this._boundLoadResource=function(h,u){return i._loadResource(h,u)},this._queue=ia.queue(this._boundLoadResource,t),this._queue.pause(),this.resources={},this.onProgress=new ke,this.onError=new ke,this.onLoad=new ke,this.onStart=new ke,this.onComplete=new ke;for(var n=0;n<r._plugins.length;++n){var s=r._plugins[n],a=s.pre,o=s.use;a&&this.pre(a),o&&this.use(o)}this._protected=!1}return r.prototype._add=function(e,t,i,n){if(this.loading&&(!i||!i.parentResource))throw new Error("Cannot add resources while the loader is running.");if(this.resources[e])throw new Error('Resource named "'+e+'" already exists.');if(t=this._prepareUrl(t),this.resources[e]=new xt(e,t,i),typeof n=="function"&&this.resources[e].onAfterMiddleware.once(n),this.loading){for(var s=i.parentResource,a=[],o=0;o<s.children.length;++o)s.children[o].isComplete||a.push(s.children[o]);var h=s.progressChunk*(a.length+1),u=h/(a.length+2);s.children.push(this.resources[e]),s.progressChunk=u;for(var o=0;o<a.length;++o)a[o].progressChunk=u;this.resources[e].progressChunk=u}return this._queue.push(this.resources[e]),this},r.prototype.pre=function(e){return this._beforeMiddleware.push(e),this},r.prototype.use=function(e){return this._afterMiddleware.push(e),this},r.prototype.reset=function(){this.progress=0,this.loading=!1,this._queue.kill(),this._queue.pause();for(var e in this.resources){var t=this.resources[e];t._onLoadBinding&&t._onLoadBinding.detach(),t.isLoading&&t.abort("loader reset")}return this.resources={},this},r.prototype.load=function(e){if(ge("6.5.0","@pixi/loaders is being replaced with @pixi/assets in the next major release."),typeof e=="function"&&this.onComplete.once(e),this.loading)return this;if(this._queue.idle())this._onStart(),this._onComplete();else{for(var t=this._queue._tasks.length,i=ra/t,n=0;n<this._queue._tasks.length;++n)this._queue._tasks[n].data.progressChunk=i;this._onStart(),this._queue.resume()}return this},Object.defineProperty(r.prototype,"concurrency",{get:function(){return this._queue.concurrency},set:function(e){this._queue.concurrency=e},enumerable:!1,configurable:!0}),r.prototype._prepareUrl=function(e){var t=tu(e,{strictMode:!0}),i;if(t.protocol||!t.path||e.indexOf("//")===0?i=e:this.baseUrl.length&&this.baseUrl.lastIndexOf("/")!==this.baseUrl.length-1&&e.charAt(0)!=="/"?i=this.baseUrl+"/"+e:i=this.baseUrl+e,this.defaultQueryString){var n=Im.exec(i)[0];i=i.slice(0,i.length-n.length),i.indexOf("?")!==-1?i+="&"+this.defaultQueryString:i+="?"+this.defaultQueryString,i+=n}return i},r.prototype._loadResource=function(e,t){var i=this;e._dequeue=t,ia.eachSeries(this._beforeMiddleware,function(n,s){n.call(i,e,function(){s(e.isComplete?{}:null)})},function(){e.isComplete?i._onLoad(e):(e._onLoadBinding=e.onComplete.once(i._onLoad,i),e.load())},!0)},r.prototype._onStart=function(){this.progress=0,this.loading=!0,this.onStart.dispatch(this)},r.prototype._onComplete=function(){this.progress=ra,this.loading=!1,this.onComplete.dispatch(this,this.resources)},r.prototype._onLoad=function(e){var t=this;e._onLoadBinding=null,this._resourcesParsing.push(e),e._dequeue(),ia.eachSeries(this._afterMiddleware,function(i,n){i.call(t,e,n)},function(){e.onAfterMiddleware.dispatch(e),t.progress=Math.min(ra,t.progress+e.progressChunk),t.onProgress.dispatch(t,e),e.error?t.onError.dispatch(e.error,t,e):t.onLoad.dispatch(t,e),t._resourcesParsing.splice(t._resourcesParsing.indexOf(e),1),t._queue.idle()&&t._resourcesParsing.length===0&&t._onComplete()},!0)},r.prototype.destroy=function(){this._protected||this.reset()},Object.defineProperty(r,"shared",{get:function(){var e=r._shared;return e||(e=new r,e._protected=!0,r._shared=e),e},enumerable:!1,configurable:!0}),r.registerPlugin=function(e){return ge("6.5.0","Loader.registerPlugin() is deprecated, use extensions.add() instead."),Ue.add({type:nt.Loader,ref:e}),r},r._plugins=[],r}();Ue.handleByList(nt.Loader,Rn._plugins),Rn.prototype.add=function(e,t,i,n){if(Array.isArray(e)){for(var s=0;s<e.length;++s)this.add(e[s]);return this}if(typeof e=="object"&&(i=e,n=t||i.callback||i.onComplete,t=i.url,e=i.name||i.key||i.url),typeof t!="string"&&(n=i,i=t,t=e),typeof t!="string")throw new Error("No url passed to add resource to loader.");return typeof i=="function"&&(n=i,i=null),this._add(e,t,i,n)};var Mm=function(){function r(){}return r.init=function(e){e=Object.assign({sharedLoader:!1},e),this.loader=e.sharedLoader?Rn.shared:new Rn},r.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},r.extension=nt.Application,r}(),Dm=function(){function r(){}return r.add=function(){xt.setExtensionLoadType("svg",xt.LOAD_TYPE.XHR),xt.setExtensionXhrType("svg",xt.XHR_RESPONSE_TYPE.TEXT)},r.use=function(e,t){if(e.data&&(e.type===xt.TYPE.IMAGE||e.extension==="svg")){var i=e.data,n=e.url,s=e.name,a=e.metadata;W.fromLoader(i,n,s,a).then(function(o){e.texture=o,t()}).catch(t)}else t()},r.extension=nt.Loader,r}(),Fm="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function Nm(r){for(var e="",t=0;t<r.length;){for(var i=[0,0,0],n=[0,0,0,0],s=0;s<i.length;++s)t<r.length?i[s]=r.charCodeAt(t++)&255:i[s]=0;n[0]=i[0]>>2,n[1]=(i[0]&3)<<4|i[1]>>4,n[2]=(i[1]&15)<<2|i[2]>>6,n[3]=i[2]&63;var a=t-(r.length-1);switch(a){case 2:n[3]=64,n[2]=64;break;case 1:n[3]=64;break}for(var s=0;s<n.length;++s)e+=Fm.charAt(n[s])}return e}function Lm(r,e){if(!r.data){e();return}if(r.xhr&&r.xhrType===xt.XHR_RESPONSE_TYPE.BLOB){if(!self.Blob||typeof r.data=="string"){var t=r.xhr.getResponseHeader("content-type");if(t&&t.indexOf("image")===0){r.data=new Image,r.data.src="data:"+t+";base64,"+Nm(r.xhr.responseText),r.type=xt.TYPE.IMAGE,r.data.onload=function(){r.data.onload=null,e()};return}}else if(r.data.type.indexOf("image")===0){var i=globalThis.URL||globalThis.webkitURL,n=i.createObjectURL(r.data);r.blob=r.data,r.data=new Image,r.data.src=n,r.type=xt.TYPE.IMAGE,r.data.onload=function(){i.revokeObjectURL(n),r.data.onload=null,e()};return}}e()}var Bm=function(){function r(){}return r.extension=nt.Loader,r.use=Lm,r}();Ue.add(Dm,Bm);var it,z;(function(r){r[r.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",r[r.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",r[r.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",r[r.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",r[r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=35917]="COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT",r[r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT=35918]="COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT",r[r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=35919]="COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT",r[r.COMPRESSED_SRGB_S3TC_DXT1_EXT=35916]="COMPRESSED_SRGB_S3TC_DXT1_EXT",r[r.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",r[r.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",r[r.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",r[r.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",r[r.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",r[r.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC",r[r.COMPRESSED_SRGB8_ETC2=37493]="COMPRESSED_SRGB8_ETC2",r[r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",r[r.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37494]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",r[r.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37495]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",r[r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG=35840]="COMPRESSED_RGB_PVRTC_4BPPV1_IMG",r[r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG=35842]="COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",r[r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG=35841]="COMPRESSED_RGB_PVRTC_2BPPV1_IMG",r[r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG=35843]="COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",r[r.COMPRESSED_RGB_ETC1_WEBGL=36196]="COMPRESSED_RGB_ETC1_WEBGL",r[r.COMPRESSED_RGB_ATC_WEBGL=35986]="COMPRESSED_RGB_ATC_WEBGL",r[r.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL=35986]="COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",r[r.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL=34798]="COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",r[r.COMPRESSED_RGBA_ASTC_4x4_KHR=37808]="COMPRESSED_RGBA_ASTC_4x4_KHR"})(z||(z={}));var Cn=(it={},it[z.COMPRESSED_RGB_S3TC_DXT1_EXT]=.5,it[z.COMPRESSED_RGBA_S3TC_DXT1_EXT]=.5,it[z.COMPRESSED_RGBA_S3TC_DXT3_EXT]=1,it[z.COMPRESSED_RGBA_S3TC_DXT5_EXT]=1,it[z.COMPRESSED_SRGB_S3TC_DXT1_EXT]=.5,it[z.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT]=.5,it[z.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT]=1,it[z.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT]=1,it[z.COMPRESSED_R11_EAC]=.5,it[z.COMPRESSED_SIGNED_R11_EAC]=.5,it[z.COMPRESSED_RG11_EAC]=1,it[z.COMPRESSED_SIGNED_RG11_EAC]=1,it[z.COMPRESSED_RGB8_ETC2]=.5,it[z.COMPRESSED_RGBA8_ETC2_EAC]=1,it[z.COMPRESSED_SRGB8_ETC2]=.5,it[z.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC]=1,it[z.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2]=.5,it[z.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2]=.5,it[z.COMPRESSED_RGB_PVRTC_4BPPV1_IMG]=.5,it[z.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG]=.5,it[z.COMPRESSED_RGB_PVRTC_2BPPV1_IMG]=.25,it[z.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG]=.25,it[z.COMPRESSED_RGB_ETC1_WEBGL]=.5,it[z.COMPRESSED_RGB_ATC_WEBGL]=.5,it[z.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL]=1,it[z.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL]=1,it[z.COMPRESSED_RGBA_ASTC_4x4_KHR]=1,it);var na=function(r,e){return na=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},na(r,e)};function nu(r,e){na(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function Gm(r,e,t,i){function n(s){return s instanceof t?s:new t(function(a){a(s)})}return new(t||(t=Promise))(function(s,a){function o(l){try{u(i.next(l))}catch(f){a(f)}}function h(l){try{u(i.throw(l))}catch(f){a(f)}}function u(l){l.done?s(l.value):n(l.value).then(o,h)}u((i=i.apply(r,e||[])).next())})}function Um(r,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,a;return a={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function o(u){return function(l){return h([u,l])}}function h(u){if(i)throw new TypeError("Generator is already executing.");for(;t;)try{if(i=1,n&&(s=u[0]&2?n.return:u[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,u[1])).done)return s;switch(n=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,n=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){t.label=u[1];break}if(u[0]===6&&t.label<s[1]){t.label=s[1],s=u;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(u);break}s[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(r,t)}catch(l){u=[6,l],n=0}finally{i=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}var km=function(r){nu(e,r);function e(t,i){i===void 0&&(i={width:1,height:1,autoLoad:!0});var n=this,s,a;return typeof t=="string"?(s=t,a=new Uint8Array):(s=null,a=t),n=r.call(this,a,i)||this,n.origin=s,n.buffer=a?new $s(a):null,n.origin&&i.autoLoad!==!1&&n.load(),a&&a.length&&(n.loaded=!0,n.onBlobLoaded(n.buffer.rawBinaryData)),n}return e.prototype.onBlobLoaded=function(t){},e.prototype.load=function(){return Gm(this,void 0,Promise,function(){var t,i,n;return Um(this,function(s){switch(s.label){case 0:return[4,fetch(this.origin)];case 1:return t=s.sent(),[4,t.blob()];case 2:return i=s.sent(),[4,i.arrayBuffer()];case 3:return n=s.sent(),this.data=new Uint32Array(n),this.buffer=new $s(n),this.loaded=!0,this.onBlobLoaded(n),this.update(),[2,this]}})})},e}(Tr),sa=function(r){nu(e,r);function e(t,i){var n=r.call(this,t,i)||this;return n.format=i.format,n.levels=i.levels||1,n._width=i.width,n._height=i.height,n._extension=e._formatToExtension(n.format),(i.levelBuffers||n.buffer)&&(n._levelBuffers=i.levelBuffers||e._createLevelBuffers(t instanceof Uint8Array?t:n.buffer.uint8View,n.format,n.levels,4,4,n.width,n.height)),n}return e.prototype.upload=function(t,i,n){var s=t.gl,a=t.context.extensions[this._extension];if(!a)throw new Error(this._extension+" textures are not supported on the current machine");if(!this._levelBuffers)return!1;for(var o=0,h=this.levels;o<h;o++){var u=this._levelBuffers[o],l=u.levelID,f=u.levelWidth,c=u.levelHeight,d=u.levelBuffer;s.compressedTexImage2D(s.TEXTURE_2D,l,this.format,f,c,0,d)}return!0},e.prototype.onBlobLoaded=function(){this._levelBuffers=e._createLevelBuffers(this.buffer.uint8View,this.format,this.levels,4,4,this.width,this.height)},e._formatToExtension=function(t){if(t>=33776&&t<=33779)return"s3tc";if(t>=37488&&t<=37497)return"etc";if(t>=35840&&t<=35843)return"pvrtc";if(t>=36196)return"etc1";if(t>=35986&&t<=34798)return"atc";throw new Error("Invalid (compressed) texture format given!")},e._createLevelBuffers=function(t,i,n,s,a,o,h){for(var u=new Array(n),l=t.byteOffset,f=o,c=h,d=f+s-1&~(s-1),v=c+a-1&~(a-1),p=d*v*Cn[i],_=0;_<n;_++)u[_]={levelID:_,levelWidth:n>1?f:d,levelHeight:n>1?c:v,levelBuffer:new Uint8Array(t.buffer,l,p)},l+=p,f=f>>1||1,c=c>>1||1,d=f+s-1&~(s-1),v=c+a-1&~(a-1),p=d*v*Cn[i];return u},e}(km),Xm=function(){function r(){}return r.use=function(e,t){var i=e.data,n=this;if(e.type===xt.TYPE.JSON&&i&&i.cacheID&&i.textures){for(var s=i.textures,a=void 0,o=void 0,h=0,u=s.length;h<u;h++){var l=s[h],f=l.src,c=l.format;if(c||(o=f),r.textureFormats[c]){a=f;break}}if(a=a||o,!a){t(new Error("Cannot load compressed-textures in "+e.url+", make sure you provide a fallback"));return}if(a===e.url){t(new Error("URL of compressed texture cannot be the same as the manifest's URL"));return}var d={crossOrigin:e.crossOrigin,metadata:e.metadata.imageMetadata,parentResource:e},v=Hi.resolve(e.url.replace(n.baseUrl,""),a),p=i.cacheID;n.add(p,v,d,function(_){if(_.error){t(_.error);return}var m=_.texture,g=m===void 0?null:m,y=_.textures,b=y===void 0?{}:y;Object.assign(e,{texture:g,textures:b}),t()})}else t()},Object.defineProperty(r,"textureExtensions",{get:function(){if(!r._textureExtensions){var e=L.ADAPTER.createCanvas(),t=e.getContext("webgl");if(!t)return console.warn("WebGL not available for compressed textures. Silently failing."),{};var i={s3tc:t.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:t.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:t.getExtension("WEBGL_compressed_texture_etc"),etc1:t.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:t.getExtension("WEBGL_compressed_texture_atc"),astc:t.getExtension("WEBGL_compressed_texture_astc")};r._textureExtensions=i}return r._textureExtensions},enumerable:!1,configurable:!0}),Object.defineProperty(r,"textureFormats",{get:function(){if(!r._textureFormats){var e=r.textureExtensions;r._textureFormats={};for(var t in e){var i=e[t];i&&Object.assign(r._textureFormats,Object.getPrototypeOf(i))}}return r._textureFormats},enumerable:!1,configurable:!0}),r.extension=nt.Loader,r}();function su(r,e,t){var i={textures:{},texture:null};if(!e)return i;var n=e.map(function(s){return new W(new Q(s,Object.assign({mipmap:pe.OFF,alphaMode:ve.NO_PREMULTIPLIED_ALPHA},t)))});return n.forEach(function(s,a){var o=s.baseTexture,h=r+"-"+(a+1);Q.addToCache(o,h),W.addToCache(s,h),a===0&&(Q.addToCache(o,r),W.addToCache(s,r),i.texture=s),i.textures[h]=s}),i}var Cr,ye,aa=4,On=124,Hm=32,au=20,Wm=542327876,An={SIZE:1,FLAGS:2,HEIGHT:3,WIDTH:4,MIPMAP_COUNT:7,PIXEL_FORMAT:19},zm={SIZE:0,FLAGS:1,FOURCC:2,RGB_BITCOUNT:3,R_BIT_MASK:4,G_BIT_MASK:5,B_BIT_MASK:6,A_BIT_MASK:7},In={DXGI_FORMAT:0,RESOURCE_DIMENSION:1,MISC_FLAG:2,ARRAY_SIZE:3,MISC_FLAGS2:4},xe;(function(r){r[r.DXGI_FORMAT_UNKNOWN=0]="DXGI_FORMAT_UNKNOWN",r[r.DXGI_FORMAT_R32G32B32A32_TYPELESS=1]="DXGI_FORMAT_R32G32B32A32_TYPELESS",r[r.DXGI_FORMAT_R32G32B32A32_FLOAT=2]="DXGI_FORMAT_R32G32B32A32_FLOAT",r[r.DXGI_FORMAT_R32G32B32A32_UINT=3]="DXGI_FORMAT_R32G32B32A32_UINT",r[r.DXGI_FORMAT_R32G32B32A32_SINT=4]="DXGI_FORMAT_R32G32B32A32_SINT",r[r.DXGI_FORMAT_R32G32B32_TYPELESS=5]="DXGI_FORMAT_R32G32B32_TYPELESS",r[r.DXGI_FORMAT_R32G32B32_FLOAT=6]="DXGI_FORMAT_R32G32B32_FLOAT",r[r.DXGI_FORMAT_R32G32B32_UINT=7]="DXGI_FORMAT_R32G32B32_UINT",r[r.DXGI_FORMAT_R32G32B32_SINT=8]="DXGI_FORMAT_R32G32B32_SINT",r[r.DXGI_FORMAT_R16G16B16A16_TYPELESS=9]="DXGI_FORMAT_R16G16B16A16_TYPELESS",r[r.DXGI_FORMAT_R16G16B16A16_FLOAT=10]="DXGI_FORMAT_R16G16B16A16_FLOAT",r[r.DXGI_FORMAT_R16G16B16A16_UNORM=11]="DXGI_FORMAT_R16G16B16A16_UNORM",r[r.DXGI_FORMAT_R16G16B16A16_UINT=12]="DXGI_FORMAT_R16G16B16A16_UINT",r[r.DXGI_FORMAT_R16G16B16A16_SNORM=13]="DXGI_FORMAT_R16G16B16A16_SNORM",r[r.DXGI_FORMAT_R16G16B16A16_SINT=14]="DXGI_FORMAT_R16G16B16A16_SINT",r[r.DXGI_FORMAT_R32G32_TYPELESS=15]="DXGI_FORMAT_R32G32_TYPELESS",r[r.DXGI_FORMAT_R32G32_FLOAT=16]="DXGI_FORMAT_R32G32_FLOAT",r[r.DXGI_FORMAT_R32G32_UINT=17]="DXGI_FORMAT_R32G32_UINT",r[r.DXGI_FORMAT_R32G32_SINT=18]="DXGI_FORMAT_R32G32_SINT",r[r.DXGI_FORMAT_R32G8X24_TYPELESS=19]="DXGI_FORMAT_R32G8X24_TYPELESS",r[r.DXGI_FORMAT_D32_FLOAT_S8X24_UINT=20]="DXGI_FORMAT_D32_FLOAT_S8X24_UINT",r[r.DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS=21]="DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS",r[r.DXGI_FORMAT_X32_TYPELESS_G8X24_UINT=22]="DXGI_FORMAT_X32_TYPELESS_G8X24_UINT",r[r.DXGI_FORMAT_R10G10B10A2_TYPELESS=23]="DXGI_FORMAT_R10G10B10A2_TYPELESS",r[r.DXGI_FORMAT_R10G10B10A2_UNORM=24]="DXGI_FORMAT_R10G10B10A2_UNORM",r[r.DXGI_FORMAT_R10G10B10A2_UINT=25]="DXGI_FORMAT_R10G10B10A2_UINT",r[r.DXGI_FORMAT_R11G11B10_FLOAT=26]="DXGI_FORMAT_R11G11B10_FLOAT",r[r.DXGI_FORMAT_R8G8B8A8_TYPELESS=27]="DXGI_FORMAT_R8G8B8A8_TYPELESS",r[r.DXGI_FORMAT_R8G8B8A8_UNORM=28]="DXGI_FORMAT_R8G8B8A8_UNORM",r[r.DXGI_FORMAT_R8G8B8A8_UNORM_SRGB=29]="DXGI_FORMAT_R8G8B8A8_UNORM_SRGB",r[r.DXGI_FORMAT_R8G8B8A8_UINT=30]="DXGI_FORMAT_R8G8B8A8_UINT",r[r.DXGI_FORMAT_R8G8B8A8_SNORM=31]="DXGI_FORMAT_R8G8B8A8_SNORM",r[r.DXGI_FORMAT_R8G8B8A8_SINT=32]="DXGI_FORMAT_R8G8B8A8_SINT",r[r.DXGI_FORMAT_R16G16_TYPELESS=33]="DXGI_FORMAT_R16G16_TYPELESS",r[r.DXGI_FORMAT_R16G16_FLOAT=34]="DXGI_FORMAT_R16G16_FLOAT",r[r.DXGI_FORMAT_R16G16_UNORM=35]="DXGI_FORMAT_R16G16_UNORM",r[r.DXGI_FORMAT_R16G16_UINT=36]="DXGI_FORMAT_R16G16_UINT",r[r.DXGI_FORMAT_R16G16_SNORM=37]="DXGI_FORMAT_R16G16_SNORM",r[r.DXGI_FORMAT_R16G16_SINT=38]="DXGI_FORMAT_R16G16_SINT",r[r.DXGI_FORMAT_R32_TYPELESS=39]="DXGI_FORMAT_R32_TYPELESS",r[r.DXGI_FORMAT_D32_FLOAT=40]="DXGI_FORMAT_D32_FLOAT",r[r.DXGI_FORMAT_R32_FLOAT=41]="DXGI_FORMAT_R32_FLOAT",r[r.DXGI_FORMAT_R32_UINT=42]="DXGI_FORMAT_R32_UINT",r[r.DXGI_FORMAT_R32_SINT=43]="DXGI_FORMAT_R32_SINT",r[r.DXGI_FORMAT_R24G8_TYPELESS=44]="DXGI_FORMAT_R24G8_TYPELESS",r[r.DXGI_FORMAT_D24_UNORM_S8_UINT=45]="DXGI_FORMAT_D24_UNORM_S8_UINT",r[r.DXGI_FORMAT_R24_UNORM_X8_TYPELESS=46]="DXGI_FORMAT_R24_UNORM_X8_TYPELESS",r[r.DXGI_FORMAT_X24_TYPELESS_G8_UINT=47]="DXGI_FORMAT_X24_TYPELESS_G8_UINT",r[r.DXGI_FORMAT_R8G8_TYPELESS=48]="DXGI_FORMAT_R8G8_TYPELESS",r[r.DXGI_FORMAT_R8G8_UNORM=49]="DXGI_FORMAT_R8G8_UNORM",r[r.DXGI_FORMAT_R8G8_UINT=50]="DXGI_FORMAT_R8G8_UINT",r[r.DXGI_FORMAT_R8G8_SNORM=51]="DXGI_FORMAT_R8G8_SNORM",r[r.DXGI_FORMAT_R8G8_SINT=52]="DXGI_FORMAT_R8G8_SINT",r[r.DXGI_FORMAT_R16_TYPELESS=53]="DXGI_FORMAT_R16_TYPELESS",r[r.DXGI_FORMAT_R16_FLOAT=54]="DXGI_FORMAT_R16_FLOAT",r[r.DXGI_FORMAT_D16_UNORM=55]="DXGI_FORMAT_D16_UNORM",r[r.DXGI_FORMAT_R16_UNORM=56]="DXGI_FORMAT_R16_UNORM",r[r.DXGI_FORMAT_R16_UINT=57]="DXGI_FORMAT_R16_UINT",r[r.DXGI_FORMAT_R16_SNORM=58]="DXGI_FORMAT_R16_SNORM",r[r.DXGI_FORMAT_R16_SINT=59]="DXGI_FORMAT_R16_SINT",r[r.DXGI_FORMAT_R8_TYPELESS=60]="DXGI_FORMAT_R8_TYPELESS",r[r.DXGI_FORMAT_R8_UNORM=61]="DXGI_FORMAT_R8_UNORM",r[r.DXGI_FORMAT_R8_UINT=62]="DXGI_FORMAT_R8_UINT",r[r.DXGI_FORMAT_R8_SNORM=63]="DXGI_FORMAT_R8_SNORM",r[r.DXGI_FORMAT_R8_SINT=64]="DXGI_FORMAT_R8_SINT",r[r.DXGI_FORMAT_A8_UNORM=65]="DXGI_FORMAT_A8_UNORM",r[r.DXGI_FORMAT_R1_UNORM=66]="DXGI_FORMAT_R1_UNORM",r[r.DXGI_FORMAT_R9G9B9E5_SHAREDEXP=67]="DXGI_FORMAT_R9G9B9E5_SHAREDEXP",r[r.DXGI_FORMAT_R8G8_B8G8_UNORM=68]="DXGI_FORMAT_R8G8_B8G8_UNORM",r[r.DXGI_FORMAT_G8R8_G8B8_UNORM=69]="DXGI_FORMAT_G8R8_G8B8_UNORM",r[r.DXGI_FORMAT_BC1_TYPELESS=70]="DXGI_FORMAT_BC1_TYPELESS",r[r.DXGI_FORMAT_BC1_UNORM=71]="DXGI_FORMAT_BC1_UNORM",r[r.DXGI_FORMAT_BC1_UNORM_SRGB=72]="DXGI_FORMAT_BC1_UNORM_SRGB",r[r.DXGI_FORMAT_BC2_TYPELESS=73]="DXGI_FORMAT_BC2_TYPELESS",r[r.DXGI_FORMAT_BC2_UNORM=74]="DXGI_FORMAT_BC2_UNORM",r[r.DXGI_FORMAT_BC2_UNORM_SRGB=75]="DXGI_FORMAT_BC2_UNORM_SRGB",r[r.DXGI_FORMAT_BC3_TYPELESS=76]="DXGI_FORMAT_BC3_TYPELESS",r[r.DXGI_FORMAT_BC3_UNORM=77]="DXGI_FORMAT_BC3_UNORM",r[r.DXGI_FORMAT_BC3_UNORM_SRGB=78]="DXGI_FORMAT_BC3_UNORM_SRGB",r[r.DXGI_FORMAT_BC4_TYPELESS=79]="DXGI_FORMAT_BC4_TYPELESS",r[r.DXGI_FORMAT_BC4_UNORM=80]="DXGI_FORMAT_BC4_UNORM",r[r.DXGI_FORMAT_BC4_SNORM=81]="DXGI_FORMAT_BC4_SNORM",r[r.DXGI_FORMAT_BC5_TYPELESS=82]="DXGI_FORMAT_BC5_TYPELESS",r[r.DXGI_FORMAT_BC5_UNORM=83]="DXGI_FORMAT_BC5_UNORM",r[r.DXGI_FORMAT_BC5_SNORM=84]="DXGI_FORMAT_BC5_SNORM",r[r.DXGI_FORMAT_B5G6R5_UNORM=85]="DXGI_FORMAT_B5G6R5_UNORM",r[r.DXGI_FORMAT_B5G5R5A1_UNORM=86]="DXGI_FORMAT_B5G5R5A1_UNORM",r[r.DXGI_FORMAT_B8G8R8A8_UNORM=87]="DXGI_FORMAT_B8G8R8A8_UNORM",r[r.DXGI_FORMAT_B8G8R8X8_UNORM=88]="DXGI_FORMAT_B8G8R8X8_UNORM",r[r.DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM=89]="DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM",r[r.DXGI_FORMAT_B8G8R8A8_TYPELESS=90]="DXGI_FORMAT_B8G8R8A8_TYPELESS",r[r.DXGI_FORMAT_B8G8R8A8_UNORM_SRGB=91]="DXGI_FORMAT_B8G8R8A8_UNORM_SRGB",r[r.DXGI_FORMAT_B8G8R8X8_TYPELESS=92]="DXGI_FORMAT_B8G8R8X8_TYPELESS",r[r.DXGI_FORMAT_B8G8R8X8_UNORM_SRGB=93]="DXGI_FORMAT_B8G8R8X8_UNORM_SRGB",r[r.DXGI_FORMAT_BC6H_TYPELESS=94]="DXGI_FORMAT_BC6H_TYPELESS",r[r.DXGI_FORMAT_BC6H_UF16=95]="DXGI_FORMAT_BC6H_UF16",r[r.DXGI_FORMAT_BC6H_SF16=96]="DXGI_FORMAT_BC6H_SF16",r[r.DXGI_FORMAT_BC7_TYPELESS=97]="DXGI_FORMAT_BC7_TYPELESS",r[r.DXGI_FORMAT_BC7_UNORM=98]="DXGI_FORMAT_BC7_UNORM",r[r.DXGI_FORMAT_BC7_UNORM_SRGB=99]="DXGI_FORMAT_BC7_UNORM_SRGB",r[r.DXGI_FORMAT_AYUV=100]="DXGI_FORMAT_AYUV",r[r.DXGI_FORMAT_Y410=101]="DXGI_FORMAT_Y410",r[r.DXGI_FORMAT_Y416=102]="DXGI_FORMAT_Y416",r[r.DXGI_FORMAT_NV12=103]="DXGI_FORMAT_NV12",r[r.DXGI_FORMAT_P010=104]="DXGI_FORMAT_P010",r[r.DXGI_FORMAT_P016=105]="DXGI_FORMAT_P016",r[r.DXGI_FORMAT_420_OPAQUE=106]="DXGI_FORMAT_420_OPAQUE",r[r.DXGI_FORMAT_YUY2=107]="DXGI_FORMAT_YUY2",r[r.DXGI_FORMAT_Y210=108]="DXGI_FORMAT_Y210",r[r.DXGI_FORMAT_Y216=109]="DXGI_FORMAT_Y216",r[r.DXGI_FORMAT_NV11=110]="DXGI_FORMAT_NV11",r[r.DXGI_FORMAT_AI44=111]="DXGI_FORMAT_AI44",r[r.DXGI_FORMAT_IA44=112]="DXGI_FORMAT_IA44",r[r.DXGI_FORMAT_P8=113]="DXGI_FORMAT_P8",r[r.DXGI_FORMAT_A8P8=114]="DXGI_FORMAT_A8P8",r[r.DXGI_FORMAT_B4G4R4A4_UNORM=115]="DXGI_FORMAT_B4G4R4A4_UNORM",r[r.DXGI_FORMAT_P208=116]="DXGI_FORMAT_P208",r[r.DXGI_FORMAT_V208=117]="DXGI_FORMAT_V208",r[r.DXGI_FORMAT_V408=118]="DXGI_FORMAT_V408",r[r.DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE=119]="DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE",r[r.DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE=120]="DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE",r[r.DXGI_FORMAT_FORCE_UINT=121]="DXGI_FORMAT_FORCE_UINT"})(xe||(xe={}));var oa;(function(r){r[r.DDS_DIMENSION_TEXTURE1D=2]="DDS_DIMENSION_TEXTURE1D",r[r.DDS_DIMENSION_TEXTURE2D=3]="DDS_DIMENSION_TEXTURE2D",r[r.DDS_DIMENSION_TEXTURE3D=6]="DDS_DIMENSION_TEXTURE3D"})(oa||(oa={}));var Vm=1,Ym=2,jm=4,Zm=64,qm=512,Km=131072,$m=827611204,Jm=861165636,Qm=894720068,tg=808540228,eg=4,ig=(Cr={},Cr[$m]=z.COMPRESSED_RGBA_S3TC_DXT1_EXT,Cr[Jm]=z.COMPRESSED_RGBA_S3TC_DXT3_EXT,Cr[Qm]=z.COMPRESSED_RGBA_S3TC_DXT5_EXT,Cr),rg=(ye={},ye[xe.DXGI_FORMAT_BC1_TYPELESS]=z.COMPRESSED_RGBA_S3TC_DXT1_EXT,ye[xe.DXGI_FORMAT_BC1_UNORM]=z.COMPRESSED_RGBA_S3TC_DXT1_EXT,ye[xe.DXGI_FORMAT_BC2_TYPELESS]=z.COMPRESSED_RGBA_S3TC_DXT3_EXT,ye[xe.DXGI_FORMAT_BC2_UNORM]=z.COMPRESSED_RGBA_S3TC_DXT3_EXT,ye[xe.DXGI_FORMAT_BC3_TYPELESS]=z.COMPRESSED_RGBA_S3TC_DXT5_EXT,ye[xe.DXGI_FORMAT_BC3_UNORM]=z.COMPRESSED_RGBA_S3TC_DXT5_EXT,ye[xe.DXGI_FORMAT_BC1_UNORM_SRGB]=z.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,ye[xe.DXGI_FORMAT_BC2_UNORM_SRGB]=z.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,ye[xe.DXGI_FORMAT_BC3_UNORM_SRGB]=z.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,ye);function ng(r){var e=new Uint32Array(r),t=e[0];if(t!==Wm)throw new Error("Invalid DDS file magic word");var i=new Uint32Array(r,0,On/Uint32Array.BYTES_PER_ELEMENT),n=i[An.HEIGHT],s=i[An.WIDTH],a=i[An.MIPMAP_COUNT],o=new Uint32Array(r,An.PIXEL_FORMAT*Uint32Array.BYTES_PER_ELEMENT,Hm/Uint32Array.BYTES_PER_ELEMENT),h=o[Vm];if(h&jm){var u=o[zm.FOURCC];if(u!==tg){var l=ig[u],f=aa+On,c=new Uint8Array(r,f),d=new sa(c,{format:l,width:s,height:n,levels:a});return[d]}var v=aa+On,p=new Uint32Array(e.buffer,v,au/Uint32Array.BYTES_PER_ELEMENT),_=p[In.DXGI_FORMAT],m=p[In.RESOURCE_DIMENSION],g=p[In.MISC_FLAG],y=p[In.ARRAY_SIZE],b=rg[_];if(b===void 0)throw new Error("DDSParser cannot parse texture data with DXGI format "+_);if(g===eg)throw new Error("DDSParser does not support cubemap textures");if(m===oa.DDS_DIMENSION_TEXTURE3D)throw new Error("DDSParser does not supported 3D texture data");var x=new Array,T=aa+On+au;if(y===1)x.push(new Uint8Array(r,T));else{for(var w=Cn[b],S=0,E=s,P=n,O=0;O<a;O++){var D=Math.max(1,E+3&-4),N=Math.max(1,P+3&-4),U=D*N*w;S+=U,E=E>>>1,P=P>>>1}for(var A=T,O=0;O<y;O++)x.push(new Uint8Array(r,A,S)),A+=S}return x.map(function(R){return new sa(R,{format:b,width:s,height:n,levels:a})})}throw h&Zm?new Error("DDSParser does not support uncompressed texture data."):h&qm?new Error("DDSParser does not supported YUV uncompressed texture data."):h&Km?new Error("DDSParser does not support single-channel (lumninance) texture data!"):h&Ym?new Error("DDSParser does not support single-channel (alpha) texture data!"):new Error("DDSParser failed to load a texture file due to an unknown reason!")}var Qe,Xe,Or,ou=[171,75,84,88,32,49,49,187,13,10,26,10],sg=67305985,be={FILE_IDENTIFIER:0,ENDIANNESS:12,GL_TYPE:16,GL_TYPE_SIZE:20,GL_FORMAT:24,GL_INTERNAL_FORMAT:28,GL_BASE_INTERNAL_FORMAT:32,PIXEL_WIDTH:36,PIXEL_HEIGHT:40,PIXEL_DEPTH:44,NUMBER_OF_ARRAY_ELEMENTS:48,NUMBER_OF_FACES:52,NUMBER_OF_MIPMAP_LEVELS:56,BYTES_OF_KEY_VALUE_DATA:60},ha=64,hu=(Qe={},Qe[k.UNSIGNED_BYTE]=1,Qe[k.UNSIGNED_SHORT]=2,Qe[k.INT]=4,Qe[k.UNSIGNED_INT]=4,Qe[k.FLOAT]=4,Qe[k.HALF_FLOAT]=8,Qe),ag=(Xe={},Xe[M.RGBA]=4,Xe[M.RGB]=3,Xe[M.RG]=2,Xe[M.RED]=1,Xe[M.LUMINANCE]=1,Xe[M.LUMINANCE_ALPHA]=2,Xe[M.ALPHA]=1,Xe),og=(Or={},Or[k.UNSIGNED_SHORT_4_4_4_4]=2,Or[k.UNSIGNED_SHORT_5_5_5_1]=2,Or[k.UNSIGNED_SHORT_5_6_5]=2,Or);function hg(r,e,t){t===void 0&&(t=!1);var i=new DataView(e);if(!ug(r,i))return null;var n=i.getUint32(be.ENDIANNESS,!0)===sg,s=i.getUint32(be.GL_TYPE,n),a=i.getUint32(be.GL_FORMAT,n),o=i.getUint32(be.GL_INTERNAL_FORMAT,n),h=i.getUint32(be.PIXEL_WIDTH,n),u=i.getUint32(be.PIXEL_HEIGHT,n)||1,l=i.getUint32(be.PIXEL_DEPTH,n)||1,f=i.getUint32(be.NUMBER_OF_ARRAY_ELEMENTS,n)||1,c=i.getUint32(be.NUMBER_OF_FACES,n),d=i.getUint32(be.NUMBER_OF_MIPMAP_LEVELS,n),v=i.getUint32(be.BYTES_OF_KEY_VALUE_DATA,n);if(u===0||l!==1)throw new Error("Only 2D textures are supported");if(c!==1)throw new Error("CubeTextures are not supported by KTXLoader yet!");if(f!==1)throw new Error("WebGL does not support array textures");var p=4,_=4,m=h+3&-4,g=u+3&-4,y=new Array(f),b=h*u;s===0&&(b=m*g);var x;if(s!==0?hu[s]?x=hu[s]*ag[a]:x=og[s]:x=Cn[o],x===void 0)throw new Error("Unable to resolve the pixel format stored in the *.ktx file!");for(var T=t?fg(i,v,n):null,w=b*x,S=w,E=h,P=u,O=m,D=g,N=ha+v,U=0;U<d;U++){for(var A=i.getUint32(N,n),R=N+4,F=0;F<f;F++){var V=y[F];V||(V=y[F]=new Array(d)),V[U]={levelID:U,levelWidth:d>1||s!==0?E:O,levelHeight:d>1||s!==0?P:D,levelBuffer:new Uint8Array(e,R,S)},R+=S}N+=A+4,N=N%4!==0?N+4-N%4:N,E=E>>1||1,P=P>>1||1,O=E+p-1&~(p-1),D=P+_-1&~(_-1),S=O*D*x}return s!==0?{uncompressed:y.map(function(H){var I=H[0].levelBuffer,C=!1;return s===k.FLOAT?I=new Float32Array(H[0].levelBuffer.buffer,H[0].levelBuffer.byteOffset,H[0].levelBuffer.byteLength/4):s===k.UNSIGNED_INT?(C=!0,I=new Uint32Array(H[0].levelBuffer.buffer,H[0].levelBuffer.byteOffset,H[0].levelBuffer.byteLength/4)):s===k.INT&&(C=!0,I=new Int32Array(H[0].levelBuffer.buffer,H[0].levelBuffer.byteOffset,H[0].levelBuffer.byteLength/4)),{resource:new Tr(I,{width:H[0].levelWidth,height:H[0].levelHeight}),type:s,format:C?lg(a):a}}),kvData:T}:{compressed:y.map(function(H){return new sa(null,{format:o,width:h,height:u,levels:d,levelBuffers:H})}),kvData:T}}function ug(r,e){for(var t=0;t<ou.length;t++)if(e.getUint8(t)!==ou[t])return console.error(r+" is not a valid *.ktx file!"),!1;return!0}function lg(r){switch(r){case M.RGBA:return M.RGBA_INTEGER;case M.RGB:return M.RGB_INTEGER;case M.RG:return M.RG_INTEGER;case M.RED:return M.RED_INTEGER;default:return r}}function fg(r,e,t){for(var i=new Map,n=0;n<e;){var s=r.getUint32(ha+n,t),a=ha+n+4,o=3-(s+3)%4;if(s===0||s>e-n){console.error("KTXLoader: keyAndValueByteSize out of bounds");break}for(var h=0;h<s&&r.getUint8(a+h)!==0;h++);if(h===-1){console.error("KTXLoader: Failed to find null byte terminating kvData key");break}var u=new TextDecoder().decode(new Uint8Array(r.buffer,a,h)),l=new DataView(r.buffer,a+h+1,s-h-1);i.set(u,l),n+=4+s+o}return i}xt.setExtensionXhrType("dds",xt.XHR_RESPONSE_TYPE.BUFFER);var cg=function(){function r(){}return r.use=function(e,t){if(e.extension==="dds"&&e.data)try{Object.assign(e,su(e.name||e.url,ng(e.data),e.metadata))}catch(i){t(i);return}t()},r.extension=nt.Loader,r}();xt.setExtensionXhrType("ktx",xt.XHR_RESPONSE_TYPE.BUFFER);var dg=function(){function r(){}return r.use=function(e,t){if(e.extension==="ktx"&&e.data)try{var i=e.name||e.url,n=hg(i,e.data,this.loadKeyValueData),s=n.compressed,a=n.uncompressed,o=n.kvData;if(s){var h=su(i,s,e.metadata);if(o&&h.textures)for(var u in h.textures)h.textures[u].baseTexture.ktxKeyValueData=o;Object.assign(e,h)}else if(a){var l={};a.forEach(function(f,c){var d=new W(new Q(f.resource,{mipmap:pe.OFF,alphaMode:ve.NO_PREMULTIPLIED_ALPHA,type:f.type,format:f.format})),v=i+"-"+(c+1);o&&(d.baseTexture.ktxKeyValueData=o),Q.addToCache(d.baseTexture,v),W.addToCache(d,v),c===0&&(l[i]=d,Q.addToCache(d.baseTexture,i),W.addToCache(d,i)),l[v]=d}),Object.assign(e,{textures:l})}}catch(f){t(f);return}t()},r.extension=nt.Loader,r.loadKeyValueData=!1,r}();var ua=function(r,e){return ua=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},ua(r,e)};function uu(r,e){ua(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}(function(r){uu(e,r);function e(t,i,n,s){t===void 0&&(t=1500),n===void 0&&(n=16384),s===void 0&&(s=!1);var a=r.call(this)||this,o=16384;return n>o&&(n=o),a._properties=[!1,!0,!1,!1,!1],a._maxSize=t,a._batchSize=n,a._buffers=null,a._bufferUpdateIDs=[],a._updateID=0,a.interactiveChildren=!1,a.blendMode=X.NORMAL,a.autoResize=s,a.roundPixels=!0,a.baseTexture=null,a.setProperties(i),a._tint=0,a.tintRgb=new Float32Array(4),a.tint=16777215,a}return e.prototype.setProperties=function(t){t&&(this._properties[0]="vertices"in t||"scale"in t?!!t.vertices||!!t.scale:this._properties[0],this._properties[1]="position"in t?!!t.position:this._properties[1],this._properties[2]="rotation"in t?!!t.rotation:this._properties[2],this._properties[3]="uvs"in t?!!t.uvs:this._properties[3],this._properties[4]="tint"in t||"alpha"in t?!!t.tint||!!t.alpha:this._properties[4])},e.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},Object.defineProperty(e.prototype,"tint",{get:function(){return this._tint},set:function(t){this._tint=t,Wi(t,this.tintRgb)},enumerable:!1,configurable:!0}),e.prototype.render=function(t){var i=this;!this.visible||this.worldAlpha<=0||!this.children.length||!this.renderable||(this.baseTexture||(this.baseTexture=this.children[0]._texture.baseTexture,this.baseTexture.valid||this.baseTexture.once("update",function(){return i.onChildrenChange(0)})),t.batch.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))},e.prototype.onChildrenChange=function(t){for(var i=Math.floor(t/this._batchSize);this._bufferUpdateIDs.length<i;)this._bufferUpdateIDs.push(0);this._bufferUpdateIDs[i]=++this._updateID},e.prototype.dispose=function(){if(this._buffers){for(var t=0;t<this._buffers.length;++t)this._buffers[t].destroy();this._buffers=null}},e.prototype.destroy=function(t){r.prototype.destroy.call(this,t),this.dispose(),this._properties=null,this._buffers=null,this._bufferUpdateIDs=null},e})(yt);var lu=function(){function r(e,t,i){this.geometry=new wr,this.indexBuffer=null,this.size=i,this.dynamicProperties=[],this.staticProperties=[];for(var n=0;n<e.length;++n){var s=e[n];s={attributeName:s.attributeName,size:s.size,uploadFunction:s.uploadFunction,type:s.type||k.FLOAT,offset:s.offset},t[n]?this.dynamicProperties.push(s):this.staticProperties.push(s)}this.staticStride=0,this.staticBuffer=null,this.staticData=null,this.staticDataUint32=null,this.dynamicStride=0,this.dynamicBuffer=null,this.dynamicData=null,this.dynamicDataUint32=null,this._updateID=0,this.initBuffers()}return r.prototype.initBuffers=function(){var e=this.geometry,t=0;this.indexBuffer=new At(Iv(this.size),!0,!0),e.addIndex(this.indexBuffer),this.dynamicStride=0;for(var i=0;i<this.dynamicProperties.length;++i){var n=this.dynamicProperties[i];n.offset=t,t+=n.size,this.dynamicStride+=n.size}var s=new ArrayBuffer(this.size*this.dynamicStride*4*4);this.dynamicData=new Float32Array(s),this.dynamicDataUint32=new Uint32Array(s),this.dynamicBuffer=new At(this.dynamicData,!1,!1);var a=0;this.staticStride=0;for(var i=0;i<this.staticProperties.length;++i){var n=this.staticProperties[i];n.offset=a,a+=n.size,this.staticStride+=n.size}var o=new ArrayBuffer(this.size*this.staticStride*4*4);this.staticData=new Float32Array(o),this.staticDataUint32=new Uint32Array(o),this.staticBuffer=new At(this.staticData,!0,!1);for(var i=0;i<this.dynamicProperties.length;++i){var n=this.dynamicProperties[i];e.addAttribute(n.attributeName,this.dynamicBuffer,0,n.type===k.UNSIGNED_BYTE,n.type,this.dynamicStride*4,n.offset*4)}for(var i=0;i<this.staticProperties.length;++i){var n=this.staticProperties[i];e.addAttribute(n.attributeName,this.staticBuffer,0,n.type===k.UNSIGNED_BYTE,n.type,this.staticStride*4,n.offset*4)}},r.prototype.uploadDynamic=function(e,t,i){for(var n=0;n<this.dynamicProperties.length;n++){var s=this.dynamicProperties[n];s.uploadFunction(e,t,i,s.type===k.UNSIGNED_BYTE?this.dynamicDataUint32:this.dynamicData,this.dynamicStride,s.offset)}this.dynamicBuffer._updateID++},r.prototype.uploadStatic=function(e,t,i){for(var n=0;n<this.staticProperties.length;n++){var s=this.staticProperties[n];s.uploadFunction(e,t,i,s.type===k.UNSIGNED_BYTE?this.staticDataUint32:this.staticData,this.staticStride,s.offset)}this.staticBuffer._updateID++},r.prototype.destroy=function(){this.indexBuffer=null,this.dynamicProperties=null,this.dynamicBuffer=null,this.dynamicData=null,this.dynamicDataUint32=null,this.staticProperties=null,this.staticBuffer=null,this.staticData=null,this.staticDataUint32=null,this.geometry.destroy()},r}(),pg=`varying vec2 vTextureCoord;
495
+ `,fm=function(){function r(){}return r.create=function(e){var t=Object.assign({vertex:Yh,fragment:jh,geometryClass:zh,vertexSize:6},e),i=t.vertex,n=t.fragment,s=t.vertexSize,a=t.geometryClass;return function(o){ht(h,o);function h(u){var l=o.call(this,u)||this;return l.shaderGenerator=new lm(i,n),l.geometryClass=a,l.vertexSize=s,l}return h}(um)},Object.defineProperty(r,"defaultVertexSrc",{get:function(){return Yh},enumerable:!1,configurable:!0}),Object.defineProperty(r,"defaultFragmentTemplate",{get:function(){return jh},enumerable:!1,configurable:!0}),r}(),Zh=fm.create();Object.assign(Zh,{extension:{name:"batch",type:nt.RendererPlugin}});var cm={accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:null,accessibleType:"button",accessiblePointerEvents:"auto",accessibleChildren:!0,renderId:-1};Tt.mixin(cm);var dm=9,Tn=100,pm=0,vm=0,qh=2,Kh=1,_m=-1e3,mm=-1e3,gm=2,ym=function(){function r(e){this.debug=!1,this._isActive=!1,this._isMobileAccessibility=!1,this.pool=[],this.renderId=0,this.children=[],this.androidUpdateCount=0,this.androidUpdateFrequency=500,this._hookDiv=null,(Oe.tablet||Oe.phone)&&this.createTouchHook();var t=document.createElement("div");t.style.width=Tn+"px",t.style.height=Tn+"px",t.style.position="absolute",t.style.top=pm+"px",t.style.left=vm+"px",t.style.zIndex=qh.toString(),this.div=t,this.renderer=e,this._onKeyDown=this._onKeyDown.bind(this),this._onMouseMove=this._onMouseMove.bind(this),globalThis.addEventListener("keydown",this._onKeyDown,!1)}return Object.defineProperty(r.prototype,"isActive",{get:function(){return this._isActive},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"isMobileAccessibility",{get:function(){return this._isMobileAccessibility},enumerable:!1,configurable:!0}),r.prototype.createTouchHook=function(){var e=this,t=document.createElement("button");t.style.width=Kh+"px",t.style.height=Kh+"px",t.style.position="absolute",t.style.top=_m+"px",t.style.left=mm+"px",t.style.zIndex=gm.toString(),t.style.backgroundColor="#FF0000",t.title="select to enable accessibility for this content",t.addEventListener("focus",function(){e._isMobileAccessibility=!0,e.activate(),e.destroyTouchHook()}),document.body.appendChild(t),this._hookDiv=t},r.prototype.destroyTouchHook=function(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)},r.prototype.activate=function(){var e;this._isActive||(this._isActive=!0,globalThis.document.addEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown,!1),this.renderer.on("postrender",this.update,this),(e=this.renderer.view.parentNode)===null||e===void 0||e.appendChild(this.div))},r.prototype.deactivate=function(){var e;!this._isActive||this._isMobileAccessibility||(this._isActive=!1,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.addEventListener("keydown",this._onKeyDown,!1),this.renderer.off("postrender",this.update),(e=this.div.parentNode)===null||e===void 0||e.removeChild(this.div))},r.prototype.updateAccessibleObjects=function(e){if(!(!e.visible||!e.accessibleChildren)){e.accessible&&e.interactive&&(e._accessibleActive||this.addChild(e),e.renderId=this.renderId);var t=e.children;if(t)for(var i=0;i<t.length;i++)this.updateAccessibleObjects(t[i])}},r.prototype.update=function(){var e=performance.now();if(!(Oe.android.device&&e<this.androidUpdateCount)&&(this.androidUpdateCount=e+this.androidUpdateFrequency,!!this.renderer.renderingToScreen)){this.renderer._lastObjectRendered&&this.updateAccessibleObjects(this.renderer._lastObjectRendered);var t=this.renderer.view.getBoundingClientRect(),i=t.left,n=t.top,s=t.width,a=t.height,o=this.renderer,h=o.width,u=o.height,l=o.resolution,f=s/h*l,c=a/u*l,d=this.div;d.style.left=i+"px",d.style.top=n+"px",d.style.width=h+"px",d.style.height=u+"px";for(var v=0;v<this.children.length;v++){var p=this.children[v];if(p.renderId!==this.renderId)p._accessibleActive=!1,Vi(this.children,v,1),this.div.removeChild(p._accessibleDiv),this.pool.push(p._accessibleDiv),p._accessibleDiv=null,v--;else{d=p._accessibleDiv;var _=p.hitArea,m=p.worldTransform;p.hitArea?(d.style.left=(m.tx+_.x*m.a)*f+"px",d.style.top=(m.ty+_.y*m.d)*c+"px",d.style.width=_.width*m.a*f+"px",d.style.height=_.height*m.d*c+"px"):(_=p.getBounds(),this.capHitArea(_),d.style.left=_.x*f+"px",d.style.top=_.y*c+"px",d.style.width=_.width*f+"px",d.style.height=_.height*c+"px",d.title!==p.accessibleTitle&&p.accessibleTitle!==null&&(d.title=p.accessibleTitle),d.getAttribute("aria-label")!==p.accessibleHint&&p.accessibleHint!==null&&d.setAttribute("aria-label",p.accessibleHint)),(p.accessibleTitle!==d.title||p.tabIndex!==d.tabIndex)&&(d.title=p.accessibleTitle,d.tabIndex=p.tabIndex,this.debug&&this.updateDebugHTML(d))}}this.renderId++}},r.prototype.updateDebugHTML=function(e){e.innerHTML="type: "+e.type+"</br> title : "+e.title+"</br> tabIndex: "+e.tabIndex},r.prototype.capHitArea=function(e){e.x<0&&(e.width+=e.x,e.x=0),e.y<0&&(e.height+=e.y,e.y=0);var t=this.renderer,i=t.width,n=t.height;e.x+e.width>i&&(e.width=i-e.x),e.y+e.height>n&&(e.height=n-e.y)},r.prototype.addChild=function(e){var t=this.pool.pop();t||(t=document.createElement("button"),t.style.width=Tn+"px",t.style.height=Tn+"px",t.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",t.style.position="absolute",t.style.zIndex=qh.toString(),t.style.borderStyle="none",navigator.userAgent.toLowerCase().indexOf("chrome")>-1?t.setAttribute("aria-live","off"):t.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?t.setAttribute("aria-relevant","additions"):t.setAttribute("aria-relevant","text"),t.addEventListener("click",this._onClick.bind(this)),t.addEventListener("focus",this._onFocus.bind(this)),t.addEventListener("focusout",this._onFocusOut.bind(this))),t.style.pointerEvents=e.accessiblePointerEvents,t.type=e.accessibleType,e.accessibleTitle&&e.accessibleTitle!==null?t.title=e.accessibleTitle:(!e.accessibleHint||e.accessibleHint===null)&&(t.title="displayObject "+e.tabIndex),e.accessibleHint&&e.accessibleHint!==null&&t.setAttribute("aria-label",e.accessibleHint),this.debug&&this.updateDebugHTML(t),e._accessibleActive=!0,e._accessibleDiv=t,t.displayObject=e,this.children.push(e),this.div.appendChild(e._accessibleDiv),e._accessibleDiv.tabIndex=e.tabIndex},r.prototype._onClick=function(e){var t=this.renderer.plugins.interaction,i=e.target.displayObject,n=t.eventData;t.dispatchEvent(i,"click",n),t.dispatchEvent(i,"pointertap",n),t.dispatchEvent(i,"tap",n)},r.prototype._onFocus=function(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","assertive");var t=this.renderer.plugins.interaction,i=e.target.displayObject,n=t.eventData;t.dispatchEvent(i,"mouseover",n)},r.prototype._onFocusOut=function(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","polite");var t=this.renderer.plugins.interaction,i=e.target.displayObject,n=t.eventData;t.dispatchEvent(i,"mouseout",n)},r.prototype._onKeyDown=function(e){e.keyCode===dm&&this.activate()},r.prototype._onMouseMove=function(e){e.movementX===0&&e.movementY===0||this.deactivate()},r.prototype.destroy=function(){this.destroyTouchHook(),this.div=null,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown),this.pool=null,this.children=null,this.renderer=null},r.extension={name:"accessibility",type:[nt.RendererPlugin,nt.CanvasRendererPlugin]},r}();var $h=function(){function r(){this.pressure=0,this.rotationAngle=0,this.twist=0,this.tangentialPressure=0,this.global=new j,this.target=null,this.originalEvent=null,this.identifier=null,this.isPrimary=!1,this.button=0,this.buttons=0,this.width=0,this.height=0,this.tiltX=0,this.tiltY=0,this.pointerType=null,this.pressure=0,this.rotationAngle=0,this.twist=0,this.tangentialPressure=0}return Object.defineProperty(r.prototype,"pointerId",{get:function(){return this.identifier},enumerable:!1,configurable:!0}),r.prototype.getLocalPosition=function(e,t,i){return e.worldTransform.applyInverse(i||this.global,t)},r.prototype.copyEvent=function(e){"isPrimary"in e&&e.isPrimary&&(this.isPrimary=!0),this.button="button"in e&&e.button;var t="buttons"in e&&e.buttons;this.buttons=Number.isInteger(t)?t:"which"in e&&e.which,this.width="width"in e&&e.width,this.height="height"in e&&e.height,this.tiltX="tiltX"in e&&e.tiltX,this.tiltY="tiltY"in e&&e.tiltY,this.pointerType="pointerType"in e&&e.pointerType,this.pressure="pressure"in e&&e.pressure,this.rotationAngle="rotationAngle"in e&&e.rotationAngle,this.twist="twist"in e&&e.twist||0,this.tangentialPressure="tangentialPressure"in e&&e.tangentialPressure||0},r.prototype.reset=function(){this.isPrimary=!1},r}();var Js=function(r,e){return Js=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},Js(r,e)};function xm(r,e){Js(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var bm=function(){function r(){this.stopped=!1,this.stopsPropagatingAt=null,this.stopPropagationHint=!1,this.target=null,this.currentTarget=null,this.type=null,this.data=null}return r.prototype.stopPropagation=function(){this.stopped=!0,this.stopPropagationHint=!0,this.stopsPropagatingAt=this.currentTarget},r.prototype.reset=function(){this.stopped=!1,this.stopsPropagatingAt=null,this.stopPropagationHint=!1,this.currentTarget=null,this.target=null},r}(),Qs=function(){function r(e){this._pointerId=e,this._flags=r.FLAGS.NONE}return r.prototype._doSet=function(e,t){t?this._flags=this._flags|e:this._flags=this._flags&~e},Object.defineProperty(r.prototype,"pointerId",{get:function(){return this._pointerId},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"flags",{get:function(){return this._flags},set:function(e){this._flags=e},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"none",{get:function(){return this._flags===r.FLAGS.NONE},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"over",{get:function(){return(this._flags&r.FLAGS.OVER)!==0},set:function(e){this._doSet(r.FLAGS.OVER,e)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"rightDown",{get:function(){return(this._flags&r.FLAGS.RIGHT_DOWN)!==0},set:function(e){this._doSet(r.FLAGS.RIGHT_DOWN,e)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"leftDown",{get:function(){return(this._flags&r.FLAGS.LEFT_DOWN)!==0},set:function(e){this._doSet(r.FLAGS.LEFT_DOWN,e)},enumerable:!1,configurable:!0}),r.FLAGS=Object.freeze({NONE:0,OVER:1<<0,LEFT_DOWN:1<<1,RIGHT_DOWN:1<<2}),r}(),Tm=function(){function r(){this._tempPoint=new j}return r.prototype.recursiveFindHit=function(e,t,i,n,s){var a;if(!t||!t.visible)return!1;var o=e.data.global;s=t.interactive||s;var h=!1,u=s,l=!0;if(t.hitArea)n&&(t.worldTransform.applyInverse(o,this._tempPoint),t.hitArea.contains(this._tempPoint.x,this._tempPoint.y)?h=!0:(n=!1,l=!1)),u=!1;else if(t._mask&&n){var f=t._mask.isMaskData?t._mask.maskObject:t._mask;f&&!(!((a=f.containsPoint)===null||a===void 0)&&a.call(f,o))&&(n=!1)}if(l&&t.interactiveChildren&&t.children)for(var c=t.children,d=c.length-1;d>=0;d--){var v=c[d],p=this.recursiveFindHit(e,v,i,n,u);if(p){if(!v.parent)continue;u=!1,p&&(e.target&&(n=!1),h=!0)}}return s&&(n&&!e.target&&!t.hitArea&&t.containsPoint&&t.containsPoint(o)&&(h=!0),t.interactive&&(h&&!e.target&&(e.target=t),i&&i(e,t,!!h))),h},r.prototype.findHit=function(e,t,i,n){this.recursiveFindHit(e,t,i,n,!1)},r}(),wm={interactive:!1,interactiveChildren:!0,hitArea:null,get buttonMode(){return this.cursor==="pointer"},set buttonMode(r){r?this.cursor="pointer":this.cursor==="pointer"&&(this.cursor=null)},cursor:null,get trackedPointers(){return this._trackedPointers===void 0&&(this._trackedPointers={}),this._trackedPointers},_trackedPointers:void 0};Tt.mixin(wm);var wn=1,En={target:null,data:{global:null}},Em=function(r){xm(e,r);function e(t,i){var n=r.call(this)||this;return i=i||{},n.renderer=t,n.autoPreventDefault=i.autoPreventDefault!==void 0?i.autoPreventDefault:!0,n.interactionFrequency=i.interactionFrequency||10,n.mouse=new $h,n.mouse.identifier=wn,n.mouse.global.set(-999999),n.activeInteractionData={},n.activeInteractionData[wn]=n.mouse,n.interactionDataPool=[],n.eventData=new bm,n.interactionDOMElement=null,n.moveWhenInside=!1,n.eventsAdded=!1,n.tickerAdded=!1,n.mouseOverRenderer=!("PointerEvent"in globalThis),n.supportsTouchEvents="ontouchstart"in globalThis,n.supportsPointerEvents=!!globalThis.PointerEvent,n.onPointerUp=n.onPointerUp.bind(n),n.processPointerUp=n.processPointerUp.bind(n),n.onPointerCancel=n.onPointerCancel.bind(n),n.processPointerCancel=n.processPointerCancel.bind(n),n.onPointerDown=n.onPointerDown.bind(n),n.processPointerDown=n.processPointerDown.bind(n),n.onPointerMove=n.onPointerMove.bind(n),n.processPointerMove=n.processPointerMove.bind(n),n.onPointerOut=n.onPointerOut.bind(n),n.processPointerOverOut=n.processPointerOverOut.bind(n),n.onPointerOver=n.onPointerOver.bind(n),n.cursorStyles={default:"inherit",pointer:"pointer"},n.currentCursorMode=null,n.cursor=null,n.resolution=1,n.delayedEvents=[],n.search=new Tm,n._tempDisplayObject=new gh,n._eventListenerOptions={capture:!0,passive:!1},n._useSystemTicker=i.useSystemTicker!==void 0?i.useSystemTicker:!0,n.setTargetElement(n.renderer.view,n.renderer.resolution),n}return Object.defineProperty(e.prototype,"useSystemTicker",{get:function(){return this._useSystemTicker},set:function(t){this._useSystemTicker=t,t?this.addTickerListener():this.removeTickerListener()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastObjectRendered",{get:function(){return this.renderer._lastObjectRendered||this._tempDisplayObject},enumerable:!1,configurable:!0}),e.prototype.hitTest=function(t,i){return En.target=null,En.data.global=t,i||(i=this.lastObjectRendered),this.processInteractive(En,i,null,!0),En.target},e.prototype.setTargetElement=function(t,i){i===void 0&&(i=1),this.removeTickerListener(),this.removeEvents(),this.interactionDOMElement=t,this.resolution=i,this.addEvents(),this.addTickerListener()},e.prototype.addTickerListener=function(){this.tickerAdded||!this.interactionDOMElement||!this._useSystemTicker||(Ft.system.add(this.tickerUpdate,this,re.INTERACTION),this.tickerAdded=!0)},e.prototype.removeTickerListener=function(){this.tickerAdded&&(Ft.system.remove(this.tickerUpdate,this),this.tickerAdded=!1)},e.prototype.addEvents=function(){if(!(this.eventsAdded||!this.interactionDOMElement)){var t=this.interactionDOMElement.style;globalThis.navigator.msPointerEnabled?(t.msContentZooming="none",t.msTouchAction="none"):this.supportsPointerEvents&&(t.touchAction="none"),this.supportsPointerEvents?(globalThis.document.addEventListener("pointermove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerdown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerleave",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerover",this.onPointerOver,this._eventListenerOptions),globalThis.addEventListener("pointercancel",this.onPointerCancel,this._eventListenerOptions),globalThis.addEventListener("pointerup",this.onPointerUp,this._eventListenerOptions)):(globalThis.document.addEventListener("mousemove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mousedown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mouseout",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mouseover",this.onPointerOver,this._eventListenerOptions),globalThis.addEventListener("mouseup",this.onPointerUp,this._eventListenerOptions)),this.supportsTouchEvents&&(this.interactionDOMElement.addEventListener("touchstart",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchcancel",this.onPointerCancel,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchend",this.onPointerUp,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchmove",this.onPointerMove,this._eventListenerOptions)),this.eventsAdded=!0}},e.prototype.removeEvents=function(){if(!(!this.eventsAdded||!this.interactionDOMElement)){var t=this.interactionDOMElement.style;globalThis.navigator.msPointerEnabled?(t.msContentZooming="",t.msTouchAction=""):this.supportsPointerEvents&&(t.touchAction=""),this.supportsPointerEvents?(globalThis.document.removeEventListener("pointermove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerdown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerleave",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerover",this.onPointerOver,this._eventListenerOptions),globalThis.removeEventListener("pointercancel",this.onPointerCancel,this._eventListenerOptions),globalThis.removeEventListener("pointerup",this.onPointerUp,this._eventListenerOptions)):(globalThis.document.removeEventListener("mousemove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mousedown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mouseout",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mouseover",this.onPointerOver,this._eventListenerOptions),globalThis.removeEventListener("mouseup",this.onPointerUp,this._eventListenerOptions)),this.supportsTouchEvents&&(this.interactionDOMElement.removeEventListener("touchstart",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchcancel",this.onPointerCancel,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchend",this.onPointerUp,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchmove",this.onPointerMove,this._eventListenerOptions)),this.interactionDOMElement=null,this.eventsAdded=!1}},e.prototype.tickerUpdate=function(t){this._deltaTime+=t,!(this._deltaTime<this.interactionFrequency)&&(this._deltaTime=0,this.update())},e.prototype.update=function(){if(this.interactionDOMElement){if(this._didMove){this._didMove=!1;return}this.cursor=null;for(var t in this.activeInteractionData)if(this.activeInteractionData.hasOwnProperty(t)){var i=this.activeInteractionData[t];if(i.originalEvent&&i.pointerType!=="touch"){var n=this.configureInteractionEventForDOMEvent(this.eventData,i.originalEvent,i);this.processInteractive(n,this.lastObjectRendered,this.processPointerOverOut,!0)}}this.setCursorMode(this.cursor)}},e.prototype.setCursorMode=function(t){t=t||"default";var i=!0;if(globalThis.OffscreenCanvas&&this.interactionDOMElement instanceof OffscreenCanvas&&(i=!1),this.currentCursorMode!==t){this.currentCursorMode=t;var n=this.cursorStyles[t];if(n)switch(typeof n){case"string":i&&(this.interactionDOMElement.style.cursor=n);break;case"function":n(t);break;case"object":i&&Object.assign(this.interactionDOMElement.style,n);break}else i&&typeof t=="string"&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,t)&&(this.interactionDOMElement.style.cursor=t)}},e.prototype.dispatchEvent=function(t,i,n){(!n.stopPropagationHint||t===n.stopsPropagatingAt)&&(n.currentTarget=t,n.type=i,t.emit(i,n),t[i]&&t[i](n))},e.prototype.delayDispatchEvent=function(t,i,n){this.delayedEvents.push({displayObject:t,eventString:i,eventData:n})},e.prototype.mapPositionToPoint=function(t,i,n){var s;this.interactionDOMElement.parentElement?s=this.interactionDOMElement.getBoundingClientRect():s={x:0,y:0,width:this.interactionDOMElement.width,height:this.interactionDOMElement.height,left:0,top:0};var a=1/this.resolution;t.x=(i-s.left)*(this.interactionDOMElement.width/s.width)*a,t.y=(n-s.top)*(this.interactionDOMElement.height/s.height)*a},e.prototype.processInteractive=function(t,i,n,s){var a=this.search.findHit(t,i,n,s),o=this.delayedEvents;if(!o.length)return a;t.stopPropagationHint=!1;var h=o.length;this.delayedEvents=[];for(var u=0;u<h;u++){var l=o[u],f=l.displayObject,c=l.eventString,d=l.eventData;d.stopsPropagatingAt===f&&(d.stopPropagationHint=!0),this.dispatchEvent(f,c,d)}return a},e.prototype.onPointerDown=function(t){if(!(this.supportsTouchEvents&&t.pointerType==="touch")){var i=this.normalizeToPointerData(t);if(this.autoPreventDefault&&i[0].isNormalized){var n=t.cancelable||!("cancelable"in t);n&&t.preventDefault()}for(var s=i.length,a=0;a<s;a++){var o=i[a],h=this.getInteractionDataForPointerId(o),u=this.configureInteractionEventForDOMEvent(this.eventData,o,h);if(u.data.originalEvent=t,this.processInteractive(u,this.lastObjectRendered,this.processPointerDown,!0),this.emit("pointerdown",u),o.pointerType==="touch")this.emit("touchstart",u);else if(o.pointerType==="mouse"||o.pointerType==="pen"){var l=o.button===2;this.emit(l?"rightdown":"mousedown",this.eventData)}}}},e.prototype.processPointerDown=function(t,i,n){var s=t.data,a=t.data.identifier;if(n){if(i.trackedPointers[a]||(i.trackedPointers[a]=new Qs(a)),this.dispatchEvent(i,"pointerdown",t),s.pointerType==="touch")this.dispatchEvent(i,"touchstart",t);else if(s.pointerType==="mouse"||s.pointerType==="pen"){var o=s.button===2;o?i.trackedPointers[a].rightDown=!0:i.trackedPointers[a].leftDown=!0,this.dispatchEvent(i,o?"rightdown":"mousedown",t)}}},e.prototype.onPointerComplete=function(t,i,n){var s=this.normalizeToPointerData(t),a=s.length,o=t.target;t.composedPath&&t.composedPath().length>0&&(o=t.composedPath()[0]);for(var h=o!==this.interactionDOMElement?"outside":"",u=0;u<a;u++){var l=s[u],f=this.getInteractionDataForPointerId(l),c=this.configureInteractionEventForDOMEvent(this.eventData,l,f);if(c.data.originalEvent=t,this.processInteractive(c,this.lastObjectRendered,n,i||!h),this.emit(i?"pointercancel":"pointerup"+h,c),l.pointerType==="mouse"||l.pointerType==="pen"){var d=l.button===2;this.emit(d?"rightup"+h:"mouseup"+h,c)}else l.pointerType==="touch"&&(this.emit(i?"touchcancel":"touchend"+h,c),this.releaseInteractionDataForPointerId(l.pointerId))}},e.prototype.onPointerCancel=function(t){this.supportsTouchEvents&&t.pointerType==="touch"||this.onPointerComplete(t,!0,this.processPointerCancel)},e.prototype.processPointerCancel=function(t,i){var n=t.data,s=t.data.identifier;i.trackedPointers[s]!==void 0&&(delete i.trackedPointers[s],this.dispatchEvent(i,"pointercancel",t),n.pointerType==="touch"&&this.dispatchEvent(i,"touchcancel",t))},e.prototype.onPointerUp=function(t){this.supportsTouchEvents&&t.pointerType==="touch"||this.onPointerComplete(t,!1,this.processPointerUp)},e.prototype.processPointerUp=function(t,i,n){var s=t.data,a=t.data.identifier,o=i.trackedPointers[a],h=s.pointerType==="touch",u=s.pointerType==="mouse"||s.pointerType==="pen",l=!1;if(u){var f=s.button===2,c=Qs.FLAGS,d=f?c.RIGHT_DOWN:c.LEFT_DOWN,v=o!==void 0&&o.flags&d;n?(this.dispatchEvent(i,f?"rightup":"mouseup",t),v&&(this.dispatchEvent(i,f?"rightclick":"click",t),l=!0)):v&&this.dispatchEvent(i,f?"rightupoutside":"mouseupoutside",t),o&&(f?o.rightDown=!1:o.leftDown=!1)}n?(this.dispatchEvent(i,"pointerup",t),h&&this.dispatchEvent(i,"touchend",t),o&&((!u||l)&&this.dispatchEvent(i,"pointertap",t),h&&(this.dispatchEvent(i,"tap",t),o.over=!1))):o&&(this.dispatchEvent(i,"pointerupoutside",t),h&&this.dispatchEvent(i,"touchendoutside",t)),o&&o.none&&delete i.trackedPointers[a]},e.prototype.onPointerMove=function(t){if(!(this.supportsTouchEvents&&t.pointerType==="touch")){var i=this.normalizeToPointerData(t);(i[0].pointerType==="mouse"||i[0].pointerType==="pen")&&(this._didMove=!0,this.cursor=null);for(var n=i.length,s=0;s<n;s++){var a=i[s],o=this.getInteractionDataForPointerId(a),h=this.configureInteractionEventForDOMEvent(this.eventData,a,o);h.data.originalEvent=t,this.processInteractive(h,this.lastObjectRendered,this.processPointerMove,!0),this.emit("pointermove",h),a.pointerType==="touch"&&this.emit("touchmove",h),(a.pointerType==="mouse"||a.pointerType==="pen")&&this.emit("mousemove",h)}i[0].pointerType==="mouse"&&this.setCursorMode(this.cursor)}},e.prototype.processPointerMove=function(t,i,n){var s=t.data,a=s.pointerType==="touch",o=s.pointerType==="mouse"||s.pointerType==="pen";o&&this.processPointerOverOut(t,i,n),(!this.moveWhenInside||n)&&(this.dispatchEvent(i,"pointermove",t),a&&this.dispatchEvent(i,"touchmove",t),o&&this.dispatchEvent(i,"mousemove",t))},e.prototype.onPointerOut=function(t){if(!(this.supportsTouchEvents&&t.pointerType==="touch")){var i=this.normalizeToPointerData(t),n=i[0];n.pointerType==="mouse"&&(this.mouseOverRenderer=!1,this.setCursorMode(null));var s=this.getInteractionDataForPointerId(n),a=this.configureInteractionEventForDOMEvent(this.eventData,n,s);a.data.originalEvent=n,this.processInteractive(a,this.lastObjectRendered,this.processPointerOverOut,!1),this.emit("pointerout",a),n.pointerType==="mouse"||n.pointerType==="pen"?this.emit("mouseout",a):this.releaseInteractionDataForPointerId(s.identifier)}},e.prototype.processPointerOverOut=function(t,i,n){var s=t.data,a=t.data.identifier,o=s.pointerType==="mouse"||s.pointerType==="pen",h=i.trackedPointers[a];n&&!h&&(h=i.trackedPointers[a]=new Qs(a)),h!==void 0&&(n&&this.mouseOverRenderer?(h.over||(h.over=!0,this.delayDispatchEvent(i,"pointerover",t),o&&this.delayDispatchEvent(i,"mouseover",t)),o&&this.cursor===null&&(this.cursor=i.cursor)):h.over&&(h.over=!1,this.dispatchEvent(i,"pointerout",this.eventData),o&&this.dispatchEvent(i,"mouseout",t),h.none&&delete i.trackedPointers[a]))},e.prototype.onPointerOver=function(t){if(!(this.supportsTouchEvents&&t.pointerType==="touch")){var i=this.normalizeToPointerData(t),n=i[0],s=this.getInteractionDataForPointerId(n),a=this.configureInteractionEventForDOMEvent(this.eventData,n,s);a.data.originalEvent=n,n.pointerType==="mouse"&&(this.mouseOverRenderer=!0),this.emit("pointerover",a),(n.pointerType==="mouse"||n.pointerType==="pen")&&this.emit("mouseover",a)}},e.prototype.getInteractionDataForPointerId=function(t){var i=t.pointerId,n;return i===wn||t.pointerType==="mouse"?n=this.mouse:this.activeInteractionData[i]?n=this.activeInteractionData[i]:(n=this.interactionDataPool.pop()||new $h,n.identifier=i,this.activeInteractionData[i]=n),n.copyEvent(t),n},e.prototype.releaseInteractionDataForPointerId=function(t){var i=this.activeInteractionData[t];i&&(delete this.activeInteractionData[t],i.reset(),this.interactionDataPool.push(i))},e.prototype.configureInteractionEventForDOMEvent=function(t,i,n){return t.data=n,this.mapPositionToPoint(n.global,i.clientX,i.clientY),i.pointerType==="touch"&&(i.globalX=n.global.x,i.globalY=n.global.y),n.originalEvent=i,t.reset(),t},e.prototype.normalizeToPointerData=function(t){var i=[];if(this.supportsTouchEvents&&t instanceof TouchEvent)for(var n=0,s=t.changedTouches.length;n<s;n++){var a=t.changedTouches[n];typeof a.button>"u"&&(a.button=t.touches.length?1:0),typeof a.buttons>"u"&&(a.buttons=t.touches.length?1:0),typeof a.isPrimary>"u"&&(a.isPrimary=t.touches.length===1&&t.type==="touchstart"),typeof a.width>"u"&&(a.width=a.radiusX||1),typeof a.height>"u"&&(a.height=a.radiusY||1),typeof a.tiltX>"u"&&(a.tiltX=0),typeof a.tiltY>"u"&&(a.tiltY=0),typeof a.pointerType>"u"&&(a.pointerType="touch"),typeof a.pointerId>"u"&&(a.pointerId=a.identifier||0),typeof a.pressure>"u"&&(a.pressure=a.force||.5),typeof a.twist>"u"&&(a.twist=0),typeof a.tangentialPressure>"u"&&(a.tangentialPressure=0),typeof a.layerX>"u"&&(a.layerX=a.offsetX=a.clientX),typeof a.layerY>"u"&&(a.layerY=a.offsetY=a.clientY),a.isNormalized=!0,i.push(a)}else if(!globalThis.MouseEvent||t instanceof MouseEvent&&(!this.supportsPointerEvents||!(t instanceof globalThis.PointerEvent))){var o=t;typeof o.isPrimary>"u"&&(o.isPrimary=!0),typeof o.width>"u"&&(o.width=1),typeof o.height>"u"&&(o.height=1),typeof o.tiltX>"u"&&(o.tiltX=0),typeof o.tiltY>"u"&&(o.tiltY=0),typeof o.pointerType>"u"&&(o.pointerType="mouse"),typeof o.pointerId>"u"&&(o.pointerId=wn),typeof o.pressure>"u"&&(o.pressure=.5),typeof o.twist>"u"&&(o.twist=0),typeof o.tangentialPressure>"u"&&(o.tangentialPressure=0),o.isNormalized=!0,i.push(o)}else i.push(t);return i},e.prototype.destroy=function(){this.removeEvents(),this.removeTickerListener(),this.removeAllListeners(),this.renderer=null,this.mouse=null,this.eventData=null,this.interactionDOMElement=null,this.onPointerDown=null,this.processPointerDown=null,this.onPointerUp=null,this.processPointerUp=null,this.onPointerCancel=null,this.processPointerCancel=null,this.onPointerMove=null,this.processPointerMove=null,this.onPointerOut=null,this.processPointerOverOut=null,this.onPointerOver=null,this.search=null},e.extension={name:"interaction",type:[nt.RendererPlugin,nt.CanvasRendererPlugin]},e}(pr);var Jh=new q,Qh=4,Sm=function(){function r(e){this.renderer=e}return r.prototype.image=function(e,t,i){var n=new Image;return n.src=this.base64(e,t,i),n},r.prototype.base64=function(e,t,i){return this.canvas(e).toDataURL(t,i)},r.prototype.canvas=function(e,t){var i=this.renderer,n,s=!1,a,o=!1;e&&(e instanceof bi?a=e:(a=this.renderer.generateTexture(e),o=!0)),a?(n=a.baseTexture.resolution,t=t??a.frame,s=!1,i.renderTexture.bind(a)):(n=i.resolution,t||(t=Jh,t.width=i.width,t.height=i.height),s=!0,i.renderTexture.bind(null));var h=Math.round(t.width*n),u=Math.round(t.height*n),l=new mh(h,u,1),f=new Uint8Array(Qh*h*u),c=i.gl;c.readPixels(Math.round(t.x*n),Math.round(t.y*n),h,u,c.RGBA,c.UNSIGNED_BYTE,f);var d=l.context.getImageData(0,0,h,u);if(r.arrayPostDivide(f,d.data),l.context.putImageData(d,0,0),s){var v=new mh(l.width,l.height,1);v.context.scale(1,-1),v.context.drawImage(l.canvas,0,-u),l.destroy(),l=v}return o&&a.destroy(!0),l.canvas},r.prototype.pixels=function(e,t){var i=this.renderer,n,s,a=!1;e&&(e instanceof bi?s=e:(s=this.renderer.generateTexture(e),a=!0)),s?(n=s.baseTexture.resolution,t=t??s.frame,i.renderTexture.bind(s)):(n=i.resolution,t||(t=Jh,t.width=i.width,t.height=i.height),i.renderTexture.bind(null));var o=Math.round(t.width*n),h=Math.round(t.height*n),u=new Uint8Array(Qh*o*h),l=i.gl;return l.readPixels(Math.round(t.x*n),Math.round(t.y*n),o,h,l.RGBA,l.UNSIGNED_BYTE,u),a&&s.destroy(!0),r.arrayPostDivide(u,u),u},r.prototype.destroy=function(){this.renderer=null},r.arrayPostDivide=function(e,t){for(var i=0;i<e.length;i+=4){var n=t[i+3]=e[i+3];n!==0?(t[i]=Math.round(Math.min(e[i]*255/n,255)),t[i+1]=Math.round(Math.min(e[i+1]*255/n,255)),t[i+2]=Math.round(Math.min(e[i+2]*255/n,255))):(t[i]=e[i],t[i+1]=e[i+1],t[i+2]=e[i+2])}},r.extension={name:"extract",type:nt.RendererPlugin},r}();var Sn=function(){function r(e,t,i){t===void 0&&(t=!1),this._fn=e,this._once=t,this._thisArg=i,this._next=this._prev=this._owner=null}return r.prototype.detach=function(){return this._owner===null?!1:(this._owner.detach(this),!0)},r}();function tu(r,e){return r._head?(r._tail._next=e,e._prev=r._tail,r._tail=e):(r._head=e,r._tail=e),e._owner=r,e}var ke=function(){function r(){this._head=this._tail=void 0}return r.prototype.handlers=function(e){e===void 0&&(e=!1);var t=this._head;if(e)return!!t;for(var i=[];t;)i.push(t),t=t._next;return i},r.prototype.has=function(e){if(!(e instanceof Sn))throw new Error("MiniSignal#has(): First arg must be a SignalBinding object.");return e._owner===this},r.prototype.dispatch=function(){for(var e=arguments,t=[],i=0;i<arguments.length;i++)t[i]=e[i];var n=this._head;if(!n)return!1;for(;n;)n._once&&this.detach(n),n._fn.apply(n._thisArg,t),n=n._next;return!0},r.prototype.add=function(e,t){if(t===void 0&&(t=null),typeof e!="function")throw new Error("MiniSignal#add(): First arg must be a Function.");return tu(this,new Sn(e,!1,t))},r.prototype.once=function(e,t){if(t===void 0&&(t=null),typeof e!="function")throw new Error("MiniSignal#once(): First arg must be a Function.");return tu(this,new Sn(e,!0,t))},r.prototype.detach=function(e){if(!(e instanceof Sn))throw new Error("MiniSignal#detach(): First arg must be a SignalBinding object.");return e._owner!==this?this:(e._prev&&(e._prev._next=e._next),e._next&&(e._next._prev=e._prev),e===this._head?(this._head=e._next,e._next===null&&(this._tail=null)):e===this._tail&&(this._tail=e._prev,this._tail._next=null),e._owner=null,this)},r.prototype.detachAll=function(){var e=this._head;if(!e)return this;for(this._head=this._tail=null;e;)e._owner=null,e=e._next;return this},r}();function eu(r,e){e=e||{};for(var t={key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}},i=t.parser[e.strictMode?"strict":"loose"].exec(r),n={},s=14;s--;)n[t.key[s]]=i[s]||"";return n[t.q.name]={},n[t.key[12]].replace(t.q.parser,function(a,o,h){o&&(n[t.q.name][o]=h)}),n}var ta,Pn=null,Pm=0,iu=200,Rm=204,Cm=1223,Om=2;function ru(){}function nu(r,e,t){e&&e.indexOf(".")===0&&(e=e.substring(1)),e&&(r[e]=t)}function ea(r){return r.toString().replace("object ","")}var xt=function(){function r(e,t,i){if(this._dequeue=ru,this._onLoadBinding=null,this._elementTimer=0,this._boundComplete=null,this._boundOnError=null,this._boundOnProgress=null,this._boundOnTimeout=null,this._boundXhrOnError=null,this._boundXhrOnTimeout=null,this._boundXhrOnAbort=null,this._boundXhrOnLoad=null,typeof e!="string"||typeof t!="string")throw new Error("Both name and url are required for constructing a resource.");i=i||{},this._flags=0,this._setFlag(r.STATUS_FLAGS.DATA_URL,t.indexOf("data:")===0),this.name=e,this.url=t,this.extension=this._getExtension(),this.data=null,this.crossOrigin=i.crossOrigin===!0?"anonymous":i.crossOrigin,this.timeout=i.timeout||0,this.loadType=i.loadType||this._determineLoadType(),this.xhrType=i.xhrType,this.metadata=i.metadata||{},this.error=null,this.xhr=null,this.children=[],this.type=r.TYPE.UNKNOWN,this.progressChunk=0,this._dequeue=ru,this._onLoadBinding=null,this._elementTimer=0,this._boundComplete=this.complete.bind(this),this._boundOnError=this._onError.bind(this),this._boundOnProgress=this._onProgress.bind(this),this._boundOnTimeout=this._onTimeout.bind(this),this._boundXhrOnError=this._xhrOnError.bind(this),this._boundXhrOnTimeout=this._xhrOnTimeout.bind(this),this._boundXhrOnAbort=this._xhrOnAbort.bind(this),this._boundXhrOnLoad=this._xhrOnLoad.bind(this),this.onStart=new ke,this.onProgress=new ke,this.onComplete=new ke,this.onAfterMiddleware=new ke}return r.setExtensionLoadType=function(e,t){nu(r._loadTypeMap,e,t)},r.setExtensionXhrType=function(e,t){nu(r._xhrTypeMap,e,t)},Object.defineProperty(r.prototype,"isDataUrl",{get:function(){return this._hasFlag(r.STATUS_FLAGS.DATA_URL)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"isComplete",{get:function(){return this._hasFlag(r.STATUS_FLAGS.COMPLETE)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"isLoading",{get:function(){return this._hasFlag(r.STATUS_FLAGS.LOADING)},enumerable:!1,configurable:!0}),r.prototype.complete=function(){this._clearEvents(),this._finish()},r.prototype.abort=function(e){if(!this.error){if(this.error=new Error(e),this._clearEvents(),this.xhr)this.xhr.abort();else if(this.xdr)this.xdr.abort();else if(this.data)if(this.data.src)this.data.src=r.EMPTY_GIF;else for(;this.data.firstChild;)this.data.removeChild(this.data.firstChild);this._finish()}},r.prototype.load=function(e){var t=this;if(!this.isLoading){if(this.isComplete){e&&setTimeout(function(){return e(t)},1);return}else e&&this.onComplete.once(e);switch(this._setFlag(r.STATUS_FLAGS.LOADING,!0),this.onStart.dispatch(this),(this.crossOrigin===!1||typeof this.crossOrigin!="string")&&(this.crossOrigin=this._determineCrossOrigin(this.url)),this.loadType){case r.LOAD_TYPE.IMAGE:this.type=r.TYPE.IMAGE,this._loadElement("image");break;case r.LOAD_TYPE.AUDIO:this.type=r.TYPE.AUDIO,this._loadSourceElement("audio");break;case r.LOAD_TYPE.VIDEO:this.type=r.TYPE.VIDEO,this._loadSourceElement("video");break;case r.LOAD_TYPE.XHR:default:typeof ta>"u"&&(ta=!!(globalThis.XDomainRequest&&!("withCredentials"in new XMLHttpRequest))),ta&&this.crossOrigin?this._loadXdr():this._loadXhr();break}}},r.prototype._hasFlag=function(e){return(this._flags&e)!==0},r.prototype._setFlag=function(e,t){this._flags=t?this._flags|e:this._flags&~e},r.prototype._clearEvents=function(){clearTimeout(this._elementTimer),this.data&&this.data.removeEventListener&&(this.data.removeEventListener("error",this._boundOnError,!1),this.data.removeEventListener("load",this._boundComplete,!1),this.data.removeEventListener("progress",this._boundOnProgress,!1),this.data.removeEventListener("canplaythrough",this._boundComplete,!1)),this.xhr&&(this.xhr.removeEventListener?(this.xhr.removeEventListener("error",this._boundXhrOnError,!1),this.xhr.removeEventListener("timeout",this._boundXhrOnTimeout,!1),this.xhr.removeEventListener("abort",this._boundXhrOnAbort,!1),this.xhr.removeEventListener("progress",this._boundOnProgress,!1),this.xhr.removeEventListener("load",this._boundXhrOnLoad,!1)):(this.xhr.onerror=null,this.xhr.ontimeout=null,this.xhr.onprogress=null,this.xhr.onload=null))},r.prototype._finish=function(){if(this.isComplete)throw new Error("Complete called again for an already completed resource.");this._setFlag(r.STATUS_FLAGS.COMPLETE,!0),this._setFlag(r.STATUS_FLAGS.LOADING,!1),this.onComplete.dispatch(this)},r.prototype._loadElement=function(e){this.metadata.loadElement?this.data=this.metadata.loadElement:e==="image"&&typeof globalThis.Image<"u"?this.data=new Image:this.data=document.createElement(e),this.crossOrigin&&(this.data.crossOrigin=this.crossOrigin),this.metadata.skipSource||(this.data.src=this.url),this.data.addEventListener("error",this._boundOnError,!1),this.data.addEventListener("load",this._boundComplete,!1),this.data.addEventListener("progress",this._boundOnProgress,!1),this.timeout&&(this._elementTimer=setTimeout(this._boundOnTimeout,this.timeout))},r.prototype._loadSourceElement=function(e){if(this.metadata.loadElement?this.data=this.metadata.loadElement:e==="audio"&&typeof globalThis.Audio<"u"?this.data=new Audio:this.data=document.createElement(e),this.data===null){this.abort("Unsupported element: "+e);return}if(this.crossOrigin&&(this.data.crossOrigin=this.crossOrigin),!this.metadata.skipSource)if(navigator.isCocoonJS)this.data.src=Array.isArray(this.url)?this.url[0]:this.url;else if(Array.isArray(this.url))for(var t=this.metadata.mimeType,i=0;i<this.url.length;++i)this.data.appendChild(this._createSource(e,this.url[i],Array.isArray(t)?t[i]:t));else{var t=this.metadata.mimeType;this.data.appendChild(this._createSource(e,this.url,Array.isArray(t)?t[0]:t))}this.data.addEventListener("error",this._boundOnError,!1),this.data.addEventListener("load",this._boundComplete,!1),this.data.addEventListener("progress",this._boundOnProgress,!1),this.data.addEventListener("canplaythrough",this._boundComplete,!1),this.data.load(),this.timeout&&(this._elementTimer=setTimeout(this._boundOnTimeout,this.timeout))},r.prototype._loadXhr=function(){typeof this.xhrType!="string"&&(this.xhrType=this._determineXhrType());var e=this.xhr=new XMLHttpRequest;this.crossOrigin==="use-credentials"&&(e.withCredentials=!0),e.open("GET",this.url,!0),e.timeout=this.timeout,this.xhrType===r.XHR_RESPONSE_TYPE.JSON||this.xhrType===r.XHR_RESPONSE_TYPE.DOCUMENT?e.responseType=r.XHR_RESPONSE_TYPE.TEXT:e.responseType=this.xhrType,e.addEventListener("error",this._boundXhrOnError,!1),e.addEventListener("timeout",this._boundXhrOnTimeout,!1),e.addEventListener("abort",this._boundXhrOnAbort,!1),e.addEventListener("progress",this._boundOnProgress,!1),e.addEventListener("load",this._boundXhrOnLoad,!1),e.send()},r.prototype._loadXdr=function(){typeof this.xhrType!="string"&&(this.xhrType=this._determineXhrType());var e=this.xhr=new globalThis.XDomainRequest;e.timeout=this.timeout||5e3,e.onerror=this._boundXhrOnError,e.ontimeout=this._boundXhrOnTimeout,e.onprogress=this._boundOnProgress,e.onload=this._boundXhrOnLoad,e.open("GET",this.url,!0),setTimeout(function(){return e.send()},1)},r.prototype._createSource=function(e,t,i){i||(i=e+"/"+this._getExtension(t));var n=document.createElement("source");return n.src=t,n.type=i,n},r.prototype._onError=function(e){this.abort("Failed to load element using: "+e.target.nodeName)},r.prototype._onProgress=function(e){e&&e.lengthComputable&&this.onProgress.dispatch(this,e.loaded/e.total)},r.prototype._onTimeout=function(){this.abort("Load timed out.")},r.prototype._xhrOnError=function(){var e=this.xhr;this.abort(ea(e)+" Request failed. Status: "+e.status+', text: "'+e.statusText+'"')},r.prototype._xhrOnTimeout=function(){var e=this.xhr;this.abort(ea(e)+" Request timed out.")},r.prototype._xhrOnAbort=function(){var e=this.xhr;this.abort(ea(e)+" Request was aborted by the user.")},r.prototype._xhrOnLoad=function(){var e=this.xhr,t="",i=typeof e.status>"u"?iu:e.status;(e.responseType===""||e.responseType==="text"||typeof e.responseType>"u")&&(t=e.responseText),i===Pm&&(t.length>0||e.responseType===r.XHR_RESPONSE_TYPE.BUFFER)?i=iu:i===Cm&&(i=Rm);var n=i/100|0;if(n===Om)if(this.xhrType===r.XHR_RESPONSE_TYPE.TEXT)this.data=t,this.type=r.TYPE.TEXT;else if(this.xhrType===r.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(t),this.type=r.TYPE.JSON}catch(o){this.abort("Error trying to parse loaded json: "+o);return}else if(this.xhrType===r.XHR_RESPONSE_TYPE.DOCUMENT)try{if(globalThis.DOMParser){var s=new DOMParser;this.data=s.parseFromString(t,"text/xml")}else{var a=document.createElement("div");a.innerHTML=t,this.data=a}this.type=r.TYPE.XML}catch(o){this.abort("Error trying to parse loaded xml: "+o);return}else this.data=e.response||t;else{this.abort("["+e.status+"] "+e.statusText+": "+e.responseURL);return}this.complete()},r.prototype._determineCrossOrigin=function(e,t){if(e.indexOf("data:")===0)return"";if(globalThis.origin!==globalThis.location.origin)return"anonymous";t=t||globalThis.location,Pn||(Pn=document.createElement("a")),Pn.href=e;var i=eu(Pn.href,{strictMode:!0}),n=!i.port&&t.port===""||i.port===t.port,s=i.protocol?i.protocol+":":"";return i.host!==t.hostname||!n||s!==t.protocol?"anonymous":""},r.prototype._determineXhrType=function(){return r._xhrTypeMap[this.extension]||r.XHR_RESPONSE_TYPE.TEXT},r.prototype._determineLoadType=function(){return r._loadTypeMap[this.extension]||r.LOAD_TYPE.XHR},r.prototype._getExtension=function(e){e===void 0&&(e=this.url);var t="";if(this.isDataUrl){var i=e.indexOf("/");t=e.substring(i+1,e.indexOf(";",i))}else{var n=e.indexOf("?"),s=e.indexOf("#"),a=Math.min(n>-1?n:e.length,s>-1?s:e.length);e=e.substring(0,a),t=e.substring(e.lastIndexOf(".")+1)}return t.toLowerCase()},r.prototype._getMimeFromXhrType=function(e){switch(e){case r.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case r.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case r.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case r.XHR_RESPONSE_TYPE.JSON:return"application/json";case r.XHR_RESPONSE_TYPE.DEFAULT:case r.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},r}();(function(r){(function(e){e[e.NONE=0]="NONE",e[e.DATA_URL=1]="DATA_URL",e[e.COMPLETE=2]="COMPLETE",e[e.LOADING=4]="LOADING"})(r.STATUS_FLAGS||(r.STATUS_FLAGS={})),function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.JSON=1]="JSON",e[e.XML=2]="XML",e[e.IMAGE=3]="IMAGE",e[e.AUDIO=4]="AUDIO",e[e.VIDEO=5]="VIDEO",e[e.TEXT=6]="TEXT"}(r.TYPE||(r.TYPE={})),function(e){e[e.XHR=1]="XHR",e[e.IMAGE=2]="IMAGE",e[e.AUDIO=3]="AUDIO",e[e.VIDEO=4]="VIDEO"}(r.LOAD_TYPE||(r.LOAD_TYPE={})),function(e){e.DEFAULT="text",e.BUFFER="arraybuffer",e.BLOB="blob",e.DOCUMENT="document",e.JSON="json",e.TEXT="text"}(r.XHR_RESPONSE_TYPE||(r.XHR_RESPONSE_TYPE={})),r._loadTypeMap={gif:r.LOAD_TYPE.IMAGE,png:r.LOAD_TYPE.IMAGE,bmp:r.LOAD_TYPE.IMAGE,jpg:r.LOAD_TYPE.IMAGE,jpeg:r.LOAD_TYPE.IMAGE,tif:r.LOAD_TYPE.IMAGE,tiff:r.LOAD_TYPE.IMAGE,webp:r.LOAD_TYPE.IMAGE,tga:r.LOAD_TYPE.IMAGE,avif:r.LOAD_TYPE.IMAGE,svg:r.LOAD_TYPE.IMAGE,"svg+xml":r.LOAD_TYPE.IMAGE,mp3:r.LOAD_TYPE.AUDIO,ogg:r.LOAD_TYPE.AUDIO,wav:r.LOAD_TYPE.AUDIO,mp4:r.LOAD_TYPE.VIDEO,webm:r.LOAD_TYPE.VIDEO},r._xhrTypeMap={xhtml:r.XHR_RESPONSE_TYPE.DOCUMENT,html:r.XHR_RESPONSE_TYPE.DOCUMENT,htm:r.XHR_RESPONSE_TYPE.DOCUMENT,xml:r.XHR_RESPONSE_TYPE.DOCUMENT,tmx:r.XHR_RESPONSE_TYPE.DOCUMENT,svg:r.XHR_RESPONSE_TYPE.DOCUMENT,tsx:r.XHR_RESPONSE_TYPE.DOCUMENT,gif:r.XHR_RESPONSE_TYPE.BLOB,png:r.XHR_RESPONSE_TYPE.BLOB,bmp:r.XHR_RESPONSE_TYPE.BLOB,jpg:r.XHR_RESPONSE_TYPE.BLOB,jpeg:r.XHR_RESPONSE_TYPE.BLOB,tif:r.XHR_RESPONSE_TYPE.BLOB,tiff:r.XHR_RESPONSE_TYPE.BLOB,webp:r.XHR_RESPONSE_TYPE.BLOB,tga:r.XHR_RESPONSE_TYPE.BLOB,avif:r.XHR_RESPONSE_TYPE.BLOB,json:r.XHR_RESPONSE_TYPE.JSON,text:r.XHR_RESPONSE_TYPE.TEXT,txt:r.XHR_RESPONSE_TYPE.TEXT,ttf:r.XHR_RESPONSE_TYPE.BUFFER,otf:r.XHR_RESPONSE_TYPE.BUFFER},r.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=="})(xt||(xt={}));function Si(){}function Am(r){return function(){for(var t=arguments,i=[],n=0;n<arguments.length;n++)i[n]=t[n];if(r===null)throw new Error("Callback was already called.");var s=r;r=null,s.apply(this,i)}}var Im=function(){function r(e,t){this.data=e,this.callback=t}return r}(),ia=function(){function r(e,t){var i=this;if(t===void 0&&(t=1),this.workers=0,this.saturated=Si,this.unsaturated=Si,this.empty=Si,this.drain=Si,this.error=Si,this.started=!1,this.paused=!1,this._tasks=[],this._insert=function(n,s,a){if(a&&typeof a!="function")throw new Error("task callback must be a function");if(i.started=!0,n==null&&i.idle()){setTimeout(function(){return i.drain()},1);return}var o=new Im(n,typeof a=="function"?a:Si);s?i._tasks.unshift(o):i._tasks.push(o),setTimeout(i.process,1)},this.process=function(){for(;!i.paused&&i.workers<i.concurrency&&i._tasks.length;){var n=i._tasks.shift();i._tasks.length===0&&i.empty(),i.workers+=1,i.workers===i.concurrency&&i.saturated(),i._worker(n.data,Am(i._next(n)))}},this._worker=e,t===0)throw new Error("Concurrency must not be zero");this.concurrency=t,this.buffer=t/4}return r.prototype._next=function(e){var t=this;return function(){for(var i=arguments,n=[],s=0;s<arguments.length;s++)n[s]=i[s];t.workers-=1,e.callback.apply(e,n),n[0]!=null&&t.error(n[0],e.data),t.workers<=t.concurrency-t.buffer&&t.unsaturated(),t.idle()&&t.drain(),t.process()}},r.prototype.push=function(e,t){this._insert(e,!1,t)},r.prototype.kill=function(){this.workers=0,this.drain=Si,this.started=!1,this._tasks=[]},r.prototype.unshift=function(e,t){this._insert(e,!0,t)},r.prototype.length=function(){return this._tasks.length},r.prototype.running=function(){return this.workers},r.prototype.idle=function(){return this._tasks.length+this.workers===0},r.prototype.pause=function(){this.paused!==!0&&(this.paused=!0)},r.prototype.resume=function(){if(this.paused!==!1){this.paused=!1;for(var e=1;e<=this.concurrency;e++)this.process()}},r.eachSeries=function(e,t,i,n){var s=0,a=e.length;function o(h){if(h||s===a){i&&i(h);return}n?setTimeout(function(){t(e[s++],o)},1):t(e[s++],o)}o()},r.queue=function(e,t){return new r(e,t)},r}(),ra=100,Mm=/(#[\w-]+)?$/,Rn=function(){function r(e,t){var i=this;e===void 0&&(e=""),t===void 0&&(t=10),this.progress=0,this.loading=!1,this.defaultQueryString="",this._beforeMiddleware=[],this._afterMiddleware=[],this._resourcesParsing=[],this._boundLoadResource=function(h,u){return i._loadResource(h,u)},this.resources={},this.baseUrl=e,this._beforeMiddleware=[],this._afterMiddleware=[],this._resourcesParsing=[],this._boundLoadResource=function(h,u){return i._loadResource(h,u)},this._queue=ia.queue(this._boundLoadResource,t),this._queue.pause(),this.resources={},this.onProgress=new ke,this.onError=new ke,this.onLoad=new ke,this.onStart=new ke,this.onComplete=new ke;for(var n=0;n<r._plugins.length;++n){var s=r._plugins[n],a=s.pre,o=s.use;a&&this.pre(a),o&&this.use(o)}this._protected=!1}return r.prototype._add=function(e,t,i,n){if(this.loading&&(!i||!i.parentResource))throw new Error("Cannot add resources while the loader is running.");if(this.resources[e])throw new Error('Resource named "'+e+'" already exists.');if(t=this._prepareUrl(t),this.resources[e]=new xt(e,t,i),typeof n=="function"&&this.resources[e].onAfterMiddleware.once(n),this.loading){for(var s=i.parentResource,a=[],o=0;o<s.children.length;++o)s.children[o].isComplete||a.push(s.children[o]);var h=s.progressChunk*(a.length+1),u=h/(a.length+2);s.children.push(this.resources[e]),s.progressChunk=u;for(var o=0;o<a.length;++o)a[o].progressChunk=u;this.resources[e].progressChunk=u}return this._queue.push(this.resources[e]),this},r.prototype.pre=function(e){return this._beforeMiddleware.push(e),this},r.prototype.use=function(e){return this._afterMiddleware.push(e),this},r.prototype.reset=function(){this.progress=0,this.loading=!1,this._queue.kill(),this._queue.pause();for(var e in this.resources){var t=this.resources[e];t._onLoadBinding&&t._onLoadBinding.detach(),t.isLoading&&t.abort("loader reset")}return this.resources={},this},r.prototype.load=function(e){if(ge("6.5.0","@pixi/loaders is being replaced with @pixi/assets in the next major release."),typeof e=="function"&&this.onComplete.once(e),this.loading)return this;if(this._queue.idle())this._onStart(),this._onComplete();else{for(var t=this._queue._tasks.length,i=ra/t,n=0;n<this._queue._tasks.length;++n)this._queue._tasks[n].data.progressChunk=i;this._onStart(),this._queue.resume()}return this},Object.defineProperty(r.prototype,"concurrency",{get:function(){return this._queue.concurrency},set:function(e){this._queue.concurrency=e},enumerable:!1,configurable:!0}),r.prototype._prepareUrl=function(e){var t=eu(e,{strictMode:!0}),i;if(t.protocol||!t.path||e.indexOf("//")===0?i=e:this.baseUrl.length&&this.baseUrl.lastIndexOf("/")!==this.baseUrl.length-1&&e.charAt(0)!=="/"?i=this.baseUrl+"/"+e:i=this.baseUrl+e,this.defaultQueryString){var n=Mm.exec(i)[0];i=i.slice(0,i.length-n.length),i.indexOf("?")!==-1?i+="&"+this.defaultQueryString:i+="?"+this.defaultQueryString,i+=n}return i},r.prototype._loadResource=function(e,t){var i=this;e._dequeue=t,ia.eachSeries(this._beforeMiddleware,function(n,s){n.call(i,e,function(){s(e.isComplete?{}:null)})},function(){e.isComplete?i._onLoad(e):(e._onLoadBinding=e.onComplete.once(i._onLoad,i),e.load())},!0)},r.prototype._onStart=function(){this.progress=0,this.loading=!0,this.onStart.dispatch(this)},r.prototype._onComplete=function(){this.progress=ra,this.loading=!1,this.onComplete.dispatch(this,this.resources)},r.prototype._onLoad=function(e){var t=this;e._onLoadBinding=null,this._resourcesParsing.push(e),e._dequeue(),ia.eachSeries(this._afterMiddleware,function(i,n){i.call(t,e,n)},function(){e.onAfterMiddleware.dispatch(e),t.progress=Math.min(ra,t.progress+e.progressChunk),t.onProgress.dispatch(t,e),e.error?t.onError.dispatch(e.error,t,e):t.onLoad.dispatch(t,e),t._resourcesParsing.splice(t._resourcesParsing.indexOf(e),1),t._queue.idle()&&t._resourcesParsing.length===0&&t._onComplete()},!0)},r.prototype.destroy=function(){this._protected||this.reset()},Object.defineProperty(r,"shared",{get:function(){var e=r._shared;return e||(e=new r,e._protected=!0,r._shared=e),e},enumerable:!1,configurable:!0}),r.registerPlugin=function(e){return ge("6.5.0","Loader.registerPlugin() is deprecated, use extensions.add() instead."),Ge.add({type:nt.Loader,ref:e}),r},r._plugins=[],r}();Ge.handleByList(nt.Loader,Rn._plugins),Rn.prototype.add=function(e,t,i,n){if(Array.isArray(e)){for(var s=0;s<e.length;++s)this.add(e[s]);return this}if(typeof e=="object"&&(i=e,n=t||i.callback||i.onComplete,t=i.url,e=i.name||i.key||i.url),typeof t!="string"&&(n=i,i=t,t=e),typeof t!="string")throw new Error("No url passed to add resource to loader.");return typeof i=="function"&&(n=i,i=null),this._add(e,t,i,n)};var Dm=function(){function r(){}return r.init=function(e){e=Object.assign({sharedLoader:!1},e),this.loader=e.sharedLoader?Rn.shared:new Rn},r.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},r.extension=nt.Application,r}(),Fm=function(){function r(){}return r.add=function(){xt.setExtensionLoadType("svg",xt.LOAD_TYPE.XHR),xt.setExtensionXhrType("svg",xt.XHR_RESPONSE_TYPE.TEXT)},r.use=function(e,t){if(e.data&&(e.type===xt.TYPE.IMAGE||e.extension==="svg")){var i=e.data,n=e.url,s=e.name,a=e.metadata;V.fromLoader(i,n,s,a).then(function(o){e.texture=o,t()}).catch(t)}else t()},r.extension=nt.Loader,r}(),Nm="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function Lm(r){for(var e="",t=0;t<r.length;){for(var i=[0,0,0],n=[0,0,0,0],s=0;s<i.length;++s)t<r.length?i[s]=r.charCodeAt(t++)&255:i[s]=0;n[0]=i[0]>>2,n[1]=(i[0]&3)<<4|i[1]>>4,n[2]=(i[1]&15)<<2|i[2]>>6,n[3]=i[2]&63;var a=t-(r.length-1);switch(a){case 2:n[3]=64,n[2]=64;break;case 1:n[3]=64;break}for(var s=0;s<n.length;++s)e+=Nm.charAt(n[s])}return e}function Bm(r,e){if(!r.data){e();return}if(r.xhr&&r.xhrType===xt.XHR_RESPONSE_TYPE.BLOB){if(!self.Blob||typeof r.data=="string"){var t=r.xhr.getResponseHeader("content-type");if(t&&t.indexOf("image")===0){r.data=new Image,r.data.src="data:"+t+";base64,"+Lm(r.xhr.responseText),r.type=xt.TYPE.IMAGE,r.data.onload=function(){r.data.onload=null,e()};return}}else if(r.data.type.indexOf("image")===0){var i=globalThis.URL||globalThis.webkitURL,n=i.createObjectURL(r.data);r.blob=r.data,r.data=new Image,r.data.src=n,r.type=xt.TYPE.IMAGE,r.data.onload=function(){i.revokeObjectURL(n),r.data.onload=null,e()};return}}e()}var Um=function(){function r(){}return r.extension=nt.Loader,r.use=Bm,r}();Ge.add(Fm,Um);var rt,z;(function(r){r[r.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",r[r.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",r[r.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",r[r.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",r[r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=35917]="COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT",r[r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT=35918]="COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT",r[r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=35919]="COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT",r[r.COMPRESSED_SRGB_S3TC_DXT1_EXT=35916]="COMPRESSED_SRGB_S3TC_DXT1_EXT",r[r.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",r[r.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",r[r.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",r[r.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",r[r.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",r[r.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC",r[r.COMPRESSED_SRGB8_ETC2=37493]="COMPRESSED_SRGB8_ETC2",r[r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",r[r.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37494]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",r[r.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37495]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",r[r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG=35840]="COMPRESSED_RGB_PVRTC_4BPPV1_IMG",r[r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG=35842]="COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",r[r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG=35841]="COMPRESSED_RGB_PVRTC_2BPPV1_IMG",r[r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG=35843]="COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",r[r.COMPRESSED_RGB_ETC1_WEBGL=36196]="COMPRESSED_RGB_ETC1_WEBGL",r[r.COMPRESSED_RGB_ATC_WEBGL=35986]="COMPRESSED_RGB_ATC_WEBGL",r[r.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL=35986]="COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",r[r.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL=34798]="COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",r[r.COMPRESSED_RGBA_ASTC_4x4_KHR=37808]="COMPRESSED_RGBA_ASTC_4x4_KHR"})(z||(z={}));var Cn=(rt={},rt[z.COMPRESSED_RGB_S3TC_DXT1_EXT]=.5,rt[z.COMPRESSED_RGBA_S3TC_DXT1_EXT]=.5,rt[z.COMPRESSED_RGBA_S3TC_DXT3_EXT]=1,rt[z.COMPRESSED_RGBA_S3TC_DXT5_EXT]=1,rt[z.COMPRESSED_SRGB_S3TC_DXT1_EXT]=.5,rt[z.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT]=.5,rt[z.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT]=1,rt[z.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT]=1,rt[z.COMPRESSED_R11_EAC]=.5,rt[z.COMPRESSED_SIGNED_R11_EAC]=.5,rt[z.COMPRESSED_RG11_EAC]=1,rt[z.COMPRESSED_SIGNED_RG11_EAC]=1,rt[z.COMPRESSED_RGB8_ETC2]=.5,rt[z.COMPRESSED_RGBA8_ETC2_EAC]=1,rt[z.COMPRESSED_SRGB8_ETC2]=.5,rt[z.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC]=1,rt[z.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2]=.5,rt[z.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2]=.5,rt[z.COMPRESSED_RGB_PVRTC_4BPPV1_IMG]=.5,rt[z.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG]=.5,rt[z.COMPRESSED_RGB_PVRTC_2BPPV1_IMG]=.25,rt[z.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG]=.25,rt[z.COMPRESSED_RGB_ETC1_WEBGL]=.5,rt[z.COMPRESSED_RGB_ATC_WEBGL]=.5,rt[z.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL]=1,rt[z.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL]=1,rt[z.COMPRESSED_RGBA_ASTC_4x4_KHR]=1,rt);var na=function(r,e){return na=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},na(r,e)};function su(r,e){na(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function Gm(r,e,t,i){function n(s){return s instanceof t?s:new t(function(a){a(s)})}return new(t||(t=Promise))(function(s,a){function o(l){try{u(i.next(l))}catch(f){a(f)}}function h(l){try{u(i.throw(l))}catch(f){a(f)}}function u(l){l.done?s(l.value):n(l.value).then(o,h)}u((i=i.apply(r,e||[])).next())})}function km(r,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,a;return a={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function o(u){return function(l){return h([u,l])}}function h(u){if(i)throw new TypeError("Generator is already executing.");for(;t;)try{if(i=1,n&&(s=u[0]&2?n.return:u[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,u[1])).done)return s;switch(n=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,n=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){t.label=u[1];break}if(u[0]===6&&t.label<s[1]){t.label=s[1],s=u;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(u);break}s[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(r,t)}catch(l){u=[6,l],n=0}finally{i=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}var Xm=function(r){su(e,r);function e(t,i){i===void 0&&(i={width:1,height:1,autoLoad:!0});var n=this,s,a;return typeof t=="string"?(s=t,a=new Uint8Array):(s=null,a=t),n=r.call(this,a,i)||this,n.origin=s,n.buffer=a?new $s(a):null,n.origin&&i.autoLoad!==!1&&n.load(),a&&a.length&&(n.loaded=!0,n.onBlobLoaded(n.buffer.rawBinaryData)),n}return e.prototype.onBlobLoaded=function(t){},e.prototype.load=function(){return Gm(this,void 0,Promise,function(){var t,i,n;return km(this,function(s){switch(s.label){case 0:return[4,fetch(this.origin)];case 1:return t=s.sent(),[4,t.blob()];case 2:return i=s.sent(),[4,i.arrayBuffer()];case 3:return n=s.sent(),this.data=new Uint32Array(n),this.buffer=new $s(n),this.loaded=!0,this.onBlobLoaded(n),this.update(),[2,this]}})})},e}(Tr),sa=function(r){su(e,r);function e(t,i){var n=r.call(this,t,i)||this;return n.format=i.format,n.levels=i.levels||1,n._width=i.width,n._height=i.height,n._extension=e._formatToExtension(n.format),(i.levelBuffers||n.buffer)&&(n._levelBuffers=i.levelBuffers||e._createLevelBuffers(t instanceof Uint8Array?t:n.buffer.uint8View,n.format,n.levels,4,4,n.width,n.height)),n}return e.prototype.upload=function(t,i,n){var s=t.gl,a=t.context.extensions[this._extension];if(!a)throw new Error(this._extension+" textures are not supported on the current machine");if(!this._levelBuffers)return!1;for(var o=0,h=this.levels;o<h;o++){var u=this._levelBuffers[o],l=u.levelID,f=u.levelWidth,c=u.levelHeight,d=u.levelBuffer;s.compressedTexImage2D(s.TEXTURE_2D,l,this.format,f,c,0,d)}return!0},e.prototype.onBlobLoaded=function(){this._levelBuffers=e._createLevelBuffers(this.buffer.uint8View,this.format,this.levels,4,4,this.width,this.height)},e._formatToExtension=function(t){if(t>=33776&&t<=33779)return"s3tc";if(t>=37488&&t<=37497)return"etc";if(t>=35840&&t<=35843)return"pvrtc";if(t>=36196)return"etc1";if(t>=35986&&t<=34798)return"atc";throw new Error("Invalid (compressed) texture format given!")},e._createLevelBuffers=function(t,i,n,s,a,o,h){for(var u=new Array(n),l=t.byteOffset,f=o,c=h,d=f+s-1&~(s-1),v=c+a-1&~(a-1),p=d*v*Cn[i],_=0;_<n;_++)u[_]={levelID:_,levelWidth:n>1?f:d,levelHeight:n>1?c:v,levelBuffer:new Uint8Array(t.buffer,l,p)},l+=p,f=f>>1||1,c=c>>1||1,d=f+s-1&~(s-1),v=c+a-1&~(a-1),p=d*v*Cn[i];return u},e}(Xm),Hm=function(){function r(){}return r.use=function(e,t){var i=e.data,n=this;if(e.type===xt.TYPE.JSON&&i&&i.cacheID&&i.textures){for(var s=i.textures,a=void 0,o=void 0,h=0,u=s.length;h<u;h++){var l=s[h],f=l.src,c=l.format;if(c||(o=f),r.textureFormats[c]){a=f;break}}if(a=a||o,!a){t(new Error("Cannot load compressed-textures in "+e.url+", make sure you provide a fallback"));return}if(a===e.url){t(new Error("URL of compressed texture cannot be the same as the manifest's URL"));return}var d={crossOrigin:e.crossOrigin,metadata:e.metadata.imageMetadata,parentResource:e},v=Hi.resolve(e.url.replace(n.baseUrl,""),a),p=i.cacheID;n.add(p,v,d,function(_){if(_.error){t(_.error);return}var m=_.texture,g=m===void 0?null:m,y=_.textures,b=y===void 0?{}:y;Object.assign(e,{texture:g,textures:b}),t()})}else t()},Object.defineProperty(r,"textureExtensions",{get:function(){if(!r._textureExtensions){var e=L.ADAPTER.createCanvas(),t=e.getContext("webgl");if(!t)return console.warn("WebGL not available for compressed textures. Silently failing."),{};var i={s3tc:t.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:t.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:t.getExtension("WEBGL_compressed_texture_etc"),etc1:t.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:t.getExtension("WEBGL_compressed_texture_atc"),astc:t.getExtension("WEBGL_compressed_texture_astc")};r._textureExtensions=i}return r._textureExtensions},enumerable:!1,configurable:!0}),Object.defineProperty(r,"textureFormats",{get:function(){if(!r._textureFormats){var e=r.textureExtensions;r._textureFormats={};for(var t in e){var i=e[t];i&&Object.assign(r._textureFormats,Object.getPrototypeOf(i))}}return r._textureFormats},enumerable:!1,configurable:!0}),r.extension=nt.Loader,r}();function au(r,e,t){var i={textures:{},texture:null};if(!e)return i;var n=e.map(function(s){return new V(new tt(s,Object.assign({mipmap:pe.OFF,alphaMode:ve.NO_PREMULTIPLIED_ALPHA},t)))});return n.forEach(function(s,a){var o=s.baseTexture,h=r+"-"+(a+1);tt.addToCache(o,h),V.addToCache(s,h),a===0&&(tt.addToCache(o,r),V.addToCache(s,r),i.texture=s),i.textures[h]=s}),i}var Cr,ye,aa=4,On=124,Wm=32,ou=20,Vm=542327876,An={SIZE:1,FLAGS:2,HEIGHT:3,WIDTH:4,MIPMAP_COUNT:7,PIXEL_FORMAT:19},zm={SIZE:0,FLAGS:1,FOURCC:2,RGB_BITCOUNT:3,R_BIT_MASK:4,G_BIT_MASK:5,B_BIT_MASK:6,A_BIT_MASK:7},In={DXGI_FORMAT:0,RESOURCE_DIMENSION:1,MISC_FLAG:2,ARRAY_SIZE:3,MISC_FLAGS2:4},xe;(function(r){r[r.DXGI_FORMAT_UNKNOWN=0]="DXGI_FORMAT_UNKNOWN",r[r.DXGI_FORMAT_R32G32B32A32_TYPELESS=1]="DXGI_FORMAT_R32G32B32A32_TYPELESS",r[r.DXGI_FORMAT_R32G32B32A32_FLOAT=2]="DXGI_FORMAT_R32G32B32A32_FLOAT",r[r.DXGI_FORMAT_R32G32B32A32_UINT=3]="DXGI_FORMAT_R32G32B32A32_UINT",r[r.DXGI_FORMAT_R32G32B32A32_SINT=4]="DXGI_FORMAT_R32G32B32A32_SINT",r[r.DXGI_FORMAT_R32G32B32_TYPELESS=5]="DXGI_FORMAT_R32G32B32_TYPELESS",r[r.DXGI_FORMAT_R32G32B32_FLOAT=6]="DXGI_FORMAT_R32G32B32_FLOAT",r[r.DXGI_FORMAT_R32G32B32_UINT=7]="DXGI_FORMAT_R32G32B32_UINT",r[r.DXGI_FORMAT_R32G32B32_SINT=8]="DXGI_FORMAT_R32G32B32_SINT",r[r.DXGI_FORMAT_R16G16B16A16_TYPELESS=9]="DXGI_FORMAT_R16G16B16A16_TYPELESS",r[r.DXGI_FORMAT_R16G16B16A16_FLOAT=10]="DXGI_FORMAT_R16G16B16A16_FLOAT",r[r.DXGI_FORMAT_R16G16B16A16_UNORM=11]="DXGI_FORMAT_R16G16B16A16_UNORM",r[r.DXGI_FORMAT_R16G16B16A16_UINT=12]="DXGI_FORMAT_R16G16B16A16_UINT",r[r.DXGI_FORMAT_R16G16B16A16_SNORM=13]="DXGI_FORMAT_R16G16B16A16_SNORM",r[r.DXGI_FORMAT_R16G16B16A16_SINT=14]="DXGI_FORMAT_R16G16B16A16_SINT",r[r.DXGI_FORMAT_R32G32_TYPELESS=15]="DXGI_FORMAT_R32G32_TYPELESS",r[r.DXGI_FORMAT_R32G32_FLOAT=16]="DXGI_FORMAT_R32G32_FLOAT",r[r.DXGI_FORMAT_R32G32_UINT=17]="DXGI_FORMAT_R32G32_UINT",r[r.DXGI_FORMAT_R32G32_SINT=18]="DXGI_FORMAT_R32G32_SINT",r[r.DXGI_FORMAT_R32G8X24_TYPELESS=19]="DXGI_FORMAT_R32G8X24_TYPELESS",r[r.DXGI_FORMAT_D32_FLOAT_S8X24_UINT=20]="DXGI_FORMAT_D32_FLOAT_S8X24_UINT",r[r.DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS=21]="DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS",r[r.DXGI_FORMAT_X32_TYPELESS_G8X24_UINT=22]="DXGI_FORMAT_X32_TYPELESS_G8X24_UINT",r[r.DXGI_FORMAT_R10G10B10A2_TYPELESS=23]="DXGI_FORMAT_R10G10B10A2_TYPELESS",r[r.DXGI_FORMAT_R10G10B10A2_UNORM=24]="DXGI_FORMAT_R10G10B10A2_UNORM",r[r.DXGI_FORMAT_R10G10B10A2_UINT=25]="DXGI_FORMAT_R10G10B10A2_UINT",r[r.DXGI_FORMAT_R11G11B10_FLOAT=26]="DXGI_FORMAT_R11G11B10_FLOAT",r[r.DXGI_FORMAT_R8G8B8A8_TYPELESS=27]="DXGI_FORMAT_R8G8B8A8_TYPELESS",r[r.DXGI_FORMAT_R8G8B8A8_UNORM=28]="DXGI_FORMAT_R8G8B8A8_UNORM",r[r.DXGI_FORMAT_R8G8B8A8_UNORM_SRGB=29]="DXGI_FORMAT_R8G8B8A8_UNORM_SRGB",r[r.DXGI_FORMAT_R8G8B8A8_UINT=30]="DXGI_FORMAT_R8G8B8A8_UINT",r[r.DXGI_FORMAT_R8G8B8A8_SNORM=31]="DXGI_FORMAT_R8G8B8A8_SNORM",r[r.DXGI_FORMAT_R8G8B8A8_SINT=32]="DXGI_FORMAT_R8G8B8A8_SINT",r[r.DXGI_FORMAT_R16G16_TYPELESS=33]="DXGI_FORMAT_R16G16_TYPELESS",r[r.DXGI_FORMAT_R16G16_FLOAT=34]="DXGI_FORMAT_R16G16_FLOAT",r[r.DXGI_FORMAT_R16G16_UNORM=35]="DXGI_FORMAT_R16G16_UNORM",r[r.DXGI_FORMAT_R16G16_UINT=36]="DXGI_FORMAT_R16G16_UINT",r[r.DXGI_FORMAT_R16G16_SNORM=37]="DXGI_FORMAT_R16G16_SNORM",r[r.DXGI_FORMAT_R16G16_SINT=38]="DXGI_FORMAT_R16G16_SINT",r[r.DXGI_FORMAT_R32_TYPELESS=39]="DXGI_FORMAT_R32_TYPELESS",r[r.DXGI_FORMAT_D32_FLOAT=40]="DXGI_FORMAT_D32_FLOAT",r[r.DXGI_FORMAT_R32_FLOAT=41]="DXGI_FORMAT_R32_FLOAT",r[r.DXGI_FORMAT_R32_UINT=42]="DXGI_FORMAT_R32_UINT",r[r.DXGI_FORMAT_R32_SINT=43]="DXGI_FORMAT_R32_SINT",r[r.DXGI_FORMAT_R24G8_TYPELESS=44]="DXGI_FORMAT_R24G8_TYPELESS",r[r.DXGI_FORMAT_D24_UNORM_S8_UINT=45]="DXGI_FORMAT_D24_UNORM_S8_UINT",r[r.DXGI_FORMAT_R24_UNORM_X8_TYPELESS=46]="DXGI_FORMAT_R24_UNORM_X8_TYPELESS",r[r.DXGI_FORMAT_X24_TYPELESS_G8_UINT=47]="DXGI_FORMAT_X24_TYPELESS_G8_UINT",r[r.DXGI_FORMAT_R8G8_TYPELESS=48]="DXGI_FORMAT_R8G8_TYPELESS",r[r.DXGI_FORMAT_R8G8_UNORM=49]="DXGI_FORMAT_R8G8_UNORM",r[r.DXGI_FORMAT_R8G8_UINT=50]="DXGI_FORMAT_R8G8_UINT",r[r.DXGI_FORMAT_R8G8_SNORM=51]="DXGI_FORMAT_R8G8_SNORM",r[r.DXGI_FORMAT_R8G8_SINT=52]="DXGI_FORMAT_R8G8_SINT",r[r.DXGI_FORMAT_R16_TYPELESS=53]="DXGI_FORMAT_R16_TYPELESS",r[r.DXGI_FORMAT_R16_FLOAT=54]="DXGI_FORMAT_R16_FLOAT",r[r.DXGI_FORMAT_D16_UNORM=55]="DXGI_FORMAT_D16_UNORM",r[r.DXGI_FORMAT_R16_UNORM=56]="DXGI_FORMAT_R16_UNORM",r[r.DXGI_FORMAT_R16_UINT=57]="DXGI_FORMAT_R16_UINT",r[r.DXGI_FORMAT_R16_SNORM=58]="DXGI_FORMAT_R16_SNORM",r[r.DXGI_FORMAT_R16_SINT=59]="DXGI_FORMAT_R16_SINT",r[r.DXGI_FORMAT_R8_TYPELESS=60]="DXGI_FORMAT_R8_TYPELESS",r[r.DXGI_FORMAT_R8_UNORM=61]="DXGI_FORMAT_R8_UNORM",r[r.DXGI_FORMAT_R8_UINT=62]="DXGI_FORMAT_R8_UINT",r[r.DXGI_FORMAT_R8_SNORM=63]="DXGI_FORMAT_R8_SNORM",r[r.DXGI_FORMAT_R8_SINT=64]="DXGI_FORMAT_R8_SINT",r[r.DXGI_FORMAT_A8_UNORM=65]="DXGI_FORMAT_A8_UNORM",r[r.DXGI_FORMAT_R1_UNORM=66]="DXGI_FORMAT_R1_UNORM",r[r.DXGI_FORMAT_R9G9B9E5_SHAREDEXP=67]="DXGI_FORMAT_R9G9B9E5_SHAREDEXP",r[r.DXGI_FORMAT_R8G8_B8G8_UNORM=68]="DXGI_FORMAT_R8G8_B8G8_UNORM",r[r.DXGI_FORMAT_G8R8_G8B8_UNORM=69]="DXGI_FORMAT_G8R8_G8B8_UNORM",r[r.DXGI_FORMAT_BC1_TYPELESS=70]="DXGI_FORMAT_BC1_TYPELESS",r[r.DXGI_FORMAT_BC1_UNORM=71]="DXGI_FORMAT_BC1_UNORM",r[r.DXGI_FORMAT_BC1_UNORM_SRGB=72]="DXGI_FORMAT_BC1_UNORM_SRGB",r[r.DXGI_FORMAT_BC2_TYPELESS=73]="DXGI_FORMAT_BC2_TYPELESS",r[r.DXGI_FORMAT_BC2_UNORM=74]="DXGI_FORMAT_BC2_UNORM",r[r.DXGI_FORMAT_BC2_UNORM_SRGB=75]="DXGI_FORMAT_BC2_UNORM_SRGB",r[r.DXGI_FORMAT_BC3_TYPELESS=76]="DXGI_FORMAT_BC3_TYPELESS",r[r.DXGI_FORMAT_BC3_UNORM=77]="DXGI_FORMAT_BC3_UNORM",r[r.DXGI_FORMAT_BC3_UNORM_SRGB=78]="DXGI_FORMAT_BC3_UNORM_SRGB",r[r.DXGI_FORMAT_BC4_TYPELESS=79]="DXGI_FORMAT_BC4_TYPELESS",r[r.DXGI_FORMAT_BC4_UNORM=80]="DXGI_FORMAT_BC4_UNORM",r[r.DXGI_FORMAT_BC4_SNORM=81]="DXGI_FORMAT_BC4_SNORM",r[r.DXGI_FORMAT_BC5_TYPELESS=82]="DXGI_FORMAT_BC5_TYPELESS",r[r.DXGI_FORMAT_BC5_UNORM=83]="DXGI_FORMAT_BC5_UNORM",r[r.DXGI_FORMAT_BC5_SNORM=84]="DXGI_FORMAT_BC5_SNORM",r[r.DXGI_FORMAT_B5G6R5_UNORM=85]="DXGI_FORMAT_B5G6R5_UNORM",r[r.DXGI_FORMAT_B5G5R5A1_UNORM=86]="DXGI_FORMAT_B5G5R5A1_UNORM",r[r.DXGI_FORMAT_B8G8R8A8_UNORM=87]="DXGI_FORMAT_B8G8R8A8_UNORM",r[r.DXGI_FORMAT_B8G8R8X8_UNORM=88]="DXGI_FORMAT_B8G8R8X8_UNORM",r[r.DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM=89]="DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM",r[r.DXGI_FORMAT_B8G8R8A8_TYPELESS=90]="DXGI_FORMAT_B8G8R8A8_TYPELESS",r[r.DXGI_FORMAT_B8G8R8A8_UNORM_SRGB=91]="DXGI_FORMAT_B8G8R8A8_UNORM_SRGB",r[r.DXGI_FORMAT_B8G8R8X8_TYPELESS=92]="DXGI_FORMAT_B8G8R8X8_TYPELESS",r[r.DXGI_FORMAT_B8G8R8X8_UNORM_SRGB=93]="DXGI_FORMAT_B8G8R8X8_UNORM_SRGB",r[r.DXGI_FORMAT_BC6H_TYPELESS=94]="DXGI_FORMAT_BC6H_TYPELESS",r[r.DXGI_FORMAT_BC6H_UF16=95]="DXGI_FORMAT_BC6H_UF16",r[r.DXGI_FORMAT_BC6H_SF16=96]="DXGI_FORMAT_BC6H_SF16",r[r.DXGI_FORMAT_BC7_TYPELESS=97]="DXGI_FORMAT_BC7_TYPELESS",r[r.DXGI_FORMAT_BC7_UNORM=98]="DXGI_FORMAT_BC7_UNORM",r[r.DXGI_FORMAT_BC7_UNORM_SRGB=99]="DXGI_FORMAT_BC7_UNORM_SRGB",r[r.DXGI_FORMAT_AYUV=100]="DXGI_FORMAT_AYUV",r[r.DXGI_FORMAT_Y410=101]="DXGI_FORMAT_Y410",r[r.DXGI_FORMAT_Y416=102]="DXGI_FORMAT_Y416",r[r.DXGI_FORMAT_NV12=103]="DXGI_FORMAT_NV12",r[r.DXGI_FORMAT_P010=104]="DXGI_FORMAT_P010",r[r.DXGI_FORMAT_P016=105]="DXGI_FORMAT_P016",r[r.DXGI_FORMAT_420_OPAQUE=106]="DXGI_FORMAT_420_OPAQUE",r[r.DXGI_FORMAT_YUY2=107]="DXGI_FORMAT_YUY2",r[r.DXGI_FORMAT_Y210=108]="DXGI_FORMAT_Y210",r[r.DXGI_FORMAT_Y216=109]="DXGI_FORMAT_Y216",r[r.DXGI_FORMAT_NV11=110]="DXGI_FORMAT_NV11",r[r.DXGI_FORMAT_AI44=111]="DXGI_FORMAT_AI44",r[r.DXGI_FORMAT_IA44=112]="DXGI_FORMAT_IA44",r[r.DXGI_FORMAT_P8=113]="DXGI_FORMAT_P8",r[r.DXGI_FORMAT_A8P8=114]="DXGI_FORMAT_A8P8",r[r.DXGI_FORMAT_B4G4R4A4_UNORM=115]="DXGI_FORMAT_B4G4R4A4_UNORM",r[r.DXGI_FORMAT_P208=116]="DXGI_FORMAT_P208",r[r.DXGI_FORMAT_V208=117]="DXGI_FORMAT_V208",r[r.DXGI_FORMAT_V408=118]="DXGI_FORMAT_V408",r[r.DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE=119]="DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE",r[r.DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE=120]="DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE",r[r.DXGI_FORMAT_FORCE_UINT=121]="DXGI_FORMAT_FORCE_UINT"})(xe||(xe={}));var oa;(function(r){r[r.DDS_DIMENSION_TEXTURE1D=2]="DDS_DIMENSION_TEXTURE1D",r[r.DDS_DIMENSION_TEXTURE2D=3]="DDS_DIMENSION_TEXTURE2D",r[r.DDS_DIMENSION_TEXTURE3D=6]="DDS_DIMENSION_TEXTURE3D"})(oa||(oa={}));var Ym=1,jm=2,Zm=4,qm=64,Km=512,$m=131072,Jm=827611204,Qm=861165636,tg=894720068,eg=808540228,ig=4,rg=(Cr={},Cr[Jm]=z.COMPRESSED_RGBA_S3TC_DXT1_EXT,Cr[Qm]=z.COMPRESSED_RGBA_S3TC_DXT3_EXT,Cr[tg]=z.COMPRESSED_RGBA_S3TC_DXT5_EXT,Cr),ng=(ye={},ye[xe.DXGI_FORMAT_BC1_TYPELESS]=z.COMPRESSED_RGBA_S3TC_DXT1_EXT,ye[xe.DXGI_FORMAT_BC1_UNORM]=z.COMPRESSED_RGBA_S3TC_DXT1_EXT,ye[xe.DXGI_FORMAT_BC2_TYPELESS]=z.COMPRESSED_RGBA_S3TC_DXT3_EXT,ye[xe.DXGI_FORMAT_BC2_UNORM]=z.COMPRESSED_RGBA_S3TC_DXT3_EXT,ye[xe.DXGI_FORMAT_BC3_TYPELESS]=z.COMPRESSED_RGBA_S3TC_DXT5_EXT,ye[xe.DXGI_FORMAT_BC3_UNORM]=z.COMPRESSED_RGBA_S3TC_DXT5_EXT,ye[xe.DXGI_FORMAT_BC1_UNORM_SRGB]=z.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,ye[xe.DXGI_FORMAT_BC2_UNORM_SRGB]=z.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,ye[xe.DXGI_FORMAT_BC3_UNORM_SRGB]=z.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,ye);function sg(r){var e=new Uint32Array(r),t=e[0];if(t!==Vm)throw new Error("Invalid DDS file magic word");var i=new Uint32Array(r,0,On/Uint32Array.BYTES_PER_ELEMENT),n=i[An.HEIGHT],s=i[An.WIDTH],a=i[An.MIPMAP_COUNT],o=new Uint32Array(r,An.PIXEL_FORMAT*Uint32Array.BYTES_PER_ELEMENT,Wm/Uint32Array.BYTES_PER_ELEMENT),h=o[Ym];if(h&Zm){var u=o[zm.FOURCC];if(u!==eg){var l=rg[u],f=aa+On,c=new Uint8Array(r,f),d=new sa(c,{format:l,width:s,height:n,levels:a});return[d]}var v=aa+On,p=new Uint32Array(e.buffer,v,ou/Uint32Array.BYTES_PER_ELEMENT),_=p[In.DXGI_FORMAT],m=p[In.RESOURCE_DIMENSION],g=p[In.MISC_FLAG],y=p[In.ARRAY_SIZE],b=ng[_];if(b===void 0)throw new Error("DDSParser cannot parse texture data with DXGI format "+_);if(g===ig)throw new Error("DDSParser does not support cubemap textures");if(m===oa.DDS_DIMENSION_TEXTURE3D)throw new Error("DDSParser does not supported 3D texture data");var x=new Array,T=aa+On+ou;if(y===1)x.push(new Uint8Array(r,T));else{for(var w=Cn[b],S=0,E=s,P=n,O=0;O<a;O++){var M=Math.max(1,E+3&-4),F=Math.max(1,P+3&-4),G=M*F*w;S+=G,E=E>>>1,P=P>>>1}for(var A=T,O=0;O<y;O++)x.push(new Uint8Array(r,A,S)),A+=S}return x.map(function(I){return new sa(I,{format:b,width:s,height:n,levels:a})})}throw h&qm?new Error("DDSParser does not support uncompressed texture data."):h&Km?new Error("DDSParser does not supported YUV uncompressed texture data."):h&$m?new Error("DDSParser does not support single-channel (lumninance) texture data!"):h&jm?new Error("DDSParser does not support single-channel (alpha) texture data!"):new Error("DDSParser failed to load a texture file due to an unknown reason!")}var Qe,Xe,Or,hu=[171,75,84,88,32,49,49,187,13,10,26,10],ag=67305985,be={FILE_IDENTIFIER:0,ENDIANNESS:12,GL_TYPE:16,GL_TYPE_SIZE:20,GL_FORMAT:24,GL_INTERNAL_FORMAT:28,GL_BASE_INTERNAL_FORMAT:32,PIXEL_WIDTH:36,PIXEL_HEIGHT:40,PIXEL_DEPTH:44,NUMBER_OF_ARRAY_ELEMENTS:48,NUMBER_OF_FACES:52,NUMBER_OF_MIPMAP_LEVELS:56,BYTES_OF_KEY_VALUE_DATA:60},ha=64,uu=(Qe={},Qe[k.UNSIGNED_BYTE]=1,Qe[k.UNSIGNED_SHORT]=2,Qe[k.INT]=4,Qe[k.UNSIGNED_INT]=4,Qe[k.FLOAT]=4,Qe[k.HALF_FLOAT]=8,Qe),og=(Xe={},Xe[D.RGBA]=4,Xe[D.RGB]=3,Xe[D.RG]=2,Xe[D.RED]=1,Xe[D.LUMINANCE]=1,Xe[D.LUMINANCE_ALPHA]=2,Xe[D.ALPHA]=1,Xe),hg=(Or={},Or[k.UNSIGNED_SHORT_4_4_4_4]=2,Or[k.UNSIGNED_SHORT_5_5_5_1]=2,Or[k.UNSIGNED_SHORT_5_6_5]=2,Or);function ug(r,e,t){t===void 0&&(t=!1);var i=new DataView(e);if(!lg(r,i))return null;var n=i.getUint32(be.ENDIANNESS,!0)===ag,s=i.getUint32(be.GL_TYPE,n),a=i.getUint32(be.GL_FORMAT,n),o=i.getUint32(be.GL_INTERNAL_FORMAT,n),h=i.getUint32(be.PIXEL_WIDTH,n),u=i.getUint32(be.PIXEL_HEIGHT,n)||1,l=i.getUint32(be.PIXEL_DEPTH,n)||1,f=i.getUint32(be.NUMBER_OF_ARRAY_ELEMENTS,n)||1,c=i.getUint32(be.NUMBER_OF_FACES,n),d=i.getUint32(be.NUMBER_OF_MIPMAP_LEVELS,n),v=i.getUint32(be.BYTES_OF_KEY_VALUE_DATA,n);if(u===0||l!==1)throw new Error("Only 2D textures are supported");if(c!==1)throw new Error("CubeTextures are not supported by KTXLoader yet!");if(f!==1)throw new Error("WebGL does not support array textures");var p=4,_=4,m=h+3&-4,g=u+3&-4,y=new Array(f),b=h*u;s===0&&(b=m*g);var x;if(s!==0?uu[s]?x=uu[s]*og[a]:x=hg[s]:x=Cn[o],x===void 0)throw new Error("Unable to resolve the pixel format stored in the *.ktx file!");for(var T=t?cg(i,v,n):null,w=b*x,S=w,E=h,P=u,O=m,M=g,F=ha+v,G=0;G<d;G++){for(var A=i.getUint32(F,n),I=F+4,N=0;N<f;N++){var Y=y[N];Y||(Y=y[N]=new Array(d)),Y[G]={levelID:G,levelWidth:d>1||s!==0?E:O,levelHeight:d>1||s!==0?P:M,levelBuffer:new Uint8Array(e,I,S)},I+=S}F+=A+4,F=F%4!==0?F+4-F%4:F,E=E>>1||1,P=P>>1||1,O=E+p-1&~(p-1),M=P+_-1&~(_-1),S=O*M*x}return s!==0?{uncompressed:y.map(function(H){var R=H[0].levelBuffer,C=!1;return s===k.FLOAT?R=new Float32Array(H[0].levelBuffer.buffer,H[0].levelBuffer.byteOffset,H[0].levelBuffer.byteLength/4):s===k.UNSIGNED_INT?(C=!0,R=new Uint32Array(H[0].levelBuffer.buffer,H[0].levelBuffer.byteOffset,H[0].levelBuffer.byteLength/4)):s===k.INT&&(C=!0,R=new Int32Array(H[0].levelBuffer.buffer,H[0].levelBuffer.byteOffset,H[0].levelBuffer.byteLength/4)),{resource:new Tr(R,{width:H[0].levelWidth,height:H[0].levelHeight}),type:s,format:C?fg(a):a}}),kvData:T}:{compressed:y.map(function(H){return new sa(null,{format:o,width:h,height:u,levels:d,levelBuffers:H})}),kvData:T}}function lg(r,e){for(var t=0;t<hu.length;t++)if(e.getUint8(t)!==hu[t])return console.error(r+" is not a valid *.ktx file!"),!1;return!0}function fg(r){switch(r){case D.RGBA:return D.RGBA_INTEGER;case D.RGB:return D.RGB_INTEGER;case D.RG:return D.RG_INTEGER;case D.RED:return D.RED_INTEGER;default:return r}}function cg(r,e,t){for(var i=new Map,n=0;n<e;){var s=r.getUint32(ha+n,t),a=ha+n+4,o=3-(s+3)%4;if(s===0||s>e-n){console.error("KTXLoader: keyAndValueByteSize out of bounds");break}for(var h=0;h<s&&r.getUint8(a+h)!==0;h++);if(h===-1){console.error("KTXLoader: Failed to find null byte terminating kvData key");break}var u=new TextDecoder().decode(new Uint8Array(r.buffer,a,h)),l=new DataView(r.buffer,a+h+1,s-h-1);i.set(u,l),n+=4+s+o}return i}xt.setExtensionXhrType("dds",xt.XHR_RESPONSE_TYPE.BUFFER);var dg=function(){function r(){}return r.use=function(e,t){if(e.extension==="dds"&&e.data)try{Object.assign(e,au(e.name||e.url,sg(e.data),e.metadata))}catch(i){t(i);return}t()},r.extension=nt.Loader,r}();xt.setExtensionXhrType("ktx",xt.XHR_RESPONSE_TYPE.BUFFER);var pg=function(){function r(){}return r.use=function(e,t){if(e.extension==="ktx"&&e.data)try{var i=e.name||e.url,n=ug(i,e.data,this.loadKeyValueData),s=n.compressed,a=n.uncompressed,o=n.kvData;if(s){var h=au(i,s,e.metadata);if(o&&h.textures)for(var u in h.textures)h.textures[u].baseTexture.ktxKeyValueData=o;Object.assign(e,h)}else if(a){var l={};a.forEach(function(f,c){var d=new V(new tt(f.resource,{mipmap:pe.OFF,alphaMode:ve.NO_PREMULTIPLIED_ALPHA,type:f.type,format:f.format})),v=i+"-"+(c+1);o&&(d.baseTexture.ktxKeyValueData=o),tt.addToCache(d.baseTexture,v),V.addToCache(d,v),c===0&&(l[i]=d,tt.addToCache(d.baseTexture,i),V.addToCache(d,i)),l[v]=d}),Object.assign(e,{textures:l})}}catch(f){t(f);return}t()},r.extension=nt.Loader,r.loadKeyValueData=!1,r}();var ua=function(r,e){return ua=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},ua(r,e)};function lu(r,e){ua(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}(function(r){lu(e,r);function e(t,i,n,s){t===void 0&&(t=1500),n===void 0&&(n=16384),s===void 0&&(s=!1);var a=r.call(this)||this,o=16384;return n>o&&(n=o),a._properties=[!1,!0,!1,!1,!1],a._maxSize=t,a._batchSize=n,a._buffers=null,a._bufferUpdateIDs=[],a._updateID=0,a.interactiveChildren=!1,a.blendMode=X.NORMAL,a.autoResize=s,a.roundPixels=!0,a.baseTexture=null,a.setProperties(i),a._tint=0,a.tintRgb=new Float32Array(4),a.tint=16777215,a}return e.prototype.setProperties=function(t){t&&(this._properties[0]="vertices"in t||"scale"in t?!!t.vertices||!!t.scale:this._properties[0],this._properties[1]="position"in t?!!t.position:this._properties[1],this._properties[2]="rotation"in t?!!t.rotation:this._properties[2],this._properties[3]="uvs"in t?!!t.uvs:this._properties[3],this._properties[4]="tint"in t||"alpha"in t?!!t.tint||!!t.alpha:this._properties[4])},e.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},Object.defineProperty(e.prototype,"tint",{get:function(){return this._tint},set:function(t){this._tint=t,Wi(t,this.tintRgb)},enumerable:!1,configurable:!0}),e.prototype.render=function(t){var i=this;!this.visible||this.worldAlpha<=0||!this.children.length||!this.renderable||(this.baseTexture||(this.baseTexture=this.children[0]._texture.baseTexture,this.baseTexture.valid||this.baseTexture.once("update",function(){return i.onChildrenChange(0)})),t.batch.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))},e.prototype.onChildrenChange=function(t){for(var i=Math.floor(t/this._batchSize);this._bufferUpdateIDs.length<i;)this._bufferUpdateIDs.push(0);this._bufferUpdateIDs[i]=++this._updateID},e.prototype.dispose=function(){if(this._buffers){for(var t=0;t<this._buffers.length;++t)this._buffers[t].destroy();this._buffers=null}},e.prototype.destroy=function(t){r.prototype.destroy.call(this,t),this.dispose(),this._properties=null,this._buffers=null,this._bufferUpdateIDs=null},e})(yt);var fu=function(){function r(e,t,i){this.geometry=new wr,this.indexBuffer=null,this.size=i,this.dynamicProperties=[],this.staticProperties=[];for(var n=0;n<e.length;++n){var s=e[n];s={attributeName:s.attributeName,size:s.size,uploadFunction:s.uploadFunction,type:s.type||k.FLOAT,offset:s.offset},t[n]?this.dynamicProperties.push(s):this.staticProperties.push(s)}this.staticStride=0,this.staticBuffer=null,this.staticData=null,this.staticDataUint32=null,this.dynamicStride=0,this.dynamicBuffer=null,this.dynamicData=null,this.dynamicDataUint32=null,this._updateID=0,this.initBuffers()}return r.prototype.initBuffers=function(){var e=this.geometry,t=0;this.indexBuffer=new At(Mv(this.size),!0,!0),e.addIndex(this.indexBuffer),this.dynamicStride=0;for(var i=0;i<this.dynamicProperties.length;++i){var n=this.dynamicProperties[i];n.offset=t,t+=n.size,this.dynamicStride+=n.size}var s=new ArrayBuffer(this.size*this.dynamicStride*4*4);this.dynamicData=new Float32Array(s),this.dynamicDataUint32=new Uint32Array(s),this.dynamicBuffer=new At(this.dynamicData,!1,!1);var a=0;this.staticStride=0;for(var i=0;i<this.staticProperties.length;++i){var n=this.staticProperties[i];n.offset=a,a+=n.size,this.staticStride+=n.size}var o=new ArrayBuffer(this.size*this.staticStride*4*4);this.staticData=new Float32Array(o),this.staticDataUint32=new Uint32Array(o),this.staticBuffer=new At(this.staticData,!0,!1);for(var i=0;i<this.dynamicProperties.length;++i){var n=this.dynamicProperties[i];e.addAttribute(n.attributeName,this.dynamicBuffer,0,n.type===k.UNSIGNED_BYTE,n.type,this.dynamicStride*4,n.offset*4)}for(var i=0;i<this.staticProperties.length;++i){var n=this.staticProperties[i];e.addAttribute(n.attributeName,this.staticBuffer,0,n.type===k.UNSIGNED_BYTE,n.type,this.staticStride*4,n.offset*4)}},r.prototype.uploadDynamic=function(e,t,i){for(var n=0;n<this.dynamicProperties.length;n++){var s=this.dynamicProperties[n];s.uploadFunction(e,t,i,s.type===k.UNSIGNED_BYTE?this.dynamicDataUint32:this.dynamicData,this.dynamicStride,s.offset)}this.dynamicBuffer._updateID++},r.prototype.uploadStatic=function(e,t,i){for(var n=0;n<this.staticProperties.length;n++){var s=this.staticProperties[n];s.uploadFunction(e,t,i,s.type===k.UNSIGNED_BYTE?this.staticDataUint32:this.staticData,this.staticStride,s.offset)}this.staticBuffer._updateID++},r.prototype.destroy=function(){this.indexBuffer=null,this.dynamicProperties=null,this.dynamicBuffer=null,this.dynamicData=null,this.dynamicDataUint32=null,this.staticProperties=null,this.staticBuffer=null,this.staticData=null,this.staticDataUint32=null,this.geometry.destroy()},r}(),vg=`varying vec2 vTextureCoord;
496
496
  varying vec4 vColor;
497
497
 
498
498
  uniform sampler2D uSampler;
@@ -500,7 +500,7 @@ uniform sampler2D uSampler;
500
500
  void main(void){
501
501
  vec4 color = texture2D(uSampler, vTextureCoord) * vColor;
502
502
  gl_FragColor = color;
503
- }`,vg=`attribute vec2 aVertexPosition;
503
+ }`,_g=`attribute vec2 aVertexPosition;
504
504
  attribute vec2 aTextureCoord;
505
505
  attribute vec4 aColor;
506
506
 
@@ -525,8 +525,8 @@ void main(void){
525
525
  vTextureCoord = aTextureCoord;
526
526
  vColor = aColor * uColor;
527
527
  }
528
- `,_g=function(r){uu(e,r);function e(t){var i=r.call(this,t)||this;return i.shader=null,i.properties=null,i.tempMatrix=new Ct,i.properties=[{attributeName:"aVertexPosition",size:2,uploadFunction:i.uploadVertices,offset:0},{attributeName:"aPositionCoord",size:2,uploadFunction:i.uploadPosition,offset:0},{attributeName:"aRotation",size:1,uploadFunction:i.uploadRotation,offset:0},{attributeName:"aTextureCoord",size:2,uploadFunction:i.uploadUvs,offset:0},{attributeName:"aColor",size:1,type:k.UNSIGNED_BYTE,uploadFunction:i.uploadTint,offset:0}],i.shader=$e.from(vg,pg,{}),i.state=wi.for2d(),i}return e.prototype.render=function(t){var i=t.children,n=t._maxSize,s=t._batchSize,a=this.renderer,o=i.length;if(o!==0){o>n&&!t.autoResize&&(o=n);var h=t._buffers;h||(h=t._buffers=this.generateBuffers(t));var u=i[0]._texture.baseTexture,l=u.alphaMode>0;this.state.blendMode=uh(t.blendMode,l),a.state.set(this.state);var f=a.gl,c=t.worldTransform.copyTo(this.tempMatrix);c.prepend(a.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=c.toArray(!0),this.shader.uniforms.uColor=Av(t.tintRgb,t.worldAlpha,this.shader.uniforms.uColor,l),this.shader.uniforms.uSampler=u,this.renderer.shader.bind(this.shader);for(var d=!1,v=0,p=0;v<o;v+=s,p+=1){var _=o-v;_>s&&(_=s),p>=h.length&&h.push(this._generateOneMoreBuffer(t));var m=h[p];m.uploadDynamic(i,v,_);var g=t._bufferUpdateIDs[p]||0;d=d||m._updateID<g,d&&(m._updateID=t._updateID,m.uploadStatic(i,v,_)),a.geometry.bind(m.geometry),f.drawElements(f.TRIANGLES,_*6,f.UNSIGNED_SHORT,0)}}},e.prototype.generateBuffers=function(t){for(var i=[],n=t._maxSize,s=t._batchSize,a=t._properties,o=0;o<n;o+=s)i.push(new lu(this.properties,a,s));return i},e.prototype._generateOneMoreBuffer=function(t){var i=t._batchSize,n=t._properties;return new lu(this.properties,n,i)},e.prototype.uploadVertices=function(t,i,n,s,a,o){for(var h=0,u=0,l=0,f=0,c=0;c<n;++c){var d=t[i+c],v=d._texture,p=d.scale.x,_=d.scale.y,m=v.trim,g=v.orig;m?(u=m.x-d.anchor.x*g.width,h=u+m.width,f=m.y-d.anchor.y*g.height,l=f+m.height):(h=g.width*(1-d.anchor.x),u=g.width*-d.anchor.x,l=g.height*(1-d.anchor.y),f=g.height*-d.anchor.y),s[o]=u*p,s[o+1]=f*_,s[o+a]=h*p,s[o+a+1]=f*_,s[o+a*2]=h*p,s[o+a*2+1]=l*_,s[o+a*3]=u*p,s[o+a*3+1]=l*_,o+=a*4}},e.prototype.uploadPosition=function(t,i,n,s,a,o){for(var h=0;h<n;h++){var u=t[i+h].position;s[o]=u.x,s[o+1]=u.y,s[o+a]=u.x,s[o+a+1]=u.y,s[o+a*2]=u.x,s[o+a*2+1]=u.y,s[o+a*3]=u.x,s[o+a*3+1]=u.y,o+=a*4}},e.prototype.uploadRotation=function(t,i,n,s,a,o){for(var h=0;h<n;h++){var u=t[i+h].rotation;s[o]=u,s[o+a]=u,s[o+a*2]=u,s[o+a*3]=u,o+=a*4}},e.prototype.uploadUvs=function(t,i,n,s,a,o){for(var h=0;h<n;++h){var u=t[i+h]._texture._uvs;u?(s[o]=u.x0,s[o+1]=u.y0,s[o+a]=u.x1,s[o+a+1]=u.y1,s[o+a*2]=u.x2,s[o+a*2+1]=u.y2,s[o+a*3]=u.x3,s[o+a*3+1]=u.y3,o+=a*4):(s[o]=0,s[o+1]=0,s[o+a]=0,s[o+a+1]=0,s[o+a*2]=0,s[o+a*2+1]=0,s[o+a*3]=0,s[o+a*3+1]=0,o+=a*4)}},e.prototype.uploadTint=function(t,i,n,s,a,o){for(var h=0;h<n;++h){var u=t[i+h],l=u._texture.baseTexture.alphaMode>0,f=u.alpha,c=f<1&&l?Os(u._tintRGB,f):u._tintRGB+(f*255<<24);s[o]=c,s[o+a]=c,s[o+a*2]=c,s[o+a*3]=c,o+=a*4}},e.prototype.destroy=function(){r.prototype.destroy.call(this),this.shader&&(this.shader.destroy(),this.shader=null),this.tempMatrix=null},e.extension={name:"particle",type:nt.RendererPlugin},e}(mn);var He;(function(r){r.MITER="miter",r.BEVEL="bevel",r.ROUND="round"})(He||(He={}));var ti;(function(r){r.BUTT="butt",r.ROUND="round",r.SQUARE="square"})(ti||(ti={}));var Ar={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount:function(r,e){if(e===void 0&&(e=20),!this.adaptive||!r||isNaN(r))return e;var t=Math.ceil(r/this.maxLength);return t<this.minSegments?t=this.minSegments:t>this.maxSegments&&(t=this.maxSegments),t}},fu=function(){function r(){this.color=16777215,this.alpha=1,this.texture=W.WHITE,this.matrix=null,this.visible=!1,this.reset()}return r.prototype.clone=function(){var e=new r;return e.color=this.color,e.alpha=this.alpha,e.texture=this.texture,e.matrix=this.matrix,e.visible=this.visible,e},r.prototype.reset=function(){this.color=16777215,this.alpha=1,this.texture=W.WHITE,this.matrix=null,this.visible=!1},r.prototype.destroy=function(){this.texture=null,this.matrix=null},r}();var la=function(r,e){return la=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},la(r,e)};function fa(r,e){la(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function cu(r,e){var t,i;e===void 0&&(e=!1);var n=r.length;if(!(n<6)){for(var s=0,a=0,o=r[n-2],h=r[n-1];a<n;a+=2){var u=r[a],l=r[a+1];s+=(u-o)*(l+h),o=u,h=l}if(!e&&s>0||e&&s<=0)for(var f=n/2,a=f+f%2;a<n;a+=2){var c=n-a-2,d=n-a-1,v=a,p=a+1;t=[r[v],r[c]],r[c]=t[0],r[v]=t[1],i=[r[p],r[d]],r[d]=i[0],r[p]=i[1]}}}var du={build:function(r){r.points=r.shape.points.slice()},triangulate:function(r,e){var t=r.points,i=r.holes,n=e.points,s=e.indices;if(t.length>=6){cu(t,!1);for(var a=[],o=0;o<i.length;o++){var h=i[o];cu(h.points,!0),a.push(t.length/2),t=t.concat(h.points)}var u=sn.exports(t,a,2);if(!u)return;for(var l=n.length/2,o=0;o<u.length;o+=3)s.push(u[o]+l),s.push(u[o+1]+l),s.push(u[o+2]+l);for(var o=0;o<t.length;o++)n.push(t[o])}}},Mn={build:function(r){var e=r.points,t,i,n,s,a,o;if(r.type===Mt.CIRC){var h=r.shape;t=h.x,i=h.y,a=o=h.radius,n=s=0}else if(r.type===Mt.ELIP){var u=r.shape;t=u.x,i=u.y,a=u.width,o=u.height,n=s=0}else{var l=r.shape,f=l.width/2,c=l.height/2;t=l.x+f,i=l.y+c,a=o=Math.max(0,Math.min(l.radius,Math.min(f,c))),n=f-a,s=c-o}if(!(a>=0&&o>=0&&n>=0&&s>=0)){e.length=0;return}var d=Math.ceil(2.3*Math.sqrt(a+o)),v=d*8+(n?4:0)+(s?4:0);if(e.length=v,v!==0){if(d===0){e.length=8,e[0]=e[6]=t+n,e[1]=e[3]=i+s,e[2]=e[4]=t-n,e[5]=e[7]=i-s;return}var p=0,_=d*4+(n?2:0)+2,m=_,g=v;{var y=n+a,b=s,x=t+y,T=t-y,w=i+b;if(e[p++]=x,e[p++]=w,e[--_]=w,e[--_]=T,s){var S=i-b;e[m++]=T,e[m++]=S,e[--g]=S,e[--g]=x}}for(var E=1;E<d;E++){var P=Math.PI/2*(E/d),y=n+Math.cos(P)*a,b=s+Math.sin(P)*o,x=t+y,T=t-y,w=i+b,S=i-b;e[p++]=x,e[p++]=w,e[--_]=w,e[--_]=T,e[m++]=T,e[m++]=S,e[--g]=S,e[--g]=x}{var y=n,b=s+o,x=t+y,T=t-y,w=i+b,S=i-b;e[p++]=x,e[p++]=w,e[--g]=S,e[--g]=x,n&&(e[p++]=T,e[p++]=w,e[--g]=S,e[--g]=T)}}},triangulate:function(r,e){var t=r.points,i=e.points,n=e.indices;if(t.length!==0){var s=i.length/2,a=s,o,h;if(r.type!==Mt.RREC){var u=r.shape;o=u.x,h=u.y}else{var l=r.shape;o=l.x+l.width/2,h=l.y+l.height/2}var f=r.matrix;i.push(r.matrix?f.a*o+f.c*h+f.tx:o,r.matrix?f.b*o+f.d*h+f.ty:h),s++,i.push(t[0],t[1]);for(var c=2;c<t.length;c+=2)i.push(t[c],t[c+1]),n.push(s++,a,s);n.push(a+1,a,s)}}},mg={build:function(r){var e=r.shape,t=e.x,i=e.y,n=e.width,s=e.height,a=r.points;a.length=0,a.push(t,i,t+n,i,t+n,i+s,t,i+s)},triangulate:function(r,e){var t=r.points,i=e.points,n=i.length/2;i.push(t[0],t[1],t[2],t[3],t[6],t[7],t[4],t[5]),e.indices.push(n,n+1,n+2,n+1,n+2,n+3)}};function ji(r,e,t){var i=e-r;return r+i*t}function Dn(r,e,t,i,n,s,a){a===void 0&&(a=[]);for(var o=20,h=a,u=0,l=0,f=0,c=0,d=0,v=0,p=0,_=0;p<=o;++p)_=p/o,u=ji(r,t,_),l=ji(e,i,_),f=ji(t,n,_),c=ji(i,s,_),d=ji(u,f,_),v=ji(l,c,_),!(p===0&&h[h.length-2]===d&&h[h.length-1]===v)&&h.push(d,v);return h}var gg={build:function(r){if(ne.nextRoundedRectBehavior){Mn.build(r);return}var e=r.shape,t=r.points,i=e.x,n=e.y,s=e.width,a=e.height,o=Math.max(0,Math.min(e.radius,Math.min(s,a)/2));t.length=0,o?(Dn(i,n+o,i,n,i+o,n,t),Dn(i+s-o,n,i+s,n,i+s,n+o,t),Dn(i+s,n+a-o,i+s,n+a,i+s-o,n+a,t),Dn(i+o,n+a,i,n+a,i,n+a-o,t)):t.push(i,n,i+s,n,i+s,n+a,i,n+a)},triangulate:function(r,e){if(ne.nextRoundedRectBehavior){Mn.triangulate(r,e);return}for(var t=r.points,i=e.points,n=e.indices,s=i.length/2,a=sn.exports(t,null,2),o=0,h=a.length;o<h;o+=3)n.push(a[o]+s),n.push(a[o+1]+s),n.push(a[o+2]+s);for(var o=0,h=t.length;o<h;o++)i.push(t[o],t[++o])}};function pu(r,e,t,i,n,s,a,o){var h=r-t*n,u=e-i*n,l=r+t*s,f=e+i*s,c,d;a?(c=i,d=-t):(c=-i,d=t);var v=h+c,p=u+d,_=l+c,m=f+d;return o.push(v,p),o.push(_,m),2}function Pi(r,e,t,i,n,s,a,o){var h=t-r,u=i-e,l=Math.atan2(h,u),f=Math.atan2(n-r,s-e);o&&l<f?l+=Math.PI*2:!o&&l>f&&(f+=Math.PI*2);var c=l,d=f-l,v=Math.abs(d),p=Math.sqrt(h*h+u*u),_=(15*v*Math.sqrt(p)/Math.PI>>0)+1,m=d/_;if(c+=m,o){a.push(r,e),a.push(t,i);for(var g=1,y=c;g<_;g++,y+=m)a.push(r,e),a.push(r+Math.sin(y)*p,e+Math.cos(y)*p);a.push(r,e),a.push(n,s)}else{a.push(t,i),a.push(r,e);for(var g=1,y=c;g<_;g++,y+=m)a.push(r+Math.sin(y)*p,e+Math.cos(y)*p),a.push(r,e);a.push(n,s),a.push(r,e)}return _*2}function yg(r,e){var t=r.shape,i=r.points||t.points.slice(),n=e.closePointEps;if(i.length!==0){var s=r.lineStyle,a=new j(i[0],i[1]),o=new j(i[i.length-2],i[i.length-1]),h=t.type!==Mt.POLY||t.closeStroke,u=Math.abs(a.x-o.x)<n&&Math.abs(a.y-o.y)<n;if(h){i=i.slice(),u&&(i.pop(),i.pop(),o.set(i[i.length-2],i[i.length-1]));var l=(a.x+o.x)*.5,f=(o.y+a.y)*.5;i.unshift(l,f),i.push(l,f)}var c=e.points,d=i.length/2,v=i.length,p=c.length/2,_=s.width/2,m=_*_,g=s.miterLimit*s.miterLimit,y=i[0],b=i[1],x=i[2],T=i[3],w=0,S=0,E=-(b-T),P=y-x,O=0,D=0,N=Math.sqrt(E*E+P*P);E/=N,P/=N,E*=_,P*=_;var U=s.alignment,A=(1-U)*2,R=U*2;h||(s.cap===ti.ROUND?v+=Pi(y-E*(A-R)*.5,b-P*(A-R)*.5,y-E*A,b-P*A,y+E*R,b+P*R,c,!0)+2:s.cap===ti.SQUARE&&(v+=pu(y,b,E,P,A,R,!0,c))),c.push(y-E*A,b-P*A),c.push(y+E*R,b+P*R);for(var F=1;F<d-1;++F){y=i[(F-1)*2],b=i[(F-1)*2+1],x=i[F*2],T=i[F*2+1],w=i[(F+1)*2],S=i[(F+1)*2+1],E=-(b-T),P=y-x,N=Math.sqrt(E*E+P*P),E/=N,P/=N,E*=_,P*=_,O=-(T-S),D=x-w,N=Math.sqrt(O*O+D*D),O/=N,D/=N,O*=_,D*=_;var V=x-y,H=b-T,I=x-w,C=S-T,G=V*I+H*C,$=H*I-C*V,Y=$<0;if(Math.abs($)<.001*Math.abs(G)){c.push(x-E*A,T-P*A),c.push(x+E*R,T+P*R),G>=0&&(s.join===He.ROUND?v+=Pi(x,T,x-E*A,T-P*A,x-O*A,T-D*A,c,!1)+4:v+=2,c.push(x-O*R,T-D*R),c.push(x+O*A,T+D*A));continue}var rt=(-E+y)*(-P+T)-(-E+x)*(-P+b),lt=(-O+w)*(-D+T)-(-O+x)*(-D+S),ft=(V*lt-I*rt)/$,Lt=(C*rt-H*lt)/$,Ut=(ft-x)*(ft-x)+(Lt-T)*(Lt-T),St=x+(ft-x)*A,st=T+(Lt-T)*A,ut=x-(ft-x)*R,ct=T-(Lt-T)*R,tt=Math.min(V*V+H*H,I*I+C*C),zt=Y?A:R,qt=tt+zt*zt*m,et=Ut<=qt;et?s.join===He.BEVEL||Ut/m>g?(Y?(c.push(St,st),c.push(x+E*R,T+P*R),c.push(St,st),c.push(x+O*R,T+D*R)):(c.push(x-E*A,T-P*A),c.push(ut,ct),c.push(x-O*A,T-D*A),c.push(ut,ct)),v+=2):s.join===He.ROUND?Y?(c.push(St,st),c.push(x+E*R,T+P*R),v+=Pi(x,T,x+E*R,T+P*R,x+O*R,T+D*R,c,!0)+4,c.push(St,st),c.push(x+O*R,T+D*R)):(c.push(x-E*A,T-P*A),c.push(ut,ct),v+=Pi(x,T,x-E*A,T-P*A,x-O*A,T-D*A,c,!1)+4,c.push(x-O*A,T-D*A),c.push(ut,ct)):(c.push(St,st),c.push(ut,ct)):(c.push(x-E*A,T-P*A),c.push(x+E*R,T+P*R),s.join===He.ROUND?Y?v+=Pi(x,T,x+E*R,T+P*R,x+O*R,T+D*R,c,!0)+2:v+=Pi(x,T,x-E*A,T-P*A,x-O*A,T-D*A,c,!1)+2:s.join===He.MITER&&Ut/m<=g&&(Y?(c.push(ut,ct),c.push(ut,ct)):(c.push(St,st),c.push(St,st)),v+=2),c.push(x-O*A,T-D*A),c.push(x+O*R,T+D*R),v+=2)}y=i[(d-2)*2],b=i[(d-2)*2+1],x=i[(d-1)*2],T=i[(d-1)*2+1],E=-(b-T),P=y-x,N=Math.sqrt(E*E+P*P),E/=N,P/=N,E*=_,P*=_,c.push(x-E*A,T-P*A),c.push(x+E*R,T+P*R),h||(s.cap===ti.ROUND?v+=Pi(x-E*(A-R)*.5,T-P*(A-R)*.5,x-E*A,T-P*A,x+E*R,T+P*R,c,!1)+2:s.cap===ti.SQUARE&&(v+=pu(x,T,E,P,A,R,!1,c)));for(var Ne=e.indices,fr=Ar.epsilon*Ar.epsilon,F=p;F<v+p-2;++F)y=c[F*2],b=c[F*2+1],x=c[(F+1)*2],T=c[(F+1)*2+1],w=c[(F+2)*2],S=c[(F+2)*2+1],!(Math.abs(y*(T-S)+x*(S-b)+w*(b-T))<fr)&&Ne.push(F,F+1,F+2)}}function xg(r,e){var t=0,i=r.shape,n=r.points||i.points,s=i.type!==Mt.POLY||i.closeStroke;if(n.length!==0){var a=e.points,o=e.indices,h=n.length/2,u=a.length/2,l=u;for(a.push(n[0],n[1]),t=1;t<h;t++)a.push(n[t*2],n[t*2+1]),o.push(l,l+1),l++;s&&o.push(l,u)}}function vu(r,e){r.lineStyle.native?xg(r,e):yg(r,e)}var _u=function(){function r(){}return r.curveTo=function(e,t,i,n,s,a){var o=a[a.length-2],h=a[a.length-1],u=h-t,l=o-e,f=n-t,c=i-e,d=Math.abs(u*c-l*f);if(d<1e-8||s===0)return(a[a.length-2]!==e||a[a.length-1]!==t)&&a.push(e,t),null;var v=u*u+l*l,p=f*f+c*c,_=u*f+l*c,m=s*Math.sqrt(v)/d,g=s*Math.sqrt(p)/d,y=m*_/v,b=g*_/p,x=m*c+g*l,T=m*f+g*u,w=l*(g+y),S=u*(g+y),E=c*(m+b),P=f*(m+b),O=Math.atan2(S-T,w-x),D=Math.atan2(P-T,E-x);return{cx:x+e,cy:T+t,radius:s,startAngle:O,endAngle:D,anticlockwise:l*f>c*u}},r.arc=function(e,t,i,n,s,a,o,h,u){for(var l=o-a,f=Ar._segmentsCount(Math.abs(l)*s,Math.ceil(Math.abs(l)/Se)*40),c=l/(f*2),d=c*2,v=Math.cos(c),p=Math.sin(c),_=f-1,m=_%1/_,g=0;g<=_;++g){var y=g+m*g,b=c+a+d*y,x=Math.cos(b),T=-Math.sin(b);u.push((v*x+p*T)*s+i,(v*-T+p*x)*s+n)}},r}(),bg=function(){function r(){}return r.curveLength=function(e,t,i,n,s,a,o,h){for(var u=10,l=0,f=0,c=0,d=0,v=0,p=0,_=0,m=0,g=0,y=0,b=0,x=e,T=t,w=1;w<=u;++w)f=w/u,c=f*f,d=c*f,v=1-f,p=v*v,_=p*v,m=_*e+3*p*f*i+3*v*c*s+d*o,g=_*t+3*p*f*n+3*v*c*a+d*h,y=x-m,b=T-g,x=m,T=g,l+=Math.sqrt(y*y+b*b);return l},r.curveTo=function(e,t,i,n,s,a,o){var h=o[o.length-2],u=o[o.length-1];o.length-=2;var l=Ar._segmentsCount(r.curveLength(h,u,e,t,i,n,s,a)),f=0,c=0,d=0,v=0,p=0;o.push(h,u);for(var _=1,m=0;_<=l;++_)m=_/l,f=1-m,c=f*f,d=c*f,v=m*m,p=v*m,o.push(d*h+3*c*m*e+3*f*v*i+p*s,d*u+3*c*m*t+3*f*v*n+p*a)},r}(),Tg=function(){function r(){}return r.curveLength=function(e,t,i,n,s,a){var o=e-2*i+s,h=t-2*n+a,u=2*i-2*e,l=2*n-2*t,f=4*(o*o+h*h),c=4*(o*u+h*l),d=u*u+l*l,v=2*Math.sqrt(f+c+d),p=Math.sqrt(f),_=2*f*p,m=2*Math.sqrt(d),g=c/p;return(_*v+p*c*(v-m)+(4*d*f-c*c)*Math.log((2*p+g+v)/(g+m)))/(4*_)},r.curveTo=function(e,t,i,n,s){for(var a=s[s.length-2],o=s[s.length-1],h=Ar._segmentsCount(r.curveLength(a,o,e,t,i,n)),u=0,l=0,f=1;f<=h;++f){var c=f/h;u=a+(e-a)*c,l=o+(t-o)*c,s.push(u+(e+(i-e)*c-u)*c,l+(t+(n-t)*c-l)*c)}},r}(),wg=function(){function r(){this.reset()}return r.prototype.begin=function(e,t,i){this.reset(),this.style=e,this.start=t,this.attribStart=i},r.prototype.end=function(e,t){this.attribSize=t-this.attribStart,this.size=e-this.start},r.prototype.reset=function(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0},r}(),Ri,ca=(Ri={},Ri[Mt.POLY]=du,Ri[Mt.CIRC]=Mn,Ri[Mt.ELIP]=Mn,Ri[Mt.RECT]=mg,Ri[Mt.RREC]=gg,Ri),mu=[],Fn=[],gu=function(){function r(e,t,i,n){t===void 0&&(t=null),i===void 0&&(i=null),n===void 0&&(n=null),this.points=[],this.holes=[],this.shape=e,this.lineStyle=i,this.fillStyle=t,this.matrix=n,this.type=e.type}return r.prototype.clone=function(){return new r(this.shape,this.fillStyle,this.lineStyle,this.matrix)},r.prototype.destroy=function(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null},r}(),Zi=new j,Eg=function(r){fa(e,r);function e(){var t=r.call(this)||this;return t.closePointEps=1e-4,t.boundsPadding=0,t.uvsFloat32=null,t.indicesUint16=null,t.batchable=!1,t.points=[],t.colors=[],t.uvs=[],t.indices=[],t.textureIds=[],t.graphicsData=[],t.drawCalls=[],t.batchDirty=-1,t.batches=[],t.dirty=0,t.cacheDirty=-1,t.clearDirty=0,t.shapeIndex=0,t._bounds=new pn,t.boundsDirty=-1,t}return Object.defineProperty(e.prototype,"bounds",{get:function(){return this.updateBatches(),this.boundsDirty!==this.dirty&&(this.boundsDirty=this.dirty,this.calculateBounds()),this._bounds},enumerable:!1,configurable:!0}),e.prototype.invalidate=function(){this.boundsDirty=-1,this.dirty++,this.batchDirty++,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(var t=0;t<this.drawCalls.length;t++)this.drawCalls[t].texArray.clear(),Fn.push(this.drawCalls[t]);this.drawCalls.length=0;for(var t=0;t<this.batches.length;t++){var i=this.batches[t];i.reset(),mu.push(i)}this.batches.length=0},e.prototype.clear=function(){return this.graphicsData.length>0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this},e.prototype.drawShape=function(t,i,n,s){i===void 0&&(i=null),n===void 0&&(n=null),s===void 0&&(s=null);var a=new gu(t,i,n,s);return this.graphicsData.push(a),this.dirty++,this},e.prototype.drawHole=function(t,i){if(i===void 0&&(i=null),!this.graphicsData.length)return null;var n=new gu(t,null,null,i),s=this.graphicsData[this.graphicsData.length-1];return n.lineStyle=s.lineStyle,s.holes.push(n),this.dirty++,this},e.prototype.destroy=function(){r.prototype.destroy.call(this);for(var t=0;t<this.graphicsData.length;++t)this.graphicsData[t].destroy();this.points.length=0,this.points=null,this.colors.length=0,this.colors=null,this.uvs.length=0,this.uvs=null,this.indices.length=0,this.indices=null,this.indexBuffer.destroy(),this.indexBuffer=null,this.graphicsData.length=0,this.graphicsData=null,this.drawCalls.length=0,this.drawCalls=null,this.batches.length=0,this.batches=null,this._bounds=null},e.prototype.containsPoint=function(t){for(var i=this.graphicsData,n=0;n<i.length;++n){var s=i[n];if(s.fillStyle.visible&&s.shape&&(s.matrix?s.matrix.applyInverse(t,Zi):Zi.copyFrom(t),s.shape.contains(Zi.x,Zi.y))){var a=!1;if(s.holes)for(var o=0;o<s.holes.length;o++){var h=s.holes[o];if(h.shape.contains(Zi.x,Zi.y)){a=!0;break}}if(!a)return!0}}return!1},e.prototype.updateBatches=function(){if(!this.graphicsData.length){this.batchable=!0;return}if(this.validateBatching()){this.cacheDirty=this.dirty;var t=this.uvs,i=this.graphicsData,n=null,s=null;this.batches.length>0&&(n=this.batches[this.batches.length-1],s=n.style);for(var a=this.shapeIndex;a<i.length;a++){this.shapeIndex++;var o=i[a],h=o.fillStyle,u=o.lineStyle,l=ca[o.type];l.build(o),o.matrix&&this.transformPoints(o.points,o.matrix),(h.visible||u.visible)&&this.processHoles(o.holes);for(var f=0;f<2;f++){var c=f===0?h:u;if(c.visible){var d=c.texture.baseTexture,v=this.indices.length,p=this.points.length/2;d.wrapMode=Re.REPEAT,f===0?this.processFill(o):this.processLine(o);var _=this.points.length/2-p;_!==0&&(n&&!this._compareStyles(s,c)&&(n.end(v,p),n=null),n||(n=mu.pop()||new wg,n.begin(c,v,p),this.batches.push(n),s=c),this.addUvs(this.points,t,c.texture,p,_,c.matrix))}}}var m=this.indices.length,g=this.points.length/2;if(n&&n.end(m,g),this.batches.length===0){this.batchable=!0;return}var y=g>65535;this.indicesUint16&&this.indices.length===this.indicesUint16.length&&y===this.indicesUint16.BYTES_PER_ELEMENT>2?this.indicesUint16.set(this.indices):this.indicesUint16=y?new Uint32Array(this.indices):new Uint16Array(this.indices),this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()}},e.prototype._compareStyles=function(t,i){return!(!t||!i||t.texture.baseTexture!==i.texture.baseTexture||t.color+t.alpha!==i.color+i.alpha||!!t.native!=!!i.native)},e.prototype.validateBatching=function(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(var t=0,i=this.graphicsData.length;t<i;t++){var n=this.graphicsData[t],s=n.fillStyle,a=n.lineStyle;if(s&&!s.texture.baseTexture.valid||a&&!a.texture.baseTexture.valid)return!1}return!0},e.prototype.packBatches=function(){this.batchDirty++,this.uvsFloat32=new Float32Array(this.uvs);for(var t=this.batches,i=0,n=t.length;i<n;i++)for(var s=t[i],a=0;a<s.size;a++){var o=s.start+a;this.indicesUint16[o]=this.indicesUint16[o]-s.attribStart}},e.prototype.isBatchable=function(){if(this.points.length>65535*2)return!1;for(var t=this.batches,i=0;i<t.length;i++)if(t[i].style.native)return!1;return this.points.length<e.BATCHABLE_SIZE*2},e.prototype.buildDrawCalls=function(){for(var t=++Q._globalBatch,i=0;i<this.drawCalls.length;i++)this.drawCalls[i].texArray.clear(),Fn.push(this.drawCalls[i]);this.drawCalls.length=0;var n=this.colors,s=this.textureIds,a=Fn.pop();a||(a=new qs,a.texArray=new Ks),a.texArray.count=0,a.start=0,a.size=0,a.type=de.TRIANGLES;var o=0,h=null,u=0,l=!1,f=de.TRIANGLES,c=0;this.drawCalls.push(a);for(var i=0;i<this.batches.length;i++){var d=this.batches[i],v=8,p=d.style,_=p.texture.baseTexture;l!==!!p.native&&(l=!!p.native,f=l?de.LINES:de.TRIANGLES,h=null,o=v,t++),h!==_&&(h=_,_._batchEnabled!==t&&(o===v&&(t++,o=0,a.size>0&&(a=Fn.pop(),a||(a=new qs,a.texArray=new Ks),this.drawCalls.push(a)),a.start=c,a.size=0,a.texArray.count=0,a.type=f),_.touched=1,_._batchEnabled=t,_._batchLocation=o,_.wrapMode=Re.REPEAT,a.texArray.elements[a.texArray.count++]=_,o++)),a.size+=d.size,c+=d.size,u=_._batchLocation,this.addColors(n,p.color,p.alpha,d.attribSize,d.attribStart),this.addTextureIds(s,u,d.attribSize,d.attribStart)}Q._globalBatch=t,this.packAttributes()},e.prototype.packAttributes=function(){for(var t=this.points,i=this.uvs,n=this.colors,s=this.textureIds,a=new ArrayBuffer(t.length*3*4),o=new Float32Array(a),h=new Uint32Array(a),u=0,l=0;l<t.length/2;l++)o[u++]=t[l*2],o[u++]=t[l*2+1],o[u++]=i[l*2],o[u++]=i[l*2+1],h[u++]=n[l],o[u++]=s[l];this._buffer.update(a),this._indexBuffer.update(this.indicesUint16)},e.prototype.processFill=function(t){if(t.holes.length)du.triangulate(t,this);else{var i=ca[t.type];i.triangulate(t,this)}},e.prototype.processLine=function(t){vu(t,this);for(var i=0;i<t.holes.length;i++)vu(t.holes[i],this)},e.prototype.processHoles=function(t){for(var i=0;i<t.length;i++){var n=t[i],s=ca[n.type];s.build(n),n.matrix&&this.transformPoints(n.points,n.matrix)}},e.prototype.calculateBounds=function(){var t=this._bounds;t.clear(),t.addVertexData(this.points,0,this.points.length),t.pad(this.boundsPadding,this.boundsPadding)},e.prototype.transformPoints=function(t,i){for(var n=0;n<t.length/2;n++){var s=t[n*2],a=t[n*2+1];t[n*2]=i.a*s+i.c*a+i.tx,t[n*2+1]=i.b*s+i.d*a+i.ty}},e.prototype.addColors=function(t,i,n,s,a){a===void 0&&(a=0);var o=(i>>16)+(i&65280)+((i&255)<<16),h=Os(o,n);t.length=Math.max(t.length,a+s);for(var u=0;u<s;u++)t[a+u]=h},e.prototype.addTextureIds=function(t,i,n,s){s===void 0&&(s=0),t.length=Math.max(t.length,s+n);for(var a=0;a<n;a++)t[s+a]=i},e.prototype.addUvs=function(t,i,n,s,a,o){o===void 0&&(o=null);for(var h=0,u=i.length,l=n.frame;h<a;){var f=t[(s+h)*2],c=t[(s+h)*2+1];if(o){var d=o.a*f+o.c*c+o.tx;c=o.b*f+o.d*c+o.ty,f=d}h++,i.push(f/l.width,c/l.height)}var v=n.baseTexture;(l.width<v.width||l.height<v.height)&&this.adjustUvs(i,n,u,a)},e.prototype.adjustUvs=function(t,i,n,s){for(var a=i.baseTexture,o=1e-6,h=n+s*2,u=i.frame,l=u.width/a.width,f=u.height/a.height,c=u.x/u.width,d=u.y/u.height,v=Math.floor(t[n]+o),p=Math.floor(t[n+1]+o),_=n+2;_<h;_+=2)v=Math.min(v,Math.floor(t[_]+o)),p=Math.min(p,Math.floor(t[_+1]+o));c-=v,d-=p;for(var _=n;_<h;_+=2)t[_]=(t[_]+c)*l,t[_+1]=(t[_+1]+d)*f},e.BATCHABLE_SIZE=100,e}(zh),Sg=function(r){fa(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.width=0,t.alignment=.5,t.native=!1,t.cap=ti.BUTT,t.join=He.MITER,t.miterLimit=10,t}return e.prototype.clone=function(){var t=new e;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t.width=this.width,t.alignment=this.alignment,t.native=this.native,t.cap=this.cap,t.join=this.join,t.miterLimit=this.miterLimit,t},e.prototype.reset=function(){r.prototype.reset.call(this),this.color=0,this.alignment=.5,this.width=0,this.native=!1},e}(fu),Pg=new Float32Array(3),da={},ne=function(r){fa(e,r);function e(t){t===void 0&&(t=null);var i=r.call(this)||this;return i.shader=null,i.pluginName="batch",i.currentPath=null,i.batches=[],i.batchTint=-1,i.batchDirty=-1,i.vertexData=null,i._fillStyle=new fu,i._lineStyle=new Sg,i._matrix=null,i._holeMode=!1,i.state=wi.for2d(),i._geometry=t||new Eg,i._geometry.refCount++,i._transformID=-1,i.tint=16777215,i.blendMode=X.NORMAL,i}return Object.defineProperty(e.prototype,"geometry",{get:function(){return this._geometry},enumerable:!1,configurable:!0}),e.prototype.clone=function(){return this.finishPoly(),new e(this._geometry)},Object.defineProperty(e.prototype,"blendMode",{get:function(){return this.state.blendMode},set:function(t){this.state.blendMode=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tint",{get:function(){return this._tint},set:function(t){this._tint=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fill",{get:function(){return this._fillStyle},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"line",{get:function(){return this._lineStyle},enumerable:!1,configurable:!0}),e.prototype.lineStyle=function(t,i,n,s,a){return t===void 0&&(t=null),i===void 0&&(i=0),n===void 0&&(n=1),s===void 0&&(s=.5),a===void 0&&(a=!1),typeof t=="number"&&(t={width:t,color:i,alpha:n,alignment:s,native:a}),this.lineTextureStyle(t)},e.prototype.lineTextureStyle=function(t){t=Object.assign({width:0,texture:W.WHITE,color:t&&t.texture?16777215:0,alpha:1,matrix:null,alignment:.5,native:!1,cap:ti.BUTT,join:He.MITER,miterLimit:10},t),this.currentPath&&this.startPoly();var i=t.width>0&&t.alpha>0;return i?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._lineStyle,{visible:i},t)):this._lineStyle.reset(),this},e.prototype.startPoly=function(){if(this.currentPath){var t=this.currentPath.points,i=this.currentPath.points.length;i>2&&(this.drawShape(this.currentPath),this.currentPath=new Jr,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[i-2],t[i-1]))}else this.currentPath=new Jr,this.currentPath.closeStroke=!1},e.prototype.finishPoly=function(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)},e.prototype.moveTo=function(t,i){return this.startPoly(),this.currentPath.points[0]=t,this.currentPath.points[1]=i,this},e.prototype.lineTo=function(t,i){this.currentPath||this.moveTo(0,0);var n=this.currentPath.points,s=n[n.length-2],a=n[n.length-1];return(s!==t||a!==i)&&n.push(t,i),this},e.prototype._initCurve=function(t,i){t===void 0&&(t=0),i===void 0&&(i=0),this.currentPath?this.currentPath.points.length===0&&(this.currentPath.points=[t,i]):this.moveTo(t,i)},e.prototype.quadraticCurveTo=function(t,i,n,s){this._initCurve();var a=this.currentPath.points;return a.length===0&&this.moveTo(0,0),Tg.curveTo(t,i,n,s,a),this},e.prototype.bezierCurveTo=function(t,i,n,s,a,o){return this._initCurve(),bg.curveTo(t,i,n,s,a,o,this.currentPath.points),this},e.prototype.arcTo=function(t,i,n,s,a){this._initCurve(t,i);var o=this.currentPath.points,h=_u.curveTo(t,i,n,s,a,o);if(h){var u=h.cx,l=h.cy,f=h.radius,c=h.startAngle,d=h.endAngle,v=h.anticlockwise;this.arc(u,l,f,c,d,v)}return this},e.prototype.arc=function(t,i,n,s,a,o){if(o===void 0&&(o=!1),s===a)return this;!o&&a<=s?a+=Se:o&&s<=a&&(s+=Se);var h=a-s;if(h===0)return this;var u=t+Math.cos(s)*n,l=i+Math.sin(s)*n,f=this._geometry.closePointEps,c=this.currentPath?this.currentPath.points:null;if(c){var d=Math.abs(c[c.length-2]-u),v=Math.abs(c[c.length-1]-l);d<f&&v<f||c.push(u,l)}else this.moveTo(u,l),c=this.currentPath.points;return _u.arc(u,l,t,i,n,s,a,o,c),this},e.prototype.beginFill=function(t,i){return t===void 0&&(t=0),i===void 0&&(i=1),this.beginTextureFill({texture:W.WHITE,color:t,alpha:i})},e.prototype.beginTextureFill=function(t){t=Object.assign({texture:W.WHITE,color:16777215,alpha:1,matrix:null},t),this.currentPath&&this.startPoly();var i=t.alpha>0;return i?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._fillStyle,{visible:i},t)):this._fillStyle.reset(),this},e.prototype.endFill=function(){return this.finishPoly(),this._fillStyle.reset(),this},e.prototype.drawRect=function(t,i,n,s){return this.drawShape(new Z(t,i,n,s))},e.prototype.drawRoundedRect=function(t,i,n,s,a){return this.drawShape(new Pf(t,i,n,s,a))},e.prototype.drawCircle=function(t,i,n){return this.drawShape(new Ef(t,i,n))},e.prototype.drawEllipse=function(t,i,n,s){return this.drawShape(new Sf(t,i,n,s))},e.prototype.drawPolygon=function(){for(var t=arguments,i=[],n=0;n<arguments.length;n++)i[n]=t[n];var s,a=!0,o=i[0];o.points?(a=o.closeStroke,s=o.points):Array.isArray(i[0])?s=i[0]:s=i;var h=new Jr(s);return h.closeStroke=a,this.drawShape(h),this},e.prototype.drawShape=function(t){return this._holeMode?this._geometry.drawHole(t,this._matrix):this._geometry.drawShape(t,this._fillStyle.clone(),this._lineStyle.clone(),this._matrix),this},e.prototype.clear=function(){return this._geometry.clear(),this._lineStyle.reset(),this._fillStyle.reset(),this._boundsID++,this._matrix=null,this._holeMode=!1,this.currentPath=null,this},e.prototype.isFastRect=function(){var t=this._geometry.graphicsData;return t.length===1&&t[0].shape.type===Mt.RECT&&!t[0].matrix&&!t[0].holes.length&&!(t[0].lineStyle.visible&&t[0].lineStyle.width)},e.prototype._render=function(t){this.finishPoly();var i=this._geometry;i.updateBatches(),i.batchable?(this.batchDirty!==i.batchDirty&&this._populateBatches(),this._renderBatched(t)):(t.batch.flush(),this._renderDirect(t))},e.prototype._populateBatches=function(){var t=this._geometry,i=this.blendMode,n=t.batches.length;this.batchTint=-1,this._transformID=-1,this.batchDirty=t.batchDirty,this.batches.length=n,this.vertexData=new Float32Array(t.points);for(var s=0;s<n;s++){var a=t.batches[s],o=a.style.color,h=new Float32Array(this.vertexData.buffer,a.attribStart*4*2,a.attribSize*2),u=new Float32Array(t.uvsFloat32.buffer,a.attribStart*4*2,a.attribSize*2),l=new Uint16Array(t.indicesUint16.buffer,a.start*2,a.size),f={vertexData:h,blendMode:i,indices:l,uvs:u,_batchRGB:Wi(o),_tintRGB:o,_texture:a.style.texture,alpha:a.style.alpha,worldAlpha:1};this.batches[s]=f}},e.prototype._renderBatched=function(t){if(this.batches.length){t.batch.setObjectRenderer(t.plugins[this.pluginName]),this.calculateVertices(),this.calculateTints();for(var i=0,n=this.batches.length;i<n;i++){var s=this.batches[i];s.worldAlpha=this.worldAlpha*s.alpha,t.plugins[this.pluginName].render(s)}}},e.prototype._renderDirect=function(t){var i=this._resolveDirectShader(t),n=this._geometry,s=this.tint,a=this.worldAlpha,o=i.uniforms,h=n.drawCalls;o.translationMatrix=this.transform.worldTransform,o.tint[0]=(s>>16&255)/255*a,o.tint[1]=(s>>8&255)/255*a,o.tint[2]=(s&255)/255*a,o.tint[3]=a,t.shader.bind(i),t.geometry.bind(n,i),t.state.set(this.state);for(var u=0,l=h.length;u<l;u++)this._renderDrawCallDirect(t,n.drawCalls[u])},e.prototype._renderDrawCallDirect=function(t,i){for(var n=i.texArray,s=i.type,a=i.size,o=i.start,h=n.count,u=0;u<h;u++)t.texture.bind(n.elements[u],u);t.geometry.draw(s,a,o)},e.prototype._resolveDirectShader=function(t){var i=this.shader,n=this.pluginName;if(!i){if(!da[n]){for(var s=t.plugins[n].MAX_TEXTURES,a=new Int32Array(s),o=0;o<s;o++)a[o]=o;var h={tint:new Float32Array([1,1,1,1]),translationMatrix:new Ct,default:Ti.from({uSamplers:a},!0)},u=t.plugins[n]._shader.program;da[n]=new $e(u,h)}i=da[n]}return i},e.prototype._calculateBounds=function(){this.finishPoly();var t=this._geometry;if(t.graphicsData.length){var i=t.bounds,n=i.minX,s=i.minY,a=i.maxX,o=i.maxY;this._bounds.addFrame(this.transform,n,s,a,o)}},e.prototype.containsPoint=function(t){return this.worldTransform.applyInverse(t,e._TEMP_POINT),this._geometry.containsPoint(e._TEMP_POINT)},e.prototype.calculateTints=function(){if(this.batchTint!==this.tint){this.batchTint=this.tint;for(var t=Wi(this.tint,Pg),i=0;i<this.batches.length;i++){var n=this.batches[i],s=n._batchRGB,a=t[0]*s[0]*255,o=t[1]*s[1]*255,h=t[2]*s[2]*255,u=(a<<16)+(o<<8)+(h|0);n._tintRGB=(u>>16)+(u&65280)+((u&255)<<16)}}},e.prototype.calculateVertices=function(){var t=this.transform._worldID;if(this._transformID!==t){this._transformID=t;for(var i=this.transform.worldTransform,n=i.a,s=i.b,a=i.c,o=i.d,h=i.tx,u=i.ty,l=this._geometry.points,f=this.vertexData,c=0,d=0;d<l.length;d+=2){var v=l[d],p=l[d+1];f[c++]=n*v+a*p+h,f[c++]=o*p+s*v+u}}},e.prototype.closePath=function(){var t=this.currentPath;return t&&(t.closeStroke=!0,this.finishPoly()),this},e.prototype.setMatrix=function(t){return this._matrix=t,this},e.prototype.beginHole=function(){return this.finishPoly(),this._holeMode=!0,this},e.prototype.endHole=function(){return this.finishPoly(),this._holeMode=!1,this},e.prototype.destroy=function(t){this._geometry.refCount--,this._geometry.refCount===0&&this._geometry.dispose(),this._matrix=null,this.currentPath=null,this._lineStyle.destroy(),this._lineStyle=null,this._fillStyle.destroy(),this._fillStyle=null,this._geometry=null,this.shader=null,this.vertexData=null,this.batches.length=0,this.batches=null,r.prototype.destroy.call(this,t)},e.nextRoundedRectBehavior=!1,e._TEMP_POINT=new j,e}(yt);var pa=function(r,e){return pa=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},pa(r,e)};function Rg(r,e){pa(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Ir=new j,Cg=new Uint16Array([0,1,2,0,2,3]),We=function(r){Rg(e,r);function e(t){var i=r.call(this)||this;return i._anchor=new Gi(i._onAnchorUpdate,i,t?t.defaultAnchor.x:0,t?t.defaultAnchor.y:0),i._texture=null,i._width=0,i._height=0,i._tint=null,i._tintRGB=null,i.tint=16777215,i.blendMode=X.NORMAL,i._cachedTint=16777215,i.uvs=null,i.texture=t||W.EMPTY,i.vertexData=new Float32Array(8),i.vertexTrimmedData=null,i._transformID=-1,i._textureID=-1,i._transformTrimmedID=-1,i._textureTrimmedID=-1,i.indices=Cg,i.pluginName="batch",i.isSprite=!0,i._roundPixels=L.ROUND_PIXELS,i}return e.prototype._onTextureUpdate=function(){this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this._width&&(this.scale.x=Vi(this.scale.x)*this._width/this._texture.orig.width),this._height&&(this.scale.y=Vi(this.scale.y)*this._height/this._texture.orig.height)},e.prototype._onAnchorUpdate=function(){this._transformID=-1,this._transformTrimmedID=-1},e.prototype.calculateVertices=function(){var t=this._texture;if(!(this._transformID===this.transform._worldID&&this._textureID===t._updateID)){this._textureID!==t._updateID&&(this.uvs=this._texture._uvs.uvsFloat32),this._transformID=this.transform._worldID,this._textureID=t._updateID;var i=this.transform.worldTransform,n=i.a,s=i.b,a=i.c,o=i.d,h=i.tx,u=i.ty,l=this.vertexData,f=t.trim,c=t.orig,d=this._anchor,v=0,p=0,_=0,m=0;if(f?(p=f.x-d._x*c.width,v=p+f.width,m=f.y-d._y*c.height,_=m+f.height):(p=-d._x*c.width,v=p+c.width,m=-d._y*c.height,_=m+c.height),l[0]=n*p+a*m+h,l[1]=o*m+s*p+u,l[2]=n*v+a*m+h,l[3]=o*m+s*v+u,l[4]=n*v+a*_+h,l[5]=o*_+s*v+u,l[6]=n*p+a*_+h,l[7]=o*_+s*p+u,this._roundPixels)for(var g=L.RESOLUTION,y=0;y<l.length;++y)l[y]=Math.round((l[y]*g|0)/g)}},e.prototype.calculateTrimmedVertices=function(){if(!this.vertexTrimmedData)this.vertexTrimmedData=new Float32Array(8);else if(this._transformTrimmedID===this.transform._worldID&&this._textureTrimmedID===this._texture._updateID)return;this._transformTrimmedID=this.transform._worldID,this._textureTrimmedID=this._texture._updateID;var t=this._texture,i=this.vertexTrimmedData,n=t.orig,s=this._anchor,a=this.transform.worldTransform,o=a.a,h=a.b,u=a.c,l=a.d,f=a.tx,c=a.ty,d=-s._x*n.width,v=d+n.width,p=-s._y*n.height,_=p+n.height;i[0]=o*d+u*p+f,i[1]=l*p+h*d+c,i[2]=o*v+u*p+f,i[3]=l*p+h*v+c,i[4]=o*v+u*_+f,i[5]=l*_+h*v+c,i[6]=o*d+u*_+f,i[7]=l*_+h*d+c},e.prototype._render=function(t){this.calculateVertices(),t.batch.setObjectRenderer(t.plugins[this.pluginName]),t.plugins[this.pluginName].render(this)},e.prototype._calculateBounds=function(){var t=this._texture.trim,i=this._texture.orig;!t||t.width===i.width&&t.height===i.height?(this.calculateVertices(),this._bounds.addQuad(this.vertexData)):(this.calculateTrimmedVertices(),this._bounds.addQuad(this.vertexTrimmedData))},e.prototype.getLocalBounds=function(t){return this.children.length===0?(this._localBounds||(this._localBounds=new pn),this._localBounds.minX=this._texture.orig.width*-this._anchor._x,this._localBounds.minY=this._texture.orig.height*-this._anchor._y,this._localBounds.maxX=this._texture.orig.width*(1-this._anchor._x),this._localBounds.maxY=this._texture.orig.height*(1-this._anchor._y),t||(this._localBoundsRect||(this._localBoundsRect=new Z),t=this._localBoundsRect),this._localBounds.getRectangle(t)):r.prototype.getLocalBounds.call(this,t)},e.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,Ir);var i=this._texture.orig.width,n=this._texture.orig.height,s=-i*this.anchor.x,a=0;return Ir.x>=s&&Ir.x<s+i&&(a=-n*this.anchor.y,Ir.y>=a&&Ir.y<a+n)},e.prototype.destroy=function(t){r.prototype.destroy.call(this,t),this._texture.off("update",this._onTextureUpdate,this),this._anchor=null;var i=typeof t=="boolean"?t:t&&t.texture;if(i){var n=typeof t=="boolean"?t:t&&t.baseTexture;this._texture.destroy(!!n)}this._texture=null},e.from=function(t,i){var n=t instanceof W?t:W.from(t,i);return new e(n)},Object.defineProperty(e.prototype,"roundPixels",{get:function(){return this._roundPixels},set:function(t){this._roundPixels!==t&&(this._transformID=-1),this._roundPixels=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return Math.abs(this.scale.x)*this._texture.orig.width},set:function(t){var i=Vi(this.scale.x)||1;this.scale.x=i*t/this._texture.orig.width,this._width=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return Math.abs(this.scale.y)*this._texture.orig.height},set:function(t){var i=Vi(this.scale.y)||1;this.scale.y=i*t/this._texture.orig.height,this._height=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"anchor",{get:function(){return this._anchor},set:function(t){this._anchor.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tint",{get:function(){return this._tint},set:function(t){this._tint=t,this._tintRGB=(t>>16)+(t&65280)+((t&255)<<16)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"texture",{get:function(){return this._texture},set:function(t){this._texture!==t&&(this._texture&&this._texture.off("update",this._onTextureUpdate,this),this._texture=t||W.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,t&&(t.baseTexture.valid?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))},enumerable:!1,configurable:!0}),e}(yt);var va=function(r,e){return va=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},va(r,e)};function Og(r,e){va(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Mr;(function(r){r[r.LINEAR_VERTICAL=0]="LINEAR_VERTICAL",r[r.LINEAR_HORIZONTAL=1]="LINEAR_HORIZONTAL"})(Mr||(Mr={}));var _a={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:Mr.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100,leading:0},Ag=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],ei=function(){function r(e){this.styleID=0,this.reset(),ga(this,e,e)}return r.prototype.clone=function(){var e={};return ga(e,this,_a),new r(e)},r.prototype.reset=function(){ga(this,_a,_a)},Object.defineProperty(r.prototype,"align",{get:function(){return this._align},set:function(e){this._align!==e&&(this._align=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"breakWords",{get:function(){return this._breakWords},set:function(e){this._breakWords!==e&&(this._breakWords=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"dropShadow",{get:function(){return this._dropShadow},set:function(e){this._dropShadow!==e&&(this._dropShadow=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"dropShadowAlpha",{get:function(){return this._dropShadowAlpha},set:function(e){this._dropShadowAlpha!==e&&(this._dropShadowAlpha=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"dropShadowAngle",{get:function(){return this._dropShadowAngle},set:function(e){this._dropShadowAngle!==e&&(this._dropShadowAngle=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"dropShadowBlur",{get:function(){return this._dropShadowBlur},set:function(e){this._dropShadowBlur!==e&&(this._dropShadowBlur=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"dropShadowColor",{get:function(){return this._dropShadowColor},set:function(e){var t=ma(e);this._dropShadowColor!==t&&(this._dropShadowColor=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"dropShadowDistance",{get:function(){return this._dropShadowDistance},set:function(e){this._dropShadowDistance!==e&&(this._dropShadowDistance=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fill",{get:function(){return this._fill},set:function(e){var t=ma(e);this._fill!==t&&(this._fill=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fillGradientType",{get:function(){return this._fillGradientType},set:function(e){this._fillGradientType!==e&&(this._fillGradientType=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fillGradientStops",{get:function(){return this._fillGradientStops},set:function(e){Ig(this._fillGradientStops,e)||(this._fillGradientStops=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fontFamily",{get:function(){return this._fontFamily},set:function(e){this.fontFamily!==e&&(this._fontFamily=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fontSize",{get:function(){return this._fontSize},set:function(e){this._fontSize!==e&&(this._fontSize=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fontStyle",{get:function(){return this._fontStyle},set:function(e){this._fontStyle!==e&&(this._fontStyle=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fontVariant",{get:function(){return this._fontVariant},set:function(e){this._fontVariant!==e&&(this._fontVariant=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fontWeight",{get:function(){return this._fontWeight},set:function(e){this._fontWeight!==e&&(this._fontWeight=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"letterSpacing",{get:function(){return this._letterSpacing},set:function(e){this._letterSpacing!==e&&(this._letterSpacing=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"lineHeight",{get:function(){return this._lineHeight},set:function(e){this._lineHeight!==e&&(this._lineHeight=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"leading",{get:function(){return this._leading},set:function(e){this._leading!==e&&(this._leading=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"lineJoin",{get:function(){return this._lineJoin},set:function(e){this._lineJoin!==e&&(this._lineJoin=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"miterLimit",{get:function(){return this._miterLimit},set:function(e){this._miterLimit!==e&&(this._miterLimit=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"padding",{get:function(){return this._padding},set:function(e){this._padding!==e&&(this._padding=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"stroke",{get:function(){return this._stroke},set:function(e){var t=ma(e);this._stroke!==t&&(this._stroke=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"strokeThickness",{get:function(){return this._strokeThickness},set:function(e){this._strokeThickness!==e&&(this._strokeThickness=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"textBaseline",{get:function(){return this._textBaseline},set:function(e){this._textBaseline!==e&&(this._textBaseline=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"trim",{get:function(){return this._trim},set:function(e){this._trim!==e&&(this._trim=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"whiteSpace",{get:function(){return this._whiteSpace},set:function(e){this._whiteSpace!==e&&(this._whiteSpace=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"wordWrap",{get:function(){return this._wordWrap},set:function(e){this._wordWrap!==e&&(this._wordWrap=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"wordWrapWidth",{get:function(){return this._wordWrapWidth},set:function(e){this._wordWrapWidth!==e&&(this._wordWrapWidth=e,this.styleID++)},enumerable:!1,configurable:!0}),r.prototype.toFontString=function(){var e=typeof this.fontSize=="number"?this.fontSize+"px":this.fontSize,t=this.fontFamily;Array.isArray(this.fontFamily)||(t=this.fontFamily.split(","));for(var i=t.length-1;i>=0;i--){var n=t[i].trim();!/([\"\'])[^\'\"]+\1/.test(n)&&Ag.indexOf(n)<0&&(n='"'+n+'"'),t[i]=n}return this.fontStyle+" "+this.fontVariant+" "+this.fontWeight+" "+e+" "+t.join(",")},r}();function yu(r){return typeof r=="number"?ah(r):(typeof r=="string"&&r.indexOf("0x")===0&&(r=r.replace("0x","#")),r)}function ma(r){if(Array.isArray(r)){for(var e=0;e<r.length;++e)r[e]=yu(r[e]);return r}else return yu(r)}function Ig(r,e){if(!Array.isArray(r)||!Array.isArray(e)||r.length!==e.length)return!1;for(var t=0;t<r.length;++t)if(r[t]!==e[t])return!1;return!0}function ga(r,e,t){for(var i in t)Array.isArray(e[i])?r[i]=e[i].slice():r[i]=e[i]}var Nn={willReadFrequently:!0},se=function(){function r(e,t,i,n,s,a,o,h,u){this.text=e,this.style=t,this.width=i,this.height=n,this.lines=s,this.lineWidths=a,this.lineHeight=o,this.maxLineWidth=h,this.fontProperties=u}return r.measureText=function(e,t,i,n){n===void 0&&(n=r._canvas),i=i??t.wordWrap;var s=t.toFontString(),a=r.measureFont(s);a.fontSize===0&&(a.fontSize=t.fontSize,a.ascent=t.fontSize);var o=n.getContext("2d",Nn);o.font=s;for(var h=i?r.wordWrap(e,t,n):e,u=h.split(/(?:\r\n|\r|\n)/),l=new Array(u.length),f=0,c=0;c<u.length;c++){var d=o.measureText(u[c]).width+(u[c].length-1)*t.letterSpacing;l[c]=d,f=Math.max(f,d)}var v=f+t.strokeThickness;t.dropShadow&&(v+=t.dropShadowDistance);var p=t.lineHeight||a.fontSize+t.strokeThickness,_=Math.max(p,a.fontSize+t.strokeThickness)+(u.length-1)*(p+t.leading);return t.dropShadow&&(_+=t.dropShadowDistance),new r(e,t,v,_,u,l,p+t.leading,f,a)},r.wordWrap=function(e,t,i){i===void 0&&(i=r._canvas);for(var n=i.getContext("2d",Nn),s=0,a="",o="",h=Object.create(null),u=t.letterSpacing,l=t.whiteSpace,f=r.collapseSpaces(l),c=r.collapseNewlines(l),d=!f,v=t.wordWrapWidth+u,p=r.tokenize(e),_=0;_<p.length;_++){var m=p[_];if(r.isNewline(m)){if(!c){o+=r.addLine(a),d=!f,a="",s=0;continue}m=" "}if(f){var g=r.isBreakingSpace(m),y=r.isBreakingSpace(a[a.length-1]);if(g&&y)continue}var b=r.getFromCache(m,u,h,n);if(b>v)if(a!==""&&(o+=r.addLine(a),a="",s=0),r.canBreakWords(m,t.breakWords))for(var x=r.wordWrapSplit(m),T=0;T<x.length;T++){for(var w=x[T],S=1;x[T+S];){var E=x[T+S],P=w[w.length-1];if(!r.canBreakChars(P,E,m,T,t.breakWords))w+=E;else break;S++}T+=w.length-1;var O=r.getFromCache(w,u,h,n);O+s>v&&(o+=r.addLine(a),d=!1,a="",s=0),a+=w,s+=O}else{a.length>0&&(o+=r.addLine(a),a="",s=0);var D=_===p.length-1;o+=r.addLine(m,!D),d=!1,a="",s=0}else b+s>v&&(d=!1,o+=r.addLine(a),a="",s=0),(a.length>0||!r.isBreakingSpace(m)||d)&&(a+=m,s+=b)}return o+=r.addLine(a,!1),o},r.addLine=function(e,t){return t===void 0&&(t=!0),e=r.trimRight(e),e=t?e+`
529
- `:e,e},r.getFromCache=function(e,t,i,n){var s=i[e];if(typeof s!="number"){var a=e.length*t;s=n.measureText(e).width+a,i[e]=s}return s},r.collapseSpaces=function(e){return e==="normal"||e==="pre-line"},r.collapseNewlines=function(e){return e==="normal"},r.trimRight=function(e){if(typeof e!="string")return"";for(var t=e.length-1;t>=0;t--){var i=e[t];if(!r.isBreakingSpace(i))break;e=e.slice(0,-1)}return e},r.isNewline=function(e){return typeof e!="string"?!1:r._newlines.indexOf(e.charCodeAt(0))>=0},r.isBreakingSpace=function(e,t){return typeof e!="string"?!1:r._breakingSpaces.indexOf(e.charCodeAt(0))>=0},r.tokenize=function(e){var t=[],i="";if(typeof e!="string")return t;for(var n=0;n<e.length;n++){var s=e[n],a=e[n+1];if(r.isBreakingSpace(s,a)||r.isNewline(s)){i!==""&&(t.push(i),i=""),t.push(s);continue}i+=s}return i!==""&&t.push(i),t},r.canBreakWords=function(e,t){return t},r.canBreakChars=function(e,t,i,n,s){return!0},r.wordWrapSplit=function(e){return e.split("")},r.measureFont=function(e){if(r._fonts[e])return r._fonts[e];var t={ascent:0,descent:0,fontSize:0},i=r._canvas,n=r._context;n.font=e;var s=r.METRICS_STRING+r.BASELINE_SYMBOL,a=Math.ceil(n.measureText(s).width),o=Math.ceil(n.measureText(r.BASELINE_SYMBOL).width),h=Math.ceil(r.HEIGHT_MULTIPLIER*o);o=o*r.BASELINE_MULTIPLIER|0,i.width=a,i.height=h,n.fillStyle="#f00",n.fillRect(0,0,a,h),n.font=e,n.textBaseline="alphabetic",n.fillStyle="#000",n.fillText(s,0,o);var u=n.getImageData(0,0,a,h).data,l=u.length,f=a*4,c=0,d=0,v=!1;for(c=0;c<o;++c){for(var p=0;p<f;p+=4)if(u[d+p]!==255){v=!0;break}if(!v)d+=f;else break}for(t.ascent=o-c,d=l-f,v=!1,c=h;c>o;--c){for(var p=0;p<f;p+=4)if(u[d+p]!==255){v=!0;break}if(!v)d-=f;else break}return t.descent=c-o,t.fontSize=t.ascent+t.descent,r._fonts[e]=t,t},r.clearMetrics=function(e){e===void 0&&(e=""),e?delete r._fonts[e]:r._fonts={}},Object.defineProperty(r,"_canvas",{get:function(){if(!r.__canvas){var e=void 0;try{var t=new OffscreenCanvas(0,0),i=t.getContext("2d",Nn);if(i&&i.measureText)return r.__canvas=t,t;e=L.ADAPTER.createCanvas()}catch{e=L.ADAPTER.createCanvas()}e.width=e.height=10,r.__canvas=e}return r.__canvas},enumerable:!1,configurable:!0}),Object.defineProperty(r,"_context",{get:function(){return r.__context||(r.__context=r._canvas.getContext("2d",Nn)),r.__context},enumerable:!1,configurable:!0}),r}();se._fonts={},se.METRICS_STRING="|ÉqÅ",se.BASELINE_SYMBOL="M",se.BASELINE_MULTIPLIER=1.4,se.HEIGHT_MULTIPLIER=2,se._newlines=[10,13],se._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];var Mg={texture:!0,children:!1,baseTexture:!0},xu=function(r){Og(e,r);function e(t,i,n){var s=this,a=!1;n||(n=L.ADAPTER.createCanvas(),a=!0),n.width=3,n.height=3;var o=W.from(n);return o.orig=new Z,o.trim=new Z,s=r.call(this,o)||this,s._ownCanvas=a,s.canvas=n,s.context=n.getContext("2d",{willReadFrequently:!0}),s._resolution=L.RESOLUTION,s._autoResolution=!0,s._text=null,s._style=null,s._styleListener=null,s._font="",s.text=t,s.style=i,s.localStyleID=-1,s}return e.prototype.updateText=function(t){var i=this._style;if(this.localStyleID!==i.styleID&&(this.dirty=!0,this.localStyleID=i.styleID),!(!this.dirty&&t)){this._font=this._style.toFontString();var n=this.context,s=se.measureText(this._text||" ",this._style,this._style.wordWrap,this.canvas),a=s.width,o=s.height,h=s.lines,u=s.lineHeight,l=s.lineWidths,f=s.maxLineWidth,c=s.fontProperties;this.canvas.width=Math.ceil(Math.ceil(Math.max(1,a)+i.padding*2)*this._resolution),this.canvas.height=Math.ceil(Math.ceil(Math.max(1,o)+i.padding*2)*this._resolution),n.scale(this._resolution,this._resolution),n.clearRect(0,0,this.canvas.width,this.canvas.height),n.font=this._font,n.lineWidth=i.strokeThickness,n.textBaseline=i.textBaseline,n.lineJoin=i.lineJoin,n.miterLimit=i.miterLimit;for(var d,v,p=i.dropShadow?2:1,_=0;_<p;++_){var m=i.dropShadow&&_===0,g=m?Math.ceil(Math.max(1,o)+i.padding*2):0,y=g*this._resolution;if(m){n.fillStyle="black",n.strokeStyle="black";var b=i.dropShadowColor,x=Wi(typeof b=="number"?b:oh(b)),T=i.dropShadowBlur*this._resolution,w=i.dropShadowDistance*this._resolution;n.shadowColor="rgba("+x[0]*255+","+x[1]*255+","+x[2]*255+","+i.dropShadowAlpha+")",n.shadowBlur=T,n.shadowOffsetX=Math.cos(i.dropShadowAngle)*w,n.shadowOffsetY=Math.sin(i.dropShadowAngle)*w+y}else n.fillStyle=this._generateFillStyle(i,h,s),n.strokeStyle=i.stroke,n.shadowColor="black",n.shadowBlur=0,n.shadowOffsetX=0,n.shadowOffsetY=0;var S=(u-c.fontSize)/2;(!e.nextLineHeightBehavior||u-c.fontSize<0)&&(S=0);for(var E=0;E<h.length;E++)d=i.strokeThickness/2,v=i.strokeThickness/2+E*u+c.ascent+S,i.align==="right"?d+=f-l[E]:i.align==="center"&&(d+=(f-l[E])/2),i.stroke&&i.strokeThickness&&this.drawLetterSpacing(h[E],d+i.padding,v+i.padding-g,!0),i.fill&&this.drawLetterSpacing(h[E],d+i.padding,v+i.padding-g)}this.updateTexture()}},e.prototype.drawLetterSpacing=function(t,i,n,s){s===void 0&&(s=!1);var a=this._style,o=a.letterSpacing,h=e.experimentalLetterSpacing&&("letterSpacing"in CanvasRenderingContext2D.prototype||"textLetterSpacing"in CanvasRenderingContext2D.prototype);if(o===0||h){h&&(this.context.letterSpacing=o,this.context.textLetterSpacing=o),s?this.context.strokeText(t,i,n):this.context.fillText(t,i,n);return}for(var u=i,l=Array.from?Array.from(t):t.split(""),f=this.context.measureText(t).width,c=0,d=0;d<l.length;++d){var v=l[d];s?this.context.strokeText(v,u,n):this.context.fillText(v,u,n);for(var p="",_=d+1;_<l.length;++_)p+=l[_];c=this.context.measureText(p).width,u+=f-c+o,f=c}},e.prototype.updateTexture=function(){var t=this.canvas;if(this._style.trim){var i=Dv(t);i.data&&(t.width=i.width,t.height=i.height,this.context.putImageData(i.data,0,0))}var n=this._texture,s=this._style,a=s.trim?0:s.padding,o=n.baseTexture;n.trim.width=n._frame.width=t.width/this._resolution,n.trim.height=n._frame.height=t.height/this._resolution,n.trim.x=-a,n.trim.y=-a,n.orig.width=n._frame.width-a*2,n.orig.height=n._frame.height-a*2,this._onTextureUpdate(),o.setRealSize(t.width,t.height,this._resolution),n.updateUvs(),this.dirty=!1},e.prototype._render=function(t){this._autoResolution&&this._resolution!==t.resolution&&(this._resolution=t.resolution,this.dirty=!0),this.updateText(!0),r.prototype._render.call(this,t)},e.prototype.updateTransform=function(){this.updateText(!0),r.prototype.updateTransform.call(this)},e.prototype.getBounds=function(t,i){return this.updateText(!0),this._textureID===-1&&(t=!1),r.prototype.getBounds.call(this,t,i)},e.prototype.getLocalBounds=function(t){return this.updateText(!0),r.prototype.getLocalBounds.call(this,t)},e.prototype._calculateBounds=function(){this.calculateVertices(),this._bounds.addQuad(this.vertexData)},e.prototype._generateFillStyle=function(t,i,n){var s=t.fill;if(Array.isArray(s)){if(s.length===1)return s[0]}else return s;var a,o=t.dropShadow?t.dropShadowDistance:0,h=t.padding||0,u=this.canvas.width/this._resolution-o-h*2,l=this.canvas.height/this._resolution-o-h*2,f=s.slice(),c=t.fillGradientStops.slice();if(!c.length)for(var d=f.length+1,v=1;v<d;++v)c.push(v/d);if(f.unshift(s[0]),c.unshift(0),f.push(s[s.length-1]),c.push(1),t.fillGradientType===Mr.LINEAR_VERTICAL){a=this.context.createLinearGradient(u/2,h,u/2,l+h);for(var p=n.fontProperties.fontSize+t.strokeThickness,v=0;v<i.length;v++){var _=n.lineHeight*(v-1)+p,m=n.lineHeight*v,g=m;v>0&&_>m&&(g=(m+_)/2);var y=m+p,b=n.lineHeight*(v+1),x=y;v+1<i.length&&b<y&&(x=(y+b)/2);for(var T=(x-g)/l,w=0;w<f.length;w++){var S=0;typeof c[w]=="number"?S=c[w]:S=w/f.length;var E=Math.min(1,Math.max(0,g/l+S*T));E=Number(E.toFixed(5)),a.addColorStop(E,f[w])}}}else{a=this.context.createLinearGradient(h,l/2,u+h,l/2);for(var P=f.length+1,O=1,v=0;v<f.length;v++){var D=void 0;typeof c[v]=="number"?D=c[v]:D=O/P,a.addColorStop(D,f[v]),O++}}return a},e.prototype.destroy=function(t){typeof t=="boolean"&&(t={children:t}),t=Object.assign({},Mg,t),r.prototype.destroy.call(this,t),this._ownCanvas&&(this.canvas.height=this.canvas.width=0),this.context=null,this.canvas=null,this._style=null},Object.defineProperty(e.prototype,"width",{get:function(){return this.updateText(!0),Math.abs(this.scale.x)*this._texture.orig.width},set:function(t){this.updateText(!0);var i=Vi(this.scale.x)||1;this.scale.x=i*t/this._texture.orig.width,this._width=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.updateText(!0),Math.abs(this.scale.y)*this._texture.orig.height},set:function(t){this.updateText(!0);var i=Vi(this.scale.y)||1;this.scale.y=i*t/this._texture.orig.height,this._height=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"style",{get:function(){return this._style},set:function(t){t=t||{},t instanceof ei?this._style=t:this._style=new ei(t),this.localStyleID=-1,this.dirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"text",{get:function(){return this._text},set:function(t){t=String(t??""),this._text!==t&&(this._text=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"resolution",{get:function(){return this._resolution},set:function(t){this._autoResolution=!1,this._resolution!==t&&(this._resolution=t,this.dirty=!0)},enumerable:!1,configurable:!0}),e.nextLineHeightBehavior=!1,e.experimentalLetterSpacing=!1,e}(We);L.UPLOADS_PER_FRAME=4;var ya=function(r,e){return ya=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},ya(r,e)};function Dg(r,e){ya(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Fg=function(){function r(e){this.maxItemsPerFrame=e,this.itemsLeft=0}return r.prototype.beginFrame=function(){this.itemsLeft=this.maxItemsPerFrame},r.prototype.allowedToUpload=function(){return this.itemsLeft-- >0},r}();function Ng(r,e){var t=!1;if(r&&r._textures&&r._textures.length){for(var i=0;i<r._textures.length;i++)if(r._textures[i]instanceof W){var n=r._textures[i].baseTexture;e.indexOf(n)===-1&&(e.push(n),t=!0)}}return t}function Lg(r,e){if(r.baseTexture instanceof Q){var t=r.baseTexture;return e.indexOf(t)===-1&&e.push(t),!0}return!1}function Bg(r,e){if(r._texture&&r._texture instanceof W){var t=r._texture.baseTexture;return e.indexOf(t)===-1&&e.push(t),!0}return!1}function Gg(r,e){return e instanceof xu?(e.updateText(!0),!0):!1}function Ug(r,e){if(e instanceof ei){var t=e.toFontString();return se.measureFont(t),!0}return!1}function kg(r,e){if(r instanceof xu){e.indexOf(r.style)===-1&&e.push(r.style),e.indexOf(r)===-1&&e.push(r);var t=r._texture.baseTexture;return e.indexOf(t)===-1&&e.push(t),!0}return!1}function Xg(r,e){return r instanceof ei?(e.indexOf(r)===-1&&e.push(r),!0):!1}var Hg=function(){function r(e){var t=this;this.limiter=new Fg(L.UPLOADS_PER_FRAME),this.renderer=e,this.uploadHookHelper=null,this.queue=[],this.addHooks=[],this.uploadHooks=[],this.completes=[],this.ticking=!1,this.delayedTick=function(){t.queue&&t.prepareItems()},this.registerFindHook(kg),this.registerFindHook(Xg),this.registerFindHook(Ng),this.registerFindHook(Lg),this.registerFindHook(Bg),this.registerUploadHook(Gg),this.registerUploadHook(Ug)}return r.prototype.upload=function(e,t){var i=this;return typeof e=="function"&&(t=e,e=null),t&&ge("6.5.0","BasePrepare.upload callback is deprecated, use the return Promise instead."),new Promise(function(n){e&&i.add(e);var s=function(){t==null||t(),n()};i.queue.length?(i.completes.push(s),i.ticking||(i.ticking=!0,Ft.system.addOnce(i.tick,i,re.UTILITY))):s()})},r.prototype.tick=function(){setTimeout(this.delayedTick,0)},r.prototype.prepareItems=function(){for(this.limiter.beginFrame();this.queue.length&&this.limiter.allowedToUpload();){var e=this.queue[0],t=!1;if(e&&!e._destroyed){for(var i=0,n=this.uploadHooks.length;i<n;i++)if(this.uploadHooks[i](this.uploadHookHelper,e)){this.queue.shift(),t=!0;break}}t||this.queue.shift()}if(this.queue.length)Ft.system.addOnce(this.tick,this,re.UTILITY);else{this.ticking=!1;var s=this.completes.slice(0);this.completes.length=0;for(var i=0,n=s.length;i<n;i++)s[i]()}},r.prototype.registerFindHook=function(e){return e&&this.addHooks.push(e),this},r.prototype.registerUploadHook=function(e){return e&&this.uploadHooks.push(e),this},r.prototype.add=function(e){for(var t=0,i=this.addHooks.length;t<i&&!this.addHooks[t](e,this.queue);t++);if(e instanceof yt)for(var t=e.children.length-1;t>=0;t--)this.add(e.children[t]);return this},r.prototype.destroy=function(){this.ticking&&Ft.system.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null},r}();function bu(r,e){return e instanceof Q?(e._glTextures[r.CONTEXT_UID]||r.texture.bind(e),!0):!1}function Wg(r,e){if(!(e instanceof ne))return!1;var t=e.geometry;e.finishPoly(),t.updateBatches();for(var i=t.batches,n=0;n<i.length;n++){var s=i[n].style.texture;s&&bu(r,s.baseTexture)}return t.batchable||r.geometry.bind(t,e._resolveDirectShader(r)),!0}function zg(r,e){return r instanceof ne?(e.push(r),!0):!1}var Vg=function(r){Dg(e,r);function e(t){var i=r.call(this,t)||this;return i.uploadHookHelper=i.renderer,i.registerFindHook(zg),i.registerUploadHook(bu),i.registerUploadHook(Wg),i}return e.extension={name:"prepare",type:nt.RendererPlugin},e}(Hg);var Yg=function(){function r(e,t,i){i===void 0&&(i=null),this.linkedSheets=[],this._texture=e instanceof W?e:null,this.baseTexture=e instanceof Q?e:this._texture.baseTexture,this.textures={},this.animations={},this.data=t;var n=this.baseTexture.resource;this.resolution=this._updateResolution(i||(n?n.url:null)),this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}return r.prototype._updateResolution=function(e){e===void 0&&(e=null);var t=this.data.meta.scale,i=dn(e,null);return i===null&&(i=t!==void 0?parseFloat(t):1),i!==1&&this.baseTexture.setResolution(i),i},r.prototype.parse=function(e){var t=this;return e&&ge("6.5.0","Spritesheet.parse callback is deprecated, use the return Promise instead."),new Promise(function(i){t._callback=function(n){e==null||e(n),i(n)},t._batchIndex=0,t._frameKeys.length<=r.BATCH_SIZE?(t._processFrames(0),t._processAnimations(),t._parseComplete()):t._nextBatch()})},r.prototype._processFrames=function(e){for(var t=e,i=r.BATCH_SIZE;t-e<i&&t<this._frameKeys.length;){var n=this._frameKeys[t],s=this._frames[n],a=s.frame;if(a){var o=null,h=null,u=s.trimmed!==!1&&s.sourceSize?s.sourceSize:s.frame,l=new Z(0,0,Math.floor(u.w)/this.resolution,Math.floor(u.h)/this.resolution);s.rotated?o=new Z(Math.floor(a.x)/this.resolution,Math.floor(a.y)/this.resolution,Math.floor(a.h)/this.resolution,Math.floor(a.w)/this.resolution):o=new Z(Math.floor(a.x)/this.resolution,Math.floor(a.y)/this.resolution,Math.floor(a.w)/this.resolution,Math.floor(a.h)/this.resolution),s.trimmed!==!1&&s.spriteSourceSize&&(h=new Z(Math.floor(s.spriteSourceSize.x)/this.resolution,Math.floor(s.spriteSourceSize.y)/this.resolution,Math.floor(a.w)/this.resolution,Math.floor(a.h)/this.resolution)),this.textures[n]=new W(this.baseTexture,o,l,h,s.rotated?2:0,s.anchor),W.addToCache(this.textures[n],n)}t++}},r.prototype._processAnimations=function(){var e=this.data.animations||{};for(var t in e){this.animations[t]=[];for(var i=0;i<e[t].length;i++){var n=e[t][i];this.animations[t].push(this.textures[n])}}},r.prototype._parseComplete=function(){var e=this._callback;this._callback=null,this._batchIndex=0,e.call(this,this.textures)},r.prototype._nextBatch=function(){var e=this;this._processFrames(this._batchIndex*r.BATCH_SIZE),this._batchIndex++,setTimeout(function(){e._batchIndex*r.BATCH_SIZE<e._frameKeys.length?e._nextBatch():(e._processAnimations(),e._parseComplete())},0)},r.prototype.destroy=function(e){var t;e===void 0&&(e=!1);for(var i in this.textures)this.textures[i].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,e&&((t=this._texture)===null||t===void 0||t.destroy(),this.baseTexture.destroy()),this._texture=null,this.baseTexture=null,this.linkedSheets=[]},r.BATCH_SIZE=1e3,r}(),jg=function(){function r(){}return r.use=function(e,t){var i,n,s=this,a=e.name+"_image";if(!e.data||e.type!==xt.TYPE.JSON||!e.data.frames||s.resources[a]){t();return}var o=(n=(i=e.data)===null||i===void 0?void 0:i.meta)===null||n===void 0?void 0:n.related_multi_packs;if(Array.isArray(o))for(var h=function(v){if(typeof v!="string")return"continue";var p=v.replace(".json",""),_=Hi.resolve(e.url.replace(s.baseUrl,""),v);if(s.resources[p]||Object.values(s.resources).some(function(g){return Hi.format(Hi.parse(g.url))===_}))return"continue";var m={crossOrigin:e.crossOrigin,loadType:xt.LOAD_TYPE.XHR,xhrType:xt.XHR_RESPONSE_TYPE.JSON,parentResource:e,metadata:e.metadata};s.add(p,_,m)},u=0,l=o;u<l.length;u++){var f=l[u];h(f)}var c={crossOrigin:e.crossOrigin,metadata:e.metadata.imageMetadata,parentResource:e},d=r.getResourcePath(e,s.baseUrl);s.add(a,d,c,function(p){if(p.error){t(p.error);return}var _=new Yg(p.texture,e.data,e.url);_.parse().then(function(){e.spritesheet=_,e.textures=_.textures,t()})})},r.getResourcePath=function(e,t){return e.isDataUrl?e.data.meta.image:Hi.resolve(e.url.replace(t,""),e.data.meta.image)},r.extension=nt.Loader,r}();var xa=function(r,e){return xa=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},xa(r,e)};function Tu(r,e){xa(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Dr=new j;(function(r){Tu(e,r);function e(t,i,n){i===void 0&&(i=100),n===void 0&&(n=100);var s=r.call(this,t)||this;return s.tileTransform=new Po,s._width=i,s._height=n,s.uvMatrix=s.texture.uvMatrix||new Ys(t),s.pluginName="tilingSprite",s.uvRespectAnchor=!1,s}return Object.defineProperty(e.prototype,"clampMargin",{get:function(){return this.uvMatrix.clampMargin},set:function(t){this.uvMatrix.clampMargin=t,this.uvMatrix.update(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tileScale",{get:function(){return this.tileTransform.scale},set:function(t){this.tileTransform.scale.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tilePosition",{get:function(){return this.tileTransform.position},set:function(t){this.tileTransform.position.copyFrom(t)},enumerable:!1,configurable:!0}),e.prototype._onTextureUpdate=function(){this.uvMatrix&&(this.uvMatrix.texture=this._texture),this._cachedTint=16777215},e.prototype._render=function(t){var i=this._texture;!i||!i.valid||(this.tileTransform.updateLocalTransform(),this.uvMatrix.update(),t.batch.setObjectRenderer(t.plugins[this.pluginName]),t.plugins[this.pluginName].render(this))},e.prototype._calculateBounds=function(){var t=this._width*-this._anchor._x,i=this._height*-this._anchor._y,n=this._width*(1-this._anchor._x),s=this._height*(1-this._anchor._y);this._bounds.addFrame(this.transform,t,i,n,s)},e.prototype.getLocalBounds=function(t){return this.children.length===0?(this._bounds.minX=this._width*-this._anchor._x,this._bounds.minY=this._height*-this._anchor._y,this._bounds.maxX=this._width*(1-this._anchor._x),this._bounds.maxY=this._height*(1-this._anchor._y),t||(this._localBoundsRect||(this._localBoundsRect=new Z),t=this._localBoundsRect),this._bounds.getRectangle(t)):r.prototype.getLocalBounds.call(this,t)},e.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,Dr);var i=this._width,n=this._height,s=-i*this.anchor._x;if(Dr.x>=s&&Dr.x<s+i){var a=-n*this.anchor._y;if(Dr.y>=a&&Dr.y<a+n)return!0}return!1},e.prototype.destroy=function(t){r.prototype.destroy.call(this,t),this.tileTransform=null,this.uvMatrix=null},e.from=function(t,i){var n=t instanceof W?t:W.from(t,i);return new e(n,i.width,i.height)},Object.defineProperty(e.prototype,"width",{get:function(){return this._width},set:function(t){this._width=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._height},set:function(t){this._height=t},enumerable:!1,configurable:!0}),e})(We);var Zg=`#version 100
528
+ `,mg=function(r){lu(e,r);function e(t){var i=r.call(this,t)||this;return i.shader=null,i.properties=null,i.tempMatrix=new Ct,i.properties=[{attributeName:"aVertexPosition",size:2,uploadFunction:i.uploadVertices,offset:0},{attributeName:"aPositionCoord",size:2,uploadFunction:i.uploadPosition,offset:0},{attributeName:"aRotation",size:1,uploadFunction:i.uploadRotation,offset:0},{attributeName:"aTextureCoord",size:2,uploadFunction:i.uploadUvs,offset:0},{attributeName:"aColor",size:1,type:k.UNSIGNED_BYTE,uploadFunction:i.uploadTint,offset:0}],i.shader=$e.from(_g,vg,{}),i.state=wi.for2d(),i}return e.prototype.render=function(t){var i=t.children,n=t._maxSize,s=t._batchSize,a=this.renderer,o=i.length;if(o!==0){o>n&&!t.autoResize&&(o=n);var h=t._buffers;h||(h=t._buffers=this.generateBuffers(t));var u=i[0]._texture.baseTexture,l=u.alphaMode>0;this.state.blendMode=lh(t.blendMode,l),a.state.set(this.state);var f=a.gl,c=t.worldTransform.copyTo(this.tempMatrix);c.prepend(a.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=c.toArray(!0),this.shader.uniforms.uColor=Iv(t.tintRgb,t.worldAlpha,this.shader.uniforms.uColor,l),this.shader.uniforms.uSampler=u,this.renderer.shader.bind(this.shader);for(var d=!1,v=0,p=0;v<o;v+=s,p+=1){var _=o-v;_>s&&(_=s),p>=h.length&&h.push(this._generateOneMoreBuffer(t));var m=h[p];m.uploadDynamic(i,v,_);var g=t._bufferUpdateIDs[p]||0;d=d||m._updateID<g,d&&(m._updateID=t._updateID,m.uploadStatic(i,v,_)),a.geometry.bind(m.geometry),f.drawElements(f.TRIANGLES,_*6,f.UNSIGNED_SHORT,0)}}},e.prototype.generateBuffers=function(t){for(var i=[],n=t._maxSize,s=t._batchSize,a=t._properties,o=0;o<n;o+=s)i.push(new fu(this.properties,a,s));return i},e.prototype._generateOneMoreBuffer=function(t){var i=t._batchSize,n=t._properties;return new fu(this.properties,n,i)},e.prototype.uploadVertices=function(t,i,n,s,a,o){for(var h=0,u=0,l=0,f=0,c=0;c<n;++c){var d=t[i+c],v=d._texture,p=d.scale.x,_=d.scale.y,m=v.trim,g=v.orig;m?(u=m.x-d.anchor.x*g.width,h=u+m.width,f=m.y-d.anchor.y*g.height,l=f+m.height):(h=g.width*(1-d.anchor.x),u=g.width*-d.anchor.x,l=g.height*(1-d.anchor.y),f=g.height*-d.anchor.y),s[o]=u*p,s[o+1]=f*_,s[o+a]=h*p,s[o+a+1]=f*_,s[o+a*2]=h*p,s[o+a*2+1]=l*_,s[o+a*3]=u*p,s[o+a*3+1]=l*_,o+=a*4}},e.prototype.uploadPosition=function(t,i,n,s,a,o){for(var h=0;h<n;h++){var u=t[i+h].position;s[o]=u.x,s[o+1]=u.y,s[o+a]=u.x,s[o+a+1]=u.y,s[o+a*2]=u.x,s[o+a*2+1]=u.y,s[o+a*3]=u.x,s[o+a*3+1]=u.y,o+=a*4}},e.prototype.uploadRotation=function(t,i,n,s,a,o){for(var h=0;h<n;h++){var u=t[i+h].rotation;s[o]=u,s[o+a]=u,s[o+a*2]=u,s[o+a*3]=u,o+=a*4}},e.prototype.uploadUvs=function(t,i,n,s,a,o){for(var h=0;h<n;++h){var u=t[i+h]._texture._uvs;u?(s[o]=u.x0,s[o+1]=u.y0,s[o+a]=u.x1,s[o+a+1]=u.y1,s[o+a*2]=u.x2,s[o+a*2+1]=u.y2,s[o+a*3]=u.x3,s[o+a*3+1]=u.y3,o+=a*4):(s[o]=0,s[o+1]=0,s[o+a]=0,s[o+a+1]=0,s[o+a*2]=0,s[o+a*2+1]=0,s[o+a*3]=0,s[o+a*3+1]=0,o+=a*4)}},e.prototype.uploadTint=function(t,i,n,s,a,o){for(var h=0;h<n;++h){var u=t[i+h],l=u._texture.baseTexture.alphaMode>0,f=u.alpha,c=f<1&&l?Os(u._tintRGB,f):u._tintRGB+(f*255<<24);s[o]=c,s[o+a]=c,s[o+a*2]=c,s[o+a*3]=c,o+=a*4}},e.prototype.destroy=function(){r.prototype.destroy.call(this),this.shader&&(this.shader.destroy(),this.shader=null),this.tempMatrix=null},e.extension={name:"particle",type:nt.RendererPlugin},e}(mn);var He;(function(r){r.MITER="miter",r.BEVEL="bevel",r.ROUND="round"})(He||(He={}));var ti;(function(r){r.BUTT="butt",r.ROUND="round",r.SQUARE="square"})(ti||(ti={}));var Ar={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount:function(r,e){if(e===void 0&&(e=20),!this.adaptive||!r||isNaN(r))return e;var t=Math.ceil(r/this.maxLength);return t<this.minSegments?t=this.minSegments:t>this.maxSegments&&(t=this.maxSegments),t}},cu=function(){function r(){this.color=16777215,this.alpha=1,this.texture=V.WHITE,this.matrix=null,this.visible=!1,this.reset()}return r.prototype.clone=function(){var e=new r;return e.color=this.color,e.alpha=this.alpha,e.texture=this.texture,e.matrix=this.matrix,e.visible=this.visible,e},r.prototype.reset=function(){this.color=16777215,this.alpha=1,this.texture=V.WHITE,this.matrix=null,this.visible=!1},r.prototype.destroy=function(){this.texture=null,this.matrix=null},r}();var la=function(r,e){return la=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},la(r,e)};function fa(r,e){la(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function du(r,e){var t,i;e===void 0&&(e=!1);var n=r.length;if(!(n<6)){for(var s=0,a=0,o=r[n-2],h=r[n-1];a<n;a+=2){var u=r[a],l=r[a+1];s+=(u-o)*(l+h),o=u,h=l}if(!e&&s>0||e&&s<=0)for(var f=n/2,a=f+f%2;a<n;a+=2){var c=n-a-2,d=n-a-1,v=a,p=a+1;t=[r[v],r[c]],r[c]=t[0],r[v]=t[1],i=[r[p],r[d]],r[d]=i[0],r[p]=i[1]}}}var pu={build:function(r){r.points=r.shape.points.slice()},triangulate:function(r,e){var t=r.points,i=r.holes,n=e.points,s=e.indices;if(t.length>=6){du(t,!1);for(var a=[],o=0;o<i.length;o++){var h=i[o];du(h.points,!0),a.push(t.length/2),t=t.concat(h.points)}var u=sn.exports(t,a,2);if(!u)return;for(var l=n.length/2,o=0;o<u.length;o+=3)s.push(u[o]+l),s.push(u[o+1]+l),s.push(u[o+2]+l);for(var o=0;o<t.length;o++)n.push(t[o])}}},Mn={build:function(r){var e=r.points,t,i,n,s,a,o;if(r.type===Mt.CIRC){var h=r.shape;t=h.x,i=h.y,a=o=h.radius,n=s=0}else if(r.type===Mt.ELIP){var u=r.shape;t=u.x,i=u.y,a=u.width,o=u.height,n=s=0}else{var l=r.shape,f=l.width/2,c=l.height/2;t=l.x+f,i=l.y+c,a=o=Math.max(0,Math.min(l.radius,Math.min(f,c))),n=f-a,s=c-o}if(!(a>=0&&o>=0&&n>=0&&s>=0)){e.length=0;return}var d=Math.ceil(2.3*Math.sqrt(a+o)),v=d*8+(n?4:0)+(s?4:0);if(e.length=v,v!==0){if(d===0){e.length=8,e[0]=e[6]=t+n,e[1]=e[3]=i+s,e[2]=e[4]=t-n,e[5]=e[7]=i-s;return}var p=0,_=d*4+(n?2:0)+2,m=_,g=v;{var y=n+a,b=s,x=t+y,T=t-y,w=i+b;if(e[p++]=x,e[p++]=w,e[--_]=w,e[--_]=T,s){var S=i-b;e[m++]=T,e[m++]=S,e[--g]=S,e[--g]=x}}for(var E=1;E<d;E++){var P=Math.PI/2*(E/d),y=n+Math.cos(P)*a,b=s+Math.sin(P)*o,x=t+y,T=t-y,w=i+b,S=i-b;e[p++]=x,e[p++]=w,e[--_]=w,e[--_]=T,e[m++]=T,e[m++]=S,e[--g]=S,e[--g]=x}{var y=n,b=s+o,x=t+y,T=t-y,w=i+b,S=i-b;e[p++]=x,e[p++]=w,e[--g]=S,e[--g]=x,n&&(e[p++]=T,e[p++]=w,e[--g]=S,e[--g]=T)}}},triangulate:function(r,e){var t=r.points,i=e.points,n=e.indices;if(t.length!==0){var s=i.length/2,a=s,o,h;if(r.type!==Mt.RREC){var u=r.shape;o=u.x,h=u.y}else{var l=r.shape;o=l.x+l.width/2,h=l.y+l.height/2}var f=r.matrix;i.push(r.matrix?f.a*o+f.c*h+f.tx:o,r.matrix?f.b*o+f.d*h+f.ty:h),s++,i.push(t[0],t[1]);for(var c=2;c<t.length;c+=2)i.push(t[c],t[c+1]),n.push(s++,a,s);n.push(a+1,a,s)}}},gg={build:function(r){var e=r.shape,t=e.x,i=e.y,n=e.width,s=e.height,a=r.points;a.length=0,a.push(t,i,t+n,i,t+n,i+s,t,i+s)},triangulate:function(r,e){var t=r.points,i=e.points,n=i.length/2;i.push(t[0],t[1],t[2],t[3],t[6],t[7],t[4],t[5]),e.indices.push(n,n+1,n+2,n+1,n+2,n+3)}};function ji(r,e,t){var i=e-r;return r+i*t}function Dn(r,e,t,i,n,s,a){a===void 0&&(a=[]);for(var o=20,h=a,u=0,l=0,f=0,c=0,d=0,v=0,p=0,_=0;p<=o;++p)_=p/o,u=ji(r,t,_),l=ji(e,i,_),f=ji(t,n,_),c=ji(i,s,_),d=ji(u,f,_),v=ji(l,c,_),!(p===0&&h[h.length-2]===d&&h[h.length-1]===v)&&h.push(d,v);return h}var yg={build:function(r){if(ne.nextRoundedRectBehavior){Mn.build(r);return}var e=r.shape,t=r.points,i=e.x,n=e.y,s=e.width,a=e.height,o=Math.max(0,Math.min(e.radius,Math.min(s,a)/2));t.length=0,o?(Dn(i,n+o,i,n,i+o,n,t),Dn(i+s-o,n,i+s,n,i+s,n+o,t),Dn(i+s,n+a-o,i+s,n+a,i+s-o,n+a,t),Dn(i+o,n+a,i,n+a,i,n+a-o,t)):t.push(i,n,i+s,n,i+s,n+a,i,n+a)},triangulate:function(r,e){if(ne.nextRoundedRectBehavior){Mn.triangulate(r,e);return}for(var t=r.points,i=e.points,n=e.indices,s=i.length/2,a=sn.exports(t,null,2),o=0,h=a.length;o<h;o+=3)n.push(a[o]+s),n.push(a[o+1]+s),n.push(a[o+2]+s);for(var o=0,h=t.length;o<h;o++)i.push(t[o],t[++o])}};function vu(r,e,t,i,n,s,a,o){var h=r-t*n,u=e-i*n,l=r+t*s,f=e+i*s,c,d;a?(c=i,d=-t):(c=-i,d=t);var v=h+c,p=u+d,_=l+c,m=f+d;return o.push(v,p),o.push(_,m),2}function Pi(r,e,t,i,n,s,a,o){var h=t-r,u=i-e,l=Math.atan2(h,u),f=Math.atan2(n-r,s-e);o&&l<f?l+=Math.PI*2:!o&&l>f&&(f+=Math.PI*2);var c=l,d=f-l,v=Math.abs(d),p=Math.sqrt(h*h+u*u),_=(15*v*Math.sqrt(p)/Math.PI>>0)+1,m=d/_;if(c+=m,o){a.push(r,e),a.push(t,i);for(var g=1,y=c;g<_;g++,y+=m)a.push(r,e),a.push(r+Math.sin(y)*p,e+Math.cos(y)*p);a.push(r,e),a.push(n,s)}else{a.push(t,i),a.push(r,e);for(var g=1,y=c;g<_;g++,y+=m)a.push(r+Math.sin(y)*p,e+Math.cos(y)*p),a.push(r,e);a.push(n,s),a.push(r,e)}return _*2}function xg(r,e){var t=r.shape,i=r.points||t.points.slice(),n=e.closePointEps;if(i.length!==0){var s=r.lineStyle,a=new j(i[0],i[1]),o=new j(i[i.length-2],i[i.length-1]),h=t.type!==Mt.POLY||t.closeStroke,u=Math.abs(a.x-o.x)<n&&Math.abs(a.y-o.y)<n;if(h){i=i.slice(),u&&(i.pop(),i.pop(),o.set(i[i.length-2],i[i.length-1]));var l=(a.x+o.x)*.5,f=(o.y+a.y)*.5;i.unshift(l,f),i.push(l,f)}var c=e.points,d=i.length/2,v=i.length,p=c.length/2,_=s.width/2,m=_*_,g=s.miterLimit*s.miterLimit,y=i[0],b=i[1],x=i[2],T=i[3],w=0,S=0,E=-(b-T),P=y-x,O=0,M=0,F=Math.sqrt(E*E+P*P);E/=F,P/=F,E*=_,P*=_;var G=s.alignment,A=(1-G)*2,I=G*2;h||(s.cap===ti.ROUND?v+=Pi(y-E*(A-I)*.5,b-P*(A-I)*.5,y-E*A,b-P*A,y+E*I,b+P*I,c,!0)+2:s.cap===ti.SQUARE&&(v+=vu(y,b,E,P,A,I,!0,c))),c.push(y-E*A,b-P*A),c.push(y+E*I,b+P*I);for(var N=1;N<d-1;++N){y=i[(N-1)*2],b=i[(N-1)*2+1],x=i[N*2],T=i[N*2+1],w=i[(N+1)*2],S=i[(N+1)*2+1],E=-(b-T),P=y-x,F=Math.sqrt(E*E+P*P),E/=F,P/=F,E*=_,P*=_,O=-(T-S),M=x-w,F=Math.sqrt(O*O+M*M),O/=F,M/=F,O*=_,M*=_;var Y=x-y,H=b-T,R=x-w,C=S-T,B=Y*R+H*C,Z=H*R-C*Y,W=Z<0;if(Math.abs(Z)<.001*Math.abs(B)){c.push(x-E*A,T-P*A),c.push(x+E*I,T+P*I),B>=0&&(s.join===He.ROUND?v+=Pi(x,T,x-E*A,T-P*A,x-O*A,T-M*A,c,!1)+4:v+=2,c.push(x-O*I,T-M*I),c.push(x+O*A,T+M*A));continue}var J=(-E+y)*(-P+T)-(-E+x)*(-P+b),ut=(-O+w)*(-M+T)-(-O+x)*(-M+S),ft=(Y*ut-R*J)/Z,Lt=(C*J-H*ut)/Z,Gt=(ft-x)*(ft-x)+(Lt-T)*(Lt-T),St=x+(ft-x)*A,st=T+(Lt-T)*A,lt=x-(ft-x)*I,ct=T-(Lt-T)*I,et=Math.min(Y*Y+H*H,R*R+C*C),Vt=W?A:I,qt=et+Vt*Vt*m,it=Gt<=qt;it?s.join===He.BEVEL||Gt/m>g?(W?(c.push(St,st),c.push(x+E*I,T+P*I),c.push(St,st),c.push(x+O*I,T+M*I)):(c.push(x-E*A,T-P*A),c.push(lt,ct),c.push(x-O*A,T-M*A),c.push(lt,ct)),v+=2):s.join===He.ROUND?W?(c.push(St,st),c.push(x+E*I,T+P*I),v+=Pi(x,T,x+E*I,T+P*I,x+O*I,T+M*I,c,!0)+4,c.push(St,st),c.push(x+O*I,T+M*I)):(c.push(x-E*A,T-P*A),c.push(lt,ct),v+=Pi(x,T,x-E*A,T-P*A,x-O*A,T-M*A,c,!1)+4,c.push(x-O*A,T-M*A),c.push(lt,ct)):(c.push(St,st),c.push(lt,ct)):(c.push(x-E*A,T-P*A),c.push(x+E*I,T+P*I),s.join===He.ROUND?W?v+=Pi(x,T,x+E*I,T+P*I,x+O*I,T+M*I,c,!0)+2:v+=Pi(x,T,x-E*A,T-P*A,x-O*A,T-M*A,c,!1)+2:s.join===He.MITER&&Gt/m<=g&&(W?(c.push(lt,ct),c.push(lt,ct)):(c.push(St,st),c.push(St,st)),v+=2),c.push(x-O*A,T-M*A),c.push(x+O*I,T+M*I),v+=2)}y=i[(d-2)*2],b=i[(d-2)*2+1],x=i[(d-1)*2],T=i[(d-1)*2+1],E=-(b-T),P=y-x,F=Math.sqrt(E*E+P*P),E/=F,P/=F,E*=_,P*=_,c.push(x-E*A,T-P*A),c.push(x+E*I,T+P*I),h||(s.cap===ti.ROUND?v+=Pi(x-E*(A-I)*.5,T-P*(A-I)*.5,x-E*A,T-P*A,x+E*I,T+P*I,c,!1)+2:s.cap===ti.SQUARE&&(v+=vu(x,T,E,P,A,I,!1,c)));for(var Ne=e.indices,fr=Ar.epsilon*Ar.epsilon,N=p;N<v+p-2;++N)y=c[N*2],b=c[N*2+1],x=c[(N+1)*2],T=c[(N+1)*2+1],w=c[(N+2)*2],S=c[(N+2)*2+1],!(Math.abs(y*(T-S)+x*(S-b)+w*(b-T))<fr)&&Ne.push(N,N+1,N+2)}}function bg(r,e){var t=0,i=r.shape,n=r.points||i.points,s=i.type!==Mt.POLY||i.closeStroke;if(n.length!==0){var a=e.points,o=e.indices,h=n.length/2,u=a.length/2,l=u;for(a.push(n[0],n[1]),t=1;t<h;t++)a.push(n[t*2],n[t*2+1]),o.push(l,l+1),l++;s&&o.push(l,u)}}function _u(r,e){r.lineStyle.native?bg(r,e):xg(r,e)}var mu=function(){function r(){}return r.curveTo=function(e,t,i,n,s,a){var o=a[a.length-2],h=a[a.length-1],u=h-t,l=o-e,f=n-t,c=i-e,d=Math.abs(u*c-l*f);if(d<1e-8||s===0)return(a[a.length-2]!==e||a[a.length-1]!==t)&&a.push(e,t),null;var v=u*u+l*l,p=f*f+c*c,_=u*f+l*c,m=s*Math.sqrt(v)/d,g=s*Math.sqrt(p)/d,y=m*_/v,b=g*_/p,x=m*c+g*l,T=m*f+g*u,w=l*(g+y),S=u*(g+y),E=c*(m+b),P=f*(m+b),O=Math.atan2(S-T,w-x),M=Math.atan2(P-T,E-x);return{cx:x+e,cy:T+t,radius:s,startAngle:O,endAngle:M,anticlockwise:l*f>c*u}},r.arc=function(e,t,i,n,s,a,o,h,u){for(var l=o-a,f=Ar._segmentsCount(Math.abs(l)*s,Math.ceil(Math.abs(l)/Se)*40),c=l/(f*2),d=c*2,v=Math.cos(c),p=Math.sin(c),_=f-1,m=_%1/_,g=0;g<=_;++g){var y=g+m*g,b=c+a+d*y,x=Math.cos(b),T=-Math.sin(b);u.push((v*x+p*T)*s+i,(v*-T+p*x)*s+n)}},r}(),Tg=function(){function r(){}return r.curveLength=function(e,t,i,n,s,a,o,h){for(var u=10,l=0,f=0,c=0,d=0,v=0,p=0,_=0,m=0,g=0,y=0,b=0,x=e,T=t,w=1;w<=u;++w)f=w/u,c=f*f,d=c*f,v=1-f,p=v*v,_=p*v,m=_*e+3*p*f*i+3*v*c*s+d*o,g=_*t+3*p*f*n+3*v*c*a+d*h,y=x-m,b=T-g,x=m,T=g,l+=Math.sqrt(y*y+b*b);return l},r.curveTo=function(e,t,i,n,s,a,o){var h=o[o.length-2],u=o[o.length-1];o.length-=2;var l=Ar._segmentsCount(r.curveLength(h,u,e,t,i,n,s,a)),f=0,c=0,d=0,v=0,p=0;o.push(h,u);for(var _=1,m=0;_<=l;++_)m=_/l,f=1-m,c=f*f,d=c*f,v=m*m,p=v*m,o.push(d*h+3*c*m*e+3*f*v*i+p*s,d*u+3*c*m*t+3*f*v*n+p*a)},r}(),wg=function(){function r(){}return r.curveLength=function(e,t,i,n,s,a){var o=e-2*i+s,h=t-2*n+a,u=2*i-2*e,l=2*n-2*t,f=4*(o*o+h*h),c=4*(o*u+h*l),d=u*u+l*l,v=2*Math.sqrt(f+c+d),p=Math.sqrt(f),_=2*f*p,m=2*Math.sqrt(d),g=c/p;return(_*v+p*c*(v-m)+(4*d*f-c*c)*Math.log((2*p+g+v)/(g+m)))/(4*_)},r.curveTo=function(e,t,i,n,s){for(var a=s[s.length-2],o=s[s.length-1],h=Ar._segmentsCount(r.curveLength(a,o,e,t,i,n)),u=0,l=0,f=1;f<=h;++f){var c=f/h;u=a+(e-a)*c,l=o+(t-o)*c,s.push(u+(e+(i-e)*c-u)*c,l+(t+(n-t)*c-l)*c)}},r}(),Eg=function(){function r(){this.reset()}return r.prototype.begin=function(e,t,i){this.reset(),this.style=e,this.start=t,this.attribStart=i},r.prototype.end=function(e,t){this.attribSize=t-this.attribStart,this.size=e-this.start},r.prototype.reset=function(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0},r}(),Ri,ca=(Ri={},Ri[Mt.POLY]=pu,Ri[Mt.CIRC]=Mn,Ri[Mt.ELIP]=Mn,Ri[Mt.RECT]=gg,Ri[Mt.RREC]=yg,Ri),gu=[],Fn=[],yu=function(){function r(e,t,i,n){t===void 0&&(t=null),i===void 0&&(i=null),n===void 0&&(n=null),this.points=[],this.holes=[],this.shape=e,this.lineStyle=i,this.fillStyle=t,this.matrix=n,this.type=e.type}return r.prototype.clone=function(){return new r(this.shape,this.fillStyle,this.lineStyle,this.matrix)},r.prototype.destroy=function(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null},r}(),Zi=new j,Sg=function(r){fa(e,r);function e(){var t=r.call(this)||this;return t.closePointEps=1e-4,t.boundsPadding=0,t.uvsFloat32=null,t.indicesUint16=null,t.batchable=!1,t.points=[],t.colors=[],t.uvs=[],t.indices=[],t.textureIds=[],t.graphicsData=[],t.drawCalls=[],t.batchDirty=-1,t.batches=[],t.dirty=0,t.cacheDirty=-1,t.clearDirty=0,t.shapeIndex=0,t._bounds=new pn,t.boundsDirty=-1,t}return Object.defineProperty(e.prototype,"bounds",{get:function(){return this.updateBatches(),this.boundsDirty!==this.dirty&&(this.boundsDirty=this.dirty,this.calculateBounds()),this._bounds},enumerable:!1,configurable:!0}),e.prototype.invalidate=function(){this.boundsDirty=-1,this.dirty++,this.batchDirty++,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(var t=0;t<this.drawCalls.length;t++)this.drawCalls[t].texArray.clear(),Fn.push(this.drawCalls[t]);this.drawCalls.length=0;for(var t=0;t<this.batches.length;t++){var i=this.batches[t];i.reset(),gu.push(i)}this.batches.length=0},e.prototype.clear=function(){return this.graphicsData.length>0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this},e.prototype.drawShape=function(t,i,n,s){i===void 0&&(i=null),n===void 0&&(n=null),s===void 0&&(s=null);var a=new yu(t,i,n,s);return this.graphicsData.push(a),this.dirty++,this},e.prototype.drawHole=function(t,i){if(i===void 0&&(i=null),!this.graphicsData.length)return null;var n=new yu(t,null,null,i),s=this.graphicsData[this.graphicsData.length-1];return n.lineStyle=s.lineStyle,s.holes.push(n),this.dirty++,this},e.prototype.destroy=function(){r.prototype.destroy.call(this);for(var t=0;t<this.graphicsData.length;++t)this.graphicsData[t].destroy();this.points.length=0,this.points=null,this.colors.length=0,this.colors=null,this.uvs.length=0,this.uvs=null,this.indices.length=0,this.indices=null,this.indexBuffer.destroy(),this.indexBuffer=null,this.graphicsData.length=0,this.graphicsData=null,this.drawCalls.length=0,this.drawCalls=null,this.batches.length=0,this.batches=null,this._bounds=null},e.prototype.containsPoint=function(t){for(var i=this.graphicsData,n=0;n<i.length;++n){var s=i[n];if(s.fillStyle.visible&&s.shape&&(s.matrix?s.matrix.applyInverse(t,Zi):Zi.copyFrom(t),s.shape.contains(Zi.x,Zi.y))){var a=!1;if(s.holes)for(var o=0;o<s.holes.length;o++){var h=s.holes[o];if(h.shape.contains(Zi.x,Zi.y)){a=!0;break}}if(!a)return!0}}return!1},e.prototype.updateBatches=function(){if(!this.graphicsData.length){this.batchable=!0;return}if(this.validateBatching()){this.cacheDirty=this.dirty;var t=this.uvs,i=this.graphicsData,n=null,s=null;this.batches.length>0&&(n=this.batches[this.batches.length-1],s=n.style);for(var a=this.shapeIndex;a<i.length;a++){this.shapeIndex++;var o=i[a],h=o.fillStyle,u=o.lineStyle,l=ca[o.type];l.build(o),o.matrix&&this.transformPoints(o.points,o.matrix),(h.visible||u.visible)&&this.processHoles(o.holes);for(var f=0;f<2;f++){var c=f===0?h:u;if(c.visible){var d=c.texture.baseTexture,v=this.indices.length,p=this.points.length/2;d.wrapMode=Re.REPEAT,f===0?this.processFill(o):this.processLine(o);var _=this.points.length/2-p;_!==0&&(n&&!this._compareStyles(s,c)&&(n.end(v,p),n=null),n||(n=gu.pop()||new Eg,n.begin(c,v,p),this.batches.push(n),s=c),this.addUvs(this.points,t,c.texture,p,_,c.matrix))}}}var m=this.indices.length,g=this.points.length/2;if(n&&n.end(m,g),this.batches.length===0){this.batchable=!0;return}var y=g>65535;this.indicesUint16&&this.indices.length===this.indicesUint16.length&&y===this.indicesUint16.BYTES_PER_ELEMENT>2?this.indicesUint16.set(this.indices):this.indicesUint16=y?new Uint32Array(this.indices):new Uint16Array(this.indices),this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()}},e.prototype._compareStyles=function(t,i){return!(!t||!i||t.texture.baseTexture!==i.texture.baseTexture||t.color+t.alpha!==i.color+i.alpha||!!t.native!=!!i.native)},e.prototype.validateBatching=function(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(var t=0,i=this.graphicsData.length;t<i;t++){var n=this.graphicsData[t],s=n.fillStyle,a=n.lineStyle;if(s&&!s.texture.baseTexture.valid||a&&!a.texture.baseTexture.valid)return!1}return!0},e.prototype.packBatches=function(){this.batchDirty++,this.uvsFloat32=new Float32Array(this.uvs);for(var t=this.batches,i=0,n=t.length;i<n;i++)for(var s=t[i],a=0;a<s.size;a++){var o=s.start+a;this.indicesUint16[o]=this.indicesUint16[o]-s.attribStart}},e.prototype.isBatchable=function(){if(this.points.length>65535*2)return!1;for(var t=this.batches,i=0;i<t.length;i++)if(t[i].style.native)return!1;return this.points.length<e.BATCHABLE_SIZE*2},e.prototype.buildDrawCalls=function(){for(var t=++tt._globalBatch,i=0;i<this.drawCalls.length;i++)this.drawCalls[i].texArray.clear(),Fn.push(this.drawCalls[i]);this.drawCalls.length=0;var n=this.colors,s=this.textureIds,a=Fn.pop();a||(a=new qs,a.texArray=new Ks),a.texArray.count=0,a.start=0,a.size=0,a.type=de.TRIANGLES;var o=0,h=null,u=0,l=!1,f=de.TRIANGLES,c=0;this.drawCalls.push(a);for(var i=0;i<this.batches.length;i++){var d=this.batches[i],v=8,p=d.style,_=p.texture.baseTexture;l!==!!p.native&&(l=!!p.native,f=l?de.LINES:de.TRIANGLES,h=null,o=v,t++),h!==_&&(h=_,_._batchEnabled!==t&&(o===v&&(t++,o=0,a.size>0&&(a=Fn.pop(),a||(a=new qs,a.texArray=new Ks),this.drawCalls.push(a)),a.start=c,a.size=0,a.texArray.count=0,a.type=f),_.touched=1,_._batchEnabled=t,_._batchLocation=o,_.wrapMode=Re.REPEAT,a.texArray.elements[a.texArray.count++]=_,o++)),a.size+=d.size,c+=d.size,u=_._batchLocation,this.addColors(n,p.color,p.alpha,d.attribSize,d.attribStart),this.addTextureIds(s,u,d.attribSize,d.attribStart)}tt._globalBatch=t,this.packAttributes()},e.prototype.packAttributes=function(){for(var t=this.points,i=this.uvs,n=this.colors,s=this.textureIds,a=new ArrayBuffer(t.length*3*4),o=new Float32Array(a),h=new Uint32Array(a),u=0,l=0;l<t.length/2;l++)o[u++]=t[l*2],o[u++]=t[l*2+1],o[u++]=i[l*2],o[u++]=i[l*2+1],h[u++]=n[l],o[u++]=s[l];this._buffer.update(a),this._indexBuffer.update(this.indicesUint16)},e.prototype.processFill=function(t){if(t.holes.length)pu.triangulate(t,this);else{var i=ca[t.type];i.triangulate(t,this)}},e.prototype.processLine=function(t){_u(t,this);for(var i=0;i<t.holes.length;i++)_u(t.holes[i],this)},e.prototype.processHoles=function(t){for(var i=0;i<t.length;i++){var n=t[i],s=ca[n.type];s.build(n),n.matrix&&this.transformPoints(n.points,n.matrix)}},e.prototype.calculateBounds=function(){var t=this._bounds;t.clear(),t.addVertexData(this.points,0,this.points.length),t.pad(this.boundsPadding,this.boundsPadding)},e.prototype.transformPoints=function(t,i){for(var n=0;n<t.length/2;n++){var s=t[n*2],a=t[n*2+1];t[n*2]=i.a*s+i.c*a+i.tx,t[n*2+1]=i.b*s+i.d*a+i.ty}},e.prototype.addColors=function(t,i,n,s,a){a===void 0&&(a=0);var o=(i>>16)+(i&65280)+((i&255)<<16),h=Os(o,n);t.length=Math.max(t.length,a+s);for(var u=0;u<s;u++)t[a+u]=h},e.prototype.addTextureIds=function(t,i,n,s){s===void 0&&(s=0),t.length=Math.max(t.length,s+n);for(var a=0;a<n;a++)t[s+a]=i},e.prototype.addUvs=function(t,i,n,s,a,o){o===void 0&&(o=null);for(var h=0,u=i.length,l=n.frame;h<a;){var f=t[(s+h)*2],c=t[(s+h)*2+1];if(o){var d=o.a*f+o.c*c+o.tx;c=o.b*f+o.d*c+o.ty,f=d}h++,i.push(f/l.width,c/l.height)}var v=n.baseTexture;(l.width<v.width||l.height<v.height)&&this.adjustUvs(i,n,u,a)},e.prototype.adjustUvs=function(t,i,n,s){for(var a=i.baseTexture,o=1e-6,h=n+s*2,u=i.frame,l=u.width/a.width,f=u.height/a.height,c=u.x/u.width,d=u.y/u.height,v=Math.floor(t[n]+o),p=Math.floor(t[n+1]+o),_=n+2;_<h;_+=2)v=Math.min(v,Math.floor(t[_]+o)),p=Math.min(p,Math.floor(t[_+1]+o));c-=v,d-=p;for(var _=n;_<h;_+=2)t[_]=(t[_]+c)*l,t[_+1]=(t[_+1]+d)*f},e.BATCHABLE_SIZE=100,e}(zh),Pg=function(r){fa(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.width=0,t.alignment=.5,t.native=!1,t.cap=ti.BUTT,t.join=He.MITER,t.miterLimit=10,t}return e.prototype.clone=function(){var t=new e;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t.width=this.width,t.alignment=this.alignment,t.native=this.native,t.cap=this.cap,t.join=this.join,t.miterLimit=this.miterLimit,t},e.prototype.reset=function(){r.prototype.reset.call(this),this.color=0,this.alignment=.5,this.width=0,this.native=!1},e}(cu),Rg=new Float32Array(3),da={},ne=function(r){fa(e,r);function e(t){t===void 0&&(t=null);var i=r.call(this)||this;return i.shader=null,i.pluginName="batch",i.currentPath=null,i.batches=[],i.batchTint=-1,i.batchDirty=-1,i.vertexData=null,i._fillStyle=new cu,i._lineStyle=new Pg,i._matrix=null,i._holeMode=!1,i.state=wi.for2d(),i._geometry=t||new Sg,i._geometry.refCount++,i._transformID=-1,i.tint=16777215,i.blendMode=X.NORMAL,i}return Object.defineProperty(e.prototype,"geometry",{get:function(){return this._geometry},enumerable:!1,configurable:!0}),e.prototype.clone=function(){return this.finishPoly(),new e(this._geometry)},Object.defineProperty(e.prototype,"blendMode",{get:function(){return this.state.blendMode},set:function(t){this.state.blendMode=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tint",{get:function(){return this._tint},set:function(t){this._tint=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fill",{get:function(){return this._fillStyle},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"line",{get:function(){return this._lineStyle},enumerable:!1,configurable:!0}),e.prototype.lineStyle=function(t,i,n,s,a){return t===void 0&&(t=null),i===void 0&&(i=0),n===void 0&&(n=1),s===void 0&&(s=.5),a===void 0&&(a=!1),typeof t=="number"&&(t={width:t,color:i,alpha:n,alignment:s,native:a}),this.lineTextureStyle(t)},e.prototype.lineTextureStyle=function(t){t=Object.assign({width:0,texture:V.WHITE,color:t&&t.texture?16777215:0,alpha:1,matrix:null,alignment:.5,native:!1,cap:ti.BUTT,join:He.MITER,miterLimit:10},t),this.currentPath&&this.startPoly();var i=t.width>0&&t.alpha>0;return i?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._lineStyle,{visible:i},t)):this._lineStyle.reset(),this},e.prototype.startPoly=function(){if(this.currentPath){var t=this.currentPath.points,i=this.currentPath.points.length;i>2&&(this.drawShape(this.currentPath),this.currentPath=new Jr,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[i-2],t[i-1]))}else this.currentPath=new Jr,this.currentPath.closeStroke=!1},e.prototype.finishPoly=function(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)},e.prototype.moveTo=function(t,i){return this.startPoly(),this.currentPath.points[0]=t,this.currentPath.points[1]=i,this},e.prototype.lineTo=function(t,i){this.currentPath||this.moveTo(0,0);var n=this.currentPath.points,s=n[n.length-2],a=n[n.length-1];return(s!==t||a!==i)&&n.push(t,i),this},e.prototype._initCurve=function(t,i){t===void 0&&(t=0),i===void 0&&(i=0),this.currentPath?this.currentPath.points.length===0&&(this.currentPath.points=[t,i]):this.moveTo(t,i)},e.prototype.quadraticCurveTo=function(t,i,n,s){this._initCurve();var a=this.currentPath.points;return a.length===0&&this.moveTo(0,0),wg.curveTo(t,i,n,s,a),this},e.prototype.bezierCurveTo=function(t,i,n,s,a,o){return this._initCurve(),Tg.curveTo(t,i,n,s,a,o,this.currentPath.points),this},e.prototype.arcTo=function(t,i,n,s,a){this._initCurve(t,i);var o=this.currentPath.points,h=mu.curveTo(t,i,n,s,a,o);if(h){var u=h.cx,l=h.cy,f=h.radius,c=h.startAngle,d=h.endAngle,v=h.anticlockwise;this.arc(u,l,f,c,d,v)}return this},e.prototype.arc=function(t,i,n,s,a,o){if(o===void 0&&(o=!1),s===a)return this;!o&&a<=s?a+=Se:o&&s<=a&&(s+=Se);var h=a-s;if(h===0)return this;var u=t+Math.cos(s)*n,l=i+Math.sin(s)*n,f=this._geometry.closePointEps,c=this.currentPath?this.currentPath.points:null;if(c){var d=Math.abs(c[c.length-2]-u),v=Math.abs(c[c.length-1]-l);d<f&&v<f||c.push(u,l)}else this.moveTo(u,l),c=this.currentPath.points;return mu.arc(u,l,t,i,n,s,a,o,c),this},e.prototype.beginFill=function(t,i){return t===void 0&&(t=0),i===void 0&&(i=1),this.beginTextureFill({texture:V.WHITE,color:t,alpha:i})},e.prototype.beginTextureFill=function(t){t=Object.assign({texture:V.WHITE,color:16777215,alpha:1,matrix:null},t),this.currentPath&&this.startPoly();var i=t.alpha>0;return i?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._fillStyle,{visible:i},t)):this._fillStyle.reset(),this},e.prototype.endFill=function(){return this.finishPoly(),this._fillStyle.reset(),this},e.prototype.drawRect=function(t,i,n,s){return this.drawShape(new q(t,i,n,s))},e.prototype.drawRoundedRect=function(t,i,n,s,a){return this.drawShape(new Rf(t,i,n,s,a))},e.prototype.drawCircle=function(t,i,n){return this.drawShape(new Sf(t,i,n))},e.prototype.drawEllipse=function(t,i,n,s){return this.drawShape(new Pf(t,i,n,s))},e.prototype.drawPolygon=function(){for(var t=arguments,i=[],n=0;n<arguments.length;n++)i[n]=t[n];var s,a=!0,o=i[0];o.points?(a=o.closeStroke,s=o.points):Array.isArray(i[0])?s=i[0]:s=i;var h=new Jr(s);return h.closeStroke=a,this.drawShape(h),this},e.prototype.drawShape=function(t){return this._holeMode?this._geometry.drawHole(t,this._matrix):this._geometry.drawShape(t,this._fillStyle.clone(),this._lineStyle.clone(),this._matrix),this},e.prototype.clear=function(){return this._geometry.clear(),this._lineStyle.reset(),this._fillStyle.reset(),this._boundsID++,this._matrix=null,this._holeMode=!1,this.currentPath=null,this},e.prototype.isFastRect=function(){var t=this._geometry.graphicsData;return t.length===1&&t[0].shape.type===Mt.RECT&&!t[0].matrix&&!t[0].holes.length&&!(t[0].lineStyle.visible&&t[0].lineStyle.width)},e.prototype._render=function(t){this.finishPoly();var i=this._geometry;i.updateBatches(),i.batchable?(this.batchDirty!==i.batchDirty&&this._populateBatches(),this._renderBatched(t)):(t.batch.flush(),this._renderDirect(t))},e.prototype._populateBatches=function(){var t=this._geometry,i=this.blendMode,n=t.batches.length;this.batchTint=-1,this._transformID=-1,this.batchDirty=t.batchDirty,this.batches.length=n,this.vertexData=new Float32Array(t.points);for(var s=0;s<n;s++){var a=t.batches[s],o=a.style.color,h=new Float32Array(this.vertexData.buffer,a.attribStart*4*2,a.attribSize*2),u=new Float32Array(t.uvsFloat32.buffer,a.attribStart*4*2,a.attribSize*2),l=new Uint16Array(t.indicesUint16.buffer,a.start*2,a.size),f={vertexData:h,blendMode:i,indices:l,uvs:u,_batchRGB:Wi(o),_tintRGB:o,_texture:a.style.texture,alpha:a.style.alpha,worldAlpha:1};this.batches[s]=f}},e.prototype._renderBatched=function(t){if(this.batches.length){t.batch.setObjectRenderer(t.plugins[this.pluginName]),this.calculateVertices(),this.calculateTints();for(var i=0,n=this.batches.length;i<n;i++){var s=this.batches[i];s.worldAlpha=this.worldAlpha*s.alpha,t.plugins[this.pluginName].render(s)}}},e.prototype._renderDirect=function(t){var i=this._resolveDirectShader(t),n=this._geometry,s=this.tint,a=this.worldAlpha,o=i.uniforms,h=n.drawCalls;o.translationMatrix=this.transform.worldTransform,o.tint[0]=(s>>16&255)/255*a,o.tint[1]=(s>>8&255)/255*a,o.tint[2]=(s&255)/255*a,o.tint[3]=a,t.shader.bind(i),t.geometry.bind(n,i),t.state.set(this.state);for(var u=0,l=h.length;u<l;u++)this._renderDrawCallDirect(t,n.drawCalls[u])},e.prototype._renderDrawCallDirect=function(t,i){for(var n=i.texArray,s=i.type,a=i.size,o=i.start,h=n.count,u=0;u<h;u++)t.texture.bind(n.elements[u],u);t.geometry.draw(s,a,o)},e.prototype._resolveDirectShader=function(t){var i=this.shader,n=this.pluginName;if(!i){if(!da[n]){for(var s=t.plugins[n].MAX_TEXTURES,a=new Int32Array(s),o=0;o<s;o++)a[o]=o;var h={tint:new Float32Array([1,1,1,1]),translationMatrix:new Ct,default:Ti.from({uSamplers:a},!0)},u=t.plugins[n]._shader.program;da[n]=new $e(u,h)}i=da[n]}return i},e.prototype._calculateBounds=function(){this.finishPoly();var t=this._geometry;if(t.graphicsData.length){var i=t.bounds,n=i.minX,s=i.minY,a=i.maxX,o=i.maxY;this._bounds.addFrame(this.transform,n,s,a,o)}},e.prototype.containsPoint=function(t){return this.worldTransform.applyInverse(t,e._TEMP_POINT),this._geometry.containsPoint(e._TEMP_POINT)},e.prototype.calculateTints=function(){if(this.batchTint!==this.tint){this.batchTint=this.tint;for(var t=Wi(this.tint,Rg),i=0;i<this.batches.length;i++){var n=this.batches[i],s=n._batchRGB,a=t[0]*s[0]*255,o=t[1]*s[1]*255,h=t[2]*s[2]*255,u=(a<<16)+(o<<8)+(h|0);n._tintRGB=(u>>16)+(u&65280)+((u&255)<<16)}}},e.prototype.calculateVertices=function(){var t=this.transform._worldID;if(this._transformID!==t){this._transformID=t;for(var i=this.transform.worldTransform,n=i.a,s=i.b,a=i.c,o=i.d,h=i.tx,u=i.ty,l=this._geometry.points,f=this.vertexData,c=0,d=0;d<l.length;d+=2){var v=l[d],p=l[d+1];f[c++]=n*v+a*p+h,f[c++]=o*p+s*v+u}}},e.prototype.closePath=function(){var t=this.currentPath;return t&&(t.closeStroke=!0,this.finishPoly()),this},e.prototype.setMatrix=function(t){return this._matrix=t,this},e.prototype.beginHole=function(){return this.finishPoly(),this._holeMode=!0,this},e.prototype.endHole=function(){return this.finishPoly(),this._holeMode=!1,this},e.prototype.destroy=function(t){this._geometry.refCount--,this._geometry.refCount===0&&this._geometry.dispose(),this._matrix=null,this.currentPath=null,this._lineStyle.destroy(),this._lineStyle=null,this._fillStyle.destroy(),this._fillStyle=null,this._geometry=null,this.shader=null,this.vertexData=null,this.batches.length=0,this.batches=null,r.prototype.destroy.call(this,t)},e.nextRoundedRectBehavior=!1,e._TEMP_POINT=new j,e}(yt);var pa=function(r,e){return pa=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},pa(r,e)};function Cg(r,e){pa(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Ir=new j,Og=new Uint16Array([0,1,2,0,2,3]),We=function(r){Cg(e,r);function e(t){var i=r.call(this)||this;return i._anchor=new Ui(i._onAnchorUpdate,i,t?t.defaultAnchor.x:0,t?t.defaultAnchor.y:0),i._texture=null,i._width=0,i._height=0,i._tint=null,i._tintRGB=null,i.tint=16777215,i.blendMode=X.NORMAL,i._cachedTint=16777215,i.uvs=null,i.texture=t||V.EMPTY,i.vertexData=new Float32Array(8),i.vertexTrimmedData=null,i._transformID=-1,i._textureID=-1,i._transformTrimmedID=-1,i._textureTrimmedID=-1,i.indices=Og,i.pluginName="batch",i.isSprite=!0,i._roundPixels=L.ROUND_PIXELS,i}return e.prototype._onTextureUpdate=function(){this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this._width&&(this.scale.x=zi(this.scale.x)*this._width/this._texture.orig.width),this._height&&(this.scale.y=zi(this.scale.y)*this._height/this._texture.orig.height)},e.prototype._onAnchorUpdate=function(){this._transformID=-1,this._transformTrimmedID=-1},e.prototype.calculateVertices=function(){var t=this._texture;if(!(this._transformID===this.transform._worldID&&this._textureID===t._updateID)){this._textureID!==t._updateID&&(this.uvs=this._texture._uvs.uvsFloat32),this._transformID=this.transform._worldID,this._textureID=t._updateID;var i=this.transform.worldTransform,n=i.a,s=i.b,a=i.c,o=i.d,h=i.tx,u=i.ty,l=this.vertexData,f=t.trim,c=t.orig,d=this._anchor,v=0,p=0,_=0,m=0;if(f?(p=f.x-d._x*c.width,v=p+f.width,m=f.y-d._y*c.height,_=m+f.height):(p=-d._x*c.width,v=p+c.width,m=-d._y*c.height,_=m+c.height),l[0]=n*p+a*m+h,l[1]=o*m+s*p+u,l[2]=n*v+a*m+h,l[3]=o*m+s*v+u,l[4]=n*v+a*_+h,l[5]=o*_+s*v+u,l[6]=n*p+a*_+h,l[7]=o*_+s*p+u,this._roundPixels)for(var g=L.RESOLUTION,y=0;y<l.length;++y)l[y]=Math.round((l[y]*g|0)/g)}},e.prototype.calculateTrimmedVertices=function(){if(!this.vertexTrimmedData)this.vertexTrimmedData=new Float32Array(8);else if(this._transformTrimmedID===this.transform._worldID&&this._textureTrimmedID===this._texture._updateID)return;this._transformTrimmedID=this.transform._worldID,this._textureTrimmedID=this._texture._updateID;var t=this._texture,i=this.vertexTrimmedData,n=t.orig,s=this._anchor,a=this.transform.worldTransform,o=a.a,h=a.b,u=a.c,l=a.d,f=a.tx,c=a.ty,d=-s._x*n.width,v=d+n.width,p=-s._y*n.height,_=p+n.height;i[0]=o*d+u*p+f,i[1]=l*p+h*d+c,i[2]=o*v+u*p+f,i[3]=l*p+h*v+c,i[4]=o*v+u*_+f,i[5]=l*_+h*v+c,i[6]=o*d+u*_+f,i[7]=l*_+h*d+c},e.prototype._render=function(t){this.calculateVertices(),t.batch.setObjectRenderer(t.plugins[this.pluginName]),t.plugins[this.pluginName].render(this)},e.prototype._calculateBounds=function(){var t=this._texture.trim,i=this._texture.orig;!t||t.width===i.width&&t.height===i.height?(this.calculateVertices(),this._bounds.addQuad(this.vertexData)):(this.calculateTrimmedVertices(),this._bounds.addQuad(this.vertexTrimmedData))},e.prototype.getLocalBounds=function(t){return this.children.length===0?(this._localBounds||(this._localBounds=new pn),this._localBounds.minX=this._texture.orig.width*-this._anchor._x,this._localBounds.minY=this._texture.orig.height*-this._anchor._y,this._localBounds.maxX=this._texture.orig.width*(1-this._anchor._x),this._localBounds.maxY=this._texture.orig.height*(1-this._anchor._y),t||(this._localBoundsRect||(this._localBoundsRect=new q),t=this._localBoundsRect),this._localBounds.getRectangle(t)):r.prototype.getLocalBounds.call(this,t)},e.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,Ir);var i=this._texture.orig.width,n=this._texture.orig.height,s=-i*this.anchor.x,a=0;return Ir.x>=s&&Ir.x<s+i&&(a=-n*this.anchor.y,Ir.y>=a&&Ir.y<a+n)},e.prototype.destroy=function(t){r.prototype.destroy.call(this,t),this._texture.off("update",this._onTextureUpdate,this),this._anchor=null;var i=typeof t=="boolean"?t:t&&t.texture;if(i){var n=typeof t=="boolean"?t:t&&t.baseTexture;this._texture.destroy(!!n)}this._texture=null},e.from=function(t,i){var n=t instanceof V?t:V.from(t,i);return new e(n)},Object.defineProperty(e.prototype,"roundPixels",{get:function(){return this._roundPixels},set:function(t){this._roundPixels!==t&&(this._transformID=-1),this._roundPixels=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return Math.abs(this.scale.x)*this._texture.orig.width},set:function(t){var i=zi(this.scale.x)||1;this.scale.x=i*t/this._texture.orig.width,this._width=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return Math.abs(this.scale.y)*this._texture.orig.height},set:function(t){var i=zi(this.scale.y)||1;this.scale.y=i*t/this._texture.orig.height,this._height=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"anchor",{get:function(){return this._anchor},set:function(t){this._anchor.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tint",{get:function(){return this._tint},set:function(t){this._tint=t,this._tintRGB=(t>>16)+(t&65280)+((t&255)<<16)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"texture",{get:function(){return this._texture},set:function(t){this._texture!==t&&(this._texture&&this._texture.off("update",this._onTextureUpdate,this),this._texture=t||V.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,t&&(t.baseTexture.valid?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))},enumerable:!1,configurable:!0}),e}(yt);var va=function(r,e){return va=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},va(r,e)};function Ag(r,e){va(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Mr;(function(r){r[r.LINEAR_VERTICAL=0]="LINEAR_VERTICAL",r[r.LINEAR_HORIZONTAL=1]="LINEAR_HORIZONTAL"})(Mr||(Mr={}));var _a={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:Mr.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100,leading:0},Ig=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],ei=function(){function r(e){this.styleID=0,this.reset(),ga(this,e,e)}return r.prototype.clone=function(){var e={};return ga(e,this,_a),new r(e)},r.prototype.reset=function(){ga(this,_a,_a)},Object.defineProperty(r.prototype,"align",{get:function(){return this._align},set:function(e){this._align!==e&&(this._align=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"breakWords",{get:function(){return this._breakWords},set:function(e){this._breakWords!==e&&(this._breakWords=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"dropShadow",{get:function(){return this._dropShadow},set:function(e){this._dropShadow!==e&&(this._dropShadow=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"dropShadowAlpha",{get:function(){return this._dropShadowAlpha},set:function(e){this._dropShadowAlpha!==e&&(this._dropShadowAlpha=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"dropShadowAngle",{get:function(){return this._dropShadowAngle},set:function(e){this._dropShadowAngle!==e&&(this._dropShadowAngle=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"dropShadowBlur",{get:function(){return this._dropShadowBlur},set:function(e){this._dropShadowBlur!==e&&(this._dropShadowBlur=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"dropShadowColor",{get:function(){return this._dropShadowColor},set:function(e){var t=ma(e);this._dropShadowColor!==t&&(this._dropShadowColor=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"dropShadowDistance",{get:function(){return this._dropShadowDistance},set:function(e){this._dropShadowDistance!==e&&(this._dropShadowDistance=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fill",{get:function(){return this._fill},set:function(e){var t=ma(e);this._fill!==t&&(this._fill=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fillGradientType",{get:function(){return this._fillGradientType},set:function(e){this._fillGradientType!==e&&(this._fillGradientType=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fillGradientStops",{get:function(){return this._fillGradientStops},set:function(e){Mg(this._fillGradientStops,e)||(this._fillGradientStops=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fontFamily",{get:function(){return this._fontFamily},set:function(e){this.fontFamily!==e&&(this._fontFamily=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fontSize",{get:function(){return this._fontSize},set:function(e){this._fontSize!==e&&(this._fontSize=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fontStyle",{get:function(){return this._fontStyle},set:function(e){this._fontStyle!==e&&(this._fontStyle=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fontVariant",{get:function(){return this._fontVariant},set:function(e){this._fontVariant!==e&&(this._fontVariant=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"fontWeight",{get:function(){return this._fontWeight},set:function(e){this._fontWeight!==e&&(this._fontWeight=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"letterSpacing",{get:function(){return this._letterSpacing},set:function(e){this._letterSpacing!==e&&(this._letterSpacing=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"lineHeight",{get:function(){return this._lineHeight},set:function(e){this._lineHeight!==e&&(this._lineHeight=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"leading",{get:function(){return this._leading},set:function(e){this._leading!==e&&(this._leading=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"lineJoin",{get:function(){return this._lineJoin},set:function(e){this._lineJoin!==e&&(this._lineJoin=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"miterLimit",{get:function(){return this._miterLimit},set:function(e){this._miterLimit!==e&&(this._miterLimit=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"padding",{get:function(){return this._padding},set:function(e){this._padding!==e&&(this._padding=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"stroke",{get:function(){return this._stroke},set:function(e){var t=ma(e);this._stroke!==t&&(this._stroke=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"strokeThickness",{get:function(){return this._strokeThickness},set:function(e){this._strokeThickness!==e&&(this._strokeThickness=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"textBaseline",{get:function(){return this._textBaseline},set:function(e){this._textBaseline!==e&&(this._textBaseline=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"trim",{get:function(){return this._trim},set:function(e){this._trim!==e&&(this._trim=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"whiteSpace",{get:function(){return this._whiteSpace},set:function(e){this._whiteSpace!==e&&(this._whiteSpace=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"wordWrap",{get:function(){return this._wordWrap},set:function(e){this._wordWrap!==e&&(this._wordWrap=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"wordWrapWidth",{get:function(){return this._wordWrapWidth},set:function(e){this._wordWrapWidth!==e&&(this._wordWrapWidth=e,this.styleID++)},enumerable:!1,configurable:!0}),r.prototype.toFontString=function(){var e=typeof this.fontSize=="number"?this.fontSize+"px":this.fontSize,t=this.fontFamily;Array.isArray(this.fontFamily)||(t=this.fontFamily.split(","));for(var i=t.length-1;i>=0;i--){var n=t[i].trim();!/([\"\'])[^\'\"]+\1/.test(n)&&Ig.indexOf(n)<0&&(n='"'+n+'"'),t[i]=n}return this.fontStyle+" "+this.fontVariant+" "+this.fontWeight+" "+e+" "+t.join(",")},r}();function xu(r){return typeof r=="number"?oh(r):(typeof r=="string"&&r.indexOf("0x")===0&&(r=r.replace("0x","#")),r)}function ma(r){if(Array.isArray(r)){for(var e=0;e<r.length;++e)r[e]=xu(r[e]);return r}else return xu(r)}function Mg(r,e){if(!Array.isArray(r)||!Array.isArray(e)||r.length!==e.length)return!1;for(var t=0;t<r.length;++t)if(r[t]!==e[t])return!1;return!0}function ga(r,e,t){for(var i in t)Array.isArray(e[i])?r[i]=e[i].slice():r[i]=e[i]}var Nn={willReadFrequently:!0},se=function(){function r(e,t,i,n,s,a,o,h,u){this.text=e,this.style=t,this.width=i,this.height=n,this.lines=s,this.lineWidths=a,this.lineHeight=o,this.maxLineWidth=h,this.fontProperties=u}return r.measureText=function(e,t,i,n){n===void 0&&(n=r._canvas),i=i??t.wordWrap;var s=t.toFontString(),a=r.measureFont(s);a.fontSize===0&&(a.fontSize=t.fontSize,a.ascent=t.fontSize);var o=n.getContext("2d",Nn);o.font=s;for(var h=i?r.wordWrap(e,t,n):e,u=h.split(/(?:\r\n|\r|\n)/),l=new Array(u.length),f=0,c=0;c<u.length;c++){var d=o.measureText(u[c]).width+(u[c].length-1)*t.letterSpacing;l[c]=d,f=Math.max(f,d)}var v=f+t.strokeThickness;t.dropShadow&&(v+=t.dropShadowDistance);var p=t.lineHeight||a.fontSize+t.strokeThickness,_=Math.max(p,a.fontSize+t.strokeThickness)+(u.length-1)*(p+t.leading);return t.dropShadow&&(_+=t.dropShadowDistance),new r(e,t,v,_,u,l,p+t.leading,f,a)},r.wordWrap=function(e,t,i){i===void 0&&(i=r._canvas);for(var n=i.getContext("2d",Nn),s=0,a="",o="",h=Object.create(null),u=t.letterSpacing,l=t.whiteSpace,f=r.collapseSpaces(l),c=r.collapseNewlines(l),d=!f,v=t.wordWrapWidth+u,p=r.tokenize(e),_=0;_<p.length;_++){var m=p[_];if(r.isNewline(m)){if(!c){o+=r.addLine(a),d=!f,a="",s=0;continue}m=" "}if(f){var g=r.isBreakingSpace(m),y=r.isBreakingSpace(a[a.length-1]);if(g&&y)continue}var b=r.getFromCache(m,u,h,n);if(b>v)if(a!==""&&(o+=r.addLine(a),a="",s=0),r.canBreakWords(m,t.breakWords))for(var x=r.wordWrapSplit(m),T=0;T<x.length;T++){for(var w=x[T],S=1;x[T+S];){var E=x[T+S],P=w[w.length-1];if(!r.canBreakChars(P,E,m,T,t.breakWords))w+=E;else break;S++}T+=w.length-1;var O=r.getFromCache(w,u,h,n);O+s>v&&(o+=r.addLine(a),d=!1,a="",s=0),a+=w,s+=O}else{a.length>0&&(o+=r.addLine(a),a="",s=0);var M=_===p.length-1;o+=r.addLine(m,!M),d=!1,a="",s=0}else b+s>v&&(d=!1,o+=r.addLine(a),a="",s=0),(a.length>0||!r.isBreakingSpace(m)||d)&&(a+=m,s+=b)}return o+=r.addLine(a,!1),o},r.addLine=function(e,t){return t===void 0&&(t=!0),e=r.trimRight(e),e=t?e+`
529
+ `:e,e},r.getFromCache=function(e,t,i,n){var s=i[e];if(typeof s!="number"){var a=e.length*t;s=n.measureText(e).width+a,i[e]=s}return s},r.collapseSpaces=function(e){return e==="normal"||e==="pre-line"},r.collapseNewlines=function(e){return e==="normal"},r.trimRight=function(e){if(typeof e!="string")return"";for(var t=e.length-1;t>=0;t--){var i=e[t];if(!r.isBreakingSpace(i))break;e=e.slice(0,-1)}return e},r.isNewline=function(e){return typeof e!="string"?!1:r._newlines.indexOf(e.charCodeAt(0))>=0},r.isBreakingSpace=function(e,t){return typeof e!="string"?!1:r._breakingSpaces.indexOf(e.charCodeAt(0))>=0},r.tokenize=function(e){var t=[],i="";if(typeof e!="string")return t;for(var n=0;n<e.length;n++){var s=e[n],a=e[n+1];if(r.isBreakingSpace(s,a)||r.isNewline(s)){i!==""&&(t.push(i),i=""),t.push(s);continue}i+=s}return i!==""&&t.push(i),t},r.canBreakWords=function(e,t){return t},r.canBreakChars=function(e,t,i,n,s){return!0},r.wordWrapSplit=function(e){return e.split("")},r.measureFont=function(e){if(r._fonts[e])return r._fonts[e];var t={ascent:0,descent:0,fontSize:0},i=r._canvas,n=r._context;n.font=e;var s=r.METRICS_STRING+r.BASELINE_SYMBOL,a=Math.ceil(n.measureText(s).width),o=Math.ceil(n.measureText(r.BASELINE_SYMBOL).width),h=Math.ceil(r.HEIGHT_MULTIPLIER*o);o=o*r.BASELINE_MULTIPLIER|0,i.width=a,i.height=h,n.fillStyle="#f00",n.fillRect(0,0,a,h),n.font=e,n.textBaseline="alphabetic",n.fillStyle="#000",n.fillText(s,0,o);var u=n.getImageData(0,0,a,h).data,l=u.length,f=a*4,c=0,d=0,v=!1;for(c=0;c<o;++c){for(var p=0;p<f;p+=4)if(u[d+p]!==255){v=!0;break}if(!v)d+=f;else break}for(t.ascent=o-c,d=l-f,v=!1,c=h;c>o;--c){for(var p=0;p<f;p+=4)if(u[d+p]!==255){v=!0;break}if(!v)d-=f;else break}return t.descent=c-o,t.fontSize=t.ascent+t.descent,r._fonts[e]=t,t},r.clearMetrics=function(e){e===void 0&&(e=""),e?delete r._fonts[e]:r._fonts={}},Object.defineProperty(r,"_canvas",{get:function(){if(!r.__canvas){var e=void 0;try{var t=new OffscreenCanvas(0,0),i=t.getContext("2d",Nn);if(i&&i.measureText)return r.__canvas=t,t;e=L.ADAPTER.createCanvas()}catch{e=L.ADAPTER.createCanvas()}e.width=e.height=10,r.__canvas=e}return r.__canvas},enumerable:!1,configurable:!0}),Object.defineProperty(r,"_context",{get:function(){return r.__context||(r.__context=r._canvas.getContext("2d",Nn)),r.__context},enumerable:!1,configurable:!0}),r}();se._fonts={},se.METRICS_STRING="|ÉqÅ",se.BASELINE_SYMBOL="M",se.BASELINE_MULTIPLIER=1.4,se.HEIGHT_MULTIPLIER=2,se._newlines=[10,13],se._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];var Dg={texture:!0,children:!1,baseTexture:!0},bu=function(r){Ag(e,r);function e(t,i,n){var s=this,a=!1;n||(n=L.ADAPTER.createCanvas(),a=!0),n.width=3,n.height=3;var o=V.from(n);return o.orig=new q,o.trim=new q,s=r.call(this,o)||this,s._ownCanvas=a,s.canvas=n,s.context=n.getContext("2d",{willReadFrequently:!0}),s._resolution=L.RESOLUTION,s._autoResolution=!0,s._text=null,s._style=null,s._styleListener=null,s._font="",s.text=t,s.style=i,s.localStyleID=-1,s}return e.prototype.updateText=function(t){var i=this._style;if(this.localStyleID!==i.styleID&&(this.dirty=!0,this.localStyleID=i.styleID),!(!this.dirty&&t)){this._font=this._style.toFontString();var n=this.context,s=se.measureText(this._text||" ",this._style,this._style.wordWrap,this.canvas),a=s.width,o=s.height,h=s.lines,u=s.lineHeight,l=s.lineWidths,f=s.maxLineWidth,c=s.fontProperties;this.canvas.width=Math.ceil(Math.ceil(Math.max(1,a)+i.padding*2)*this._resolution),this.canvas.height=Math.ceil(Math.ceil(Math.max(1,o)+i.padding*2)*this._resolution),n.scale(this._resolution,this._resolution),n.clearRect(0,0,this.canvas.width,this.canvas.height),n.font=this._font,n.lineWidth=i.strokeThickness,n.textBaseline=i.textBaseline,n.lineJoin=i.lineJoin,n.miterLimit=i.miterLimit;for(var d,v,p=i.dropShadow?2:1,_=0;_<p;++_){var m=i.dropShadow&&_===0,g=m?Math.ceil(Math.max(1,o)+i.padding*2):0,y=g*this._resolution;if(m){n.fillStyle="black",n.strokeStyle="black";var b=i.dropShadowColor,x=Wi(typeof b=="number"?b:hh(b)),T=i.dropShadowBlur*this._resolution,w=i.dropShadowDistance*this._resolution;n.shadowColor="rgba("+x[0]*255+","+x[1]*255+","+x[2]*255+","+i.dropShadowAlpha+")",n.shadowBlur=T,n.shadowOffsetX=Math.cos(i.dropShadowAngle)*w,n.shadowOffsetY=Math.sin(i.dropShadowAngle)*w+y}else n.fillStyle=this._generateFillStyle(i,h,s),n.strokeStyle=i.stroke,n.shadowColor="black",n.shadowBlur=0,n.shadowOffsetX=0,n.shadowOffsetY=0;var S=(u-c.fontSize)/2;(!e.nextLineHeightBehavior||u-c.fontSize<0)&&(S=0);for(var E=0;E<h.length;E++)d=i.strokeThickness/2,v=i.strokeThickness/2+E*u+c.ascent+S,i.align==="right"?d+=f-l[E]:i.align==="center"&&(d+=(f-l[E])/2),i.stroke&&i.strokeThickness&&this.drawLetterSpacing(h[E],d+i.padding,v+i.padding-g,!0),i.fill&&this.drawLetterSpacing(h[E],d+i.padding,v+i.padding-g)}this.updateTexture()}},e.prototype.drawLetterSpacing=function(t,i,n,s){s===void 0&&(s=!1);var a=this._style,o=a.letterSpacing,h=e.experimentalLetterSpacing&&("letterSpacing"in CanvasRenderingContext2D.prototype||"textLetterSpacing"in CanvasRenderingContext2D.prototype);if(o===0||h){h&&(this.context.letterSpacing=o,this.context.textLetterSpacing=o),s?this.context.strokeText(t,i,n):this.context.fillText(t,i,n);return}for(var u=i,l=Array.from?Array.from(t):t.split(""),f=this.context.measureText(t).width,c=0,d=0;d<l.length;++d){var v=l[d];s?this.context.strokeText(v,u,n):this.context.fillText(v,u,n);for(var p="",_=d+1;_<l.length;++_)p+=l[_];c=this.context.measureText(p).width,u+=f-c+o,f=c}},e.prototype.updateTexture=function(){var t=this.canvas;if(this._style.trim){var i=Fv(t);i.data&&(t.width=i.width,t.height=i.height,this.context.putImageData(i.data,0,0))}var n=this._texture,s=this._style,a=s.trim?0:s.padding,o=n.baseTexture;n.trim.width=n._frame.width=t.width/this._resolution,n.trim.height=n._frame.height=t.height/this._resolution,n.trim.x=-a,n.trim.y=-a,n.orig.width=n._frame.width-a*2,n.orig.height=n._frame.height-a*2,this._onTextureUpdate(),o.setRealSize(t.width,t.height,this._resolution),n.updateUvs(),this.dirty=!1},e.prototype._render=function(t){this._autoResolution&&this._resolution!==t.resolution&&(this._resolution=t.resolution,this.dirty=!0),this.updateText(!0),r.prototype._render.call(this,t)},e.prototype.updateTransform=function(){this.updateText(!0),r.prototype.updateTransform.call(this)},e.prototype.getBounds=function(t,i){return this.updateText(!0),this._textureID===-1&&(t=!1),r.prototype.getBounds.call(this,t,i)},e.prototype.getLocalBounds=function(t){return this.updateText(!0),r.prototype.getLocalBounds.call(this,t)},e.prototype._calculateBounds=function(){this.calculateVertices(),this._bounds.addQuad(this.vertexData)},e.prototype._generateFillStyle=function(t,i,n){var s=t.fill;if(Array.isArray(s)){if(s.length===1)return s[0]}else return s;var a,o=t.dropShadow?t.dropShadowDistance:0,h=t.padding||0,u=this.canvas.width/this._resolution-o-h*2,l=this.canvas.height/this._resolution-o-h*2,f=s.slice(),c=t.fillGradientStops.slice();if(!c.length)for(var d=f.length+1,v=1;v<d;++v)c.push(v/d);if(f.unshift(s[0]),c.unshift(0),f.push(s[s.length-1]),c.push(1),t.fillGradientType===Mr.LINEAR_VERTICAL){a=this.context.createLinearGradient(u/2,h,u/2,l+h);for(var p=n.fontProperties.fontSize+t.strokeThickness,v=0;v<i.length;v++){var _=n.lineHeight*(v-1)+p,m=n.lineHeight*v,g=m;v>0&&_>m&&(g=(m+_)/2);var y=m+p,b=n.lineHeight*(v+1),x=y;v+1<i.length&&b<y&&(x=(y+b)/2);for(var T=(x-g)/l,w=0;w<f.length;w++){var S=0;typeof c[w]=="number"?S=c[w]:S=w/f.length;var E=Math.min(1,Math.max(0,g/l+S*T));E=Number(E.toFixed(5)),a.addColorStop(E,f[w])}}}else{a=this.context.createLinearGradient(h,l/2,u+h,l/2);for(var P=f.length+1,O=1,v=0;v<f.length;v++){var M=void 0;typeof c[v]=="number"?M=c[v]:M=O/P,a.addColorStop(M,f[v]),O++}}return a},e.prototype.destroy=function(t){typeof t=="boolean"&&(t={children:t}),t=Object.assign({},Dg,t),r.prototype.destroy.call(this,t),this._ownCanvas&&(this.canvas.height=this.canvas.width=0),this.context=null,this.canvas=null,this._style=null},Object.defineProperty(e.prototype,"width",{get:function(){return this.updateText(!0),Math.abs(this.scale.x)*this._texture.orig.width},set:function(t){this.updateText(!0);var i=zi(this.scale.x)||1;this.scale.x=i*t/this._texture.orig.width,this._width=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.updateText(!0),Math.abs(this.scale.y)*this._texture.orig.height},set:function(t){this.updateText(!0);var i=zi(this.scale.y)||1;this.scale.y=i*t/this._texture.orig.height,this._height=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"style",{get:function(){return this._style},set:function(t){t=t||{},t instanceof ei?this._style=t:this._style=new ei(t),this.localStyleID=-1,this.dirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"text",{get:function(){return this._text},set:function(t){t=String(t??""),this._text!==t&&(this._text=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"resolution",{get:function(){return this._resolution},set:function(t){this._autoResolution=!1,this._resolution!==t&&(this._resolution=t,this.dirty=!0)},enumerable:!1,configurable:!0}),e.nextLineHeightBehavior=!1,e.experimentalLetterSpacing=!1,e}(We);L.UPLOADS_PER_FRAME=4;var ya=function(r,e){return ya=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},ya(r,e)};function Fg(r,e){ya(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Ng=function(){function r(e){this.maxItemsPerFrame=e,this.itemsLeft=0}return r.prototype.beginFrame=function(){this.itemsLeft=this.maxItemsPerFrame},r.prototype.allowedToUpload=function(){return this.itemsLeft-- >0},r}();function Lg(r,e){var t=!1;if(r&&r._textures&&r._textures.length){for(var i=0;i<r._textures.length;i++)if(r._textures[i]instanceof V){var n=r._textures[i].baseTexture;e.indexOf(n)===-1&&(e.push(n),t=!0)}}return t}function Bg(r,e){if(r.baseTexture instanceof tt){var t=r.baseTexture;return e.indexOf(t)===-1&&e.push(t),!0}return!1}function Ug(r,e){if(r._texture&&r._texture instanceof V){var t=r._texture.baseTexture;return e.indexOf(t)===-1&&e.push(t),!0}return!1}function Gg(r,e){return e instanceof bu?(e.updateText(!0),!0):!1}function kg(r,e){if(e instanceof ei){var t=e.toFontString();return se.measureFont(t),!0}return!1}function Xg(r,e){if(r instanceof bu){e.indexOf(r.style)===-1&&e.push(r.style),e.indexOf(r)===-1&&e.push(r);var t=r._texture.baseTexture;return e.indexOf(t)===-1&&e.push(t),!0}return!1}function Hg(r,e){return r instanceof ei?(e.indexOf(r)===-1&&e.push(r),!0):!1}var Wg=function(){function r(e){var t=this;this.limiter=new Ng(L.UPLOADS_PER_FRAME),this.renderer=e,this.uploadHookHelper=null,this.queue=[],this.addHooks=[],this.uploadHooks=[],this.completes=[],this.ticking=!1,this.delayedTick=function(){t.queue&&t.prepareItems()},this.registerFindHook(Xg),this.registerFindHook(Hg),this.registerFindHook(Lg),this.registerFindHook(Bg),this.registerFindHook(Ug),this.registerUploadHook(Gg),this.registerUploadHook(kg)}return r.prototype.upload=function(e,t){var i=this;return typeof e=="function"&&(t=e,e=null),t&&ge("6.5.0","BasePrepare.upload callback is deprecated, use the return Promise instead."),new Promise(function(n){e&&i.add(e);var s=function(){t==null||t(),n()};i.queue.length?(i.completes.push(s),i.ticking||(i.ticking=!0,Ft.system.addOnce(i.tick,i,re.UTILITY))):s()})},r.prototype.tick=function(){setTimeout(this.delayedTick,0)},r.prototype.prepareItems=function(){for(this.limiter.beginFrame();this.queue.length&&this.limiter.allowedToUpload();){var e=this.queue[0],t=!1;if(e&&!e._destroyed){for(var i=0,n=this.uploadHooks.length;i<n;i++)if(this.uploadHooks[i](this.uploadHookHelper,e)){this.queue.shift(),t=!0;break}}t||this.queue.shift()}if(this.queue.length)Ft.system.addOnce(this.tick,this,re.UTILITY);else{this.ticking=!1;var s=this.completes.slice(0);this.completes.length=0;for(var i=0,n=s.length;i<n;i++)s[i]()}},r.prototype.registerFindHook=function(e){return e&&this.addHooks.push(e),this},r.prototype.registerUploadHook=function(e){return e&&this.uploadHooks.push(e),this},r.prototype.add=function(e){for(var t=0,i=this.addHooks.length;t<i&&!this.addHooks[t](e,this.queue);t++);if(e instanceof yt)for(var t=e.children.length-1;t>=0;t--)this.add(e.children[t]);return this},r.prototype.destroy=function(){this.ticking&&Ft.system.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null},r}();function Tu(r,e){return e instanceof tt?(e._glTextures[r.CONTEXT_UID]||r.texture.bind(e),!0):!1}function Vg(r,e){if(!(e instanceof ne))return!1;var t=e.geometry;e.finishPoly(),t.updateBatches();for(var i=t.batches,n=0;n<i.length;n++){var s=i[n].style.texture;s&&Tu(r,s.baseTexture)}return t.batchable||r.geometry.bind(t,e._resolveDirectShader(r)),!0}function zg(r,e){return r instanceof ne?(e.push(r),!0):!1}var Yg=function(r){Fg(e,r);function e(t){var i=r.call(this,t)||this;return i.uploadHookHelper=i.renderer,i.registerFindHook(zg),i.registerUploadHook(Tu),i.registerUploadHook(Vg),i}return e.extension={name:"prepare",type:nt.RendererPlugin},e}(Wg);var jg=function(){function r(e,t,i){i===void 0&&(i=null),this.linkedSheets=[],this._texture=e instanceof V?e:null,this.baseTexture=e instanceof tt?e:this._texture.baseTexture,this.textures={},this.animations={},this.data=t;var n=this.baseTexture.resource;this.resolution=this._updateResolution(i||(n?n.url:null)),this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}return r.prototype._updateResolution=function(e){e===void 0&&(e=null);var t=this.data.meta.scale,i=dn(e,null);return i===null&&(i=t!==void 0?parseFloat(t):1),i!==1&&this.baseTexture.setResolution(i),i},r.prototype.parse=function(e){var t=this;return e&&ge("6.5.0","Spritesheet.parse callback is deprecated, use the return Promise instead."),new Promise(function(i){t._callback=function(n){e==null||e(n),i(n)},t._batchIndex=0,t._frameKeys.length<=r.BATCH_SIZE?(t._processFrames(0),t._processAnimations(),t._parseComplete()):t._nextBatch()})},r.prototype._processFrames=function(e){for(var t=e,i=r.BATCH_SIZE;t-e<i&&t<this._frameKeys.length;){var n=this._frameKeys[t],s=this._frames[n],a=s.frame;if(a){var o=null,h=null,u=s.trimmed!==!1&&s.sourceSize?s.sourceSize:s.frame,l=new q(0,0,Math.floor(u.w)/this.resolution,Math.floor(u.h)/this.resolution);s.rotated?o=new q(Math.floor(a.x)/this.resolution,Math.floor(a.y)/this.resolution,Math.floor(a.h)/this.resolution,Math.floor(a.w)/this.resolution):o=new q(Math.floor(a.x)/this.resolution,Math.floor(a.y)/this.resolution,Math.floor(a.w)/this.resolution,Math.floor(a.h)/this.resolution),s.trimmed!==!1&&s.spriteSourceSize&&(h=new q(Math.floor(s.spriteSourceSize.x)/this.resolution,Math.floor(s.spriteSourceSize.y)/this.resolution,Math.floor(a.w)/this.resolution,Math.floor(a.h)/this.resolution)),this.textures[n]=new V(this.baseTexture,o,l,h,s.rotated?2:0,s.anchor),V.addToCache(this.textures[n],n)}t++}},r.prototype._processAnimations=function(){var e=this.data.animations||{};for(var t in e){this.animations[t]=[];for(var i=0;i<e[t].length;i++){var n=e[t][i];this.animations[t].push(this.textures[n])}}},r.prototype._parseComplete=function(){var e=this._callback;this._callback=null,this._batchIndex=0,e.call(this,this.textures)},r.prototype._nextBatch=function(){var e=this;this._processFrames(this._batchIndex*r.BATCH_SIZE),this._batchIndex++,setTimeout(function(){e._batchIndex*r.BATCH_SIZE<e._frameKeys.length?e._nextBatch():(e._processAnimations(),e._parseComplete())},0)},r.prototype.destroy=function(e){var t;e===void 0&&(e=!1);for(var i in this.textures)this.textures[i].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,e&&((t=this._texture)===null||t===void 0||t.destroy(),this.baseTexture.destroy()),this._texture=null,this.baseTexture=null,this.linkedSheets=[]},r.BATCH_SIZE=1e3,r}(),Zg=function(){function r(){}return r.use=function(e,t){var i,n,s=this,a=e.name+"_image";if(!e.data||e.type!==xt.TYPE.JSON||!e.data.frames||s.resources[a]){t();return}var o=(n=(i=e.data)===null||i===void 0?void 0:i.meta)===null||n===void 0?void 0:n.related_multi_packs;if(Array.isArray(o))for(var h=function(v){if(typeof v!="string")return"continue";var p=v.replace(".json",""),_=Hi.resolve(e.url.replace(s.baseUrl,""),v);if(s.resources[p]||Object.values(s.resources).some(function(g){return Hi.format(Hi.parse(g.url))===_}))return"continue";var m={crossOrigin:e.crossOrigin,loadType:xt.LOAD_TYPE.XHR,xhrType:xt.XHR_RESPONSE_TYPE.JSON,parentResource:e,metadata:e.metadata};s.add(p,_,m)},u=0,l=o;u<l.length;u++){var f=l[u];h(f)}var c={crossOrigin:e.crossOrigin,metadata:e.metadata.imageMetadata,parentResource:e},d=r.getResourcePath(e,s.baseUrl);s.add(a,d,c,function(p){if(p.error){t(p.error);return}var _=new jg(p.texture,e.data,e.url);_.parse().then(function(){e.spritesheet=_,e.textures=_.textures,t()})})},r.getResourcePath=function(e,t){return e.isDataUrl?e.data.meta.image:Hi.resolve(e.url.replace(t,""),e.data.meta.image)},r.extension=nt.Loader,r}();var xa=function(r,e){return xa=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},xa(r,e)};function wu(r,e){xa(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Dr=new j;(function(r){wu(e,r);function e(t,i,n){i===void 0&&(i=100),n===void 0&&(n=100);var s=r.call(this,t)||this;return s.tileTransform=new Ro,s._width=i,s._height=n,s.uvMatrix=s.texture.uvMatrix||new Ys(t),s.pluginName="tilingSprite",s.uvRespectAnchor=!1,s}return Object.defineProperty(e.prototype,"clampMargin",{get:function(){return this.uvMatrix.clampMargin},set:function(t){this.uvMatrix.clampMargin=t,this.uvMatrix.update(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tileScale",{get:function(){return this.tileTransform.scale},set:function(t){this.tileTransform.scale.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tilePosition",{get:function(){return this.tileTransform.position},set:function(t){this.tileTransform.position.copyFrom(t)},enumerable:!1,configurable:!0}),e.prototype._onTextureUpdate=function(){this.uvMatrix&&(this.uvMatrix.texture=this._texture),this._cachedTint=16777215},e.prototype._render=function(t){var i=this._texture;!i||!i.valid||(this.tileTransform.updateLocalTransform(),this.uvMatrix.update(),t.batch.setObjectRenderer(t.plugins[this.pluginName]),t.plugins[this.pluginName].render(this))},e.prototype._calculateBounds=function(){var t=this._width*-this._anchor._x,i=this._height*-this._anchor._y,n=this._width*(1-this._anchor._x),s=this._height*(1-this._anchor._y);this._bounds.addFrame(this.transform,t,i,n,s)},e.prototype.getLocalBounds=function(t){return this.children.length===0?(this._bounds.minX=this._width*-this._anchor._x,this._bounds.minY=this._height*-this._anchor._y,this._bounds.maxX=this._width*(1-this._anchor._x),this._bounds.maxY=this._height*(1-this._anchor._y),t||(this._localBoundsRect||(this._localBoundsRect=new q),t=this._localBoundsRect),this._bounds.getRectangle(t)):r.prototype.getLocalBounds.call(this,t)},e.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,Dr);var i=this._width,n=this._height,s=-i*this.anchor._x;if(Dr.x>=s&&Dr.x<s+i){var a=-n*this.anchor._y;if(Dr.y>=a&&Dr.y<a+n)return!0}return!1},e.prototype.destroy=function(t){r.prototype.destroy.call(this,t),this.tileTransform=null,this.uvMatrix=null},e.from=function(t,i){var n=t instanceof V?t:V.from(t,i);return new e(n,i.width,i.height)},Object.defineProperty(e.prototype,"width",{get:function(){return this._width},set:function(t){this._width=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._height},set:function(t){this._height=t},enumerable:!1,configurable:!0}),e})(We);var qg=`#version 100
530
530
  #define SHADER_NAME Tiling-Sprite-Simple-100
531
531
 
532
532
  precision lowp float;
@@ -541,7 +541,7 @@ void main(void)
541
541
  vec4 texSample = texture2D(uSampler, vTextureCoord);
542
542
  gl_FragColor = texSample * uColor;
543
543
  }
544
- `,wu=`#version 100
544
+ `,Eu=`#version 100
545
545
  #define SHADER_NAME Tiling-Sprite-100
546
546
 
547
547
  precision lowp float;
@@ -561,7 +561,7 @@ void main(void)
561
561
 
562
562
  vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;
563
563
  }
564
- `,qg=`#version 100
564
+ `,Kg=`#version 100
565
565
  #ifdef GL_EXT_shader_texture_lod
566
566
  #extension GL_EXT_shader_texture_lod : enable
567
567
  #endif
@@ -594,7 +594,7 @@ void main(void)
594
594
 
595
595
  gl_FragColor = texSample * uColor;
596
596
  }
597
- `,Kg=`#version 300 es
597
+ `,$g=`#version 300 es
598
598
  #define SHADER_NAME Tiling-Sprite-300
599
599
 
600
600
  precision lowp float;
@@ -614,7 +614,7 @@ void main(void)
614
614
 
615
615
  vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;
616
616
  }
617
- `,$g=`#version 300 es
617
+ `,Jg=`#version 300 es
618
618
  #define SHADER_NAME Tiling-Sprite-100
619
619
 
620
620
  precision lowp float;
@@ -640,7 +640,7 @@ void main(void)
640
640
 
641
641
  fragmentColor = texSample * uColor;
642
642
  }
643
- `,Ln=new Ct,Jg=function(r){Tu(e,r);function e(t){var i=r.call(this,t)||this;return t.runners.contextChange.add(i),i.quad=new Rh,i.state=wi.for2d(),i}return e.prototype.contextChange=function(){var t=this.renderer,i={globals:t.globalUniforms};this.simpleShader=$e.from(wu,Zg,i),this.shader=t.context.webGLVersion>1?$e.from(Kg,$g,i):$e.from(wu,qg,i)},e.prototype.render=function(t){var i=this.renderer,n=this.quad,s=n.vertices;s[0]=s[6]=t._width*-t.anchor.x,s[1]=s[3]=t._height*-t.anchor.y,s[2]=s[4]=t._width*(1-t.anchor.x),s[5]=s[7]=t._height*(1-t.anchor.y);var a=t.uvRespectAnchor?t.anchor.x:0,o=t.uvRespectAnchor?t.anchor.y:0;s=n.uvs,s[0]=s[6]=-a,s[1]=s[3]=-o,s[2]=s[4]=1-a,s[5]=s[7]=1-o,n.invalidate();var h=t._texture,u=h.baseTexture,l=u.alphaMode>0,f=t.tileTransform.localTransform,c=t.uvMatrix,d=u.isPowerOfTwo&&h.frame.width===u.width&&h.frame.height===u.height;d&&(u._glTextures[i.CONTEXT_UID]?d=u.wrapMode!==Re.CLAMP:u.wrapMode===Re.CLAMP&&(u.wrapMode=Re.REPEAT));var v=d?this.simpleShader:this.shader,p=h.width,_=h.height,m=t._width,g=t._height;Ln.set(f.a*p/m,f.b*p/g,f.c*_/m,f.d*_/g,f.tx/m,f.ty/g),Ln.invert(),d?Ln.prepend(c.mapCoord):(v.uniforms.uMapCoord=c.mapCoord.toArray(!0),v.uniforms.uClampFrame=c.uClampFrame,v.uniforms.uClampOffset=c.uClampOffset),v.uniforms.uTransform=Ln.toArray(!0),v.uniforms.uColor=lh(t.tint,t.worldAlpha,v.uniforms.uColor,l),v.uniforms.translationMatrix=t.transform.worldTransform.toArray(!0),v.uniforms.uSampler=h,i.shader.bind(v),i.geometry.bind(n),this.state.blendMode=uh(t.blendMode,l),i.state.set(this.state),i.geometry.draw(this.renderer.gl.TRIANGLES,6,0)},e.extension={name:"tilingSprite",type:nt.RendererPlugin},e}(mn);var ba=function(r,e){return ba=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},ba(r,e)};function Ta(r,e){ba(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Qg=function(){function r(e,t){this.uvBuffer=e,this.uvMatrix=t,this.data=null,this._bufferUpdateId=-1,this._textureUpdateId=-1,this._updateID=0}return r.prototype.update=function(e){if(!(!e&&this._bufferUpdateId===this.uvBuffer._updateID&&this._textureUpdateId===this.uvMatrix._updateID)){this._bufferUpdateId=this.uvBuffer._updateID,this._textureUpdateId=this.uvMatrix._updateID;var t=this.uvBuffer.data;(!this.data||this.data.length!==t.length)&&(this.data=new Float32Array(t.length)),this.uvMatrix.multiplyUvs(t,this.data),this._updateID++}},r}(),wa=new j,Eu=new Jr,Fr=function(r){Ta(e,r);function e(t,i,n,s){s===void 0&&(s=de.TRIANGLES);var a=r.call(this)||this;return a.geometry=t,a.shader=i,a.state=n||wi.for2d(),a.drawMode=s,a.start=0,a.size=0,a.uvs=null,a.indices=null,a.vertexData=new Float32Array(1),a.vertexDirty=-1,a._transformID=-1,a._roundPixels=L.ROUND_PIXELS,a.batchUvs=null,a}return Object.defineProperty(e.prototype,"geometry",{get:function(){return this._geometry},set:function(t){this._geometry!==t&&(this._geometry&&(this._geometry.refCount--,this._geometry.refCount===0&&this._geometry.dispose()),this._geometry=t,this._geometry&&this._geometry.refCount++,this.vertexDirty=-1)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"uvBuffer",{get:function(){return this.geometry.buffers[1]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"verticesBuffer",{get:function(){return this.geometry.buffers[0]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"material",{get:function(){return this.shader},set:function(t){this.shader=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"blendMode",{get:function(){return this.state.blendMode},set:function(t){this.state.blendMode=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"roundPixels",{get:function(){return this._roundPixels},set:function(t){this._roundPixels!==t&&(this._transformID=-1),this._roundPixels=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tint",{get:function(){return"tint"in this.shader?this.shader.tint:null},set:function(t){this.shader.tint=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"texture",{get:function(){return"texture"in this.shader?this.shader.texture:null},set:function(t){this.shader.texture=t},enumerable:!1,configurable:!0}),e.prototype._render=function(t){var i=this.geometry.buffers[0].data,n=this.shader;n.batchable&&this.drawMode===de.TRIANGLES&&i.length<e.BATCHABLE_SIZE*2?this._renderToBatch(t):this._renderDefault(t)},e.prototype._renderDefault=function(t){var i=this.shader;i.alpha=this.worldAlpha,i.update&&i.update(),t.batch.flush(),i.uniforms.translationMatrix=this.transform.worldTransform.toArray(!0),t.shader.bind(i),t.state.set(this.state),t.geometry.bind(this.geometry,i),t.geometry.draw(this.drawMode,this.size,this.start,this.geometry.instanceCount)},e.prototype._renderToBatch=function(t){var i=this.geometry,n=this.shader;n.uvMatrix&&(n.uvMatrix.update(),this.calculateUvs()),this.calculateVertices(),this.indices=i.indexBuffer.data,this._tintRGB=n._tintRGB,this._texture=n.texture;var s=this.material.pluginName;t.batch.setObjectRenderer(t.plugins[s]),t.plugins[s].render(this)},e.prototype.calculateVertices=function(){var t=this.geometry,i=t.buffers[0],n=i.data,s=i._updateID;if(!(s===this.vertexDirty&&this._transformID===this.transform._worldID)){this._transformID=this.transform._worldID,this.vertexData.length!==n.length&&(this.vertexData=new Float32Array(n.length));for(var a=this.transform.worldTransform,o=a.a,h=a.b,u=a.c,l=a.d,f=a.tx,c=a.ty,d=this.vertexData,v=0;v<d.length/2;v++){var p=n[v*2],_=n[v*2+1];d[v*2]=o*p+u*_+f,d[v*2+1]=h*p+l*_+c}if(this._roundPixels)for(var m=L.RESOLUTION,v=0;v<d.length;++v)d[v]=Math.round((d[v]*m|0)/m);this.vertexDirty=s}},e.prototype.calculateUvs=function(){var t=this.geometry.buffers[1],i=this.shader;i.uvMatrix.isSimple?this.uvs=t.data:(this.batchUvs||(this.batchUvs=new Qg(t,i.uvMatrix)),this.batchUvs.update(),this.uvs=this.batchUvs.data)},e.prototype._calculateBounds=function(){this.calculateVertices(),this._bounds.addVertexData(this.vertexData,0,this.vertexData.length)},e.prototype.containsPoint=function(t){if(!this.getBounds().contains(t.x,t.y))return!1;this.worldTransform.applyInverse(t,wa);for(var i=this.geometry.getBuffer("aVertexPosition").data,n=Eu.points,s=this.geometry.getIndex().data,a=s.length,o=this.drawMode===4?3:1,h=0;h+2<a;h+=o){var u=s[h]*2,l=s[h+1]*2,f=s[h+2]*2;if(n[0]=i[u],n[1]=i[u+1],n[2]=i[l],n[3]=i[l+1],n[4]=i[f],n[5]=i[f+1],Eu.contains(wa.x,wa.y))return!0}return!1},e.prototype.destroy=function(t){r.prototype.destroy.call(this,t),this._cachedTexture&&(this._cachedTexture.destroy(),this._cachedTexture=null),this.geometry=null,this.shader=null,this.state=null,this.uvs=null,this.indices=null,this.vertexData=null},e.BATCHABLE_SIZE=100,e}(yt),ty=`varying vec2 vTextureCoord;
643
+ `,Ln=new Ct,Qg=function(r){wu(e,r);function e(t){var i=r.call(this,t)||this;return t.runners.contextChange.add(i),i.quad=new Ch,i.state=wi.for2d(),i}return e.prototype.contextChange=function(){var t=this.renderer,i={globals:t.globalUniforms};this.simpleShader=$e.from(Eu,qg,i),this.shader=t.context.webGLVersion>1?$e.from($g,Jg,i):$e.from(Eu,Kg,i)},e.prototype.render=function(t){var i=this.renderer,n=this.quad,s=n.vertices;s[0]=s[6]=t._width*-t.anchor.x,s[1]=s[3]=t._height*-t.anchor.y,s[2]=s[4]=t._width*(1-t.anchor.x),s[5]=s[7]=t._height*(1-t.anchor.y);var a=t.uvRespectAnchor?t.anchor.x:0,o=t.uvRespectAnchor?t.anchor.y:0;s=n.uvs,s[0]=s[6]=-a,s[1]=s[3]=-o,s[2]=s[4]=1-a,s[5]=s[7]=1-o,n.invalidate();var h=t._texture,u=h.baseTexture,l=u.alphaMode>0,f=t.tileTransform.localTransform,c=t.uvMatrix,d=u.isPowerOfTwo&&h.frame.width===u.width&&h.frame.height===u.height;d&&(u._glTextures[i.CONTEXT_UID]?d=u.wrapMode!==Re.CLAMP:u.wrapMode===Re.CLAMP&&(u.wrapMode=Re.REPEAT));var v=d?this.simpleShader:this.shader,p=h.width,_=h.height,m=t._width,g=t._height;Ln.set(f.a*p/m,f.b*p/g,f.c*_/m,f.d*_/g,f.tx/m,f.ty/g),Ln.invert(),d?Ln.prepend(c.mapCoord):(v.uniforms.uMapCoord=c.mapCoord.toArray(!0),v.uniforms.uClampFrame=c.uClampFrame,v.uniforms.uClampOffset=c.uClampOffset),v.uniforms.uTransform=Ln.toArray(!0),v.uniforms.uColor=fh(t.tint,t.worldAlpha,v.uniforms.uColor,l),v.uniforms.translationMatrix=t.transform.worldTransform.toArray(!0),v.uniforms.uSampler=h,i.shader.bind(v),i.geometry.bind(n),this.state.blendMode=lh(t.blendMode,l),i.state.set(this.state),i.geometry.draw(this.renderer.gl.TRIANGLES,6,0)},e.extension={name:"tilingSprite",type:nt.RendererPlugin},e}(mn);var ba=function(r,e){return ba=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},ba(r,e)};function Ta(r,e){ba(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var ty=function(){function r(e,t){this.uvBuffer=e,this.uvMatrix=t,this.data=null,this._bufferUpdateId=-1,this._textureUpdateId=-1,this._updateID=0}return r.prototype.update=function(e){if(!(!e&&this._bufferUpdateId===this.uvBuffer._updateID&&this._textureUpdateId===this.uvMatrix._updateID)){this._bufferUpdateId=this.uvBuffer._updateID,this._textureUpdateId=this.uvMatrix._updateID;var t=this.uvBuffer.data;(!this.data||this.data.length!==t.length)&&(this.data=new Float32Array(t.length)),this.uvMatrix.multiplyUvs(t,this.data),this._updateID++}},r}(),wa=new j,Su=new Jr,Fr=function(r){Ta(e,r);function e(t,i,n,s){s===void 0&&(s=de.TRIANGLES);var a=r.call(this)||this;return a.geometry=t,a.shader=i,a.state=n||wi.for2d(),a.drawMode=s,a.start=0,a.size=0,a.uvs=null,a.indices=null,a.vertexData=new Float32Array(1),a.vertexDirty=-1,a._transformID=-1,a._roundPixels=L.ROUND_PIXELS,a.batchUvs=null,a}return Object.defineProperty(e.prototype,"geometry",{get:function(){return this._geometry},set:function(t){this._geometry!==t&&(this._geometry&&(this._geometry.refCount--,this._geometry.refCount===0&&this._geometry.dispose()),this._geometry=t,this._geometry&&this._geometry.refCount++,this.vertexDirty=-1)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"uvBuffer",{get:function(){return this.geometry.buffers[1]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"verticesBuffer",{get:function(){return this.geometry.buffers[0]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"material",{get:function(){return this.shader},set:function(t){this.shader=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"blendMode",{get:function(){return this.state.blendMode},set:function(t){this.state.blendMode=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"roundPixels",{get:function(){return this._roundPixels},set:function(t){this._roundPixels!==t&&(this._transformID=-1),this._roundPixels=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tint",{get:function(){return"tint"in this.shader?this.shader.tint:null},set:function(t){this.shader.tint=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"texture",{get:function(){return"texture"in this.shader?this.shader.texture:null},set:function(t){this.shader.texture=t},enumerable:!1,configurable:!0}),e.prototype._render=function(t){var i=this.geometry.buffers[0].data,n=this.shader;n.batchable&&this.drawMode===de.TRIANGLES&&i.length<e.BATCHABLE_SIZE*2?this._renderToBatch(t):this._renderDefault(t)},e.prototype._renderDefault=function(t){var i=this.shader;i.alpha=this.worldAlpha,i.update&&i.update(),t.batch.flush(),i.uniforms.translationMatrix=this.transform.worldTransform.toArray(!0),t.shader.bind(i),t.state.set(this.state),t.geometry.bind(this.geometry,i),t.geometry.draw(this.drawMode,this.size,this.start,this.geometry.instanceCount)},e.prototype._renderToBatch=function(t){var i=this.geometry,n=this.shader;n.uvMatrix&&(n.uvMatrix.update(),this.calculateUvs()),this.calculateVertices(),this.indices=i.indexBuffer.data,this._tintRGB=n._tintRGB,this._texture=n.texture;var s=this.material.pluginName;t.batch.setObjectRenderer(t.plugins[s]),t.plugins[s].render(this)},e.prototype.calculateVertices=function(){var t=this.geometry,i=t.buffers[0],n=i.data,s=i._updateID;if(!(s===this.vertexDirty&&this._transformID===this.transform._worldID)){this._transformID=this.transform._worldID,this.vertexData.length!==n.length&&(this.vertexData=new Float32Array(n.length));for(var a=this.transform.worldTransform,o=a.a,h=a.b,u=a.c,l=a.d,f=a.tx,c=a.ty,d=this.vertexData,v=0;v<d.length/2;v++){var p=n[v*2],_=n[v*2+1];d[v*2]=o*p+u*_+f,d[v*2+1]=h*p+l*_+c}if(this._roundPixels)for(var m=L.RESOLUTION,v=0;v<d.length;++v)d[v]=Math.round((d[v]*m|0)/m);this.vertexDirty=s}},e.prototype.calculateUvs=function(){var t=this.geometry.buffers[1],i=this.shader;i.uvMatrix.isSimple?this.uvs=t.data:(this.batchUvs||(this.batchUvs=new ty(t,i.uvMatrix)),this.batchUvs.update(),this.uvs=this.batchUvs.data)},e.prototype._calculateBounds=function(){this.calculateVertices(),this._bounds.addVertexData(this.vertexData,0,this.vertexData.length)},e.prototype.containsPoint=function(t){if(!this.getBounds().contains(t.x,t.y))return!1;this.worldTransform.applyInverse(t,wa);for(var i=this.geometry.getBuffer("aVertexPosition").data,n=Su.points,s=this.geometry.getIndex().data,a=s.length,o=this.drawMode===4?3:1,h=0;h+2<a;h+=o){var u=s[h]*2,l=s[h+1]*2,f=s[h+2]*2;if(n[0]=i[u],n[1]=i[u+1],n[2]=i[l],n[3]=i[l+1],n[4]=i[f],n[5]=i[f+1],Su.contains(wa.x,wa.y))return!0}return!1},e.prototype.destroy=function(t){r.prototype.destroy.call(this,t),this._cachedTexture&&(this._cachedTexture.destroy(),this._cachedTexture=null),this.geometry=null,this.shader=null,this.state=null,this.uvs=null,this.indices=null,this.vertexData=null},e.BATCHABLE_SIZE=100,e}(yt),ey=`varying vec2 vTextureCoord;
644
644
  uniform vec4 uColor;
645
645
 
646
646
  uniform sampler2D uSampler;
@@ -649,7 +649,7 @@ void main(void)
649
649
  {
650
650
  gl_FragColor = texture2D(uSampler, vTextureCoord) * uColor;
651
651
  }
652
- `,ey=`attribute vec2 aVertexPosition;
652
+ `,iy=`attribute vec2 aVertexPosition;
653
653
  attribute vec2 aTextureCoord;
654
654
 
655
655
  uniform mat3 projectionMatrix;
@@ -664,7 +664,7 @@ void main(void)
664
664
 
665
665
  vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;
666
666
  }
667
- `,Nr=function(r){Ta(e,r);function e(t,i){var n=this,s={uSampler:t,alpha:1,uTextureMatrix:Ct.IDENTITY,uColor:new Float32Array([1,1,1,1])};return i=Object.assign({tint:16777215,alpha:1,pluginName:"batch"},i),i.uniforms&&Object.assign(s,i.uniforms),n=r.call(this,i.program||Pr.from(ey,ty),s)||this,n._colorDirty=!1,n.uvMatrix=new Ys(t),n.batchable=i.program===void 0,n.pluginName=i.pluginName,n.tint=i.tint,n.alpha=i.alpha,n}return Object.defineProperty(e.prototype,"texture",{get:function(){return this.uniforms.uSampler},set:function(t){this.uniforms.uSampler!==t&&(!this.uniforms.uSampler.baseTexture.alphaMode!=!t.baseTexture.alphaMode&&(this._colorDirty=!0),this.uniforms.uSampler=t,this.uvMatrix.texture=t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"alpha",{get:function(){return this._alpha},set:function(t){t!==this._alpha&&(this._alpha=t,this._colorDirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tint",{get:function(){return this._tint},set:function(t){t!==this._tint&&(this._tint=t,this._tintRGB=(t>>16)+(t&65280)+((t&255)<<16),this._colorDirty=!0)},enumerable:!1,configurable:!0}),e.prototype.update=function(){if(this._colorDirty){this._colorDirty=!1;var t=this.texture.baseTexture;lh(this._tint,this._alpha,this.uniforms.uColor,t.alphaMode)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)},e}($e),Bn=function(r){Ta(e,r);function e(t,i,n){var s=r.call(this)||this,a=new At(t),o=new At(i,!0),h=new At(n,!0,!0);return s.addAttribute("aVertexPosition",a,2,!1,k.FLOAT).addAttribute("aTextureCoord",o,2,!1,k.FLOAT).addIndex(h),s._updateId=-1,s}return Object.defineProperty(e.prototype,"vertexDirtyId",{get:function(){return this.buffers[0]._updateID},enumerable:!1,configurable:!0}),e}(wr);var Ea=function(r,e){return Ea=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},Ea(r,e)};function iy(r,e){Ea(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Gn=function(){function r(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[],this.distanceField=[]}return r}(),ry=function(){function r(){}return r.test=function(e){return typeof e=="string"&&e.indexOf("info face=")===0},r.parse=function(e){var t=e.match(/^[a-z]+\s+.+$/gm),i={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[],distanceField:[]};for(var n in t){var s=t[n].match(/^[a-z]+/gm)[0],a=t[n].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),o={};for(var h in a){var u=a[h].split("="),l=u[0],f=u[1].replace(/"/gm,""),c=parseFloat(f),d=isNaN(c)?f:c;o[l]=d}i[s].push(o)}var v=new Gn;return i.info.forEach(function(p){return v.info.push({face:p.face,size:parseInt(p.size,10)})}),i.common.forEach(function(p){return v.common.push({lineHeight:parseInt(p.lineHeight,10)})}),i.page.forEach(function(p){return v.page.push({id:parseInt(p.id,10),file:p.file})}),i.char.forEach(function(p){return v.char.push({id:parseInt(p.id,10),page:parseInt(p.page,10),x:parseInt(p.x,10),y:parseInt(p.y,10),width:parseInt(p.width,10),height:parseInt(p.height,10),xoffset:parseInt(p.xoffset,10),yoffset:parseInt(p.yoffset,10),xadvance:parseInt(p.xadvance,10)})}),i.kerning.forEach(function(p){return v.kerning.push({first:parseInt(p.first,10),second:parseInt(p.second,10),amount:parseInt(p.amount,10)})}),i.distanceField.forEach(function(p){return v.distanceField.push({distanceRange:parseInt(p.distanceRange,10),fieldType:p.fieldType})}),v},r}(),Sa=function(){function r(){}return r.test=function(e){return e instanceof XMLDocument&&e.getElementsByTagName("page").length&&e.getElementsByTagName("info")[0].getAttribute("face")!==null},r.parse=function(e){for(var t=new Gn,i=e.getElementsByTagName("info"),n=e.getElementsByTagName("common"),s=e.getElementsByTagName("page"),a=e.getElementsByTagName("char"),o=e.getElementsByTagName("kerning"),h=e.getElementsByTagName("distanceField"),u=0;u<i.length;u++)t.info.push({face:i[u].getAttribute("face"),size:parseInt(i[u].getAttribute("size"),10)});for(var u=0;u<n.length;u++)t.common.push({lineHeight:parseInt(n[u].getAttribute("lineHeight"),10)});for(var u=0;u<s.length;u++)t.page.push({id:parseInt(s[u].getAttribute("id"),10)||0,file:s[u].getAttribute("file")});for(var u=0;u<a.length;u++){var l=a[u];t.char.push({id:parseInt(l.getAttribute("id"),10),page:parseInt(l.getAttribute("page"),10)||0,x:parseInt(l.getAttribute("x"),10),y:parseInt(l.getAttribute("y"),10),width:parseInt(l.getAttribute("width"),10),height:parseInt(l.getAttribute("height"),10),xoffset:parseInt(l.getAttribute("xoffset"),10),yoffset:parseInt(l.getAttribute("yoffset"),10),xadvance:parseInt(l.getAttribute("xadvance"),10)})}for(var u=0;u<o.length;u++)t.kerning.push({first:parseInt(o[u].getAttribute("first"),10),second:parseInt(o[u].getAttribute("second"),10),amount:parseInt(o[u].getAttribute("amount"),10)});for(var u=0;u<h.length;u++)t.distanceField.push({fieldType:h[u].getAttribute("fieldType"),distanceRange:parseInt(h[u].getAttribute("distanceRange"),10)});return t},r}(),ny=function(){function r(){}return r.test=function(e){if(typeof e=="string"&&e.indexOf("<font>")>-1){var t=new globalThis.DOMParser().parseFromString(e,"text/xml");return Sa.test(t)}return!1},r.parse=function(e){var t=new globalThis.DOMParser().parseFromString(e,"text/xml");return Sa.parse(t)},r}(),Pa=[ry,Sa,ny];function Su(r){for(var e=0;e<Pa.length;e++)if(Pa[e].test(r))return Pa[e];return null}function sy(r,e,t,i,n,s){var a=t.fill;if(Array.isArray(a)){if(a.length===1)return a[0]}else return a;var o,h=t.dropShadow?t.dropShadowDistance:0,u=t.padding||0,l=r.width/i-h-u*2,f=r.height/i-h-u*2,c=a.slice(),d=t.fillGradientStops.slice();if(!d.length)for(var v=c.length+1,p=1;p<v;++p)d.push(p/v);if(c.unshift(a[0]),d.unshift(0),c.push(a[a.length-1]),d.push(1),t.fillGradientType===Mr.LINEAR_VERTICAL){o=e.createLinearGradient(l/2,u,l/2,f+u);for(var _=0,m=s.fontProperties.fontSize+t.strokeThickness,g=m/f,p=0;p<n.length;p++)for(var y=s.lineHeight*p,b=0;b<c.length;b++){var x=0;typeof d[b]=="number"?x=d[b]:x=b/c.length;var T=y/f+x*g,w=Math.max(_,T);w=Math.min(w,1),o.addColorStop(w,c[b]),_=w}}else{o=e.createLinearGradient(u,f/2,l+u,f/2);for(var S=c.length+1,E=1,p=0;p<c.length;p++){var P=void 0;typeof d[p]=="number"?P=d[p]:P=E/S,o.addColorStop(P,c[p]),E++}}return o}function ay(r,e,t,i,n,s,a){var o=t.text,h=t.fontProperties;e.translate(i,n),e.scale(s,s);var u=a.strokeThickness/2,l=-(a.strokeThickness/2);if(e.font=a.toFontString(),e.lineWidth=a.strokeThickness,e.textBaseline=a.textBaseline,e.lineJoin=a.lineJoin,e.miterLimit=a.miterLimit,e.fillStyle=sy(r,e,a,s,[o],t),e.strokeStyle=a.stroke,a.dropShadow){var f=a.dropShadowColor,c=Wi(typeof f=="number"?f:oh(f)),d=a.dropShadowBlur*s,v=a.dropShadowDistance*s;e.shadowColor="rgba("+c[0]*255+","+c[1]*255+","+c[2]*255+","+a.dropShadowAlpha+")",e.shadowBlur=d,e.shadowOffsetX=Math.cos(a.dropShadowAngle)*v,e.shadowOffsetY=Math.sin(a.dropShadowAngle)*v}else e.shadowColor="black",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0;a.stroke&&a.strokeThickness&&e.strokeText(o,u,l+t.lineHeight-h.descent),a.fill&&e.fillText(o,u,l+t.lineHeight-h.descent),e.setTransform(1,0,0,1,0,0),e.fillStyle="rgba(0, 0, 0, 0)"}function Pu(r){return Array.from?Array.from(r):r.split("")}function oy(r){typeof r=="string"&&(r=[r]);for(var e=[],t=0,i=r.length;t<i;t++){var n=r[t];if(Array.isArray(n)){if(n.length!==2)throw new Error("[BitmapFont]: Invalid character range length, expecting 2 got "+n.length+".");var s=n[0].charCodeAt(0),a=n[1].charCodeAt(0);if(a<s)throw new Error("[BitmapFont]: Invalid character range.");for(var o=s,h=a;o<=h;o++)e.push(String.fromCharCode(o))}else e.push.apply(e,Pu(n))}if(e.length===0)throw new Error("[BitmapFont]: Empty set when resolving characters.");return e}function Un(r){return r.codePointAt?r.codePointAt(0):r.charCodeAt(0)}var wt=function(){function r(e,t,i){var n,s,a=e.info[0],o=e.common[0],h=e.page[0],u=e.distanceField[0],l=dn(h.file),f={};this._ownsTextures=i,this.font=a.face,this.size=a.size,this.lineHeight=o.lineHeight/l,this.chars={},this.pageTextures=f;for(var c=0;c<e.page.length;c++){var d=e.page[c],v=d.id,p=d.file;f[v]=t instanceof Array?t[c]:t[p],u!=null&&u.fieldType&&u.fieldType!=="none"&&(f[v].baseTexture.alphaMode=ve.NO_PREMULTIPLIED_ALPHA,f[v].baseTexture.mipmap=pe.OFF)}for(var c=0;c<e.char.length;c++){var _=e.char[c],v=_.id,m=_.page,g=e.char[c],y=g.x,b=g.y,x=g.width,T=g.height,w=g.xoffset,S=g.yoffset,E=g.xadvance;y/=l,b/=l,x/=l,T/=l,w/=l,S/=l,E/=l;var P=new Z(y+f[m].frame.x/l,b+f[m].frame.y/l,x,T);this.chars[v]={xOffset:w,yOffset:S,xAdvance:E,kerning:{},texture:new W(f[m].baseTexture,P),page:m}}for(var c=0;c<e.kerning.length;c++){var O=e.kerning[c],D=O.first,N=O.second,U=O.amount;D/=l,N/=l,U/=l,this.chars[N]&&(this.chars[N].kerning[D]=U)}this.distanceFieldRange=u==null?void 0:u.distanceRange,this.distanceFieldType=(s=(n=u==null?void 0:u.fieldType)===null||n===void 0?void 0:n.toLowerCase())!==null&&s!==void 0?s:"none"}return r.prototype.destroy=function(){for(var e in this.chars)this.chars[e].texture.destroy(),this.chars[e].texture=null;for(var e in this.pageTextures)this._ownsTextures&&this.pageTextures[e].destroy(!0),this.pageTextures[e]=null;this.chars=null,this.pageTextures=null},r.install=function(e,t,i){var n;if(e instanceof Gn)n=e;else{var s=Su(e);if(!s)throw new Error("Unrecognized data format for font.");n=s.parse(e)}t instanceof W&&(t=[t]);var a=new r(n,t,i);return r.available[a.font]=a,a},r.uninstall=function(e){var t=r.available[e];if(!t)throw new Error("No font found named '"+e+"'");t.destroy(),delete r.available[e]},r.from=function(e,t,i){if(!e)throw new Error("[BitmapFont] Property `name` is required.");var n=Object.assign({},r.defaultOptions,i),s=n.chars,a=n.padding,o=n.resolution,h=n.textureWidth,u=n.textureHeight,l=oy(s),f=t instanceof ei?t:new ei(t),c=h,d=new Gn;d.info[0]={face:f.fontFamily,size:f.fontSize},d.common[0]={lineHeight:f.fontSize};for(var v=0,p=0,_,m,g,y=0,b=[],x=0;x<l.length;x++){_||(_=L.ADAPTER.createCanvas(),_.width=h,_.height=u,m=_.getContext("2d"),g=new Q(_,{resolution:o}),b.push(new W(g)),d.page.push({id:b.length-1,file:""}));var T=l[x],w=se.measureText(T,f,!1,_),S=w.width,E=Math.ceil(w.height),P=Math.ceil((f.fontStyle==="italic"?2:1)*S);if(p>=u-E*o){if(p===0)throw new Error("[BitmapFont] textureHeight "+u+"px is too small "+("(fontFamily: '"+f.fontFamily+"', fontSize: "+f.fontSize+"px, char: '"+T+"')"));--x,_=null,m=null,g=null,p=0,v=0,y=0;continue}if(y=Math.max(E+w.fontProperties.descent,y),P*o+v>=c){if(v===0)throw new Error("[BitmapFont] textureWidth "+h+"px is too small "+("(fontFamily: '"+f.fontFamily+"', fontSize: "+f.fontSize+"px, char: '"+T+"')"));--x,p+=y*o,p=Math.ceil(p),v=0,y=0;continue}ay(_,m,w,v,p,o,f);var O=Un(w.text);d.char.push({id:O,page:b.length-1,x:v/o,y:p/o,width:P,height:E,xoffset:0,yoffset:0,xadvance:Math.ceil(S-(f.dropShadow?f.dropShadowDistance:0)-(f.stroke?f.strokeThickness:0))}),v+=(P+2*a)*o,v=Math.ceil(v)}for(var x=0,D=l.length;x<D;x++)for(var N=l[x],U=0;U<D;U++){var A=l[U],R=m.measureText(N).width,F=m.measureText(A).width,V=m.measureText(N+A).width,H=V-(R+F);H&&d.kerning.push({first:Un(N),second:Un(A),amount:H})}var I=new r(d,b,!0);return r.available[e]!==void 0&&r.uninstall(e),r.available[e]=I,I},r.ALPHA=[["a","z"],["A","Z"]," "],r.NUMERIC=[["0","9"]],r.ALPHANUMERIC=[["a","z"],["A","Z"],["0","9"]," "],r.ASCII=[[" ","~"]],r.defaultOptions={resolution:1,textureWidth:512,textureHeight:512,padding:4,chars:r.ALPHANUMERIC},r.available={},r}(),hy=`// Pixi texture info\r
667
+ `,Nr=function(r){Ta(e,r);function e(t,i){var n=this,s={uSampler:t,alpha:1,uTextureMatrix:Ct.IDENTITY,uColor:new Float32Array([1,1,1,1])};return i=Object.assign({tint:16777215,alpha:1,pluginName:"batch"},i),i.uniforms&&Object.assign(s,i.uniforms),n=r.call(this,i.program||Pr.from(iy,ey),s)||this,n._colorDirty=!1,n.uvMatrix=new Ys(t),n.batchable=i.program===void 0,n.pluginName=i.pluginName,n.tint=i.tint,n.alpha=i.alpha,n}return Object.defineProperty(e.prototype,"texture",{get:function(){return this.uniforms.uSampler},set:function(t){this.uniforms.uSampler!==t&&(!this.uniforms.uSampler.baseTexture.alphaMode!=!t.baseTexture.alphaMode&&(this._colorDirty=!0),this.uniforms.uSampler=t,this.uvMatrix.texture=t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"alpha",{get:function(){return this._alpha},set:function(t){t!==this._alpha&&(this._alpha=t,this._colorDirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tint",{get:function(){return this._tint},set:function(t){t!==this._tint&&(this._tint=t,this._tintRGB=(t>>16)+(t&65280)+((t&255)<<16),this._colorDirty=!0)},enumerable:!1,configurable:!0}),e.prototype.update=function(){if(this._colorDirty){this._colorDirty=!1;var t=this.texture.baseTexture;fh(this._tint,this._alpha,this.uniforms.uColor,t.alphaMode)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)},e}($e),Bn=function(r){Ta(e,r);function e(t,i,n){var s=r.call(this)||this,a=new At(t),o=new At(i,!0),h=new At(n,!0,!0);return s.addAttribute("aVertexPosition",a,2,!1,k.FLOAT).addAttribute("aTextureCoord",o,2,!1,k.FLOAT).addIndex(h),s._updateId=-1,s}return Object.defineProperty(e.prototype,"vertexDirtyId",{get:function(){return this.buffers[0]._updateID},enumerable:!1,configurable:!0}),e}(wr);var Ea=function(r,e){return Ea=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},Ea(r,e)};function ry(r,e){Ea(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Un=function(){function r(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[],this.distanceField=[]}return r}(),ny=function(){function r(){}return r.test=function(e){return typeof e=="string"&&e.indexOf("info face=")===0},r.parse=function(e){var t=e.match(/^[a-z]+\s+.+$/gm),i={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[],distanceField:[]};for(var n in t){var s=t[n].match(/^[a-z]+/gm)[0],a=t[n].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),o={};for(var h in a){var u=a[h].split("="),l=u[0],f=u[1].replace(/"/gm,""),c=parseFloat(f),d=isNaN(c)?f:c;o[l]=d}i[s].push(o)}var v=new Un;return i.info.forEach(function(p){return v.info.push({face:p.face,size:parseInt(p.size,10)})}),i.common.forEach(function(p){return v.common.push({lineHeight:parseInt(p.lineHeight,10)})}),i.page.forEach(function(p){return v.page.push({id:parseInt(p.id,10),file:p.file})}),i.char.forEach(function(p){return v.char.push({id:parseInt(p.id,10),page:parseInt(p.page,10),x:parseInt(p.x,10),y:parseInt(p.y,10),width:parseInt(p.width,10),height:parseInt(p.height,10),xoffset:parseInt(p.xoffset,10),yoffset:parseInt(p.yoffset,10),xadvance:parseInt(p.xadvance,10)})}),i.kerning.forEach(function(p){return v.kerning.push({first:parseInt(p.first,10),second:parseInt(p.second,10),amount:parseInt(p.amount,10)})}),i.distanceField.forEach(function(p){return v.distanceField.push({distanceRange:parseInt(p.distanceRange,10),fieldType:p.fieldType})}),v},r}(),Sa=function(){function r(){}return r.test=function(e){return e instanceof XMLDocument&&e.getElementsByTagName("page").length&&e.getElementsByTagName("info")[0].getAttribute("face")!==null},r.parse=function(e){for(var t=new Un,i=e.getElementsByTagName("info"),n=e.getElementsByTagName("common"),s=e.getElementsByTagName("page"),a=e.getElementsByTagName("char"),o=e.getElementsByTagName("kerning"),h=e.getElementsByTagName("distanceField"),u=0;u<i.length;u++)t.info.push({face:i[u].getAttribute("face"),size:parseInt(i[u].getAttribute("size"),10)});for(var u=0;u<n.length;u++)t.common.push({lineHeight:parseInt(n[u].getAttribute("lineHeight"),10)});for(var u=0;u<s.length;u++)t.page.push({id:parseInt(s[u].getAttribute("id"),10)||0,file:s[u].getAttribute("file")});for(var u=0;u<a.length;u++){var l=a[u];t.char.push({id:parseInt(l.getAttribute("id"),10),page:parseInt(l.getAttribute("page"),10)||0,x:parseInt(l.getAttribute("x"),10),y:parseInt(l.getAttribute("y"),10),width:parseInt(l.getAttribute("width"),10),height:parseInt(l.getAttribute("height"),10),xoffset:parseInt(l.getAttribute("xoffset"),10),yoffset:parseInt(l.getAttribute("yoffset"),10),xadvance:parseInt(l.getAttribute("xadvance"),10)})}for(var u=0;u<o.length;u++)t.kerning.push({first:parseInt(o[u].getAttribute("first"),10),second:parseInt(o[u].getAttribute("second"),10),amount:parseInt(o[u].getAttribute("amount"),10)});for(var u=0;u<h.length;u++)t.distanceField.push({fieldType:h[u].getAttribute("fieldType"),distanceRange:parseInt(h[u].getAttribute("distanceRange"),10)});return t},r}(),sy=function(){function r(){}return r.test=function(e){if(typeof e=="string"&&e.indexOf("<font>")>-1){var t=new globalThis.DOMParser().parseFromString(e,"text/xml");return Sa.test(t)}return!1},r.parse=function(e){var t=new globalThis.DOMParser().parseFromString(e,"text/xml");return Sa.parse(t)},r}(),Pa=[ny,Sa,sy];function Pu(r){for(var e=0;e<Pa.length;e++)if(Pa[e].test(r))return Pa[e];return null}function ay(r,e,t,i,n,s){var a=t.fill;if(Array.isArray(a)){if(a.length===1)return a[0]}else return a;var o,h=t.dropShadow?t.dropShadowDistance:0,u=t.padding||0,l=r.width/i-h-u*2,f=r.height/i-h-u*2,c=a.slice(),d=t.fillGradientStops.slice();if(!d.length)for(var v=c.length+1,p=1;p<v;++p)d.push(p/v);if(c.unshift(a[0]),d.unshift(0),c.push(a[a.length-1]),d.push(1),t.fillGradientType===Mr.LINEAR_VERTICAL){o=e.createLinearGradient(l/2,u,l/2,f+u);for(var _=0,m=s.fontProperties.fontSize+t.strokeThickness,g=m/f,p=0;p<n.length;p++)for(var y=s.lineHeight*p,b=0;b<c.length;b++){var x=0;typeof d[b]=="number"?x=d[b]:x=b/c.length;var T=y/f+x*g,w=Math.max(_,T);w=Math.min(w,1),o.addColorStop(w,c[b]),_=w}}else{o=e.createLinearGradient(u,f/2,l+u,f/2);for(var S=c.length+1,E=1,p=0;p<c.length;p++){var P=void 0;typeof d[p]=="number"?P=d[p]:P=E/S,o.addColorStop(P,c[p]),E++}}return o}function oy(r,e,t,i,n,s,a){var o=t.text,h=t.fontProperties;e.translate(i,n),e.scale(s,s);var u=a.strokeThickness/2,l=-(a.strokeThickness/2);if(e.font=a.toFontString(),e.lineWidth=a.strokeThickness,e.textBaseline=a.textBaseline,e.lineJoin=a.lineJoin,e.miterLimit=a.miterLimit,e.fillStyle=ay(r,e,a,s,[o],t),e.strokeStyle=a.stroke,a.dropShadow){var f=a.dropShadowColor,c=Wi(typeof f=="number"?f:hh(f)),d=a.dropShadowBlur*s,v=a.dropShadowDistance*s;e.shadowColor="rgba("+c[0]*255+","+c[1]*255+","+c[2]*255+","+a.dropShadowAlpha+")",e.shadowBlur=d,e.shadowOffsetX=Math.cos(a.dropShadowAngle)*v,e.shadowOffsetY=Math.sin(a.dropShadowAngle)*v}else e.shadowColor="black",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0;a.stroke&&a.strokeThickness&&e.strokeText(o,u,l+t.lineHeight-h.descent),a.fill&&e.fillText(o,u,l+t.lineHeight-h.descent),e.setTransform(1,0,0,1,0,0),e.fillStyle="rgba(0, 0, 0, 0)"}function Ru(r){return Array.from?Array.from(r):r.split("")}function hy(r){typeof r=="string"&&(r=[r]);for(var e=[],t=0,i=r.length;t<i;t++){var n=r[t];if(Array.isArray(n)){if(n.length!==2)throw new Error("[BitmapFont]: Invalid character range length, expecting 2 got "+n.length+".");var s=n[0].charCodeAt(0),a=n[1].charCodeAt(0);if(a<s)throw new Error("[BitmapFont]: Invalid character range.");for(var o=s,h=a;o<=h;o++)e.push(String.fromCharCode(o))}else e.push.apply(e,Ru(n))}if(e.length===0)throw new Error("[BitmapFont]: Empty set when resolving characters.");return e}function Gn(r){return r.codePointAt?r.codePointAt(0):r.charCodeAt(0)}var wt=function(){function r(e,t,i){var n,s,a=e.info[0],o=e.common[0],h=e.page[0],u=e.distanceField[0],l=dn(h.file),f={};this._ownsTextures=i,this.font=a.face,this.size=a.size,this.lineHeight=o.lineHeight/l,this.chars={},this.pageTextures=f;for(var c=0;c<e.page.length;c++){var d=e.page[c],v=d.id,p=d.file;f[v]=t instanceof Array?t[c]:t[p],u!=null&&u.fieldType&&u.fieldType!=="none"&&(f[v].baseTexture.alphaMode=ve.NO_PREMULTIPLIED_ALPHA,f[v].baseTexture.mipmap=pe.OFF)}for(var c=0;c<e.char.length;c++){var _=e.char[c],v=_.id,m=_.page,g=e.char[c],y=g.x,b=g.y,x=g.width,T=g.height,w=g.xoffset,S=g.yoffset,E=g.xadvance;y/=l,b/=l,x/=l,T/=l,w/=l,S/=l,E/=l;var P=new q(y+f[m].frame.x/l,b+f[m].frame.y/l,x,T);this.chars[v]={xOffset:w,yOffset:S,xAdvance:E,kerning:{},texture:new V(f[m].baseTexture,P),page:m}}for(var c=0;c<e.kerning.length;c++){var O=e.kerning[c],M=O.first,F=O.second,G=O.amount;M/=l,F/=l,G/=l,this.chars[F]&&(this.chars[F].kerning[M]=G)}this.distanceFieldRange=u==null?void 0:u.distanceRange,this.distanceFieldType=(s=(n=u==null?void 0:u.fieldType)===null||n===void 0?void 0:n.toLowerCase())!==null&&s!==void 0?s:"none"}return r.prototype.destroy=function(){for(var e in this.chars)this.chars[e].texture.destroy(),this.chars[e].texture=null;for(var e in this.pageTextures)this._ownsTextures&&this.pageTextures[e].destroy(!0),this.pageTextures[e]=null;this.chars=null,this.pageTextures=null},r.install=function(e,t,i){var n;if(e instanceof Un)n=e;else{var s=Pu(e);if(!s)throw new Error("Unrecognized data format for font.");n=s.parse(e)}t instanceof V&&(t=[t]);var a=new r(n,t,i);return r.available[a.font]=a,a},r.uninstall=function(e){var t=r.available[e];if(!t)throw new Error("No font found named '"+e+"'");t.destroy(),delete r.available[e]},r.from=function(e,t,i){if(!e)throw new Error("[BitmapFont] Property `name` is required.");var n=Object.assign({},r.defaultOptions,i),s=n.chars,a=n.padding,o=n.resolution,h=n.textureWidth,u=n.textureHeight,l=hy(s),f=t instanceof ei?t:new ei(t),c=h,d=new Un;d.info[0]={face:f.fontFamily,size:f.fontSize},d.common[0]={lineHeight:f.fontSize};for(var v=0,p=0,_,m,g,y=0,b=[],x=0;x<l.length;x++){_||(_=L.ADAPTER.createCanvas(),_.width=h,_.height=u,m=_.getContext("2d"),g=new tt(_,{resolution:o}),b.push(new V(g)),d.page.push({id:b.length-1,file:""}));var T=l[x],w=se.measureText(T,f,!1,_),S=w.width,E=Math.ceil(w.height),P=Math.ceil((f.fontStyle==="italic"?2:1)*S);if(p>=u-E*o){if(p===0)throw new Error("[BitmapFont] textureHeight "+u+"px is too small "+("(fontFamily: '"+f.fontFamily+"', fontSize: "+f.fontSize+"px, char: '"+T+"')"));--x,_=null,m=null,g=null,p=0,v=0,y=0;continue}if(y=Math.max(E+w.fontProperties.descent,y),P*o+v>=c){if(v===0)throw new Error("[BitmapFont] textureWidth "+h+"px is too small "+("(fontFamily: '"+f.fontFamily+"', fontSize: "+f.fontSize+"px, char: '"+T+"')"));--x,p+=y*o,p=Math.ceil(p),v=0,y=0;continue}oy(_,m,w,v,p,o,f);var O=Gn(w.text);d.char.push({id:O,page:b.length-1,x:v/o,y:p/o,width:P,height:E,xoffset:0,yoffset:0,xadvance:Math.ceil(S-(f.dropShadow?f.dropShadowDistance:0)-(f.stroke?f.strokeThickness:0))}),v+=(P+2*a)*o,v=Math.ceil(v)}for(var x=0,M=l.length;x<M;x++)for(var F=l[x],G=0;G<M;G++){var A=l[G],I=m.measureText(F).width,N=m.measureText(A).width,Y=m.measureText(F+A).width,H=Y-(I+N);H&&d.kerning.push({first:Gn(F),second:Gn(A),amount:H})}var R=new r(d,b,!0);return r.available[e]!==void 0&&r.uninstall(e),r.available[e]=R,R},r.ALPHA=[["a","z"],["A","Z"]," "],r.NUMERIC=[["0","9"]],r.ALPHANUMERIC=[["a","z"],["A","Z"],["0","9"]," "],r.ASCII=[[" ","~"]],r.defaultOptions={resolution:1,textureWidth:512,textureHeight:512,padding:4,chars:r.ALPHANUMERIC},r.available={},r}(),uy=`// Pixi texture info\r
668
668
  varying vec2 vTextureCoord;\r
669
669
  uniform sampler2D uSampler;\r
670
670
  \r
@@ -698,7 +698,7 @@ void main(void) {\r
698
698
  gl_FragColor = vec4(uColor.rgb, uColor.a * alpha);\r
699
699
  \r
700
700
  }\r
701
- `,uy=`// Mesh material default fragment\r
701
+ `,ly=`// Mesh material default fragment\r
702
702
  attribute vec2 aVertexPosition;\r
703
703
  attribute vec2 aTextureCoord;\r
704
704
  \r
@@ -714,10 +714,10 @@ void main(void)\r
714
714
  \r
715
715
  vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;\r
716
716
  }\r
717
- `,Ru=[],Cu=[],Ou=[],kn=function(r){iy(e,r);function e(t,i){i===void 0&&(i={});var n=r.call(this)||this;n._tint=16777215;var s=Object.assign({},e.styleDefaults,i),a=s.align,o=s.tint,h=s.maxWidth,u=s.letterSpacing,l=s.fontName,f=s.fontSize;if(!wt.available[l])throw new Error('Missing BitmapFont "'+l+'"');return n._activePagesMeshData=[],n._textWidth=0,n._textHeight=0,n._align=a,n._tint=o,n._font=void 0,n._fontName=l,n._fontSize=f,n.text=t,n._maxWidth=h,n._maxLineHeight=0,n._letterSpacing=u,n._anchor=new Gi(function(){n.dirty=!0},n,0,0),n._roundPixels=L.ROUND_PIXELS,n.dirty=!0,n._resolution=L.RESOLUTION,n._autoResolution=!0,n._textureCache={},n}return e.prototype.updateText=function(){for(var t,i=wt.available[this._fontName],n=this.fontSize,s=n/i.size,a=new j,o=[],h=[],u=[],l=this._text.replace(/(?:\r\n|\r)/g,`
718
- `)||" ",f=Pu(l),c=this._maxWidth*i.size/n,d=i.distanceFieldType==="none"?Ru:Cu,v=null,p=0,_=0,m=0,g=-1,y=0,b=0,x=0,T=0,w=0;w<f.length;w++){var S=f[w],E=Un(S);if(/(?:\s)/.test(S)&&(g=w,y=p,T++),S==="\r"||S===`
719
- `){h.push(p),u.push(-1),_=Math.max(_,p),++m,++b,a.x=0,a.y+=i.lineHeight,v=null,T=0;continue}var P=i.chars[E];if(P){v&&P.kerning[v]&&(a.x+=P.kerning[v]);var O=Ou.pop()||{texture:W.EMPTY,line:0,charCode:0,prevSpaces:0,position:new j};O.texture=P.texture,O.line=m,O.charCode=E,O.position.x=a.x+P.xOffset+this._letterSpacing/2,O.position.y=a.y+P.yOffset,O.prevSpaces=T,o.push(O),p=O.position.x+Math.max(P.xAdvance-P.xOffset,P.texture.orig.width),a.x+=P.xAdvance+this._letterSpacing,x=Math.max(x,P.yOffset+P.texture.height),v=E,g!==-1&&c>0&&a.x>c&&(++b,zi(o,1+g-b,1+w-g),w=g,g=-1,h.push(y),u.push(o.length>0?o[o.length-1].prevSpaces:0),_=Math.max(_,y),m++,a.x=0,a.y+=i.lineHeight,v=null,T=0)}}var D=f[f.length-1];D!=="\r"&&D!==`
720
- `&&(/(?:\s)/.test(D)&&(p=y),h.push(p),_=Math.max(_,p),u.push(-1));for(var N=[],w=0;w<=m;w++){var U=0;this._align==="right"?U=_-h[w]:this._align==="center"?U=(_-h[w])/2:this._align==="justify"&&(U=u[w]<0?0:(_-h[w])/u[w]),N.push(U)}var A=o.length,R={},F=[],V=this._activePagesMeshData;d.push.apply(d,V);for(var w=0;w<A;w++){var H=o[w].texture,I=H.baseTexture.uid;if(!R[I]){var C=d.pop();if(!C){var G=new Bn,$=void 0,Y=void 0;i.distanceFieldType==="none"?($=new Nr(W.EMPTY),Y=X.NORMAL):($=new Nr(W.EMPTY,{program:Pr.from(uy,hy),uniforms:{uFWidth:0}}),Y=X.NORMAL_NPM);var rt=new Fr(G,$);rt.blendMode=Y,C={index:0,indexCount:0,vertexCount:0,uvsCount:0,total:0,mesh:rt,vertices:null,uvs:null,indices:null}}C.index=0,C.indexCount=0,C.vertexCount=0,C.uvsCount=0,C.total=0;var lt=this._textureCache;lt[I]=lt[I]||new W(H.baseTexture),C.mesh.texture=lt[I],C.mesh.tint=this._tint,F.push(C),R[I]=C}R[I].total++}for(var w=0;w<V.length;w++)F.indexOf(V[w])===-1&&this.removeChild(V[w].mesh);for(var w=0;w<F.length;w++)F[w].mesh.parent!==this&&this.addChild(F[w].mesh);this._activePagesMeshData=F;for(var w in R){var C=R[w],ft=C.total;if(!(((t=C.indices)===null||t===void 0?void 0:t.length)>6*ft)||C.vertices.length<Fr.BATCHABLE_SIZE*2)C.vertices=new Float32Array(4*2*ft),C.uvs=new Float32Array(4*2*ft),C.indices=new Uint16Array(6*ft);else for(var Lt=C.total,Ut=C.vertices,St=Lt*4*2;St<Ut.length;St++)Ut[St]=0;C.mesh.size=6*ft}for(var w=0;w<A;w++){var S=o[w],st=S.position.x+N[S.line]*(this._align==="justify"?S.prevSpaces:1);this._roundPixels&&(st=Math.round(st));var ut=st*s,ct=S.position.y*s,H=S.texture,tt=R[H.baseTexture.uid],zt=H.frame,qt=H._uvs,et=tt.index++;tt.indices[et*6+0]=0+et*4,tt.indices[et*6+1]=1+et*4,tt.indices[et*6+2]=2+et*4,tt.indices[et*6+3]=0+et*4,tt.indices[et*6+4]=2+et*4,tt.indices[et*6+5]=3+et*4,tt.vertices[et*8+0]=ut,tt.vertices[et*8+1]=ct,tt.vertices[et*8+2]=ut+zt.width*s,tt.vertices[et*8+3]=ct,tt.vertices[et*8+4]=ut+zt.width*s,tt.vertices[et*8+5]=ct+zt.height*s,tt.vertices[et*8+6]=ut,tt.vertices[et*8+7]=ct+zt.height*s,tt.uvs[et*8+0]=qt.x0,tt.uvs[et*8+1]=qt.y0,tt.uvs[et*8+2]=qt.x1,tt.uvs[et*8+3]=qt.y1,tt.uvs[et*8+4]=qt.x2,tt.uvs[et*8+5]=qt.y2,tt.uvs[et*8+6]=qt.x3,tt.uvs[et*8+7]=qt.y3}this._textWidth=_*s,this._textHeight=(a.y+i.lineHeight)*s;for(var w in R){var C=R[w];if(this.anchor.x!==0||this.anchor.y!==0)for(var Ne=0,fr=this._textWidth*this.anchor.x,ls=this._textHeight*this.anchor.y,gf=0;gf<C.total;gf++)C.vertices[Ne++]-=fr,C.vertices[Ne++]-=ls,C.vertices[Ne++]-=fr,C.vertices[Ne++]-=ls,C.vertices[Ne++]-=fr,C.vertices[Ne++]-=ls,C.vertices[Ne++]-=fr,C.vertices[Ne++]-=ls;this._maxLineHeight=x*s;var yf=C.mesh.geometry.getBuffer("aVertexPosition"),xf=C.mesh.geometry.getBuffer("aTextureCoord"),bf=C.mesh.geometry.getIndex();yf.data=C.vertices,xf.data=C.uvs,bf.data=C.indices,yf.update(),xf.update(),bf.update()}for(var w=0;w<o.length;w++)Ou.push(o[w]);this._font=i,this.dirty=!1},e.prototype.updateTransform=function(){this.validate(),this.containerUpdateTransform()},e.prototype._render=function(t){this._autoResolution&&this._resolution!==t.resolution&&(this._resolution=t.resolution,this.dirty=!0);var i=wt.available[this._fontName],n=i.distanceFieldRange,s=i.distanceFieldType,a=i.size;if(s!=="none")for(var o=this.worldTransform,h=o.a,u=o.b,l=o.c,f=o.d,c=Math.sqrt(h*h+u*u),d=Math.sqrt(l*l+f*f),v=(Math.abs(c)+Math.abs(d))/2,p=this.fontSize/a,_=0,m=this._activePagesMeshData;_<m.length;_++){var g=m[_];g.mesh.shader.uniforms.uFWidth=v*n*p*this._resolution}r.prototype._render.call(this,t)},e.prototype.getLocalBounds=function(){return this.validate(),r.prototype.getLocalBounds.call(this)},e.prototype.validate=function(){var t=wt.available[this._fontName];if(!t)throw new Error('Missing BitmapFont "'+this._fontName+'"');this._font!==t&&(this.dirty=!0),this.dirty&&this.updateText()},Object.defineProperty(e.prototype,"tint",{get:function(){return this._tint},set:function(t){if(this._tint!==t){this._tint=t;for(var i=0;i<this._activePagesMeshData.length;i++)this._activePagesMeshData[i].mesh.tint=t}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"align",{get:function(){return this._align},set:function(t){this._align!==t&&(this._align=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fontName",{get:function(){return this._fontName},set:function(t){if(!wt.available[t])throw new Error('Missing BitmapFont "'+t+'"');this._fontName!==t&&(this._fontName=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fontSize",{get:function(){var t;return(t=this._fontSize)!==null&&t!==void 0?t:wt.available[this._fontName].size},set:function(t){this._fontSize!==t&&(this._fontSize=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"anchor",{get:function(){return this._anchor},set:function(t){typeof t=="number"?this._anchor.set(t):this._anchor.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"text",{get:function(){return this._text},set:function(t){t=String(t??""),this._text!==t&&(this._text=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxWidth",{get:function(){return this._maxWidth},set:function(t){this._maxWidth!==t&&(this._maxWidth=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxLineHeight",{get:function(){return this.validate(),this._maxLineHeight},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"textWidth",{get:function(){return this.validate(),this._textWidth},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"letterSpacing",{get:function(){return this._letterSpacing},set:function(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"roundPixels",{get:function(){return this._roundPixels},set:function(t){t!==this._roundPixels&&(this._roundPixels=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"textHeight",{get:function(){return this.validate(),this._textHeight},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"resolution",{get:function(){return this._resolution},set:function(t){this._autoResolution=!1,this._resolution!==t&&(this._resolution=t,this.dirty=!0)},enumerable:!1,configurable:!0}),e.prototype.destroy=function(t){var i=this._textureCache,n=wt.available[this._fontName],s=n.distanceFieldType==="none"?Ru:Cu;s.push.apply(s,this._activePagesMeshData);for(var a=0,o=this._activePagesMeshData;a<o.length;a++){var h=o[a];this.removeChild(h.mesh)}this._activePagesMeshData=[],s.filter(function(f){return i[f.mesh.texture.baseTexture.uid]}).forEach(function(f){f.mesh.texture=W.EMPTY});for(var u in i){var l=i[u];l.destroy(),delete i[u]}this._font=null,this._textureCache=null,r.prototype.destroy.call(this,t)},e.styleDefaults={align:"left",tint:16777215,maxWidth:0,letterSpacing:0},e}(yt),ly=function(){function r(){}return r.add=function(){xt.setExtensionXhrType("fnt",xt.XHR_RESPONSE_TYPE.TEXT)},r.use=function(e,t){var i=Su(e.data);if(!i){t();return}for(var n=r.getBaseUrl(this,e),s=i.parse(e.data),a={},o=function(p){a[p.metadata.pageFile]=p.texture,Object.keys(a).length===s.page.length&&(e.bitmapFont=wt.install(s,a,!0),t())},h=0;h<s.page.length;++h){var u=s.page[h].file,l=n+u,f=!1;for(var c in this.resources){var d=this.resources[c];if(d.url===l){d.metadata.pageFile=u,d.texture?o(d):d.onAfterMiddleware.add(o),f=!0;break}}if(!f){var v={crossOrigin:e.crossOrigin,loadType:xt.LOAD_TYPE.IMAGE,metadata:Object.assign({pageFile:u},e.metadata.imageMetadata),parentResource:e};this.add(l,v,o)}}},r.getBaseUrl=function(e,t){var i=t.isDataUrl?"":r.dirname(t.url);return t.isDataUrl&&(i==="."&&(i=""),e.baseUrl&&i&&e.baseUrl.charAt(e.baseUrl.length-1)==="/"&&(i+="/")),i=i.replace(e.baseUrl,""),i&&i.charAt(i.length-1)!=="/"&&(i+="/"),i},r.dirname=function(e){var t=e.replace(/\\/g,"/").replace(/\/$/,"").replace(/\/[^\/]*$/,"");return t===e?".":t===""?"/":t},r.extension=nt.Loader,r}();var Ra=function(r,e){return Ra=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},Ra(r,e)};function fy(r,e){Ra(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var cy=`varying vec2 vTextureCoord;
717
+ `,Cu=[],Ou=[],Au=[],kn=function(r){ry(e,r);function e(t,i){i===void 0&&(i={});var n=r.call(this)||this;n._tint=16777215;var s=Object.assign({},e.styleDefaults,i),a=s.align,o=s.tint,h=s.maxWidth,u=s.letterSpacing,l=s.fontName,f=s.fontSize;if(!wt.available[l])throw new Error('Missing BitmapFont "'+l+'"');return n._activePagesMeshData=[],n._textWidth=0,n._textHeight=0,n._align=a,n._tint=o,n._font=void 0,n._fontName=l,n._fontSize=f,n.text=t,n._maxWidth=h,n._maxLineHeight=0,n._letterSpacing=u,n._anchor=new Ui(function(){n.dirty=!0},n,0,0),n._roundPixels=L.ROUND_PIXELS,n.dirty=!0,n._resolution=L.RESOLUTION,n._autoResolution=!0,n._textureCache={},n}return e.prototype.updateText=function(){for(var t,i=wt.available[this._fontName],n=this.fontSize,s=n/i.size,a=new j,o=[],h=[],u=[],l=this._text.replace(/(?:\r\n|\r)/g,`
718
+ `)||" ",f=Ru(l),c=this._maxWidth*i.size/n,d=i.distanceFieldType==="none"?Cu:Ou,v=null,p=0,_=0,m=0,g=-1,y=0,b=0,x=0,T=0,w=0;w<f.length;w++){var S=f[w],E=Gn(S);if(/(?:\s)/.test(S)&&(g=w,y=p,T++),S==="\r"||S===`
719
+ `){h.push(p),u.push(-1),_=Math.max(_,p),++m,++b,a.x=0,a.y+=i.lineHeight,v=null,T=0;continue}var P=i.chars[E];if(P){v&&P.kerning[v]&&(a.x+=P.kerning[v]);var O=Au.pop()||{texture:V.EMPTY,line:0,charCode:0,prevSpaces:0,position:new j};O.texture=P.texture,O.line=m,O.charCode=E,O.position.x=a.x+P.xOffset+this._letterSpacing/2,O.position.y=a.y+P.yOffset,O.prevSpaces=T,o.push(O),p=O.position.x+Math.max(P.xAdvance-P.xOffset,P.texture.orig.width),a.x+=P.xAdvance+this._letterSpacing,x=Math.max(x,P.yOffset+P.texture.height),v=E,g!==-1&&c>0&&a.x>c&&(++b,Vi(o,1+g-b,1+w-g),w=g,g=-1,h.push(y),u.push(o.length>0?o[o.length-1].prevSpaces:0),_=Math.max(_,y),m++,a.x=0,a.y+=i.lineHeight,v=null,T=0)}}var M=f[f.length-1];M!=="\r"&&M!==`
720
+ `&&(/(?:\s)/.test(M)&&(p=y),h.push(p),_=Math.max(_,p),u.push(-1));for(var F=[],w=0;w<=m;w++){var G=0;this._align==="right"?G=_-h[w]:this._align==="center"?G=(_-h[w])/2:this._align==="justify"&&(G=u[w]<0?0:(_-h[w])/u[w]),F.push(G)}var A=o.length,I={},N=[],Y=this._activePagesMeshData;d.push.apply(d,Y);for(var w=0;w<A;w++){var H=o[w].texture,R=H.baseTexture.uid;if(!I[R]){var C=d.pop();if(!C){var B=new Bn,Z=void 0,W=void 0;i.distanceFieldType==="none"?(Z=new Nr(V.EMPTY),W=X.NORMAL):(Z=new Nr(V.EMPTY,{program:Pr.from(ly,uy),uniforms:{uFWidth:0}}),W=X.NORMAL_NPM);var J=new Fr(B,Z);J.blendMode=W,C={index:0,indexCount:0,vertexCount:0,uvsCount:0,total:0,mesh:J,vertices:null,uvs:null,indices:null}}C.index=0,C.indexCount=0,C.vertexCount=0,C.uvsCount=0,C.total=0;var ut=this._textureCache;ut[R]=ut[R]||new V(H.baseTexture),C.mesh.texture=ut[R],C.mesh.tint=this._tint,N.push(C),I[R]=C}I[R].total++}for(var w=0;w<Y.length;w++)N.indexOf(Y[w])===-1&&this.removeChild(Y[w].mesh);for(var w=0;w<N.length;w++)N[w].mesh.parent!==this&&this.addChild(N[w].mesh);this._activePagesMeshData=N;for(var w in I){var C=I[w],ft=C.total;if(!(((t=C.indices)===null||t===void 0?void 0:t.length)>6*ft)||C.vertices.length<Fr.BATCHABLE_SIZE*2)C.vertices=new Float32Array(4*2*ft),C.uvs=new Float32Array(4*2*ft),C.indices=new Uint16Array(6*ft);else for(var Lt=C.total,Gt=C.vertices,St=Lt*4*2;St<Gt.length;St++)Gt[St]=0;C.mesh.size=6*ft}for(var w=0;w<A;w++){var S=o[w],st=S.position.x+F[S.line]*(this._align==="justify"?S.prevSpaces:1);this._roundPixels&&(st=Math.round(st));var lt=st*s,ct=S.position.y*s,H=S.texture,et=I[H.baseTexture.uid],Vt=H.frame,qt=H._uvs,it=et.index++;et.indices[it*6+0]=0+it*4,et.indices[it*6+1]=1+it*4,et.indices[it*6+2]=2+it*4,et.indices[it*6+3]=0+it*4,et.indices[it*6+4]=2+it*4,et.indices[it*6+5]=3+it*4,et.vertices[it*8+0]=lt,et.vertices[it*8+1]=ct,et.vertices[it*8+2]=lt+Vt.width*s,et.vertices[it*8+3]=ct,et.vertices[it*8+4]=lt+Vt.width*s,et.vertices[it*8+5]=ct+Vt.height*s,et.vertices[it*8+6]=lt,et.vertices[it*8+7]=ct+Vt.height*s,et.uvs[it*8+0]=qt.x0,et.uvs[it*8+1]=qt.y0,et.uvs[it*8+2]=qt.x1,et.uvs[it*8+3]=qt.y1,et.uvs[it*8+4]=qt.x2,et.uvs[it*8+5]=qt.y2,et.uvs[it*8+6]=qt.x3,et.uvs[it*8+7]=qt.y3}this._textWidth=_*s,this._textHeight=(a.y+i.lineHeight)*s;for(var w in I){var C=I[w];if(this.anchor.x!==0||this.anchor.y!==0)for(var Ne=0,fr=this._textWidth*this.anchor.x,ls=this._textHeight*this.anchor.y,yf=0;yf<C.total;yf++)C.vertices[Ne++]-=fr,C.vertices[Ne++]-=ls,C.vertices[Ne++]-=fr,C.vertices[Ne++]-=ls,C.vertices[Ne++]-=fr,C.vertices[Ne++]-=ls,C.vertices[Ne++]-=fr,C.vertices[Ne++]-=ls;this._maxLineHeight=x*s;var xf=C.mesh.geometry.getBuffer("aVertexPosition"),bf=C.mesh.geometry.getBuffer("aTextureCoord"),Tf=C.mesh.geometry.getIndex();xf.data=C.vertices,bf.data=C.uvs,Tf.data=C.indices,xf.update(),bf.update(),Tf.update()}for(var w=0;w<o.length;w++)Au.push(o[w]);this._font=i,this.dirty=!1},e.prototype.updateTransform=function(){this.validate(),this.containerUpdateTransform()},e.prototype._render=function(t){this._autoResolution&&this._resolution!==t.resolution&&(this._resolution=t.resolution,this.dirty=!0);var i=wt.available[this._fontName],n=i.distanceFieldRange,s=i.distanceFieldType,a=i.size;if(s!=="none")for(var o=this.worldTransform,h=o.a,u=o.b,l=o.c,f=o.d,c=Math.sqrt(h*h+u*u),d=Math.sqrt(l*l+f*f),v=(Math.abs(c)+Math.abs(d))/2,p=this.fontSize/a,_=0,m=this._activePagesMeshData;_<m.length;_++){var g=m[_];g.mesh.shader.uniforms.uFWidth=v*n*p*this._resolution}r.prototype._render.call(this,t)},e.prototype.getLocalBounds=function(){return this.validate(),r.prototype.getLocalBounds.call(this)},e.prototype.validate=function(){var t=wt.available[this._fontName];if(!t)throw new Error('Missing BitmapFont "'+this._fontName+'"');this._font!==t&&(this.dirty=!0),this.dirty&&this.updateText()},Object.defineProperty(e.prototype,"tint",{get:function(){return this._tint},set:function(t){if(this._tint!==t){this._tint=t;for(var i=0;i<this._activePagesMeshData.length;i++)this._activePagesMeshData[i].mesh.tint=t}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"align",{get:function(){return this._align},set:function(t){this._align!==t&&(this._align=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fontName",{get:function(){return this._fontName},set:function(t){if(!wt.available[t])throw new Error('Missing BitmapFont "'+t+'"');this._fontName!==t&&(this._fontName=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fontSize",{get:function(){var t;return(t=this._fontSize)!==null&&t!==void 0?t:wt.available[this._fontName].size},set:function(t){this._fontSize!==t&&(this._fontSize=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"anchor",{get:function(){return this._anchor},set:function(t){typeof t=="number"?this._anchor.set(t):this._anchor.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"text",{get:function(){return this._text},set:function(t){t=String(t??""),this._text!==t&&(this._text=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxWidth",{get:function(){return this._maxWidth},set:function(t){this._maxWidth!==t&&(this._maxWidth=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxLineHeight",{get:function(){return this.validate(),this._maxLineHeight},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"textWidth",{get:function(){return this.validate(),this._textWidth},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"letterSpacing",{get:function(){return this._letterSpacing},set:function(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"roundPixels",{get:function(){return this._roundPixels},set:function(t){t!==this._roundPixels&&(this._roundPixels=t,this.dirty=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"textHeight",{get:function(){return this.validate(),this._textHeight},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"resolution",{get:function(){return this._resolution},set:function(t){this._autoResolution=!1,this._resolution!==t&&(this._resolution=t,this.dirty=!0)},enumerable:!1,configurable:!0}),e.prototype.destroy=function(t){var i=this._textureCache,n=wt.available[this._fontName],s=n.distanceFieldType==="none"?Cu:Ou;s.push.apply(s,this._activePagesMeshData);for(var a=0,o=this._activePagesMeshData;a<o.length;a++){var h=o[a];this.removeChild(h.mesh)}this._activePagesMeshData=[],s.filter(function(f){return i[f.mesh.texture.baseTexture.uid]}).forEach(function(f){f.mesh.texture=V.EMPTY});for(var u in i){var l=i[u];l.destroy(),delete i[u]}this._font=null,this._textureCache=null,r.prototype.destroy.call(this,t)},e.styleDefaults={align:"left",tint:16777215,maxWidth:0,letterSpacing:0},e}(yt),fy=function(){function r(){}return r.add=function(){xt.setExtensionXhrType("fnt",xt.XHR_RESPONSE_TYPE.TEXT)},r.use=function(e,t){var i=Pu(e.data);if(!i){t();return}for(var n=r.getBaseUrl(this,e),s=i.parse(e.data),a={},o=function(p){a[p.metadata.pageFile]=p.texture,Object.keys(a).length===s.page.length&&(e.bitmapFont=wt.install(s,a,!0),t())},h=0;h<s.page.length;++h){var u=s.page[h].file,l=n+u,f=!1;for(var c in this.resources){var d=this.resources[c];if(d.url===l){d.metadata.pageFile=u,d.texture?o(d):d.onAfterMiddleware.add(o),f=!0;break}}if(!f){var v={crossOrigin:e.crossOrigin,loadType:xt.LOAD_TYPE.IMAGE,metadata:Object.assign({pageFile:u},e.metadata.imageMetadata),parentResource:e};this.add(l,v,o)}}},r.getBaseUrl=function(e,t){var i=t.isDataUrl?"":r.dirname(t.url);return t.isDataUrl&&(i==="."&&(i=""),e.baseUrl&&i&&e.baseUrl.charAt(e.baseUrl.length-1)==="/"&&(i+="/")),i=i.replace(e.baseUrl,""),i&&i.charAt(i.length-1)!=="/"&&(i+="/"),i},r.dirname=function(e){var t=e.replace(/\\/g,"/").replace(/\/$/,"").replace(/\/[^\/]*$/,"");return t===e?".":t===""?"/":t},r.extension=nt.Loader,r}();var Ra=function(r,e){return Ra=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},Ra(r,e)};function cy(r,e){Ra(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var dy=`varying vec2 vTextureCoord;
721
721
 
722
722
  uniform sampler2D uSampler;
723
723
  uniform float uAlpha;
@@ -726,7 +726,7 @@ void main(void)
726
726
  {
727
727
  gl_FragColor = texture2D(uSampler, vTextureCoord) * uAlpha;
728
728
  }
729
- `;(function(r){fy(e,r);function e(t){t===void 0&&(t=1);var i=r.call(this,om,cy,{uAlpha:1})||this;return i.alpha=t,i}return Object.defineProperty(e.prototype,"alpha",{get:function(){return this.uniforms.uAlpha},set:function(t){this.uniforms.uAlpha=t},enumerable:!1,configurable:!0}),e})(Je);var Ca=function(r,e){return Ca=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},Ca(r,e)};function Au(r,e){Ca(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var dy=`
729
+ `;(function(r){cy(e,r);function e(t){t===void 0&&(t=1);var i=r.call(this,hm,dy,{uAlpha:1})||this;return i.alpha=t,i}return Object.defineProperty(e.prototype,"alpha",{get:function(){return this.uniforms.uAlpha},set:function(t){this.uniforms.uAlpha=t},enumerable:!1,configurable:!0}),e})(Je);var Ca=function(r,e){return Ca=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},Ca(r,e)};function Iu(r,e){Ca(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var py=`
730
730
  attribute vec2 aVertexPosition;
731
731
 
732
732
  uniform mat3 projectionMatrix;
@@ -756,10 +756,10 @@ void main(void)
756
756
 
757
757
  vec2 textureCoord = filterTextureCoord();
758
758
  %blur%
759
- }`;function py(r,e){var t=Math.ceil(r/2),i=dy,n="",s;e?s="vBlurTexCoords[%index%] = textureCoord + vec2(%sampleIndex% * strength, 0.0);":s="vBlurTexCoords[%index%] = textureCoord + vec2(0.0, %sampleIndex% * strength);";for(var a=0;a<r;a++){var o=s.replace("%index%",a.toString());o=o.replace("%sampleIndex%",a-(t-1)+".0"),n+=o,n+=`
760
- `}return i=i.replace("%blur%",n),i=i.replace("%size%",r.toString()),i}var vy={5:[.153388,.221461,.250301],7:[.071303,.131514,.189879,.214607],9:[.028532,.067234,.124009,.179044,.20236],11:[.0093,.028002,.065984,.121703,.175713,.198596],13:[.002406,.009255,.027867,.065666,.121117,.174868,.197641],15:[489e-6,.002403,.009246,.02784,.065602,.120999,.174697,.197448]},_y=["varying vec2 vBlurTexCoords[%size%];","uniform sampler2D uSampler;","void main(void)","{"," gl_FragColor = vec4(0.0);"," %blur%","}"].join(`
761
- `);function my(r){for(var e=vy[r],t=e.length,i=_y,n="",s="gl_FragColor += texture2D(uSampler, vBlurTexCoords[%index%]) * %value%;",a,o=0;o<r;o++){var h=s.replace("%index%",o.toString());a=o,o>=t&&(a=r-o-1),h=h.replace("%value%",e[a].toString()),n+=h,n+=`
762
- `}return i=i.replace("%blur%",n),i=i.replace("%size%",r.toString()),i}var Iu=function(r){Au(e,r);function e(t,i,n,s,a){i===void 0&&(i=8),n===void 0&&(n=4),s===void 0&&(s=L.FILTER_RESOLUTION),a===void 0&&(a=5);var o=this,h=py(a,t),u=my(a);return o=r.call(this,h,u)||this,o.horizontal=t,o.resolution=s,o._quality=0,o.quality=n,o.blur=i,o}return e.prototype.apply=function(t,i,n,s){if(n?this.horizontal?this.uniforms.strength=1/n.width*(n.width/i.width):this.uniforms.strength=1/n.height*(n.height/i.height):this.horizontal?this.uniforms.strength=1/t.renderer.width*(t.renderer.width/i.width):this.uniforms.strength=1/t.renderer.height*(t.renderer.height/i.height),this.uniforms.strength*=this.strength,this.uniforms.strength/=this.passes,this.passes===1)t.applyFilter(this,i,n,s);else{var a=t.getFilterTexture(),o=t.renderer,h=i,u=a;this.state.blend=!1,t.applyFilter(this,h,u,_e.CLEAR);for(var l=1;l<this.passes-1;l++){t.bindAndClear(h,_e.BLIT),this.uniforms.uSampler=u;var f=u;u=h,h=f,o.shader.bind(this),o.geometry.draw(5)}this.state.blend=!0,t.applyFilter(this,u,n,s),t.returnFilterTexture(a)}},Object.defineProperty(e.prototype,"blur",{get:function(){return this.strength},set:function(t){this.padding=1+Math.abs(t)*2,this.strength=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"quality",{get:function(){return this._quality},set:function(t){this._quality=t,this.passes=t},enumerable:!1,configurable:!0}),e}(Je);(function(r){Au(e,r);function e(t,i,n,s){t===void 0&&(t=8),i===void 0&&(i=4),n===void 0&&(n=L.FILTER_RESOLUTION),s===void 0&&(s=5);var a=r.call(this)||this;return a.blurXFilter=new Iu(!0,t,i,n,s),a.blurYFilter=new Iu(!1,t,i,n,s),a.resolution=n,a.quality=i,a.blur=t,a.repeatEdgePixels=!1,a}return e.prototype.apply=function(t,i,n,s){var a=Math.abs(this.blurXFilter.strength),o=Math.abs(this.blurYFilter.strength);if(a&&o){var h=t.getFilterTexture();this.blurXFilter.apply(t,i,h,_e.CLEAR),this.blurYFilter.apply(t,h,n,s),t.returnFilterTexture(h)}else o?this.blurYFilter.apply(t,i,n,s):this.blurXFilter.apply(t,i,n,s)},e.prototype.updatePadding=function(){this._repeatEdgePixels?this.padding=0:this.padding=Math.max(Math.abs(this.blurXFilter.strength),Math.abs(this.blurYFilter.strength))*2},Object.defineProperty(e.prototype,"blur",{get:function(){return this.blurXFilter.blur},set:function(t){this.blurXFilter.blur=this.blurYFilter.blur=t,this.updatePadding()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"quality",{get:function(){return this.blurXFilter.quality},set:function(t){this.blurXFilter.quality=this.blurYFilter.quality=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"blurX",{get:function(){return this.blurXFilter.blur},set:function(t){this.blurXFilter.blur=t,this.updatePadding()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"blurY",{get:function(){return this.blurYFilter.blur},set:function(t){this.blurYFilter.blur=t,this.updatePadding()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"blendMode",{get:function(){return this.blurYFilter.blendMode},set:function(t){this.blurYFilter.blendMode=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"repeatEdgePixels",{get:function(){return this._repeatEdgePixels},set:function(t){this._repeatEdgePixels=t,this.updatePadding()},enumerable:!1,configurable:!0}),e})(Je);var Oa=function(r,e){return Oa=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},Oa(r,e)};function gy(r,e){Oa(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var yy=`varying vec2 vTextureCoord;
759
+ }`;function vy(r,e){var t=Math.ceil(r/2),i=py,n="",s;e?s="vBlurTexCoords[%index%] = textureCoord + vec2(%sampleIndex% * strength, 0.0);":s="vBlurTexCoords[%index%] = textureCoord + vec2(0.0, %sampleIndex% * strength);";for(var a=0;a<r;a++){var o=s.replace("%index%",a.toString());o=o.replace("%sampleIndex%",a-(t-1)+".0"),n+=o,n+=`
760
+ `}return i=i.replace("%blur%",n),i=i.replace("%size%",r.toString()),i}var _y={5:[.153388,.221461,.250301],7:[.071303,.131514,.189879,.214607],9:[.028532,.067234,.124009,.179044,.20236],11:[.0093,.028002,.065984,.121703,.175713,.198596],13:[.002406,.009255,.027867,.065666,.121117,.174868,.197641],15:[489e-6,.002403,.009246,.02784,.065602,.120999,.174697,.197448]},my=["varying vec2 vBlurTexCoords[%size%];","uniform sampler2D uSampler;","void main(void)","{"," gl_FragColor = vec4(0.0);"," %blur%","}"].join(`
761
+ `);function gy(r){for(var e=_y[r],t=e.length,i=my,n="",s="gl_FragColor += texture2D(uSampler, vBlurTexCoords[%index%]) * %value%;",a,o=0;o<r;o++){var h=s.replace("%index%",o.toString());a=o,o>=t&&(a=r-o-1),h=h.replace("%value%",e[a].toString()),n+=h,n+=`
762
+ `}return i=i.replace("%blur%",n),i=i.replace("%size%",r.toString()),i}var Mu=function(r){Iu(e,r);function e(t,i,n,s,a){i===void 0&&(i=8),n===void 0&&(n=4),s===void 0&&(s=L.FILTER_RESOLUTION),a===void 0&&(a=5);var o=this,h=vy(a,t),u=gy(a);return o=r.call(this,h,u)||this,o.horizontal=t,o.resolution=s,o._quality=0,o.quality=n,o.blur=i,o}return e.prototype.apply=function(t,i,n,s){if(n?this.horizontal?this.uniforms.strength=1/n.width*(n.width/i.width):this.uniforms.strength=1/n.height*(n.height/i.height):this.horizontal?this.uniforms.strength=1/t.renderer.width*(t.renderer.width/i.width):this.uniforms.strength=1/t.renderer.height*(t.renderer.height/i.height),this.uniforms.strength*=this.strength,this.uniforms.strength/=this.passes,this.passes===1)t.applyFilter(this,i,n,s);else{var a=t.getFilterTexture(),o=t.renderer,h=i,u=a;this.state.blend=!1,t.applyFilter(this,h,u,_e.CLEAR);for(var l=1;l<this.passes-1;l++){t.bindAndClear(h,_e.BLIT),this.uniforms.uSampler=u;var f=u;u=h,h=f,o.shader.bind(this),o.geometry.draw(5)}this.state.blend=!0,t.applyFilter(this,u,n,s),t.returnFilterTexture(a)}},Object.defineProperty(e.prototype,"blur",{get:function(){return this.strength},set:function(t){this.padding=1+Math.abs(t)*2,this.strength=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"quality",{get:function(){return this._quality},set:function(t){this._quality=t,this.passes=t},enumerable:!1,configurable:!0}),e}(Je);(function(r){Iu(e,r);function e(t,i,n,s){t===void 0&&(t=8),i===void 0&&(i=4),n===void 0&&(n=L.FILTER_RESOLUTION),s===void 0&&(s=5);var a=r.call(this)||this;return a.blurXFilter=new Mu(!0,t,i,n,s),a.blurYFilter=new Mu(!1,t,i,n,s),a.resolution=n,a.quality=i,a.blur=t,a.repeatEdgePixels=!1,a}return e.prototype.apply=function(t,i,n,s){var a=Math.abs(this.blurXFilter.strength),o=Math.abs(this.blurYFilter.strength);if(a&&o){var h=t.getFilterTexture();this.blurXFilter.apply(t,i,h,_e.CLEAR),this.blurYFilter.apply(t,h,n,s),t.returnFilterTexture(h)}else o?this.blurYFilter.apply(t,i,n,s):this.blurXFilter.apply(t,i,n,s)},e.prototype.updatePadding=function(){this._repeatEdgePixels?this.padding=0:this.padding=Math.max(Math.abs(this.blurXFilter.strength),Math.abs(this.blurYFilter.strength))*2},Object.defineProperty(e.prototype,"blur",{get:function(){return this.blurXFilter.blur},set:function(t){this.blurXFilter.blur=this.blurYFilter.blur=t,this.updatePadding()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"quality",{get:function(){return this.blurXFilter.quality},set:function(t){this.blurXFilter.quality=this.blurYFilter.quality=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"blurX",{get:function(){return this.blurXFilter.blur},set:function(t){this.blurXFilter.blur=t,this.updatePadding()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"blurY",{get:function(){return this.blurYFilter.blur},set:function(t){this.blurYFilter.blur=t,this.updatePadding()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"blendMode",{get:function(){return this.blurYFilter.blendMode},set:function(t){this.blurYFilter.blendMode=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"repeatEdgePixels",{get:function(){return this._repeatEdgePixels},set:function(t){this._repeatEdgePixels=t,this.updatePadding()},enumerable:!1,configurable:!0}),e})(Je);var Oa=function(r,e){return Oa=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},Oa(r,e)};function yy(r,e){Oa(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var xy=`varying vec2 vTextureCoord;
763
763
  uniform sampler2D uSampler;
764
764
  uniform float m[20];
765
765
  uniform float uAlpha;
@@ -811,7 +811,7 @@ void main(void)
811
811
 
812
812
  gl_FragColor = vec4(rgb, result.a);
813
813
  }
814
- `,Mu=function(r){gy(e,r);function e(){var t=this,i={m:new Float32Array([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]),uAlpha:1};return t=r.call(this,Wh,yy,i)||this,t.alpha=1,t}return e.prototype._loadMatrix=function(t,i){i===void 0&&(i=!1);var n=t;i&&(this._multiply(n,this.uniforms.m,t),n=this._colorMatrix(n)),this.uniforms.m=n},e.prototype._multiply=function(t,i,n){return t[0]=i[0]*n[0]+i[1]*n[5]+i[2]*n[10]+i[3]*n[15],t[1]=i[0]*n[1]+i[1]*n[6]+i[2]*n[11]+i[3]*n[16],t[2]=i[0]*n[2]+i[1]*n[7]+i[2]*n[12]+i[3]*n[17],t[3]=i[0]*n[3]+i[1]*n[8]+i[2]*n[13]+i[3]*n[18],t[4]=i[0]*n[4]+i[1]*n[9]+i[2]*n[14]+i[3]*n[19]+i[4],t[5]=i[5]*n[0]+i[6]*n[5]+i[7]*n[10]+i[8]*n[15],t[6]=i[5]*n[1]+i[6]*n[6]+i[7]*n[11]+i[8]*n[16],t[7]=i[5]*n[2]+i[6]*n[7]+i[7]*n[12]+i[8]*n[17],t[8]=i[5]*n[3]+i[6]*n[8]+i[7]*n[13]+i[8]*n[18],t[9]=i[5]*n[4]+i[6]*n[9]+i[7]*n[14]+i[8]*n[19]+i[9],t[10]=i[10]*n[0]+i[11]*n[5]+i[12]*n[10]+i[13]*n[15],t[11]=i[10]*n[1]+i[11]*n[6]+i[12]*n[11]+i[13]*n[16],t[12]=i[10]*n[2]+i[11]*n[7]+i[12]*n[12]+i[13]*n[17],t[13]=i[10]*n[3]+i[11]*n[8]+i[12]*n[13]+i[13]*n[18],t[14]=i[10]*n[4]+i[11]*n[9]+i[12]*n[14]+i[13]*n[19]+i[14],t[15]=i[15]*n[0]+i[16]*n[5]+i[17]*n[10]+i[18]*n[15],t[16]=i[15]*n[1]+i[16]*n[6]+i[17]*n[11]+i[18]*n[16],t[17]=i[15]*n[2]+i[16]*n[7]+i[17]*n[12]+i[18]*n[17],t[18]=i[15]*n[3]+i[16]*n[8]+i[17]*n[13]+i[18]*n[18],t[19]=i[15]*n[4]+i[16]*n[9]+i[17]*n[14]+i[18]*n[19]+i[19],t},e.prototype._colorMatrix=function(t){var i=new Float32Array(t);return i[4]/=255,i[9]/=255,i[14]/=255,i[19]/=255,i},e.prototype.brightness=function(t,i){var n=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0];this._loadMatrix(n,i)},e.prototype.tint=function(t,i){var n=t>>16&255,s=t>>8&255,a=t&255,o=[n/255,0,0,0,0,0,s/255,0,0,0,0,0,a/255,0,0,0,0,0,1,0];this._loadMatrix(o,i)},e.prototype.greyscale=function(t,i){var n=[t,t,t,0,0,t,t,t,0,0,t,t,t,0,0,0,0,0,1,0];this._loadMatrix(n,i)},e.prototype.blackAndWhite=function(t){var i=[.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0];this._loadMatrix(i,t)},e.prototype.hue=function(t,i){t=(t||0)/180*Math.PI;var n=Math.cos(t),s=Math.sin(t),a=Math.sqrt,o=1/3,h=a(o),u=n+(1-n)*o,l=o*(1-n)-h*s,f=o*(1-n)+h*s,c=o*(1-n)+h*s,d=n+o*(1-n),v=o*(1-n)-h*s,p=o*(1-n)-h*s,_=o*(1-n)+h*s,m=n+o*(1-n),g=[u,l,f,0,0,c,d,v,0,0,p,_,m,0,0,0,0,0,1,0];this._loadMatrix(g,i)},e.prototype.contrast=function(t,i){var n=(t||0)+1,s=-.5*(n-1),a=[n,0,0,0,s,0,n,0,0,s,0,0,n,0,s,0,0,0,1,0];this._loadMatrix(a,i)},e.prototype.saturate=function(t,i){t===void 0&&(t=0);var n=t*2/3+1,s=(n-1)*-.5,a=[n,s,s,0,0,s,n,s,0,0,s,s,n,0,0,0,0,0,1,0];this._loadMatrix(a,i)},e.prototype.desaturate=function(){this.saturate(-1)},e.prototype.negative=function(t){var i=[-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0];this._loadMatrix(i,t)},e.prototype.sepia=function(t){var i=[.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0];this._loadMatrix(i,t)},e.prototype.technicolor=function(t){var i=[1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0];this._loadMatrix(i,t)},e.prototype.polaroid=function(t){var i=[1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0];this._loadMatrix(i,t)},e.prototype.toBGR=function(t){var i=[0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0];this._loadMatrix(i,t)},e.prototype.kodachrome=function(t){var i=[1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0];this._loadMatrix(i,t)},e.prototype.browni=function(t){var i=[.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0];this._loadMatrix(i,t)},e.prototype.vintage=function(t){var i=[.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0];this._loadMatrix(i,t)},e.prototype.colorTone=function(t,i,n,s,a){t=t||.2,i=i||.15,n=n||16770432,s=s||3375104;var o=(n>>16&255)/255,h=(n>>8&255)/255,u=(n&255)/255,l=(s>>16&255)/255,f=(s>>8&255)/255,c=(s&255)/255,d=[.3,.59,.11,0,0,o,h,u,t,0,l,f,c,i,0,o-l,h-f,u-c,0,0];this._loadMatrix(d,a)},e.prototype.night=function(t,i){t=t||.1;var n=[t*-2,-t,0,0,0,-t,0,t,0,0,0,t,t*2,0,0,0,0,0,1,0];this._loadMatrix(n,i)},e.prototype.predator=function(t,i){var n=[11.224130630493164*t,-4.794486999511719*t,-2.8746118545532227*t,0*t,.40342438220977783*t,-3.6330697536468506*t,9.193157196044922*t,-2.951810836791992*t,0*t,-1.316135048866272*t,-3.2184197902679443*t,-4.2375030517578125*t,7.476448059082031*t,0*t,.8044459223747253*t,0,0,0,1,0];this._loadMatrix(n,i)},e.prototype.lsd=function(t){var i=[2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0];this._loadMatrix(i,t)},e.prototype.reset=function(){var t=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0];this._loadMatrix(t,!1)},Object.defineProperty(e.prototype,"matrix",{get:function(){return this.uniforms.m},set:function(t){this.uniforms.m=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"alpha",{get:function(){return this.uniforms.uAlpha},set:function(t){this.uniforms.uAlpha=t},enumerable:!1,configurable:!0}),e}(Je);Mu.prototype.grayscale=Mu.prototype.greyscale;var Aa=function(r,e){return Aa=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},Aa(r,e)};function xy(r,e){Aa(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var by=`varying vec2 vFilterCoord;
814
+ `,Du=function(r){yy(e,r);function e(){var t=this,i={m:new Float32Array([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]),uAlpha:1};return t=r.call(this,Vh,xy,i)||this,t.alpha=1,t}return e.prototype._loadMatrix=function(t,i){i===void 0&&(i=!1);var n=t;i&&(this._multiply(n,this.uniforms.m,t),n=this._colorMatrix(n)),this.uniforms.m=n},e.prototype._multiply=function(t,i,n){return t[0]=i[0]*n[0]+i[1]*n[5]+i[2]*n[10]+i[3]*n[15],t[1]=i[0]*n[1]+i[1]*n[6]+i[2]*n[11]+i[3]*n[16],t[2]=i[0]*n[2]+i[1]*n[7]+i[2]*n[12]+i[3]*n[17],t[3]=i[0]*n[3]+i[1]*n[8]+i[2]*n[13]+i[3]*n[18],t[4]=i[0]*n[4]+i[1]*n[9]+i[2]*n[14]+i[3]*n[19]+i[4],t[5]=i[5]*n[0]+i[6]*n[5]+i[7]*n[10]+i[8]*n[15],t[6]=i[5]*n[1]+i[6]*n[6]+i[7]*n[11]+i[8]*n[16],t[7]=i[5]*n[2]+i[6]*n[7]+i[7]*n[12]+i[8]*n[17],t[8]=i[5]*n[3]+i[6]*n[8]+i[7]*n[13]+i[8]*n[18],t[9]=i[5]*n[4]+i[6]*n[9]+i[7]*n[14]+i[8]*n[19]+i[9],t[10]=i[10]*n[0]+i[11]*n[5]+i[12]*n[10]+i[13]*n[15],t[11]=i[10]*n[1]+i[11]*n[6]+i[12]*n[11]+i[13]*n[16],t[12]=i[10]*n[2]+i[11]*n[7]+i[12]*n[12]+i[13]*n[17],t[13]=i[10]*n[3]+i[11]*n[8]+i[12]*n[13]+i[13]*n[18],t[14]=i[10]*n[4]+i[11]*n[9]+i[12]*n[14]+i[13]*n[19]+i[14],t[15]=i[15]*n[0]+i[16]*n[5]+i[17]*n[10]+i[18]*n[15],t[16]=i[15]*n[1]+i[16]*n[6]+i[17]*n[11]+i[18]*n[16],t[17]=i[15]*n[2]+i[16]*n[7]+i[17]*n[12]+i[18]*n[17],t[18]=i[15]*n[3]+i[16]*n[8]+i[17]*n[13]+i[18]*n[18],t[19]=i[15]*n[4]+i[16]*n[9]+i[17]*n[14]+i[18]*n[19]+i[19],t},e.prototype._colorMatrix=function(t){var i=new Float32Array(t);return i[4]/=255,i[9]/=255,i[14]/=255,i[19]/=255,i},e.prototype.brightness=function(t,i){var n=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0];this._loadMatrix(n,i)},e.prototype.tint=function(t,i){var n=t>>16&255,s=t>>8&255,a=t&255,o=[n/255,0,0,0,0,0,s/255,0,0,0,0,0,a/255,0,0,0,0,0,1,0];this._loadMatrix(o,i)},e.prototype.greyscale=function(t,i){var n=[t,t,t,0,0,t,t,t,0,0,t,t,t,0,0,0,0,0,1,0];this._loadMatrix(n,i)},e.prototype.blackAndWhite=function(t){var i=[.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0];this._loadMatrix(i,t)},e.prototype.hue=function(t,i){t=(t||0)/180*Math.PI;var n=Math.cos(t),s=Math.sin(t),a=Math.sqrt,o=1/3,h=a(o),u=n+(1-n)*o,l=o*(1-n)-h*s,f=o*(1-n)+h*s,c=o*(1-n)+h*s,d=n+o*(1-n),v=o*(1-n)-h*s,p=o*(1-n)-h*s,_=o*(1-n)+h*s,m=n+o*(1-n),g=[u,l,f,0,0,c,d,v,0,0,p,_,m,0,0,0,0,0,1,0];this._loadMatrix(g,i)},e.prototype.contrast=function(t,i){var n=(t||0)+1,s=-.5*(n-1),a=[n,0,0,0,s,0,n,0,0,s,0,0,n,0,s,0,0,0,1,0];this._loadMatrix(a,i)},e.prototype.saturate=function(t,i){t===void 0&&(t=0);var n=t*2/3+1,s=(n-1)*-.5,a=[n,s,s,0,0,s,n,s,0,0,s,s,n,0,0,0,0,0,1,0];this._loadMatrix(a,i)},e.prototype.desaturate=function(){this.saturate(-1)},e.prototype.negative=function(t){var i=[-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0];this._loadMatrix(i,t)},e.prototype.sepia=function(t){var i=[.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0];this._loadMatrix(i,t)},e.prototype.technicolor=function(t){var i=[1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0];this._loadMatrix(i,t)},e.prototype.polaroid=function(t){var i=[1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0];this._loadMatrix(i,t)},e.prototype.toBGR=function(t){var i=[0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0];this._loadMatrix(i,t)},e.prototype.kodachrome=function(t){var i=[1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0];this._loadMatrix(i,t)},e.prototype.browni=function(t){var i=[.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0];this._loadMatrix(i,t)},e.prototype.vintage=function(t){var i=[.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0];this._loadMatrix(i,t)},e.prototype.colorTone=function(t,i,n,s,a){t=t||.2,i=i||.15,n=n||16770432,s=s||3375104;var o=(n>>16&255)/255,h=(n>>8&255)/255,u=(n&255)/255,l=(s>>16&255)/255,f=(s>>8&255)/255,c=(s&255)/255,d=[.3,.59,.11,0,0,o,h,u,t,0,l,f,c,i,0,o-l,h-f,u-c,0,0];this._loadMatrix(d,a)},e.prototype.night=function(t,i){t=t||.1;var n=[t*-2,-t,0,0,0,-t,0,t,0,0,0,t,t*2,0,0,0,0,0,1,0];this._loadMatrix(n,i)},e.prototype.predator=function(t,i){var n=[11.224130630493164*t,-4.794486999511719*t,-2.8746118545532227*t,0*t,.40342438220977783*t,-3.6330697536468506*t,9.193157196044922*t,-2.951810836791992*t,0*t,-1.316135048866272*t,-3.2184197902679443*t,-4.2375030517578125*t,7.476448059082031*t,0*t,.8044459223747253*t,0,0,0,1,0];this._loadMatrix(n,i)},e.prototype.lsd=function(t){var i=[2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0];this._loadMatrix(i,t)},e.prototype.reset=function(){var t=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0];this._loadMatrix(t,!1)},Object.defineProperty(e.prototype,"matrix",{get:function(){return this.uniforms.m},set:function(t){this.uniforms.m=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"alpha",{get:function(){return this.uniforms.uAlpha},set:function(t){this.uniforms.uAlpha=t},enumerable:!1,configurable:!0}),e}(Je);Du.prototype.grayscale=Du.prototype.greyscale;var Aa=function(r,e){return Aa=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},Aa(r,e)};function by(r,e){Aa(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Ty=`varying vec2 vFilterCoord;
815
815
  varying vec2 vTextureCoord;
816
816
 
817
817
  uniform vec2 scale;
@@ -831,7 +831,7 @@ void main(void)
831
831
 
832
832
  gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw));
833
833
  }
834
- `,Ty=`attribute vec2 aVertexPosition;
834
+ `,wy=`attribute vec2 aVertexPosition;
835
835
 
836
836
  uniform mat3 projectionMatrix;
837
837
  uniform mat3 filterMatrix;
@@ -860,7 +860,7 @@ void main(void)
860
860
  vTextureCoord = filterTextureCoord();
861
861
  vFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0) ).xy;
862
862
  }
863
- `;(function(r){xy(e,r);function e(t,i){var n=this,s=new Ct;return t.renderable=!1,n=r.call(this,Ty,by,{mapSampler:t._texture,filterMatrix:s,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])})||this,n.maskSprite=t,n.maskMatrix=s,i==null&&(i=20),n.scale=new j(i,i),n}return e.prototype.apply=function(t,i,n,s){this.uniforms.filterMatrix=t.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;var a=this.maskSprite.worldTransform,o=Math.sqrt(a.a*a.a+a.b*a.b),h=Math.sqrt(a.c*a.c+a.d*a.d);o!==0&&h!==0&&(this.uniforms.rotation[0]=a.a/o,this.uniforms.rotation[1]=a.b/o,this.uniforms.rotation[2]=a.c/h,this.uniforms.rotation[3]=a.d/h),t.applyFilter(this,i,n,s)},Object.defineProperty(e.prototype,"map",{get:function(){return this.uniforms.mapSampler},set:function(t){this.uniforms.mapSampler=t},enumerable:!1,configurable:!0}),e})(Je);var Ia=function(r,e){return Ia=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},Ia(r,e)};function wy(r,e){Ia(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Ey=`
863
+ `;(function(r){by(e,r);function e(t,i){var n=this,s=new Ct;return t.renderable=!1,n=r.call(this,wy,Ty,{mapSampler:t._texture,filterMatrix:s,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])})||this,n.maskSprite=t,n.maskMatrix=s,i==null&&(i=20),n.scale=new j(i,i),n}return e.prototype.apply=function(t,i,n,s){this.uniforms.filterMatrix=t.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;var a=this.maskSprite.worldTransform,o=Math.sqrt(a.a*a.a+a.b*a.b),h=Math.sqrt(a.c*a.c+a.d*a.d);o!==0&&h!==0&&(this.uniforms.rotation[0]=a.a/o,this.uniforms.rotation[1]=a.b/o,this.uniforms.rotation[2]=a.c/h,this.uniforms.rotation[3]=a.d/h),t.applyFilter(this,i,n,s)},Object.defineProperty(e.prototype,"map",{get:function(){return this.uniforms.mapSampler},set:function(t){this.uniforms.mapSampler=t},enumerable:!1,configurable:!0}),e})(Je);var Ia=function(r,e){return Ia=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},Ia(r,e)};function Ey(r,e){Ia(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Sy=`
864
864
  attribute vec2 aVertexPosition;
865
865
 
866
866
  uniform mat3 projectionMatrix;
@@ -902,7 +902,7 @@ void main(void) {
902
902
 
903
903
  texcoords(vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);
904
904
  }
905
- `,Sy=`varying vec2 v_rgbNW;
905
+ `,Py=`varying vec2 v_rgbNW;
906
906
  varying vec2 v_rgbNE;
907
907
  varying vec2 v_rgbSW;
908
908
  varying vec2 v_rgbSE;
@@ -1023,7 +1023,7 @@ void main() {
1023
1023
 
1024
1024
  gl_FragColor = color;
1025
1025
  }
1026
- `;(function(r){wy(e,r);function e(){return r.call(this,Ey,Sy)||this}return e})(Je);var Ma=function(r,e){return Ma=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},Ma(r,e)};function Py(r,e){Ma(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Ry=`precision highp float;
1026
+ `;(function(r){Ey(e,r);function e(){return r.call(this,Sy,Py)||this}return e})(Je);var Ma=function(r,e){return Ma=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},Ma(r,e)};function Ry(r,e){Ma(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Cy=`precision highp float;
1027
1027
 
1028
1028
  varying vec2 vTextureCoord;
1029
1029
  varying vec4 vColor;
@@ -1057,6 +1057,6 @@ void main()
1057
1057
 
1058
1058
  gl_FragColor = color;
1059
1059
  }
1060
- `;(function(r){Py(e,r);function e(t,i){t===void 0&&(t=.5),i===void 0&&(i=Math.random());var n=r.call(this,Wh,Ry,{uNoise:0,uSeed:0})||this;return n.noise=t,n.seed=i,n}return Object.defineProperty(e.prototype,"noise",{get:function(){return this.uniforms.uNoise},set:function(t){this.uniforms.uNoise=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"seed",{get:function(){return this.uniforms.uSeed},set:function(t){this.uniforms.uSeed=t},enumerable:!1,configurable:!0}),e})(Je);var Du=new Ct;Tt.prototype._cacheAsBitmap=!1,Tt.prototype._cacheData=null,Tt.prototype._cacheAsBitmapResolution=null,Tt.prototype._cacheAsBitmapMultisample=gt.NONE;var Cy=function(){function r(){this.textureCacheId=null,this.originalRender=null,this.originalRenderCanvas=null,this.originalCalculateBounds=null,this.originalGetLocalBounds=null,this.originalUpdateTransform=null,this.originalDestroy=null,this.originalMask=null,this.originalFilterArea=null,this.originalContainsPoint=null,this.sprite=null}return r}();Object.defineProperties(Tt.prototype,{cacheAsBitmapResolution:{get:function(){return this._cacheAsBitmapResolution},set:function(r){r!==this._cacheAsBitmapResolution&&(this._cacheAsBitmapResolution=r,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmapMultisample:{get:function(){return this._cacheAsBitmapMultisample},set:function(r){r!==this._cacheAsBitmapMultisample&&(this._cacheAsBitmapMultisample=r,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmap:{get:function(){return this._cacheAsBitmap},set:function(r){if(this._cacheAsBitmap!==r){this._cacheAsBitmap=r;var e;r?(this._cacheData||(this._cacheData=new Cy),e=this._cacheData,e.originalRender=this.render,e.originalRenderCanvas=this.renderCanvas,e.originalUpdateTransform=this.updateTransform,e.originalCalculateBounds=this.calculateBounds,e.originalGetLocalBounds=this.getLocalBounds,e.originalDestroy=this.destroy,e.originalContainsPoint=this.containsPoint,e.originalMask=this._mask,e.originalFilterArea=this.filterArea,this.render=this._renderCached,this.renderCanvas=this._renderCachedCanvas,this.destroy=this._cacheAsBitmapDestroy):(e=this._cacheData,e.sprite&&this._destroyCachedDisplayObject(),this.render=e.originalRender,this.renderCanvas=e.originalRenderCanvas,this.calculateBounds=e.originalCalculateBounds,this.getLocalBounds=e.originalGetLocalBounds,this.destroy=e.originalDestroy,this.updateTransform=e.originalUpdateTransform,this.containsPoint=e.originalContainsPoint,this._mask=e.originalMask,this.filterArea=e.originalFilterArea)}}}}),Tt.prototype._renderCached=function(e){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObject(e),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._render(e))},Tt.prototype._initCachedDisplayObject=function(e){var t;if(!(this._cacheData&&this._cacheData.sprite)){var i=this.alpha;this.alpha=1,e.batch.flush();var n=this.getLocalBounds(null,!0).clone();if(this.filters&&this.filters.length){var s=this.filters[0].padding;n.pad(s)}n.ceil(L.RESOLUTION);var a=e.renderTexture.current,o=e.renderTexture.sourceFrame.clone(),h=e.renderTexture.destinationFrame.clone(),u=e.projection.transform,l=bi.create({width:n.width,height:n.height,resolution:this.cacheAsBitmapResolution||e.resolution,multisample:(t=this.cacheAsBitmapMultisample)!==null&&t!==void 0?t:e.multisample}),f="cacheAsBitmap_"+yi();this._cacheData.textureCacheId=f,Q.addToCache(l.baseTexture,f),W.addToCache(l,f);var c=this.transform.localTransform.copyTo(Du).invert().translate(-n.x,-n.y);this.render=this._cacheData.originalRender,e.render(this,{renderTexture:l,clear:!0,transform:c,skipUpdateTransform:!1}),e.framebuffer.blit(),e.projection.transform=u,e.renderTexture.bind(a,o,h),this.render=this._renderCached,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null,this.alpha=i;var d=new We(l);d.transform.worldTransform=this.transform.worldTransform,d.anchor.x=-(n.x/n.width),d.anchor.y=-(n.y/n.height),d.alpha=i,d._bounds=this._bounds,this._cacheData.sprite=d,this.transform._parentID=-1,this.parent?this.updateTransform():(this.enableTempParent(),this.updateTransform(),this.disableTempParent(null)),this.containsPoint=d.containsPoint.bind(d)}},Tt.prototype._renderCachedCanvas=function(e){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(e),this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._renderCanvas(e))},Tt.prototype._initCachedDisplayObjectCanvas=function(e){if(!(this._cacheData&&this._cacheData.sprite)){var t=this.getLocalBounds(null,!0),i=this.alpha;this.alpha=1;var n=e.context,s=e._projTransform;t.ceil(L.RESOLUTION);var a=bi.create({width:t.width,height:t.height}),o="cacheAsBitmap_"+yi();this._cacheData.textureCacheId=o,Q.addToCache(a.baseTexture,o),W.addToCache(a,o);var h=Du;this.transform.localTransform.copyTo(h),h.invert(),h.tx-=t.x,h.ty-=t.y,this.renderCanvas=this._cacheData.originalRenderCanvas,e.render(this,{renderTexture:a,clear:!0,transform:h,skipUpdateTransform:!1}),e.context=n,e._projTransform=s,this.renderCanvas=this._renderCachedCanvas,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null,this.alpha=i;var u=new We(a);u.transform.worldTransform=this.transform.worldTransform,u.anchor.x=-(t.x/t.width),u.anchor.y=-(t.y/t.height),u.alpha=i,u._bounds=this._bounds,this._cacheData.sprite=u,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=e._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=u.containsPoint.bind(u)}},Tt.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._bounds.updateID=this._boundsID},Tt.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds(null)},Tt.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,Q.removeFromCache(this._cacheData.textureCacheId),W.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null},Tt.prototype._cacheAsBitmapDestroy=function(e){this.cacheAsBitmap=!1,this.destroy(e)};Tt.prototype.name=null,yt.prototype.getChildByName=function(e,t){for(var i=0,n=this.children.length;i<n;i++)if(this.children[i].name===e)return this.children[i];if(t)for(var i=0,n=this.children.length;i<n;i++){var s=this.children[i];if(s.getChildByName){var a=s.getChildByName(e,!0);if(a)return a}}return null};Tt.prototype.getGlobalPosition=function(e,t){return e===void 0&&(e=new j),t===void 0&&(t=!1),this.parent?this.parent.toGlobal(this.position,e,t):(e.x=this.position.x,e.y=this.position.y),e};var Oy=function(){function r(){}return r.init=function(e){var t=this;Object.defineProperty(this,"resizeTo",{set:function(i){globalThis.removeEventListener("resize",this.queueResize),this._resizeTo=i,i&&(globalThis.addEventListener("resize",this.queueResize),this.resize())},get:function(){return this._resizeTo}}),this.queueResize=function(){t._resizeTo&&(t.cancelResize(),t._resizeId=requestAnimationFrame(function(){return t.resize()}))},this.cancelResize=function(){t._resizeId&&(cancelAnimationFrame(t._resizeId),t._resizeId=null)},this.resize=function(){if(t._resizeTo){t.cancelResize();var i,n;if(t._resizeTo===globalThis.window)i=globalThis.innerWidth,n=globalThis.innerHeight;else{var s=t._resizeTo,a=s.clientWidth,o=s.clientHeight;i=a,n=o}t.renderer.resize(i,n)}},this._resizeId=null,this._resizeTo=null,this.resizeTo=e.resizeTo||null},r.destroy=function(){globalThis.removeEventListener("resize",this.queueResize),this.cancelResize(),this.cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null},r.extension=nt.Application,r}(),Fu=function(){function r(e){var t=this;this.stage=new yt,e=Object.assign({forceCanvas:!1},e),this.renderer=nm(e),r._plugins.forEach(function(i){i.init.call(t,e)})}return r.registerPlugin=function(e){ge("6.5.0","Application.registerPlugin() is deprecated, use extensions.add()"),Ue.add({type:nt.Application,ref:e})},r.prototype.render=function(){this.renderer.render(this.stage)},Object.defineProperty(r.prototype,"view",{get:function(){return this.renderer.view},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"screen",{get:function(){return this.renderer.screen},enumerable:!1,configurable:!0}),r.prototype.destroy=function(e,t){var i=this,n=r._plugins.slice(0);n.reverse(),n.forEach(function(s){s.destroy.call(i)}),this.stage.destroy(t),this.stage=null,this.renderer.destroy(e),this.renderer=null},r._plugins=[],r}();Ue.handleByList(nt.Application,Fu._plugins),Ue.add(Oy);var Da=function(r,e){return Da=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},Da(r,e)};function qi(r,e){Da(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Ay=function(r){qi(e,r);function e(t,i,n,s){t===void 0&&(t=100),i===void 0&&(i=100),n===void 0&&(n=10),s===void 0&&(s=10);var a=r.call(this)||this;return a.segWidth=n,a.segHeight=s,a.width=t,a.height=i,a.build(),a}return e.prototype.build=function(){for(var t=this.segWidth*this.segHeight,i=[],n=[],s=[],a=this.segWidth-1,o=this.segHeight-1,h=this.width/a,u=this.height/o,l=0;l<t;l++){var f=l%this.segWidth,c=l/this.segWidth|0;i.push(f*h,c*u),n.push(f/a,c/o)}for(var d=a*o,l=0;l<d;l++){var v=l%a,p=l/a|0,_=p*this.segWidth+v,m=p*this.segWidth+v+1,g=(p+1)*this.segWidth+v,y=(p+1)*this.segWidth+v+1;s.push(_,m,g,m,y,g)}this.buffers[0].data=new Float32Array(i),this.buffers[1].data=new Float32Array(n),this.indexBuffer.data=new Uint16Array(s),this.buffers[0].update(),this.buffers[1].update(),this.indexBuffer.update()},e}(Bn),Iy=function(r){qi(e,r);function e(t,i,n){t===void 0&&(t=200),n===void 0&&(n=0);var s=r.call(this,new Float32Array(i.length*4),new Float32Array(i.length*4),new Uint16Array((i.length-1)*6))||this;return s.points=i,s._width=t,s.textureScale=n,s.build(),s}return Object.defineProperty(e.prototype,"width",{get:function(){return this._width},enumerable:!1,configurable:!0}),e.prototype.build=function(){var t=this.points;if(t){var i=this.getBuffer("aVertexPosition"),n=this.getBuffer("aTextureCoord"),s=this.getIndex();if(!(t.length<1)){i.data.length/4!==t.length&&(i.data=new Float32Array(t.length*4),n.data=new Float32Array(t.length*4),s.data=new Uint16Array((t.length-1)*6));var a=n.data,o=s.data;a[0]=0,a[1]=0,a[2]=0,a[3]=1;for(var h=0,u=t[0],l=this._width*this.textureScale,f=t.length,c=0;c<f;c++){var d=c*4;if(this.textureScale>0){var v=u.x-t[c].x,p=u.y-t[c].y,_=Math.sqrt(v*v+p*p);u=t[c],h+=_/l}else h=c/(f-1);a[d]=h,a[d+1]=0,a[d+2]=h,a[d+3]=1}for(var m=0,c=0;c<f-1;c++){var d=c*2;o[m++]=d,o[m++]=d+1,o[m++]=d+2,o[m++]=d+2,o[m++]=d+1,o[m++]=d+3}n.update(),s.update(),this.updateVertices()}}},e.prototype.updateVertices=function(){var t=this.points;if(!(t.length<1)){for(var i=t[0],n,s=0,a=0,o=this.buffers[0].data,h=t.length,u=0;u<h;u++){var l=t[u],f=u*4;u<t.length-1?n=t[u+1]:n=l,a=-(n.x-i.x),s=n.y-i.y;var c=Math.sqrt(s*s+a*a),d=this.textureScale>0?this.textureScale*this._width/2:this._width/2;s/=c,a/=c,s*=d,a*=d,o[f]=l.x+s,o[f+1]=l.y+a,o[f+2]=l.x-s,o[f+3]=l.y-a,i=l}this.buffers[0].update()}},e.prototype.update=function(){this.textureScale>0?this.build():this.updateVertices()},e}(Bn);(function(r){qi(e,r);function e(t,i,n){n===void 0&&(n=0);var s=this,a=new Iy(t.height,i,n),o=new Nr(t);return n>0&&(t.baseTexture.wrapMode=Re.REPEAT),s=r.call(this,a,o)||this,s.autoUpdate=!0,s}return e.prototype._render=function(t){var i=this.geometry;(this.autoUpdate||i._width!==this.shader.texture.height)&&(i._width=this.shader.texture.height,i.update()),r.prototype._render.call(this,t)},e})(Fr);var My=function(r){qi(e,r);function e(t,i,n){var s=this,a=new Ay(t.width,t.height,i,n),o=new Nr(W.WHITE);return s=r.call(this,a,o)||this,s.texture=t,s.autoResize=!0,s}return e.prototype.textureUpdated=function(){this._textureID=this.shader.texture._updateID;var t=this.geometry,i=this.shader.texture,n=i.width,s=i.height;this.autoResize&&(t.width!==n||t.height!==s)&&(t.width=this.shader.texture.width,t.height=this.shader.texture.height,t.build())},Object.defineProperty(e.prototype,"texture",{get:function(){return this.shader.texture},set:function(t){this.shader.texture!==t&&(this.shader.texture=t,this._textureID=-1,t.baseTexture.valid?this.textureUpdated():t.once("update",this.textureUpdated,this))},enumerable:!1,configurable:!0}),e.prototype._render=function(t){this._textureID!==this.shader.texture._updateID&&this.textureUpdated(),r.prototype._render.call(this,t)},e.prototype.destroy=function(t){this.shader.texture.off("update",this.textureUpdated,this),r.prototype.destroy.call(this,t)},e}(Fr);(function(r){qi(e,r);function e(t,i,n,s,a){t===void 0&&(t=W.EMPTY);var o=this,h=new Bn(i,n,s);h.getBuffer("aVertexPosition").static=!1;var u=new Nr(t);return o=r.call(this,h,u,null,a)||this,o.autoUpdate=!0,o}return Object.defineProperty(e.prototype,"vertices",{get:function(){return this.geometry.getBuffer("aVertexPosition").data},set:function(t){this.geometry.getBuffer("aVertexPosition").data=t},enumerable:!1,configurable:!0}),e.prototype._render=function(t){this.autoUpdate&&this.geometry.getBuffer("aVertexPosition").update(),r.prototype._render.call(this,t)},e})(Fr);var Xn=10;(function(r){qi(e,r);function e(t,i,n,s,a){i===void 0&&(i=Xn),n===void 0&&(n=Xn),s===void 0&&(s=Xn),a===void 0&&(a=Xn);var o=r.call(this,W.WHITE,4,4)||this;return o._origWidth=t.orig.width,o._origHeight=t.orig.height,o._width=o._origWidth,o._height=o._origHeight,o._leftWidth=i,o._rightWidth=s,o._topHeight=n,o._bottomHeight=a,o.texture=t,o}return e.prototype.textureUpdated=function(){this._textureID=this.shader.texture._updateID,this._refresh()},Object.defineProperty(e.prototype,"vertices",{get:function(){return this.geometry.getBuffer("aVertexPosition").data},set:function(t){this.geometry.getBuffer("aVertexPosition").data=t},enumerable:!1,configurable:!0}),e.prototype.updateHorizontalVertices=function(){var t=this.vertices,i=this._getMinScale();t[9]=t[11]=t[13]=t[15]=this._topHeight*i,t[17]=t[19]=t[21]=t[23]=this._height-this._bottomHeight*i,t[25]=t[27]=t[29]=t[31]=this._height},e.prototype.updateVerticalVertices=function(){var t=this.vertices,i=this._getMinScale();t[2]=t[10]=t[18]=t[26]=this._leftWidth*i,t[4]=t[12]=t[20]=t[28]=this._width-this._rightWidth*i,t[6]=t[14]=t[22]=t[30]=this._width},e.prototype._getMinScale=function(){var t=this._leftWidth+this._rightWidth,i=this._width>t?1:this._width/t,n=this._topHeight+this._bottomHeight,s=this._height>n?1:this._height/n,a=Math.min(i,s);return a},Object.defineProperty(e.prototype,"width",{get:function(){return this._width},set:function(t){this._width=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._height},set:function(t){this._height=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"leftWidth",{get:function(){return this._leftWidth},set:function(t){this._leftWidth=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rightWidth",{get:function(){return this._rightWidth},set:function(t){this._rightWidth=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"topHeight",{get:function(){return this._topHeight},set:function(t){this._topHeight=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bottomHeight",{get:function(){return this._bottomHeight},set:function(t){this._bottomHeight=t,this._refresh()},enumerable:!1,configurable:!0}),e.prototype._refresh=function(){var t=this.texture,i=this.geometry.buffers[1].data;this._origWidth=t.orig.width,this._origHeight=t.orig.height;var n=1/this._origWidth,s=1/this._origHeight;i[0]=i[8]=i[16]=i[24]=0,i[1]=i[3]=i[5]=i[7]=0,i[6]=i[14]=i[22]=i[30]=1,i[25]=i[27]=i[29]=i[31]=1,i[2]=i[10]=i[18]=i[26]=n*this._leftWidth,i[4]=i[12]=i[20]=i[28]=1-n*this._rightWidth,i[9]=i[11]=i[13]=i[15]=s*this._topHeight,i[17]=i[19]=i[21]=i[23]=1-s*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.geometry.buffers[0].update(),this.geometry.buffers[1].update()},e})(My);var Fa=function(r,e){return Fa=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},Fa(r,e)};function Dy(r,e){Fa(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}(function(r){Dy(e,r);function e(t,i){i===void 0&&(i=!0);var n=r.call(this,t[0]instanceof W?t[0]:t[0].texture)||this;return n._textures=null,n._durations=null,n._autoUpdate=i,n._isConnectedToTicker=!1,n.animationSpeed=1,n.loop=!0,n.updateAnchor=!1,n.onComplete=null,n.onFrameChange=null,n.onLoop=null,n._currentTime=0,n._playing=!1,n._previousFrame=null,n.textures=t,n}return e.prototype.stop=function(){this._playing&&(this._playing=!1,this._autoUpdate&&this._isConnectedToTicker&&(Ft.shared.remove(this.update,this),this._isConnectedToTicker=!1))},e.prototype.play=function(){this._playing||(this._playing=!0,this._autoUpdate&&!this._isConnectedToTicker&&(Ft.shared.add(this.update,this,re.HIGH),this._isConnectedToTicker=!0))},e.prototype.gotoAndStop=function(t){this.stop();var i=this.currentFrame;this._currentTime=t,i!==this.currentFrame&&this.updateTexture()},e.prototype.gotoAndPlay=function(t){var i=this.currentFrame;this._currentTime=t,i!==this.currentFrame&&this.updateTexture(),this.play()},e.prototype.update=function(t){if(this._playing){var i=this.animationSpeed*t,n=this.currentFrame;if(this._durations!==null){var s=this._currentTime%1*this._durations[this.currentFrame];for(s+=i/60*1e3;s<0;)this._currentTime--,s+=this._durations[this.currentFrame];var a=Math.sign(this.animationSpeed*t);for(this._currentTime=Math.floor(this._currentTime);s>=this._durations[this.currentFrame];)s-=this._durations[this.currentFrame]*a,this._currentTime+=a;this._currentTime+=s/this._durations[this.currentFrame]}else this._currentTime+=i;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):n!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFrame<n?this.onLoop():this.animationSpeed<0&&this.currentFrame>n&&this.onLoop()),this.updateTexture())}},e.prototype.updateTexture=function(){var t=this.currentFrame;this._previousFrame!==t&&(this._previousFrame=t,this._texture=this._textures[t],this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this.uvs=this._texture._uvs.uvsFloat32,this.updateAnchor&&this._anchor.copyFrom(this._texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame))},e.prototype.destroy=function(t){this.stop(),r.prototype.destroy.call(this,t),this.onComplete=null,this.onFrameChange=null,this.onLoop=null},e.fromFrames=function(t){for(var i=[],n=0;n<t.length;++n)i.push(W.from(t[n]));return new e(i)},e.fromImages=function(t){for(var i=[],n=0;n<t.length;++n)i.push(W.from(t[n]));return new e(i)},Object.defineProperty(e.prototype,"totalFrames",{get:function(){return this._textures.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"textures",{get:function(){return this._textures},set:function(t){if(t[0]instanceof W)this._textures=t,this._durations=null;else{this._textures=[],this._durations=[];for(var i=0;i<t.length;i++)this._textures.push(t[i].texture),this._durations.push(t[i].time)}this._previousFrame=null,this.gotoAndStop(0),this.updateTexture()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentFrame",{get:function(){var t=Math.floor(this._currentTime)%this._textures.length;return t<0&&(t+=this._textures.length),t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"playing",{get:function(){return this._playing},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"autoUpdate",{get:function(){return this._autoUpdate},set:function(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isConnectedToTicker?(Ft.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._playing&&(Ft.shared.add(this.update,this),this._isConnectedToTicker=!0))},enumerable:!1,configurable:!0}),e})(We);Ue.add(gm,Em,wm,_g,Vg,jh,Jg,ly,Xm,cg,dg,jg,Lv,Mm);let Ki="sans-serif",Hn=null;const ii=new ei,Nu={chars:wt.ASCII},Ci=new ei;async function Lu(r){const e=new Xf(r.textFontFamilyDefault);try{await e.load()}catch(t){return console.error(t),console.warn(`loadBitmapFonts: font ${r.textFontFamilyDefault} failed to load, falling back to ${Ki}`),Gu(Ki,r)}return Ki=r.textFontFamilyDefault,Gu(Ki,r)}function Bu(r){ii.fontFamily=Ki,ii.fontSize=r.textSizeDefault,ii.lineHeight=r.textLineHeightDefault,Ci.fontFamily=Ki,Ci.fontSize=r.textSizeSmall,Ci.lineHeight=r.textLineHeightSmall}function Gu(r,e){Bu(e);const t={resolution:window.devicePixelRatio||2,...Nu};wt.from("NodeTextDefault",{...ii,fill:e.colorTextDefault},t);const i={fontName:"NodeTextDefault",fontSize:e.textSizeDefault};wt.from("NodeTextInverse",{...ii,fill:e.colorTextInverse},t);const n={fontName:"NodeTextInverse",fontSize:e.textSizeDefault};wt.from("TimeMarkerLabel",{...Ci,fill:e.colorTextSubdued},t);const s={fontName:"TimeMarkerLabel",fontSize:e.textSizeSmall};wt.from("PlayheadTimerLabel",{...Ci,fill:e.colorPlayheadBg},t);const a={fontName:"PlayheadTimerLabel",fontSize:e.textSizeSmall};return{nodeTextDefault:i,nodeTextInverse:n,nodeTextStyles:ii,timeMarkerLabel:s,playheadTimerLabel:a}}function Fy(r){Bu(r);const e={resolution:window.devicePixelRatio||2,...Nu};setTimeout(()=>{wt.uninstall("NodeTextDefault"),wt.from("NodeTextDefault",{...ii,fill:r.colorTextDefault},e),wt.uninstall("NodeTextInverse"),wt.from("NodeTextInverse",{...ii,fill:r.colorTextInverse},e),wt.uninstall("TimeMarkerLabel"),wt.from("TimeMarkerLabel",{...Ci,fill:r.colorTextSubdued},e),wt.uninstall("PlayheadTimerLabel"),wt.from("PlayheadTimerLabel",{...Ci,fill:r.colorPlayheadBg},e)},0)}const Wn=r=>(Hn||(Hn=Lu(r)),Hn),Ny=r=>{Hn=Lu(r)};class Ly extends yt{constructor(t,i){super();B(this,"appRef");B(this,"viewportRef");B(this,"layer",new ne);this.appRef=t,this.viewportRef=i,this.drawLayer(),this.initUpdater(),this.interactive=!0}drawLayer(){const{xPos:t,yPos:i,width:n,height:s}=this.getDimensions();this.layer.beginFill(16777215,1),this.layer.drawRect(t,i,n,s),this.layer.endFill(),this.layer.alpha=0,this.addChild(this.layer)}getDimensions(){return{xPos:this.viewportRef.left,yPos:this.viewportRef.top,width:this.viewportRef.right-this.viewportRef.left,height:this.viewportRef.bottom-this.viewportRef.top}}initUpdater(){this.appRef.ticker.add(()=>{this.update()},null,re.LOW)}update(){const{xPos:t,yPos:i,width:n,height:s}=this.getDimensions();this.x=t,this.y=i,this.width=n,this.height=s}}function By(r){Uc();const e=new Fu({backgroundAlpha:0,width:r.clientWidth,height:r.clientHeight,resolution:window.devicePixelRatio||2,autoDensity:!0,antialias:!0,resizeTo:r});return r.appendChild(e.view),e.ticker.add(()=>{(r.clientWidth!==e.screen.width||r.clientHeight!==e.screen.height)&&(e.resizeTo=r)},null,re.LOW),e}async function Gy(){const{Viewport:r}=await Promise.resolve().then(()=>Mx);return r}async function Uy(r,e){const t=await Gy(),{width:i,height:n}=e.screen,s=new t({screenWidth:i,screenHeight:n,passiveWheel:!1,interaction:e.renderer.plugins.interaction,divWheel:r,ticker:e.ticker});return s.drag({wheel:!1,pressDrag:!0}).wheel({trackpadPinch:!0,wheelZoom:!0}).pinch().clampZoom({minWidth:i/2,maxWidth:i*40}).decelerate({friction:.9}),e.stage.addChild(s),e.ticker.add(()=>{(s.screenWidth!==e.screen.width||s.screenHeight!==e.screen.height)&&s.resize(e.screen.width,e.screen.height)},null,re.LOW),s}let Te,we;const Uu={multisample:2,resolution:4};function ku(){Te=new Map,we=new Map}function ky(){Te&&(Te.forEach(({cap:r,body:e})=>{r.destroy(),e.destroy()}),Te.clear(),Te=void 0),we&&(we.forEach(r=>{r.destroy()}),we.clear(),we=void 0)}function Xy({appRef:r,fill:e,borderRadius:t,boxCapWidth:i,height:n}){if(Te||ku(),!(Te!=null&&Te.has(e))){const s=new ne;s.beginFill(e),s.moveTo(i,0),s.lineTo(i,n),s.lineTo(0+t,n),s.bezierCurveTo(0,n,0,n-t,0,n-t),s.lineTo(0,t),s.bezierCurveTo(0,0,t,0,t,0),s.lineTo(i,0),s.endFill();const a=new ne;a.beginFill(e),a.drawRect(0,0,1,n),a.endFill();const o=r.renderer.generateTexture(s,Uu),h=r.renderer.generateTexture(a);Te.set(e,{cap:o,body:h})}return Te.get(e)}function Hy({appRef:r,strokeColor:e,edgeWidth:t,edgeLength:i}){if(we||ku(),!(we!=null&&we.has(e))){const n=new ne;n.lineStyle(t,e,1,.5),n.moveTo(-i,-i),n.lineTo(0,0),n.lineTo(-i,i);const s=r.renderer.generateTexture(n,Uu);we.set(e,s)}return we.get(e)}const Xu=64;class Wy extends yt{constructor({appRef:t,styles:i,sourceNode:n,targetNode:s}){super();B(this,"appRef");B(this,"styles");B(this,"sourceNode");B(this,"targetNode");B(this,"sourceX",0);B(this,"sourceY",0);B(this,"targetX",0);B(this,"targetY",0);B(this,"edge",new ne);B(this,"arrow",new yt);B(this,"unwatch");B(this,"getXBezier",(t,i)=>{const{sourceX:n,targetX:s}=this,a=(s-n)/2;return t+(a>Xu?a:Xu)*(i?-1:1)});this.appRef=t,this.styles=i,this.sourceNode=n,this.targetNode=s,this.assignStartAndEndPositions(),this.drawEdge(),this.addChild(this.edge),this.drawArrow(),this.addChild(this.arrow),this.unwatch=J.watch([i],()=>{this.update(!0)},{deep:!0})}assignStartAndEndPositions(){this.sourceX=this.sourceNode.x+this.sourceNode.getChildByName(ss).getLocalBounds().width,this.sourceY=this.sourceNode.y+this.sourceNode.getChildByName(ss).getLocalBounds().height/2,this.targetX=this.targetNode.x,this.targetY=this.targetNode.y+this.targetNode.getChildByName(ss).getLocalBounds().height/2}drawEdge(){const{colorEdge:t,spacingEdgeWidth:i}=this.styles.value,{edge:n,sourceX:s,sourceY:a,targetX:o,targetY:h}=this,u=this.getXBezier(s),l=this.getXBezier(o,!0);n.clear(),n.lineStyle(i,t,1,.5),n.moveTo(s,a),n.bezierCurveTo(u,a,l,h,o-i,h)}drawArrow(t){const{arrow:i,targetX:n,targetY:s}=this;t&&i.removeChildren(),i.children.length>0&&i.position.set(n,s);const{colorEdge:a,spacingEdgeWidth:o,spacingNodeEdgeLength:h}=this.styles.value,u=Hy({appRef:this.appRef,strokeColor:a,edgeWidth:o,edgeLength:h}),l=new We(u);l.anchor.set(1,.5),i.addChild(l),i.position.set(n,s)}update(t){this.assignStartAndEndPositions(),this.drawEdge(),this.drawArrow(t)}destroy(){this.unwatch(),super.destroy.call(this)}}class zy extends yt{constructor({labelText:t,styles:i,appHeight:n}){super();B(this,"labelText");B(this,"styles");B(this,"appHeight");B(this,"guideLine",new ne);B(this,"label");this.labelText=t,this.styles=i,this.appHeight=n,this.drawGuideLine(),this.addChild(this.guideLine),this.drawLabel(),this.interactive=!1}drawGuideLine(){const{colorGuideLine:t}=this.styles.value;this.guideLine.clear(),this.guideLine.beginFill(t),this.guideLine.drawRect(0,0,1,this.appHeight),this.guideLine.endFill()}async drawLabel(){var t;if(this.labelText){const i=await Wn(this.styles.value),{spacingGuideLabelPadding:n}=this.styles.value;(t=this.label)==null||t.destroy(),this.label=new kn(this.labelText,i.timeMarkerLabel),this.label.position.set(n,n),this.addChild(this.label)}}updateHeight(t){this.appHeight=t,this.drawGuideLine()}}let ae;const Vy=({minimumStartTime:r,overallGraphWidth:e,initialOverallTimeSpan:t})=>({dateToX:jy(r,e,t),xToDate:Zy(r,e,t)}),Yy=({minimumStartTime:r,overallGraphWidth:e,initialOverallTimeSpan:t})=>(ae=Vy({minimumStartTime:r,overallGraphWidth:e,initialOverallTimeSpan:t}),ae);function jy(r,e,t){return function(i){return Math.ceil((i.getTime()-r)*(e/t))}}function Zy(r,e,t){return function(i){return Math.ceil(r+i*(t/e))}}const qy=260,Na=4e3;class Ky extends yt{constructor({viewportRef:t,appRef:i,minimumStartDate:n,maximumEndDate:s,isRunning:a,styles:o,formatDateFns:h}){super();B(this,"viewportRef");B(this,"appRef");B(this,"minimumStartDate");B(this,"maximumEndDate");B(this,"isRunning");B(this,"styles");B(this,"formatDateFns");B(this,"unwatch");B(this,"idealGuideCount",10);B(this,"currentTimeGap",120);B(this,"labelFormatter",t=>t.toLocaleTimeString());B(this,"guides",new Map);this.viewportRef=t,this.appRef=i,this.minimumStartDate=n,this.maximumEndDate=s,this.isRunning=a,this.styles=o,this.formatDateFns=h,this.updateIdealGuideCount(),this.updateCurrentTimeGap(),this.createGuides(),this.unwatch=J.watch(o,()=>{this.removeChildren(),this.guides.clear(),this.createGuides()},{deep:!0}),this.interactive=!1}updateGuides(){const t=this.currentTimeGap;this.updateCurrentTimeGap(),this.isRedrawRequired(t)?(this.guides.size>0&&(this.removeChildren(),this.guides.clear()),this.createGuides()):this.updateGuidePositions()}updateIdealGuideCount(){this.idealGuideCount=Math.ceil(this.appRef.screen.width/qy)}updateCurrentTimeGap(){const t=Math.ceil((this.viewportRef.right-this.viewportRef.left)/this.idealGuideCount),i=ae.xToDate(t)-this.minimumStartDate.getTime(),n=Co.find(s=>s.ceiling>i)??Co[0];this.currentTimeGap=n.span,this.setLabelFormatter(n.labelFormat)}createGuides(){let t;const i=ae.xToDate(ae.dateToX(this.maximumEndDate.value??new Date)+Na);let n=new Date(Math.ceil(ae.xToDate(-Na)/this.currentTimeGap)*this.currentTimeGap);for(this.currentTimeGap>q.hour*6?n=Nf(n):this.currentTimeGap>q.hour&&(n=Lf(n)),t=n;t.getTime()<i;){const s=new zy({labelText:this.labelFormatter(t),styles:this.styles,appHeight:this.appRef.screen.height});s.position.set(this.getGuidePosition(t),0),this.guides.set(t,s),this.addChild(s),t=new Date(t.getTime()+this.currentTimeGap)}}getGuidePosition(t){return ae.dateToX(t)*this.viewportRef.scale._x+this.viewportRef.worldTransform.tx}updateGuidePositions(){this.guides.forEach((t,i)=>{this.getGuidePosition(i)!==t.position.x&&t.position.set(this.getGuidePosition(i),0),t.height!==this.appRef.screen.height&&t.updateHeight(this.appRef.screen.height)})}setLabelFormatter(t){switch(t){case Ot.minutes:this.labelFormatter=this.formatByMinutesWithDates;break;case Ot.date:this.labelFormatter=this.formatDateFns.value.date;break;default:this.labelFormatter=this.formatDateFns.value.timeBySeconds}}formatByMinutesWithDates(t){return t.getHours()===0&&t.getMinutes()===0?`${this.formatDateFns.value.date(t)}
1061
- ${this.formatDateFns.value.timeByMinutes(t)}`:this.formatDateFns.value.timeByMinutes(t)}isRedrawRequired(t){return t!==this.currentTimeGap||this.noGuidesExist()||this.isGuideLengthOutdated()}noGuidesExist(){return this.guides.size===0}isGuideLengthOutdated(){var n;if(!this.isRunning)return!1;const t=(n=Array.from(this.guides).pop())==null?void 0:n[1];if(!t||!this.maximumEndDate.value)return!1;const i=this.getGuidePosition(this.maximumEndDate.value)+Na*this.viewportRef.scale._x-ae.dateToX(new Date(this.minimumStartDate.getTime()+this.currentTimeGap))*this.viewportRef.scale._x;return t.x<i}destroy(){this.removeChildren(),this.guides.forEach(t=>t.destroy()),this.guides.clear(),this.unwatch(),super.destroy.call(this)}}function ze(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function Hu(r,e){r.prototype=Object.create(e.prototype),r.prototype.constructor=r,r.__proto__=e}var $t={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},$i={duration:.5,overwrite:!1,delay:0},La,kt,Rt,oe=1e8,at=1/oe,Ba=Math.PI*2,$y=Ba/4,Jy=0,Wu=Math.sqrt,Qy=Math.cos,t0=Math.sin,Nt=function(e){return typeof e=="string"},bt=function(e){return typeof e=="function"},Ve=function(e){return typeof e=="number"},Ga=function(e){return typeof e>"u"},Ie=function(e){return typeof e=="object"},Vt=function(e){return e!==!1},zu=function(){return typeof window<"u"},zn=function(e){return bt(e)||Nt(e)},Vu=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},Xt=Array.isArray,Ua=/(?:-?\.?\d|\.)+/gi,Yu=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,Ji=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,ka=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,ju=/[+-]=-?[.\d]+/,Zu=/[^,'"\[\]\s]+/gi,e0=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,vt,he,Xa,Ha,Jt={},Vn={},qu,Ku=function(e){return(Vn=Ai(e,Jt))&&ee},Wa=function(e,t){return console.warn("Invalid property",e,"set to",t,"Missing plugin? gsap.registerPlugin()")},Yn=function(e,t){return!t&&console.warn(e)},$u=function(e,t){return e&&(Jt[e]=t)&&Vn&&(Vn[e]=t)||Jt},Lr=function(){return 0},i0={suppressEvents:!0,isStart:!0,kill:!1},jn={suppressEvents:!0,kill:!1},r0={suppressEvents:!0},za={},ri=[],Va={},Ju,Qt={},Ya={},Qu=30,Zn=[],ja="",Za=function(e){var t=e[0],i,n;if(Ie(t)||bt(t)||(e=[e]),!(i=(t._gsap||{}).harness)){for(n=Zn.length;n--&&!Zn[n].targetTest(t););i=Zn[n]}for(n=e.length;n--;)e[n]&&(e[n]._gsap||(e[n]._gsap=new Pl(e[n],i)))||e.splice(n,1);return e},Oi=function(e){return e._gsap||Za(fe(e))[0]._gsap},tl=function(e,t,i){return(i=e[t])&&bt(i)?e[t]():Ga(i)&&e.getAttribute&&e.getAttribute(t)||i},Yt=function(e,t){return(e=e.split(",")).forEach(t)||e},Et=function(e){return Math.round(e*1e5)/1e5||0},Gt=function(e){return Math.round(e*1e7)/1e7||0},Qi=function(e,t){var i=t.charAt(0),n=parseFloat(t.substr(2));return e=parseFloat(e),i==="+"?e+n:i==="-"?e-n:i==="*"?e*n:e/n},n0=function(e,t){for(var i=t.length,n=0;e.indexOf(t[n])<0&&++n<i;);return n<i},qn=function(){var e=ri.length,t=ri.slice(0),i,n;for(Va={},ri.length=0,i=0;i<e;i++)n=t[i],n&&n._lazy&&(n.render(n._lazy[0],n._lazy[1],!0)._lazy=0)},el=function(e,t,i,n){ri.length&&!kt&&qn(),e.render(t,i,n||kt&&t<0&&(e._initted||e._startAt)),ri.length&&!kt&&qn()},il=function(e){var t=parseFloat(e);return(t||t===0)&&(e+"").match(Zu).length<2?t:Nt(e)?e.trim():e},rl=function(e){return e},ue=function(e,t){for(var i in t)i in e||(e[i]=t[i]);return e},s0=function(e){return function(t,i){for(var n in i)n in t||n==="duration"&&e||n==="ease"||(t[n]=i[n])}},Ai=function(e,t){for(var i in t)e[i]=t[i];return e},nl=function r(e,t){for(var i in t)i!=="__proto__"&&i!=="constructor"&&i!=="prototype"&&(e[i]=Ie(t[i])?r(e[i]||(e[i]={}),t[i]):t[i]);return e},Kn=function(e,t){var i={},n;for(n in e)n in t||(i[n]=e[n]);return i},Br=function(e){var t=e.parent||vt,i=e.keyframes?s0(Xt(e.keyframes)):ue;if(Vt(e.inherit))for(;t;)i(e,t.vars.defaults),t=t.parent||t._dp;return e},a0=function(e,t){for(var i=e.length,n=i===t.length;n&&i--&&e[i]===t[i];);return i<0},sl=function(e,t,i,n,s){i===void 0&&(i="_first"),n===void 0&&(n="_last");var a=e[n],o;if(s)for(o=t[s];a&&a[s]>o;)a=a._prev;return a?(t._next=a._next,a._next=t):(t._next=e[i],e[i]=t),t._next?t._next._prev=t:e[n]=t,t._prev=a,t.parent=t._dp=e,t},$n=function(e,t,i,n){i===void 0&&(i="_first"),n===void 0&&(n="_last");var s=t._prev,a=t._next;s?s._next=a:e[i]===t&&(e[i]=a),a?a._prev=s:e[n]===t&&(e[n]=s),t._next=t._prev=t.parent=null},ni=function(e,t){e.parent&&(!t||e.parent.autoRemoveChildren)&&e.parent.remove(e),e._act=0},Ii=function(e,t){if(e&&(!t||t._end>e._dur||t._start<0))for(var i=e;i;)i._dirty=1,i=i.parent;return e},o0=function(e){for(var t=e.parent;t&&t.parent;)t._dirty=1,t.totalDuration(),t=t.parent;return e},qa=function(e,t,i,n){return e._startAt&&(kt?e._startAt.revert(jn):e.vars.immediateRender&&!e.vars.autoRevert||e._startAt.render(t,!0,n))},h0=function r(e){return!e||e._ts&&r(e.parent)},al=function(e){return e._repeat?tr(e._tTime,e=e.duration()+e._rDelay)*e:0},tr=function(e,t){var i=Math.floor(e/=t);return e&&i===e?i-1:i},Jn=function(e,t){return(e-t._start)*t._ts+(t._ts>=0?0:t._dirty?t.totalDuration():t._tDur)},Qn=function(e){return e._end=Gt(e._start+(e._tDur/Math.abs(e._ts||e._rts||at)||0))},ts=function(e,t){var i=e._dp;return i&&i.smoothChildTiming&&e._ts&&(e._start=Gt(i._time-(e._ts>0?t/e._ts:((e._dirty?e.totalDuration():e._tDur)-t)/-e._ts)),Qn(e),i._dirty||Ii(i,e)),e},ol=function(e,t){var i;if((t._time||t._initted&&!t._dur)&&(i=Jn(e.rawTime(),t),(!t._dur||Ur(0,t.totalDuration(),i)-t._tTime>at)&&t.render(i,!0)),Ii(e,t)._dp&&e._initted&&e._time>=e._dur&&e._ts){if(e._dur<e.duration())for(i=e;i._dp;)i.rawTime()>=0&&i.totalTime(i._tTime),i=i._dp;e._zTime=-at}},Me=function(e,t,i,n){return t.parent&&ni(t),t._start=Gt((Ve(i)?i:i||e!==vt?le(e,i,t):e._time)+t._delay),t._end=Gt(t._start+(t.totalDuration()/Math.abs(t.timeScale())||0)),sl(e,t,"_first","_last",e._sort?"_start":0),Ka(t)||(e._recent=t),n||ol(e,t),e._ts<0&&ts(e,e._tTime),e},hl=function(e,t){return(Jt.ScrollTrigger||Wa("scrollTrigger",t))&&Jt.ScrollTrigger.create(t,e)},ul=function(e,t,i,n,s){if(so(e,t,s),!e._initted)return 1;if(!i&&e._pt&&!kt&&(e._dur&&e.vars.lazy!==!1||!e._dur&&e.vars.lazy)&&Ju!==te.frame)return ri.push(e),e._lazy=[s,n],1},u0=function r(e){var t=e.parent;return t&&t._ts&&t._initted&&!t._lock&&(t.rawTime()<0||r(t))},Ka=function(e){var t=e.data;return t==="isFromStart"||t==="isStart"},l0=function(e,t,i,n){var s=e.ratio,a=t<0||!t&&(!e._start&&u0(e)&&!(!e._initted&&Ka(e))||(e._ts<0||e._dp._ts<0)&&!Ka(e))?0:1,o=e._rDelay,h=0,u,l,f;if(o&&e._repeat&&(h=Ur(0,e._tDur,t),l=tr(h,o),e._yoyo&&l&1&&(a=1-a),l!==tr(e._tTime,o)&&(s=1-a,e.vars.repeatRefresh&&e._initted&&e.invalidate())),a!==s||kt||n||e._zTime===at||!t&&e._zTime){if(!e._initted&&ul(e,t,n,i,h))return;for(f=e._zTime,e._zTime=t||(i?at:0),i||(i=t&&!f),e.ratio=a,e._from&&(a=1-a),e._time=0,e._tTime=h,u=e._pt;u;)u.r(a,u.d),u=u._next;t<0&&qa(e,t,i,!0),e._onUpdate&&!i&&ce(e,"onUpdate"),h&&e._repeat&&!i&&e.parent&&ce(e,"onRepeat"),(t>=e._tDur||t<0)&&e.ratio===a&&(a&&ni(e,1),!i&&!kt&&(ce(e,a?"onComplete":"onReverseComplete",!0),e._prom&&e._prom()))}else e._zTime||(e._zTime=t)},f0=function(e,t,i){var n;if(i>t)for(n=e._first;n&&n._start<=i;){if(n.data==="isPause"&&n._start>t)return n;n=n._next}else for(n=e._last;n&&n._start>=i;){if(n.data==="isPause"&&n._start<t)return n;n=n._prev}},er=function(e,t,i,n){var s=e._repeat,a=Gt(t)||0,o=e._tTime/e._tDur;return o&&!n&&(e._time*=a/e._dur),e._dur=a,e._tDur=s?s<0?1e10:Gt(a*(s+1)+e._rDelay*s):a,o>0&&!n&&ts(e,e._tTime=e._tDur*o),e.parent&&Qn(e),i||Ii(e.parent,e),e},ll=function(e){return e instanceof jt?Ii(e):er(e,e._dur)},c0={_start:0,endTime:Lr,totalDuration:Lr},le=function r(e,t,i){var n=e.labels,s=e._recent||c0,a=e.duration()>=oe?s.endTime(!1):e._dur,o,h,u;return Nt(t)&&(isNaN(t)||t in n)?(h=t.charAt(0),u=t.substr(-1)==="%",o=t.indexOf("="),h==="<"||h===">"?(o>=0&&(t=t.replace(/=/,"")),(h==="<"?s._start:s.endTime(s._repeat>=0))+(parseFloat(t.substr(1))||0)*(u?(o<0?s:i).totalDuration()/100:1)):o<0?(t in n||(n[t]=a),n[t]):(h=parseFloat(t.charAt(o-1)+t.substr(o+1)),u&&i&&(h=h/100*(Xt(i)?i[0]:i).totalDuration()),o>1?r(e,t.substr(0,o-1),i)+h:a+h)):t==null?a:+t},Gr=function(e,t,i){var n=Ve(t[1]),s=(n?2:1)+(e<2?0:1),a=t[s],o,h;if(n&&(a.duration=t[1]),a.parent=i,e){for(o=a,h=i;h&&!("immediateRender"in o);)o=h.vars.defaults||{},h=Vt(h.vars.inherit)&&h.parent;a.immediateRender=Vt(o.immediateRender),e<2?a.runBackwards=1:a.startAt=t[s-1]}return new It(t[0],a,t[s+1])},si=function(e,t){return e||e===0?t(e):t},Ur=function(e,t,i){return i<e?e:i>t?t:i},Ht=function(e,t){return!Nt(e)||!(t=e0.exec(e))?"":t[1]},d0=function(e,t,i){return si(i,function(n){return Ur(e,t,n)})},$a=[].slice,fl=function(e,t){return e&&Ie(e)&&"length"in e&&(!t&&!e.length||e.length-1 in e&&Ie(e[0]))&&!e.nodeType&&e!==he},p0=function(e,t,i){return i===void 0&&(i=[]),e.forEach(function(n){var s;return Nt(n)&&!t||fl(n,1)?(s=i).push.apply(s,fe(n)):i.push(n)})||i},fe=function(e,t,i){return Rt&&!t&&Rt.selector?Rt.selector(e):Nt(e)&&!i&&(Xa||!rr())?$a.call((t||Ha).querySelectorAll(e),0):Xt(e)?p0(e,i):fl(e)?$a.call(e,0):e?[e]:[]},Ja=function(e){return e=fe(e)[0]||Yn("Invalid scope")||{},function(t){var i=e.current||e.nativeElement||e;return fe(t,i.querySelectorAll?i:i===e?Yn("Invalid scope")||Ha.createElement("div"):e)}},cl=function(e){return e.sort(function(){return .5-Math.random()})},dl=function(e){if(bt(e))return e;var t=Ie(e)?e:{each:e},i=Mi(t.ease),n=t.from||0,s=parseFloat(t.base)||0,a={},o=n>0&&n<1,h=isNaN(n)||o,u=t.axis,l=n,f=n;return Nt(n)?l=f={center:.5,edges:.5,end:1}[n]||0:!o&&h&&(l=n[0],f=n[1]),function(c,d,v){var p=(v||t).length,_=a[p],m,g,y,b,x,T,w,S,E;if(!_){if(E=t.grid==="auto"?0:(t.grid||[1,oe])[1],!E){for(w=-oe;w<(w=v[E++].getBoundingClientRect().left)&&E<p;);E--}for(_=a[p]=[],m=h?Math.min(E,p)*l-.5:n%E,g=E===oe?0:h?p*f/E-.5:n/E|0,w=0,S=oe,T=0;T<p;T++)y=T%E-m,b=g-(T/E|0),_[T]=x=u?Math.abs(u==="y"?b:y):Wu(y*y+b*b),x>w&&(w=x),x<S&&(S=x);n==="random"&&cl(_),_.max=w-S,_.min=S,_.v=p=(parseFloat(t.amount)||parseFloat(t.each)*(E>p?p-1:u?u==="y"?p/E:E:Math.max(E,p/E))||0)*(n==="edges"?-1:1),_.b=p<0?s-p:s,_.u=Ht(t.amount||t.each)||0,i=i&&p<0?wl(i):i}return p=(_[c]-_.min)/_.max||0,Gt(_.b+(i?i(p):p)*_.v)+_.u}},Qa=function(e){var t=Math.pow(10,((e+"").split(".")[1]||"").length);return function(i){var n=Gt(Math.round(parseFloat(i)/e)*e*t);return(n-n%1)/t+(Ve(i)?0:Ht(i))}},pl=function(e,t){var i=Xt(e),n,s;return!i&&Ie(e)&&(n=i=e.radius||oe,e.values?(e=fe(e.values),(s=!Ve(e[0]))&&(n*=n)):e=Qa(e.increment)),si(t,i?bt(e)?function(a){return s=e(a),Math.abs(s-a)<=n?s:a}:function(a){for(var o=parseFloat(s?a.x:a),h=parseFloat(s?a.y:0),u=oe,l=0,f=e.length,c,d;f--;)s?(c=e[f].x-o,d=e[f].y-h,c=c*c+d*d):c=Math.abs(e[f]-o),c<u&&(u=c,l=f);return l=!n||u<=n?e[l]:a,s||l===a||Ve(a)?l:l+Ht(a)}:Qa(e))},vl=function(e,t,i,n){return si(Xt(e)?!t:i===!0?!!(i=0):!n,function(){return Xt(e)?e[~~(Math.random()*e.length)]:(i=i||1e-5)&&(n=i<1?Math.pow(10,(i+"").length-2):1)&&Math.floor(Math.round((e-i/2+Math.random()*(t-e+i*.99))/i)*i*n)/n})},v0=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return function(n){return t.reduce(function(s,a){return a(s)},n)}},_0=function(e,t){return function(i){return e(parseFloat(i))+(t||Ht(i))}},m0=function(e,t,i){return ml(e,t,0,1,i)},_l=function(e,t,i){return si(i,function(n){return e[~~t(n)]})},g0=function r(e,t,i){var n=t-e;return Xt(e)?_l(e,r(0,e.length),t):si(i,function(s){return(n+(s-e)%n)%n+e})},y0=function r(e,t,i){var n=t-e,s=n*2;return Xt(e)?_l(e,r(0,e.length-1),t):si(i,function(a){return a=(s+(a-e)%s)%s||0,e+(a>n?s-a:a)})},kr=function(e){for(var t=0,i="",n,s,a,o;~(n=e.indexOf("random(",t));)a=e.indexOf(")",n),o=e.charAt(n+7)==="[",s=e.substr(n+7,a-n-7).match(o?Zu:Ua),i+=e.substr(t,n-t)+vl(o?s:+s[0],o?0:+s[1],+s[2]||1e-5),t=a+1;return i+e.substr(t,e.length-t)},ml=function(e,t,i,n,s){var a=t-e,o=n-i;return si(s,function(h){return i+((h-e)/a*o||0)})},x0=function r(e,t,i,n){var s=isNaN(e+t)?0:function(d){return(1-d)*e+d*t};if(!s){var a=Nt(e),o={},h,u,l,f,c;if(i===!0&&(n=1)&&(i=null),a)e={p:e},t={p:t};else if(Xt(e)&&!Xt(t)){for(l=[],f=e.length,c=f-2,u=1;u<f;u++)l.push(r(e[u-1],e[u]));f--,s=function(v){v*=f;var p=Math.min(c,~~v);return l[p](v-p)},i=t}else n||(e=Ai(Xt(e)?[]:{},e));if(!l){for(h in t)ro.call(o,e,h,"get",t[h]);s=function(v){return ho(v,o)||(a?e.p:e)}}}return si(i,s)},gl=function(e,t,i){var n=e.labels,s=oe,a,o,h;for(a in n)o=n[a]-t,o<0==!!i&&o&&s>(o=Math.abs(o))&&(h=a,s=o);return h},ce=function(e,t,i){var n=e.vars,s=n[t],a=Rt,o=e._ctx,h,u,l;if(s)return h=n[t+"Params"],u=n.callbackScope||e,i&&ri.length&&qn(),o&&(Rt=o),l=h?s.apply(u,h):s.call(u),Rt=a,l},Xr=function(e){return ni(e),e.scrollTrigger&&e.scrollTrigger.kill(!!kt),e.progress()<1&&ce(e,"onInterrupt"),e},ir,b0=function(e){e=!e.name&&e.default||e;var t=e.name,i=bt(e),n=t&&!i&&e.init?function(){this._props=[]}:e,s={init:Lr,render:ho,add:ro,kill:B0,modifier:L0,rawVars:0},a={targetTest:0,get:0,getSetter:oo,aliases:{},register:0};if(rr(),e!==n){if(Qt[t])return;ue(n,ue(Kn(e,s),a)),Ai(n.prototype,Ai(s,Kn(e,a))),Qt[n.prop=t]=n,e.targetTest&&(Zn.push(n),za[t]=1),t=(t==="css"?"CSS":t.charAt(0).toUpperCase()+t.substr(1))+"Plugin"}$u(t,n),e.register&&e.register(ee,n,Zt)},ot=255,Hr={aqua:[0,ot,ot],lime:[0,ot,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,ot],navy:[0,0,128],white:[ot,ot,ot],olive:[128,128,0],yellow:[ot,ot,0],orange:[ot,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[ot,0,0],pink:[ot,192,203],cyan:[0,ot,ot],transparent:[ot,ot,ot,0]},to=function(e,t,i){return e+=e<0?1:e>1?-1:0,(e*6<1?t+(i-t)*e*6:e<.5?i:e*3<2?t+(i-t)*(2/3-e)*6:t)*ot+.5|0},yl=function(e,t,i){var n=e?Ve(e)?[e>>16,e>>8&ot,e&ot]:0:Hr.black,s,a,o,h,u,l,f,c,d,v;if(!n){if(e.substr(-1)===","&&(e=e.substr(0,e.length-1)),Hr[e])n=Hr[e];else if(e.charAt(0)==="#"){if(e.length<6&&(s=e.charAt(1),a=e.charAt(2),o=e.charAt(3),e="#"+s+s+a+a+o+o+(e.length===5?e.charAt(4)+e.charAt(4):"")),e.length===9)return n=parseInt(e.substr(1,6),16),[n>>16,n>>8&ot,n&ot,parseInt(e.substr(7),16)/255];e=parseInt(e.substr(1),16),n=[e>>16,e>>8&ot,e&ot]}else if(e.substr(0,3)==="hsl"){if(n=v=e.match(Ua),!t)h=+n[0]%360/360,u=+n[1]/100,l=+n[2]/100,a=l<=.5?l*(u+1):l+u-l*u,s=l*2-a,n.length>3&&(n[3]*=1),n[0]=to(h+1/3,s,a),n[1]=to(h,s,a),n[2]=to(h-1/3,s,a);else if(~e.indexOf("="))return n=e.match(Yu),i&&n.length<4&&(n[3]=1),n}else n=e.match(Ua)||Hr.transparent;n=n.map(Number)}return t&&!v&&(s=n[0]/ot,a=n[1]/ot,o=n[2]/ot,f=Math.max(s,a,o),c=Math.min(s,a,o),l=(f+c)/2,f===c?h=u=0:(d=f-c,u=l>.5?d/(2-f-c):d/(f+c),h=f===s?(a-o)/d+(a<o?6:0):f===a?(o-s)/d+2:(s-a)/d+4,h*=60),n[0]=~~(h+.5),n[1]=~~(u*100+.5),n[2]=~~(l*100+.5)),i&&n.length<4&&(n[3]=1),n},xl=function(e){var t=[],i=[],n=-1;return e.split(ai).forEach(function(s){var a=s.match(Ji)||[];t.push.apply(t,a),i.push(n+=a.length+1)}),t.c=i,t},bl=function(e,t,i){var n="",s=(e+n).match(ai),a=t?"hsla(":"rgba(",o=0,h,u,l,f;if(!s)return e;if(s=s.map(function(c){return(c=yl(c,t,1))&&a+(t?c[0]+","+c[1]+"%,"+c[2]+"%,"+c[3]:c.join(","))+")"}),i&&(l=xl(e),h=i.c,h.join(n)!==l.c.join(n)))for(u=e.replace(ai,"1").split(Ji),f=u.length-1;o<f;o++)n+=u[o]+(~h.indexOf(o)?s.shift()||a+"0,0,0,0)":(l.length?l:s.length?s:i).shift());if(!u)for(u=e.split(ai),f=u.length-1;o<f;o++)n+=u[o]+s[o];return n+u[f]},ai=function(){var r="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",e;for(e in Hr)r+="|"+e+"\\b";return new RegExp(r+")","gi")}(),T0=/hsl[a]?\(/,Tl=function(e){var t=e.join(" "),i;if(ai.lastIndex=0,ai.test(t))return i=T0.test(t),e[1]=bl(e[1],i),e[0]=bl(e[0],i,xl(e[1])),!0},Wr,te=function(){var r=Date.now,e=500,t=33,i=r(),n=i,s=1e3/240,a=s,o=[],h,u,l,f,c,d,v=function p(_){var m=r()-n,g=_===!0,y,b,x,T;if(m>e&&(i+=m-t),n+=m,x=n-i,y=x-a,(y>0||g)&&(T=++f.frame,c=x-f.time*1e3,f.time=x=x/1e3,a+=y+(y>=s?4:s-y),b=1),g||(h=u(p)),b)for(d=0;d<o.length;d++)o[d](x,c,T,_)};return f={time:0,frame:0,tick:function(){v(!0)},deltaRatio:function(_){return c/(1e3/(_||60))},wake:function(){qu&&(!Xa&&zu()&&(he=Xa=window,Ha=he.document||{},Jt.gsap=ee,(he.gsapVersions||(he.gsapVersions=[])).push(ee.version),Ku(Vn||he.GreenSockGlobals||!he.gsap&&he||{}),l=he.requestAnimationFrame),h&&f.sleep(),u=l||function(_){return setTimeout(_,a-f.time*1e3+1|0)},Wr=1,v(2))},sleep:function(){(l?he.cancelAnimationFrame:clearTimeout)(h),Wr=0,u=Lr},lagSmoothing:function(_,m){e=_||1/0,t=Math.min(m||33,e)},fps:function(_){s=1e3/(_||240),a=f.time*1e3+s},add:function(_,m,g){var y=m?function(b,x,T,w){_(b,x,T,w),f.remove(y)}:_;return f.remove(_),o[g?"unshift":"push"](y),rr(),y},remove:function(_,m){~(m=o.indexOf(_))&&o.splice(m,1)&&d>=m&&d--},_listeners:o},f}(),rr=function(){return!Wr&&te.wake()},K={},w0=/^[\d.\-M][\d.\-,\s]/,E0=/["']/g,S0=function(e){for(var t={},i=e.substr(1,e.length-3).split(":"),n=i[0],s=1,a=i.length,o,h,u;s<a;s++)h=i[s],o=s!==a-1?h.lastIndexOf(","):h.length,u=h.substr(0,o),t[n]=isNaN(u)?u.replace(E0,"").trim():+u,n=h.substr(o+1).trim();return t},P0=function(e){var t=e.indexOf("(")+1,i=e.indexOf(")"),n=e.indexOf("(",t);return e.substring(t,~n&&n<i?e.indexOf(")",i+1):i)},R0=function(e){var t=(e+"").split("("),i=K[t[0]];return i&&t.length>1&&i.config?i.config.apply(null,~e.indexOf("{")?[S0(t[1])]:P0(e).split(",").map(il)):K._CE&&w0.test(e)?K._CE("",e):i},wl=function(e){return function(t){return 1-e(1-t)}},El=function r(e,t){for(var i=e._first,n;i;)i instanceof jt?r(i,t):i.vars.yoyoEase&&(!i._yoyo||!i._repeat)&&i._yoyo!==t&&(i.timeline?r(i.timeline,t):(n=i._ease,i._ease=i._yEase,i._yEase=n,i._yoyo=t)),i=i._next},Mi=function(e,t){return e&&(bt(e)?e:K[e]||R0(e))||t},Di=function(e,t,i,n){i===void 0&&(i=function(h){return 1-t(1-h)}),n===void 0&&(n=function(h){return h<.5?t(h*2)/2:1-t((1-h)*2)/2});var s={easeIn:t,easeOut:i,easeInOut:n},a;return Yt(e,function(o){K[o]=Jt[o]=s,K[a=o.toLowerCase()]=i;for(var h in s)K[a+(h==="easeIn"?".in":h==="easeOut"?".out":".inOut")]=K[o+"."+h]=s[h]}),s},Sl=function(e){return function(t){return t<.5?(1-e(1-t*2))/2:.5+e((t-.5)*2)/2}},eo=function r(e,t,i){var n=t>=1?t:1,s=(i||(e?.3:.45))/(t<1?t:1),a=s/Ba*(Math.asin(1/n)||0),o=function(l){return l===1?1:n*Math.pow(2,-10*l)*t0((l-a)*s)+1},h=e==="out"?o:e==="in"?function(u){return 1-o(1-u)}:Sl(o);return s=Ba/s,h.config=function(u,l){return r(e,u,l)},h},io=function r(e,t){t===void 0&&(t=1.70158);var i=function(a){return a?--a*a*((t+1)*a+t)+1:0},n=e==="out"?i:e==="in"?function(s){return 1-i(1-s)}:Sl(i);return n.config=function(s){return r(e,s)},n};Yt("Linear,Quad,Cubic,Quart,Quint,Strong",function(r,e){var t=e<5?e+1:e;Di(r+",Power"+(t-1),e?function(i){return Math.pow(i,t)}:function(i){return i},function(i){return 1-Math.pow(1-i,t)},function(i){return i<.5?Math.pow(i*2,t)/2:1-Math.pow((1-i)*2,t)/2})}),K.Linear.easeNone=K.none=K.Linear.easeIn,Di("Elastic",eo("in"),eo("out"),eo()),function(r,e){var t=1/e,i=2*t,n=2.5*t,s=function(o){return o<t?r*o*o:o<i?r*Math.pow(o-1.5/e,2)+.75:o<n?r*(o-=2.25/e)*o+.9375:r*Math.pow(o-2.625/e,2)+.984375};Di("Bounce",function(a){return 1-s(1-a)},s)}(7.5625,2.75),Di("Expo",function(r){return r?Math.pow(2,10*(r-1)):0}),Di("Circ",function(r){return-(Wu(1-r*r)-1)}),Di("Sine",function(r){return r===1?1:-Qy(r*$y)+1}),Di("Back",io("in"),io("out"),io()),K.SteppedEase=K.steps=Jt.SteppedEase={config:function(e,t){e===void 0&&(e=1);var i=1/e,n=e+(t?0:1),s=t?1:0,a=1-at;return function(o){return((n*Ur(0,a,o)|0)+s)*i}}},$i.ease=K["quad.out"],Yt("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(r){return ja+=r+","+r+"Params,"});var Pl=function(e,t){this.id=Jy++,e._gsap=this,this.target=e,this.harness=t,this.get=t?t.get:tl,this.set=t?t.getSetter:oo},nr=function(){function r(t){this.vars=t,this._delay=+t.delay||0,(this._repeat=t.repeat===1/0?-2:t.repeat||0)&&(this._rDelay=t.repeatDelay||0,this._yoyo=!!t.yoyo||!!t.yoyoEase),this._ts=1,er(this,+t.duration,1,1),this.data=t.data,Rt&&(this._ctx=Rt,Rt.data.push(this)),Wr||te.wake()}var e=r.prototype;return e.delay=function(i){return i||i===0?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+i-this._delay),this._delay=i,this):this._delay},e.duration=function(i){return arguments.length?this.totalDuration(this._repeat>0?i+(i+this._rDelay)*this._repeat:i):this.totalDuration()&&this._dur},e.totalDuration=function(i){return arguments.length?(this._dirty=0,er(this,this._repeat<0?i:(i-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(i,n){if(rr(),!arguments.length)return this._tTime;var s=this._dp;if(s&&s.smoothChildTiming&&this._ts){for(ts(this,i),!s._dp||s.parent||ol(s,this);s&&s.parent;)s.parent._time!==s._start+(s._ts>=0?s._tTime/s._ts:(s.totalDuration()-s._tTime)/-s._ts)&&s.totalTime(s._tTime,!0),s=s.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&i<this._tDur||this._ts<0&&i>0||!this._tDur&&!i)&&Me(this._dp,this,this._start-this._delay)}return(this._tTime!==i||!this._dur&&!n||this._initted&&Math.abs(this._zTime)===at||!i&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=i),el(this,i,n)),this},e.time=function(i,n){return arguments.length?this.totalTime(Math.min(this.totalDuration(),i+al(this))%(this._dur+this._rDelay)||(i?this._dur:0),n):this._time},e.totalProgress=function(i,n){return arguments.length?this.totalTime(this.totalDuration()*i,n):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.ratio},e.progress=function(i,n){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-i:i)+al(this),n):this.duration()?Math.min(1,this._time/this._dur):this.ratio},e.iteration=function(i,n){var s=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(i-1)*s,n):this._repeat?tr(this._tTime,s)+1:1},e.timeScale=function(i){if(!arguments.length)return this._rts===-at?0:this._rts;if(this._rts===i)return this;var n=this.parent&&this._ts?Jn(this.parent._time,this):this._tTime;return this._rts=+i||0,this._ts=this._ps||i===-at?0:this._rts,this.totalTime(Ur(-this._delay,this._tDur,n),!0),Qn(this),o0(this)},e.paused=function(i){return arguments.length?(this._ps!==i&&(this._ps=i,i?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(rr(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==at&&(this._tTime-=at)))),this):this._ps},e.startTime=function(i){if(arguments.length){this._start=i;var n=this.parent||this._dp;return n&&(n._sort||!this.parent)&&Me(n,this,i-this._delay),this}return this._start},e.endTime=function(i){return this._start+(Vt(i)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},e.rawTime=function(i){var n=this.parent||this._dp;return n?i&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?Jn(n.rawTime(i),this):this._tTime:this._tTime},e.revert=function(i){i===void 0&&(i=r0);var n=kt;return kt=i,(this._initted||this._startAt)&&(this.timeline&&this.timeline.revert(i),this.totalTime(-.01,i.suppressEvents)),this.data!=="nested"&&i.kill!==!1&&this.kill(),kt=n,this},e.globalTime=function(i){for(var n=this,s=arguments.length?i:n.rawTime();n;)s=n._start+s/(n._ts||1),n=n._dp;return!this.parent&&this._sat?this._sat.vars.immediateRender?-1:this._sat.globalTime(i):s},e.repeat=function(i){return arguments.length?(this._repeat=i===1/0?-2:i,ll(this)):this._repeat===-2?1/0:this._repeat},e.repeatDelay=function(i){if(arguments.length){var n=this._time;return this._rDelay=i,ll(this),n?this.time(n):this}return this._rDelay},e.yoyo=function(i){return arguments.length?(this._yoyo=i,this):this._yoyo},e.seek=function(i,n){return this.totalTime(le(this,i),Vt(n))},e.restart=function(i,n){return this.play().totalTime(i?-this._delay:0,Vt(n))},e.play=function(i,n){return i!=null&&this.seek(i,n),this.reversed(!1).paused(!1)},e.reverse=function(i,n){return i!=null&&this.seek(i||this.totalDuration(),n),this.reversed(!0).paused(!1)},e.pause=function(i,n){return i!=null&&this.seek(i,n),this.paused(!0)},e.resume=function(){return this.paused(!1)},e.reversed=function(i){return arguments.length?(!!i!==this.reversed()&&this.timeScale(-this._rts||(i?-at:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-at,this},e.isActive=function(){var i=this.parent||this._dp,n=this._start,s;return!!(!i||this._ts&&this._initted&&i.isActive()&&(s=i.rawTime(!0))>=n&&s<this.endTime(!0)-at)},e.eventCallback=function(i,n,s){var a=this.vars;return arguments.length>1?(n?(a[i]=n,s&&(a[i+"Params"]=s),i==="onUpdate"&&(this._onUpdate=n)):delete a[i],this):a[i]},e.then=function(i){var n=this;return new Promise(function(s){var a=bt(i)?i:rl,o=function(){var u=n.then;n.then=null,bt(a)&&(a=a(n))&&(a.then||a===n)&&(n.then=u),s(a),n.then=u};n._initted&&n.totalProgress()===1&&n._ts>=0||!n._tTime&&n._ts<0?o():n._prom=o})},e.kill=function(){Xr(this)},r}();ue(nr.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-at,_prom:0,_ps:!1,_rts:1});var jt=function(r){Hu(e,r);function e(i,n){var s;return i===void 0&&(i={}),s=r.call(this,i)||this,s.labels={},s.smoothChildTiming=!!i.smoothChildTiming,s.autoRemoveChildren=!!i.autoRemoveChildren,s._sort=Vt(i.sortChildren),vt&&Me(i.parent||vt,ze(s),n),i.reversed&&s.reverse(),i.paused&&s.paused(!0),i.scrollTrigger&&hl(ze(s),i.scrollTrigger),s}var t=e.prototype;return t.to=function(n,s,a){return Gr(0,arguments,this),this},t.from=function(n,s,a){return Gr(1,arguments,this),this},t.fromTo=function(n,s,a,o){return Gr(2,arguments,this),this},t.set=function(n,s,a){return s.duration=0,s.parent=this,Br(s).repeatDelay||(s.repeat=0),s.immediateRender=!!s.immediateRender,new It(n,s,le(this,a),1),this},t.call=function(n,s,a){return Me(this,It.delayedCall(0,n,s),a)},t.staggerTo=function(n,s,a,o,h,u,l){return a.duration=s,a.stagger=a.stagger||o,a.onComplete=u,a.onCompleteParams=l,a.parent=this,new It(n,a,le(this,h)),this},t.staggerFrom=function(n,s,a,o,h,u,l){return a.runBackwards=1,Br(a).immediateRender=Vt(a.immediateRender),this.staggerTo(n,s,a,o,h,u,l)},t.staggerFromTo=function(n,s,a,o,h,u,l,f){return o.startAt=a,Br(o).immediateRender=Vt(o.immediateRender),this.staggerTo(n,s,o,h,u,l,f)},t.render=function(n,s,a){var o=this._time,h=this._dirty?this.totalDuration():this._tDur,u=this._dur,l=n<=0?0:Gt(n),f=this._zTime<0!=n<0&&(this._initted||!u),c,d,v,p,_,m,g,y,b,x,T,w;if(this!==vt&&l>h&&n>=0&&(l=h),l!==this._tTime||a||f){if(o!==this._time&&u&&(l+=this._time-o,n+=this._time-o),c=l,b=this._start,y=this._ts,m=!y,f&&(u||(o=this._zTime),(n||!s)&&(this._zTime=n)),this._repeat){if(T=this._yoyo,_=u+this._rDelay,this._repeat<-1&&n<0)return this.totalTime(_*100+n,s,a);if(c=Gt(l%_),l===h?(p=this._repeat,c=u):(p=~~(l/_),p&&p===l/_&&(c=u,p--),c>u&&(c=u)),x=tr(this._tTime,_),!o&&this._tTime&&x!==p&&(x=p),T&&p&1&&(c=u-c,w=1),p!==x&&!this._lock){var S=T&&x&1,E=S===(T&&p&1);if(p<x&&(S=!S),o=S?0:u,this._lock=1,this.render(o||(w?0:Gt(p*_)),s,!u)._lock=0,this._tTime=l,!s&&this.parent&&ce(this,"onRepeat"),this.vars.repeatRefresh&&!w&&(this.invalidate()._lock=1),o&&o!==this._time||m!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(u=this._dur,h=this._tDur,E&&(this._lock=2,o=S?u:-1e-4,this.render(o,!0),this.vars.repeatRefresh&&!w&&this.invalidate()),this._lock=0,!this._ts&&!m)return this;El(this,w)}}if(this._hasPause&&!this._forcing&&this._lock<2&&(g=f0(this,Gt(o),Gt(c)),g&&(l-=c-(c=g._start))),this._tTime=l,this._time=c,this._act=!y,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=n,o=0),!o&&c&&!s&&(ce(this,"onStart"),this._tTime!==l))return this;if(c>=o&&n>=0)for(d=this._first;d;){if(v=d._next,(d._act||c>=d._start)&&d._ts&&g!==d){if(d.parent!==this)return this.render(n,s,a);if(d.render(d._ts>0?(c-d._start)*d._ts:(d._dirty?d.totalDuration():d._tDur)+(c-d._start)*d._ts,s,a),c!==this._time||!this._ts&&!m){g=0,v&&(l+=this._zTime=-at);break}}d=v}else{d=this._last;for(var P=n<0?n:c;d;){if(v=d._prev,(d._act||P<=d._end)&&d._ts&&g!==d){if(d.parent!==this)return this.render(n,s,a);if(d.render(d._ts>0?(P-d._start)*d._ts:(d._dirty?d.totalDuration():d._tDur)+(P-d._start)*d._ts,s,a||kt&&(d._initted||d._startAt)),c!==this._time||!this._ts&&!m){g=0,v&&(l+=this._zTime=P?-at:at);break}}d=v}}if(g&&!s&&(this.pause(),g.render(c>=o?0:-at)._zTime=c>=o?1:-1,this._ts))return this._start=b,Qn(this),this.render(n,s,a);this._onUpdate&&!s&&ce(this,"onUpdate",!0),(l===h&&this._tTime>=this.totalDuration()||!l&&o)&&(b===this._start||Math.abs(y)!==Math.abs(this._ts))&&(this._lock||((n||!u)&&(l===h&&this._ts>0||!l&&this._ts<0)&&ni(this,1),!s&&!(n<0&&!o)&&(l||o||!h)&&(ce(this,l===h&&n>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(l<h&&this.timeScale()>0)&&this._prom())))}return this},t.add=function(n,s){var a=this;if(Ve(s)||(s=le(this,s,n)),!(n instanceof nr)){if(Xt(n))return n.forEach(function(o){return a.add(o,s)}),this;if(Nt(n))return this.addLabel(n,s);if(bt(n))n=It.delayedCall(0,n);else return this}return this!==n?Me(this,n,s):this},t.getChildren=function(n,s,a,o){n===void 0&&(n=!0),s===void 0&&(s=!0),a===void 0&&(a=!0),o===void 0&&(o=-oe);for(var h=[],u=this._first;u;)u._start>=o&&(u instanceof It?s&&h.push(u):(a&&h.push(u),n&&h.push.apply(h,u.getChildren(!0,s,a)))),u=u._next;return h},t.getById=function(n){for(var s=this.getChildren(1,1,1),a=s.length;a--;)if(s[a].vars.id===n)return s[a]},t.remove=function(n){return Nt(n)?this.removeLabel(n):bt(n)?this.killTweensOf(n):($n(this,n),n===this._recent&&(this._recent=this._last),Ii(this))},t.totalTime=function(n,s){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=Gt(te.time-(this._ts>0?n/this._ts:(this.totalDuration()-n)/-this._ts))),r.prototype.totalTime.call(this,n,s),this._forcing=0,this):this._tTime},t.addLabel=function(n,s){return this.labels[n]=le(this,s),this},t.removeLabel=function(n){return delete this.labels[n],this},t.addPause=function(n,s,a){var o=It.delayedCall(0,s||Lr,a);return o.data="isPause",this._hasPause=1,Me(this,o,le(this,n))},t.removePause=function(n){var s=this._first;for(n=le(this,n);s;)s._start===n&&s.data==="isPause"&&ni(s),s=s._next},t.killTweensOf=function(n,s,a){for(var o=this.getTweensOf(n,a),h=o.length;h--;)oi!==o[h]&&o[h].kill(n,s);return this},t.getTweensOf=function(n,s){for(var a=[],o=fe(n),h=this._first,u=Ve(s),l;h;)h instanceof It?n0(h._targets,o)&&(u?(!oi||h._initted&&h._ts)&&h.globalTime(0)<=s&&h.globalTime(h.totalDuration())>s:!s||h.isActive())&&a.push(h):(l=h.getTweensOf(o,s)).length&&a.push.apply(a,l),h=h._next;return a},t.tweenTo=function(n,s){s=s||{};var a=this,o=le(a,n),h=s,u=h.startAt,l=h.onStart,f=h.onStartParams,c=h.immediateRender,d,v=It.to(a,ue({ease:s.ease||"none",lazy:!1,immediateRender:!1,time:o,overwrite:"auto",duration:s.duration||Math.abs((o-(u&&"time"in u?u.time:a._time))/a.timeScale())||at,onStart:function(){if(a.pause(),!d){var _=s.duration||Math.abs((o-(u&&"time"in u?u.time:a._time))/a.timeScale());v._dur!==_&&er(v,_,0,1).render(v._time,!0,!0),d=1}l&&l.apply(v,f||[])}},s));return c?v.render(0):v},t.tweenFromTo=function(n,s,a){return this.tweenTo(s,ue({startAt:{time:le(this,n)}},a))},t.recent=function(){return this._recent},t.nextLabel=function(n){return n===void 0&&(n=this._time),gl(this,le(this,n))},t.previousLabel=function(n){return n===void 0&&(n=this._time),gl(this,le(this,n),1)},t.currentLabel=function(n){return arguments.length?this.seek(n,!0):this.previousLabel(this._time+at)},t.shiftChildren=function(n,s,a){a===void 0&&(a=0);for(var o=this._first,h=this.labels,u;o;)o._start>=a&&(o._start+=n,o._end+=n),o=o._next;if(s)for(u in h)h[u]>=a&&(h[u]+=n);return Ii(this)},t.invalidate=function(n){var s=this._first;for(this._lock=0;s;)s.invalidate(n),s=s._next;return r.prototype.invalidate.call(this,n)},t.clear=function(n){n===void 0&&(n=!0);for(var s=this._first,a;s;)a=s._next,this.remove(s),s=a;return this._dp&&(this._time=this._tTime=this._pTime=0),n&&(this.labels={}),Ii(this)},t.totalDuration=function(n){var s=0,a=this,o=a._last,h=oe,u,l,f;if(arguments.length)return a.timeScale((a._repeat<0?a.duration():a.totalDuration())/(a.reversed()?-n:n));if(a._dirty){for(f=a.parent;o;)u=o._prev,o._dirty&&o.totalDuration(),l=o._start,l>h&&a._sort&&o._ts&&!a._lock?(a._lock=1,Me(a,o,l-o._delay,1)._lock=0):h=l,l<0&&o._ts&&(s-=l,(!f&&!a._dp||f&&f.smoothChildTiming)&&(a._start+=l/a._ts,a._time-=l,a._tTime-=l),a.shiftChildren(-l,!1,-1/0),h=0),o._end>s&&o._ts&&(s=o._end),o=u;er(a,a===vt&&a._time>s?a._time:s,1,1),a._dirty=0}return a._tDur},e.updateRoot=function(n){if(vt._ts&&(el(vt,Jn(n,vt)),Ju=te.frame),te.frame>=Qu){Qu+=$t.autoSleep||120;var s=vt._first;if((!s||!s._ts)&&$t.autoSleep&&te._listeners.length<2){for(;s&&!s._ts;)s=s._next;s||te.sleep()}}},e}(nr);ue(jt.prototype,{_lock:0,_hasPause:0,_forcing:0});var C0=function(e,t,i,n,s,a,o){var h=new Zt(this._pt,e,t,0,1,Ml,null,s),u=0,l=0,f,c,d,v,p,_,m,g;for(h.b=i,h.e=n,i+="",n+="",(m=~n.indexOf("random("))&&(n=kr(n)),a&&(g=[i,n],a(g,e,t),i=g[0],n=g[1]),c=i.match(ka)||[];f=ka.exec(n);)v=f[0],p=n.substring(u,f.index),d?d=(d+1)%5:p.substr(-5)==="rgba("&&(d=1),v!==c[l++]&&(_=parseFloat(c[l-1])||0,h._pt={_next:h._pt,p:p||l===1?p:",",s:_,c:v.charAt(1)==="="?Qi(_,v)-_:parseFloat(v)-_,m:d&&d<4?Math.round:0},u=ka.lastIndex);return h.c=u<n.length?n.substring(u,n.length):"",h.fp=o,(ju.test(n)||m)&&(h.e=0),this._pt=h,h},ro=function(e,t,i,n,s,a,o,h,u,l){bt(n)&&(n=n(s||0,e,a));var f=e[t],c=i!=="get"?i:bt(f)?u?e[t.indexOf("set")||!bt(e["get"+t.substr(3)])?t:"get"+t.substr(3)](u):e[t]():f,d=bt(f)?u?D0:Al:ao,v;if(Nt(n)&&(~n.indexOf("random(")&&(n=kr(n)),n.charAt(1)==="="&&(v=Qi(c,n)+(Ht(c)||0),(v||v===0)&&(n=v))),!l||c!==n||no)return!isNaN(c*n)&&n!==""?(v=new Zt(this._pt,e,t,+c||0,n-(c||0),typeof f=="boolean"?N0:Il,0,d),u&&(v.fp=u),o&&v.modifier(o,this,e),this._pt=v):(!f&&!(t in e)&&Wa(t,n),C0.call(this,e,t,c,n,d,h||$t.stringFilter,u))},O0=function(e,t,i,n,s){if(bt(e)&&(e=zr(e,s,t,i,n)),!Ie(e)||e.style&&e.nodeType||Xt(e)||Vu(e))return Nt(e)?zr(e,s,t,i,n):e;var a={},o;for(o in e)a[o]=zr(e[o],s,t,i,n);return a},Rl=function(e,t,i,n,s,a){var o,h,u,l;if(Qt[e]&&(o=new Qt[e]).init(s,o.rawVars?t[e]:O0(t[e],n,s,a,i),i,n,a)!==!1&&(i._pt=h=new Zt(i._pt,s,e,0,1,o.render,o,0,o.priority),i!==ir))for(u=i._ptLookup[i._targets.indexOf(s)],l=o._props.length;l--;)u[o._props[l]]=h;return o},oi,no,so=function r(e,t,i){var n=e.vars,s=n.ease,a=n.startAt,o=n.immediateRender,h=n.lazy,u=n.onUpdate,l=n.onUpdateParams,f=n.callbackScope,c=n.runBackwards,d=n.yoyoEase,v=n.keyframes,p=n.autoRevert,_=e._dur,m=e._startAt,g=e._targets,y=e.parent,b=y&&y.data==="nested"?y.vars.targets:g,x=e._overwrite==="auto"&&!La,T=e.timeline,w,S,E,P,O,D,N,U,A,R,F,V,H;if(T&&(!v||!s)&&(s="none"),e._ease=Mi(s,$i.ease),e._yEase=d?wl(Mi(d===!0?s:d,$i.ease)):0,d&&e._yoyo&&!e._repeat&&(d=e._yEase,e._yEase=e._ease,e._ease=d),e._from=!T&&!!n.runBackwards,!T||v&&!n.stagger){if(U=g[0]?Oi(g[0]).harness:0,V=U&&n[U.prop],w=Kn(n,za),m&&(m._zTime<0&&m.progress(1),t<0&&c&&o&&!p?m.render(-1,!0):m.revert(c&&_?jn:i0),m._lazy=0),a){if(ni(e._startAt=It.set(g,ue({data:"isStart",overwrite:!1,parent:y,immediateRender:!0,lazy:!m&&Vt(h),startAt:null,delay:0,onUpdate:u,onUpdateParams:l,callbackScope:f,stagger:0},a))),e._startAt._dp=0,e._startAt._sat=e,t<0&&(kt||!o&&!p)&&e._startAt.revert(jn),o&&_&&t<=0&&i<=0){t&&(e._zTime=t);return}}else if(c&&_&&!m){if(t&&(o=!1),E=ue({overwrite:!1,data:"isFromStart",lazy:o&&!m&&Vt(h),immediateRender:o,stagger:0,parent:y},w),V&&(E[U.prop]=V),ni(e._startAt=It.set(g,E)),e._startAt._dp=0,e._startAt._sat=e,t<0&&(kt?e._startAt.revert(jn):e._startAt.render(-1,!0)),e._zTime=t,!o)r(e._startAt,at,at);else if(!t)return}for(e._pt=e._ptCache=0,h=_&&Vt(h)||h&&!_,S=0;S<g.length;S++){if(O=g[S],N=O._gsap||Za(g)[S]._gsap,e._ptLookup[S]=R={},Va[N.id]&&ri.length&&qn(),F=b===g?S:b.indexOf(O),U&&(A=new U).init(O,V||w,e,F,b)!==!1&&(e._pt=P=new Zt(e._pt,O,A.name,0,1,A.render,A,0,A.priority),A._props.forEach(function(I){R[I]=P}),A.priority&&(D=1)),!U||V)for(E in w)Qt[E]&&(A=Rl(E,w,e,F,O,b))?A.priority&&(D=1):R[E]=P=ro.call(e,O,E,"get",w[E],F,b,0,n.stringFilter);e._op&&e._op[S]&&e.kill(O,e._op[S]),x&&e._pt&&(oi=e,vt.killTweensOf(O,R,e.globalTime(t)),H=!e.parent,oi=0),e._pt&&h&&(Va[N.id]=1)}D&&Dl(e),e._onInit&&e._onInit(e)}e._onUpdate=u,e._initted=(!e._op||e._pt)&&!H,v&&t<=0&&T.render(oe,!0,!0)},A0=function(e,t,i,n,s,a,o){var h=(e._pt&&e._ptCache||(e._ptCache={}))[t],u,l,f,c;if(!h)for(h=e._ptCache[t]=[],f=e._ptLookup,c=e._targets.length;c--;){if(u=f[c][t],u&&u.d&&u.d._pt)for(u=u.d._pt;u&&u.p!==t&&u.fp!==t;)u=u._next;if(!u)return no=1,e.vars[t]="+=0",so(e,o),no=0,1;h.push(u)}for(c=h.length;c--;)l=h[c],u=l._pt||l,u.s=(n||n===0)&&!s?n:u.s+(n||0)+a*u.c,u.c=i-u.s,l.e&&(l.e=Et(i)+Ht(l.e)),l.b&&(l.b=u.s+Ht(l.b))},I0=function(e,t){var i=e[0]?Oi(e[0]).harness:0,n=i&&i.aliases,s,a,o,h;if(!n)return t;s=Ai({},t);for(a in n)if(a in s)for(h=n[a].split(","),o=h.length;o--;)s[h[o]]=s[a];return s},M0=function(e,t,i,n){var s=t.ease||n||"power1.inOut",a,o;if(Xt(t))o=i[e]||(i[e]=[]),t.forEach(function(h,u){return o.push({t:u/(t.length-1)*100,v:h,e:s})});else for(a in t)o=i[a]||(i[a]=[]),a==="ease"||o.push({t:parseFloat(e),v:t[a],e:s})},zr=function(e,t,i,n,s){return bt(e)?e.call(t,i,n,s):Nt(e)&&~e.indexOf("random(")?kr(e):e},Cl=ja+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert",Ol={};Yt(Cl+",id,stagger,delay,duration,paused,scrollTrigger",function(r){return Ol[r]=1});var It=function(r){Hu(e,r);function e(i,n,s,a){var o;typeof n=="number"&&(s.duration=n,n=s,s=null),o=r.call(this,a?n:Br(n))||this;var h=o.vars,u=h.duration,l=h.delay,f=h.immediateRender,c=h.stagger,d=h.overwrite,v=h.keyframes,p=h.defaults,_=h.scrollTrigger,m=h.yoyoEase,g=n.parent||vt,y=(Xt(i)||Vu(i)?Ve(i[0]):"length"in n)?[i]:fe(i),b,x,T,w,S,E,P,O;if(o._targets=y.length?Za(y):Yn("GSAP target "+i+" not found. https://greensock.com",!$t.nullTargetWarn)||[],o._ptLookup=[],o._overwrite=d,v||c||zn(u)||zn(l)){if(n=o.vars,b=o.timeline=new jt({data:"nested",defaults:p||{},targets:g&&g.data==="nested"?g.vars.targets:y}),b.kill(),b.parent=b._dp=ze(o),b._start=0,c||zn(u)||zn(l)){if(w=y.length,P=c&&dl(c),Ie(c))for(S in c)~Cl.indexOf(S)&&(O||(O={}),O[S]=c[S]);for(x=0;x<w;x++)T=Kn(n,Ol),T.stagger=0,m&&(T.yoyoEase=m),O&&Ai(T,O),E=y[x],T.duration=+zr(u,ze(o),x,E,y),T.delay=(+zr(l,ze(o),x,E,y)||0)-o._delay,!c&&w===1&&T.delay&&(o._delay=l=T.delay,o._start+=l,T.delay=0),b.to(E,T,P?P(x,E,y):0),b._ease=K.none;b.duration()?u=l=0:o.timeline=0}else if(v){Br(ue(b.vars.defaults,{ease:"none"})),b._ease=Mi(v.ease||n.ease||"none");var D=0,N,U,A;if(Xt(v))v.forEach(function(R){return b.to(y,R,">")}),b.duration();else{T={};for(S in v)S==="ease"||S==="easeEach"||M0(S,v[S],T,v.easeEach);for(S in T)for(N=T[S].sort(function(R,F){return R.t-F.t}),D=0,x=0;x<N.length;x++)U=N[x],A={ease:U.e,duration:(U.t-(x?N[x-1].t:0))/100*u},A[S]=U.v,b.to(y,A,D),D+=A.duration;b.duration()<u&&b.to({},{duration:u-b.duration()})}}u||o.duration(u=b.duration())}else o.timeline=0;return d===!0&&!La&&(oi=ze(o),vt.killTweensOf(y),oi=0),Me(g,ze(o),s),n.reversed&&o.reverse(),n.paused&&o.paused(!0),(f||!u&&!v&&o._start===Gt(g._time)&&Vt(f)&&h0(ze(o))&&g.data!=="nested")&&(o._tTime=-at,o.render(Math.max(0,-l)||0)),_&&hl(ze(o),_),o}var t=e.prototype;return t.render=function(n,s,a){var o=this._time,h=this._tDur,u=this._dur,l=n<0,f=n>h-at&&!l?h:n<at?0:n,c,d,v,p,_,m,g,y,b;if(!u)l0(this,n,s,a);else if(f!==this._tTime||!n||a||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==l){if(c=f,y=this.timeline,this._repeat){if(p=u+this._rDelay,this._repeat<-1&&l)return this.totalTime(p*100+n,s,a);if(c=Gt(f%p),f===h?(v=this._repeat,c=u):(v=~~(f/p),v&&v===f/p&&(c=u,v--),c>u&&(c=u)),m=this._yoyo&&v&1,m&&(b=this._yEase,c=u-c),_=tr(this._tTime,p),c===o&&!a&&this._initted)return this._tTime=f,this;v!==_&&(y&&this._yEase&&El(y,m),this.vars.repeatRefresh&&!m&&!this._lock&&(this._lock=a=1,this.render(Gt(p*v),!0).invalidate()._lock=0))}if(!this._initted){if(ul(this,l?n:c,a,s,f))return this._tTime=0,this;if(o!==this._time)return this;if(u!==this._dur)return this.render(n,s,a)}if(this._tTime=f,this._time=c,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=g=(b||this._ease)(c/u),this._from&&(this.ratio=g=1-g),c&&!o&&!s&&(ce(this,"onStart"),this._tTime!==f))return this;for(d=this._pt;d;)d.r(g,d.d),d=d._next;y&&y.render(n<0?n:!c&&m?-at:y._dur*y._ease(c/this._dur),s,a)||this._startAt&&(this._zTime=n),this._onUpdate&&!s&&(l&&qa(this,n,s,a),ce(this,"onUpdate")),this._repeat&&v!==_&&this.vars.onRepeat&&!s&&this.parent&&ce(this,"onRepeat"),(f===this._tDur||!f)&&this._tTime===f&&(l&&!this._onUpdate&&qa(this,n,!0,!0),(n||!u)&&(f===this._tDur&&this._ts>0||!f&&this._ts<0)&&ni(this,1),!s&&!(l&&!o)&&(f||o||m)&&(ce(this,f===h?"onComplete":"onReverseComplete",!0),this._prom&&!(f<h&&this.timeScale()>0)&&this._prom()))}return this},t.targets=function(){return this._targets},t.invalidate=function(n){return(!n||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(n),r.prototype.invalidate.call(this,n)},t.resetTo=function(n,s,a,o){Wr||te.wake(),this._ts||this.play();var h=Math.min(this._dur,(this._dp._time-this._start)*this._ts),u;return this._initted||so(this,h),u=this._ease(h/this._dur),A0(this,n,s,a,o,u,h)?this.resetTo(n,s,a,o):(ts(this,0),this.parent||sl(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},t.kill=function(n,s){if(s===void 0&&(s="all"),!n&&(!s||s==="all"))return this._lazy=this._pt=0,this.parent?Xr(this):this;if(this.timeline){var a=this.timeline.totalDuration();return this.timeline.killTweensOf(n,s,oi&&oi.vars.overwrite!==!0)._first||Xr(this),this.parent&&a!==this.timeline.totalDuration()&&er(this,this._dur*this.timeline._tDur/a,0,1),this}var o=this._targets,h=n?fe(n):o,u=this._ptLookup,l=this._pt,f,c,d,v,p,_,m;if((!s||s==="all")&&a0(o,h))return s==="all"&&(this._pt=0),Xr(this);for(f=this._op=this._op||[],s!=="all"&&(Nt(s)&&(p={},Yt(s,function(g){return p[g]=1}),s=p),s=I0(o,s)),m=o.length;m--;)if(~h.indexOf(o[m])){c=u[m],s==="all"?(f[m]=s,v=c,d={}):(d=f[m]=f[m]||{},v=s);for(p in v)_=c&&c[p],_&&((!("kill"in _.d)||_.d.kill(p)===!0)&&$n(this,_,"_pt"),delete c[p]),d!=="all"&&(d[p]=1)}return this._initted&&!this._pt&&l&&Xr(this),this},e.to=function(n,s){return new e(n,s,arguments[2])},e.from=function(n,s){return Gr(1,arguments)},e.delayedCall=function(n,s,a,o){return new e(s,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:n,onComplete:s,onReverseComplete:s,onCompleteParams:a,onReverseCompleteParams:a,callbackScope:o})},e.fromTo=function(n,s,a){return Gr(2,arguments)},e.set=function(n,s){return s.duration=0,s.repeatDelay||(s.repeat=0),new e(n,s)},e.killTweensOf=function(n,s,a){return vt.killTweensOf(n,s,a)},e}(nr);ue(It.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0}),Yt("staggerTo,staggerFrom,staggerFromTo",function(r){It[r]=function(){var e=new jt,t=$a.call(arguments,0);return t.splice(r==="staggerFromTo"?5:4,0,0),e[r].apply(e,t)}});var ao=function(e,t,i){return e[t]=i},Al=function(e,t,i){return e[t](i)},D0=function(e,t,i,n){return e[t](n.fp,i)},F0=function(e,t,i){return e.setAttribute(t,i)},oo=function(e,t){return bt(e[t])?Al:Ga(e[t])&&e.setAttribute?F0:ao},Il=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e6)/1e6,t)},N0=function(e,t){return t.set(t.t,t.p,!!(t.s+t.c*e),t)},Ml=function(e,t){var i=t._pt,n="";if(!e&&t.b)n=t.b;else if(e===1&&t.e)n=t.e;else{for(;i;)n=i.p+(i.m?i.m(i.s+i.c*e):Math.round((i.s+i.c*e)*1e4)/1e4)+n,i=i._next;n+=t.c}t.set(t.t,t.p,n,t)},ho=function(e,t){for(var i=t._pt;i;)i.r(e,i.d),i=i._next},L0=function(e,t,i,n){for(var s=this._pt,a;s;)a=s._next,s.p===n&&s.modifier(e,t,i),s=a},B0=function(e){for(var t=this._pt,i,n;t;)n=t._next,t.p===e&&!t.op||t.op===e?$n(this,t,"_pt"):t.dep||(i=1),t=n;return!i},G0=function(e,t,i,n){n.mSet(e,t,n.m.call(n.tween,i,n.mt),n)},Dl=function(e){for(var t=e._pt,i,n,s,a;t;){for(i=t._next,n=s;n&&n.pr>t.pr;)n=n._next;(t._prev=n?n._prev:a)?t._prev._next=t:s=t,(t._next=n)?n._prev=t:a=t,t=i}e._pt=s},Zt=function(){function r(t,i,n,s,a,o,h,u,l){this.t=i,this.s=s,this.c=a,this.p=n,this.r=o||Il,this.d=h||this,this.set=u||ao,this.pr=l||0,this._next=t,t&&(t._prev=this)}var e=r.prototype;return e.modifier=function(i,n,s){this.mSet=this.mSet||this.set,this.set=G0,this.m=i,this.mt=s,this.tween=n},r}();Yt(ja+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger",function(r){return za[r]=1}),Jt.TweenMax=Jt.TweenLite=It,Jt.TimelineLite=Jt.TimelineMax=jt,vt=new jt({sortChildren:!1,defaults:$i,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0}),$t.stringFilter=Tl;var sr=[],es={},U0=[],Fl=0,uo=function(e){return(es[e]||U0).map(function(t){return t()})},lo=function(){var e=Date.now(),t=[];e-Fl>2&&(uo("matchMediaInit"),sr.forEach(function(i){var n=i.queries,s=i.conditions,a,o,h,u;for(o in n)a=he.matchMedia(n[o]).matches,a&&(h=1),a!==s[o]&&(s[o]=a,u=1);u&&(i.revert(),h&&t.push(i))}),uo("matchMediaRevert"),t.forEach(function(i){return i.onMatch(i)}),Fl=e,uo("matchMedia"))},Nl=function(){function r(t,i){this.selector=i&&Ja(i),this.data=[],this._r=[],this.isReverted=!1,t&&this.add(t)}var e=r.prototype;return e.add=function(i,n,s){bt(i)&&(s=n,n=i,i=bt);var a=this,o=function(){var u=Rt,l=a.selector,f;return u&&u!==a&&u.data.push(a),s&&(a.selector=Ja(s)),Rt=a,f=n.apply(a,arguments),bt(f)&&a._r.push(f),Rt=u,a.selector=l,a.isReverted=!1,f};return a.last=o,i===bt?o(a):i?a[i]=o:o},e.ignore=function(i){var n=Rt;Rt=null,i(this),Rt=n},e.getTweens=function(){var i=[];return this.data.forEach(function(n){return n instanceof r?i.push.apply(i,n.getTweens()):n instanceof It&&!(n.parent&&n.parent.data==="nested")&&i.push(n)}),i},e.clear=function(){this._r.length=this.data.length=0},e.kill=function(i,n){var s=this;if(i){var a=this.getTweens();this.data.forEach(function(h){h.data==="isFlip"&&(h.revert(),h.getChildren(!0,!0,!1).forEach(function(u){return a.splice(a.indexOf(u),1)}))}),a.map(function(h){return{g:h.globalTime(0),t:h}}).sort(function(h,u){return u.g-h.g||-1}).forEach(function(h){return h.t.revert(i)}),this.data.forEach(function(h){return!(h instanceof nr)&&h.revert&&h.revert(i)}),this._r.forEach(function(h){return h(i,s)}),this.isReverted=!0}else this.data.forEach(function(h){return h.kill&&h.kill()});if(this.clear(),n){var o=sr.indexOf(this);~o&&sr.splice(o,1)}},e.revert=function(i){this.kill(i||{})},r}(),k0=function(){function r(t){this.contexts=[],this.scope=t}var e=r.prototype;return e.add=function(i,n,s){Ie(i)||(i={matches:i});var a=new Nl(0,s||this.scope),o=a.conditions={},h,u,l;this.contexts.push(a),n=a.add("onMatch",n),a.queries=i;for(u in i)u==="all"?l=1:(h=he.matchMedia(i[u]),h&&(sr.indexOf(a)<0&&sr.push(a),(o[u]=h.matches)&&(l=1),h.addListener?h.addListener(lo):h.addEventListener("change",lo)));return l&&n(a),this},e.revert=function(i){this.kill(i||{})},e.kill=function(i){this.contexts.forEach(function(n){return n.kill(i,!0)})},r}(),is={registerPlugin:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];t.forEach(function(n){return b0(n)})},timeline:function(e){return new jt(e)},getTweensOf:function(e,t){return vt.getTweensOf(e,t)},getProperty:function(e,t,i,n){Nt(e)&&(e=fe(e)[0]);var s=Oi(e||{}).get,a=i?rl:il;return i==="native"&&(i=""),e&&(t?a((Qt[t]&&Qt[t].get||s)(e,t,i,n)):function(o,h,u){return a((Qt[o]&&Qt[o].get||s)(e,o,h,u))})},quickSetter:function(e,t,i){if(e=fe(e),e.length>1){var n=e.map(function(l){return ee.quickSetter(l,t,i)}),s=n.length;return function(l){for(var f=s;f--;)n[f](l)}}e=e[0]||{};var a=Qt[t],o=Oi(e),h=o.harness&&(o.harness.aliases||{})[t]||t,u=a?function(l){var f=new a;ir._pt=0,f.init(e,i?l+i:l,ir,0,[e]),f.render(1,f),ir._pt&&ho(1,ir)}:o.set(e,h);return a?u:function(l){return u(e,h,i?l+i:l,o,1)}},quickTo:function(e,t,i){var n,s=ee.to(e,Ai((n={},n[t]="+=0.1",n.paused=!0,n),i||{})),a=function(h,u,l){return s.resetTo(t,h,u,l)};return a.tween=s,a},isTweening:function(e){return vt.getTweensOf(e,!0).length>0},defaults:function(e){return e&&e.ease&&(e.ease=Mi(e.ease,$i.ease)),nl($i,e||{})},config:function(e){return nl($t,e||{})},registerEffect:function(e){var t=e.name,i=e.effect,n=e.plugins,s=e.defaults,a=e.extendTimeline;(n||"").split(",").forEach(function(o){return o&&!Qt[o]&&!Jt[o]&&Yn(t+" effect requires "+o+" plugin.")}),Ya[t]=function(o,h,u){return i(fe(o),ue(h||{},s),u)},a&&(jt.prototype[t]=function(o,h,u){return this.add(Ya[t](o,Ie(h)?h:(u=h)&&{},this),u)})},registerEase:function(e,t){K[e]=Mi(t)},parseEase:function(e,t){return arguments.length?Mi(e,t):K},getById:function(e){return vt.getById(e)},exportRoot:function(e,t){e===void 0&&(e={});var i=new jt(e),n,s;for(i.smoothChildTiming=Vt(e.smoothChildTiming),vt.remove(i),i._dp=0,i._time=i._tTime=vt._time,n=vt._first;n;)s=n._next,(t||!(!n._dur&&n instanceof It&&n.vars.onComplete===n._targets[0]))&&Me(i,n,n._start-n._delay),n=s;return Me(vt,i,0),i},context:function(e,t){return e?new Nl(e,t):Rt},matchMedia:function(e){return new k0(e)},matchMediaRefresh:function(){return sr.forEach(function(e){var t=e.conditions,i,n;for(n in t)t[n]&&(t[n]=!1,i=1);i&&e.revert()})||lo()},addEventListener:function(e,t){var i=es[e]||(es[e]=[]);~i.indexOf(t)||i.push(t)},removeEventListener:function(e,t){var i=es[e],n=i&&i.indexOf(t);n>=0&&i.splice(n,1)},utils:{wrap:g0,wrapYoyo:y0,distribute:dl,random:vl,snap:pl,normalize:m0,getUnit:Ht,clamp:d0,splitColor:yl,toArray:fe,selector:Ja,mapRange:ml,pipe:v0,unitize:_0,interpolate:x0,shuffle:cl},install:Ku,effects:Ya,ticker:te,updateRoot:jt.updateRoot,plugins:Qt,globalTimeline:vt,core:{PropTween:Zt,globals:$u,Tween:It,Timeline:jt,Animation:nr,getCache:Oi,_removeLinkedListItem:$n,reverting:function(){return kt},context:function(e){return e&&Rt&&(Rt.data.push(e),e._ctx=Rt),Rt},suppressOverwrites:function(e){return La=e}}};Yt("to,from,fromTo,delayedCall,set,killTweensOf",function(r){return is[r]=It[r]}),te.add(jt.updateRoot),ir=is.to({},{duration:0});var X0=function(e,t){for(var i=e._pt;i&&i.p!==t&&i.op!==t&&i.fp!==t;)i=i._next;return i},H0=function(e,t){var i=e._targets,n,s,a;for(n in t)for(s=i.length;s--;)a=e._ptLookup[s][n],a&&(a=a.d)&&(a._pt&&(a=X0(a,n)),a&&a.modifier&&a.modifier(t[n],e,i[s],n))},fo=function(e,t){return{name:e,rawVars:1,init:function(n,s,a){a._onInit=function(o){var h,u;if(Nt(s)&&(h={},Yt(s,function(l){return h[l]=1}),s=h),t){h={};for(u in s)h[u]=t(s[u]);s=h}H0(o,s)}}}},ee=is.registerPlugin({name:"attr",init:function(e,t,i,n,s){var a,o,h;this.tween=i;for(a in t)h=e.getAttribute(a)||"",o=this.add(e,"setAttribute",(h||0)+"",t[a],n,s,0,0,a),o.op=a,o.b=h,this._props.push(a)},render:function(e,t){for(var i=t._pt;i;)kt?i.set(i.t,i.p,i.b,i):i.r(e,i.d),i=i._next}},{name:"endArray",init:function(e,t){for(var i=t.length;i--;)this.add(e,i,e[i]||0,t[i],0,0,0,0,0,1)}},fo("roundProps",Qa),fo("modifiers"),fo("snap",pl))||is;It.version=jt.version=ee.version="3.11.4",qu=1,zu()&&rr(),K.Power0,K.Power1,K.Power2,K.Power3,K.Power4,K.Linear,K.Quad,K.Cubic,K.Quart,K.Quint,K.Strong,K.Elastic,K.Back,K.SteppedEase,K.Bounce,K.Sine,K.Expo,K.Circ;var Ll,hi,ar,co,Fi,Bl,po,W0=function(){return typeof window<"u"},Ye={},Ni=180/Math.PI,or=Math.PI/180,hr=Math.atan2,Gl=1e8,vo=/([A-Z])/g,z0=/(left|right|width|margin|padding|x)/i,V0=/[\s,\(]\S/,je={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},_o=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e4)/1e4+t.u,t)},Y0=function(e,t){return t.set(t.t,t.p,e===1?t.e:Math.round((t.s+t.c*e)*1e4)/1e4+t.u,t)},j0=function(e,t){return t.set(t.t,t.p,e?Math.round((t.s+t.c*e)*1e4)/1e4+t.u:t.b,t)},Z0=function(e,t){var i=t.s+t.c*e;t.set(t.t,t.p,~~(i+(i<0?-.5:.5))+t.u,t)},Ul=function(e,t){return t.set(t.t,t.p,e?t.e:t.b,t)},kl=function(e,t){return t.set(t.t,t.p,e!==1?t.b:t.e,t)},q0=function(e,t,i){return e.style[t]=i},K0=function(e,t,i){return e.style.setProperty(t,i)},$0=function(e,t,i){return e._gsap[t]=i},J0=function(e,t,i){return e._gsap.scaleX=e._gsap.scaleY=i},Q0=function(e,t,i,n,s){var a=e._gsap;a.scaleX=a.scaleY=i,a.renderTransform(s,a)},tx=function(e,t,i,n,s){var a=e._gsap;a[t]=i,a.renderTransform(s,a)},_t="transform",Ee=_t+"Origin",ex=function(e,t){var i=this,n=this.target,s=n.style;if(e in Ye){if(this.tfm=this.tfm||{},e!=="transform"&&(e=je[e]||e,~e.indexOf(",")?e.split(",").forEach(function(a){return i.tfm[a]=Ze(n,a)}):this.tfm[e]=n._gsap.x?n._gsap[e]:Ze(n,e)),this.props.indexOf(_t)>=0)return;n._gsap.svg&&(this.svgo=n.getAttribute("data-svg-origin"),this.props.push(Ee,t,"")),e=_t}(s||t)&&this.props.push(e,t,s[e])},Xl=function(e){e.translate&&(e.removeProperty("translate"),e.removeProperty("scale"),e.removeProperty("rotate"))},ix=function(){var e=this.props,t=this.target,i=t.style,n=t._gsap,s,a;for(s=0;s<e.length;s+=3)e[s+1]?t[e[s]]=e[s+2]:e[s+2]?i[e[s]]=e[s+2]:i.removeProperty(e[s].replace(vo,"-$1").toLowerCase());if(this.tfm){for(a in this.tfm)n[a]=this.tfm[a];n.svg&&(n.renderTransform(),t.setAttribute("data-svg-origin",this.svgo||"")),s=po(),s&&!s.isStart&&!i[_t]&&(Xl(i),n.uncache=1)}},Hl=function(e,t){var i={target:e,props:[],revert:ix,save:ex};return t&&t.split(",").forEach(function(n){return i.save(n)}),i},Wl,mo=function(e,t){var i=hi.createElementNS?hi.createElementNS((t||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),e):hi.createElement(e);return i.style?i:hi.createElement(e)},De=function r(e,t,i){var n=getComputedStyle(e);return n[t]||n.getPropertyValue(t.replace(vo,"-$1").toLowerCase())||n.getPropertyValue(t)||!i&&r(e,ur(t)||t,1)||""},zl="O,Moz,ms,Ms,Webkit".split(","),ur=function(e,t,i){var n=t||Fi,s=n.style,a=5;if(e in s&&!i)return e;for(e=e.charAt(0).toUpperCase()+e.substr(1);a--&&!(zl[a]+e in s););return a<0?null:(a===3?"ms":a>=0?zl[a]:"")+e},go=function(){W0()&&window.document&&(Ll=window,hi=Ll.document,ar=hi.documentElement,Fi=mo("div")||{style:{}},mo("div"),_t=ur(_t),Ee=_t+"Origin",Fi.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",Wl=!!ur("perspective"),po=ee.core.reverting,co=1)},yo=function r(e){var t=mo("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),i=this.parentNode,n=this.nextSibling,s=this.style.cssText,a;if(ar.appendChild(t),t.appendChild(this),this.style.display="block",e)try{a=this.getBBox(),this._gsapBBox=this.getBBox,this.getBBox=r}catch{}else this._gsapBBox&&(a=this._gsapBBox());return i&&(n?i.insertBefore(this,n):i.appendChild(this)),ar.removeChild(t),this.style.cssText=s,a},Vl=function(e,t){for(var i=t.length;i--;)if(e.hasAttribute(t[i]))return e.getAttribute(t[i])},Yl=function(e){var t;try{t=e.getBBox()}catch{t=yo.call(e,!0)}return t&&(t.width||t.height)||e.getBBox===yo||(t=yo.call(e,!0)),t&&!t.width&&!t.x&&!t.y?{x:+Vl(e,["x","cx","x1"])||0,y:+Vl(e,["y","cy","y1"])||0,width:0,height:0}:t},jl=function(e){return!!(e.getCTM&&(!e.parentNode||e.ownerSVGElement)&&Yl(e))},Vr=function(e,t){if(t){var i=e.style;t in Ye&&t!==Ee&&(t=_t),i.removeProperty?((t.substr(0,2)==="ms"||t.substr(0,6)==="webkit")&&(t="-"+t),i.removeProperty(t.replace(vo,"-$1").toLowerCase())):i.removeAttribute(t)}},ui=function(e,t,i,n,s,a){var o=new Zt(e._pt,t,i,0,1,a?kl:Ul);return e._pt=o,o.b=n,o.e=s,e._props.push(i),o},Zl={deg:1,rad:1,turn:1},rx={grid:1,flex:1},li=function r(e,t,i,n){var s=parseFloat(i)||0,a=(i+"").trim().substr((s+"").length)||"px",o=Fi.style,h=z0.test(t),u=e.tagName.toLowerCase()==="svg",l=(u?"client":"offset")+(h?"Width":"Height"),f=100,c=n==="px",d=n==="%",v,p,_,m;return n===a||!s||Zl[n]||Zl[a]?s:(a!=="px"&&!c&&(s=r(e,t,i,"px")),m=e.getCTM&&jl(e),(d||a==="%")&&(Ye[t]||~t.indexOf("adius"))?(v=m?e.getBBox()[h?"width":"height"]:e[l],Et(d?s/v*f:s/100*v)):(o[h?"width":"height"]=f+(c?a:n),p=~t.indexOf("adius")||n==="em"&&e.appendChild&&!u?e:e.parentNode,m&&(p=(e.ownerSVGElement||{}).parentNode),(!p||p===hi||!p.appendChild)&&(p=hi.body),_=p._gsap,_&&d&&_.width&&h&&_.time===te.time&&!_.uncache?Et(s/_.width*f):((d||a==="%")&&!rx[De(p,"display")]&&(o.position=De(e,"position")),p===e&&(o.position="static"),p.appendChild(Fi),v=Fi[l],p.removeChild(Fi),o.position="absolute",h&&d&&(_=Oi(p),_.time=te.time,_.width=p[l]),Et(c?v*s/f:v&&s?f/v*s:0))))},Ze=function(e,t,i,n){var s;return co||go(),t in je&&t!=="transform"&&(t=je[t],~t.indexOf(",")&&(t=t.split(",")[0])),Ye[t]&&t!=="transform"?(s=jr(e,n),s=t!=="transformOrigin"?s[t]:s.svg?s.origin:ns(De(e,Ee))+" "+s.zOrigin+"px"):(s=e.style[t],(!s||s==="auto"||n||~(s+"").indexOf("calc("))&&(s=rs[t]&&rs[t](e,t,i)||De(e,t)||tl(e,t)||(t==="opacity"?1:0))),i&&!~(s+"").trim().indexOf(" ")?li(e,t,s,i)+i:s},nx=function(e,t,i,n){if(!i||i==="none"){var s=ur(t,e,1),a=s&&De(e,s,1);a&&a!==i?(t=s,i=a):t==="borderColor"&&(i=De(e,"borderTopColor"))}var o=new Zt(this._pt,e.style,t,0,1,Ml),h=0,u=0,l,f,c,d,v,p,_,m,g,y,b,x;if(o.b=i,o.e=n,i+="",n+="",n==="auto"&&(e.style[t]=n,n=De(e,t)||n,e.style[t]=i),l=[i,n],Tl(l),i=l[0],n=l[1],c=i.match(Ji)||[],x=n.match(Ji)||[],x.length){for(;f=Ji.exec(n);)_=f[0],g=n.substring(h,f.index),v?v=(v+1)%5:(g.substr(-5)==="rgba("||g.substr(-5)==="hsla(")&&(v=1),_!==(p=c[u++]||"")&&(d=parseFloat(p)||0,b=p.substr((d+"").length),_.charAt(1)==="="&&(_=Qi(d,_)+b),m=parseFloat(_),y=_.substr((m+"").length),h=Ji.lastIndex-y.length,y||(y=y||$t.units[t]||b,h===n.length&&(n+=y,o.e+=y)),b!==y&&(d=li(e,t,p,y)||0),o._pt={_next:o._pt,p:g||u===1?g:",",s:d,c:m-d,m:v&&v<4||t==="zIndex"?Math.round:0});o.c=h<n.length?n.substring(h,n.length):""}else o.r=t==="display"&&n==="none"?kl:Ul;return ju.test(n)&&(o.e=0),this._pt=o,o},ql={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},sx=function(e){var t=e.split(" "),i=t[0],n=t[1]||"50%";return(i==="top"||i==="bottom"||n==="left"||n==="right")&&(e=i,i=n,n=e),t[0]=ql[i]||i,t[1]=ql[n]||n,t.join(" ")},ax=function(e,t){if(t.tween&&t.tween._time===t.tween._dur){var i=t.t,n=i.style,s=t.u,a=i._gsap,o,h,u;if(s==="all"||s===!0)n.cssText="",h=1;else for(s=s.split(","),u=s.length;--u>-1;)o=s[u],Ye[o]&&(h=1,o=o==="transformOrigin"?Ee:_t),Vr(i,o);h&&(Vr(i,_t),a&&(a.svg&&i.removeAttribute("transform"),jr(i,1),a.uncache=1,Xl(n)))}},rs={clearProps:function(e,t,i,n,s){if(s.data!=="isFromStart"){var a=e._pt=new Zt(e._pt,t,i,0,0,ax);return a.u=n,a.pr=-10,a.tween=s,e._props.push(i),1}}},Yr=[1,0,0,1,0,0],Kl={},$l=function(e){return e==="matrix(1, 0, 0, 1, 0, 0)"||e==="none"||!e},Jl=function(e){var t=De(e,_t);return $l(t)?Yr:t.substr(7).match(Yu).map(Et)},xo=function(e,t){var i=e._gsap||Oi(e),n=e.style,s=Jl(e),a,o,h,u;return i.svg&&e.getAttribute("transform")?(h=e.transform.baseVal.consolidate().matrix,s=[h.a,h.b,h.c,h.d,h.e,h.f],s.join(",")==="1,0,0,1,0,0"?Yr:s):(s===Yr&&!e.offsetParent&&e!==ar&&!i.svg&&(h=n.display,n.display="block",a=e.parentNode,(!a||!e.offsetParent)&&(u=1,o=e.nextElementSibling,ar.appendChild(e)),s=Jl(e),h?n.display=h:Vr(e,"display"),u&&(o?a.insertBefore(e,o):a?a.appendChild(e):ar.removeChild(e))),t&&s.length>6?[s[0],s[1],s[4],s[5],s[12],s[13]]:s)},bo=function(e,t,i,n,s,a){var o=e._gsap,h=s||xo(e,!0),u=o.xOrigin||0,l=o.yOrigin||0,f=o.xOffset||0,c=o.yOffset||0,d=h[0],v=h[1],p=h[2],_=h[3],m=h[4],g=h[5],y=t.split(" "),b=parseFloat(y[0])||0,x=parseFloat(y[1])||0,T,w,S,E;i?h!==Yr&&(w=d*_-v*p)&&(S=b*(_/w)+x*(-p/w)+(p*g-_*m)/w,E=b*(-v/w)+x*(d/w)-(d*g-v*m)/w,b=S,x=E):(T=Yl(e),b=T.x+(~y[0].indexOf("%")?b/100*T.width:b),x=T.y+(~(y[1]||y[0]).indexOf("%")?x/100*T.height:x)),n||n!==!1&&o.smooth?(m=b-u,g=x-l,o.xOffset=f+(m*d+g*p)-m,o.yOffset=c+(m*v+g*_)-g):o.xOffset=o.yOffset=0,o.xOrigin=b,o.yOrigin=x,o.smooth=!!n,o.origin=t,o.originIsAbsolute=!!i,e.style[Ee]="0px 0px",a&&(ui(a,o,"xOrigin",u,b),ui(a,o,"yOrigin",l,x),ui(a,o,"xOffset",f,o.xOffset),ui(a,o,"yOffset",c,o.yOffset)),e.setAttribute("data-svg-origin",b+" "+x)},jr=function(e,t){var i=e._gsap||new Pl(e);if("x"in i&&!t&&!i.uncache)return i;var n=e.style,s=i.scaleX<0,a="px",o="deg",h=getComputedStyle(e),u=De(e,Ee)||"0",l,f,c,d,v,p,_,m,g,y,b,x,T,w,S,E,P,O,D,N,U,A,R,F,V,H,I,C,G,$,Y,rt;return l=f=c=p=_=m=g=y=b=0,d=v=1,i.svg=!!(e.getCTM&&jl(e)),h.translate&&((h.translate!=="none"||h.scale!=="none"||h.rotate!=="none")&&(n[_t]=(h.translate!=="none"?"translate3d("+(h.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(h.rotate!=="none"?"rotate("+h.rotate+") ":"")+(h.scale!=="none"?"scale("+h.scale.split(" ").join(",")+") ":"")+(h[_t]!=="none"?h[_t]:"")),n.scale=n.rotate=n.translate="none"),w=xo(e,i.svg),i.svg&&(i.uncache?(V=e.getBBox(),u=i.xOrigin-V.x+"px "+(i.yOrigin-V.y)+"px",F=""):F=!t&&e.getAttribute("data-svg-origin"),bo(e,F||u,!!F||i.originIsAbsolute,i.smooth!==!1,w)),x=i.xOrigin||0,T=i.yOrigin||0,w!==Yr&&(O=w[0],D=w[1],N=w[2],U=w[3],l=A=w[4],f=R=w[5],w.length===6?(d=Math.sqrt(O*O+D*D),v=Math.sqrt(U*U+N*N),p=O||D?hr(D,O)*Ni:0,g=N||U?hr(N,U)*Ni+p:0,g&&(v*=Math.abs(Math.cos(g*or))),i.svg&&(l-=x-(x*O+T*N),f-=T-(x*D+T*U))):(rt=w[6],$=w[7],I=w[8],C=w[9],G=w[10],Y=w[11],l=w[12],f=w[13],c=w[14],S=hr(rt,G),_=S*Ni,S&&(E=Math.cos(-S),P=Math.sin(-S),F=A*E+I*P,V=R*E+C*P,H=rt*E+G*P,I=A*-P+I*E,C=R*-P+C*E,G=rt*-P+G*E,Y=$*-P+Y*E,A=F,R=V,rt=H),S=hr(-N,G),m=S*Ni,S&&(E=Math.cos(-S),P=Math.sin(-S),F=O*E-I*P,V=D*E-C*P,H=N*E-G*P,Y=U*P+Y*E,O=F,D=V,N=H),S=hr(D,O),p=S*Ni,S&&(E=Math.cos(S),P=Math.sin(S),F=O*E+D*P,V=A*E+R*P,D=D*E-O*P,R=R*E-A*P,O=F,A=V),_&&Math.abs(_)+Math.abs(p)>359.9&&(_=p=0,m=180-m),d=Et(Math.sqrt(O*O+D*D+N*N)),v=Et(Math.sqrt(R*R+rt*rt)),S=hr(A,R),g=Math.abs(S)>2e-4?S*Ni:0,b=Y?1/(Y<0?-Y:Y):0),i.svg&&(F=e.getAttribute("transform"),i.forceCSS=e.setAttribute("transform","")||!$l(De(e,_t)),F&&e.setAttribute("transform",F))),Math.abs(g)>90&&Math.abs(g)<270&&(s?(d*=-1,g+=p<=0?180:-180,p+=p<=0?180:-180):(v*=-1,g+=g<=0?180:-180)),t=t||i.uncache,i.x=l-((i.xPercent=l&&(!t&&i.xPercent||(Math.round(e.offsetWidth/2)===Math.round(-l)?-50:0)))?e.offsetWidth*i.xPercent/100:0)+a,i.y=f-((i.yPercent=f&&(!t&&i.yPercent||(Math.round(e.offsetHeight/2)===Math.round(-f)?-50:0)))?e.offsetHeight*i.yPercent/100:0)+a,i.z=c+a,i.scaleX=Et(d),i.scaleY=Et(v),i.rotation=Et(p)+o,i.rotationX=Et(_)+o,i.rotationY=Et(m)+o,i.skewX=g+o,i.skewY=y+o,i.transformPerspective=b+a,(i.zOrigin=parseFloat(u.split(" ")[2])||0)&&(n[Ee]=ns(u)),i.xOffset=i.yOffset=0,i.force3D=$t.force3D,i.renderTransform=i.svg?hx:Wl?Ql:ox,i.uncache=0,i},ns=function(e){return(e=e.split(" "))[0]+" "+e[1]},To=function(e,t,i){var n=Ht(t);return Et(parseFloat(t)+parseFloat(li(e,"x",i+"px",n)))+n},ox=function(e,t){t.z="0px",t.rotationY=t.rotationX="0deg",t.force3D=0,Ql(e,t)},Li="0deg",Zr="0px",Bi=") ",Ql=function(e,t){var i=t||this,n=i.xPercent,s=i.yPercent,a=i.x,o=i.y,h=i.z,u=i.rotation,l=i.rotationY,f=i.rotationX,c=i.skewX,d=i.skewY,v=i.scaleX,p=i.scaleY,_=i.transformPerspective,m=i.force3D,g=i.target,y=i.zOrigin,b="",x=m==="auto"&&e&&e!==1||m===!0;if(y&&(f!==Li||l!==Li)){var T=parseFloat(l)*or,w=Math.sin(T),S=Math.cos(T),E;T=parseFloat(f)*or,E=Math.cos(T),a=To(g,a,w*E*-y),o=To(g,o,-Math.sin(T)*-y),h=To(g,h,S*E*-y+y)}_!==Zr&&(b+="perspective("+_+Bi),(n||s)&&(b+="translate("+n+"%, "+s+"%) "),(x||a!==Zr||o!==Zr||h!==Zr)&&(b+=h!==Zr||x?"translate3d("+a+", "+o+", "+h+") ":"translate("+a+", "+o+Bi),u!==Li&&(b+="rotate("+u+Bi),l!==Li&&(b+="rotateY("+l+Bi),f!==Li&&(b+="rotateX("+f+Bi),(c!==Li||d!==Li)&&(b+="skew("+c+", "+d+Bi),(v!==1||p!==1)&&(b+="scale("+v+", "+p+Bi),g.style[_t]=b||"translate(0, 0)"},hx=function(e,t){var i=t||this,n=i.xPercent,s=i.yPercent,a=i.x,o=i.y,h=i.rotation,u=i.skewX,l=i.skewY,f=i.scaleX,c=i.scaleY,d=i.target,v=i.xOrigin,p=i.yOrigin,_=i.xOffset,m=i.yOffset,g=i.forceCSS,y=parseFloat(a),b=parseFloat(o),x,T,w,S,E;h=parseFloat(h),u=parseFloat(u),l=parseFloat(l),l&&(l=parseFloat(l),u+=l,h+=l),h||u?(h*=or,u*=or,x=Math.cos(h)*f,T=Math.sin(h)*f,w=Math.sin(h-u)*-c,S=Math.cos(h-u)*c,u&&(l*=or,E=Math.tan(u-l),E=Math.sqrt(1+E*E),w*=E,S*=E,l&&(E=Math.tan(l),E=Math.sqrt(1+E*E),x*=E,T*=E)),x=Et(x),T=Et(T),w=Et(w),S=Et(S)):(x=f,S=c,T=w=0),(y&&!~(a+"").indexOf("px")||b&&!~(o+"").indexOf("px"))&&(y=li(d,"x",a,"px"),b=li(d,"y",o,"px")),(v||p||_||m)&&(y=Et(y+v-(v*x+p*w)+_),b=Et(b+p-(v*T+p*S)+m)),(n||s)&&(E=d.getBBox(),y=Et(y+n/100*E.width),b=Et(b+s/100*E.height)),E="matrix("+x+","+T+","+w+","+S+","+y+","+b+")",d.setAttribute("transform",E),g&&(d.style[_t]=E)},ux=function(e,t,i,n,s){var a=360,o=Nt(s),h=parseFloat(s)*(o&&~s.indexOf("rad")?Ni:1),u=h-n,l=n+u+"deg",f,c;return o&&(f=s.split("_")[1],f==="short"&&(u%=a,u!==u%(a/2)&&(u+=u<0?a:-a)),f==="cw"&&u<0?u=(u+a*Gl)%a-~~(u/a)*a:f==="ccw"&&u>0&&(u=(u-a*Gl)%a-~~(u/a)*a)),e._pt=c=new Zt(e._pt,t,i,n,u,Y0),c.e=l,c.u="deg",e._props.push(i),c},tf=function(e,t){for(var i in t)e[i]=t[i];return e},lx=function(e,t,i){var n=tf({},i._gsap),s="perspective,force3D,transformOrigin,svgOrigin",a=i.style,o,h,u,l,f,c,d,v;n.svg?(u=i.getAttribute("transform"),i.setAttribute("transform",""),a[_t]=t,o=jr(i,1),Vr(i,_t),i.setAttribute("transform",u)):(u=getComputedStyle(i)[_t],a[_t]=t,o=jr(i,1),a[_t]=u);for(h in Ye)u=n[h],l=o[h],u!==l&&s.indexOf(h)<0&&(d=Ht(u),v=Ht(l),f=d!==v?li(i,h,u,v):parseFloat(u),c=parseFloat(l),e._pt=new Zt(e._pt,o,h,f,c-f,_o),e._pt.u=v||0,e._props.push(h));tf(o,n)};Yt("padding,margin,Width,Radius",function(r,e){var t="Top",i="Right",n="Bottom",s="Left",a=(e<3?[t,i,n,s]:[t+s,t+i,n+i,n+s]).map(function(o){return e<2?r+o:"border"+o+r});rs[e>1?"border"+r:r]=function(o,h,u,l,f){var c,d;if(arguments.length<4)return c=a.map(function(v){return Ze(o,v,u)}),d=c.join(" "),d.split(c[0]).length===5?c[0]:d;c=(l+"").split(" "),d={},a.forEach(function(v,p){return d[v]=c[p]=c[p]||c[(p-1)/2|0]}),o.init(h,d,f)}});var ef={name:"css",register:go,targetTest:function(e){return e.style&&e.nodeType},init:function(e,t,i,n,s){var a=this._props,o=e.style,h=i.vars.startAt,u,l,f,c,d,v,p,_,m,g,y,b,x,T,w,S;co||go(),this.styles=this.styles||Hl(e),S=this.styles.props,this.tween=i;for(p in t)if(p!=="autoRound"&&(l=t[p],!(Qt[p]&&Rl(p,t,i,n,e,s)))){if(d=typeof l,v=rs[p],d==="function"&&(l=l.call(i,n,e,s),d=typeof l),d==="string"&&~l.indexOf("random(")&&(l=kr(l)),v)v(this,e,p,l,i)&&(w=1);else if(p.substr(0,2)==="--")u=(getComputedStyle(e).getPropertyValue(p)+"").trim(),l+="",ai.lastIndex=0,ai.test(u)||(_=Ht(u),m=Ht(l)),m?_!==m&&(u=li(e,p,u,m)+m):_&&(l+=_),this.add(o,"setProperty",u,l,n,s,0,0,p),a.push(p),S.push(p,0,o[p]);else if(d!=="undefined"){if(h&&p in h?(u=typeof h[p]=="function"?h[p].call(i,n,e,s):h[p],Nt(u)&&~u.indexOf("random(")&&(u=kr(u)),Ht(u+"")||(u+=$t.units[p]||Ht(Ze(e,p))||""),(u+"").charAt(1)==="="&&(u=Ze(e,p))):u=Ze(e,p),c=parseFloat(u),g=d==="string"&&l.charAt(1)==="="&&l.substr(0,2),g&&(l=l.substr(2)),f=parseFloat(l),p in je&&(p==="autoAlpha"&&(c===1&&Ze(e,"visibility")==="hidden"&&f&&(c=0),S.push("visibility",0,o.visibility),ui(this,o,"visibility",c?"inherit":"hidden",f?"inherit":"hidden",!f)),p!=="scale"&&p!=="transform"&&(p=je[p],~p.indexOf(",")&&(p=p.split(",")[0]))),y=p in Ye,y){if(this.styles.save(p),b||(x=e._gsap,x.renderTransform&&!t.parseTransform||jr(e,t.parseTransform),T=t.smoothOrigin!==!1&&x.smooth,b=this._pt=new Zt(this._pt,o,_t,0,1,x.renderTransform,x,0,-1),b.dep=1),p==="scale")this._pt=new Zt(this._pt,x,"scaleY",x.scaleY,(g?Qi(x.scaleY,g+f):f)-x.scaleY||0,_o),this._pt.u=0,a.push("scaleY",p),p+="X";else if(p==="transformOrigin"){S.push(Ee,0,o[Ee]),l=sx(l),x.svg?bo(e,l,0,T,0,this):(m=parseFloat(l.split(" ")[2])||0,m!==x.zOrigin&&ui(this,x,"zOrigin",x.zOrigin,m),ui(this,o,p,ns(u),ns(l)));continue}else if(p==="svgOrigin"){bo(e,l,1,T,0,this);continue}else if(p in Kl){ux(this,x,p,c,g?Qi(c,g+l):l);continue}else if(p==="smoothOrigin"){ui(this,x,"smooth",x.smooth,l);continue}else if(p==="force3D"){x[p]=l;continue}else if(p==="transform"){lx(this,l,e);continue}}else p in o||(p=ur(p)||p);if(y||(f||f===0)&&(c||c===0)&&!V0.test(l)&&p in o)_=(u+"").substr((c+"").length),f||(f=0),m=Ht(l)||(p in $t.units?$t.units[p]:_),_!==m&&(c=li(e,p,u,m)),this._pt=new Zt(this._pt,y?x:o,p,c,(g?Qi(c,g+f):f)-c,!y&&(m==="px"||p==="zIndex")&&t.autoRound!==!1?Z0:_o),this._pt.u=m||0,_!==m&&m!=="%"&&(this._pt.b=u,this._pt.r=j0);else if(p in o)nx.call(this,e,p,u,g?g+l:l);else if(p in e)this.add(e,p,u||e[p],g?g+l:l,n,s);else if(p!=="parseTransform"){Wa(p,l);continue}y||(p in o?S.push(p,0,o[p]):S.push(p,1,u||e[p])),a.push(p)}}w&&Dl(this)},render:function(e,t){if(t.tween._time||!po())for(var i=t._pt;i;)i.r(e,i.d),i=i._next;else t.styles.revert()},get:Ze,aliases:je,getSetter:function(e,t,i){var n=je[t];return n&&n.indexOf(",")<0&&(t=n),t in Ye&&t!==Ee&&(e._gsap.x||Ze(e,"x"))?i&&Bl===i?t==="scale"?J0:$0:(Bl=i||{})&&(t==="scale"?Q0:tx):e.style&&!Ga(e.style[t])?q0:~t.indexOf("-")?K0:oo(e,t)},core:{_removeProperty:Vr,_getMatrix:xo}};ee.utils.checkPrefix=ur,ee.core.getStyleSaver=Hl,function(r,e,t,i){var n=Yt(r+","+e+","+t,function(s){Ye[s]=1});Yt(e,function(s){$t.units[s]="deg",Kl[s]=1}),je[n[13]]=r+","+e,Yt(i,function(s){var a=s.split(":");je[a[1]]=n[a[0]]})}("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY"),Yt("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(r){$t.units[r]="px"}),ee.registerPlugin(ef);var wo=ee.registerPlugin(ef)||ee;wo.core.Tween;const rf={fadeIn:.25,move:.5},ss="box",qr={startCap:"startCap",endCap:"endCap",body:"body"};class fx extends yt{constructor({appRef:t,nodeData:i,styles:n,styleNode:s,layoutPosition:a}){super();B(this,"appRef");B(this,"nodeData");B(this,"styles");B(this,"styleNode");B(this,"unwatch");B(this,"label");B(this,"boxCapWidth",0);B(this,"box",new yt);B(this,"apxLabelWidth",0);B(this,"nodeWidth");B(this,"layoutPositionOffset");B(this,"layoutPosition");B(this,"isLabelInBox",!0);B(this,"selectedRing",new ne);this.appRef=t,this.nodeData=i,this.styles=n,this.styleNode=s,this.layoutPosition=a,this.boxCapWidth=this.styles.value.borderRadiusNode,this.nodeWidth=this.getNodeWidth(),this.layoutPositionOffset=this.getLayoutPositionOffset(),this.box.name=ss,this.drawBox(),this.addChild(this.box),this.drawLabel(),this.drawSelectedRing(),this.selectedRing.alpha=0,this.updatePosition(!0),this.unwatch=J.watch([n,s],()=>{this.box.removeChildren(),this.drawBox(),this.drawLabel()},{deep:!0}),this.interactive=!0,this.buttonMode=!0,this.animateIn()}getNodeWidth(){const t=this.boxCapWidth*2,i=ae.dateToX(this.nodeData.end??new Date)-ae.dateToX(this.nodeData.start);return i>t?i:t}getLayoutPositionOffset(){const{textLineHeightDefault:t,spacingNodeYPadding:i,spacingNodeMargin:n}=this.styles.value;return t+i*2+n}drawBox(){const{appRef:t,nodeWidth:i,box:n,boxCapWidth:s}=this,{fill:a}=this.styleNode.value(this.nodeData),o=qe(a),h=!this.nodeData.end,{textLineHeightDefault:u,spacingNodeYPadding:l,borderRadiusNode:f}=this.styles.value,c=u+l*2,{cap:d,body:v}=Xy({appRef:t,fill:o,borderRadius:f,boxCapWidth:s,height:c}),p=new We(d);p.name=qr.startCap;const _=new We(v);if(_.name=qr.body,_.width=this.getBoxBodyWidth(),_.position.set(s,0),n.addChild(p),n.addChild(_),!h){const m=new We(d);m.name=qr.endCap,m.rotation=Math.PI,m.position.set(i,c),n.addChild(m)}}getBoxBodyWidth(){const{nodeData:t,nodeWidth:i,boxCapWidth:n}=this;return!t.end?i-n:i-n*2}async drawLabel(){var s;const t=await Wn(this.styles.value),{inverseTextOnFill:i}=this.styleNode.value(this.nodeData),{spacingNodeXPadding:n}=this.styles.value;if(this.apxLabelWidth===0&&(this.apxLabelWidth=se.measureText(this.nodeData.label,t.nodeTextStyles).width*(1+7/100)),(s=this.label)==null||s.destroy(),this.apxLabelWidth+n*2>this.nodeWidth)this.isLabelInBox=!1,this.label=new kn(this.nodeData.label,t.nodeTextDefault);else{const a=i?t.nodeTextInverse:t.nodeTextDefault;this.isLabelInBox=!0,this.label=new kn(this.nodeData.label,a)}this.updateLabelPosition(),this.addChild(this.label)}drawSelectedRing(){const{colorNodeSelection:t,spacingNodeSelectionMargin:i,spacingNodeSelectionWidth:n,borderRadiusNode:s}=this.styles.value;this.selectedRing.lineStyle(n,t,1,1),this.selectedRing.drawRoundedRect(-i,-i,this.nodeWidth+i*2,this.box.height+i*2,s),this.addChild(this.selectedRing)}animateIn(){wo.to(this,{alpha:1,duration:rf.fadeIn})}updateBoxWidth(){this.box.children.forEach(t=>{switch(t.name){case qr.body:t.scale.x=this.getBoxBodyWidth();break;case qr.endCap:t.position.set(this.nodeWidth,this.box.height);break}})}async updatePosition(t){const i=ae.dateToX(this.nodeData.start),n=this.layoutPosition*this.layoutPositionOffset;if(t){this.position.set(i,n);return}await new Promise(s=>{wo.to(this,{x:i,y:n,duration:rf.move,ease:"power1.out"}).then(()=>{s(null)})})}updateLabelPosition(){var s;const{spacingNodeXPadding:t,spacingNodeYPadding:i,spacingNodeLabelMargin:n}=this.styles.value;(s=this.label)==null||s.position.set(this.isLabelInBox?t:this.nodeWidth+n,i)}async update(t){let i=!1;t&&(i=t.state!==this.nodeData.state,this.nodeData=t);const n=this.getNodeWidth();i&&(this.box.removeChildren(),this.drawBox()),n!==this.nodeWidth&&(i||this.updateBoxWidth(),this.nodeWidth=n,this.selectedRing.clear(),this.drawSelectedRing(),this.isLabelInBox&&this.apxLabelWidth>this.nodeWidth+2||!this.isLabelInBox&&this.apxLabelWidth<this.nodeWidth-2?this.drawLabel():this.isLabelInBox||this.updateLabelPosition()),await this.updatePosition()}select(){this.selectedRing.alpha=1}deselect(){this.selectedRing.alpha=0}destroy(){this.unwatch(),super.destroy.call(this)}}const nf="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2NvbnN0IEw9KHttaW5pbXVtU3RhcnRUaW1lOmUsb3ZlcmFsbEdyYXBoV2lkdGg6bixpbml0aWFsT3ZlcmFsbFRpbWVTcGFuOnR9KT0+KHtkYXRlVG9YOlQoZSxuLHQpLHhUb0RhdGU6UyhlLG4sdCl9KTtmdW5jdGlvbiBUKGUsbix0KXtyZXR1cm4gZnVuY3Rpb24obyl7cmV0dXJuIE1hdGguY2VpbCgoby5nZXRUaW1lKCktZSkqKG4vdCkpfX1mdW5jdGlvbiBTKGUsbix0KXtyZXR1cm4gZnVuY3Rpb24obyl7cmV0dXJuIE1hdGguY2VpbChlK28qKHQvbikpfX1jb25zdCBnPTA7bGV0IGQsRD0xNCx2PTAsdz0id2F0ZXJmYWxsIixtPVtdO2NvbnN0IHM9e307b25tZXNzYWdlPWFzeW5jKHtkYXRhOntsYXlvdXRTZXR0aW5nOmUsZ3JhcGhEYXRhOm4sYXB4Q2hhcmFjdGVyV2lkdGg6dCxzcGFjaW5nTWluaW11bU5vZGVFZGdlR2FwOm8sdGltZVNjYWxlUHJvcHM6aX19KT0+e2lmKCFuKXtjb25zb2xlLndhcm4oIm5vZGVMYXlvdXQgd29ya2VyOiBjYWxsZWQgd2l0aG91dCBncmFwaERhdGEsIGV4aXRpbmcuIik7cmV0dXJufWlmKG8mJih2PW8pLGUpe2Zvcihjb25zdCBjIGluIHMpZGVsZXRlIHNbY107dz1lfWlmKHQmJihEPXQpLCFkJiZpKXtjb25zdHttaW5pbXVtU3RhcnRUaW1lOmMsb3ZlcmFsbEdyYXBoV2lkdGg6YSxpbml0aWFsT3ZlcmFsbFRpbWVTcGFuOnV9PWk7ZD1MKHttaW5pbXVtU3RhcnRUaW1lOmMsb3ZlcmFsbEdyYXBoV2lkdGg6YSxpbml0aWFsT3ZlcmFsbFRpbWVTcGFuOnV9KX1jb25zdCByPUpTT04ucGFyc2Uobik7ZCYmKGV8fG0hPT1yKSYmKG09cixhd2FpdCBYKCkscG9zdE1lc3NhZ2Uoe2xheW91dDpzfSkpfTthc3luYyBmdW5jdGlvbiBYKCl7dz09PSJ3YXRlcmZhbGwiJiZQKCksdz09PSJuZWFyZXN0UGFyZW50IiYmYXdhaXQgQygpfWZ1bmN0aW9uIFAoKXttLmZvckVhY2goKGUsbik9PntzW2UuaWRdPXtwb3NpdGlvbjpuLHN0YXJ0WDowLGVuZFg6MH19KX1hc3luYyBmdW5jdGlvbiBDKCl7Zm9yIGF3YWl0KGNvbnN0IGUgb2YgbSl7Y29uc3Qgbj1kLmRhdGVUb1goZS5lbmQ/bmV3IERhdGUoZS5lbmQpOm5ldyBEYXRlKSx0PWUubGFiZWwubGVuZ3RoKkQsbz1uK3Q7aWYoZS5pZCBpbiBzKXtzW2UuaWRdLmVuZFg9bztjb250aW51ZX1jb25zdCBpPWUuaWQgaW4gcz9zW2UuaWRdLnN0YXJ0WDpkLmRhdGVUb1gobmV3IERhdGUoZS5zdGFydCkpLHI9YXdhaXQgTyhlLGkpO3NbZS5pZF09e3Bvc2l0aW9uOnIsc3RhcnRYOmksZW5kWDpvfX19YXN5bmMgZnVuY3Rpb24gTyhlLG4pe2lmKGUudXBzdHJlYW1EZXBlbmRlbmNpZXMmJmUudXBzdHJlYW1EZXBlbmRlbmNpZXMubGVuZ3RoPT09MSl7aWYoZS51cHN0cmVhbURlcGVuZGVuY2llc1swXWluIHMpe2NvbnN0IHQ9c1tlLnVwc3RyZWFtRGVwZW5kZW5jaWVzWzBdXTtyZXR1cm4gYXdhaXQgaCh0LG4pfXJldHVybiBjb25zb2xlLndhcm4oInRpbWVsaW5lTm9kZXMgbGF5b3V0IHdvcmtlcjogUGFyZW50IG5vZGUgbm90IGZvdW5kIGluIGxheW91dCIsZS51cHN0cmVhbURlcGVuZGVuY2llc1swXSksZ31pZihlLnVwc3RyZWFtRGVwZW5kZW5jaWVzJiZlLnVwc3RyZWFtRGVwZW5kZW5jaWVzLmxlbmd0aD4wKXtjb25zdCBvPWUudXBzdHJlYW1EZXBlbmRlbmNpZXMubWFwKGE9PnNbYV0pLmZpbHRlcihhPT4hIWEpLm1hcChhPT5hLnBvc2l0aW9uKSxyPW8ucmVkdWNlKChhLHUpPT5hK3UsMCkvby5sZW5ndGgsYz1NYXRoLnJvdW5kKHIpO2lmKHkobixjKSl7Y29uc3QgYT1JKG4sYyksdT1hLmZpbHRlcihwPT57dmFyIGY7cmV0dXJuKGY9ZS51cHN0cmVhbURlcGVuZGVuY2llcyk9PW51bGw/dm9pZCAwOmYuaW5jbHVkZXMocCl9KTtpZih1Lmxlbmd0aD4wfHxhLmxlbmd0aD4xKXtjb25zdFtwXT11Lmxlbmd0aD4wP3U6YSxmPXNbcF07cmV0dXJuIGYubmV4dERlcGVuZGVuY3lTaG92ZT1BKG8sYyxmLm5leHREZXBlbmRlbmN5U2hvdmUpLGF3YWl0IGgoZixuKX1yZXR1cm4gYXdhaXQgYih7Y29tcGV0aW5nTGF5b3V0SXRlbUlkOmFbMF0sdXBzdHJlYW1Qb3NpdGlvbnM6byxub2RlU3RhcnRYOm4sZGVzaXJlZFBvc2l0aW9uOmN9KX19cmV0dXJuIE4obixnKX1mdW5jdGlvbiBOKGUsbil7cmV0dXJuIHkoZSxuKT9OKGUsbisxKTpufWFzeW5jIGZ1bmN0aW9uIGgoZSxuKXtlLm5leHREZXBlbmRlbmN5U2hvdmUhPT0xJiZlLm5leHREZXBlbmRlbmN5U2hvdmUhPT0tMSYmKGUubmV4dERlcGVuZGVuY3lTaG92ZT0xKTtjb25zdHtwb3NpdGlvbjp0LG5leHREZXBlbmRlbmN5U2hvdmU6b309ZTtyZXR1cm4geShuLHQpP289PT0xJiYheShuLHQrMSk/KGUubmV4dERlcGVuZGVuY3lTaG92ZT0tMSx0KzEpOnkobix0LTEpPyhhd2FpdCBsKHtkaXJlY3Rpb246byxub2RlU3RhcnRYOm4sZGVzaXJlZFBvc2l0aW9uOnQrb30pLGUubmV4dERlcGVuZGVuY3lTaG92ZT1vPT09MT8tMToxLHQrbyk6KGUubmV4dERlcGVuZGVuY3lTaG92ZT0xLHQtMSk6dH1mdW5jdGlvbiB5KGUsbil7Y29uc3QgdD1PYmplY3Qua2V5cyhzKTtyZXR1cm4gdC5sZW5ndGg+MCYmdC5zb21lKG89Pntjb25zdCBpPXNbb107cmV0dXJuIHgoe2ZpcnN0Tm9kZUVuZFg6aS5lbmRYLGZpcnN0Tm9kZVBvc2l0aW9uOmkucG9zaXRpb24sbGFzdE5vZGVTdGFydFg6ZSxsYXN0Tm9kZVBvc2l0aW9uOm59KX0pfWFzeW5jIGZ1bmN0aW9uIGwoe2RpcmVjdGlvbjplLG5vZGVTdGFydFg6bixkZXNpcmVkUG9zaXRpb246dH0pe2NvbnN0IG89SShuLHQpO2lmKG8pZm9yIGF3YWl0KGNvbnN0IGkgb2Ygbyl7Y29uc3Qgcj1zW2ldLGM9ci5wb3NpdGlvbitlO2F3YWl0IGwoe2RpcmVjdGlvbjplLG5vZGVTdGFydFg6ci5zdGFydFgsZGVzaXJlZFBvc2l0aW9uOmN9KSxyLnBvc2l0aW9uPWN9fWZ1bmN0aW9uIHgoe2ZpcnN0Tm9kZUVuZFg6ZSxmaXJzdE5vZGVQb3NpdGlvbjpuLGxhc3ROb2RlU3RhcnRYOnQsbGFzdE5vZGVQb3NpdGlvbjpvfSl7cmV0dXJuIG49PT1vJiZlK3Y+PXR9ZnVuY3Rpb24gSShlLG4pe2NvbnN0IHQ9W107aWYoT2JqZWN0LmtleXMocykuZm9yRWFjaChvPT57Y29uc3QgaT1zW29dO3goe2ZpcnN0Tm9kZUVuZFg6aS5lbmRYLGZpcnN0Tm9kZVBvc2l0aW9uOmkucG9zaXRpb24sbGFzdE5vZGVTdGFydFg6ZSxsYXN0Tm9kZVBvc2l0aW9uOm59KSYmdC5wdXNoKG8pfSksdC5sZW5ndGghPT0wKXJldHVybiB0LnNvcnQoKG8saSk9Pntjb25zdCByPXNbb10sYz1zW2ldO3JldHVybiByLmVuZFg8Yy5lbmRYPzE6ci5lbmRYPmMuZW5kWD8tMTowfSksdH1mdW5jdGlvbiBBKGUsbix0KXtjb25zdCBvPWUuZmlsdGVyKHI9PnI8bikubGVuZ3RoLGk9ZS5maWx0ZXIocj0+cj5uKS5sZW5ndGg7cmV0dXJuIG8+aT8tMTp0Pz8xfWFzeW5jIGZ1bmN0aW9uIGIoe2Rlc2lyZWRQb3NpdGlvbjplLG5vZGVTdGFydFg6bix1cHN0cmVhbVBvc2l0aW9uczp0LGNvbXBldGluZ0xheW91dEl0ZW1JZDpvfSl7Y29uc3QgaT1zW29dLFtyLGNdPWsobyksYT10LmZpbHRlcihwPT5wPGUpLmxlbmd0aCx1PXQuZmlsdGVyKHA9PnA+ZSkubGVuZ3RoO2lmKGE+dSl7aWYocj5jJiZyPmEpcmV0dXJuIGF3YWl0IGwoe2RpcmVjdGlvbjotMSxub2RlU3RhcnRYOm4sZGVzaXJlZFBvc2l0aW9uOmV9KSxlO2lmKGM+cilyZXR1cm4gYXdhaXQgbCh7ZGlyZWN0aW9uOjEsbm9kZVN0YXJ0WDpuLGRlc2lyZWRQb3NpdGlvbjplfSksZTtpLm5leHREZXBlbmRlbmN5U2hvdmU9LTF9aWYodT5hKXtpZihjPnImJmM+dSlyZXR1cm4gYXdhaXQgbCh7ZGlyZWN0aW9uOjEsbm9kZVN0YXJ0WDpuLGRlc2lyZWRQb3NpdGlvbjplfSksZTtpZihyPmMpcmV0dXJuIGF3YWl0IGwoe2RpcmVjdGlvbjotMSxub2RlU3RhcnRYOm4sZGVzaXJlZFBvc2l0aW9uOmV9KSxlO2kubmV4dERlcGVuZGVuY3lTaG92ZT0xfXJldHVybiBhd2FpdCBoKGksbil9ZnVuY3Rpb24gayhlKXt2YXIgbztjb25zdCBuPW0uZmluZChpPT5pLmlkPT09ZSksdD1zW2VdO3JldHVybigobz1uLnVwc3RyZWFtRGVwZW5kZW5jaWVzKT09bnVsbD92b2lkIDA6by5yZWR1Y2UoKGkscik9PntpZihlIGluIHMpe2NvbnN0IGM9c1tyXTtyZXR1cm4gYy5wb3NpdGlvbjx0LnBvc2l0aW9uJiYoaVswXSs9MSksYy5wb3NpdGlvbj50LnBvc2l0aW9uJiYoaVsxXSs9MSksaX1yZXR1cm4gY29uc29sZS53YXJuKCJub2RlTGF5b3V0Lndvcmtlci50czogUGFyZW50IG5vZGUgbm90IGZvdW5kIG9uIGxheW91dCBkYXRhIixlKSxpfSxbMCwwXSkpPz9bMCwwXX19KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1ub2RlTGF5b3V0Lndvcmtlci03MzM0Mjk3Yi5qcy5tYXAKLy8jIHNvdXJjZU1hcHBpbmdVUkw9YXNzZXRzL25vZGVMYXlvdXQud29ya2VyLTczMzQyOTdiLmpzLm1hcA==",sf=typeof window<"u"&&window.Blob&&new Blob([atob(nf)],{type:"text/javascript;charset=utf-8"});function cx(){const r=sf&&(window.URL||window.webkitURL).createObjectURL(sf);try{return r?new Worker(r):new Worker("data:application/javascript;base64,"+nf)}finally{r&&(window.URL||window.webkitURL).revokeObjectURL(r)}}class dx extends yt{constructor({appRef:t,viewportRef:i,graphData:n,styles:s,styleNode:a,layoutSetting:o,hideEdges:h,timeScaleProps:{minimumStartTime:u,overallGraphWidth:l,initialOverallTimeSpan:f}}){super();B(this,"appRef");B(this,"viewportRef");B(this,"graphData");B(this,"styles");B(this,"styleNode");B(this,"nodeContainer",new yt);B(this,"nodeRecords",new Map);B(this,"selectedNodeId",null);B(this,"layoutSetting");B(this,"hideEdges");B(this,"layoutWorker",new cx);B(this,"layout",{});B(this,"edgeContainer",new yt);B(this,"edgeRecords",[]);this.appRef=t,this.viewportRef=i,this.graphData=n,this.styles=s,this.styleNode=a,this.layoutSetting=o,this.hideEdges=h,this.initDeselectLayer(),this.initLayoutWorker({minimumStartTime:u,overallGraphWidth:l,initialOverallTimeSpan:f})}async initLayoutWorker({minimumStartTime:t,overallGraphWidth:i,initialOverallTimeSpan:n}){const s=await Wn(this.styles.value),{spacingMinimumNodeEdgeGap:a}=this.styles.value,o=se.measureText("M",s.nodeTextStyles).width,h={data:{timeScaleProps:{minimumStartTime:t,overallGraphWidth:i,initialOverallTimeSpan:n},spacingMinimumNodeEdgeGap:a,apxCharacterWidth:o,graphData:JSON.stringify(this.graphData),layoutSetting:this.layoutSetting}};this.layoutWorker.onmessage=u=>{this.layout=u.data.layout,this.renderLayout()},this.layoutWorker.postMessage(h.data)}initDeselectLayer(){const t=new Ly(this.appRef,this.viewportRef);this.addChild(t),t.on("click",()=>{this.emit("node-click",null)})}renderLayout(){const t=this.nodeRecords.size===0;Object.keys(this.layout).forEach(i=>{if(this.nodeRecords.has(i)){const n=this.nodeRecords.get(i);this.updateNodeRecordAndEdgesLayout(i,n)}else this.createNode(this.graphData.find(n=>n.id===i))}),t&&(this.addChild(this.edgeContainer),this.addChild(this.nodeContainer),this.fitNodesInViewport())}async updateNodeRecordAndEdgesLayout(t,i){const n=this.graphData.find(a=>a.id===t);if(i.layoutPosition===this.layout[t].position){i.update(n);return}i.layoutPosition=this.layout[t].position;const s=this.edgeRecords.filter(a=>a.sourceId===t||a.targetId===t);s.forEach(a=>{a.edge.visible=!1}),await i.update(n),s.forEach(a=>{a.edge.update(),a.edge.visible=!0})}createNode(t){const{appRef:i,styles:n,styleNode:s}=this,a=new fx({appRef:i,nodeData:t,styles:n,styleNode:s,layoutPosition:this.layout[t.id].position});a.on("click",()=>{this.emit("node-click",t.id)}),this.nodeRecords.set(t.id,a),this.addNodeEdges(t),this.nodeContainer.addChild(a)}fitNodesInViewport(){const{spacingViewportPaddingDefault:t}=this.styles.value,{x:i,y:n,width:s,height:a}=this.nodeContainer.getBounds();this.viewportRef.ensureVisible(i-t,n-t,s+t*2,a+t*2,!0),this.viewportRef.moveCenter(i+s/2,n+a/2)}addNodeEdges(t){t.upstreamDependencies&&t.upstreamDependencies.forEach(i=>{const n=this.nodeRecords.get(i),s=this.nodeRecords.get(t.id);if(!n||!s){console.warn("timelineNodes: could not find source or target node for edge, skipping");return}const a=new Wy({appRef:this.appRef,styles:this.styles,sourceNode:n,targetNode:s});this.hideEdges&&(a.renderable=!1),this.edgeRecords.push({edge:a,sourceId:i,targetId:t.id}),this.edgeContainer.addChild(a)})}update(t){if(t){this.graphData=t;const i={data:{graphData:JSON.stringify(this.graphData)}};this.layoutWorker.postMessage(i.data);return}this.nodeRecords.forEach(i=>i.update())}updateSelection(t){var n;if(this.unHighlightAll(),!t&&this.selectedNodeId){this.clearNodeSelection();return}const i=this.selectedNodeId;i&&((n=this.nodeRecords.get(i))==null||n.deselect()),this.setNodeSelection(t??null)}updateHideEdges(t){if(this.hideEdges=t,this.edgeRecords.forEach(({edge:i})=>i.renderable=!this.hideEdges),!this.hideEdges){this.viewportRef.dirty=!0,this.viewportRef.updateTransform();return}if(this.selectedNodeId){const i=this.nodeRecords.get(this.selectedNodeId);this.highlightSelectedNodePath(this.selectedNodeId,i)}}updateLayoutSetting(t){this.layoutSetting=t;const i={data:{graphData:JSON.stringify(this.graphData),layoutSetting:t}};this.layoutWorker.postMessage(i.data)}clearNodeSelection(){this.nodeRecords.get(this.selectedNodeId).deselect();const t=this.nodeRecords.get(this.selectedNodeId);this.centerViewportAfterOutsideAnimation(t),this.selectedNodeId=null}setNodeSelection(t){if(this.selectedNodeId=t,!this.selectedNodeId)return;const i=this.nodeRecords.get(this.selectedNodeId);i.select(),this.highlightSelectedNodePath(this.selectedNodeId,i),this.centerViewportAfterOutsideAnimation(i)}centerViewportAfterOutsideAnimation(t){setTimeout(()=>{const i=t.x+t.width/2,n=t.y+t.height/2;this.viewportRef.animate({position:{x:i,y:n},time:1e3,ease:"easeInOutQuad",removeOnInterrupt:!0})},100)}highlightSelectedNodePath(t,i){const{alphaNodeDimmed:n}=this.styles.value,s=[...this.getAllUpstreamEdges(t),...this.getAllDownstreamEdges(t)],a=new Map;a.set(t,i),this.edgeRecords.forEach(o=>{if(s.includes(o)){const h=this.nodeRecords.get(o.sourceId),u=this.nodeRecords.get(o.targetId);a.set(o.sourceId,h),a.set(o.targetId,u),o.edge.renderable=!0;return}o.edge.alpha=n}),this.nodeRecords.forEach((o,h)=>{a.has(h)||(o.alpha=n)})}unHighlightAll(){this.edgeRecords.forEach(({edge:t})=>{this.hideEdges&&(t.renderable=!1),t.alpha=1}),this.nodeRecords.forEach(t=>{t.alpha=1})}getAllUpstreamEdges(t){var s;const i=[],n=this.graphData.find(a=>a.id===t);return(s=n==null?void 0:n.upstreamDependencies)==null||s.forEach(a=>{const o=this.edgeRecords.find(h=>h.sourceId===a&&h.targetId===t);if(o){i.push(o);const h=this.getAllUpstreamEdges(a);i.push(...h)}}),i}getAllDownstreamEdges(t){const i=[];return this.graphData.forEach(n=>{var s;if((s=n.upstreamDependencies)!=null&&s.includes(t)){const a=this.edgeRecords.find(o=>o.targetId===n.id&&o.sourceId===t);if(a){i.push(a);const o=this.getAllDownstreamEdges(n.id);i.push(...o)}}}),i}destroy(){this.removeChildren(),this.nodeRecords.forEach(t=>t.destroy()),this.nodeRecords.clear(),this.edgeRecords.forEach(t=>t.edge.destroy()),this.layoutWorker.terminate(),this.layoutWorker.onmessage=null,ky(),super.destroy.call(this)}}class px extends yt{constructor({viewportRef:t,appRef:i,formatDateFns:n,styles:s}){super();B(this,"viewportRef");B(this,"appRef");B(this,"formatDateFns");B(this,"styles");B(this,"unwatch");B(this,"playhead",new ne);B(this,"label");this.viewportRef=t,this.appRef=i,this.formatDateFns=n,this.styles=s,this.drawPlayhead(),this.drawTimeLabel(),this.unwatch=J.watch(s,()=>{this.playhead.clear(),this.drawPlayhead()},{deep:!0}),this.interactive=!1}drawPlayhead(){const{colorPlayheadBg:t,spacingPlayheadWidth:i,spacingPlayheadGlowPadding:n}=this.styles.value;this.playhead.beginFill(t,.1),this.playhead.drawRect(0,0,i+n*2,this.appRef.screen.height),this.playhead.endFill(),this.playhead.beginFill(t),this.playhead.drawRect(n,0,i,this.appRef.screen.height),this.playhead.endFill(),this.addChild(this.playhead)}async drawTimeLabel(){const{spacingGuideLabelPadding:t,spacingPlayheadGlowPadding:i}=this.styles.value,n=await Wn(this.styles.value),{timeBySeconds:s}=this.formatDateFns.value,a=s(new Date);this.label=new kn(a,n.playheadTimerLabel),this.label.x=-this.label.width-(i+t),this.label.y=this.appRef.screen.height-(this.label.height+t),this.addChild(this.label),setInterval(()=>{const o=new Date;this.label.text=s(o)},1e3)}updatePosition(){const{spacingPlayheadWidth:t,spacingPlayheadGlowPadding:i}=this.styles.value;this.position.x=ae.dateToX(new Date)*this.viewportRef.scale._x+this.viewportRef.worldTransform.tx-i-t/2,this.playhead.height!==this.appRef.screen.height&&(this.playhead.height=this.appRef.screen.height)}destroy(){this.unwatch(),this.playhead.destroy(),super.destroy.call(this)}}const vx=J.defineComponent({__name:"FlowRunTimeline",props:{graphData:null,isRunning:{type:Boolean},theme:null,formatDateFns:null,selectedNodeId:null,layout:null,hideEdges:{type:Boolean}},emits:["click"],setup(r,{emit:e}){const t=r,i=J.ref(),n=J.computed(()=>{var R;return((R=t.theme)==null?void 0:R.node)??Mo}),s=J.computed(()=>{var R;return Bf((R=t.theme)==null?void 0:R.defaults)}),a=J.ref(!1),o=J.computed(()=>({...Io,...t.formatDateFns})),h={timelineGuides:0,viewport:10,playhead:20},u=J.ref(!0);let l,f;const c=new Cf;let d=!1,v;const p=J.ref();let _,m,g,y,b,x=null,T;J.onMounted(async()=>{if(!i.value){console.error("Stage reference not found in initPixiApp");return}E(),l=By(i.value),l.stage.sortableChildren=!0,f=await Uy(i.value,l),f.zIndex=h.viewport,S(),P(),N(),A(),O(),U(),u.value=!1}),J.onBeforeUnmount(()=>{w()});function w(){y.destroy(),b==null||b.destroy(),T.destroy(),f.destroy(),l.destroy(!0)}function S(){f.on("drag-start",()=>{a.value=!0}).on("drag-end",()=>{a.value=!1})}function E(){const F=t.graphData.filter(C=>C.end).map(({start:C,end:G})=>({start:C,end:G}));t.isRunning===!0&&F.push({start:new Date,end:new Date});const{min:V,max:H,span:I}=Ff(F,6e4);v=V,p.value=H,_=I,m=i.value.clientWidth*2,g=Yy({minimumStartTime:v.getTime(),overallGraphWidth:m,initialOverallTimeSpan:_})}function P(){Ny(s.value),J.watch(s,R=>{Fy(R)})}function O(){t.isRunning&&(b=new px({viewportRef:f,appRef:l,formatDateFns:o,styles:s}),b.zIndex=h.playhead,l.stage.addChild(b),D())}function D(){x||(x=()=>{if(t.isRunning&&b){const R=b.position.x>0&&b.position.x<l.screen.width;if(p.value=new Date,b.updatePosition(),!f.moving&&R&&b.position.x>l.screen.width-s.value.spacingViewportPaddingDefault){const F=g.xToDate(f.left);f.zoomPercent(-.1,!0),f.left=g.dateToX(new Date(F))}}else b!=null&&b.destroyed||b==null||b.destroy()},l.ticker.add(x))}J.watch(()=>t.isRunning,R=>{u.value||(R&&(!b||b.destroyed)&&O(),!R&&b&&x&&(b.destroy(),l.ticker.remove(x),x=null))});function N(){y=new Ky({viewportRef:f,appRef:l,minimumStartDate:v,maximumEndDate:p,isRunning:t.isRunning??!1,styles:s,formatDateFns:o}),y.zIndex=h.timelineGuides,l.stage.addChild(y),l.ticker.add(()=>{y.updateGuides()})}function U(){c.addAll(f.children),f.on("frame-end",()=>{(f.dirty||d)&&(c.cull(l.renderer.screen),f.dirty=!1,d=!1)})}function A(){T=new dx({appRef:l,viewportRef:f,graphData:t.graphData,styles:s,styleNode:n,layoutSetting:t.layout??"nearestParent",hideEdges:t.hideEdges??!1,timeScaleProps:{minimumStartTime:v.getTime(),overallGraphWidth:m,initialOverallTimeSpan:_}}),f.addChild(T),t.isRunning&&l.ticker.add(()=>{t.isRunning&&T.update()}),T.on("node-click",R=>{a.value||e("click",R)}),J.watch(()=>t.graphData,R=>{T.update(R),d=!0}),J.watch(()=>t.selectedNodeId,R=>{T.updateSelection(R)}),J.watch(()=>t.hideEdges,R=>{T.updateHideEdges(R??!1)}),J.watch(()=>t.layout,R=>{T.updateLayoutSetting(R??"nearestParent")})}return(R,F)=>(J.openBlock(),J.createElementBlock("div",{ref_key:"stage",ref:i,class:"flow-run-timeline"},null,512))}}),Vx="";class ie{constructor(e){this.parent=e,this.paused=!1}destroy(){}down(e){return!1}move(e){return!1}up(e){return!1}wheel(e){return!1}update(e){}resize(){}reset(){}pause(){this.paused=!0}resume(){this.paused=!1}}var _x=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function mx(r,e,t){return t={path:e,exports:{},require:function(i,n){return gx(i,n??t.path)}},r(t,t.exports),t.exports}function gx(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var af=mx(function(r,e){(function(){var t,i;i=function(n){return r.exports=n},t={linear:function(n,s,a,o){return a*n/o+s},easeInQuad:function(n,s,a,o){return a*(n/=o)*n+s},easeOutQuad:function(n,s,a,o){return-a*(n/=o)*(n-2)+s},easeInOutQuad:function(n,s,a,o){return(n/=o/2)<1?a/2*n*n+s:-a/2*(--n*(n-2)-1)+s},easeInCubic:function(n,s,a,o){return a*(n/=o)*n*n+s},easeOutCubic:function(n,s,a,o){return a*((n=n/o-1)*n*n+1)+s},easeInOutCubic:function(n,s,a,o){return(n/=o/2)<1?a/2*n*n*n+s:a/2*((n-=2)*n*n+2)+s},easeInQuart:function(n,s,a,o){return a*(n/=o)*n*n*n+s},easeOutQuart:function(n,s,a,o){return-a*((n=n/o-1)*n*n*n-1)+s},easeInOutQuart:function(n,s,a,o){return(n/=o/2)<1?a/2*n*n*n*n+s:-a/2*((n-=2)*n*n*n-2)+s},easeInQuint:function(n,s,a,o){return a*(n/=o)*n*n*n*n+s},easeOutQuint:function(n,s,a,o){return a*((n=n/o-1)*n*n*n*n+1)+s},easeInOutQuint:function(n,s,a,o){return(n/=o/2)<1?a/2*n*n*n*n*n+s:a/2*((n-=2)*n*n*n*n+2)+s},easeInSine:function(n,s,a,o){return-a*Math.cos(n/o*(Math.PI/2))+a+s},easeOutSine:function(n,s,a,o){return a*Math.sin(n/o*(Math.PI/2))+s},easeInOutSine:function(n,s,a,o){return-a/2*(Math.cos(Math.PI*n/o)-1)+s},easeInExpo:function(n,s,a,o){return n===0?s:a*Math.pow(2,10*(n/o-1))+s},easeOutExpo:function(n,s,a,o){return n===o?s+a:a*(-Math.pow(2,-10*n/o)+1)+s},easeInOutExpo:function(n,s,a,o){return(n/=o/2)<1?a/2*Math.pow(2,10*(n-1))+s:a/2*(-Math.pow(2,-10*--n)+2)+s},easeInCirc:function(n,s,a,o){return-a*(Math.sqrt(1-(n/=o)*n)-1)+s},easeOutCirc:function(n,s,a,o){return a*Math.sqrt(1-(n=n/o-1)*n)+s},easeInOutCirc:function(n,s,a,o){return(n/=o/2)<1?-a/2*(Math.sqrt(1-n*n)-1)+s:a/2*(Math.sqrt(1-(n-=2)*n)+1)+s},easeInElastic:function(n,s,a,o){var h,u,l;return l=1.70158,u=0,h=a,n===0||(n/=o),u||(u=o*.3),h<Math.abs(a)?(h=a,l=u/4):l=u/(2*Math.PI)*Math.asin(a/h),-(h*Math.pow(2,10*(n-=1))*Math.sin((n*o-l)*(2*Math.PI)/u))+s},easeOutElastic:function(n,s,a,o){var h,u,l;return l=1.70158,u=0,h=a,n===0||(n/=o),u||(u=o*.3),h<Math.abs(a)?(h=a,l=u/4):l=u/(2*Math.PI)*Math.asin(a/h),h*Math.pow(2,-10*n)*Math.sin((n*o-l)*(2*Math.PI)/u)+a+s},easeInOutElastic:function(n,s,a,o){var h,u,l;return l=1.70158,u=0,h=a,n===0||(n/=o/2),u||(u=o*(.3*1.5)),h<Math.abs(a)?(h=a,l=u/4):l=u/(2*Math.PI)*Math.asin(a/h),n<1?-.5*(h*Math.pow(2,10*(n-=1))*Math.sin((n*o-l)*(2*Math.PI)/u))+s:h*Math.pow(2,-10*(n-=1))*Math.sin((n*o-l)*(2*Math.PI)/u)*.5+a+s},easeInBack:function(n,s,a,o,h){return h===void 0&&(h=1.70158),a*(n/=o)*n*((h+1)*n-h)+s},easeOutBack:function(n,s,a,o,h){return h===void 0&&(h=1.70158),a*((n=n/o-1)*n*((h+1)*n+h)+1)+s},easeInOutBack:function(n,s,a,o,h){return h===void 0&&(h=1.70158),(n/=o/2)<1?a/2*(n*n*(((h*=1.525)+1)*n-h))+s:a/2*((n-=2)*n*(((h*=1.525)+1)*n+h)+2)+s},easeInBounce:function(n,s,a,o){var h;return h=t.easeOutBounce(o-n,0,a,o),a-h+s},easeOutBounce:function(n,s,a,o){return(n/=o)<1/2.75?a*(7.5625*n*n)+s:n<2/2.75?a*(7.5625*(n-=1.5/2.75)*n+.75)+s:n<2.5/2.75?a*(7.5625*(n-=2.25/2.75)*n+.9375)+s:a*(7.5625*(n-=2.625/2.75)*n+.984375)+s},easeInOutBounce:function(n,s,a,o){var h;return n<o/2?(h=t.easeInBounce(n*2,0,a,o),h*.5+s):(h=t.easeOutBounce(n*2-o,0,a,o),h*.5+a*.5+s)}},i(t)}).call(_x)});function as(r,e){if(r){if(typeof r=="function")return r;if(typeof r=="string")return af[r]}else return af[e]}const yx={removeOnInterrupt:!1,ease:"linear",time:1e3};class Fe extends ie{__init(){this.startWidth=null}__init2(){this.startHeight=null}__init3(){this.deltaWidth=null}__init4(){this.deltaHeight=null}__init5(){this.width=null}__init6(){this.height=null}__init7(){this.time=0}constructor(e,t={}){super(e),Fe.prototype.__init.call(this),Fe.prototype.__init2.call(this),Fe.prototype.__init3.call(this),Fe.prototype.__init4.call(this),Fe.prototype.__init5.call(this),Fe.prototype.__init6.call(this),Fe.prototype.__init7.call(this),this.options=Object.assign({},yx,t),this.options.ease=as(this.options.ease),this.setupPosition(),this.setupZoom(),this.time=0}setupPosition(){typeof this.options.position<"u"?(this.startX=this.parent.center.x,this.startY=this.parent.center.y,this.deltaX=this.options.position.x-this.parent.center.x,this.deltaY=this.options.position.y-this.parent.center.y,this.keepCenter=!1):this.keepCenter=!0}setupZoom(){this.width=null,this.height=null,typeof this.options.scale<"u"?this.width=this.parent.screenWidth/this.options.scale:typeof this.options.scaleX<"u"||typeof this.options.scaleY<"u"?(typeof this.options.scaleX<"u"&&(this.width=this.parent.screenWidth/this.options.scaleX),typeof this.options.scaleY<"u"&&(this.height=this.parent.screenHeight/this.options.scaleY)):(typeof this.options.width<"u"&&(this.width=this.options.width),typeof this.options.height<"u"&&(this.height=this.options.height)),this.width!==null&&(this.startWidth=this.parent.screenWidthInWorldPixels,this.deltaWidth=this.width-this.startWidth),this.height!==null&&(this.startHeight=this.parent.screenHeightInWorldPixels,this.deltaHeight=this.height-this.startHeight)}down(){return this.options.removeOnInterrupt&&this.parent.plugins.remove("animate"),!1}complete(){this.parent.plugins.remove("animate"),this.width!==null&&this.parent.fitWidth(this.width,this.keepCenter,this.height===null),this.height!==null&&this.parent.fitHeight(this.height,this.keepCenter,this.width===null),!this.keepCenter&&this.options.position&&this.parent.moveCenter(this.options.position),this.parent.emit("animate-end",this.parent),this.options.callbackOnComplete&&this.options.callbackOnComplete(this.parent)}update(e){if(this.paused)return;this.time+=e;const t=new j(this.parent.scale.x,this.parent.scale.y);if(this.time>=this.options.time){const i=this.parent.width,n=this.parent.height;this.complete(),(i!==this.parent.width||n!==this.parent.height)&&this.parent.emit("zoomed",{viewport:this.parent,original:t,type:"animate"})}else{const i=this.options.ease(this.time,0,1,this.options.time);if(this.width!==null){const n=this.startWidth,s=this.deltaWidth;this.parent.fitWidth(n+s*i,this.keepCenter,this.height===null)}if(this.height!==null){const n=this.startHeight,s=this.deltaHeight;this.parent.fitHeight(n+s*i,this.keepCenter,this.width===null)}if(this.width===null?this.parent.scale.x=this.parent.scale.y:this.height===null&&(this.parent.scale.y=this.parent.scale.x),!this.keepCenter){const n=this.startX,s=this.startY,a=this.deltaX,o=this.deltaY,h=new j(this.parent.x,this.parent.y);this.parent.moveCenter(n+a*i,s+o*i),this.parent.emit("moved",{viewport:this.parent,original:h,type:"animate"})}(this.width||this.height)&&this.parent.emit("zoomed",{viewport:this.parent,original:t,type:"animate"})}}}function os(r){let e,t=r[0],i=1;for(;i<r.length;){const n=r[i],s=r[i+1];if(i+=2,(n==="optionalAccess"||n==="optionalCall")&&t==null)return;n==="access"||n==="optionalAccess"?(e=t,t=s(t)):(n==="call"||n==="optionalCall")&&(t=s((...a)=>t.call(e,...a)),e=void 0)}return t}const xx={sides:"all",friction:.5,time:150,ease:"easeInOutSine",underflow:"center",bounceBox:null};class of extends ie{constructor(e,t={}){super(e),this.options=Object.assign({},xx,t),this.ease=as(this.options.ease,"easeInOutSine"),this.options.sides?this.options.sides==="all"?this.top=this.bottom=this.left=this.right=!0:this.options.sides==="horizontal"?(this.right=this.left=!0,this.top=this.bottom=!1):this.options.sides==="vertical"?(this.left=this.right=!1,this.top=this.bottom=!0):(this.top=this.options.sides.indexOf("top")!==-1,this.bottom=this.options.sides.indexOf("bottom")!==-1,this.left=this.options.sides.indexOf("left")!==-1,this.right=this.options.sides.indexOf("right")!==-1):this.left=this.top=this.right=this.bottom=!1;const i=this.options.underflow.toLowerCase();i==="center"?(this.underflowX=0,this.underflowY=0):(this.underflowX=i.indexOf("left")!==-1?-1:i.indexOf("right")!==-1?1:0,this.underflowY=i.indexOf("top")!==-1?-1:i.indexOf("bottom")!==-1?1:0),this.reset()}isActive(){return this.toX!==null||this.toY!==null}down(){return this.toX=this.toY=null,!1}up(){return this.bounce(),!1}update(e){if(!this.paused){if(this.bounce(),this.toX){const t=this.toX;t.time+=e,this.parent.emit("moved",{viewport:this.parent,type:"bounce-x"}),t.time>=this.options.time?(this.parent.x=t.end,this.toX=null,this.parent.emit("bounce-x-end",this.parent)):this.parent.x=this.ease(t.time,t.start,t.delta,this.options.time)}if(this.toY){const t=this.toY;t.time+=e,this.parent.emit("moved",{viewport:this.parent,type:"bounce-y"}),t.time>=this.options.time?(this.parent.y=t.end,this.toY=null,this.parent.emit("bounce-y-end",this.parent)):this.parent.y=this.ease(t.time,t.start,t.delta,this.options.time)}}}calcUnderflowX(){let e;switch(this.underflowX){case-1:e=0;break;case 1:e=this.parent.screenWidth-this.parent.screenWorldWidth;break;default:e=(this.parent.screenWidth-this.parent.screenWorldWidth)/2}return e}calcUnderflowY(){let e;switch(this.underflowY){case-1:e=0;break;case 1:e=this.parent.screenHeight-this.parent.screenWorldHeight;break;default:e=(this.parent.screenHeight-this.parent.screenWorldHeight)/2}return e}oob(){const e=this.options.bounceBox;if(e){const t=typeof e.x>"u"?0:e.x,i=typeof e.y>"u"?0:e.y,n=typeof e.width>"u"?this.parent.worldWidth:e.width,s=typeof e.height>"u"?this.parent.worldHeight:e.height;return{left:this.parent.left<t,right:this.parent.right>n,top:this.parent.top<i,bottom:this.parent.bottom>s,topLeft:new j(t*this.parent.scale.x,i*this.parent.scale.y),bottomRight:new j(n*this.parent.scale.x-this.parent.screenWidth,s*this.parent.scale.y-this.parent.screenHeight)}}return{left:this.parent.left<0,right:this.parent.right>this.parent.worldWidth,top:this.parent.top<0,bottom:this.parent.bottom>this.parent.worldHeight,topLeft:new j(0,0),bottomRight:new j(this.parent.worldWidth*this.parent.scale.x-this.parent.screenWidth,this.parent.worldHeight*this.parent.scale.y-this.parent.screenHeight)}}bounce(){if(this.paused)return;let e,t=this.parent.plugins.get("decelerate",!0);t&&(t.x||t.y)&&(t.x&&t.percentChangeX===os([t,"access",s=>s.options,"optionalAccess",s=>s.friction])||t.y&&t.percentChangeY===os([t,"access",s=>s.options,"optionalAccess",s=>s.friction]))&&(e=this.oob(),(e.left&&this.left||e.right&&this.right)&&(t.percentChangeX=this.options.friction),(e.top&&this.top||e.bottom&&this.bottom)&&(t.percentChangeY=this.options.friction));const i=this.parent.plugins.get("drag",!0)||{},n=this.parent.plugins.get("pinch",!0)||{};if(t=t||{},!os([i,"optionalAccess",s=>s.active])&&!os([n,"optionalAccess",s=>s.active])&&(!this.toX||!this.toY)&&(!t.x||!t.y)){e=e||this.oob();const s=e.topLeft,a=e.bottomRight;if(!this.toX&&!t.x){let o=null;e.left&&this.left?o=this.parent.screenWorldWidth<this.parent.screenWidth?this.calcUnderflowX():-s.x:e.right&&this.right&&(o=this.parent.screenWorldWidth<this.parent.screenWidth?this.calcUnderflowX():-a.x),o!==null&&this.parent.x!==o&&(this.toX={time:0,start:this.parent.x,delta:o-this.parent.x,end:o},this.parent.emit("bounce-x-start",this.parent))}if(!this.toY&&!t.y){let o=null;e.top&&this.top?o=this.parent.screenWorldHeight<this.parent.screenHeight?this.calcUnderflowY():-s.y:e.bottom&&this.bottom&&(o=this.parent.screenWorldHeight<this.parent.screenHeight?this.calcUnderflowY():-a.y),o!==null&&this.parent.y!==o&&(this.toY={time:0,start:this.parent.y,delta:o-this.parent.y,end:o},this.parent.emit("bounce-y-start",this.parent))}}}reset(){this.toX=this.toY=null,this.bounce()}}const bx={left:!1,right:!1,top:!1,bottom:!1,direction:null,underflow:"center"};class hf extends ie{constructor(e,t={}){super(e),this.options=Object.assign({},bx,t),this.options.direction&&(this.options.left=this.options.direction==="x"||this.options.direction==="all"?!0:null,this.options.right=this.options.direction==="x"||this.options.direction==="all"?!0:null,this.options.top=this.options.direction==="y"||this.options.direction==="all"?!0:null,this.options.bottom=this.options.direction==="y"||this.options.direction==="all"?!0:null),this.parseUnderflow(),this.last={x:null,y:null,scaleX:null,scaleY:null},this.update()}parseUnderflow(){const e=this.options.underflow.toLowerCase();e==="none"?this.noUnderflow=!0:e==="center"?(this.underflowX=this.underflowY=0,this.noUnderflow=!1):(this.underflowX=e.indexOf("left")!==-1?-1:e.indexOf("right")!==-1?1:0,this.underflowY=e.indexOf("top")!==-1?-1:e.indexOf("bottom")!==-1?1:0,this.noUnderflow=!1)}move(){return this.update(),!1}update(){if(this.paused||this.parent.x===this.last.x&&this.parent.y===this.last.y&&this.parent.scale.x===this.last.scaleX&&this.parent.scale.y===this.last.scaleY)return;const e={x:this.parent.x,y:this.parent.y},t=this.parent.plugins.decelerate||{};if(this.options.left!==null||this.options.right!==null){let i=!1;if(!this.noUnderflow&&this.parent.screenWorldWidth<this.parent.screenWidth)switch(this.underflowX){case-1:this.parent.x!==0&&(this.parent.x=0,i=!0);break;case 1:this.parent.x!==this.parent.screenWidth-this.parent.screenWorldWidth&&(this.parent.x=this.parent.screenWidth-this.parent.screenWorldWidth,i=!0);break;default:this.parent.x!==(this.parent.screenWidth-this.parent.screenWorldWidth)/2&&(this.parent.x=(this.parent.screenWidth-this.parent.screenWorldWidth)/2,i=!0)}else this.options.left!==null&&this.parent.left<(this.options.left===!0?0:this.options.left)&&(this.parent.x=-(this.options.left===!0?0:this.options.left)*this.parent.scale.x,t.x=0,i=!0),this.options.right!==null&&this.parent.right>(this.options.right===!0?this.parent.worldWidth:this.options.right)&&(this.parent.x=-(this.options.right===!0?this.parent.worldWidth:this.options.right)*this.parent.scale.x+this.parent.screenWidth,t.x=0,i=!0);i&&this.parent.emit("moved",{viewport:this.parent,original:e,type:"clamp-x"})}if(this.options.top!==null||this.options.bottom!==null){let i=!1;if(!this.noUnderflow&&this.parent.screenWorldHeight<this.parent.screenHeight)switch(this.underflowY){case-1:this.parent.y!==0&&(this.parent.y=0,i=!0);break;case 1:this.parent.y!==this.parent.screenHeight-this.parent.screenWorldHeight&&(this.parent.y=this.parent.screenHeight-this.parent.screenWorldHeight,i=!0);break;default:this.parent.y!==(this.parent.screenHeight-this.parent.screenWorldHeight)/2&&(this.parent.y=(this.parent.screenHeight-this.parent.screenWorldHeight)/2,i=!0)}else this.options.top!==null&&this.parent.top<(this.options.top===!0?0:this.options.top)&&(this.parent.y=-(this.options.top===!0?0:this.options.top)*this.parent.scale.y,t.y=0,i=!0),this.options.bottom!==null&&this.parent.bottom>(this.options.bottom===!0?this.parent.worldHeight:this.options.bottom)&&(this.parent.y=-(this.options.bottom===!0?this.parent.worldHeight:this.options.bottom)*this.parent.scale.y+this.parent.screenHeight,t.y=0,i=!0);i&&this.parent.emit("moved",{viewport:this.parent,original:e,type:"clamp-y"})}this.last.x=this.parent.x,this.last.y=this.parent.y,this.last.scaleX=this.parent.scale.x,this.last.scaleY=this.parent.scale.y}reset(){this.update()}}const Tx={minWidth:null,minHeight:null,maxWidth:null,maxHeight:null,minScale:null,maxScale:null};class uf extends ie{constructor(e,t={}){super(e),this.options=Object.assign({},Tx,t),this.clamp()}resize(){this.clamp()}clamp(){if(!this.paused){if(this.options.minWidth||this.options.minHeight||this.options.maxWidth||this.options.maxHeight){let e=this.parent.worldScreenWidth,t=this.parent.worldScreenHeight;if(this.options.minWidth!==null&&e<this.options.minWidth){const i=this.parent.scale.x;this.parent.fitWidth(this.options.minWidth,!1,!1,!0),this.parent.scale.y*=this.parent.scale.x/i,e=this.parent.worldScreenWidth,t=this.parent.worldScreenHeight,this.parent.emit("zoomed",{viewport:this.parent,type:"clamp-zoom"})}if(this.options.maxWidth!==null&&e>this.options.maxWidth){const i=this.parent.scale.x;this.parent.fitWidth(this.options.maxWidth,!1,!1,!0),this.parent.scale.y*=this.parent.scale.x/i,e=this.parent.worldScreenWidth,t=this.parent.worldScreenHeight,this.parent.emit("zoomed",{viewport:this.parent,type:"clamp-zoom"})}if(this.options.minHeight!==null&&t<this.options.minHeight){const i=this.parent.scale.y;this.parent.fitHeight(this.options.minHeight,!1,!1,!0),this.parent.scale.x*=this.parent.scale.y/i,e=this.parent.worldScreenWidth,t=this.parent.worldScreenHeight,this.parent.emit("zoomed",{viewport:this.parent,type:"clamp-zoom"})}if(this.options.maxHeight!==null&&t>this.options.maxHeight){const i=this.parent.scale.y;this.parent.fitHeight(this.options.maxHeight,!1,!1,!0),this.parent.scale.x*=this.parent.scale.y/i,this.parent.emit("zoomed",{viewport:this.parent,type:"clamp-zoom"})}}else if(this.options.minScale||this.options.maxScale){const e={x:null,y:null},t={x:null,y:null};if(typeof this.options.minScale=="number")e.x=this.options.minScale,e.y=this.options.minScale;else if(this.options.minScale!==null){const s=this.options.minScale;e.x=typeof s.x>"u"?null:s.x,e.y=typeof s.y>"u"?null:s.y}if(typeof this.options.maxScale=="number")t.x=this.options.maxScale,t.y=this.options.maxScale;else if(this.options.maxScale!==null){const s=this.options.maxScale;t.x=typeof s.x>"u"?null:s.x,t.y=typeof s.y>"u"?null:s.y}let i=this.parent.scale.x,n=this.parent.scale.y;e.x!==null&&i<e.x&&(i=e.x),t.x!==null&&i>t.x&&(i=t.x),e.y!==null&&n<e.y&&(n=e.y),t.y!==null&&n>t.y&&(n=t.y),(i!==this.parent.scale.x||n!==this.parent.scale.y)&&(this.parent.scale.set(i,n),this.parent.emit("zoomed",{viewport:this.parent,type:"clamp-zoom"}))}}}reset(){this.clamp()}}const wx={friction:.98,bounce:.8,minSpeed:.01},fi=16;class lf extends ie{constructor(e,t={}){super(e),this.options=Object.assign({},wx,t),this.saved=[],this.timeSinceRelease=0,this.reset(),this.parent.on("moved",i=>this.moved(i))}down(){return this.saved=[],this.x=this.y=null,!1}isActive(){return!!(this.x||this.y)}move(){if(this.paused)return!1;const e=this.parent.input.count();return(e===1||e>1&&!this.parent.plugins.get("pinch",!0))&&(this.saved.push({x:this.parent.x,y:this.parent.y,time:performance.now()}),this.saved.length>60&&this.saved.splice(0,30)),!1}moved(e){if(this.saved.length){const t=this.saved[this.saved.length-1];e.type==="clamp-x"?t.x===e.original.x&&(t.x=this.parent.x):e.type==="clamp-y"&&t.y===e.original.y&&(t.y=this.parent.y)}}up(){if(this.parent.input.count()===0&&this.saved.length){const e=performance.now();for(const t of this.saved)if(t.time>=e-100){const i=e-t.time;this.x=(this.parent.x-t.x)/i,this.y=(this.parent.y-t.y)/i,this.percentChangeX=this.percentChangeY=this.options.friction,this.timeSinceRelease=0;break}}return!1}activate(e){e=e||{},typeof e.x<"u"&&(this.x=e.x,this.percentChangeX=this.options.friction),typeof e.y<"u"&&(this.y=e.y,this.percentChangeY=this.options.friction)}update(e){if(this.paused)return;const t=this.x||this.y,i=this.timeSinceRelease,n=this.timeSinceRelease+e;if(this.x){const s=this.percentChangeX,a=Math.log(s);this.parent.x+=this.x*fi/a*(Math.pow(s,n/fi)-Math.pow(s,i/fi)),this.x*=Math.pow(this.percentChangeX,e/fi)}if(this.y){const s=this.percentChangeY,a=Math.log(s);this.parent.y+=this.y*fi/a*(Math.pow(s,n/fi)-Math.pow(s,i/fi)),this.y*=Math.pow(this.percentChangeY,e/fi)}this.timeSinceRelease+=e,this.x&&this.y?Math.abs(this.x)<this.options.minSpeed&&Math.abs(this.y)<this.options.minSpeed&&(this.x=0,this.y=0):(Math.abs(this.x||0)<this.options.minSpeed&&(this.x=0),Math.abs(this.y||0)<this.options.minSpeed&&(this.y=0)),t&&this.parent.emit("moved",{viewport:this.parent,type:"decelerate"})}reset(){this.x=this.y=null}}const Ex={direction:"all",pressDrag:!0,wheel:!0,wheelScroll:1,reverse:!1,clampWheel:!1,underflow:"center",factor:1,mouseButtons:"all",keyToPress:null,ignoreKeyToPressOnTouch:!1,lineHeight:20,wheelSwapAxes:!1};class hs extends ie{__init(){this.windowEventHandlers=new Array}constructor(e,t={}){super(e),hs.prototype.__init.call(this),this.options=Object.assign({},Ex,t),this.moved=!1,this.reverse=this.options.reverse?1:-1,this.xDirection=!this.options.direction||this.options.direction==="all"||this.options.direction==="x",this.yDirection=!this.options.direction||this.options.direction==="all"||this.options.direction==="y",this.keyIsPressed=!1,this.parseUnderflow(),this.mouseButtons(this.options.mouseButtons),this.options.keyToPress&&this.handleKeyPresses(this.options.keyToPress)}handleKeyPresses(e){const t=n=>{e.includes(n.code)&&(this.keyIsPressed=!0)},i=n=>{e.includes(n.code)&&(this.keyIsPressed=!1)};this.addWindowEventHandler("keyup",i),this.addWindowEventHandler("keydown",t)}addWindowEventHandler(e,t){window.addEventListener(e,t),this.windowEventHandlers.push({event:e,handler:t})}destroy(){this.windowEventHandlers.forEach(({event:e,handler:t})=>{window.removeEventListener(e,t)})}mouseButtons(e){!e||e==="all"?this.mouse=[!0,!0,!0]:this.mouse=[e.indexOf("left")!==-1,e.indexOf("middle")!==-1,e.indexOf("right")!==-1]}parseUnderflow(){const e=this.options.underflow.toLowerCase();e==="center"?(this.underflowX=0,this.underflowY=0):(e.includes("left")?this.underflowX=-1:e.includes("right")?this.underflowX=1:this.underflowX=0,e.includes("top")?this.underflowY=-1:e.includes("bottom")?this.underflowY=1:this.underflowY=0)}checkButtons(e){const t=e.data.pointerType==="mouse",i=this.parent.input.count();return!!((i===1||i>1&&!this.parent.plugins.get("pinch",!0))&&(!t||this.mouse[e.data.button]))}checkKeyPress(e){return!this.options.keyToPress||this.keyIsPressed||this.options.ignoreKeyToPressOnTouch&&e.data.pointerType==="touch"}down(e){return this.paused||!this.options.pressDrag?!1:this.checkButtons(e)&&this.checkKeyPress(e)?(this.last={x:e.data.global.x,y:e.data.global.y},this.current=e.data.pointerId,!0):(this.last=null,!1)}get active(){return this.moved}move(e){if(this.paused||!this.options.pressDrag)return!1;if(this.last&&this.current===e.data.pointerId){const t=e.data.global.x,i=e.data.global.y,n=this.parent.input.count();if(n===1||n>1&&!this.parent.plugins.get("pinch",!0)){const s=t-this.last.x,a=i-this.last.y;if(this.moved||this.xDirection&&this.parent.input.checkThreshold(s)||this.yDirection&&this.parent.input.checkThreshold(a)){const o={x:t,y:i};return this.xDirection&&(this.parent.x+=(o.x-this.last.x)*this.options.factor),this.yDirection&&(this.parent.y+=(o.y-this.last.y)*this.options.factor),this.last=o,this.moved||this.parent.emit("drag-start",{event:e,screen:new j(this.last.x,this.last.y),world:this.parent.toWorld(new j(this.last.x,this.last.y)),viewport:this.parent}),this.moved=!0,this.parent.emit("moved",{viewport:this.parent,type:"drag"}),!0}}else this.moved=!1}return!1}up(e){if(this.paused)return!1;const t=this.parent.input.touches;if(t.length===1){const i=t[0];return i.last&&(this.last={x:i.last.x,y:i.last.y},this.current=i.id),this.moved=!1,!0}else if(this.last&&this.moved){const i=new j(this.last.x,this.last.y);return this.parent.emit("drag-end",{event:e,screen:i,world:this.parent.toWorld(i),viewport:this.parent}),this.last=null,this.moved=!1,!0}return!1}wheel(e){if(this.paused)return!1;if(this.options.wheel){const t=this.parent.plugins.get("wheel",!0);if(!t||!t.options.wheelZoom&&!e.ctrlKey){const i=e.deltaMode?this.options.lineHeight:1,n=[e.deltaX,e.deltaY],[s,a]=this.options.wheelSwapAxes?n.reverse():n;return this.xDirection&&(this.parent.x+=s*i*this.options.wheelScroll*this.reverse),this.yDirection&&(this.parent.y+=a*i*this.options.wheelScroll*this.reverse),this.options.clampWheel&&this.clamp(),this.parent.emit("wheel-scroll",this.parent),this.parent.emit("moved",{viewport:this.parent,type:"wheel"}),this.parent.options.passiveWheel||e.preventDefault(),this.parent.options.stopPropagation&&e.stopPropagation(),!0}}return!1}resume(){this.last=null,this.paused=!1}clamp(){const e=this.parent.plugins.get("decelerate",!0)||{};if(this.options.clampWheel!=="y")if(this.parent.screenWorldWidth<this.parent.screenWidth)switch(this.underflowX){case-1:this.parent.x=0;break;case 1:this.parent.x=this.parent.screenWidth-this.parent.screenWorldWidth;break;default:this.parent.x=(this.parent.screenWidth-this.parent.screenWorldWidth)/2}else this.parent.left<0?(this.parent.x=0,e.x=0):this.parent.right>this.parent.worldWidth&&(this.parent.x=-this.parent.worldWidth*this.parent.scale.x+this.parent.screenWidth,e.x=0);if(this.options.clampWheel!=="x")if(this.parent.screenWorldHeight<this.parent.screenHeight)switch(this.underflowY){case-1:this.parent.y=0;break;case 1:this.parent.y=this.parent.screenHeight-this.parent.screenWorldHeight;break;default:this.parent.y=(this.parent.screenHeight-this.parent.screenWorldHeight)/2}else this.parent.top<0&&(this.parent.y=0,e.y=0),this.parent.bottom>this.parent.worldHeight&&(this.parent.y=-this.parent.worldHeight*this.parent.scale.y+this.parent.screenHeight,e.y=0)}}const Sx={speed:0,acceleration:null,radius:null};class ff extends ie{constructor(e,t,i={}){super(e),this.target=t,this.options=Object.assign({},Sx,i),this.velocity={x:0,y:0}}update(e){if(this.paused)return;const t=this.parent.center;let i=this.target.x,n=this.target.y;if(this.options.radius)if(Math.sqrt(Math.pow(this.target.y-t.y,2)+Math.pow(this.target.x-t.x,2))>this.options.radius){const h=Math.atan2(this.target.y-t.y,this.target.x-t.x);i=this.target.x-Math.cos(h)*this.options.radius,n=this.target.y-Math.sin(h)*this.options.radius}else return;const s=i-t.x,a=n-t.y;if(s||a)if(this.options.speed)if(this.options.acceleration){const o=Math.atan2(n-t.y,i-t.x),h=Math.sqrt(Math.pow(s,2)+Math.pow(a,2));if(h){const u=(Math.pow(this.velocity.x,2)+Math.pow(this.velocity.y,2))/(2*this.options.acceleration);h>u?this.velocity={x:Math.min(this.velocity.x+(this.options.acceleration*e,this.options.speed)),y:Math.min(this.velocity.y+(this.options.acceleration*e,this.options.speed))}:this.velocity={x:Math.max(this.velocity.x-this.options.acceleration*this.options.speed,0),y:Math.max(this.velocity.y-this.options.acceleration*this.options.speed,0)};const l=Math.cos(o)*this.velocity.x,f=Math.sin(o)*this.velocity.y,c=Math.abs(l)>Math.abs(s)?i:t.x+l,d=Math.abs(f)>Math.abs(a)?n:t.y+f;this.parent.moveCenter(c,d),this.parent.emit("moved",{viewport:this.parent,type:"follow"})}}else{const o=Math.atan2(n-t.y,i-t.x),h=Math.cos(o)*this.options.speed,u=Math.sin(o)*this.options.speed,l=Math.abs(h)>Math.abs(s)?i:t.x+h,f=Math.abs(u)>Math.abs(a)?n:t.y+u;this.parent.moveCenter(l,f),this.parent.emit("moved",{viewport:this.parent,type:"follow"})}else this.parent.moveCenter(i,n),this.parent.emit("moved",{viewport:this.parent,type:"follow"})}}const Px={radius:null,distance:null,top:null,bottom:null,left:null,right:null,speed:8,reverse:!1,noDecelerate:!1,linear:!1,allowButtons:!1};class cf extends ie{constructor(e,t={}){super(e),this.options=Object.assign({},Px,t),this.reverse=this.options.reverse?1:-1,this.radiusSquared=typeof this.options.radius=="number"?Math.pow(this.options.radius,2):null,this.resize()}resize(){const e=this.options.distance;e!==null?(this.left=e,this.top=e,this.right=this.parent.screenWidth-e,this.bottom=this.parent.screenHeight-e):this.options.radius||(this.left=this.options.left,this.top=this.options.top,this.right=this.options.right===null?null:this.parent.screenWidth-this.options.right,this.bottom=this.options.bottom===null?null:this.parent.screenHeight-this.options.bottom)}down(){return this.paused||this.options.allowButtons||(this.horizontal=this.vertical=null),!1}move(e){if(this.paused||e.data.pointerType!=="mouse"&&e.data.identifier!==1||!this.options.allowButtons&&e.data.buttons!==0)return!1;const t=e.data.global.x,i=e.data.global.y;if(this.radiusSquared){const n=this.parent.toScreen(this.parent.center);if(Math.pow(n.x-t,2)+Math.pow(n.y-i,2)>=this.radiusSquared){const a=Math.atan2(n.y-i,n.x-t);this.options.linear?(this.horizontal=Math.round(Math.cos(a))*this.options.speed*this.reverse*(60/1e3),this.vertical=Math.round(Math.sin(a))*this.options.speed*this.reverse*(60/1e3)):(this.horizontal=Math.cos(a)*this.options.speed*this.reverse*(60/1e3),this.vertical=Math.sin(a)*this.options.speed*this.reverse*(60/1e3))}else this.horizontal&&this.decelerateHorizontal(),this.vertical&&this.decelerateVertical(),this.horizontal=this.vertical=0}else this.left!==null&&t<this.left?this.horizontal=Number(this.reverse)*this.options.speed*(60/1e3):this.right!==null&&t>this.right?this.horizontal=-1*this.reverse*this.options.speed*(60/1e3):(this.decelerateHorizontal(),this.horizontal=0),this.top!==null&&i<this.top?this.vertical=Number(this.reverse)*this.options.speed*(60/1e3):this.bottom!==null&&i>this.bottom?this.vertical=-1*this.reverse*this.options.speed*(60/1e3):(this.decelerateVertical(),this.vertical=0);return!1}decelerateHorizontal(){const e=this.parent.plugins.get("decelerate",!0);this.horizontal&&e&&!this.options.noDecelerate&&e.activate({x:this.horizontal*this.options.speed*this.reverse/(1e3/60)})}decelerateVertical(){const e=this.parent.plugins.get("decelerate",!0);this.vertical&&e&&!this.options.noDecelerate&&e.activate({y:this.vertical*this.options.speed*this.reverse/(1e3/60)})}up(){return this.paused||(this.horizontal&&this.decelerateHorizontal(),this.vertical&&this.decelerateVertical(),this.horizontal=this.vertical=null),!1}update(){if(!this.paused&&(this.horizontal||this.vertical)){const e=this.parent.center;this.horizontal&&(e.x+=this.horizontal*this.options.speed),this.vertical&&(e.y+=this.vertical*this.options.speed),this.parent.moveCenter(e),this.parent.emit("moved",{viewport:this.parent,type:"mouse-edges"})}}}const Rx={noDrag:!1,percent:1,center:null,factor:1,axis:"all"};class lr extends ie{__init(){this.active=!1}__init2(){this.pinching=!1}__init3(){this.moved=!1}constructor(e,t={}){super(e),lr.prototype.__init.call(this),lr.prototype.__init2.call(this),lr.prototype.__init3.call(this),this.options=Object.assign({},Rx,t)}down(){return this.parent.input.count()>=2?(this.active=!0,!0):!1}isAxisX(){return["all","x"].includes(this.options.axis)}isAxisY(){return["all","y"].includes(this.options.axis)}move(e){if(this.paused||!this.active)return!1;const t=e.data.global.x,i=e.data.global.y,n=this.parent.input.touches;if(n.length>=2){const s=n[0],a=n[1],o=s.last&&a.last?Math.sqrt(Math.pow(a.last.x-s.last.x,2)+Math.pow(a.last.y-s.last.y,2)):null;if(s.id===e.data.pointerId?s.last={x:t,y:i,data:e.data}:a.id===e.data.pointerId&&(a.last={x:t,y:i,data:e.data}),o){let h;const u={x:s.last.x+(a.last.x-s.last.x)/2,y:s.last.y+(a.last.y-s.last.y)/2};this.options.center||(h=this.parent.toLocal(u));let l=Math.sqrt(Math.pow(a.last.x-s.last.x,2)+Math.pow(a.last.y-s.last.y,2));l=l===0?l=1e-10:l;const f=(1-o/l)*this.options.percent*(this.isAxisX()?this.parent.scale.x:this.parent.scale.y);this.isAxisX()&&(this.parent.scale.x+=f),this.isAxisY()&&(this.parent.scale.y+=f),this.parent.emit("zoomed",{viewport:this.parent,type:"pinch",center:u});const c=this.parent.plugins.get("clamp-zoom",!0);if(c&&c.clamp(),this.options.center)this.parent.moveCenter(this.options.center);else{const d=this.parent.toGlobal(h);this.parent.x+=(u.x-d.x)*this.options.factor,this.parent.y+=(u.y-d.y)*this.options.factor,this.parent.emit("moved",{viewport:this.parent,type:"pinch"})}!this.options.noDrag&&this.lastCenter&&(this.parent.x+=(u.x-this.lastCenter.x)*this.options.factor,this.parent.y+=(u.y-this.lastCenter.y)*this.options.factor,this.parent.emit("moved",{viewport:this.parent,type:"pinch"})),this.lastCenter=u,this.moved=!0}else this.pinching||(this.parent.emit("pinch-start",this.parent),this.pinching=!0);return!0}return!1}up(){return this.pinching&&this.parent.input.touches.length<=1?(this.active=!1,this.lastCenter=null,this.pinching=!1,this.moved=!1,this.parent.emit("pinch-end",this.parent),!0):!1}}const Cx={topLeft:!1,friction:.8,time:1e3,ease:"easeInOutSine",interrupt:!0,removeOnComplete:!1,removeOnInterrupt:!1,forceStart:!1};class df extends ie{constructor(e,t,i,n={}){super(e),this.options=Object.assign({},Cx,n),this.ease=as(n.ease,"easeInOutSine"),this.x=t,this.y=i,this.options.forceStart&&this.snapStart()}snapStart(){this.percent=0,this.snapping={time:0};const e=this.options.topLeft?this.parent.corner:this.parent.center;this.deltaX=this.x-e.x,this.deltaY=this.y-e.y,this.startX=e.x,this.startY=e.y,this.parent.emit("snap-start",this.parent)}wheel(){return this.options.removeOnInterrupt&&this.parent.plugins.remove("snap"),!1}down(){return this.options.removeOnInterrupt?this.parent.plugins.remove("snap"):this.options.interrupt&&(this.snapping=null),!1}up(){if(this.parent.input.count()===0){const e=this.parent.plugins.get("decelerate",!0);e&&(e.x||e.y)&&(e.percentChangeX=e.percentChangeY=this.options.friction)}return!1}update(e){if(!this.paused&&!(this.options.interrupt&&this.parent.input.count()!==0))if(this.snapping){const t=this.snapping;t.time+=e;let i,n,s;const a=this.startX,o=this.startY,h=this.deltaX,u=this.deltaY;if(t.time>this.options.time)i=!0,n=a+h,s=o+u;else{const l=this.ease(t.time,0,1,this.options.time);n=a+h*l,s=o+u*l}this.options.topLeft?this.parent.moveCorner(n,s):this.parent.moveCenter(n,s),this.parent.emit("moved",{viewport:this.parent,type:"snap"}),i&&(this.options.removeOnComplete&&this.parent.plugins.remove("snap"),this.parent.emit("snap-end",this.parent),this.snapping=null)}else{const t=this.options.topLeft?this.parent.corner:this.parent.center;(t.x!==this.x||t.y!==this.y)&&this.snapStart()}}}const Ox={width:0,height:0,time:1e3,ease:"easeInOutSine",center:null,interrupt:!0,removeOnComplete:!1,removeOnInterrupt:!1,forceStart:!1,noMove:!1};class pf extends ie{constructor(e,t={}){super(e),this.options=Object.assign({},Ox,t),this.ease=as(this.options.ease),this.xIndependent=!1,this.yIndependent=!1,this.xScale=0,this.yScale=0,this.options.width>0&&(this.xScale=e.screenWidth/this.options.width,this.xIndependent=!0),this.options.height>0&&(this.yScale=e.screenHeight/this.options.height,this.yIndependent=!0),this.xScale=this.xIndependent?this.xScale:this.yScale,this.yScale=this.yIndependent?this.yScale:this.xScale,this.options.time===0?(e.container.scale.x=this.xScale,e.container.scale.y=this.yScale,this.options.removeOnComplete&&this.parent.plugins.remove("snap-zoom")):t.forceStart&&this.createSnapping()}createSnapping(){const e=this.parent.worldScreenWidth,t=this.parent.worldScreenHeight,i=this.parent.screenWidth/this.xScale,n=this.parent.screenHeight/this.yScale;this.snapping={time:0,startX:e,startY:t,deltaX:i-e,deltaY:n-t},this.parent.emit("snap-zoom-start",this.parent)}resize(){this.snapping=null,this.options.width>0&&(this.xScale=this.parent.screenWidth/this.options.width),this.options.height>0&&(this.yScale=this.parent.screenHeight/this.options.height),this.xScale=this.xIndependent?this.xScale:this.yScale,this.yScale=this.yIndependent?this.yScale:this.xScale}wheel(){return this.options.removeOnInterrupt&&this.parent.plugins.remove("snap-zoom"),!1}down(){return this.options.removeOnInterrupt?this.parent.plugins.remove("snap-zoom"):this.options.interrupt&&(this.snapping=null),!1}update(e){if(this.paused||this.options.interrupt&&this.parent.input.count()!==0)return;let t;if(!this.options.center&&!this.options.noMove&&(t=this.parent.center),!this.snapping)(this.parent.scale.x!==this.xScale||this.parent.scale.y!==this.yScale)&&this.createSnapping();else if(this.snapping){const i=this.snapping;if(i.time+=e,i.time>=this.options.time)this.parent.scale.set(this.xScale,this.yScale),this.options.removeOnComplete&&this.parent.plugins.remove("snap-zoom"),this.parent.emit("snap-zoom-end",this.parent),this.snapping=null;else{const s=this.snapping,a=this.ease(s.time,s.startX,s.deltaX,this.options.time),o=this.ease(s.time,s.startY,s.deltaY,this.options.time);this.parent.scale.x=this.parent.screenWidth/a,this.parent.scale.y=this.parent.screenHeight/o}const n=this.parent.plugins.get("clamp-zoom",!0);n&&n.clamp(),this.options.noMove||(this.options.center?this.parent.moveCenter(this.options.center):this.parent.moveCenter(t))}}resume(){this.snapping=null,super.resume()}}const Ax={percent:.1,smooth:!1,interrupt:!0,reverse:!1,center:null,lineHeight:20,axis:"all",keyToPress:null,trackpadPinch:!1,wheelZoom:!0};class vf extends ie{constructor(e,t={}){super(e),this.options=Object.assign({},Ax,t),this.keyIsPressed=!1,this.options.keyToPress&&this.handleKeyPresses(this.options.keyToPress)}handleKeyPresses(e){window.addEventListener("keydown",t=>{e.includes(t.code)&&(this.keyIsPressed=!0)}),window.addEventListener("keyup",t=>{e.includes(t.code)&&(this.keyIsPressed=!1)})}checkKeyPress(){return!this.options.keyToPress||this.keyIsPressed}down(){return this.options.interrupt&&(this.smoothing=null),!1}isAxisX(){return["all","x"].includes(this.options.axis)}isAxisY(){return["all","y"].includes(this.options.axis)}update(){if(this.smoothing){const e=this.smoothingCenter,t=this.smoothing;let i;this.options.center||(i=this.parent.toLocal(e)),this.isAxisX()&&(this.parent.scale.x+=t.x),this.isAxisY()&&(this.parent.scale.y+=t.y),this.parent.emit("zoomed",{viewport:this.parent,type:"wheel"});const n=this.parent.plugins.get("clamp-zoom",!0);if(n&&n.clamp(),this.options.center)this.parent.moveCenter(this.options.center);else{const s=this.parent.toGlobal(i);this.parent.x+=e.x-s.x,this.parent.y+=e.y-s.y}this.parent.emit("moved",{viewport:this.parent,type:"wheel"}),this.smoothingCount++,this.smoothingCount>=this.options.smooth&&(this.smoothing=null)}}pinch(e){if(this.paused)return;const t=this.parent.input.getPointerPosition(e),i=-e.deltaY*(e.deltaMode?this.options.lineHeight:1)/200,n=Math.pow(2,(1+this.options.percent)*i);let s;this.options.center||(s=this.parent.toLocal(t)),this.isAxisX()&&(this.parent.scale.x*=n),this.isAxisY()&&(this.parent.scale.y*=n),this.parent.emit("zoomed",{viewport:this.parent,type:"wheel"});const a=this.parent.plugins.get("clamp-zoom",!0);if(a&&a.clamp(),this.options.center)this.parent.moveCenter(this.options.center);else{const o=this.parent.toGlobal(s);this.parent.x+=t.x-o.x,this.parent.y+=t.y-o.y}this.parent.emit("moved",{viewport:this.parent,type:"wheel"}),this.parent.emit("wheel",{wheel:{dx:e.deltaX,dy:e.deltaY,dz:e.deltaZ},event:e,viewport:this.parent})}wheel(e){if(this.paused||!this.checkKeyPress())return!1;if(e.ctrlKey&&this.options.trackpadPinch)this.pinch(e);else if(this.options.wheelZoom){const t=this.parent.input.getPointerPosition(e),n=(this.options.reverse?-1:1)*-e.deltaY*(e.deltaMode?this.options.lineHeight:1)/500,s=Math.pow(2,(1+this.options.percent)*n);if(this.options.smooth){const a={x:this.smoothing?this.smoothing.x*(this.options.smooth-this.smoothingCount):0,y:this.smoothing?this.smoothing.y*(this.options.smooth-this.smoothingCount):0};this.smoothing={x:((this.parent.scale.x+a.x)*s-this.parent.scale.x)/this.options.smooth,y:((this.parent.scale.y+a.y)*s-this.parent.scale.y)/this.options.smooth},this.smoothingCount=0,this.smoothingCenter=t}else{let a;this.options.center||(a=this.parent.toLocal(t)),this.isAxisX()&&(this.parent.scale.x*=s),this.isAxisY()&&(this.parent.scale.y*=s),this.parent.emit("zoomed",{viewport:this.parent,type:"wheel"});const o=this.parent.plugins.get("clamp-zoom",!0);if(o&&o.clamp(),this.options.center)this.parent.moveCenter(this.options.center);else{const h=this.parent.toGlobal(a);this.parent.x+=t.x-h.x,this.parent.y+=t.y-h.y}}this.parent.emit("moved",{viewport:this.parent,type:"wheel"}),this.parent.emit("wheel",{wheel:{dx:e.deltaX,dy:e.deltaY,dz:e.deltaZ},event:e,viewport:this.parent})}return!this.parent.options.passiveWheel}}class _f{constructor(e){this.viewport=e,this.touches=[],this.addListeners()}addListeners(){this.viewport.interactive=!0,this.viewport.forceHitArea||(this.viewport.hitArea=new Z(0,0,this.viewport.worldWidth,this.viewport.worldHeight)),this.viewport.on("pointerdown",this.down,this),this.viewport.on("pointermove",this.move,this),this.viewport.on("pointerup",this.up,this),this.viewport.on("pointerupoutside",this.up,this),this.viewport.on("pointercancel",this.up,this),this.viewport.on("pointerout",this.up,this),this.wheelFunction=e=>this.handleWheel(e),this.viewport.options.divWheel.addEventListener("wheel",this.wheelFunction,{passive:this.viewport.options.passiveWheel}),this.isMouseDown=!1}destroy(){this.viewport.options.divWheel.removeEventListener("wheel",this.wheelFunction)}down(e){if(this.viewport.pause||!this.viewport.worldVisible)return;if(e.data.pointerType==="mouse"?this.isMouseDown=!0:this.get(e.data.pointerId)||this.touches.push({id:e.data.pointerId,last:null}),this.count()===1){this.last=e.data.global.clone();const i=this.viewport.plugins.get("decelerate",!0),n=this.viewport.plugins.get("bounce",!0);(!i||!i.isActive())&&(!n||!n.isActive())?this.clickedAvailable=!0:this.clickedAvailable=!1}else this.clickedAvailable=!1;this.viewport.plugins.down(e)&&this.viewport.options.stopPropagation&&e.stopPropagation()}clear(){this.isMouseDown=!1,this.touches=[],this.last=null}checkThreshold(e){return Math.abs(e)>=this.viewport.threshold}move(e){if(this.viewport.pause||!this.viewport.worldVisible)return;const t=this.viewport.plugins.move(e);if(this.clickedAvailable&&this.last){const i=e.data.global.x-this.last.x,n=e.data.global.y-this.last.y;(this.checkThreshold(i)||this.checkThreshold(n))&&(this.clickedAvailable=!1)}t&&this.viewport.options.stopPropagation&&e.stopPropagation()}up(e){if(this.viewport.pause||!this.viewport.worldVisible)return;e.data.pointerType==="mouse"&&(this.isMouseDown=!1),e.data.pointerType!=="mouse"&&this.remove(e.data.pointerId);const t=this.viewport.plugins.up(e);this.clickedAvailable&&this.count()===0&&this.last&&(this.viewport.emit("clicked",{event:e,screen:this.last,world:this.viewport.toWorld(this.last),viewport:this}),this.clickedAvailable=!1),t&&this.viewport.options.stopPropagation&&e.stopPropagation()}getPointerPosition(e){const t=new j;if(this.viewport.options.interaction)this.viewport.options.interaction.mapPositionToPoint(t,e.clientX,e.clientY);else if(this.viewport.options.useDivWheelForInputManager&&this.viewport.options.divWheel){const i=this.viewport.options.divWheel.getBoundingClientRect();t.x=e.clientX-i.left,t.y=e.clientY-i.top}else t.x=e.clientX,t.y=e.clientY;return t}handleWheel(e){if(this.viewport.pause||!this.viewport.worldVisible||this.viewport.options.interaction&&this.viewport.options.interaction.interactionDOMElement!==e.target)return;const t=this.viewport.toLocal(this.getPointerPosition(e));this.viewport.left<=t.x&&t.x<=this.viewport.right&&this.viewport.top<=t.y&&t.y<=this.viewport.bottom&&this.viewport.plugins.wheel(e)&&!this.viewport.options.passiveWheel&&e.preventDefault()}pause(){this.touches=[],this.isMouseDown=!1}get(e){for(const t of this.touches)if(t.id===e)return t;return null}remove(e){for(let t=0;t<this.touches.length;t++)if(this.touches[t].id===e){this.touches.splice(t,1);return}}count(){return(this.isMouseDown?1:0)+this.touches.length}}function us(r){let e,t=r[0],i=1;for(;i<r.length;){const n=r[i],s=r[i+1];if(i+=2,(n==="optionalAccess"||n==="optionalCall")&&t==null)return;n==="access"||n==="optionalAccess"?(e=t,t=s(t)):(n==="call"||n==="optionalCall")&&(t=s((...a)=>t.call(e,...a)),e=void 0)}return t}const Kr=["drag","pinch","wheel","follow","mouse-edges","decelerate","animate","bounce","snap-zoom","clamp-zoom","snap","clamp"];class mf{constructor(e){this.viewport=e,this.list=[],this.plugins={}}add(e,t,i=Kr.length){const n=this.plugins[e];n&&n.destroy(),this.plugins[e]=t;const s=Kr.indexOf(e);s!==-1&&Kr.splice(s,1),Kr.splice(i,0,e),this.sort()}get(e,t){return t&&us([this,"access",i=>i.plugins,"access",i=>i[e],"optionalAccess",i=>i.paused])?null:this.plugins[e]}update(e){for(const t of this.list)t.update(e)}resize(){for(const e of this.list)e.resize()}reset(){for(const e of this.list)e.reset()}removeAll(){this.list.forEach(e=>{e.destroy()}),this.plugins={},this.sort()}remove(e){this.plugins[e]&&(us([this,"access",t=>t.plugins,"access",t=>t[e],"optionalAccess",t=>t.destroy,"call",t=>t()]),delete this.plugins[e],this.viewport.emit(`${e}-remove`),this.sort())}pause(e){us([this,"access",t=>t.plugins,"access",t=>t[e],"optionalAccess",t=>t.pause,"call",t=>t()])}resume(e){us([this,"access",t=>t.plugins,"access",t=>t[e],"optionalAccess",t=>t.resume,"call",t=>t()])}sort(){this.list=[];for(const e of Kr)this.plugins[e]&&this.list.push(this.plugins[e])}down(e){let t=!1;for(const i of this.list)i.down(e)&&(t=!0);return t}move(e){let t=!1;for(const i of this.viewport.plugins.list)i.move(e)&&(t=!0);return t}up(e){let t=!1;for(const i of this.list)i.up(e)&&(t=!0);return t}wheel(e){let t=!1;for(const i of this.list)i.wheel(e)&&(t=!0);return t}}const Ix={screenWidth:window.innerWidth,screenHeight:window.innerHeight,worldWidth:null,worldHeight:null,threshold:5,passiveWheel:!0,stopPropagation:!1,forceHitArea:null,noTicker:!1,interaction:null,disableOnContextMenu:!1,ticker:Ft.shared};class Eo extends yt{__init(){this._disableOnContextMenu=e=>e.preventDefault()}constructor(e={}){super(),Eo.prototype.__init.call(this),this.options=Object.assign({},{divWheel:document.body},Ix,e),this.screenWidth=this.options.screenWidth,this.screenHeight=this.options.screenHeight,this._worldWidth=this.options.worldWidth,this._worldHeight=this.options.worldHeight,this.forceHitArea=this.options.forceHitArea,this.threshold=this.options.threshold,this.options.divWheel=this.options.divWheel||document.body,this.options.disableOnContextMenu&&this.options.divWheel.addEventListener("contextmenu",this._disableOnContextMenu),this.options.noTicker||(this.tickerFunction=()=>this.update(this.options.ticker.elapsedMS),this.options.ticker.add(this.tickerFunction)),this.input=new _f(this),this.plugins=new mf(this)}destroy(e){!this.options.noTicker&&this.tickerFunction&&this.options.ticker.remove(this.tickerFunction),this.options.disableOnContextMenu&&this.options.divWheel.removeEventListener("contextmenu",this._disableOnContextMenu),this.input.destroy(),super.destroy(e)}update(e){this.pause||(this.plugins.update(e),this.lastViewport&&(this.lastViewport.x!==this.x||this.lastViewport.y!==this.y?this.moving=!0:this.moving&&(this.emit("moved-end",this),this.moving=!1),this.lastViewport.scaleX!==this.scale.x||this.lastViewport.scaleY!==this.scale.y?this.zooming=!0:this.zooming&&(this.emit("zoomed-end",this),this.zooming=!1)),this.forceHitArea||(this._hitAreaDefault=new Z(this.left,this.top,this.worldScreenWidth,this.worldScreenHeight),this.hitArea=this._hitAreaDefault),this._dirty=this._dirty||!this.lastViewport||this.lastViewport.x!==this.x||this.lastViewport.y!==this.y||this.lastViewport.scaleX!==this.scale.x||this.lastViewport.scaleY!==this.scale.y,this.lastViewport={x:this.x,y:this.y,scaleX:this.scale.x,scaleY:this.scale.y},this.emit("frame-end",this))}resize(e=window.innerWidth,t=window.innerHeight,i,n){this.screenWidth=e,this.screenHeight=t,typeof i<"u"&&(this._worldWidth=i),typeof n<"u"&&(this._worldHeight=n),this.plugins.resize(),this.dirty=!0}get worldWidth(){return this._worldWidth?this._worldWidth:this.width/this.scale.x}set worldWidth(e){this._worldWidth=e,this.plugins.resize()}get worldHeight(){return this._worldHeight?this._worldHeight:this.height/this.scale.y}set worldHeight(e){this._worldHeight=e,this.plugins.resize()}getVisibleBounds(){return new Z(this.left,this.top,this.worldScreenWidth,this.worldScreenHeight)}toWorld(e,t){return arguments.length===2?this.toLocal(new j(e,t)):this.toLocal(e)}toScreen(e,t){return arguments.length===2?this.toGlobal(new j(e,t)):this.toGlobal(e)}get worldScreenWidth(){return this.screenWidth/this.scale.x}get worldScreenHeight(){return this.screenHeight/this.scale.y}get screenWorldWidth(){return this.worldWidth*this.scale.x}get screenWorldHeight(){return this.worldHeight*this.scale.y}get center(){return new j(this.worldScreenWidth/2-this.x/this.scale.x,this.worldScreenHeight/2-this.y/this.scale.y)}set center(e){this.moveCenter(e)}moveCenter(...e){let t,i;typeof e[0]=="number"?(t=e[0],i=e[1]):(t=e[0].x,i=e[0].y);const n=(this.worldScreenWidth/2-t)*this.scale.x,s=(this.worldScreenHeight/2-i)*this.scale.y;return(this.x!==n||this.y!==s)&&(this.position.set(n,s),this.plugins.reset(),this.dirty=!0),this}get corner(){return new j(-this.x/this.scale.x,-this.y/this.scale.y)}set corner(e){this.moveCorner(e)}moveCorner(...e){let t,i;return e.length===1?(t=-e[0].x*this.scale.x,i=-e[0].y*this.scale.y):(t=-e[0]*this.scale.x,i=-e[1]*this.scale.y),(t!==this.x||i!==this.y)&&(this.position.set(t,i),this.plugins.reset(),this.dirty=!0),this}get screenWidthInWorldPixels(){return this.screenWidth/this.scale.x}get screenHeightInWorldPixels(){return this.screenHeight/this.scale.y}findFitWidth(e){return this.screenWidth/e}findFitHeight(e){return this.screenHeight/e}findFit(e,t){const i=this.screenWidth/e,n=this.screenHeight/t;return Math.min(i,n)}findCover(e,t){const i=this.screenWidth/e,n=this.screenHeight/t;return Math.max(i,n)}fitWidth(e=this.worldWidth,t,i=!0,n){let s;t&&(s=this.center),this.scale.x=this.screenWidth/e,i&&(this.scale.y=this.scale.x);const a=this.plugins.get("clamp-zoom",!0);return!n&&a&&a.clamp(),t&&s&&this.moveCenter(s),this}fitHeight(e=this.worldHeight,t,i=!0,n){let s;t&&(s=this.center),this.scale.y=this.screenHeight/e,i&&(this.scale.x=this.scale.y);const a=this.plugins.get("clamp-zoom",!0);return!n&&a&&a.clamp(),t&&s&&this.moveCenter(s),this}fitWorld(e){let t;e&&(t=this.center),this.scale.x=this.screenWidth/this.worldWidth,this.scale.y=this.screenHeight/this.worldHeight,this.scale.x<this.scale.y?this.scale.y=this.scale.x:this.scale.x=this.scale.y;const i=this.plugins.get("clamp-zoom",!0);return i&&i.clamp(),e&&t&&this.moveCenter(t),this}fit(e,t=this.worldWidth,i=this.worldHeight){let n;e&&(n=this.center),this.scale.x=this.screenWidth/t,this.scale.y=this.screenHeight/i,this.scale.x<this.scale.y?this.scale.y=this.scale.x:this.scale.x=this.scale.y;const s=this.plugins.get("clamp-zoom",!0);return s&&s.clamp(),e&&n&&this.moveCenter(n),this}setZoom(e,t){let i;t&&(i=this.center),this.scale.set(e);const n=this.plugins.get("clamp-zoom",!0);return n&&n.clamp(),t&&i&&this.moveCenter(i),this}zoomPercent(e,t){return this.setZoom(this.scale.x+this.scale.x*e,t)}zoom(e,t){return this.fitWidth(e+this.worldScreenWidth,t),this}get scaled(){return this.scale.x}set scaled(e){this.setZoom(e,!0)}snapZoom(e){return this.plugins.add("snap-zoom",new pf(this,e)),this}OOB(){return{left:this.left<0,right:this.right>this.worldWidth,top:this.top<0,bottom:this.bottom>this.worldHeight,cornerPoint:new j(this.worldWidth*this.scale.x-this.screenWidth,this.worldHeight*this.scale.y-this.screenHeight)}}get right(){return-this.x/this.scale.x+this.worldScreenWidth}set right(e){this.x=-e*this.scale.x+this.screenWidth,this.plugins.reset()}get left(){return-this.x/this.scale.x}set left(e){this.x=-e*this.scale.x,this.plugins.reset()}get top(){return-this.y/this.scale.y}set top(e){this.y=-e*this.scale.y,this.plugins.reset()}get bottom(){return-this.y/this.scale.y+this.worldScreenHeight}set bottom(e){this.y=-e*this.scale.y+this.screenHeight,this.plugins.reset()}get dirty(){return!!this._dirty}set dirty(e){this._dirty=e}get forceHitArea(){return this._forceHitArea}set forceHitArea(e){e?(this._forceHitArea=e,this.hitArea=e):(this._forceHitArea=null,this.hitArea=new Z(0,0,this.worldWidth,this.worldHeight))}drag(e){return this.plugins.add("drag",new hs(this,e)),this}clamp(e){return this.plugins.add("clamp",new hf(this,e)),this}decelerate(e){return this.plugins.add("decelerate",new lf(this,e)),this}bounce(e){return this.plugins.add("bounce",new of(this,e)),this}pinch(e){return this.plugins.add("pinch",new lr(this,e)),this}snap(e,t,i){return this.plugins.add("snap",new df(this,e,t,i)),this}follow(e,t){return this.plugins.add("follow",new ff(this,e,t)),this}wheel(e){return this.plugins.add("wheel",new vf(this,e)),this}animate(e){return this.plugins.add("animate",new Fe(this,e)),this}clampZoom(e){return this.plugins.add("clamp-zoom",new uf(this,e)),this}mouseEdges(e){return this.plugins.add("mouse-edges",new cf(this,e)),this}get pause(){return!!this._pause}set pause(e){this._pause=e,this.lastViewport=null,this.moving=!1,this.zooming=!1,e&&this.input.pause()}ensureVisible(e,t,i,n,s){s&&(i>this.worldScreenWidth||n>this.worldScreenHeight)&&(this.fit(!0,i,n),this.emit("zoomed",{viewport:this,type:"ensureVisible"}));let a=!1;e<this.left?(this.left=e,a=!0):e+i>this.right&&(this.right=e+i,a=!0),t<this.top?(this.top=t,a=!0):t+n>this.bottom&&(this.bottom=t+n,a=!0),a&&this.emit("moved",{viewport:this,type:"ensureVisible"})}}const Mx=Object.freeze(Object.defineProperty({__proto__:null,Animate:Fe,Bounce:of,Clamp:hf,ClampZoom:uf,Decelerate:lf,Drag:hs,Follow:ff,InputManager:_f,MouseEdges:cf,Pinch:lr,Plugin:ie,PluginManager:mf,Snap:df,SnapZoom:pf,Viewport:Eo,Wheel:vf},Symbol.toStringTag,{value:"Module"}));Wt.FlowRunTimeline=vx,Wt.formatDateFnsDefault=Io,Wt.nodeThemeFnDefault=Mo,Object.defineProperty(Wt,Symbol.toStringTag,{value:"Module"})});
1060
+ `;(function(r){Ry(e,r);function e(t,i){t===void 0&&(t=.5),i===void 0&&(i=Math.random());var n=r.call(this,Vh,Cy,{uNoise:0,uSeed:0})||this;return n.noise=t,n.seed=i,n}return Object.defineProperty(e.prototype,"noise",{get:function(){return this.uniforms.uNoise},set:function(t){this.uniforms.uNoise=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"seed",{get:function(){return this.uniforms.uSeed},set:function(t){this.uniforms.uSeed=t},enumerable:!1,configurable:!0}),e})(Je);var Fu=new Ct;Tt.prototype._cacheAsBitmap=!1,Tt.prototype._cacheData=null,Tt.prototype._cacheAsBitmapResolution=null,Tt.prototype._cacheAsBitmapMultisample=gt.NONE;var Oy=function(){function r(){this.textureCacheId=null,this.originalRender=null,this.originalRenderCanvas=null,this.originalCalculateBounds=null,this.originalGetLocalBounds=null,this.originalUpdateTransform=null,this.originalDestroy=null,this.originalMask=null,this.originalFilterArea=null,this.originalContainsPoint=null,this.sprite=null}return r}();Object.defineProperties(Tt.prototype,{cacheAsBitmapResolution:{get:function(){return this._cacheAsBitmapResolution},set:function(r){r!==this._cacheAsBitmapResolution&&(this._cacheAsBitmapResolution=r,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmapMultisample:{get:function(){return this._cacheAsBitmapMultisample},set:function(r){r!==this._cacheAsBitmapMultisample&&(this._cacheAsBitmapMultisample=r,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmap:{get:function(){return this._cacheAsBitmap},set:function(r){if(this._cacheAsBitmap!==r){this._cacheAsBitmap=r;var e;r?(this._cacheData||(this._cacheData=new Oy),e=this._cacheData,e.originalRender=this.render,e.originalRenderCanvas=this.renderCanvas,e.originalUpdateTransform=this.updateTransform,e.originalCalculateBounds=this.calculateBounds,e.originalGetLocalBounds=this.getLocalBounds,e.originalDestroy=this.destroy,e.originalContainsPoint=this.containsPoint,e.originalMask=this._mask,e.originalFilterArea=this.filterArea,this.render=this._renderCached,this.renderCanvas=this._renderCachedCanvas,this.destroy=this._cacheAsBitmapDestroy):(e=this._cacheData,e.sprite&&this._destroyCachedDisplayObject(),this.render=e.originalRender,this.renderCanvas=e.originalRenderCanvas,this.calculateBounds=e.originalCalculateBounds,this.getLocalBounds=e.originalGetLocalBounds,this.destroy=e.originalDestroy,this.updateTransform=e.originalUpdateTransform,this.containsPoint=e.originalContainsPoint,this._mask=e.originalMask,this.filterArea=e.originalFilterArea)}}}}),Tt.prototype._renderCached=function(e){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObject(e),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._render(e))},Tt.prototype._initCachedDisplayObject=function(e){var t;if(!(this._cacheData&&this._cacheData.sprite)){var i=this.alpha;this.alpha=1,e.batch.flush();var n=this.getLocalBounds(null,!0).clone();if(this.filters&&this.filters.length){var s=this.filters[0].padding;n.pad(s)}n.ceil(L.RESOLUTION);var a=e.renderTexture.current,o=e.renderTexture.sourceFrame.clone(),h=e.renderTexture.destinationFrame.clone(),u=e.projection.transform,l=bi.create({width:n.width,height:n.height,resolution:this.cacheAsBitmapResolution||e.resolution,multisample:(t=this.cacheAsBitmapMultisample)!==null&&t!==void 0?t:e.multisample}),f="cacheAsBitmap_"+yi();this._cacheData.textureCacheId=f,tt.addToCache(l.baseTexture,f),V.addToCache(l,f);var c=this.transform.localTransform.copyTo(Fu).invert().translate(-n.x,-n.y);this.render=this._cacheData.originalRender,e.render(this,{renderTexture:l,clear:!0,transform:c,skipUpdateTransform:!1}),e.framebuffer.blit(),e.projection.transform=u,e.renderTexture.bind(a,o,h),this.render=this._renderCached,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null,this.alpha=i;var d=new We(l);d.transform.worldTransform=this.transform.worldTransform,d.anchor.x=-(n.x/n.width),d.anchor.y=-(n.y/n.height),d.alpha=i,d._bounds=this._bounds,this._cacheData.sprite=d,this.transform._parentID=-1,this.parent?this.updateTransform():(this.enableTempParent(),this.updateTransform(),this.disableTempParent(null)),this.containsPoint=d.containsPoint.bind(d)}},Tt.prototype._renderCachedCanvas=function(e){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(e),this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._renderCanvas(e))},Tt.prototype._initCachedDisplayObjectCanvas=function(e){if(!(this._cacheData&&this._cacheData.sprite)){var t=this.getLocalBounds(null,!0),i=this.alpha;this.alpha=1;var n=e.context,s=e._projTransform;t.ceil(L.RESOLUTION);var a=bi.create({width:t.width,height:t.height}),o="cacheAsBitmap_"+yi();this._cacheData.textureCacheId=o,tt.addToCache(a.baseTexture,o),V.addToCache(a,o);var h=Fu;this.transform.localTransform.copyTo(h),h.invert(),h.tx-=t.x,h.ty-=t.y,this.renderCanvas=this._cacheData.originalRenderCanvas,e.render(this,{renderTexture:a,clear:!0,transform:h,skipUpdateTransform:!1}),e.context=n,e._projTransform=s,this.renderCanvas=this._renderCachedCanvas,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null,this.alpha=i;var u=new We(a);u.transform.worldTransform=this.transform.worldTransform,u.anchor.x=-(t.x/t.width),u.anchor.y=-(t.y/t.height),u.alpha=i,u._bounds=this._bounds,this._cacheData.sprite=u,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=e._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=u.containsPoint.bind(u)}},Tt.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._bounds.updateID=this._boundsID},Tt.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds(null)},Tt.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,tt.removeFromCache(this._cacheData.textureCacheId),V.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null},Tt.prototype._cacheAsBitmapDestroy=function(e){this.cacheAsBitmap=!1,this.destroy(e)};Tt.prototype.name=null,yt.prototype.getChildByName=function(e,t){for(var i=0,n=this.children.length;i<n;i++)if(this.children[i].name===e)return this.children[i];if(t)for(var i=0,n=this.children.length;i<n;i++){var s=this.children[i];if(s.getChildByName){var a=s.getChildByName(e,!0);if(a)return a}}return null};Tt.prototype.getGlobalPosition=function(e,t){return e===void 0&&(e=new j),t===void 0&&(t=!1),this.parent?this.parent.toGlobal(this.position,e,t):(e.x=this.position.x,e.y=this.position.y),e};var Ay=function(){function r(){}return r.init=function(e){var t=this;Object.defineProperty(this,"resizeTo",{set:function(i){globalThis.removeEventListener("resize",this.queueResize),this._resizeTo=i,i&&(globalThis.addEventListener("resize",this.queueResize),this.resize())},get:function(){return this._resizeTo}}),this.queueResize=function(){t._resizeTo&&(t.cancelResize(),t._resizeId=requestAnimationFrame(function(){return t.resize()}))},this.cancelResize=function(){t._resizeId&&(cancelAnimationFrame(t._resizeId),t._resizeId=null)},this.resize=function(){if(t._resizeTo){t.cancelResize();var i,n;if(t._resizeTo===globalThis.window)i=globalThis.innerWidth,n=globalThis.innerHeight;else{var s=t._resizeTo,a=s.clientWidth,o=s.clientHeight;i=a,n=o}t.renderer.resize(i,n)}},this._resizeId=null,this._resizeTo=null,this.resizeTo=e.resizeTo||null},r.destroy=function(){globalThis.removeEventListener("resize",this.queueResize),this.cancelResize(),this.cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null},r.extension=nt.Application,r}(),Nu=function(){function r(e){var t=this;this.stage=new yt,e=Object.assign({forceCanvas:!1},e),this.renderer=sm(e),r._plugins.forEach(function(i){i.init.call(t,e)})}return r.registerPlugin=function(e){ge("6.5.0","Application.registerPlugin() is deprecated, use extensions.add()"),Ge.add({type:nt.Application,ref:e})},r.prototype.render=function(){this.renderer.render(this.stage)},Object.defineProperty(r.prototype,"view",{get:function(){return this.renderer.view},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"screen",{get:function(){return this.renderer.screen},enumerable:!1,configurable:!0}),r.prototype.destroy=function(e,t){var i=this,n=r._plugins.slice(0);n.reverse(),n.forEach(function(s){s.destroy.call(i)}),this.stage.destroy(t),this.stage=null,this.renderer.destroy(e),this.renderer=null},r._plugins=[],r}();Ge.handleByList(nt.Application,Nu._plugins),Ge.add(Ay);var Da=function(r,e){return Da=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},Da(r,e)};function qi(r,e){Da(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Iy=function(r){qi(e,r);function e(t,i,n,s){t===void 0&&(t=100),i===void 0&&(i=100),n===void 0&&(n=10),s===void 0&&(s=10);var a=r.call(this)||this;return a.segWidth=n,a.segHeight=s,a.width=t,a.height=i,a.build(),a}return e.prototype.build=function(){for(var t=this.segWidth*this.segHeight,i=[],n=[],s=[],a=this.segWidth-1,o=this.segHeight-1,h=this.width/a,u=this.height/o,l=0;l<t;l++){var f=l%this.segWidth,c=l/this.segWidth|0;i.push(f*h,c*u),n.push(f/a,c/o)}for(var d=a*o,l=0;l<d;l++){var v=l%a,p=l/a|0,_=p*this.segWidth+v,m=p*this.segWidth+v+1,g=(p+1)*this.segWidth+v,y=(p+1)*this.segWidth+v+1;s.push(_,m,g,m,y,g)}this.buffers[0].data=new Float32Array(i),this.buffers[1].data=new Float32Array(n),this.indexBuffer.data=new Uint16Array(s),this.buffers[0].update(),this.buffers[1].update(),this.indexBuffer.update()},e}(Bn),My=function(r){qi(e,r);function e(t,i,n){t===void 0&&(t=200),n===void 0&&(n=0);var s=r.call(this,new Float32Array(i.length*4),new Float32Array(i.length*4),new Uint16Array((i.length-1)*6))||this;return s.points=i,s._width=t,s.textureScale=n,s.build(),s}return Object.defineProperty(e.prototype,"width",{get:function(){return this._width},enumerable:!1,configurable:!0}),e.prototype.build=function(){var t=this.points;if(t){var i=this.getBuffer("aVertexPosition"),n=this.getBuffer("aTextureCoord"),s=this.getIndex();if(!(t.length<1)){i.data.length/4!==t.length&&(i.data=new Float32Array(t.length*4),n.data=new Float32Array(t.length*4),s.data=new Uint16Array((t.length-1)*6));var a=n.data,o=s.data;a[0]=0,a[1]=0,a[2]=0,a[3]=1;for(var h=0,u=t[0],l=this._width*this.textureScale,f=t.length,c=0;c<f;c++){var d=c*4;if(this.textureScale>0){var v=u.x-t[c].x,p=u.y-t[c].y,_=Math.sqrt(v*v+p*p);u=t[c],h+=_/l}else h=c/(f-1);a[d]=h,a[d+1]=0,a[d+2]=h,a[d+3]=1}for(var m=0,c=0;c<f-1;c++){var d=c*2;o[m++]=d,o[m++]=d+1,o[m++]=d+2,o[m++]=d+2,o[m++]=d+1,o[m++]=d+3}n.update(),s.update(),this.updateVertices()}}},e.prototype.updateVertices=function(){var t=this.points;if(!(t.length<1)){for(var i=t[0],n,s=0,a=0,o=this.buffers[0].data,h=t.length,u=0;u<h;u++){var l=t[u],f=u*4;u<t.length-1?n=t[u+1]:n=l,a=-(n.x-i.x),s=n.y-i.y;var c=Math.sqrt(s*s+a*a),d=this.textureScale>0?this.textureScale*this._width/2:this._width/2;s/=c,a/=c,s*=d,a*=d,o[f]=l.x+s,o[f+1]=l.y+a,o[f+2]=l.x-s,o[f+3]=l.y-a,i=l}this.buffers[0].update()}},e.prototype.update=function(){this.textureScale>0?this.build():this.updateVertices()},e}(Bn);(function(r){qi(e,r);function e(t,i,n){n===void 0&&(n=0);var s=this,a=new My(t.height,i,n),o=new Nr(t);return n>0&&(t.baseTexture.wrapMode=Re.REPEAT),s=r.call(this,a,o)||this,s.autoUpdate=!0,s}return e.prototype._render=function(t){var i=this.geometry;(this.autoUpdate||i._width!==this.shader.texture.height)&&(i._width=this.shader.texture.height,i.update()),r.prototype._render.call(this,t)},e})(Fr);var Dy=function(r){qi(e,r);function e(t,i,n){var s=this,a=new Iy(t.width,t.height,i,n),o=new Nr(V.WHITE);return s=r.call(this,a,o)||this,s.texture=t,s.autoResize=!0,s}return e.prototype.textureUpdated=function(){this._textureID=this.shader.texture._updateID;var t=this.geometry,i=this.shader.texture,n=i.width,s=i.height;this.autoResize&&(t.width!==n||t.height!==s)&&(t.width=this.shader.texture.width,t.height=this.shader.texture.height,t.build())},Object.defineProperty(e.prototype,"texture",{get:function(){return this.shader.texture},set:function(t){this.shader.texture!==t&&(this.shader.texture=t,this._textureID=-1,t.baseTexture.valid?this.textureUpdated():t.once("update",this.textureUpdated,this))},enumerable:!1,configurable:!0}),e.prototype._render=function(t){this._textureID!==this.shader.texture._updateID&&this.textureUpdated(),r.prototype._render.call(this,t)},e.prototype.destroy=function(t){this.shader.texture.off("update",this.textureUpdated,this),r.prototype.destroy.call(this,t)},e}(Fr);(function(r){qi(e,r);function e(t,i,n,s,a){t===void 0&&(t=V.EMPTY);var o=this,h=new Bn(i,n,s);h.getBuffer("aVertexPosition").static=!1;var u=new Nr(t);return o=r.call(this,h,u,null,a)||this,o.autoUpdate=!0,o}return Object.defineProperty(e.prototype,"vertices",{get:function(){return this.geometry.getBuffer("aVertexPosition").data},set:function(t){this.geometry.getBuffer("aVertexPosition").data=t},enumerable:!1,configurable:!0}),e.prototype._render=function(t){this.autoUpdate&&this.geometry.getBuffer("aVertexPosition").update(),r.prototype._render.call(this,t)},e})(Fr);var Xn=10;(function(r){qi(e,r);function e(t,i,n,s,a){i===void 0&&(i=Xn),n===void 0&&(n=Xn),s===void 0&&(s=Xn),a===void 0&&(a=Xn);var o=r.call(this,V.WHITE,4,4)||this;return o._origWidth=t.orig.width,o._origHeight=t.orig.height,o._width=o._origWidth,o._height=o._origHeight,o._leftWidth=i,o._rightWidth=s,o._topHeight=n,o._bottomHeight=a,o.texture=t,o}return e.prototype.textureUpdated=function(){this._textureID=this.shader.texture._updateID,this._refresh()},Object.defineProperty(e.prototype,"vertices",{get:function(){return this.geometry.getBuffer("aVertexPosition").data},set:function(t){this.geometry.getBuffer("aVertexPosition").data=t},enumerable:!1,configurable:!0}),e.prototype.updateHorizontalVertices=function(){var t=this.vertices,i=this._getMinScale();t[9]=t[11]=t[13]=t[15]=this._topHeight*i,t[17]=t[19]=t[21]=t[23]=this._height-this._bottomHeight*i,t[25]=t[27]=t[29]=t[31]=this._height},e.prototype.updateVerticalVertices=function(){var t=this.vertices,i=this._getMinScale();t[2]=t[10]=t[18]=t[26]=this._leftWidth*i,t[4]=t[12]=t[20]=t[28]=this._width-this._rightWidth*i,t[6]=t[14]=t[22]=t[30]=this._width},e.prototype._getMinScale=function(){var t=this._leftWidth+this._rightWidth,i=this._width>t?1:this._width/t,n=this._topHeight+this._bottomHeight,s=this._height>n?1:this._height/n,a=Math.min(i,s);return a},Object.defineProperty(e.prototype,"width",{get:function(){return this._width},set:function(t){this._width=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._height},set:function(t){this._height=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"leftWidth",{get:function(){return this._leftWidth},set:function(t){this._leftWidth=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rightWidth",{get:function(){return this._rightWidth},set:function(t){this._rightWidth=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"topHeight",{get:function(){return this._topHeight},set:function(t){this._topHeight=t,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bottomHeight",{get:function(){return this._bottomHeight},set:function(t){this._bottomHeight=t,this._refresh()},enumerable:!1,configurable:!0}),e.prototype._refresh=function(){var t=this.texture,i=this.geometry.buffers[1].data;this._origWidth=t.orig.width,this._origHeight=t.orig.height;var n=1/this._origWidth,s=1/this._origHeight;i[0]=i[8]=i[16]=i[24]=0,i[1]=i[3]=i[5]=i[7]=0,i[6]=i[14]=i[22]=i[30]=1,i[25]=i[27]=i[29]=i[31]=1,i[2]=i[10]=i[18]=i[26]=n*this._leftWidth,i[4]=i[12]=i[20]=i[28]=1-n*this._rightWidth,i[9]=i[11]=i[13]=i[15]=s*this._topHeight,i[17]=i[19]=i[21]=i[23]=1-s*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.geometry.buffers[0].update(),this.geometry.buffers[1].update()},e})(Dy);var Fa=function(r,e){return Fa=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},Fa(r,e)};function Fy(r,e){Fa(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}(function(r){Fy(e,r);function e(t,i){i===void 0&&(i=!0);var n=r.call(this,t[0]instanceof V?t[0]:t[0].texture)||this;return n._textures=null,n._durations=null,n._autoUpdate=i,n._isConnectedToTicker=!1,n.animationSpeed=1,n.loop=!0,n.updateAnchor=!1,n.onComplete=null,n.onFrameChange=null,n.onLoop=null,n._currentTime=0,n._playing=!1,n._previousFrame=null,n.textures=t,n}return e.prototype.stop=function(){this._playing&&(this._playing=!1,this._autoUpdate&&this._isConnectedToTicker&&(Ft.shared.remove(this.update,this),this._isConnectedToTicker=!1))},e.prototype.play=function(){this._playing||(this._playing=!0,this._autoUpdate&&!this._isConnectedToTicker&&(Ft.shared.add(this.update,this,re.HIGH),this._isConnectedToTicker=!0))},e.prototype.gotoAndStop=function(t){this.stop();var i=this.currentFrame;this._currentTime=t,i!==this.currentFrame&&this.updateTexture()},e.prototype.gotoAndPlay=function(t){var i=this.currentFrame;this._currentTime=t,i!==this.currentFrame&&this.updateTexture(),this.play()},e.prototype.update=function(t){if(this._playing){var i=this.animationSpeed*t,n=this.currentFrame;if(this._durations!==null){var s=this._currentTime%1*this._durations[this.currentFrame];for(s+=i/60*1e3;s<0;)this._currentTime--,s+=this._durations[this.currentFrame];var a=Math.sign(this.animationSpeed*t);for(this._currentTime=Math.floor(this._currentTime);s>=this._durations[this.currentFrame];)s-=this._durations[this.currentFrame]*a,this._currentTime+=a;this._currentTime+=s/this._durations[this.currentFrame]}else this._currentTime+=i;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):n!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFrame<n?this.onLoop():this.animationSpeed<0&&this.currentFrame>n&&this.onLoop()),this.updateTexture())}},e.prototype.updateTexture=function(){var t=this.currentFrame;this._previousFrame!==t&&(this._previousFrame=t,this._texture=this._textures[t],this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this.uvs=this._texture._uvs.uvsFloat32,this.updateAnchor&&this._anchor.copyFrom(this._texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame))},e.prototype.destroy=function(t){this.stop(),r.prototype.destroy.call(this,t),this.onComplete=null,this.onFrameChange=null,this.onLoop=null},e.fromFrames=function(t){for(var i=[],n=0;n<t.length;++n)i.push(V.from(t[n]));return new e(i)},e.fromImages=function(t){for(var i=[],n=0;n<t.length;++n)i.push(V.from(t[n]));return new e(i)},Object.defineProperty(e.prototype,"totalFrames",{get:function(){return this._textures.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"textures",{get:function(){return this._textures},set:function(t){if(t[0]instanceof V)this._textures=t,this._durations=null;else{this._textures=[],this._durations=[];for(var i=0;i<t.length;i++)this._textures.push(t[i].texture),this._durations.push(t[i].time)}this._previousFrame=null,this.gotoAndStop(0),this.updateTexture()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentFrame",{get:function(){var t=Math.floor(this._currentTime)%this._textures.length;return t<0&&(t+=this._textures.length),t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"playing",{get:function(){return this._playing},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"autoUpdate",{get:function(){return this._autoUpdate},set:function(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isConnectedToTicker?(Ft.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._playing&&(Ft.shared.add(this.update,this),this._isConnectedToTicker=!0))},enumerable:!1,configurable:!0}),e})(We);Ge.add(ym,Sm,Em,mg,Yg,Zh,Qg,fy,Hm,dg,pg,Zg,Bv,Dm);let Ki="sans-serif",Hn=null;const ii=new ei,Lu={chars:wt.ASCII},Ci=new ei;async function Bu(r){const e=new Hf(r.textFontFamilyDefault);try{await e.load()}catch(t){return console.error(t),console.warn(`loadBitmapFonts: font ${r.textFontFamilyDefault} failed to load, falling back to ${Ki}`),Gu(Ki,r)}return Ki=r.textFontFamilyDefault,Gu(Ki,r)}function Uu(r){ii.fontFamily=Ki,ii.fontSize=r.textSizeDefault,ii.lineHeight=r.textLineHeightDefault,Ci.fontFamily=Ki,Ci.fontSize=r.textSizeSmall,Ci.lineHeight=r.textLineHeightSmall}function Gu(r,e){Uu(e);const t={resolution:window.devicePixelRatio||2,...Lu};wt.from("NodeTextDefault",{...ii,fill:e.colorTextDefault},t);const i={fontName:"NodeTextDefault",fontSize:e.textSizeDefault};wt.from("NodeTextInverse",{...ii,fill:e.colorTextInverse},t);const n={fontName:"NodeTextInverse",fontSize:e.textSizeDefault};wt.from("TimeMarkerLabel",{...Ci,fill:e.colorTextSubdued},t);const s={fontName:"TimeMarkerLabel",fontSize:e.textSizeSmall};wt.from("PlayheadTimerLabel",{...Ci,fill:e.colorPlayheadBg},t);const a={fontName:"PlayheadTimerLabel",fontSize:e.textSizeSmall};return{nodeTextDefault:i,nodeTextInverse:n,nodeTextStyles:ii,timeMarkerLabel:s,playheadTimerLabel:a}}function Ny(r){Uu(r);const e={resolution:window.devicePixelRatio||2,...Lu};setTimeout(()=>{wt.uninstall("NodeTextDefault"),wt.from("NodeTextDefault",{...ii,fill:r.colorTextDefault},e),wt.uninstall("NodeTextInverse"),wt.from("NodeTextInverse",{...ii,fill:r.colorTextInverse},e),wt.uninstall("TimeMarkerLabel"),wt.from("TimeMarkerLabel",{...Ci,fill:r.colorTextSubdued},e),wt.uninstall("PlayheadTimerLabel"),wt.from("PlayheadTimerLabel",{...Ci,fill:r.colorPlayheadBg},e)},0)}const Wn=r=>(Hn||(Hn=Bu(r)),Hn),Ly=r=>{Hn=Bu(r)};class By extends yt{constructor(t,i){super();U(this,"appRef");U(this,"viewportRef");U(this,"layer",new ne);this.appRef=t,this.viewportRef=i,this.drawLayer(),this.initUpdater(),this.interactive=!0}drawLayer(){const{xPos:t,yPos:i,width:n,height:s}=this.getDimensions();this.layer.beginFill(16777215,1),this.layer.drawRect(t,i,n,s),this.layer.endFill(),this.layer.alpha=0,this.addChild(this.layer)}getDimensions(){return{xPos:this.viewportRef.left,yPos:this.viewportRef.top,width:this.viewportRef.right-this.viewportRef.left,height:this.viewportRef.bottom-this.viewportRef.top}}initUpdater(){this.appRef.ticker.add(()=>{this.update()},null,re.LOW)}update(){const{xPos:t,yPos:i,width:n,height:s}=this.getDimensions();this.x=t,this.y=i,this.width=n,this.height=s}}function Uy(r){kc();const e=new Nu({backgroundAlpha:0,width:r.clientWidth,height:r.clientHeight,resolution:window.devicePixelRatio||2,autoDensity:!0,antialias:!0,resizeTo:r});return r.appendChild(e.view),e.ticker.add(()=>{(r.clientWidth!==e.screen.width||r.clientHeight!==e.screen.height)&&(e.resizeTo=r)},null,re.LOW),e}async function Gy(){const{Viewport:r}=await Promise.resolve().then(()=>Dx);return r}async function ky(r,e){const t=await Gy(),{width:i,height:n}=e.screen,s=new t({screenWidth:i,screenHeight:n,passiveWheel:!1,interaction:e.renderer.plugins.interaction,divWheel:r,ticker:e.ticker});return s.drag({wheel:!1,pressDrag:!0}).wheel({trackpadPinch:!0,wheelZoom:!0}).pinch().clampZoom({minWidth:i/2,maxWidth:i*40}).decelerate({friction:.9}),e.stage.addChild(s),e.ticker.add(()=>{(s.screenWidth!==e.screen.width||s.screenHeight!==e.screen.height)&&s.resize(e.screen.width,e.screen.height)},null,re.LOW),s}let Te,we;const ku={multisample:2,resolution:4};function Xu(){Te=new Map,we=new Map}function Xy(){Te&&(Te.forEach(({cap:r,body:e})=>{r.destroy(),e.destroy()}),Te.clear(),Te=void 0),we&&(we.forEach(r=>{r.destroy()}),we.clear(),we=void 0)}function Hy({appRef:r,fill:e,borderRadius:t,boxCapWidth:i,height:n}){if(Te||Xu(),!(Te!=null&&Te.has(e))){const s=new ne;s.beginFill(e),s.moveTo(i,0),s.lineTo(i,n),s.lineTo(0+t,n),s.bezierCurveTo(0,n,0,n-t,0,n-t),s.lineTo(0,t),s.bezierCurveTo(0,0,t,0,t,0),s.lineTo(i,0),s.endFill();const a=new ne;a.beginFill(e),a.drawRect(0,0,1,n),a.endFill();const o=r.renderer.generateTexture(s,ku),h=r.renderer.generateTexture(a);Te.set(e,{cap:o,body:h})}return Te.get(e)}function Wy({appRef:r,strokeColor:e,edgeWidth:t,edgeLength:i}){if(we||Xu(),!(we!=null&&we.has(e))){const n=new ne;n.lineStyle(t,e,1,.5),n.moveTo(-i,-i),n.lineTo(0,0),n.lineTo(-i,i);const s=r.renderer.generateTexture(n,ku);we.set(e,s)}return we.get(e)}const Hu=64;class Vy extends yt{constructor({appRef:t,styles:i,sourceNode:n,targetNode:s}){super();U(this,"appRef");U(this,"styles");U(this,"sourceNode");U(this,"targetNode");U(this,"sourceX",0);U(this,"sourceY",0);U(this,"targetX",0);U(this,"targetY",0);U(this,"edge",new ne);U(this,"arrow",new yt);U(this,"unwatch");U(this,"getXBezier",(t,i)=>{const{sourceX:n,targetX:s}=this,a=(s-n)/2;return t+(a>Hu?a:Hu)*(i?-1:1)});this.appRef=t,this.styles=i,this.sourceNode=n,this.targetNode=s,this.assignStartAndEndPositions(),this.drawEdge(),this.addChild(this.edge),this.drawArrow(),this.addChild(this.arrow),this.unwatch=Q.watch([i],()=>{this.update(!0)},{deep:!0})}assignStartAndEndPositions(){this.sourceX=this.sourceNode.x+this.sourceNode.getChildByName(ss).getLocalBounds().width,this.sourceY=this.sourceNode.y+this.sourceNode.getChildByName(ss).getLocalBounds().height/2,this.targetX=this.targetNode.x,this.targetY=this.targetNode.y+this.targetNode.getChildByName(ss).getLocalBounds().height/2}drawEdge(){const{colorEdge:t,spacingEdgeWidth:i}=this.styles.value,{edge:n,sourceX:s,sourceY:a,targetX:o,targetY:h}=this,u=this.getXBezier(s),l=this.getXBezier(o,!0);n.clear(),n.lineStyle(i,t,1,.5),n.moveTo(s,a),n.bezierCurveTo(u,a,l,h,o-i,h)}drawArrow(t){const{arrow:i,targetX:n,targetY:s}=this;t&&i.removeChildren(),i.children.length>0&&i.position.set(n,s);const{colorEdge:a,spacingEdgeWidth:o,spacingNodeEdgeLength:h}=this.styles.value,u=Wy({appRef:this.appRef,strokeColor:a,edgeWidth:o,edgeLength:h}),l=new We(u);l.anchor.set(1,.5),i.addChild(l),i.position.set(n,s)}update(t){this.assignStartAndEndPositions(),this.drawEdge(),this.drawArrow(t)}destroy(){this.unwatch(),super.destroy.call(this)}}class zy extends yt{constructor({labelText:t,styles:i,appHeight:n}){super();U(this,"labelText");U(this,"styles");U(this,"appHeight");U(this,"guideLine",new ne);U(this,"label");this.labelText=t,this.styles=i,this.appHeight=n,this.drawGuideLine(),this.addChild(this.guideLine),this.drawLabel(),this.interactive=!1}drawGuideLine(){const{colorGuideLine:t}=this.styles.value;this.guideLine.clear(),this.guideLine.beginFill(t),this.guideLine.drawRect(0,0,1,this.appHeight),this.guideLine.endFill()}async drawLabel(){var t;if(this.labelText){const i=await Wn(this.styles.value),{spacingGuideLabelPadding:n}=this.styles.value;(t=this.label)==null||t.destroy(),this.label=new kn(this.labelText,i.timeMarkerLabel),this.label.position.set(n,n),this.addChild(this.label)}}updateHeight(t){this.appHeight=t,this.drawGuideLine()}}let ae;const Yy=({minimumStartTime:r,overallGraphWidth:e,initialOverallTimeSpan:t})=>({dateToX:Zy(r,e,t),xToDate:qy(r,e,t)}),jy=({minimumStartTime:r,overallGraphWidth:e,initialOverallTimeSpan:t})=>(ae=Yy({minimumStartTime:r,overallGraphWidth:e,initialOverallTimeSpan:t}),ae);function Zy(r,e,t){return function(i){return Math.ceil((i.getTime()-r)*(e/t))}}function qy(r,e,t){return function(i){return Math.ceil(r+i*(t/e))}}const Ky=260,Na=4e3;class $y extends yt{constructor({viewportRef:t,appRef:i,minimumStartDate:n,maximumEndDate:s,isRunning:a,styles:o,formatDateFns:h}){super();U(this,"viewportRef");U(this,"appRef");U(this,"minimumStartDate");U(this,"maximumEndDate");U(this,"isRunning");U(this,"styles");U(this,"formatDateFns");U(this,"unwatch");U(this,"idealGuideCount",10);U(this,"currentTimeGap",120);U(this,"labelFormatter",t=>t.toLocaleTimeString());U(this,"guides",new Map);this.viewportRef=t,this.appRef=i,this.minimumStartDate=n,this.maximumEndDate=s,this.isRunning=a,this.styles=o,this.formatDateFns=h,this.updateIdealGuideCount(),this.updateCurrentTimeGap(),this.createGuides(),this.unwatch=Q.watch(o,()=>{this.removeChildren(),this.guides.clear(),this.createGuides()},{deep:!0}),this.interactive=!1}updateGuides(){const t=this.currentTimeGap;this.updateCurrentTimeGap(),this.isRedrawRequired(t)?(this.guides.size>0&&(this.removeChildren(),this.guides.clear()),this.createGuides()):this.updateGuidePositions()}updateIdealGuideCount(){this.idealGuideCount=Math.ceil(this.appRef.screen.width/Ky)}updateCurrentTimeGap(){const t=Math.ceil((this.viewportRef.right-this.viewportRef.left)/this.idealGuideCount),i=ae.xToDate(t)-this.minimumStartDate.getTime(),n=Oo.find(s=>s.ceiling>i)??Oo[0];this.currentTimeGap=n.span,this.setLabelFormatter(n.labelFormat)}createGuides(){let t;const i=ae.xToDate(ae.dateToX(this.maximumEndDate.value??new Date)+Na);let n=new Date(Math.ceil(ae.xToDate(-Na)/this.currentTimeGap)*this.currentTimeGap);for(this.currentTimeGap>K.hour*6?n=Lf(n):this.currentTimeGap>K.hour&&(n=Bf(n)),t=n;t.getTime()<i;){const s=new zy({labelText:this.labelFormatter(t),styles:this.styles,appHeight:this.appRef.screen.height});s.position.set(this.getGuidePosition(t),0),this.guides.set(t,s),this.addChild(s),t=new Date(t.getTime()+this.currentTimeGap)}}getGuidePosition(t){return ae.dateToX(t)*this.viewportRef.scale._x+this.viewportRef.worldTransform.tx}updateGuidePositions(){this.guides.forEach((t,i)=>{this.getGuidePosition(i)!==t.position.x&&t.position.set(this.getGuidePosition(i),0),t.height!==this.appRef.screen.height&&t.updateHeight(this.appRef.screen.height)})}setLabelFormatter(t){switch(t){case Ot.minutes:this.labelFormatter=this.formatByMinutesWithDates;break;case Ot.date:this.labelFormatter=this.formatDateFns.value.date;break;default:this.labelFormatter=this.formatDateFns.value.timeBySeconds}}formatByMinutesWithDates(t){return t.getHours()===0&&t.getMinutes()===0?`${this.formatDateFns.value.date(t)}
1061
+ ${this.formatDateFns.value.timeByMinutes(t)}`:this.formatDateFns.value.timeByMinutes(t)}isRedrawRequired(t){return t!==this.currentTimeGap||this.noGuidesExist()||this.isGuideLengthOutdated()}noGuidesExist(){return this.guides.size===0}isGuideLengthOutdated(){var n;if(!this.isRunning)return!1;const t=(n=Array.from(this.guides).pop())==null?void 0:n[1];if(!t||!this.maximumEndDate.value)return!1;const i=this.getGuidePosition(this.maximumEndDate.value)+Na*this.viewportRef.scale._x-ae.dateToX(new Date(this.minimumStartDate.getTime()+this.currentTimeGap))*this.viewportRef.scale._x;return t.x<i}destroy(){this.removeChildren(),this.guides.forEach(t=>t.destroy()),this.guides.clear(),this.unwatch(),super.destroy.call(this)}}function Ve(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function Wu(r,e){r.prototype=Object.create(e.prototype),r.prototype.constructor=r,r.__proto__=e}var $t={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},$i={duration:.5,overwrite:!1,delay:0},La,kt,Rt,oe=1e8,at=1/oe,Ba=Math.PI*2,Jy=Ba/4,Qy=0,Vu=Math.sqrt,t0=Math.cos,e0=Math.sin,Nt=function(e){return typeof e=="string"},bt=function(e){return typeof e=="function"},ze=function(e){return typeof e=="number"},Ua=function(e){return typeof e>"u"},Ie=function(e){return typeof e=="object"},zt=function(e){return e!==!1},zu=function(){return typeof window<"u"},Vn=function(e){return bt(e)||Nt(e)},Yu=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},Xt=Array.isArray,Ga=/(?:-?\.?\d|\.)+/gi,ju=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,Ji=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,ka=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,Zu=/[+-]=-?[.\d]+/,qu=/[^,'"\[\]\s]+/gi,i0=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,vt,he,Xa,Ha,Jt={},zn={},Ku,$u=function(e){return(zn=Ai(e,Jt))&&ee},Wa=function(e,t){return console.warn("Invalid property",e,"set to",t,"Missing plugin? gsap.registerPlugin()")},Yn=function(e,t){return!t&&console.warn(e)},Ju=function(e,t){return e&&(Jt[e]=t)&&zn&&(zn[e]=t)||Jt},Lr=function(){return 0},r0={suppressEvents:!0,isStart:!0,kill:!1},jn={suppressEvents:!0,kill:!1},n0={suppressEvents:!0},Va={},ri=[],za={},Qu,Qt={},Ya={},tl=30,Zn=[],ja="",Za=function(e){var t=e[0],i,n;if(Ie(t)||bt(t)||(e=[e]),!(i=(t._gsap||{}).harness)){for(n=Zn.length;n--&&!Zn[n].targetTest(t););i=Zn[n]}for(n=e.length;n--;)e[n]&&(e[n]._gsap||(e[n]._gsap=new Rl(e[n],i)))||e.splice(n,1);return e},Oi=function(e){return e._gsap||Za(fe(e))[0]._gsap},el=function(e,t,i){return(i=e[t])&&bt(i)?e[t]():Ua(i)&&e.getAttribute&&e.getAttribute(t)||i},Yt=function(e,t){return(e=e.split(",")).forEach(t)||e},Et=function(e){return Math.round(e*1e5)/1e5||0},Ut=function(e){return Math.round(e*1e7)/1e7||0},Qi=function(e,t){var i=t.charAt(0),n=parseFloat(t.substr(2));return e=parseFloat(e),i==="+"?e+n:i==="-"?e-n:i==="*"?e*n:e/n},s0=function(e,t){for(var i=t.length,n=0;e.indexOf(t[n])<0&&++n<i;);return n<i},qn=function(){var e=ri.length,t=ri.slice(0),i,n;for(za={},ri.length=0,i=0;i<e;i++)n=t[i],n&&n._lazy&&(n.render(n._lazy[0],n._lazy[1],!0)._lazy=0)},il=function(e,t,i,n){ri.length&&!kt&&qn(),e.render(t,i,n||kt&&t<0&&(e._initted||e._startAt)),ri.length&&!kt&&qn()},rl=function(e){var t=parseFloat(e);return(t||t===0)&&(e+"").match(qu).length<2?t:Nt(e)?e.trim():e},nl=function(e){return e},ue=function(e,t){for(var i in t)i in e||(e[i]=t[i]);return e},a0=function(e){return function(t,i){for(var n in i)n in t||n==="duration"&&e||n==="ease"||(t[n]=i[n])}},Ai=function(e,t){for(var i in t)e[i]=t[i];return e},sl=function r(e,t){for(var i in t)i!=="__proto__"&&i!=="constructor"&&i!=="prototype"&&(e[i]=Ie(t[i])?r(e[i]||(e[i]={}),t[i]):t[i]);return e},Kn=function(e,t){var i={},n;for(n in e)n in t||(i[n]=e[n]);return i},Br=function(e){var t=e.parent||vt,i=e.keyframes?a0(Xt(e.keyframes)):ue;if(zt(e.inherit))for(;t;)i(e,t.vars.defaults),t=t.parent||t._dp;return e},o0=function(e,t){for(var i=e.length,n=i===t.length;n&&i--&&e[i]===t[i];);return i<0},al=function(e,t,i,n,s){i===void 0&&(i="_first"),n===void 0&&(n="_last");var a=e[n],o;if(s)for(o=t[s];a&&a[s]>o;)a=a._prev;return a?(t._next=a._next,a._next=t):(t._next=e[i],e[i]=t),t._next?t._next._prev=t:e[n]=t,t._prev=a,t.parent=t._dp=e,t},$n=function(e,t,i,n){i===void 0&&(i="_first"),n===void 0&&(n="_last");var s=t._prev,a=t._next;s?s._next=a:e[i]===t&&(e[i]=a),a?a._prev=s:e[n]===t&&(e[n]=s),t._next=t._prev=t.parent=null},ni=function(e,t){e.parent&&(!t||e.parent.autoRemoveChildren)&&e.parent.remove(e),e._act=0},Ii=function(e,t){if(e&&(!t||t._end>e._dur||t._start<0))for(var i=e;i;)i._dirty=1,i=i.parent;return e},h0=function(e){for(var t=e.parent;t&&t.parent;)t._dirty=1,t.totalDuration(),t=t.parent;return e},qa=function(e,t,i,n){return e._startAt&&(kt?e._startAt.revert(jn):e.vars.immediateRender&&!e.vars.autoRevert||e._startAt.render(t,!0,n))},u0=function r(e){return!e||e._ts&&r(e.parent)},ol=function(e){return e._repeat?tr(e._tTime,e=e.duration()+e._rDelay)*e:0},tr=function(e,t){var i=Math.floor(e/=t);return e&&i===e?i-1:i},Jn=function(e,t){return(e-t._start)*t._ts+(t._ts>=0?0:t._dirty?t.totalDuration():t._tDur)},Qn=function(e){return e._end=Ut(e._start+(e._tDur/Math.abs(e._ts||e._rts||at)||0))},ts=function(e,t){var i=e._dp;return i&&i.smoothChildTiming&&e._ts&&(e._start=Ut(i._time-(e._ts>0?t/e._ts:((e._dirty?e.totalDuration():e._tDur)-t)/-e._ts)),Qn(e),i._dirty||Ii(i,e)),e},hl=function(e,t){var i;if((t._time||t._initted&&!t._dur)&&(i=Jn(e.rawTime(),t),(!t._dur||Gr(0,t.totalDuration(),i)-t._tTime>at)&&t.render(i,!0)),Ii(e,t)._dp&&e._initted&&e._time>=e._dur&&e._ts){if(e._dur<e.duration())for(i=e;i._dp;)i.rawTime()>=0&&i.totalTime(i._tTime),i=i._dp;e._zTime=-at}},Me=function(e,t,i,n){return t.parent&&ni(t),t._start=Ut((ze(i)?i:i||e!==vt?le(e,i,t):e._time)+t._delay),t._end=Ut(t._start+(t.totalDuration()/Math.abs(t.timeScale())||0)),al(e,t,"_first","_last",e._sort?"_start":0),Ka(t)||(e._recent=t),n||hl(e,t),e._ts<0&&ts(e,e._tTime),e},ul=function(e,t){return(Jt.ScrollTrigger||Wa("scrollTrigger",t))&&Jt.ScrollTrigger.create(t,e)},ll=function(e,t,i,n,s){if(so(e,t,s),!e._initted)return 1;if(!i&&e._pt&&!kt&&(e._dur&&e.vars.lazy!==!1||!e._dur&&e.vars.lazy)&&Qu!==te.frame)return ri.push(e),e._lazy=[s,n],1},l0=function r(e){var t=e.parent;return t&&t._ts&&t._initted&&!t._lock&&(t.rawTime()<0||r(t))},Ka=function(e){var t=e.data;return t==="isFromStart"||t==="isStart"},f0=function(e,t,i,n){var s=e.ratio,a=t<0||!t&&(!e._start&&l0(e)&&!(!e._initted&&Ka(e))||(e._ts<0||e._dp._ts<0)&&!Ka(e))?0:1,o=e._rDelay,h=0,u,l,f;if(o&&e._repeat&&(h=Gr(0,e._tDur,t),l=tr(h,o),e._yoyo&&l&1&&(a=1-a),l!==tr(e._tTime,o)&&(s=1-a,e.vars.repeatRefresh&&e._initted&&e.invalidate())),a!==s||kt||n||e._zTime===at||!t&&e._zTime){if(!e._initted&&ll(e,t,n,i,h))return;for(f=e._zTime,e._zTime=t||(i?at:0),i||(i=t&&!f),e.ratio=a,e._from&&(a=1-a),e._time=0,e._tTime=h,u=e._pt;u;)u.r(a,u.d),u=u._next;t<0&&qa(e,t,i,!0),e._onUpdate&&!i&&ce(e,"onUpdate"),h&&e._repeat&&!i&&e.parent&&ce(e,"onRepeat"),(t>=e._tDur||t<0)&&e.ratio===a&&(a&&ni(e,1),!i&&!kt&&(ce(e,a?"onComplete":"onReverseComplete",!0),e._prom&&e._prom()))}else e._zTime||(e._zTime=t)},c0=function(e,t,i){var n;if(i>t)for(n=e._first;n&&n._start<=i;){if(n.data==="isPause"&&n._start>t)return n;n=n._next}else for(n=e._last;n&&n._start>=i;){if(n.data==="isPause"&&n._start<t)return n;n=n._prev}},er=function(e,t,i,n){var s=e._repeat,a=Ut(t)||0,o=e._tTime/e._tDur;return o&&!n&&(e._time*=a/e._dur),e._dur=a,e._tDur=s?s<0?1e10:Ut(a*(s+1)+e._rDelay*s):a,o>0&&!n&&ts(e,e._tTime=e._tDur*o),e.parent&&Qn(e),i||Ii(e.parent,e),e},fl=function(e){return e instanceof jt?Ii(e):er(e,e._dur)},d0={_start:0,endTime:Lr,totalDuration:Lr},le=function r(e,t,i){var n=e.labels,s=e._recent||d0,a=e.duration()>=oe?s.endTime(!1):e._dur,o,h,u;return Nt(t)&&(isNaN(t)||t in n)?(h=t.charAt(0),u=t.substr(-1)==="%",o=t.indexOf("="),h==="<"||h===">"?(o>=0&&(t=t.replace(/=/,"")),(h==="<"?s._start:s.endTime(s._repeat>=0))+(parseFloat(t.substr(1))||0)*(u?(o<0?s:i).totalDuration()/100:1)):o<0?(t in n||(n[t]=a),n[t]):(h=parseFloat(t.charAt(o-1)+t.substr(o+1)),u&&i&&(h=h/100*(Xt(i)?i[0]:i).totalDuration()),o>1?r(e,t.substr(0,o-1),i)+h:a+h)):t==null?a:+t},Ur=function(e,t,i){var n=ze(t[1]),s=(n?2:1)+(e<2?0:1),a=t[s],o,h;if(n&&(a.duration=t[1]),a.parent=i,e){for(o=a,h=i;h&&!("immediateRender"in o);)o=h.vars.defaults||{},h=zt(h.vars.inherit)&&h.parent;a.immediateRender=zt(o.immediateRender),e<2?a.runBackwards=1:a.startAt=t[s-1]}return new It(t[0],a,t[s+1])},si=function(e,t){return e||e===0?t(e):t},Gr=function(e,t,i){return i<e?e:i>t?t:i},Ht=function(e,t){return!Nt(e)||!(t=i0.exec(e))?"":t[1]},p0=function(e,t,i){return si(i,function(n){return Gr(e,t,n)})},$a=[].slice,cl=function(e,t){return e&&Ie(e)&&"length"in e&&(!t&&!e.length||e.length-1 in e&&Ie(e[0]))&&!e.nodeType&&e!==he},v0=function(e,t,i){return i===void 0&&(i=[]),e.forEach(function(n){var s;return Nt(n)&&!t||cl(n,1)?(s=i).push.apply(s,fe(n)):i.push(n)})||i},fe=function(e,t,i){return Rt&&!t&&Rt.selector?Rt.selector(e):Nt(e)&&!i&&(Xa||!rr())?$a.call((t||Ha).querySelectorAll(e),0):Xt(e)?v0(e,i):cl(e)?$a.call(e,0):e?[e]:[]},Ja=function(e){return e=fe(e)[0]||Yn("Invalid scope")||{},function(t){var i=e.current||e.nativeElement||e;return fe(t,i.querySelectorAll?i:i===e?Yn("Invalid scope")||Ha.createElement("div"):e)}},dl=function(e){return e.sort(function(){return .5-Math.random()})},pl=function(e){if(bt(e))return e;var t=Ie(e)?e:{each:e},i=Mi(t.ease),n=t.from||0,s=parseFloat(t.base)||0,a={},o=n>0&&n<1,h=isNaN(n)||o,u=t.axis,l=n,f=n;return Nt(n)?l=f={center:.5,edges:.5,end:1}[n]||0:!o&&h&&(l=n[0],f=n[1]),function(c,d,v){var p=(v||t).length,_=a[p],m,g,y,b,x,T,w,S,E;if(!_){if(E=t.grid==="auto"?0:(t.grid||[1,oe])[1],!E){for(w=-oe;w<(w=v[E++].getBoundingClientRect().left)&&E<p;);E--}for(_=a[p]=[],m=h?Math.min(E,p)*l-.5:n%E,g=E===oe?0:h?p*f/E-.5:n/E|0,w=0,S=oe,T=0;T<p;T++)y=T%E-m,b=g-(T/E|0),_[T]=x=u?Math.abs(u==="y"?b:y):Vu(y*y+b*b),x>w&&(w=x),x<S&&(S=x);n==="random"&&dl(_),_.max=w-S,_.min=S,_.v=p=(parseFloat(t.amount)||parseFloat(t.each)*(E>p?p-1:u?u==="y"?p/E:E:Math.max(E,p/E))||0)*(n==="edges"?-1:1),_.b=p<0?s-p:s,_.u=Ht(t.amount||t.each)||0,i=i&&p<0?El(i):i}return p=(_[c]-_.min)/_.max||0,Ut(_.b+(i?i(p):p)*_.v)+_.u}},Qa=function(e){var t=Math.pow(10,((e+"").split(".")[1]||"").length);return function(i){var n=Ut(Math.round(parseFloat(i)/e)*e*t);return(n-n%1)/t+(ze(i)?0:Ht(i))}},vl=function(e,t){var i=Xt(e),n,s;return!i&&Ie(e)&&(n=i=e.radius||oe,e.values?(e=fe(e.values),(s=!ze(e[0]))&&(n*=n)):e=Qa(e.increment)),si(t,i?bt(e)?function(a){return s=e(a),Math.abs(s-a)<=n?s:a}:function(a){for(var o=parseFloat(s?a.x:a),h=parseFloat(s?a.y:0),u=oe,l=0,f=e.length,c,d;f--;)s?(c=e[f].x-o,d=e[f].y-h,c=c*c+d*d):c=Math.abs(e[f]-o),c<u&&(u=c,l=f);return l=!n||u<=n?e[l]:a,s||l===a||ze(a)?l:l+Ht(a)}:Qa(e))},_l=function(e,t,i,n){return si(Xt(e)?!t:i===!0?!!(i=0):!n,function(){return Xt(e)?e[~~(Math.random()*e.length)]:(i=i||1e-5)&&(n=i<1?Math.pow(10,(i+"").length-2):1)&&Math.floor(Math.round((e-i/2+Math.random()*(t-e+i*.99))/i)*i*n)/n})},_0=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return function(n){return t.reduce(function(s,a){return a(s)},n)}},m0=function(e,t){return function(i){return e(parseFloat(i))+(t||Ht(i))}},g0=function(e,t,i){return gl(e,t,0,1,i)},ml=function(e,t,i){return si(i,function(n){return e[~~t(n)]})},y0=function r(e,t,i){var n=t-e;return Xt(e)?ml(e,r(0,e.length),t):si(i,function(s){return(n+(s-e)%n)%n+e})},x0=function r(e,t,i){var n=t-e,s=n*2;return Xt(e)?ml(e,r(0,e.length-1),t):si(i,function(a){return a=(s+(a-e)%s)%s||0,e+(a>n?s-a:a)})},kr=function(e){for(var t=0,i="",n,s,a,o;~(n=e.indexOf("random(",t));)a=e.indexOf(")",n),o=e.charAt(n+7)==="[",s=e.substr(n+7,a-n-7).match(o?qu:Ga),i+=e.substr(t,n-t)+_l(o?s:+s[0],o?0:+s[1],+s[2]||1e-5),t=a+1;return i+e.substr(t,e.length-t)},gl=function(e,t,i,n,s){var a=t-e,o=n-i;return si(s,function(h){return i+((h-e)/a*o||0)})},b0=function r(e,t,i,n){var s=isNaN(e+t)?0:function(d){return(1-d)*e+d*t};if(!s){var a=Nt(e),o={},h,u,l,f,c;if(i===!0&&(n=1)&&(i=null),a)e={p:e},t={p:t};else if(Xt(e)&&!Xt(t)){for(l=[],f=e.length,c=f-2,u=1;u<f;u++)l.push(r(e[u-1],e[u]));f--,s=function(v){v*=f;var p=Math.min(c,~~v);return l[p](v-p)},i=t}else n||(e=Ai(Xt(e)?[]:{},e));if(!l){for(h in t)ro.call(o,e,h,"get",t[h]);s=function(v){return ho(v,o)||(a?e.p:e)}}}return si(i,s)},yl=function(e,t,i){var n=e.labels,s=oe,a,o,h;for(a in n)o=n[a]-t,o<0==!!i&&o&&s>(o=Math.abs(o))&&(h=a,s=o);return h},ce=function(e,t,i){var n=e.vars,s=n[t],a=Rt,o=e._ctx,h,u,l;if(s)return h=n[t+"Params"],u=n.callbackScope||e,i&&ri.length&&qn(),o&&(Rt=o),l=h?s.apply(u,h):s.call(u),Rt=a,l},Xr=function(e){return ni(e),e.scrollTrigger&&e.scrollTrigger.kill(!!kt),e.progress()<1&&ce(e,"onInterrupt"),e},ir,T0=function(e){e=!e.name&&e.default||e;var t=e.name,i=bt(e),n=t&&!i&&e.init?function(){this._props=[]}:e,s={init:Lr,render:ho,add:ro,kill:U0,modifier:B0,rawVars:0},a={targetTest:0,get:0,getSetter:oo,aliases:{},register:0};if(rr(),e!==n){if(Qt[t])return;ue(n,ue(Kn(e,s),a)),Ai(n.prototype,Ai(s,Kn(e,a))),Qt[n.prop=t]=n,e.targetTest&&(Zn.push(n),Va[t]=1),t=(t==="css"?"CSS":t.charAt(0).toUpperCase()+t.substr(1))+"Plugin"}Ju(t,n),e.register&&e.register(ee,n,Zt)},ot=255,Hr={aqua:[0,ot,ot],lime:[0,ot,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,ot],navy:[0,0,128],white:[ot,ot,ot],olive:[128,128,0],yellow:[ot,ot,0],orange:[ot,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[ot,0,0],pink:[ot,192,203],cyan:[0,ot,ot],transparent:[ot,ot,ot,0]},to=function(e,t,i){return e+=e<0?1:e>1?-1:0,(e*6<1?t+(i-t)*e*6:e<.5?i:e*3<2?t+(i-t)*(2/3-e)*6:t)*ot+.5|0},xl=function(e,t,i){var n=e?ze(e)?[e>>16,e>>8&ot,e&ot]:0:Hr.black,s,a,o,h,u,l,f,c,d,v;if(!n){if(e.substr(-1)===","&&(e=e.substr(0,e.length-1)),Hr[e])n=Hr[e];else if(e.charAt(0)==="#"){if(e.length<6&&(s=e.charAt(1),a=e.charAt(2),o=e.charAt(3),e="#"+s+s+a+a+o+o+(e.length===5?e.charAt(4)+e.charAt(4):"")),e.length===9)return n=parseInt(e.substr(1,6),16),[n>>16,n>>8&ot,n&ot,parseInt(e.substr(7),16)/255];e=parseInt(e.substr(1),16),n=[e>>16,e>>8&ot,e&ot]}else if(e.substr(0,3)==="hsl"){if(n=v=e.match(Ga),!t)h=+n[0]%360/360,u=+n[1]/100,l=+n[2]/100,a=l<=.5?l*(u+1):l+u-l*u,s=l*2-a,n.length>3&&(n[3]*=1),n[0]=to(h+1/3,s,a),n[1]=to(h,s,a),n[2]=to(h-1/3,s,a);else if(~e.indexOf("="))return n=e.match(ju),i&&n.length<4&&(n[3]=1),n}else n=e.match(Ga)||Hr.transparent;n=n.map(Number)}return t&&!v&&(s=n[0]/ot,a=n[1]/ot,o=n[2]/ot,f=Math.max(s,a,o),c=Math.min(s,a,o),l=(f+c)/2,f===c?h=u=0:(d=f-c,u=l>.5?d/(2-f-c):d/(f+c),h=f===s?(a-o)/d+(a<o?6:0):f===a?(o-s)/d+2:(s-a)/d+4,h*=60),n[0]=~~(h+.5),n[1]=~~(u*100+.5),n[2]=~~(l*100+.5)),i&&n.length<4&&(n[3]=1),n},bl=function(e){var t=[],i=[],n=-1;return e.split(ai).forEach(function(s){var a=s.match(Ji)||[];t.push.apply(t,a),i.push(n+=a.length+1)}),t.c=i,t},Tl=function(e,t,i){var n="",s=(e+n).match(ai),a=t?"hsla(":"rgba(",o=0,h,u,l,f;if(!s)return e;if(s=s.map(function(c){return(c=xl(c,t,1))&&a+(t?c[0]+","+c[1]+"%,"+c[2]+"%,"+c[3]:c.join(","))+")"}),i&&(l=bl(e),h=i.c,h.join(n)!==l.c.join(n)))for(u=e.replace(ai,"1").split(Ji),f=u.length-1;o<f;o++)n+=u[o]+(~h.indexOf(o)?s.shift()||a+"0,0,0,0)":(l.length?l:s.length?s:i).shift());if(!u)for(u=e.split(ai),f=u.length-1;o<f;o++)n+=u[o]+s[o];return n+u[f]},ai=function(){var r="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",e;for(e in Hr)r+="|"+e+"\\b";return new RegExp(r+")","gi")}(),w0=/hsl[a]?\(/,wl=function(e){var t=e.join(" "),i;if(ai.lastIndex=0,ai.test(t))return i=w0.test(t),e[1]=Tl(e[1],i),e[0]=Tl(e[0],i,bl(e[1])),!0},Wr,te=function(){var r=Date.now,e=500,t=33,i=r(),n=i,s=1e3/240,a=s,o=[],h,u,l,f,c,d,v=function p(_){var m=r()-n,g=_===!0,y,b,x,T;if(m>e&&(i+=m-t),n+=m,x=n-i,y=x-a,(y>0||g)&&(T=++f.frame,c=x-f.time*1e3,f.time=x=x/1e3,a+=y+(y>=s?4:s-y),b=1),g||(h=u(p)),b)for(d=0;d<o.length;d++)o[d](x,c,T,_)};return f={time:0,frame:0,tick:function(){v(!0)},deltaRatio:function(_){return c/(1e3/(_||60))},wake:function(){Ku&&(!Xa&&zu()&&(he=Xa=window,Ha=he.document||{},Jt.gsap=ee,(he.gsapVersions||(he.gsapVersions=[])).push(ee.version),$u(zn||he.GreenSockGlobals||!he.gsap&&he||{}),l=he.requestAnimationFrame),h&&f.sleep(),u=l||function(_){return setTimeout(_,a-f.time*1e3+1|0)},Wr=1,v(2))},sleep:function(){(l?he.cancelAnimationFrame:clearTimeout)(h),Wr=0,u=Lr},lagSmoothing:function(_,m){e=_||1/0,t=Math.min(m||33,e)},fps:function(_){s=1e3/(_||240),a=f.time*1e3+s},add:function(_,m,g){var y=m?function(b,x,T,w){_(b,x,T,w),f.remove(y)}:_;return f.remove(_),o[g?"unshift":"push"](y),rr(),y},remove:function(_,m){~(m=o.indexOf(_))&&o.splice(m,1)&&d>=m&&d--},_listeners:o},f}(),rr=function(){return!Wr&&te.wake()},$={},E0=/^[\d.\-M][\d.\-,\s]/,S0=/["']/g,P0=function(e){for(var t={},i=e.substr(1,e.length-3).split(":"),n=i[0],s=1,a=i.length,o,h,u;s<a;s++)h=i[s],o=s!==a-1?h.lastIndexOf(","):h.length,u=h.substr(0,o),t[n]=isNaN(u)?u.replace(S0,"").trim():+u,n=h.substr(o+1).trim();return t},R0=function(e){var t=e.indexOf("(")+1,i=e.indexOf(")"),n=e.indexOf("(",t);return e.substring(t,~n&&n<i?e.indexOf(")",i+1):i)},C0=function(e){var t=(e+"").split("("),i=$[t[0]];return i&&t.length>1&&i.config?i.config.apply(null,~e.indexOf("{")?[P0(t[1])]:R0(e).split(",").map(rl)):$._CE&&E0.test(e)?$._CE("",e):i},El=function(e){return function(t){return 1-e(1-t)}},Sl=function r(e,t){for(var i=e._first,n;i;)i instanceof jt?r(i,t):i.vars.yoyoEase&&(!i._yoyo||!i._repeat)&&i._yoyo!==t&&(i.timeline?r(i.timeline,t):(n=i._ease,i._ease=i._yEase,i._yEase=n,i._yoyo=t)),i=i._next},Mi=function(e,t){return e&&(bt(e)?e:$[e]||C0(e))||t},Di=function(e,t,i,n){i===void 0&&(i=function(h){return 1-t(1-h)}),n===void 0&&(n=function(h){return h<.5?t(h*2)/2:1-t((1-h)*2)/2});var s={easeIn:t,easeOut:i,easeInOut:n},a;return Yt(e,function(o){$[o]=Jt[o]=s,$[a=o.toLowerCase()]=i;for(var h in s)$[a+(h==="easeIn"?".in":h==="easeOut"?".out":".inOut")]=$[o+"."+h]=s[h]}),s},Pl=function(e){return function(t){return t<.5?(1-e(1-t*2))/2:.5+e((t-.5)*2)/2}},eo=function r(e,t,i){var n=t>=1?t:1,s=(i||(e?.3:.45))/(t<1?t:1),a=s/Ba*(Math.asin(1/n)||0),o=function(l){return l===1?1:n*Math.pow(2,-10*l)*e0((l-a)*s)+1},h=e==="out"?o:e==="in"?function(u){return 1-o(1-u)}:Pl(o);return s=Ba/s,h.config=function(u,l){return r(e,u,l)},h},io=function r(e,t){t===void 0&&(t=1.70158);var i=function(a){return a?--a*a*((t+1)*a+t)+1:0},n=e==="out"?i:e==="in"?function(s){return 1-i(1-s)}:Pl(i);return n.config=function(s){return r(e,s)},n};Yt("Linear,Quad,Cubic,Quart,Quint,Strong",function(r,e){var t=e<5?e+1:e;Di(r+",Power"+(t-1),e?function(i){return Math.pow(i,t)}:function(i){return i},function(i){return 1-Math.pow(1-i,t)},function(i){return i<.5?Math.pow(i*2,t)/2:1-Math.pow((1-i)*2,t)/2})}),$.Linear.easeNone=$.none=$.Linear.easeIn,Di("Elastic",eo("in"),eo("out"),eo()),function(r,e){var t=1/e,i=2*t,n=2.5*t,s=function(o){return o<t?r*o*o:o<i?r*Math.pow(o-1.5/e,2)+.75:o<n?r*(o-=2.25/e)*o+.9375:r*Math.pow(o-2.625/e,2)+.984375};Di("Bounce",function(a){return 1-s(1-a)},s)}(7.5625,2.75),Di("Expo",function(r){return r?Math.pow(2,10*(r-1)):0}),Di("Circ",function(r){return-(Vu(1-r*r)-1)}),Di("Sine",function(r){return r===1?1:-t0(r*Jy)+1}),Di("Back",io("in"),io("out"),io()),$.SteppedEase=$.steps=Jt.SteppedEase={config:function(e,t){e===void 0&&(e=1);var i=1/e,n=e+(t?0:1),s=t?1:0,a=1-at;return function(o){return((n*Gr(0,a,o)|0)+s)*i}}},$i.ease=$["quad.out"],Yt("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(r){return ja+=r+","+r+"Params,"});var Rl=function(e,t){this.id=Qy++,e._gsap=this,this.target=e,this.harness=t,this.get=t?t.get:el,this.set=t?t.getSetter:oo},nr=function(){function r(t){this.vars=t,this._delay=+t.delay||0,(this._repeat=t.repeat===1/0?-2:t.repeat||0)&&(this._rDelay=t.repeatDelay||0,this._yoyo=!!t.yoyo||!!t.yoyoEase),this._ts=1,er(this,+t.duration,1,1),this.data=t.data,Rt&&(this._ctx=Rt,Rt.data.push(this)),Wr||te.wake()}var e=r.prototype;return e.delay=function(i){return i||i===0?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+i-this._delay),this._delay=i,this):this._delay},e.duration=function(i){return arguments.length?this.totalDuration(this._repeat>0?i+(i+this._rDelay)*this._repeat:i):this.totalDuration()&&this._dur},e.totalDuration=function(i){return arguments.length?(this._dirty=0,er(this,this._repeat<0?i:(i-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(i,n){if(rr(),!arguments.length)return this._tTime;var s=this._dp;if(s&&s.smoothChildTiming&&this._ts){for(ts(this,i),!s._dp||s.parent||hl(s,this);s&&s.parent;)s.parent._time!==s._start+(s._ts>=0?s._tTime/s._ts:(s.totalDuration()-s._tTime)/-s._ts)&&s.totalTime(s._tTime,!0),s=s.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&i<this._tDur||this._ts<0&&i>0||!this._tDur&&!i)&&Me(this._dp,this,this._start-this._delay)}return(this._tTime!==i||!this._dur&&!n||this._initted&&Math.abs(this._zTime)===at||!i&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=i),il(this,i,n)),this},e.time=function(i,n){return arguments.length?this.totalTime(Math.min(this.totalDuration(),i+ol(this))%(this._dur+this._rDelay)||(i?this._dur:0),n):this._time},e.totalProgress=function(i,n){return arguments.length?this.totalTime(this.totalDuration()*i,n):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.ratio},e.progress=function(i,n){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-i:i)+ol(this),n):this.duration()?Math.min(1,this._time/this._dur):this.ratio},e.iteration=function(i,n){var s=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(i-1)*s,n):this._repeat?tr(this._tTime,s)+1:1},e.timeScale=function(i){if(!arguments.length)return this._rts===-at?0:this._rts;if(this._rts===i)return this;var n=this.parent&&this._ts?Jn(this.parent._time,this):this._tTime;return this._rts=+i||0,this._ts=this._ps||i===-at?0:this._rts,this.totalTime(Gr(-this._delay,this._tDur,n),!0),Qn(this),h0(this)},e.paused=function(i){return arguments.length?(this._ps!==i&&(this._ps=i,i?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(rr(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==at&&(this._tTime-=at)))),this):this._ps},e.startTime=function(i){if(arguments.length){this._start=i;var n=this.parent||this._dp;return n&&(n._sort||!this.parent)&&Me(n,this,i-this._delay),this}return this._start},e.endTime=function(i){return this._start+(zt(i)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},e.rawTime=function(i){var n=this.parent||this._dp;return n?i&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?Jn(n.rawTime(i),this):this._tTime:this._tTime},e.revert=function(i){i===void 0&&(i=n0);var n=kt;return kt=i,(this._initted||this._startAt)&&(this.timeline&&this.timeline.revert(i),this.totalTime(-.01,i.suppressEvents)),this.data!=="nested"&&i.kill!==!1&&this.kill(),kt=n,this},e.globalTime=function(i){for(var n=this,s=arguments.length?i:n.rawTime();n;)s=n._start+s/(n._ts||1),n=n._dp;return!this.parent&&this._sat?this._sat.vars.immediateRender?-1:this._sat.globalTime(i):s},e.repeat=function(i){return arguments.length?(this._repeat=i===1/0?-2:i,fl(this)):this._repeat===-2?1/0:this._repeat},e.repeatDelay=function(i){if(arguments.length){var n=this._time;return this._rDelay=i,fl(this),n?this.time(n):this}return this._rDelay},e.yoyo=function(i){return arguments.length?(this._yoyo=i,this):this._yoyo},e.seek=function(i,n){return this.totalTime(le(this,i),zt(n))},e.restart=function(i,n){return this.play().totalTime(i?-this._delay:0,zt(n))},e.play=function(i,n){return i!=null&&this.seek(i,n),this.reversed(!1).paused(!1)},e.reverse=function(i,n){return i!=null&&this.seek(i||this.totalDuration(),n),this.reversed(!0).paused(!1)},e.pause=function(i,n){return i!=null&&this.seek(i,n),this.paused(!0)},e.resume=function(){return this.paused(!1)},e.reversed=function(i){return arguments.length?(!!i!==this.reversed()&&this.timeScale(-this._rts||(i?-at:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-at,this},e.isActive=function(){var i=this.parent||this._dp,n=this._start,s;return!!(!i||this._ts&&this._initted&&i.isActive()&&(s=i.rawTime(!0))>=n&&s<this.endTime(!0)-at)},e.eventCallback=function(i,n,s){var a=this.vars;return arguments.length>1?(n?(a[i]=n,s&&(a[i+"Params"]=s),i==="onUpdate"&&(this._onUpdate=n)):delete a[i],this):a[i]},e.then=function(i){var n=this;return new Promise(function(s){var a=bt(i)?i:nl,o=function(){var u=n.then;n.then=null,bt(a)&&(a=a(n))&&(a.then||a===n)&&(n.then=u),s(a),n.then=u};n._initted&&n.totalProgress()===1&&n._ts>=0||!n._tTime&&n._ts<0?o():n._prom=o})},e.kill=function(){Xr(this)},r}();ue(nr.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-at,_prom:0,_ps:!1,_rts:1});var jt=function(r){Wu(e,r);function e(i,n){var s;return i===void 0&&(i={}),s=r.call(this,i)||this,s.labels={},s.smoothChildTiming=!!i.smoothChildTiming,s.autoRemoveChildren=!!i.autoRemoveChildren,s._sort=zt(i.sortChildren),vt&&Me(i.parent||vt,Ve(s),n),i.reversed&&s.reverse(),i.paused&&s.paused(!0),i.scrollTrigger&&ul(Ve(s),i.scrollTrigger),s}var t=e.prototype;return t.to=function(n,s,a){return Ur(0,arguments,this),this},t.from=function(n,s,a){return Ur(1,arguments,this),this},t.fromTo=function(n,s,a,o){return Ur(2,arguments,this),this},t.set=function(n,s,a){return s.duration=0,s.parent=this,Br(s).repeatDelay||(s.repeat=0),s.immediateRender=!!s.immediateRender,new It(n,s,le(this,a),1),this},t.call=function(n,s,a){return Me(this,It.delayedCall(0,n,s),a)},t.staggerTo=function(n,s,a,o,h,u,l){return a.duration=s,a.stagger=a.stagger||o,a.onComplete=u,a.onCompleteParams=l,a.parent=this,new It(n,a,le(this,h)),this},t.staggerFrom=function(n,s,a,o,h,u,l){return a.runBackwards=1,Br(a).immediateRender=zt(a.immediateRender),this.staggerTo(n,s,a,o,h,u,l)},t.staggerFromTo=function(n,s,a,o,h,u,l,f){return o.startAt=a,Br(o).immediateRender=zt(o.immediateRender),this.staggerTo(n,s,o,h,u,l,f)},t.render=function(n,s,a){var o=this._time,h=this._dirty?this.totalDuration():this._tDur,u=this._dur,l=n<=0?0:Ut(n),f=this._zTime<0!=n<0&&(this._initted||!u),c,d,v,p,_,m,g,y,b,x,T,w;if(this!==vt&&l>h&&n>=0&&(l=h),l!==this._tTime||a||f){if(o!==this._time&&u&&(l+=this._time-o,n+=this._time-o),c=l,b=this._start,y=this._ts,m=!y,f&&(u||(o=this._zTime),(n||!s)&&(this._zTime=n)),this._repeat){if(T=this._yoyo,_=u+this._rDelay,this._repeat<-1&&n<0)return this.totalTime(_*100+n,s,a);if(c=Ut(l%_),l===h?(p=this._repeat,c=u):(p=~~(l/_),p&&p===l/_&&(c=u,p--),c>u&&(c=u)),x=tr(this._tTime,_),!o&&this._tTime&&x!==p&&(x=p),T&&p&1&&(c=u-c,w=1),p!==x&&!this._lock){var S=T&&x&1,E=S===(T&&p&1);if(p<x&&(S=!S),o=S?0:u,this._lock=1,this.render(o||(w?0:Ut(p*_)),s,!u)._lock=0,this._tTime=l,!s&&this.parent&&ce(this,"onRepeat"),this.vars.repeatRefresh&&!w&&(this.invalidate()._lock=1),o&&o!==this._time||m!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(u=this._dur,h=this._tDur,E&&(this._lock=2,o=S?u:-1e-4,this.render(o,!0),this.vars.repeatRefresh&&!w&&this.invalidate()),this._lock=0,!this._ts&&!m)return this;Sl(this,w)}}if(this._hasPause&&!this._forcing&&this._lock<2&&(g=c0(this,Ut(o),Ut(c)),g&&(l-=c-(c=g._start))),this._tTime=l,this._time=c,this._act=!y,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=n,o=0),!o&&c&&!s&&(ce(this,"onStart"),this._tTime!==l))return this;if(c>=o&&n>=0)for(d=this._first;d;){if(v=d._next,(d._act||c>=d._start)&&d._ts&&g!==d){if(d.parent!==this)return this.render(n,s,a);if(d.render(d._ts>0?(c-d._start)*d._ts:(d._dirty?d.totalDuration():d._tDur)+(c-d._start)*d._ts,s,a),c!==this._time||!this._ts&&!m){g=0,v&&(l+=this._zTime=-at);break}}d=v}else{d=this._last;for(var P=n<0?n:c;d;){if(v=d._prev,(d._act||P<=d._end)&&d._ts&&g!==d){if(d.parent!==this)return this.render(n,s,a);if(d.render(d._ts>0?(P-d._start)*d._ts:(d._dirty?d.totalDuration():d._tDur)+(P-d._start)*d._ts,s,a||kt&&(d._initted||d._startAt)),c!==this._time||!this._ts&&!m){g=0,v&&(l+=this._zTime=P?-at:at);break}}d=v}}if(g&&!s&&(this.pause(),g.render(c>=o?0:-at)._zTime=c>=o?1:-1,this._ts))return this._start=b,Qn(this),this.render(n,s,a);this._onUpdate&&!s&&ce(this,"onUpdate",!0),(l===h&&this._tTime>=this.totalDuration()||!l&&o)&&(b===this._start||Math.abs(y)!==Math.abs(this._ts))&&(this._lock||((n||!u)&&(l===h&&this._ts>0||!l&&this._ts<0)&&ni(this,1),!s&&!(n<0&&!o)&&(l||o||!h)&&(ce(this,l===h&&n>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(l<h&&this.timeScale()>0)&&this._prom())))}return this},t.add=function(n,s){var a=this;if(ze(s)||(s=le(this,s,n)),!(n instanceof nr)){if(Xt(n))return n.forEach(function(o){return a.add(o,s)}),this;if(Nt(n))return this.addLabel(n,s);if(bt(n))n=It.delayedCall(0,n);else return this}return this!==n?Me(this,n,s):this},t.getChildren=function(n,s,a,o){n===void 0&&(n=!0),s===void 0&&(s=!0),a===void 0&&(a=!0),o===void 0&&(o=-oe);for(var h=[],u=this._first;u;)u._start>=o&&(u instanceof It?s&&h.push(u):(a&&h.push(u),n&&h.push.apply(h,u.getChildren(!0,s,a)))),u=u._next;return h},t.getById=function(n){for(var s=this.getChildren(1,1,1),a=s.length;a--;)if(s[a].vars.id===n)return s[a]},t.remove=function(n){return Nt(n)?this.removeLabel(n):bt(n)?this.killTweensOf(n):($n(this,n),n===this._recent&&(this._recent=this._last),Ii(this))},t.totalTime=function(n,s){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=Ut(te.time-(this._ts>0?n/this._ts:(this.totalDuration()-n)/-this._ts))),r.prototype.totalTime.call(this,n,s),this._forcing=0,this):this._tTime},t.addLabel=function(n,s){return this.labels[n]=le(this,s),this},t.removeLabel=function(n){return delete this.labels[n],this},t.addPause=function(n,s,a){var o=It.delayedCall(0,s||Lr,a);return o.data="isPause",this._hasPause=1,Me(this,o,le(this,n))},t.removePause=function(n){var s=this._first;for(n=le(this,n);s;)s._start===n&&s.data==="isPause"&&ni(s),s=s._next},t.killTweensOf=function(n,s,a){for(var o=this.getTweensOf(n,a),h=o.length;h--;)oi!==o[h]&&o[h].kill(n,s);return this},t.getTweensOf=function(n,s){for(var a=[],o=fe(n),h=this._first,u=ze(s),l;h;)h instanceof It?s0(h._targets,o)&&(u?(!oi||h._initted&&h._ts)&&h.globalTime(0)<=s&&h.globalTime(h.totalDuration())>s:!s||h.isActive())&&a.push(h):(l=h.getTweensOf(o,s)).length&&a.push.apply(a,l),h=h._next;return a},t.tweenTo=function(n,s){s=s||{};var a=this,o=le(a,n),h=s,u=h.startAt,l=h.onStart,f=h.onStartParams,c=h.immediateRender,d,v=It.to(a,ue({ease:s.ease||"none",lazy:!1,immediateRender:!1,time:o,overwrite:"auto",duration:s.duration||Math.abs((o-(u&&"time"in u?u.time:a._time))/a.timeScale())||at,onStart:function(){if(a.pause(),!d){var _=s.duration||Math.abs((o-(u&&"time"in u?u.time:a._time))/a.timeScale());v._dur!==_&&er(v,_,0,1).render(v._time,!0,!0),d=1}l&&l.apply(v,f||[])}},s));return c?v.render(0):v},t.tweenFromTo=function(n,s,a){return this.tweenTo(s,ue({startAt:{time:le(this,n)}},a))},t.recent=function(){return this._recent},t.nextLabel=function(n){return n===void 0&&(n=this._time),yl(this,le(this,n))},t.previousLabel=function(n){return n===void 0&&(n=this._time),yl(this,le(this,n),1)},t.currentLabel=function(n){return arguments.length?this.seek(n,!0):this.previousLabel(this._time+at)},t.shiftChildren=function(n,s,a){a===void 0&&(a=0);for(var o=this._first,h=this.labels,u;o;)o._start>=a&&(o._start+=n,o._end+=n),o=o._next;if(s)for(u in h)h[u]>=a&&(h[u]+=n);return Ii(this)},t.invalidate=function(n){var s=this._first;for(this._lock=0;s;)s.invalidate(n),s=s._next;return r.prototype.invalidate.call(this,n)},t.clear=function(n){n===void 0&&(n=!0);for(var s=this._first,a;s;)a=s._next,this.remove(s),s=a;return this._dp&&(this._time=this._tTime=this._pTime=0),n&&(this.labels={}),Ii(this)},t.totalDuration=function(n){var s=0,a=this,o=a._last,h=oe,u,l,f;if(arguments.length)return a.timeScale((a._repeat<0?a.duration():a.totalDuration())/(a.reversed()?-n:n));if(a._dirty){for(f=a.parent;o;)u=o._prev,o._dirty&&o.totalDuration(),l=o._start,l>h&&a._sort&&o._ts&&!a._lock?(a._lock=1,Me(a,o,l-o._delay,1)._lock=0):h=l,l<0&&o._ts&&(s-=l,(!f&&!a._dp||f&&f.smoothChildTiming)&&(a._start+=l/a._ts,a._time-=l,a._tTime-=l),a.shiftChildren(-l,!1,-1/0),h=0),o._end>s&&o._ts&&(s=o._end),o=u;er(a,a===vt&&a._time>s?a._time:s,1,1),a._dirty=0}return a._tDur},e.updateRoot=function(n){if(vt._ts&&(il(vt,Jn(n,vt)),Qu=te.frame),te.frame>=tl){tl+=$t.autoSleep||120;var s=vt._first;if((!s||!s._ts)&&$t.autoSleep&&te._listeners.length<2){for(;s&&!s._ts;)s=s._next;s||te.sleep()}}},e}(nr);ue(jt.prototype,{_lock:0,_hasPause:0,_forcing:0});var O0=function(e,t,i,n,s,a,o){var h=new Zt(this._pt,e,t,0,1,Dl,null,s),u=0,l=0,f,c,d,v,p,_,m,g;for(h.b=i,h.e=n,i+="",n+="",(m=~n.indexOf("random("))&&(n=kr(n)),a&&(g=[i,n],a(g,e,t),i=g[0],n=g[1]),c=i.match(ka)||[];f=ka.exec(n);)v=f[0],p=n.substring(u,f.index),d?d=(d+1)%5:p.substr(-5)==="rgba("&&(d=1),v!==c[l++]&&(_=parseFloat(c[l-1])||0,h._pt={_next:h._pt,p:p||l===1?p:",",s:_,c:v.charAt(1)==="="?Qi(_,v)-_:parseFloat(v)-_,m:d&&d<4?Math.round:0},u=ka.lastIndex);return h.c=u<n.length?n.substring(u,n.length):"",h.fp=o,(Zu.test(n)||m)&&(h.e=0),this._pt=h,h},ro=function(e,t,i,n,s,a,o,h,u,l){bt(n)&&(n=n(s||0,e,a));var f=e[t],c=i!=="get"?i:bt(f)?u?e[t.indexOf("set")||!bt(e["get"+t.substr(3)])?t:"get"+t.substr(3)](u):e[t]():f,d=bt(f)?u?F0:Il:ao,v;if(Nt(n)&&(~n.indexOf("random(")&&(n=kr(n)),n.charAt(1)==="="&&(v=Qi(c,n)+(Ht(c)||0),(v||v===0)&&(n=v))),!l||c!==n||no)return!isNaN(c*n)&&n!==""?(v=new Zt(this._pt,e,t,+c||0,n-(c||0),typeof f=="boolean"?L0:Ml,0,d),u&&(v.fp=u),o&&v.modifier(o,this,e),this._pt=v):(!f&&!(t in e)&&Wa(t,n),O0.call(this,e,t,c,n,d,h||$t.stringFilter,u))},A0=function(e,t,i,n,s){if(bt(e)&&(e=Vr(e,s,t,i,n)),!Ie(e)||e.style&&e.nodeType||Xt(e)||Yu(e))return Nt(e)?Vr(e,s,t,i,n):e;var a={},o;for(o in e)a[o]=Vr(e[o],s,t,i,n);return a},Cl=function(e,t,i,n,s,a){var o,h,u,l;if(Qt[e]&&(o=new Qt[e]).init(s,o.rawVars?t[e]:A0(t[e],n,s,a,i),i,n,a)!==!1&&(i._pt=h=new Zt(i._pt,s,e,0,1,o.render,o,0,o.priority),i!==ir))for(u=i._ptLookup[i._targets.indexOf(s)],l=o._props.length;l--;)u[o._props[l]]=h;return o},oi,no,so=function r(e,t,i){var n=e.vars,s=n.ease,a=n.startAt,o=n.immediateRender,h=n.lazy,u=n.onUpdate,l=n.onUpdateParams,f=n.callbackScope,c=n.runBackwards,d=n.yoyoEase,v=n.keyframes,p=n.autoRevert,_=e._dur,m=e._startAt,g=e._targets,y=e.parent,b=y&&y.data==="nested"?y.vars.targets:g,x=e._overwrite==="auto"&&!La,T=e.timeline,w,S,E,P,O,M,F,G,A,I,N,Y,H;if(T&&(!v||!s)&&(s="none"),e._ease=Mi(s,$i.ease),e._yEase=d?El(Mi(d===!0?s:d,$i.ease)):0,d&&e._yoyo&&!e._repeat&&(d=e._yEase,e._yEase=e._ease,e._ease=d),e._from=!T&&!!n.runBackwards,!T||v&&!n.stagger){if(G=g[0]?Oi(g[0]).harness:0,Y=G&&n[G.prop],w=Kn(n,Va),m&&(m._zTime<0&&m.progress(1),t<0&&c&&o&&!p?m.render(-1,!0):m.revert(c&&_?jn:r0),m._lazy=0),a){if(ni(e._startAt=It.set(g,ue({data:"isStart",overwrite:!1,parent:y,immediateRender:!0,lazy:!m&&zt(h),startAt:null,delay:0,onUpdate:u,onUpdateParams:l,callbackScope:f,stagger:0},a))),e._startAt._dp=0,e._startAt._sat=e,t<0&&(kt||!o&&!p)&&e._startAt.revert(jn),o&&_&&t<=0&&i<=0){t&&(e._zTime=t);return}}else if(c&&_&&!m){if(t&&(o=!1),E=ue({overwrite:!1,data:"isFromStart",lazy:o&&!m&&zt(h),immediateRender:o,stagger:0,parent:y},w),Y&&(E[G.prop]=Y),ni(e._startAt=It.set(g,E)),e._startAt._dp=0,e._startAt._sat=e,t<0&&(kt?e._startAt.revert(jn):e._startAt.render(-1,!0)),e._zTime=t,!o)r(e._startAt,at,at);else if(!t)return}for(e._pt=e._ptCache=0,h=_&&zt(h)||h&&!_,S=0;S<g.length;S++){if(O=g[S],F=O._gsap||Za(g)[S]._gsap,e._ptLookup[S]=I={},za[F.id]&&ri.length&&qn(),N=b===g?S:b.indexOf(O),G&&(A=new G).init(O,Y||w,e,N,b)!==!1&&(e._pt=P=new Zt(e._pt,O,A.name,0,1,A.render,A,0,A.priority),A._props.forEach(function(R){I[R]=P}),A.priority&&(M=1)),!G||Y)for(E in w)Qt[E]&&(A=Cl(E,w,e,N,O,b))?A.priority&&(M=1):I[E]=P=ro.call(e,O,E,"get",w[E],N,b,0,n.stringFilter);e._op&&e._op[S]&&e.kill(O,e._op[S]),x&&e._pt&&(oi=e,vt.killTweensOf(O,I,e.globalTime(t)),H=!e.parent,oi=0),e._pt&&h&&(za[F.id]=1)}M&&Fl(e),e._onInit&&e._onInit(e)}e._onUpdate=u,e._initted=(!e._op||e._pt)&&!H,v&&t<=0&&T.render(oe,!0,!0)},I0=function(e,t,i,n,s,a,o){var h=(e._pt&&e._ptCache||(e._ptCache={}))[t],u,l,f,c;if(!h)for(h=e._ptCache[t]=[],f=e._ptLookup,c=e._targets.length;c--;){if(u=f[c][t],u&&u.d&&u.d._pt)for(u=u.d._pt;u&&u.p!==t&&u.fp!==t;)u=u._next;if(!u)return no=1,e.vars[t]="+=0",so(e,o),no=0,1;h.push(u)}for(c=h.length;c--;)l=h[c],u=l._pt||l,u.s=(n||n===0)&&!s?n:u.s+(n||0)+a*u.c,u.c=i-u.s,l.e&&(l.e=Et(i)+Ht(l.e)),l.b&&(l.b=u.s+Ht(l.b))},M0=function(e,t){var i=e[0]?Oi(e[0]).harness:0,n=i&&i.aliases,s,a,o,h;if(!n)return t;s=Ai({},t);for(a in n)if(a in s)for(h=n[a].split(","),o=h.length;o--;)s[h[o]]=s[a];return s},D0=function(e,t,i,n){var s=t.ease||n||"power1.inOut",a,o;if(Xt(t))o=i[e]||(i[e]=[]),t.forEach(function(h,u){return o.push({t:u/(t.length-1)*100,v:h,e:s})});else for(a in t)o=i[a]||(i[a]=[]),a==="ease"||o.push({t:parseFloat(e),v:t[a],e:s})},Vr=function(e,t,i,n,s){return bt(e)?e.call(t,i,n,s):Nt(e)&&~e.indexOf("random(")?kr(e):e},Ol=ja+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert",Al={};Yt(Ol+",id,stagger,delay,duration,paused,scrollTrigger",function(r){return Al[r]=1});var It=function(r){Wu(e,r);function e(i,n,s,a){var o;typeof n=="number"&&(s.duration=n,n=s,s=null),o=r.call(this,a?n:Br(n))||this;var h=o.vars,u=h.duration,l=h.delay,f=h.immediateRender,c=h.stagger,d=h.overwrite,v=h.keyframes,p=h.defaults,_=h.scrollTrigger,m=h.yoyoEase,g=n.parent||vt,y=(Xt(i)||Yu(i)?ze(i[0]):"length"in n)?[i]:fe(i),b,x,T,w,S,E,P,O;if(o._targets=y.length?Za(y):Yn("GSAP target "+i+" not found. https://greensock.com",!$t.nullTargetWarn)||[],o._ptLookup=[],o._overwrite=d,v||c||Vn(u)||Vn(l)){if(n=o.vars,b=o.timeline=new jt({data:"nested",defaults:p||{},targets:g&&g.data==="nested"?g.vars.targets:y}),b.kill(),b.parent=b._dp=Ve(o),b._start=0,c||Vn(u)||Vn(l)){if(w=y.length,P=c&&pl(c),Ie(c))for(S in c)~Ol.indexOf(S)&&(O||(O={}),O[S]=c[S]);for(x=0;x<w;x++)T=Kn(n,Al),T.stagger=0,m&&(T.yoyoEase=m),O&&Ai(T,O),E=y[x],T.duration=+Vr(u,Ve(o),x,E,y),T.delay=(+Vr(l,Ve(o),x,E,y)||0)-o._delay,!c&&w===1&&T.delay&&(o._delay=l=T.delay,o._start+=l,T.delay=0),b.to(E,T,P?P(x,E,y):0),b._ease=$.none;b.duration()?u=l=0:o.timeline=0}else if(v){Br(ue(b.vars.defaults,{ease:"none"})),b._ease=Mi(v.ease||n.ease||"none");var M=0,F,G,A;if(Xt(v))v.forEach(function(I){return b.to(y,I,">")}),b.duration();else{T={};for(S in v)S==="ease"||S==="easeEach"||D0(S,v[S],T,v.easeEach);for(S in T)for(F=T[S].sort(function(I,N){return I.t-N.t}),M=0,x=0;x<F.length;x++)G=F[x],A={ease:G.e,duration:(G.t-(x?F[x-1].t:0))/100*u},A[S]=G.v,b.to(y,A,M),M+=A.duration;b.duration()<u&&b.to({},{duration:u-b.duration()})}}u||o.duration(u=b.duration())}else o.timeline=0;return d===!0&&!La&&(oi=Ve(o),vt.killTweensOf(y),oi=0),Me(g,Ve(o),s),n.reversed&&o.reverse(),n.paused&&o.paused(!0),(f||!u&&!v&&o._start===Ut(g._time)&&zt(f)&&u0(Ve(o))&&g.data!=="nested")&&(o._tTime=-at,o.render(Math.max(0,-l)||0)),_&&ul(Ve(o),_),o}var t=e.prototype;return t.render=function(n,s,a){var o=this._time,h=this._tDur,u=this._dur,l=n<0,f=n>h-at&&!l?h:n<at?0:n,c,d,v,p,_,m,g,y,b;if(!u)f0(this,n,s,a);else if(f!==this._tTime||!n||a||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==l){if(c=f,y=this.timeline,this._repeat){if(p=u+this._rDelay,this._repeat<-1&&l)return this.totalTime(p*100+n,s,a);if(c=Ut(f%p),f===h?(v=this._repeat,c=u):(v=~~(f/p),v&&v===f/p&&(c=u,v--),c>u&&(c=u)),m=this._yoyo&&v&1,m&&(b=this._yEase,c=u-c),_=tr(this._tTime,p),c===o&&!a&&this._initted)return this._tTime=f,this;v!==_&&(y&&this._yEase&&Sl(y,m),this.vars.repeatRefresh&&!m&&!this._lock&&(this._lock=a=1,this.render(Ut(p*v),!0).invalidate()._lock=0))}if(!this._initted){if(ll(this,l?n:c,a,s,f))return this._tTime=0,this;if(o!==this._time)return this;if(u!==this._dur)return this.render(n,s,a)}if(this._tTime=f,this._time=c,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=g=(b||this._ease)(c/u),this._from&&(this.ratio=g=1-g),c&&!o&&!s&&(ce(this,"onStart"),this._tTime!==f))return this;for(d=this._pt;d;)d.r(g,d.d),d=d._next;y&&y.render(n<0?n:!c&&m?-at:y._dur*y._ease(c/this._dur),s,a)||this._startAt&&(this._zTime=n),this._onUpdate&&!s&&(l&&qa(this,n,s,a),ce(this,"onUpdate")),this._repeat&&v!==_&&this.vars.onRepeat&&!s&&this.parent&&ce(this,"onRepeat"),(f===this._tDur||!f)&&this._tTime===f&&(l&&!this._onUpdate&&qa(this,n,!0,!0),(n||!u)&&(f===this._tDur&&this._ts>0||!f&&this._ts<0)&&ni(this,1),!s&&!(l&&!o)&&(f||o||m)&&(ce(this,f===h?"onComplete":"onReverseComplete",!0),this._prom&&!(f<h&&this.timeScale()>0)&&this._prom()))}return this},t.targets=function(){return this._targets},t.invalidate=function(n){return(!n||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(n),r.prototype.invalidate.call(this,n)},t.resetTo=function(n,s,a,o){Wr||te.wake(),this._ts||this.play();var h=Math.min(this._dur,(this._dp._time-this._start)*this._ts),u;return this._initted||so(this,h),u=this._ease(h/this._dur),I0(this,n,s,a,o,u,h)?this.resetTo(n,s,a,o):(ts(this,0),this.parent||al(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},t.kill=function(n,s){if(s===void 0&&(s="all"),!n&&(!s||s==="all"))return this._lazy=this._pt=0,this.parent?Xr(this):this;if(this.timeline){var a=this.timeline.totalDuration();return this.timeline.killTweensOf(n,s,oi&&oi.vars.overwrite!==!0)._first||Xr(this),this.parent&&a!==this.timeline.totalDuration()&&er(this,this._dur*this.timeline._tDur/a,0,1),this}var o=this._targets,h=n?fe(n):o,u=this._ptLookup,l=this._pt,f,c,d,v,p,_,m;if((!s||s==="all")&&o0(o,h))return s==="all"&&(this._pt=0),Xr(this);for(f=this._op=this._op||[],s!=="all"&&(Nt(s)&&(p={},Yt(s,function(g){return p[g]=1}),s=p),s=M0(o,s)),m=o.length;m--;)if(~h.indexOf(o[m])){c=u[m],s==="all"?(f[m]=s,v=c,d={}):(d=f[m]=f[m]||{},v=s);for(p in v)_=c&&c[p],_&&((!("kill"in _.d)||_.d.kill(p)===!0)&&$n(this,_,"_pt"),delete c[p]),d!=="all"&&(d[p]=1)}return this._initted&&!this._pt&&l&&Xr(this),this},e.to=function(n,s){return new e(n,s,arguments[2])},e.from=function(n,s){return Ur(1,arguments)},e.delayedCall=function(n,s,a,o){return new e(s,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:n,onComplete:s,onReverseComplete:s,onCompleteParams:a,onReverseCompleteParams:a,callbackScope:o})},e.fromTo=function(n,s,a){return Ur(2,arguments)},e.set=function(n,s){return s.duration=0,s.repeatDelay||(s.repeat=0),new e(n,s)},e.killTweensOf=function(n,s,a){return vt.killTweensOf(n,s,a)},e}(nr);ue(It.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0}),Yt("staggerTo,staggerFrom,staggerFromTo",function(r){It[r]=function(){var e=new jt,t=$a.call(arguments,0);return t.splice(r==="staggerFromTo"?5:4,0,0),e[r].apply(e,t)}});var ao=function(e,t,i){return e[t]=i},Il=function(e,t,i){return e[t](i)},F0=function(e,t,i,n){return e[t](n.fp,i)},N0=function(e,t,i){return e.setAttribute(t,i)},oo=function(e,t){return bt(e[t])?Il:Ua(e[t])&&e.setAttribute?N0:ao},Ml=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e6)/1e6,t)},L0=function(e,t){return t.set(t.t,t.p,!!(t.s+t.c*e),t)},Dl=function(e,t){var i=t._pt,n="";if(!e&&t.b)n=t.b;else if(e===1&&t.e)n=t.e;else{for(;i;)n=i.p+(i.m?i.m(i.s+i.c*e):Math.round((i.s+i.c*e)*1e4)/1e4)+n,i=i._next;n+=t.c}t.set(t.t,t.p,n,t)},ho=function(e,t){for(var i=t._pt;i;)i.r(e,i.d),i=i._next},B0=function(e,t,i,n){for(var s=this._pt,a;s;)a=s._next,s.p===n&&s.modifier(e,t,i),s=a},U0=function(e){for(var t=this._pt,i,n;t;)n=t._next,t.p===e&&!t.op||t.op===e?$n(this,t,"_pt"):t.dep||(i=1),t=n;return!i},G0=function(e,t,i,n){n.mSet(e,t,n.m.call(n.tween,i,n.mt),n)},Fl=function(e){for(var t=e._pt,i,n,s,a;t;){for(i=t._next,n=s;n&&n.pr>t.pr;)n=n._next;(t._prev=n?n._prev:a)?t._prev._next=t:s=t,(t._next=n)?n._prev=t:a=t,t=i}e._pt=s},Zt=function(){function r(t,i,n,s,a,o,h,u,l){this.t=i,this.s=s,this.c=a,this.p=n,this.r=o||Ml,this.d=h||this,this.set=u||ao,this.pr=l||0,this._next=t,t&&(t._prev=this)}var e=r.prototype;return e.modifier=function(i,n,s){this.mSet=this.mSet||this.set,this.set=G0,this.m=i,this.mt=s,this.tween=n},r}();Yt(ja+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger",function(r){return Va[r]=1}),Jt.TweenMax=Jt.TweenLite=It,Jt.TimelineLite=Jt.TimelineMax=jt,vt=new jt({sortChildren:!1,defaults:$i,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0}),$t.stringFilter=wl;var sr=[],es={},k0=[],Nl=0,uo=function(e){return(es[e]||k0).map(function(t){return t()})},lo=function(){var e=Date.now(),t=[];e-Nl>2&&(uo("matchMediaInit"),sr.forEach(function(i){var n=i.queries,s=i.conditions,a,o,h,u;for(o in n)a=he.matchMedia(n[o]).matches,a&&(h=1),a!==s[o]&&(s[o]=a,u=1);u&&(i.revert(),h&&t.push(i))}),uo("matchMediaRevert"),t.forEach(function(i){return i.onMatch(i)}),Nl=e,uo("matchMedia"))},Ll=function(){function r(t,i){this.selector=i&&Ja(i),this.data=[],this._r=[],this.isReverted=!1,t&&this.add(t)}var e=r.prototype;return e.add=function(i,n,s){bt(i)&&(s=n,n=i,i=bt);var a=this,o=function(){var u=Rt,l=a.selector,f;return u&&u!==a&&u.data.push(a),s&&(a.selector=Ja(s)),Rt=a,f=n.apply(a,arguments),bt(f)&&a._r.push(f),Rt=u,a.selector=l,a.isReverted=!1,f};return a.last=o,i===bt?o(a):i?a[i]=o:o},e.ignore=function(i){var n=Rt;Rt=null,i(this),Rt=n},e.getTweens=function(){var i=[];return this.data.forEach(function(n){return n instanceof r?i.push.apply(i,n.getTweens()):n instanceof It&&!(n.parent&&n.parent.data==="nested")&&i.push(n)}),i},e.clear=function(){this._r.length=this.data.length=0},e.kill=function(i,n){var s=this;if(i){var a=this.getTweens();this.data.forEach(function(h){h.data==="isFlip"&&(h.revert(),h.getChildren(!0,!0,!1).forEach(function(u){return a.splice(a.indexOf(u),1)}))}),a.map(function(h){return{g:h.globalTime(0),t:h}}).sort(function(h,u){return u.g-h.g||-1}).forEach(function(h){return h.t.revert(i)}),this.data.forEach(function(h){return!(h instanceof nr)&&h.revert&&h.revert(i)}),this._r.forEach(function(h){return h(i,s)}),this.isReverted=!0}else this.data.forEach(function(h){return h.kill&&h.kill()});if(this.clear(),n){var o=sr.indexOf(this);~o&&sr.splice(o,1)}},e.revert=function(i){this.kill(i||{})},r}(),X0=function(){function r(t){this.contexts=[],this.scope=t}var e=r.prototype;return e.add=function(i,n,s){Ie(i)||(i={matches:i});var a=new Ll(0,s||this.scope),o=a.conditions={},h,u,l;this.contexts.push(a),n=a.add("onMatch",n),a.queries=i;for(u in i)u==="all"?l=1:(h=he.matchMedia(i[u]),h&&(sr.indexOf(a)<0&&sr.push(a),(o[u]=h.matches)&&(l=1),h.addListener?h.addListener(lo):h.addEventListener("change",lo)));return l&&n(a),this},e.revert=function(i){this.kill(i||{})},e.kill=function(i){this.contexts.forEach(function(n){return n.kill(i,!0)})},r}(),is={registerPlugin:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];t.forEach(function(n){return T0(n)})},timeline:function(e){return new jt(e)},getTweensOf:function(e,t){return vt.getTweensOf(e,t)},getProperty:function(e,t,i,n){Nt(e)&&(e=fe(e)[0]);var s=Oi(e||{}).get,a=i?nl:rl;return i==="native"&&(i=""),e&&(t?a((Qt[t]&&Qt[t].get||s)(e,t,i,n)):function(o,h,u){return a((Qt[o]&&Qt[o].get||s)(e,o,h,u))})},quickSetter:function(e,t,i){if(e=fe(e),e.length>1){var n=e.map(function(l){return ee.quickSetter(l,t,i)}),s=n.length;return function(l){for(var f=s;f--;)n[f](l)}}e=e[0]||{};var a=Qt[t],o=Oi(e),h=o.harness&&(o.harness.aliases||{})[t]||t,u=a?function(l){var f=new a;ir._pt=0,f.init(e,i?l+i:l,ir,0,[e]),f.render(1,f),ir._pt&&ho(1,ir)}:o.set(e,h);return a?u:function(l){return u(e,h,i?l+i:l,o,1)}},quickTo:function(e,t,i){var n,s=ee.to(e,Ai((n={},n[t]="+=0.1",n.paused=!0,n),i||{})),a=function(h,u,l){return s.resetTo(t,h,u,l)};return a.tween=s,a},isTweening:function(e){return vt.getTweensOf(e,!0).length>0},defaults:function(e){return e&&e.ease&&(e.ease=Mi(e.ease,$i.ease)),sl($i,e||{})},config:function(e){return sl($t,e||{})},registerEffect:function(e){var t=e.name,i=e.effect,n=e.plugins,s=e.defaults,a=e.extendTimeline;(n||"").split(",").forEach(function(o){return o&&!Qt[o]&&!Jt[o]&&Yn(t+" effect requires "+o+" plugin.")}),Ya[t]=function(o,h,u){return i(fe(o),ue(h||{},s),u)},a&&(jt.prototype[t]=function(o,h,u){return this.add(Ya[t](o,Ie(h)?h:(u=h)&&{},this),u)})},registerEase:function(e,t){$[e]=Mi(t)},parseEase:function(e,t){return arguments.length?Mi(e,t):$},getById:function(e){return vt.getById(e)},exportRoot:function(e,t){e===void 0&&(e={});var i=new jt(e),n,s;for(i.smoothChildTiming=zt(e.smoothChildTiming),vt.remove(i),i._dp=0,i._time=i._tTime=vt._time,n=vt._first;n;)s=n._next,(t||!(!n._dur&&n instanceof It&&n.vars.onComplete===n._targets[0]))&&Me(i,n,n._start-n._delay),n=s;return Me(vt,i,0),i},context:function(e,t){return e?new Ll(e,t):Rt},matchMedia:function(e){return new X0(e)},matchMediaRefresh:function(){return sr.forEach(function(e){var t=e.conditions,i,n;for(n in t)t[n]&&(t[n]=!1,i=1);i&&e.revert()})||lo()},addEventListener:function(e,t){var i=es[e]||(es[e]=[]);~i.indexOf(t)||i.push(t)},removeEventListener:function(e,t){var i=es[e],n=i&&i.indexOf(t);n>=0&&i.splice(n,1)},utils:{wrap:y0,wrapYoyo:x0,distribute:pl,random:_l,snap:vl,normalize:g0,getUnit:Ht,clamp:p0,splitColor:xl,toArray:fe,selector:Ja,mapRange:gl,pipe:_0,unitize:m0,interpolate:b0,shuffle:dl},install:$u,effects:Ya,ticker:te,updateRoot:jt.updateRoot,plugins:Qt,globalTimeline:vt,core:{PropTween:Zt,globals:Ju,Tween:It,Timeline:jt,Animation:nr,getCache:Oi,_removeLinkedListItem:$n,reverting:function(){return kt},context:function(e){return e&&Rt&&(Rt.data.push(e),e._ctx=Rt),Rt},suppressOverwrites:function(e){return La=e}}};Yt("to,from,fromTo,delayedCall,set,killTweensOf",function(r){return is[r]=It[r]}),te.add(jt.updateRoot),ir=is.to({},{duration:0});var H0=function(e,t){for(var i=e._pt;i&&i.p!==t&&i.op!==t&&i.fp!==t;)i=i._next;return i},W0=function(e,t){var i=e._targets,n,s,a;for(n in t)for(s=i.length;s--;)a=e._ptLookup[s][n],a&&(a=a.d)&&(a._pt&&(a=H0(a,n)),a&&a.modifier&&a.modifier(t[n],e,i[s],n))},fo=function(e,t){return{name:e,rawVars:1,init:function(n,s,a){a._onInit=function(o){var h,u;if(Nt(s)&&(h={},Yt(s,function(l){return h[l]=1}),s=h),t){h={};for(u in s)h[u]=t(s[u]);s=h}W0(o,s)}}}},ee=is.registerPlugin({name:"attr",init:function(e,t,i,n,s){var a,o,h;this.tween=i;for(a in t)h=e.getAttribute(a)||"",o=this.add(e,"setAttribute",(h||0)+"",t[a],n,s,0,0,a),o.op=a,o.b=h,this._props.push(a)},render:function(e,t){for(var i=t._pt;i;)kt?i.set(i.t,i.p,i.b,i):i.r(e,i.d),i=i._next}},{name:"endArray",init:function(e,t){for(var i=t.length;i--;)this.add(e,i,e[i]||0,t[i],0,0,0,0,0,1)}},fo("roundProps",Qa),fo("modifiers"),fo("snap",vl))||is;It.version=jt.version=ee.version="3.11.4",Ku=1,zu()&&rr(),$.Power0,$.Power1,$.Power2,$.Power3,$.Power4,$.Linear,$.Quad,$.Cubic,$.Quart,$.Quint,$.Strong,$.Elastic,$.Back,$.SteppedEase,$.Bounce,$.Sine,$.Expo,$.Circ;var Bl,hi,ar,co,Fi,Ul,po,V0=function(){return typeof window<"u"},Ye={},Ni=180/Math.PI,or=Math.PI/180,hr=Math.atan2,Gl=1e8,vo=/([A-Z])/g,z0=/(left|right|width|margin|padding|x)/i,Y0=/[\s,\(]\S/,je={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},_o=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e4)/1e4+t.u,t)},j0=function(e,t){return t.set(t.t,t.p,e===1?t.e:Math.round((t.s+t.c*e)*1e4)/1e4+t.u,t)},Z0=function(e,t){return t.set(t.t,t.p,e?Math.round((t.s+t.c*e)*1e4)/1e4+t.u:t.b,t)},q0=function(e,t){var i=t.s+t.c*e;t.set(t.t,t.p,~~(i+(i<0?-.5:.5))+t.u,t)},kl=function(e,t){return t.set(t.t,t.p,e?t.e:t.b,t)},Xl=function(e,t){return t.set(t.t,t.p,e!==1?t.b:t.e,t)},K0=function(e,t,i){return e.style[t]=i},$0=function(e,t,i){return e.style.setProperty(t,i)},J0=function(e,t,i){return e._gsap[t]=i},Q0=function(e,t,i){return e._gsap.scaleX=e._gsap.scaleY=i},tx=function(e,t,i,n,s){var a=e._gsap;a.scaleX=a.scaleY=i,a.renderTransform(s,a)},ex=function(e,t,i,n,s){var a=e._gsap;a[t]=i,a.renderTransform(s,a)},_t="transform",Ee=_t+"Origin",ix=function(e,t){var i=this,n=this.target,s=n.style;if(e in Ye){if(this.tfm=this.tfm||{},e!=="transform"&&(e=je[e]||e,~e.indexOf(",")?e.split(",").forEach(function(a){return i.tfm[a]=Ze(n,a)}):this.tfm[e]=n._gsap.x?n._gsap[e]:Ze(n,e)),this.props.indexOf(_t)>=0)return;n._gsap.svg&&(this.svgo=n.getAttribute("data-svg-origin"),this.props.push(Ee,t,"")),e=_t}(s||t)&&this.props.push(e,t,s[e])},Hl=function(e){e.translate&&(e.removeProperty("translate"),e.removeProperty("scale"),e.removeProperty("rotate"))},rx=function(){var e=this.props,t=this.target,i=t.style,n=t._gsap,s,a;for(s=0;s<e.length;s+=3)e[s+1]?t[e[s]]=e[s+2]:e[s+2]?i[e[s]]=e[s+2]:i.removeProperty(e[s].replace(vo,"-$1").toLowerCase());if(this.tfm){for(a in this.tfm)n[a]=this.tfm[a];n.svg&&(n.renderTransform(),t.setAttribute("data-svg-origin",this.svgo||"")),s=po(),s&&!s.isStart&&!i[_t]&&(Hl(i),n.uncache=1)}},Wl=function(e,t){var i={target:e,props:[],revert:rx,save:ix};return t&&t.split(",").forEach(function(n){return i.save(n)}),i},Vl,mo=function(e,t){var i=hi.createElementNS?hi.createElementNS((t||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),e):hi.createElement(e);return i.style?i:hi.createElement(e)},De=function r(e,t,i){var n=getComputedStyle(e);return n[t]||n.getPropertyValue(t.replace(vo,"-$1").toLowerCase())||n.getPropertyValue(t)||!i&&r(e,ur(t)||t,1)||""},zl="O,Moz,ms,Ms,Webkit".split(","),ur=function(e,t,i){var n=t||Fi,s=n.style,a=5;if(e in s&&!i)return e;for(e=e.charAt(0).toUpperCase()+e.substr(1);a--&&!(zl[a]+e in s););return a<0?null:(a===3?"ms":a>=0?zl[a]:"")+e},go=function(){V0()&&window.document&&(Bl=window,hi=Bl.document,ar=hi.documentElement,Fi=mo("div")||{style:{}},mo("div"),_t=ur(_t),Ee=_t+"Origin",Fi.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",Vl=!!ur("perspective"),po=ee.core.reverting,co=1)},yo=function r(e){var t=mo("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),i=this.parentNode,n=this.nextSibling,s=this.style.cssText,a;if(ar.appendChild(t),t.appendChild(this),this.style.display="block",e)try{a=this.getBBox(),this._gsapBBox=this.getBBox,this.getBBox=r}catch{}else this._gsapBBox&&(a=this._gsapBBox());return i&&(n?i.insertBefore(this,n):i.appendChild(this)),ar.removeChild(t),this.style.cssText=s,a},Yl=function(e,t){for(var i=t.length;i--;)if(e.hasAttribute(t[i]))return e.getAttribute(t[i])},jl=function(e){var t;try{t=e.getBBox()}catch{t=yo.call(e,!0)}return t&&(t.width||t.height)||e.getBBox===yo||(t=yo.call(e,!0)),t&&!t.width&&!t.x&&!t.y?{x:+Yl(e,["x","cx","x1"])||0,y:+Yl(e,["y","cy","y1"])||0,width:0,height:0}:t},Zl=function(e){return!!(e.getCTM&&(!e.parentNode||e.ownerSVGElement)&&jl(e))},zr=function(e,t){if(t){var i=e.style;t in Ye&&t!==Ee&&(t=_t),i.removeProperty?((t.substr(0,2)==="ms"||t.substr(0,6)==="webkit")&&(t="-"+t),i.removeProperty(t.replace(vo,"-$1").toLowerCase())):i.removeAttribute(t)}},ui=function(e,t,i,n,s,a){var o=new Zt(e._pt,t,i,0,1,a?Xl:kl);return e._pt=o,o.b=n,o.e=s,e._props.push(i),o},ql={deg:1,rad:1,turn:1},nx={grid:1,flex:1},li=function r(e,t,i,n){var s=parseFloat(i)||0,a=(i+"").trim().substr((s+"").length)||"px",o=Fi.style,h=z0.test(t),u=e.tagName.toLowerCase()==="svg",l=(u?"client":"offset")+(h?"Width":"Height"),f=100,c=n==="px",d=n==="%",v,p,_,m;return n===a||!s||ql[n]||ql[a]?s:(a!=="px"&&!c&&(s=r(e,t,i,"px")),m=e.getCTM&&Zl(e),(d||a==="%")&&(Ye[t]||~t.indexOf("adius"))?(v=m?e.getBBox()[h?"width":"height"]:e[l],Et(d?s/v*f:s/100*v)):(o[h?"width":"height"]=f+(c?a:n),p=~t.indexOf("adius")||n==="em"&&e.appendChild&&!u?e:e.parentNode,m&&(p=(e.ownerSVGElement||{}).parentNode),(!p||p===hi||!p.appendChild)&&(p=hi.body),_=p._gsap,_&&d&&_.width&&h&&_.time===te.time&&!_.uncache?Et(s/_.width*f):((d||a==="%")&&!nx[De(p,"display")]&&(o.position=De(e,"position")),p===e&&(o.position="static"),p.appendChild(Fi),v=Fi[l],p.removeChild(Fi),o.position="absolute",h&&d&&(_=Oi(p),_.time=te.time,_.width=p[l]),Et(c?v*s/f:v&&s?f/v*s:0))))},Ze=function(e,t,i,n){var s;return co||go(),t in je&&t!=="transform"&&(t=je[t],~t.indexOf(",")&&(t=t.split(",")[0])),Ye[t]&&t!=="transform"?(s=jr(e,n),s=t!=="transformOrigin"?s[t]:s.svg?s.origin:ns(De(e,Ee))+" "+s.zOrigin+"px"):(s=e.style[t],(!s||s==="auto"||n||~(s+"").indexOf("calc("))&&(s=rs[t]&&rs[t](e,t,i)||De(e,t)||el(e,t)||(t==="opacity"?1:0))),i&&!~(s+"").trim().indexOf(" ")?li(e,t,s,i)+i:s},sx=function(e,t,i,n){if(!i||i==="none"){var s=ur(t,e,1),a=s&&De(e,s,1);a&&a!==i?(t=s,i=a):t==="borderColor"&&(i=De(e,"borderTopColor"))}var o=new Zt(this._pt,e.style,t,0,1,Dl),h=0,u=0,l,f,c,d,v,p,_,m,g,y,b,x;if(o.b=i,o.e=n,i+="",n+="",n==="auto"&&(e.style[t]=n,n=De(e,t)||n,e.style[t]=i),l=[i,n],wl(l),i=l[0],n=l[1],c=i.match(Ji)||[],x=n.match(Ji)||[],x.length){for(;f=Ji.exec(n);)_=f[0],g=n.substring(h,f.index),v?v=(v+1)%5:(g.substr(-5)==="rgba("||g.substr(-5)==="hsla(")&&(v=1),_!==(p=c[u++]||"")&&(d=parseFloat(p)||0,b=p.substr((d+"").length),_.charAt(1)==="="&&(_=Qi(d,_)+b),m=parseFloat(_),y=_.substr((m+"").length),h=Ji.lastIndex-y.length,y||(y=y||$t.units[t]||b,h===n.length&&(n+=y,o.e+=y)),b!==y&&(d=li(e,t,p,y)||0),o._pt={_next:o._pt,p:g||u===1?g:",",s:d,c:m-d,m:v&&v<4||t==="zIndex"?Math.round:0});o.c=h<n.length?n.substring(h,n.length):""}else o.r=t==="display"&&n==="none"?Xl:kl;return Zu.test(n)&&(o.e=0),this._pt=o,o},Kl={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},ax=function(e){var t=e.split(" "),i=t[0],n=t[1]||"50%";return(i==="top"||i==="bottom"||n==="left"||n==="right")&&(e=i,i=n,n=e),t[0]=Kl[i]||i,t[1]=Kl[n]||n,t.join(" ")},ox=function(e,t){if(t.tween&&t.tween._time===t.tween._dur){var i=t.t,n=i.style,s=t.u,a=i._gsap,o,h,u;if(s==="all"||s===!0)n.cssText="",h=1;else for(s=s.split(","),u=s.length;--u>-1;)o=s[u],Ye[o]&&(h=1,o=o==="transformOrigin"?Ee:_t),zr(i,o);h&&(zr(i,_t),a&&(a.svg&&i.removeAttribute("transform"),jr(i,1),a.uncache=1,Hl(n)))}},rs={clearProps:function(e,t,i,n,s){if(s.data!=="isFromStart"){var a=e._pt=new Zt(e._pt,t,i,0,0,ox);return a.u=n,a.pr=-10,a.tween=s,e._props.push(i),1}}},Yr=[1,0,0,1,0,0],$l={},Jl=function(e){return e==="matrix(1, 0, 0, 1, 0, 0)"||e==="none"||!e},Ql=function(e){var t=De(e,_t);return Jl(t)?Yr:t.substr(7).match(ju).map(Et)},xo=function(e,t){var i=e._gsap||Oi(e),n=e.style,s=Ql(e),a,o,h,u;return i.svg&&e.getAttribute("transform")?(h=e.transform.baseVal.consolidate().matrix,s=[h.a,h.b,h.c,h.d,h.e,h.f],s.join(",")==="1,0,0,1,0,0"?Yr:s):(s===Yr&&!e.offsetParent&&e!==ar&&!i.svg&&(h=n.display,n.display="block",a=e.parentNode,(!a||!e.offsetParent)&&(u=1,o=e.nextElementSibling,ar.appendChild(e)),s=Ql(e),h?n.display=h:zr(e,"display"),u&&(o?a.insertBefore(e,o):a?a.appendChild(e):ar.removeChild(e))),t&&s.length>6?[s[0],s[1],s[4],s[5],s[12],s[13]]:s)},bo=function(e,t,i,n,s,a){var o=e._gsap,h=s||xo(e,!0),u=o.xOrigin||0,l=o.yOrigin||0,f=o.xOffset||0,c=o.yOffset||0,d=h[0],v=h[1],p=h[2],_=h[3],m=h[4],g=h[5],y=t.split(" "),b=parseFloat(y[0])||0,x=parseFloat(y[1])||0,T,w,S,E;i?h!==Yr&&(w=d*_-v*p)&&(S=b*(_/w)+x*(-p/w)+(p*g-_*m)/w,E=b*(-v/w)+x*(d/w)-(d*g-v*m)/w,b=S,x=E):(T=jl(e),b=T.x+(~y[0].indexOf("%")?b/100*T.width:b),x=T.y+(~(y[1]||y[0]).indexOf("%")?x/100*T.height:x)),n||n!==!1&&o.smooth?(m=b-u,g=x-l,o.xOffset=f+(m*d+g*p)-m,o.yOffset=c+(m*v+g*_)-g):o.xOffset=o.yOffset=0,o.xOrigin=b,o.yOrigin=x,o.smooth=!!n,o.origin=t,o.originIsAbsolute=!!i,e.style[Ee]="0px 0px",a&&(ui(a,o,"xOrigin",u,b),ui(a,o,"yOrigin",l,x),ui(a,o,"xOffset",f,o.xOffset),ui(a,o,"yOffset",c,o.yOffset)),e.setAttribute("data-svg-origin",b+" "+x)},jr=function(e,t){var i=e._gsap||new Rl(e);if("x"in i&&!t&&!i.uncache)return i;var n=e.style,s=i.scaleX<0,a="px",o="deg",h=getComputedStyle(e),u=De(e,Ee)||"0",l,f,c,d,v,p,_,m,g,y,b,x,T,w,S,E,P,O,M,F,G,A,I,N,Y,H,R,C,B,Z,W,J;return l=f=c=p=_=m=g=y=b=0,d=v=1,i.svg=!!(e.getCTM&&Zl(e)),h.translate&&((h.translate!=="none"||h.scale!=="none"||h.rotate!=="none")&&(n[_t]=(h.translate!=="none"?"translate3d("+(h.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(h.rotate!=="none"?"rotate("+h.rotate+") ":"")+(h.scale!=="none"?"scale("+h.scale.split(" ").join(",")+") ":"")+(h[_t]!=="none"?h[_t]:"")),n.scale=n.rotate=n.translate="none"),w=xo(e,i.svg),i.svg&&(i.uncache?(Y=e.getBBox(),u=i.xOrigin-Y.x+"px "+(i.yOrigin-Y.y)+"px",N=""):N=!t&&e.getAttribute("data-svg-origin"),bo(e,N||u,!!N||i.originIsAbsolute,i.smooth!==!1,w)),x=i.xOrigin||0,T=i.yOrigin||0,w!==Yr&&(O=w[0],M=w[1],F=w[2],G=w[3],l=A=w[4],f=I=w[5],w.length===6?(d=Math.sqrt(O*O+M*M),v=Math.sqrt(G*G+F*F),p=O||M?hr(M,O)*Ni:0,g=F||G?hr(F,G)*Ni+p:0,g&&(v*=Math.abs(Math.cos(g*or))),i.svg&&(l-=x-(x*O+T*F),f-=T-(x*M+T*G))):(J=w[6],Z=w[7],R=w[8],C=w[9],B=w[10],W=w[11],l=w[12],f=w[13],c=w[14],S=hr(J,B),_=S*Ni,S&&(E=Math.cos(-S),P=Math.sin(-S),N=A*E+R*P,Y=I*E+C*P,H=J*E+B*P,R=A*-P+R*E,C=I*-P+C*E,B=J*-P+B*E,W=Z*-P+W*E,A=N,I=Y,J=H),S=hr(-F,B),m=S*Ni,S&&(E=Math.cos(-S),P=Math.sin(-S),N=O*E-R*P,Y=M*E-C*P,H=F*E-B*P,W=G*P+W*E,O=N,M=Y,F=H),S=hr(M,O),p=S*Ni,S&&(E=Math.cos(S),P=Math.sin(S),N=O*E+M*P,Y=A*E+I*P,M=M*E-O*P,I=I*E-A*P,O=N,A=Y),_&&Math.abs(_)+Math.abs(p)>359.9&&(_=p=0,m=180-m),d=Et(Math.sqrt(O*O+M*M+F*F)),v=Et(Math.sqrt(I*I+J*J)),S=hr(A,I),g=Math.abs(S)>2e-4?S*Ni:0,b=W?1/(W<0?-W:W):0),i.svg&&(N=e.getAttribute("transform"),i.forceCSS=e.setAttribute("transform","")||!Jl(De(e,_t)),N&&e.setAttribute("transform",N))),Math.abs(g)>90&&Math.abs(g)<270&&(s?(d*=-1,g+=p<=0?180:-180,p+=p<=0?180:-180):(v*=-1,g+=g<=0?180:-180)),t=t||i.uncache,i.x=l-((i.xPercent=l&&(!t&&i.xPercent||(Math.round(e.offsetWidth/2)===Math.round(-l)?-50:0)))?e.offsetWidth*i.xPercent/100:0)+a,i.y=f-((i.yPercent=f&&(!t&&i.yPercent||(Math.round(e.offsetHeight/2)===Math.round(-f)?-50:0)))?e.offsetHeight*i.yPercent/100:0)+a,i.z=c+a,i.scaleX=Et(d),i.scaleY=Et(v),i.rotation=Et(p)+o,i.rotationX=Et(_)+o,i.rotationY=Et(m)+o,i.skewX=g+o,i.skewY=y+o,i.transformPerspective=b+a,(i.zOrigin=parseFloat(u.split(" ")[2])||0)&&(n[Ee]=ns(u)),i.xOffset=i.yOffset=0,i.force3D=$t.force3D,i.renderTransform=i.svg?ux:Vl?tf:hx,i.uncache=0,i},ns=function(e){return(e=e.split(" "))[0]+" "+e[1]},To=function(e,t,i){var n=Ht(t);return Et(parseFloat(t)+parseFloat(li(e,"x",i+"px",n)))+n},hx=function(e,t){t.z="0px",t.rotationY=t.rotationX="0deg",t.force3D=0,tf(e,t)},Li="0deg",Zr="0px",Bi=") ",tf=function(e,t){var i=t||this,n=i.xPercent,s=i.yPercent,a=i.x,o=i.y,h=i.z,u=i.rotation,l=i.rotationY,f=i.rotationX,c=i.skewX,d=i.skewY,v=i.scaleX,p=i.scaleY,_=i.transformPerspective,m=i.force3D,g=i.target,y=i.zOrigin,b="",x=m==="auto"&&e&&e!==1||m===!0;if(y&&(f!==Li||l!==Li)){var T=parseFloat(l)*or,w=Math.sin(T),S=Math.cos(T),E;T=parseFloat(f)*or,E=Math.cos(T),a=To(g,a,w*E*-y),o=To(g,o,-Math.sin(T)*-y),h=To(g,h,S*E*-y+y)}_!==Zr&&(b+="perspective("+_+Bi),(n||s)&&(b+="translate("+n+"%, "+s+"%) "),(x||a!==Zr||o!==Zr||h!==Zr)&&(b+=h!==Zr||x?"translate3d("+a+", "+o+", "+h+") ":"translate("+a+", "+o+Bi),u!==Li&&(b+="rotate("+u+Bi),l!==Li&&(b+="rotateY("+l+Bi),f!==Li&&(b+="rotateX("+f+Bi),(c!==Li||d!==Li)&&(b+="skew("+c+", "+d+Bi),(v!==1||p!==1)&&(b+="scale("+v+", "+p+Bi),g.style[_t]=b||"translate(0, 0)"},ux=function(e,t){var i=t||this,n=i.xPercent,s=i.yPercent,a=i.x,o=i.y,h=i.rotation,u=i.skewX,l=i.skewY,f=i.scaleX,c=i.scaleY,d=i.target,v=i.xOrigin,p=i.yOrigin,_=i.xOffset,m=i.yOffset,g=i.forceCSS,y=parseFloat(a),b=parseFloat(o),x,T,w,S,E;h=parseFloat(h),u=parseFloat(u),l=parseFloat(l),l&&(l=parseFloat(l),u+=l,h+=l),h||u?(h*=or,u*=or,x=Math.cos(h)*f,T=Math.sin(h)*f,w=Math.sin(h-u)*-c,S=Math.cos(h-u)*c,u&&(l*=or,E=Math.tan(u-l),E=Math.sqrt(1+E*E),w*=E,S*=E,l&&(E=Math.tan(l),E=Math.sqrt(1+E*E),x*=E,T*=E)),x=Et(x),T=Et(T),w=Et(w),S=Et(S)):(x=f,S=c,T=w=0),(y&&!~(a+"").indexOf("px")||b&&!~(o+"").indexOf("px"))&&(y=li(d,"x",a,"px"),b=li(d,"y",o,"px")),(v||p||_||m)&&(y=Et(y+v-(v*x+p*w)+_),b=Et(b+p-(v*T+p*S)+m)),(n||s)&&(E=d.getBBox(),y=Et(y+n/100*E.width),b=Et(b+s/100*E.height)),E="matrix("+x+","+T+","+w+","+S+","+y+","+b+")",d.setAttribute("transform",E),g&&(d.style[_t]=E)},lx=function(e,t,i,n,s){var a=360,o=Nt(s),h=parseFloat(s)*(o&&~s.indexOf("rad")?Ni:1),u=h-n,l=n+u+"deg",f,c;return o&&(f=s.split("_")[1],f==="short"&&(u%=a,u!==u%(a/2)&&(u+=u<0?a:-a)),f==="cw"&&u<0?u=(u+a*Gl)%a-~~(u/a)*a:f==="ccw"&&u>0&&(u=(u-a*Gl)%a-~~(u/a)*a)),e._pt=c=new Zt(e._pt,t,i,n,u,j0),c.e=l,c.u="deg",e._props.push(i),c},ef=function(e,t){for(var i in t)e[i]=t[i];return e},fx=function(e,t,i){var n=ef({},i._gsap),s="perspective,force3D,transformOrigin,svgOrigin",a=i.style,o,h,u,l,f,c,d,v;n.svg?(u=i.getAttribute("transform"),i.setAttribute("transform",""),a[_t]=t,o=jr(i,1),zr(i,_t),i.setAttribute("transform",u)):(u=getComputedStyle(i)[_t],a[_t]=t,o=jr(i,1),a[_t]=u);for(h in Ye)u=n[h],l=o[h],u!==l&&s.indexOf(h)<0&&(d=Ht(u),v=Ht(l),f=d!==v?li(i,h,u,v):parseFloat(u),c=parseFloat(l),e._pt=new Zt(e._pt,o,h,f,c-f,_o),e._pt.u=v||0,e._props.push(h));ef(o,n)};Yt("padding,margin,Width,Radius",function(r,e){var t="Top",i="Right",n="Bottom",s="Left",a=(e<3?[t,i,n,s]:[t+s,t+i,n+i,n+s]).map(function(o){return e<2?r+o:"border"+o+r});rs[e>1?"border"+r:r]=function(o,h,u,l,f){var c,d;if(arguments.length<4)return c=a.map(function(v){return Ze(o,v,u)}),d=c.join(" "),d.split(c[0]).length===5?c[0]:d;c=(l+"").split(" "),d={},a.forEach(function(v,p){return d[v]=c[p]=c[p]||c[(p-1)/2|0]}),o.init(h,d,f)}});var rf={name:"css",register:go,targetTest:function(e){return e.style&&e.nodeType},init:function(e,t,i,n,s){var a=this._props,o=e.style,h=i.vars.startAt,u,l,f,c,d,v,p,_,m,g,y,b,x,T,w,S;co||go(),this.styles=this.styles||Wl(e),S=this.styles.props,this.tween=i;for(p in t)if(p!=="autoRound"&&(l=t[p],!(Qt[p]&&Cl(p,t,i,n,e,s)))){if(d=typeof l,v=rs[p],d==="function"&&(l=l.call(i,n,e,s),d=typeof l),d==="string"&&~l.indexOf("random(")&&(l=kr(l)),v)v(this,e,p,l,i)&&(w=1);else if(p.substr(0,2)==="--")u=(getComputedStyle(e).getPropertyValue(p)+"").trim(),l+="",ai.lastIndex=0,ai.test(u)||(_=Ht(u),m=Ht(l)),m?_!==m&&(u=li(e,p,u,m)+m):_&&(l+=_),this.add(o,"setProperty",u,l,n,s,0,0,p),a.push(p),S.push(p,0,o[p]);else if(d!=="undefined"){if(h&&p in h?(u=typeof h[p]=="function"?h[p].call(i,n,e,s):h[p],Nt(u)&&~u.indexOf("random(")&&(u=kr(u)),Ht(u+"")||(u+=$t.units[p]||Ht(Ze(e,p))||""),(u+"").charAt(1)==="="&&(u=Ze(e,p))):u=Ze(e,p),c=parseFloat(u),g=d==="string"&&l.charAt(1)==="="&&l.substr(0,2),g&&(l=l.substr(2)),f=parseFloat(l),p in je&&(p==="autoAlpha"&&(c===1&&Ze(e,"visibility")==="hidden"&&f&&(c=0),S.push("visibility",0,o.visibility),ui(this,o,"visibility",c?"inherit":"hidden",f?"inherit":"hidden",!f)),p!=="scale"&&p!=="transform"&&(p=je[p],~p.indexOf(",")&&(p=p.split(",")[0]))),y=p in Ye,y){if(this.styles.save(p),b||(x=e._gsap,x.renderTransform&&!t.parseTransform||jr(e,t.parseTransform),T=t.smoothOrigin!==!1&&x.smooth,b=this._pt=new Zt(this._pt,o,_t,0,1,x.renderTransform,x,0,-1),b.dep=1),p==="scale")this._pt=new Zt(this._pt,x,"scaleY",x.scaleY,(g?Qi(x.scaleY,g+f):f)-x.scaleY||0,_o),this._pt.u=0,a.push("scaleY",p),p+="X";else if(p==="transformOrigin"){S.push(Ee,0,o[Ee]),l=ax(l),x.svg?bo(e,l,0,T,0,this):(m=parseFloat(l.split(" ")[2])||0,m!==x.zOrigin&&ui(this,x,"zOrigin",x.zOrigin,m),ui(this,o,p,ns(u),ns(l)));continue}else if(p==="svgOrigin"){bo(e,l,1,T,0,this);continue}else if(p in $l){lx(this,x,p,c,g?Qi(c,g+l):l);continue}else if(p==="smoothOrigin"){ui(this,x,"smooth",x.smooth,l);continue}else if(p==="force3D"){x[p]=l;continue}else if(p==="transform"){fx(this,l,e);continue}}else p in o||(p=ur(p)||p);if(y||(f||f===0)&&(c||c===0)&&!Y0.test(l)&&p in o)_=(u+"").substr((c+"").length),f||(f=0),m=Ht(l)||(p in $t.units?$t.units[p]:_),_!==m&&(c=li(e,p,u,m)),this._pt=new Zt(this._pt,y?x:o,p,c,(g?Qi(c,g+f):f)-c,!y&&(m==="px"||p==="zIndex")&&t.autoRound!==!1?q0:_o),this._pt.u=m||0,_!==m&&m!=="%"&&(this._pt.b=u,this._pt.r=Z0);else if(p in o)sx.call(this,e,p,u,g?g+l:l);else if(p in e)this.add(e,p,u||e[p],g?g+l:l,n,s);else if(p!=="parseTransform"){Wa(p,l);continue}y||(p in o?S.push(p,0,o[p]):S.push(p,1,u||e[p])),a.push(p)}}w&&Fl(this)},render:function(e,t){if(t.tween._time||!po())for(var i=t._pt;i;)i.r(e,i.d),i=i._next;else t.styles.revert()},get:Ze,aliases:je,getSetter:function(e,t,i){var n=je[t];return n&&n.indexOf(",")<0&&(t=n),t in Ye&&t!==Ee&&(e._gsap.x||Ze(e,"x"))?i&&Ul===i?t==="scale"?Q0:J0:(Ul=i||{})&&(t==="scale"?tx:ex):e.style&&!Ua(e.style[t])?K0:~t.indexOf("-")?$0:oo(e,t)},core:{_removeProperty:zr,_getMatrix:xo}};ee.utils.checkPrefix=ur,ee.core.getStyleSaver=Wl,function(r,e,t,i){var n=Yt(r+","+e+","+t,function(s){Ye[s]=1});Yt(e,function(s){$t.units[s]="deg",$l[s]=1}),je[n[13]]=r+","+e,Yt(i,function(s){var a=s.split(":");je[a[1]]=n[a[0]]})}("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY"),Yt("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(r){$t.units[r]="px"}),ee.registerPlugin(rf);var wo=ee.registerPlugin(rf)||ee;wo.core.Tween;const Eo={fadeIn:.25,move:.5},ss="box",qr={startCap:"startCap",endCap:"endCap",body:"body"};class cx extends yt{constructor({appRef:t,nodeData:i,styles:n,styleNode:s,layoutPosition:a}){super();U(this,"appRef");U(this,"nodeData");U(this,"styles");U(this,"styleNode");U(this,"unwatch");U(this,"label");U(this,"boxCapWidth",0);U(this,"box",new yt);U(this,"apxLabelWidth",0);U(this,"nodeWidth");U(this,"layoutPositionOffset");U(this,"layoutPosition");U(this,"isLabelInBox",!0);U(this,"selectedRing",new ne);this.appRef=t,this.nodeData=i,this.styles=n,this.styleNode=s,this.layoutPosition=a,this.boxCapWidth=this.styles.value.borderRadiusNode,this.nodeWidth=this.getNodeWidth(),this.layoutPositionOffset=this.getLayoutPositionOffset(),this.box.name=ss,this.drawBox(),this.addChild(this.box),this.drawLabel(),this.drawSelectedRing(),this.selectedRing.alpha=0,this.updatePosition(!0),this.unwatch=Q.watch([n,s],()=>{this.box.removeChildren(),this.drawBox(),this.drawLabel()},{deep:!0}),this.interactive=!0,this.buttonMode=!0,this.animateIn()}getNodeWidth(){const t=this.boxCapWidth*2,i=ae.dateToX(this.nodeData.end??new Date)-ae.dateToX(this.nodeData.start);return i>t?i:t}getLayoutPositionOffset(){const{textLineHeightDefault:t,spacingNodeYPadding:i,spacingNodeMargin:n}=this.styles.value;return t+i*2+n}drawBox(){const{appRef:t,nodeWidth:i,box:n,boxCapWidth:s}=this,{fill:a}=this.styleNode.value(this.nodeData),o=qe(a),h=!this.nodeData.end,{textLineHeightDefault:u,spacingNodeYPadding:l,borderRadiusNode:f}=this.styles.value,c=u+l*2,{cap:d,body:v}=Hy({appRef:t,fill:o,borderRadius:f,boxCapWidth:s,height:c}),p=new We(d);p.name=qr.startCap;const _=new We(v);if(_.name=qr.body,_.width=this.getBoxBodyWidth(),_.position.set(s,0),n.addChild(p),n.addChild(_),!h){const m=new We(d);m.name=qr.endCap,m.rotation=Math.PI,m.position.set(i,c),n.addChild(m)}}getBoxBodyWidth(){const{nodeData:t,nodeWidth:i,boxCapWidth:n}=this;return!t.end?i-n:i-n*2}async drawLabel(){var s;const t=await Wn(this.styles.value),{inverseTextOnFill:i}=this.styleNode.value(this.nodeData),{spacingNodeXPadding:n}=this.styles.value;if(this.apxLabelWidth===0&&(this.apxLabelWidth=se.measureText(this.nodeData.label,t.nodeTextStyles).width*(1+7/100)),(s=this.label)==null||s.destroy(),this.apxLabelWidth+n*2>this.nodeWidth)this.isLabelInBox=!1,this.label=new kn(this.nodeData.label,t.nodeTextDefault);else{const a=i?t.nodeTextInverse:t.nodeTextDefault;this.isLabelInBox=!0,this.label=new kn(this.nodeData.label,a)}this.updateLabelPosition(),this.addChild(this.label)}drawSelectedRing(){const{colorNodeSelection:t,spacingNodeSelectionMargin:i,spacingNodeSelectionWidth:n,borderRadiusNode:s}=this.styles.value;this.selectedRing.lineStyle(n,t,1,1),this.selectedRing.drawRoundedRect(-i,-i,this.nodeWidth+i*2,this.box.height+i*2,s),this.addChild(this.selectedRing)}animateIn(){wo.to(this,{alpha:1,duration:Eo.fadeIn})}updateBoxWidth(){this.box.children.forEach(t=>{switch(t.name){case qr.body:t.scale.x=this.getBoxBodyWidth();break;case qr.endCap:t.position.set(this.nodeWidth,this.box.height);break}})}async updatePosition(t){const i=ae.dateToX(this.nodeData.start),n=this.layoutPosition*this.layoutPositionOffset;if(t){this.position.set(i,n);return}await new Promise(s=>{wo.to(this,{x:i,y:n,duration:Eo.move,ease:"power1.out"}).then(()=>{s(null)})})}updateLabelPosition(){var s;const{spacingNodeXPadding:t,spacingNodeYPadding:i,spacingNodeLabelMargin:n}=this.styles.value;(s=this.label)==null||s.position.set(this.isLabelInBox?t:this.nodeWidth+n,i)}async update(t){let i=!1;t&&(i=t.state!==this.nodeData.state,this.nodeData=t);const n=this.getNodeWidth();i&&(this.box.removeChildren(),this.drawBox()),n!==this.nodeWidth&&(i||this.updateBoxWidth(),this.nodeWidth=n,this.selectedRing.clear(),this.drawSelectedRing(),this.isLabelInBox&&this.apxLabelWidth>this.nodeWidth+2||!this.isLabelInBox&&this.apxLabelWidth<this.nodeWidth-2?this.drawLabel():this.isLabelInBox||this.updateLabelPosition()),await this.updatePosition()}select(){this.selectedRing.alpha=1}deselect(){this.selectedRing.alpha=0}destroy(){this.unwatch(),super.destroy.call(this)}}const nf="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2NvbnN0IEw9KHttaW5pbXVtU3RhcnRUaW1lOmUsb3ZlcmFsbEdyYXBoV2lkdGg6bixpbml0aWFsT3ZlcmFsbFRpbWVTcGFuOnR9KT0+KHtkYXRlVG9YOlQoZSxuLHQpLHhUb0RhdGU6UyhlLG4sdCl9KTtmdW5jdGlvbiBUKGUsbix0KXtyZXR1cm4gZnVuY3Rpb24obyl7cmV0dXJuIE1hdGguY2VpbCgoby5nZXRUaW1lKCktZSkqKG4vdCkpfX1mdW5jdGlvbiBTKGUsbix0KXtyZXR1cm4gZnVuY3Rpb24obyl7cmV0dXJuIE1hdGguY2VpbChlK28qKHQvbikpfX1jb25zdCBnPTA7bGV0IGQsRD0xNCx2PTAsdz0id2F0ZXJmYWxsIixtPVtdO2NvbnN0IHM9e307b25tZXNzYWdlPWFzeW5jKHtkYXRhOntsYXlvdXRTZXR0aW5nOmUsZ3JhcGhEYXRhOm4sYXB4Q2hhcmFjdGVyV2lkdGg6dCxzcGFjaW5nTWluaW11bU5vZGVFZGdlR2FwOm8sdGltZVNjYWxlUHJvcHM6aSxyZWNlbnRlckFmdGVyOnJ9fSk9PntpZighbil7Y29uc29sZS53YXJuKCJub2RlTGF5b3V0IHdvcmtlcjogY2FsbGVkIHdpdGhvdXQgZ3JhcGhEYXRhLCBleGl0aW5nLiIpO3JldHVybn1pZihvJiYodj1vKSxlKXtmb3IoY29uc3QgYSBpbiBzKWRlbGV0ZSBzW2FdO3c9ZX1pZih0JiYoRD10KSwhZCYmaSl7Y29uc3R7bWluaW11bVN0YXJ0VGltZTphLG92ZXJhbGxHcmFwaFdpZHRoOnUsaW5pdGlhbE92ZXJhbGxUaW1lU3BhbjpwfT1pO2Q9TCh7bWluaW11bVN0YXJ0VGltZTphLG92ZXJhbGxHcmFwaFdpZHRoOnUsaW5pdGlhbE92ZXJhbGxUaW1lU3BhbjpwfSl9Y29uc3QgYz1KU09OLnBhcnNlKG4pO2QmJihlfHxtIT09YykmJihtPWMsYXdhaXQgWCgpLHBvc3RNZXNzYWdlKHtsYXlvdXQ6cyxyZWNlbnRlckFmdGVyOnJ9KSl9O2FzeW5jIGZ1bmN0aW9uIFgoKXt3PT09IndhdGVyZmFsbCImJlAoKSx3PT09Im5lYXJlc3RQYXJlbnQiJiZhd2FpdCBDKCl9ZnVuY3Rpb24gUCgpe20uZm9yRWFjaCgoZSxuKT0+e3NbZS5pZF09e3Bvc2l0aW9uOm4sc3RhcnRYOjAsZW5kWDowfX0pfWFzeW5jIGZ1bmN0aW9uIEMoKXtmb3IgYXdhaXQoY29uc3QgZSBvZiBtKXtjb25zdCBuPWQuZGF0ZVRvWChlLmVuZD9uZXcgRGF0ZShlLmVuZCk6bmV3IERhdGUpLHQ9ZS5sYWJlbC5sZW5ndGgqRCxvPW4rdDtpZihlLmlkIGluIHMpe3NbZS5pZF0uZW5kWD1vO2NvbnRpbnVlfWNvbnN0IGk9ZS5pZCBpbiBzP3NbZS5pZF0uc3RhcnRYOmQuZGF0ZVRvWChuZXcgRGF0ZShlLnN0YXJ0KSkscj1hd2FpdCBPKGUsaSk7c1tlLmlkXT17cG9zaXRpb246cixzdGFydFg6aSxlbmRYOm99fX1hc3luYyBmdW5jdGlvbiBPKGUsbil7aWYoZS51cHN0cmVhbURlcGVuZGVuY2llcyYmZS51cHN0cmVhbURlcGVuZGVuY2llcy5sZW5ndGg9PT0xKXtpZihlLnVwc3RyZWFtRGVwZW5kZW5jaWVzWzBdaW4gcyl7Y29uc3QgdD1zW2UudXBzdHJlYW1EZXBlbmRlbmNpZXNbMF1dO3JldHVybiBhd2FpdCBoKHQsbil9cmV0dXJuIGNvbnNvbGUud2FybigidGltZWxpbmVOb2RlcyBsYXlvdXQgd29ya2VyOiBQYXJlbnQgbm9kZSBub3QgZm91bmQgaW4gbGF5b3V0IixlLnVwc3RyZWFtRGVwZW5kZW5jaWVzWzBdKSxnfWlmKGUudXBzdHJlYW1EZXBlbmRlbmNpZXMmJmUudXBzdHJlYW1EZXBlbmRlbmNpZXMubGVuZ3RoPjApe2NvbnN0IG89ZS51cHN0cmVhbURlcGVuZGVuY2llcy5tYXAoYT0+c1thXSkuZmlsdGVyKGE9PiEhYSkubWFwKGE9PmEucG9zaXRpb24pLHI9by5yZWR1Y2UoKGEsdSk9PmErdSwwKS9vLmxlbmd0aCxjPU1hdGgucm91bmQocik7aWYoeShuLGMpKXtjb25zdCBhPUkobixjKSx1PWEuZmlsdGVyKHA9Pnt2YXIgZjtyZXR1cm4oZj1lLnVwc3RyZWFtRGVwZW5kZW5jaWVzKT09bnVsbD92b2lkIDA6Zi5pbmNsdWRlcyhwKX0pO2lmKHUubGVuZ3RoPjB8fGEubGVuZ3RoPjEpe2NvbnN0W3BdPXUubGVuZ3RoPjA/dTphLGY9c1twXTtyZXR1cm4gZi5uZXh0RGVwZW5kZW5jeVNob3ZlPUEobyxjLGYubmV4dERlcGVuZGVuY3lTaG92ZSksYXdhaXQgaChmLG4pfXJldHVybiBhd2FpdCBiKHtjb21wZXRpbmdMYXlvdXRJdGVtSWQ6YVswXSx1cHN0cmVhbVBvc2l0aW9uczpvLG5vZGVTdGFydFg6bixkZXNpcmVkUG9zaXRpb246Y30pfX1yZXR1cm4gTihuLGcpfWZ1bmN0aW9uIE4oZSxuKXtyZXR1cm4geShlLG4pP04oZSxuKzEpOm59YXN5bmMgZnVuY3Rpb24gaChlLG4pe2UubmV4dERlcGVuZGVuY3lTaG92ZSE9PTEmJmUubmV4dERlcGVuZGVuY3lTaG92ZSE9PS0xJiYoZS5uZXh0RGVwZW5kZW5jeVNob3ZlPTEpO2NvbnN0e3Bvc2l0aW9uOnQsbmV4dERlcGVuZGVuY3lTaG92ZTpvfT1lO3JldHVybiB5KG4sdCk/bz09PTEmJiF5KG4sdCsxKT8oZS5uZXh0RGVwZW5kZW5jeVNob3ZlPS0xLHQrMSk6eShuLHQtMSk/KGF3YWl0IGwoe2RpcmVjdGlvbjpvLG5vZGVTdGFydFg6bixkZXNpcmVkUG9zaXRpb246dCtvfSksZS5uZXh0RGVwZW5kZW5jeVNob3ZlPW89PT0xPy0xOjEsdCtvKTooZS5uZXh0RGVwZW5kZW5jeVNob3ZlPTEsdC0xKTp0fWZ1bmN0aW9uIHkoZSxuKXtjb25zdCB0PU9iamVjdC5rZXlzKHMpO3JldHVybiB0Lmxlbmd0aD4wJiZ0LnNvbWUobz0+e2NvbnN0IGk9c1tvXTtyZXR1cm4geCh7Zmlyc3ROb2RlRW5kWDppLmVuZFgsZmlyc3ROb2RlUG9zaXRpb246aS5wb3NpdGlvbixsYXN0Tm9kZVN0YXJ0WDplLGxhc3ROb2RlUG9zaXRpb246bn0pfSl9YXN5bmMgZnVuY3Rpb24gbCh7ZGlyZWN0aW9uOmUsbm9kZVN0YXJ0WDpuLGRlc2lyZWRQb3NpdGlvbjp0fSl7Y29uc3Qgbz1JKG4sdCk7aWYobylmb3IgYXdhaXQoY29uc3QgaSBvZiBvKXtjb25zdCByPXNbaV0sYz1yLnBvc2l0aW9uK2U7YXdhaXQgbCh7ZGlyZWN0aW9uOmUsbm9kZVN0YXJ0WDpyLnN0YXJ0WCxkZXNpcmVkUG9zaXRpb246Y30pLHIucG9zaXRpb249Y319ZnVuY3Rpb24geCh7Zmlyc3ROb2RlRW5kWDplLGZpcnN0Tm9kZVBvc2l0aW9uOm4sbGFzdE5vZGVTdGFydFg6dCxsYXN0Tm9kZVBvc2l0aW9uOm99KXtyZXR1cm4gbj09PW8mJmUrdj49dH1mdW5jdGlvbiBJKGUsbil7Y29uc3QgdD1bXTtpZihPYmplY3Qua2V5cyhzKS5mb3JFYWNoKG89Pntjb25zdCBpPXNbb107eCh7Zmlyc3ROb2RlRW5kWDppLmVuZFgsZmlyc3ROb2RlUG9zaXRpb246aS5wb3NpdGlvbixsYXN0Tm9kZVN0YXJ0WDplLGxhc3ROb2RlUG9zaXRpb246bn0pJiZ0LnB1c2gobyl9KSx0Lmxlbmd0aCE9PTApcmV0dXJuIHQuc29ydCgobyxpKT0+e2NvbnN0IHI9c1tvXSxjPXNbaV07cmV0dXJuIHIuZW5kWDxjLmVuZFg/MTpyLmVuZFg+Yy5lbmRYPy0xOjB9KSx0fWZ1bmN0aW9uIEEoZSxuLHQpe2NvbnN0IG89ZS5maWx0ZXIocj0+cjxuKS5sZW5ndGgsaT1lLmZpbHRlcihyPT5yPm4pLmxlbmd0aDtyZXR1cm4gbz5pPy0xOnQ/PzF9YXN5bmMgZnVuY3Rpb24gYih7ZGVzaXJlZFBvc2l0aW9uOmUsbm9kZVN0YXJ0WDpuLHVwc3RyZWFtUG9zaXRpb25zOnQsY29tcGV0aW5nTGF5b3V0SXRlbUlkOm99KXtjb25zdCBpPXNbb10sW3IsY109ayhvKSxhPXQuZmlsdGVyKHA9PnA8ZSkubGVuZ3RoLHU9dC5maWx0ZXIocD0+cD5lKS5sZW5ndGg7aWYoYT51KXtpZihyPmMmJnI+YSlyZXR1cm4gYXdhaXQgbCh7ZGlyZWN0aW9uOi0xLG5vZGVTdGFydFg6bixkZXNpcmVkUG9zaXRpb246ZX0pLGU7aWYoYz5yKXJldHVybiBhd2FpdCBsKHtkaXJlY3Rpb246MSxub2RlU3RhcnRYOm4sZGVzaXJlZFBvc2l0aW9uOmV9KSxlO2kubmV4dERlcGVuZGVuY3lTaG92ZT0tMX1pZih1PmEpe2lmKGM+ciYmYz51KXJldHVybiBhd2FpdCBsKHtkaXJlY3Rpb246MSxub2RlU3RhcnRYOm4sZGVzaXJlZFBvc2l0aW9uOmV9KSxlO2lmKHI+YylyZXR1cm4gYXdhaXQgbCh7ZGlyZWN0aW9uOi0xLG5vZGVTdGFydFg6bixkZXNpcmVkUG9zaXRpb246ZX0pLGU7aS5uZXh0RGVwZW5kZW5jeVNob3ZlPTF9cmV0dXJuIGF3YWl0IGgoaSxuKX1mdW5jdGlvbiBrKGUpe3ZhciBvO2NvbnN0IG49bS5maW5kKGk9PmkuaWQ9PT1lKSx0PXNbZV07cmV0dXJuKChvPW4udXBzdHJlYW1EZXBlbmRlbmNpZXMpPT1udWxsP3ZvaWQgMDpvLnJlZHVjZSgoaSxyKT0+e2lmKGUgaW4gcyl7Y29uc3QgYz1zW3JdO3JldHVybiBjLnBvc2l0aW9uPHQucG9zaXRpb24mJihpWzBdKz0xKSxjLnBvc2l0aW9uPnQucG9zaXRpb24mJihpWzFdKz0xKSxpfXJldHVybiBjb25zb2xlLndhcm4oIm5vZGVMYXlvdXQud29ya2VyLnRzOiBQYXJlbnQgbm9kZSBub3QgZm91bmQgb24gbGF5b3V0IGRhdGEiLGUpLGl9LFswLDBdKSk/P1swLDBdfX0pKCk7Ci8vIyBzb3VyY2VNYXBwaW5nVVJMPW5vZGVMYXlvdXQud29ya2VyLTMzMmNmMTcyLmpzLm1hcAovLyMgc291cmNlTWFwcGluZ1VSTD1hc3NldHMvbm9kZUxheW91dC53b3JrZXItMzMyY2YxNzIuanMubWFw",sf=typeof window<"u"&&window.Blob&&new Blob([atob(nf)],{type:"text/javascript;charset=utf-8"});function dx(){const r=sf&&(window.URL||window.webkitURL).createObjectURL(sf);try{return r?new Worker(r):new Worker("data:application/javascript;base64,"+nf)}finally{r&&(window.URL||window.webkitURL).revokeObjectURL(r)}}const af="nodeContainer";class px extends yt{constructor({appRef:t,viewportRef:i,graphData:n,styles:s,styleNode:a,layoutSetting:o,hideEdges:h,timeScaleProps:{minimumStartTime:u,overallGraphWidth:l,initialOverallTimeSpan:f},recenter:c}){super();U(this,"appRef");U(this,"viewportRef");U(this,"graphData");U(this,"styles");U(this,"styleNode");U(this,"recenter");U(this,"nodeContainer",new yt);U(this,"nodeRecords",new Map);U(this,"selectedNodeId",null);U(this,"layoutSetting");U(this,"hideEdges");U(this,"layoutWorker",new dx);U(this,"layout",{});U(this,"edgeContainer",new yt);U(this,"edgeRecords",[]);this.appRef=t,this.viewportRef=i,this.graphData=n,this.styles=s,this.styleNode=a,this.recenter=c,this.layoutSetting=o,this.hideEdges=h,this.initDeselectLayer(),this.nodeContainer.name=af,this.initLayoutWorker({minimumStartTime:u,overallGraphWidth:l,initialOverallTimeSpan:f})}async initLayoutWorker({minimumStartTime:t,overallGraphWidth:i,initialOverallTimeSpan:n}){const s=await Wn(this.styles.value),{spacingMinimumNodeEdgeGap:a}=this.styles.value,o=se.measureText("M",s.nodeTextStyles).width,h={data:{timeScaleProps:{minimumStartTime:t,overallGraphWidth:i,initialOverallTimeSpan:n},spacingMinimumNodeEdgeGap:a,apxCharacterWidth:o,graphData:JSON.stringify(this.graphData),layoutSetting:this.layoutSetting}};this.layoutWorker.onmessage=({data:u})=>{this.layout=u.layout,this.renderLayout(),u.recenterAfter&&this.recenterAfterDelay()},this.layoutWorker.postMessage(h.data)}recenterAfterDelay(){setTimeout(()=>{this.recenter()},Eo.move*1e3)}initDeselectLayer(){const t=new By(this.appRef,this.viewportRef);this.addChild(t),t.on("click",()=>{this.emit("node-click",null)})}renderLayout(){const t=this.nodeRecords.size===0;Object.keys(this.layout).forEach(i=>{if(this.nodeRecords.has(i)){const n=this.nodeRecords.get(i);this.updateNodeRecordAndEdgesLayout(i,n)}else this.createNode(this.graphData.find(n=>n.id===i))}),t&&(this.addChild(this.edgeContainer),this.addChild(this.nodeContainer),this.fitNodesInViewport())}async updateNodeRecordAndEdgesLayout(t,i){const n=this.graphData.find(a=>a.id===t);if(i.layoutPosition===this.layout[t].position){i.update(n);return}i.layoutPosition=this.layout[t].position;const s=this.edgeRecords.filter(a=>a.sourceId===t||a.targetId===t);s.forEach(a=>{a.edge.visible=!1}),await i.update(n),s.forEach(a=>{a.edge.update(),a.edge.visible=!0})}createNode(t){const{appRef:i,styles:n,styleNode:s}=this,a=new cx({appRef:i,nodeData:t,styles:n,styleNode:s,layoutPosition:this.layout[t.id].position});a.on("click",()=>{this.emit("node-click",t.id)}),this.nodeRecords.set(t.id,a),this.addNodeEdges(t),this.nodeContainer.addChild(a)}fitNodesInViewport(){const{spacingViewportPaddingDefault:t}=this.styles.value,{x:i,y:n,width:s,height:a}=this.nodeContainer.getBounds();this.viewportRef.ensureVisible(i-t,n-t,s+t*2,a+t*2,!0),this.viewportRef.moveCenter(i+s/2,n+a/2)}addNodeEdges(t){t.upstreamDependencies&&t.upstreamDependencies.forEach(i=>{const n=this.nodeRecords.get(i),s=this.nodeRecords.get(t.id);if(!n||!s){console.warn("timelineNodes: could not find source or target node for edge, skipping");return}const a=new Vy({appRef:this.appRef,styles:this.styles,sourceNode:n,targetNode:s});this.hideEdges&&(a.renderable=!1),this.edgeRecords.push({edge:a,sourceId:i,targetId:t.id}),this.edgeContainer.addChild(a)})}update(t){if(t){this.graphData=t;const i={data:{graphData:JSON.stringify(this.graphData)}};this.layoutWorker.postMessage(i.data);return}this.nodeRecords.forEach(i=>i.update())}updateSelection(t){var n;if(this.unHighlightAll(),!t&&this.selectedNodeId){this.clearNodeSelection();return}const i=this.selectedNodeId;i&&((n=this.nodeRecords.get(i))==null||n.deselect()),this.setNodeSelection(t??null)}updateHideEdges(t){if(this.hideEdges=t,this.edgeRecords.forEach(({edge:i})=>i.renderable=!this.hideEdges),!this.hideEdges){this.viewportRef.dirty=!0,this.viewportRef.updateTransform();return}if(this.selectedNodeId){const i=this.nodeRecords.get(this.selectedNodeId);this.highlightSelectedNodePath(this.selectedNodeId,i)}}updateLayoutSetting(t){this.layoutSetting=t;const i={data:{graphData:JSON.stringify(this.graphData),layoutSetting:t,recenterAfter:!0}};this.layoutWorker.postMessage(i.data)}clearNodeSelection(){this.nodeRecords.get(this.selectedNodeId).deselect();const t=this.nodeRecords.get(this.selectedNodeId);this.centerViewportAfterOutsideAnimation(t),this.selectedNodeId=null}setNodeSelection(t){if(this.selectedNodeId=t,!this.selectedNodeId)return;const i=this.nodeRecords.get(this.selectedNodeId);i.select(),this.highlightSelectedNodePath(this.selectedNodeId,i),this.centerViewportAfterOutsideAnimation(i)}centerViewportAfterOutsideAnimation(t){setTimeout(()=>{const i=t.x+t.width/2,n=t.y+t.height/2;this.viewportRef.animate({position:{x:i,y:n},time:1e3,ease:"easeInOutQuad",removeOnInterrupt:!0})},100)}highlightSelectedNodePath(t,i){const{alphaNodeDimmed:n}=this.styles.value,s=[...this.getAllUpstreamEdges(t),...this.getAllDownstreamEdges(t)],a=new Map;a.set(t,i),this.edgeRecords.forEach(o=>{if(s.includes(o)){const h=this.nodeRecords.get(o.sourceId),u=this.nodeRecords.get(o.targetId);a.set(o.sourceId,h),a.set(o.targetId,u),o.edge.renderable=!0;return}o.edge.alpha=n}),this.nodeRecords.forEach((o,h)=>{a.has(h)||(o.alpha=n)})}unHighlightAll(){this.edgeRecords.forEach(({edge:t})=>{this.hideEdges&&(t.renderable=!1),t.alpha=1}),this.nodeRecords.forEach(t=>{t.alpha=1})}getAllUpstreamEdges(t){var s;const i=[],n=this.graphData.find(a=>a.id===t);return(s=n==null?void 0:n.upstreamDependencies)==null||s.forEach(a=>{const o=this.edgeRecords.find(h=>h.sourceId===a&&h.targetId===t);if(o){i.push(o);const h=this.getAllUpstreamEdges(a);i.push(...h)}}),i}getAllDownstreamEdges(t){const i=[];return this.graphData.forEach(n=>{var s;if((s=n.upstreamDependencies)!=null&&s.includes(t)){const a=this.edgeRecords.find(o=>o.targetId===n.id&&o.sourceId===t);if(a){i.push(a);const o=this.getAllDownstreamEdges(n.id);i.push(...o)}}}),i}destroy(){this.removeChildren(),this.nodeRecords.forEach(t=>t.destroy()),this.nodeRecords.clear(),this.edgeRecords.forEach(t=>t.edge.destroy()),this.layoutWorker.terminate(),this.layoutWorker.onmessage=null,Xy(),super.destroy.call(this)}}class vx extends yt{constructor({viewportRef:t,appRef:i,formatDateFns:n,styles:s}){super();U(this,"viewportRef");U(this,"appRef");U(this,"formatDateFns");U(this,"styles");U(this,"unwatch");U(this,"playhead",new ne);U(this,"label");this.viewportRef=t,this.appRef=i,this.formatDateFns=n,this.styles=s,this.drawPlayhead(),this.drawTimeLabel(),this.unwatch=Q.watch(s,()=>{this.playhead.clear(),this.drawPlayhead()},{deep:!0}),this.interactive=!1}drawPlayhead(){const{colorPlayheadBg:t,spacingPlayheadWidth:i,spacingPlayheadGlowPadding:n}=this.styles.value;this.playhead.beginFill(t,.1),this.playhead.drawRect(0,0,i+n*2,this.appRef.screen.height),this.playhead.endFill(),this.playhead.beginFill(t),this.playhead.drawRect(n,0,i,this.appRef.screen.height),this.playhead.endFill(),this.addChild(this.playhead)}async drawTimeLabel(){const{spacingGuideLabelPadding:t,spacingPlayheadGlowPadding:i}=this.styles.value,n=await Wn(this.styles.value),{timeBySeconds:s}=this.formatDateFns.value,a=s(new Date);this.label=new kn(a,n.playheadTimerLabel),this.label.x=-this.label.width-(i+t),this.label.y=this.appRef.screen.height-(this.label.height+t),this.addChild(this.label),setInterval(()=>{const o=new Date;this.label.text=s(o)},1e3)}updatePosition(){const{spacingPlayheadWidth:t,spacingPlayheadGlowPadding:i}=this.styles.value;this.position.x=ae.dateToX(new Date)*this.viewportRef.scale._x+this.viewportRef.worldTransform.tx-i-t/2,this.playhead.height!==this.appRef.screen.height&&(this.playhead.height=this.appRef.screen.height)}destroy(){this.unwatch(),this.playhead.destroy(),super.destroy.call(this)}}const _x=Q.defineComponent({__name:"FlowRunTimeline",props:{graphData:null,isRunning:{type:Boolean},theme:null,formatDateFns:null,selectedNodeId:null,layout:null,hideEdges:{type:Boolean}},emits:["click"],setup(r,{expose:e,emit:t}){const i=r;e({recenter:H});const n=Q.ref(),s=Q.computed(()=>{var R;return((R=i.theme)==null?void 0:R.node)??Do}),a=Q.computed(()=>{var R;return Uf((R=i.theme)==null?void 0:R.defaults)}),o=Q.ref(!1),h=Q.computed(()=>({...Mo,...i.formatDateFns})),u={timelineGuides:0,viewport:10,playhead:20},l=Q.ref(!0);let f,c;const d=new Of;let v=!1,p;const _=Q.ref();let m,g,y,b,x,T=null,w;Q.onMounted(async()=>{if(!n.value){console.error("Stage reference not found in initPixiApp");return}P(),f=Uy(n.value),f.stage.sortableChildren=!0,c=await ky(n.value,f),c.zIndex=u.viewport,E(),O(),G(),Y(),M(),A(),l.value=!1}),Q.onBeforeUnmount(()=>{S()});function S(){b.destroy(),x==null||x.destroy(),w.destroy(),c.destroy(),f.destroy(!0)}function E(){c.on("drag-start",()=>{o.value=!0}).on("drag-end",()=>{o.value=!1})}function P(){const C=i.graphData.filter(J=>J.end).map(({start:J,end:ut})=>({start:J,end:ut}));i.isRunning===!0&&C.push({start:new Date,end:new Date});const{min:B,max:Z,span:W}=Nf(C,6e4);p=B,_.value=Z,m=W,g=n.value.clientWidth*2,y=jy({minimumStartTime:p.getTime(),overallGraphWidth:g,initialOverallTimeSpan:m})}function O(){Ly(a.value),Q.watch(a,R=>{Ny(R)})}function M(){i.isRunning&&(x=new vx({viewportRef:c,appRef:f,formatDateFns:h,styles:a}),x.zIndex=u.playhead,f.stage.addChild(x),F())}function F(){T||(T=()=>{if(i.isRunning&&x){const R=x.position.x>0&&x.position.x<f.screen.width;if(_.value=new Date,x.updatePosition(),!c.moving&&R&&x.position.x>f.screen.width-a.value.spacingViewportPaddingDefault){const C=y.xToDate(c.left);c.zoomPercent(-.1,!0),c.left=y.dateToX(new Date(C))}}else x!=null&&x.destroyed||x==null||x.destroy()},f.ticker.add(T))}Q.watch(()=>i.isRunning,R=>{l.value||(R&&(!x||x.destroyed)&&M(),!R&&x&&T&&(x.destroy(),f.ticker.remove(T),T=null))});function G(){b=new $y({viewportRef:c,appRef:f,minimumStartDate:p,maximumEndDate:_,isRunning:i.isRunning??!1,styles:a,formatDateFns:h}),b.zIndex=u.timelineGuides,f.stage.addChild(b),f.ticker.add(()=>{b.updateGuides()})}function A(){d.addAll(c.children),c.on("frame-end",()=>{(c.dirty||v)&&(d.cull(f.renderer.screen),c.dirty=!1,v=!1)})}function I(){d.uncull()}function N(){d.cull(f.renderer.screen)}function Y(){w=new px({appRef:f,viewportRef:c,graphData:i.graphData,styles:a,styleNode:s,layoutSetting:i.layout??"nearestParent",hideEdges:i.hideEdges??!1,timeScaleProps:{minimumStartTime:p.getTime(),overallGraphWidth:g,initialOverallTimeSpan:m},recenter:H}),c.addChild(w),i.isRunning&&f.ticker.add(()=>{i.isRunning&&w.update()}),w.on("node-click",R=>{o.value||t("click",R)}),Q.watch(()=>i.graphData,R=>{w.update(R),v=!0}),Q.watch(()=>i.selectedNodeId,R=>{w.updateSelection(R)}),Q.watch(()=>i.hideEdges,R=>{w.updateHideEdges(R??!1)}),Q.watch(()=>i.layout,R=>{w.updateLayoutSetting(R??"nearestParent")})}function H(){const{spacingViewportPaddingDefault:R}=a.value;I();const{x:C,y:B,width:Z,height:W}=w.getChildByName(af).getLocalBounds();N();const J=c.findFit(Z+R*2,W+R*2);c.animate({position:{x:C+Z/2,y:B+W/2},scale:J,time:500,ease:"easeInOutQuad",removeOnInterrupt:!0})}return(R,C)=>(Q.openBlock(),Q.createElementBlock("div",{ref_key:"stage",ref:n,class:"g-flow-run-timeline"},null,512))}}),Yx="";class ie{constructor(e){this.parent=e,this.paused=!1}destroy(){}down(e){return!1}move(e){return!1}up(e){return!1}wheel(e){return!1}update(e){}resize(){}reset(){}pause(){this.paused=!0}resume(){this.paused=!1}}var mx=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function gx(r,e,t){return t={path:e,exports:{},require:function(i,n){return yx(i,n??t.path)}},r(t,t.exports),t.exports}function yx(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var of=gx(function(r,e){(function(){var t,i;i=function(n){return r.exports=n},t={linear:function(n,s,a,o){return a*n/o+s},easeInQuad:function(n,s,a,o){return a*(n/=o)*n+s},easeOutQuad:function(n,s,a,o){return-a*(n/=o)*(n-2)+s},easeInOutQuad:function(n,s,a,o){return(n/=o/2)<1?a/2*n*n+s:-a/2*(--n*(n-2)-1)+s},easeInCubic:function(n,s,a,o){return a*(n/=o)*n*n+s},easeOutCubic:function(n,s,a,o){return a*((n=n/o-1)*n*n+1)+s},easeInOutCubic:function(n,s,a,o){return(n/=o/2)<1?a/2*n*n*n+s:a/2*((n-=2)*n*n+2)+s},easeInQuart:function(n,s,a,o){return a*(n/=o)*n*n*n+s},easeOutQuart:function(n,s,a,o){return-a*((n=n/o-1)*n*n*n-1)+s},easeInOutQuart:function(n,s,a,o){return(n/=o/2)<1?a/2*n*n*n*n+s:-a/2*((n-=2)*n*n*n-2)+s},easeInQuint:function(n,s,a,o){return a*(n/=o)*n*n*n*n+s},easeOutQuint:function(n,s,a,o){return a*((n=n/o-1)*n*n*n*n+1)+s},easeInOutQuint:function(n,s,a,o){return(n/=o/2)<1?a/2*n*n*n*n*n+s:a/2*((n-=2)*n*n*n*n+2)+s},easeInSine:function(n,s,a,o){return-a*Math.cos(n/o*(Math.PI/2))+a+s},easeOutSine:function(n,s,a,o){return a*Math.sin(n/o*(Math.PI/2))+s},easeInOutSine:function(n,s,a,o){return-a/2*(Math.cos(Math.PI*n/o)-1)+s},easeInExpo:function(n,s,a,o){return n===0?s:a*Math.pow(2,10*(n/o-1))+s},easeOutExpo:function(n,s,a,o){return n===o?s+a:a*(-Math.pow(2,-10*n/o)+1)+s},easeInOutExpo:function(n,s,a,o){return(n/=o/2)<1?a/2*Math.pow(2,10*(n-1))+s:a/2*(-Math.pow(2,-10*--n)+2)+s},easeInCirc:function(n,s,a,o){return-a*(Math.sqrt(1-(n/=o)*n)-1)+s},easeOutCirc:function(n,s,a,o){return a*Math.sqrt(1-(n=n/o-1)*n)+s},easeInOutCirc:function(n,s,a,o){return(n/=o/2)<1?-a/2*(Math.sqrt(1-n*n)-1)+s:a/2*(Math.sqrt(1-(n-=2)*n)+1)+s},easeInElastic:function(n,s,a,o){var h,u,l;return l=1.70158,u=0,h=a,n===0||(n/=o),u||(u=o*.3),h<Math.abs(a)?(h=a,l=u/4):l=u/(2*Math.PI)*Math.asin(a/h),-(h*Math.pow(2,10*(n-=1))*Math.sin((n*o-l)*(2*Math.PI)/u))+s},easeOutElastic:function(n,s,a,o){var h,u,l;return l=1.70158,u=0,h=a,n===0||(n/=o),u||(u=o*.3),h<Math.abs(a)?(h=a,l=u/4):l=u/(2*Math.PI)*Math.asin(a/h),h*Math.pow(2,-10*n)*Math.sin((n*o-l)*(2*Math.PI)/u)+a+s},easeInOutElastic:function(n,s,a,o){var h,u,l;return l=1.70158,u=0,h=a,n===0||(n/=o/2),u||(u=o*(.3*1.5)),h<Math.abs(a)?(h=a,l=u/4):l=u/(2*Math.PI)*Math.asin(a/h),n<1?-.5*(h*Math.pow(2,10*(n-=1))*Math.sin((n*o-l)*(2*Math.PI)/u))+s:h*Math.pow(2,-10*(n-=1))*Math.sin((n*o-l)*(2*Math.PI)/u)*.5+a+s},easeInBack:function(n,s,a,o,h){return h===void 0&&(h=1.70158),a*(n/=o)*n*((h+1)*n-h)+s},easeOutBack:function(n,s,a,o,h){return h===void 0&&(h=1.70158),a*((n=n/o-1)*n*((h+1)*n+h)+1)+s},easeInOutBack:function(n,s,a,o,h){return h===void 0&&(h=1.70158),(n/=o/2)<1?a/2*(n*n*(((h*=1.525)+1)*n-h))+s:a/2*((n-=2)*n*(((h*=1.525)+1)*n+h)+2)+s},easeInBounce:function(n,s,a,o){var h;return h=t.easeOutBounce(o-n,0,a,o),a-h+s},easeOutBounce:function(n,s,a,o){return(n/=o)<1/2.75?a*(7.5625*n*n)+s:n<2/2.75?a*(7.5625*(n-=1.5/2.75)*n+.75)+s:n<2.5/2.75?a*(7.5625*(n-=2.25/2.75)*n+.9375)+s:a*(7.5625*(n-=2.625/2.75)*n+.984375)+s},easeInOutBounce:function(n,s,a,o){var h;return n<o/2?(h=t.easeInBounce(n*2,0,a,o),h*.5+s):(h=t.easeOutBounce(n*2-o,0,a,o),h*.5+a*.5+s)}},i(t)}).call(mx)});function as(r,e){if(r){if(typeof r=="function")return r;if(typeof r=="string")return of[r]}else return of[e]}const xx={removeOnInterrupt:!1,ease:"linear",time:1e3};class Fe extends ie{__init(){this.startWidth=null}__init2(){this.startHeight=null}__init3(){this.deltaWidth=null}__init4(){this.deltaHeight=null}__init5(){this.width=null}__init6(){this.height=null}__init7(){this.time=0}constructor(e,t={}){super(e),Fe.prototype.__init.call(this),Fe.prototype.__init2.call(this),Fe.prototype.__init3.call(this),Fe.prototype.__init4.call(this),Fe.prototype.__init5.call(this),Fe.prototype.__init6.call(this),Fe.prototype.__init7.call(this),this.options=Object.assign({},xx,t),this.options.ease=as(this.options.ease),this.setupPosition(),this.setupZoom(),this.time=0}setupPosition(){typeof this.options.position<"u"?(this.startX=this.parent.center.x,this.startY=this.parent.center.y,this.deltaX=this.options.position.x-this.parent.center.x,this.deltaY=this.options.position.y-this.parent.center.y,this.keepCenter=!1):this.keepCenter=!0}setupZoom(){this.width=null,this.height=null,typeof this.options.scale<"u"?this.width=this.parent.screenWidth/this.options.scale:typeof this.options.scaleX<"u"||typeof this.options.scaleY<"u"?(typeof this.options.scaleX<"u"&&(this.width=this.parent.screenWidth/this.options.scaleX),typeof this.options.scaleY<"u"&&(this.height=this.parent.screenHeight/this.options.scaleY)):(typeof this.options.width<"u"&&(this.width=this.options.width),typeof this.options.height<"u"&&(this.height=this.options.height)),this.width!==null&&(this.startWidth=this.parent.screenWidthInWorldPixels,this.deltaWidth=this.width-this.startWidth),this.height!==null&&(this.startHeight=this.parent.screenHeightInWorldPixels,this.deltaHeight=this.height-this.startHeight)}down(){return this.options.removeOnInterrupt&&this.parent.plugins.remove("animate"),!1}complete(){this.parent.plugins.remove("animate"),this.width!==null&&this.parent.fitWidth(this.width,this.keepCenter,this.height===null),this.height!==null&&this.parent.fitHeight(this.height,this.keepCenter,this.width===null),!this.keepCenter&&this.options.position&&this.parent.moveCenter(this.options.position),this.parent.emit("animate-end",this.parent),this.options.callbackOnComplete&&this.options.callbackOnComplete(this.parent)}update(e){if(this.paused)return;this.time+=e;const t=new j(this.parent.scale.x,this.parent.scale.y);if(this.time>=this.options.time){const i=this.parent.width,n=this.parent.height;this.complete(),(i!==this.parent.width||n!==this.parent.height)&&this.parent.emit("zoomed",{viewport:this.parent,original:t,type:"animate"})}else{const i=this.options.ease(this.time,0,1,this.options.time);if(this.width!==null){const n=this.startWidth,s=this.deltaWidth;this.parent.fitWidth(n+s*i,this.keepCenter,this.height===null)}if(this.height!==null){const n=this.startHeight,s=this.deltaHeight;this.parent.fitHeight(n+s*i,this.keepCenter,this.width===null)}if(this.width===null?this.parent.scale.x=this.parent.scale.y:this.height===null&&(this.parent.scale.y=this.parent.scale.x),!this.keepCenter){const n=this.startX,s=this.startY,a=this.deltaX,o=this.deltaY,h=new j(this.parent.x,this.parent.y);this.parent.moveCenter(n+a*i,s+o*i),this.parent.emit("moved",{viewport:this.parent,original:h,type:"animate"})}(this.width||this.height)&&this.parent.emit("zoomed",{viewport:this.parent,original:t,type:"animate"})}}}function os(r){let e,t=r[0],i=1;for(;i<r.length;){const n=r[i],s=r[i+1];if(i+=2,(n==="optionalAccess"||n==="optionalCall")&&t==null)return;n==="access"||n==="optionalAccess"?(e=t,t=s(t)):(n==="call"||n==="optionalCall")&&(t=s((...a)=>t.call(e,...a)),e=void 0)}return t}const bx={sides:"all",friction:.5,time:150,ease:"easeInOutSine",underflow:"center",bounceBox:null};class hf extends ie{constructor(e,t={}){super(e),this.options=Object.assign({},bx,t),this.ease=as(this.options.ease,"easeInOutSine"),this.options.sides?this.options.sides==="all"?this.top=this.bottom=this.left=this.right=!0:this.options.sides==="horizontal"?(this.right=this.left=!0,this.top=this.bottom=!1):this.options.sides==="vertical"?(this.left=this.right=!1,this.top=this.bottom=!0):(this.top=this.options.sides.indexOf("top")!==-1,this.bottom=this.options.sides.indexOf("bottom")!==-1,this.left=this.options.sides.indexOf("left")!==-1,this.right=this.options.sides.indexOf("right")!==-1):this.left=this.top=this.right=this.bottom=!1;const i=this.options.underflow.toLowerCase();i==="center"?(this.underflowX=0,this.underflowY=0):(this.underflowX=i.indexOf("left")!==-1?-1:i.indexOf("right")!==-1?1:0,this.underflowY=i.indexOf("top")!==-1?-1:i.indexOf("bottom")!==-1?1:0),this.reset()}isActive(){return this.toX!==null||this.toY!==null}down(){return this.toX=this.toY=null,!1}up(){return this.bounce(),!1}update(e){if(!this.paused){if(this.bounce(),this.toX){const t=this.toX;t.time+=e,this.parent.emit("moved",{viewport:this.parent,type:"bounce-x"}),t.time>=this.options.time?(this.parent.x=t.end,this.toX=null,this.parent.emit("bounce-x-end",this.parent)):this.parent.x=this.ease(t.time,t.start,t.delta,this.options.time)}if(this.toY){const t=this.toY;t.time+=e,this.parent.emit("moved",{viewport:this.parent,type:"bounce-y"}),t.time>=this.options.time?(this.parent.y=t.end,this.toY=null,this.parent.emit("bounce-y-end",this.parent)):this.parent.y=this.ease(t.time,t.start,t.delta,this.options.time)}}}calcUnderflowX(){let e;switch(this.underflowX){case-1:e=0;break;case 1:e=this.parent.screenWidth-this.parent.screenWorldWidth;break;default:e=(this.parent.screenWidth-this.parent.screenWorldWidth)/2}return e}calcUnderflowY(){let e;switch(this.underflowY){case-1:e=0;break;case 1:e=this.parent.screenHeight-this.parent.screenWorldHeight;break;default:e=(this.parent.screenHeight-this.parent.screenWorldHeight)/2}return e}oob(){const e=this.options.bounceBox;if(e){const t=typeof e.x>"u"?0:e.x,i=typeof e.y>"u"?0:e.y,n=typeof e.width>"u"?this.parent.worldWidth:e.width,s=typeof e.height>"u"?this.parent.worldHeight:e.height;return{left:this.parent.left<t,right:this.parent.right>n,top:this.parent.top<i,bottom:this.parent.bottom>s,topLeft:new j(t*this.parent.scale.x,i*this.parent.scale.y),bottomRight:new j(n*this.parent.scale.x-this.parent.screenWidth,s*this.parent.scale.y-this.parent.screenHeight)}}return{left:this.parent.left<0,right:this.parent.right>this.parent.worldWidth,top:this.parent.top<0,bottom:this.parent.bottom>this.parent.worldHeight,topLeft:new j(0,0),bottomRight:new j(this.parent.worldWidth*this.parent.scale.x-this.parent.screenWidth,this.parent.worldHeight*this.parent.scale.y-this.parent.screenHeight)}}bounce(){if(this.paused)return;let e,t=this.parent.plugins.get("decelerate",!0);t&&(t.x||t.y)&&(t.x&&t.percentChangeX===os([t,"access",s=>s.options,"optionalAccess",s=>s.friction])||t.y&&t.percentChangeY===os([t,"access",s=>s.options,"optionalAccess",s=>s.friction]))&&(e=this.oob(),(e.left&&this.left||e.right&&this.right)&&(t.percentChangeX=this.options.friction),(e.top&&this.top||e.bottom&&this.bottom)&&(t.percentChangeY=this.options.friction));const i=this.parent.plugins.get("drag",!0)||{},n=this.parent.plugins.get("pinch",!0)||{};if(t=t||{},!os([i,"optionalAccess",s=>s.active])&&!os([n,"optionalAccess",s=>s.active])&&(!this.toX||!this.toY)&&(!t.x||!t.y)){e=e||this.oob();const s=e.topLeft,a=e.bottomRight;if(!this.toX&&!t.x){let o=null;e.left&&this.left?o=this.parent.screenWorldWidth<this.parent.screenWidth?this.calcUnderflowX():-s.x:e.right&&this.right&&(o=this.parent.screenWorldWidth<this.parent.screenWidth?this.calcUnderflowX():-a.x),o!==null&&this.parent.x!==o&&(this.toX={time:0,start:this.parent.x,delta:o-this.parent.x,end:o},this.parent.emit("bounce-x-start",this.parent))}if(!this.toY&&!t.y){let o=null;e.top&&this.top?o=this.parent.screenWorldHeight<this.parent.screenHeight?this.calcUnderflowY():-s.y:e.bottom&&this.bottom&&(o=this.parent.screenWorldHeight<this.parent.screenHeight?this.calcUnderflowY():-a.y),o!==null&&this.parent.y!==o&&(this.toY={time:0,start:this.parent.y,delta:o-this.parent.y,end:o},this.parent.emit("bounce-y-start",this.parent))}}}reset(){this.toX=this.toY=null,this.bounce()}}const Tx={left:!1,right:!1,top:!1,bottom:!1,direction:null,underflow:"center"};class uf extends ie{constructor(e,t={}){super(e),this.options=Object.assign({},Tx,t),this.options.direction&&(this.options.left=this.options.direction==="x"||this.options.direction==="all"?!0:null,this.options.right=this.options.direction==="x"||this.options.direction==="all"?!0:null,this.options.top=this.options.direction==="y"||this.options.direction==="all"?!0:null,this.options.bottom=this.options.direction==="y"||this.options.direction==="all"?!0:null),this.parseUnderflow(),this.last={x:null,y:null,scaleX:null,scaleY:null},this.update()}parseUnderflow(){const e=this.options.underflow.toLowerCase();e==="none"?this.noUnderflow=!0:e==="center"?(this.underflowX=this.underflowY=0,this.noUnderflow=!1):(this.underflowX=e.indexOf("left")!==-1?-1:e.indexOf("right")!==-1?1:0,this.underflowY=e.indexOf("top")!==-1?-1:e.indexOf("bottom")!==-1?1:0,this.noUnderflow=!1)}move(){return this.update(),!1}update(){if(this.paused||this.parent.x===this.last.x&&this.parent.y===this.last.y&&this.parent.scale.x===this.last.scaleX&&this.parent.scale.y===this.last.scaleY)return;const e={x:this.parent.x,y:this.parent.y},t=this.parent.plugins.decelerate||{};if(this.options.left!==null||this.options.right!==null){let i=!1;if(!this.noUnderflow&&this.parent.screenWorldWidth<this.parent.screenWidth)switch(this.underflowX){case-1:this.parent.x!==0&&(this.parent.x=0,i=!0);break;case 1:this.parent.x!==this.parent.screenWidth-this.parent.screenWorldWidth&&(this.parent.x=this.parent.screenWidth-this.parent.screenWorldWidth,i=!0);break;default:this.parent.x!==(this.parent.screenWidth-this.parent.screenWorldWidth)/2&&(this.parent.x=(this.parent.screenWidth-this.parent.screenWorldWidth)/2,i=!0)}else this.options.left!==null&&this.parent.left<(this.options.left===!0?0:this.options.left)&&(this.parent.x=-(this.options.left===!0?0:this.options.left)*this.parent.scale.x,t.x=0,i=!0),this.options.right!==null&&this.parent.right>(this.options.right===!0?this.parent.worldWidth:this.options.right)&&(this.parent.x=-(this.options.right===!0?this.parent.worldWidth:this.options.right)*this.parent.scale.x+this.parent.screenWidth,t.x=0,i=!0);i&&this.parent.emit("moved",{viewport:this.parent,original:e,type:"clamp-x"})}if(this.options.top!==null||this.options.bottom!==null){let i=!1;if(!this.noUnderflow&&this.parent.screenWorldHeight<this.parent.screenHeight)switch(this.underflowY){case-1:this.parent.y!==0&&(this.parent.y=0,i=!0);break;case 1:this.parent.y!==this.parent.screenHeight-this.parent.screenWorldHeight&&(this.parent.y=this.parent.screenHeight-this.parent.screenWorldHeight,i=!0);break;default:this.parent.y!==(this.parent.screenHeight-this.parent.screenWorldHeight)/2&&(this.parent.y=(this.parent.screenHeight-this.parent.screenWorldHeight)/2,i=!0)}else this.options.top!==null&&this.parent.top<(this.options.top===!0?0:this.options.top)&&(this.parent.y=-(this.options.top===!0?0:this.options.top)*this.parent.scale.y,t.y=0,i=!0),this.options.bottom!==null&&this.parent.bottom>(this.options.bottom===!0?this.parent.worldHeight:this.options.bottom)&&(this.parent.y=-(this.options.bottom===!0?this.parent.worldHeight:this.options.bottom)*this.parent.scale.y+this.parent.screenHeight,t.y=0,i=!0);i&&this.parent.emit("moved",{viewport:this.parent,original:e,type:"clamp-y"})}this.last.x=this.parent.x,this.last.y=this.parent.y,this.last.scaleX=this.parent.scale.x,this.last.scaleY=this.parent.scale.y}reset(){this.update()}}const wx={minWidth:null,minHeight:null,maxWidth:null,maxHeight:null,minScale:null,maxScale:null};class lf extends ie{constructor(e,t={}){super(e),this.options=Object.assign({},wx,t),this.clamp()}resize(){this.clamp()}clamp(){if(!this.paused){if(this.options.minWidth||this.options.minHeight||this.options.maxWidth||this.options.maxHeight){let e=this.parent.worldScreenWidth,t=this.parent.worldScreenHeight;if(this.options.minWidth!==null&&e<this.options.minWidth){const i=this.parent.scale.x;this.parent.fitWidth(this.options.minWidth,!1,!1,!0),this.parent.scale.y*=this.parent.scale.x/i,e=this.parent.worldScreenWidth,t=this.parent.worldScreenHeight,this.parent.emit("zoomed",{viewport:this.parent,type:"clamp-zoom"})}if(this.options.maxWidth!==null&&e>this.options.maxWidth){const i=this.parent.scale.x;this.parent.fitWidth(this.options.maxWidth,!1,!1,!0),this.parent.scale.y*=this.parent.scale.x/i,e=this.parent.worldScreenWidth,t=this.parent.worldScreenHeight,this.parent.emit("zoomed",{viewport:this.parent,type:"clamp-zoom"})}if(this.options.minHeight!==null&&t<this.options.minHeight){const i=this.parent.scale.y;this.parent.fitHeight(this.options.minHeight,!1,!1,!0),this.parent.scale.x*=this.parent.scale.y/i,e=this.parent.worldScreenWidth,t=this.parent.worldScreenHeight,this.parent.emit("zoomed",{viewport:this.parent,type:"clamp-zoom"})}if(this.options.maxHeight!==null&&t>this.options.maxHeight){const i=this.parent.scale.y;this.parent.fitHeight(this.options.maxHeight,!1,!1,!0),this.parent.scale.x*=this.parent.scale.y/i,this.parent.emit("zoomed",{viewport:this.parent,type:"clamp-zoom"})}}else if(this.options.minScale||this.options.maxScale){const e={x:null,y:null},t={x:null,y:null};if(typeof this.options.minScale=="number")e.x=this.options.minScale,e.y=this.options.minScale;else if(this.options.minScale!==null){const s=this.options.minScale;e.x=typeof s.x>"u"?null:s.x,e.y=typeof s.y>"u"?null:s.y}if(typeof this.options.maxScale=="number")t.x=this.options.maxScale,t.y=this.options.maxScale;else if(this.options.maxScale!==null){const s=this.options.maxScale;t.x=typeof s.x>"u"?null:s.x,t.y=typeof s.y>"u"?null:s.y}let i=this.parent.scale.x,n=this.parent.scale.y;e.x!==null&&i<e.x&&(i=e.x),t.x!==null&&i>t.x&&(i=t.x),e.y!==null&&n<e.y&&(n=e.y),t.y!==null&&n>t.y&&(n=t.y),(i!==this.parent.scale.x||n!==this.parent.scale.y)&&(this.parent.scale.set(i,n),this.parent.emit("zoomed",{viewport:this.parent,type:"clamp-zoom"}))}}}reset(){this.clamp()}}const Ex={friction:.98,bounce:.8,minSpeed:.01},fi=16;class ff extends ie{constructor(e,t={}){super(e),this.options=Object.assign({},Ex,t),this.saved=[],this.timeSinceRelease=0,this.reset(),this.parent.on("moved",i=>this.moved(i))}down(){return this.saved=[],this.x=this.y=null,!1}isActive(){return!!(this.x||this.y)}move(){if(this.paused)return!1;const e=this.parent.input.count();return(e===1||e>1&&!this.parent.plugins.get("pinch",!0))&&(this.saved.push({x:this.parent.x,y:this.parent.y,time:performance.now()}),this.saved.length>60&&this.saved.splice(0,30)),!1}moved(e){if(this.saved.length){const t=this.saved[this.saved.length-1];e.type==="clamp-x"?t.x===e.original.x&&(t.x=this.parent.x):e.type==="clamp-y"&&t.y===e.original.y&&(t.y=this.parent.y)}}up(){if(this.parent.input.count()===0&&this.saved.length){const e=performance.now();for(const t of this.saved)if(t.time>=e-100){const i=e-t.time;this.x=(this.parent.x-t.x)/i,this.y=(this.parent.y-t.y)/i,this.percentChangeX=this.percentChangeY=this.options.friction,this.timeSinceRelease=0;break}}return!1}activate(e){e=e||{},typeof e.x<"u"&&(this.x=e.x,this.percentChangeX=this.options.friction),typeof e.y<"u"&&(this.y=e.y,this.percentChangeY=this.options.friction)}update(e){if(this.paused)return;const t=this.x||this.y,i=this.timeSinceRelease,n=this.timeSinceRelease+e;if(this.x){const s=this.percentChangeX,a=Math.log(s);this.parent.x+=this.x*fi/a*(Math.pow(s,n/fi)-Math.pow(s,i/fi)),this.x*=Math.pow(this.percentChangeX,e/fi)}if(this.y){const s=this.percentChangeY,a=Math.log(s);this.parent.y+=this.y*fi/a*(Math.pow(s,n/fi)-Math.pow(s,i/fi)),this.y*=Math.pow(this.percentChangeY,e/fi)}this.timeSinceRelease+=e,this.x&&this.y?Math.abs(this.x)<this.options.minSpeed&&Math.abs(this.y)<this.options.minSpeed&&(this.x=0,this.y=0):(Math.abs(this.x||0)<this.options.minSpeed&&(this.x=0),Math.abs(this.y||0)<this.options.minSpeed&&(this.y=0)),t&&this.parent.emit("moved",{viewport:this.parent,type:"decelerate"})}reset(){this.x=this.y=null}}const Sx={direction:"all",pressDrag:!0,wheel:!0,wheelScroll:1,reverse:!1,clampWheel:!1,underflow:"center",factor:1,mouseButtons:"all",keyToPress:null,ignoreKeyToPressOnTouch:!1,lineHeight:20,wheelSwapAxes:!1};class hs extends ie{__init(){this.windowEventHandlers=new Array}constructor(e,t={}){super(e),hs.prototype.__init.call(this),this.options=Object.assign({},Sx,t),this.moved=!1,this.reverse=this.options.reverse?1:-1,this.xDirection=!this.options.direction||this.options.direction==="all"||this.options.direction==="x",this.yDirection=!this.options.direction||this.options.direction==="all"||this.options.direction==="y",this.keyIsPressed=!1,this.parseUnderflow(),this.mouseButtons(this.options.mouseButtons),this.options.keyToPress&&this.handleKeyPresses(this.options.keyToPress)}handleKeyPresses(e){const t=n=>{e.includes(n.code)&&(this.keyIsPressed=!0)},i=n=>{e.includes(n.code)&&(this.keyIsPressed=!1)};this.addWindowEventHandler("keyup",i),this.addWindowEventHandler("keydown",t)}addWindowEventHandler(e,t){window.addEventListener(e,t),this.windowEventHandlers.push({event:e,handler:t})}destroy(){this.windowEventHandlers.forEach(({event:e,handler:t})=>{window.removeEventListener(e,t)})}mouseButtons(e){!e||e==="all"?this.mouse=[!0,!0,!0]:this.mouse=[e.indexOf("left")!==-1,e.indexOf("middle")!==-1,e.indexOf("right")!==-1]}parseUnderflow(){const e=this.options.underflow.toLowerCase();e==="center"?(this.underflowX=0,this.underflowY=0):(e.includes("left")?this.underflowX=-1:e.includes("right")?this.underflowX=1:this.underflowX=0,e.includes("top")?this.underflowY=-1:e.includes("bottom")?this.underflowY=1:this.underflowY=0)}checkButtons(e){const t=e.data.pointerType==="mouse",i=this.parent.input.count();return!!((i===1||i>1&&!this.parent.plugins.get("pinch",!0))&&(!t||this.mouse[e.data.button]))}checkKeyPress(e){return!this.options.keyToPress||this.keyIsPressed||this.options.ignoreKeyToPressOnTouch&&e.data.pointerType==="touch"}down(e){return this.paused||!this.options.pressDrag?!1:this.checkButtons(e)&&this.checkKeyPress(e)?(this.last={x:e.data.global.x,y:e.data.global.y},this.current=e.data.pointerId,!0):(this.last=null,!1)}get active(){return this.moved}move(e){if(this.paused||!this.options.pressDrag)return!1;if(this.last&&this.current===e.data.pointerId){const t=e.data.global.x,i=e.data.global.y,n=this.parent.input.count();if(n===1||n>1&&!this.parent.plugins.get("pinch",!0)){const s=t-this.last.x,a=i-this.last.y;if(this.moved||this.xDirection&&this.parent.input.checkThreshold(s)||this.yDirection&&this.parent.input.checkThreshold(a)){const o={x:t,y:i};return this.xDirection&&(this.parent.x+=(o.x-this.last.x)*this.options.factor),this.yDirection&&(this.parent.y+=(o.y-this.last.y)*this.options.factor),this.last=o,this.moved||this.parent.emit("drag-start",{event:e,screen:new j(this.last.x,this.last.y),world:this.parent.toWorld(new j(this.last.x,this.last.y)),viewport:this.parent}),this.moved=!0,this.parent.emit("moved",{viewport:this.parent,type:"drag"}),!0}}else this.moved=!1}return!1}up(e){if(this.paused)return!1;const t=this.parent.input.touches;if(t.length===1){const i=t[0];return i.last&&(this.last={x:i.last.x,y:i.last.y},this.current=i.id),this.moved=!1,!0}else if(this.last&&this.moved){const i=new j(this.last.x,this.last.y);return this.parent.emit("drag-end",{event:e,screen:i,world:this.parent.toWorld(i),viewport:this.parent}),this.last=null,this.moved=!1,!0}return!1}wheel(e){if(this.paused)return!1;if(this.options.wheel){const t=this.parent.plugins.get("wheel",!0);if(!t||!t.options.wheelZoom&&!e.ctrlKey){const i=e.deltaMode?this.options.lineHeight:1,n=[e.deltaX,e.deltaY],[s,a]=this.options.wheelSwapAxes?n.reverse():n;return this.xDirection&&(this.parent.x+=s*i*this.options.wheelScroll*this.reverse),this.yDirection&&(this.parent.y+=a*i*this.options.wheelScroll*this.reverse),this.options.clampWheel&&this.clamp(),this.parent.emit("wheel-scroll",this.parent),this.parent.emit("moved",{viewport:this.parent,type:"wheel"}),this.parent.options.passiveWheel||e.preventDefault(),this.parent.options.stopPropagation&&e.stopPropagation(),!0}}return!1}resume(){this.last=null,this.paused=!1}clamp(){const e=this.parent.plugins.get("decelerate",!0)||{};if(this.options.clampWheel!=="y")if(this.parent.screenWorldWidth<this.parent.screenWidth)switch(this.underflowX){case-1:this.parent.x=0;break;case 1:this.parent.x=this.parent.screenWidth-this.parent.screenWorldWidth;break;default:this.parent.x=(this.parent.screenWidth-this.parent.screenWorldWidth)/2}else this.parent.left<0?(this.parent.x=0,e.x=0):this.parent.right>this.parent.worldWidth&&(this.parent.x=-this.parent.worldWidth*this.parent.scale.x+this.parent.screenWidth,e.x=0);if(this.options.clampWheel!=="x")if(this.parent.screenWorldHeight<this.parent.screenHeight)switch(this.underflowY){case-1:this.parent.y=0;break;case 1:this.parent.y=this.parent.screenHeight-this.parent.screenWorldHeight;break;default:this.parent.y=(this.parent.screenHeight-this.parent.screenWorldHeight)/2}else this.parent.top<0&&(this.parent.y=0,e.y=0),this.parent.bottom>this.parent.worldHeight&&(this.parent.y=-this.parent.worldHeight*this.parent.scale.y+this.parent.screenHeight,e.y=0)}}const Px={speed:0,acceleration:null,radius:null};class cf extends ie{constructor(e,t,i={}){super(e),this.target=t,this.options=Object.assign({},Px,i),this.velocity={x:0,y:0}}update(e){if(this.paused)return;const t=this.parent.center;let i=this.target.x,n=this.target.y;if(this.options.radius)if(Math.sqrt(Math.pow(this.target.y-t.y,2)+Math.pow(this.target.x-t.x,2))>this.options.radius){const h=Math.atan2(this.target.y-t.y,this.target.x-t.x);i=this.target.x-Math.cos(h)*this.options.radius,n=this.target.y-Math.sin(h)*this.options.radius}else return;const s=i-t.x,a=n-t.y;if(s||a)if(this.options.speed)if(this.options.acceleration){const o=Math.atan2(n-t.y,i-t.x),h=Math.sqrt(Math.pow(s,2)+Math.pow(a,2));if(h){const u=(Math.pow(this.velocity.x,2)+Math.pow(this.velocity.y,2))/(2*this.options.acceleration);h>u?this.velocity={x:Math.min(this.velocity.x+(this.options.acceleration*e,this.options.speed)),y:Math.min(this.velocity.y+(this.options.acceleration*e,this.options.speed))}:this.velocity={x:Math.max(this.velocity.x-this.options.acceleration*this.options.speed,0),y:Math.max(this.velocity.y-this.options.acceleration*this.options.speed,0)};const l=Math.cos(o)*this.velocity.x,f=Math.sin(o)*this.velocity.y,c=Math.abs(l)>Math.abs(s)?i:t.x+l,d=Math.abs(f)>Math.abs(a)?n:t.y+f;this.parent.moveCenter(c,d),this.parent.emit("moved",{viewport:this.parent,type:"follow"})}}else{const o=Math.atan2(n-t.y,i-t.x),h=Math.cos(o)*this.options.speed,u=Math.sin(o)*this.options.speed,l=Math.abs(h)>Math.abs(s)?i:t.x+h,f=Math.abs(u)>Math.abs(a)?n:t.y+u;this.parent.moveCenter(l,f),this.parent.emit("moved",{viewport:this.parent,type:"follow"})}else this.parent.moveCenter(i,n),this.parent.emit("moved",{viewport:this.parent,type:"follow"})}}const Rx={radius:null,distance:null,top:null,bottom:null,left:null,right:null,speed:8,reverse:!1,noDecelerate:!1,linear:!1,allowButtons:!1};class df extends ie{constructor(e,t={}){super(e),this.options=Object.assign({},Rx,t),this.reverse=this.options.reverse?1:-1,this.radiusSquared=typeof this.options.radius=="number"?Math.pow(this.options.radius,2):null,this.resize()}resize(){const e=this.options.distance;e!==null?(this.left=e,this.top=e,this.right=this.parent.screenWidth-e,this.bottom=this.parent.screenHeight-e):this.options.radius||(this.left=this.options.left,this.top=this.options.top,this.right=this.options.right===null?null:this.parent.screenWidth-this.options.right,this.bottom=this.options.bottom===null?null:this.parent.screenHeight-this.options.bottom)}down(){return this.paused||this.options.allowButtons||(this.horizontal=this.vertical=null),!1}move(e){if(this.paused||e.data.pointerType!=="mouse"&&e.data.identifier!==1||!this.options.allowButtons&&e.data.buttons!==0)return!1;const t=e.data.global.x,i=e.data.global.y;if(this.radiusSquared){const n=this.parent.toScreen(this.parent.center);if(Math.pow(n.x-t,2)+Math.pow(n.y-i,2)>=this.radiusSquared){const a=Math.atan2(n.y-i,n.x-t);this.options.linear?(this.horizontal=Math.round(Math.cos(a))*this.options.speed*this.reverse*(60/1e3),this.vertical=Math.round(Math.sin(a))*this.options.speed*this.reverse*(60/1e3)):(this.horizontal=Math.cos(a)*this.options.speed*this.reverse*(60/1e3),this.vertical=Math.sin(a)*this.options.speed*this.reverse*(60/1e3))}else this.horizontal&&this.decelerateHorizontal(),this.vertical&&this.decelerateVertical(),this.horizontal=this.vertical=0}else this.left!==null&&t<this.left?this.horizontal=Number(this.reverse)*this.options.speed*(60/1e3):this.right!==null&&t>this.right?this.horizontal=-1*this.reverse*this.options.speed*(60/1e3):(this.decelerateHorizontal(),this.horizontal=0),this.top!==null&&i<this.top?this.vertical=Number(this.reverse)*this.options.speed*(60/1e3):this.bottom!==null&&i>this.bottom?this.vertical=-1*this.reverse*this.options.speed*(60/1e3):(this.decelerateVertical(),this.vertical=0);return!1}decelerateHorizontal(){const e=this.parent.plugins.get("decelerate",!0);this.horizontal&&e&&!this.options.noDecelerate&&e.activate({x:this.horizontal*this.options.speed*this.reverse/(1e3/60)})}decelerateVertical(){const e=this.parent.plugins.get("decelerate",!0);this.vertical&&e&&!this.options.noDecelerate&&e.activate({y:this.vertical*this.options.speed*this.reverse/(1e3/60)})}up(){return this.paused||(this.horizontal&&this.decelerateHorizontal(),this.vertical&&this.decelerateVertical(),this.horizontal=this.vertical=null),!1}update(){if(!this.paused&&(this.horizontal||this.vertical)){const e=this.parent.center;this.horizontal&&(e.x+=this.horizontal*this.options.speed),this.vertical&&(e.y+=this.vertical*this.options.speed),this.parent.moveCenter(e),this.parent.emit("moved",{viewport:this.parent,type:"mouse-edges"})}}}const Cx={noDrag:!1,percent:1,center:null,factor:1,axis:"all"};class lr extends ie{__init(){this.active=!1}__init2(){this.pinching=!1}__init3(){this.moved=!1}constructor(e,t={}){super(e),lr.prototype.__init.call(this),lr.prototype.__init2.call(this),lr.prototype.__init3.call(this),this.options=Object.assign({},Cx,t)}down(){return this.parent.input.count()>=2?(this.active=!0,!0):!1}isAxisX(){return["all","x"].includes(this.options.axis)}isAxisY(){return["all","y"].includes(this.options.axis)}move(e){if(this.paused||!this.active)return!1;const t=e.data.global.x,i=e.data.global.y,n=this.parent.input.touches;if(n.length>=2){const s=n[0],a=n[1],o=s.last&&a.last?Math.sqrt(Math.pow(a.last.x-s.last.x,2)+Math.pow(a.last.y-s.last.y,2)):null;if(s.id===e.data.pointerId?s.last={x:t,y:i,data:e.data}:a.id===e.data.pointerId&&(a.last={x:t,y:i,data:e.data}),o){let h;const u={x:s.last.x+(a.last.x-s.last.x)/2,y:s.last.y+(a.last.y-s.last.y)/2};this.options.center||(h=this.parent.toLocal(u));let l=Math.sqrt(Math.pow(a.last.x-s.last.x,2)+Math.pow(a.last.y-s.last.y,2));l=l===0?l=1e-10:l;const f=(1-o/l)*this.options.percent*(this.isAxisX()?this.parent.scale.x:this.parent.scale.y);this.isAxisX()&&(this.parent.scale.x+=f),this.isAxisY()&&(this.parent.scale.y+=f),this.parent.emit("zoomed",{viewport:this.parent,type:"pinch",center:u});const c=this.parent.plugins.get("clamp-zoom",!0);if(c&&c.clamp(),this.options.center)this.parent.moveCenter(this.options.center);else{const d=this.parent.toGlobal(h);this.parent.x+=(u.x-d.x)*this.options.factor,this.parent.y+=(u.y-d.y)*this.options.factor,this.parent.emit("moved",{viewport:this.parent,type:"pinch"})}!this.options.noDrag&&this.lastCenter&&(this.parent.x+=(u.x-this.lastCenter.x)*this.options.factor,this.parent.y+=(u.y-this.lastCenter.y)*this.options.factor,this.parent.emit("moved",{viewport:this.parent,type:"pinch"})),this.lastCenter=u,this.moved=!0}else this.pinching||(this.parent.emit("pinch-start",this.parent),this.pinching=!0);return!0}return!1}up(){return this.pinching&&this.parent.input.touches.length<=1?(this.active=!1,this.lastCenter=null,this.pinching=!1,this.moved=!1,this.parent.emit("pinch-end",this.parent),!0):!1}}const Ox={topLeft:!1,friction:.8,time:1e3,ease:"easeInOutSine",interrupt:!0,removeOnComplete:!1,removeOnInterrupt:!1,forceStart:!1};class pf extends ie{constructor(e,t,i,n={}){super(e),this.options=Object.assign({},Ox,n),this.ease=as(n.ease,"easeInOutSine"),this.x=t,this.y=i,this.options.forceStart&&this.snapStart()}snapStart(){this.percent=0,this.snapping={time:0};const e=this.options.topLeft?this.parent.corner:this.parent.center;this.deltaX=this.x-e.x,this.deltaY=this.y-e.y,this.startX=e.x,this.startY=e.y,this.parent.emit("snap-start",this.parent)}wheel(){return this.options.removeOnInterrupt&&this.parent.plugins.remove("snap"),!1}down(){return this.options.removeOnInterrupt?this.parent.plugins.remove("snap"):this.options.interrupt&&(this.snapping=null),!1}up(){if(this.parent.input.count()===0){const e=this.parent.plugins.get("decelerate",!0);e&&(e.x||e.y)&&(e.percentChangeX=e.percentChangeY=this.options.friction)}return!1}update(e){if(!this.paused&&!(this.options.interrupt&&this.parent.input.count()!==0))if(this.snapping){const t=this.snapping;t.time+=e;let i,n,s;const a=this.startX,o=this.startY,h=this.deltaX,u=this.deltaY;if(t.time>this.options.time)i=!0,n=a+h,s=o+u;else{const l=this.ease(t.time,0,1,this.options.time);n=a+h*l,s=o+u*l}this.options.topLeft?this.parent.moveCorner(n,s):this.parent.moveCenter(n,s),this.parent.emit("moved",{viewport:this.parent,type:"snap"}),i&&(this.options.removeOnComplete&&this.parent.plugins.remove("snap"),this.parent.emit("snap-end",this.parent),this.snapping=null)}else{const t=this.options.topLeft?this.parent.corner:this.parent.center;(t.x!==this.x||t.y!==this.y)&&this.snapStart()}}}const Ax={width:0,height:0,time:1e3,ease:"easeInOutSine",center:null,interrupt:!0,removeOnComplete:!1,removeOnInterrupt:!1,forceStart:!1,noMove:!1};class vf extends ie{constructor(e,t={}){super(e),this.options=Object.assign({},Ax,t),this.ease=as(this.options.ease),this.xIndependent=!1,this.yIndependent=!1,this.xScale=0,this.yScale=0,this.options.width>0&&(this.xScale=e.screenWidth/this.options.width,this.xIndependent=!0),this.options.height>0&&(this.yScale=e.screenHeight/this.options.height,this.yIndependent=!0),this.xScale=this.xIndependent?this.xScale:this.yScale,this.yScale=this.yIndependent?this.yScale:this.xScale,this.options.time===0?(e.container.scale.x=this.xScale,e.container.scale.y=this.yScale,this.options.removeOnComplete&&this.parent.plugins.remove("snap-zoom")):t.forceStart&&this.createSnapping()}createSnapping(){const e=this.parent.worldScreenWidth,t=this.parent.worldScreenHeight,i=this.parent.screenWidth/this.xScale,n=this.parent.screenHeight/this.yScale;this.snapping={time:0,startX:e,startY:t,deltaX:i-e,deltaY:n-t},this.parent.emit("snap-zoom-start",this.parent)}resize(){this.snapping=null,this.options.width>0&&(this.xScale=this.parent.screenWidth/this.options.width),this.options.height>0&&(this.yScale=this.parent.screenHeight/this.options.height),this.xScale=this.xIndependent?this.xScale:this.yScale,this.yScale=this.yIndependent?this.yScale:this.xScale}wheel(){return this.options.removeOnInterrupt&&this.parent.plugins.remove("snap-zoom"),!1}down(){return this.options.removeOnInterrupt?this.parent.plugins.remove("snap-zoom"):this.options.interrupt&&(this.snapping=null),!1}update(e){if(this.paused||this.options.interrupt&&this.parent.input.count()!==0)return;let t;if(!this.options.center&&!this.options.noMove&&(t=this.parent.center),!this.snapping)(this.parent.scale.x!==this.xScale||this.parent.scale.y!==this.yScale)&&this.createSnapping();else if(this.snapping){const i=this.snapping;if(i.time+=e,i.time>=this.options.time)this.parent.scale.set(this.xScale,this.yScale),this.options.removeOnComplete&&this.parent.plugins.remove("snap-zoom"),this.parent.emit("snap-zoom-end",this.parent),this.snapping=null;else{const s=this.snapping,a=this.ease(s.time,s.startX,s.deltaX,this.options.time),o=this.ease(s.time,s.startY,s.deltaY,this.options.time);this.parent.scale.x=this.parent.screenWidth/a,this.parent.scale.y=this.parent.screenHeight/o}const n=this.parent.plugins.get("clamp-zoom",!0);n&&n.clamp(),this.options.noMove||(this.options.center?this.parent.moveCenter(this.options.center):this.parent.moveCenter(t))}}resume(){this.snapping=null,super.resume()}}const Ix={percent:.1,smooth:!1,interrupt:!0,reverse:!1,center:null,lineHeight:20,axis:"all",keyToPress:null,trackpadPinch:!1,wheelZoom:!0};class _f extends ie{constructor(e,t={}){super(e),this.options=Object.assign({},Ix,t),this.keyIsPressed=!1,this.options.keyToPress&&this.handleKeyPresses(this.options.keyToPress)}handleKeyPresses(e){window.addEventListener("keydown",t=>{e.includes(t.code)&&(this.keyIsPressed=!0)}),window.addEventListener("keyup",t=>{e.includes(t.code)&&(this.keyIsPressed=!1)})}checkKeyPress(){return!this.options.keyToPress||this.keyIsPressed}down(){return this.options.interrupt&&(this.smoothing=null),!1}isAxisX(){return["all","x"].includes(this.options.axis)}isAxisY(){return["all","y"].includes(this.options.axis)}update(){if(this.smoothing){const e=this.smoothingCenter,t=this.smoothing;let i;this.options.center||(i=this.parent.toLocal(e)),this.isAxisX()&&(this.parent.scale.x+=t.x),this.isAxisY()&&(this.parent.scale.y+=t.y),this.parent.emit("zoomed",{viewport:this.parent,type:"wheel"});const n=this.parent.plugins.get("clamp-zoom",!0);if(n&&n.clamp(),this.options.center)this.parent.moveCenter(this.options.center);else{const s=this.parent.toGlobal(i);this.parent.x+=e.x-s.x,this.parent.y+=e.y-s.y}this.parent.emit("moved",{viewport:this.parent,type:"wheel"}),this.smoothingCount++,this.smoothingCount>=this.options.smooth&&(this.smoothing=null)}}pinch(e){if(this.paused)return;const t=this.parent.input.getPointerPosition(e),i=-e.deltaY*(e.deltaMode?this.options.lineHeight:1)/200,n=Math.pow(2,(1+this.options.percent)*i);let s;this.options.center||(s=this.parent.toLocal(t)),this.isAxisX()&&(this.parent.scale.x*=n),this.isAxisY()&&(this.parent.scale.y*=n),this.parent.emit("zoomed",{viewport:this.parent,type:"wheel"});const a=this.parent.plugins.get("clamp-zoom",!0);if(a&&a.clamp(),this.options.center)this.parent.moveCenter(this.options.center);else{const o=this.parent.toGlobal(s);this.parent.x+=t.x-o.x,this.parent.y+=t.y-o.y}this.parent.emit("moved",{viewport:this.parent,type:"wheel"}),this.parent.emit("wheel",{wheel:{dx:e.deltaX,dy:e.deltaY,dz:e.deltaZ},event:e,viewport:this.parent})}wheel(e){if(this.paused||!this.checkKeyPress())return!1;if(e.ctrlKey&&this.options.trackpadPinch)this.pinch(e);else if(this.options.wheelZoom){const t=this.parent.input.getPointerPosition(e),n=(this.options.reverse?-1:1)*-e.deltaY*(e.deltaMode?this.options.lineHeight:1)/500,s=Math.pow(2,(1+this.options.percent)*n);if(this.options.smooth){const a={x:this.smoothing?this.smoothing.x*(this.options.smooth-this.smoothingCount):0,y:this.smoothing?this.smoothing.y*(this.options.smooth-this.smoothingCount):0};this.smoothing={x:((this.parent.scale.x+a.x)*s-this.parent.scale.x)/this.options.smooth,y:((this.parent.scale.y+a.y)*s-this.parent.scale.y)/this.options.smooth},this.smoothingCount=0,this.smoothingCenter=t}else{let a;this.options.center||(a=this.parent.toLocal(t)),this.isAxisX()&&(this.parent.scale.x*=s),this.isAxisY()&&(this.parent.scale.y*=s),this.parent.emit("zoomed",{viewport:this.parent,type:"wheel"});const o=this.parent.plugins.get("clamp-zoom",!0);if(o&&o.clamp(),this.options.center)this.parent.moveCenter(this.options.center);else{const h=this.parent.toGlobal(a);this.parent.x+=t.x-h.x,this.parent.y+=t.y-h.y}}this.parent.emit("moved",{viewport:this.parent,type:"wheel"}),this.parent.emit("wheel",{wheel:{dx:e.deltaX,dy:e.deltaY,dz:e.deltaZ},event:e,viewport:this.parent})}return!this.parent.options.passiveWheel}}class mf{constructor(e){this.viewport=e,this.touches=[],this.addListeners()}addListeners(){this.viewport.interactive=!0,this.viewport.forceHitArea||(this.viewport.hitArea=new q(0,0,this.viewport.worldWidth,this.viewport.worldHeight)),this.viewport.on("pointerdown",this.down,this),this.viewport.on("pointermove",this.move,this),this.viewport.on("pointerup",this.up,this),this.viewport.on("pointerupoutside",this.up,this),this.viewport.on("pointercancel",this.up,this),this.viewport.on("pointerout",this.up,this),this.wheelFunction=e=>this.handleWheel(e),this.viewport.options.divWheel.addEventListener("wheel",this.wheelFunction,{passive:this.viewport.options.passiveWheel}),this.isMouseDown=!1}destroy(){this.viewport.options.divWheel.removeEventListener("wheel",this.wheelFunction)}down(e){if(this.viewport.pause||!this.viewport.worldVisible)return;if(e.data.pointerType==="mouse"?this.isMouseDown=!0:this.get(e.data.pointerId)||this.touches.push({id:e.data.pointerId,last:null}),this.count()===1){this.last=e.data.global.clone();const i=this.viewport.plugins.get("decelerate",!0),n=this.viewport.plugins.get("bounce",!0);(!i||!i.isActive())&&(!n||!n.isActive())?this.clickedAvailable=!0:this.clickedAvailable=!1}else this.clickedAvailable=!1;this.viewport.plugins.down(e)&&this.viewport.options.stopPropagation&&e.stopPropagation()}clear(){this.isMouseDown=!1,this.touches=[],this.last=null}checkThreshold(e){return Math.abs(e)>=this.viewport.threshold}move(e){if(this.viewport.pause||!this.viewport.worldVisible)return;const t=this.viewport.plugins.move(e);if(this.clickedAvailable&&this.last){const i=e.data.global.x-this.last.x,n=e.data.global.y-this.last.y;(this.checkThreshold(i)||this.checkThreshold(n))&&(this.clickedAvailable=!1)}t&&this.viewport.options.stopPropagation&&e.stopPropagation()}up(e){if(this.viewport.pause||!this.viewport.worldVisible)return;e.data.pointerType==="mouse"&&(this.isMouseDown=!1),e.data.pointerType!=="mouse"&&this.remove(e.data.pointerId);const t=this.viewport.plugins.up(e);this.clickedAvailable&&this.count()===0&&this.last&&(this.viewport.emit("clicked",{event:e,screen:this.last,world:this.viewport.toWorld(this.last),viewport:this}),this.clickedAvailable=!1),t&&this.viewport.options.stopPropagation&&e.stopPropagation()}getPointerPosition(e){const t=new j;if(this.viewport.options.interaction)this.viewport.options.interaction.mapPositionToPoint(t,e.clientX,e.clientY);else if(this.viewport.options.useDivWheelForInputManager&&this.viewport.options.divWheel){const i=this.viewport.options.divWheel.getBoundingClientRect();t.x=e.clientX-i.left,t.y=e.clientY-i.top}else t.x=e.clientX,t.y=e.clientY;return t}handleWheel(e){if(this.viewport.pause||!this.viewport.worldVisible||this.viewport.options.interaction&&this.viewport.options.interaction.interactionDOMElement!==e.target)return;const t=this.viewport.toLocal(this.getPointerPosition(e));this.viewport.left<=t.x&&t.x<=this.viewport.right&&this.viewport.top<=t.y&&t.y<=this.viewport.bottom&&this.viewport.plugins.wheel(e)&&!this.viewport.options.passiveWheel&&e.preventDefault()}pause(){this.touches=[],this.isMouseDown=!1}get(e){for(const t of this.touches)if(t.id===e)return t;return null}remove(e){for(let t=0;t<this.touches.length;t++)if(this.touches[t].id===e){this.touches.splice(t,1);return}}count(){return(this.isMouseDown?1:0)+this.touches.length}}function us(r){let e,t=r[0],i=1;for(;i<r.length;){const n=r[i],s=r[i+1];if(i+=2,(n==="optionalAccess"||n==="optionalCall")&&t==null)return;n==="access"||n==="optionalAccess"?(e=t,t=s(t)):(n==="call"||n==="optionalCall")&&(t=s((...a)=>t.call(e,...a)),e=void 0)}return t}const Kr=["drag","pinch","wheel","follow","mouse-edges","decelerate","animate","bounce","snap-zoom","clamp-zoom","snap","clamp"];class gf{constructor(e){this.viewport=e,this.list=[],this.plugins={}}add(e,t,i=Kr.length){const n=this.plugins[e];n&&n.destroy(),this.plugins[e]=t;const s=Kr.indexOf(e);s!==-1&&Kr.splice(s,1),Kr.splice(i,0,e),this.sort()}get(e,t){return t&&us([this,"access",i=>i.plugins,"access",i=>i[e],"optionalAccess",i=>i.paused])?null:this.plugins[e]}update(e){for(const t of this.list)t.update(e)}resize(){for(const e of this.list)e.resize()}reset(){for(const e of this.list)e.reset()}removeAll(){this.list.forEach(e=>{e.destroy()}),this.plugins={},this.sort()}remove(e){this.plugins[e]&&(us([this,"access",t=>t.plugins,"access",t=>t[e],"optionalAccess",t=>t.destroy,"call",t=>t()]),delete this.plugins[e],this.viewport.emit(`${e}-remove`),this.sort())}pause(e){us([this,"access",t=>t.plugins,"access",t=>t[e],"optionalAccess",t=>t.pause,"call",t=>t()])}resume(e){us([this,"access",t=>t.plugins,"access",t=>t[e],"optionalAccess",t=>t.resume,"call",t=>t()])}sort(){this.list=[];for(const e of Kr)this.plugins[e]&&this.list.push(this.plugins[e])}down(e){let t=!1;for(const i of this.list)i.down(e)&&(t=!0);return t}move(e){let t=!1;for(const i of this.viewport.plugins.list)i.move(e)&&(t=!0);return t}up(e){let t=!1;for(const i of this.list)i.up(e)&&(t=!0);return t}wheel(e){let t=!1;for(const i of this.list)i.wheel(e)&&(t=!0);return t}}const Mx={screenWidth:window.innerWidth,screenHeight:window.innerHeight,worldWidth:null,worldHeight:null,threshold:5,passiveWheel:!0,stopPropagation:!1,forceHitArea:null,noTicker:!1,interaction:null,disableOnContextMenu:!1,ticker:Ft.shared};class So extends yt{__init(){this._disableOnContextMenu=e=>e.preventDefault()}constructor(e={}){super(),So.prototype.__init.call(this),this.options=Object.assign({},{divWheel:document.body},Mx,e),this.screenWidth=this.options.screenWidth,this.screenHeight=this.options.screenHeight,this._worldWidth=this.options.worldWidth,this._worldHeight=this.options.worldHeight,this.forceHitArea=this.options.forceHitArea,this.threshold=this.options.threshold,this.options.divWheel=this.options.divWheel||document.body,this.options.disableOnContextMenu&&this.options.divWheel.addEventListener("contextmenu",this._disableOnContextMenu),this.options.noTicker||(this.tickerFunction=()=>this.update(this.options.ticker.elapsedMS),this.options.ticker.add(this.tickerFunction)),this.input=new mf(this),this.plugins=new gf(this)}destroy(e){!this.options.noTicker&&this.tickerFunction&&this.options.ticker.remove(this.tickerFunction),this.options.disableOnContextMenu&&this.options.divWheel.removeEventListener("contextmenu",this._disableOnContextMenu),this.input.destroy(),super.destroy(e)}update(e){this.pause||(this.plugins.update(e),this.lastViewport&&(this.lastViewport.x!==this.x||this.lastViewport.y!==this.y?this.moving=!0:this.moving&&(this.emit("moved-end",this),this.moving=!1),this.lastViewport.scaleX!==this.scale.x||this.lastViewport.scaleY!==this.scale.y?this.zooming=!0:this.zooming&&(this.emit("zoomed-end",this),this.zooming=!1)),this.forceHitArea||(this._hitAreaDefault=new q(this.left,this.top,this.worldScreenWidth,this.worldScreenHeight),this.hitArea=this._hitAreaDefault),this._dirty=this._dirty||!this.lastViewport||this.lastViewport.x!==this.x||this.lastViewport.y!==this.y||this.lastViewport.scaleX!==this.scale.x||this.lastViewport.scaleY!==this.scale.y,this.lastViewport={x:this.x,y:this.y,scaleX:this.scale.x,scaleY:this.scale.y},this.emit("frame-end",this))}resize(e=window.innerWidth,t=window.innerHeight,i,n){this.screenWidth=e,this.screenHeight=t,typeof i<"u"&&(this._worldWidth=i),typeof n<"u"&&(this._worldHeight=n),this.plugins.resize(),this.dirty=!0}get worldWidth(){return this._worldWidth?this._worldWidth:this.width/this.scale.x}set worldWidth(e){this._worldWidth=e,this.plugins.resize()}get worldHeight(){return this._worldHeight?this._worldHeight:this.height/this.scale.y}set worldHeight(e){this._worldHeight=e,this.plugins.resize()}getVisibleBounds(){return new q(this.left,this.top,this.worldScreenWidth,this.worldScreenHeight)}toWorld(e,t){return arguments.length===2?this.toLocal(new j(e,t)):this.toLocal(e)}toScreen(e,t){return arguments.length===2?this.toGlobal(new j(e,t)):this.toGlobal(e)}get worldScreenWidth(){return this.screenWidth/this.scale.x}get worldScreenHeight(){return this.screenHeight/this.scale.y}get screenWorldWidth(){return this.worldWidth*this.scale.x}get screenWorldHeight(){return this.worldHeight*this.scale.y}get center(){return new j(this.worldScreenWidth/2-this.x/this.scale.x,this.worldScreenHeight/2-this.y/this.scale.y)}set center(e){this.moveCenter(e)}moveCenter(...e){let t,i;typeof e[0]=="number"?(t=e[0],i=e[1]):(t=e[0].x,i=e[0].y);const n=(this.worldScreenWidth/2-t)*this.scale.x,s=(this.worldScreenHeight/2-i)*this.scale.y;return(this.x!==n||this.y!==s)&&(this.position.set(n,s),this.plugins.reset(),this.dirty=!0),this}get corner(){return new j(-this.x/this.scale.x,-this.y/this.scale.y)}set corner(e){this.moveCorner(e)}moveCorner(...e){let t,i;return e.length===1?(t=-e[0].x*this.scale.x,i=-e[0].y*this.scale.y):(t=-e[0]*this.scale.x,i=-e[1]*this.scale.y),(t!==this.x||i!==this.y)&&(this.position.set(t,i),this.plugins.reset(),this.dirty=!0),this}get screenWidthInWorldPixels(){return this.screenWidth/this.scale.x}get screenHeightInWorldPixels(){return this.screenHeight/this.scale.y}findFitWidth(e){return this.screenWidth/e}findFitHeight(e){return this.screenHeight/e}findFit(e,t){const i=this.screenWidth/e,n=this.screenHeight/t;return Math.min(i,n)}findCover(e,t){const i=this.screenWidth/e,n=this.screenHeight/t;return Math.max(i,n)}fitWidth(e=this.worldWidth,t,i=!0,n){let s;t&&(s=this.center),this.scale.x=this.screenWidth/e,i&&(this.scale.y=this.scale.x);const a=this.plugins.get("clamp-zoom",!0);return!n&&a&&a.clamp(),t&&s&&this.moveCenter(s),this}fitHeight(e=this.worldHeight,t,i=!0,n){let s;t&&(s=this.center),this.scale.y=this.screenHeight/e,i&&(this.scale.x=this.scale.y);const a=this.plugins.get("clamp-zoom",!0);return!n&&a&&a.clamp(),t&&s&&this.moveCenter(s),this}fitWorld(e){let t;e&&(t=this.center),this.scale.x=this.screenWidth/this.worldWidth,this.scale.y=this.screenHeight/this.worldHeight,this.scale.x<this.scale.y?this.scale.y=this.scale.x:this.scale.x=this.scale.y;const i=this.plugins.get("clamp-zoom",!0);return i&&i.clamp(),e&&t&&this.moveCenter(t),this}fit(e,t=this.worldWidth,i=this.worldHeight){let n;e&&(n=this.center),this.scale.x=this.screenWidth/t,this.scale.y=this.screenHeight/i,this.scale.x<this.scale.y?this.scale.y=this.scale.x:this.scale.x=this.scale.y;const s=this.plugins.get("clamp-zoom",!0);return s&&s.clamp(),e&&n&&this.moveCenter(n),this}setZoom(e,t){let i;t&&(i=this.center),this.scale.set(e);const n=this.plugins.get("clamp-zoom",!0);return n&&n.clamp(),t&&i&&this.moveCenter(i),this}zoomPercent(e,t){return this.setZoom(this.scale.x+this.scale.x*e,t)}zoom(e,t){return this.fitWidth(e+this.worldScreenWidth,t),this}get scaled(){return this.scale.x}set scaled(e){this.setZoom(e,!0)}snapZoom(e){return this.plugins.add("snap-zoom",new vf(this,e)),this}OOB(){return{left:this.left<0,right:this.right>this.worldWidth,top:this.top<0,bottom:this.bottom>this.worldHeight,cornerPoint:new j(this.worldWidth*this.scale.x-this.screenWidth,this.worldHeight*this.scale.y-this.screenHeight)}}get right(){return-this.x/this.scale.x+this.worldScreenWidth}set right(e){this.x=-e*this.scale.x+this.screenWidth,this.plugins.reset()}get left(){return-this.x/this.scale.x}set left(e){this.x=-e*this.scale.x,this.plugins.reset()}get top(){return-this.y/this.scale.y}set top(e){this.y=-e*this.scale.y,this.plugins.reset()}get bottom(){return-this.y/this.scale.y+this.worldScreenHeight}set bottom(e){this.y=-e*this.scale.y+this.screenHeight,this.plugins.reset()}get dirty(){return!!this._dirty}set dirty(e){this._dirty=e}get forceHitArea(){return this._forceHitArea}set forceHitArea(e){e?(this._forceHitArea=e,this.hitArea=e):(this._forceHitArea=null,this.hitArea=new q(0,0,this.worldWidth,this.worldHeight))}drag(e){return this.plugins.add("drag",new hs(this,e)),this}clamp(e){return this.plugins.add("clamp",new uf(this,e)),this}decelerate(e){return this.plugins.add("decelerate",new ff(this,e)),this}bounce(e){return this.plugins.add("bounce",new hf(this,e)),this}pinch(e){return this.plugins.add("pinch",new lr(this,e)),this}snap(e,t,i){return this.plugins.add("snap",new pf(this,e,t,i)),this}follow(e,t){return this.plugins.add("follow",new cf(this,e,t)),this}wheel(e){return this.plugins.add("wheel",new _f(this,e)),this}animate(e){return this.plugins.add("animate",new Fe(this,e)),this}clampZoom(e){return this.plugins.add("clamp-zoom",new lf(this,e)),this}mouseEdges(e){return this.plugins.add("mouse-edges",new df(this,e)),this}get pause(){return!!this._pause}set pause(e){this._pause=e,this.lastViewport=null,this.moving=!1,this.zooming=!1,e&&this.input.pause()}ensureVisible(e,t,i,n,s){s&&(i>this.worldScreenWidth||n>this.worldScreenHeight)&&(this.fit(!0,i,n),this.emit("zoomed",{viewport:this,type:"ensureVisible"}));let a=!1;e<this.left?(this.left=e,a=!0):e+i>this.right&&(this.right=e+i,a=!0),t<this.top?(this.top=t,a=!0):t+n>this.bottom&&(this.bottom=t+n,a=!0),a&&this.emit("moved",{viewport:this,type:"ensureVisible"})}}const Dx=Object.freeze(Object.defineProperty({__proto__:null,Animate:Fe,Bounce:hf,Clamp:uf,ClampZoom:lf,Decelerate:ff,Drag:hs,Follow:cf,InputManager:mf,MouseEdges:df,Pinch:lr,Plugin:ie,PluginManager:gf,Snap:pf,SnapZoom:vf,Viewport:So,Wheel:_f},Symbol.toStringTag,{value:"Module"}));Wt.FlowRunTimeline=_x,Wt.formatDateFnsDefault=Mo,Wt.nodeThemeFnDefault=Do,Object.defineProperty(Wt,Symbol.toStringTag,{value:"Module"})});
1062
1062
  //# sourceMappingURL=graphs.umd.js.map