@prefecthq/graphs 2.2.12 → 2.2.13

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.
@@ -1156,7 +1156,7 @@ void main(void)\r
1156
1156
  font-weight: ${e.weight};
1157
1157
  font-style: ${e.style};
1158
1158
  font-display: ${e.display};
1159
- }`,this._stylesheet)}get stylesheet(){return this._stylesheet}set stylesheet(t){this._stylesheet!==t&&(this._stylesheet=t,this.styleID++)}normalizeColor(t){return Array.isArray(t)&&(t=J1(t)),typeof t=="number"?j1(t):t}dropShadowToCSS(){let t=this.normalizeColor(this.dropShadowColor);const e=this.dropShadowAlpha,i=Math.round(Math.cos(this.dropShadowAngle)*this.dropShadowDistance),s=Math.round(Math.sin(this.dropShadowAngle)*this.dropShadowDistance);t.startsWith("#")&&e<1&&(t+=(e*255|0).toString(16).padStart(2,"0"));const n=`${i}px ${s}px`;return this.dropShadowBlur>0?`text-shadow: ${n} ${this.dropShadowBlur}px ${t}`:`text-shadow: ${n} ${t}`}reset(){Object.assign(this,Vn.defaultOptions)}onBeforeDraw(){const{fontsDirty:t}=this;return this.fontsDirty=!1,this.isSafari&&this._fonts.length>0&&t?new Promise(e=>setTimeout(e,100)):Promise.resolve()}get isSafari(){const{userAgent:t}=rt.ADAPTER.getNavigator();return/^((?!chrome|android).)*safari/i.test(t)}set fillGradientStops(t){console.warn("[HTMLTextStyle] fillGradientStops is not supported by HTMLText")}get fillGradientStops(){return super.fillGradientStops}set fillGradientType(t){console.warn("[HTMLTextStyle] fillGradientType is not supported by HTMLText")}get fillGradientType(){return super.fillGradientType}set miterLimit(t){console.warn("[HTMLTextStyle] miterLimit is not supported by HTMLText")}get miterLimit(){return super.miterLimit}set trim(t){console.warn("[HTMLTextStyle] trim is not supported by HTMLText")}get trim(){return super.trim}set textBaseline(t){console.warn("[HTMLTextStyle] textBaseline is not supported by HTMLText")}get textBaseline(){return super.textBaseline}set leading(t){console.warn("[HTMLTextStyle] leading is not supported by HTMLText")}get leading(){return super.leading}set lineJoin(t){console.warn("[HTMLTextStyle] lineJoin is not supported by HTMLText")}get lineJoin(){return super.lineJoin}};gu.availableFonts={},gu.defaultOptions={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,padding:0,stroke:"black",strokeThickness:0,whiteSpace:"normal",wordWrap:!1,wordWrapWidth:100};let yu=gu;const uh=class Hn extends $t{constructor(t="",e={}){super(nt.EMPTY),this._text=null,this._style=null,this._autoResolution=!0,this.localStyleID=-1,this.dirty=!1,this._updateID=0,this.ownsStyle=!1;const i=new Image,s=nt.from(i,{scaleMode:rt.SCALE_MODE,resourceOptions:{autoLoad:!1}});s.orig=new mt,s.trim=new mt,this.texture=s;const n="http://www.w3.org/2000/svg",o="http://www.w3.org/1999/xhtml",a=document.createElementNS(n,"svg"),h=document.createElementNS(n,"foreignObject"),l=document.createElementNS(o,"div"),c=document.createElementNS(o,"style");h.setAttribute("width","10000"),h.setAttribute("height","10000"),h.style.overflow="hidden",a.appendChild(h),this.maxWidth=Hn.defaultMaxWidth,this.maxHeight=Hn.defaultMaxHeight,this._domElement=l,this._styleElement=c,this._svgRoot=a,this._foreignObject=h,this._foreignObject.appendChild(c),this._foreignObject.appendChild(l),this._image=i,this._loadImage=new Image,this._autoResolution=Hn.defaultAutoResolution,this._resolution=Hn.defaultResolution??rt.RESOLUTION,this.text=t,this.style=e}measureText(t){var c,u;const{text:e,style:i,resolution:s}=Object.assign({text:this._text,style:this._style,resolution:this._resolution},t);Object.assign(this._domElement,{innerHTML:e,style:i.toCSS(s)}),this._styleElement.textContent=i.toGlobalCSS(),document.body.appendChild(this._svgRoot);const n=this._domElement.getBoundingClientRect();this._svgRoot.remove();const{width:o,height:a}=n;(o>this.maxWidth||a>this.maxHeight)&&console.warn("[HTMLText] Large expanse of text, increase HTMLText.maxWidth or HTMLText.maxHeight property.");const h=Math.min(this.maxWidth,Math.ceil(o)),l=Math.min(this.maxHeight,Math.ceil(a));return this._svgRoot.setAttribute("width",h.toString()),this._svgRoot.setAttribute("height",l.toString()),e!==this._text&&(this._domElement.innerHTML=this._text),i!==this._style&&(Object.assign(this._domElement,{style:(c=this._style)==null?void 0:c.toCSS(s)}),this._styleElement.textContent=(u=this._style)==null?void 0:u.toGlobalCSS()),{width:h+i.padding*2,height:l+i.padding*2}}async updateText(t=!0){const{style:e,_image:i,_loadImage:s}=this;if(this.localStyleID!==e.styleID&&(this.dirty=!0,this.localStyleID=e.styleID),!this.dirty&&t)return;const{width:n,height:o}=this.measureText();i.width=s.width=Math.ceil(Math.max(1,n)),i.height=s.height=Math.ceil(Math.max(1,o)),this._updateID++;const a=this._updateID;await new Promise(h=>{s.onload=async()=>{if(a<this._updateID){h();return}await e.onBeforeDraw(),i.src=s.src,s.onload=null,s.src="",this.updateTexture(),h()};const l=new XMLSerializer().serializeToString(this._svgRoot);s.src=`data:image/svg+xml;charset=utf8,${encodeURIComponent(l)}`})}get source(){return this._image}updateTexture(){const{style:t,texture:e,_image:i,resolution:s}=this,{padding:n}=t,{baseTexture:o}=e;e.trim.width=e._frame.width=i.width/s,e.trim.height=e._frame.height=i.height/s,e.trim.x=-n,e.trim.y=-n,e.orig.width=e._frame.width-n*2,e.orig.height=e._frame.height-n*2,this._onTextureUpdate(),o.setRealSize(i.width,i.height,s),this.dirty=!1}_render(t){this._autoResolution&&this._resolution!==t.resolution&&(this._resolution=t.resolution,this.dirty=!0),this.updateText(!0),super._render(t)}_renderCanvas(t){this._autoResolution&&this._resolution!==t.resolution&&(this._resolution=t.resolution,this.dirty=!0),this.updateText(!0),super._renderCanvas(t)}getLocalBounds(t){return this.updateText(!0),super.getLocalBounds(t)}_calculateBounds(){this.updateText(!0),this.calculateVertices(),this._bounds.addQuad(this.vertexData)}_onStyleChange(){this.dirty=!0}destroy(t){var i,s,n,o,a;typeof t=="boolean"&&(t={children:t}),t=Object.assign({},Hn.defaultDestroyOptions,t),super.destroy(t);const e=null;this.ownsStyle&&((i=this._style)==null||i.cleanFonts()),this._style=e,(s=this._svgRoot)==null||s.remove(),this._svgRoot=e,(n=this._domElement)==null||n.remove(),this._domElement=e,(o=this._foreignObject)==null||o.remove(),this._foreignObject=e,(a=this._styleElement)==null||a.remove(),this._styleElement=e,this._loadImage.src="",this._loadImage.onload=null,this._loadImage=e,this._image.src="",this._image=e}get width(){return this.updateText(!0),Math.abs(this.scale.x)*this._image.width/this.resolution}set width(t){this.updateText(!0);const e=Sr(this.scale.x)||1;this.scale.x=e*t/this._image.width/this.resolution,this._width=t}get height(){return this.updateText(!0),Math.abs(this.scale.y)*this._image.height/this.resolution}set height(t){this.updateText(!0);const e=Sr(this.scale.y)||1;this.scale.y=e*t/this._image.height/this.resolution,this._height=t}get style(){return this._style}set style(t){this._style!==t&&(t=t||{},t instanceof yu?(this.ownsStyle=!1,this._style=t):t instanceof Pr?(console.warn("[HTMLText] Cloning TextStyle, if this is not what you want, use HTMLTextStyle"),this.ownsStyle=!0,this._style=yu.from(t)):(this.ownsStyle=!0,this._style=new yu(t)),this.localStyleID=-1,this.dirty=!0)}get text(){return this._text}set text(t){t=String(t===""||t===null||t===void 0?" ":t),t=this.sanitiseText(t),this._text!==t&&(this._text=t,this.dirty=!0)}get resolution(){return this._resolution}set resolution(t){this._autoResolution=!1,this._resolution!==t&&(this._resolution=t,this.dirty=!0)}sanitiseText(t){return t.replace(/<br>/gi,"<br/>").replace(/<hr>/gi,"<hr/>").replace(/&nbsp;/gi,"&#160;")}};uh.defaultDestroyOptions={texture:!0,children:!1,baseTexture:!0},uh.defaultMaxWidth=2024,uh.defaultMaxHeight=2024,uh.defaultAutoResolution=!0;function hE(){const r=new Map;function t(o,a){const h=r.get(o);return h?h.add(a):r.set(o,new Set([a])),()=>i(o,a)}function e(o,a){const h=l=>{i(o,h),a(l)};t(o,h)}function i(o,a){var h;(h=r.get(o))==null||h.delete(a)}function s(o,a){var h;(h=r.get(o))==null||h.forEach(l=>l(a))}function n(){r.clear()}return{on:t,off:i,once:e,emit:s,clear:n}}const q=hE();function Ie(r){let t;return new Promise(e=>{t=e,q.on(r,t)}).then(e=>(q.off(r,t),e))}let Pi=null;const Hg=new ResizeObserver(()=>{Pi&&q.emit("stageUpdated",Pi)});function lE(r){Pi=r,Hg.observe(Pi),q.emit("stageCreated",Pi)}function cE(){Pi&&Hg.unobserve(Pi),Pi=null}async function bu(){return Pi||await Ie("stageCreated")}let ke=null;async function uE(){const r=await bu();fE(r),q.on("stageUpdated",pE)}function dE(){ke&&(ke.destroy(!0,{children:!0}),ke=null)}function fE(r){ke=new sg({backgroundAlpha:0,resizeTo:r,antialias:!0,resolution:window.devicePixelRatio}),ke.stage.sortableChildren=!0,r.appendChild(ke.view),q.emit("applicationCreated",ke),process.env.NODE_ENV==="development"&&(globalThis.__PIXI_APP__=ke)}async function Qt(){return ke||await Ie("applicationCreated")}function pE(r){ke&&(ke.resizeTo=r,q.emit("applicationResized",ke))}var dh={exports:{}};dh.exports,function(r,t){var e=200,i="__lodash_hash_undefined__",s=800,n=16,o=9007199254740991,a="[object Arguments]",h="[object Array]",l="[object AsyncFunction]",c="[object Boolean]",u="[object Date]",d="[object Error]",f="[object Function]",p="[object GeneratorFunction]",m="[object Map]",g="[object Number]",y="[object Null]",x="[object Object]",b="[object Proxy]",v="[object RegExp]",w="[object Set]",S="[object String]",C="[object Undefined]",I="[object WeakMap]",R="[object ArrayBuffer]",P="[object DataView]",G="[object Float32Array]",N="[object Float64Array]",A="[object Int8Array]",k="[object Int16Array]",V="[object Int32Array]",K="[object Uint8Array]",H="[object Uint8ClampedArray]",$="[object Uint16Array]",U="[object Uint32Array]",D=/[\\^$.*+?()[\]{}|]/g,F=/^\[object .+?Constructor\]$/,Z=/^(?:0|[1-9]\d*)$/,tt={};tt[G]=tt[N]=tt[A]=tt[k]=tt[V]=tt[K]=tt[H]=tt[$]=tt[U]=!0,tt[a]=tt[h]=tt[R]=tt[c]=tt[P]=tt[u]=tt[d]=tt[f]=tt[m]=tt[g]=tt[x]=tt[v]=tt[w]=tt[S]=tt[I]=!1;var ft=typeof ve=="object"&&ve&&ve.Object===Object&&ve,ot=typeof self=="object"&&self&&self.Object===Object&&self,Et=ft||ot||Function("return this")(),Mt=t&&!t.nodeType&&t,bt=Mt&&!0&&r&&!r.nodeType&&r,B=bt&&bt.exports===Mt,j=B&&ft.process,J=function(){try{var _=bt&&bt.require&&bt.require("util").types;return _||j&&j.binding&&j.binding("util")}catch{}}(),O=J&&J.isTypedArray;function gt(_,E,L){switch(L.length){case 0:return _.call(E);case 1:return _.call(E,L[0]);case 2:return _.call(E,L[0],L[1]);case 3:return _.call(E,L[0],L[1],L[2])}return _.apply(E,L)}function ut(_,E){for(var L=-1,X=Array(_);++L<_;)X[L]=E(L);return X}function It(_){return function(E){return _(E)}}function Dt(_,E){return _==null?void 0:_[E]}function Ee(_,E){return function(L){return _(E(L))}}var ri=Array.prototype,Xo=Function.prototype,Kr=Object.prototype,Fs=Et["__core-js_shared__"],Ns=Xo.toString,gi=Kr.hasOwnProperty,tl=function(){var _=/[^.]+$/.exec(Fs&&Fs.keys&&Fs.keys.IE_PROTO||"");return _?"Symbol(src)_1."+_:""}(),el=Kr.toString,Wd=Ns.call(Object),Gn=RegExp("^"+Ns.call(gi).replace(D,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Yr=B?Et.Buffer:void 0,Zo=Et.Symbol,Ze=Et.Uint8Array,Vo=Yr?Yr.allocUnsafe:void 0,Ho=Ee(Object.getPrototypeOf,Object),il=Object.create,rl=Kr.propertyIsEnumerable,Fn=ri.splice,Xi=Zo?Zo.toStringTag:void 0,Ds=function(){try{var _=qo(Object,"defineProperty");return _({},"",{}),_}catch{}}(),Xd=Yr?Yr.isBuffer:void 0,Zi=Math.max,sl=Date.now,nl=qo(Et,"Map"),ks=qo(Object,"create"),Ko=function(){function _(){}return function(E){if(!Ki(E))return{};if(il)return il(E);_.prototype=E;var L=new _;return _.prototype=void 0,L}}();function Ve(_){var E=-1,L=_==null?0:_.length;for(this.clear();++E<L;){var X=_[E];this.set(X[0],X[1])}}function Yo(){this.__data__=ks?ks(null):{},this.size=0}function zo(_){var E=this.has(_)&&delete this.__data__[_];return this.size-=E?1:0,E}function jo(_){var E=this.__data__;if(ks){var L=E[_];return L===i?void 0:L}return gi.call(E,_)?E[_]:void 0}function Os(_){var E=this.__data__;return ks?E[_]!==void 0:gi.call(E,_)}function Zd(_,E){var L=this.__data__;return this.size+=this.has(_)?0:1,L[_]=ks&&E===void 0?i:E,this}Ve.prototype.clear=Yo,Ve.prototype.delete=zo,Ve.prototype.get=jo,Ve.prototype.has=Os,Ve.prototype.set=Zd;function yi(_){var E=-1,L=_==null?0:_.length;for(this.clear();++E<L;){var X=_[E];this.set(X[0],X[1])}}function Vd(){this.__data__=[],this.size=0}function Hd(_){var E=this.__data__,L=Nn(E,_);if(L<0)return!1;var X=E.length-1;return L==X?E.pop():Fn.call(E,L,1),--this.size,!0}function Kd(_){var E=this.__data__,L=Nn(E,_);return L<0?void 0:E[L][1]}function ol(_){return Nn(this.__data__,_)>-1}function Jo(_,E){var L=this.__data__,X=Nn(L,_);return X<0?(++this.size,L.push([_,E])):L[X][1]=E,this}yi.prototype.clear=Vd,yi.prototype.delete=Hd,yi.prototype.get=Kd,yi.prototype.has=ol,yi.prototype.set=Jo;function Ne(_){var E=-1,L=_==null?0:_.length;for(this.clear();++E<L;){var X=_[E];this.set(X[0],X[1])}}function Yd(){this.size=0,this.__data__={hash:new Ve,map:new(nl||yi),string:new Ve}}function zd(_){var E=kn(this,_).delete(_);return this.size-=E?1:0,E}function jd(_){return kn(this,_).get(_)}function Jd(_){return kn(this,_).has(_)}function $d(_,E){var L=kn(this,_),X=L.size;return L.set(_,E),this.size+=L.size==X?0:1,this}Ne.prototype.clear=Yd,Ne.prototype.delete=zd,Ne.prototype.get=jd,Ne.prototype.has=Jd,Ne.prototype.set=$d;function xe(_){var E=this.__data__=new yi(_);this.size=E.size}function Qd(){this.__data__=new yi,this.size=0}function qd(_){var E=this.__data__,L=E.delete(_);return this.size=E.size,L}function tf(_){return this.__data__.get(_)}function ef(_){return this.__data__.has(_)}function rf(_,E){var L=this.__data__;if(L instanceof yi){var X=L.__data__;if(!nl||X.length<e-1)return X.push([_,E]),this.size=++L.size,this;L=this.__data__=new Ne(X)}return L.set(_,E),this.size=L.size,this}xe.prototype.clear=Qd,xe.prototype.delete=qd,xe.prototype.get=tf,xe.prototype.has=ef,xe.prototype.set=rf;function yr(_,E){var L=Un(_),X=!L&&bi(_),ct=!L&&!X&&pl(_),yt=!L&&!X&&!ct&&jr(_),_t=L||X||ct||yt,ht=_t?ut(_.length,String):[],vt=ht.length;for(var Ut in _)(E||gi.call(_,Ut))&&!(_t&&(Ut=="length"||ct&&(Ut=="offset"||Ut=="parent")||yt&&(Ut=="buffer"||Ut=="byteLength"||Ut=="byteOffset")||dl(Ut,vt)))&&ht.push(Ut);return ht}function $o(_,E,L){(L!==void 0&&!Bn(_[E],L)||L===void 0&&!(E in _))&&Qo(_,E,L)}function sf(_,E,L){var X=_[E];(!(gi.call(_,E)&&Bn(X,L))||L===void 0&&!(E in _))&&Qo(_,E,L)}function Nn(_,E){for(var L=_.length;L--;)if(Bn(_[L][0],E))return L;return-1}function Qo(_,E,L){E=="__proto__"&&Ds?Ds(_,E,{configurable:!0,enumerable:!0,value:L,writable:!0}):_[E]=L}var nf=ff();function br(_){return _==null?_===void 0?C:y:Xi&&Xi in Object(_)?pf(_):yf(_)}function al(_){return zr(_)&&br(_)==a}function of(_){if(!Ki(_)||On(_))return!1;var E=Us(_)?Gn:F;return E.test(_f(_))}function Vi(_){return zr(_)&&ml(_.length)&&!!tt[br(_)]}function af(_){if(!Ki(_))return gf(_);var E=xr(_),L=[];for(var X in _)X=="constructor"&&(E||!gi.call(_,X))||L.push(X);return L}function hl(_,E,L,X,ct){_!==E&&nf(E,function(yt,_t){if(ct||(ct=new xe),Ki(yt))hf(_,E,_t,L,hl,X,ct);else{var ht=X?X(ta(_,_t),yt,_t+"",_,E,ct):void 0;ht===void 0&&(ht=yt),$o(_,_t,ht)}},bl)}function hf(_,E,L,X,ct,yt,_t){var ht=ta(_,L),vt=ta(E,L),Ut=_t.get(vt);if(Ut){$o(_,L,Ut);return}var Lt=yt?yt(ht,vt,L+"",_,E,_t):void 0,de=Lt===void 0;if(de){var _e=Un(vt),si=!_e&&pl(vt),ni=!_e&&!si&&jr(vt);Lt=vt,_e||si||ni?Un(ht)?Lt=ht:Wn(ht)?Lt=Bs(ht):si?(de=!1,Lt=uf(vt,!0)):ni?(de=!1,Lt=df(vt,!0)):Lt=[]:gl(vt)||bi(vt)?(Lt=ht,bi(ht)?Lt=yl(ht):(!Ki(ht)||Us(ht))&&(Lt=ul(vt))):de=!1}de&&(_t.set(vt,Lt),ct(Lt,vt,X,yt,_t),_t.delete(vt)),$o(_,L,Lt)}function lf(_,E){return bf(Hi(_,E,T),_+"")}var cf=Ds?function(_,E){return Ds(_,"toString",{configurable:!0,enumerable:!1,value:wf(E),writable:!0})}:T;function uf(_,E){if(E)return _.slice();var L=_.length,X=Vo?Vo(L):new _.constructor(L);return _.copy(X),X}function Dn(_){var E=new _.constructor(_.byteLength);return new Ze(E).set(new Ze(_)),E}function df(_,E){var L=E?Dn(_.buffer):_.buffer;return new _.constructor(L,_.byteOffset,_.length)}function Bs(_,E){var L=-1,X=_.length;for(E||(E=Array(X));++L<X;)E[L]=_[L];return E}function ll(_,E,L,X){var ct=!L;L||(L={});for(var yt=-1,_t=E.length;++yt<_t;){var ht=E[yt],vt=X?X(L[ht],_[ht],ht,L,_):void 0;vt===void 0&&(vt=_[ht]),ct?Qo(L,ht,vt):sf(L,ht,vt)}return L}function cl(_){return lf(function(E,L){var X=-1,ct=L.length,yt=ct>1?L[ct-1]:void 0,_t=ct>2?L[2]:void 0;for(yt=_.length>3&&typeof yt=="function"?(ct--,yt):void 0,_t&&mf(L[0],L[1],_t)&&(yt=ct<3?void 0:yt,ct=1),E=Object(E);++X<ct;){var ht=L[X];ht&&_(E,ht,X,yt)}return E})}function ff(_){return function(E,L,X){for(var ct=-1,yt=Object(E),_t=X(E),ht=_t.length;ht--;){var vt=_t[_?ht:++ct];if(L(yt[vt],vt,yt)===!1)break}return E}}function kn(_,E){var L=_.__data__;return fl(E)?L[typeof E=="string"?"string":"hash"]:L.map}function qo(_,E){var L=Dt(_,E);return of(L)?L:void 0}function pf(_){var E=gi.call(_,Xi),L=_[Xi];try{_[Xi]=void 0;var X=!0}catch{}var ct=el.call(_);return X&&(E?_[Xi]=L:delete _[Xi]),ct}function ul(_){return typeof _.constructor=="function"&&!xr(_)?Ko(Ho(_)):{}}function dl(_,E){var L=typeof _;return E=E??o,!!E&&(L=="number"||L!="symbol"&&Z.test(_))&&_>-1&&_%1==0&&_<E}function mf(_,E,L){if(!Ki(L))return!1;var X=typeof E;return(X=="number"?ea(L)&&dl(E,L.length):X=="string"&&E in L)?Bn(L[E],_):!1}function fl(_){var E=typeof _;return E=="string"||E=="number"||E=="symbol"||E=="boolean"?_!=="__proto__":_===null}function On(_){return!!tl&&tl in _}function xr(_){var E=_&&_.constructor,L=typeof E=="function"&&E.prototype||Kr;return _===L}function gf(_){var E=[];if(_!=null)for(var L in Object(_))E.push(L);return E}function yf(_){return el.call(_)}function Hi(_,E,L){return E=Zi(E===void 0?_.length-1:E,0),function(){for(var X=arguments,ct=-1,yt=Zi(X.length-E,0),_t=Array(yt);++ct<yt;)_t[ct]=X[E+ct];ct=-1;for(var ht=Array(E+1);++ct<E;)ht[ct]=X[ct];return ht[E]=L(_t),gt(_,this,ht)}}function ta(_,E){if(!(E==="constructor"&&typeof _[E]=="function")&&E!="__proto__")return _[E]}var bf=xf(cf);function xf(_){var E=0,L=0;return function(){var X=sl(),ct=n-(X-L);if(L=X,ct>0){if(++E>=s)return arguments[0]}else E=0;return _.apply(void 0,arguments)}}function _f(_){if(_!=null){try{return Ns.call(_)}catch{}try{return _+""}catch{}}return""}function Bn(_,E){return _===E||_!==_&&E!==E}var bi=al(function(){return arguments}())?al:function(_){return zr(_)&&gi.call(_,"callee")&&!rl.call(_,"callee")},Un=Array.isArray;function ea(_){return _!=null&&ml(_.length)&&!Us(_)}function Wn(_){return zr(_)&&ea(_)}var pl=Xd||M;function Us(_){if(!Ki(_))return!1;var E=br(_);return E==f||E==p||E==l||E==b}function ml(_){return typeof _=="number"&&_>-1&&_%1==0&&_<=o}function Ki(_){var E=typeof _;return _!=null&&(E=="object"||E=="function")}function zr(_){return _!=null&&typeof _=="object"}function gl(_){if(!zr(_)||br(_)!=x)return!1;var E=Ho(_);if(E===null)return!0;var L=gi.call(E,"constructor")&&E.constructor;return typeof L=="function"&&L instanceof L&&Ns.call(L)==Wd}var jr=O?It(O):Vi;function yl(_){return ll(_,bl(_))}function bl(_){return ea(_)?yr(_,!0):af(_)}var vf=cl(function(_,E,L){hl(_,E,L)});function wf(_){return function(){return _}}function T(_){return _}function M(){return!1}r.exports=vf}(dh,dh.exports);var mE=dh.exports;const gE=Vs(mE);let ms=null;function yE(){ms=z.effectScope()}function bE(){ms==null||ms.stop(),ms=null}async function xE(){return ms||await Ie("scopeCreated")}let Fr=null;const Kg={animationDuration:500,disableAnimationsThreshold:500,disableEdgesThreshold:500,fetchEvents:()=>[],styles:{colorMode:"dark",rowGap:24,columnGap:32,textDefault:"#ffffff",textInverse:"#000000",selectedBorderColor:"#3fa2c3",selectedBorderWidth:2,selectedBorderOffset:4,selectedBorderRadius:9,nodesPadding:16,nodeHeight:32,nodePadding:4,nodeRadius:6,nodeBorderRadius:9,nodeToggleSize:28,nodeToggleBgColor:"#35363C",nodeToggleBorderRadius:6,nodeToggleBorderColor:"#51525C",nodeUnselectedAlpha:.2,artifactsGap:4,artifactsNodeOverlap:4,artifactPaddingLeft:2,artifactPaddingRight:4,artifactPaddingY:2,artifactTextColor:"#ffffff",artifactBgColor:"#35363b",artifactBorderRadius:4,artifactContentGap:4,artifactIconSize:16,artifactIconColor:"#ffffff",flowStateBarHeight:8,flowStateSelectedBarHeight:10,flowStateAreaAlpha:.1,eventTargetSize:30,eventBottomMargin:4,eventSelectedBorderInset:8,eventRadiusDefault:4,eventColor:"#A564F9",eventClusterRadiusDefault:6,eventClusterColor:"#A564F9",edgeColor:"#51525C",guideLineWidth:1,guideLineColor:"#51525C",guideTextTopPadding:8,guideTextLeftPadding:8,guideTextSize:12,guideTextColor:"#ADADAD",playheadWidth:2,playheadColor:"#6272FF",node:()=>({background:"#ffffff"}),state:()=>({background:"#ffffff"})}};function _E(r){const t=gE({},Kg,r);return t.styles.node=e=>{var i,s;return{...Kg.styles.node(e),...(s=(i=r.styles)==null?void 0:i.node)==null?void 0:s.call(i,e)}},t}async function vE(r){(await xE()).run(()=>{z.watch(()=>r.config,e=>{const i=_E(e);if(!Fr){Fr=i,q.emit("configCreated",Fr);return}Object.assign(Fr,i),q.emit("configUpdated",Fr)},{immediate:!0})})}function wE(){Fr=null}async function Pt(){return Fr||await Ie("configCreated")}async function Yg(r,t){const e=await Pt();let i,s=null;async function n(){try{s=await e.fetch(r),t(s)}catch(a){console.error(a)}s&&!s.end_time&&(i=setTimeout(()=>n(),zg(s)))}function o(){clearInterval(i)}return{start:n,stop:o}}function zg(r){const t=Math.floor(r.nodes.size/aa)*aa;return Math.max(aa,t)}function nr(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function jg(r,t){r.prototype=Object.create(t.prototype),r.prototype.constructor=r,r.__proto__=t}/*!
1159
+ }`,this._stylesheet)}get stylesheet(){return this._stylesheet}set stylesheet(t){this._stylesheet!==t&&(this._stylesheet=t,this.styleID++)}normalizeColor(t){return Array.isArray(t)&&(t=J1(t)),typeof t=="number"?j1(t):t}dropShadowToCSS(){let t=this.normalizeColor(this.dropShadowColor);const e=this.dropShadowAlpha,i=Math.round(Math.cos(this.dropShadowAngle)*this.dropShadowDistance),s=Math.round(Math.sin(this.dropShadowAngle)*this.dropShadowDistance);t.startsWith("#")&&e<1&&(t+=(e*255|0).toString(16).padStart(2,"0"));const n=`${i}px ${s}px`;return this.dropShadowBlur>0?`text-shadow: ${n} ${this.dropShadowBlur}px ${t}`:`text-shadow: ${n} ${t}`}reset(){Object.assign(this,Vn.defaultOptions)}onBeforeDraw(){const{fontsDirty:t}=this;return this.fontsDirty=!1,this.isSafari&&this._fonts.length>0&&t?new Promise(e=>setTimeout(e,100)):Promise.resolve()}get isSafari(){const{userAgent:t}=rt.ADAPTER.getNavigator();return/^((?!chrome|android).)*safari/i.test(t)}set fillGradientStops(t){console.warn("[HTMLTextStyle] fillGradientStops is not supported by HTMLText")}get fillGradientStops(){return super.fillGradientStops}set fillGradientType(t){console.warn("[HTMLTextStyle] fillGradientType is not supported by HTMLText")}get fillGradientType(){return super.fillGradientType}set miterLimit(t){console.warn("[HTMLTextStyle] miterLimit is not supported by HTMLText")}get miterLimit(){return super.miterLimit}set trim(t){console.warn("[HTMLTextStyle] trim is not supported by HTMLText")}get trim(){return super.trim}set textBaseline(t){console.warn("[HTMLTextStyle] textBaseline is not supported by HTMLText")}get textBaseline(){return super.textBaseline}set leading(t){console.warn("[HTMLTextStyle] leading is not supported by HTMLText")}get leading(){return super.leading}set lineJoin(t){console.warn("[HTMLTextStyle] lineJoin is not supported by HTMLText")}get lineJoin(){return super.lineJoin}};gu.availableFonts={},gu.defaultOptions={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,padding:0,stroke:"black",strokeThickness:0,whiteSpace:"normal",wordWrap:!1,wordWrapWidth:100};let yu=gu;const uh=class Hn extends $t{constructor(t="",e={}){super(nt.EMPTY),this._text=null,this._style=null,this._autoResolution=!0,this.localStyleID=-1,this.dirty=!1,this._updateID=0,this.ownsStyle=!1;const i=new Image,s=nt.from(i,{scaleMode:rt.SCALE_MODE,resourceOptions:{autoLoad:!1}});s.orig=new mt,s.trim=new mt,this.texture=s;const n="http://www.w3.org/2000/svg",o="http://www.w3.org/1999/xhtml",a=document.createElementNS(n,"svg"),h=document.createElementNS(n,"foreignObject"),l=document.createElementNS(o,"div"),c=document.createElementNS(o,"style");h.setAttribute("width","10000"),h.setAttribute("height","10000"),h.style.overflow="hidden",a.appendChild(h),this.maxWidth=Hn.defaultMaxWidth,this.maxHeight=Hn.defaultMaxHeight,this._domElement=l,this._styleElement=c,this._svgRoot=a,this._foreignObject=h,this._foreignObject.appendChild(c),this._foreignObject.appendChild(l),this._image=i,this._loadImage=new Image,this._autoResolution=Hn.defaultAutoResolution,this._resolution=Hn.defaultResolution??rt.RESOLUTION,this.text=t,this.style=e}measureText(t){var c,u;const{text:e,style:i,resolution:s}=Object.assign({text:this._text,style:this._style,resolution:this._resolution},t);Object.assign(this._domElement,{innerHTML:e,style:i.toCSS(s)}),this._styleElement.textContent=i.toGlobalCSS(),document.body.appendChild(this._svgRoot);const n=this._domElement.getBoundingClientRect();this._svgRoot.remove();const{width:o,height:a}=n;(o>this.maxWidth||a>this.maxHeight)&&console.warn("[HTMLText] Large expanse of text, increase HTMLText.maxWidth or HTMLText.maxHeight property.");const h=Math.min(this.maxWidth,Math.ceil(o)),l=Math.min(this.maxHeight,Math.ceil(a));return this._svgRoot.setAttribute("width",h.toString()),this._svgRoot.setAttribute("height",l.toString()),e!==this._text&&(this._domElement.innerHTML=this._text),i!==this._style&&(Object.assign(this._domElement,{style:(c=this._style)==null?void 0:c.toCSS(s)}),this._styleElement.textContent=(u=this._style)==null?void 0:u.toGlobalCSS()),{width:h+i.padding*2,height:l+i.padding*2}}async updateText(t=!0){const{style:e,_image:i,_loadImage:s}=this;if(this.localStyleID!==e.styleID&&(this.dirty=!0,this.localStyleID=e.styleID),!this.dirty&&t)return;const{width:n,height:o}=this.measureText();i.width=s.width=Math.ceil(Math.max(1,n)),i.height=s.height=Math.ceil(Math.max(1,o)),this._updateID++;const a=this._updateID;await new Promise(h=>{s.onload=async()=>{if(a<this._updateID){h();return}await e.onBeforeDraw(),i.src=s.src,s.onload=null,s.src="",this.updateTexture(),h()};const l=new XMLSerializer().serializeToString(this._svgRoot);s.src=`data:image/svg+xml;charset=utf8,${encodeURIComponent(l)}`})}get source(){return this._image}updateTexture(){const{style:t,texture:e,_image:i,resolution:s}=this,{padding:n}=t,{baseTexture:o}=e;e.trim.width=e._frame.width=i.width/s,e.trim.height=e._frame.height=i.height/s,e.trim.x=-n,e.trim.y=-n,e.orig.width=e._frame.width-n*2,e.orig.height=e._frame.height-n*2,this._onTextureUpdate(),o.setRealSize(i.width,i.height,s),this.dirty=!1}_render(t){this._autoResolution&&this._resolution!==t.resolution&&(this._resolution=t.resolution,this.dirty=!0),this.updateText(!0),super._render(t)}_renderCanvas(t){this._autoResolution&&this._resolution!==t.resolution&&(this._resolution=t.resolution,this.dirty=!0),this.updateText(!0),super._renderCanvas(t)}getLocalBounds(t){return this.updateText(!0),super.getLocalBounds(t)}_calculateBounds(){this.updateText(!0),this.calculateVertices(),this._bounds.addQuad(this.vertexData)}_onStyleChange(){this.dirty=!0}destroy(t){var i,s,n,o,a;typeof t=="boolean"&&(t={children:t}),t=Object.assign({},Hn.defaultDestroyOptions,t),super.destroy(t);const e=null;this.ownsStyle&&((i=this._style)==null||i.cleanFonts()),this._style=e,(s=this._svgRoot)==null||s.remove(),this._svgRoot=e,(n=this._domElement)==null||n.remove(),this._domElement=e,(o=this._foreignObject)==null||o.remove(),this._foreignObject=e,(a=this._styleElement)==null||a.remove(),this._styleElement=e,this._loadImage.src="",this._loadImage.onload=null,this._loadImage=e,this._image.src="",this._image=e}get width(){return this.updateText(!0),Math.abs(this.scale.x)*this._image.width/this.resolution}set width(t){this.updateText(!0);const e=Sr(this.scale.x)||1;this.scale.x=e*t/this._image.width/this.resolution,this._width=t}get height(){return this.updateText(!0),Math.abs(this.scale.y)*this._image.height/this.resolution}set height(t){this.updateText(!0);const e=Sr(this.scale.y)||1;this.scale.y=e*t/this._image.height/this.resolution,this._height=t}get style(){return this._style}set style(t){this._style!==t&&(t=t||{},t instanceof yu?(this.ownsStyle=!1,this._style=t):t instanceof Pr?(console.warn("[HTMLText] Cloning TextStyle, if this is not what you want, use HTMLTextStyle"),this.ownsStyle=!0,this._style=yu.from(t)):(this.ownsStyle=!0,this._style=new yu(t)),this.localStyleID=-1,this.dirty=!0)}get text(){return this._text}set text(t){t=String(t===""||t===null||t===void 0?" ":t),t=this.sanitiseText(t),this._text!==t&&(this._text=t,this.dirty=!0)}get resolution(){return this._resolution}set resolution(t){this._autoResolution=!1,this._resolution!==t&&(this._resolution=t,this.dirty=!0)}sanitiseText(t){return t.replace(/<br>/gi,"<br/>").replace(/<hr>/gi,"<hr/>").replace(/&nbsp;/gi,"&#160;")}};uh.defaultDestroyOptions={texture:!0,children:!1,baseTexture:!0},uh.defaultMaxWidth=2024,uh.defaultMaxHeight=2024,uh.defaultAutoResolution=!0;function hE(){const r=new Map;function t(o,a){const h=r.get(o);return h?h.add(a):r.set(o,new Set([a])),()=>i(o,a)}function e(o,a){const h=l=>{i(o,h),a(l)};t(o,h)}function i(o,a){var h;(h=r.get(o))==null||h.delete(a)}function s(o,a){var h;(h=r.get(o))==null||h.forEach(l=>l(a))}function n(){r.clear()}return{on:t,off:i,once:e,emit:s,clear:n}}const q=hE();function Ie(r){let t;return new Promise(e=>{t=e,q.on(r,t)}).then(e=>(q.off(r,t),e))}let Pi=null;const Hg=new ResizeObserver(()=>{Pi&&q.emit("stageUpdated",Pi)});function lE(r){Pi=r,Hg.observe(Pi),q.emit("stageCreated",Pi)}function cE(){Pi&&Hg.unobserve(Pi),Pi=null}async function bu(){return Pi||await Ie("stageCreated")}let ke=null;async function uE(){const r=await bu();fE(r),q.on("stageUpdated",pE)}function dE(){ke&&(ke.destroy(!0,{children:!0}),ke=null)}function fE(r){ke=new sg({backgroundAlpha:0,resizeTo:r,antialias:!0,resolution:Math.ceil(window.devicePixelRatio)}),ke.stage.sortableChildren=!0,r.appendChild(ke.view),q.emit("applicationCreated",ke),process.env.NODE_ENV==="development"&&(globalThis.__PIXI_APP__=ke)}async function Qt(){return ke||await Ie("applicationCreated")}function pE(r){ke&&(ke.resizeTo=r,q.emit("applicationResized",ke))}var dh={exports:{}};dh.exports,function(r,t){var e=200,i="__lodash_hash_undefined__",s=800,n=16,o=9007199254740991,a="[object Arguments]",h="[object Array]",l="[object AsyncFunction]",c="[object Boolean]",u="[object Date]",d="[object Error]",f="[object Function]",p="[object GeneratorFunction]",m="[object Map]",g="[object Number]",y="[object Null]",x="[object Object]",b="[object Proxy]",v="[object RegExp]",w="[object Set]",S="[object String]",C="[object Undefined]",I="[object WeakMap]",R="[object ArrayBuffer]",P="[object DataView]",G="[object Float32Array]",N="[object Float64Array]",A="[object Int8Array]",k="[object Int16Array]",V="[object Int32Array]",K="[object Uint8Array]",H="[object Uint8ClampedArray]",$="[object Uint16Array]",U="[object Uint32Array]",D=/[\\^$.*+?()[\]{}|]/g,F=/^\[object .+?Constructor\]$/,Z=/^(?:0|[1-9]\d*)$/,tt={};tt[G]=tt[N]=tt[A]=tt[k]=tt[V]=tt[K]=tt[H]=tt[$]=tt[U]=!0,tt[a]=tt[h]=tt[R]=tt[c]=tt[P]=tt[u]=tt[d]=tt[f]=tt[m]=tt[g]=tt[x]=tt[v]=tt[w]=tt[S]=tt[I]=!1;var ft=typeof ve=="object"&&ve&&ve.Object===Object&&ve,ot=typeof self=="object"&&self&&self.Object===Object&&self,Et=ft||ot||Function("return this")(),Mt=t&&!t.nodeType&&t,bt=Mt&&!0&&r&&!r.nodeType&&r,B=bt&&bt.exports===Mt,j=B&&ft.process,J=function(){try{var _=bt&&bt.require&&bt.require("util").types;return _||j&&j.binding&&j.binding("util")}catch{}}(),O=J&&J.isTypedArray;function gt(_,E,L){switch(L.length){case 0:return _.call(E);case 1:return _.call(E,L[0]);case 2:return _.call(E,L[0],L[1]);case 3:return _.call(E,L[0],L[1],L[2])}return _.apply(E,L)}function ut(_,E){for(var L=-1,X=Array(_);++L<_;)X[L]=E(L);return X}function It(_){return function(E){return _(E)}}function Dt(_,E){return _==null?void 0:_[E]}function Ee(_,E){return function(L){return _(E(L))}}var ri=Array.prototype,Xo=Function.prototype,Kr=Object.prototype,Fs=Et["__core-js_shared__"],Ns=Xo.toString,gi=Kr.hasOwnProperty,tl=function(){var _=/[^.]+$/.exec(Fs&&Fs.keys&&Fs.keys.IE_PROTO||"");return _?"Symbol(src)_1."+_:""}(),el=Kr.toString,Wd=Ns.call(Object),Gn=RegExp("^"+Ns.call(gi).replace(D,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Yr=B?Et.Buffer:void 0,Zo=Et.Symbol,Ze=Et.Uint8Array,Vo=Yr?Yr.allocUnsafe:void 0,Ho=Ee(Object.getPrototypeOf,Object),il=Object.create,rl=Kr.propertyIsEnumerable,Fn=ri.splice,Xi=Zo?Zo.toStringTag:void 0,Ds=function(){try{var _=qo(Object,"defineProperty");return _({},"",{}),_}catch{}}(),Xd=Yr?Yr.isBuffer:void 0,Zi=Math.max,sl=Date.now,nl=qo(Et,"Map"),ks=qo(Object,"create"),Ko=function(){function _(){}return function(E){if(!Ki(E))return{};if(il)return il(E);_.prototype=E;var L=new _;return _.prototype=void 0,L}}();function Ve(_){var E=-1,L=_==null?0:_.length;for(this.clear();++E<L;){var X=_[E];this.set(X[0],X[1])}}function Yo(){this.__data__=ks?ks(null):{},this.size=0}function zo(_){var E=this.has(_)&&delete this.__data__[_];return this.size-=E?1:0,E}function jo(_){var E=this.__data__;if(ks){var L=E[_];return L===i?void 0:L}return gi.call(E,_)?E[_]:void 0}function Os(_){var E=this.__data__;return ks?E[_]!==void 0:gi.call(E,_)}function Zd(_,E){var L=this.__data__;return this.size+=this.has(_)?0:1,L[_]=ks&&E===void 0?i:E,this}Ve.prototype.clear=Yo,Ve.prototype.delete=zo,Ve.prototype.get=jo,Ve.prototype.has=Os,Ve.prototype.set=Zd;function yi(_){var E=-1,L=_==null?0:_.length;for(this.clear();++E<L;){var X=_[E];this.set(X[0],X[1])}}function Vd(){this.__data__=[],this.size=0}function Hd(_){var E=this.__data__,L=Nn(E,_);if(L<0)return!1;var X=E.length-1;return L==X?E.pop():Fn.call(E,L,1),--this.size,!0}function Kd(_){var E=this.__data__,L=Nn(E,_);return L<0?void 0:E[L][1]}function ol(_){return Nn(this.__data__,_)>-1}function Jo(_,E){var L=this.__data__,X=Nn(L,_);return X<0?(++this.size,L.push([_,E])):L[X][1]=E,this}yi.prototype.clear=Vd,yi.prototype.delete=Hd,yi.prototype.get=Kd,yi.prototype.has=ol,yi.prototype.set=Jo;function Ne(_){var E=-1,L=_==null?0:_.length;for(this.clear();++E<L;){var X=_[E];this.set(X[0],X[1])}}function Yd(){this.size=0,this.__data__={hash:new Ve,map:new(nl||yi),string:new Ve}}function zd(_){var E=kn(this,_).delete(_);return this.size-=E?1:0,E}function jd(_){return kn(this,_).get(_)}function Jd(_){return kn(this,_).has(_)}function $d(_,E){var L=kn(this,_),X=L.size;return L.set(_,E),this.size+=L.size==X?0:1,this}Ne.prototype.clear=Yd,Ne.prototype.delete=zd,Ne.prototype.get=jd,Ne.prototype.has=Jd,Ne.prototype.set=$d;function xe(_){var E=this.__data__=new yi(_);this.size=E.size}function Qd(){this.__data__=new yi,this.size=0}function qd(_){var E=this.__data__,L=E.delete(_);return this.size=E.size,L}function tf(_){return this.__data__.get(_)}function ef(_){return this.__data__.has(_)}function rf(_,E){var L=this.__data__;if(L instanceof yi){var X=L.__data__;if(!nl||X.length<e-1)return X.push([_,E]),this.size=++L.size,this;L=this.__data__=new Ne(X)}return L.set(_,E),this.size=L.size,this}xe.prototype.clear=Qd,xe.prototype.delete=qd,xe.prototype.get=tf,xe.prototype.has=ef,xe.prototype.set=rf;function yr(_,E){var L=Un(_),X=!L&&bi(_),ct=!L&&!X&&pl(_),yt=!L&&!X&&!ct&&jr(_),_t=L||X||ct||yt,ht=_t?ut(_.length,String):[],vt=ht.length;for(var Ut in _)(E||gi.call(_,Ut))&&!(_t&&(Ut=="length"||ct&&(Ut=="offset"||Ut=="parent")||yt&&(Ut=="buffer"||Ut=="byteLength"||Ut=="byteOffset")||dl(Ut,vt)))&&ht.push(Ut);return ht}function $o(_,E,L){(L!==void 0&&!Bn(_[E],L)||L===void 0&&!(E in _))&&Qo(_,E,L)}function sf(_,E,L){var X=_[E];(!(gi.call(_,E)&&Bn(X,L))||L===void 0&&!(E in _))&&Qo(_,E,L)}function Nn(_,E){for(var L=_.length;L--;)if(Bn(_[L][0],E))return L;return-1}function Qo(_,E,L){E=="__proto__"&&Ds?Ds(_,E,{configurable:!0,enumerable:!0,value:L,writable:!0}):_[E]=L}var nf=ff();function br(_){return _==null?_===void 0?C:y:Xi&&Xi in Object(_)?pf(_):yf(_)}function al(_){return zr(_)&&br(_)==a}function of(_){if(!Ki(_)||On(_))return!1;var E=Us(_)?Gn:F;return E.test(_f(_))}function Vi(_){return zr(_)&&ml(_.length)&&!!tt[br(_)]}function af(_){if(!Ki(_))return gf(_);var E=xr(_),L=[];for(var X in _)X=="constructor"&&(E||!gi.call(_,X))||L.push(X);return L}function hl(_,E,L,X,ct){_!==E&&nf(E,function(yt,_t){if(ct||(ct=new xe),Ki(yt))hf(_,E,_t,L,hl,X,ct);else{var ht=X?X(ta(_,_t),yt,_t+"",_,E,ct):void 0;ht===void 0&&(ht=yt),$o(_,_t,ht)}},bl)}function hf(_,E,L,X,ct,yt,_t){var ht=ta(_,L),vt=ta(E,L),Ut=_t.get(vt);if(Ut){$o(_,L,Ut);return}var Lt=yt?yt(ht,vt,L+"",_,E,_t):void 0,de=Lt===void 0;if(de){var _e=Un(vt),si=!_e&&pl(vt),ni=!_e&&!si&&jr(vt);Lt=vt,_e||si||ni?Un(ht)?Lt=ht:Wn(ht)?Lt=Bs(ht):si?(de=!1,Lt=uf(vt,!0)):ni?(de=!1,Lt=df(vt,!0)):Lt=[]:gl(vt)||bi(vt)?(Lt=ht,bi(ht)?Lt=yl(ht):(!Ki(ht)||Us(ht))&&(Lt=ul(vt))):de=!1}de&&(_t.set(vt,Lt),ct(Lt,vt,X,yt,_t),_t.delete(vt)),$o(_,L,Lt)}function lf(_,E){return bf(Hi(_,E,T),_+"")}var cf=Ds?function(_,E){return Ds(_,"toString",{configurable:!0,enumerable:!1,value:wf(E),writable:!0})}:T;function uf(_,E){if(E)return _.slice();var L=_.length,X=Vo?Vo(L):new _.constructor(L);return _.copy(X),X}function Dn(_){var E=new _.constructor(_.byteLength);return new Ze(E).set(new Ze(_)),E}function df(_,E){var L=E?Dn(_.buffer):_.buffer;return new _.constructor(L,_.byteOffset,_.length)}function Bs(_,E){var L=-1,X=_.length;for(E||(E=Array(X));++L<X;)E[L]=_[L];return E}function ll(_,E,L,X){var ct=!L;L||(L={});for(var yt=-1,_t=E.length;++yt<_t;){var ht=E[yt],vt=X?X(L[ht],_[ht],ht,L,_):void 0;vt===void 0&&(vt=_[ht]),ct?Qo(L,ht,vt):sf(L,ht,vt)}return L}function cl(_){return lf(function(E,L){var X=-1,ct=L.length,yt=ct>1?L[ct-1]:void 0,_t=ct>2?L[2]:void 0;for(yt=_.length>3&&typeof yt=="function"?(ct--,yt):void 0,_t&&mf(L[0],L[1],_t)&&(yt=ct<3?void 0:yt,ct=1),E=Object(E);++X<ct;){var ht=L[X];ht&&_(E,ht,X,yt)}return E})}function ff(_){return function(E,L,X){for(var ct=-1,yt=Object(E),_t=X(E),ht=_t.length;ht--;){var vt=_t[_?ht:++ct];if(L(yt[vt],vt,yt)===!1)break}return E}}function kn(_,E){var L=_.__data__;return fl(E)?L[typeof E=="string"?"string":"hash"]:L.map}function qo(_,E){var L=Dt(_,E);return of(L)?L:void 0}function pf(_){var E=gi.call(_,Xi),L=_[Xi];try{_[Xi]=void 0;var X=!0}catch{}var ct=el.call(_);return X&&(E?_[Xi]=L:delete _[Xi]),ct}function ul(_){return typeof _.constructor=="function"&&!xr(_)?Ko(Ho(_)):{}}function dl(_,E){var L=typeof _;return E=E??o,!!E&&(L=="number"||L!="symbol"&&Z.test(_))&&_>-1&&_%1==0&&_<E}function mf(_,E,L){if(!Ki(L))return!1;var X=typeof E;return(X=="number"?ea(L)&&dl(E,L.length):X=="string"&&E in L)?Bn(L[E],_):!1}function fl(_){var E=typeof _;return E=="string"||E=="number"||E=="symbol"||E=="boolean"?_!=="__proto__":_===null}function On(_){return!!tl&&tl in _}function xr(_){var E=_&&_.constructor,L=typeof E=="function"&&E.prototype||Kr;return _===L}function gf(_){var E=[];if(_!=null)for(var L in Object(_))E.push(L);return E}function yf(_){return el.call(_)}function Hi(_,E,L){return E=Zi(E===void 0?_.length-1:E,0),function(){for(var X=arguments,ct=-1,yt=Zi(X.length-E,0),_t=Array(yt);++ct<yt;)_t[ct]=X[E+ct];ct=-1;for(var ht=Array(E+1);++ct<E;)ht[ct]=X[ct];return ht[E]=L(_t),gt(_,this,ht)}}function ta(_,E){if(!(E==="constructor"&&typeof _[E]=="function")&&E!="__proto__")return _[E]}var bf=xf(cf);function xf(_){var E=0,L=0;return function(){var X=sl(),ct=n-(X-L);if(L=X,ct>0){if(++E>=s)return arguments[0]}else E=0;return _.apply(void 0,arguments)}}function _f(_){if(_!=null){try{return Ns.call(_)}catch{}try{return _+""}catch{}}return""}function Bn(_,E){return _===E||_!==_&&E!==E}var bi=al(function(){return arguments}())?al:function(_){return zr(_)&&gi.call(_,"callee")&&!rl.call(_,"callee")},Un=Array.isArray;function ea(_){return _!=null&&ml(_.length)&&!Us(_)}function Wn(_){return zr(_)&&ea(_)}var pl=Xd||M;function Us(_){if(!Ki(_))return!1;var E=br(_);return E==f||E==p||E==l||E==b}function ml(_){return typeof _=="number"&&_>-1&&_%1==0&&_<=o}function Ki(_){var E=typeof _;return _!=null&&(E=="object"||E=="function")}function zr(_){return _!=null&&typeof _=="object"}function gl(_){if(!zr(_)||br(_)!=x)return!1;var E=Ho(_);if(E===null)return!0;var L=gi.call(E,"constructor")&&E.constructor;return typeof L=="function"&&L instanceof L&&Ns.call(L)==Wd}var jr=O?It(O):Vi;function yl(_){return ll(_,bl(_))}function bl(_){return ea(_)?yr(_,!0):af(_)}var vf=cl(function(_,E,L){hl(_,E,L)});function wf(_){return function(){return _}}function T(_){return _}function M(){return!1}r.exports=vf}(dh,dh.exports);var mE=dh.exports;const gE=Vs(mE);let ms=null;function yE(){ms=z.effectScope()}function bE(){ms==null||ms.stop(),ms=null}async function xE(){return ms||await Ie("scopeCreated")}let Fr=null;const Kg={animationDuration:500,disableAnimationsThreshold:500,disableEdgesThreshold:500,fetchEvents:()=>[],styles:{colorMode:"dark",rowGap:24,columnGap:32,textDefault:"#ffffff",textInverse:"#000000",selectedBorderColor:"#3fa2c3",selectedBorderWidth:2,selectedBorderOffset:4,selectedBorderRadius:9,nodesPadding:16,nodeHeight:32,nodePadding:4,nodeRadius:6,nodeBorderRadius:9,nodeToggleSize:28,nodeToggleBgColor:"#35363C",nodeToggleBorderRadius:6,nodeToggleBorderColor:"#51525C",nodeUnselectedAlpha:.2,artifactsGap:4,artifactsNodeOverlap:4,artifactPaddingLeft:2,artifactPaddingRight:4,artifactPaddingY:2,artifactTextColor:"#ffffff",artifactBgColor:"#35363b",artifactBorderRadius:4,artifactContentGap:4,artifactIconSize:16,artifactIconColor:"#ffffff",flowStateBarHeight:8,flowStateSelectedBarHeight:10,flowStateAreaAlpha:.1,eventTargetSize:30,eventBottomMargin:4,eventSelectedBorderInset:8,eventRadiusDefault:4,eventColor:"#A564F9",eventClusterRadiusDefault:6,eventClusterColor:"#A564F9",edgeColor:"#51525C",guideLineWidth:1,guideLineColor:"#51525C",guideTextTopPadding:8,guideTextLeftPadding:8,guideTextSize:12,guideTextColor:"#ADADAD",playheadWidth:2,playheadColor:"#6272FF",node:()=>({background:"#ffffff"}),state:()=>({background:"#ffffff"})}};function _E(r){const t=gE({},Kg,r);return t.styles.node=e=>{var i,s;return{...Kg.styles.node(e),...(s=(i=r.styles)==null?void 0:i.node)==null?void 0:s.call(i,e)}},t}async function vE(r){(await xE()).run(()=>{z.watch(()=>r.config,e=>{const i=_E(e);if(!Fr){Fr=i,q.emit("configCreated",Fr);return}Object.assign(Fr,i),q.emit("configUpdated",Fr)},{immediate:!0})})}function wE(){Fr=null}async function Pt(){return Fr||await Ie("configCreated")}async function Yg(r,t){const e=await Pt();let i,s=null;async function n(){try{s=await e.fetch(r),t(s)}catch(a){console.error(a)}s&&!s.end_time&&(i=setTimeout(()=>n(),zg(s)))}function o(){clearInterval(i)}return{start:n,stop:o}}function zg(r){const t=Math.floor(r.nodes.size/aa)*aa;return Math.max(aa,t)}function nr(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function jg(r,t){r.prototype=Object.create(t.prototype),r.prototype.constructor=r,r.__proto__=t}/*!
1160
1160
  * GSAP 3.12.5
1161
1161
  * https://gsap.com
1162
1162
  *
@@ -1172,6 +1172,6 @@ void main(void)\r
1172
1172
  * Subject to the terms at https://gsap.com/standard-license or for
1173
1173
  * Club GSAP members, the agreement issued with that membership.
1174
1174
  * @author: Jack Doyle, jack@greensock.com
1175
- */var V0,Ur,xn,Ju,ws,H0,$u,mC=function(){return typeof window<"u"},ar={},Ts=180/Math.PI,_n=Math.PI/180,vn=Math.atan2,K0=1e8,Qu=/([A-Z])/g,gC=/(left|right|width|margin|padding|x)/i,yC=/[\s,\(]\S/,Di={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},qu=function(t,e){return e.set(e.t,e.p,Math.round((e.s+e.c*t)*1e4)/1e4+e.u,e)},bC=function(t,e){return e.set(e.t,e.p,t===1?e.e:Math.round((e.s+e.c*t)*1e4)/1e4+e.u,e)},xC=function(t,e){return e.set(e.t,e.p,t?Math.round((e.s+e.c*t)*1e4)/1e4+e.u:e.b,e)},_C=function(t,e){var i=e.s+e.c*t;e.set(e.t,e.p,~~(i+(i<0?-.5:.5))+e.u,e)},Y0=function(t,e){return e.set(e.t,e.p,t?e.e:e.b,e)},z0=function(t,e){return e.set(e.t,e.p,t!==1?e.b:e.e,e)},vC=function(t,e,i){return t.style[e]=i},wC=function(t,e,i){return t.style.setProperty(e,i)},TC=function(t,e,i){return t._gsap[e]=i},SC=function(t,e,i){return t._gsap.scaleX=t._gsap.scaleY=i},EC=function(t,e,i,s,n){var o=t._gsap;o.scaleX=o.scaleY=i,o.renderTransform(n,o)},CC=function(t,e,i,s,n){var o=t._gsap;o[e]=i,o.renderTransform(n,o)},Ht="transform",Pe=Ht+"Origin",IC=function r(t,e){var i=this,s=this.target,n=s.style,o=s._gsap;if(t in ar&&n){if(this.tfm=this.tfm||{},t!=="transform")t=Di[t]||t,~t.indexOf(",")?t.split(",").forEach(function(a){return i.tfm[a]=hr(s,a)}):this.tfm[t]=o.x?o[t]:hr(s,t),t===Pe&&(this.tfm.zOrigin=o.zOrigin);else return Di.transform.split(",").forEach(function(a){return r.call(i,a,e)});if(this.props.indexOf(Ht)>=0)return;o.svg&&(this.svgo=s.getAttribute("data-svg-origin"),this.props.push(Pe,e,"")),t=Ht}(n||e)&&this.props.push(t,e,n[t])},j0=function(t){t.translate&&(t.removeProperty("translate"),t.removeProperty("scale"),t.removeProperty("rotate"))},AC=function(){var t=this.props,e=this.target,i=e.style,s=e._gsap,n,o;for(n=0;n<t.length;n+=3)t[n+1]?e[t[n]]=t[n+2]:t[n+2]?i[t[n]]=t[n+2]:i.removeProperty(t[n].substr(0,2)==="--"?t[n]:t[n].replace(Qu,"-$1").toLowerCase());if(this.tfm){for(o in this.tfm)s[o]=this.tfm[o];s.svg&&(s.renderTransform(),e.setAttribute("data-svg-origin",this.svgo||"")),n=$u(),(!n||!n.isStart)&&!i[Ht]&&(j0(i),s.zOrigin&&i[Pe]&&(i[Pe]+=" "+s.zOrigin+"px",s.zOrigin=0,s.renderTransform()),s.uncache=1)}},J0=function(t,e){var i={target:t,props:[],revert:AC,save:IC};return t._gsap||Le.core.getCache(t),e&&e.split(",").forEach(function(s){return i.save(s)}),i},$0,td=function(t,e){var i=Ur.createElementNS?Ur.createElementNS((e||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),t):Ur.createElement(t);return i&&i.style?i:Ur.createElement(t)},ki=function r(t,e,i){var s=getComputedStyle(t);return s[e]||s.getPropertyValue(e.replace(Qu,"-$1").toLowerCase())||s.getPropertyValue(e)||!i&&r(t,wn(e)||e,1)||""},Q0="O,Moz,ms,Ms,Webkit".split(","),wn=function(t,e,i){var s=e||ws,n=s.style,o=5;if(t in n&&!i)return t;for(t=t.charAt(0).toUpperCase()+t.substr(1);o--&&!(Q0[o]+t in n););return o<0?null:(o===3?"ms":o>=0?Q0[o]:"")+t},ed=function(){mC()&&window.document&&(V0=window,Ur=V0.document,xn=Ur.documentElement,ws=td("div")||{style:{}},td("div"),Ht=wn(Ht),Pe=Ht+"Origin",ws.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",$0=!!wn("perspective"),$u=Le.core.reverting,Ju=1)},id=function r(t){var e=td("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),i=this.parentNode,s=this.nextSibling,n=this.style.cssText,o;if(xn.appendChild(e),e.appendChild(this),this.style.display="block",t)try{o=this.getBBox(),this._gsapBBox=this.getBBox,this.getBBox=r}catch{}else this._gsapBBox&&(o=this._gsapBBox());return i&&(s?i.insertBefore(this,s):i.appendChild(this)),xn.removeChild(e),this.style.cssText=n,o},q0=function(t,e){for(var i=e.length;i--;)if(t.hasAttribute(e[i]))return t.getAttribute(e[i])},ty=function(t){var e;try{e=t.getBBox()}catch{e=id.call(t,!0)}return e&&(e.width||e.height)||t.getBBox===id||(e=id.call(t,!0)),e&&!e.width&&!e.x&&!e.y?{x:+q0(t,["x","cx","x1"])||0,y:+q0(t,["y","cy","y1"])||0,width:0,height:0}:e},ey=function(t){return!!(t.getCTM&&(!t.parentNode||t.ownerSVGElement)&&ty(t))},Ss=function(t,e){if(e){var i=t.style,s;e in ar&&e!==Pe&&(e=Ht),i.removeProperty?(s=e.substr(0,2),(s==="ms"||e.substr(0,6)==="webkit")&&(e="-"+e),i.removeProperty(s==="--"?e:e.replace(Qu,"-$1").toLowerCase())):i.removeAttribute(e)}},Wr=function(t,e,i,s,n,o){var a=new Me(t._pt,e,i,0,1,o?z0:Y0);return t._pt=a,a.b=s,a.e=n,t._props.push(i),a},iy={deg:1,rad:1,turn:1},RC={grid:1,flex:1},Xr=function r(t,e,i,s){var n=parseFloat(i)||0,o=(i+"").trim().substr((n+"").length)||"px",a=ws.style,h=gC.test(e),l=t.tagName.toLowerCase()==="svg",c=(l?"client":"offset")+(h?"Width":"Height"),u=100,d=s==="px",f=s==="%",p,m,g,y;if(s===o||!n||iy[s]||iy[o])return n;if(o!=="px"&&!d&&(n=r(t,e,i,"px")),y=t.getCTM&&ey(t),(f||o==="%")&&(ar[e]||~e.indexOf("adius")))return p=y?t.getBBox()[h?"width":"height"]:t[c],jt(f?n/p*u:n/100*p);if(a[h?"width":"height"]=u+(d?o:s),m=~e.indexOf("adius")||s==="em"&&t.appendChild&&!l?t:t.parentNode,y&&(m=(t.ownerSVGElement||{}).parentNode),(!m||m===Ur||!m.appendChild)&&(m=Ur.body),g=m._gsap,g&&f&&g.width&&h&&g.time===Xe.time&&!g.uncache)return jt(n/g.width*u);if(f&&(e==="height"||e==="width")){var x=t.style[e];t.style[e]=u+s,p=t[c],x?t.style[e]=x:Ss(t,e)}else(f||o==="%")&&!RC[ki(m,"display")]&&(a.position=ki(t,"position")),m===t&&(a.position="static"),m.appendChild(ws),p=ws[c],m.removeChild(ws),a.position="absolute";return h&&f&&(g=gs(m),g.time=Xe.time,g.width=m[c]),jt(d?p*n/u:p&&n?u/p*n:0)},hr=function(t,e,i,s){var n;return Ju||ed(),e in Di&&e!=="transform"&&(e=Di[e],~e.indexOf(",")&&(e=e.split(",")[0])),ar[e]&&e!=="transform"?(n=So(t,s),n=e!=="transformOrigin"?n[e]:n.svg?n.origin:Ch(ki(t,Pe))+" "+n.zOrigin+"px"):(n=t.style[e],(!n||n==="auto"||s||~(n+"").indexOf("calc("))&&(n=Eh[e]&&Eh[e](t,e,i)||ki(t,e)||o0(t,e)||(e==="opacity"?1:0))),i&&!~(n+"").trim().indexOf(" ")?Xr(t,e,n,i)+i:n},MC=function(t,e,i,s){if(!i||i==="none"){var n=wn(e,t,1),o=n&&ki(t,n,1);o&&o!==i?(e=n,i=o):e==="borderColor"&&(i=ki(t,"borderTopColor"))}var a=new Me(this._pt,t.style,e,0,1,U0),h=0,l=0,c,u,d,f,p,m,g,y,x,b,v,w;if(a.b=i,a.e=s,i+="",s+="",s==="auto"&&(m=t.style[e],t.style[e]=s,s=ki(t,e)||s,m?t.style[e]=m:Ss(t,e)),c=[i,s],M0(c),i=c[0],s=c[1],d=i.match(fn)||[],w=s.match(fn)||[],w.length){for(;u=fn.exec(s);)g=u[0],x=s.substring(h,u.index),p?p=(p+1)%5:(x.substr(-5)==="rgba("||x.substr(-5)==="hsla(")&&(p=1),g!==(m=d[l++]||"")&&(f=parseFloat(m)||0,v=m.substr((f+"").length),g.charAt(1)==="="&&(g=pn(f,g)+v),y=parseFloat(g),b=g.substr((y+"").length),h=fn.lastIndex-b.length,b||(b=b||Oe.units[e]||v,h===s.length&&(s+=b,a.e+=b)),v!==b&&(f=Xr(t,e,m,b)||0),a._pt={_next:a._pt,p:x||l===1?x:",",s:f,c:y-f,m:p&&p<4||e==="zIndex"?Math.round:0});a.c=h<s.length?s.substring(h,s.length):""}else a.r=e==="display"&&s==="none"?z0:Y0;return qg.test(s)&&(a.e=0),this._pt=a,a},ry={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},LC=function(t){var e=t.split(" "),i=e[0],s=e[1]||"50%";return(i==="top"||i==="bottom"||s==="left"||s==="right")&&(t=i,i=s,s=t),e[0]=ry[i]||i,e[1]=ry[s]||s,e.join(" ")},PC=function(t,e){if(e.tween&&e.tween._time===e.tween._dur){var i=e.t,s=i.style,n=e.u,o=i._gsap,a,h,l;if(n==="all"||n===!0)s.cssText="",h=1;else for(n=n.split(","),l=n.length;--l>-1;)a=n[l],ar[a]&&(h=1,a=a==="transformOrigin"?Pe:Ht),Ss(i,a);h&&(Ss(i,Ht),o&&(o.svg&&i.removeAttribute("transform"),So(i,1),o.uncache=1,j0(s)))}},Eh={clearProps:function(t,e,i,s,n){if(n.data!=="isFromStart"){var o=t._pt=new Me(t._pt,e,i,0,0,PC);return o.u=s,o.pr=-10,o.tween=n,t._props.push(i),1}}},To=[1,0,0,1,0,0],sy={},ny=function(t){return t==="matrix(1, 0, 0, 1, 0, 0)"||t==="none"||!t},oy=function(t){var e=ki(t,Ht);return ny(e)?To:e.substr(7).match(Qg).map(jt)},rd=function(t,e){var i=t._gsap||gs(t),s=t.style,n=oy(t),o,a,h,l;return i.svg&&t.getAttribute("transform")?(h=t.transform.baseVal.consolidate().matrix,n=[h.a,h.b,h.c,h.d,h.e,h.f],n.join(",")==="1,0,0,1,0,0"?To:n):(n===To&&!t.offsetParent&&t!==xn&&!i.svg&&(h=s.display,s.display="block",o=t.parentNode,(!o||!t.offsetParent)&&(l=1,a=t.nextElementSibling,xn.appendChild(t)),n=oy(t),h?s.display=h:Ss(t,"display"),l&&(a?o.insertBefore(t,a):o?o.appendChild(t):xn.removeChild(t))),e&&n.length>6?[n[0],n[1],n[4],n[5],n[12],n[13]]:n)},sd=function(t,e,i,s,n,o){var a=t._gsap,h=n||rd(t,!0),l=a.xOrigin||0,c=a.yOrigin||0,u=a.xOffset||0,d=a.yOffset||0,f=h[0],p=h[1],m=h[2],g=h[3],y=h[4],x=h[5],b=e.split(" "),v=parseFloat(b[0])||0,w=parseFloat(b[1])||0,S,C,I,R;i?h!==To&&(C=f*g-p*m)&&(I=v*(g/C)+w*(-m/C)+(m*x-g*y)/C,R=v*(-p/C)+w*(f/C)-(f*x-p*y)/C,v=I,w=R):(S=ty(t),v=S.x+(~b[0].indexOf("%")?v/100*S.width:v),w=S.y+(~(b[1]||b[0]).indexOf("%")?w/100*S.height:w)),s||s!==!1&&a.smooth?(y=v-l,x=w-c,a.xOffset=u+(y*f+x*m)-y,a.yOffset=d+(y*p+x*g)-x):a.xOffset=a.yOffset=0,a.xOrigin=v,a.yOrigin=w,a.smooth=!!s,a.origin=e,a.originIsAbsolute=!!i,t.style[Pe]="0px 0px",o&&(Wr(o,a,"xOrigin",l,v),Wr(o,a,"yOrigin",c,w),Wr(o,a,"xOffset",u,a.xOffset),Wr(o,a,"yOffset",d,a.yOffset)),t.setAttribute("data-svg-origin",v+" "+w)},So=function(t,e){var i=t._gsap||new F0(t);if("x"in i&&!e&&!i.uncache)return i;var s=t.style,n=i.scaleX<0,o="px",a="deg",h=getComputedStyle(t),l=ki(t,Pe)||"0",c,u,d,f,p,m,g,y,x,b,v,w,S,C,I,R,P,G,N,A,k,V,K,H,$,U,D,F,Z,tt,ft,ot;return c=u=d=m=g=y=x=b=v=0,f=p=1,i.svg=!!(t.getCTM&&ey(t)),h.translate&&((h.translate!=="none"||h.scale!=="none"||h.rotate!=="none")&&(s[Ht]=(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[Ht]!=="none"?h[Ht]:"")),s.scale=s.rotate=s.translate="none"),C=rd(t,i.svg),i.svg&&(i.uncache?($=t.getBBox(),l=i.xOrigin-$.x+"px "+(i.yOrigin-$.y)+"px",H=""):H=!e&&t.getAttribute("data-svg-origin"),sd(t,H||l,!!H||i.originIsAbsolute,i.smooth!==!1,C)),w=i.xOrigin||0,S=i.yOrigin||0,C!==To&&(G=C[0],N=C[1],A=C[2],k=C[3],c=V=C[4],u=K=C[5],C.length===6?(f=Math.sqrt(G*G+N*N),p=Math.sqrt(k*k+A*A),m=G||N?vn(N,G)*Ts:0,x=A||k?vn(A,k)*Ts+m:0,x&&(p*=Math.abs(Math.cos(x*_n))),i.svg&&(c-=w-(w*G+S*A),u-=S-(w*N+S*k))):(ot=C[6],tt=C[7],D=C[8],F=C[9],Z=C[10],ft=C[11],c=C[12],u=C[13],d=C[14],I=vn(ot,Z),g=I*Ts,I&&(R=Math.cos(-I),P=Math.sin(-I),H=V*R+D*P,$=K*R+F*P,U=ot*R+Z*P,D=V*-P+D*R,F=K*-P+F*R,Z=ot*-P+Z*R,ft=tt*-P+ft*R,V=H,K=$,ot=U),I=vn(-A,Z),y=I*Ts,I&&(R=Math.cos(-I),P=Math.sin(-I),H=G*R-D*P,$=N*R-F*P,U=A*R-Z*P,ft=k*P+ft*R,G=H,N=$,A=U),I=vn(N,G),m=I*Ts,I&&(R=Math.cos(I),P=Math.sin(I),H=G*R+N*P,$=V*R+K*P,N=N*R-G*P,K=K*R-V*P,G=H,V=$),g&&Math.abs(g)+Math.abs(m)>359.9&&(g=m=0,y=180-y),f=jt(Math.sqrt(G*G+N*N+A*A)),p=jt(Math.sqrt(K*K+ot*ot)),I=vn(V,K),x=Math.abs(I)>2e-4?I*Ts:0,v=ft?1/(ft<0?-ft:ft):0),i.svg&&(H=t.getAttribute("transform"),i.forceCSS=t.setAttribute("transform","")||!ny(ki(t,Ht)),H&&t.setAttribute("transform",H))),Math.abs(x)>90&&Math.abs(x)<270&&(n?(f*=-1,x+=m<=0?180:-180,m+=m<=0?180:-180):(p*=-1,x+=x<=0?180:-180)),e=e||i.uncache,i.x=c-((i.xPercent=c&&(!e&&i.xPercent||(Math.round(t.offsetWidth/2)===Math.round(-c)?-50:0)))?t.offsetWidth*i.xPercent/100:0)+o,i.y=u-((i.yPercent=u&&(!e&&i.yPercent||(Math.round(t.offsetHeight/2)===Math.round(-u)?-50:0)))?t.offsetHeight*i.yPercent/100:0)+o,i.z=d+o,i.scaleX=jt(f),i.scaleY=jt(p),i.rotation=jt(m)+a,i.rotationX=jt(g)+a,i.rotationY=jt(y)+a,i.skewX=x+a,i.skewY=b+a,i.transformPerspective=v+o,(i.zOrigin=parseFloat(l.split(" ")[2])||!e&&i.zOrigin||0)&&(s[Pe]=Ch(l)),i.xOffset=i.yOffset=0,i.force3D=Oe.force3D,i.renderTransform=i.svg?FC:$0?ay:GC,i.uncache=0,i},Ch=function(t){return(t=t.split(" "))[0]+" "+t[1]},nd=function(t,e,i){var s=be(e);return jt(parseFloat(e)+parseFloat(Xr(t,"x",i+"px",s)))+s},GC=function(t,e){e.z="0px",e.rotationY=e.rotationX="0deg",e.force3D=0,ay(t,e)},Es="0deg",Eo="0px",Cs=") ",ay=function(t,e){var i=e||this,s=i.xPercent,n=i.yPercent,o=i.x,a=i.y,h=i.z,l=i.rotation,c=i.rotationY,u=i.rotationX,d=i.skewX,f=i.skewY,p=i.scaleX,m=i.scaleY,g=i.transformPerspective,y=i.force3D,x=i.target,b=i.zOrigin,v="",w=y==="auto"&&t&&t!==1||y===!0;if(b&&(u!==Es||c!==Es)){var S=parseFloat(c)*_n,C=Math.sin(S),I=Math.cos(S),R;S=parseFloat(u)*_n,R=Math.cos(S),o=nd(x,o,C*R*-b),a=nd(x,a,-Math.sin(S)*-b),h=nd(x,h,I*R*-b+b)}g!==Eo&&(v+="perspective("+g+Cs),(s||n)&&(v+="translate("+s+"%, "+n+"%) "),(w||o!==Eo||a!==Eo||h!==Eo)&&(v+=h!==Eo||w?"translate3d("+o+", "+a+", "+h+") ":"translate("+o+", "+a+Cs),l!==Es&&(v+="rotate("+l+Cs),c!==Es&&(v+="rotateY("+c+Cs),u!==Es&&(v+="rotateX("+u+Cs),(d!==Es||f!==Es)&&(v+="skew("+d+", "+f+Cs),(p!==1||m!==1)&&(v+="scale("+p+", "+m+Cs),x.style[Ht]=v||"translate(0, 0)"},FC=function(t,e){var i=e||this,s=i.xPercent,n=i.yPercent,o=i.x,a=i.y,h=i.rotation,l=i.skewX,c=i.skewY,u=i.scaleX,d=i.scaleY,f=i.target,p=i.xOrigin,m=i.yOrigin,g=i.xOffset,y=i.yOffset,x=i.forceCSS,b=parseFloat(o),v=parseFloat(a),w,S,C,I,R;h=parseFloat(h),l=parseFloat(l),c=parseFloat(c),c&&(c=parseFloat(c),l+=c,h+=c),h||l?(h*=_n,l*=_n,w=Math.cos(h)*u,S=Math.sin(h)*u,C=Math.sin(h-l)*-d,I=Math.cos(h-l)*d,l&&(c*=_n,R=Math.tan(l-c),R=Math.sqrt(1+R*R),C*=R,I*=R,c&&(R=Math.tan(c),R=Math.sqrt(1+R*R),w*=R,S*=R)),w=jt(w),S=jt(S),C=jt(C),I=jt(I)):(w=u,I=d,S=C=0),(b&&!~(o+"").indexOf("px")||v&&!~(a+"").indexOf("px"))&&(b=Xr(f,"x",o,"px"),v=Xr(f,"y",a,"px")),(p||m||g||y)&&(b=jt(b+p-(p*w+m*C)+g),v=jt(v+m-(p*S+m*I)+y)),(s||n)&&(R=f.getBBox(),b=jt(b+s/100*R.width),v=jt(v+n/100*R.height)),R="matrix("+w+","+S+","+C+","+I+","+b+","+v+")",f.setAttribute("transform",R),x&&(f.style[Ht]=R)},NC=function(t,e,i,s,n){var o=360,a=le(n),h=parseFloat(n)*(a&&~n.indexOf("rad")?Ts:1),l=h-s,c=s+l+"deg",u,d;return a&&(u=n.split("_")[1],u==="short"&&(l%=o,l!==l%(o/2)&&(l+=l<0?o:-o)),u==="cw"&&l<0?l=(l+o*K0)%o-~~(l/o)*o:u==="ccw"&&l>0&&(l=(l-o*K0)%o-~~(l/o)*o)),t._pt=d=new Me(t._pt,e,i,s,l,bC),d.e=c,d.u="deg",t._props.push(i),d},hy=function(t,e){for(var i in e)t[i]=e[i];return t},DC=function(t,e,i){var s=hy({},i._gsap),n="perspective,force3D,transformOrigin,svgOrigin",o=i.style,a,h,l,c,u,d,f,p;s.svg?(l=i.getAttribute("transform"),i.setAttribute("transform",""),o[Ht]=e,a=So(i,1),Ss(i,Ht),i.setAttribute("transform",l)):(l=getComputedStyle(i)[Ht],o[Ht]=e,a=So(i,1),o[Ht]=l);for(h in ar)l=s[h],c=a[h],l!==c&&n.indexOf(h)<0&&(f=be(l),p=be(c),u=f!==p?Xr(i,h,l,p):parseFloat(l),d=parseFloat(c),t._pt=new Me(t._pt,a,h,u,d-u,qu),t._pt.u=p||0,t._props.push(h));hy(a,s)};Re("padding,margin,Width,Radius",function(r,t){var e="Top",i="Right",s="Bottom",n="Left",o=(t<3?[e,i,s,n]:[e+n,e+i,s+i,s+n]).map(function(a){return t<2?r+a:"border"+a+r});Eh[t>1?"border"+r:r]=function(a,h,l,c,u){var d,f;if(arguments.length<4)return d=o.map(function(p){return hr(a,p,l)}),f=d.join(" "),f.split(d[0]).length===5?d[0]:f;d=(c+"").split(" "),f={},o.forEach(function(p,m){return f[p]=d[m]=d[m]||d[(m-1)/2|0]}),a.init(h,f,u)}});var ly={name:"css",register:ed,targetTest:function(t){return t.style&&t.nodeType},init:function(t,e,i,s,n){var o=this._props,a=t.style,h=i.vars.startAt,l,c,u,d,f,p,m,g,y,x,b,v,w,S,C,I;Ju||ed(),this.styles=this.styles||J0(t),I=this.styles.props,this.tween=i;for(m in e)if(m!=="autoRound"&&(c=e[m],!(Ue[m]&&N0(m,e,i,s,t,n)))){if(f=typeof c,p=Eh[m],f==="function"&&(c=c.call(i,s,t,n),f=typeof c),f==="string"&&~c.indexOf("random(")&&(c=yo(c)),p)p(this,t,m,c,i)&&(C=1);else if(m.substr(0,2)==="--")l=(getComputedStyle(t).getPropertyValue(m)+"").trim(),c+="",Or.lastIndex=0,Or.test(l)||(g=be(l),y=be(c)),y?g!==y&&(l=Xr(t,m,l,y)+y):g&&(c+=g),this.add(a,"setProperty",l,c,s,n,0,0,m),o.push(m),I.push(m,0,a[m]);else if(f!=="undefined"){if(h&&m in h?(l=typeof h[m]=="function"?h[m].call(i,s,t,n):h[m],le(l)&&~l.indexOf("random(")&&(l=yo(l)),be(l+"")||l==="auto"||(l+=Oe.units[m]||be(hr(t,m))||""),(l+"").charAt(1)==="="&&(l=hr(t,m))):l=hr(t,m),d=parseFloat(l),x=f==="string"&&c.charAt(1)==="="&&c.substr(0,2),x&&(c=c.substr(2)),u=parseFloat(c),m in Di&&(m==="autoAlpha"&&(d===1&&hr(t,"visibility")==="hidden"&&u&&(d=0),I.push("visibility",0,a.visibility),Wr(this,a,"visibility",d?"inherit":"hidden",u?"inherit":"hidden",!u)),m!=="scale"&&m!=="transform"&&(m=Di[m],~m.indexOf(",")&&(m=m.split(",")[0]))),b=m in ar,b){if(this.styles.save(m),v||(w=t._gsap,w.renderTransform&&!e.parseTransform||So(t,e.parseTransform),S=e.smoothOrigin!==!1&&w.smooth,v=this._pt=new Me(this._pt,a,Ht,0,1,w.renderTransform,w,0,-1),v.dep=1),m==="scale")this._pt=new Me(this._pt,w,"scaleY",w.scaleY,(x?pn(w.scaleY,x+u):u)-w.scaleY||0,qu),this._pt.u=0,o.push("scaleY",m),m+="X";else if(m==="transformOrigin"){I.push(Pe,0,a[Pe]),c=LC(c),w.svg?sd(t,c,0,S,0,this):(y=parseFloat(c.split(" ")[2])||0,y!==w.zOrigin&&Wr(this,w,"zOrigin",w.zOrigin,y),Wr(this,a,m,Ch(l),Ch(c)));continue}else if(m==="svgOrigin"){sd(t,c,1,S,0,this);continue}else if(m in sy){NC(this,w,m,d,x?pn(d,x+c):c);continue}else if(m==="smoothOrigin"){Wr(this,w,"smooth",w.smooth,c);continue}else if(m==="force3D"){w[m]=c;continue}else if(m==="transform"){DC(this,c,t);continue}}else m in a||(m=wn(m)||m);if(b||(u||u===0)&&(d||d===0)&&!yC.test(c)&&m in a)g=(l+"").substr((d+"").length),u||(u=0),y=be(c)||(m in Oe.units?Oe.units[m]:g),g!==y&&(d=Xr(t,m,l,y)),this._pt=new Me(this._pt,b?w:a,m,d,(x?pn(d,x+u):u)-d,!b&&(y==="px"||m==="zIndex")&&e.autoRound!==!1?_C:qu),this._pt.u=y||0,g!==y&&y!=="%"&&(this._pt.b=l,this._pt.r=xC);else if(m in a)MC.call(this,t,m,l,x?x+c:c);else if(m in t)this.add(t,m,l||t[m],x?x+c:c,s,n);else if(m!=="parseTransform"){Iu(m,c);continue}b||(m in a?I.push(m,0,a[m]):I.push(m,1,l||t[m])),o.push(m)}}C&&W0(this)},render:function(t,e){if(e.tween._time||!$u())for(var i=e._pt;i;)i.r(t,i.d),i=i._next;else e.styles.revert()},get:hr,aliases:Di,getSetter:function(t,e,i){var s=Di[e];return s&&s.indexOf(",")<0&&(e=s),e in ar&&e!==Pe&&(t._gsap.x||hr(t,"x"))?i&&H0===i?e==="scale"?SC:TC:(H0=i||{})&&(e==="scale"?EC:CC):t.style&&!vu(t.style[e])?vC:~e.indexOf("-")?wC:Hu(t,e)},core:{_removeProperty:Ss,_getMatrix:rd}};Le.utils.checkPrefix=wn,Le.core.getStyleSaver=J0,function(r,t,e,i){var s=Re(r+","+t+","+e,function(n){ar[n]=1});Re(t,function(n){Oe.units[n]="deg",sy[n]=1}),Di[s[13]]=r+","+t,Re(i,function(n){var o=n.split(":");Di[o[1]]=s[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"),Re("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(r){Oe.units[r]="px"}),Le.registerPlugin(ly);var cy=Le.registerPlugin(ly)||Le;cy.core.Tween;const Is=new mt;class kC{constructor(t={}){this._recursive=typeof t.recursive=="boolean"?t.recursive:!0,this._toggle=t.toggle||"visible",this._targetList=new Set}add(t){return this._targetList.add(t),this}addAll(t){for(let e=0,i=t.length;e<i;e++)this._targetList.add(t[e]);return this}remove(t){return this._targetList.delete(t),this}removeAll(t){for(let e=0,i=t.length;e<i;e++)this._targetList.delete(t[e]);return this}clear(){return this._targetList.clear(),this}cull(t,e=!1){return e||this.uncull(),this._targetList.forEach(i=>{e||i.getBounds(!1,Is),this._recursive?this.cullRecursive(t,i,e):(e&&i._bounds.getRectangle(t),i[this._toggle]=Is.right>t.left&&Is.left<t.right&&Is.bottom>t.top&&Is.top<t.bottom)}),this}uncull(){return this._targetList.forEach(t=>{this._recursive?this.uncullRecursive(t):t[this._toggle]=!1}),this}cullRecursive(t,e,i){const s=i?e._bounds.getRectangle(Is):e.getBounds(!0,Is);if(e[this._toggle]=s.right>t.left&&s.left<t.right&&s.bottom>t.top&&s.top<t.bottom,!(s.left>=t.left&&s.top>=t.top&&s.right<=t.right&&s.bottom<=t.bottom)&&e[this._toggle]&&e.children&&e.children.length){const o=e.children;for(let a=0,h=o.length;a<h;a++)this.cullRecursive(t,o[a])}}uncullRecursive(t){if(t[this._toggle]=!0,t.children&&t.children.length){const e=t.children;for(let i=0,s=e.length;i<s;i++)this.uncullRecursive(e[i])}}}var Ih={exports:{}};Ih.exports,function(r,t){var e=200,i="__lodash_hash_undefined__",s=1,n=2,o=9007199254740991,a="[object Arguments]",h="[object Array]",l="[object AsyncFunction]",c="[object Boolean]",u="[object Date]",d="[object Error]",f="[object Function]",p="[object GeneratorFunction]",m="[object Map]",g="[object Number]",y="[object Null]",x="[object Object]",b="[object Promise]",v="[object Proxy]",w="[object RegExp]",S="[object Set]",C="[object String]",I="[object Symbol]",R="[object Undefined]",P="[object WeakMap]",G="[object ArrayBuffer]",N="[object DataView]",A="[object Float32Array]",k="[object Float64Array]",V="[object Int8Array]",K="[object Int16Array]",H="[object Int32Array]",$="[object Uint8Array]",U="[object Uint8ClampedArray]",D="[object Uint16Array]",F="[object Uint32Array]",Z=/[\\^$.*+?()[\]{}|]/g,tt=/^\[object .+?Constructor\]$/,ft=/^(?:0|[1-9]\d*)$/,ot={};ot[A]=ot[k]=ot[V]=ot[K]=ot[H]=ot[$]=ot[U]=ot[D]=ot[F]=!0,ot[a]=ot[h]=ot[G]=ot[c]=ot[N]=ot[u]=ot[d]=ot[f]=ot[m]=ot[g]=ot[x]=ot[w]=ot[S]=ot[C]=ot[P]=!1;var Et=typeof ve=="object"&&ve&&ve.Object===Object&&ve,Mt=typeof self=="object"&&self&&self.Object===Object&&self,bt=Et||Mt||Function("return this")(),B=t&&!t.nodeType&&t,j=B&&!0&&r&&!r.nodeType&&r,J=j&&j.exports===B,O=J&&Et.process,gt=function(){try{return O&&O.binding&&O.binding("util")}catch{}}(),ut=gt&&gt.isTypedArray;function It(T,M){for(var _=-1,E=T==null?0:T.length,L=0,X=[];++_<E;){var ct=T[_];M(ct,_,T)&&(X[L++]=ct)}return X}function Dt(T,M){for(var _=-1,E=M.length,L=T.length;++_<E;)T[L+_]=M[_];return T}function Ee(T,M){for(var _=-1,E=T==null?0:T.length;++_<E;)if(M(T[_],_,T))return!0;return!1}function ri(T,M){for(var _=-1,E=Array(T);++_<T;)E[_]=M(_);return E}function Xo(T){return function(M){return T(M)}}function Kr(T,M){return T.has(M)}function Fs(T,M){return T==null?void 0:T[M]}function Ns(T){var M=-1,_=Array(T.size);return T.forEach(function(E,L){_[++M]=[L,E]}),_}function gi(T,M){return function(_){return T(M(_))}}function tl(T){var M=-1,_=Array(T.size);return T.forEach(function(E){_[++M]=E}),_}var el=Array.prototype,Wd=Function.prototype,Gn=Object.prototype,Yr=bt["__core-js_shared__"],Zo=Wd.toString,Ze=Gn.hasOwnProperty,Vo=function(){var T=/[^.]+$/.exec(Yr&&Yr.keys&&Yr.keys.IE_PROTO||"");return T?"Symbol(src)_1."+T:""}(),Ho=Gn.toString,il=RegExp("^"+Zo.call(Ze).replace(Z,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),rl=J?bt.Buffer:void 0,Fn=bt.Symbol,Xi=bt.Uint8Array,Ds=Gn.propertyIsEnumerable,Xd=el.splice,Zi=Fn?Fn.toStringTag:void 0,sl=Object.getOwnPropertySymbols,nl=rl?rl.isBuffer:void 0,ks=gi(Object.keys,Object),Ko=xr(bt,"DataView"),Ve=xr(bt,"Map"),Yo=xr(bt,"Promise"),zo=xr(bt,"Set"),jo=xr(bt,"WeakMap"),Os=xr(Object,"create"),Zd=bi(Ko),yi=bi(Ve),Vd=bi(Yo),Hd=bi(zo),Kd=bi(jo),ol=Fn?Fn.prototype:void 0,Jo=ol?ol.valueOf:void 0;function Ne(T){var M=-1,_=T==null?0:T.length;for(this.clear();++M<_;){var E=T[M];this.set(E[0],E[1])}}function Yd(){this.__data__=Os?Os(null):{},this.size=0}function zd(T){var M=this.has(T)&&delete this.__data__[T];return this.size-=M?1:0,M}function jd(T){var M=this.__data__;if(Os){var _=M[T];return _===i?void 0:_}return Ze.call(M,T)?M[T]:void 0}function Jd(T){var M=this.__data__;return Os?M[T]!==void 0:Ze.call(M,T)}function $d(T,M){var _=this.__data__;return this.size+=this.has(T)?0:1,_[T]=Os&&M===void 0?i:M,this}Ne.prototype.clear=Yd,Ne.prototype.delete=zd,Ne.prototype.get=jd,Ne.prototype.has=Jd,Ne.prototype.set=$d;function xe(T){var M=-1,_=T==null?0:T.length;for(this.clear();++M<_;){var E=T[M];this.set(E[0],E[1])}}function Qd(){this.__data__=[],this.size=0}function qd(T){var M=this.__data__,_=Dn(M,T);if(_<0)return!1;var E=M.length-1;return _==E?M.pop():Xd.call(M,_,1),--this.size,!0}function tf(T){var M=this.__data__,_=Dn(M,T);return _<0?void 0:M[_][1]}function ef(T){return Dn(this.__data__,T)>-1}function rf(T,M){var _=this.__data__,E=Dn(_,T);return E<0?(++this.size,_.push([T,M])):_[E][1]=M,this}xe.prototype.clear=Qd,xe.prototype.delete=qd,xe.prototype.get=tf,xe.prototype.has=ef,xe.prototype.set=rf;function yr(T){var M=-1,_=T==null?0:T.length;for(this.clear();++M<_;){var E=T[M];this.set(E[0],E[1])}}function $o(){this.size=0,this.__data__={hash:new Ne,map:new(Ve||xe),string:new Ne}}function sf(T){var M=On(this,T).delete(T);return this.size-=M?1:0,M}function Nn(T){return On(this,T).get(T)}function Qo(T){return On(this,T).has(T)}function nf(T,M){var _=On(this,T),E=_.size;return _.set(T,M),this.size+=_.size==E?0:1,this}yr.prototype.clear=$o,yr.prototype.delete=sf,yr.prototype.get=Nn,yr.prototype.has=Qo,yr.prototype.set=nf;function br(T){var M=-1,_=T==null?0:T.length;for(this.__data__=new yr;++M<_;)this.add(T[M])}function al(T){return this.__data__.set(T,i),this}function of(T){return this.__data__.has(T)}br.prototype.add=br.prototype.push=al,br.prototype.has=of;function Vi(T){var M=this.__data__=new xe(T);this.size=M.size}function af(){this.__data__=new xe,this.size=0}function hl(T){var M=this.__data__,_=M.delete(T);return this.size=M.size,_}function hf(T){return this.__data__.get(T)}function lf(T){return this.__data__.has(T)}function cf(T,M){var _=this.__data__;if(_ instanceof xe){var E=_.__data__;if(!Ve||E.length<e-1)return E.push([T,M]),this.size=++_.size,this;_=this.__data__=new yr(E)}return _.set(T,M),this.size=_.size,this}Vi.prototype.clear=af,Vi.prototype.delete=hl,Vi.prototype.get=hf,Vi.prototype.has=lf,Vi.prototype.set=cf;function uf(T,M){var _=Wn(T),E=!_&&ea(T),L=!_&&!E&&Us(T),X=!_&&!E&&!L&&yl(T),ct=_||E||L||X,yt=ct?ri(T.length,String):[],_t=yt.length;for(var ht in T)(M||Ze.call(T,ht))&&!(ct&&(ht=="length"||L&&(ht=="offset"||ht=="parent")||X&&(ht=="buffer"||ht=="byteLength"||ht=="byteOffset")||ta(ht,_t)))&&yt.push(ht);return yt}function Dn(T,M){for(var _=T.length;_--;)if(Un(T[_][0],M))return _;return-1}function df(T,M,_){var E=M(T);return Wn(T)?E:Dt(E,_(T))}function Bs(T){return T==null?T===void 0?R:y:Zi&&Zi in Object(T)?gf(T):Bn(T)}function ll(T){return jr(T)&&Bs(T)==a}function cl(T,M,_,E,L){return T===M?!0:T==null||M==null||!jr(T)&&!jr(M)?T!==T&&M!==M:ff(T,M,_,E,cl,L)}function ff(T,M,_,E,L,X){var ct=Wn(T),yt=Wn(M),_t=ct?h:Hi(T),ht=yt?h:Hi(M);_t=_t==a?x:_t,ht=ht==a?x:ht;var vt=_t==x,Ut=ht==x,Lt=_t==ht;if(Lt&&Us(T)){if(!Us(M))return!1;ct=!0,vt=!1}if(Lt&&!vt)return X||(X=new Vi),ct||yl(T)?ul(T,M,_,E,L,X):dl(T,M,_t,_,E,L,X);if(!(_&s)){var de=vt&&Ze.call(T,"__wrapped__"),_e=Ut&&Ze.call(M,"__wrapped__");if(de||_e){var si=de?T.value():T,ni=_e?M.value():M;return X||(X=new Vi),L(si,ni,_,E,X)}}return Lt?(X||(X=new Vi),mf(T,M,_,E,L,X)):!1}function kn(T){if(!gl(T)||xf(T))return!1;var M=Ki(T)?il:tt;return M.test(bi(T))}function qo(T){return jr(T)&&zr(T.length)&&!!ot[Bs(T)]}function pf(T){if(!_f(T))return ks(T);var M=[];for(var _ in Object(T))Ze.call(T,_)&&_!="constructor"&&M.push(_);return M}function ul(T,M,_,E,L,X){var ct=_&s,yt=T.length,_t=M.length;if(yt!=_t&&!(ct&&_t>yt))return!1;var ht=X.get(T);if(ht&&X.get(M))return ht==M;var vt=-1,Ut=!0,Lt=_&n?new br:void 0;for(X.set(T,M),X.set(M,T);++vt<yt;){var de=T[vt],_e=M[vt];if(E)var si=ct?E(_e,de,vt,M,T,X):E(de,_e,vt,T,M,X);if(si!==void 0){if(si)continue;Ut=!1;break}if(Lt){if(!Ee(M,function(ni,Ws){if(!Kr(Lt,Ws)&&(de===ni||L(de,ni,_,E,X)))return Lt.push(Ws)})){Ut=!1;break}}else if(!(de===_e||L(de,_e,_,E,X))){Ut=!1;break}}return X.delete(T),X.delete(M),Ut}function dl(T,M,_,E,L,X,ct){switch(_){case N:if(T.byteLength!=M.byteLength||T.byteOffset!=M.byteOffset)return!1;T=T.buffer,M=M.buffer;case G:return!(T.byteLength!=M.byteLength||!X(new Xi(T),new Xi(M)));case c:case u:case g:return Un(+T,+M);case d:return T.name==M.name&&T.message==M.message;case w:case C:return T==M+"";case m:var yt=Ns;case S:var _t=E&s;if(yt||(yt=tl),T.size!=M.size&&!_t)return!1;var ht=ct.get(T);if(ht)return ht==M;E|=n,ct.set(T,M);var vt=ul(yt(T),yt(M),E,L,X,ct);return ct.delete(T),vt;case I:if(Jo)return Jo.call(T)==Jo.call(M)}return!1}function mf(T,M,_,E,L,X){var ct=_&s,yt=fl(T),_t=yt.length,ht=fl(M),vt=ht.length;if(_t!=vt&&!ct)return!1;for(var Ut=_t;Ut--;){var Lt=yt[Ut];if(!(ct?Lt in M:Ze.call(M,Lt)))return!1}var de=X.get(T);if(de&&X.get(M))return de==M;var _e=!0;X.set(T,M),X.set(M,T);for(var si=ct;++Ut<_t;){Lt=yt[Ut];var ni=T[Lt],Ws=M[Lt];if(E)var Qb=ct?E(Ws,ni,Lt,M,T,X):E(ni,Ws,Lt,T,M,X);if(!(Qb===void 0?ni===Ws||L(ni,Ws,_,E,X):Qb)){_e=!1;break}si||(si=Lt=="constructor")}if(_e&&!si){var xl=T.constructor,_l=M.constructor;xl!=_l&&"constructor"in T&&"constructor"in M&&!(typeof xl=="function"&&xl instanceof xl&&typeof _l=="function"&&_l instanceof _l)&&(_e=!1)}return X.delete(T),X.delete(M),_e}function fl(T){return df(T,bl,yf)}function On(T,M){var _=T.__data__;return bf(M)?_[typeof M=="string"?"string":"hash"]:_.map}function xr(T,M){var _=Fs(T,M);return kn(_)?_:void 0}function gf(T){var M=Ze.call(T,Zi),_=T[Zi];try{T[Zi]=void 0;var E=!0}catch{}var L=Ho.call(T);return E&&(M?T[Zi]=_:delete T[Zi]),L}var yf=sl?function(T){return T==null?[]:(T=Object(T),It(sl(T),function(M){return Ds.call(T,M)}))}:vf,Hi=Bs;(Ko&&Hi(new Ko(new ArrayBuffer(1)))!=N||Ve&&Hi(new Ve)!=m||Yo&&Hi(Yo.resolve())!=b||zo&&Hi(new zo)!=S||jo&&Hi(new jo)!=P)&&(Hi=function(T){var M=Bs(T),_=M==x?T.constructor:void 0,E=_?bi(_):"";if(E)switch(E){case Zd:return N;case yi:return m;case Vd:return b;case Hd:return S;case Kd:return P}return M});function ta(T,M){return M=M??o,!!M&&(typeof T=="number"||ft.test(T))&&T>-1&&T%1==0&&T<M}function bf(T){var M=typeof T;return M=="string"||M=="number"||M=="symbol"||M=="boolean"?T!=="__proto__":T===null}function xf(T){return!!Vo&&Vo in T}function _f(T){var M=T&&T.constructor,_=typeof M=="function"&&M.prototype||Gn;return T===_}function Bn(T){return Ho.call(T)}function bi(T){if(T!=null){try{return Zo.call(T)}catch{}try{return T+""}catch{}}return""}function Un(T,M){return T===M||T!==T&&M!==M}var ea=ll(function(){return arguments}())?ll:function(T){return jr(T)&&Ze.call(T,"callee")&&!Ds.call(T,"callee")},Wn=Array.isArray;function pl(T){return T!=null&&zr(T.length)&&!Ki(T)}var Us=nl||wf;function ml(T,M){return cl(T,M)}function Ki(T){if(!gl(T))return!1;var M=Bs(T);return M==f||M==p||M==l||M==v}function zr(T){return typeof T=="number"&&T>-1&&T%1==0&&T<=o}function gl(T){var M=typeof T;return T!=null&&(M=="object"||M=="function")}function jr(T){return T!=null&&typeof T=="object"}var yl=ut?Xo(ut):qo;function bl(T){return pl(T)?uf(T):pf(T)}function vf(){return[]}function wf(){return!1}r.exports=ml}(Ih,Ih.exports);var OC=Ih.exports;const uy=Vs(OC);var BC=Object.defineProperty,UC=(r,t,e)=>t in r?BC(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,W=(r,t,e)=>(UC(r,typeof t!="symbol"?t+"":t,e),e);class qe{constructor(t){W(this,"parent"),W(this,"paused"),this.parent=t,this.paused=!1}destroy(){}down(t){return!1}move(t){return!1}up(t){return!1}wheel(t){return!1}update(t){}resize(){}reset(){}pause(){this.paused=!0}resume(){this.paused=!1}}var WC=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},dy={exports:{}};(function(r,t){(function(){var e,i;i=function(s){return r.exports=s},e={linear:function(s,n,o,a){return o*s/a+n},easeInQuad:function(s,n,o,a){return o*(s/=a)*s+n},easeOutQuad:function(s,n,o,a){return-o*(s/=a)*(s-2)+n},easeInOutQuad:function(s,n,o,a){return(s/=a/2)<1?o/2*s*s+n:-o/2*(--s*(s-2)-1)+n},easeInCubic:function(s,n,o,a){return o*(s/=a)*s*s+n},easeOutCubic:function(s,n,o,a){return o*((s=s/a-1)*s*s+1)+n},easeInOutCubic:function(s,n,o,a){return(s/=a/2)<1?o/2*s*s*s+n:o/2*((s-=2)*s*s+2)+n},easeInQuart:function(s,n,o,a){return o*(s/=a)*s*s*s+n},easeOutQuart:function(s,n,o,a){return-o*((s=s/a-1)*s*s*s-1)+n},easeInOutQuart:function(s,n,o,a){return(s/=a/2)<1?o/2*s*s*s*s+n:-o/2*((s-=2)*s*s*s-2)+n},easeInQuint:function(s,n,o,a){return o*(s/=a)*s*s*s*s+n},easeOutQuint:function(s,n,o,a){return o*((s=s/a-1)*s*s*s*s+1)+n},easeInOutQuint:function(s,n,o,a){return(s/=a/2)<1?o/2*s*s*s*s*s+n:o/2*((s-=2)*s*s*s*s+2)+n},easeInSine:function(s,n,o,a){return-o*Math.cos(s/a*(Math.PI/2))+o+n},easeOutSine:function(s,n,o,a){return o*Math.sin(s/a*(Math.PI/2))+n},easeInOutSine:function(s,n,o,a){return-o/2*(Math.cos(Math.PI*s/a)-1)+n},easeInExpo:function(s,n,o,a){return s===0?n:o*Math.pow(2,10*(s/a-1))+n},easeOutExpo:function(s,n,o,a){return s===a?n+o:o*(-Math.pow(2,-10*s/a)+1)+n},easeInOutExpo:function(s,n,o,a){return(s/=a/2)<1?o/2*Math.pow(2,10*(s-1))+n:o/2*(-Math.pow(2,-10*--s)+2)+n},easeInCirc:function(s,n,o,a){return-o*(Math.sqrt(1-(s/=a)*s)-1)+n},easeOutCirc:function(s,n,o,a){return o*Math.sqrt(1-(s=s/a-1)*s)+n},easeInOutCirc:function(s,n,o,a){return(s/=a/2)<1?-o/2*(Math.sqrt(1-s*s)-1)+n:o/2*(Math.sqrt(1-(s-=2)*s)+1)+n},easeInElastic:function(s,n,o,a){var h,l,c;return c=1.70158,l=0,h=o,s===0||(s/=a),l||(l=a*.3),h<Math.abs(o)?(h=o,c=l/4):c=l/(2*Math.PI)*Math.asin(o/h),-(h*Math.pow(2,10*(s-=1))*Math.sin((s*a-c)*(2*Math.PI)/l))+n},easeOutElastic:function(s,n,o,a){var h,l,c;return c=1.70158,l=0,h=o,s===0||(s/=a),l||(l=a*.3),h<Math.abs(o)?(h=o,c=l/4):c=l/(2*Math.PI)*Math.asin(o/h),h*Math.pow(2,-10*s)*Math.sin((s*a-c)*(2*Math.PI)/l)+o+n},easeInOutElastic:function(s,n,o,a){var h,l,c;return c=1.70158,l=0,h=o,s===0||(s/=a/2),l||(l=a*(.3*1.5)),h<Math.abs(o)?(h=o,c=l/4):c=l/(2*Math.PI)*Math.asin(o/h),s<1?-.5*(h*Math.pow(2,10*(s-=1))*Math.sin((s*a-c)*(2*Math.PI)/l))+n:h*Math.pow(2,-10*(s-=1))*Math.sin((s*a-c)*(2*Math.PI)/l)*.5+o+n},easeInBack:function(s,n,o,a,h){return h===void 0&&(h=1.70158),o*(s/=a)*s*((h+1)*s-h)+n},easeOutBack:function(s,n,o,a,h){return h===void 0&&(h=1.70158),o*((s=s/a-1)*s*((h+1)*s+h)+1)+n},easeInOutBack:function(s,n,o,a,h){return h===void 0&&(h=1.70158),(s/=a/2)<1?o/2*(s*s*(((h*=1.525)+1)*s-h))+n:o/2*((s-=2)*s*(((h*=1.525)+1)*s+h)+2)+n},easeInBounce:function(s,n,o,a){var h;return h=e.easeOutBounce(a-s,0,o,a),o-h+n},easeOutBounce:function(s,n,o,a){return(s/=a)<1/2.75?o*(7.5625*s*s)+n:s<2/2.75?o*(7.5625*(s-=1.5/2.75)*s+.75)+n:s<2.5/2.75?o*(7.5625*(s-=2.25/2.75)*s+.9375)+n:o*(7.5625*(s-=2.625/2.75)*s+.984375)+n},easeInOutBounce:function(s,n,o,a){var h;return s<a/2?(h=e.easeInBounce(s*2,0,o,a),h*.5+n):(h=e.easeOutBounce(s*2-a,0,o,a),h*.5+o*.5+n)}},i(e)}).call(WC)})(dy);const fy=dy.exports;function Ah(r,t){if(r){if(typeof r=="function")return r;if(typeof r=="string")return fy[r]}else return fy[t]}const XC={removeOnInterrupt:!1,ease:"linear",time:1e3};class ZC extends qe{constructor(t,e={}){super(t),W(this,"options"),W(this,"startX"),W(this,"startY"),W(this,"deltaX"),W(this,"deltaY"),W(this,"keepCenter"),W(this,"startWidth",null),W(this,"startHeight",null),W(this,"deltaWidth",null),W(this,"deltaHeight",null),W(this,"width",null),W(this,"height",null),W(this,"time",0),this.options=Object.assign({},XC,e),this.options.ease=Ah(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(t){if(this.paused)return;this.time+=t;const e=new dt(this.parent.scale.x,this.parent.scale.y);if(this.time>=this.options.time){const i=this.parent.width,s=this.parent.height;this.complete(),(i!==this.parent.width||s!==this.parent.height)&&this.parent.emit("zoomed",{viewport:this.parent,original:e,type:"animate"})}else{const i=this.options.ease(this.time,0,1,this.options.time);if(this.width!==null){const s=this.startWidth,n=this.deltaWidth;this.parent.fitWidth(s+n*i,this.keepCenter,this.height===null)}if(this.height!==null){const s=this.startHeight,n=this.deltaHeight;this.parent.fitHeight(s+n*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 s=this.startX,n=this.startY,o=this.deltaX,a=this.deltaY,h=new dt(this.parent.x,this.parent.y);this.parent.moveCenter(s+o*i,n+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:e,type:"animate"})}}}const VC={sides:"all",friction:.5,time:150,ease:"easeInOutSine",underflow:"center",bounceBox:null};class HC extends qe{constructor(t,e={}){super(t),W(this,"options"),W(this,"left"),W(this,"top"),W(this,"right"),W(this,"bottom"),W(this,"underflowX"),W(this,"underflowY"),W(this,"ease"),W(this,"toX"),W(this,"toY"),this.options=Object.assign({},VC,e),this.ease=Ah(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(t){if(!this.paused){if(this.bounce(),this.toX){const e=this.toX;e.time+=t,this.parent.emit("moved",{viewport:this.parent,type:"bounce-x"}),e.time>=this.options.time?(this.parent.x=e.end,this.toX=null,this.parent.emit("bounce-x-end",this.parent)):this.parent.x=this.ease(e.time,e.start,e.delta,this.options.time)}if(this.toY){const e=this.toY;e.time+=t,this.parent.emit("moved",{viewport:this.parent,type:"bounce-y"}),e.time>=this.options.time?(this.parent.y=e.end,this.toY=null,this.parent.emit("bounce-y-end",this.parent)):this.parent.y=this.ease(e.time,e.start,e.delta,this.options.time)}}}calcUnderflowX(){let t;switch(this.underflowX){case-1:t=0;break;case 1:t=this.parent.screenWidth-this.parent.screenWorldWidth;break;default:t=(this.parent.screenWidth-this.parent.screenWorldWidth)/2}return t}calcUnderflowY(){let t;switch(this.underflowY){case-1:t=0;break;case 1:t=this.parent.screenHeight-this.parent.screenWorldHeight;break;default:t=(this.parent.screenHeight-this.parent.screenWorldHeight)/2}return t}oob(){const t=this.options.bounceBox;if(t){const e=typeof t.x>"u"?0:t.x,i=typeof t.y>"u"?0:t.y,s=typeof t.width>"u"?this.parent.worldWidth:t.width,n=typeof t.height>"u"?this.parent.worldHeight:t.height;return{left:this.parent.left<e,right:this.parent.right>s,top:this.parent.top<i,bottom:this.parent.bottom>n,topLeft:new dt(e*this.parent.scale.x,i*this.parent.scale.y),bottomRight:new dt(s*this.parent.scale.x-this.parent.screenWidth,n*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 dt(0,0),bottomRight:new dt(this.parent.worldWidth*this.parent.scale.x-this.parent.screenWidth,this.parent.worldHeight*this.parent.scale.y-this.parent.screenHeight)}}bounce(){var t,e;if(this.paused)return;let i,s=this.parent.plugins.get("decelerate",!0);s&&(s.x||s.y)&&(s.x&&s.percentChangeX===((t=s.options)==null?void 0:t.friction)||s.y&&s.percentChangeY===((e=s.options)==null?void 0:e.friction))&&(i=this.oob(),(i.left&&this.left||i.right&&this.right)&&(s.percentChangeX=this.options.friction),(i.top&&this.top||i.bottom&&this.bottom)&&(s.percentChangeY=this.options.friction));const n=this.parent.plugins.get("drag",!0)||{},o=this.parent.plugins.get("pinch",!0)||{};if(s=s||{},!(n!=null&&n.active)&&!(o!=null&&o.active)&&(!this.toX||!this.toY)&&(!s.x||!s.y)){i=i||this.oob();const a=i.topLeft,h=i.bottomRight;if(!this.toX&&!s.x){let l=null;i.left&&this.left?l=this.parent.screenWorldWidth<this.parent.screenWidth?this.calcUnderflowX():-a.x:i.right&&this.right&&(l=this.parent.screenWorldWidth<this.parent.screenWidth?this.calcUnderflowX():-h.x),l!==null&&this.parent.x!==l&&(this.toX={time:0,start:this.parent.x,delta:l-this.parent.x,end:l},this.parent.emit("bounce-x-start",this.parent))}if(!this.toY&&!s.y){let l=null;i.top&&this.top?l=this.parent.screenWorldHeight<this.parent.screenHeight?this.calcUnderflowY():-a.y:i.bottom&&this.bottom&&(l=this.parent.screenWorldHeight<this.parent.screenHeight?this.calcUnderflowY():-h.y),l!==null&&this.parent.y!==l&&(this.toY={time:0,start:this.parent.y,delta:l-this.parent.y,end:l},this.parent.emit("bounce-y-start",this.parent))}}}reset(){this.toX=this.toY=null,this.bounce()}}const KC={left:!1,right:!1,top:!1,bottom:!1,direction:null,underflow:"center"};class YC extends qe{constructor(t,e={}){super(t),W(this,"options"),W(this,"last"),W(this,"noUnderflow"),W(this,"underflowX"),W(this,"underflowY"),this.options=Object.assign({},KC,e),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 t=this.options.underflow.toLowerCase();t==="none"?this.noUnderflow=!0:t==="center"?(this.underflowX=this.underflowY=0,this.noUnderflow=!1):(this.underflowX=t.indexOf("left")!==-1?-1:t.indexOf("right")!==-1?1:0,this.underflowY=t.indexOf("top")!==-1?-1:t.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 t=new dt(this.parent.x,this.parent.y),e=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,e.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,e.x=0,i=!0);i&&this.parent.emit("moved",{viewport:this.parent,original:t,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,e.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,e.y=0,i=!0);i&&this.parent.emit("moved",{viewport:this.parent,original:t,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 zC={minWidth:null,minHeight:null,maxWidth:null,maxHeight:null,minScale:null,maxScale:null};class jC extends qe{constructor(t,e={}){super(t),W(this,"options"),this.options=Object.assign({},zC,e),this.clamp()}resize(){this.clamp()}clamp(){if(!this.paused){if(this.options.minWidth||this.options.minHeight||this.options.maxWidth||this.options.maxHeight){let t=this.parent.worldScreenWidth,e=this.parent.worldScreenHeight;if(this.options.minWidth!==null&&t<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,t=this.parent.worldScreenWidth,e=this.parent.worldScreenHeight,this.parent.emit("zoomed",{viewport:this.parent,type:"clamp-zoom"})}if(this.options.maxWidth!==null&&t>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,t=this.parent.worldScreenWidth,e=this.parent.worldScreenHeight,this.parent.emit("zoomed",{viewport:this.parent,type:"clamp-zoom"})}if(this.options.minHeight!==null&&e<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,t=this.parent.worldScreenWidth,e=this.parent.worldScreenHeight,this.parent.emit("zoomed",{viewport:this.parent,type:"clamp-zoom"})}if(this.options.maxHeight!==null&&e>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 t={x:null,y:null},e={x:null,y:null};if(typeof this.options.minScale=="number")t.x=this.options.minScale,t.y=this.options.minScale;else if(this.options.minScale!==null){const n=this.options.minScale;t.x=typeof n.x>"u"?null:n.x,t.y=typeof n.y>"u"?null:n.y}if(typeof this.options.maxScale=="number")e.x=this.options.maxScale,e.y=this.options.maxScale;else if(this.options.maxScale!==null){const n=this.options.maxScale;e.x=typeof n.x>"u"?null:n.x,e.y=typeof n.y>"u"?null:n.y}let i=this.parent.scale.x,s=this.parent.scale.y;t.x!==null&&i<t.x&&(i=t.x),e.x!==null&&i>e.x&&(i=e.x),t.y!==null&&s<t.y&&(s=t.y),e.y!==null&&s>e.y&&(s=e.y),(i!==this.parent.scale.x||s!==this.parent.scale.y)&&(this.parent.scale.set(i,s),this.parent.emit("zoomed",{viewport:this.parent,type:"clamp-zoom"}))}}}reset(){this.clamp()}}const JC={friction:.98,bounce:.8,minSpeed:.01},Zr=16;class $C extends qe{constructor(t,e={}){super(t),W(this,"options"),W(this,"x"),W(this,"y"),W(this,"percentChangeX"),W(this,"percentChangeY"),W(this,"saved"),W(this,"timeSinceRelease"),this.options=Object.assign({},JC,e),this.saved=[],this.timeSinceRelease=0,this.reset(),this.parent.on("moved",i=>this.handleMoved(i))}down(){return this.saved=[],this.x=this.y=null,!1}isActive(){return!!(this.x||this.y)}move(){if(this.paused)return!1;const t=this.parent.input.count();return(t===1||t>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}handleMoved(t){if(this.saved.length){const e=this.saved[this.saved.length-1];t.type==="clamp-x"&&t.original?e.x===t.original.x&&(e.x=this.parent.x):t.type==="clamp-y"&&t.original&&e.y===t.original.y&&(e.y=this.parent.y)}}up(){if(this.parent.input.count()===0&&this.saved.length){const t=performance.now();for(const e of this.saved)if(e.time>=t-100){const i=t-e.time;this.x=(this.parent.x-e.x)/i,this.y=(this.parent.y-e.y)/i,this.percentChangeX=this.percentChangeY=this.options.friction,this.timeSinceRelease=0;break}}return!1}activate(t){t=t||{},typeof t.x<"u"&&(this.x=t.x,this.percentChangeX=this.options.friction),typeof t.y<"u"&&(this.y=t.y,this.percentChangeY=this.options.friction)}update(t){if(this.paused)return;const e=this.x||this.y,i=this.timeSinceRelease,s=this.timeSinceRelease+t;if(this.x){const n=this.percentChangeX,o=Math.log(n);this.parent.x+=this.x*Zr/o*(Math.pow(n,s/Zr)-Math.pow(n,i/Zr)),this.x*=Math.pow(this.percentChangeX,t/Zr)}if(this.y){const n=this.percentChangeY,o=Math.log(n);this.parent.y+=this.y*Zr/o*(Math.pow(n,s/Zr)-Math.pow(n,i/Zr)),this.y*=Math.pow(this.percentChangeY,t/Zr)}this.timeSinceRelease+=t,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)),e&&this.parent.emit("moved",{viewport:this.parent,type:"decelerate"})}reset(){this.x=this.y=null}}const QC={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 qC extends qe{constructor(t,e={}){super(t),W(this,"options"),W(this,"moved"),W(this,"reverse"),W(this,"xDirection"),W(this,"yDirection"),W(this,"keyIsPressed"),W(this,"mouse"),W(this,"underflowX"),W(this,"underflowY"),W(this,"last"),W(this,"current"),W(this,"windowEventHandlers",[]),this.options=Object.assign({},QC,e),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(t){const e=s=>{t.includes(s.code)&&(this.keyIsPressed=!0)},i=s=>{t.includes(s.code)&&(this.keyIsPressed=!1)};this.addWindowEventHandler("keyup",i),this.addWindowEventHandler("keydown",e)}addWindowEventHandler(t,e){window.addEventListener(t,e),this.windowEventHandlers.push({event:t,handler:e})}destroy(){this.windowEventHandlers.forEach(({event:t,handler:e})=>{window.removeEventListener(t,e)})}mouseButtons(t){!t||t==="all"?this.mouse=[!0,!0,!0]:this.mouse=[t.indexOf("left")!==-1,t.indexOf("middle")!==-1,t.indexOf("right")!==-1]}parseUnderflow(){const t=this.options.underflow.toLowerCase();t==="center"?(this.underflowX=0,this.underflowY=0):(t.includes("left")?this.underflowX=-1:t.includes("right")?this.underflowX=1:this.underflowX=0,t.includes("top")?this.underflowY=-1:t.includes("bottom")?this.underflowY=1:this.underflowY=0)}checkButtons(t){const e=t.pointerType==="mouse",i=this.parent.input.count();return!!((i===1||i>1&&!this.parent.plugins.get("pinch",!0))&&(!e||this.mouse[t.button]))}checkKeyPress(t){return!this.options.keyToPress||this.keyIsPressed||this.options.ignoreKeyToPressOnTouch&&t.data.pointerType==="touch"}down(t){return this.paused||!this.options.pressDrag?!1:this.checkButtons(t)&&this.checkKeyPress(t)?(this.last={x:t.global.x,y:t.global.y},this.current=t.pointerId,!0):(this.last=null,!1)}get active(){return this.moved}move(t){if(this.paused||!this.options.pressDrag)return!1;if(this.last&&this.current===t.data.pointerId){const e=t.global.x,i=t.global.y,s=this.parent.input.count();if(s===1||s>1&&!this.parent.plugins.get("pinch",!0)){const n=e-this.last.x,o=i-this.last.y;if(this.moved||this.xDirection&&this.parent.input.checkThreshold(n)||this.yDirection&&this.parent.input.checkThreshold(o)){const a={x:e,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:t,screen:new dt(this.last.x,this.last.y),world:this.parent.toWorld(new dt(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(t){if(this.paused)return!1;const e=this.parent.input.touches;if(e.length===1){const i=e[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 dt(this.last.x,this.last.y);return this.parent.emit("drag-end",{event:t,screen:i,world:this.parent.toWorld(i),viewport:this.parent}),this.last=null,this.moved=!1,!0}return!1}wheel(t){if(this.paused)return!1;if(this.options.wheel){const e=this.parent.plugins.get("wheel",!0);if(!e||!e.options.wheelZoom&&!t.ctrlKey){const i=t.deltaMode?this.options.lineHeight:1,s=[t.deltaX,t.deltaY],[n,o]=this.options.wheelSwapAxes?s.reverse():s;return this.xDirection&&(this.parent.x+=n*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||t.preventDefault(),this.parent.options.stopPropagation&&t.stopPropagation(),!0}}return!1}resume(){this.last=null,this.paused=!1}clamp(){const t=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,t.x=0):this.parent.right>this.parent.worldWidth&&(this.parent.x=-this.parent.worldWidth*this.parent.scale.x+this.parent.screenWidth,t.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,t.y=0),this.parent.bottom>this.parent.worldHeight&&(this.parent.y=-this.parent.worldHeight*this.parent.scale.y+this.parent.screenHeight,t.y=0)}}const tI={speed:0,acceleration:null,radius:null};class eI extends qe{constructor(t,e,i={}){super(t),W(this,"options"),W(this,"target"),W(this,"velocity"),this.target=e,this.options=Object.assign({},tI,i),this.velocity={x:0,y:0}}update(t){if(this.paused)return;const e=this.parent.center;let i=this.target.x,s=this.target.y;if(this.options.radius)if(Math.sqrt(Math.pow(this.target.y-e.y,2)+Math.pow(this.target.x-e.x,2))>this.options.radius){const a=Math.atan2(this.target.y-e.y,this.target.x-e.x);i=this.target.x-Math.cos(a)*this.options.radius,s=this.target.y-Math.sin(a)*this.options.radius}else return;const n=i-e.x,o=s-e.y;if(n||o)if(this.options.speed)if(this.options.acceleration){const a=Math.atan2(s-e.y,i-e.x),h=Math.sqrt(Math.pow(n,2)+Math.pow(o,2));if(h){const l=(Math.pow(this.velocity.x,2)+Math.pow(this.velocity.y,2))/(2*this.options.acceleration);h>l?this.velocity={x:Math.min(this.velocity.x+(this.options.acceleration*t,this.options.speed)),y:Math.min(this.velocity.y+(this.options.acceleration*t,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 c=Math.cos(a)*this.velocity.x,u=Math.sin(a)*this.velocity.y,d=Math.abs(c)>Math.abs(n)?i:e.x+c,f=Math.abs(u)>Math.abs(o)?s:e.y+u;this.parent.moveCenter(d,f),this.parent.emit("moved",{viewport:this.parent,type:"follow"})}}else{const a=Math.atan2(s-e.y,i-e.x),h=Math.cos(a)*this.options.speed,l=Math.sin(a)*this.options.speed,c=Math.abs(h)>Math.abs(n)?i:e.x+h,u=Math.abs(l)>Math.abs(o)?s:e.y+l;this.parent.moveCenter(c,u),this.parent.emit("moved",{viewport:this.parent,type:"follow"})}else this.parent.moveCenter(i,s),this.parent.emit("moved",{viewport:this.parent,type:"follow"})}}const iI={radius:null,distance:null,top:null,bottom:null,left:null,right:null,speed:8,reverse:!1,noDecelerate:!1,linear:!1,allowButtons:!1};class rI extends qe{constructor(t,e={}){super(t),W(this,"options"),W(this,"reverse"),W(this,"radiusSquared"),W(this,"left"),W(this,"top"),W(this,"right"),W(this,"bottom"),W(this,"horizontal"),W(this,"vertical"),this.options=Object.assign({},iI,e),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 t=this.options.distance;t!==null?(this.left=t,this.top=t,this.right=this.parent.screenWidth-t,this.bottom=this.parent.screenHeight-t):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(t){if(this.paused||t.pointerType!=="mouse"&&t.pointerId!==1||!this.options.allowButtons&&t.buttons!==0)return!1;const e=t.global.x,i=t.global.y;if(this.radiusSquared){const s=this.parent.toScreen(this.parent.center);if(Math.pow(s.x-e,2)+Math.pow(s.y-i,2)>=this.radiusSquared){const n=Math.atan2(s.y-i,s.x-e);this.options.linear?(this.horizontal=Math.round(Math.cos(n))*this.options.speed*this.reverse*(60/1e3),this.vertical=Math.round(Math.sin(n))*this.options.speed*this.reverse*(60/1e3)):(this.horizontal=Math.cos(n)*this.options.speed*this.reverse*(60/1e3),this.vertical=Math.sin(n)*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&&e<this.left?this.horizontal=Number(this.reverse)*this.options.speed*(60/1e3):this.right!==null&&e>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 t=this.parent.plugins.get("decelerate",!0);this.horizontal&&t&&!this.options.noDecelerate&&t.activate({x:this.horizontal*this.options.speed*this.reverse/(1e3/60)})}decelerateVertical(){const t=this.parent.plugins.get("decelerate",!0);this.vertical&&t&&!this.options.noDecelerate&&t.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 t=this.parent.center;this.horizontal&&(t.x+=this.horizontal*this.options.speed),this.vertical&&(t.y+=this.vertical*this.options.speed),this.parent.moveCenter(t),this.parent.emit("moved",{viewport:this.parent,type:"mouse-edges"})}}}const sI={noDrag:!1,percent:1,center:null,factor:1,axis:"all"};class nI extends qe{constructor(t,e={}){super(t),W(this,"options"),W(this,"active",!1),W(this,"pinching",!1),W(this,"moved",!1),W(this,"lastCenter"),this.options=Object.assign({},sI,e)}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(t){if(this.paused||!this.active)return!1;const e=t.global.x,i=t.global.y,s=this.parent.input.touches;if(s.length>=2){const n=s[0],o=s[1],a=n.last&&o.last?Math.sqrt(Math.pow(o.last.x-n.last.x,2)+Math.pow(o.last.y-n.last.y,2)):null;if(n.id===t.pointerId?n.last={x:e,y:i,data:t}:o.id===t.pointerId&&(o.last={x:e,y:i,data:t}),a){let h;const l=new dt(n.last.x+(o.last.x-n.last.x)/2,n.last.y+(o.last.y-n.last.y)/2);this.options.center||(h=this.parent.toLocal(l));let c=Math.sqrt(Math.pow(o.last.x-n.last.x,2)+Math.pow(o.last.y-n.last.y,2));c=c===0?c=1e-10:c;const u=(1-a/c)*this.options.percent*(this.isAxisX()?this.parent.scale.x:this.parent.scale.y);this.isAxisX()&&(this.parent.scale.x+=u),this.isAxisY()&&(this.parent.scale.y+=u),this.parent.emit("zoomed",{viewport:this.parent,type:"pinch",center:l});const d=this.parent.plugins.get("clamp-zoom",!0);if(d&&d.clamp(),this.options.center)this.parent.moveCenter(this.options.center);else{const f=this.parent.toGlobal(h);this.parent.x+=(l.x-f.x)*this.options.factor,this.parent.y+=(l.y-f.y)*this.options.factor,this.parent.emit("moved",{viewport:this.parent,type:"pinch"})}!this.options.noDrag&&this.lastCenter&&(this.parent.x+=(l.x-this.lastCenter.x)*this.options.factor,this.parent.y+=(l.y-this.lastCenter.y)*this.options.factor,this.parent.emit("moved",{viewport:this.parent,type:"pinch"})),this.lastCenter=l,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 oI={topLeft:!1,friction:.8,time:1e3,ease:"easeInOutSine",interrupt:!0,removeOnComplete:!1,removeOnInterrupt:!1,forceStart:!1};class aI extends qe{constructor(t,e,i,s={}){super(t),W(this,"options"),W(this,"ease"),W(this,"x"),W(this,"y"),W(this,"percent"),W(this,"snapping"),W(this,"deltaX"),W(this,"deltaY"),W(this,"startX"),W(this,"startY"),this.options=Object.assign({},oI,s),this.ease=Ah(s.ease,"easeInOutSine"),this.x=e,this.y=i,this.options.forceStart&&this.snapStart()}snapStart(){this.percent=0,this.snapping={time:0};const t=this.options.topLeft?this.parent.corner:this.parent.center;this.deltaX=this.x-t.x,this.deltaY=this.y-t.y,this.startX=t.x,this.startY=t.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 t=this.parent.plugins.get("decelerate",!0);t&&(t.x||t.y)&&(t.percentChangeX=t.percentChangeY=this.options.friction)}return!1}update(t){if(!this.paused&&!(this.options.interrupt&&this.parent.input.count()!==0))if(this.snapping){const e=this.snapping;e.time+=t;let i,s,n;const o=this.startX,a=this.startY,h=this.deltaX,l=this.deltaY;if(e.time>this.options.time)i=!0,s=o+h,n=a+l;else{const c=this.ease(e.time,0,1,this.options.time);s=o+h*c,n=a+l*c}this.options.topLeft?this.parent.moveCorner(s,n):this.parent.moveCenter(s,n),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 e=this.options.topLeft?this.parent.corner:this.parent.center;(e.x!==this.x||e.y!==this.y)&&this.snapStart()}}}const hI={width:0,height:0,time:1e3,ease:"easeInOutSine",center:null,interrupt:!0,removeOnComplete:!1,removeOnInterrupt:!1,forceStart:!1,noMove:!1};class lI extends qe{constructor(t,e={}){super(t),W(this,"options"),W(this,"ease"),W(this,"xScale"),W(this,"yScale"),W(this,"xIndependent"),W(this,"yIndependent"),W(this,"snapping"),this.options=Object.assign({},hI,e),this.ease=Ah(this.options.ease),this.xIndependent=!1,this.yIndependent=!1,this.xScale=0,this.yScale=0,this.options.width>0&&(this.xScale=t.screenWidth/this.options.width,this.xIndependent=!0),this.options.height>0&&(this.yScale=t.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?(t.container.scale.x=this.xScale,t.container.scale.y=this.yScale,this.options.removeOnComplete&&this.parent.plugins.remove("snap-zoom")):e.forceStart&&this.createSnapping()}createSnapping(){const t=this.parent.worldScreenWidth,e=this.parent.worldScreenHeight,i=this.parent.screenWidth/this.xScale,s=this.parent.screenHeight/this.yScale;this.snapping={time:0,startX:t,startY:e,deltaX:i-t,deltaY:s-e},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(t){if(this.paused||this.options.interrupt&&this.parent.input.count()!==0)return;let e;if(!this.options.center&&!this.options.noMove&&(e=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+=t,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 n=this.snapping,o=this.ease(n.time,n.startX,n.deltaX,this.options.time),a=this.ease(n.time,n.startY,n.deltaY,this.options.time);this.parent.scale.x=this.parent.screenWidth/o,this.parent.scale.y=this.parent.screenHeight/a}const s=this.parent.plugins.get("clamp-zoom",!0);s&&s.clamp(),this.options.noMove||(this.options.center?this.parent.moveCenter(this.options.center):this.parent.moveCenter(e))}}resume(){this.snapping=null,super.resume()}}const cI={percent:.1,smooth:!1,interrupt:!0,reverse:!1,center:null,lineHeight:20,axis:"all",keyToPress:null,trackpadPinch:!1,wheelZoom:!0};class uI extends qe{constructor(t,e={}){super(t),W(this,"options"),W(this,"smoothing"),W(this,"smoothingCenter"),W(this,"smoothingCount"),W(this,"keyIsPressed"),this.options=Object.assign({},cI,e),this.keyIsPressed=!1,this.options.keyToPress&&this.handleKeyPresses(this.options.keyToPress)}handleKeyPresses(t){window.addEventListener("keydown",e=>{t.includes(e.code)&&(this.keyIsPressed=!0)}),window.addEventListener("keyup",e=>{t.includes(e.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 t=this.smoothingCenter,e=this.smoothing;let i;this.options.center||(i=this.parent.toLocal(t)),this.isAxisX()&&(this.parent.scale.x+=e.x),this.isAxisY()&&(this.parent.scale.y+=e.y),this.parent.emit("zoomed",{viewport:this.parent,type:"wheel"});const s=this.parent.plugins.get("clamp-zoom",!0);if(s&&s.clamp(),this.options.center)this.parent.moveCenter(this.options.center);else{const n=this.parent.toGlobal(i);this.parent.x+=t.x-n.x,this.parent.y+=t.y-n.y}this.parent.emit("moved",{viewport:this.parent,type:"wheel"}),this.smoothingCount++,this.smoothingCount>=this.options.smooth&&(this.smoothing=null)}}pinch(t){if(this.paused)return;const e=this.parent.input.getPointerPosition(t),i=-t.deltaY*(t.deltaMode?this.options.lineHeight:1)/200,s=Math.pow(2,(1+this.options.percent)*i);let n;this.options.center||(n=this.parent.toLocal(e)),this.isAxisX()&&(this.parent.scale.x*=s),this.isAxisY()&&(this.parent.scale.y*=s),this.parent.emit("zoomed",{viewport:this.parent,type:"wheel"});const o=this.parent.plugins.get("clamp-zoom",!0);if(o&&o.clamp(),this.options.center)this.parent.moveCenter(this.options.center);else{const a=this.parent.toGlobal(n);this.parent.x+=e.x-a.x,this.parent.y+=e.y-a.y}this.parent.emit("moved",{viewport:this.parent,type:"wheel"}),this.parent.emit("wheel-start",{event:t,viewport:this.parent})}wheel(t){if(this.paused||!this.checkKeyPress())return!1;if(t.ctrlKey&&this.options.trackpadPinch)this.pinch(t);else if(this.options.wheelZoom){const e=this.parent.input.getPointerPosition(t),i=(this.options.reverse?-1:1)*-t.deltaY*(t.deltaMode?this.options.lineHeight:1)/500,s=Math.pow(2,(1+this.options.percent)*i);if(this.options.smooth){const n={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+n.x)*s-this.parent.scale.x)/this.options.smooth,y:((this.parent.scale.y+n.y)*s-this.parent.scale.y)/this.options.smooth},this.smoothingCount=0,this.smoothingCenter=e}else{let n;this.options.center||(n=this.parent.toLocal(e)),this.isAxisX()&&(this.parent.scale.x*=s),this.isAxisY()&&(this.parent.scale.y*=s),this.parent.emit("zoomed",{viewport:this.parent,type:"wheel"});const o=this.parent.plugins.get("clamp-zoom",!0);if(o&&o.clamp(),this.options.center)this.parent.moveCenter(this.options.center);else{const a=this.parent.toGlobal(n);this.parent.x+=e.x-a.x,this.parent.y+=e.y-a.y}}this.parent.emit("moved",{viewport:this.parent,type:"wheel"}),this.parent.emit("wheel-start",{event:t,viewport:this.parent})}return!this.parent.options.passiveWheel}}class dI{constructor(t){W(this,"viewport"),W(this,"clickedAvailable"),W(this,"isMouseDown"),W(this,"last"),W(this,"wheelFunction"),W(this,"touches"),this.viewport=t,this.touches=[],this.addListeners()}addListeners(){this.viewport.interactive=!0,this.viewport.forceHitArea||(this.viewport.hitArea=new mt(0,0,this.viewport.worldWidth,this.viewport.worldHeight)),this.viewport.on("pointerdown",this.down,this),this.viewport.options.allowPreserveDragOutside?this.viewport.on("globalpointermove",this.move,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.options.allowPreserveDragOutside||this.viewport.on("pointerleave",this.up,this),this.wheelFunction=t=>this.handleWheel(t),this.viewport.options.events.domElement.addEventListener("wheel",this.wheelFunction,{passive:this.viewport.options.passiveWheel}),this.isMouseDown=!1}destroy(){this.viewport.options.events.domElement.removeEventListener("wheel",this.wheelFunction)}down(t){if(!(this.viewport.pause||!this.viewport.worldVisible)){if(t.pointerType==="mouse"?this.isMouseDown=!0:this.get(t.pointerId)||this.touches.push({id:t.pointerId,last:null}),this.count()===1){this.last=t.global.clone();const e=this.viewport.plugins.get("decelerate",!0),i=this.viewport.plugins.get("bounce",!0);(!e||!e.isActive())&&(!i||!i.isActive())?this.clickedAvailable=!0:this.clickedAvailable=!1}else this.clickedAvailable=!1;this.viewport.plugins.down(t)&&this.viewport.options.stopPropagation&&t.stopPropagation()}}clear(){this.isMouseDown=!1,this.touches=[],this.last=null}checkThreshold(t){return Math.abs(t)>=this.viewport.threshold}move(t){if(this.viewport.pause||!this.viewport.worldVisible)return;const e=this.viewport.plugins.move(t);if(this.clickedAvailable&&this.last){const i=t.global.x-this.last.x,s=t.global.y-this.last.y;(this.checkThreshold(i)||this.checkThreshold(s))&&(this.clickedAvailable=!1)}e&&this.viewport.options.stopPropagation&&t.stopPropagation()}up(t){if(this.viewport.pause||!this.viewport.worldVisible)return;t.pointerType==="mouse"&&(this.isMouseDown=!1),t.pointerType!=="mouse"&&this.remove(t.pointerId);const e=this.viewport.plugins.up(t);this.clickedAvailable&&this.count()===0&&this.last&&(this.viewport.emit("clicked",{event:t,screen:this.last,world:this.viewport.toWorld(this.last),viewport:this.viewport}),this.clickedAvailable=!1),e&&this.viewport.options.stopPropagation&&t.stopPropagation()}getPointerPosition(t){const e=new dt;return this.viewport.options.events.mapPositionToPoint(e,t.clientX,t.clientY),e}handleWheel(t){if(this.viewport.pause||!this.viewport.worldVisible)return;const e=this.viewport.toLocal(this.getPointerPosition(t));this.viewport.left<=e.x&&e.x<=this.viewport.right&&this.viewport.top<=e.y&&e.y<=this.viewport.bottom&&this.viewport.plugins.wheel(t)&&!this.viewport.options.passiveWheel&&t.preventDefault()}pause(){this.touches=[],this.isMouseDown=!1}get(t){for(const e of this.touches)if(e.id===t)return e;return null}remove(t){for(let e=0;e<this.touches.length;e++)if(this.touches[e].id===t){this.touches.splice(e,1);return}}count(){return(this.isMouseDown?1:0)+this.touches.length}}const Co=["drag","pinch","wheel","follow","mouse-edges","decelerate","animate","bounce","snap-zoom","clamp-zoom","snap","clamp"];class fI{constructor(t){W(this,"plugins"),W(this,"list"),W(this,"viewport"),this.viewport=t,this.list=[],this.plugins={}}add(t,e,i=Co.length){const s=this.plugins[t];s&&s.destroy(),this.plugins[t]=e;const n=Co.indexOf(t);n!==-1&&Co.splice(n,1),Co.splice(i,0,t),this.sort()}get(t,e){var i;return e&&(i=this.plugins[t])!=null&&i.paused?null:this.plugins[t]}update(t){for(const e of this.list)e.update(t)}resize(){for(const t of this.list)t.resize()}reset(){for(const t of this.list)t.reset()}removeAll(){this.list.forEach(t=>{t.destroy()}),this.plugins={},this.sort()}remove(t){var e;this.plugins[t]&&((e=this.plugins[t])==null||e.destroy(),delete this.plugins[t],this.viewport.emit("plugin-remove",t),this.sort())}pause(t){var e;(e=this.plugins[t])==null||e.pause()}resume(t){var e;(e=this.plugins[t])==null||e.resume()}sort(){this.list=[];for(const t of Co)this.plugins[t]&&this.list.push(this.plugins[t])}down(t){let e=!1;for(const i of this.list)i.down(t)&&(e=!0);return e}move(t){let e=!1;for(const i of this.viewport.plugins.list)i.move(t)&&(e=!0);return e}up(t){let e=!1;for(const i of this.list)i.up(t)&&(e=!0);return e}wheel(t){let e=!1;for(const i of this.list)i.wheel(t)&&(e=!0);return e}}const pI={screenWidth:window.innerWidth,screenHeight:window.innerHeight,worldWidth:null,worldHeight:null,threshold:5,passiveWheel:!0,stopPropagation:!1,forceHitArea:null,noTicker:!1,disableOnContextMenu:!1,ticker:Te.shared,allowPreserveDragOutside:!1};class mI extends Ct{constructor(t){super(),W(this,"moving"),W(this,"screenWidth"),W(this,"screenHeight"),W(this,"threshold"),W(this,"input"),W(this,"plugins"),W(this,"zooming"),W(this,"lastViewport"),W(this,"options"),W(this,"_dirty"),W(this,"_forceHitArea"),W(this,"_hitAreaDefault"),W(this,"_pause"),W(this,"tickerFunction"),W(this,"_worldWidth"),W(this,"_worldHeight"),W(this,"_disableOnContextMenu",e=>e.preventDefault()),this.options={...pI,...t},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.disableOnContextMenu&&this.options.events.domElement.addEventListener("contextmenu",this._disableOnContextMenu),this.options.noTicker||(this.tickerFunction=()=>this.update(this.options.ticker.elapsedMS),this.options.ticker.add(this.tickerFunction)),this.input=new dI(this),this.plugins=new fI(this)}destroy(t){!this.options.noTicker&&this.tickerFunction&&this.options.ticker.remove(this.tickerFunction),this.options.disableOnContextMenu&&this.options.events.domElement.removeEventListener("contextmenu",this._disableOnContextMenu),this.input.destroy(),super.destroy(t)}update(t){this.pause||(this.plugins.update(t),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 mt(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(t=window.innerWidth,e=window.innerHeight,i,s){this.screenWidth=t,this.screenHeight=e,typeof i<"u"&&(this._worldWidth=i),typeof s<"u"&&(this._worldHeight=s),this.plugins.resize(),this.dirty=!0}get worldWidth(){return this._worldWidth?this._worldWidth:this.width/this.scale.x}set worldWidth(t){this._worldWidth=t,this.plugins.resize()}get worldHeight(){return this._worldHeight?this._worldHeight:this.height/this.scale.y}set worldHeight(t){this._worldHeight=t,this.plugins.resize()}getVisibleBounds(){return new mt(this.left,this.top,this.worldScreenWidth,this.worldScreenHeight)}toWorld(t,e){return arguments.length===2?this.toLocal(new dt(t,e)):this.toLocal(t)}toScreen(t,e){return arguments.length===2?this.toGlobal(new dt(t,e)):this.toGlobal(t)}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 dt(this.worldScreenWidth/2-this.x/this.scale.x,this.worldScreenHeight/2-this.y/this.scale.y)}set center(t){this.moveCenter(t)}moveCenter(...t){let e,i;typeof t[0]=="number"?(e=t[0],i=t[1]):(e=t[0].x,i=t[0].y);const s=(this.worldScreenWidth/2-e)*this.scale.x,n=(this.worldScreenHeight/2-i)*this.scale.y;return(this.x!==s||this.y!==n)&&(this.position.set(s,n),this.plugins.reset(),this.dirty=!0),this}get corner(){return new dt(-this.x/this.scale.x,-this.y/this.scale.y)}set corner(t){this.moveCorner(t)}moveCorner(...t){let e,i;return t.length===1?(e=-t[0].x*this.scale.x,i=-t[0].y*this.scale.y):(e=-t[0]*this.scale.x,i=-t[1]*this.scale.y),(e!==this.x||i!==this.y)&&(this.position.set(e,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(t){return this.screenWidth/t}findFitHeight(t){return this.screenHeight/t}findFit(t,e){const i=this.screenWidth/t,s=this.screenHeight/e;return Math.min(i,s)}findCover(t,e){const i=this.screenWidth/t,s=this.screenHeight/e;return Math.max(i,s)}fitWidth(t=this.worldWidth,e,i=!0,s){let n;e&&(n=this.center),this.scale.x=this.screenWidth/t,i&&(this.scale.y=this.scale.x);const o=this.plugins.get("clamp-zoom",!0);return!s&&o&&o.clamp(),e&&n&&this.moveCenter(n),this}fitHeight(t=this.worldHeight,e,i=!0,s){let n;e&&(n=this.center),this.scale.y=this.screenHeight/t,i&&(this.scale.x=this.scale.y);const o=this.plugins.get("clamp-zoom",!0);return!s&&o&&o.clamp(),e&&n&&this.moveCenter(n),this}fitWorld(t){let e;t&&(e=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(),t&&e&&this.moveCenter(e),this}fit(t,e=this.worldWidth,i=this.worldHeight){let s;t&&(s=this.center),this.scale.x=this.screenWidth/e,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 n=this.plugins.get("clamp-zoom",!0);return n&&n.clamp(),t&&s&&this.moveCenter(s),this}setZoom(t,e){let i;e&&(i=this.center),this.scale.set(t);const s=this.plugins.get("clamp-zoom",!0);return s&&s.clamp(),e&&i&&this.moveCenter(i),this}zoomPercent(t,e){return this.setZoom(this.scale.x+this.scale.x*t,e)}zoom(t,e){return this.fitWidth(t+this.worldScreenWidth,e),this}get scaled(){return this.scale.x}set scaled(t){this.setZoom(t,!0)}snapZoom(t){return this.plugins.add("snap-zoom",new lI(this,t)),this}OOB(){return{left:this.left<0,right:this.right>this.worldWidth,top:this.top<0,bottom:this.bottom>this.worldHeight,cornerPoint:new dt(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(t){this.x=-t*this.scale.x+this.screenWidth,this.plugins.reset()}get left(){return-this.x/this.scale.x}set left(t){this.x=-t*this.scale.x,this.plugins.reset()}get top(){return-this.y/this.scale.y}set top(t){this.y=-t*this.scale.y,this.plugins.reset()}get bottom(){return-this.y/this.scale.y+this.worldScreenHeight}set bottom(t){this.y=-t*this.scale.y+this.screenHeight,this.plugins.reset()}get dirty(){return!!this._dirty}set dirty(t){this._dirty=t}get forceHitArea(){return this._forceHitArea}set forceHitArea(t){t?(this._forceHitArea=t,this.hitArea=t):(this._forceHitArea=null,this.hitArea=new mt(0,0,this.worldWidth,this.worldHeight))}drag(t){return this.plugins.add("drag",new qC(this,t)),this}clamp(t){return this.plugins.add("clamp",new YC(this,t)),this}decelerate(t){return this.plugins.add("decelerate",new $C(this,t)),this}bounce(t){return this.plugins.add("bounce",new HC(this,t)),this}pinch(t){return this.plugins.add("pinch",new nI(this,t)),this}snap(t,e,i){return this.plugins.add("snap",new aI(this,t,e,i)),this}follow(t,e){return this.plugins.add("follow",new eI(this,t,e)),this}wheel(t){return this.plugins.add("wheel",new uI(this,t)),this}animate(t){return this.plugins.add("animate",new ZC(this,t)),this}clampZoom(t){return this.plugins.add("clamp-zoom",new jC(this,t)),this}mouseEdges(t){return this.plugins.add("mouse-edges",new rI(this,t)),this}get pause(){return!!this._pause}set pause(t){this._pause=t,this.lastViewport=null,this.moving=!1,this.zooming=!1,t&&this.input.pause()}ensureVisible(t,e,i,s,n){n&&(i>this.worldScreenWidth||s>this.worldScreenHeight)&&(this.fit(!0,i,s),this.emit("zoomed",{viewport:this,type:"ensureVisible"}));let o=!1;t<this.left?(this.left=t,o=!0):t+i>this.right&&(this.right=t+i,o=!0),e<this.top?(this.top=e,o=!0):e+s>this.bottom&&(this.bottom=e+s,o=!0),o&&this.emit("moved",{viewport:this,type:"ensureVisible"})}}function Rh(r,t){return r==null||t==null?NaN:r<t?-1:r>t?1:r>=t?0:NaN}function gI(r,t){return r==null||t==null?NaN:t<r?-1:t>r?1:t>=r?0:NaN}function od(r){let t,e,i;r.length!==2?(t=Rh,e=(a,h)=>Rh(r(a),h),i=(a,h)=>r(a)-h):(t=r===Rh||r===gI?r:yI,e=r,i=r);function s(a,h,l=0,c=a.length){if(l<c){if(t(h,h)!==0)return c;do{const u=l+c>>>1;e(a[u],h)<0?l=u+1:c=u}while(l<c)}return l}function n(a,h,l=0,c=a.length){if(l<c){if(t(h,h)!==0)return c;do{const u=l+c>>>1;e(a[u],h)<=0?l=u+1:c=u}while(l<c)}return l}function o(a,h,l=0,c=a.length){const u=s(a,h,l,c-1);return u>l&&i(a[u-1],h)>-i(a[u],h)?u-1:u}return{left:s,center:o,right:n}}function yI(){return 0}function bI(r){return r===null?NaN:+r}const xI=od(Rh).right;od(bI).center;const _I=xI,vI=Math.sqrt(50),wI=Math.sqrt(10),TI=Math.sqrt(2);function Mh(r,t,e){const i=(t-r)/Math.max(0,e),s=Math.floor(Math.log10(i)),n=i/Math.pow(10,s),o=n>=vI?10:n>=wI?5:n>=TI?2:1;let a,h,l;return s<0?(l=Math.pow(10,-s)/o,a=Math.round(r*l),h=Math.round(t*l),a/l<r&&++a,h/l>t&&--h,l=-l):(l=Math.pow(10,s)*o,a=Math.round(r/l),h=Math.round(t/l),a*l<r&&++a,h*l>t&&--h),h<a&&.5<=e&&e<2?Mh(r,t,e*2):[a,h,l]}function SI(r,t,e){if(t=+t,r=+r,e=+e,!(e>0))return[];if(r===t)return[r];const i=t<r,[s,n,o]=i?Mh(t,r,e):Mh(r,t,e);if(!(n>=s))return[];const a=n-s+1,h=new Array(a);if(i)if(o<0)for(let l=0;l<a;++l)h[l]=(n-l)/-o;else for(let l=0;l<a;++l)h[l]=(n-l)*o;else if(o<0)for(let l=0;l<a;++l)h[l]=(s+l)/-o;else for(let l=0;l<a;++l)h[l]=(s+l)*o;return h}function ad(r,t,e){return t=+t,r=+r,e=+e,Mh(r,t,e)[2]}function hd(r,t,e){t=+t,r=+r,e=+e;const i=t<r,s=i?ad(t,r,e):ad(r,t,e);return(i?-1:1)*(s<0?1/-s:s)}function ld(r,t,e){r.prototype=t.prototype=e,e.constructor=r}function py(r,t){var e=Object.create(r.prototype);for(var i in t)e[i]=t[i];return e}function Io(){}var Ao=.7,Lh=1/Ao,Tn="\\s*([+-]?\\d+)\\s*",Ro="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Oi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",EI=/^#([0-9a-f]{3,8})$/,CI=new RegExp(`^rgb\\(${Tn},${Tn},${Tn}\\)$`),II=new RegExp(`^rgb\\(${Oi},${Oi},${Oi}\\)$`),AI=new RegExp(`^rgba\\(${Tn},${Tn},${Tn},${Ro}\\)$`),RI=new RegExp(`^rgba\\(${Oi},${Oi},${Oi},${Ro}\\)$`),MI=new RegExp(`^hsl\\(${Ro},${Oi},${Oi}\\)$`),LI=new RegExp(`^hsla\\(${Ro},${Oi},${Oi},${Ro}\\)$`),my={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};ld(Io,Mo,{copy(r){return Object.assign(new this.constructor,this,r)},displayable(){return this.rgb().displayable()},hex:gy,formatHex:gy,formatHex8:PI,formatHsl:GI,formatRgb:yy,toString:yy});function gy(){return this.rgb().formatHex()}function PI(){return this.rgb().formatHex8()}function GI(){return wy(this).formatHsl()}function yy(){return this.rgb().formatRgb()}function Mo(r){var t,e;return r=(r+"").trim().toLowerCase(),(t=EI.exec(r))?(e=t[1].length,t=parseInt(t[1],16),e===6?by(t):e===3?new Ge(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):e===8?Ph(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):e===4?Ph(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=CI.exec(r))?new Ge(t[1],t[2],t[3],1):(t=II.exec(r))?new Ge(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=AI.exec(r))?Ph(t[1],t[2],t[3],t[4]):(t=RI.exec(r))?Ph(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=MI.exec(r))?vy(t[1],t[2]/100,t[3]/100,1):(t=LI.exec(r))?vy(t[1],t[2]/100,t[3]/100,t[4]):my.hasOwnProperty(r)?by(my[r]):r==="transparent"?new Ge(NaN,NaN,NaN,0):null}function by(r){return new Ge(r>>16&255,r>>8&255,r&255,1)}function Ph(r,t,e,i){return i<=0&&(r=t=e=NaN),new Ge(r,t,e,i)}function FI(r){return r instanceof Io||(r=Mo(r)),r?(r=r.rgb(),new Ge(r.r,r.g,r.b,r.opacity)):new Ge}function cd(r,t,e,i){return arguments.length===1?FI(r):new Ge(r,t,e,i??1)}function Ge(r,t,e,i){this.r=+r,this.g=+t,this.b=+e,this.opacity=+i}ld(Ge,cd,py(Io,{brighter(r){return r=r==null?Lh:Math.pow(Lh,r),new Ge(this.r*r,this.g*r,this.b*r,this.opacity)},darker(r){return r=r==null?Ao:Math.pow(Ao,r),new Ge(this.r*r,this.g*r,this.b*r,this.opacity)},rgb(){return this},clamp(){return new Ge(As(this.r),As(this.g),As(this.b),Gh(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:xy,formatHex:xy,formatHex8:NI,formatRgb:_y,toString:_y}));function xy(){return`#${Rs(this.r)}${Rs(this.g)}${Rs(this.b)}`}function NI(){return`#${Rs(this.r)}${Rs(this.g)}${Rs(this.b)}${Rs((isNaN(this.opacity)?1:this.opacity)*255)}`}function _y(){const r=Gh(this.opacity);return`${r===1?"rgb(":"rgba("}${As(this.r)}, ${As(this.g)}, ${As(this.b)}${r===1?")":`, ${r})`}`}function Gh(r){return isNaN(r)?1:Math.max(0,Math.min(1,r))}function As(r){return Math.max(0,Math.min(255,Math.round(r)||0))}function Rs(r){return r=As(r),(r<16?"0":"")+r.toString(16)}function vy(r,t,e,i){return i<=0?r=t=e=NaN:e<=0||e>=1?r=t=NaN:t<=0&&(r=NaN),new pi(r,t,e,i)}function wy(r){if(r instanceof pi)return new pi(r.h,r.s,r.l,r.opacity);if(r instanceof Io||(r=Mo(r)),!r)return new pi;if(r instanceof pi)return r;r=r.rgb();var t=r.r/255,e=r.g/255,i=r.b/255,s=Math.min(t,e,i),n=Math.max(t,e,i),o=NaN,a=n-s,h=(n+s)/2;return a?(t===n?o=(e-i)/a+(e<i)*6:e===n?o=(i-t)/a+2:o=(t-e)/a+4,a/=h<.5?n+s:2-n-s,o*=60):a=h>0&&h<1?0:o,new pi(o,a,h,r.opacity)}function DI(r,t,e,i){return arguments.length===1?wy(r):new pi(r,t,e,i??1)}function pi(r,t,e,i){this.h=+r,this.s=+t,this.l=+e,this.opacity=+i}ld(pi,DI,py(Io,{brighter(r){return r=r==null?Lh:Math.pow(Lh,r),new pi(this.h,this.s,this.l*r,this.opacity)},darker(r){return r=r==null?Ao:Math.pow(Ao,r),new pi(this.h,this.s,this.l*r,this.opacity)},rgb(){var r=this.h%360+(this.h<0)*360,t=isNaN(r)||isNaN(this.s)?0:this.s,e=this.l,i=e+(e<.5?e:1-e)*t,s=2*e-i;return new Ge(ud(r>=240?r-240:r+120,s,i),ud(r,s,i),ud(r<120?r+240:r-120,s,i),this.opacity)},clamp(){return new pi(Ty(this.h),Fh(this.s),Fh(this.l),Gh(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const r=Gh(this.opacity);return`${r===1?"hsl(":"hsla("}${Ty(this.h)}, ${Fh(this.s)*100}%, ${Fh(this.l)*100}%${r===1?")":`, ${r})`}`}}));function Ty(r){return r=(r||0)%360,r<0?r+360:r}function Fh(r){return Math.max(0,Math.min(1,r||0))}function ud(r,t,e){return(r<60?t+(e-t)*r/60:r<180?e:r<240?t+(e-t)*(240-r)/60:t)*255}const dd=r=>()=>r;function kI(r,t){return function(e){return r+e*t}}function OI(r,t,e){return r=Math.pow(r,e),t=Math.pow(t,e)-r,e=1/e,function(i){return Math.pow(r+i*t,e)}}function BI(r){return(r=+r)==1?Sy:function(t,e){return e-t?OI(t,e,r):dd(isNaN(t)?e:t)}}function Sy(r,t){var e=t-r;return e?kI(r,e):dd(isNaN(r)?t:r)}const Ey=function r(t){var e=BI(t);function i(s,n){var o=e((s=cd(s)).r,(n=cd(n)).r),a=e(s.g,n.g),h=e(s.b,n.b),l=Sy(s.opacity,n.opacity);return function(c){return s.r=o(c),s.g=a(c),s.b=h(c),s.opacity=l(c),s+""}}return i.gamma=r,i}(1);function UI(r,t){t||(t=[]);var e=r?Math.min(t.length,r.length):0,i=t.slice(),s;return function(n){for(s=0;s<e;++s)i[s]=r[s]*(1-n)+t[s]*n;return i}}function WI(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}function XI(r,t){var e=t?t.length:0,i=r?Math.min(e,r.length):0,s=new Array(i),n=new Array(e),o;for(o=0;o<i;++o)s[o]=md(r[o],t[o]);for(;o<e;++o)n[o]=t[o];return function(a){for(o=0;o<i;++o)n[o]=s[o](a);return n}}function ZI(r,t){var e=new Date;return r=+r,t=+t,function(i){return e.setTime(r*(1-i)+t*i),e}}function Nh(r,t){return r=+r,t=+t,function(e){return r*(1-e)+t*e}}function VI(r,t){var e={},i={},s;(r===null||typeof r!="object")&&(r={}),(t===null||typeof t!="object")&&(t={});for(s in t)s in r?e[s]=md(r[s],t[s]):i[s]=t[s];return function(n){for(s in e)i[s]=e[s](n);return i}}var fd=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,pd=new RegExp(fd.source,"g");function HI(r){return function(){return r}}function KI(r){return function(t){return r(t)+""}}function YI(r,t){var e=fd.lastIndex=pd.lastIndex=0,i,s,n,o=-1,a=[],h=[];for(r=r+"",t=t+"";(i=fd.exec(r))&&(s=pd.exec(t));)(n=s.index)>e&&(n=t.slice(e,n),a[o]?a[o]+=n:a[++o]=n),(i=i[0])===(s=s[0])?a[o]?a[o]+=s:a[++o]=s:(a[++o]=null,h.push({i:o,x:Nh(i,s)})),e=pd.lastIndex;return e<t.length&&(n=t.slice(e),a[o]?a[o]+=n:a[++o]=n),a.length<2?h[0]?KI(h[0].x):HI(t):(t=h.length,function(l){for(var c=0,u;c<t;++c)a[(u=h[c]).i]=u.x(l);return a.join("")})}function md(r,t){var e=typeof t,i;return t==null||e==="boolean"?dd(t):(e==="number"?Nh:e==="string"?(i=Mo(t))?(t=i,Ey):YI:t instanceof Mo?Ey:t instanceof Date?ZI:WI(t)?UI:Array.isArray(t)?XI:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?VI:Nh)(r,t)}function zI(r,t){return r=+r,t=+t,function(e){return Math.round(r*(1-e)+t*e)}}function jI(r){return Math.abs(r=Math.round(r))>=1e21?r.toLocaleString("en").replace(/,/g,""):r.toString(10)}function Dh(r,t){if((e=(r=t?r.toExponential(t-1):r.toExponential()).indexOf("e"))<0)return null;var e,i=r.slice(0,e);return[i.length>1?i[0]+i.slice(2):i,+r.slice(e+1)]}function Sn(r){return r=Dh(Math.abs(r)),r?r[1]:NaN}function JI(r,t){return function(e,i){for(var s=e.length,n=[],o=0,a=r[0],h=0;s>0&&a>0&&(h+a+1>i&&(a=Math.max(1,i-h)),n.push(e.substring(s-=a,s+a)),!((h+=a+1)>i));)a=r[o=(o+1)%r.length];return n.reverse().join(t)}}function $I(r){return function(t){return t.replace(/[0-9]/g,function(e){return r[+e]})}}var QI=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function kh(r){if(!(t=QI.exec(r)))throw new Error("invalid format: "+r);var t;return new gd({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}kh.prototype=gd.prototype;function gd(r){this.fill=r.fill===void 0?" ":r.fill+"",this.align=r.align===void 0?">":r.align+"",this.sign=r.sign===void 0?"-":r.sign+"",this.symbol=r.symbol===void 0?"":r.symbol+"",this.zero=!!r.zero,this.width=r.width===void 0?void 0:+r.width,this.comma=!!r.comma,this.precision=r.precision===void 0?void 0:+r.precision,this.trim=!!r.trim,this.type=r.type===void 0?"":r.type+""}gd.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function qI(r){t:for(var t=r.length,e=1,i=-1,s;e<t;++e)switch(r[e]){case".":i=s=e;break;case"0":i===0&&(i=e),s=e;break;default:if(!+r[e])break t;i>0&&(i=0);break}return i>0?r.slice(0,i)+r.slice(s+1):r}var Cy;function tA(r,t){var e=Dh(r,t);if(!e)return r+"";var i=e[0],s=e[1],n=s-(Cy=Math.max(-8,Math.min(8,Math.floor(s/3)))*3)+1,o=i.length;return n===o?i:n>o?i+new Array(n-o+1).join("0"):n>0?i.slice(0,n)+"."+i.slice(n):"0."+new Array(1-n).join("0")+Dh(r,Math.max(0,t+n-1))[0]}function Iy(r,t){var e=Dh(r,t);if(!e)return r+"";var i=e[0],s=e[1];return s<0?"0."+new Array(-s).join("0")+i:i.length>s+1?i.slice(0,s+1)+"."+i.slice(s+1):i+new Array(s-i.length+2).join("0")}const Ay={"%":(r,t)=>(r*100).toFixed(t),b:r=>Math.round(r).toString(2),c:r=>r+"",d:jI,e:(r,t)=>r.toExponential(t),f:(r,t)=>r.toFixed(t),g:(r,t)=>r.toPrecision(t),o:r=>Math.round(r).toString(8),p:(r,t)=>Iy(r*100,t),r:Iy,s:tA,X:r=>Math.round(r).toString(16).toUpperCase(),x:r=>Math.round(r).toString(16)};function Ry(r){return r}var My=Array.prototype.map,Ly=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function eA(r){var t=r.grouping===void 0||r.thousands===void 0?Ry:JI(My.call(r.grouping,Number),r.thousands+""),e=r.currency===void 0?"":r.currency[0]+"",i=r.currency===void 0?"":r.currency[1]+"",s=r.decimal===void 0?".":r.decimal+"",n=r.numerals===void 0?Ry:$I(My.call(r.numerals,String)),o=r.percent===void 0?"%":r.percent+"",a=r.minus===void 0?"−":r.minus+"",h=r.nan===void 0?"NaN":r.nan+"";function l(u){u=kh(u);var d=u.fill,f=u.align,p=u.sign,m=u.symbol,g=u.zero,y=u.width,x=u.comma,b=u.precision,v=u.trim,w=u.type;w==="n"?(x=!0,w="g"):Ay[w]||(b===void 0&&(b=12),v=!0,w="g"),(g||d==="0"&&f==="=")&&(g=!0,d="0",f="=");var S=m==="$"?e:m==="#"&&/[boxX]/.test(w)?"0"+w.toLowerCase():"",C=m==="$"?i:/[%p]/.test(w)?o:"",I=Ay[w],R=/[defgprs%]/.test(w);b=b===void 0?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,b)):Math.max(0,Math.min(20,b));function P(G){var N=S,A=C,k,V,K;if(w==="c")A=I(G)+A,G="";else{G=+G;var H=G<0||1/G<0;if(G=isNaN(G)?h:I(Math.abs(G),b),v&&(G=qI(G)),H&&+G==0&&p!=="+"&&(H=!1),N=(H?p==="("?p:a:p==="-"||p==="("?"":p)+N,A=(w==="s"?Ly[8+Cy/3]:"")+A+(H&&p==="("?")":""),R){for(k=-1,V=G.length;++k<V;)if(K=G.charCodeAt(k),48>K||K>57){A=(K===46?s+G.slice(k+1):G.slice(k))+A,G=G.slice(0,k);break}}}x&&!g&&(G=t(G,1/0));var $=N.length+G.length+A.length,U=$<y?new Array(y-$+1).join(d):"";switch(x&&g&&(G=t(U+G,U.length?y-A.length:1/0),U=""),f){case"<":G=N+G+A+U;break;case"=":G=N+U+G+A;break;case"^":G=U.slice(0,$=U.length>>1)+N+G+A+U.slice($);break;default:G=U+N+G+A;break}return n(G)}return P.toString=function(){return u+""},P}function c(u,d){var f=l((u=kh(u),u.type="f",u)),p=Math.max(-8,Math.min(8,Math.floor(Sn(d)/3)))*3,m=Math.pow(10,-p),g=Ly[8+p/3];return function(y){return f(m*y)+g}}return{format:l,formatPrefix:c}}var Oh,Py,Gy;iA({thousands:",",grouping:[3],currency:["$",""]});function iA(r){return Oh=eA(r),Py=Oh.format,Gy=Oh.formatPrefix,Oh}function rA(r){return Math.max(0,-Sn(Math.abs(r)))}function sA(r,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Sn(t)/3)))*3-Sn(Math.abs(r)))}function nA(r,t){return r=Math.abs(r),t=Math.abs(t)-r,Math.max(0,Sn(t)-Sn(r))+1}function Fy(r,t){switch(arguments.length){case 0:break;case 1:this.range(r);break;default:this.range(t).domain(r);break}return this}function oA(r){return function(){return r}}function aA(r){return+r}var Ny=[0,1];function En(r){return r}function yd(r,t){return(t-=r=+r)?function(e){return(e-r)/t}:oA(isNaN(t)?NaN:.5)}function hA(r,t){var e;return r>t&&(e=r,r=t,t=e),function(i){return Math.max(r,Math.min(t,i))}}function lA(r,t,e){var i=r[0],s=r[1],n=t[0],o=t[1];return s<i?(i=yd(s,i),n=e(o,n)):(i=yd(i,s),n=e(n,o)),function(a){return n(i(a))}}function cA(r,t,e){var i=Math.min(r.length,t.length)-1,s=new Array(i),n=new Array(i),o=-1;for(r[i]<r[0]&&(r=r.slice().reverse(),t=t.slice().reverse());++o<i;)s[o]=yd(r[o],r[o+1]),n[o]=e(t[o],t[o+1]);return function(a){var h=_I(r,a,1,i)-1;return n[h](s[h](a))}}function Dy(r,t){return t.domain(r.domain()).range(r.range()).interpolate(r.interpolate()).clamp(r.clamp()).unknown(r.unknown())}function uA(){var r=Ny,t=Ny,e=md,i,s,n,o=En,a,h,l;function c(){var d=Math.min(r.length,t.length);return o!==En&&(o=hA(r[0],r[d-1])),a=d>2?cA:lA,h=l=null,u}function u(d){return d==null||isNaN(d=+d)?n:(h||(h=a(r.map(i),t,e)))(i(o(d)))}return u.invert=function(d){return o(s((l||(l=a(t,r.map(i),Nh)))(d)))},u.domain=function(d){return arguments.length?(r=Array.from(d,aA),c()):r.slice()},u.range=function(d){return arguments.length?(t=Array.from(d),c()):t.slice()},u.rangeRound=function(d){return t=Array.from(d),e=zI,c()},u.clamp=function(d){return arguments.length?(o=d?!0:En,c()):o!==En},u.interpolate=function(d){return arguments.length?(e=d,c()):e},u.unknown=function(d){return arguments.length?(n=d,u):n},function(d,f){return i=d,s=f,c()}}function ky(){return uA()(En,En)}function dA(r,t,e,i){var s=hd(r,t,e),n;switch(i=kh(i??",f"),i.type){case"s":{var o=Math.max(Math.abs(r),Math.abs(t));return i.precision==null&&!isNaN(n=sA(s,o))&&(i.precision=n),Gy(i,o)}case"":case"e":case"g":case"p":case"r":{i.precision==null&&!isNaN(n=nA(s,Math.max(Math.abs(r),Math.abs(t))))&&(i.precision=n-(i.type==="e"));break}case"f":case"%":{i.precision==null&&!isNaN(n=rA(s))&&(i.precision=n-(i.type==="%")*2);break}}return Py(i)}function fA(r){var t=r.domain;return r.ticks=function(e){var i=t();return SI(i[0],i[i.length-1],e??10)},r.tickFormat=function(e,i){var s=t();return dA(s[0],s[s.length-1],e??10,i)},r.nice=function(e){e==null&&(e=10);var i=t(),s=0,n=i.length-1,o=i[s],a=i[n],h,l,c=10;for(a<o&&(l=o,o=a,a=l,l=s,s=n,n=l);c-- >0;){if(l=ad(o,a,e),l===h)return i[s]=o,i[n]=a,t(i);if(l>0)o=Math.floor(o/l)*l,a=Math.ceil(a/l)*l;else if(l<0)o=Math.ceil(o*l)/l,a=Math.floor(a*l)/l;else break;h=l}return r},r}function Oy(){var r=ky();return r.copy=function(){return Dy(r,Oy())},Fy.apply(r,arguments),fA(r)}function pA(r,t){r=r.slice();var e=0,i=r.length-1,s=r[e],n=r[i],o;return n<s&&(o=e,e=i,i=o,o=s,s=n,n=o),r[e]=t.floor(s),r[i]=t.ceil(n),r}const bd=new Date,xd=new Date;function se(r,t,e,i){function s(n){return r(n=arguments.length===0?new Date:new Date(+n)),n}return s.floor=n=>(r(n=new Date(+n)),n),s.ceil=n=>(r(n=new Date(n-1)),t(n,1),r(n),n),s.round=n=>{const o=s(n),a=s.ceil(n);return n-o<a-n?o:a},s.offset=(n,o)=>(t(n=new Date(+n),o==null?1:Math.floor(o)),n),s.range=(n,o,a)=>{const h=[];if(n=s.ceil(n),a=a==null?1:Math.floor(a),!(n<o)||!(a>0))return h;let l;do h.push(l=new Date(+n)),t(n,a),r(n);while(l<n&&n<o);return h},s.filter=n=>se(o=>{if(o>=o)for(;r(o),!n(o);)o.setTime(o-1)},(o,a)=>{if(o>=o)if(a<0)for(;++a<=0;)for(;t(o,-1),!n(o););else for(;--a>=0;)for(;t(o,1),!n(o););}),e&&(s.count=(n,o)=>(bd.setTime(+n),xd.setTime(+o),r(bd),r(xd),Math.floor(e(bd,xd))),s.every=n=>(n=Math.floor(n),!isFinite(n)||!(n>0)?null:n>1?s.filter(i?o=>i(o)%n===0:o=>s.count(0,o)%n===0):s)),s}const Bh=se(()=>{},(r,t)=>{r.setTime(+r+t)},(r,t)=>t-r);Bh.every=r=>(r=Math.floor(r),!isFinite(r)||!(r>0)?null:r>1?se(t=>{t.setTime(Math.floor(t/r)*r)},(t,e)=>{t.setTime(+t+e*r)},(t,e)=>(e-t)/r):Bh),Bh.range;const lr=1e3,ti=lr*60,cr=ti*60,ur=cr*24,_d=ur*7,By=ur*30,vd=ur*365,Cn=se(r=>{r.setTime(r-r.getMilliseconds())},(r,t)=>{r.setTime(+r+t*lr)},(r,t)=>(t-r)/lr,r=>r.getUTCSeconds());Cn.range;const wd=se(r=>{r.setTime(r-r.getMilliseconds()-r.getSeconds()*lr)},(r,t)=>{r.setTime(+r+t*ti)},(r,t)=>(t-r)/ti,r=>r.getMinutes());wd.range,se(r=>{r.setUTCSeconds(0,0)},(r,t)=>{r.setTime(+r+t*ti)},(r,t)=>(t-r)/ti,r=>r.getUTCMinutes()).range;const Td=se(r=>{r.setTime(r-r.getMilliseconds()-r.getSeconds()*lr-r.getMinutes()*ti)},(r,t)=>{r.setTime(+r+t*cr)},(r,t)=>(t-r)/cr,r=>r.getHours());Td.range,se(r=>{r.setUTCMinutes(0,0,0)},(r,t)=>{r.setTime(+r+t*cr)},(r,t)=>(t-r)/cr,r=>r.getUTCHours()).range;const Lo=se(r=>r.setHours(0,0,0,0),(r,t)=>r.setDate(r.getDate()+t),(r,t)=>(t-r-(t.getTimezoneOffset()-r.getTimezoneOffset())*ti)/ur,r=>r.getDate()-1);Lo.range;const Sd=se(r=>{r.setUTCHours(0,0,0,0)},(r,t)=>{r.setUTCDate(r.getUTCDate()+t)},(r,t)=>(t-r)/ur,r=>r.getUTCDate()-1);Sd.range,se(r=>{r.setUTCHours(0,0,0,0)},(r,t)=>{r.setUTCDate(r.getUTCDate()+t)},(r,t)=>(t-r)/ur,r=>Math.floor(r/ur)).range;function Ms(r){return se(t=>{t.setDate(t.getDate()-(t.getDay()+7-r)%7),t.setHours(0,0,0,0)},(t,e)=>{t.setDate(t.getDate()+e*7)},(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*ti)/_d)}const Uh=Ms(0),Wh=Ms(1),mA=Ms(2),gA=Ms(3),In=Ms(4),yA=Ms(5),bA=Ms(6);Uh.range,Wh.range,mA.range,gA.range,In.range,yA.range,bA.range;function Ls(r){return se(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-r)%7),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e*7)},(t,e)=>(e-t)/_d)}const Uy=Ls(0),Xh=Ls(1),xA=Ls(2),_A=Ls(3),An=Ls(4),vA=Ls(5),wA=Ls(6);Uy.range,Xh.range,xA.range,_A.range,An.range,vA.range,wA.range;const Ed=se(r=>{r.setDate(1),r.setHours(0,0,0,0)},(r,t)=>{r.setMonth(r.getMonth()+t)},(r,t)=>t.getMonth()-r.getMonth()+(t.getFullYear()-r.getFullYear())*12,r=>r.getMonth());Ed.range,se(r=>{r.setUTCDate(1),r.setUTCHours(0,0,0,0)},(r,t)=>{r.setUTCMonth(r.getUTCMonth()+t)},(r,t)=>t.getUTCMonth()-r.getUTCMonth()+(t.getUTCFullYear()-r.getUTCFullYear())*12,r=>r.getUTCMonth()).range;const dr=se(r=>{r.setMonth(0,1),r.setHours(0,0,0,0)},(r,t)=>{r.setFullYear(r.getFullYear()+t)},(r,t)=>t.getFullYear()-r.getFullYear(),r=>r.getFullYear());dr.every=r=>!isFinite(r=Math.floor(r))||!(r>0)?null:se(t=>{t.setFullYear(Math.floor(t.getFullYear()/r)*r),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e*r)}),dr.range;const Ps=se(r=>{r.setUTCMonth(0,1),r.setUTCHours(0,0,0,0)},(r,t)=>{r.setUTCFullYear(r.getUTCFullYear()+t)},(r,t)=>t.getUTCFullYear()-r.getUTCFullYear(),r=>r.getUTCFullYear());Ps.every=r=>!isFinite(r=Math.floor(r))||!(r>0)?null:se(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/r)*r),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e*r)}),Ps.range;function TA(r,t,e,i,s,n){const o=[[Cn,1,lr],[Cn,5,5*lr],[Cn,15,15*lr],[Cn,30,30*lr],[n,1,ti],[n,5,5*ti],[n,15,15*ti],[n,30,30*ti],[s,1,cr],[s,3,3*cr],[s,6,6*cr],[s,12,12*cr],[i,1,ur],[i,2,2*ur],[e,1,_d],[t,1,By],[t,3,3*By],[r,1,vd]];function a(l,c,u){const d=c<l;d&&([l,c]=[c,l]);const f=u&&typeof u.range=="function"?u:h(l,c,u),p=f?f.range(l,+c+1):[];return d?p.reverse():p}function h(l,c,u){const d=Math.abs(c-l)/u,f=od(([,,g])=>g).right(o,d);if(f===o.length)return r.every(hd(l/vd,c/vd,u));if(f===0)return Bh.every(Math.max(hd(l,c,u),1));const[p,m]=o[d/o[f-1][2]<o[f][2]/d?f-1:f];return p.every(m)}return[a,h]}const[SA,EA]=TA(dr,Ed,Uh,Lo,Td,wd);function Cd(r){if(0<=r.y&&r.y<100){var t=new Date(-1,r.m,r.d,r.H,r.M,r.S,r.L);return t.setFullYear(r.y),t}return new Date(r.y,r.m,r.d,r.H,r.M,r.S,r.L)}function Id(r){if(0<=r.y&&r.y<100){var t=new Date(Date.UTC(-1,r.m,r.d,r.H,r.M,r.S,r.L));return t.setUTCFullYear(r.y),t}return new Date(Date.UTC(r.y,r.m,r.d,r.H,r.M,r.S,r.L))}function Po(r,t,e){return{y:r,m:t,d:e,H:0,M:0,S:0,L:0}}function CA(r){var t=r.dateTime,e=r.date,i=r.time,s=r.periods,n=r.days,o=r.shortDays,a=r.months,h=r.shortMonths,l=Go(s),c=Fo(s),u=Go(n),d=Fo(n),f=Go(o),p=Fo(o),m=Go(a),g=Fo(a),y=Go(h),x=Fo(h),b={a:H,A:$,b:U,B:D,c:null,d:Ky,e:Ky,f:jA,g:n2,G:a2,H:KA,I:YA,j:zA,L:Yy,m:JA,M:$A,p:F,q:Z,Q:qy,s:tb,S:QA,u:qA,U:t2,V:e2,w:i2,W:r2,x:null,X:null,y:s2,Y:o2,Z:h2,"%":Qy},v={a:tt,A:ft,b:ot,B:Et,c:null,d:jy,e:jy,f:d2,g:w2,G:S2,H:l2,I:c2,j:u2,L:Jy,m:f2,M:p2,p:Mt,q:bt,Q:qy,s:tb,S:m2,u:g2,U:y2,V:b2,w:x2,W:_2,x:null,X:null,y:v2,Y:T2,Z:E2,"%":Qy},w={a:P,A:G,b:N,B:A,c:k,d:Vy,e:Vy,f:XA,g:Zy,G:Xy,H:Hy,I:Hy,j:OA,L:WA,m:kA,M:BA,p:R,q:DA,Q:VA,s:HA,S:UA,u:LA,U:PA,V:GA,w:MA,W:FA,x:V,X:K,y:Zy,Y:Xy,Z:NA,"%":ZA};b.x=S(e,b),b.X=S(i,b),b.c=S(t,b),v.x=S(e,v),v.X=S(i,v),v.c=S(t,v);function S(B,j){return function(J){var O=[],gt=-1,ut=0,It=B.length,Dt,Ee,ri;for(J instanceof Date||(J=new Date(+J));++gt<It;)B.charCodeAt(gt)===37&&(O.push(B.slice(ut,gt)),(Ee=Wy[Dt=B.charAt(++gt)])!=null?Dt=B.charAt(++gt):Ee=Dt==="e"?" ":"0",(ri=j[Dt])&&(Dt=ri(J,Ee)),O.push(Dt),ut=gt+1);return O.push(B.slice(ut,gt)),O.join("")}}function C(B,j){return function(J){var O=Po(1900,void 0,1),gt=I(O,B,J+="",0),ut,It;if(gt!=J.length)return null;if("Q"in O)return new Date(O.Q);if("s"in O)return new Date(O.s*1e3+("L"in O?O.L:0));if(j&&!("Z"in O)&&(O.Z=0),"p"in O&&(O.H=O.H%12+O.p*12),O.m===void 0&&(O.m="q"in O?O.q:0),"V"in O){if(O.V<1||O.V>53)return null;"w"in O||(O.w=1),"Z"in O?(ut=Id(Po(O.y,0,1)),It=ut.getUTCDay(),ut=It>4||It===0?Xh.ceil(ut):Xh(ut),ut=Sd.offset(ut,(O.V-1)*7),O.y=ut.getUTCFullYear(),O.m=ut.getUTCMonth(),O.d=ut.getUTCDate()+(O.w+6)%7):(ut=Cd(Po(O.y,0,1)),It=ut.getDay(),ut=It>4||It===0?Wh.ceil(ut):Wh(ut),ut=Lo.offset(ut,(O.V-1)*7),O.y=ut.getFullYear(),O.m=ut.getMonth(),O.d=ut.getDate()+(O.w+6)%7)}else("W"in O||"U"in O)&&("w"in O||(O.w="u"in O?O.u%7:"W"in O?1:0),It="Z"in O?Id(Po(O.y,0,1)).getUTCDay():Cd(Po(O.y,0,1)).getDay(),O.m=0,O.d="W"in O?(O.w+6)%7+O.W*7-(It+5)%7:O.w+O.U*7-(It+6)%7);return"Z"in O?(O.H+=O.Z/100|0,O.M+=O.Z%100,Id(O)):Cd(O)}}function I(B,j,J,O){for(var gt=0,ut=j.length,It=J.length,Dt,Ee;gt<ut;){if(O>=It)return-1;if(Dt=j.charCodeAt(gt++),Dt===37){if(Dt=j.charAt(gt++),Ee=w[Dt in Wy?j.charAt(gt++):Dt],!Ee||(O=Ee(B,J,O))<0)return-1}else if(Dt!=J.charCodeAt(O++))return-1}return O}function R(B,j,J){var O=l.exec(j.slice(J));return O?(B.p=c.get(O[0].toLowerCase()),J+O[0].length):-1}function P(B,j,J){var O=f.exec(j.slice(J));return O?(B.w=p.get(O[0].toLowerCase()),J+O[0].length):-1}function G(B,j,J){var O=u.exec(j.slice(J));return O?(B.w=d.get(O[0].toLowerCase()),J+O[0].length):-1}function N(B,j,J){var O=y.exec(j.slice(J));return O?(B.m=x.get(O[0].toLowerCase()),J+O[0].length):-1}function A(B,j,J){var O=m.exec(j.slice(J));return O?(B.m=g.get(O[0].toLowerCase()),J+O[0].length):-1}function k(B,j,J){return I(B,t,j,J)}function V(B,j,J){return I(B,e,j,J)}function K(B,j,J){return I(B,i,j,J)}function H(B){return o[B.getDay()]}function $(B){return n[B.getDay()]}function U(B){return h[B.getMonth()]}function D(B){return a[B.getMonth()]}function F(B){return s[+(B.getHours()>=12)]}function Z(B){return 1+~~(B.getMonth()/3)}function tt(B){return o[B.getUTCDay()]}function ft(B){return n[B.getUTCDay()]}function ot(B){return h[B.getUTCMonth()]}function Et(B){return a[B.getUTCMonth()]}function Mt(B){return s[+(B.getUTCHours()>=12)]}function bt(B){return 1+~~(B.getUTCMonth()/3)}return{format:function(B){var j=S(B+="",b);return j.toString=function(){return B},j},parse:function(B){var j=C(B+="",!1);return j.toString=function(){return B},j},utcFormat:function(B){var j=S(B+="",v);return j.toString=function(){return B},j},utcParse:function(B){var j=C(B+="",!0);return j.toString=function(){return B},j}}}var Wy={"-":"",_:" ",0:"0"},ue=/^\s*\d+/,IA=/^%/,AA=/[\\^$*+?|[\]().{}]/g;function Rt(r,t,e){var i=r<0?"-":"",s=(i?-r:r)+"",n=s.length;return i+(n<e?new Array(e-n+1).join(t)+s:s)}function RA(r){return r.replace(AA,"\\$&")}function Go(r){return new RegExp("^(?:"+r.map(RA).join("|")+")","i")}function Fo(r){return new Map(r.map((t,e)=>[t.toLowerCase(),e]))}function MA(r,t,e){var i=ue.exec(t.slice(e,e+1));return i?(r.w=+i[0],e+i[0].length):-1}function LA(r,t,e){var i=ue.exec(t.slice(e,e+1));return i?(r.u=+i[0],e+i[0].length):-1}function PA(r,t,e){var i=ue.exec(t.slice(e,e+2));return i?(r.U=+i[0],e+i[0].length):-1}function GA(r,t,e){var i=ue.exec(t.slice(e,e+2));return i?(r.V=+i[0],e+i[0].length):-1}function FA(r,t,e){var i=ue.exec(t.slice(e,e+2));return i?(r.W=+i[0],e+i[0].length):-1}function Xy(r,t,e){var i=ue.exec(t.slice(e,e+4));return i?(r.y=+i[0],e+i[0].length):-1}function Zy(r,t,e){var i=ue.exec(t.slice(e,e+2));return i?(r.y=+i[0]+(+i[0]>68?1900:2e3),e+i[0].length):-1}function NA(r,t,e){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(e,e+6));return i?(r.Z=i[1]?0:-(i[2]+(i[3]||"00")),e+i[0].length):-1}function DA(r,t,e){var i=ue.exec(t.slice(e,e+1));return i?(r.q=i[0]*3-3,e+i[0].length):-1}function kA(r,t,e){var i=ue.exec(t.slice(e,e+2));return i?(r.m=i[0]-1,e+i[0].length):-1}function Vy(r,t,e){var i=ue.exec(t.slice(e,e+2));return i?(r.d=+i[0],e+i[0].length):-1}function OA(r,t,e){var i=ue.exec(t.slice(e,e+3));return i?(r.m=0,r.d=+i[0],e+i[0].length):-1}function Hy(r,t,e){var i=ue.exec(t.slice(e,e+2));return i?(r.H=+i[0],e+i[0].length):-1}function BA(r,t,e){var i=ue.exec(t.slice(e,e+2));return i?(r.M=+i[0],e+i[0].length):-1}function UA(r,t,e){var i=ue.exec(t.slice(e,e+2));return i?(r.S=+i[0],e+i[0].length):-1}function WA(r,t,e){var i=ue.exec(t.slice(e,e+3));return i?(r.L=+i[0],e+i[0].length):-1}function XA(r,t,e){var i=ue.exec(t.slice(e,e+6));return i?(r.L=Math.floor(i[0]/1e3),e+i[0].length):-1}function ZA(r,t,e){var i=IA.exec(t.slice(e,e+1));return i?e+i[0].length:-1}function VA(r,t,e){var i=ue.exec(t.slice(e));return i?(r.Q=+i[0],e+i[0].length):-1}function HA(r,t,e){var i=ue.exec(t.slice(e));return i?(r.s=+i[0],e+i[0].length):-1}function Ky(r,t){return Rt(r.getDate(),t,2)}function KA(r,t){return Rt(r.getHours(),t,2)}function YA(r,t){return Rt(r.getHours()%12||12,t,2)}function zA(r,t){return Rt(1+Lo.count(dr(r),r),t,3)}function Yy(r,t){return Rt(r.getMilliseconds(),t,3)}function jA(r,t){return Yy(r,t)+"000"}function JA(r,t){return Rt(r.getMonth()+1,t,2)}function $A(r,t){return Rt(r.getMinutes(),t,2)}function QA(r,t){return Rt(r.getSeconds(),t,2)}function qA(r){var t=r.getDay();return t===0?7:t}function t2(r,t){return Rt(Uh.count(dr(r)-1,r),t,2)}function zy(r){var t=r.getDay();return t>=4||t===0?In(r):In.ceil(r)}function e2(r,t){return r=zy(r),Rt(In.count(dr(r),r)+(dr(r).getDay()===4),t,2)}function i2(r){return r.getDay()}function r2(r,t){return Rt(Wh.count(dr(r)-1,r),t,2)}function s2(r,t){return Rt(r.getFullYear()%100,t,2)}function n2(r,t){return r=zy(r),Rt(r.getFullYear()%100,t,2)}function o2(r,t){return Rt(r.getFullYear()%1e4,t,4)}function a2(r,t){var e=r.getDay();return r=e>=4||e===0?In(r):In.ceil(r),Rt(r.getFullYear()%1e4,t,4)}function h2(r){var t=r.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Rt(t/60|0,"0",2)+Rt(t%60,"0",2)}function jy(r,t){return Rt(r.getUTCDate(),t,2)}function l2(r,t){return Rt(r.getUTCHours(),t,2)}function c2(r,t){return Rt(r.getUTCHours()%12||12,t,2)}function u2(r,t){return Rt(1+Sd.count(Ps(r),r),t,3)}function Jy(r,t){return Rt(r.getUTCMilliseconds(),t,3)}function d2(r,t){return Jy(r,t)+"000"}function f2(r,t){return Rt(r.getUTCMonth()+1,t,2)}function p2(r,t){return Rt(r.getUTCMinutes(),t,2)}function m2(r,t){return Rt(r.getUTCSeconds(),t,2)}function g2(r){var t=r.getUTCDay();return t===0?7:t}function y2(r,t){return Rt(Uy.count(Ps(r)-1,r),t,2)}function $y(r){var t=r.getUTCDay();return t>=4||t===0?An(r):An.ceil(r)}function b2(r,t){return r=$y(r),Rt(An.count(Ps(r),r)+(Ps(r).getUTCDay()===4),t,2)}function x2(r){return r.getUTCDay()}function _2(r,t){return Rt(Xh.count(Ps(r)-1,r),t,2)}function v2(r,t){return Rt(r.getUTCFullYear()%100,t,2)}function w2(r,t){return r=$y(r),Rt(r.getUTCFullYear()%100,t,2)}function T2(r,t){return Rt(r.getUTCFullYear()%1e4,t,4)}function S2(r,t){var e=r.getUTCDay();return r=e>=4||e===0?An(r):An.ceil(r),Rt(r.getUTCFullYear()%1e4,t,4)}function E2(){return"+0000"}function Qy(){return"%"}function qy(r){return+r}function tb(r){return Math.floor(+r/1e3)}var Rn,eb;C2({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function C2(r){return Rn=CA(r),eb=Rn.format,Rn.parse,Rn.utcFormat,Rn.utcParse,Rn}function I2(r){return new Date(r)}function A2(r){return r instanceof Date?+r:+new Date(+r)}function ib(r,t,e,i,s,n,o,a,h,l){var c=ky(),u=c.invert,d=c.domain,f=l(".%L"),p=l(":%S"),m=l("%I:%M"),g=l("%I %p"),y=l("%a %d"),x=l("%b %d"),b=l("%B"),v=l("%Y");function w(S){return(h(S)<S?f:a(S)<S?p:o(S)<S?m:n(S)<S?g:i(S)<S?s(S)<S?y:x:e(S)<S?b:v)(S)}return c.invert=function(S){return new Date(u(S))},c.domain=function(S){return arguments.length?d(Array.from(S,A2)):d().map(I2)},c.ticks=function(S){var C=d();return r(C[0],C[C.length-1],S??10)},c.tickFormat=function(S,C){return C==null?w:l(C)},c.nice=function(S){var C=d();return(!S||typeof S.range!="function")&&(S=t(C[0],C[C.length-1],S??10)),S?d(pA(C,S)):c},c.copy=function(){return Dy(c,ib(r,t,e,i,s,n,o,a,h,l))},c}function R2(){return Fy.apply(ib(SA,EA,dr,Ed,Uh,Lo,Td,wd,Cn,eb).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function No(r,t,e){this.k=r,this.x=t,this.y=e}No.prototype={constructor:No,scale:function(r){return r===1?this:new No(this.k*r,this.x,this.y)},translate:function(r,t){return r===0&t===0?this:new No(this.k,this.x+this.k*r,this.y+this.k*t)},apply:function(r){return[r[0]*this.k+this.x,r[1]*this.k+this.y]},applyX:function(r){return r*this.k+this.x},applyY:function(r){return r*this.k+this.y},invert:function(r){return[(r[0]-this.x)/this.k,(r[1]-this.y)/this.k]},invertX:function(r){return(r-this.x)/this.k},invertY:function(r){return(r-this.y)/this.k},rescaleX:function(r){return r.copy().domain(r.range().map(this.invertX,this).map(r.invert,r))},rescaleY:function(r){return r.copy().domain(r.range().map(this.invertY,this).map(r.invert,r))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},No.prototype;function rb(r){return r.mode==="temporal"||r.mode==="left-aligned"?M2(r):L2(r)}function M2({domain:r,range:t}){return R2().domain(r).range(t)}function L2({domain:r,range:t}){return Oy().domain(r).range(t)}function Ad(r){return{mode:et.horizontal,range:TM(),domain:SM(r)}}function P2(){return{mode:et.vertical}}let Mn=null;async function G2(){const r=await gr();sb(r.start_time),q.on("layoutSettingsUpdated",()=>sb(r.start_time))}function F2(){Mn=null}async function ei(){return Mn||await Ie("scaleCreated")}async function sb(r){await ee();const t=Mn?"scaleUpdated":"scaleCreated",e=Ad(r);Mn=rb(e),q.emit(t,Mn)}let Fe=null,Rd=null;async function N2(){const r=await Qt(),t=await bu();Fe=new mI({screenHeight:t.clientHeight,screenWidth:t.clientWidth,events:r.renderer.events,passiveWheel:!1}),Fe.zIndex=1,Fe.drag().pinch().wheel({trackpadPinch:!0}).decelerate({friction:.9}).clampZoom({minWidth:t.clientWidth/2}),Fe.on("moved",()=>{q.emit("viewportMoved",null)}).on("moved-end",()=>{q.emit("viewportMoved",null)}),r.stage.addChild(Fe),q.emit("viewportCreated",Fe),q.on("applicationResized",X2),q.on("scaleUpdated",()=>Do()),U2()}function D2(){Fe=null,Rd=null}async function Md({animate:r}={}){const e=(await te()).getChildByName(Lf);if(!e)throw new Error("Nodes container not found");H2();const{x:i,y:s,width:n,height:o}=e.getLocalBounds();if(!n||!o){O2({animate:r});return}k2({x:i,y:s,width:n,height:o,animate:r})}async function k2({x:r,y:t,width:e,height:i,animate:s}){const n=await Pt(),o=await te(),{guideTextSize:a,guideTextTopPadding:h,columnGap:l,rowGap:c,eventTargetSize:u}=n.styles,d=a+h,f=e+l*2,p=i+c*4+d+u,m=o.findFit(f,p);o.animate({position:{x:r+e/2,y:t+i/2+d},scale:Math.min(m,1),time:s?n.animationDuration:0,ease:"easeInOutQuad",removeOnInterrupt:!0,callbackOnComplete:()=>{Vh(),Do()}})}async function O2({animate:r}){const t=await gr(),e=await Pt(),i=await te(),s=await ei();let n=s(t.start_time)-e.styles.columnGap,o=s(t.end_time??new Date)+e.styles.columnGap;if(n>o){const c=n;n=o,o=c}const a=o-n,h=n+a/2,l=i.findFit(a,0);i.animate({position:{x:h,y:0},scale:l,time:r?e.animationDuration:0,ease:"easeInOutQuad",removeOnInterrupt:!0,callbackOnComplete:()=>{Vh(),Do()}})}async function te(){return Fe||await Ie("viewportCreated")}function nb(r){uy(Rd,r)||(Rd=r,q.emit("viewportDateRangeUpdated",r))}function B2({xOffset:r,yOffset:t}){if(!Fe)return;const{x:e,y:i}=Fe.transform.position;Fe.setTransform(e+r,i+t,Fe.transform.scale.x,Fe.transform.scale.y)}async function U2(){const r=await te();Do(),r.on("moved",()=>Do())}async function Do(){const r=await ob();r&&nb(r)}async function ob(){const r=await te(),t=await ei(),e=t.invert(r.left),i=t.invert(r.right);return e instanceof Date&&i instanceof Date?[e,i]:null}async function W2(r){const t=await ob(),e=await ee();if(r===void 0||e.isDependency()||uy(r,t))return;const i=await te(),s=await ei(),[n,o]=r,a=s(n),h=s(o),l=a+(h-a)/2;nb(r),i.fitWidth(h-a,!0),i.moveCenter(l,i.center.y)}async function X2(){const r=await Qt(),t=await te(),e=await bu(),i=t.screenWidth,s=t.screenHeight,n=e.clientWidth,o=e.clientHeight,a=(n-i)/2,h=(o-s)/2;t.resize(r.screen.width,r.screen.height),B2({xOffset:a,yOffset:h})}class Zh{constructor(){Tf(this,"status","visible");Tf(this,"labels",new Set)}get visible(){return this.status==="visible"}get hidden(){return this.status==="hidden"}show(){if(this.status!=="visible"){for(const t of this.labels)t.visible=!0;this.status="visible"}}hide(){if(this.status!=="hidden"){for(const t of this.labels)t.visible=!1;this.status="hidden"}}toggle(t){t?this.show():this.hide()}add(t){this.labels.add(t),t.visible=this.visible}clear(){this.labels.clear()}}let Bi=null,ii=null,Ui=null,fr=null,mi=null;async function Z2(){const r=await te(),t=await Qt();Bi=new kC({toggle:"renderable"}),ii=new Zh,Ui=new Zh,mi=new Zh,fr=new Zh,t.ticker.add(()=>{if(r.dirty){const e=r.scale.x>.1,i=r.scale.x>.2,s=r.scale.x>.2,n=r.scale.x>.2;mi==null||mi.toggle(e),ii==null||ii.toggle(i),Ui==null||Ui.toggle(s),fr==null||fr.toggle(n),Bi==null||Bi.cull(t.renderer.screen),r.dirty=!1}}),q.emit("cullCreated",Bi),q.emit("labelCullCreated",ii),q.emit("iconCullCreated",ii),q.emit("edgeCullCreated",mi),q.emit("toggleCullCreated",fr)}function V2(){Bi=null,ii==null||ii.clear(),ii=null,Ui==null||Ui.clear(),Ui=null,mi==null||mi.clear(),mi=null,fr==null||fr.clear(),fr=null}async function Vh(){const r=await te();r.dirty=!0}function H2(){Bi&&Bi.uncull()}async function ab(){return Bi||await Ie("cullCreated")}async function K2(){return mi||await Ie("edgeCullCreated")}async function hb(){return ii||await Ie("labelCullCreated")}async function Y2(){return Ui||await Ie("iconCullCreated")}async function lb(){const r=await ee(),t=await Pt();function e(i,s,n){const a=r.disableAnimations||n?0:t.animationDuration/1e3;return cy.to(i,{...s,duration:a,ease:"power1.out",onUpdate:()=>{Vh()}})}return{animate:e}}let Hh=new Map;function z2(){Hh=new Map}async function ko(r,t){const e=`${r.toString()}-${JSON.stringify(t)}`;if(Hh.has(e))return Hh.get(e);const i=await r(...t);return Hh.set(e,i),i}async function j2({size:r,stroke:t=1,radius:e=0}){const i=await Qt(),s=new un;return s.lineStyle(t,"#fff",1,0),s.drawRoundedRect(0,0,r*2,r*2,e),i.renderer.generateTexture(s,{region:new mt(0,0,r,r),resolution:10})}async function Oo(r){return await ko(j2,[r])}var Kh=(r=>(r[r.Up=0]="Up",r[r.Down=180]="Down",r[r.Left=270]="Left",r[r.Right=90]="Right",r))(Kh||{});function cb(){const r=new $t;async function t(e){const{rotate:i=0}=e,s={size:e.size,radius:e.radius,stroke:e.stroke},n=await Oo(s);return r.texture=n,r.anchor.set(.5,.5),r.angle=45+i,r}return{element:r,render:t}}async function J2(){const r=await Qt(),t=new un;return t.beginFill("#fff"),t.drawRect(0,0,1,1),t.endFill(),r.renderer.generateTexture(t,{wrapMode:vi.REPEAT})}async function Ld(){return await ko(J2,[])}function Pd(r,t){return Array.from({length:r},(e,i)=>t(i))}const $2=8,Q2=2;async function q2(){const r=await Pt(),t=await ab(),e=await K2(),{animate:i}=await lb(),s=new Ct,{element:n,render:o}=await cb(),a=await Ld(),h=Pd(20,()=>new dt),l=new LS(a,h);let c=!1;s.name=sx,s.addChild(n),s.addChild(l),t.addAll([n,l]),e.add(s);async function u(){return await o({size:10,rotate:Kh.Right}),n.tint=r.styles.edgeColor,l.tint=r.styles.edgeColor,s}async function d(p,m){const g=f(m);c||await u();for(const[y,x]of h.entries()){const{x:b,y:v}=g[y];i(x,{x:b,y:v},!c)}i(s,{x:p.x,y:p.y},!c),i(n,{x:m.x-$2,y:m.y},!c),c=!0}function f({x:p,y:m}){const g=[],y={x:0,y:0},x={x:p-Q2,y:m},b={x:ub(y.x,{source:y,target:x}),y:y.y},v={x:ub(x.x,{source:y,target:x},!0),y:x.y};for(const[w]of h.entries()){if(w===h.length-1){g[w]=x;continue}const S=tR(w,{source:y,target:x,sourceBezier:b,targetBezier:v});g[w]=S}return g}return{element:s,render:u,setPosition:d}}function ub(r,{source:t,target:e},i){const s=(e.x-t.x)/2;return r+(s>64?s:64)*(i?-1:1)}function tR(r,t){const e=r/20,{source:i,target:s,sourceBezier:n,targetBezier:o}=t,a=i.x+(n.x-i.x)*e,h=i.y+(n.y-i.y)*e,l=n.x+(o.x-n.x)*e,c=n.y+(o.y-n.y)*e,u=o.x+(s.x-o.x)*e,d=o.y+(s.y-o.y)*e,f=a+(l-a)*e,p=h+(c-h)*e,m=l+(u-l)*e,g=c+(d-c)*e,y=f+(m-f)*e,x=p+(g-p)*e;return{x:y,y:x}}async function eR({height:r,radius:t}){const e=await Qt(),i=new un;return i.beginFill("#fff"),i.drawRoundedRect(0,0,t*2,r,t),i.endFill(),e.renderer.generateTexture(i,{region:new mt(0,0,t,r),resolution:10})}async function iR(r){return await ko(eR,[r])}function rR(){const r=new $t,t=new $t;async function e(i){const s=await iR(i);return r.texture=s,t.texture=s,t.anchor.x=1,t.scale.x=-1,{left:r,right:t}}return{left:r,right:t,render:e}}async function pr(){const r=await Ld();return new $t(r)}async function Gd(){const r=new Ct,t=await pr(),{left:e,right:i,render:s}=await rR();r.addChild(t),r.addChild(e),r.addChild(i);async function n(h){const{width:l,x:c,visible:u}=a(h);return await s({height:h.height,radius:h.radius}),t.visible=u,t.width=l,t.height=h.height,t.x=c,e.visible=o(h.capLeft,h.radius),i.visible=o(h.capRight,h.radius),i.x=h.radius+l,t.tint=h.background,e.tint=h.background,i.tint=h.background,r}function o(h,l){return l===0?!1:h??!0}function a(h){const l=o(h.capLeft,h.radius),c=o(h.capRight,h.radius);let u=0;l&&(u+=h.radius),c&&(u+=h.radius);const d=Math.max(h.width-u,0),f=d>0,p=l?h.radius:0;return{width:d,visible:f,x:p}}return{element:r,render:n}}function Fd(){const r=new Ct,t=new $t,e=new $t,i=new $t,s=new $t,n=new $t,o=new $t,a=new $t,h=new $t;t.name="border-corner-top-left",e.name="border-corner-top-right",i.name="border-corner-bottom-left",s.name="border-corner-bottom-right",n.name="border-corner-left",o.name="border-corner-right",a.name="border-corner-top",h.name="border-corner-bottom",e.anchor.x=1,e.scale.x=-1,i.anchor.y=1,i.scale.y=-1,s.anchor.x=1,s.scale.x=-1,s.anchor.y=1,s.scale.y=-1,r.addChild(t),r.addChild(e),r.addChild(i),r.addChild(s),r.addChild(n),r.addChild(o),r.addChild(a),r.addChild(h);async function l(p){const{radius:m=0,color:g="#fff",stroke:y,width:x,height:b}=p,v=typeof m=="number",w={topLeft:c(v?m:m[0],x,b),topRight:c(v?m:m[1],x,b),bottomLeft:c(v?m:m[2],x,b),bottomRight:c(v?m:m[3],x,b)};return await u({width:x,height:b,stroke:y,cornerSizes:w}),await d({width:x,height:b,stroke:y,cornerSizes:w}),f(g),r}function c(p,m,g){const y=Math.min(m,g);return{size:p*2>y?y/2:p,radius:p}}async function u({width:p,height:m,stroke:g,cornerSizes:y}){const{topLeft:x,topRight:b,bottomLeft:v,bottomRight:w}=y,[S,C,I,R]=await Promise.all([Oo({...x,stroke:g}),Oo({...b,stroke:g}),Oo({...v,stroke:g}),Oo({...w,stroke:g})]);t.texture=S,e.texture=C,i.texture=R,s.texture=I,t.position.set(0,0),e.position.set(p-b.size,0),i.position.set(0,m-v.size),s.position.set(p-w.size,m-w.size)}async function d({width:p,height:m,stroke:g,cornerSizes:y}){const x=await Ld(),{topLeft:b,topRight:v,bottomLeft:w,bottomRight:S}=y;a.texture=x,n.texture=x,o.texture=x,h.texture=x,n.position.set(0,b.size),n.height=Math.max(m-b.size-w.size,0),n.width=g,o.position.set(p-g,v.size),o.height=Math.max(m-v.size-S.size,0),o.width=g,a.position.set(b.size,0),a.width=Math.max(p-b.size-v.size,0),a.height=g,h.position.set(w.size,m-g),h.width=Math.max(p-w.size-S.size,0),h.height=g}function f(p){t.tint=p,e.tint=p,i.tint=p,s.tint=p,a.tint=p,n.tint=p,o.tint=p,h.tint=p}return{element:r,render:l}}async function Yh(){const r=await Pt(),t=new Ct,{element:e,render:i}=await Fd();async function s({selected:n,width:o,height:a}){if(!n)return t.removeChild(e),t;const{selectedBorderColor:h,selectedBorderWidth:l,selectedBorderOffset:c,selectedBorderRadius:u}=r.styles;return e.position.set(-c,-c),t.addChild(e),await i({stroke:l,radius:u,width:o+c*2,height:a+c*2,color:h}),t}return{element:t,render:s}}async function sR(){const r=await Pt(),t=new Ct,{element:e,render:i}=await Gd(),{element:s,render:n}=await Yh();t.addChild(e),t.addChild(s);async function o({selected:a,width:h,height:l}){const{artifactBgColor:c,artifactBorderRadius:u}=r.styles,d={width:h,height:l,background:c,radius:u,capLeft:!0,capRight:!0};return await Promise.all([i(d),n({selected:a,width:h,height:l})]),t}return{element:t,render:o}}const nR=Object.freeze(Object.defineProperty({__proto__:null,Artifact:"data:image/svg+xml,%3csvg%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7.5%203.875C7.5%203.11561%208.11561%202.5%208.875%202.5H16.125C16.8844%202.5%2017.5%203.11561%2017.5%203.875V16.125C17.5%2016.8844%2016.8844%2017.5%2016.125%2017.5H8.875C8.11561%2017.5%207.5%2016.8844%207.5%2016.125V10.9375H6.66449C6.31341%2011.6765%205.56012%2012.1875%204.6875%2012.1875C3.47938%2012.1875%202.5%2011.2081%202.5%2010C2.5%208.79188%203.47938%207.8125%204.6875%207.8125C5.56012%207.8125%206.31341%208.32345%206.66449%209.0625H7.5V3.875ZM15.7984%207.99134L12.7215%2012.9913C12.5599%2013.2539%2012.2797%2013.4202%2011.9718%2013.4362C11.664%2013.4523%2011.3679%2013.3159%2011.18%2013.0716L9.25692%2010.5716L10.7431%209.4284L11.8372%2010.8508L14.2016%207.00866L15.7984%207.99134Z'%20fill='white'/%3e%3c/svg%3e",ArtifactMarkdown:"data:image/svg+xml,%3csvg%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7.5%203.875C7.5%203.11561%208.11561%202.5%208.875%202.5H16.125C16.8844%202.5%2017.5%203.11561%2017.5%203.875V16.125C17.5%2016.8844%2016.8844%2017.5%2016.125%2017.5H8.875C8.11561%2017.5%207.5%2016.8844%207.5%2016.125V10.9375H6.66449C6.31341%2011.6765%205.56012%2012.1875%204.6875%2012.1875C3.47938%2012.1875%202.5%2011.2081%202.5%2010C2.5%208.79188%203.47938%207.8125%204.6875%207.8125C5.56012%207.8125%206.31341%208.32345%206.66449%209.0625H7.5V3.875ZM15%207.1875H10V5.3125H15V7.1875ZM15%2010.9375H10V9.0625H15V10.9375ZM10%2014.6875H12.5V12.8125H10V14.6875Z'%20fill='white'/%3e%3c/svg%3e",ArtifactResult:"data:image/svg+xml,%3csvg%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7.5%203.875C7.5%203.11561%208.11561%202.5%208.875%202.5H16.125C16.8844%202.5%2017.5%203.11561%2017.5%203.875V16.125C17.5%2016.8844%2016.8844%2017.5%2016.125%2017.5H8.875C8.11561%2017.5%207.5%2016.8844%207.5%2016.125V10.9375H6.66449C6.31341%2011.6765%205.56012%2012.1875%204.6875%2012.1875C3.47938%2012.1875%202.5%2011.2081%202.5%2010C2.5%208.79188%203.47938%207.8125%204.6875%207.8125C5.56012%207.8125%206.31341%208.32345%206.66449%209.0625H7.5V3.875ZM9.52483%206.61458C9.7035%205.94774%2010.3889%205.55202%2011.0558%205.73069C11.7226%205.90937%2012.1183%206.59479%2011.9396%207.26162C11.761%207.92846%2011.0755%208.32418%2010.4087%208.14551C9.74188%207.96683%209.34615%207.28141%209.52483%206.61458ZM13.0604%2012.7383C13.239%2012.0715%2013.9245%2011.6757%2014.5913%2011.8544C15.2581%2012.0331%2015.6539%2012.7185%2015.4752%2013.3854C15.2965%2014.0522%2014.6111%2014.4479%2013.9442%2014.2692C13.2774%2014.0906%2012.8817%2013.4051%2013.0604%2012.7383ZM10.78%2014.27L15.78%206.77002L14.2199%205.72996L9.21995%2013.23L10.78%2014.27Z'%20fill='white'/%3e%3c/svg%3e",ArtifactTable:"data:image/svg+xml,%3csvg%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7.5%203.875C7.5%203.11561%208.11561%202.5%208.875%202.5H16.125C16.8844%202.5%2017.5%203.11561%2017.5%203.875V16.125C17.5%2016.8844%2016.8844%2017.5%2016.125%2017.5H8.875C8.11561%2017.5%207.5%2016.8844%207.5%2016.125V10.9375H6.66449C6.31341%2011.6765%205.56012%2012.1875%204.6875%2012.1875C3.47938%2012.1875%202.5%2011.2081%202.5%2010C2.5%208.79188%203.47938%207.8125%204.6875%207.8125C5.56012%207.8125%206.31341%208.32345%206.66449%209.0625H7.5V3.875ZM10%207.1875H11.875V5.3125H10V7.1875ZM10%2010.9375H11.875V9.0625H10V10.9375ZM11.875%2014.6875H10V12.8125H11.875V14.6875ZM13.125%207.1875H15V5.3125H13.125V7.1875ZM15%2010.9375H13.125V9.0625H15V10.9375ZM13.125%2014.6875H15V12.8125H13.125V14.6875Z'%20fill='white'/%3e%3c/svg%3e"},Symbol.toStringTag,{value:"Module"}));function oR(r){const t={resolution:4};return nt.from(nR[r],t)}async function aR(r){return await ko(oR,[r])}async function hR({cullAtZoomThreshold:r=!0}={}){const t=await Y2(),e=new $t;r&&t.add(e);async function i(s){const n=await aR(s);return e.texture=n,e}return{element:e,render:i}}var db={exports:{}};(function(r){(function(){function t(m,g){document.addEventListener?m.addEventListener("scroll",g,!1):m.attachEvent("scroll",g)}function e(m){document.body?m():document.addEventListener?document.addEventListener("DOMContentLoaded",function g(){document.removeEventListener("DOMContentLoaded",g),m()}):document.attachEvent("onreadystatechange",function g(){(document.readyState=="interactive"||document.readyState=="complete")&&(document.detachEvent("onreadystatechange",g),m())})}function i(m){this.g=document.createElement("div"),this.g.setAttribute("aria-hidden","true"),this.g.appendChild(document.createTextNode(m)),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 s(m,g){m.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 n(m){var g=m.g.offsetWidth,y=g+100;return m.j.style.width=y+"px",m.i.scrollLeft=y,m.h.scrollLeft=m.h.scrollWidth+100,m.l!==g?(m.l=g,!0):!1}function o(m,g){function y(){var b=x;n(b)&&b.g.parentNode!==null&&g(b.l)}var x=m;t(m.h,y),t(m.i,y),n(m)}function a(m,g,y){g=g||{},y=y||window,this.family=m,this.style=g.style||"normal",this.weight=g.weight||"normal",this.stretch=g.stretch||"normal",this.context=y}var h=null,l=null,c=null,u=null;function d(m){return l===null&&(f(m)&&/Apple/.test(window.navigator.vendor)?(m=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))(?:\.([0-9]+))/.exec(window.navigator.userAgent),l=!!m&&603>parseInt(m[1],10)):l=!1),l}function f(m){return u===null&&(u=!!m.document.fonts),u}function p(m,g){var y=m.style,x=m.weight;if(c===null){var b=document.createElement("div");try{b.style.font="condensed 100px sans-serif"}catch{}c=b.style.font!==""}return[y,x,c?m.stretch:"","100px",g].join(" ")}a.prototype.load=function(m,g){var y=this,x=m||"BESbswy",b=0,v=g||3e3,w=new Date().getTime();return new Promise(function(S,C){if(f(y.context)&&!d(y.context)){var I=new Promise(function(P,G){function N(){new Date().getTime()-w>=v?G(Error(""+v+"ms timeout exceeded")):y.context.document.fonts.load(p(y,'"'+y.family+'"'),x).then(function(A){1<=A.length?P():setTimeout(N,25)},G)}N()}),R=new Promise(function(P,G){b=setTimeout(function(){G(Error(""+v+"ms timeout exceeded"))},v)});Promise.race([R,I]).then(function(){clearTimeout(b),S(y)},C)}else e(function(){function P(){var Z;(Z=V!=-1&&K!=-1||V!=-1&&H!=-1||K!=-1&&H!=-1)&&((Z=V!=K&&V!=H&&K!=H)||(h===null&&(Z=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))/.exec(window.navigator.userAgent),h=!!Z&&(536>parseInt(Z[1],10)||parseInt(Z[1],10)===536&&11>=parseInt(Z[2],10))),Z=h&&(V==$&&K==$&&H==$||V==U&&K==U&&H==U||V==D&&K==D&&H==D)),Z=!Z),Z&&(F.parentNode!==null&&F.parentNode.removeChild(F),clearTimeout(b),S(y))}function G(){if(new Date().getTime()-w>=v)F.parentNode!==null&&F.parentNode.removeChild(F),C(Error(""+v+"ms timeout exceeded"));else{var Z=y.context.document.hidden;(Z===!0||Z===void 0)&&(V=N.g.offsetWidth,K=A.g.offsetWidth,H=k.g.offsetWidth,P()),b=setTimeout(G,50)}}var N=new i(x),A=new i(x),k=new i(x),V=-1,K=-1,H=-1,$=-1,U=-1,D=-1,F=document.createElement("div");F.dir="ltr",s(N,p(y,"sans-serif")),s(A,p(y,"serif")),s(k,p(y,"monospace")),F.appendChild(N.g),F.appendChild(A.g),F.appendChild(k.g),y.context.document.body.appendChild(F),$=N.g.offsetWidth,U=A.g.offsetWidth,D=k.g.offsetWidth,G(),o(N,function(Z){V=Z,P()}),s(N,p(y,'"'+y.family+'",sans-serif')),o(A,function(Z){K=Z,P()}),s(A,p(y,'"'+y.family+'",serif')),o(k,function(Z){H=Z,P()}),s(k,p(y,'"'+y.family+'",monospace'))})})},r.exports=a})()})(db);var lR=db.exports;const cR=Vs(lR),fb={inter:{fontFamily:"InterVariable",fontSize:16,lineHeight:20,fill:16777215}},pb={resolution:4,chars:fi.ASCII},mb="sans-serif",gb={inter:pR(fb.inter)};let Nd=!1;async function uR(){const r=Object.values(fb);await Promise.all(r.map(t=>dR(t))),Nd=!0,q.emit("fontsLoaded",gb)}async function dR(r){const{fontFamily:t,...e}=r,i=new cR(t);try{await i.load()}catch(s){console.error(s),console.warn(`fonts: font ${t} failed to load, falling back to ${mb}`),fi.from(t,{fontFamily:mb,...e},pb);return}fi.from(t,r,pb)}function fR(){Nd=!1}async function yb(){return Nd?gb:await Ie("fontsLoaded")}function pR(r){const{fontFamily:t,...e}=r,i={fontName:t,...e};return s=>new nE(s,i)}async function zh({cullAtZoomThreshold:r=!0}={}){const{inter:t}=await yb(),e=await hb(),i=t("");r&&e.add(i);async function s(n){return i.text=n,await i}return{element:i,render:s}}const mR=["result","markdown","table","unknown"],bb={markdown:"ArtifactMarkdown",table:"ArtifactTable",result:"ArtifactResult",unknown:"Artifact"},Dd=["flow-run","task-run"];function gR(r){return Dd.includes(r)}function jh(r){return Dd.includes(r.kind)}function xb(r){return r.kind==="artifact"}function _b(r){return r.kind==="artifacts"}function vb(r){return r.kind==="state"}function wb(r){return r.kind==="event"}function Tb(r){return r.kind==="events"}const yR=["COMPLETED","RUNNING","SCHEDULED","PENDING","FAILED","CANCELLED","CANCELLING","CRASHED","PAUSED"];async function Sb({cullAtZoomThreshold:r}){const t=await Pt(),e=new Ct,i=new Ct,{element:s,render:n}=await hR({cullAtZoomThreshold:r}),{element:o,render:a}=await zh({cullAtZoomThreshold:r}),{element:h,render:l}=await sR();let c=!1,u=null,d=null;i.addChild(s),i.addChild(o),e.addChild(h),e.addChild(i);async function f(y){if(y){const{selected:x,name:b,type:v}=y;c=x??c,u=b??u,d=v??d}return await Promise.all([p(),m()]),await g(),e}async function p(){if(!d)return s;const y=bb[d],{artifactIconSize:x,artifactIconColor:b,artifactPaddingLeft:v,artifactPaddingY:w}=t.styles,S=await n(y);return S.position={x:v,y:w},S.width=x,S.height=x,S.tint=b,S}async function m(){if(!u)return o.visible=!1,o;await a(u);const{artifactPaddingLeft:y,artifactPaddingY:x,artifactTextColor:b,artifactIconSize:v,artifactContentGap:w}=t.styles,S=y+v+w,C=x;return o.tint=b,o.scale.set(.75),o.position={x:S,y:C},o.visible=!0,o}async function g(){const{artifactPaddingLeft:y,artifactPaddingRight:x,artifactPaddingY:b}=t.styles,v={selected:c,width:i.width+y+x,height:i.height+b*2};return await l(v)}return{element:e,render:f}}let Kt=null,Jh=!1;async function bR(){const r=await te();r.on("click",()=>Wi(null)),r.on("drag-start",()=>{Jh=!0}),r.on("drag-end",()=>{setTimeout(()=>{Jh=!1})})}function xR(){Kt=null,Jh=!1}function Wi(r){if(!Jh&&!(!r&&!Kt||r&&mr(r))){if(Kt=r,r===null){q.emit("itemSelected",null);return}q.emit("itemSelected",r)}}function mr(r){if(Kt===null)return!1;const{kind:t}=r;switch(t){case"task-run":return jh(Kt)&&Kt.id===r.id;case"flow-run":return jh(Kt)&&Kt.id===r.id;case"artifact":return xb(Kt)&&Kt.id===r.id;case"artifacts":return _b(Kt)&&Kt.ids.length===r.ids.length&&Kt.ids.every(i=>r.ids.includes(i));case"state":return vb(Kt)&&Kt.id===r.id;case"event":return wb(Kt)&&Kt.id===r.id;case"events":return Tb(Kt)&&Kt.ids.length===r.ids.length&&Kt.ids.every(i=>r.ids.includes(i));default:const e=t;throw new Error(`switch does not have case for value: ${e}`)}}function _R(){return Kt&&jh(Kt)?Kt:null}async function kd(r,{cullAtZoomThreshold:t=!0,enableLocalClickHandling:e=!1}={}){const{element:i,render:s}=await Sb({cullAtZoomThreshold:t});let n=!1;i.eventMode="static",i.cursor="pointer",e&&i.on("click",c=>{c.stopPropagation(),Wi({kind:"artifact",id:r.id})}),q.on("itemSelected",()=>{const c=mr({kind:"artifact",id:r.id});c!==n&&(n=c,o())});async function o(){await s({selected:n,name:r.key,type:r.type})}function a(){return n}function h(){return r.created}function l(){return r.id}return{element:i,render:o,getSelected:a,getDate:h,getId:l}}async function Eb(r,t,e){const i=await gr(),s=await Pt();let n,o=null;async function a(){try{o=await s.fetchEvents(r,z.toValue(e)),t(o)}catch(l){console.error(l)}i.end_time||(n=setTimeout(()=>a(),zg(i)))}function h(){clearInterval(n)}return{start:a,stop:h}}async function vR(){const r=await Pt(),t=await hb(),e=new Ct,{element:i,render:s}=await cb(),{element:n,render:o}=await Gd(),{element:a,render:h}=await Fd();t.add(e);let l=!1;e.eventMode="static",e.cursor="pointer",e.addChild(n),e.addChild(i),e.addChild(a),e.on("mouseover",u),e.on("mouseout",d);async function c({inside:f,isOpen:p}){l=f;const m={size:10,stroke:2,rotate:p?Kh.Up:Kh.Down},g=await s(m),y={width:r.styles.nodeToggleSize,height:r.styles.nodeToggleSize,background:r.styles.nodeToggleBgColor,radius:r.styles.nodeToggleBorderRadius},x=await o(y);x.alpha=f?0:.5;const b=await h({width:y.width,height:y.height,radius:y.radius,stroke:1,color:r.styles.nodeToggleBorderColor});b.alpha=f?0:1;const v={y:x.height/2,x:x.width/2},w=m.size/4;return g.x=v.x,g.y=p?v.y+w:v.y-w,e}function u(){n.alpha=l?.5:1}function d(){n.alpha=l?0:.5}return{element:e,render:c}}async function Cb(){const r=await Pt(),t=await ee(),e=new Ct,{element:i,render:s}=await Gd(),{element:n,render:o}=await Yh();e.addChild(i),e.addChild(n);async function a(l){const{background:c="#fff"}=r.styles.node(l),{nodeHeight:u,nodeRadius:d}=r.styles,f=mr({kind:l.kind,id:l.id}),p=h(l,d),m=l.state_type!=="RUNNING"||t.isDependency();return await Promise.all([s({width:p,height:u,radius:d,background:c,capRight:m}),o({selected:f,width:p,height:u})]),i}function h(l,c){const u=Bd();if(et.isTemporal()||et.isLeftAligned()){const d=l.start_time,f=l.end_time??new Date,m=Pf(f,d)/aa*u;return Math.max(m,c*2)}return u}return{element:e,render:a}}var Ib="Expected a function",Ab=NaN,wR="[object Symbol]",TR=/^\s+|\s+$/g,SR=/^[-+]0x[0-9a-f]+$/i,ER=/^0b[01]+$/i,CR=/^0o[0-7]+$/i,IR=parseInt,AR=typeof ve=="object"&&ve&&ve.Object===Object&&ve,RR=typeof self=="object"&&self&&self.Object===Object&&self,MR=AR||RR||Function("return this")(),LR=Object.prototype,PR=LR.toString,GR=Math.max,FR=Math.min,Od=function(){return MR.Date.now()};function NR(r,t,e){var i,s,n,o,a,h,l=0,c=!1,u=!1,d=!0;if(typeof r!="function")throw new TypeError(Ib);t=Rb(t)||0,$h(e)&&(c=!!e.leading,u="maxWait"in e,n=u?GR(Rb(e.maxWait)||0,t):n,d="trailing"in e?!!e.trailing:d);function f(S){var C=i,I=s;return i=s=void 0,l=S,o=r.apply(I,C),o}function p(S){return l=S,a=setTimeout(y,t),c?f(S):o}function m(S){var C=S-h,I=S-l,R=t-C;return u?FR(R,n-I):R}function g(S){var C=S-h,I=S-l;return h===void 0||C>=t||C<0||u&&I>=n}function y(){var S=Od();if(g(S))return x(S);a=setTimeout(y,m(S))}function x(S){return a=void 0,d&&i?f(S):(i=s=void 0,o)}function b(){a!==void 0&&clearTimeout(a),l=0,i=h=s=a=void 0}function v(){return a===void 0?o:x(Od())}function w(){var S=Od(),C=g(S);if(i=arguments,s=this,h=S,C){if(a===void 0)return p(h);if(u)return a=setTimeout(y,t),f(h)}return a===void 0&&(a=setTimeout(y,t)),o}return w.cancel=b,w.flush=v,w}function DR(r,t,e){var i=!0,s=!0;if(typeof r!="function")throw new TypeError(Ib);return $h(e)&&(i="leading"in e?!!e.leading:i,s="trailing"in e?!!e.trailing:s),NR(r,t,{leading:i,maxWait:t,trailing:s})}function $h(r){var t=typeof r;return!!r&&(t=="object"||t=="function")}function kR(r){return!!r&&typeof r=="object"}function OR(r){return typeof r=="symbol"||kR(r)&&PR.call(r)==wR}function Rb(r){if(typeof r=="number")return r;if(OR(r))return Ab;if($h(r)){var t=typeof r.valueOf=="function"?r.valueOf():r;r=$h(t)?t+"":t}if(typeof r!="string")return r===0?r:+r;r=r.replace(TR,"");var e=ER.test(r);return e||CR.test(r)?IR(r.slice(2),e?2:8):SR.test(r)?Ab:+r}var BR=DR;const Mb=Vs(BR);async function Lb(){const{element:r,render:t}=await Sb({cullAtZoomThreshold:!1});let e=null,i=[],s=!1;r.eventMode="static",r.cursor="pointer",q.on("itemSelected",()=>{const l=mr({kind:"artifacts",ids:i});l!==s&&e&&(s=l,n({ids:i,date:e}))});async function n(l){if(!l){e=null,i=[],r.visible=!1;return}const{ids:c,date:u}=l;e=u,i=c,await t({selected:s,type:"unknown",name:c.length.toString()}),r.visible=!0}function o(){return s}function a(){return e}function h(){return i}return{element:r,render:n,getSelected:o,getDate:a,getIds:h,isCluster:!0}}async function UR(){const r=await Qt(),t=await gr(),e=await ee(),{element:i,render:s,update:n}=await Hb({isRoot:!0});i.zIndex=4;function o(a){if(et.isTemporal()&&!e.disableArtifacts){r.stage.addChild(i),s(a==null?void 0:a.artifacts);return}r.stage.removeChild(i)}t.artifacts&&o(t),q.on("viewportMoved",()=>n()),q.on("runDataCreated",a=>o(a)),q.on("runDataUpdated",a=>o(a)),q.on("configUpdated",()=>o()),q.on("layoutSettingsUpdated",()=>o())}function vL(){}async function WR({radius:r}){const t=await Qt(),e=new un;return e.beginFill("#fff"),e.drawCircle(0,0,r),e.endFill(),t.renderer.generateTexture(e,{resolution:10})}async function XR(r){return await ko(WR,[r])}async function Pb(r){const t=await XR(r);return new $t(t)}async function Gb(r){const t=new Ct,e=await Pt(),i=await pr(),s=await Pb({radius:e.styles.eventRadiusDefault}),{element:n,render:o}=await Yh();let a=!1;t.addChild(i),t.addChild(s),t.addChild(n),t.eventMode="static",t.cursor="pointer",t.on("mouseenter",()=>{a||s.scale.set(1.5)}),t.on("mouseleave",()=>{a||s.scale.set(1)}),q.on("itemSelected",()=>{const u=mr({kind:"event",id:r.id,occurred:r.occurred});u!==a&&(a=u,s.scale.set(u?1.5:1),h())});function h(){const{eventColor:u,eventTargetSize:d,eventSelectedBorderInset:f}=e.styles;i.alpha=0,i.width=d,i.height=d,s.tint=u,s.anchor.set(.5),s.position.set(d/2,d/2),n.position.set(f,f),o({selected:a,width:d-f*2,height:d-f*2})}function l(){return r.id}function c(){return r.occurred}return{element:t,render:h,getId:l,getDate:c}}async function Fb(){const r=new Ct,t=await Pt(),e=await pr(),i=await Pb({radius:t.styles.eventClusterRadiusDefault}),{element:s,render:n}=await Yh(),{element:o,render:a}=await zh({cullAtZoomThreshold:!1});let h=null,l=[],c=!1;r.addChild(e),r.addChild(i),r.addChild(o),r.addChild(s),r.eventMode="static",r.cursor="pointer",r.on("mouseenter",()=>{c||i.scale.set(1.5)}),r.on("mouseleave",()=>{c||i.scale.set(1)}),q.on("itemSelected",()=>{const x=mr({kind:"events",occurred:h,ids:l});x!==c&&(c=x,i.scale.set(x?1.5:1),h&&u({ids:l,date:h}))});async function u(x){if(!x){h=null,l=[],r.visible=!1;return}const{ids:b,date:v}=x;h=v,l=b,d(),f(),m(),await p(b.length.toString()),r.visible=!0}function d(){const{eventTargetSize:x}=t.styles;e.alpha=0,e.width=x,e.height=x}function f(){const{eventClusterColor:x,eventTargetSize:b}=t.styles;i.tint=x,i.anchor.set(.5),i.position.set(b/2,b/2)}async function p(x){if(l.length<2)return;const{eventTargetSize:b}=t.styles,v=-1;o.scale.set(.6),o.anchor.set(.5),o.position.set(b/2,b/2+v),await a(x)}function m(){const{eventSelectedBorderInset:x,eventTargetSize:b}=t.styles;s.position.set(x,x),n({selected:c,width:b-x*2,height:b-x*2})}function g(){return l}function y(){return h}return{element:r,render:u,getIds:g,getDate:y}}function Vr(r){return"getIds"in r}async function Nb({items:r,createCluster:t}){const e=[...r.values()].sort((o,a)=>o.element.x-a.element.x);async function i(o){let a,h=null,l=null;for(let c=o??0;c<e.length;c++){const u=e[c],d=u.element.x;if(u.element.visible=!0,h!==null&&a&&d<a){l=c;break}h=c,a=d+u.element.width}if(l!==null&&h!==null){const c=e[h],u=e[l];c.element.visible=!1,u.element.visible=!1;const d=await s(c,u);d&&(e.splice(h,1,d),e.splice(l,1)),i(h)}}async function s(o,a){const h=o.getDate(),l=a.getDate(),c=Vr(o)?o.getIds():[o.getId()],u=Vr(a)?a.getIds():[a.getId()];if(!h||!l)return console.error("flowRunArtifacts: visible item is missing date"),null;let d;Vr(o)?d=o:Vr(a)?d=a:d=await t();const f=[...c,...u],p=n(f);return await d.render({ids:f,date:p}),d}function n(o){const a=o.reduce((c,u)=>{const d=r.get(u),f=d==null?void 0:d.getDate();return f&&c.push(f.getTime()),c},[]),h=Math.min(...a),l=Math.max(...a);return new Date((h+l)/2)}await i()}async function Db(r){const t=await Qt(),e=await te(),i=await Pt(),s=await ee();let n=await ei();const o=await h();o.element.on("click",c=>{c.stopPropagation();const{element:u}=o,d={x:u.position.x,y:u.position.y,width:u.width,height:u.height},f=Vr(o)?{kind:"events",ids:o.getIds(),occurred:o.getDate(),position:d}:{kind:"event",id:o.getId(),occurred:o.getDate(),position:d};Wi(f)}),q.on("scaleUpdated",c=>{n=c,l()}),q.on("viewportMoved",()=>l());async function a(c){await o.render(c),l()}async function h(){return r.type==="event"?await Gb(r.event):await Fb()}function l(){const c=o.getDate();if(!c||s.disableEvents||!et.isTemporal())return;const{element:u}=o,f=n(c)*e.scale._x+e.worldTransform.tx-u.width/2,p=t.screen.height-u.height-i.styles.eventBottomMargin;u.position.set(f,p)}return{...o,render:a}}async function kb(r){const t=await te(),e=await ee();let i=await ei();const s=await o();s.element.on("click",h=>{h.stopPropagation();const{element:l}=s,c=l.getGlobalPosition(),u={x:c.x,y:c.y,width:l.width*t.scale.x,height:l.height*t.scale.y},d=Vr(s)?{kind:"events",ids:s.getIds(),occurred:s.getDate(),position:u}:{kind:"event",id:s.getId(),occurred:s.getDate(),position:u};Wi(d)}),q.on("scaleUpdated",h=>{i=h,a()});async function n(h){await s.render(h),a()}async function o(){return r.type==="event"?await Gb(r.event):await Fb()}function a(){const h=s.getDate(),{parentStartDate:l}=r;if(!h||e.disableEvents||!et.isTemporal()||!l)return;const{element:c}=s,d=i(h)-i(l)-c.width/2,f=-c.height;c.position.set(d,f)}return{...s,render:n}}async function Ob({isRoot:r,parentStartDate:t}={}){const e=await ee(),i=new Map,s=new Map,n=[];let o=[];const a=new Ct;let h=null;q.on("scaleUpdated",()=>u());async function l(p){if(p&&(h=p),!h)return;const m=[];for(const g of h)m.push(c(g));await Promise.all(m),u()}async function c(p){if(i.has(p.id))return i.get(p.id).render();s.has(p.id)&&await s.get(p.id);const m=(async()=>{const g=r?await Db({type:"event",event:p}):await kb({type:"event",event:p,parentStartDate:t});i.set(p.id,g),a.addChild(g.element)})();return s.set(p.id,m),await m,s.delete(p.id),i.get(p.id).render()}function u(){e.disableEvents||!et.isTemporal()||d()}const d=Mb(async()=>{o=[...n],await Nb({items:i,createCluster:f});for(const p of o)p.render()},250);async function f(){if(o.length>0)return o.pop();const p=r?await Db({type:"cluster"}):await kb({type:"cluster",parentStartDate:t});return a.addChild(p.element),n.push(p),p}return{element:a,render:l,update:u}}let Bo=null,Ln=null;async function ZR(){const r=await Qt(),t=await Pt(),e=await ee(),{element:i,render:s,update:n}=await Ob({isRoot:!0});i.zIndex=2;async function o(h){if(!et.isTemporal()||e.disableEvents){r.stage.removeChild(i);return}r.stage.addChild(i),await s(h)}const a=await Eb(t.runId,h=>{const l=Ln?"eventDataUpdated":"eventDataCreated";Ln=h,q.emit(l,Ln),o(h)});q.on("configUpdated",()=>o()),q.on("viewportMoved",()=>n()),q.on("layoutSettingsUpdated",()=>o()),Bo=a.stop,a.start()}function VR(){Bo==null||Bo(),Bo=null,Ln=null}async function HR(){return Ln||await Ie("eventDataCreated")}async function KR(r){const t=await Qt(),e=await te(),i=await Pt(),s=await gr();let n=await ei();const o=new Ct,a=await pr(),h=await pr();let l=null,c=!1,u=!1;t.stage.addChild(h),o.addChild(a),a.eventMode="static",a.cursor="pointer",a.on("mouseover",()=>{c=!0,d()}),a.on("mouseleave",()=>{c=!1,d()}),a.on("click",()=>{const b={x:a.position.x,y:a.position.y,width:a.width,height:a.height};Wi({...r,kind:"state",position:b})}),q.on("viewportMoved",()=>d()),q.on("scaleUpdated",b=>{n=b,d()}),q.on("itemSelected",()=>{const b=mr({kind:"state",...r});b!==u&&(u=b,c=!1,d())}),r.type==="RUNNING"&&!s.end_time&&g();function d(b){const{end:v}=b??{};if(v&&(l=v),s.end_time&&y(),!et.isTemporal()){h.visible=!1,o.visible=!1;return}const w=f();p(w),m(w),h.visible=!0,o.visible=!0}function f(){const{background:b="#fff"}=i.styles.state(r),v=Math.max(n(r.timestamp)*e.scale._x+e.worldTransform.tx,0);let w=0;return r.type==="RUNNING"&&!s.end_time?w=n(new Date)*e.scale._x+e.worldTransform.tx-v:l?w=n(l)*e.scale._x+e.worldTransform.tx-v:w=t.screen.width-v,{x:v,width:Math.max(w,0),background:b}}function p({x:b,width:v,background:w}){const{flowStateBarHeight:S,flowStateSelectedBarHeight:C}=i.styles,I=c||u?C:S;a.x=b,a.y=t.screen.height-I,a.width=v,a.height=I,a.tint=w}function m({x:b,width:v,background:w}){if(r.type==="RUNNING"){h.visible=!1;return}const{flowStateBarHeight:S,flowStateAreaAlpha:C}=i.styles;h.x=b,h.y=0,h.width=v,h.height=t.screen.height-S,h.tint=w,h.alpha=C}function g(){t.ticker.add(x)}function y(){t.ticker.remove(x)}function x(){d()}return{element:o,render:d}}function YR(r){return"isNodesFlowRunStateFactory"in r}async function zR(r){const t=await Qt(),e=await te(),i=await Pt(),s=await gr();let n=await ei();const o=new Ct,a=await pr(),h=await pr();let l=null,c=null,u=0,d=0,f=!1,p=!1;o.visible=!1,o.addChild(h),o.addChild(a),a.eventMode="static",a.cursor="pointer",a.on("mouseover",()=>{f=!0,m()}),a.on("mouseleave",()=>{f=!1,m()}),a.on("click",S=>{S.stopPropagation();const C=a.getGlobalPosition(),I={x:C.x,y:C.y,width:a.width*e.scale.x,height:a.height*e.scale.y};Wi({...r,kind:"state",position:I})}),h.eventMode="none",h.cursor="default",q.on("scaleUpdated",S=>{n=S,m()}),q.on("itemSelected",()=>{const S=mr({kind:"state",...r});S!==p&&(p=S,f=!1,m())}),r.type==="RUNNING"&&!s.end_time&&b();function m(S){const{end:C,parentStartDate:I,width:R,height:P}=S??{};if(C&&(l=C),I&&(c=I),R&&(u=R),P&&(d=P),s.end_time&&v(),!et.isTemporal()){o.visible=!1;return}if(!c||u<=0){o.visible=!1;return}const G=g();if(G.width<=0){o.visible=!1;return}y(G),x(G),o.visible=!0}function g(){const{background:S="#fff"}=i.styles.state(r);if(!c)return{x:0,width:0,background:S};const C=n(c);let I=n(r.timestamp)-C;if(I>=u)return{x:u,width:0,background:S};I<0&&(I=0);let R=n(l??new Date)-C;R>u&&(R=u);const P=Math.max(R-I,0);return{x:I,width:P,background:S}}function y({x:S,width:C,background:I}){const{flowStateBarHeight:R,flowStateSelectedBarHeight:P}=i.styles,G=f||p?P:R;a.x=S,a.y=d-G,a.width=C,a.height=G,a.tint=I}function x({x:S,width:C,background:I}){const{flowStateBarHeight:R,flowStateAreaAlpha:P,nodeHeight:G}=i.styles,N=G/2;h.x=S,h.y=N,h.width=C,h.height=d-R-N,h.tint=I,h.alpha=P}function b(){t.ticker.add(w)}function v(){t.ticker.remove(w)}function w(){m()}return{element:o,render:m,isNodesFlowRunStateFactory:!0}}function Bb({isRoot:r}={}){const t=new Ct,e=new Map,i=new Map;let s=null;async function n(a,h){if(a&&(s=a),!s)return;const l=[];for(let c=0;c<s.length;c++)l.push(o(s[c],c,h));await Promise.all(l)}async function o(a,h,l){const c=s&&s.length>=h+1&&s[h+1],u=c?c.timestamp:void 0;let d;if(i.has(a.id)&&await i.get(a.id),e.has(a.id))d=e.get(a.id);else{const f=(async()=>{const p=r?await KR(a):await zR(a);e.set(a.id,p),t.addChild(p.element)})();i.set(a.id,f),await f,i.delete(a.id),d=e.get(a.id)}YR(d)?await d.render({end:u,...l}):await d.render(u?{end:u}:void 0)}return{element:t,render:n}}async function jR(){const r=await Qt(),t=await gr(),{element:e,render:i}=await Bb({isRoot:!0});e.zIndex=3,r.stage.addChild(e);function s(n){i(n==null?void 0:n.states)}t.states&&s(t),q.on("runDataUpdated",n=>s(n)),q.on("configUpdated",()=>s()),q.on("layoutSettingsUpdated",()=>s())}function wL(){}async function JR(){const r=await Qt(),t=await te(),e=await ee(),i=await Pt(),{inter:s}=await yb(),n=new Ct,o=await pr();n.addChild(o);const a=s("");n.addChild(a);let h=await ei(),l,c;q.on("scaleUpdated",m=>{h=m,p()}),q.on("viewportMoved",()=>{e.disableGuides||(p(),n.height!==r.screen.height&&d())});function u(m,g){l=m,c=g,d(),f(m)}function d(){o.width=i.styles.guideLineWidth,o.height=r.screen.height,o.tint=i.styles.guideLineColor}function f(m){a.text=c(m),a.fontSize=i.styles.guideTextSize,a.tint=i.styles.guideTextColor,a.position.set(i.styles.guideTextLeftPadding,i.styles.guideTextTopPadding)}function p(){l!==void 0&&(n.position.x=h(l)*t.scale._x+t.worldTransform.tx)}return{element:n,render:u}}class Ub extends Error{constructor(){super("Layout is not temporal")}}function $R(r){return r.toLocaleTimeString()}function Wb(r){const t=navigator.language;return new Intl.DateTimeFormat(t,{timeStyle:"short"}).format(r)}function QR(r){const t=navigator.language;return new Intl.DateTimeFormat(t,{dateStyle:"short"}).format(r)}function qR(r){return r.getHours()===0&&r.getMinutes()===0?`${Qh.date(r)}
1175
+ */var V0,Ur,xn,Ju,ws,H0,$u,mC=function(){return typeof window<"u"},ar={},Ts=180/Math.PI,_n=Math.PI/180,vn=Math.atan2,K0=1e8,Qu=/([A-Z])/g,gC=/(left|right|width|margin|padding|x)/i,yC=/[\s,\(]\S/,Di={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},qu=function(t,e){return e.set(e.t,e.p,Math.round((e.s+e.c*t)*1e4)/1e4+e.u,e)},bC=function(t,e){return e.set(e.t,e.p,t===1?e.e:Math.round((e.s+e.c*t)*1e4)/1e4+e.u,e)},xC=function(t,e){return e.set(e.t,e.p,t?Math.round((e.s+e.c*t)*1e4)/1e4+e.u:e.b,e)},_C=function(t,e){var i=e.s+e.c*t;e.set(e.t,e.p,~~(i+(i<0?-.5:.5))+e.u,e)},Y0=function(t,e){return e.set(e.t,e.p,t?e.e:e.b,e)},z0=function(t,e){return e.set(e.t,e.p,t!==1?e.b:e.e,e)},vC=function(t,e,i){return t.style[e]=i},wC=function(t,e,i){return t.style.setProperty(e,i)},TC=function(t,e,i){return t._gsap[e]=i},SC=function(t,e,i){return t._gsap.scaleX=t._gsap.scaleY=i},EC=function(t,e,i,s,n){var o=t._gsap;o.scaleX=o.scaleY=i,o.renderTransform(n,o)},CC=function(t,e,i,s,n){var o=t._gsap;o[e]=i,o.renderTransform(n,o)},Ht="transform",Pe=Ht+"Origin",IC=function r(t,e){var i=this,s=this.target,n=s.style,o=s._gsap;if(t in ar&&n){if(this.tfm=this.tfm||{},t!=="transform")t=Di[t]||t,~t.indexOf(",")?t.split(",").forEach(function(a){return i.tfm[a]=hr(s,a)}):this.tfm[t]=o.x?o[t]:hr(s,t),t===Pe&&(this.tfm.zOrigin=o.zOrigin);else return Di.transform.split(",").forEach(function(a){return r.call(i,a,e)});if(this.props.indexOf(Ht)>=0)return;o.svg&&(this.svgo=s.getAttribute("data-svg-origin"),this.props.push(Pe,e,"")),t=Ht}(n||e)&&this.props.push(t,e,n[t])},j0=function(t){t.translate&&(t.removeProperty("translate"),t.removeProperty("scale"),t.removeProperty("rotate"))},AC=function(){var t=this.props,e=this.target,i=e.style,s=e._gsap,n,o;for(n=0;n<t.length;n+=3)t[n+1]?e[t[n]]=t[n+2]:t[n+2]?i[t[n]]=t[n+2]:i.removeProperty(t[n].substr(0,2)==="--"?t[n]:t[n].replace(Qu,"-$1").toLowerCase());if(this.tfm){for(o in this.tfm)s[o]=this.tfm[o];s.svg&&(s.renderTransform(),e.setAttribute("data-svg-origin",this.svgo||"")),n=$u(),(!n||!n.isStart)&&!i[Ht]&&(j0(i),s.zOrigin&&i[Pe]&&(i[Pe]+=" "+s.zOrigin+"px",s.zOrigin=0,s.renderTransform()),s.uncache=1)}},J0=function(t,e){var i={target:t,props:[],revert:AC,save:IC};return t._gsap||Le.core.getCache(t),e&&e.split(",").forEach(function(s){return i.save(s)}),i},$0,td=function(t,e){var i=Ur.createElementNS?Ur.createElementNS((e||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),t):Ur.createElement(t);return i&&i.style?i:Ur.createElement(t)},ki=function r(t,e,i){var s=getComputedStyle(t);return s[e]||s.getPropertyValue(e.replace(Qu,"-$1").toLowerCase())||s.getPropertyValue(e)||!i&&r(t,wn(e)||e,1)||""},Q0="O,Moz,ms,Ms,Webkit".split(","),wn=function(t,e,i){var s=e||ws,n=s.style,o=5;if(t in n&&!i)return t;for(t=t.charAt(0).toUpperCase()+t.substr(1);o--&&!(Q0[o]+t in n););return o<0?null:(o===3?"ms":o>=0?Q0[o]:"")+t},ed=function(){mC()&&window.document&&(V0=window,Ur=V0.document,xn=Ur.documentElement,ws=td("div")||{style:{}},td("div"),Ht=wn(Ht),Pe=Ht+"Origin",ws.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",$0=!!wn("perspective"),$u=Le.core.reverting,Ju=1)},id=function r(t){var e=td("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),i=this.parentNode,s=this.nextSibling,n=this.style.cssText,o;if(xn.appendChild(e),e.appendChild(this),this.style.display="block",t)try{o=this.getBBox(),this._gsapBBox=this.getBBox,this.getBBox=r}catch{}else this._gsapBBox&&(o=this._gsapBBox());return i&&(s?i.insertBefore(this,s):i.appendChild(this)),xn.removeChild(e),this.style.cssText=n,o},q0=function(t,e){for(var i=e.length;i--;)if(t.hasAttribute(e[i]))return t.getAttribute(e[i])},ty=function(t){var e;try{e=t.getBBox()}catch{e=id.call(t,!0)}return e&&(e.width||e.height)||t.getBBox===id||(e=id.call(t,!0)),e&&!e.width&&!e.x&&!e.y?{x:+q0(t,["x","cx","x1"])||0,y:+q0(t,["y","cy","y1"])||0,width:0,height:0}:e},ey=function(t){return!!(t.getCTM&&(!t.parentNode||t.ownerSVGElement)&&ty(t))},Ss=function(t,e){if(e){var i=t.style,s;e in ar&&e!==Pe&&(e=Ht),i.removeProperty?(s=e.substr(0,2),(s==="ms"||e.substr(0,6)==="webkit")&&(e="-"+e),i.removeProperty(s==="--"?e:e.replace(Qu,"-$1").toLowerCase())):i.removeAttribute(e)}},Wr=function(t,e,i,s,n,o){var a=new Me(t._pt,e,i,0,1,o?z0:Y0);return t._pt=a,a.b=s,a.e=n,t._props.push(i),a},iy={deg:1,rad:1,turn:1},RC={grid:1,flex:1},Xr=function r(t,e,i,s){var n=parseFloat(i)||0,o=(i+"").trim().substr((n+"").length)||"px",a=ws.style,h=gC.test(e),l=t.tagName.toLowerCase()==="svg",c=(l?"client":"offset")+(h?"Width":"Height"),u=100,d=s==="px",f=s==="%",p,m,g,y;if(s===o||!n||iy[s]||iy[o])return n;if(o!=="px"&&!d&&(n=r(t,e,i,"px")),y=t.getCTM&&ey(t),(f||o==="%")&&(ar[e]||~e.indexOf("adius")))return p=y?t.getBBox()[h?"width":"height"]:t[c],jt(f?n/p*u:n/100*p);if(a[h?"width":"height"]=u+(d?o:s),m=~e.indexOf("adius")||s==="em"&&t.appendChild&&!l?t:t.parentNode,y&&(m=(t.ownerSVGElement||{}).parentNode),(!m||m===Ur||!m.appendChild)&&(m=Ur.body),g=m._gsap,g&&f&&g.width&&h&&g.time===Xe.time&&!g.uncache)return jt(n/g.width*u);if(f&&(e==="height"||e==="width")){var x=t.style[e];t.style[e]=u+s,p=t[c],x?t.style[e]=x:Ss(t,e)}else(f||o==="%")&&!RC[ki(m,"display")]&&(a.position=ki(t,"position")),m===t&&(a.position="static"),m.appendChild(ws),p=ws[c],m.removeChild(ws),a.position="absolute";return h&&f&&(g=gs(m),g.time=Xe.time,g.width=m[c]),jt(d?p*n/u:p&&n?u/p*n:0)},hr=function(t,e,i,s){var n;return Ju||ed(),e in Di&&e!=="transform"&&(e=Di[e],~e.indexOf(",")&&(e=e.split(",")[0])),ar[e]&&e!=="transform"?(n=So(t,s),n=e!=="transformOrigin"?n[e]:n.svg?n.origin:Ch(ki(t,Pe))+" "+n.zOrigin+"px"):(n=t.style[e],(!n||n==="auto"||s||~(n+"").indexOf("calc("))&&(n=Eh[e]&&Eh[e](t,e,i)||ki(t,e)||o0(t,e)||(e==="opacity"?1:0))),i&&!~(n+"").trim().indexOf(" ")?Xr(t,e,n,i)+i:n},MC=function(t,e,i,s){if(!i||i==="none"){var n=wn(e,t,1),o=n&&ki(t,n,1);o&&o!==i?(e=n,i=o):e==="borderColor"&&(i=ki(t,"borderTopColor"))}var a=new Me(this._pt,t.style,e,0,1,U0),h=0,l=0,c,u,d,f,p,m,g,y,x,b,v,w;if(a.b=i,a.e=s,i+="",s+="",s==="auto"&&(m=t.style[e],t.style[e]=s,s=ki(t,e)||s,m?t.style[e]=m:Ss(t,e)),c=[i,s],M0(c),i=c[0],s=c[1],d=i.match(fn)||[],w=s.match(fn)||[],w.length){for(;u=fn.exec(s);)g=u[0],x=s.substring(h,u.index),p?p=(p+1)%5:(x.substr(-5)==="rgba("||x.substr(-5)==="hsla(")&&(p=1),g!==(m=d[l++]||"")&&(f=parseFloat(m)||0,v=m.substr((f+"").length),g.charAt(1)==="="&&(g=pn(f,g)+v),y=parseFloat(g),b=g.substr((y+"").length),h=fn.lastIndex-b.length,b||(b=b||Oe.units[e]||v,h===s.length&&(s+=b,a.e+=b)),v!==b&&(f=Xr(t,e,m,b)||0),a._pt={_next:a._pt,p:x||l===1?x:",",s:f,c:y-f,m:p&&p<4||e==="zIndex"?Math.round:0});a.c=h<s.length?s.substring(h,s.length):""}else a.r=e==="display"&&s==="none"?z0:Y0;return qg.test(s)&&(a.e=0),this._pt=a,a},ry={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},LC=function(t){var e=t.split(" "),i=e[0],s=e[1]||"50%";return(i==="top"||i==="bottom"||s==="left"||s==="right")&&(t=i,i=s,s=t),e[0]=ry[i]||i,e[1]=ry[s]||s,e.join(" ")},PC=function(t,e){if(e.tween&&e.tween._time===e.tween._dur){var i=e.t,s=i.style,n=e.u,o=i._gsap,a,h,l;if(n==="all"||n===!0)s.cssText="",h=1;else for(n=n.split(","),l=n.length;--l>-1;)a=n[l],ar[a]&&(h=1,a=a==="transformOrigin"?Pe:Ht),Ss(i,a);h&&(Ss(i,Ht),o&&(o.svg&&i.removeAttribute("transform"),So(i,1),o.uncache=1,j0(s)))}},Eh={clearProps:function(t,e,i,s,n){if(n.data!=="isFromStart"){var o=t._pt=new Me(t._pt,e,i,0,0,PC);return o.u=s,o.pr=-10,o.tween=n,t._props.push(i),1}}},To=[1,0,0,1,0,0],sy={},ny=function(t){return t==="matrix(1, 0, 0, 1, 0, 0)"||t==="none"||!t},oy=function(t){var e=ki(t,Ht);return ny(e)?To:e.substr(7).match(Qg).map(jt)},rd=function(t,e){var i=t._gsap||gs(t),s=t.style,n=oy(t),o,a,h,l;return i.svg&&t.getAttribute("transform")?(h=t.transform.baseVal.consolidate().matrix,n=[h.a,h.b,h.c,h.d,h.e,h.f],n.join(",")==="1,0,0,1,0,0"?To:n):(n===To&&!t.offsetParent&&t!==xn&&!i.svg&&(h=s.display,s.display="block",o=t.parentNode,(!o||!t.offsetParent)&&(l=1,a=t.nextElementSibling,xn.appendChild(t)),n=oy(t),h?s.display=h:Ss(t,"display"),l&&(a?o.insertBefore(t,a):o?o.appendChild(t):xn.removeChild(t))),e&&n.length>6?[n[0],n[1],n[4],n[5],n[12],n[13]]:n)},sd=function(t,e,i,s,n,o){var a=t._gsap,h=n||rd(t,!0),l=a.xOrigin||0,c=a.yOrigin||0,u=a.xOffset||0,d=a.yOffset||0,f=h[0],p=h[1],m=h[2],g=h[3],y=h[4],x=h[5],b=e.split(" "),v=parseFloat(b[0])||0,w=parseFloat(b[1])||0,S,C,I,R;i?h!==To&&(C=f*g-p*m)&&(I=v*(g/C)+w*(-m/C)+(m*x-g*y)/C,R=v*(-p/C)+w*(f/C)-(f*x-p*y)/C,v=I,w=R):(S=ty(t),v=S.x+(~b[0].indexOf("%")?v/100*S.width:v),w=S.y+(~(b[1]||b[0]).indexOf("%")?w/100*S.height:w)),s||s!==!1&&a.smooth?(y=v-l,x=w-c,a.xOffset=u+(y*f+x*m)-y,a.yOffset=d+(y*p+x*g)-x):a.xOffset=a.yOffset=0,a.xOrigin=v,a.yOrigin=w,a.smooth=!!s,a.origin=e,a.originIsAbsolute=!!i,t.style[Pe]="0px 0px",o&&(Wr(o,a,"xOrigin",l,v),Wr(o,a,"yOrigin",c,w),Wr(o,a,"xOffset",u,a.xOffset),Wr(o,a,"yOffset",d,a.yOffset)),t.setAttribute("data-svg-origin",v+" "+w)},So=function(t,e){var i=t._gsap||new F0(t);if("x"in i&&!e&&!i.uncache)return i;var s=t.style,n=i.scaleX<0,o="px",a="deg",h=getComputedStyle(t),l=ki(t,Pe)||"0",c,u,d,f,p,m,g,y,x,b,v,w,S,C,I,R,P,G,N,A,k,V,K,H,$,U,D,F,Z,tt,ft,ot;return c=u=d=m=g=y=x=b=v=0,f=p=1,i.svg=!!(t.getCTM&&ey(t)),h.translate&&((h.translate!=="none"||h.scale!=="none"||h.rotate!=="none")&&(s[Ht]=(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[Ht]!=="none"?h[Ht]:"")),s.scale=s.rotate=s.translate="none"),C=rd(t,i.svg),i.svg&&(i.uncache?($=t.getBBox(),l=i.xOrigin-$.x+"px "+(i.yOrigin-$.y)+"px",H=""):H=!e&&t.getAttribute("data-svg-origin"),sd(t,H||l,!!H||i.originIsAbsolute,i.smooth!==!1,C)),w=i.xOrigin||0,S=i.yOrigin||0,C!==To&&(G=C[0],N=C[1],A=C[2],k=C[3],c=V=C[4],u=K=C[5],C.length===6?(f=Math.sqrt(G*G+N*N),p=Math.sqrt(k*k+A*A),m=G||N?vn(N,G)*Ts:0,x=A||k?vn(A,k)*Ts+m:0,x&&(p*=Math.abs(Math.cos(x*_n))),i.svg&&(c-=w-(w*G+S*A),u-=S-(w*N+S*k))):(ot=C[6],tt=C[7],D=C[8],F=C[9],Z=C[10],ft=C[11],c=C[12],u=C[13],d=C[14],I=vn(ot,Z),g=I*Ts,I&&(R=Math.cos(-I),P=Math.sin(-I),H=V*R+D*P,$=K*R+F*P,U=ot*R+Z*P,D=V*-P+D*R,F=K*-P+F*R,Z=ot*-P+Z*R,ft=tt*-P+ft*R,V=H,K=$,ot=U),I=vn(-A,Z),y=I*Ts,I&&(R=Math.cos(-I),P=Math.sin(-I),H=G*R-D*P,$=N*R-F*P,U=A*R-Z*P,ft=k*P+ft*R,G=H,N=$,A=U),I=vn(N,G),m=I*Ts,I&&(R=Math.cos(I),P=Math.sin(I),H=G*R+N*P,$=V*R+K*P,N=N*R-G*P,K=K*R-V*P,G=H,V=$),g&&Math.abs(g)+Math.abs(m)>359.9&&(g=m=0,y=180-y),f=jt(Math.sqrt(G*G+N*N+A*A)),p=jt(Math.sqrt(K*K+ot*ot)),I=vn(V,K),x=Math.abs(I)>2e-4?I*Ts:0,v=ft?1/(ft<0?-ft:ft):0),i.svg&&(H=t.getAttribute("transform"),i.forceCSS=t.setAttribute("transform","")||!ny(ki(t,Ht)),H&&t.setAttribute("transform",H))),Math.abs(x)>90&&Math.abs(x)<270&&(n?(f*=-1,x+=m<=0?180:-180,m+=m<=0?180:-180):(p*=-1,x+=x<=0?180:-180)),e=e||i.uncache,i.x=c-((i.xPercent=c&&(!e&&i.xPercent||(Math.round(t.offsetWidth/2)===Math.round(-c)?-50:0)))?t.offsetWidth*i.xPercent/100:0)+o,i.y=u-((i.yPercent=u&&(!e&&i.yPercent||(Math.round(t.offsetHeight/2)===Math.round(-u)?-50:0)))?t.offsetHeight*i.yPercent/100:0)+o,i.z=d+o,i.scaleX=jt(f),i.scaleY=jt(p),i.rotation=jt(m)+a,i.rotationX=jt(g)+a,i.rotationY=jt(y)+a,i.skewX=x+a,i.skewY=b+a,i.transformPerspective=v+o,(i.zOrigin=parseFloat(l.split(" ")[2])||!e&&i.zOrigin||0)&&(s[Pe]=Ch(l)),i.xOffset=i.yOffset=0,i.force3D=Oe.force3D,i.renderTransform=i.svg?FC:$0?ay:GC,i.uncache=0,i},Ch=function(t){return(t=t.split(" "))[0]+" "+t[1]},nd=function(t,e,i){var s=be(e);return jt(parseFloat(e)+parseFloat(Xr(t,"x",i+"px",s)))+s},GC=function(t,e){e.z="0px",e.rotationY=e.rotationX="0deg",e.force3D=0,ay(t,e)},Es="0deg",Eo="0px",Cs=") ",ay=function(t,e){var i=e||this,s=i.xPercent,n=i.yPercent,o=i.x,a=i.y,h=i.z,l=i.rotation,c=i.rotationY,u=i.rotationX,d=i.skewX,f=i.skewY,p=i.scaleX,m=i.scaleY,g=i.transformPerspective,y=i.force3D,x=i.target,b=i.zOrigin,v="",w=y==="auto"&&t&&t!==1||y===!0;if(b&&(u!==Es||c!==Es)){var S=parseFloat(c)*_n,C=Math.sin(S),I=Math.cos(S),R;S=parseFloat(u)*_n,R=Math.cos(S),o=nd(x,o,C*R*-b),a=nd(x,a,-Math.sin(S)*-b),h=nd(x,h,I*R*-b+b)}g!==Eo&&(v+="perspective("+g+Cs),(s||n)&&(v+="translate("+s+"%, "+n+"%) "),(w||o!==Eo||a!==Eo||h!==Eo)&&(v+=h!==Eo||w?"translate3d("+o+", "+a+", "+h+") ":"translate("+o+", "+a+Cs),l!==Es&&(v+="rotate("+l+Cs),c!==Es&&(v+="rotateY("+c+Cs),u!==Es&&(v+="rotateX("+u+Cs),(d!==Es||f!==Es)&&(v+="skew("+d+", "+f+Cs),(p!==1||m!==1)&&(v+="scale("+p+", "+m+Cs),x.style[Ht]=v||"translate(0, 0)"},FC=function(t,e){var i=e||this,s=i.xPercent,n=i.yPercent,o=i.x,a=i.y,h=i.rotation,l=i.skewX,c=i.skewY,u=i.scaleX,d=i.scaleY,f=i.target,p=i.xOrigin,m=i.yOrigin,g=i.xOffset,y=i.yOffset,x=i.forceCSS,b=parseFloat(o),v=parseFloat(a),w,S,C,I,R;h=parseFloat(h),l=parseFloat(l),c=parseFloat(c),c&&(c=parseFloat(c),l+=c,h+=c),h||l?(h*=_n,l*=_n,w=Math.cos(h)*u,S=Math.sin(h)*u,C=Math.sin(h-l)*-d,I=Math.cos(h-l)*d,l&&(c*=_n,R=Math.tan(l-c),R=Math.sqrt(1+R*R),C*=R,I*=R,c&&(R=Math.tan(c),R=Math.sqrt(1+R*R),w*=R,S*=R)),w=jt(w),S=jt(S),C=jt(C),I=jt(I)):(w=u,I=d,S=C=0),(b&&!~(o+"").indexOf("px")||v&&!~(a+"").indexOf("px"))&&(b=Xr(f,"x",o,"px"),v=Xr(f,"y",a,"px")),(p||m||g||y)&&(b=jt(b+p-(p*w+m*C)+g),v=jt(v+m-(p*S+m*I)+y)),(s||n)&&(R=f.getBBox(),b=jt(b+s/100*R.width),v=jt(v+n/100*R.height)),R="matrix("+w+","+S+","+C+","+I+","+b+","+v+")",f.setAttribute("transform",R),x&&(f.style[Ht]=R)},NC=function(t,e,i,s,n){var o=360,a=le(n),h=parseFloat(n)*(a&&~n.indexOf("rad")?Ts:1),l=h-s,c=s+l+"deg",u,d;return a&&(u=n.split("_")[1],u==="short"&&(l%=o,l!==l%(o/2)&&(l+=l<0?o:-o)),u==="cw"&&l<0?l=(l+o*K0)%o-~~(l/o)*o:u==="ccw"&&l>0&&(l=(l-o*K0)%o-~~(l/o)*o)),t._pt=d=new Me(t._pt,e,i,s,l,bC),d.e=c,d.u="deg",t._props.push(i),d},hy=function(t,e){for(var i in e)t[i]=e[i];return t},DC=function(t,e,i){var s=hy({},i._gsap),n="perspective,force3D,transformOrigin,svgOrigin",o=i.style,a,h,l,c,u,d,f,p;s.svg?(l=i.getAttribute("transform"),i.setAttribute("transform",""),o[Ht]=e,a=So(i,1),Ss(i,Ht),i.setAttribute("transform",l)):(l=getComputedStyle(i)[Ht],o[Ht]=e,a=So(i,1),o[Ht]=l);for(h in ar)l=s[h],c=a[h],l!==c&&n.indexOf(h)<0&&(f=be(l),p=be(c),u=f!==p?Xr(i,h,l,p):parseFloat(l),d=parseFloat(c),t._pt=new Me(t._pt,a,h,u,d-u,qu),t._pt.u=p||0,t._props.push(h));hy(a,s)};Re("padding,margin,Width,Radius",function(r,t){var e="Top",i="Right",s="Bottom",n="Left",o=(t<3?[e,i,s,n]:[e+n,e+i,s+i,s+n]).map(function(a){return t<2?r+a:"border"+a+r});Eh[t>1?"border"+r:r]=function(a,h,l,c,u){var d,f;if(arguments.length<4)return d=o.map(function(p){return hr(a,p,l)}),f=d.join(" "),f.split(d[0]).length===5?d[0]:f;d=(c+"").split(" "),f={},o.forEach(function(p,m){return f[p]=d[m]=d[m]||d[(m-1)/2|0]}),a.init(h,f,u)}});var ly={name:"css",register:ed,targetTest:function(t){return t.style&&t.nodeType},init:function(t,e,i,s,n){var o=this._props,a=t.style,h=i.vars.startAt,l,c,u,d,f,p,m,g,y,x,b,v,w,S,C,I;Ju||ed(),this.styles=this.styles||J0(t),I=this.styles.props,this.tween=i;for(m in e)if(m!=="autoRound"&&(c=e[m],!(Ue[m]&&N0(m,e,i,s,t,n)))){if(f=typeof c,p=Eh[m],f==="function"&&(c=c.call(i,s,t,n),f=typeof c),f==="string"&&~c.indexOf("random(")&&(c=yo(c)),p)p(this,t,m,c,i)&&(C=1);else if(m.substr(0,2)==="--")l=(getComputedStyle(t).getPropertyValue(m)+"").trim(),c+="",Or.lastIndex=0,Or.test(l)||(g=be(l),y=be(c)),y?g!==y&&(l=Xr(t,m,l,y)+y):g&&(c+=g),this.add(a,"setProperty",l,c,s,n,0,0,m),o.push(m),I.push(m,0,a[m]);else if(f!=="undefined"){if(h&&m in h?(l=typeof h[m]=="function"?h[m].call(i,s,t,n):h[m],le(l)&&~l.indexOf("random(")&&(l=yo(l)),be(l+"")||l==="auto"||(l+=Oe.units[m]||be(hr(t,m))||""),(l+"").charAt(1)==="="&&(l=hr(t,m))):l=hr(t,m),d=parseFloat(l),x=f==="string"&&c.charAt(1)==="="&&c.substr(0,2),x&&(c=c.substr(2)),u=parseFloat(c),m in Di&&(m==="autoAlpha"&&(d===1&&hr(t,"visibility")==="hidden"&&u&&(d=0),I.push("visibility",0,a.visibility),Wr(this,a,"visibility",d?"inherit":"hidden",u?"inherit":"hidden",!u)),m!=="scale"&&m!=="transform"&&(m=Di[m],~m.indexOf(",")&&(m=m.split(",")[0]))),b=m in ar,b){if(this.styles.save(m),v||(w=t._gsap,w.renderTransform&&!e.parseTransform||So(t,e.parseTransform),S=e.smoothOrigin!==!1&&w.smooth,v=this._pt=new Me(this._pt,a,Ht,0,1,w.renderTransform,w,0,-1),v.dep=1),m==="scale")this._pt=new Me(this._pt,w,"scaleY",w.scaleY,(x?pn(w.scaleY,x+u):u)-w.scaleY||0,qu),this._pt.u=0,o.push("scaleY",m),m+="X";else if(m==="transformOrigin"){I.push(Pe,0,a[Pe]),c=LC(c),w.svg?sd(t,c,0,S,0,this):(y=parseFloat(c.split(" ")[2])||0,y!==w.zOrigin&&Wr(this,w,"zOrigin",w.zOrigin,y),Wr(this,a,m,Ch(l),Ch(c)));continue}else if(m==="svgOrigin"){sd(t,c,1,S,0,this);continue}else if(m in sy){NC(this,w,m,d,x?pn(d,x+c):c);continue}else if(m==="smoothOrigin"){Wr(this,w,"smooth",w.smooth,c);continue}else if(m==="force3D"){w[m]=c;continue}else if(m==="transform"){DC(this,c,t);continue}}else m in a||(m=wn(m)||m);if(b||(u||u===0)&&(d||d===0)&&!yC.test(c)&&m in a)g=(l+"").substr((d+"").length),u||(u=0),y=be(c)||(m in Oe.units?Oe.units[m]:g),g!==y&&(d=Xr(t,m,l,y)),this._pt=new Me(this._pt,b?w:a,m,d,(x?pn(d,x+u):u)-d,!b&&(y==="px"||m==="zIndex")&&e.autoRound!==!1?_C:qu),this._pt.u=y||0,g!==y&&y!=="%"&&(this._pt.b=l,this._pt.r=xC);else if(m in a)MC.call(this,t,m,l,x?x+c:c);else if(m in t)this.add(t,m,l||t[m],x?x+c:c,s,n);else if(m!=="parseTransform"){Iu(m,c);continue}b||(m in a?I.push(m,0,a[m]):I.push(m,1,l||t[m])),o.push(m)}}C&&W0(this)},render:function(t,e){if(e.tween._time||!$u())for(var i=e._pt;i;)i.r(t,i.d),i=i._next;else e.styles.revert()},get:hr,aliases:Di,getSetter:function(t,e,i){var s=Di[e];return s&&s.indexOf(",")<0&&(e=s),e in ar&&e!==Pe&&(t._gsap.x||hr(t,"x"))?i&&H0===i?e==="scale"?SC:TC:(H0=i||{})&&(e==="scale"?EC:CC):t.style&&!vu(t.style[e])?vC:~e.indexOf("-")?wC:Hu(t,e)},core:{_removeProperty:Ss,_getMatrix:rd}};Le.utils.checkPrefix=wn,Le.core.getStyleSaver=J0,function(r,t,e,i){var s=Re(r+","+t+","+e,function(n){ar[n]=1});Re(t,function(n){Oe.units[n]="deg",sy[n]=1}),Di[s[13]]=r+","+t,Re(i,function(n){var o=n.split(":");Di[o[1]]=s[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"),Re("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(r){Oe.units[r]="px"}),Le.registerPlugin(ly);var cy=Le.registerPlugin(ly)||Le;cy.core.Tween;const Is=new mt;class kC{constructor(t={}){this._recursive=typeof t.recursive=="boolean"?t.recursive:!0,this._toggle=t.toggle||"visible",this._targetList=new Set}add(t){return this._targetList.add(t),this}addAll(t){for(let e=0,i=t.length;e<i;e++)this._targetList.add(t[e]);return this}remove(t){return this._targetList.delete(t),this}removeAll(t){for(let e=0,i=t.length;e<i;e++)this._targetList.delete(t[e]);return this}clear(){return this._targetList.clear(),this}cull(t,e=!1){return e||this.uncull(),this._targetList.forEach(i=>{e||i.getBounds(!1,Is),this._recursive?this.cullRecursive(t,i,e):(e&&i._bounds.getRectangle(t),i[this._toggle]=Is.right>t.left&&Is.left<t.right&&Is.bottom>t.top&&Is.top<t.bottom)}),this}uncull(){return this._targetList.forEach(t=>{this._recursive?this.uncullRecursive(t):t[this._toggle]=!1}),this}cullRecursive(t,e,i){const s=i?e._bounds.getRectangle(Is):e.getBounds(!0,Is);if(e[this._toggle]=s.right>t.left&&s.left<t.right&&s.bottom>t.top&&s.top<t.bottom,!(s.left>=t.left&&s.top>=t.top&&s.right<=t.right&&s.bottom<=t.bottom)&&e[this._toggle]&&e.children&&e.children.length){const o=e.children;for(let a=0,h=o.length;a<h;a++)this.cullRecursive(t,o[a])}}uncullRecursive(t){if(t[this._toggle]=!0,t.children&&t.children.length){const e=t.children;for(let i=0,s=e.length;i<s;i++)this.uncullRecursive(e[i])}}}var Ih={exports:{}};Ih.exports,function(r,t){var e=200,i="__lodash_hash_undefined__",s=1,n=2,o=9007199254740991,a="[object Arguments]",h="[object Array]",l="[object AsyncFunction]",c="[object Boolean]",u="[object Date]",d="[object Error]",f="[object Function]",p="[object GeneratorFunction]",m="[object Map]",g="[object Number]",y="[object Null]",x="[object Object]",b="[object Promise]",v="[object Proxy]",w="[object RegExp]",S="[object Set]",C="[object String]",I="[object Symbol]",R="[object Undefined]",P="[object WeakMap]",G="[object ArrayBuffer]",N="[object DataView]",A="[object Float32Array]",k="[object Float64Array]",V="[object Int8Array]",K="[object Int16Array]",H="[object Int32Array]",$="[object Uint8Array]",U="[object Uint8ClampedArray]",D="[object Uint16Array]",F="[object Uint32Array]",Z=/[\\^$.*+?()[\]{}|]/g,tt=/^\[object .+?Constructor\]$/,ft=/^(?:0|[1-9]\d*)$/,ot={};ot[A]=ot[k]=ot[V]=ot[K]=ot[H]=ot[$]=ot[U]=ot[D]=ot[F]=!0,ot[a]=ot[h]=ot[G]=ot[c]=ot[N]=ot[u]=ot[d]=ot[f]=ot[m]=ot[g]=ot[x]=ot[w]=ot[S]=ot[C]=ot[P]=!1;var Et=typeof ve=="object"&&ve&&ve.Object===Object&&ve,Mt=typeof self=="object"&&self&&self.Object===Object&&self,bt=Et||Mt||Function("return this")(),B=t&&!t.nodeType&&t,j=B&&!0&&r&&!r.nodeType&&r,J=j&&j.exports===B,O=J&&Et.process,gt=function(){try{return O&&O.binding&&O.binding("util")}catch{}}(),ut=gt&&gt.isTypedArray;function It(T,M){for(var _=-1,E=T==null?0:T.length,L=0,X=[];++_<E;){var ct=T[_];M(ct,_,T)&&(X[L++]=ct)}return X}function Dt(T,M){for(var _=-1,E=M.length,L=T.length;++_<E;)T[L+_]=M[_];return T}function Ee(T,M){for(var _=-1,E=T==null?0:T.length;++_<E;)if(M(T[_],_,T))return!0;return!1}function ri(T,M){for(var _=-1,E=Array(T);++_<T;)E[_]=M(_);return E}function Xo(T){return function(M){return T(M)}}function Kr(T,M){return T.has(M)}function Fs(T,M){return T==null?void 0:T[M]}function Ns(T){var M=-1,_=Array(T.size);return T.forEach(function(E,L){_[++M]=[L,E]}),_}function gi(T,M){return function(_){return T(M(_))}}function tl(T){var M=-1,_=Array(T.size);return T.forEach(function(E){_[++M]=E}),_}var el=Array.prototype,Wd=Function.prototype,Gn=Object.prototype,Yr=bt["__core-js_shared__"],Zo=Wd.toString,Ze=Gn.hasOwnProperty,Vo=function(){var T=/[^.]+$/.exec(Yr&&Yr.keys&&Yr.keys.IE_PROTO||"");return T?"Symbol(src)_1."+T:""}(),Ho=Gn.toString,il=RegExp("^"+Zo.call(Ze).replace(Z,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),rl=J?bt.Buffer:void 0,Fn=bt.Symbol,Xi=bt.Uint8Array,Ds=Gn.propertyIsEnumerable,Xd=el.splice,Zi=Fn?Fn.toStringTag:void 0,sl=Object.getOwnPropertySymbols,nl=rl?rl.isBuffer:void 0,ks=gi(Object.keys,Object),Ko=xr(bt,"DataView"),Ve=xr(bt,"Map"),Yo=xr(bt,"Promise"),zo=xr(bt,"Set"),jo=xr(bt,"WeakMap"),Os=xr(Object,"create"),Zd=bi(Ko),yi=bi(Ve),Vd=bi(Yo),Hd=bi(zo),Kd=bi(jo),ol=Fn?Fn.prototype:void 0,Jo=ol?ol.valueOf:void 0;function Ne(T){var M=-1,_=T==null?0:T.length;for(this.clear();++M<_;){var E=T[M];this.set(E[0],E[1])}}function Yd(){this.__data__=Os?Os(null):{},this.size=0}function zd(T){var M=this.has(T)&&delete this.__data__[T];return this.size-=M?1:0,M}function jd(T){var M=this.__data__;if(Os){var _=M[T];return _===i?void 0:_}return Ze.call(M,T)?M[T]:void 0}function Jd(T){var M=this.__data__;return Os?M[T]!==void 0:Ze.call(M,T)}function $d(T,M){var _=this.__data__;return this.size+=this.has(T)?0:1,_[T]=Os&&M===void 0?i:M,this}Ne.prototype.clear=Yd,Ne.prototype.delete=zd,Ne.prototype.get=jd,Ne.prototype.has=Jd,Ne.prototype.set=$d;function xe(T){var M=-1,_=T==null?0:T.length;for(this.clear();++M<_;){var E=T[M];this.set(E[0],E[1])}}function Qd(){this.__data__=[],this.size=0}function qd(T){var M=this.__data__,_=Dn(M,T);if(_<0)return!1;var E=M.length-1;return _==E?M.pop():Xd.call(M,_,1),--this.size,!0}function tf(T){var M=this.__data__,_=Dn(M,T);return _<0?void 0:M[_][1]}function ef(T){return Dn(this.__data__,T)>-1}function rf(T,M){var _=this.__data__,E=Dn(_,T);return E<0?(++this.size,_.push([T,M])):_[E][1]=M,this}xe.prototype.clear=Qd,xe.prototype.delete=qd,xe.prototype.get=tf,xe.prototype.has=ef,xe.prototype.set=rf;function yr(T){var M=-1,_=T==null?0:T.length;for(this.clear();++M<_;){var E=T[M];this.set(E[0],E[1])}}function $o(){this.size=0,this.__data__={hash:new Ne,map:new(Ve||xe),string:new Ne}}function sf(T){var M=On(this,T).delete(T);return this.size-=M?1:0,M}function Nn(T){return On(this,T).get(T)}function Qo(T){return On(this,T).has(T)}function nf(T,M){var _=On(this,T),E=_.size;return _.set(T,M),this.size+=_.size==E?0:1,this}yr.prototype.clear=$o,yr.prototype.delete=sf,yr.prototype.get=Nn,yr.prototype.has=Qo,yr.prototype.set=nf;function br(T){var M=-1,_=T==null?0:T.length;for(this.__data__=new yr;++M<_;)this.add(T[M])}function al(T){return this.__data__.set(T,i),this}function of(T){return this.__data__.has(T)}br.prototype.add=br.prototype.push=al,br.prototype.has=of;function Vi(T){var M=this.__data__=new xe(T);this.size=M.size}function af(){this.__data__=new xe,this.size=0}function hl(T){var M=this.__data__,_=M.delete(T);return this.size=M.size,_}function hf(T){return this.__data__.get(T)}function lf(T){return this.__data__.has(T)}function cf(T,M){var _=this.__data__;if(_ instanceof xe){var E=_.__data__;if(!Ve||E.length<e-1)return E.push([T,M]),this.size=++_.size,this;_=this.__data__=new yr(E)}return _.set(T,M),this.size=_.size,this}Vi.prototype.clear=af,Vi.prototype.delete=hl,Vi.prototype.get=hf,Vi.prototype.has=lf,Vi.prototype.set=cf;function uf(T,M){var _=Wn(T),E=!_&&ea(T),L=!_&&!E&&Us(T),X=!_&&!E&&!L&&yl(T),ct=_||E||L||X,yt=ct?ri(T.length,String):[],_t=yt.length;for(var ht in T)(M||Ze.call(T,ht))&&!(ct&&(ht=="length"||L&&(ht=="offset"||ht=="parent")||X&&(ht=="buffer"||ht=="byteLength"||ht=="byteOffset")||ta(ht,_t)))&&yt.push(ht);return yt}function Dn(T,M){for(var _=T.length;_--;)if(Un(T[_][0],M))return _;return-1}function df(T,M,_){var E=M(T);return Wn(T)?E:Dt(E,_(T))}function Bs(T){return T==null?T===void 0?R:y:Zi&&Zi in Object(T)?gf(T):Bn(T)}function ll(T){return jr(T)&&Bs(T)==a}function cl(T,M,_,E,L){return T===M?!0:T==null||M==null||!jr(T)&&!jr(M)?T!==T&&M!==M:ff(T,M,_,E,cl,L)}function ff(T,M,_,E,L,X){var ct=Wn(T),yt=Wn(M),_t=ct?h:Hi(T),ht=yt?h:Hi(M);_t=_t==a?x:_t,ht=ht==a?x:ht;var vt=_t==x,Ut=ht==x,Lt=_t==ht;if(Lt&&Us(T)){if(!Us(M))return!1;ct=!0,vt=!1}if(Lt&&!vt)return X||(X=new Vi),ct||yl(T)?ul(T,M,_,E,L,X):dl(T,M,_t,_,E,L,X);if(!(_&s)){var de=vt&&Ze.call(T,"__wrapped__"),_e=Ut&&Ze.call(M,"__wrapped__");if(de||_e){var si=de?T.value():T,ni=_e?M.value():M;return X||(X=new Vi),L(si,ni,_,E,X)}}return Lt?(X||(X=new Vi),mf(T,M,_,E,L,X)):!1}function kn(T){if(!gl(T)||xf(T))return!1;var M=Ki(T)?il:tt;return M.test(bi(T))}function qo(T){return jr(T)&&zr(T.length)&&!!ot[Bs(T)]}function pf(T){if(!_f(T))return ks(T);var M=[];for(var _ in Object(T))Ze.call(T,_)&&_!="constructor"&&M.push(_);return M}function ul(T,M,_,E,L,X){var ct=_&s,yt=T.length,_t=M.length;if(yt!=_t&&!(ct&&_t>yt))return!1;var ht=X.get(T);if(ht&&X.get(M))return ht==M;var vt=-1,Ut=!0,Lt=_&n?new br:void 0;for(X.set(T,M),X.set(M,T);++vt<yt;){var de=T[vt],_e=M[vt];if(E)var si=ct?E(_e,de,vt,M,T,X):E(de,_e,vt,T,M,X);if(si!==void 0){if(si)continue;Ut=!1;break}if(Lt){if(!Ee(M,function(ni,Ws){if(!Kr(Lt,Ws)&&(de===ni||L(de,ni,_,E,X)))return Lt.push(Ws)})){Ut=!1;break}}else if(!(de===_e||L(de,_e,_,E,X))){Ut=!1;break}}return X.delete(T),X.delete(M),Ut}function dl(T,M,_,E,L,X,ct){switch(_){case N:if(T.byteLength!=M.byteLength||T.byteOffset!=M.byteOffset)return!1;T=T.buffer,M=M.buffer;case G:return!(T.byteLength!=M.byteLength||!X(new Xi(T),new Xi(M)));case c:case u:case g:return Un(+T,+M);case d:return T.name==M.name&&T.message==M.message;case w:case C:return T==M+"";case m:var yt=Ns;case S:var _t=E&s;if(yt||(yt=tl),T.size!=M.size&&!_t)return!1;var ht=ct.get(T);if(ht)return ht==M;E|=n,ct.set(T,M);var vt=ul(yt(T),yt(M),E,L,X,ct);return ct.delete(T),vt;case I:if(Jo)return Jo.call(T)==Jo.call(M)}return!1}function mf(T,M,_,E,L,X){var ct=_&s,yt=fl(T),_t=yt.length,ht=fl(M),vt=ht.length;if(_t!=vt&&!ct)return!1;for(var Ut=_t;Ut--;){var Lt=yt[Ut];if(!(ct?Lt in M:Ze.call(M,Lt)))return!1}var de=X.get(T);if(de&&X.get(M))return de==M;var _e=!0;X.set(T,M),X.set(M,T);for(var si=ct;++Ut<_t;){Lt=yt[Ut];var ni=T[Lt],Ws=M[Lt];if(E)var Qb=ct?E(Ws,ni,Lt,M,T,X):E(ni,Ws,Lt,T,M,X);if(!(Qb===void 0?ni===Ws||L(ni,Ws,_,E,X):Qb)){_e=!1;break}si||(si=Lt=="constructor")}if(_e&&!si){var xl=T.constructor,_l=M.constructor;xl!=_l&&"constructor"in T&&"constructor"in M&&!(typeof xl=="function"&&xl instanceof xl&&typeof _l=="function"&&_l instanceof _l)&&(_e=!1)}return X.delete(T),X.delete(M),_e}function fl(T){return df(T,bl,yf)}function On(T,M){var _=T.__data__;return bf(M)?_[typeof M=="string"?"string":"hash"]:_.map}function xr(T,M){var _=Fs(T,M);return kn(_)?_:void 0}function gf(T){var M=Ze.call(T,Zi),_=T[Zi];try{T[Zi]=void 0;var E=!0}catch{}var L=Ho.call(T);return E&&(M?T[Zi]=_:delete T[Zi]),L}var yf=sl?function(T){return T==null?[]:(T=Object(T),It(sl(T),function(M){return Ds.call(T,M)}))}:vf,Hi=Bs;(Ko&&Hi(new Ko(new ArrayBuffer(1)))!=N||Ve&&Hi(new Ve)!=m||Yo&&Hi(Yo.resolve())!=b||zo&&Hi(new zo)!=S||jo&&Hi(new jo)!=P)&&(Hi=function(T){var M=Bs(T),_=M==x?T.constructor:void 0,E=_?bi(_):"";if(E)switch(E){case Zd:return N;case yi:return m;case Vd:return b;case Hd:return S;case Kd:return P}return M});function ta(T,M){return M=M??o,!!M&&(typeof T=="number"||ft.test(T))&&T>-1&&T%1==0&&T<M}function bf(T){var M=typeof T;return M=="string"||M=="number"||M=="symbol"||M=="boolean"?T!=="__proto__":T===null}function xf(T){return!!Vo&&Vo in T}function _f(T){var M=T&&T.constructor,_=typeof M=="function"&&M.prototype||Gn;return T===_}function Bn(T){return Ho.call(T)}function bi(T){if(T!=null){try{return Zo.call(T)}catch{}try{return T+""}catch{}}return""}function Un(T,M){return T===M||T!==T&&M!==M}var ea=ll(function(){return arguments}())?ll:function(T){return jr(T)&&Ze.call(T,"callee")&&!Ds.call(T,"callee")},Wn=Array.isArray;function pl(T){return T!=null&&zr(T.length)&&!Ki(T)}var Us=nl||wf;function ml(T,M){return cl(T,M)}function Ki(T){if(!gl(T))return!1;var M=Bs(T);return M==f||M==p||M==l||M==v}function zr(T){return typeof T=="number"&&T>-1&&T%1==0&&T<=o}function gl(T){var M=typeof T;return T!=null&&(M=="object"||M=="function")}function jr(T){return T!=null&&typeof T=="object"}var yl=ut?Xo(ut):qo;function bl(T){return pl(T)?uf(T):pf(T)}function vf(){return[]}function wf(){return!1}r.exports=ml}(Ih,Ih.exports);var OC=Ih.exports;const uy=Vs(OC);var BC=Object.defineProperty,UC=(r,t,e)=>t in r?BC(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,W=(r,t,e)=>(UC(r,typeof t!="symbol"?t+"":t,e),e);class qe{constructor(t){W(this,"parent"),W(this,"paused"),this.parent=t,this.paused=!1}destroy(){}down(t){return!1}move(t){return!1}up(t){return!1}wheel(t){return!1}update(t){}resize(){}reset(){}pause(){this.paused=!0}resume(){this.paused=!1}}var WC=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},dy={exports:{}};(function(r,t){(function(){var e,i;i=function(s){return r.exports=s},e={linear:function(s,n,o,a){return o*s/a+n},easeInQuad:function(s,n,o,a){return o*(s/=a)*s+n},easeOutQuad:function(s,n,o,a){return-o*(s/=a)*(s-2)+n},easeInOutQuad:function(s,n,o,a){return(s/=a/2)<1?o/2*s*s+n:-o/2*(--s*(s-2)-1)+n},easeInCubic:function(s,n,o,a){return o*(s/=a)*s*s+n},easeOutCubic:function(s,n,o,a){return o*((s=s/a-1)*s*s+1)+n},easeInOutCubic:function(s,n,o,a){return(s/=a/2)<1?o/2*s*s*s+n:o/2*((s-=2)*s*s+2)+n},easeInQuart:function(s,n,o,a){return o*(s/=a)*s*s*s+n},easeOutQuart:function(s,n,o,a){return-o*((s=s/a-1)*s*s*s-1)+n},easeInOutQuart:function(s,n,o,a){return(s/=a/2)<1?o/2*s*s*s*s+n:-o/2*((s-=2)*s*s*s-2)+n},easeInQuint:function(s,n,o,a){return o*(s/=a)*s*s*s*s+n},easeOutQuint:function(s,n,o,a){return o*((s=s/a-1)*s*s*s*s+1)+n},easeInOutQuint:function(s,n,o,a){return(s/=a/2)<1?o/2*s*s*s*s*s+n:o/2*((s-=2)*s*s*s*s+2)+n},easeInSine:function(s,n,o,a){return-o*Math.cos(s/a*(Math.PI/2))+o+n},easeOutSine:function(s,n,o,a){return o*Math.sin(s/a*(Math.PI/2))+n},easeInOutSine:function(s,n,o,a){return-o/2*(Math.cos(Math.PI*s/a)-1)+n},easeInExpo:function(s,n,o,a){return s===0?n:o*Math.pow(2,10*(s/a-1))+n},easeOutExpo:function(s,n,o,a){return s===a?n+o:o*(-Math.pow(2,-10*s/a)+1)+n},easeInOutExpo:function(s,n,o,a){return(s/=a/2)<1?o/2*Math.pow(2,10*(s-1))+n:o/2*(-Math.pow(2,-10*--s)+2)+n},easeInCirc:function(s,n,o,a){return-o*(Math.sqrt(1-(s/=a)*s)-1)+n},easeOutCirc:function(s,n,o,a){return o*Math.sqrt(1-(s=s/a-1)*s)+n},easeInOutCirc:function(s,n,o,a){return(s/=a/2)<1?-o/2*(Math.sqrt(1-s*s)-1)+n:o/2*(Math.sqrt(1-(s-=2)*s)+1)+n},easeInElastic:function(s,n,o,a){var h,l,c;return c=1.70158,l=0,h=o,s===0||(s/=a),l||(l=a*.3),h<Math.abs(o)?(h=o,c=l/4):c=l/(2*Math.PI)*Math.asin(o/h),-(h*Math.pow(2,10*(s-=1))*Math.sin((s*a-c)*(2*Math.PI)/l))+n},easeOutElastic:function(s,n,o,a){var h,l,c;return c=1.70158,l=0,h=o,s===0||(s/=a),l||(l=a*.3),h<Math.abs(o)?(h=o,c=l/4):c=l/(2*Math.PI)*Math.asin(o/h),h*Math.pow(2,-10*s)*Math.sin((s*a-c)*(2*Math.PI)/l)+o+n},easeInOutElastic:function(s,n,o,a){var h,l,c;return c=1.70158,l=0,h=o,s===0||(s/=a/2),l||(l=a*(.3*1.5)),h<Math.abs(o)?(h=o,c=l/4):c=l/(2*Math.PI)*Math.asin(o/h),s<1?-.5*(h*Math.pow(2,10*(s-=1))*Math.sin((s*a-c)*(2*Math.PI)/l))+n:h*Math.pow(2,-10*(s-=1))*Math.sin((s*a-c)*(2*Math.PI)/l)*.5+o+n},easeInBack:function(s,n,o,a,h){return h===void 0&&(h=1.70158),o*(s/=a)*s*((h+1)*s-h)+n},easeOutBack:function(s,n,o,a,h){return h===void 0&&(h=1.70158),o*((s=s/a-1)*s*((h+1)*s+h)+1)+n},easeInOutBack:function(s,n,o,a,h){return h===void 0&&(h=1.70158),(s/=a/2)<1?o/2*(s*s*(((h*=1.525)+1)*s-h))+n:o/2*((s-=2)*s*(((h*=1.525)+1)*s+h)+2)+n},easeInBounce:function(s,n,o,a){var h;return h=e.easeOutBounce(a-s,0,o,a),o-h+n},easeOutBounce:function(s,n,o,a){return(s/=a)<1/2.75?o*(7.5625*s*s)+n:s<2/2.75?o*(7.5625*(s-=1.5/2.75)*s+.75)+n:s<2.5/2.75?o*(7.5625*(s-=2.25/2.75)*s+.9375)+n:o*(7.5625*(s-=2.625/2.75)*s+.984375)+n},easeInOutBounce:function(s,n,o,a){var h;return s<a/2?(h=e.easeInBounce(s*2,0,o,a),h*.5+n):(h=e.easeOutBounce(s*2-a,0,o,a),h*.5+o*.5+n)}},i(e)}).call(WC)})(dy);const fy=dy.exports;function Ah(r,t){if(r){if(typeof r=="function")return r;if(typeof r=="string")return fy[r]}else return fy[t]}const XC={removeOnInterrupt:!1,ease:"linear",time:1e3};class ZC extends qe{constructor(t,e={}){super(t),W(this,"options"),W(this,"startX"),W(this,"startY"),W(this,"deltaX"),W(this,"deltaY"),W(this,"keepCenter"),W(this,"startWidth",null),W(this,"startHeight",null),W(this,"deltaWidth",null),W(this,"deltaHeight",null),W(this,"width",null),W(this,"height",null),W(this,"time",0),this.options=Object.assign({},XC,e),this.options.ease=Ah(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(t){if(this.paused)return;this.time+=t;const e=new dt(this.parent.scale.x,this.parent.scale.y);if(this.time>=this.options.time){const i=this.parent.width,s=this.parent.height;this.complete(),(i!==this.parent.width||s!==this.parent.height)&&this.parent.emit("zoomed",{viewport:this.parent,original:e,type:"animate"})}else{const i=this.options.ease(this.time,0,1,this.options.time);if(this.width!==null){const s=this.startWidth,n=this.deltaWidth;this.parent.fitWidth(s+n*i,this.keepCenter,this.height===null)}if(this.height!==null){const s=this.startHeight,n=this.deltaHeight;this.parent.fitHeight(s+n*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 s=this.startX,n=this.startY,o=this.deltaX,a=this.deltaY,h=new dt(this.parent.x,this.parent.y);this.parent.moveCenter(s+o*i,n+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:e,type:"animate"})}}}const VC={sides:"all",friction:.5,time:150,ease:"easeInOutSine",underflow:"center",bounceBox:null};class HC extends qe{constructor(t,e={}){super(t),W(this,"options"),W(this,"left"),W(this,"top"),W(this,"right"),W(this,"bottom"),W(this,"underflowX"),W(this,"underflowY"),W(this,"ease"),W(this,"toX"),W(this,"toY"),this.options=Object.assign({},VC,e),this.ease=Ah(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(t){if(!this.paused){if(this.bounce(),this.toX){const e=this.toX;e.time+=t,this.parent.emit("moved",{viewport:this.parent,type:"bounce-x"}),e.time>=this.options.time?(this.parent.x=e.end,this.toX=null,this.parent.emit("bounce-x-end",this.parent)):this.parent.x=this.ease(e.time,e.start,e.delta,this.options.time)}if(this.toY){const e=this.toY;e.time+=t,this.parent.emit("moved",{viewport:this.parent,type:"bounce-y"}),e.time>=this.options.time?(this.parent.y=e.end,this.toY=null,this.parent.emit("bounce-y-end",this.parent)):this.parent.y=this.ease(e.time,e.start,e.delta,this.options.time)}}}calcUnderflowX(){let t;switch(this.underflowX){case-1:t=0;break;case 1:t=this.parent.screenWidth-this.parent.screenWorldWidth;break;default:t=(this.parent.screenWidth-this.parent.screenWorldWidth)/2}return t}calcUnderflowY(){let t;switch(this.underflowY){case-1:t=0;break;case 1:t=this.parent.screenHeight-this.parent.screenWorldHeight;break;default:t=(this.parent.screenHeight-this.parent.screenWorldHeight)/2}return t}oob(){const t=this.options.bounceBox;if(t){const e=typeof t.x>"u"?0:t.x,i=typeof t.y>"u"?0:t.y,s=typeof t.width>"u"?this.parent.worldWidth:t.width,n=typeof t.height>"u"?this.parent.worldHeight:t.height;return{left:this.parent.left<e,right:this.parent.right>s,top:this.parent.top<i,bottom:this.parent.bottom>n,topLeft:new dt(e*this.parent.scale.x,i*this.parent.scale.y),bottomRight:new dt(s*this.parent.scale.x-this.parent.screenWidth,n*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 dt(0,0),bottomRight:new dt(this.parent.worldWidth*this.parent.scale.x-this.parent.screenWidth,this.parent.worldHeight*this.parent.scale.y-this.parent.screenHeight)}}bounce(){var t,e;if(this.paused)return;let i,s=this.parent.plugins.get("decelerate",!0);s&&(s.x||s.y)&&(s.x&&s.percentChangeX===((t=s.options)==null?void 0:t.friction)||s.y&&s.percentChangeY===((e=s.options)==null?void 0:e.friction))&&(i=this.oob(),(i.left&&this.left||i.right&&this.right)&&(s.percentChangeX=this.options.friction),(i.top&&this.top||i.bottom&&this.bottom)&&(s.percentChangeY=this.options.friction));const n=this.parent.plugins.get("drag",!0)||{},o=this.parent.plugins.get("pinch",!0)||{};if(s=s||{},!(n!=null&&n.active)&&!(o!=null&&o.active)&&(!this.toX||!this.toY)&&(!s.x||!s.y)){i=i||this.oob();const a=i.topLeft,h=i.bottomRight;if(!this.toX&&!s.x){let l=null;i.left&&this.left?l=this.parent.screenWorldWidth<this.parent.screenWidth?this.calcUnderflowX():-a.x:i.right&&this.right&&(l=this.parent.screenWorldWidth<this.parent.screenWidth?this.calcUnderflowX():-h.x),l!==null&&this.parent.x!==l&&(this.toX={time:0,start:this.parent.x,delta:l-this.parent.x,end:l},this.parent.emit("bounce-x-start",this.parent))}if(!this.toY&&!s.y){let l=null;i.top&&this.top?l=this.parent.screenWorldHeight<this.parent.screenHeight?this.calcUnderflowY():-a.y:i.bottom&&this.bottom&&(l=this.parent.screenWorldHeight<this.parent.screenHeight?this.calcUnderflowY():-h.y),l!==null&&this.parent.y!==l&&(this.toY={time:0,start:this.parent.y,delta:l-this.parent.y,end:l},this.parent.emit("bounce-y-start",this.parent))}}}reset(){this.toX=this.toY=null,this.bounce()}}const KC={left:!1,right:!1,top:!1,bottom:!1,direction:null,underflow:"center"};class YC extends qe{constructor(t,e={}){super(t),W(this,"options"),W(this,"last"),W(this,"noUnderflow"),W(this,"underflowX"),W(this,"underflowY"),this.options=Object.assign({},KC,e),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 t=this.options.underflow.toLowerCase();t==="none"?this.noUnderflow=!0:t==="center"?(this.underflowX=this.underflowY=0,this.noUnderflow=!1):(this.underflowX=t.indexOf("left")!==-1?-1:t.indexOf("right")!==-1?1:0,this.underflowY=t.indexOf("top")!==-1?-1:t.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 t=new dt(this.parent.x,this.parent.y),e=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,e.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,e.x=0,i=!0);i&&this.parent.emit("moved",{viewport:this.parent,original:t,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,e.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,e.y=0,i=!0);i&&this.parent.emit("moved",{viewport:this.parent,original:t,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 zC={minWidth:null,minHeight:null,maxWidth:null,maxHeight:null,minScale:null,maxScale:null};class jC extends qe{constructor(t,e={}){super(t),W(this,"options"),this.options=Object.assign({},zC,e),this.clamp()}resize(){this.clamp()}clamp(){if(!this.paused){if(this.options.minWidth||this.options.minHeight||this.options.maxWidth||this.options.maxHeight){let t=this.parent.worldScreenWidth,e=this.parent.worldScreenHeight;if(this.options.minWidth!==null&&t<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,t=this.parent.worldScreenWidth,e=this.parent.worldScreenHeight,this.parent.emit("zoomed",{viewport:this.parent,type:"clamp-zoom"})}if(this.options.maxWidth!==null&&t>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,t=this.parent.worldScreenWidth,e=this.parent.worldScreenHeight,this.parent.emit("zoomed",{viewport:this.parent,type:"clamp-zoom"})}if(this.options.minHeight!==null&&e<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,t=this.parent.worldScreenWidth,e=this.parent.worldScreenHeight,this.parent.emit("zoomed",{viewport:this.parent,type:"clamp-zoom"})}if(this.options.maxHeight!==null&&e>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 t={x:null,y:null},e={x:null,y:null};if(typeof this.options.minScale=="number")t.x=this.options.minScale,t.y=this.options.minScale;else if(this.options.minScale!==null){const n=this.options.minScale;t.x=typeof n.x>"u"?null:n.x,t.y=typeof n.y>"u"?null:n.y}if(typeof this.options.maxScale=="number")e.x=this.options.maxScale,e.y=this.options.maxScale;else if(this.options.maxScale!==null){const n=this.options.maxScale;e.x=typeof n.x>"u"?null:n.x,e.y=typeof n.y>"u"?null:n.y}let i=this.parent.scale.x,s=this.parent.scale.y;t.x!==null&&i<t.x&&(i=t.x),e.x!==null&&i>e.x&&(i=e.x),t.y!==null&&s<t.y&&(s=t.y),e.y!==null&&s>e.y&&(s=e.y),(i!==this.parent.scale.x||s!==this.parent.scale.y)&&(this.parent.scale.set(i,s),this.parent.emit("zoomed",{viewport:this.parent,type:"clamp-zoom"}))}}}reset(){this.clamp()}}const JC={friction:.98,bounce:.8,minSpeed:.01},Zr=16;class $C extends qe{constructor(t,e={}){super(t),W(this,"options"),W(this,"x"),W(this,"y"),W(this,"percentChangeX"),W(this,"percentChangeY"),W(this,"saved"),W(this,"timeSinceRelease"),this.options=Object.assign({},JC,e),this.saved=[],this.timeSinceRelease=0,this.reset(),this.parent.on("moved",i=>this.handleMoved(i))}down(){return this.saved=[],this.x=this.y=null,!1}isActive(){return!!(this.x||this.y)}move(){if(this.paused)return!1;const t=this.parent.input.count();return(t===1||t>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}handleMoved(t){if(this.saved.length){const e=this.saved[this.saved.length-1];t.type==="clamp-x"&&t.original?e.x===t.original.x&&(e.x=this.parent.x):t.type==="clamp-y"&&t.original&&e.y===t.original.y&&(e.y=this.parent.y)}}up(){if(this.parent.input.count()===0&&this.saved.length){const t=performance.now();for(const e of this.saved)if(e.time>=t-100){const i=t-e.time;this.x=(this.parent.x-e.x)/i,this.y=(this.parent.y-e.y)/i,this.percentChangeX=this.percentChangeY=this.options.friction,this.timeSinceRelease=0;break}}return!1}activate(t){t=t||{},typeof t.x<"u"&&(this.x=t.x,this.percentChangeX=this.options.friction),typeof t.y<"u"&&(this.y=t.y,this.percentChangeY=this.options.friction)}update(t){if(this.paused)return;const e=this.x||this.y,i=this.timeSinceRelease,s=this.timeSinceRelease+t;if(this.x){const n=this.percentChangeX,o=Math.log(n);this.parent.x+=this.x*Zr/o*(Math.pow(n,s/Zr)-Math.pow(n,i/Zr)),this.x*=Math.pow(this.percentChangeX,t/Zr)}if(this.y){const n=this.percentChangeY,o=Math.log(n);this.parent.y+=this.y*Zr/o*(Math.pow(n,s/Zr)-Math.pow(n,i/Zr)),this.y*=Math.pow(this.percentChangeY,t/Zr)}this.timeSinceRelease+=t,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)),e&&this.parent.emit("moved",{viewport:this.parent,type:"decelerate"})}reset(){this.x=this.y=null}}const QC={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 qC extends qe{constructor(t,e={}){super(t),W(this,"options"),W(this,"moved"),W(this,"reverse"),W(this,"xDirection"),W(this,"yDirection"),W(this,"keyIsPressed"),W(this,"mouse"),W(this,"underflowX"),W(this,"underflowY"),W(this,"last"),W(this,"current"),W(this,"windowEventHandlers",[]),this.options=Object.assign({},QC,e),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(t){const e=s=>{t.includes(s.code)&&(this.keyIsPressed=!0)},i=s=>{t.includes(s.code)&&(this.keyIsPressed=!1)};this.addWindowEventHandler("keyup",i),this.addWindowEventHandler("keydown",e)}addWindowEventHandler(t,e){window.addEventListener(t,e),this.windowEventHandlers.push({event:t,handler:e})}destroy(){this.windowEventHandlers.forEach(({event:t,handler:e})=>{window.removeEventListener(t,e)})}mouseButtons(t){!t||t==="all"?this.mouse=[!0,!0,!0]:this.mouse=[t.indexOf("left")!==-1,t.indexOf("middle")!==-1,t.indexOf("right")!==-1]}parseUnderflow(){const t=this.options.underflow.toLowerCase();t==="center"?(this.underflowX=0,this.underflowY=0):(t.includes("left")?this.underflowX=-1:t.includes("right")?this.underflowX=1:this.underflowX=0,t.includes("top")?this.underflowY=-1:t.includes("bottom")?this.underflowY=1:this.underflowY=0)}checkButtons(t){const e=t.pointerType==="mouse",i=this.parent.input.count();return!!((i===1||i>1&&!this.parent.plugins.get("pinch",!0))&&(!e||this.mouse[t.button]))}checkKeyPress(t){return!this.options.keyToPress||this.keyIsPressed||this.options.ignoreKeyToPressOnTouch&&t.data.pointerType==="touch"}down(t){return this.paused||!this.options.pressDrag?!1:this.checkButtons(t)&&this.checkKeyPress(t)?(this.last={x:t.global.x,y:t.global.y},this.current=t.pointerId,!0):(this.last=null,!1)}get active(){return this.moved}move(t){if(this.paused||!this.options.pressDrag)return!1;if(this.last&&this.current===t.data.pointerId){const e=t.global.x,i=t.global.y,s=this.parent.input.count();if(s===1||s>1&&!this.parent.plugins.get("pinch",!0)){const n=e-this.last.x,o=i-this.last.y;if(this.moved||this.xDirection&&this.parent.input.checkThreshold(n)||this.yDirection&&this.parent.input.checkThreshold(o)){const a={x:e,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:t,screen:new dt(this.last.x,this.last.y),world:this.parent.toWorld(new dt(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(t){if(this.paused)return!1;const e=this.parent.input.touches;if(e.length===1){const i=e[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 dt(this.last.x,this.last.y);return this.parent.emit("drag-end",{event:t,screen:i,world:this.parent.toWorld(i),viewport:this.parent}),this.last=null,this.moved=!1,!0}return!1}wheel(t){if(this.paused)return!1;if(this.options.wheel){const e=this.parent.plugins.get("wheel",!0);if(!e||!e.options.wheelZoom&&!t.ctrlKey){const i=t.deltaMode?this.options.lineHeight:1,s=[t.deltaX,t.deltaY],[n,o]=this.options.wheelSwapAxes?s.reverse():s;return this.xDirection&&(this.parent.x+=n*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||t.preventDefault(),this.parent.options.stopPropagation&&t.stopPropagation(),!0}}return!1}resume(){this.last=null,this.paused=!1}clamp(){const t=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,t.x=0):this.parent.right>this.parent.worldWidth&&(this.parent.x=-this.parent.worldWidth*this.parent.scale.x+this.parent.screenWidth,t.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,t.y=0),this.parent.bottom>this.parent.worldHeight&&(this.parent.y=-this.parent.worldHeight*this.parent.scale.y+this.parent.screenHeight,t.y=0)}}const tI={speed:0,acceleration:null,radius:null};class eI extends qe{constructor(t,e,i={}){super(t),W(this,"options"),W(this,"target"),W(this,"velocity"),this.target=e,this.options=Object.assign({},tI,i),this.velocity={x:0,y:0}}update(t){if(this.paused)return;const e=this.parent.center;let i=this.target.x,s=this.target.y;if(this.options.radius)if(Math.sqrt(Math.pow(this.target.y-e.y,2)+Math.pow(this.target.x-e.x,2))>this.options.radius){const a=Math.atan2(this.target.y-e.y,this.target.x-e.x);i=this.target.x-Math.cos(a)*this.options.radius,s=this.target.y-Math.sin(a)*this.options.radius}else return;const n=i-e.x,o=s-e.y;if(n||o)if(this.options.speed)if(this.options.acceleration){const a=Math.atan2(s-e.y,i-e.x),h=Math.sqrt(Math.pow(n,2)+Math.pow(o,2));if(h){const l=(Math.pow(this.velocity.x,2)+Math.pow(this.velocity.y,2))/(2*this.options.acceleration);h>l?this.velocity={x:Math.min(this.velocity.x+(this.options.acceleration*t,this.options.speed)),y:Math.min(this.velocity.y+(this.options.acceleration*t,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 c=Math.cos(a)*this.velocity.x,u=Math.sin(a)*this.velocity.y,d=Math.abs(c)>Math.abs(n)?i:e.x+c,f=Math.abs(u)>Math.abs(o)?s:e.y+u;this.parent.moveCenter(d,f),this.parent.emit("moved",{viewport:this.parent,type:"follow"})}}else{const a=Math.atan2(s-e.y,i-e.x),h=Math.cos(a)*this.options.speed,l=Math.sin(a)*this.options.speed,c=Math.abs(h)>Math.abs(n)?i:e.x+h,u=Math.abs(l)>Math.abs(o)?s:e.y+l;this.parent.moveCenter(c,u),this.parent.emit("moved",{viewport:this.parent,type:"follow"})}else this.parent.moveCenter(i,s),this.parent.emit("moved",{viewport:this.parent,type:"follow"})}}const iI={radius:null,distance:null,top:null,bottom:null,left:null,right:null,speed:8,reverse:!1,noDecelerate:!1,linear:!1,allowButtons:!1};class rI extends qe{constructor(t,e={}){super(t),W(this,"options"),W(this,"reverse"),W(this,"radiusSquared"),W(this,"left"),W(this,"top"),W(this,"right"),W(this,"bottom"),W(this,"horizontal"),W(this,"vertical"),this.options=Object.assign({},iI,e),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 t=this.options.distance;t!==null?(this.left=t,this.top=t,this.right=this.parent.screenWidth-t,this.bottom=this.parent.screenHeight-t):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(t){if(this.paused||t.pointerType!=="mouse"&&t.pointerId!==1||!this.options.allowButtons&&t.buttons!==0)return!1;const e=t.global.x,i=t.global.y;if(this.radiusSquared){const s=this.parent.toScreen(this.parent.center);if(Math.pow(s.x-e,2)+Math.pow(s.y-i,2)>=this.radiusSquared){const n=Math.atan2(s.y-i,s.x-e);this.options.linear?(this.horizontal=Math.round(Math.cos(n))*this.options.speed*this.reverse*(60/1e3),this.vertical=Math.round(Math.sin(n))*this.options.speed*this.reverse*(60/1e3)):(this.horizontal=Math.cos(n)*this.options.speed*this.reverse*(60/1e3),this.vertical=Math.sin(n)*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&&e<this.left?this.horizontal=Number(this.reverse)*this.options.speed*(60/1e3):this.right!==null&&e>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 t=this.parent.plugins.get("decelerate",!0);this.horizontal&&t&&!this.options.noDecelerate&&t.activate({x:this.horizontal*this.options.speed*this.reverse/(1e3/60)})}decelerateVertical(){const t=this.parent.plugins.get("decelerate",!0);this.vertical&&t&&!this.options.noDecelerate&&t.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 t=this.parent.center;this.horizontal&&(t.x+=this.horizontal*this.options.speed),this.vertical&&(t.y+=this.vertical*this.options.speed),this.parent.moveCenter(t),this.parent.emit("moved",{viewport:this.parent,type:"mouse-edges"})}}}const sI={noDrag:!1,percent:1,center:null,factor:1,axis:"all"};class nI extends qe{constructor(t,e={}){super(t),W(this,"options"),W(this,"active",!1),W(this,"pinching",!1),W(this,"moved",!1),W(this,"lastCenter"),this.options=Object.assign({},sI,e)}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(t){if(this.paused||!this.active)return!1;const e=t.global.x,i=t.global.y,s=this.parent.input.touches;if(s.length>=2){const n=s[0],o=s[1],a=n.last&&o.last?Math.sqrt(Math.pow(o.last.x-n.last.x,2)+Math.pow(o.last.y-n.last.y,2)):null;if(n.id===t.pointerId?n.last={x:e,y:i,data:t}:o.id===t.pointerId&&(o.last={x:e,y:i,data:t}),a){let h;const l=new dt(n.last.x+(o.last.x-n.last.x)/2,n.last.y+(o.last.y-n.last.y)/2);this.options.center||(h=this.parent.toLocal(l));let c=Math.sqrt(Math.pow(o.last.x-n.last.x,2)+Math.pow(o.last.y-n.last.y,2));c=c===0?c=1e-10:c;const u=(1-a/c)*this.options.percent*(this.isAxisX()?this.parent.scale.x:this.parent.scale.y);this.isAxisX()&&(this.parent.scale.x+=u),this.isAxisY()&&(this.parent.scale.y+=u),this.parent.emit("zoomed",{viewport:this.parent,type:"pinch",center:l});const d=this.parent.plugins.get("clamp-zoom",!0);if(d&&d.clamp(),this.options.center)this.parent.moveCenter(this.options.center);else{const f=this.parent.toGlobal(h);this.parent.x+=(l.x-f.x)*this.options.factor,this.parent.y+=(l.y-f.y)*this.options.factor,this.parent.emit("moved",{viewport:this.parent,type:"pinch"})}!this.options.noDrag&&this.lastCenter&&(this.parent.x+=(l.x-this.lastCenter.x)*this.options.factor,this.parent.y+=(l.y-this.lastCenter.y)*this.options.factor,this.parent.emit("moved",{viewport:this.parent,type:"pinch"})),this.lastCenter=l,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 oI={topLeft:!1,friction:.8,time:1e3,ease:"easeInOutSine",interrupt:!0,removeOnComplete:!1,removeOnInterrupt:!1,forceStart:!1};class aI extends qe{constructor(t,e,i,s={}){super(t),W(this,"options"),W(this,"ease"),W(this,"x"),W(this,"y"),W(this,"percent"),W(this,"snapping"),W(this,"deltaX"),W(this,"deltaY"),W(this,"startX"),W(this,"startY"),this.options=Object.assign({},oI,s),this.ease=Ah(s.ease,"easeInOutSine"),this.x=e,this.y=i,this.options.forceStart&&this.snapStart()}snapStart(){this.percent=0,this.snapping={time:0};const t=this.options.topLeft?this.parent.corner:this.parent.center;this.deltaX=this.x-t.x,this.deltaY=this.y-t.y,this.startX=t.x,this.startY=t.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 t=this.parent.plugins.get("decelerate",!0);t&&(t.x||t.y)&&(t.percentChangeX=t.percentChangeY=this.options.friction)}return!1}update(t){if(!this.paused&&!(this.options.interrupt&&this.parent.input.count()!==0))if(this.snapping){const e=this.snapping;e.time+=t;let i,s,n;const o=this.startX,a=this.startY,h=this.deltaX,l=this.deltaY;if(e.time>this.options.time)i=!0,s=o+h,n=a+l;else{const c=this.ease(e.time,0,1,this.options.time);s=o+h*c,n=a+l*c}this.options.topLeft?this.parent.moveCorner(s,n):this.parent.moveCenter(s,n),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 e=this.options.topLeft?this.parent.corner:this.parent.center;(e.x!==this.x||e.y!==this.y)&&this.snapStart()}}}const hI={width:0,height:0,time:1e3,ease:"easeInOutSine",center:null,interrupt:!0,removeOnComplete:!1,removeOnInterrupt:!1,forceStart:!1,noMove:!1};class lI extends qe{constructor(t,e={}){super(t),W(this,"options"),W(this,"ease"),W(this,"xScale"),W(this,"yScale"),W(this,"xIndependent"),W(this,"yIndependent"),W(this,"snapping"),this.options=Object.assign({},hI,e),this.ease=Ah(this.options.ease),this.xIndependent=!1,this.yIndependent=!1,this.xScale=0,this.yScale=0,this.options.width>0&&(this.xScale=t.screenWidth/this.options.width,this.xIndependent=!0),this.options.height>0&&(this.yScale=t.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?(t.container.scale.x=this.xScale,t.container.scale.y=this.yScale,this.options.removeOnComplete&&this.parent.plugins.remove("snap-zoom")):e.forceStart&&this.createSnapping()}createSnapping(){const t=this.parent.worldScreenWidth,e=this.parent.worldScreenHeight,i=this.parent.screenWidth/this.xScale,s=this.parent.screenHeight/this.yScale;this.snapping={time:0,startX:t,startY:e,deltaX:i-t,deltaY:s-e},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(t){if(this.paused||this.options.interrupt&&this.parent.input.count()!==0)return;let e;if(!this.options.center&&!this.options.noMove&&(e=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+=t,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 n=this.snapping,o=this.ease(n.time,n.startX,n.deltaX,this.options.time),a=this.ease(n.time,n.startY,n.deltaY,this.options.time);this.parent.scale.x=this.parent.screenWidth/o,this.parent.scale.y=this.parent.screenHeight/a}const s=this.parent.plugins.get("clamp-zoom",!0);s&&s.clamp(),this.options.noMove||(this.options.center?this.parent.moveCenter(this.options.center):this.parent.moveCenter(e))}}resume(){this.snapping=null,super.resume()}}const cI={percent:.1,smooth:!1,interrupt:!0,reverse:!1,center:null,lineHeight:20,axis:"all",keyToPress:null,trackpadPinch:!1,wheelZoom:!0};class uI extends qe{constructor(t,e={}){super(t),W(this,"options"),W(this,"smoothing"),W(this,"smoothingCenter"),W(this,"smoothingCount"),W(this,"keyIsPressed"),this.options=Object.assign({},cI,e),this.keyIsPressed=!1,this.options.keyToPress&&this.handleKeyPresses(this.options.keyToPress)}handleKeyPresses(t){window.addEventListener("keydown",e=>{t.includes(e.code)&&(this.keyIsPressed=!0)}),window.addEventListener("keyup",e=>{t.includes(e.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 t=this.smoothingCenter,e=this.smoothing;let i;this.options.center||(i=this.parent.toLocal(t)),this.isAxisX()&&(this.parent.scale.x+=e.x),this.isAxisY()&&(this.parent.scale.y+=e.y),this.parent.emit("zoomed",{viewport:this.parent,type:"wheel"});const s=this.parent.plugins.get("clamp-zoom",!0);if(s&&s.clamp(),this.options.center)this.parent.moveCenter(this.options.center);else{const n=this.parent.toGlobal(i);this.parent.x+=t.x-n.x,this.parent.y+=t.y-n.y}this.parent.emit("moved",{viewport:this.parent,type:"wheel"}),this.smoothingCount++,this.smoothingCount>=this.options.smooth&&(this.smoothing=null)}}pinch(t){if(this.paused)return;const e=this.parent.input.getPointerPosition(t),i=-t.deltaY*(t.deltaMode?this.options.lineHeight:1)/200,s=Math.pow(2,(1+this.options.percent)*i);let n;this.options.center||(n=this.parent.toLocal(e)),this.isAxisX()&&(this.parent.scale.x*=s),this.isAxisY()&&(this.parent.scale.y*=s),this.parent.emit("zoomed",{viewport:this.parent,type:"wheel"});const o=this.parent.plugins.get("clamp-zoom",!0);if(o&&o.clamp(),this.options.center)this.parent.moveCenter(this.options.center);else{const a=this.parent.toGlobal(n);this.parent.x+=e.x-a.x,this.parent.y+=e.y-a.y}this.parent.emit("moved",{viewport:this.parent,type:"wheel"}),this.parent.emit("wheel-start",{event:t,viewport:this.parent})}wheel(t){if(this.paused||!this.checkKeyPress())return!1;if(t.ctrlKey&&this.options.trackpadPinch)this.pinch(t);else if(this.options.wheelZoom){const e=this.parent.input.getPointerPosition(t),i=(this.options.reverse?-1:1)*-t.deltaY*(t.deltaMode?this.options.lineHeight:1)/500,s=Math.pow(2,(1+this.options.percent)*i);if(this.options.smooth){const n={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+n.x)*s-this.parent.scale.x)/this.options.smooth,y:((this.parent.scale.y+n.y)*s-this.parent.scale.y)/this.options.smooth},this.smoothingCount=0,this.smoothingCenter=e}else{let n;this.options.center||(n=this.parent.toLocal(e)),this.isAxisX()&&(this.parent.scale.x*=s),this.isAxisY()&&(this.parent.scale.y*=s),this.parent.emit("zoomed",{viewport:this.parent,type:"wheel"});const o=this.parent.plugins.get("clamp-zoom",!0);if(o&&o.clamp(),this.options.center)this.parent.moveCenter(this.options.center);else{const a=this.parent.toGlobal(n);this.parent.x+=e.x-a.x,this.parent.y+=e.y-a.y}}this.parent.emit("moved",{viewport:this.parent,type:"wheel"}),this.parent.emit("wheel-start",{event:t,viewport:this.parent})}return!this.parent.options.passiveWheel}}class dI{constructor(t){W(this,"viewport"),W(this,"clickedAvailable"),W(this,"isMouseDown"),W(this,"last"),W(this,"wheelFunction"),W(this,"touches"),this.viewport=t,this.touches=[],this.addListeners()}addListeners(){this.viewport.interactive=!0,this.viewport.forceHitArea||(this.viewport.hitArea=new mt(0,0,this.viewport.worldWidth,this.viewport.worldHeight)),this.viewport.on("pointerdown",this.down,this),this.viewport.options.allowPreserveDragOutside?this.viewport.on("globalpointermove",this.move,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.options.allowPreserveDragOutside||this.viewport.on("pointerleave",this.up,this),this.wheelFunction=t=>this.handleWheel(t),this.viewport.options.events.domElement.addEventListener("wheel",this.wheelFunction,{passive:this.viewport.options.passiveWheel}),this.isMouseDown=!1}destroy(){this.viewport.options.events.domElement.removeEventListener("wheel",this.wheelFunction)}down(t){if(!(this.viewport.pause||!this.viewport.worldVisible)){if(t.pointerType==="mouse"?this.isMouseDown=!0:this.get(t.pointerId)||this.touches.push({id:t.pointerId,last:null}),this.count()===1){this.last=t.global.clone();const e=this.viewport.plugins.get("decelerate",!0),i=this.viewport.plugins.get("bounce",!0);(!e||!e.isActive())&&(!i||!i.isActive())?this.clickedAvailable=!0:this.clickedAvailable=!1}else this.clickedAvailable=!1;this.viewport.plugins.down(t)&&this.viewport.options.stopPropagation&&t.stopPropagation()}}clear(){this.isMouseDown=!1,this.touches=[],this.last=null}checkThreshold(t){return Math.abs(t)>=this.viewport.threshold}move(t){if(this.viewport.pause||!this.viewport.worldVisible)return;const e=this.viewport.plugins.move(t);if(this.clickedAvailable&&this.last){const i=t.global.x-this.last.x,s=t.global.y-this.last.y;(this.checkThreshold(i)||this.checkThreshold(s))&&(this.clickedAvailable=!1)}e&&this.viewport.options.stopPropagation&&t.stopPropagation()}up(t){if(this.viewport.pause||!this.viewport.worldVisible)return;t.pointerType==="mouse"&&(this.isMouseDown=!1),t.pointerType!=="mouse"&&this.remove(t.pointerId);const e=this.viewport.plugins.up(t);this.clickedAvailable&&this.count()===0&&this.last&&(this.viewport.emit("clicked",{event:t,screen:this.last,world:this.viewport.toWorld(this.last),viewport:this.viewport}),this.clickedAvailable=!1),e&&this.viewport.options.stopPropagation&&t.stopPropagation()}getPointerPosition(t){const e=new dt;return this.viewport.options.events.mapPositionToPoint(e,t.clientX,t.clientY),e}handleWheel(t){if(this.viewport.pause||!this.viewport.worldVisible)return;const e=this.viewport.toLocal(this.getPointerPosition(t));this.viewport.left<=e.x&&e.x<=this.viewport.right&&this.viewport.top<=e.y&&e.y<=this.viewport.bottom&&this.viewport.plugins.wheel(t)&&!this.viewport.options.passiveWheel&&t.preventDefault()}pause(){this.touches=[],this.isMouseDown=!1}get(t){for(const e of this.touches)if(e.id===t)return e;return null}remove(t){for(let e=0;e<this.touches.length;e++)if(this.touches[e].id===t){this.touches.splice(e,1);return}}count(){return(this.isMouseDown?1:0)+this.touches.length}}const Co=["drag","pinch","wheel","follow","mouse-edges","decelerate","animate","bounce","snap-zoom","clamp-zoom","snap","clamp"];class fI{constructor(t){W(this,"plugins"),W(this,"list"),W(this,"viewport"),this.viewport=t,this.list=[],this.plugins={}}add(t,e,i=Co.length){const s=this.plugins[t];s&&s.destroy(),this.plugins[t]=e;const n=Co.indexOf(t);n!==-1&&Co.splice(n,1),Co.splice(i,0,t),this.sort()}get(t,e){var i;return e&&(i=this.plugins[t])!=null&&i.paused?null:this.plugins[t]}update(t){for(const e of this.list)e.update(t)}resize(){for(const t of this.list)t.resize()}reset(){for(const t of this.list)t.reset()}removeAll(){this.list.forEach(t=>{t.destroy()}),this.plugins={},this.sort()}remove(t){var e;this.plugins[t]&&((e=this.plugins[t])==null||e.destroy(),delete this.plugins[t],this.viewport.emit("plugin-remove",t),this.sort())}pause(t){var e;(e=this.plugins[t])==null||e.pause()}resume(t){var e;(e=this.plugins[t])==null||e.resume()}sort(){this.list=[];for(const t of Co)this.plugins[t]&&this.list.push(this.plugins[t])}down(t){let e=!1;for(const i of this.list)i.down(t)&&(e=!0);return e}move(t){let e=!1;for(const i of this.viewport.plugins.list)i.move(t)&&(e=!0);return e}up(t){let e=!1;for(const i of this.list)i.up(t)&&(e=!0);return e}wheel(t){let e=!1;for(const i of this.list)i.wheel(t)&&(e=!0);return e}}const pI={screenWidth:window.innerWidth,screenHeight:window.innerHeight,worldWidth:null,worldHeight:null,threshold:5,passiveWheel:!0,stopPropagation:!1,forceHitArea:null,noTicker:!1,disableOnContextMenu:!1,ticker:Te.shared,allowPreserveDragOutside:!1};class mI extends Ct{constructor(t){super(),W(this,"moving"),W(this,"screenWidth"),W(this,"screenHeight"),W(this,"threshold"),W(this,"input"),W(this,"plugins"),W(this,"zooming"),W(this,"lastViewport"),W(this,"options"),W(this,"_dirty"),W(this,"_forceHitArea"),W(this,"_hitAreaDefault"),W(this,"_pause"),W(this,"tickerFunction"),W(this,"_worldWidth"),W(this,"_worldHeight"),W(this,"_disableOnContextMenu",e=>e.preventDefault()),this.options={...pI,...t},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.disableOnContextMenu&&this.options.events.domElement.addEventListener("contextmenu",this._disableOnContextMenu),this.options.noTicker||(this.tickerFunction=()=>this.update(this.options.ticker.elapsedMS),this.options.ticker.add(this.tickerFunction)),this.input=new dI(this),this.plugins=new fI(this)}destroy(t){!this.options.noTicker&&this.tickerFunction&&this.options.ticker.remove(this.tickerFunction),this.options.disableOnContextMenu&&this.options.events.domElement.removeEventListener("contextmenu",this._disableOnContextMenu),this.input.destroy(),super.destroy(t)}update(t){this.pause||(this.plugins.update(t),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 mt(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(t=window.innerWidth,e=window.innerHeight,i,s){this.screenWidth=t,this.screenHeight=e,typeof i<"u"&&(this._worldWidth=i),typeof s<"u"&&(this._worldHeight=s),this.plugins.resize(),this.dirty=!0}get worldWidth(){return this._worldWidth?this._worldWidth:this.width/this.scale.x}set worldWidth(t){this._worldWidth=t,this.plugins.resize()}get worldHeight(){return this._worldHeight?this._worldHeight:this.height/this.scale.y}set worldHeight(t){this._worldHeight=t,this.plugins.resize()}getVisibleBounds(){return new mt(this.left,this.top,this.worldScreenWidth,this.worldScreenHeight)}toWorld(t,e){return arguments.length===2?this.toLocal(new dt(t,e)):this.toLocal(t)}toScreen(t,e){return arguments.length===2?this.toGlobal(new dt(t,e)):this.toGlobal(t)}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 dt(this.worldScreenWidth/2-this.x/this.scale.x,this.worldScreenHeight/2-this.y/this.scale.y)}set center(t){this.moveCenter(t)}moveCenter(...t){let e,i;typeof t[0]=="number"?(e=t[0],i=t[1]):(e=t[0].x,i=t[0].y);const s=(this.worldScreenWidth/2-e)*this.scale.x,n=(this.worldScreenHeight/2-i)*this.scale.y;return(this.x!==s||this.y!==n)&&(this.position.set(s,n),this.plugins.reset(),this.dirty=!0),this}get corner(){return new dt(-this.x/this.scale.x,-this.y/this.scale.y)}set corner(t){this.moveCorner(t)}moveCorner(...t){let e,i;return t.length===1?(e=-t[0].x*this.scale.x,i=-t[0].y*this.scale.y):(e=-t[0]*this.scale.x,i=-t[1]*this.scale.y),(e!==this.x||i!==this.y)&&(this.position.set(e,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(t){return this.screenWidth/t}findFitHeight(t){return this.screenHeight/t}findFit(t,e){const i=this.screenWidth/t,s=this.screenHeight/e;return Math.min(i,s)}findCover(t,e){const i=this.screenWidth/t,s=this.screenHeight/e;return Math.max(i,s)}fitWidth(t=this.worldWidth,e,i=!0,s){let n;e&&(n=this.center),this.scale.x=this.screenWidth/t,i&&(this.scale.y=this.scale.x);const o=this.plugins.get("clamp-zoom",!0);return!s&&o&&o.clamp(),e&&n&&this.moveCenter(n),this}fitHeight(t=this.worldHeight,e,i=!0,s){let n;e&&(n=this.center),this.scale.y=this.screenHeight/t,i&&(this.scale.x=this.scale.y);const o=this.plugins.get("clamp-zoom",!0);return!s&&o&&o.clamp(),e&&n&&this.moveCenter(n),this}fitWorld(t){let e;t&&(e=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(),t&&e&&this.moveCenter(e),this}fit(t,e=this.worldWidth,i=this.worldHeight){let s;t&&(s=this.center),this.scale.x=this.screenWidth/e,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 n=this.plugins.get("clamp-zoom",!0);return n&&n.clamp(),t&&s&&this.moveCenter(s),this}setZoom(t,e){let i;e&&(i=this.center),this.scale.set(t);const s=this.plugins.get("clamp-zoom",!0);return s&&s.clamp(),e&&i&&this.moveCenter(i),this}zoomPercent(t,e){return this.setZoom(this.scale.x+this.scale.x*t,e)}zoom(t,e){return this.fitWidth(t+this.worldScreenWidth,e),this}get scaled(){return this.scale.x}set scaled(t){this.setZoom(t,!0)}snapZoom(t){return this.plugins.add("snap-zoom",new lI(this,t)),this}OOB(){return{left:this.left<0,right:this.right>this.worldWidth,top:this.top<0,bottom:this.bottom>this.worldHeight,cornerPoint:new dt(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(t){this.x=-t*this.scale.x+this.screenWidth,this.plugins.reset()}get left(){return-this.x/this.scale.x}set left(t){this.x=-t*this.scale.x,this.plugins.reset()}get top(){return-this.y/this.scale.y}set top(t){this.y=-t*this.scale.y,this.plugins.reset()}get bottom(){return-this.y/this.scale.y+this.worldScreenHeight}set bottom(t){this.y=-t*this.scale.y+this.screenHeight,this.plugins.reset()}get dirty(){return!!this._dirty}set dirty(t){this._dirty=t}get forceHitArea(){return this._forceHitArea}set forceHitArea(t){t?(this._forceHitArea=t,this.hitArea=t):(this._forceHitArea=null,this.hitArea=new mt(0,0,this.worldWidth,this.worldHeight))}drag(t){return this.plugins.add("drag",new qC(this,t)),this}clamp(t){return this.plugins.add("clamp",new YC(this,t)),this}decelerate(t){return this.plugins.add("decelerate",new $C(this,t)),this}bounce(t){return this.plugins.add("bounce",new HC(this,t)),this}pinch(t){return this.plugins.add("pinch",new nI(this,t)),this}snap(t,e,i){return this.plugins.add("snap",new aI(this,t,e,i)),this}follow(t,e){return this.plugins.add("follow",new eI(this,t,e)),this}wheel(t){return this.plugins.add("wheel",new uI(this,t)),this}animate(t){return this.plugins.add("animate",new ZC(this,t)),this}clampZoom(t){return this.plugins.add("clamp-zoom",new jC(this,t)),this}mouseEdges(t){return this.plugins.add("mouse-edges",new rI(this,t)),this}get pause(){return!!this._pause}set pause(t){this._pause=t,this.lastViewport=null,this.moving=!1,this.zooming=!1,t&&this.input.pause()}ensureVisible(t,e,i,s,n){n&&(i>this.worldScreenWidth||s>this.worldScreenHeight)&&(this.fit(!0,i,s),this.emit("zoomed",{viewport:this,type:"ensureVisible"}));let o=!1;t<this.left?(this.left=t,o=!0):t+i>this.right&&(this.right=t+i,o=!0),e<this.top?(this.top=e,o=!0):e+s>this.bottom&&(this.bottom=e+s,o=!0),o&&this.emit("moved",{viewport:this,type:"ensureVisible"})}}function Rh(r,t){return r==null||t==null?NaN:r<t?-1:r>t?1:r>=t?0:NaN}function gI(r,t){return r==null||t==null?NaN:t<r?-1:t>r?1:t>=r?0:NaN}function od(r){let t,e,i;r.length!==2?(t=Rh,e=(a,h)=>Rh(r(a),h),i=(a,h)=>r(a)-h):(t=r===Rh||r===gI?r:yI,e=r,i=r);function s(a,h,l=0,c=a.length){if(l<c){if(t(h,h)!==0)return c;do{const u=l+c>>>1;e(a[u],h)<0?l=u+1:c=u}while(l<c)}return l}function n(a,h,l=0,c=a.length){if(l<c){if(t(h,h)!==0)return c;do{const u=l+c>>>1;e(a[u],h)<=0?l=u+1:c=u}while(l<c)}return l}function o(a,h,l=0,c=a.length){const u=s(a,h,l,c-1);return u>l&&i(a[u-1],h)>-i(a[u],h)?u-1:u}return{left:s,center:o,right:n}}function yI(){return 0}function bI(r){return r===null?NaN:+r}const xI=od(Rh).right;od(bI).center;const _I=xI,vI=Math.sqrt(50),wI=Math.sqrt(10),TI=Math.sqrt(2);function Mh(r,t,e){const i=(t-r)/Math.max(0,e),s=Math.floor(Math.log10(i)),n=i/Math.pow(10,s),o=n>=vI?10:n>=wI?5:n>=TI?2:1;let a,h,l;return s<0?(l=Math.pow(10,-s)/o,a=Math.round(r*l),h=Math.round(t*l),a/l<r&&++a,h/l>t&&--h,l=-l):(l=Math.pow(10,s)*o,a=Math.round(r/l),h=Math.round(t/l),a*l<r&&++a,h*l>t&&--h),h<a&&.5<=e&&e<2?Mh(r,t,e*2):[a,h,l]}function SI(r,t,e){if(t=+t,r=+r,e=+e,!(e>0))return[];if(r===t)return[r];const i=t<r,[s,n,o]=i?Mh(t,r,e):Mh(r,t,e);if(!(n>=s))return[];const a=n-s+1,h=new Array(a);if(i)if(o<0)for(let l=0;l<a;++l)h[l]=(n-l)/-o;else for(let l=0;l<a;++l)h[l]=(n-l)*o;else if(o<0)for(let l=0;l<a;++l)h[l]=(s+l)/-o;else for(let l=0;l<a;++l)h[l]=(s+l)*o;return h}function ad(r,t,e){return t=+t,r=+r,e=+e,Mh(r,t,e)[2]}function hd(r,t,e){t=+t,r=+r,e=+e;const i=t<r,s=i?ad(t,r,e):ad(r,t,e);return(i?-1:1)*(s<0?1/-s:s)}function ld(r,t,e){r.prototype=t.prototype=e,e.constructor=r}function py(r,t){var e=Object.create(r.prototype);for(var i in t)e[i]=t[i];return e}function Io(){}var Ao=.7,Lh=1/Ao,Tn="\\s*([+-]?\\d+)\\s*",Ro="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Oi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",EI=/^#([0-9a-f]{3,8})$/,CI=new RegExp(`^rgb\\(${Tn},${Tn},${Tn}\\)$`),II=new RegExp(`^rgb\\(${Oi},${Oi},${Oi}\\)$`),AI=new RegExp(`^rgba\\(${Tn},${Tn},${Tn},${Ro}\\)$`),RI=new RegExp(`^rgba\\(${Oi},${Oi},${Oi},${Ro}\\)$`),MI=new RegExp(`^hsl\\(${Ro},${Oi},${Oi}\\)$`),LI=new RegExp(`^hsla\\(${Ro},${Oi},${Oi},${Ro}\\)$`),my={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};ld(Io,Mo,{copy(r){return Object.assign(new this.constructor,this,r)},displayable(){return this.rgb().displayable()},hex:gy,formatHex:gy,formatHex8:PI,formatHsl:GI,formatRgb:yy,toString:yy});function gy(){return this.rgb().formatHex()}function PI(){return this.rgb().formatHex8()}function GI(){return wy(this).formatHsl()}function yy(){return this.rgb().formatRgb()}function Mo(r){var t,e;return r=(r+"").trim().toLowerCase(),(t=EI.exec(r))?(e=t[1].length,t=parseInt(t[1],16),e===6?by(t):e===3?new Ge(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):e===8?Ph(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):e===4?Ph(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=CI.exec(r))?new Ge(t[1],t[2],t[3],1):(t=II.exec(r))?new Ge(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=AI.exec(r))?Ph(t[1],t[2],t[3],t[4]):(t=RI.exec(r))?Ph(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=MI.exec(r))?vy(t[1],t[2]/100,t[3]/100,1):(t=LI.exec(r))?vy(t[1],t[2]/100,t[3]/100,t[4]):my.hasOwnProperty(r)?by(my[r]):r==="transparent"?new Ge(NaN,NaN,NaN,0):null}function by(r){return new Ge(r>>16&255,r>>8&255,r&255,1)}function Ph(r,t,e,i){return i<=0&&(r=t=e=NaN),new Ge(r,t,e,i)}function FI(r){return r instanceof Io||(r=Mo(r)),r?(r=r.rgb(),new Ge(r.r,r.g,r.b,r.opacity)):new Ge}function cd(r,t,e,i){return arguments.length===1?FI(r):new Ge(r,t,e,i??1)}function Ge(r,t,e,i){this.r=+r,this.g=+t,this.b=+e,this.opacity=+i}ld(Ge,cd,py(Io,{brighter(r){return r=r==null?Lh:Math.pow(Lh,r),new Ge(this.r*r,this.g*r,this.b*r,this.opacity)},darker(r){return r=r==null?Ao:Math.pow(Ao,r),new Ge(this.r*r,this.g*r,this.b*r,this.opacity)},rgb(){return this},clamp(){return new Ge(As(this.r),As(this.g),As(this.b),Gh(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:xy,formatHex:xy,formatHex8:NI,formatRgb:_y,toString:_y}));function xy(){return`#${Rs(this.r)}${Rs(this.g)}${Rs(this.b)}`}function NI(){return`#${Rs(this.r)}${Rs(this.g)}${Rs(this.b)}${Rs((isNaN(this.opacity)?1:this.opacity)*255)}`}function _y(){const r=Gh(this.opacity);return`${r===1?"rgb(":"rgba("}${As(this.r)}, ${As(this.g)}, ${As(this.b)}${r===1?")":`, ${r})`}`}function Gh(r){return isNaN(r)?1:Math.max(0,Math.min(1,r))}function As(r){return Math.max(0,Math.min(255,Math.round(r)||0))}function Rs(r){return r=As(r),(r<16?"0":"")+r.toString(16)}function vy(r,t,e,i){return i<=0?r=t=e=NaN:e<=0||e>=1?r=t=NaN:t<=0&&(r=NaN),new pi(r,t,e,i)}function wy(r){if(r instanceof pi)return new pi(r.h,r.s,r.l,r.opacity);if(r instanceof Io||(r=Mo(r)),!r)return new pi;if(r instanceof pi)return r;r=r.rgb();var t=r.r/255,e=r.g/255,i=r.b/255,s=Math.min(t,e,i),n=Math.max(t,e,i),o=NaN,a=n-s,h=(n+s)/2;return a?(t===n?o=(e-i)/a+(e<i)*6:e===n?o=(i-t)/a+2:o=(t-e)/a+4,a/=h<.5?n+s:2-n-s,o*=60):a=h>0&&h<1?0:o,new pi(o,a,h,r.opacity)}function DI(r,t,e,i){return arguments.length===1?wy(r):new pi(r,t,e,i??1)}function pi(r,t,e,i){this.h=+r,this.s=+t,this.l=+e,this.opacity=+i}ld(pi,DI,py(Io,{brighter(r){return r=r==null?Lh:Math.pow(Lh,r),new pi(this.h,this.s,this.l*r,this.opacity)},darker(r){return r=r==null?Ao:Math.pow(Ao,r),new pi(this.h,this.s,this.l*r,this.opacity)},rgb(){var r=this.h%360+(this.h<0)*360,t=isNaN(r)||isNaN(this.s)?0:this.s,e=this.l,i=e+(e<.5?e:1-e)*t,s=2*e-i;return new Ge(ud(r>=240?r-240:r+120,s,i),ud(r,s,i),ud(r<120?r+240:r-120,s,i),this.opacity)},clamp(){return new pi(Ty(this.h),Fh(this.s),Fh(this.l),Gh(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const r=Gh(this.opacity);return`${r===1?"hsl(":"hsla("}${Ty(this.h)}, ${Fh(this.s)*100}%, ${Fh(this.l)*100}%${r===1?")":`, ${r})`}`}}));function Ty(r){return r=(r||0)%360,r<0?r+360:r}function Fh(r){return Math.max(0,Math.min(1,r||0))}function ud(r,t,e){return(r<60?t+(e-t)*r/60:r<180?e:r<240?t+(e-t)*(240-r)/60:t)*255}const dd=r=>()=>r;function kI(r,t){return function(e){return r+e*t}}function OI(r,t,e){return r=Math.pow(r,e),t=Math.pow(t,e)-r,e=1/e,function(i){return Math.pow(r+i*t,e)}}function BI(r){return(r=+r)==1?Sy:function(t,e){return e-t?OI(t,e,r):dd(isNaN(t)?e:t)}}function Sy(r,t){var e=t-r;return e?kI(r,e):dd(isNaN(r)?t:r)}const Ey=function r(t){var e=BI(t);function i(s,n){var o=e((s=cd(s)).r,(n=cd(n)).r),a=e(s.g,n.g),h=e(s.b,n.b),l=Sy(s.opacity,n.opacity);return function(c){return s.r=o(c),s.g=a(c),s.b=h(c),s.opacity=l(c),s+""}}return i.gamma=r,i}(1);function UI(r,t){t||(t=[]);var e=r?Math.min(t.length,r.length):0,i=t.slice(),s;return function(n){for(s=0;s<e;++s)i[s]=r[s]*(1-n)+t[s]*n;return i}}function WI(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}function XI(r,t){var e=t?t.length:0,i=r?Math.min(e,r.length):0,s=new Array(i),n=new Array(e),o;for(o=0;o<i;++o)s[o]=md(r[o],t[o]);for(;o<e;++o)n[o]=t[o];return function(a){for(o=0;o<i;++o)n[o]=s[o](a);return n}}function ZI(r,t){var e=new Date;return r=+r,t=+t,function(i){return e.setTime(r*(1-i)+t*i),e}}function Nh(r,t){return r=+r,t=+t,function(e){return r*(1-e)+t*e}}function VI(r,t){var e={},i={},s;(r===null||typeof r!="object")&&(r={}),(t===null||typeof t!="object")&&(t={});for(s in t)s in r?e[s]=md(r[s],t[s]):i[s]=t[s];return function(n){for(s in e)i[s]=e[s](n);return i}}var fd=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,pd=new RegExp(fd.source,"g");function HI(r){return function(){return r}}function KI(r){return function(t){return r(t)+""}}function YI(r,t){var e=fd.lastIndex=pd.lastIndex=0,i,s,n,o=-1,a=[],h=[];for(r=r+"",t=t+"";(i=fd.exec(r))&&(s=pd.exec(t));)(n=s.index)>e&&(n=t.slice(e,n),a[o]?a[o]+=n:a[++o]=n),(i=i[0])===(s=s[0])?a[o]?a[o]+=s:a[++o]=s:(a[++o]=null,h.push({i:o,x:Nh(i,s)})),e=pd.lastIndex;return e<t.length&&(n=t.slice(e),a[o]?a[o]+=n:a[++o]=n),a.length<2?h[0]?KI(h[0].x):HI(t):(t=h.length,function(l){for(var c=0,u;c<t;++c)a[(u=h[c]).i]=u.x(l);return a.join("")})}function md(r,t){var e=typeof t,i;return t==null||e==="boolean"?dd(t):(e==="number"?Nh:e==="string"?(i=Mo(t))?(t=i,Ey):YI:t instanceof Mo?Ey:t instanceof Date?ZI:WI(t)?UI:Array.isArray(t)?XI:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?VI:Nh)(r,t)}function zI(r,t){return r=+r,t=+t,function(e){return Math.round(r*(1-e)+t*e)}}function jI(r){return Math.abs(r=Math.round(r))>=1e21?r.toLocaleString("en").replace(/,/g,""):r.toString(10)}function Dh(r,t){if((e=(r=t?r.toExponential(t-1):r.toExponential()).indexOf("e"))<0)return null;var e,i=r.slice(0,e);return[i.length>1?i[0]+i.slice(2):i,+r.slice(e+1)]}function Sn(r){return r=Dh(Math.abs(r)),r?r[1]:NaN}function JI(r,t){return function(e,i){for(var s=e.length,n=[],o=0,a=r[0],h=0;s>0&&a>0&&(h+a+1>i&&(a=Math.max(1,i-h)),n.push(e.substring(s-=a,s+a)),!((h+=a+1)>i));)a=r[o=(o+1)%r.length];return n.reverse().join(t)}}function $I(r){return function(t){return t.replace(/[0-9]/g,function(e){return r[+e]})}}var QI=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function kh(r){if(!(t=QI.exec(r)))throw new Error("invalid format: "+r);var t;return new gd({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}kh.prototype=gd.prototype;function gd(r){this.fill=r.fill===void 0?" ":r.fill+"",this.align=r.align===void 0?">":r.align+"",this.sign=r.sign===void 0?"-":r.sign+"",this.symbol=r.symbol===void 0?"":r.symbol+"",this.zero=!!r.zero,this.width=r.width===void 0?void 0:+r.width,this.comma=!!r.comma,this.precision=r.precision===void 0?void 0:+r.precision,this.trim=!!r.trim,this.type=r.type===void 0?"":r.type+""}gd.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function qI(r){t:for(var t=r.length,e=1,i=-1,s;e<t;++e)switch(r[e]){case".":i=s=e;break;case"0":i===0&&(i=e),s=e;break;default:if(!+r[e])break t;i>0&&(i=0);break}return i>0?r.slice(0,i)+r.slice(s+1):r}var Cy;function tA(r,t){var e=Dh(r,t);if(!e)return r+"";var i=e[0],s=e[1],n=s-(Cy=Math.max(-8,Math.min(8,Math.floor(s/3)))*3)+1,o=i.length;return n===o?i:n>o?i+new Array(n-o+1).join("0"):n>0?i.slice(0,n)+"."+i.slice(n):"0."+new Array(1-n).join("0")+Dh(r,Math.max(0,t+n-1))[0]}function Iy(r,t){var e=Dh(r,t);if(!e)return r+"";var i=e[0],s=e[1];return s<0?"0."+new Array(-s).join("0")+i:i.length>s+1?i.slice(0,s+1)+"."+i.slice(s+1):i+new Array(s-i.length+2).join("0")}const Ay={"%":(r,t)=>(r*100).toFixed(t),b:r=>Math.round(r).toString(2),c:r=>r+"",d:jI,e:(r,t)=>r.toExponential(t),f:(r,t)=>r.toFixed(t),g:(r,t)=>r.toPrecision(t),o:r=>Math.round(r).toString(8),p:(r,t)=>Iy(r*100,t),r:Iy,s:tA,X:r=>Math.round(r).toString(16).toUpperCase(),x:r=>Math.round(r).toString(16)};function Ry(r){return r}var My=Array.prototype.map,Ly=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function eA(r){var t=r.grouping===void 0||r.thousands===void 0?Ry:JI(My.call(r.grouping,Number),r.thousands+""),e=r.currency===void 0?"":r.currency[0]+"",i=r.currency===void 0?"":r.currency[1]+"",s=r.decimal===void 0?".":r.decimal+"",n=r.numerals===void 0?Ry:$I(My.call(r.numerals,String)),o=r.percent===void 0?"%":r.percent+"",a=r.minus===void 0?"−":r.minus+"",h=r.nan===void 0?"NaN":r.nan+"";function l(u){u=kh(u);var d=u.fill,f=u.align,p=u.sign,m=u.symbol,g=u.zero,y=u.width,x=u.comma,b=u.precision,v=u.trim,w=u.type;w==="n"?(x=!0,w="g"):Ay[w]||(b===void 0&&(b=12),v=!0,w="g"),(g||d==="0"&&f==="=")&&(g=!0,d="0",f="=");var S=m==="$"?e:m==="#"&&/[boxX]/.test(w)?"0"+w.toLowerCase():"",C=m==="$"?i:/[%p]/.test(w)?o:"",I=Ay[w],R=/[defgprs%]/.test(w);b=b===void 0?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,b)):Math.max(0,Math.min(20,b));function P(G){var N=S,A=C,k,V,K;if(w==="c")A=I(G)+A,G="";else{G=+G;var H=G<0||1/G<0;if(G=isNaN(G)?h:I(Math.abs(G),b),v&&(G=qI(G)),H&&+G==0&&p!=="+"&&(H=!1),N=(H?p==="("?p:a:p==="-"||p==="("?"":p)+N,A=(w==="s"?Ly[8+Cy/3]:"")+A+(H&&p==="("?")":""),R){for(k=-1,V=G.length;++k<V;)if(K=G.charCodeAt(k),48>K||K>57){A=(K===46?s+G.slice(k+1):G.slice(k))+A,G=G.slice(0,k);break}}}x&&!g&&(G=t(G,1/0));var $=N.length+G.length+A.length,U=$<y?new Array(y-$+1).join(d):"";switch(x&&g&&(G=t(U+G,U.length?y-A.length:1/0),U=""),f){case"<":G=N+G+A+U;break;case"=":G=N+U+G+A;break;case"^":G=U.slice(0,$=U.length>>1)+N+G+A+U.slice($);break;default:G=U+N+G+A;break}return n(G)}return P.toString=function(){return u+""},P}function c(u,d){var f=l((u=kh(u),u.type="f",u)),p=Math.max(-8,Math.min(8,Math.floor(Sn(d)/3)))*3,m=Math.pow(10,-p),g=Ly[8+p/3];return function(y){return f(m*y)+g}}return{format:l,formatPrefix:c}}var Oh,Py,Gy;iA({thousands:",",grouping:[3],currency:["$",""]});function iA(r){return Oh=eA(r),Py=Oh.format,Gy=Oh.formatPrefix,Oh}function rA(r){return Math.max(0,-Sn(Math.abs(r)))}function sA(r,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Sn(t)/3)))*3-Sn(Math.abs(r)))}function nA(r,t){return r=Math.abs(r),t=Math.abs(t)-r,Math.max(0,Sn(t)-Sn(r))+1}function Fy(r,t){switch(arguments.length){case 0:break;case 1:this.range(r);break;default:this.range(t).domain(r);break}return this}function oA(r){return function(){return r}}function aA(r){return+r}var Ny=[0,1];function En(r){return r}function yd(r,t){return(t-=r=+r)?function(e){return(e-r)/t}:oA(isNaN(t)?NaN:.5)}function hA(r,t){var e;return r>t&&(e=r,r=t,t=e),function(i){return Math.max(r,Math.min(t,i))}}function lA(r,t,e){var i=r[0],s=r[1],n=t[0],o=t[1];return s<i?(i=yd(s,i),n=e(o,n)):(i=yd(i,s),n=e(n,o)),function(a){return n(i(a))}}function cA(r,t,e){var i=Math.min(r.length,t.length)-1,s=new Array(i),n=new Array(i),o=-1;for(r[i]<r[0]&&(r=r.slice().reverse(),t=t.slice().reverse());++o<i;)s[o]=yd(r[o],r[o+1]),n[o]=e(t[o],t[o+1]);return function(a){var h=_I(r,a,1,i)-1;return n[h](s[h](a))}}function Dy(r,t){return t.domain(r.domain()).range(r.range()).interpolate(r.interpolate()).clamp(r.clamp()).unknown(r.unknown())}function uA(){var r=Ny,t=Ny,e=md,i,s,n,o=En,a,h,l;function c(){var d=Math.min(r.length,t.length);return o!==En&&(o=hA(r[0],r[d-1])),a=d>2?cA:lA,h=l=null,u}function u(d){return d==null||isNaN(d=+d)?n:(h||(h=a(r.map(i),t,e)))(i(o(d)))}return u.invert=function(d){return o(s((l||(l=a(t,r.map(i),Nh)))(d)))},u.domain=function(d){return arguments.length?(r=Array.from(d,aA),c()):r.slice()},u.range=function(d){return arguments.length?(t=Array.from(d),c()):t.slice()},u.rangeRound=function(d){return t=Array.from(d),e=zI,c()},u.clamp=function(d){return arguments.length?(o=d?!0:En,c()):o!==En},u.interpolate=function(d){return arguments.length?(e=d,c()):e},u.unknown=function(d){return arguments.length?(n=d,u):n},function(d,f){return i=d,s=f,c()}}function ky(){return uA()(En,En)}function dA(r,t,e,i){var s=hd(r,t,e),n;switch(i=kh(i??",f"),i.type){case"s":{var o=Math.max(Math.abs(r),Math.abs(t));return i.precision==null&&!isNaN(n=sA(s,o))&&(i.precision=n),Gy(i,o)}case"":case"e":case"g":case"p":case"r":{i.precision==null&&!isNaN(n=nA(s,Math.max(Math.abs(r),Math.abs(t))))&&(i.precision=n-(i.type==="e"));break}case"f":case"%":{i.precision==null&&!isNaN(n=rA(s))&&(i.precision=n-(i.type==="%")*2);break}}return Py(i)}function fA(r){var t=r.domain;return r.ticks=function(e){var i=t();return SI(i[0],i[i.length-1],e??10)},r.tickFormat=function(e,i){var s=t();return dA(s[0],s[s.length-1],e??10,i)},r.nice=function(e){e==null&&(e=10);var i=t(),s=0,n=i.length-1,o=i[s],a=i[n],h,l,c=10;for(a<o&&(l=o,o=a,a=l,l=s,s=n,n=l);c-- >0;){if(l=ad(o,a,e),l===h)return i[s]=o,i[n]=a,t(i);if(l>0)o=Math.floor(o/l)*l,a=Math.ceil(a/l)*l;else if(l<0)o=Math.ceil(o*l)/l,a=Math.floor(a*l)/l;else break;h=l}return r},r}function Oy(){var r=ky();return r.copy=function(){return Dy(r,Oy())},Fy.apply(r,arguments),fA(r)}function pA(r,t){r=r.slice();var e=0,i=r.length-1,s=r[e],n=r[i],o;return n<s&&(o=e,e=i,i=o,o=s,s=n,n=o),r[e]=t.floor(s),r[i]=t.ceil(n),r}const bd=new Date,xd=new Date;function se(r,t,e,i){function s(n){return r(n=arguments.length===0?new Date:new Date(+n)),n}return s.floor=n=>(r(n=new Date(+n)),n),s.ceil=n=>(r(n=new Date(n-1)),t(n,1),r(n),n),s.round=n=>{const o=s(n),a=s.ceil(n);return n-o<a-n?o:a},s.offset=(n,o)=>(t(n=new Date(+n),o==null?1:Math.floor(o)),n),s.range=(n,o,a)=>{const h=[];if(n=s.ceil(n),a=a==null?1:Math.floor(a),!(n<o)||!(a>0))return h;let l;do h.push(l=new Date(+n)),t(n,a),r(n);while(l<n&&n<o);return h},s.filter=n=>se(o=>{if(o>=o)for(;r(o),!n(o);)o.setTime(o-1)},(o,a)=>{if(o>=o)if(a<0)for(;++a<=0;)for(;t(o,-1),!n(o););else for(;--a>=0;)for(;t(o,1),!n(o););}),e&&(s.count=(n,o)=>(bd.setTime(+n),xd.setTime(+o),r(bd),r(xd),Math.floor(e(bd,xd))),s.every=n=>(n=Math.floor(n),!isFinite(n)||!(n>0)?null:n>1?s.filter(i?o=>i(o)%n===0:o=>s.count(0,o)%n===0):s)),s}const Bh=se(()=>{},(r,t)=>{r.setTime(+r+t)},(r,t)=>t-r);Bh.every=r=>(r=Math.floor(r),!isFinite(r)||!(r>0)?null:r>1?se(t=>{t.setTime(Math.floor(t/r)*r)},(t,e)=>{t.setTime(+t+e*r)},(t,e)=>(e-t)/r):Bh),Bh.range;const lr=1e3,ti=lr*60,cr=ti*60,ur=cr*24,_d=ur*7,By=ur*30,vd=ur*365,Cn=se(r=>{r.setTime(r-r.getMilliseconds())},(r,t)=>{r.setTime(+r+t*lr)},(r,t)=>(t-r)/lr,r=>r.getUTCSeconds());Cn.range;const wd=se(r=>{r.setTime(r-r.getMilliseconds()-r.getSeconds()*lr)},(r,t)=>{r.setTime(+r+t*ti)},(r,t)=>(t-r)/ti,r=>r.getMinutes());wd.range,se(r=>{r.setUTCSeconds(0,0)},(r,t)=>{r.setTime(+r+t*ti)},(r,t)=>(t-r)/ti,r=>r.getUTCMinutes()).range;const Td=se(r=>{r.setTime(r-r.getMilliseconds()-r.getSeconds()*lr-r.getMinutes()*ti)},(r,t)=>{r.setTime(+r+t*cr)},(r,t)=>(t-r)/cr,r=>r.getHours());Td.range,se(r=>{r.setUTCMinutes(0,0,0)},(r,t)=>{r.setTime(+r+t*cr)},(r,t)=>(t-r)/cr,r=>r.getUTCHours()).range;const Lo=se(r=>r.setHours(0,0,0,0),(r,t)=>r.setDate(r.getDate()+t),(r,t)=>(t-r-(t.getTimezoneOffset()-r.getTimezoneOffset())*ti)/ur,r=>r.getDate()-1);Lo.range;const Sd=se(r=>{r.setUTCHours(0,0,0,0)},(r,t)=>{r.setUTCDate(r.getUTCDate()+t)},(r,t)=>(t-r)/ur,r=>r.getUTCDate()-1);Sd.range,se(r=>{r.setUTCHours(0,0,0,0)},(r,t)=>{r.setUTCDate(r.getUTCDate()+t)},(r,t)=>(t-r)/ur,r=>Math.floor(r/ur)).range;function Ms(r){return se(t=>{t.setDate(t.getDate()-(t.getDay()+7-r)%7),t.setHours(0,0,0,0)},(t,e)=>{t.setDate(t.getDate()+e*7)},(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*ti)/_d)}const Uh=Ms(0),Wh=Ms(1),mA=Ms(2),gA=Ms(3),In=Ms(4),yA=Ms(5),bA=Ms(6);Uh.range,Wh.range,mA.range,gA.range,In.range,yA.range,bA.range;function Ls(r){return se(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-r)%7),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e*7)},(t,e)=>(e-t)/_d)}const Uy=Ls(0),Xh=Ls(1),xA=Ls(2),_A=Ls(3),An=Ls(4),vA=Ls(5),wA=Ls(6);Uy.range,Xh.range,xA.range,_A.range,An.range,vA.range,wA.range;const Ed=se(r=>{r.setDate(1),r.setHours(0,0,0,0)},(r,t)=>{r.setMonth(r.getMonth()+t)},(r,t)=>t.getMonth()-r.getMonth()+(t.getFullYear()-r.getFullYear())*12,r=>r.getMonth());Ed.range,se(r=>{r.setUTCDate(1),r.setUTCHours(0,0,0,0)},(r,t)=>{r.setUTCMonth(r.getUTCMonth()+t)},(r,t)=>t.getUTCMonth()-r.getUTCMonth()+(t.getUTCFullYear()-r.getUTCFullYear())*12,r=>r.getUTCMonth()).range;const dr=se(r=>{r.setMonth(0,1),r.setHours(0,0,0,0)},(r,t)=>{r.setFullYear(r.getFullYear()+t)},(r,t)=>t.getFullYear()-r.getFullYear(),r=>r.getFullYear());dr.every=r=>!isFinite(r=Math.floor(r))||!(r>0)?null:se(t=>{t.setFullYear(Math.floor(t.getFullYear()/r)*r),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e*r)}),dr.range;const Ps=se(r=>{r.setUTCMonth(0,1),r.setUTCHours(0,0,0,0)},(r,t)=>{r.setUTCFullYear(r.getUTCFullYear()+t)},(r,t)=>t.getUTCFullYear()-r.getUTCFullYear(),r=>r.getUTCFullYear());Ps.every=r=>!isFinite(r=Math.floor(r))||!(r>0)?null:se(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/r)*r),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e*r)}),Ps.range;function TA(r,t,e,i,s,n){const o=[[Cn,1,lr],[Cn,5,5*lr],[Cn,15,15*lr],[Cn,30,30*lr],[n,1,ti],[n,5,5*ti],[n,15,15*ti],[n,30,30*ti],[s,1,cr],[s,3,3*cr],[s,6,6*cr],[s,12,12*cr],[i,1,ur],[i,2,2*ur],[e,1,_d],[t,1,By],[t,3,3*By],[r,1,vd]];function a(l,c,u){const d=c<l;d&&([l,c]=[c,l]);const f=u&&typeof u.range=="function"?u:h(l,c,u),p=f?f.range(l,+c+1):[];return d?p.reverse():p}function h(l,c,u){const d=Math.abs(c-l)/u,f=od(([,,g])=>g).right(o,d);if(f===o.length)return r.every(hd(l/vd,c/vd,u));if(f===0)return Bh.every(Math.max(hd(l,c,u),1));const[p,m]=o[d/o[f-1][2]<o[f][2]/d?f-1:f];return p.every(m)}return[a,h]}const[SA,EA]=TA(dr,Ed,Uh,Lo,Td,wd);function Cd(r){if(0<=r.y&&r.y<100){var t=new Date(-1,r.m,r.d,r.H,r.M,r.S,r.L);return t.setFullYear(r.y),t}return new Date(r.y,r.m,r.d,r.H,r.M,r.S,r.L)}function Id(r){if(0<=r.y&&r.y<100){var t=new Date(Date.UTC(-1,r.m,r.d,r.H,r.M,r.S,r.L));return t.setUTCFullYear(r.y),t}return new Date(Date.UTC(r.y,r.m,r.d,r.H,r.M,r.S,r.L))}function Po(r,t,e){return{y:r,m:t,d:e,H:0,M:0,S:0,L:0}}function CA(r){var t=r.dateTime,e=r.date,i=r.time,s=r.periods,n=r.days,o=r.shortDays,a=r.months,h=r.shortMonths,l=Go(s),c=Fo(s),u=Go(n),d=Fo(n),f=Go(o),p=Fo(o),m=Go(a),g=Fo(a),y=Go(h),x=Fo(h),b={a:H,A:$,b:U,B:D,c:null,d:Ky,e:Ky,f:jA,g:n2,G:a2,H:KA,I:YA,j:zA,L:Yy,m:JA,M:$A,p:F,q:Z,Q:qy,s:tb,S:QA,u:qA,U:t2,V:e2,w:i2,W:r2,x:null,X:null,y:s2,Y:o2,Z:h2,"%":Qy},v={a:tt,A:ft,b:ot,B:Et,c:null,d:jy,e:jy,f:d2,g:w2,G:S2,H:l2,I:c2,j:u2,L:Jy,m:f2,M:p2,p:Mt,q:bt,Q:qy,s:tb,S:m2,u:g2,U:y2,V:b2,w:x2,W:_2,x:null,X:null,y:v2,Y:T2,Z:E2,"%":Qy},w={a:P,A:G,b:N,B:A,c:k,d:Vy,e:Vy,f:XA,g:Zy,G:Xy,H:Hy,I:Hy,j:OA,L:WA,m:kA,M:BA,p:R,q:DA,Q:VA,s:HA,S:UA,u:LA,U:PA,V:GA,w:MA,W:FA,x:V,X:K,y:Zy,Y:Xy,Z:NA,"%":ZA};b.x=S(e,b),b.X=S(i,b),b.c=S(t,b),v.x=S(e,v),v.X=S(i,v),v.c=S(t,v);function S(B,j){return function(J){var O=[],gt=-1,ut=0,It=B.length,Dt,Ee,ri;for(J instanceof Date||(J=new Date(+J));++gt<It;)B.charCodeAt(gt)===37&&(O.push(B.slice(ut,gt)),(Ee=Wy[Dt=B.charAt(++gt)])!=null?Dt=B.charAt(++gt):Ee=Dt==="e"?" ":"0",(ri=j[Dt])&&(Dt=ri(J,Ee)),O.push(Dt),ut=gt+1);return O.push(B.slice(ut,gt)),O.join("")}}function C(B,j){return function(J){var O=Po(1900,void 0,1),gt=I(O,B,J+="",0),ut,It;if(gt!=J.length)return null;if("Q"in O)return new Date(O.Q);if("s"in O)return new Date(O.s*1e3+("L"in O?O.L:0));if(j&&!("Z"in O)&&(O.Z=0),"p"in O&&(O.H=O.H%12+O.p*12),O.m===void 0&&(O.m="q"in O?O.q:0),"V"in O){if(O.V<1||O.V>53)return null;"w"in O||(O.w=1),"Z"in O?(ut=Id(Po(O.y,0,1)),It=ut.getUTCDay(),ut=It>4||It===0?Xh.ceil(ut):Xh(ut),ut=Sd.offset(ut,(O.V-1)*7),O.y=ut.getUTCFullYear(),O.m=ut.getUTCMonth(),O.d=ut.getUTCDate()+(O.w+6)%7):(ut=Cd(Po(O.y,0,1)),It=ut.getDay(),ut=It>4||It===0?Wh.ceil(ut):Wh(ut),ut=Lo.offset(ut,(O.V-1)*7),O.y=ut.getFullYear(),O.m=ut.getMonth(),O.d=ut.getDate()+(O.w+6)%7)}else("W"in O||"U"in O)&&("w"in O||(O.w="u"in O?O.u%7:"W"in O?1:0),It="Z"in O?Id(Po(O.y,0,1)).getUTCDay():Cd(Po(O.y,0,1)).getDay(),O.m=0,O.d="W"in O?(O.w+6)%7+O.W*7-(It+5)%7:O.w+O.U*7-(It+6)%7);return"Z"in O?(O.H+=O.Z/100|0,O.M+=O.Z%100,Id(O)):Cd(O)}}function I(B,j,J,O){for(var gt=0,ut=j.length,It=J.length,Dt,Ee;gt<ut;){if(O>=It)return-1;if(Dt=j.charCodeAt(gt++),Dt===37){if(Dt=j.charAt(gt++),Ee=w[Dt in Wy?j.charAt(gt++):Dt],!Ee||(O=Ee(B,J,O))<0)return-1}else if(Dt!=J.charCodeAt(O++))return-1}return O}function R(B,j,J){var O=l.exec(j.slice(J));return O?(B.p=c.get(O[0].toLowerCase()),J+O[0].length):-1}function P(B,j,J){var O=f.exec(j.slice(J));return O?(B.w=p.get(O[0].toLowerCase()),J+O[0].length):-1}function G(B,j,J){var O=u.exec(j.slice(J));return O?(B.w=d.get(O[0].toLowerCase()),J+O[0].length):-1}function N(B,j,J){var O=y.exec(j.slice(J));return O?(B.m=x.get(O[0].toLowerCase()),J+O[0].length):-1}function A(B,j,J){var O=m.exec(j.slice(J));return O?(B.m=g.get(O[0].toLowerCase()),J+O[0].length):-1}function k(B,j,J){return I(B,t,j,J)}function V(B,j,J){return I(B,e,j,J)}function K(B,j,J){return I(B,i,j,J)}function H(B){return o[B.getDay()]}function $(B){return n[B.getDay()]}function U(B){return h[B.getMonth()]}function D(B){return a[B.getMonth()]}function F(B){return s[+(B.getHours()>=12)]}function Z(B){return 1+~~(B.getMonth()/3)}function tt(B){return o[B.getUTCDay()]}function ft(B){return n[B.getUTCDay()]}function ot(B){return h[B.getUTCMonth()]}function Et(B){return a[B.getUTCMonth()]}function Mt(B){return s[+(B.getUTCHours()>=12)]}function bt(B){return 1+~~(B.getUTCMonth()/3)}return{format:function(B){var j=S(B+="",b);return j.toString=function(){return B},j},parse:function(B){var j=C(B+="",!1);return j.toString=function(){return B},j},utcFormat:function(B){var j=S(B+="",v);return j.toString=function(){return B},j},utcParse:function(B){var j=C(B+="",!0);return j.toString=function(){return B},j}}}var Wy={"-":"",_:" ",0:"0"},ue=/^\s*\d+/,IA=/^%/,AA=/[\\^$*+?|[\]().{}]/g;function Rt(r,t,e){var i=r<0?"-":"",s=(i?-r:r)+"",n=s.length;return i+(n<e?new Array(e-n+1).join(t)+s:s)}function RA(r){return r.replace(AA,"\\$&")}function Go(r){return new RegExp("^(?:"+r.map(RA).join("|")+")","i")}function Fo(r){return new Map(r.map((t,e)=>[t.toLowerCase(),e]))}function MA(r,t,e){var i=ue.exec(t.slice(e,e+1));return i?(r.w=+i[0],e+i[0].length):-1}function LA(r,t,e){var i=ue.exec(t.slice(e,e+1));return i?(r.u=+i[0],e+i[0].length):-1}function PA(r,t,e){var i=ue.exec(t.slice(e,e+2));return i?(r.U=+i[0],e+i[0].length):-1}function GA(r,t,e){var i=ue.exec(t.slice(e,e+2));return i?(r.V=+i[0],e+i[0].length):-1}function FA(r,t,e){var i=ue.exec(t.slice(e,e+2));return i?(r.W=+i[0],e+i[0].length):-1}function Xy(r,t,e){var i=ue.exec(t.slice(e,e+4));return i?(r.y=+i[0],e+i[0].length):-1}function Zy(r,t,e){var i=ue.exec(t.slice(e,e+2));return i?(r.y=+i[0]+(+i[0]>68?1900:2e3),e+i[0].length):-1}function NA(r,t,e){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(e,e+6));return i?(r.Z=i[1]?0:-(i[2]+(i[3]||"00")),e+i[0].length):-1}function DA(r,t,e){var i=ue.exec(t.slice(e,e+1));return i?(r.q=i[0]*3-3,e+i[0].length):-1}function kA(r,t,e){var i=ue.exec(t.slice(e,e+2));return i?(r.m=i[0]-1,e+i[0].length):-1}function Vy(r,t,e){var i=ue.exec(t.slice(e,e+2));return i?(r.d=+i[0],e+i[0].length):-1}function OA(r,t,e){var i=ue.exec(t.slice(e,e+3));return i?(r.m=0,r.d=+i[0],e+i[0].length):-1}function Hy(r,t,e){var i=ue.exec(t.slice(e,e+2));return i?(r.H=+i[0],e+i[0].length):-1}function BA(r,t,e){var i=ue.exec(t.slice(e,e+2));return i?(r.M=+i[0],e+i[0].length):-1}function UA(r,t,e){var i=ue.exec(t.slice(e,e+2));return i?(r.S=+i[0],e+i[0].length):-1}function WA(r,t,e){var i=ue.exec(t.slice(e,e+3));return i?(r.L=+i[0],e+i[0].length):-1}function XA(r,t,e){var i=ue.exec(t.slice(e,e+6));return i?(r.L=Math.floor(i[0]/1e3),e+i[0].length):-1}function ZA(r,t,e){var i=IA.exec(t.slice(e,e+1));return i?e+i[0].length:-1}function VA(r,t,e){var i=ue.exec(t.slice(e));return i?(r.Q=+i[0],e+i[0].length):-1}function HA(r,t,e){var i=ue.exec(t.slice(e));return i?(r.s=+i[0],e+i[0].length):-1}function Ky(r,t){return Rt(r.getDate(),t,2)}function KA(r,t){return Rt(r.getHours(),t,2)}function YA(r,t){return Rt(r.getHours()%12||12,t,2)}function zA(r,t){return Rt(1+Lo.count(dr(r),r),t,3)}function Yy(r,t){return Rt(r.getMilliseconds(),t,3)}function jA(r,t){return Yy(r,t)+"000"}function JA(r,t){return Rt(r.getMonth()+1,t,2)}function $A(r,t){return Rt(r.getMinutes(),t,2)}function QA(r,t){return Rt(r.getSeconds(),t,2)}function qA(r){var t=r.getDay();return t===0?7:t}function t2(r,t){return Rt(Uh.count(dr(r)-1,r),t,2)}function zy(r){var t=r.getDay();return t>=4||t===0?In(r):In.ceil(r)}function e2(r,t){return r=zy(r),Rt(In.count(dr(r),r)+(dr(r).getDay()===4),t,2)}function i2(r){return r.getDay()}function r2(r,t){return Rt(Wh.count(dr(r)-1,r),t,2)}function s2(r,t){return Rt(r.getFullYear()%100,t,2)}function n2(r,t){return r=zy(r),Rt(r.getFullYear()%100,t,2)}function o2(r,t){return Rt(r.getFullYear()%1e4,t,4)}function a2(r,t){var e=r.getDay();return r=e>=4||e===0?In(r):In.ceil(r),Rt(r.getFullYear()%1e4,t,4)}function h2(r){var t=r.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Rt(t/60|0,"0",2)+Rt(t%60,"0",2)}function jy(r,t){return Rt(r.getUTCDate(),t,2)}function l2(r,t){return Rt(r.getUTCHours(),t,2)}function c2(r,t){return Rt(r.getUTCHours()%12||12,t,2)}function u2(r,t){return Rt(1+Sd.count(Ps(r),r),t,3)}function Jy(r,t){return Rt(r.getUTCMilliseconds(),t,3)}function d2(r,t){return Jy(r,t)+"000"}function f2(r,t){return Rt(r.getUTCMonth()+1,t,2)}function p2(r,t){return Rt(r.getUTCMinutes(),t,2)}function m2(r,t){return Rt(r.getUTCSeconds(),t,2)}function g2(r){var t=r.getUTCDay();return t===0?7:t}function y2(r,t){return Rt(Uy.count(Ps(r)-1,r),t,2)}function $y(r){var t=r.getUTCDay();return t>=4||t===0?An(r):An.ceil(r)}function b2(r,t){return r=$y(r),Rt(An.count(Ps(r),r)+(Ps(r).getUTCDay()===4),t,2)}function x2(r){return r.getUTCDay()}function _2(r,t){return Rt(Xh.count(Ps(r)-1,r),t,2)}function v2(r,t){return Rt(r.getUTCFullYear()%100,t,2)}function w2(r,t){return r=$y(r),Rt(r.getUTCFullYear()%100,t,2)}function T2(r,t){return Rt(r.getUTCFullYear()%1e4,t,4)}function S2(r,t){var e=r.getUTCDay();return r=e>=4||e===0?An(r):An.ceil(r),Rt(r.getUTCFullYear()%1e4,t,4)}function E2(){return"+0000"}function Qy(){return"%"}function qy(r){return+r}function tb(r){return Math.floor(+r/1e3)}var Rn,eb;C2({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function C2(r){return Rn=CA(r),eb=Rn.format,Rn.parse,Rn.utcFormat,Rn.utcParse,Rn}function I2(r){return new Date(r)}function A2(r){return r instanceof Date?+r:+new Date(+r)}function ib(r,t,e,i,s,n,o,a,h,l){var c=ky(),u=c.invert,d=c.domain,f=l(".%L"),p=l(":%S"),m=l("%I:%M"),g=l("%I %p"),y=l("%a %d"),x=l("%b %d"),b=l("%B"),v=l("%Y");function w(S){return(h(S)<S?f:a(S)<S?p:o(S)<S?m:n(S)<S?g:i(S)<S?s(S)<S?y:x:e(S)<S?b:v)(S)}return c.invert=function(S){return new Date(u(S))},c.domain=function(S){return arguments.length?d(Array.from(S,A2)):d().map(I2)},c.ticks=function(S){var C=d();return r(C[0],C[C.length-1],S??10)},c.tickFormat=function(S,C){return C==null?w:l(C)},c.nice=function(S){var C=d();return(!S||typeof S.range!="function")&&(S=t(C[0],C[C.length-1],S??10)),S?d(pA(C,S)):c},c.copy=function(){return Dy(c,ib(r,t,e,i,s,n,o,a,h,l))},c}function R2(){return Fy.apply(ib(SA,EA,dr,Ed,Uh,Lo,Td,wd,Cn,eb).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function No(r,t,e){this.k=r,this.x=t,this.y=e}No.prototype={constructor:No,scale:function(r){return r===1?this:new No(this.k*r,this.x,this.y)},translate:function(r,t){return r===0&t===0?this:new No(this.k,this.x+this.k*r,this.y+this.k*t)},apply:function(r){return[r[0]*this.k+this.x,r[1]*this.k+this.y]},applyX:function(r){return r*this.k+this.x},applyY:function(r){return r*this.k+this.y},invert:function(r){return[(r[0]-this.x)/this.k,(r[1]-this.y)/this.k]},invertX:function(r){return(r-this.x)/this.k},invertY:function(r){return(r-this.y)/this.k},rescaleX:function(r){return r.copy().domain(r.range().map(this.invertX,this).map(r.invert,r))},rescaleY:function(r){return r.copy().domain(r.range().map(this.invertY,this).map(r.invert,r))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},No.prototype;function rb(r){return r.mode==="temporal"||r.mode==="left-aligned"?M2(r):L2(r)}function M2({domain:r,range:t}){return R2().domain(r).range(t)}function L2({domain:r,range:t}){return Oy().domain(r).range(t)}function Ad(r){return{mode:et.horizontal,range:TM(),domain:SM(r)}}function P2(){return{mode:et.vertical}}let Mn=null;async function G2(){const r=await gr();sb(r.start_time),q.on("layoutSettingsUpdated",()=>sb(r.start_time))}function F2(){Mn=null}async function ei(){return Mn||await Ie("scaleCreated")}async function sb(r){await ee();const t=Mn?"scaleUpdated":"scaleCreated",e=Ad(r);Mn=rb(e),q.emit(t,Mn)}let Fe=null,Rd=null;async function N2(){const r=await Qt(),t=await bu();Fe=new mI({screenHeight:t.clientHeight,screenWidth:t.clientWidth,events:r.renderer.events,passiveWheel:!1}),Fe.zIndex=1,Fe.drag().pinch().wheel({trackpadPinch:!0}).decelerate({friction:.9}).clampZoom({minWidth:t.clientWidth/2}),Fe.on("moved",()=>{q.emit("viewportMoved",null)}).on("moved-end",()=>{q.emit("viewportMoved",null)}),r.stage.addChild(Fe),q.emit("viewportCreated",Fe),q.on("applicationResized",X2),q.on("scaleUpdated",()=>Do()),U2()}function D2(){Fe=null,Rd=null}async function Md({animate:r}={}){const e=(await te()).getChildByName(Lf);if(!e)throw new Error("Nodes container not found");H2();const{x:i,y:s,width:n,height:o}=e.getLocalBounds();if(!n||!o){O2({animate:r});return}k2({x:i,y:s,width:n,height:o,animate:r})}async function k2({x:r,y:t,width:e,height:i,animate:s}){const n=await Pt(),o=await te(),{guideTextSize:a,guideTextTopPadding:h,columnGap:l,rowGap:c,eventTargetSize:u}=n.styles,d=a+h,f=e+l*2,p=i+c*4+d+u,m=o.findFit(f,p);o.animate({position:{x:r+e/2,y:t+i/2+d},scale:Math.min(m,1),time:s?n.animationDuration:0,ease:"easeInOutQuad",removeOnInterrupt:!0,callbackOnComplete:()=>{Vh(),Do()}})}async function O2({animate:r}){const t=await gr(),e=await Pt(),i=await te(),s=await ei();let n=s(t.start_time)-e.styles.columnGap,o=s(t.end_time??new Date)+e.styles.columnGap;if(n>o){const c=n;n=o,o=c}const a=o-n,h=n+a/2,l=i.findFit(a,0);i.animate({position:{x:h,y:0},scale:l,time:r?e.animationDuration:0,ease:"easeInOutQuad",removeOnInterrupt:!0,callbackOnComplete:()=>{Vh(),Do()}})}async function te(){return Fe||await Ie("viewportCreated")}function nb(r){uy(Rd,r)||(Rd=r,q.emit("viewportDateRangeUpdated",r))}function B2({xOffset:r,yOffset:t}){if(!Fe)return;const{x:e,y:i}=Fe.transform.position;Fe.setTransform(e+r,i+t,Fe.transform.scale.x,Fe.transform.scale.y)}async function U2(){const r=await te();Do(),r.on("moved",()=>Do())}async function Do(){const r=await ob();r&&nb(r)}async function ob(){const r=await te(),t=await ei(),e=t.invert(r.left),i=t.invert(r.right);return e instanceof Date&&i instanceof Date?[e,i]:null}async function W2(r){const t=await ob(),e=await ee();if(r===void 0||e.isDependency()||uy(r,t))return;const i=await te(),s=await ei(),[n,o]=r,a=s(n),h=s(o),l=a+(h-a)/2;nb(r),i.fitWidth(h-a,!0),i.moveCenter(l,i.center.y)}async function X2(){const r=await Qt(),t=await te(),e=await bu(),i=t.screenWidth,s=t.screenHeight,n=e.clientWidth,o=e.clientHeight,a=(n-i)/2,h=(o-s)/2;t.resize(r.screen.width,r.screen.height),B2({xOffset:a,yOffset:h})}class Zh{constructor(){Tf(this,"status","visible");Tf(this,"labels",new Set)}get visible(){return this.status==="visible"}get hidden(){return this.status==="hidden"}show(){if(this.status!=="visible"){for(const t of this.labels)t.visible=!0;this.status="visible"}}hide(){if(this.status!=="hidden"){for(const t of this.labels)t.visible=!1;this.status="hidden"}}toggle(t){t?this.show():this.hide()}add(t){this.labels.add(t),t.visible=this.visible}clear(){this.labels.clear()}}let Bi=null,ii=null,Ui=null,fr=null,mi=null;async function Z2(){const r=await te(),t=await Qt();Bi=new kC({toggle:"renderable"}),ii=new Zh,Ui=new Zh,mi=new Zh,fr=new Zh,t.ticker.add(()=>{if(r.dirty){const e=r.scale.x>.1,i=r.scale.x>.2,s=r.scale.x>.2,n=r.scale.x>.2;mi==null||mi.toggle(e),ii==null||ii.toggle(i),Ui==null||Ui.toggle(s),fr==null||fr.toggle(n),Bi==null||Bi.cull(t.renderer.screen),r.dirty=!1}}),q.emit("cullCreated",Bi),q.emit("labelCullCreated",ii),q.emit("iconCullCreated",ii),q.emit("edgeCullCreated",mi),q.emit("toggleCullCreated",fr)}function V2(){Bi=null,ii==null||ii.clear(),ii=null,Ui==null||Ui.clear(),Ui=null,mi==null||mi.clear(),mi=null,fr==null||fr.clear(),fr=null}async function Vh(){const r=await te();r.dirty=!0}function H2(){Bi&&Bi.uncull()}async function ab(){return Bi||await Ie("cullCreated")}async function K2(){return mi||await Ie("edgeCullCreated")}async function hb(){return ii||await Ie("labelCullCreated")}async function Y2(){return Ui||await Ie("iconCullCreated")}async function lb(){const r=await ee(),t=await Pt();function e(i,s,n){const a=r.disableAnimations||n?0:t.animationDuration/1e3;return cy.to(i,{...s,duration:a,ease:"power1.out",onUpdate:()=>{Vh()}})}return{animate:e}}let Hh=new Map;function z2(){Hh=new Map}async function ko(r,t){const e=`${r.toString()}-${JSON.stringify(t)}`;if(Hh.has(e))return Hh.get(e);const i=await r(...t);return Hh.set(e,i),i}async function j2({size:r,stroke:t=1,radius:e=0}){const i=await Qt(),s=new un;return s.lineStyle(t,"#fff",1,0),s.drawRoundedRect(0,0,r*2,r*2,e),i.renderer.generateTexture(s,{region:new mt(0,0,r,r),resolution:10})}async function Oo(r){return await ko(j2,[r])}var Kh=(r=>(r[r.Up=0]="Up",r[r.Down=180]="Down",r[r.Left=270]="Left",r[r.Right=90]="Right",r))(Kh||{});function cb(){const r=new $t;async function t(e){const{rotate:i=0}=e,s={size:e.size,radius:e.radius,stroke:e.stroke},n=await Oo(s);return r.texture=n,r.anchor.set(.5,.5),r.angle=45+i,r}return{element:r,render:t}}async function J2(){const r=await Qt(),t=new un;return t.beginFill("#fff"),t.drawRect(0,0,1,1),t.endFill(),r.renderer.generateTexture(t,{wrapMode:vi.REPEAT})}async function Ld(){return await ko(J2,[])}function Pd(r,t){return Array.from({length:r},(e,i)=>t(i))}const $2=8,Q2=2;async function q2(){const r=await Pt(),t=await ab(),e=await K2(),{animate:i}=await lb(),s=new Ct,{element:n,render:o}=await cb(),a=await Ld(),h=Pd(20,()=>new dt),l=new LS(a,h);let c=!1;s.name=sx,s.addChild(n),s.addChild(l),t.addAll([n,l]),e.add(s);async function u(){return await o({size:10,rotate:Kh.Right}),n.tint=r.styles.edgeColor,l.tint=r.styles.edgeColor,s}async function d(p,m){const g=f(m);c||await u();for(const[y,x]of h.entries()){const{x:b,y:v}=g[y];i(x,{x:b,y:v},!c)}i(s,{x:p.x,y:p.y},!c),i(n,{x:m.x-$2,y:m.y},!c),c=!0}function f({x:p,y:m}){const g=[],y={x:0,y:0},x={x:p-Q2,y:m},b={x:ub(y.x,{source:y,target:x}),y:y.y},v={x:ub(x.x,{source:y,target:x},!0),y:x.y};for(const[w]of h.entries()){if(w===h.length-1){g[w]=x;continue}const S=tR(w,{source:y,target:x,sourceBezier:b,targetBezier:v});g[w]=S}return g}return{element:s,render:u,setPosition:d}}function ub(r,{source:t,target:e},i){const s=(e.x-t.x)/2;return r+(s>64?s:64)*(i?-1:1)}function tR(r,t){const e=r/20,{source:i,target:s,sourceBezier:n,targetBezier:o}=t,a=i.x+(n.x-i.x)*e,h=i.y+(n.y-i.y)*e,l=n.x+(o.x-n.x)*e,c=n.y+(o.y-n.y)*e,u=o.x+(s.x-o.x)*e,d=o.y+(s.y-o.y)*e,f=a+(l-a)*e,p=h+(c-h)*e,m=l+(u-l)*e,g=c+(d-c)*e,y=f+(m-f)*e,x=p+(g-p)*e;return{x:y,y:x}}async function eR({height:r,radius:t}){const e=await Qt(),i=new un;return i.beginFill("#fff"),i.drawRoundedRect(0,0,t*2,r,t),i.endFill(),e.renderer.generateTexture(i,{region:new mt(0,0,t,r),resolution:10})}async function iR(r){return await ko(eR,[r])}function rR(){const r=new $t,t=new $t;async function e(i){const s=await iR(i);return r.texture=s,t.texture=s,t.anchor.x=1,t.scale.x=-1,{left:r,right:t}}return{left:r,right:t,render:e}}async function pr(){const r=await Ld();return new $t(r)}async function Gd(){const r=new Ct,t=await pr(),{left:e,right:i,render:s}=await rR();r.addChild(t),r.addChild(e),r.addChild(i);async function n(h){const{width:l,x:c,visible:u}=a(h);return await s({height:h.height,radius:h.radius}),t.visible=u,t.width=l,t.height=h.height,t.x=c,e.visible=o(h.capLeft,h.radius),i.visible=o(h.capRight,h.radius),i.x=h.radius+l,t.tint=h.background,e.tint=h.background,i.tint=h.background,r}function o(h,l){return l===0?!1:h??!0}function a(h){const l=o(h.capLeft,h.radius),c=o(h.capRight,h.radius);let u=0;l&&(u+=h.radius),c&&(u+=h.radius);const d=Math.max(h.width-u,0),f=d>0,p=l?h.radius:0;return{width:d,visible:f,x:p}}return{element:r,render:n}}function Fd(){const r=new Ct,t=new $t,e=new $t,i=new $t,s=new $t,n=new $t,o=new $t,a=new $t,h=new $t;t.name="border-corner-top-left",e.name="border-corner-top-right",i.name="border-corner-bottom-left",s.name="border-corner-bottom-right",n.name="border-corner-left",o.name="border-corner-right",a.name="border-corner-top",h.name="border-corner-bottom",e.anchor.x=1,e.scale.x=-1,i.anchor.y=1,i.scale.y=-1,s.anchor.x=1,s.scale.x=-1,s.anchor.y=1,s.scale.y=-1,r.addChild(t),r.addChild(e),r.addChild(i),r.addChild(s),r.addChild(n),r.addChild(o),r.addChild(a),r.addChild(h);async function l(p){const{radius:m=0,color:g="#fff",stroke:y,width:x,height:b}=p,v=typeof m=="number",w={topLeft:c(v?m:m[0],x,b),topRight:c(v?m:m[1],x,b),bottomLeft:c(v?m:m[2],x,b),bottomRight:c(v?m:m[3],x,b)};return await u({width:x,height:b,stroke:y,cornerSizes:w}),await d({width:x,height:b,stroke:y,cornerSizes:w}),f(g),r}function c(p,m,g){const y=Math.min(m,g);return{size:p*2>y?y/2:p,radius:p}}async function u({width:p,height:m,stroke:g,cornerSizes:y}){const{topLeft:x,topRight:b,bottomLeft:v,bottomRight:w}=y,[S,C,I,R]=await Promise.all([Oo({...x,stroke:g}),Oo({...b,stroke:g}),Oo({...v,stroke:g}),Oo({...w,stroke:g})]);t.texture=S,e.texture=C,i.texture=R,s.texture=I,t.position.set(0,0),e.position.set(p-b.size,0),i.position.set(0,m-v.size),s.position.set(p-w.size,m-w.size)}async function d({width:p,height:m,stroke:g,cornerSizes:y}){const x=await Ld(),{topLeft:b,topRight:v,bottomLeft:w,bottomRight:S}=y;a.texture=x,n.texture=x,o.texture=x,h.texture=x,n.position.set(0,b.size),n.height=Math.max(m-b.size-w.size,0),n.width=g,o.position.set(p-g,v.size),o.height=Math.max(m-v.size-S.size,0),o.width=g,a.position.set(b.size,0),a.width=Math.max(p-b.size-v.size,0),a.height=g,h.position.set(w.size,m-g),h.width=Math.max(p-w.size-S.size,0),h.height=g}function f(p){t.tint=p,e.tint=p,i.tint=p,s.tint=p,a.tint=p,n.tint=p,o.tint=p,h.tint=p}return{element:r,render:l}}async function Yh(){const r=await Pt(),t=new Ct,{element:e,render:i}=await Fd();async function s({selected:n,width:o,height:a}){if(!n)return t.removeChild(e),t;const{selectedBorderColor:h,selectedBorderWidth:l,selectedBorderOffset:c,selectedBorderRadius:u}=r.styles;return e.position.set(-c,-c),t.addChild(e),await i({stroke:l,radius:u,width:o+c*2,height:a+c*2,color:h}),t}return{element:t,render:s}}async function sR(){const r=await Pt(),t=new Ct,{element:e,render:i}=await Gd(),{element:s,render:n}=await Yh();t.addChild(e),t.addChild(s);async function o({selected:a,width:h,height:l}){const{artifactBgColor:c,artifactBorderRadius:u}=r.styles,d={width:h,height:l,background:c,radius:u,capLeft:!0,capRight:!0};return await Promise.all([i(d),n({selected:a,width:h,height:l})]),t}return{element:t,render:o}}const nR=Object.freeze(Object.defineProperty({__proto__:null,Artifact:"data:image/svg+xml,%3csvg%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7.5%203.875C7.5%203.11561%208.11561%202.5%208.875%202.5H16.125C16.8844%202.5%2017.5%203.11561%2017.5%203.875V16.125C17.5%2016.8844%2016.8844%2017.5%2016.125%2017.5H8.875C8.11561%2017.5%207.5%2016.8844%207.5%2016.125V10.9375H6.66449C6.31341%2011.6765%205.56012%2012.1875%204.6875%2012.1875C3.47938%2012.1875%202.5%2011.2081%202.5%2010C2.5%208.79188%203.47938%207.8125%204.6875%207.8125C5.56012%207.8125%206.31341%208.32345%206.66449%209.0625H7.5V3.875ZM15.7984%207.99134L12.7215%2012.9913C12.5599%2013.2539%2012.2797%2013.4202%2011.9718%2013.4362C11.664%2013.4523%2011.3679%2013.3159%2011.18%2013.0716L9.25692%2010.5716L10.7431%209.4284L11.8372%2010.8508L14.2016%207.00866L15.7984%207.99134Z'%20fill='white'/%3e%3c/svg%3e",ArtifactMarkdown:"data:image/svg+xml,%3csvg%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7.5%203.875C7.5%203.11561%208.11561%202.5%208.875%202.5H16.125C16.8844%202.5%2017.5%203.11561%2017.5%203.875V16.125C17.5%2016.8844%2016.8844%2017.5%2016.125%2017.5H8.875C8.11561%2017.5%207.5%2016.8844%207.5%2016.125V10.9375H6.66449C6.31341%2011.6765%205.56012%2012.1875%204.6875%2012.1875C3.47938%2012.1875%202.5%2011.2081%202.5%2010C2.5%208.79188%203.47938%207.8125%204.6875%207.8125C5.56012%207.8125%206.31341%208.32345%206.66449%209.0625H7.5V3.875ZM15%207.1875H10V5.3125H15V7.1875ZM15%2010.9375H10V9.0625H15V10.9375ZM10%2014.6875H12.5V12.8125H10V14.6875Z'%20fill='white'/%3e%3c/svg%3e",ArtifactResult:"data:image/svg+xml,%3csvg%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7.5%203.875C7.5%203.11561%208.11561%202.5%208.875%202.5H16.125C16.8844%202.5%2017.5%203.11561%2017.5%203.875V16.125C17.5%2016.8844%2016.8844%2017.5%2016.125%2017.5H8.875C8.11561%2017.5%207.5%2016.8844%207.5%2016.125V10.9375H6.66449C6.31341%2011.6765%205.56012%2012.1875%204.6875%2012.1875C3.47938%2012.1875%202.5%2011.2081%202.5%2010C2.5%208.79188%203.47938%207.8125%204.6875%207.8125C5.56012%207.8125%206.31341%208.32345%206.66449%209.0625H7.5V3.875ZM9.52483%206.61458C9.7035%205.94774%2010.3889%205.55202%2011.0558%205.73069C11.7226%205.90937%2012.1183%206.59479%2011.9396%207.26162C11.761%207.92846%2011.0755%208.32418%2010.4087%208.14551C9.74188%207.96683%209.34615%207.28141%209.52483%206.61458ZM13.0604%2012.7383C13.239%2012.0715%2013.9245%2011.6757%2014.5913%2011.8544C15.2581%2012.0331%2015.6539%2012.7185%2015.4752%2013.3854C15.2965%2014.0522%2014.6111%2014.4479%2013.9442%2014.2692C13.2774%2014.0906%2012.8817%2013.4051%2013.0604%2012.7383ZM10.78%2014.27L15.78%206.77002L14.2199%205.72996L9.21995%2013.23L10.78%2014.27Z'%20fill='white'/%3e%3c/svg%3e",ArtifactTable:"data:image/svg+xml,%3csvg%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7.5%203.875C7.5%203.11561%208.11561%202.5%208.875%202.5H16.125C16.8844%202.5%2017.5%203.11561%2017.5%203.875V16.125C17.5%2016.8844%2016.8844%2017.5%2016.125%2017.5H8.875C8.11561%2017.5%207.5%2016.8844%207.5%2016.125V10.9375H6.66449C6.31341%2011.6765%205.56012%2012.1875%204.6875%2012.1875C3.47938%2012.1875%202.5%2011.2081%202.5%2010C2.5%208.79188%203.47938%207.8125%204.6875%207.8125C5.56012%207.8125%206.31341%208.32345%206.66449%209.0625H7.5V3.875ZM10%207.1875H11.875V5.3125H10V7.1875ZM10%2010.9375H11.875V9.0625H10V10.9375ZM11.875%2014.6875H10V12.8125H11.875V14.6875ZM13.125%207.1875H15V5.3125H13.125V7.1875ZM15%2010.9375H13.125V9.0625H15V10.9375ZM13.125%2014.6875H15V12.8125H13.125V14.6875Z'%20fill='white'/%3e%3c/svg%3e"},Symbol.toStringTag,{value:"Module"}));function oR(r){const t={resolution:4};return nt.from(nR[r],t)}async function aR(r){return await ko(oR,[r])}async function hR({cullAtZoomThreshold:r=!0}={}){const t=await Y2(),e=new $t;r&&t.add(e);async function i(s){const n=await aR(s);return e.texture=n,e}return{element:e,render:i}}var db={exports:{}};(function(r){(function(){function t(m,g){document.addEventListener?m.addEventListener("scroll",g,!1):m.attachEvent("scroll",g)}function e(m){document.body?m():document.addEventListener?document.addEventListener("DOMContentLoaded",function g(){document.removeEventListener("DOMContentLoaded",g),m()}):document.attachEvent("onreadystatechange",function g(){(document.readyState=="interactive"||document.readyState=="complete")&&(document.detachEvent("onreadystatechange",g),m())})}function i(m){this.g=document.createElement("div"),this.g.setAttribute("aria-hidden","true"),this.g.appendChild(document.createTextNode(m)),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 s(m,g){m.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 n(m){var g=m.g.offsetWidth,y=g+100;return m.j.style.width=y+"px",m.i.scrollLeft=y,m.h.scrollLeft=m.h.scrollWidth+100,m.l!==g?(m.l=g,!0):!1}function o(m,g){function y(){var b=x;n(b)&&b.g.parentNode!==null&&g(b.l)}var x=m;t(m.h,y),t(m.i,y),n(m)}function a(m,g,y){g=g||{},y=y||window,this.family=m,this.style=g.style||"normal",this.weight=g.weight||"normal",this.stretch=g.stretch||"normal",this.context=y}var h=null,l=null,c=null,u=null;function d(m){return l===null&&(f(m)&&/Apple/.test(window.navigator.vendor)?(m=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))(?:\.([0-9]+))/.exec(window.navigator.userAgent),l=!!m&&603>parseInt(m[1],10)):l=!1),l}function f(m){return u===null&&(u=!!m.document.fonts),u}function p(m,g){var y=m.style,x=m.weight;if(c===null){var b=document.createElement("div");try{b.style.font="condensed 100px sans-serif"}catch{}c=b.style.font!==""}return[y,x,c?m.stretch:"","100px",g].join(" ")}a.prototype.load=function(m,g){var y=this,x=m||"BESbswy",b=0,v=g||3e3,w=new Date().getTime();return new Promise(function(S,C){if(f(y.context)&&!d(y.context)){var I=new Promise(function(P,G){function N(){new Date().getTime()-w>=v?G(Error(""+v+"ms timeout exceeded")):y.context.document.fonts.load(p(y,'"'+y.family+'"'),x).then(function(A){1<=A.length?P():setTimeout(N,25)},G)}N()}),R=new Promise(function(P,G){b=setTimeout(function(){G(Error(""+v+"ms timeout exceeded"))},v)});Promise.race([R,I]).then(function(){clearTimeout(b),S(y)},C)}else e(function(){function P(){var Z;(Z=V!=-1&&K!=-1||V!=-1&&H!=-1||K!=-1&&H!=-1)&&((Z=V!=K&&V!=H&&K!=H)||(h===null&&(Z=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))/.exec(window.navigator.userAgent),h=!!Z&&(536>parseInt(Z[1],10)||parseInt(Z[1],10)===536&&11>=parseInt(Z[2],10))),Z=h&&(V==$&&K==$&&H==$||V==U&&K==U&&H==U||V==D&&K==D&&H==D)),Z=!Z),Z&&(F.parentNode!==null&&F.parentNode.removeChild(F),clearTimeout(b),S(y))}function G(){if(new Date().getTime()-w>=v)F.parentNode!==null&&F.parentNode.removeChild(F),C(Error(""+v+"ms timeout exceeded"));else{var Z=y.context.document.hidden;(Z===!0||Z===void 0)&&(V=N.g.offsetWidth,K=A.g.offsetWidth,H=k.g.offsetWidth,P()),b=setTimeout(G,50)}}var N=new i(x),A=new i(x),k=new i(x),V=-1,K=-1,H=-1,$=-1,U=-1,D=-1,F=document.createElement("div");F.dir="ltr",s(N,p(y,"sans-serif")),s(A,p(y,"serif")),s(k,p(y,"monospace")),F.appendChild(N.g),F.appendChild(A.g),F.appendChild(k.g),y.context.document.body.appendChild(F),$=N.g.offsetWidth,U=A.g.offsetWidth,D=k.g.offsetWidth,G(),o(N,function(Z){V=Z,P()}),s(N,p(y,'"'+y.family+'",sans-serif')),o(A,function(Z){K=Z,P()}),s(A,p(y,'"'+y.family+'",serif')),o(k,function(Z){H=Z,P()}),s(k,p(y,'"'+y.family+'",monospace'))})})},r.exports=a})()})(db);var lR=db.exports;const cR=Vs(lR),fb={inter:{fontFamily:"InterVariable",fontSize:16,lineHeight:20,fill:16777215}},pb={resolution:4,chars:fi.ASCII},mb="sans-serif",gb={inter:pR(fb.inter)};let Nd=!1;async function uR(){const r=Object.values(fb);await Promise.all(r.map(t=>dR(t))),Nd=!0,q.emit("fontsLoaded",gb)}async function dR(r){const{fontFamily:t,...e}=r,i=new cR(t);try{await i.load()}catch(s){console.error(s),console.warn(`fonts: font ${t} failed to load, falling back to ${mb}`),fi.from(t,{fontFamily:mb,...e},pb);return}fi.from(t,r,pb)}function fR(){Nd=!1}async function yb(){return Nd?gb:await Ie("fontsLoaded")}function pR(r){const{fontFamily:t,...e}=r,i={fontName:t,...e};return s=>new nE(s,i)}async function zh({cullAtZoomThreshold:r=!0}={}){const{inter:t}=await yb(),e=await hb(),i=t("");r&&e.add(i);async function s(n){return i.text=n,await i}return{element:i,render:s}}const mR=["result","markdown","table","unknown"],bb={markdown:"ArtifactMarkdown",table:"ArtifactTable",result:"ArtifactResult",unknown:"Artifact"},Dd=["flow-run","task-run"];function gR(r){return Dd.includes(r)}function jh(r){return Dd.includes(r.kind)}function xb(r){return r.kind==="artifact"}function _b(r){return r.kind==="artifacts"}function vb(r){return r.kind==="state"}function wb(r){return r.kind==="event"}function Tb(r){return r.kind==="events"}const yR=["COMPLETED","RUNNING","SCHEDULED","PENDING","FAILED","CANCELLED","CANCELLING","CRASHED","PAUSED"];async function Sb({cullAtZoomThreshold:r}){const t=await Pt(),e=new Ct,i=new Ct,{element:s,render:n}=await hR({cullAtZoomThreshold:r}),{element:o,render:a}=await zh({cullAtZoomThreshold:r}),{element:h,render:l}=await sR();let c=!1,u=null,d=null;i.addChild(s),i.addChild(o),e.addChild(h),e.addChild(i);async function f(y){if(y){const{selected:x,name:b,type:v}=y;c=x??c,u=b??u,d=v??d}return await Promise.all([p(),m()]),await g(),e}async function p(){if(!d)return s;const y=bb[d],{artifactIconSize:x,artifactIconColor:b,artifactPaddingLeft:v,artifactPaddingY:w}=t.styles,S=await n(y);return S.position={x:v,y:w},S.width=x,S.height=x,S.tint=b,S}async function m(){if(!u)return o.visible=!1,o;await a(u);const{artifactPaddingLeft:y,artifactPaddingY:x,artifactTextColor:b,artifactIconSize:v,artifactContentGap:w}=t.styles,S=y+v+w,C=x;return o.tint=b,o.scale.set(.75),o.position={x:S,y:C},o.visible=!0,o}async function g(){const{artifactPaddingLeft:y,artifactPaddingRight:x,artifactPaddingY:b}=t.styles,v={selected:c,width:i.width+y+x,height:i.height+b*2};return await l(v)}return{element:e,render:f}}let Kt=null,Jh=!1;async function bR(){const r=await te();r.on("click",()=>Wi(null)),r.on("drag-start",()=>{Jh=!0}),r.on("drag-end",()=>{setTimeout(()=>{Jh=!1})})}function xR(){Kt=null,Jh=!1}function Wi(r){if(!Jh&&!(!r&&!Kt||r&&mr(r))){if(Kt=r,r===null){q.emit("itemSelected",null);return}q.emit("itemSelected",r)}}function mr(r){if(Kt===null)return!1;const{kind:t}=r;switch(t){case"task-run":return jh(Kt)&&Kt.id===r.id;case"flow-run":return jh(Kt)&&Kt.id===r.id;case"artifact":return xb(Kt)&&Kt.id===r.id;case"artifacts":return _b(Kt)&&Kt.ids.length===r.ids.length&&Kt.ids.every(i=>r.ids.includes(i));case"state":return vb(Kt)&&Kt.id===r.id;case"event":return wb(Kt)&&Kt.id===r.id;case"events":return Tb(Kt)&&Kt.ids.length===r.ids.length&&Kt.ids.every(i=>r.ids.includes(i));default:const e=t;throw new Error(`switch does not have case for value: ${e}`)}}function _R(){return Kt&&jh(Kt)?Kt:null}async function kd(r,{cullAtZoomThreshold:t=!0,enableLocalClickHandling:e=!1}={}){const{element:i,render:s}=await Sb({cullAtZoomThreshold:t});let n=!1;i.eventMode="static",i.cursor="pointer",e&&i.on("click",c=>{c.stopPropagation(),Wi({kind:"artifact",id:r.id})}),q.on("itemSelected",()=>{const c=mr({kind:"artifact",id:r.id});c!==n&&(n=c,o())});async function o(){await s({selected:n,name:r.key,type:r.type})}function a(){return n}function h(){return r.created}function l(){return r.id}return{element:i,render:o,getSelected:a,getDate:h,getId:l}}async function Eb(r,t,e){const i=await gr(),s=await Pt();let n,o=null;async function a(){try{o=await s.fetchEvents(r,z.toValue(e)),t(o)}catch(l){console.error(l)}i.end_time||(n=setTimeout(()=>a(),zg(i)))}function h(){clearInterval(n)}return{start:a,stop:h}}async function vR(){const r=await Pt(),t=await hb(),e=new Ct,{element:i,render:s}=await cb(),{element:n,render:o}=await Gd(),{element:a,render:h}=await Fd();t.add(e);let l=!1;e.eventMode="static",e.cursor="pointer",e.addChild(n),e.addChild(i),e.addChild(a),e.on("mouseover",u),e.on("mouseout",d);async function c({inside:f,isOpen:p}){l=f;const m={size:10,stroke:2,rotate:p?Kh.Up:Kh.Down},g=await s(m),y={width:r.styles.nodeToggleSize,height:r.styles.nodeToggleSize,background:r.styles.nodeToggleBgColor,radius:r.styles.nodeToggleBorderRadius},x=await o(y);x.alpha=f?0:.5;const b=await h({width:y.width,height:y.height,radius:y.radius,stroke:1,color:r.styles.nodeToggleBorderColor});b.alpha=f?0:1;const v={y:x.height/2,x:x.width/2},w=m.size/4;return g.x=v.x,g.y=p?v.y+w:v.y-w,e}function u(){n.alpha=l?.5:1}function d(){n.alpha=l?0:.5}return{element:e,render:c}}async function Cb(){const r=await Pt(),t=await ee(),e=new Ct,{element:i,render:s}=await Gd(),{element:n,render:o}=await Yh();e.addChild(i),e.addChild(n);async function a(l){const{background:c="#fff"}=r.styles.node(l),{nodeHeight:u,nodeRadius:d}=r.styles,f=mr({kind:l.kind,id:l.id}),p=h(l,d),m=l.state_type!=="RUNNING"||t.isDependency();return await Promise.all([s({width:p,height:u,radius:d,background:c,capRight:m}),o({selected:f,width:p,height:u})]),i}function h(l,c){const u=Bd();if(et.isTemporal()||et.isLeftAligned()){const d=l.start_time,f=l.end_time??new Date,m=Pf(f,d)/aa*u;return Math.max(m,c*2)}return u}return{element:e,render:a}}var Ib="Expected a function",Ab=NaN,wR="[object Symbol]",TR=/^\s+|\s+$/g,SR=/^[-+]0x[0-9a-f]+$/i,ER=/^0b[01]+$/i,CR=/^0o[0-7]+$/i,IR=parseInt,AR=typeof ve=="object"&&ve&&ve.Object===Object&&ve,RR=typeof self=="object"&&self&&self.Object===Object&&self,MR=AR||RR||Function("return this")(),LR=Object.prototype,PR=LR.toString,GR=Math.max,FR=Math.min,Od=function(){return MR.Date.now()};function NR(r,t,e){var i,s,n,o,a,h,l=0,c=!1,u=!1,d=!0;if(typeof r!="function")throw new TypeError(Ib);t=Rb(t)||0,$h(e)&&(c=!!e.leading,u="maxWait"in e,n=u?GR(Rb(e.maxWait)||0,t):n,d="trailing"in e?!!e.trailing:d);function f(S){var C=i,I=s;return i=s=void 0,l=S,o=r.apply(I,C),o}function p(S){return l=S,a=setTimeout(y,t),c?f(S):o}function m(S){var C=S-h,I=S-l,R=t-C;return u?FR(R,n-I):R}function g(S){var C=S-h,I=S-l;return h===void 0||C>=t||C<0||u&&I>=n}function y(){var S=Od();if(g(S))return x(S);a=setTimeout(y,m(S))}function x(S){return a=void 0,d&&i?f(S):(i=s=void 0,o)}function b(){a!==void 0&&clearTimeout(a),l=0,i=h=s=a=void 0}function v(){return a===void 0?o:x(Od())}function w(){var S=Od(),C=g(S);if(i=arguments,s=this,h=S,C){if(a===void 0)return p(h);if(u)return a=setTimeout(y,t),f(h)}return a===void 0&&(a=setTimeout(y,t)),o}return w.cancel=b,w.flush=v,w}function DR(r,t,e){var i=!0,s=!0;if(typeof r!="function")throw new TypeError(Ib);return $h(e)&&(i="leading"in e?!!e.leading:i,s="trailing"in e?!!e.trailing:s),NR(r,t,{leading:i,maxWait:t,trailing:s})}function $h(r){var t=typeof r;return!!r&&(t=="object"||t=="function")}function kR(r){return!!r&&typeof r=="object"}function OR(r){return typeof r=="symbol"||kR(r)&&PR.call(r)==wR}function Rb(r){if(typeof r=="number")return r;if(OR(r))return Ab;if($h(r)){var t=typeof r.valueOf=="function"?r.valueOf():r;r=$h(t)?t+"":t}if(typeof r!="string")return r===0?r:+r;r=r.replace(TR,"");var e=ER.test(r);return e||CR.test(r)?IR(r.slice(2),e?2:8):SR.test(r)?Ab:+r}var BR=DR;const Mb=Vs(BR);async function Lb(){const{element:r,render:t}=await Sb({cullAtZoomThreshold:!1});let e=null,i=[],s=!1;r.eventMode="static",r.cursor="pointer",q.on("itemSelected",()=>{const l=mr({kind:"artifacts",ids:i});l!==s&&e&&(s=l,n({ids:i,date:e}))});async function n(l){if(!l){e=null,i=[],r.visible=!1;return}const{ids:c,date:u}=l;e=u,i=c,await t({selected:s,type:"unknown",name:c.length.toString()}),r.visible=!0}function o(){return s}function a(){return e}function h(){return i}return{element:r,render:n,getSelected:o,getDate:a,getIds:h,isCluster:!0}}async function UR(){const r=await Qt(),t=await gr(),e=await ee(),{element:i,render:s,update:n}=await Hb({isRoot:!0});i.zIndex=4;function o(a){if(et.isTemporal()&&!e.disableArtifacts){r.stage.addChild(i),s(a==null?void 0:a.artifacts);return}r.stage.removeChild(i)}t.artifacts&&o(t),q.on("viewportMoved",()=>n()),q.on("runDataCreated",a=>o(a)),q.on("runDataUpdated",a=>o(a)),q.on("configUpdated",()=>o()),q.on("layoutSettingsUpdated",()=>o())}function vL(){}async function WR({radius:r}){const t=await Qt(),e=new un;return e.beginFill("#fff"),e.drawCircle(0,0,r),e.endFill(),t.renderer.generateTexture(e,{resolution:10})}async function XR(r){return await ko(WR,[r])}async function Pb(r){const t=await XR(r);return new $t(t)}async function Gb(r){const t=new Ct,e=await Pt(),i=await pr(),s=await Pb({radius:e.styles.eventRadiusDefault}),{element:n,render:o}=await Yh();let a=!1;t.addChild(i),t.addChild(s),t.addChild(n),t.eventMode="static",t.cursor="pointer",t.on("mouseenter",()=>{a||s.scale.set(1.5)}),t.on("mouseleave",()=>{a||s.scale.set(1)}),q.on("itemSelected",()=>{const u=mr({kind:"event",id:r.id,occurred:r.occurred});u!==a&&(a=u,s.scale.set(u?1.5:1),h())});function h(){const{eventColor:u,eventTargetSize:d,eventSelectedBorderInset:f}=e.styles;i.alpha=0,i.width=d,i.height=d,s.tint=u,s.anchor.set(.5),s.position.set(d/2,d/2),n.position.set(f,f),o({selected:a,width:d-f*2,height:d-f*2})}function l(){return r.id}function c(){return r.occurred}return{element:t,render:h,getId:l,getDate:c}}async function Fb(){const r=new Ct,t=await Pt(),e=await pr(),i=await Pb({radius:t.styles.eventClusterRadiusDefault}),{element:s,render:n}=await Yh(),{element:o,render:a}=await zh({cullAtZoomThreshold:!1});let h=null,l=[],c=!1;r.addChild(e),r.addChild(i),r.addChild(o),r.addChild(s),r.eventMode="static",r.cursor="pointer",r.on("mouseenter",()=>{c||i.scale.set(1.5)}),r.on("mouseleave",()=>{c||i.scale.set(1)}),q.on("itemSelected",()=>{const x=mr({kind:"events",occurred:h,ids:l});x!==c&&(c=x,i.scale.set(x?1.5:1),h&&u({ids:l,date:h}))});async function u(x){if(!x){h=null,l=[],r.visible=!1;return}const{ids:b,date:v}=x;h=v,l=b,d(),f(),m(),await p(b.length.toString()),r.visible=!0}function d(){const{eventTargetSize:x}=t.styles;e.alpha=0,e.width=x,e.height=x}function f(){const{eventClusterColor:x,eventTargetSize:b}=t.styles;i.tint=x,i.anchor.set(.5),i.position.set(b/2,b/2)}async function p(x){if(l.length<2)return;const{eventTargetSize:b}=t.styles,v=-1;o.scale.set(.6),o.anchor.set(.5),o.position.set(b/2,b/2+v),await a(x)}function m(){const{eventSelectedBorderInset:x,eventTargetSize:b}=t.styles;s.position.set(x,x),n({selected:c,width:b-x*2,height:b-x*2})}function g(){return l}function y(){return h}return{element:r,render:u,getIds:g,getDate:y}}function Vr(r){return"getIds"in r}async function Nb({items:r,createCluster:t}){const e=[...r.values()].sort((o,a)=>o.element.x-a.element.x);async function i(o){let a,h=null,l=null;for(let c=o??0;c<e.length;c++){const u=e[c],d=u.element.x;if(u.element.visible=!0,h!==null&&a&&d<a){l=c;break}h=c,a=d+u.element.width}if(l!==null&&h!==null){const c=e[h],u=e[l];c.element.visible=!1,u.element.visible=!1;const d=await s(c,u);d&&(e.splice(h,1,d),e.splice(l,1)),i(h)}}async function s(o,a){const h=o.getDate(),l=a.getDate(),c=Vr(o)?o.getIds():[o.getId()],u=Vr(a)?a.getIds():[a.getId()];if(!h||!l)return console.error("flowRunArtifacts: visible item is missing date"),null;let d;Vr(o)?d=o:Vr(a)?d=a:d=await t();const f=[...c,...u],p=n(f);return await d.render({ids:f,date:p}),d}function n(o){const a=o.reduce((c,u)=>{const d=r.get(u),f=d==null?void 0:d.getDate();return f&&c.push(f.getTime()),c},[]),h=Math.min(...a),l=Math.max(...a);return new Date((h+l)/2)}await i()}async function Db(r){const t=await Qt(),e=await te(),i=await Pt(),s=await ee();let n=await ei();const o=await h();o.element.on("click",c=>{c.stopPropagation();const{element:u}=o,d={x:u.position.x,y:u.position.y,width:u.width,height:u.height},f=Vr(o)?{kind:"events",ids:o.getIds(),occurred:o.getDate(),position:d}:{kind:"event",id:o.getId(),occurred:o.getDate(),position:d};Wi(f)}),q.on("scaleUpdated",c=>{n=c,l()}),q.on("viewportMoved",()=>l());async function a(c){await o.render(c),l()}async function h(){return r.type==="event"?await Gb(r.event):await Fb()}function l(){const c=o.getDate();if(!c||s.disableEvents||!et.isTemporal())return;const{element:u}=o,f=n(c)*e.scale._x+e.worldTransform.tx-u.width/2,p=t.screen.height-u.height-i.styles.eventBottomMargin;u.position.set(f,p)}return{...o,render:a}}async function kb(r){const t=await te(),e=await ee();let i=await ei();const s=await o();s.element.on("click",h=>{h.stopPropagation();const{element:l}=s,c=l.getGlobalPosition(),u={x:c.x,y:c.y,width:l.width*t.scale.x,height:l.height*t.scale.y},d=Vr(s)?{kind:"events",ids:s.getIds(),occurred:s.getDate(),position:u}:{kind:"event",id:s.getId(),occurred:s.getDate(),position:u};Wi(d)}),q.on("scaleUpdated",h=>{i=h,a()});async function n(h){await s.render(h),a()}async function o(){return r.type==="event"?await Gb(r.event):await Fb()}function a(){const h=s.getDate(),{parentStartDate:l}=r;if(!h||e.disableEvents||!et.isTemporal()||!l)return;const{element:c}=s,d=i(h)-i(l)-c.width/2,f=-c.height;c.position.set(d,f)}return{...s,render:n}}async function Ob({isRoot:r,parentStartDate:t}={}){const e=await ee(),i=new Map,s=new Map,n=[];let o=[];const a=new Ct;let h=null;q.on("scaleUpdated",()=>u());async function l(p){if(p&&(h=p),!h)return;const m=[];for(const g of h)m.push(c(g));await Promise.all(m),u()}async function c(p){if(i.has(p.id))return i.get(p.id).render();if(s.has(p.id))return await s.get(p.id);const m=(async()=>{const g=r?await Db({type:"event",event:p}):await kb({type:"event",event:p,parentStartDate:t});i.set(p.id,g),a.addChild(g.element)})();return s.set(p.id,m),await m,s.delete(p.id),i.get(p.id).render()}function u(){e.disableEvents||!et.isTemporal()||d()}const d=Mb(async()=>{o=[...n],await Nb({items:i,createCluster:f});for(const p of o)p.render()},250);async function f(){if(o.length>0)return o.pop();const p=r?await Db({type:"cluster"}):await kb({type:"cluster",parentStartDate:t});return a.addChild(p.element),n.push(p),p}return{element:a,render:l,update:u}}let Bo=null,Ln=null;async function ZR(){const r=await Qt(),t=await Pt(),e=await ee(),{element:i,render:s,update:n}=await Ob({isRoot:!0});i.zIndex=2;async function o(h){if(!et.isTemporal()||e.disableEvents){r.stage.removeChild(i);return}r.stage.addChild(i),await s(h)}const a=await Eb(t.runId,h=>{const l=Ln?"eventDataUpdated":"eventDataCreated";Ln=h,q.emit(l,Ln),o(h)});q.on("configUpdated",()=>o()),q.on("viewportMoved",()=>n()),q.on("layoutSettingsUpdated",()=>o()),Bo=a.stop,a.start()}function VR(){Bo==null||Bo(),Bo=null,Ln=null}async function HR(){return Ln||await Ie("eventDataCreated")}async function KR(r){const t=await Qt(),e=await te(),i=await Pt(),s=await gr();let n=await ei();const o=new Ct,a=await pr(),h=await pr();let l=null,c=!1,u=!1;t.stage.addChild(h),o.addChild(a),a.eventMode="static",a.cursor="pointer",a.on("mouseover",()=>{c=!0,d()}),a.on("mouseleave",()=>{c=!1,d()}),a.on("click",()=>{const b={x:a.position.x,y:a.position.y,width:a.width,height:a.height};Wi({...r,kind:"state",position:b})}),q.on("viewportMoved",()=>d()),q.on("scaleUpdated",b=>{n=b,d()}),q.on("itemSelected",()=>{const b=mr({kind:"state",...r});b!==u&&(u=b,c=!1,d())}),r.type==="RUNNING"&&!s.end_time&&g();function d(b){const{end:v}=b??{};if(v&&(l=v),s.end_time&&y(),!et.isTemporal()){h.visible=!1,o.visible=!1;return}const w=f();p(w),m(w),h.visible=!0,o.visible=!0}function f(){const{background:b="#fff"}=i.styles.state(r),v=Math.max(n(r.timestamp)*e.scale._x+e.worldTransform.tx,0);let w=0;return r.type==="RUNNING"&&!s.end_time?w=n(new Date)*e.scale._x+e.worldTransform.tx-v:l?w=n(l)*e.scale._x+e.worldTransform.tx-v:w=t.screen.width-v,{x:v,width:Math.max(w,0),background:b}}function p({x:b,width:v,background:w}){const{flowStateBarHeight:S,flowStateSelectedBarHeight:C}=i.styles,I=c||u?C:S;a.x=b,a.y=t.screen.height-I,a.width=v,a.height=I,a.tint=w}function m({x:b,width:v,background:w}){if(r.type==="RUNNING"){h.visible=!1;return}const{flowStateBarHeight:S,flowStateAreaAlpha:C}=i.styles;h.x=b,h.y=0,h.width=v,h.height=t.screen.height-S,h.tint=w,h.alpha=C}function g(){t.ticker.add(x)}function y(){t.ticker.remove(x)}function x(){d()}return{element:o,render:d}}function YR(r){return"isNodesFlowRunStateFactory"in r}async function zR(r){const t=await Qt(),e=await te(),i=await Pt(),s=await gr();let n=await ei();const o=new Ct,a=await pr(),h=await pr();let l=null,c=null,u=0,d=0,f=!1,p=!1;o.visible=!1,o.addChild(h),o.addChild(a),a.eventMode="static",a.cursor="pointer",a.on("mouseover",()=>{f=!0,m()}),a.on("mouseleave",()=>{f=!1,m()}),a.on("click",S=>{S.stopPropagation();const C=a.getGlobalPosition(),I={x:C.x,y:C.y,width:a.width*e.scale.x,height:a.height*e.scale.y};Wi({...r,kind:"state",position:I})}),h.eventMode="none",h.cursor="default",q.on("scaleUpdated",S=>{n=S,m()}),q.on("itemSelected",()=>{const S=mr({kind:"state",...r});S!==p&&(p=S,f=!1,m())}),r.type==="RUNNING"&&!s.end_time&&b();function m(S){const{end:C,parentStartDate:I,width:R,height:P}=S??{};if(C&&(l=C),I&&(c=I),R&&(u=R),P&&(d=P),s.end_time&&v(),!et.isTemporal()){o.visible=!1;return}if(!c||u<=0){o.visible=!1;return}const G=g();if(G.width<=0){o.visible=!1;return}y(G),x(G),o.visible=!0}function g(){const{background:S="#fff"}=i.styles.state(r);if(!c)return{x:0,width:0,background:S};const C=n(c);let I=n(r.timestamp)-C;if(I>=u)return{x:u,width:0,background:S};I<0&&(I=0);let R=n(l??new Date)-C;R>u&&(R=u);const P=Math.max(R-I,0);return{x:I,width:P,background:S}}function y({x:S,width:C,background:I}){const{flowStateBarHeight:R,flowStateSelectedBarHeight:P}=i.styles,G=f||p?P:R;a.x=S,a.y=d-G,a.width=C,a.height=G,a.tint=I}function x({x:S,width:C,background:I}){const{flowStateBarHeight:R,flowStateAreaAlpha:P,nodeHeight:G}=i.styles,N=G/2;h.x=S,h.y=N,h.width=C,h.height=d-R-N,h.tint=I,h.alpha=P}function b(){t.ticker.add(w)}function v(){t.ticker.remove(w)}function w(){m()}return{element:o,render:m,isNodesFlowRunStateFactory:!0}}function Bb({isRoot:r}={}){const t=new Ct,e=new Map,i=new Map;let s=null;async function n(a,h){if(a&&(s=a),!s)return;const l=[];for(let c=0;c<s.length;c++)l.push(o(s[c],c,h));await Promise.all(l)}async function o(a,h,l){const c=s&&s.length>=h+1&&s[h+1],u=c?c.timestamp:void 0;let d;if(i.has(a.id)&&await i.get(a.id),e.has(a.id))d=e.get(a.id);else{const f=(async()=>{const p=r?await KR(a):await zR(a);e.set(a.id,p),t.addChild(p.element)})();i.set(a.id,f),await f,i.delete(a.id),d=e.get(a.id)}YR(d)?await d.render({end:u,...l}):await d.render(u?{end:u}:void 0)}return{element:t,render:n}}async function jR(){const r=await Qt(),t=await gr(),{element:e,render:i}=await Bb({isRoot:!0});e.zIndex=3,r.stage.addChild(e);function s(n){i(n==null?void 0:n.states)}t.states&&s(t),q.on("runDataUpdated",n=>s(n)),q.on("configUpdated",()=>s()),q.on("layoutSettingsUpdated",()=>s())}function wL(){}async function JR(){const r=await Qt(),t=await te(),e=await ee(),i=await Pt(),{inter:s}=await yb(),n=new Ct,o=await pr();n.addChild(o);const a=s("");n.addChild(a);let h=await ei(),l,c;q.on("scaleUpdated",m=>{h=m,p()}),q.on("viewportMoved",()=>{e.disableGuides||(p(),n.height!==r.screen.height&&d())});function u(m,g){l=m,c=g,d(),f(m)}function d(){o.width=i.styles.guideLineWidth,o.height=r.screen.height,o.tint=i.styles.guideLineColor}function f(m){a.text=c(m),a.fontSize=i.styles.guideTextSize,a.tint=i.styles.guideTextColor,a.position.set(i.styles.guideTextLeftPadding,i.styles.guideTextTopPadding)}function p(){l!==void 0&&(n.position.x=h(l)*t.scale._x+t.worldTransform.tx)}return{element:n,render:u}}class Ub extends Error{constructor(){super("Layout is not temporal")}}function $R(r){return r.toLocaleTimeString()}function Wb(r){const t=navigator.language;return new Intl.DateTimeFormat(t,{timeStyle:"short"}).format(r)}function QR(r){const t=navigator.language;return new Intl.DateTimeFormat(t,{dateStyle:"short"}).format(r)}function qR(r){return r.getHours()===0&&r.getMinutes()===0?`${Qh.date(r)}
1176
1176
  ${Wb(r)}`:Wb(r)}const Qh={timeBySeconds:$R,timeByMinutesWithDates:qR,date:QR},ne={seconds:"seconds",minutes:"minutes",date:"date"},Uo={day:r=>{const t=new Date(r.getTime());return t.setHours(0,0,0,0),t.getTime()},week:r=>{const t=new Date(r.getTime());return t.setHours(0,0,0,0),t.setDate(r.getDate()-r.getDay()+1),t.getTime()}},At={second:1e3,minute:1e3*60,hour:1e3*60*60,day:1e3*60*60*24,week:1e3*60*60*24*7},Xb=[{ceiling:At.second*4,increment:At.second,labelFormat:ne.seconds},{ceiling:At.second*8,increment:At.second*5,labelFormat:ne.seconds},{ceiling:At.second*13,increment:At.second*10,labelFormat:ne.seconds},{ceiling:At.second*20,increment:At.second*15,labelFormat:ne.seconds},{ceiling:At.second*45,increment:At.second*30,labelFormat:ne.seconds},{ceiling:At.minute*4,increment:At.minute,labelFormat:ne.minutes},{ceiling:At.minute*8,increment:At.minute*5,labelFormat:ne.minutes},{ceiling:At.minute*13,increment:At.minute*10,labelFormat:ne.minutes},{ceiling:At.minute*28,increment:At.minute*15,labelFormat:ne.minutes},{ceiling:At.hour*1.24,increment:At.minute*30,labelFormat:ne.minutes},{ceiling:At.hour*3,increment:At.hour,labelFormat:ne.minutes},{ceiling:At.hour*8,increment:At.hour*2,getAnchor:Uo.day,labelFormat:ne.minutes},{ceiling:At.hour*13,increment:At.hour*6,getAnchor:Uo.day,labelFormat:ne.minutes},{ceiling:At.hour*22,increment:At.hour*12,getAnchor:Uo.day,labelFormat:ne.minutes},{ceiling:At.day*4,increment:At.day,getAnchor:Uo.day,labelFormat:ne.date},{ceiling:At.week*2,increment:At.week,getAnchor:Uo.week,labelFormat:ne.date},{ceiling:1/0,increment:At.week*4,labelFormat:ne.date}],tM=300;async function eM(){const r=await te(),t=await ee(),e=new Ct,i=new Map;let s=await ei();q.on("scaleUpdated",d=>s=d),await o();function n(){if(e.visible=!t.disableGuides,!t.disableGuides)try{const{anchor:d,increment:f,labelFormat:p}=a(),m=u(d,f);c(m,p)}catch(d){if(d instanceof Ub)return;console.error(d)}}async function o(){const d=[];Pd(30,async f=>{const p=JR();d.push(p);const m=await p;e.addChild(m.element),i.set(f,m)}),await Promise.all(d)}function a(){const d=r.left-tM,f=s.invert(d),p=s.invert(d+260/r.scale.x);if(!(f instanceof Date)||!(p instanceof Date))throw new Ub;const m=p.getTime()-f.getTime(),{increment:g,getAnchor:y,labelFormat:x}=h(m);return{anchor:y(f),increment:g,labelFormat:l(x)}}function h(d){const f=Xb.find(p=>p.ceiling>d)??Xb[0];return f.getAnchor||(f.getAnchor=p=>Math.floor(p.getTime()/f.increment)*f.increment),f}function l(d){switch(d){case ne.minutes:return Qh.timeByMinutesWithDates;case ne.date:return Qh.date;default:return Qh.timeBySeconds}}function c(d,f){const p=new Map(i.entries()),m=Array.from(p.keys()).filter(g=>!d.includes(g));i.clear();for(const g of d){if(p.has(g)){const x=p.get(g);i.set(g,x),x.render(new Date(g),f);continue}const y=p.get(m.pop()??-1);if(y===void 0){console.warn("Guides: No unused guides available to render.");continue}y.render(new Date(g),f),i.set(g,y)}}function u(d,f){return Pd(30,p=>d+f*p)}return{element:e,render:n}}async function iM(){const r=await Qt(),{element:t,render:e}=await eM();r.stage.addChild(t),e(),q.on("viewportDateRangeUpdated",()=>e()),q.on("layoutSettingsUpdated",()=>e()),q.on("configUpdated",()=>e())}function TL(){}const rM=80;async function sM(){const r=await Qt(),t=await te(),e=await ee(),i=await Pt(),s=await pr();let n=await ei();q.on("scaleUpdated",h=>n=h);function o(){if(!e.isTemporal()){s.visible=!1;return}s.width=i.styles.playheadWidth,s.height=r.stage.height,s.tint=i.styles.playheadColor,s.position.x=n(new Date)*t.scale.x+t.worldTransform.tx,a()}function a(){if(t.moving||!(s.position.x>0&&s.position.x<r.screen.width)||!(s.position.x>r.screen.width-rM))return;const c=t.left;t.zoomPercent(-.1,!0),t.left=c}return{element:s,render:o}}async function nM(){const r=await Qt(),t=await gr(),{element:e,render:i}=await sM();t.end_time||(r.stage.addChild(e),r.ticker.add(i)),q.on("runDataUpdated",({end_time:s})=>{s&&(r.ticker.remove(i),r.stage.removeChild(e))})}function SL(){}function oM({stage:r,props:t}){uE(),N2(),G2(),iM(),mM(),UR(),ZR(),jR(),nM(),yE(),uR(),lE(r),vE(t),Z2(),vM(),bR()}function aM(){q.clear();try{dE(),D2(),F2(),cE(),gM(),VR(),wE(),bE(),fR(),V2(),wM(),xR(),z2()}catch(r){console.error(r)}}async function Zb(r){const t=await Qt(),e=await te(),i=await Pt(),s=await ee(),n=await HR();let o=await ei(),a=n&&n.length>0;const h=await c();h.element.on("click",d=>{d.stopPropagation();const{element:f}=h,p=f.getGlobalPosition(),m={x:p.x,y:p.y,width:f.width,height:f.height},g=Vr(h)?{kind:"artifacts",ids:h.getIds(),position:m}:{kind:"artifact",id:h.getId()};Wi(g)}),q.on("scaleUpdated",d=>{o=d,u()}),q.on("viewportMoved",()=>u()),q.on("eventDataCreated",d=>{a=d.length>0,u()}),q.on("eventDataUpdated",d=>{a=d.length>0,u()});async function l(d){await h.render(d),u()}async function c(){return r.type==="artifact"?await kd(r.artifact,{cullAtZoomThreshold:!1}):await Lb()}function u(){const d=h.getDate();if(!d||!et.isTemporal()||s.disableArtifacts)return;const f=h.getSelected(),{element:p}=h,{eventTargetSize:m,flowStateSelectedBarHeight:g}=i.styles;let y=0;if(f){const{selectedBorderOffset:S,selectedBorderWidth:C}=i.styles;y=S+C*2}const b=o(d)*e.scale._x+e.worldTransform.tx-(p.width-y)/2,v=a&&!s.disableEvents?m:g,w=t.screen.height-(p.height-y)-v;p.position.set(b,w)}return{...h,render:l}}async function Vb(r){const t=await te(),e=await Pt(),i=await ee();let s=await ei();const n=await a();n.element.on("click",l=>{console.log("artifact click"),l.stopPropagation();const{element:c}=n,u=c.getGlobalPosition(),d={x:u.x,y:u.y,width:c.width*t.scale.x,height:c.height*t.scale.y},f=Vr(n)?{kind:"artifacts",ids:n.getIds(),position:d}:{kind:"artifact",id:n.getId()};Wi(f)}),q.on("scaleUpdated",l=>{s=l,h()});async function o(l){await n.render(l),h()}async function a(){return r.type==="artifact"?await kd(r.artifact):await Lb()}function h(){const l=n.getDate(),{parentStartDate:c}=r;if(!l||!et.isTemporal()||i.disableArtifacts||!c)return;const u=n.getSelected(),{element:d}=n;let f=0;if(u){const{selectedBorderOffset:y,selectedBorderWidth:x}=e.styles;f=y+x*2}const m=s(l)-s(c)-(d.width-f)/2,g=-(d.height-f);d.position.set(m,g)}return{...n,render:o}}async function Hb({isRoot:r,parentStartDate:t}={}){const e=await ee(),i=new Map,s=new Map,n=[];let o=[];const a=new Ct;let h=null;async function l(p){if(p&&(h=p),!h)return;const m=[];for(const g of h)m.push(c(g));await Promise.all(m),u()}async function c(p){if(i.has(p.id))return i.get(p.id).render();s.has(p.id)&&await s.get(p.id);const m=(async()=>{const g=r?await Zb({type:"artifact",artifact:p}):await Vb({type:"artifact",artifact:p,parentStartDate:t});i.set(p.id,g),a.addChild(g.element)})();return s.set(p.id,m),await m,s.delete(p.id),i.get(p.id).render()}function u(){if(!(e.disableArtifacts||!et.isTemporal())){if(!et.isTemporal()){a.visible=!1;return}a.visible=!0,a.position.x=0,d()}}const d=Mb(async()=>{o=[...n],await Nb({items:i,createCluster:f});for(const p of o)p.render()},250);async function f(){if(o.length>0)return o.pop();const p=r?await Zb({type:"cluster"}):await Vb({type:"cluster",parentStartDate:t});return a.addChild(p.element),n.push(p),p}return{element:a,render:l,update:u}}class Kb extends Ct{updateTransform(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(let t=0,e=this.children.length;t<e;++t)this.children[t].updateTransform()}calculateBounds(){this._bounds.clear(),this._calculateBounds();for(const t of this.children)if(t.calculateBounds(),t._mask){const e=t._mask.isMaskData?t._mask.maskObject:t._mask;e?(e.calculateBounds(),this._bounds.addBoundsMask(t._bounds,e._bounds)):this._bounds.addBounds(t._bounds)}else t.filterArea?this._bounds.addBoundsArea(t._bounds,t.filterArea):this._bounds.addBounds(t._bounds);this._bounds.updateID=this._boundsID}}async function hM(r){const t=new Kb,e=await Pt(),i=await ee(),{element:s,render:n}=await Cb(),{element:o,render:a}=await zh(),{element:h,render:l}=await vR(),{element:c,render:u}=await Fd(),{element:d,render:f,getSize:p,stopWorker:m}=await Jb(),{element:g,render:y}=await Bb(),{element:x,render:b,update:v}=await Ob({parentStartDate:r.start_time}),{element:w,render:S,update:C}=await Hb({parentStartDate:r.start_time});let I=!1,R=!1,P=r,G=!1;t.sortableChildren=!0,c.zIndex=0,s.zIndex=4,o.zIndex=5,h.zIndex=5,d.zIndex=2,x.zIndex=1,g.zIndex=2,w.zIndex=3,c.eventMode="none",c.cursor="default";const{start:N,stop:A}=await Yg(P.id,B=>{R=!!B.artifacts&&B.artifacts.length>0,f(B),D(B.states),Z(B.artifacts),U()});function k(){return{since:P.start_time,until:P.end_time??new Date}}const{start:V,stop:K}=await Eb(P.id,B=>{I=B.length>0,F(B)},k);t.addChild(s),t.addChild(o),t.addChild(h),h.on("click",B=>{B.stopPropagation(),$()}),d.position={x:0,y:e.styles.nodeHeight+e.styles.nodesPadding},d.on("rendered",()=>{Vh(),Mt()});async function H(B){return P=B,await n(B),await ot(),await Et(),G&&(await D(),await F(),await Z(),await U()),t}async function $(){G?await ft():await tt()}async function U(){const{background:B="#fff"}=e.styles.node(P),{width:j,height:J}=p(),{height:O}=bt(),{nodeBorderRadius:gt}=e.styles,ut=2;c.position={x:-ut,y:-ut};const It=et.isTemporal()?O+ut*2:J+ut*2;await u({width:j+ut*2,height:It,stroke:ut,radius:[gt,gt,0,0],color:B})}async function D(B){const{height:j}=bt(),{width:J}=s;await y(B??void 0,{parentStartDate:P.start_time,width:J,height:j})}async function F(B){if(!G||!et.isTemporal()||i.disableEvents){t.removeChild(x);return}t.addChild(x);const{height:j}=bt();if(x.position={x:0,y:j-e.styles.eventBottomMargin},B){await b(B);return}await v()}async function Z(B){if(!G||!et.isTemporal()||i.disableArtifacts){t.removeChild(w);return}t.addChild(w);const{eventTargetSize:j,flowStateSelectedBarHeight:J}=e.styles,{height:O}=bt(),gt=O-(I&&!i.disableEvents?j:J);if(w.position={x:0,y:gt},B){await S(B);return}await C()}async function tt(){G=!0,t.addChild(g),t.addChild(d),t.addChild(c),await Promise.all([N(),V(),H(P)]),Mt()}async function ft(){G=!1,t.removeChild(g),t.removeChild(d),t.removeChild(c),t.removeChild(x),t.removeChild(w),m(),await Promise.all([A(),K(),H(P)]),Mt()}async function ot(){const B=e.styles.nodeToggleSize,j=e.styles.nodeHeight-B,J=s.width>B,O=await l({inside:J,isOpen:G});return O.x=J?j/2:s.width+e.styles.nodePadding,O.y=j/2,O}async function Et(){const B=await a(P.label),j=e.styles.colorMode==="dark"?e.styles.textDefault:e.styles.textInverse,J=e.styles.nodePadding,O=h.x+h.width+J,gt=s.width+J,ut=s.width>O+B.width+J,It=e.styles.nodeHeight/2-B.height/2,Dt=ut?O:Math.max(gt,O);return B.position={x:Dt,y:It},B.tint=ut?j:e.styles.textDefault,B}function Mt(){G&&(D(),F(),Z(),U());const B=bt();t.emit("resized",B)}function bt(){const B=p(),{nodeHeight:j,nodesPadding:J,eventTargetSize:O,eventBottomMargin:gt,artifactPaddingY:ut,artifactIconSize:It}=e.styles,Ee=R&&et.isTemporal()&&!i.disableArtifacts?It+ut*2:0,Xo=I&&et.isTemporal()&&!i.disableEvents?O+gt:0,Kr=G?B.height+Ee+Xo+J*2:0,Fs=G?B.width:0;return{height:j+Kr,width:Math.max(Fs,t.width)}}return{kind:"flow-run",element:t,bar:s,render:H}}async function lM(){const r=await Pt(),t=new Kb,{element:e,render:i}=await zh(),{element:s,render:n}=await Cb();t.addChild(s),t.addChild(e);async function o(h){return await Promise.all([n(h),i(h.label)]),a(),t}function a(){const h=r.styles.colorMode==="dark"?r.styles.textDefault:r.styles.textInverse,l=r.styles.nodePadding,c=s.width>l+e.width+l,u=c?l:s.width+l,d=r.styles.nodeHeight/2-e.height/2;e.position={x:u,y:d},e.tint=c?h:r.styles.textDefault}return{kind:"task-run",element:t,render:o,bar:s}}async function cM(r){const t=await Pt(),e=await Qt(),i=await ab(),s=await ee();let n=null;const o=new Map,{animate:a}=await lb(),{element:h,render:l,bar:c}=await C(r);let u=r,d=null,f=!1,p=!1;i.add(h),h.eventMode="static",h.cursor="pointer",h.name=rx,h.on("click",P=>{P.stopPropagation(),Wi({kind:u.kind,id:u.id})}),u.end_time||v(),q.on("itemSelected",()=>{const P=mr({kind:u.kind,id:u.id});P!==f&&(f=P,l(u))});async function m(P){u=P;const G=I(P);return G===d||(d=G,await Promise.all([l(P),g(P.artifacts)]),P.end_time&&w()),h}async function g(P){if(!P||(x(),s.disableArtifacts||!et.isTemporal()))return;const G=[];for(const N of P)G.push(y(N));await Promise.all(G),b()}async function y(P){if(o.has(P.id))return o.get(P.id).render();const G=await kd(P,{enableLocalClickHandling:!0});return o.set(P.id,G),n.addChild(G.element),G.render()}function x(){if(et.isTemporal()&&!s.disableArtifacts){n||(n=new Ct),h.addChild(n);return}n&&h.removeChild(n)}function b(){if(!n)return;const{artifactsGap:P,artifactsNodeOverlap:G}=t.styles;let N=0;for(const A of o.values())A.element.position.x=N,N+=A.element.width+P;n.position.y=-n.height+G,n.width<c.width&&(n.position.x=c.width-n.width)}function v(){e.ticker.add(S)}function w(){e.ticker.remove(S)}function S(){m(u)}async function C(P){const{kind:G}=P;switch(G){case"task-run":return await lM();case"flow-run":return await hM(P);default:const N=G;throw new Error(`switch does not have case for value: ${N}`)}}function I(P){var k;const G=P.end_time??new Date,N=((k=P.artifacts)==null?void 0:k.length)??0;return[P.state_type,G.getTime(),N,et.horizontal,et.horizontalScaleMultiplier,t.styles.colorMode,N>0&&s.disableArtifacts].join("-")}function R({x:P,y:G}){a(h,{x:P,y:G},!p),p=!0}return{element:h,render:m,bar:c,setPosition:R}}function Yb({gap:r=0,minimum:t=0}={}){const e=new Map;function i(c){const u=e.get(c)??[];return Math.max(...u.values(),z.toValue(t))+z.toValue(r)}function s(c){let u=0;for(let d=0;d<c;d++)u+=i(d);return u}function n(c){return s(c+1)-z.toValue(r)}function o({axis:c,nodeId:u,offset:d}){const f=e.get(c)??new Map;f.set(u,d),e.set(c,f)}function a({axis:c,nodeId:u}){let d,f;for(const[p,m]of e.entries())if(m.has(u)){d=p,f=m.get(u);break}d===c||d===void 0||f===void 0||(h({axis:d,nodeId:u}),o({axis:c,nodeId:u,offset:f}))}function h({axis:c,nodeId:u}){var d;(d=e.get(c))==null||d.delete(u)}function l(){e.clear()}return{getOffset:i,getTotalOffset:s,getTotalValue:n,setOffset:o,updateNodeAxis:a,removeOffset:h,clear:l}}function uM(r){throw new Error(`switch does not have case for value: ${r}`)}const zb="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2Z1bmN0aW9uIEtlKG4pe3Rocm93IG5ldyBFcnJvcihgc3dpdGNoIGRvZXMgbm90IGhhdmUgY2FzZSBmb3IgdmFsdWU6ICR7bn1gKX1mdW5jdGlvbiBDbihuLGUpe3JldHVybiBuPT1udWxsfHxlPT1udWxsP05hTjpuPGU/LTE6bj5lPzE6bj49ZT8wOk5hTn1mdW5jdGlvbiBudChuLGUpe3JldHVybiBuPT1udWxsfHxlPT1udWxsP05hTjplPG4/LTE6ZT5uPzE6ZT49bj8wOk5hTn1mdW5jdGlvbiBSbihuKXtsZXQgZSx0LHI7bi5sZW5ndGghPT0yPyhlPUNuLHQ9KHUsbCk9PkNuKG4odSksbCkscj0odSxsKT0+bih1KS1sKTooZT1uPT09Q258fG49PT1udD9uOmV0LHQ9bixyPW4pO2Z1bmN0aW9uIG8odSxsLGY9MCxnPXUubGVuZ3RoKXtpZihmPGcpe2lmKGUobCxsKSE9PTApcmV0dXJuIGc7ZG97Y29uc3QgbT1mK2c+Pj4xO3QodVttXSxsKTwwP2Y9bSsxOmc9bX13aGlsZShmPGcpfXJldHVybiBmfWZ1bmN0aW9uIGkodSxsLGY9MCxnPXUubGVuZ3RoKXtpZihmPGcpe2lmKGUobCxsKSE9PTApcmV0dXJuIGc7ZG97Y29uc3QgbT1mK2c+Pj4xO3QodVttXSxsKTw9MD9mPW0rMTpnPW19d2hpbGUoZjxnKX1yZXR1cm4gZn1mdW5jdGlvbiBhKHUsbCxmPTAsZz11Lmxlbmd0aCl7Y29uc3QgbT1vKHUsbCxm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B0KWUuc2V0KG8uaWQscisrKTtyZXR1cm4gZX1vbm1lc3NhZ2U9RG87ZnVuY3Rpb24gRG8oe2RhdGE6bn0pe2NvbnN0e3R5cGU6ZX09bjtzd2l0Y2goZSl7Y2FzZSJsYXlvdXQiOlNvKG4pO3JldHVybjtkZWZhdWx0OktlKGUpfX1mdW5jdGlvbiBrbyhuKXtwb3N0TWVzc2FnZShuKX1hc3luYyBmdW5jdGlvbiBTbyhuKXtjb25zdHtkYXRhOmV9PW4sdD13byhuKSxyPWF3YWl0IENvKG4sdCksbz1uZXcgTWFwO2xldCBpPTAsYT0wO2Zvcihjb25zdFt1LGxdb2YgZS5ub2Rlcyl7Y29uc3QgZj10LmdldCh1KSxnPXIuZ2V0KHUpO2lmKGY9PT12b2lkIDApe2NvbnNvbGUud2FybihgTm9kZUlkIG5vdCBmb3VuZCBpbiBob3Jpem9udGFsIGxheW91dDogU2tpcHBpbmcgJHtsLmxhYmVsfWApO2NvbnRpbnVlfWlmKGc9PT12b2lkIDApe2NvbnNvbGUud2FybihgTm9kZUlkIG5vdCBmb3VuZCBpbiB2ZXJ0aWNhbCBsYXlvdXQ6IFNraXBwaW5nICR7bC5sYWJlbH1gKTtjb250aW51ZX1pPU1hdGgubWF4KGksZyksYT1NYXRoLm1heChhLGYuY29sdW1uKSxvLnNldCh1LHsuLi5mLHk6Zyxyb3c6Z30pfWtvKHt0eXBlOiJsYXlvdXQiLGxheW91dDp7bWF4Um93OmksbWF4Q29sdW1uOmEscG9zaXRpb25zOm99fSl9fSkoKTsKLy8jIHNvdXJjZU1hcHBpbmdVUkw9cnVuR3JhcGgud29ya2VyLXNkX0hraDUwLmpzLm1hcAo=",dM=r=>Uint8Array.from(atob(r),t=>t.charCodeAt(0)),jb=typeof window<"u"&&window.Blob&&new Blob([dM(zb)],{type:"text/javascript;charset=utf-8"});function fM(r){let t;try{if(t=jb&&(window.URL||window.webkitURL).createObjectURL(jb),!t)throw"";const e=new Worker(t,{name:r==null?void 0:r.name});return e.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(t)}),e}catch{return new Worker("data:text/javascript;base64,"+zb,{name:r==null?void 0:r.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}function pM(r){const t=new fM;return t.onmessage=r,t}async function Jb(){const r=new Map,t=new Map,e=new Ct,i=new Ct,s=await Pt();let n=null;const o=Yb({gap:()=>s.styles.rowGap,minimum:()=>s.styles.nodeHeight}),a=Yb({gap:()=>s.styles.columnGap,minimum:()=>Bd()});let h=null,l=null;e.name=Lf,q.on("layoutUpdated",()=>{o.clear(),a.clear()}),q.on("layoutSettingsUpdated",()=>{l&&e.parent&&c(l),A()}),q.on("itemSelected",()=>{A()});async function c(U){u(),l=U,h=null,await Promise.all([f(U),m(U)]),y(U)}function u(){n||(n=pM(G))}function d(){n&&(n.terminate(),n=null)}async function f(U){const D=[];for(const F of U.nodes.values())D.push(p(F));await Promise.all(D)}async function p(U){const{render:D}=await v(U);return await D(U)}async function m(U){if((await ee()).disableEdges){e.removeChild(i);return}e.addChildAt(i,0);const F=[];for(const[Z,{children:tt}]of U.nodes)for(const{id:ft}of tt)F.push(g(Z,ft));await Promise.all(F)}async function g(U,D){const F=`${U}_${D}`;if(t.has(F))return;const Z=await q2();t.has(F)||(t.set(F,Z),i.addChild(Z.element))}function y(U){if(!n)throw new Error("Layout worker not initialized");const D=new Map;for(const[F,{element:Z}]of r)D.set(F,Z.width);n.postMessage({type:"layout",data:U,widths:D,horizontalSettings:Ad(U.start_time),verticalSettings:P2()})}function x(){if(h)for(const[U,D]of t){const[F,Z]=U.split("_"),tt=h.positions.get(F),ft=h.positions.get(Z),ot=r.get(F);if(!tt||!ft){console.warn(`Could not find edge in layout: Skipping ${U}`);continue}if(!ot){console.warn(`Could not find parent node in nodes: Skipping ${F}`);continue}const Et=ot.bar.width,Mt=S(tt),bt={x:Mt.x+Et,y:Mt.y+s.styles.nodeHeight/2},B=S(ft),j={x:B.x-bt.x,y:B.y-bt.y+s.styles.nodeHeight/2};D.setPosition(bt,j)}}function b(){if(h){for(const[U,D]of r){const F=h.positions.get(U);if(!F){console.warn(`Could not find node in layout: Skipping ${U}`);continue}const Z=S(F);D.setPosition(Z),o.updateNodeAxis({nodeId:U,axis:F.y}),a.updateNodeAxis({nodeId:U,axis:F.column})}x(),e.emit("rendered"),e.emit("resized",P())}}async function v(U){const D=r.get(U.id);if(D)return D;const F=await cM(U);return F.element.on("resized",Z=>w(U.id,Z)),r.set(U.id,F),e.addChild(F.element),F}function w(U,D){if(!h)return;const F=r.get(U),Z=h.positions.get(U);!F||!Z||(o.setOffset({nodeId:U,axis:Z.y,offset:D.height}),a.setOffset({nodeId:U,axis:Z.column,offset:D.width}),b())}function S(U){const D=o.getTotalOffset(U.y);return{x:C(U),y:D}}function C(U){return et.isDependency()?a.getTotalOffset(U.column):U.x}function I(){return h?o.getTotalValue(h.maxRow):0}function R(){if(!h||!l)return 0;if(et.isDependency())return a.getTotalValue(h.maxColumn);const U=Ad(l.start_time),D=rb(U),F=D(l.end_time??new Date),Z=D(l.start_time);return F-Z}function P(){return{width:R(),height:I()}}function G({data:U}){const{type:D}=U;switch(D){case"layout":N(U);return;default:uM(D)}}function N(U){h=U.layout,b()}async function A(){const U=await ee(),D=_R();if(U.disableEdges||!D||!(l!=null&&l.nodes.has(D.id))){k([]);return}const F=H(D.id);k(F)}function k(U){V(U),K(U)}function V(U){for(const[D,{element:F}]of r){if(U.length===0||U.includes(D)){F.alpha=1;continue}F.alpha=s.styles.nodeUnselectedAlpha}}function K(U){for(const[D,{element:F}]of t){const[Z,tt]=D.split("_");if(U.length===0||U.includes(Z)&&U.includes(tt)){F.alpha=1;continue}F.alpha=s.styles.nodeUnselectedAlpha}}function H(U){const D=$(U,"parents"),F=$(U,"children");return[U,...D,...F]}function $(U,D){const F=l==null?void 0:l.nodes.get(U);if(!F)return[];const Z=[];for(const{id:tt}of F[D])Z.push(tt),Z.push(...$(tt,D));return Z}return{element:e,stopWorker:d,getSize:P,render:c}}let Wo=null,Hr=null,Gs=null;async function mM(){const r=await te(),t=await Pt(),{element:e,render:i}=await Jb();r.addChild(e),e.alpha=0;const s=await Yg(t.runId,async n=>{const o=Hr?"runDataUpdated":"runDataCreated";Hr=n,q.emit(o,Hr),await ee(),i(n)});q.on("configUpdated",()=>{Hr&&i(Hr)}),Gs=e,Wo=s.stop,Gs.once("rendered",()=>yM()),q.on("layoutUpdated",()=>bM()),s.start()}function gM(){Wo==null||Wo(),Wo=null,Gs=null,Hr=null}async function gr(){return Hr||await Ie("runDataCreated")}function yM(){Md(),Te.shared.addOnce(()=>{Gs&&(Gs.alpha=1)})}async function bM(){if(!Gs)return;const r=await Pt();Gs.once("rendered",()=>{setTimeout(()=>{Md({animate:!0})},r.animationDuration)})}function xM(r){let t=0;for(const[,{children:e}]of r)t+=e.length;return t}function _M({start_time:r,end_time:t,nodes:e},i,s){const n=Math.max(lx(t??new Date,r),1),o=i.styles.nodeHeight+i.styles.rowGap,a=.5,h=4;return(e.size>0?e.size*o*a:o*h)*s/(n*20)}async function vM(){const r=await gr(),t=await Pt(),e=await Qt(),i=e.view.width/e.view.height,s=_M(r,t,i);qh(s,!0),r.nodes.size>t.disableAnimationsThreshold&&(et.disableAnimations=!0),xM(r.nodes)>t.disableEdgesThreshold&&(et.disableEdges=!0)}function wM(){et.horizontal="temporal",et.vertical="nearest-parent",et.horizontalScaleMultiplierDefault=0,et.horizontalScaleMultiplier=0,et.disableAnimations=!1,et.disableGuides=!1,et.disableEdges=!1,et.disableArtifacts=!1,et.disableEvents=!1}const et=z.reactive({horizontal:"temporal",vertical:"nearest-parent",horizontalScaleMultiplierDefault:0,horizontalScaleMultiplier:0,disableAnimations:!1,disableGuides:!1,disableEdges:!1,disableArtifacts:!1,disableEvents:!1,isTemporal(){return this.horizontal==="temporal"},isDependency(){return this.horizontal==="dependency"},isWaterfall(){return this.vertical==="waterfall"},isNearestParent(){return this.vertical==="nearest-parent"},isLeftAligned(){return this.horizontal==="left-aligned"}});async function ee(){return Ud()?et:await Ie("layoutSettingsCreated")}function Bd(){return et.isDependency()?200:20*et.horizontalScaleMultiplier}function TM(){return[0,Bd()]}function SM(r){if(et.isDependency())return[0,1];const t=r,e=ax(t,1);return[t,e]}function qh(r,t=!1){if(et.horizontalScaleMultiplier===r)return;const e=Pn();et.horizontalScaleMultiplier=r,t&&(et.horizontalScaleMultiplierDefault=r),e()}function EM(){qh(et.horizontalScaleMultiplierDefault)}function CM(r){if(et.horizontal===r)return;const t=Pn();et.horizontal=r,et.disableGuides=et.isDependency()||et.isLeftAligned(),t()}function IM(r){if(et.vertical===r)return;const t=Pn();et.vertical=r,t()}function AM(r){if(et.disableEdges===r)return;const t=Pn();et.disableEdges=r,t()}function RM(r){if(et.disableArtifacts===r)return;const t=Pn();et.disableArtifacts=r,t()}function MM(r){if(et.disableEvents===r)return;const t=Pn();et.disableEvents=r,t()}function Pn(){const r=Ud()?"layoutSettingsUpdated":"layoutSettingsCreated",{horizontal:t,vertical:e}=et;return()=>{Ud()&&q.emit(r,et),(t!==et.horizontal||e!==et.vertical)&&q.emit("layoutUpdated")}}function Ud(){return et.horizontalScaleMultiplier!==0}function $b(r){if(!(r instanceof HTMLElement))return!1;const t=r.tagName.toLowerCase();return["input","textarea"].includes(t)}const LM={class:"flex items-center gap-2"},PM=z.defineComponent({__name:"RunGraphSettings",setup(r){const t=[zi.positions.topRight,zi.positions.bottomRight,zi.positions.topLeft,zi.positions.bottomLeft],e=[{label:"Temporal dependency",value:"temporal_nearest-parent"},{label:"Temporal sequence",value:"temporal_waterfall"},{label:"Dependency grid",value:"dependency_nearest-parent"},{label:"Sequential grid",value:"dependency_waterfall"},{label:"Comparative duration",value:"left-aligned_duration-sorted"}],i=z.computed({get(){return`${et.horizontal}_${et.vertical}`},set(u){const[d,f]=u.split("_");CM(d),IM(f)}}),s=z.computed({get(){return et.disableEdges},set(u){AM(u)}}),n=z.computed({get(){return et.disableArtifacts},set(u){RM(u)}}),o=z.computed({get(){return et.disableEvents},set(u){MM(u)}});function a(){const d=et.horizontalScaleMultiplier*1.25;qh(d)}function h(){const u=Math.abs(-.75),d=et.horizontalScaleMultiplier*u;qh(d)}_r.useKeyDown(["-","="],l);function l(u){if(!($b(u.target)||u.metaKey||u.ctrlKey))switch(u.key){case"-":h();break;case"=":a();break}}function c(){EM()}return(u,d)=>{const f=z.resolveComponent("p-radio-group"),p=z.resolveComponent("p-label"),m=z.resolveComponent("p-divider"),g=z.resolveComponent("p-checkbox"),y=z.resolveComponent("p-overflow-menu");return z.openBlock(),z.createBlock(z.unref(zi.PPopOver),{class:"run-graph-settings","auto-close":"",placement:t},{target:z.withCtx(({toggle:x})=>[z.createVNode(z.unref(zi.PButton),{"aria-label":"Run Graph Options",icon:"CogIcon",flat:"",onClick:x},null,8,["onClick"])]),default:z.withCtx(()=>[z.createVNode(y,{class:"run-graph-settings__menu"},{default:z.withCtx(()=>[z.createVNode(p,{label:"Layout"},{default:z.withCtx(()=>[z.createVNode(f,{modelValue:i.value,"onUpdate:modelValue":d[0]||(d[0]=x=>i.value=x),options:e},{label:z.withCtx(({option:x})=>[z.createTextVNode(z.toDisplayString(x.label),1)]),_:1},8,["modelValue"])]),_:1}),z.unref(et).isTemporal()||z.unref(et).isLeftAligned()?(z.openBlock(),z.createElementBlock(z.Fragment,{key:0},[z.createVNode(m),z.createVNode(p,{label:"Scaling"},{default:z.withCtx(()=>[z.createElementVNode("div",LM,[z.createVNode(z.unref(zi.PButton),{title:"Decrease scale (-)",small:"",icon:"MinusIcon",onClick:h}),z.createVNode(z.unref(zi.PButton),{title:"Increase scale (+)",small:"",icon:"PlusIcon",onClick:a}),z.createVNode(z.unref(zi.PButton),{small:"",onClick:c},{default:z.withCtx(()=>[z.createTextVNode(" Reset ")]),_:1})])]),_:1})],64)):z.createCommentVNode("",!0),z.createVNode(m),z.createVNode(g,{modelValue:s.value,"onUpdate:modelValue":d[1]||(d[1]=x=>s.value=x),label:"Hide dependency arrows"},null,8,["modelValue"]),z.createVNode(g,{modelValue:n.value,"onUpdate:modelValue":d[2]||(d[2]=x=>n.value=x),label:"Hide artifacts"},null,8,["modelValue"]),z.createVNode(g,{modelValue:o.value,"onUpdate:modelValue":d[3]||(d[3]=x=>o.value=x),label:"Hide events"},null,8,["modelValue"])]),_:1})]),_:1})}}}),GM={class:"run-graph__actions"},FM=z.defineComponent({__name:"RunGraph",props:{config:{},viewport:{},fullscreen:{type:[Boolean,null],default:null},selected:{default:null}},emits:["update:viewport","update:fullscreen","update:selected"],setup(r,{emit:t}){const e=r,i=z.ref(),s=z.ref(!1),n=z.computed({get(){return e.fullscreen??s.value},set(c){s.value=c,t("update:fullscreen",c)}});z.watch(()=>e.selected,c=>Wi(c)),q.on("itemSelected",c=>t("update:selected",c)),z.watch(()=>e.viewport,c=>W2(c));const o=z.computed(()=>({root:{"run-graph--fullscreen":n.value}}));q.on("viewportDateRangeUpdated",c=>t("update:viewport",c));function a(){Md({animate:!0})}function h(){n.value=!n.value}z.onMounted(()=>{if(!i.value)throw new Error("Stage does not exist");oM({stage:i.value,props:e})}),z.onBeforeUnmount(()=>{aM()}),_r.useKeyDown(["c","f","Escape"],l);function l(c){if(!($b(c.target)||c.metaKey||c.ctrlKey))switch(c.key){case"c":a();break;case"f":h();break;case"Escape":n.value&&h();break}}return(c,u)=>{const d=z.resolveComponent("p-button");return z.openBlock(),z.createElementBlock("div",{class:z.normalizeClass(["run-graph",o.value.root])},[z.createElementVNode("div",{ref_key:"stage",ref:i,class:"run-graph__stage"},null,512),z.createElementVNode("div",GM,[z.createVNode(d,{title:"Recenter graph (c)",icon:"Target",flat:"",onClick:a}),z.createVNode(d,{title:"Toggle fullscreen (f)",icon:"ArrowsPointingOutIcon",flat:"",onClick:h}),z.createVNode(PM)])],2)}}});Ft.RunGraph=FM,Ft.artifactTypeIconMap=bb,Ft.artifactTypes=mR,Ft.isArtifactSelection=xb,Ft.isArtifactsSelection=_b,Ft.isEventSelection=wb,Ft.isEventsSelection=Tb,Ft.isNodeSelection=jh,Ft.isRunGraphNodeType=gR,Ft.isStateSelection=vb,Ft.runGraphNodeKinds=Dd,Ft.stateType=yR,Object.defineProperty(Ft,Symbol.toStringTag,{value:"Module"})});
1177
1177
  //# sourceMappingURL=graphs.umd.js.map