@prefecthq/graphs 1.0.0 → 1.0.1

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(jt,W){typeof exports=="object"&&typeof module<"u"?W(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],W):(jt=typeof globalThis<"u"?globalThis:jt||self,W(jt["prefect-graphs"]={},jt.Vue))})(this,function(jt,W){"use strict";var $x=Object.defineProperty;var Jx=(jt,W,Ie)=>W in jt?$x(jt,W,{enumerable:!0,configurable:!0,writable:!0,value:Ie}):jt[W]=Ie;var R=(jt,W,Ie)=>(Jx(jt,typeof W!="symbol"?W+"":W,Ie),Ie);var Ie=Math.PI*2,Bf=180/Math.PI,Lf=Math.PI/180,Gt;(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"})(Gt||(Gt={}));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}(),rn=[new j,new j,new j,new j],J=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=Gt.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,o=this.bottom>e.bottom?e.bottom:this.bottom;return o>s}var a=this.left,h=this.right,u=this.top,l=this.bottom;if(h<=a||l<=u)return!1;var f=rn[0].set(e.left,e.top),c=rn[1].set(e.left,e.bottom),d=rn[2].set(e.right,e.top),v=rn[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)<=a||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),g=p*(f.x-c.x),y=_*a+g*u,m=_*h+g*u,b=_*a+g*l,x=_*h+g*l;if(Math.max(y,m,b,x)<=_*f.x+g*f.y||Math.min(y,m,b,x)>=_*v.x+g*v.y)return!1;var T=p*(f.y-d.y),w=p*(d.x-f.x),S=T*a+w*u,E=T*h+w*u,P=T*a+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}(),Gf=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=Gt.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 J(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}(),Uf=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=Gt.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 J(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}(),nn=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=[],o=0,a=n.length;o<a;o++)s.push(n[o].x,n[o].y);n=s}this.points=n,this.type=Gt.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,o=n-1;s<n;o=s++){var a=this.points[s*2],h=this.points[s*2+1],u=this.points[o*2],l=this.points[o*2+1],f=h>t!=l>t&&e<(u-a)*((t-h)/(l-h))+a;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}(),kf=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=Gt.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),o=i*i;if(n*n+s*s<=o||(n=e-(this.x+this.width-i),n*n+s*s<=o)||(s=t-(this.y+this.height-i),n*n+s*s<=o)||(n=e-(this.x+i),n*n+s*s<=o))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}(),Wi=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}(),Dt=function(){function r(e,t,i,n,s,o){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),o===void 0&&(o=0),this.array=null,this.a=e,this.b=t,this.c=i,this.d=n,this.tx=s,this.ty=o}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,o){return this.a=e,this.b=t,this.c=i,this.d=n,this.tx=s,this.ty=o,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,o=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=o*t-this.ty*i,this.ty=o*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,o,a,h,u){return this.a=Math.cos(a+u)*s,this.b=Math.sin(a+u)*s,this.c=-Math.sin(a-h)*o,this.d=Math.cos(a-h)*o,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,o=e.pivot,a=-Math.atan2(-n,s),h=Math.atan2(i,t),u=Math.abs(a+h);return u<1e-5||Math.abs(Ie-u)<1e-5?(e.rotation=h,e.skew.x=e.skew.y=0):(e.rotation=0,e.skew.x=a,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+(o.x*t+o.y*n),e.position.y=this.ty+(o.x*i+o.y*s),e},r.prototype.invert=function(){var e=this.a,t=this.b,i=this.c,n=this.d,s=this.tx,o=e*n-t*i;return this.a=n/o,this.b=-t/o,this.c=-i/o,this.d=e/o,this.tx=(i*this.ty-n*s)/o,this.ty=-(e*this.ty-t*s)/o,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}(),gi=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],mi=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],yi=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],xi=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],_s=[],Ga=[],sn=Math.sign;function Xf(){for(var r=0;r<16;r++){var e=[];_s.push(e);for(var t=0;t<16;t++)for(var i=sn(gi[r]*gi[t]+yi[r]*mi[t]),n=sn(mi[r]*gi[t]+xi[r]*mi[t]),s=sn(gi[r]*yi[t]+yi[r]*xi[t]),o=sn(mi[r]*yi[t]+xi[r]*xi[t]),a=0;a<16;a++)if(gi[a]===i&&mi[a]===n&&yi[a]===s&&xi[a]===o){e.push(a);break}}for(var r=0;r<16;r++){var h=new Dt;h.set(gi[r],mi[r],yi[r],xi[r],0,0),Ga.push(h)}}Xf();var _t={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 gi[r]},uY:function(r){return mi[r]},vX:function(r){return yi[r]},vY:function(r){return xi[r]},inv:function(r){return r&8?r&15:-r&7},add:function(r,e){return _s[r][e]},sub:function(r,e){return _s[r][_t.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?_t.S:_t.N:Math.abs(e)*2<=Math.abs(r)?r>0?_t.E:_t.W:e>0?r>0?_t.SE:_t.SW:r>0?_t.NE:_t.NW},matrixAppendRotationInv:function(r,e,t,i){t===void 0&&(t=0),i===void 0&&(i=0);var n=Ga[_t.inv(e)];n.tx=t,n.ty=i,r.append(n)}},Ua=function(){function r(){this.worldTransform=new Dt,this.localTransform=new Dt,this.position=new Wi(this.onChange,this,0,0),this.scale=new Wi(this.onChange,this,1,1),this.pivot=new Wi(this.onChange,this,0,0),this.skew=new Wi(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 bi=new J;class Hf{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,bi),this._recursive?this.cullRecursive(e,i,t):(t&&i._bounds.getRectangle(e),i[this._toggle]=bi.right>e.left&&bi.left<e.right&&bi.bottom>e.top&&bi.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(bi):t.getBounds(!0,bi);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 o=t.children;for(let a=0,h=o.length;a<h;a++)this.cullRecursive(e,o[a])}}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:Qx,atan2:tb,cos:eb,max:Wf,min:ka,sin:ib,tan:rb,sqrt:nb,pow:sb,floor:ob,ceil:ab,random:hb,round:zf}=Math;function Yf(r){return r.toLocaleTimeString()}function Vf(r){const e=navigator.language;return new Intl.DateTimeFormat(e,{timeStyle:"short"}).format(r)}function jf(r){const e=navigator.language;return new Intl.DateTimeFormat(e,{dateStyle:"short"}).format(r)}function Zf(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 qf(r){return new Date(r.getFullYear(),r.getMonth(),r.getDate())}function Kf(r){return new Date(r.getFullYear(),r.getMonth(),r.getDate(),Math.floor(r.getHours()/2)*2)}const et={second:1e3,minute:1e3*60,hour:1e3*60*60,day:1e3*60*60*24,week:1e3*60*60*24*7},Nt={seconds:"seconds",minutes:"minutes",date:"date"},Xa=[{ceiling:et.second*4,span:et.second,labelFormat:Nt.seconds},{ceiling:et.second*8,span:et.second*5,labelFormat:Nt.seconds},{ceiling:et.second*13,span:et.second*10,labelFormat:Nt.seconds},{ceiling:et.second*20,span:et.second*15,labelFormat:Nt.seconds},{ceiling:et.second*45,span:et.second*30,labelFormat:Nt.seconds},{ceiling:et.minute*4,span:et.minute,labelFormat:Nt.minutes},{ceiling:et.minute*8,span:et.minute*5,labelFormat:Nt.minutes},{ceiling:et.minute*13,span:et.minute*10,labelFormat:Nt.minutes},{ceiling:et.minute*28,span:et.minute*15,labelFormat:Nt.minutes},{ceiling:et.hour*1.24,span:et.minute*30,labelFormat:Nt.minutes},{ceiling:et.hour*3,span:et.hour,labelFormat:Nt.minutes},{ceiling:et.hour*8,span:et.hour*2,labelFormat:Nt.minutes},{ceiling:et.hour*13,span:et.hour*6,labelFormat:Nt.minutes},{ceiling:et.hour*22,span:et.hour*12,labelFormat:Nt.minutes},{ceiling:et.day*4,span:et.day,labelFormat:Nt.date},{ceiling:et.week*2,span:et.week,labelFormat:Nt.date},{ceiling:1/0,span:et.week*4,labelFormat:Nt.date}];function $f(r){return{colorTextDefault:Qt((r==null?void 0:r.colorTextDefault)??"#374151"),colorTextInverse:Qt((r==null?void 0:r.colorTextInverse)??"#f8fafc"),colorTextSubdued:Qt((r==null?void 0:r.colorTextSubdued)??"#6b7280"),colorEdge:Qt((r==null?void 0:r.colorEdge)??"#374151"),colorNodeSelection:Qt((r==null?void 0:r.colorNodeSelection)??"#024DFD"),colorButtonBg:Qt((r==null?void 0:r.colorButtonBg)??"#ffffff"),colorButtonBgHover:Qt((r==null?void 0:r.colorButtonBgHover)??"#cbd5e1"),colorButtonBorder:r!=null&&r.colorButtonBorder?Qt(r.colorButtonBorder):null,colorGuideLine:Qt((r==null?void 0:r.colorGuideLine)??"#cbd5e1"),colorPlayheadBg:Qt((r==null?void 0:r.colorPlayheadBg)??"#4e82fe"),textFontFamilyDefault:(r==null?void 0:r.textFontFamilyDefault)??"InterVariable",textSizeDefault:bt((r==null?void 0:r.textSizeDefault)??"14px"),textSizeSmall:bt((r==null?void 0:r.textSizeSmall)??"12px"),textLineHeightDefault:bt((r==null?void 0:r.textLineHeightDefault)??"20px"),textLineHeightSmall:bt((r==null?void 0:r.textLineHeightSmall)??"16px"),spacingButtonBorderWidth:bt((r==null?void 0:r.spacingButtonBorderWidth)??"1px"),spacingViewportPaddingDefault:bt((r==null?void 0:r.spacingViewportPaddingDefault)??"40px"),spacingNodeXPadding:bt((r==null?void 0:r.spacingNodeXPadding)??"8px"),spacingNodeYPadding:bt((r==null?void 0:r.spacingNodeYPadding)??"8px"),spacingNodeMargin:bt((r==null?void 0:r.spacingNodeMargin)??"24px"),spacingNodeLabelMargin:bt((r==null?void 0:r.spacingNodeLabelMargin)??"20px"),spacingMinimumNodeEdgeGap:bt((r==null?void 0:r.spacingMinimumNodeEdgeGap)??"16px"),spacingNodeEdgeLength:bt((r==null?void 0:r.spacingNodeEdgeLength)??"8px"),spacingNodeSelectionMargin:bt((r==null?void 0:r.spacingNodeSelectionMargin)??"2px"),spacingNodeSelectionWidth:bt((r==null?void 0:r.spacingNodeSelectionWidth)??"4px"),spacingSubNodesOutlineBorderWidth:bt((r==null?void 0:r.spacingSubNodesOutlineBorderWidth)??"2px"),spacingSubNodesOutlineOffset:bt((r==null?void 0:r.spacingSubNodesOutlineOffset)??"5px"),spacingEdgeWidth:bt((r==null?void 0:r.spacingEdgeWidth)??"2px"),spacingGuideLabelPadding:bt((r==null?void 0:r.spacingGuideLabelPadding)??"4px"),spacingPlayheadGlowPadding:bt((r==null?void 0:r.spacingPlayheadGlowPadding)??"8px"),spacingPlayheadWidth:bt((r==null?void 0:r.spacingPlayheadWidth)??"2px"),borderRadiusNode:bt((r==null?void 0:r.borderRadiusNode)??"8px"),borderRadiusButton:bt((r==null?void 0:r.borderRadiusButton)??"8px"),alphaNodeDimmed:(r==null?void 0:r.alphaNodeDimmed)??.2,alphaSubNodesOutlineDimmed:(r==null?void 0:r.alphaSubNodesOutlineDimmed)??.7}}function Qt(r){const e=r.trim();if(e.startsWith("rgb")){const[t,i,n]=e.replace(/[^\d,]/g,"").split(",").map(s=>parseInt(s,10));return Jf([t,i,n])}if(e.startsWith("hsl")){const[t,i,n]=e.replace(/[^\d,.%]/g,"").split(",").map(o=>parseInt(o,10));return Ha(Qf(t,i,n))}return Ha(e)}function Jf(r){return parseInt((1<<24|r[0]<<16|r[1]<<8|r[2]).toString(16).slice(1),16)}function Qf(r,e,t){t/=100;const i=e*ka(t,1-t)/100,n=s=>{const o=(s+r/30)%12,a=t-i*Wf(ka(o-3,9-o,1),-1);return zf(255*a).toString(16).padStart(2,"0")};return`#${n(0)}${n(8)}${n(4)}`}function Ha(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 bt(r){return typeof r!="string"?(Wa(r),0):r.endsWith("em")||r.endsWith("rem")?tc(r):r.endsWith("px")?parseFloat(r):(Wa(r),0)}function Wa(r){console.error(`
1
+ (function(jt,W){typeof exports=="object"&&typeof module<"u"?W(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],W):(jt=typeof globalThis<"u"?globalThis:jt||self,W(jt["prefect-graphs"]={},jt.Vue))})(this,function(jt,W){"use strict";var $x=Object.defineProperty;var Jx=(jt,W,Ie)=>W in jt?$x(jt,W,{enumerable:!0,configurable:!0,writable:!0,value:Ie}):jt[W]=Ie;var R=(jt,W,Ie)=>(Jx(jt,typeof W!="symbol"?W+"":W,Ie),Ie);var Ie=Math.PI*2,Bf=180/Math.PI,Lf=Math.PI/180,Gt;(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"})(Gt||(Gt={}));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}(),rn=[new j,new j,new j,new j],J=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=Gt.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,o=this.bottom>e.bottom?e.bottom:this.bottom;return o>s}var a=this.left,h=this.right,u=this.top,l=this.bottom;if(h<=a||l<=u)return!1;var f=rn[0].set(e.left,e.top),c=rn[1].set(e.left,e.bottom),d=rn[2].set(e.right,e.top),v=rn[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)<=a||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),g=p*(f.x-c.x),y=_*a+g*u,m=_*h+g*u,b=_*a+g*l,x=_*h+g*l;if(Math.max(y,m,b,x)<=_*f.x+g*f.y||Math.min(y,m,b,x)>=_*v.x+g*v.y)return!1;var T=p*(f.y-d.y),w=p*(d.x-f.x),S=T*a+w*u,E=T*h+w*u,P=T*a+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}(),Gf=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=Gt.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 J(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}(),Uf=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=Gt.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 J(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}(),nn=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=[],o=0,a=n.length;o<a;o++)s.push(n[o].x,n[o].y);n=s}this.points=n,this.type=Gt.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,o=n-1;s<n;o=s++){var a=this.points[s*2],h=this.points[s*2+1],u=this.points[o*2],l=this.points[o*2+1],f=h>t!=l>t&&e<(u-a)*((t-h)/(l-h))+a;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}(),kf=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=Gt.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),o=i*i;if(n*n+s*s<=o||(n=e-(this.x+this.width-i),n*n+s*s<=o)||(s=t-(this.y+this.height-i),n*n+s*s<=o)||(n=e-(this.x+i),n*n+s*s<=o))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}(),Wi=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}(),Nt=function(){function r(e,t,i,n,s,o){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),o===void 0&&(o=0),this.array=null,this.a=e,this.b=t,this.c=i,this.d=n,this.tx=s,this.ty=o}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,o){return this.a=e,this.b=t,this.c=i,this.d=n,this.tx=s,this.ty=o,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,o=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=o*t-this.ty*i,this.ty=o*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,o,a,h,u){return this.a=Math.cos(a+u)*s,this.b=Math.sin(a+u)*s,this.c=-Math.sin(a-h)*o,this.d=Math.cos(a-h)*o,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,o=e.pivot,a=-Math.atan2(-n,s),h=Math.atan2(i,t),u=Math.abs(a+h);return u<1e-5||Math.abs(Ie-u)<1e-5?(e.rotation=h,e.skew.x=e.skew.y=0):(e.rotation=0,e.skew.x=a,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+(o.x*t+o.y*n),e.position.y=this.ty+(o.x*i+o.y*s),e},r.prototype.invert=function(){var e=this.a,t=this.b,i=this.c,n=this.d,s=this.tx,o=e*n-t*i;return this.a=n/o,this.b=-t/o,this.c=-i/o,this.d=e/o,this.tx=(i*this.ty-n*s)/o,this.ty=-(e*this.ty-t*s)/o,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}(),gi=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],mi=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],yi=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],xi=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],_s=[],Ga=[],sn=Math.sign;function Xf(){for(var r=0;r<16;r++){var e=[];_s.push(e);for(var t=0;t<16;t++)for(var i=sn(gi[r]*gi[t]+yi[r]*mi[t]),n=sn(mi[r]*gi[t]+xi[r]*mi[t]),s=sn(gi[r]*yi[t]+yi[r]*xi[t]),o=sn(mi[r]*yi[t]+xi[r]*xi[t]),a=0;a<16;a++)if(gi[a]===i&&mi[a]===n&&yi[a]===s&&xi[a]===o){e.push(a);break}}for(var r=0;r<16;r++){var h=new Nt;h.set(gi[r],mi[r],yi[r],xi[r],0,0),Ga.push(h)}}Xf();var _t={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 gi[r]},uY:function(r){return mi[r]},vX:function(r){return yi[r]},vY:function(r){return xi[r]},inv:function(r){return r&8?r&15:-r&7},add:function(r,e){return _s[r][e]},sub:function(r,e){return _s[r][_t.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?_t.S:_t.N:Math.abs(e)*2<=Math.abs(r)?r>0?_t.E:_t.W:e>0?r>0?_t.SE:_t.SW:r>0?_t.NE:_t.NW},matrixAppendRotationInv:function(r,e,t,i){t===void 0&&(t=0),i===void 0&&(i=0);var n=Ga[_t.inv(e)];n.tx=t,n.ty=i,r.append(n)}},Ua=function(){function r(){this.worldTransform=new Nt,this.localTransform=new Nt,this.position=new Wi(this.onChange,this,0,0),this.scale=new Wi(this.onChange,this,1,1),this.pivot=new Wi(this.onChange,this,0,0),this.skew=new Wi(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 bi=new J;class Hf{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,bi),this._recursive?this.cullRecursive(e,i,t):(t&&i._bounds.getRectangle(e),i[this._toggle]=bi.right>e.left&&bi.left<e.right&&bi.bottom>e.top&&bi.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(bi):t.getBounds(!0,bi);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 o=t.children;for(let a=0,h=o.length;a<h;a++)this.cullRecursive(e,o[a])}}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:Qx,atan2:tb,cos:eb,max:Wf,min:ka,sin:ib,tan:rb,sqrt:nb,pow:sb,floor:ob,ceil:ab,random:hb,round:zf}=Math;function Yf(r){return r.toLocaleTimeString()}function Vf(r){const e=navigator.language;return new Intl.DateTimeFormat(e,{timeStyle:"short"}).format(r)}function jf(r){const e=navigator.language;return new Intl.DateTimeFormat(e,{dateStyle:"short"}).format(r)}function Zf(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 qf(r){return new Date(r.getFullYear(),r.getMonth(),r.getDate())}function Kf(r){return new Date(r.getFullYear(),r.getMonth(),r.getDate(),Math.floor(r.getHours()/2)*2)}const et={second:1e3,minute:1e3*60,hour:1e3*60*60,day:1e3*60*60*24,week:1e3*60*60*24*7},Dt={seconds:"seconds",minutes:"minutes",date:"date"},Xa=[{ceiling:et.second*4,span:et.second,labelFormat:Dt.seconds},{ceiling:et.second*8,span:et.second*5,labelFormat:Dt.seconds},{ceiling:et.second*13,span:et.second*10,labelFormat:Dt.seconds},{ceiling:et.second*20,span:et.second*15,labelFormat:Dt.seconds},{ceiling:et.second*45,span:et.second*30,labelFormat:Dt.seconds},{ceiling:et.minute*4,span:et.minute,labelFormat:Dt.minutes},{ceiling:et.minute*8,span:et.minute*5,labelFormat:Dt.minutes},{ceiling:et.minute*13,span:et.minute*10,labelFormat:Dt.minutes},{ceiling:et.minute*28,span:et.minute*15,labelFormat:Dt.minutes},{ceiling:et.hour*1.24,span:et.minute*30,labelFormat:Dt.minutes},{ceiling:et.hour*3,span:et.hour,labelFormat:Dt.minutes},{ceiling:et.hour*8,span:et.hour*2,labelFormat:Dt.minutes},{ceiling:et.hour*13,span:et.hour*6,labelFormat:Dt.minutes},{ceiling:et.hour*22,span:et.hour*12,labelFormat:Dt.minutes},{ceiling:et.day*4,span:et.day,labelFormat:Dt.date},{ceiling:et.week*2,span:et.week,labelFormat:Dt.date},{ceiling:1/0,span:et.week*4,labelFormat:Dt.date}];function $f(r){return{colorTextDefault:Jt((r==null?void 0:r.colorTextDefault)??"#374151"),colorTextInverse:Jt((r==null?void 0:r.colorTextInverse)??"#f8fafc"),colorTextSubdued:Jt((r==null?void 0:r.colorTextSubdued)??"#6b7280"),colorEdge:Jt((r==null?void 0:r.colorEdge)??"#374151"),colorNodeSelection:Jt((r==null?void 0:r.colorNodeSelection)??"#024DFD"),colorButtonBg:Jt((r==null?void 0:r.colorButtonBg)??"#ffffff"),colorButtonBgHover:Jt((r==null?void 0:r.colorButtonBgHover)??"#cbd5e1"),colorButtonBorder:r!=null&&r.colorButtonBorder?Jt(r.colorButtonBorder):null,colorGuideLine:Jt((r==null?void 0:r.colorGuideLine)??"#cbd5e1"),colorPlayheadBg:Jt((r==null?void 0:r.colorPlayheadBg)??"#4e82fe"),textFontFamilyDefault:(r==null?void 0:r.textFontFamilyDefault)??"InterVariable",textSizeDefault:bt((r==null?void 0:r.textSizeDefault)??"14px"),textSizeSmall:bt((r==null?void 0:r.textSizeSmall)??"12px"),textLineHeightDefault:bt((r==null?void 0:r.textLineHeightDefault)??"20px"),textLineHeightSmall:bt((r==null?void 0:r.textLineHeightSmall)??"16px"),spacingButtonBorderWidth:bt((r==null?void 0:r.spacingButtonBorderWidth)??"1px"),spacingViewportPaddingDefault:bt((r==null?void 0:r.spacingViewportPaddingDefault)??"40px"),spacingNodeXPadding:bt((r==null?void 0:r.spacingNodeXPadding)??"8px"),spacingNodeYPadding:bt((r==null?void 0:r.spacingNodeYPadding)??"8px"),spacingNodeMargin:bt((r==null?void 0:r.spacingNodeMargin)??"24px"),spacingNodeLabelMargin:bt((r==null?void 0:r.spacingNodeLabelMargin)??"20px"),spacingMinimumNodeEdgeGap:bt((r==null?void 0:r.spacingMinimumNodeEdgeGap)??"16px"),spacingNodeEdgeLength:bt((r==null?void 0:r.spacingNodeEdgeLength)??"8px"),spacingNodeSelectionMargin:bt((r==null?void 0:r.spacingNodeSelectionMargin)??"2px"),spacingNodeSelectionWidth:bt((r==null?void 0:r.spacingNodeSelectionWidth)??"4px"),spacingSubNodesOutlineBorderWidth:bt((r==null?void 0:r.spacingSubNodesOutlineBorderWidth)??"2px"),spacingSubNodesOutlineOffset:bt((r==null?void 0:r.spacingSubNodesOutlineOffset)??"5px"),spacingEdgeWidth:bt((r==null?void 0:r.spacingEdgeWidth)??"2px"),spacingGuideLabelPadding:bt((r==null?void 0:r.spacingGuideLabelPadding)??"4px"),spacingPlayheadGlowPadding:bt((r==null?void 0:r.spacingPlayheadGlowPadding)??"8px"),spacingPlayheadWidth:bt((r==null?void 0:r.spacingPlayheadWidth)??"2px"),borderRadiusNode:bt((r==null?void 0:r.borderRadiusNode)??"8px"),borderRadiusButton:bt((r==null?void 0:r.borderRadiusButton)??"8px"),alphaNodeDimmed:(r==null?void 0:r.alphaNodeDimmed)??.2,alphaSubNodesOutlineDimmed:(r==null?void 0:r.alphaSubNodesOutlineDimmed)??.7}}function Jt(r){const e=r.trim();if(e.startsWith("rgb")){const[t,i,n]=e.replace(/[^\d,]/g,"").split(",").map(s=>parseInt(s,10));return Jf([t,i,n])}if(e.startsWith("hsl")){const[t,i,n]=e.replace(/[^\d,.%]/g,"").split(",").map(o=>parseInt(o,10));return Ha(Qf(t,i,n))}return Ha(e)}function Jf(r){return parseInt((1<<24|r[0]<<16|r[1]<<8|r[2]).toString(16).slice(1),16)}function Qf(r,e,t){t/=100;const i=e*ka(t,1-t)/100,n=s=>{const o=(s+r/30)%12,a=t-i*Wf(ka(o-3,9-o,1),-1);return zf(255*a).toString(16).padStart(2,"0")};return`#${n(0)}${n(8)}${n(4)}`}function Ha(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 bt(r){return typeof r!="string"?(Wa(r),0):r.endsWith("em")||r.endsWith("rem")?tc(r):r.endsWith("px")?parseFloat(r):(Wa(r),0)}function Wa(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 tc(r){const e=getComputedStyle(document.documentElement).fontSize;return parseFloat(r)*parseFloat(e)}const za={timeBySeconds:Yf,timeByMinutes:Vf,date:jf},Ya=()=>({fill:"black",inverseTextOnFill:!0,onFillSubNodeToggleHoverBg:"black",onFillSubNodeToggleHoverBgAlpha:.4});var gs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Va={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,g=_+100;return p.j.style.width=g+"px",p.i.scrollLeft=g,p.h.scrollLeft=p.h.scrollWidth+100,p.l!==_?(p.l=_,!0):!1}function o(p,_){function g(){var m=y;s(m)&&m.g.parentNode!==null&&_(m.l)}var y=p;e(p.h,g),e(p.i,g),s(p)}function a(p,_,g){_=_||{},g=g||window,this.family=p,this.style=_.style||"normal",this.weight=_.weight||"normal",this.stretch=_.stretch||"normal",this.context=g}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 g=p.style,y=p.weight;if(l===null){var m=document.createElement("div");try{m.style.font="condensed 100px sans-serif"}catch{}l=m.style.font!==""}return[g,y,l?p.stretch:"","100px",_].join(" ")}a.prototype.load=function(p,_){var g=this,y=p||"BESbswy",m=0,b=_||3e3,x=new Date().getTime();return new Promise(function(T,w){if(d(g.context)&&!c(g.context)){var S=new Promise(function(P,O){function N(){new Date().getTime()-x>=b?O(Error(""+b+"ms timeout exceeded")):g.context.document.fonts.load(v(g,'"'+g.family+'"'),y).then(function(D){1<=D.length?P():setTimeout(N,25)},O)}N()}),E=new Promise(function(P,O){m=setTimeout(function(){O(Error(""+b+"ms timeout exceeded"))},b)});Promise.race([E,S]).then(function(){clearTimeout(m),T(g)},w)}else t(function(){function P(){var G;(G=I!=-1&&A!=-1||I!=-1&&B!=-1||A!=-1&&B!=-1)&&((G=I!=A&&I!=B&&A!=B)||(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&&(I==K&&A==K&&B==K||I==z&&A==z&&B==z||I==M&&A==M&&B==M)),G=!G),G&&(C.parentNode!==null&&C.parentNode.removeChild(C),clearTimeout(m),T(g))}function O(){if(new Date().getTime()-x>=b)C.parentNode!==null&&C.parentNode.removeChild(C),w(Error(""+b+"ms timeout exceeded"));else{var G=g.context.document.hidden;(G===!0||G===void 0)&&(I=N.g.offsetWidth,A=D.g.offsetWidth,B=U.g.offsetWidth,P()),m=setTimeout(O,50)}}var N=new i(y),D=new i(y),U=new i(y),I=-1,A=-1,B=-1,K=-1,z=-1,M=-1,C=document.createElement("div");C.dir="ltr",n(N,v(g,"sans-serif")),n(D,v(g,"serif")),n(U,v(g,"monospace")),C.appendChild(N.g),C.appendChild(D.g),C.appendChild(U.g),g.context.document.body.appendChild(C),K=N.g.offsetWidth,z=D.g.offsetWidth,M=U.g.offsetWidth,O(),o(N,function(G){I=G,P()}),n(N,v(g,'"'+g.family+'",sans-serif')),o(D,function(G){A=G,P()}),n(D,v(g,'"'+g.family+'",serif')),o(U,function(G){B=G,P()}),n(U,v(g,'"'+g.family+'",monospace'))})})},r.exports=a})()})(Va);const ec=Va.exports;function ic(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 rc(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 o(h,u){if(u&&(typeof u=="object"||typeof u=="function")){var l=u.then;if(typeof l=="function"){l.call(u,function(f){o(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 a=0;a<n.length;a++)o(a,n[a])})}var nc=setTimeout;function ja(r){return Boolean(r&&typeof r.length<"u")}function sc(){}function oc(r,e){return function(){r.apply(e,arguments)}}function Tt(r){if(!(this instanceof Tt))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=[],qa(r,this)}function Za(r,e){for(;r._state===3;)r=r._value;if(r._state===0){r._deferreds.push(e);return}r._handled=!0,Tt._immediateFn(function(){var t=r._state===1?e.onFulfilled:e.onRejected;if(t===null){(r._state===1?ms:gr)(e.promise,r._value);return}var i;try{i=t(r._value)}catch(n){gr(e.promise,n);return}ms(e.promise,i)})}function ms(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 Tt){r._state=3,r._value=e,ys(r);return}else if(typeof t=="function"){qa(oc(t,e),r);return}}r._state=1,r._value=e,ys(r)}catch(i){gr(r,i)}}function gr(r,e){r._state=2,r._value=e,ys(r)}function ys(r){r._state===2&&r._deferreds.length===0&&Tt._immediateFn(function(){r._handled||Tt._unhandledRejectionFn(r._value)});for(var e=0,t=r._deferreds.length;e<t;e++)Za(r,r._deferreds[e]);r._deferreds=null}function ac(r,e,t){this.onFulfilled=typeof r=="function"?r:null,this.onRejected=typeof e=="function"?e:null,this.promise=t}function qa(r,e){var t=!1;try{r(function(i){t||(t=!0,ms(e,i))},function(i){t||(t=!0,gr(e,i))})}catch(i){if(t)return;t=!0,gr(e,i)}}Tt.prototype.catch=function(r){return this.then(null,r)},Tt.prototype.then=function(r,e){var t=new this.constructor(sc);return Za(this,new ac(r,e,t)),t},Tt.prototype.finally=ic,Tt.all=function(r){return new Tt(function(e,t){if(!ja(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(a,h){try{if(h&&(typeof h=="object"||typeof h=="function")){var u=h.then;if(typeof u=="function"){u.call(h,function(l){s(a,l)},t);return}}i[a]=h,--n===0&&e(i)}catch(l){t(l)}}for(var o=0;o<i.length;o++)s(o,i[o])})},Tt.allSettled=rc,Tt.resolve=function(r){return r&&typeof r=="object"&&r.constructor===Tt?r:new Tt(function(e){e(r)})},Tt.reject=function(r){return new Tt(function(e,t){t(r)})},Tt.race=function(r){return new Tt(function(e,t){if(!ja(r))return t(new TypeError("Promise.race accepts an array"));for(var i=0,n=r.length;i<n;i++)Tt.resolve(r[i]).then(e,t)})},Tt._immediateFn=typeof setImmediate=="function"&&function(r){setImmediate(r)}||function(r){nc(r,0)},Tt._unhandledRejectionFn=function(e){typeof console<"u"&&console&&console.warn("Possible Unhandled Promise Rejection:",e)};var Ka=Object.getOwnPropertySymbols,hc=Object.prototype.hasOwnProperty,uc=Object.prototype.propertyIsEnumerable;function lc(r){if(r==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(r)}function fc(){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 cc=fc()?Object.assign:function(r,e){for(var t,i=lc(r),n,s=1;s<arguments.length;s++){t=Object(arguments[s]);for(var o in t)hc.call(t,o)&&(i[o]=t[o]);if(Ka){n=Ka(t);for(var a=0;a<n.length;a++)uc.call(t,n[a])&&(i[n[a]]=t[n[a]])}}return i};typeof globalThis>"u"&&(typeof self<"u"?self.globalThis=self:typeof global<"u"&&(global.globalThis=global)),globalThis.Promise||(globalThis.Promise=Tt),Object.assign||(Object.assign=cc);var dc=16;if(Date.now&&Date.prototype.getTime||(Date.now=function(){return new Date().getTime()}),!(globalThis.performance&&globalThis.performance.now)){var pc=Date.now();globalThis.performance||(globalThis.performance={}),globalThis.performance.now=function(){return Date.now()-pc}}for(var xs=Date.now(),$a=["ms","moz","webkit","o"],bs=0;bs<$a.length&&!globalThis.requestAnimationFrame;++bs){var Ts=$a[bs];globalThis.requestAnimationFrame=globalThis[Ts+"RequestAnimationFrame"],globalThis.cancelAnimationFrame=globalThis[Ts+"CancelAnimationFrame"]||globalThis[Ts+"CancelRequestAnimationFrame"]}globalThis.requestAnimationFrame||(globalThis.requestAnimationFrame=function(r){if(typeof r!="function")throw new TypeError(r+"is not a function");var e=Date.now(),t=dc+xs-e;return t<0&&(t=0),xs=e,globalThis.self.setTimeout(function(){xs=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 We;(function(r){r[r.WEBGL_LEGACY=0]="WEBGL_LEGACY",r[r.WEBGL=1]="WEBGL",r[r.WEBGL2=2]="WEBGL2"})(We||(We={}));var mr;(function(r){r[r.UNKNOWN=0]="UNKNOWN",r[r.WEBGL=1]="WEBGL",r[r.CANVAS=2]="CANVAS"})(mr||(mr={}));var on;(function(r){r[r.COLOR=16384]="COLOR",r[r.DEPTH=256]="DEPTH",r[r.STENCIL=1024]="STENCIL"})(on||(on={}));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 ge;(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"})(ge||(ge={}));var F;(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"})(F||(F={}));var Ti;(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"})(Ti||(Ti={}));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 an;(function(r){r[r.FLOAT=0]="FLOAT",r[r.INT=1]="INT",r[r.UINT=2]="UINT"})(an||(an={}));var Me;(function(r){r[r.NEAREST=0]="NEAREST",r[r.LINEAR=1]="LINEAR"})(Me||(Me={}));var De;(function(r){r[r.CLAMP=33071]="CLAMP",r[r.REPEAT=10497]="REPEAT",r[r.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"})(De||(De={}));var me;(function(r){r[r.OFF=0]="OFF",r[r.POW2=1]="POW2",r[r.ON=2]="ON",r[r.ON_MANUAL=3]="ON_MANUAL"})(me||(me={}));var ye;(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"})(ye||(ye={}));var xe;(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"})(xe||(xe={}));var hn;(function(r){r[r.AUTO=0]="AUTO",r[r.MANUAL=1]="MANUAL"})(hn||(hn={}));var te;(function(r){r.LOW="lowp",r.MEDIUM="mediump",r.HIGH="highp"})(te||(te={}));var It;(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"})(It||(It={}));var Ja;(function(r){r[r.RED=1]="RED",r[r.GREEN=2]="GREEN",r[r.BLUE=4]="BLUE",r[r.ALPHA=8]="ALPHA"})(Ja||(Ja={}));var wt;(function(r){r[r.NONE=0]="NONE",r[r.LOW=2]="LOW",r[r.MEDIUM=4]="MEDIUM",r[r.HIGH=8]="HIGH"})(wt||(wt={}));var Ne;(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"})(Ne||(Ne={}));var vc={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)}},ws=/iPhone/i,Qa=/iPod/i,th=/iPad/i,eh=/\biOS-universal(?:.+)Mac\b/i,Es=/\bAndroid(?:.+)Mobile\b/i,ih=/Android/i,zi=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,un=/Silk/i,ze=/Windows Phone/i,rh=/\bWindows(?:.+)ARM\b/i,nh=/BlackBerry/i,sh=/BB10/i,oh=/Opera Mini/i,ah=/\b(CriOS|Chrome)(?:.+)Mobile/i,hh=/Mobile(?:.+)Firefox\b/i,uh=function(r){return typeof r<"u"&&r.platform==="MacIntel"&&typeof r.maxTouchPoints=="number"&&r.maxTouchPoints>1&&typeof MSStream>"u"};function _c(r){return function(e){return e.test(r)}}function gc(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=_c(t),s={apple:{phone:n(ws)&&!n(ze),ipod:n(Qa),tablet:!n(ws)&&(n(th)||uh(e))&&!n(ze),universal:n(eh),device:(n(ws)||n(Qa)||n(th)||n(eh)||uh(e))&&!n(ze)},amazon:{phone:n(zi),tablet:!n(zi)&&n(un),device:n(zi)||n(un)},android:{phone:!n(ze)&&n(zi)||!n(ze)&&n(Es),tablet:!n(ze)&&!n(zi)&&!n(Es)&&(n(un)||n(ih)),device:!n(ze)&&(n(zi)||n(un)||n(Es)||n(ih))||n(/\bokhttp\b/i)},windows:{phone:n(ze),tablet:n(rh),device:n(ze)||n(rh)},other:{blackberry:n(nh),blackberry10:n(sh),opera:n(oh),firefox:n(hh),chrome:n(ah),device:n(nh)||n(sh)||n(oh)||n(hh)||n(ah)},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 Fe=gc(globalThis.navigator);function mc(){return!Fe.apple.device}function yc(r){var e=!0;if(Fe.tablet||Fe.phone){if(Fe.apple.device){var t=navigator.userAgent.match(/OS (\d+)_(\d+)?/);if(t){var i=parseInt(t[1],10);i<11&&(e=!1)}}if(Fe.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:vc,MIPMAP_TEXTURES:me.POW2,ANISOTROPIC_LEVEL:0,RESOLUTION:1,FILTER_RESOLUTION:1,FILTER_MULTISAMPLE:wt.NONE,SPRITE_MAX_TEXTURES:yc(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:hn.AUTO,GC_MAX_IDLE:60*60,GC_MAX_CHECK_COUNT:60*10,WRAP_MODE:De.CLAMP,SCALE_MODE:Me.LINEAR,PRECISION_VERTEX:te.HIGH,PRECISION_FRAGMENT:Fe.apple.device?te.HIGH:te.MEDIUM,CAN_UPLOAD_SAME_BUFFER:mc(),CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1},lh={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 o(h,u){--h._eventsCount===0?h._events=new i:delete h._events[u]}function a(){this._events=new i,this._eventsCount=0}a.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},a.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},a.prototype.listenerCount=function(u){var l=t?t+u:u,f=this._events[l];return f?f.fn?1:f.length:0},a.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],g=arguments.length,y,m;if(_.fn){switch(_.once&&this.removeListener(u,_.fn,void 0,!0),g){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(m=1,y=new Array(g-1);m<g;m++)y[m-1]=arguments[m];_.fn.apply(_.context,y)}else{var b=_.length,x;for(m=0;m<b;m++)switch(_[m].once&&this.removeListener(u,_[m].fn,void 0,!0),g){case 1:_[m].fn.call(_[m].context);break;case 2:_[m].fn.call(_[m].context,l);break;case 3:_[m].fn.call(_[m].context,l,f);break;case 4:_[m].fn.call(_[m].context,l,f,c);break;default:if(!y)for(x=1,y=new Array(g-1);x<g;x++)y[x-1]=arguments[x];_[m].fn.apply(_[m].context,y)}}return!0},a.prototype.on=function(u,l,f){return s(this,u,l,f,!1)},a.prototype.once=function(u,l,f){return s(this,u,l,f,!0)},a.prototype.removeListener=function(u,l,f,c){var d=t?t+u:u;if(!this._events[d])return this;if(!l)return o(this,d),this;var v=this._events[d];if(v.fn)v.fn===l&&(!c||v.once)&&(!f||v.context===f)&&o(this,d);else{for(var p=0,_=[],g=v.length;p<g;p++)(v[p].fn!==l||c&&!v[p].once||f&&v[p].context!==f)&&_.push(v[p]);_.length?this._events[d]=_.length===1?_[0]:_:o(this,d)}return this},a.prototype.removeAllListeners=function(u){var l;return u?(l=t?t+u:u,this._events[l]&&o(this,l)):(this._events=new i,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=t,a.EventEmitter=a,r.exports=a})(lh);const yr=lh.exports;var ln={exports:{}};ln.exports=fn,ln.exports.default=fn;function fn(r,e,t){t=t||2;var i=e&&e.length,n=i?e[0]*t:r.length,s=fh(r,0,n,t,!0),o=[];if(!s||s.next===s.prev)return o;var a,h,u,l,f,c,d;if(i&&(s=Ec(r,e,s,t)),r.length>80*t){a=u=r[0],h=l=r[1];for(var v=t;v<n;v+=t)f=r[v],c=r[v+1],f<a&&(a=f),c<h&&(h=c),f>u&&(u=f),c>l&&(l=c);d=Math.max(u-a,l-h),d=d!==0?32767/d:0}return xr(s,o,t,a,h,d,0),o}function fh(r,e,t,i,n){var s,o;if(n===Rs(r,e,t,i)>0)for(s=e;s<t;s+=i)o=ph(s,r[s],r[s+1],o);else for(s=t-i;s>=e;s-=i)o=ph(s,r[s],r[s+1],o);return o&&cn(o,o.next)&&(Tr(o),o=o.next),o}function wi(r,e){if(!r)return r;e||(e=r);var t=r,i;do if(i=!1,!t.steiner&&(cn(t,t.next)||gt(t.prev,t,t.next)===0)){if(Tr(t),t=e=t.prev,t===t.next)break;i=!0}else t=t.next;while(i||t!==e);return e}function xr(r,e,t,i,n,s,o){if(r){!o&&s&&Oc(r,i,n,s);for(var a=r,h,u;r.prev!==r.next;){if(h=r.prev,u=r.next,s?bc(r,i,n,s):xc(r)){e.push(h.i/t|0),e.push(r.i/t|0),e.push(u.i/t|0),Tr(r),r=u.next,a=u.next;continue}if(r=u,r===a){o?o===1?(r=Tc(wi(r),e,t),xr(r,e,t,i,n,s,2)):o===2&&wc(r,e,t,i,n,s):xr(wi(r),e,t,i,n,s,1);break}}}}function xc(r){var e=r.prev,t=r,i=r.next;if(gt(e,t,i)>=0)return!1;for(var n=e.x,s=t.x,o=i.x,a=e.y,h=t.y,u=i.y,l=n<s?n<o?n:o:s<o?s:o,f=a<h?a<u?a:u:h<u?h:u,c=n>s?n>o?n:o:s>o?s:o,d=a>h?a>u?a:u:h>u?h:u,v=i.next;v!==e;){if(v.x>=l&&v.x<=c&&v.y>=f&&v.y<=d&&Yi(n,a,s,h,o,u,v.x,v.y)&&gt(v.prev,v,v.next)>=0)return!1;v=v.next}return!0}function bc(r,e,t,i){var n=r.prev,s=r,o=r.next;if(gt(n,s,o)>=0)return!1;for(var a=n.x,h=s.x,u=o.x,l=n.y,f=s.y,c=o.y,d=a<h?a<u?a:u:h<u?h:u,v=l<f?l<c?l:c:f<c?f:c,p=a>h?a>u?a:u:h>u?h:u,_=l>f?l>c?l:c:f>c?f:c,g=Ss(d,v,e,t,i),y=Ss(p,_,e,t,i),m=r.prevZ,b=r.nextZ;m&&m.z>=g&&b&&b.z<=y;){if(m.x>=d&&m.x<=p&&m.y>=v&&m.y<=_&&m!==n&&m!==o&&Yi(a,l,h,f,u,c,m.x,m.y)&&gt(m.prev,m,m.next)>=0||(m=m.prevZ,b.x>=d&&b.x<=p&&b.y>=v&&b.y<=_&&b!==n&&b!==o&&Yi(a,l,h,f,u,c,b.x,b.y)&&gt(b.prev,b,b.next)>=0))return!1;b=b.nextZ}for(;m&&m.z>=g;){if(m.x>=d&&m.x<=p&&m.y>=v&&m.y<=_&&m!==n&&m!==o&&Yi(a,l,h,f,u,c,m.x,m.y)&&gt(m.prev,m,m.next)>=0)return!1;m=m.prevZ}for(;b&&b.z<=y;){if(b.x>=d&&b.x<=p&&b.y>=v&&b.y<=_&&b!==n&&b!==o&&Yi(a,l,h,f,u,c,b.x,b.y)&&gt(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function Tc(r,e,t){var i=r;do{var n=i.prev,s=i.next.next;!cn(n,s)&&ch(n,i,i.next,s)&&br(n,s)&&br(s,n)&&(e.push(n.i/t|0),e.push(i.i/t|0),e.push(s.i/t|0),Tr(i),Tr(i.next),i=r=s),i=i.next}while(i!==r);return wi(i)}function wc(r,e,t,i,n,s){var o=r;do{for(var a=o.next.next;a!==o.prev;){if(o.i!==a.i&&Mc(o,a)){var h=dh(o,a);o=wi(o,o.next),h=wi(h,h.next),xr(o,e,t,i,n,s,0),xr(h,e,t,i,n,s,0);return}a=a.next}o=o.next}while(o!==r)}function Ec(r,e,t,i){var n=[],s,o,a,h,u;for(s=0,o=e.length;s<o;s++)a=e[s]*i,h=s<o-1?e[s+1]*i:r.length,u=fh(r,a,h,i,!1),u===u.next&&(u.steiner=!0),n.push(Ic(u));for(n.sort(Sc),s=0;s<n.length;s++)t=Pc(n[s],t);return t}function Sc(r,e){return r.x-e.x}function Pc(r,e){var t=Rc(r,e);if(!t)return e;var i=dh(t,r);return wi(i,i.next),wi(t,t.next)}function Rc(r,e){var t=e,i=r.x,n=r.y,s=-1/0,o;do{if(n<=t.y&&n>=t.next.y&&t.next.y!==t.y){var a=t.x+(n-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(a<=i&&a>s&&(s=a,o=t.x<t.next.x?t:t.next,a===i))return o}t=t.next}while(t!==e);if(!o)return null;var h=o,u=o.x,l=o.y,f=1/0,c;t=o;do i>=t.x&&t.x>=u&&i!==t.x&&Yi(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),br(t,r)&&(c<f||c===f&&(t.x>o.x||t.x===o.x&&Cc(o,t)))&&(o=t,f=c)),t=t.next;while(t!==h);return o}function Cc(r,e){return gt(r.prev,r,e.prev)<0&&gt(e.next,r,r.next)<0}function Oc(r,e,t,i){var n=r;do n.z===0&&(n.z=Ss(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,Ac(n)}function Ac(r){var e,t,i,n,s,o,a,h,u=1;do{for(t=r,r=null,s=null,o=0;t;){for(o++,i=t,a=0,e=0;e<u&&(a++,i=i.nextZ,!!i);e++);for(h=u;a>0||h>0&&i;)a!==0&&(h===0||!i||t.z<=i.z)?(n=t,t=t.nextZ,a--):(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(o>1);return r}function Ss(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 Ic(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 Yi(r,e,t,i,n,s,o,a){return(n-o)*(e-a)>=(r-o)*(s-a)&&(r-o)*(i-a)>=(t-o)*(e-a)&&(t-o)*(s-a)>=(n-o)*(i-a)}function Mc(r,e){return r.next.i!==e.i&&r.prev.i!==e.i&&!Dc(r,e)&&(br(r,e)&&br(e,r)&&Nc(r,e)&&(gt(r.prev,r,e.prev)||gt(r,e.prev,e))||cn(r,e)&&gt(r.prev,r,r.next)>0&&gt(e.prev,e,e.next)>0)}function gt(r,e,t){return(e.y-r.y)*(t.x-e.x)-(e.x-r.x)*(t.y-e.y)}function cn(r,e){return r.x===e.x&&r.y===e.y}function ch(r,e,t,i){var n=pn(gt(r,e,t)),s=pn(gt(r,e,i)),o=pn(gt(t,i,r)),a=pn(gt(t,i,e));return!!(n!==s&&o!==a||n===0&&dn(r,t,e)||s===0&&dn(r,i,e)||o===0&&dn(t,r,i)||a===0&&dn(t,e,i))}function dn(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 pn(r){return r>0?1:r<0?-1:0}function Dc(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&&ch(t,t.next,r,e))return!0;t=t.next}while(t!==r);return!1}function br(r,e){return gt(r.prev,r,r.next)<0?gt(r,e,r.next)>=0&&gt(r,r.prev,e)>=0:gt(r,e,r.prev)<0||gt(r,r.next,e)<0}function Nc(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 dh(r,e){var t=new Ps(r.i,r.x,r.y),i=new Ps(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 ph(r,e,t,i){var n=new Ps(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 Tr(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 Ps(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}fn.deviation=function(r,e,t,i){var n=e&&e.length,s=n?e[0]*t:r.length,o=Math.abs(Rs(r,0,s,t));if(n)for(var a=0,h=e.length;a<h;a++){var u=e[a]*t,l=a<h-1?e[a+1]*t:r.length;o-=Math.abs(Rs(r,u,l,t))}var f=0;for(a=0;a<i.length;a+=3){var c=i[a]*t,d=i[a+1]*t,v=i[a+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 o===0&&f===0?0:Math.abs((f-o)/o)};function Rs(r,e,t,i){for(var n=0,s=e,o=t-i;s<t;s+=i)n+=(r[o]-r[s])*(r[s+1]+r[o+1]),o=s;return n}fn.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 o=0;o<e;o++)t.vertices.push(r[n][s][o]);n>0&&(i+=r[n-1].length,t.holes.push(i))}return t};var Cs={exports:{}};(function(r,e){(function(t){var i=e&&!e.nodeType&&e,n=r&&!r.nodeType&&r,s=typeof gs=="object"&&gs;(s.global===s||s.window===s||s.self===s)&&(t=s);var o,a=2147483647,h=36,u=1,l=26,f=38,c=700,d=72,v=128,p="-",_=/^xn--/,g=/[^\x20-\x7E]/,y=/[\x2E\u3002\uFF0E\uFF61]/g,m={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(M){throw RangeError(m[M])}function E(M,C){for(var G=M.length,tt=[];G--;)tt[G]=C(M[G]);return tt}function P(M,C){var G=M.split("@"),tt="";G.length>1&&(tt=G[0]+"@",M=G[1]),M=M.replace(y,".");var V=M.split("."),nt=E(V,C).join(".");return tt+nt}function O(M){for(var C=[],G=0,tt=M.length,V,nt;G<tt;)V=M.charCodeAt(G++),V>=55296&&V<=56319&&G<tt?(nt=M.charCodeAt(G++),(nt&64512)==56320?C.push(((V&1023)<<10)+(nt&1023)+65536):(C.push(V),G--)):C.push(V);return C}function N(M){return E(M,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 D(M){return M-48<10?M-22:M-65<26?M-65:M-97<26?M-97:h}function U(M,C){return M+22+75*(M<26)-((C!=0)<<5)}function I(M,C,G){var tt=0;for(M=G?x(M/c):M>>1,M+=x(M/C);M>b*l>>1;tt+=h)M=x(M/b);return x(tt+(b+1)*M/(M+f))}function A(M){var C=[],G=M.length,tt,V=0,nt=v,dt=d,pt,Pt,Lt,vt,st,H,$,Z,xt;for(pt=M.lastIndexOf(p),pt<0&&(pt=0),Pt=0;Pt<pt;++Pt)M.charCodeAt(Pt)>=128&&S("not-basic"),C.push(M.charCodeAt(Pt));for(Lt=pt>0?pt+1:0;Lt<G;){for(vt=V,st=1,H=h;Lt>=G&&S("invalid-input"),$=D(M.charCodeAt(Lt++)),($>=h||$>x((a-V)/st))&&S("overflow"),V+=$*st,Z=H<=dt?u:H>=dt+l?l:H-dt,!($<Z);H+=h)xt=h-Z,st>x(a/xt)&&S("overflow"),st*=xt;tt=C.length+1,dt=I(V-vt,tt,vt==0),x(V/tt)>a-nt&&S("overflow"),nt+=x(V/tt),V%=tt,C.splice(V++,0,nt)}return N(C)}function B(M){var C,G,tt,V,nt,dt,pt,Pt,Lt,vt,st,H=[],$,Z,xt,Rt;for(M=O(M),$=M.length,C=v,G=0,nt=d,dt=0;dt<$;++dt)st=M[dt],st<128&&H.push(T(st));for(tt=V=H.length,V&&H.push(p);tt<$;){for(pt=a,dt=0;dt<$;++dt)st=M[dt],st>=C&&st<pt&&(pt=st);for(Z=tt+1,pt-C>x((a-G)/Z)&&S("overflow"),G+=(pt-C)*Z,C=pt,dt=0;dt<$;++dt)if(st=M[dt],st<C&&++G>a&&S("overflow"),st==C){for(Pt=G,Lt=h;vt=Lt<=nt?u:Lt>=nt+l?l:Lt-nt,!(Pt<vt);Lt+=h)Rt=Pt-vt,xt=h-vt,H.push(T(U(vt+Rt%xt,0))),Pt=x(Rt/xt);H.push(T(U(Pt,0))),nt=I(G,Z,tt==V),G=0,++tt}++G,++C}return H.join("")}function K(M){return P(M,function(C){return _.test(C)?A(C.slice(4).toLowerCase()):C})}function z(M){return P(M,function(C){return g.test(C)?"xn--"+B(C):C})}if(o={version:"1.3.2",ucs2:{decode:O,encode:N},decode:A,encode:B,toASCII:z,toUnicode:K},i&&n)if(r.exports==i)n.exports=o;else for(w in o)o.hasOwnProperty(w)&&(i[w]=o[w]);else t.punycode=o})(gs)})(Cs,Cs.exports);var Fc={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}},wr={};function Bc(r,e){return Object.prototype.hasOwnProperty.call(r,e)}var Lc=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 o=1e3;i&&typeof i.maxKeys=="number"&&(o=i.maxKeys);var a=r.length;o>0&&a>o&&(a=o);for(var h=0;h<a;++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),Bc(n,d)?Array.isArray(n[d])?n[d].push(v):n[d]=[n[d],v]:n[d]=v}return n},Er=function(r){switch(typeof r){case"string":return r;case"boolean":return r?"true":"false";case"number":return isFinite(r)?r:"";default:return""}},Gc=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(Er(n))+t;return Array.isArray(r[n])?r[n].map(function(o){return s+encodeURIComponent(Er(o))}).join(e):s+encodeURIComponent(Er(r[n]))}).join(e):i?encodeURIComponent(Er(i))+t+encodeURIComponent(Er(r)):""};wr.decode=wr.parse=Lc,wr.encode=wr.stringify=Gc;var Uc=Cs.exports,Be=Fc,kc=vn,Xc=Jc,Hc=$c;function be(){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 Wc=/^([a-z0-9.+-]+:)/i,zc=/:[0-9]*$/,Yc=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Vc=["<",">",'"',"`"," ","\r",`
6
- `," "],jc=["{","}","|","\\","^","`"].concat(Vc),Os=["'"].concat(jc),vh=["%","/","?",";","#"].concat(Os),_h=["/","?","#"],Zc=255,gh=/^[+a-z0-9A-Z_-]{0,63}$/,qc=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Kc={javascript:!0,"javascript:":!0},As={javascript:!0,"javascript:":!0},Vi={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},Is=wr;function vn(r,e,t){if(r&&Be.isObject(r)&&r instanceof be)return r;var i=new be;return i.parse(r,e,t),i}be.prototype.parse=function(r,e,t){if(!Be.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),o=/\\/g;s[0]=s[0].replace(o,"/"),r=s.join(n);var a=r;if(a=a.trim(),!t&&r.split("#").length===1){var h=Yc.exec(a);if(h)return this.path=a,this.href=a,this.pathname=h[1],h[2]?(this.search=h[2],e?this.query=Is.parse(this.search.substr(1)):this.query=this.search.substr(1)):e&&(this.search="",this.query={}),this}var u=Wc.exec(a);if(u){u=u[0];var l=u.toLowerCase();this.protocol=l,a=a.substr(u.length)}if(t||u||a.match(/^\/\/[^@\/]+@[^@\/]+/)){var f=a.substr(0,2)==="//";f&&!(u&&As[u])&&(a=a.substr(2),this.slashes=!0)}if(!As[u]&&(f||u&&!Vi[u])){for(var c=-1,d=0;d<_h.length;d++){var v=a.indexOf(_h[d]);v!==-1&&(c===-1||v<c)&&(c=v)}var p,_;c===-1?_=a.lastIndexOf("@"):_=a.lastIndexOf("@",c),_!==-1&&(p=a.slice(0,_),a=a.slice(_+1),this.auth=decodeURIComponent(p)),c=-1;for(var d=0;d<vh.length;d++){var v=a.indexOf(vh[d]);v!==-1&&(c===-1||v<c)&&(c=v)}c===-1&&(c=a.length),this.host=a.slice(0,c),a=a.slice(c),this.parseHost(),this.hostname=this.hostname||"";var g=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!g)for(var y=this.hostname.split(/\./),d=0,m=y.length;d<m;d++){var b=y[d];if(b&&!b.match(gh)){for(var x="",T=0,w=b.length;T<w;T++)b.charCodeAt(T)>127?x+="x":x+=b[T];if(!x.match(gh)){var S=y.slice(0,d),E=y.slice(d+1),P=b.match(qc);P&&(S.push(P[1]),E.unshift(P[2])),E.length&&(a="/"+E.join(".")+a),this.hostname=S.join(".");break}}}this.hostname.length>Zc?this.hostname="":this.hostname=this.hostname.toLowerCase(),g||(this.hostname=Uc.toASCII(this.hostname));var O=this.port?":"+this.port:"",N=this.hostname||"";this.host=N+O,this.href+=this.host,g&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),a[0]!=="/"&&(a="/"+a))}if(!Kc[l])for(var d=0,m=Os.length;d<m;d++){var D=Os[d];if(a.indexOf(D)!==-1){var U=encodeURIComponent(D);U===D&&(U=escape(D)),a=a.split(D).join(U)}}var I=a.indexOf("#");I!==-1&&(this.hash=a.substr(I),a=a.slice(0,I));var A=a.indexOf("?");if(A!==-1?(this.search=a.substr(A),this.query=a.substr(A+1),e&&(this.query=Is.parse(this.query)),a=a.slice(0,A)):e&&(this.search="",this.query={}),a&&(this.pathname=a),Vi[l]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var O=this.pathname||"",B=this.search||"";this.path=O+B}return this.href=this.format(),this};function $c(r){return Be.isString(r)&&(r=vn(r)),r instanceof be?r.format():be.prototype.format.call(r)}be.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&&Be.isObject(this.query)&&Object.keys(this.query).length&&(s=Is.stringify(this.query));var o=this.search||s&&"?"+s||"";return e&&e.substr(-1)!==":"&&(e+=":"),this.slashes||(!e||Vi[e])&&n!==!1?(n="//"+(n||""),t&&t.charAt(0)!=="/"&&(t="/"+t)):n||(n=""),i&&i.charAt(0)!=="#"&&(i="#"+i),o&&o.charAt(0)!=="?"&&(o="?"+o),t=t.replace(/[?#]/g,function(a){return encodeURIComponent(a)}),o=o.replace("#","%23"),e+n+t+o+i};function Jc(r,e){return vn(r,!1,!0).resolve(e)}be.prototype.resolve=function(r){return this.resolveObject(vn(r,!1,!0)).format()},be.prototype.resolveObject=function(r){if(Be.isString(r)){var e=new be;e.parse(r,!1,!0),r=e}for(var t=new be,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 o=Object.keys(r),a=0;a<o.length;a++){var h=o[a];h!=="protocol"&&(t[h]=r[h])}return Vi[t.protocol]&&t.hostname&&!t.pathname&&(t.path=t.pathname="/"),t.href=t.format(),t}if(r.protocol&&r.protocol!==t.protocol){if(!Vi[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&&!As[r.protocol]){for(var m=(r.pathname||"").split("/");m.length&&!(r.host=m.shift()););r.host||(r.host=""),r.hostname||(r.hostname=""),m[0]!==""&&m.unshift(""),m.length<2&&m.unshift(""),t.pathname=m.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,g=_,y=t.pathname&&t.pathname.split("/")||[],m=r.pathname&&r.pathname.split("/")||[],b=t.protocol&&!Vi[t.protocol];if(b&&(t.hostname="",t.port=null,t.host&&(y[0]===""?y[0]=t.host:y.unshift(t.host)),t.host="",r.protocol&&(r.hostname=null,r.port=null,r.host&&(m[0]===""?m[0]=r.host:m.unshift(r.host)),r.host=null),_=_&&(m[0]===""||y[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,y=m;else if(m.length)y||(y=[]),y.pop(),y=y.concat(m),t.search=r.search,t.query=r.query;else if(!Be.isNullOrUndefined(r.search)){if(b){t.hostname=t.host=y.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,(!Be.isNull(t.pathname)||!Be.isNull(t.search))&&(t.path=(t.pathname?t.pathname:"")+(t.search?t.search:"")),t.href=t.format(),t}if(!y.length)return t.pathname=null,t.search?t.path="/"+t.search:t.path=null,t.href=t.format(),t;for(var T=y.slice(-1)[0],w=(t.host||r.host||y.length>1)&&(T==="."||T==="..")||T==="",S=0,E=y.length;E>=0;E--)T=y[E],T==="."?y.splice(E,1):T===".."?(y.splice(E,1),S++):S&&(y.splice(E,1),S--);if(!_&&!g)for(;S--;S)y.unshift("..");_&&y[0]!==""&&(!y[0]||y[0].charAt(0)!=="/")&&y.unshift(""),w&&y.join("/").substr(-1)!=="/"&&y.push("");var P=y[0]===""||y[0]&&y[0].charAt(0)==="/";if(b){t.hostname=t.host=P?"":y.length?y.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&&y.length,_&&!P&&y.unshift(""),y.length?t.pathname=y.join("/"):(t.pathname=null,t.path=null),(!Be.isNull(t.pathname)||!Be.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},be.prototype.parseHost=function(){var r=this.host,e=zc.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 ji={parse:kc,format:Hc,resolve:Xc};L.RETINA_PREFIX=/@([0-9\.]+)x/,L.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var Ms=!1,mh="6.5.8";function Qc(){Ms=!0}function td(r){var e;if(!Ms){if(L.ADAPTER.getNavigator().userAgent.toLowerCase().indexOf("chrome")>-1){var t=[`
5
+ `)}function tc(r){const e=getComputedStyle(document.documentElement).fontSize;return parseFloat(r)*parseFloat(e)}const za={timeBySeconds:Yf,timeByMinutes:Vf,date:jf},Ya=()=>({fill:"black",inverseTextOnFill:!0,onFillSubNodeToggleHoverBg:"black",onFillSubNodeToggleHoverBgAlpha:.4});var gs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Va={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,g=_+100;return p.j.style.width=g+"px",p.i.scrollLeft=g,p.h.scrollLeft=p.h.scrollWidth+100,p.l!==_?(p.l=_,!0):!1}function o(p,_){function g(){var m=y;s(m)&&m.g.parentNode!==null&&_(m.l)}var y=p;e(p.h,g),e(p.i,g),s(p)}function a(p,_,g){_=_||{},g=g||window,this.family=p,this.style=_.style||"normal",this.weight=_.weight||"normal",this.stretch=_.stretch||"normal",this.context=g}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 g=p.style,y=p.weight;if(l===null){var m=document.createElement("div");try{m.style.font="condensed 100px sans-serif"}catch{}l=m.style.font!==""}return[g,y,l?p.stretch:"","100px",_].join(" ")}a.prototype.load=function(p,_){var g=this,y=p||"BESbswy",m=0,b=_||3e3,x=new Date().getTime();return new Promise(function(T,w){if(d(g.context)&&!c(g.context)){var S=new Promise(function(P,O){function D(){new Date().getTime()-x>=b?O(Error(""+b+"ms timeout exceeded")):g.context.document.fonts.load(v(g,'"'+g.family+'"'),y).then(function(N){1<=N.length?P():setTimeout(D,25)},O)}D()}),E=new Promise(function(P,O){m=setTimeout(function(){O(Error(""+b+"ms timeout exceeded"))},b)});Promise.race([E,S]).then(function(){clearTimeout(m),T(g)},w)}else t(function(){function P(){var G;(G=I!=-1&&A!=-1||I!=-1&&B!=-1||A!=-1&&B!=-1)&&((G=I!=A&&I!=B&&A!=B)||(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&&(I==K&&A==K&&B==K||I==z&&A==z&&B==z||I==M&&A==M&&B==M)),G=!G),G&&(C.parentNode!==null&&C.parentNode.removeChild(C),clearTimeout(m),T(g))}function O(){if(new Date().getTime()-x>=b)C.parentNode!==null&&C.parentNode.removeChild(C),w(Error(""+b+"ms timeout exceeded"));else{var G=g.context.document.hidden;(G===!0||G===void 0)&&(I=D.g.offsetWidth,A=N.g.offsetWidth,B=U.g.offsetWidth,P()),m=setTimeout(O,50)}}var D=new i(y),N=new i(y),U=new i(y),I=-1,A=-1,B=-1,K=-1,z=-1,M=-1,C=document.createElement("div");C.dir="ltr",n(D,v(g,"sans-serif")),n(N,v(g,"serif")),n(U,v(g,"monospace")),C.appendChild(D.g),C.appendChild(N.g),C.appendChild(U.g),g.context.document.body.appendChild(C),K=D.g.offsetWidth,z=N.g.offsetWidth,M=U.g.offsetWidth,O(),o(D,function(G){I=G,P()}),n(D,v(g,'"'+g.family+'",sans-serif')),o(N,function(G){A=G,P()}),n(N,v(g,'"'+g.family+'",serif')),o(U,function(G){B=G,P()}),n(U,v(g,'"'+g.family+'",monospace'))})})},r.exports=a})()})(Va);const ec=Va.exports;function ic(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 rc(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 o(h,u){if(u&&(typeof u=="object"||typeof u=="function")){var l=u.then;if(typeof l=="function"){l.call(u,function(f){o(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 a=0;a<n.length;a++)o(a,n[a])})}var nc=setTimeout;function ja(r){return Boolean(r&&typeof r.length<"u")}function sc(){}function oc(r,e){return function(){r.apply(e,arguments)}}function Tt(r){if(!(this instanceof Tt))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=[],qa(r,this)}function Za(r,e){for(;r._state===3;)r=r._value;if(r._state===0){r._deferreds.push(e);return}r._handled=!0,Tt._immediateFn(function(){var t=r._state===1?e.onFulfilled:e.onRejected;if(t===null){(r._state===1?ms:gr)(e.promise,r._value);return}var i;try{i=t(r._value)}catch(n){gr(e.promise,n);return}ms(e.promise,i)})}function ms(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 Tt){r._state=3,r._value=e,ys(r);return}else if(typeof t=="function"){qa(oc(t,e),r);return}}r._state=1,r._value=e,ys(r)}catch(i){gr(r,i)}}function gr(r,e){r._state=2,r._value=e,ys(r)}function ys(r){r._state===2&&r._deferreds.length===0&&Tt._immediateFn(function(){r._handled||Tt._unhandledRejectionFn(r._value)});for(var e=0,t=r._deferreds.length;e<t;e++)Za(r,r._deferreds[e]);r._deferreds=null}function ac(r,e,t){this.onFulfilled=typeof r=="function"?r:null,this.onRejected=typeof e=="function"?e:null,this.promise=t}function qa(r,e){var t=!1;try{r(function(i){t||(t=!0,ms(e,i))},function(i){t||(t=!0,gr(e,i))})}catch(i){if(t)return;t=!0,gr(e,i)}}Tt.prototype.catch=function(r){return this.then(null,r)},Tt.prototype.then=function(r,e){var t=new this.constructor(sc);return Za(this,new ac(r,e,t)),t},Tt.prototype.finally=ic,Tt.all=function(r){return new Tt(function(e,t){if(!ja(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(a,h){try{if(h&&(typeof h=="object"||typeof h=="function")){var u=h.then;if(typeof u=="function"){u.call(h,function(l){s(a,l)},t);return}}i[a]=h,--n===0&&e(i)}catch(l){t(l)}}for(var o=0;o<i.length;o++)s(o,i[o])})},Tt.allSettled=rc,Tt.resolve=function(r){return r&&typeof r=="object"&&r.constructor===Tt?r:new Tt(function(e){e(r)})},Tt.reject=function(r){return new Tt(function(e,t){t(r)})},Tt.race=function(r){return new Tt(function(e,t){if(!ja(r))return t(new TypeError("Promise.race accepts an array"));for(var i=0,n=r.length;i<n;i++)Tt.resolve(r[i]).then(e,t)})},Tt._immediateFn=typeof setImmediate=="function"&&function(r){setImmediate(r)}||function(r){nc(r,0)},Tt._unhandledRejectionFn=function(e){typeof console<"u"&&console&&console.warn("Possible Unhandled Promise Rejection:",e)};var Ka=Object.getOwnPropertySymbols,hc=Object.prototype.hasOwnProperty,uc=Object.prototype.propertyIsEnumerable;function lc(r){if(r==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(r)}function fc(){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 cc=fc()?Object.assign:function(r,e){for(var t,i=lc(r),n,s=1;s<arguments.length;s++){t=Object(arguments[s]);for(var o in t)hc.call(t,o)&&(i[o]=t[o]);if(Ka){n=Ka(t);for(var a=0;a<n.length;a++)uc.call(t,n[a])&&(i[n[a]]=t[n[a]])}}return i};typeof globalThis>"u"&&(typeof self<"u"?self.globalThis=self:typeof global<"u"&&(global.globalThis=global)),globalThis.Promise||(globalThis.Promise=Tt),Object.assign||(Object.assign=cc);var dc=16;if(Date.now&&Date.prototype.getTime||(Date.now=function(){return new Date().getTime()}),!(globalThis.performance&&globalThis.performance.now)){var pc=Date.now();globalThis.performance||(globalThis.performance={}),globalThis.performance.now=function(){return Date.now()-pc}}for(var xs=Date.now(),$a=["ms","moz","webkit","o"],bs=0;bs<$a.length&&!globalThis.requestAnimationFrame;++bs){var Ts=$a[bs];globalThis.requestAnimationFrame=globalThis[Ts+"RequestAnimationFrame"],globalThis.cancelAnimationFrame=globalThis[Ts+"CancelAnimationFrame"]||globalThis[Ts+"CancelRequestAnimationFrame"]}globalThis.requestAnimationFrame||(globalThis.requestAnimationFrame=function(r){if(typeof r!="function")throw new TypeError(r+"is not a function");var e=Date.now(),t=dc+xs-e;return t<0&&(t=0),xs=e,globalThis.self.setTimeout(function(){xs=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 We;(function(r){r[r.WEBGL_LEGACY=0]="WEBGL_LEGACY",r[r.WEBGL=1]="WEBGL",r[r.WEBGL2=2]="WEBGL2"})(We||(We={}));var mr;(function(r){r[r.UNKNOWN=0]="UNKNOWN",r[r.WEBGL=1]="WEBGL",r[r.CANVAS=2]="CANVAS"})(mr||(mr={}));var on;(function(r){r[r.COLOR=16384]="COLOR",r[r.DEPTH=256]="DEPTH",r[r.STENCIL=1024]="STENCIL"})(on||(on={}));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 ge;(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"})(ge||(ge={}));var F;(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"})(F||(F={}));var Ti;(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"})(Ti||(Ti={}));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 an;(function(r){r[r.FLOAT=0]="FLOAT",r[r.INT=1]="INT",r[r.UINT=2]="UINT"})(an||(an={}));var Me;(function(r){r[r.NEAREST=0]="NEAREST",r[r.LINEAR=1]="LINEAR"})(Me||(Me={}));var Ne;(function(r){r[r.CLAMP=33071]="CLAMP",r[r.REPEAT=10497]="REPEAT",r[r.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"})(Ne||(Ne={}));var me;(function(r){r[r.OFF=0]="OFF",r[r.POW2=1]="POW2",r[r.ON=2]="ON",r[r.ON_MANUAL=3]="ON_MANUAL"})(me||(me={}));var ye;(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"})(ye||(ye={}));var xe;(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"})(xe||(xe={}));var hn;(function(r){r[r.AUTO=0]="AUTO",r[r.MANUAL=1]="MANUAL"})(hn||(hn={}));var Qt;(function(r){r.LOW="lowp",r.MEDIUM="mediump",r.HIGH="highp"})(Qt||(Qt={}));var It;(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"})(It||(It={}));var Ja;(function(r){r[r.RED=1]="RED",r[r.GREEN=2]="GREEN",r[r.BLUE=4]="BLUE",r[r.ALPHA=8]="ALPHA"})(Ja||(Ja={}));var wt;(function(r){r[r.NONE=0]="NONE",r[r.LOW=2]="LOW",r[r.MEDIUM=4]="MEDIUM",r[r.HIGH=8]="HIGH"})(wt||(wt={}));var De;(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"})(De||(De={}));var vc={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)}},ws=/iPhone/i,Qa=/iPod/i,th=/iPad/i,eh=/\biOS-universal(?:.+)Mac\b/i,Es=/\bAndroid(?:.+)Mobile\b/i,ih=/Android/i,zi=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,un=/Silk/i,ze=/Windows Phone/i,rh=/\bWindows(?:.+)ARM\b/i,nh=/BlackBerry/i,sh=/BB10/i,oh=/Opera Mini/i,ah=/\b(CriOS|Chrome)(?:.+)Mobile/i,hh=/Mobile(?:.+)Firefox\b/i,uh=function(r){return typeof r<"u"&&r.platform==="MacIntel"&&typeof r.maxTouchPoints=="number"&&r.maxTouchPoints>1&&typeof MSStream>"u"};function _c(r){return function(e){return e.test(r)}}function gc(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=_c(t),s={apple:{phone:n(ws)&&!n(ze),ipod:n(Qa),tablet:!n(ws)&&(n(th)||uh(e))&&!n(ze),universal:n(eh),device:(n(ws)||n(Qa)||n(th)||n(eh)||uh(e))&&!n(ze)},amazon:{phone:n(zi),tablet:!n(zi)&&n(un),device:n(zi)||n(un)},android:{phone:!n(ze)&&n(zi)||!n(ze)&&n(Es),tablet:!n(ze)&&!n(zi)&&!n(Es)&&(n(un)||n(ih)),device:!n(ze)&&(n(zi)||n(un)||n(Es)||n(ih))||n(/\bokhttp\b/i)},windows:{phone:n(ze),tablet:n(rh),device:n(ze)||n(rh)},other:{blackberry:n(nh),blackberry10:n(sh),opera:n(oh),firefox:n(hh),chrome:n(ah),device:n(nh)||n(sh)||n(oh)||n(hh)||n(ah)},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 Fe=gc(globalThis.navigator);function mc(){return!Fe.apple.device}function yc(r){var e=!0;if(Fe.tablet||Fe.phone){if(Fe.apple.device){var t=navigator.userAgent.match(/OS (\d+)_(\d+)?/);if(t){var i=parseInt(t[1],10);i<11&&(e=!1)}}if(Fe.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:vc,MIPMAP_TEXTURES:me.POW2,ANISOTROPIC_LEVEL:0,RESOLUTION:1,FILTER_RESOLUTION:1,FILTER_MULTISAMPLE:wt.NONE,SPRITE_MAX_TEXTURES:yc(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:hn.AUTO,GC_MAX_IDLE:60*60,GC_MAX_CHECK_COUNT:60*10,WRAP_MODE:Ne.CLAMP,SCALE_MODE:Me.LINEAR,PRECISION_VERTEX:Qt.HIGH,PRECISION_FRAGMENT:Fe.apple.device?Qt.HIGH:Qt.MEDIUM,CAN_UPLOAD_SAME_BUFFER:mc(),CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1},lh={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 o(h,u){--h._eventsCount===0?h._events=new i:delete h._events[u]}function a(){this._events=new i,this._eventsCount=0}a.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},a.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},a.prototype.listenerCount=function(u){var l=t?t+u:u,f=this._events[l];return f?f.fn?1:f.length:0},a.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],g=arguments.length,y,m;if(_.fn){switch(_.once&&this.removeListener(u,_.fn,void 0,!0),g){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(m=1,y=new Array(g-1);m<g;m++)y[m-1]=arguments[m];_.fn.apply(_.context,y)}else{var b=_.length,x;for(m=0;m<b;m++)switch(_[m].once&&this.removeListener(u,_[m].fn,void 0,!0),g){case 1:_[m].fn.call(_[m].context);break;case 2:_[m].fn.call(_[m].context,l);break;case 3:_[m].fn.call(_[m].context,l,f);break;case 4:_[m].fn.call(_[m].context,l,f,c);break;default:if(!y)for(x=1,y=new Array(g-1);x<g;x++)y[x-1]=arguments[x];_[m].fn.apply(_[m].context,y)}}return!0},a.prototype.on=function(u,l,f){return s(this,u,l,f,!1)},a.prototype.once=function(u,l,f){return s(this,u,l,f,!0)},a.prototype.removeListener=function(u,l,f,c){var d=t?t+u:u;if(!this._events[d])return this;if(!l)return o(this,d),this;var v=this._events[d];if(v.fn)v.fn===l&&(!c||v.once)&&(!f||v.context===f)&&o(this,d);else{for(var p=0,_=[],g=v.length;p<g;p++)(v[p].fn!==l||c&&!v[p].once||f&&v[p].context!==f)&&_.push(v[p]);_.length?this._events[d]=_.length===1?_[0]:_:o(this,d)}return this},a.prototype.removeAllListeners=function(u){var l;return u?(l=t?t+u:u,this._events[l]&&o(this,l)):(this._events=new i,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=t,a.EventEmitter=a,r.exports=a})(lh);const yr=lh.exports;var ln={exports:{}};ln.exports=fn,ln.exports.default=fn;function fn(r,e,t){t=t||2;var i=e&&e.length,n=i?e[0]*t:r.length,s=fh(r,0,n,t,!0),o=[];if(!s||s.next===s.prev)return o;var a,h,u,l,f,c,d;if(i&&(s=Ec(r,e,s,t)),r.length>80*t){a=u=r[0],h=l=r[1];for(var v=t;v<n;v+=t)f=r[v],c=r[v+1],f<a&&(a=f),c<h&&(h=c),f>u&&(u=f),c>l&&(l=c);d=Math.max(u-a,l-h),d=d!==0?32767/d:0}return xr(s,o,t,a,h,d,0),o}function fh(r,e,t,i,n){var s,o;if(n===Rs(r,e,t,i)>0)for(s=e;s<t;s+=i)o=ph(s,r[s],r[s+1],o);else for(s=t-i;s>=e;s-=i)o=ph(s,r[s],r[s+1],o);return o&&cn(o,o.next)&&(Tr(o),o=o.next),o}function wi(r,e){if(!r)return r;e||(e=r);var t=r,i;do if(i=!1,!t.steiner&&(cn(t,t.next)||gt(t.prev,t,t.next)===0)){if(Tr(t),t=e=t.prev,t===t.next)break;i=!0}else t=t.next;while(i||t!==e);return e}function xr(r,e,t,i,n,s,o){if(r){!o&&s&&Oc(r,i,n,s);for(var a=r,h,u;r.prev!==r.next;){if(h=r.prev,u=r.next,s?bc(r,i,n,s):xc(r)){e.push(h.i/t|0),e.push(r.i/t|0),e.push(u.i/t|0),Tr(r),r=u.next,a=u.next;continue}if(r=u,r===a){o?o===1?(r=Tc(wi(r),e,t),xr(r,e,t,i,n,s,2)):o===2&&wc(r,e,t,i,n,s):xr(wi(r),e,t,i,n,s,1);break}}}}function xc(r){var e=r.prev,t=r,i=r.next;if(gt(e,t,i)>=0)return!1;for(var n=e.x,s=t.x,o=i.x,a=e.y,h=t.y,u=i.y,l=n<s?n<o?n:o:s<o?s:o,f=a<h?a<u?a:u:h<u?h:u,c=n>s?n>o?n:o:s>o?s:o,d=a>h?a>u?a:u:h>u?h:u,v=i.next;v!==e;){if(v.x>=l&&v.x<=c&&v.y>=f&&v.y<=d&&Yi(n,a,s,h,o,u,v.x,v.y)&&gt(v.prev,v,v.next)>=0)return!1;v=v.next}return!0}function bc(r,e,t,i){var n=r.prev,s=r,o=r.next;if(gt(n,s,o)>=0)return!1;for(var a=n.x,h=s.x,u=o.x,l=n.y,f=s.y,c=o.y,d=a<h?a<u?a:u:h<u?h:u,v=l<f?l<c?l:c:f<c?f:c,p=a>h?a>u?a:u:h>u?h:u,_=l>f?l>c?l:c:f>c?f:c,g=Ss(d,v,e,t,i),y=Ss(p,_,e,t,i),m=r.prevZ,b=r.nextZ;m&&m.z>=g&&b&&b.z<=y;){if(m.x>=d&&m.x<=p&&m.y>=v&&m.y<=_&&m!==n&&m!==o&&Yi(a,l,h,f,u,c,m.x,m.y)&&gt(m.prev,m,m.next)>=0||(m=m.prevZ,b.x>=d&&b.x<=p&&b.y>=v&&b.y<=_&&b!==n&&b!==o&&Yi(a,l,h,f,u,c,b.x,b.y)&&gt(b.prev,b,b.next)>=0))return!1;b=b.nextZ}for(;m&&m.z>=g;){if(m.x>=d&&m.x<=p&&m.y>=v&&m.y<=_&&m!==n&&m!==o&&Yi(a,l,h,f,u,c,m.x,m.y)&&gt(m.prev,m,m.next)>=0)return!1;m=m.prevZ}for(;b&&b.z<=y;){if(b.x>=d&&b.x<=p&&b.y>=v&&b.y<=_&&b!==n&&b!==o&&Yi(a,l,h,f,u,c,b.x,b.y)&&gt(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function Tc(r,e,t){var i=r;do{var n=i.prev,s=i.next.next;!cn(n,s)&&ch(n,i,i.next,s)&&br(n,s)&&br(s,n)&&(e.push(n.i/t|0),e.push(i.i/t|0),e.push(s.i/t|0),Tr(i),Tr(i.next),i=r=s),i=i.next}while(i!==r);return wi(i)}function wc(r,e,t,i,n,s){var o=r;do{for(var a=o.next.next;a!==o.prev;){if(o.i!==a.i&&Mc(o,a)){var h=dh(o,a);o=wi(o,o.next),h=wi(h,h.next),xr(o,e,t,i,n,s,0),xr(h,e,t,i,n,s,0);return}a=a.next}o=o.next}while(o!==r)}function Ec(r,e,t,i){var n=[],s,o,a,h,u;for(s=0,o=e.length;s<o;s++)a=e[s]*i,h=s<o-1?e[s+1]*i:r.length,u=fh(r,a,h,i,!1),u===u.next&&(u.steiner=!0),n.push(Ic(u));for(n.sort(Sc),s=0;s<n.length;s++)t=Pc(n[s],t);return t}function Sc(r,e){return r.x-e.x}function Pc(r,e){var t=Rc(r,e);if(!t)return e;var i=dh(t,r);return wi(i,i.next),wi(t,t.next)}function Rc(r,e){var t=e,i=r.x,n=r.y,s=-1/0,o;do{if(n<=t.y&&n>=t.next.y&&t.next.y!==t.y){var a=t.x+(n-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(a<=i&&a>s&&(s=a,o=t.x<t.next.x?t:t.next,a===i))return o}t=t.next}while(t!==e);if(!o)return null;var h=o,u=o.x,l=o.y,f=1/0,c;t=o;do i>=t.x&&t.x>=u&&i!==t.x&&Yi(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),br(t,r)&&(c<f||c===f&&(t.x>o.x||t.x===o.x&&Cc(o,t)))&&(o=t,f=c)),t=t.next;while(t!==h);return o}function Cc(r,e){return gt(r.prev,r,e.prev)<0&&gt(e.next,r,r.next)<0}function Oc(r,e,t,i){var n=r;do n.z===0&&(n.z=Ss(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,Ac(n)}function Ac(r){var e,t,i,n,s,o,a,h,u=1;do{for(t=r,r=null,s=null,o=0;t;){for(o++,i=t,a=0,e=0;e<u&&(a++,i=i.nextZ,!!i);e++);for(h=u;a>0||h>0&&i;)a!==0&&(h===0||!i||t.z<=i.z)?(n=t,t=t.nextZ,a--):(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(o>1);return r}function Ss(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 Ic(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 Yi(r,e,t,i,n,s,o,a){return(n-o)*(e-a)>=(r-o)*(s-a)&&(r-o)*(i-a)>=(t-o)*(e-a)&&(t-o)*(s-a)>=(n-o)*(i-a)}function Mc(r,e){return r.next.i!==e.i&&r.prev.i!==e.i&&!Nc(r,e)&&(br(r,e)&&br(e,r)&&Dc(r,e)&&(gt(r.prev,r,e.prev)||gt(r,e.prev,e))||cn(r,e)&&gt(r.prev,r,r.next)>0&&gt(e.prev,e,e.next)>0)}function gt(r,e,t){return(e.y-r.y)*(t.x-e.x)-(e.x-r.x)*(t.y-e.y)}function cn(r,e){return r.x===e.x&&r.y===e.y}function ch(r,e,t,i){var n=pn(gt(r,e,t)),s=pn(gt(r,e,i)),o=pn(gt(t,i,r)),a=pn(gt(t,i,e));return!!(n!==s&&o!==a||n===0&&dn(r,t,e)||s===0&&dn(r,i,e)||o===0&&dn(t,r,i)||a===0&&dn(t,e,i))}function dn(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 pn(r){return r>0?1:r<0?-1:0}function Nc(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&&ch(t,t.next,r,e))return!0;t=t.next}while(t!==r);return!1}function br(r,e){return gt(r.prev,r,r.next)<0?gt(r,e,r.next)>=0&&gt(r,r.prev,e)>=0:gt(r,e,r.prev)<0||gt(r,r.next,e)<0}function Dc(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 dh(r,e){var t=new Ps(r.i,r.x,r.y),i=new Ps(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 ph(r,e,t,i){var n=new Ps(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 Tr(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 Ps(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}fn.deviation=function(r,e,t,i){var n=e&&e.length,s=n?e[0]*t:r.length,o=Math.abs(Rs(r,0,s,t));if(n)for(var a=0,h=e.length;a<h;a++){var u=e[a]*t,l=a<h-1?e[a+1]*t:r.length;o-=Math.abs(Rs(r,u,l,t))}var f=0;for(a=0;a<i.length;a+=3){var c=i[a]*t,d=i[a+1]*t,v=i[a+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 o===0&&f===0?0:Math.abs((f-o)/o)};function Rs(r,e,t,i){for(var n=0,s=e,o=t-i;s<t;s+=i)n+=(r[o]-r[s])*(r[s+1]+r[o+1]),o=s;return n}fn.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 o=0;o<e;o++)t.vertices.push(r[n][s][o]);n>0&&(i+=r[n-1].length,t.holes.push(i))}return t};var Cs={exports:{}};(function(r,e){(function(t){var i=e&&!e.nodeType&&e,n=r&&!r.nodeType&&r,s=typeof gs=="object"&&gs;(s.global===s||s.window===s||s.self===s)&&(t=s);var o,a=2147483647,h=36,u=1,l=26,f=38,c=700,d=72,v=128,p="-",_=/^xn--/,g=/[^\x20-\x7E]/,y=/[\x2E\u3002\uFF0E\uFF61]/g,m={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(M){throw RangeError(m[M])}function E(M,C){for(var G=M.length,tt=[];G--;)tt[G]=C(M[G]);return tt}function P(M,C){var G=M.split("@"),tt="";G.length>1&&(tt=G[0]+"@",M=G[1]),M=M.replace(y,".");var V=M.split("."),nt=E(V,C).join(".");return tt+nt}function O(M){for(var C=[],G=0,tt=M.length,V,nt;G<tt;)V=M.charCodeAt(G++),V>=55296&&V<=56319&&G<tt?(nt=M.charCodeAt(G++),(nt&64512)==56320?C.push(((V&1023)<<10)+(nt&1023)+65536):(C.push(V),G--)):C.push(V);return C}function D(M){return E(M,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(M){return M-48<10?M-22:M-65<26?M-65:M-97<26?M-97:h}function U(M,C){return M+22+75*(M<26)-((C!=0)<<5)}function I(M,C,G){var tt=0;for(M=G?x(M/c):M>>1,M+=x(M/C);M>b*l>>1;tt+=h)M=x(M/b);return x(tt+(b+1)*M/(M+f))}function A(M){var C=[],G=M.length,tt,V=0,nt=v,dt=d,pt,Pt,Lt,vt,st,H,$,Z,xt;for(pt=M.lastIndexOf(p),pt<0&&(pt=0),Pt=0;Pt<pt;++Pt)M.charCodeAt(Pt)>=128&&S("not-basic"),C.push(M.charCodeAt(Pt));for(Lt=pt>0?pt+1:0;Lt<G;){for(vt=V,st=1,H=h;Lt>=G&&S("invalid-input"),$=N(M.charCodeAt(Lt++)),($>=h||$>x((a-V)/st))&&S("overflow"),V+=$*st,Z=H<=dt?u:H>=dt+l?l:H-dt,!($<Z);H+=h)xt=h-Z,st>x(a/xt)&&S("overflow"),st*=xt;tt=C.length+1,dt=I(V-vt,tt,vt==0),x(V/tt)>a-nt&&S("overflow"),nt+=x(V/tt),V%=tt,C.splice(V++,0,nt)}return D(C)}function B(M){var C,G,tt,V,nt,dt,pt,Pt,Lt,vt,st,H=[],$,Z,xt,Rt;for(M=O(M),$=M.length,C=v,G=0,nt=d,dt=0;dt<$;++dt)st=M[dt],st<128&&H.push(T(st));for(tt=V=H.length,V&&H.push(p);tt<$;){for(pt=a,dt=0;dt<$;++dt)st=M[dt],st>=C&&st<pt&&(pt=st);for(Z=tt+1,pt-C>x((a-G)/Z)&&S("overflow"),G+=(pt-C)*Z,C=pt,dt=0;dt<$;++dt)if(st=M[dt],st<C&&++G>a&&S("overflow"),st==C){for(Pt=G,Lt=h;vt=Lt<=nt?u:Lt>=nt+l?l:Lt-nt,!(Pt<vt);Lt+=h)Rt=Pt-vt,xt=h-vt,H.push(T(U(vt+Rt%xt,0))),Pt=x(Rt/xt);H.push(T(U(Pt,0))),nt=I(G,Z,tt==V),G=0,++tt}++G,++C}return H.join("")}function K(M){return P(M,function(C){return _.test(C)?A(C.slice(4).toLowerCase()):C})}function z(M){return P(M,function(C){return g.test(C)?"xn--"+B(C):C})}if(o={version:"1.3.2",ucs2:{decode:O,encode:D},decode:A,encode:B,toASCII:z,toUnicode:K},i&&n)if(r.exports==i)n.exports=o;else for(w in o)o.hasOwnProperty(w)&&(i[w]=o[w]);else t.punycode=o})(gs)})(Cs,Cs.exports);var Fc={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}},wr={};function Bc(r,e){return Object.prototype.hasOwnProperty.call(r,e)}var Lc=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 o=1e3;i&&typeof i.maxKeys=="number"&&(o=i.maxKeys);var a=r.length;o>0&&a>o&&(a=o);for(var h=0;h<a;++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),Bc(n,d)?Array.isArray(n[d])?n[d].push(v):n[d]=[n[d],v]:n[d]=v}return n},Er=function(r){switch(typeof r){case"string":return r;case"boolean":return r?"true":"false";case"number":return isFinite(r)?r:"";default:return""}},Gc=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(Er(n))+t;return Array.isArray(r[n])?r[n].map(function(o){return s+encodeURIComponent(Er(o))}).join(e):s+encodeURIComponent(Er(r[n]))}).join(e):i?encodeURIComponent(Er(i))+t+encodeURIComponent(Er(r)):""};wr.decode=wr.parse=Lc,wr.encode=wr.stringify=Gc;var Uc=Cs.exports,Be=Fc,kc=vn,Xc=Jc,Hc=$c;function be(){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 Wc=/^([a-z0-9.+-]+:)/i,zc=/:[0-9]*$/,Yc=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Vc=["<",">",'"',"`"," ","\r",`
6
+ `," "],jc=["{","}","|","\\","^","`"].concat(Vc),Os=["'"].concat(jc),vh=["%","/","?",";","#"].concat(Os),_h=["/","?","#"],Zc=255,gh=/^[+a-z0-9A-Z_-]{0,63}$/,qc=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Kc={javascript:!0,"javascript:":!0},As={javascript:!0,"javascript:":!0},Vi={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},Is=wr;function vn(r,e,t){if(r&&Be.isObject(r)&&r instanceof be)return r;var i=new be;return i.parse(r,e,t),i}be.prototype.parse=function(r,e,t){if(!Be.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),o=/\\/g;s[0]=s[0].replace(o,"/"),r=s.join(n);var a=r;if(a=a.trim(),!t&&r.split("#").length===1){var h=Yc.exec(a);if(h)return this.path=a,this.href=a,this.pathname=h[1],h[2]?(this.search=h[2],e?this.query=Is.parse(this.search.substr(1)):this.query=this.search.substr(1)):e&&(this.search="",this.query={}),this}var u=Wc.exec(a);if(u){u=u[0];var l=u.toLowerCase();this.protocol=l,a=a.substr(u.length)}if(t||u||a.match(/^\/\/[^@\/]+@[^@\/]+/)){var f=a.substr(0,2)==="//";f&&!(u&&As[u])&&(a=a.substr(2),this.slashes=!0)}if(!As[u]&&(f||u&&!Vi[u])){for(var c=-1,d=0;d<_h.length;d++){var v=a.indexOf(_h[d]);v!==-1&&(c===-1||v<c)&&(c=v)}var p,_;c===-1?_=a.lastIndexOf("@"):_=a.lastIndexOf("@",c),_!==-1&&(p=a.slice(0,_),a=a.slice(_+1),this.auth=decodeURIComponent(p)),c=-1;for(var d=0;d<vh.length;d++){var v=a.indexOf(vh[d]);v!==-1&&(c===-1||v<c)&&(c=v)}c===-1&&(c=a.length),this.host=a.slice(0,c),a=a.slice(c),this.parseHost(),this.hostname=this.hostname||"";var g=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!g)for(var y=this.hostname.split(/\./),d=0,m=y.length;d<m;d++){var b=y[d];if(b&&!b.match(gh)){for(var x="",T=0,w=b.length;T<w;T++)b.charCodeAt(T)>127?x+="x":x+=b[T];if(!x.match(gh)){var S=y.slice(0,d),E=y.slice(d+1),P=b.match(qc);P&&(S.push(P[1]),E.unshift(P[2])),E.length&&(a="/"+E.join(".")+a),this.hostname=S.join(".");break}}}this.hostname.length>Zc?this.hostname="":this.hostname=this.hostname.toLowerCase(),g||(this.hostname=Uc.toASCII(this.hostname));var O=this.port?":"+this.port:"",D=this.hostname||"";this.host=D+O,this.href+=this.host,g&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),a[0]!=="/"&&(a="/"+a))}if(!Kc[l])for(var d=0,m=Os.length;d<m;d++){var N=Os[d];if(a.indexOf(N)!==-1){var U=encodeURIComponent(N);U===N&&(U=escape(N)),a=a.split(N).join(U)}}var I=a.indexOf("#");I!==-1&&(this.hash=a.substr(I),a=a.slice(0,I));var A=a.indexOf("?");if(A!==-1?(this.search=a.substr(A),this.query=a.substr(A+1),e&&(this.query=Is.parse(this.query)),a=a.slice(0,A)):e&&(this.search="",this.query={}),a&&(this.pathname=a),Vi[l]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var O=this.pathname||"",B=this.search||"";this.path=O+B}return this.href=this.format(),this};function $c(r){return Be.isString(r)&&(r=vn(r)),r instanceof be?r.format():be.prototype.format.call(r)}be.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&&Be.isObject(this.query)&&Object.keys(this.query).length&&(s=Is.stringify(this.query));var o=this.search||s&&"?"+s||"";return e&&e.substr(-1)!==":"&&(e+=":"),this.slashes||(!e||Vi[e])&&n!==!1?(n="//"+(n||""),t&&t.charAt(0)!=="/"&&(t="/"+t)):n||(n=""),i&&i.charAt(0)!=="#"&&(i="#"+i),o&&o.charAt(0)!=="?"&&(o="?"+o),t=t.replace(/[?#]/g,function(a){return encodeURIComponent(a)}),o=o.replace("#","%23"),e+n+t+o+i};function Jc(r,e){return vn(r,!1,!0).resolve(e)}be.prototype.resolve=function(r){return this.resolveObject(vn(r,!1,!0)).format()},be.prototype.resolveObject=function(r){if(Be.isString(r)){var e=new be;e.parse(r,!1,!0),r=e}for(var t=new be,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 o=Object.keys(r),a=0;a<o.length;a++){var h=o[a];h!=="protocol"&&(t[h]=r[h])}return Vi[t.protocol]&&t.hostname&&!t.pathname&&(t.path=t.pathname="/"),t.href=t.format(),t}if(r.protocol&&r.protocol!==t.protocol){if(!Vi[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&&!As[r.protocol]){for(var m=(r.pathname||"").split("/");m.length&&!(r.host=m.shift()););r.host||(r.host=""),r.hostname||(r.hostname=""),m[0]!==""&&m.unshift(""),m.length<2&&m.unshift(""),t.pathname=m.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,g=_,y=t.pathname&&t.pathname.split("/")||[],m=r.pathname&&r.pathname.split("/")||[],b=t.protocol&&!Vi[t.protocol];if(b&&(t.hostname="",t.port=null,t.host&&(y[0]===""?y[0]=t.host:y.unshift(t.host)),t.host="",r.protocol&&(r.hostname=null,r.port=null,r.host&&(m[0]===""?m[0]=r.host:m.unshift(r.host)),r.host=null),_=_&&(m[0]===""||y[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,y=m;else if(m.length)y||(y=[]),y.pop(),y=y.concat(m),t.search=r.search,t.query=r.query;else if(!Be.isNullOrUndefined(r.search)){if(b){t.hostname=t.host=y.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,(!Be.isNull(t.pathname)||!Be.isNull(t.search))&&(t.path=(t.pathname?t.pathname:"")+(t.search?t.search:"")),t.href=t.format(),t}if(!y.length)return t.pathname=null,t.search?t.path="/"+t.search:t.path=null,t.href=t.format(),t;for(var T=y.slice(-1)[0],w=(t.host||r.host||y.length>1)&&(T==="."||T==="..")||T==="",S=0,E=y.length;E>=0;E--)T=y[E],T==="."?y.splice(E,1):T===".."?(y.splice(E,1),S++):S&&(y.splice(E,1),S--);if(!_&&!g)for(;S--;S)y.unshift("..");_&&y[0]!==""&&(!y[0]||y[0].charAt(0)!=="/")&&y.unshift(""),w&&y.join("/").substr(-1)!=="/"&&y.push("");var P=y[0]===""||y[0]&&y[0].charAt(0)==="/";if(b){t.hostname=t.host=P?"":y.length?y.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&&y.length,_&&!P&&y.unshift(""),y.length?t.pathname=y.join("/"):(t.pathname=null,t.path=null),(!Be.isNull(t.pathname)||!Be.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},be.prototype.parseHost=function(){var r=this.host,e=zc.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 ji={parse:kc,format:Hc,resolve:Xc};L.RETINA_PREFIX=/@([0-9\.]+)x/,L.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var Ms=!1,mh="6.5.8";function Qc(){Ms=!0}function td(r){var e;if(!Ms){if(L.ADAPTER.getNavigator().userAgent.toLowerCase().indexOf("chrome")>-1){var t=[`
7
7
  %c %c %c PixiJS `+mh+" - ✰ "+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 "+mh+" - "+r+" - http://www.pixijs.com/");Ms=!0}}var Ds;function ed(){return typeof Ds>"u"&&(Ds=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}}()),Ds}var id="#f0f8ff",rd="#faebd7",nd="#00ffff",sd="#7fffd4",od="#f0ffff",ad="#f5f5dc",hd="#ffe4c4",ud="#000000",ld="#ffebcd",fd="#0000ff",cd="#8a2be2",dd="#a52a2a",pd="#deb887",vd="#5f9ea0",_d="#7fff00",gd="#d2691e",md="#ff7f50",yd="#6495ed",xd="#fff8dc",bd="#dc143c",Td="#00ffff",wd="#00008b",Ed="#008b8b",Sd="#b8860b",Pd="#a9a9a9",Rd="#006400",Cd="#a9a9a9",Od="#bdb76b",Ad="#8b008b",Id="#556b2f",Md="#ff8c00",Dd="#9932cc",Nd="#8b0000",Fd="#e9967a",Bd="#8fbc8f",Ld="#483d8b",Gd="#2f4f4f",Ud="#2f4f4f",kd="#00ced1",Xd="#9400d3",Hd="#ff1493",Wd="#00bfff",zd="#696969",Yd="#696969",Vd="#1e90ff",jd="#b22222",Zd="#fffaf0",qd="#228b22",Kd="#ff00ff",$d="#dcdcdc",Jd="#f8f8ff",Qd="#daa520",tp="#ffd700",ep="#808080",ip="#008000",rp="#adff2f",np="#808080",sp="#f0fff0",op="#ff69b4",ap="#cd5c5c",hp="#4b0082",up="#fffff0",lp="#f0e68c",fp="#fff0f5",cp="#e6e6fa",dp="#7cfc00",pp="#fffacd",vp="#add8e6",_p="#f08080",gp="#e0ffff",mp="#fafad2",yp="#d3d3d3",xp="#90ee90",bp="#d3d3d3",Tp="#ffb6c1",wp="#ffa07a",Ep="#20b2aa",Sp="#87cefa",Pp="#778899",Rp="#778899",Cp="#b0c4de",Op="#ffffe0",Ap="#00ff00",Ip="#32cd32",Mp="#faf0e6",Dp="#ff00ff",Np="#800000",Fp="#66cdaa",Bp="#0000cd",Lp="#ba55d3",Gp="#9370db",Up="#3cb371",kp="#7b68ee",Xp="#00fa9a",Hp="#48d1cc",Wp="#c71585",zp="#191970",Yp="#f5fffa",Vp="#ffe4e1",jp="#ffe4b5",Zp="#ffdead",qp="#000080",Kp="#fdf5e6",$p="#808000",Jp="#6b8e23",Qp="#ffa500",tv="#ff4500",ev="#da70d6",iv="#eee8aa",rv="#98fb98",nv="#afeeee",sv="#db7093",ov="#ffefd5",av="#ffdab9",hv="#cd853f",uv="#ffc0cb",lv="#dda0dd",fv="#b0e0e6",cv="#800080",dv="#663399",pv="#ff0000",vv="#bc8f8f",_v="#4169e1",gv="#8b4513",mv="#fa8072",yv="#f4a460",xv="#2e8b57",bv="#fff5ee",Tv="#a0522d",wv="#c0c0c0",Ev="#87ceeb",Sv="#6a5acd",Pv="#708090",Rv="#708090",Cv="#fffafa",Ov="#00ff7f",Av="#4682b4",Iv="#d2b48c",Mv="#008080",Dv="#d8bfd8",Nv="#ff6347",Fv="#40e0d0",Bv="#ee82ee",Lv="#f5deb3",Gv="#ffffff",Uv="#f5f5f5",kv="#ffff00",Xv="#9acd32",Hv={aliceblue:id,antiquewhite:rd,aqua:nd,aquamarine:sd,azure:od,beige:ad,bisque:hd,black:ud,blanchedalmond:ld,blue:fd,blueviolet:cd,brown:dd,burlywood:pd,cadetblue:vd,chartreuse:_d,chocolate:gd,coral:md,cornflowerblue:yd,cornsilk:xd,crimson:bd,cyan:Td,darkblue:wd,darkcyan:Ed,darkgoldenrod:Sd,darkgray:Pd,darkgreen:Rd,darkgrey:Cd,darkkhaki:Od,darkmagenta:Ad,darkolivegreen:Id,darkorange:Md,darkorchid:Dd,darkred:Nd,darksalmon:Fd,darkseagreen:Bd,darkslateblue:Ld,darkslategray:Gd,darkslategrey:Ud,darkturquoise:kd,darkviolet:Xd,deeppink:Hd,deepskyblue:Wd,dimgray:zd,dimgrey:Yd,dodgerblue:Vd,firebrick:jd,floralwhite:Zd,forestgreen:qd,fuchsia:Kd,gainsboro:$d,ghostwhite:Jd,goldenrod:Qd,gold:tp,gray:ep,green:ip,greenyellow:rp,grey:np,honeydew:sp,hotpink:op,indianred:ap,indigo:hp,ivory:up,khaki:lp,lavenderblush:fp,lavender:cp,lawngreen:dp,lemonchiffon:pp,lightblue:vp,lightcoral:_p,lightcyan:gp,lightgoldenrodyellow:mp,lightgray:yp,lightgreen:xp,lightgrey:bp,lightpink:Tp,lightsalmon:wp,lightseagreen:Ep,lightskyblue:Sp,lightslategray:Pp,lightslategrey:Rp,lightsteelblue:Cp,lightyellow:Op,lime:Ap,limegreen:Ip,linen:Mp,magenta:Dp,maroon:Np,mediumaquamarine:Fp,mediumblue:Bp,mediumorchid:Lp,mediumpurple:Gp,mediumseagreen:Up,mediumslateblue:kp,mediumspringgreen:Xp,mediumturquoise:Hp,mediumvioletred:Wp,midnightblue:zp,mintcream:Yp,mistyrose:Vp,moccasin:jp,navajowhite:Zp,navy:qp,oldlace:Kp,olive:$p,olivedrab:Jp,orange:Qp,orangered:tv,orchid:ev,palegoldenrod:iv,palegreen:rv,paleturquoise:nv,palevioletred:sv,papayawhip:ov,peachpuff:av,peru:hv,pink:uv,plum:lv,powderblue:fv,purple:cv,rebeccapurple:dv,red:pv,rosybrown:vv,royalblue:_v,saddlebrown:gv,salmon:mv,sandybrown:yv,seagreen:xv,seashell:bv,sienna:Tv,silver:wv,skyblue:Ev,slateblue:Sv,slategray:Pv,slategrey:Rv,snow:Cv,springgreen:Ov,steelblue:Av,tan:Iv,teal:Mv,thistle:Dv,tomato:Nv,turquoise:Fv,violet:Bv,wheat:Lv,white:Gv,whitesmoke:Uv,yellow:kv,yellowgreen:Xv};function Zi(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 yh(r){var e=r.toString(16);return e="000000".substring(0,6-e.length)+e,"#"+e}function xh(r){return typeof r=="string"&&(r=Hv[r.toLowerCase()]||r,r[0]==="#"&&(r=r.slice(1))),parseInt(r,16)}function Wv(){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 bh=Wv();function Th(r,e){return bh[e?1:0][r]}function zv(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 Ns(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 wh(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 Yv(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 Eh(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 _n(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 Sh(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 qi(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 Ki(r){return r===0?0:r<0?-1:1}var Vv=0;function Ei(){return++Vv}var Rh={};function Te(r,e,t){if(t===void 0&&(t=3),!Rh[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 "+mh+" - "+r+" - http://www.pixijs.com/");Ms=!0}}var Ns;function ed(){return typeof Ns>"u"&&(Ns=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}}()),Ns}var id="#f0f8ff",rd="#faebd7",nd="#00ffff",sd="#7fffd4",od="#f0ffff",ad="#f5f5dc",hd="#ffe4c4",ud="#000000",ld="#ffebcd",fd="#0000ff",cd="#8a2be2",dd="#a52a2a",pd="#deb887",vd="#5f9ea0",_d="#7fff00",gd="#d2691e",md="#ff7f50",yd="#6495ed",xd="#fff8dc",bd="#dc143c",Td="#00ffff",wd="#00008b",Ed="#008b8b",Sd="#b8860b",Pd="#a9a9a9",Rd="#006400",Cd="#a9a9a9",Od="#bdb76b",Ad="#8b008b",Id="#556b2f",Md="#ff8c00",Nd="#9932cc",Dd="#8b0000",Fd="#e9967a",Bd="#8fbc8f",Ld="#483d8b",Gd="#2f4f4f",Ud="#2f4f4f",kd="#00ced1",Xd="#9400d3",Hd="#ff1493",Wd="#00bfff",zd="#696969",Yd="#696969",Vd="#1e90ff",jd="#b22222",Zd="#fffaf0",qd="#228b22",Kd="#ff00ff",$d="#dcdcdc",Jd="#f8f8ff",Qd="#daa520",tp="#ffd700",ep="#808080",ip="#008000",rp="#adff2f",np="#808080",sp="#f0fff0",op="#ff69b4",ap="#cd5c5c",hp="#4b0082",up="#fffff0",lp="#f0e68c",fp="#fff0f5",cp="#e6e6fa",dp="#7cfc00",pp="#fffacd",vp="#add8e6",_p="#f08080",gp="#e0ffff",mp="#fafad2",yp="#d3d3d3",xp="#90ee90",bp="#d3d3d3",Tp="#ffb6c1",wp="#ffa07a",Ep="#20b2aa",Sp="#87cefa",Pp="#778899",Rp="#778899",Cp="#b0c4de",Op="#ffffe0",Ap="#00ff00",Ip="#32cd32",Mp="#faf0e6",Np="#ff00ff",Dp="#800000",Fp="#66cdaa",Bp="#0000cd",Lp="#ba55d3",Gp="#9370db",Up="#3cb371",kp="#7b68ee",Xp="#00fa9a",Hp="#48d1cc",Wp="#c71585",zp="#191970",Yp="#f5fffa",Vp="#ffe4e1",jp="#ffe4b5",Zp="#ffdead",qp="#000080",Kp="#fdf5e6",$p="#808000",Jp="#6b8e23",Qp="#ffa500",tv="#ff4500",ev="#da70d6",iv="#eee8aa",rv="#98fb98",nv="#afeeee",sv="#db7093",ov="#ffefd5",av="#ffdab9",hv="#cd853f",uv="#ffc0cb",lv="#dda0dd",fv="#b0e0e6",cv="#800080",dv="#663399",pv="#ff0000",vv="#bc8f8f",_v="#4169e1",gv="#8b4513",mv="#fa8072",yv="#f4a460",xv="#2e8b57",bv="#fff5ee",Tv="#a0522d",wv="#c0c0c0",Ev="#87ceeb",Sv="#6a5acd",Pv="#708090",Rv="#708090",Cv="#fffafa",Ov="#00ff7f",Av="#4682b4",Iv="#d2b48c",Mv="#008080",Nv="#d8bfd8",Dv="#ff6347",Fv="#40e0d0",Bv="#ee82ee",Lv="#f5deb3",Gv="#ffffff",Uv="#f5f5f5",kv="#ffff00",Xv="#9acd32",Hv={aliceblue:id,antiquewhite:rd,aqua:nd,aquamarine:sd,azure:od,beige:ad,bisque:hd,black:ud,blanchedalmond:ld,blue:fd,blueviolet:cd,brown:dd,burlywood:pd,cadetblue:vd,chartreuse:_d,chocolate:gd,coral:md,cornflowerblue:yd,cornsilk:xd,crimson:bd,cyan:Td,darkblue:wd,darkcyan:Ed,darkgoldenrod:Sd,darkgray:Pd,darkgreen:Rd,darkgrey:Cd,darkkhaki:Od,darkmagenta:Ad,darkolivegreen:Id,darkorange:Md,darkorchid:Nd,darkred:Dd,darksalmon:Fd,darkseagreen:Bd,darkslateblue:Ld,darkslategray:Gd,darkslategrey:Ud,darkturquoise:kd,darkviolet:Xd,deeppink:Hd,deepskyblue:Wd,dimgray:zd,dimgrey:Yd,dodgerblue:Vd,firebrick:jd,floralwhite:Zd,forestgreen:qd,fuchsia:Kd,gainsboro:$d,ghostwhite:Jd,goldenrod:Qd,gold:tp,gray:ep,green:ip,greenyellow:rp,grey:np,honeydew:sp,hotpink:op,indianred:ap,indigo:hp,ivory:up,khaki:lp,lavenderblush:fp,lavender:cp,lawngreen:dp,lemonchiffon:pp,lightblue:vp,lightcoral:_p,lightcyan:gp,lightgoldenrodyellow:mp,lightgray:yp,lightgreen:xp,lightgrey:bp,lightpink:Tp,lightsalmon:wp,lightseagreen:Ep,lightskyblue:Sp,lightslategray:Pp,lightslategrey:Rp,lightsteelblue:Cp,lightyellow:Op,lime:Ap,limegreen:Ip,linen:Mp,magenta:Np,maroon:Dp,mediumaquamarine:Fp,mediumblue:Bp,mediumorchid:Lp,mediumpurple:Gp,mediumseagreen:Up,mediumslateblue:kp,mediumspringgreen:Xp,mediumturquoise:Hp,mediumvioletred:Wp,midnightblue:zp,mintcream:Yp,mistyrose:Vp,moccasin:jp,navajowhite:Zp,navy:qp,oldlace:Kp,olive:$p,olivedrab:Jp,orange:Qp,orangered:tv,orchid:ev,palegoldenrod:iv,palegreen:rv,paleturquoise:nv,palevioletred:sv,papayawhip:ov,peachpuff:av,peru:hv,pink:uv,plum:lv,powderblue:fv,purple:cv,rebeccapurple:dv,red:pv,rosybrown:vv,royalblue:_v,saddlebrown:gv,salmon:mv,sandybrown:yv,seagreen:xv,seashell:bv,sienna:Tv,silver:wv,skyblue:Ev,slateblue:Sv,slategray:Pv,slategrey:Rv,snow:Cv,springgreen:Ov,steelblue:Av,tan:Iv,teal:Mv,thistle:Nv,tomato:Dv,turquoise:Fv,violet:Bv,wheat:Lv,white:Gv,whitesmoke:Uv,yellow:kv,yellowgreen:Xv};function Zi(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 yh(r){var e=r.toString(16);return e="000000".substring(0,6-e.length)+e,"#"+e}function xh(r){return typeof r=="string"&&(r=Hv[r.toLowerCase()]||r,r[0]==="#"&&(r=r.slice(1))),parseInt(r,16)}function Wv(){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 bh=Wv();function Th(r,e){return bh[e?1:0][r]}function zv(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 Ds(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 wh(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 Yv(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 Eh(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 _n(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 Sh(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 qi(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 Ki(r){return r===0?0:r<0?-1:1}var Vv=0;function Ei(){return++Vv}var Rh={};function Te(r,e,t){if(t===void 0&&(t=3),!Rh[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))),Rh[e]=!0}}var Ch={},Ye=Object.create(null),Si=Object.create(null),Oh=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 jv(r){var e=r.width,t=r.height,i=r.getContext("2d",{willReadFrequently:!0}),n=i.getImageData(0,0,e,t),s=n.data,o=s.length,a={top:null,left:null,right:null,bottom:null},h=null,u,l,f;for(u=0;u<o;u+=4)s[u+3]!==0&&(l=u/4%e,f=~~(u/4/e),a.top===null&&(a.top=f),(a.left===null||l<a.left)&&(a.left=l),(a.right===null||a.right<l)&&(a.right=l+1),(a.bottom===null||a.bottom<f)&&(a.bottom=f));return a.top!==null&&(e=a.right-a.left,t=a.bottom-a.top+1,h=i.getImageData(a.left,a.top,e,t)),{height:t,width:e,data:h}}var gn;function Zv(r,e){if(e===void 0&&(e=globalThis.location),r.indexOf("data:")===0)return"";e=e||globalThis.location,gn||(gn=document.createElement("a")),gn.href=r;var t=ji.parse(gn.href),i=!t.port&&e.port===""||t.port===e.port;return t.hostname!==e.hostname||!i||t.protocol!==e.protocol?"anonymous":""}function mn(r,e){var t=L.RETINA_PREFIX.exec(r);return t?parseFloat(t[1]):e!==void 0?e:1}L.SORTABLE_CHILDREN=!1;var yn=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?J.EMPTY:(e=e||new J(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,o=e.d,a=e.tx,h=e.ty,u=i*t.x+s*t.y+a,l=n*t.x+o*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,o=e[0],a=e[1];t=o<t?o:t,i=a<i?a:i,n=o>n?o:n,s=a>s?a:s,o=e[2],a=e[3],t=o<t?o:t,i=a<i?a:i,n=o>n?o:n,s=a>s?a:s,o=e[4],a=e[5],t=o<t?o:t,i=a<i?a:i,n=o>n?o:n,s=a>s?a:s,o=e[6],a=e[7],t=o<t?o:t,i=a<i?a:i,n=o>n?o:n,s=a>s?a: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 o=e.a,a=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,_=o*t+h*i+l,g=a*t+u*i+f;c=_<c?_:c,d=g<d?g:d,v=_>v?_:v,p=g>p?g:p,_=o*n+h*i+l,g=a*n+u*i+f,c=_<c?_:c,d=g<d?g:d,v=_>v?_:v,p=g>p?g:p,_=o*t+h*s+l,g=a*t+u*s+f,c=_<c?_:c,d=g<d?g:d,v=_>v?_:v,p=g>p?g:p,_=o*n+h*s+l,g=a*n+u*s+f,c=_<c?_:c,d=g<d?g:d,v=_>v?_:v,p=g>p?g: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,o=this.maxX,a=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,o=u>o?u:o,a=l>a?l:a}this.minX=n,this.minY=s,this.maxX=o,this.maxY=a},r.prototype.addVertices=function(e,t,i,n){this.addVerticesMatrix(e.worldTransform,t,i,n)},r.prototype.addVerticesMatrix=function(e,t,i,n,s,o){s===void 0&&(s=0),o===void 0&&(o=s);for(var a=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,g=i;g<n;g+=2){var y=t[g],m=t[g+1],b=a*y+u*m+f,x=l*m+h*y+c;d=Math.min(d,b-s),p=Math.max(p,b+s),v=Math.min(v,x-o),_=Math.max(_,x+o)}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,o=e.maxY<t.maxY?e.maxY:t.maxY;if(i<=s&&n<=o){var a=this.minX,h=this.minY,u=this.maxX,l=this.maxY;this.minX=i<a?i:a,this.minY=n<h?n:h,this.maxX=s>u?s:u,this.maxY=o>l?o: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,o=e.maxY<t.y+t.height?e.maxY:t.y+t.height;if(i<=s&&n<=o){var a=this.minX,h=this.minY,u=this.maxX,l=this.maxY;this.minX=i<a?i:a,this.minY=n<h?n:h,this.maxX=s>u?s:u,this.maxY=o>l?o: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,o){e-=s,t-=o,i+=s,n+=o,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 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 Bs(r,e){Fs(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Ct=function(r){Bs(e,r);function e(){var t=r.call(this)||this;return t.tempDisplayObjectParent=null,t.transform=new Ua,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 yn,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 J),i=this._boundsRect),this._bounds.getRectangle(i)},e.prototype.getLocalBounds=function(t){t||(this._localBoundsRect||(this._localBoundsRect=new J),t=this._localBoundsRect),this._localBounds||(this._localBounds=new yn);var i=this.transform,n=this.parent;this.parent=null,this.transform=this._tempDisplayObjectParent.transform;var s=this._bounds,o=this._boundsID;this._bounds=this._localBounds;var a=this.getBounds(!1,t);return this.parent=n,this.transform=i,this._bounds=s,this._bounds.updateID+=this._boundsID-o,a},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,o,a,h,u,l){return t===void 0&&(t=0),i===void 0&&(i=0),n===void 0&&(n=1),s===void 0&&(s=1),o===void 0&&(o=0),a===void 0&&(a=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=o,this.skew.x=a,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 Ah),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*Bf},set:function(t){this.transform.rotation=t*Lf},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}(yr),Ah=function(r){Bs(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.sortDirty=null,t}return e}(Ct);Ct.prototype.displayObjectUpdateTransform=Ct.prototype.updateTransform;function qv(r,e){return r.zIndex===e.zIndex?r._lastSortedIndex-e._lastSortedIndex:r.zIndex-e.zIndex}var ht=function(r){Bs(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 o=i[0];o.parent&&o.parent.removeChild(o),o.parent=this,this.sortDirty=!0,o.transform._parentID=-1,this.children.push(o),this._boundsID++,this.onChildrenChange(this.children.length-1),this.emit("childAdded",o,this,this.children.length-1),o.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);qi(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 o=i[0],a=this.children.indexOf(o);if(a===-1)return null;o.parent=null,o.transform._parentID=-1,qi(this.children,a,1),this._boundsID++,this.onChildrenChange(a),o.emit("removed",this),this.emit("childRemoved",o,this,a)}return i[0]},e.prototype.removeChildAt=function(t){var i=this.getChildAt(t);return i.parent=null,i.transform._parentID=-1,qi(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,o=s-n,a;if(o>0&&o<=s){a=this.children.splice(n,o);for(var h=0;h<a.length;++h)a[h].parent=null,a[h].transform&&(a[h].transform._parentID=-1);this._boundsID++,this.onChildrenChange(t);for(var h=0;h<a.length;++h)a[h].emit("removed",this),this.emit("childRemoved",a[h],this,h);return a}else if(o===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(qv),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,o=this.children.length;s<o;++s){var a=this.children[s];a.visible&&a.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 o=0,a=this.children.length;o<a;++o){var h=this.children[o],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 o=i&&this._enabledFilters&&this._enabledFilters.length||n&&(!n.isMaskData||n.enabled&&(n.autoDetect||n.type!==It.NONE));if(o&&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,a=this.children.length;s<a;++s)this.children[s].render(t)}o&&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}(Ct);ht.prototype.containerUpdateTransform=ht.prototype.updateTransform;var Sr=function(){return Sr=Object.assign||function(e){for(var t=arguments,i,n=1,s=arguments.length;n<s;n++){i=t[n];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(e[o]=i[o])}return e},Sr.apply(this,arguments)},at;(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"})(at||(at={}));var Ih=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=Sr(Sr({},e),{ref:r})}if(typeof r=="object")r=Sr({},r);else throw new Error("Invalid extension type");return typeof r.type=="string"&&(r.type=[r.type]),r},Ve={_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(Ih).forEach(function(n){n.type.forEach(function(s){var o,a;return(a=(o=e._removeHandlers)[s])===null||a===void 0?void 0:a.call(o,n)})}),this},add:function(){for(var r=arguments,e=this,t=[],i=0;i<arguments.length;i++)t[i]=r[i];return t.map(Ih).forEach(function(n){n.type.forEach(function(s){var o=e._addHandlers,a=e._queue;o[s]?o[s](n):(a[s]=a[s]||[],a[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(o){return e(o)}),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===at.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 Xt=function(){function r(e){this.items=[],this._name=e,this._aliasCount=0}return r.prototype.emit=function(e,t,i,n,s,o,a,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,o,a,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(Xt.prototype,{dispatch:{value:Xt.prototype.emit},run:{value:Xt.prototype.emit}});L.TARGET_FPMS=.06;var ee;(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"})(ee||(ee={}));var Ls=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}(),Ut=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 Ls(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=ee.NORMAL),this._addListener(new Ls(e,t,i))},r.prototype.addOnce=function(e,t,i){return i===void 0&&(i=ee.NORMAL),this._addListener(new Ls(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}(),Kv=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,ee.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?Ut.shared:new Ut,e.autoStart&&this.start()},r.destroy=function(){if(this._ticker){var e=this._ticker;this.ticker=null,e.destroy()}},r.extension=at.Application,r}();L.PREFER_ENV=Fe.any?We.WEBGL:We.WEBGL2,L.STRICT_TEXTURE_CACHE=!1;var Gs=[];function Mh(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=Gs.length-1;n>=0;--n){var s=Gs[n];if(s.test&&s.test(r,t))return new s(r,e)}throw new Error("Unrecognized source type to auto-detect Resource")}var Us=function(r,e){return Us=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])},Us(r,e)};function ft(r,e){Us(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var ks=function(){return ks=Object.assign||function(e){for(var t=arguments,i,n=1,s=arguments.length;n<s;n++){i=t[n];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(e[o]=i[o])}return e},ks.apply(this,arguments)};function $v(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 Pr=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 Xt("setRealSize"),this.onUpdate=new Xt("update"),this.onError=new Xt("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}(),Rr=function(r){ft(e,r);function e(t,i){var n=this,s=i||{},o=s.width,a=s.height;if(!o||!a)throw new Error("BufferResource width or height invalid");return n=r.call(this,o,a)||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===ye.UNPACK);var o=i.realWidth,a=i.realHeight;return n.width===o&&n.height===a?s.texSubImage2D(i.target,0,0,0,o,a,i.format,n.type,this.data):(n.width=o,n.height=a,s.texImage2D(i.target,0,n.internalFormat,o,a,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}(Pr),Jv={scaleMode:Me.NEAREST,format:F.RGBA,alphaMode:ye.NPM},rt=function(r){ft(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,o=i.mipmap,a=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 Pr)&&(t=Mh(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=o!==void 0?o:L.MIPMAP_TEXTURES,n.anisotropicLevel=a!==void 0?a:L.ANISOTROPIC_LEVEL,n._wrapMode=f||L.WRAP_MODE,n._scaleMode=h!==void 0?h:L.SCALE_MODE,n.format=c||F.RGBA,n.type=d||k.UNSIGNED_BYTE,n.target=v||Ti.TEXTURE_2D,n.alphaMode=s!==void 0?s:ye.UNPACK,n.uid=Ei(),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=Sh(this.realWidth)&&Sh(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 Si[this.cacheId],delete Ye[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",o=null;if(s)o=t;else{if(!t._pixiId){var a=i&&i.pixiIdPrefix||"pixiid";t._pixiId=a+"_"+Ei()}o=t._pixiId}var h=Si[o];if(s&&n&&!h)throw new Error('The cacheId "'+o+'" does not exist in BaseTextureCache.');return h||(h=new e(t,i),h.cacheId=o,e.addToCache(h,o)),h},e.fromBuffer=function(t,i,n,s){t=t||new Float32Array(i*n*4);var o=new Rr(t,{width:i,height:n}),a=t instanceof Float32Array?k.FLOAT:k.UNSIGNED_BYTE;return new e(o,Object.assign({},Jv,s||{width:i,height:n,type:a}))},e.addToCache=function(t,i){i&&(t.textureCacheIds.indexOf(i)===-1&&t.textureCacheIds.push(i),Si[i]&&console.warn("BaseTexture added to the cache with an id ["+i+"] that already had an entry"),Si[i]=t)},e.removeFromCache=function(t){if(typeof t=="string"){var i=Si[t];if(i){var n=i.textureCacheIds.indexOf(t);return n>-1&&i.textureCacheIds.splice(n,1),delete Si[t],i}}else if(t&&t.textureCacheIds){for(var s=0;s<t.textureCacheIds.length;++s)delete Si[t.textureCacheIds[s]];return t.textureCacheIds.length=0,t}return null},e._globalBatch=0,e}(yr),Dh=function(r){ft(e,r);function e(t,i){var n=this,s=i||{},o=s.width,a=s.height;n=r.call(this,o,a)||this,n.items=[],n.itemDirtyIds=[];for(var h=0;h<t;h++){var u=new rt;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 Pr?this.addResourceAt(t[n],n):this.addResourceAt(Mh(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],o=s.realWidth,a=s.realHeight;return t.resize(o,a),Promise.resolve(t)}),this._load},e}(Pr),Qv=function(r){ft(e,r);function e(t,i){var n=this,s=i||{},o=s.width,a=s.height,h,u;return Array.isArray(t)?(h=t,u=t.length):u=t,n=r.call(this,u,{width:o,height:a})||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=Ti.TEXTURE_2D_ARRAY},e.prototype.upload=function(t,i,n){var s=this,o=s.length,a=s.itemDirtyIds,h=s.items,u=t.gl;n.dirtyId<0&&u.texImage3D(u.TEXTURE_2D_ARRAY,0,n.internalFormat,this._width,this._height,o,0,i.format,n.type,null);for(var l=0;l<o;l++){var f=h[l];a[l]<f.dirtyId&&(a[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}(Dh),ei=function(r){ft(e,r);function e(t){var i=this,n=t,s=n.naturalWidth||n.videoWidth||n.width,o=n.naturalHeight||n.videoHeight||n.height;return i=r.call(this,s,o)||this,i.source=t,i.noSubImage=!1,i}return e.crossOrigin=function(t,i,n){n===void 0&&i.indexOf("data:")!==0?t.crossOrigin=Zv(i):n!==!1&&(t.crossOrigin=typeof n=="string"?n:"anonymous")},e.prototype.upload=function(t,i,n,s){var o=t.gl,a=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 o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i.alphaMode===ye.UNPACK),!this.noSubImage&&i.target===o.TEXTURE_2D&&n.width===a&&n.height===h?o.texSubImage2D(o.TEXTURE_2D,0,0,0,i.format,n.type,s):(n.width=a,n.height=h,o.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}(Pr),t_=function(r){ft(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}(ei),e_=function(r){ft(e,r);function e(t,i){var n=this,s=i||{},o=s.width,a=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:o,height:a})||this;for(var l=0;l<e.SIDES;l++)n.items[l].target=Ti.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=Ti.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=Ti.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,o=0;o<e.SIDES;o++){var a=this.items[o];(s[o]<a.dirtyId||n.dirtyId<i.dirtyId)&&(a.valid&&a.resource?(a.resource.upload(t,a,n),s[o]=a.dirtyId):s[o]<-1&&(t.gl.texImage2D(a.target,0,n.internalFormat,i.realWidth,i.realHeight,0,i.format,n.type,null),s[o]=-1))}return!0},e.test=function(t){return Array.isArray(t)&&t.length===e.SIDES},e.SIDES=6,e}(Dh),Nh=function(r){ft(e,r);function e(t,i){var n=this;if(i=i||{},!(t instanceof HTMLImageElement)){var s=new Image;ei.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 o=i.source;i.url=o.src;var a=function(){i.destroyed||(o.onload=null,o.onerror=null,i.resize(o.width,o.height),i._load=null,i.createBitmap?n(i.process()):n(i))};o.complete&&o.src?a():(o.onload=a,o.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(o){return o.blob()}).then(function(o){return n(o,0,0,i.width,i.height,{premultiplyAlpha:t.alphaMode===null||t.alphaMode===ye.UNPACK?"premultiply":"none"})}).then(function(o){return t.destroyed?Promise.reject():(t.bitmap=o,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,o=i._glTextures;for(var a in o){var h=o[a];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}(ei),i_=function(r){ft(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;ei.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 o=n*t.scale,a=s*t.scale;(t._overrideWidth||t._overrideHeight)&&(o=t._overrideWidth||t._overrideHeight/s*n,a=t._overrideHeight||t._overrideWidth/n*s),o=Math.round(o),a=Math.round(a);var h=t.source;h.width=o,h.height=a,h._pixiId="canvas_"+Ei(),h.getContext("2d").drawImage(i,0,0,n,s,0,0,o,a),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}(ei),r_=function(r){ft(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 o=t[0].src||t[0];ei.crossOrigin(s,o,i.crossorigin);for(var a=0;a<t.length;++a){var h=document.createElement("source"),u=t[a],l=u.src,f=u.mime;l=l||t[a];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=Ut.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&&(Ut.shared.add(this.update,this),this._isConnectedToTicker=!0)},e.prototype._onPlayStop=function(){this._isConnectedToTicker&&(Ut.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&&(Ut.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?(Ut.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._isSourcePlaying()&&(Ut.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}(ei),n_=function(r){ft(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}(ei);Gs.push(Nh,n_,t_,r_,i_,Rr,e_,Qv);var s_=function(r){ft(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===ye.UNPACK);var o=i.realWidth,a=i.realHeight;return n.width===o&&n.height===a?s.texSubImage2D(i.target,0,0,0,o,a,i.format,n.type,this.data):(n.width=o,n.height=a,s.texImage2D(i.target,0,n.internalFormat,o,a,0,i.format,n.type,this.data)),!0},e}(Rr),Xs=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 Xt("disposeFramebuffer"),this.multisample=wt.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 rt(null,{scaleMode:Me.NEAREST,resolution:1,mipmap:me.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},r.prototype.addDepthTexture=function(e){return this.depthTexture=e||new rt(new s_(null,{width:this.width,height:this.height}),{scaleMode:Me.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:me.OFF,format:F.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}(),Fh=function(r){ft(e,r);function e(t){t===void 0&&(t={});var i=this;if(typeof t=="number"){var n=arguments[0],s=arguments[1],o=arguments[2],a=arguments[3];t={width:n,height:s,scaleMode:o,resolution:a}}return t.width=t.width||100,t.height=t.height||100,t.multisample=t.multisample!==void 0?t.multisample:wt.NONE,i=r.call(this,null,t)||this,i.mipmap=me.OFF,i.valid=!0,i.clearColor=[0,0,0,0],i.framebuffer=new Xs(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}(rt),Bh=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 o=e.width/2/n,a=e.height/2/s,h=e.x/n+o,u=e.y/s+a;i=_t.add(i,_t.NW),this.x0=h+o*_t.uX(i),this.y0=u+a*_t.uY(i),i=_t.add(i,2),this.x1=h+o*_t.uX(i),this.y1=u+a*_t.uY(i),i=_t.add(i,2),this.x2=h+o*_t.uX(i),this.y2=u+a*_t.uY(i),i=_t.add(i,2),this.x3=h+o*_t.uX(i),this.y3=u+a*_t.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}(),Lh=new Bh;function xn(r){r.destroy=function(){},r.on=function(){},r.once=function(){},r.emit=function(){}}var Y=function(r){ft(e,r);function e(t,i,n,s,o,a){var h=r.call(this)||this;if(h.noFrame=!1,i||(h.noFrame=!0,i=new J(0,0,1,1)),t instanceof e&&(t=t.baseTexture),h.baseTexture=t,h._frame=i,h.trim=s,h.valid=!1,h._uvs=Lh,h.uvMatrix=null,h.orig=n||i,h._rotate=Number(o||0),o===!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=a?new j(a.x,a.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&&Ye[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===Lh&&(this._uvs=new Bh),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",o=null;if(s)o=t;else if(t instanceof rt){if(!t.cacheId){var a=i&&i.pixiIdPrefix||"pixiid";t.cacheId=a+"-"+Ei(),rt.addToCache(t,t.cacheId)}o=t.cacheId}else{if(!t._pixiId){var a=i&&i.pixiIdPrefix||"pixiid";t._pixiId=a+"_"+Ei()}o=t._pixiId}var h=Ye[o];if(s&&n&&!h)throw new Error('The cacheId "'+o+'" does not exist in TextureCache.');return!h&&!(t instanceof rt)?(i.resolution||(i.resolution=mn(t)),h=new e(new rt(t,i)),h.baseTexture.cacheId=o,rt.addToCache(h.baseTexture,o),e.addToCache(h,o)):!h&&t instanceof rt&&(h=new e(t),e.addToCache(h,o)),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),o=s.baseTexture.resource;return s.baseTexture.valid?Promise.resolve(s):o.load().then(function(){return Promise.resolve(s)})},e.fromBuffer=function(t,i,n,s){return new e(rt.fromBuffer(t,i,n,s))},e.fromLoader=function(t,i,n,s){var o=new rt(t,Object.assign({scaleMode:L.SCALE_MODE,resolution:mn(i)},s)),a=o.resource;a instanceof Nh&&(a.url=i);var h=new e(o);return n||(n=i),rt.addToCache(h.baseTexture,n),e.addToCache(h,n),n!==i&&(rt.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),Ye[i]&&console.warn("Texture added to the cache with an id ["+i+"] that already had an entry"),Ye[i]=t)},e.removeFromCache=function(t){if(typeof t=="string"){var i=Ye[t];if(i){var n=i.textureCacheIds.indexOf(t);return n>-1&&i.textureCacheIds.splice(n,1),delete Ye[t],i}}else if(t&&t.textureCacheIds){for(var s=0;s<t.textureCacheIds.length;++s)Ye[t.textureCacheIds[s]]===t&&delete Ye[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,o=t.height,a=i+s>this.baseTexture.width,h=n+o>this.baseTexture.height;if(a||h){var u=a&&h?"and":"or",l="X: "+i+" + "+s+" = "+(i+s)+" > "+this.baseTexture.width,f="Y: "+n+" + "+o+" = "+(n+o)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+(l+" "+u+" "+f))}this.valid=s&&o&&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 rt),xn(e._EMPTY),xn(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(rt.from(t)),xn(e._WHITE),xn(e._WHITE.baseTexture)}return e._WHITE},enumerable:!1,configurable:!0}),e}(yr),Pi=function(r){ft(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,o=Math.round(t*s)/s,a=Math.round(i*s)/s;this.valid=o>0&&a>0,this._frame.width=this.orig.width=o,this._frame.height=this.orig.height=a,n&&this.baseTexture.resize(o,a),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"&&(Te("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 Fh(t))},e}(Y),o_=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=wt.NONE);var n=new Fh(Object.assign({width:e,height:t,resolution:1,multisample:i},this.textureOptions));return new Pi(n)},r.prototype.getOptimalTexture=function(e,t,i,n){i===void 0&&(i=1),n===void 0&&(n=wt.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=_n(e),t=_n(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 o=this.texturePool[s].pop();return o||(o=this.createTexture(e,t,n)),o.filterPoolKey=s,o.setResolution(i),o},r.prototype.getFilterTexture=function(e,t,i){var n=this.getOptimalTexture(e.width,e.height,t||e.resolution,i||wt.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}(),Gh=function(){function r(e,t,i,n,s,o,a){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=o,this.instance=a}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}(),a_=0,Ft=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=a_++,this.disposeRunner=new Xt("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===Ne.ELEMENT_ARRAY_BUFFER},set:function(e){this.type=e?Ne.ELEMENT_ARRAY_BUFFER:Ne.ARRAY_BUFFER},enumerable:!1,configurable:!0}),r.from=function(e){return e instanceof Array&&(e=new Float32Array(e)),new r(e)},r}(),h_={Float32Array,Uint32Array,Int32Array,Uint8Array};function u_(r,e){for(var t=0,i=0,n={},s=0;s<r.length;s++)i+=e[s],t+=r[s].length;for(var o=new ArrayBuffer(t*4),a=null,h=0,s=0;s<r.length;s++){var u=e[s],l=r[s],f=Eh(l);n[f]||(n[f]=new h_[f](o)),a=n[f];for(var c=0;c<l.length;c++){var d=(c/u|0)*i+h,v=c%u;a[d+v]=l[c]}h+=u}return new Float32Array(o)}var Uh={5126:4,5123:2,5121:1},l_=0,f_={Float32Array,Uint32Array,Int32Array,Uint8Array,Uint16Array},Cr=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=l_++,this.instanced=!1,this.instanceCount=1,this.disposeRunner=new Xt("disposeGeometry"),this.refCount=0}return r.prototype.addAttribute=function(e,t,i,n,s,o,a,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 Ft||(t instanceof Array&&(t=new Float32Array(t)),t=new Ft(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 Gh(f,i,n,s,o,a,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 Ft||(e instanceof Array&&(e=new Uint16Array(e)),e=new Ft(e)),e.type=Ne.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 Ft,n;for(n in this.attributes){var s=this.attributes[n],o=this.buffers[s.buffer];e.push(o.data),t.push(s.size*Uh[s.type]/4),s.buffer=0}for(i.data=u_(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 Ft(this.buffers[t].data.slice(0));for(var t in this.attributes){var i=this.attributes[t];e.attributes[t]=new Gh(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=Ne.ELEMENT_ARRAY_BUFFER),e},r.merge=function(e){for(var t=new r,i=[],n=[],s=[],o,a=0;a<e.length;a++){o=e[a];for(var h=0;h<o.buffers.length;h++)n[h]=n[h]||0,n[h]+=o.buffers[h].data.length,s[h]=0}for(var a=0;a<o.buffers.length;a++)i[a]=new f_[Eh(o.buffers[a].data)](n[a]),t.buffers[a]=new Ft(i[a]);for(var a=0;a<e.length;a++){o=e[a];for(var h=0;h<o.buffers.length;h++)i[h].set(o.buffers[h].data,s[h]),s[h]+=o.buffers[h].data.length}if(t.attributes=o.attributes,o.indexBuffer){t.indexBuffer=t.buffers[o.buffers.indexOf(o.indexBuffer)],t.indexBuffer.type=Ne.ELEMENT_ARRAY_BUFFER;for(var u=0,l=0,f=0,c=0,a=0;a<o.buffers.length;a++)if(o.buffers[a]!==o.indexBuffer){c=a;break}for(var a in o.attributes){var d=o.attributes[a];(d.buffer|0)===c&&(l+=d.size*Uh[d.type]/4)}for(var a=0;a<e.length;a++){for(var v=e[a].indexBuffer.data,h=0;h<v.length;h++)t.indexBuffer.data[h+f]+=u;u+=e[a].buffers[c].data.length/l,f+=v.length}}return t},r}(),c_=function(r){ft(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}(Cr),kh=function(r){ft(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 Ft(t.vertices),t.uvBuffer=new Ft(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}(Cr),d_=0,Ri=function(){function r(e,t,i){this.group=!0,this.syncUniforms={},this.dirtyId=0,this.id=d_++,this.static=!!t,this.ubo=!!i,e instanceof Ft?(this.buffer=e,this.buffer.type=Ne.UNIFORM_BUFFER,this.autoManage=!1,this.ubo=!0):(this.uniforms=e,this.ubo&&(this.buffer=new Ft(new Float32Array(1)),this.buffer.type=Ne.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}(),p_=function(){function r(){this.renderTexture=null,this.target=null,this.legacy=!1,this.resolution=1,this.multisample=wt.NONE,this.sourceFrame=new J,this.destinationFrame=new J,this.bindingSourceFrame=new J,this.bindingDestinationFrame=new J,this.filters=[],this.transform=null}return r.prototype.clear=function(){this.target=null,this.filters=null,this.renderTexture=null},r}(),bn=[new j,new j,new j,new j],Hs=new Dt,v_=function(){function r(e){this.renderer=e,this.defaultFilterStack=[{}],this.texturePool=new o_,this.texturePool.setScreenSize(e.view),this.statePool=[],this.quad=new c_,this.quadUv=new kh,this.tempRect=new J,this.activeState={},this.globalUniforms=new Ri({outputFrame:new J,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,o=this.defaultFilterStack,a=this.statePool.pop()||new p_,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)}o.length===1&&(this.defaultFilterStack[0].renderTexture=h.current),o.push(a),a.resolution=u,a.multisample=l,a.legacy=d,a.target=e,a.sourceFrame.copyFrom(e.filterArea||e.getBounds(!0)),a.sourceFrame.pad(f);var _=this.tempRect.copyFrom(h.sourceFrame);s.projection.transform&&this.transformAABB(Hs.copyFrom(s.projection.transform).invert(),_),c?(a.sourceFrame.fit(_),(a.sourceFrame.width<=0||a.sourceFrame.height<=0)&&(a.sourceFrame.width=0,a.sourceFrame.height=0)):a.sourceFrame.intersects(_)||(a.sourceFrame.width=0,a.sourceFrame.height=0),this.roundFrame(a.sourceFrame,h.current?h.current.resolution:s.resolution,h.sourceFrame,h.destinationFrame,s.projection.transform),a.renderTexture=this.getOptimalFilterTexture(a.sourceFrame.width,a.sourceFrame.height,u,l),a.filters=t,a.destinationFrame.width=a.renderTexture.width,a.destinationFrame.height=a.renderTexture.height;var g=this.tempRect;g.x=0,g.y=0,g.width=a.sourceFrame.width,g.height=a.sourceFrame.height,a.renderTexture.filterFrame=a.sourceFrame,a.bindingSourceFrame.copyFrom(h.sourceFrame),a.bindingDestinationFrame.copyFrom(h.destinationFrame),a.transform=s.projection.transform,s.projection.transform=null,h.bind(a.renderTexture,a.sourceFrame,g),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,o=n.inputPixel,a=n.inputClamp;if(s[0]=t.destinationFrame.width,s[1]=t.destinationFrame.height,s[2]=1/s[0],s[3]=1/s[1],o[0]=Math.round(s[0]*t.resolution),o[1]=Math.round(s[1]*t.resolution),o[2]=1/o[0],o[3]=1/o[1],a[0]=.5*o[2],a[1]=.5*o[3],a[2]=t.sourceFrame.width*s[2]-.5*o[2],a[3]=t.sourceFrame.height*s[3]-.5*o[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,xe.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,xe.CLEAR,t);var d=l;l=f,f=d}i[c].apply(this,l,u.renderTexture,xe.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=xe.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 o=this.tempRect;o.x=0,o.y=0,o.width=e.filterFrame.width,o.height=e.filterFrame.height,n.bind(e,e.filterFrame,o)}else e!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?n.bind(e):this.renderer.renderTexture.bind(e,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);var a=s.stateId&1||this.forceClear;(t===xe.CLEAR||t===xe.BLIT&&a)&&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(ge.TRIANGLES)):(s.geometry.bind(this.quad),s.geometry.draw(ge.TRIANGLE_STRIP))},r.prototype.calculateSpriteMatrix=function(e,t){var i=this.activeState,n=i.sourceFrame,s=i.destinationFrame,o=t._texture.orig,a=e.set(s.width,0,0,s.height,n.x,n.y),h=t.worldTransform.copyTo(Dt.TEMP_MATRIX);return h.invert(),a.prepend(h),a.scale(1/o.width,1/o.height),a.translate(t.anchor.x,t.anchor.y),a},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=wt.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||wt.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=bn[0],n=bn[1],s=bn[2],o=bn[3];i.set(t.left,t.top),n.set(t.left,t.bottom),s.set(t.right,t.top),o.set(t.right,t.bottom),e.apply(i,i),e.apply(n,n),e.apply(s,s),e.apply(o,o);var a=Math.min(i.x,n.x,s.x,o.x),h=Math.min(i.y,n.y,s.y,o.y),u=Math.max(i.x,n.x,s.x,o.x),l=Math.max(i.y,n.y,s.y,o.y);t.x=a,t.y=h,t.width=u-a,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 o=s.a,a=s.b,h=s.c,u=s.d;if((Math.abs(a)>1e-4||Math.abs(h)>1e-4)&&(Math.abs(o)>1e-4||Math.abs(u)>1e-4))return}s=s?Hs.copyFrom(s):Hs.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}(),Tn=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}(),__=function(){function r(e){this.renderer=e,this.emptyRenderer=new Tn(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,o=e.ids,a=e.count,h=0,u=0;u<a;u++){var l=s[u],f=l._batchLocation;if(f>=0&&f<n&&t[f]===l){o[u]=f;continue}for(;h<n;){var c=t[h];if(c&&c._batchEnabled===i&&c._batchLocation===h){h++;continue}o[u]=h,l._batchLocation=h,t[h]=l;break}}},r.prototype.destroy=function(){this.renderer=null},r}(),Xh=0,g_=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=Xh++,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=Xh++,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>=We.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}(),m_=function(){function r(e){this.framebuffer=e,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=wt.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0}return r}(),y_=new J,x_=function(){function r(e){this.renderer=e,this.managedFramebuffers=[],this.unknownFramebuffer=new Xs(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 J,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===We.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 o=0;o<e.colorTextures.length;o++){var a=e.colorTextures[o];this.renderer.texture.unbind(a.parentTextureArray||a)}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=on.COLOR|on.DEPTH);var o=this.gl;o.clearColor(e,t,i,n),o.clear(s)},r.prototype.initFramebuffer=function(e){var t=this.gl,i=new m_(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 o=0;o<s;o++){var a=n[o],h=a.parentTextureArray||a;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,o=s.length;i.drawBuffers||(o=Math.min(o,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 a=[],h=0;h<o;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),a.push(i.COLOR_ATTACHMENT0+h))}if(a.length>1&&i.drawBuffers(a),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=wt.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=wt.NONE),i},r.prototype.blit=function(e,t,i){var n=this,s=n.current,o=n.renderer,a=n.gl,h=n.CONTEXT_UID;if(o.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 Xs(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=y_,t.width=s.width,t.height=s.height),i||(i=t);var f=t.width===i.width&&t.height===i.height;this.bind(e),a.bindFramebuffer(a.READ_FRAMEBUFFER,u.framebuffer),a.blitFramebuffer(t.left,t.top,t.right,t.bottom,i.left,i.top,i.right,i.bottom,a.COLOR_BUFFER_BIT,f?a.NEAREST:a.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,o=s.createRenderbuffer();s.bindRenderbuffer(s.RENDERBUFFER,o),t.msaaBuffer?s.renderbufferStorageMultisample(s.RENDERBUFFER,t.multisample,s.DEPTH24_STENCIL8,i,n):s.renderbufferStorage(s.RENDERBUFFER,s.DEPTH_STENCIL,i,n),t.stencil=o,s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_STENCIL_ATTACHMENT,s.RENDERBUFFER,o)}}},r.prototype.reset=function(){this.current=this.unknownFramebuffer,this.viewport=new J},r.prototype.destroy=function(){this.renderer=null},r}(),Ws={5126:4,5123:2,5121:1},b_=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===We.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,o){return n.vertexAttribDivisorANGLE(s,o)},e.drawElementsInstanced=function(s,o,a,h,u){return n.drawElementsInstancedANGLE(s,o,a,h,u)},e.drawArraysInstanced=function(s,o,a,h){return n.drawArraysInstancedANGLE(s,o,a,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 o=n[t.program.id]||this.initGeometryVao(e,t,s);this._activeGeometry=e,this._activeVao!==o&&(this._activeVao=o,this.hasVao?i.bindVertexArray(o):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 o in i)n[o]&&s.push(o,n[o].location);return s.join("-")},r.prototype.initGeometryVao=function(e,t,i){i===void 0&&(i=!0);var n=this.gl,s=this.CONTEXT_UID,o=this.renderer.buffer,a=t.program;a.glPrograms[s]||this.renderer.shader.generateProgram(t),this.checkCompatibility(e,a);var h=this.getSignature(e,a),u=e.glVertexArrayObjects[this.CONTEXT_UID],l=u[h];if(l)return u[a.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&&a.attributeData[p]?c[p].size=a.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*Ws[c[p].type];for(var p in c){var _=c[p],g=_.size;_.stride===void 0&&(d[_.buffer]===g*Ws[_.type]?_.stride=0:_.stride=d[_.buffer]),_.start===void 0&&(_.start=v[_.buffer],v[_.buffer]+=g*Ws[_.type])}l=n.createVertexArray(),n.bindVertexArray(l);for(var y=0;y<f.length;y++){var m=f[y];o.bind(m),i&&m._glBuffers[s].refCount++}return this.activateVao(e,a),this._activeVao=l,u[a.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,o=e.buffers,a=(i=this.renderer)===null||i===void 0?void 0:i.buffer;if(e.disposeRunner.remove(this),!!n){if(a)for(var h=0;h<o.length;h++){var u=o[h]._glBuffers[this.CONTEXT_UID];u&&(u.refCount--,u.refCount===0&&!t&&a.dispose(o[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,o=e.buffers,a=e.attributes;e.indexBuffer&&s.bind(e.indexBuffer);var h=null;for(var u in a){var l=a[u],f=o[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,o=this._activeGeometry;if(o.indexBuffer){var a=o.indexBuffer.data.BYTES_PER_ELEMENT,h=a===2?s.UNSIGNED_SHORT:s.UNSIGNED_INT;a===2||a===4&&this.canUseUInt32ElementIndex?o.instanced?s.drawElementsInstanced(e,t||o.indexBuffer.data.length,h,(i||0)*a,n||1):s.drawElements(e,t||o.indexBuffer.data.length,h,(i||0)*a):console.warn("unsupported index buffer type: uint32")}else o.instanced?s.drawArraysInstanced(e,i,t||o.getSize(),n||1):s.drawArrays(e,i,t||o.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}(),T_=function(){function r(e){e===void 0&&(e=null),this.type=It.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=It.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 Hh(r,e,t){var i=r.createShader(e);return r.shaderSource(i,t),r.compileShader(i),i}function Wh(r,e){var t=r.getShaderSource(e).split(`
14
+ Deprecated since v`+r),console.warn(i))),Rh[e]=!0}}var Ch={},Ye=Object.create(null),Si=Object.create(null),Oh=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 jv(r){var e=r.width,t=r.height,i=r.getContext("2d",{willReadFrequently:!0}),n=i.getImageData(0,0,e,t),s=n.data,o=s.length,a={top:null,left:null,right:null,bottom:null},h=null,u,l,f;for(u=0;u<o;u+=4)s[u+3]!==0&&(l=u/4%e,f=~~(u/4/e),a.top===null&&(a.top=f),(a.left===null||l<a.left)&&(a.left=l),(a.right===null||a.right<l)&&(a.right=l+1),(a.bottom===null||a.bottom<f)&&(a.bottom=f));return a.top!==null&&(e=a.right-a.left,t=a.bottom-a.top+1,h=i.getImageData(a.left,a.top,e,t)),{height:t,width:e,data:h}}var gn;function Zv(r,e){if(e===void 0&&(e=globalThis.location),r.indexOf("data:")===0)return"";e=e||globalThis.location,gn||(gn=document.createElement("a")),gn.href=r;var t=ji.parse(gn.href),i=!t.port&&e.port===""||t.port===e.port;return t.hostname!==e.hostname||!i||t.protocol!==e.protocol?"anonymous":""}function mn(r,e){var t=L.RETINA_PREFIX.exec(r);return t?parseFloat(t[1]):e!==void 0?e:1}L.SORTABLE_CHILDREN=!1;var yn=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?J.EMPTY:(e=e||new J(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,o=e.d,a=e.tx,h=e.ty,u=i*t.x+s*t.y+a,l=n*t.x+o*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,o=e[0],a=e[1];t=o<t?o:t,i=a<i?a:i,n=o>n?o:n,s=a>s?a:s,o=e[2],a=e[3],t=o<t?o:t,i=a<i?a:i,n=o>n?o:n,s=a>s?a:s,o=e[4],a=e[5],t=o<t?o:t,i=a<i?a:i,n=o>n?o:n,s=a>s?a:s,o=e[6],a=e[7],t=o<t?o:t,i=a<i?a:i,n=o>n?o:n,s=a>s?a: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 o=e.a,a=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,_=o*t+h*i+l,g=a*t+u*i+f;c=_<c?_:c,d=g<d?g:d,v=_>v?_:v,p=g>p?g:p,_=o*n+h*i+l,g=a*n+u*i+f,c=_<c?_:c,d=g<d?g:d,v=_>v?_:v,p=g>p?g:p,_=o*t+h*s+l,g=a*t+u*s+f,c=_<c?_:c,d=g<d?g:d,v=_>v?_:v,p=g>p?g:p,_=o*n+h*s+l,g=a*n+u*s+f,c=_<c?_:c,d=g<d?g:d,v=_>v?_:v,p=g>p?g: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,o=this.maxX,a=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,o=u>o?u:o,a=l>a?l:a}this.minX=n,this.minY=s,this.maxX=o,this.maxY=a},r.prototype.addVertices=function(e,t,i,n){this.addVerticesMatrix(e.worldTransform,t,i,n)},r.prototype.addVerticesMatrix=function(e,t,i,n,s,o){s===void 0&&(s=0),o===void 0&&(o=s);for(var a=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,g=i;g<n;g+=2){var y=t[g],m=t[g+1],b=a*y+u*m+f,x=l*m+h*y+c;d=Math.min(d,b-s),p=Math.max(p,b+s),v=Math.min(v,x-o),_=Math.max(_,x+o)}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,o=e.maxY<t.maxY?e.maxY:t.maxY;if(i<=s&&n<=o){var a=this.minX,h=this.minY,u=this.maxX,l=this.maxY;this.minX=i<a?i:a,this.minY=n<h?n:h,this.maxX=s>u?s:u,this.maxY=o>l?o: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,o=e.maxY<t.y+t.height?e.maxY:t.y+t.height;if(i<=s&&n<=o){var a=this.minX,h=this.minY,u=this.maxX,l=this.maxY;this.minX=i<a?i:a,this.minY=n<h?n:h,this.maxX=s>u?s:u,this.maxY=o>l?o: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,o){e-=s,t-=o,i+=s,n+=o,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 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 Bs(r,e){Fs(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Ct=function(r){Bs(e,r);function e(){var t=r.call(this)||this;return t.tempDisplayObjectParent=null,t.transform=new Ua,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 yn,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 J),i=this._boundsRect),this._bounds.getRectangle(i)},e.prototype.getLocalBounds=function(t){t||(this._localBoundsRect||(this._localBoundsRect=new J),t=this._localBoundsRect),this._localBounds||(this._localBounds=new yn);var i=this.transform,n=this.parent;this.parent=null,this.transform=this._tempDisplayObjectParent.transform;var s=this._bounds,o=this._boundsID;this._bounds=this._localBounds;var a=this.getBounds(!1,t);return this.parent=n,this.transform=i,this._bounds=s,this._bounds.updateID+=this._boundsID-o,a},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,o,a,h,u,l){return t===void 0&&(t=0),i===void 0&&(i=0),n===void 0&&(n=1),s===void 0&&(s=1),o===void 0&&(o=0),a===void 0&&(a=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=o,this.skew.x=a,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 Ah),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*Bf},set:function(t){this.transform.rotation=t*Lf},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}(yr),Ah=function(r){Bs(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.sortDirty=null,t}return e}(Ct);Ct.prototype.displayObjectUpdateTransform=Ct.prototype.updateTransform;function qv(r,e){return r.zIndex===e.zIndex?r._lastSortedIndex-e._lastSortedIndex:r.zIndex-e.zIndex}var ht=function(r){Bs(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 o=i[0];o.parent&&o.parent.removeChild(o),o.parent=this,this.sortDirty=!0,o.transform._parentID=-1,this.children.push(o),this._boundsID++,this.onChildrenChange(this.children.length-1),this.emit("childAdded",o,this,this.children.length-1),o.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);qi(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 o=i[0],a=this.children.indexOf(o);if(a===-1)return null;o.parent=null,o.transform._parentID=-1,qi(this.children,a,1),this._boundsID++,this.onChildrenChange(a),o.emit("removed",this),this.emit("childRemoved",o,this,a)}return i[0]},e.prototype.removeChildAt=function(t){var i=this.getChildAt(t);return i.parent=null,i.transform._parentID=-1,qi(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,o=s-n,a;if(o>0&&o<=s){a=this.children.splice(n,o);for(var h=0;h<a.length;++h)a[h].parent=null,a[h].transform&&(a[h].transform._parentID=-1);this._boundsID++,this.onChildrenChange(t);for(var h=0;h<a.length;++h)a[h].emit("removed",this),this.emit("childRemoved",a[h],this,h);return a}else if(o===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(qv),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,o=this.children.length;s<o;++s){var a=this.children[s];a.visible&&a.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 o=0,a=this.children.length;o<a;++o){var h=this.children[o],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 o=i&&this._enabledFilters&&this._enabledFilters.length||n&&(!n.isMaskData||n.enabled&&(n.autoDetect||n.type!==It.NONE));if(o&&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,a=this.children.length;s<a;++s)this.children[s].render(t)}o&&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}(Ct);ht.prototype.containerUpdateTransform=ht.prototype.updateTransform;var Sr=function(){return Sr=Object.assign||function(e){for(var t=arguments,i,n=1,s=arguments.length;n<s;n++){i=t[n];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(e[o]=i[o])}return e},Sr.apply(this,arguments)},at;(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"})(at||(at={}));var Ih=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=Sr(Sr({},e),{ref:r})}if(typeof r=="object")r=Sr({},r);else throw new Error("Invalid extension type");return typeof r.type=="string"&&(r.type=[r.type]),r},Ve={_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(Ih).forEach(function(n){n.type.forEach(function(s){var o,a;return(a=(o=e._removeHandlers)[s])===null||a===void 0?void 0:a.call(o,n)})}),this},add:function(){for(var r=arguments,e=this,t=[],i=0;i<arguments.length;i++)t[i]=r[i];return t.map(Ih).forEach(function(n){n.type.forEach(function(s){var o=e._addHandlers,a=e._queue;o[s]?o[s](n):(a[s]=a[s]||[],a[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(o){return e(o)}),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===at.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 Xt=function(){function r(e){this.items=[],this._name=e,this._aliasCount=0}return r.prototype.emit=function(e,t,i,n,s,o,a,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,o,a,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(Xt.prototype,{dispatch:{value:Xt.prototype.emit},run:{value:Xt.prototype.emit}});L.TARGET_FPMS=.06;var te;(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"})(te||(te={}));var Ls=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}(),Ut=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 Ls(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=te.NORMAL),this._addListener(new Ls(e,t,i))},r.prototype.addOnce=function(e,t,i){return i===void 0&&(i=te.NORMAL),this._addListener(new Ls(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}(),Kv=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,te.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?Ut.shared:new Ut,e.autoStart&&this.start()},r.destroy=function(){if(this._ticker){var e=this._ticker;this.ticker=null,e.destroy()}},r.extension=at.Application,r}();L.PREFER_ENV=Fe.any?We.WEBGL:We.WEBGL2,L.STRICT_TEXTURE_CACHE=!1;var Gs=[];function Mh(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=Gs.length-1;n>=0;--n){var s=Gs[n];if(s.test&&s.test(r,t))return new s(r,e)}throw new Error("Unrecognized source type to auto-detect Resource")}var Us=function(r,e){return Us=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])},Us(r,e)};function ft(r,e){Us(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var ks=function(){return ks=Object.assign||function(e){for(var t=arguments,i,n=1,s=arguments.length;n<s;n++){i=t[n];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(e[o]=i[o])}return e},ks.apply(this,arguments)};function $v(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 Pr=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 Xt("setRealSize"),this.onUpdate=new Xt("update"),this.onError=new Xt("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}(),Rr=function(r){ft(e,r);function e(t,i){var n=this,s=i||{},o=s.width,a=s.height;if(!o||!a)throw new Error("BufferResource width or height invalid");return n=r.call(this,o,a)||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===ye.UNPACK);var o=i.realWidth,a=i.realHeight;return n.width===o&&n.height===a?s.texSubImage2D(i.target,0,0,0,o,a,i.format,n.type,this.data):(n.width=o,n.height=a,s.texImage2D(i.target,0,n.internalFormat,o,a,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}(Pr),Jv={scaleMode:Me.NEAREST,format:F.RGBA,alphaMode:ye.NPM},rt=function(r){ft(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,o=i.mipmap,a=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 Pr)&&(t=Mh(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=o!==void 0?o:L.MIPMAP_TEXTURES,n.anisotropicLevel=a!==void 0?a:L.ANISOTROPIC_LEVEL,n._wrapMode=f||L.WRAP_MODE,n._scaleMode=h!==void 0?h:L.SCALE_MODE,n.format=c||F.RGBA,n.type=d||k.UNSIGNED_BYTE,n.target=v||Ti.TEXTURE_2D,n.alphaMode=s!==void 0?s:ye.UNPACK,n.uid=Ei(),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=Sh(this.realWidth)&&Sh(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 Si[this.cacheId],delete Ye[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",o=null;if(s)o=t;else{if(!t._pixiId){var a=i&&i.pixiIdPrefix||"pixiid";t._pixiId=a+"_"+Ei()}o=t._pixiId}var h=Si[o];if(s&&n&&!h)throw new Error('The cacheId "'+o+'" does not exist in BaseTextureCache.');return h||(h=new e(t,i),h.cacheId=o,e.addToCache(h,o)),h},e.fromBuffer=function(t,i,n,s){t=t||new Float32Array(i*n*4);var o=new Rr(t,{width:i,height:n}),a=t instanceof Float32Array?k.FLOAT:k.UNSIGNED_BYTE;return new e(o,Object.assign({},Jv,s||{width:i,height:n,type:a}))},e.addToCache=function(t,i){i&&(t.textureCacheIds.indexOf(i)===-1&&t.textureCacheIds.push(i),Si[i]&&console.warn("BaseTexture added to the cache with an id ["+i+"] that already had an entry"),Si[i]=t)},e.removeFromCache=function(t){if(typeof t=="string"){var i=Si[t];if(i){var n=i.textureCacheIds.indexOf(t);return n>-1&&i.textureCacheIds.splice(n,1),delete Si[t],i}}else if(t&&t.textureCacheIds){for(var s=0;s<t.textureCacheIds.length;++s)delete Si[t.textureCacheIds[s]];return t.textureCacheIds.length=0,t}return null},e._globalBatch=0,e}(yr),Nh=function(r){ft(e,r);function e(t,i){var n=this,s=i||{},o=s.width,a=s.height;n=r.call(this,o,a)||this,n.items=[],n.itemDirtyIds=[];for(var h=0;h<t;h++){var u=new rt;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 Pr?this.addResourceAt(t[n],n):this.addResourceAt(Mh(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],o=s.realWidth,a=s.realHeight;return t.resize(o,a),Promise.resolve(t)}),this._load},e}(Pr),Qv=function(r){ft(e,r);function e(t,i){var n=this,s=i||{},o=s.width,a=s.height,h,u;return Array.isArray(t)?(h=t,u=t.length):u=t,n=r.call(this,u,{width:o,height:a})||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=Ti.TEXTURE_2D_ARRAY},e.prototype.upload=function(t,i,n){var s=this,o=s.length,a=s.itemDirtyIds,h=s.items,u=t.gl;n.dirtyId<0&&u.texImage3D(u.TEXTURE_2D_ARRAY,0,n.internalFormat,this._width,this._height,o,0,i.format,n.type,null);for(var l=0;l<o;l++){var f=h[l];a[l]<f.dirtyId&&(a[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}(Nh),ei=function(r){ft(e,r);function e(t){var i=this,n=t,s=n.naturalWidth||n.videoWidth||n.width,o=n.naturalHeight||n.videoHeight||n.height;return i=r.call(this,s,o)||this,i.source=t,i.noSubImage=!1,i}return e.crossOrigin=function(t,i,n){n===void 0&&i.indexOf("data:")!==0?t.crossOrigin=Zv(i):n!==!1&&(t.crossOrigin=typeof n=="string"?n:"anonymous")},e.prototype.upload=function(t,i,n,s){var o=t.gl,a=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 o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i.alphaMode===ye.UNPACK),!this.noSubImage&&i.target===o.TEXTURE_2D&&n.width===a&&n.height===h?o.texSubImage2D(o.TEXTURE_2D,0,0,0,i.format,n.type,s):(n.width=a,n.height=h,o.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}(Pr),t_=function(r){ft(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}(ei),e_=function(r){ft(e,r);function e(t,i){var n=this,s=i||{},o=s.width,a=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:o,height:a})||this;for(var l=0;l<e.SIDES;l++)n.items[l].target=Ti.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=Ti.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=Ti.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,o=0;o<e.SIDES;o++){var a=this.items[o];(s[o]<a.dirtyId||n.dirtyId<i.dirtyId)&&(a.valid&&a.resource?(a.resource.upload(t,a,n),s[o]=a.dirtyId):s[o]<-1&&(t.gl.texImage2D(a.target,0,n.internalFormat,i.realWidth,i.realHeight,0,i.format,n.type,null),s[o]=-1))}return!0},e.test=function(t){return Array.isArray(t)&&t.length===e.SIDES},e.SIDES=6,e}(Nh),Dh=function(r){ft(e,r);function e(t,i){var n=this;if(i=i||{},!(t instanceof HTMLImageElement)){var s=new Image;ei.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 o=i.source;i.url=o.src;var a=function(){i.destroyed||(o.onload=null,o.onerror=null,i.resize(o.width,o.height),i._load=null,i.createBitmap?n(i.process()):n(i))};o.complete&&o.src?a():(o.onload=a,o.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(o){return o.blob()}).then(function(o){return n(o,0,0,i.width,i.height,{premultiplyAlpha:t.alphaMode===null||t.alphaMode===ye.UNPACK?"premultiply":"none"})}).then(function(o){return t.destroyed?Promise.reject():(t.bitmap=o,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,o=i._glTextures;for(var a in o){var h=o[a];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}(ei),i_=function(r){ft(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;ei.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 o=n*t.scale,a=s*t.scale;(t._overrideWidth||t._overrideHeight)&&(o=t._overrideWidth||t._overrideHeight/s*n,a=t._overrideHeight||t._overrideWidth/n*s),o=Math.round(o),a=Math.round(a);var h=t.source;h.width=o,h.height=a,h._pixiId="canvas_"+Ei(),h.getContext("2d").drawImage(i,0,0,n,s,0,0,o,a),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}(ei),r_=function(r){ft(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 o=t[0].src||t[0];ei.crossOrigin(s,o,i.crossorigin);for(var a=0;a<t.length;++a){var h=document.createElement("source"),u=t[a],l=u.src,f=u.mime;l=l||t[a];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=Ut.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&&(Ut.shared.add(this.update,this),this._isConnectedToTicker=!0)},e.prototype._onPlayStop=function(){this._isConnectedToTicker&&(Ut.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&&(Ut.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?(Ut.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._isSourcePlaying()&&(Ut.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}(ei),n_=function(r){ft(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}(ei);Gs.push(Dh,n_,t_,r_,i_,Rr,e_,Qv);var s_=function(r){ft(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===ye.UNPACK);var o=i.realWidth,a=i.realHeight;return n.width===o&&n.height===a?s.texSubImage2D(i.target,0,0,0,o,a,i.format,n.type,this.data):(n.width=o,n.height=a,s.texImage2D(i.target,0,n.internalFormat,o,a,0,i.format,n.type,this.data)),!0},e}(Rr),Xs=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 Xt("disposeFramebuffer"),this.multisample=wt.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 rt(null,{scaleMode:Me.NEAREST,resolution:1,mipmap:me.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},r.prototype.addDepthTexture=function(e){return this.depthTexture=e||new rt(new s_(null,{width:this.width,height:this.height}),{scaleMode:Me.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:me.OFF,format:F.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}(),Fh=function(r){ft(e,r);function e(t){t===void 0&&(t={});var i=this;if(typeof t=="number"){var n=arguments[0],s=arguments[1],o=arguments[2],a=arguments[3];t={width:n,height:s,scaleMode:o,resolution:a}}return t.width=t.width||100,t.height=t.height||100,t.multisample=t.multisample!==void 0?t.multisample:wt.NONE,i=r.call(this,null,t)||this,i.mipmap=me.OFF,i.valid=!0,i.clearColor=[0,0,0,0],i.framebuffer=new Xs(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}(rt),Bh=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 o=e.width/2/n,a=e.height/2/s,h=e.x/n+o,u=e.y/s+a;i=_t.add(i,_t.NW),this.x0=h+o*_t.uX(i),this.y0=u+a*_t.uY(i),i=_t.add(i,2),this.x1=h+o*_t.uX(i),this.y1=u+a*_t.uY(i),i=_t.add(i,2),this.x2=h+o*_t.uX(i),this.y2=u+a*_t.uY(i),i=_t.add(i,2),this.x3=h+o*_t.uX(i),this.y3=u+a*_t.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}(),Lh=new Bh;function xn(r){r.destroy=function(){},r.on=function(){},r.once=function(){},r.emit=function(){}}var Y=function(r){ft(e,r);function e(t,i,n,s,o,a){var h=r.call(this)||this;if(h.noFrame=!1,i||(h.noFrame=!0,i=new J(0,0,1,1)),t instanceof e&&(t=t.baseTexture),h.baseTexture=t,h._frame=i,h.trim=s,h.valid=!1,h._uvs=Lh,h.uvMatrix=null,h.orig=n||i,h._rotate=Number(o||0),o===!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=a?new j(a.x,a.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&&Ye[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===Lh&&(this._uvs=new Bh),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",o=null;if(s)o=t;else if(t instanceof rt){if(!t.cacheId){var a=i&&i.pixiIdPrefix||"pixiid";t.cacheId=a+"-"+Ei(),rt.addToCache(t,t.cacheId)}o=t.cacheId}else{if(!t._pixiId){var a=i&&i.pixiIdPrefix||"pixiid";t._pixiId=a+"_"+Ei()}o=t._pixiId}var h=Ye[o];if(s&&n&&!h)throw new Error('The cacheId "'+o+'" does not exist in TextureCache.');return!h&&!(t instanceof rt)?(i.resolution||(i.resolution=mn(t)),h=new e(new rt(t,i)),h.baseTexture.cacheId=o,rt.addToCache(h.baseTexture,o),e.addToCache(h,o)):!h&&t instanceof rt&&(h=new e(t),e.addToCache(h,o)),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),o=s.baseTexture.resource;return s.baseTexture.valid?Promise.resolve(s):o.load().then(function(){return Promise.resolve(s)})},e.fromBuffer=function(t,i,n,s){return new e(rt.fromBuffer(t,i,n,s))},e.fromLoader=function(t,i,n,s){var o=new rt(t,Object.assign({scaleMode:L.SCALE_MODE,resolution:mn(i)},s)),a=o.resource;a instanceof Dh&&(a.url=i);var h=new e(o);return n||(n=i),rt.addToCache(h.baseTexture,n),e.addToCache(h,n),n!==i&&(rt.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),Ye[i]&&console.warn("Texture added to the cache with an id ["+i+"] that already had an entry"),Ye[i]=t)},e.removeFromCache=function(t){if(typeof t=="string"){var i=Ye[t];if(i){var n=i.textureCacheIds.indexOf(t);return n>-1&&i.textureCacheIds.splice(n,1),delete Ye[t],i}}else if(t&&t.textureCacheIds){for(var s=0;s<t.textureCacheIds.length;++s)Ye[t.textureCacheIds[s]]===t&&delete Ye[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,o=t.height,a=i+s>this.baseTexture.width,h=n+o>this.baseTexture.height;if(a||h){var u=a&&h?"and":"or",l="X: "+i+" + "+s+" = "+(i+s)+" > "+this.baseTexture.width,f="Y: "+n+" + "+o+" = "+(n+o)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+(l+" "+u+" "+f))}this.valid=s&&o&&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 rt),xn(e._EMPTY),xn(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(rt.from(t)),xn(e._WHITE),xn(e._WHITE.baseTexture)}return e._WHITE},enumerable:!1,configurable:!0}),e}(yr),Pi=function(r){ft(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,o=Math.round(t*s)/s,a=Math.round(i*s)/s;this.valid=o>0&&a>0,this._frame.width=this.orig.width=o,this._frame.height=this.orig.height=a,n&&this.baseTexture.resize(o,a),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"&&(Te("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 Fh(t))},e}(Y),o_=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=wt.NONE);var n=new Fh(Object.assign({width:e,height:t,resolution:1,multisample:i},this.textureOptions));return new Pi(n)},r.prototype.getOptimalTexture=function(e,t,i,n){i===void 0&&(i=1),n===void 0&&(n=wt.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=_n(e),t=_n(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 o=this.texturePool[s].pop();return o||(o=this.createTexture(e,t,n)),o.filterPoolKey=s,o.setResolution(i),o},r.prototype.getFilterTexture=function(e,t,i){var n=this.getOptimalTexture(e.width,e.height,t||e.resolution,i||wt.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}(),Gh=function(){function r(e,t,i,n,s,o,a){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=o,this.instance=a}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}(),a_=0,Ft=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=a_++,this.disposeRunner=new Xt("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===De.ELEMENT_ARRAY_BUFFER},set:function(e){this.type=e?De.ELEMENT_ARRAY_BUFFER:De.ARRAY_BUFFER},enumerable:!1,configurable:!0}),r.from=function(e){return e instanceof Array&&(e=new Float32Array(e)),new r(e)},r}(),h_={Float32Array,Uint32Array,Int32Array,Uint8Array};function u_(r,e){for(var t=0,i=0,n={},s=0;s<r.length;s++)i+=e[s],t+=r[s].length;for(var o=new ArrayBuffer(t*4),a=null,h=0,s=0;s<r.length;s++){var u=e[s],l=r[s],f=Eh(l);n[f]||(n[f]=new h_[f](o)),a=n[f];for(var c=0;c<l.length;c++){var d=(c/u|0)*i+h,v=c%u;a[d+v]=l[c]}h+=u}return new Float32Array(o)}var Uh={5126:4,5123:2,5121:1},l_=0,f_={Float32Array,Uint32Array,Int32Array,Uint8Array,Uint16Array},Cr=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=l_++,this.instanced=!1,this.instanceCount=1,this.disposeRunner=new Xt("disposeGeometry"),this.refCount=0}return r.prototype.addAttribute=function(e,t,i,n,s,o,a,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 Ft||(t instanceof Array&&(t=new Float32Array(t)),t=new Ft(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 Gh(f,i,n,s,o,a,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 Ft||(e instanceof Array&&(e=new Uint16Array(e)),e=new Ft(e)),e.type=De.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 Ft,n;for(n in this.attributes){var s=this.attributes[n],o=this.buffers[s.buffer];e.push(o.data),t.push(s.size*Uh[s.type]/4),s.buffer=0}for(i.data=u_(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 Ft(this.buffers[t].data.slice(0));for(var t in this.attributes){var i=this.attributes[t];e.attributes[t]=new Gh(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=De.ELEMENT_ARRAY_BUFFER),e},r.merge=function(e){for(var t=new r,i=[],n=[],s=[],o,a=0;a<e.length;a++){o=e[a];for(var h=0;h<o.buffers.length;h++)n[h]=n[h]||0,n[h]+=o.buffers[h].data.length,s[h]=0}for(var a=0;a<o.buffers.length;a++)i[a]=new f_[Eh(o.buffers[a].data)](n[a]),t.buffers[a]=new Ft(i[a]);for(var a=0;a<e.length;a++){o=e[a];for(var h=0;h<o.buffers.length;h++)i[h].set(o.buffers[h].data,s[h]),s[h]+=o.buffers[h].data.length}if(t.attributes=o.attributes,o.indexBuffer){t.indexBuffer=t.buffers[o.buffers.indexOf(o.indexBuffer)],t.indexBuffer.type=De.ELEMENT_ARRAY_BUFFER;for(var u=0,l=0,f=0,c=0,a=0;a<o.buffers.length;a++)if(o.buffers[a]!==o.indexBuffer){c=a;break}for(var a in o.attributes){var d=o.attributes[a];(d.buffer|0)===c&&(l+=d.size*Uh[d.type]/4)}for(var a=0;a<e.length;a++){for(var v=e[a].indexBuffer.data,h=0;h<v.length;h++)t.indexBuffer.data[h+f]+=u;u+=e[a].buffers[c].data.length/l,f+=v.length}}return t},r}(),c_=function(r){ft(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}(Cr),kh=function(r){ft(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 Ft(t.vertices),t.uvBuffer=new Ft(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}(Cr),d_=0,Ri=function(){function r(e,t,i){this.group=!0,this.syncUniforms={},this.dirtyId=0,this.id=d_++,this.static=!!t,this.ubo=!!i,e instanceof Ft?(this.buffer=e,this.buffer.type=De.UNIFORM_BUFFER,this.autoManage=!1,this.ubo=!0):(this.uniforms=e,this.ubo&&(this.buffer=new Ft(new Float32Array(1)),this.buffer.type=De.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}(),p_=function(){function r(){this.renderTexture=null,this.target=null,this.legacy=!1,this.resolution=1,this.multisample=wt.NONE,this.sourceFrame=new J,this.destinationFrame=new J,this.bindingSourceFrame=new J,this.bindingDestinationFrame=new J,this.filters=[],this.transform=null}return r.prototype.clear=function(){this.target=null,this.filters=null,this.renderTexture=null},r}(),bn=[new j,new j,new j,new j],Hs=new Nt,v_=function(){function r(e){this.renderer=e,this.defaultFilterStack=[{}],this.texturePool=new o_,this.texturePool.setScreenSize(e.view),this.statePool=[],this.quad=new c_,this.quadUv=new kh,this.tempRect=new J,this.activeState={},this.globalUniforms=new Ri({outputFrame:new J,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,o=this.defaultFilterStack,a=this.statePool.pop()||new p_,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)}o.length===1&&(this.defaultFilterStack[0].renderTexture=h.current),o.push(a),a.resolution=u,a.multisample=l,a.legacy=d,a.target=e,a.sourceFrame.copyFrom(e.filterArea||e.getBounds(!0)),a.sourceFrame.pad(f);var _=this.tempRect.copyFrom(h.sourceFrame);s.projection.transform&&this.transformAABB(Hs.copyFrom(s.projection.transform).invert(),_),c?(a.sourceFrame.fit(_),(a.sourceFrame.width<=0||a.sourceFrame.height<=0)&&(a.sourceFrame.width=0,a.sourceFrame.height=0)):a.sourceFrame.intersects(_)||(a.sourceFrame.width=0,a.sourceFrame.height=0),this.roundFrame(a.sourceFrame,h.current?h.current.resolution:s.resolution,h.sourceFrame,h.destinationFrame,s.projection.transform),a.renderTexture=this.getOptimalFilterTexture(a.sourceFrame.width,a.sourceFrame.height,u,l),a.filters=t,a.destinationFrame.width=a.renderTexture.width,a.destinationFrame.height=a.renderTexture.height;var g=this.tempRect;g.x=0,g.y=0,g.width=a.sourceFrame.width,g.height=a.sourceFrame.height,a.renderTexture.filterFrame=a.sourceFrame,a.bindingSourceFrame.copyFrom(h.sourceFrame),a.bindingDestinationFrame.copyFrom(h.destinationFrame),a.transform=s.projection.transform,s.projection.transform=null,h.bind(a.renderTexture,a.sourceFrame,g),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,o=n.inputPixel,a=n.inputClamp;if(s[0]=t.destinationFrame.width,s[1]=t.destinationFrame.height,s[2]=1/s[0],s[3]=1/s[1],o[0]=Math.round(s[0]*t.resolution),o[1]=Math.round(s[1]*t.resolution),o[2]=1/o[0],o[3]=1/o[1],a[0]=.5*o[2],a[1]=.5*o[3],a[2]=t.sourceFrame.width*s[2]-.5*o[2],a[3]=t.sourceFrame.height*s[3]-.5*o[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,xe.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,xe.CLEAR,t);var d=l;l=f,f=d}i[c].apply(this,l,u.renderTexture,xe.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=xe.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 o=this.tempRect;o.x=0,o.y=0,o.width=e.filterFrame.width,o.height=e.filterFrame.height,n.bind(e,e.filterFrame,o)}else e!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?n.bind(e):this.renderer.renderTexture.bind(e,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);var a=s.stateId&1||this.forceClear;(t===xe.CLEAR||t===xe.BLIT&&a)&&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(ge.TRIANGLES)):(s.geometry.bind(this.quad),s.geometry.draw(ge.TRIANGLE_STRIP))},r.prototype.calculateSpriteMatrix=function(e,t){var i=this.activeState,n=i.sourceFrame,s=i.destinationFrame,o=t._texture.orig,a=e.set(s.width,0,0,s.height,n.x,n.y),h=t.worldTransform.copyTo(Nt.TEMP_MATRIX);return h.invert(),a.prepend(h),a.scale(1/o.width,1/o.height),a.translate(t.anchor.x,t.anchor.y),a},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=wt.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||wt.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=bn[0],n=bn[1],s=bn[2],o=bn[3];i.set(t.left,t.top),n.set(t.left,t.bottom),s.set(t.right,t.top),o.set(t.right,t.bottom),e.apply(i,i),e.apply(n,n),e.apply(s,s),e.apply(o,o);var a=Math.min(i.x,n.x,s.x,o.x),h=Math.min(i.y,n.y,s.y,o.y),u=Math.max(i.x,n.x,s.x,o.x),l=Math.max(i.y,n.y,s.y,o.y);t.x=a,t.y=h,t.width=u-a,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 o=s.a,a=s.b,h=s.c,u=s.d;if((Math.abs(a)>1e-4||Math.abs(h)>1e-4)&&(Math.abs(o)>1e-4||Math.abs(u)>1e-4))return}s=s?Hs.copyFrom(s):Hs.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}(),Tn=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}(),__=function(){function r(e){this.renderer=e,this.emptyRenderer=new Tn(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,o=e.ids,a=e.count,h=0,u=0;u<a;u++){var l=s[u],f=l._batchLocation;if(f>=0&&f<n&&t[f]===l){o[u]=f;continue}for(;h<n;){var c=t[h];if(c&&c._batchEnabled===i&&c._batchLocation===h){h++;continue}o[u]=h,l._batchLocation=h,t[h]=l;break}}},r.prototype.destroy=function(){this.renderer=null},r}(),Xh=0,g_=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=Xh++,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=Xh++,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>=We.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}(),m_=function(){function r(e){this.framebuffer=e,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=wt.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0}return r}(),y_=new J,x_=function(){function r(e){this.renderer=e,this.managedFramebuffers=[],this.unknownFramebuffer=new Xs(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 J,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===We.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 o=0;o<e.colorTextures.length;o++){var a=e.colorTextures[o];this.renderer.texture.unbind(a.parentTextureArray||a)}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=on.COLOR|on.DEPTH);var o=this.gl;o.clearColor(e,t,i,n),o.clear(s)},r.prototype.initFramebuffer=function(e){var t=this.gl,i=new m_(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 o=0;o<s;o++){var a=n[o],h=a.parentTextureArray||a;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,o=s.length;i.drawBuffers||(o=Math.min(o,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 a=[],h=0;h<o;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),a.push(i.COLOR_ATTACHMENT0+h))}if(a.length>1&&i.drawBuffers(a),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=wt.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=wt.NONE),i},r.prototype.blit=function(e,t,i){var n=this,s=n.current,o=n.renderer,a=n.gl,h=n.CONTEXT_UID;if(o.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 Xs(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=y_,t.width=s.width,t.height=s.height),i||(i=t);var f=t.width===i.width&&t.height===i.height;this.bind(e),a.bindFramebuffer(a.READ_FRAMEBUFFER,u.framebuffer),a.blitFramebuffer(t.left,t.top,t.right,t.bottom,i.left,i.top,i.right,i.bottom,a.COLOR_BUFFER_BIT,f?a.NEAREST:a.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,o=s.createRenderbuffer();s.bindRenderbuffer(s.RENDERBUFFER,o),t.msaaBuffer?s.renderbufferStorageMultisample(s.RENDERBUFFER,t.multisample,s.DEPTH24_STENCIL8,i,n):s.renderbufferStorage(s.RENDERBUFFER,s.DEPTH_STENCIL,i,n),t.stencil=o,s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_STENCIL_ATTACHMENT,s.RENDERBUFFER,o)}}},r.prototype.reset=function(){this.current=this.unknownFramebuffer,this.viewport=new J},r.prototype.destroy=function(){this.renderer=null},r}(),Ws={5126:4,5123:2,5121:1},b_=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===We.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,o){return n.vertexAttribDivisorANGLE(s,o)},e.drawElementsInstanced=function(s,o,a,h,u){return n.drawElementsInstancedANGLE(s,o,a,h,u)},e.drawArraysInstanced=function(s,o,a,h){return n.drawArraysInstancedANGLE(s,o,a,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 o=n[t.program.id]||this.initGeometryVao(e,t,s);this._activeGeometry=e,this._activeVao!==o&&(this._activeVao=o,this.hasVao?i.bindVertexArray(o):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 o in i)n[o]&&s.push(o,n[o].location);return s.join("-")},r.prototype.initGeometryVao=function(e,t,i){i===void 0&&(i=!0);var n=this.gl,s=this.CONTEXT_UID,o=this.renderer.buffer,a=t.program;a.glPrograms[s]||this.renderer.shader.generateProgram(t),this.checkCompatibility(e,a);var h=this.getSignature(e,a),u=e.glVertexArrayObjects[this.CONTEXT_UID],l=u[h];if(l)return u[a.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&&a.attributeData[p]?c[p].size=a.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*Ws[c[p].type];for(var p in c){var _=c[p],g=_.size;_.stride===void 0&&(d[_.buffer]===g*Ws[_.type]?_.stride=0:_.stride=d[_.buffer]),_.start===void 0&&(_.start=v[_.buffer],v[_.buffer]+=g*Ws[_.type])}l=n.createVertexArray(),n.bindVertexArray(l);for(var y=0;y<f.length;y++){var m=f[y];o.bind(m),i&&m._glBuffers[s].refCount++}return this.activateVao(e,a),this._activeVao=l,u[a.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,o=e.buffers,a=(i=this.renderer)===null||i===void 0?void 0:i.buffer;if(e.disposeRunner.remove(this),!!n){if(a)for(var h=0;h<o.length;h++){var u=o[h]._glBuffers[this.CONTEXT_UID];u&&(u.refCount--,u.refCount===0&&!t&&a.dispose(o[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,o=e.buffers,a=e.attributes;e.indexBuffer&&s.bind(e.indexBuffer);var h=null;for(var u in a){var l=a[u],f=o[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,o=this._activeGeometry;if(o.indexBuffer){var a=o.indexBuffer.data.BYTES_PER_ELEMENT,h=a===2?s.UNSIGNED_SHORT:s.UNSIGNED_INT;a===2||a===4&&this.canUseUInt32ElementIndex?o.instanced?s.drawElementsInstanced(e,t||o.indexBuffer.data.length,h,(i||0)*a,n||1):s.drawElements(e,t||o.indexBuffer.data.length,h,(i||0)*a):console.warn("unsupported index buffer type: uint32")}else o.instanced?s.drawArraysInstanced(e,i,t||o.getSize(),n||1):s.drawArrays(e,i,t||o.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}(),T_=function(){function r(e){e===void 0&&(e=null),this.type=It.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=It.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 Hh(r,e,t){var i=r.createShader(e);return r.shaderSource(i,t),r.compileShader(i),i}function Wh(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={},o=n.map(function(u){return parseFloat(u.replace(/^ERROR\: 0\:([\d]+)\:.*$/,"$1"))}).filter(function(u){return u&&!s[u]?(s[u]=!0,!0):!1}),a=[""];o.forEach(function(u){t[u-1]="%c"+t[u-1]+"%c",a.push("background: #FF0000; color:#FFFFFF; font-size: 10px","font-size: 10px")});var h=t.join(`
17
- `);a[0]=h,console.error(i),console.groupCollapsed("click to view full shader code"),console.warn.apply(console,a),console.groupEnd()}function w_(r,e,t,i){r.getProgramParameter(e,r.LINK_STATUS)||(r.getShaderParameter(t,r.COMPILE_STATUS)||Wh(r,t),r.getShaderParameter(i,r.COMPILE_STATUS)||Wh(r,i),console.error("PixiJS Error: Could not initialize shader."),r.getProgramInfoLog(e)!==""&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",r.getProgramInfoLog(e)))}function zs(r){for(var e=new Array(r),t=0;t<e.length;t++)e[t]=!1;return e}function zh(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 zs(2*e);case"bvec3":return zs(3*e);case"bvec4":return zs(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 Yh={},Or=Yh;function E_(){if(Or===Yh||Or&&Or.isContextLost()){var r=L.ADAPTER.createCanvas(),e=void 0;L.PREFER_ENV>=We.WEBGL2&&(e=r.getContext("webgl2",{})),e||(e=r.getContext("webgl",{})||r.getContext("experimental-webgl",{}),e?e.getExtension("WEBGL_draw_buffers"):e=null),Or=e}return Or}var wn;function S_(){if(!wn){wn=te.MEDIUM;var r=E_();if(r&&r.getShaderPrecisionFormat){var e=r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT);wn=e.precision?te.HIGH:te.MEDIUM}}return wn}function Vh(r,e,t){if(r.substring(0,9)!=="precision"){var i=e;return e===te.HIGH&&t!==te.HIGH&&(i=te.MEDIUM),"precision "+i+` float;
18
- `+r}else if(t!==te.HIGH&&r.substring(0,15)==="precision highp")return r.replace("precision highp","precision mediump");return r}var P_={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 jh(r){return P_[r]}var En=null,Zh={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 qh(r,e){if(!En){var t=Object.keys(Zh);En={};for(var i=0;i<t.length;++i){var n=t[i];En[r[n]]=Zh[n]}}return En[e]}var $i=[{test:function(r){return r.type==="float"&&r.size===1&&!r.isArray},code:function(r){return`
17
+ `);a[0]=h,console.error(i),console.groupCollapsed("click to view full shader code"),console.warn.apply(console,a),console.groupEnd()}function w_(r,e,t,i){r.getProgramParameter(e,r.LINK_STATUS)||(r.getShaderParameter(t,r.COMPILE_STATUS)||Wh(r,t),r.getShaderParameter(i,r.COMPILE_STATUS)||Wh(r,i),console.error("PixiJS Error: Could not initialize shader."),r.getProgramInfoLog(e)!==""&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",r.getProgramInfoLog(e)))}function zs(r){for(var e=new Array(r),t=0;t<e.length;t++)e[t]=!1;return e}function zh(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 zs(2*e);case"bvec3":return zs(3*e);case"bvec4":return zs(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 Yh={},Or=Yh;function E_(){if(Or===Yh||Or&&Or.isContextLost()){var r=L.ADAPTER.createCanvas(),e=void 0;L.PREFER_ENV>=We.WEBGL2&&(e=r.getContext("webgl2",{})),e||(e=r.getContext("webgl",{})||r.getContext("experimental-webgl",{}),e?e.getExtension("WEBGL_draw_buffers"):e=null),Or=e}return Or}var wn;function S_(){if(!wn){wn=Qt.MEDIUM;var r=E_();if(r&&r.getShaderPrecisionFormat){var e=r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT);wn=e.precision?Qt.HIGH:Qt.MEDIUM}}return wn}function Vh(r,e,t){if(r.substring(0,9)!=="precision"){var i=e;return e===Qt.HIGH&&t!==Qt.HIGH&&(i=Qt.MEDIUM),"precision "+i+` float;
18
+ `+r}else if(t!==Qt.HIGH&&r.substring(0,15)==="precision highp")return r.replace("precision highp","precision mediump");return r}var P_={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 jh(r){return P_[r]}var En=null,Zh={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 qh(r,e){if(!En){var t=Object.keys(Zh);En={};for(var i=0;i<t.length;++i){var n=t[i];En[r[n]]=Zh[n]}}return En[e]}var $i=[{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+`"]
@@ -253,7 +253,7 @@ Deprecated since v`+r),console.warn(i))),Rh[e]=!0}}var Ch={},Ye=Object.create(nu
253
253
  `+l+";")}}return new Function("ud","uv","renderer","syncData",i.join(`
254
254
  `))}var A_=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(`
255
255
  `);function I_(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 M_(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=A_.replace(/%forloop%/gi,I_(r));if(e.shaderSource(t,i),e.compileShader(t),!e.getShaderParameter(t,e.COMPILE_STATUS))r=r/2|0;else break}return r}var Ar;function D_(){if(typeof Ar=="boolean")return Ar;try{var r=new Function("param1","param2","param3","return param1[param2] === param3;");Ar=r({a:"b"},"a","b")===!0}catch{Ar=!1}return Ar}var N_=`varying vec2 vTextureCoord;
256
+ else `),t<r-1&&(e+="if(test == "+t+".0){}");return e}function M_(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=A_.replace(/%forloop%/gi,I_(r));if(e.shaderSource(t,i),e.compileShader(t),!e.getShaderParameter(t,e.COMPILE_STATUS))r=r/2|0;else break}return r}var Ar;function N_(){if(typeof Ar=="boolean")return Ar;try{var r=new Function("param1","param2","param3","return param1[param2] === param3;");Ar=r({a:"b"},"a","b")===!0}catch{Ar=!1}return Ar}var D_=`varying vec2 vTextureCoord;
257
257
 
258
258
  uniform sampler2D uSampler;
259
259
 
@@ -272,7 +272,7 @@ void main(void){
272
272
  }
273
273
  `,B_=0,Sn={},Ir=function(){function r(e,t,i){i===void 0&&(i="pixi-shader"),this.id=B_++,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,"-"),Sn[i]?(Sn[i]++,i+="-"+Sn[i]):Sn[i]=1,this.vertexSrc="#define SHADER_NAME "+i+`
274
274
  `+this.vertexSrc,this.fragmentSrc="#define SHADER_NAME "+i+`
275
- `+this.fragmentSrc,this.vertexSrc=Vh(this.vertexSrc,L.PRECISION_VERTEX,te.HIGH),this.fragmentSrc=Vh(this.fragmentSrc,L.PRECISION_FRAGMENT,S_())),this.glPrograms={},this.syncUniforms=null}return Object.defineProperty(r,"defaultVertexSrc",{get:function(){return F_},enumerable:!1,configurable:!0}),Object.defineProperty(r,"defaultFragmentSrc",{get:function(){return N_},enumerable:!1,configurable:!0}),r.from=function(e,t,i){var n=e+t,s=Ch[n];return s||(Ch[n]=s=new r(e,t,i)),s},r}(),ii=function(){function r(e,t){this.uniformBindCount=0,this.program=e,t?t instanceof Ri?this.uniformGroup=t:this.uniformGroup=new Ri(t):this.uniformGroup=new Ri({}),this.disposeRunner=new Xt("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=Ir.from(e,t);return new r(n,i)},r}(),Ys=0,Vs=1,js=2,Zs=3,qs=4,Ks=5,Ci=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<<Ys)},set:function(e){!!(this.data&1<<Ys)!==e&&(this.data^=1<<Ys)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"offsets",{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,"culling",{get:function(){return!!(this.data&1<<js)},set:function(e){!!(this.data&1<<js)!==e&&(this.data^=1<<js)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"depthTest",{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,"depthMask",{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,"clockwiseFrontFace",{get:function(){return!!(this.data&1<<qs)},set:function(e){!!(this.data&1<<qs)!==e&&(this.data^=1<<qs)},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}(),L_=`varying vec2 vTextureCoord;
275
+ `+this.fragmentSrc,this.vertexSrc=Vh(this.vertexSrc,L.PRECISION_VERTEX,Qt.HIGH),this.fragmentSrc=Vh(this.fragmentSrc,L.PRECISION_FRAGMENT,S_())),this.glPrograms={},this.syncUniforms=null}return Object.defineProperty(r,"defaultVertexSrc",{get:function(){return F_},enumerable:!1,configurable:!0}),Object.defineProperty(r,"defaultFragmentSrc",{get:function(){return D_},enumerable:!1,configurable:!0}),r.from=function(e,t,i){var n=e+t,s=Ch[n];return s||(Ch[n]=s=new r(e,t,i)),s},r}(),ii=function(){function r(e,t){this.uniformBindCount=0,this.program=e,t?t instanceof Ri?this.uniformGroup=t:this.uniformGroup=new Ri(t):this.uniformGroup=new Ri({}),this.disposeRunner=new Xt("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=Ir.from(e,t);return new r(n,i)},r}(),Ys=0,Vs=1,js=2,Zs=3,qs=4,Ks=5,Ci=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<<Ys)},set:function(e){!!(this.data&1<<Ys)!==e&&(this.data^=1<<Ys)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"offsets",{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,"culling",{get:function(){return!!(this.data&1<<js)},set:function(e){!!(this.data&1<<js)!==e&&(this.data^=1<<js)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"depthTest",{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,"depthMask",{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,"clockwiseFrontFace",{get:function(){return!!(this.data&1<<qs)},set:function(e){!!(this.data&1<<qs)!==e&&(this.data^=1<<qs)},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}(),L_=`varying vec2 vTextureCoord;
276
276
 
277
277
  uniform sampler2D uSampler;
278
278
 
@@ -346,7 +346,7 @@ void main(void)
346
346
 
347
347
  gl_FragColor = original;
348
348
  }
349
- `,Kh=new Dt,$s=function(){function r(e,t){this._texture=e,this.mapCoord=new Dt,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],o=e[n+1];t[n]=s*i.a+o*i.c+i.tx,t[n+1]=s*i.b+o*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&&(Kh.set(n.width/s.width,0,0,n.height/s.height,-s.x/s.width,-s.y/s.height),this.mapCoord.append(Kh));var o=t.baseTexture,a=this.uClampFrame,h=this.clampMargin/o.resolution,u=this.clampOffset;return a[0]=(t._frame.x+h+u)/o.width,a[1]=(t._frame.y+h+u)/o.height,a[2]=(t._frame.x+t._frame.width-h+u)/o.width,a[3]=(t._frame.y+t._frame.height-h+u)/o.height,this.uClampOffset[0]=u/o.realWidth,this.uClampOffset[1]=u/o.realHeight,this.isSimple=t._frame.width===o.width&&t._frame.height===o.height&&t.rotate===0,!0},r}(),X_=function(r){ft(e,r);function e(t,i,n){var s=this,o=null;return typeof t!="string"&&i===void 0&&n===void 0&&(o=t,t=void 0,i=void 0,n=void 0),s=r.call(this,t||U_,i||k_,n)||this,s.maskSprite=o,s.maskMatrix=new Dt,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 o=this._maskSprite,a=o._texture;a.valid&&(a.uvMatrix||(a.uvMatrix=new $s(a,0)),a.uvMatrix.update(),this.uniforms.npmAlpha=a.baseTexture.alphaMode?0:1,this.uniforms.mask=a,this.uniforms.otherMatrix=t.calculateSpriteMatrix(this.maskMatrix,o).prepend(a.uvMatrix.mapCoord),this.uniforms.alpha=o.worldAlpha,this.uniforms.maskClamp=a.uvMatrix.uClampFrame,t.applyFilter(this,i,n,s))},e}(ri),H_=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 T_;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!==It.SPRITE&&this.maskStack.push(i),i.enabled)switch(i.type){case It.SCISSOR:this.renderer.scissor.push(i);break;case It.STENCIL:this.renderer.stencil.push(i);break;case It.SPRITE:i.copyCountersOrReset(null),this.pushSpriteMask(i);break;case It.COLOR:this.pushColorMask(i);break}i.type===It.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 It.SCISSOR:this.renderer.scissor.pop(t);break;case It.STENCIL:this.renderer.stencil.pop(t.maskObject);break;case It.SPRITE:this.popSpriteMask(t);break;case It.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===It.SPRITE&&i._filters&&(i._filters[0].maskSprite=i.maskObject)}}},r.prototype.detect=function(e){var t=e.maskObject;t?t.isSprite?e.type=It.SPRITE:this.enableScissor&&this.renderer.scissor.testScissor(e)?e.type=It.SCISSOR:e.type=It.STENCIL:e.type=It.COLOR},r.prototype.pushSpriteMask=function(e){var t,i,n=e.maskObject,s=e._target,o=e._filters;o||(o=this.alphaMaskPool[this.alphaMaskIndex],o||(o=this.alphaMaskPool[this.alphaMaskIndex]=[new X_]));var a=this.renderer,h=a.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||a.resolution,l=(i=e.multisample)!==null&&i!==void 0?i:a.multisample;o[0].resolution=u,o[0].multisample=l,o[0].maskSprite=n;var c=s.filterArea;s.filterArea=n.getBounds(!0),a.filter.push(s,o),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}(),$h=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}(),Jh=new Dt,Qh=[],W_=function(r){ft(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,o=this.renderer,a=o.renderTexture,h=s.getBounds(!0,(i=Qh.pop())!==null&&i!==void 0?i:new J);this.roundFrameToPixels(h,a.current?a.current.resolution:o.resolution,a.sourceFrame,a.destinationFrame,o.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,o=t.d;return(Math.abs(n)>1e-4||Math.abs(s)>1e-4)&&(Math.abs(i)>1e-4||Math.abs(o)>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,o){e.isMatrixRotated(o)||(o=o?Jh.copyFrom(o):Jh.identity(),o.translate(-n.x,-n.y).scale(s.width/n.width,s.height/n.height).translate(s.x,s.y),this.renderer.filter.transformAABB(o,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&&Qh.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}($h),z_=function(r){ft(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 o=t._colorMask;o!==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,o!==0&&(t._colorMask=o,n.colorMask((o&1)!==0,(o&2)!==0,(o&4)!==0,(o&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}($h),Y_=function(){function r(e){this.renderer=e,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new Dt,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,o=n?-1:1;s.identity(),s.a=1/t.width*2,s.d=o*(1/t.height*2),s.tx=-1-t.x*s.a,s.ty=-o-t.y*s.d},r.prototype.setTransform=function(e){},r.prototype.destroy=function(){this.renderer=null},r}(),Oi=new J,Mr=new J,V_=function(){function r(e){this.renderer=e,this.clearColor=e._backgroundColorRgba,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new J,this.destinationFrame=new J,this.viewportFrame=new J}return r.prototype.bind=function(e,t,i){e===void 0&&(e=null);var n=this.renderer;this.current=e;var s,o,a;e?(s=e.baseTexture,a=s.resolution,t||(Oi.width=e.frame.width,Oi.height=e.frame.height,t=Oi),i||(Mr.x=e.frame.x,Mr.y=e.frame.y,Mr.width=t.width,Mr.height=t.height,i=Mr),o=s.framebuffer):(a=n.resolution,t||(Oi.width=n.screen.width,Oi.height=n.screen.height,t=Oi),i||(i=Oi,i.width=t.width,i.height=t.height));var h=this.viewportFrame;h.x=i.x*a,h.y=i.y*a,h.width=i.width*a,h.height=i.height*a,e||(h.y=n.view.height-(h.y+h.height)),h.ceil(),this.renderer.framebuffer.bind(o,h),this.renderer.projection.update(i,t,a,!o),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 o=this.viewportFrame,a=o.x,h=o.y,u=o.width,l=o.height;a=Math.round(a),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(a,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 j_(r,e,t,i,n){t.buffer.update(n)}var Z_={float:`
349
+ `,Kh=new Nt,$s=function(){function r(e,t){this._texture=e,this.mapCoord=new Nt,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],o=e[n+1];t[n]=s*i.a+o*i.c+i.tx,t[n+1]=s*i.b+o*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&&(Kh.set(n.width/s.width,0,0,n.height/s.height,-s.x/s.width,-s.y/s.height),this.mapCoord.append(Kh));var o=t.baseTexture,a=this.uClampFrame,h=this.clampMargin/o.resolution,u=this.clampOffset;return a[0]=(t._frame.x+h+u)/o.width,a[1]=(t._frame.y+h+u)/o.height,a[2]=(t._frame.x+t._frame.width-h+u)/o.width,a[3]=(t._frame.y+t._frame.height-h+u)/o.height,this.uClampOffset[0]=u/o.realWidth,this.uClampOffset[1]=u/o.realHeight,this.isSimple=t._frame.width===o.width&&t._frame.height===o.height&&t.rotate===0,!0},r}(),X_=function(r){ft(e,r);function e(t,i,n){var s=this,o=null;return typeof t!="string"&&i===void 0&&n===void 0&&(o=t,t=void 0,i=void 0,n=void 0),s=r.call(this,t||U_,i||k_,n)||this,s.maskSprite=o,s.maskMatrix=new Nt,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 o=this._maskSprite,a=o._texture;a.valid&&(a.uvMatrix||(a.uvMatrix=new $s(a,0)),a.uvMatrix.update(),this.uniforms.npmAlpha=a.baseTexture.alphaMode?0:1,this.uniforms.mask=a,this.uniforms.otherMatrix=t.calculateSpriteMatrix(this.maskMatrix,o).prepend(a.uvMatrix.mapCoord),this.uniforms.alpha=o.worldAlpha,this.uniforms.maskClamp=a.uvMatrix.uClampFrame,t.applyFilter(this,i,n,s))},e}(ri),H_=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 T_;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!==It.SPRITE&&this.maskStack.push(i),i.enabled)switch(i.type){case It.SCISSOR:this.renderer.scissor.push(i);break;case It.STENCIL:this.renderer.stencil.push(i);break;case It.SPRITE:i.copyCountersOrReset(null),this.pushSpriteMask(i);break;case It.COLOR:this.pushColorMask(i);break}i.type===It.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 It.SCISSOR:this.renderer.scissor.pop(t);break;case It.STENCIL:this.renderer.stencil.pop(t.maskObject);break;case It.SPRITE:this.popSpriteMask(t);break;case It.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===It.SPRITE&&i._filters&&(i._filters[0].maskSprite=i.maskObject)}}},r.prototype.detect=function(e){var t=e.maskObject;t?t.isSprite?e.type=It.SPRITE:this.enableScissor&&this.renderer.scissor.testScissor(e)?e.type=It.SCISSOR:e.type=It.STENCIL:e.type=It.COLOR},r.prototype.pushSpriteMask=function(e){var t,i,n=e.maskObject,s=e._target,o=e._filters;o||(o=this.alphaMaskPool[this.alphaMaskIndex],o||(o=this.alphaMaskPool[this.alphaMaskIndex]=[new X_]));var a=this.renderer,h=a.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||a.resolution,l=(i=e.multisample)!==null&&i!==void 0?i:a.multisample;o[0].resolution=u,o[0].multisample=l,o[0].maskSprite=n;var c=s.filterArea;s.filterArea=n.getBounds(!0),a.filter.push(s,o),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}(),$h=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}(),Jh=new Nt,Qh=[],W_=function(r){ft(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,o=this.renderer,a=o.renderTexture,h=s.getBounds(!0,(i=Qh.pop())!==null&&i!==void 0?i:new J);this.roundFrameToPixels(h,a.current?a.current.resolution:o.resolution,a.sourceFrame,a.destinationFrame,o.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,o=t.d;return(Math.abs(n)>1e-4||Math.abs(s)>1e-4)&&(Math.abs(i)>1e-4||Math.abs(o)>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,o){e.isMatrixRotated(o)||(o=o?Jh.copyFrom(o):Jh.identity(),o.translate(-n.x,-n.y).scale(s.width/n.width,s.height/n.height).translate(s.x,s.y),this.renderer.filter.transformAABB(o,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&&Qh.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}($h),z_=function(r){ft(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 o=t._colorMask;o!==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,o!==0&&(t._colorMask=o,n.colorMask((o&1)!==0,(o&2)!==0,(o&4)!==0,(o&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}($h),Y_=function(){function r(e){this.renderer=e,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new Nt,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,o=n?-1:1;s.identity(),s.a=1/t.width*2,s.d=o*(1/t.height*2),s.tx=-1-t.x*s.a,s.ty=-o-t.y*s.d},r.prototype.setTransform=function(e){},r.prototype.destroy=function(){this.renderer=null},r}(),Oi=new J,Mr=new J,V_=function(){function r(e){this.renderer=e,this.clearColor=e._backgroundColorRgba,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new J,this.destinationFrame=new J,this.viewportFrame=new J}return r.prototype.bind=function(e,t,i){e===void 0&&(e=null);var n=this.renderer;this.current=e;var s,o,a;e?(s=e.baseTexture,a=s.resolution,t||(Oi.width=e.frame.width,Oi.height=e.frame.height,t=Oi),i||(Mr.x=e.frame.x,Mr.y=e.frame.y,Mr.width=t.width,Mr.height=t.height,i=Mr),o=s.framebuffer):(a=n.resolution,t||(Oi.width=n.screen.width,Oi.height=n.screen.height,t=Oi),i||(i=Oi,i.width=t.width,i.height=t.height));var h=this.viewportFrame;h.x=i.x*a,h.y=i.y*a,h.width=i.width*a,h.height=i.height*a,e||(h.y=n.view.height-(h.y+h.height)),h.ceil(),this.renderer.framebuffer.bind(o,h),this.renderer.projection.update(i,t,a,!o),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 o=this.viewportFrame,a=o.x,h=o.y,u=o.width,l=o.height;a=Math.round(a),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(a,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 j_(r,e,t,i,n){t.buffer.update(n)}var Z_={float:`
350
350
  data[offset] = v;
351
351
  `,vec2:`
352
352
  data[offset] = v[0];
@@ -416,7 +416,7 @@ void main(void)
416
416
  `)}}return o.push(`
417
417
  renderer.buffer.update(buffer);
418
418
  `),{size:s,syncFunc:new Function("ud","uv","renderer","syncData","buffer",o.join(`
419
- `))}}var J_=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 Q_(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 o=qh(e,s.type),a={type:o,name:s.name,size:jh(o),location:e.getAttribLocation(r,s.name)};t[s.name]=a}}return t}function tg(r,e){for(var t={},i=e.getProgramParameter(r,e.ACTIVE_UNIFORMS),n=0;n<i;n++){var s=e.getActiveUniform(r,n),o=s.name.replace(/\[.*?\]$/,""),a=!!s.name.match(/\[.*?\]$/),h=qh(e,s.type);t[o]={name:o,index:n,type:h,size:s.size,isArray:a,value:zh(h,s.size)}}return t}function eg(r,e){var t=Hh(r,r.VERTEX_SHADER,e.vertexSrc),i=Hh(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)||w_(r,n,t,i),e.attributeData=Q_(n,r),e.uniformData=tg(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 o=0;o<s.length;o++)e.attributeData[s[o]].location=o,r.bindAttribLocation(n,o,s[o]);r.linkProgram(n)}r.deleteShader(t),r.deleteShader(i);var a={};for(var o in e.uniformData){var h=e.uniformData[o];a[o]={location:r.getUniformLocation(n,o),value:zh(h.type,h.size)}}var u=new J_(n,a);return u}var ig=0,Pn={textureCount:0,uboCount:0},rg=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=ig++}return r.prototype.systemCheck=function(){if(!D_())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||(Pn.textureCount=0,Pn.uboCount=0,this.syncUniformGroup(e.uniformGroup,Pn)),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]=O_(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,Pn,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 o=this.getSignature(e,this.shader.program.uniformData,"ubo"),a=this._uboCache[o];if(a||(a=this._uboCache[o]=$_(e,this.shader.program.uniformData)),e.autoManage){var h=new Float32Array(a.size/4);e.buffer.update(h)}return t.uniformGroups[e.id]=a.syncFunc,t.uniformGroups[e.id]},r.prototype.getSignature=function(e,t,i){var n=e.uniforms,s=[i+"-"];for(var o in n)s.push(o),t[o]&&s.push(t[o].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=eg(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 ng(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 sg=0,og=1,ag=2,hg=3,ug=4,lg=5,fg=function(){function r(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode=X.NONE,this._blendEq=!1,this.map=[],this.map[sg]=this.setBlend,this.map[og]=this.setOffset,this.map[ag]=this.setCullFace,this.map[hg]=this.setDepthTest,this.map[ug]=this.setFrontFace,this.map[lg]=this.setDepthMask,this.checks=[],this.defaultState=new Ci,this.defaultState.blend=!0}return r.prototype.contextChange=function(e){this.gl=e,this.blendModes=ng(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}(),cg=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!==hn.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 o=0,n=0;n<t.length;n++)t[n]!==null&&(t[o++]=t[n]);t.length=o}},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 dg(r){var e,t,i,n,s,o,a,h,u,l,f,c,d,v,p,_,g,y,m,b,x,T,w;return"WebGL2RenderingContext"in globalThis&&r instanceof globalThis.WebGL2RenderingContext?w=(e={},e[k.UNSIGNED_BYTE]=(t={},t[F.RGBA]=r.RGBA8,t[F.RGB]=r.RGB8,t[F.RG]=r.RG8,t[F.RED]=r.R8,t[F.RGBA_INTEGER]=r.RGBA8UI,t[F.RGB_INTEGER]=r.RGB8UI,t[F.RG_INTEGER]=r.RG8UI,t[F.RED_INTEGER]=r.R8UI,t[F.ALPHA]=r.ALPHA,t[F.LUMINANCE]=r.LUMINANCE,t[F.LUMINANCE_ALPHA]=r.LUMINANCE_ALPHA,t),e[k.BYTE]=(i={},i[F.RGBA]=r.RGBA8_SNORM,i[F.RGB]=r.RGB8_SNORM,i[F.RG]=r.RG8_SNORM,i[F.RED]=r.R8_SNORM,i[F.RGBA_INTEGER]=r.RGBA8I,i[F.RGB_INTEGER]=r.RGB8I,i[F.RG_INTEGER]=r.RG8I,i[F.RED_INTEGER]=r.R8I,i),e[k.UNSIGNED_SHORT]=(n={},n[F.RGBA_INTEGER]=r.RGBA16UI,n[F.RGB_INTEGER]=r.RGB16UI,n[F.RG_INTEGER]=r.RG16UI,n[F.RED_INTEGER]=r.R16UI,n[F.DEPTH_COMPONENT]=r.DEPTH_COMPONENT16,n),e[k.SHORT]=(s={},s[F.RGBA_INTEGER]=r.RGBA16I,s[F.RGB_INTEGER]=r.RGB16I,s[F.RG_INTEGER]=r.RG16I,s[F.RED_INTEGER]=r.R16I,s),e[k.UNSIGNED_INT]=(o={},o[F.RGBA_INTEGER]=r.RGBA32UI,o[F.RGB_INTEGER]=r.RGB32UI,o[F.RG_INTEGER]=r.RG32UI,o[F.RED_INTEGER]=r.R32UI,o[F.DEPTH_COMPONENT]=r.DEPTH_COMPONENT24,o),e[k.INT]=(a={},a[F.RGBA_INTEGER]=r.RGBA32I,a[F.RGB_INTEGER]=r.RGB32I,a[F.RG_INTEGER]=r.RG32I,a[F.RED_INTEGER]=r.R32I,a),e[k.FLOAT]=(h={},h[F.RGBA]=r.RGBA32F,h[F.RGB]=r.RGB32F,h[F.RG]=r.RG32F,h[F.RED]=r.R32F,h[F.DEPTH_COMPONENT]=r.DEPTH_COMPONENT32F,h),e[k.HALF_FLOAT]=(u={},u[F.RGBA]=r.RGBA16F,u[F.RGB]=r.RGB16F,u[F.RG]=r.RG16F,u[F.RED]=r.R16F,u),e[k.UNSIGNED_SHORT_5_6_5]=(l={},l[F.RGB]=r.RGB565,l),e[k.UNSIGNED_SHORT_4_4_4_4]=(f={},f[F.RGBA]=r.RGBA4,f),e[k.UNSIGNED_SHORT_5_5_5_1]=(c={},c[F.RGBA]=r.RGB5_A1,c),e[k.UNSIGNED_INT_2_10_10_10_REV]=(d={},d[F.RGBA]=r.RGB10_A2,d[F.RGBA_INTEGER]=r.RGB10_A2UI,d),e[k.UNSIGNED_INT_10F_11F_11F_REV]=(v={},v[F.RGB]=r.R11F_G11F_B10F,v),e[k.UNSIGNED_INT_5_9_9_9_REV]=(p={},p[F.RGB]=r.RGB9_E5,p),e[k.UNSIGNED_INT_24_8]=(_={},_[F.DEPTH_STENCIL]=r.DEPTH24_STENCIL8,_),e[k.FLOAT_32_UNSIGNED_INT_24_8_REV]=(g={},g[F.DEPTH_STENCIL]=r.DEPTH32F_STENCIL8,g),e):w=(y={},y[k.UNSIGNED_BYTE]=(m={},m[F.RGBA]=r.RGBA,m[F.RGB]=r.RGB,m[F.ALPHA]=r.ALPHA,m[F.LUMINANCE]=r.LUMINANCE,m[F.LUMINANCE_ALPHA]=r.LUMINANCE_ALPHA,m),y[k.UNSIGNED_SHORT_5_6_5]=(b={},b[F.RGB]=r.RGB,b),y[k.UNSIGNED_SHORT_4_4_4_4]=(x={},x[F.RGBA]=r.RGBA,x),y[k.UNSIGNED_SHORT_5_5_5_1]=(T={},T[F.RGBA]=r.RGBA,T),y),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=F.RGBA,this.samplerType=0}return r}(),pg=function(){function r(e){this.renderer=e,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new rt,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=dg(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 o=e-1;o>=0;--o){var a=i[o];if(a){var h=a._glTextures[s];h.samplerType!==an.FLOAT&&this.renderer.texture.unbind(a)}}},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!==an.FLOAT&&(this.hasIntegerTextures=!0);else{var n=e.realWidth,s=e.realHeight,o=i.gl;(t.width!==n||t.height!==s||t.dirtyId<0)&&(t.width=n,t.height=s,o.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&&qi(this.managedTextures,n,1)}},r.prototype.updateTextureStyle=function(e){var t=e._glTextures[this.CONTEXT_UID];t&&((e.mipmap===me.POW2||this.webGLVersion!==2)&&!e.isPowerOfTwo?t.mipmap=!1:t.mipmap=e.mipmap>=1,this.webGLVersion!==2&&!e.isPowerOfTwo?t.wrapMode=De.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!==me.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===Me.LINEAR?i.LINEAR_MIPMAP_LINEAR:i.NEAREST_MIPMAP_NEAREST);var n=this.renderer.context.extensions.anisotropicFiltering;if(n&&e.anisotropicLevel>0&&e.scaleMode===Me.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===Me.LINEAR?i.LINEAR:i.NEAREST);i.texParameteri(e.target,i.TEXTURE_MAG_FILTER,e.scaleMode===Me.LINEAR?i.LINEAR:i.NEAREST)},r.prototype.destroy=function(){this.renderer=null},r}(),Qs=new Dt,vg=function(r){ft(e,r);function e(t,i){t===void 0&&(t=mr.UNKNOWN);var n=r.call(this)||this;return i=Object.assign({},L.RENDER_OPTIONS,i),n.options=i,n.type=t,n.screen=new J(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&&(Te("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"&&(Te("6.1.0","generateTexture options (scaleMode, resolution, region) are now object options."),i={scaleMode:i,resolution:n,region:s});var o=i.region,a=$v(i,["region"]);s=o||t.getLocalBounds(null,!0),s.width===0&&(s.width=1),s.height===0&&(s.height=1);var h=Pi.create(ks({width:s.width,height:s.height},a));return Qs.tx=-s.x,Qs.ty=-s.y,this.render(t,{renderTexture:h,clear:!1,transform:Qs,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=mr.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=yh(t),Zi(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}(yr),_g=function(){function r(e){this.buffer=e||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}return r}(),gg=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 o=e._glBuffers[s]||this.createGLBuffer(e);this.boundBufferBases[t]=e,n.bindBufferBase(n.UNIFORM_BUFFER,t,o.buffer)}},r.prototype.bindBufferRange=function(e,t,i){var n=this,s=n.gl,o=n.CONTEXT_UID;i=i||0;var a=e._glBuffers[o]||this.createGLBuffer(e);s.bindBufferRange(s.UNIFORM_BUFFER,t||0,a.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 o=e.static?i.STATIC_DRAW:i.DYNAMIC_DRAW;s.byteLength=e.data.byteLength,i.bufferData(e.type,e.data,o)}},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 _g(n.createBuffer()),this.managedBuffers[e.id]=e,e.disposeRunner.add(this),e._glBuffers[i]},r}(),eu=function(r){ft(e,r);function e(t){var i=r.call(this,mr.WEBGL,t)||this;return t=i.options,i.gl=null,i.CONTEXT_UID=0,i.runners={destroy:new Xt("destroy"),contextChange:new Xt("contextChange"),reset:new Xt("reset"),update:new Xt("update"),postrender:new Xt("postrender"),prerender:new Xt("prerender"),resize:new Xt("resize")},i.runners.contextChange.add(i),i.globalUniforms=new Ri({projectionMatrix:new Dt},!0),i.addSystem(H_,"mask").addSystem(g_,"context").addSystem(fg,"state").addSystem(rg,"shader").addSystem(pg,"texture").addSystem(gg,"buffer").addSystem(b_,"geometry").addSystem(x_,"framebuffer").addSystem(W_,"scissor").addSystem(z_,"stencil").addSystem(Y_,"projection").addSystem(cg,"textureGC").addSystem(v_,"filter").addSystem(V_,"renderTexture").addSystem(__,"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,td(i.context.webGLVersion===2?"WebGL 2":"WebGL 1"),i.resize(i.options.width,i.options.height),i}return e.create=function(t){if(ed())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>=wt.HIGH?this.multisample=wt.HIGH:i>=wt.MEDIUM?this.multisample=wt.MEDIUM:i>=wt.LOW?this.multisample=wt.LOW:this.multisample=wt.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,o,a;if(i&&(i instanceof Pi?(Te("6.0.0","Renderer#render arguments changed, use options instead."),n=i,s=arguments[2],o=arguments[3],a=arguments[4]):(n=i.renderTexture,s=i.clear,o=i.transform,a=i.skipUpdateTransform)),this.renderingToScreen=!n,this.runners.prerender.emit(),this.emit("prerender"),this.projection.transform=o,!this.context.isLost){if(n||(this._lastObjectRendered=t),!a){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 o=r.prototype.generateTexture.call(this,t,i,n,s);return this.framebuffer.blit(),o},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 Te("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){Te("6.5.0","Renderer.registerPlugin() has been deprecated, please use extensions.add() instead."),Ve.add({name:t,type:at.RendererPlugin,ref:i})},e.__plugins={},e}(vg);Ve.handleByMap(at.RendererPlugin,eu.__plugins);function mg(r){return eu.create(r)}var yg=`attribute vec2 aVertexPosition;
419
+ `))}}var J_=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 Q_(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 o=qh(e,s.type),a={type:o,name:s.name,size:jh(o),location:e.getAttribLocation(r,s.name)};t[s.name]=a}}return t}function tg(r,e){for(var t={},i=e.getProgramParameter(r,e.ACTIVE_UNIFORMS),n=0;n<i;n++){var s=e.getActiveUniform(r,n),o=s.name.replace(/\[.*?\]$/,""),a=!!s.name.match(/\[.*?\]$/),h=qh(e,s.type);t[o]={name:o,index:n,type:h,size:s.size,isArray:a,value:zh(h,s.size)}}return t}function eg(r,e){var t=Hh(r,r.VERTEX_SHADER,e.vertexSrc),i=Hh(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)||w_(r,n,t,i),e.attributeData=Q_(n,r),e.uniformData=tg(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 o=0;o<s.length;o++)e.attributeData[s[o]].location=o,r.bindAttribLocation(n,o,s[o]);r.linkProgram(n)}r.deleteShader(t),r.deleteShader(i);var a={};for(var o in e.uniformData){var h=e.uniformData[o];a[o]={location:r.getUniformLocation(n,o),value:zh(h.type,h.size)}}var u=new J_(n,a);return u}var ig=0,Pn={textureCount:0,uboCount:0},rg=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=ig++}return r.prototype.systemCheck=function(){if(!N_())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||(Pn.textureCount=0,Pn.uboCount=0,this.syncUniformGroup(e.uniformGroup,Pn)),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]=O_(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,Pn,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 o=this.getSignature(e,this.shader.program.uniformData,"ubo"),a=this._uboCache[o];if(a||(a=this._uboCache[o]=$_(e,this.shader.program.uniformData)),e.autoManage){var h=new Float32Array(a.size/4);e.buffer.update(h)}return t.uniformGroups[e.id]=a.syncFunc,t.uniformGroups[e.id]},r.prototype.getSignature=function(e,t,i){var n=e.uniforms,s=[i+"-"];for(var o in n)s.push(o),t[o]&&s.push(t[o].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=eg(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 ng(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 sg=0,og=1,ag=2,hg=3,ug=4,lg=5,fg=function(){function r(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode=X.NONE,this._blendEq=!1,this.map=[],this.map[sg]=this.setBlend,this.map[og]=this.setOffset,this.map[ag]=this.setCullFace,this.map[hg]=this.setDepthTest,this.map[ug]=this.setFrontFace,this.map[lg]=this.setDepthMask,this.checks=[],this.defaultState=new Ci,this.defaultState.blend=!0}return r.prototype.contextChange=function(e){this.gl=e,this.blendModes=ng(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}(),cg=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!==hn.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 o=0,n=0;n<t.length;n++)t[n]!==null&&(t[o++]=t[n]);t.length=o}},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 dg(r){var e,t,i,n,s,o,a,h,u,l,f,c,d,v,p,_,g,y,m,b,x,T,w;return"WebGL2RenderingContext"in globalThis&&r instanceof globalThis.WebGL2RenderingContext?w=(e={},e[k.UNSIGNED_BYTE]=(t={},t[F.RGBA]=r.RGBA8,t[F.RGB]=r.RGB8,t[F.RG]=r.RG8,t[F.RED]=r.R8,t[F.RGBA_INTEGER]=r.RGBA8UI,t[F.RGB_INTEGER]=r.RGB8UI,t[F.RG_INTEGER]=r.RG8UI,t[F.RED_INTEGER]=r.R8UI,t[F.ALPHA]=r.ALPHA,t[F.LUMINANCE]=r.LUMINANCE,t[F.LUMINANCE_ALPHA]=r.LUMINANCE_ALPHA,t),e[k.BYTE]=(i={},i[F.RGBA]=r.RGBA8_SNORM,i[F.RGB]=r.RGB8_SNORM,i[F.RG]=r.RG8_SNORM,i[F.RED]=r.R8_SNORM,i[F.RGBA_INTEGER]=r.RGBA8I,i[F.RGB_INTEGER]=r.RGB8I,i[F.RG_INTEGER]=r.RG8I,i[F.RED_INTEGER]=r.R8I,i),e[k.UNSIGNED_SHORT]=(n={},n[F.RGBA_INTEGER]=r.RGBA16UI,n[F.RGB_INTEGER]=r.RGB16UI,n[F.RG_INTEGER]=r.RG16UI,n[F.RED_INTEGER]=r.R16UI,n[F.DEPTH_COMPONENT]=r.DEPTH_COMPONENT16,n),e[k.SHORT]=(s={},s[F.RGBA_INTEGER]=r.RGBA16I,s[F.RGB_INTEGER]=r.RGB16I,s[F.RG_INTEGER]=r.RG16I,s[F.RED_INTEGER]=r.R16I,s),e[k.UNSIGNED_INT]=(o={},o[F.RGBA_INTEGER]=r.RGBA32UI,o[F.RGB_INTEGER]=r.RGB32UI,o[F.RG_INTEGER]=r.RG32UI,o[F.RED_INTEGER]=r.R32UI,o[F.DEPTH_COMPONENT]=r.DEPTH_COMPONENT24,o),e[k.INT]=(a={},a[F.RGBA_INTEGER]=r.RGBA32I,a[F.RGB_INTEGER]=r.RGB32I,a[F.RG_INTEGER]=r.RG32I,a[F.RED_INTEGER]=r.R32I,a),e[k.FLOAT]=(h={},h[F.RGBA]=r.RGBA32F,h[F.RGB]=r.RGB32F,h[F.RG]=r.RG32F,h[F.RED]=r.R32F,h[F.DEPTH_COMPONENT]=r.DEPTH_COMPONENT32F,h),e[k.HALF_FLOAT]=(u={},u[F.RGBA]=r.RGBA16F,u[F.RGB]=r.RGB16F,u[F.RG]=r.RG16F,u[F.RED]=r.R16F,u),e[k.UNSIGNED_SHORT_5_6_5]=(l={},l[F.RGB]=r.RGB565,l),e[k.UNSIGNED_SHORT_4_4_4_4]=(f={},f[F.RGBA]=r.RGBA4,f),e[k.UNSIGNED_SHORT_5_5_5_1]=(c={},c[F.RGBA]=r.RGB5_A1,c),e[k.UNSIGNED_INT_2_10_10_10_REV]=(d={},d[F.RGBA]=r.RGB10_A2,d[F.RGBA_INTEGER]=r.RGB10_A2UI,d),e[k.UNSIGNED_INT_10F_11F_11F_REV]=(v={},v[F.RGB]=r.R11F_G11F_B10F,v),e[k.UNSIGNED_INT_5_9_9_9_REV]=(p={},p[F.RGB]=r.RGB9_E5,p),e[k.UNSIGNED_INT_24_8]=(_={},_[F.DEPTH_STENCIL]=r.DEPTH24_STENCIL8,_),e[k.FLOAT_32_UNSIGNED_INT_24_8_REV]=(g={},g[F.DEPTH_STENCIL]=r.DEPTH32F_STENCIL8,g),e):w=(y={},y[k.UNSIGNED_BYTE]=(m={},m[F.RGBA]=r.RGBA,m[F.RGB]=r.RGB,m[F.ALPHA]=r.ALPHA,m[F.LUMINANCE]=r.LUMINANCE,m[F.LUMINANCE_ALPHA]=r.LUMINANCE_ALPHA,m),y[k.UNSIGNED_SHORT_5_6_5]=(b={},b[F.RGB]=r.RGB,b),y[k.UNSIGNED_SHORT_4_4_4_4]=(x={},x[F.RGBA]=r.RGBA,x),y[k.UNSIGNED_SHORT_5_5_5_1]=(T={},T[F.RGBA]=r.RGBA,T),y),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=F.RGBA,this.samplerType=0}return r}(),pg=function(){function r(e){this.renderer=e,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new rt,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=dg(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 o=e-1;o>=0;--o){var a=i[o];if(a){var h=a._glTextures[s];h.samplerType!==an.FLOAT&&this.renderer.texture.unbind(a)}}},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!==an.FLOAT&&(this.hasIntegerTextures=!0);else{var n=e.realWidth,s=e.realHeight,o=i.gl;(t.width!==n||t.height!==s||t.dirtyId<0)&&(t.width=n,t.height=s,o.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&&qi(this.managedTextures,n,1)}},r.prototype.updateTextureStyle=function(e){var t=e._glTextures[this.CONTEXT_UID];t&&((e.mipmap===me.POW2||this.webGLVersion!==2)&&!e.isPowerOfTwo?t.mipmap=!1:t.mipmap=e.mipmap>=1,this.webGLVersion!==2&&!e.isPowerOfTwo?t.wrapMode=Ne.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!==me.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===Me.LINEAR?i.LINEAR_MIPMAP_LINEAR:i.NEAREST_MIPMAP_NEAREST);var n=this.renderer.context.extensions.anisotropicFiltering;if(n&&e.anisotropicLevel>0&&e.scaleMode===Me.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===Me.LINEAR?i.LINEAR:i.NEAREST);i.texParameteri(e.target,i.TEXTURE_MAG_FILTER,e.scaleMode===Me.LINEAR?i.LINEAR:i.NEAREST)},r.prototype.destroy=function(){this.renderer=null},r}(),Qs=new Nt,vg=function(r){ft(e,r);function e(t,i){t===void 0&&(t=mr.UNKNOWN);var n=r.call(this)||this;return i=Object.assign({},L.RENDER_OPTIONS,i),n.options=i,n.type=t,n.screen=new J(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&&(Te("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"&&(Te("6.1.0","generateTexture options (scaleMode, resolution, region) are now object options."),i={scaleMode:i,resolution:n,region:s});var o=i.region,a=$v(i,["region"]);s=o||t.getLocalBounds(null,!0),s.width===0&&(s.width=1),s.height===0&&(s.height=1);var h=Pi.create(ks({width:s.width,height:s.height},a));return Qs.tx=-s.x,Qs.ty=-s.y,this.render(t,{renderTexture:h,clear:!1,transform:Qs,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=mr.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=yh(t),Zi(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}(yr),_g=function(){function r(e){this.buffer=e||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}return r}(),gg=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 o=e._glBuffers[s]||this.createGLBuffer(e);this.boundBufferBases[t]=e,n.bindBufferBase(n.UNIFORM_BUFFER,t,o.buffer)}},r.prototype.bindBufferRange=function(e,t,i){var n=this,s=n.gl,o=n.CONTEXT_UID;i=i||0;var a=e._glBuffers[o]||this.createGLBuffer(e);s.bindBufferRange(s.UNIFORM_BUFFER,t||0,a.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 o=e.static?i.STATIC_DRAW:i.DYNAMIC_DRAW;s.byteLength=e.data.byteLength,i.bufferData(e.type,e.data,o)}},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 _g(n.createBuffer()),this.managedBuffers[e.id]=e,e.disposeRunner.add(this),e._glBuffers[i]},r}(),eu=function(r){ft(e,r);function e(t){var i=r.call(this,mr.WEBGL,t)||this;return t=i.options,i.gl=null,i.CONTEXT_UID=0,i.runners={destroy:new Xt("destroy"),contextChange:new Xt("contextChange"),reset:new Xt("reset"),update:new Xt("update"),postrender:new Xt("postrender"),prerender:new Xt("prerender"),resize:new Xt("resize")},i.runners.contextChange.add(i),i.globalUniforms=new Ri({projectionMatrix:new Nt},!0),i.addSystem(H_,"mask").addSystem(g_,"context").addSystem(fg,"state").addSystem(rg,"shader").addSystem(pg,"texture").addSystem(gg,"buffer").addSystem(b_,"geometry").addSystem(x_,"framebuffer").addSystem(W_,"scissor").addSystem(z_,"stencil").addSystem(Y_,"projection").addSystem(cg,"textureGC").addSystem(v_,"filter").addSystem(V_,"renderTexture").addSystem(__,"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,td(i.context.webGLVersion===2?"WebGL 2":"WebGL 1"),i.resize(i.options.width,i.options.height),i}return e.create=function(t){if(ed())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>=wt.HIGH?this.multisample=wt.HIGH:i>=wt.MEDIUM?this.multisample=wt.MEDIUM:i>=wt.LOW?this.multisample=wt.LOW:this.multisample=wt.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,o,a;if(i&&(i instanceof Pi?(Te("6.0.0","Renderer#render arguments changed, use options instead."),n=i,s=arguments[2],o=arguments[3],a=arguments[4]):(n=i.renderTexture,s=i.clear,o=i.transform,a=i.skipUpdateTransform)),this.renderingToScreen=!n,this.runners.prerender.emit(),this.emit("prerender"),this.projection.transform=o,!this.context.isLost){if(n||(this._lastObjectRendered=t),!a){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 o=r.prototype.generateTexture.call(this,t,i,n,s);return this.framebuffer.blit(),o},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 Te("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){Te("6.5.0","Renderer.registerPlugin() has been deprecated, please use extensions.add() instead."),Ve.add({name:t,type:at.RendererPlugin,ref:i})},e.__plugins={},e}(vg);Ve.handleByMap(at.RendererPlugin,eu.__plugins);function mg(r){return eu.create(r)}var yg=`attribute vec2 aVertexPosition;
420
420
  attribute vec2 aTextureCoord;
421
421
 
422
422
  uniform mat3 projectionMatrix;
@@ -453,7 +453,7 @@ void main(void)
453
453
  gl_Position = filterVertexPosition();
454
454
  vTextureCoord = filterTextureCoord();
455
455
  }
456
- `,bg=yg,iu=xg,to=function(){function r(){this.texArray=null,this.blend=0,this.type=ge.TRIANGLES,this.start=0,this.size=0,this.data=null}return r}(),eo=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}(),io=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}(),Tg=function(r){ft(e,r);function e(t){var i=r.call(this,t)||this;return i.shaderGenerator=null,i.geometryClass=null,i.vertexSize=null,i.state=Ci.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===We.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=M_(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 to);for(;i.length<s;)i.push(new eo);for(var o=0;o<this.MAX_TEXTURES;o++)this._tempBoundTextures[o]=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,o=this.renderer.batch,a=this._tempBoundTextures,h=this.renderer.textureGC.count,u=++rt._globalBatch,l=0,f=s[0],c=0;o.copyBoundTextures(a,n);for(var d=0;d<this._bufferSize;++d){var v=i[d];i[d]=null,v._batchEnabled!==u&&(f.count>=n&&(o.boundArray(f,a,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&&(o.boundArray(f,a,u,n),this.buildDrawCalls(f,c,this._bufferSize),++l,++u);for(var d=0;d<a.length;d++)a[d]=null;rt._globalBatch=u},e.prototype.buildDrawCalls=function(t,i,n){var s=this,o=s._bufferedElements,a=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 _=o[p],g=_._texture.baseTexture,y=bh[g.alphaMode?1:0][_.blendMode];o[p]=null,i<p&&v.blend!==y&&(v.size=d-v.start,i=p,v=l[++f],v.texArray=t,v.start=d),this.packInterleavedGeometry(_,a,h,c,d),c+=_.vertexData.length/2*u,d+=_.indices.length,v.blend=y}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,o=e._drawCallPool,a=null,h=0;h<t;h++){var u=o[h],l=u.texArray,f=u.type,c=u.size,d=u.start,v=u.blend;a!==l&&(a=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=_n(Math.ceil(t/8)),n=Ph(i),s=i*8;this._aBuffers.length<=n&&(this._iBuffers.length=n+1);var o=this._aBuffers[s];return o||(this._aBuffers[s]=o=new io(s*this.vertexSize*4)),o},e.prototype.getIndexBuffer=function(t){var i=_n(Math.ceil(t/12)),n=Ph(i),s=i*12;this._iBuffers.length<=n&&(this._iBuffers.length=n+1);var o=this._iBuffers[n];return o||(this._iBuffers[n]=o=new Uint16Array(s)),o},e.prototype.packInterleavedGeometry=function(t,i,n,s,o){for(var a=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?Ns(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],a[s++]=p,h[s++]=d;for(var _=0;_<f.length;_++)n[o++]=u+f[_]},e._drawCallPool=[],e._textureArrayPool=[],e}(Tn),wg=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]=Ri.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 Ir(this.vertexSrc,n)}var s={tint:new Float32Array([1,1,1,1]),translationMatrix:new Dt,default:this.defaultGroupCache[e]};return new ii(this.programCache[e],s)},r.prototype.generateSampleSrc=function(e){var t="";t+=`
456
+ `,bg=yg,iu=xg,to=function(){function r(){this.texArray=null,this.blend=0,this.type=ge.TRIANGLES,this.start=0,this.size=0,this.data=null}return r}(),eo=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}(),io=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}(),Tg=function(r){ft(e,r);function e(t){var i=r.call(this,t)||this;return i.shaderGenerator=null,i.geometryClass=null,i.vertexSize=null,i.state=Ci.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===We.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=M_(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 to);for(;i.length<s;)i.push(new eo);for(var o=0;o<this.MAX_TEXTURES;o++)this._tempBoundTextures[o]=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,o=this.renderer.batch,a=this._tempBoundTextures,h=this.renderer.textureGC.count,u=++rt._globalBatch,l=0,f=s[0],c=0;o.copyBoundTextures(a,n);for(var d=0;d<this._bufferSize;++d){var v=i[d];i[d]=null,v._batchEnabled!==u&&(f.count>=n&&(o.boundArray(f,a,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&&(o.boundArray(f,a,u,n),this.buildDrawCalls(f,c,this._bufferSize),++l,++u);for(var d=0;d<a.length;d++)a[d]=null;rt._globalBatch=u},e.prototype.buildDrawCalls=function(t,i,n){var s=this,o=s._bufferedElements,a=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 _=o[p],g=_._texture.baseTexture,y=bh[g.alphaMode?1:0][_.blendMode];o[p]=null,i<p&&v.blend!==y&&(v.size=d-v.start,i=p,v=l[++f],v.texArray=t,v.start=d),this.packInterleavedGeometry(_,a,h,c,d),c+=_.vertexData.length/2*u,d+=_.indices.length,v.blend=y}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,o=e._drawCallPool,a=null,h=0;h<t;h++){var u=o[h],l=u.texArray,f=u.type,c=u.size,d=u.start,v=u.blend;a!==l&&(a=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=_n(Math.ceil(t/8)),n=Ph(i),s=i*8;this._aBuffers.length<=n&&(this._iBuffers.length=n+1);var o=this._aBuffers[s];return o||(this._aBuffers[s]=o=new io(s*this.vertexSize*4)),o},e.prototype.getIndexBuffer=function(t){var i=_n(Math.ceil(t/12)),n=Ph(i),s=i*12;this._iBuffers.length<=n&&(this._iBuffers.length=n+1);var o=this._iBuffers[n];return o||(this._iBuffers[n]=o=new Uint16Array(s)),o},e.prototype.packInterleavedGeometry=function(t,i,n,s,o){for(var a=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?Ds(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],a[s++]=p,h[s++]=d;for(var _=0;_<f.length;_++)n[o++]=u+f[_]},e._drawCallPool=[],e._textureArrayPool=[],e}(Tn),wg=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]=Ri.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 Ir(this.vertexSrc,n)}var s={tint:new Float32Array([1,1,1,1]),translationMatrix:new Nt,default:this.defaultGroupCache[e]};return new ii(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+=`
@@ -492,7 +492,7 @@ void main(void){
492
492
  %forloop%
493
493
  gl_FragColor = color * vColor;
494
494
  }
495
- `,Eg=function(){function r(){}return r.create=function(e){var t=Object.assign({vertex:nu,fragment:su,geometryClass:ru,vertexSize:6},e),i=t.vertex,n=t.fragment,s=t.vertexSize,o=t.geometryClass;return function(a){ft(h,a);function h(u){var l=a.call(this,u)||this;return l.shaderGenerator=new wg(i,n),l.geometryClass=o,l.vertexSize=s,l}return h}(Tg)},Object.defineProperty(r,"defaultVertexSrc",{get:function(){return nu},enumerable:!1,configurable:!0}),Object.defineProperty(r,"defaultFragmentTemplate",{get:function(){return su},enumerable:!1,configurable:!0}),r}(),ou=Eg.create();Object.assign(ou,{extension:{name:"batch",type:at.RendererPlugin}});var Sg={accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:null,accessibleType:"button",accessiblePointerEvents:"auto",accessibleChildren:!0,renderId:-1};Ct.mixin(Sg);var Pg=9,Rn=100,Rg=0,Cg=0,au=2,hu=1,Og=-1e3,Ag=-1e3,Ig=2,Mg=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,(Fe.tablet||Fe.phone)&&this.createTouchHook();var t=document.createElement("div");t.style.width=Rn+"px",t.style.height=Rn+"px",t.style.position="absolute",t.style.top=Rg+"px",t.style.left=Cg+"px",t.style.zIndex=au.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=hu+"px",t.style.height=hu+"px",t.style.position="absolute",t.style.top=Og+"px",t.style.left=Ag+"px",t.style.zIndex=Ig.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(!(Fe.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,o=t.height,a=this.renderer,h=a.width,u=a.height,l=a.resolution,f=s/h*l,c=o/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,qi(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,g=p.worldTransform;p.hitArea?(d.style.left=(g.tx+_.x*g.a)*f+"px",d.style.top=(g.ty+_.y*g.d)*c+"px",d.style.width=_.width*g.a*f+"px",d.style.height=_.height*g.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=Rn+"px",t.style.height=Rn+"px",t.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",t.style.position="absolute",t.style.zIndex=au.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===Pg&&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:[at.RendererPlugin,at.CanvasRendererPlugin]},r}();var uu=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 ro=function(r,e){return ro=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])},ro(r,e)};function Dg(r,e){ro(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(){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}(),no=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}(),Fg=function(){function r(){this._tempPoint=new j}return r.prototype.recursiveFindHit=function(e,t,i,n,s){var o;if(!t||!t.visible)return!1;var a=e.data.global;s=t.interactive||s;var h=!1,u=s,l=!0;if(t.hitArea)n&&(t.worldTransform.applyInverse(a,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&&!(!((o=f.containsPoint)===null||o===void 0)&&o.call(f,a))&&(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(a)&&(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}(),Bg={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};Ct.mixin(Bg);var Cn=1,On={target:null,data:{global:null}},Lg=function(r){Dg(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 uu,n.mouse.identifier=Cn,n.mouse.global.set(-999999),n.activeInteractionData={},n.activeInteractionData[Cn]=n.mouse,n.interactionDataPool=[],n.eventData=new Ng,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 Fg,n._tempDisplayObject=new Ah,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 On.target=null,On.data.global=t,i||(i=this.lastObjectRendered),this.processInteractive(On,i,null,!0),On.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||(Ut.system.add(this.tickerUpdate,this,ee.INTERACTION),this.tickerAdded=!0)},e.prototype.removeTickerListener=function(){this.tickerAdded&&(Ut.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 o=1/this.resolution;t.x=(i-s.left)*(this.interactionDOMElement.width/s.width)*o,t.y=(n-s.top)*(this.interactionDOMElement.height/s.height)*o},e.prototype.processInteractive=function(t,i,n,s){var o=this.search.findHit(t,i,n,s),a=this.delayedEvents;if(!a.length)return o;t.stopPropagationHint=!1;var h=a.length;this.delayedEvents=[];for(var u=0;u<h;u++){var l=a[u],f=l.displayObject,c=l.eventString,d=l.eventData;d.stopsPropagatingAt===f&&(d.stopPropagationHint=!0),this.dispatchEvent(f,c,d)}return o},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,o=0;o<s;o++){var a=i[o],h=this.getInteractionDataForPointerId(a),u=this.configureInteractionEventForDOMEvent(this.eventData,a,h);if(u.data.originalEvent=t,this.processInteractive(u,this.lastObjectRendered,this.processPointerDown,!0),this.emit("pointerdown",u),a.pointerType==="touch")this.emit("touchstart",u);else if(a.pointerType==="mouse"||a.pointerType==="pen"){var l=a.button===2;this.emit(l?"rightdown":"mousedown",this.eventData)}}}},e.prototype.processPointerDown=function(t,i,n){var s=t.data,o=t.data.identifier;if(n){if(i.trackedPointers[o]||(i.trackedPointers[o]=new no(o)),this.dispatchEvent(i,"pointerdown",t),s.pointerType==="touch")this.dispatchEvent(i,"touchstart",t);else if(s.pointerType==="mouse"||s.pointerType==="pen"){var a=s.button===2;a?i.trackedPointers[o].rightDown=!0:i.trackedPointers[o].leftDown=!0,this.dispatchEvent(i,a?"rightdown":"mousedown",t)}}},e.prototype.onPointerComplete=function(t,i,n){var s=this.normalizeToPointerData(t),o=s.length,a=t.target;t.composedPath&&t.composedPath().length>0&&(a=t.composedPath()[0]);for(var h=a!==this.interactionDOMElement?"outside":"",u=0;u<o;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,o=t.data.identifier,a=i.trackedPointers[o],h=s.pointerType==="touch",u=s.pointerType==="mouse"||s.pointerType==="pen",l=!1;if(u){var f=s.button===2,c=no.FLAGS,d=f?c.RIGHT_DOWN:c.LEFT_DOWN,v=a!==void 0&&a.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),a&&(f?a.rightDown=!1:a.leftDown=!1)}n?(this.dispatchEvent(i,"pointerup",t),h&&this.dispatchEvent(i,"touchend",t),a&&((!u||l)&&this.dispatchEvent(i,"pointertap",t),h&&(this.dispatchEvent(i,"tap",t),a.over=!1))):a&&(this.dispatchEvent(i,"pointerupoutside",t),h&&this.dispatchEvent(i,"touchendoutside",t)),a&&a.none&&delete i.trackedPointers[o]},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 o=i[s],a=this.getInteractionDataForPointerId(o),h=this.configureInteractionEventForDOMEvent(this.eventData,o,a);h.data.originalEvent=t,this.processInteractive(h,this.lastObjectRendered,this.processPointerMove,!0),this.emit("pointermove",h),o.pointerType==="touch"&&this.emit("touchmove",h),(o.pointerType==="mouse"||o.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,o=s.pointerType==="touch",a=s.pointerType==="mouse"||s.pointerType==="pen";a&&this.processPointerOverOut(t,i,n),(!this.moveWhenInside||n)&&(this.dispatchEvent(i,"pointermove",t),o&&this.dispatchEvent(i,"touchmove",t),a&&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),o=this.configureInteractionEventForDOMEvent(this.eventData,n,s);o.data.originalEvent=n,this.processInteractive(o,this.lastObjectRendered,this.processPointerOverOut,!1),this.emit("pointerout",o),n.pointerType==="mouse"||n.pointerType==="pen"?this.emit("mouseout",o):this.releaseInteractionDataForPointerId(s.identifier)}},e.prototype.processPointerOverOut=function(t,i,n){var s=t.data,o=t.data.identifier,a=s.pointerType==="mouse"||s.pointerType==="pen",h=i.trackedPointers[o];n&&!h&&(h=i.trackedPointers[o]=new no(o)),h!==void 0&&(n&&this.mouseOverRenderer?(h.over||(h.over=!0,this.delayDispatchEvent(i,"pointerover",t),a&&this.delayDispatchEvent(i,"mouseover",t)),a&&this.cursor===null&&(this.cursor=i.cursor)):h.over&&(h.over=!1,this.dispatchEvent(i,"pointerout",this.eventData),a&&this.dispatchEvent(i,"mouseout",t),h.none&&delete i.trackedPointers[o]))},e.prototype.onPointerOver=function(t){if(!(this.supportsTouchEvents&&t.pointerType==="touch")){var i=this.normalizeToPointerData(t),n=i[0],s=this.getInteractionDataForPointerId(n),o=this.configureInteractionEventForDOMEvent(this.eventData,n,s);o.data.originalEvent=n,n.pointerType==="mouse"&&(this.mouseOverRenderer=!0),this.emit("pointerover",o),(n.pointerType==="mouse"||n.pointerType==="pen")&&this.emit("mouseover",o)}},e.prototype.getInteractionDataForPointerId=function(t){var i=t.pointerId,n;return i===Cn||t.pointerType==="mouse"?n=this.mouse:this.activeInteractionData[i]?n=this.activeInteractionData[i]:(n=this.interactionDataPool.pop()||new uu,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 o=t.changedTouches[n];typeof o.button>"u"&&(o.button=t.touches.length?1:0),typeof o.buttons>"u"&&(o.buttons=t.touches.length?1:0),typeof o.isPrimary>"u"&&(o.isPrimary=t.touches.length===1&&t.type==="touchstart"),typeof o.width>"u"&&(o.width=o.radiusX||1),typeof o.height>"u"&&(o.height=o.radiusY||1),typeof o.tiltX>"u"&&(o.tiltX=0),typeof o.tiltY>"u"&&(o.tiltY=0),typeof o.pointerType>"u"&&(o.pointerType="touch"),typeof o.pointerId>"u"&&(o.pointerId=o.identifier||0),typeof o.pressure>"u"&&(o.pressure=o.force||.5),typeof o.twist>"u"&&(o.twist=0),typeof o.tangentialPressure>"u"&&(o.tangentialPressure=0),typeof o.layerX>"u"&&(o.layerX=o.offsetX=o.clientX),typeof o.layerY>"u"&&(o.layerY=o.offsetY=o.clientY),o.isNormalized=!0,i.push(o)}else if(!globalThis.MouseEvent||t instanceof MouseEvent&&(!this.supportsPointerEvents||!(t instanceof globalThis.PointerEvent))){var a=t;typeof a.isPrimary>"u"&&(a.isPrimary=!0),typeof a.width>"u"&&(a.width=1),typeof a.height>"u"&&(a.height=1),typeof a.tiltX>"u"&&(a.tiltX=0),typeof a.tiltY>"u"&&(a.tiltY=0),typeof a.pointerType>"u"&&(a.pointerType="mouse"),typeof a.pointerId>"u"&&(a.pointerId=Cn),typeof a.pressure>"u"&&(a.pressure=.5),typeof a.twist>"u"&&(a.twist=0),typeof a.tangentialPressure>"u"&&(a.tangentialPressure=0),a.isNormalized=!0,i.push(a)}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:[at.RendererPlugin,at.CanvasRendererPlugin]},e}(yr);var lu=new J,fu=4,Gg=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,o,a=!1;e&&(e instanceof Pi?o=e:(o=this.renderer.generateTexture(e),a=!0)),o?(n=o.baseTexture.resolution,t=t??o.frame,s=!1,i.renderTexture.bind(o)):(n=i.resolution,t||(t=lu,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 Oh(h,u,1),f=new Uint8Array(fu*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 Oh(l.width,l.height,1);v.context.scale(1,-1),v.context.drawImage(l.canvas,0,-u),l.destroy(),l=v}return a&&o.destroy(!0),l.canvas},r.prototype.pixels=function(e,t){var i=this.renderer,n,s,o=!1;e&&(e instanceof Pi?s=e:(s=this.renderer.generateTexture(e),o=!0)),s?(n=s.baseTexture.resolution,t=t??s.frame,i.renderTexture.bind(s)):(n=i.resolution,t||(t=lu,t.width=i.width,t.height=i.height),i.renderTexture.bind(null));var a=Math.round(t.width*n),h=Math.round(t.height*n),u=new Uint8Array(fu*a*h),l=i.gl;return l.readPixels(Math.round(t.x*n),Math.round(t.y*n),a,h,l.RGBA,l.UNSIGNED_BYTE,u),o&&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:at.RendererPlugin},r}();var An=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 cu(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 je=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 An))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 cu(this,new An(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 cu(this,new An(e,!0,t))},r.prototype.detach=function(e){if(!(e instanceof An))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 du(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(o,a,h){a&&(n[t.q.name][a]=h)}),n}var so,In=null,Ug=0,pu=200,kg=204,Xg=1223,Hg=2;function vu(){}function _u(r,e,t){e&&e.indexOf(".")===0&&(e=e.substring(1)),e&&(r[e]=t)}function oo(r){return r.toString().replace("object ","")}var Et=function(){function r(e,t,i){if(this._dequeue=vu,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=vu,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 je,this.onProgress=new je,this.onComplete=new je,this.onAfterMiddleware=new je}return r.setExtensionLoadType=function(e,t){_u(r._loadTypeMap,e,t)},r.setExtensionXhrType=function(e,t){_u(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 so>"u"&&(so=!!(globalThis.XDomainRequest&&!("withCredentials"in new XMLHttpRequest))),so&&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(oo(e)+" Request failed. Status: "+e.status+', text: "'+e.statusText+'"')},r.prototype._xhrOnTimeout=function(){var e=this.xhr;this.abort(oo(e)+" Request timed out.")},r.prototype._xhrOnAbort=function(){var e=this.xhr;this.abort(oo(e)+" Request was aborted by the user.")},r.prototype._xhrOnLoad=function(){var e=this.xhr,t="",i=typeof e.status>"u"?pu:e.status;(e.responseType===""||e.responseType==="text"||typeof e.responseType>"u")&&(t=e.responseText),i===Ug&&(t.length>0||e.responseType===r.XHR_RESPONSE_TYPE.BUFFER)?i=pu:i===Xg&&(i=kg);var n=i/100|0;if(n===Hg)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(a){this.abort("Error trying to parse loaded json: "+a);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 o=document.createElement("div");o.innerHTML=t,this.data=o}this.type=r.TYPE.XML}catch(a){this.abort("Error trying to parse loaded xml: "+a);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,In||(In=document.createElement("a")),In.href=e;var i=du(In.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("#"),o=Math.min(n>-1?n:e.length,s>-1?s:e.length);e=e.substring(0,o),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=="})(Et||(Et={}));function Ai(){}function Wg(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 zg=function(){function r(e,t){this.data=e,this.callback=t}return r}(),ao=function(){function r(e,t){var i=this;if(t===void 0&&(t=1),this.workers=0,this.saturated=Ai,this.unsaturated=Ai,this.empty=Ai,this.drain=Ai,this.error=Ai,this.started=!1,this.paused=!1,this._tasks=[],this._insert=function(n,s,o){if(o&&typeof o!="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 a=new zg(n,typeof o=="function"?o:Ai);s?i._tasks.unshift(a):i._tasks.push(a),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,Wg(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=Ai,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,o=e.length;function a(h){if(h||s===o){i&&i(h);return}n?setTimeout(function(){t(e[s++],a)},1):t(e[s++],a)}a()},r.queue=function(e,t){return new r(e,t)},r}(),ho=100,Yg=/(#[\w-]+)?$/,Mn=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=ao.queue(this._boundLoadResource,t),this._queue.pause(),this.resources={},this.onProgress=new je,this.onError=new je,this.onLoad=new je,this.onStart=new je,this.onComplete=new je;for(var n=0;n<r._plugins.length;++n){var s=r._plugins[n],o=s.pre,a=s.use;o&&this.pre(o),a&&this.use(a)}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 Et(e,t,i),typeof n=="function"&&this.resources[e].onAfterMiddleware.once(n),this.loading){for(var s=i.parentResource,o=[],a=0;a<s.children.length;++a)s.children[a].isComplete||o.push(s.children[a]);var h=s.progressChunk*(o.length+1),u=h/(o.length+2);s.children.push(this.resources[e]),s.progressChunk=u;for(var a=0;a<o.length;++a)o[a].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(Te("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=ho/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=du(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=Yg.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,ao.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=ho,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(),ao.eachSeries(this._afterMiddleware,function(i,n){i.call(t,e,n)},function(){e.onAfterMiddleware.dispatch(e),t.progress=Math.min(ho,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 Te("6.5.0","Loader.registerPlugin() is deprecated, use extensions.add() instead."),Ve.add({type:at.Loader,ref:e}),r},r._plugins=[],r}();Ve.handleByList(at.Loader,Mn._plugins),Mn.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 Vg=function(){function r(){}return r.init=function(e){e=Object.assign({sharedLoader:!1},e),this.loader=e.sharedLoader?Mn.shared:new Mn},r.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},r.extension=at.Application,r}(),jg=function(){function r(){}return r.add=function(){Et.setExtensionLoadType("svg",Et.LOAD_TYPE.XHR),Et.setExtensionXhrType("svg",Et.XHR_RESPONSE_TYPE.TEXT)},r.use=function(e,t){if(e.data&&(e.type===Et.TYPE.IMAGE||e.extension==="svg")){var i=e.data,n=e.url,s=e.name,o=e.metadata;Y.fromLoader(i,n,s,o).then(function(a){e.texture=a,t()}).catch(t)}else t()},r.extension=at.Loader,r}(),Zg="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function qg(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 o=t-(r.length-1);switch(o){case 2:n[3]=64,n[2]=64;break;case 1:n[3]=64;break}for(var s=0;s<n.length;++s)e+=Zg.charAt(n[s])}return e}function Kg(r,e){if(!r.data){e();return}if(r.xhr&&r.xhrType===Et.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,"+qg(r.xhr.responseText),r.type=Et.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=Et.TYPE.IMAGE,r.data.onload=function(){i.revokeObjectURL(n),r.data.onload=null,e()};return}}e()}var $g=function(){function r(){}return r.extension=at.Loader,r.use=Kg,r}();Ve.add(jg,$g);var ot,q;(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"})(q||(q={}));var Dn=(ot={},ot[q.COMPRESSED_RGB_S3TC_DXT1_EXT]=.5,ot[q.COMPRESSED_RGBA_S3TC_DXT1_EXT]=.5,ot[q.COMPRESSED_RGBA_S3TC_DXT3_EXT]=1,ot[q.COMPRESSED_RGBA_S3TC_DXT5_EXT]=1,ot[q.COMPRESSED_SRGB_S3TC_DXT1_EXT]=.5,ot[q.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT]=.5,ot[q.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT]=1,ot[q.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT]=1,ot[q.COMPRESSED_R11_EAC]=.5,ot[q.COMPRESSED_SIGNED_R11_EAC]=.5,ot[q.COMPRESSED_RG11_EAC]=1,ot[q.COMPRESSED_SIGNED_RG11_EAC]=1,ot[q.COMPRESSED_RGB8_ETC2]=.5,ot[q.COMPRESSED_RGBA8_ETC2_EAC]=1,ot[q.COMPRESSED_SRGB8_ETC2]=.5,ot[q.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC]=1,ot[q.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2]=.5,ot[q.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2]=.5,ot[q.COMPRESSED_RGB_PVRTC_4BPPV1_IMG]=.5,ot[q.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG]=.5,ot[q.COMPRESSED_RGB_PVRTC_2BPPV1_IMG]=.25,ot[q.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG]=.25,ot[q.COMPRESSED_RGB_ETC1_WEBGL]=.5,ot[q.COMPRESSED_RGB_ATC_WEBGL]=.5,ot[q.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL]=1,ot[q.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL]=1,ot[q.COMPRESSED_RGBA_ASTC_4x4_KHR]=1,ot);var uo=function(r,e){return uo=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])},uo(r,e)};function gu(r,e){uo(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function Jg(r,e,t,i){function n(s){return s instanceof t?s:new t(function(o){o(s)})}return new(t||(t=Promise))(function(s,o){function a(l){try{u(i.next(l))}catch(f){o(f)}}function h(l){try{u(i.throw(l))}catch(f){o(f)}}function u(l){l.done?s(l.value):n(l.value).then(a,h)}u((i=i.apply(r,e||[])).next())})}function Qg(r,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(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 tm=function(r){gu(e,r);function e(t,i){i===void 0&&(i={width:1,height:1,autoLoad:!0});var n=this,s,o;return typeof t=="string"?(s=t,o=new Uint8Array):(s=null,o=t),n=r.call(this,o,i)||this,n.origin=s,n.buffer=o?new io(o):null,n.origin&&i.autoLoad!==!1&&n.load(),o&&o.length&&(n.loaded=!0,n.onBlobLoaded(n.buffer.rawBinaryData)),n}return e.prototype.onBlobLoaded=function(t){},e.prototype.load=function(){return Jg(this,void 0,Promise,function(){var t,i,n;return Qg(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 io(n),this.loaded=!0,this.onBlobLoaded(n),this.update(),[2,this]}})})},e}(Rr),lo=function(r){gu(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,o=t.context.extensions[this._extension];if(!o)throw new Error(this._extension+" textures are not supported on the current machine");if(!this._levelBuffers)return!1;for(var a=0,h=this.levels;a<h;a++){var u=this._levelBuffers[a],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,o,a,h){for(var u=new Array(n),l=t.byteOffset,f=a,c=h,d=f+s-1&~(s-1),v=c+o-1&~(o-1),p=d*v*Dn[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+o-1&~(o-1),p=d*v*Dn[i];return u},e}(tm),em=function(){function r(){}return r.use=function(e,t){var i=e.data,n=this;if(e.type===Et.TYPE.JSON&&i&&i.cacheID&&i.textures){for(var s=i.textures,o=void 0,a=void 0,h=0,u=s.length;h<u;h++){var l=s[h],f=l.src,c=l.format;if(c||(a=f),r.textureFormats[c]){o=f;break}}if(o=o||a,!o){t(new Error("Cannot load compressed-textures in "+e.url+", make sure you provide a fallback"));return}if(o===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=ji.resolve(e.url.replace(n.baseUrl,""),o),p=i.cacheID;n.add(p,v,d,function(_){if(_.error){t(_.error);return}var g=_.texture,y=g===void 0?null:g,m=_.textures,b=m===void 0?{}:m;Object.assign(e,{texture:y,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=at.Loader,r}();function mu(r,e,t){var i={textures:{},texture:null};if(!e)return i;var n=e.map(function(s){return new Y(new rt(s,Object.assign({mipmap:me.OFF,alphaMode:ye.NO_PREMULTIPLIED_ALPHA},t)))});return n.forEach(function(s,o){var a=s.baseTexture,h=r+"-"+(o+1);rt.addToCache(a,h),Y.addToCache(s,h),o===0&&(rt.addToCache(a,r),Y.addToCache(s,r),i.texture=s),i.textures[h]=s}),i}var Dr,we,fo=4,Nn=124,im=32,yu=20,rm=542327876,Fn={SIZE:1,FLAGS:2,HEIGHT:3,WIDTH:4,MIPMAP_COUNT:7,PIXEL_FORMAT:19},nm={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},Bn={DXGI_FORMAT:0,RESOURCE_DIMENSION:1,MISC_FLAG:2,ARRAY_SIZE:3,MISC_FLAGS2:4},Ee;(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"})(Ee||(Ee={}));var co;(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"})(co||(co={}));var sm=1,om=2,am=4,hm=64,um=512,lm=131072,fm=827611204,cm=861165636,dm=894720068,pm=808540228,vm=4,_m=(Dr={},Dr[fm]=q.COMPRESSED_RGBA_S3TC_DXT1_EXT,Dr[cm]=q.COMPRESSED_RGBA_S3TC_DXT3_EXT,Dr[dm]=q.COMPRESSED_RGBA_S3TC_DXT5_EXT,Dr),gm=(we={},we[Ee.DXGI_FORMAT_BC1_TYPELESS]=q.COMPRESSED_RGBA_S3TC_DXT1_EXT,we[Ee.DXGI_FORMAT_BC1_UNORM]=q.COMPRESSED_RGBA_S3TC_DXT1_EXT,we[Ee.DXGI_FORMAT_BC2_TYPELESS]=q.COMPRESSED_RGBA_S3TC_DXT3_EXT,we[Ee.DXGI_FORMAT_BC2_UNORM]=q.COMPRESSED_RGBA_S3TC_DXT3_EXT,we[Ee.DXGI_FORMAT_BC3_TYPELESS]=q.COMPRESSED_RGBA_S3TC_DXT5_EXT,we[Ee.DXGI_FORMAT_BC3_UNORM]=q.COMPRESSED_RGBA_S3TC_DXT5_EXT,we[Ee.DXGI_FORMAT_BC1_UNORM_SRGB]=q.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,we[Ee.DXGI_FORMAT_BC2_UNORM_SRGB]=q.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,we[Ee.DXGI_FORMAT_BC3_UNORM_SRGB]=q.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,we);function mm(r){var e=new Uint32Array(r),t=e[0];if(t!==rm)throw new Error("Invalid DDS file magic word");var i=new Uint32Array(r,0,Nn/Uint32Array.BYTES_PER_ELEMENT),n=i[Fn.HEIGHT],s=i[Fn.WIDTH],o=i[Fn.MIPMAP_COUNT],a=new Uint32Array(r,Fn.PIXEL_FORMAT*Uint32Array.BYTES_PER_ELEMENT,im/Uint32Array.BYTES_PER_ELEMENT),h=a[sm];if(h&am){var u=a[nm.FOURCC];if(u!==pm){var l=_m[u],f=fo+Nn,c=new Uint8Array(r,f),d=new lo(c,{format:l,width:s,height:n,levels:o});return[d]}var v=fo+Nn,p=new Uint32Array(e.buffer,v,yu/Uint32Array.BYTES_PER_ELEMENT),_=p[Bn.DXGI_FORMAT],g=p[Bn.RESOURCE_DIMENSION],y=p[Bn.MISC_FLAG],m=p[Bn.ARRAY_SIZE],b=gm[_];if(b===void 0)throw new Error("DDSParser cannot parse texture data with DXGI format "+_);if(y===vm)throw new Error("DDSParser does not support cubemap textures");if(g===co.DDS_DIMENSION_TEXTURE3D)throw new Error("DDSParser does not supported 3D texture data");var x=new Array,T=fo+Nn+yu;if(m===1)x.push(new Uint8Array(r,T));else{for(var w=Dn[b],S=0,E=s,P=n,O=0;O<o;O++){var N=Math.max(1,E+3&-4),D=Math.max(1,P+3&-4),U=N*D*w;S+=U,E=E>>>1,P=P>>>1}for(var I=T,O=0;O<m;O++)x.push(new Uint8Array(r,I,S)),I+=S}return x.map(function(A){return new lo(A,{format:b,width:s,height:n,levels:o})})}throw h&hm?new Error("DDSParser does not support uncompressed texture data."):h&um?new Error("DDSParser does not supported YUV uncompressed texture data."):h&lm?new Error("DDSParser does not support single-channel (lumninance) texture data!"):h&om?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 ni,Ze,Nr,xu=[171,75,84,88,32,49,49,187,13,10,26,10],ym=67305985,Se={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},po=64,bu=(ni={},ni[k.UNSIGNED_BYTE]=1,ni[k.UNSIGNED_SHORT]=2,ni[k.INT]=4,ni[k.UNSIGNED_INT]=4,ni[k.FLOAT]=4,ni[k.HALF_FLOAT]=8,ni),xm=(Ze={},Ze[F.RGBA]=4,Ze[F.RGB]=3,Ze[F.RG]=2,Ze[F.RED]=1,Ze[F.LUMINANCE]=1,Ze[F.LUMINANCE_ALPHA]=2,Ze[F.ALPHA]=1,Ze),bm=(Nr={},Nr[k.UNSIGNED_SHORT_4_4_4_4]=2,Nr[k.UNSIGNED_SHORT_5_5_5_1]=2,Nr[k.UNSIGNED_SHORT_5_6_5]=2,Nr);function Tm(r,e,t){t===void 0&&(t=!1);var i=new DataView(e);if(!wm(r,i))return null;var n=i.getUint32(Se.ENDIANNESS,!0)===ym,s=i.getUint32(Se.GL_TYPE,n),o=i.getUint32(Se.GL_FORMAT,n),a=i.getUint32(Se.GL_INTERNAL_FORMAT,n),h=i.getUint32(Se.PIXEL_WIDTH,n),u=i.getUint32(Se.PIXEL_HEIGHT,n)||1,l=i.getUint32(Se.PIXEL_DEPTH,n)||1,f=i.getUint32(Se.NUMBER_OF_ARRAY_ELEMENTS,n)||1,c=i.getUint32(Se.NUMBER_OF_FACES,n),d=i.getUint32(Se.NUMBER_OF_MIPMAP_LEVELS,n),v=i.getUint32(Se.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,g=h+3&-4,y=u+3&-4,m=new Array(f),b=h*u;s===0&&(b=g*y);var x;if(s!==0?bu[s]?x=bu[s]*xm[o]:x=bm[s]:x=Dn[a],x===void 0)throw new Error("Unable to resolve the pixel format stored in the *.ktx file!");for(var T=t?Sm(i,v,n):null,w=b*x,S=w,E=h,P=u,O=g,N=y,D=po+v,U=0;U<d;U++){for(var I=i.getUint32(D,n),A=D+4,B=0;B<f;B++){var K=m[B];K||(K=m[B]=new Array(d)),K[U]={levelID:U,levelWidth:d>1||s!==0?E:O,levelHeight:d>1||s!==0?P:N,levelBuffer:new Uint8Array(e,A,S)},A+=S}D+=I+4,D=D%4!==0?D+4-D%4:D,E=E>>1||1,P=P>>1||1,O=E+p-1&~(p-1),N=P+_-1&~(_-1),S=O*N*x}return s!==0?{uncompressed:m.map(function(z){var M=z[0].levelBuffer,C=!1;return s===k.FLOAT?M=new Float32Array(z[0].levelBuffer.buffer,z[0].levelBuffer.byteOffset,z[0].levelBuffer.byteLength/4):s===k.UNSIGNED_INT?(C=!0,M=new Uint32Array(z[0].levelBuffer.buffer,z[0].levelBuffer.byteOffset,z[0].levelBuffer.byteLength/4)):s===k.INT&&(C=!0,M=new Int32Array(z[0].levelBuffer.buffer,z[0].levelBuffer.byteOffset,z[0].levelBuffer.byteLength/4)),{resource:new Rr(M,{width:z[0].levelWidth,height:z[0].levelHeight}),type:s,format:C?Em(o):o}}),kvData:T}:{compressed:m.map(function(z){return new lo(null,{format:a,width:h,height:u,levels:d,levelBuffers:z})}),kvData:T}}function wm(r,e){for(var t=0;t<xu.length;t++)if(e.getUint8(t)!==xu[t])return console.error(r+" is not a valid *.ktx file!"),!1;return!0}function Em(r){switch(r){case F.RGBA:return F.RGBA_INTEGER;case F.RGB:return F.RGB_INTEGER;case F.RG:return F.RG_INTEGER;case F.RED:return F.RED_INTEGER;default:return r}}function Sm(r,e,t){for(var i=new Map,n=0;n<e;){var s=r.getUint32(po+n,t),o=po+n+4,a=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(o+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,o,h)),l=new DataView(r.buffer,o+h+1,s-h-1);i.set(u,l),n+=4+s+a}return i}Et.setExtensionXhrType("dds",Et.XHR_RESPONSE_TYPE.BUFFER);var Pm=function(){function r(){}return r.use=function(e,t){if(e.extension==="dds"&&e.data)try{Object.assign(e,mu(e.name||e.url,mm(e.data),e.metadata))}catch(i){t(i);return}t()},r.extension=at.Loader,r}();Et.setExtensionXhrType("ktx",Et.XHR_RESPONSE_TYPE.BUFFER);var Rm=function(){function r(){}return r.use=function(e,t){if(e.extension==="ktx"&&e.data)try{var i=e.name||e.url,n=Tm(i,e.data,this.loadKeyValueData),s=n.compressed,o=n.uncompressed,a=n.kvData;if(s){var h=mu(i,s,e.metadata);if(a&&h.textures)for(var u in h.textures)h.textures[u].baseTexture.ktxKeyValueData=a;Object.assign(e,h)}else if(o){var l={};o.forEach(function(f,c){var d=new Y(new rt(f.resource,{mipmap:me.OFF,alphaMode:ye.NO_PREMULTIPLIED_ALPHA,type:f.type,format:f.format})),v=i+"-"+(c+1);a&&(d.baseTexture.ktxKeyValueData=a),rt.addToCache(d.baseTexture,v),Y.addToCache(d,v),c===0&&(l[i]=d,rt.addToCache(d.baseTexture,i),Y.addToCache(d,i)),l[v]=d}),Object.assign(e,{textures:l})}}catch(f){t(f);return}t()},r.extension=at.Loader,r.loadKeyValueData=!1,r}();var vo=function(r,e){return vo=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])},vo(r,e)};function Tu(r,e){vo(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}(function(r){Tu(e,r);function e(t,i,n,s){t===void 0&&(t=1500),n===void 0&&(n=16384),s===void 0&&(s=!1);var o=r.call(this)||this,a=16384;return n>a&&(n=a),o._properties=[!1,!0,!1,!1,!1],o._maxSize=t,o._batchSize=n,o._buffers=null,o._bufferUpdateIDs=[],o._updateID=0,o.interactiveChildren=!1,o.blendMode=X.NORMAL,o.autoResize=s,o.roundPixels=!0,o.baseTexture=null,o.setProperties(i),o._tint=0,o.tintRgb=new Float32Array(4),o.tint=16777215,o}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,Zi(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})(ht);var wu=function(){function r(e,t,i){this.geometry=new Cr,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 Ft(Yv(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 Ft(this.dynamicData,!1,!1);var o=0;this.staticStride=0;for(var i=0;i<this.staticProperties.length;++i){var n=this.staticProperties[i];n.offset=o,o+=n.size,this.staticStride+=n.size}var a=new ArrayBuffer(this.size*this.staticStride*4*4);this.staticData=new Float32Array(a),this.staticDataUint32=new Uint32Array(a),this.staticBuffer=new Ft(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}(),Cm=`varying vec2 vTextureCoord;
495
+ `,Eg=function(){function r(){}return r.create=function(e){var t=Object.assign({vertex:nu,fragment:su,geometryClass:ru,vertexSize:6},e),i=t.vertex,n=t.fragment,s=t.vertexSize,o=t.geometryClass;return function(a){ft(h,a);function h(u){var l=a.call(this,u)||this;return l.shaderGenerator=new wg(i,n),l.geometryClass=o,l.vertexSize=s,l}return h}(Tg)},Object.defineProperty(r,"defaultVertexSrc",{get:function(){return nu},enumerable:!1,configurable:!0}),Object.defineProperty(r,"defaultFragmentTemplate",{get:function(){return su},enumerable:!1,configurable:!0}),r}(),ou=Eg.create();Object.assign(ou,{extension:{name:"batch",type:at.RendererPlugin}});var Sg={accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:null,accessibleType:"button",accessiblePointerEvents:"auto",accessibleChildren:!0,renderId:-1};Ct.mixin(Sg);var Pg=9,Rn=100,Rg=0,Cg=0,au=2,hu=1,Og=-1e3,Ag=-1e3,Ig=2,Mg=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,(Fe.tablet||Fe.phone)&&this.createTouchHook();var t=document.createElement("div");t.style.width=Rn+"px",t.style.height=Rn+"px",t.style.position="absolute",t.style.top=Rg+"px",t.style.left=Cg+"px",t.style.zIndex=au.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=hu+"px",t.style.height=hu+"px",t.style.position="absolute",t.style.top=Og+"px",t.style.left=Ag+"px",t.style.zIndex=Ig.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(!(Fe.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,o=t.height,a=this.renderer,h=a.width,u=a.height,l=a.resolution,f=s/h*l,c=o/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,qi(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,g=p.worldTransform;p.hitArea?(d.style.left=(g.tx+_.x*g.a)*f+"px",d.style.top=(g.ty+_.y*g.d)*c+"px",d.style.width=_.width*g.a*f+"px",d.style.height=_.height*g.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=Rn+"px",t.style.height=Rn+"px",t.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",t.style.position="absolute",t.style.zIndex=au.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===Pg&&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:[at.RendererPlugin,at.CanvasRendererPlugin]},r}();var uu=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 ro=function(r,e){return ro=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])},ro(r,e)};function Ng(r,e){ro(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Dg=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}(),no=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}(),Fg=function(){function r(){this._tempPoint=new j}return r.prototype.recursiveFindHit=function(e,t,i,n,s){var o;if(!t||!t.visible)return!1;var a=e.data.global;s=t.interactive||s;var h=!1,u=s,l=!0;if(t.hitArea)n&&(t.worldTransform.applyInverse(a,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&&!(!((o=f.containsPoint)===null||o===void 0)&&o.call(f,a))&&(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(a)&&(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}(),Bg={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};Ct.mixin(Bg);var Cn=1,On={target:null,data:{global:null}},Lg=function(r){Ng(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 uu,n.mouse.identifier=Cn,n.mouse.global.set(-999999),n.activeInteractionData={},n.activeInteractionData[Cn]=n.mouse,n.interactionDataPool=[],n.eventData=new Dg,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 Fg,n._tempDisplayObject=new Ah,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 On.target=null,On.data.global=t,i||(i=this.lastObjectRendered),this.processInteractive(On,i,null,!0),On.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||(Ut.system.add(this.tickerUpdate,this,te.INTERACTION),this.tickerAdded=!0)},e.prototype.removeTickerListener=function(){this.tickerAdded&&(Ut.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 o=1/this.resolution;t.x=(i-s.left)*(this.interactionDOMElement.width/s.width)*o,t.y=(n-s.top)*(this.interactionDOMElement.height/s.height)*o},e.prototype.processInteractive=function(t,i,n,s){var o=this.search.findHit(t,i,n,s),a=this.delayedEvents;if(!a.length)return o;t.stopPropagationHint=!1;var h=a.length;this.delayedEvents=[];for(var u=0;u<h;u++){var l=a[u],f=l.displayObject,c=l.eventString,d=l.eventData;d.stopsPropagatingAt===f&&(d.stopPropagationHint=!0),this.dispatchEvent(f,c,d)}return o},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,o=0;o<s;o++){var a=i[o],h=this.getInteractionDataForPointerId(a),u=this.configureInteractionEventForDOMEvent(this.eventData,a,h);if(u.data.originalEvent=t,this.processInteractive(u,this.lastObjectRendered,this.processPointerDown,!0),this.emit("pointerdown",u),a.pointerType==="touch")this.emit("touchstart",u);else if(a.pointerType==="mouse"||a.pointerType==="pen"){var l=a.button===2;this.emit(l?"rightdown":"mousedown",this.eventData)}}}},e.prototype.processPointerDown=function(t,i,n){var s=t.data,o=t.data.identifier;if(n){if(i.trackedPointers[o]||(i.trackedPointers[o]=new no(o)),this.dispatchEvent(i,"pointerdown",t),s.pointerType==="touch")this.dispatchEvent(i,"touchstart",t);else if(s.pointerType==="mouse"||s.pointerType==="pen"){var a=s.button===2;a?i.trackedPointers[o].rightDown=!0:i.trackedPointers[o].leftDown=!0,this.dispatchEvent(i,a?"rightdown":"mousedown",t)}}},e.prototype.onPointerComplete=function(t,i,n){var s=this.normalizeToPointerData(t),o=s.length,a=t.target;t.composedPath&&t.composedPath().length>0&&(a=t.composedPath()[0]);for(var h=a!==this.interactionDOMElement?"outside":"",u=0;u<o;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,o=t.data.identifier,a=i.trackedPointers[o],h=s.pointerType==="touch",u=s.pointerType==="mouse"||s.pointerType==="pen",l=!1;if(u){var f=s.button===2,c=no.FLAGS,d=f?c.RIGHT_DOWN:c.LEFT_DOWN,v=a!==void 0&&a.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),a&&(f?a.rightDown=!1:a.leftDown=!1)}n?(this.dispatchEvent(i,"pointerup",t),h&&this.dispatchEvent(i,"touchend",t),a&&((!u||l)&&this.dispatchEvent(i,"pointertap",t),h&&(this.dispatchEvent(i,"tap",t),a.over=!1))):a&&(this.dispatchEvent(i,"pointerupoutside",t),h&&this.dispatchEvent(i,"touchendoutside",t)),a&&a.none&&delete i.trackedPointers[o]},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 o=i[s],a=this.getInteractionDataForPointerId(o),h=this.configureInteractionEventForDOMEvent(this.eventData,o,a);h.data.originalEvent=t,this.processInteractive(h,this.lastObjectRendered,this.processPointerMove,!0),this.emit("pointermove",h),o.pointerType==="touch"&&this.emit("touchmove",h),(o.pointerType==="mouse"||o.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,o=s.pointerType==="touch",a=s.pointerType==="mouse"||s.pointerType==="pen";a&&this.processPointerOverOut(t,i,n),(!this.moveWhenInside||n)&&(this.dispatchEvent(i,"pointermove",t),o&&this.dispatchEvent(i,"touchmove",t),a&&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),o=this.configureInteractionEventForDOMEvent(this.eventData,n,s);o.data.originalEvent=n,this.processInteractive(o,this.lastObjectRendered,this.processPointerOverOut,!1),this.emit("pointerout",o),n.pointerType==="mouse"||n.pointerType==="pen"?this.emit("mouseout",o):this.releaseInteractionDataForPointerId(s.identifier)}},e.prototype.processPointerOverOut=function(t,i,n){var s=t.data,o=t.data.identifier,a=s.pointerType==="mouse"||s.pointerType==="pen",h=i.trackedPointers[o];n&&!h&&(h=i.trackedPointers[o]=new no(o)),h!==void 0&&(n&&this.mouseOverRenderer?(h.over||(h.over=!0,this.delayDispatchEvent(i,"pointerover",t),a&&this.delayDispatchEvent(i,"mouseover",t)),a&&this.cursor===null&&(this.cursor=i.cursor)):h.over&&(h.over=!1,this.dispatchEvent(i,"pointerout",this.eventData),a&&this.dispatchEvent(i,"mouseout",t),h.none&&delete i.trackedPointers[o]))},e.prototype.onPointerOver=function(t){if(!(this.supportsTouchEvents&&t.pointerType==="touch")){var i=this.normalizeToPointerData(t),n=i[0],s=this.getInteractionDataForPointerId(n),o=this.configureInteractionEventForDOMEvent(this.eventData,n,s);o.data.originalEvent=n,n.pointerType==="mouse"&&(this.mouseOverRenderer=!0),this.emit("pointerover",o),(n.pointerType==="mouse"||n.pointerType==="pen")&&this.emit("mouseover",o)}},e.prototype.getInteractionDataForPointerId=function(t){var i=t.pointerId,n;return i===Cn||t.pointerType==="mouse"?n=this.mouse:this.activeInteractionData[i]?n=this.activeInteractionData[i]:(n=this.interactionDataPool.pop()||new uu,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 o=t.changedTouches[n];typeof o.button>"u"&&(o.button=t.touches.length?1:0),typeof o.buttons>"u"&&(o.buttons=t.touches.length?1:0),typeof o.isPrimary>"u"&&(o.isPrimary=t.touches.length===1&&t.type==="touchstart"),typeof o.width>"u"&&(o.width=o.radiusX||1),typeof o.height>"u"&&(o.height=o.radiusY||1),typeof o.tiltX>"u"&&(o.tiltX=0),typeof o.tiltY>"u"&&(o.tiltY=0),typeof o.pointerType>"u"&&(o.pointerType="touch"),typeof o.pointerId>"u"&&(o.pointerId=o.identifier||0),typeof o.pressure>"u"&&(o.pressure=o.force||.5),typeof o.twist>"u"&&(o.twist=0),typeof o.tangentialPressure>"u"&&(o.tangentialPressure=0),typeof o.layerX>"u"&&(o.layerX=o.offsetX=o.clientX),typeof o.layerY>"u"&&(o.layerY=o.offsetY=o.clientY),o.isNormalized=!0,i.push(o)}else if(!globalThis.MouseEvent||t instanceof MouseEvent&&(!this.supportsPointerEvents||!(t instanceof globalThis.PointerEvent))){var a=t;typeof a.isPrimary>"u"&&(a.isPrimary=!0),typeof a.width>"u"&&(a.width=1),typeof a.height>"u"&&(a.height=1),typeof a.tiltX>"u"&&(a.tiltX=0),typeof a.tiltY>"u"&&(a.tiltY=0),typeof a.pointerType>"u"&&(a.pointerType="mouse"),typeof a.pointerId>"u"&&(a.pointerId=Cn),typeof a.pressure>"u"&&(a.pressure=.5),typeof a.twist>"u"&&(a.twist=0),typeof a.tangentialPressure>"u"&&(a.tangentialPressure=0),a.isNormalized=!0,i.push(a)}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:[at.RendererPlugin,at.CanvasRendererPlugin]},e}(yr);var lu=new J,fu=4,Gg=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,o,a=!1;e&&(e instanceof Pi?o=e:(o=this.renderer.generateTexture(e),a=!0)),o?(n=o.baseTexture.resolution,t=t??o.frame,s=!1,i.renderTexture.bind(o)):(n=i.resolution,t||(t=lu,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 Oh(h,u,1),f=new Uint8Array(fu*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 Oh(l.width,l.height,1);v.context.scale(1,-1),v.context.drawImage(l.canvas,0,-u),l.destroy(),l=v}return a&&o.destroy(!0),l.canvas},r.prototype.pixels=function(e,t){var i=this.renderer,n,s,o=!1;e&&(e instanceof Pi?s=e:(s=this.renderer.generateTexture(e),o=!0)),s?(n=s.baseTexture.resolution,t=t??s.frame,i.renderTexture.bind(s)):(n=i.resolution,t||(t=lu,t.width=i.width,t.height=i.height),i.renderTexture.bind(null));var a=Math.round(t.width*n),h=Math.round(t.height*n),u=new Uint8Array(fu*a*h),l=i.gl;return l.readPixels(Math.round(t.x*n),Math.round(t.y*n),a,h,l.RGBA,l.UNSIGNED_BYTE,u),o&&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:at.RendererPlugin},r}();var An=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 cu(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 je=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 An))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 cu(this,new An(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 cu(this,new An(e,!0,t))},r.prototype.detach=function(e){if(!(e instanceof An))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 du(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(o,a,h){a&&(n[t.q.name][a]=h)}),n}var so,In=null,Ug=0,pu=200,kg=204,Xg=1223,Hg=2;function vu(){}function _u(r,e,t){e&&e.indexOf(".")===0&&(e=e.substring(1)),e&&(r[e]=t)}function oo(r){return r.toString().replace("object ","")}var Et=function(){function r(e,t,i){if(this._dequeue=vu,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=vu,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 je,this.onProgress=new je,this.onComplete=new je,this.onAfterMiddleware=new je}return r.setExtensionLoadType=function(e,t){_u(r._loadTypeMap,e,t)},r.setExtensionXhrType=function(e,t){_u(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 so>"u"&&(so=!!(globalThis.XDomainRequest&&!("withCredentials"in new XMLHttpRequest))),so&&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(oo(e)+" Request failed. Status: "+e.status+', text: "'+e.statusText+'"')},r.prototype._xhrOnTimeout=function(){var e=this.xhr;this.abort(oo(e)+" Request timed out.")},r.prototype._xhrOnAbort=function(){var e=this.xhr;this.abort(oo(e)+" Request was aborted by the user.")},r.prototype._xhrOnLoad=function(){var e=this.xhr,t="",i=typeof e.status>"u"?pu:e.status;(e.responseType===""||e.responseType==="text"||typeof e.responseType>"u")&&(t=e.responseText),i===Ug&&(t.length>0||e.responseType===r.XHR_RESPONSE_TYPE.BUFFER)?i=pu:i===Xg&&(i=kg);var n=i/100|0;if(n===Hg)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(a){this.abort("Error trying to parse loaded json: "+a);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 o=document.createElement("div");o.innerHTML=t,this.data=o}this.type=r.TYPE.XML}catch(a){this.abort("Error trying to parse loaded xml: "+a);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,In||(In=document.createElement("a")),In.href=e;var i=du(In.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("#"),o=Math.min(n>-1?n:e.length,s>-1?s:e.length);e=e.substring(0,o),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=="})(Et||(Et={}));function Ai(){}function Wg(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 zg=function(){function r(e,t){this.data=e,this.callback=t}return r}(),ao=function(){function r(e,t){var i=this;if(t===void 0&&(t=1),this.workers=0,this.saturated=Ai,this.unsaturated=Ai,this.empty=Ai,this.drain=Ai,this.error=Ai,this.started=!1,this.paused=!1,this._tasks=[],this._insert=function(n,s,o){if(o&&typeof o!="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 a=new zg(n,typeof o=="function"?o:Ai);s?i._tasks.unshift(a):i._tasks.push(a),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,Wg(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=Ai,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,o=e.length;function a(h){if(h||s===o){i&&i(h);return}n?setTimeout(function(){t(e[s++],a)},1):t(e[s++],a)}a()},r.queue=function(e,t){return new r(e,t)},r}(),ho=100,Yg=/(#[\w-]+)?$/,Mn=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=ao.queue(this._boundLoadResource,t),this._queue.pause(),this.resources={},this.onProgress=new je,this.onError=new je,this.onLoad=new je,this.onStart=new je,this.onComplete=new je;for(var n=0;n<r._plugins.length;++n){var s=r._plugins[n],o=s.pre,a=s.use;o&&this.pre(o),a&&this.use(a)}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 Et(e,t,i),typeof n=="function"&&this.resources[e].onAfterMiddleware.once(n),this.loading){for(var s=i.parentResource,o=[],a=0;a<s.children.length;++a)s.children[a].isComplete||o.push(s.children[a]);var h=s.progressChunk*(o.length+1),u=h/(o.length+2);s.children.push(this.resources[e]),s.progressChunk=u;for(var a=0;a<o.length;++a)o[a].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(Te("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=ho/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=du(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=Yg.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,ao.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=ho,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(),ao.eachSeries(this._afterMiddleware,function(i,n){i.call(t,e,n)},function(){e.onAfterMiddleware.dispatch(e),t.progress=Math.min(ho,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 Te("6.5.0","Loader.registerPlugin() is deprecated, use extensions.add() instead."),Ve.add({type:at.Loader,ref:e}),r},r._plugins=[],r}();Ve.handleByList(at.Loader,Mn._plugins),Mn.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 Vg=function(){function r(){}return r.init=function(e){e=Object.assign({sharedLoader:!1},e),this.loader=e.sharedLoader?Mn.shared:new Mn},r.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},r.extension=at.Application,r}(),jg=function(){function r(){}return r.add=function(){Et.setExtensionLoadType("svg",Et.LOAD_TYPE.XHR),Et.setExtensionXhrType("svg",Et.XHR_RESPONSE_TYPE.TEXT)},r.use=function(e,t){if(e.data&&(e.type===Et.TYPE.IMAGE||e.extension==="svg")){var i=e.data,n=e.url,s=e.name,o=e.metadata;Y.fromLoader(i,n,s,o).then(function(a){e.texture=a,t()}).catch(t)}else t()},r.extension=at.Loader,r}(),Zg="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function qg(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 o=t-(r.length-1);switch(o){case 2:n[3]=64,n[2]=64;break;case 1:n[3]=64;break}for(var s=0;s<n.length;++s)e+=Zg.charAt(n[s])}return e}function Kg(r,e){if(!r.data){e();return}if(r.xhr&&r.xhrType===Et.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,"+qg(r.xhr.responseText),r.type=Et.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=Et.TYPE.IMAGE,r.data.onload=function(){i.revokeObjectURL(n),r.data.onload=null,e()};return}}e()}var $g=function(){function r(){}return r.extension=at.Loader,r.use=Kg,r}();Ve.add(jg,$g);var ot,q;(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"})(q||(q={}));var Nn=(ot={},ot[q.COMPRESSED_RGB_S3TC_DXT1_EXT]=.5,ot[q.COMPRESSED_RGBA_S3TC_DXT1_EXT]=.5,ot[q.COMPRESSED_RGBA_S3TC_DXT3_EXT]=1,ot[q.COMPRESSED_RGBA_S3TC_DXT5_EXT]=1,ot[q.COMPRESSED_SRGB_S3TC_DXT1_EXT]=.5,ot[q.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT]=.5,ot[q.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT]=1,ot[q.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT]=1,ot[q.COMPRESSED_R11_EAC]=.5,ot[q.COMPRESSED_SIGNED_R11_EAC]=.5,ot[q.COMPRESSED_RG11_EAC]=1,ot[q.COMPRESSED_SIGNED_RG11_EAC]=1,ot[q.COMPRESSED_RGB8_ETC2]=.5,ot[q.COMPRESSED_RGBA8_ETC2_EAC]=1,ot[q.COMPRESSED_SRGB8_ETC2]=.5,ot[q.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC]=1,ot[q.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2]=.5,ot[q.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2]=.5,ot[q.COMPRESSED_RGB_PVRTC_4BPPV1_IMG]=.5,ot[q.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG]=.5,ot[q.COMPRESSED_RGB_PVRTC_2BPPV1_IMG]=.25,ot[q.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG]=.25,ot[q.COMPRESSED_RGB_ETC1_WEBGL]=.5,ot[q.COMPRESSED_RGB_ATC_WEBGL]=.5,ot[q.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL]=1,ot[q.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL]=1,ot[q.COMPRESSED_RGBA_ASTC_4x4_KHR]=1,ot);var uo=function(r,e){return uo=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])},uo(r,e)};function gu(r,e){uo(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function Jg(r,e,t,i){function n(s){return s instanceof t?s:new t(function(o){o(s)})}return new(t||(t=Promise))(function(s,o){function a(l){try{u(i.next(l))}catch(f){o(f)}}function h(l){try{u(i.throw(l))}catch(f){o(f)}}function u(l){l.done?s(l.value):n(l.value).then(a,h)}u((i=i.apply(r,e||[])).next())})}function Qg(r,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(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 tm=function(r){gu(e,r);function e(t,i){i===void 0&&(i={width:1,height:1,autoLoad:!0});var n=this,s,o;return typeof t=="string"?(s=t,o=new Uint8Array):(s=null,o=t),n=r.call(this,o,i)||this,n.origin=s,n.buffer=o?new io(o):null,n.origin&&i.autoLoad!==!1&&n.load(),o&&o.length&&(n.loaded=!0,n.onBlobLoaded(n.buffer.rawBinaryData)),n}return e.prototype.onBlobLoaded=function(t){},e.prototype.load=function(){return Jg(this,void 0,Promise,function(){var t,i,n;return Qg(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 io(n),this.loaded=!0,this.onBlobLoaded(n),this.update(),[2,this]}})})},e}(Rr),lo=function(r){gu(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,o=t.context.extensions[this._extension];if(!o)throw new Error(this._extension+" textures are not supported on the current machine");if(!this._levelBuffers)return!1;for(var a=0,h=this.levels;a<h;a++){var u=this._levelBuffers[a],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,o,a,h){for(var u=new Array(n),l=t.byteOffset,f=a,c=h,d=f+s-1&~(s-1),v=c+o-1&~(o-1),p=d*v*Nn[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+o-1&~(o-1),p=d*v*Nn[i];return u},e}(tm),em=function(){function r(){}return r.use=function(e,t){var i=e.data,n=this;if(e.type===Et.TYPE.JSON&&i&&i.cacheID&&i.textures){for(var s=i.textures,o=void 0,a=void 0,h=0,u=s.length;h<u;h++){var l=s[h],f=l.src,c=l.format;if(c||(a=f),r.textureFormats[c]){o=f;break}}if(o=o||a,!o){t(new Error("Cannot load compressed-textures in "+e.url+", make sure you provide a fallback"));return}if(o===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=ji.resolve(e.url.replace(n.baseUrl,""),o),p=i.cacheID;n.add(p,v,d,function(_){if(_.error){t(_.error);return}var g=_.texture,y=g===void 0?null:g,m=_.textures,b=m===void 0?{}:m;Object.assign(e,{texture:y,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=at.Loader,r}();function mu(r,e,t){var i={textures:{},texture:null};if(!e)return i;var n=e.map(function(s){return new Y(new rt(s,Object.assign({mipmap:me.OFF,alphaMode:ye.NO_PREMULTIPLIED_ALPHA},t)))});return n.forEach(function(s,o){var a=s.baseTexture,h=r+"-"+(o+1);rt.addToCache(a,h),Y.addToCache(s,h),o===0&&(rt.addToCache(a,r),Y.addToCache(s,r),i.texture=s),i.textures[h]=s}),i}var Nr,we,fo=4,Dn=124,im=32,yu=20,rm=542327876,Fn={SIZE:1,FLAGS:2,HEIGHT:3,WIDTH:4,MIPMAP_COUNT:7,PIXEL_FORMAT:19},nm={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},Bn={DXGI_FORMAT:0,RESOURCE_DIMENSION:1,MISC_FLAG:2,ARRAY_SIZE:3,MISC_FLAGS2:4},Ee;(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"})(Ee||(Ee={}));var co;(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"})(co||(co={}));var sm=1,om=2,am=4,hm=64,um=512,lm=131072,fm=827611204,cm=861165636,dm=894720068,pm=808540228,vm=4,_m=(Nr={},Nr[fm]=q.COMPRESSED_RGBA_S3TC_DXT1_EXT,Nr[cm]=q.COMPRESSED_RGBA_S3TC_DXT3_EXT,Nr[dm]=q.COMPRESSED_RGBA_S3TC_DXT5_EXT,Nr),gm=(we={},we[Ee.DXGI_FORMAT_BC1_TYPELESS]=q.COMPRESSED_RGBA_S3TC_DXT1_EXT,we[Ee.DXGI_FORMAT_BC1_UNORM]=q.COMPRESSED_RGBA_S3TC_DXT1_EXT,we[Ee.DXGI_FORMAT_BC2_TYPELESS]=q.COMPRESSED_RGBA_S3TC_DXT3_EXT,we[Ee.DXGI_FORMAT_BC2_UNORM]=q.COMPRESSED_RGBA_S3TC_DXT3_EXT,we[Ee.DXGI_FORMAT_BC3_TYPELESS]=q.COMPRESSED_RGBA_S3TC_DXT5_EXT,we[Ee.DXGI_FORMAT_BC3_UNORM]=q.COMPRESSED_RGBA_S3TC_DXT5_EXT,we[Ee.DXGI_FORMAT_BC1_UNORM_SRGB]=q.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,we[Ee.DXGI_FORMAT_BC2_UNORM_SRGB]=q.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,we[Ee.DXGI_FORMAT_BC3_UNORM_SRGB]=q.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,we);function mm(r){var e=new Uint32Array(r),t=e[0];if(t!==rm)throw new Error("Invalid DDS file magic word");var i=new Uint32Array(r,0,Dn/Uint32Array.BYTES_PER_ELEMENT),n=i[Fn.HEIGHT],s=i[Fn.WIDTH],o=i[Fn.MIPMAP_COUNT],a=new Uint32Array(r,Fn.PIXEL_FORMAT*Uint32Array.BYTES_PER_ELEMENT,im/Uint32Array.BYTES_PER_ELEMENT),h=a[sm];if(h&am){var u=a[nm.FOURCC];if(u!==pm){var l=_m[u],f=fo+Dn,c=new Uint8Array(r,f),d=new lo(c,{format:l,width:s,height:n,levels:o});return[d]}var v=fo+Dn,p=new Uint32Array(e.buffer,v,yu/Uint32Array.BYTES_PER_ELEMENT),_=p[Bn.DXGI_FORMAT],g=p[Bn.RESOURCE_DIMENSION],y=p[Bn.MISC_FLAG],m=p[Bn.ARRAY_SIZE],b=gm[_];if(b===void 0)throw new Error("DDSParser cannot parse texture data with DXGI format "+_);if(y===vm)throw new Error("DDSParser does not support cubemap textures");if(g===co.DDS_DIMENSION_TEXTURE3D)throw new Error("DDSParser does not supported 3D texture data");var x=new Array,T=fo+Dn+yu;if(m===1)x.push(new Uint8Array(r,T));else{for(var w=Nn[b],S=0,E=s,P=n,O=0;O<o;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 I=T,O=0;O<m;O++)x.push(new Uint8Array(r,I,S)),I+=S}return x.map(function(A){return new lo(A,{format:b,width:s,height:n,levels:o})})}throw h&hm?new Error("DDSParser does not support uncompressed texture data."):h&um?new Error("DDSParser does not supported YUV uncompressed texture data."):h&lm?new Error("DDSParser does not support single-channel (lumninance) texture data!"):h&om?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 ni,Ze,Dr,xu=[171,75,84,88,32,49,49,187,13,10,26,10],ym=67305985,Se={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},po=64,bu=(ni={},ni[k.UNSIGNED_BYTE]=1,ni[k.UNSIGNED_SHORT]=2,ni[k.INT]=4,ni[k.UNSIGNED_INT]=4,ni[k.FLOAT]=4,ni[k.HALF_FLOAT]=8,ni),xm=(Ze={},Ze[F.RGBA]=4,Ze[F.RGB]=3,Ze[F.RG]=2,Ze[F.RED]=1,Ze[F.LUMINANCE]=1,Ze[F.LUMINANCE_ALPHA]=2,Ze[F.ALPHA]=1,Ze),bm=(Dr={},Dr[k.UNSIGNED_SHORT_4_4_4_4]=2,Dr[k.UNSIGNED_SHORT_5_5_5_1]=2,Dr[k.UNSIGNED_SHORT_5_6_5]=2,Dr);function Tm(r,e,t){t===void 0&&(t=!1);var i=new DataView(e);if(!wm(r,i))return null;var n=i.getUint32(Se.ENDIANNESS,!0)===ym,s=i.getUint32(Se.GL_TYPE,n),o=i.getUint32(Se.GL_FORMAT,n),a=i.getUint32(Se.GL_INTERNAL_FORMAT,n),h=i.getUint32(Se.PIXEL_WIDTH,n),u=i.getUint32(Se.PIXEL_HEIGHT,n)||1,l=i.getUint32(Se.PIXEL_DEPTH,n)||1,f=i.getUint32(Se.NUMBER_OF_ARRAY_ELEMENTS,n)||1,c=i.getUint32(Se.NUMBER_OF_FACES,n),d=i.getUint32(Se.NUMBER_OF_MIPMAP_LEVELS,n),v=i.getUint32(Se.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,g=h+3&-4,y=u+3&-4,m=new Array(f),b=h*u;s===0&&(b=g*y);var x;if(s!==0?bu[s]?x=bu[s]*xm[o]:x=bm[s]:x=Nn[a],x===void 0)throw new Error("Unable to resolve the pixel format stored in the *.ktx file!");for(var T=t?Sm(i,v,n):null,w=b*x,S=w,E=h,P=u,O=g,D=y,N=po+v,U=0;U<d;U++){for(var I=i.getUint32(N,n),A=N+4,B=0;B<f;B++){var K=m[B];K||(K=m[B]=new Array(d)),K[U]={levelID:U,levelWidth:d>1||s!==0?E:O,levelHeight:d>1||s!==0?P:D,levelBuffer:new Uint8Array(e,A,S)},A+=S}N+=I+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:m.map(function(z){var M=z[0].levelBuffer,C=!1;return s===k.FLOAT?M=new Float32Array(z[0].levelBuffer.buffer,z[0].levelBuffer.byteOffset,z[0].levelBuffer.byteLength/4):s===k.UNSIGNED_INT?(C=!0,M=new Uint32Array(z[0].levelBuffer.buffer,z[0].levelBuffer.byteOffset,z[0].levelBuffer.byteLength/4)):s===k.INT&&(C=!0,M=new Int32Array(z[0].levelBuffer.buffer,z[0].levelBuffer.byteOffset,z[0].levelBuffer.byteLength/4)),{resource:new Rr(M,{width:z[0].levelWidth,height:z[0].levelHeight}),type:s,format:C?Em(o):o}}),kvData:T}:{compressed:m.map(function(z){return new lo(null,{format:a,width:h,height:u,levels:d,levelBuffers:z})}),kvData:T}}function wm(r,e){for(var t=0;t<xu.length;t++)if(e.getUint8(t)!==xu[t])return console.error(r+" is not a valid *.ktx file!"),!1;return!0}function Em(r){switch(r){case F.RGBA:return F.RGBA_INTEGER;case F.RGB:return F.RGB_INTEGER;case F.RG:return F.RG_INTEGER;case F.RED:return F.RED_INTEGER;default:return r}}function Sm(r,e,t){for(var i=new Map,n=0;n<e;){var s=r.getUint32(po+n,t),o=po+n+4,a=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(o+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,o,h)),l=new DataView(r.buffer,o+h+1,s-h-1);i.set(u,l),n+=4+s+a}return i}Et.setExtensionXhrType("dds",Et.XHR_RESPONSE_TYPE.BUFFER);var Pm=function(){function r(){}return r.use=function(e,t){if(e.extension==="dds"&&e.data)try{Object.assign(e,mu(e.name||e.url,mm(e.data),e.metadata))}catch(i){t(i);return}t()},r.extension=at.Loader,r}();Et.setExtensionXhrType("ktx",Et.XHR_RESPONSE_TYPE.BUFFER);var Rm=function(){function r(){}return r.use=function(e,t){if(e.extension==="ktx"&&e.data)try{var i=e.name||e.url,n=Tm(i,e.data,this.loadKeyValueData),s=n.compressed,o=n.uncompressed,a=n.kvData;if(s){var h=mu(i,s,e.metadata);if(a&&h.textures)for(var u in h.textures)h.textures[u].baseTexture.ktxKeyValueData=a;Object.assign(e,h)}else if(o){var l={};o.forEach(function(f,c){var d=new Y(new rt(f.resource,{mipmap:me.OFF,alphaMode:ye.NO_PREMULTIPLIED_ALPHA,type:f.type,format:f.format})),v=i+"-"+(c+1);a&&(d.baseTexture.ktxKeyValueData=a),rt.addToCache(d.baseTexture,v),Y.addToCache(d,v),c===0&&(l[i]=d,rt.addToCache(d.baseTexture,i),Y.addToCache(d,i)),l[v]=d}),Object.assign(e,{textures:l})}}catch(f){t(f);return}t()},r.extension=at.Loader,r.loadKeyValueData=!1,r}();var vo=function(r,e){return vo=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])},vo(r,e)};function Tu(r,e){vo(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}(function(r){Tu(e,r);function e(t,i,n,s){t===void 0&&(t=1500),n===void 0&&(n=16384),s===void 0&&(s=!1);var o=r.call(this)||this,a=16384;return n>a&&(n=a),o._properties=[!1,!0,!1,!1,!1],o._maxSize=t,o._batchSize=n,o._buffers=null,o._bufferUpdateIDs=[],o._updateID=0,o.interactiveChildren=!1,o.blendMode=X.NORMAL,o.autoResize=s,o.roundPixels=!0,o.baseTexture=null,o.setProperties(i),o._tint=0,o.tintRgb=new Float32Array(4),o.tint=16777215,o}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,Zi(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})(ht);var wu=function(){function r(e,t,i){this.geometry=new Cr,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 Ft(Yv(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 Ft(this.dynamicData,!1,!1);var o=0;this.staticStride=0;for(var i=0;i<this.staticProperties.length;++i){var n=this.staticProperties[i];n.offset=o,o+=n.size,this.staticStride+=n.size}var a=new ArrayBuffer(this.size*this.staticStride*4*4);this.staticData=new Float32Array(a),this.staticDataUint32=new Uint32Array(a),this.staticBuffer=new Ft(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}(),Cm=`varying vec2 vTextureCoord;
496
496
  varying vec4 vColor;
497
497
 
498
498
  uniform sampler2D uSampler;
@@ -525,8 +525,8 @@ void main(void){
525
525
  vTextureCoord = aTextureCoord;
526
526
  vColor = aColor * uColor;
527
527
  }
528
- `,Am=function(r){Tu(e,r);function e(t){var i=r.call(this,t)||this;return i.shader=null,i.properties=null,i.tempMatrix=new Dt,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=ii.from(Om,Cm,{}),i.state=Ci.for2d(),i}return e.prototype.render=function(t){var i=t.children,n=t._maxSize,s=t._batchSize,o=this.renderer,a=i.length;if(a!==0){a>n&&!t.autoResize&&(a=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=Th(t.blendMode,l),o.state.set(this.state);var f=o.gl,c=t.worldTransform.copyTo(this.tempMatrix);c.prepend(o.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=c.toArray(!0),this.shader.uniforms.uColor=zv(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<a;v+=s,p+=1){var _=a-v;_>s&&(_=s),p>=h.length&&h.push(this._generateOneMoreBuffer(t));var g=h[p];g.uploadDynamic(i,v,_);var y=t._bufferUpdateIDs[p]||0;d=d||g._updateID<y,d&&(g._updateID=t._updateID,g.uploadStatic(i,v,_)),o.geometry.bind(g.geometry),f.drawElements(f.TRIANGLES,_*6,f.UNSIGNED_SHORT,0)}}},e.prototype.generateBuffers=function(t){for(var i=[],n=t._maxSize,s=t._batchSize,o=t._properties,a=0;a<n;a+=s)i.push(new wu(this.properties,o,s));return i},e.prototype._generateOneMoreBuffer=function(t){var i=t._batchSize,n=t._properties;return new wu(this.properties,n,i)},e.prototype.uploadVertices=function(t,i,n,s,o,a){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,g=v.trim,y=v.orig;g?(u=g.x-d.anchor.x*y.width,h=u+g.width,f=g.y-d.anchor.y*y.height,l=f+g.height):(h=y.width*(1-d.anchor.x),u=y.width*-d.anchor.x,l=y.height*(1-d.anchor.y),f=y.height*-d.anchor.y),s[a]=u*p,s[a+1]=f*_,s[a+o]=h*p,s[a+o+1]=f*_,s[a+o*2]=h*p,s[a+o*2+1]=l*_,s[a+o*3]=u*p,s[a+o*3+1]=l*_,a+=o*4}},e.prototype.uploadPosition=function(t,i,n,s,o,a){for(var h=0;h<n;h++){var u=t[i+h].position;s[a]=u.x,s[a+1]=u.y,s[a+o]=u.x,s[a+o+1]=u.y,s[a+o*2]=u.x,s[a+o*2+1]=u.y,s[a+o*3]=u.x,s[a+o*3+1]=u.y,a+=o*4}},e.prototype.uploadRotation=function(t,i,n,s,o,a){for(var h=0;h<n;h++){var u=t[i+h].rotation;s[a]=u,s[a+o]=u,s[a+o*2]=u,s[a+o*3]=u,a+=o*4}},e.prototype.uploadUvs=function(t,i,n,s,o,a){for(var h=0;h<n;++h){var u=t[i+h]._texture._uvs;u?(s[a]=u.x0,s[a+1]=u.y0,s[a+o]=u.x1,s[a+o+1]=u.y1,s[a+o*2]=u.x2,s[a+o*2+1]=u.y2,s[a+o*3]=u.x3,s[a+o*3+1]=u.y3,a+=o*4):(s[a]=0,s[a+1]=0,s[a+o]=0,s[a+o+1]=0,s[a+o*2]=0,s[a+o*2+1]=0,s[a+o*3]=0,s[a+o*3+1]=0,a+=o*4)}},e.prototype.uploadTint=function(t,i,n,s,o,a){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?Ns(u._tintRGB,f):u._tintRGB+(f*255<<24);s[a]=c,s[a+o]=c,s[a+o*2]=c,s[a+o*3]=c,a+=o*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:at.RendererPlugin},e}(Tn);var qe;(function(r){r.MITER="miter",r.BEVEL="bevel",r.ROUND="round"})(qe||(qe={}));var si;(function(r){r.BUTT="butt",r.ROUND="round",r.SQUARE="square"})(si||(si={}));var Fr={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}},Eu=function(){function r(){this.color=16777215,this.alpha=1,this.texture=Y.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=Y.WHITE,this.matrix=null,this.visible=!1},r.prototype.destroy=function(){this.texture=null,this.matrix=null},r}();var _o=function(r,e){return _o=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])},_o(r,e)};function go(r,e){_o(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function Su(r,e){var t,i;e===void 0&&(e=!1);var n=r.length;if(!(n<6)){for(var s=0,o=0,a=r[n-2],h=r[n-1];o<n;o+=2){var u=r[o],l=r[o+1];s+=(u-a)*(l+h),a=u,h=l}if(!e&&s>0||e&&s<=0)for(var f=n/2,o=f+f%2;o<n;o+=2){var c=n-o-2,d=n-o-1,v=o,p=o+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){Su(t,!1);for(var o=[],a=0;a<i.length;a++){var h=i[a];Su(h.points,!0),o.push(t.length/2),t=t.concat(h.points)}var u=ln.exports(t,o,2);if(!u)return;for(var l=n.length/2,a=0;a<u.length;a+=3)s.push(u[a]+l),s.push(u[a+1]+l),s.push(u[a+2]+l);for(var a=0;a<t.length;a++)n.push(t[a])}}},Ln={build:function(r){var e=r.points,t,i,n,s,o,a;if(r.type===Gt.CIRC){var h=r.shape;t=h.x,i=h.y,o=a=h.radius,n=s=0}else if(r.type===Gt.ELIP){var u=r.shape;t=u.x,i=u.y,o=u.width,a=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,o=a=Math.max(0,Math.min(l.radius,Math.min(f,c))),n=f-o,s=c-a}if(!(o>=0&&a>=0&&n>=0&&s>=0)){e.length=0;return}var d=Math.ceil(2.3*Math.sqrt(o+a)),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,g=_,y=v;{var m=n+o,b=s,x=t+m,T=t-m,w=i+b;if(e[p++]=x,e[p++]=w,e[--_]=w,e[--_]=T,s){var S=i-b;e[g++]=T,e[g++]=S,e[--y]=S,e[--y]=x}}for(var E=1;E<d;E++){var P=Math.PI/2*(E/d),m=n+Math.cos(P)*o,b=s+Math.sin(P)*a,x=t+m,T=t-m,w=i+b,S=i-b;e[p++]=x,e[p++]=w,e[--_]=w,e[--_]=T,e[g++]=T,e[g++]=S,e[--y]=S,e[--y]=x}{var m=n,b=s+a,x=t+m,T=t-m,w=i+b,S=i-b;e[p++]=x,e[p++]=w,e[--y]=S,e[--y]=x,n&&(e[p++]=T,e[p++]=w,e[--y]=S,e[--y]=T)}}},triangulate:function(r,e){var t=r.points,i=e.points,n=e.indices;if(t.length!==0){var s=i.length/2,o=s,a,h;if(r.type!==Gt.RREC){var u=r.shape;a=u.x,h=u.y}else{var l=r.shape;a=l.x+l.width/2,h=l.y+l.height/2}var f=r.matrix;i.push(r.matrix?f.a*a+f.c*h+f.tx:a,r.matrix?f.b*a+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++,o,s);n.push(o+1,o,s)}}},Im={build:function(r){var e=r.shape,t=e.x,i=e.y,n=e.width,s=e.height,o=r.points;o.length=0,o.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 Gn(r,e,t,i,n,s,o){o===void 0&&(o=[]);for(var a=20,h=o,u=0,l=0,f=0,c=0,d=0,v=0,p=0,_=0;p<=a;++p)_=p/a,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 Mm={build:function(r){if(Le.nextRoundedRectBehavior){Ln.build(r);return}var e=r.shape,t=r.points,i=e.x,n=e.y,s=e.width,o=e.height,a=Math.max(0,Math.min(e.radius,Math.min(s,o)/2));t.length=0,a?(Gn(i,n+a,i,n,i+a,n,t),Gn(i+s-a,n,i+s,n,i+s,n+a,t),Gn(i+s,n+o-a,i+s,n+o,i+s-a,n+o,t),Gn(i+a,n+o,i,n+o,i,n+o-a,t)):t.push(i,n,i+s,n,i+s,n+o,i,n+o)},triangulate:function(r,e){if(Le.nextRoundedRectBehavior){Ln.triangulate(r,e);return}for(var t=r.points,i=e.points,n=e.indices,s=i.length/2,o=ln.exports(t,null,2),a=0,h=o.length;a<h;a+=3)n.push(o[a]+s),n.push(o[a+1]+s),n.push(o[a+2]+s);for(var a=0,h=t.length;a<h;a++)i.push(t[a],t[++a])}};function Ru(r,e,t,i,n,s,o,a){var h=r-t*n,u=e-i*n,l=r+t*s,f=e+i*s,c,d;o?(c=i,d=-t):(c=-i,d=t);var v=h+c,p=u+d,_=l+c,g=f+d;return a.push(v,p),a.push(_,g),2}function Ii(r,e,t,i,n,s,o,a){var h=t-r,u=i-e,l=Math.atan2(h,u),f=Math.atan2(n-r,s-e);a&&l<f?l+=Math.PI*2:!a&&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,g=d/_;if(c+=g,a){o.push(r,e),o.push(t,i);for(var y=1,m=c;y<_;y++,m+=g)o.push(r,e),o.push(r+Math.sin(m)*p,e+Math.cos(m)*p);o.push(r,e),o.push(n,s)}else{o.push(t,i),o.push(r,e);for(var y=1,m=c;y<_;y++,m+=g)o.push(r+Math.sin(m)*p,e+Math.cos(m)*p),o.push(r,e);o.push(n,s),o.push(r,e)}return _*2}function Dm(r,e){var t=r.shape,i=r.points||t.points.slice(),n=e.closePointEps;if(i.length!==0){var s=r.lineStyle,o=new j(i[0],i[1]),a=new j(i[i.length-2],i[i.length-1]),h=t.type!==Gt.POLY||t.closeStroke,u=Math.abs(o.x-a.x)<n&&Math.abs(o.y-a.y)<n;if(h){i=i.slice(),u&&(i.pop(),i.pop(),a.set(i[i.length-2],i[i.length-1]));var l=(o.x+a.x)*.5,f=(a.y+o.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,g=_*_,y=s.miterLimit*s.miterLimit,m=i[0],b=i[1],x=i[2],T=i[3],w=0,S=0,E=-(b-T),P=m-x,O=0,N=0,D=Math.sqrt(E*E+P*P);E/=D,P/=D,E*=_,P*=_;var U=s.alignment,I=(1-U)*2,A=U*2;h||(s.cap===si.ROUND?v+=Ii(m-E*(I-A)*.5,b-P*(I-A)*.5,m-E*I,b-P*I,m+E*A,b+P*A,c,!0)+2:s.cap===si.SQUARE&&(v+=Ru(m,b,E,P,I,A,!0,c))),c.push(m-E*I,b-P*I),c.push(m+E*A,b+P*A);for(var B=1;B<d-1;++B){m=i[(B-1)*2],b=i[(B-1)*2+1],x=i[B*2],T=i[B*2+1],w=i[(B+1)*2],S=i[(B+1)*2+1],E=-(b-T),P=m-x,D=Math.sqrt(E*E+P*P),E/=D,P/=D,E*=_,P*=_,O=-(T-S),N=x-w,D=Math.sqrt(O*O+N*N),O/=D,N/=D,O*=_,N*=_;var K=x-m,z=b-T,M=x-w,C=S-T,G=K*M+z*C,tt=z*M-C*K,V=tt<0;if(Math.abs(tt)<.001*Math.abs(G)){c.push(x-E*I,T-P*I),c.push(x+E*A,T+P*A),G>=0&&(s.join===qe.ROUND?v+=Ii(x,T,x-E*I,T-P*I,x-O*I,T-N*I,c,!1)+4:v+=2,c.push(x-O*A,T-N*A),c.push(x+O*I,T+N*I));continue}var nt=(-E+m)*(-P+T)-(-E+x)*(-P+b),dt=(-O+w)*(-N+T)-(-O+x)*(-N+S),pt=(K*dt-M*nt)/tt,Pt=(C*nt-z*dt)/tt,Lt=(pt-x)*(pt-x)+(Pt-T)*(Pt-T),vt=x+(pt-x)*I,st=T+(Pt-T)*I,H=x-(pt-x)*A,$=T-(Pt-T)*A,Z=Math.min(K*K+z*z,M*M+C*C),xt=V?I:A,Rt=Z+xt*xt*g,Q=Lt<=Rt;Q?s.join===qe.BEVEL||Lt/g>y?(V?(c.push(vt,st),c.push(x+E*A,T+P*A),c.push(vt,st),c.push(x+O*A,T+N*A)):(c.push(x-E*I,T-P*I),c.push(H,$),c.push(x-O*I,T-N*I),c.push(H,$)),v+=2):s.join===qe.ROUND?V?(c.push(vt,st),c.push(x+E*A,T+P*A),v+=Ii(x,T,x+E*A,T+P*A,x+O*A,T+N*A,c,!0)+4,c.push(vt,st),c.push(x+O*A,T+N*A)):(c.push(x-E*I,T-P*I),c.push(H,$),v+=Ii(x,T,x-E*I,T-P*I,x-O*I,T-N*I,c,!1)+4,c.push(x-O*I,T-N*I),c.push(H,$)):(c.push(vt,st),c.push(H,$)):(c.push(x-E*I,T-P*I),c.push(x+E*A,T+P*A),s.join===qe.ROUND?V?v+=Ii(x,T,x+E*A,T+P*A,x+O*A,T+N*A,c,!0)+2:v+=Ii(x,T,x-E*I,T-P*I,x-O*I,T-N*I,c,!1)+2:s.join===qe.MITER&&Lt/g<=y&&(V?(c.push(H,$),c.push(H,$)):(c.push(vt,st),c.push(vt,st)),v+=2),c.push(x-O*I,T-N*I),c.push(x+O*A,T+N*A),v+=2)}m=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=m-x,D=Math.sqrt(E*E+P*P),E/=D,P/=D,E*=_,P*=_,c.push(x-E*I,T-P*I),c.push(x+E*A,T+P*A),h||(s.cap===si.ROUND?v+=Ii(x-E*(I-A)*.5,T-P*(I-A)*.5,x-E*I,T-P*I,x+E*A,T+P*A,c,!1)+2:s.cap===si.SQUARE&&(v+=Ru(x,T,E,P,I,A,!1,c)));for(var Wt=e.indices,He=Fr.epsilon*Fr.epsilon,B=p;B<v+p-2;++B)m=c[B*2],b=c[B*2+1],x=c[(B+1)*2],T=c[(B+1)*2+1],w=c[(B+2)*2],S=c[(B+2)*2+1],!(Math.abs(m*(T-S)+x*(S-b)+w*(b-T))<He)&&Wt.push(B,B+1,B+2)}}function Nm(r,e){var t=0,i=r.shape,n=r.points||i.points,s=i.type!==Gt.POLY||i.closeStroke;if(n.length!==0){var o=e.points,a=e.indices,h=n.length/2,u=o.length/2,l=u;for(o.push(n[0],n[1]),t=1;t<h;t++)o.push(n[t*2],n[t*2+1]),a.push(l,l+1),l++;s&&a.push(l,u)}}function Cu(r,e){r.lineStyle.native?Nm(r,e):Dm(r,e)}var Ou=function(){function r(){}return r.curveTo=function(e,t,i,n,s,o){var a=o[o.length-2],h=o[o.length-1],u=h-t,l=a-e,f=n-t,c=i-e,d=Math.abs(u*c-l*f);if(d<1e-8||s===0)return(o[o.length-2]!==e||o[o.length-1]!==t)&&o.push(e,t),null;var v=u*u+l*l,p=f*f+c*c,_=u*f+l*c,g=s*Math.sqrt(v)/d,y=s*Math.sqrt(p)/d,m=g*_/v,b=y*_/p,x=g*c+y*l,T=g*f+y*u,w=l*(y+m),S=u*(y+m),E=c*(g+b),P=f*(g+b),O=Math.atan2(S-T,w-x),N=Math.atan2(P-T,E-x);return{cx:x+e,cy:T+t,radius:s,startAngle:O,endAngle:N,anticlockwise:l*f>c*u}},r.arc=function(e,t,i,n,s,o,a,h,u){for(var l=a-o,f=Fr._segmentsCount(Math.abs(l)*s,Math.ceil(Math.abs(l)/Ie)*40),c=l/(f*2),d=c*2,v=Math.cos(c),p=Math.sin(c),_=f-1,g=_%1/_,y=0;y<=_;++y){var m=y+g*y,b=c+o+d*m,x=Math.cos(b),T=-Math.sin(b);u.push((v*x+p*T)*s+i,(v*-T+p*x)*s+n)}},r}(),Fm=function(){function r(){}return r.curveLength=function(e,t,i,n,s,o,a,h){for(var u=10,l=0,f=0,c=0,d=0,v=0,p=0,_=0,g=0,y=0,m=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,g=_*e+3*p*f*i+3*v*c*s+d*a,y=_*t+3*p*f*n+3*v*c*o+d*h,m=x-g,b=T-y,x=g,T=y,l+=Math.sqrt(m*m+b*b);return l},r.curveTo=function(e,t,i,n,s,o,a){var h=a[a.length-2],u=a[a.length-1];a.length-=2;var l=Fr._segmentsCount(r.curveLength(h,u,e,t,i,n,s,o)),f=0,c=0,d=0,v=0,p=0;a.push(h,u);for(var _=1,g=0;_<=l;++_)g=_/l,f=1-g,c=f*f,d=c*f,v=g*g,p=v*g,a.push(d*h+3*c*g*e+3*f*v*i+p*s,d*u+3*c*g*t+3*f*v*n+p*o)},r}(),Bm=function(){function r(){}return r.curveLength=function(e,t,i,n,s,o){var a=e-2*i+s,h=t-2*n+o,u=2*i-2*e,l=2*n-2*t,f=4*(a*a+h*h),c=4*(a*u+h*l),d=u*u+l*l,v=2*Math.sqrt(f+c+d),p=Math.sqrt(f),_=2*f*p,g=2*Math.sqrt(d),y=c/p;return(_*v+p*c*(v-g)+(4*d*f-c*c)*Math.log((2*p+y+v)/(y+g)))/(4*_)},r.curveTo=function(e,t,i,n,s){for(var o=s[s.length-2],a=s[s.length-1],h=Fr._segmentsCount(r.curveLength(o,a,e,t,i,n)),u=0,l=0,f=1;f<=h;++f){var c=f/h;u=o+(e-o)*c,l=a+(t-a)*c,s.push(u+(e+(i-e)*c-u)*c,l+(t+(n-t)*c-l)*c)}},r}(),Lm=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}(),Mi,mo=(Mi={},Mi[Gt.POLY]=Pu,Mi[Gt.CIRC]=Ln,Mi[Gt.ELIP]=Ln,Mi[Gt.RECT]=Im,Mi[Gt.RREC]=Mm,Mi),Au=[],Un=[],Iu=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}(),Qi=new j,Gm=function(r){go(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 yn,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(),Un.push(this.drawCalls[t]);this.drawCalls.length=0;for(var t=0;t<this.batches.length;t++){var i=this.batches[t];i.reset(),Au.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 o=new Iu(t,i,n,s);return this.graphicsData.push(o),this.dirty++,this},e.prototype.drawHole=function(t,i){if(i===void 0&&(i=null),!this.graphicsData.length)return null;var n=new Iu(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,Qi):Qi.copyFrom(t),s.shape.contains(Qi.x,Qi.y))){var o=!1;if(s.holes)for(var a=0;a<s.holes.length;a++){var h=s.holes[a];if(h.shape.contains(Qi.x,Qi.y)){o=!0;break}}if(!o)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 o=this.shapeIndex;o<i.length;o++){this.shapeIndex++;var a=i[o],h=a.fillStyle,u=a.lineStyle,l=mo[a.type];l.build(a),a.matrix&&this.transformPoints(a.points,a.matrix),(h.visible||u.visible)&&this.processHoles(a.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=De.REPEAT,f===0?this.processFill(a):this.processLine(a);var _=this.points.length/2-p;_!==0&&(n&&!this._compareStyles(s,c)&&(n.end(v,p),n=null),n||(n=Au.pop()||new Lm,n.begin(c,v,p),this.batches.push(n),s=c),this.addUvs(this.points,t,c.texture,p,_,c.matrix))}}}var g=this.indices.length,y=this.points.length/2;if(n&&n.end(g,y),this.batches.length===0){this.batchable=!0;return}var m=y>65535;this.indicesUint16&&this.indices.length===this.indicesUint16.length&&m===this.indicesUint16.BYTES_PER_ELEMENT>2?this.indicesUint16.set(this.indices):this.indicesUint16=m?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,o=n.lineStyle;if(s&&!s.texture.baseTexture.valid||o&&!o.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],o=0;o<s.size;o++){var a=s.start+o;this.indicesUint16[a]=this.indicesUint16[a]-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=++rt._globalBatch,i=0;i<this.drawCalls.length;i++)this.drawCalls[i].texArray.clear(),Un.push(this.drawCalls[i]);this.drawCalls.length=0;var n=this.colors,s=this.textureIds,o=Un.pop();o||(o=new to,o.texArray=new eo),o.texArray.count=0,o.start=0,o.size=0,o.type=ge.TRIANGLES;var a=0,h=null,u=0,l=!1,f=ge.TRIANGLES,c=0;this.drawCalls.push(o);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?ge.LINES:ge.TRIANGLES,h=null,a=v,t++),h!==_&&(h=_,_._batchEnabled!==t&&(a===v&&(t++,a=0,o.size>0&&(o=Un.pop(),o||(o=new to,o.texArray=new eo),this.drawCalls.push(o)),o.start=c,o.size=0,o.texArray.count=0,o.type=f),_.touched=1,_._batchEnabled=t,_._batchLocation=a,_.wrapMode=De.REPEAT,o.texArray.elements[o.texArray.count++]=_,a++)),o.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)}rt._globalBatch=t,this.packAttributes()},e.prototype.packAttributes=function(){for(var t=this.points,i=this.uvs,n=this.colors,s=this.textureIds,o=new ArrayBuffer(t.length*3*4),a=new Float32Array(o),h=new Uint32Array(o),u=0,l=0;l<t.length/2;l++)a[u++]=t[l*2],a[u++]=t[l*2+1],a[u++]=i[l*2],a[u++]=i[l*2+1],h[u++]=n[l],a[u++]=s[l];this._buffer.update(o),this._indexBuffer.update(this.indicesUint16)},e.prototype.processFill=function(t){if(t.holes.length)Pu.triangulate(t,this);else{var i=mo[t.type];i.triangulate(t,this)}},e.prototype.processLine=function(t){Cu(t,this);for(var i=0;i<t.holes.length;i++)Cu(t.holes[i],this)},e.prototype.processHoles=function(t){for(var i=0;i<t.length;i++){var n=t[i],s=mo[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],o=t[n*2+1];t[n*2]=i.a*s+i.c*o+i.tx,t[n*2+1]=i.b*s+i.d*o+i.ty}},e.prototype.addColors=function(t,i,n,s,o){o===void 0&&(o=0);var a=(i>>16)+(i&65280)+((i&255)<<16),h=Ns(a,n);t.length=Math.max(t.length,o+s);for(var u=0;u<s;u++)t[o+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 o=0;o<n;o++)t[s+o]=i},e.prototype.addUvs=function(t,i,n,s,o,a){a===void 0&&(a=null);for(var h=0,u=i.length,l=n.frame;h<o;){var f=t[(s+h)*2],c=t[(s+h)*2+1];if(a){var d=a.a*f+a.c*c+a.tx;c=a.b*f+a.d*c+a.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,o)},e.prototype.adjustUvs=function(t,i,n,s){for(var o=i.baseTexture,a=1e-6,h=n+s*2,u=i.frame,l=u.width/o.width,f=u.height/o.height,c=u.x/u.width,d=u.y/u.height,v=Math.floor(t[n]+a),p=Math.floor(t[n+1]+a),_=n+2;_<h;_+=2)v=Math.min(v,Math.floor(t[_]+a)),p=Math.min(p,Math.floor(t[_+1]+a));c-=v,d-=p;for(var _=n;_<h;_+=2)t[_]=(t[_]+c)*l,t[_+1]=(t[_+1]+d)*f},e.BATCHABLE_SIZE=100,e}(ru),Um=function(r){go(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=si.BUTT,t.join=qe.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}(Eu),km=new Float32Array(3),yo={},Le=function(r){go(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 Eu,i._lineStyle=new Um,i._matrix=null,i._holeMode=!1,i.state=Ci.for2d(),i._geometry=t||new Gm,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,o){return t===void 0&&(t=null),i===void 0&&(i=0),n===void 0&&(n=1),s===void 0&&(s=.5),o===void 0&&(o=!1),typeof t=="number"&&(t={width:t,color:i,alpha:n,alignment:s,native:o}),this.lineTextureStyle(t)},e.prototype.lineTextureStyle=function(t){t=Object.assign({width:0,texture:Y.WHITE,color:t&&t.texture?16777215:0,alpha:1,matrix:null,alignment:.5,native:!1,cap:si.BUTT,join:qe.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 nn,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[i-2],t[i-1]))}else this.currentPath=new nn,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],o=n[n.length-1];return(s!==t||o!==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 o=this.currentPath.points;return o.length===0&&this.moveTo(0,0),Bm.curveTo(t,i,n,s,o),this},e.prototype.bezierCurveTo=function(t,i,n,s,o,a){return this._initCurve(),Fm.curveTo(t,i,n,s,o,a,this.currentPath.points),this},e.prototype.arcTo=function(t,i,n,s,o){this._initCurve(t,i);var a=this.currentPath.points,h=Ou.curveTo(t,i,n,s,o,a);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,o,a){if(a===void 0&&(a=!1),s===o)return this;!a&&o<=s?o+=Ie:a&&s<=o&&(s+=Ie);var h=o-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 Ou.arc(u,l,t,i,n,s,o,a,c),this},e.prototype.beginFill=function(t,i){return t===void 0&&(t=0),i===void 0&&(i=1),this.beginTextureFill({texture:Y.WHITE,color:t,alpha:i})},e.prototype.beginTextureFill=function(t){t=Object.assign({texture:Y.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 J(t,i,n,s))},e.prototype.drawRoundedRect=function(t,i,n,s,o){return this.drawShape(new kf(t,i,n,s,o))},e.prototype.drawCircle=function(t,i,n){return this.drawShape(new Gf(t,i,n))},e.prototype.drawEllipse=function(t,i,n,s){return this.drawShape(new Uf(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,o=!0,a=i[0];a.points?(o=a.closeStroke,s=a.points):Array.isArray(i[0])?s=i[0]:s=i;var h=new nn(s);return h.closeStroke=o,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===Gt.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 o=t.batches[s],a=o.style.color,h=new Float32Array(this.vertexData.buffer,o.attribStart*4*2,o.attribSize*2),u=new Float32Array(t.uvsFloat32.buffer,o.attribStart*4*2,o.attribSize*2),l=new Uint16Array(t.indicesUint16.buffer,o.start*2,o.size),f={vertexData:h,blendMode:i,indices:l,uvs:u,_batchRGB:Zi(a),_tintRGB:a,_texture:o.style.texture,alpha:o.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,o=this.worldAlpha,a=i.uniforms,h=n.drawCalls;a.translationMatrix=this.transform.worldTransform,a.tint[0]=(s>>16&255)/255*o,a.tint[1]=(s>>8&255)/255*o,a.tint[2]=(s&255)/255*o,a.tint[3]=o,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,o=i.size,a=i.start,h=n.count,u=0;u<h;u++)t.texture.bind(n.elements[u],u);t.geometry.draw(s,o,a)},e.prototype._resolveDirectShader=function(t){var i=this.shader,n=this.pluginName;if(!i){if(!yo[n]){for(var s=t.plugins[n].MAX_TEXTURES,o=new Int32Array(s),a=0;a<s;a++)o[a]=a;var h={tint:new Float32Array([1,1,1,1]),translationMatrix:new Dt,default:Ri.from({uSamplers:o},!0)},u=t.plugins[n]._shader.program;yo[n]=new ii(u,h)}i=yo[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,o=i.maxX,a=i.maxY;this._bounds.addFrame(this.transform,n,s,o,a)}},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=Zi(this.tint,km),i=0;i<this.batches.length;i++){var n=this.batches[i],s=n._batchRGB,o=t[0]*s[0]*255,a=t[1]*s[1]*255,h=t[2]*s[2]*255,u=(o<<16)+(a<<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,o=i.c,a=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+o*p+h,f[c++]=a*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}(ht);var xo=function(r,e){return xo=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])},xo(r,e)};function Xm(r,e){xo(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Br=new j,Hm=new Uint16Array([0,1,2,0,2,3]),ct=function(r){Xm(e,r);function e(t){var i=r.call(this)||this;return i._anchor=new Wi(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||Y.EMPTY,i.vertexData=new Float32Array(8),i.vertexTrimmedData=null,i._transformID=-1,i._textureID=-1,i._transformTrimmedID=-1,i._textureTrimmedID=-1,i.indices=Hm,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=Ki(this.scale.x)*this._width/this._texture.orig.width),this._height&&(this.scale.y=Ki(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,o=i.c,a=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,g=0;if(f?(p=f.x-d._x*c.width,v=p+f.width,g=f.y-d._y*c.height,_=g+f.height):(p=-d._x*c.width,v=p+c.width,g=-d._y*c.height,_=g+c.height),l[0]=n*p+o*g+h,l[1]=a*g+s*p+u,l[2]=n*v+o*g+h,l[3]=a*g+s*v+u,l[4]=n*v+o*_+h,l[5]=a*_+s*v+u,l[6]=n*p+o*_+h,l[7]=a*_+s*p+u,this._roundPixels)for(var y=L.RESOLUTION,m=0;m<l.length;++m)l[m]=Math.round((l[m]*y|0)/y)}},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,o=this.transform.worldTransform,a=o.a,h=o.b,u=o.c,l=o.d,f=o.tx,c=o.ty,d=-s._x*n.width,v=d+n.width,p=-s._y*n.height,_=p+n.height;i[0]=a*d+u*p+f,i[1]=l*p+h*d+c,i[2]=a*v+u*p+f,i[3]=l*p+h*v+c,i[4]=a*v+u*_+f,i[5]=l*_+h*v+c,i[6]=a*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 yn),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 J),t=this._localBoundsRect),this._localBounds.getRectangle(t)):r.prototype.getLocalBounds.call(this,t)},e.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,Br);var i=this._texture.orig.width,n=this._texture.orig.height,s=-i*this.anchor.x,o=0;return Br.x>=s&&Br.x<s+i&&(o=-n*this.anchor.y,Br.y>=o&&Br.y<o+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 Y?t:Y.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=Ki(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=Ki(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||Y.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}(ht);var bo=function(r,e){return bo=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])},bo(r,e)};function Wm(r,e){bo(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Lr;(function(r){r[r.LINEAR_VERTICAL=0]="LINEAR_VERTICAL",r[r.LINEAR_HORIZONTAL=1]="LINEAR_HORIZONTAL"})(Lr||(Lr={}));var To={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:Lr.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},zm=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],oi=function(){function r(e){this.styleID=0,this.reset(),Eo(this,e,e)}return r.prototype.clone=function(){var e={};return Eo(e,this,To),new r(e)},r.prototype.reset=function(){Eo(this,To,To)},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=wo(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=wo(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){Ym(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=wo(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)&&zm.indexOf(n)<0&&(n='"'+n+'"'),t[i]=n}return this.fontStyle+" "+this.fontVariant+" "+this.fontWeight+" "+e+" "+t.join(",")},r}();function Mu(r){return typeof r=="number"?yh(r):(typeof r=="string"&&r.indexOf("0x")===0&&(r=r.replace("0x","#")),r)}function wo(r){if(Array.isArray(r)){for(var e=0;e<r.length;++e)r[e]=Mu(r[e]);return r}else return Mu(r)}function Ym(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 Eo(r,e,t){for(var i in t)Array.isArray(e[i])?r[i]=e[i].slice():r[i]=e[i]}var kn={willReadFrequently:!0},le=function(){function r(e,t,i,n,s,o,a,h,u){this.text=e,this.style=t,this.width=i,this.height=n,this.lines=s,this.lineWidths=o,this.lineHeight=a,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(),o=r.measureFont(s);o.fontSize===0&&(o.fontSize=t.fontSize,o.ascent=t.fontSize);var a=n.getContext("2d",kn);a.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=a.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||o.fontSize+t.strokeThickness,_=Math.max(p,o.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,o)},r.wordWrap=function(e,t,i){i===void 0&&(i=r._canvas);for(var n=i.getContext("2d",kn),s=0,o="",a="",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 g=p[_];if(r.isNewline(g)){if(!c){a+=r.addLine(o),d=!f,o="",s=0;continue}g=" "}if(f){var y=r.isBreakingSpace(g),m=r.isBreakingSpace(o[o.length-1]);if(y&&m)continue}var b=r.getFromCache(g,u,h,n);if(b>v)if(o!==""&&(a+=r.addLine(o),o="",s=0),r.canBreakWords(g,t.breakWords))for(var x=r.wordWrapSplit(g),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,g,T,t.breakWords))w+=E;else break;S++}T+=w.length-1;var O=r.getFromCache(w,u,h,n);O+s>v&&(a+=r.addLine(o),d=!1,o="",s=0),o+=w,s+=O}else{o.length>0&&(a+=r.addLine(o),o="",s=0);var N=_===p.length-1;a+=r.addLine(g,!N),d=!1,o="",s=0}else b+s>v&&(d=!1,a+=r.addLine(o),o="",s=0),(o.length>0||!r.isBreakingSpace(g)||d)&&(o+=g,s+=b)}return a+=r.addLine(o,!1),a},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 o=e.length*t;s=n.measureText(e).width+o,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],o=e[n+1];if(r.isBreakingSpace(s,o)||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,o=Math.ceil(n.measureText(s).width),a=Math.ceil(n.measureText(r.BASELINE_SYMBOL).width),h=Math.ceil(r.HEIGHT_MULTIPLIER*a);a=a*r.BASELINE_MULTIPLIER|0,i.width=o,i.height=h,n.fillStyle="#f00",n.fillRect(0,0,o,h),n.font=e,n.textBaseline="alphabetic",n.fillStyle="#000",n.fillText(s,0,a);var u=n.getImageData(0,0,o,h).data,l=u.length,f=o*4,c=0,d=0,v=!1;for(c=0;c<a;++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=a-c,d=l-f,v=!1,c=h;c>a;--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-a,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",kn);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",kn)),r.__context},enumerable:!1,configurable:!0}),r}();le._fonts={},le.METRICS_STRING="|ÉqÅ",le.BASELINE_SYMBOL="M",le.BASELINE_MULTIPLIER=1.4,le.HEIGHT_MULTIPLIER=2,le._newlines=[10,13],le._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];var Vm={texture:!0,children:!1,baseTexture:!0},Du=function(r){Wm(e,r);function e(t,i,n){var s=this,o=!1;n||(n=L.ADAPTER.createCanvas(),o=!0),n.width=3,n.height=3;var a=Y.from(n);return a.orig=new J,a.trim=new J,s=r.call(this,a)||this,s._ownCanvas=o,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=le.measureText(this._text||" ",this._style,this._style.wordWrap,this.canvas),o=s.width,a=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,o)+i.padding*2)*this._resolution),this.canvas.height=Math.ceil(Math.ceil(Math.max(1,a)+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 g=i.dropShadow&&_===0,y=g?Math.ceil(Math.max(1,a)+i.padding*2):0,m=y*this._resolution;if(g){n.fillStyle="black",n.strokeStyle="black";var b=i.dropShadowColor,x=Zi(typeof b=="number"?b:xh(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+m}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-y,!0),i.fill&&this.drawLetterSpacing(h[E],d+i.padding,v+i.padding-y)}this.updateTexture()}},e.prototype.drawLetterSpacing=function(t,i,n,s){s===void 0&&(s=!1);var o=this._style,a=o.letterSpacing,h=e.experimentalLetterSpacing&&("letterSpacing"in CanvasRenderingContext2D.prototype||"textLetterSpacing"in CanvasRenderingContext2D.prototype);if(a===0||h){h&&(this.context.letterSpacing=a,this.context.textLetterSpacing=a),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+a,f=c}},e.prototype.updateTexture=function(){var t=this.canvas;if(this._style.trim){var i=jv(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,o=s.trim?0:s.padding,a=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=-o,n.trim.y=-o,n.orig.width=n._frame.width-o*2,n.orig.height=n._frame.height-o*2,this._onTextureUpdate(),a.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 o,a=t.dropShadow?t.dropShadowDistance:0,h=t.padding||0,u=this.canvas.width/this._resolution-a-h*2,l=this.canvas.height/this._resolution-a-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===Lr.LINEAR_VERTICAL){o=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,g=n.lineHeight*v,y=g;v>0&&_>g&&(y=(g+_)/2);var m=g+p,b=n.lineHeight*(v+1),x=m;v+1<i.length&&b<m&&(x=(m+b)/2);for(var T=(x-y)/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,y/l+S*T));E=Number(E.toFixed(5)),o.addColorStop(E,f[w])}}}else{o=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 N=void 0;typeof c[v]=="number"?N=c[v]:N=O/P,o.addColorStop(N,f[v]),O++}}return o},e.prototype.destroy=function(t){typeof t=="boolean"&&(t={children:t}),t=Object.assign({},Vm,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=Ki(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=Ki(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 oi?this._style=t:this._style=new oi(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}(ct);L.UPLOADS_PER_FRAME=4;var So=function(r,e){return So=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])},So(r,e)};function jm(r,e){So(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Zm=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 qm(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 Y){var n=r._textures[i].baseTexture;e.indexOf(n)===-1&&(e.push(n),t=!0)}}return t}function Km(r,e){if(r.baseTexture instanceof rt){var t=r.baseTexture;return e.indexOf(t)===-1&&e.push(t),!0}return!1}function $m(r,e){if(r._texture&&r._texture instanceof Y){var t=r._texture.baseTexture;return e.indexOf(t)===-1&&e.push(t),!0}return!1}function Jm(r,e){return e instanceof Du?(e.updateText(!0),!0):!1}function Qm(r,e){if(e instanceof oi){var t=e.toFontString();return le.measureFont(t),!0}return!1}function ty(r,e){if(r instanceof Du){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 ey(r,e){return r instanceof oi?(e.indexOf(r)===-1&&e.push(r),!0):!1}var iy=function(){function r(e){var t=this;this.limiter=new Zm(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(ty),this.registerFindHook(ey),this.registerFindHook(qm),this.registerFindHook(Km),this.registerFindHook($m),this.registerUploadHook(Jm),this.registerUploadHook(Qm)}return r.prototype.upload=function(e,t){var i=this;return typeof e=="function"&&(t=e,e=null),t&&Te("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,Ut.system.addOnce(i.tick,i,ee.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)Ut.system.addOnce(this.tick,this,ee.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 ht)for(var t=e.children.length-1;t>=0;t--)this.add(e.children[t]);return this},r.prototype.destroy=function(){this.ticking&&Ut.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 Nu(r,e){return e instanceof rt?(e._glTextures[r.CONTEXT_UID]||r.texture.bind(e),!0):!1}function ry(r,e){if(!(e instanceof Le))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&&Nu(r,s.baseTexture)}return t.batchable||r.geometry.bind(t,e._resolveDirectShader(r)),!0}function ny(r,e){return r instanceof Le?(e.push(r),!0):!1}var sy=function(r){jm(e,r);function e(t){var i=r.call(this,t)||this;return i.uploadHookHelper=i.renderer,i.registerFindHook(ny),i.registerUploadHook(Nu),i.registerUploadHook(ry),i}return e.extension={name:"prepare",type:at.RendererPlugin},e}(iy);var oy=function(){function r(e,t,i){i===void 0&&(i=null),this.linkedSheets=[],this._texture=e instanceof Y?e:null,this.baseTexture=e instanceof rt?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=mn(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&&Te("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],o=s.frame;if(o){var a=null,h=null,u=s.trimmed!==!1&&s.sourceSize?s.sourceSize:s.frame,l=new J(0,0,Math.floor(u.w)/this.resolution,Math.floor(u.h)/this.resolution);s.rotated?a=new J(Math.floor(o.x)/this.resolution,Math.floor(o.y)/this.resolution,Math.floor(o.h)/this.resolution,Math.floor(o.w)/this.resolution):a=new J(Math.floor(o.x)/this.resolution,Math.floor(o.y)/this.resolution,Math.floor(o.w)/this.resolution,Math.floor(o.h)/this.resolution),s.trimmed!==!1&&s.spriteSourceSize&&(h=new J(Math.floor(s.spriteSourceSize.x)/this.resolution,Math.floor(s.spriteSourceSize.y)/this.resolution,Math.floor(o.w)/this.resolution,Math.floor(o.h)/this.resolution)),this.textures[n]=new Y(this.baseTexture,a,l,h,s.rotated?2:0,s.anchor),Y.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}(),ay=function(){function r(){}return r.use=function(e,t){var i,n,s=this,o=e.name+"_image";if(!e.data||e.type!==Et.TYPE.JSON||!e.data.frames||s.resources[o]){t();return}var a=(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(a))for(var h=function(v){if(typeof v!="string")return"continue";var p=v.replace(".json",""),_=ji.resolve(e.url.replace(s.baseUrl,""),v);if(s.resources[p]||Object.values(s.resources).some(function(y){return ji.format(ji.parse(y.url))===_}))return"continue";var g={crossOrigin:e.crossOrigin,loadType:Et.LOAD_TYPE.XHR,xhrType:Et.XHR_RESPONSE_TYPE.JSON,parentResource:e,metadata:e.metadata};s.add(p,_,g)},u=0,l=a;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(o,d,c,function(p){if(p.error){t(p.error);return}var _=new oy(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:ji.resolve(e.url.replace(t,""),e.data.meta.image)},r.extension=at.Loader,r}();var Po=function(r,e){return Po=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])},Po(r,e)};function Fu(r,e){Po(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Gr=new j;(function(r){Fu(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 Ua,s._width=i,s._height=n,s.uvMatrix=s.texture.uvMatrix||new $s(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 J),t=this._localBoundsRect),this._bounds.getRectangle(t)):r.prototype.getLocalBounds.call(this,t)},e.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,Gr);var i=this._width,n=this._height,s=-i*this.anchor._x;if(Gr.x>=s&&Gr.x<s+i){var o=-n*this.anchor._y;if(Gr.y>=o&&Gr.y<o+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 Y?t:Y.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})(ct);var hy=`#version 100
528
+ `,Am=function(r){Tu(e,r);function e(t){var i=r.call(this,t)||this;return i.shader=null,i.properties=null,i.tempMatrix=new Nt,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=ii.from(Om,Cm,{}),i.state=Ci.for2d(),i}return e.prototype.render=function(t){var i=t.children,n=t._maxSize,s=t._batchSize,o=this.renderer,a=i.length;if(a!==0){a>n&&!t.autoResize&&(a=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=Th(t.blendMode,l),o.state.set(this.state);var f=o.gl,c=t.worldTransform.copyTo(this.tempMatrix);c.prepend(o.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=c.toArray(!0),this.shader.uniforms.uColor=zv(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<a;v+=s,p+=1){var _=a-v;_>s&&(_=s),p>=h.length&&h.push(this._generateOneMoreBuffer(t));var g=h[p];g.uploadDynamic(i,v,_);var y=t._bufferUpdateIDs[p]||0;d=d||g._updateID<y,d&&(g._updateID=t._updateID,g.uploadStatic(i,v,_)),o.geometry.bind(g.geometry),f.drawElements(f.TRIANGLES,_*6,f.UNSIGNED_SHORT,0)}}},e.prototype.generateBuffers=function(t){for(var i=[],n=t._maxSize,s=t._batchSize,o=t._properties,a=0;a<n;a+=s)i.push(new wu(this.properties,o,s));return i},e.prototype._generateOneMoreBuffer=function(t){var i=t._batchSize,n=t._properties;return new wu(this.properties,n,i)},e.prototype.uploadVertices=function(t,i,n,s,o,a){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,g=v.trim,y=v.orig;g?(u=g.x-d.anchor.x*y.width,h=u+g.width,f=g.y-d.anchor.y*y.height,l=f+g.height):(h=y.width*(1-d.anchor.x),u=y.width*-d.anchor.x,l=y.height*(1-d.anchor.y),f=y.height*-d.anchor.y),s[a]=u*p,s[a+1]=f*_,s[a+o]=h*p,s[a+o+1]=f*_,s[a+o*2]=h*p,s[a+o*2+1]=l*_,s[a+o*3]=u*p,s[a+o*3+1]=l*_,a+=o*4}},e.prototype.uploadPosition=function(t,i,n,s,o,a){for(var h=0;h<n;h++){var u=t[i+h].position;s[a]=u.x,s[a+1]=u.y,s[a+o]=u.x,s[a+o+1]=u.y,s[a+o*2]=u.x,s[a+o*2+1]=u.y,s[a+o*3]=u.x,s[a+o*3+1]=u.y,a+=o*4}},e.prototype.uploadRotation=function(t,i,n,s,o,a){for(var h=0;h<n;h++){var u=t[i+h].rotation;s[a]=u,s[a+o]=u,s[a+o*2]=u,s[a+o*3]=u,a+=o*4}},e.prototype.uploadUvs=function(t,i,n,s,o,a){for(var h=0;h<n;++h){var u=t[i+h]._texture._uvs;u?(s[a]=u.x0,s[a+1]=u.y0,s[a+o]=u.x1,s[a+o+1]=u.y1,s[a+o*2]=u.x2,s[a+o*2+1]=u.y2,s[a+o*3]=u.x3,s[a+o*3+1]=u.y3,a+=o*4):(s[a]=0,s[a+1]=0,s[a+o]=0,s[a+o+1]=0,s[a+o*2]=0,s[a+o*2+1]=0,s[a+o*3]=0,s[a+o*3+1]=0,a+=o*4)}},e.prototype.uploadTint=function(t,i,n,s,o,a){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?Ds(u._tintRGB,f):u._tintRGB+(f*255<<24);s[a]=c,s[a+o]=c,s[a+o*2]=c,s[a+o*3]=c,a+=o*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:at.RendererPlugin},e}(Tn);var qe;(function(r){r.MITER="miter",r.BEVEL="bevel",r.ROUND="round"})(qe||(qe={}));var si;(function(r){r.BUTT="butt",r.ROUND="round",r.SQUARE="square"})(si||(si={}));var Fr={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}},Eu=function(){function r(){this.color=16777215,this.alpha=1,this.texture=Y.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=Y.WHITE,this.matrix=null,this.visible=!1},r.prototype.destroy=function(){this.texture=null,this.matrix=null},r}();var _o=function(r,e){return _o=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])},_o(r,e)};function go(r,e){_o(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function Su(r,e){var t,i;e===void 0&&(e=!1);var n=r.length;if(!(n<6)){for(var s=0,o=0,a=r[n-2],h=r[n-1];o<n;o+=2){var u=r[o],l=r[o+1];s+=(u-a)*(l+h),a=u,h=l}if(!e&&s>0||e&&s<=0)for(var f=n/2,o=f+f%2;o<n;o+=2){var c=n-o-2,d=n-o-1,v=o,p=o+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){Su(t,!1);for(var o=[],a=0;a<i.length;a++){var h=i[a];Su(h.points,!0),o.push(t.length/2),t=t.concat(h.points)}var u=ln.exports(t,o,2);if(!u)return;for(var l=n.length/2,a=0;a<u.length;a+=3)s.push(u[a]+l),s.push(u[a+1]+l),s.push(u[a+2]+l);for(var a=0;a<t.length;a++)n.push(t[a])}}},Ln={build:function(r){var e=r.points,t,i,n,s,o,a;if(r.type===Gt.CIRC){var h=r.shape;t=h.x,i=h.y,o=a=h.radius,n=s=0}else if(r.type===Gt.ELIP){var u=r.shape;t=u.x,i=u.y,o=u.width,a=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,o=a=Math.max(0,Math.min(l.radius,Math.min(f,c))),n=f-o,s=c-a}if(!(o>=0&&a>=0&&n>=0&&s>=0)){e.length=0;return}var d=Math.ceil(2.3*Math.sqrt(o+a)),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,g=_,y=v;{var m=n+o,b=s,x=t+m,T=t-m,w=i+b;if(e[p++]=x,e[p++]=w,e[--_]=w,e[--_]=T,s){var S=i-b;e[g++]=T,e[g++]=S,e[--y]=S,e[--y]=x}}for(var E=1;E<d;E++){var P=Math.PI/2*(E/d),m=n+Math.cos(P)*o,b=s+Math.sin(P)*a,x=t+m,T=t-m,w=i+b,S=i-b;e[p++]=x,e[p++]=w,e[--_]=w,e[--_]=T,e[g++]=T,e[g++]=S,e[--y]=S,e[--y]=x}{var m=n,b=s+a,x=t+m,T=t-m,w=i+b,S=i-b;e[p++]=x,e[p++]=w,e[--y]=S,e[--y]=x,n&&(e[p++]=T,e[p++]=w,e[--y]=S,e[--y]=T)}}},triangulate:function(r,e){var t=r.points,i=e.points,n=e.indices;if(t.length!==0){var s=i.length/2,o=s,a,h;if(r.type!==Gt.RREC){var u=r.shape;a=u.x,h=u.y}else{var l=r.shape;a=l.x+l.width/2,h=l.y+l.height/2}var f=r.matrix;i.push(r.matrix?f.a*a+f.c*h+f.tx:a,r.matrix?f.b*a+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++,o,s);n.push(o+1,o,s)}}},Im={build:function(r){var e=r.shape,t=e.x,i=e.y,n=e.width,s=e.height,o=r.points;o.length=0,o.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 Gn(r,e,t,i,n,s,o){o===void 0&&(o=[]);for(var a=20,h=o,u=0,l=0,f=0,c=0,d=0,v=0,p=0,_=0;p<=a;++p)_=p/a,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 Mm={build:function(r){if(Le.nextRoundedRectBehavior){Ln.build(r);return}var e=r.shape,t=r.points,i=e.x,n=e.y,s=e.width,o=e.height,a=Math.max(0,Math.min(e.radius,Math.min(s,o)/2));t.length=0,a?(Gn(i,n+a,i,n,i+a,n,t),Gn(i+s-a,n,i+s,n,i+s,n+a,t),Gn(i+s,n+o-a,i+s,n+o,i+s-a,n+o,t),Gn(i+a,n+o,i,n+o,i,n+o-a,t)):t.push(i,n,i+s,n,i+s,n+o,i,n+o)},triangulate:function(r,e){if(Le.nextRoundedRectBehavior){Ln.triangulate(r,e);return}for(var t=r.points,i=e.points,n=e.indices,s=i.length/2,o=ln.exports(t,null,2),a=0,h=o.length;a<h;a+=3)n.push(o[a]+s),n.push(o[a+1]+s),n.push(o[a+2]+s);for(var a=0,h=t.length;a<h;a++)i.push(t[a],t[++a])}};function Ru(r,e,t,i,n,s,o,a){var h=r-t*n,u=e-i*n,l=r+t*s,f=e+i*s,c,d;o?(c=i,d=-t):(c=-i,d=t);var v=h+c,p=u+d,_=l+c,g=f+d;return a.push(v,p),a.push(_,g),2}function Ii(r,e,t,i,n,s,o,a){var h=t-r,u=i-e,l=Math.atan2(h,u),f=Math.atan2(n-r,s-e);a&&l<f?l+=Math.PI*2:!a&&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,g=d/_;if(c+=g,a){o.push(r,e),o.push(t,i);for(var y=1,m=c;y<_;y++,m+=g)o.push(r,e),o.push(r+Math.sin(m)*p,e+Math.cos(m)*p);o.push(r,e),o.push(n,s)}else{o.push(t,i),o.push(r,e);for(var y=1,m=c;y<_;y++,m+=g)o.push(r+Math.sin(m)*p,e+Math.cos(m)*p),o.push(r,e);o.push(n,s),o.push(r,e)}return _*2}function Nm(r,e){var t=r.shape,i=r.points||t.points.slice(),n=e.closePointEps;if(i.length!==0){var s=r.lineStyle,o=new j(i[0],i[1]),a=new j(i[i.length-2],i[i.length-1]),h=t.type!==Gt.POLY||t.closeStroke,u=Math.abs(o.x-a.x)<n&&Math.abs(o.y-a.y)<n;if(h){i=i.slice(),u&&(i.pop(),i.pop(),a.set(i[i.length-2],i[i.length-1]));var l=(o.x+a.x)*.5,f=(a.y+o.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,g=_*_,y=s.miterLimit*s.miterLimit,m=i[0],b=i[1],x=i[2],T=i[3],w=0,S=0,E=-(b-T),P=m-x,O=0,D=0,N=Math.sqrt(E*E+P*P);E/=N,P/=N,E*=_,P*=_;var U=s.alignment,I=(1-U)*2,A=U*2;h||(s.cap===si.ROUND?v+=Ii(m-E*(I-A)*.5,b-P*(I-A)*.5,m-E*I,b-P*I,m+E*A,b+P*A,c,!0)+2:s.cap===si.SQUARE&&(v+=Ru(m,b,E,P,I,A,!0,c))),c.push(m-E*I,b-P*I),c.push(m+E*A,b+P*A);for(var B=1;B<d-1;++B){m=i[(B-1)*2],b=i[(B-1)*2+1],x=i[B*2],T=i[B*2+1],w=i[(B+1)*2],S=i[(B+1)*2+1],E=-(b-T),P=m-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 K=x-m,z=b-T,M=x-w,C=S-T,G=K*M+z*C,tt=z*M-C*K,V=tt<0;if(Math.abs(tt)<.001*Math.abs(G)){c.push(x-E*I,T-P*I),c.push(x+E*A,T+P*A),G>=0&&(s.join===qe.ROUND?v+=Ii(x,T,x-E*I,T-P*I,x-O*I,T-D*I,c,!1)+4:v+=2,c.push(x-O*A,T-D*A),c.push(x+O*I,T+D*I));continue}var nt=(-E+m)*(-P+T)-(-E+x)*(-P+b),dt=(-O+w)*(-D+T)-(-O+x)*(-D+S),pt=(K*dt-M*nt)/tt,Pt=(C*nt-z*dt)/tt,Lt=(pt-x)*(pt-x)+(Pt-T)*(Pt-T),vt=x+(pt-x)*I,st=T+(Pt-T)*I,H=x-(pt-x)*A,$=T-(Pt-T)*A,Z=Math.min(K*K+z*z,M*M+C*C),xt=V?I:A,Rt=Z+xt*xt*g,Q=Lt<=Rt;Q?s.join===qe.BEVEL||Lt/g>y?(V?(c.push(vt,st),c.push(x+E*A,T+P*A),c.push(vt,st),c.push(x+O*A,T+D*A)):(c.push(x-E*I,T-P*I),c.push(H,$),c.push(x-O*I,T-D*I),c.push(H,$)),v+=2):s.join===qe.ROUND?V?(c.push(vt,st),c.push(x+E*A,T+P*A),v+=Ii(x,T,x+E*A,T+P*A,x+O*A,T+D*A,c,!0)+4,c.push(vt,st),c.push(x+O*A,T+D*A)):(c.push(x-E*I,T-P*I),c.push(H,$),v+=Ii(x,T,x-E*I,T-P*I,x-O*I,T-D*I,c,!1)+4,c.push(x-O*I,T-D*I),c.push(H,$)):(c.push(vt,st),c.push(H,$)):(c.push(x-E*I,T-P*I),c.push(x+E*A,T+P*A),s.join===qe.ROUND?V?v+=Ii(x,T,x+E*A,T+P*A,x+O*A,T+D*A,c,!0)+2:v+=Ii(x,T,x-E*I,T-P*I,x-O*I,T-D*I,c,!1)+2:s.join===qe.MITER&&Lt/g<=y&&(V?(c.push(H,$),c.push(H,$)):(c.push(vt,st),c.push(vt,st)),v+=2),c.push(x-O*I,T-D*I),c.push(x+O*A,T+D*A),v+=2)}m=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=m-x,N=Math.sqrt(E*E+P*P),E/=N,P/=N,E*=_,P*=_,c.push(x-E*I,T-P*I),c.push(x+E*A,T+P*A),h||(s.cap===si.ROUND?v+=Ii(x-E*(I-A)*.5,T-P*(I-A)*.5,x-E*I,T-P*I,x+E*A,T+P*A,c,!1)+2:s.cap===si.SQUARE&&(v+=Ru(x,T,E,P,I,A,!1,c)));for(var Wt=e.indices,He=Fr.epsilon*Fr.epsilon,B=p;B<v+p-2;++B)m=c[B*2],b=c[B*2+1],x=c[(B+1)*2],T=c[(B+1)*2+1],w=c[(B+2)*2],S=c[(B+2)*2+1],!(Math.abs(m*(T-S)+x*(S-b)+w*(b-T))<He)&&Wt.push(B,B+1,B+2)}}function Dm(r,e){var t=0,i=r.shape,n=r.points||i.points,s=i.type!==Gt.POLY||i.closeStroke;if(n.length!==0){var o=e.points,a=e.indices,h=n.length/2,u=o.length/2,l=u;for(o.push(n[0],n[1]),t=1;t<h;t++)o.push(n[t*2],n[t*2+1]),a.push(l,l+1),l++;s&&a.push(l,u)}}function Cu(r,e){r.lineStyle.native?Dm(r,e):Nm(r,e)}var Ou=function(){function r(){}return r.curveTo=function(e,t,i,n,s,o){var a=o[o.length-2],h=o[o.length-1],u=h-t,l=a-e,f=n-t,c=i-e,d=Math.abs(u*c-l*f);if(d<1e-8||s===0)return(o[o.length-2]!==e||o[o.length-1]!==t)&&o.push(e,t),null;var v=u*u+l*l,p=f*f+c*c,_=u*f+l*c,g=s*Math.sqrt(v)/d,y=s*Math.sqrt(p)/d,m=g*_/v,b=y*_/p,x=g*c+y*l,T=g*f+y*u,w=l*(y+m),S=u*(y+m),E=c*(g+b),P=f*(g+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,o,a,h,u){for(var l=a-o,f=Fr._segmentsCount(Math.abs(l)*s,Math.ceil(Math.abs(l)/Ie)*40),c=l/(f*2),d=c*2,v=Math.cos(c),p=Math.sin(c),_=f-1,g=_%1/_,y=0;y<=_;++y){var m=y+g*y,b=c+o+d*m,x=Math.cos(b),T=-Math.sin(b);u.push((v*x+p*T)*s+i,(v*-T+p*x)*s+n)}},r}(),Fm=function(){function r(){}return r.curveLength=function(e,t,i,n,s,o,a,h){for(var u=10,l=0,f=0,c=0,d=0,v=0,p=0,_=0,g=0,y=0,m=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,g=_*e+3*p*f*i+3*v*c*s+d*a,y=_*t+3*p*f*n+3*v*c*o+d*h,m=x-g,b=T-y,x=g,T=y,l+=Math.sqrt(m*m+b*b);return l},r.curveTo=function(e,t,i,n,s,o,a){var h=a[a.length-2],u=a[a.length-1];a.length-=2;var l=Fr._segmentsCount(r.curveLength(h,u,e,t,i,n,s,o)),f=0,c=0,d=0,v=0,p=0;a.push(h,u);for(var _=1,g=0;_<=l;++_)g=_/l,f=1-g,c=f*f,d=c*f,v=g*g,p=v*g,a.push(d*h+3*c*g*e+3*f*v*i+p*s,d*u+3*c*g*t+3*f*v*n+p*o)},r}(),Bm=function(){function r(){}return r.curveLength=function(e,t,i,n,s,o){var a=e-2*i+s,h=t-2*n+o,u=2*i-2*e,l=2*n-2*t,f=4*(a*a+h*h),c=4*(a*u+h*l),d=u*u+l*l,v=2*Math.sqrt(f+c+d),p=Math.sqrt(f),_=2*f*p,g=2*Math.sqrt(d),y=c/p;return(_*v+p*c*(v-g)+(4*d*f-c*c)*Math.log((2*p+y+v)/(y+g)))/(4*_)},r.curveTo=function(e,t,i,n,s){for(var o=s[s.length-2],a=s[s.length-1],h=Fr._segmentsCount(r.curveLength(o,a,e,t,i,n)),u=0,l=0,f=1;f<=h;++f){var c=f/h;u=o+(e-o)*c,l=a+(t-a)*c,s.push(u+(e+(i-e)*c-u)*c,l+(t+(n-t)*c-l)*c)}},r}(),Lm=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}(),Mi,mo=(Mi={},Mi[Gt.POLY]=Pu,Mi[Gt.CIRC]=Ln,Mi[Gt.ELIP]=Ln,Mi[Gt.RECT]=Im,Mi[Gt.RREC]=Mm,Mi),Au=[],Un=[],Iu=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}(),Qi=new j,Gm=function(r){go(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 yn,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(),Un.push(this.drawCalls[t]);this.drawCalls.length=0;for(var t=0;t<this.batches.length;t++){var i=this.batches[t];i.reset(),Au.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 o=new Iu(t,i,n,s);return this.graphicsData.push(o),this.dirty++,this},e.prototype.drawHole=function(t,i){if(i===void 0&&(i=null),!this.graphicsData.length)return null;var n=new Iu(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,Qi):Qi.copyFrom(t),s.shape.contains(Qi.x,Qi.y))){var o=!1;if(s.holes)for(var a=0;a<s.holes.length;a++){var h=s.holes[a];if(h.shape.contains(Qi.x,Qi.y)){o=!0;break}}if(!o)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 o=this.shapeIndex;o<i.length;o++){this.shapeIndex++;var a=i[o],h=a.fillStyle,u=a.lineStyle,l=mo[a.type];l.build(a),a.matrix&&this.transformPoints(a.points,a.matrix),(h.visible||u.visible)&&this.processHoles(a.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=Ne.REPEAT,f===0?this.processFill(a):this.processLine(a);var _=this.points.length/2-p;_!==0&&(n&&!this._compareStyles(s,c)&&(n.end(v,p),n=null),n||(n=Au.pop()||new Lm,n.begin(c,v,p),this.batches.push(n),s=c),this.addUvs(this.points,t,c.texture,p,_,c.matrix))}}}var g=this.indices.length,y=this.points.length/2;if(n&&n.end(g,y),this.batches.length===0){this.batchable=!0;return}var m=y>65535;this.indicesUint16&&this.indices.length===this.indicesUint16.length&&m===this.indicesUint16.BYTES_PER_ELEMENT>2?this.indicesUint16.set(this.indices):this.indicesUint16=m?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,o=n.lineStyle;if(s&&!s.texture.baseTexture.valid||o&&!o.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],o=0;o<s.size;o++){var a=s.start+o;this.indicesUint16[a]=this.indicesUint16[a]-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=++rt._globalBatch,i=0;i<this.drawCalls.length;i++)this.drawCalls[i].texArray.clear(),Un.push(this.drawCalls[i]);this.drawCalls.length=0;var n=this.colors,s=this.textureIds,o=Un.pop();o||(o=new to,o.texArray=new eo),o.texArray.count=0,o.start=0,o.size=0,o.type=ge.TRIANGLES;var a=0,h=null,u=0,l=!1,f=ge.TRIANGLES,c=0;this.drawCalls.push(o);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?ge.LINES:ge.TRIANGLES,h=null,a=v,t++),h!==_&&(h=_,_._batchEnabled!==t&&(a===v&&(t++,a=0,o.size>0&&(o=Un.pop(),o||(o=new to,o.texArray=new eo),this.drawCalls.push(o)),o.start=c,o.size=0,o.texArray.count=0,o.type=f),_.touched=1,_._batchEnabled=t,_._batchLocation=a,_.wrapMode=Ne.REPEAT,o.texArray.elements[o.texArray.count++]=_,a++)),o.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)}rt._globalBatch=t,this.packAttributes()},e.prototype.packAttributes=function(){for(var t=this.points,i=this.uvs,n=this.colors,s=this.textureIds,o=new ArrayBuffer(t.length*3*4),a=new Float32Array(o),h=new Uint32Array(o),u=0,l=0;l<t.length/2;l++)a[u++]=t[l*2],a[u++]=t[l*2+1],a[u++]=i[l*2],a[u++]=i[l*2+1],h[u++]=n[l],a[u++]=s[l];this._buffer.update(o),this._indexBuffer.update(this.indicesUint16)},e.prototype.processFill=function(t){if(t.holes.length)Pu.triangulate(t,this);else{var i=mo[t.type];i.triangulate(t,this)}},e.prototype.processLine=function(t){Cu(t,this);for(var i=0;i<t.holes.length;i++)Cu(t.holes[i],this)},e.prototype.processHoles=function(t){for(var i=0;i<t.length;i++){var n=t[i],s=mo[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],o=t[n*2+1];t[n*2]=i.a*s+i.c*o+i.tx,t[n*2+1]=i.b*s+i.d*o+i.ty}},e.prototype.addColors=function(t,i,n,s,o){o===void 0&&(o=0);var a=(i>>16)+(i&65280)+((i&255)<<16),h=Ds(a,n);t.length=Math.max(t.length,o+s);for(var u=0;u<s;u++)t[o+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 o=0;o<n;o++)t[s+o]=i},e.prototype.addUvs=function(t,i,n,s,o,a){a===void 0&&(a=null);for(var h=0,u=i.length,l=n.frame;h<o;){var f=t[(s+h)*2],c=t[(s+h)*2+1];if(a){var d=a.a*f+a.c*c+a.tx;c=a.b*f+a.d*c+a.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,o)},e.prototype.adjustUvs=function(t,i,n,s){for(var o=i.baseTexture,a=1e-6,h=n+s*2,u=i.frame,l=u.width/o.width,f=u.height/o.height,c=u.x/u.width,d=u.y/u.height,v=Math.floor(t[n]+a),p=Math.floor(t[n+1]+a),_=n+2;_<h;_+=2)v=Math.min(v,Math.floor(t[_]+a)),p=Math.min(p,Math.floor(t[_+1]+a));c-=v,d-=p;for(var _=n;_<h;_+=2)t[_]=(t[_]+c)*l,t[_+1]=(t[_+1]+d)*f},e.BATCHABLE_SIZE=100,e}(ru),Um=function(r){go(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=si.BUTT,t.join=qe.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}(Eu),km=new Float32Array(3),yo={},Le=function(r){go(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 Eu,i._lineStyle=new Um,i._matrix=null,i._holeMode=!1,i.state=Ci.for2d(),i._geometry=t||new Gm,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,o){return t===void 0&&(t=null),i===void 0&&(i=0),n===void 0&&(n=1),s===void 0&&(s=.5),o===void 0&&(o=!1),typeof t=="number"&&(t={width:t,color:i,alpha:n,alignment:s,native:o}),this.lineTextureStyle(t)},e.prototype.lineTextureStyle=function(t){t=Object.assign({width:0,texture:Y.WHITE,color:t&&t.texture?16777215:0,alpha:1,matrix:null,alignment:.5,native:!1,cap:si.BUTT,join:qe.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 nn,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[i-2],t[i-1]))}else this.currentPath=new nn,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],o=n[n.length-1];return(s!==t||o!==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 o=this.currentPath.points;return o.length===0&&this.moveTo(0,0),Bm.curveTo(t,i,n,s,o),this},e.prototype.bezierCurveTo=function(t,i,n,s,o,a){return this._initCurve(),Fm.curveTo(t,i,n,s,o,a,this.currentPath.points),this},e.prototype.arcTo=function(t,i,n,s,o){this._initCurve(t,i);var a=this.currentPath.points,h=Ou.curveTo(t,i,n,s,o,a);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,o,a){if(a===void 0&&(a=!1),s===o)return this;!a&&o<=s?o+=Ie:a&&s<=o&&(s+=Ie);var h=o-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 Ou.arc(u,l,t,i,n,s,o,a,c),this},e.prototype.beginFill=function(t,i){return t===void 0&&(t=0),i===void 0&&(i=1),this.beginTextureFill({texture:Y.WHITE,color:t,alpha:i})},e.prototype.beginTextureFill=function(t){t=Object.assign({texture:Y.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 J(t,i,n,s))},e.prototype.drawRoundedRect=function(t,i,n,s,o){return this.drawShape(new kf(t,i,n,s,o))},e.prototype.drawCircle=function(t,i,n){return this.drawShape(new Gf(t,i,n))},e.prototype.drawEllipse=function(t,i,n,s){return this.drawShape(new Uf(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,o=!0,a=i[0];a.points?(o=a.closeStroke,s=a.points):Array.isArray(i[0])?s=i[0]:s=i;var h=new nn(s);return h.closeStroke=o,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===Gt.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 o=t.batches[s],a=o.style.color,h=new Float32Array(this.vertexData.buffer,o.attribStart*4*2,o.attribSize*2),u=new Float32Array(t.uvsFloat32.buffer,o.attribStart*4*2,o.attribSize*2),l=new Uint16Array(t.indicesUint16.buffer,o.start*2,o.size),f={vertexData:h,blendMode:i,indices:l,uvs:u,_batchRGB:Zi(a),_tintRGB:a,_texture:o.style.texture,alpha:o.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,o=this.worldAlpha,a=i.uniforms,h=n.drawCalls;a.translationMatrix=this.transform.worldTransform,a.tint[0]=(s>>16&255)/255*o,a.tint[1]=(s>>8&255)/255*o,a.tint[2]=(s&255)/255*o,a.tint[3]=o,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,o=i.size,a=i.start,h=n.count,u=0;u<h;u++)t.texture.bind(n.elements[u],u);t.geometry.draw(s,o,a)},e.prototype._resolveDirectShader=function(t){var i=this.shader,n=this.pluginName;if(!i){if(!yo[n]){for(var s=t.plugins[n].MAX_TEXTURES,o=new Int32Array(s),a=0;a<s;a++)o[a]=a;var h={tint:new Float32Array([1,1,1,1]),translationMatrix:new Nt,default:Ri.from({uSamplers:o},!0)},u=t.plugins[n]._shader.program;yo[n]=new ii(u,h)}i=yo[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,o=i.maxX,a=i.maxY;this._bounds.addFrame(this.transform,n,s,o,a)}},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=Zi(this.tint,km),i=0;i<this.batches.length;i++){var n=this.batches[i],s=n._batchRGB,o=t[0]*s[0]*255,a=t[1]*s[1]*255,h=t[2]*s[2]*255,u=(o<<16)+(a<<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,o=i.c,a=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+o*p+h,f[c++]=a*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}(ht);var xo=function(r,e){return xo=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])},xo(r,e)};function Xm(r,e){xo(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Br=new j,Hm=new Uint16Array([0,1,2,0,2,3]),ct=function(r){Xm(e,r);function e(t){var i=r.call(this)||this;return i._anchor=new Wi(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||Y.EMPTY,i.vertexData=new Float32Array(8),i.vertexTrimmedData=null,i._transformID=-1,i._textureID=-1,i._transformTrimmedID=-1,i._textureTrimmedID=-1,i.indices=Hm,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=Ki(this.scale.x)*this._width/this._texture.orig.width),this._height&&(this.scale.y=Ki(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,o=i.c,a=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,g=0;if(f?(p=f.x-d._x*c.width,v=p+f.width,g=f.y-d._y*c.height,_=g+f.height):(p=-d._x*c.width,v=p+c.width,g=-d._y*c.height,_=g+c.height),l[0]=n*p+o*g+h,l[1]=a*g+s*p+u,l[2]=n*v+o*g+h,l[3]=a*g+s*v+u,l[4]=n*v+o*_+h,l[5]=a*_+s*v+u,l[6]=n*p+o*_+h,l[7]=a*_+s*p+u,this._roundPixels)for(var y=L.RESOLUTION,m=0;m<l.length;++m)l[m]=Math.round((l[m]*y|0)/y)}},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,o=this.transform.worldTransform,a=o.a,h=o.b,u=o.c,l=o.d,f=o.tx,c=o.ty,d=-s._x*n.width,v=d+n.width,p=-s._y*n.height,_=p+n.height;i[0]=a*d+u*p+f,i[1]=l*p+h*d+c,i[2]=a*v+u*p+f,i[3]=l*p+h*v+c,i[4]=a*v+u*_+f,i[5]=l*_+h*v+c,i[6]=a*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 yn),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 J),t=this._localBoundsRect),this._localBounds.getRectangle(t)):r.prototype.getLocalBounds.call(this,t)},e.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,Br);var i=this._texture.orig.width,n=this._texture.orig.height,s=-i*this.anchor.x,o=0;return Br.x>=s&&Br.x<s+i&&(o=-n*this.anchor.y,Br.y>=o&&Br.y<o+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 Y?t:Y.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=Ki(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=Ki(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||Y.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}(ht);var bo=function(r,e){return bo=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])},bo(r,e)};function Wm(r,e){bo(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Lr;(function(r){r[r.LINEAR_VERTICAL=0]="LINEAR_VERTICAL",r[r.LINEAR_HORIZONTAL=1]="LINEAR_HORIZONTAL"})(Lr||(Lr={}));var To={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:Lr.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},zm=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],oi=function(){function r(e){this.styleID=0,this.reset(),Eo(this,e,e)}return r.prototype.clone=function(){var e={};return Eo(e,this,To),new r(e)},r.prototype.reset=function(){Eo(this,To,To)},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=wo(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=wo(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){Ym(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=wo(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)&&zm.indexOf(n)<0&&(n='"'+n+'"'),t[i]=n}return this.fontStyle+" "+this.fontVariant+" "+this.fontWeight+" "+e+" "+t.join(",")},r}();function Mu(r){return typeof r=="number"?yh(r):(typeof r=="string"&&r.indexOf("0x")===0&&(r=r.replace("0x","#")),r)}function wo(r){if(Array.isArray(r)){for(var e=0;e<r.length;++e)r[e]=Mu(r[e]);return r}else return Mu(r)}function Ym(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 Eo(r,e,t){for(var i in t)Array.isArray(e[i])?r[i]=e[i].slice():r[i]=e[i]}var kn={willReadFrequently:!0},le=function(){function r(e,t,i,n,s,o,a,h,u){this.text=e,this.style=t,this.width=i,this.height=n,this.lines=s,this.lineWidths=o,this.lineHeight=a,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(),o=r.measureFont(s);o.fontSize===0&&(o.fontSize=t.fontSize,o.ascent=t.fontSize);var a=n.getContext("2d",kn);a.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=a.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||o.fontSize+t.strokeThickness,_=Math.max(p,o.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,o)},r.wordWrap=function(e,t,i){i===void 0&&(i=r._canvas);for(var n=i.getContext("2d",kn),s=0,o="",a="",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 g=p[_];if(r.isNewline(g)){if(!c){a+=r.addLine(o),d=!f,o="",s=0;continue}g=" "}if(f){var y=r.isBreakingSpace(g),m=r.isBreakingSpace(o[o.length-1]);if(y&&m)continue}var b=r.getFromCache(g,u,h,n);if(b>v)if(o!==""&&(a+=r.addLine(o),o="",s=0),r.canBreakWords(g,t.breakWords))for(var x=r.wordWrapSplit(g),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,g,T,t.breakWords))w+=E;else break;S++}T+=w.length-1;var O=r.getFromCache(w,u,h,n);O+s>v&&(a+=r.addLine(o),d=!1,o="",s=0),o+=w,s+=O}else{o.length>0&&(a+=r.addLine(o),o="",s=0);var D=_===p.length-1;a+=r.addLine(g,!D),d=!1,o="",s=0}else b+s>v&&(d=!1,a+=r.addLine(o),o="",s=0),(o.length>0||!r.isBreakingSpace(g)||d)&&(o+=g,s+=b)}return a+=r.addLine(o,!1),a},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 o=e.length*t;s=n.measureText(e).width+o,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],o=e[n+1];if(r.isBreakingSpace(s,o)||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,o=Math.ceil(n.measureText(s).width),a=Math.ceil(n.measureText(r.BASELINE_SYMBOL).width),h=Math.ceil(r.HEIGHT_MULTIPLIER*a);a=a*r.BASELINE_MULTIPLIER|0,i.width=o,i.height=h,n.fillStyle="#f00",n.fillRect(0,0,o,h),n.font=e,n.textBaseline="alphabetic",n.fillStyle="#000",n.fillText(s,0,a);var u=n.getImageData(0,0,o,h).data,l=u.length,f=o*4,c=0,d=0,v=!1;for(c=0;c<a;++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=a-c,d=l-f,v=!1,c=h;c>a;--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-a,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",kn);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",kn)),r.__context},enumerable:!1,configurable:!0}),r}();le._fonts={},le.METRICS_STRING="|ÉqÅ",le.BASELINE_SYMBOL="M",le.BASELINE_MULTIPLIER=1.4,le.HEIGHT_MULTIPLIER=2,le._newlines=[10,13],le._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];var Vm={texture:!0,children:!1,baseTexture:!0},Nu=function(r){Wm(e,r);function e(t,i,n){var s=this,o=!1;n||(n=L.ADAPTER.createCanvas(),o=!0),n.width=3,n.height=3;var a=Y.from(n);return a.orig=new J,a.trim=new J,s=r.call(this,a)||this,s._ownCanvas=o,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=le.measureText(this._text||" ",this._style,this._style.wordWrap,this.canvas),o=s.width,a=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,o)+i.padding*2)*this._resolution),this.canvas.height=Math.ceil(Math.ceil(Math.max(1,a)+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 g=i.dropShadow&&_===0,y=g?Math.ceil(Math.max(1,a)+i.padding*2):0,m=y*this._resolution;if(g){n.fillStyle="black",n.strokeStyle="black";var b=i.dropShadowColor,x=Zi(typeof b=="number"?b:xh(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+m}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-y,!0),i.fill&&this.drawLetterSpacing(h[E],d+i.padding,v+i.padding-y)}this.updateTexture()}},e.prototype.drawLetterSpacing=function(t,i,n,s){s===void 0&&(s=!1);var o=this._style,a=o.letterSpacing,h=e.experimentalLetterSpacing&&("letterSpacing"in CanvasRenderingContext2D.prototype||"textLetterSpacing"in CanvasRenderingContext2D.prototype);if(a===0||h){h&&(this.context.letterSpacing=a,this.context.textLetterSpacing=a),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+a,f=c}},e.prototype.updateTexture=function(){var t=this.canvas;if(this._style.trim){var i=jv(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,o=s.trim?0:s.padding,a=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=-o,n.trim.y=-o,n.orig.width=n._frame.width-o*2,n.orig.height=n._frame.height-o*2,this._onTextureUpdate(),a.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 o,a=t.dropShadow?t.dropShadowDistance:0,h=t.padding||0,u=this.canvas.width/this._resolution-a-h*2,l=this.canvas.height/this._resolution-a-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===Lr.LINEAR_VERTICAL){o=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,g=n.lineHeight*v,y=g;v>0&&_>g&&(y=(g+_)/2);var m=g+p,b=n.lineHeight*(v+1),x=m;v+1<i.length&&b<m&&(x=(m+b)/2);for(var T=(x-y)/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,y/l+S*T));E=Number(E.toFixed(5)),o.addColorStop(E,f[w])}}}else{o=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,o.addColorStop(D,f[v]),O++}}return o},e.prototype.destroy=function(t){typeof t=="boolean"&&(t={children:t}),t=Object.assign({},Vm,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=Ki(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=Ki(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 oi?this._style=t:this._style=new oi(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}(ct);L.UPLOADS_PER_FRAME=4;var So=function(r,e){return So=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])},So(r,e)};function jm(r,e){So(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Zm=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 qm(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 Y){var n=r._textures[i].baseTexture;e.indexOf(n)===-1&&(e.push(n),t=!0)}}return t}function Km(r,e){if(r.baseTexture instanceof rt){var t=r.baseTexture;return e.indexOf(t)===-1&&e.push(t),!0}return!1}function $m(r,e){if(r._texture&&r._texture instanceof Y){var t=r._texture.baseTexture;return e.indexOf(t)===-1&&e.push(t),!0}return!1}function Jm(r,e){return e instanceof Nu?(e.updateText(!0),!0):!1}function Qm(r,e){if(e instanceof oi){var t=e.toFontString();return le.measureFont(t),!0}return!1}function ty(r,e){if(r instanceof Nu){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 ey(r,e){return r instanceof oi?(e.indexOf(r)===-1&&e.push(r),!0):!1}var iy=function(){function r(e){var t=this;this.limiter=new Zm(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(ty),this.registerFindHook(ey),this.registerFindHook(qm),this.registerFindHook(Km),this.registerFindHook($m),this.registerUploadHook(Jm),this.registerUploadHook(Qm)}return r.prototype.upload=function(e,t){var i=this;return typeof e=="function"&&(t=e,e=null),t&&Te("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,Ut.system.addOnce(i.tick,i,te.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)Ut.system.addOnce(this.tick,this,te.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 ht)for(var t=e.children.length-1;t>=0;t--)this.add(e.children[t]);return this},r.prototype.destroy=function(){this.ticking&&Ut.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 Du(r,e){return e instanceof rt?(e._glTextures[r.CONTEXT_UID]||r.texture.bind(e),!0):!1}function ry(r,e){if(!(e instanceof Le))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&&Du(r,s.baseTexture)}return t.batchable||r.geometry.bind(t,e._resolveDirectShader(r)),!0}function ny(r,e){return r instanceof Le?(e.push(r),!0):!1}var sy=function(r){jm(e,r);function e(t){var i=r.call(this,t)||this;return i.uploadHookHelper=i.renderer,i.registerFindHook(ny),i.registerUploadHook(Du),i.registerUploadHook(ry),i}return e.extension={name:"prepare",type:at.RendererPlugin},e}(iy);var oy=function(){function r(e,t,i){i===void 0&&(i=null),this.linkedSheets=[],this._texture=e instanceof Y?e:null,this.baseTexture=e instanceof rt?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=mn(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&&Te("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],o=s.frame;if(o){var a=null,h=null,u=s.trimmed!==!1&&s.sourceSize?s.sourceSize:s.frame,l=new J(0,0,Math.floor(u.w)/this.resolution,Math.floor(u.h)/this.resolution);s.rotated?a=new J(Math.floor(o.x)/this.resolution,Math.floor(o.y)/this.resolution,Math.floor(o.h)/this.resolution,Math.floor(o.w)/this.resolution):a=new J(Math.floor(o.x)/this.resolution,Math.floor(o.y)/this.resolution,Math.floor(o.w)/this.resolution,Math.floor(o.h)/this.resolution),s.trimmed!==!1&&s.spriteSourceSize&&(h=new J(Math.floor(s.spriteSourceSize.x)/this.resolution,Math.floor(s.spriteSourceSize.y)/this.resolution,Math.floor(o.w)/this.resolution,Math.floor(o.h)/this.resolution)),this.textures[n]=new Y(this.baseTexture,a,l,h,s.rotated?2:0,s.anchor),Y.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}(),ay=function(){function r(){}return r.use=function(e,t){var i,n,s=this,o=e.name+"_image";if(!e.data||e.type!==Et.TYPE.JSON||!e.data.frames||s.resources[o]){t();return}var a=(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(a))for(var h=function(v){if(typeof v!="string")return"continue";var p=v.replace(".json",""),_=ji.resolve(e.url.replace(s.baseUrl,""),v);if(s.resources[p]||Object.values(s.resources).some(function(y){return ji.format(ji.parse(y.url))===_}))return"continue";var g={crossOrigin:e.crossOrigin,loadType:Et.LOAD_TYPE.XHR,xhrType:Et.XHR_RESPONSE_TYPE.JSON,parentResource:e,metadata:e.metadata};s.add(p,_,g)},u=0,l=a;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(o,d,c,function(p){if(p.error){t(p.error);return}var _=new oy(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:ji.resolve(e.url.replace(t,""),e.data.meta.image)},r.extension=at.Loader,r}();var Po=function(r,e){return Po=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])},Po(r,e)};function Fu(r,e){Po(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Gr=new j;(function(r){Fu(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 Ua,s._width=i,s._height=n,s.uvMatrix=s.texture.uvMatrix||new $s(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 J),t=this._localBoundsRect),this._bounds.getRectangle(t)):r.prototype.getLocalBounds.call(this,t)},e.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,Gr);var i=this._width,n=this._height,s=-i*this.anchor._x;if(Gr.x>=s&&Gr.x<s+i){var o=-n*this.anchor._y;if(Gr.y>=o&&Gr.y<o+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 Y?t:Y.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})(ct);var hy=`#version 100
530
530
  #define SHADER_NAME Tiling-Sprite-Simple-100
531
531
 
532
532
  precision lowp float;
@@ -640,7 +640,7 @@ void main(void)
640
640
 
641
641
  fragmentColor = texSample * uColor;
642
642
  }
643
- `,Xn=new Dt,cy=function(r){Fu(e,r);function e(t){var i=r.call(this,t)||this;return t.runners.contextChange.add(i),i.quad=new kh,i.state=Ci.for2d(),i}return e.prototype.contextChange=function(){var t=this.renderer,i={globals:t.globalUniforms};this.simpleShader=ii.from(Bu,hy,i),this.shader=t.context.webGLVersion>1?ii.from(ly,fy,i):ii.from(Bu,uy,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 o=t.uvRespectAnchor?t.anchor.x:0,a=t.uvRespectAnchor?t.anchor.y:0;s=n.uvs,s[0]=s[6]=-o,s[1]=s[3]=-a,s[2]=s[4]=1-o,s[5]=s[7]=1-a,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!==De.CLAMP:u.wrapMode===De.CLAMP&&(u.wrapMode=De.REPEAT));var v=d?this.simpleShader:this.shader,p=h.width,_=h.height,g=t._width,y=t._height;Xn.set(f.a*p/g,f.b*p/y,f.c*_/g,f.d*_/y,f.tx/g,f.ty/y),Xn.invert(),d?Xn.prepend(c.mapCoord):(v.uniforms.uMapCoord=c.mapCoord.toArray(!0),v.uniforms.uClampFrame=c.uClampFrame,v.uniforms.uClampOffset=c.uClampOffset),v.uniforms.uTransform=Xn.toArray(!0),v.uniforms.uColor=wh(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=Th(t.blendMode,l),i.state.set(this.state),i.geometry.draw(this.renderer.gl.TRIANGLES,6,0)},e.extension={name:"tilingSprite",type:at.RendererPlugin},e}(Tn);var Ro=function(r,e){return Ro=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])},Ro(r,e)};function Co(r,e){Ro(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var dy=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}(),Oo=new j,Lu=new nn,Ur=function(r){Co(e,r);function e(t,i,n,s){s===void 0&&(s=ge.TRIANGLES);var o=r.call(this)||this;return o.geometry=t,o.shader=i,o.state=n||Ci.for2d(),o.drawMode=s,o.start=0,o.size=0,o.uvs=null,o.indices=null,o.vertexData=new Float32Array(1),o.vertexDirty=-1,o._transformID=-1,o._roundPixels=L.ROUND_PIXELS,o.batchUvs=null,o}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===ge.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 o=this.transform.worldTransform,a=o.a,h=o.b,u=o.c,l=o.d,f=o.tx,c=o.ty,d=this.vertexData,v=0;v<d.length/2;v++){var p=n[v*2],_=n[v*2+1];d[v*2]=a*p+u*_+f,d[v*2+1]=h*p+l*_+c}if(this._roundPixels)for(var g=L.RESOLUTION,v=0;v<d.length;++v)d[v]=Math.round((d[v]*g|0)/g);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 dy(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,Oo);for(var i=this.geometry.getBuffer("aVertexPosition").data,n=Lu.points,s=this.geometry.getIndex().data,o=s.length,a=this.drawMode===4?3:1,h=0;h+2<o;h+=a){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],Lu.contains(Oo.x,Oo.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}(ht),py=`varying vec2 vTextureCoord;
643
+ `,Xn=new Nt,cy=function(r){Fu(e,r);function e(t){var i=r.call(this,t)||this;return t.runners.contextChange.add(i),i.quad=new kh,i.state=Ci.for2d(),i}return e.prototype.contextChange=function(){var t=this.renderer,i={globals:t.globalUniforms};this.simpleShader=ii.from(Bu,hy,i),this.shader=t.context.webGLVersion>1?ii.from(ly,fy,i):ii.from(Bu,uy,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 o=t.uvRespectAnchor?t.anchor.x:0,a=t.uvRespectAnchor?t.anchor.y:0;s=n.uvs,s[0]=s[6]=-o,s[1]=s[3]=-a,s[2]=s[4]=1-o,s[5]=s[7]=1-a,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!==Ne.CLAMP:u.wrapMode===Ne.CLAMP&&(u.wrapMode=Ne.REPEAT));var v=d?this.simpleShader:this.shader,p=h.width,_=h.height,g=t._width,y=t._height;Xn.set(f.a*p/g,f.b*p/y,f.c*_/g,f.d*_/y,f.tx/g,f.ty/y),Xn.invert(),d?Xn.prepend(c.mapCoord):(v.uniforms.uMapCoord=c.mapCoord.toArray(!0),v.uniforms.uClampFrame=c.uClampFrame,v.uniforms.uClampOffset=c.uClampOffset),v.uniforms.uTransform=Xn.toArray(!0),v.uniforms.uColor=wh(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=Th(t.blendMode,l),i.state.set(this.state),i.geometry.draw(this.renderer.gl.TRIANGLES,6,0)},e.extension={name:"tilingSprite",type:at.RendererPlugin},e}(Tn);var Ro=function(r,e){return Ro=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])},Ro(r,e)};function Co(r,e){Ro(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var dy=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}(),Oo=new j,Lu=new nn,Ur=function(r){Co(e,r);function e(t,i,n,s){s===void 0&&(s=ge.TRIANGLES);var o=r.call(this)||this;return o.geometry=t,o.shader=i,o.state=n||Ci.for2d(),o.drawMode=s,o.start=0,o.size=0,o.uvs=null,o.indices=null,o.vertexData=new Float32Array(1),o.vertexDirty=-1,o._transformID=-1,o._roundPixels=L.ROUND_PIXELS,o.batchUvs=null,o}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===ge.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 o=this.transform.worldTransform,a=o.a,h=o.b,u=o.c,l=o.d,f=o.tx,c=o.ty,d=this.vertexData,v=0;v<d.length/2;v++){var p=n[v*2],_=n[v*2+1];d[v*2]=a*p+u*_+f,d[v*2+1]=h*p+l*_+c}if(this._roundPixels)for(var g=L.RESOLUTION,v=0;v<d.length;++v)d[v]=Math.round((d[v]*g|0)/g);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 dy(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,Oo);for(var i=this.geometry.getBuffer("aVertexPosition").data,n=Lu.points,s=this.geometry.getIndex().data,o=s.length,a=this.drawMode===4?3:1,h=0;h+2<o;h+=a){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],Lu.contains(Oo.x,Oo.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}(ht),py=`varying vec2 vTextureCoord;
644
644
  uniform vec4 uColor;
645
645
 
646
646
  uniform sampler2D uSampler;
@@ -664,7 +664,7 @@ void main(void)
664
664
 
665
665
  vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;
666
666
  }
667
- `,kr=function(r){Co(e,r);function e(t,i){var n=this,s={uSampler:t,alpha:1,uTextureMatrix:Dt.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||Ir.from(vy,py),s)||this,n._colorDirty=!1,n.uvMatrix=new $s(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;wh(this._tint,this._alpha,this.uniforms.uColor,t.alphaMode)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)},e}(ii),Hn=function(r){Co(e,r);function e(t,i,n){var s=r.call(this)||this,o=new Ft(t),a=new Ft(i,!0),h=new Ft(n,!0,!0);return s.addAttribute("aVertexPosition",o,2,!1,k.FLOAT).addAttribute("aTextureCoord",a,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}(Cr);var Ao=function(r,e){return Ao=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])},Ao(r,e)};function _y(r,e){Ao(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Wn=function(){function r(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[],this.distanceField=[]}return r}(),gy=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],o=t[n].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),a={};for(var h in o){var u=o[h].split("="),l=u[0],f=u[1].replace(/"/gm,""),c=parseFloat(f),d=isNaN(c)?f:c;a[l]=d}i[s].push(a)}var v=new Wn;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}(),Io=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 Wn,i=e.getElementsByTagName("info"),n=e.getElementsByTagName("common"),s=e.getElementsByTagName("page"),o=e.getElementsByTagName("char"),a=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<o.length;u++){var l=o[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<a.length;u++)t.kerning.push({first:parseInt(a[u].getAttribute("first"),10),second:parseInt(a[u].getAttribute("second"),10),amount:parseInt(a[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}(),my=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 Io.test(t)}return!1},r.parse=function(e){var t=new globalThis.DOMParser().parseFromString(e,"text/xml");return Io.parse(t)},r}(),Mo=[gy,Io,my];function Gu(r){for(var e=0;e<Mo.length;e++)if(Mo[e].test(r))return Mo[e];return null}function yy(r,e,t,i,n,s){var o=t.fill;if(Array.isArray(o)){if(o.length===1)return o[0]}else return o;var a,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=o.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(o[0]),d.unshift(0),c.push(o[o.length-1]),d.push(1),t.fillGradientType===Lr.LINEAR_VERTICAL){a=e.createLinearGradient(l/2,u,l/2,f+u);for(var _=0,g=s.fontProperties.fontSize+t.strokeThickness,y=g/f,p=0;p<n.length;p++)for(var m=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=m/f+x*y,w=Math.max(_,T);w=Math.min(w,1),a.addColorStop(w,c[b]),_=w}}else{a=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,a.addColorStop(P,c[p]),E++}}return a}function xy(r,e,t,i,n,s,o){var a=t.text,h=t.fontProperties;e.translate(i,n),e.scale(s,s);var u=o.strokeThickness/2,l=-(o.strokeThickness/2);if(e.font=o.toFontString(),e.lineWidth=o.strokeThickness,e.textBaseline=o.textBaseline,e.lineJoin=o.lineJoin,e.miterLimit=o.miterLimit,e.fillStyle=yy(r,e,o,s,[a],t),e.strokeStyle=o.stroke,o.dropShadow){var f=o.dropShadowColor,c=Zi(typeof f=="number"?f:xh(f)),d=o.dropShadowBlur*s,v=o.dropShadowDistance*s;e.shadowColor="rgba("+c[0]*255+","+c[1]*255+","+c[2]*255+","+o.dropShadowAlpha+")",e.shadowBlur=d,e.shadowOffsetX=Math.cos(o.dropShadowAngle)*v,e.shadowOffsetY=Math.sin(o.dropShadowAngle)*v}else e.shadowColor="black",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0;o.stroke&&o.strokeThickness&&e.strokeText(a,u,l+t.lineHeight-h.descent),o.fill&&e.fillText(a,u,l+t.lineHeight-h.descent),e.setTransform(1,0,0,1,0,0),e.fillStyle="rgba(0, 0, 0, 0)"}function Uu(r){return Array.from?Array.from(r):r.split("")}function by(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),o=n[1].charCodeAt(0);if(o<s)throw new Error("[BitmapFont]: Invalid character range.");for(var a=s,h=o;a<=h;a++)e.push(String.fromCharCode(a))}else e.push.apply(e,Uu(n))}if(e.length===0)throw new Error("[BitmapFont]: Empty set when resolving characters.");return e}function zn(r){return r.codePointAt?r.codePointAt(0):r.charCodeAt(0)}var Ot=function(){function r(e,t,i){var n,s,o=e.info[0],a=e.common[0],h=e.page[0],u=e.distanceField[0],l=mn(h.file),f={};this._ownsTextures=i,this.font=o.face,this.size=o.size,this.lineHeight=a.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=ye.NO_PREMULTIPLIED_ALPHA,f[v].baseTexture.mipmap=me.OFF)}for(var c=0;c<e.char.length;c++){var _=e.char[c],v=_.id,g=_.page,y=e.char[c],m=y.x,b=y.y,x=y.width,T=y.height,w=y.xoffset,S=y.yoffset,E=y.xadvance;m/=l,b/=l,x/=l,T/=l,w/=l,S/=l,E/=l;var P=new J(m+f[g].frame.x/l,b+f[g].frame.y/l,x,T);this.chars[v]={xOffset:w,yOffset:S,xAdvance:E,kerning:{},texture:new Y(f[g].baseTexture,P),page:g}}for(var c=0;c<e.kerning.length;c++){var O=e.kerning[c],N=O.first,D=O.second,U=O.amount;N/=l,D/=l,U/=l,this.chars[D]&&(this.chars[D].kerning[N]=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 Wn)n=e;else{var s=Gu(e);if(!s)throw new Error("Unrecognized data format for font.");n=s.parse(e)}t instanceof Y&&(t=[t]);var o=new r(n,t,i);return r.available[o.font]=o,o},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,o=n.padding,a=n.resolution,h=n.textureWidth,u=n.textureHeight,l=by(s),f=t instanceof oi?t:new oi(t),c=h,d=new Wn;d.info[0]={face:f.fontFamily,size:f.fontSize},d.common[0]={lineHeight:f.fontSize};for(var v=0,p=0,_,g,y,m=0,b=[],x=0;x<l.length;x++){_||(_=L.ADAPTER.createCanvas(),_.width=h,_.height=u,g=_.getContext("2d"),y=new rt(_,{resolution:a}),b.push(new Y(y)),d.page.push({id:b.length-1,file:""}));var T=l[x],w=le.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*a){if(p===0)throw new Error("[BitmapFont] textureHeight "+u+"px is too small "+("(fontFamily: '"+f.fontFamily+"', fontSize: "+f.fontSize+"px, char: '"+T+"')"));--x,_=null,g=null,y=null,p=0,v=0,m=0;continue}if(m=Math.max(E+w.fontProperties.descent,m),P*a+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+=m*a,p=Math.ceil(p),v=0,m=0;continue}xy(_,g,w,v,p,a,f);var O=zn(w.text);d.char.push({id:O,page:b.length-1,x:v/a,y:p/a,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*o)*a,v=Math.ceil(v)}for(var x=0,N=l.length;x<N;x++)for(var D=l[x],U=0;U<N;U++){var I=l[U],A=g.measureText(D).width,B=g.measureText(I).width,K=g.measureText(D+I).width,z=K-(A+B);z&&d.kerning.push({first:zn(D),second:zn(I),amount:z})}var M=new r(d,b,!0);return r.available[e]!==void 0&&r.uninstall(e),r.available[e]=M,M},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}(),Ty=`// Pixi texture info\r
667
+ `,kr=function(r){Co(e,r);function e(t,i){var n=this,s={uSampler:t,alpha:1,uTextureMatrix:Nt.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||Ir.from(vy,py),s)||this,n._colorDirty=!1,n.uvMatrix=new $s(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;wh(this._tint,this._alpha,this.uniforms.uColor,t.alphaMode)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)},e}(ii),Hn=function(r){Co(e,r);function e(t,i,n){var s=r.call(this)||this,o=new Ft(t),a=new Ft(i,!0),h=new Ft(n,!0,!0);return s.addAttribute("aVertexPosition",o,2,!1,k.FLOAT).addAttribute("aTextureCoord",a,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}(Cr);var Ao=function(r,e){return Ao=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])},Ao(r,e)};function _y(r,e){Ao(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Wn=function(){function r(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[],this.distanceField=[]}return r}(),gy=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],o=t[n].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),a={};for(var h in o){var u=o[h].split("="),l=u[0],f=u[1].replace(/"/gm,""),c=parseFloat(f),d=isNaN(c)?f:c;a[l]=d}i[s].push(a)}var v=new Wn;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}(),Io=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 Wn,i=e.getElementsByTagName("info"),n=e.getElementsByTagName("common"),s=e.getElementsByTagName("page"),o=e.getElementsByTagName("char"),a=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<o.length;u++){var l=o[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<a.length;u++)t.kerning.push({first:parseInt(a[u].getAttribute("first"),10),second:parseInt(a[u].getAttribute("second"),10),amount:parseInt(a[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}(),my=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 Io.test(t)}return!1},r.parse=function(e){var t=new globalThis.DOMParser().parseFromString(e,"text/xml");return Io.parse(t)},r}(),Mo=[gy,Io,my];function Gu(r){for(var e=0;e<Mo.length;e++)if(Mo[e].test(r))return Mo[e];return null}function yy(r,e,t,i,n,s){var o=t.fill;if(Array.isArray(o)){if(o.length===1)return o[0]}else return o;var a,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=o.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(o[0]),d.unshift(0),c.push(o[o.length-1]),d.push(1),t.fillGradientType===Lr.LINEAR_VERTICAL){a=e.createLinearGradient(l/2,u,l/2,f+u);for(var _=0,g=s.fontProperties.fontSize+t.strokeThickness,y=g/f,p=0;p<n.length;p++)for(var m=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=m/f+x*y,w=Math.max(_,T);w=Math.min(w,1),a.addColorStop(w,c[b]),_=w}}else{a=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,a.addColorStop(P,c[p]),E++}}return a}function xy(r,e,t,i,n,s,o){var a=t.text,h=t.fontProperties;e.translate(i,n),e.scale(s,s);var u=o.strokeThickness/2,l=-(o.strokeThickness/2);if(e.font=o.toFontString(),e.lineWidth=o.strokeThickness,e.textBaseline=o.textBaseline,e.lineJoin=o.lineJoin,e.miterLimit=o.miterLimit,e.fillStyle=yy(r,e,o,s,[a],t),e.strokeStyle=o.stroke,o.dropShadow){var f=o.dropShadowColor,c=Zi(typeof f=="number"?f:xh(f)),d=o.dropShadowBlur*s,v=o.dropShadowDistance*s;e.shadowColor="rgba("+c[0]*255+","+c[1]*255+","+c[2]*255+","+o.dropShadowAlpha+")",e.shadowBlur=d,e.shadowOffsetX=Math.cos(o.dropShadowAngle)*v,e.shadowOffsetY=Math.sin(o.dropShadowAngle)*v}else e.shadowColor="black",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0;o.stroke&&o.strokeThickness&&e.strokeText(a,u,l+t.lineHeight-h.descent),o.fill&&e.fillText(a,u,l+t.lineHeight-h.descent),e.setTransform(1,0,0,1,0,0),e.fillStyle="rgba(0, 0, 0, 0)"}function Uu(r){return Array.from?Array.from(r):r.split("")}function by(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),o=n[1].charCodeAt(0);if(o<s)throw new Error("[BitmapFont]: Invalid character range.");for(var a=s,h=o;a<=h;a++)e.push(String.fromCharCode(a))}else e.push.apply(e,Uu(n))}if(e.length===0)throw new Error("[BitmapFont]: Empty set when resolving characters.");return e}function zn(r){return r.codePointAt?r.codePointAt(0):r.charCodeAt(0)}var Ot=function(){function r(e,t,i){var n,s,o=e.info[0],a=e.common[0],h=e.page[0],u=e.distanceField[0],l=mn(h.file),f={};this._ownsTextures=i,this.font=o.face,this.size=o.size,this.lineHeight=a.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=ye.NO_PREMULTIPLIED_ALPHA,f[v].baseTexture.mipmap=me.OFF)}for(var c=0;c<e.char.length;c++){var _=e.char[c],v=_.id,g=_.page,y=e.char[c],m=y.x,b=y.y,x=y.width,T=y.height,w=y.xoffset,S=y.yoffset,E=y.xadvance;m/=l,b/=l,x/=l,T/=l,w/=l,S/=l,E/=l;var P=new J(m+f[g].frame.x/l,b+f[g].frame.y/l,x,T);this.chars[v]={xOffset:w,yOffset:S,xAdvance:E,kerning:{},texture:new Y(f[g].baseTexture,P),page:g}}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 Wn)n=e;else{var s=Gu(e);if(!s)throw new Error("Unrecognized data format for font.");n=s.parse(e)}t instanceof Y&&(t=[t]);var o=new r(n,t,i);return r.available[o.font]=o,o},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,o=n.padding,a=n.resolution,h=n.textureWidth,u=n.textureHeight,l=by(s),f=t instanceof oi?t:new oi(t),c=h,d=new Wn;d.info[0]={face:f.fontFamily,size:f.fontSize},d.common[0]={lineHeight:f.fontSize};for(var v=0,p=0,_,g,y,m=0,b=[],x=0;x<l.length;x++){_||(_=L.ADAPTER.createCanvas(),_.width=h,_.height=u,g=_.getContext("2d"),y=new rt(_,{resolution:a}),b.push(new Y(y)),d.page.push({id:b.length-1,file:""}));var T=l[x],w=le.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*a){if(p===0)throw new Error("[BitmapFont] textureHeight "+u+"px is too small "+("(fontFamily: '"+f.fontFamily+"', fontSize: "+f.fontSize+"px, char: '"+T+"')"));--x,_=null,g=null,y=null,p=0,v=0,m=0;continue}if(m=Math.max(E+w.fontProperties.descent,m),P*a+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+=m*a,p=Math.ceil(p),v=0,m=0;continue}xy(_,g,w,v,p,a,f);var O=zn(w.text);d.char.push({id:O,page:b.length-1,x:v/a,y:p/a,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*o)*a,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 I=l[U],A=g.measureText(N).width,B=g.measureText(I).width,K=g.measureText(N+I).width,z=K-(A+B);z&&d.kerning.push({first:zn(N),second:zn(I),amount:z})}var M=new r(d,b,!0);return r.available[e]!==void 0&&r.uninstall(e),r.available[e]=M,M},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}(),Ty=`// Pixi texture info\r
668
668
  varying vec2 vTextureCoord;\r
669
669
  uniform sampler2D uSampler;\r
670
670
  \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
- `,ku=[],Xu=[],Hu=[],Do=function(r){_y(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),o=s.align,a=s.tint,h=s.maxWidth,u=s.letterSpacing,l=s.fontName,f=s.fontSize;if(!Ot.available[l])throw new Error('Missing BitmapFont "'+l+'"');return n._activePagesMeshData=[],n._textWidth=0,n._textHeight=0,n._align=o,n._tint=a,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 Wi(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=Ot.available[this._fontName],n=this.fontSize,s=n/i.size,o=new j,a=[],h=[],u=[],l=this._text.replace(/(?:\r\n|\r)/g,`
717
+ `,ku=[],Xu=[],Hu=[],No=function(r){_y(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),o=s.align,a=s.tint,h=s.maxWidth,u=s.letterSpacing,l=s.fontName,f=s.fontSize;if(!Ot.available[l])throw new Error('Missing BitmapFont "'+l+'"');return n._activePagesMeshData=[],n._textWidth=0,n._textHeight=0,n._align=o,n._tint=a,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 Wi(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=Ot.available[this._fontName],n=this.fontSize,s=n/i.size,o=new j,a=[],h=[],u=[],l=this._text.replace(/(?:\r\n|\r)/g,`
718
718
  `)||" ",f=Uu(l),c=this._maxWidth*i.size/n,d=i.distanceFieldType==="none"?ku:Xu,v=null,p=0,_=0,g=0,y=-1,m=0,b=0,x=0,T=0,w=0;w<f.length;w++){var S=f[w],E=zn(S);if(/(?:\s)/.test(S)&&(y=w,m=p,T++),S==="\r"||S===`
719
- `){h.push(p),u.push(-1),_=Math.max(_,p),++g,++b,o.x=0,o.y+=i.lineHeight,v=null,T=0;continue}var P=i.chars[E];if(P){v&&P.kerning[v]&&(o.x+=P.kerning[v]);var O=Hu.pop()||{texture:Y.EMPTY,line:0,charCode:0,prevSpaces:0,position:new j};O.texture=P.texture,O.line=g,O.charCode=E,O.position.x=o.x+P.xOffset+this._letterSpacing/2,O.position.y=o.y+P.yOffset,O.prevSpaces=T,a.push(O),p=O.position.x+Math.max(P.xAdvance-P.xOffset,P.texture.orig.width),o.x+=P.xAdvance+this._letterSpacing,x=Math.max(x,P.yOffset+P.texture.height),v=E,y!==-1&&c>0&&o.x>c&&(++b,qi(a,1+y-b,1+w-y),w=y,y=-1,h.push(m),u.push(a.length>0?a[a.length-1].prevSpaces:0),_=Math.max(_,m),g++,o.x=0,o.y+=i.lineHeight,v=null,T=0)}}var N=f[f.length-1];N!=="\r"&&N!==`
720
- `&&(/(?:\s)/.test(N)&&(p=m),h.push(p),_=Math.max(_,p),u.push(-1));for(var D=[],w=0;w<=g;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]),D.push(U)}var I=a.length,A={},B=[],K=this._activePagesMeshData;d.push.apply(d,K);for(var w=0;w<I;w++){var z=a[w].texture,M=z.baseTexture.uid;if(!A[M]){var C=d.pop();if(!C){var G=new Hn,tt=void 0,V=void 0;i.distanceFieldType==="none"?(tt=new kr(Y.EMPTY),V=X.NORMAL):(tt=new kr(Y.EMPTY,{program:Ir.from(wy,Ty),uniforms:{uFWidth:0}}),V=X.NORMAL_NPM);var nt=new Ur(G,tt);nt.blendMode=V,C={index:0,indexCount:0,vertexCount:0,uvsCount:0,total:0,mesh:nt,vertices:null,uvs:null,indices:null}}C.index=0,C.indexCount=0,C.vertexCount=0,C.uvsCount=0,C.total=0;var dt=this._textureCache;dt[M]=dt[M]||new Y(z.baseTexture),C.mesh.texture=dt[M],C.mesh.tint=this._tint,B.push(C),A[M]=C}A[M].total++}for(var w=0;w<K.length;w++)B.indexOf(K[w])===-1&&this.removeChild(K[w].mesh);for(var w=0;w<B.length;w++)B[w].mesh.parent!==this&&this.addChild(B[w].mesh);this._activePagesMeshData=B;for(var w in A){var C=A[w],pt=C.total;if(!(((t=C.indices)===null||t===void 0?void 0:t.length)>6*pt)||C.vertices.length<Ur.BATCHABLE_SIZE*2)C.vertices=new Float32Array(4*2*pt),C.uvs=new Float32Array(4*2*pt),C.indices=new Uint16Array(6*pt);else for(var Pt=C.total,Lt=C.vertices,vt=Pt*4*2;vt<Lt.length;vt++)Lt[vt]=0;C.mesh.size=6*pt}for(var w=0;w<I;w++){var S=a[w],st=S.position.x+D[S.line]*(this._align==="justify"?S.prevSpaces:1);this._roundPixels&&(st=Math.round(st));var H=st*s,$=S.position.y*s,z=S.texture,Z=A[z.baseTexture.uid],xt=z.frame,Rt=z._uvs,Q=Z.index++;Z.indices[Q*6+0]=0+Q*4,Z.indices[Q*6+1]=1+Q*4,Z.indices[Q*6+2]=2+Q*4,Z.indices[Q*6+3]=0+Q*4,Z.indices[Q*6+4]=2+Q*4,Z.indices[Q*6+5]=3+Q*4,Z.vertices[Q*8+0]=H,Z.vertices[Q*8+1]=$,Z.vertices[Q*8+2]=H+xt.width*s,Z.vertices[Q*8+3]=$,Z.vertices[Q*8+4]=H+xt.width*s,Z.vertices[Q*8+5]=$+xt.height*s,Z.vertices[Q*8+6]=H,Z.vertices[Q*8+7]=$+xt.height*s,Z.uvs[Q*8+0]=Rt.x0,Z.uvs[Q*8+1]=Rt.y0,Z.uvs[Q*8+2]=Rt.x1,Z.uvs[Q*8+3]=Rt.y1,Z.uvs[Q*8+4]=Rt.x2,Z.uvs[Q*8+5]=Rt.y2,Z.uvs[Q*8+6]=Rt.x3,Z.uvs[Q*8+7]=Rt.y3}this._textWidth=_*s,this._textHeight=(o.y+i.lineHeight)*s;for(var w in A){var C=A[w];if(this.anchor.x!==0||this.anchor.y!==0)for(var Wt=0,He=this._textWidth*this.anchor.x,_r=this._textHeight*this.anchor.y,vs=0;vs<C.total;vs++)C.vertices[Wt++]-=He,C.vertices[Wt++]-=_r,C.vertices[Wt++]-=He,C.vertices[Wt++]-=_r,C.vertices[Wt++]-=He,C.vertices[Wt++]-=_r,C.vertices[Wt++]-=He,C.vertices[Wt++]-=_r;this._maxLineHeight=x*s;var Df=C.mesh.geometry.getBuffer("aVertexPosition"),Nf=C.mesh.geometry.getBuffer("aTextureCoord"),Ff=C.mesh.geometry.getIndex();Df.data=C.vertices,Nf.data=C.uvs,Ff.data=C.indices,Df.update(),Nf.update(),Ff.update()}for(var w=0;w<a.length;w++)Hu.push(a[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=Ot.available[this._fontName],n=i.distanceFieldRange,s=i.distanceFieldType,o=i.size;if(s!=="none")for(var a=this.worldTransform,h=a.a,u=a.b,l=a.c,f=a.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/o,_=0,g=this._activePagesMeshData;_<g.length;_++){var y=g[_];y.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=Ot.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(!Ot.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:Ot.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=Ot.available[this._fontName],s=n.distanceFieldType==="none"?ku:Xu;s.push.apply(s,this._activePagesMeshData);for(var o=0,a=this._activePagesMeshData;o<a.length;o++){var h=a[o];this.removeChild(h.mesh)}this._activePagesMeshData=[],s.filter(function(f){return i[f.mesh.texture.baseTexture.uid]}).forEach(function(f){f.mesh.texture=Y.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}(ht),Ey=function(){function r(){}return r.add=function(){Et.setExtensionXhrType("fnt",Et.XHR_RESPONSE_TYPE.TEXT)},r.use=function(e,t){var i=Gu(e.data);if(!i){t();return}for(var n=r.getBaseUrl(this,e),s=i.parse(e.data),o={},a=function(p){o[p.metadata.pageFile]=p.texture,Object.keys(o).length===s.page.length&&(e.bitmapFont=Ot.install(s,o,!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?a(d):d.onAfterMiddleware.add(a),f=!0;break}}if(!f){var v={crossOrigin:e.crossOrigin,loadType:Et.LOAD_TYPE.IMAGE,metadata:Object.assign({pageFile:u},e.metadata.imageMetadata),parentResource:e};this.add(l,v,a)}}},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=at.Loader,r}();var No=function(r,e){return No=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])},No(r,e)};function Sy(r,e){No(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Py=`varying vec2 vTextureCoord;
719
+ `){h.push(p),u.push(-1),_=Math.max(_,p),++g,++b,o.x=0,o.y+=i.lineHeight,v=null,T=0;continue}var P=i.chars[E];if(P){v&&P.kerning[v]&&(o.x+=P.kerning[v]);var O=Hu.pop()||{texture:Y.EMPTY,line:0,charCode:0,prevSpaces:0,position:new j};O.texture=P.texture,O.line=g,O.charCode=E,O.position.x=o.x+P.xOffset+this._letterSpacing/2,O.position.y=o.y+P.yOffset,O.prevSpaces=T,a.push(O),p=O.position.x+Math.max(P.xAdvance-P.xOffset,P.texture.orig.width),o.x+=P.xAdvance+this._letterSpacing,x=Math.max(x,P.yOffset+P.texture.height),v=E,y!==-1&&c>0&&o.x>c&&(++b,qi(a,1+y-b,1+w-y),w=y,y=-1,h.push(m),u.push(a.length>0?a[a.length-1].prevSpaces:0),_=Math.max(_,m),g++,o.x=0,o.y+=i.lineHeight,v=null,T=0)}}var D=f[f.length-1];D!=="\r"&&D!==`
720
+ `&&(/(?:\s)/.test(D)&&(p=m),h.push(p),_=Math.max(_,p),u.push(-1));for(var N=[],w=0;w<=g;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 I=a.length,A={},B=[],K=this._activePagesMeshData;d.push.apply(d,K);for(var w=0;w<I;w++){var z=a[w].texture,M=z.baseTexture.uid;if(!A[M]){var C=d.pop();if(!C){var G=new Hn,tt=void 0,V=void 0;i.distanceFieldType==="none"?(tt=new kr(Y.EMPTY),V=X.NORMAL):(tt=new kr(Y.EMPTY,{program:Ir.from(wy,Ty),uniforms:{uFWidth:0}}),V=X.NORMAL_NPM);var nt=new Ur(G,tt);nt.blendMode=V,C={index:0,indexCount:0,vertexCount:0,uvsCount:0,total:0,mesh:nt,vertices:null,uvs:null,indices:null}}C.index=0,C.indexCount=0,C.vertexCount=0,C.uvsCount=0,C.total=0;var dt=this._textureCache;dt[M]=dt[M]||new Y(z.baseTexture),C.mesh.texture=dt[M],C.mesh.tint=this._tint,B.push(C),A[M]=C}A[M].total++}for(var w=0;w<K.length;w++)B.indexOf(K[w])===-1&&this.removeChild(K[w].mesh);for(var w=0;w<B.length;w++)B[w].mesh.parent!==this&&this.addChild(B[w].mesh);this._activePagesMeshData=B;for(var w in A){var C=A[w],pt=C.total;if(!(((t=C.indices)===null||t===void 0?void 0:t.length)>6*pt)||C.vertices.length<Ur.BATCHABLE_SIZE*2)C.vertices=new Float32Array(4*2*pt),C.uvs=new Float32Array(4*2*pt),C.indices=new Uint16Array(6*pt);else for(var Pt=C.total,Lt=C.vertices,vt=Pt*4*2;vt<Lt.length;vt++)Lt[vt]=0;C.mesh.size=6*pt}for(var w=0;w<I;w++){var S=a[w],st=S.position.x+N[S.line]*(this._align==="justify"?S.prevSpaces:1);this._roundPixels&&(st=Math.round(st));var H=st*s,$=S.position.y*s,z=S.texture,Z=A[z.baseTexture.uid],xt=z.frame,Rt=z._uvs,Q=Z.index++;Z.indices[Q*6+0]=0+Q*4,Z.indices[Q*6+1]=1+Q*4,Z.indices[Q*6+2]=2+Q*4,Z.indices[Q*6+3]=0+Q*4,Z.indices[Q*6+4]=2+Q*4,Z.indices[Q*6+5]=3+Q*4,Z.vertices[Q*8+0]=H,Z.vertices[Q*8+1]=$,Z.vertices[Q*8+2]=H+xt.width*s,Z.vertices[Q*8+3]=$,Z.vertices[Q*8+4]=H+xt.width*s,Z.vertices[Q*8+5]=$+xt.height*s,Z.vertices[Q*8+6]=H,Z.vertices[Q*8+7]=$+xt.height*s,Z.uvs[Q*8+0]=Rt.x0,Z.uvs[Q*8+1]=Rt.y0,Z.uvs[Q*8+2]=Rt.x1,Z.uvs[Q*8+3]=Rt.y1,Z.uvs[Q*8+4]=Rt.x2,Z.uvs[Q*8+5]=Rt.y2,Z.uvs[Q*8+6]=Rt.x3,Z.uvs[Q*8+7]=Rt.y3}this._textWidth=_*s,this._textHeight=(o.y+i.lineHeight)*s;for(var w in A){var C=A[w];if(this.anchor.x!==0||this.anchor.y!==0)for(var Wt=0,He=this._textWidth*this.anchor.x,_r=this._textHeight*this.anchor.y,vs=0;vs<C.total;vs++)C.vertices[Wt++]-=He,C.vertices[Wt++]-=_r,C.vertices[Wt++]-=He,C.vertices[Wt++]-=_r,C.vertices[Wt++]-=He,C.vertices[Wt++]-=_r,C.vertices[Wt++]-=He,C.vertices[Wt++]-=_r;this._maxLineHeight=x*s;var Nf=C.mesh.geometry.getBuffer("aVertexPosition"),Df=C.mesh.geometry.getBuffer("aTextureCoord"),Ff=C.mesh.geometry.getIndex();Nf.data=C.vertices,Df.data=C.uvs,Ff.data=C.indices,Nf.update(),Df.update(),Ff.update()}for(var w=0;w<a.length;w++)Hu.push(a[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=Ot.available[this._fontName],n=i.distanceFieldRange,s=i.distanceFieldType,o=i.size;if(s!=="none")for(var a=this.worldTransform,h=a.a,u=a.b,l=a.c,f=a.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/o,_=0,g=this._activePagesMeshData;_<g.length;_++){var y=g[_];y.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=Ot.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(!Ot.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:Ot.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=Ot.available[this._fontName],s=n.distanceFieldType==="none"?ku:Xu;s.push.apply(s,this._activePagesMeshData);for(var o=0,a=this._activePagesMeshData;o<a.length;o++){var h=a[o];this.removeChild(h.mesh)}this._activePagesMeshData=[],s.filter(function(f){return i[f.mesh.texture.baseTexture.uid]}).forEach(function(f){f.mesh.texture=Y.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}(ht),Ey=function(){function r(){}return r.add=function(){Et.setExtensionXhrType("fnt",Et.XHR_RESPONSE_TYPE.TEXT)},r.use=function(e,t){var i=Gu(e.data);if(!i){t();return}for(var n=r.getBaseUrl(this,e),s=i.parse(e.data),o={},a=function(p){o[p.metadata.pageFile]=p.texture,Object.keys(o).length===s.page.length&&(e.bitmapFont=Ot.install(s,o,!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?a(d):d.onAfterMiddleware.add(a),f=!0;break}}if(!f){var v={crossOrigin:e.crossOrigin,loadType:Et.LOAD_TYPE.IMAGE,metadata:Object.assign({pageFile:u},e.metadata.imageMetadata),parentResource:e};this.add(l,v,a)}}},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=at.Loader,r}();var Do=function(r,e){return Do=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])},Do(r,e)};function Sy(r,e){Do(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Py=`varying vec2 vTextureCoord;
721
721
 
722
722
  uniform sampler2D uSampler;
723
723
  uniform float uAlpha;
@@ -759,7 +759,7 @@ void main(void)
759
759
  }`;function Cy(r,e){var t=Math.ceil(r/2),i=Ry,n="",s;e?s="vBlurTexCoords[%index%] = textureCoord + vec2(%sampleIndex% * strength, 0.0);":s="vBlurTexCoords[%index%] = textureCoord + vec2(0.0, %sampleIndex% * strength);";for(var o=0;o<r;o++){var a=s.replace("%index%",o.toString());a=a.replace("%sampleIndex%",o-(t-1)+".0"),n+=a,n+=`
760
760
  `}return i=i.replace("%blur%",n),i=i.replace("%size%",r.toString()),i}var Oy={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]},Ay=["varying vec2 vBlurTexCoords[%size%];","uniform sampler2D uSampler;","void main(void)","{"," gl_FragColor = vec4(0.0);"," %blur%","}"].join(`
761
761
  `);function Iy(r){for(var e=Oy[r],t=e.length,i=Ay,n="",s="gl_FragColor += texture2D(uSampler, vBlurTexCoords[%index%]) * %value%;",o,a=0;a<r;a++){var h=s.replace("%index%",a.toString());o=a,a>=t&&(o=r-a-1),h=h.replace("%value%",e[o].toString()),n+=h,n+=`
762
- `}return i=i.replace("%blur%",n),i=i.replace("%size%",r.toString()),i}var zu=function(r){Wu(e,r);function e(t,i,n,s,o){i===void 0&&(i=8),n===void 0&&(n=4),s===void 0&&(s=L.FILTER_RESOLUTION),o===void 0&&(o=5);var a=this,h=Cy(o,t),u=Iy(o);return a=r.call(this,h,u)||this,a.horizontal=t,a.resolution=s,a._quality=0,a.quality=n,a.blur=i,a}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 o=t.getFilterTexture(),a=t.renderer,h=i,u=o;this.state.blend=!1,t.applyFilter(this,h,u,xe.CLEAR);for(var l=1;l<this.passes-1;l++){t.bindAndClear(h,xe.BLIT),this.uniforms.uSampler=u;var f=u;u=h,h=f,a.shader.bind(this),a.geometry.draw(5)}this.state.blend=!0,t.applyFilter(this,u,n,s),t.returnFilterTexture(o)}},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}(ri);(function(r){Wu(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 o=r.call(this)||this;return o.blurXFilter=new zu(!0,t,i,n,s),o.blurYFilter=new zu(!1,t,i,n,s),o.resolution=n,o.quality=i,o.blur=t,o.repeatEdgePixels=!1,o}return e.prototype.apply=function(t,i,n,s){var o=Math.abs(this.blurXFilter.strength),a=Math.abs(this.blurYFilter.strength);if(o&&a){var h=t.getFilterTexture();this.blurXFilter.apply(t,i,h,xe.CLEAR),this.blurYFilter.apply(t,h,n,s),t.returnFilterTexture(h)}else a?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})(ri);var Bo=function(r,e){return Bo=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])},Bo(r,e)};function My(r,e){Bo(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;
762
+ `}return i=i.replace("%blur%",n),i=i.replace("%size%",r.toString()),i}var zu=function(r){Wu(e,r);function e(t,i,n,s,o){i===void 0&&(i=8),n===void 0&&(n=4),s===void 0&&(s=L.FILTER_RESOLUTION),o===void 0&&(o=5);var a=this,h=Cy(o,t),u=Iy(o);return a=r.call(this,h,u)||this,a.horizontal=t,a.resolution=s,a._quality=0,a.quality=n,a.blur=i,a}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 o=t.getFilterTexture(),a=t.renderer,h=i,u=o;this.state.blend=!1,t.applyFilter(this,h,u,xe.CLEAR);for(var l=1;l<this.passes-1;l++){t.bindAndClear(h,xe.BLIT),this.uniforms.uSampler=u;var f=u;u=h,h=f,a.shader.bind(this),a.geometry.draw(5)}this.state.blend=!0,t.applyFilter(this,u,n,s),t.returnFilterTexture(o)}},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}(ri);(function(r){Wu(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 o=r.call(this)||this;return o.blurXFilter=new zu(!0,t,i,n,s),o.blurYFilter=new zu(!1,t,i,n,s),o.resolution=n,o.quality=i,o.blur=t,o.repeatEdgePixels=!1,o}return e.prototype.apply=function(t,i,n,s){var o=Math.abs(this.blurXFilter.strength),a=Math.abs(this.blurYFilter.strength);if(o&&a){var h=t.getFilterTexture();this.blurXFilter.apply(t,i,h,xe.CLEAR),this.blurYFilter.apply(t,h,n,s),t.returnFilterTexture(h)}else a?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})(ri);var Bo=function(r,e){return Bo=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])},Bo(r,e)};function My(r,e){Bo(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Ny=`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
- `,Yu=function(r){My(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,iu,Dy,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,o=t&255,a=[n/255,0,0,0,0,0,s/255,0,0,0,0,0,o/255,0,0,0,0,0,1,0];this._loadMatrix(a,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),o=Math.sqrt,a=1/3,h=o(a),u=n+(1-n)*a,l=a*(1-n)-h*s,f=a*(1-n)+h*s,c=a*(1-n)+h*s,d=n+a*(1-n),v=a*(1-n)-h*s,p=a*(1-n)-h*s,_=a*(1-n)+h*s,g=n+a*(1-n),y=[u,l,f,0,0,c,d,v,0,0,p,_,g,0,0,0,0,0,1,0];this._loadMatrix(y,i)},e.prototype.contrast=function(t,i){var n=(t||0)+1,s=-.5*(n-1),o=[n,0,0,0,s,0,n,0,0,s,0,0,n,0,s,0,0,0,1,0];this._loadMatrix(o,i)},e.prototype.saturate=function(t,i){t===void 0&&(t=0);var n=t*2/3+1,s=(n-1)*-.5,o=[n,s,s,0,0,s,n,s,0,0,s,s,n,0,0,0,0,0,1,0];this._loadMatrix(o,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,o){t=t||.2,i=i||.15,n=n||16770432,s=s||3375104;var a=(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,a,h,u,t,0,l,f,c,i,0,a-l,h-f,u-c,0,0];this._loadMatrix(d,o)},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}(ri);Yu.prototype.grayscale=Yu.prototype.greyscale;var Lo=function(r,e){return Lo=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])},Lo(r,e)};function Ny(r,e){Lo(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Fy=`varying vec2 vFilterCoord;
814
+ `,Yu=function(r){My(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,iu,Ny,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,o=t&255,a=[n/255,0,0,0,0,0,s/255,0,0,0,0,0,o/255,0,0,0,0,0,1,0];this._loadMatrix(a,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),o=Math.sqrt,a=1/3,h=o(a),u=n+(1-n)*a,l=a*(1-n)-h*s,f=a*(1-n)+h*s,c=a*(1-n)+h*s,d=n+a*(1-n),v=a*(1-n)-h*s,p=a*(1-n)-h*s,_=a*(1-n)+h*s,g=n+a*(1-n),y=[u,l,f,0,0,c,d,v,0,0,p,_,g,0,0,0,0,0,1,0];this._loadMatrix(y,i)},e.prototype.contrast=function(t,i){var n=(t||0)+1,s=-.5*(n-1),o=[n,0,0,0,s,0,n,0,0,s,0,0,n,0,s,0,0,0,1,0];this._loadMatrix(o,i)},e.prototype.saturate=function(t,i){t===void 0&&(t=0);var n=t*2/3+1,s=(n-1)*-.5,o=[n,s,s,0,0,s,n,s,0,0,s,s,n,0,0,0,0,0,1,0];this._loadMatrix(o,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,o){t=t||.2,i=i||.15,n=n||16770432,s=s||3375104;var a=(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,a,h,u,t,0,l,f,c,i,0,a-l,h-f,u-c,0,0];this._loadMatrix(d,o)},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}(ri);Yu.prototype.grayscale=Yu.prototype.greyscale;var Lo=function(r,e){return Lo=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])},Lo(r,e)};function Dy(r,e){Lo(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Fy=`varying vec2 vFilterCoord;
815
815
  varying vec2 vTextureCoord;
816
816
 
817
817
  uniform vec2 scale;
@@ -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){Ny(e,r);function e(t,i){var n=this,s=new Dt;return t.renderable=!1,n=r.call(this,By,Fy,{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 o=this.maskSprite.worldTransform,a=Math.sqrt(o.a*o.a+o.b*o.b),h=Math.sqrt(o.c*o.c+o.d*o.d);a!==0&&h!==0&&(this.uniforms.rotation[0]=o.a/a,this.uniforms.rotation[1]=o.b/a,this.uniforms.rotation[2]=o.c/h,this.uniforms.rotation[3]=o.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})(ri);var Go=function(r,e){return Go=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])},Go(r,e)};function Ly(r,e){Go(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Gy=`
863
+ `;(function(r){Dy(e,r);function e(t,i){var n=this,s=new Nt;return t.renderable=!1,n=r.call(this,By,Fy,{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 o=this.maskSprite.worldTransform,a=Math.sqrt(o.a*o.a+o.b*o.b),h=Math.sqrt(o.c*o.c+o.d*o.d);a!==0&&h!==0&&(this.uniforms.rotation[0]=o.a/a,this.uniforms.rotation[1]=o.b/a,this.uniforms.rotation[2]=o.c/h,this.uniforms.rotation[3]=o.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})(ri);var Go=function(r,e){return Go=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])},Go(r,e)};function Ly(r,e){Go(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Gy=`
864
864
  attribute vec2 aVertexPosition;
865
865
 
866
866
  uniform mat3 projectionMatrix;
@@ -1057,6 +1057,6 @@ void main()
1057
1057
 
1058
1058
  gl_FragColor = color;
1059
1059
  }
1060
- `;(function(r){ky(e,r);function e(t,i){t===void 0&&(t=.5),i===void 0&&(i=Math.random());var n=r.call(this,iu,Xy,{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})(ri);var Vu=new Dt;Ct.prototype._cacheAsBitmap=!1,Ct.prototype._cacheData=null,Ct.prototype._cacheAsBitmapResolution=null,Ct.prototype._cacheAsBitmapMultisample=wt.NONE;var Hy=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(Ct.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 Hy),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)}}}}),Ct.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))},Ct.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 o=e.renderTexture.current,a=e.renderTexture.sourceFrame.clone(),h=e.renderTexture.destinationFrame.clone(),u=e.projection.transform,l=Pi.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_"+Ei();this._cacheData.textureCacheId=f,rt.addToCache(l.baseTexture,f),Y.addToCache(l,f);var c=this.transform.localTransform.copyTo(Vu).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(o,a,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 ct(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)}},Ct.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))},Ct.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 o=Pi.create({width:t.width,height:t.height}),a="cacheAsBitmap_"+Ei();this._cacheData.textureCacheId=a,rt.addToCache(o.baseTexture,a),Y.addToCache(o,a);var h=Vu;this.transform.localTransform.copyTo(h),h.invert(),h.tx-=t.x,h.ty-=t.y,this.renderCanvas=this._cacheData.originalRenderCanvas,e.render(this,{renderTexture:o,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 ct(o);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)}},Ct.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._bounds.updateID=this._boundsID},Ct.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds(null)},Ct.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,rt.removeFromCache(this._cacheData.textureCacheId),Y.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null},Ct.prototype._cacheAsBitmapDestroy=function(e){this.cacheAsBitmap=!1,this.destroy(e)};Ct.prototype.name=null,ht.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 o=s.getChildByName(e,!0);if(o)return o}}return null};Ct.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 Wy=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,o=s.clientWidth,a=s.clientHeight;i=o,n=a}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=at.Application,r}(),ju=function(){function r(e){var t=this;this.stage=new ht,e=Object.assign({forceCanvas:!1},e),this.renderer=mg(e),r._plugins.forEach(function(i){i.init.call(t,e)})}return r.registerPlugin=function(e){Te("6.5.0","Application.registerPlugin() is deprecated, use extensions.add()"),Ve.add({type:at.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}();Ve.handleByList(at.Application,ju._plugins),Ve.add(Wy);var ko=function(r,e){return ko=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])},ko(r,e)};function tr(r,e){ko(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var zy=function(r){tr(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 o=r.call(this)||this;return o.segWidth=n,o.segHeight=s,o.width=t,o.height=i,o.build(),o}return e.prototype.build=function(){for(var t=this.segWidth*this.segHeight,i=[],n=[],s=[],o=this.segWidth-1,a=this.segHeight-1,h=this.width/o,u=this.height/a,l=0;l<t;l++){var f=l%this.segWidth,c=l/this.segWidth|0;i.push(f*h,c*u),n.push(f/o,c/a)}for(var d=o*a,l=0;l<d;l++){var v=l%o,p=l/o|0,_=p*this.segWidth+v,g=p*this.segWidth+v+1,y=(p+1)*this.segWidth+v,m=(p+1)*this.segWidth+v+1;s.push(_,g,y,g,m,y)}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}(Hn),Yy=function(r){tr(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 o=n.data,a=s.data;o[0]=0,o[1]=0,o[2]=0,o[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);o[d]=h,o[d+1]=0,o[d+2]=h,o[d+3]=1}for(var g=0,c=0;c<f-1;c++){var d=c*2;a[g++]=d,a[g++]=d+1,a[g++]=d+2,a[g++]=d+2,a[g++]=d+1,a[g++]=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,o=0,a=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,o=-(n.x-i.x),s=n.y-i.y;var c=Math.sqrt(s*s+o*o),d=this.textureScale>0?this.textureScale*this._width/2:this._width/2;s/=c,o/=c,s*=d,o*=d,a[f]=l.x+s,a[f+1]=l.y+o,a[f+2]=l.x-s,a[f+3]=l.y-o,i=l}this.buffers[0].update()}},e.prototype.update=function(){this.textureScale>0?this.build():this.updateVertices()},e}(Hn),Vy=function(r){tr(e,r);function e(t,i,n){n===void 0&&(n=0);var s=this,o=new Yy(t.height,i,n),a=new kr(t);return n>0&&(t.baseTexture.wrapMode=De.REPEAT),s=r.call(this,o,a)||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}(Ur),jy=function(r){tr(e,r);function e(t,i,n){var s=this,o=new zy(t.width,t.height,i,n),a=new kr(Y.WHITE);return s=r.call(this,o,a)||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}(Ur);(function(r){tr(e,r);function e(t,i,n,s,o){t===void 0&&(t=Y.EMPTY);var a=this,h=new Hn(i,n,s);h.getBuffer("aVertexPosition").static=!1;var u=new kr(t);return a=r.call(this,h,u,null,o)||this,a.autoUpdate=!0,a}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})(Ur);var Yn=10;(function(r){tr(e,r);function e(t,i,n,s,o){i===void 0&&(i=Yn),n===void 0&&(n=Yn),s===void 0&&(s=Yn),o===void 0&&(o=Yn);var a=r.call(this,Y.WHITE,4,4)||this;return a._origWidth=t.orig.width,a._origHeight=t.orig.height,a._width=a._origWidth,a._height=a._origHeight,a._leftWidth=i,a._rightWidth=s,a._topHeight=n,a._bottomHeight=o,a.texture=t,a}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,o=Math.min(i,s);return o},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})(jy);var Xo=function(r,e){return Xo=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])},Xo(r,e)};function Zy(r,e){Xo(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}(function(r){Zy(e,r);function e(t,i){i===void 0&&(i=!0);var n=r.call(this,t[0]instanceof Y?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&&(Ut.shared.remove(this.update,this),this._isConnectedToTicker=!1))},e.prototype.play=function(){this._playing||(this._playing=!0,this._autoUpdate&&!this._isConnectedToTicker&&(Ut.shared.add(this.update,this,ee.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 o=Math.sign(this.animationSpeed*t);for(this._currentTime=Math.floor(this._currentTime);s>=this._durations[this.currentFrame];)s-=this._durations[this.currentFrame]*o,this._currentTime+=o;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(Y.from(t[n]));return new e(i)},e.fromImages=function(t){for(var i=[],n=0;n<t.length;++n)i.push(Y.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 Y)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?(Ut.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._playing&&(Ut.shared.add(this.update,this),this._isConnectedToTicker=!0))},enumerable:!1,configurable:!0}),e})(ct);Ve.add(Mg,Gg,Lg,Am,sy,ou,cy,Ey,em,Pm,Rm,ay,Kv,Vg);let er="sans-serif",Vn=null;const ai=new oi,Zu={chars:Ot.ASCII},Di=new oi;async function qu(r){const e=new ec(r.textFontFamilyDefault);try{await e.load()}catch(t){return console.error(t),console.warn(`loadBitmapFonts: font ${r.textFontFamilyDefault} failed to load, falling back to ${er}`),$u(er,r)}return er=r.textFontFamilyDefault,$u(er,r)}function Ku(r){ai.fontFamily=er,ai.fontSize=r.textSizeDefault,ai.lineHeight=r.textLineHeightDefault,Di.fontFamily=er,Di.fontSize=r.textSizeSmall,Di.lineHeight=r.textLineHeightSmall}function $u(r,e){Ku(e);const t={resolution:window.devicePixelRatio||2,...Zu};Ot.from("NodeTextDefault",{...ai,fill:e.colorTextDefault},t);const i={fontName:"NodeTextDefault",fontSize:e.textSizeDefault};Ot.from("NodeTextInverse",{...ai,fill:e.colorTextInverse},t);const n={fontName:"NodeTextInverse",fontSize:e.textSizeDefault};Ot.from("TimeMarkerLabel",{...Di,fill:e.colorTextSubdued},t);const s={fontName:"TimeMarkerLabel",fontSize:e.textSizeSmall};Ot.from("PlayheadTimerLabel",{...Di,fill:e.colorPlayheadBg},t);const o={fontName:"PlayheadTimerLabel",fontSize:e.textSizeSmall};return{nodeTextDefault:i,nodeTextInverse:n,nodeTextStyles:ai,timeMarkerLabel:s,playheadTimerLabel:o}}function qy(r){Ku(r);const e={resolution:window.devicePixelRatio||2,...Zu};setTimeout(()=>{Ot.uninstall("NodeTextDefault"),Ot.from("NodeTextDefault",{...ai,fill:r.colorTextDefault},e),Ot.uninstall("NodeTextInverse"),Ot.from("NodeTextInverse",{...ai,fill:r.colorTextInverse},e),Ot.uninstall("TimeMarkerLabel"),Ot.from("TimeMarkerLabel",{...Di,fill:r.colorTextSubdued},e),Ot.uninstall("PlayheadTimerLabel"),Ot.from("PlayheadTimerLabel",{...Di,fill:r.colorPlayheadBg},e)},0)}const jn=r=>(Vn||(Vn=qu(r)),Vn),Ky=r=>{Vn=qu(r)};class $y extends ht{constructor(t,i){super();R(this,"appRef");R(this,"viewportRef");R(this,"layer",new Le);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,ee.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 Jy(r){Qc();const e=new ju({backgroundAlpha:0,width:r.clientWidth,height:r.clientHeight,resolution:window.devicePixelRatio||2,autoDensity:!0,antialias:!0,resizeTo:r});return process.env.NODE_ENV==="development"&&Qy(e),r.appendChild(e.view),e.ticker.add(()=>{(r.clientWidth!==e.screen.width||r.clientHeight!==e.screen.height)&&(e.resizeTo=r)},null,ee.LOW),e}function Qy(r){globalThis.__PIXI_APP__=r}async function t0(){const{Viewport:r}=await Promise.resolve().then(()=>Kx);return r}async function e0(r,e){const t=await t0(),{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}).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,ee.LOW),s}const Ho=10;let Pe,Re,Ce,Oe;const Wo={multisample:2,resolution:4};function Zn(){Pe=new Map,Re=new Map,Ce=new Map,Oe=new Map}function i0(){Pe&&(Pe.forEach(r=>{r.destroy()}),Pe.clear(),Pe=void 0),Re&&(Re.forEach(({cap:r,body:e})=>{r.destroy(),e.destroy()}),Re.clear(),Re=void 0),Ce&&(Ce.forEach(r=>{r.destroy()}),Ce.clear(),Ce=void 0),Oe&&(Oe.forEach(({corner:r,edge:e})=>{r.destroy(),e.destroy()}),Oe.clear(),Oe=void 0)}function Xr({pixiApp:r,fill:e}){if(Pe||Zn(),!(Pe!=null&&Pe.has(e))){const t=new Le;t.beginFill(e),t.drawRect(0,0,Ho,Ho),t.endFill();const i=r.renderer.generateTexture(t);Pe.set(e,i)}return Pe.get(e)}function zo({pixiApp:r,fill:e,borderRadius:t,boxCapWidth:i,height:n}){if(Re||Zn(),!(Re!=null&&Re.has(e))){const s=new Le;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 o=Xr({pixiApp:r,fill:e}),a=r.renderer.generateTexture(s,Wo),h=o;Re.set(e,{cap:a,body:h})}return Re.get(e)}function Ju({pixiApp:r,strokeColor:e,edgeWidth:t,edgeLength:i}){if(Ce||Zn(),!(Ce!=null&&Ce.has(e))){const n=new Le;n.lineStyle(t,e,1,.5),n.moveTo(-i,-i),n.lineTo(0,0),n.lineTo(-i,i);const s=r.renderer.generateTexture(n,Wo);Ce.set(e,s)}return Ce.get(e)}function r0({pixiApp:r,borderRadius:e,borderColor:t,borderWidth:i}){Oe||Zn();const n={borderRadius:e,borderColor:t,borderWidth:i};if(!(Oe!=null&&Oe.has(n))){const s=new Le;s.lineStyle(i,t),s.moveTo(0,e),s.bezierCurveTo(0,e,0,0,e,0);const o=Xr({pixiApp:r,fill:t}),a=r.renderer.generateTexture(s,Wo);Oe.set(n,{corner:a,edge:o})}return Oe.get(n)}function Ke(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function Qu(r,e){r.prototype=Object.create(e.prototype),r.prototype.constructor=r,r.__proto__=e}var ie={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},ir={duration:.5,overwrite:!1,delay:0},Yo,zt,Mt,fe=1e8,ut=1/fe,Vo=Math.PI*2,n0=Vo/4,s0=0,tl=Math.sqrt,o0=Math.cos,a0=Math.sin,kt=function(e){return typeof e=="string"},St=function(e){return typeof e=="function"},$e=function(e){return typeof e=="number"},jo=function(e){return typeof e>"u"},Ge=function(e){return typeof e=="object"},Zt=function(e){return e!==!1},el=function(){return typeof window<"u"},qn=function(e){return St(e)||kt(e)},il=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},Yt=Array.isArray,Zo=/(?:-?\.?\d|\.)+/gi,rl=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,rr=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,qo=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,nl=/[+-]=-?[.\d]+/,sl=/[^,'"\[\]\s]+/gi,h0=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,mt,ce,Ko,$o,re={},Kn={},ol,al=function(e){return(Kn=Fi(e,re))&&oe},Jo=function(e,t){return console.warn("Invalid property",e,"set to",t,"Missing plugin? gsap.registerPlugin()")},$n=function(e,t){return!t&&console.warn(e)},hl=function(e,t){return e&&(re[e]=t)&&Kn&&(Kn[e]=t)||re},Hr=function(){return 0},u0={suppressEvents:!0,isStart:!0,kill:!1},Jn={suppressEvents:!0,kill:!1},l0={suppressEvents:!0},Qo={},hi=[],ta={},ul,ne={},ea={},ll=30,Qn=[],ia="",ra=function(e){var t=e[0],i,n;if(Ge(t)||St(t)||(e=[e]),!(i=(t._gsap||{}).harness)){for(n=Qn.length;n--&&!Qn[n].targetTest(t););i=Qn[n]}for(n=e.length;n--;)e[n]&&(e[n]._gsap||(e[n]._gsap=new Ll(e[n],i)))||e.splice(n,1);return e},Ni=function(e){return e._gsap||ra(ve(e))[0]._gsap},fl=function(e,t,i){return(i=e[t])&&St(i)?e[t]():jo(i)&&e.getAttribute&&e.getAttribute(t)||i},qt=function(e,t){return(e=e.split(",")).forEach(t)||e},At=function(e){return Math.round(e*1e5)/1e5||0},Ht=function(e){return Math.round(e*1e7)/1e7||0},nr=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},f0=function(e,t){for(var i=t.length,n=0;e.indexOf(t[n])<0&&++n<i;);return n<i},ts=function(){var e=hi.length,t=hi.slice(0),i,n;for(ta={},hi.length=0,i=0;i<e;i++)n=t[i],n&&n._lazy&&(n.render(n._lazy[0],n._lazy[1],!0)._lazy=0)},cl=function(e,t,i,n){hi.length&&!zt&&ts(),e.render(t,i,n||zt&&t<0&&(e._initted||e._startAt)),hi.length&&!zt&&ts()},dl=function(e){var t=parseFloat(e);return(t||t===0)&&(e+"").match(sl).length<2?t:kt(e)?e.trim():e},pl=function(e){return e},de=function(e,t){for(var i in t)i in e||(e[i]=t[i]);return e},c0=function(e){return function(t,i){for(var n in i)n in t||n==="duration"&&e||n==="ease"||(t[n]=i[n])}},Fi=function(e,t){for(var i in t)e[i]=t[i];return e},vl=function r(e,t){for(var i in t)i!=="__proto__"&&i!=="constructor"&&i!=="prototype"&&(e[i]=Ge(t[i])?r(e[i]||(e[i]={}),t[i]):t[i]);return e},es=function(e,t){var i={},n;for(n in e)n in t||(i[n]=e[n]);return i},Wr=function(e){var t=e.parent||mt,i=e.keyframes?c0(Yt(e.keyframes)):de;if(Zt(e.inherit))for(;t;)i(e,t.vars.defaults),t=t.parent||t._dp;return e},d0=function(e,t){for(var i=e.length,n=i===t.length;n&&i--&&e[i]===t[i];);return i<0},_l=function(e,t,i,n,s){i===void 0&&(i="_first"),n===void 0&&(n="_last");var o=e[n],a;if(s)for(a=t[s];o&&o[s]>a;)o=o._prev;return o?(t._next=o._next,o._next=t):(t._next=e[i],e[i]=t),t._next?t._next._prev=t:e[n]=t,t._prev=o,t.parent=t._dp=e,t},is=function(e,t,i,n){i===void 0&&(i="_first"),n===void 0&&(n="_last");var s=t._prev,o=t._next;s?s._next=o:e[i]===t&&(e[i]=o),o?o._prev=s:e[n]===t&&(e[n]=s),t._next=t._prev=t.parent=null},ui=function(e,t){e.parent&&(!t||e.parent.autoRemoveChildren)&&e.parent.remove(e),e._act=0},Bi=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},p0=function(e){for(var t=e.parent;t&&t.parent;)t._dirty=1,t.totalDuration(),t=t.parent;return e},na=function(e,t,i,n){return e._startAt&&(zt?e._startAt.revert(Jn):e.vars.immediateRender&&!e.vars.autoRevert||e._startAt.render(t,!0,n))},v0=function r(e){return!e||e._ts&&r(e.parent)},gl=function(e){return e._repeat?sr(e._tTime,e=e.duration()+e._rDelay)*e:0},sr=function(e,t){var i=Math.floor(e/=t);return e&&i===e?i-1:i},rs=function(e,t){return(e-t._start)*t._ts+(t._ts>=0?0:t._dirty?t.totalDuration():t._tDur)},ns=function(e){return e._end=Ht(e._start+(e._tDur/Math.abs(e._ts||e._rts||ut)||0))},ss=function(e,t){var i=e._dp;return i&&i.smoothChildTiming&&e._ts&&(e._start=Ht(i._time-(e._ts>0?t/e._ts:((e._dirty?e.totalDuration():e._tDur)-t)/-e._ts)),ns(e),i._dirty||Bi(i,e)),e},ml=function(e,t){var i;if((t._time||t._initted&&!t._dur)&&(i=rs(e.rawTime(),t),(!t._dur||Yr(0,t.totalDuration(),i)-t._tTime>ut)&&t.render(i,!0)),Bi(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=-ut}},Ue=function(e,t,i,n){return t.parent&&ui(t),t._start=Ht(($e(i)?i:i||e!==mt?pe(e,i,t):e._time)+t._delay),t._end=Ht(t._start+(t.totalDuration()/Math.abs(t.timeScale())||0)),_l(e,t,"_first","_last",e._sort?"_start":0),sa(t)||(e._recent=t),n||ml(e,t),e._ts<0&&ss(e,e._tTime),e},yl=function(e,t){return(re.ScrollTrigger||Jo("scrollTrigger",t))&&re.ScrollTrigger.create(t,e)},xl=function(e,t,i,n,s){if(pa(e,t,s),!e._initted)return 1;if(!i&&e._pt&&!zt&&(e._dur&&e.vars.lazy!==!1||!e._dur&&e.vars.lazy)&&ul!==se.frame)return hi.push(e),e._lazy=[s,n],1},_0=function r(e){var t=e.parent;return t&&t._ts&&t._initted&&!t._lock&&(t.rawTime()<0||r(t))},sa=function(e){var t=e.data;return t==="isFromStart"||t==="isStart"},g0=function(e,t,i,n){var s=e.ratio,o=t<0||!t&&(!e._start&&_0(e)&&!(!e._initted&&sa(e))||(e._ts<0||e._dp._ts<0)&&!sa(e))?0:1,a=e._rDelay,h=0,u,l,f;if(a&&e._repeat&&(h=Yr(0,e._tDur,t),l=sr(h,a),e._yoyo&&l&1&&(o=1-o),l!==sr(e._tTime,a)&&(s=1-o,e.vars.repeatRefresh&&e._initted&&e.invalidate())),o!==s||zt||n||e._zTime===ut||!t&&e._zTime){if(!e._initted&&xl(e,t,n,i,h))return;for(f=e._zTime,e._zTime=t||(i?ut:0),i||(i=t&&!f),e.ratio=o,e._from&&(o=1-o),e._time=0,e._tTime=h,u=e._pt;u;)u.r(o,u.d),u=u._next;t<0&&na(e,t,i,!0),e._onUpdate&&!i&&_e(e,"onUpdate"),h&&e._repeat&&!i&&e.parent&&_e(e,"onRepeat"),(t>=e._tDur||t<0)&&e.ratio===o&&(o&&ui(e,1),!i&&!zt&&(_e(e,o?"onComplete":"onReverseComplete",!0),e._prom&&e._prom()))}else e._zTime||(e._zTime=t)},m0=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}},or=function(e,t,i,n){var s=e._repeat,o=Ht(t)||0,a=e._tTime/e._tDur;return a&&!n&&(e._time*=o/e._dur),e._dur=o,e._tDur=s?s<0?1e10:Ht(o*(s+1)+e._rDelay*s):o,a>0&&!n&&ss(e,e._tTime=e._tDur*a),e.parent&&ns(e),i||Bi(e.parent,e),e},bl=function(e){return e instanceof Kt?Bi(e):or(e,e._dur)},y0={_start:0,endTime:Hr,totalDuration:Hr},pe=function r(e,t,i){var n=e.labels,s=e._recent||y0,o=e.duration()>=fe?s.endTime(!1):e._dur,a,h,u;return kt(t)&&(isNaN(t)||t in n)?(h=t.charAt(0),u=t.substr(-1)==="%",a=t.indexOf("="),h==="<"||h===">"?(a>=0&&(t=t.replace(/=/,"")),(h==="<"?s._start:s.endTime(s._repeat>=0))+(parseFloat(t.substr(1))||0)*(u?(a<0?s:i).totalDuration()/100:1)):a<0?(t in n||(n[t]=o),n[t]):(h=parseFloat(t.charAt(a-1)+t.substr(a+1)),u&&i&&(h=h/100*(Yt(i)?i[0]:i).totalDuration()),a>1?r(e,t.substr(0,a-1),i)+h:o+h)):t==null?o:+t},zr=function(e,t,i){var n=$e(t[1]),s=(n?2:1)+(e<2?0:1),o=t[s],a,h;if(n&&(o.duration=t[1]),o.parent=i,e){for(a=o,h=i;h&&!("immediateRender"in a);)a=h.vars.defaults||{},h=Zt(h.vars.inherit)&&h.parent;o.immediateRender=Zt(a.immediateRender),e<2?o.runBackwards=1:o.startAt=t[s-1]}return new Bt(t[0],o,t[s+1])},li=function(e,t){return e||e===0?t(e):t},Yr=function(e,t,i){return i<e?e:i>t?t:i},Vt=function(e,t){return!kt(e)||!(t=h0.exec(e))?"":t[1]},x0=function(e,t,i){return li(i,function(n){return Yr(e,t,n)})},oa=[].slice,Tl=function(e,t){return e&&Ge(e)&&"length"in e&&(!t&&!e.length||e.length-1 in e&&Ge(e[0]))&&!e.nodeType&&e!==ce},b0=function(e,t,i){return i===void 0&&(i=[]),e.forEach(function(n){var s;return kt(n)&&!t||Tl(n,1)?(s=i).push.apply(s,ve(n)):i.push(n)})||i},ve=function(e,t,i){return Mt&&!t&&Mt.selector?Mt.selector(e):kt(e)&&!i&&(Ko||!hr())?oa.call((t||$o).querySelectorAll(e),0):Yt(e)?b0(e,i):Tl(e)?oa.call(e,0):e?[e]:[]},aa=function(e){return e=ve(e)[0]||$n("Invalid scope")||{},function(t){var i=e.current||e.nativeElement||e;return ve(t,i.querySelectorAll?i:i===e?$n("Invalid scope")||$o.createElement("div"):e)}},wl=function(e){return e.sort(function(){return .5-Math.random()})},El=function(e){if(St(e))return e;var t=Ge(e)?e:{each:e},i=Li(t.ease),n=t.from||0,s=parseFloat(t.base)||0,o={},a=n>0&&n<1,h=isNaN(n)||a,u=t.axis,l=n,f=n;return kt(n)?l=f={center:.5,edges:.5,end:1}[n]||0:!a&&h&&(l=n[0],f=n[1]),function(c,d,v){var p=(v||t).length,_=o[p],g,y,m,b,x,T,w,S,E;if(!_){if(E=t.grid==="auto"?0:(t.grid||[1,fe])[1],!E){for(w=-fe;w<(w=v[E++].getBoundingClientRect().left)&&E<p;);E--}for(_=o[p]=[],g=h?Math.min(E,p)*l-.5:n%E,y=E===fe?0:h?p*f/E-.5:n/E|0,w=0,S=fe,T=0;T<p;T++)m=T%E-g,b=y-(T/E|0),_[T]=x=u?Math.abs(u==="y"?b:m):tl(m*m+b*b),x>w&&(w=x),x<S&&(S=x);n==="random"&&wl(_),_.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=Vt(t.amount||t.each)||0,i=i&&p<0?Nl(i):i}return p=(_[c]-_.min)/_.max||0,Ht(_.b+(i?i(p):p)*_.v)+_.u}},ha=function(e){var t=Math.pow(10,((e+"").split(".")[1]||"").length);return function(i){var n=Ht(Math.round(parseFloat(i)/e)*e*t);return(n-n%1)/t+($e(i)?0:Vt(i))}},Sl=function(e,t){var i=Yt(e),n,s;return!i&&Ge(e)&&(n=i=e.radius||fe,e.values?(e=ve(e.values),(s=!$e(e[0]))&&(n*=n)):e=ha(e.increment)),li(t,i?St(e)?function(o){return s=e(o),Math.abs(s-o)<=n?s:o}:function(o){for(var a=parseFloat(s?o.x:o),h=parseFloat(s?o.y:0),u=fe,l=0,f=e.length,c,d;f--;)s?(c=e[f].x-a,d=e[f].y-h,c=c*c+d*d):c=Math.abs(e[f]-a),c<u&&(u=c,l=f);return l=!n||u<=n?e[l]:o,s||l===o||$e(o)?l:l+Vt(o)}:ha(e))},Pl=function(e,t,i,n){return li(Yt(e)?!t:i===!0?!!(i=0):!n,function(){return Yt(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})},T0=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,o){return o(s)},n)}},w0=function(e,t){return function(i){return e(parseFloat(i))+(t||Vt(i))}},E0=function(e,t,i){return Cl(e,t,0,1,i)},Rl=function(e,t,i){return li(i,function(n){return e[~~t(n)]})},S0=function r(e,t,i){var n=t-e;return Yt(e)?Rl(e,r(0,e.length),t):li(i,function(s){return(n+(s-e)%n)%n+e})},P0=function r(e,t,i){var n=t-e,s=n*2;return Yt(e)?Rl(e,r(0,e.length-1),t):li(i,function(o){return o=(s+(o-e)%s)%s||0,e+(o>n?s-o:o)})},Vr=function(e){for(var t=0,i="",n,s,o,a;~(n=e.indexOf("random(",t));)o=e.indexOf(")",n),a=e.charAt(n+7)==="[",s=e.substr(n+7,o-n-7).match(a?sl:Zo),i+=e.substr(t,n-t)+Pl(a?s:+s[0],a?0:+s[1],+s[2]||1e-5),t=o+1;return i+e.substr(t,e.length-t)},Cl=function(e,t,i,n,s){var o=t-e,a=n-i;return li(s,function(h){return i+((h-e)/o*a||0)})},R0=function r(e,t,i,n){var s=isNaN(e+t)?0:function(d){return(1-d)*e+d*t};if(!s){var o=kt(e),a={},h,u,l,f,c;if(i===!0&&(n=1)&&(i=null),o)e={p:e},t={p:t};else if(Yt(e)&&!Yt(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=Fi(Yt(e)?[]:{},e));if(!l){for(h in t)ca.call(a,e,h,"get",t[h]);s=function(v){return ga(v,a)||(o?e.p:e)}}}return li(i,s)},Ol=function(e,t,i){var n=e.labels,s=fe,o,a,h;for(o in n)a=n[o]-t,a<0==!!i&&a&&s>(a=Math.abs(a))&&(h=o,s=a);return h},_e=function(e,t,i){var n=e.vars,s=n[t],o=Mt,a=e._ctx,h,u,l;if(s)return h=n[t+"Params"],u=n.callbackScope||e,i&&hi.length&&ts(),a&&(Mt=a),l=h?s.apply(u,h):s.call(u),Mt=o,l},jr=function(e){return ui(e),e.scrollTrigger&&e.scrollTrigger.kill(!!zt),e.progress()<1&&_e(e,"onInterrupt"),e},ar,C0=function(e){e=!e.name&&e.default||e;var t=e.name,i=St(e),n=t&&!i&&e.init?function(){this._props=[]}:e,s={init:Hr,render:ga,add:ca,kill:z0,modifier:W0,rawVars:0},o={targetTest:0,get:0,getSetter:_a,aliases:{},register:0};if(hr(),e!==n){if(ne[t])return;de(n,de(es(e,s),o)),Fi(n.prototype,Fi(s,es(e,o))),ne[n.prop=t]=n,e.targetTest&&(Qn.push(n),Qo[t]=1),t=(t==="css"?"CSS":t.charAt(0).toUpperCase()+t.substr(1))+"Plugin"}hl(t,n),e.register&&e.register(oe,n,$t)},lt=255,Zr={aqua:[0,lt,lt],lime:[0,lt,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,lt],navy:[0,0,128],white:[lt,lt,lt],olive:[128,128,0],yellow:[lt,lt,0],orange:[lt,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[lt,0,0],pink:[lt,192,203],cyan:[0,lt,lt],transparent:[lt,lt,lt,0]},ua=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)*lt+.5|0},Al=function(e,t,i){var n=e?$e(e)?[e>>16,e>>8&lt,e&lt]:0:Zr.black,s,o,a,h,u,l,f,c,d,v;if(!n){if(e.substr(-1)===","&&(e=e.substr(0,e.length-1)),Zr[e])n=Zr[e];else if(e.charAt(0)==="#"){if(e.length<6&&(s=e.charAt(1),o=e.charAt(2),a=e.charAt(3),e="#"+s+s+o+o+a+a+(e.length===5?e.charAt(4)+e.charAt(4):"")),e.length===9)return n=parseInt(e.substr(1,6),16),[n>>16,n>>8&lt,n&lt,parseInt(e.substr(7),16)/255];e=parseInt(e.substr(1),16),n=[e>>16,e>>8&lt,e&lt]}else if(e.substr(0,3)==="hsl"){if(n=v=e.match(Zo),!t)h=+n[0]%360/360,u=+n[1]/100,l=+n[2]/100,o=l<=.5?l*(u+1):l+u-l*u,s=l*2-o,n.length>3&&(n[3]*=1),n[0]=ua(h+1/3,s,o),n[1]=ua(h,s,o),n[2]=ua(h-1/3,s,o);else if(~e.indexOf("="))return n=e.match(rl),i&&n.length<4&&(n[3]=1),n}else n=e.match(Zo)||Zr.transparent;n=n.map(Number)}return t&&!v&&(s=n[0]/lt,o=n[1]/lt,a=n[2]/lt,f=Math.max(s,o,a),c=Math.min(s,o,a),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?(o-a)/d+(o<a?6:0):f===o?(a-s)/d+2:(s-o)/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},Il=function(e){var t=[],i=[],n=-1;return e.split(fi).forEach(function(s){var o=s.match(rr)||[];t.push.apply(t,o),i.push(n+=o.length+1)}),t.c=i,t},Ml=function(e,t,i){var n="",s=(e+n).match(fi),o=t?"hsla(":"rgba(",a=0,h,u,l,f;if(!s)return e;if(s=s.map(function(c){return(c=Al(c,t,1))&&o+(t?c[0]+","+c[1]+"%,"+c[2]+"%,"+c[3]:c.join(","))+")"}),i&&(l=Il(e),h=i.c,h.join(n)!==l.c.join(n)))for(u=e.replace(fi,"1").split(rr),f=u.length-1;a<f;a++)n+=u[a]+(~h.indexOf(a)?s.shift()||o+"0,0,0,0)":(l.length?l:s.length?s:i).shift());if(!u)for(u=e.split(fi),f=u.length-1;a<f;a++)n+=u[a]+s[a];return n+u[f]},fi=function(){var r="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",e;for(e in Zr)r+="|"+e+"\\b";return new RegExp(r+")","gi")}(),O0=/hsl[a]?\(/,Dl=function(e){var t=e.join(" "),i;if(fi.lastIndex=0,fi.test(t))return i=O0.test(t),e[1]=Ml(e[1],i),e[0]=Ml(e[0],i,Il(e[1])),!0},qr,se=function(){var r=Date.now,e=500,t=33,i=r(),n=i,s=1e3/240,o=s,a=[],h,u,l,f,c,d,v=function p(_){var g=r()-n,y=_===!0,m,b,x,T;if(g>e&&(i+=g-t),n+=g,x=n-i,m=x-o,(m>0||y)&&(T=++f.frame,c=x-f.time*1e3,f.time=x=x/1e3,o+=m+(m>=s?4:s-m),b=1),y||(h=u(p)),b)for(d=0;d<a.length;d++)a[d](x,c,T,_)};return f={time:0,frame:0,tick:function(){v(!0)},deltaRatio:function(_){return c/(1e3/(_||60))},wake:function(){ol&&(!Ko&&el()&&(ce=Ko=window,$o=ce.document||{},re.gsap=oe,(ce.gsapVersions||(ce.gsapVersions=[])).push(oe.version),al(Kn||ce.GreenSockGlobals||!ce.gsap&&ce||{}),l=ce.requestAnimationFrame),h&&f.sleep(),u=l||function(_){return setTimeout(_,o-f.time*1e3+1|0)},qr=1,v(2))},sleep:function(){(l?ce.cancelAnimationFrame:clearTimeout)(h),qr=0,u=Hr},lagSmoothing:function(_,g){e=_||1/0,t=Math.min(g||33,e)},fps:function(_){s=1e3/(_||240),o=f.time*1e3+s},add:function(_,g,y){var m=g?function(b,x,T,w){_(b,x,T,w),f.remove(m)}:_;return f.remove(_),a[y?"unshift":"push"](m),hr(),m},remove:function(_,g){~(g=a.indexOf(_))&&a.splice(g,1)&&d>=g&&d--},_listeners:a},f}(),hr=function(){return!qr&&se.wake()},it={},A0=/^[\d.\-M][\d.\-,\s]/,I0=/["']/g,M0=function(e){for(var t={},i=e.substr(1,e.length-3).split(":"),n=i[0],s=1,o=i.length,a,h,u;s<o;s++)h=i[s],a=s!==o-1?h.lastIndexOf(","):h.length,u=h.substr(0,a),t[n]=isNaN(u)?u.replace(I0,"").trim():+u,n=h.substr(a+1).trim();return t},D0=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)},N0=function(e){var t=(e+"").split("("),i=it[t[0]];return i&&t.length>1&&i.config?i.config.apply(null,~e.indexOf("{")?[M0(t[1])]:D0(e).split(",").map(dl)):it._CE&&A0.test(e)?it._CE("",e):i},Nl=function(e){return function(t){return 1-e(1-t)}},Fl=function r(e,t){for(var i=e._first,n;i;)i instanceof Kt?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},Li=function(e,t){return e&&(St(e)?e:it[e]||N0(e))||t},Gi=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},o;return qt(e,function(a){it[a]=re[a]=s,it[o=a.toLowerCase()]=i;for(var h in s)it[o+(h==="easeIn"?".in":h==="easeOut"?".out":".inOut")]=it[a+"."+h]=s[h]}),s},Bl=function(e){return function(t){return t<.5?(1-e(1-t*2))/2:.5+e((t-.5)*2)/2}},la=function r(e,t,i){var n=t>=1?t:1,s=(i||(e?.3:.45))/(t<1?t:1),o=s/Vo*(Math.asin(1/n)||0),a=function(l){return l===1?1:n*Math.pow(2,-10*l)*a0((l-o)*s)+1},h=e==="out"?a:e==="in"?function(u){return 1-a(1-u)}:Bl(a);return s=Vo/s,h.config=function(u,l){return r(e,u,l)},h},fa=function r(e,t){t===void 0&&(t=1.70158);var i=function(o){return o?--o*o*((t+1)*o+t)+1:0},n=e==="out"?i:e==="in"?function(s){return 1-i(1-s)}:Bl(i);return n.config=function(s){return r(e,s)},n};qt("Linear,Quad,Cubic,Quart,Quint,Strong",function(r,e){var t=e<5?e+1:e;Gi(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})}),it.Linear.easeNone=it.none=it.Linear.easeIn,Gi("Elastic",la("in"),la("out"),la()),function(r,e){var t=1/e,i=2*t,n=2.5*t,s=function(a){return a<t?r*a*a:a<i?r*Math.pow(a-1.5/e,2)+.75:a<n?r*(a-=2.25/e)*a+.9375:r*Math.pow(a-2.625/e,2)+.984375};Gi("Bounce",function(o){return 1-s(1-o)},s)}(7.5625,2.75),Gi("Expo",function(r){return r?Math.pow(2,10*(r-1)):0}),Gi("Circ",function(r){return-(tl(1-r*r)-1)}),Gi("Sine",function(r){return r===1?1:-o0(r*n0)+1}),Gi("Back",fa("in"),fa("out"),fa()),it.SteppedEase=it.steps=re.SteppedEase={config:function(e,t){e===void 0&&(e=1);var i=1/e,n=e+(t?0:1),s=t?1:0,o=1-ut;return function(a){return((n*Yr(0,o,a)|0)+s)*i}}},ir.ease=it["quad.out"],qt("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(r){return ia+=r+","+r+"Params,"});var Ll=function(e,t){this.id=s0++,e._gsap=this,this.target=e,this.harness=t,this.get=t?t.get:fl,this.set=t?t.getSetter:_a},ur=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,or(this,+t.duration,1,1),this.data=t.data,Mt&&(this._ctx=Mt,Mt.data.push(this)),qr||se.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,or(this,this._repeat<0?i:(i-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(i,n){if(hr(),!arguments.length)return this._tTime;var s=this._dp;if(s&&s.smoothChildTiming&&this._ts){for(ss(this,i),!s._dp||s.parent||ml(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)&&Ue(this._dp,this,this._start-this._delay)}return(this._tTime!==i||!this._dur&&!n||this._initted&&Math.abs(this._zTime)===ut||!i&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=i),cl(this,i,n)),this},e.time=function(i,n){return arguments.length?this.totalTime(Math.min(this.totalDuration(),i+gl(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)+gl(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?sr(this._tTime,s)+1:1},e.timeScale=function(i){if(!arguments.length)return this._rts===-ut?0:this._rts;if(this._rts===i)return this;var n=this.parent&&this._ts?rs(this.parent._time,this):this._tTime;return this._rts=+i||0,this._ts=this._ps||i===-ut?0:this._rts,this.totalTime(Yr(-this._delay,this._tDur,n),!0),ns(this),p0(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):(hr(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==ut&&(this._tTime-=ut)))),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)&&Ue(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?rs(n.rawTime(i),this):this._tTime:this._tTime},e.revert=function(i){i===void 0&&(i=l0);var n=zt;return zt=i,(this._initted||this._startAt)&&(this.timeline&&this.timeline.revert(i),this.totalTime(-.01,i.suppressEvents)),this.data!=="nested"&&i.kill!==!1&&this.kill(),zt=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,bl(this)):this._repeat===-2?1/0:this._repeat},e.repeatDelay=function(i){if(arguments.length){var n=this._time;return this._rDelay=i,bl(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(pe(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?-ut:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-ut,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)-ut)},e.eventCallback=function(i,n,s){var o=this.vars;return arguments.length>1?(n?(o[i]=n,s&&(o[i+"Params"]=s),i==="onUpdate"&&(this._onUpdate=n)):delete o[i],this):o[i]},e.then=function(i){var n=this;return new Promise(function(s){var o=St(i)?i:pl,a=function(){var u=n.then;n.then=null,St(o)&&(o=o(n))&&(o.then||o===n)&&(n.then=u),s(o),n.then=u};n._initted&&n.totalProgress()===1&&n._ts>=0||!n._tTime&&n._ts<0?a():n._prom=a})},e.kill=function(){jr(this)},r}();de(ur.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:-ut,_prom:0,_ps:!1,_rts:1});var Kt=function(r){Qu(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),mt&&Ue(i.parent||mt,Ke(s),n),i.reversed&&s.reverse(),i.paused&&s.paused(!0),i.scrollTrigger&&yl(Ke(s),i.scrollTrigger),s}var t=e.prototype;return t.to=function(n,s,o){return zr(0,arguments,this),this},t.from=function(n,s,o){return zr(1,arguments,this),this},t.fromTo=function(n,s,o,a){return zr(2,arguments,this),this},t.set=function(n,s,o){return s.duration=0,s.parent=this,Wr(s).repeatDelay||(s.repeat=0),s.immediateRender=!!s.immediateRender,new Bt(n,s,pe(this,o),1),this},t.call=function(n,s,o){return Ue(this,Bt.delayedCall(0,n,s),o)},t.staggerTo=function(n,s,o,a,h,u,l){return o.duration=s,o.stagger=o.stagger||a,o.onComplete=u,o.onCompleteParams=l,o.parent=this,new Bt(n,o,pe(this,h)),this},t.staggerFrom=function(n,s,o,a,h,u,l){return o.runBackwards=1,Wr(o).immediateRender=Zt(o.immediateRender),this.staggerTo(n,s,o,a,h,u,l)},t.staggerFromTo=function(n,s,o,a,h,u,l,f){return a.startAt=o,Wr(a).immediateRender=Zt(a.immediateRender),this.staggerTo(n,s,a,h,u,l,f)},t.render=function(n,s,o){var a=this._time,h=this._dirty?this.totalDuration():this._tDur,u=this._dur,l=n<=0?0:Ht(n),f=this._zTime<0!=n<0&&(this._initted||!u),c,d,v,p,_,g,y,m,b,x,T,w;if(this!==mt&&l>h&&n>=0&&(l=h),l!==this._tTime||o||f){if(a!==this._time&&u&&(l+=this._time-a,n+=this._time-a),c=l,b=this._start,m=this._ts,g=!m,f&&(u||(a=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,o);if(c=Ht(l%_),l===h?(p=this._repeat,c=u):(p=~~(l/_),p&&p===l/_&&(c=u,p--),c>u&&(c=u)),x=sr(this._tTime,_),!a&&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),a=S?0:u,this._lock=1,this.render(a||(w?0:Ht(p*_)),s,!u)._lock=0,this._tTime=l,!s&&this.parent&&_e(this,"onRepeat"),this.vars.repeatRefresh&&!w&&(this.invalidate()._lock=1),a&&a!==this._time||g!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(u=this._dur,h=this._tDur,E&&(this._lock=2,a=S?u:-1e-4,this.render(a,!0),this.vars.repeatRefresh&&!w&&this.invalidate()),this._lock=0,!this._ts&&!g)return this;Fl(this,w)}}if(this._hasPause&&!this._forcing&&this._lock<2&&(y=m0(this,Ht(a),Ht(c)),y&&(l-=c-(c=y._start))),this._tTime=l,this._time=c,this._act=!m,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=n,a=0),!a&&c&&!s&&(_e(this,"onStart"),this._tTime!==l))return this;if(c>=a&&n>=0)for(d=this._first;d;){if(v=d._next,(d._act||c>=d._start)&&d._ts&&y!==d){if(d.parent!==this)return this.render(n,s,o);if(d.render(d._ts>0?(c-d._start)*d._ts:(d._dirty?d.totalDuration():d._tDur)+(c-d._start)*d._ts,s,o),c!==this._time||!this._ts&&!g){y=0,v&&(l+=this._zTime=-ut);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&&y!==d){if(d.parent!==this)return this.render(n,s,o);if(d.render(d._ts>0?(P-d._start)*d._ts:(d._dirty?d.totalDuration():d._tDur)+(P-d._start)*d._ts,s,o||zt&&(d._initted||d._startAt)),c!==this._time||!this._ts&&!g){y=0,v&&(l+=this._zTime=P?-ut:ut);break}}d=v}}if(y&&!s&&(this.pause(),y.render(c>=a?0:-ut)._zTime=c>=a?1:-1,this._ts))return this._start=b,ns(this),this.render(n,s,o);this._onUpdate&&!s&&_e(this,"onUpdate",!0),(l===h&&this._tTime>=this.totalDuration()||!l&&a)&&(b===this._start||Math.abs(m)!==Math.abs(this._ts))&&(this._lock||((n||!u)&&(l===h&&this._ts>0||!l&&this._ts<0)&&ui(this,1),!s&&!(n<0&&!a)&&(l||a||!h)&&(_e(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 o=this;if($e(s)||(s=pe(this,s,n)),!(n instanceof ur)){if(Yt(n))return n.forEach(function(a){return o.add(a,s)}),this;if(kt(n))return this.addLabel(n,s);if(St(n))n=Bt.delayedCall(0,n);else return this}return this!==n?Ue(this,n,s):this},t.getChildren=function(n,s,o,a){n===void 0&&(n=!0),s===void 0&&(s=!0),o===void 0&&(o=!0),a===void 0&&(a=-fe);for(var h=[],u=this._first;u;)u._start>=a&&(u instanceof Bt?s&&h.push(u):(o&&h.push(u),n&&h.push.apply(h,u.getChildren(!0,s,o)))),u=u._next;return h},t.getById=function(n){for(var s=this.getChildren(1,1,1),o=s.length;o--;)if(s[o].vars.id===n)return s[o]},t.remove=function(n){return kt(n)?this.removeLabel(n):St(n)?this.killTweensOf(n):(is(this,n),n===this._recent&&(this._recent=this._last),Bi(this))},t.totalTime=function(n,s){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=Ht(se.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]=pe(this,s),this},t.removeLabel=function(n){return delete this.labels[n],this},t.addPause=function(n,s,o){var a=Bt.delayedCall(0,s||Hr,o);return a.data="isPause",this._hasPause=1,Ue(this,a,pe(this,n))},t.removePause=function(n){var s=this._first;for(n=pe(this,n);s;)s._start===n&&s.data==="isPause"&&ui(s),s=s._next},t.killTweensOf=function(n,s,o){for(var a=this.getTweensOf(n,o),h=a.length;h--;)ci!==a[h]&&a[h].kill(n,s);return this},t.getTweensOf=function(n,s){for(var o=[],a=ve(n),h=this._first,u=$e(s),l;h;)h instanceof Bt?f0(h._targets,a)&&(u?(!ci||h._initted&&h._ts)&&h.globalTime(0)<=s&&h.globalTime(h.totalDuration())>s:!s||h.isActive())&&o.push(h):(l=h.getTweensOf(a,s)).length&&o.push.apply(o,l),h=h._next;return o},t.tweenTo=function(n,s){s=s||{};var o=this,a=pe(o,n),h=s,u=h.startAt,l=h.onStart,f=h.onStartParams,c=h.immediateRender,d,v=Bt.to(o,de({ease:s.ease||"none",lazy:!1,immediateRender:!1,time:a,overwrite:"auto",duration:s.duration||Math.abs((a-(u&&"time"in u?u.time:o._time))/o.timeScale())||ut,onStart:function(){if(o.pause(),!d){var _=s.duration||Math.abs((a-(u&&"time"in u?u.time:o._time))/o.timeScale());v._dur!==_&&or(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,o){return this.tweenTo(s,de({startAt:{time:pe(this,n)}},o))},t.recent=function(){return this._recent},t.nextLabel=function(n){return n===void 0&&(n=this._time),Ol(this,pe(this,n))},t.previousLabel=function(n){return n===void 0&&(n=this._time),Ol(this,pe(this,n),1)},t.currentLabel=function(n){return arguments.length?this.seek(n,!0):this.previousLabel(this._time+ut)},t.shiftChildren=function(n,s,o){o===void 0&&(o=0);for(var a=this._first,h=this.labels,u;a;)a._start>=o&&(a._start+=n,a._end+=n),a=a._next;if(s)for(u in h)h[u]>=o&&(h[u]+=n);return Bi(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,o;s;)o=s._next,this.remove(s),s=o;return this._dp&&(this._time=this._tTime=this._pTime=0),n&&(this.labels={}),Bi(this)},t.totalDuration=function(n){var s=0,o=this,a=o._last,h=fe,u,l,f;if(arguments.length)return o.timeScale((o._repeat<0?o.duration():o.totalDuration())/(o.reversed()?-n:n));if(o._dirty){for(f=o.parent;a;)u=a._prev,a._dirty&&a.totalDuration(),l=a._start,l>h&&o._sort&&a._ts&&!o._lock?(o._lock=1,Ue(o,a,l-a._delay,1)._lock=0):h=l,l<0&&a._ts&&(s-=l,(!f&&!o._dp||f&&f.smoothChildTiming)&&(o._start+=l/o._ts,o._time-=l,o._tTime-=l),o.shiftChildren(-l,!1,-1/0),h=0),a._end>s&&a._ts&&(s=a._end),a=u;or(o,o===mt&&o._time>s?o._time:s,1,1),o._dirty=0}return o._tDur},e.updateRoot=function(n){if(mt._ts&&(cl(mt,rs(n,mt)),ul=se.frame),se.frame>=ll){ll+=ie.autoSleep||120;var s=mt._first;if((!s||!s._ts)&&ie.autoSleep&&se._listeners.length<2){for(;s&&!s._ts;)s=s._next;s||se.sleep()}}},e}(ur);de(Kt.prototype,{_lock:0,_hasPause:0,_forcing:0});var F0=function(e,t,i,n,s,o,a){var h=new $t(this._pt,e,t,0,1,Wl,null,s),u=0,l=0,f,c,d,v,p,_,g,y;for(h.b=i,h.e=n,i+="",n+="",(g=~n.indexOf("random("))&&(n=Vr(n)),o&&(y=[i,n],o(y,e,t),i=y[0],n=y[1]),c=i.match(qo)||[];f=qo.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)==="="?nr(_,v)-_:parseFloat(v)-_,m:d&&d<4?Math.round:0},u=qo.lastIndex);return h.c=u<n.length?n.substring(u,n.length):"",h.fp=a,(nl.test(n)||g)&&(h.e=0),this._pt=h,h},ca=function(e,t,i,n,s,o,a,h,u,l){St(n)&&(n=n(s||0,e,o));var f=e[t],c=i!=="get"?i:St(f)?u?e[t.indexOf("set")||!St(e["get"+t.substr(3)])?t:"get"+t.substr(3)](u):e[t]():f,d=St(f)?u?k0:Xl:va,v;if(kt(n)&&(~n.indexOf("random(")&&(n=Vr(n)),n.charAt(1)==="="&&(v=nr(c,n)+(Vt(c)||0),(v||v===0)&&(n=v))),!l||c!==n||da)return!isNaN(c*n)&&n!==""?(v=new $t(this._pt,e,t,+c||0,n-(c||0),typeof f=="boolean"?H0:Hl,0,d),u&&(v.fp=u),a&&v.modifier(a,this,e),this._pt=v):(!f&&!(t in e)&&Jo(t,n),F0.call(this,e,t,c,n,d,h||ie.stringFilter,u))},B0=function(e,t,i,n,s){if(St(e)&&(e=Kr(e,s,t,i,n)),!Ge(e)||e.style&&e.nodeType||Yt(e)||il(e))return kt(e)?Kr(e,s,t,i,n):e;var o={},a;for(a in e)o[a]=Kr(e[a],s,t,i,n);return o},Gl=function(e,t,i,n,s,o){var a,h,u,l;if(ne[e]&&(a=new ne[e]).init(s,a.rawVars?t[e]:B0(t[e],n,s,o,i),i,n,o)!==!1&&(i._pt=h=new $t(i._pt,s,e,0,1,a.render,a,0,a.priority),i!==ar))for(u=i._ptLookup[i._targets.indexOf(s)],l=a._props.length;l--;)u[a._props[l]]=h;return a},ci,da,pa=function r(e,t,i){var n=e.vars,s=n.ease,o=n.startAt,a=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,g=e._startAt,y=e._targets,m=e.parent,b=m&&m.data==="nested"?m.vars.targets:y,x=e._overwrite==="auto"&&!Yo,T=e.timeline,w,S,E,P,O,N,D,U,I,A,B,K,z;if(T&&(!v||!s)&&(s="none"),e._ease=Li(s,ir.ease),e._yEase=d?Nl(Li(d===!0?s:d,ir.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=y[0]?Ni(y[0]).harness:0,K=U&&n[U.prop],w=es(n,Qo),g&&(g._zTime<0&&g.progress(1),t<0&&c&&a&&!p?g.render(-1,!0):g.revert(c&&_?Jn:u0),g._lazy=0),o){if(ui(e._startAt=Bt.set(y,de({data:"isStart",overwrite:!1,parent:m,immediateRender:!0,lazy:!g&&Zt(h),startAt:null,delay:0,onUpdate:u,onUpdateParams:l,callbackScope:f,stagger:0},o))),e._startAt._dp=0,e._startAt._sat=e,t<0&&(zt||!a&&!p)&&e._startAt.revert(Jn),a&&_&&t<=0&&i<=0){t&&(e._zTime=t);return}}else if(c&&_&&!g){if(t&&(a=!1),E=de({overwrite:!1,data:"isFromStart",lazy:a&&!g&&Zt(h),immediateRender:a,stagger:0,parent:m},w),K&&(E[U.prop]=K),ui(e._startAt=Bt.set(y,E)),e._startAt._dp=0,e._startAt._sat=e,t<0&&(zt?e._startAt.revert(Jn):e._startAt.render(-1,!0)),e._zTime=t,!a)r(e._startAt,ut,ut);else if(!t)return}for(e._pt=e._ptCache=0,h=_&&Zt(h)||h&&!_,S=0;S<y.length;S++){if(O=y[S],D=O._gsap||ra(y)[S]._gsap,e._ptLookup[S]=A={},ta[D.id]&&hi.length&&ts(),B=b===y?S:b.indexOf(O),U&&(I=new U).init(O,K||w,e,B,b)!==!1&&(e._pt=P=new $t(e._pt,O,I.name,0,1,I.render,I,0,I.priority),I._props.forEach(function(M){A[M]=P}),I.priority&&(N=1)),!U||K)for(E in w)ne[E]&&(I=Gl(E,w,e,B,O,b))?I.priority&&(N=1):A[E]=P=ca.call(e,O,E,"get",w[E],B,b,0,n.stringFilter);e._op&&e._op[S]&&e.kill(O,e._op[S]),x&&e._pt&&(ci=e,mt.killTweensOf(O,A,e.globalTime(t)),z=!e.parent,ci=0),e._pt&&h&&(ta[D.id]=1)}N&&zl(e),e._onInit&&e._onInit(e)}e._onUpdate=u,e._initted=(!e._op||e._pt)&&!z,v&&t<=0&&T.render(fe,!0,!0)},L0=function(e,t,i,n,s,o,a){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 da=1,e.vars[t]="+=0",pa(e,a),da=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)+o*u.c,u.c=i-u.s,l.e&&(l.e=At(i)+Vt(l.e)),l.b&&(l.b=u.s+Vt(l.b))},G0=function(e,t){var i=e[0]?Ni(e[0]).harness:0,n=i&&i.aliases,s,o,a,h;if(!n)return t;s=Fi({},t);for(o in n)if(o in s)for(h=n[o].split(","),a=h.length;a--;)s[h[a]]=s[o];return s},U0=function(e,t,i,n){var s=t.ease||n||"power1.inOut",o,a;if(Yt(t))a=i[e]||(i[e]=[]),t.forEach(function(h,u){return a.push({t:u/(t.length-1)*100,v:h,e:s})});else for(o in t)a=i[o]||(i[o]=[]),o==="ease"||a.push({t:parseFloat(e),v:t[o],e:s})},Kr=function(e,t,i,n,s){return St(e)?e.call(t,i,n,s):kt(e)&&~e.indexOf("random(")?Vr(e):e},Ul=ia+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert",kl={};qt(Ul+",id,stagger,delay,duration,paused,scrollTrigger",function(r){return kl[r]=1});var Bt=function(r){Qu(e,r);function e(i,n,s,o){var a;typeof n=="number"&&(s.duration=n,n=s,s=null),a=r.call(this,o?n:Wr(n))||this;var h=a.vars,u=h.duration,l=h.delay,f=h.immediateRender,c=h.stagger,d=h.overwrite,v=h.keyframes,p=h.defaults,_=h.scrollTrigger,g=h.yoyoEase,y=n.parent||mt,m=(Yt(i)||il(i)?$e(i[0]):"length"in n)?[i]:ve(i),b,x,T,w,S,E,P,O;if(a._targets=m.length?ra(m):$n("GSAP target "+i+" not found. https://greensock.com",!ie.nullTargetWarn)||[],a._ptLookup=[],a._overwrite=d,v||c||qn(u)||qn(l)){if(n=a.vars,b=a.timeline=new Kt({data:"nested",defaults:p||{},targets:y&&y.data==="nested"?y.vars.targets:m}),b.kill(),b.parent=b._dp=Ke(a),b._start=0,c||qn(u)||qn(l)){if(w=m.length,P=c&&El(c),Ge(c))for(S in c)~Ul.indexOf(S)&&(O||(O={}),O[S]=c[S]);for(x=0;x<w;x++)T=es(n,kl),T.stagger=0,g&&(T.yoyoEase=g),O&&Fi(T,O),E=m[x],T.duration=+Kr(u,Ke(a),x,E,m),T.delay=(+Kr(l,Ke(a),x,E,m)||0)-a._delay,!c&&w===1&&T.delay&&(a._delay=l=T.delay,a._start+=l,T.delay=0),b.to(E,T,P?P(x,E,m):0),b._ease=it.none;b.duration()?u=l=0:a.timeline=0}else if(v){Wr(de(b.vars.defaults,{ease:"none"})),b._ease=Li(v.ease||n.ease||"none");var N=0,D,U,I;if(Yt(v))v.forEach(function(A){return b.to(m,A,">")}),b.duration();else{T={};for(S in v)S==="ease"||S==="easeEach"||U0(S,v[S],T,v.easeEach);for(S in T)for(D=T[S].sort(function(A,B){return A.t-B.t}),N=0,x=0;x<D.length;x++)U=D[x],I={ease:U.e,duration:(U.t-(x?D[x-1].t:0))/100*u},I[S]=U.v,b.to(m,I,N),N+=I.duration;b.duration()<u&&b.to({},{duration:u-b.duration()})}}u||a.duration(u=b.duration())}else a.timeline=0;return d===!0&&!Yo&&(ci=Ke(a),mt.killTweensOf(m),ci=0),Ue(y,Ke(a),s),n.reversed&&a.reverse(),n.paused&&a.paused(!0),(f||!u&&!v&&a._start===Ht(y._time)&&Zt(f)&&v0(Ke(a))&&y.data!=="nested")&&(a._tTime=-ut,a.render(Math.max(0,-l)||0)),_&&yl(Ke(a),_),a}var t=e.prototype;return t.render=function(n,s,o){var a=this._time,h=this._tDur,u=this._dur,l=n<0,f=n>h-ut&&!l?h:n<ut?0:n,c,d,v,p,_,g,y,m,b;if(!u)g0(this,n,s,o);else if(f!==this._tTime||!n||o||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==l){if(c=f,m=this.timeline,this._repeat){if(p=u+this._rDelay,this._repeat<-1&&l)return this.totalTime(p*100+n,s,o);if(c=Ht(f%p),f===h?(v=this._repeat,c=u):(v=~~(f/p),v&&v===f/p&&(c=u,v--),c>u&&(c=u)),g=this._yoyo&&v&1,g&&(b=this._yEase,c=u-c),_=sr(this._tTime,p),c===a&&!o&&this._initted)return this._tTime=f,this;v!==_&&(m&&this._yEase&&Fl(m,g),this.vars.repeatRefresh&&!g&&!this._lock&&(this._lock=o=1,this.render(Ht(p*v),!0).invalidate()._lock=0))}if(!this._initted){if(xl(this,l?n:c,o,s,f))return this._tTime=0,this;if(a!==this._time)return this;if(u!==this._dur)return this.render(n,s,o)}if(this._tTime=f,this._time=c,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=y=(b||this._ease)(c/u),this._from&&(this.ratio=y=1-y),c&&!a&&!s&&(_e(this,"onStart"),this._tTime!==f))return this;for(d=this._pt;d;)d.r(y,d.d),d=d._next;m&&m.render(n<0?n:!c&&g?-ut:m._dur*m._ease(c/this._dur),s,o)||this._startAt&&(this._zTime=n),this._onUpdate&&!s&&(l&&na(this,n,s,o),_e(this,"onUpdate")),this._repeat&&v!==_&&this.vars.onRepeat&&!s&&this.parent&&_e(this,"onRepeat"),(f===this._tDur||!f)&&this._tTime===f&&(l&&!this._onUpdate&&na(this,n,!0,!0),(n||!u)&&(f===this._tDur&&this._ts>0||!f&&this._ts<0)&&ui(this,1),!s&&!(l&&!a)&&(f||a||g)&&(_e(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,o,a){qr||se.wake(),this._ts||this.play();var h=Math.min(this._dur,(this._dp._time-this._start)*this._ts),u;return this._initted||pa(this,h),u=this._ease(h/this._dur),L0(this,n,s,o,a,u,h)?this.resetTo(n,s,o,a):(ss(this,0),this.parent||_l(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?jr(this):this;if(this.timeline){var o=this.timeline.totalDuration();return this.timeline.killTweensOf(n,s,ci&&ci.vars.overwrite!==!0)._first||jr(this),this.parent&&o!==this.timeline.totalDuration()&&or(this,this._dur*this.timeline._tDur/o,0,1),this}var a=this._targets,h=n?ve(n):a,u=this._ptLookup,l=this._pt,f,c,d,v,p,_,g;if((!s||s==="all")&&d0(a,h))return s==="all"&&(this._pt=0),jr(this);for(f=this._op=this._op||[],s!=="all"&&(kt(s)&&(p={},qt(s,function(y){return p[y]=1}),s=p),s=G0(a,s)),g=a.length;g--;)if(~h.indexOf(a[g])){c=u[g],s==="all"?(f[g]=s,v=c,d={}):(d=f[g]=f[g]||{},v=s);for(p in v)_=c&&c[p],_&&((!("kill"in _.d)||_.d.kill(p)===!0)&&is(this,_,"_pt"),delete c[p]),d!=="all"&&(d[p]=1)}return this._initted&&!this._pt&&l&&jr(this),this},e.to=function(n,s){return new e(n,s,arguments[2])},e.from=function(n,s){return zr(1,arguments)},e.delayedCall=function(n,s,o,a){return new e(s,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:n,onComplete:s,onReverseComplete:s,onCompleteParams:o,onReverseCompleteParams:o,callbackScope:a})},e.fromTo=function(n,s,o){return zr(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,o){return mt.killTweensOf(n,s,o)},e}(ur);de(Bt.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0}),qt("staggerTo,staggerFrom,staggerFromTo",function(r){Bt[r]=function(){var e=new Kt,t=oa.call(arguments,0);return t.splice(r==="staggerFromTo"?5:4,0,0),e[r].apply(e,t)}});var va=function(e,t,i){return e[t]=i},Xl=function(e,t,i){return e[t](i)},k0=function(e,t,i,n){return e[t](n.fp,i)},X0=function(e,t,i){return e.setAttribute(t,i)},_a=function(e,t){return St(e[t])?Xl:jo(e[t])&&e.setAttribute?X0:va},Hl=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e6)/1e6,t)},H0=function(e,t){return t.set(t.t,t.p,!!(t.s+t.c*e),t)},Wl=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)},ga=function(e,t){for(var i=t._pt;i;)i.r(e,i.d),i=i._next},W0=function(e,t,i,n){for(var s=this._pt,o;s;)o=s._next,s.p===n&&s.modifier(e,t,i),s=o},z0=function(e){for(var t=this._pt,i,n;t;)n=t._next,t.p===e&&!t.op||t.op===e?is(this,t,"_pt"):t.dep||(i=1),t=n;return!i},Y0=function(e,t,i,n){n.mSet(e,t,n.m.call(n.tween,i,n.mt),n)},zl=function(e){for(var t=e._pt,i,n,s,o;t;){for(i=t._next,n=s;n&&n.pr>t.pr;)n=n._next;(t._prev=n?n._prev:o)?t._prev._next=t:s=t,(t._next=n)?n._prev=t:o=t,t=i}e._pt=s},$t=function(){function r(t,i,n,s,o,a,h,u,l){this.t=i,this.s=s,this.c=o,this.p=n,this.r=a||Hl,this.d=h||this,this.set=u||va,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=Y0,this.m=i,this.mt=s,this.tween=n},r}();qt(ia+"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 Qo[r]=1}),re.TweenMax=re.TweenLite=Bt,re.TimelineLite=re.TimelineMax=Kt,mt=new Kt({sortChildren:!1,defaults:ir,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0}),ie.stringFilter=Dl;var lr=[],os={},V0=[],Yl=0,ma=function(e){return(os[e]||V0).map(function(t){return t()})},ya=function(){var e=Date.now(),t=[];e-Yl>2&&(ma("matchMediaInit"),lr.forEach(function(i){var n=i.queries,s=i.conditions,o,a,h,u;for(a in n)o=ce.matchMedia(n[a]).matches,o&&(h=1),o!==s[a]&&(s[a]=o,u=1);u&&(i.revert(),h&&t.push(i))}),ma("matchMediaRevert"),t.forEach(function(i){return i.onMatch(i)}),Yl=e,ma("matchMedia"))},Vl=function(){function r(t,i){this.selector=i&&aa(i),this.data=[],this._r=[],this.isReverted=!1,t&&this.add(t)}var e=r.prototype;return e.add=function(i,n,s){St(i)&&(s=n,n=i,i=St);var o=this,a=function(){var u=Mt,l=o.selector,f;return u&&u!==o&&u.data.push(o),s&&(o.selector=aa(s)),Mt=o,f=n.apply(o,arguments),St(f)&&o._r.push(f),Mt=u,o.selector=l,o.isReverted=!1,f};return o.last=a,i===St?a(o):i?o[i]=a:a},e.ignore=function(i){var n=Mt;Mt=null,i(this),Mt=n},e.getTweens=function(){var i=[];return this.data.forEach(function(n){return n instanceof r?i.push.apply(i,n.getTweens()):n instanceof Bt&&!(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 o=this.getTweens();this.data.forEach(function(h){h.data==="isFlip"&&(h.revert(),h.getChildren(!0,!0,!1).forEach(function(u){return o.splice(o.indexOf(u),1)}))}),o.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 ur)&&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 a=lr.indexOf(this);~a&&lr.splice(a,1)}},e.revert=function(i){this.kill(i||{})},r}(),j0=function(){function r(t){this.contexts=[],this.scope=t}var e=r.prototype;return e.add=function(i,n,s){Ge(i)||(i={matches:i});var o=new Vl(0,s||this.scope),a=o.conditions={},h,u,l;this.contexts.push(o),n=o.add("onMatch",n),o.queries=i;for(u in i)u==="all"?l=1:(h=ce.matchMedia(i[u]),h&&(lr.indexOf(o)<0&&lr.push(o),(a[u]=h.matches)&&(l=1),h.addListener?h.addListener(ya):h.addEventListener("change",ya)));return l&&n(o),this},e.revert=function(i){this.kill(i||{})},e.kill=function(i){this.contexts.forEach(function(n){return n.kill(i,!0)})},r}(),as={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 C0(n)})},timeline:function(e){return new Kt(e)},getTweensOf:function(e,t){return mt.getTweensOf(e,t)},getProperty:function(e,t,i,n){kt(e)&&(e=ve(e)[0]);var s=Ni(e||{}).get,o=i?pl:dl;return i==="native"&&(i=""),e&&(t?o((ne[t]&&ne[t].get||s)(e,t,i,n)):function(a,h,u){return o((ne[a]&&ne[a].get||s)(e,a,h,u))})},quickSetter:function(e,t,i){if(e=ve(e),e.length>1){var n=e.map(function(l){return oe.quickSetter(l,t,i)}),s=n.length;return function(l){for(var f=s;f--;)n[f](l)}}e=e[0]||{};var o=ne[t],a=Ni(e),h=a.harness&&(a.harness.aliases||{})[t]||t,u=o?function(l){var f=new o;ar._pt=0,f.init(e,i?l+i:l,ar,0,[e]),f.render(1,f),ar._pt&&ga(1,ar)}:a.set(e,h);return o?u:function(l){return u(e,h,i?l+i:l,a,1)}},quickTo:function(e,t,i){var n,s=oe.to(e,Fi((n={},n[t]="+=0.1",n.paused=!0,n),i||{})),o=function(h,u,l){return s.resetTo(t,h,u,l)};return o.tween=s,o},isTweening:function(e){return mt.getTweensOf(e,!0).length>0},defaults:function(e){return e&&e.ease&&(e.ease=Li(e.ease,ir.ease)),vl(ir,e||{})},config:function(e){return vl(ie,e||{})},registerEffect:function(e){var t=e.name,i=e.effect,n=e.plugins,s=e.defaults,o=e.extendTimeline;(n||"").split(",").forEach(function(a){return a&&!ne[a]&&!re[a]&&$n(t+" effect requires "+a+" plugin.")}),ea[t]=function(a,h,u){return i(ve(a),de(h||{},s),u)},o&&(Kt.prototype[t]=function(a,h,u){return this.add(ea[t](a,Ge(h)?h:(u=h)&&{},this),u)})},registerEase:function(e,t){it[e]=Li(t)},parseEase:function(e,t){return arguments.length?Li(e,t):it},getById:function(e){return mt.getById(e)},exportRoot:function(e,t){e===void 0&&(e={});var i=new Kt(e),n,s;for(i.smoothChildTiming=Zt(e.smoothChildTiming),mt.remove(i),i._dp=0,i._time=i._tTime=mt._time,n=mt._first;n;)s=n._next,(t||!(!n._dur&&n instanceof Bt&&n.vars.onComplete===n._targets[0]))&&Ue(i,n,n._start-n._delay),n=s;return Ue(mt,i,0),i},context:function(e,t){return e?new Vl(e,t):Mt},matchMedia:function(e){return new j0(e)},matchMediaRefresh:function(){return lr.forEach(function(e){var t=e.conditions,i,n;for(n in t)t[n]&&(t[n]=!1,i=1);i&&e.revert()})||ya()},addEventListener:function(e,t){var i=os[e]||(os[e]=[]);~i.indexOf(t)||i.push(t)},removeEventListener:function(e,t){var i=os[e],n=i&&i.indexOf(t);n>=0&&i.splice(n,1)},utils:{wrap:S0,wrapYoyo:P0,distribute:El,random:Pl,snap:Sl,normalize:E0,getUnit:Vt,clamp:x0,splitColor:Al,toArray:ve,selector:aa,mapRange:Cl,pipe:T0,unitize:w0,interpolate:R0,shuffle:wl},install:al,effects:ea,ticker:se,updateRoot:Kt.updateRoot,plugins:ne,globalTimeline:mt,core:{PropTween:$t,globals:hl,Tween:Bt,Timeline:Kt,Animation:ur,getCache:Ni,_removeLinkedListItem:is,reverting:function(){return zt},context:function(e){return e&&Mt&&(Mt.data.push(e),e._ctx=Mt),Mt},suppressOverwrites:function(e){return Yo=e}}};qt("to,from,fromTo,delayedCall,set,killTweensOf",function(r){return as[r]=Bt[r]}),se.add(Kt.updateRoot),ar=as.to({},{duration:0});var Z0=function(e,t){for(var i=e._pt;i&&i.p!==t&&i.op!==t&&i.fp!==t;)i=i._next;return i},q0=function(e,t){var i=e._targets,n,s,o;for(n in t)for(s=i.length;s--;)o=e._ptLookup[s][n],o&&(o=o.d)&&(o._pt&&(o=Z0(o,n)),o&&o.modifier&&o.modifier(t[n],e,i[s],n))},xa=function(e,t){return{name:e,rawVars:1,init:function(n,s,o){o._onInit=function(a){var h,u;if(kt(s)&&(h={},qt(s,function(l){return h[l]=1}),s=h),t){h={};for(u in s)h[u]=t(s[u]);s=h}q0(a,s)}}}},oe=as.registerPlugin({name:"attr",init:function(e,t,i,n,s){var o,a,h;this.tween=i;for(o in t)h=e.getAttribute(o)||"",a=this.add(e,"setAttribute",(h||0)+"",t[o],n,s,0,0,o),a.op=o,a.b=h,this._props.push(o)},render:function(e,t){for(var i=t._pt;i;)zt?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)}},xa("roundProps",ha),xa("modifiers"),xa("snap",Sl))||as;Bt.version=Kt.version=oe.version="3.11.4",ol=1,el()&&hr(),it.Power0,it.Power1,it.Power2,it.Power3,it.Power4,it.Linear,it.Quad,it.Cubic,it.Quart,it.Quint,it.Strong,it.Elastic,it.Back,it.SteppedEase,it.Bounce,it.Sine,it.Expo,it.Circ;var jl,di,fr,ba,Ui,Zl,Ta,K0=function(){return typeof window<"u"},Je={},ki=180/Math.PI,cr=Math.PI/180,dr=Math.atan2,ql=1e8,wa=/([A-Z])/g,$0=/(left|right|width|margin|padding|x)/i,J0=/[\s,\(]\S/,Qe={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},Ea=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e4)/1e4+t.u,t)},Q0=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)},tx=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)},ex=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)},$l=function(e,t){return t.set(t.t,t.p,e!==1?t.b:t.e,t)},ix=function(e,t,i){return e.style[t]=i},rx=function(e,t,i){return e.style.setProperty(t,i)},nx=function(e,t,i){return e._gsap[t]=i},sx=function(e,t,i){return e._gsap.scaleX=e._gsap.scaleY=i},ox=function(e,t,i,n,s){var o=e._gsap;o.scaleX=o.scaleY=i,o.renderTransform(s,o)},ax=function(e,t,i,n,s){var o=e._gsap;o[t]=i,o.renderTransform(s,o)},yt="transform",Ae=yt+"Origin",hx=function(e,t){var i=this,n=this.target,s=n.style;if(e in Je){if(this.tfm=this.tfm||{},e!=="transform"&&(e=Qe[e]||e,~e.indexOf(",")?e.split(",").forEach(function(o){return i.tfm[o]=ti(n,o)}):this.tfm[e]=n._gsap.x?n._gsap[e]:ti(n,e)),this.props.indexOf(yt)>=0)return;n._gsap.svg&&(this.svgo=n.getAttribute("data-svg-origin"),this.props.push(Ae,t,"")),e=yt}(s||t)&&this.props.push(e,t,s[e])},Jl=function(e){e.translate&&(e.removeProperty("translate"),e.removeProperty("scale"),e.removeProperty("rotate"))},ux=function(){var e=this.props,t=this.target,i=t.style,n=t._gsap,s,o;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(wa,"-$1").toLowerCase());if(this.tfm){for(o in this.tfm)n[o]=this.tfm[o];n.svg&&(n.renderTransform(),t.setAttribute("data-svg-origin",this.svgo||"")),s=Ta(),s&&!s.isStart&&!i[yt]&&(Jl(i),n.uncache=1)}},Ql=function(e,t){var i={target:e,props:[],revert:ux,save:hx};return t&&t.split(",").forEach(function(n){return i.save(n)}),i},tf,Sa=function(e,t){var i=di.createElementNS?di.createElementNS((t||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),e):di.createElement(e);return i.style?i:di.createElement(e)},ke=function r(e,t,i){var n=getComputedStyle(e);return n[t]||n.getPropertyValue(t.replace(wa,"-$1").toLowerCase())||n.getPropertyValue(t)||!i&&r(e,pr(t)||t,1)||""},ef="O,Moz,ms,Ms,Webkit".split(","),pr=function(e,t,i){var n=t||Ui,s=n.style,o=5;if(e in s&&!i)return e;for(e=e.charAt(0).toUpperCase()+e.substr(1);o--&&!(ef[o]+e in s););return o<0?null:(o===3?"ms":o>=0?ef[o]:"")+e},Pa=function(){K0()&&window.document&&(jl=window,di=jl.document,fr=di.documentElement,Ui=Sa("div")||{style:{}},Sa("div"),yt=pr(yt),Ae=yt+"Origin",Ui.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",tf=!!pr("perspective"),Ta=oe.core.reverting,ba=1)},Ra=function r(e){var t=Sa("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),i=this.parentNode,n=this.nextSibling,s=this.style.cssText,o;if(fr.appendChild(t),t.appendChild(this),this.style.display="block",e)try{o=this.getBBox(),this._gsapBBox=this.getBBox,this.getBBox=r}catch{}else this._gsapBBox&&(o=this._gsapBBox());return i&&(n?i.insertBefore(this,n):i.appendChild(this)),fr.removeChild(t),this.style.cssText=s,o},rf=function(e,t){for(var i=t.length;i--;)if(e.hasAttribute(t[i]))return e.getAttribute(t[i])},nf=function(e){var t;try{t=e.getBBox()}catch{t=Ra.call(e,!0)}return t&&(t.width||t.height)||e.getBBox===Ra||(t=Ra.call(e,!0)),t&&!t.width&&!t.x&&!t.y?{x:+rf(e,["x","cx","x1"])||0,y:+rf(e,["y","cy","y1"])||0,width:0,height:0}:t},sf=function(e){return!!(e.getCTM&&(!e.parentNode||e.ownerSVGElement)&&nf(e))},$r=function(e,t){if(t){var i=e.style;t in Je&&t!==Ae&&(t=yt),i.removeProperty?((t.substr(0,2)==="ms"||t.substr(0,6)==="webkit")&&(t="-"+t),i.removeProperty(t.replace(wa,"-$1").toLowerCase())):i.removeAttribute(t)}},pi=function(e,t,i,n,s,o){var a=new $t(e._pt,t,i,0,1,o?$l:Kl);return e._pt=a,a.b=n,a.e=s,e._props.push(i),a},of={deg:1,rad:1,turn:1},lx={grid:1,flex:1},vi=function r(e,t,i,n){var s=parseFloat(i)||0,o=(i+"").trim().substr((s+"").length)||"px",a=Ui.style,h=$0.test(t),u=e.tagName.toLowerCase()==="svg",l=(u?"client":"offset")+(h?"Width":"Height"),f=100,c=n==="px",d=n==="%",v,p,_,g;return n===o||!s||of[n]||of[o]?s:(o!=="px"&&!c&&(s=r(e,t,i,"px")),g=e.getCTM&&sf(e),(d||o==="%")&&(Je[t]||~t.indexOf("adius"))?(v=g?e.getBBox()[h?"width":"height"]:e[l],At(d?s/v*f:s/100*v)):(a[h?"width":"height"]=f+(c?o:n),p=~t.indexOf("adius")||n==="em"&&e.appendChild&&!u?e:e.parentNode,g&&(p=(e.ownerSVGElement||{}).parentNode),(!p||p===di||!p.appendChild)&&(p=di.body),_=p._gsap,_&&d&&_.width&&h&&_.time===se.time&&!_.uncache?At(s/_.width*f):((d||o==="%")&&!lx[ke(p,"display")]&&(a.position=ke(e,"position")),p===e&&(a.position="static"),p.appendChild(Ui),v=Ui[l],p.removeChild(Ui),a.position="absolute",h&&d&&(_=Ni(p),_.time=se.time,_.width=p[l]),At(c?v*s/f:v&&s?f/v*s:0))))},ti=function(e,t,i,n){var s;return ba||Pa(),t in Qe&&t!=="transform"&&(t=Qe[t],~t.indexOf(",")&&(t=t.split(",")[0])),Je[t]&&t!=="transform"?(s=Qr(e,n),s=t!=="transformOrigin"?s[t]:s.svg?s.origin:us(ke(e,Ae))+" "+s.zOrigin+"px"):(s=e.style[t],(!s||s==="auto"||n||~(s+"").indexOf("calc("))&&(s=hs[t]&&hs[t](e,t,i)||ke(e,t)||fl(e,t)||(t==="opacity"?1:0))),i&&!~(s+"").trim().indexOf(" ")?vi(e,t,s,i)+i:s},fx=function(e,t,i,n){if(!i||i==="none"){var s=pr(t,e,1),o=s&&ke(e,s,1);o&&o!==i?(t=s,i=o):t==="borderColor"&&(i=ke(e,"borderTopColor"))}var a=new $t(this._pt,e.style,t,0,1,Wl),h=0,u=0,l,f,c,d,v,p,_,g,y,m,b,x;if(a.b=i,a.e=n,i+="",n+="",n==="auto"&&(e.style[t]=n,n=ke(e,t)||n,e.style[t]=i),l=[i,n],Dl(l),i=l[0],n=l[1],c=i.match(rr)||[],x=n.match(rr)||[],x.length){for(;f=rr.exec(n);)_=f[0],y=n.substring(h,f.index),v?v=(v+1)%5:(y.substr(-5)==="rgba("||y.substr(-5)==="hsla(")&&(v=1),_!==(p=c[u++]||"")&&(d=parseFloat(p)||0,b=p.substr((d+"").length),_.charAt(1)==="="&&(_=nr(d,_)+b),g=parseFloat(_),m=_.substr((g+"").length),h=rr.lastIndex-m.length,m||(m=m||ie.units[t]||b,h===n.length&&(n+=m,a.e+=m)),b!==m&&(d=vi(e,t,p,m)||0),a._pt={_next:a._pt,p:y||u===1?y:",",s:d,c:g-d,m:v&&v<4||t==="zIndex"?Math.round:0});a.c=h<n.length?n.substring(h,n.length):""}else a.r=t==="display"&&n==="none"?$l:Kl;return nl.test(n)&&(a.e=0),this._pt=a,a},af={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},cx=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]=af[i]||i,t[1]=af[n]||n,t.join(" ")},dx=function(e,t){if(t.tween&&t.tween._time===t.tween._dur){var i=t.t,n=i.style,s=t.u,o=i._gsap,a,h,u;if(s==="all"||s===!0)n.cssText="",h=1;else for(s=s.split(","),u=s.length;--u>-1;)a=s[u],Je[a]&&(h=1,a=a==="transformOrigin"?Ae:yt),$r(i,a);h&&($r(i,yt),o&&(o.svg&&i.removeAttribute("transform"),Qr(i,1),o.uncache=1,Jl(n)))}},hs={clearProps:function(e,t,i,n,s){if(s.data!=="isFromStart"){var o=e._pt=new $t(e._pt,t,i,0,0,dx);return o.u=n,o.pr=-10,o.tween=s,e._props.push(i),1}}},Jr=[1,0,0,1,0,0],hf={},uf=function(e){return e==="matrix(1, 0, 0, 1, 0, 0)"||e==="none"||!e},lf=function(e){var t=ke(e,yt);return uf(t)?Jr:t.substr(7).match(rl).map(At)},Ca=function(e,t){var i=e._gsap||Ni(e),n=e.style,s=lf(e),o,a,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"?Jr:s):(s===Jr&&!e.offsetParent&&e!==fr&&!i.svg&&(h=n.display,n.display="block",o=e.parentNode,(!o||!e.offsetParent)&&(u=1,a=e.nextElementSibling,fr.appendChild(e)),s=lf(e),h?n.display=h:$r(e,"display"),u&&(a?o.insertBefore(e,a):o?o.appendChild(e):fr.removeChild(e))),t&&s.length>6?[s[0],s[1],s[4],s[5],s[12],s[13]]:s)},Oa=function(e,t,i,n,s,o){var a=e._gsap,h=s||Ca(e,!0),u=a.xOrigin||0,l=a.yOrigin||0,f=a.xOffset||0,c=a.yOffset||0,d=h[0],v=h[1],p=h[2],_=h[3],g=h[4],y=h[5],m=t.split(" "),b=parseFloat(m[0])||0,x=parseFloat(m[1])||0,T,w,S,E;i?h!==Jr&&(w=d*_-v*p)&&(S=b*(_/w)+x*(-p/w)+(p*y-_*g)/w,E=b*(-v/w)+x*(d/w)-(d*y-v*g)/w,b=S,x=E):(T=nf(e),b=T.x+(~m[0].indexOf("%")?b/100*T.width:b),x=T.y+(~(m[1]||m[0]).indexOf("%")?x/100*T.height:x)),n||n!==!1&&a.smooth?(g=b-u,y=x-l,a.xOffset=f+(g*d+y*p)-g,a.yOffset=c+(g*v+y*_)-y):a.xOffset=a.yOffset=0,a.xOrigin=b,a.yOrigin=x,a.smooth=!!n,a.origin=t,a.originIsAbsolute=!!i,e.style[Ae]="0px 0px",o&&(pi(o,a,"xOrigin",u,b),pi(o,a,"yOrigin",l,x),pi(o,a,"xOffset",f,a.xOffset),pi(o,a,"yOffset",c,a.yOffset)),e.setAttribute("data-svg-origin",b+" "+x)},Qr=function(e,t){var i=e._gsap||new Ll(e);if("x"in i&&!t&&!i.uncache)return i;var n=e.style,s=i.scaleX<0,o="px",a="deg",h=getComputedStyle(e),u=ke(e,Ae)||"0",l,f,c,d,v,p,_,g,y,m,b,x,T,w,S,E,P,O,N,D,U,I,A,B,K,z,M,C,G,tt,V,nt;return l=f=c=p=_=g=y=m=b=0,d=v=1,i.svg=!!(e.getCTM&&sf(e)),h.translate&&((h.translate!=="none"||h.scale!=="none"||h.rotate!=="none")&&(n[yt]=(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[yt]!=="none"?h[yt]:"")),n.scale=n.rotate=n.translate="none"),w=Ca(e,i.svg),i.svg&&(i.uncache?(K=e.getBBox(),u=i.xOrigin-K.x+"px "+(i.yOrigin-K.y)+"px",B=""):B=!t&&e.getAttribute("data-svg-origin"),Oa(e,B||u,!!B||i.originIsAbsolute,i.smooth!==!1,w)),x=i.xOrigin||0,T=i.yOrigin||0,w!==Jr&&(O=w[0],N=w[1],D=w[2],U=w[3],l=I=w[4],f=A=w[5],w.length===6?(d=Math.sqrt(O*O+N*N),v=Math.sqrt(U*U+D*D),p=O||N?dr(N,O)*ki:0,y=D||U?dr(D,U)*ki+p:0,y&&(v*=Math.abs(Math.cos(y*cr))),i.svg&&(l-=x-(x*O+T*D),f-=T-(x*N+T*U))):(nt=w[6],tt=w[7],M=w[8],C=w[9],G=w[10],V=w[11],l=w[12],f=w[13],c=w[14],S=dr(nt,G),_=S*ki,S&&(E=Math.cos(-S),P=Math.sin(-S),B=I*E+M*P,K=A*E+C*P,z=nt*E+G*P,M=I*-P+M*E,C=A*-P+C*E,G=nt*-P+G*E,V=tt*-P+V*E,I=B,A=K,nt=z),S=dr(-D,G),g=S*ki,S&&(E=Math.cos(-S),P=Math.sin(-S),B=O*E-M*P,K=N*E-C*P,z=D*E-G*P,V=U*P+V*E,O=B,N=K,D=z),S=dr(N,O),p=S*ki,S&&(E=Math.cos(S),P=Math.sin(S),B=O*E+N*P,K=I*E+A*P,N=N*E-O*P,A=A*E-I*P,O=B,I=K),_&&Math.abs(_)+Math.abs(p)>359.9&&(_=p=0,g=180-g),d=At(Math.sqrt(O*O+N*N+D*D)),v=At(Math.sqrt(A*A+nt*nt)),S=dr(I,A),y=Math.abs(S)>2e-4?S*ki:0,b=V?1/(V<0?-V:V):0),i.svg&&(B=e.getAttribute("transform"),i.forceCSS=e.setAttribute("transform","")||!uf(ke(e,yt)),B&&e.setAttribute("transform",B))),Math.abs(y)>90&&Math.abs(y)<270&&(s?(d*=-1,y+=p<=0?180:-180,p+=p<=0?180:-180):(v*=-1,y+=y<=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)+o,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)+o,i.z=c+o,i.scaleX=At(d),i.scaleY=At(v),i.rotation=At(p)+a,i.rotationX=At(_)+a,i.rotationY=At(g)+a,i.skewX=y+a,i.skewY=m+a,i.transformPerspective=b+o,(i.zOrigin=parseFloat(u.split(" ")[2])||0)&&(n[Ae]=us(u)),i.xOffset=i.yOffset=0,i.force3D=ie.force3D,i.renderTransform=i.svg?vx:tf?ff:px,i.uncache=0,i},us=function(e){return(e=e.split(" "))[0]+" "+e[1]},Aa=function(e,t,i){var n=Vt(t);return At(parseFloat(t)+parseFloat(vi(e,"x",i+"px",n)))+n},px=function(e,t){t.z="0px",t.rotationY=t.rotationX="0deg",t.force3D=0,ff(e,t)},Xi="0deg",tn="0px",Hi=") ",ff=function(e,t){var i=t||this,n=i.xPercent,s=i.yPercent,o=i.x,a=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,g=i.force3D,y=i.target,m=i.zOrigin,b="",x=g==="auto"&&e&&e!==1||g===!0;if(m&&(f!==Xi||l!==Xi)){var T=parseFloat(l)*cr,w=Math.sin(T),S=Math.cos(T),E;T=parseFloat(f)*cr,E=Math.cos(T),o=Aa(y,o,w*E*-m),a=Aa(y,a,-Math.sin(T)*-m),h=Aa(y,h,S*E*-m+m)}_!==tn&&(b+="perspective("+_+Hi),(n||s)&&(b+="translate("+n+"%, "+s+"%) "),(x||o!==tn||a!==tn||h!==tn)&&(b+=h!==tn||x?"translate3d("+o+", "+a+", "+h+") ":"translate("+o+", "+a+Hi),u!==Xi&&(b+="rotate("+u+Hi),l!==Xi&&(b+="rotateY("+l+Hi),f!==Xi&&(b+="rotateX("+f+Hi),(c!==Xi||d!==Xi)&&(b+="skew("+c+", "+d+Hi),(v!==1||p!==1)&&(b+="scale("+v+", "+p+Hi),y.style[yt]=b||"translate(0, 0)"},vx=function(e,t){var i=t||this,n=i.xPercent,s=i.yPercent,o=i.x,a=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,g=i.yOffset,y=i.forceCSS,m=parseFloat(o),b=parseFloat(a),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*=cr,u*=cr,x=Math.cos(h)*f,T=Math.sin(h)*f,w=Math.sin(h-u)*-c,S=Math.cos(h-u)*c,u&&(l*=cr,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=At(x),T=At(T),w=At(w),S=At(S)):(x=f,S=c,T=w=0),(m&&!~(o+"").indexOf("px")||b&&!~(a+"").indexOf("px"))&&(m=vi(d,"x",o,"px"),b=vi(d,"y",a,"px")),(v||p||_||g)&&(m=At(m+v-(v*x+p*w)+_),b=At(b+p-(v*T+p*S)+g)),(n||s)&&(E=d.getBBox(),m=At(m+n/100*E.width),b=At(b+s/100*E.height)),E="matrix("+x+","+T+","+w+","+S+","+m+","+b+")",d.setAttribute("transform",E),y&&(d.style[yt]=E)},_x=function(e,t,i,n,s){var o=360,a=kt(s),h=parseFloat(s)*(a&&~s.indexOf("rad")?ki:1),u=h-n,l=n+u+"deg",f,c;return a&&(f=s.split("_")[1],f==="short"&&(u%=o,u!==u%(o/2)&&(u+=u<0?o:-o)),f==="cw"&&u<0?u=(u+o*ql)%o-~~(u/o)*o:f==="ccw"&&u>0&&(u=(u-o*ql)%o-~~(u/o)*o)),e._pt=c=new $t(e._pt,t,i,n,u,Q0),c.e=l,c.u="deg",e._props.push(i),c},cf=function(e,t){for(var i in t)e[i]=t[i];return e},gx=function(e,t,i){var n=cf({},i._gsap),s="perspective,force3D,transformOrigin,svgOrigin",o=i.style,a,h,u,l,f,c,d,v;n.svg?(u=i.getAttribute("transform"),i.setAttribute("transform",""),o[yt]=t,a=Qr(i,1),$r(i,yt),i.setAttribute("transform",u)):(u=getComputedStyle(i)[yt],o[yt]=t,a=Qr(i,1),o[yt]=u);for(h in Je)u=n[h],l=a[h],u!==l&&s.indexOf(h)<0&&(d=Vt(u),v=Vt(l),f=d!==v?vi(i,h,u,v):parseFloat(u),c=parseFloat(l),e._pt=new $t(e._pt,a,h,f,c-f,Ea),e._pt.u=v||0,e._props.push(h));cf(a,n)};qt("padding,margin,Width,Radius",function(r,e){var t="Top",i="Right",n="Bottom",s="Left",o=(e<3?[t,i,n,s]:[t+s,t+i,n+i,n+s]).map(function(a){return e<2?r+a:"border"+a+r});hs[e>1?"border"+r:r]=function(a,h,u,l,f){var c,d;if(arguments.length<4)return c=o.map(function(v){return ti(a,v,u)}),d=c.join(" "),d.split(c[0]).length===5?c[0]:d;c=(l+"").split(" "),d={},o.forEach(function(v,p){return d[v]=c[p]=c[p]||c[(p-1)/2|0]}),a.init(h,d,f)}});var df={name:"css",register:Pa,targetTest:function(e){return e.style&&e.nodeType},init:function(e,t,i,n,s){var o=this._props,a=e.style,h=i.vars.startAt,u,l,f,c,d,v,p,_,g,y,m,b,x,T,w,S;ba||Pa(),this.styles=this.styles||Ql(e),S=this.styles.props,this.tween=i;for(p in t)if(p!=="autoRound"&&(l=t[p],!(ne[p]&&Gl(p,t,i,n,e,s)))){if(d=typeof l,v=hs[p],d==="function"&&(l=l.call(i,n,e,s),d=typeof l),d==="string"&&~l.indexOf("random(")&&(l=Vr(l)),v)v(this,e,p,l,i)&&(w=1);else if(p.substr(0,2)==="--")u=(getComputedStyle(e).getPropertyValue(p)+"").trim(),l+="",fi.lastIndex=0,fi.test(u)||(_=Vt(u),g=Vt(l)),g?_!==g&&(u=vi(e,p,u,g)+g):_&&(l+=_),this.add(a,"setProperty",u,l,n,s,0,0,p),o.push(p),S.push(p,0,a[p]);else if(d!=="undefined"){if(h&&p in h?(u=typeof h[p]=="function"?h[p].call(i,n,e,s):h[p],kt(u)&&~u.indexOf("random(")&&(u=Vr(u)),Vt(u+"")||(u+=ie.units[p]||Vt(ti(e,p))||""),(u+"").charAt(1)==="="&&(u=ti(e,p))):u=ti(e,p),c=parseFloat(u),y=d==="string"&&l.charAt(1)==="="&&l.substr(0,2),y&&(l=l.substr(2)),f=parseFloat(l),p in Qe&&(p==="autoAlpha"&&(c===1&&ti(e,"visibility")==="hidden"&&f&&(c=0),S.push("visibility",0,a.visibility),pi(this,a,"visibility",c?"inherit":"hidden",f?"inherit":"hidden",!f)),p!=="scale"&&p!=="transform"&&(p=Qe[p],~p.indexOf(",")&&(p=p.split(",")[0]))),m=p in Je,m){if(this.styles.save(p),b||(x=e._gsap,x.renderTransform&&!t.parseTransform||Qr(e,t.parseTransform),T=t.smoothOrigin!==!1&&x.smooth,b=this._pt=new $t(this._pt,a,yt,0,1,x.renderTransform,x,0,-1),b.dep=1),p==="scale")this._pt=new $t(this._pt,x,"scaleY",x.scaleY,(y?nr(x.scaleY,y+f):f)-x.scaleY||0,Ea),this._pt.u=0,o.push("scaleY",p),p+="X";else if(p==="transformOrigin"){S.push(Ae,0,a[Ae]),l=cx(l),x.svg?Oa(e,l,0,T,0,this):(g=parseFloat(l.split(" ")[2])||0,g!==x.zOrigin&&pi(this,x,"zOrigin",x.zOrigin,g),pi(this,a,p,us(u),us(l)));continue}else if(p==="svgOrigin"){Oa(e,l,1,T,0,this);continue}else if(p in hf){_x(this,x,p,c,y?nr(c,y+l):l);continue}else if(p==="smoothOrigin"){pi(this,x,"smooth",x.smooth,l);continue}else if(p==="force3D"){x[p]=l;continue}else if(p==="transform"){gx(this,l,e);continue}}else p in a||(p=pr(p)||p);if(m||(f||f===0)&&(c||c===0)&&!J0.test(l)&&p in a)_=(u+"").substr((c+"").length),f||(f=0),g=Vt(l)||(p in ie.units?ie.units[p]:_),_!==g&&(c=vi(e,p,u,g)),this._pt=new $t(this._pt,m?x:a,p,c,(y?nr(c,y+f):f)-c,!m&&(g==="px"||p==="zIndex")&&t.autoRound!==!1?ex:Ea),this._pt.u=g||0,_!==g&&g!=="%"&&(this._pt.b=u,this._pt.r=tx);else if(p in a)fx.call(this,e,p,u,y?y+l:l);else if(p in e)this.add(e,p,u||e[p],y?y+l:l,n,s);else if(p!=="parseTransform"){Jo(p,l);continue}m||(p in a?S.push(p,0,a[p]):S.push(p,1,u||e[p])),o.push(p)}}w&&zl(this)},render:function(e,t){if(t.tween._time||!Ta())for(var i=t._pt;i;)i.r(e,i.d),i=i._next;else t.styles.revert()},get:ti,aliases:Qe,getSetter:function(e,t,i){var n=Qe[t];return n&&n.indexOf(",")<0&&(t=n),t in Je&&t!==Ae&&(e._gsap.x||ti(e,"x"))?i&&Zl===i?t==="scale"?sx:nx:(Zl=i||{})&&(t==="scale"?ox:ax):e.style&&!jo(e.style[t])?ix:~t.indexOf("-")?rx:_a(e,t)},core:{_removeProperty:$r,_getMatrix:Ca}};oe.utils.checkPrefix=pr,oe.core.getStyleSaver=Ql,function(r,e,t,i){var n=qt(r+","+e+","+t,function(s){Je[s]=1});qt(e,function(s){ie.units[s]="deg",hf[s]=1}),Qe[n[13]]=r+","+e,qt(i,function(s){var o=s.split(":");Qe[o[1]]=n[o[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"),qt("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(r){ie.units[r]="px"}),oe.registerPlugin(df);var ae=oe.registerPlugin(df)||oe;ae.core.Tween;const pf=.2,vf="power2.out";class Ia extends ht{constructor({graphState:t,width:i,height:n,borderRadius:s,borderColor:o,borderWidth:a}){super();R(this,"graphState");R(this,"rectWidth");R(this,"rectHeight");R(this,"borderRadius");R(this,"borderColor");R(this,"borderWidth");R(this,"topLeft");R(this,"topRight");R(this,"bottomRight");R(this,"bottomLeft");R(this,"topEdge");R(this,"rightEdge");R(this,"bottomEdge");R(this,"leftEdge");this.graphState=t,this.rectWidth=i,this.rectHeight=n,this.borderRadius=s,this.borderColor=o,this.borderWidth=a,this.initRect()}initRect(){const{borderRadius:t,borderColor:i,borderWidth:n}=this,{pixiApp:s}=this.graphState,{corner:o,edge:a}=r0({pixiApp:s,borderRadius:t,borderColor:i,borderWidth:n});this.topLeft=new ct(o),this.topRight=new ct(o),this.topRight.position.set(this.rectWidth,0),this.topRight.rotation=Math.PI/2,this.bottomRight=new ct(o),this.bottomRight.position.set(this.rectWidth,this.rectHeight),this.bottomRight.rotation=Math.PI,this.bottomLeft=new ct(o),this.bottomLeft.position.set(0,this.rectHeight),this.bottomLeft.rotation=Math.PI*1.5,this.topEdge=new ct(a),this.topEdge.position.set(this.borderRadius,0),this.topEdge.width=this.rectWidth-this.borderRadius*2,this.topEdge.height=n,this.rightEdge=new ct(a),this.rightEdge.position.set(this.rectWidth-this.borderWidth,this.borderRadius),this.rightEdge.height=this.rectHeight-this.borderRadius*2,this.rightEdge.width=n,this.bottomEdge=new ct(a),this.bottomEdge.position.set(this.borderRadius,this.rectHeight-this.borderWidth),this.bottomEdge.width=this.rectWidth-this.borderRadius*2,this.bottomEdge.height=n,this.leftEdge=new ct(a),this.leftEdge.position.set(0,this.borderRadius),this.leftEdge.height=this.rectHeight-this.borderRadius*2,this.leftEdge.width=n,this.addChild(this.topLeft),this.addChild(this.topRight),this.addChild(this.bottomRight),this.addChild(this.bottomLeft),this.addChild(this.topEdge),this.addChild(this.rightEdge),this.addChild(this.bottomEdge),this.addChild(this.leftEdge),this.resize({width:this.rectWidth,height:this.rectHeight})}resize({width:t,height:i,animate:n}){const{topRight:s,bottomRight:o,bottomLeft:a,topEdge:h,rightEdge:u,bottomEdge:l,leftEdge:f}=this;this.scale.x=1,this.rectWidth=t,this.rectHeight=i;const c=this.borderRadius*2,v=t<c?c:t;if(t<c&&(this.scale.x=t/c),!n||this.graphState.suppressMotion.value){s.position.x=v,o.position.set(v,this.rectHeight),a.position.y=this.rectHeight,h.width=v-c,u.height=this.rectHeight-c,u.position.x=v-this.borderWidth,l.width=v-c,l.position.y=this.rectHeight-this.borderWidth,f.height=this.rectHeight-c;return}const p={duration:pf,ease:vf};ae.to(s,{x:v,...p}),ae.to(o,{x:v,y:this.rectHeight,...p}),ae.to(a,{y:this.rectHeight,...p}),ae.to(h,{width:v-c,...p}),ae.to(u,{height:this.rectHeight-c,x:v-this.borderWidth,...p}),ae.to(l,{width:v-c,y:this.rectHeight-this.borderWidth,...p}),ae.to(f,{height:this.rectHeight-c,...p})}killTweens(){const{topRight:t,bottomRight:i,bottomLeft:n,topEdge:s,rightEdge:o,bottomEdge:a,leftEdge:h}=this;ae.killTweensOf([t,i,n,s,o,a,h])}destroy(){this.killTweens(),super.destroy.call(this)}}const _f=64,ls=20;class mx extends ht{constructor({sourceNode:t,targetNode:i,graphState:n}){super();R(this,"sourceNode");R(this,"targetNode");R(this,"graphState");R(this,"sourceX",0);R(this,"sourceY",0);R(this,"targetX",0);R(this,"targetY",0);R(this,"sourceControlPointX",0);R(this,"sourceControlPointY",0);R(this,"targetControlPointX",0);R(this,"targetControlPointY",0);R(this,"edgePoints");R(this,"edge");R(this,"arrow",new ht);R(this,"unWatchers",[]);R(this,"getXBezier",(t,i)=>{const{sourceX:n,targetX:s}=this,o=(s-n)/2;return t+(o>_f?o:_f)*(i?-1:1)});R(this,"getPointBezierPosition",t=>{const{sourceX:i,sourceY:n,targetX:s,targetY:o,sourceControlPointX:a,sourceControlPointY:h,targetControlPointX:u,targetControlPointY:l}=this,f=i+(a-i)*t,c=n+(h-n)*t,d=a+(u-a)*t,v=h+(l-h)*t,p=u+(s-u)*t,_=l+(o-l)*t,g=f+(d-f)*t,y=c+(v-c)*t,m=d+(p-d)*t,b=v+(_-v)*t,x=g+(m-g)*t,T=y+(b-y)*t;return{x,y:T}});this.sourceNode=t,this.targetNode=i,this.graphState=n,this.assignBezierPositions(),this.edgePoints=this.initEdgePoints(),this.edge=this.initEdge(),this.addChild(this.edge),this.drawArrow(),this.addChild(this.arrow),this.initCulling(),this.initWatchers()}initCulling(){const{cull:t}=this.graphState;t.add(this.arrow)}initWatchers(){const{styleOptions:t,viewport:i}=this.graphState;this.unWatchers.push(W.watch([t],()=>{this.updateStyle()},{deep:!0})),i.on("frame-end",()=>{this.sourceNode.destroyed||this.targetNode.destroyed||this.hasEdgeChanged()&&this.update()})}assignBezierPositions(){this.sourceX=this.getSourceX(),this.sourceY=this.getNodeY(this.sourceNode),this.targetX=this.targetNode.x,this.targetY=this.getNodeY(this.targetNode),this.sourceControlPointX=this.getXBezier(this.sourceX),this.sourceControlPointY=this.sourceY,this.targetControlPointX=this.getXBezier(this.targetX,!0),this.targetControlPointY=this.targetY}initEdge(){const{spacingEdgeWidth:t}=this.graphState.styleOptions.value,i=this.getEdgeTexture();return new Vy(i,this.edgePoints,t/Ho)}initEdgePoints(){const t=[];for(let s=0;s<ls;s++){const o=s===ls-1?{x:this.targetX,y:this.targetY}:this.getPointBezierPosition(s/ls);t.push(new j(o.x,o.y))}const i=this.getTargetAnchorPointPosition(),n=new j(i.x,i.y);return t.push(n),t}drawArrow(){const{arrow:t,targetX:i,targetY:n}=this,{pixiApp:s,styleOptions:o}=this.graphState,{colorEdge:a,spacingEdgeWidth:h,spacingNodeEdgeLength:u}=o.value,l=Ju({pixiApp:s,strokeColor:a,edgeWidth:h,edgeLength:u}),f=new ct(l);f.anchor.set(1,.5),t.addChild(f),t.position.set(i,n)}update(){this.assignBezierPositions(),this.arrow.position.set(this.targetX,this.targetY),this.edgePoints.forEach((t,i)=>{const n=i===this.edgePoints.length-1?this.getTargetAnchorPointPosition():this.getPointBezierPosition(i/ls);t.set(n.x,n.y)})}updateStyle(){this.arrow.removeChildren(),this.drawArrow(),this.edge.texture=this.getEdgeTexture()}hasEdgeChanged(){const t=this.getSourceX(),i=this.getNodeY(this.sourceNode),n=this.targetNode.x,s=this.getNodeY(this.targetNode);return t!==this.sourceX||i!==this.sourceY||n!==this.targetX||s!==this.targetY}getSourceX(){return this.sourceNode.x+this.sourceNode.getChildByName(Na).getLocalBounds().width}getNodeY(t){return t.y+t.getChildByName(Na).getLocalBounds().height/2}getEdgeTexture(){const{pixiApp:t,styleOptions:i}=this.graphState,{colorEdge:n}=i.value;return Xr({pixiApp:t,fill:n})}getTargetAnchorPointPosition(){return{x:this.targetX-2,y:this.targetY}}destroy(){const{cull:t}=this.graphState;t.remove(this.arrow),this.unWatchers.forEach(i=>i()),super.destroy.call(this)}}class yx extends ht{constructor({appRef:t,labelText:i,styles:n,cull:s}){super();R(this,"appRef");R(this,"labelText");R(this,"styles");R(this,"cull");R(this,"guideLine");R(this,"label");s.add(this),this.appRef=t,this.labelText=i,this.styles=n,this.cull=s,this.initGuideLine(),this.drawLabel(),this.interactive=!1}initGuideLine(){const{appRef:t}=this,{colorGuideLine:i}=this.styles.value,n=Xr({pixiApp:t,fill:i});this.guideLine=new ct(n),this.guideLine.width=1,this.guideLine.height=t.screen.height,this.addChild(this.guideLine)}async drawLabel(){var t;if(this.labelText){const i=await jn(this.styles.value),{spacingGuideLabelPadding:n}=this.styles.value;(t=this.label)==null||t.destroy(),this.label=new Do(this.labelText,i.timeMarkerLabel),this.label.position.set(n,n),this.addChild(this.label)}}updateHeight(t){this.guideLine.height=t}destroy(){this.cull.remove(this),super.destroy()}}let he;const xx=({minimumStartTime:r,graphXDomain:e,initialOverallTimeSpan:t})=>({dateToX:Tx(r,e,t),xToDate:wx(r,e,t)}),bx=({minimumStartTime:r,graphXDomain:e,initialOverallTimeSpan:t})=>(he=xx({minimumStartTime:r,graphXDomain:e,initialOverallTimeSpan:t}),he);function Tx(r,e,t){return function(i){return Math.ceil((i.getTime()-r)*(e/t))}}function wx(r,e,t){return function(i){return Math.ceil(r+i*(t/e))}}const Ex=260,Ma=4e3;class Sx extends ht{constructor({viewportRef:t,appRef:i,cull:n,minimumStartDate:s,maximumEndDate:o,isRunning:a,styleOptions:h,formatDateFns:u}){super();R(this,"viewportRef");R(this,"appRef");R(this,"cull");R(this,"minimumStartDate");R(this,"maximumEndDate");R(this,"isRunning");R(this,"styleOptions");R(this,"formatDateFns");R(this,"unwatch");R(this,"idealGuideCount",10);R(this,"currentTimeGap",120);R(this,"labelFormatter",t=>t.toLocaleTimeString());R(this,"guides",new Map);this.viewportRef=t,this.appRef=i,this.cull=n,this.minimumStartDate=s,this.maximumEndDate=o,this.isRunning=a,this.styleOptions=h,this.formatDateFns=u,this.updateIdealGuideCount(),this.updateCurrentTimeGap(),this.createGuides(),this.unwatch=W.watch(h,()=>{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/Ex)}updateCurrentTimeGap(){const t=Math.ceil((this.viewportRef.right-this.viewportRef.left)/this.idealGuideCount),i=he.xToDate(t)-this.minimumStartDate.getTime(),n=Xa.find(s=>s.ceiling>i)??Xa[0];this.currentTimeGap=n.span,this.setLabelFormatter(n.labelFormat)}createGuides(){let t;const i=he.xToDate(he.dateToX(this.maximumEndDate.value??new Date)+Ma);let n=new Date(Math.ceil(he.xToDate(-Ma)/this.currentTimeGap)*this.currentTimeGap);for(this.currentTimeGap>et.hour*6?n=qf(n):this.currentTimeGap>et.hour&&(n=Kf(n)),t=n;t.getTime()<i;){const s=new yx({appRef:this.appRef,labelText:this.labelFormatter(t),styles:this.styleOptions,cull:this.cull});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 he.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 Nt.minutes:this.labelFormatter=this.formatByMinutesWithDates;break;case Nt.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)+Ma*this.viewportRef.scale._x-he.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)}}const Jt={nodeDetails:"nodeDetailsClick",subNodesToggle:"subNodesToggleClick"},Da="nodeResize",gf={fadeIn:.25,move:.5},Na="box",Px=.2;class Rx extends ht{constructor({nodeData:t,graphState:i,layout:n,layoutRows:s}){super();R(this,"nodeData");R(this,"graphState");R(this,"layout");R(this,"layoutRows");R(this,"currentState");R(this,"hasSubNodes",!1);R(this,"isRunningNode",!1);R(this,"runningNodeTicker",null);R(this,"unWatchers",[]);R(this,"positionInitialized",!1);R(this,"nodeWidth");R(this,"nodeHeight");R(this,"boxCapWidth",0);R(this,"box",new ht);R(this,"leftBoxCap");R(this,"rightBoxCap");R(this,"boxBody");R(this,"subNodesToggle");R(this,"subNodesToggleWidth",0);R(this,"isSubNodesToggleFloating",!1);R(this,"label");R(this,"apxLabelWidth",0);R(this,"isLabelInBox",!0);R(this,"isSubNodesExpanded",!1);R(this,"subNodesOutlineContainer",new ht);R(this,"subNodesOutline");R(this,"subNodesContent");R(this,"subNodesHeight",0);R(this,"subNodesContentTicker",null);R(this,"isSelected",!1);R(this,"selectedRing");R(this,"initializePosition",()=>{this.positionInitialized=!0,this.updatePosition({skipAnimation:!0,includeXPos:!0})});this.interactive=!1,this.nodeData=t,this.graphState=i,this.layout=n,this.layoutRows=s,this.currentState=t.state.toString(),this.hasSubNodes=t.subFlowRunId!==void 0,this.updateIsRunningNode(),this.boxCapWidth=i.styleOptions.value.borderRadiusNode,this.nodeWidth=this.getNodeWidth(),this.nodeHeight=this.getNodeHeight(),this.addChild(this.subNodesOutlineContainer),this.drawSubNodesOutline(),this.initBox(),this.initSubNodesToggle(),this.drawLabel(),this.initSelectedRing(),this.initWatchers()}initWatchers(){const{layoutRows:t,unWatchers:i,hasSubNodes:n,isRunningNode:s}=this,{pixiApp:o,styleOptions:a,styleNode:h,selectedNodeId:u,subNodeLabels:l,expandedSubNodes:f,viewport:c}=this.graphState;i.push(W.watch(t,()=>{this.updatePosition()}),W.watch([a,h],()=>{this.drawBox(),this.drawLabel()},{deep:!0}),W.watch(u,()=>{if(u.value===this.nodeData.id||u.value===this.nodeData.subFlowRunId){this.select();return}this.isSelected&&this.deselect()}),W.watch(f,()=>{var d;if(this.isSubNodesExpanded){if(!f.value.has(this.nodeData.id)){this.isSubNodesExpanded=!1,this.collapseSubNodes();return}const v=f.value.get(this.nodeData.id).data;(d=this.subNodesContent)==null||d.update("value"in v?v.value:v);return}f.value.has(this.nodeData.id)&&(this.isSubNodesExpanded=!0,this.expandSubNodes())},{deep:!0})),n&&i.push(W.watch(l,()=>{var d;this.getLabelText()!==((d=this.label)==null?void 0:d.text)&&this.drawLabel(!0)},{deep:!0})),s&&(this.runningNodeTicker=()=>{this.update()},o.ticker.add(this.runningNodeTicker)),c.on("frame-end",()=>{if(c.scale.x<Px){this.label&&(this.label.visible=!1),this.subNodesOutline&&!this.isSubNodesExpanded&&(this.subNodesOutline.visible=!1);return}this.label&&(this.label.visible=!0),this.subNodesOutline&&(this.subNodesOutline.visible=!0)})}drawSubNodesOutline(){var d;if(!this.hasSubNodes)return;(d=this.subNodesOutline)==null||d.destroy();const{nodeHeight:t,graphState:i}=this,{styleOptions:n,styleNode:s}=i,{borderRadiusNode:o,alphaSubNodesOutlineDimmed:a,spacingSubNodesOutlineBorderWidth:h,spacingSubNodesOutlineOffset:u}=n.value,{fill:l}=s.value(this.nodeData),f=Qt(l),c=this.getOutlineWidth();this.subNodesOutline=new Ia({graphState:i,width:c,height:t,borderRadius:o,borderWidth:h,borderColor:f}),this.subNodesOutline.position.set(u,u),this.subNodesOutline.alpha=a,this.subNodesOutlineContainer.addChild(this.subNodesOutline)}initBox(){const{box:t}=this;t.name=Na,this.drawBox(),this.addChild(t),t.interactive=!0,t.buttonMode=!0,t.on("click",()=>{this.emitSelection()}),this.graphState.cull.add(t)}drawBox(){var p,_,g;const{pixiApp:t,styleOptions:i,styleNode:n}=this.graphState,{isRunningNode:s,nodeWidth:o,nodeHeight:a,box:h,boxCapWidth:u}=this,{borderRadiusNode:l}=i.value,{fill:f}=n.value(this.nodeData),c=Qt(f);(p=this.leftBoxCap)==null||p.destroy(),(_=this.boxBody)==null||_.destroy(),(g=this.rightBoxCap)==null||g.destroy(),this.box.removeChildren();const{cap:d,body:v}=zo({pixiApp:t,fill:c,borderRadius:l,boxCapWidth:u,height:a});this.leftBoxCap=new ct(d),this.boxBody=new ct(v),this.boxBody.width=this.getBoxBodyWidth(),this.boxBody.height=a,this.boxBody.position.set(u,0),h.addChild(this.leftBoxCap),h.addChild(this.boxBody),s||(this.rightBoxCap=new ct(d),this.rightBoxCap.scale.x=-1,this.rightBoxCap.position.x=o,h.addChild(this.rightBoxCap))}initSubNodesToggle(){if(!this.hasSubNodes)return;const{graphState:t,nodeWidth:i,nodeHeight:n,nodeData:s}=this,{spacingNodeLabelMargin:o,borderRadiusNode:a}=this.graphState.styleOptions.value;this.subNodesToggleWidth=n,this.isSubNodesToggleFloating=this.subNodesToggleWidth+a>i,this.subNodesToggle=new Mx({graphState:t,nodeData:s,floating:this.isSubNodesToggleFloating,size:this.subNodesToggleWidth}),this.subNodesToggle.position.x=this.isSubNodesToggleFloating?i+o:0,this.subNodesToggle.on("click",()=>{this.emit(Jt.subNodesToggle,this.nodeData.id)}),this.addChild(this.subNodesToggle)}async drawLabel(t){const{apxLabelWidth:i,nodeData:n}=this,{styleOptions:s,styleNode:o,cull:a}=this.graphState,h=await jn(s.value),{spacingNodeXPadding:u}=s.value,{inverseTextOnFill:l}=o.value(n),f=l?h.nodeTextInverse:h.nodeTextDefault,c=this.getLabelText();if(i===0||t){const p=le.measureText(c,h.nodeTextStyles).width*1.07;this.apxLabelWidth=p+u*2}this.isLabelInBox=this.checkIsLabelInBox();const d=this.isLabelInBox?f:h.nodeTextDefault;this.label&&(a.remove(this.label),this.label.destroy()),this.label=new Do(c,d),this.updateLabelPosition(),this.isLabelInBox||(this.label.interactive=!0,this.label.buttonMode=!0,this.label.on("click",()=>{this.emitSelection()})),a.add(this.label),this.addChild(this.label)}initSelectedRing(){const{width:t,height:i,margin:n}=this.getSelectedRingSize(),{colorNodeSelection:s,spacingNodeSelectionWidth:o,borderRadiusNode:a}=this.graphState.styleOptions.value;this.selectedRing=new Ia({graphState:this.graphState,width:t,height:i,borderRadius:a,borderColor:s,borderWidth:o}),this.selectedRing.position.set(-n,-n),this.selectedRing.alpha=0,this.addChild(this.selectedRing)}select(){this.isSelected=!0,this.selectedRing.alpha=1,this.centerViewportToNodeAfterDelay()}deselect(){this.isSelected=!1,this.selectedRing.alpha=0,this.graphState.selectedNodeId.value||this.centerViewportToNodeAfterDelay()}centerViewportToNodeAfterDelay(){const{viewport:t,suppressMotion:i}=this.graphState;setTimeout(()=>{const n=(this.worldTransform.tx-t.x)/t.scale.x+this.box.width/2,s=(this.worldTransform.ty-t.y)/t.scale.y+this.box.height/2;t.animate({position:{x:n,y:s},time:i.value?0:1e3,ease:"easeInOutQuad",removeOnInterrupt:!0})},100)}expandSubNodes(){var n,s;const t=this.graphState.expandedSubNodes.value.get(this.nodeData.id);if(!this.hasSubNodes||!t)return;const i="value"in t.data?t.data.value:t.data;(n=this.subNodesToggle)==null||n.setExpanded(),(s=this.subNodesContent)==null||s.destroy(),this.subNodesContent=new xf({isSubNodes:!0,graphData:i,graphState:this.graphState}),this.subNodesContent.on(Jt.nodeDetails,o=>{this.emit(Jt.nodeDetails,o)}),this.subNodesContent.on(Jt.subNodesToggle,o=>{this.emit(Jt.subNodesToggle,o)}),this.updateSubNodesContentPosition(),this.subNodesContent.on(Fa,()=>this.updateSubNodesContentPosition()),this.addChild(this.subNodesContent),this.initSubNodesTicker()}updateSubNodesContentPosition(){const{subNodesContent:t,box:i}=this,{spacingNodeMargin:n}=this.graphState.styleOptions.value;if(!t)return;const s=t.getEarliestNodeStart(),o=s?-he.dateToX(s):0,a=i.y+i.height+n;t.position.set(o,a)}initSubNodesTicker(){const{subNodesContent:t}=this,{pixiApp:i}=this.graphState;t&&(this.subNodesHeight=t.height,this.subNodesContentTicker=()=>{var n;((n=this.subNodesContent)==null?void 0:n.height)!==this.subNodesHeight&&(this.updateSubNodesOutlineSize(),this.updateSelectedRingSize(),this.subNodesHeight=t.height,this.emit(Da))},i.ticker.add(this.subNodesContentTicker,null,ee.LOW))}async collapseSubNodes(){var t;(t=this.subNodesToggle)==null||t.setCollapsed(),this.destroySubNodesContent(),this.updateSelectedRingSize(),await this.updateSubNodesOutlineSize(),this.emit(Da)}update(t){var o;let i=!1,n=!1;t&&(this.nodeData=t,i=this.currentState!==this.nodeData.state,this.currentState=this.nodeData.state.toString(),this.updateIsRunningNode(),n=((o=this.label)==null?void 0:o.text)!==this.nodeData.label),this.isRunningNode&&this.nodeData.end&&(this.isRunningNode=!1,this.destroyRunningNodeTicker());const s=this.getNodeWidth();if(i&&(this.drawBox(),this.drawSubNodesOutline()),n&&this.drawLabel(),s!==this.nodeWidth){this.nodeWidth=s,this.updateBoxWidth(),this.updateSelectedRingSize(),this.updateSubNodesOutlineSize(!0),this.updateSubNodesTogglePosition();const a=this.isLabelInBox!==this.checkIsLabelInBox(2);!n&&a?this.drawLabel():this.isLabelInBox||this.updateLabelPosition()}}updatePosition(t){if(!this.positionInitialized)return;const{skipAnimation:i,includeXPos:n}=t??{},{suppressMotion:s}=this.graphState,{id:o}=this.nodeData,{position:a}=this.layout.value[o];if(!this.layoutRows.value[a])return;const{yPos:h}=this.layoutRows.value[a],u=n?he.dateToX(this.nodeData.start):this.position.x;if(!(this.position.y===h&&this.position.x===u)){if(i||s.value){this.position.set(u,h);return}ae.to(this,{x:u,y:h,duration:gf.move,ease:"power1.out"}).then(()=>{this.graphState.cullScreen()})}}updateIsRunningNode(){this.isRunningNode=this.graphState.isRunning.value&&!this.nodeData.end}updateBoxWidth(){var t;this.boxBody.width=this.getBoxBodyWidth(),(t=this.rightBoxCap)==null||t.position.set(this.nodeWidth,0)}async updateSubNodesOutlineSize(t){if(!this.subNodesOutline)return;const{isSubNodesExpanded:i,subNodesContent:n,subNodesOutline:s,nodeHeight:o}=this,{spacingSubNodesOutlineOffset:a,alphaSubNodesOutlineDimmed:h,spacingNodeMargin:u}=this.graphState.styleOptions.value,{suppressMotion:l}=this.graphState,f=this.getOutlineWidth(),c=i?o+n.height+u:o;s.resize({width:f,height:c,animate:!0}),await new Promise(d=>{const v=t||l.value?0:pf,p=i?-a:a,_=i?-a:a,g=i?1:h;if(t||l.value){s.position.set(p,_),s.alpha=g,d(null);return}ae.to(s,{x:p,y:_,alpha:g,duration:v,ease:vf}).then(()=>d(null))})}updateLabelPosition(){if(!this.label)return;const{graphState:t,nodeWidth:i,hasSubNodes:n,isSubNodesToggleFloating:s,subNodesToggleWidth:o}=this,{spacingNodeXPadding:a,spacingNodeLabelMargin:h,spacingNodeYPadding:u}=t.styleOptions.value,l=()=>n&&s?i+h+o+a:i+h,f=()=>n&&!s?o+a:a,c=this.isLabelInBox?f():l();this.label.position.set(c,u)}updateSelectedRingSize(){const{width:t,height:i}=this.getSelectedRingSize();this.selectedRing.resize({width:t,height:i})}updateSubNodesTogglePosition(){if(!this.subNodesToggle)return;const{nodeWidth:t}=this,{borderRadiusNode:i,spacingNodeLabelMargin:n}=this.graphState.styleOptions.value;this.isSubNodesToggleFloating=this.subNodesToggleWidth+i>t,this.subNodesToggle.updateFloatingState(this.isSubNodesToggleFloating),this.subNodesToggle.position.x=this.isSubNodesToggleFloating?t+n:0}getNodeWidth(){const{isRunningNode:t,boxCapWidth:i,nodeData:n}=this,s=t?i:i*2,o=he.dateToX(n.end??new Date)-he.dateToX(n.start);return o>s?o:s}getNodeHeight(){const{textLineHeightDefault:t,spacingNodeYPadding:i}=this.graphState.styleOptions.value;return t+i*2}getBoxBodyWidth(){const{isRunningNode:t,nodeWidth:i,boxCapWidth:n}=this;return t?i-n:i-n*2}getOutlineWidth(){const{nodeWidth:t,isSubNodesExpanded:i}=this,{spacingSubNodesOutlineOffset:n}=this.graphState.styleOptions.value;if(i)return t+n*2;const s=this.boxCapWidth*2,o=t-n*2;return o>=s?o:s}getLabelText(){if(!this.hasSubNodes)return this.nodeData.label;const{subNodeLabels:t}=this.graphState,{subFlowRunId:i}=this.nodeData;return t.value.has(i)?t.value.get(i):this.nodeData.label}checkIsLabelInBox(t=0){const{hasSubNodes:i,isSubNodesToggleFloating:n,subNodesToggle:s}=this;return i&&!n?this.apxLabelWidth+t<this.nodeWidth-s.width:this.apxLabelWidth+t<this.nodeWidth}getSelectedRingSize(){const{nodeWidth:t,nodeHeight:i,hasSubNodes:n,isSubNodesExpanded:s}=this,{spacingNodeSelectionMargin:o,spacingNodeSelectionWidth:a,spacingSubNodesOutlineBorderWidth:h,spacingSubNodesOutlineOffset:u}=this.graphState.styleOptions.value,l=o+a,f=t+l*2,c=n&&!s?i+h+u+l*2:i+l*2;return{width:f,height:c,margin:l}}emitSelection(){const{id:t,subFlowRunId:i}=this.nodeData,n={id:this.hasSubNodes?i:t,type:this.hasSubNodes?"subFlow":"task"};this.emit(Jt.nodeDetails,n)}destroySubNodesContent(){var t;this.subNodesContentTicker&&(this.graphState.pixiApp.ticker.remove(this.subNodesContentTicker),this.subNodesContentTicker=null),(t=this.subNodesContent)==null||t.destroy()}destroyRunningNodeTicker(){this.runningNodeTicker&&(this.graphState.pixiApp.ticker.remove(this.runningNodeTicker),this.runningNodeTicker=null)}killTweens(){ae.killTweensOf([this,this.subNodesOutline])}destroy(){var i,n,s,o,a,h,u;const{cull:t}=this.graphState;t.remove(this.box),this.label&&t.remove(this.label),this.killTweens(),this.isSelected&&this.emit(Jt.nodeDetails,null),this.destroyRunningNodeTicker(),this.destroySubNodesContent(),(i=this.subNodesOutline)==null||i.destroy(),(n=this.leftBoxCap)==null||n.destroy(),(s=this.rightBoxCap)==null||s.destroy(),(o=this.boxBody)==null||o.destroy(),this.box.destroy(),(a=this.subNodesToggle)==null||a.destroy(),(h=this.label)==null||h.destroy(),(u=this.selectedRing)==null||u.destroy(),this.unWatchers.forEach(l=>l()),super.destroy.call(this)}}const mf="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2NvbnN0IFQ9KHttaW5pbXVtU3RhcnRUaW1lOmUsZ3JhcGhYRG9tYWluOm4saW5pdGlhbE92ZXJhbGxUaW1lU3Bhbjp0fSk9Pih7ZGF0ZVRvWDpJKGUsbix0KSx4VG9EYXRlOkwoZSxuLHQpfSk7ZnVuY3Rpb24gSShlLG4sdCl7cmV0dXJuIGZ1bmN0aW9uKG8pe3JldHVybiBNYXRoLmNlaWwoKG8uZ2V0VGltZSgpLWUpKihuL3QpKX19ZnVuY3Rpb24gTChlLG4sdCl7cmV0dXJuIGZ1bmN0aW9uKG8pe3JldHVybiBNYXRoLmNlaWwoZStvKih0L24pKX19Y29uc3QgZz0wO2xldCB5LHY9MTQsRD0wLGg9IndhdGVyZmFsbCIsZD1bXTtjb25zdCBjPXt9O29ubWVzc2FnZT1hc3luYyh7ZGF0YTp7bGF5b3V0U2V0dGluZzplLGdyYXBoRGF0YTpuLGFweENoYXJhY3RlcldpZHRoOnQsc3BhY2luZ01pbmltdW1Ob2RlRWRnZUdhcDpvLHRpbWVTY2FsZVByb3BzOmksY2VudGVyVmlld3BvcnRBZnRlcjpzfX0pPT57Zm9yKGNvbnN0IHIgaW4gYylkZWxldGUgY1tyXTtpZihvJiYoRD1vKSxlJiYoaD1lKSx0JiYodj10KSxpKXtjb25zdHttaW5pbXVtU3RhcnRUaW1lOnIsZ3JhcGhYRG9tYWluOmEsaW5pdGlhbE92ZXJhbGxUaW1lU3Bhbjp1fT1pO3k9VCh7bWluaW11bVN0YXJ0VGltZTpyLGdyYXBoWERvbWFpbjphLGluaXRpYWxPdmVyYWxsVGltZVNwYW46dX0pfWlmKG4pe2NvbnN0IHI9SlNPTi5wYXJzZShuKTt5JiYoZXx8ZCE9PXIpJiYoZD1yLGF3YWl0IE8oKSxwb3N0TWVzc2FnZSh7bGF5b3V0OmMsY2VudGVyVmlld3BvcnRBZnRlcjpzfSkpfX07YXN5bmMgZnVuY3Rpb24gTygpe2g9PT0id2F0ZXJmYWxsIiYmUygpLGg9PT0ibmVhcmVzdFBhcmVudCImJmF3YWl0IGIoKSxFKCl9ZnVuY3Rpb24gUygpe2QuZm9yRWFjaCgoZSxuKT0+e2NbZS5pZF09e3Bvc2l0aW9uOm4sc3RhcnRYOjAsZW5kWDowfX0pfWFzeW5jIGZ1bmN0aW9uIGIoKXtmb3IgYXdhaXQoY29uc3QgZSBvZiBkKXtjb25zdCBuPXkuZGF0ZVRvWChlLmVuZD9uZXcgRGF0ZShlLmVuZCk6bmV3IERhdGUpLHQ9ZS5sYWJlbC5sZW5ndGgqdixvPW4rdCxpPWUuaWQgaW4gYz9jW2UuaWRdLnN0YXJ0WDp5LmRhdGVUb1gobmV3IERhdGUoZS5zdGFydCkpLHM9YXdhaXQgWChlLGkpO2NbZS5pZF09e3Bvc2l0aW9uOnMsc3RhcnRYOmksZW5kWDpvfX19YXN5bmMgZnVuY3Rpb24gWChlLG4pe2lmKGUudXBzdHJlYW1EZXBlbmRlbmNpZXMmJmUudXBzdHJlYW1EZXBlbmRlbmNpZXMubGVuZ3RoPT09MSl7aWYoZS51cHN0cmVhbURlcGVuZGVuY2llc1swXWluIGMpe2NvbnN0IHQ9Y1tlLnVwc3RyZWFtRGVwZW5kZW5jaWVzWzBdXTtyZXR1cm4gYXdhaXQgdyh0LG4pfXJldHVybiBjb25zb2xlLndhcm4oInRpbWVsaW5lTm9kZXMgbGF5b3V0IHdvcmtlcjogUGFyZW50IG5vZGUgbm90IGZvdW5kIGluIGxheW91dCIsZS51cHN0cmVhbURlcGVuZGVuY2llc1swXSksZ31pZihlLnVwc3RyZWFtRGVwZW5kZW5jaWVzJiZlLnVwc3RyZWFtRGVwZW5kZW5jaWVzLmxlbmd0aD4wKXtjb25zdCBvPWUudXBzdHJlYW1EZXBlbmRlbmNpZXMubWFwKGE9PmNbYV0pLmZpbHRlcihhPT4hIWEpLm1hcChhPT5hLnBvc2l0aW9uKSxzPW8ucmVkdWNlKChhLHUpPT5hK3UsMCkvby5sZW5ndGgscj1NYXRoLnJvdW5kKHMpO2lmKG0obixyKSl7Y29uc3QgYT1QKG4sciksdT1hLmZpbHRlcihwPT57dmFyIGw7cmV0dXJuKGw9ZS51cHN0cmVhbURlcGVuZGVuY2llcyk9PW51bGw/dm9pZCAwOmwuaW5jbHVkZXMocCl9KTtpZih1Lmxlbmd0aD4wfHxhLmxlbmd0aD4xKXtjb25zdFtwXT11Lmxlbmd0aD4wP3U6YSxsPWNbcF07cmV0dXJuIGwubmV4dERlcGVuZGVuY3lTaG92ZT1DKG8scixsLm5leHREZXBlbmRlbmN5U2hvdmUpLGF3YWl0IHcobCxuKX1yZXR1cm4gYXdhaXQgQSh7Y29tcGV0aW5nTGF5b3V0SXRlbUlkOmFbMF0sdXBzdHJlYW1Qb3NpdGlvbnM6byxub2RlU3RhcnRYOm4sZGVzaXJlZFBvc2l0aW9uOnJ9KX19cmV0dXJuIE4obixnKX1mdW5jdGlvbiBOKGUsbil7cmV0dXJuIG0oZSxuKT9OKGUsbisxKTpufWFzeW5jIGZ1bmN0aW9uIHcoZSxuKXtlLm5leHREZXBlbmRlbmN5U2hvdmUhPT0xJiZlLm5leHREZXBlbmRlbmN5U2hvdmUhPT0tMSYmKGUubmV4dERlcGVuZGVuY3lTaG92ZT0xKTtjb25zdHtwb3NpdGlvbjp0LG5leHREZXBlbmRlbmN5U2hvdmU6b309ZTtyZXR1cm4gbShuLHQpP289PT0xJiYhbShuLHQrMSk/KGUubmV4dERlcGVuZGVuY3lTaG92ZT0tMSx0KzEpOm0obix0LTEpPyhhd2FpdCBmKHtkaXJlY3Rpb246byxub2RlU3RhcnRYOm4sZGVzaXJlZFBvc2l0aW9uOnQrb30pLGUubmV4dERlcGVuZGVuY3lTaG92ZT1vPT09MT8tMToxLHQrbyk6KGUubmV4dERlcGVuZGVuY3lTaG92ZT0xLHQtMSk6dH1mdW5jdGlvbiBtKGUsbil7Y29uc3QgdD1PYmplY3Qua2V5cyhjKTtyZXR1cm4gdC5sZW5ndGg+MCYmdC5zb21lKG89Pntjb25zdCBpPWNbb107cmV0dXJuIHgoe2ZpcnN0Tm9kZUVuZFg6aS5lbmRYLGZpcnN0Tm9kZVBvc2l0aW9uOmkucG9zaXRpb24sbGFzdE5vZGVTdGFydFg6ZSxsYXN0Tm9kZVBvc2l0aW9uOm59KX0pfWFzeW5jIGZ1bmN0aW9uIGYoe2RpcmVjdGlvbjplLG5vZGVTdGFydFg6bixkZXNpcmVkUG9zaXRpb246dH0pe2NvbnN0IG89UChuLHQpO2lmKG8pZm9yIGF3YWl0KGNvbnN0IGkgb2Ygbyl7Y29uc3Qgcz1jW2ldLHI9cy5wb3NpdGlvbitlO2F3YWl0IGYoe2RpcmVjdGlvbjplLG5vZGVTdGFydFg6cy5zdGFydFgsZGVzaXJlZFBvc2l0aW9uOnJ9KSxzLnBvc2l0aW9uPXJ9fWZ1bmN0aW9uIHgoe2ZpcnN0Tm9kZUVuZFg6ZSxmaXJzdE5vZGVQb3NpdGlvbjpuLGxhc3ROb2RlU3RhcnRYOnQsbGFzdE5vZGVQb3NpdGlvbjpvfSl7cmV0dXJuIG49PT1vJiZlK0Q+PXR9ZnVuY3Rpb24gUChlLG4pe2NvbnN0IHQ9W107aWYoT2JqZWN0LmtleXMoYykuZm9yRWFjaChvPT57Y29uc3QgaT1jW29dO3goe2ZpcnN0Tm9kZUVuZFg6aS5lbmRYLGZpcnN0Tm9kZVBvc2l0aW9uOmkucG9zaXRpb24sbGFzdE5vZGVTdGFydFg6ZSxsYXN0Tm9kZVBvc2l0aW9uOm59KSYmdC5wdXNoKG8pfSksdC5sZW5ndGghPT0wKXJldHVybiB0LnNvcnQoKG8saSk9Pntjb25zdCBzPWNbb10scj1jW2ldO3JldHVybiBzLmVuZFg8ci5lbmRYPzE6cy5lbmRYPnIuZW5kWD8tMTowfSksdH1mdW5jdGlvbiBDKGUsbix0KXtjb25zdCBvPWUuZmlsdGVyKHM9PnM8bikubGVuZ3RoLGk9ZS5maWx0ZXIocz0+cz5uKS5sZW5ndGg7cmV0dXJuIG8+aT8tMTp0Pz8xfWFzeW5jIGZ1bmN0aW9uIEEoe2Rlc2lyZWRQb3NpdGlvbjplLG5vZGVTdGFydFg6bix1cHN0cmVhbVBvc2l0aW9uczp0LGNvbXBldGluZ0xheW91dEl0ZW1JZDpvfSl7Y29uc3QgaT1jW29dLFtzLHJdPWsobyksYT10LmZpbHRlcihwPT5wPGUpLmxlbmd0aCx1PXQuZmlsdGVyKHA9PnA+ZSkubGVuZ3RoO2lmKGE+dSl7aWYocz5yJiZzPmEpcmV0dXJuIGF3YWl0IGYoe2RpcmVjdGlvbjotMSxub2RlU3RhcnRYOm4sZGVzaXJlZFBvc2l0aW9uOmV9KSxlO2lmKHI+cylyZXR1cm4gYXdhaXQgZih7ZGlyZWN0aW9uOjEsbm9kZVN0YXJ0WDpuLGRlc2lyZWRQb3NpdGlvbjplfSksZTtpLm5leHREZXBlbmRlbmN5U2hvdmU9LTF9aWYodT5hKXtpZihyPnMmJnI+dSlyZXR1cm4gYXdhaXQgZih7ZGlyZWN0aW9uOjEsbm9kZVN0YXJ0WDpuLGRlc2lyZWRQb3NpdGlvbjplfSksZTtpZihzPnIpcmV0dXJuIGF3YWl0IGYoe2RpcmVjdGlvbjotMSxub2RlU3RhcnRYOm4sZGVzaXJlZFBvc2l0aW9uOmV9KSxlO2kubmV4dERlcGVuZGVuY3lTaG92ZT0xfXJldHVybiBhd2FpdCB3KGksbil9ZnVuY3Rpb24gayhlKXt2YXIgbztjb25zdCBuPWQuZmluZChpPT5pLmlkPT09ZSksdD1jW2VdO3JldHVybigobz1uLnVwc3RyZWFtRGVwZW5kZW5jaWVzKT09bnVsbD92b2lkIDA6by5yZWR1Y2UoKGkscyk9PntpZihlIGluIGMpe2NvbnN0IHI9Y1tzXTtyZXR1cm4gci5wb3NpdGlvbjx0LnBvc2l0aW9uJiYoaVswXSs9MSksci5wb3NpdGlvbj50LnBvc2l0aW9uJiYoaVsxXSs9MSksaX1yZXR1cm4gY29uc29sZS53YXJuKCJub2RlTGF5b3V0Lndvcmtlci50czogUGFyZW50IG5vZGUgbm90IGZvdW5kIG9uIGxheW91dCBkYXRhIixlKSxpfSxbMCwwXSkpPz9bMCwwXX1mdW5jdGlvbiBFKCl7Y29uc3QgZT1PYmplY3QudmFsdWVzKGMpLnJlZHVjZSgobix0KT0+dC5wb3NpdGlvbjxuP3QucG9zaXRpb246biwwKTtlPDAmJk9iamVjdC52YWx1ZXMoYykuZm9yRWFjaChuPT57bi5wb3NpdGlvbis9TWF0aC5hYnMoZSl9KX19KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1ub2RlTGF5b3V0Lndvcmtlci1lZWEzZDQyYy5qcy5tYXAKLy8jIHNvdXJjZU1hcHBpbmdVUkw9YXNzZXRzL25vZGVMYXlvdXQud29ya2VyLWVlYTNkNDJjLmpzLm1hcA==",yf=typeof window<"u"&&window.Blob&&new Blob([atob(mf)],{type:"text/javascript;charset=utf-8"});function Cx(){const r=yf&&(window.URL||window.webkitURL).createObjectURL(yf);try{return r?new Worker(r):new Worker("data:application/javascript;base64,"+mf)}finally{r&&(window.URL||window.webkitURL).revokeObjectURL(r)}}const Fa="timelineUpdateEvent";class xf extends ht{constructor({nodeContentContainerName:t,isSubNodes:i,graphData:n,graphState:s}){super();R(this,"layoutWorker",new Cx);R(this,"isSubNodes");R(this,"graphData");R(this,"graphState");R(this,"nodeContainer",new ht);R(this,"nodeRecords",new Map);R(this,"layout",W.ref({}));R(this,"layoutRows",W.ref([]));R(this,"edgeContainer",new ht);R(this,"edgeRecords",[]);R(this,"unWatchers",[]);R(this,"isSelectionPathHighlighted",!1);t&&(this.nodeContainer.name=t),this.isSubNodes=i,this.graphData=n,this.graphState=s,this.initDeselectLayer(),this.initLayoutWorker(),this.initWatchers()}initWatchers(){const{layoutSetting:t,hideEdges:i,selectedNodeId:n}=this.graphState;this.unWatchers.push(W.watch(t,()=>{this.updateLayoutSetting()}),W.watch(i,()=>{this.updateHideEdges()}),W.watch(n,()=>{if(n.value&&this.nodeRecords.has(n.value)){this.isSelectionPathHighlighted&&this.unHighlightSelectedNodePath(),this.isSelectionPathHighlighted=!0,this.highlightSelectedNodePath();return}this.isSelectionPathHighlighted&&(!n.value||!this.nodeRecords.has(n.value))&&this.unHighlightSelectedNodePath()}))}async initLayoutWorker(){const{styleOptions:t,timeScaleProps:i,layoutSetting:n,centerViewport:s,suppressMotion:o}=this.graphState,a=await jn(t.value),{spacingMinimumNodeEdgeGap:h}=t.value,u=le.measureText("M",a.nodeTextStyles).width,l={data:{graphData:JSON.stringify(this.graphData),timeScaleProps:i,spacingMinimumNodeEdgeGap:h,apxCharacterWidth:u,layoutSetting:n.value}};this.layoutWorker.onmessage=({data:f})=>{this.layout.value=f.layout,this.renderLayout(),this.isSelectionPathHighlighted&&this.highlightSelectedNodePath(),f.centerViewportAfter&&!this.isSubNodes&&setTimeout(()=>{s()},o.value?10:gf.move*1e3*1.1),this.emit(Fa)},this.layoutWorker.postMessage(l.data)}initDeselectLayer(){if(this.isSubNodes)return;const{pixiApp:t,viewport:i}=this.graphState,n=new $y(t,i);this.addChild(n),n.on("click",()=>{this.emitNullSelection()})}renderLayout(){const{layout:t}=this,i=this.nodeRecords.size===0,n=[];Object.keys(t.value).forEach(s=>{const o=this.getNodeData(s);o&&(this.nodeRecords.has(s)?this.nodeRecords.get(s).update(o):(this.createNode(o),n.push(s)))}),this.updateLayoutRows(),n.forEach(s=>{this.nodeRecords.get(s).initializePosition()}),i&&(this.addChild(this.edgeContainer),this.addChild(this.nodeContainer),this.isSubNodes||this.graphState.centerViewport({skipAnimation:!0}))}updateLayoutRows(t=0){const{layout:i}=this,{spacingNodeMargin:n,spacingNodeSelectionMargin:s}=this.graphState.styleOptions.value,o=Math.max(...Object.values(i.value).map(h=>h.position));let a=[];for(let h=t;h<=o;h++){const u=a[h-1]?a[h-1].yPos+a[h-1].height-s*2+n:0,l=Object.keys(i.value).filter(c=>i.value[c].position===h),f=Math.max(...l.map(c=>{var d;return((d=this.nodeRecords.get(c))==null?void 0:d.height)??0}));a.push({yPos:u,height:f})}t>0&&(a=this.layoutRows.value.slice(0,t).concat(a)),this.layoutRows.value=a}createNode(t){const{graphState:i,layout:n,layoutRows:s}=this,o=new Rx({nodeData:t,graphState:i,layout:n,layoutRows:s});this.registerEmits(o),this.nodeRecords.set(t.id,o),this.addNodeEdges(t),this.nodeContainer.addChild(o),o.on(Da,()=>{this.updateLayoutRows()})}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 o=new mx({sourceNode:n,targetNode:s,graphState:this.graphState});this.graphState.hideEdges.value&&(o.renderable=!1),this.edgeRecords.push({edge:o,sourceId:i,targetId:t.id}),this.edgeContainer.addChild(o)})}update(t){if(this.graphData=t,t.length!==this.nodeRecords.size){const i={data:{graphData:JSON.stringify(this.graphData)}};this.layoutWorker.postMessage(i.data);return}this.nodeRecords.forEach((i,n)=>{const s=this.getNodeData(n);s&&i.update(s)}),this.emit(Fa)}updateHideEdges(){const{hideEdges:t,viewport:i}=this.graphState;this.edgeRecords.forEach(({edge:n})=>n.renderable=!t.value),t.value||(i.dirty=!0,i.updateTransform()),this.isSelectionPathHighlighted&&this.highlightSelectedNodePath()}updateLayoutSetting(){const{layoutSetting:t}=this.graphState,i={data:{graphData:JSON.stringify(this.graphData),layoutSetting:t.value,centerViewportAfter:!0}};this.layoutWorker.postMessage(i.data)}highlightSelectedNodePath(){const t=this.graphState.selectedNodeId.value,i=t&&this.nodeRecords.get(t);if(!t||!i)return;const{alphaNodeDimmed:n}=this.graphState.styleOptions.value,s=[...this.getAllUpstreamEdges(t),...this.getAllDownstreamEdges(t)],o=new Map;o.set(t,i),this.edgeRecords.forEach(a=>{if(s.includes(a)){const h=this.nodeRecords.get(a.sourceId),u=this.nodeRecords.get(a.targetId);o.set(a.sourceId,h),o.set(a.targetId,u),a.edge.renderable=!0;return}a.edge.alpha=n}),this.nodeRecords.forEach((a,h)=>{o.has(h)||(a.alpha=n)})}getAllUpstreamEdges(t){var s;const i=[],n=this.graphData.find(o=>o.id===t);return(s=n==null?void 0:n.upstreamDependencies)==null||s.forEach(o=>{const a=this.edgeRecords.find(h=>h.sourceId===o&&h.targetId===t);if(a){i.push(a);const h=this.getAllUpstreamEdges(o);i.push(...h)}}),i}getAllDownstreamEdges(t){const i=[];return this.graphData.forEach(n=>{var s;if((s=n.upstreamDependencies)!=null&&s.includes(t)){const o=this.edgeRecords.find(a=>a.targetId===n.id&&a.sourceId===t);if(o){i.push(o);const a=this.getAllDownstreamEdges(n.id);i.push(...a)}}}),i}unHighlightSelectedNodePath(){const{hideEdges:t}=this.graphState;this.edgeRecords.forEach(({edge:i})=>{t.value&&(i.renderable=!1),i.alpha=1}),this.nodeRecords.forEach(i=>{i.alpha=1})}registerEmits(t){t.on(Jt.nodeDetails,i=>{this.emit(Jt.nodeDetails,i)}),t.on(Jt.subNodesToggle,i=>{this.emit(Jt.subNodesToggle,i)})}emitNullSelection(){this.emit(Jt.nodeDetails,null)}getNodeData(t){return this.graphData.find(i=>i.id===t)}getEarliestNodeStart(){return this.graphData.length<1?null:this.graphData.reduce((i,n)=>n.start.getTime()<i.getTime()?n.start:i,this.graphData[0].start)}destroy(){this.nodeRecords.forEach(t=>t.destroy()),this.nodeRecords.clear(),this.edgeRecords.forEach(t=>t.edge.destroy()),this.removeChildren(),this.unWatchers.forEach(t=>t()),this.layoutWorker.terminate(),this.layoutWorker.onmessage=null,this.isSubNodes||i0(),super.destroy.call(this)}}class Ox extends ht{constructor({viewportRef:t,appRef:i,cull:n,formatDateFns:s,styleOptions:o}){super();R(this,"viewportRef");R(this,"appRef");R(this,"cull");R(this,"formatDateFns");R(this,"styleOptions");R(this,"unwatch");R(this,"playhead",new Le);R(this,"label");n.add(this),this.viewportRef=t,this.appRef=i,this.cull=n,this.formatDateFns=s,this.styleOptions=o,this.drawPlayhead(),this.drawTimeLabel(),this.unwatch=W.watch(o,()=>{this.playhead.clear(),this.drawPlayhead()},{deep:!0}),this.interactive=!1}drawPlayhead(){const{colorPlayheadBg:t,spacingPlayheadWidth:i,spacingPlayheadGlowPadding:n}=this.styleOptions.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.styleOptions.value,n=await jn(this.styleOptions.value),{timeBySeconds:s}=this.formatDateFns.value,o=s(new Date);this.label=new Do(o,n.playheadTimerLabel),this.label.x=-this.label.width-(i+t),this.label.y=this.getTimeLabelY(),this.addChild(this.label),setInterval(()=>{const a=new Date;this.label.text=s(a)},1e3)}getTimeLabelY(){const{spacingGuideLabelPadding:t}=this.styleOptions.value;return this.appRef.screen.height-(this.label.height+t)}updatePosition(){const{spacingPlayheadWidth:t,spacingPlayheadGlowPadding:i}=this.styleOptions.value;this.position.x=he.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,this.label.y=this.getTimeLabelY())}destroy(){this.cull.remove(this),this.unwatch(),this.playhead.destroy(),super.destroy.call(this)}}const Ba={leftCap:"leftCap",body:"body",rightCap:"rightCap"},Ax=.2,Ix=.2;class Mx extends ht{constructor({graphState:t,nodeData:i,size:n,floating:s}){super();R(this,"graphState");R(this,"nodeData");R(this,"size");R(this,"isFloating");R(this,"isExpanded",!1);R(this,"textColor");R(this,"toggleBox",new ht);R(this,"hoverShade",new ht);R(this,"toggleArrow");R(this,"toggleBorder");R(this,"divider");R(this,"unWatchers",[]);this.interactive=!0,this.buttonMode=!0,t.cull.add(this),this.graphState=t,this.nodeData=i,this.size=n,this.isFloating=s,this.textColor=this.getTextColor(),this.addChild(this.toggleBox),this.addChild(this.hoverShade),this.initShapes(),this.on("pointerover",()=>{this.hover()}),this.on("pointerout",()=>{this.unHover()}),this.initWatchers()}initWatchers(){const{viewport:t,styleOptions:i,styleNode:n}=this.graphState;this.unWatchers.push(W.watch([i,n],()=>{this.redraw()},{deep:!0})),t.on("frame-end",()=>{t.scale.x<Ix?this.visible=!1:this.visible=!0})}initShapes(){this.drawToggleBox(),this.drawHoverShade(),this.drawDivider(),this.drawToggleArrow(),this.drawToggleBorder()}drawToggleBox(){if(this.toggleBox.removeChildren(),!this.isFloating)return;const{size:t,toggleBox:i}=this,{pixiApp:n,styleOptions:s}=this.graphState,{colorButtonBg:o,borderRadiusButton:a}=s.value,{cap:h,body:u}=zo({pixiApp:n,fill:o,borderRadius:a,boxCapWidth:a,height:t}),l=new ct(h),f=new ct(u);f.x=a,f.width=t-a*2,f.height=t;const c=new ct(h);c.scale.x=-1,c.x=t,i.addChild(l),i.addChild(f),i.addChild(c)}drawHoverShade(){const{hoverShade:t,size:i,isFloating:n}=this,{borderRadiusButton:s,colorButtonBgHover:o}=this.graphState.styleOptions.value,{onFillSubNodeToggleHoverBg:a,onFillSubNodeToggleHoverBgAlpha:h}=this.graphState.styleNode.value(this.nodeData),u=Qt(a);t.removeChildren();const{cap:l,body:f}=zo({pixiApp:this.graphState.pixiApp,fill:n?o:u,borderRadius:s,boxCapWidth:s,height:i}),c=new ct(l);c.name=Ba.leftCap,c.alpha=n?1:h;const d=new ct(f);d.name=Ba.body,d.x=s,d.width=n?i-s*2:i-s,d.height=i,d.alpha=n?1:h;const v=new ct(l);v.name=Ba.rightCap,v.scale.x=-1,v.x=i,v.alpha=n?1:0,t.addChild(c),t.addChild(d),t.addChild(v),t.alpha=0}drawDivider(){var o;if((o=this.divider)==null||o.destroy(),this.isFloating)return;const{size:t,textColor:i}=this,{pixiApp:n}=this.graphState,s=Xr({pixiApp:n,fill:i});this.divider=new ct(s),this.divider.width=1,this.divider.height=t,this.divider.x=t,this.addChild(this.divider)}drawToggleArrow(){var a;const{size:t,textColor:i,isExpanded:n}=this,{pixiApp:s}=this.graphState;(a=this.toggleArrow)==null||a.destroy();const o=Ju({pixiApp:s,strokeColor:i,edgeWidth:2,edgeLength:8});this.toggleArrow=new ct(o),this.toggleArrow.transform.rotation=n?Math.PI/2*-1:Math.PI/2,this.toggleArrow.anchor.set(.5,.5),this.toggleArrow.position.set(t/2,t/2),this.addChild(this.toggleArrow)}drawToggleBorder(){var a;(a=this.toggleBorder)==null||a.destroy();const{size:t,isFloating:i}=this,{colorButtonBorder:n,borderRadiusButton:s,spacingButtonBorderWidth:o}=this.graphState.styleOptions.value;!n||!i||(this.toggleBorder=new Ia({graphState:this.graphState,width:t,height:t,borderRadius:s,borderWidth:o,borderColor:n}),this.addChild(this.toggleBorder))}setToggleArrowRotation(t){const{suppressMotion:i}=this.graphState;this.toggleArrow&&ae.to(this.toggleArrow,{rotation:t,duration:i.value?0:Ax,ease:"power2.inOut"})}getTextColor(){const{styleOptions:t,styleNode:i}=this.graphState,{colorTextDefault:n,colorTextInverse:s}=t.value,{inverseTextOnFill:o}=i.value(this.nodeData);return this.isFloating?n:o?s:n}redraw(){this.textColor=this.getTextColor(),this.initShapes()}hover(){this.hoverShade.alpha=1}unHover(){this.hoverShade.alpha=0}setExpanded(){this.isExpanded=!0,this.setToggleArrowRotation(Math.PI/2*-1)}setCollapsed(){this.isExpanded=!1,this.setToggleArrowRotation(Math.PI/2)}updateFloatingState(t){this.isFloating!==t&&(this.isFloating=t,this.redraw())}destroy(){this.graphState.cull.remove(this),super.destroy.call(this)}}const Dx=W.defineComponent({__name:"FlowRunTimeline",props:{graphData:null,isRunning:{type:Boolean},theme:null,formatDateFns:null,selectedNodeId:null,layout:null,hideEdges:{type:Boolean},subNodeLabels:null,expandedSubNodes:null},emits:["selection","subFlowToggle"],setup(r,{expose:e,emit:t}){const i=r,n=500;e({centerViewport:vt,moveViewportCenter:st});const s=W.ref(),o=W.computed(()=>{var H;return((H=i.theme)==null?void 0:H.node)??Ya}),a=W.computed(()=>{var H;return $f((H=i.theme)==null?void 0:H.defaults)}),h=W.computed(()=>i.selectedNodeId??null),u=W.computed(()=>i.layout??"nearestParent"),l=W.computed(()=>i.isRunning??!1),f=W.computed(()=>i.hideEdges??!1),c=W.computed(()=>i.subNodeLabels??new Map),d=W.computed(()=>i.expandedSubNodes??new Map),v=W.computed(()=>{const H=window.matchMedia("(prefers-reduced-motion: reduce)").matches;return i.graphData.length>n||H}),p=W.ref(!1),_=W.computed(()=>({...za,...i.formatDateFns})),g={timelineGuides:0,viewport:10,playhead:20},y=W.ref(!0);let m,b;const x=new Hf;let T,w;const S=W.ref();let E,P,O,N,D,U=null;const I="rootNodesContainer";let A;W.onMounted(async()=>{if(!s.value){console.error("Stage reference not found in initPixiApp");return}z(),O=bx(T),m=Jy(s.value),m.stage.sortableChildren=!0,b=await e0(s.value,m),b.zIndex=g.viewport,K(),C(),V(),Lt(),G(),nt(),y.value=!1}),W.onBeforeUnmount(()=>{B()});function B(){N.destroy(),D==null||D.destroy(),A.destroy(),b.destroy(),m.destroy(!0)}function K(){b.on("drag-start",()=>{p.value=!0}).on("drag-end",()=>{p.value=!1})}function z(){const $=i.graphData.filter(Q=>Q.end).map(({start:Q,end:Wt})=>({start:Q,end:Wt}));l.value&&$.push({start:new Date,end:new Date});const{min:Z,max:xt,span:Rt}=Zf($,6e4);w=Z,S.value=xt,E=Rt,P=M(),T={minimumStartTime:w.getTime(),graphXDomain:P,initialOverallTimeSpan:E}}function M(){const{spacingNodeYPadding:H,textLineHeightDefault:$,spacingNodeMargin:Z,spacingSubNodesOutlineOffset:xt}=a.value,Rt=i.graphData.length,Q=$+H*2+xt*2+Z,Wt=s.value.clientWidth/s.value.clientHeight,_r=Q*Rt*Wt,vs=Rt>=120?Rt/100:1.2;return _r*vs}function C(){Ky(a.value),W.watch(a,H=>{qy(H)})}function G(){l.value&&(D=new Ox({viewportRef:b,appRef:m,cull:x,formatDateFns:_,styleOptions:a}),D.zIndex=g.playhead,m.stage.addChild(D),tt())}function tt(){U||!D||(U=()=>{if(l.value&&D&&!D.destroyed){const H=D.position.x>0&&D.position.x<m.screen.width;if(S.value=new Date,D.updatePosition(),!b.moving&&H&&D.position.x>m.screen.width-a.value.spacingViewportPaddingDefault){const $=O.xToDate(b.left);b.zoomPercent(-.1,!0),b.left=O.dateToX(new Date($))}}},m.ticker.add(U))}W.watch(l,H=>{y.value||(H&&(!D||D.destroyed)&&G(),!H&&D&&U&&(D.destroy(),m.ticker.remove(U),U=null))});function V(){N=new Sx({viewportRef:b,appRef:m,cull:x,minimumStartDate:w,maximumEndDate:S,isRunning:l.value,styleOptions:a,formatDateFns:_}),N.zIndex=g.timelineGuides,m.stage.addChild(N),m.ticker.add(()=>{N.updateGuides()})}function nt(){b.on("frame-end",()=>{b.dirty&&(Pt(),b.dirty=!1)})}function dt(){x.uncull()}function pt(){Pt()}function Pt(){x.cull(m.renderer.screen)}function Lt(){const H={pixiApp:m,viewport:b,cull:x,cullScreen:Pt,timeScaleProps:T,styleOptions:a,styleNode:o,layoutSetting:u,isRunning:l,hideEdges:f,subNodeLabels:c,selectedNodeId:h,expandedSubNodes:d,suppressMotion:v,centerViewport:vt};A=new xf({nodeContentContainerName:I,graphData:i.graphData,graphState:H}),b.addChild(A),A.on(Jt.nodeDetails,$=>{p.value||t("selection",$)}),A.on(Jt.subNodesToggle,$=>{p.value||t("subFlowToggle",$)}),W.watch(()=>i.graphData,()=>{A.update(i.graphData),b.dirty=!0})}function vt({skipAnimation:H}={}){const{spacingViewportPaddingDefault:$}=a.value,Z=500;dt();const{x:xt,y:Rt,width:Q,height:Wt}=A.getChildByName(I).getLocalBounds();pt();const He=b.findFit(Q+$*2,Wt+$*2);b.animate({position:{x:xt+Q/2,y:Rt+Wt/2},scale:He>1?1:He,time:H||v.value?0:Z,ease:"easeInOutQuad",removeOnInterrupt:!0})}function st({xOffset:H,yOffset:$}){const{x:Z,y:xt}=b.transform.position;b.setTransform(Z+H,xt+$,b.transform.scale.x,b.transform.scale.y)}return(H,$)=>(W.openBlock(),W.createElementBlock("div",{ref_key:"stage",ref:s,class:"g-flow-run-timeline"},null,512))}}),ub="";class ue{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 Nx=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Fx(r,e,t){return t={path:e,exports:{},require:function(i,n){return Bx(i,n??t.path)}},r(t,t.exports),t.exports}function Bx(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var bf=Fx(function(r,e){(function(){var t,i;i=function(n){return r.exports=n},t={linear:function(n,s,o,a){return o*n/a+s},easeInQuad:function(n,s,o,a){return o*(n/=a)*n+s},easeOutQuad:function(n,s,o,a){return-o*(n/=a)*(n-2)+s},easeInOutQuad:function(n,s,o,a){return(n/=a/2)<1?o/2*n*n+s:-o/2*(--n*(n-2)-1)+s},easeInCubic:function(n,s,o,a){return o*(n/=a)*n*n+s},easeOutCubic:function(n,s,o,a){return o*((n=n/a-1)*n*n+1)+s},easeInOutCubic:function(n,s,o,a){return(n/=a/2)<1?o/2*n*n*n+s:o/2*((n-=2)*n*n+2)+s},easeInQuart:function(n,s,o,a){return o*(n/=a)*n*n*n+s},easeOutQuart:function(n,s,o,a){return-o*((n=n/a-1)*n*n*n-1)+s},easeInOutQuart:function(n,s,o,a){return(n/=a/2)<1?o/2*n*n*n*n+s:-o/2*((n-=2)*n*n*n-2)+s},easeInQuint:function(n,s,o,a){return o*(n/=a)*n*n*n*n+s},easeOutQuint:function(n,s,o,a){return o*((n=n/a-1)*n*n*n*n+1)+s},easeInOutQuint:function(n,s,o,a){return(n/=a/2)<1?o/2*n*n*n*n*n+s:o/2*((n-=2)*n*n*n*n+2)+s},easeInSine:function(n,s,o,a){return-o*Math.cos(n/a*(Math.PI/2))+o+s},easeOutSine:function(n,s,o,a){return o*Math.sin(n/a*(Math.PI/2))+s},easeInOutSine:function(n,s,o,a){return-o/2*(Math.cos(Math.PI*n/a)-1)+s},easeInExpo:function(n,s,o,a){return n===0?s:o*Math.pow(2,10*(n/a-1))+s},easeOutExpo:function(n,s,o,a){return n===a?s+o:o*(-Math.pow(2,-10*n/a)+1)+s},easeInOutExpo:function(n,s,o,a){return(n/=a/2)<1?o/2*Math.pow(2,10*(n-1))+s:o/2*(-Math.pow(2,-10*--n)+2)+s},easeInCirc:function(n,s,o,a){return-o*(Math.sqrt(1-(n/=a)*n)-1)+s},easeOutCirc:function(n,s,o,a){return o*Math.sqrt(1-(n=n/a-1)*n)+s},easeInOutCirc:function(n,s,o,a){return(n/=a/2)<1?-o/2*(Math.sqrt(1-n*n)-1)+s:o/2*(Math.sqrt(1-(n-=2)*n)+1)+s},easeInElastic:function(n,s,o,a){var h,u,l;return l=1.70158,u=0,h=o,n===0||(n/=a),u||(u=a*.3),h<Math.abs(o)?(h=o,l=u/4):l=u/(2*Math.PI)*Math.asin(o/h),-(h*Math.pow(2,10*(n-=1))*Math.sin((n*a-l)*(2*Math.PI)/u))+s},easeOutElastic:function(n,s,o,a){var h,u,l;return l=1.70158,u=0,h=o,n===0||(n/=a),u||(u=a*.3),h<Math.abs(o)?(h=o,l=u/4):l=u/(2*Math.PI)*Math.asin(o/h),h*Math.pow(2,-10*n)*Math.sin((n*a-l)*(2*Math.PI)/u)+o+s},easeInOutElastic:function(n,s,o,a){var h,u,l;return l=1.70158,u=0,h=o,n===0||(n/=a/2),u||(u=a*(.3*1.5)),h<Math.abs(o)?(h=o,l=u/4):l=u/(2*Math.PI)*Math.asin(o/h),n<1?-.5*(h*Math.pow(2,10*(n-=1))*Math.sin((n*a-l)*(2*Math.PI)/u))+s:h*Math.pow(2,-10*(n-=1))*Math.sin((n*a-l)*(2*Math.PI)/u)*.5+o+s},easeInBack:function(n,s,o,a,h){return h===void 0&&(h=1.70158),o*(n/=a)*n*((h+1)*n-h)+s},easeOutBack:function(n,s,o,a,h){return h===void 0&&(h=1.70158),o*((n=n/a-1)*n*((h+1)*n+h)+1)+s},easeInOutBack:function(n,s,o,a,h){return h===void 0&&(h=1.70158),(n/=a/2)<1?o/2*(n*n*(((h*=1.525)+1)*n-h))+s:o/2*((n-=2)*n*(((h*=1.525)+1)*n+h)+2)+s},easeInBounce:function(n,s,o,a){var h;return h=t.easeOutBounce(a-n,0,o,a),o-h+s},easeOutBounce:function(n,s,o,a){return(n/=a)<1/2.75?o*(7.5625*n*n)+s:n<2/2.75?o*(7.5625*(n-=1.5/2.75)*n+.75)+s:n<2.5/2.75?o*(7.5625*(n-=2.25/2.75)*n+.9375)+s:o*(7.5625*(n-=2.625/2.75)*n+.984375)+s},easeInOutBounce:function(n,s,o,a){var h;return n<a/2?(h=t.easeInBounce(n*2,0,o,a),h*.5+s):(h=t.easeOutBounce(n*2-a,0,o,a),h*.5+o*.5+s)}},i(t)}).call(Nx)});function fs(r,e){if(r){if(typeof r=="function")return r;if(typeof r=="string")return bf[r]}else return bf[e]}const Lx={removeOnInterrupt:!1,ease:"linear",time:1e3};class Xe extends ue{__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),Xe.prototype.__init.call(this),Xe.prototype.__init2.call(this),Xe.prototype.__init3.call(this),Xe.prototype.__init4.call(this),Xe.prototype.__init5.call(this),Xe.prototype.__init6.call(this),Xe.prototype.__init7.call(this),this.options=Object.assign({},Lx,t),this.options.ease=fs(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,o=this.deltaX,a=this.deltaY,h=new j(this.parent.x,this.parent.y);this.parent.moveCenter(n+o*i,s+a*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 cs(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((...o)=>t.call(e,...o)),e=void 0)}return t}const Gx={sides:"all",friction:.5,time:150,ease:"easeInOutSine",underflow:"center",bounceBox:null};class Tf extends ue{constructor(e,t={}){super(e),this.options=Object.assign({},Gx,t),this.ease=fs(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===cs([t,"access",s=>s.options,"optionalAccess",s=>s.friction])||t.y&&t.percentChangeY===cs([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||{},!cs([i,"optionalAccess",s=>s.active])&&!cs([n,"optionalAccess",s=>s.active])&&(!this.toX||!this.toY)&&(!t.x||!t.y)){e=e||this.oob();const s=e.topLeft,o=e.bottomRight;if(!this.toX&&!t.x){let a=null;e.left&&this.left?a=this.parent.screenWorldWidth<this.parent.screenWidth?this.calcUnderflowX():-s.x:e.right&&this.right&&(a=this.parent.screenWorldWidth<this.parent.screenWidth?this.calcUnderflowX():-o.x),a!==null&&this.parent.x!==a&&(this.toX={time:0,start:this.parent.x,delta:a-this.parent.x,end:a},this.parent.emit("bounce-x-start",this.parent))}if(!this.toY&&!t.y){let a=null;e.top&&this.top?a=this.parent.screenWorldHeight<this.parent.screenHeight?this.calcUnderflowY():-s.y:e.bottom&&this.bottom&&(a=this.parent.screenWorldHeight<this.parent.screenHeight?this.calcUnderflowY():-o.y),a!==null&&this.parent.y!==a&&(this.toY={time:0,start:this.parent.y,delta:a-this.parent.y,end:a},this.parent.emit("bounce-y-start",this.parent))}}}reset(){this.toX=this.toY=null,this.bounce()}}const Ux={left:!1,right:!1,top:!1,bottom:!1,direction:null,underflow:"center"};class wf extends ue{constructor(e,t={}){super(e),this.options=Object.assign({},Ux,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 kx={minWidth:null,minHeight:null,maxWidth:null,maxHeight:null,minScale:null,maxScale:null};class Ef extends ue{constructor(e,t={}){super(e),this.options=Object.assign({},kx,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 Xx={friction:.98,bounce:.8,minSpeed:.01},_i=16;class Sf extends ue{constructor(e,t={}){super(e),this.options=Object.assign({},Xx,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,o=Math.log(s);this.parent.x+=this.x*_i/o*(Math.pow(s,n/_i)-Math.pow(s,i/_i)),this.x*=Math.pow(this.percentChangeX,e/_i)}if(this.y){const s=this.percentChangeY,o=Math.log(s);this.parent.y+=this.y*_i/o*(Math.pow(s,n/_i)-Math.pow(s,i/_i)),this.y*=Math.pow(this.percentChangeY,e/_i)}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 Hx={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 ds extends ue{__init(){this.windowEventHandlers=new Array}constructor(e,t={}){super(e),ds.prototype.__init.call(this),this.options=Object.assign({},Hx,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,o=i-this.last.y;if(this.moved||this.xDirection&&this.parent.input.checkThreshold(s)||this.yDirection&&this.parent.input.checkThreshold(o)){const a={x:t,y:i};return this.xDirection&&(this.parent.x+=(a.x-this.last.x)*this.options.factor),this.yDirection&&(this.parent.y+=(a.y-this.last.y)*this.options.factor),this.last=a,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,o]=this.options.wheelSwapAxes?n.reverse():n;return this.xDirection&&(this.parent.x+=s*i*this.options.wheelScroll*this.reverse),this.yDirection&&(this.parent.y+=o*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 Wx={speed:0,acceleration:null,radius:null};class Pf extends ue{constructor(e,t,i={}){super(e),this.target=t,this.options=Object.assign({},Wx,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,o=n-t.y;if(s||o)if(this.options.speed)if(this.options.acceleration){const a=Math.atan2(n-t.y,i-t.x),h=Math.sqrt(Math.pow(s,2)+Math.pow(o,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(a)*this.velocity.x,f=Math.sin(a)*this.velocity.y,c=Math.abs(l)>Math.abs(s)?i:t.x+l,d=Math.abs(f)>Math.abs(o)?n:t.y+f;this.parent.moveCenter(c,d),this.parent.emit("moved",{viewport:this.parent,type:"follow"})}}else{const a=Math.atan2(n-t.y,i-t.x),h=Math.cos(a)*this.options.speed,u=Math.sin(a)*this.options.speed,l=Math.abs(h)>Math.abs(s)?i:t.x+h,f=Math.abs(u)>Math.abs(o)?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 zx={radius:null,distance:null,top:null,bottom:null,left:null,right:null,speed:8,reverse:!1,noDecelerate:!1,linear:!1,allowButtons:!1};class Rf extends ue{constructor(e,t={}){super(e),this.options=Object.assign({},zx,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 o=Math.atan2(n.y-i,n.x-t);this.options.linear?(this.horizontal=Math.round(Math.cos(o))*this.options.speed*this.reverse*(60/1e3),this.vertical=Math.round(Math.sin(o))*this.options.speed*this.reverse*(60/1e3)):(this.horizontal=Math.cos(o)*this.options.speed*this.reverse*(60/1e3),this.vertical=Math.sin(o)*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 Yx={noDrag:!1,percent:1,center:null,factor:1,axis:"all"};class vr extends ue{__init(){this.active=!1}__init2(){this.pinching=!1}__init3(){this.moved=!1}constructor(e,t={}){super(e),vr.prototype.__init.call(this),vr.prototype.__init2.call(this),vr.prototype.__init3.call(this),this.options=Object.assign({},Yx,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],o=n[1],a=s.last&&o.last?Math.sqrt(Math.pow(o.last.x-s.last.x,2)+Math.pow(o.last.y-s.last.y,2)):null;if(s.id===e.data.pointerId?s.last={x:t,y:i,data:e.data}:o.id===e.data.pointerId&&(o.last={x:t,y:i,data:e.data}),a){let h;const u={x:s.last.x+(o.last.x-s.last.x)/2,y:s.last.y+(o.last.y-s.last.y)/2};this.options.center||(h=this.parent.toLocal(u));let l=Math.sqrt(Math.pow(o.last.x-s.last.x,2)+Math.pow(o.last.y-s.last.y,2));l=l===0?l=1e-10:l;const f=(1-a/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 Vx={topLeft:!1,friction:.8,time:1e3,ease:"easeInOutSine",interrupt:!0,removeOnComplete:!1,removeOnInterrupt:!1,forceStart:!1};class Cf extends ue{constructor(e,t,i,n={}){super(e),this.options=Object.assign({},Vx,n),this.ease=fs(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 o=this.startX,a=this.startY,h=this.deltaX,u=this.deltaY;if(t.time>this.options.time)i=!0,n=o+h,s=a+u;else{const l=this.ease(t.time,0,1,this.options.time);n=o+h*l,s=a+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 jx={width:0,height:0,time:1e3,ease:"easeInOutSine",center:null,interrupt:!0,removeOnComplete:!1,removeOnInterrupt:!1,forceStart:!1,noMove:!1};class Of extends ue{constructor(e,t={}){super(e),this.options=Object.assign({},jx,t),this.ease=fs(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,o=this.ease(s.time,s.startX,s.deltaX,this.options.time),a=this.ease(s.time,s.startY,s.deltaY,this.options.time);this.parent.scale.x=this.parent.screenWidth/o,this.parent.scale.y=this.parent.screenHeight/a}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 Zx={percent:.1,smooth:!1,interrupt:!0,reverse:!1,center:null,lineHeight:20,axis:"all",keyToPress:null,trackpadPinch:!1,wheelZoom:!0};class Af extends ue{constructor(e,t={}){super(e),this.options=Object.assign({},Zx,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 o=this.parent.plugins.get("clamp-zoom",!0);if(o&&o.clamp(),this.options.center)this.parent.moveCenter(this.options.center);else{const a=this.parent.toGlobal(s);this.parent.x+=t.x-a.x,this.parent.y+=t.y-a.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 o={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+o.x)*s-this.parent.scale.x)/this.options.smooth,y:((this.parent.scale.y+o.y)*s-this.parent.scale.y)/this.options.smooth},this.smoothingCount=0,this.smoothingCenter=t}else{let o;this.options.center||(o=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 a=this.parent.plugins.get("clamp-zoom",!0);if(a&&a.clamp(),this.options.center)this.parent.moveCenter(this.options.center);else{const h=this.parent.toGlobal(o);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 If{constructor(e){this.viewport=e,this.touches=[],this.addListeners()}addListeners(){this.viewport.interactive=!0,this.viewport.forceHitArea||(this.viewport.hitArea=new J(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 ps(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((...o)=>t.call(e,...o)),e=void 0)}return t}const en=["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=en.length){const n=this.plugins[e];n&&n.destroy(),this.plugins[e]=t;const s=en.indexOf(e);s!==-1&&en.splice(s,1),en.splice(i,0,e),this.sort()}get(e,t){return t&&ps([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]&&(ps([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){ps([this,"access",t=>t.plugins,"access",t=>t[e],"optionalAccess",t=>t.pause,"call",t=>t()])}resume(e){ps([this,"access",t=>t.plugins,"access",t=>t[e],"optionalAccess",t=>t.resume,"call",t=>t()])}sort(){this.list=[];for(const e of en)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 qx={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:Ut.shared};class La extends ht{__init(){this._disableOnContextMenu=e=>e.preventDefault()}constructor(e={}){super(),La.prototype.__init.call(this),this.options=Object.assign({},{divWheel:document.body},qx,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 If(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 J(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 J(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 o=this.plugins.get("clamp-zoom",!0);return!n&&o&&o.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 o=this.plugins.get("clamp-zoom",!0);return!n&&o&&o.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 Of(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 J(0,0,this.worldWidth,this.worldHeight))}drag(e){return this.plugins.add("drag",new ds(this,e)),this}clamp(e){return this.plugins.add("clamp",new wf(this,e)),this}decelerate(e){return this.plugins.add("decelerate",new Sf(this,e)),this}bounce(e){return this.plugins.add("bounce",new Tf(this,e)),this}pinch(e){return this.plugins.add("pinch",new vr(this,e)),this}snap(e,t,i){return this.plugins.add("snap",new Cf(this,e,t,i)),this}follow(e,t){return this.plugins.add("follow",new Pf(this,e,t)),this}wheel(e){return this.plugins.add("wheel",new Af(this,e)),this}animate(e){return this.plugins.add("animate",new Xe(this,e)),this}clampZoom(e){return this.plugins.add("clamp-zoom",new Ef(this,e)),this}mouseEdges(e){return this.plugins.add("mouse-edges",new Rf(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 o=!1;e<this.left?(this.left=e,o=!0):e+i>this.right&&(this.right=e+i,o=!0),t<this.top?(this.top=t,o=!0):t+n>this.bottom&&(this.bottom=t+n,o=!0),o&&this.emit("moved",{viewport:this,type:"ensureVisible"})}}const Kx=Object.freeze(Object.defineProperty({__proto__:null,Animate:Xe,Bounce:Tf,Clamp:wf,ClampZoom:Ef,Decelerate:Sf,Drag:ds,Follow:Pf,InputManager:If,MouseEdges:Rf,Pinch:vr,Plugin:ue,PluginManager:Mf,Snap:Cf,SnapZoom:Of,Viewport:La,Wheel:Af},Symbol.toStringTag,{value:"Module"}));jt.FlowRunTimeline=Dx,jt.formatDateFnsDefault=za,jt.nodeThemeFnDefault=Ya,Object.defineProperty(jt,Symbol.toStringTag,{value:"Module"})});
1060
+ `;(function(r){ky(e,r);function e(t,i){t===void 0&&(t=.5),i===void 0&&(i=Math.random());var n=r.call(this,iu,Xy,{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})(ri);var Vu=new Nt;Ct.prototype._cacheAsBitmap=!1,Ct.prototype._cacheData=null,Ct.prototype._cacheAsBitmapResolution=null,Ct.prototype._cacheAsBitmapMultisample=wt.NONE;var Hy=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(Ct.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 Hy),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)}}}}),Ct.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))},Ct.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 o=e.renderTexture.current,a=e.renderTexture.sourceFrame.clone(),h=e.renderTexture.destinationFrame.clone(),u=e.projection.transform,l=Pi.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_"+Ei();this._cacheData.textureCacheId=f,rt.addToCache(l.baseTexture,f),Y.addToCache(l,f);var c=this.transform.localTransform.copyTo(Vu).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(o,a,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 ct(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)}},Ct.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))},Ct.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 o=Pi.create({width:t.width,height:t.height}),a="cacheAsBitmap_"+Ei();this._cacheData.textureCacheId=a,rt.addToCache(o.baseTexture,a),Y.addToCache(o,a);var h=Vu;this.transform.localTransform.copyTo(h),h.invert(),h.tx-=t.x,h.ty-=t.y,this.renderCanvas=this._cacheData.originalRenderCanvas,e.render(this,{renderTexture:o,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 ct(o);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)}},Ct.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._bounds.updateID=this._boundsID},Ct.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds(null)},Ct.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,rt.removeFromCache(this._cacheData.textureCacheId),Y.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null},Ct.prototype._cacheAsBitmapDestroy=function(e){this.cacheAsBitmap=!1,this.destroy(e)};Ct.prototype.name=null,ht.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 o=s.getChildByName(e,!0);if(o)return o}}return null};Ct.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 Wy=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,o=s.clientWidth,a=s.clientHeight;i=o,n=a}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=at.Application,r}(),ju=function(){function r(e){var t=this;this.stage=new ht,e=Object.assign({forceCanvas:!1},e),this.renderer=mg(e),r._plugins.forEach(function(i){i.init.call(t,e)})}return r.registerPlugin=function(e){Te("6.5.0","Application.registerPlugin() is deprecated, use extensions.add()"),Ve.add({type:at.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}();Ve.handleByList(at.Application,ju._plugins),Ve.add(Wy);var ko=function(r,e){return ko=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])},ko(r,e)};function tr(r,e){ko(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var zy=function(r){tr(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 o=r.call(this)||this;return o.segWidth=n,o.segHeight=s,o.width=t,o.height=i,o.build(),o}return e.prototype.build=function(){for(var t=this.segWidth*this.segHeight,i=[],n=[],s=[],o=this.segWidth-1,a=this.segHeight-1,h=this.width/o,u=this.height/a,l=0;l<t;l++){var f=l%this.segWidth,c=l/this.segWidth|0;i.push(f*h,c*u),n.push(f/o,c/a)}for(var d=o*a,l=0;l<d;l++){var v=l%o,p=l/o|0,_=p*this.segWidth+v,g=p*this.segWidth+v+1,y=(p+1)*this.segWidth+v,m=(p+1)*this.segWidth+v+1;s.push(_,g,y,g,m,y)}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}(Hn),Yy=function(r){tr(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 o=n.data,a=s.data;o[0]=0,o[1]=0,o[2]=0,o[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);o[d]=h,o[d+1]=0,o[d+2]=h,o[d+3]=1}for(var g=0,c=0;c<f-1;c++){var d=c*2;a[g++]=d,a[g++]=d+1,a[g++]=d+2,a[g++]=d+2,a[g++]=d+1,a[g++]=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,o=0,a=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,o=-(n.x-i.x),s=n.y-i.y;var c=Math.sqrt(s*s+o*o),d=this.textureScale>0?this.textureScale*this._width/2:this._width/2;s/=c,o/=c,s*=d,o*=d,a[f]=l.x+s,a[f+1]=l.y+o,a[f+2]=l.x-s,a[f+3]=l.y-o,i=l}this.buffers[0].update()}},e.prototype.update=function(){this.textureScale>0?this.build():this.updateVertices()},e}(Hn),Vy=function(r){tr(e,r);function e(t,i,n){n===void 0&&(n=0);var s=this,o=new Yy(t.height,i,n),a=new kr(t);return n>0&&(t.baseTexture.wrapMode=Ne.REPEAT),s=r.call(this,o,a)||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}(Ur),jy=function(r){tr(e,r);function e(t,i,n){var s=this,o=new zy(t.width,t.height,i,n),a=new kr(Y.WHITE);return s=r.call(this,o,a)||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}(Ur);(function(r){tr(e,r);function e(t,i,n,s,o){t===void 0&&(t=Y.EMPTY);var a=this,h=new Hn(i,n,s);h.getBuffer("aVertexPosition").static=!1;var u=new kr(t);return a=r.call(this,h,u,null,o)||this,a.autoUpdate=!0,a}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})(Ur);var Yn=10;(function(r){tr(e,r);function e(t,i,n,s,o){i===void 0&&(i=Yn),n===void 0&&(n=Yn),s===void 0&&(s=Yn),o===void 0&&(o=Yn);var a=r.call(this,Y.WHITE,4,4)||this;return a._origWidth=t.orig.width,a._origHeight=t.orig.height,a._width=a._origWidth,a._height=a._origHeight,a._leftWidth=i,a._rightWidth=s,a._topHeight=n,a._bottomHeight=o,a.texture=t,a}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,o=Math.min(i,s);return o},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})(jy);var Xo=function(r,e){return Xo=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])},Xo(r,e)};function Zy(r,e){Xo(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}(function(r){Zy(e,r);function e(t,i){i===void 0&&(i=!0);var n=r.call(this,t[0]instanceof Y?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&&(Ut.shared.remove(this.update,this),this._isConnectedToTicker=!1))},e.prototype.play=function(){this._playing||(this._playing=!0,this._autoUpdate&&!this._isConnectedToTicker&&(Ut.shared.add(this.update,this,te.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 o=Math.sign(this.animationSpeed*t);for(this._currentTime=Math.floor(this._currentTime);s>=this._durations[this.currentFrame];)s-=this._durations[this.currentFrame]*o,this._currentTime+=o;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(Y.from(t[n]));return new e(i)},e.fromImages=function(t){for(var i=[],n=0;n<t.length;++n)i.push(Y.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 Y)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?(Ut.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._playing&&(Ut.shared.add(this.update,this),this._isConnectedToTicker=!0))},enumerable:!1,configurable:!0}),e})(ct);Ve.add(Mg,Gg,Lg,Am,sy,ou,cy,Ey,em,Pm,Rm,ay,Kv,Vg);let er="sans-serif",Vn=null;const ai=new oi,Zu={chars:Ot.ASCII},Ni=new oi;async function qu(r){const e=new ec(r.textFontFamilyDefault);try{await e.load()}catch(t){return console.error(t),console.warn(`loadBitmapFonts: font ${r.textFontFamilyDefault} failed to load, falling back to ${er}`),$u(er,r)}return er=r.textFontFamilyDefault,$u(er,r)}function Ku(r){ai.fontFamily=er,ai.fontSize=r.textSizeDefault,ai.lineHeight=r.textLineHeightDefault,Ni.fontFamily=er,Ni.fontSize=r.textSizeSmall,Ni.lineHeight=r.textLineHeightSmall}function $u(r,e){Ku(e);const t={resolution:window.devicePixelRatio||2,...Zu};Ot.from("NodeTextDefault",{...ai,fill:e.colorTextDefault},t);const i={fontName:"NodeTextDefault",fontSize:e.textSizeDefault};Ot.from("NodeTextInverse",{...ai,fill:e.colorTextInverse},t);const n={fontName:"NodeTextInverse",fontSize:e.textSizeDefault};Ot.from("TimeMarkerLabel",{...Ni,fill:e.colorTextSubdued},t);const s={fontName:"TimeMarkerLabel",fontSize:e.textSizeSmall};Ot.from("PlayheadTimerLabel",{...Ni,fill:e.colorPlayheadBg},t);const o={fontName:"PlayheadTimerLabel",fontSize:e.textSizeSmall};return{nodeTextDefault:i,nodeTextInverse:n,nodeTextStyles:ai,timeMarkerLabel:s,playheadTimerLabel:o}}function qy(r){Ku(r);const e={resolution:window.devicePixelRatio||2,...Zu};setTimeout(()=>{Ot.uninstall("NodeTextDefault"),Ot.from("NodeTextDefault",{...ai,fill:r.colorTextDefault},e),Ot.uninstall("NodeTextInverse"),Ot.from("NodeTextInverse",{...ai,fill:r.colorTextInverse},e),Ot.uninstall("TimeMarkerLabel"),Ot.from("TimeMarkerLabel",{...Ni,fill:r.colorTextSubdued},e),Ot.uninstall("PlayheadTimerLabel"),Ot.from("PlayheadTimerLabel",{...Ni,fill:r.colorPlayheadBg},e)},0)}const jn=r=>(Vn||(Vn=qu(r)),Vn),Ky=r=>{Vn=qu(r)};class $y extends ht{constructor(t,i){super();R(this,"appRef");R(this,"viewportRef");R(this,"layer",new Le);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,te.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 Jy(r){Qc();const e=new ju({backgroundAlpha:0,width:r.clientWidth,height:r.clientHeight,resolution:window.devicePixelRatio||2,autoDensity:!0,antialias:!0,resizeTo:r});return process.env.NODE_ENV==="development"&&Qy(e),r.appendChild(e.view),e.ticker.add(()=>{(r.clientWidth!==e.screen.width||r.clientHeight!==e.screen.height)&&(e.resizeTo=r)},null,te.LOW),e}function Qy(r){globalThis.__PIXI_APP__=r}async function t0(){const{Viewport:r}=await Promise.resolve().then(()=>Kx);return r}async function e0(r,e){const t=await t0(),{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}).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,te.LOW),s}const Ho=10;let Pe,Re,Ce,Oe;const Wo={multisample:2,resolution:4};function Zn(){Pe=new Map,Re=new Map,Ce=new Map,Oe=new Map}function i0(){Pe&&(Pe.forEach(r=>{r.destroy()}),Pe.clear(),Pe=void 0),Re&&(Re.forEach(({cap:r,body:e})=>{r.destroy(),e.destroy()}),Re.clear(),Re=void 0),Ce&&(Ce.forEach(r=>{r.destroy()}),Ce.clear(),Ce=void 0),Oe&&(Oe.forEach(({corner:r,edge:e})=>{r.destroy(),e.destroy()}),Oe.clear(),Oe=void 0)}function Xr({pixiApp:r,fill:e}){if(Pe||Zn(),!(Pe!=null&&Pe.has(e))){const t=new Le;t.beginFill(e),t.drawRect(0,0,Ho,Ho),t.endFill();const i=r.renderer.generateTexture(t);Pe.set(e,i)}return Pe.get(e)}function zo({pixiApp:r,fill:e,borderRadius:t,boxCapWidth:i,height:n}){if(Re||Zn(),!(Re!=null&&Re.has(e))){const s=new Le;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 o=Xr({pixiApp:r,fill:e}),a=r.renderer.generateTexture(s,Wo),h=o;Re.set(e,{cap:a,body:h})}return Re.get(e)}function Ju({pixiApp:r,strokeColor:e,edgeWidth:t,edgeLength:i}){if(Ce||Zn(),!(Ce!=null&&Ce.has(e))){const n=new Le;n.lineStyle(t,e,1,.5),n.moveTo(-i,-i),n.lineTo(0,0),n.lineTo(-i,i);const s=r.renderer.generateTexture(n,Wo);Ce.set(e,s)}return Ce.get(e)}function r0({pixiApp:r,borderRadius:e,borderColor:t,borderWidth:i}){Oe||Zn();const n={borderRadius:e,borderColor:t,borderWidth:i};if(!(Oe!=null&&Oe.has(n))){const s=new Le;s.lineStyle(i,t),s.moveTo(0,e),s.bezierCurveTo(0,e,0,0,e,0);const o=Xr({pixiApp:r,fill:t}),a=r.renderer.generateTexture(s,Wo);Oe.set(n,{corner:a,edge:o})}return Oe.get(n)}function Ke(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function Qu(r,e){r.prototype=Object.create(e.prototype),r.prototype.constructor=r,r.__proto__=e}var ee={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},ir={duration:.5,overwrite:!1,delay:0},Yo,zt,Mt,fe=1e8,ut=1/fe,Vo=Math.PI*2,n0=Vo/4,s0=0,tl=Math.sqrt,o0=Math.cos,a0=Math.sin,kt=function(e){return typeof e=="string"},St=function(e){return typeof e=="function"},$e=function(e){return typeof e=="number"},jo=function(e){return typeof e>"u"},Ge=function(e){return typeof e=="object"},Zt=function(e){return e!==!1},el=function(){return typeof window<"u"},qn=function(e){return St(e)||kt(e)},il=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},Yt=Array.isArray,Zo=/(?:-?\.?\d|\.)+/gi,rl=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,rr=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,qo=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,nl=/[+-]=-?[.\d]+/,sl=/[^,'"\[\]\s]+/gi,h0=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,mt,ce,Ko,$o,ie={},Kn={},ol,al=function(e){return(Kn=Fi(e,ie))&&se},Jo=function(e,t){return console.warn("Invalid property",e,"set to",t,"Missing plugin? gsap.registerPlugin()")},$n=function(e,t){return!t&&console.warn(e)},hl=function(e,t){return e&&(ie[e]=t)&&Kn&&(Kn[e]=t)||ie},Hr=function(){return 0},u0={suppressEvents:!0,isStart:!0,kill:!1},Jn={suppressEvents:!0,kill:!1},l0={suppressEvents:!0},Qo={},hi=[],ta={},ul,re={},ea={},ll=30,Qn=[],ia="",ra=function(e){var t=e[0],i,n;if(Ge(t)||St(t)||(e=[e]),!(i=(t._gsap||{}).harness)){for(n=Qn.length;n--&&!Qn[n].targetTest(t););i=Qn[n]}for(n=e.length;n--;)e[n]&&(e[n]._gsap||(e[n]._gsap=new Ll(e[n],i)))||e.splice(n,1);return e},Di=function(e){return e._gsap||ra(ve(e))[0]._gsap},fl=function(e,t,i){return(i=e[t])&&St(i)?e[t]():jo(i)&&e.getAttribute&&e.getAttribute(t)||i},qt=function(e,t){return(e=e.split(",")).forEach(t)||e},At=function(e){return Math.round(e*1e5)/1e5||0},Ht=function(e){return Math.round(e*1e7)/1e7||0},nr=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},f0=function(e,t){for(var i=t.length,n=0;e.indexOf(t[n])<0&&++n<i;);return n<i},ts=function(){var e=hi.length,t=hi.slice(0),i,n;for(ta={},hi.length=0,i=0;i<e;i++)n=t[i],n&&n._lazy&&(n.render(n._lazy[0],n._lazy[1],!0)._lazy=0)},cl=function(e,t,i,n){hi.length&&!zt&&ts(),e.render(t,i,n||zt&&t<0&&(e._initted||e._startAt)),hi.length&&!zt&&ts()},dl=function(e){var t=parseFloat(e);return(t||t===0)&&(e+"").match(sl).length<2?t:kt(e)?e.trim():e},pl=function(e){return e},de=function(e,t){for(var i in t)i in e||(e[i]=t[i]);return e},c0=function(e){return function(t,i){for(var n in i)n in t||n==="duration"&&e||n==="ease"||(t[n]=i[n])}},Fi=function(e,t){for(var i in t)e[i]=t[i];return e},vl=function r(e,t){for(var i in t)i!=="__proto__"&&i!=="constructor"&&i!=="prototype"&&(e[i]=Ge(t[i])?r(e[i]||(e[i]={}),t[i]):t[i]);return e},es=function(e,t){var i={},n;for(n in e)n in t||(i[n]=e[n]);return i},Wr=function(e){var t=e.parent||mt,i=e.keyframes?c0(Yt(e.keyframes)):de;if(Zt(e.inherit))for(;t;)i(e,t.vars.defaults),t=t.parent||t._dp;return e},d0=function(e,t){for(var i=e.length,n=i===t.length;n&&i--&&e[i]===t[i];);return i<0},_l=function(e,t,i,n,s){i===void 0&&(i="_first"),n===void 0&&(n="_last");var o=e[n],a;if(s)for(a=t[s];o&&o[s]>a;)o=o._prev;return o?(t._next=o._next,o._next=t):(t._next=e[i],e[i]=t),t._next?t._next._prev=t:e[n]=t,t._prev=o,t.parent=t._dp=e,t},is=function(e,t,i,n){i===void 0&&(i="_first"),n===void 0&&(n="_last");var s=t._prev,o=t._next;s?s._next=o:e[i]===t&&(e[i]=o),o?o._prev=s:e[n]===t&&(e[n]=s),t._next=t._prev=t.parent=null},ui=function(e,t){e.parent&&(!t||e.parent.autoRemoveChildren)&&e.parent.remove(e),e._act=0},Bi=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},p0=function(e){for(var t=e.parent;t&&t.parent;)t._dirty=1,t.totalDuration(),t=t.parent;return e},na=function(e,t,i,n){return e._startAt&&(zt?e._startAt.revert(Jn):e.vars.immediateRender&&!e.vars.autoRevert||e._startAt.render(t,!0,n))},v0=function r(e){return!e||e._ts&&r(e.parent)},gl=function(e){return e._repeat?sr(e._tTime,e=e.duration()+e._rDelay)*e:0},sr=function(e,t){var i=Math.floor(e/=t);return e&&i===e?i-1:i},rs=function(e,t){return(e-t._start)*t._ts+(t._ts>=0?0:t._dirty?t.totalDuration():t._tDur)},ns=function(e){return e._end=Ht(e._start+(e._tDur/Math.abs(e._ts||e._rts||ut)||0))},ss=function(e,t){var i=e._dp;return i&&i.smoothChildTiming&&e._ts&&(e._start=Ht(i._time-(e._ts>0?t/e._ts:((e._dirty?e.totalDuration():e._tDur)-t)/-e._ts)),ns(e),i._dirty||Bi(i,e)),e},ml=function(e,t){var i;if((t._time||t._initted&&!t._dur)&&(i=rs(e.rawTime(),t),(!t._dur||Yr(0,t.totalDuration(),i)-t._tTime>ut)&&t.render(i,!0)),Bi(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=-ut}},Ue=function(e,t,i,n){return t.parent&&ui(t),t._start=Ht(($e(i)?i:i||e!==mt?pe(e,i,t):e._time)+t._delay),t._end=Ht(t._start+(t.totalDuration()/Math.abs(t.timeScale())||0)),_l(e,t,"_first","_last",e._sort?"_start":0),sa(t)||(e._recent=t),n||ml(e,t),e._ts<0&&ss(e,e._tTime),e},yl=function(e,t){return(ie.ScrollTrigger||Jo("scrollTrigger",t))&&ie.ScrollTrigger.create(t,e)},xl=function(e,t,i,n,s){if(pa(e,t,s),!e._initted)return 1;if(!i&&e._pt&&!zt&&(e._dur&&e.vars.lazy!==!1||!e._dur&&e.vars.lazy)&&ul!==ne.frame)return hi.push(e),e._lazy=[s,n],1},_0=function r(e){var t=e.parent;return t&&t._ts&&t._initted&&!t._lock&&(t.rawTime()<0||r(t))},sa=function(e){var t=e.data;return t==="isFromStart"||t==="isStart"},g0=function(e,t,i,n){var s=e.ratio,o=t<0||!t&&(!e._start&&_0(e)&&!(!e._initted&&sa(e))||(e._ts<0||e._dp._ts<0)&&!sa(e))?0:1,a=e._rDelay,h=0,u,l,f;if(a&&e._repeat&&(h=Yr(0,e._tDur,t),l=sr(h,a),e._yoyo&&l&1&&(o=1-o),l!==sr(e._tTime,a)&&(s=1-o,e.vars.repeatRefresh&&e._initted&&e.invalidate())),o!==s||zt||n||e._zTime===ut||!t&&e._zTime){if(!e._initted&&xl(e,t,n,i,h))return;for(f=e._zTime,e._zTime=t||(i?ut:0),i||(i=t&&!f),e.ratio=o,e._from&&(o=1-o),e._time=0,e._tTime=h,u=e._pt;u;)u.r(o,u.d),u=u._next;t<0&&na(e,t,i,!0),e._onUpdate&&!i&&_e(e,"onUpdate"),h&&e._repeat&&!i&&e.parent&&_e(e,"onRepeat"),(t>=e._tDur||t<0)&&e.ratio===o&&(o&&ui(e,1),!i&&!zt&&(_e(e,o?"onComplete":"onReverseComplete",!0),e._prom&&e._prom()))}else e._zTime||(e._zTime=t)},m0=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}},or=function(e,t,i,n){var s=e._repeat,o=Ht(t)||0,a=e._tTime/e._tDur;return a&&!n&&(e._time*=o/e._dur),e._dur=o,e._tDur=s?s<0?1e10:Ht(o*(s+1)+e._rDelay*s):o,a>0&&!n&&ss(e,e._tTime=e._tDur*a),e.parent&&ns(e),i||Bi(e.parent,e),e},bl=function(e){return e instanceof Kt?Bi(e):or(e,e._dur)},y0={_start:0,endTime:Hr,totalDuration:Hr},pe=function r(e,t,i){var n=e.labels,s=e._recent||y0,o=e.duration()>=fe?s.endTime(!1):e._dur,a,h,u;return kt(t)&&(isNaN(t)||t in n)?(h=t.charAt(0),u=t.substr(-1)==="%",a=t.indexOf("="),h==="<"||h===">"?(a>=0&&(t=t.replace(/=/,"")),(h==="<"?s._start:s.endTime(s._repeat>=0))+(parseFloat(t.substr(1))||0)*(u?(a<0?s:i).totalDuration()/100:1)):a<0?(t in n||(n[t]=o),n[t]):(h=parseFloat(t.charAt(a-1)+t.substr(a+1)),u&&i&&(h=h/100*(Yt(i)?i[0]:i).totalDuration()),a>1?r(e,t.substr(0,a-1),i)+h:o+h)):t==null?o:+t},zr=function(e,t,i){var n=$e(t[1]),s=(n?2:1)+(e<2?0:1),o=t[s],a,h;if(n&&(o.duration=t[1]),o.parent=i,e){for(a=o,h=i;h&&!("immediateRender"in a);)a=h.vars.defaults||{},h=Zt(h.vars.inherit)&&h.parent;o.immediateRender=Zt(a.immediateRender),e<2?o.runBackwards=1:o.startAt=t[s-1]}return new Bt(t[0],o,t[s+1])},li=function(e,t){return e||e===0?t(e):t},Yr=function(e,t,i){return i<e?e:i>t?t:i},Vt=function(e,t){return!kt(e)||!(t=h0.exec(e))?"":t[1]},x0=function(e,t,i){return li(i,function(n){return Yr(e,t,n)})},oa=[].slice,Tl=function(e,t){return e&&Ge(e)&&"length"in e&&(!t&&!e.length||e.length-1 in e&&Ge(e[0]))&&!e.nodeType&&e!==ce},b0=function(e,t,i){return i===void 0&&(i=[]),e.forEach(function(n){var s;return kt(n)&&!t||Tl(n,1)?(s=i).push.apply(s,ve(n)):i.push(n)})||i},ve=function(e,t,i){return Mt&&!t&&Mt.selector?Mt.selector(e):kt(e)&&!i&&(Ko||!hr())?oa.call((t||$o).querySelectorAll(e),0):Yt(e)?b0(e,i):Tl(e)?oa.call(e,0):e?[e]:[]},aa=function(e){return e=ve(e)[0]||$n("Invalid scope")||{},function(t){var i=e.current||e.nativeElement||e;return ve(t,i.querySelectorAll?i:i===e?$n("Invalid scope")||$o.createElement("div"):e)}},wl=function(e){return e.sort(function(){return .5-Math.random()})},El=function(e){if(St(e))return e;var t=Ge(e)?e:{each:e},i=Li(t.ease),n=t.from||0,s=parseFloat(t.base)||0,o={},a=n>0&&n<1,h=isNaN(n)||a,u=t.axis,l=n,f=n;return kt(n)?l=f={center:.5,edges:.5,end:1}[n]||0:!a&&h&&(l=n[0],f=n[1]),function(c,d,v){var p=(v||t).length,_=o[p],g,y,m,b,x,T,w,S,E;if(!_){if(E=t.grid==="auto"?0:(t.grid||[1,fe])[1],!E){for(w=-fe;w<(w=v[E++].getBoundingClientRect().left)&&E<p;);E--}for(_=o[p]=[],g=h?Math.min(E,p)*l-.5:n%E,y=E===fe?0:h?p*f/E-.5:n/E|0,w=0,S=fe,T=0;T<p;T++)m=T%E-g,b=y-(T/E|0),_[T]=x=u?Math.abs(u==="y"?b:m):tl(m*m+b*b),x>w&&(w=x),x<S&&(S=x);n==="random"&&wl(_),_.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=Vt(t.amount||t.each)||0,i=i&&p<0?Dl(i):i}return p=(_[c]-_.min)/_.max||0,Ht(_.b+(i?i(p):p)*_.v)+_.u}},ha=function(e){var t=Math.pow(10,((e+"").split(".")[1]||"").length);return function(i){var n=Ht(Math.round(parseFloat(i)/e)*e*t);return(n-n%1)/t+($e(i)?0:Vt(i))}},Sl=function(e,t){var i=Yt(e),n,s;return!i&&Ge(e)&&(n=i=e.radius||fe,e.values?(e=ve(e.values),(s=!$e(e[0]))&&(n*=n)):e=ha(e.increment)),li(t,i?St(e)?function(o){return s=e(o),Math.abs(s-o)<=n?s:o}:function(o){for(var a=parseFloat(s?o.x:o),h=parseFloat(s?o.y:0),u=fe,l=0,f=e.length,c,d;f--;)s?(c=e[f].x-a,d=e[f].y-h,c=c*c+d*d):c=Math.abs(e[f]-a),c<u&&(u=c,l=f);return l=!n||u<=n?e[l]:o,s||l===o||$e(o)?l:l+Vt(o)}:ha(e))},Pl=function(e,t,i,n){return li(Yt(e)?!t:i===!0?!!(i=0):!n,function(){return Yt(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})},T0=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,o){return o(s)},n)}},w0=function(e,t){return function(i){return e(parseFloat(i))+(t||Vt(i))}},E0=function(e,t,i){return Cl(e,t,0,1,i)},Rl=function(e,t,i){return li(i,function(n){return e[~~t(n)]})},S0=function r(e,t,i){var n=t-e;return Yt(e)?Rl(e,r(0,e.length),t):li(i,function(s){return(n+(s-e)%n)%n+e})},P0=function r(e,t,i){var n=t-e,s=n*2;return Yt(e)?Rl(e,r(0,e.length-1),t):li(i,function(o){return o=(s+(o-e)%s)%s||0,e+(o>n?s-o:o)})},Vr=function(e){for(var t=0,i="",n,s,o,a;~(n=e.indexOf("random(",t));)o=e.indexOf(")",n),a=e.charAt(n+7)==="[",s=e.substr(n+7,o-n-7).match(a?sl:Zo),i+=e.substr(t,n-t)+Pl(a?s:+s[0],a?0:+s[1],+s[2]||1e-5),t=o+1;return i+e.substr(t,e.length-t)},Cl=function(e,t,i,n,s){var o=t-e,a=n-i;return li(s,function(h){return i+((h-e)/o*a||0)})},R0=function r(e,t,i,n){var s=isNaN(e+t)?0:function(d){return(1-d)*e+d*t};if(!s){var o=kt(e),a={},h,u,l,f,c;if(i===!0&&(n=1)&&(i=null),o)e={p:e},t={p:t};else if(Yt(e)&&!Yt(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=Fi(Yt(e)?[]:{},e));if(!l){for(h in t)ca.call(a,e,h,"get",t[h]);s=function(v){return ga(v,a)||(o?e.p:e)}}}return li(i,s)},Ol=function(e,t,i){var n=e.labels,s=fe,o,a,h;for(o in n)a=n[o]-t,a<0==!!i&&a&&s>(a=Math.abs(a))&&(h=o,s=a);return h},_e=function(e,t,i){var n=e.vars,s=n[t],o=Mt,a=e._ctx,h,u,l;if(s)return h=n[t+"Params"],u=n.callbackScope||e,i&&hi.length&&ts(),a&&(Mt=a),l=h?s.apply(u,h):s.call(u),Mt=o,l},jr=function(e){return ui(e),e.scrollTrigger&&e.scrollTrigger.kill(!!zt),e.progress()<1&&_e(e,"onInterrupt"),e},ar,C0=function(e){e=!e.name&&e.default||e;var t=e.name,i=St(e),n=t&&!i&&e.init?function(){this._props=[]}:e,s={init:Hr,render:ga,add:ca,kill:z0,modifier:W0,rawVars:0},o={targetTest:0,get:0,getSetter:_a,aliases:{},register:0};if(hr(),e!==n){if(re[t])return;de(n,de(es(e,s),o)),Fi(n.prototype,Fi(s,es(e,o))),re[n.prop=t]=n,e.targetTest&&(Qn.push(n),Qo[t]=1),t=(t==="css"?"CSS":t.charAt(0).toUpperCase()+t.substr(1))+"Plugin"}hl(t,n),e.register&&e.register(se,n,$t)},lt=255,Zr={aqua:[0,lt,lt],lime:[0,lt,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,lt],navy:[0,0,128],white:[lt,lt,lt],olive:[128,128,0],yellow:[lt,lt,0],orange:[lt,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[lt,0,0],pink:[lt,192,203],cyan:[0,lt,lt],transparent:[lt,lt,lt,0]},ua=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)*lt+.5|0},Al=function(e,t,i){var n=e?$e(e)?[e>>16,e>>8&lt,e&lt]:0:Zr.black,s,o,a,h,u,l,f,c,d,v;if(!n){if(e.substr(-1)===","&&(e=e.substr(0,e.length-1)),Zr[e])n=Zr[e];else if(e.charAt(0)==="#"){if(e.length<6&&(s=e.charAt(1),o=e.charAt(2),a=e.charAt(3),e="#"+s+s+o+o+a+a+(e.length===5?e.charAt(4)+e.charAt(4):"")),e.length===9)return n=parseInt(e.substr(1,6),16),[n>>16,n>>8&lt,n&lt,parseInt(e.substr(7),16)/255];e=parseInt(e.substr(1),16),n=[e>>16,e>>8&lt,e&lt]}else if(e.substr(0,3)==="hsl"){if(n=v=e.match(Zo),!t)h=+n[0]%360/360,u=+n[1]/100,l=+n[2]/100,o=l<=.5?l*(u+1):l+u-l*u,s=l*2-o,n.length>3&&(n[3]*=1),n[0]=ua(h+1/3,s,o),n[1]=ua(h,s,o),n[2]=ua(h-1/3,s,o);else if(~e.indexOf("="))return n=e.match(rl),i&&n.length<4&&(n[3]=1),n}else n=e.match(Zo)||Zr.transparent;n=n.map(Number)}return t&&!v&&(s=n[0]/lt,o=n[1]/lt,a=n[2]/lt,f=Math.max(s,o,a),c=Math.min(s,o,a),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?(o-a)/d+(o<a?6:0):f===o?(a-s)/d+2:(s-o)/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},Il=function(e){var t=[],i=[],n=-1;return e.split(fi).forEach(function(s){var o=s.match(rr)||[];t.push.apply(t,o),i.push(n+=o.length+1)}),t.c=i,t},Ml=function(e,t,i){var n="",s=(e+n).match(fi),o=t?"hsla(":"rgba(",a=0,h,u,l,f;if(!s)return e;if(s=s.map(function(c){return(c=Al(c,t,1))&&o+(t?c[0]+","+c[1]+"%,"+c[2]+"%,"+c[3]:c.join(","))+")"}),i&&(l=Il(e),h=i.c,h.join(n)!==l.c.join(n)))for(u=e.replace(fi,"1").split(rr),f=u.length-1;a<f;a++)n+=u[a]+(~h.indexOf(a)?s.shift()||o+"0,0,0,0)":(l.length?l:s.length?s:i).shift());if(!u)for(u=e.split(fi),f=u.length-1;a<f;a++)n+=u[a]+s[a];return n+u[f]},fi=function(){var r="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",e;for(e in Zr)r+="|"+e+"\\b";return new RegExp(r+")","gi")}(),O0=/hsl[a]?\(/,Nl=function(e){var t=e.join(" "),i;if(fi.lastIndex=0,fi.test(t))return i=O0.test(t),e[1]=Ml(e[1],i),e[0]=Ml(e[0],i,Il(e[1])),!0},qr,ne=function(){var r=Date.now,e=500,t=33,i=r(),n=i,s=1e3/240,o=s,a=[],h,u,l,f,c,d,v=function p(_){var g=r()-n,y=_===!0,m,b,x,T;if(g>e&&(i+=g-t),n+=g,x=n-i,m=x-o,(m>0||y)&&(T=++f.frame,c=x-f.time*1e3,f.time=x=x/1e3,o+=m+(m>=s?4:s-m),b=1),y||(h=u(p)),b)for(d=0;d<a.length;d++)a[d](x,c,T,_)};return f={time:0,frame:0,tick:function(){v(!0)},deltaRatio:function(_){return c/(1e3/(_||60))},wake:function(){ol&&(!Ko&&el()&&(ce=Ko=window,$o=ce.document||{},ie.gsap=se,(ce.gsapVersions||(ce.gsapVersions=[])).push(se.version),al(Kn||ce.GreenSockGlobals||!ce.gsap&&ce||{}),l=ce.requestAnimationFrame),h&&f.sleep(),u=l||function(_){return setTimeout(_,o-f.time*1e3+1|0)},qr=1,v(2))},sleep:function(){(l?ce.cancelAnimationFrame:clearTimeout)(h),qr=0,u=Hr},lagSmoothing:function(_,g){e=_||1/0,t=Math.min(g||33,e)},fps:function(_){s=1e3/(_||240),o=f.time*1e3+s},add:function(_,g,y){var m=g?function(b,x,T,w){_(b,x,T,w),f.remove(m)}:_;return f.remove(_),a[y?"unshift":"push"](m),hr(),m},remove:function(_,g){~(g=a.indexOf(_))&&a.splice(g,1)&&d>=g&&d--},_listeners:a},f}(),hr=function(){return!qr&&ne.wake()},it={},A0=/^[\d.\-M][\d.\-,\s]/,I0=/["']/g,M0=function(e){for(var t={},i=e.substr(1,e.length-3).split(":"),n=i[0],s=1,o=i.length,a,h,u;s<o;s++)h=i[s],a=s!==o-1?h.lastIndexOf(","):h.length,u=h.substr(0,a),t[n]=isNaN(u)?u.replace(I0,"").trim():+u,n=h.substr(a+1).trim();return t},N0=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)},D0=function(e){var t=(e+"").split("("),i=it[t[0]];return i&&t.length>1&&i.config?i.config.apply(null,~e.indexOf("{")?[M0(t[1])]:N0(e).split(",").map(dl)):it._CE&&A0.test(e)?it._CE("",e):i},Dl=function(e){return function(t){return 1-e(1-t)}},Fl=function r(e,t){for(var i=e._first,n;i;)i instanceof Kt?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},Li=function(e,t){return e&&(St(e)?e:it[e]||D0(e))||t},Gi=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},o;return qt(e,function(a){it[a]=ie[a]=s,it[o=a.toLowerCase()]=i;for(var h in s)it[o+(h==="easeIn"?".in":h==="easeOut"?".out":".inOut")]=it[a+"."+h]=s[h]}),s},Bl=function(e){return function(t){return t<.5?(1-e(1-t*2))/2:.5+e((t-.5)*2)/2}},la=function r(e,t,i){var n=t>=1?t:1,s=(i||(e?.3:.45))/(t<1?t:1),o=s/Vo*(Math.asin(1/n)||0),a=function(l){return l===1?1:n*Math.pow(2,-10*l)*a0((l-o)*s)+1},h=e==="out"?a:e==="in"?function(u){return 1-a(1-u)}:Bl(a);return s=Vo/s,h.config=function(u,l){return r(e,u,l)},h},fa=function r(e,t){t===void 0&&(t=1.70158);var i=function(o){return o?--o*o*((t+1)*o+t)+1:0},n=e==="out"?i:e==="in"?function(s){return 1-i(1-s)}:Bl(i);return n.config=function(s){return r(e,s)},n};qt("Linear,Quad,Cubic,Quart,Quint,Strong",function(r,e){var t=e<5?e+1:e;Gi(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})}),it.Linear.easeNone=it.none=it.Linear.easeIn,Gi("Elastic",la("in"),la("out"),la()),function(r,e){var t=1/e,i=2*t,n=2.5*t,s=function(a){return a<t?r*a*a:a<i?r*Math.pow(a-1.5/e,2)+.75:a<n?r*(a-=2.25/e)*a+.9375:r*Math.pow(a-2.625/e,2)+.984375};Gi("Bounce",function(o){return 1-s(1-o)},s)}(7.5625,2.75),Gi("Expo",function(r){return r?Math.pow(2,10*(r-1)):0}),Gi("Circ",function(r){return-(tl(1-r*r)-1)}),Gi("Sine",function(r){return r===1?1:-o0(r*n0)+1}),Gi("Back",fa("in"),fa("out"),fa()),it.SteppedEase=it.steps=ie.SteppedEase={config:function(e,t){e===void 0&&(e=1);var i=1/e,n=e+(t?0:1),s=t?1:0,o=1-ut;return function(a){return((n*Yr(0,o,a)|0)+s)*i}}},ir.ease=it["quad.out"],qt("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(r){return ia+=r+","+r+"Params,"});var Ll=function(e,t){this.id=s0++,e._gsap=this,this.target=e,this.harness=t,this.get=t?t.get:fl,this.set=t?t.getSetter:_a},ur=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,or(this,+t.duration,1,1),this.data=t.data,Mt&&(this._ctx=Mt,Mt.data.push(this)),qr||ne.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,or(this,this._repeat<0?i:(i-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(i,n){if(hr(),!arguments.length)return this._tTime;var s=this._dp;if(s&&s.smoothChildTiming&&this._ts){for(ss(this,i),!s._dp||s.parent||ml(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)&&Ue(this._dp,this,this._start-this._delay)}return(this._tTime!==i||!this._dur&&!n||this._initted&&Math.abs(this._zTime)===ut||!i&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=i),cl(this,i,n)),this},e.time=function(i,n){return arguments.length?this.totalTime(Math.min(this.totalDuration(),i+gl(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)+gl(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?sr(this._tTime,s)+1:1},e.timeScale=function(i){if(!arguments.length)return this._rts===-ut?0:this._rts;if(this._rts===i)return this;var n=this.parent&&this._ts?rs(this.parent._time,this):this._tTime;return this._rts=+i||0,this._ts=this._ps||i===-ut?0:this._rts,this.totalTime(Yr(-this._delay,this._tDur,n),!0),ns(this),p0(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):(hr(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==ut&&(this._tTime-=ut)))),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)&&Ue(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?rs(n.rawTime(i),this):this._tTime:this._tTime},e.revert=function(i){i===void 0&&(i=l0);var n=zt;return zt=i,(this._initted||this._startAt)&&(this.timeline&&this.timeline.revert(i),this.totalTime(-.01,i.suppressEvents)),this.data!=="nested"&&i.kill!==!1&&this.kill(),zt=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,bl(this)):this._repeat===-2?1/0:this._repeat},e.repeatDelay=function(i){if(arguments.length){var n=this._time;return this._rDelay=i,bl(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(pe(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?-ut:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-ut,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)-ut)},e.eventCallback=function(i,n,s){var o=this.vars;return arguments.length>1?(n?(o[i]=n,s&&(o[i+"Params"]=s),i==="onUpdate"&&(this._onUpdate=n)):delete o[i],this):o[i]},e.then=function(i){var n=this;return new Promise(function(s){var o=St(i)?i:pl,a=function(){var u=n.then;n.then=null,St(o)&&(o=o(n))&&(o.then||o===n)&&(n.then=u),s(o),n.then=u};n._initted&&n.totalProgress()===1&&n._ts>=0||!n._tTime&&n._ts<0?a():n._prom=a})},e.kill=function(){jr(this)},r}();de(ur.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:-ut,_prom:0,_ps:!1,_rts:1});var Kt=function(r){Qu(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),mt&&Ue(i.parent||mt,Ke(s),n),i.reversed&&s.reverse(),i.paused&&s.paused(!0),i.scrollTrigger&&yl(Ke(s),i.scrollTrigger),s}var t=e.prototype;return t.to=function(n,s,o){return zr(0,arguments,this),this},t.from=function(n,s,o){return zr(1,arguments,this),this},t.fromTo=function(n,s,o,a){return zr(2,arguments,this),this},t.set=function(n,s,o){return s.duration=0,s.parent=this,Wr(s).repeatDelay||(s.repeat=0),s.immediateRender=!!s.immediateRender,new Bt(n,s,pe(this,o),1),this},t.call=function(n,s,o){return Ue(this,Bt.delayedCall(0,n,s),o)},t.staggerTo=function(n,s,o,a,h,u,l){return o.duration=s,o.stagger=o.stagger||a,o.onComplete=u,o.onCompleteParams=l,o.parent=this,new Bt(n,o,pe(this,h)),this},t.staggerFrom=function(n,s,o,a,h,u,l){return o.runBackwards=1,Wr(o).immediateRender=Zt(o.immediateRender),this.staggerTo(n,s,o,a,h,u,l)},t.staggerFromTo=function(n,s,o,a,h,u,l,f){return a.startAt=o,Wr(a).immediateRender=Zt(a.immediateRender),this.staggerTo(n,s,a,h,u,l,f)},t.render=function(n,s,o){var a=this._time,h=this._dirty?this.totalDuration():this._tDur,u=this._dur,l=n<=0?0:Ht(n),f=this._zTime<0!=n<0&&(this._initted||!u),c,d,v,p,_,g,y,m,b,x,T,w;if(this!==mt&&l>h&&n>=0&&(l=h),l!==this._tTime||o||f){if(a!==this._time&&u&&(l+=this._time-a,n+=this._time-a),c=l,b=this._start,m=this._ts,g=!m,f&&(u||(a=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,o);if(c=Ht(l%_),l===h?(p=this._repeat,c=u):(p=~~(l/_),p&&p===l/_&&(c=u,p--),c>u&&(c=u)),x=sr(this._tTime,_),!a&&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),a=S?0:u,this._lock=1,this.render(a||(w?0:Ht(p*_)),s,!u)._lock=0,this._tTime=l,!s&&this.parent&&_e(this,"onRepeat"),this.vars.repeatRefresh&&!w&&(this.invalidate()._lock=1),a&&a!==this._time||g!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(u=this._dur,h=this._tDur,E&&(this._lock=2,a=S?u:-1e-4,this.render(a,!0),this.vars.repeatRefresh&&!w&&this.invalidate()),this._lock=0,!this._ts&&!g)return this;Fl(this,w)}}if(this._hasPause&&!this._forcing&&this._lock<2&&(y=m0(this,Ht(a),Ht(c)),y&&(l-=c-(c=y._start))),this._tTime=l,this._time=c,this._act=!m,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=n,a=0),!a&&c&&!s&&(_e(this,"onStart"),this._tTime!==l))return this;if(c>=a&&n>=0)for(d=this._first;d;){if(v=d._next,(d._act||c>=d._start)&&d._ts&&y!==d){if(d.parent!==this)return this.render(n,s,o);if(d.render(d._ts>0?(c-d._start)*d._ts:(d._dirty?d.totalDuration():d._tDur)+(c-d._start)*d._ts,s,o),c!==this._time||!this._ts&&!g){y=0,v&&(l+=this._zTime=-ut);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&&y!==d){if(d.parent!==this)return this.render(n,s,o);if(d.render(d._ts>0?(P-d._start)*d._ts:(d._dirty?d.totalDuration():d._tDur)+(P-d._start)*d._ts,s,o||zt&&(d._initted||d._startAt)),c!==this._time||!this._ts&&!g){y=0,v&&(l+=this._zTime=P?-ut:ut);break}}d=v}}if(y&&!s&&(this.pause(),y.render(c>=a?0:-ut)._zTime=c>=a?1:-1,this._ts))return this._start=b,ns(this),this.render(n,s,o);this._onUpdate&&!s&&_e(this,"onUpdate",!0),(l===h&&this._tTime>=this.totalDuration()||!l&&a)&&(b===this._start||Math.abs(m)!==Math.abs(this._ts))&&(this._lock||((n||!u)&&(l===h&&this._ts>0||!l&&this._ts<0)&&ui(this,1),!s&&!(n<0&&!a)&&(l||a||!h)&&(_e(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 o=this;if($e(s)||(s=pe(this,s,n)),!(n instanceof ur)){if(Yt(n))return n.forEach(function(a){return o.add(a,s)}),this;if(kt(n))return this.addLabel(n,s);if(St(n))n=Bt.delayedCall(0,n);else return this}return this!==n?Ue(this,n,s):this},t.getChildren=function(n,s,o,a){n===void 0&&(n=!0),s===void 0&&(s=!0),o===void 0&&(o=!0),a===void 0&&(a=-fe);for(var h=[],u=this._first;u;)u._start>=a&&(u instanceof Bt?s&&h.push(u):(o&&h.push(u),n&&h.push.apply(h,u.getChildren(!0,s,o)))),u=u._next;return h},t.getById=function(n){for(var s=this.getChildren(1,1,1),o=s.length;o--;)if(s[o].vars.id===n)return s[o]},t.remove=function(n){return kt(n)?this.removeLabel(n):St(n)?this.killTweensOf(n):(is(this,n),n===this._recent&&(this._recent=this._last),Bi(this))},t.totalTime=function(n,s){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=Ht(ne.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]=pe(this,s),this},t.removeLabel=function(n){return delete this.labels[n],this},t.addPause=function(n,s,o){var a=Bt.delayedCall(0,s||Hr,o);return a.data="isPause",this._hasPause=1,Ue(this,a,pe(this,n))},t.removePause=function(n){var s=this._first;for(n=pe(this,n);s;)s._start===n&&s.data==="isPause"&&ui(s),s=s._next},t.killTweensOf=function(n,s,o){for(var a=this.getTweensOf(n,o),h=a.length;h--;)ci!==a[h]&&a[h].kill(n,s);return this},t.getTweensOf=function(n,s){for(var o=[],a=ve(n),h=this._first,u=$e(s),l;h;)h instanceof Bt?f0(h._targets,a)&&(u?(!ci||h._initted&&h._ts)&&h.globalTime(0)<=s&&h.globalTime(h.totalDuration())>s:!s||h.isActive())&&o.push(h):(l=h.getTweensOf(a,s)).length&&o.push.apply(o,l),h=h._next;return o},t.tweenTo=function(n,s){s=s||{};var o=this,a=pe(o,n),h=s,u=h.startAt,l=h.onStart,f=h.onStartParams,c=h.immediateRender,d,v=Bt.to(o,de({ease:s.ease||"none",lazy:!1,immediateRender:!1,time:a,overwrite:"auto",duration:s.duration||Math.abs((a-(u&&"time"in u?u.time:o._time))/o.timeScale())||ut,onStart:function(){if(o.pause(),!d){var _=s.duration||Math.abs((a-(u&&"time"in u?u.time:o._time))/o.timeScale());v._dur!==_&&or(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,o){return this.tweenTo(s,de({startAt:{time:pe(this,n)}},o))},t.recent=function(){return this._recent},t.nextLabel=function(n){return n===void 0&&(n=this._time),Ol(this,pe(this,n))},t.previousLabel=function(n){return n===void 0&&(n=this._time),Ol(this,pe(this,n),1)},t.currentLabel=function(n){return arguments.length?this.seek(n,!0):this.previousLabel(this._time+ut)},t.shiftChildren=function(n,s,o){o===void 0&&(o=0);for(var a=this._first,h=this.labels,u;a;)a._start>=o&&(a._start+=n,a._end+=n),a=a._next;if(s)for(u in h)h[u]>=o&&(h[u]+=n);return Bi(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,o;s;)o=s._next,this.remove(s),s=o;return this._dp&&(this._time=this._tTime=this._pTime=0),n&&(this.labels={}),Bi(this)},t.totalDuration=function(n){var s=0,o=this,a=o._last,h=fe,u,l,f;if(arguments.length)return o.timeScale((o._repeat<0?o.duration():o.totalDuration())/(o.reversed()?-n:n));if(o._dirty){for(f=o.parent;a;)u=a._prev,a._dirty&&a.totalDuration(),l=a._start,l>h&&o._sort&&a._ts&&!o._lock?(o._lock=1,Ue(o,a,l-a._delay,1)._lock=0):h=l,l<0&&a._ts&&(s-=l,(!f&&!o._dp||f&&f.smoothChildTiming)&&(o._start+=l/o._ts,o._time-=l,o._tTime-=l),o.shiftChildren(-l,!1,-1/0),h=0),a._end>s&&a._ts&&(s=a._end),a=u;or(o,o===mt&&o._time>s?o._time:s,1,1),o._dirty=0}return o._tDur},e.updateRoot=function(n){if(mt._ts&&(cl(mt,rs(n,mt)),ul=ne.frame),ne.frame>=ll){ll+=ee.autoSleep||120;var s=mt._first;if((!s||!s._ts)&&ee.autoSleep&&ne._listeners.length<2){for(;s&&!s._ts;)s=s._next;s||ne.sleep()}}},e}(ur);de(Kt.prototype,{_lock:0,_hasPause:0,_forcing:0});var F0=function(e,t,i,n,s,o,a){var h=new $t(this._pt,e,t,0,1,Wl,null,s),u=0,l=0,f,c,d,v,p,_,g,y;for(h.b=i,h.e=n,i+="",n+="",(g=~n.indexOf("random("))&&(n=Vr(n)),o&&(y=[i,n],o(y,e,t),i=y[0],n=y[1]),c=i.match(qo)||[];f=qo.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)==="="?nr(_,v)-_:parseFloat(v)-_,m:d&&d<4?Math.round:0},u=qo.lastIndex);return h.c=u<n.length?n.substring(u,n.length):"",h.fp=a,(nl.test(n)||g)&&(h.e=0),this._pt=h,h},ca=function(e,t,i,n,s,o,a,h,u,l){St(n)&&(n=n(s||0,e,o));var f=e[t],c=i!=="get"?i:St(f)?u?e[t.indexOf("set")||!St(e["get"+t.substr(3)])?t:"get"+t.substr(3)](u):e[t]():f,d=St(f)?u?k0:Xl:va,v;if(kt(n)&&(~n.indexOf("random(")&&(n=Vr(n)),n.charAt(1)==="="&&(v=nr(c,n)+(Vt(c)||0),(v||v===0)&&(n=v))),!l||c!==n||da)return!isNaN(c*n)&&n!==""?(v=new $t(this._pt,e,t,+c||0,n-(c||0),typeof f=="boolean"?H0:Hl,0,d),u&&(v.fp=u),a&&v.modifier(a,this,e),this._pt=v):(!f&&!(t in e)&&Jo(t,n),F0.call(this,e,t,c,n,d,h||ee.stringFilter,u))},B0=function(e,t,i,n,s){if(St(e)&&(e=Kr(e,s,t,i,n)),!Ge(e)||e.style&&e.nodeType||Yt(e)||il(e))return kt(e)?Kr(e,s,t,i,n):e;var o={},a;for(a in e)o[a]=Kr(e[a],s,t,i,n);return o},Gl=function(e,t,i,n,s,o){var a,h,u,l;if(re[e]&&(a=new re[e]).init(s,a.rawVars?t[e]:B0(t[e],n,s,o,i),i,n,o)!==!1&&(i._pt=h=new $t(i._pt,s,e,0,1,a.render,a,0,a.priority),i!==ar))for(u=i._ptLookup[i._targets.indexOf(s)],l=a._props.length;l--;)u[a._props[l]]=h;return a},ci,da,pa=function r(e,t,i){var n=e.vars,s=n.ease,o=n.startAt,a=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,g=e._startAt,y=e._targets,m=e.parent,b=m&&m.data==="nested"?m.vars.targets:y,x=e._overwrite==="auto"&&!Yo,T=e.timeline,w,S,E,P,O,D,N,U,I,A,B,K,z;if(T&&(!v||!s)&&(s="none"),e._ease=Li(s,ir.ease),e._yEase=d?Dl(Li(d===!0?s:d,ir.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=y[0]?Di(y[0]).harness:0,K=U&&n[U.prop],w=es(n,Qo),g&&(g._zTime<0&&g.progress(1),t<0&&c&&a&&!p?g.render(-1,!0):g.revert(c&&_?Jn:u0),g._lazy=0),o){if(ui(e._startAt=Bt.set(y,de({data:"isStart",overwrite:!1,parent:m,immediateRender:!0,lazy:!g&&Zt(h),startAt:null,delay:0,onUpdate:u,onUpdateParams:l,callbackScope:f,stagger:0},o))),e._startAt._dp=0,e._startAt._sat=e,t<0&&(zt||!a&&!p)&&e._startAt.revert(Jn),a&&_&&t<=0&&i<=0){t&&(e._zTime=t);return}}else if(c&&_&&!g){if(t&&(a=!1),E=de({overwrite:!1,data:"isFromStart",lazy:a&&!g&&Zt(h),immediateRender:a,stagger:0,parent:m},w),K&&(E[U.prop]=K),ui(e._startAt=Bt.set(y,E)),e._startAt._dp=0,e._startAt._sat=e,t<0&&(zt?e._startAt.revert(Jn):e._startAt.render(-1,!0)),e._zTime=t,!a)r(e._startAt,ut,ut);else if(!t)return}for(e._pt=e._ptCache=0,h=_&&Zt(h)||h&&!_,S=0;S<y.length;S++){if(O=y[S],N=O._gsap||ra(y)[S]._gsap,e._ptLookup[S]=A={},ta[N.id]&&hi.length&&ts(),B=b===y?S:b.indexOf(O),U&&(I=new U).init(O,K||w,e,B,b)!==!1&&(e._pt=P=new $t(e._pt,O,I.name,0,1,I.render,I,0,I.priority),I._props.forEach(function(M){A[M]=P}),I.priority&&(D=1)),!U||K)for(E in w)re[E]&&(I=Gl(E,w,e,B,O,b))?I.priority&&(D=1):A[E]=P=ca.call(e,O,E,"get",w[E],B,b,0,n.stringFilter);e._op&&e._op[S]&&e.kill(O,e._op[S]),x&&e._pt&&(ci=e,mt.killTweensOf(O,A,e.globalTime(t)),z=!e.parent,ci=0),e._pt&&h&&(ta[N.id]=1)}D&&zl(e),e._onInit&&e._onInit(e)}e._onUpdate=u,e._initted=(!e._op||e._pt)&&!z,v&&t<=0&&T.render(fe,!0,!0)},L0=function(e,t,i,n,s,o,a){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 da=1,e.vars[t]="+=0",pa(e,a),da=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)+o*u.c,u.c=i-u.s,l.e&&(l.e=At(i)+Vt(l.e)),l.b&&(l.b=u.s+Vt(l.b))},G0=function(e,t){var i=e[0]?Di(e[0]).harness:0,n=i&&i.aliases,s,o,a,h;if(!n)return t;s=Fi({},t);for(o in n)if(o in s)for(h=n[o].split(","),a=h.length;a--;)s[h[a]]=s[o];return s},U0=function(e,t,i,n){var s=t.ease||n||"power1.inOut",o,a;if(Yt(t))a=i[e]||(i[e]=[]),t.forEach(function(h,u){return a.push({t:u/(t.length-1)*100,v:h,e:s})});else for(o in t)a=i[o]||(i[o]=[]),o==="ease"||a.push({t:parseFloat(e),v:t[o],e:s})},Kr=function(e,t,i,n,s){return St(e)?e.call(t,i,n,s):kt(e)&&~e.indexOf("random(")?Vr(e):e},Ul=ia+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert",kl={};qt(Ul+",id,stagger,delay,duration,paused,scrollTrigger",function(r){return kl[r]=1});var Bt=function(r){Qu(e,r);function e(i,n,s,o){var a;typeof n=="number"&&(s.duration=n,n=s,s=null),a=r.call(this,o?n:Wr(n))||this;var h=a.vars,u=h.duration,l=h.delay,f=h.immediateRender,c=h.stagger,d=h.overwrite,v=h.keyframes,p=h.defaults,_=h.scrollTrigger,g=h.yoyoEase,y=n.parent||mt,m=(Yt(i)||il(i)?$e(i[0]):"length"in n)?[i]:ve(i),b,x,T,w,S,E,P,O;if(a._targets=m.length?ra(m):$n("GSAP target "+i+" not found. https://greensock.com",!ee.nullTargetWarn)||[],a._ptLookup=[],a._overwrite=d,v||c||qn(u)||qn(l)){if(n=a.vars,b=a.timeline=new Kt({data:"nested",defaults:p||{},targets:y&&y.data==="nested"?y.vars.targets:m}),b.kill(),b.parent=b._dp=Ke(a),b._start=0,c||qn(u)||qn(l)){if(w=m.length,P=c&&El(c),Ge(c))for(S in c)~Ul.indexOf(S)&&(O||(O={}),O[S]=c[S]);for(x=0;x<w;x++)T=es(n,kl),T.stagger=0,g&&(T.yoyoEase=g),O&&Fi(T,O),E=m[x],T.duration=+Kr(u,Ke(a),x,E,m),T.delay=(+Kr(l,Ke(a),x,E,m)||0)-a._delay,!c&&w===1&&T.delay&&(a._delay=l=T.delay,a._start+=l,T.delay=0),b.to(E,T,P?P(x,E,m):0),b._ease=it.none;b.duration()?u=l=0:a.timeline=0}else if(v){Wr(de(b.vars.defaults,{ease:"none"})),b._ease=Li(v.ease||n.ease||"none");var D=0,N,U,I;if(Yt(v))v.forEach(function(A){return b.to(m,A,">")}),b.duration();else{T={};for(S in v)S==="ease"||S==="easeEach"||U0(S,v[S],T,v.easeEach);for(S in T)for(N=T[S].sort(function(A,B){return A.t-B.t}),D=0,x=0;x<N.length;x++)U=N[x],I={ease:U.e,duration:(U.t-(x?N[x-1].t:0))/100*u},I[S]=U.v,b.to(m,I,D),D+=I.duration;b.duration()<u&&b.to({},{duration:u-b.duration()})}}u||a.duration(u=b.duration())}else a.timeline=0;return d===!0&&!Yo&&(ci=Ke(a),mt.killTweensOf(m),ci=0),Ue(y,Ke(a),s),n.reversed&&a.reverse(),n.paused&&a.paused(!0),(f||!u&&!v&&a._start===Ht(y._time)&&Zt(f)&&v0(Ke(a))&&y.data!=="nested")&&(a._tTime=-ut,a.render(Math.max(0,-l)||0)),_&&yl(Ke(a),_),a}var t=e.prototype;return t.render=function(n,s,o){var a=this._time,h=this._tDur,u=this._dur,l=n<0,f=n>h-ut&&!l?h:n<ut?0:n,c,d,v,p,_,g,y,m,b;if(!u)g0(this,n,s,o);else if(f!==this._tTime||!n||o||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==l){if(c=f,m=this.timeline,this._repeat){if(p=u+this._rDelay,this._repeat<-1&&l)return this.totalTime(p*100+n,s,o);if(c=Ht(f%p),f===h?(v=this._repeat,c=u):(v=~~(f/p),v&&v===f/p&&(c=u,v--),c>u&&(c=u)),g=this._yoyo&&v&1,g&&(b=this._yEase,c=u-c),_=sr(this._tTime,p),c===a&&!o&&this._initted)return this._tTime=f,this;v!==_&&(m&&this._yEase&&Fl(m,g),this.vars.repeatRefresh&&!g&&!this._lock&&(this._lock=o=1,this.render(Ht(p*v),!0).invalidate()._lock=0))}if(!this._initted){if(xl(this,l?n:c,o,s,f))return this._tTime=0,this;if(a!==this._time)return this;if(u!==this._dur)return this.render(n,s,o)}if(this._tTime=f,this._time=c,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=y=(b||this._ease)(c/u),this._from&&(this.ratio=y=1-y),c&&!a&&!s&&(_e(this,"onStart"),this._tTime!==f))return this;for(d=this._pt;d;)d.r(y,d.d),d=d._next;m&&m.render(n<0?n:!c&&g?-ut:m._dur*m._ease(c/this._dur),s,o)||this._startAt&&(this._zTime=n),this._onUpdate&&!s&&(l&&na(this,n,s,o),_e(this,"onUpdate")),this._repeat&&v!==_&&this.vars.onRepeat&&!s&&this.parent&&_e(this,"onRepeat"),(f===this._tDur||!f)&&this._tTime===f&&(l&&!this._onUpdate&&na(this,n,!0,!0),(n||!u)&&(f===this._tDur&&this._ts>0||!f&&this._ts<0)&&ui(this,1),!s&&!(l&&!a)&&(f||a||g)&&(_e(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,o,a){qr||ne.wake(),this._ts||this.play();var h=Math.min(this._dur,(this._dp._time-this._start)*this._ts),u;return this._initted||pa(this,h),u=this._ease(h/this._dur),L0(this,n,s,o,a,u,h)?this.resetTo(n,s,o,a):(ss(this,0),this.parent||_l(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?jr(this):this;if(this.timeline){var o=this.timeline.totalDuration();return this.timeline.killTweensOf(n,s,ci&&ci.vars.overwrite!==!0)._first||jr(this),this.parent&&o!==this.timeline.totalDuration()&&or(this,this._dur*this.timeline._tDur/o,0,1),this}var a=this._targets,h=n?ve(n):a,u=this._ptLookup,l=this._pt,f,c,d,v,p,_,g;if((!s||s==="all")&&d0(a,h))return s==="all"&&(this._pt=0),jr(this);for(f=this._op=this._op||[],s!=="all"&&(kt(s)&&(p={},qt(s,function(y){return p[y]=1}),s=p),s=G0(a,s)),g=a.length;g--;)if(~h.indexOf(a[g])){c=u[g],s==="all"?(f[g]=s,v=c,d={}):(d=f[g]=f[g]||{},v=s);for(p in v)_=c&&c[p],_&&((!("kill"in _.d)||_.d.kill(p)===!0)&&is(this,_,"_pt"),delete c[p]),d!=="all"&&(d[p]=1)}return this._initted&&!this._pt&&l&&jr(this),this},e.to=function(n,s){return new e(n,s,arguments[2])},e.from=function(n,s){return zr(1,arguments)},e.delayedCall=function(n,s,o,a){return new e(s,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:n,onComplete:s,onReverseComplete:s,onCompleteParams:o,onReverseCompleteParams:o,callbackScope:a})},e.fromTo=function(n,s,o){return zr(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,o){return mt.killTweensOf(n,s,o)},e}(ur);de(Bt.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0}),qt("staggerTo,staggerFrom,staggerFromTo",function(r){Bt[r]=function(){var e=new Kt,t=oa.call(arguments,0);return t.splice(r==="staggerFromTo"?5:4,0,0),e[r].apply(e,t)}});var va=function(e,t,i){return e[t]=i},Xl=function(e,t,i){return e[t](i)},k0=function(e,t,i,n){return e[t](n.fp,i)},X0=function(e,t,i){return e.setAttribute(t,i)},_a=function(e,t){return St(e[t])?Xl:jo(e[t])&&e.setAttribute?X0:va},Hl=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e6)/1e6,t)},H0=function(e,t){return t.set(t.t,t.p,!!(t.s+t.c*e),t)},Wl=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)},ga=function(e,t){for(var i=t._pt;i;)i.r(e,i.d),i=i._next},W0=function(e,t,i,n){for(var s=this._pt,o;s;)o=s._next,s.p===n&&s.modifier(e,t,i),s=o},z0=function(e){for(var t=this._pt,i,n;t;)n=t._next,t.p===e&&!t.op||t.op===e?is(this,t,"_pt"):t.dep||(i=1),t=n;return!i},Y0=function(e,t,i,n){n.mSet(e,t,n.m.call(n.tween,i,n.mt),n)},zl=function(e){for(var t=e._pt,i,n,s,o;t;){for(i=t._next,n=s;n&&n.pr>t.pr;)n=n._next;(t._prev=n?n._prev:o)?t._prev._next=t:s=t,(t._next=n)?n._prev=t:o=t,t=i}e._pt=s},$t=function(){function r(t,i,n,s,o,a,h,u,l){this.t=i,this.s=s,this.c=o,this.p=n,this.r=a||Hl,this.d=h||this,this.set=u||va,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=Y0,this.m=i,this.mt=s,this.tween=n},r}();qt(ia+"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 Qo[r]=1}),ie.TweenMax=ie.TweenLite=Bt,ie.TimelineLite=ie.TimelineMax=Kt,mt=new Kt({sortChildren:!1,defaults:ir,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0}),ee.stringFilter=Nl;var lr=[],os={},V0=[],Yl=0,ma=function(e){return(os[e]||V0).map(function(t){return t()})},ya=function(){var e=Date.now(),t=[];e-Yl>2&&(ma("matchMediaInit"),lr.forEach(function(i){var n=i.queries,s=i.conditions,o,a,h,u;for(a in n)o=ce.matchMedia(n[a]).matches,o&&(h=1),o!==s[a]&&(s[a]=o,u=1);u&&(i.revert(),h&&t.push(i))}),ma("matchMediaRevert"),t.forEach(function(i){return i.onMatch(i)}),Yl=e,ma("matchMedia"))},Vl=function(){function r(t,i){this.selector=i&&aa(i),this.data=[],this._r=[],this.isReverted=!1,t&&this.add(t)}var e=r.prototype;return e.add=function(i,n,s){St(i)&&(s=n,n=i,i=St);var o=this,a=function(){var u=Mt,l=o.selector,f;return u&&u!==o&&u.data.push(o),s&&(o.selector=aa(s)),Mt=o,f=n.apply(o,arguments),St(f)&&o._r.push(f),Mt=u,o.selector=l,o.isReverted=!1,f};return o.last=a,i===St?a(o):i?o[i]=a:a},e.ignore=function(i){var n=Mt;Mt=null,i(this),Mt=n},e.getTweens=function(){var i=[];return this.data.forEach(function(n){return n instanceof r?i.push.apply(i,n.getTweens()):n instanceof Bt&&!(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 o=this.getTweens();this.data.forEach(function(h){h.data==="isFlip"&&(h.revert(),h.getChildren(!0,!0,!1).forEach(function(u){return o.splice(o.indexOf(u),1)}))}),o.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 ur)&&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 a=lr.indexOf(this);~a&&lr.splice(a,1)}},e.revert=function(i){this.kill(i||{})},r}(),j0=function(){function r(t){this.contexts=[],this.scope=t}var e=r.prototype;return e.add=function(i,n,s){Ge(i)||(i={matches:i});var o=new Vl(0,s||this.scope),a=o.conditions={},h,u,l;this.contexts.push(o),n=o.add("onMatch",n),o.queries=i;for(u in i)u==="all"?l=1:(h=ce.matchMedia(i[u]),h&&(lr.indexOf(o)<0&&lr.push(o),(a[u]=h.matches)&&(l=1),h.addListener?h.addListener(ya):h.addEventListener("change",ya)));return l&&n(o),this},e.revert=function(i){this.kill(i||{})},e.kill=function(i){this.contexts.forEach(function(n){return n.kill(i,!0)})},r}(),as={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 C0(n)})},timeline:function(e){return new Kt(e)},getTweensOf:function(e,t){return mt.getTweensOf(e,t)},getProperty:function(e,t,i,n){kt(e)&&(e=ve(e)[0]);var s=Di(e||{}).get,o=i?pl:dl;return i==="native"&&(i=""),e&&(t?o((re[t]&&re[t].get||s)(e,t,i,n)):function(a,h,u){return o((re[a]&&re[a].get||s)(e,a,h,u))})},quickSetter:function(e,t,i){if(e=ve(e),e.length>1){var n=e.map(function(l){return se.quickSetter(l,t,i)}),s=n.length;return function(l){for(var f=s;f--;)n[f](l)}}e=e[0]||{};var o=re[t],a=Di(e),h=a.harness&&(a.harness.aliases||{})[t]||t,u=o?function(l){var f=new o;ar._pt=0,f.init(e,i?l+i:l,ar,0,[e]),f.render(1,f),ar._pt&&ga(1,ar)}:a.set(e,h);return o?u:function(l){return u(e,h,i?l+i:l,a,1)}},quickTo:function(e,t,i){var n,s=se.to(e,Fi((n={},n[t]="+=0.1",n.paused=!0,n),i||{})),o=function(h,u,l){return s.resetTo(t,h,u,l)};return o.tween=s,o},isTweening:function(e){return mt.getTweensOf(e,!0).length>0},defaults:function(e){return e&&e.ease&&(e.ease=Li(e.ease,ir.ease)),vl(ir,e||{})},config:function(e){return vl(ee,e||{})},registerEffect:function(e){var t=e.name,i=e.effect,n=e.plugins,s=e.defaults,o=e.extendTimeline;(n||"").split(",").forEach(function(a){return a&&!re[a]&&!ie[a]&&$n(t+" effect requires "+a+" plugin.")}),ea[t]=function(a,h,u){return i(ve(a),de(h||{},s),u)},o&&(Kt.prototype[t]=function(a,h,u){return this.add(ea[t](a,Ge(h)?h:(u=h)&&{},this),u)})},registerEase:function(e,t){it[e]=Li(t)},parseEase:function(e,t){return arguments.length?Li(e,t):it},getById:function(e){return mt.getById(e)},exportRoot:function(e,t){e===void 0&&(e={});var i=new Kt(e),n,s;for(i.smoothChildTiming=Zt(e.smoothChildTiming),mt.remove(i),i._dp=0,i._time=i._tTime=mt._time,n=mt._first;n;)s=n._next,(t||!(!n._dur&&n instanceof Bt&&n.vars.onComplete===n._targets[0]))&&Ue(i,n,n._start-n._delay),n=s;return Ue(mt,i,0),i},context:function(e,t){return e?new Vl(e,t):Mt},matchMedia:function(e){return new j0(e)},matchMediaRefresh:function(){return lr.forEach(function(e){var t=e.conditions,i,n;for(n in t)t[n]&&(t[n]=!1,i=1);i&&e.revert()})||ya()},addEventListener:function(e,t){var i=os[e]||(os[e]=[]);~i.indexOf(t)||i.push(t)},removeEventListener:function(e,t){var i=os[e],n=i&&i.indexOf(t);n>=0&&i.splice(n,1)},utils:{wrap:S0,wrapYoyo:P0,distribute:El,random:Pl,snap:Sl,normalize:E0,getUnit:Vt,clamp:x0,splitColor:Al,toArray:ve,selector:aa,mapRange:Cl,pipe:T0,unitize:w0,interpolate:R0,shuffle:wl},install:al,effects:ea,ticker:ne,updateRoot:Kt.updateRoot,plugins:re,globalTimeline:mt,core:{PropTween:$t,globals:hl,Tween:Bt,Timeline:Kt,Animation:ur,getCache:Di,_removeLinkedListItem:is,reverting:function(){return zt},context:function(e){return e&&Mt&&(Mt.data.push(e),e._ctx=Mt),Mt},suppressOverwrites:function(e){return Yo=e}}};qt("to,from,fromTo,delayedCall,set,killTweensOf",function(r){return as[r]=Bt[r]}),ne.add(Kt.updateRoot),ar=as.to({},{duration:0});var Z0=function(e,t){for(var i=e._pt;i&&i.p!==t&&i.op!==t&&i.fp!==t;)i=i._next;return i},q0=function(e,t){var i=e._targets,n,s,o;for(n in t)for(s=i.length;s--;)o=e._ptLookup[s][n],o&&(o=o.d)&&(o._pt&&(o=Z0(o,n)),o&&o.modifier&&o.modifier(t[n],e,i[s],n))},xa=function(e,t){return{name:e,rawVars:1,init:function(n,s,o){o._onInit=function(a){var h,u;if(kt(s)&&(h={},qt(s,function(l){return h[l]=1}),s=h),t){h={};for(u in s)h[u]=t(s[u]);s=h}q0(a,s)}}}},se=as.registerPlugin({name:"attr",init:function(e,t,i,n,s){var o,a,h;this.tween=i;for(o in t)h=e.getAttribute(o)||"",a=this.add(e,"setAttribute",(h||0)+"",t[o],n,s,0,0,o),a.op=o,a.b=h,this._props.push(o)},render:function(e,t){for(var i=t._pt;i;)zt?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)}},xa("roundProps",ha),xa("modifiers"),xa("snap",Sl))||as;Bt.version=Kt.version=se.version="3.11.4",ol=1,el()&&hr(),it.Power0,it.Power1,it.Power2,it.Power3,it.Power4,it.Linear,it.Quad,it.Cubic,it.Quart,it.Quint,it.Strong,it.Elastic,it.Back,it.SteppedEase,it.Bounce,it.Sine,it.Expo,it.Circ;var jl,di,fr,ba,Ui,Zl,Ta,K0=function(){return typeof window<"u"},Je={},ki=180/Math.PI,cr=Math.PI/180,dr=Math.atan2,ql=1e8,wa=/([A-Z])/g,$0=/(left|right|width|margin|padding|x)/i,J0=/[\s,\(]\S/,Qe={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},Ea=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e4)/1e4+t.u,t)},Q0=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)},tx=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)},ex=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)},$l=function(e,t){return t.set(t.t,t.p,e!==1?t.b:t.e,t)},ix=function(e,t,i){return e.style[t]=i},rx=function(e,t,i){return e.style.setProperty(t,i)},nx=function(e,t,i){return e._gsap[t]=i},sx=function(e,t,i){return e._gsap.scaleX=e._gsap.scaleY=i},ox=function(e,t,i,n,s){var o=e._gsap;o.scaleX=o.scaleY=i,o.renderTransform(s,o)},ax=function(e,t,i,n,s){var o=e._gsap;o[t]=i,o.renderTransform(s,o)},yt="transform",Ae=yt+"Origin",hx=function(e,t){var i=this,n=this.target,s=n.style;if(e in Je){if(this.tfm=this.tfm||{},e!=="transform"&&(e=Qe[e]||e,~e.indexOf(",")?e.split(",").forEach(function(o){return i.tfm[o]=ti(n,o)}):this.tfm[e]=n._gsap.x?n._gsap[e]:ti(n,e)),this.props.indexOf(yt)>=0)return;n._gsap.svg&&(this.svgo=n.getAttribute("data-svg-origin"),this.props.push(Ae,t,"")),e=yt}(s||t)&&this.props.push(e,t,s[e])},Jl=function(e){e.translate&&(e.removeProperty("translate"),e.removeProperty("scale"),e.removeProperty("rotate"))},ux=function(){var e=this.props,t=this.target,i=t.style,n=t._gsap,s,o;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(wa,"-$1").toLowerCase());if(this.tfm){for(o in this.tfm)n[o]=this.tfm[o];n.svg&&(n.renderTransform(),t.setAttribute("data-svg-origin",this.svgo||"")),s=Ta(),s&&!s.isStart&&!i[yt]&&(Jl(i),n.uncache=1)}},Ql=function(e,t){var i={target:e,props:[],revert:ux,save:hx};return t&&t.split(",").forEach(function(n){return i.save(n)}),i},tf,Sa=function(e,t){var i=di.createElementNS?di.createElementNS((t||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),e):di.createElement(e);return i.style?i:di.createElement(e)},ke=function r(e,t,i){var n=getComputedStyle(e);return n[t]||n.getPropertyValue(t.replace(wa,"-$1").toLowerCase())||n.getPropertyValue(t)||!i&&r(e,pr(t)||t,1)||""},ef="O,Moz,ms,Ms,Webkit".split(","),pr=function(e,t,i){var n=t||Ui,s=n.style,o=5;if(e in s&&!i)return e;for(e=e.charAt(0).toUpperCase()+e.substr(1);o--&&!(ef[o]+e in s););return o<0?null:(o===3?"ms":o>=0?ef[o]:"")+e},Pa=function(){K0()&&window.document&&(jl=window,di=jl.document,fr=di.documentElement,Ui=Sa("div")||{style:{}},Sa("div"),yt=pr(yt),Ae=yt+"Origin",Ui.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",tf=!!pr("perspective"),Ta=se.core.reverting,ba=1)},Ra=function r(e){var t=Sa("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),i=this.parentNode,n=this.nextSibling,s=this.style.cssText,o;if(fr.appendChild(t),t.appendChild(this),this.style.display="block",e)try{o=this.getBBox(),this._gsapBBox=this.getBBox,this.getBBox=r}catch{}else this._gsapBBox&&(o=this._gsapBBox());return i&&(n?i.insertBefore(this,n):i.appendChild(this)),fr.removeChild(t),this.style.cssText=s,o},rf=function(e,t){for(var i=t.length;i--;)if(e.hasAttribute(t[i]))return e.getAttribute(t[i])},nf=function(e){var t;try{t=e.getBBox()}catch{t=Ra.call(e,!0)}return t&&(t.width||t.height)||e.getBBox===Ra||(t=Ra.call(e,!0)),t&&!t.width&&!t.x&&!t.y?{x:+rf(e,["x","cx","x1"])||0,y:+rf(e,["y","cy","y1"])||0,width:0,height:0}:t},sf=function(e){return!!(e.getCTM&&(!e.parentNode||e.ownerSVGElement)&&nf(e))},$r=function(e,t){if(t){var i=e.style;t in Je&&t!==Ae&&(t=yt),i.removeProperty?((t.substr(0,2)==="ms"||t.substr(0,6)==="webkit")&&(t="-"+t),i.removeProperty(t.replace(wa,"-$1").toLowerCase())):i.removeAttribute(t)}},pi=function(e,t,i,n,s,o){var a=new $t(e._pt,t,i,0,1,o?$l:Kl);return e._pt=a,a.b=n,a.e=s,e._props.push(i),a},of={deg:1,rad:1,turn:1},lx={grid:1,flex:1},vi=function r(e,t,i,n){var s=parseFloat(i)||0,o=(i+"").trim().substr((s+"").length)||"px",a=Ui.style,h=$0.test(t),u=e.tagName.toLowerCase()==="svg",l=(u?"client":"offset")+(h?"Width":"Height"),f=100,c=n==="px",d=n==="%",v,p,_,g;return n===o||!s||of[n]||of[o]?s:(o!=="px"&&!c&&(s=r(e,t,i,"px")),g=e.getCTM&&sf(e),(d||o==="%")&&(Je[t]||~t.indexOf("adius"))?(v=g?e.getBBox()[h?"width":"height"]:e[l],At(d?s/v*f:s/100*v)):(a[h?"width":"height"]=f+(c?o:n),p=~t.indexOf("adius")||n==="em"&&e.appendChild&&!u?e:e.parentNode,g&&(p=(e.ownerSVGElement||{}).parentNode),(!p||p===di||!p.appendChild)&&(p=di.body),_=p._gsap,_&&d&&_.width&&h&&_.time===ne.time&&!_.uncache?At(s/_.width*f):((d||o==="%")&&!lx[ke(p,"display")]&&(a.position=ke(e,"position")),p===e&&(a.position="static"),p.appendChild(Ui),v=Ui[l],p.removeChild(Ui),a.position="absolute",h&&d&&(_=Di(p),_.time=ne.time,_.width=p[l]),At(c?v*s/f:v&&s?f/v*s:0))))},ti=function(e,t,i,n){var s;return ba||Pa(),t in Qe&&t!=="transform"&&(t=Qe[t],~t.indexOf(",")&&(t=t.split(",")[0])),Je[t]&&t!=="transform"?(s=Qr(e,n),s=t!=="transformOrigin"?s[t]:s.svg?s.origin:us(ke(e,Ae))+" "+s.zOrigin+"px"):(s=e.style[t],(!s||s==="auto"||n||~(s+"").indexOf("calc("))&&(s=hs[t]&&hs[t](e,t,i)||ke(e,t)||fl(e,t)||(t==="opacity"?1:0))),i&&!~(s+"").trim().indexOf(" ")?vi(e,t,s,i)+i:s},fx=function(e,t,i,n){if(!i||i==="none"){var s=pr(t,e,1),o=s&&ke(e,s,1);o&&o!==i?(t=s,i=o):t==="borderColor"&&(i=ke(e,"borderTopColor"))}var a=new $t(this._pt,e.style,t,0,1,Wl),h=0,u=0,l,f,c,d,v,p,_,g,y,m,b,x;if(a.b=i,a.e=n,i+="",n+="",n==="auto"&&(e.style[t]=n,n=ke(e,t)||n,e.style[t]=i),l=[i,n],Nl(l),i=l[0],n=l[1],c=i.match(rr)||[],x=n.match(rr)||[],x.length){for(;f=rr.exec(n);)_=f[0],y=n.substring(h,f.index),v?v=(v+1)%5:(y.substr(-5)==="rgba("||y.substr(-5)==="hsla(")&&(v=1),_!==(p=c[u++]||"")&&(d=parseFloat(p)||0,b=p.substr((d+"").length),_.charAt(1)==="="&&(_=nr(d,_)+b),g=parseFloat(_),m=_.substr((g+"").length),h=rr.lastIndex-m.length,m||(m=m||ee.units[t]||b,h===n.length&&(n+=m,a.e+=m)),b!==m&&(d=vi(e,t,p,m)||0),a._pt={_next:a._pt,p:y||u===1?y:",",s:d,c:g-d,m:v&&v<4||t==="zIndex"?Math.round:0});a.c=h<n.length?n.substring(h,n.length):""}else a.r=t==="display"&&n==="none"?$l:Kl;return nl.test(n)&&(a.e=0),this._pt=a,a},af={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},cx=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]=af[i]||i,t[1]=af[n]||n,t.join(" ")},dx=function(e,t){if(t.tween&&t.tween._time===t.tween._dur){var i=t.t,n=i.style,s=t.u,o=i._gsap,a,h,u;if(s==="all"||s===!0)n.cssText="",h=1;else for(s=s.split(","),u=s.length;--u>-1;)a=s[u],Je[a]&&(h=1,a=a==="transformOrigin"?Ae:yt),$r(i,a);h&&($r(i,yt),o&&(o.svg&&i.removeAttribute("transform"),Qr(i,1),o.uncache=1,Jl(n)))}},hs={clearProps:function(e,t,i,n,s){if(s.data!=="isFromStart"){var o=e._pt=new $t(e._pt,t,i,0,0,dx);return o.u=n,o.pr=-10,o.tween=s,e._props.push(i),1}}},Jr=[1,0,0,1,0,0],hf={},uf=function(e){return e==="matrix(1, 0, 0, 1, 0, 0)"||e==="none"||!e},lf=function(e){var t=ke(e,yt);return uf(t)?Jr:t.substr(7).match(rl).map(At)},Ca=function(e,t){var i=e._gsap||Di(e),n=e.style,s=lf(e),o,a,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"?Jr:s):(s===Jr&&!e.offsetParent&&e!==fr&&!i.svg&&(h=n.display,n.display="block",o=e.parentNode,(!o||!e.offsetParent)&&(u=1,a=e.nextElementSibling,fr.appendChild(e)),s=lf(e),h?n.display=h:$r(e,"display"),u&&(a?o.insertBefore(e,a):o?o.appendChild(e):fr.removeChild(e))),t&&s.length>6?[s[0],s[1],s[4],s[5],s[12],s[13]]:s)},Oa=function(e,t,i,n,s,o){var a=e._gsap,h=s||Ca(e,!0),u=a.xOrigin||0,l=a.yOrigin||0,f=a.xOffset||0,c=a.yOffset||0,d=h[0],v=h[1],p=h[2],_=h[3],g=h[4],y=h[5],m=t.split(" "),b=parseFloat(m[0])||0,x=parseFloat(m[1])||0,T,w,S,E;i?h!==Jr&&(w=d*_-v*p)&&(S=b*(_/w)+x*(-p/w)+(p*y-_*g)/w,E=b*(-v/w)+x*(d/w)-(d*y-v*g)/w,b=S,x=E):(T=nf(e),b=T.x+(~m[0].indexOf("%")?b/100*T.width:b),x=T.y+(~(m[1]||m[0]).indexOf("%")?x/100*T.height:x)),n||n!==!1&&a.smooth?(g=b-u,y=x-l,a.xOffset=f+(g*d+y*p)-g,a.yOffset=c+(g*v+y*_)-y):a.xOffset=a.yOffset=0,a.xOrigin=b,a.yOrigin=x,a.smooth=!!n,a.origin=t,a.originIsAbsolute=!!i,e.style[Ae]="0px 0px",o&&(pi(o,a,"xOrigin",u,b),pi(o,a,"yOrigin",l,x),pi(o,a,"xOffset",f,a.xOffset),pi(o,a,"yOffset",c,a.yOffset)),e.setAttribute("data-svg-origin",b+" "+x)},Qr=function(e,t){var i=e._gsap||new Ll(e);if("x"in i&&!t&&!i.uncache)return i;var n=e.style,s=i.scaleX<0,o="px",a="deg",h=getComputedStyle(e),u=ke(e,Ae)||"0",l,f,c,d,v,p,_,g,y,m,b,x,T,w,S,E,P,O,D,N,U,I,A,B,K,z,M,C,G,tt,V,nt;return l=f=c=p=_=g=y=m=b=0,d=v=1,i.svg=!!(e.getCTM&&sf(e)),h.translate&&((h.translate!=="none"||h.scale!=="none"||h.rotate!=="none")&&(n[yt]=(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[yt]!=="none"?h[yt]:"")),n.scale=n.rotate=n.translate="none"),w=Ca(e,i.svg),i.svg&&(i.uncache?(K=e.getBBox(),u=i.xOrigin-K.x+"px "+(i.yOrigin-K.y)+"px",B=""):B=!t&&e.getAttribute("data-svg-origin"),Oa(e,B||u,!!B||i.originIsAbsolute,i.smooth!==!1,w)),x=i.xOrigin||0,T=i.yOrigin||0,w!==Jr&&(O=w[0],D=w[1],N=w[2],U=w[3],l=I=w[4],f=A=w[5],w.length===6?(d=Math.sqrt(O*O+D*D),v=Math.sqrt(U*U+N*N),p=O||D?dr(D,O)*ki:0,y=N||U?dr(N,U)*ki+p:0,y&&(v*=Math.abs(Math.cos(y*cr))),i.svg&&(l-=x-(x*O+T*N),f-=T-(x*D+T*U))):(nt=w[6],tt=w[7],M=w[8],C=w[9],G=w[10],V=w[11],l=w[12],f=w[13],c=w[14],S=dr(nt,G),_=S*ki,S&&(E=Math.cos(-S),P=Math.sin(-S),B=I*E+M*P,K=A*E+C*P,z=nt*E+G*P,M=I*-P+M*E,C=A*-P+C*E,G=nt*-P+G*E,V=tt*-P+V*E,I=B,A=K,nt=z),S=dr(-N,G),g=S*ki,S&&(E=Math.cos(-S),P=Math.sin(-S),B=O*E-M*P,K=D*E-C*P,z=N*E-G*P,V=U*P+V*E,O=B,D=K,N=z),S=dr(D,O),p=S*ki,S&&(E=Math.cos(S),P=Math.sin(S),B=O*E+D*P,K=I*E+A*P,D=D*E-O*P,A=A*E-I*P,O=B,I=K),_&&Math.abs(_)+Math.abs(p)>359.9&&(_=p=0,g=180-g),d=At(Math.sqrt(O*O+D*D+N*N)),v=At(Math.sqrt(A*A+nt*nt)),S=dr(I,A),y=Math.abs(S)>2e-4?S*ki:0,b=V?1/(V<0?-V:V):0),i.svg&&(B=e.getAttribute("transform"),i.forceCSS=e.setAttribute("transform","")||!uf(ke(e,yt)),B&&e.setAttribute("transform",B))),Math.abs(y)>90&&Math.abs(y)<270&&(s?(d*=-1,y+=p<=0?180:-180,p+=p<=0?180:-180):(v*=-1,y+=y<=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)+o,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)+o,i.z=c+o,i.scaleX=At(d),i.scaleY=At(v),i.rotation=At(p)+a,i.rotationX=At(_)+a,i.rotationY=At(g)+a,i.skewX=y+a,i.skewY=m+a,i.transformPerspective=b+o,(i.zOrigin=parseFloat(u.split(" ")[2])||0)&&(n[Ae]=us(u)),i.xOffset=i.yOffset=0,i.force3D=ee.force3D,i.renderTransform=i.svg?vx:tf?ff:px,i.uncache=0,i},us=function(e){return(e=e.split(" "))[0]+" "+e[1]},Aa=function(e,t,i){var n=Vt(t);return At(parseFloat(t)+parseFloat(vi(e,"x",i+"px",n)))+n},px=function(e,t){t.z="0px",t.rotationY=t.rotationX="0deg",t.force3D=0,ff(e,t)},Xi="0deg",tn="0px",Hi=") ",ff=function(e,t){var i=t||this,n=i.xPercent,s=i.yPercent,o=i.x,a=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,g=i.force3D,y=i.target,m=i.zOrigin,b="",x=g==="auto"&&e&&e!==1||g===!0;if(m&&(f!==Xi||l!==Xi)){var T=parseFloat(l)*cr,w=Math.sin(T),S=Math.cos(T),E;T=parseFloat(f)*cr,E=Math.cos(T),o=Aa(y,o,w*E*-m),a=Aa(y,a,-Math.sin(T)*-m),h=Aa(y,h,S*E*-m+m)}_!==tn&&(b+="perspective("+_+Hi),(n||s)&&(b+="translate("+n+"%, "+s+"%) "),(x||o!==tn||a!==tn||h!==tn)&&(b+=h!==tn||x?"translate3d("+o+", "+a+", "+h+") ":"translate("+o+", "+a+Hi),u!==Xi&&(b+="rotate("+u+Hi),l!==Xi&&(b+="rotateY("+l+Hi),f!==Xi&&(b+="rotateX("+f+Hi),(c!==Xi||d!==Xi)&&(b+="skew("+c+", "+d+Hi),(v!==1||p!==1)&&(b+="scale("+v+", "+p+Hi),y.style[yt]=b||"translate(0, 0)"},vx=function(e,t){var i=t||this,n=i.xPercent,s=i.yPercent,o=i.x,a=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,g=i.yOffset,y=i.forceCSS,m=parseFloat(o),b=parseFloat(a),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*=cr,u*=cr,x=Math.cos(h)*f,T=Math.sin(h)*f,w=Math.sin(h-u)*-c,S=Math.cos(h-u)*c,u&&(l*=cr,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=At(x),T=At(T),w=At(w),S=At(S)):(x=f,S=c,T=w=0),(m&&!~(o+"").indexOf("px")||b&&!~(a+"").indexOf("px"))&&(m=vi(d,"x",o,"px"),b=vi(d,"y",a,"px")),(v||p||_||g)&&(m=At(m+v-(v*x+p*w)+_),b=At(b+p-(v*T+p*S)+g)),(n||s)&&(E=d.getBBox(),m=At(m+n/100*E.width),b=At(b+s/100*E.height)),E="matrix("+x+","+T+","+w+","+S+","+m+","+b+")",d.setAttribute("transform",E),y&&(d.style[yt]=E)},_x=function(e,t,i,n,s){var o=360,a=kt(s),h=parseFloat(s)*(a&&~s.indexOf("rad")?ki:1),u=h-n,l=n+u+"deg",f,c;return a&&(f=s.split("_")[1],f==="short"&&(u%=o,u!==u%(o/2)&&(u+=u<0?o:-o)),f==="cw"&&u<0?u=(u+o*ql)%o-~~(u/o)*o:f==="ccw"&&u>0&&(u=(u-o*ql)%o-~~(u/o)*o)),e._pt=c=new $t(e._pt,t,i,n,u,Q0),c.e=l,c.u="deg",e._props.push(i),c},cf=function(e,t){for(var i in t)e[i]=t[i];return e},gx=function(e,t,i){var n=cf({},i._gsap),s="perspective,force3D,transformOrigin,svgOrigin",o=i.style,a,h,u,l,f,c,d,v;n.svg?(u=i.getAttribute("transform"),i.setAttribute("transform",""),o[yt]=t,a=Qr(i,1),$r(i,yt),i.setAttribute("transform",u)):(u=getComputedStyle(i)[yt],o[yt]=t,a=Qr(i,1),o[yt]=u);for(h in Je)u=n[h],l=a[h],u!==l&&s.indexOf(h)<0&&(d=Vt(u),v=Vt(l),f=d!==v?vi(i,h,u,v):parseFloat(u),c=parseFloat(l),e._pt=new $t(e._pt,a,h,f,c-f,Ea),e._pt.u=v||0,e._props.push(h));cf(a,n)};qt("padding,margin,Width,Radius",function(r,e){var t="Top",i="Right",n="Bottom",s="Left",o=(e<3?[t,i,n,s]:[t+s,t+i,n+i,n+s]).map(function(a){return e<2?r+a:"border"+a+r});hs[e>1?"border"+r:r]=function(a,h,u,l,f){var c,d;if(arguments.length<4)return c=o.map(function(v){return ti(a,v,u)}),d=c.join(" "),d.split(c[0]).length===5?c[0]:d;c=(l+"").split(" "),d={},o.forEach(function(v,p){return d[v]=c[p]=c[p]||c[(p-1)/2|0]}),a.init(h,d,f)}});var df={name:"css",register:Pa,targetTest:function(e){return e.style&&e.nodeType},init:function(e,t,i,n,s){var o=this._props,a=e.style,h=i.vars.startAt,u,l,f,c,d,v,p,_,g,y,m,b,x,T,w,S;ba||Pa(),this.styles=this.styles||Ql(e),S=this.styles.props,this.tween=i;for(p in t)if(p!=="autoRound"&&(l=t[p],!(re[p]&&Gl(p,t,i,n,e,s)))){if(d=typeof l,v=hs[p],d==="function"&&(l=l.call(i,n,e,s),d=typeof l),d==="string"&&~l.indexOf("random(")&&(l=Vr(l)),v)v(this,e,p,l,i)&&(w=1);else if(p.substr(0,2)==="--")u=(getComputedStyle(e).getPropertyValue(p)+"").trim(),l+="",fi.lastIndex=0,fi.test(u)||(_=Vt(u),g=Vt(l)),g?_!==g&&(u=vi(e,p,u,g)+g):_&&(l+=_),this.add(a,"setProperty",u,l,n,s,0,0,p),o.push(p),S.push(p,0,a[p]);else if(d!=="undefined"){if(h&&p in h?(u=typeof h[p]=="function"?h[p].call(i,n,e,s):h[p],kt(u)&&~u.indexOf("random(")&&(u=Vr(u)),Vt(u+"")||(u+=ee.units[p]||Vt(ti(e,p))||""),(u+"").charAt(1)==="="&&(u=ti(e,p))):u=ti(e,p),c=parseFloat(u),y=d==="string"&&l.charAt(1)==="="&&l.substr(0,2),y&&(l=l.substr(2)),f=parseFloat(l),p in Qe&&(p==="autoAlpha"&&(c===1&&ti(e,"visibility")==="hidden"&&f&&(c=0),S.push("visibility",0,a.visibility),pi(this,a,"visibility",c?"inherit":"hidden",f?"inherit":"hidden",!f)),p!=="scale"&&p!=="transform"&&(p=Qe[p],~p.indexOf(",")&&(p=p.split(",")[0]))),m=p in Je,m){if(this.styles.save(p),b||(x=e._gsap,x.renderTransform&&!t.parseTransform||Qr(e,t.parseTransform),T=t.smoothOrigin!==!1&&x.smooth,b=this._pt=new $t(this._pt,a,yt,0,1,x.renderTransform,x,0,-1),b.dep=1),p==="scale")this._pt=new $t(this._pt,x,"scaleY",x.scaleY,(y?nr(x.scaleY,y+f):f)-x.scaleY||0,Ea),this._pt.u=0,o.push("scaleY",p),p+="X";else if(p==="transformOrigin"){S.push(Ae,0,a[Ae]),l=cx(l),x.svg?Oa(e,l,0,T,0,this):(g=parseFloat(l.split(" ")[2])||0,g!==x.zOrigin&&pi(this,x,"zOrigin",x.zOrigin,g),pi(this,a,p,us(u),us(l)));continue}else if(p==="svgOrigin"){Oa(e,l,1,T,0,this);continue}else if(p in hf){_x(this,x,p,c,y?nr(c,y+l):l);continue}else if(p==="smoothOrigin"){pi(this,x,"smooth",x.smooth,l);continue}else if(p==="force3D"){x[p]=l;continue}else if(p==="transform"){gx(this,l,e);continue}}else p in a||(p=pr(p)||p);if(m||(f||f===0)&&(c||c===0)&&!J0.test(l)&&p in a)_=(u+"").substr((c+"").length),f||(f=0),g=Vt(l)||(p in ee.units?ee.units[p]:_),_!==g&&(c=vi(e,p,u,g)),this._pt=new $t(this._pt,m?x:a,p,c,(y?nr(c,y+f):f)-c,!m&&(g==="px"||p==="zIndex")&&t.autoRound!==!1?ex:Ea),this._pt.u=g||0,_!==g&&g!=="%"&&(this._pt.b=u,this._pt.r=tx);else if(p in a)fx.call(this,e,p,u,y?y+l:l);else if(p in e)this.add(e,p,u||e[p],y?y+l:l,n,s);else if(p!=="parseTransform"){Jo(p,l);continue}m||(p in a?S.push(p,0,a[p]):S.push(p,1,u||e[p])),o.push(p)}}w&&zl(this)},render:function(e,t){if(t.tween._time||!Ta())for(var i=t._pt;i;)i.r(e,i.d),i=i._next;else t.styles.revert()},get:ti,aliases:Qe,getSetter:function(e,t,i){var n=Qe[t];return n&&n.indexOf(",")<0&&(t=n),t in Je&&t!==Ae&&(e._gsap.x||ti(e,"x"))?i&&Zl===i?t==="scale"?sx:nx:(Zl=i||{})&&(t==="scale"?ox:ax):e.style&&!jo(e.style[t])?ix:~t.indexOf("-")?rx:_a(e,t)},core:{_removeProperty:$r,_getMatrix:Ca}};se.utils.checkPrefix=pr,se.core.getStyleSaver=Ql,function(r,e,t,i){var n=qt(r+","+e+","+t,function(s){Je[s]=1});qt(e,function(s){ee.units[s]="deg",hf[s]=1}),Qe[n[13]]=r+","+e,qt(i,function(s){var o=s.split(":");Qe[o[1]]=n[o[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"),qt("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(r){ee.units[r]="px"}),se.registerPlugin(df);var oe=se.registerPlugin(df)||se;oe.core.Tween;const pf=.2,vf="power2.out";class Ia extends ht{constructor({graphState:t,width:i,height:n,borderRadius:s,borderColor:o,borderWidth:a}){super();R(this,"graphState");R(this,"rectWidth");R(this,"rectHeight");R(this,"borderRadius");R(this,"borderColor");R(this,"borderWidth");R(this,"topLeft");R(this,"topRight");R(this,"bottomRight");R(this,"bottomLeft");R(this,"topEdge");R(this,"rightEdge");R(this,"bottomEdge");R(this,"leftEdge");this.graphState=t,this.rectWidth=i,this.rectHeight=n,this.borderRadius=s,this.borderColor=o,this.borderWidth=a,this.initRect()}initRect(){const{borderRadius:t,borderColor:i,borderWidth:n}=this,{pixiApp:s}=this.graphState,{corner:o,edge:a}=r0({pixiApp:s,borderRadius:t,borderColor:i,borderWidth:n});this.topLeft=new ct(o),this.topRight=new ct(o),this.topRight.position.set(this.rectWidth,0),this.topRight.rotation=Math.PI/2,this.bottomRight=new ct(o),this.bottomRight.position.set(this.rectWidth,this.rectHeight),this.bottomRight.rotation=Math.PI,this.bottomLeft=new ct(o),this.bottomLeft.position.set(0,this.rectHeight),this.bottomLeft.rotation=Math.PI*1.5,this.topEdge=new ct(a),this.topEdge.position.set(this.borderRadius,0),this.topEdge.width=this.rectWidth-this.borderRadius*2,this.topEdge.height=n,this.rightEdge=new ct(a),this.rightEdge.position.set(this.rectWidth-this.borderWidth,this.borderRadius),this.rightEdge.height=this.rectHeight-this.borderRadius*2,this.rightEdge.width=n,this.bottomEdge=new ct(a),this.bottomEdge.position.set(this.borderRadius,this.rectHeight-this.borderWidth),this.bottomEdge.width=this.rectWidth-this.borderRadius*2,this.bottomEdge.height=n,this.leftEdge=new ct(a),this.leftEdge.position.set(0,this.borderRadius),this.leftEdge.height=this.rectHeight-this.borderRadius*2,this.leftEdge.width=n,this.addChild(this.topLeft),this.addChild(this.topRight),this.addChild(this.bottomRight),this.addChild(this.bottomLeft),this.addChild(this.topEdge),this.addChild(this.rightEdge),this.addChild(this.bottomEdge),this.addChild(this.leftEdge),this.resize({width:this.rectWidth,height:this.rectHeight})}resize({width:t,height:i,animate:n}){const{topRight:s,bottomRight:o,bottomLeft:a,topEdge:h,rightEdge:u,bottomEdge:l,leftEdge:f}=this;this.scale.x=1,this.rectWidth=t,this.rectHeight=i;const c=this.borderRadius*2,v=t<c?c:t;if(t<c&&(this.scale.x=t/c),!n||this.graphState.suppressMotion.value){s.position.x=v,o.position.set(v,this.rectHeight),a.position.y=this.rectHeight,h.width=v-c,u.height=this.rectHeight-c,u.position.x=v-this.borderWidth,l.width=v-c,l.position.y=this.rectHeight-this.borderWidth,f.height=this.rectHeight-c;return}const p={duration:pf,ease:vf};oe.to(s,{x:v,...p}),oe.to(o,{x:v,y:this.rectHeight,...p}),oe.to(a,{y:this.rectHeight,...p}),oe.to(h,{width:v-c,...p}),oe.to(u,{height:this.rectHeight-c,x:v-this.borderWidth,...p}),oe.to(l,{width:v-c,y:this.rectHeight-this.borderWidth,...p}),oe.to(f,{height:this.rectHeight-c,...p})}killTweens(){const{topRight:t,bottomRight:i,bottomLeft:n,topEdge:s,rightEdge:o,bottomEdge:a,leftEdge:h}=this;oe.killTweensOf([t,i,n,s,o,a,h])}destroy(){this.killTweens(),super.destroy.call(this)}}const _f=64,ls=20;class mx extends ht{constructor({sourceNode:t,targetNode:i,graphState:n}){super();R(this,"sourceNode");R(this,"targetNode");R(this,"graphState");R(this,"sourceX",0);R(this,"sourceY",0);R(this,"targetX",0);R(this,"targetY",0);R(this,"sourceControlPointX",0);R(this,"sourceControlPointY",0);R(this,"targetControlPointX",0);R(this,"targetControlPointY",0);R(this,"edgePoints");R(this,"edge");R(this,"arrow",new ht);R(this,"unWatchers",[]);R(this,"getXBezier",(t,i)=>{const{sourceX:n,targetX:s}=this,o=(s-n)/2;return t+(o>_f?o:_f)*(i?-1:1)});R(this,"getPointBezierPosition",t=>{const{sourceX:i,sourceY:n,targetX:s,targetY:o,sourceControlPointX:a,sourceControlPointY:h,targetControlPointX:u,targetControlPointY:l}=this,f=i+(a-i)*t,c=n+(h-n)*t,d=a+(u-a)*t,v=h+(l-h)*t,p=u+(s-u)*t,_=l+(o-l)*t,g=f+(d-f)*t,y=c+(v-c)*t,m=d+(p-d)*t,b=v+(_-v)*t,x=g+(m-g)*t,T=y+(b-y)*t;return{x,y:T}});this.sourceNode=t,this.targetNode=i,this.graphState=n,this.assignBezierPositions(),this.edgePoints=this.initEdgePoints(),this.edge=this.initEdge(),this.addChild(this.edge),this.drawArrow(),this.addChild(this.arrow),this.initCulling(),this.initWatchers()}initCulling(){const{cull:t}=this.graphState;t.add(this.arrow)}initWatchers(){const{styleOptions:t,viewport:i}=this.graphState;this.unWatchers.push(W.watch([t],()=>{this.updateStyle()},{deep:!0})),i.on("frame-end",()=>{this.sourceNode.destroyed||this.targetNode.destroyed||this.hasEdgeChanged()&&this.update()})}assignBezierPositions(){this.sourceX=this.getSourceX(),this.sourceY=this.getNodeY(this.sourceNode),this.targetX=this.targetNode.x,this.targetY=this.getNodeY(this.targetNode),this.sourceControlPointX=this.getXBezier(this.sourceX),this.sourceControlPointY=this.sourceY,this.targetControlPointX=this.getXBezier(this.targetX,!0),this.targetControlPointY=this.targetY}initEdge(){const{spacingEdgeWidth:t}=this.graphState.styleOptions.value,i=this.getEdgeTexture();return new Vy(i,this.edgePoints,t/Ho)}initEdgePoints(){const t=[];for(let s=0;s<ls;s++){const o=s===ls-1?{x:this.targetX,y:this.targetY}:this.getPointBezierPosition(s/ls);t.push(new j(o.x,o.y))}const i=this.getTargetAnchorPointPosition(),n=new j(i.x,i.y);return t.push(n),t}drawArrow(){const{arrow:t,targetX:i,targetY:n}=this,{pixiApp:s,styleOptions:o}=this.graphState,{colorEdge:a,spacingEdgeWidth:h,spacingNodeEdgeLength:u}=o.value,l=Ju({pixiApp:s,strokeColor:a,edgeWidth:h,edgeLength:u}),f=new ct(l);f.anchor.set(1,.5),t.addChild(f),t.position.set(i,n)}update(){this.assignBezierPositions(),this.arrow.position.set(this.targetX,this.targetY),this.edgePoints.forEach((t,i)=>{const n=i===this.edgePoints.length-1?this.getTargetAnchorPointPosition():this.getPointBezierPosition(i/ls);t.set(n.x,n.y)})}updateStyle(){this.arrow.removeChildren(),this.drawArrow(),this.edge.texture=this.getEdgeTexture()}hasEdgeChanged(){const t=this.getSourceX(),i=this.getNodeY(this.sourceNode),n=this.targetNode.x,s=this.getNodeY(this.targetNode);return t!==this.sourceX||i!==this.sourceY||n!==this.targetX||s!==this.targetY}getSourceX(){return this.sourceNode.x+this.sourceNode.getChildByName(Da).getLocalBounds().width}getNodeY(t){return t.y+t.getChildByName(Da).getLocalBounds().height/2}getEdgeTexture(){const{pixiApp:t,styleOptions:i}=this.graphState,{colorEdge:n}=i.value;return Xr({pixiApp:t,fill:n})}getTargetAnchorPointPosition(){return{x:this.targetX-2,y:this.targetY}}destroy(){const{cull:t}=this.graphState;t.remove(this.arrow),this.unWatchers.forEach(i=>i()),super.destroy.call(this)}}class yx extends ht{constructor({appRef:t,labelText:i,styles:n,cull:s}){super();R(this,"appRef");R(this,"labelText");R(this,"styles");R(this,"cull");R(this,"guideLine");R(this,"label");s.add(this),this.appRef=t,this.labelText=i,this.styles=n,this.cull=s,this.initGuideLine(),this.drawLabel(),this.interactive=!1}initGuideLine(){const{appRef:t}=this,{colorGuideLine:i}=this.styles.value,n=Xr({pixiApp:t,fill:i});this.guideLine=new ct(n),this.guideLine.width=1,this.guideLine.height=t.screen.height,this.addChild(this.guideLine)}async drawLabel(){var t;if(this.labelText){const i=await jn(this.styles.value),{spacingGuideLabelPadding:n}=this.styles.value;(t=this.label)==null||t.destroy(),this.label=new No(this.labelText,i.timeMarkerLabel),this.label.position.set(n,n),this.addChild(this.label)}}updateHeight(t){this.guideLine.height=t}destroy(){this.cull.remove(this),super.destroy()}}let ae;const xx=({minimumStartTime:r,graphXDomain:e,initialOverallTimeSpan:t})=>({dateToX:Tx(r,e,t),xToDate:wx(r,e,t)}),bx=({minimumStartTime:r,graphXDomain:e,initialOverallTimeSpan:t})=>(ae=xx({minimumStartTime:r,graphXDomain:e,initialOverallTimeSpan:t}),ae);function Tx(r,e,t){return function(i){return Math.ceil((i.getTime()-r)*(e/t))}}function wx(r,e,t){return function(i){return Math.ceil(r+i*(t/e))}}const Ex=260,Ma=4e3;class Sx extends ht{constructor({viewportRef:t,appRef:i,cull:n,minimumStartDate:s,maximumEndDate:o,isRunning:a,styleOptions:h,formatDateFns:u}){super();R(this,"viewportRef");R(this,"appRef");R(this,"cull");R(this,"minimumStartDate");R(this,"maximumEndDate");R(this,"isRunning");R(this,"styleOptions");R(this,"formatDateFns");R(this,"unwatch");R(this,"idealGuideCount",10);R(this,"currentTimeGap",120);R(this,"labelFormatter",t=>t.toLocaleTimeString());R(this,"guides",new Map);this.viewportRef=t,this.appRef=i,this.cull=n,this.minimumStartDate=s,this.maximumEndDate=o,this.isRunning=a,this.styleOptions=h,this.formatDateFns=u,this.updateIdealGuideCount(),this.updateCurrentTimeGap(),this.createGuides(),this.unwatch=W.watch(h,()=>{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/Ex)}updateCurrentTimeGap(){const t=Math.ceil((this.viewportRef.right-this.viewportRef.left)/this.idealGuideCount),i=ae.xToDate(t)-this.minimumStartDate.getTime(),n=Xa.find(s=>s.ceiling>i)??Xa[0];this.currentTimeGap=n.span,this.setLabelFormatter(n.labelFormat)}createGuides(){let t;const i=ae.xToDate(ae.dateToX(this.maximumEndDate.value??new Date)+Ma);let n=new Date(Math.ceil(ae.xToDate(-Ma)/this.currentTimeGap)*this.currentTimeGap);for(this.currentTimeGap>et.hour*6?n=qf(n):this.currentTimeGap>et.hour&&(n=Kf(n)),t=n;t.getTime()<i;){const s=new yx({appRef:this.appRef,labelText:this.labelFormatter(t),styles:this.styleOptions,cull:this.cull});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 Dt.minutes:this.labelFormatter=this.formatByMinutesWithDates;break;case Dt.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)+Ma*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)}}const he={nodeDetails:"nodeDetailsClick",subNodesToggle:"subNodesToggleClick"},Na="nodeResize",gf={fadeIn:.25,move:.5},Da="box",Px=.2;class Rx extends ht{constructor({nodeData:t,graphState:i,layout:n,layoutRows:s}){super();R(this,"nodeData");R(this,"graphState");R(this,"layout");R(this,"layoutRows");R(this,"currentState");R(this,"hasSubNodes",!1);R(this,"isRunningNode",!1);R(this,"runningNodeTicker",null);R(this,"unWatchers",[]);R(this,"positionInitialized",!1);R(this,"nodeWidth");R(this,"nodeHeight");R(this,"boxCapWidth",0);R(this,"box",new ht);R(this,"leftBoxCap");R(this,"rightBoxCap");R(this,"boxBody");R(this,"subNodesToggle");R(this,"subNodesToggleWidth",0);R(this,"isSubNodesToggleFloating",!1);R(this,"label");R(this,"apxLabelWidth",0);R(this,"isLabelInBox",!0);R(this,"isSubNodesExpanded",!1);R(this,"subNodesOutlineContainer",new ht);R(this,"subNodesOutline");R(this,"subNodesContent");R(this,"subNodesHeight",0);R(this,"subNodesContentTicker",null);R(this,"isSelected",!1);R(this,"selectedRing");R(this,"initializePosition",()=>{this.positionInitialized=!0,this.updatePosition({skipAnimation:!0,includeXPos:!0})});this.interactive=!1,this.nodeData=t,this.graphState=i,this.layout=n,this.layoutRows=s,this.currentState=t.state.toString(),this.hasSubNodes=t.subFlowRunId!==void 0,this.updateIsRunningNode(),this.boxCapWidth=i.styleOptions.value.borderRadiusNode,this.nodeWidth=this.getNodeWidth(),this.nodeHeight=this.getNodeHeight(),this.addChild(this.subNodesOutlineContainer),this.drawSubNodesOutline(),this.initBox(),this.initSubNodesToggle(),this.drawLabel(),this.initSelectedRing(),this.initWatchers()}initWatchers(){const{layoutRows:t,unWatchers:i,hasSubNodes:n,isRunningNode:s}=this,{pixiApp:o,styleOptions:a,styleNode:h,selectedNodeId:u,subNodeLabels:l,expandedSubNodes:f,viewport:c}=this.graphState;i.push(W.watch(t,()=>{this.updatePosition()}),W.watch([a,h],()=>{this.drawBox(),this.drawLabel()},{deep:!0}),W.watch(u,()=>{if(u.value===this.nodeData.id||u.value===this.nodeData.subFlowRunId){this.select();return}this.isSelected&&this.deselect()})),n&&i.push(W.watch(f,()=>{var d;if(this.nodeData.subFlowRunId){if(this.isSubNodesExpanded){if(!f.value.has(this.nodeData.subFlowRunId)){this.isSubNodesExpanded=!1,this.collapseSubNodes();return}const v=f.value.get(this.nodeData.subFlowRunId).data;(d=this.subNodesContent)==null||d.update("value"in v?v.value:v);return}f.value.has(this.nodeData.subFlowRunId)&&(this.isSubNodesExpanded=!0,this.expandSubNodes())}},{deep:!0}),W.watch(l,()=>{var d;this.getLabelText()!==((d=this.label)==null?void 0:d.text)&&this.drawLabel(!0)},{deep:!0})),s&&(this.runningNodeTicker=()=>{this.update()},o.ticker.add(this.runningNodeTicker)),c.on("frame-end",()=>{if(c.scale.x<Px){this.label&&(this.label.visible=!1),this.subNodesOutline&&!this.isSubNodesExpanded&&(this.subNodesOutline.visible=!1);return}this.label&&(this.label.visible=!0),this.subNodesOutline&&(this.subNodesOutline.visible=!0)})}drawSubNodesOutline(){var d;if(!this.hasSubNodes)return;(d=this.subNodesOutline)==null||d.destroy();const{nodeHeight:t,graphState:i}=this,{styleOptions:n,styleNode:s}=i,{borderRadiusNode:o,alphaSubNodesOutlineDimmed:a,spacingSubNodesOutlineBorderWidth:h,spacingSubNodesOutlineOffset:u}=n.value,{fill:l}=s.value(this.nodeData),f=Jt(l),c=this.getOutlineWidth();this.subNodesOutline=new Ia({graphState:i,width:c,height:t,borderRadius:o,borderWidth:h,borderColor:f}),this.subNodesOutline.position.set(u,u),this.subNodesOutline.alpha=a,this.subNodesOutlineContainer.addChild(this.subNodesOutline)}initBox(){const{box:t}=this;t.name=Da,this.drawBox(),this.addChild(t),t.interactive=!0,t.buttonMode=!0,t.on("click",()=>{this.emitSelection()}),this.graphState.cull.add(t)}drawBox(){var p,_,g;const{pixiApp:t,styleOptions:i,styleNode:n}=this.graphState,{isRunningNode:s,nodeWidth:o,nodeHeight:a,box:h,boxCapWidth:u}=this,{borderRadiusNode:l}=i.value,{fill:f}=n.value(this.nodeData),c=Jt(f);(p=this.leftBoxCap)==null||p.destroy(),(_=this.boxBody)==null||_.destroy(),(g=this.rightBoxCap)==null||g.destroy(),this.box.removeChildren();const{cap:d,body:v}=zo({pixiApp:t,fill:c,borderRadius:l,boxCapWidth:u,height:a});this.leftBoxCap=new ct(d),this.boxBody=new ct(v),this.boxBody.width=this.getBoxBodyWidth(),this.boxBody.height=a,this.boxBody.position.set(u,0),h.addChild(this.leftBoxCap),h.addChild(this.boxBody),s||(this.rightBoxCap=new ct(d),this.rightBoxCap.scale.x=-1,this.rightBoxCap.position.x=o,h.addChild(this.rightBoxCap))}initSubNodesToggle(){if(!this.hasSubNodes)return;const{graphState:t,nodeWidth:i,nodeHeight:n,nodeData:s}=this,{spacingNodeLabelMargin:o,borderRadiusNode:a}=this.graphState.styleOptions.value;this.subNodesToggleWidth=n,this.isSubNodesToggleFloating=this.subNodesToggleWidth+a>i,this.subNodesToggle=new Mx({graphState:t,nodeData:s,floating:this.isSubNodesToggleFloating,size:this.subNodesToggleWidth}),this.subNodesToggle.position.x=this.isSubNodesToggleFloating?i+o:0,this.subNodesToggle.on("click",()=>{this.emitSubNodesToggle()}),this.addChild(this.subNodesToggle)}async drawLabel(t){const{apxLabelWidth:i,nodeData:n}=this,{styleOptions:s,styleNode:o,cull:a}=this.graphState,h=await jn(s.value),{spacingNodeXPadding:u}=s.value,{inverseTextOnFill:l}=o.value(n),f=l?h.nodeTextInverse:h.nodeTextDefault,c=this.getLabelText();if(i===0||t){const p=le.measureText(c,h.nodeTextStyles).width*1.07;this.apxLabelWidth=p+u*2}this.isLabelInBox=this.checkIsLabelInBox();const d=this.isLabelInBox?f:h.nodeTextDefault;this.label&&(a.remove(this.label),this.label.destroy()),this.label=new No(c,d),this.updateLabelPosition(),this.isLabelInBox||(this.label.interactive=!0,this.label.buttonMode=!0,this.label.on("click",()=>{this.emitSelection()})),a.add(this.label),this.addChild(this.label)}initSelectedRing(){const{width:t,height:i,margin:n}=this.getSelectedRingSize(),{colorNodeSelection:s,spacingNodeSelectionWidth:o,borderRadiusNode:a}=this.graphState.styleOptions.value;this.selectedRing=new Ia({graphState:this.graphState,width:t,height:i,borderRadius:a,borderColor:s,borderWidth:o}),this.selectedRing.position.set(-n,-n),this.selectedRing.alpha=0,this.addChild(this.selectedRing)}select(){this.isSelected=!0,this.selectedRing.alpha=1,this.centerViewportToNodeAfterDelay()}deselect(){this.isSelected=!1,this.selectedRing.alpha=0,this.graphState.selectedNodeId.value||this.centerViewportToNodeAfterDelay()}centerViewportToNodeAfterDelay(){const{viewport:t,suppressMotion:i}=this.graphState;setTimeout(()=>{const n=(this.worldTransform.tx-t.x)/t.scale.x+this.box.width/2,s=(this.worldTransform.ty-t.y)/t.scale.y+this.box.height/2;t.animate({position:{x:n,y:s},time:i.value?0:1e3,ease:"easeInOutQuad",removeOnInterrupt:!0})},100)}expandSubNodes(){var n,s;if(!this.nodeData.subFlowRunId)return;const t=this.graphState.expandedSubNodes.value.get(this.nodeData.subFlowRunId);if(!this.hasSubNodes||!t)return;const i="value"in t.data?t.data.value:t.data;(n=this.subNodesToggle)==null||n.setExpanded(),(s=this.subNodesContent)==null||s.destroy(),this.subNodesContent=new xf({isSubNodes:!0,graphData:i,graphState:this.graphState}),this.subNodesContent.on(he.nodeDetails,o=>{this.emit(he.nodeDetails,o)}),this.subNodesContent.on(he.subNodesToggle,o=>{this.emitSubNodesToggle(o)}),this.updateSubNodesContentPosition(),this.subNodesContent.on(Fa,()=>this.updateSubNodesContentPosition()),this.addChild(this.subNodesContent),this.initSubNodesTicker()}updateSubNodesContentPosition(){const{subNodesContent:t,box:i}=this,{spacingNodeMargin:n}=this.graphState.styleOptions.value;if(!t)return;const s=t.getEarliestNodeStart(),o=s?-ae.dateToX(s):0,a=i.y+i.height+n;t.position.set(o,a)}initSubNodesTicker(){const{subNodesContent:t}=this,{pixiApp:i}=this.graphState;t&&(this.subNodesHeight=t.height,this.subNodesContentTicker=()=>{var n;((n=this.subNodesContent)==null?void 0:n.height)!==this.subNodesHeight&&(this.updateSubNodesOutlineSize(),this.updateSelectedRingSize(),this.subNodesHeight=t.height,this.emit(Na))},i.ticker.add(this.subNodesContentTicker,null,te.LOW))}async collapseSubNodes(){var t;(t=this.subNodesToggle)==null||t.setCollapsed(),this.destroySubNodesContent(),this.updateSelectedRingSize(),await this.updateSubNodesOutlineSize(),this.emit(Na)}update(t){var o;let i=!1,n=!1;t&&(this.nodeData=t,i=this.currentState!==this.nodeData.state,this.currentState=this.nodeData.state.toString(),this.updateIsRunningNode(),n=((o=this.label)==null?void 0:o.text)!==this.nodeData.label),this.isRunningNode&&this.nodeData.end&&(this.isRunningNode=!1,this.destroyRunningNodeTicker());const s=this.getNodeWidth();if(i&&(this.drawBox(),this.drawSubNodesOutline()),n&&this.drawLabel(),s!==this.nodeWidth){this.nodeWidth=s,this.updateBoxWidth(),this.updateSelectedRingSize(),this.updateSubNodesOutlineSize(!0),this.updateSubNodesTogglePosition();const a=this.isLabelInBox!==this.checkIsLabelInBox(2);!n&&a?this.drawLabel():this.isLabelInBox||this.updateLabelPosition()}}updatePosition(t){if(!this.positionInitialized)return;const{skipAnimation:i,includeXPos:n}=t??{},{suppressMotion:s}=this.graphState,{id:o}=this.nodeData,{position:a}=this.layout.value[o];if(!this.layoutRows.value[a])return;const{yPos:h}=this.layoutRows.value[a],u=n?ae.dateToX(this.nodeData.start):this.position.x;if(!(this.position.y===h&&this.position.x===u)){if(i||s.value){this.position.set(u,h);return}oe.to(this,{x:u,y:h,duration:gf.move,ease:"power1.out"}).then(()=>{this.graphState.cullScreen()})}}updateIsRunningNode(){this.isRunningNode=this.graphState.isRunning.value&&!this.nodeData.end}updateBoxWidth(){var t;this.boxBody.width=this.getBoxBodyWidth(),(t=this.rightBoxCap)==null||t.position.set(this.nodeWidth,0)}async updateSubNodesOutlineSize(t){if(!this.subNodesOutline)return;const{isSubNodesExpanded:i,subNodesContent:n,subNodesOutline:s,nodeHeight:o}=this,{spacingSubNodesOutlineOffset:a,alphaSubNodesOutlineDimmed:h,spacingNodeMargin:u}=this.graphState.styleOptions.value,{suppressMotion:l}=this.graphState,f=this.getOutlineWidth(),c=i?o+n.height+u:o;s.resize({width:f,height:c,animate:!0}),await new Promise(d=>{const v=t||l.value?0:pf,p=i?-a:a,_=i?-a:a,g=i?1:h;if(t||l.value){s.position.set(p,_),s.alpha=g,d(null);return}oe.to(s,{x:p,y:_,alpha:g,duration:v,ease:vf}).then(()=>d(null))})}updateLabelPosition(){if(!this.label)return;const{graphState:t,nodeWidth:i,hasSubNodes:n,isSubNodesToggleFloating:s,subNodesToggleWidth:o}=this,{spacingNodeXPadding:a,spacingNodeLabelMargin:h,spacingNodeYPadding:u}=t.styleOptions.value,l=()=>n&&s?i+h+o+a:i+h,f=()=>n&&!s?o+a:a,c=this.isLabelInBox?f():l();this.label.position.set(c,u)}updateSelectedRingSize(){const{width:t,height:i}=this.getSelectedRingSize();this.selectedRing.resize({width:t,height:i})}updateSubNodesTogglePosition(){if(!this.subNodesToggle)return;const{nodeWidth:t}=this,{borderRadiusNode:i,spacingNodeLabelMargin:n}=this.graphState.styleOptions.value;this.isSubNodesToggleFloating=this.subNodesToggleWidth+i>t,this.subNodesToggle.updateFloatingState(this.isSubNodesToggleFloating),this.subNodesToggle.position.x=this.isSubNodesToggleFloating?t+n:0}getNodeWidth(){const{isRunningNode:t,boxCapWidth:i,nodeData:n}=this,s=t?i:i*2,o=ae.dateToX(n.end??new Date)-ae.dateToX(n.start);return o>s?o:s}getNodeHeight(){const{textLineHeightDefault:t,spacingNodeYPadding:i}=this.graphState.styleOptions.value;return t+i*2}getBoxBodyWidth(){const{isRunningNode:t,nodeWidth:i,boxCapWidth:n}=this;return t?i-n:i-n*2}getOutlineWidth(){const{nodeWidth:t,isSubNodesExpanded:i}=this,{spacingSubNodesOutlineOffset:n}=this.graphState.styleOptions.value;if(i)return t+n*2;const s=this.boxCapWidth*2,o=t-n*2;return o>=s?o:s}getLabelText(){if(!this.hasSubNodes)return this.nodeData.label;const{subNodeLabels:t}=this.graphState,{subFlowRunId:i}=this.nodeData;return t.value.has(i)?t.value.get(i):this.nodeData.label}checkIsLabelInBox(t=0){const{hasSubNodes:i,isSubNodesToggleFloating:n,subNodesToggle:s}=this;return i&&!n?this.apxLabelWidth+t<this.nodeWidth-s.width:this.apxLabelWidth+t<this.nodeWidth}getSelectedRingSize(){const{nodeWidth:t,nodeHeight:i,hasSubNodes:n,isSubNodesExpanded:s}=this,{spacingNodeSelectionMargin:o,spacingNodeSelectionWidth:a,spacingSubNodesOutlineBorderWidth:h,spacingSubNodesOutlineOffset:u}=this.graphState.styleOptions.value,l=o+a,f=t+l*2,c=n&&!s?i+h+u+l*2:i+l*2;return{width:f,height:c,margin:l}}emitSelection(){const{id:t,subFlowRunId:i}=this.nodeData,n={id:this.hasSubNodes?i:t,type:this.hasSubNodes?"subFlowRun":"task"};this.emit(he.nodeDetails,n)}emitSubNodesToggle(t){this.emit(he.subNodesToggle,t??this.nodeData.subFlowRunId)}destroySubNodesContent(){var t;this.subNodesContentTicker&&(this.graphState.pixiApp.ticker.remove(this.subNodesContentTicker),this.subNodesContentTicker=null),(t=this.subNodesContent)==null||t.destroy()}destroyRunningNodeTicker(){this.runningNodeTicker&&(this.graphState.pixiApp.ticker.remove(this.runningNodeTicker),this.runningNodeTicker=null)}killTweens(){oe.killTweensOf([this,this.subNodesOutline])}destroy(){var i,n,s,o,a,h,u;const{cull:t}=this.graphState;t.remove(this.box),this.label&&t.remove(this.label),this.killTweens(),this.isSelected&&this.emit(he.nodeDetails,null),this.isSubNodesExpanded&&this.emitSubNodesToggle(),this.destroyRunningNodeTicker(),this.destroySubNodesContent(),(i=this.subNodesOutline)==null||i.destroy(),(n=this.leftBoxCap)==null||n.destroy(),(s=this.rightBoxCap)==null||s.destroy(),(o=this.boxBody)==null||o.destroy(),this.box.destroy(),(a=this.subNodesToggle)==null||a.destroy(),(h=this.label)==null||h.destroy(),(u=this.selectedRing)==null||u.destroy(),this.unWatchers.forEach(l=>l()),super.destroy.call(this)}}const mf="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2NvbnN0IFQ9KHttaW5pbXVtU3RhcnRUaW1lOmUsZ3JhcGhYRG9tYWluOm4saW5pdGlhbE92ZXJhbGxUaW1lU3Bhbjp0fSk9Pih7ZGF0ZVRvWDpJKGUsbix0KSx4VG9EYXRlOkwoZSxuLHQpfSk7ZnVuY3Rpb24gSShlLG4sdCl7cmV0dXJuIGZ1bmN0aW9uKG8pe3JldHVybiBNYXRoLmNlaWwoKG8uZ2V0VGltZSgpLWUpKihuL3QpKX19ZnVuY3Rpb24gTChlLG4sdCl7cmV0dXJuIGZ1bmN0aW9uKG8pe3JldHVybiBNYXRoLmNlaWwoZStvKih0L24pKX19Y29uc3QgZz0wO2xldCB5LHY9MTQsRD0wLGg9IndhdGVyZmFsbCIsZD1bXTtjb25zdCBjPXt9O29ubWVzc2FnZT1hc3luYyh7ZGF0YTp7bGF5b3V0U2V0dGluZzplLGdyYXBoRGF0YTpuLGFweENoYXJhY3RlcldpZHRoOnQsc3BhY2luZ01pbmltdW1Ob2RlRWRnZUdhcDpvLHRpbWVTY2FsZVByb3BzOmksY2VudGVyVmlld3BvcnRBZnRlcjpzfX0pPT57Zm9yKGNvbnN0IHIgaW4gYylkZWxldGUgY1tyXTtpZihvJiYoRD1vKSxlJiYoaD1lKSx0JiYodj10KSxpKXtjb25zdHttaW5pbXVtU3RhcnRUaW1lOnIsZ3JhcGhYRG9tYWluOmEsaW5pdGlhbE92ZXJhbGxUaW1lU3Bhbjp1fT1pO3k9VCh7bWluaW11bVN0YXJ0VGltZTpyLGdyYXBoWERvbWFpbjphLGluaXRpYWxPdmVyYWxsVGltZVNwYW46dX0pfWlmKG4pe2NvbnN0IHI9SlNPTi5wYXJzZShuKTt5JiYoZXx8ZCE9PXIpJiYoZD1yLGF3YWl0IE8oKSxwb3N0TWVzc2FnZSh7bGF5b3V0OmMsY2VudGVyVmlld3BvcnRBZnRlcjpzfSkpfX07YXN5bmMgZnVuY3Rpb24gTygpe2g9PT0id2F0ZXJmYWxsIiYmUygpLGg9PT0ibmVhcmVzdFBhcmVudCImJmF3YWl0IGIoKSxFKCl9ZnVuY3Rpb24gUygpe2QuZm9yRWFjaCgoZSxuKT0+e2NbZS5pZF09e3Bvc2l0aW9uOm4sc3RhcnRYOjAsZW5kWDowfX0pfWFzeW5jIGZ1bmN0aW9uIGIoKXtmb3IgYXdhaXQoY29uc3QgZSBvZiBkKXtjb25zdCBuPXkuZGF0ZVRvWChlLmVuZD9uZXcgRGF0ZShlLmVuZCk6bmV3IERhdGUpLHQ9ZS5sYWJlbC5sZW5ndGgqdixvPW4rdCxpPWUuaWQgaW4gYz9jW2UuaWRdLnN0YXJ0WDp5LmRhdGVUb1gobmV3IERhdGUoZS5zdGFydCkpLHM9YXdhaXQgWChlLGkpO2NbZS5pZF09e3Bvc2l0aW9uOnMsc3RhcnRYOmksZW5kWDpvfX19YXN5bmMgZnVuY3Rpb24gWChlLG4pe2lmKGUudXBzdHJlYW1EZXBlbmRlbmNpZXMmJmUudXBzdHJlYW1EZXBlbmRlbmNpZXMubGVuZ3RoPT09MSl7aWYoZS51cHN0cmVhbURlcGVuZGVuY2llc1swXWluIGMpe2NvbnN0IHQ9Y1tlLnVwc3RyZWFtRGVwZW5kZW5jaWVzWzBdXTtyZXR1cm4gYXdhaXQgdyh0LG4pfXJldHVybiBjb25zb2xlLndhcm4oInRpbWVsaW5lTm9kZXMgbGF5b3V0IHdvcmtlcjogUGFyZW50IG5vZGUgbm90IGZvdW5kIGluIGxheW91dCIsZS51cHN0cmVhbURlcGVuZGVuY2llc1swXSksZ31pZihlLnVwc3RyZWFtRGVwZW5kZW5jaWVzJiZlLnVwc3RyZWFtRGVwZW5kZW5jaWVzLmxlbmd0aD4wKXtjb25zdCBvPWUudXBzdHJlYW1EZXBlbmRlbmNpZXMubWFwKGE9PmNbYV0pLmZpbHRlcihhPT4hIWEpLm1hcChhPT5hLnBvc2l0aW9uKSxzPW8ucmVkdWNlKChhLHUpPT5hK3UsMCkvby5sZW5ndGgscj1NYXRoLnJvdW5kKHMpO2lmKG0obixyKSl7Y29uc3QgYT1QKG4sciksdT1hLmZpbHRlcihwPT57dmFyIGw7cmV0dXJuKGw9ZS51cHN0cmVhbURlcGVuZGVuY2llcyk9PW51bGw/dm9pZCAwOmwuaW5jbHVkZXMocCl9KTtpZih1Lmxlbmd0aD4wfHxhLmxlbmd0aD4xKXtjb25zdFtwXT11Lmxlbmd0aD4wP3U6YSxsPWNbcF07cmV0dXJuIGwubmV4dERlcGVuZGVuY3lTaG92ZT1DKG8scixsLm5leHREZXBlbmRlbmN5U2hvdmUpLGF3YWl0IHcobCxuKX1yZXR1cm4gYXdhaXQgQSh7Y29tcGV0aW5nTGF5b3V0SXRlbUlkOmFbMF0sdXBzdHJlYW1Qb3NpdGlvbnM6byxub2RlU3RhcnRYOm4sZGVzaXJlZFBvc2l0aW9uOnJ9KX19cmV0dXJuIE4obixnKX1mdW5jdGlvbiBOKGUsbil7cmV0dXJuIG0oZSxuKT9OKGUsbisxKTpufWFzeW5jIGZ1bmN0aW9uIHcoZSxuKXtlLm5leHREZXBlbmRlbmN5U2hvdmUhPT0xJiZlLm5leHREZXBlbmRlbmN5U2hvdmUhPT0tMSYmKGUubmV4dERlcGVuZGVuY3lTaG92ZT0xKTtjb25zdHtwb3NpdGlvbjp0LG5leHREZXBlbmRlbmN5U2hvdmU6b309ZTtyZXR1cm4gbShuLHQpP289PT0xJiYhbShuLHQrMSk/KGUubmV4dERlcGVuZGVuY3lTaG92ZT0tMSx0KzEpOm0obix0LTEpPyhhd2FpdCBmKHtkaXJlY3Rpb246byxub2RlU3RhcnRYOm4sZGVzaXJlZFBvc2l0aW9uOnQrb30pLGUubmV4dERlcGVuZGVuY3lTaG92ZT1vPT09MT8tMToxLHQrbyk6KGUubmV4dERlcGVuZGVuY3lTaG92ZT0xLHQtMSk6dH1mdW5jdGlvbiBtKGUsbil7Y29uc3QgdD1PYmplY3Qua2V5cyhjKTtyZXR1cm4gdC5sZW5ndGg+MCYmdC5zb21lKG89Pntjb25zdCBpPWNbb107cmV0dXJuIHgoe2ZpcnN0Tm9kZUVuZFg6aS5lbmRYLGZpcnN0Tm9kZVBvc2l0aW9uOmkucG9zaXRpb24sbGFzdE5vZGVTdGFydFg6ZSxsYXN0Tm9kZVBvc2l0aW9uOm59KX0pfWFzeW5jIGZ1bmN0aW9uIGYoe2RpcmVjdGlvbjplLG5vZGVTdGFydFg6bixkZXNpcmVkUG9zaXRpb246dH0pe2NvbnN0IG89UChuLHQpO2lmKG8pZm9yIGF3YWl0KGNvbnN0IGkgb2Ygbyl7Y29uc3Qgcz1jW2ldLHI9cy5wb3NpdGlvbitlO2F3YWl0IGYoe2RpcmVjdGlvbjplLG5vZGVTdGFydFg6cy5zdGFydFgsZGVzaXJlZFBvc2l0aW9uOnJ9KSxzLnBvc2l0aW9uPXJ9fWZ1bmN0aW9uIHgoe2ZpcnN0Tm9kZUVuZFg6ZSxmaXJzdE5vZGVQb3NpdGlvbjpuLGxhc3ROb2RlU3RhcnRYOnQsbGFzdE5vZGVQb3NpdGlvbjpvfSl7cmV0dXJuIG49PT1vJiZlK0Q+PXR9ZnVuY3Rpb24gUChlLG4pe2NvbnN0IHQ9W107aWYoT2JqZWN0LmtleXMoYykuZm9yRWFjaChvPT57Y29uc3QgaT1jW29dO3goe2ZpcnN0Tm9kZUVuZFg6aS5lbmRYLGZpcnN0Tm9kZVBvc2l0aW9uOmkucG9zaXRpb24sbGFzdE5vZGVTdGFydFg6ZSxsYXN0Tm9kZVBvc2l0aW9uOm59KSYmdC5wdXNoKG8pfSksdC5sZW5ndGghPT0wKXJldHVybiB0LnNvcnQoKG8saSk9Pntjb25zdCBzPWNbb10scj1jW2ldO3JldHVybiBzLmVuZFg8ci5lbmRYPzE6cy5lbmRYPnIuZW5kWD8tMTowfSksdH1mdW5jdGlvbiBDKGUsbix0KXtjb25zdCBvPWUuZmlsdGVyKHM9PnM8bikubGVuZ3RoLGk9ZS5maWx0ZXIocz0+cz5uKS5sZW5ndGg7cmV0dXJuIG8+aT8tMTp0Pz8xfWFzeW5jIGZ1bmN0aW9uIEEoe2Rlc2lyZWRQb3NpdGlvbjplLG5vZGVTdGFydFg6bix1cHN0cmVhbVBvc2l0aW9uczp0LGNvbXBldGluZ0xheW91dEl0ZW1JZDpvfSl7Y29uc3QgaT1jW29dLFtzLHJdPWsobyksYT10LmZpbHRlcihwPT5wPGUpLmxlbmd0aCx1PXQuZmlsdGVyKHA9PnA+ZSkubGVuZ3RoO2lmKGE+dSl7aWYocz5yJiZzPmEpcmV0dXJuIGF3YWl0IGYoe2RpcmVjdGlvbjotMSxub2RlU3RhcnRYOm4sZGVzaXJlZFBvc2l0aW9uOmV9KSxlO2lmKHI+cylyZXR1cm4gYXdhaXQgZih7ZGlyZWN0aW9uOjEsbm9kZVN0YXJ0WDpuLGRlc2lyZWRQb3NpdGlvbjplfSksZTtpLm5leHREZXBlbmRlbmN5U2hvdmU9LTF9aWYodT5hKXtpZihyPnMmJnI+dSlyZXR1cm4gYXdhaXQgZih7ZGlyZWN0aW9uOjEsbm9kZVN0YXJ0WDpuLGRlc2lyZWRQb3NpdGlvbjplfSksZTtpZihzPnIpcmV0dXJuIGF3YWl0IGYoe2RpcmVjdGlvbjotMSxub2RlU3RhcnRYOm4sZGVzaXJlZFBvc2l0aW9uOmV9KSxlO2kubmV4dERlcGVuZGVuY3lTaG92ZT0xfXJldHVybiBhd2FpdCB3KGksbil9ZnVuY3Rpb24gayhlKXt2YXIgbztjb25zdCBuPWQuZmluZChpPT5pLmlkPT09ZSksdD1jW2VdO3JldHVybigobz1uLnVwc3RyZWFtRGVwZW5kZW5jaWVzKT09bnVsbD92b2lkIDA6by5yZWR1Y2UoKGkscyk9PntpZihlIGluIGMpe2NvbnN0IHI9Y1tzXTtyZXR1cm4gci5wb3NpdGlvbjx0LnBvc2l0aW9uJiYoaVswXSs9MSksci5wb3NpdGlvbj50LnBvc2l0aW9uJiYoaVsxXSs9MSksaX1yZXR1cm4gY29uc29sZS53YXJuKCJub2RlTGF5b3V0Lndvcmtlci50czogUGFyZW50IG5vZGUgbm90IGZvdW5kIG9uIGxheW91dCBkYXRhIixlKSxpfSxbMCwwXSkpPz9bMCwwXX1mdW5jdGlvbiBFKCl7Y29uc3QgZT1PYmplY3QudmFsdWVzKGMpLnJlZHVjZSgobix0KT0+dC5wb3NpdGlvbjxuP3QucG9zaXRpb246biwwKTtlPDAmJk9iamVjdC52YWx1ZXMoYykuZm9yRWFjaChuPT57bi5wb3NpdGlvbis9TWF0aC5hYnMoZSl9KX19KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1ub2RlTGF5b3V0Lndvcmtlci1lZWEzZDQyYy5qcy5tYXAKLy8jIHNvdXJjZU1hcHBpbmdVUkw9YXNzZXRzL25vZGVMYXlvdXQud29ya2VyLWVlYTNkNDJjLmpzLm1hcA==",yf=typeof window<"u"&&window.Blob&&new Blob([atob(mf)],{type:"text/javascript;charset=utf-8"});function Cx(){const r=yf&&(window.URL||window.webkitURL).createObjectURL(yf);try{return r?new Worker(r):new Worker("data:application/javascript;base64,"+mf)}finally{r&&(window.URL||window.webkitURL).revokeObjectURL(r)}}const Fa="timelineUpdateEvent";class xf extends ht{constructor({nodeContentContainerName:t,isSubNodes:i,graphData:n,graphState:s}){super();R(this,"layoutWorker",new Cx);R(this,"isSubNodes");R(this,"graphData");R(this,"graphState");R(this,"nodeContainer",new ht);R(this,"nodeRecords",new Map);R(this,"layout",W.ref({}));R(this,"layoutRows",W.ref([]));R(this,"edgeContainer",new ht);R(this,"edgeRecords",[]);R(this,"unWatchers",[]);R(this,"isSelectionPathHighlighted",!1);t&&(this.nodeContainer.name=t),this.isSubNodes=i,this.graphData=n,this.graphState=s,this.initDeselectLayer(),this.initLayoutWorker(),this.initWatchers()}initWatchers(){const{layoutSetting:t,hideEdges:i,selectedNodeId:n}=this.graphState;this.unWatchers.push(W.watch(t,()=>{this.updateLayoutSetting()}),W.watch(i,()=>{this.updateHideEdges()}),W.watch(n,()=>{if(n.value&&this.nodeRecords.has(n.value)){this.isSelectionPathHighlighted&&this.unHighlightSelectedNodePath(),this.isSelectionPathHighlighted=!0,this.highlightSelectedNodePath();return}this.isSelectionPathHighlighted&&(!n.value||!this.nodeRecords.has(n.value))&&this.unHighlightSelectedNodePath()}))}async initLayoutWorker(){const{styleOptions:t,timeScaleProps:i,layoutSetting:n,centerViewport:s,suppressMotion:o}=this.graphState,a=await jn(t.value),{spacingMinimumNodeEdgeGap:h}=t.value,u=le.measureText("M",a.nodeTextStyles).width,l={data:{graphData:JSON.stringify(this.graphData),timeScaleProps:i,spacingMinimumNodeEdgeGap:h,apxCharacterWidth:u,layoutSetting:n.value}};this.layoutWorker.onmessage=({data:f})=>{this.layout.value=f.layout,this.renderLayout(),this.isSelectionPathHighlighted&&this.highlightSelectedNodePath(),f.centerViewportAfter&&!this.isSubNodes&&setTimeout(()=>{s()},o.value?10:gf.move*1e3*1.1),this.emit(Fa)},this.layoutWorker.postMessage(l.data)}initDeselectLayer(){if(this.isSubNodes)return;const{pixiApp:t,viewport:i}=this.graphState,n=new $y(t,i);this.addChild(n),n.on("click",()=>{this.emitNullSelection()})}renderLayout(){const{layout:t}=this,i=this.nodeRecords.size===0,n=[];Object.keys(t.value).forEach(s=>{const o=this.getNodeData(s);o&&(this.nodeRecords.has(s)?this.nodeRecords.get(s).update(o):(this.createNode(o),n.push(s)))}),this.updateLayoutRows(),n.forEach(s=>{this.nodeRecords.get(s).initializePosition()}),i&&(this.addChild(this.edgeContainer),this.addChild(this.nodeContainer),this.isSubNodes||this.graphState.centerViewport({skipAnimation:!0}))}updateLayoutRows(t=0){const{layout:i}=this,{spacingNodeMargin:n,spacingNodeSelectionMargin:s}=this.graphState.styleOptions.value,o=Math.max(...Object.values(i.value).map(h=>h.position));let a=[];for(let h=t;h<=o;h++){const u=a[h-1]?a[h-1].yPos+a[h-1].height-s*2+n:0,l=Object.keys(i.value).filter(c=>i.value[c].position===h),f=Math.max(...l.map(c=>{var d;return((d=this.nodeRecords.get(c))==null?void 0:d.height)??0}));a.push({yPos:u,height:f})}t>0&&(a=this.layoutRows.value.slice(0,t).concat(a)),this.layoutRows.value=a}createNode(t){const{graphState:i,layout:n,layoutRows:s}=this,o=new Rx({nodeData:t,graphState:i,layout:n,layoutRows:s});this.registerEmits(o),this.nodeRecords.set(t.id,o),this.addNodeEdges(t),this.nodeContainer.addChild(o),o.on(Na,()=>{this.updateLayoutRows()})}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 o=new mx({sourceNode:n,targetNode:s,graphState:this.graphState});this.graphState.hideEdges.value&&(o.renderable=!1),this.edgeRecords.push({edge:o,sourceId:i,targetId:t.id}),this.edgeContainer.addChild(o)})}update(t){if(this.graphData=t,t.length!==this.nodeRecords.size){const i={data:{graphData:JSON.stringify(this.graphData)}};this.layoutWorker.postMessage(i.data);return}this.nodeRecords.forEach((i,n)=>{const s=this.getNodeData(n);s&&i.update(s)}),this.emit(Fa)}updateHideEdges(){const{hideEdges:t,viewport:i}=this.graphState;this.edgeRecords.forEach(({edge:n})=>n.renderable=!t.value),t.value||(i.dirty=!0,i.updateTransform()),this.isSelectionPathHighlighted&&this.highlightSelectedNodePath()}updateLayoutSetting(){const{layoutSetting:t}=this.graphState,i={data:{graphData:JSON.stringify(this.graphData),layoutSetting:t.value,centerViewportAfter:!0}};this.layoutWorker.postMessage(i.data)}highlightSelectedNodePath(){const t=this.graphState.selectedNodeId.value,i=t&&this.nodeRecords.get(t);if(!t||!i)return;const{alphaNodeDimmed:n}=this.graphState.styleOptions.value,s=[...this.getAllUpstreamEdges(t),...this.getAllDownstreamEdges(t)],o=new Map;o.set(t,i),this.edgeRecords.forEach(a=>{if(s.includes(a)){const h=this.nodeRecords.get(a.sourceId),u=this.nodeRecords.get(a.targetId);o.set(a.sourceId,h),o.set(a.targetId,u),a.edge.renderable=!0;return}a.edge.alpha=n}),this.nodeRecords.forEach((a,h)=>{o.has(h)||(a.alpha=n)})}getAllUpstreamEdges(t){var s;const i=[],n=this.graphData.find(o=>o.id===t);return(s=n==null?void 0:n.upstreamDependencies)==null||s.forEach(o=>{const a=this.edgeRecords.find(h=>h.sourceId===o&&h.targetId===t);if(a){i.push(a);const h=this.getAllUpstreamEdges(o);i.push(...h)}}),i}getAllDownstreamEdges(t){const i=[];return this.graphData.forEach(n=>{var s;if((s=n.upstreamDependencies)!=null&&s.includes(t)){const o=this.edgeRecords.find(a=>a.targetId===n.id&&a.sourceId===t);if(o){i.push(o);const a=this.getAllDownstreamEdges(n.id);i.push(...a)}}}),i}unHighlightSelectedNodePath(){const{hideEdges:t}=this.graphState;this.edgeRecords.forEach(({edge:i})=>{t.value&&(i.renderable=!1),i.alpha=1}),this.nodeRecords.forEach(i=>{i.alpha=1})}registerEmits(t){t.on(he.nodeDetails,i=>{this.emit(he.nodeDetails,i)}),t.on(he.subNodesToggle,i=>{this.emit(he.subNodesToggle,i)})}emitNullSelection(){this.emit(he.nodeDetails,null)}getNodeData(t){return this.graphData.find(i=>i.id===t)}getEarliestNodeStart(){return this.graphData.length<1?null:this.graphData.reduce((i,n)=>n.start.getTime()<i.getTime()?n.start:i,this.graphData[0].start)}destroy(){this.nodeRecords.forEach(t=>t.destroy()),this.nodeRecords.clear(),this.edgeRecords.forEach(t=>t.edge.destroy()),this.removeChildren(),this.unWatchers.forEach(t=>t()),this.layoutWorker.terminate(),this.layoutWorker.onmessage=null,this.isSubNodes||i0(),super.destroy.call(this)}}class Ox extends ht{constructor({viewportRef:t,appRef:i,cull:n,formatDateFns:s,styleOptions:o}){super();R(this,"viewportRef");R(this,"appRef");R(this,"cull");R(this,"formatDateFns");R(this,"styleOptions");R(this,"unwatch");R(this,"playhead",new Le);R(this,"label");n.add(this),this.viewportRef=t,this.appRef=i,this.cull=n,this.formatDateFns=s,this.styleOptions=o,this.drawPlayhead(),this.drawTimeLabel(),this.unwatch=W.watch(o,()=>{this.playhead.clear(),this.drawPlayhead()},{deep:!0}),this.interactive=!1}drawPlayhead(){const{colorPlayheadBg:t,spacingPlayheadWidth:i,spacingPlayheadGlowPadding:n}=this.styleOptions.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.styleOptions.value,n=await jn(this.styleOptions.value),{timeBySeconds:s}=this.formatDateFns.value,o=s(new Date);this.label=new No(o,n.playheadTimerLabel),this.label.x=-this.label.width-(i+t),this.label.y=this.getTimeLabelY(),this.addChild(this.label),setInterval(()=>{const a=new Date;this.label.text=s(a)},1e3)}getTimeLabelY(){const{spacingGuideLabelPadding:t}=this.styleOptions.value;return this.appRef.screen.height-(this.label.height+t)}updatePosition(){const{spacingPlayheadWidth:t,spacingPlayheadGlowPadding:i}=this.styleOptions.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,this.label.y=this.getTimeLabelY())}destroy(){this.cull.remove(this),this.unwatch(),this.playhead.destroy(),super.destroy.call(this)}}const Ba={leftCap:"leftCap",body:"body",rightCap:"rightCap"},Ax=.2,Ix=.2;class Mx extends ht{constructor({graphState:t,nodeData:i,size:n,floating:s}){super();R(this,"graphState");R(this,"nodeData");R(this,"size");R(this,"isFloating");R(this,"isExpanded",!1);R(this,"textColor");R(this,"toggleBox",new ht);R(this,"hoverShade",new ht);R(this,"toggleArrow");R(this,"toggleBorder");R(this,"divider");R(this,"unWatchers",[]);this.interactive=!0,this.buttonMode=!0,t.cull.add(this),this.graphState=t,this.nodeData=i,this.size=n,this.isFloating=s,this.textColor=this.getTextColor(),this.addChild(this.toggleBox),this.addChild(this.hoverShade),this.initShapes(),this.on("pointerover",()=>{this.hover()}),this.on("pointerout",()=>{this.unHover()}),this.initWatchers()}initWatchers(){const{viewport:t,styleOptions:i,styleNode:n}=this.graphState;this.unWatchers.push(W.watch([i,n],()=>{this.redraw()},{deep:!0})),t.on("frame-end",()=>{t.scale.x<Ix?this.visible=!1:this.visible=!0})}initShapes(){this.drawToggleBox(),this.drawHoverShade(),this.drawDivider(),this.drawToggleArrow(),this.drawToggleBorder()}drawToggleBox(){if(this.toggleBox.removeChildren(),!this.isFloating)return;const{size:t,toggleBox:i}=this,{pixiApp:n,styleOptions:s}=this.graphState,{colorButtonBg:o,borderRadiusButton:a}=s.value,{cap:h,body:u}=zo({pixiApp:n,fill:o,borderRadius:a,boxCapWidth:a,height:t}),l=new ct(h),f=new ct(u);f.x=a,f.width=t-a*2,f.height=t;const c=new ct(h);c.scale.x=-1,c.x=t,i.addChild(l),i.addChild(f),i.addChild(c)}drawHoverShade(){const{hoverShade:t,size:i,isFloating:n}=this,{borderRadiusButton:s,colorButtonBgHover:o}=this.graphState.styleOptions.value,{onFillSubNodeToggleHoverBg:a,onFillSubNodeToggleHoverBgAlpha:h}=this.graphState.styleNode.value(this.nodeData),u=Jt(a);t.removeChildren();const{cap:l,body:f}=zo({pixiApp:this.graphState.pixiApp,fill:n?o:u,borderRadius:s,boxCapWidth:s,height:i}),c=new ct(l);c.name=Ba.leftCap,c.alpha=n?1:h;const d=new ct(f);d.name=Ba.body,d.x=s,d.width=n?i-s*2:i-s,d.height=i,d.alpha=n?1:h;const v=new ct(l);v.name=Ba.rightCap,v.scale.x=-1,v.x=i,v.alpha=n?1:0,t.addChild(c),t.addChild(d),t.addChild(v),t.alpha=0}drawDivider(){var o;if((o=this.divider)==null||o.destroy(),this.isFloating)return;const{size:t,textColor:i}=this,{pixiApp:n}=this.graphState,s=Xr({pixiApp:n,fill:i});this.divider=new ct(s),this.divider.width=1,this.divider.height=t,this.divider.x=t,this.addChild(this.divider)}drawToggleArrow(){var a;const{size:t,textColor:i,isExpanded:n}=this,{pixiApp:s}=this.graphState;(a=this.toggleArrow)==null||a.destroy();const o=Ju({pixiApp:s,strokeColor:i,edgeWidth:2,edgeLength:8});this.toggleArrow=new ct(o),this.toggleArrow.transform.rotation=n?Math.PI/2*-1:Math.PI/2,this.toggleArrow.anchor.set(.5,.5),this.toggleArrow.position.set(t/2,t/2),this.addChild(this.toggleArrow)}drawToggleBorder(){var a;(a=this.toggleBorder)==null||a.destroy();const{size:t,isFloating:i}=this,{colorButtonBorder:n,borderRadiusButton:s,spacingButtonBorderWidth:o}=this.graphState.styleOptions.value;!n||!i||(this.toggleBorder=new Ia({graphState:this.graphState,width:t,height:t,borderRadius:s,borderWidth:o,borderColor:n}),this.addChild(this.toggleBorder))}setToggleArrowRotation(t){const{suppressMotion:i}=this.graphState;this.toggleArrow&&oe.to(this.toggleArrow,{rotation:t,duration:i.value?0:Ax,ease:"power2.inOut"})}getTextColor(){const{styleOptions:t,styleNode:i}=this.graphState,{colorTextDefault:n,colorTextInverse:s}=t.value,{inverseTextOnFill:o}=i.value(this.nodeData);return this.isFloating?n:o?s:n}redraw(){this.textColor=this.getTextColor(),this.initShapes()}hover(){this.hoverShade.alpha=1}unHover(){this.hoverShade.alpha=0}setExpanded(){this.isExpanded=!0,this.setToggleArrowRotation(Math.PI/2*-1)}setCollapsed(){this.isExpanded=!1,this.setToggleArrowRotation(Math.PI/2)}updateFloatingState(t){this.isFloating!==t&&(this.isFloating=t,this.redraw())}destroy(){this.graphState.cull.remove(this),super.destroy.call(this)}}const Nx=W.defineComponent({__name:"FlowRunTimeline",props:{graphData:null,isRunning:{type:Boolean},theme:null,formatDateFns:null,selectedNodeId:null,layout:null,hideEdges:{type:Boolean},subNodeLabels:null,expandedSubNodes:null},emits:["selection","subNodeToggle"],setup(r,{expose:e,emit:t}){const i=r,n=500;e({centerViewport:vt,moveViewportCenter:st});const s=W.ref(),o=W.computed(()=>{var H;return((H=i.theme)==null?void 0:H.node)??Ya}),a=W.computed(()=>{var H;return $f((H=i.theme)==null?void 0:H.defaults)}),h=W.computed(()=>i.selectedNodeId??null),u=W.computed(()=>i.layout??"nearestParent"),l=W.computed(()=>i.isRunning??!1),f=W.computed(()=>i.hideEdges??!1),c=W.computed(()=>i.subNodeLabels??new Map),d=W.computed(()=>i.expandedSubNodes??new Map),v=W.computed(()=>{const H=window.matchMedia("(prefers-reduced-motion: reduce)").matches;return i.graphData.length>n||H}),p=W.ref(!1),_=W.computed(()=>({...za,...i.formatDateFns})),g={timelineGuides:0,viewport:10,playhead:20},y=W.ref(!0);let m,b;const x=new Hf;let T,w;const S=W.ref();let E,P,O,D,N,U=null;const I="rootNodesContainer";let A;W.onMounted(async()=>{if(!s.value){console.error("Stage reference not found in initPixiApp");return}z(),O=bx(T),m=Jy(s.value),m.stage.sortableChildren=!0,b=await e0(s.value,m),b.zIndex=g.viewport,K(),C(),V(),Lt(),G(),nt(),y.value=!1}),W.onBeforeUnmount(()=>{B()});function B(){D.destroy(),N==null||N.destroy(),A.destroy(),b.destroy(),m.destroy(!0)}function K(){b.on("drag-start",()=>{p.value=!0}).on("drag-end",()=>{p.value=!1})}function z(){const $=i.graphData.filter(Q=>Q.end).map(({start:Q,end:Wt})=>({start:Q,end:Wt}));l.value&&$.push({start:new Date,end:new Date});const{min:Z,max:xt,span:Rt}=Zf($,6e4);w=Z,S.value=xt,E=Rt,P=M(),T={minimumStartTime:w.getTime(),graphXDomain:P,initialOverallTimeSpan:E}}function M(){const{spacingNodeYPadding:H,textLineHeightDefault:$,spacingNodeMargin:Z,spacingSubNodesOutlineOffset:xt}=a.value,Rt=i.graphData.length,Q=$+H*2+xt*2+Z,Wt=s.value.clientWidth/s.value.clientHeight,_r=Q*Rt*Wt,vs=Rt>=120?Rt/100:1.2;return _r*vs}function C(){Ky(a.value),W.watch(a,H=>{qy(H)})}function G(){l.value&&(N=new Ox({viewportRef:b,appRef:m,cull:x,formatDateFns:_,styleOptions:a}),N.zIndex=g.playhead,m.stage.addChild(N),tt())}function tt(){U||!N||(U=()=>{if(l.value&&N&&!N.destroyed){const H=N.position.x>0&&N.position.x<m.screen.width;if(S.value=new Date,N.updatePosition(),!b.moving&&H&&N.position.x>m.screen.width-a.value.spacingViewportPaddingDefault){const $=O.xToDate(b.left);b.zoomPercent(-.1,!0),b.left=O.dateToX(new Date($))}}},m.ticker.add(U))}W.watch(l,H=>{y.value||(H&&(!N||N.destroyed)&&G(),!H&&N&&U&&(N.destroy(),m.ticker.remove(U),U=null))});function V(){D=new Sx({viewportRef:b,appRef:m,cull:x,minimumStartDate:w,maximumEndDate:S,isRunning:l.value,styleOptions:a,formatDateFns:_}),D.zIndex=g.timelineGuides,m.stage.addChild(D),m.ticker.add(()=>{D.updateGuides()})}function nt(){b.on("frame-end",()=>{b.dirty&&(Pt(),b.dirty=!1)})}function dt(){x.uncull()}function pt(){Pt()}function Pt(){x.cull(m.renderer.screen)}function Lt(){const H={pixiApp:m,viewport:b,cull:x,cullScreen:Pt,timeScaleProps:T,styleOptions:a,styleNode:o,layoutSetting:u,isRunning:l,hideEdges:f,subNodeLabels:c,selectedNodeId:h,expandedSubNodes:d,suppressMotion:v,centerViewport:vt};A=new xf({nodeContentContainerName:I,graphData:i.graphData,graphState:H}),b.addChild(A),A.on(he.nodeDetails,$=>{p.value||t("selection",$)}),A.on(he.subNodesToggle,$=>{p.value||t("subNodeToggle",$)}),W.watch(()=>i.graphData,()=>{A.update(i.graphData),b.dirty=!0})}function vt({skipAnimation:H}={}){const{spacingViewportPaddingDefault:$}=a.value,Z=500;dt();const{x:xt,y:Rt,width:Q,height:Wt}=A.getChildByName(I).getLocalBounds();pt();const He=b.findFit(Q+$*2,Wt+$*2);b.animate({position:{x:xt+Q/2,y:Rt+Wt/2},scale:He>1?1:He,time:H||v.value?0:Z,ease:"easeInOutQuad",removeOnInterrupt:!0})}function st({xOffset:H,yOffset:$}){const{x:Z,y:xt}=b.transform.position;b.setTransform(Z+H,xt+$,b.transform.scale.x,b.transform.scale.y)}return(H,$)=>(W.openBlock(),W.createElementBlock("div",{ref_key:"stage",ref:s,class:"g-flow-run-timeline"},null,512))}}),ub="";class ue{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 Dx=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Fx(r,e,t){return t={path:e,exports:{},require:function(i,n){return Bx(i,n??t.path)}},r(t,t.exports),t.exports}function Bx(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var bf=Fx(function(r,e){(function(){var t,i;i=function(n){return r.exports=n},t={linear:function(n,s,o,a){return o*n/a+s},easeInQuad:function(n,s,o,a){return o*(n/=a)*n+s},easeOutQuad:function(n,s,o,a){return-o*(n/=a)*(n-2)+s},easeInOutQuad:function(n,s,o,a){return(n/=a/2)<1?o/2*n*n+s:-o/2*(--n*(n-2)-1)+s},easeInCubic:function(n,s,o,a){return o*(n/=a)*n*n+s},easeOutCubic:function(n,s,o,a){return o*((n=n/a-1)*n*n+1)+s},easeInOutCubic:function(n,s,o,a){return(n/=a/2)<1?o/2*n*n*n+s:o/2*((n-=2)*n*n+2)+s},easeInQuart:function(n,s,o,a){return o*(n/=a)*n*n*n+s},easeOutQuart:function(n,s,o,a){return-o*((n=n/a-1)*n*n*n-1)+s},easeInOutQuart:function(n,s,o,a){return(n/=a/2)<1?o/2*n*n*n*n+s:-o/2*((n-=2)*n*n*n-2)+s},easeInQuint:function(n,s,o,a){return o*(n/=a)*n*n*n*n+s},easeOutQuint:function(n,s,o,a){return o*((n=n/a-1)*n*n*n*n+1)+s},easeInOutQuint:function(n,s,o,a){return(n/=a/2)<1?o/2*n*n*n*n*n+s:o/2*((n-=2)*n*n*n*n+2)+s},easeInSine:function(n,s,o,a){return-o*Math.cos(n/a*(Math.PI/2))+o+s},easeOutSine:function(n,s,o,a){return o*Math.sin(n/a*(Math.PI/2))+s},easeInOutSine:function(n,s,o,a){return-o/2*(Math.cos(Math.PI*n/a)-1)+s},easeInExpo:function(n,s,o,a){return n===0?s:o*Math.pow(2,10*(n/a-1))+s},easeOutExpo:function(n,s,o,a){return n===a?s+o:o*(-Math.pow(2,-10*n/a)+1)+s},easeInOutExpo:function(n,s,o,a){return(n/=a/2)<1?o/2*Math.pow(2,10*(n-1))+s:o/2*(-Math.pow(2,-10*--n)+2)+s},easeInCirc:function(n,s,o,a){return-o*(Math.sqrt(1-(n/=a)*n)-1)+s},easeOutCirc:function(n,s,o,a){return o*Math.sqrt(1-(n=n/a-1)*n)+s},easeInOutCirc:function(n,s,o,a){return(n/=a/2)<1?-o/2*(Math.sqrt(1-n*n)-1)+s:o/2*(Math.sqrt(1-(n-=2)*n)+1)+s},easeInElastic:function(n,s,o,a){var h,u,l;return l=1.70158,u=0,h=o,n===0||(n/=a),u||(u=a*.3),h<Math.abs(o)?(h=o,l=u/4):l=u/(2*Math.PI)*Math.asin(o/h),-(h*Math.pow(2,10*(n-=1))*Math.sin((n*a-l)*(2*Math.PI)/u))+s},easeOutElastic:function(n,s,o,a){var h,u,l;return l=1.70158,u=0,h=o,n===0||(n/=a),u||(u=a*.3),h<Math.abs(o)?(h=o,l=u/4):l=u/(2*Math.PI)*Math.asin(o/h),h*Math.pow(2,-10*n)*Math.sin((n*a-l)*(2*Math.PI)/u)+o+s},easeInOutElastic:function(n,s,o,a){var h,u,l;return l=1.70158,u=0,h=o,n===0||(n/=a/2),u||(u=a*(.3*1.5)),h<Math.abs(o)?(h=o,l=u/4):l=u/(2*Math.PI)*Math.asin(o/h),n<1?-.5*(h*Math.pow(2,10*(n-=1))*Math.sin((n*a-l)*(2*Math.PI)/u))+s:h*Math.pow(2,-10*(n-=1))*Math.sin((n*a-l)*(2*Math.PI)/u)*.5+o+s},easeInBack:function(n,s,o,a,h){return h===void 0&&(h=1.70158),o*(n/=a)*n*((h+1)*n-h)+s},easeOutBack:function(n,s,o,a,h){return h===void 0&&(h=1.70158),o*((n=n/a-1)*n*((h+1)*n+h)+1)+s},easeInOutBack:function(n,s,o,a,h){return h===void 0&&(h=1.70158),(n/=a/2)<1?o/2*(n*n*(((h*=1.525)+1)*n-h))+s:o/2*((n-=2)*n*(((h*=1.525)+1)*n+h)+2)+s},easeInBounce:function(n,s,o,a){var h;return h=t.easeOutBounce(a-n,0,o,a),o-h+s},easeOutBounce:function(n,s,o,a){return(n/=a)<1/2.75?o*(7.5625*n*n)+s:n<2/2.75?o*(7.5625*(n-=1.5/2.75)*n+.75)+s:n<2.5/2.75?o*(7.5625*(n-=2.25/2.75)*n+.9375)+s:o*(7.5625*(n-=2.625/2.75)*n+.984375)+s},easeInOutBounce:function(n,s,o,a){var h;return n<a/2?(h=t.easeInBounce(n*2,0,o,a),h*.5+s):(h=t.easeOutBounce(n*2-a,0,o,a),h*.5+o*.5+s)}},i(t)}).call(Dx)});function fs(r,e){if(r){if(typeof r=="function")return r;if(typeof r=="string")return bf[r]}else return bf[e]}const Lx={removeOnInterrupt:!1,ease:"linear",time:1e3};class Xe extends ue{__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),Xe.prototype.__init.call(this),Xe.prototype.__init2.call(this),Xe.prototype.__init3.call(this),Xe.prototype.__init4.call(this),Xe.prototype.__init5.call(this),Xe.prototype.__init6.call(this),Xe.prototype.__init7.call(this),this.options=Object.assign({},Lx,t),this.options.ease=fs(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,o=this.deltaX,a=this.deltaY,h=new j(this.parent.x,this.parent.y);this.parent.moveCenter(n+o*i,s+a*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 cs(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((...o)=>t.call(e,...o)),e=void 0)}return t}const Gx={sides:"all",friction:.5,time:150,ease:"easeInOutSine",underflow:"center",bounceBox:null};class Tf extends ue{constructor(e,t={}){super(e),this.options=Object.assign({},Gx,t),this.ease=fs(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===cs([t,"access",s=>s.options,"optionalAccess",s=>s.friction])||t.y&&t.percentChangeY===cs([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||{},!cs([i,"optionalAccess",s=>s.active])&&!cs([n,"optionalAccess",s=>s.active])&&(!this.toX||!this.toY)&&(!t.x||!t.y)){e=e||this.oob();const s=e.topLeft,o=e.bottomRight;if(!this.toX&&!t.x){let a=null;e.left&&this.left?a=this.parent.screenWorldWidth<this.parent.screenWidth?this.calcUnderflowX():-s.x:e.right&&this.right&&(a=this.parent.screenWorldWidth<this.parent.screenWidth?this.calcUnderflowX():-o.x),a!==null&&this.parent.x!==a&&(this.toX={time:0,start:this.parent.x,delta:a-this.parent.x,end:a},this.parent.emit("bounce-x-start",this.parent))}if(!this.toY&&!t.y){let a=null;e.top&&this.top?a=this.parent.screenWorldHeight<this.parent.screenHeight?this.calcUnderflowY():-s.y:e.bottom&&this.bottom&&(a=this.parent.screenWorldHeight<this.parent.screenHeight?this.calcUnderflowY():-o.y),a!==null&&this.parent.y!==a&&(this.toY={time:0,start:this.parent.y,delta:a-this.parent.y,end:a},this.parent.emit("bounce-y-start",this.parent))}}}reset(){this.toX=this.toY=null,this.bounce()}}const Ux={left:!1,right:!1,top:!1,bottom:!1,direction:null,underflow:"center"};class wf extends ue{constructor(e,t={}){super(e),this.options=Object.assign({},Ux,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 kx={minWidth:null,minHeight:null,maxWidth:null,maxHeight:null,minScale:null,maxScale:null};class Ef extends ue{constructor(e,t={}){super(e),this.options=Object.assign({},kx,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 Xx={friction:.98,bounce:.8,minSpeed:.01},_i=16;class Sf extends ue{constructor(e,t={}){super(e),this.options=Object.assign({},Xx,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,o=Math.log(s);this.parent.x+=this.x*_i/o*(Math.pow(s,n/_i)-Math.pow(s,i/_i)),this.x*=Math.pow(this.percentChangeX,e/_i)}if(this.y){const s=this.percentChangeY,o=Math.log(s);this.parent.y+=this.y*_i/o*(Math.pow(s,n/_i)-Math.pow(s,i/_i)),this.y*=Math.pow(this.percentChangeY,e/_i)}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 Hx={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 ds extends ue{__init(){this.windowEventHandlers=new Array}constructor(e,t={}){super(e),ds.prototype.__init.call(this),this.options=Object.assign({},Hx,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,o=i-this.last.y;if(this.moved||this.xDirection&&this.parent.input.checkThreshold(s)||this.yDirection&&this.parent.input.checkThreshold(o)){const a={x:t,y:i};return this.xDirection&&(this.parent.x+=(a.x-this.last.x)*this.options.factor),this.yDirection&&(this.parent.y+=(a.y-this.last.y)*this.options.factor),this.last=a,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,o]=this.options.wheelSwapAxes?n.reverse():n;return this.xDirection&&(this.parent.x+=s*i*this.options.wheelScroll*this.reverse),this.yDirection&&(this.parent.y+=o*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 Wx={speed:0,acceleration:null,radius:null};class Pf extends ue{constructor(e,t,i={}){super(e),this.target=t,this.options=Object.assign({},Wx,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,o=n-t.y;if(s||o)if(this.options.speed)if(this.options.acceleration){const a=Math.atan2(n-t.y,i-t.x),h=Math.sqrt(Math.pow(s,2)+Math.pow(o,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(a)*this.velocity.x,f=Math.sin(a)*this.velocity.y,c=Math.abs(l)>Math.abs(s)?i:t.x+l,d=Math.abs(f)>Math.abs(o)?n:t.y+f;this.parent.moveCenter(c,d),this.parent.emit("moved",{viewport:this.parent,type:"follow"})}}else{const a=Math.atan2(n-t.y,i-t.x),h=Math.cos(a)*this.options.speed,u=Math.sin(a)*this.options.speed,l=Math.abs(h)>Math.abs(s)?i:t.x+h,f=Math.abs(u)>Math.abs(o)?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 zx={radius:null,distance:null,top:null,bottom:null,left:null,right:null,speed:8,reverse:!1,noDecelerate:!1,linear:!1,allowButtons:!1};class Rf extends ue{constructor(e,t={}){super(e),this.options=Object.assign({},zx,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 o=Math.atan2(n.y-i,n.x-t);this.options.linear?(this.horizontal=Math.round(Math.cos(o))*this.options.speed*this.reverse*(60/1e3),this.vertical=Math.round(Math.sin(o))*this.options.speed*this.reverse*(60/1e3)):(this.horizontal=Math.cos(o)*this.options.speed*this.reverse*(60/1e3),this.vertical=Math.sin(o)*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 Yx={noDrag:!1,percent:1,center:null,factor:1,axis:"all"};class vr extends ue{__init(){this.active=!1}__init2(){this.pinching=!1}__init3(){this.moved=!1}constructor(e,t={}){super(e),vr.prototype.__init.call(this),vr.prototype.__init2.call(this),vr.prototype.__init3.call(this),this.options=Object.assign({},Yx,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],o=n[1],a=s.last&&o.last?Math.sqrt(Math.pow(o.last.x-s.last.x,2)+Math.pow(o.last.y-s.last.y,2)):null;if(s.id===e.data.pointerId?s.last={x:t,y:i,data:e.data}:o.id===e.data.pointerId&&(o.last={x:t,y:i,data:e.data}),a){let h;const u={x:s.last.x+(o.last.x-s.last.x)/2,y:s.last.y+(o.last.y-s.last.y)/2};this.options.center||(h=this.parent.toLocal(u));let l=Math.sqrt(Math.pow(o.last.x-s.last.x,2)+Math.pow(o.last.y-s.last.y,2));l=l===0?l=1e-10:l;const f=(1-a/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 Vx={topLeft:!1,friction:.8,time:1e3,ease:"easeInOutSine",interrupt:!0,removeOnComplete:!1,removeOnInterrupt:!1,forceStart:!1};class Cf extends ue{constructor(e,t,i,n={}){super(e),this.options=Object.assign({},Vx,n),this.ease=fs(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 o=this.startX,a=this.startY,h=this.deltaX,u=this.deltaY;if(t.time>this.options.time)i=!0,n=o+h,s=a+u;else{const l=this.ease(t.time,0,1,this.options.time);n=o+h*l,s=a+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 jx={width:0,height:0,time:1e3,ease:"easeInOutSine",center:null,interrupt:!0,removeOnComplete:!1,removeOnInterrupt:!1,forceStart:!1,noMove:!1};class Of extends ue{constructor(e,t={}){super(e),this.options=Object.assign({},jx,t),this.ease=fs(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,o=this.ease(s.time,s.startX,s.deltaX,this.options.time),a=this.ease(s.time,s.startY,s.deltaY,this.options.time);this.parent.scale.x=this.parent.screenWidth/o,this.parent.scale.y=this.parent.screenHeight/a}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 Zx={percent:.1,smooth:!1,interrupt:!0,reverse:!1,center:null,lineHeight:20,axis:"all",keyToPress:null,trackpadPinch:!1,wheelZoom:!0};class Af extends ue{constructor(e,t={}){super(e),this.options=Object.assign({},Zx,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 o=this.parent.plugins.get("clamp-zoom",!0);if(o&&o.clamp(),this.options.center)this.parent.moveCenter(this.options.center);else{const a=this.parent.toGlobal(s);this.parent.x+=t.x-a.x,this.parent.y+=t.y-a.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 o={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+o.x)*s-this.parent.scale.x)/this.options.smooth,y:((this.parent.scale.y+o.y)*s-this.parent.scale.y)/this.options.smooth},this.smoothingCount=0,this.smoothingCenter=t}else{let o;this.options.center||(o=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 a=this.parent.plugins.get("clamp-zoom",!0);if(a&&a.clamp(),this.options.center)this.parent.moveCenter(this.options.center);else{const h=this.parent.toGlobal(o);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 If{constructor(e){this.viewport=e,this.touches=[],this.addListeners()}addListeners(){this.viewport.interactive=!0,this.viewport.forceHitArea||(this.viewport.hitArea=new J(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 ps(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((...o)=>t.call(e,...o)),e=void 0)}return t}const en=["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=en.length){const n=this.plugins[e];n&&n.destroy(),this.plugins[e]=t;const s=en.indexOf(e);s!==-1&&en.splice(s,1),en.splice(i,0,e),this.sort()}get(e,t){return t&&ps([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]&&(ps([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){ps([this,"access",t=>t.plugins,"access",t=>t[e],"optionalAccess",t=>t.pause,"call",t=>t()])}resume(e){ps([this,"access",t=>t.plugins,"access",t=>t[e],"optionalAccess",t=>t.resume,"call",t=>t()])}sort(){this.list=[];for(const e of en)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 qx={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:Ut.shared};class La extends ht{__init(){this._disableOnContextMenu=e=>e.preventDefault()}constructor(e={}){super(),La.prototype.__init.call(this),this.options=Object.assign({},{divWheel:document.body},qx,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 If(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 J(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 J(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 o=this.plugins.get("clamp-zoom",!0);return!n&&o&&o.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 o=this.plugins.get("clamp-zoom",!0);return!n&&o&&o.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 Of(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 J(0,0,this.worldWidth,this.worldHeight))}drag(e){return this.plugins.add("drag",new ds(this,e)),this}clamp(e){return this.plugins.add("clamp",new wf(this,e)),this}decelerate(e){return this.plugins.add("decelerate",new Sf(this,e)),this}bounce(e){return this.plugins.add("bounce",new Tf(this,e)),this}pinch(e){return this.plugins.add("pinch",new vr(this,e)),this}snap(e,t,i){return this.plugins.add("snap",new Cf(this,e,t,i)),this}follow(e,t){return this.plugins.add("follow",new Pf(this,e,t)),this}wheel(e){return this.plugins.add("wheel",new Af(this,e)),this}animate(e){return this.plugins.add("animate",new Xe(this,e)),this}clampZoom(e){return this.plugins.add("clamp-zoom",new Ef(this,e)),this}mouseEdges(e){return this.plugins.add("mouse-edges",new Rf(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 o=!1;e<this.left?(this.left=e,o=!0):e+i>this.right&&(this.right=e+i,o=!0),t<this.top?(this.top=t,o=!0):t+n>this.bottom&&(this.bottom=t+n,o=!0),o&&this.emit("moved",{viewport:this,type:"ensureVisible"})}}const Kx=Object.freeze(Object.defineProperty({__proto__:null,Animate:Xe,Bounce:Tf,Clamp:wf,ClampZoom:Ef,Decelerate:Sf,Drag:ds,Follow:Pf,InputManager:If,MouseEdges:Rf,Pinch:vr,Plugin:ue,PluginManager:Mf,Snap:Cf,SnapZoom:Of,Viewport:La,Wheel:Af},Symbol.toStringTag,{value:"Module"}));jt.FlowRunTimeline=Nx,jt.formatDateFnsDefault=za,jt.nodeThemeFnDefault=Ya,Object.defineProperty(jt,Symbol.toStringTag,{value:"Module"})});
1062
1062
  //# sourceMappingURL=graphs.umd.js.map