@prefecthq/graphs 1.0.6 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/graphs.mjs +1 -1
- package/dist/graphs.umd.js +10 -10
- package/dist/graphs.umd.js.map +1 -1
- package/dist/{index-9b903be3.mjs → index-0669fb1d.mjs} +818 -814
- package/dist/{index-9b903be3.mjs.map → index-0669fb1d.mjs.map} +1 -1
- package/dist/{viewport.es-87938ebd.mjs → viewport.es-a4ca92c6.mjs} +2 -2
- package/dist/{viewport.es-87938ebd.mjs.map → viewport.es-a4ca92c6.mjs.map} +1 -1
- package/package.json +1 -1
package/dist/graphs.umd.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
(function(zt,W){typeof exports=="object"&&typeof module<"u"?W(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],W):(zt=typeof globalThis<"u"?globalThis:zt||self,W(zt["prefect-graphs"]={},zt.Vue))})(this,function(zt,W){"use strict";var ab=Object.defineProperty;var hb=(zt,W,De)=>W in zt?ab(zt,W,{enumerable:!0,configurable:!0,writable:!0,value:De}):zt[W]=De;var R=(zt,W,De)=>(hb(zt,typeof W!="symbol"?W+"":W,De),De);var De=Math.PI*2,Xf=180/Math.PI,Hf=Math.PI/180,Bt;(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"})(Bt||(Bt={}));var Z=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}(),un=[new Z,new Z,new Z,new Z],K=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=Bt.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=un[0].set(e.left,e.top),c=un[1].set(e.left,e.bottom),d=un[2].set(e.right,e.top),v=un[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 g=p*(c.y-f.y),_=p*(f.x-c.x),m=g*a+_*u,y=g*h+_*u,b=g*a+_*l,x=g*h+_*l;if(Math.max(m,y,b,x)<=g*f.x+_*f.y||Math.min(m,y,b,x)>=g*v.x+_*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}(),Wf=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=Bt.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 K(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}(),zf=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=Bt.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 K(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}(),ln=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=Bt.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}(),Yf=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=Bt.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}(),ji=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}(),Mt=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 Z;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 Z;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(De-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}(),bi=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],Ti=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],wi=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],Ei=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],Ts=[],za=[],fn=Math.sign;function Vf(){for(var r=0;r<16;r++){var e=[];Ts.push(e);for(var t=0;t<16;t++)for(var i=fn(bi[r]*bi[t]+wi[r]*Ti[t]),n=fn(Ti[r]*bi[t]+Ei[r]*Ti[t]),s=fn(bi[r]*wi[t]+wi[r]*Ei[t]),o=fn(Ti[r]*wi[t]+Ei[r]*Ei[t]),a=0;a<16;a++)if(bi[a]===i&&Ti[a]===n&&wi[a]===s&&Ei[a]===o){e.push(a);break}}for(var r=0;r<16;r++){var h=new Mt;h.set(bi[r],Ti[r],wi[r],Ei[r],0,0),za.push(h)}}Vf();var gt={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 bi[r]},uY:function(r){return Ti[r]},vX:function(r){return wi[r]},vY:function(r){return Ei[r]},inv:function(r){return r&8?r&15:-r&7},add:function(r,e){return Ts[r][e]},sub:function(r,e){return Ts[r][gt.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?gt.S:gt.N:Math.abs(e)*2<=Math.abs(r)?r>0?gt.E:gt.W:e>0?r>0?gt.SE:gt.SW:r>0?gt.NE:gt.NW},matrixAppendRotationInv:function(r,e,t,i){t===void 0&&(t=0),i===void 0&&(i=0);var n=za[gt.inv(e)];n.tx=t,n.ty=i,r.append(n)}},Ya=function(){function r(){this.worldTransform=new Mt,this.localTransform=new Mt,this.position=new ji(this.onChange,this,0,0),this.scale=new ji(this.onChange,this,1,1),this.pivot=new ji(this.onChange,this,0,0),this.skew=new ji(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 Si=new K;class jf{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,Si),this._recursive?this.cullRecursive(e,i,t):(t&&i._bounds.getRectangle(e),i[this._toggle]=Si.right>e.left&&Si.left<e.right&&Si.bottom>e.top&&Si.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(Si):t.getBounds(!0,Si);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:ub,atan2:lb,cos:fb,max:Zf,min:Va,sin:cb,tan:db,sqrt:pb,pow:vb,floor:gb,ceil:_b,random:mb,round:qf}=Math;function Kf(r){return r.toLocaleTimeString()}function $f(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 Qf(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 tc(r){return new Date(r.getFullYear(),r.getMonth(),r.getDate())}function ec(r){return new Date(r.getFullYear(),r.getMonth(),r.getDate(),Math.floor(r.getHours()/2)*2)}const Q={second:1e3,minute:1e3*60,hour:1e3*60*60,day:1e3*60*60*24,week:1e3*60*60*24*7},Nt={seconds:"seconds",minutes:"minutes",date:"date"},ja=[{ceiling:Q.second*4,span:Q.second,labelFormat:Nt.seconds},{ceiling:Q.second*8,span:Q.second*5,labelFormat:Nt.seconds},{ceiling:Q.second*13,span:Q.second*10,labelFormat:Nt.seconds},{ceiling:Q.second*20,span:Q.second*15,labelFormat:Nt.seconds},{ceiling:Q.second*45,span:Q.second*30,labelFormat:Nt.seconds},{ceiling:Q.minute*4,span:Q.minute,labelFormat:Nt.minutes},{ceiling:Q.minute*8,span:Q.minute*5,labelFormat:Nt.minutes},{ceiling:Q.minute*13,span:Q.minute*10,labelFormat:Nt.minutes},{ceiling:Q.minute*28,span:Q.minute*15,labelFormat:Nt.minutes},{ceiling:Q.hour*1.24,span:Q.minute*30,labelFormat:Nt.minutes},{ceiling:Q.hour*3,span:Q.hour,labelFormat:Nt.minutes},{ceiling:Q.hour*8,span:Q.hour*2,labelFormat:Nt.minutes},{ceiling:Q.hour*13,span:Q.hour*6,labelFormat:Nt.minutes},{ceiling:Q.hour*22,span:Q.hour*12,labelFormat:Nt.minutes},{ceiling:Q.day*4,span:Q.day,labelFormat:Nt.date},{ceiling:Q.week*2,span:Q.week,labelFormat:Nt.date},{ceiling:1/0,span:Q.week*4,labelFormat:Nt.date}];function ic(r){return{colorTextDefault:ee((r==null?void 0:r.colorTextDefault)??"#374151"),colorTextInverse:ee((r==null?void 0:r.colorTextInverse)??"#f8fafc"),colorTextSubdued:ee((r==null?void 0:r.colorTextSubdued)??"#6b7280"),colorEdge:ee((r==null?void 0:r.colorEdge)??"#374151"),colorNodeSelection:ee((r==null?void 0:r.colorNodeSelection)??"#024DFD"),colorButtonBg:ee((r==null?void 0:r.colorButtonBg)??"#ffffff"),colorButtonBgHover:ee((r==null?void 0:r.colorButtonBgHover)??"#cbd5e1"),colorButtonBorder:r!=null&&r.colorButtonBorder?ee(r.colorButtonBorder):null,colorGuideLine:ee((r==null?void 0:r.colorGuideLine)??"#cbd5e1"),colorPlayheadBg:ee((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 ee(r){const e=r.trim();if(e.startsWith("rgb")){const[t,i,n]=e.replace(/[^\d,]/g,"").split(",").map(s=>parseInt(s,10));return rc([t,i,n])}if(e.startsWith("hsl")){const[t,i,n]=e.replace(/[^\d,.%]/g,"").split(",").map(o=>parseInt(o,10));return Za(nc(t,i,n))}return Za(e)}function rc(r){return parseInt((1<<24|r[0]<<16|r[1]<<8|r[2]).toString(16).slice(1),16)}function nc(r,e,t){t/=100;const i=e*Va(t,1-t)/100,n=s=>{const o=(s+r/30)%12,a=t-i*Zf(Va(o-3,9-o,1),-1);return qf(255*a).toString(16).padStart(2,"0")};return`#${n(0)}${n(8)}${n(4)}`}function Za(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"?(qa(r),0):r.endsWith("em")||r.endsWith("rem")?sc(r):r.endsWith("px")?parseFloat(r):(qa(r),0)}function qa(r){console.error(`
|
|
1
|
+
(function(zt,H){typeof exports=="object"&&typeof module<"u"?H(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],H):(zt=typeof globalThis<"u"?globalThis:zt||self,H(zt["prefect-graphs"]={},zt.Vue))})(this,function(zt,H){"use strict";var ab=Object.defineProperty;var hb=(zt,H,De)=>H in zt?ab(zt,H,{enumerable:!0,configurable:!0,writable:!0,value:De}):zt[H]=De;var R=(zt,H,De)=>(hb(zt,typeof H!="symbol"?H+"":H,De),De);var De=Math.PI*2,Xf=180/Math.PI,Hf=Math.PI/180,Bt;(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"})(Bt||(Bt={}));var Z=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}(),un=[new Z,new Z,new Z,new Z],K=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=Bt.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=un[0].set(e.left,e.top),c=un[1].set(e.left,e.bottom),d=un[2].set(e.right,e.top),v=un[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 g=p*(c.y-f.y),_=p*(f.x-c.x),m=g*a+_*u,y=g*h+_*u,b=g*a+_*l,x=g*h+_*l;if(Math.max(m,y,b,x)<=g*f.x+_*f.y||Math.min(m,y,b,x)>=g*v.x+_*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}(),Wf=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=Bt.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 K(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}(),zf=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=Bt.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 K(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}(),ln=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=Bt.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}(),Yf=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=Bt.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}(),ji=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}(),Mt=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 Z;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 Z;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(De-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}(),bi=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],Ti=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],wi=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],Ei=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],Ts=[],za=[],fn=Math.sign;function Vf(){for(var r=0;r<16;r++){var e=[];Ts.push(e);for(var t=0;t<16;t++)for(var i=fn(bi[r]*bi[t]+wi[r]*Ti[t]),n=fn(Ti[r]*bi[t]+Ei[r]*Ti[t]),s=fn(bi[r]*wi[t]+wi[r]*Ei[t]),o=fn(Ti[r]*wi[t]+Ei[r]*Ei[t]),a=0;a<16;a++)if(bi[a]===i&&Ti[a]===n&&wi[a]===s&&Ei[a]===o){e.push(a);break}}for(var r=0;r<16;r++){var h=new Mt;h.set(bi[r],Ti[r],wi[r],Ei[r],0,0),za.push(h)}}Vf();var gt={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 bi[r]},uY:function(r){return Ti[r]},vX:function(r){return wi[r]},vY:function(r){return Ei[r]},inv:function(r){return r&8?r&15:-r&7},add:function(r,e){return Ts[r][e]},sub:function(r,e){return Ts[r][gt.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?gt.S:gt.N:Math.abs(e)*2<=Math.abs(r)?r>0?gt.E:gt.W:e>0?r>0?gt.SE:gt.SW:r>0?gt.NE:gt.NW},matrixAppendRotationInv:function(r,e,t,i){t===void 0&&(t=0),i===void 0&&(i=0);var n=za[gt.inv(e)];n.tx=t,n.ty=i,r.append(n)}},Ya=function(){function r(){this.worldTransform=new Mt,this.localTransform=new Mt,this.position=new ji(this.onChange,this,0,0),this.scale=new ji(this.onChange,this,1,1),this.pivot=new ji(this.onChange,this,0,0),this.skew=new ji(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 Si=new K;class jf{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,Si),this._recursive?this.cullRecursive(e,i,t):(t&&i._bounds.getRectangle(e),i[this._toggle]=Si.right>e.left&&Si.left<e.right&&Si.bottom>e.top&&Si.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(Si):t.getBounds(!0,Si);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:ub,atan2:lb,cos:fb,max:Zf,min:Va,sin:cb,tan:db,sqrt:pb,pow:vb,floor:gb,ceil:_b,random:mb,round:qf}=Math;function Kf(r){return r.toLocaleTimeString()}function $f(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 Qf(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 tc(r){return new Date(r.getFullYear(),r.getMonth(),r.getDate())}function ec(r){return new Date(r.getFullYear(),r.getMonth(),r.getDate(),Math.floor(r.getHours()/2)*2)}const Q={second:1e3,minute:1e3*60,hour:1e3*60*60,day:1e3*60*60*24,week:1e3*60*60*24*7},Nt={seconds:"seconds",minutes:"minutes",date:"date"},ja=[{ceiling:Q.second*4,span:Q.second,labelFormat:Nt.seconds},{ceiling:Q.second*8,span:Q.second*5,labelFormat:Nt.seconds},{ceiling:Q.second*13,span:Q.second*10,labelFormat:Nt.seconds},{ceiling:Q.second*20,span:Q.second*15,labelFormat:Nt.seconds},{ceiling:Q.second*45,span:Q.second*30,labelFormat:Nt.seconds},{ceiling:Q.minute*4,span:Q.minute,labelFormat:Nt.minutes},{ceiling:Q.minute*8,span:Q.minute*5,labelFormat:Nt.minutes},{ceiling:Q.minute*13,span:Q.minute*10,labelFormat:Nt.minutes},{ceiling:Q.minute*28,span:Q.minute*15,labelFormat:Nt.minutes},{ceiling:Q.hour*1.24,span:Q.minute*30,labelFormat:Nt.minutes},{ceiling:Q.hour*3,span:Q.hour,labelFormat:Nt.minutes},{ceiling:Q.hour*8,span:Q.hour*2,labelFormat:Nt.minutes},{ceiling:Q.hour*13,span:Q.hour*6,labelFormat:Nt.minutes},{ceiling:Q.hour*22,span:Q.hour*12,labelFormat:Nt.minutes},{ceiling:Q.day*4,span:Q.day,labelFormat:Nt.date},{ceiling:Q.week*2,span:Q.week,labelFormat:Nt.date},{ceiling:1/0,span:Q.week*4,labelFormat:Nt.date}];function ic(r){return{colorTextDefault:ee((r==null?void 0:r.colorTextDefault)??"#374151"),colorTextInverse:ee((r==null?void 0:r.colorTextInverse)??"#f8fafc"),colorTextSubdued:ee((r==null?void 0:r.colorTextSubdued)??"#6b7280"),colorEdge:ee((r==null?void 0:r.colorEdge)??"#374151"),colorNodeSelection:ee((r==null?void 0:r.colorNodeSelection)??"#024DFD"),colorButtonBg:ee((r==null?void 0:r.colorButtonBg)??"#ffffff"),colorButtonBgHover:ee((r==null?void 0:r.colorButtonBgHover)??"#cbd5e1"),colorButtonBorder:r!=null&&r.colorButtonBorder?ee(r.colorButtonBorder):null,colorGuideLine:ee((r==null?void 0:r.colorGuideLine)??"#cbd5e1"),colorPlayheadBg:ee((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 ee(r){const e=r.trim();if(e.startsWith("rgb")){const[t,i,n]=e.replace(/[^\d,]/g,"").split(",").map(s=>parseInt(s,10));return rc([t,i,n])}if(e.startsWith("hsl")){const[t,i,n]=e.replace(/[^\d,.%]/g,"").split(",").map(o=>parseInt(o,10));return Za(nc(t,i,n))}return Za(e)}function rc(r){return parseInt((1<<24|r[0]<<16|r[1]<<8|r[2]).toString(16).slice(1),16)}function nc(r,e,t){t/=100;const i=e*Va(t,1-t)/100,n=s=>{const o=(s+r/30)%12,a=t-i*Zf(Va(o-3,9-o,1),-1);return qf(255*a).toString(16).padStart(2,"0")};return`#${n(0)}${n(8)}${n(4)}`}function Za(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"?(qa(r),0):r.endsWith("em")||r.endsWith("rem")?sc(r):r.endsWith("px")?parseFloat(r):(qa(r),0)}function qa(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 sc(r){const e=getComputedStyle(document.documentElement).fontSize;return parseFloat(r)*parseFloat(e)}function Ka(r){return!!r.start&&!!r.end}const $a={timeBySeconds:Kf,timeByMinutes:$f,date:Jf},Ja=()=>({fill:"black",inverseTextOnFill:!0,onFillSubNodeToggleHoverBg:"black",onFillSubNodeToggleHoverBgAlpha:.4});var ws=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Qa={exports:{}};(function(r){(function(){function e(p,g){document.addEventListener?p.addEventListener("scroll",g,!1):p.attachEvent("scroll",g)}function t(p){document.body?p():document.addEventListener?document.addEventListener("DOMContentLoaded",function g(){document.removeEventListener("DOMContentLoaded",g),p()}):document.attachEvent("onreadystatechange",function g(){(document.readyState=="interactive"||document.readyState=="complete")&&(document.detachEvent("onreadystatechange",g),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,g){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:"+g+";"}function s(p){var g=p.g.offsetWidth,_=g+100;return p.j.style.width=_+"px",p.i.scrollLeft=_,p.h.scrollLeft=p.h.scrollWidth+100,p.l!==g?(p.l=g,!0):!1}function o(p,g){function _(){var y=m;s(y)&&y.g.parentNode!==null&&g(y.l)}var m=p;e(p.h,_),e(p.i,_),s(p)}function a(p,g,_){g=g||{},_=_||window,this.family=p,this.style=g.style||"normal",this.weight=g.weight||"normal",this.stretch=g.stretch||"normal",this.context=_}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,g){var _=p.style,m=p.weight;if(l===null){var y=document.createElement("div");try{y.style.font="condensed 100px sans-serif"}catch{}l=y.style.font!==""}return[_,m,l?p.stretch:"","100px",g].join(" ")}a.prototype.load=function(p,g){var _=this,m=p||"BESbswy",y=0,b=g||3e3,x=new Date().getTime();return new Promise(function(T,w){if(d(_.context)&&!c(_.context)){var S=new Promise(function(P,O){function M(){new Date().getTime()-x>=b?O(Error(""+b+"ms timeout exceeded")):_.context.document.fonts.load(v(_,'"'+_.family+'"'),m).then(function(L){1<=L.length?P():setTimeout(M,25)},O)}M()}),E=new Promise(function(P,O){y=setTimeout(function(){O(Error(""+b+"ms timeout exceeded"))},b)});Promise.race([E,S]).then(function(){clearTimeout(y),T(_)},w)}else t(function(){function P(){var U;(U=A!=-1&&I!=-1||A!=-1&&F!=-1||I!=-1&&F!=-1)&&((U=A!=I&&A!=F&&I!=F)||(h===null&&(U=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))/.exec(window.navigator.userAgent),h=!!U&&(536>parseInt(U[1],10)||parseInt(U[1],10)===536&&11>=parseInt(U[2],10))),U=h&&(A==Y&&I==Y&&F==Y||A==z&&I==z&&F==z||A==N&&I==N&&F==N)),U=!U),U&&(C.parentNode!==null&&C.parentNode.removeChild(C),clearTimeout(y),T(_))}function O(){if(new Date().getTime()-x>=b)C.parentNode!==null&&C.parentNode.removeChild(C),w(Error(""+b+"ms timeout exceeded"));else{var U=_.context.document.hidden;(U===!0||U===void 0)&&(A=M.g.offsetWidth,I=L.g.offsetWidth,F=B.g.offsetWidth,P()),y=setTimeout(O,50)}}var M=new i(m),L=new i(m),B=new i(m),A=-1,I=-1,F=-1,Y=-1,z=-1,N=-1,C=document.createElement("div");C.dir="ltr",n(M,v(_,"sans-serif")),n(L,v(_,"serif")),n(B,v(_,"monospace")),C.appendChild(M.g),C.appendChild(L.g),C.appendChild(B.g),_.context.document.body.appendChild(C),Y=M.g.offsetWidth,z=L.g.offsetWidth,N=B.g.offsetWidth,O(),o(M,function(U){A=U,P()}),n(M,v(_,'"'+_.family+'",sans-serif')),o(L,function(U){I=U,P()}),n(L,v(_,'"'+_.family+'",serif')),o(B,function(U){F=U,P()}),n(B,v(_,'"'+_.family+'",monospace'))})})},r.exports=a})()})(Qa);const oc=Qa.exports;function ac(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 hc(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 uc=setTimeout;function th(r){return Boolean(r&&typeof r.length<"u")}function lc(){}function fc(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=[],ih(r,this)}function eh(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?Es:br)(e.promise,r._value);return}var i;try{i=t(r._value)}catch(n){br(e.promise,n);return}Es(e.promise,i)})}function Es(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,Ss(r);return}else if(typeof t=="function"){ih(fc(t,e),r);return}}r._state=1,r._value=e,Ss(r)}catch(i){br(r,i)}}function br(r,e){r._state=2,r._value=e,Ss(r)}function Ss(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++)eh(r,r._deferreds[e]);r._deferreds=null}function cc(r,e,t){this.onFulfilled=typeof r=="function"?r:null,this.onRejected=typeof e=="function"?e:null,this.promise=t}function ih(r,e){var t=!1;try{r(function(i){t||(t=!0,Es(e,i))},function(i){t||(t=!0,br(e,i))})}catch(i){if(t)return;t=!0,br(e,i)}}Tt.prototype.catch=function(r){return this.then(null,r)},Tt.prototype.then=function(r,e){var t=new this.constructor(lc);return eh(this,new cc(r,e,t)),t},Tt.prototype.finally=ac,Tt.all=function(r){return new Tt(function(e,t){if(!th(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=hc,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(!th(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){uc(r,0)},Tt._unhandledRejectionFn=function(e){typeof console<"u"&&console&&console.warn("Possible Unhandled Promise Rejection:",e)};var rh=Object.getOwnPropertySymbols,dc=Object.prototype.hasOwnProperty,pc=Object.prototype.propertyIsEnumerable;function vc(r){if(r==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(r)}function gc(){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 _c=gc()?Object.assign:function(r,e){for(var t,i=vc(r),n,s=1;s<arguments.length;s++){t=Object(arguments[s]);for(var o in t)dc.call(t,o)&&(i[o]=t[o]);if(rh){n=rh(t);for(var a=0;a<n.length;a++)pc.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=_c);var mc=16;if(Date.now&&Date.prototype.getTime||(Date.now=function(){return new Date().getTime()}),!(globalThis.performance&&globalThis.performance.now)){var yc=Date.now();globalThis.performance||(globalThis.performance={}),globalThis.performance.now=function(){return Date.now()-yc}}for(var Ps=Date.now(),nh=["ms","moz","webkit","o"],Rs=0;Rs<nh.length&&!globalThis.requestAnimationFrame;++Rs){var Cs=nh[Rs];globalThis.requestAnimationFrame=globalThis[Cs+"RequestAnimationFrame"],globalThis.cancelAnimationFrame=globalThis[Cs+"CancelAnimationFrame"]||globalThis[Cs+"CancelRequestAnimationFrame"]}globalThis.requestAnimationFrame||(globalThis.requestAnimationFrame=function(r){if(typeof r!="function")throw new TypeError(r+"is not a function");var e=Date.now(),t=mc+Ps-e;return t<0&&(t=0),Ps=e,globalThis.self.setTimeout(function(){Ps=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 Ye;(function(r){r[r.WEBGL_LEGACY=0]="WEBGL_LEGACY",r[r.WEBGL=1]="WEBGL",r[r.WEBGL2=2]="WEBGL2"})(Ye||(Ye={}));var Tr;(function(r){r[r.UNKNOWN=0]="UNKNOWN",r[r.WEBGL=1]="WEBGL",r[r.CANVAS=2]="CANVAS"})(Tr||(Tr={}));var cn;(function(r){r[r.COLOR=16384]="COLOR",r[r.DEPTH=256]="DEPTH",r[r.STENCIL=1024]="STENCIL"})(cn||(cn={}));var H;(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"})(H||(H={}));var ye;(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"})(ye||(ye={}));var D;(function(r){r[r.RGBA=6408]="RGBA",r[r.RGB=6407]="RGB",r[r.RG=33319]="RG",r[r.RED=6403]="RED",r[r.RGBA_INTEGER=36249]="RGBA_INTEGER",r[r.RGB_INTEGER=36248]="RGB_INTEGER",r[r.RG_INTEGER=33320]="RG_INTEGER",r[r.RED_INTEGER=36244]="RED_INTEGER",r[r.ALPHA=6406]="ALPHA",r[r.LUMINANCE=6409]="LUMINANCE",r[r.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",r[r.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",r[r.DEPTH_STENCIL=34041]="DEPTH_STENCIL"})(D||(D={}));var Pi;(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"})(Pi||(Pi={}));var X;(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"})(X||(X={}));var dn;(function(r){r[r.FLOAT=0]="FLOAT",r[r.INT=1]="INT",r[r.UINT=2]="UINT"})(dn||(dn={}));var Fe;(function(r){r[r.NEAREST=0]="NEAREST",r[r.LINEAR=1]="LINEAR"})(Fe||(Fe={}));var Le;(function(r){r[r.CLAMP=33071]="CLAMP",r[r.REPEAT=10497]="REPEAT",r[r.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"})(Le||(Le={}));var xe;(function(r){r[r.OFF=0]="OFF",r[r.POW2=1]="POW2",r[r.ON=2]="ON",r[r.ON_MANUAL=3]="ON_MANUAL"})(xe||(xe={}));var be;(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"})(be||(be={}));var Te;(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"})(Te||(Te={}));var pn;(function(r){r[r.AUTO=0]="AUTO",r[r.MANUAL=1]="MANUAL"})(pn||(pn={}));var ie;(function(r){r.LOW="lowp",r.MEDIUM="mediump",r.HIGH="highp"})(ie||(ie={}));var Ot;(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"})(Ot||(Ot={}));var sh;(function(r){r[r.RED=1]="RED",r[r.GREEN=2]="GREEN",r[r.BLUE=4]="BLUE",r[r.ALPHA=8]="ALPHA"})(sh||(sh={}));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 Be;(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"})(Be||(Be={}));var xc={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)}},Os=/iPhone/i,oh=/iPod/i,ah=/iPad/i,hh=/\biOS-universal(?:.+)Mac\b/i,As=/\bAndroid(?:.+)Mobile\b/i,uh=/Android/i,Zi=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,vn=/Silk/i,Ve=/Windows Phone/i,lh=/\bWindows(?:.+)ARM\b/i,fh=/BlackBerry/i,ch=/BB10/i,dh=/Opera Mini/i,ph=/\b(CriOS|Chrome)(?:.+)Mobile/i,vh=/Mobile(?:.+)Firefox\b/i,gh=function(r){return typeof r<"u"&&r.platform==="MacIntel"&&typeof r.maxTouchPoints=="number"&&r.maxTouchPoints>1&&typeof MSStream>"u"};function bc(r){return function(e){return e.test(r)}}function Tc(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=bc(t),s={apple:{phone:n(Os)&&!n(Ve),ipod:n(oh),tablet:!n(Os)&&(n(ah)||gh(e))&&!n(Ve),universal:n(hh),device:(n(Os)||n(oh)||n(ah)||n(hh)||gh(e))&&!n(Ve)},amazon:{phone:n(Zi),tablet:!n(Zi)&&n(vn),device:n(Zi)||n(vn)},android:{phone:!n(Ve)&&n(Zi)||!n(Ve)&&n(As),tablet:!n(Ve)&&!n(Zi)&&!n(As)&&(n(vn)||n(uh)),device:!n(Ve)&&(n(Zi)||n(vn)||n(As)||n(uh))||n(/\bokhttp\b/i)},windows:{phone:n(Ve),tablet:n(lh),device:n(Ve)||n(lh)},other:{blackberry:n(fh),blackberry10:n(ch),opera:n(dh),firefox:n(vh),chrome:n(ph),device:n(fh)||n(ch)||n(dh)||n(vh)||n(ph)},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 Ge=Tc(globalThis.navigator);function wc(){return!Ge.apple.device}function Ec(r){var e=!0;if(Ge.tablet||Ge.phone){if(Ge.apple.device){var t=navigator.userAgent.match(/OS (\d+)_(\d+)?/);if(t){var i=parseInt(t[1],10);i<11&&(e=!1)}}if(Ge.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 G={ADAPTER:xc,MIPMAP_TEXTURES:xe.POW2,ANISOTROPIC_LEVEL:0,RESOLUTION:1,FILTER_RESOLUTION:1,FILTER_MULTISAMPLE:wt.NONE,SPRITE_MAX_TEXTURES:Ec(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:pn.AUTO,GC_MAX_IDLE:60*60,GC_MAX_CHECK_COUNT:60*10,WRAP_MODE:Le.CLAMP,SCALE_MODE:Fe.LINEAR,PRECISION_VERTEX:ie.HIGH,PRECISION_FRAGMENT:Ge.apple.device?ie.HIGH:ie.MEDIUM,CAN_UPLOAD_SAME_BUFFER:wc(),CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1},_h={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 g=this._events[p],_=arguments.length,m,y;if(g.fn){switch(g.once&&this.removeListener(u,g.fn,void 0,!0),_){case 1:return g.fn.call(g.context),!0;case 2:return g.fn.call(g.context,l),!0;case 3:return g.fn.call(g.context,l,f),!0;case 4:return g.fn.call(g.context,l,f,c),!0;case 5:return g.fn.call(g.context,l,f,c,d),!0;case 6:return g.fn.call(g.context,l,f,c,d,v),!0}for(y=1,m=new Array(_-1);y<_;y++)m[y-1]=arguments[y];g.fn.apply(g.context,m)}else{var b=g.length,x;for(y=0;y<b;y++)switch(g[y].once&&this.removeListener(u,g[y].fn,void 0,!0),_){case 1:g[y].fn.call(g[y].context);break;case 2:g[y].fn.call(g[y].context,l);break;case 3:g[y].fn.call(g[y].context,l,f);break;case 4:g[y].fn.call(g[y].context,l,f,c);break;default:if(!m)for(x=1,m=new Array(_-1);x<_;x++)m[x-1]=arguments[x];g[y].fn.apply(g[y].context,m)}}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<_;p++)(v[p].fn!==l||c&&!v[p].once||f&&v[p].context!==f)&&g.push(v[p]);g.length?this._events[d]=g.length===1?g[0]:g: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})(_h);const wr=_h.exports;var gn={exports:{}};gn.exports=_n,gn.exports.default=_n;function _n(r,e,t){t=t||2;var i=e&&e.length,n=i?e[0]*t:r.length,s=mh(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=Oc(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 Er(s,o,t,a,h,d,0),o}function mh(r,e,t,i,n){var s,o;if(n===Ns(r,e,t,i)>0)for(s=e;s<t;s+=i)o=bh(s,r[s],r[s+1],o);else for(s=t-i;s>=e;s-=i)o=bh(s,r[s],r[s+1],o);return o&&mn(o,o.next)&&(Pr(o),o=o.next),o}function Ri(r,e){if(!r)return r;e||(e=r);var t=r,i;do if(i=!1,!t.steiner&&(mn(t,t.next)||_t(t.prev,t,t.next)===0)){if(Pr(t),t=e=t.prev,t===t.next)break;i=!0}else t=t.next;while(i||t!==e);return e}function Er(r,e,t,i,n,s,o){if(r){!o&&s&&Dc(r,i,n,s);for(var a=r,h,u;r.prev!==r.next;){if(h=r.prev,u=r.next,s?Pc(r,i,n,s):Sc(r)){e.push(h.i/t|0),e.push(r.i/t|0),e.push(u.i/t|0),Pr(r),r=u.next,a=u.next;continue}if(r=u,r===a){o?o===1?(r=Rc(Ri(r),e,t),Er(r,e,t,i,n,s,2)):o===2&&Cc(r,e,t,i,n,s):Er(Ri(r),e,t,i,n,s,1);break}}}}function Sc(r){var e=r.prev,t=r,i=r.next;if(_t(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&&qi(n,a,s,h,o,u,v.x,v.y)&&_t(v.prev,v,v.next)>=0)return!1;v=v.next}return!0}function Pc(r,e,t,i){var n=r.prev,s=r,o=r.next;if(_t(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,g=l>f?l>c?l:c:f>c?f:c,_=Is(d,v,e,t,i),m=Is(p,g,e,t,i),y=r.prevZ,b=r.nextZ;y&&y.z>=_&&b&&b.z<=m;){if(y.x>=d&&y.x<=p&&y.y>=v&&y.y<=g&&y!==n&&y!==o&&qi(a,l,h,f,u,c,y.x,y.y)&&_t(y.prev,y,y.next)>=0||(y=y.prevZ,b.x>=d&&b.x<=p&&b.y>=v&&b.y<=g&&b!==n&&b!==o&&qi(a,l,h,f,u,c,b.x,b.y)&&_t(b.prev,b,b.next)>=0))return!1;b=b.nextZ}for(;y&&y.z>=_;){if(y.x>=d&&y.x<=p&&y.y>=v&&y.y<=g&&y!==n&&y!==o&&qi(a,l,h,f,u,c,y.x,y.y)&&_t(y.prev,y,y.next)>=0)return!1;y=y.prevZ}for(;b&&b.z<=m;){if(b.x>=d&&b.x<=p&&b.y>=v&&b.y<=g&&b!==n&&b!==o&&qi(a,l,h,f,u,c,b.x,b.y)&&_t(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function Rc(r,e,t){var i=r;do{var n=i.prev,s=i.next.next;!mn(n,s)&&yh(n,i,i.next,s)&&Sr(n,s)&&Sr(s,n)&&(e.push(n.i/t|0),e.push(i.i/t|0),e.push(s.i/t|0),Pr(i),Pr(i.next),i=r=s),i=i.next}while(i!==r);return Ri(i)}function Cc(r,e,t,i,n,s){var o=r;do{for(var a=o.next.next;a!==o.prev;){if(o.i!==a.i&&Bc(o,a)){var h=xh(o,a);o=Ri(o,o.next),h=Ri(h,h.next),Er(o,e,t,i,n,s,0),Er(h,e,t,i,n,s,0);return}a=a.next}o=o.next}while(o!==r)}function Oc(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=mh(r,a,h,i,!1),u===u.next&&(u.steiner=!0),n.push(Lc(u));for(n.sort(Ac),s=0;s<n.length;s++)t=Ic(n[s],t);return t}function Ac(r,e){return r.x-e.x}function Ic(r,e){var t=Mc(r,e);if(!t)return e;var i=xh(t,r);return Ri(i,i.next),Ri(t,t.next)}function Mc(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&&qi(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),Sr(t,r)&&(c<f||c===f&&(t.x>o.x||t.x===o.x&&Nc(o,t)))&&(o=t,f=c)),t=t.next;while(t!==h);return o}function Nc(r,e){return _t(r.prev,r,e.prev)<0&&_t(e.next,r,r.next)<0}function Dc(r,e,t,i){var n=r;do n.z===0&&(n.z=Is(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,Fc(n)}function Fc(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 Is(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 Lc(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 qi(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 Bc(r,e){return r.next.i!==e.i&&r.prev.i!==e.i&&!Gc(r,e)&&(Sr(r,e)&&Sr(e,r)&&Uc(r,e)&&(_t(r.prev,r,e.prev)||_t(r,e.prev,e))||mn(r,e)&&_t(r.prev,r,r.next)>0&&_t(e.prev,e,e.next)>0)}function _t(r,e,t){return(e.y-r.y)*(t.x-e.x)-(e.x-r.x)*(t.y-e.y)}function mn(r,e){return r.x===e.x&&r.y===e.y}function yh(r,e,t,i){var n=xn(_t(r,e,t)),s=xn(_t(r,e,i)),o=xn(_t(t,i,r)),a=xn(_t(t,i,e));return!!(n!==s&&o!==a||n===0&&yn(r,t,e)||s===0&&yn(r,i,e)||o===0&&yn(t,r,i)||a===0&&yn(t,e,i))}function yn(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 xn(r){return r>0?1:r<0?-1:0}function Gc(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&&yh(t,t.next,r,e))return!0;t=t.next}while(t!==r);return!1}function Sr(r,e){return _t(r.prev,r,r.next)<0?_t(r,e,r.next)>=0&&_t(r,r.prev,e)>=0:_t(r,e,r.prev)<0||_t(r,r.next,e)<0}function Uc(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 xh(r,e){var t=new Ms(r.i,r.x,r.y),i=new Ms(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 bh(r,e,t,i){var n=new Ms(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 Pr(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 Ms(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}_n.deviation=function(r,e,t,i){var n=e&&e.length,s=n?e[0]*t:r.length,o=Math.abs(Ns(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(Ns(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 Ns(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}_n.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 Ds={exports:{}};(function(r,e){(function(t){var i=e&&!e.nodeType&&e,n=r&&!r.nodeType&&r,s=typeof ws=="object"&&ws;(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="-",g=/^xn--/,_=/[^\x20-\x7E]/,m=/[\x2E\u3002\uFF0E\uFF61]/g,y={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},b=h-u,x=Math.floor,T=String.fromCharCode,w;function S(N){throw RangeError(y[N])}function E(N,C){for(var U=N.length,$=[];U--;)$[U]=C(N[U]);return $}function P(N,C){var U=N.split("@"),$="";U.length>1&&($=U[0]+"@",N=U[1]),N=N.replace(m,".");var j=N.split("."),it=E(j,C).join(".");return $+it}function O(N){for(var C=[],U=0,$=N.length,j,it;U<$;)j=N.charCodeAt(U++),j>=55296&&j<=56319&&U<$?(it=N.charCodeAt(U++),(it&64512)==56320?C.push(((j&1023)<<10)+(it&1023)+65536):(C.push(j),U--)):C.push(j);return C}function M(N){return E(N,function(C){var U="";return C>65535&&(C-=65536,U+=T(C>>>10&1023|55296),C=56320|C&1023),U+=T(C),U}).join("")}function L(N){return N-48<10?N-22:N-65<26?N-65:N-97<26?N-97:h}function B(N,C){return N+22+75*(N<26)-((C!=0)<<5)}function A(N,C,U){var $=0;for(N=U?x(N/c):N>>1,N+=x(N/C);N>b*l>>1;$+=h)N=x(N/b);return x($+(b+1)*N/(N+f))}function I(N){var C=[],U=N.length,$,j=0,it=v,vt=d,ft,It,Lt,xt,rt,ct,at,J,kt;for(ft=N.lastIndexOf(p),ft<0&&(ft=0),It=0;It<ft;++It)N.charCodeAt(It)>=128&&S("not-basic"),C.push(N.charCodeAt(It));for(Lt=ft>0?ft+1:0;Lt<U;){for(xt=j,rt=1,ct=h;Lt>=U&&S("invalid-input"),at=L(N.charCodeAt(Lt++)),(at>=h||at>x((a-j)/rt))&&S("overflow"),j+=at*rt,J=ct<=vt?u:ct>=vt+l?l:ct-vt,!(at<J);ct+=h)kt=h-J,rt>x(a/kt)&&S("overflow"),rt*=kt;$=C.length+1,vt=A(j-xt,$,xt==0),x(j/$)>a-it&&S("overflow"),it+=x(j/$),j%=$,C.splice(j++,0,it)}return M(C)}function F(N){var C,U,$,j,it,vt,ft,It,Lt,xt,rt,ct=[],at,J,kt,qt;for(N=O(N),at=N.length,C=v,U=0,it=d,vt=0;vt<at;++vt)rt=N[vt],rt<128&&ct.push(T(rt));for($=j=ct.length,j&&ct.push(p);$<at;){for(ft=a,vt=0;vt<at;++vt)rt=N[vt],rt>=C&&rt<ft&&(ft=rt);for(J=$+1,ft-C>x((a-U)/J)&&S("overflow"),U+=(ft-C)*J,C=ft,vt=0;vt<at;++vt)if(rt=N[vt],rt<C&&++U>a&&S("overflow"),rt==C){for(It=U,Lt=h;xt=Lt<=it?u:Lt>=it+l?l:Lt-it,!(It<xt);Lt+=h)qt=It-xt,kt=h-xt,ct.push(T(B(xt+qt%kt,0))),It=x(qt/kt);ct.push(T(B(It,0))),it=A(U,J,$==j),U=0,++$}++U,++C}return ct.join("")}function Y(N){return P(N,function(C){return g.test(C)?I(C.slice(4).toLowerCase()):C})}function z(N){return P(N,function(C){return _.test(C)?"xn--"+F(C):C})}if(o={version:"1.3.2",ucs2:{decode:O,encode:M},decode:I,encode:F,toASCII:z,toUnicode:Y},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})(ws)})(Ds,Ds.exports);var kc={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}},Rr={};function Xc(r,e){return Object.prototype.hasOwnProperty.call(r,e)}var Hc=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),Xc(n,d)?Array.isArray(n[d])?n[d].push(v):n[d]=[n[d],v]:n[d]=v}return n},Cr=function(r){switch(typeof r){case"string":return r;case"boolean":return r?"true":"false";case"number":return isFinite(r)?r:"";default:return""}},Wc=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(Cr(n))+t;return Array.isArray(r[n])?r[n].map(function(o){return s+encodeURIComponent(Cr(o))}).join(e):s+encodeURIComponent(Cr(r[n]))}).join(e):i?encodeURIComponent(Cr(i))+t+encodeURIComponent(Cr(r)):""};Rr.decode=Rr.parse=Hc,Rr.encode=Rr.stringify=Wc;var zc=Ds.exports,Ue=kc,Yc=bn,Vc=rd,jc=id;function we(){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 Zc=/^([a-z0-9.+-]+:)/i,qc=/:[0-9]*$/,Kc=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,$c=["<",">",'"',"`"," ","\r",`
|
|
5
|
+
`)}function sc(r){const e=getComputedStyle(document.documentElement).fontSize;return parseFloat(r)*parseFloat(e)}function Ka(r){return!!r.start&&!!r.end}const $a={timeBySeconds:Kf,timeByMinutes:$f,date:Jf},Ja=()=>({fill:"black",inverseTextOnFill:!0,onFillSubNodeToggleHoverBg:"black",onFillSubNodeToggleHoverBgAlpha:.4});var ws=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Qa={exports:{}};(function(r){(function(){function e(p,g){document.addEventListener?p.addEventListener("scroll",g,!1):p.attachEvent("scroll",g)}function t(p){document.body?p():document.addEventListener?document.addEventListener("DOMContentLoaded",function g(){document.removeEventListener("DOMContentLoaded",g),p()}):document.attachEvent("onreadystatechange",function g(){(document.readyState=="interactive"||document.readyState=="complete")&&(document.detachEvent("onreadystatechange",g),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,g){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:"+g+";"}function s(p){var g=p.g.offsetWidth,_=g+100;return p.j.style.width=_+"px",p.i.scrollLeft=_,p.h.scrollLeft=p.h.scrollWidth+100,p.l!==g?(p.l=g,!0):!1}function o(p,g){function _(){var y=m;s(y)&&y.g.parentNode!==null&&g(y.l)}var m=p;e(p.h,_),e(p.i,_),s(p)}function a(p,g,_){g=g||{},_=_||window,this.family=p,this.style=g.style||"normal",this.weight=g.weight||"normal",this.stretch=g.stretch||"normal",this.context=_}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,g){var _=p.style,m=p.weight;if(l===null){var y=document.createElement("div");try{y.style.font="condensed 100px sans-serif"}catch{}l=y.style.font!==""}return[_,m,l?p.stretch:"","100px",g].join(" ")}a.prototype.load=function(p,g){var _=this,m=p||"BESbswy",y=0,b=g||3e3,x=new Date().getTime();return new Promise(function(T,w){if(d(_.context)&&!c(_.context)){var S=new Promise(function(P,O){function M(){new Date().getTime()-x>=b?O(Error(""+b+"ms timeout exceeded")):_.context.document.fonts.load(v(_,'"'+_.family+'"'),m).then(function(L){1<=L.length?P():setTimeout(M,25)},O)}M()}),E=new Promise(function(P,O){y=setTimeout(function(){O(Error(""+b+"ms timeout exceeded"))},b)});Promise.race([E,S]).then(function(){clearTimeout(y),T(_)},w)}else t(function(){function P(){var U;(U=A!=-1&&I!=-1||A!=-1&&F!=-1||I!=-1&&F!=-1)&&((U=A!=I&&A!=F&&I!=F)||(h===null&&(U=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))/.exec(window.navigator.userAgent),h=!!U&&(536>parseInt(U[1],10)||parseInt(U[1],10)===536&&11>=parseInt(U[2],10))),U=h&&(A==Y&&I==Y&&F==Y||A==z&&I==z&&F==z||A==N&&I==N&&F==N)),U=!U),U&&(C.parentNode!==null&&C.parentNode.removeChild(C),clearTimeout(y),T(_))}function O(){if(new Date().getTime()-x>=b)C.parentNode!==null&&C.parentNode.removeChild(C),w(Error(""+b+"ms timeout exceeded"));else{var U=_.context.document.hidden;(U===!0||U===void 0)&&(A=M.g.offsetWidth,I=L.g.offsetWidth,F=B.g.offsetWidth,P()),y=setTimeout(O,50)}}var M=new i(m),L=new i(m),B=new i(m),A=-1,I=-1,F=-1,Y=-1,z=-1,N=-1,C=document.createElement("div");C.dir="ltr",n(M,v(_,"sans-serif")),n(L,v(_,"serif")),n(B,v(_,"monospace")),C.appendChild(M.g),C.appendChild(L.g),C.appendChild(B.g),_.context.document.body.appendChild(C),Y=M.g.offsetWidth,z=L.g.offsetWidth,N=B.g.offsetWidth,O(),o(M,function(U){A=U,P()}),n(M,v(_,'"'+_.family+'",sans-serif')),o(L,function(U){I=U,P()}),n(L,v(_,'"'+_.family+'",serif')),o(B,function(U){F=U,P()}),n(B,v(_,'"'+_.family+'",monospace'))})})},r.exports=a})()})(Qa);const oc=Qa.exports;function ac(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 hc(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 uc=setTimeout;function th(r){return Boolean(r&&typeof r.length<"u")}function lc(){}function fc(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=[],ih(r,this)}function eh(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?Es:br)(e.promise,r._value);return}var i;try{i=t(r._value)}catch(n){br(e.promise,n);return}Es(e.promise,i)})}function Es(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,Ss(r);return}else if(typeof t=="function"){ih(fc(t,e),r);return}}r._state=1,r._value=e,Ss(r)}catch(i){br(r,i)}}function br(r,e){r._state=2,r._value=e,Ss(r)}function Ss(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++)eh(r,r._deferreds[e]);r._deferreds=null}function cc(r,e,t){this.onFulfilled=typeof r=="function"?r:null,this.onRejected=typeof e=="function"?e:null,this.promise=t}function ih(r,e){var t=!1;try{r(function(i){t||(t=!0,Es(e,i))},function(i){t||(t=!0,br(e,i))})}catch(i){if(t)return;t=!0,br(e,i)}}Tt.prototype.catch=function(r){return this.then(null,r)},Tt.prototype.then=function(r,e){var t=new this.constructor(lc);return eh(this,new cc(r,e,t)),t},Tt.prototype.finally=ac,Tt.all=function(r){return new Tt(function(e,t){if(!th(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=hc,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(!th(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){uc(r,0)},Tt._unhandledRejectionFn=function(e){typeof console<"u"&&console&&console.warn("Possible Unhandled Promise Rejection:",e)};var rh=Object.getOwnPropertySymbols,dc=Object.prototype.hasOwnProperty,pc=Object.prototype.propertyIsEnumerable;function vc(r){if(r==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(r)}function gc(){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 _c=gc()?Object.assign:function(r,e){for(var t,i=vc(r),n,s=1;s<arguments.length;s++){t=Object(arguments[s]);for(var o in t)dc.call(t,o)&&(i[o]=t[o]);if(rh){n=rh(t);for(var a=0;a<n.length;a++)pc.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=_c);var mc=16;if(Date.now&&Date.prototype.getTime||(Date.now=function(){return new Date().getTime()}),!(globalThis.performance&&globalThis.performance.now)){var yc=Date.now();globalThis.performance||(globalThis.performance={}),globalThis.performance.now=function(){return Date.now()-yc}}for(var Ps=Date.now(),nh=["ms","moz","webkit","o"],Rs=0;Rs<nh.length&&!globalThis.requestAnimationFrame;++Rs){var Cs=nh[Rs];globalThis.requestAnimationFrame=globalThis[Cs+"RequestAnimationFrame"],globalThis.cancelAnimationFrame=globalThis[Cs+"CancelAnimationFrame"]||globalThis[Cs+"CancelRequestAnimationFrame"]}globalThis.requestAnimationFrame||(globalThis.requestAnimationFrame=function(r){if(typeof r!="function")throw new TypeError(r+"is not a function");var e=Date.now(),t=mc+Ps-e;return t<0&&(t=0),Ps=e,globalThis.self.setTimeout(function(){Ps=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 Ye;(function(r){r[r.WEBGL_LEGACY=0]="WEBGL_LEGACY",r[r.WEBGL=1]="WEBGL",r[r.WEBGL2=2]="WEBGL2"})(Ye||(Ye={}));var Tr;(function(r){r[r.UNKNOWN=0]="UNKNOWN",r[r.WEBGL=1]="WEBGL",r[r.CANVAS=2]="CANVAS"})(Tr||(Tr={}));var cn;(function(r){r[r.COLOR=16384]="COLOR",r[r.DEPTH=256]="DEPTH",r[r.STENCIL=1024]="STENCIL"})(cn||(cn={}));var W;(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"})(W||(W={}));var ye;(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"})(ye||(ye={}));var D;(function(r){r[r.RGBA=6408]="RGBA",r[r.RGB=6407]="RGB",r[r.RG=33319]="RG",r[r.RED=6403]="RED",r[r.RGBA_INTEGER=36249]="RGBA_INTEGER",r[r.RGB_INTEGER=36248]="RGB_INTEGER",r[r.RG_INTEGER=33320]="RG_INTEGER",r[r.RED_INTEGER=36244]="RED_INTEGER",r[r.ALPHA=6406]="ALPHA",r[r.LUMINANCE=6409]="LUMINANCE",r[r.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",r[r.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",r[r.DEPTH_STENCIL=34041]="DEPTH_STENCIL"})(D||(D={}));var Pi;(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"})(Pi||(Pi={}));var X;(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"})(X||(X={}));var dn;(function(r){r[r.FLOAT=0]="FLOAT",r[r.INT=1]="INT",r[r.UINT=2]="UINT"})(dn||(dn={}));var Fe;(function(r){r[r.NEAREST=0]="NEAREST",r[r.LINEAR=1]="LINEAR"})(Fe||(Fe={}));var Le;(function(r){r[r.CLAMP=33071]="CLAMP",r[r.REPEAT=10497]="REPEAT",r[r.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"})(Le||(Le={}));var xe;(function(r){r[r.OFF=0]="OFF",r[r.POW2=1]="POW2",r[r.ON=2]="ON",r[r.ON_MANUAL=3]="ON_MANUAL"})(xe||(xe={}));var be;(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"})(be||(be={}));var Te;(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"})(Te||(Te={}));var pn;(function(r){r[r.AUTO=0]="AUTO",r[r.MANUAL=1]="MANUAL"})(pn||(pn={}));var ie;(function(r){r.LOW="lowp",r.MEDIUM="mediump",r.HIGH="highp"})(ie||(ie={}));var Ot;(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"})(Ot||(Ot={}));var sh;(function(r){r[r.RED=1]="RED",r[r.GREEN=2]="GREEN",r[r.BLUE=4]="BLUE",r[r.ALPHA=8]="ALPHA"})(sh||(sh={}));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 Be;(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"})(Be||(Be={}));var xc={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)}},Os=/iPhone/i,oh=/iPod/i,ah=/iPad/i,hh=/\biOS-universal(?:.+)Mac\b/i,As=/\bAndroid(?:.+)Mobile\b/i,uh=/Android/i,Zi=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,vn=/Silk/i,Ve=/Windows Phone/i,lh=/\bWindows(?:.+)ARM\b/i,fh=/BlackBerry/i,ch=/BB10/i,dh=/Opera Mini/i,ph=/\b(CriOS|Chrome)(?:.+)Mobile/i,vh=/Mobile(?:.+)Firefox\b/i,gh=function(r){return typeof r<"u"&&r.platform==="MacIntel"&&typeof r.maxTouchPoints=="number"&&r.maxTouchPoints>1&&typeof MSStream>"u"};function bc(r){return function(e){return e.test(r)}}function Tc(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=bc(t),s={apple:{phone:n(Os)&&!n(Ve),ipod:n(oh),tablet:!n(Os)&&(n(ah)||gh(e))&&!n(Ve),universal:n(hh),device:(n(Os)||n(oh)||n(ah)||n(hh)||gh(e))&&!n(Ve)},amazon:{phone:n(Zi),tablet:!n(Zi)&&n(vn),device:n(Zi)||n(vn)},android:{phone:!n(Ve)&&n(Zi)||!n(Ve)&&n(As),tablet:!n(Ve)&&!n(Zi)&&!n(As)&&(n(vn)||n(uh)),device:!n(Ve)&&(n(Zi)||n(vn)||n(As)||n(uh))||n(/\bokhttp\b/i)},windows:{phone:n(Ve),tablet:n(lh),device:n(Ve)||n(lh)},other:{blackberry:n(fh),blackberry10:n(ch),opera:n(dh),firefox:n(vh),chrome:n(ph),device:n(fh)||n(ch)||n(dh)||n(vh)||n(ph)},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 Ge=Tc(globalThis.navigator);function wc(){return!Ge.apple.device}function Ec(r){var e=!0;if(Ge.tablet||Ge.phone){if(Ge.apple.device){var t=navigator.userAgent.match(/OS (\d+)_(\d+)?/);if(t){var i=parseInt(t[1],10);i<11&&(e=!1)}}if(Ge.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 G={ADAPTER:xc,MIPMAP_TEXTURES:xe.POW2,ANISOTROPIC_LEVEL:0,RESOLUTION:1,FILTER_RESOLUTION:1,FILTER_MULTISAMPLE:wt.NONE,SPRITE_MAX_TEXTURES:Ec(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:pn.AUTO,GC_MAX_IDLE:60*60,GC_MAX_CHECK_COUNT:60*10,WRAP_MODE:Le.CLAMP,SCALE_MODE:Fe.LINEAR,PRECISION_VERTEX:ie.HIGH,PRECISION_FRAGMENT:Ge.apple.device?ie.HIGH:ie.MEDIUM,CAN_UPLOAD_SAME_BUFFER:wc(),CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1},_h={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 g=this._events[p],_=arguments.length,m,y;if(g.fn){switch(g.once&&this.removeListener(u,g.fn,void 0,!0),_){case 1:return g.fn.call(g.context),!0;case 2:return g.fn.call(g.context,l),!0;case 3:return g.fn.call(g.context,l,f),!0;case 4:return g.fn.call(g.context,l,f,c),!0;case 5:return g.fn.call(g.context,l,f,c,d),!0;case 6:return g.fn.call(g.context,l,f,c,d,v),!0}for(y=1,m=new Array(_-1);y<_;y++)m[y-1]=arguments[y];g.fn.apply(g.context,m)}else{var b=g.length,x;for(y=0;y<b;y++)switch(g[y].once&&this.removeListener(u,g[y].fn,void 0,!0),_){case 1:g[y].fn.call(g[y].context);break;case 2:g[y].fn.call(g[y].context,l);break;case 3:g[y].fn.call(g[y].context,l,f);break;case 4:g[y].fn.call(g[y].context,l,f,c);break;default:if(!m)for(x=1,m=new Array(_-1);x<_;x++)m[x-1]=arguments[x];g[y].fn.apply(g[y].context,m)}}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<_;p++)(v[p].fn!==l||c&&!v[p].once||f&&v[p].context!==f)&&g.push(v[p]);g.length?this._events[d]=g.length===1?g[0]:g: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})(_h);const wr=_h.exports;var gn={exports:{}};gn.exports=_n,gn.exports.default=_n;function _n(r,e,t){t=t||2;var i=e&&e.length,n=i?e[0]*t:r.length,s=mh(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=Oc(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 Er(s,o,t,a,h,d,0),o}function mh(r,e,t,i,n){var s,o;if(n===Ns(r,e,t,i)>0)for(s=e;s<t;s+=i)o=bh(s,r[s],r[s+1],o);else for(s=t-i;s>=e;s-=i)o=bh(s,r[s],r[s+1],o);return o&&mn(o,o.next)&&(Pr(o),o=o.next),o}function Ri(r,e){if(!r)return r;e||(e=r);var t=r,i;do if(i=!1,!t.steiner&&(mn(t,t.next)||_t(t.prev,t,t.next)===0)){if(Pr(t),t=e=t.prev,t===t.next)break;i=!0}else t=t.next;while(i||t!==e);return e}function Er(r,e,t,i,n,s,o){if(r){!o&&s&&Dc(r,i,n,s);for(var a=r,h,u;r.prev!==r.next;){if(h=r.prev,u=r.next,s?Pc(r,i,n,s):Sc(r)){e.push(h.i/t|0),e.push(r.i/t|0),e.push(u.i/t|0),Pr(r),r=u.next,a=u.next;continue}if(r=u,r===a){o?o===1?(r=Rc(Ri(r),e,t),Er(r,e,t,i,n,s,2)):o===2&&Cc(r,e,t,i,n,s):Er(Ri(r),e,t,i,n,s,1);break}}}}function Sc(r){var e=r.prev,t=r,i=r.next;if(_t(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&&qi(n,a,s,h,o,u,v.x,v.y)&&_t(v.prev,v,v.next)>=0)return!1;v=v.next}return!0}function Pc(r,e,t,i){var n=r.prev,s=r,o=r.next;if(_t(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,g=l>f?l>c?l:c:f>c?f:c,_=Is(d,v,e,t,i),m=Is(p,g,e,t,i),y=r.prevZ,b=r.nextZ;y&&y.z>=_&&b&&b.z<=m;){if(y.x>=d&&y.x<=p&&y.y>=v&&y.y<=g&&y!==n&&y!==o&&qi(a,l,h,f,u,c,y.x,y.y)&&_t(y.prev,y,y.next)>=0||(y=y.prevZ,b.x>=d&&b.x<=p&&b.y>=v&&b.y<=g&&b!==n&&b!==o&&qi(a,l,h,f,u,c,b.x,b.y)&&_t(b.prev,b,b.next)>=0))return!1;b=b.nextZ}for(;y&&y.z>=_;){if(y.x>=d&&y.x<=p&&y.y>=v&&y.y<=g&&y!==n&&y!==o&&qi(a,l,h,f,u,c,y.x,y.y)&&_t(y.prev,y,y.next)>=0)return!1;y=y.prevZ}for(;b&&b.z<=m;){if(b.x>=d&&b.x<=p&&b.y>=v&&b.y<=g&&b!==n&&b!==o&&qi(a,l,h,f,u,c,b.x,b.y)&&_t(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function Rc(r,e,t){var i=r;do{var n=i.prev,s=i.next.next;!mn(n,s)&&yh(n,i,i.next,s)&&Sr(n,s)&&Sr(s,n)&&(e.push(n.i/t|0),e.push(i.i/t|0),e.push(s.i/t|0),Pr(i),Pr(i.next),i=r=s),i=i.next}while(i!==r);return Ri(i)}function Cc(r,e,t,i,n,s){var o=r;do{for(var a=o.next.next;a!==o.prev;){if(o.i!==a.i&&Bc(o,a)){var h=xh(o,a);o=Ri(o,o.next),h=Ri(h,h.next),Er(o,e,t,i,n,s,0),Er(h,e,t,i,n,s,0);return}a=a.next}o=o.next}while(o!==r)}function Oc(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=mh(r,a,h,i,!1),u===u.next&&(u.steiner=!0),n.push(Lc(u));for(n.sort(Ac),s=0;s<n.length;s++)t=Ic(n[s],t);return t}function Ac(r,e){return r.x-e.x}function Ic(r,e){var t=Mc(r,e);if(!t)return e;var i=xh(t,r);return Ri(i,i.next),Ri(t,t.next)}function Mc(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&&qi(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),Sr(t,r)&&(c<f||c===f&&(t.x>o.x||t.x===o.x&&Nc(o,t)))&&(o=t,f=c)),t=t.next;while(t!==h);return o}function Nc(r,e){return _t(r.prev,r,e.prev)<0&&_t(e.next,r,r.next)<0}function Dc(r,e,t,i){var n=r;do n.z===0&&(n.z=Is(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,Fc(n)}function Fc(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 Is(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 Lc(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 qi(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 Bc(r,e){return r.next.i!==e.i&&r.prev.i!==e.i&&!Gc(r,e)&&(Sr(r,e)&&Sr(e,r)&&Uc(r,e)&&(_t(r.prev,r,e.prev)||_t(r,e.prev,e))||mn(r,e)&&_t(r.prev,r,r.next)>0&&_t(e.prev,e,e.next)>0)}function _t(r,e,t){return(e.y-r.y)*(t.x-e.x)-(e.x-r.x)*(t.y-e.y)}function mn(r,e){return r.x===e.x&&r.y===e.y}function yh(r,e,t,i){var n=xn(_t(r,e,t)),s=xn(_t(r,e,i)),o=xn(_t(t,i,r)),a=xn(_t(t,i,e));return!!(n!==s&&o!==a||n===0&&yn(r,t,e)||s===0&&yn(r,i,e)||o===0&&yn(t,r,i)||a===0&&yn(t,e,i))}function yn(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 xn(r){return r>0?1:r<0?-1:0}function Gc(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&&yh(t,t.next,r,e))return!0;t=t.next}while(t!==r);return!1}function Sr(r,e){return _t(r.prev,r,r.next)<0?_t(r,e,r.next)>=0&&_t(r,r.prev,e)>=0:_t(r,e,r.prev)<0||_t(r,r.next,e)<0}function Uc(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 xh(r,e){var t=new Ms(r.i,r.x,r.y),i=new Ms(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 bh(r,e,t,i){var n=new Ms(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 Pr(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 Ms(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}_n.deviation=function(r,e,t,i){var n=e&&e.length,s=n?e[0]*t:r.length,o=Math.abs(Ns(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(Ns(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 Ns(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}_n.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 Ds={exports:{}};(function(r,e){(function(t){var i=e&&!e.nodeType&&e,n=r&&!r.nodeType&&r,s=typeof ws=="object"&&ws;(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="-",g=/^xn--/,_=/[^\x20-\x7E]/,m=/[\x2E\u3002\uFF0E\uFF61]/g,y={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},b=h-u,x=Math.floor,T=String.fromCharCode,w;function S(N){throw RangeError(y[N])}function E(N,C){for(var U=N.length,$=[];U--;)$[U]=C(N[U]);return $}function P(N,C){var U=N.split("@"),$="";U.length>1&&($=U[0]+"@",N=U[1]),N=N.replace(m,".");var j=N.split("."),it=E(j,C).join(".");return $+it}function O(N){for(var C=[],U=0,$=N.length,j,it;U<$;)j=N.charCodeAt(U++),j>=55296&&j<=56319&&U<$?(it=N.charCodeAt(U++),(it&64512)==56320?C.push(((j&1023)<<10)+(it&1023)+65536):(C.push(j),U--)):C.push(j);return C}function M(N){return E(N,function(C){var U="";return C>65535&&(C-=65536,U+=T(C>>>10&1023|55296),C=56320|C&1023),U+=T(C),U}).join("")}function L(N){return N-48<10?N-22:N-65<26?N-65:N-97<26?N-97:h}function B(N,C){return N+22+75*(N<26)-((C!=0)<<5)}function A(N,C,U){var $=0;for(N=U?x(N/c):N>>1,N+=x(N/C);N>b*l>>1;$+=h)N=x(N/b);return x($+(b+1)*N/(N+f))}function I(N){var C=[],U=N.length,$,j=0,it=v,vt=d,ft,It,Lt,xt,rt,ct,at,J,kt;for(ft=N.lastIndexOf(p),ft<0&&(ft=0),It=0;It<ft;++It)N.charCodeAt(It)>=128&&S("not-basic"),C.push(N.charCodeAt(It));for(Lt=ft>0?ft+1:0;Lt<U;){for(xt=j,rt=1,ct=h;Lt>=U&&S("invalid-input"),at=L(N.charCodeAt(Lt++)),(at>=h||at>x((a-j)/rt))&&S("overflow"),j+=at*rt,J=ct<=vt?u:ct>=vt+l?l:ct-vt,!(at<J);ct+=h)kt=h-J,rt>x(a/kt)&&S("overflow"),rt*=kt;$=C.length+1,vt=A(j-xt,$,xt==0),x(j/$)>a-it&&S("overflow"),it+=x(j/$),j%=$,C.splice(j++,0,it)}return M(C)}function F(N){var C,U,$,j,it,vt,ft,It,Lt,xt,rt,ct=[],at,J,kt,qt;for(N=O(N),at=N.length,C=v,U=0,it=d,vt=0;vt<at;++vt)rt=N[vt],rt<128&&ct.push(T(rt));for($=j=ct.length,j&&ct.push(p);$<at;){for(ft=a,vt=0;vt<at;++vt)rt=N[vt],rt>=C&&rt<ft&&(ft=rt);for(J=$+1,ft-C>x((a-U)/J)&&S("overflow"),U+=(ft-C)*J,C=ft,vt=0;vt<at;++vt)if(rt=N[vt],rt<C&&++U>a&&S("overflow"),rt==C){for(It=U,Lt=h;xt=Lt<=it?u:Lt>=it+l?l:Lt-it,!(It<xt);Lt+=h)qt=It-xt,kt=h-xt,ct.push(T(B(xt+qt%kt,0))),It=x(qt/kt);ct.push(T(B(It,0))),it=A(U,J,$==j),U=0,++$}++U,++C}return ct.join("")}function Y(N){return P(N,function(C){return g.test(C)?I(C.slice(4).toLowerCase()):C})}function z(N){return P(N,function(C){return _.test(C)?"xn--"+F(C):C})}if(o={version:"1.3.2",ucs2:{decode:O,encode:M},decode:I,encode:F,toASCII:z,toUnicode:Y},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})(ws)})(Ds,Ds.exports);var kc={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}},Rr={};function Xc(r,e){return Object.prototype.hasOwnProperty.call(r,e)}var Hc=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),Xc(n,d)?Array.isArray(n[d])?n[d].push(v):n[d]=[n[d],v]:n[d]=v}return n},Cr=function(r){switch(typeof r){case"string":return r;case"boolean":return r?"true":"false";case"number":return isFinite(r)?r:"";default:return""}},Wc=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(Cr(n))+t;return Array.isArray(r[n])?r[n].map(function(o){return s+encodeURIComponent(Cr(o))}).join(e):s+encodeURIComponent(Cr(r[n]))}).join(e):i?encodeURIComponent(Cr(i))+t+encodeURIComponent(Cr(r)):""};Rr.decode=Rr.parse=Hc,Rr.encode=Rr.stringify=Wc;var zc=Ds.exports,Ue=kc,Yc=bn,Vc=rd,jc=id;function we(){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 Zc=/^([a-z0-9.+-]+:)/i,qc=/:[0-9]*$/,Kc=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,$c=["<",">",'"',"`"," ","\r",`
|
|
6
6
|
`," "],Jc=["{","}","|","\\","^","`"].concat($c),Fs=["'"].concat(Jc),Th=["%","/","?",";","#"].concat(Fs),wh=["/","?","#"],Qc=255,Eh=/^[+a-z0-9A-Z_-]{0,63}$/,td=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,ed={javascript:!0,"javascript:":!0},Ls={javascript:!0,"javascript:":!0},Ki={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},Bs=Rr;function bn(r,e,t){if(r&&Ue.isObject(r)&&r instanceof we)return r;var i=new we;return i.parse(r,e,t),i}we.prototype.parse=function(r,e,t){if(!Ue.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=Kc.exec(a);if(h)return this.path=a,this.href=a,this.pathname=h[1],h[2]?(this.search=h[2],e?this.query=Bs.parse(this.search.substr(1)):this.query=this.search.substr(1)):e&&(this.search="",this.query={}),this}var u=Zc.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&&Ls[u])&&(a=a.substr(2),this.slashes=!0)}if(!Ls[u]&&(f||u&&!Ki[u])){for(var c=-1,d=0;d<wh.length;d++){var v=a.indexOf(wh[d]);v!==-1&&(c===-1||v<c)&&(c=v)}var p,g;c===-1?g=a.lastIndexOf("@"):g=a.lastIndexOf("@",c),g!==-1&&(p=a.slice(0,g),a=a.slice(g+1),this.auth=decodeURIComponent(p)),c=-1;for(var d=0;d<Th.length;d++){var v=a.indexOf(Th[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 _=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!_)for(var m=this.hostname.split(/\./),d=0,y=m.length;d<y;d++){var b=m[d];if(b&&!b.match(Eh)){for(var x="",T=0,w=b.length;T<w;T++)b.charCodeAt(T)>127?x+="x":x+=b[T];if(!x.match(Eh)){var S=m.slice(0,d),E=m.slice(d+1),P=b.match(td);P&&(S.push(P[1]),E.unshift(P[2])),E.length&&(a="/"+E.join(".")+a),this.hostname=S.join(".");break}}}this.hostname.length>Qc?this.hostname="":this.hostname=this.hostname.toLowerCase(),_||(this.hostname=zc.toASCII(this.hostname));var O=this.port?":"+this.port:"",M=this.hostname||"";this.host=M+O,this.href+=this.host,_&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),a[0]!=="/"&&(a="/"+a))}if(!ed[l])for(var d=0,y=Fs.length;d<y;d++){var L=Fs[d];if(a.indexOf(L)!==-1){var B=encodeURIComponent(L);B===L&&(B=escape(L)),a=a.split(L).join(B)}}var A=a.indexOf("#");A!==-1&&(this.hash=a.substr(A),a=a.slice(0,A));var I=a.indexOf("?");if(I!==-1?(this.search=a.substr(I),this.query=a.substr(I+1),e&&(this.query=Bs.parse(this.query)),a=a.slice(0,I)):e&&(this.search="",this.query={}),a&&(this.pathname=a),Ki[l]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var O=this.pathname||"",F=this.search||"";this.path=O+F}return this.href=this.format(),this};function id(r){return Ue.isString(r)&&(r=bn(r)),r instanceof we?r.format():we.prototype.format.call(r)}we.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&&Ue.isObject(this.query)&&Object.keys(this.query).length&&(s=Bs.stringify(this.query));var o=this.search||s&&"?"+s||"";return e&&e.substr(-1)!==":"&&(e+=":"),this.slashes||(!e||Ki[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 rd(r,e){return bn(r,!1,!0).resolve(e)}we.prototype.resolve=function(r){return this.resolveObject(bn(r,!1,!0)).format()},we.prototype.resolveObject=function(r){if(Ue.isString(r)){var e=new we;e.parse(r,!1,!0),r=e}for(var t=new we,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 Ki[t.protocol]&&t.hostname&&!t.pathname&&(t.path=t.pathname="/"),t.href=t.format(),t}if(r.protocol&&r.protocol!==t.protocol){if(!Ki[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&&!Ls[r.protocol]){for(var y=(r.pathname||"").split("/");y.length&&!(r.host=y.shift()););r.host||(r.host=""),r.hostname||(r.hostname=""),y[0]!==""&&y.unshift(""),y.length<2&&y.unshift(""),t.pathname=y.join("/")}else t.pathname=r.pathname;if(t.search=r.search,t.query=r.query,t.host=r.host||"",t.auth=r.auth,t.hostname=r.hostname||r.host,t.port=r.port,t.pathname||t.search){var c=t.pathname||"",d=t.search||"";t.path=c+d}return t.slashes=t.slashes||r.slashes,t.href=t.format(),t}var v=t.pathname&&t.pathname.charAt(0)==="/",p=r.host||r.pathname&&r.pathname.charAt(0)==="/",g=p||v||t.host&&r.pathname,_=g,m=t.pathname&&t.pathname.split("/")||[],y=r.pathname&&r.pathname.split("/")||[],b=t.protocol&&!Ki[t.protocol];if(b&&(t.hostname="",t.port=null,t.host&&(m[0]===""?m[0]=t.host:m.unshift(t.host)),t.host="",r.protocol&&(r.hostname=null,r.port=null,r.host&&(y[0]===""?y[0]=r.host:y.unshift(r.host)),r.host=null),g=g&&(y[0]===""||m[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,m=y;else if(y.length)m||(m=[]),m.pop(),m=m.concat(y),t.search=r.search,t.query=r.query;else if(!Ue.isNullOrUndefined(r.search)){if(b){t.hostname=t.host=m.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,(!Ue.isNull(t.pathname)||!Ue.isNull(t.search))&&(t.path=(t.pathname?t.pathname:"")+(t.search?t.search:"")),t.href=t.format(),t}if(!m.length)return t.pathname=null,t.search?t.path="/"+t.search:t.path=null,t.href=t.format(),t;for(var T=m.slice(-1)[0],w=(t.host||r.host||m.length>1)&&(T==="."||T==="..")||T==="",S=0,E=m.length;E>=0;E--)T=m[E],T==="."?m.splice(E,1):T===".."?(m.splice(E,1),S++):S&&(m.splice(E,1),S--);if(!g&&!_)for(;S--;S)m.unshift("..");g&&m[0]!==""&&(!m[0]||m[0].charAt(0)!=="/")&&m.unshift(""),w&&m.join("/").substr(-1)!=="/"&&m.push("");var P=m[0]===""||m[0]&&m[0].charAt(0)==="/";if(b){t.hostname=t.host=P?"":m.length?m.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 g=g||t.host&&m.length,g&&!P&&m.unshift(""),m.length?t.pathname=m.join("/"):(t.pathname=null,t.path=null),(!Ue.isNull(t.pathname)||!Ue.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},we.prototype.parseHost=function(){var r=this.host,e=qc.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 $i={parse:Yc,format:jc,resolve:Vc};G.RETINA_PREFIX=/@([0-9\.]+)x/,G.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var Gs=!1,Sh="6.5.8";function nd(){Gs=!0}function sd(r){var e;if(!Gs){if(G.ADAPTER.getNavigator().userAgent.toLowerCase().indexOf("chrome")>-1){var t=[`
|
|
7
7
|
%c %c %c PixiJS `+Sh+" - ✰ "+r+` ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥
|
|
8
8
|
|
|
9
|
-
`,"background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];(e=globalThis.console).log.apply(e,t)}else globalThis.console&&globalThis.console.log("PixiJS "+Sh+" - "+r+" - http://www.pixijs.com/");Gs=!0}}var Us;function od(){return typeof Us>"u"&&(Us=function(){var e={stencil:!0,failIfMajorPerformanceCaveat:G.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!G.ADAPTER.getWebGLRenderingContext())return!1;var t=G.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}}()),Us}var ad="#f0f8ff",hd="#faebd7",ud="#00ffff",ld="#7fffd4",fd="#f0ffff",cd="#f5f5dc",dd="#ffe4c4",pd="#000000",vd="#ffebcd",gd="#0000ff",_d="#8a2be2",md="#a52a2a",yd="#deb887",xd="#5f9ea0",bd="#7fff00",Td="#d2691e",wd="#ff7f50",Ed="#6495ed",Sd="#fff8dc",Pd="#dc143c",Rd="#00ffff",Cd="#00008b",Od="#008b8b",Ad="#b8860b",Id="#a9a9a9",Md="#006400",Nd="#a9a9a9",Dd="#bdb76b",Fd="#8b008b",Ld="#556b2f",Bd="#ff8c00",Gd="#9932cc",Ud="#8b0000",kd="#e9967a",Xd="#8fbc8f",Hd="#483d8b",Wd="#2f4f4f",zd="#2f4f4f",Yd="#00ced1",Vd="#9400d3",jd="#ff1493",Zd="#00bfff",qd="#696969",Kd="#696969",$d="#1e90ff",Jd="#b22222",Qd="#fffaf0",tp="#228b22",ep="#ff00ff",ip="#dcdcdc",rp="#f8f8ff",np="#daa520",sp="#ffd700",op="#808080",ap="#008000",hp="#adff2f",up="#808080",lp="#f0fff0",fp="#ff69b4",cp="#cd5c5c",dp="#4b0082",pp="#fffff0",vp="#f0e68c",gp="#fff0f5",_p="#e6e6fa",mp="#7cfc00",yp="#fffacd",xp="#add8e6",bp="#f08080",Tp="#e0ffff",wp="#fafad2",Ep="#d3d3d3",Sp="#90ee90",Pp="#d3d3d3",Rp="#ffb6c1",Cp="#ffa07a",Op="#20b2aa",Ap="#87cefa",Ip="#778899",Mp="#778899",Np="#b0c4de",Dp="#ffffe0",Fp="#00ff00",Lp="#32cd32",Bp="#faf0e6",Gp="#ff00ff",Up="#800000",kp="#66cdaa",Xp="#0000cd",Hp="#ba55d3",Wp="#9370db",zp="#3cb371",Yp="#7b68ee",Vp="#00fa9a",jp="#48d1cc",Zp="#c71585",qp="#191970",Kp="#f5fffa",$p="#ffe4e1",Jp="#ffe4b5",Qp="#ffdead",tv="#000080",ev="#fdf5e6",iv="#808000",rv="#6b8e23",nv="#ffa500",sv="#ff4500",ov="#da70d6",av="#eee8aa",hv="#98fb98",uv="#afeeee",lv="#db7093",fv="#ffefd5",cv="#ffdab9",dv="#cd853f",pv="#ffc0cb",vv="#dda0dd",gv="#b0e0e6",_v="#800080",mv="#663399",yv="#ff0000",xv="#bc8f8f",bv="#4169e1",Tv="#8b4513",wv="#fa8072",Ev="#f4a460",Sv="#2e8b57",Pv="#fff5ee",Rv="#a0522d",Cv="#c0c0c0",Ov="#87ceeb",Av="#6a5acd",Iv="#708090",Mv="#708090",Nv="#fffafa",Dv="#00ff7f",Fv="#4682b4",Lv="#d2b48c",Bv="#008080",Gv="#d8bfd8",Uv="#ff6347",kv="#40e0d0",Xv="#ee82ee",Hv="#f5deb3",Wv="#ffffff",zv="#f5f5f5",Yv="#ffff00",Vv="#9acd32",jv={aliceblue:ad,antiquewhite:hd,aqua:ud,aquamarine:ld,azure:fd,beige:cd,bisque:dd,black:pd,blanchedalmond:vd,blue:gd,blueviolet:_d,brown:md,burlywood:yd,cadetblue:xd,chartreuse:bd,chocolate:Td,coral:wd,cornflowerblue:Ed,cornsilk:Sd,crimson:Pd,cyan:Rd,darkblue:Cd,darkcyan:Od,darkgoldenrod:Ad,darkgray:Id,darkgreen:Md,darkgrey:Nd,darkkhaki:Dd,darkmagenta:Fd,darkolivegreen:Ld,darkorange:Bd,darkorchid:Gd,darkred:Ud,darksalmon:kd,darkseagreen:Xd,darkslateblue:Hd,darkslategray:Wd,darkslategrey:zd,darkturquoise:Yd,darkviolet:Vd,deeppink:jd,deepskyblue:Zd,dimgray:qd,dimgrey:Kd,dodgerblue:$d,firebrick:Jd,floralwhite:Qd,forestgreen:tp,fuchsia:ep,gainsboro:ip,ghostwhite:rp,goldenrod:np,gold:sp,gray:op,green:ap,greenyellow:hp,grey:up,honeydew:lp,hotpink:fp,indianred:cp,indigo:dp,ivory:pp,khaki:vp,lavenderblush:gp,lavender:_p,lawngreen:mp,lemonchiffon:yp,lightblue:xp,lightcoral:bp,lightcyan:Tp,lightgoldenrodyellow:wp,lightgray:Ep,lightgreen:Sp,lightgrey:Pp,lightpink:Rp,lightsalmon:Cp,lightseagreen:Op,lightskyblue:Ap,lightslategray:Ip,lightslategrey:Mp,lightsteelblue:Np,lightyellow:Dp,lime:Fp,limegreen:Lp,linen:Bp,magenta:Gp,maroon:Up,mediumaquamarine:kp,mediumblue:Xp,mediumorchid:Hp,mediumpurple:Wp,mediumseagreen:zp,mediumslateblue:Yp,mediumspringgreen:Vp,mediumturquoise:jp,mediumvioletred:Zp,midnightblue:qp,mintcream:Kp,mistyrose:$p,moccasin:Jp,navajowhite:Qp,navy:tv,oldlace:ev,olive:iv,olivedrab:rv,orange:nv,orangered:sv,orchid:ov,palegoldenrod:av,palegreen:hv,paleturquoise:uv,palevioletred:lv,papayawhip:fv,peachpuff:cv,peru:dv,pink:pv,plum:vv,powderblue:gv,purple:_v,rebeccapurple:mv,red:yv,rosybrown:xv,royalblue:bv,saddlebrown:Tv,salmon:wv,sandybrown:Ev,seagreen:Sv,seashell:Pv,sienna:Rv,silver:Cv,skyblue:Ov,slateblue:Av,slategray:Iv,slategrey:Mv,snow:Nv,springgreen:Dv,steelblue:Fv,tan:Lv,teal:Bv,thistle:Gv,tomato:Uv,turquoise:kv,violet:Xv,wheat:Hv,white:Wv,whitesmoke:zv,yellow:Yv,yellowgreen:Vv};function Ji(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 Ph(r){var e=r.toString(16);return e="000000".substring(0,6-e.length)+e,"#"+e}function Rh(r){return typeof r=="string"&&(r=jv[r.toLowerCase()]||r,r[0]==="#"&&(r=r.slice(1))),parseInt(r,16)}function Zv(){for(var r=[],e=[],t=0;t<32;t++)r[t]=t,e[t]=t;r[
|
|
9
|
+
`,"background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];(e=globalThis.console).log.apply(e,t)}else globalThis.console&&globalThis.console.log("PixiJS "+Sh+" - "+r+" - http://www.pixijs.com/");Gs=!0}}var Us;function od(){return typeof Us>"u"&&(Us=function(){var e={stencil:!0,failIfMajorPerformanceCaveat:G.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!G.ADAPTER.getWebGLRenderingContext())return!1;var t=G.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}}()),Us}var ad="#f0f8ff",hd="#faebd7",ud="#00ffff",ld="#7fffd4",fd="#f0ffff",cd="#f5f5dc",dd="#ffe4c4",pd="#000000",vd="#ffebcd",gd="#0000ff",_d="#8a2be2",md="#a52a2a",yd="#deb887",xd="#5f9ea0",bd="#7fff00",Td="#d2691e",wd="#ff7f50",Ed="#6495ed",Sd="#fff8dc",Pd="#dc143c",Rd="#00ffff",Cd="#00008b",Od="#008b8b",Ad="#b8860b",Id="#a9a9a9",Md="#006400",Nd="#a9a9a9",Dd="#bdb76b",Fd="#8b008b",Ld="#556b2f",Bd="#ff8c00",Gd="#9932cc",Ud="#8b0000",kd="#e9967a",Xd="#8fbc8f",Hd="#483d8b",Wd="#2f4f4f",zd="#2f4f4f",Yd="#00ced1",Vd="#9400d3",jd="#ff1493",Zd="#00bfff",qd="#696969",Kd="#696969",$d="#1e90ff",Jd="#b22222",Qd="#fffaf0",tp="#228b22",ep="#ff00ff",ip="#dcdcdc",rp="#f8f8ff",np="#daa520",sp="#ffd700",op="#808080",ap="#008000",hp="#adff2f",up="#808080",lp="#f0fff0",fp="#ff69b4",cp="#cd5c5c",dp="#4b0082",pp="#fffff0",vp="#f0e68c",gp="#fff0f5",_p="#e6e6fa",mp="#7cfc00",yp="#fffacd",xp="#add8e6",bp="#f08080",Tp="#e0ffff",wp="#fafad2",Ep="#d3d3d3",Sp="#90ee90",Pp="#d3d3d3",Rp="#ffb6c1",Cp="#ffa07a",Op="#20b2aa",Ap="#87cefa",Ip="#778899",Mp="#778899",Np="#b0c4de",Dp="#ffffe0",Fp="#00ff00",Lp="#32cd32",Bp="#faf0e6",Gp="#ff00ff",Up="#800000",kp="#66cdaa",Xp="#0000cd",Hp="#ba55d3",Wp="#9370db",zp="#3cb371",Yp="#7b68ee",Vp="#00fa9a",jp="#48d1cc",Zp="#c71585",qp="#191970",Kp="#f5fffa",$p="#ffe4e1",Jp="#ffe4b5",Qp="#ffdead",tv="#000080",ev="#fdf5e6",iv="#808000",rv="#6b8e23",nv="#ffa500",sv="#ff4500",ov="#da70d6",av="#eee8aa",hv="#98fb98",uv="#afeeee",lv="#db7093",fv="#ffefd5",cv="#ffdab9",dv="#cd853f",pv="#ffc0cb",vv="#dda0dd",gv="#b0e0e6",_v="#800080",mv="#663399",yv="#ff0000",xv="#bc8f8f",bv="#4169e1",Tv="#8b4513",wv="#fa8072",Ev="#f4a460",Sv="#2e8b57",Pv="#fff5ee",Rv="#a0522d",Cv="#c0c0c0",Ov="#87ceeb",Av="#6a5acd",Iv="#708090",Mv="#708090",Nv="#fffafa",Dv="#00ff7f",Fv="#4682b4",Lv="#d2b48c",Bv="#008080",Gv="#d8bfd8",Uv="#ff6347",kv="#40e0d0",Xv="#ee82ee",Hv="#f5deb3",Wv="#ffffff",zv="#f5f5f5",Yv="#ffff00",Vv="#9acd32",jv={aliceblue:ad,antiquewhite:hd,aqua:ud,aquamarine:ld,azure:fd,beige:cd,bisque:dd,black:pd,blanchedalmond:vd,blue:gd,blueviolet:_d,brown:md,burlywood:yd,cadetblue:xd,chartreuse:bd,chocolate:Td,coral:wd,cornflowerblue:Ed,cornsilk:Sd,crimson:Pd,cyan:Rd,darkblue:Cd,darkcyan:Od,darkgoldenrod:Ad,darkgray:Id,darkgreen:Md,darkgrey:Nd,darkkhaki:Dd,darkmagenta:Fd,darkolivegreen:Ld,darkorange:Bd,darkorchid:Gd,darkred:Ud,darksalmon:kd,darkseagreen:Xd,darkslateblue:Hd,darkslategray:Wd,darkslategrey:zd,darkturquoise:Yd,darkviolet:Vd,deeppink:jd,deepskyblue:Zd,dimgray:qd,dimgrey:Kd,dodgerblue:$d,firebrick:Jd,floralwhite:Qd,forestgreen:tp,fuchsia:ep,gainsboro:ip,ghostwhite:rp,goldenrod:np,gold:sp,gray:op,green:ap,greenyellow:hp,grey:up,honeydew:lp,hotpink:fp,indianred:cp,indigo:dp,ivory:pp,khaki:vp,lavenderblush:gp,lavender:_p,lawngreen:mp,lemonchiffon:yp,lightblue:xp,lightcoral:bp,lightcyan:Tp,lightgoldenrodyellow:wp,lightgray:Ep,lightgreen:Sp,lightgrey:Pp,lightpink:Rp,lightsalmon:Cp,lightseagreen:Op,lightskyblue:Ap,lightslategray:Ip,lightslategrey:Mp,lightsteelblue:Np,lightyellow:Dp,lime:Fp,limegreen:Lp,linen:Bp,magenta:Gp,maroon:Up,mediumaquamarine:kp,mediumblue:Xp,mediumorchid:Hp,mediumpurple:Wp,mediumseagreen:zp,mediumslateblue:Yp,mediumspringgreen:Vp,mediumturquoise:jp,mediumvioletred:Zp,midnightblue:qp,mintcream:Kp,mistyrose:$p,moccasin:Jp,navajowhite:Qp,navy:tv,oldlace:ev,olive:iv,olivedrab:rv,orange:nv,orangered:sv,orchid:ov,palegoldenrod:av,palegreen:hv,paleturquoise:uv,palevioletred:lv,papayawhip:fv,peachpuff:cv,peru:dv,pink:pv,plum:vv,powderblue:gv,purple:_v,rebeccapurple:mv,red:yv,rosybrown:xv,royalblue:bv,saddlebrown:Tv,salmon:wv,sandybrown:Ev,seagreen:Sv,seashell:Pv,sienna:Rv,silver:Cv,skyblue:Ov,slateblue:Av,slategray:Iv,slategrey:Mv,snow:Nv,springgreen:Dv,steelblue:Fv,tan:Lv,teal:Bv,thistle:Gv,tomato:Uv,turquoise:kv,violet:Xv,wheat:Hv,white:Wv,whitesmoke:zv,yellow:Yv,yellowgreen:Vv};function Ji(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 Ph(r){var e=r.toString(16);return e="000000".substring(0,6-e.length)+e,"#"+e}function Rh(r){return typeof r=="string"&&(r=jv[r.toLowerCase()]||r,r[0]==="#"&&(r=r.slice(1))),parseInt(r,16)}function Zv(){for(var r=[],e=[],t=0;t<32;t++)r[t]=t,e[t]=t;r[W.NORMAL_NPM]=W.NORMAL,r[W.ADD_NPM]=W.ADD,r[W.SCREEN_NPM]=W.SCREEN,e[W.NORMAL]=W.NORMAL_NPM,e[W.ADD]=W.ADD_NPM,e[W.SCREEN]=W.SCREEN_NPM;var i=[];return i.push(e),i.push(r),i}var Ch=Zv();function Oh(r,e){return Ch[e?1:0][r]}function qv(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 ks(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 Ah(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 Kv(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 Ih(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 Tn(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 Mh(r){return!(r&r-1)&&!!r}function Nh(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 tr(r){return r===0?0:r<0?-1:1}var $v=0;function Ci(){return++$v}var Dh={};function Ee(r,e,t){if(t===void 0&&(t=3),!Dh[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+`
|
|
@@ -272,7 +272,7 @@ void main(void){
|
|
|
272
272
|
}
|
|
273
273
|
`,Xg=0,In={},Fr=function(){function r(e,t,i){i===void 0&&(i="pixi-shader"),this.id=Xg++,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,"-"),In[i]?(In[i]++,i+="-"+In[i]):In[i]=1,this.vertexSrc="#define SHADER_NAME "+i+`
|
|
274
274
|
`+this.vertexSrc,this.fragmentSrc="#define SHADER_NAME "+i+`
|
|
275
|
-
`+this.fragmentSrc,this.vertexSrc=Qh(this.vertexSrc,G.PRECISION_VERTEX,ie.HIGH),this.fragmentSrc=Qh(this.fragmentSrc,G.PRECISION_FRAGMENT,Ag())),this.glPrograms={},this.syncUniforms=null}return Object.defineProperty(r,"defaultVertexSrc",{get:function(){return kg},enumerable:!1,configurable:!0}),Object.defineProperty(r,"defaultFragmentSrc",{get:function(){return Ug},enumerable:!1,configurable:!0}),r.from=function(e,t,i){var n=e+t,s=Fh[n];return s||(Fh[n]=s=new r(e,t,i)),s},r}(),ai=function(){function r(e,t){this.uniformBindCount=0,this.program=e,t?t instanceof Ii?this.uniformGroup=t:this.uniformGroup=new Ii(t):this.uniformGroup=new Ii({}),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=Fr.from(e,t);return new r(n,i)},r}(),$s=0,Js=1,Qs=2,to=3,eo=4,io=5,Mi=function(){function r(){this.data=0,this.blendMode=
|
|
275
|
+
`+this.fragmentSrc,this.vertexSrc=Qh(this.vertexSrc,G.PRECISION_VERTEX,ie.HIGH),this.fragmentSrc=Qh(this.fragmentSrc,G.PRECISION_FRAGMENT,Ag())),this.glPrograms={},this.syncUniforms=null}return Object.defineProperty(r,"defaultVertexSrc",{get:function(){return kg},enumerable:!1,configurable:!0}),Object.defineProperty(r,"defaultFragmentSrc",{get:function(){return Ug},enumerable:!1,configurable:!0}),r.from=function(e,t,i){var n=e+t,s=Fh[n];return s||(Fh[n]=s=new r(e,t,i)),s},r}(),ai=function(){function r(e,t){this.uniformBindCount=0,this.program=e,t?t instanceof Ii?this.uniformGroup=t:this.uniformGroup=new Ii(t):this.uniformGroup=new Ii({}),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=Fr.from(e,t);return new r(n,i)},r}(),$s=0,Js=1,Qs=2,to=3,eo=4,io=5,Mi=function(){function r(){this.data=0,this.blendMode=W.NORMAL,this.polygonOffset=0,this.blend=!0,this.depthMask=!0}return Object.defineProperty(r.prototype,"blend",{get:function(){return!!(this.data&1<<$s)},set:function(e){!!(this.data&1<<$s)!==e&&(this.data^=1<<$s)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"offsets",{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,"culling",{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,"depthTest",{get:function(){return!!(this.data&1<<to)},set:function(e){!!(this.data&1<<to)!==e&&(this.data^=1<<to)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"depthMask",{get:function(){return!!(this.data&1<<io)},set:function(e){!!(this.data&1<<io)!==e&&(this.data^=1<<io)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"clockwiseFrontFace",{get:function(){return!!(this.data&1<<eo)},set:function(e){!!(this.data&1<<eo)!==e&&(this.data^=1<<eo)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"blendMode",{get:function(){return this._blendMode},set:function(e){this.blend=e!==W.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}(),Hg=`varying vec2 vTextureCoord;
|
|
276
276
|
|
|
277
277
|
uniform sampler2D uSampler;
|
|
278
278
|
|
|
@@ -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 r_=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 n_(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=iu(e,s.type),a={type:o,name:s.name,size:tu(o),location:e.getAttribLocation(r,s.name)};t[s.name]=a}}return t}function s_(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=iu(e,s.type);t[o]={name:o,index:n,type:h,size:s.size,isArray:a,value:$h(h,s.size)}}return t}function o_(r,e){var t=qh(r,r.VERTEX_SHADER,e.vertexSrc),i=qh(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)||Cg(r,n,t,i),e.attributeData=n_(n,r),e.uniformData=s_(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:$h(h.type,h.size)}}var u=new r_(n,a);return u}var a_=0,Mn={textureCount:0,uboCount:0},h_=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=a_++}return r.prototype.systemCheck=function(){if(!Gg())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||(Mn.textureCount=0,Mn.uboCount=0,this.syncUniformGroup(e.uniformGroup,Mn)),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]=Dg(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,Mn,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]=i_(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=o_(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 u_(r,e){return e===void 0&&(e=[]),e[H.NORMAL]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[H.ADD]=[r.ONE,r.ONE],e[H.MULTIPLY]=[r.DST_COLOR,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA],e[H.SCREEN]=[r.ONE,r.ONE_MINUS_SRC_COLOR,r.ONE,r.ONE_MINUS_SRC_ALPHA],e[H.OVERLAY]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[H.DARKEN]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[H.LIGHTEN]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[H.COLOR_DODGE]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[H.COLOR_BURN]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[H.HARD_LIGHT]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[H.SOFT_LIGHT]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[H.DIFFERENCE]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[H.EXCLUSION]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[H.HUE]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[H.SATURATION]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[H.COLOR]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[H.LUMINOSITY]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[H.NONE]=[0,0],e[H.NORMAL_NPM]=[r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA],e[H.ADD_NPM]=[r.SRC_ALPHA,r.ONE,r.ONE,r.ONE],e[H.SCREEN_NPM]=[r.SRC_ALPHA,r.ONE_MINUS_SRC_COLOR,r.ONE,r.ONE_MINUS_SRC_ALPHA],e[H.SRC_IN]=[r.DST_ALPHA,r.ZERO],e[H.SRC_OUT]=[r.ONE_MINUS_DST_ALPHA,r.ZERO],e[H.SRC_ATOP]=[r.DST_ALPHA,r.ONE_MINUS_SRC_ALPHA],e[H.DST_OVER]=[r.ONE_MINUS_DST_ALPHA,r.ONE],e[H.DST_IN]=[r.ZERO,r.SRC_ALPHA],e[H.DST_OUT]=[r.ZERO,r.ONE_MINUS_SRC_ALPHA],e[H.DST_ATOP]=[r.ONE_MINUS_DST_ALPHA,r.SRC_ALPHA],e[H.XOR]=[r.ONE_MINUS_DST_ALPHA,r.ONE_MINUS_SRC_ALPHA],e[H.SUBTRACT]=[r.ONE,r.ONE,r.ONE,r.ONE,r.FUNC_REVERSE_SUBTRACT,r.FUNC_ADD],e}var l_=0,f_=1,c_=2,d_=3,p_=4,v_=5,g_=function(){function r(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode=H.NONE,this._blendEq=!1,this.map=[],this.map[l_]=this.setBlend,this.map[f_]=this.setOffset,this.map[c_]=this.setCullFace,this.map[d_]=this.setDepthTest,this.map[p_]=this.setFrontFace,this.map[v_]=this.setDepthMask,this.checks=[],this.defaultState=new Mi,this.defaultState.blend=!0}return r.prototype.contextChange=function(e){this.gl=e,this.blendModes=u_(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}(),__=function(){function r(e){this.renderer=e,this.count=0,this.checkCount=0,this.maxIdle=G.GC_MAX_IDLE,this.checkCountMax=G.GC_MAX_CHECK_COUNT,this.mode=G.GC_MODE}return r.prototype.postrender=function(){this.renderer.renderingToScreen&&(this.count++,this.mode!==pn.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 m_(r){var e,t,i,n,s,o,a,h,u,l,f,c,d,v,p,g,_,m,y,b,x,T,w;return"WebGL2RenderingContext"in globalThis&&r instanceof globalThis.WebGL2RenderingContext?w=(e={},e[X.UNSIGNED_BYTE]=(t={},t[D.RGBA]=r.RGBA8,t[D.RGB]=r.RGB8,t[D.RG]=r.RG8,t[D.RED]=r.R8,t[D.RGBA_INTEGER]=r.RGBA8UI,t[D.RGB_INTEGER]=r.RGB8UI,t[D.RG_INTEGER]=r.RG8UI,t[D.RED_INTEGER]=r.R8UI,t[D.ALPHA]=r.ALPHA,t[D.LUMINANCE]=r.LUMINANCE,t[D.LUMINANCE_ALPHA]=r.LUMINANCE_ALPHA,t),e[X.BYTE]=(i={},i[D.RGBA]=r.RGBA8_SNORM,i[D.RGB]=r.RGB8_SNORM,i[D.RG]=r.RG8_SNORM,i[D.RED]=r.R8_SNORM,i[D.RGBA_INTEGER]=r.RGBA8I,i[D.RGB_INTEGER]=r.RGB8I,i[D.RG_INTEGER]=r.RG8I,i[D.RED_INTEGER]=r.R8I,i),e[X.UNSIGNED_SHORT]=(n={},n[D.RGBA_INTEGER]=r.RGBA16UI,n[D.RGB_INTEGER]=r.RGB16UI,n[D.RG_INTEGER]=r.RG16UI,n[D.RED_INTEGER]=r.R16UI,n[D.DEPTH_COMPONENT]=r.DEPTH_COMPONENT16,n),e[X.SHORT]=(s={},s[D.RGBA_INTEGER]=r.RGBA16I,s[D.RGB_INTEGER]=r.RGB16I,s[D.RG_INTEGER]=r.RG16I,s[D.RED_INTEGER]=r.R16I,s),e[X.UNSIGNED_INT]=(o={},o[D.RGBA_INTEGER]=r.RGBA32UI,o[D.RGB_INTEGER]=r.RGB32UI,o[D.RG_INTEGER]=r.RG32UI,o[D.RED_INTEGER]=r.R32UI,o[D.DEPTH_COMPONENT]=r.DEPTH_COMPONENT24,o),e[X.INT]=(a={},a[D.RGBA_INTEGER]=r.RGBA32I,a[D.RGB_INTEGER]=r.RGB32I,a[D.RG_INTEGER]=r.RG32I,a[D.RED_INTEGER]=r.R32I,a),e[X.FLOAT]=(h={},h[D.RGBA]=r.RGBA32F,h[D.RGB]=r.RGB32F,h[D.RG]=r.RG32F,h[D.RED]=r.R32F,h[D.DEPTH_COMPONENT]=r.DEPTH_COMPONENT32F,h),e[X.HALF_FLOAT]=(u={},u[D.RGBA]=r.RGBA16F,u[D.RGB]=r.RGB16F,u[D.RG]=r.RG16F,u[D.RED]=r.R16F,u),e[X.UNSIGNED_SHORT_5_6_5]=(l={},l[D.RGB]=r.RGB565,l),e[X.UNSIGNED_SHORT_4_4_4_4]=(f={},f[D.RGBA]=r.RGBA4,f),e[X.UNSIGNED_SHORT_5_5_5_1]=(c={},c[D.RGBA]=r.RGB5_A1,c),e[X.UNSIGNED_INT_2_10_10_10_REV]=(d={},d[D.RGBA]=r.RGB10_A2,d[D.RGBA_INTEGER]=r.RGB10_A2UI,d),e[X.UNSIGNED_INT_10F_11F_11F_REV]=(v={},v[D.RGB]=r.R11F_G11F_B10F,v),e[X.UNSIGNED_INT_5_9_9_9_REV]=(p={},p[D.RGB]=r.RGB9_E5,p),e[X.UNSIGNED_INT_24_8]=(g={},g[D.DEPTH_STENCIL]=r.DEPTH24_STENCIL8,g),e[X.FLOAT_32_UNSIGNED_INT_24_8_REV]=(_={},_[D.DEPTH_STENCIL]=r.DEPTH32F_STENCIL8,_),e):w=(m={},m[X.UNSIGNED_BYTE]=(y={},y[D.RGBA]=r.RGBA,y[D.RGB]=r.RGB,y[D.ALPHA]=r.ALPHA,y[D.LUMINANCE]=r.LUMINANCE,y[D.LUMINANCE_ALPHA]=r.LUMINANCE_ALPHA,y),m[X.UNSIGNED_SHORT_5_6_5]=(b={},b[D.RGB]=r.RGB,b),m[X.UNSIGNED_SHORT_4_4_4_4]=(x={},x[D.RGBA]=r.RGBA,x),m[X.UNSIGNED_SHORT_5_5_5_1]=(T={},T[D.RGBA]=r.RGBA,T),m),w}var no=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=X.UNSIGNED_BYTE,this.internalFormat=D.RGBA,this.samplerType=0}return r}(),y_=function(){function r(e){this.renderer=e,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new et,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=m_(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 no(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 no(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!==dn.FLOAT&&this.renderer.texture.unbind(a)}}},r.prototype.initTexture=function(e){var t=new no(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===X.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!==dn.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===xe.POW2||this.webGLVersion!==2)&&!e.isPowerOfTwo?t.mipmap=!1:t.mipmap=e.mipmap>=1,this.webGLVersion!==2&&!e.isPowerOfTwo?t.wrapMode=Le.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!==xe.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===Fe.LINEAR?i.LINEAR_MIPMAP_LINEAR:i.NEAREST_MIPMAP_NEAREST);var n=this.renderer.context.extensions.anisotropicFiltering;if(n&&e.anisotropicLevel>0&&e.scaleMode===Fe.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===Fe.LINEAR?i.LINEAR:i.NEAREST);i.texParameteri(e.target,i.TEXTURE_MAG_FILTER,e.scaleMode===Fe.LINEAR?i.LINEAR:i.NEAREST)},r.prototype.destroy=function(){this.renderer=null},r}(),so=new Mt,x_=function(r){pt(e,r);function e(t,i){t===void 0&&(t=Tr.UNKNOWN);var n=r.call(this)||this;return i=Object.assign({},G.RENDER_OPTIONS,i),n.options=i,n.type=t,n.screen=new K(0,0,i.width,i.height),n.view=i.view||G.ADAPTER.createCanvas(),n.resolution=i.resolution||G.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&&(Ee("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"&&(Ee("6.1.0","generateTexture options (scaleMode, resolution, region) are now object options."),i={scaleMode:i,resolution:n,region:s});var o=i.region,a=ig(i,["region"]);s=o||t.getLocalBounds(null,!0),s.width===0&&(s.width=1),s.height===0&&(s.height=1);var h=Ai.create(Vs({width:s.width,height:s.height},a));return so.tx=-s.x,so.ty=-s.y,this.render(t,{renderTexture:h,clear:!1,transform:so,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=Tr.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=Ph(t),Ji(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}(wr),b_=function(){function r(e){this.buffer=e||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}return r}(),T_=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 b_(n.createBuffer()),this.managedBuffers[e.id]=e,e.disposeRunner.add(this),e._glBuffers[i]},r}(),hu=function(r){pt(e,r);function e(t){var i=r.call(this,Tr.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 Ii({projectionMatrix:new Mt},!0),i.addSystem(jg,"mask").addSystem(Tg,"context").addSystem(g_,"state").addSystem(h_,"shader").addSystem(y_,"texture").addSystem(T_,"buffer").addSystem(Pg,"geometry").addSystem(Sg,"framebuffer").addSystem(Zg,"scissor").addSystem(qg,"stencil").addSystem(Kg,"projection").addSystem(__,"textureGC").addSystem(xg,"filter").addSystem($g,"renderTexture").addSystem(bg,"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,sd(i.context.webGLVersion===2?"WebGL 2":"WebGL 1"),i.resize(i.options.width,i.options.height),i}return e.create=function(t){if(od())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 Ai?(Ee("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 Ee("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){Ee("6.5.0","Renderer.registerPlugin() has been deprecated, please use extensions.add() instead."),Ze.add({name:t,type:ot.RendererPlugin,ref:i})},e.__plugins={},e}(x_);Ze.handleByMap(ot.RendererPlugin,hu.__plugins);function w_(r){return hu.create(r)}var E_=`attribute vec2 aVertexPosition;
|
|
419
|
+
`))}}var r_=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 n_(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=iu(e,s.type),a={type:o,name:s.name,size:tu(o),location:e.getAttribLocation(r,s.name)};t[s.name]=a}}return t}function s_(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=iu(e,s.type);t[o]={name:o,index:n,type:h,size:s.size,isArray:a,value:$h(h,s.size)}}return t}function o_(r,e){var t=qh(r,r.VERTEX_SHADER,e.vertexSrc),i=qh(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)||Cg(r,n,t,i),e.attributeData=n_(n,r),e.uniformData=s_(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:$h(h.type,h.size)}}var u=new r_(n,a);return u}var a_=0,Mn={textureCount:0,uboCount:0},h_=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=a_++}return r.prototype.systemCheck=function(){if(!Gg())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||(Mn.textureCount=0,Mn.uboCount=0,this.syncUniformGroup(e.uniformGroup,Mn)),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]=Dg(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,Mn,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]=i_(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=o_(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 u_(r,e){return e===void 0&&(e=[]),e[W.NORMAL]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[W.ADD]=[r.ONE,r.ONE],e[W.MULTIPLY]=[r.DST_COLOR,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA],e[W.SCREEN]=[r.ONE,r.ONE_MINUS_SRC_COLOR,r.ONE,r.ONE_MINUS_SRC_ALPHA],e[W.OVERLAY]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[W.DARKEN]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[W.LIGHTEN]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[W.COLOR_DODGE]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[W.COLOR_BURN]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[W.HARD_LIGHT]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[W.SOFT_LIGHT]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[W.DIFFERENCE]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[W.EXCLUSION]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[W.HUE]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[W.SATURATION]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[W.COLOR]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[W.LUMINOSITY]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],e[W.NONE]=[0,0],e[W.NORMAL_NPM]=[r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA],e[W.ADD_NPM]=[r.SRC_ALPHA,r.ONE,r.ONE,r.ONE],e[W.SCREEN_NPM]=[r.SRC_ALPHA,r.ONE_MINUS_SRC_COLOR,r.ONE,r.ONE_MINUS_SRC_ALPHA],e[W.SRC_IN]=[r.DST_ALPHA,r.ZERO],e[W.SRC_OUT]=[r.ONE_MINUS_DST_ALPHA,r.ZERO],e[W.SRC_ATOP]=[r.DST_ALPHA,r.ONE_MINUS_SRC_ALPHA],e[W.DST_OVER]=[r.ONE_MINUS_DST_ALPHA,r.ONE],e[W.DST_IN]=[r.ZERO,r.SRC_ALPHA],e[W.DST_OUT]=[r.ZERO,r.ONE_MINUS_SRC_ALPHA],e[W.DST_ATOP]=[r.ONE_MINUS_DST_ALPHA,r.SRC_ALPHA],e[W.XOR]=[r.ONE_MINUS_DST_ALPHA,r.ONE_MINUS_SRC_ALPHA],e[W.SUBTRACT]=[r.ONE,r.ONE,r.ONE,r.ONE,r.FUNC_REVERSE_SUBTRACT,r.FUNC_ADD],e}var l_=0,f_=1,c_=2,d_=3,p_=4,v_=5,g_=function(){function r(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode=W.NONE,this._blendEq=!1,this.map=[],this.map[l_]=this.setBlend,this.map[f_]=this.setOffset,this.map[c_]=this.setCullFace,this.map[d_]=this.setDepthTest,this.map[p_]=this.setFrontFace,this.map[v_]=this.setDepthMask,this.checks=[],this.defaultState=new Mi,this.defaultState.blend=!0}return r.prototype.contextChange=function(e){this.gl=e,this.blendModes=u_(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}(),__=function(){function r(e){this.renderer=e,this.count=0,this.checkCount=0,this.maxIdle=G.GC_MAX_IDLE,this.checkCountMax=G.GC_MAX_CHECK_COUNT,this.mode=G.GC_MODE}return r.prototype.postrender=function(){this.renderer.renderingToScreen&&(this.count++,this.mode!==pn.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 m_(r){var e,t,i,n,s,o,a,h,u,l,f,c,d,v,p,g,_,m,y,b,x,T,w;return"WebGL2RenderingContext"in globalThis&&r instanceof globalThis.WebGL2RenderingContext?w=(e={},e[X.UNSIGNED_BYTE]=(t={},t[D.RGBA]=r.RGBA8,t[D.RGB]=r.RGB8,t[D.RG]=r.RG8,t[D.RED]=r.R8,t[D.RGBA_INTEGER]=r.RGBA8UI,t[D.RGB_INTEGER]=r.RGB8UI,t[D.RG_INTEGER]=r.RG8UI,t[D.RED_INTEGER]=r.R8UI,t[D.ALPHA]=r.ALPHA,t[D.LUMINANCE]=r.LUMINANCE,t[D.LUMINANCE_ALPHA]=r.LUMINANCE_ALPHA,t),e[X.BYTE]=(i={},i[D.RGBA]=r.RGBA8_SNORM,i[D.RGB]=r.RGB8_SNORM,i[D.RG]=r.RG8_SNORM,i[D.RED]=r.R8_SNORM,i[D.RGBA_INTEGER]=r.RGBA8I,i[D.RGB_INTEGER]=r.RGB8I,i[D.RG_INTEGER]=r.RG8I,i[D.RED_INTEGER]=r.R8I,i),e[X.UNSIGNED_SHORT]=(n={},n[D.RGBA_INTEGER]=r.RGBA16UI,n[D.RGB_INTEGER]=r.RGB16UI,n[D.RG_INTEGER]=r.RG16UI,n[D.RED_INTEGER]=r.R16UI,n[D.DEPTH_COMPONENT]=r.DEPTH_COMPONENT16,n),e[X.SHORT]=(s={},s[D.RGBA_INTEGER]=r.RGBA16I,s[D.RGB_INTEGER]=r.RGB16I,s[D.RG_INTEGER]=r.RG16I,s[D.RED_INTEGER]=r.R16I,s),e[X.UNSIGNED_INT]=(o={},o[D.RGBA_INTEGER]=r.RGBA32UI,o[D.RGB_INTEGER]=r.RGB32UI,o[D.RG_INTEGER]=r.RG32UI,o[D.RED_INTEGER]=r.R32UI,o[D.DEPTH_COMPONENT]=r.DEPTH_COMPONENT24,o),e[X.INT]=(a={},a[D.RGBA_INTEGER]=r.RGBA32I,a[D.RGB_INTEGER]=r.RGB32I,a[D.RG_INTEGER]=r.RG32I,a[D.RED_INTEGER]=r.R32I,a),e[X.FLOAT]=(h={},h[D.RGBA]=r.RGBA32F,h[D.RGB]=r.RGB32F,h[D.RG]=r.RG32F,h[D.RED]=r.R32F,h[D.DEPTH_COMPONENT]=r.DEPTH_COMPONENT32F,h),e[X.HALF_FLOAT]=(u={},u[D.RGBA]=r.RGBA16F,u[D.RGB]=r.RGB16F,u[D.RG]=r.RG16F,u[D.RED]=r.R16F,u),e[X.UNSIGNED_SHORT_5_6_5]=(l={},l[D.RGB]=r.RGB565,l),e[X.UNSIGNED_SHORT_4_4_4_4]=(f={},f[D.RGBA]=r.RGBA4,f),e[X.UNSIGNED_SHORT_5_5_5_1]=(c={},c[D.RGBA]=r.RGB5_A1,c),e[X.UNSIGNED_INT_2_10_10_10_REV]=(d={},d[D.RGBA]=r.RGB10_A2,d[D.RGBA_INTEGER]=r.RGB10_A2UI,d),e[X.UNSIGNED_INT_10F_11F_11F_REV]=(v={},v[D.RGB]=r.R11F_G11F_B10F,v),e[X.UNSIGNED_INT_5_9_9_9_REV]=(p={},p[D.RGB]=r.RGB9_E5,p),e[X.UNSIGNED_INT_24_8]=(g={},g[D.DEPTH_STENCIL]=r.DEPTH24_STENCIL8,g),e[X.FLOAT_32_UNSIGNED_INT_24_8_REV]=(_={},_[D.DEPTH_STENCIL]=r.DEPTH32F_STENCIL8,_),e):w=(m={},m[X.UNSIGNED_BYTE]=(y={},y[D.RGBA]=r.RGBA,y[D.RGB]=r.RGB,y[D.ALPHA]=r.ALPHA,y[D.LUMINANCE]=r.LUMINANCE,y[D.LUMINANCE_ALPHA]=r.LUMINANCE_ALPHA,y),m[X.UNSIGNED_SHORT_5_6_5]=(b={},b[D.RGB]=r.RGB,b),m[X.UNSIGNED_SHORT_4_4_4_4]=(x={},x[D.RGBA]=r.RGBA,x),m[X.UNSIGNED_SHORT_5_5_5_1]=(T={},T[D.RGBA]=r.RGBA,T),m),w}var no=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=X.UNSIGNED_BYTE,this.internalFormat=D.RGBA,this.samplerType=0}return r}(),y_=function(){function r(e){this.renderer=e,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new et,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=m_(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 no(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 no(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!==dn.FLOAT&&this.renderer.texture.unbind(a)}}},r.prototype.initTexture=function(e){var t=new no(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===X.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!==dn.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===xe.POW2||this.webGLVersion!==2)&&!e.isPowerOfTwo?t.mipmap=!1:t.mipmap=e.mipmap>=1,this.webGLVersion!==2&&!e.isPowerOfTwo?t.wrapMode=Le.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!==xe.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===Fe.LINEAR?i.LINEAR_MIPMAP_LINEAR:i.NEAREST_MIPMAP_NEAREST);var n=this.renderer.context.extensions.anisotropicFiltering;if(n&&e.anisotropicLevel>0&&e.scaleMode===Fe.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===Fe.LINEAR?i.LINEAR:i.NEAREST);i.texParameteri(e.target,i.TEXTURE_MAG_FILTER,e.scaleMode===Fe.LINEAR?i.LINEAR:i.NEAREST)},r.prototype.destroy=function(){this.renderer=null},r}(),so=new Mt,x_=function(r){pt(e,r);function e(t,i){t===void 0&&(t=Tr.UNKNOWN);var n=r.call(this)||this;return i=Object.assign({},G.RENDER_OPTIONS,i),n.options=i,n.type=t,n.screen=new K(0,0,i.width,i.height),n.view=i.view||G.ADAPTER.createCanvas(),n.resolution=i.resolution||G.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&&(Ee("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"&&(Ee("6.1.0","generateTexture options (scaleMode, resolution, region) are now object options."),i={scaleMode:i,resolution:n,region:s});var o=i.region,a=ig(i,["region"]);s=o||t.getLocalBounds(null,!0),s.width===0&&(s.width=1),s.height===0&&(s.height=1);var h=Ai.create(Vs({width:s.width,height:s.height},a));return so.tx=-s.x,so.ty=-s.y,this.render(t,{renderTexture:h,clear:!1,transform:so,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=Tr.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=Ph(t),Ji(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}(wr),b_=function(){function r(e){this.buffer=e||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}return r}(),T_=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 b_(n.createBuffer()),this.managedBuffers[e.id]=e,e.disposeRunner.add(this),e._glBuffers[i]},r}(),hu=function(r){pt(e,r);function e(t){var i=r.call(this,Tr.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 Ii({projectionMatrix:new Mt},!0),i.addSystem(jg,"mask").addSystem(Tg,"context").addSystem(g_,"state").addSystem(h_,"shader").addSystem(y_,"texture").addSystem(T_,"buffer").addSystem(Pg,"geometry").addSystem(Sg,"framebuffer").addSystem(Zg,"scissor").addSystem(qg,"stencil").addSystem(Kg,"projection").addSystem(__,"textureGC").addSystem(xg,"filter").addSystem($g,"renderTexture").addSystem(bg,"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,sd(i.context.webGLVersion===2?"WebGL 2":"WebGL 1"),i.resize(i.options.width,i.options.height),i}return e.create=function(t){if(od())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 Ai?(Ee("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 Ee("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){Ee("6.5.0","Renderer.registerPlugin() has been deprecated, please use extensions.add() instead."),Ze.add({name:t,type:ot.RendererPlugin,ref:i})},e.__plugins={},e}(x_);Ze.handleByMap(ot.RendererPlugin,hu.__plugins);function w_(r){return hu.create(r)}var E_=`attribute vec2 aVertexPosition;
|
|
420
420
|
attribute vec2 aTextureCoord;
|
|
421
421
|
|
|
422
422
|
uniform mat3 projectionMatrix;
|
|
@@ -492,7 +492,7 @@ void main(void){
|
|
|
492
492
|
%forloop%
|
|
493
493
|
gl_FragColor = color * vColor;
|
|
494
494
|
}
|
|
495
|
-
`,O_=function(){function r(){}return r.create=function(e){var t=Object.assign({vertex:fu,fragment:cu,geometryClass:lu,vertexSize:6},e),i=t.vertex,n=t.fragment,s=t.vertexSize,o=t.geometryClass;return function(a){pt(h,a);function h(u){var l=a.call(this,u)||this;return l.shaderGenerator=new C_(i,n),l.geometryClass=o,l.vertexSize=s,l}return h}(R_)},Object.defineProperty(r,"defaultVertexSrc",{get:function(){return fu},enumerable:!1,configurable:!0}),Object.defineProperty(r,"defaultFragmentTemplate",{get:function(){return cu},enumerable:!1,configurable:!0}),r}(),du=O_.create();Object.assign(du,{extension:{name:"batch",type:ot.RendererPlugin}});var A_={accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:null,accessibleType:"button",accessiblePointerEvents:"auto",accessibleChildren:!0,renderId:-1};Rt.mixin(A_);var I_=9,Nn=100,M_=0,N_=0,pu=2,vu=1,D_=-1e3,F_=-1e3,L_=2,B_=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,(Ge.tablet||Ge.phone)&&this.createTouchHook();var t=document.createElement("div");t.style.width=Nn+"px",t.style.height=Nn+"px",t.style.position="absolute",t.style.top=M_+"px",t.style.left=N_+"px",t.style.zIndex=pu.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=vu+"px",t.style.height=vu+"px",t.style.position="absolute",t.style.top=D_+"px",t.style.left=F_+"px",t.style.zIndex=L_.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(!(Ge.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 g=p.hitArea,_=p.worldTransform;p.hitArea?(d.style.left=(_.tx+g.x*_.a)*f+"px",d.style.top=(_.ty+g.y*_.d)*c+"px",d.style.width=g.width*_.a*f+"px",d.style.height=g.height*_.d*c+"px"):(g=p.getBounds(),this.capHitArea(g),d.style.left=g.x*f+"px",d.style.top=g.y*c+"px",d.style.width=g.width*f+"px",d.style.height=g.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=Nn+"px",t.style.height=Nn+"px",t.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",t.style.position="absolute",t.style.zIndex=pu.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===I_&&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:[ot.RendererPlugin,ot.CanvasRendererPlugin]},r}();var gu=function(){function r(){this.pressure=0,this.rotationAngle=0,this.twist=0,this.tangentialPressure=0,this.global=new Z,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 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 G_(r,e){uo(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var U_=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}(),lo=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}(),k_=function(){function r(){this._tempPoint=new Z}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}(),X_={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};Rt.mixin(X_);var Dn=1,Fn={target:null,data:{global:null}},H_=function(r){G_(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 gu,n.mouse.identifier=Dn,n.mouse.global.set(-999999),n.activeInteractionData={},n.activeInteractionData[Dn]=n.mouse,n.interactionDataPool=[],n.eventData=new U_,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 k_,n._tempDisplayObject=new Bh,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 Fn.target=null,Fn.data.global=t,i||(i=this.lastObjectRendered),this.processInteractive(Fn,i,null,!0),Fn.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||(Gt.system.add(this.tickerUpdate,this,re.INTERACTION),this.tickerAdded=!0)},e.prototype.removeTickerListener=function(){this.tickerAdded&&(Gt.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 lo(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=lo.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 lo(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===Dn||t.pointerType==="mouse"?n=this.mouse:this.activeInteractionData[i]?n=this.activeInteractionData[i]:(n=this.interactionDataPool.pop()||new gu,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=Dn),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:[ot.RendererPlugin,ot.CanvasRendererPlugin]},e}(wr);var _u=new K,mu=4,W_=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 Ai?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=_u,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 Lh(h,u,1),f=new Uint8Array(mu*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 Lh(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 Ai?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=_u,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(mu*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:ot.RendererPlugin},r}();var Ln=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 yu(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 qe=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 Ln))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 yu(this,new Ln(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 yu(this,new Ln(e,!0,t))},r.prototype.detach=function(e){if(!(e instanceof Ln))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 xu(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 fo,Bn=null,z_=0,bu=200,Y_=204,V_=1223,j_=2;function Tu(){}function wu(r,e,t){e&&e.indexOf(".")===0&&(e=e.substring(1)),e&&(r[e]=t)}function co(r){return r.toString().replace("object ","")}var Et=function(){function r(e,t,i){if(this._dequeue=Tu,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=Tu,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 qe,this.onProgress=new qe,this.onComplete=new qe,this.onAfterMiddleware=new qe}return r.setExtensionLoadType=function(e,t){wu(r._loadTypeMap,e,t)},r.setExtensionXhrType=function(e,t){wu(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 fo>"u"&&(fo=!!(globalThis.XDomainRequest&&!("withCredentials"in new XMLHttpRequest))),fo&&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(co(e)+" Request failed. Status: "+e.status+', text: "'+e.statusText+'"')},r.prototype._xhrOnTimeout=function(){var e=this.xhr;this.abort(co(e)+" Request timed out.")},r.prototype._xhrOnAbort=function(){var e=this.xhr;this.abort(co(e)+" Request was aborted by the user.")},r.prototype._xhrOnLoad=function(){var e=this.xhr,t="",i=typeof e.status>"u"?bu:e.status;(e.responseType===""||e.responseType==="text"||typeof e.responseType>"u")&&(t=e.responseText),i===z_&&(t.length>0||e.responseType===r.XHR_RESPONSE_TYPE.BUFFER)?i=bu:i===V_&&(i=Y_);var n=i/100|0;if(n===j_)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,Bn||(Bn=document.createElement("a")),Bn.href=e;var i=xu(Bn.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 Di(){}function Z_(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 q_=function(){function r(e,t){this.data=e,this.callback=t}return r}(),po=function(){function r(e,t){var i=this;if(t===void 0&&(t=1),this.workers=0,this.saturated=Di,this.unsaturated=Di,this.empty=Di,this.drain=Di,this.error=Di,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 q_(n,typeof o=="function"?o:Di);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,Z_(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=Di,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}(),vo=100,K_=/(#[\w-]+)?$/,Gn=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=po.queue(this._boundLoadResource,t),this._queue.pause(),this.resources={},this.onProgress=new qe,this.onError=new qe,this.onLoad=new qe,this.onStart=new qe,this.onComplete=new qe;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(Ee("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=vo/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=xu(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=K_.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,po.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=vo,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(),po.eachSeries(this._afterMiddleware,function(i,n){i.call(t,e,n)},function(){e.onAfterMiddleware.dispatch(e),t.progress=Math.min(vo,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 Ee("6.5.0","Loader.registerPlugin() is deprecated, use extensions.add() instead."),Ze.add({type:ot.Loader,ref:e}),r},r._plugins=[],r}();Ze.handleByList(ot.Loader,Gn._plugins),Gn.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 $_=function(){function r(){}return r.init=function(e){e=Object.assign({sharedLoader:!1},e),this.loader=e.sharedLoader?Gn.shared:new Gn},r.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},r.extension=ot.Application,r}(),J_=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;V.fromLoader(i,n,s,o).then(function(a){e.texture=a,t()}).catch(t)}else t()},r.extension=ot.Loader,r}(),Q_="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function tm(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+=Q_.charAt(n[s])}return e}function em(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,"+tm(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 im=function(){function r(){}return r.extension=ot.Loader,r.use=em,r}();Ze.add(J_,im);var nt,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 Un=(nt={},nt[q.COMPRESSED_RGB_S3TC_DXT1_EXT]=.5,nt[q.COMPRESSED_RGBA_S3TC_DXT1_EXT]=.5,nt[q.COMPRESSED_RGBA_S3TC_DXT3_EXT]=1,nt[q.COMPRESSED_RGBA_S3TC_DXT5_EXT]=1,nt[q.COMPRESSED_SRGB_S3TC_DXT1_EXT]=.5,nt[q.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT]=.5,nt[q.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT]=1,nt[q.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT]=1,nt[q.COMPRESSED_R11_EAC]=.5,nt[q.COMPRESSED_SIGNED_R11_EAC]=.5,nt[q.COMPRESSED_RG11_EAC]=1,nt[q.COMPRESSED_SIGNED_RG11_EAC]=1,nt[q.COMPRESSED_RGB8_ETC2]=.5,nt[q.COMPRESSED_RGBA8_ETC2_EAC]=1,nt[q.COMPRESSED_SRGB8_ETC2]=.5,nt[q.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC]=1,nt[q.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2]=.5,nt[q.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2]=.5,nt[q.COMPRESSED_RGB_PVRTC_4BPPV1_IMG]=.5,nt[q.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG]=.5,nt[q.COMPRESSED_RGB_PVRTC_2BPPV1_IMG]=.25,nt[q.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG]=.25,nt[q.COMPRESSED_RGB_ETC1_WEBGL]=.5,nt[q.COMPRESSED_RGB_ATC_WEBGL]=.5,nt[q.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL]=1,nt[q.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL]=1,nt[q.COMPRESSED_RGBA_ASTC_4x4_KHR]=1,nt);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 Eu(r,e){go(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function rm(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 nm(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 sm=function(r){Eu(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 ho(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 rm(this,void 0,Promise,function(){var t,i,n;return nm(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 ho(n),this.loaded=!0,this.onBlobLoaded(n),this.update(),[2,this]}})})},e}(Ir),_o=function(r){Eu(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*Un[i],g=0;g<n;g++)u[g]={levelID:g,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*Un[i];return u},e}(sm),om=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=$i.resolve(e.url.replace(n.baseUrl,""),o),p=i.cacheID;n.add(p,v,d,function(g){if(g.error){t(g.error);return}var _=g.texture,m=_===void 0?null:_,y=g.textures,b=y===void 0?{}:y;Object.assign(e,{texture:m,textures:b}),t()})}else t()},Object.defineProperty(r,"textureExtensions",{get:function(){if(!r._textureExtensions){var e=G.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=ot.Loader,r}();function Su(r,e,t){var i={textures:{},texture:null};if(!e)return i;var n=e.map(function(s){return new V(new et(s,Object.assign({mipmap:xe.OFF,alphaMode:be.NO_PREMULTIPLIED_ALPHA},t)))});return n.forEach(function(s,o){var a=s.baseTexture,h=r+"-"+(o+1);et.addToCache(a,h),V.addToCache(s,h),o===0&&(et.addToCache(a,r),V.addToCache(s,r),i.texture=s),i.textures[h]=s}),i}var Br,Se,mo=4,kn=124,am=32,Pu=20,hm=542327876,Xn={SIZE:1,FLAGS:2,HEIGHT:3,WIDTH:4,MIPMAP_COUNT:7,PIXEL_FORMAT:19},um={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},Hn={DXGI_FORMAT:0,RESOURCE_DIMENSION:1,MISC_FLAG:2,ARRAY_SIZE:3,MISC_FLAGS2:4},Pe;(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"})(Pe||(Pe={}));var yo;(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"})(yo||(yo={}));var lm=1,fm=2,cm=4,dm=64,pm=512,vm=131072,gm=827611204,_m=861165636,mm=894720068,ym=808540228,xm=4,bm=(Br={},Br[gm]=q.COMPRESSED_RGBA_S3TC_DXT1_EXT,Br[_m]=q.COMPRESSED_RGBA_S3TC_DXT3_EXT,Br[mm]=q.COMPRESSED_RGBA_S3TC_DXT5_EXT,Br),Tm=(Se={},Se[Pe.DXGI_FORMAT_BC1_TYPELESS]=q.COMPRESSED_RGBA_S3TC_DXT1_EXT,Se[Pe.DXGI_FORMAT_BC1_UNORM]=q.COMPRESSED_RGBA_S3TC_DXT1_EXT,Se[Pe.DXGI_FORMAT_BC2_TYPELESS]=q.COMPRESSED_RGBA_S3TC_DXT3_EXT,Se[Pe.DXGI_FORMAT_BC2_UNORM]=q.COMPRESSED_RGBA_S3TC_DXT3_EXT,Se[Pe.DXGI_FORMAT_BC3_TYPELESS]=q.COMPRESSED_RGBA_S3TC_DXT5_EXT,Se[Pe.DXGI_FORMAT_BC3_UNORM]=q.COMPRESSED_RGBA_S3TC_DXT5_EXT,Se[Pe.DXGI_FORMAT_BC1_UNORM_SRGB]=q.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,Se[Pe.DXGI_FORMAT_BC2_UNORM_SRGB]=q.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,Se[Pe.DXGI_FORMAT_BC3_UNORM_SRGB]=q.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,Se);function wm(r){var e=new Uint32Array(r),t=e[0];if(t!==hm)throw new Error("Invalid DDS file magic word");var i=new Uint32Array(r,0,kn/Uint32Array.BYTES_PER_ELEMENT),n=i[Xn.HEIGHT],s=i[Xn.WIDTH],o=i[Xn.MIPMAP_COUNT],a=new Uint32Array(r,Xn.PIXEL_FORMAT*Uint32Array.BYTES_PER_ELEMENT,am/Uint32Array.BYTES_PER_ELEMENT),h=a[lm];if(h&cm){var u=a[um.FOURCC];if(u!==ym){var l=bm[u],f=mo+kn,c=new Uint8Array(r,f),d=new _o(c,{format:l,width:s,height:n,levels:o});return[d]}var v=mo+kn,p=new Uint32Array(e.buffer,v,Pu/Uint32Array.BYTES_PER_ELEMENT),g=p[Hn.DXGI_FORMAT],_=p[Hn.RESOURCE_DIMENSION],m=p[Hn.MISC_FLAG],y=p[Hn.ARRAY_SIZE],b=Tm[g];if(b===void 0)throw new Error("DDSParser cannot parse texture data with DXGI format "+g);if(m===xm)throw new Error("DDSParser does not support cubemap textures");if(_===yo.DDS_DIMENSION_TEXTURE3D)throw new Error("DDSParser does not supported 3D texture data");var x=new Array,T=mo+kn+Pu;if(y===1)x.push(new Uint8Array(r,T));else{for(var w=Un[b],S=0,E=s,P=n,O=0;O<o;O++){var M=Math.max(1,E+3&-4),L=Math.max(1,P+3&-4),B=M*L*w;S+=B,E=E>>>1,P=P>>>1}for(var A=T,O=0;O<y;O++)x.push(new Uint8Array(r,A,S)),A+=S}return x.map(function(I){return new _o(I,{format:b,width:s,height:n,levels:o})})}throw h&dm?new Error("DDSParser does not support uncompressed texture data."):h&pm?new Error("DDSParser does not supported YUV uncompressed texture data."):h&vm?new Error("DDSParser does not support single-channel (lumninance) texture data!"):h&fm?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 ui,Ke,Gr,Ru=[171,75,84,88,32,49,49,187,13,10,26,10],Em=67305985,Re={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},xo=64,Cu=(ui={},ui[X.UNSIGNED_BYTE]=1,ui[X.UNSIGNED_SHORT]=2,ui[X.INT]=4,ui[X.UNSIGNED_INT]=4,ui[X.FLOAT]=4,ui[X.HALF_FLOAT]=8,ui),Sm=(Ke={},Ke[D.RGBA]=4,Ke[D.RGB]=3,Ke[D.RG]=2,Ke[D.RED]=1,Ke[D.LUMINANCE]=1,Ke[D.LUMINANCE_ALPHA]=2,Ke[D.ALPHA]=1,Ke),Pm=(Gr={},Gr[X.UNSIGNED_SHORT_4_4_4_4]=2,Gr[X.UNSIGNED_SHORT_5_5_5_1]=2,Gr[X.UNSIGNED_SHORT_5_6_5]=2,Gr);function Rm(r,e,t){t===void 0&&(t=!1);var i=new DataView(e);if(!Cm(r,i))return null;var n=i.getUint32(Re.ENDIANNESS,!0)===Em,s=i.getUint32(Re.GL_TYPE,n),o=i.getUint32(Re.GL_FORMAT,n),a=i.getUint32(Re.GL_INTERNAL_FORMAT,n),h=i.getUint32(Re.PIXEL_WIDTH,n),u=i.getUint32(Re.PIXEL_HEIGHT,n)||1,l=i.getUint32(Re.PIXEL_DEPTH,n)||1,f=i.getUint32(Re.NUMBER_OF_ARRAY_ELEMENTS,n)||1,c=i.getUint32(Re.NUMBER_OF_FACES,n),d=i.getUint32(Re.NUMBER_OF_MIPMAP_LEVELS,n),v=i.getUint32(Re.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,g=4,_=h+3&-4,m=u+3&-4,y=new Array(f),b=h*u;s===0&&(b=_*m);var x;if(s!==0?Cu[s]?x=Cu[s]*Sm[o]:x=Pm[s]:x=Un[a],x===void 0)throw new Error("Unable to resolve the pixel format stored in the *.ktx file!");for(var T=t?Am(i,v,n):null,w=b*x,S=w,E=h,P=u,O=_,M=m,L=xo+v,B=0;B<d;B++){for(var A=i.getUint32(L,n),I=L+4,F=0;F<f;F++){var Y=y[F];Y||(Y=y[F]=new Array(d)),Y[B]={levelID:B,levelWidth:d>1||s!==0?E:O,levelHeight:d>1||s!==0?P:M,levelBuffer:new Uint8Array(e,I,S)},I+=S}L+=A+4,L=L%4!==0?L+4-L%4:L,E=E>>1||1,P=P>>1||1,O=E+p-1&~(p-1),M=P+g-1&~(g-1),S=O*M*x}return s!==0?{uncompressed:y.map(function(z){var N=z[0].levelBuffer,C=!1;return s===X.FLOAT?N=new Float32Array(z[0].levelBuffer.buffer,z[0].levelBuffer.byteOffset,z[0].levelBuffer.byteLength/4):s===X.UNSIGNED_INT?(C=!0,N=new Uint32Array(z[0].levelBuffer.buffer,z[0].levelBuffer.byteOffset,z[0].levelBuffer.byteLength/4)):s===X.INT&&(C=!0,N=new Int32Array(z[0].levelBuffer.buffer,z[0].levelBuffer.byteOffset,z[0].levelBuffer.byteLength/4)),{resource:new Ir(N,{width:z[0].levelWidth,height:z[0].levelHeight}),type:s,format:C?Om(o):o}}),kvData:T}:{compressed:y.map(function(z){return new _o(null,{format:a,width:h,height:u,levels:d,levelBuffers:z})}),kvData:T}}function Cm(r,e){for(var t=0;t<Ru.length;t++)if(e.getUint8(t)!==Ru[t])return console.error(r+" is not a valid *.ktx file!"),!1;return!0}function Om(r){switch(r){case D.RGBA:return D.RGBA_INTEGER;case D.RGB:return D.RGB_INTEGER;case D.RG:return D.RG_INTEGER;case D.RED:return D.RED_INTEGER;default:return r}}function Am(r,e,t){for(var i=new Map,n=0;n<e;){var s=r.getUint32(xo+n,t),o=xo+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 Im=function(){function r(){}return r.use=function(e,t){if(e.extension==="dds"&&e.data)try{Object.assign(e,Su(e.name||e.url,wm(e.data),e.metadata))}catch(i){t(i);return}t()},r.extension=ot.Loader,r}();Et.setExtensionXhrType("ktx",Et.XHR_RESPONSE_TYPE.BUFFER);var Mm=function(){function r(){}return r.use=function(e,t){if(e.extension==="ktx"&&e.data)try{var i=e.name||e.url,n=Rm(i,e.data,this.loadKeyValueData),s=n.compressed,o=n.uncompressed,a=n.kvData;if(s){var h=Su(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 V(new et(f.resource,{mipmap:xe.OFF,alphaMode:be.NO_PREMULTIPLIED_ALPHA,type:f.type,format:f.format})),v=i+"-"+(c+1);a&&(d.baseTexture.ktxKeyValueData=a),et.addToCache(d.baseTexture,v),V.addToCache(d,v),c===0&&(l[i]=d,et.addToCache(d.baseTexture,i),V.addToCache(d,i)),l[v]=d}),Object.assign(e,{textures:l})}}catch(f){t(f);return}t()},r.extension=ot.Loader,r.loadKeyValueData=!1,r}();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 Ou(r,e){bo(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}(function(r){Ou(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=H.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,Ji(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})(st);var Au=function(){function r(e,t,i){this.geometry=new Mr,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||X.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 Dt(Kv(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 Dt(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 Dt(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===X.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===X.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===X.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===X.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}(),Nm=`varying vec2 vTextureCoord;
|
|
495
|
+
`,O_=function(){function r(){}return r.create=function(e){var t=Object.assign({vertex:fu,fragment:cu,geometryClass:lu,vertexSize:6},e),i=t.vertex,n=t.fragment,s=t.vertexSize,o=t.geometryClass;return function(a){pt(h,a);function h(u){var l=a.call(this,u)||this;return l.shaderGenerator=new C_(i,n),l.geometryClass=o,l.vertexSize=s,l}return h}(R_)},Object.defineProperty(r,"defaultVertexSrc",{get:function(){return fu},enumerable:!1,configurable:!0}),Object.defineProperty(r,"defaultFragmentTemplate",{get:function(){return cu},enumerable:!1,configurable:!0}),r}(),du=O_.create();Object.assign(du,{extension:{name:"batch",type:ot.RendererPlugin}});var A_={accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:null,accessibleType:"button",accessiblePointerEvents:"auto",accessibleChildren:!0,renderId:-1};Rt.mixin(A_);var I_=9,Nn=100,M_=0,N_=0,pu=2,vu=1,D_=-1e3,F_=-1e3,L_=2,B_=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,(Ge.tablet||Ge.phone)&&this.createTouchHook();var t=document.createElement("div");t.style.width=Nn+"px",t.style.height=Nn+"px",t.style.position="absolute",t.style.top=M_+"px",t.style.left=N_+"px",t.style.zIndex=pu.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=vu+"px",t.style.height=vu+"px",t.style.position="absolute",t.style.top=D_+"px",t.style.left=F_+"px",t.style.zIndex=L_.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(!(Ge.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 g=p.hitArea,_=p.worldTransform;p.hitArea?(d.style.left=(_.tx+g.x*_.a)*f+"px",d.style.top=(_.ty+g.y*_.d)*c+"px",d.style.width=g.width*_.a*f+"px",d.style.height=g.height*_.d*c+"px"):(g=p.getBounds(),this.capHitArea(g),d.style.left=g.x*f+"px",d.style.top=g.y*c+"px",d.style.width=g.width*f+"px",d.style.height=g.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=Nn+"px",t.style.height=Nn+"px",t.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",t.style.position="absolute",t.style.zIndex=pu.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===I_&&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:[ot.RendererPlugin,ot.CanvasRendererPlugin]},r}();var gu=function(){function r(){this.pressure=0,this.rotationAngle=0,this.twist=0,this.tangentialPressure=0,this.global=new Z,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 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 G_(r,e){uo(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var U_=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}(),lo=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}(),k_=function(){function r(){this._tempPoint=new Z}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}(),X_={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};Rt.mixin(X_);var Dn=1,Fn={target:null,data:{global:null}},H_=function(r){G_(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 gu,n.mouse.identifier=Dn,n.mouse.global.set(-999999),n.activeInteractionData={},n.activeInteractionData[Dn]=n.mouse,n.interactionDataPool=[],n.eventData=new U_,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 k_,n._tempDisplayObject=new Bh,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 Fn.target=null,Fn.data.global=t,i||(i=this.lastObjectRendered),this.processInteractive(Fn,i,null,!0),Fn.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||(Gt.system.add(this.tickerUpdate,this,re.INTERACTION),this.tickerAdded=!0)},e.prototype.removeTickerListener=function(){this.tickerAdded&&(Gt.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 lo(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=lo.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 lo(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===Dn||t.pointerType==="mouse"?n=this.mouse:this.activeInteractionData[i]?n=this.activeInteractionData[i]:(n=this.interactionDataPool.pop()||new gu,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=Dn),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:[ot.RendererPlugin,ot.CanvasRendererPlugin]},e}(wr);var _u=new K,mu=4,W_=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 Ai?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=_u,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 Lh(h,u,1),f=new Uint8Array(mu*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 Lh(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 Ai?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=_u,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(mu*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:ot.RendererPlugin},r}();var Ln=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 yu(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 qe=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 Ln))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 yu(this,new Ln(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 yu(this,new Ln(e,!0,t))},r.prototype.detach=function(e){if(!(e instanceof Ln))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 xu(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 fo,Bn=null,z_=0,bu=200,Y_=204,V_=1223,j_=2;function Tu(){}function wu(r,e,t){e&&e.indexOf(".")===0&&(e=e.substring(1)),e&&(r[e]=t)}function co(r){return r.toString().replace("object ","")}var Et=function(){function r(e,t,i){if(this._dequeue=Tu,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=Tu,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 qe,this.onProgress=new qe,this.onComplete=new qe,this.onAfterMiddleware=new qe}return r.setExtensionLoadType=function(e,t){wu(r._loadTypeMap,e,t)},r.setExtensionXhrType=function(e,t){wu(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 fo>"u"&&(fo=!!(globalThis.XDomainRequest&&!("withCredentials"in new XMLHttpRequest))),fo&&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(co(e)+" Request failed. Status: "+e.status+', text: "'+e.statusText+'"')},r.prototype._xhrOnTimeout=function(){var e=this.xhr;this.abort(co(e)+" Request timed out.")},r.prototype._xhrOnAbort=function(){var e=this.xhr;this.abort(co(e)+" Request was aborted by the user.")},r.prototype._xhrOnLoad=function(){var e=this.xhr,t="",i=typeof e.status>"u"?bu:e.status;(e.responseType===""||e.responseType==="text"||typeof e.responseType>"u")&&(t=e.responseText),i===z_&&(t.length>0||e.responseType===r.XHR_RESPONSE_TYPE.BUFFER)?i=bu:i===V_&&(i=Y_);var n=i/100|0;if(n===j_)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,Bn||(Bn=document.createElement("a")),Bn.href=e;var i=xu(Bn.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 Di(){}function Z_(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 q_=function(){function r(e,t){this.data=e,this.callback=t}return r}(),po=function(){function r(e,t){var i=this;if(t===void 0&&(t=1),this.workers=0,this.saturated=Di,this.unsaturated=Di,this.empty=Di,this.drain=Di,this.error=Di,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 q_(n,typeof o=="function"?o:Di);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,Z_(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=Di,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}(),vo=100,K_=/(#[\w-]+)?$/,Gn=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=po.queue(this._boundLoadResource,t),this._queue.pause(),this.resources={},this.onProgress=new qe,this.onError=new qe,this.onLoad=new qe,this.onStart=new qe,this.onComplete=new qe;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(Ee("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=vo/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=xu(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=K_.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,po.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=vo,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(),po.eachSeries(this._afterMiddleware,function(i,n){i.call(t,e,n)},function(){e.onAfterMiddleware.dispatch(e),t.progress=Math.min(vo,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 Ee("6.5.0","Loader.registerPlugin() is deprecated, use extensions.add() instead."),Ze.add({type:ot.Loader,ref:e}),r},r._plugins=[],r}();Ze.handleByList(ot.Loader,Gn._plugins),Gn.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 $_=function(){function r(){}return r.init=function(e){e=Object.assign({sharedLoader:!1},e),this.loader=e.sharedLoader?Gn.shared:new Gn},r.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},r.extension=ot.Application,r}(),J_=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;V.fromLoader(i,n,s,o).then(function(a){e.texture=a,t()}).catch(t)}else t()},r.extension=ot.Loader,r}(),Q_="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function tm(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+=Q_.charAt(n[s])}return e}function em(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,"+tm(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 im=function(){function r(){}return r.extension=ot.Loader,r.use=em,r}();Ze.add(J_,im);var nt,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 Un=(nt={},nt[q.COMPRESSED_RGB_S3TC_DXT1_EXT]=.5,nt[q.COMPRESSED_RGBA_S3TC_DXT1_EXT]=.5,nt[q.COMPRESSED_RGBA_S3TC_DXT3_EXT]=1,nt[q.COMPRESSED_RGBA_S3TC_DXT5_EXT]=1,nt[q.COMPRESSED_SRGB_S3TC_DXT1_EXT]=.5,nt[q.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT]=.5,nt[q.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT]=1,nt[q.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT]=1,nt[q.COMPRESSED_R11_EAC]=.5,nt[q.COMPRESSED_SIGNED_R11_EAC]=.5,nt[q.COMPRESSED_RG11_EAC]=1,nt[q.COMPRESSED_SIGNED_RG11_EAC]=1,nt[q.COMPRESSED_RGB8_ETC2]=.5,nt[q.COMPRESSED_RGBA8_ETC2_EAC]=1,nt[q.COMPRESSED_SRGB8_ETC2]=.5,nt[q.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC]=1,nt[q.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2]=.5,nt[q.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2]=.5,nt[q.COMPRESSED_RGB_PVRTC_4BPPV1_IMG]=.5,nt[q.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG]=.5,nt[q.COMPRESSED_RGB_PVRTC_2BPPV1_IMG]=.25,nt[q.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG]=.25,nt[q.COMPRESSED_RGB_ETC1_WEBGL]=.5,nt[q.COMPRESSED_RGB_ATC_WEBGL]=.5,nt[q.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL]=1,nt[q.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL]=1,nt[q.COMPRESSED_RGBA_ASTC_4x4_KHR]=1,nt);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 Eu(r,e){go(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function rm(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 nm(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 sm=function(r){Eu(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 ho(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 rm(this,void 0,Promise,function(){var t,i,n;return nm(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 ho(n),this.loaded=!0,this.onBlobLoaded(n),this.update(),[2,this]}})})},e}(Ir),_o=function(r){Eu(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*Un[i],g=0;g<n;g++)u[g]={levelID:g,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*Un[i];return u},e}(sm),om=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=$i.resolve(e.url.replace(n.baseUrl,""),o),p=i.cacheID;n.add(p,v,d,function(g){if(g.error){t(g.error);return}var _=g.texture,m=_===void 0?null:_,y=g.textures,b=y===void 0?{}:y;Object.assign(e,{texture:m,textures:b}),t()})}else t()},Object.defineProperty(r,"textureExtensions",{get:function(){if(!r._textureExtensions){var e=G.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=ot.Loader,r}();function Su(r,e,t){var i={textures:{},texture:null};if(!e)return i;var n=e.map(function(s){return new V(new et(s,Object.assign({mipmap:xe.OFF,alphaMode:be.NO_PREMULTIPLIED_ALPHA},t)))});return n.forEach(function(s,o){var a=s.baseTexture,h=r+"-"+(o+1);et.addToCache(a,h),V.addToCache(s,h),o===0&&(et.addToCache(a,r),V.addToCache(s,r),i.texture=s),i.textures[h]=s}),i}var Br,Se,mo=4,kn=124,am=32,Pu=20,hm=542327876,Xn={SIZE:1,FLAGS:2,HEIGHT:3,WIDTH:4,MIPMAP_COUNT:7,PIXEL_FORMAT:19},um={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},Hn={DXGI_FORMAT:0,RESOURCE_DIMENSION:1,MISC_FLAG:2,ARRAY_SIZE:3,MISC_FLAGS2:4},Pe;(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"})(Pe||(Pe={}));var yo;(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"})(yo||(yo={}));var lm=1,fm=2,cm=4,dm=64,pm=512,vm=131072,gm=827611204,_m=861165636,mm=894720068,ym=808540228,xm=4,bm=(Br={},Br[gm]=q.COMPRESSED_RGBA_S3TC_DXT1_EXT,Br[_m]=q.COMPRESSED_RGBA_S3TC_DXT3_EXT,Br[mm]=q.COMPRESSED_RGBA_S3TC_DXT5_EXT,Br),Tm=(Se={},Se[Pe.DXGI_FORMAT_BC1_TYPELESS]=q.COMPRESSED_RGBA_S3TC_DXT1_EXT,Se[Pe.DXGI_FORMAT_BC1_UNORM]=q.COMPRESSED_RGBA_S3TC_DXT1_EXT,Se[Pe.DXGI_FORMAT_BC2_TYPELESS]=q.COMPRESSED_RGBA_S3TC_DXT3_EXT,Se[Pe.DXGI_FORMAT_BC2_UNORM]=q.COMPRESSED_RGBA_S3TC_DXT3_EXT,Se[Pe.DXGI_FORMAT_BC3_TYPELESS]=q.COMPRESSED_RGBA_S3TC_DXT5_EXT,Se[Pe.DXGI_FORMAT_BC3_UNORM]=q.COMPRESSED_RGBA_S3TC_DXT5_EXT,Se[Pe.DXGI_FORMAT_BC1_UNORM_SRGB]=q.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,Se[Pe.DXGI_FORMAT_BC2_UNORM_SRGB]=q.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,Se[Pe.DXGI_FORMAT_BC3_UNORM_SRGB]=q.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,Se);function wm(r){var e=new Uint32Array(r),t=e[0];if(t!==hm)throw new Error("Invalid DDS file magic word");var i=new Uint32Array(r,0,kn/Uint32Array.BYTES_PER_ELEMENT),n=i[Xn.HEIGHT],s=i[Xn.WIDTH],o=i[Xn.MIPMAP_COUNT],a=new Uint32Array(r,Xn.PIXEL_FORMAT*Uint32Array.BYTES_PER_ELEMENT,am/Uint32Array.BYTES_PER_ELEMENT),h=a[lm];if(h&cm){var u=a[um.FOURCC];if(u!==ym){var l=bm[u],f=mo+kn,c=new Uint8Array(r,f),d=new _o(c,{format:l,width:s,height:n,levels:o});return[d]}var v=mo+kn,p=new Uint32Array(e.buffer,v,Pu/Uint32Array.BYTES_PER_ELEMENT),g=p[Hn.DXGI_FORMAT],_=p[Hn.RESOURCE_DIMENSION],m=p[Hn.MISC_FLAG],y=p[Hn.ARRAY_SIZE],b=Tm[g];if(b===void 0)throw new Error("DDSParser cannot parse texture data with DXGI format "+g);if(m===xm)throw new Error("DDSParser does not support cubemap textures");if(_===yo.DDS_DIMENSION_TEXTURE3D)throw new Error("DDSParser does not supported 3D texture data");var x=new Array,T=mo+kn+Pu;if(y===1)x.push(new Uint8Array(r,T));else{for(var w=Un[b],S=0,E=s,P=n,O=0;O<o;O++){var M=Math.max(1,E+3&-4),L=Math.max(1,P+3&-4),B=M*L*w;S+=B,E=E>>>1,P=P>>>1}for(var A=T,O=0;O<y;O++)x.push(new Uint8Array(r,A,S)),A+=S}return x.map(function(I){return new _o(I,{format:b,width:s,height:n,levels:o})})}throw h&dm?new Error("DDSParser does not support uncompressed texture data."):h&pm?new Error("DDSParser does not supported YUV uncompressed texture data."):h&vm?new Error("DDSParser does not support single-channel (lumninance) texture data!"):h&fm?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 ui,Ke,Gr,Ru=[171,75,84,88,32,49,49,187,13,10,26,10],Em=67305985,Re={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},xo=64,Cu=(ui={},ui[X.UNSIGNED_BYTE]=1,ui[X.UNSIGNED_SHORT]=2,ui[X.INT]=4,ui[X.UNSIGNED_INT]=4,ui[X.FLOAT]=4,ui[X.HALF_FLOAT]=8,ui),Sm=(Ke={},Ke[D.RGBA]=4,Ke[D.RGB]=3,Ke[D.RG]=2,Ke[D.RED]=1,Ke[D.LUMINANCE]=1,Ke[D.LUMINANCE_ALPHA]=2,Ke[D.ALPHA]=1,Ke),Pm=(Gr={},Gr[X.UNSIGNED_SHORT_4_4_4_4]=2,Gr[X.UNSIGNED_SHORT_5_5_5_1]=2,Gr[X.UNSIGNED_SHORT_5_6_5]=2,Gr);function Rm(r,e,t){t===void 0&&(t=!1);var i=new DataView(e);if(!Cm(r,i))return null;var n=i.getUint32(Re.ENDIANNESS,!0)===Em,s=i.getUint32(Re.GL_TYPE,n),o=i.getUint32(Re.GL_FORMAT,n),a=i.getUint32(Re.GL_INTERNAL_FORMAT,n),h=i.getUint32(Re.PIXEL_WIDTH,n),u=i.getUint32(Re.PIXEL_HEIGHT,n)||1,l=i.getUint32(Re.PIXEL_DEPTH,n)||1,f=i.getUint32(Re.NUMBER_OF_ARRAY_ELEMENTS,n)||1,c=i.getUint32(Re.NUMBER_OF_FACES,n),d=i.getUint32(Re.NUMBER_OF_MIPMAP_LEVELS,n),v=i.getUint32(Re.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,g=4,_=h+3&-4,m=u+3&-4,y=new Array(f),b=h*u;s===0&&(b=_*m);var x;if(s!==0?Cu[s]?x=Cu[s]*Sm[o]:x=Pm[s]:x=Un[a],x===void 0)throw new Error("Unable to resolve the pixel format stored in the *.ktx file!");for(var T=t?Am(i,v,n):null,w=b*x,S=w,E=h,P=u,O=_,M=m,L=xo+v,B=0;B<d;B++){for(var A=i.getUint32(L,n),I=L+4,F=0;F<f;F++){var Y=y[F];Y||(Y=y[F]=new Array(d)),Y[B]={levelID:B,levelWidth:d>1||s!==0?E:O,levelHeight:d>1||s!==0?P:M,levelBuffer:new Uint8Array(e,I,S)},I+=S}L+=A+4,L=L%4!==0?L+4-L%4:L,E=E>>1||1,P=P>>1||1,O=E+p-1&~(p-1),M=P+g-1&~(g-1),S=O*M*x}return s!==0?{uncompressed:y.map(function(z){var N=z[0].levelBuffer,C=!1;return s===X.FLOAT?N=new Float32Array(z[0].levelBuffer.buffer,z[0].levelBuffer.byteOffset,z[0].levelBuffer.byteLength/4):s===X.UNSIGNED_INT?(C=!0,N=new Uint32Array(z[0].levelBuffer.buffer,z[0].levelBuffer.byteOffset,z[0].levelBuffer.byteLength/4)):s===X.INT&&(C=!0,N=new Int32Array(z[0].levelBuffer.buffer,z[0].levelBuffer.byteOffset,z[0].levelBuffer.byteLength/4)),{resource:new Ir(N,{width:z[0].levelWidth,height:z[0].levelHeight}),type:s,format:C?Om(o):o}}),kvData:T}:{compressed:y.map(function(z){return new _o(null,{format:a,width:h,height:u,levels:d,levelBuffers:z})}),kvData:T}}function Cm(r,e){for(var t=0;t<Ru.length;t++)if(e.getUint8(t)!==Ru[t])return console.error(r+" is not a valid *.ktx file!"),!1;return!0}function Om(r){switch(r){case D.RGBA:return D.RGBA_INTEGER;case D.RGB:return D.RGB_INTEGER;case D.RG:return D.RG_INTEGER;case D.RED:return D.RED_INTEGER;default:return r}}function Am(r,e,t){for(var i=new Map,n=0;n<e;){var s=r.getUint32(xo+n,t),o=xo+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 Im=function(){function r(){}return r.use=function(e,t){if(e.extension==="dds"&&e.data)try{Object.assign(e,Su(e.name||e.url,wm(e.data),e.metadata))}catch(i){t(i);return}t()},r.extension=ot.Loader,r}();Et.setExtensionXhrType("ktx",Et.XHR_RESPONSE_TYPE.BUFFER);var Mm=function(){function r(){}return r.use=function(e,t){if(e.extension==="ktx"&&e.data)try{var i=e.name||e.url,n=Rm(i,e.data,this.loadKeyValueData),s=n.compressed,o=n.uncompressed,a=n.kvData;if(s){var h=Su(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 V(new et(f.resource,{mipmap:xe.OFF,alphaMode:be.NO_PREMULTIPLIED_ALPHA,type:f.type,format:f.format})),v=i+"-"+(c+1);a&&(d.baseTexture.ktxKeyValueData=a),et.addToCache(d.baseTexture,v),V.addToCache(d,v),c===0&&(l[i]=d,et.addToCache(d.baseTexture,i),V.addToCache(d,i)),l[v]=d}),Object.assign(e,{textures:l})}}catch(f){t(f);return}t()},r.extension=ot.Loader,r.loadKeyValueData=!1,r}();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 Ou(r,e){bo(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}(function(r){Ou(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=W.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,Ji(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})(st);var Au=function(){function r(e,t,i){this.geometry=new Mr,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||X.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 Dt(Kv(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 Dt(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 Dt(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===X.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===X.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===X.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===X.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}(),Nm=`varying vec2 vTextureCoord;
|
|
496
496
|
varying vec4 vColor;
|
|
497
497
|
|
|
498
498
|
uniform sampler2D uSampler;
|
|
@@ -525,7 +525,7 @@ void main(void){
|
|
|
525
525
|
vTextureCoord = aTextureCoord;
|
|
526
526
|
vColor = aColor * uColor;
|
|
527
527
|
}
|
|
528
|
-
`,Fm=function(r){Ou(e,r);function e(t){var i=r.call(this,t)||this;return i.shader=null,i.properties=null,i.tempMatrix=new Mt,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:X.UNSIGNED_BYTE,uploadFunction:i.uploadTint,offset:0}],i.shader=ai.from(Dm,Nm,{}),i.state=Mi.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=Oh(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=qv(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 g=a-v;g>s&&(g=s),p>=h.length&&h.push(this._generateOneMoreBuffer(t));var _=h[p];_.uploadDynamic(i,v,g);var m=t._bufferUpdateIDs[p]||0;d=d||_._updateID<m,d&&(_._updateID=t._updateID,_.uploadStatic(i,v,g)),o.geometry.bind(_.geometry),f.drawElements(f.TRIANGLES,g*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 Au(this.properties,o,s));return i},e.prototype._generateOneMoreBuffer=function(t){var i=t._batchSize,n=t._properties;return new Au(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,g=d.scale.y,_=v.trim,m=v.orig;_?(u=_.x-d.anchor.x*m.width,h=u+_.width,f=_.y-d.anchor.y*m.height,l=f+_.height):(h=m.width*(1-d.anchor.x),u=m.width*-d.anchor.x,l=m.height*(1-d.anchor.y),f=m.height*-d.anchor.y),s[a]=u*p,s[a+1]=f*g,s[a+o]=h*p,s[a+o+1]=f*g,s[a+o*2]=h*p,s[a+o*2+1]=l*g,s[a+o*3]=u*p,s[a+o*3+1]=l*g,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?ks(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:ot.RendererPlugin},e}(Cn);var $e;(function(r){r.MITER="miter",r.BEVEL="bevel",r.ROUND="round"})($e||($e={}));var li;(function(r){r.BUTT="butt",r.ROUND="round",r.SQUARE="square"})(li||(li={}));var Ur={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}},Iu=function(){function r(){this.color=16777215,this.alpha=1,this.texture=V.WHITE,this.matrix=null,this.visible=!1,this.reset()}return r.prototype.clone=function(){var e=new r;return e.color=this.color,e.alpha=this.alpha,e.texture=this.texture,e.matrix=this.matrix,e.visible=this.visible,e},r.prototype.reset=function(){this.color=16777215,this.alpha=1,this.texture=V.WHITE,this.matrix=null,this.visible=!1},r.prototype.destroy=function(){this.texture=null,this.matrix=null},r}();var To=function(r,e){return To=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])},To(r,e)};function wo(r,e){To(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function Mu(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 Nu={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){Mu(t,!1);for(var o=[],a=0;a<i.length;a++){var h=i[a];Mu(h.points,!0),o.push(t.length/2),t=t.concat(h.points)}var u=gn.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])}}},Wn={build:function(r){var e=r.points,t,i,n,s,o,a;if(r.type===Bt.CIRC){var h=r.shape;t=h.x,i=h.y,o=a=h.radius,n=s=0}else if(r.type===Bt.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,g=d*4+(n?2:0)+2,_=g,m=v;{var y=n+o,b=s,x=t+y,T=t-y,w=i+b;if(e[p++]=x,e[p++]=w,e[--g]=w,e[--g]=T,s){var S=i-b;e[_++]=T,e[_++]=S,e[--m]=S,e[--m]=x}}for(var E=1;E<d;E++){var P=Math.PI/2*(E/d),y=n+Math.cos(P)*o,b=s+Math.sin(P)*a,x=t+y,T=t-y,w=i+b,S=i-b;e[p++]=x,e[p++]=w,e[--g]=w,e[--g]=T,e[_++]=T,e[_++]=S,e[--m]=S,e[--m]=x}{var y=n,b=s+a,x=t+y,T=t-y,w=i+b,S=i-b;e[p++]=x,e[p++]=w,e[--m]=S,e[--m]=x,n&&(e[p++]=T,e[p++]=w,e[--m]=S,e[--m]=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!==Bt.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)}}},Lm={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 ir(r,e,t){var i=e-r;return r+i*t}function zn(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,g=0;p<=a;++p)g=p/a,u=ir(r,t,g),l=ir(e,i,g),f=ir(t,n,g),c=ir(i,s,g),d=ir(u,f,g),v=ir(l,c,g),!(p===0&&h[h.length-2]===d&&h[h.length-1]===v)&&h.push(d,v);return h}var Bm={build:function(r){if(Ce.nextRoundedRectBehavior){Wn.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?(zn(i,n+a,i,n,i+a,n,t),zn(i+s-a,n,i+s,n,i+s,n+a,t),zn(i+s,n+o-a,i+s,n+o,i+s-a,n+o,t),zn(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(Ce.nextRoundedRectBehavior){Wn.triangulate(r,e);return}for(var t=r.points,i=e.points,n=e.indices,s=i.length/2,o=gn.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 Du(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,g=l+c,_=f+d;return a.push(v,p),a.push(g,_),2}function Fi(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),g=(15*v*Math.sqrt(p)/Math.PI>>0)+1,_=d/g;if(c+=_,a){o.push(r,e),o.push(t,i);for(var m=1,y=c;m<g;m++,y+=_)o.push(r,e),o.push(r+Math.sin(y)*p,e+Math.cos(y)*p);o.push(r,e),o.push(n,s)}else{o.push(t,i),o.push(r,e);for(var m=1,y=c;m<g;m++,y+=_)o.push(r+Math.sin(y)*p,e+Math.cos(y)*p),o.push(r,e);o.push(n,s),o.push(r,e)}return g*2}function Gm(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 Z(i[0],i[1]),a=new Z(i[i.length-2],i[i.length-1]),h=t.type!==Bt.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,g=s.width/2,_=g*g,m=s.miterLimit*s.miterLimit,y=i[0],b=i[1],x=i[2],T=i[3],w=0,S=0,E=-(b-T),P=y-x,O=0,M=0,L=Math.sqrt(E*E+P*P);E/=L,P/=L,E*=g,P*=g;var B=s.alignment,A=(1-B)*2,I=B*2;h||(s.cap===li.ROUND?v+=Fi(y-E*(A-I)*.5,b-P*(A-I)*.5,y-E*A,b-P*A,y+E*I,b+P*I,c,!0)+2:s.cap===li.SQUARE&&(v+=Du(y,b,E,P,A,I,!0,c))),c.push(y-E*A,b-P*A),c.push(y+E*I,b+P*I);for(var F=1;F<d-1;++F){y=i[(F-1)*2],b=i[(F-1)*2+1],x=i[F*2],T=i[F*2+1],w=i[(F+1)*2],S=i[(F+1)*2+1],E=-(b-T),P=y-x,L=Math.sqrt(E*E+P*P),E/=L,P/=L,E*=g,P*=g,O=-(T-S),M=x-w,L=Math.sqrt(O*O+M*M),O/=L,M/=L,O*=g,M*=g;var Y=x-y,z=b-T,N=x-w,C=S-T,U=Y*N+z*C,$=z*N-C*Y,j=$<0;if(Math.abs($)<.001*Math.abs(U)){c.push(x-E*A,T-P*A),c.push(x+E*I,T+P*I),U>=0&&(s.join===$e.ROUND?v+=Fi(x,T,x-E*A,T-P*A,x-O*A,T-M*A,c,!1)+4:v+=2,c.push(x-O*I,T-M*I),c.push(x+O*A,T+M*A));continue}var it=(-E+y)*(-P+T)-(-E+x)*(-P+b),vt=(-O+w)*(-M+T)-(-O+x)*(-M+S),ft=(Y*vt-N*it)/$,It=(C*it-z*vt)/$,Lt=(ft-x)*(ft-x)+(It-T)*(It-T),xt=x+(ft-x)*A,rt=T+(It-T)*A,ct=x-(ft-x)*I,at=T-(It-T)*I,J=Math.min(Y*Y+z*z,N*N+C*C),kt=j?A:I,qt=J+kt*kt*_,k=Lt<=qt;k?s.join===$e.BEVEL||Lt/_>m?(j?(c.push(xt,rt),c.push(x+E*I,T+P*I),c.push(xt,rt),c.push(x+O*I,T+M*I)):(c.push(x-E*A,T-P*A),c.push(ct,at),c.push(x-O*A,T-M*A),c.push(ct,at)),v+=2):s.join===$e.ROUND?j?(c.push(xt,rt),c.push(x+E*I,T+P*I),v+=Fi(x,T,x+E*I,T+P*I,x+O*I,T+M*I,c,!0)+4,c.push(xt,rt),c.push(x+O*I,T+M*I)):(c.push(x-E*A,T-P*A),c.push(ct,at),v+=Fi(x,T,x-E*A,T-P*A,x-O*A,T-M*A,c,!1)+4,c.push(x-O*A,T-M*A),c.push(ct,at)):(c.push(xt,rt),c.push(ct,at)):(c.push(x-E*A,T-P*A),c.push(x+E*I,T+P*I),s.join===$e.ROUND?j?v+=Fi(x,T,x+E*I,T+P*I,x+O*I,T+M*I,c,!0)+2:v+=Fi(x,T,x-E*A,T-P*A,x-O*A,T-M*A,c,!1)+2:s.join===$e.MITER&&Lt/_<=m&&(j?(c.push(ct,at),c.push(ct,at)):(c.push(xt,rt),c.push(xt,rt)),v+=2),c.push(x-O*A,T-M*A),c.push(x+O*I,T+M*I),v+=2)}y=i[(d-2)*2],b=i[(d-2)*2+1],x=i[(d-1)*2],T=i[(d-1)*2+1],E=-(b-T),P=y-x,L=Math.sqrt(E*E+P*P),E/=L,P/=L,E*=g,P*=g,c.push(x-E*A,T-P*A),c.push(x+E*I,T+P*I),h||(s.cap===li.ROUND?v+=Fi(x-E*(A-I)*.5,T-P*(A-I)*.5,x-E*A,T-P*A,x+E*I,T+P*I,c,!1)+2:s.cap===li.SQUARE&&(v+=Du(x,T,E,P,A,I,!1,c)));for(var dt=e.indices,Wt=Ur.epsilon*Ur.epsilon,F=p;F<v+p-2;++F)y=c[F*2],b=c[F*2+1],x=c[(F+1)*2],T=c[(F+1)*2+1],w=c[(F+2)*2],S=c[(F+2)*2+1],!(Math.abs(y*(T-S)+x*(S-b)+w*(b-T))<Wt)&&dt.push(F,F+1,F+2)}}function Um(r,e){var t=0,i=r.shape,n=r.points||i.points,s=i.type!==Bt.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 Fu(r,e){r.lineStyle.native?Um(r,e):Gm(r,e)}var Lu=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,g=u*f+l*c,_=s*Math.sqrt(v)/d,m=s*Math.sqrt(p)/d,y=_*g/v,b=m*g/p,x=_*c+m*l,T=_*f+m*u,w=l*(m+y),S=u*(m+y),E=c*(_+b),P=f*(_+b),O=Math.atan2(S-T,w-x),M=Math.atan2(P-T,E-x);return{cx:x+e,cy:T+t,radius:s,startAngle:O,endAngle:M,anticlockwise:l*f>c*u}},r.arc=function(e,t,i,n,s,o,a,h,u){for(var l=a-o,f=Ur._segmentsCount(Math.abs(l)*s,Math.ceil(Math.abs(l)/De)*40),c=l/(f*2),d=c*2,v=Math.cos(c),p=Math.sin(c),g=f-1,_=g%1/g,m=0;m<=g;++m){var y=m+_*m,b=c+o+d*y,x=Math.cos(b),T=-Math.sin(b);u.push((v*x+p*T)*s+i,(v*-T+p*x)*s+n)}},r}(),km=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,g=0,_=0,m=0,y=0,b=0,x=e,T=t,w=1;w<=u;++w)f=w/u,c=f*f,d=c*f,v=1-f,p=v*v,g=p*v,_=g*e+3*p*f*i+3*v*c*s+d*a,m=g*t+3*p*f*n+3*v*c*o+d*h,y=x-_,b=T-m,x=_,T=m,l+=Math.sqrt(y*y+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=Ur._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 g=1,_=0;g<=l;++g)_=g/l,f=1-_,c=f*f,d=c*f,v=_*_,p=v*_,a.push(d*h+3*c*_*e+3*f*v*i+p*s,d*u+3*c*_*t+3*f*v*n+p*o)},r}(),Xm=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),g=2*f*p,_=2*Math.sqrt(d),m=c/p;return(g*v+p*c*(v-_)+(4*d*f-c*c)*Math.log((2*p+m+v)/(m+_)))/(4*g)},r.curveTo=function(e,t,i,n,s){for(var o=s[s.length-2],a=s[s.length-1],h=Ur._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}(),Hm=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}(),Li,Eo=(Li={},Li[Bt.POLY]=Nu,Li[Bt.CIRC]=Wn,Li[Bt.ELIP]=Wn,Li[Bt.RECT]=Lm,Li[Bt.RREC]=Bm,Li),Bu=[],Yn=[],Gu=function(){function r(e,t,i,n){t===void 0&&(t=null),i===void 0&&(i=null),n===void 0&&(n=null),this.points=[],this.holes=[],this.shape=e,this.lineStyle=i,this.fillStyle=t,this.matrix=n,this.type=e.type}return r.prototype.clone=function(){return new r(this.shape,this.fillStyle,this.lineStyle,this.matrix)},r.prototype.destroy=function(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null},r}(),rr=new Z,Wm=function(r){wo(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 Sn,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(),Yn.push(this.drawCalls[t]);this.drawCalls.length=0;for(var t=0;t<this.batches.length;t++){var i=this.batches[t];i.reset(),Bu.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 Gu(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 Gu(t,null,null,i),s=this.graphicsData[this.graphicsData.length-1];return n.lineStyle=s.lineStyle,s.holes.push(n),this.dirty++,this},e.prototype.destroy=function(){r.prototype.destroy.call(this);for(var t=0;t<this.graphicsData.length;++t)this.graphicsData[t].destroy();this.points.length=0,this.points=null,this.colors.length=0,this.colors=null,this.uvs.length=0,this.uvs=null,this.indices.length=0,this.indices=null,this.indexBuffer.destroy(),this.indexBuffer=null,this.graphicsData.length=0,this.graphicsData=null,this.drawCalls.length=0,this.drawCalls=null,this.batches.length=0,this.batches=null,this._bounds=null},e.prototype.containsPoint=function(t){for(var i=this.graphicsData,n=0;n<i.length;++n){var s=i[n];if(s.fillStyle.visible&&s.shape&&(s.matrix?s.matrix.applyInverse(t,rr):rr.copyFrom(t),s.shape.contains(rr.x,rr.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(rr.x,rr.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=Eo[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=Le.REPEAT,f===0?this.processFill(a):this.processLine(a);var g=this.points.length/2-p;g!==0&&(n&&!this._compareStyles(s,c)&&(n.end(v,p),n=null),n||(n=Bu.pop()||new Hm,n.begin(c,v,p),this.batches.push(n),s=c),this.addUvs(this.points,t,c.texture,p,g,c.matrix))}}}var _=this.indices.length,m=this.points.length/2;if(n&&n.end(_,m),this.batches.length===0){this.batchable=!0;return}var y=m>65535;this.indicesUint16&&this.indices.length===this.indicesUint16.length&&y===this.indicesUint16.BYTES_PER_ELEMENT>2?this.indicesUint16.set(this.indices):this.indicesUint16=y?new Uint32Array(this.indices):new Uint16Array(this.indices),this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()}},e.prototype._compareStyles=function(t,i){return!(!t||!i||t.texture.baseTexture!==i.texture.baseTexture||t.color+t.alpha!==i.color+i.alpha||!!t.native!=!!i.native)},e.prototype.validateBatching=function(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(var t=0,i=this.graphicsData.length;t<i;t++){var n=this.graphicsData[t],s=n.fillStyle,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=++et._globalBatch,i=0;i<this.drawCalls.length;i++)this.drawCalls[i].texArray.clear(),Yn.push(this.drawCalls[i]);this.drawCalls.length=0;var n=this.colors,s=this.textureIds,o=Yn.pop();o||(o=new oo,o.texArray=new ao),o.texArray.count=0,o.start=0,o.size=0,o.type=ye.TRIANGLES;var a=0,h=null,u=0,l=!1,f=ye.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,g=p.texture.baseTexture;l!==!!p.native&&(l=!!p.native,f=l?ye.LINES:ye.TRIANGLES,h=null,a=v,t++),h!==g&&(h=g,g._batchEnabled!==t&&(a===v&&(t++,a=0,o.size>0&&(o=Yn.pop(),o||(o=new oo,o.texArray=new ao),this.drawCalls.push(o)),o.start=c,o.size=0,o.texArray.count=0,o.type=f),g.touched=1,g._batchEnabled=t,g._batchLocation=a,g.wrapMode=Le.REPEAT,o.texArray.elements[o.texArray.count++]=g,a++)),o.size+=d.size,c+=d.size,u=g._batchLocation,this.addColors(n,p.color,p.alpha,d.attribSize,d.attribStart),this.addTextureIds(s,u,d.attribSize,d.attribStart)}et._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)Nu.triangulate(t,this);else{var i=Eo[t.type];i.triangulate(t,this)}},e.prototype.processLine=function(t){Fu(t,this);for(var i=0;i<t.holes.length;i++)Fu(t.holes[i],this)},e.prototype.processHoles=function(t){for(var i=0;i<t.length;i++){var n=t[i],s=Eo[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=ks(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),g=n+2;g<h;g+=2)v=Math.min(v,Math.floor(t[g]+a)),p=Math.min(p,Math.floor(t[g+1]+a));c-=v,d-=p;for(var g=n;g<h;g+=2)t[g]=(t[g]+c)*l,t[g+1]=(t[g+1]+d)*f},e.BATCHABLE_SIZE=100,e}(lu),zm=function(r){wo(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=li.BUTT,t.join=$e.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}(Iu),Ym=new Float32Array(3),So={},Ce=function(r){wo(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 Iu,i._lineStyle=new zm,i._matrix=null,i._holeMode=!1,i.state=Mi.for2d(),i._geometry=t||new Wm,i._geometry.refCount++,i._transformID=-1,i.tint=16777215,i.blendMode=H.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:V.WHITE,color:t&&t.texture?16777215:0,alpha:1,matrix:null,alignment:.5,native:!1,cap:li.BUTT,join:$e.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 ln,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[i-2],t[i-1]))}else this.currentPath=new ln,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),Xm.curveTo(t,i,n,s,o),this},e.prototype.bezierCurveTo=function(t,i,n,s,o,a){return this._initCurve(),km.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=Lu.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+=De:a&&s<=o&&(s+=De);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 Lu.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:V.WHITE,color:t,alpha:i})},e.prototype.beginTextureFill=function(t){t=Object.assign({texture:V.WHITE,color:16777215,alpha:1,matrix:null},t),this.currentPath&&this.startPoly();var i=t.alpha>0;return i?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._fillStyle,{visible:i},t)):this._fillStyle.reset(),this},e.prototype.endFill=function(){return this.finishPoly(),this._fillStyle.reset(),this},e.prototype.drawRect=function(t,i,n,s){return this.drawShape(new K(t,i,n,s))},e.prototype.drawRoundedRect=function(t,i,n,s,o){return this.drawShape(new Yf(t,i,n,s,o))},e.prototype.drawCircle=function(t,i,n){return this.drawShape(new Wf(t,i,n))},e.prototype.drawEllipse=function(t,i,n,s){return this.drawShape(new zf(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 ln(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===Bt.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:Ji(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(!So[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 Mt,default:Ii.from({uSamplers:o},!0)},u=t.plugins[n]._shader.program;So[n]=new ai(u,h)}i=So[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=Ji(this.tint,Ym),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 Z,e}(st);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 Vm(r,e){Po(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var kr=new Z,jm=new Uint16Array([0,1,2,0,2,3]),ht=function(r){Vm(e,r);function e(t){var i=r.call(this)||this;return i._anchor=new ji(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=H.NORMAL,i._cachedTint=16777215,i.uvs=null,i.texture=t||V.EMPTY,i.vertexData=new Float32Array(8),i.vertexTrimmedData=null,i._transformID=-1,i._textureID=-1,i._transformTrimmedID=-1,i._textureTrimmedID=-1,i.indices=jm,i.pluginName="batch",i.isSprite=!0,i._roundPixels=G.ROUND_PIXELS,i}return e.prototype._onTextureUpdate=function(){this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this._width&&(this.scale.x=tr(this.scale.x)*this._width/this._texture.orig.width),this._height&&(this.scale.y=tr(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,g=0,_=0;if(f?(p=f.x-d._x*c.width,v=p+f.width,_=f.y-d._y*c.height,g=_+f.height):(p=-d._x*c.width,v=p+c.width,_=-d._y*c.height,g=_+c.height),l[0]=n*p+o*_+h,l[1]=a*_+s*p+u,l[2]=n*v+o*_+h,l[3]=a*_+s*v+u,l[4]=n*v+o*g+h,l[5]=a*g+s*v+u,l[6]=n*p+o*g+h,l[7]=a*g+s*p+u,this._roundPixels)for(var m=G.RESOLUTION,y=0;y<l.length;++y)l[y]=Math.round((l[y]*m|0)/m)}},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,g=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*g+f,i[5]=l*g+h*v+c,i[6]=a*d+u*g+f,i[7]=l*g+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 Sn),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 K),t=this._localBoundsRect),this._localBounds.getRectangle(t)):r.prototype.getLocalBounds.call(this,t)},e.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,kr);var i=this._texture.orig.width,n=this._texture.orig.height,s=-i*this.anchor.x,o=0;return kr.x>=s&&kr.x<s+i&&(o=-n*this.anchor.y,kr.y>=o&&kr.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 V?t:V.from(t,i);return new e(n)},Object.defineProperty(e.prototype,"roundPixels",{get:function(){return this._roundPixels},set:function(t){this._roundPixels!==t&&(this._transformID=-1),this._roundPixels=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return Math.abs(this.scale.x)*this._texture.orig.width},set:function(t){var i=tr(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=tr(this.scale.y)||1;this.scale.y=i*t/this._texture.orig.height,this._height=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"anchor",{get:function(){return this._anchor},set:function(t){this._anchor.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tint",{get:function(){return this._tint},set:function(t){this._tint=t,this._tintRGB=(t>>16)+(t&65280)+((t&255)<<16)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"texture",{get:function(){return this._texture},set:function(t){this._texture!==t&&(this._texture&&this._texture.off("update",this._onTextureUpdate,this),this._texture=t||V.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,t&&(t.baseTexture.valid?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))},enumerable:!1,configurable:!0}),e}(st);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 Zm(r,e){Ro(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Xr;(function(r){r[r.LINEAR_VERTICAL=0]="LINEAR_VERTICAL",r[r.LINEAR_HORIZONTAL=1]="LINEAR_HORIZONTAL"})(Xr||(Xr={}));var Co={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:Xr.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},qm=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],fi=function(){function r(e){this.styleID=0,this.reset(),Ao(this,e,e)}return r.prototype.clone=function(){var e={};return Ao(e,this,Co),new r(e)},r.prototype.reset=function(){Ao(this,Co,Co)},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=Oo(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=Oo(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){Km(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=Oo(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)&&qm.indexOf(n)<0&&(n='"'+n+'"'),t[i]=n}return this.fontStyle+" "+this.fontVariant+" "+this.fontWeight+" "+e+" "+t.join(",")},r}();function Uu(r){return typeof r=="number"?Ph(r):(typeof r=="string"&&r.indexOf("0x")===0&&(r=r.replace("0x","#")),r)}function Oo(r){if(Array.isArray(r)){for(var e=0;e<r.length;++e)r[e]=Uu(r[e]);return r}else return Uu(r)}function Km(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 Ao(r,e,t){for(var i in t)Array.isArray(e[i])?r[i]=e[i].slice():r[i]=e[i]}var Vn={willReadFrequently:!0},ce=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",Vn);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,g=Math.max(p,o.fontSize+t.strokeThickness)+(u.length-1)*(p+t.leading);return t.dropShadow&&(g+=t.dropShadowDistance),new r(e,t,v,g,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",Vn),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),g=0;g<p.length;g++){var _=p[g];if(r.isNewline(_)){if(!c){a+=r.addLine(o),d=!f,o="",s=0;continue}_=" "}if(f){var m=r.isBreakingSpace(_),y=r.isBreakingSpace(o[o.length-1]);if(m&&y)continue}var b=r.getFromCache(_,u,h,n);if(b>v)if(o!==""&&(a+=r.addLine(o),o="",s=0),r.canBreakWords(_,t.breakWords))for(var x=r.wordWrapSplit(_),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,_,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 M=g===p.length-1;a+=r.addLine(_,!M),d=!1,o="",s=0}else b+s>v&&(d=!1,a+=r.addLine(o),o="",s=0),(o.length>0||!r.isBreakingSpace(_)||d)&&(o+=_,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+`
|
|
528
|
+
`,Fm=function(r){Ou(e,r);function e(t){var i=r.call(this,t)||this;return i.shader=null,i.properties=null,i.tempMatrix=new Mt,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:X.UNSIGNED_BYTE,uploadFunction:i.uploadTint,offset:0}],i.shader=ai.from(Dm,Nm,{}),i.state=Mi.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=Oh(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=qv(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 g=a-v;g>s&&(g=s),p>=h.length&&h.push(this._generateOneMoreBuffer(t));var _=h[p];_.uploadDynamic(i,v,g);var m=t._bufferUpdateIDs[p]||0;d=d||_._updateID<m,d&&(_._updateID=t._updateID,_.uploadStatic(i,v,g)),o.geometry.bind(_.geometry),f.drawElements(f.TRIANGLES,g*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 Au(this.properties,o,s));return i},e.prototype._generateOneMoreBuffer=function(t){var i=t._batchSize,n=t._properties;return new Au(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,g=d.scale.y,_=v.trim,m=v.orig;_?(u=_.x-d.anchor.x*m.width,h=u+_.width,f=_.y-d.anchor.y*m.height,l=f+_.height):(h=m.width*(1-d.anchor.x),u=m.width*-d.anchor.x,l=m.height*(1-d.anchor.y),f=m.height*-d.anchor.y),s[a]=u*p,s[a+1]=f*g,s[a+o]=h*p,s[a+o+1]=f*g,s[a+o*2]=h*p,s[a+o*2+1]=l*g,s[a+o*3]=u*p,s[a+o*3+1]=l*g,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?ks(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:ot.RendererPlugin},e}(Cn);var $e;(function(r){r.MITER="miter",r.BEVEL="bevel",r.ROUND="round"})($e||($e={}));var li;(function(r){r.BUTT="butt",r.ROUND="round",r.SQUARE="square"})(li||(li={}));var Ur={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}},Iu=function(){function r(){this.color=16777215,this.alpha=1,this.texture=V.WHITE,this.matrix=null,this.visible=!1,this.reset()}return r.prototype.clone=function(){var e=new r;return e.color=this.color,e.alpha=this.alpha,e.texture=this.texture,e.matrix=this.matrix,e.visible=this.visible,e},r.prototype.reset=function(){this.color=16777215,this.alpha=1,this.texture=V.WHITE,this.matrix=null,this.visible=!1},r.prototype.destroy=function(){this.texture=null,this.matrix=null},r}();var To=function(r,e){return To=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])},To(r,e)};function wo(r,e){To(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function Mu(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 Nu={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){Mu(t,!1);for(var o=[],a=0;a<i.length;a++){var h=i[a];Mu(h.points,!0),o.push(t.length/2),t=t.concat(h.points)}var u=gn.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])}}},Wn={build:function(r){var e=r.points,t,i,n,s,o,a;if(r.type===Bt.CIRC){var h=r.shape;t=h.x,i=h.y,o=a=h.radius,n=s=0}else if(r.type===Bt.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,g=d*4+(n?2:0)+2,_=g,m=v;{var y=n+o,b=s,x=t+y,T=t-y,w=i+b;if(e[p++]=x,e[p++]=w,e[--g]=w,e[--g]=T,s){var S=i-b;e[_++]=T,e[_++]=S,e[--m]=S,e[--m]=x}}for(var E=1;E<d;E++){var P=Math.PI/2*(E/d),y=n+Math.cos(P)*o,b=s+Math.sin(P)*a,x=t+y,T=t-y,w=i+b,S=i-b;e[p++]=x,e[p++]=w,e[--g]=w,e[--g]=T,e[_++]=T,e[_++]=S,e[--m]=S,e[--m]=x}{var y=n,b=s+a,x=t+y,T=t-y,w=i+b,S=i-b;e[p++]=x,e[p++]=w,e[--m]=S,e[--m]=x,n&&(e[p++]=T,e[p++]=w,e[--m]=S,e[--m]=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!==Bt.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)}}},Lm={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 ir(r,e,t){var i=e-r;return r+i*t}function zn(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,g=0;p<=a;++p)g=p/a,u=ir(r,t,g),l=ir(e,i,g),f=ir(t,n,g),c=ir(i,s,g),d=ir(u,f,g),v=ir(l,c,g),!(p===0&&h[h.length-2]===d&&h[h.length-1]===v)&&h.push(d,v);return h}var Bm={build:function(r){if(Ce.nextRoundedRectBehavior){Wn.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?(zn(i,n+a,i,n,i+a,n,t),zn(i+s-a,n,i+s,n,i+s,n+a,t),zn(i+s,n+o-a,i+s,n+o,i+s-a,n+o,t),zn(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(Ce.nextRoundedRectBehavior){Wn.triangulate(r,e);return}for(var t=r.points,i=e.points,n=e.indices,s=i.length/2,o=gn.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 Du(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,g=l+c,_=f+d;return a.push(v,p),a.push(g,_),2}function Fi(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),g=(15*v*Math.sqrt(p)/Math.PI>>0)+1,_=d/g;if(c+=_,a){o.push(r,e),o.push(t,i);for(var m=1,y=c;m<g;m++,y+=_)o.push(r,e),o.push(r+Math.sin(y)*p,e+Math.cos(y)*p);o.push(r,e),o.push(n,s)}else{o.push(t,i),o.push(r,e);for(var m=1,y=c;m<g;m++,y+=_)o.push(r+Math.sin(y)*p,e+Math.cos(y)*p),o.push(r,e);o.push(n,s),o.push(r,e)}return g*2}function Gm(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 Z(i[0],i[1]),a=new Z(i[i.length-2],i[i.length-1]),h=t.type!==Bt.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,g=s.width/2,_=g*g,m=s.miterLimit*s.miterLimit,y=i[0],b=i[1],x=i[2],T=i[3],w=0,S=0,E=-(b-T),P=y-x,O=0,M=0,L=Math.sqrt(E*E+P*P);E/=L,P/=L,E*=g,P*=g;var B=s.alignment,A=(1-B)*2,I=B*2;h||(s.cap===li.ROUND?v+=Fi(y-E*(A-I)*.5,b-P*(A-I)*.5,y-E*A,b-P*A,y+E*I,b+P*I,c,!0)+2:s.cap===li.SQUARE&&(v+=Du(y,b,E,P,A,I,!0,c))),c.push(y-E*A,b-P*A),c.push(y+E*I,b+P*I);for(var F=1;F<d-1;++F){y=i[(F-1)*2],b=i[(F-1)*2+1],x=i[F*2],T=i[F*2+1],w=i[(F+1)*2],S=i[(F+1)*2+1],E=-(b-T),P=y-x,L=Math.sqrt(E*E+P*P),E/=L,P/=L,E*=g,P*=g,O=-(T-S),M=x-w,L=Math.sqrt(O*O+M*M),O/=L,M/=L,O*=g,M*=g;var Y=x-y,z=b-T,N=x-w,C=S-T,U=Y*N+z*C,$=z*N-C*Y,j=$<0;if(Math.abs($)<.001*Math.abs(U)){c.push(x-E*A,T-P*A),c.push(x+E*I,T+P*I),U>=0&&(s.join===$e.ROUND?v+=Fi(x,T,x-E*A,T-P*A,x-O*A,T-M*A,c,!1)+4:v+=2,c.push(x-O*I,T-M*I),c.push(x+O*A,T+M*A));continue}var it=(-E+y)*(-P+T)-(-E+x)*(-P+b),vt=(-O+w)*(-M+T)-(-O+x)*(-M+S),ft=(Y*vt-N*it)/$,It=(C*it-z*vt)/$,Lt=(ft-x)*(ft-x)+(It-T)*(It-T),xt=x+(ft-x)*A,rt=T+(It-T)*A,ct=x-(ft-x)*I,at=T-(It-T)*I,J=Math.min(Y*Y+z*z,N*N+C*C),kt=j?A:I,qt=J+kt*kt*_,k=Lt<=qt;k?s.join===$e.BEVEL||Lt/_>m?(j?(c.push(xt,rt),c.push(x+E*I,T+P*I),c.push(xt,rt),c.push(x+O*I,T+M*I)):(c.push(x-E*A,T-P*A),c.push(ct,at),c.push(x-O*A,T-M*A),c.push(ct,at)),v+=2):s.join===$e.ROUND?j?(c.push(xt,rt),c.push(x+E*I,T+P*I),v+=Fi(x,T,x+E*I,T+P*I,x+O*I,T+M*I,c,!0)+4,c.push(xt,rt),c.push(x+O*I,T+M*I)):(c.push(x-E*A,T-P*A),c.push(ct,at),v+=Fi(x,T,x-E*A,T-P*A,x-O*A,T-M*A,c,!1)+4,c.push(x-O*A,T-M*A),c.push(ct,at)):(c.push(xt,rt),c.push(ct,at)):(c.push(x-E*A,T-P*A),c.push(x+E*I,T+P*I),s.join===$e.ROUND?j?v+=Fi(x,T,x+E*I,T+P*I,x+O*I,T+M*I,c,!0)+2:v+=Fi(x,T,x-E*A,T-P*A,x-O*A,T-M*A,c,!1)+2:s.join===$e.MITER&&Lt/_<=m&&(j?(c.push(ct,at),c.push(ct,at)):(c.push(xt,rt),c.push(xt,rt)),v+=2),c.push(x-O*A,T-M*A),c.push(x+O*I,T+M*I),v+=2)}y=i[(d-2)*2],b=i[(d-2)*2+1],x=i[(d-1)*2],T=i[(d-1)*2+1],E=-(b-T),P=y-x,L=Math.sqrt(E*E+P*P),E/=L,P/=L,E*=g,P*=g,c.push(x-E*A,T-P*A),c.push(x+E*I,T+P*I),h||(s.cap===li.ROUND?v+=Fi(x-E*(A-I)*.5,T-P*(A-I)*.5,x-E*A,T-P*A,x+E*I,T+P*I,c,!1)+2:s.cap===li.SQUARE&&(v+=Du(x,T,E,P,A,I,!1,c)));for(var dt=e.indices,Wt=Ur.epsilon*Ur.epsilon,F=p;F<v+p-2;++F)y=c[F*2],b=c[F*2+1],x=c[(F+1)*2],T=c[(F+1)*2+1],w=c[(F+2)*2],S=c[(F+2)*2+1],!(Math.abs(y*(T-S)+x*(S-b)+w*(b-T))<Wt)&&dt.push(F,F+1,F+2)}}function Um(r,e){var t=0,i=r.shape,n=r.points||i.points,s=i.type!==Bt.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 Fu(r,e){r.lineStyle.native?Um(r,e):Gm(r,e)}var Lu=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,g=u*f+l*c,_=s*Math.sqrt(v)/d,m=s*Math.sqrt(p)/d,y=_*g/v,b=m*g/p,x=_*c+m*l,T=_*f+m*u,w=l*(m+y),S=u*(m+y),E=c*(_+b),P=f*(_+b),O=Math.atan2(S-T,w-x),M=Math.atan2(P-T,E-x);return{cx:x+e,cy:T+t,radius:s,startAngle:O,endAngle:M,anticlockwise:l*f>c*u}},r.arc=function(e,t,i,n,s,o,a,h,u){for(var l=a-o,f=Ur._segmentsCount(Math.abs(l)*s,Math.ceil(Math.abs(l)/De)*40),c=l/(f*2),d=c*2,v=Math.cos(c),p=Math.sin(c),g=f-1,_=g%1/g,m=0;m<=g;++m){var y=m+_*m,b=c+o+d*y,x=Math.cos(b),T=-Math.sin(b);u.push((v*x+p*T)*s+i,(v*-T+p*x)*s+n)}},r}(),km=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,g=0,_=0,m=0,y=0,b=0,x=e,T=t,w=1;w<=u;++w)f=w/u,c=f*f,d=c*f,v=1-f,p=v*v,g=p*v,_=g*e+3*p*f*i+3*v*c*s+d*a,m=g*t+3*p*f*n+3*v*c*o+d*h,y=x-_,b=T-m,x=_,T=m,l+=Math.sqrt(y*y+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=Ur._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 g=1,_=0;g<=l;++g)_=g/l,f=1-_,c=f*f,d=c*f,v=_*_,p=v*_,a.push(d*h+3*c*_*e+3*f*v*i+p*s,d*u+3*c*_*t+3*f*v*n+p*o)},r}(),Xm=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),g=2*f*p,_=2*Math.sqrt(d),m=c/p;return(g*v+p*c*(v-_)+(4*d*f-c*c)*Math.log((2*p+m+v)/(m+_)))/(4*g)},r.curveTo=function(e,t,i,n,s){for(var o=s[s.length-2],a=s[s.length-1],h=Ur._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}(),Hm=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}(),Li,Eo=(Li={},Li[Bt.POLY]=Nu,Li[Bt.CIRC]=Wn,Li[Bt.ELIP]=Wn,Li[Bt.RECT]=Lm,Li[Bt.RREC]=Bm,Li),Bu=[],Yn=[],Gu=function(){function r(e,t,i,n){t===void 0&&(t=null),i===void 0&&(i=null),n===void 0&&(n=null),this.points=[],this.holes=[],this.shape=e,this.lineStyle=i,this.fillStyle=t,this.matrix=n,this.type=e.type}return r.prototype.clone=function(){return new r(this.shape,this.fillStyle,this.lineStyle,this.matrix)},r.prototype.destroy=function(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null},r}(),rr=new Z,Wm=function(r){wo(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 Sn,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(),Yn.push(this.drawCalls[t]);this.drawCalls.length=0;for(var t=0;t<this.batches.length;t++){var i=this.batches[t];i.reset(),Bu.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 Gu(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 Gu(t,null,null,i),s=this.graphicsData[this.graphicsData.length-1];return n.lineStyle=s.lineStyle,s.holes.push(n),this.dirty++,this},e.prototype.destroy=function(){r.prototype.destroy.call(this);for(var t=0;t<this.graphicsData.length;++t)this.graphicsData[t].destroy();this.points.length=0,this.points=null,this.colors.length=0,this.colors=null,this.uvs.length=0,this.uvs=null,this.indices.length=0,this.indices=null,this.indexBuffer.destroy(),this.indexBuffer=null,this.graphicsData.length=0,this.graphicsData=null,this.drawCalls.length=0,this.drawCalls=null,this.batches.length=0,this.batches=null,this._bounds=null},e.prototype.containsPoint=function(t){for(var i=this.graphicsData,n=0;n<i.length;++n){var s=i[n];if(s.fillStyle.visible&&s.shape&&(s.matrix?s.matrix.applyInverse(t,rr):rr.copyFrom(t),s.shape.contains(rr.x,rr.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(rr.x,rr.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=Eo[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=Le.REPEAT,f===0?this.processFill(a):this.processLine(a);var g=this.points.length/2-p;g!==0&&(n&&!this._compareStyles(s,c)&&(n.end(v,p),n=null),n||(n=Bu.pop()||new Hm,n.begin(c,v,p),this.batches.push(n),s=c),this.addUvs(this.points,t,c.texture,p,g,c.matrix))}}}var _=this.indices.length,m=this.points.length/2;if(n&&n.end(_,m),this.batches.length===0){this.batchable=!0;return}var y=m>65535;this.indicesUint16&&this.indices.length===this.indicesUint16.length&&y===this.indicesUint16.BYTES_PER_ELEMENT>2?this.indicesUint16.set(this.indices):this.indicesUint16=y?new Uint32Array(this.indices):new Uint16Array(this.indices),this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()}},e.prototype._compareStyles=function(t,i){return!(!t||!i||t.texture.baseTexture!==i.texture.baseTexture||t.color+t.alpha!==i.color+i.alpha||!!t.native!=!!i.native)},e.prototype.validateBatching=function(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(var t=0,i=this.graphicsData.length;t<i;t++){var n=this.graphicsData[t],s=n.fillStyle,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=++et._globalBatch,i=0;i<this.drawCalls.length;i++)this.drawCalls[i].texArray.clear(),Yn.push(this.drawCalls[i]);this.drawCalls.length=0;var n=this.colors,s=this.textureIds,o=Yn.pop();o||(o=new oo,o.texArray=new ao),o.texArray.count=0,o.start=0,o.size=0,o.type=ye.TRIANGLES;var a=0,h=null,u=0,l=!1,f=ye.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,g=p.texture.baseTexture;l!==!!p.native&&(l=!!p.native,f=l?ye.LINES:ye.TRIANGLES,h=null,a=v,t++),h!==g&&(h=g,g._batchEnabled!==t&&(a===v&&(t++,a=0,o.size>0&&(o=Yn.pop(),o||(o=new oo,o.texArray=new ao),this.drawCalls.push(o)),o.start=c,o.size=0,o.texArray.count=0,o.type=f),g.touched=1,g._batchEnabled=t,g._batchLocation=a,g.wrapMode=Le.REPEAT,o.texArray.elements[o.texArray.count++]=g,a++)),o.size+=d.size,c+=d.size,u=g._batchLocation,this.addColors(n,p.color,p.alpha,d.attribSize,d.attribStart),this.addTextureIds(s,u,d.attribSize,d.attribStart)}et._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)Nu.triangulate(t,this);else{var i=Eo[t.type];i.triangulate(t,this)}},e.prototype.processLine=function(t){Fu(t,this);for(var i=0;i<t.holes.length;i++)Fu(t.holes[i],this)},e.prototype.processHoles=function(t){for(var i=0;i<t.length;i++){var n=t[i],s=Eo[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=ks(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),g=n+2;g<h;g+=2)v=Math.min(v,Math.floor(t[g]+a)),p=Math.min(p,Math.floor(t[g+1]+a));c-=v,d-=p;for(var g=n;g<h;g+=2)t[g]=(t[g]+c)*l,t[g+1]=(t[g+1]+d)*f},e.BATCHABLE_SIZE=100,e}(lu),zm=function(r){wo(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=li.BUTT,t.join=$e.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}(Iu),Ym=new Float32Array(3),So={},Ce=function(r){wo(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 Iu,i._lineStyle=new zm,i._matrix=null,i._holeMode=!1,i.state=Mi.for2d(),i._geometry=t||new Wm,i._geometry.refCount++,i._transformID=-1,i.tint=16777215,i.blendMode=W.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:V.WHITE,color:t&&t.texture?16777215:0,alpha:1,matrix:null,alignment:.5,native:!1,cap:li.BUTT,join:$e.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 ln,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[i-2],t[i-1]))}else this.currentPath=new ln,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),Xm.curveTo(t,i,n,s,o),this},e.prototype.bezierCurveTo=function(t,i,n,s,o,a){return this._initCurve(),km.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=Lu.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+=De:a&&s<=o&&(s+=De);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 Lu.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:V.WHITE,color:t,alpha:i})},e.prototype.beginTextureFill=function(t){t=Object.assign({texture:V.WHITE,color:16777215,alpha:1,matrix:null},t),this.currentPath&&this.startPoly();var i=t.alpha>0;return i?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._fillStyle,{visible:i},t)):this._fillStyle.reset(),this},e.prototype.endFill=function(){return this.finishPoly(),this._fillStyle.reset(),this},e.prototype.drawRect=function(t,i,n,s){return this.drawShape(new K(t,i,n,s))},e.prototype.drawRoundedRect=function(t,i,n,s,o){return this.drawShape(new Yf(t,i,n,s,o))},e.prototype.drawCircle=function(t,i,n){return this.drawShape(new Wf(t,i,n))},e.prototype.drawEllipse=function(t,i,n,s){return this.drawShape(new zf(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 ln(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===Bt.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:Ji(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(!So[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 Mt,default:Ii.from({uSamplers:o},!0)},u=t.plugins[n]._shader.program;So[n]=new ai(u,h)}i=So[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=Ji(this.tint,Ym),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 Z,e}(st);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 Vm(r,e){Po(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var kr=new Z,jm=new Uint16Array([0,1,2,0,2,3]),ht=function(r){Vm(e,r);function e(t){var i=r.call(this)||this;return i._anchor=new ji(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=W.NORMAL,i._cachedTint=16777215,i.uvs=null,i.texture=t||V.EMPTY,i.vertexData=new Float32Array(8),i.vertexTrimmedData=null,i._transformID=-1,i._textureID=-1,i._transformTrimmedID=-1,i._textureTrimmedID=-1,i.indices=jm,i.pluginName="batch",i.isSprite=!0,i._roundPixels=G.ROUND_PIXELS,i}return e.prototype._onTextureUpdate=function(){this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this._width&&(this.scale.x=tr(this.scale.x)*this._width/this._texture.orig.width),this._height&&(this.scale.y=tr(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,g=0,_=0;if(f?(p=f.x-d._x*c.width,v=p+f.width,_=f.y-d._y*c.height,g=_+f.height):(p=-d._x*c.width,v=p+c.width,_=-d._y*c.height,g=_+c.height),l[0]=n*p+o*_+h,l[1]=a*_+s*p+u,l[2]=n*v+o*_+h,l[3]=a*_+s*v+u,l[4]=n*v+o*g+h,l[5]=a*g+s*v+u,l[6]=n*p+o*g+h,l[7]=a*g+s*p+u,this._roundPixels)for(var m=G.RESOLUTION,y=0;y<l.length;++y)l[y]=Math.round((l[y]*m|0)/m)}},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,g=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*g+f,i[5]=l*g+h*v+c,i[6]=a*d+u*g+f,i[7]=l*g+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 Sn),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 K),t=this._localBoundsRect),this._localBounds.getRectangle(t)):r.prototype.getLocalBounds.call(this,t)},e.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,kr);var i=this._texture.orig.width,n=this._texture.orig.height,s=-i*this.anchor.x,o=0;return kr.x>=s&&kr.x<s+i&&(o=-n*this.anchor.y,kr.y>=o&&kr.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 V?t:V.from(t,i);return new e(n)},Object.defineProperty(e.prototype,"roundPixels",{get:function(){return this._roundPixels},set:function(t){this._roundPixels!==t&&(this._transformID=-1),this._roundPixels=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return Math.abs(this.scale.x)*this._texture.orig.width},set:function(t){var i=tr(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=tr(this.scale.y)||1;this.scale.y=i*t/this._texture.orig.height,this._height=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"anchor",{get:function(){return this._anchor},set:function(t){this._anchor.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tint",{get:function(){return this._tint},set:function(t){this._tint=t,this._tintRGB=(t>>16)+(t&65280)+((t&255)<<16)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"texture",{get:function(){return this._texture},set:function(t){this._texture!==t&&(this._texture&&this._texture.off("update",this._onTextureUpdate,this),this._texture=t||V.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,t&&(t.baseTexture.valid?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))},enumerable:!1,configurable:!0}),e}(st);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 Zm(r,e){Ro(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Xr;(function(r){r[r.LINEAR_VERTICAL=0]="LINEAR_VERTICAL",r[r.LINEAR_HORIZONTAL=1]="LINEAR_HORIZONTAL"})(Xr||(Xr={}));var Co={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:Xr.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},qm=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],fi=function(){function r(e){this.styleID=0,this.reset(),Ao(this,e,e)}return r.prototype.clone=function(){var e={};return Ao(e,this,Co),new r(e)},r.prototype.reset=function(){Ao(this,Co,Co)},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=Oo(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=Oo(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){Km(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=Oo(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)&&qm.indexOf(n)<0&&(n='"'+n+'"'),t[i]=n}return this.fontStyle+" "+this.fontVariant+" "+this.fontWeight+" "+e+" "+t.join(",")},r}();function Uu(r){return typeof r=="number"?Ph(r):(typeof r=="string"&&r.indexOf("0x")===0&&(r=r.replace("0x","#")),r)}function Oo(r){if(Array.isArray(r)){for(var e=0;e<r.length;++e)r[e]=Uu(r[e]);return r}else return Uu(r)}function Km(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 Ao(r,e,t){for(var i in t)Array.isArray(e[i])?r[i]=e[i].slice():r[i]=e[i]}var Vn={willReadFrequently:!0},ce=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",Vn);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,g=Math.max(p,o.fontSize+t.strokeThickness)+(u.length-1)*(p+t.leading);return t.dropShadow&&(g+=t.dropShadowDistance),new r(e,t,v,g,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",Vn),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),g=0;g<p.length;g++){var _=p[g];if(r.isNewline(_)){if(!c){a+=r.addLine(o),d=!f,o="",s=0;continue}_=" "}if(f){var m=r.isBreakingSpace(_),y=r.isBreakingSpace(o[o.length-1]);if(m&&y)continue}var b=r.getFromCache(_,u,h,n);if(b>v)if(o!==""&&(a+=r.addLine(o),o="",s=0),r.canBreakWords(_,t.breakWords))for(var x=r.wordWrapSplit(_),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,_,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 M=g===p.length-1;a+=r.addLine(_,!M),d=!1,o="",s=0}else b+s>v&&(d=!1,a+=r.addLine(o),o="",s=0),(o.length>0||!r.isBreakingSpace(_)||d)&&(o+=_,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
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",Vn);if(i&&i.measureText)return r.__canvas=t,t;e=G.ADAPTER.createCanvas()}catch{e=G.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",Vn)),r.__context},enumerable:!1,configurable:!0}),r}();ce._fonts={},ce.METRICS_STRING="|ÉqÅ",ce.BASELINE_SYMBOL="M",ce.BASELINE_MULTIPLIER=1.4,ce.HEIGHT_MULTIPLIER=2,ce._newlines=[10,13],ce._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];var $m={texture:!0,children:!1,baseTexture:!0},ku=function(r){Zm(e,r);function e(t,i,n){var s=this,o=!1;n||(n=G.ADAPTER.createCanvas(),o=!0),n.width=3,n.height=3;var a=V.from(n);return a.orig=new K,a.trim=new K,s=r.call(this,a)||this,s._ownCanvas=o,s.canvas=n,s.context=n.getContext("2d",{willReadFrequently:!0}),s._resolution=G.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=ce.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,g=0;g<p;++g){var _=i.dropShadow&&g===0,m=_?Math.ceil(Math.max(1,a)+i.padding*2):0,y=m*this._resolution;if(_){n.fillStyle="black",n.strokeStyle="black";var b=i.dropShadowColor,x=Ji(typeof b=="number"?b:Rh(b)),T=i.dropShadowBlur*this._resolution,w=i.dropShadowDistance*this._resolution;n.shadowColor="rgba("+x[0]*255+","+x[1]*255+","+x[2]*255+","+i.dropShadowAlpha+")",n.shadowBlur=T,n.shadowOffsetX=Math.cos(i.dropShadowAngle)*w,n.shadowOffsetY=Math.sin(i.dropShadowAngle)*w+y}else n.fillStyle=this._generateFillStyle(i,h,s),n.strokeStyle=i.stroke,n.shadowColor="black",n.shadowBlur=0,n.shadowOffsetX=0,n.shadowOffsetY=0;var S=(u-c.fontSize)/2;(!e.nextLineHeightBehavior||u-c.fontSize<0)&&(S=0);for(var E=0;E<h.length;E++)d=i.strokeThickness/2,v=i.strokeThickness/2+E*u+c.ascent+S,i.align==="right"?d+=f-l[E]:i.align==="center"&&(d+=(f-l[E])/2),i.stroke&&i.strokeThickness&&this.drawLetterSpacing(h[E],d+i.padding,v+i.padding-m,!0),i.fill&&this.drawLetterSpacing(h[E],d+i.padding,v+i.padding-m)}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="",g=d+1;g<l.length;++g)p+=l[g];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===Xr.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 g=n.lineHeight*(v-1)+p,_=n.lineHeight*v,m=_;v>0&&g>_&&(m=(_+g)/2);var y=_+p,b=n.lineHeight*(v+1),x=y;v+1<i.length&&b<y&&(x=(y+b)/2);for(var T=(x-m)/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,m/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 M=void 0;typeof c[v]=="number"?M=c[v]:M=O/P,o.addColorStop(M,f[v]),O++}}return o},e.prototype.destroy=function(t){typeof t=="boolean"&&(t={children:t}),t=Object.assign({},$m,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=tr(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=tr(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 fi?this._style=t:this._style=new fi(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}(ht);G.UPLOADS_PER_FRAME=4;var Io=function(r,e){return Io=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])},Io(r,e)};function Jm(r,e){Io(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Qm=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 ty(r,e){var t=!1;if(r&&r._textures&&r._textures.length){for(var i=0;i<r._textures.length;i++)if(r._textures[i]instanceof V){var n=r._textures[i].baseTexture;e.indexOf(n)===-1&&(e.push(n),t=!0)}}return t}function ey(r,e){if(r.baseTexture instanceof et){var t=r.baseTexture;return e.indexOf(t)===-1&&e.push(t),!0}return!1}function iy(r,e){if(r._texture&&r._texture instanceof V){var t=r._texture.baseTexture;return e.indexOf(t)===-1&&e.push(t),!0}return!1}function ry(r,e){return e instanceof ku?(e.updateText(!0),!0):!1}function ny(r,e){if(e instanceof fi){var t=e.toFontString();return ce.measureFont(t),!0}return!1}function sy(r,e){if(r instanceof ku){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 oy(r,e){return r instanceof fi?(e.indexOf(r)===-1&&e.push(r),!0):!1}var ay=function(){function r(e){var t=this;this.limiter=new Qm(G.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(sy),this.registerFindHook(oy),this.registerFindHook(ty),this.registerFindHook(ey),this.registerFindHook(iy),this.registerUploadHook(ry),this.registerUploadHook(ny)}return r.prototype.upload=function(e,t){var i=this;return typeof e=="function"&&(t=e,e=null),t&&Ee("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,Gt.system.addOnce(i.tick,i,re.UTILITY))):s()})},r.prototype.tick=function(){setTimeout(this.delayedTick,0)},r.prototype.prepareItems=function(){for(this.limiter.beginFrame();this.queue.length&&this.limiter.allowedToUpload();){var e=this.queue[0],t=!1;if(e&&!e._destroyed){for(var i=0,n=this.uploadHooks.length;i<n;i++)if(this.uploadHooks[i](this.uploadHookHelper,e)){this.queue.shift(),t=!0;break}}t||this.queue.shift()}if(this.queue.length)Gt.system.addOnce(this.tick,this,re.UTILITY);else{this.ticking=!1;var s=this.completes.slice(0);this.completes.length=0;for(var i=0,n=s.length;i<n;i++)s[i]()}},r.prototype.registerFindHook=function(e){return e&&this.addHooks.push(e),this},r.prototype.registerUploadHook=function(e){return e&&this.uploadHooks.push(e),this},r.prototype.add=function(e){for(var t=0,i=this.addHooks.length;t<i&&!this.addHooks[t](e,this.queue);t++);if(e instanceof st)for(var t=e.children.length-1;t>=0;t--)this.add(e.children[t]);return this},r.prototype.destroy=function(){this.ticking&&Gt.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 Xu(r,e){return e instanceof et?(e._glTextures[r.CONTEXT_UID]||r.texture.bind(e),!0):!1}function hy(r,e){if(!(e instanceof Ce))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&&Xu(r,s.baseTexture)}return t.batchable||r.geometry.bind(t,e._resolveDirectShader(r)),!0}function uy(r,e){return r instanceof Ce?(e.push(r),!0):!1}var ly=function(r){Jm(e,r);function e(t){var i=r.call(this,t)||this;return i.uploadHookHelper=i.renderer,i.registerFindHook(uy),i.registerUploadHook(Xu),i.registerUploadHook(hy),i}return e.extension={name:"prepare",type:ot.RendererPlugin},e}(ay);var fy=function(){function r(e,t,i){i===void 0&&(i=null),this.linkedSheets=[],this._texture=e instanceof V?e:null,this.baseTexture=e instanceof et?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=En(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&&Ee("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 K(0,0,Math.floor(u.w)/this.resolution,Math.floor(u.h)/this.resolution);s.rotated?a=new K(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 K(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 K(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 V(this.baseTexture,a,l,h,s.rotated?2:0,s.anchor),V.addToCache(this.textures[n],n)}t++}},r.prototype._processAnimations=function(){var e=this.data.animations||{};for(var t in e){this.animations[t]=[];for(var i=0;i<e[t].length;i++){var n=e[t][i];this.animations[t].push(this.textures[n])}}},r.prototype._parseComplete=function(){var e=this._callback;this._callback=null,this._batchIndex=0,e.call(this,this.textures)},r.prototype._nextBatch=function(){var e=this;this._processFrames(this._batchIndex*r.BATCH_SIZE),this._batchIndex++,setTimeout(function(){e._batchIndex*r.BATCH_SIZE<e._frameKeys.length?e._nextBatch():(e._processAnimations(),e._parseComplete())},0)},r.prototype.destroy=function(e){var t;e===void 0&&(e=!1);for(var i in this.textures)this.textures[i].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,e&&((t=this._texture)===null||t===void 0||t.destroy(),this.baseTexture.destroy()),this._texture=null,this.baseTexture=null,this.linkedSheets=[]},r.BATCH_SIZE=1e3,r}(),cy=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",""),g=$i.resolve(e.url.replace(s.baseUrl,""),v);if(s.resources[p]||Object.values(s.resources).some(function(m){return $i.format($i.parse(m.url))===g}))return"continue";var _={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 g=new fy(p.texture,e.data,e.url);g.parse().then(function(){e.spritesheet=g,e.textures=g.textures,t()})})},r.getResourcePath=function(e,t){return e.isDataUrl?e.data.meta.image:$i.resolve(e.url.replace(t,""),e.data.meta.image)},r.extension=ot.Loader,r}();var Mo=function(r,e){return Mo=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])},Mo(r,e)};function Hu(r,e){Mo(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Hr=new Z;(function(r){Hu(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 Ya,s._width=i,s._height=n,s.uvMatrix=s.texture.uvMatrix||new ro(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 K),t=this._localBoundsRect),this._bounds.getRectangle(t)):r.prototype.getLocalBounds.call(this,t)},e.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,Hr);var i=this._width,n=this._height,s=-i*this.anchor._x;if(Hr.x>=s&&Hr.x<s+i){var o=-n*this.anchor._y;if(Hr.y>=o&&Hr.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 V?t:V.from(t,i);return new e(n,i.width,i.height)},Object.defineProperty(e.prototype,"width",{get:function(){return this._width},set:function(t){this._width=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._height},set:function(t){this._height=t},enumerable:!1,configurable:!0}),e})(ht);var dy=`#version 100
|
|
530
530
|
#define SHADER_NAME Tiling-Sprite-Simple-100
|
|
531
531
|
|
|
@@ -717,7 +717,7 @@ void main(void)\r
|
|
|
717
717
|
`,ju=[],Zu=[],qu=[],$n=function(r){by(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(!St.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 ji(function(){n.dirty=!0},n,0,0),n._roundPixels=G.ROUND_PIXELS,n.dirty=!0,n._resolution=G.RESOLUTION,n._autoResolution=!0,n._textureCache={},n}return e.prototype.updateText=function(){for(var t,i=St.available[this._fontName],n=this.fontSize,s=n/i.size,o=new Z,a=[],h=[],u=[],l=this._text.replace(/(?:\r\n|\r)/g,`
|
|
718
718
|
`)||" ",f=Vu(l),c=this._maxWidth*i.size/n,d=i.distanceFieldType==="none"?ju:Zu,v=null,p=0,g=0,_=0,m=-1,y=0,b=0,x=0,T=0,w=0;w<f.length;w++){var S=f[w],E=Kn(S);if(/(?:\s)/.test(S)&&(m=w,y=p,T++),S==="\r"||S===`
|
|
719
719
|
`){h.push(p),u.push(-1),g=Math.max(g,p),++_,++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=qu.pop()||{texture:V.EMPTY,line:0,charCode:0,prevSpaces:0,position:new Z};O.texture=P.texture,O.line=_,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,m!==-1&&c>0&&o.x>c&&(++b,Qi(a,1+m-b,1+w-m),w=m,m=-1,h.push(y),u.push(a.length>0?a[a.length-1].prevSpaces:0),g=Math.max(g,y),_++,o.x=0,o.y+=i.lineHeight,v=null,T=0)}}var M=f[f.length-1];M!=="\r"&&M!==`
|
|
720
|
-
`&&(/(?:\s)/.test(M)&&(p=y),h.push(p),g=Math.max(g,p),u.push(-1));for(var L=[],w=0;w<=_;w++){var B=0;this._align==="right"?B=g-h[w]:this._align==="center"?B=(g-h[w])/2:this._align==="justify"&&(B=u[w]<0?0:(g-h[w])/u[w]),L.push(B)}var A=a.length,I={},F=[],Y=this._activePagesMeshData;d.push.apply(d,Y);for(var w=0;w<A;w++){var z=a[w].texture,N=z.baseTexture.uid;if(!I[N]){var C=d.pop();if(!C){var U=new Zn,$=void 0,j=void 0;i.distanceFieldType==="none"?($=new zr(V.EMPTY),j=
|
|
720
|
+
`&&(/(?:\s)/.test(M)&&(p=y),h.push(p),g=Math.max(g,p),u.push(-1));for(var L=[],w=0;w<=_;w++){var B=0;this._align==="right"?B=g-h[w]:this._align==="center"?B=(g-h[w])/2:this._align==="justify"&&(B=u[w]<0?0:(g-h[w])/u[w]),L.push(B)}var A=a.length,I={},F=[],Y=this._activePagesMeshData;d.push.apply(d,Y);for(var w=0;w<A;w++){var z=a[w].texture,N=z.baseTexture.uid;if(!I[N]){var C=d.pop();if(!C){var U=new Zn,$=void 0,j=void 0;i.distanceFieldType==="none"?($=new zr(V.EMPTY),j=W.NORMAL):($=new zr(V.EMPTY,{program:Fr.from(Cy,Ry),uniforms:{uFWidth:0}}),j=W.NORMAL_NPM);var it=new Wr(U,$);it.blendMode=j,C={index:0,indexCount:0,vertexCount:0,uvsCount:0,total:0,mesh:it,vertices:null,uvs:null,indices:null}}C.index=0,C.indexCount=0,C.vertexCount=0,C.uvsCount=0,C.total=0;var vt=this._textureCache;vt[N]=vt[N]||new V(z.baseTexture),C.mesh.texture=vt[N],C.mesh.tint=this._tint,F.push(C),I[N]=C}I[N].total++}for(var w=0;w<Y.length;w++)F.indexOf(Y[w])===-1&&this.removeChild(Y[w].mesh);for(var w=0;w<F.length;w++)F[w].mesh.parent!==this&&this.addChild(F[w].mesh);this._activePagesMeshData=F;for(var w in I){var C=I[w],ft=C.total;if(!(((t=C.indices)===null||t===void 0?void 0:t.length)>6*ft)||C.vertices.length<Wr.BATCHABLE_SIZE*2)C.vertices=new Float32Array(4*2*ft),C.uvs=new Float32Array(4*2*ft),C.indices=new Uint16Array(6*ft);else for(var It=C.total,Lt=C.vertices,xt=It*4*2;xt<Lt.length;xt++)Lt[xt]=0;C.mesh.size=6*ft}for(var w=0;w<A;w++){var S=a[w],rt=S.position.x+L[S.line]*(this._align==="justify"?S.prevSpaces:1);this._roundPixels&&(rt=Math.round(rt));var ct=rt*s,at=S.position.y*s,z=S.texture,J=I[z.baseTexture.uid],kt=z.frame,qt=z._uvs,k=J.index++;J.indices[k*6+0]=0+k*4,J.indices[k*6+1]=1+k*4,J.indices[k*6+2]=2+k*4,J.indices[k*6+3]=0+k*4,J.indices[k*6+4]=2+k*4,J.indices[k*6+5]=3+k*4,J.vertices[k*8+0]=ct,J.vertices[k*8+1]=at,J.vertices[k*8+2]=ct+kt.width*s,J.vertices[k*8+3]=at,J.vertices[k*8+4]=ct+kt.width*s,J.vertices[k*8+5]=at+kt.height*s,J.vertices[k*8+6]=ct,J.vertices[k*8+7]=at+kt.height*s,J.uvs[k*8+0]=qt.x0,J.uvs[k*8+1]=qt.y0,J.uvs[k*8+2]=qt.x1,J.uvs[k*8+3]=qt.y1,J.uvs[k*8+4]=qt.x2,J.uvs[k*8+5]=qt.y2,J.uvs[k*8+6]=qt.x3,J.uvs[k*8+7]=qt.y3}this._textWidth=g*s,this._textHeight=(o.y+i.lineHeight)*s;for(var w in I){var C=I[w];if(this.anchor.x!==0||this.anchor.y!==0)for(var dt=0,Wt=this._textWidth*this.anchor.x,te=this._textHeight*this.anchor.y,ze=0;ze<C.total;ze++)C.vertices[dt++]-=Wt,C.vertices[dt++]-=te,C.vertices[dt++]-=Wt,C.vertices[dt++]-=te,C.vertices[dt++]-=Wt,C.vertices[dt++]-=te,C.vertices[dt++]-=Wt,C.vertices[dt++]-=te;this._maxLineHeight=x*s;var ni=C.mesh.geometry.getBuffer("aVertexPosition"),si=C.mesh.geometry.getBuffer("aTextureCoord"),xr=C.mesh.geometry.getIndex();ni.data=C.vertices,si.data=C.uvs,xr.data=C.indices,ni.update(),si.update(),xr.update()}for(var w=0;w<a.length;w++)qu.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=St.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,g=0,_=this._activePagesMeshData;g<_.length;g++){var m=_[g];m.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=St.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(!St.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:St.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=St.available[this._fontName],s=n.distanceFieldType==="none"?ju:Zu;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=V.EMPTY});for(var u in i){var l=i[u];l.destroy(),delete i[u]}this._font=null,this._textureCache=null,r.prototype.destroy.call(this,t)},e.styleDefaults={align:"left",tint:16777215,maxWidth:0,letterSpacing:0},e}(st),Oy=function(){function r(){}return r.add=function(){Et.setExtensionXhrType("fnt",Et.XHR_RESPONSE_TYPE.TEXT)},r.use=function(e,t){var i=Yu(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=St.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=ot.Loader,r}();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 Ay(r,e){Uo(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Iy=`varying vec2 vTextureCoord;
|
|
721
721
|
|
|
722
722
|
uniform sampler2D uSampler;
|
|
723
723
|
uniform float uAlpha;
|
|
@@ -1057,6 +1057,6 @@ void main()
|
|
|
1057
1057
|
|
|
1058
1058
|
gl_FragColor = color;
|
|
1059
1059
|
}
|
|
1060
|
-
`;(function(r){Yy(e,r);function e(t,i){t===void 0&&(t=.5),i===void 0&&(i=Math.random());var n=r.call(this,uu,Vy,{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})(hi);var Qu=new Mt;Rt.prototype._cacheAsBitmap=!1,Rt.prototype._cacheData=null,Rt.prototype._cacheAsBitmapResolution=null,Rt.prototype._cacheAsBitmapMultisample=wt.NONE;var jy=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(Rt.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 jy),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)}}}}),Rt.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))},Rt.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(G.RESOLUTION);var o=e.renderTexture.current,a=e.renderTexture.sourceFrame.clone(),h=e.renderTexture.destinationFrame.clone(),u=e.projection.transform,l=Ai.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_"+Ci();this._cacheData.textureCacheId=f,et.addToCache(l.baseTexture,f),V.addToCache(l,f);var c=this.transform.localTransform.copyTo(Qu).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 ht(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)}},Rt.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))},Rt.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(G.RESOLUTION);var o=Ai.create({width:t.width,height:t.height}),a="cacheAsBitmap_"+Ci();this._cacheData.textureCacheId=a,et.addToCache(o.baseTexture,a),V.addToCache(o,a);var h=Qu;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 ht(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)}},Rt.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._bounds.updateID=this._boundsID},Rt.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds(null)},Rt.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,et.removeFromCache(this._cacheData.textureCacheId),V.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null},Rt.prototype._cacheAsBitmapDestroy=function(e){this.cacheAsBitmap=!1,this.destroy(e)};Rt.prototype.name=null,st.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};Rt.prototype.getGlobalPosition=function(e,t){return e===void 0&&(e=new Z),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 Zy=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=ot.Application,r}(),tl=function(){function r(e){var t=this;this.stage=new st,e=Object.assign({forceCanvas:!1},e),this.renderer=w_(e),r._plugins.forEach(function(i){i.init.call(t,e)})}return r.registerPlugin=function(e){Ee("6.5.0","Application.registerPlugin() is deprecated, use extensions.add()"),Ze.add({type:ot.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}();Ze.handleByList(ot.Application,tl._plugins),Ze.add(Zy);var Yo=function(r,e){return Yo=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])},Yo(r,e)};function nr(r,e){Yo(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var qy=function(r){nr(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,g=p*this.segWidth+v,_=p*this.segWidth+v+1,m=(p+1)*this.segWidth+v,y=(p+1)*this.segWidth+v+1;s.push(g,_,m,_,y,m)}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}(Zn),Ky=function(r){nr(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,g=Math.sqrt(v*v+p*p);u=t[c],h+=g/l}else h=c/(f-1);o[d]=h,o[d+1]=0,o[d+2]=h,o[d+3]=1}for(var _=0,c=0;c<f-1;c++){var d=c*2;a[_++]=d,a[_++]=d+1,a[_++]=d+2,a[_++]=d+2,a[_++]=d+1,a[_++]=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}(Zn),$y=function(r){nr(e,r);function e(t,i,n){n===void 0&&(n=0);var s=this,o=new Ky(t.height,i,n),a=new zr(t);return n>0&&(t.baseTexture.wrapMode=Le.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}(Wr),Jy=function(r){nr(e,r);function e(t,i,n){var s=this,o=new qy(t.width,t.height,i,n),a=new zr(V.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}(Wr);(function(r){nr(e,r);function e(t,i,n,s,o){t===void 0&&(t=V.EMPTY);var a=this,h=new Zn(i,n,s);h.getBuffer("aVertexPosition").static=!1;var u=new zr(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})(Wr);var Jn=10;(function(r){nr(e,r);function e(t,i,n,s,o){i===void 0&&(i=Jn),n===void 0&&(n=Jn),s===void 0&&(s=Jn),o===void 0&&(o=Jn);var a=r.call(this,V.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 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 Qy(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){Qy(e,r);function e(t,i){i===void 0&&(i=!0);var n=r.call(this,t[0]instanceof V?t[0]:t[0].texture)||this;return n._textures=null,n._durations=null,n._autoUpdate=i,n._isConnectedToTicker=!1,n.animationSpeed=1,n.loop=!0,n.updateAnchor=!1,n.onComplete=null,n.onFrameChange=null,n.onLoop=null,n._currentTime=0,n._playing=!1,n._previousFrame=null,n.textures=t,n}return e.prototype.stop=function(){this._playing&&(this._playing=!1,this._autoUpdate&&this._isConnectedToTicker&&(Gt.shared.remove(this.update,this),this._isConnectedToTicker=!1))},e.prototype.play=function(){this._playing||(this._playing=!0,this._autoUpdate&&!this._isConnectedToTicker&&(Gt.shared.add(this.update,this,re.HIGH),this._isConnectedToTicker=!0))},e.prototype.gotoAndStop=function(t){this.stop();var i=this.currentFrame;this._currentTime=t,i!==this.currentFrame&&this.updateTexture()},e.prototype.gotoAndPlay=function(t){var i=this.currentFrame;this._currentTime=t,i!==this.currentFrame&&this.updateTexture(),this.play()},e.prototype.update=function(t){if(this._playing){var i=this.animationSpeed*t,n=this.currentFrame;if(this._durations!==null){var s=this._currentTime%1*this._durations[this.currentFrame];for(s+=i/60*1e3;s<0;)this._currentTime--,s+=this._durations[this.currentFrame];var 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(V.from(t[n]));return new e(i)},e.fromImages=function(t){for(var i=[],n=0;n<t.length;++n)i.push(V.from(t[n]));return new e(i)},Object.defineProperty(e.prototype,"totalFrames",{get:function(){return this._textures.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"textures",{get:function(){return this._textures},set:function(t){if(t[0]instanceof V)this._textures=t,this._durations=null;else{this._textures=[],this._durations=[];for(var i=0;i<t.length;i++)this._textures.push(t[i].texture),this._durations.push(t[i].time)}this._previousFrame=null,this.gotoAndStop(0),this.updateTexture()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentFrame",{get:function(){var t=Math.floor(this._currentTime)%this._textures.length;return t<0&&(t+=this._textures.length),t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"playing",{get:function(){return this._playing},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"autoUpdate",{get:function(){return this._autoUpdate},set:function(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isConnectedToTicker?(Gt.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._playing&&(Gt.shared.add(this.update,this),this._isConnectedToTicker=!0))},enumerable:!1,configurable:!0}),e})(ht);Ze.add(B_,W_,H_,Fm,ly,du,_y,Oy,om,Im,Mm,cy,eg,$_);let sr="sans-serif",Qn=null;const Je=new fi,el={chars:St.ASCII},Bi=new fi;async function il(r){const e=new oc(r.textFontFamilyDefault);try{await e.load()}catch(t){return console.error(t),console.warn(`loadBitmapFonts: font ${r.textFontFamilyDefault} failed to load, falling back to ${sr}`),nl(sr,r)}return sr=r.textFontFamilyDefault,nl(sr,r)}function rl(r){Je.fontFamily=sr,Je.fontSize=r.textSizeDefault,Je.lineHeight=r.textLineHeightDefault,Bi.fontFamily=sr,Bi.fontSize=r.textSizeSmall,Bi.lineHeight=r.textLineHeightSmall}function nl(r,e){rl(e);const t={resolution:window.devicePixelRatio||2,...el};St.from("NodeTextDefault",{...Je,fill:e.colorTextDefault},t);const i={fontName:"NodeTextDefault",fontSize:e.textSizeDefault};St.from("NodeTextInverse",{...Je,fill:e.colorTextInverse},t);const n={fontName:"NodeTextInverse",fontSize:e.textSizeDefault};St.from("NodeTextSubdued",{...Je,fill:e.colorTextSubdued},t);const s={fontName:"NodeTextSubdued",fontSize:e.textSizeDefault};St.from("TimeMarkerLabel",{...Bi,fill:e.colorTextSubdued},t);const o={fontName:"TimeMarkerLabel",fontSize:e.textSizeSmall};St.from("PlayheadTimerLabel",{...Bi,fill:e.colorPlayheadBg},t);const a={fontName:"PlayheadTimerLabel",fontSize:e.textSizeSmall};return{nodeTextDefault:i,nodeTextInverse:n,nodeTextSubdued:s,nodeTextStyles:Je,timeMarkerLabel:o,playheadTimerLabel:a}}function t0(r){rl(r);const e={resolution:window.devicePixelRatio||2,...el};setTimeout(()=>{St.uninstall("NodeTextDefault"),St.from("NodeTextDefault",{...Je,fill:r.colorTextDefault},e),St.uninstall("NodeTextInverse"),St.from("NodeTextInverse",{...Je,fill:r.colorTextInverse},e),St.uninstall("TimeMarkerLabel"),St.from("TimeMarkerLabel",{...Bi,fill:r.colorTextSubdued},e),St.uninstall("PlayheadTimerLabel"),St.from("PlayheadTimerLabel",{...Bi,fill:r.colorPlayheadBg},e)},0)}const Yr=r=>(Qn||(Qn=il(r)),Qn),e0=r=>{Qn=il(r)};class i0 extends st{constructor(t,i){super();R(this,"appRef");R(this,"viewportRef");R(this,"layer",new Ce);this.appRef=t,this.viewportRef=i,this.drawLayer(),this.initUpdater(),this.interactive=!0}drawLayer(){const{xPos:t,yPos:i,width:n,height:s}=this.getDimensions();this.layer.beginFill(16777215,1),this.layer.drawRect(t,i,n,s),this.layer.endFill(),this.layer.alpha=0,this.addChild(this.layer)}getDimensions(){return{xPos:this.viewportRef.left,yPos:this.viewportRef.top,width:this.viewportRef.right-this.viewportRef.left,height:this.viewportRef.bottom-this.viewportRef.top}}initUpdater(){this.appRef.ticker.add(()=>{this.update()},null,re.LOW)}update(){const{xPos:t,yPos:i,width:n,height:s}=this.getDimensions();this.x=t,this.y=i,this.width=n,this.height=s}}function r0(r){nd();const e=new tl({backgroundAlpha:0,width:r.clientWidth,height:r.clientHeight,resolution:window.devicePixelRatio||2,autoDensity:!0,antialias:!0,resizeTo:r});return process.env.NODE_ENV==="development"&&n0(e),r.appendChild(e.view),e.ticker.add(()=>{(r.clientWidth!==e.screen.width||r.clientHeight!==e.screen.height)&&(e.resizeTo=r)},null,re.LOW),e}function n0(r){globalThis.__PIXI_APP__=r}async function s0(){const{Viewport:r}=await Promise.resolve().then(()=>nb);return r}async function o0(r,e){const t=await s0(),{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,re.LOW),s}function Qe(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function sl(r,e){r.prototype=Object.create(e.prototype),r.prototype.constructor=r,r.__proto__=e}var ne={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},or={duration:.5,overwrite:!1,delay:0},jo,Yt,At,de=1e8,ut=1/de,Zo=Math.PI*2,a0=Zo/4,h0=0,ol=Math.sqrt,u0=Math.cos,l0=Math.sin,Ut=function(e){return typeof e=="string"},Pt=function(e){return typeof e=="function"},ti=function(e){return typeof e=="number"},qo=function(e){return typeof e>"u"},ke=function(e){return typeof e=="object"},Kt=function(e){return e!==!1},al=function(){return typeof window<"u"},ts=function(e){return Pt(e)||Ut(e)},hl=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},Vt=Array.isArray,Ko=/(?:-?\.?\d|\.)+/gi,ul=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,ar=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,$o=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,ll=/[+-]=-?[.\d]+/,fl=/[^,'"\[\]\s]+/gi,f0=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,mt,pe,Jo,Qo,se={},es={},cl,dl=function(e){return(es=Ui(e,se))&&he},ta=function(e,t){return console.warn("Invalid property",e,"set to",t,"Missing plugin? gsap.registerPlugin()")},is=function(e,t){return!t&&console.warn(e)},pl=function(e,t){return e&&(se[e]=t)&&es&&(es[e]=t)||se},Vr=function(){return 0},c0={suppressEvents:!0,isStart:!0,kill:!1},rs={suppressEvents:!0,kill:!1},d0={suppressEvents:!0},ea={},ci=[],ia={},vl,oe={},ra={},gl=30,ns=[],na="",sa=function(e){var t=e[0],i,n;if(ke(t)||Pt(t)||(e=[e]),!(i=(t._gsap||{}).harness)){for(n=ns.length;n--&&!ns[n].targetTest(t););i=ns[n]}for(n=e.length;n--;)e[n]&&(e[n]._gsap||(e[n]._gsap=new Wl(e[n],i)))||e.splice(n,1);return e},Gi=function(e){return e._gsap||sa(_e(e))[0]._gsap},_l=function(e,t,i){return(i=e[t])&&Pt(i)?e[t]():qo(i)&&e.getAttribute&&e.getAttribute(t)||i},$t=function(e,t){return(e=e.split(",")).forEach(t)||e},Ct=function(e){return Math.round(e*1e5)/1e5||0},Ht=function(e){return Math.round(e*1e7)/1e7||0},hr=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},p0=function(e,t){for(var i=t.length,n=0;e.indexOf(t[n])<0&&++n<i;);return n<i},ss=function(){var e=ci.length,t=ci.slice(0),i,n;for(ia={},ci.length=0,i=0;i<e;i++)n=t[i],n&&n._lazy&&(n.render(n._lazy[0],n._lazy[1],!0)._lazy=0)},ml=function(e,t,i,n){ci.length&&!Yt&&ss(),e.render(t,i,n||Yt&&t<0&&(e._initted||e._startAt)),ci.length&&!Yt&&ss()},yl=function(e){var t=parseFloat(e);return(t||t===0)&&(e+"").match(fl).length<2?t:Ut(e)?e.trim():e},xl=function(e){return e},ve=function(e,t){for(var i in t)i in e||(e[i]=t[i]);return e},v0=function(e){return function(t,i){for(var n in i)n in t||n==="duration"&&e||n==="ease"||(t[n]=i[n])}},Ui=function(e,t){for(var i in t)e[i]=t[i];return e},bl=function r(e,t){for(var i in t)i!=="__proto__"&&i!=="constructor"&&i!=="prototype"&&(e[i]=ke(t[i])?r(e[i]||(e[i]={}),t[i]):t[i]);return e},os=function(e,t){var i={},n;for(n in e)n in t||(i[n]=e[n]);return i},jr=function(e){var t=e.parent||mt,i=e.keyframes?v0(Vt(e.keyframes)):ve;if(Kt(e.inherit))for(;t;)i(e,t.vars.defaults),t=t.parent||t._dp;return e},g0=function(e,t){for(var i=e.length,n=i===t.length;n&&i--&&e[i]===t[i];);return i<0},Tl=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},as=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},di=function(e,t){e.parent&&(!t||e.parent.autoRemoveChildren)&&e.parent.remove(e),e._act=0},ki=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},_0=function(e){for(var t=e.parent;t&&t.parent;)t._dirty=1,t.totalDuration(),t=t.parent;return e},oa=function(e,t,i,n){return e._startAt&&(Yt?e._startAt.revert(rs):e.vars.immediateRender&&!e.vars.autoRevert||e._startAt.render(t,!0,n))},m0=function r(e){return!e||e._ts&&r(e.parent)},wl=function(e){return e._repeat?ur(e._tTime,e=e.duration()+e._rDelay)*e:0},ur=function(e,t){var i=Math.floor(e/=t);return e&&i===e?i-1:i},hs=function(e,t){return(e-t._start)*t._ts+(t._ts>=0?0:t._dirty?t.totalDuration():t._tDur)},us=function(e){return e._end=Ht(e._start+(e._tDur/Math.abs(e._ts||e._rts||ut)||0))},ls=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)),us(e),i._dirty||ki(i,e)),e},El=function(e,t){var i;if((t._time||t._initted&&!t._dur)&&(i=hs(e.rawTime(),t),(!t._dur||qr(0,t.totalDuration(),i)-t._tTime>ut)&&t.render(i,!0)),ki(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}},Xe=function(e,t,i,n){return t.parent&&di(t),t._start=Ht((ti(i)?i:i||e!==mt?ge(e,i,t):e._time)+t._delay),t._end=Ht(t._start+(t.totalDuration()/Math.abs(t.timeScale())||0)),Tl(e,t,"_first","_last",e._sort?"_start":0),aa(t)||(e._recent=t),n||El(e,t),e._ts<0&&ls(e,e._tTime),e},Sl=function(e,t){return(se.ScrollTrigger||ta("scrollTrigger",t))&&se.ScrollTrigger.create(t,e)},Pl=function(e,t,i,n,s){if(ga(e,t,s),!e._initted)return 1;if(!i&&e._pt&&!Yt&&(e._dur&&e.vars.lazy!==!1||!e._dur&&e.vars.lazy)&&vl!==ae.frame)return ci.push(e),e._lazy=[s,n],1},y0=function r(e){var t=e.parent;return t&&t._ts&&t._initted&&!t._lock&&(t.rawTime()<0||r(t))},aa=function(e){var t=e.data;return t==="isFromStart"||t==="isStart"},x0=function(e,t,i,n){var s=e.ratio,o=t<0||!t&&(!e._start&&y0(e)&&!(!e._initted&&aa(e))||(e._ts<0||e._dp._ts<0)&&!aa(e))?0:1,a=e._rDelay,h=0,u,l,f;if(a&&e._repeat&&(h=qr(0,e._tDur,t),l=ur(h,a),e._yoyo&&l&1&&(o=1-o),l!==ur(e._tTime,a)&&(s=1-o,e.vars.repeatRefresh&&e._initted&&e.invalidate())),o!==s||Yt||n||e._zTime===ut||!t&&e._zTime){if(!e._initted&&Pl(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&&oa(e,t,i,!0),e._onUpdate&&!i&&me(e,"onUpdate"),h&&e._repeat&&!i&&e.parent&&me(e,"onRepeat"),(t>=e._tDur||t<0)&&e.ratio===o&&(o&&di(e,1),!i&&!Yt&&(me(e,o?"onComplete":"onReverseComplete",!0),e._prom&&e._prom()))}else e._zTime||(e._zTime=t)},b0=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}},lr=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&&ls(e,e._tTime=e._tDur*a),e.parent&&us(e),i||ki(e.parent,e),e},Rl=function(e){return e instanceof Jt?ki(e):lr(e,e._dur)},T0={_start:0,endTime:Vr,totalDuration:Vr},ge=function r(e,t,i){var n=e.labels,s=e._recent||T0,o=e.duration()>=de?s.endTime(!1):e._dur,a,h,u;return Ut(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*(Vt(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=ti(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=Kt(h.vars.inherit)&&h.parent;o.immediateRender=Kt(a.immediateRender),e<2?o.runBackwards=1:o.startAt=t[s-1]}return new Ft(t[0],o,t[s+1])},pi=function(e,t){return e||e===0?t(e):t},qr=function(e,t,i){return i<e?e:i>t?t:i},jt=function(e,t){return!Ut(e)||!(t=f0.exec(e))?"":t[1]},w0=function(e,t,i){return pi(i,function(n){return qr(e,t,n)})},ha=[].slice,Cl=function(e,t){return e&&ke(e)&&"length"in e&&(!t&&!e.length||e.length-1 in e&&ke(e[0]))&&!e.nodeType&&e!==pe},E0=function(e,t,i){return i===void 0&&(i=[]),e.forEach(function(n){var s;return Ut(n)&&!t||Cl(n,1)?(s=i).push.apply(s,_e(n)):i.push(n)})||i},_e=function(e,t,i){return At&&!t&&At.selector?At.selector(e):Ut(e)&&!i&&(Jo||!cr())?ha.call((t||Qo).querySelectorAll(e),0):Vt(e)?E0(e,i):Cl(e)?ha.call(e,0):e?[e]:[]},ua=function(e){return e=_e(e)[0]||is("Invalid scope")||{},function(t){var i=e.current||e.nativeElement||e;return _e(t,i.querySelectorAll?i:i===e?is("Invalid scope")||Qo.createElement("div"):e)}},Ol=function(e){return e.sort(function(){return .5-Math.random()})},Al=function(e){if(Pt(e))return e;var t=ke(e)?e:{each:e},i=Xi(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 Ut(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,g=o[p],_,m,y,b,x,T,w,S,E;if(!g){if(E=t.grid==="auto"?0:(t.grid||[1,de])[1],!E){for(w=-de;w<(w=v[E++].getBoundingClientRect().left)&&E<p;);E--}for(g=o[p]=[],_=h?Math.min(E,p)*l-.5:n%E,m=E===de?0:h?p*f/E-.5:n/E|0,w=0,S=de,T=0;T<p;T++)y=T%E-_,b=m-(T/E|0),g[T]=x=u?Math.abs(u==="y"?b:y):ol(y*y+b*b),x>w&&(w=x),x<S&&(S=x);n==="random"&&Ol(g),g.max=w-S,g.min=S,g.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),g.b=p<0?s-p:s,g.u=jt(t.amount||t.each)||0,i=i&&p<0?kl(i):i}return p=(g[c]-g.min)/g.max||0,Ht(g.b+(i?i(p):p)*g.v)+g.u}},la=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+(ti(i)?0:jt(i))}},Il=function(e,t){var i=Vt(e),n,s;return!i&&ke(e)&&(n=i=e.radius||de,e.values?(e=_e(e.values),(s=!ti(e[0]))&&(n*=n)):e=la(e.increment)),pi(t,i?Pt(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=de,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||ti(o)?l:l+jt(o)}:la(e))},Ml=function(e,t,i,n){return pi(Vt(e)?!t:i===!0?!!(i=0):!n,function(){return Vt(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})},S0=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)}},P0=function(e,t){return function(i){return e(parseFloat(i))+(t||jt(i))}},R0=function(e,t,i){return Dl(e,t,0,1,i)},Nl=function(e,t,i){return pi(i,function(n){return e[~~t(n)]})},C0=function r(e,t,i){var n=t-e;return Vt(e)?Nl(e,r(0,e.length),t):pi(i,function(s){return(n+(s-e)%n)%n+e})},O0=function r(e,t,i){var n=t-e,s=n*2;return Vt(e)?Nl(e,r(0,e.length-1),t):pi(i,function(o){return o=(s+(o-e)%s)%s||0,e+(o>n?s-o:o)})},Kr=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?fl:Ko),i+=e.substr(t,n-t)+Ml(a?s:+s[0],a?0:+s[1],+s[2]||1e-5),t=o+1;return i+e.substr(t,e.length-t)},Dl=function(e,t,i,n,s){var o=t-e,a=n-i;return pi(s,function(h){return i+((h-e)/o*a||0)})},A0=function r(e,t,i,n){var s=isNaN(e+t)?0:function(d){return(1-d)*e+d*t};if(!s){var o=Ut(e),a={},h,u,l,f,c;if(i===!0&&(n=1)&&(i=null),o)e={p:e},t={p:t};else if(Vt(e)&&!Vt(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=Ui(Vt(e)?[]:{},e));if(!l){for(h in t)pa.call(a,e,h,"get",t[h]);s=function(v){return ya(v,a)||(o?e.p:e)}}}return pi(i,s)},Fl=function(e,t,i){var n=e.labels,s=de,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},me=function(e,t,i){var n=e.vars,s=n[t],o=At,a=e._ctx,h,u,l;if(s)return h=n[t+"Params"],u=n.callbackScope||e,i&&ci.length&&ss(),a&&(At=a),l=h?s.apply(u,h):s.call(u),At=o,l},$r=function(e){return di(e),e.scrollTrigger&&e.scrollTrigger.kill(!!Yt),e.progress()<1&&me(e,"onInterrupt"),e},fr,I0=function(e){e=!e.name&&e.default||e;var t=e.name,i=Pt(e),n=t&&!i&&e.init?function(){this._props=[]}:e,s={init:Vr,render:ya,add:pa,kill:j0,modifier:V0,rawVars:0},o={targetTest:0,get:0,getSetter:ma,aliases:{},register:0};if(cr(),e!==n){if(oe[t])return;ve(n,ve(os(e,s),o)),Ui(n.prototype,Ui(s,os(e,o))),oe[n.prop=t]=n,e.targetTest&&(ns.push(n),ea[t]=1),t=(t==="css"?"CSS":t.charAt(0).toUpperCase()+t.substr(1))+"Plugin"}pl(t,n),e.register&&e.register(he,n,Qt)},lt=255,Jr={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]},fa=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},Ll=function(e,t,i){var n=e?ti(e)?[e>>16,e>>8<,e<]:0:Jr.black,s,o,a,h,u,l,f,c,d,v;if(!n){if(e.substr(-1)===","&&(e=e.substr(0,e.length-1)),Jr[e])n=Jr[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<,n<,parseInt(e.substr(7),16)/255];e=parseInt(e.substr(1),16),n=[e>>16,e>>8<,e<]}else if(e.substr(0,3)==="hsl"){if(n=v=e.match(Ko),!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]=fa(h+1/3,s,o),n[1]=fa(h,s,o),n[2]=fa(h-1/3,s,o);else if(~e.indexOf("="))return n=e.match(ul),i&&n.length<4&&(n[3]=1),n}else n=e.match(Ko)||Jr.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},Bl=function(e){var t=[],i=[],n=-1;return e.split(vi).forEach(function(s){var o=s.match(ar)||[];t.push.apply(t,o),i.push(n+=o.length+1)}),t.c=i,t},Gl=function(e,t,i){var n="",s=(e+n).match(vi),o=t?"hsla(":"rgba(",a=0,h,u,l,f;if(!s)return e;if(s=s.map(function(c){return(c=Ll(c,t,1))&&o+(t?c[0]+","+c[1]+"%,"+c[2]+"%,"+c[3]:c.join(","))+")"}),i&&(l=Bl(e),h=i.c,h.join(n)!==l.c.join(n)))for(u=e.replace(vi,"1").split(ar),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(vi),f=u.length-1;a<f;a++)n+=u[a]+s[a];return n+u[f]},vi=function(){var r="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",e;for(e in Jr)r+="|"+e+"\\b";return new RegExp(r+")","gi")}(),M0=/hsl[a]?\(/,Ul=function(e){var t=e.join(" "),i;if(vi.lastIndex=0,vi.test(t))return i=M0.test(t),e[1]=Gl(e[1],i),e[0]=Gl(e[0],i,Bl(e[1])),!0},Qr,ae=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(g){var _=r()-n,m=g===!0,y,b,x,T;if(_>e&&(i+=_-t),n+=_,x=n-i,y=x-o,(y>0||m)&&(T=++f.frame,c=x-f.time*1e3,f.time=x=x/1e3,o+=y+(y>=s?4:s-y),b=1),m||(h=u(p)),b)for(d=0;d<a.length;d++)a[d](x,c,T,g)};return f={time:0,frame:0,tick:function(){v(!0)},deltaRatio:function(g){return c/(1e3/(g||60))},wake:function(){cl&&(!Jo&&al()&&(pe=Jo=window,Qo=pe.document||{},se.gsap=he,(pe.gsapVersions||(pe.gsapVersions=[])).push(he.version),dl(es||pe.GreenSockGlobals||!pe.gsap&&pe||{}),l=pe.requestAnimationFrame),h&&f.sleep(),u=l||function(g){return setTimeout(g,o-f.time*1e3+1|0)},Qr=1,v(2))},sleep:function(){(l?pe.cancelAnimationFrame:clearTimeout)(h),Qr=0,u=Vr},lagSmoothing:function(g,_){e=g||1/0,t=Math.min(_||33,e)},fps:function(g){s=1e3/(g||240),o=f.time*1e3+s},add:function(g,_,m){var y=_?function(b,x,T,w){g(b,x,T,w),f.remove(y)}:g;return f.remove(g),a[m?"unshift":"push"](y),cr(),y},remove:function(g,_){~(_=a.indexOf(g))&&a.splice(_,1)&&d>=_&&d--},_listeners:a},f}(),cr=function(){return!Qr&&ae.wake()},tt={},N0=/^[\d.\-M][\d.\-,\s]/,D0=/["']/g,F0=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(D0,"").trim():+u,n=h.substr(a+1).trim();return t},L0=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)},B0=function(e){var t=(e+"").split("("),i=tt[t[0]];return i&&t.length>1&&i.config?i.config.apply(null,~e.indexOf("{")?[F0(t[1])]:L0(e).split(",").map(yl)):tt._CE&&N0.test(e)?tt._CE("",e):i},kl=function(e){return function(t){return 1-e(1-t)}},Xl=function r(e,t){for(var i=e._first,n;i;)i instanceof Jt?r(i,t):i.vars.yoyoEase&&(!i._yoyo||!i._repeat)&&i._yoyo!==t&&(i.timeline?r(i.timeline,t):(n=i._ease,i._ease=i._yEase,i._yEase=n,i._yoyo=t)),i=i._next},Xi=function(e,t){return e&&(Pt(e)?e:tt[e]||B0(e))||t},Hi=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 $t(e,function(a){tt[a]=se[a]=s,tt[o=a.toLowerCase()]=i;for(var h in s)tt[o+(h==="easeIn"?".in":h==="easeOut"?".out":".inOut")]=tt[a+"."+h]=s[h]}),s},Hl=function(e){return function(t){return t<.5?(1-e(1-t*2))/2:.5+e((t-.5)*2)/2}},ca=function r(e,t,i){var n=t>=1?t:1,s=(i||(e?.3:.45))/(t<1?t:1),o=s/Zo*(Math.asin(1/n)||0),a=function(l){return l===1?1:n*Math.pow(2,-10*l)*l0((l-o)*s)+1},h=e==="out"?a:e==="in"?function(u){return 1-a(1-u)}:Hl(a);return s=Zo/s,h.config=function(u,l){return r(e,u,l)},h},da=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)}:Hl(i);return n.config=function(s){return r(e,s)},n};$t("Linear,Quad,Cubic,Quart,Quint,Strong",function(r,e){var t=e<5?e+1:e;Hi(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})}),tt.Linear.easeNone=tt.none=tt.Linear.easeIn,Hi("Elastic",ca("in"),ca("out"),ca()),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};Hi("Bounce",function(o){return 1-s(1-o)},s)}(7.5625,2.75),Hi("Expo",function(r){return r?Math.pow(2,10*(r-1)):0}),Hi("Circ",function(r){return-(ol(1-r*r)-1)}),Hi("Sine",function(r){return r===1?1:-u0(r*a0)+1}),Hi("Back",da("in"),da("out"),da()),tt.SteppedEase=tt.steps=se.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*qr(0,o,a)|0)+s)*i}}},or.ease=tt["quad.out"],$t("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(r){return na+=r+","+r+"Params,"});var Wl=function(e,t){this.id=h0++,e._gsap=this,this.target=e,this.harness=t,this.get=t?t.get:_l,this.set=t?t.getSetter:ma},dr=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,lr(this,+t.duration,1,1),this.data=t.data,At&&(this._ctx=At,At.data.push(this)),Qr||ae.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,lr(this,this._repeat<0?i:(i-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(i,n){if(cr(),!arguments.length)return this._tTime;var s=this._dp;if(s&&s.smoothChildTiming&&this._ts){for(ls(this,i),!s._dp||s.parent||El(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)&&Xe(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),ml(this,i,n)),this},e.time=function(i,n){return arguments.length?this.totalTime(Math.min(this.totalDuration(),i+wl(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)+wl(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?ur(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?hs(this.parent._time,this):this._tTime;return this._rts=+i||0,this._ts=this._ps||i===-ut?0:this._rts,this.totalTime(qr(-this._delay,this._tDur,n),!0),us(this),_0(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):(cr(),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)&&Xe(n,this,i-this._delay),this}return this._start},e.endTime=function(i){return this._start+(Kt(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?hs(n.rawTime(i),this):this._tTime:this._tTime},e.revert=function(i){i===void 0&&(i=d0);var n=Yt;return Yt=i,(this._initted||this._startAt)&&(this.timeline&&this.timeline.revert(i),this.totalTime(-.01,i.suppressEvents)),this.data!=="nested"&&i.kill!==!1&&this.kill(),Yt=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,Rl(this)):this._repeat===-2?1/0:this._repeat},e.repeatDelay=function(i){if(arguments.length){var n=this._time;return this._rDelay=i,Rl(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(ge(this,i),Kt(n))},e.restart=function(i,n){return this.play().totalTime(i?-this._delay:0,Kt(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=Pt(i)?i:xl,a=function(){var u=n.then;n.then=null,Pt(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(){$r(this)},r}();ve(dr.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 Jt=function(r){sl(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=Kt(i.sortChildren),mt&&Xe(i.parent||mt,Qe(s),n),i.reversed&&s.reverse(),i.paused&&s.paused(!0),i.scrollTrigger&&Sl(Qe(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,jr(s).repeatDelay||(s.repeat=0),s.immediateRender=!!s.immediateRender,new Ft(n,s,ge(this,o),1),this},t.call=function(n,s,o){return Xe(this,Ft.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 Ft(n,o,ge(this,h)),this},t.staggerFrom=function(n,s,o,a,h,u,l){return o.runBackwards=1,jr(o).immediateRender=Kt(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,jr(a).immediateRender=Kt(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,_,m,y,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,y=this._ts,_=!y,f&&(u||(a=this._zTime),(n||!s)&&(this._zTime=n)),this._repeat){if(T=this._yoyo,g=u+this._rDelay,this._repeat<-1&&n<0)return this.totalTime(g*100+n,s,o);if(c=Ht(l%g),l===h?(p=this._repeat,c=u):(p=~~(l/g),p&&p===l/g&&(c=u,p--),c>u&&(c=u)),x=ur(this._tTime,g),!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*g)),s,!u)._lock=0,this._tTime=l,!s&&this.parent&&me(this,"onRepeat"),this.vars.repeatRefresh&&!w&&(this.invalidate()._lock=1),a&&a!==this._time||_!==!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&&!_)return this;Xl(this,w)}}if(this._hasPause&&!this._forcing&&this._lock<2&&(m=b0(this,Ht(a),Ht(c)),m&&(l-=c-(c=m._start))),this._tTime=l,this._time=c,this._act=!y,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=n,a=0),!a&&c&&!s&&(me(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&&m!==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&&!_){m=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&&m!==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||Yt&&(d._initted||d._startAt)),c!==this._time||!this._ts&&!_){m=0,v&&(l+=this._zTime=P?-ut:ut);break}}d=v}}if(m&&!s&&(this.pause(),m.render(c>=a?0:-ut)._zTime=c>=a?1:-1,this._ts))return this._start=b,us(this),this.render(n,s,o);this._onUpdate&&!s&&me(this,"onUpdate",!0),(l===h&&this._tTime>=this.totalDuration()||!l&&a)&&(b===this._start||Math.abs(y)!==Math.abs(this._ts))&&(this._lock||((n||!u)&&(l===h&&this._ts>0||!l&&this._ts<0)&&di(this,1),!s&&!(n<0&&!a)&&(l||a||!h)&&(me(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(ti(s)||(s=ge(this,s,n)),!(n instanceof dr)){if(Vt(n))return n.forEach(function(a){return o.add(a,s)}),this;if(Ut(n))return this.addLabel(n,s);if(Pt(n))n=Ft.delayedCall(0,n);else return this}return this!==n?Xe(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=-de);for(var h=[],u=this._first;u;)u._start>=a&&(u instanceof Ft?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 Ut(n)?this.removeLabel(n):Pt(n)?this.killTweensOf(n):(as(this,n),n===this._recent&&(this._recent=this._last),ki(this))},t.totalTime=function(n,s){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=Ht(ae.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]=ge(this,s),this},t.removeLabel=function(n){return delete this.labels[n],this},t.addPause=function(n,s,o){var a=Ft.delayedCall(0,s||Vr,o);return a.data="isPause",this._hasPause=1,Xe(this,a,ge(this,n))},t.removePause=function(n){var s=this._first;for(n=ge(this,n);s;)s._start===n&&s.data==="isPause"&&di(s),s=s._next},t.killTweensOf=function(n,s,o){for(var a=this.getTweensOf(n,o),h=a.length;h--;)gi!==a[h]&&a[h].kill(n,s);return this},t.getTweensOf=function(n,s){for(var o=[],a=_e(n),h=this._first,u=ti(s),l;h;)h instanceof Ft?p0(h._targets,a)&&(u?(!gi||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=ge(o,n),h=s,u=h.startAt,l=h.onStart,f=h.onStartParams,c=h.immediateRender,d,v=Ft.to(o,ve({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 g=s.duration||Math.abs((a-(u&&"time"in u?u.time:o._time))/o.timeScale());v._dur!==g&&lr(v,g,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,ve({startAt:{time:ge(this,n)}},o))},t.recent=function(){return this._recent},t.nextLabel=function(n){return n===void 0&&(n=this._time),Fl(this,ge(this,n))},t.previousLabel=function(n){return n===void 0&&(n=this._time),Fl(this,ge(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 ki(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={}),ki(this)},t.totalDuration=function(n){var s=0,o=this,a=o._last,h=de,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,Xe(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;lr(o,o===mt&&o._time>s?o._time:s,1,1),o._dirty=0}return o._tDur},e.updateRoot=function(n){if(mt._ts&&(ml(mt,hs(n,mt)),vl=ae.frame),ae.frame>=gl){gl+=ne.autoSleep||120;var s=mt._first;if((!s||!s._ts)&&ne.autoSleep&&ae._listeners.length<2){for(;s&&!s._ts;)s=s._next;s||ae.sleep()}}},e}(dr);ve(Jt.prototype,{_lock:0,_hasPause:0,_forcing:0});var G0=function(e,t,i,n,s,o,a){var h=new Qt(this._pt,e,t,0,1,ql,null,s),u=0,l=0,f,c,d,v,p,g,_,m;for(h.b=i,h.e=n,i+="",n+="",(_=~n.indexOf("random("))&&(n=Kr(n)),o&&(m=[i,n],o(m,e,t),i=m[0],n=m[1]),c=i.match($o)||[];f=$o.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++]&&(g=parseFloat(c[l-1])||0,h._pt={_next:h._pt,p:p||l===1?p:",",s:g,c:v.charAt(1)==="="?hr(g,v)-g:parseFloat(v)-g,m:d&&d<4?Math.round:0},u=$o.lastIndex);return h.c=u<n.length?n.substring(u,n.length):"",h.fp=a,(ll.test(n)||_)&&(h.e=0),this._pt=h,h},pa=function(e,t,i,n,s,o,a,h,u,l){Pt(n)&&(n=n(s||0,e,o));var f=e[t],c=i!=="get"?i:Pt(f)?u?e[t.indexOf("set")||!Pt(e["get"+t.substr(3)])?t:"get"+t.substr(3)](u):e[t]():f,d=Pt(f)?u?W0:jl:_a,v;if(Ut(n)&&(~n.indexOf("random(")&&(n=Kr(n)),n.charAt(1)==="="&&(v=hr(c,n)+(jt(c)||0),(v||v===0)&&(n=v))),!l||c!==n||va)return!isNaN(c*n)&&n!==""?(v=new Qt(this._pt,e,t,+c||0,n-(c||0),typeof f=="boolean"?Y0:Zl,0,d),u&&(v.fp=u),a&&v.modifier(a,this,e),this._pt=v):(!f&&!(t in e)&&ta(t,n),G0.call(this,e,t,c,n,d,h||ne.stringFilter,u))},U0=function(e,t,i,n,s){if(Pt(e)&&(e=tn(e,s,t,i,n)),!ke(e)||e.style&&e.nodeType||Vt(e)||hl(e))return Ut(e)?tn(e,s,t,i,n):e;var o={},a;for(a in e)o[a]=tn(e[a],s,t,i,n);return o},zl=function(e,t,i,n,s,o){var a,h,u,l;if(oe[e]&&(a=new oe[e]).init(s,a.rawVars?t[e]:U0(t[e],n,s,o,i),i,n,o)!==!1&&(i._pt=h=new Qt(i._pt,s,e,0,1,a.render,a,0,a.priority),i!==fr))for(u=i._ptLookup[i._targets.indexOf(s)],l=a._props.length;l--;)u[a._props[l]]=h;return a},gi,va,ga=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,g=e._dur,_=e._startAt,m=e._targets,y=e.parent,b=y&&y.data==="nested"?y.vars.targets:m,x=e._overwrite==="auto"&&!jo,T=e.timeline,w,S,E,P,O,M,L,B,A,I,F,Y,z;if(T&&(!v||!s)&&(s="none"),e._ease=Xi(s,or.ease),e._yEase=d?kl(Xi(d===!0?s:d,or.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(B=m[0]?Gi(m[0]).harness:0,Y=B&&n[B.prop],w=os(n,ea),_&&(_._zTime<0&&_.progress(1),t<0&&c&&a&&!p?_.render(-1,!0):_.revert(c&&g?rs:c0),_._lazy=0),o){if(di(e._startAt=Ft.set(m,ve({data:"isStart",overwrite:!1,parent:y,immediateRender:!0,lazy:!_&&Kt(h),startAt:null,delay:0,onUpdate:u,onUpdateParams:l,callbackScope:f,stagger:0},o))),e._startAt._dp=0,e._startAt._sat=e,t<0&&(Yt||!a&&!p)&&e._startAt.revert(rs),a&&g&&t<=0&&i<=0){t&&(e._zTime=t);return}}else if(c&&g&&!_){if(t&&(a=!1),E=ve({overwrite:!1,data:"isFromStart",lazy:a&&!_&&Kt(h),immediateRender:a,stagger:0,parent:y},w),Y&&(E[B.prop]=Y),di(e._startAt=Ft.set(m,E)),e._startAt._dp=0,e._startAt._sat=e,t<0&&(Yt?e._startAt.revert(rs):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=g&&Kt(h)||h&&!g,S=0;S<m.length;S++){if(O=m[S],L=O._gsap||sa(m)[S]._gsap,e._ptLookup[S]=I={},ia[L.id]&&ci.length&&ss(),F=b===m?S:b.indexOf(O),B&&(A=new B).init(O,Y||w,e,F,b)!==!1&&(e._pt=P=new Qt(e._pt,O,A.name,0,1,A.render,A,0,A.priority),A._props.forEach(function(N){I[N]=P}),A.priority&&(M=1)),!B||Y)for(E in w)oe[E]&&(A=zl(E,w,e,F,O,b))?A.priority&&(M=1):I[E]=P=pa.call(e,O,E,"get",w[E],F,b,0,n.stringFilter);e._op&&e._op[S]&&e.kill(O,e._op[S]),x&&e._pt&&(gi=e,mt.killTweensOf(O,I,e.globalTime(t)),z=!e.parent,gi=0),e._pt&&h&&(ia[L.id]=1)}M&&Kl(e),e._onInit&&e._onInit(e)}e._onUpdate=u,e._initted=(!e._op||e._pt)&&!z,v&&t<=0&&T.render(de,!0,!0)},k0=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 va=1,e.vars[t]="+=0",ga(e,a),va=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=Ct(i)+jt(l.e)),l.b&&(l.b=u.s+jt(l.b))},X0=function(e,t){var i=e[0]?Gi(e[0]).harness:0,n=i&&i.aliases,s,o,a,h;if(!n)return t;s=Ui({},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},H0=function(e,t,i,n){var s=t.ease||n||"power1.inOut",o,a;if(Vt(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})},tn=function(e,t,i,n,s){return Pt(e)?e.call(t,i,n,s):Ut(e)&&~e.indexOf("random(")?Kr(e):e},Yl=na+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert",Vl={};$t(Yl+",id,stagger,delay,duration,paused,scrollTrigger",function(r){return Vl[r]=1});var Ft=function(r){sl(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:jr(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,g=h.scrollTrigger,_=h.yoyoEase,m=n.parent||mt,y=(Vt(i)||hl(i)?ti(i[0]):"length"in n)?[i]:_e(i),b,x,T,w,S,E,P,O;if(a._targets=y.length?sa(y):is("GSAP target "+i+" not found. https://greensock.com",!ne.nullTargetWarn)||[],a._ptLookup=[],a._overwrite=d,v||c||ts(u)||ts(l)){if(n=a.vars,b=a.timeline=new Jt({data:"nested",defaults:p||{},targets:m&&m.data==="nested"?m.vars.targets:y}),b.kill(),b.parent=b._dp=Qe(a),b._start=0,c||ts(u)||ts(l)){if(w=y.length,P=c&&Al(c),ke(c))for(S in c)~Yl.indexOf(S)&&(O||(O={}),O[S]=c[S]);for(x=0;x<w;x++)T=os(n,Vl),T.stagger=0,_&&(T.yoyoEase=_),O&&Ui(T,O),E=y[x],T.duration=+tn(u,Qe(a),x,E,y),T.delay=(+tn(l,Qe(a),x,E,y)||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,y):0),b._ease=tt.none;b.duration()?u=l=0:a.timeline=0}else if(v){jr(ve(b.vars.defaults,{ease:"none"})),b._ease=Xi(v.ease||n.ease||"none");var M=0,L,B,A;if(Vt(v))v.forEach(function(I){return b.to(y,I,">")}),b.duration();else{T={};for(S in v)S==="ease"||S==="easeEach"||H0(S,v[S],T,v.easeEach);for(S in T)for(L=T[S].sort(function(I,F){return I.t-F.t}),M=0,x=0;x<L.length;x++)B=L[x],A={ease:B.e,duration:(B.t-(x?L[x-1].t:0))/100*u},A[S]=B.v,b.to(y,A,M),M+=A.duration;b.duration()<u&&b.to({},{duration:u-b.duration()})}}u||a.duration(u=b.duration())}else a.timeline=0;return d===!0&&!jo&&(gi=Qe(a),mt.killTweensOf(y),gi=0),Xe(m,Qe(a),s),n.reversed&&a.reverse(),n.paused&&a.paused(!0),(f||!u&&!v&&a._start===Ht(m._time)&&Kt(f)&&m0(Qe(a))&&m.data!=="nested")&&(a._tTime=-ut,a.render(Math.max(0,-l)||0)),g&&Sl(Qe(a),g),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,_,m,y,b;if(!u)x0(this,n,s,o);else if(f!==this._tTime||!n||o||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==l){if(c=f,y=this.timeline,this._repeat){if(p=u+this._rDelay,this._repeat<-1&&l)return this.totalTime(p*100+n,s,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)),_=this._yoyo&&v&1,_&&(b=this._yEase,c=u-c),g=ur(this._tTime,p),c===a&&!o&&this._initted)return this._tTime=f,this;v!==g&&(y&&this._yEase&&Xl(y,_),this.vars.repeatRefresh&&!_&&!this._lock&&(this._lock=o=1,this.render(Ht(p*v),!0).invalidate()._lock=0))}if(!this._initted){if(Pl(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=m=(b||this._ease)(c/u),this._from&&(this.ratio=m=1-m),c&&!a&&!s&&(me(this,"onStart"),this._tTime!==f))return this;for(d=this._pt;d;)d.r(m,d.d),d=d._next;y&&y.render(n<0?n:!c&&_?-ut:y._dur*y._ease(c/this._dur),s,o)||this._startAt&&(this._zTime=n),this._onUpdate&&!s&&(l&&oa(this,n,s,o),me(this,"onUpdate")),this._repeat&&v!==g&&this.vars.onRepeat&&!s&&this.parent&&me(this,"onRepeat"),(f===this._tDur||!f)&&this._tTime===f&&(l&&!this._onUpdate&&oa(this,n,!0,!0),(n||!u)&&(f===this._tDur&&this._ts>0||!f&&this._ts<0)&&di(this,1),!s&&!(l&&!a)&&(f||a||_)&&(me(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||ae.wake(),this._ts||this.play();var h=Math.min(this._dur,(this._dp._time-this._start)*this._ts),u;return this._initted||ga(this,h),u=this._ease(h/this._dur),k0(this,n,s,o,a,u,h)?this.resetTo(n,s,o,a):(ls(this,0),this.parent||Tl(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?$r(this):this;if(this.timeline){var o=this.timeline.totalDuration();return this.timeline.killTweensOf(n,s,gi&&gi.vars.overwrite!==!0)._first||$r(this),this.parent&&o!==this.timeline.totalDuration()&&lr(this,this._dur*this.timeline._tDur/o,0,1),this}var a=this._targets,h=n?_e(n):a,u=this._ptLookup,l=this._pt,f,c,d,v,p,g,_;if((!s||s==="all")&&g0(a,h))return s==="all"&&(this._pt=0),$r(this);for(f=this._op=this._op||[],s!=="all"&&(Ut(s)&&(p={},$t(s,function(m){return p[m]=1}),s=p),s=X0(a,s)),_=a.length;_--;)if(~h.indexOf(a[_])){c=u[_],s==="all"?(f[_]=s,v=c,d={}):(d=f[_]=f[_]||{},v=s);for(p in v)g=c&&c[p],g&&((!("kill"in g.d)||g.d.kill(p)===!0)&&as(this,g,"_pt"),delete c[p]),d!=="all"&&(d[p]=1)}return this._initted&&!this._pt&&l&&$r(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}(dr);ve(Ft.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0}),$t("staggerTo,staggerFrom,staggerFromTo",function(r){Ft[r]=function(){var e=new Jt,t=ha.call(arguments,0);return t.splice(r==="staggerFromTo"?5:4,0,0),e[r].apply(e,t)}});var _a=function(e,t,i){return e[t]=i},jl=function(e,t,i){return e[t](i)},W0=function(e,t,i,n){return e[t](n.fp,i)},z0=function(e,t,i){return e.setAttribute(t,i)},ma=function(e,t){return Pt(e[t])?jl:qo(e[t])&&e.setAttribute?z0:_a},Zl=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e6)/1e6,t)},Y0=function(e,t){return t.set(t.t,t.p,!!(t.s+t.c*e),t)},ql=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)},ya=function(e,t){for(var i=t._pt;i;)i.r(e,i.d),i=i._next},V0=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},j0=function(e){for(var t=this._pt,i,n;t;)n=t._next,t.p===e&&!t.op||t.op===e?as(this,t,"_pt"):t.dep||(i=1),t=n;return!i},Z0=function(e,t,i,n){n.mSet(e,t,n.m.call(n.tween,i,n.mt),n)},Kl=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},Qt=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||Zl,this.d=h||this,this.set=u||_a,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=Z0,this.m=i,this.mt=s,this.tween=n},r}();$t(na+"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 ea[r]=1}),se.TweenMax=se.TweenLite=Ft,se.TimelineLite=se.TimelineMax=Jt,mt=new Jt({sortChildren:!1,defaults:or,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0}),ne.stringFilter=Ul;var pr=[],fs={},q0=[],$l=0,xa=function(e){return(fs[e]||q0).map(function(t){return t()})},ba=function(){var e=Date.now(),t=[];e-$l>2&&(xa("matchMediaInit"),pr.forEach(function(i){var n=i.queries,s=i.conditions,o,a,h,u;for(a in n)o=pe.matchMedia(n[a]).matches,o&&(h=1),o!==s[a]&&(s[a]=o,u=1);u&&(i.revert(),h&&t.push(i))}),xa("matchMediaRevert"),t.forEach(function(i){return i.onMatch(i)}),$l=e,xa("matchMedia"))},Jl=function(){function r(t,i){this.selector=i&&ua(i),this.data=[],this._r=[],this.isReverted=!1,t&&this.add(t)}var e=r.prototype;return e.add=function(i,n,s){Pt(i)&&(s=n,n=i,i=Pt);var o=this,a=function(){var u=At,l=o.selector,f;return u&&u!==o&&u.data.push(o),s&&(o.selector=ua(s)),At=o,f=n.apply(o,arguments),Pt(f)&&o._r.push(f),At=u,o.selector=l,o.isReverted=!1,f};return o.last=a,i===Pt?a(o):i?o[i]=a:a},e.ignore=function(i){var n=At;At=null,i(this),At=n},e.getTweens=function(){var i=[];return this.data.forEach(function(n){return n instanceof r?i.push.apply(i,n.getTweens()):n instanceof Ft&&!(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 dr)&&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=pr.indexOf(this);~a&&pr.splice(a,1)}},e.revert=function(i){this.kill(i||{})},r}(),K0=function(){function r(t){this.contexts=[],this.scope=t}var e=r.prototype;return e.add=function(i,n,s){ke(i)||(i={matches:i});var o=new Jl(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=pe.matchMedia(i[u]),h&&(pr.indexOf(o)<0&&pr.push(o),(a[u]=h.matches)&&(l=1),h.addListener?h.addListener(ba):h.addEventListener("change",ba)));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}(),cs={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 I0(n)})},timeline:function(e){return new Jt(e)},getTweensOf:function(e,t){return mt.getTweensOf(e,t)},getProperty:function(e,t,i,n){Ut(e)&&(e=_e(e)[0]);var s=Gi(e||{}).get,o=i?xl:yl;return i==="native"&&(i=""),e&&(t?o((oe[t]&&oe[t].get||s)(e,t,i,n)):function(a,h,u){return o((oe[a]&&oe[a].get||s)(e,a,h,u))})},quickSetter:function(e,t,i){if(e=_e(e),e.length>1){var n=e.map(function(l){return he.quickSetter(l,t,i)}),s=n.length;return function(l){for(var f=s;f--;)n[f](l)}}e=e[0]||{};var o=oe[t],a=Gi(e),h=a.harness&&(a.harness.aliases||{})[t]||t,u=o?function(l){var f=new o;fr._pt=0,f.init(e,i?l+i:l,fr,0,[e]),f.render(1,f),fr._pt&&ya(1,fr)}: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=he.to(e,Ui((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=Xi(e.ease,or.ease)),bl(or,e||{})},config:function(e){return bl(ne,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&&!oe[a]&&!se[a]&&is(t+" effect requires "+a+" plugin.")}),ra[t]=function(a,h,u){return i(_e(a),ve(h||{},s),u)},o&&(Jt.prototype[t]=function(a,h,u){return this.add(ra[t](a,ke(h)?h:(u=h)&&{},this),u)})},registerEase:function(e,t){tt[e]=Xi(t)},parseEase:function(e,t){return arguments.length?Xi(e,t):tt},getById:function(e){return mt.getById(e)},exportRoot:function(e,t){e===void 0&&(e={});var i=new Jt(e),n,s;for(i.smoothChildTiming=Kt(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 Ft&&n.vars.onComplete===n._targets[0]))&&Xe(i,n,n._start-n._delay),n=s;return Xe(mt,i,0),i},context:function(e,t){return e?new Jl(e,t):At},matchMedia:function(e){return new K0(e)},matchMediaRefresh:function(){return pr.forEach(function(e){var t=e.conditions,i,n;for(n in t)t[n]&&(t[n]=!1,i=1);i&&e.revert()})||ba()},addEventListener:function(e,t){var i=fs[e]||(fs[e]=[]);~i.indexOf(t)||i.push(t)},removeEventListener:function(e,t){var i=fs[e],n=i&&i.indexOf(t);n>=0&&i.splice(n,1)},utils:{wrap:C0,wrapYoyo:O0,distribute:Al,random:Ml,snap:Il,normalize:R0,getUnit:jt,clamp:w0,splitColor:Ll,toArray:_e,selector:ua,mapRange:Dl,pipe:S0,unitize:P0,interpolate:A0,shuffle:Ol},install:dl,effects:ra,ticker:ae,updateRoot:Jt.updateRoot,plugins:oe,globalTimeline:mt,core:{PropTween:Qt,globals:pl,Tween:Ft,Timeline:Jt,Animation:dr,getCache:Gi,_removeLinkedListItem:as,reverting:function(){return Yt},context:function(e){return e&&At&&(At.data.push(e),e._ctx=At),At},suppressOverwrites:function(e){return jo=e}}};$t("to,from,fromTo,delayedCall,set,killTweensOf",function(r){return cs[r]=Ft[r]}),ae.add(Jt.updateRoot),fr=cs.to({},{duration:0});var $0=function(e,t){for(var i=e._pt;i&&i.p!==t&&i.op!==t&&i.fp!==t;)i=i._next;return i},J0=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=$0(o,n)),o&&o.modifier&&o.modifier(t[n],e,i[s],n))},Ta=function(e,t){return{name:e,rawVars:1,init:function(n,s,o){o._onInit=function(a){var h,u;if(Ut(s)&&(h={},$t(s,function(l){return h[l]=1}),s=h),t){h={};for(u in s)h[u]=t(s[u]);s=h}J0(a,s)}}}},he=cs.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;)Yt?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)}},Ta("roundProps",la),Ta("modifiers"),Ta("snap",Il))||cs;Ft.version=Jt.version=he.version="3.11.4",cl=1,al()&&cr(),tt.Power0,tt.Power1,tt.Power2,tt.Power3,tt.Power4,tt.Linear,tt.Quad,tt.Cubic,tt.Quart,tt.Quint,tt.Strong,tt.Elastic,tt.Back,tt.SteppedEase,tt.Bounce,tt.Sine,tt.Expo,tt.Circ;var Ql,_i,vr,wa,Wi,tf,Ea,Q0=function(){return typeof window<"u"},ei={},zi=180/Math.PI,gr=Math.PI/180,_r=Math.atan2,ef=1e8,Sa=/([A-Z])/g,tx=/(left|right|width|margin|padding|x)/i,ex=/[\s,\(]\S/,ii={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},Pa=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e4)/1e4+t.u,t)},ix=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)},rx=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)},nx=function(e,t){var i=t.s+t.c*e;t.set(t.t,t.p,~~(i+(i<0?-.5:.5))+t.u,t)},rf=function(e,t){return t.set(t.t,t.p,e?t.e:t.b,t)},nf=function(e,t){return t.set(t.t,t.p,e!==1?t.b:t.e,t)},sx=function(e,t,i){return e.style[t]=i},ox=function(e,t,i){return e.style.setProperty(t,i)},ax=function(e,t,i){return e._gsap[t]=i},hx=function(e,t,i){return e._gsap.scaleX=e._gsap.scaleY=i},ux=function(e,t,i,n,s){var o=e._gsap;o.scaleX=o.scaleY=i,o.renderTransform(s,o)},lx=function(e,t,i,n,s){var o=e._gsap;o[t]=i,o.renderTransform(s,o)},yt="transform",Oe=yt+"Origin",fx=function(e,t){var i=this,n=this.target,s=n.style;if(e in ei){if(this.tfm=this.tfm||{},e!=="transform"&&(e=ii[e]||e,~e.indexOf(",")?e.split(",").forEach(function(o){return i.tfm[o]=ri(n,o)}):this.tfm[e]=n._gsap.x?n._gsap[e]:ri(n,e)),this.props.indexOf(yt)>=0)return;n._gsap.svg&&(this.svgo=n.getAttribute("data-svg-origin"),this.props.push(Oe,t,"")),e=yt}(s||t)&&this.props.push(e,t,s[e])},sf=function(e){e.translate&&(e.removeProperty("translate"),e.removeProperty("scale"),e.removeProperty("rotate"))},cx=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(Sa,"-$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=Ea(),s&&!s.isStart&&!i[yt]&&(sf(i),n.uncache=1)}},of=function(e,t){var i={target:e,props:[],revert:cx,save:fx};return t&&t.split(",").forEach(function(n){return i.save(n)}),i},af,Ra=function(e,t){var i=_i.createElementNS?_i.createElementNS((t||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),e):_i.createElement(e);return i.style?i:_i.createElement(e)},He=function r(e,t,i){var n=getComputedStyle(e);return n[t]||n.getPropertyValue(t.replace(Sa,"-$1").toLowerCase())||n.getPropertyValue(t)||!i&&r(e,mr(t)||t,1)||""},hf="O,Moz,ms,Ms,Webkit".split(","),mr=function(e,t,i){var n=t||Wi,s=n.style,o=5;if(e in s&&!i)return e;for(e=e.charAt(0).toUpperCase()+e.substr(1);o--&&!(hf[o]+e in s););return o<0?null:(o===3?"ms":o>=0?hf[o]:"")+e},Ca=function(){Q0()&&window.document&&(Ql=window,_i=Ql.document,vr=_i.documentElement,Wi=Ra("div")||{style:{}},Ra("div"),yt=mr(yt),Oe=yt+"Origin",Wi.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",af=!!mr("perspective"),Ea=he.core.reverting,wa=1)},Oa=function r(e){var t=Ra("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(vr.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)),vr.removeChild(t),this.style.cssText=s,o},uf=function(e,t){for(var i=t.length;i--;)if(e.hasAttribute(t[i]))return e.getAttribute(t[i])},lf=function(e){var t;try{t=e.getBBox()}catch{t=Oa.call(e,!0)}return t&&(t.width||t.height)||e.getBBox===Oa||(t=Oa.call(e,!0)),t&&!t.width&&!t.x&&!t.y?{x:+uf(e,["x","cx","x1"])||0,y:+uf(e,["y","cy","y1"])||0,width:0,height:0}:t},ff=function(e){return!!(e.getCTM&&(!e.parentNode||e.ownerSVGElement)&&lf(e))},en=function(e,t){if(t){var i=e.style;t in ei&&t!==Oe&&(t=yt),i.removeProperty?((t.substr(0,2)==="ms"||t.substr(0,6)==="webkit")&&(t="-"+t),i.removeProperty(t.replace(Sa,"-$1").toLowerCase())):i.removeAttribute(t)}},mi=function(e,t,i,n,s,o){var a=new Qt(e._pt,t,i,0,1,o?nf:rf);return e._pt=a,a.b=n,a.e=s,e._props.push(i),a},cf={deg:1,rad:1,turn:1},dx={grid:1,flex:1},yi=function r(e,t,i,n){var s=parseFloat(i)||0,o=(i+"").trim().substr((s+"").length)||"px",a=Wi.style,h=tx.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||cf[n]||cf[o]?s:(o!=="px"&&!c&&(s=r(e,t,i,"px")),_=e.getCTM&&ff(e),(d||o==="%")&&(ei[t]||~t.indexOf("adius"))?(v=_?e.getBBox()[h?"width":"height"]:e[l],Ct(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,_&&(p=(e.ownerSVGElement||{}).parentNode),(!p||p===_i||!p.appendChild)&&(p=_i.body),g=p._gsap,g&&d&&g.width&&h&&g.time===ae.time&&!g.uncache?Ct(s/g.width*f):((d||o==="%")&&!dx[He(p,"display")]&&(a.position=He(e,"position")),p===e&&(a.position="static"),p.appendChild(Wi),v=Wi[l],p.removeChild(Wi),a.position="absolute",h&&d&&(g=Gi(p),g.time=ae.time,g.width=p[l]),Ct(c?v*s/f:v&&s?f/v*s:0))))},ri=function(e,t,i,n){var s;return wa||Ca(),t in ii&&t!=="transform"&&(t=ii[t],~t.indexOf(",")&&(t=t.split(",")[0])),ei[t]&&t!=="transform"?(s=nn(e,n),s=t!=="transformOrigin"?s[t]:s.svg?s.origin:ps(He(e,Oe))+" "+s.zOrigin+"px"):(s=e.style[t],(!s||s==="auto"||n||~(s+"").indexOf("calc("))&&(s=ds[t]&&ds[t](e,t,i)||He(e,t)||_l(e,t)||(t==="opacity"?1:0))),i&&!~(s+"").trim().indexOf(" ")?yi(e,t,s,i)+i:s},px=function(e,t,i,n){if(!i||i==="none"){var s=mr(t,e,1),o=s&&He(e,s,1);o&&o!==i?(t=s,i=o):t==="borderColor"&&(i=He(e,"borderTopColor"))}var a=new Qt(this._pt,e.style,t,0,1,ql),h=0,u=0,l,f,c,d,v,p,g,_,m,y,b,x;if(a.b=i,a.e=n,i+="",n+="",n==="auto"&&(e.style[t]=n,n=He(e,t)||n,e.style[t]=i),l=[i,n],Ul(l),i=l[0],n=l[1],c=i.match(ar)||[],x=n.match(ar)||[],x.length){for(;f=ar.exec(n);)g=f[0],m=n.substring(h,f.index),v?v=(v+1)%5:(m.substr(-5)==="rgba("||m.substr(-5)==="hsla(")&&(v=1),g!==(p=c[u++]||"")&&(d=parseFloat(p)||0,b=p.substr((d+"").length),g.charAt(1)==="="&&(g=hr(d,g)+b),_=parseFloat(g),y=g.substr((_+"").length),h=ar.lastIndex-y.length,y||(y=y||ne.units[t]||b,h===n.length&&(n+=y,a.e+=y)),b!==y&&(d=yi(e,t,p,y)||0),a._pt={_next:a._pt,p:m||u===1?m:",",s:d,c:_-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"?nf:rf;return ll.test(n)&&(a.e=0),this._pt=a,a},df={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},vx=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]=df[i]||i,t[1]=df[n]||n,t.join(" ")},gx=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],ei[a]&&(h=1,a=a==="transformOrigin"?Oe:yt),en(i,a);h&&(en(i,yt),o&&(o.svg&&i.removeAttribute("transform"),nn(i,1),o.uncache=1,sf(n)))}},ds={clearProps:function(e,t,i,n,s){if(s.data!=="isFromStart"){var o=e._pt=new Qt(e._pt,t,i,0,0,gx);return o.u=n,o.pr=-10,o.tween=s,e._props.push(i),1}}},rn=[1,0,0,1,0,0],pf={},vf=function(e){return e==="matrix(1, 0, 0, 1, 0, 0)"||e==="none"||!e},gf=function(e){var t=He(e,yt);return vf(t)?rn:t.substr(7).match(ul).map(Ct)},Aa=function(e,t){var i=e._gsap||Gi(e),n=e.style,s=gf(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"?rn:s):(s===rn&&!e.offsetParent&&e!==vr&&!i.svg&&(h=n.display,n.display="block",o=e.parentNode,(!o||!e.offsetParent)&&(u=1,a=e.nextElementSibling,vr.appendChild(e)),s=gf(e),h?n.display=h:en(e,"display"),u&&(a?o.insertBefore(e,a):o?o.appendChild(e):vr.removeChild(e))),t&&s.length>6?[s[0],s[1],s[4],s[5],s[12],s[13]]:s)},Ia=function(e,t,i,n,s,o){var a=e._gsap,h=s||Aa(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],g=h[3],_=h[4],m=h[5],y=t.split(" "),b=parseFloat(y[0])||0,x=parseFloat(y[1])||0,T,w,S,E;i?h!==rn&&(w=d*g-v*p)&&(S=b*(g/w)+x*(-p/w)+(p*m-g*_)/w,E=b*(-v/w)+x*(d/w)-(d*m-v*_)/w,b=S,x=E):(T=lf(e),b=T.x+(~y[0].indexOf("%")?b/100*T.width:b),x=T.y+(~(y[1]||y[0]).indexOf("%")?x/100*T.height:x)),n||n!==!1&&a.smooth?(_=b-u,m=x-l,a.xOffset=f+(_*d+m*p)-_,a.yOffset=c+(_*v+m*g)-m):a.xOffset=a.yOffset=0,a.xOrigin=b,a.yOrigin=x,a.smooth=!!n,a.origin=t,a.originIsAbsolute=!!i,e.style[Oe]="0px 0px",o&&(mi(o,a,"xOrigin",u,b),mi(o,a,"yOrigin",l,x),mi(o,a,"xOffset",f,a.xOffset),mi(o,a,"yOffset",c,a.yOffset)),e.setAttribute("data-svg-origin",b+" "+x)},nn=function(e,t){var i=e._gsap||new Wl(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=He(e,Oe)||"0",l,f,c,d,v,p,g,_,m,y,b,x,T,w,S,E,P,O,M,L,B,A,I,F,Y,z,N,C,U,$,j,it;return l=f=c=p=g=_=m=y=b=0,d=v=1,i.svg=!!(e.getCTM&&ff(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=Aa(e,i.svg),i.svg&&(i.uncache?(Y=e.getBBox(),u=i.xOrigin-Y.x+"px "+(i.yOrigin-Y.y)+"px",F=""):F=!t&&e.getAttribute("data-svg-origin"),Ia(e,F||u,!!F||i.originIsAbsolute,i.smooth!==!1,w)),x=i.xOrigin||0,T=i.yOrigin||0,w!==rn&&(O=w[0],M=w[1],L=w[2],B=w[3],l=A=w[4],f=I=w[5],w.length===6?(d=Math.sqrt(O*O+M*M),v=Math.sqrt(B*B+L*L),p=O||M?_r(M,O)*zi:0,m=L||B?_r(L,B)*zi+p:0,m&&(v*=Math.abs(Math.cos(m*gr))),i.svg&&(l-=x-(x*O+T*L),f-=T-(x*M+T*B))):(it=w[6],$=w[7],N=w[8],C=w[9],U=w[10],j=w[11],l=w[12],f=w[13],c=w[14],S=_r(it,U),g=S*zi,S&&(E=Math.cos(-S),P=Math.sin(-S),F=A*E+N*P,Y=I*E+C*P,z=it*E+U*P,N=A*-P+N*E,C=I*-P+C*E,U=it*-P+U*E,j=$*-P+j*E,A=F,I=Y,it=z),S=_r(-L,U),_=S*zi,S&&(E=Math.cos(-S),P=Math.sin(-S),F=O*E-N*P,Y=M*E-C*P,z=L*E-U*P,j=B*P+j*E,O=F,M=Y,L=z),S=_r(M,O),p=S*zi,S&&(E=Math.cos(S),P=Math.sin(S),F=O*E+M*P,Y=A*E+I*P,M=M*E-O*P,I=I*E-A*P,O=F,A=Y),g&&Math.abs(g)+Math.abs(p)>359.9&&(g=p=0,_=180-_),d=Ct(Math.sqrt(O*O+M*M+L*L)),v=Ct(Math.sqrt(I*I+it*it)),S=_r(A,I),m=Math.abs(S)>2e-4?S*zi:0,b=j?1/(j<0?-j:j):0),i.svg&&(F=e.getAttribute("transform"),i.forceCSS=e.setAttribute("transform","")||!vf(He(e,yt)),F&&e.setAttribute("transform",F))),Math.abs(m)>90&&Math.abs(m)<270&&(s?(d*=-1,m+=p<=0?180:-180,p+=p<=0?180:-180):(v*=-1,m+=m<=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=Ct(d),i.scaleY=Ct(v),i.rotation=Ct(p)+a,i.rotationX=Ct(g)+a,i.rotationY=Ct(_)+a,i.skewX=m+a,i.skewY=y+a,i.transformPerspective=b+o,(i.zOrigin=parseFloat(u.split(" ")[2])||0)&&(n[Oe]=ps(u)),i.xOffset=i.yOffset=0,i.force3D=ne.force3D,i.renderTransform=i.svg?mx:af?_f:_x,i.uncache=0,i},ps=function(e){return(e=e.split(" "))[0]+" "+e[1]},Ma=function(e,t,i){var n=jt(t);return Ct(parseFloat(t)+parseFloat(yi(e,"x",i+"px",n)))+n},_x=function(e,t){t.z="0px",t.rotationY=t.rotationX="0deg",t.force3D=0,_f(e,t)},Yi="0deg",sn="0px",Vi=") ",_f=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,g=i.transformPerspective,_=i.force3D,m=i.target,y=i.zOrigin,b="",x=_==="auto"&&e&&e!==1||_===!0;if(y&&(f!==Yi||l!==Yi)){var T=parseFloat(l)*gr,w=Math.sin(T),S=Math.cos(T),E;T=parseFloat(f)*gr,E=Math.cos(T),o=Ma(m,o,w*E*-y),a=Ma(m,a,-Math.sin(T)*-y),h=Ma(m,h,S*E*-y+y)}g!==sn&&(b+="perspective("+g+Vi),(n||s)&&(b+="translate("+n+"%, "+s+"%) "),(x||o!==sn||a!==sn||h!==sn)&&(b+=h!==sn||x?"translate3d("+o+", "+a+", "+h+") ":"translate("+o+", "+a+Vi),u!==Yi&&(b+="rotate("+u+Vi),l!==Yi&&(b+="rotateY("+l+Vi),f!==Yi&&(b+="rotateX("+f+Vi),(c!==Yi||d!==Yi)&&(b+="skew("+c+", "+d+Vi),(v!==1||p!==1)&&(b+="scale("+v+", "+p+Vi),m.style[yt]=b||"translate(0, 0)"},mx=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,g=i.xOffset,_=i.yOffset,m=i.forceCSS,y=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*=gr,u*=gr,x=Math.cos(h)*f,T=Math.sin(h)*f,w=Math.sin(h-u)*-c,S=Math.cos(h-u)*c,u&&(l*=gr,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=Ct(x),T=Ct(T),w=Ct(w),S=Ct(S)):(x=f,S=c,T=w=0),(y&&!~(o+"").indexOf("px")||b&&!~(a+"").indexOf("px"))&&(y=yi(d,"x",o,"px"),b=yi(d,"y",a,"px")),(v||p||g||_)&&(y=Ct(y+v-(v*x+p*w)+g),b=Ct(b+p-(v*T+p*S)+_)),(n||s)&&(E=d.getBBox(),y=Ct(y+n/100*E.width),b=Ct(b+s/100*E.height)),E="matrix("+x+","+T+","+w+","+S+","+y+","+b+")",d.setAttribute("transform",E),m&&(d.style[yt]=E)},yx=function(e,t,i,n,s){var o=360,a=Ut(s),h=parseFloat(s)*(a&&~s.indexOf("rad")?zi: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*ef)%o-~~(u/o)*o:f==="ccw"&&u>0&&(u=(u-o*ef)%o-~~(u/o)*o)),e._pt=c=new Qt(e._pt,t,i,n,u,ix),c.e=l,c.u="deg",e._props.push(i),c},mf=function(e,t){for(var i in t)e[i]=t[i];return e},xx=function(e,t,i){var n=mf({},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=nn(i,1),en(i,yt),i.setAttribute("transform",u)):(u=getComputedStyle(i)[yt],o[yt]=t,a=nn(i,1),o[yt]=u);for(h in ei)u=n[h],l=a[h],u!==l&&s.indexOf(h)<0&&(d=jt(u),v=jt(l),f=d!==v?yi(i,h,u,v):parseFloat(u),c=parseFloat(l),e._pt=new Qt(e._pt,a,h,f,c-f,Pa),e._pt.u=v||0,e._props.push(h));mf(a,n)};$t("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});ds[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 ri(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 yf={name:"css",register:Ca,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,_,m,y,b,x,T,w,S;wa||Ca(),this.styles=this.styles||of(e),S=this.styles.props,this.tween=i;for(p in t)if(p!=="autoRound"&&(l=t[p],!(oe[p]&&zl(p,t,i,n,e,s)))){if(d=typeof l,v=ds[p],d==="function"&&(l=l.call(i,n,e,s),d=typeof l),d==="string"&&~l.indexOf("random(")&&(l=Kr(l)),v)v(this,e,p,l,i)&&(w=1);else if(p.substr(0,2)==="--")u=(getComputedStyle(e).getPropertyValue(p)+"").trim(),l+="",vi.lastIndex=0,vi.test(u)||(g=jt(u),_=jt(l)),_?g!==_&&(u=yi(e,p,u,_)+_):g&&(l+=g),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],Ut(u)&&~u.indexOf("random(")&&(u=Kr(u)),jt(u+"")||(u+=ne.units[p]||jt(ri(e,p))||""),(u+"").charAt(1)==="="&&(u=ri(e,p))):u=ri(e,p),c=parseFloat(u),m=d==="string"&&l.charAt(1)==="="&&l.substr(0,2),m&&(l=l.substr(2)),f=parseFloat(l),p in ii&&(p==="autoAlpha"&&(c===1&&ri(e,"visibility")==="hidden"&&f&&(c=0),S.push("visibility",0,a.visibility),mi(this,a,"visibility",c?"inherit":"hidden",f?"inherit":"hidden",!f)),p!=="scale"&&p!=="transform"&&(p=ii[p],~p.indexOf(",")&&(p=p.split(",")[0]))),y=p in ei,y){if(this.styles.save(p),b||(x=e._gsap,x.renderTransform&&!t.parseTransform||nn(e,t.parseTransform),T=t.smoothOrigin!==!1&&x.smooth,b=this._pt=new Qt(this._pt,a,yt,0,1,x.renderTransform,x,0,-1),b.dep=1),p==="scale")this._pt=new Qt(this._pt,x,"scaleY",x.scaleY,(m?hr(x.scaleY,m+f):f)-x.scaleY||0,Pa),this._pt.u=0,o.push("scaleY",p),p+="X";else if(p==="transformOrigin"){S.push(Oe,0,a[Oe]),l=vx(l),x.svg?Ia(e,l,0,T,0,this):(_=parseFloat(l.split(" ")[2])||0,_!==x.zOrigin&&mi(this,x,"zOrigin",x.zOrigin,_),mi(this,a,p,ps(u),ps(l)));continue}else if(p==="svgOrigin"){Ia(e,l,1,T,0,this);continue}else if(p in pf){yx(this,x,p,c,m?hr(c,m+l):l);continue}else if(p==="smoothOrigin"){mi(this,x,"smooth",x.smooth,l);continue}else if(p==="force3D"){x[p]=l;continue}else if(p==="transform"){xx(this,l,e);continue}}else p in a||(p=mr(p)||p);if(y||(f||f===0)&&(c||c===0)&&!ex.test(l)&&p in a)g=(u+"").substr((c+"").length),f||(f=0),_=jt(l)||(p in ne.units?ne.units[p]:g),g!==_&&(c=yi(e,p,u,_)),this._pt=new Qt(this._pt,y?x:a,p,c,(m?hr(c,m+f):f)-c,!y&&(_==="px"||p==="zIndex")&&t.autoRound!==!1?nx:Pa),this._pt.u=_||0,g!==_&&_!=="%"&&(this._pt.b=u,this._pt.r=rx);else if(p in a)px.call(this,e,p,u,m?m+l:l);else if(p in e)this.add(e,p,u||e[p],m?m+l:l,n,s);else if(p!=="parseTransform"){ta(p,l);continue}y||(p in a?S.push(p,0,a[p]):S.push(p,1,u||e[p])),o.push(p)}}w&&Kl(this)},render:function(e,t){if(t.tween._time||!Ea())for(var i=t._pt;i;)i.r(e,i.d),i=i._next;else t.styles.revert()},get:ri,aliases:ii,getSetter:function(e,t,i){var n=ii[t];return n&&n.indexOf(",")<0&&(t=n),t in ei&&t!==Oe&&(e._gsap.x||ri(e,"x"))?i&&tf===i?t==="scale"?hx:ax:(tf=i||{})&&(t==="scale"?ux:lx):e.style&&!qo(e.style[t])?sx:~t.indexOf("-")?ox:ma(e,t)},core:{_removeProperty:en,_getMatrix:Aa}};he.utils.checkPrefix=mr,he.core.getStyleSaver=of,function(r,e,t,i){var n=$t(r+","+e+","+t,function(s){ei[s]=1});$t(e,function(s){ne.units[s]="deg",pf[s]=1}),ii[n[13]]=r+","+e,$t(i,function(s){var o=s.split(":");ii[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"),$t("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(r){ne.units[r]="px"}),he.registerPlugin(yf);var Zt=he.registerPlugin(yf)||he;Zt.core.Tween;const vs=16,on=8,Na=4,xf=.7,bx=.25;class Tx extends st{constructor({graphState:t}){super();R(this,"graphState");R(this,"dimensionsObject",new ht);R(this,"dots",[]);R(this,"unWatchers",[]);this.graphState=t,this.initDimensions(),this.initDots(),this.initWatchers()}initWatchers(){const{styleOptions:t}=this.graphState,i=W.watch(t,()=>{this.destroyDots(),this.initDots()});this.unWatchers.push(i)}initDimensions(){const t=on*3+Na*2,i=vs*2+on;this.dimensionsObject.width=t,this.dimensionsObject.height=i,this.addChild(this.dimensionsObject)}initDots(){const{colorTextDefault:t}=this.graphState.styleOptions.value,i=new Ce;i.beginFill(t),i.drawCircle(0,0,on/2),i.endFill(),i.alpha=0,i.position.y=vs;const n=i.clone();n.alpha=0,n.position.set(on+Na,vs);const s=i.clone();s.alpha=0,s.position.set((on+Na)*2,vs),this.dots.push(i,n,s),this.addChild(i,n,s),this.initAnimation()}initAnimation(){const t=(i,n=0)=>{Zt.to(i,{alpha:1,duration:xf,delay:n,onComplete:()=>{Zt.to(i,{alpha:0,duration:xf,onComplete:()=>t(i)})}})};this.dots.forEach((i,n)=>{t(i,n*bx)})}destroyDots(){this.dots.forEach(t=>{Zt.killTweensOf(t),t.destroy()}),this.dots=[]}destroy(){this.unWatchers.forEach(t=>t()),this.removeChildren(),this.dimensionsObject.destroy(),this.destroyDots(),super.destroy.call(this)}}const Da=10;let Ae,Ie,Me,Ne;const Fa={multisample:2,resolution:4};function gs(){Ae=new Map,Ie=new Map,Me=new Map,Ne=new Map}function wx(){Ae&&(Ae.forEach(r=>{r.destroy()}),Ae.clear(),Ae=void 0),Ie&&(Ie.forEach(({cap:r,body:e})=>{r.destroy(),e.destroy()}),Ie.clear(),Ie=void 0),Me&&(Me.forEach(r=>{r.destroy()}),Me.clear(),Me=void 0),Ne&&(Ne.forEach(({corner:r,edge:e})=>{r.destroy(),e.destroy()}),Ne.clear(),Ne=void 0)}function an({pixiApp:r,fill:e}){if(Ae||gs(),!(Ae!=null&&Ae.has(e))){const t=new Ce;t.beginFill(e),t.drawRect(0,0,Da,Da),t.endFill();const i=r.renderer.generateTexture(t);Ae.set(e,i)}return Ae.get(e)}function La({pixiApp:r,fill:e,borderRadius:t,boxCapWidth:i,height:n}){if(Ie||gs(),!(Ie!=null&&Ie.has(e))){const s=new Ce;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=an({pixiApp:r,fill:e}),a=r.renderer.generateTexture(s,Fa),h=o;Ie.set(e,{cap:a,body:h})}return Ie.get(e)}function bf({pixiApp:r,strokeColor:e,edgeWidth:t,edgeLength:i}){if(Me||gs(),!(Me!=null&&Me.has(e))){const n=new Ce;n.lineStyle(t,e,1,.5),n.moveTo(-i,-i),n.lineTo(0,0),n.lineTo(-i,i);const s=r.renderer.generateTexture(n,Fa);Me.set(e,s)}return Me.get(e)}function Ex({pixiApp:r,borderRadius:e,borderColor:t,borderWidth:i}){Ne||gs();const n={borderRadius:e,borderColor:t,borderWidth:i};if(!(Ne!=null&&Ne.has(n))){const s=new Ce;s.lineStyle(i,t),s.moveTo(0,e),s.bezierCurveTo(0,e,0,0,e,0);const o=an({pixiApp:r,fill:t}),a=r.renderer.generateTexture(s,Fa);Ne.set(n,{corner:a,edge:o})}return Ne.get(n)}const Tf=.2,wf="power2.out";class Ba extends st{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}=Ex({pixiApp:s,borderRadius:t,borderColor:i,borderWidth:n});this.topLeft=new ht(o),this.topRight=new ht(o),this.topRight.position.set(this.rectWidth,0),this.topRight.rotation=Math.PI/2,this.bottomRight=new ht(o),this.bottomRight.position.set(this.rectWidth,this.rectHeight),this.bottomRight.rotation=Math.PI,this.bottomLeft=new ht(o),this.bottomLeft.position.set(0,this.rectHeight),this.bottomLeft.rotation=Math.PI*1.5,this.topEdge=new ht(a),this.topEdge.position.set(this.borderRadius,0),this.topEdge.width=this.rectWidth-this.borderRadius*2,this.topEdge.height=n,this.rightEdge=new ht(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 ht(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 ht(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:Tf,ease:wf};Zt.to(s,{x:v,...p}),Zt.to(o,{x:v,y:this.rectHeight,...p}),Zt.to(a,{y:this.rectHeight,...p}),Zt.to(h,{width:v-c,...p}),Zt.to(u,{height:this.rectHeight-c,x:v-this.borderWidth,...p}),Zt.to(l,{width:v-c,y:this.rectHeight-this.borderWidth,...p}),Zt.to(f,{height:this.rectHeight-c,...p})}killTweens(){const{topRight:t,bottomRight:i,bottomLeft:n,topEdge:s,rightEdge:o,bottomEdge:a,leftEdge:h}=this;Zt.killTweensOf([t,i,n,s,o,a,h])}destroy(){this.killTweens(),super.destroy.call(this)}}const Ef=64,_s=20;class Sx extends st{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 st);R(this,"unWatchers",[]);R(this,"getXBezier",(t,i)=>{const{sourceX:n,targetX:s}=this,o=(s-n)/2;return t+(o>Ef?o:Ef)*(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,g=l+(o-l)*t,_=f+(d-f)*t,m=c+(v-c)*t,y=d+(p-d)*t,b=v+(g-v)*t,x=_+(y-_)*t,T=m+(b-m)*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 $y(i,this.edgePoints,t/Da)}initEdgePoints(){const t=[];for(let s=0;s<_s;s++){const o=s===_s-1?{x:this.targetX,y:this.targetY}:this.getPointBezierPosition(s/_s);t.push(new Z(o.x,o.y))}const i=this.getTargetAnchorPointPosition(),n=new Z(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=bf({pixiApp:s,strokeColor:a,edgeWidth:h,edgeLength:u}),f=new ht(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/_s);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(ka).getLocalBounds().width}getNodeY(t){return t.y+t.getChildByName(ka).getLocalBounds().height/2}getEdgeTexture(){const{pixiApp:t,styleOptions:i}=this.graphState,{colorEdge:n}=i.value;return an({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 Px extends st{constructor({pixiApp:t,labelText:i,styleOptions:n}){super();R(this,"pixiApp");R(this,"labelText");R(this,"styleOptions");R(this,"guideLine");R(this,"label");this.pixiApp=t,this.labelText=i,this.styleOptions=n,this.initGuideLine(),this.drawLabel(),this.interactive=!1}initGuideLine(){const{pixiApp:t}=this,{colorGuideLine:i}=this.styleOptions.value,n=an({pixiApp:t,fill:i});this.guideLine=new ht(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 Yr(this.styleOptions.value),{spacingGuideLabelPadding:n}=this.styleOptions.value;(t=this.label)==null||t.destroy(),this.label=new $n(this.labelText,i.timeMarkerLabel),this.label.position.set(n,n),this.addChild(this.label)}}updateHeight(t){this.guideLine.height=t}}let ue;const Rx=({minimumStartTime:r,graphXDomain:e,initialOverallTimeSpan:t})=>({dateToX:Ox(r,e,t),xToDate:Ax(r,e,t)}),Cx=({minimumStartTime:r,graphXDomain:e,initialOverallTimeSpan:t})=>(ue=Rx({minimumStartTime:r,graphXDomain:e,initialOverallTimeSpan:t}),ue);function Ox(r,e,t){return function(i){return Math.ceil((i.getTime()-r)*(e/t))}}function Ax(r,e,t){return function(i){return new Date(Math.ceil(r+i*(t/e)))}}const Ix=260,Ga=4e3;class Mx extends st{constructor({graphState:t,maximumEndDate:i,formatDateFns:n}){super();R(this,"graphState");R(this,"maximumEndDate");R(this,"formatDateFns");R(this,"unWatchers",[]);R(this,"idealGuideCount",10);R(this,"currentTimeGap",120);R(this,"labelFormatter",t=>t.toLocaleTimeString());R(this,"guides",new Map);this.graphState=t,this.maximumEndDate=i,this.formatDateFns=n,this.updateIdealGuideCount(),this.updateCurrentTimeGap(),this.createGuides(),this.initWatchers(),this.interactive=!1}initWatchers(){const{styleOptions:t}=this.graphState;this.unWatchers.push(W.watch(t,()=>{this.removeChildren(),this.guides.clear(),this.createGuides()},{deep:!0}))}updateGuides(){const t=this.currentTimeGap;this.updateCurrentTimeGap(),this.isRedrawRequired(t)?(this.guides.size>0&&(this.removeChildren(),this.guides.clear()),this.createGuides()):this.updateGuidePositions()}updateIdealGuideCount(){const{pixiApp:t}=this.graphState;this.idealGuideCount=Math.ceil(t.screen.width/Ix)}updateCurrentTimeGap(){const{viewport:t}=this.graphState,{minimumStartTime:i}=this.graphState.timeScaleProps,n=Math.ceil((t.right-t.left)/this.idealGuideCount),s=ue.xToDate(n).getTime()-i,o=ja.find(a=>a.ceiling>s)??ja[0];this.currentTimeGap=o.span,this.setLabelFormatter(o.labelFormat)}createGuides(){const{pixiApp:t,styleOptions:i}=this.graphState;let n;const s=ue.xToDate(ue.dateToX(this.maximumEndDate.value??new Date)+Ga);let o=new Date(Math.ceil(ue.xToDate(-Ga).getTime()/this.currentTimeGap)*this.currentTimeGap);for(this.currentTimeGap>Q.hour*6?o=tc(o):this.currentTimeGap>Q.hour&&(o=ec(o)),n=o;n.getTime()<s.getTime();){const a=new Px({pixiApp:t,labelText:this.labelFormatter(n),styleOptions:i});a.position.set(this.getGuidePosition(n),0),this.guides.set(n,a),this.addChild(a),n=new Date(n.getTime()+this.currentTimeGap)}}getGuidePosition(t){const{viewport:i}=this.graphState;return ue.dateToX(t)*i.scale._x+i.worldTransform.tx}updateGuidePositions(){const{pixiApp:t}=this.graphState;this.guides.forEach((i,n)=>{this.getGuidePosition(n)!==i.position.x&&i.position.set(this.getGuidePosition(n),0),i.height!==t.screen.height&&i.updateHeight(t.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 h;const{isRunning:t,viewport:i,timeScaleProps:n}=this.graphState,{minimumStartTime:s}=n;if(!t.value)return!1;const o=(h=Array.from(this.guides).pop())==null?void 0:h[1];if(!o||!this.maximumEndDate.value)return!1;const a=this.getGuidePosition(this.maximumEndDate.value)+Ga*i.scale._x-ue.dateToX(new Date(s+this.currentTimeGap))*i.scale._x;return o.x<a}destroy(){this.removeChildren(),this.guides.forEach(t=>t.destroy()),this.guides.clear(),this.unWatchers.forEach(t=>t()),super.destroy.call(this)}}const le={nodeDetails:"nodeDetailsClick",subNodesToggle:"subNodesToggleClick"},Ua="nodeResize",Sf={fadeIn:.25,move:.5},ka="box",Nx="None",Dx=.2;class Fx extends st{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 st);R(this,"leftBoxCap");R(this,"rightBoxCap");R(this,"boxBody");R(this,"subNodesToggle");R(this,"subNodesToggleWidth",0);R(this,"isSubNodesToggleFloating",!1);R(this,"isLoadingSubNodes",!1);R(this,"subNodesLoadingIndicator",null);R(this,"noSubNodesMessage",null);R(this,"label");R(this,"apxLabelWidth",0);R(this,"isLabelInBox",!0);R(this,"isSubNodesExpanded",!1);R(this,"subNodesOutlineContainer",new st);R(this,"subNodesOutline");R(this,"subNodesContent",null);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})});R(this,"getSubNodesData",()=>{if(!this.nodeData.subFlowRunId)return[];const{expandedSubNodes:t}=this.graphState,i=t.value.get(this.nodeData.subFlowRunId).data;return"value"in i?i.value:i});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(),this.noSubNodesMessage&&this.drawNoSubNodesMessage()},{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,v;if(this.nodeData.subFlowRunId){if(!this.isSubNodesExpanded&&f.value.has(this.nodeData.subFlowRunId)){if(this.isSubNodesExpanded=!0,(d=this.subNodesToggle)==null||d.setExpanded(),this.getSubNodesData().length===0&&!this.isLoadingSubNodes){this.isLoadingSubNodes=!0,this.drawLoadingSubNodes();return}this.expandSubNodes();return}if(this.isSubNodesExpanded){if(!f.value.has(this.nodeData.subFlowRunId)){(v=this.subNodesToggle)==null||v.setCollapsed(),this.isSubNodesExpanded=!1,this.isLoadingSubNodes=!1,this.collapseSubNodes();return}const p=this.getSubNodesData();if(this.isLoadingSubNodes&&(this.isLoadingSubNodes=!1,this.destroySubNodesLoadingIndicator(),p.length===0)){this.drawNoSubNodesMessage();return}if(!this.subNodesContent){this.expandSubNodes();return}this.subNodesContent.update(p)}}},{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<Dx){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=ee(l),c=this.getOutlineWidth();this.subNodesOutline=new Ba({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=ka,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=ee(f);(p=this.leftBoxCap)==null||p.destroy(),(g=this.boxBody)==null||g.destroy(),(_=this.rightBoxCap)==null||_.destroy(),this.box.removeChildren();const{cap:d,body:v}=La({pixiApp:t,fill:c,borderRadius:l,boxCapWidth:u,height:a});this.leftBoxCap=new ht(d),this.boxBody=new ht(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 ht(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 kx({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 Yr(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=ce.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 $n(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 Ba({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;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.subNodesContent)==null||n.destroy(),this.subNodesContent=new Cf({isSubNodes:!0,graphData:i,graphState:this.graphState}),this.subNodesContent.on(le.nodeDetails,s=>{this.emit(le.nodeDetails,s)}),this.subNodesContent.on(le.subNodesToggle,s=>{this.emitSubNodesToggle(s)}),this.updateSubNodesContentPosition(),this.subNodesContent.on(Xa,()=>this.updateSubNodesContentPosition()),this.addChild(this.subNodesContent),this.initSubNodesTicker()}drawLoadingSubNodes(){const{graphState:t,box:i}=this,{spacingNodeMargin:n}=t.styleOptions.value;this.destroySubNodesLoadingIndicator(),this.subNodesLoadingIndicator=new Tx({graphState:t}),this.subNodesLoadingIndicator.position.set(i.width/2-this.subNodesLoadingIndicator.width/2,i.y+i.height+n),this.addChild(this.subNodesLoadingIndicator),this.initSubNodesTicker()}async drawNoSubNodesMessage(){const{box:t}=this,{styleOptions:i}=this.graphState,n=await Yr(i.value);this.destroyNoSubNodesMessage(),this.noSubNodesMessage=new $n(Nx,n.nodeTextSubdued),this.noSubNodesMessage.anchor.set(.5,0),this.noSubNodesMessage.position.set(t.width/2,t.y+t.height+i.value.spacingNodeMargin),this.addChild(this.noSubNodesMessage),this.initSubNodesTicker()}updateSubNodesContentPosition(){const{subNodesContent:t,box:i}=this,{spacingNodeMargin:n}=this.graphState.styleOptions.value;if(!t)return;const s=t.getEarliestNodeStart(),o=s?-ue.dateToX(s):0,a=i.y+i.height+n;t.position.set(o,a)}initSubNodesTicker(){const{pixiApp:t}=this.graphState;this.subNodesContentTicker||(this.subNodesHeight=0,this.subNodesContentTicker=()=>{const i=this.getSubContentHeight();i!==this.subNodesHeight&&(this.updateSubNodesOutlineSize(),this.updateSelectedRingSize(),this.subNodesHeight=i,this.emit(Ua))},t.ticker.add(this.subNodesContentTicker,null,re.LOW))}async collapseSubNodes(){this.destroySubNodesContent(),this.updateSelectedRingSize(),await this.updateSubNodesOutlineSize(),this.emit(Ua)}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||!this.nodeData.start)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?ue.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}Zt.to(this,{x:u,y:h,duration:Sf.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,subNodesOutline:n,nodeHeight:s}=this,{spacingSubNodesOutlineOffset:o,alphaSubNodesOutlineDimmed:a,spacingNodeMargin:h}=this.graphState.styleOptions.value,{suppressMotion:u}=this.graphState,l=this.getOutlineWidth(),f=i?s+this.getSubContentHeight()+h:s;n.resize({width:l,height:f,animate:!0}),await new Promise(c=>{const d=t||u.value?0:Tf,v=i?-o:o,p=i?-o:o,g=i?1:a;if(t||u.value){n.position.set(v,p),n.alpha=g,c(null);return}Zt.to(n,{x:v,y:p,alpha:g,duration:d,ease:wf}).then(()=>c(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;if(!n.start)return 0;const s=t?i:i*2,o=ue.dateToX(n.end??new Date)-ue.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(le.nodeDetails,n)}getSubContentHeight(){var i,n,s;const{spacingNodeMargin:t}=this.graphState.styleOptions.value;return(i=this.subNodesContent)!=null&&i.height?this.subNodesContent.height:(n=this.subNodesLoadingIndicator)!=null&&n.height?this.subNodesLoadingIndicator.height+t:(s=this.noSubNodesMessage)!=null&&s.height?this.noSubNodesMessage.height+t:0}emitSubNodesToggle(t){this.emit(le.subNodesToggle,t??this.nodeData.subFlowRunId)}destroySubNodesContent(){var t;this.subNodesContentTicker&&(this.graphState.pixiApp.ticker.remove(this.subNodesContentTicker),this.subNodesContentTicker=null),this.destroyNoSubNodesMessage(),this.destroySubNodesLoadingIndicator(),(t=this.subNodesContent)==null||t.destroy(),this.subNodesContent=null}destroySubNodesLoadingIndicator(){var t;(t=this.subNodesLoadingIndicator)==null||t.destroy(),this.subNodesLoadingIndicator=null}destroyNoSubNodesMessage(){var t;(t=this.noSubNodesMessage)==null||t.destroy(),this.noSubNodesMessage=null}destroyRunningNodeTicker(){this.runningNodeTicker&&(this.graphState.pixiApp.ticker.remove(this.runningNodeTicker),this.runningNodeTicker=null)}killTweens(){Zt.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(le.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 Pf="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2NvbnN0IGI9KHttaW5pbXVtU3RhcnRUaW1lOmUsZ3JhcGhYRG9tYWluOm4saW5pdGlhbE92ZXJhbGxUaW1lU3Bhbjp0fSk9Pih7ZGF0ZVRvWDpQKGUsbix0KSx4VG9EYXRlOkkoZSxuLHQpfSk7ZnVuY3Rpb24gUChlLG4sdCl7cmV0dXJuIGZ1bmN0aW9uKG8pe3JldHVybiBNYXRoLmNlaWwoKG8uZ2V0VGltZSgpLWUpKihuL3QpKX19ZnVuY3Rpb24gSShlLG4sdCl7cmV0dXJuIGZ1bmN0aW9uKG8pe3JldHVybiBuZXcgRGF0ZShNYXRoLmNlaWwoZStvKih0L24pKSl9fWNvbnN0IGc9MDtsZXQgeSxEPTE0LHY9MCxoPSJ3YXRlcmZhbGwiLGQ9W107Y29uc3QgYT17fTtvbm1lc3NhZ2U9YXN5bmMoe2RhdGE6e2xheW91dFNldHRpbmc6ZSxncmFwaERhdGE6bixhcHhDaGFyYWN0ZXJXaWR0aDp0LHNwYWNpbmdNaW5pbXVtTm9kZUVkZ2VHYXA6byx0aW1lU2NhbGVQcm9wczppLGNlbnRlclZpZXdwb3J0QWZ0ZXI6c319KT0+e2Zvcihjb25zdCByIGluIGEpZGVsZXRlIGFbcl07aWYobyYmKHY9byksZSYmKGg9ZSksdCYmKEQ9dCksaSl7Y29uc3R7bWluaW11bVN0YXJ0VGltZTpyLGdyYXBoWERvbWFpbjpjLGluaXRpYWxPdmVyYWxsVGltZVNwYW46dX09aTt5PWIoe21pbmltdW1TdGFydFRpbWU6cixncmFwaFhEb21haW46Yyxpbml0aWFsT3ZlcmFsbFRpbWVTcGFuOnV9KX1pZihuKXtjb25zdCByPUpTT04ucGFyc2Uobik7eSYmKGV8fGQhPT1yKSYmKGQ9TChyKSxhd2FpdCBTKCkscG9zdE1lc3NhZ2Uoe2xheW91dDphLGNlbnRlclZpZXdwb3J0QWZ0ZXI6c30pKX19O2Z1bmN0aW9uIEwoZSl7cmV0dXJuIGUuZmlsdGVyKE8pLm1hcChuPT4obi5zdGFydD1uZXcgRGF0ZShuLnN0YXJ0KSxuLmVuZCYmKG4uZW5kPW5ldyBEYXRlKG4uZW5kKSksbikpLnNvcnQoKG4sdCk9Pm4uc3RhcnQuZ2V0VGltZSgpLXQuc3RhcnQuZ2V0VGltZSgpKX1mdW5jdGlvbiBPKGUpe3JldHVybiB0eXBlb2YgZT09Im9iamVjdCImJiJzdGFydCJpbiBlfWFzeW5jIGZ1bmN0aW9uIFMoKXtoPT09IndhdGVyZmFsbCImJlgoKSxoPT09Im5lYXJlc3RQYXJlbnQiJiZhd2FpdCBDKCksQigpfWZ1bmN0aW9uIFgoKXtkLmZvckVhY2goKGUsbik9PnthW2UuaWRdPXtwb3NpdGlvbjpuLHN0YXJ0WDowLGVuZFg6MH19KX1hc3luYyBmdW5jdGlvbiBDKCl7Zm9yIGF3YWl0KGNvbnN0IGUgb2YgZCl7aWYoIWUuc3RhcnQpY29udGludWU7Y29uc3Qgbj15LmRhdGVUb1goZS5lbmQ/bmV3IERhdGUoZS5lbmQpOm5ldyBEYXRlKSx0PWUubGFiZWwubGVuZ3RoKkQsbz1uK3QsaT1lLmlkIGluIGE/YVtlLmlkXS5zdGFydFg6eS5kYXRlVG9YKG5ldyBEYXRlKGUuc3RhcnQpKSxzPWF3YWl0IEEoZSxpKTthW2UuaWRdPXtwb3NpdGlvbjpzLHN0YXJ0WDppLGVuZFg6b319fWFzeW5jIGZ1bmN0aW9uIEEoZSxuKXtpZihlLnVwc3RyZWFtRGVwZW5kZW5jaWVzJiZlLnVwc3RyZWFtRGVwZW5kZW5jaWVzLmxlbmd0aD09PTEpe2lmKGUudXBzdHJlYW1EZXBlbmRlbmNpZXNbMF1pbiBhKXtjb25zdCB0PWFbZS51cHN0cmVhbURlcGVuZGVuY2llc1swXV07cmV0dXJuIGF3YWl0IHcodCxuKX1yZXR1cm4gY29uc29sZS53YXJuKCJ0aW1lbGluZU5vZGVzIGxheW91dCB3b3JrZXI6IFBhcmVudCBub2RlIG5vdCBmb3VuZCBpbiBsYXlvdXQiLGUudXBzdHJlYW1EZXBlbmRlbmNpZXNbMF0pLGd9aWYoZS51cHN0cmVhbURlcGVuZGVuY2llcyYmZS51cHN0cmVhbURlcGVuZGVuY2llcy5sZW5ndGg+MCl7Y29uc3Qgbz1lLnVwc3RyZWFtRGVwZW5kZW5jaWVzLm1hcChjPT5hW2NdKS5maWx0ZXIoYz0+ISFjKS5tYXAoYz0+Yy5wb3NpdGlvbikscz1vLnJlZHVjZSgoYyx1KT0+Yyt1LDApL28ubGVuZ3RoLHI9TWF0aC5yb3VuZChzKTtpZihtKG4scikpe2NvbnN0IGM9VChuLHIpLHU9Yy5maWx0ZXIocD0+e3ZhciBsO3JldHVybihsPWUudXBzdHJlYW1EZXBlbmRlbmNpZXMpPT1udWxsP3ZvaWQgMDpsLmluY2x1ZGVzKHApfSk7aWYodS5sZW5ndGg+MHx8Yy5sZW5ndGg+MSl7Y29uc3RbcF09dS5sZW5ndGg+MD91OmMsbD1hW3BdO3JldHVybiBsLm5leHREZXBlbmRlbmN5U2hvdmU9aihvLHIsbC5uZXh0RGVwZW5kZW5jeVNob3ZlKSxhd2FpdCB3KGwsbil9cmV0dXJuIGF3YWl0IGsoe2NvbXBldGluZ0xheW91dEl0ZW1JZDpjWzBdLHVwc3RyZWFtUG9zaXRpb25zOm8sbm9kZVN0YXJ0WDpuLGRlc2lyZWRQb3NpdGlvbjpyfSl9fXJldHVybiBOKG4sZyl9ZnVuY3Rpb24gTihlLG4pe3JldHVybiBtKGUsbik/TihlLG4rMSk6bn1hc3luYyBmdW5jdGlvbiB3KGUsbil7ZS5uZXh0RGVwZW5kZW5jeVNob3ZlIT09MSYmZS5uZXh0RGVwZW5kZW5jeVNob3ZlIT09LTEmJihlLm5leHREZXBlbmRlbmN5U2hvdmU9MSk7Y29uc3R7cG9zaXRpb246dCxuZXh0RGVwZW5kZW5jeVNob3ZlOm99PWU7cmV0dXJuIG0obix0KT9vPT09MSYmIW0obix0KzEpPyhlLm5leHREZXBlbmRlbmN5U2hvdmU9LTEsdCsxKTptKG4sdC0xKT8oYXdhaXQgZih7ZGlyZWN0aW9uOm8sbm9kZVN0YXJ0WDpuLGRlc2lyZWRQb3NpdGlvbjp0K299KSxlLm5leHREZXBlbmRlbmN5U2hvdmU9bz09PTE/LTE6MSx0K28pOihlLm5leHREZXBlbmRlbmN5U2hvdmU9MSx0LTEpOnR9ZnVuY3Rpb24gbShlLG4pe2NvbnN0IHQ9T2JqZWN0LmtleXMoYSk7cmV0dXJuIHQubGVuZ3RoPjAmJnQuc29tZShvPT57Y29uc3QgaT1hW29dO3JldHVybiB4KHtmaXJzdE5vZGVFbmRYOmkuZW5kWCxmaXJzdE5vZGVQb3NpdGlvbjppLnBvc2l0aW9uLGxhc3ROb2RlU3RhcnRYOmUsbGFzdE5vZGVQb3NpdGlvbjpufSl9KX1hc3luYyBmdW5jdGlvbiBmKHtkaXJlY3Rpb246ZSxub2RlU3RhcnRYOm4sZGVzaXJlZFBvc2l0aW9uOnR9KXtjb25zdCBvPVQobix0KTtpZihvKWZvciBhd2FpdChjb25zdCBpIG9mIG8pe2NvbnN0IHM9YVtpXSxyPXMucG9zaXRpb24rZTthd2FpdCBmKHtkaXJlY3Rpb246ZSxub2RlU3RhcnRYOnMuc3RhcnRYLGRlc2lyZWRQb3NpdGlvbjpyfSkscy5wb3NpdGlvbj1yfX1mdW5jdGlvbiB4KHtmaXJzdE5vZGVFbmRYOmUsZmlyc3ROb2RlUG9zaXRpb246bixsYXN0Tm9kZVN0YXJ0WDp0LGxhc3ROb2RlUG9zaXRpb246b30pe3JldHVybiBuPT09byYmZSt2Pj10fWZ1bmN0aW9uIFQoZSxuKXtjb25zdCB0PVtdO2lmKE9iamVjdC5rZXlzKGEpLmZvckVhY2gobz0+e2NvbnN0IGk9YVtvXTt4KHtmaXJzdE5vZGVFbmRYOmkuZW5kWCxmaXJzdE5vZGVQb3NpdGlvbjppLnBvc2l0aW9uLGxhc3ROb2RlU3RhcnRYOmUsbGFzdE5vZGVQb3NpdGlvbjpufSkmJnQucHVzaChvKX0pLHQubGVuZ3RoIT09MClyZXR1cm4gdC5zb3J0KChvLGkpPT57Y29uc3Qgcz1hW29dLHI9YVtpXTtyZXR1cm4gcy5lbmRYPHIuZW5kWD8xOnMuZW5kWD5yLmVuZFg/LTE6MH0pLHR9ZnVuY3Rpb24gaihlLG4sdCl7Y29uc3Qgbz1lLmZpbHRlcihzPT5zPG4pLmxlbmd0aCxpPWUuZmlsdGVyKHM9PnM+bikubGVuZ3RoO3JldHVybiBvPmk/LTE6dD8/MX1hc3luYyBmdW5jdGlvbiBrKHtkZXNpcmVkUG9zaXRpb246ZSxub2RlU3RhcnRYOm4sdXBzdHJlYW1Qb3NpdGlvbnM6dCxjb21wZXRpbmdMYXlvdXRJdGVtSWQ6b30pe2NvbnN0IGk9YVtvXSxbcyxyXT1FKG8pLGM9dC5maWx0ZXIocD0+cDxlKS5sZW5ndGgsdT10LmZpbHRlcihwPT5wPmUpLmxlbmd0aDtpZihjPnUpe2lmKHM+ciYmcz5jKXJldHVybiBhd2FpdCBmKHtkaXJlY3Rpb246LTEsbm9kZVN0YXJ0WDpuLGRlc2lyZWRQb3NpdGlvbjplfSksZTtpZihyPnMpcmV0dXJuIGF3YWl0IGYoe2RpcmVjdGlvbjoxLG5vZGVTdGFydFg6bixkZXNpcmVkUG9zaXRpb246ZX0pLGU7aS5uZXh0RGVwZW5kZW5jeVNob3ZlPS0xfWlmKHU+Yyl7aWYocj5zJiZyPnUpcmV0dXJuIGF3YWl0IGYoe2RpcmVjdGlvbjoxLG5vZGVTdGFydFg6bixkZXNpcmVkUG9zaXRpb246ZX0pLGU7aWYocz5yKXJldHVybiBhd2FpdCBmKHtkaXJlY3Rpb246LTEsbm9kZVN0YXJ0WDpuLGRlc2lyZWRQb3NpdGlvbjplfSksZTtpLm5leHREZXBlbmRlbmN5U2hvdmU9MX1yZXR1cm4gYXdhaXQgdyhpLG4pfWZ1bmN0aW9uIEUoZSl7dmFyIG87Y29uc3Qgbj1kLmZpbmQoaT0+aS5pZD09PWUpLHQ9YVtlXTtyZXR1cm4oKG89bi51cHN0cmVhbURlcGVuZGVuY2llcyk9PW51bGw/dm9pZCAwOm8ucmVkdWNlKChpLHMpPT57aWYoZSBpbiBhKXtjb25zdCByPWFbc107cmV0dXJuIHIucG9zaXRpb248dC5wb3NpdGlvbiYmKGlbMF0rPTEpLHIucG9zaXRpb24+dC5wb3NpdGlvbiYmKGlbMV0rPTEpLGl9cmV0dXJuIGNvbnNvbGUud2Fybigibm9kZUxheW91dC53b3JrZXIudHM6IFBhcmVudCBub2RlIG5vdCBmb3VuZCBvbiBsYXlvdXQgZGF0YSIsZSksaX0sWzAsMF0pKT8/WzAsMF19ZnVuY3Rpb24gQigpe2NvbnN0IGU9T2JqZWN0LnZhbHVlcyhhKS5yZWR1Y2UoKG4sdCk9PnQucG9zaXRpb248bj90LnBvc2l0aW9uOm4sMCk7ZTwwJiZPYmplY3QudmFsdWVzKGEpLmZvckVhY2gobj0+e24ucG9zaXRpb24rPU1hdGguYWJzKGUpfSl9fSkoKTsKLy8jIHNvdXJjZU1hcHBpbmdVUkw9bm9kZUxheW91dC53b3JrZXItMzBjMmM3MTUuanMubWFwCi8vIyBzb3VyY2VNYXBwaW5nVVJMPWFzc2V0cy9ub2RlTGF5b3V0Lndvcmtlci0zMGMyYzcxNS5qcy5tYXA=",Rf=typeof window<"u"&&window.Blob&&new Blob([atob(Pf)],{type:"text/javascript;charset=utf-8"});function Lx(){const r=Rf&&(window.URL||window.webkitURL).createObjectURL(Rf);try{return r?new Worker(r):new Worker("data:application/javascript;base64,"+Pf)}finally{r&&(window.URL||window.webkitURL).revokeObjectURL(r)}}const Xa="timelineUpdateEvent";class Cf extends st{constructor({nodeContentContainerName:t,isSubNodes:i,graphData:n,graphState:s}){super();R(this,"layoutWorker",new Lx);R(this,"isSubNodes");R(this,"graphData");R(this,"graphDataLookup",new Map);R(this,"graphState");R(this,"nodeContainer",new st);R(this,"nodeRecords",new Map);R(this,"layout",W.ref({}));R(this,"layoutRows",W.ref([]));R(this,"edgeContainer",new st);R(this,"edgeRecords",[]);R(this,"unWatchers",[]);R(this,"isSelectionPathHighlighted",!1);t&&(this.nodeContainer.name=t),this.isSubNodes=i,this.graphData=n,this.setGraphDataLookup(),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 Yr(t.value),{spacingMinimumNodeEdgeGap:h}=t.value,u=ce.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:Sf.move*1e3*1.1),this.emit(Xa)},this.layoutWorker.postMessage(l.data)}initDeselectLayer(){if(this.isSubNodes)return;const{pixiApp:t,viewport:i}=this.graphState,n=new i0(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}))}createNode(t){const{graphState:i,layout:n,layoutRows:s}=this,o=new Fx({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(Ua,()=>{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 Sx({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,this.setGraphDataLookup(),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(Xa)}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()}updateLayoutRows(t=0){const{layout:i}=this,{spacingNodeMargin:n,spacingNodeSelectionMargin:s}=this.graphState.styleOptions.value,o=Math.max(...Object.values(i.value).map(u=>u.position));let a=[];const h=Object.keys(i.value).reduce((u,l)=>{var v;const f=i.value[l].position,c=u.get(f)??0,d=((v=this.nodeRecords.get(l))==null?void 0:v.height)??0;return u.set(f,Math.max(d,c)),u},new Map);for(let u=t;u<=o;u++){const l=a[u-1],f=h.get(u)??0;if(l===void 0){a.push({yPos:0,height:f});continue}const c=l.yPos+l.height-s*2+n;a.push({yPos:c,height:f})}t>0&&(a=this.layoutRows.value.slice(0,t).concat(a)),this.layoutRows.value=a}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.getNodeData(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})}setGraphDataLookup(){this.graphData.forEach(t=>{this.graphDataLookup.set(t.id,t)})}registerEmits(t){t.on(le.nodeDetails,i=>{this.emit(le.nodeDetails,i)}),t.on(le.subNodesToggle,i=>{this.emit(le.subNodesToggle,i)})}emitNullSelection(){this.emit(le.nodeDetails,null)}getNodeData(t){return this.graphDataLookup.get(t)}getEarliestNodeStart(){return this.graphData.length<1?null:this.graphData.reduce((i,n)=>n.start&&n.start.getTime()<i.getTime()?n.start:i,new Date)}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||wx(),super.destroy.call(this)}}class Bx extends st{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 Ce);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 Yr(this.styleOptions.value),{timeBySeconds:s}=this.formatDateFns.value,o=s(new Date);this.label=new $n(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=ue.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 Ha={leftCap:"leftCap",body:"body",rightCap:"rightCap"},Gx=.2,Ux=.2;class kx extends st{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 st);R(this,"hoverShade",new st);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<Ux?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}=La({pixiApp:n,fill:o,borderRadius:a,boxCapWidth:a,height:t}),l=new ht(h),f=new ht(u);f.x=a,f.width=t-a*2,f.height=t;const c=new ht(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=ee(a);t.removeChildren();const{cap:l,body:f}=La({pixiApp:this.graphState.pixiApp,fill:n?o:u,borderRadius:s,boxCapWidth:s,height:i}),c=new ht(l);c.name=Ha.leftCap,c.alpha=n?1:h;const d=new ht(f);d.name=Ha.body,d.x=s,d.width=n?i-s*2:i-s,d.height=i,d.alpha=n?1:h;const v=new ht(l);v.name=Ha.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=an({pixiApp:n,fill:i});this.divider=new ht(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=bf({pixiApp:s,strokeColor:i,edgeWidth:2,edgeLength:8});this.toggleArrow=new ht(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 Ba({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&&Zt.to(this.toggleArrow,{rotation:t,duration:i.value?0:Gx,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 Xx=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,visibleDateRange:null},emits:["selection","subNodeToggle","update:visibleDateRange"],setup(r,{expose:e,emit:t}){const i=r,n=500;e({centerViewport:kt,moveViewportCenter:qt});const s=W.computed({get(){return i.visibleDateRange},set(k){t("update:visibleDateRange",k)}}),o=W.ref(),a=W.computed(()=>{var k;return((k=i.theme)==null?void 0:k.node)??Ja}),h=W.computed(()=>{var k;return ic((k=i.theme)==null?void 0:k.defaults)}),u=W.computed(()=>i.selectedNodeId??null),l=W.computed(()=>i.layout??"nearestParent"),f=W.computed(()=>i.isRunning??!1),c=W.computed(()=>i.hideEdges??!1),d=W.computed(()=>i.subNodeLabels??new Map),v=W.computed(()=>i.expandedSubNodes??new Map),p=W.computed(()=>{const k=window.matchMedia("(prefers-reduced-motion: reduce)").matches;return i.graphData.length>n||k}),g=W.ref(!1),_=W.computed(()=>({...$a,...i.formatDateFns})),m={timelineGuides:0,viewport:10,playhead:20},y=W.ref(!0);let b,x;const T=new jf;let w,S;const E=W.ref();let P,O,M,L,B,A=null;const I="rootNodesContainer";let F,Y=null;W.onMounted(async()=>{if(!o.value){console.error("Stage reference not found in initPixiApp");return}$(),M=Cx(w),b=r0(o.value),b.stage.sortableChildren=!0,x=await o0(o.value,b),x.zIndex=m.viewport,N(),U(),it(),vt(),Lt(),J(),ft(),xt(),y.value=!1}),W.onBeforeUnmount(()=>{z()});function z(){L.destroy(),B==null||B.destroy(),F.destroy(),x.destroy(),b.destroy(!0)}function N(){x.on("drag-start",()=>{g.value=!0}).on("drag-end",()=>{g.value=!1})}function C(){s.value={startDate:M.xToDate(x.left),endDate:M.xToDate(x.right),internalOrigin:!0}}function U(){x.on("moved",()=>{C()})}W.watch(()=>i.visibleDateRange,k=>{if(k&&!k.internalOrigin){const dt=M.dateToX(k.startDate),Wt=M.dateToX(k.endDate),te=dt+(Wt-dt)/2;x.fitWidth(Wt-dt,!0),x.moveCenter(te,x.center.y)}});function $(){const dt=i.graphData.filter(Ka).map(({start:ni,end:si})=>({start:ni,end:si}));f.value&&dt.push({start:new Date,end:new Date});const{min:Wt,max:te,span:ze}=Qf(dt,6e4);S=Wt,E.value=te,P=ze,O=j(),w={minimumStartTime:S.getTime(),graphXDomain:O,initialOverallTimeSpan:P}}function j(){const{spacingNodeYPadding:k,textLineHeightDefault:dt,spacingNodeMargin:Wt,spacingSubNodesOutlineOffset:te}=h.value,ze=i.graphData.length,ni=dt+k*2+te*2+Wt,si=o.value.clientWidth/o.value.clientHeight,sb=ni*ze*si,ob=ze>=120?ze/100:1.2;return sb*ob}function it(){e0(h.value),W.watch(h,k=>{t0(k)})}function vt(){Y={pixiApp:b,viewport:x,cull:T,cullScreen:at,timeScaleProps:w,styleOptions:h,styleNode:a,layoutSetting:l,isRunning:f,hideEdges:c,subNodeLabels:d,selectedNodeId:u,expandedSubNodes:v,suppressMotion:p,centerViewport:kt}}function ft(){f.value&&(B=new Bx({viewportRef:x,appRef:b,cull:T,formatDateFns:_,styleOptions:h}),B.zIndex=m.playhead,b.stage.addChild(B),It())}function It(){A||!B||(A=()=>{if(f.value&&B&&!B.destroyed){const k=B.position.x>0&&B.position.x<b.screen.width;if(E.value=new Date,B.updatePosition(),!x.moving&&k&&B.position.x>b.screen.width-h.value.spacingViewportPaddingDefault){const dt=M.xToDate(x.left);x.zoomPercent(-.1,!0),x.left=M.dateToX(dt)}}},b.ticker.add(A))}W.watch(f,k=>{y.value||(k&&(!B||B.destroyed)&&ft(),!k&&B&&A&&(B.destroy(),b.ticker.remove(A),A=null))});function Lt(){Y&&(L=new Mx({graphState:Y,maximumEndDate:E,formatDateFns:_}),L.zIndex=m.timelineGuides,b.stage.addChild(L),b.ticker.add(()=>{L.updateGuides()}))}function xt(){x.on("frame-end",()=>{x.dirty&&(at(),x.dirty=!1)})}function rt(){T.uncull()}function ct(){at()}function at(){T.cull(b.renderer.screen)}function J(){Y&&(F=new Cf({nodeContentContainerName:I,graphData:i.graphData,graphState:Y}),x.addChild(F),F.on(le.nodeDetails,k=>{g.value||t("selection",k)}),F.on(le.subNodesToggle,k=>{g.value||t("subNodeToggle",k)}),W.watch(()=>i.graphData,()=>{F.update(i.graphData),x.dirty=!0}))}function kt({skipAnimation:k}={}){const{spacingViewportPaddingDefault:dt}=h.value,Wt=500;rt();const{x:te,y:ze,width:ni,height:si}=F.getChildByName(I).getLocalBounds();ct();const xr=x.findFit(ni+dt*2,si+dt*2);x.animate({position:{x:te+ni/2,y:ze+si/2},scale:xr>1?1:xr,time:k||p.value?0:Wt,ease:"easeInOutQuad",removeOnInterrupt:!0,callbackOnComplete:()=>{k&&C()}})}function qt({xOffset:k,yOffset:dt}){const{x:Wt,y:te}=x.transform.position;x.setTransform(Wt+k,te+dt,x.transform.scale.x,x.transform.scale.y)}return(k,dt)=>(W.openBlock(),W.createElementBlock("div",{ref_key:"stage",ref:o,class:"g-flow-run-timeline"},null,512))}}),yb="";class fe{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 Hx=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Wx(r,e,t){return t={path:e,exports:{},require:function(i,n){return zx(i,n??t.path)}},r(t,t.exports),t.exports}function zx(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var Of=Wx(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(Hx)});function ms(r,e){if(r){if(typeof r=="function")return r;if(typeof r=="string")return Of[r]}else return Of[e]}const Yx={removeOnInterrupt:!1,ease:"linear",time:1e3};class We extends fe{__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),We.prototype.__init.call(this),We.prototype.__init2.call(this),We.prototype.__init3.call(this),We.prototype.__init4.call(this),We.prototype.__init5.call(this),We.prototype.__init6.call(this),We.prototype.__init7.call(this),this.options=Object.assign({},Yx,t),this.options.ease=ms(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 Z(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 Z(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 ys(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 Vx={sides:"all",friction:.5,time:150,ease:"easeInOutSine",underflow:"center",bounceBox:null};class Af extends fe{constructor(e,t={}){super(e),this.options=Object.assign({},Vx,t),this.ease=ms(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 Z(t*this.parent.scale.x,i*this.parent.scale.y),bottomRight:new Z(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 Z(0,0),bottomRight:new Z(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===ys([t,"access",s=>s.options,"optionalAccess",s=>s.friction])||t.y&&t.percentChangeY===ys([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||{},!ys([i,"optionalAccess",s=>s.active])&&!ys([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 jx={left:!1,right:!1,top:!1,bottom:!1,direction:null,underflow:"center"};class If extends fe{constructor(e,t={}){super(e),this.options=Object.assign({},jx,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 Zx={minWidth:null,minHeight:null,maxWidth:null,maxHeight:null,minScale:null,maxScale:null};class Mf extends fe{constructor(e,t={}){super(e),this.options=Object.assign({},Zx,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 qx={friction:.98,bounce:.8,minSpeed:.01},xi=16;class Nf extends fe{constructor(e,t={}){super(e),this.options=Object.assign({},qx,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*xi/o*(Math.pow(s,n/xi)-Math.pow(s,i/xi)),this.x*=Math.pow(this.percentChangeX,e/xi)}if(this.y){const s=this.percentChangeY,o=Math.log(s);this.parent.y+=this.y*xi/o*(Math.pow(s,n/xi)-Math.pow(s,i/xi)),this.y*=Math.pow(this.percentChangeY,e/xi)}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 Kx={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 xs extends fe{__init(){this.windowEventHandlers=new Array}constructor(e,t={}){super(e),xs.prototype.__init.call(this),this.options=Object.assign({},Kx,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 Z(this.last.x,this.last.y),world:this.parent.toWorld(new Z(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 Z(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 $x={speed:0,acceleration:null,radius:null};class Df extends fe{constructor(e,t,i={}){super(e),this.target=t,this.options=Object.assign({},$x,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 Jx={radius:null,distance:null,top:null,bottom:null,left:null,right:null,speed:8,reverse:!1,noDecelerate:!1,linear:!1,allowButtons:!1};class Ff extends fe{constructor(e,t={}){super(e),this.options=Object.assign({},Jx,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 Qx={noDrag:!1,percent:1,center:null,factor:1,axis:"all"};class yr extends fe{__init(){this.active=!1}__init2(){this.pinching=!1}__init3(){this.moved=!1}constructor(e,t={}){super(e),yr.prototype.__init.call(this),yr.prototype.__init2.call(this),yr.prototype.__init3.call(this),this.options=Object.assign({},Qx,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 tb={topLeft:!1,friction:.8,time:1e3,ease:"easeInOutSine",interrupt:!0,removeOnComplete:!1,removeOnInterrupt:!1,forceStart:!1};class Lf extends fe{constructor(e,t,i,n={}){super(e),this.options=Object.assign({},tb,n),this.ease=ms(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 eb={width:0,height:0,time:1e3,ease:"easeInOutSine",center:null,interrupt:!0,removeOnComplete:!1,removeOnInterrupt:!1,forceStart:!1,noMove:!1};class Bf extends fe{constructor(e,t={}){super(e),this.options=Object.assign({},eb,t),this.ease=ms(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 ib={percent:.1,smooth:!1,interrupt:!0,reverse:!1,center:null,lineHeight:20,axis:"all",keyToPress:null,trackpadPinch:!1,wheelZoom:!0};class Gf extends fe{constructor(e,t={}){super(e),this.options=Object.assign({},ib,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 Uf{constructor(e){this.viewport=e,this.touches=[],this.addListeners()}addListeners(){this.viewport.interactive=!0,this.viewport.forceHitArea||(this.viewport.hitArea=new K(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 Z;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 bs(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 hn=["drag","pinch","wheel","follow","mouse-edges","decelerate","animate","bounce","snap-zoom","clamp-zoom","snap","clamp"];class kf{constructor(e){this.viewport=e,this.list=[],this.plugins={}}add(e,t,i=hn.length){const n=this.plugins[e];n&&n.destroy(),this.plugins[e]=t;const s=hn.indexOf(e);s!==-1&&hn.splice(s,1),hn.splice(i,0,e),this.sort()}get(e,t){return t&&bs([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]&&(bs([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){bs([this,"access",t=>t.plugins,"access",t=>t[e],"optionalAccess",t=>t.pause,"call",t=>t()])}resume(e){bs([this,"access",t=>t.plugins,"access",t=>t[e],"optionalAccess",t=>t.resume,"call",t=>t()])}sort(){this.list=[];for(const e of hn)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 rb={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:Gt.shared};class Wa extends st{__init(){this._disableOnContextMenu=e=>e.preventDefault()}constructor(e={}){super(),Wa.prototype.__init.call(this),this.options=Object.assign({},{divWheel:document.body},rb,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 Uf(this),this.plugins=new kf(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 K(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 K(this.left,this.top,this.worldScreenWidth,this.worldScreenHeight)}toWorld(e,t){return arguments.length===2?this.toLocal(new Z(e,t)):this.toLocal(e)}toScreen(e,t){return arguments.length===2?this.toGlobal(new Z(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 Z(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 Z(-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 Bf(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 Z(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 K(0,0,this.worldWidth,this.worldHeight))}drag(e){return this.plugins.add("drag",new xs(this,e)),this}clamp(e){return this.plugins.add("clamp",new If(this,e)),this}decelerate(e){return this.plugins.add("decelerate",new Nf(this,e)),this}bounce(e){return this.plugins.add("bounce",new Af(this,e)),this}pinch(e){return this.plugins.add("pinch",new yr(this,e)),this}snap(e,t,i){return this.plugins.add("snap",new Lf(this,e,t,i)),this}follow(e,t){return this.plugins.add("follow",new Df(this,e,t)),this}wheel(e){return this.plugins.add("wheel",new Gf(this,e)),this}animate(e){return this.plugins.add("animate",new We(this,e)),this}clampZoom(e){return this.plugins.add("clamp-zoom",new Mf(this,e)),this}mouseEdges(e){return this.plugins.add("mouse-edges",new Ff(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 nb=Object.freeze(Object.defineProperty({__proto__:null,Animate:We,Bounce:Af,Clamp:If,ClampZoom:Mf,Decelerate:Nf,Drag:xs,Follow:Df,InputManager:Uf,MouseEdges:Ff,Pinch:yr,Plugin:fe,PluginManager:kf,Snap:Lf,SnapZoom:Bf,Viewport:Wa,Wheel:Gf},Symbol.toStringTag,{value:"Module"}));zt.FlowRunTimeline=Xx,zt.formatDateFnsDefault=$a,zt.hasStartAndEndDates=Ka,zt.nodeThemeFnDefault=Ja,Object.defineProperty(zt,Symbol.toStringTag,{value:"Module"})});
|
|
1060
|
+
`;(function(r){Yy(e,r);function e(t,i){t===void 0&&(t=.5),i===void 0&&(i=Math.random());var n=r.call(this,uu,Vy,{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})(hi);var Qu=new Mt;Rt.prototype._cacheAsBitmap=!1,Rt.prototype._cacheData=null,Rt.prototype._cacheAsBitmapResolution=null,Rt.prototype._cacheAsBitmapMultisample=wt.NONE;var jy=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(Rt.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 jy),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)}}}}),Rt.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))},Rt.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(G.RESOLUTION);var o=e.renderTexture.current,a=e.renderTexture.sourceFrame.clone(),h=e.renderTexture.destinationFrame.clone(),u=e.projection.transform,l=Ai.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_"+Ci();this._cacheData.textureCacheId=f,et.addToCache(l.baseTexture,f),V.addToCache(l,f);var c=this.transform.localTransform.copyTo(Qu).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 ht(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)}},Rt.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))},Rt.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(G.RESOLUTION);var o=Ai.create({width:t.width,height:t.height}),a="cacheAsBitmap_"+Ci();this._cacheData.textureCacheId=a,et.addToCache(o.baseTexture,a),V.addToCache(o,a);var h=Qu;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 ht(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)}},Rt.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._bounds.updateID=this._boundsID},Rt.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds(null)},Rt.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,et.removeFromCache(this._cacheData.textureCacheId),V.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null},Rt.prototype._cacheAsBitmapDestroy=function(e){this.cacheAsBitmap=!1,this.destroy(e)};Rt.prototype.name=null,st.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};Rt.prototype.getGlobalPosition=function(e,t){return e===void 0&&(e=new Z),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 Zy=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=ot.Application,r}(),tl=function(){function r(e){var t=this;this.stage=new st,e=Object.assign({forceCanvas:!1},e),this.renderer=w_(e),r._plugins.forEach(function(i){i.init.call(t,e)})}return r.registerPlugin=function(e){Ee("6.5.0","Application.registerPlugin() is deprecated, use extensions.add()"),Ze.add({type:ot.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}();Ze.handleByList(ot.Application,tl._plugins),Ze.add(Zy);var Yo=function(r,e){return Yo=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])},Yo(r,e)};function nr(r,e){Yo(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var qy=function(r){nr(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,g=p*this.segWidth+v,_=p*this.segWidth+v+1,m=(p+1)*this.segWidth+v,y=(p+1)*this.segWidth+v+1;s.push(g,_,m,_,y,m)}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}(Zn),Ky=function(r){nr(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,g=Math.sqrt(v*v+p*p);u=t[c],h+=g/l}else h=c/(f-1);o[d]=h,o[d+1]=0,o[d+2]=h,o[d+3]=1}for(var _=0,c=0;c<f-1;c++){var d=c*2;a[_++]=d,a[_++]=d+1,a[_++]=d+2,a[_++]=d+2,a[_++]=d+1,a[_++]=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}(Zn),$y=function(r){nr(e,r);function e(t,i,n){n===void 0&&(n=0);var s=this,o=new Ky(t.height,i,n),a=new zr(t);return n>0&&(t.baseTexture.wrapMode=Le.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}(Wr),Jy=function(r){nr(e,r);function e(t,i,n){var s=this,o=new qy(t.width,t.height,i,n),a=new zr(V.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}(Wr);(function(r){nr(e,r);function e(t,i,n,s,o){t===void 0&&(t=V.EMPTY);var a=this,h=new Zn(i,n,s);h.getBuffer("aVertexPosition").static=!1;var u=new zr(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})(Wr);var Jn=10;(function(r){nr(e,r);function e(t,i,n,s,o){i===void 0&&(i=Jn),n===void 0&&(n=Jn),s===void 0&&(s=Jn),o===void 0&&(o=Jn);var a=r.call(this,V.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 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 Qy(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){Qy(e,r);function e(t,i){i===void 0&&(i=!0);var n=r.call(this,t[0]instanceof V?t[0]:t[0].texture)||this;return n._textures=null,n._durations=null,n._autoUpdate=i,n._isConnectedToTicker=!1,n.animationSpeed=1,n.loop=!0,n.updateAnchor=!1,n.onComplete=null,n.onFrameChange=null,n.onLoop=null,n._currentTime=0,n._playing=!1,n._previousFrame=null,n.textures=t,n}return e.prototype.stop=function(){this._playing&&(this._playing=!1,this._autoUpdate&&this._isConnectedToTicker&&(Gt.shared.remove(this.update,this),this._isConnectedToTicker=!1))},e.prototype.play=function(){this._playing||(this._playing=!0,this._autoUpdate&&!this._isConnectedToTicker&&(Gt.shared.add(this.update,this,re.HIGH),this._isConnectedToTicker=!0))},e.prototype.gotoAndStop=function(t){this.stop();var i=this.currentFrame;this._currentTime=t,i!==this.currentFrame&&this.updateTexture()},e.prototype.gotoAndPlay=function(t){var i=this.currentFrame;this._currentTime=t,i!==this.currentFrame&&this.updateTexture(),this.play()},e.prototype.update=function(t){if(this._playing){var i=this.animationSpeed*t,n=this.currentFrame;if(this._durations!==null){var s=this._currentTime%1*this._durations[this.currentFrame];for(s+=i/60*1e3;s<0;)this._currentTime--,s+=this._durations[this.currentFrame];var 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(V.from(t[n]));return new e(i)},e.fromImages=function(t){for(var i=[],n=0;n<t.length;++n)i.push(V.from(t[n]));return new e(i)},Object.defineProperty(e.prototype,"totalFrames",{get:function(){return this._textures.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"textures",{get:function(){return this._textures},set:function(t){if(t[0]instanceof V)this._textures=t,this._durations=null;else{this._textures=[],this._durations=[];for(var i=0;i<t.length;i++)this._textures.push(t[i].texture),this._durations.push(t[i].time)}this._previousFrame=null,this.gotoAndStop(0),this.updateTexture()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentFrame",{get:function(){var t=Math.floor(this._currentTime)%this._textures.length;return t<0&&(t+=this._textures.length),t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"playing",{get:function(){return this._playing},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"autoUpdate",{get:function(){return this._autoUpdate},set:function(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isConnectedToTicker?(Gt.shared.remove(this.update,this),this._isConnectedToTicker=!1):this._autoUpdate&&!this._isConnectedToTicker&&this._playing&&(Gt.shared.add(this.update,this),this._isConnectedToTicker=!0))},enumerable:!1,configurable:!0}),e})(ht);Ze.add(B_,W_,H_,Fm,ly,du,_y,Oy,om,Im,Mm,cy,eg,$_);let sr="sans-serif",Qn=null;const Je=new fi,el={chars:St.ASCII},Bi=new fi;async function il(r){const e=new oc(r.textFontFamilyDefault);try{await e.load()}catch(t){return console.error(t),console.warn(`loadBitmapFonts: font ${r.textFontFamilyDefault} failed to load, falling back to ${sr}`),nl(sr,r)}return sr=r.textFontFamilyDefault,nl(sr,r)}function rl(r){Je.fontFamily=sr,Je.fontSize=r.textSizeDefault,Je.lineHeight=r.textLineHeightDefault,Bi.fontFamily=sr,Bi.fontSize=r.textSizeSmall,Bi.lineHeight=r.textLineHeightSmall}function nl(r,e){rl(e);const t={resolution:window.devicePixelRatio||2,...el};St.from("NodeTextDefault",{...Je,fill:e.colorTextDefault},t);const i={fontName:"NodeTextDefault",fontSize:e.textSizeDefault};St.from("NodeTextInverse",{...Je,fill:e.colorTextInverse},t);const n={fontName:"NodeTextInverse",fontSize:e.textSizeDefault};St.from("NodeTextSubdued",{...Je,fill:e.colorTextSubdued},t);const s={fontName:"NodeTextSubdued",fontSize:e.textSizeDefault};St.from("TimeMarkerLabel",{...Bi,fill:e.colorTextSubdued},t);const o={fontName:"TimeMarkerLabel",fontSize:e.textSizeSmall};St.from("PlayheadTimerLabel",{...Bi,fill:e.colorPlayheadBg},t);const a={fontName:"PlayheadTimerLabel",fontSize:e.textSizeSmall};return{nodeTextDefault:i,nodeTextInverse:n,nodeTextSubdued:s,nodeTextStyles:Je,timeMarkerLabel:o,playheadTimerLabel:a}}function t0(r){rl(r);const e={resolution:window.devicePixelRatio||2,...el};setTimeout(()=>{St.uninstall("NodeTextDefault"),St.from("NodeTextDefault",{...Je,fill:r.colorTextDefault},e),St.uninstall("NodeTextInverse"),St.from("NodeTextInverse",{...Je,fill:r.colorTextInverse},e),St.uninstall("TimeMarkerLabel"),St.from("TimeMarkerLabel",{...Bi,fill:r.colorTextSubdued},e),St.uninstall("PlayheadTimerLabel"),St.from("PlayheadTimerLabel",{...Bi,fill:r.colorPlayheadBg},e)},0)}const Yr=r=>(Qn||(Qn=il(r)),Qn),e0=r=>{Qn=il(r)};class i0 extends st{constructor(t,i){super();R(this,"appRef");R(this,"viewportRef");R(this,"layer",new Ce);this.appRef=t,this.viewportRef=i,this.drawLayer(),this.initUpdater(),this.interactive=!0}drawLayer(){const{xPos:t,yPos:i,width:n,height:s}=this.getDimensions();this.layer.beginFill(16777215,1),this.layer.drawRect(t,i,n,s),this.layer.endFill(),this.layer.alpha=0,this.addChild(this.layer)}getDimensions(){return{xPos:this.viewportRef.left,yPos:this.viewportRef.top,width:this.viewportRef.right-this.viewportRef.left,height:this.viewportRef.bottom-this.viewportRef.top}}initUpdater(){this.appRef.ticker.add(()=>{this.update()},null,re.LOW)}update(){const{xPos:t,yPos:i,width:n,height:s}=this.getDimensions();this.x=t,this.y=i,this.width=n,this.height=s}}function r0(r){nd();const e=new tl({backgroundAlpha:0,width:r.clientWidth,height:r.clientHeight,resolution:window.devicePixelRatio||2,autoDensity:!0,antialias:!0,resizeTo:r});return process.env.NODE_ENV==="development"&&n0(e),r.appendChild(e.view),e.ticker.add(()=>{(r.clientWidth!==e.screen.width||r.clientHeight!==e.screen.height)&&(e.resizeTo=r)},null,re.LOW),e}function n0(r){globalThis.__PIXI_APP__=r}async function s0(){const{Viewport:r}=await Promise.resolve().then(()=>nb);return r}async function o0(r,e){const t=await s0(),{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),H.nextTick(()=>{s.emit("resize")}))},null,re.LOW),s}function Qe(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function sl(r,e){r.prototype=Object.create(e.prototype),r.prototype.constructor=r,r.__proto__=e}var ne={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},or={duration:.5,overwrite:!1,delay:0},jo,Yt,At,de=1e8,ut=1/de,Zo=Math.PI*2,a0=Zo/4,h0=0,ol=Math.sqrt,u0=Math.cos,l0=Math.sin,Ut=function(e){return typeof e=="string"},Pt=function(e){return typeof e=="function"},ti=function(e){return typeof e=="number"},qo=function(e){return typeof e>"u"},ke=function(e){return typeof e=="object"},Kt=function(e){return e!==!1},al=function(){return typeof window<"u"},ts=function(e){return Pt(e)||Ut(e)},hl=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},Vt=Array.isArray,Ko=/(?:-?\.?\d|\.)+/gi,ul=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,ar=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,$o=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,ll=/[+-]=-?[.\d]+/,fl=/[^,'"\[\]\s]+/gi,f0=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,mt,pe,Jo,Qo,se={},es={},cl,dl=function(e){return(es=Ui(e,se))&&he},ta=function(e,t){return console.warn("Invalid property",e,"set to",t,"Missing plugin? gsap.registerPlugin()")},is=function(e,t){return!t&&console.warn(e)},pl=function(e,t){return e&&(se[e]=t)&&es&&(es[e]=t)||se},Vr=function(){return 0},c0={suppressEvents:!0,isStart:!0,kill:!1},rs={suppressEvents:!0,kill:!1},d0={suppressEvents:!0},ea={},ci=[],ia={},vl,oe={},ra={},gl=30,ns=[],na="",sa=function(e){var t=e[0],i,n;if(ke(t)||Pt(t)||(e=[e]),!(i=(t._gsap||{}).harness)){for(n=ns.length;n--&&!ns[n].targetTest(t););i=ns[n]}for(n=e.length;n--;)e[n]&&(e[n]._gsap||(e[n]._gsap=new Wl(e[n],i)))||e.splice(n,1);return e},Gi=function(e){return e._gsap||sa(_e(e))[0]._gsap},_l=function(e,t,i){return(i=e[t])&&Pt(i)?e[t]():qo(i)&&e.getAttribute&&e.getAttribute(t)||i},$t=function(e,t){return(e=e.split(",")).forEach(t)||e},Ct=function(e){return Math.round(e*1e5)/1e5||0},Ht=function(e){return Math.round(e*1e7)/1e7||0},hr=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},p0=function(e,t){for(var i=t.length,n=0;e.indexOf(t[n])<0&&++n<i;);return n<i},ss=function(){var e=ci.length,t=ci.slice(0),i,n;for(ia={},ci.length=0,i=0;i<e;i++)n=t[i],n&&n._lazy&&(n.render(n._lazy[0],n._lazy[1],!0)._lazy=0)},ml=function(e,t,i,n){ci.length&&!Yt&&ss(),e.render(t,i,n||Yt&&t<0&&(e._initted||e._startAt)),ci.length&&!Yt&&ss()},yl=function(e){var t=parseFloat(e);return(t||t===0)&&(e+"").match(fl).length<2?t:Ut(e)?e.trim():e},xl=function(e){return e},ve=function(e,t){for(var i in t)i in e||(e[i]=t[i]);return e},v0=function(e){return function(t,i){for(var n in i)n in t||n==="duration"&&e||n==="ease"||(t[n]=i[n])}},Ui=function(e,t){for(var i in t)e[i]=t[i];return e},bl=function r(e,t){for(var i in t)i!=="__proto__"&&i!=="constructor"&&i!=="prototype"&&(e[i]=ke(t[i])?r(e[i]||(e[i]={}),t[i]):t[i]);return e},os=function(e,t){var i={},n;for(n in e)n in t||(i[n]=e[n]);return i},jr=function(e){var t=e.parent||mt,i=e.keyframes?v0(Vt(e.keyframes)):ve;if(Kt(e.inherit))for(;t;)i(e,t.vars.defaults),t=t.parent||t._dp;return e},g0=function(e,t){for(var i=e.length,n=i===t.length;n&&i--&&e[i]===t[i];);return i<0},Tl=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},as=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},di=function(e,t){e.parent&&(!t||e.parent.autoRemoveChildren)&&e.parent.remove(e),e._act=0},ki=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},_0=function(e){for(var t=e.parent;t&&t.parent;)t._dirty=1,t.totalDuration(),t=t.parent;return e},oa=function(e,t,i,n){return e._startAt&&(Yt?e._startAt.revert(rs):e.vars.immediateRender&&!e.vars.autoRevert||e._startAt.render(t,!0,n))},m0=function r(e){return!e||e._ts&&r(e.parent)},wl=function(e){return e._repeat?ur(e._tTime,e=e.duration()+e._rDelay)*e:0},ur=function(e,t){var i=Math.floor(e/=t);return e&&i===e?i-1:i},hs=function(e,t){return(e-t._start)*t._ts+(t._ts>=0?0:t._dirty?t.totalDuration():t._tDur)},us=function(e){return e._end=Ht(e._start+(e._tDur/Math.abs(e._ts||e._rts||ut)||0))},ls=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)),us(e),i._dirty||ki(i,e)),e},El=function(e,t){var i;if((t._time||t._initted&&!t._dur)&&(i=hs(e.rawTime(),t),(!t._dur||qr(0,t.totalDuration(),i)-t._tTime>ut)&&t.render(i,!0)),ki(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}},Xe=function(e,t,i,n){return t.parent&&di(t),t._start=Ht((ti(i)?i:i||e!==mt?ge(e,i,t):e._time)+t._delay),t._end=Ht(t._start+(t.totalDuration()/Math.abs(t.timeScale())||0)),Tl(e,t,"_first","_last",e._sort?"_start":0),aa(t)||(e._recent=t),n||El(e,t),e._ts<0&&ls(e,e._tTime),e},Sl=function(e,t){return(se.ScrollTrigger||ta("scrollTrigger",t))&&se.ScrollTrigger.create(t,e)},Pl=function(e,t,i,n,s){if(ga(e,t,s),!e._initted)return 1;if(!i&&e._pt&&!Yt&&(e._dur&&e.vars.lazy!==!1||!e._dur&&e.vars.lazy)&&vl!==ae.frame)return ci.push(e),e._lazy=[s,n],1},y0=function r(e){var t=e.parent;return t&&t._ts&&t._initted&&!t._lock&&(t.rawTime()<0||r(t))},aa=function(e){var t=e.data;return t==="isFromStart"||t==="isStart"},x0=function(e,t,i,n){var s=e.ratio,o=t<0||!t&&(!e._start&&y0(e)&&!(!e._initted&&aa(e))||(e._ts<0||e._dp._ts<0)&&!aa(e))?0:1,a=e._rDelay,h=0,u,l,f;if(a&&e._repeat&&(h=qr(0,e._tDur,t),l=ur(h,a),e._yoyo&&l&1&&(o=1-o),l!==ur(e._tTime,a)&&(s=1-o,e.vars.repeatRefresh&&e._initted&&e.invalidate())),o!==s||Yt||n||e._zTime===ut||!t&&e._zTime){if(!e._initted&&Pl(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&&oa(e,t,i,!0),e._onUpdate&&!i&&me(e,"onUpdate"),h&&e._repeat&&!i&&e.parent&&me(e,"onRepeat"),(t>=e._tDur||t<0)&&e.ratio===o&&(o&&di(e,1),!i&&!Yt&&(me(e,o?"onComplete":"onReverseComplete",!0),e._prom&&e._prom()))}else e._zTime||(e._zTime=t)},b0=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}},lr=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&&ls(e,e._tTime=e._tDur*a),e.parent&&us(e),i||ki(e.parent,e),e},Rl=function(e){return e instanceof Jt?ki(e):lr(e,e._dur)},T0={_start:0,endTime:Vr,totalDuration:Vr},ge=function r(e,t,i){var n=e.labels,s=e._recent||T0,o=e.duration()>=de?s.endTime(!1):e._dur,a,h,u;return Ut(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*(Vt(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=ti(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=Kt(h.vars.inherit)&&h.parent;o.immediateRender=Kt(a.immediateRender),e<2?o.runBackwards=1:o.startAt=t[s-1]}return new Ft(t[0],o,t[s+1])},pi=function(e,t){return e||e===0?t(e):t},qr=function(e,t,i){return i<e?e:i>t?t:i},jt=function(e,t){return!Ut(e)||!(t=f0.exec(e))?"":t[1]},w0=function(e,t,i){return pi(i,function(n){return qr(e,t,n)})},ha=[].slice,Cl=function(e,t){return e&&ke(e)&&"length"in e&&(!t&&!e.length||e.length-1 in e&&ke(e[0]))&&!e.nodeType&&e!==pe},E0=function(e,t,i){return i===void 0&&(i=[]),e.forEach(function(n){var s;return Ut(n)&&!t||Cl(n,1)?(s=i).push.apply(s,_e(n)):i.push(n)})||i},_e=function(e,t,i){return At&&!t&&At.selector?At.selector(e):Ut(e)&&!i&&(Jo||!cr())?ha.call((t||Qo).querySelectorAll(e),0):Vt(e)?E0(e,i):Cl(e)?ha.call(e,0):e?[e]:[]},ua=function(e){return e=_e(e)[0]||is("Invalid scope")||{},function(t){var i=e.current||e.nativeElement||e;return _e(t,i.querySelectorAll?i:i===e?is("Invalid scope")||Qo.createElement("div"):e)}},Ol=function(e){return e.sort(function(){return .5-Math.random()})},Al=function(e){if(Pt(e))return e;var t=ke(e)?e:{each:e},i=Xi(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 Ut(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,g=o[p],_,m,y,b,x,T,w,S,E;if(!g){if(E=t.grid==="auto"?0:(t.grid||[1,de])[1],!E){for(w=-de;w<(w=v[E++].getBoundingClientRect().left)&&E<p;);E--}for(g=o[p]=[],_=h?Math.min(E,p)*l-.5:n%E,m=E===de?0:h?p*f/E-.5:n/E|0,w=0,S=de,T=0;T<p;T++)y=T%E-_,b=m-(T/E|0),g[T]=x=u?Math.abs(u==="y"?b:y):ol(y*y+b*b),x>w&&(w=x),x<S&&(S=x);n==="random"&&Ol(g),g.max=w-S,g.min=S,g.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),g.b=p<0?s-p:s,g.u=jt(t.amount||t.each)||0,i=i&&p<0?kl(i):i}return p=(g[c]-g.min)/g.max||0,Ht(g.b+(i?i(p):p)*g.v)+g.u}},la=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+(ti(i)?0:jt(i))}},Il=function(e,t){var i=Vt(e),n,s;return!i&&ke(e)&&(n=i=e.radius||de,e.values?(e=_e(e.values),(s=!ti(e[0]))&&(n*=n)):e=la(e.increment)),pi(t,i?Pt(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=de,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||ti(o)?l:l+jt(o)}:la(e))},Ml=function(e,t,i,n){return pi(Vt(e)?!t:i===!0?!!(i=0):!n,function(){return Vt(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})},S0=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)}},P0=function(e,t){return function(i){return e(parseFloat(i))+(t||jt(i))}},R0=function(e,t,i){return Dl(e,t,0,1,i)},Nl=function(e,t,i){return pi(i,function(n){return e[~~t(n)]})},C0=function r(e,t,i){var n=t-e;return Vt(e)?Nl(e,r(0,e.length),t):pi(i,function(s){return(n+(s-e)%n)%n+e})},O0=function r(e,t,i){var n=t-e,s=n*2;return Vt(e)?Nl(e,r(0,e.length-1),t):pi(i,function(o){return o=(s+(o-e)%s)%s||0,e+(o>n?s-o:o)})},Kr=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?fl:Ko),i+=e.substr(t,n-t)+Ml(a?s:+s[0],a?0:+s[1],+s[2]||1e-5),t=o+1;return i+e.substr(t,e.length-t)},Dl=function(e,t,i,n,s){var o=t-e,a=n-i;return pi(s,function(h){return i+((h-e)/o*a||0)})},A0=function r(e,t,i,n){var s=isNaN(e+t)?0:function(d){return(1-d)*e+d*t};if(!s){var o=Ut(e),a={},h,u,l,f,c;if(i===!0&&(n=1)&&(i=null),o)e={p:e},t={p:t};else if(Vt(e)&&!Vt(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=Ui(Vt(e)?[]:{},e));if(!l){for(h in t)pa.call(a,e,h,"get",t[h]);s=function(v){return ya(v,a)||(o?e.p:e)}}}return pi(i,s)},Fl=function(e,t,i){var n=e.labels,s=de,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},me=function(e,t,i){var n=e.vars,s=n[t],o=At,a=e._ctx,h,u,l;if(s)return h=n[t+"Params"],u=n.callbackScope||e,i&&ci.length&&ss(),a&&(At=a),l=h?s.apply(u,h):s.call(u),At=o,l},$r=function(e){return di(e),e.scrollTrigger&&e.scrollTrigger.kill(!!Yt),e.progress()<1&&me(e,"onInterrupt"),e},fr,I0=function(e){e=!e.name&&e.default||e;var t=e.name,i=Pt(e),n=t&&!i&&e.init?function(){this._props=[]}:e,s={init:Vr,render:ya,add:pa,kill:j0,modifier:V0,rawVars:0},o={targetTest:0,get:0,getSetter:ma,aliases:{},register:0};if(cr(),e!==n){if(oe[t])return;ve(n,ve(os(e,s),o)),Ui(n.prototype,Ui(s,os(e,o))),oe[n.prop=t]=n,e.targetTest&&(ns.push(n),ea[t]=1),t=(t==="css"?"CSS":t.charAt(0).toUpperCase()+t.substr(1))+"Plugin"}pl(t,n),e.register&&e.register(he,n,Qt)},lt=255,Jr={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]},fa=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},Ll=function(e,t,i){var n=e?ti(e)?[e>>16,e>>8<,e<]:0:Jr.black,s,o,a,h,u,l,f,c,d,v;if(!n){if(e.substr(-1)===","&&(e=e.substr(0,e.length-1)),Jr[e])n=Jr[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<,n<,parseInt(e.substr(7),16)/255];e=parseInt(e.substr(1),16),n=[e>>16,e>>8<,e<]}else if(e.substr(0,3)==="hsl"){if(n=v=e.match(Ko),!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]=fa(h+1/3,s,o),n[1]=fa(h,s,o),n[2]=fa(h-1/3,s,o);else if(~e.indexOf("="))return n=e.match(ul),i&&n.length<4&&(n[3]=1),n}else n=e.match(Ko)||Jr.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},Bl=function(e){var t=[],i=[],n=-1;return e.split(vi).forEach(function(s){var o=s.match(ar)||[];t.push.apply(t,o),i.push(n+=o.length+1)}),t.c=i,t},Gl=function(e,t,i){var n="",s=(e+n).match(vi),o=t?"hsla(":"rgba(",a=0,h,u,l,f;if(!s)return e;if(s=s.map(function(c){return(c=Ll(c,t,1))&&o+(t?c[0]+","+c[1]+"%,"+c[2]+"%,"+c[3]:c.join(","))+")"}),i&&(l=Bl(e),h=i.c,h.join(n)!==l.c.join(n)))for(u=e.replace(vi,"1").split(ar),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(vi),f=u.length-1;a<f;a++)n+=u[a]+s[a];return n+u[f]},vi=function(){var r="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",e;for(e in Jr)r+="|"+e+"\\b";return new RegExp(r+")","gi")}(),M0=/hsl[a]?\(/,Ul=function(e){var t=e.join(" "),i;if(vi.lastIndex=0,vi.test(t))return i=M0.test(t),e[1]=Gl(e[1],i),e[0]=Gl(e[0],i,Bl(e[1])),!0},Qr,ae=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(g){var _=r()-n,m=g===!0,y,b,x,T;if(_>e&&(i+=_-t),n+=_,x=n-i,y=x-o,(y>0||m)&&(T=++f.frame,c=x-f.time*1e3,f.time=x=x/1e3,o+=y+(y>=s?4:s-y),b=1),m||(h=u(p)),b)for(d=0;d<a.length;d++)a[d](x,c,T,g)};return f={time:0,frame:0,tick:function(){v(!0)},deltaRatio:function(g){return c/(1e3/(g||60))},wake:function(){cl&&(!Jo&&al()&&(pe=Jo=window,Qo=pe.document||{},se.gsap=he,(pe.gsapVersions||(pe.gsapVersions=[])).push(he.version),dl(es||pe.GreenSockGlobals||!pe.gsap&&pe||{}),l=pe.requestAnimationFrame),h&&f.sleep(),u=l||function(g){return setTimeout(g,o-f.time*1e3+1|0)},Qr=1,v(2))},sleep:function(){(l?pe.cancelAnimationFrame:clearTimeout)(h),Qr=0,u=Vr},lagSmoothing:function(g,_){e=g||1/0,t=Math.min(_||33,e)},fps:function(g){s=1e3/(g||240),o=f.time*1e3+s},add:function(g,_,m){var y=_?function(b,x,T,w){g(b,x,T,w),f.remove(y)}:g;return f.remove(g),a[m?"unshift":"push"](y),cr(),y},remove:function(g,_){~(_=a.indexOf(g))&&a.splice(_,1)&&d>=_&&d--},_listeners:a},f}(),cr=function(){return!Qr&&ae.wake()},tt={},N0=/^[\d.\-M][\d.\-,\s]/,D0=/["']/g,F0=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(D0,"").trim():+u,n=h.substr(a+1).trim();return t},L0=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)},B0=function(e){var t=(e+"").split("("),i=tt[t[0]];return i&&t.length>1&&i.config?i.config.apply(null,~e.indexOf("{")?[F0(t[1])]:L0(e).split(",").map(yl)):tt._CE&&N0.test(e)?tt._CE("",e):i},kl=function(e){return function(t){return 1-e(1-t)}},Xl=function r(e,t){for(var i=e._first,n;i;)i instanceof Jt?r(i,t):i.vars.yoyoEase&&(!i._yoyo||!i._repeat)&&i._yoyo!==t&&(i.timeline?r(i.timeline,t):(n=i._ease,i._ease=i._yEase,i._yEase=n,i._yoyo=t)),i=i._next},Xi=function(e,t){return e&&(Pt(e)?e:tt[e]||B0(e))||t},Hi=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 $t(e,function(a){tt[a]=se[a]=s,tt[o=a.toLowerCase()]=i;for(var h in s)tt[o+(h==="easeIn"?".in":h==="easeOut"?".out":".inOut")]=tt[a+"."+h]=s[h]}),s},Hl=function(e){return function(t){return t<.5?(1-e(1-t*2))/2:.5+e((t-.5)*2)/2}},ca=function r(e,t,i){var n=t>=1?t:1,s=(i||(e?.3:.45))/(t<1?t:1),o=s/Zo*(Math.asin(1/n)||0),a=function(l){return l===1?1:n*Math.pow(2,-10*l)*l0((l-o)*s)+1},h=e==="out"?a:e==="in"?function(u){return 1-a(1-u)}:Hl(a);return s=Zo/s,h.config=function(u,l){return r(e,u,l)},h},da=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)}:Hl(i);return n.config=function(s){return r(e,s)},n};$t("Linear,Quad,Cubic,Quart,Quint,Strong",function(r,e){var t=e<5?e+1:e;Hi(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})}),tt.Linear.easeNone=tt.none=tt.Linear.easeIn,Hi("Elastic",ca("in"),ca("out"),ca()),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};Hi("Bounce",function(o){return 1-s(1-o)},s)}(7.5625,2.75),Hi("Expo",function(r){return r?Math.pow(2,10*(r-1)):0}),Hi("Circ",function(r){return-(ol(1-r*r)-1)}),Hi("Sine",function(r){return r===1?1:-u0(r*a0)+1}),Hi("Back",da("in"),da("out"),da()),tt.SteppedEase=tt.steps=se.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*qr(0,o,a)|0)+s)*i}}},or.ease=tt["quad.out"],$t("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(r){return na+=r+","+r+"Params,"});var Wl=function(e,t){this.id=h0++,e._gsap=this,this.target=e,this.harness=t,this.get=t?t.get:_l,this.set=t?t.getSetter:ma},dr=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,lr(this,+t.duration,1,1),this.data=t.data,At&&(this._ctx=At,At.data.push(this)),Qr||ae.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,lr(this,this._repeat<0?i:(i-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(i,n){if(cr(),!arguments.length)return this._tTime;var s=this._dp;if(s&&s.smoothChildTiming&&this._ts){for(ls(this,i),!s._dp||s.parent||El(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)&&Xe(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),ml(this,i,n)),this},e.time=function(i,n){return arguments.length?this.totalTime(Math.min(this.totalDuration(),i+wl(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)+wl(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?ur(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?hs(this.parent._time,this):this._tTime;return this._rts=+i||0,this._ts=this._ps||i===-ut?0:this._rts,this.totalTime(qr(-this._delay,this._tDur,n),!0),us(this),_0(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):(cr(),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)&&Xe(n,this,i-this._delay),this}return this._start},e.endTime=function(i){return this._start+(Kt(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?hs(n.rawTime(i),this):this._tTime:this._tTime},e.revert=function(i){i===void 0&&(i=d0);var n=Yt;return Yt=i,(this._initted||this._startAt)&&(this.timeline&&this.timeline.revert(i),this.totalTime(-.01,i.suppressEvents)),this.data!=="nested"&&i.kill!==!1&&this.kill(),Yt=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,Rl(this)):this._repeat===-2?1/0:this._repeat},e.repeatDelay=function(i){if(arguments.length){var n=this._time;return this._rDelay=i,Rl(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(ge(this,i),Kt(n))},e.restart=function(i,n){return this.play().totalTime(i?-this._delay:0,Kt(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=Pt(i)?i:xl,a=function(){var u=n.then;n.then=null,Pt(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(){$r(this)},r}();ve(dr.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 Jt=function(r){sl(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=Kt(i.sortChildren),mt&&Xe(i.parent||mt,Qe(s),n),i.reversed&&s.reverse(),i.paused&&s.paused(!0),i.scrollTrigger&&Sl(Qe(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,jr(s).repeatDelay||(s.repeat=0),s.immediateRender=!!s.immediateRender,new Ft(n,s,ge(this,o),1),this},t.call=function(n,s,o){return Xe(this,Ft.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 Ft(n,o,ge(this,h)),this},t.staggerFrom=function(n,s,o,a,h,u,l){return o.runBackwards=1,jr(o).immediateRender=Kt(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,jr(a).immediateRender=Kt(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,_,m,y,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,y=this._ts,_=!y,f&&(u||(a=this._zTime),(n||!s)&&(this._zTime=n)),this._repeat){if(T=this._yoyo,g=u+this._rDelay,this._repeat<-1&&n<0)return this.totalTime(g*100+n,s,o);if(c=Ht(l%g),l===h?(p=this._repeat,c=u):(p=~~(l/g),p&&p===l/g&&(c=u,p--),c>u&&(c=u)),x=ur(this._tTime,g),!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*g)),s,!u)._lock=0,this._tTime=l,!s&&this.parent&&me(this,"onRepeat"),this.vars.repeatRefresh&&!w&&(this.invalidate()._lock=1),a&&a!==this._time||_!==!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&&!_)return this;Xl(this,w)}}if(this._hasPause&&!this._forcing&&this._lock<2&&(m=b0(this,Ht(a),Ht(c)),m&&(l-=c-(c=m._start))),this._tTime=l,this._time=c,this._act=!y,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=n,a=0),!a&&c&&!s&&(me(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&&m!==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&&!_){m=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&&m!==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||Yt&&(d._initted||d._startAt)),c!==this._time||!this._ts&&!_){m=0,v&&(l+=this._zTime=P?-ut:ut);break}}d=v}}if(m&&!s&&(this.pause(),m.render(c>=a?0:-ut)._zTime=c>=a?1:-1,this._ts))return this._start=b,us(this),this.render(n,s,o);this._onUpdate&&!s&&me(this,"onUpdate",!0),(l===h&&this._tTime>=this.totalDuration()||!l&&a)&&(b===this._start||Math.abs(y)!==Math.abs(this._ts))&&(this._lock||((n||!u)&&(l===h&&this._ts>0||!l&&this._ts<0)&&di(this,1),!s&&!(n<0&&!a)&&(l||a||!h)&&(me(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(ti(s)||(s=ge(this,s,n)),!(n instanceof dr)){if(Vt(n))return n.forEach(function(a){return o.add(a,s)}),this;if(Ut(n))return this.addLabel(n,s);if(Pt(n))n=Ft.delayedCall(0,n);else return this}return this!==n?Xe(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=-de);for(var h=[],u=this._first;u;)u._start>=a&&(u instanceof Ft?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 Ut(n)?this.removeLabel(n):Pt(n)?this.killTweensOf(n):(as(this,n),n===this._recent&&(this._recent=this._last),ki(this))},t.totalTime=function(n,s){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=Ht(ae.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]=ge(this,s),this},t.removeLabel=function(n){return delete this.labels[n],this},t.addPause=function(n,s,o){var a=Ft.delayedCall(0,s||Vr,o);return a.data="isPause",this._hasPause=1,Xe(this,a,ge(this,n))},t.removePause=function(n){var s=this._first;for(n=ge(this,n);s;)s._start===n&&s.data==="isPause"&&di(s),s=s._next},t.killTweensOf=function(n,s,o){for(var a=this.getTweensOf(n,o),h=a.length;h--;)gi!==a[h]&&a[h].kill(n,s);return this},t.getTweensOf=function(n,s){for(var o=[],a=_e(n),h=this._first,u=ti(s),l;h;)h instanceof Ft?p0(h._targets,a)&&(u?(!gi||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=ge(o,n),h=s,u=h.startAt,l=h.onStart,f=h.onStartParams,c=h.immediateRender,d,v=Ft.to(o,ve({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 g=s.duration||Math.abs((a-(u&&"time"in u?u.time:o._time))/o.timeScale());v._dur!==g&&lr(v,g,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,ve({startAt:{time:ge(this,n)}},o))},t.recent=function(){return this._recent},t.nextLabel=function(n){return n===void 0&&(n=this._time),Fl(this,ge(this,n))},t.previousLabel=function(n){return n===void 0&&(n=this._time),Fl(this,ge(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 ki(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={}),ki(this)},t.totalDuration=function(n){var s=0,o=this,a=o._last,h=de,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,Xe(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;lr(o,o===mt&&o._time>s?o._time:s,1,1),o._dirty=0}return o._tDur},e.updateRoot=function(n){if(mt._ts&&(ml(mt,hs(n,mt)),vl=ae.frame),ae.frame>=gl){gl+=ne.autoSleep||120;var s=mt._first;if((!s||!s._ts)&&ne.autoSleep&&ae._listeners.length<2){for(;s&&!s._ts;)s=s._next;s||ae.sleep()}}},e}(dr);ve(Jt.prototype,{_lock:0,_hasPause:0,_forcing:0});var G0=function(e,t,i,n,s,o,a){var h=new Qt(this._pt,e,t,0,1,ql,null,s),u=0,l=0,f,c,d,v,p,g,_,m;for(h.b=i,h.e=n,i+="",n+="",(_=~n.indexOf("random("))&&(n=Kr(n)),o&&(m=[i,n],o(m,e,t),i=m[0],n=m[1]),c=i.match($o)||[];f=$o.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++]&&(g=parseFloat(c[l-1])||0,h._pt={_next:h._pt,p:p||l===1?p:",",s:g,c:v.charAt(1)==="="?hr(g,v)-g:parseFloat(v)-g,m:d&&d<4?Math.round:0},u=$o.lastIndex);return h.c=u<n.length?n.substring(u,n.length):"",h.fp=a,(ll.test(n)||_)&&(h.e=0),this._pt=h,h},pa=function(e,t,i,n,s,o,a,h,u,l){Pt(n)&&(n=n(s||0,e,o));var f=e[t],c=i!=="get"?i:Pt(f)?u?e[t.indexOf("set")||!Pt(e["get"+t.substr(3)])?t:"get"+t.substr(3)](u):e[t]():f,d=Pt(f)?u?W0:jl:_a,v;if(Ut(n)&&(~n.indexOf("random(")&&(n=Kr(n)),n.charAt(1)==="="&&(v=hr(c,n)+(jt(c)||0),(v||v===0)&&(n=v))),!l||c!==n||va)return!isNaN(c*n)&&n!==""?(v=new Qt(this._pt,e,t,+c||0,n-(c||0),typeof f=="boolean"?Y0:Zl,0,d),u&&(v.fp=u),a&&v.modifier(a,this,e),this._pt=v):(!f&&!(t in e)&&ta(t,n),G0.call(this,e,t,c,n,d,h||ne.stringFilter,u))},U0=function(e,t,i,n,s){if(Pt(e)&&(e=tn(e,s,t,i,n)),!ke(e)||e.style&&e.nodeType||Vt(e)||hl(e))return Ut(e)?tn(e,s,t,i,n):e;var o={},a;for(a in e)o[a]=tn(e[a],s,t,i,n);return o},zl=function(e,t,i,n,s,o){var a,h,u,l;if(oe[e]&&(a=new oe[e]).init(s,a.rawVars?t[e]:U0(t[e],n,s,o,i),i,n,o)!==!1&&(i._pt=h=new Qt(i._pt,s,e,0,1,a.render,a,0,a.priority),i!==fr))for(u=i._ptLookup[i._targets.indexOf(s)],l=a._props.length;l--;)u[a._props[l]]=h;return a},gi,va,ga=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,g=e._dur,_=e._startAt,m=e._targets,y=e.parent,b=y&&y.data==="nested"?y.vars.targets:m,x=e._overwrite==="auto"&&!jo,T=e.timeline,w,S,E,P,O,M,L,B,A,I,F,Y,z;if(T&&(!v||!s)&&(s="none"),e._ease=Xi(s,or.ease),e._yEase=d?kl(Xi(d===!0?s:d,or.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(B=m[0]?Gi(m[0]).harness:0,Y=B&&n[B.prop],w=os(n,ea),_&&(_._zTime<0&&_.progress(1),t<0&&c&&a&&!p?_.render(-1,!0):_.revert(c&&g?rs:c0),_._lazy=0),o){if(di(e._startAt=Ft.set(m,ve({data:"isStart",overwrite:!1,parent:y,immediateRender:!0,lazy:!_&&Kt(h),startAt:null,delay:0,onUpdate:u,onUpdateParams:l,callbackScope:f,stagger:0},o))),e._startAt._dp=0,e._startAt._sat=e,t<0&&(Yt||!a&&!p)&&e._startAt.revert(rs),a&&g&&t<=0&&i<=0){t&&(e._zTime=t);return}}else if(c&&g&&!_){if(t&&(a=!1),E=ve({overwrite:!1,data:"isFromStart",lazy:a&&!_&&Kt(h),immediateRender:a,stagger:0,parent:y},w),Y&&(E[B.prop]=Y),di(e._startAt=Ft.set(m,E)),e._startAt._dp=0,e._startAt._sat=e,t<0&&(Yt?e._startAt.revert(rs):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=g&&Kt(h)||h&&!g,S=0;S<m.length;S++){if(O=m[S],L=O._gsap||sa(m)[S]._gsap,e._ptLookup[S]=I={},ia[L.id]&&ci.length&&ss(),F=b===m?S:b.indexOf(O),B&&(A=new B).init(O,Y||w,e,F,b)!==!1&&(e._pt=P=new Qt(e._pt,O,A.name,0,1,A.render,A,0,A.priority),A._props.forEach(function(N){I[N]=P}),A.priority&&(M=1)),!B||Y)for(E in w)oe[E]&&(A=zl(E,w,e,F,O,b))?A.priority&&(M=1):I[E]=P=pa.call(e,O,E,"get",w[E],F,b,0,n.stringFilter);e._op&&e._op[S]&&e.kill(O,e._op[S]),x&&e._pt&&(gi=e,mt.killTweensOf(O,I,e.globalTime(t)),z=!e.parent,gi=0),e._pt&&h&&(ia[L.id]=1)}M&&Kl(e),e._onInit&&e._onInit(e)}e._onUpdate=u,e._initted=(!e._op||e._pt)&&!z,v&&t<=0&&T.render(de,!0,!0)},k0=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 va=1,e.vars[t]="+=0",ga(e,a),va=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=Ct(i)+jt(l.e)),l.b&&(l.b=u.s+jt(l.b))},X0=function(e,t){var i=e[0]?Gi(e[0]).harness:0,n=i&&i.aliases,s,o,a,h;if(!n)return t;s=Ui({},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},H0=function(e,t,i,n){var s=t.ease||n||"power1.inOut",o,a;if(Vt(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})},tn=function(e,t,i,n,s){return Pt(e)?e.call(t,i,n,s):Ut(e)&&~e.indexOf("random(")?Kr(e):e},Yl=na+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert",Vl={};$t(Yl+",id,stagger,delay,duration,paused,scrollTrigger",function(r){return Vl[r]=1});var Ft=function(r){sl(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:jr(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,g=h.scrollTrigger,_=h.yoyoEase,m=n.parent||mt,y=(Vt(i)||hl(i)?ti(i[0]):"length"in n)?[i]:_e(i),b,x,T,w,S,E,P,O;if(a._targets=y.length?sa(y):is("GSAP target "+i+" not found. https://greensock.com",!ne.nullTargetWarn)||[],a._ptLookup=[],a._overwrite=d,v||c||ts(u)||ts(l)){if(n=a.vars,b=a.timeline=new Jt({data:"nested",defaults:p||{},targets:m&&m.data==="nested"?m.vars.targets:y}),b.kill(),b.parent=b._dp=Qe(a),b._start=0,c||ts(u)||ts(l)){if(w=y.length,P=c&&Al(c),ke(c))for(S in c)~Yl.indexOf(S)&&(O||(O={}),O[S]=c[S]);for(x=0;x<w;x++)T=os(n,Vl),T.stagger=0,_&&(T.yoyoEase=_),O&&Ui(T,O),E=y[x],T.duration=+tn(u,Qe(a),x,E,y),T.delay=(+tn(l,Qe(a),x,E,y)||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,y):0),b._ease=tt.none;b.duration()?u=l=0:a.timeline=0}else if(v){jr(ve(b.vars.defaults,{ease:"none"})),b._ease=Xi(v.ease||n.ease||"none");var M=0,L,B,A;if(Vt(v))v.forEach(function(I){return b.to(y,I,">")}),b.duration();else{T={};for(S in v)S==="ease"||S==="easeEach"||H0(S,v[S],T,v.easeEach);for(S in T)for(L=T[S].sort(function(I,F){return I.t-F.t}),M=0,x=0;x<L.length;x++)B=L[x],A={ease:B.e,duration:(B.t-(x?L[x-1].t:0))/100*u},A[S]=B.v,b.to(y,A,M),M+=A.duration;b.duration()<u&&b.to({},{duration:u-b.duration()})}}u||a.duration(u=b.duration())}else a.timeline=0;return d===!0&&!jo&&(gi=Qe(a),mt.killTweensOf(y),gi=0),Xe(m,Qe(a),s),n.reversed&&a.reverse(),n.paused&&a.paused(!0),(f||!u&&!v&&a._start===Ht(m._time)&&Kt(f)&&m0(Qe(a))&&m.data!=="nested")&&(a._tTime=-ut,a.render(Math.max(0,-l)||0)),g&&Sl(Qe(a),g),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,_,m,y,b;if(!u)x0(this,n,s,o);else if(f!==this._tTime||!n||o||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==l){if(c=f,y=this.timeline,this._repeat){if(p=u+this._rDelay,this._repeat<-1&&l)return this.totalTime(p*100+n,s,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)),_=this._yoyo&&v&1,_&&(b=this._yEase,c=u-c),g=ur(this._tTime,p),c===a&&!o&&this._initted)return this._tTime=f,this;v!==g&&(y&&this._yEase&&Xl(y,_),this.vars.repeatRefresh&&!_&&!this._lock&&(this._lock=o=1,this.render(Ht(p*v),!0).invalidate()._lock=0))}if(!this._initted){if(Pl(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=m=(b||this._ease)(c/u),this._from&&(this.ratio=m=1-m),c&&!a&&!s&&(me(this,"onStart"),this._tTime!==f))return this;for(d=this._pt;d;)d.r(m,d.d),d=d._next;y&&y.render(n<0?n:!c&&_?-ut:y._dur*y._ease(c/this._dur),s,o)||this._startAt&&(this._zTime=n),this._onUpdate&&!s&&(l&&oa(this,n,s,o),me(this,"onUpdate")),this._repeat&&v!==g&&this.vars.onRepeat&&!s&&this.parent&&me(this,"onRepeat"),(f===this._tDur||!f)&&this._tTime===f&&(l&&!this._onUpdate&&oa(this,n,!0,!0),(n||!u)&&(f===this._tDur&&this._ts>0||!f&&this._ts<0)&&di(this,1),!s&&!(l&&!a)&&(f||a||_)&&(me(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||ae.wake(),this._ts||this.play();var h=Math.min(this._dur,(this._dp._time-this._start)*this._ts),u;return this._initted||ga(this,h),u=this._ease(h/this._dur),k0(this,n,s,o,a,u,h)?this.resetTo(n,s,o,a):(ls(this,0),this.parent||Tl(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?$r(this):this;if(this.timeline){var o=this.timeline.totalDuration();return this.timeline.killTweensOf(n,s,gi&&gi.vars.overwrite!==!0)._first||$r(this),this.parent&&o!==this.timeline.totalDuration()&&lr(this,this._dur*this.timeline._tDur/o,0,1),this}var a=this._targets,h=n?_e(n):a,u=this._ptLookup,l=this._pt,f,c,d,v,p,g,_;if((!s||s==="all")&&g0(a,h))return s==="all"&&(this._pt=0),$r(this);for(f=this._op=this._op||[],s!=="all"&&(Ut(s)&&(p={},$t(s,function(m){return p[m]=1}),s=p),s=X0(a,s)),_=a.length;_--;)if(~h.indexOf(a[_])){c=u[_],s==="all"?(f[_]=s,v=c,d={}):(d=f[_]=f[_]||{},v=s);for(p in v)g=c&&c[p],g&&((!("kill"in g.d)||g.d.kill(p)===!0)&&as(this,g,"_pt"),delete c[p]),d!=="all"&&(d[p]=1)}return this._initted&&!this._pt&&l&&$r(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}(dr);ve(Ft.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0}),$t("staggerTo,staggerFrom,staggerFromTo",function(r){Ft[r]=function(){var e=new Jt,t=ha.call(arguments,0);return t.splice(r==="staggerFromTo"?5:4,0,0),e[r].apply(e,t)}});var _a=function(e,t,i){return e[t]=i},jl=function(e,t,i){return e[t](i)},W0=function(e,t,i,n){return e[t](n.fp,i)},z0=function(e,t,i){return e.setAttribute(t,i)},ma=function(e,t){return Pt(e[t])?jl:qo(e[t])&&e.setAttribute?z0:_a},Zl=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e6)/1e6,t)},Y0=function(e,t){return t.set(t.t,t.p,!!(t.s+t.c*e),t)},ql=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)},ya=function(e,t){for(var i=t._pt;i;)i.r(e,i.d),i=i._next},V0=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},j0=function(e){for(var t=this._pt,i,n;t;)n=t._next,t.p===e&&!t.op||t.op===e?as(this,t,"_pt"):t.dep||(i=1),t=n;return!i},Z0=function(e,t,i,n){n.mSet(e,t,n.m.call(n.tween,i,n.mt),n)},Kl=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},Qt=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||Zl,this.d=h||this,this.set=u||_a,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=Z0,this.m=i,this.mt=s,this.tween=n},r}();$t(na+"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 ea[r]=1}),se.TweenMax=se.TweenLite=Ft,se.TimelineLite=se.TimelineMax=Jt,mt=new Jt({sortChildren:!1,defaults:or,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0}),ne.stringFilter=Ul;var pr=[],fs={},q0=[],$l=0,xa=function(e){return(fs[e]||q0).map(function(t){return t()})},ba=function(){var e=Date.now(),t=[];e-$l>2&&(xa("matchMediaInit"),pr.forEach(function(i){var n=i.queries,s=i.conditions,o,a,h,u;for(a in n)o=pe.matchMedia(n[a]).matches,o&&(h=1),o!==s[a]&&(s[a]=o,u=1);u&&(i.revert(),h&&t.push(i))}),xa("matchMediaRevert"),t.forEach(function(i){return i.onMatch(i)}),$l=e,xa("matchMedia"))},Jl=function(){function r(t,i){this.selector=i&&ua(i),this.data=[],this._r=[],this.isReverted=!1,t&&this.add(t)}var e=r.prototype;return e.add=function(i,n,s){Pt(i)&&(s=n,n=i,i=Pt);var o=this,a=function(){var u=At,l=o.selector,f;return u&&u!==o&&u.data.push(o),s&&(o.selector=ua(s)),At=o,f=n.apply(o,arguments),Pt(f)&&o._r.push(f),At=u,o.selector=l,o.isReverted=!1,f};return o.last=a,i===Pt?a(o):i?o[i]=a:a},e.ignore=function(i){var n=At;At=null,i(this),At=n},e.getTweens=function(){var i=[];return this.data.forEach(function(n){return n instanceof r?i.push.apply(i,n.getTweens()):n instanceof Ft&&!(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 dr)&&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=pr.indexOf(this);~a&&pr.splice(a,1)}},e.revert=function(i){this.kill(i||{})},r}(),K0=function(){function r(t){this.contexts=[],this.scope=t}var e=r.prototype;return e.add=function(i,n,s){ke(i)||(i={matches:i});var o=new Jl(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=pe.matchMedia(i[u]),h&&(pr.indexOf(o)<0&&pr.push(o),(a[u]=h.matches)&&(l=1),h.addListener?h.addListener(ba):h.addEventListener("change",ba)));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}(),cs={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 I0(n)})},timeline:function(e){return new Jt(e)},getTweensOf:function(e,t){return mt.getTweensOf(e,t)},getProperty:function(e,t,i,n){Ut(e)&&(e=_e(e)[0]);var s=Gi(e||{}).get,o=i?xl:yl;return i==="native"&&(i=""),e&&(t?o((oe[t]&&oe[t].get||s)(e,t,i,n)):function(a,h,u){return o((oe[a]&&oe[a].get||s)(e,a,h,u))})},quickSetter:function(e,t,i){if(e=_e(e),e.length>1){var n=e.map(function(l){return he.quickSetter(l,t,i)}),s=n.length;return function(l){for(var f=s;f--;)n[f](l)}}e=e[0]||{};var o=oe[t],a=Gi(e),h=a.harness&&(a.harness.aliases||{})[t]||t,u=o?function(l){var f=new o;fr._pt=0,f.init(e,i?l+i:l,fr,0,[e]),f.render(1,f),fr._pt&&ya(1,fr)}: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=he.to(e,Ui((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=Xi(e.ease,or.ease)),bl(or,e||{})},config:function(e){return bl(ne,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&&!oe[a]&&!se[a]&&is(t+" effect requires "+a+" plugin.")}),ra[t]=function(a,h,u){return i(_e(a),ve(h||{},s),u)},o&&(Jt.prototype[t]=function(a,h,u){return this.add(ra[t](a,ke(h)?h:(u=h)&&{},this),u)})},registerEase:function(e,t){tt[e]=Xi(t)},parseEase:function(e,t){return arguments.length?Xi(e,t):tt},getById:function(e){return mt.getById(e)},exportRoot:function(e,t){e===void 0&&(e={});var i=new Jt(e),n,s;for(i.smoothChildTiming=Kt(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 Ft&&n.vars.onComplete===n._targets[0]))&&Xe(i,n,n._start-n._delay),n=s;return Xe(mt,i,0),i},context:function(e,t){return e?new Jl(e,t):At},matchMedia:function(e){return new K0(e)},matchMediaRefresh:function(){return pr.forEach(function(e){var t=e.conditions,i,n;for(n in t)t[n]&&(t[n]=!1,i=1);i&&e.revert()})||ba()},addEventListener:function(e,t){var i=fs[e]||(fs[e]=[]);~i.indexOf(t)||i.push(t)},removeEventListener:function(e,t){var i=fs[e],n=i&&i.indexOf(t);n>=0&&i.splice(n,1)},utils:{wrap:C0,wrapYoyo:O0,distribute:Al,random:Ml,snap:Il,normalize:R0,getUnit:jt,clamp:w0,splitColor:Ll,toArray:_e,selector:ua,mapRange:Dl,pipe:S0,unitize:P0,interpolate:A0,shuffle:Ol},install:dl,effects:ra,ticker:ae,updateRoot:Jt.updateRoot,plugins:oe,globalTimeline:mt,core:{PropTween:Qt,globals:pl,Tween:Ft,Timeline:Jt,Animation:dr,getCache:Gi,_removeLinkedListItem:as,reverting:function(){return Yt},context:function(e){return e&&At&&(At.data.push(e),e._ctx=At),At},suppressOverwrites:function(e){return jo=e}}};$t("to,from,fromTo,delayedCall,set,killTweensOf",function(r){return cs[r]=Ft[r]}),ae.add(Jt.updateRoot),fr=cs.to({},{duration:0});var $0=function(e,t){for(var i=e._pt;i&&i.p!==t&&i.op!==t&&i.fp!==t;)i=i._next;return i},J0=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=$0(o,n)),o&&o.modifier&&o.modifier(t[n],e,i[s],n))},Ta=function(e,t){return{name:e,rawVars:1,init:function(n,s,o){o._onInit=function(a){var h,u;if(Ut(s)&&(h={},$t(s,function(l){return h[l]=1}),s=h),t){h={};for(u in s)h[u]=t(s[u]);s=h}J0(a,s)}}}},he=cs.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;)Yt?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)}},Ta("roundProps",la),Ta("modifiers"),Ta("snap",Il))||cs;Ft.version=Jt.version=he.version="3.11.4",cl=1,al()&&cr(),tt.Power0,tt.Power1,tt.Power2,tt.Power3,tt.Power4,tt.Linear,tt.Quad,tt.Cubic,tt.Quart,tt.Quint,tt.Strong,tt.Elastic,tt.Back,tt.SteppedEase,tt.Bounce,tt.Sine,tt.Expo,tt.Circ;var Ql,_i,vr,wa,Wi,tf,Ea,Q0=function(){return typeof window<"u"},ei={},zi=180/Math.PI,gr=Math.PI/180,_r=Math.atan2,ef=1e8,Sa=/([A-Z])/g,tx=/(left|right|width|margin|padding|x)/i,ex=/[\s,\(]\S/,ii={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},Pa=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e4)/1e4+t.u,t)},ix=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)},rx=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)},nx=function(e,t){var i=t.s+t.c*e;t.set(t.t,t.p,~~(i+(i<0?-.5:.5))+t.u,t)},rf=function(e,t){return t.set(t.t,t.p,e?t.e:t.b,t)},nf=function(e,t){return t.set(t.t,t.p,e!==1?t.b:t.e,t)},sx=function(e,t,i){return e.style[t]=i},ox=function(e,t,i){return e.style.setProperty(t,i)},ax=function(e,t,i){return e._gsap[t]=i},hx=function(e,t,i){return e._gsap.scaleX=e._gsap.scaleY=i},ux=function(e,t,i,n,s){var o=e._gsap;o.scaleX=o.scaleY=i,o.renderTransform(s,o)},lx=function(e,t,i,n,s){var o=e._gsap;o[t]=i,o.renderTransform(s,o)},yt="transform",Oe=yt+"Origin",fx=function(e,t){var i=this,n=this.target,s=n.style;if(e in ei){if(this.tfm=this.tfm||{},e!=="transform"&&(e=ii[e]||e,~e.indexOf(",")?e.split(",").forEach(function(o){return i.tfm[o]=ri(n,o)}):this.tfm[e]=n._gsap.x?n._gsap[e]:ri(n,e)),this.props.indexOf(yt)>=0)return;n._gsap.svg&&(this.svgo=n.getAttribute("data-svg-origin"),this.props.push(Oe,t,"")),e=yt}(s||t)&&this.props.push(e,t,s[e])},sf=function(e){e.translate&&(e.removeProperty("translate"),e.removeProperty("scale"),e.removeProperty("rotate"))},cx=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(Sa,"-$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=Ea(),s&&!s.isStart&&!i[yt]&&(sf(i),n.uncache=1)}},of=function(e,t){var i={target:e,props:[],revert:cx,save:fx};return t&&t.split(",").forEach(function(n){return i.save(n)}),i},af,Ra=function(e,t){var i=_i.createElementNS?_i.createElementNS((t||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),e):_i.createElement(e);return i.style?i:_i.createElement(e)},He=function r(e,t,i){var n=getComputedStyle(e);return n[t]||n.getPropertyValue(t.replace(Sa,"-$1").toLowerCase())||n.getPropertyValue(t)||!i&&r(e,mr(t)||t,1)||""},hf="O,Moz,ms,Ms,Webkit".split(","),mr=function(e,t,i){var n=t||Wi,s=n.style,o=5;if(e in s&&!i)return e;for(e=e.charAt(0).toUpperCase()+e.substr(1);o--&&!(hf[o]+e in s););return o<0?null:(o===3?"ms":o>=0?hf[o]:"")+e},Ca=function(){Q0()&&window.document&&(Ql=window,_i=Ql.document,vr=_i.documentElement,Wi=Ra("div")||{style:{}},Ra("div"),yt=mr(yt),Oe=yt+"Origin",Wi.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",af=!!mr("perspective"),Ea=he.core.reverting,wa=1)},Oa=function r(e){var t=Ra("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(vr.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)),vr.removeChild(t),this.style.cssText=s,o},uf=function(e,t){for(var i=t.length;i--;)if(e.hasAttribute(t[i]))return e.getAttribute(t[i])},lf=function(e){var t;try{t=e.getBBox()}catch{t=Oa.call(e,!0)}return t&&(t.width||t.height)||e.getBBox===Oa||(t=Oa.call(e,!0)),t&&!t.width&&!t.x&&!t.y?{x:+uf(e,["x","cx","x1"])||0,y:+uf(e,["y","cy","y1"])||0,width:0,height:0}:t},ff=function(e){return!!(e.getCTM&&(!e.parentNode||e.ownerSVGElement)&&lf(e))},en=function(e,t){if(t){var i=e.style;t in ei&&t!==Oe&&(t=yt),i.removeProperty?((t.substr(0,2)==="ms"||t.substr(0,6)==="webkit")&&(t="-"+t),i.removeProperty(t.replace(Sa,"-$1").toLowerCase())):i.removeAttribute(t)}},mi=function(e,t,i,n,s,o){var a=new Qt(e._pt,t,i,0,1,o?nf:rf);return e._pt=a,a.b=n,a.e=s,e._props.push(i),a},cf={deg:1,rad:1,turn:1},dx={grid:1,flex:1},yi=function r(e,t,i,n){var s=parseFloat(i)||0,o=(i+"").trim().substr((s+"").length)||"px",a=Wi.style,h=tx.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||cf[n]||cf[o]?s:(o!=="px"&&!c&&(s=r(e,t,i,"px")),_=e.getCTM&&ff(e),(d||o==="%")&&(ei[t]||~t.indexOf("adius"))?(v=_?e.getBBox()[h?"width":"height"]:e[l],Ct(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,_&&(p=(e.ownerSVGElement||{}).parentNode),(!p||p===_i||!p.appendChild)&&(p=_i.body),g=p._gsap,g&&d&&g.width&&h&&g.time===ae.time&&!g.uncache?Ct(s/g.width*f):((d||o==="%")&&!dx[He(p,"display")]&&(a.position=He(e,"position")),p===e&&(a.position="static"),p.appendChild(Wi),v=Wi[l],p.removeChild(Wi),a.position="absolute",h&&d&&(g=Gi(p),g.time=ae.time,g.width=p[l]),Ct(c?v*s/f:v&&s?f/v*s:0))))},ri=function(e,t,i,n){var s;return wa||Ca(),t in ii&&t!=="transform"&&(t=ii[t],~t.indexOf(",")&&(t=t.split(",")[0])),ei[t]&&t!=="transform"?(s=nn(e,n),s=t!=="transformOrigin"?s[t]:s.svg?s.origin:ps(He(e,Oe))+" "+s.zOrigin+"px"):(s=e.style[t],(!s||s==="auto"||n||~(s+"").indexOf("calc("))&&(s=ds[t]&&ds[t](e,t,i)||He(e,t)||_l(e,t)||(t==="opacity"?1:0))),i&&!~(s+"").trim().indexOf(" ")?yi(e,t,s,i)+i:s},px=function(e,t,i,n){if(!i||i==="none"){var s=mr(t,e,1),o=s&&He(e,s,1);o&&o!==i?(t=s,i=o):t==="borderColor"&&(i=He(e,"borderTopColor"))}var a=new Qt(this._pt,e.style,t,0,1,ql),h=0,u=0,l,f,c,d,v,p,g,_,m,y,b,x;if(a.b=i,a.e=n,i+="",n+="",n==="auto"&&(e.style[t]=n,n=He(e,t)||n,e.style[t]=i),l=[i,n],Ul(l),i=l[0],n=l[1],c=i.match(ar)||[],x=n.match(ar)||[],x.length){for(;f=ar.exec(n);)g=f[0],m=n.substring(h,f.index),v?v=(v+1)%5:(m.substr(-5)==="rgba("||m.substr(-5)==="hsla(")&&(v=1),g!==(p=c[u++]||"")&&(d=parseFloat(p)||0,b=p.substr((d+"").length),g.charAt(1)==="="&&(g=hr(d,g)+b),_=parseFloat(g),y=g.substr((_+"").length),h=ar.lastIndex-y.length,y||(y=y||ne.units[t]||b,h===n.length&&(n+=y,a.e+=y)),b!==y&&(d=yi(e,t,p,y)||0),a._pt={_next:a._pt,p:m||u===1?m:",",s:d,c:_-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"?nf:rf;return ll.test(n)&&(a.e=0),this._pt=a,a},df={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},vx=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]=df[i]||i,t[1]=df[n]||n,t.join(" ")},gx=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],ei[a]&&(h=1,a=a==="transformOrigin"?Oe:yt),en(i,a);h&&(en(i,yt),o&&(o.svg&&i.removeAttribute("transform"),nn(i,1),o.uncache=1,sf(n)))}},ds={clearProps:function(e,t,i,n,s){if(s.data!=="isFromStart"){var o=e._pt=new Qt(e._pt,t,i,0,0,gx);return o.u=n,o.pr=-10,o.tween=s,e._props.push(i),1}}},rn=[1,0,0,1,0,0],pf={},vf=function(e){return e==="matrix(1, 0, 0, 1, 0, 0)"||e==="none"||!e},gf=function(e){var t=He(e,yt);return vf(t)?rn:t.substr(7).match(ul).map(Ct)},Aa=function(e,t){var i=e._gsap||Gi(e),n=e.style,s=gf(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"?rn:s):(s===rn&&!e.offsetParent&&e!==vr&&!i.svg&&(h=n.display,n.display="block",o=e.parentNode,(!o||!e.offsetParent)&&(u=1,a=e.nextElementSibling,vr.appendChild(e)),s=gf(e),h?n.display=h:en(e,"display"),u&&(a?o.insertBefore(e,a):o?o.appendChild(e):vr.removeChild(e))),t&&s.length>6?[s[0],s[1],s[4],s[5],s[12],s[13]]:s)},Ia=function(e,t,i,n,s,o){var a=e._gsap,h=s||Aa(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],g=h[3],_=h[4],m=h[5],y=t.split(" "),b=parseFloat(y[0])||0,x=parseFloat(y[1])||0,T,w,S,E;i?h!==rn&&(w=d*g-v*p)&&(S=b*(g/w)+x*(-p/w)+(p*m-g*_)/w,E=b*(-v/w)+x*(d/w)-(d*m-v*_)/w,b=S,x=E):(T=lf(e),b=T.x+(~y[0].indexOf("%")?b/100*T.width:b),x=T.y+(~(y[1]||y[0]).indexOf("%")?x/100*T.height:x)),n||n!==!1&&a.smooth?(_=b-u,m=x-l,a.xOffset=f+(_*d+m*p)-_,a.yOffset=c+(_*v+m*g)-m):a.xOffset=a.yOffset=0,a.xOrigin=b,a.yOrigin=x,a.smooth=!!n,a.origin=t,a.originIsAbsolute=!!i,e.style[Oe]="0px 0px",o&&(mi(o,a,"xOrigin",u,b),mi(o,a,"yOrigin",l,x),mi(o,a,"xOffset",f,a.xOffset),mi(o,a,"yOffset",c,a.yOffset)),e.setAttribute("data-svg-origin",b+" "+x)},nn=function(e,t){var i=e._gsap||new Wl(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=He(e,Oe)||"0",l,f,c,d,v,p,g,_,m,y,b,x,T,w,S,E,P,O,M,L,B,A,I,F,Y,z,N,C,U,$,j,it;return l=f=c=p=g=_=m=y=b=0,d=v=1,i.svg=!!(e.getCTM&&ff(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=Aa(e,i.svg),i.svg&&(i.uncache?(Y=e.getBBox(),u=i.xOrigin-Y.x+"px "+(i.yOrigin-Y.y)+"px",F=""):F=!t&&e.getAttribute("data-svg-origin"),Ia(e,F||u,!!F||i.originIsAbsolute,i.smooth!==!1,w)),x=i.xOrigin||0,T=i.yOrigin||0,w!==rn&&(O=w[0],M=w[1],L=w[2],B=w[3],l=A=w[4],f=I=w[5],w.length===6?(d=Math.sqrt(O*O+M*M),v=Math.sqrt(B*B+L*L),p=O||M?_r(M,O)*zi:0,m=L||B?_r(L,B)*zi+p:0,m&&(v*=Math.abs(Math.cos(m*gr))),i.svg&&(l-=x-(x*O+T*L),f-=T-(x*M+T*B))):(it=w[6],$=w[7],N=w[8],C=w[9],U=w[10],j=w[11],l=w[12],f=w[13],c=w[14],S=_r(it,U),g=S*zi,S&&(E=Math.cos(-S),P=Math.sin(-S),F=A*E+N*P,Y=I*E+C*P,z=it*E+U*P,N=A*-P+N*E,C=I*-P+C*E,U=it*-P+U*E,j=$*-P+j*E,A=F,I=Y,it=z),S=_r(-L,U),_=S*zi,S&&(E=Math.cos(-S),P=Math.sin(-S),F=O*E-N*P,Y=M*E-C*P,z=L*E-U*P,j=B*P+j*E,O=F,M=Y,L=z),S=_r(M,O),p=S*zi,S&&(E=Math.cos(S),P=Math.sin(S),F=O*E+M*P,Y=A*E+I*P,M=M*E-O*P,I=I*E-A*P,O=F,A=Y),g&&Math.abs(g)+Math.abs(p)>359.9&&(g=p=0,_=180-_),d=Ct(Math.sqrt(O*O+M*M+L*L)),v=Ct(Math.sqrt(I*I+it*it)),S=_r(A,I),m=Math.abs(S)>2e-4?S*zi:0,b=j?1/(j<0?-j:j):0),i.svg&&(F=e.getAttribute("transform"),i.forceCSS=e.setAttribute("transform","")||!vf(He(e,yt)),F&&e.setAttribute("transform",F))),Math.abs(m)>90&&Math.abs(m)<270&&(s?(d*=-1,m+=p<=0?180:-180,p+=p<=0?180:-180):(v*=-1,m+=m<=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=Ct(d),i.scaleY=Ct(v),i.rotation=Ct(p)+a,i.rotationX=Ct(g)+a,i.rotationY=Ct(_)+a,i.skewX=m+a,i.skewY=y+a,i.transformPerspective=b+o,(i.zOrigin=parseFloat(u.split(" ")[2])||0)&&(n[Oe]=ps(u)),i.xOffset=i.yOffset=0,i.force3D=ne.force3D,i.renderTransform=i.svg?mx:af?_f:_x,i.uncache=0,i},ps=function(e){return(e=e.split(" "))[0]+" "+e[1]},Ma=function(e,t,i){var n=jt(t);return Ct(parseFloat(t)+parseFloat(yi(e,"x",i+"px",n)))+n},_x=function(e,t){t.z="0px",t.rotationY=t.rotationX="0deg",t.force3D=0,_f(e,t)},Yi="0deg",sn="0px",Vi=") ",_f=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,g=i.transformPerspective,_=i.force3D,m=i.target,y=i.zOrigin,b="",x=_==="auto"&&e&&e!==1||_===!0;if(y&&(f!==Yi||l!==Yi)){var T=parseFloat(l)*gr,w=Math.sin(T),S=Math.cos(T),E;T=parseFloat(f)*gr,E=Math.cos(T),o=Ma(m,o,w*E*-y),a=Ma(m,a,-Math.sin(T)*-y),h=Ma(m,h,S*E*-y+y)}g!==sn&&(b+="perspective("+g+Vi),(n||s)&&(b+="translate("+n+"%, "+s+"%) "),(x||o!==sn||a!==sn||h!==sn)&&(b+=h!==sn||x?"translate3d("+o+", "+a+", "+h+") ":"translate("+o+", "+a+Vi),u!==Yi&&(b+="rotate("+u+Vi),l!==Yi&&(b+="rotateY("+l+Vi),f!==Yi&&(b+="rotateX("+f+Vi),(c!==Yi||d!==Yi)&&(b+="skew("+c+", "+d+Vi),(v!==1||p!==1)&&(b+="scale("+v+", "+p+Vi),m.style[yt]=b||"translate(0, 0)"},mx=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,g=i.xOffset,_=i.yOffset,m=i.forceCSS,y=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*=gr,u*=gr,x=Math.cos(h)*f,T=Math.sin(h)*f,w=Math.sin(h-u)*-c,S=Math.cos(h-u)*c,u&&(l*=gr,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=Ct(x),T=Ct(T),w=Ct(w),S=Ct(S)):(x=f,S=c,T=w=0),(y&&!~(o+"").indexOf("px")||b&&!~(a+"").indexOf("px"))&&(y=yi(d,"x",o,"px"),b=yi(d,"y",a,"px")),(v||p||g||_)&&(y=Ct(y+v-(v*x+p*w)+g),b=Ct(b+p-(v*T+p*S)+_)),(n||s)&&(E=d.getBBox(),y=Ct(y+n/100*E.width),b=Ct(b+s/100*E.height)),E="matrix("+x+","+T+","+w+","+S+","+y+","+b+")",d.setAttribute("transform",E),m&&(d.style[yt]=E)},yx=function(e,t,i,n,s){var o=360,a=Ut(s),h=parseFloat(s)*(a&&~s.indexOf("rad")?zi: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*ef)%o-~~(u/o)*o:f==="ccw"&&u>0&&(u=(u-o*ef)%o-~~(u/o)*o)),e._pt=c=new Qt(e._pt,t,i,n,u,ix),c.e=l,c.u="deg",e._props.push(i),c},mf=function(e,t){for(var i in t)e[i]=t[i];return e},xx=function(e,t,i){var n=mf({},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=nn(i,1),en(i,yt),i.setAttribute("transform",u)):(u=getComputedStyle(i)[yt],o[yt]=t,a=nn(i,1),o[yt]=u);for(h in ei)u=n[h],l=a[h],u!==l&&s.indexOf(h)<0&&(d=jt(u),v=jt(l),f=d!==v?yi(i,h,u,v):parseFloat(u),c=parseFloat(l),e._pt=new Qt(e._pt,a,h,f,c-f,Pa),e._pt.u=v||0,e._props.push(h));mf(a,n)};$t("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});ds[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 ri(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 yf={name:"css",register:Ca,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,_,m,y,b,x,T,w,S;wa||Ca(),this.styles=this.styles||of(e),S=this.styles.props,this.tween=i;for(p in t)if(p!=="autoRound"&&(l=t[p],!(oe[p]&&zl(p,t,i,n,e,s)))){if(d=typeof l,v=ds[p],d==="function"&&(l=l.call(i,n,e,s),d=typeof l),d==="string"&&~l.indexOf("random(")&&(l=Kr(l)),v)v(this,e,p,l,i)&&(w=1);else if(p.substr(0,2)==="--")u=(getComputedStyle(e).getPropertyValue(p)+"").trim(),l+="",vi.lastIndex=0,vi.test(u)||(g=jt(u),_=jt(l)),_?g!==_&&(u=yi(e,p,u,_)+_):g&&(l+=g),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],Ut(u)&&~u.indexOf("random(")&&(u=Kr(u)),jt(u+"")||(u+=ne.units[p]||jt(ri(e,p))||""),(u+"").charAt(1)==="="&&(u=ri(e,p))):u=ri(e,p),c=parseFloat(u),m=d==="string"&&l.charAt(1)==="="&&l.substr(0,2),m&&(l=l.substr(2)),f=parseFloat(l),p in ii&&(p==="autoAlpha"&&(c===1&&ri(e,"visibility")==="hidden"&&f&&(c=0),S.push("visibility",0,a.visibility),mi(this,a,"visibility",c?"inherit":"hidden",f?"inherit":"hidden",!f)),p!=="scale"&&p!=="transform"&&(p=ii[p],~p.indexOf(",")&&(p=p.split(",")[0]))),y=p in ei,y){if(this.styles.save(p),b||(x=e._gsap,x.renderTransform&&!t.parseTransform||nn(e,t.parseTransform),T=t.smoothOrigin!==!1&&x.smooth,b=this._pt=new Qt(this._pt,a,yt,0,1,x.renderTransform,x,0,-1),b.dep=1),p==="scale")this._pt=new Qt(this._pt,x,"scaleY",x.scaleY,(m?hr(x.scaleY,m+f):f)-x.scaleY||0,Pa),this._pt.u=0,o.push("scaleY",p),p+="X";else if(p==="transformOrigin"){S.push(Oe,0,a[Oe]),l=vx(l),x.svg?Ia(e,l,0,T,0,this):(_=parseFloat(l.split(" ")[2])||0,_!==x.zOrigin&&mi(this,x,"zOrigin",x.zOrigin,_),mi(this,a,p,ps(u),ps(l)));continue}else if(p==="svgOrigin"){Ia(e,l,1,T,0,this);continue}else if(p in pf){yx(this,x,p,c,m?hr(c,m+l):l);continue}else if(p==="smoothOrigin"){mi(this,x,"smooth",x.smooth,l);continue}else if(p==="force3D"){x[p]=l;continue}else if(p==="transform"){xx(this,l,e);continue}}else p in a||(p=mr(p)||p);if(y||(f||f===0)&&(c||c===0)&&!ex.test(l)&&p in a)g=(u+"").substr((c+"").length),f||(f=0),_=jt(l)||(p in ne.units?ne.units[p]:g),g!==_&&(c=yi(e,p,u,_)),this._pt=new Qt(this._pt,y?x:a,p,c,(m?hr(c,m+f):f)-c,!y&&(_==="px"||p==="zIndex")&&t.autoRound!==!1?nx:Pa),this._pt.u=_||0,g!==_&&_!=="%"&&(this._pt.b=u,this._pt.r=rx);else if(p in a)px.call(this,e,p,u,m?m+l:l);else if(p in e)this.add(e,p,u||e[p],m?m+l:l,n,s);else if(p!=="parseTransform"){ta(p,l);continue}y||(p in a?S.push(p,0,a[p]):S.push(p,1,u||e[p])),o.push(p)}}w&&Kl(this)},render:function(e,t){if(t.tween._time||!Ea())for(var i=t._pt;i;)i.r(e,i.d),i=i._next;else t.styles.revert()},get:ri,aliases:ii,getSetter:function(e,t,i){var n=ii[t];return n&&n.indexOf(",")<0&&(t=n),t in ei&&t!==Oe&&(e._gsap.x||ri(e,"x"))?i&&tf===i?t==="scale"?hx:ax:(tf=i||{})&&(t==="scale"?ux:lx):e.style&&!qo(e.style[t])?sx:~t.indexOf("-")?ox:ma(e,t)},core:{_removeProperty:en,_getMatrix:Aa}};he.utils.checkPrefix=mr,he.core.getStyleSaver=of,function(r,e,t,i){var n=$t(r+","+e+","+t,function(s){ei[s]=1});$t(e,function(s){ne.units[s]="deg",pf[s]=1}),ii[n[13]]=r+","+e,$t(i,function(s){var o=s.split(":");ii[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"),$t("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(r){ne.units[r]="px"}),he.registerPlugin(yf);var Zt=he.registerPlugin(yf)||he;Zt.core.Tween;const vs=16,on=8,Na=4,xf=.7,bx=.25;class Tx extends st{constructor({graphState:t}){super();R(this,"graphState");R(this,"dimensionsObject",new ht);R(this,"dots",[]);R(this,"unWatchers",[]);this.graphState=t,this.initDimensions(),this.initDots(),this.initWatchers()}initWatchers(){const{styleOptions:t}=this.graphState,i=H.watch(t,()=>{this.destroyDots(),this.initDots()});this.unWatchers.push(i)}initDimensions(){const t=on*3+Na*2,i=vs*2+on;this.dimensionsObject.width=t,this.dimensionsObject.height=i,this.addChild(this.dimensionsObject)}initDots(){const{colorTextDefault:t}=this.graphState.styleOptions.value,i=new Ce;i.beginFill(t),i.drawCircle(0,0,on/2),i.endFill(),i.alpha=0,i.position.y=vs;const n=i.clone();n.alpha=0,n.position.set(on+Na,vs);const s=i.clone();s.alpha=0,s.position.set((on+Na)*2,vs),this.dots.push(i,n,s),this.addChild(i,n,s),this.initAnimation()}initAnimation(){const t=(i,n=0)=>{Zt.to(i,{alpha:1,duration:xf,delay:n,onComplete:()=>{Zt.to(i,{alpha:0,duration:xf,onComplete:()=>t(i)})}})};this.dots.forEach((i,n)=>{t(i,n*bx)})}destroyDots(){this.dots.forEach(t=>{Zt.killTweensOf(t),t.destroy()}),this.dots=[]}destroy(){this.unWatchers.forEach(t=>t()),this.removeChildren(),this.dimensionsObject.destroy(),this.destroyDots(),super.destroy.call(this)}}const Da=10;let Ae,Ie,Me,Ne;const Fa={multisample:2,resolution:4};function gs(){Ae=new Map,Ie=new Map,Me=new Map,Ne=new Map}function wx(){Ae&&(Ae.forEach(r=>{r.destroy()}),Ae.clear(),Ae=void 0),Ie&&(Ie.forEach(({cap:r,body:e})=>{r.destroy(),e.destroy()}),Ie.clear(),Ie=void 0),Me&&(Me.forEach(r=>{r.destroy()}),Me.clear(),Me=void 0),Ne&&(Ne.forEach(({corner:r,edge:e})=>{r.destroy(),e.destroy()}),Ne.clear(),Ne=void 0)}function an({pixiApp:r,fill:e}){if(Ae||gs(),!(Ae!=null&&Ae.has(e))){const t=new Ce;t.beginFill(e),t.drawRect(0,0,Da,Da),t.endFill();const i=r.renderer.generateTexture(t);Ae.set(e,i)}return Ae.get(e)}function La({pixiApp:r,fill:e,borderRadius:t,boxCapWidth:i,height:n}){if(Ie||gs(),!(Ie!=null&&Ie.has(e))){const s=new Ce;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=an({pixiApp:r,fill:e}),a=r.renderer.generateTexture(s,Fa),h=o;Ie.set(e,{cap:a,body:h})}return Ie.get(e)}function bf({pixiApp:r,strokeColor:e,edgeWidth:t,edgeLength:i}){if(Me||gs(),!(Me!=null&&Me.has(e))){const n=new Ce;n.lineStyle(t,e,1,.5),n.moveTo(-i,-i),n.lineTo(0,0),n.lineTo(-i,i);const s=r.renderer.generateTexture(n,Fa);Me.set(e,s)}return Me.get(e)}function Ex({pixiApp:r,borderRadius:e,borderColor:t,borderWidth:i}){Ne||gs();const n={borderRadius:e,borderColor:t,borderWidth:i};if(!(Ne!=null&&Ne.has(n))){const s=new Ce;s.lineStyle(i,t),s.moveTo(0,e),s.bezierCurveTo(0,e,0,0,e,0);const o=an({pixiApp:r,fill:t}),a=r.renderer.generateTexture(s,Fa);Ne.set(n,{corner:a,edge:o})}return Ne.get(n)}const Tf=.2,wf="power2.out";class Ba extends st{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}=Ex({pixiApp:s,borderRadius:t,borderColor:i,borderWidth:n});this.topLeft=new ht(o),this.topRight=new ht(o),this.topRight.position.set(this.rectWidth,0),this.topRight.rotation=Math.PI/2,this.bottomRight=new ht(o),this.bottomRight.position.set(this.rectWidth,this.rectHeight),this.bottomRight.rotation=Math.PI,this.bottomLeft=new ht(o),this.bottomLeft.position.set(0,this.rectHeight),this.bottomLeft.rotation=Math.PI*1.5,this.topEdge=new ht(a),this.topEdge.position.set(this.borderRadius,0),this.topEdge.width=this.rectWidth-this.borderRadius*2,this.topEdge.height=n,this.rightEdge=new ht(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 ht(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 ht(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:Tf,ease:wf};Zt.to(s,{x:v,...p}),Zt.to(o,{x:v,y:this.rectHeight,...p}),Zt.to(a,{y:this.rectHeight,...p}),Zt.to(h,{width:v-c,...p}),Zt.to(u,{height:this.rectHeight-c,x:v-this.borderWidth,...p}),Zt.to(l,{width:v-c,y:this.rectHeight-this.borderWidth,...p}),Zt.to(f,{height:this.rectHeight-c,...p})}killTweens(){const{topRight:t,bottomRight:i,bottomLeft:n,topEdge:s,rightEdge:o,bottomEdge:a,leftEdge:h}=this;Zt.killTweensOf([t,i,n,s,o,a,h])}destroy(){this.killTweens(),super.destroy.call(this)}}const Ef=64,_s=20;class Sx extends st{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 st);R(this,"unWatchers",[]);R(this,"getXBezier",(t,i)=>{const{sourceX:n,targetX:s}=this,o=(s-n)/2;return t+(o>Ef?o:Ef)*(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,g=l+(o-l)*t,_=f+(d-f)*t,m=c+(v-c)*t,y=d+(p-d)*t,b=v+(g-v)*t,x=_+(y-_)*t,T=m+(b-m)*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(H.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 $y(i,this.edgePoints,t/Da)}initEdgePoints(){const t=[];for(let s=0;s<_s;s++){const o=s===_s-1?{x:this.targetX,y:this.targetY}:this.getPointBezierPosition(s/_s);t.push(new Z(o.x,o.y))}const i=this.getTargetAnchorPointPosition(),n=new Z(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=bf({pixiApp:s,strokeColor:a,edgeWidth:h,edgeLength:u}),f=new ht(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/_s);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(ka).getLocalBounds().width}getNodeY(t){return t.y+t.getChildByName(ka).getLocalBounds().height/2}getEdgeTexture(){const{pixiApp:t,styleOptions:i}=this.graphState,{colorEdge:n}=i.value;return an({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 Px extends st{constructor({pixiApp:t,labelText:i,styleOptions:n}){super();R(this,"pixiApp");R(this,"labelText");R(this,"styleOptions");R(this,"guideLine");R(this,"label");this.pixiApp=t,this.labelText=i,this.styleOptions=n,this.initGuideLine(),this.drawLabel(),this.interactive=!1}initGuideLine(){const{pixiApp:t}=this,{colorGuideLine:i}=this.styleOptions.value,n=an({pixiApp:t,fill:i});this.guideLine=new ht(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 Yr(this.styleOptions.value),{spacingGuideLabelPadding:n}=this.styleOptions.value;(t=this.label)==null||t.destroy(),this.label=new $n(this.labelText,i.timeMarkerLabel),this.label.position.set(n,n),this.addChild(this.label)}}updateHeight(t){this.guideLine.height=t}}let ue;const Rx=({minimumStartTime:r,graphXDomain:e,initialOverallTimeSpan:t})=>({dateToX:Ox(r,e,t),xToDate:Ax(r,e,t)}),Cx=({minimumStartTime:r,graphXDomain:e,initialOverallTimeSpan:t})=>(ue=Rx({minimumStartTime:r,graphXDomain:e,initialOverallTimeSpan:t}),ue);function Ox(r,e,t){return function(i){return Math.ceil((i.getTime()-r)*(e/t))}}function Ax(r,e,t){return function(i){return new Date(Math.ceil(r+i*(t/e)))}}const Ix=260,Ga=4e3;class Mx extends st{constructor({graphState:t,maximumEndDate:i,formatDateFns:n}){super();R(this,"graphState");R(this,"maximumEndDate");R(this,"formatDateFns");R(this,"unWatchers",[]);R(this,"idealGuideCount",10);R(this,"currentTimeGap",120);R(this,"labelFormatter",t=>t.toLocaleTimeString());R(this,"guides",new Map);this.graphState=t,this.maximumEndDate=i,this.formatDateFns=n,this.updateIdealGuideCount(),this.updateCurrentTimeGap(),this.createGuides(),this.initWatchers(),this.interactive=!1}initWatchers(){const{styleOptions:t}=this.graphState;this.unWatchers.push(H.watch(t,()=>{this.removeChildren(),this.guides.clear(),this.createGuides()},{deep:!0}))}updateGuides(){const t=this.currentTimeGap;this.updateCurrentTimeGap(),this.isRedrawRequired(t)?(this.guides.size>0&&(this.removeChildren(),this.guides.clear()),this.createGuides()):this.updateGuidePositions()}updateIdealGuideCount(){const{pixiApp:t}=this.graphState;this.idealGuideCount=Math.ceil(t.screen.width/Ix)}updateCurrentTimeGap(){const{viewport:t}=this.graphState,{minimumStartTime:i}=this.graphState.timeScaleProps,n=Math.ceil((t.right-t.left)/this.idealGuideCount),s=ue.xToDate(n).getTime()-i,o=ja.find(a=>a.ceiling>s)??ja[0];this.currentTimeGap=o.span,this.setLabelFormatter(o.labelFormat)}createGuides(){const{pixiApp:t,styleOptions:i}=this.graphState;let n;const s=ue.xToDate(ue.dateToX(this.maximumEndDate.value??new Date)+Ga);let o=new Date(Math.ceil(ue.xToDate(-Ga).getTime()/this.currentTimeGap)*this.currentTimeGap);for(this.currentTimeGap>Q.hour*6?o=tc(o):this.currentTimeGap>Q.hour&&(o=ec(o)),n=o;n.getTime()<s.getTime();){const a=new Px({pixiApp:t,labelText:this.labelFormatter(n),styleOptions:i});a.position.set(this.getGuidePosition(n),0),this.guides.set(n,a),this.addChild(a),n=new Date(n.getTime()+this.currentTimeGap)}}getGuidePosition(t){const{viewport:i}=this.graphState;return ue.dateToX(t)*i.scale._x+i.worldTransform.tx}updateGuidePositions(){const{pixiApp:t}=this.graphState;this.guides.forEach((i,n)=>{this.getGuidePosition(n)!==i.position.x&&i.position.set(this.getGuidePosition(n),0),i.height!==t.screen.height&&i.updateHeight(t.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 h;const{isRunning:t,viewport:i,timeScaleProps:n}=this.graphState,{minimumStartTime:s}=n;if(!t.value)return!1;const o=(h=Array.from(this.guides).pop())==null?void 0:h[1];if(!o||!this.maximumEndDate.value)return!1;const a=this.getGuidePosition(this.maximumEndDate.value)+Ga*i.scale._x-ue.dateToX(new Date(s+this.currentTimeGap))*i.scale._x;return o.x<a}destroy(){this.removeChildren(),this.guides.forEach(t=>t.destroy()),this.guides.clear(),this.unWatchers.forEach(t=>t()),super.destroy.call(this)}}const le={nodeDetails:"nodeDetailsClick",subNodesToggle:"subNodesToggleClick"},Ua="nodeResize",Sf={fadeIn:.25,move:.5},ka="box",Nx="None",Dx=.2;class Fx extends st{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 st);R(this,"leftBoxCap");R(this,"rightBoxCap");R(this,"boxBody");R(this,"subNodesToggle");R(this,"subNodesToggleWidth",0);R(this,"isSubNodesToggleFloating",!1);R(this,"isLoadingSubNodes",!1);R(this,"subNodesLoadingIndicator",null);R(this,"noSubNodesMessage",null);R(this,"label");R(this,"apxLabelWidth",0);R(this,"isLabelInBox",!0);R(this,"isSubNodesExpanded",!1);R(this,"subNodesOutlineContainer",new st);R(this,"subNodesOutline");R(this,"subNodesContent",null);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})});R(this,"getSubNodesData",()=>{if(!this.nodeData.subFlowRunId)return[];const{expandedSubNodes:t}=this.graphState,i=t.value.get(this.nodeData.subFlowRunId).data;return"value"in i?i.value:i});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(H.watch(t,()=>{this.updatePosition()}),H.watch([a,h],()=>{this.drawBox(),this.drawLabel(),this.noSubNodesMessage&&this.drawNoSubNodesMessage()},{deep:!0}),H.watch(u,()=>{if(u.value===this.nodeData.id||u.value===this.nodeData.subFlowRunId){this.select();return}this.isSelected&&this.deselect()})),n&&i.push(H.watch(f,()=>{var d,v;if(this.nodeData.subFlowRunId){if(!this.isSubNodesExpanded&&f.value.has(this.nodeData.subFlowRunId)){if(this.isSubNodesExpanded=!0,(d=this.subNodesToggle)==null||d.setExpanded(),this.getSubNodesData().length===0&&!this.isLoadingSubNodes){this.isLoadingSubNodes=!0,this.drawLoadingSubNodes();return}this.expandSubNodes();return}if(this.isSubNodesExpanded){if(!f.value.has(this.nodeData.subFlowRunId)){(v=this.subNodesToggle)==null||v.setCollapsed(),this.isSubNodesExpanded=!1,this.isLoadingSubNodes=!1,this.collapseSubNodes();return}const p=this.getSubNodesData();if(this.isLoadingSubNodes&&(this.isLoadingSubNodes=!1,this.destroySubNodesLoadingIndicator(),p.length===0)){this.drawNoSubNodesMessage();return}if(!this.subNodesContent){this.expandSubNodes();return}this.subNodesContent.update(p)}}},{deep:!0}),H.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<Dx){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=ee(l),c=this.getOutlineWidth();this.subNodesOutline=new Ba({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=ka,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=ee(f);(p=this.leftBoxCap)==null||p.destroy(),(g=this.boxBody)==null||g.destroy(),(_=this.rightBoxCap)==null||_.destroy(),this.box.removeChildren();const{cap:d,body:v}=La({pixiApp:t,fill:c,borderRadius:l,boxCapWidth:u,height:a});this.leftBoxCap=new ht(d),this.boxBody=new ht(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 ht(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 kx({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 Yr(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=ce.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 $n(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 Ba({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;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.subNodesContent)==null||n.destroy(),this.subNodesContent=new Cf({isSubNodes:!0,graphData:i,graphState:this.graphState}),this.subNodesContent.on(le.nodeDetails,s=>{this.emit(le.nodeDetails,s)}),this.subNodesContent.on(le.subNodesToggle,s=>{this.emitSubNodesToggle(s)}),this.updateSubNodesContentPosition(),this.subNodesContent.on(Xa,()=>this.updateSubNodesContentPosition()),this.addChild(this.subNodesContent),this.initSubNodesTicker()}drawLoadingSubNodes(){const{graphState:t,box:i}=this,{spacingNodeMargin:n}=t.styleOptions.value;this.destroySubNodesLoadingIndicator(),this.subNodesLoadingIndicator=new Tx({graphState:t}),this.subNodesLoadingIndicator.position.set(i.width/2-this.subNodesLoadingIndicator.width/2,i.y+i.height+n),this.addChild(this.subNodesLoadingIndicator),this.initSubNodesTicker()}async drawNoSubNodesMessage(){const{box:t}=this,{styleOptions:i}=this.graphState,n=await Yr(i.value);this.destroyNoSubNodesMessage(),this.noSubNodesMessage=new $n(Nx,n.nodeTextSubdued),this.noSubNodesMessage.anchor.set(.5,0),this.noSubNodesMessage.position.set(t.width/2,t.y+t.height+i.value.spacingNodeMargin),this.addChild(this.noSubNodesMessage),this.initSubNodesTicker()}updateSubNodesContentPosition(){const{subNodesContent:t,box:i}=this,{spacingNodeMargin:n}=this.graphState.styleOptions.value;if(!t)return;const s=t.getEarliestNodeStart(),o=s?-ue.dateToX(s):0,a=i.y+i.height+n;t.position.set(o,a)}initSubNodesTicker(){const{pixiApp:t}=this.graphState;this.subNodesContentTicker||(this.subNodesHeight=0,this.subNodesContentTicker=()=>{const i=this.getSubContentHeight();i!==this.subNodesHeight&&(this.updateSubNodesOutlineSize(),this.updateSelectedRingSize(),this.subNodesHeight=i,this.emit(Ua))},t.ticker.add(this.subNodesContentTicker,null,re.LOW))}async collapseSubNodes(){this.destroySubNodesContent(),this.updateSelectedRingSize(),await this.updateSubNodesOutlineSize(),this.emit(Ua)}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||!this.nodeData.start)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?ue.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}Zt.to(this,{x:u,y:h,duration:Sf.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,subNodesOutline:n,nodeHeight:s}=this,{spacingSubNodesOutlineOffset:o,alphaSubNodesOutlineDimmed:a,spacingNodeMargin:h}=this.graphState.styleOptions.value,{suppressMotion:u}=this.graphState,l=this.getOutlineWidth(),f=i?s+this.getSubContentHeight()+h:s;n.resize({width:l,height:f,animate:!0}),await new Promise(c=>{const d=t||u.value?0:Tf,v=i?-o:o,p=i?-o:o,g=i?1:a;if(t||u.value){n.position.set(v,p),n.alpha=g,c(null);return}Zt.to(n,{x:v,y:p,alpha:g,duration:d,ease:wf}).then(()=>c(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;if(!n.start)return 0;const s=t?i:i*2,o=ue.dateToX(n.end??new Date)-ue.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(le.nodeDetails,n)}getSubContentHeight(){var i,n,s;const{spacingNodeMargin:t}=this.graphState.styleOptions.value;return(i=this.subNodesContent)!=null&&i.height?this.subNodesContent.height:(n=this.subNodesLoadingIndicator)!=null&&n.height?this.subNodesLoadingIndicator.height+t:(s=this.noSubNodesMessage)!=null&&s.height?this.noSubNodesMessage.height+t:0}emitSubNodesToggle(t){this.emit(le.subNodesToggle,t??this.nodeData.subFlowRunId)}destroySubNodesContent(){var t;this.subNodesContentTicker&&(this.graphState.pixiApp.ticker.remove(this.subNodesContentTicker),this.subNodesContentTicker=null),this.destroyNoSubNodesMessage(),this.destroySubNodesLoadingIndicator(),(t=this.subNodesContent)==null||t.destroy(),this.subNodesContent=null}destroySubNodesLoadingIndicator(){var t;(t=this.subNodesLoadingIndicator)==null||t.destroy(),this.subNodesLoadingIndicator=null}destroyNoSubNodesMessage(){var t;(t=this.noSubNodesMessage)==null||t.destroy(),this.noSubNodesMessage=null}destroyRunningNodeTicker(){this.runningNodeTicker&&(this.graphState.pixiApp.ticker.remove(this.runningNodeTicker),this.runningNodeTicker=null)}killTweens(){Zt.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(le.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 Pf="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2NvbnN0IGI9KHttaW5pbXVtU3RhcnRUaW1lOmUsZ3JhcGhYRG9tYWluOm4saW5pdGlhbE92ZXJhbGxUaW1lU3Bhbjp0fSk9Pih7ZGF0ZVRvWDpQKGUsbix0KSx4VG9EYXRlOkkoZSxuLHQpfSk7ZnVuY3Rpb24gUChlLG4sdCl7cmV0dXJuIGZ1bmN0aW9uKG8pe3JldHVybiBNYXRoLmNlaWwoKG8uZ2V0VGltZSgpLWUpKihuL3QpKX19ZnVuY3Rpb24gSShlLG4sdCl7cmV0dXJuIGZ1bmN0aW9uKG8pe3JldHVybiBuZXcgRGF0ZShNYXRoLmNlaWwoZStvKih0L24pKSl9fWNvbnN0IGc9MDtsZXQgeSxEPTE0LHY9MCxoPSJ3YXRlcmZhbGwiLGQ9W107Y29uc3QgYT17fTtvbm1lc3NhZ2U9YXN5bmMoe2RhdGE6e2xheW91dFNldHRpbmc6ZSxncmFwaERhdGE6bixhcHhDaGFyYWN0ZXJXaWR0aDp0LHNwYWNpbmdNaW5pbXVtTm9kZUVkZ2VHYXA6byx0aW1lU2NhbGVQcm9wczppLGNlbnRlclZpZXdwb3J0QWZ0ZXI6c319KT0+e2Zvcihjb25zdCByIGluIGEpZGVsZXRlIGFbcl07aWYobyYmKHY9byksZSYmKGg9ZSksdCYmKEQ9dCksaSl7Y29uc3R7bWluaW11bVN0YXJ0VGltZTpyLGdyYXBoWERvbWFpbjpjLGluaXRpYWxPdmVyYWxsVGltZVNwYW46dX09aTt5PWIoe21pbmltdW1TdGFydFRpbWU6cixncmFwaFhEb21haW46Yyxpbml0aWFsT3ZlcmFsbFRpbWVTcGFuOnV9KX1pZihuKXtjb25zdCByPUpTT04ucGFyc2Uobik7eSYmKGV8fGQhPT1yKSYmKGQ9TChyKSxhd2FpdCBTKCkscG9zdE1lc3NhZ2Uoe2xheW91dDphLGNlbnRlclZpZXdwb3J0QWZ0ZXI6c30pKX19O2Z1bmN0aW9uIEwoZSl7cmV0dXJuIGUuZmlsdGVyKE8pLm1hcChuPT4obi5zdGFydD1uZXcgRGF0ZShuLnN0YXJ0KSxuLmVuZCYmKG4uZW5kPW5ldyBEYXRlKG4uZW5kKSksbikpLnNvcnQoKG4sdCk9Pm4uc3RhcnQuZ2V0VGltZSgpLXQuc3RhcnQuZ2V0VGltZSgpKX1mdW5jdGlvbiBPKGUpe3JldHVybiB0eXBlb2YgZT09Im9iamVjdCImJiJzdGFydCJpbiBlfWFzeW5jIGZ1bmN0aW9uIFMoKXtoPT09IndhdGVyZmFsbCImJlgoKSxoPT09Im5lYXJlc3RQYXJlbnQiJiZhd2FpdCBDKCksQigpfWZ1bmN0aW9uIFgoKXtkLmZvckVhY2goKGUsbik9PnthW2UuaWRdPXtwb3NpdGlvbjpuLHN0YXJ0WDowLGVuZFg6MH19KX1hc3luYyBmdW5jdGlvbiBDKCl7Zm9yIGF3YWl0KGNvbnN0IGUgb2YgZCl7aWYoIWUuc3RhcnQpY29udGludWU7Y29uc3Qgbj15LmRhdGVUb1goZS5lbmQ/bmV3IERhdGUoZS5lbmQpOm5ldyBEYXRlKSx0PWUubGFiZWwubGVuZ3RoKkQsbz1uK3QsaT1lLmlkIGluIGE/YVtlLmlkXS5zdGFydFg6eS5kYXRlVG9YKG5ldyBEYXRlKGUuc3RhcnQpKSxzPWF3YWl0IEEoZSxpKTthW2UuaWRdPXtwb3NpdGlvbjpzLHN0YXJ0WDppLGVuZFg6b319fWFzeW5jIGZ1bmN0aW9uIEEoZSxuKXtpZihlLnVwc3RyZWFtRGVwZW5kZW5jaWVzJiZlLnVwc3RyZWFtRGVwZW5kZW5jaWVzLmxlbmd0aD09PTEpe2lmKGUudXBzdHJlYW1EZXBlbmRlbmNpZXNbMF1pbiBhKXtjb25zdCB0PWFbZS51cHN0cmVhbURlcGVuZGVuY2llc1swXV07cmV0dXJuIGF3YWl0IHcodCxuKX1yZXR1cm4gY29uc29sZS53YXJuKCJ0aW1lbGluZU5vZGVzIGxheW91dCB3b3JrZXI6IFBhcmVudCBub2RlIG5vdCBmb3VuZCBpbiBsYXlvdXQiLGUudXBzdHJlYW1EZXBlbmRlbmNpZXNbMF0pLGd9aWYoZS51cHN0cmVhbURlcGVuZGVuY2llcyYmZS51cHN0cmVhbURlcGVuZGVuY2llcy5sZW5ndGg+MCl7Y29uc3Qgbz1lLnVwc3RyZWFtRGVwZW5kZW5jaWVzLm1hcChjPT5hW2NdKS5maWx0ZXIoYz0+ISFjKS5tYXAoYz0+Yy5wb3NpdGlvbikscz1vLnJlZHVjZSgoYyx1KT0+Yyt1LDApL28ubGVuZ3RoLHI9TWF0aC5yb3VuZChzKTtpZihtKG4scikpe2NvbnN0IGM9VChuLHIpLHU9Yy5maWx0ZXIocD0+e3ZhciBsO3JldHVybihsPWUudXBzdHJlYW1EZXBlbmRlbmNpZXMpPT1udWxsP3ZvaWQgMDpsLmluY2x1ZGVzKHApfSk7aWYodS5sZW5ndGg+MHx8Yy5sZW5ndGg+MSl7Y29uc3RbcF09dS5sZW5ndGg+MD91OmMsbD1hW3BdO3JldHVybiBsLm5leHREZXBlbmRlbmN5U2hvdmU9aihvLHIsbC5uZXh0RGVwZW5kZW5jeVNob3ZlKSxhd2FpdCB3KGwsbil9cmV0dXJuIGF3YWl0IGsoe2NvbXBldGluZ0xheW91dEl0ZW1JZDpjWzBdLHVwc3RyZWFtUG9zaXRpb25zOm8sbm9kZVN0YXJ0WDpuLGRlc2lyZWRQb3NpdGlvbjpyfSl9fXJldHVybiBOKG4sZyl9ZnVuY3Rpb24gTihlLG4pe3JldHVybiBtKGUsbik/TihlLG4rMSk6bn1hc3luYyBmdW5jdGlvbiB3KGUsbil7ZS5uZXh0RGVwZW5kZW5jeVNob3ZlIT09MSYmZS5uZXh0RGVwZW5kZW5jeVNob3ZlIT09LTEmJihlLm5leHREZXBlbmRlbmN5U2hvdmU9MSk7Y29uc3R7cG9zaXRpb246dCxuZXh0RGVwZW5kZW5jeVNob3ZlOm99PWU7cmV0dXJuIG0obix0KT9vPT09MSYmIW0obix0KzEpPyhlLm5leHREZXBlbmRlbmN5U2hvdmU9LTEsdCsxKTptKG4sdC0xKT8oYXdhaXQgZih7ZGlyZWN0aW9uOm8sbm9kZVN0YXJ0WDpuLGRlc2lyZWRQb3NpdGlvbjp0K299KSxlLm5leHREZXBlbmRlbmN5U2hvdmU9bz09PTE/LTE6MSx0K28pOihlLm5leHREZXBlbmRlbmN5U2hvdmU9MSx0LTEpOnR9ZnVuY3Rpb24gbShlLG4pe2NvbnN0IHQ9T2JqZWN0LmtleXMoYSk7cmV0dXJuIHQubGVuZ3RoPjAmJnQuc29tZShvPT57Y29uc3QgaT1hW29dO3JldHVybiB4KHtmaXJzdE5vZGVFbmRYOmkuZW5kWCxmaXJzdE5vZGVQb3NpdGlvbjppLnBvc2l0aW9uLGxhc3ROb2RlU3RhcnRYOmUsbGFzdE5vZGVQb3NpdGlvbjpufSl9KX1hc3luYyBmdW5jdGlvbiBmKHtkaXJlY3Rpb246ZSxub2RlU3RhcnRYOm4sZGVzaXJlZFBvc2l0aW9uOnR9KXtjb25zdCBvPVQobix0KTtpZihvKWZvciBhd2FpdChjb25zdCBpIG9mIG8pe2NvbnN0IHM9YVtpXSxyPXMucG9zaXRpb24rZTthd2FpdCBmKHtkaXJlY3Rpb246ZSxub2RlU3RhcnRYOnMuc3RhcnRYLGRlc2lyZWRQb3NpdGlvbjpyfSkscy5wb3NpdGlvbj1yfX1mdW5jdGlvbiB4KHtmaXJzdE5vZGVFbmRYOmUsZmlyc3ROb2RlUG9zaXRpb246bixsYXN0Tm9kZVN0YXJ0WDp0LGxhc3ROb2RlUG9zaXRpb246b30pe3JldHVybiBuPT09byYmZSt2Pj10fWZ1bmN0aW9uIFQoZSxuKXtjb25zdCB0PVtdO2lmKE9iamVjdC5rZXlzKGEpLmZvckVhY2gobz0+e2NvbnN0IGk9YVtvXTt4KHtmaXJzdE5vZGVFbmRYOmkuZW5kWCxmaXJzdE5vZGVQb3NpdGlvbjppLnBvc2l0aW9uLGxhc3ROb2RlU3RhcnRYOmUsbGFzdE5vZGVQb3NpdGlvbjpufSkmJnQucHVzaChvKX0pLHQubGVuZ3RoIT09MClyZXR1cm4gdC5zb3J0KChvLGkpPT57Y29uc3Qgcz1hW29dLHI9YVtpXTtyZXR1cm4gcy5lbmRYPHIuZW5kWD8xOnMuZW5kWD5yLmVuZFg/LTE6MH0pLHR9ZnVuY3Rpb24gaihlLG4sdCl7Y29uc3Qgbz1lLmZpbHRlcihzPT5zPG4pLmxlbmd0aCxpPWUuZmlsdGVyKHM9PnM+bikubGVuZ3RoO3JldHVybiBvPmk/LTE6dD8/MX1hc3luYyBmdW5jdGlvbiBrKHtkZXNpcmVkUG9zaXRpb246ZSxub2RlU3RhcnRYOm4sdXBzdHJlYW1Qb3NpdGlvbnM6dCxjb21wZXRpbmdMYXlvdXRJdGVtSWQ6b30pe2NvbnN0IGk9YVtvXSxbcyxyXT1FKG8pLGM9dC5maWx0ZXIocD0+cDxlKS5sZW5ndGgsdT10LmZpbHRlcihwPT5wPmUpLmxlbmd0aDtpZihjPnUpe2lmKHM+ciYmcz5jKXJldHVybiBhd2FpdCBmKHtkaXJlY3Rpb246LTEsbm9kZVN0YXJ0WDpuLGRlc2lyZWRQb3NpdGlvbjplfSksZTtpZihyPnMpcmV0dXJuIGF3YWl0IGYoe2RpcmVjdGlvbjoxLG5vZGVTdGFydFg6bixkZXNpcmVkUG9zaXRpb246ZX0pLGU7aS5uZXh0RGVwZW5kZW5jeVNob3ZlPS0xfWlmKHU+Yyl7aWYocj5zJiZyPnUpcmV0dXJuIGF3YWl0IGYoe2RpcmVjdGlvbjoxLG5vZGVTdGFydFg6bixkZXNpcmVkUG9zaXRpb246ZX0pLGU7aWYocz5yKXJldHVybiBhd2FpdCBmKHtkaXJlY3Rpb246LTEsbm9kZVN0YXJ0WDpuLGRlc2lyZWRQb3NpdGlvbjplfSksZTtpLm5leHREZXBlbmRlbmN5U2hvdmU9MX1yZXR1cm4gYXdhaXQgdyhpLG4pfWZ1bmN0aW9uIEUoZSl7dmFyIG87Y29uc3Qgbj1kLmZpbmQoaT0+aS5pZD09PWUpLHQ9YVtlXTtyZXR1cm4oKG89bi51cHN0cmVhbURlcGVuZGVuY2llcyk9PW51bGw/dm9pZCAwOm8ucmVkdWNlKChpLHMpPT57aWYoZSBpbiBhKXtjb25zdCByPWFbc107cmV0dXJuIHIucG9zaXRpb248dC5wb3NpdGlvbiYmKGlbMF0rPTEpLHIucG9zaXRpb24+dC5wb3NpdGlvbiYmKGlbMV0rPTEpLGl9cmV0dXJuIGNvbnNvbGUud2Fybigibm9kZUxheW91dC53b3JrZXIudHM6IFBhcmVudCBub2RlIG5vdCBmb3VuZCBvbiBsYXlvdXQgZGF0YSIsZSksaX0sWzAsMF0pKT8/WzAsMF19ZnVuY3Rpb24gQigpe2NvbnN0IGU9T2JqZWN0LnZhbHVlcyhhKS5yZWR1Y2UoKG4sdCk9PnQucG9zaXRpb248bj90LnBvc2l0aW9uOm4sMCk7ZTwwJiZPYmplY3QudmFsdWVzKGEpLmZvckVhY2gobj0+e24ucG9zaXRpb24rPU1hdGguYWJzKGUpfSl9fSkoKTsKLy8jIHNvdXJjZU1hcHBpbmdVUkw9bm9kZUxheW91dC53b3JrZXItMzBjMmM3MTUuanMubWFwCi8vIyBzb3VyY2VNYXBwaW5nVVJMPWFzc2V0cy9ub2RlTGF5b3V0Lndvcmtlci0zMGMyYzcxNS5qcy5tYXA=",Rf=typeof window<"u"&&window.Blob&&new Blob([atob(Pf)],{type:"text/javascript;charset=utf-8"});function Lx(){const r=Rf&&(window.URL||window.webkitURL).createObjectURL(Rf);try{return r?new Worker(r):new Worker("data:application/javascript;base64,"+Pf)}finally{r&&(window.URL||window.webkitURL).revokeObjectURL(r)}}const Xa="timelineUpdateEvent";class Cf extends st{constructor({nodeContentContainerName:t,isSubNodes:i,graphData:n,graphState:s}){super();R(this,"layoutWorker",new Lx);R(this,"isSubNodes");R(this,"graphData");R(this,"graphDataLookup",new Map);R(this,"graphState");R(this,"nodeContainer",new st);R(this,"nodeRecords",new Map);R(this,"layout",H.ref({}));R(this,"layoutRows",H.ref([]));R(this,"edgeContainer",new st);R(this,"edgeRecords",[]);R(this,"unWatchers",[]);R(this,"isSelectionPathHighlighted",!1);t&&(this.nodeContainer.name=t),this.isSubNodes=i,this.graphData=n,this.setGraphDataLookup(),this.graphState=s,this.initDeselectLayer(),this.initLayoutWorker(),this.initWatchers()}initWatchers(){const{layoutSetting:t,hideEdges:i,selectedNodeId:n}=this.graphState;this.unWatchers.push(H.watch(t,()=>{this.updateLayoutSetting()}),H.watch(i,()=>{this.updateHideEdges()}),H.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 Yr(t.value),{spacingMinimumNodeEdgeGap:h}=t.value,u=ce.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:Sf.move*1e3*1.1),this.emit(Xa)},this.layoutWorker.postMessage(l.data)}initDeselectLayer(){if(this.isSubNodes)return;const{pixiApp:t,viewport:i}=this.graphState,n=new i0(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}))}createNode(t){const{graphState:i,layout:n,layoutRows:s}=this,o=new Fx({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(Ua,()=>{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 Sx({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,this.setGraphDataLookup(),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(Xa)}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()}updateLayoutRows(t=0){const{layout:i}=this,{spacingNodeMargin:n,spacingNodeSelectionMargin:s}=this.graphState.styleOptions.value,o=Math.max(...Object.values(i.value).map(u=>u.position));let a=[];const h=Object.keys(i.value).reduce((u,l)=>{var v;const f=i.value[l].position,c=u.get(f)??0,d=((v=this.nodeRecords.get(l))==null?void 0:v.height)??0;return u.set(f,Math.max(d,c)),u},new Map);for(let u=t;u<=o;u++){const l=a[u-1],f=h.get(u)??0;if(l===void 0){a.push({yPos:0,height:f});continue}const c=l.yPos+l.height-s*2+n;a.push({yPos:c,height:f})}t>0&&(a=this.layoutRows.value.slice(0,t).concat(a)),this.layoutRows.value=a}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.getNodeData(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})}setGraphDataLookup(){this.graphData.forEach(t=>{this.graphDataLookup.set(t.id,t)})}registerEmits(t){t.on(le.nodeDetails,i=>{this.emit(le.nodeDetails,i)}),t.on(le.subNodesToggle,i=>{this.emit(le.subNodesToggle,i)})}emitNullSelection(){this.emit(le.nodeDetails,null)}getNodeData(t){return this.graphDataLookup.get(t)}getEarliestNodeStart(){return this.graphData.length<1?null:this.graphData.reduce((i,n)=>n.start&&n.start.getTime()<i.getTime()?n.start:i,new Date)}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||wx(),super.destroy.call(this)}}class Bx extends st{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 Ce);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=H.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 Yr(this.styleOptions.value),{timeBySeconds:s}=this.formatDateFns.value,o=s(new Date);this.label=new $n(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=ue.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 Ha={leftCap:"leftCap",body:"body",rightCap:"rightCap"},Gx=.2,Ux=.2;class kx extends st{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 st);R(this,"hoverShade",new st);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(H.watch([i,n],()=>{this.redraw()},{deep:!0})),t.on("frame-end",()=>{t.scale.x<Ux?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}=La({pixiApp:n,fill:o,borderRadius:a,boxCapWidth:a,height:t}),l=new ht(h),f=new ht(u);f.x=a,f.width=t-a*2,f.height=t;const c=new ht(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=ee(a);t.removeChildren();const{cap:l,body:f}=La({pixiApp:this.graphState.pixiApp,fill:n?o:u,borderRadius:s,boxCapWidth:s,height:i}),c=new ht(l);c.name=Ha.leftCap,c.alpha=n?1:h;const d=new ht(f);d.name=Ha.body,d.x=s,d.width=n?i-s*2:i-s,d.height=i,d.alpha=n?1:h;const v=new ht(l);v.name=Ha.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=an({pixiApp:n,fill:i});this.divider=new ht(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=bf({pixiApp:s,strokeColor:i,edgeWidth:2,edgeLength:8});this.toggleArrow=new ht(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 Ba({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&&Zt.to(this.toggleArrow,{rotation:t,duration:i.value?0:Gx,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 Xx=H.defineComponent({__name:"FlowRunTimeline",props:{graphData:null,isRunning:{type:Boolean},theme:null,formatDateFns:null,selectedNodeId:null,layout:null,hideEdges:{type:Boolean},subNodeLabels:null,expandedSubNodes:null,visibleDateRange:null},emits:["selection","subNodeToggle","update:visibleDateRange"],setup(r,{expose:e,emit:t}){const i=r,n=500;e({centerViewport:kt,moveViewportCenter:qt});const s=H.computed({get(){return i.visibleDateRange},set(k){t("update:visibleDateRange",k)}}),o=H.ref(),a=H.computed(()=>{var k;return((k=i.theme)==null?void 0:k.node)??Ja}),h=H.computed(()=>{var k;return ic((k=i.theme)==null?void 0:k.defaults)}),u=H.computed(()=>i.selectedNodeId??null),l=H.computed(()=>i.layout??"nearestParent"),f=H.computed(()=>i.isRunning??!1),c=H.computed(()=>i.hideEdges??!1),d=H.computed(()=>i.subNodeLabels??new Map),v=H.computed(()=>i.expandedSubNodes??new Map),p=H.computed(()=>{const k=window.matchMedia("(prefers-reduced-motion: reduce)").matches;return i.graphData.length>n||k}),g=H.ref(!1),_=H.computed(()=>({...$a,...i.formatDateFns})),m={timelineGuides:0,viewport:10,playhead:20},y=H.ref(!0);let b,x;const T=new jf;let w,S;const E=H.ref();let P,O,M,L,B,A=null;const I="rootNodesContainer";let F,Y=null;H.onMounted(async()=>{if(!o.value){console.error("Stage reference not found in initPixiApp");return}$(),M=Cx(w),b=r0(o.value),b.stage.sortableChildren=!0,x=await o0(o.value,b),x.zIndex=m.viewport,N(),U(),it(),vt(),Lt(),J(),ft(),xt(),y.value=!1}),H.onBeforeUnmount(()=>{z()});function z(){L.destroy(),B==null||B.destroy(),F.destroy(),x.destroy(),b.destroy(!0)}function N(){x.on("drag-start",()=>{g.value=!0}).on("drag-end",()=>{g.value=!1})}function C(){s.value={startDate:M.xToDate(x.left),endDate:M.xToDate(x.right),internalOrigin:!0}}function U(){x.on("moved",()=>{C()}),x.on("resize",()=>{C()})}H.watch(()=>i.visibleDateRange,k=>{if(k&&!k.internalOrigin){const dt=M.dateToX(k.startDate),Wt=M.dateToX(k.endDate),te=dt+(Wt-dt)/2;x.fitWidth(Wt-dt,!0),x.moveCenter(te,x.center.y)}});function $(){const dt=i.graphData.filter(Ka).map(({start:ni,end:si})=>({start:ni,end:si}));f.value&&dt.push({start:new Date,end:new Date});const{min:Wt,max:te,span:ze}=Qf(dt,6e4);S=Wt,E.value=te,P=ze,O=j(),w={minimumStartTime:S.getTime(),graphXDomain:O,initialOverallTimeSpan:P}}function j(){const{spacingNodeYPadding:k,textLineHeightDefault:dt,spacingNodeMargin:Wt,spacingSubNodesOutlineOffset:te}=h.value,ze=i.graphData.length,ni=dt+k*2+te*2+Wt,si=o.value.clientWidth/o.value.clientHeight,sb=ni*ze*si,ob=ze>=120?ze/100:1.2;return sb*ob}function it(){e0(h.value),H.watch(h,k=>{t0(k)})}function vt(){Y={pixiApp:b,viewport:x,cull:T,cullScreen:at,timeScaleProps:w,styleOptions:h,styleNode:a,layoutSetting:l,isRunning:f,hideEdges:c,subNodeLabels:d,selectedNodeId:u,expandedSubNodes:v,suppressMotion:p,centerViewport:kt}}function ft(){f.value&&(B=new Bx({viewportRef:x,appRef:b,cull:T,formatDateFns:_,styleOptions:h}),B.zIndex=m.playhead,b.stage.addChild(B),It())}function It(){A||!B||(A=()=>{if(f.value&&B&&!B.destroyed){const k=B.position.x>0&&B.position.x<b.screen.width;if(E.value=new Date,B.updatePosition(),!x.moving&&k&&B.position.x>b.screen.width-h.value.spacingViewportPaddingDefault){const dt=M.xToDate(x.left);x.zoomPercent(-.1,!0),x.left=M.dateToX(dt)}}},b.ticker.add(A))}H.watch(f,k=>{y.value||(k&&(!B||B.destroyed)&&ft(),!k&&B&&A&&(B.destroy(),b.ticker.remove(A),A=null))});function Lt(){Y&&(L=new Mx({graphState:Y,maximumEndDate:E,formatDateFns:_}),L.zIndex=m.timelineGuides,b.stage.addChild(L),b.ticker.add(()=>{L.updateGuides()}))}function xt(){x.on("frame-end",()=>{x.dirty&&(at(),x.dirty=!1)})}function rt(){T.uncull()}function ct(){at()}function at(){T.cull(b.renderer.screen)}function J(){Y&&(F=new Cf({nodeContentContainerName:I,graphData:i.graphData,graphState:Y}),x.addChild(F),F.on(le.nodeDetails,k=>{g.value||t("selection",k)}),F.on(le.subNodesToggle,k=>{g.value||t("subNodeToggle",k)}),H.watch(()=>i.graphData,()=>{F.update(i.graphData),x.dirty=!0}))}function kt({skipAnimation:k}={}){const{spacingViewportPaddingDefault:dt}=h.value,Wt=500;rt();const{x:te,y:ze,width:ni,height:si}=F.getChildByName(I).getLocalBounds();ct();const xr=x.findFit(ni+dt*2,si+dt*2);x.animate({position:{x:te+ni/2,y:ze+si/2},scale:xr>1?1:xr,time:k||p.value?0:Wt,ease:"easeInOutQuad",removeOnInterrupt:!0,callbackOnComplete:()=>{k&&C()}})}function qt({xOffset:k,yOffset:dt}){const{x:Wt,y:te}=x.transform.position;x.setTransform(Wt+k,te+dt,x.transform.scale.x,x.transform.scale.y)}return(k,dt)=>(H.openBlock(),H.createElementBlock("div",{ref_key:"stage",ref:o,class:"g-flow-run-timeline"},null,512))}}),yb="";class fe{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 Hx=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Wx(r,e,t){return t={path:e,exports:{},require:function(i,n){return zx(i,n??t.path)}},r(t,t.exports),t.exports}function zx(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var Of=Wx(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(Hx)});function ms(r,e){if(r){if(typeof r=="function")return r;if(typeof r=="string")return Of[r]}else return Of[e]}const Yx={removeOnInterrupt:!1,ease:"linear",time:1e3};class We extends fe{__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),We.prototype.__init.call(this),We.prototype.__init2.call(this),We.prototype.__init3.call(this),We.prototype.__init4.call(this),We.prototype.__init5.call(this),We.prototype.__init6.call(this),We.prototype.__init7.call(this),this.options=Object.assign({},Yx,t),this.options.ease=ms(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 Z(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 Z(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 ys(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 Vx={sides:"all",friction:.5,time:150,ease:"easeInOutSine",underflow:"center",bounceBox:null};class Af extends fe{constructor(e,t={}){super(e),this.options=Object.assign({},Vx,t),this.ease=ms(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 Z(t*this.parent.scale.x,i*this.parent.scale.y),bottomRight:new Z(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 Z(0,0),bottomRight:new Z(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===ys([t,"access",s=>s.options,"optionalAccess",s=>s.friction])||t.y&&t.percentChangeY===ys([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||{},!ys([i,"optionalAccess",s=>s.active])&&!ys([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 jx={left:!1,right:!1,top:!1,bottom:!1,direction:null,underflow:"center"};class If extends fe{constructor(e,t={}){super(e),this.options=Object.assign({},jx,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 Zx={minWidth:null,minHeight:null,maxWidth:null,maxHeight:null,minScale:null,maxScale:null};class Mf extends fe{constructor(e,t={}){super(e),this.options=Object.assign({},Zx,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 qx={friction:.98,bounce:.8,minSpeed:.01},xi=16;class Nf extends fe{constructor(e,t={}){super(e),this.options=Object.assign({},qx,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*xi/o*(Math.pow(s,n/xi)-Math.pow(s,i/xi)),this.x*=Math.pow(this.percentChangeX,e/xi)}if(this.y){const s=this.percentChangeY,o=Math.log(s);this.parent.y+=this.y*xi/o*(Math.pow(s,n/xi)-Math.pow(s,i/xi)),this.y*=Math.pow(this.percentChangeY,e/xi)}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 Kx={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 xs extends fe{__init(){this.windowEventHandlers=new Array}constructor(e,t={}){super(e),xs.prototype.__init.call(this),this.options=Object.assign({},Kx,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 Z(this.last.x,this.last.y),world:this.parent.toWorld(new Z(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 Z(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 $x={speed:0,acceleration:null,radius:null};class Df extends fe{constructor(e,t,i={}){super(e),this.target=t,this.options=Object.assign({},$x,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 Jx={radius:null,distance:null,top:null,bottom:null,left:null,right:null,speed:8,reverse:!1,noDecelerate:!1,linear:!1,allowButtons:!1};class Ff extends fe{constructor(e,t={}){super(e),this.options=Object.assign({},Jx,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 Qx={noDrag:!1,percent:1,center:null,factor:1,axis:"all"};class yr extends fe{__init(){this.active=!1}__init2(){this.pinching=!1}__init3(){this.moved=!1}constructor(e,t={}){super(e),yr.prototype.__init.call(this),yr.prototype.__init2.call(this),yr.prototype.__init3.call(this),this.options=Object.assign({},Qx,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 tb={topLeft:!1,friction:.8,time:1e3,ease:"easeInOutSine",interrupt:!0,removeOnComplete:!1,removeOnInterrupt:!1,forceStart:!1};class Lf extends fe{constructor(e,t,i,n={}){super(e),this.options=Object.assign({},tb,n),this.ease=ms(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 eb={width:0,height:0,time:1e3,ease:"easeInOutSine",center:null,interrupt:!0,removeOnComplete:!1,removeOnInterrupt:!1,forceStart:!1,noMove:!1};class Bf extends fe{constructor(e,t={}){super(e),this.options=Object.assign({},eb,t),this.ease=ms(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 ib={percent:.1,smooth:!1,interrupt:!0,reverse:!1,center:null,lineHeight:20,axis:"all",keyToPress:null,trackpadPinch:!1,wheelZoom:!0};class Gf extends fe{constructor(e,t={}){super(e),this.options=Object.assign({},ib,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 Uf{constructor(e){this.viewport=e,this.touches=[],this.addListeners()}addListeners(){this.viewport.interactive=!0,this.viewport.forceHitArea||(this.viewport.hitArea=new K(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 Z;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 bs(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 hn=["drag","pinch","wheel","follow","mouse-edges","decelerate","animate","bounce","snap-zoom","clamp-zoom","snap","clamp"];class kf{constructor(e){this.viewport=e,this.list=[],this.plugins={}}add(e,t,i=hn.length){const n=this.plugins[e];n&&n.destroy(),this.plugins[e]=t;const s=hn.indexOf(e);s!==-1&&hn.splice(s,1),hn.splice(i,0,e),this.sort()}get(e,t){return t&&bs([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]&&(bs([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){bs([this,"access",t=>t.plugins,"access",t=>t[e],"optionalAccess",t=>t.pause,"call",t=>t()])}resume(e){bs([this,"access",t=>t.plugins,"access",t=>t[e],"optionalAccess",t=>t.resume,"call",t=>t()])}sort(){this.list=[];for(const e of hn)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 rb={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:Gt.shared};class Wa extends st{__init(){this._disableOnContextMenu=e=>e.preventDefault()}constructor(e={}){super(),Wa.prototype.__init.call(this),this.options=Object.assign({},{divWheel:document.body},rb,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 Uf(this),this.plugins=new kf(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 K(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 K(this.left,this.top,this.worldScreenWidth,this.worldScreenHeight)}toWorld(e,t){return arguments.length===2?this.toLocal(new Z(e,t)):this.toLocal(e)}toScreen(e,t){return arguments.length===2?this.toGlobal(new Z(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 Z(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 Z(-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 Bf(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 Z(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 K(0,0,this.worldWidth,this.worldHeight))}drag(e){return this.plugins.add("drag",new xs(this,e)),this}clamp(e){return this.plugins.add("clamp",new If(this,e)),this}decelerate(e){return this.plugins.add("decelerate",new Nf(this,e)),this}bounce(e){return this.plugins.add("bounce",new Af(this,e)),this}pinch(e){return this.plugins.add("pinch",new yr(this,e)),this}snap(e,t,i){return this.plugins.add("snap",new Lf(this,e,t,i)),this}follow(e,t){return this.plugins.add("follow",new Df(this,e,t)),this}wheel(e){return this.plugins.add("wheel",new Gf(this,e)),this}animate(e){return this.plugins.add("animate",new We(this,e)),this}clampZoom(e){return this.plugins.add("clamp-zoom",new Mf(this,e)),this}mouseEdges(e){return this.plugins.add("mouse-edges",new Ff(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 nb=Object.freeze(Object.defineProperty({__proto__:null,Animate:We,Bounce:Af,Clamp:If,ClampZoom:Mf,Decelerate:Nf,Drag:xs,Follow:Df,InputManager:Uf,MouseEdges:Ff,Pinch:yr,Plugin:fe,PluginManager:kf,Snap:Lf,SnapZoom:Bf,Viewport:Wa,Wheel:Gf},Symbol.toStringTag,{value:"Module"}));zt.FlowRunTimeline=Xx,zt.formatDateFnsDefault=$a,zt.hasStartAndEndDates=Ka,zt.nodeThemeFnDefault=Ja,Object.defineProperty(zt,Symbol.toStringTag,{value:"Module"})});
|
|
1062
1062
|
//# sourceMappingURL=graphs.umd.js.map
|